aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2012-11-18 15:47:18 -0800
committerSteve Kondik <shade@chemlab.org>2012-11-18 15:47:18 -0800
commita546c7006355a7bd1df4267ee53d0bfa2c017c8c (patch)
tree01be0bf6c0d6968e1468ec9661fd52110f9b05a7
parentbaf3d7830396202df5cc47bd7bcee109c319cdb3 (diff)
parent0f809250987b64f491bd3b4b73c0f0d33036a786 (diff)
downloadexternal_qemu-a546c7006355a7bd1df4267ee53d0bfa2c017c8c.zip
external_qemu-a546c7006355a7bd1df4267ee53d0bfa2c017c8c.tar.gz
external_qemu-a546c7006355a7bd1df4267ee53d0bfa2c017c8c.tar.bz2
Merge branch 'jb-mr1-release' of https://android.googlesource.com/platform/external/qemu into mr1-staging
Change-Id: I8a4a71ac65b08e6e17f26c942f67a15b85211115
-rw-r--r--.gitignore2
-rw-r--r--CleanSpec.mk3
-rw-r--r--INSTALL2
-rw-r--r--Makefile.android95
-rw-r--r--Makefile.common98
-rw-r--r--Makefile.target92
-rwxr-xr-xandroid-configure.sh41
-rw-r--r--android/adb-qemud.c44
-rw-r--r--android/android-device.c1526
-rw-r--r--android/android-device.h321
-rw-r--r--android/android.h7
-rw-r--r--android/async-socket-connector.c6
-rw-r--r--android/async-socket-connector.h2
-rw-r--r--android/async-socket.c54
-rw-r--r--android/async-socket.h8
-rw-r--r--android/avd/hardware-properties.ini4
-rw-r--r--android/avd/util.c2
-rw-r--r--android/build/common.sh12
-rwxr-xr-xandroid/camera/camera-capture-windows.c1
-rw-r--r--android/cmdline-options.h1
-rw-r--r--android/config/darwin-x86/config-host.h1
-rw-r--r--android/config/linux-x86/config-host.h1
-rw-r--r--android/config/target-mips/config.h5
-rw-r--r--android/config/windows/config-host.h1
-rw-r--r--android/help.c9
-rw-r--r--android/hw-events.h11
-rw-r--r--android/hw-pipe-net.c29
-rw-r--r--android/hw-sensors.c7
-rw-r--r--android/main-common.c2
-rw-r--r--android/main.c15
-rw-r--r--android/multitouch-port.c493
-rw-r--r--android/multitouch-port.h31
-rw-r--r--android/multitouch-screen.c99
-rw-r--r--android/multitouch-screen.h12
-rw-r--r--android/opengles.c220
-rw-r--r--android/opengles.h34
-rw-r--r--android/qemu-setup.c33
-rw-r--r--android/sdk-controller-socket.c996
-rw-r--r--android/sdk-controller-socket.h225
-rw-r--r--android/sensors-port.c654
-rw-r--r--android/sensors-port.h27
-rw-r--r--android/skin/scaler.c28
-rw-r--r--android/skin/window.c45
-rw-r--r--android/utils/path.c6
-rw-r--r--distrib/README10
-rwxr-xr-xdistrib/build-kernel.sh41
-rw-r--r--distrib/jpeg-6b/jddctmgr.c15
-rw-r--r--distrib/jpeg-6b/jdphuff.c4
-rw-r--r--distrib/jpeg-6b/jidctintelsse.c332
-rw-r--r--distrib/jpeg-6b/jmorecfg.h4
-rw-r--r--distrib/jpeg-6b/sources.make3
-rwxr-xr-xdistrib/kernel-toolchain/toolbox.sh20
-rw-r--r--distrib/libpng-1.2.19/sources.make3
-rw-r--r--distrib/sdl-1.2.12/CREDITS92
-rw-r--r--distrib/sdl-1.2.12/Makefile71
-rw-r--r--distrib/sdl-1.2.12/README.ANDROID9
-rwxr-xr-xdistrib/sdl-1.2.12/android-configure.sh553
-rw-r--r--distrib/sdl-1.2.12/include/SDL.h94
-rw-r--r--distrib/sdl-1.2.12/include/SDL_active.h58
-rw-r--r--distrib/sdl-1.2.12/include/SDL_audio.h253
-rw-r--r--distrib/sdl-1.2.12/include/SDL_byteorder.h24
-rw-r--r--distrib/sdl-1.2.12/include/SDL_cdrom.h171
-rw-r--r--distrib/sdl-1.2.12/include/SDL_config.h.default45
-rw-r--r--distrib/sdl-1.2.12/include/SDL_config.h.in305
-rw-r--r--distrib/sdl-1.2.12/include/SDL_config_amiga.h80
-rw-r--r--distrib/sdl-1.2.12/include/SDL_config_dreamcast.h106
-rw-r--r--distrib/sdl-1.2.12/include/SDL_config_macos.h112
-rw-r--r--distrib/sdl-1.2.12/include/SDL_config_macosx.h135
-rw-r--r--distrib/sdl-1.2.12/include/SDL_config_minimal.h62
-rw-r--r--distrib/sdl-1.2.12/include/SDL_config_os2.h141
-rw-r--r--distrib/sdl-1.2.12/include/SDL_config_win32.h180
-rw-r--r--distrib/sdl-1.2.12/include/SDL_copying.h22
-rw-r--r--distrib/sdl-1.2.12/include/SDL_cpuinfo.h75
-rw-r--r--distrib/sdl-1.2.12/include/SDL_endian.h194
-rw-r--r--distrib/sdl-1.2.12/include/SDL_error.h61
-rw-r--r--distrib/sdl-1.2.12/include/SDL_events.h337
-rw-r--r--distrib/sdl-1.2.12/include/SDL_getenv.h24
-rw-r--r--distrib/sdl-1.2.12/include/SDL_joystick.h167
-rw-r--r--distrib/sdl-1.2.12/include/SDL_keyboard.h121
-rw-r--r--distrib/sdl-1.2.12/include/SDL_keysym.h311
-rw-r--r--distrib/sdl-1.2.12/include/SDL_loadso.h74
-rw-r--r--distrib/sdl-1.2.12/include/SDL_main.h98
-rw-r--r--distrib/sdl-1.2.12/include/SDL_mouse.h136
-rw-r--r--distrib/sdl-1.2.12/include/SDL_mutex.h162
-rw-r--r--distrib/sdl-1.2.12/include/SDL_opengl.h6551
-rw-r--r--distrib/sdl-1.2.12/include/SDL_platform.h100
-rw-r--r--distrib/sdl-1.2.12/include/SDL_quit.h50
-rw-r--r--distrib/sdl-1.2.12/include/SDL_rwops.h144
-rw-r--r--distrib/sdl-1.2.12/include/SDL_stdinc.h594
-rw-r--r--distrib/sdl-1.2.12/include/SDL_syswm.h226
-rw-r--r--distrib/sdl-1.2.12/include/SDL_thread.h119
-rw-r--r--distrib/sdl-1.2.12/include/SDL_timer.h115
-rw-r--r--distrib/sdl-1.2.12/include/SDL_types.h24
-rw-r--r--distrib/sdl-1.2.12/include/SDL_version.h85
-rw-r--r--distrib/sdl-1.2.12/include/SDL_video.h922
-rw-r--r--distrib/sdl-1.2.12/include/begin_code.h156
-rw-r--r--distrib/sdl-1.2.12/include/close_code.h41
-rw-r--r--distrib/sdl-1.2.12/sources.make244
-rw-r--r--distrib/sdl-1.2.12/src/SDL.c350
-rw-r--r--distrib/sdl-1.2.12/src/SDL_error.c238
-rw-r--r--distrib/sdl-1.2.12/src/SDL_error_c.h58
-rw-r--r--distrib/sdl-1.2.12/src/SDL_fatal.c134
-rw-r--r--distrib/sdl-1.2.12/src/SDL_fatal.h28
-rw-r--r--distrib/sdl-1.2.12/src/audio/SDL_audio.c695
-rw-r--r--distrib/sdl-1.2.12/src/audio/SDL_audio_c.h34
-rw-r--r--distrib/sdl-1.2.12/src/audio/SDL_audiocvt.c1510
-rw-r--r--distrib/sdl-1.2.12/src/audio/SDL_audiodev.c179
-rw-r--r--distrib/sdl-1.2.12/src/audio/SDL_audiodev_c.h26
-rw-r--r--distrib/sdl-1.2.12/src/audio/SDL_audiomem.h25
-rw-r--r--distrib/sdl-1.2.12/src/audio/SDL_mixer.c258
-rw-r--r--distrib/sdl-1.2.12/src/audio/SDL_mixer_MMX.c206
-rw-r--r--distrib/sdl-1.2.12/src/audio/SDL_mixer_MMX.h15
-rw-r--r--distrib/sdl-1.2.12/src/audio/SDL_mixer_MMX_VC.c181
-rw-r--r--distrib/sdl-1.2.12/src/audio/SDL_mixer_MMX_VC.h36
-rw-r--r--distrib/sdl-1.2.12/src/audio/SDL_mixer_m68k.c211
-rw-r--r--distrib/sdl-1.2.12/src/audio/SDL_mixer_m68k.h36
-rw-r--r--distrib/sdl-1.2.12/src/audio/SDL_sysaudio.h184
-rw-r--r--distrib/sdl-1.2.12/src/audio/SDL_wave.c597
-rw-r--r--distrib/sdl-1.2.12/src/audio/SDL_wave.h62
-rw-r--r--distrib/sdl-1.2.12/src/audio/alsa/SDL_alsa_audio.c538
-rw-r--r--distrib/sdl-1.2.12/src/audio/alsa/SDL_alsa_audio.h54
-rw-r--r--distrib/sdl-1.2.12/src/audio/amigaos/SDL_ahiaudio.c337
-rw-r--r--distrib/sdl-1.2.12/src/audio/amigaos/SDL_ahiaudio.h60
-rw-r--r--distrib/sdl-1.2.12/src/audio/arts/SDL_artsaudio.c348
-rw-r--r--distrib/sdl-1.2.12/src/audio/arts/SDL_artsaudio.h60
-rw-r--r--distrib/sdl-1.2.12/src/audio/baudio/SDL_beaudio.cc225
-rw-r--r--distrib/sdl-1.2.12/src/audio/baudio/SDL_beaudio.h39
-rw-r--r--distrib/sdl-1.2.12/src/audio/bsd/SDL_bsdaudio.c404
-rw-r--r--distrib/sdl-1.2.12/src/audio/bsd/SDL_bsdaudio.h58
-rw-r--r--distrib/sdl-1.2.12/src/audio/dart/SDL_dart.c441
-rw-r--r--distrib/sdl-1.2.12/src/audio/dart/SDL_dart.h63
-rw-r--r--distrib/sdl-1.2.12/src/audio/dc/SDL_dcaudio.c246
-rw-r--r--distrib/sdl-1.2.12/src/audio/dc/SDL_dcaudio.h41
-rw-r--r--distrib/sdl-1.2.12/src/audio/dc/aica.h40
-rw-r--r--distrib/sdl-1.2.12/src/audio/disk/SDL_diskaudio.c186
-rw-r--r--distrib/sdl-1.2.12/src/audio/disk/SDL_diskaudio.h41
-rw-r--r--distrib/sdl-1.2.12/src/audio/dma/SDL_dmaaudio.c455
-rw-r--r--distrib/sdl-1.2.12/src/audio/dma/SDL_dmaaudio.h59
-rw-r--r--distrib/sdl-1.2.12/src/audio/dmedia/SDL_irixaudio.c242
-rw-r--r--distrib/sdl-1.2.12/src/audio/dmedia/SDL_irixaudio.h45
-rw-r--r--distrib/sdl-1.2.12/src/audio/dsp/SDL_dspaudio.c340
-rw-r--r--distrib/sdl-1.2.12/src/audio/dsp/SDL_dspaudio.h53
-rw-r--r--distrib/sdl-1.2.12/src/audio/dummy/SDL_dummyaudio.c156
-rw-r--r--distrib/sdl-1.2.12/src/audio/dummy/SDL_dummyaudio.h40
-rw-r--r--distrib/sdl-1.2.12/src/audio/esd/SDL_esdaudio.c323
-rw-r--r--distrib/sdl-1.2.12/src/audio/esd/SDL_esdaudio.h57
-rw-r--r--distrib/sdl-1.2.12/src/audio/macosx/SDL_coreaudio.c277
-rw-r--r--distrib/sdl-1.2.12/src/audio/macosx/SDL_coreaudio.h46
-rw-r--r--distrib/sdl-1.2.12/src/audio/macrom/SDL_romaudio.c496
-rw-r--r--distrib/sdl-1.2.12/src/audio/macrom/SDL_romaudio.h50
-rw-r--r--distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio.c215
-rw-r--r--distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio.h153
-rw-r--r--distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_dma8.c361
-rw-r--r--distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_dma8.h85
-rw-r--r--distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_gsxb.c436
-rw-r--r--distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_gsxb.h108
-rw-r--r--distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_it.S281
-rw-r--r--distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_mcsn.c404
-rw-r--r--distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_mcsn.h59
-rw-r--r--distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_stfa.c323
-rw-r--r--distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_stfa.h100
-rw-r--r--distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_xbios.c495
-rw-r--r--distrib/sdl-1.2.12/src/audio/mme/SDL_mmeaudio.c264
-rw-r--r--distrib/sdl-1.2.12/src/audio/mme/SDL_mmeaudio.h51
-rw-r--r--distrib/sdl-1.2.12/src/audio/nas/SDL_nasaudio.c299
-rw-r--r--distrib/sdl-1.2.12/src/audio/nas/SDL_nasaudio.h62
-rw-r--r--distrib/sdl-1.2.12/src/audio/nto/SDL_nto_audio.c507
-rw-r--r--distrib/sdl-1.2.12/src/audio/nto/SDL_nto_audio.h68
-rw-r--r--distrib/sdl-1.2.12/src/audio/paudio/SDL_paudio.c511
-rw-r--r--distrib/sdl-1.2.12/src/audio/paudio/SDL_paudio.h57
-rw-r--r--distrib/sdl-1.2.12/src/audio/sun/SDL_sunaudio.c432
-rw-r--r--distrib/sdl-1.2.12/src/audio/sun/SDL_sunaudio.h55
-rw-r--r--distrib/sdl-1.2.12/src/audio/ums/SDL_umsaudio.c547
-rw-r--r--distrib/sdl-1.2.12/src/audio/ums/SDL_umsaudio.h50
-rw-r--r--distrib/sdl-1.2.12/src/audio/windib/SDL_dibaudio.c343
-rw-r--r--distrib/sdl-1.2.12/src/audio/windib/SDL_dibaudio.h53
-rw-r--r--distrib/sdl-1.2.12/src/audio/windx5/SDL_dx5audio.c705
-rw-r--r--distrib/sdl-1.2.12/src/audio/windx5/SDL_dx5audio.h55
-rw-r--r--distrib/sdl-1.2.12/src/audio/windx5/directx.h84
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/SDL_cdrom.c341
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/SDL_syscdrom.h76
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/aix/SDL_syscdrom.c660
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/beos/SDL_syscdrom.cc412
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/bsdi/SDL_syscdrom.c542
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/dc/SDL_syscdrom.c167
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/dummy/SDL_syscdrom.c41
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/freebsd/SDL_syscdrom.c406
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/linux/SDL_syscdrom.c564
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/macos/SDL_syscdrom.c525
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/macos/SDL_syscdrom_c.h140
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/macosx/AudioFilePlayer.c354
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/macosx/AudioFilePlayer.h170
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/macosx/AudioFileReaderThread.c605
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/macosx/CDPlayer.c628
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/macosx/CDPlayer.h69
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/macosx/SDLOSXCAGuard.c199
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/macosx/SDLOSXCAGuard.h116
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/macosx/SDL_syscdrom.c505
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/macosx/SDL_syscdrom_c.h136
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/mint/SDL_syscdrom.c317
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/openbsd/SDL_syscdrom.c415
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/os2/SDL_syscdrom.c393
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/qnx/SDL_syscdrom.c551
-rw-r--r--distrib/sdl-1.2.12/src/cdrom/win32/SDL_syscdrom.c385
-rw-r--r--distrib/sdl-1.2.12/src/cpuinfo/SDL_cpuinfo.c446
-rw-r--r--distrib/sdl-1.2.12/src/events/SDL_active.c91
-rw-r--r--distrib/sdl-1.2.12/src/events/SDL_events.c500
-rw-r--r--distrib/sdl-1.2.12/src/events/SDL_events_c.h80
-rw-r--r--distrib/sdl-1.2.12/src/events/SDL_expose.c51
-rw-r--r--distrib/sdl-1.2.12/src/events/SDL_keyboard.c578
-rw-r--r--distrib/sdl-1.2.12/src/events/SDL_mouse.c263
-rw-r--r--distrib/sdl-1.2.12/src/events/SDL_quit.c92
-rw-r--r--distrib/sdl-1.2.12/src/events/SDL_resize.c75
-rw-r--r--distrib/sdl-1.2.12/src/events/SDL_sysevents.h46
-rw-r--r--distrib/sdl-1.2.12/src/file/SDL_rwops.c612
-rw-r--r--distrib/sdl-1.2.12/src/hermes/HeadMMX.h100
-rw-r--r--distrib/sdl-1.2.12/src/hermes/HeadX86.h186
-rw-r--r--distrib/sdl-1.2.12/src/hermes/mmx_main.asm74
-rw-r--r--distrib/sdl-1.2.12/src/hermes/mmxp2_32.asm405
-rw-r--r--distrib/sdl-1.2.12/src/hermes/x86_main.asm75
-rw-r--r--distrib/sdl-1.2.12/src/hermes/x86p_16.asm490
-rw-r--r--distrib/sdl-1.2.12/src/hermes/x86p_32.asm1045
-rw-r--r--distrib/sdl-1.2.12/src/joystick/SDL_joystick.c573
-rw-r--r--distrib/sdl-1.2.12/src/joystick/SDL_joystick_c.h38
-rw-r--r--distrib/sdl-1.2.12/src/joystick/SDL_sysjoystick.h82
-rw-r--r--distrib/sdl-1.2.12/src/joystick/amigaos/SDL_sysjoystick.c233
-rw-r--r--distrib/sdl-1.2.12/src/joystick/beos/SDL_bejoystick.cc237
-rw-r--r--distrib/sdl-1.2.12/src/joystick/bsd/SDL_sysjoystick.c591
-rw-r--r--distrib/sdl-1.2.12/src/joystick/darwin/SDL_sysjoystick.c841
-rw-r--r--distrib/sdl-1.2.12/src/joystick/dc/SDL_sysjoystick.c193
-rw-r--r--distrib/sdl-1.2.12/src/joystick/dummy/SDL_sysjoystick.c83
-rw-r--r--distrib/sdl-1.2.12/src/joystick/linux/SDL_sysjoystick.c1199
-rw-r--r--distrib/sdl-1.2.12/src/joystick/macos/SDL_sysjoystick.c320
-rw-r--r--distrib/sdl-1.2.12/src/joystick/mint/SDL_sysjoystick.c683
-rw-r--r--distrib/sdl-1.2.12/src/joystick/os2/SDL_sysjoystick.c668
-rw-r--r--distrib/sdl-1.2.12/src/joystick/os2/joyos2.h177
-rw-r--r--distrib/sdl-1.2.12/src/joystick/riscos/SDL_sysjoystick.c176
-rw-r--r--distrib/sdl-1.2.12/src/joystick/win32/SDL_mmjoystick.c405
-rw-r--r--distrib/sdl-1.2.12/src/loadso/beos/SDL_sysloadso.c72
-rw-r--r--distrib/sdl-1.2.12/src/loadso/dlopen/SDL_sysloadso.c69
-rw-r--r--distrib/sdl-1.2.12/src/loadso/dummy/SDL_sysloadso.c50
-rw-r--r--distrib/sdl-1.2.12/src/loadso/macos/SDL_sysloadso.c106
-rw-r--r--distrib/sdl-1.2.12/src/loadso/macosx/SDL_dlcompat.c1407
-rw-r--r--distrib/sdl-1.2.12/src/loadso/mint/SDL_sysloadso.c62
-rw-r--r--distrib/sdl-1.2.12/src/loadso/os2/SDL_sysloadso.c71
-rw-r--r--distrib/sdl-1.2.12/src/loadso/win32/SDL_sysloadso.c139
-rw-r--r--distrib/sdl-1.2.12/src/main/beos/SDL_BeApp.cc109
-rw-r--r--distrib/sdl-1.2.12/src/main/beos/SDL_BeApp.h33
-rw-r--r--distrib/sdl-1.2.12/src/main/epoc/SDL_main.cpp129
-rw-r--r--distrib/sdl-1.2.12/src/main/macos/SDL.r58
-rw-r--r--distrib/sdl-1.2.12/src/main/macos/SDL_main.c610
-rw-r--r--distrib/sdl-1.2.12/src/main/macos/SIZE.r24
-rw-r--r--distrib/sdl-1.2.12/src/main/macos/exports/Makefile34
-rw-r--r--distrib/sdl-1.2.12/src/main/macos/exports/SDL.x209
-rw-r--r--distrib/sdl-1.2.12/src/main/macos/exports/gendef.pl43
-rw-r--r--distrib/sdl-1.2.12/src/main/macosx/SDLMain.h11
-rw-r--r--distrib/sdl-1.2.12/src/main/macosx/SDLMain.m398
-rw-r--r--distrib/sdl-1.2.12/src/main/win32/SDL_win32_main.c357
-rw-r--r--distrib/sdl-1.2.12/src/main/win32/version.rc39
-rw-r--r--distrib/sdl-1.2.12/src/stdlib/SDL_getenv.c247
-rw-r--r--distrib/sdl-1.2.12/src/stdlib/SDL_iconv.c881
-rw-r--r--distrib/sdl-1.2.12/src/stdlib/SDL_malloc.c5111
-rw-r--r--distrib/sdl-1.2.12/src/stdlib/SDL_qsort.c425
-rw-r--r--distrib/sdl-1.2.12/src/stdlib/SDL_stdlib.c620
-rw-r--r--distrib/sdl-1.2.12/src/stdlib/SDL_string.c1248
-rw-r--r--distrib/sdl-1.2.12/src/thread/SDL_systhread.h52
-rw-r--r--distrib/sdl-1.2.12/src/thread/SDL_thread.c298
-rw-r--r--distrib/sdl-1.2.12/src/thread/SDL_thread_c.h64
-rw-r--r--distrib/sdl-1.2.12/src/thread/amigaos/SDL_syssem.c148
-rw-r--r--distrib/sdl-1.2.12/src/thread/amigaos/SDL_systhread.c151
-rw-r--r--distrib/sdl-1.2.12/src/thread/amigaos/SDL_systhread_c.h61
-rw-r--r--distrib/sdl-1.2.12/src/thread/amigaos/SDL_thread.c278
-rw-r--r--distrib/sdl-1.2.12/src/thread/beos/SDL_syssem.c142
-rw-r--r--distrib/sdl-1.2.12/src/thread/beos/SDL_systhread.c96
-rw-r--r--distrib/sdl-1.2.12/src/thread/beos/SDL_systhread_c.h31
-rw-r--r--distrib/sdl-1.2.12/src/thread/dc/SDL_syscond.c215
-rw-r--r--distrib/sdl-1.2.12/src/thread/dc/SDL_syscond_c.h23
-rw-r--r--distrib/sdl-1.2.12/src/thread/dc/SDL_sysmutex.c122
-rw-r--r--distrib/sdl-1.2.12/src/thread/dc/SDL_sysmutex_c.h23
-rw-r--r--distrib/sdl-1.2.12/src/thread/dc/SDL_syssem.c173
-rw-r--r--distrib/sdl-1.2.12/src/thread/dc/SDL_syssem_c.h23
-rw-r--r--distrib/sdl-1.2.12/src/thread/dc/SDL_systhread.c60
-rw-r--r--distrib/sdl-1.2.12/src/thread/dc/SDL_systhread_c.h24
-rw-r--r--distrib/sdl-1.2.12/src/thread/epoc/SDL_sysmutex.cpp105
-rw-r--r--distrib/sdl-1.2.12/src/thread/epoc/SDL_syssem.cpp193
-rw-r--r--distrib/sdl-1.2.12/src/thread/epoc/SDL_systhread.cpp124
-rw-r--r--distrib/sdl-1.2.12/src/thread/epoc/SDL_systhread_c.h31
-rw-r--r--distrib/sdl-1.2.12/src/thread/generic/SDL_syscond.c215
-rw-r--r--distrib/sdl-1.2.12/src/thread/generic/SDL_sysmutex.c129
-rw-r--r--distrib/sdl-1.2.12/src/thread/generic/SDL_sysmutex_c.h23
-rw-r--r--distrib/sdl-1.2.12/src/thread/generic/SDL_syssem.c209
-rw-r--r--distrib/sdl-1.2.12/src/thread/generic/SDL_systhread.c54
-rw-r--r--distrib/sdl-1.2.12/src/thread/generic/SDL_systhread_c.h25
-rw-r--r--distrib/sdl-1.2.12/src/thread/irix/SDL_syssem.c219
-rw-r--r--distrib/sdl-1.2.12/src/thread/irix/SDL_systhread.c85
-rw-r--r--distrib/sdl-1.2.12/src/thread/irix/SDL_systhread_c.h27
-rw-r--r--distrib/sdl-1.2.12/src/thread/os2/SDL_syscond.c215
-rw-r--r--distrib/sdl-1.2.12/src/thread/os2/SDL_syscond_c.h23
-rw-r--r--distrib/sdl-1.2.12/src/thread/os2/SDL_sysmutex.c108
-rw-r--r--distrib/sdl-1.2.12/src/thread/os2/SDL_syssem.c192
-rw-r--r--distrib/sdl-1.2.12/src/thread/os2/SDL_systhread.c108
-rw-r--r--distrib/sdl-1.2.12/src/thread/os2/SDL_systhread_c.h28
-rw-r--r--distrib/sdl-1.2.12/src/thread/pth/SDL_syscond.c164
-rw-r--r--distrib/sdl-1.2.12/src/thread/pth/SDL_sysmutex.c87
-rw-r--r--distrib/sdl-1.2.12/src/thread/pth/SDL_sysmutex_c.h31
-rw-r--r--distrib/sdl-1.2.12/src/thread/pth/SDL_systhread.c103
-rw-r--r--distrib/sdl-1.2.12/src/thread/pth/SDL_systhread_c.h31
-rw-r--r--distrib/sdl-1.2.12/src/thread/pthread/SDL_syscond.c155
-rw-r--r--distrib/sdl-1.2.12/src/thread/pthread/SDL_sysmutex.c153
-rw-r--r--distrib/sdl-1.2.12/src/thread/pthread/SDL_sysmutex_c.h31
-rw-r--r--distrib/sdl-1.2.12/src/thread/pthread/SDL_syssem.c156
-rw-r--r--distrib/sdl-1.2.12/src/thread/pthread/SDL_systhread.c120
-rw-r--r--distrib/sdl-1.2.12/src/thread/pthread/SDL_systhread_c.h26
-rw-r--r--distrib/sdl-1.2.12/src/thread/riscos/SDL_syscond.c160
-rw-r--r--distrib/sdl-1.2.12/src/thread/riscos/SDL_sysmutex.c153
-rw-r--r--distrib/sdl-1.2.12/src/thread/riscos/SDL_sysmutex_c.h34
-rw-r--r--distrib/sdl-1.2.12/src/thread/riscos/SDL_syssem.c203
-rw-r--r--distrib/sdl-1.2.12/src/thread/riscos/SDL_systhread.c144
-rw-r--r--distrib/sdl-1.2.12/src/thread/riscos/SDL_systhread_c.h34
-rw-r--r--distrib/sdl-1.2.12/src/thread/win32/SDL_sysmutex.c95
-rw-r--r--distrib/sdl-1.2.12/src/thread/win32/SDL_syssem.c164
-rw-r--r--distrib/sdl-1.2.12/src/thread/win32/SDL_systhread.c150
-rw-r--r--distrib/sdl-1.2.12/src/thread/win32/SDL_systhread_c.h28
-rw-r--r--distrib/sdl-1.2.12/src/timer/SDL_systimer.h40
-rw-r--r--distrib/sdl-1.2.12/src/timer/SDL_timer.c285
-rw-r--r--distrib/sdl-1.2.12/src/timer/SDL_timer_c.h46
-rw-r--r--distrib/sdl-1.2.12/src/timer/amigaos/SDL_systimer.c267
-rw-r--r--distrib/sdl-1.2.12/src/timer/beos/SDL_systimer.c95
-rw-r--r--distrib/sdl-1.2.12/src/timer/dc/SDL_systimer.c100
-rw-r--r--distrib/sdl-1.2.12/src/timer/dummy/SDL_systimer.c91
-rw-r--r--distrib/sdl-1.2.12/src/timer/epoc/SDL_systimer.cpp116
-rw-r--r--distrib/sdl-1.2.12/src/timer/macos/FastTimes.c352
-rw-r--r--distrib/sdl-1.2.12/src/timer/macos/FastTimes.h27
-rw-r--r--distrib/sdl-1.2.12/src/timer/macos/SDL_MPWtimer.c152
-rw-r--r--distrib/sdl-1.2.12/src/timer/macos/SDL_systimer.c186
-rw-r--r--distrib/sdl-1.2.12/src/timer/mint/SDL_systimer.c147
-rw-r--r--distrib/sdl-1.2.12/src/timer/mint/SDL_vbltimer.S159
-rw-r--r--distrib/sdl-1.2.12/src/timer/mint/SDL_vbltimer_s.h35
-rw-r--r--distrib/sdl-1.2.12/src/timer/os2/SDL_systimer.c227
-rw-r--r--distrib/sdl-1.2.12/src/timer/riscos/SDL_systimer.c233
-rw-r--r--distrib/sdl-1.2.12/src/timer/unix/SDL_systimer.c240
-rw-r--r--distrib/sdl-1.2.12/src/timer/win32/SDL_systimer.c160
-rw-r--r--distrib/sdl-1.2.12/src/timer/wince/SDL_systimer.c198
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_RLEaccel.c1943
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_RLEaccel_c.h31
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_blit.c360
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_blit.h541
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_blit_0.c471
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_blit_1.c523
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_blit_A.c2872
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_blit_N.c2490
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_bmp.c520
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_cursor.c758
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_cursor_c.h73
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_gamma.c233
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_leaks.h31
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_pixels.c625
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_pixels_c.h46
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_stretch.c334
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_stretch_c.h29
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_surface.c941
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_sysvideo.h433
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_video.c2009
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_yuv.c150
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_yuv_mmx.c428
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_yuv_sw.c1298
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_yuv_sw_c.h37
-rw-r--r--distrib/sdl-1.2.12/src/video/SDL_yuvfuncs.h37
-rw-r--r--distrib/sdl-1.2.12/src/video/Xext/XME/xme.c405
-rw-r--r--distrib/sdl-1.2.12/src/video/Xext/Xinerama/Xinerama.c319
-rw-r--r--distrib/sdl-1.2.12/src/video/Xext/Xv/Xvlibint.h76
-rw-r--r--distrib/sdl-1.2.12/src/video/Xext/Xxf86dga/XF86DGA.c716
-rw-r--r--distrib/sdl-1.2.12/src/video/Xext/Xxf86dga/XF86DGA2.c988
-rw-r--r--distrib/sdl-1.2.12/src/video/Xext/Xxf86vm/XF86VMode.c1223
-rw-r--r--distrib/sdl-1.2.12/src/video/aalib/SDL_aaevents.c202
-rw-r--r--distrib/sdl-1.2.12/src/video/aalib/SDL_aaevents_c.h35
-rw-r--r--distrib/sdl-1.2.12/src/video/aalib/SDL_aamouse.c35
-rw-r--r--distrib/sdl-1.2.12/src/video/aalib/SDL_aamouse_c.h26
-rw-r--r--distrib/sdl-1.2.12/src/video/aalib/SDL_aavideo.c388
-rw-r--r--distrib/sdl-1.2.12/src/video/aalib/SDL_aavideo.h66
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_ataric2p.S447
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_ataric2p_s.h75
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_ataridevmouse.c159
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_ataridevmouse_c.h42
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarieddi.S42
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarieddi_s.h54
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarievents.c239
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarievents_c.h65
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarigl.c1088
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarigl_c.h109
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarikeys.h140
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarimxalloc.c52
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarimxalloc_c.h45
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_biosevents.c131
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_biosevents_c.h42
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_gemdosevents.c137
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_gemdosevents_c.h42
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_ikbdevents.c126
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_ikbdevents_c.h42
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_ikbdinterrupt.S260
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_ikbdinterrupt_s.h61
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_xbiosevents.c154
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_xbiosevents_c.h48
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_xbiosinterrupt.S172
-rw-r--r--distrib/sdl-1.2.12/src/video/ataricommon/SDL_xbiosinterrupt_s.h52
-rw-r--r--distrib/sdl-1.2.12/src/video/blank_cursor.h33
-rw-r--r--distrib/sdl-1.2.12/src/video/bwindow/SDL_BView.h116
-rw-r--r--distrib/sdl-1.2.12/src/video/bwindow/SDL_BWin.h282
-rw-r--r--distrib/sdl-1.2.12/src/video/bwindow/SDL_lowvideo.h58
-rw-r--r--distrib/sdl-1.2.12/src/video/bwindow/SDL_sysevents.cc381
-rw-r--r--distrib/sdl-1.2.12/src/video/bwindow/SDL_sysevents_c.h31
-rw-r--r--distrib/sdl-1.2.12/src/video/bwindow/SDL_sysmouse.cc153
-rw-r--r--distrib/sdl-1.2.12/src/video/bwindow/SDL_sysmouse_c.h33
-rw-r--r--distrib/sdl-1.2.12/src/video/bwindow/SDL_sysvideo.cc829
-rw-r--r--distrib/sdl-1.2.12/src/video/bwindow/SDL_syswm.cc91
-rw-r--r--distrib/sdl-1.2.12/src/video/bwindow/SDL_syswm_c.h32
-rw-r--r--distrib/sdl-1.2.12/src/video/bwindow/SDL_sysyuv.cc314
-rw-r--r--distrib/sdl-1.2.12/src/video/bwindow/SDL_sysyuv.h73
-rw-r--r--distrib/sdl-1.2.12/src/video/cybergfx/SDL_amigaevents.c535
-rw-r--r--distrib/sdl-1.2.12/src/video/cybergfx/SDL_amigaevents_c.h29
-rw-r--r--distrib/sdl-1.2.12/src/video/cybergfx/SDL_amigamouse.c77
-rw-r--r--distrib/sdl-1.2.12/src/video/cybergfx/SDL_amigamouse_c.h32
-rw-r--r--distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxaccel.c262
-rw-r--r--distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxgl.c212
-rw-r--r--distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxgl_c.h51
-rw-r--r--distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgximage.c906
-rw-r--r--distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgximage_c.h36
-rw-r--r--distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxmodes.c316
-rw-r--r--distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxmodes_c.h45
-rw-r--r--distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxvideo.c1375
-rw-r--r--distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxvideo.h172
-rw-r--r--distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxwm.c63
-rw-r--r--distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxwm_c.h33
-rw-r--r--distrib/sdl-1.2.12/src/video/dc/SDL_dcevents.c152
-rw-r--r--distrib/sdl-1.2.12/src/video/dc/SDL_dcevents_c.h33
-rw-r--r--distrib/sdl-1.2.12/src/video/dc/SDL_dcmouse.c35
-rw-r--r--distrib/sdl-1.2.12/src/video/dc/SDL_dcmouse_c.h26
-rw-r--r--distrib/sdl-1.2.12/src/video/dc/SDL_dcvideo.c445
-rw-r--r--distrib/sdl-1.2.12/src/video/dc/SDL_dcvideo.h42
-rw-r--r--distrib/sdl-1.2.12/src/video/default_cursor.h116
-rw-r--r--distrib/sdl-1.2.12/src/video/dga/SDL_dgaevents.c150
-rw-r--r--distrib/sdl-1.2.12/src/video/dga/SDL_dgaevents_c.h28
-rw-r--r--distrib/sdl-1.2.12/src/video/dga/SDL_dgamouse.c35
-rw-r--r--distrib/sdl-1.2.12/src/video/dga/SDL_dgamouse_c.h26
-rw-r--r--distrib/sdl-1.2.12/src/video/dga/SDL_dgavideo.c1100
-rw-r--r--distrib/sdl-1.2.12/src/video/dga/SDL_dgavideo.h123
-rw-r--r--distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_events.c210
-rw-r--r--distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_events.h29
-rw-r--r--distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_video.c1171
-rw-r--r--distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_video.h62
-rw-r--r--distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_yuv.c290
-rw-r--r--distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_yuv.h38
-rw-r--r--distrib/sdl-1.2.12/src/video/dummy/SDL_nullevents.c45
-rw-r--r--distrib/sdl-1.2.12/src/video/dummy/SDL_nullevents_c.h33
-rw-r--r--distrib/sdl-1.2.12/src/video/dummy/SDL_nullmouse.c33
-rw-r--r--distrib/sdl-1.2.12/src/video/dummy/SDL_nullmouse_c.h26
-rw-r--r--distrib/sdl-1.2.12/src/video/dummy/SDL_nullvideo.c239
-rw-r--r--distrib/sdl-1.2.12/src/video/dummy/SDL_nullvideo.h40
-rw-r--r--distrib/sdl-1.2.12/src/video/epoc/SDL_epocevents.cpp419
-rw-r--r--distrib/sdl-1.2.12/src/video/epoc/SDL_epocevents_c.h46
-rw-r--r--distrib/sdl-1.2.12/src/video/epoc/SDL_epocvideo.cpp697
-rw-r--r--distrib/sdl-1.2.12/src/video/epoc/SDL_epocvideo.h90
-rw-r--r--distrib/sdl-1.2.12/src/video/fbcon/3dfx_mmio.h56
-rw-r--r--distrib/sdl-1.2.12/src/video/fbcon/3dfx_regs.h83
-rw-r--r--distrib/sdl-1.2.12/src/video/fbcon/SDL_fb3dfx.c217
-rw-r--r--distrib/sdl-1.2.12/src/video/fbcon/SDL_fb3dfx.h29
-rw-r--r--distrib/sdl-1.2.12/src/video/fbcon/SDL_fbelo.c442
-rw-r--r--distrib/sdl-1.2.12/src/video/fbcon/SDL_fbelo.h55
-rw-r--r--distrib/sdl-1.2.12/src/video/fbcon/SDL_fbevents.c1245
-rw-r--r--distrib/sdl-1.2.12/src/video/fbcon/SDL_fbevents_c.h38
-rw-r--r--distrib/sdl-1.2.12/src/video/fbcon/SDL_fbmatrox.c280
-rw-r--r--distrib/sdl-1.2.12/src/video/fbcon/SDL_fbmatrox.h29
-rw-r--r--distrib/sdl-1.2.12/src/video/fbcon/SDL_fbmouse.c33
-rw-r--r--distrib/sdl-1.2.12/src/video/fbcon/SDL_fbmouse_c.h26
-rw-r--r--distrib/sdl-1.2.12/src/video/fbcon/SDL_fbriva.c222
-rw-r--r--distrib/sdl-1.2.12/src/video/fbcon/SDL_fbriva.h36
-rw-r--r--distrib/sdl-1.2.12/src/video/fbcon/SDL_fbvideo.c1701
-rw-r--r--distrib/sdl-1.2.12/src/video/fbcon/SDL_fbvideo.h182
-rw-r--r--distrib/sdl-1.2.12/src/video/fbcon/matrox_mmio.h51
-rw-r--r--distrib/sdl-1.2.12/src/video/fbcon/out29
-rw-r--r--distrib/sdl-1.2.12/src/video/fbcon/riva_regs.h43
-rw-r--r--distrib/sdl-1.2.12/src/video/gapi/SDL_gapivideo.c1232
-rw-r--r--distrib/sdl-1.2.12/src/video/gapi/SDL_gapivideo.h162
-rw-r--r--distrib/sdl-1.2.12/src/video/gem/SDL_gemevents.c370
-rw-r--r--distrib/sdl-1.2.12/src/video/gem/SDL_gemevents_c.h33
-rw-r--r--distrib/sdl-1.2.12/src/video/gem/SDL_gemmouse.c204
-rw-r--r--distrib/sdl-1.2.12/src/video/gem/SDL_gemmouse_c.h34
-rw-r--r--distrib/sdl-1.2.12/src/video/gem/SDL_gemvideo.c1340
-rw-r--r--distrib/sdl-1.2.12/src/video/gem/SDL_gemvideo.h191
-rw-r--r--distrib/sdl-1.2.12/src/video/gem/SDL_gemwm.c116
-rw-r--r--distrib/sdl-1.2.12/src/video/gem/SDL_gemwm_c.h37
-rw-r--r--distrib/sdl-1.2.12/src/video/ggi/SDL_ggievents.c264
-rwxr-xr-xdistrib/sdl-1.2.12/src/video/ggi/SDL_ggievents_c.h29
-rw-r--r--distrib/sdl-1.2.12/src/video/ggi/SDL_ggimouse.c32
-rwxr-xr-xdistrib/sdl-1.2.12/src/video/ggi/SDL_ggimouse_c.h26
-rw-r--r--distrib/sdl-1.2.12/src/video/ggi/SDL_ggivideo.c378
-rw-r--r--distrib/sdl-1.2.12/src/video/ggi/SDL_ggivideo.h48
-rw-r--r--distrib/sdl-1.2.12/src/video/ipod/SDL_ipodvideo.c733
-rw-r--r--distrib/sdl-1.2.12/src/video/ipod/SDL_ipodvideo.h38
-rw-r--r--distrib/sdl-1.2.12/src/video/maccommon/SDL_lowvideo.h102
-rw-r--r--distrib/sdl-1.2.12/src/video/maccommon/SDL_macevents.c746
-rw-r--r--distrib/sdl-1.2.12/src/video/maccommon/SDL_macevents_c.h32
-rw-r--r--distrib/sdl-1.2.12/src/video/maccommon/SDL_macgl.c197
-rw-r--r--distrib/sdl-1.2.12/src/video/maccommon/SDL_macgl_c.h47
-rw-r--r--distrib/sdl-1.2.12/src/video/maccommon/SDL_mackeys.h140
-rw-r--r--distrib/sdl-1.2.12/src/video/maccommon/SDL_macmouse.c129
-rw-r--r--distrib/sdl-1.2.12/src/video/maccommon/SDL_macmouse_c.h34
-rw-r--r--distrib/sdl-1.2.12/src/video/maccommon/SDL_macwm.c442
-rw-r--r--distrib/sdl-1.2.12/src/video/maccommon/SDL_macwm_c.h41
-rw-r--r--distrib/sdl-1.2.12/src/video/macdsp/SDL_dspvideo.c1422
-rw-r--r--distrib/sdl-1.2.12/src/video/macdsp/SDL_dspvideo.h54
-rw-r--r--distrib/sdl-1.2.12/src/video/macrom/SDL_romvideo.c745
-rw-r--r--distrib/sdl-1.2.12/src/video/macrom/SDL_romvideo.h29
-rw-r--r--distrib/sdl-1.2.12/src/video/math_private.h173
-rw-r--r--distrib/sdl-1.2.12/src/video/mmx.h704
-rw-r--r--distrib/sdl-1.2.12/src/video/nanox/SDL_nxevents.c382
-rw-r--r--distrib/sdl-1.2.12/src/video/nanox/SDL_nxevents_c.h32
-rw-r--r--distrib/sdl-1.2.12/src/video/nanox/SDL_nximage.c230
-rw-r--r--distrib/sdl-1.2.12/src/video/nanox/SDL_nximage_c.h35
-rw-r--r--distrib/sdl-1.2.12/src/video/nanox/SDL_nxmodes.c84
-rw-r--r--distrib/sdl-1.2.12/src/video/nanox/SDL_nxmodes_c.h34
-rw-r--r--distrib/sdl-1.2.12/src/video/nanox/SDL_nxmouse.c79
-rw-r--r--distrib/sdl-1.2.12/src/video/nanox/SDL_nxmouse_c.h29
-rw-r--r--distrib/sdl-1.2.12/src/video/nanox/SDL_nxvideo.c544
-rw-r--r--distrib/sdl-1.2.12/src/video/nanox/SDL_nxvideo.h96
-rw-r--r--distrib/sdl-1.2.12/src/video/nanox/SDL_nxwm.c61
-rw-r--r--distrib/sdl-1.2.12/src/video/nanox/SDL_nxwm_c.h32
-rw-r--r--distrib/sdl-1.2.12/src/video/os2fslib/SDL_os2fslib.c3018
-rw-r--r--distrib/sdl-1.2.12/src/video/os2fslib/SDL_os2fslib.h71
-rw-r--r--distrib/sdl-1.2.12/src/video/os2fslib/SDL_vkeys.h74
-rw-r--r--distrib/sdl-1.2.12/src/video/photon/SDL_ph_events.c624
-rw-r--r--distrib/sdl-1.2.12/src/video/photon/SDL_ph_events_c.h37
-rw-r--r--distrib/sdl-1.2.12/src/video/photon/SDL_ph_gl.c406
-rw-r--r--distrib/sdl-1.2.12/src/video/photon/SDL_ph_gl.h41
-rw-r--r--distrib/sdl-1.2.12/src/video/photon/SDL_ph_image.c1059
-rw-r--r--distrib/sdl-1.2.12/src/video/photon/SDL_ph_image_c.h59
-rw-r--r--distrib/sdl-1.2.12/src/video/photon/SDL_ph_modes.c390
-rw-r--r--distrib/sdl-1.2.12/src/video/photon/SDL_ph_modes_c.h43
-rw-r--r--distrib/sdl-1.2.12/src/video/photon/SDL_ph_mouse.c220
-rw-r--r--distrib/sdl-1.2.12/src/video/photon/SDL_ph_mouse_c.h39
-rw-r--r--distrib/sdl-1.2.12/src/video/photon/SDL_ph_video.c648
-rw-r--r--distrib/sdl-1.2.12/src/video/photon/SDL_ph_video.h157
-rw-r--r--distrib/sdl-1.2.12/src/video/photon/SDL_ph_wm.c118
-rw-r--r--distrib/sdl-1.2.12/src/video/photon/SDL_ph_wm_c.h37
-rw-r--r--distrib/sdl-1.2.12/src/video/photon/SDL_phyuv.c504
-rw-r--r--distrib/sdl-1.2.12/src/video/photon/SDL_phyuv_c.h62
-rw-r--r--distrib/sdl-1.2.12/src/video/picogui/SDL_pgevents.c117
-rw-r--r--distrib/sdl-1.2.12/src/video/picogui/SDL_pgevents_c.h37
-rw-r--r--distrib/sdl-1.2.12/src/video/picogui/SDL_pgvideo.c364
-rw-r--r--distrib/sdl-1.2.12/src/video/picogui/SDL_pgvideo.h50
-rw-r--r--distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsevents.c977
-rw-r--r--distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsevents_c.h38
-rw-r--r--distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsmouse.c146
-rw-r--r--distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsmouse_c.h37
-rw-r--r--distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsvideo.c689
-rw-r--r--distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsvideo.h95
-rw-r--r--distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsyuv.c461
-rw-r--r--distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsyuv_c.h37
-rw-r--r--distrib/sdl-1.2.12/src/video/qtopia/SDL_QPEApp.cc63
-rw-r--r--distrib/sdl-1.2.12/src/video/qtopia/SDL_QPEApp.h33
-rw-r--r--distrib/sdl-1.2.12/src/video/qtopia/SDL_QWin.cc527
-rw-r--r--distrib/sdl-1.2.12/src/video/qtopia/SDL_QWin.h110
-rw-r--r--distrib/sdl-1.2.12/src/video/qtopia/SDL_lowvideo.h65
-rw-r--r--distrib/sdl-1.2.12/src/video/qtopia/SDL_sysevents.cc269
-rw-r--r--distrib/sdl-1.2.12/src/video/qtopia/SDL_sysevents_c.h31
-rw-r--r--distrib/sdl-1.2.12/src/video/qtopia/SDL_sysmouse.cc56
-rw-r--r--distrib/sdl-1.2.12/src/video/qtopia/SDL_sysmouse_c.h32
-rw-r--r--distrib/sdl-1.2.12/src/video/qtopia/SDL_sysvideo.cc403
-rw-r--r--distrib/sdl-1.2.12/src/video/qtopia/SDL_syswm.cc35
-rw-r--r--distrib/sdl-1.2.12/src/video/qtopia/SDL_syswm_c.h28
-rw-r--r--distrib/sdl-1.2.12/src/video/quartz/CGS.h84
-rw-r--r--distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzEvents.m984
-rw-r--r--distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzGL.m281
-rw-r--r--distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzKeys.h146
-rw-r--r--distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzVideo.h237
-rw-r--r--distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzVideo.m1691
-rw-r--r--distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzWM.h28
-rw-r--r--distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzWM.m574
-rw-r--r--distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzWindow.h43
-rw-r--r--distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzWindow.m232
-rw-r--r--distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzYUV.m330
-rw-r--r--distrib/sdl-1.2.12/src/video/riscos/SDL_riscosASM.S116
-rw-r--r--distrib/sdl-1.2.12/src/video/riscos/SDL_riscosFullScreenVideo.c777
-rw-r--r--distrib/sdl-1.2.12/src/video/riscos/SDL_riscosevents.c549
-rw-r--r--distrib/sdl-1.2.12/src/video/riscos/SDL_riscosevents_c.h34
-rw-r--r--distrib/sdl-1.2.12/src/video/riscos/SDL_riscosmouse.c371
-rw-r--r--distrib/sdl-1.2.12/src/video/riscos/SDL_riscosmouse_c.h44
-rw-r--r--distrib/sdl-1.2.12/src/video/riscos/SDL_riscossprite.c265
-rw-r--r--distrib/sdl-1.2.12/src/video/riscos/SDL_riscostask.c350
-rw-r--r--distrib/sdl-1.2.12/src/video/riscos/SDL_riscostask.h39
-rw-r--r--distrib/sdl-1.2.12/src/video/riscos/SDL_riscosvideo.c316
-rw-r--r--distrib/sdl-1.2.12/src/video/riscos/SDL_riscosvideo.h62
-rw-r--r--distrib/sdl-1.2.12/src/video/riscos/SDL_wimppoll.c330
-rw-r--r--distrib/sdl-1.2.12/src/video/riscos/SDL_wimpvideo.c501
-rw-r--r--distrib/sdl-1.2.12/src/video/svga/SDL_svgaevents.c412
-rw-r--r--distrib/sdl-1.2.12/src/video/svga/SDL_svgaevents_c.h35
-rw-r--r--distrib/sdl-1.2.12/src/video/svga/SDL_svgamouse.c33
-rw-r--r--distrib/sdl-1.2.12/src/video/svga/SDL_svgamouse_c.h26
-rw-r--r--distrib/sdl-1.2.12/src/video/svga/SDL_svgavideo.c584
-rw-r--r--distrib/sdl-1.2.12/src/video/svga/SDL_svgavideo.h58
-rw-r--r--distrib/sdl-1.2.12/src/video/vgl/SDL_vglevents.c299
-rw-r--r--distrib/sdl-1.2.12/src/video/vgl/SDL_vglevents_c.h155
-rw-r--r--distrib/sdl-1.2.12/src/video/vgl/SDL_vglmouse.c56
-rw-r--r--distrib/sdl-1.2.12/src/video/vgl/SDL_vglmouse_c.h32
-rw-r--r--distrib/sdl-1.2.12/src/video/vgl/SDL_vglvideo.c640
-rw-r--r--distrib/sdl-1.2.12/src/video/vgl/SDL_vglvideo.h65
-rw-r--r--distrib/sdl-1.2.12/src/video/wincommon/SDL_lowvideo.h139
-rw-r--r--distrib/sdl-1.2.12/src/video/wincommon/SDL_sysevents.c924
-rw-r--r--distrib/sdl-1.2.12/src/video/wincommon/SDL_sysmouse.c260
-rw-r--r--distrib/sdl-1.2.12/src/video/wincommon/SDL_sysmouse_c.h33
-rw-r--r--distrib/sdl-1.2.12/src/video/wincommon/SDL_syswm.c321
-rw-r--r--distrib/sdl-1.2.12/src/video/wincommon/SDL_syswm_c.h35
-rw-r--r--distrib/sdl-1.2.12/src/video/wincommon/SDL_wingl.c647
-rw-r--r--distrib/sdl-1.2.12/src/video/wincommon/SDL_wingl_c.h135
-rw-r--r--distrib/sdl-1.2.12/src/video/windib/SDL_dibevents.c591
-rw-r--r--distrib/sdl-1.2.12/src/video/windib/SDL_dibevents_c.h35
-rw-r--r--distrib/sdl-1.2.12/src/video/windib/SDL_dibvideo.c1422
-rw-r--r--distrib/sdl-1.2.12/src/video/windib/SDL_dibvideo.h68
-rw-r--r--distrib/sdl-1.2.12/src/video/windib/SDL_vkeys.h75
-rw-r--r--distrib/sdl-1.2.12/src/video/windx5/SDL_dx5events.c923
-rw-r--r--distrib/sdl-1.2.12/src/video/windx5/SDL_dx5events_c.h37
-rw-r--r--distrib/sdl-1.2.12/src/video/windx5/SDL_dx5video.c2518
-rw-r--r--distrib/sdl-1.2.12/src/video/windx5/SDL_dx5video.h61
-rw-r--r--distrib/sdl-1.2.12/src/video/windx5/SDL_dx5yuv.c295
-rw-r--r--distrib/sdl-1.2.12/src/video/windx5/SDL_dx5yuv_c.h38
-rw-r--r--distrib/sdl-1.2.12/src/video/windx5/directx.h84
-rw-r--r--distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsevents.c233
-rw-r--r--distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsevents_c.h36
-rw-r--r--distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsmouse.c33
-rw-r--r--distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsmouse_c.h26
-rw-r--r--distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsvideo.c609
-rw-r--r--distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsvideo.h76
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11dga.c90
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11dga_c.h33
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11dyn.c193
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11dyn.h87
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11events.c1453
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11events_c.h33
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11gamma.c142
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11gamma_c.h32
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11gl.c552
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11gl_c.h99
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11image.c318
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11image_c.h38
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11modes.c1110
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11modes_c.h43
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11mouse.c284
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11mouse_c.h33
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11sym.h215
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11video.c1558
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11video.h223
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11wm.c619
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11wm_c.h38
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11yuv.c413
-rw-r--r--distrib/sdl-1.2.12/src/video/x11/SDL_x11yuv_c.h41
-rw-r--r--distrib/sdl-1.2.12/src/video/xbios/SDL_xbios.c953
-rw-r--r--distrib/sdl-1.2.12/src/video/xbios/SDL_xbios.h131
-rw-r--r--distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_blowup.c70
-rw-r--r--distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_blowup.h86
-rw-r--r--distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_centscreen.c103
-rw-r--r--distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_centscreen.h118
-rw-r--r--distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_sb3.c86
-rw-r--r--distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_sb3.h82
-rw-r--r--distrib/sdl-1.2.15/BUGS (renamed from distrib/sdl-1.2.12/BUGS)0
-rw-r--r--distrib/sdl-1.2.15/Borland.html139
-rw-r--r--distrib/sdl-1.2.15/Borland.zipbin0 -> 157899 bytes
-rw-r--r--distrib/sdl-1.2.15/COPYING (renamed from distrib/sdl-1.2.12/COPYING)0
-rw-r--r--distrib/sdl-1.2.15/CREDITS94
-rw-r--r--distrib/sdl-1.2.15/CWprojects.sea.binbin0 -> 476160 bytes
-rw-r--r--distrib/sdl-1.2.15/INSTALL23
-rw-r--r--distrib/sdl-1.2.15/MPWmake.sea.binbin0 -> 22144 bytes
-rw-r--r--distrib/sdl-1.2.15/Makefile71
-rw-r--r--distrib/sdl-1.2.15/Makefile.android (renamed from distrib/sdl-1.2.12/Makefile.android)0
-rw-r--r--distrib/sdl-1.2.15/Makefile.dc111
-rw-r--r--distrib/sdl-1.2.15/Makefile.ds63
-rw-r--r--distrib/sdl-1.2.15/Makefile.in178
-rw-r--r--distrib/sdl-1.2.15/Makefile.minimal42
-rw-r--r--distrib/sdl-1.2.15/README (renamed from distrib/sdl-1.2.12/README)0
-rw-r--r--distrib/sdl-1.2.15/README-SDL.txt13
-rw-r--r--distrib/sdl-1.2.15/README.ANDROID9
-rw-r--r--distrib/sdl-1.2.15/README.AmigaOS12
-rw-r--r--distrib/sdl-1.2.15/README.BeOS13
-rw-r--r--distrib/sdl-1.2.15/README.DC32
-rw-r--r--distrib/sdl-1.2.15/README.HG23
-rw-r--r--distrib/sdl-1.2.15/README.MacOS63
-rw-r--r--distrib/sdl-1.2.15/README.MacOSX179
-rw-r--r--distrib/sdl-1.2.15/README.MiNT250
-rw-r--r--distrib/sdl-1.2.15/README.NDS22
-rw-r--r--distrib/sdl-1.2.15/README.NanoX97
-rw-r--r--distrib/sdl-1.2.15/README.OS2281
-rw-r--r--distrib/sdl-1.2.15/README.PS329
-rw-r--r--distrib/sdl-1.2.15/README.PicoGUI50
-rw-r--r--distrib/sdl-1.2.15/README.Porting56
-rw-r--r--distrib/sdl-1.2.15/README.QNX155
-rw-r--r--distrib/sdl-1.2.15/README.Qtopia84
-rw-r--r--distrib/sdl-1.2.15/README.RISCOS130
-rw-r--r--distrib/sdl-1.2.15/README.Symbian23
-rw-r--r--distrib/sdl-1.2.15/README.Watcom133
-rw-r--r--distrib/sdl-1.2.15/README.WinCE55
-rw-r--r--distrib/sdl-1.2.15/README.wscons107
-rw-r--r--distrib/sdl-1.2.15/SDL.qpg.in141
-rw-r--r--distrib/sdl-1.2.15/SDL.spec.in113
-rw-r--r--distrib/sdl-1.2.15/TODO25
-rw-r--r--distrib/sdl-1.2.15/VisualC.html159
-rw-r--r--distrib/sdl-1.2.15/VisualC/SDL.dsw41
-rw-r--r--distrib/sdl-1.2.15/VisualC/SDL.sln45
-rw-r--r--distrib/sdl-1.2.15/VisualC/SDL/SDL.dsp546
-rw-r--r--distrib/sdl-1.2.15/VisualC/SDL/SDL.vcproj828
-rw-r--r--distrib/sdl-1.2.15/VisualC/SDL/Version.rc105
-rw-r--r--distrib/sdl-1.2.15/VisualC/SDL/resource.h15
-rw-r--r--distrib/sdl-1.2.15/VisualC/SDLmain/SDLmain.dsp106
-rw-r--r--distrib/sdl-1.2.15/VisualC/SDLmain/SDLmain.vcproj422
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/graywin/graywin.dsp102
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/graywin/graywin.vcproj217
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/loopwave/loopwave.dsp102
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/loopwave/loopwave.vcproj217
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/testalpha/testalpha.dsp102
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/testalpha/testalpha.vcproj217
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/testfile/testfile.dsp102
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/testfile/testfile.vcproj217
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/testgamma/testgamma.dsp102
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/testgamma/testgamma.vcproj217
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/testgl/testgl.dsp102
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/testgl/testgl.vcproj219
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/testjoystick/testjoystick.dsp102
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/testjoystick/testjoystick.vcproj217
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/testpalette/testpalette.dsp102
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/testpalette/testpalette.vcproj217
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/testplatform/testplatform.dsp102
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/testplatform/testplatform.vcproj239
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/tests.dsw161
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/tests.sln85
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/testvidinfo/testvidinfo.dsp102
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/testvidinfo/testvidinfo.vcproj217
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/testwin/testwin.dsp102
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/testwin/testwin.vcproj217
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/testwm/testwm.dsp102
-rw-r--r--distrib/sdl-1.2.15/VisualC/tests/testwm/testwm.vcproj217
-rw-r--r--distrib/sdl-1.2.15/VisualCE/SDL.sln149
-rw-r--r--distrib/sdl-1.2.15/VisualCE/SDL.vcw116
-rw-r--r--distrib/sdl-1.2.15/VisualCE/SDL/SDL.vcp42066
-rw-r--r--distrib/sdl-1.2.15/VisualCE/SDL/SDL.vcproj3967
-rw-r--r--distrib/sdl-1.2.15/VisualCE/SDLMain/SDLmain.vcp1653
-rw-r--r--distrib/sdl-1.2.15/VisualCE/SDLMain/SDLmain.vcproj603
-rw-r--r--distrib/sdl-1.2.15/VisualCE/loopwave/loopwave.vcp562
-rw-r--r--distrib/sdl-1.2.15/VisualCE/loopwave/loopwave.vcproj374
-rw-r--r--distrib/sdl-1.2.15/VisualCE/testalpha/testalpha.vcp698
-rw-r--r--distrib/sdl-1.2.15/VisualCE/testalpha/testalpha.vcproj710
-rw-r--r--distrib/sdl-1.2.15/VisualCE/testtimer/testtimer.vcp874
-rw-r--r--distrib/sdl-1.2.15/VisualCE/testtimer/testtimer.vcproj372
-rw-r--r--distrib/sdl-1.2.15/VisualCE/testwin/testwin.vcp672
-rw-r--r--distrib/sdl-1.2.15/VisualCE/testwin/testwin.vcproj702
-rw-r--r--distrib/sdl-1.2.15/Watcom-OS2.zipbin0 -> 63088 bytes
-rw-r--r--distrib/sdl-1.2.15/Watcom-Win32.zipbin0 -> 3709 bytes
-rw-r--r--distrib/sdl-1.2.15/WhatsNew727
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDL/Info-Framework.plist28
-rwxr-xr-xdistrib/sdl-1.2.15/Xcode/SDL/SDL.xcodeproj/project.pbxproj1961
-rwxr-xr-xdistrib/sdl-1.2.15/Xcode/SDL/pkg-support/Readme SDL Developer.txt282
-rwxr-xr-xdistrib/sdl-1.2.15/Xcode/SDL/pkg-support/SDL-devel.info15
-rwxr-xr-xdistrib/sdl-1.2.15/Xcode/SDL/pkg-support/SDL.info15
-rwxr-xr-xdistrib/sdl-1.2.15/Xcode/SDL/pkg-support/devel-resources/ReadMe.txt5
-rwxr-xr-xdistrib/sdl-1.2.15/Xcode/SDL/pkg-support/devel-resources/Welcome.txt5
-rwxr-xr-xdistrib/sdl-1.2.15/Xcode/SDL/pkg-support/devel-resources/install.sh76
-rwxr-xr-xdistrib/sdl-1.2.15/Xcode/SDL/pkg-support/resources/License.rtf283
-rwxr-xr-xdistrib/sdl-1.2.15/Xcode/SDL/pkg-support/resources/ReadMe.txt171
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDL/pkg-support/resources/ReadMeDevLite.txt12
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDL/pkg-support/resources/SDL_DS_Storebin0 -> 12292 bytes
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDL/pkg-support/resources/UniversalBinaryNotes.rtf150
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDL/pkg-support/sdl_logo.pdfbin0 -> 163800 bytes
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-checkkeys__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-graywin__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-loopwave__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-test.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testalpha__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testbitmap__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testblitspeed.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testcdrom__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testdyngl.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testerror__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testfile.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testgamma__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testgl__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testiconv.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testjoystick__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testkeys__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testlock__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testoverlay2.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testoverlay__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testpalette__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testplatform.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testsem__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testsprite__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testthread__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testtimer__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testtypes__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testversion__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testvidinfo__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testwin__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-testwm__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-threadwin__Upgraded_.plist32
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/Info-torturethread__Upgraded_.plist32
-rwxr-xr-xdistrib/sdl-1.2.15/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj4514
-rw-r--r--distrib/sdl-1.2.15/Xcode/SDLTest/libsdlmain_prefix.h13
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/English.lproj/InfoPlist.stringsbin0 -> 644 bytes
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/Info.plist37
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/SDLMain.h16
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/SDLMain.m383
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch9
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icnsbin0 -> 111234 bytes
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist12
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/project.pbxproj308
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/main.c65
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/InfoPlist.stringsbin0 -> 644 bytes
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/classes.nib19
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/info.nib21
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/objects.nibbin0 -> 2590 bytes
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/Info.plist37
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/SDLMain.h16
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/SDLMain.m383
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch9
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icnsbin0 -> 111234 bytes
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist12
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/project.pbxproj320
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/main.c65
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/English.lproj/InfoPlist.stringsbin0 -> 644 bytes
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/Info.plist37
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/SDLMain.h16
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/SDLMain.m383
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch9
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icnsbin0 -> 111234 bytes
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist12
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/project.pbxproj350
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/atlantis.c459
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/atlantis.h65
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/dolphin.c1934
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/shark.c1308
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/swim.c188
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/whale.c1798
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/main.c179
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/English.lproj/InfoPlist.stringsbin0 -> 644 bytes
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/Info.plist37
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/SDLMain.h16
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/SDLMain.m383
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch9
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icnsbin0 -> 111234 bytes
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist12
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/project.pbxproj310
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/main.c65
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/InfoPlist.stringsbin0 -> 644 bytes
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/classes.nib19
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/info.nib21
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/objects.nibbin0 -> 2590 bytes
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/Info.plist37
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLMain.h16
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLMain.m383
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch9
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icnsbin0 -> 111234 bytes
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist12
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/project.pbxproj322
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/main.c65
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/English.lproj/InfoPlist.stringsbin0 -> 644 bytes
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/Info.plist37
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/SDLMain.h16
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/SDLMain.m383
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch9
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icnsbin0 -> 111234 bytes
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist12
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/project.pbxproj352
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/atlantis.c459
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/atlantis.h65
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/dolphin.c1934
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/shark.c1308
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/swim.c188
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/whale.c1798
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/main.c179
-rwxr-xr-xdistrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/English.lproj/InfoPlist.stringsbin0 -> 588 bytes
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/Info.plist28
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp.xcodeproj/TemplateInfo.plist12
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp.xcodeproj/project.pbxproj324
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp_Prefix.pch9
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/SDLMain.h16
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/SDLMain.m383
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/main.c65
-rwxr-xr-xdistrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/InfoPlist.stringsbin0 -> 588 bytes
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/SDLMain.nib/classes.nib19
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/SDLMain.nib/info.nib21
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/SDLMain.nib/objects.nibbin0 -> 2590 bytes
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/Info.plist28
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLApp_Prefix.pch9
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLCocoaApp.xcodeproj/TemplateInfo.plist12
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLCocoaApp.xcodeproj/project.pbxproj336
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLMain.h16
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLMain.m383
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/main.c65
-rwxr-xr-xdistrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/English.lproj/InfoPlist.stringsbin0 -> 588 bytes
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/Info.plist28
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLApp_Prefix.pch9
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLMain.h16
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLMain.m383
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLOpenGLApp.xcodeproj/TemplateInfo.plist12
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLOpenGLApp.xcodeproj/project.pbxproj362
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/atlantis.c459
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/atlantis.h65
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/dolphin.c1934
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/shark.c1308
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/swim.c188
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/whale.c1798
-rw-r--r--distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/main.c179
-rw-r--r--distrib/sdl-1.2.15/Xcode/XcodeDocSet/Doxyfile1558
-rwxr-xr-xdistrib/sdl-1.2.15/Xcode/mkxcode.csh20
-rwxr-xr-xdistrib/sdl-1.2.15/Xcode/package272
-rwxr-xr-xdistrib/sdl-1.2.15/Xcode/stationary.csh25
-rwxr-xr-xdistrib/sdl-1.2.15/Xcode/uninstall.csh32
-rw-r--r--distrib/sdl-1.2.15/acinclude/alsa.m4145
-rw-r--r--distrib/sdl-1.2.15/acinclude/esd.m4168
-rw-r--r--distrib/sdl-1.2.15/acinclude/libtool.m47370
-rw-r--r--distrib/sdl-1.2.15/acinclude/ltdl.m4806
-rw-r--r--distrib/sdl-1.2.15/acinclude/ltoptions.m4370
-rw-r--r--distrib/sdl-1.2.15/acinclude/ltsugar.m4125
-rw-r--r--distrib/sdl-1.2.15/acinclude/ltversion.m425
-rw-r--r--distrib/sdl-1.2.15/acinclude/lt~obsolete.m493
-rwxr-xr-xdistrib/sdl-1.2.15/android-configure.sh553
-rwxr-xr-xdistrib/sdl-1.2.15/autogen.sh19
-rwxr-xr-xdistrib/sdl-1.2.15/build-scripts/config.guess1494
-rwxr-xr-xdistrib/sdl-1.2.15/build-scripts/config.sub1700
-rwxr-xr-xdistrib/sdl-1.2.15/build-scripts/fatbuild.sh310
-rwxr-xr-xdistrib/sdl-1.2.15/build-scripts/install-sh323
-rw-r--r--distrib/sdl-1.2.15/build-scripts/ltmain.sh8407
-rwxr-xr-xdistrib/sdl-1.2.15/build-scripts/makedep.sh93
-rwxr-xr-xdistrib/sdl-1.2.15/build-scripts/mkinstalldirs99
-rwxr-xr-xdistrib/sdl-1.2.15/build-scripts/strip_fPIC.sh21
-rw-r--r--distrib/sdl-1.2.15/configure.in2965
-rw-r--r--distrib/sdl-1.2.15/docs.html698
-rw-r--r--distrib/sdl-1.2.15/docs/html/audio.html242
-rw-r--r--distrib/sdl-1.2.15/docs/html/cdrom.html260
-rw-r--r--distrib/sdl-1.2.15/docs/html/event.html216
-rw-r--r--distrib/sdl-1.2.15/docs/html/eventfunctions.html481
-rw-r--r--distrib/sdl-1.2.15/docs/html/eventstructures.html233
-rw-r--r--distrib/sdl-1.2.15/docs/html/general.html225
-rw-r--r--distrib/sdl-1.2.15/docs/html/guide.html174
-rw-r--r--distrib/sdl-1.2.15/docs/html/guideaboutsdldoc.html148
-rw-r--r--distrib/sdl-1.2.15/docs/html/guideaudioexamples.html228
-rw-r--r--distrib/sdl-1.2.15/docs/html/guidebasicsinit.html240
-rw-r--r--distrib/sdl-1.2.15/docs/html/guidecdromexamples.html275
-rw-r--r--distrib/sdl-1.2.15/docs/html/guidecredits.html195
-rw-r--r--distrib/sdl-1.2.15/docs/html/guideeventexamples.html247
-rw-r--r--distrib/sdl-1.2.15/docs/html/guideexamples.html188
-rw-r--r--distrib/sdl-1.2.15/docs/html/guideinput.html739
-rw-r--r--distrib/sdl-1.2.15/docs/html/guideinputkeyboard.html746
-rw-r--r--distrib/sdl-1.2.15/docs/html/guidepreface.html178
-rw-r--r--distrib/sdl-1.2.15/docs/html/guidethebasics.html173
-rw-r--r--distrib/sdl-1.2.15/docs/html/guidetimeexamples.html183
-rw-r--r--distrib/sdl-1.2.15/docs/html/guidevideo.html463
-rw-r--r--distrib/sdl-1.2.15/docs/html/guidevideoopengl.html730
-rw-r--r--distrib/sdl-1.2.15/docs/html/index.html1156
-rw-r--r--distrib/sdl-1.2.15/docs/html/joystick.html296
-rw-r--r--distrib/sdl-1.2.15/docs/html/reference.html194
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlactiveevent.html335
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdladdtimer.html296
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlaudiocvt.html556
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlaudiospec.html589
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlblitsurface.html339
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlbuildaudiocvt.html291
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcd.html359
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcdclose.html217
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcdeject.html226
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcdname.html239
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcdnumdrives.html205
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcdopen.html275
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcdpause.html233
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcdplay.html243
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcdplaytracks.html325
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcdresume.html233
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcdstatus.html273
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcdstop.html226
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcdtrack.html313
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcloseaudio.html205
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcolor.html300
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcondbroadcast.html224
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcondsignal.html224
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcondwait.html231
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcondwaittimeout.html230
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlconvertaudio.html407
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlconvertsurface.html271
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcreatecond.html240
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcreatecursor.html398
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcreatemutex.html249
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcreatergbsurface.html458
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcreatergbsurfacefrom.html256
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcreatesemaphore.html303
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcreatethread.html223
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlcreateyuvoverlay.html256
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdldelay.html231
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdldestroycond.html206
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdldestroymutex.html209
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdldestroysemaphore.html278
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdldisplayformat.html262
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdldisplayformatalpha.html250
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdldisplayyuvoverlay.html246
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlenablekeyrepeat.html238
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlenableunicode.html252
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlenvvars.html1227
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlevent.html994
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdleventstate.html276
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlexposeevent.html252
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlfillrect.html291
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlflip.html259
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlfreecursor.html209
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlfreesurface.html219
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlfreewav.html222
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlfreeyuvoverlay.html233
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlgetappstate.html263
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlgetaudiostatus.html221
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlgetcliprect.html229
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlgetcursor.html219
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlgeterror.html205
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlgeteventfilter.html235
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlgetgammaramp.html219
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlgetkeyname.html216
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlgetkeystate.html253
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlgetmodstate.html257
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlgetmousestate.html253
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlgetrelativemousestate.html235
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlgetrgb.html231
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlgetrgba.html222
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlgetthreadid.html209
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlgetticks.html206
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlgetvideoinfo.html226
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlgetvideosurface.html208
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlglattr.html379
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlglgetattribute.html247
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlglgetprocaddress.html262
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlglloadlibrary.html231
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlglsetattribute.html286
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlglswapbuffers.html212
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlinit.html368
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlinitsubsystem.html283
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdljoyaxisevent.html330
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdljoyballevent.html340
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdljoybuttonevent.html351
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdljoyhatevent.html413
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdljoystickclose.html223
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdljoystickeventstate.html290
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdljoystickgetaxis.html271
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdljoystickgetball.html262
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdljoystickgetbutton.html231
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdljoystickgethat.html297
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdljoystickindex.html218
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdljoystickname.html238
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdljoysticknumaxes.html225
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdljoysticknumballs.html225
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdljoysticknumbuttons.html225
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdljoysticknumhats.html225
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdljoystickopen.html259
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdljoystickopened.html233
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdljoystickupdate.html211
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlkey.html2630
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlkeyboardevent.html375
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlkeysym.html355
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlkillthread.html223
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdllistmodes.html310
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlloadbmp.html219
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlloadwav.html296
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdllockaudio.html208
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdllocksurface.html306
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdllockyuvoverlay.html252
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlmaprgb.html254
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlmaprgba.html242
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlmixaudio.html237
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlmousebuttonevent.html346
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlmousemotionevent.html365
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlmutexp.html241
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlmutexv.html235
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlnumjoysticks.html222
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlopenaudio.html578
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdloverlay.html362
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlpalette.html301
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlpauseaudio.html221
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlpeepevents.html321
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlpixelformat.html528
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlpollevent.html269
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlpumpevents.html244
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlpushevent.html266
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlquit.html244
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlquitevent.html263
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlquitsubsystem.html248
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlrect.html258
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlremovetimer.html236
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlresizeevent.html307
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlsavebmp.html236
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlsempost.html299
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlsemtrywait.html319
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlsemvalue.html273
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlsemwait.html298
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlsemwaittimeout.html322
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlsetalpha.html500
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlsetcliprect.html241
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlsetcolorkey.html321
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlsetcolors.html358
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlsetcursor.html222
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlseteventfilter.html284
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlsetgamma.html231
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlsetgammaramp.html230
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlsetmodstate.html237
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlsetpalette.html352
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlsettimer.html267
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlsetvideomode.html558
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlshowcursor.html239
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlsurface.html597
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlsyswmevent.html233
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlthreadid.html190
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlunlockaudio.html211
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlunlocksurface.html219
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlunlockyuvoverlay.html225
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlupdaterect.html266
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlupdaterects.html255
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdluserevent.html337
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlvideodrivername.html243
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlvideoinfo.html408
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlvideomodeok.html270
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlwaitevent.html231
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlwaitthread.html231
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlwarpmouse.html205
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlwasinit.html284
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlwmgetcaption.html222
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlwmgrabinput.html224
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlwmiconifywindow.html211
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlwmsetcaption.html212
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlwmseticon.html260
-rw-r--r--distrib/sdl-1.2.15/docs/html/sdlwmtogglefullscreen.html205
-rw-r--r--distrib/sdl-1.2.15/docs/html/thread.html313
-rw-r--r--distrib/sdl-1.2.15/docs/html/time.html206
-rw-r--r--distrib/sdl-1.2.15/docs/html/video.html507
-rw-r--r--distrib/sdl-1.2.15/docs/html/wm.html188
-rw-r--r--distrib/sdl-1.2.15/docs/images/rainbow.gifbin0 -> 1715 bytes
-rw-r--r--distrib/sdl-1.2.15/docs/index.html55
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDLKey.3161
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_ActiveEvent.338
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_AddTimer.338
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_AudioCVT.368
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_AudioSpec.370
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_BlitSurface.360
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_BuildAudioCVT.323
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CD.357
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CDClose.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CDEject.318
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CDName.323
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CDNumDrives.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CDOpen.358
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CDPause.318
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CDPlay.318
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CDPlayTracks.347
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CDResume.318
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CDStatus.359
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CDStop.318
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CDtrack.340
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CloseAudio.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_Color.334
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CondBroadcast.316
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CondSignal.316
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CondWait.316
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CondWaitTimeout.316
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_ConvertAudio.395
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_ConvertSurface.324
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CreateCond.331
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CreateCursor.3120
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CreateMutex.343
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CreateRGBSurface.369
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CreateRGBSurfaceFrom.322
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CreateSemaphore.332
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CreateThread.316
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_CreateYUVOverlay.317
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_Delay.321
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_DestroyCond.316
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_DestroyMutex.316
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_DestroySemaphore.326
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_DisplayFormat.322
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_DisplayFormatAlpha.322
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_DisplayYUVOverlay.318
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_EnableKeyRepeat.317
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_EnableUNICODE.324
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_Event.3182
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_EventState.323
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_ExposeEvent.324
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_FillRect.322
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_Flip.320
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_FreeCursor.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_FreeSurface.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_FreeWAV.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_FreeYUVOverlay.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GL_GetAttribute.318
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GL_GetProcAddress.348
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GL_LoadLibrary.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GL_SetAttribute.340
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GL_SwapBuffers.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GLattr.347
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GetAppState.324
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GetAudioStatus.324
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GetClipRect.317
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GetCursor.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GetError.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GetEventFilter.323
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GetGamma.321
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GetGammaRamp.320
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GetKeyName.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GetKeyState.330
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GetModState.354
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GetMouseState.324
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GetRGB.317
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GetRGBA.319
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GetRelativeMouseState.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GetThreadID.316
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GetTicks.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GetVideoInfo.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_GetVideoSurface.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_Init.341
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_InitSubSystem.341
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_JoyAxisEvent.336
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_JoyBallEvent.336
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_JoyButtonEvent.336
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_JoyHatEvent.356
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_JoystickClose.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_JoystickEventState.324
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_JoystickGetAxis.332
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_JoystickGetBall.337
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_JoystickGetButton.318
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_JoystickGetHat.336
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_JoystickIndex.318
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_JoystickName.332
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_JoystickNumAxes.318
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_JoystickNumBalls.318
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_JoystickNumButtons.318
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_JoystickNumHats.318
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_JoystickOpen.351
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_JoystickOpened.318
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_JoystickUpdate.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_KeyboardEvent.338
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_KillThread.316
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_ListModes.353
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_LoadBMP.318
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_LoadWAV.342
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_LockAudio.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_LockSurface.348
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_LockYUVOverlay.318
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_MapRGB.322
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_MapRGBA.322
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_MixAudio.321
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_MouseButtonEvent.336
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_MouseMotionEvent.338
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_NumJoysticks.318
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_OpenAudio.397
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_Overlay.352
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_Palette.326
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_PauseAudio.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_PeepEvents.326
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_PixelFormat.3140
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_PollEvent.344
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_PumpEvents.323
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_PushEvent.327
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_Quit.329
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_QuitEvent.330
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_QuitSubSystem.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_RWFromFile.318
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_Rect.326
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_RemoveTimer.325
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_ResizeEvent.328
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_SaveBMP.318
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_SemPost.328
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_SemTryWait.341
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_SemValue.326
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_SemWait.334
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_SemWaitTimeout.341
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_SetAlpha.366
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_SetClipRect.319
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_SetColorKey.326
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_SetColors.357
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_SetCursor.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_SetEventFilter.335
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_SetGamma.322
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_SetGammaRamp.322
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_SetModState.335
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_SetPalette.359
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_SetTimer.339
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_SetVideoMode.367
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_ShowCursor.320
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_Surface.396
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_SysWMEvent.321
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_ThreadID.313
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_UnlockAudio.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_UnlockSurface.317
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_UnlockYUVOverlay.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_UpdateRect.319
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_UpdateRects.325
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_UserEvent.347
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_VideoDriverName.318
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_VideoInfo.362
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_VideoModeOK.344
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_WM_GetCaption.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_WM_GrabInput.328
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_WM_IconifyWindow.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_WM_SetCaption.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_WM_SetIcon.327
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_WM_ToggleFullScreen.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_WaitEvent.317
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_WaitThread.319
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_WarpMouse.315
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_WasInit.363
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_keysym.369
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_mutexP.318
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_mutexV.318
-rw-r--r--distrib/sdl-1.2.15/include/SDL.h101
-rw-r--r--distrib/sdl-1.2.15/include/SDL_active.h63
-rw-r--r--distrib/sdl-1.2.15/include/SDL_audio.h284
-rw-r--r--distrib/sdl-1.2.15/include/SDL_byteorder.h29
-rw-r--r--distrib/sdl-1.2.15/include/SDL_cdrom.h202
-rw-r--r--distrib/sdl-1.2.15/include/SDL_config.h.default45
-rw-r--r--distrib/sdl-1.2.15/include/SDL_config.h.in312
-rw-r--r--distrib/sdl-1.2.15/include/SDL_config_dreamcast.h106
-rw-r--r--distrib/sdl-1.2.15/include/SDL_config_macos.h112
-rw-r--r--distrib/sdl-1.2.15/include/SDL_config_macosx.h150
-rw-r--r--distrib/sdl-1.2.15/include/SDL_config_minimal.h62
-rw-r--r--distrib/sdl-1.2.15/include/SDL_config_nds.h115
-rw-r--r--distrib/sdl-1.2.15/include/SDL_config_os2.h141
-rw-r--r--distrib/sdl-1.2.15/include/SDL_config_symbian.h146
-rw-r--r--distrib/sdl-1.2.15/include/SDL_config_win32.h183
-rw-r--r--distrib/sdl-1.2.15/include/SDL_copying.h22
-rw-r--r--distrib/sdl-1.2.15/include/SDL_cpuinfo.h69
-rw-r--r--distrib/sdl-1.2.15/include/SDL_endian.h214
-rw-r--r--distrib/sdl-1.2.15/include/SDL_error.h72
-rw-r--r--distrib/sdl-1.2.15/include/SDL_events.h356
-rw-r--r--distrib/sdl-1.2.15/include/SDL_getenv.h28
-rw-r--r--distrib/sdl-1.2.15/include/SDL_joystick.h187
-rw-r--r--distrib/sdl-1.2.15/include/SDL_keyboard.h135
-rw-r--r--distrib/sdl-1.2.15/include/SDL_keysym.h326
-rw-r--r--distrib/sdl-1.2.15/include/SDL_loadso.h78
-rw-r--r--distrib/sdl-1.2.15/include/SDL_main.h106
-rw-r--r--distrib/sdl-1.2.15/include/SDL_mouse.h143
-rw-r--r--distrib/sdl-1.2.15/include/SDL_mutex.h177
-rw-r--r--distrib/sdl-1.2.15/include/SDL_name.h (renamed from distrib/sdl-1.2.12/include/SDL_name.h)0
-rw-r--r--distrib/sdl-1.2.15/include/SDL_opengl.h6570
-rw-r--r--distrib/sdl-1.2.15/include/SDL_platform.h110
-rw-r--r--distrib/sdl-1.2.15/include/SDL_quit.h55
-rw-r--r--distrib/sdl-1.2.15/include/SDL_rwops.h155
-rw-r--r--distrib/sdl-1.2.15/include/SDL_stdinc.h620
-rw-r--r--distrib/sdl-1.2.15/include/SDL_syswm.h238
-rw-r--r--distrib/sdl-1.2.15/include/SDL_thread.h115
-rw-r--r--distrib/sdl-1.2.15/include/SDL_timer.h125
-rw-r--r--distrib/sdl-1.2.15/include/SDL_types.h28
-rw-r--r--distrib/sdl-1.2.15/include/SDL_version.h91
-rw-r--r--distrib/sdl-1.2.15/include/SDL_video.h981
-rw-r--r--distrib/sdl-1.2.15/include/begin_code.h196
-rw-r--r--distrib/sdl-1.2.15/include/close_code.h46
-rw-r--r--distrib/sdl-1.2.15/include/doxyfile946
-rw-r--r--distrib/sdl-1.2.15/sdl-config.in (renamed from distrib/sdl-1.2.12/sdl-config.in)0
-rw-r--r--distrib/sdl-1.2.15/sdl.m4185
-rw-r--r--distrib/sdl-1.2.15/sdl.pc.in15
-rw-r--r--distrib/sdl-1.2.15/sources.make243
-rw-r--r--distrib/sdl-1.2.15/src/SDL.c350
-rw-r--r--distrib/sdl-1.2.15/src/SDL_error.c238
-rw-r--r--distrib/sdl-1.2.15/src/SDL_error_c.h58
-rw-r--r--distrib/sdl-1.2.15/src/SDL_fatal.c134
-rw-r--r--distrib/sdl-1.2.15/src/SDL_fatal.h28
-rw-r--r--distrib/sdl-1.2.15/src/audio/SDL_audio.c703
-rw-r--r--distrib/sdl-1.2.15/src/audio/SDL_audio_c.h35
-rw-r--r--distrib/sdl-1.2.15/src/audio/SDL_audiocvt.c1510
-rw-r--r--distrib/sdl-1.2.15/src/audio/SDL_audiodev.c179
-rw-r--r--distrib/sdl-1.2.15/src/audio/SDL_audiodev_c.h26
-rw-r--r--distrib/sdl-1.2.15/src/audio/SDL_audiomem.h25
-rw-r--r--distrib/sdl-1.2.15/src/audio/SDL_mixer.c264
-rw-r--r--distrib/sdl-1.2.15/src/audio/SDL_mixer_MMX.c207
-rw-r--r--distrib/sdl-1.2.15/src/audio/SDL_mixer_MMX.h17
-rw-r--r--distrib/sdl-1.2.15/src/audio/SDL_mixer_MMX_VC.c183
-rw-r--r--distrib/sdl-1.2.15/src/audio/SDL_mixer_MMX_VC.h38
-rw-r--r--distrib/sdl-1.2.15/src/audio/SDL_mixer_m68k.c210
-rw-r--r--distrib/sdl-1.2.15/src/audio/SDL_mixer_m68k.h36
-rw-r--r--distrib/sdl-1.2.15/src/audio/SDL_sysaudio.h186
-rw-r--r--distrib/sdl-1.2.15/src/audio/SDL_wave.c596
-rw-r--r--distrib/sdl-1.2.15/src/audio/SDL_wave.h62
-rw-r--r--distrib/sdl-1.2.15/src/audio/alsa/SDL_alsa_audio.c619
-rw-r--r--distrib/sdl-1.2.15/src/audio/alsa/SDL_alsa_audio.h48
-rw-r--r--distrib/sdl-1.2.15/src/audio/arts/SDL_artsaudio.c362
-rw-r--r--distrib/sdl-1.2.15/src/audio/arts/SDL_artsaudio.h60
-rw-r--r--distrib/sdl-1.2.15/src/audio/baudio/SDL_beaudio.cc225
-rw-r--r--distrib/sdl-1.2.15/src/audio/baudio/SDL_beaudio.h39
-rw-r--r--distrib/sdl-1.2.15/src/audio/bsd/SDL_bsdaudio.c404
-rw-r--r--distrib/sdl-1.2.15/src/audio/bsd/SDL_bsdaudio.h58
-rw-r--r--distrib/sdl-1.2.15/src/audio/dart/SDL_dart.c441
-rw-r--r--distrib/sdl-1.2.15/src/audio/dart/SDL_dart.h63
-rw-r--r--distrib/sdl-1.2.15/src/audio/dc/SDL_dcaudio.c246
-rw-r--r--distrib/sdl-1.2.15/src/audio/dc/SDL_dcaudio.h41
-rw-r--r--distrib/sdl-1.2.15/src/audio/dc/aica.c (renamed from distrib/sdl-1.2.12/src/audio/dc/aica.c)0
-rw-r--r--distrib/sdl-1.2.15/src/audio/dc/aica.h40
-rw-r--r--distrib/sdl-1.2.15/src/audio/disk/SDL_diskaudio.c186
-rw-r--r--distrib/sdl-1.2.15/src/audio/disk/SDL_diskaudio.h41
-rw-r--r--distrib/sdl-1.2.15/src/audio/dma/SDL_dmaaudio.c455
-rw-r--r--distrib/sdl-1.2.15/src/audio/dma/SDL_dmaaudio.h59
-rw-r--r--distrib/sdl-1.2.15/src/audio/dmedia/SDL_irixaudio.c242
-rw-r--r--distrib/sdl-1.2.15/src/audio/dmedia/SDL_irixaudio.h45
-rw-r--r--distrib/sdl-1.2.15/src/audio/dsp/SDL_dspaudio.c340
-rw-r--r--distrib/sdl-1.2.15/src/audio/dsp/SDL_dspaudio.h53
-rw-r--r--distrib/sdl-1.2.15/src/audio/dummy/SDL_dummyaudio.c156
-rw-r--r--distrib/sdl-1.2.15/src/audio/dummy/SDL_dummyaudio.h40
-rw-r--r--distrib/sdl-1.2.15/src/audio/esd/SDL_esdaudio.c323
-rw-r--r--distrib/sdl-1.2.15/src/audio/esd/SDL_esdaudio.h57
-rw-r--r--distrib/sdl-1.2.15/src/audio/macosx/SDL_coreaudio.c291
-rw-r--r--distrib/sdl-1.2.15/src/audio/macosx/SDL_coreaudio.h46
-rw-r--r--distrib/sdl-1.2.15/src/audio/macrom/SDL_romaudio.c496
-rw-r--r--distrib/sdl-1.2.15/src/audio/macrom/SDL_romaudio.h50
-rw-r--r--distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio.c215
-rw-r--r--distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio.h121
-rw-r--r--distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_dma8.c357
-rw-r--r--distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_dma8.h85
-rw-r--r--distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_gsxb.c436
-rw-r--r--distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_gsxb.h104
-rw-r--r--distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_it.S386
-rw-r--r--distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_mcsn.c405
-rw-r--r--distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_mcsn.h59
-rw-r--r--distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_stfa.c326
-rw-r--r--distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_stfa.h97
-rw-r--r--distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_xbios.c490
-rw-r--r--distrib/sdl-1.2.15/src/audio/mme/SDL_mmeaudio.c264
-rw-r--r--distrib/sdl-1.2.15/src/audio/mme/SDL_mmeaudio.h51
-rw-r--r--distrib/sdl-1.2.15/src/audio/nas/SDL_nasaudio.c423
-rw-r--r--distrib/sdl-1.2.15/src/audio/nas/SDL_nasaudio.h62
-rw-r--r--distrib/sdl-1.2.15/src/audio/nds/SDL_ndsaudio.c335
-rw-r--r--distrib/sdl-1.2.15/src/audio/nds/SDL_ndsaudio.h40
-rw-r--r--distrib/sdl-1.2.15/src/audio/nds/sound9.c61
-rw-r--r--distrib/sdl-1.2.15/src/audio/nds/soundcommon.h80
-rw-r--r--distrib/sdl-1.2.15/src/audio/nto/SDL_nto_audio.c507
-rw-r--r--distrib/sdl-1.2.15/src/audio/nto/SDL_nto_audio.h68
-rw-r--r--distrib/sdl-1.2.15/src/audio/paudio/SDL_paudio.c511
-rw-r--r--distrib/sdl-1.2.15/src/audio/paudio/SDL_paudio.h57
-rw-r--r--distrib/sdl-1.2.15/src/audio/pulse/SDL_pulseaudio.c570
-rw-r--r--distrib/sdl-1.2.15/src/audio/pulse/SDL_pulseaudio.h73
-rw-r--r--distrib/sdl-1.2.15/src/audio/sun/SDL_sunaudio.c432
-rw-r--r--distrib/sdl-1.2.15/src/audio/sun/SDL_sunaudio.h55
-rw-r--r--distrib/sdl-1.2.15/src/audio/symbian/SDL_epocaudio.cpp614
-rw-r--r--distrib/sdl-1.2.15/src/audio/symbian/SDL_epocaudio.h37
-rw-r--r--distrib/sdl-1.2.15/src/audio/symbian/streamplayer.cpp279
-rw-r--r--distrib/sdl-1.2.15/src/audio/symbian/streamplayer.h89
-rw-r--r--distrib/sdl-1.2.15/src/audio/ums/SDL_umsaudio.c547
-rw-r--r--distrib/sdl-1.2.15/src/audio/ums/SDL_umsaudio.h50
-rw-r--r--distrib/sdl-1.2.15/src/audio/windib/SDL_dibaudio.c343
-rw-r--r--distrib/sdl-1.2.15/src/audio/windib/SDL_dibaudio.h53
-rw-r--r--distrib/sdl-1.2.15/src/audio/windx5/SDL_dx5audio.c705
-rw-r--r--distrib/sdl-1.2.15/src/audio/windx5/SDL_dx5audio.h55
-rw-r--r--distrib/sdl-1.2.15/src/audio/windx5/directx.h81
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/SDL_cdrom.c341
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/SDL_syscdrom.h76
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/aix/SDL_syscdrom.c660
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/beos/SDL_syscdrom.cc410
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/bsdi/SDL_syscdrom.c542
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/dc/SDL_syscdrom.c167
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/dummy/SDL_syscdrom.c41
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/freebsd/SDL_syscdrom.c406
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/linux/SDL_syscdrom.c564
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/macos/SDL_syscdrom.c525
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/macos/SDL_syscdrom_c.h140
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/macosx/AudioFilePlayer.c360
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/macosx/AudioFilePlayer.h178
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/macosx/AudioFileReaderThread.c610
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/macosx/CDPlayer.c636
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/macosx/CDPlayer.h69
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/macosx/SDLOSXCAGuard.c199
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/macosx/SDLOSXCAGuard.h116
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/macosx/SDL_syscdrom.c514
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/macosx/SDL_syscdrom_c.h136
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/mint/SDL_syscdrom.c317
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/openbsd/SDL_syscdrom.c416
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/os2/SDL_syscdrom.c393
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/osf/SDL_syscdrom.c (renamed from distrib/sdl-1.2.12/src/cdrom/osf/SDL_syscdrom.c)0
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/qnx/SDL_syscdrom.c551
-rw-r--r--distrib/sdl-1.2.15/src/cdrom/win32/SDL_syscdrom.c386
-rw-r--r--distrib/sdl-1.2.15/src/cpuinfo/SDL_cpuinfo.c499
-rw-r--r--distrib/sdl-1.2.15/src/events/SDL_active.c95
-rw-r--r--distrib/sdl-1.2.15/src/events/SDL_events.c502
-rw-r--r--distrib/sdl-1.2.15/src/events/SDL_events_c.h83
-rw-r--r--distrib/sdl-1.2.15/src/events/SDL_expose.c51
-rw-r--r--distrib/sdl-1.2.15/src/events/SDL_keyboard.c614
-rw-r--r--distrib/sdl-1.2.15/src/events/SDL_mouse.c268
-rw-r--r--distrib/sdl-1.2.15/src/events/SDL_quit.c124
-rw-r--r--distrib/sdl-1.2.15/src/events/SDL_resize.c71
-rw-r--r--distrib/sdl-1.2.15/src/events/SDL_sysevents.h46
-rw-r--r--distrib/sdl-1.2.15/src/file/SDL_rwops.c673
-rw-r--r--distrib/sdl-1.2.15/src/hermes/COPYING.LIB (renamed from distrib/sdl-1.2.12/src/hermes/COPYING.LIB)0
-rw-r--r--distrib/sdl-1.2.15/src/hermes/HeadMMX.h100
-rw-r--r--distrib/sdl-1.2.15/src/hermes/HeadX86.h186
-rw-r--r--distrib/sdl-1.2.15/src/hermes/README (renamed from distrib/sdl-1.2.12/src/hermes/README)0
-rw-r--r--distrib/sdl-1.2.15/src/hermes/common.inc (renamed from distrib/sdl-1.2.12/src/hermes/common.inc)0
-rw-r--r--distrib/sdl-1.2.15/src/hermes/mmx_main.asm74
-rw-r--r--distrib/sdl-1.2.15/src/hermes/mmxp2_32.asm405
-rw-r--r--distrib/sdl-1.2.15/src/hermes/x86_main.asm75
-rw-r--r--distrib/sdl-1.2.15/src/hermes/x86p_16.asm490
-rw-r--r--distrib/sdl-1.2.15/src/hermes/x86p_32.asm1044
-rw-r--r--distrib/sdl-1.2.15/src/joystick/SDL_joystick.c606
-rw-r--r--distrib/sdl-1.2.15/src/joystick/SDL_joystick_c.h38
-rw-r--r--distrib/sdl-1.2.15/src/joystick/SDL_sysjoystick.h82
-rw-r--r--distrib/sdl-1.2.15/src/joystick/beos/SDL_bejoystick.cc237
-rw-r--r--distrib/sdl-1.2.15/src/joystick/bsd/SDL_sysjoystick.c608
-rw-r--r--distrib/sdl-1.2.15/src/joystick/darwin/SDL_sysjoystick.c842
-rw-r--r--distrib/sdl-1.2.15/src/joystick/dc/SDL_sysjoystick.c193
-rw-r--r--distrib/sdl-1.2.15/src/joystick/dummy/SDL_sysjoystick.c83
-rw-r--r--distrib/sdl-1.2.15/src/joystick/linux/SDL_sysjoystick.c1218
-rw-r--r--distrib/sdl-1.2.15/src/joystick/macos/SDL_sysjoystick.c320
-rw-r--r--distrib/sdl-1.2.15/src/joystick/mint/SDL_sysjoystick.c826
-rw-r--r--distrib/sdl-1.2.15/src/joystick/nds/SDL_sysjoystick.c150
-rw-r--r--distrib/sdl-1.2.15/src/joystick/riscos/SDL_sysjoystick.c176
-rw-r--r--distrib/sdl-1.2.15/src/joystick/win32/SDL_mmjoystick.c407
-rw-r--r--distrib/sdl-1.2.15/src/loadso/beos/SDL_sysloadso.c72
-rw-r--r--distrib/sdl-1.2.15/src/loadso/dlopen/SDL_sysloadso.c69
-rw-r--r--distrib/sdl-1.2.15/src/loadso/dummy/SDL_sysloadso.c50
-rw-r--r--distrib/sdl-1.2.15/src/loadso/macos/SDL_sysloadso.c106
-rw-r--r--distrib/sdl-1.2.15/src/loadso/macosx/SDL_dlcompat.c1407
-rw-r--r--distrib/sdl-1.2.15/src/loadso/mint/SDL_sysloadso.c62
-rw-r--r--distrib/sdl-1.2.15/src/loadso/os2/SDL_sysloadso.c71
-rw-r--r--distrib/sdl-1.2.15/src/loadso/win32/SDL_sysloadso.c139
-rw-r--r--distrib/sdl-1.2.15/src/main/beos/SDL_BeApp.cc111
-rw-r--r--distrib/sdl-1.2.15/src/main/beos/SDL_BeApp.h33
-rw-r--r--distrib/sdl-1.2.15/src/main/dummy/SDL_dummy_main.c (renamed from distrib/sdl-1.2.12/src/main/dummy/SDL_dummy_main.c)0
-rw-r--r--distrib/sdl-1.2.15/src/main/macos/SDL.r1
-rw-r--r--distrib/sdl-1.2.15/src/main/macos/SDL.shlib.r1
-rw-r--r--distrib/sdl-1.2.15/src/main/macos/SDL_main.c610
-rw-r--r--distrib/sdl-1.2.15/src/main/macos/SIZE.r1
-rw-r--r--distrib/sdl-1.2.15/src/main/macos/exports/Makefile39
-rw-r--r--distrib/sdl-1.2.15/src/main/macos/exports/SDL.x1
-rw-r--r--distrib/sdl-1.2.15/src/main/macos/exports/gendef.pl43
-rw-r--r--distrib/sdl-1.2.15/src/main/macosx/Info.plist.in (renamed from distrib/sdl-1.2.12/src/main/macosx/Info.plist.in)0
-rw-r--r--distrib/sdl-1.2.15/src/main/macosx/SDLMain.h16
-rw-r--r--distrib/sdl-1.2.15/src/main/macosx/SDLMain.m395
-rw-r--r--distrib/sdl-1.2.15/src/main/macosx/SDLMain.nib/classes.nib (renamed from distrib/sdl-1.2.12/src/main/macosx/SDLMain.nib/classes.nib)0
-rw-r--r--distrib/sdl-1.2.15/src/main/macosx/SDLMain.nib/info.nib (renamed from distrib/sdl-1.2.12/src/main/macosx/SDLMain.nib/info.nib)0
-rw-r--r--distrib/sdl-1.2.15/src/main/macosx/SDLMain.nib/objects.nib (renamed from distrib/sdl-1.2.12/src/main/macosx/SDLMain.nib/objects.nib)bin1701 -> 1701 bytes
-rw-r--r--distrib/sdl-1.2.15/src/main/macosx/info.nib (renamed from distrib/sdl-1.2.12/src/main/macosx/info.nib)0
-rw-r--r--distrib/sdl-1.2.15/src/main/qtopia/SDL_qtopia_main.cc (renamed from distrib/sdl-1.2.12/src/main/qtopia/SDL_qtopia_main.cc)0
-rw-r--r--distrib/sdl-1.2.15/src/main/symbian/EKA1/SDL_main.cpp152
-rw-r--r--distrib/sdl-1.2.15/src/main/symbian/EKA2/SDL_main.cpp1035
-rw-r--r--distrib/sdl-1.2.15/src/main/symbian/EKA2/sdlexe.cpp809
-rw-r--r--distrib/sdl-1.2.15/src/main/symbian/EKA2/sdllib.cpp12
-rw-r--r--distrib/sdl-1.2.15/src/main/symbian/EKA2/vectorbuffer.cpp62
-rw-r--r--distrib/sdl-1.2.15/src/main/symbian/EKA2/vectorbuffer.h240
-rw-r--r--distrib/sdl-1.2.15/src/main/win32/SDL_win32_main.c402
-rw-r--r--distrib/sdl-1.2.15/src/main/win32/version.rc38
-rw-r--r--distrib/sdl-1.2.15/src/stdlib/SDL_getenv.c247
-rw-r--r--distrib/sdl-1.2.15/src/stdlib/SDL_iconv.c881
-rw-r--r--distrib/sdl-1.2.15/src/stdlib/SDL_malloc.c5111
-rw-r--r--distrib/sdl-1.2.15/src/stdlib/SDL_qsort.c443
-rw-r--r--distrib/sdl-1.2.15/src/stdlib/SDL_stdlib.c620
-rw-r--r--distrib/sdl-1.2.15/src/stdlib/SDL_string.c1248
-rw-r--r--distrib/sdl-1.2.15/src/thread/SDL_systhread.h52
-rw-r--r--distrib/sdl-1.2.15/src/thread/SDL_thread.c300
-rw-r--r--distrib/sdl-1.2.15/src/thread/SDL_thread_c.h64
-rw-r--r--distrib/sdl-1.2.15/src/thread/beos/SDL_syssem.c142
-rw-r--r--distrib/sdl-1.2.15/src/thread/beos/SDL_systhread.c96
-rw-r--r--distrib/sdl-1.2.15/src/thread/beos/SDL_systhread_c.h31
-rw-r--r--distrib/sdl-1.2.15/src/thread/dc/SDL_syscond.c215
-rw-r--r--distrib/sdl-1.2.15/src/thread/dc/SDL_syscond_c.h23
-rw-r--r--distrib/sdl-1.2.15/src/thread/dc/SDL_sysmutex.c122
-rw-r--r--distrib/sdl-1.2.15/src/thread/dc/SDL_sysmutex_c.h23
-rw-r--r--distrib/sdl-1.2.15/src/thread/dc/SDL_syssem.c173
-rw-r--r--distrib/sdl-1.2.15/src/thread/dc/SDL_syssem_c.h23
-rw-r--r--distrib/sdl-1.2.15/src/thread/dc/SDL_systhread.c60
-rw-r--r--distrib/sdl-1.2.15/src/thread/dc/SDL_systhread_c.h24
-rw-r--r--distrib/sdl-1.2.15/src/thread/generic/SDL_syscond.c215
-rw-r--r--distrib/sdl-1.2.15/src/thread/generic/SDL_sysmutex.c129
-rw-r--r--distrib/sdl-1.2.15/src/thread/generic/SDL_sysmutex_c.h23
-rw-r--r--distrib/sdl-1.2.15/src/thread/generic/SDL_syssem.c211
-rw-r--r--distrib/sdl-1.2.15/src/thread/generic/SDL_systhread.c54
-rw-r--r--distrib/sdl-1.2.15/src/thread/generic/SDL_systhread_c.h25
-rw-r--r--distrib/sdl-1.2.15/src/thread/irix/SDL_syssem.c219
-rw-r--r--distrib/sdl-1.2.15/src/thread/irix/SDL_systhread.c85
-rw-r--r--distrib/sdl-1.2.15/src/thread/irix/SDL_systhread_c.h27
-rw-r--r--distrib/sdl-1.2.15/src/thread/os2/SDL_syscond.c215
-rw-r--r--distrib/sdl-1.2.15/src/thread/os2/SDL_syscond_c.h23
-rw-r--r--distrib/sdl-1.2.15/src/thread/os2/SDL_sysmutex.c108
-rw-r--r--distrib/sdl-1.2.15/src/thread/os2/SDL_syssem.c192
-rw-r--r--distrib/sdl-1.2.15/src/thread/os2/SDL_systhread.c108
-rw-r--r--distrib/sdl-1.2.15/src/thread/os2/SDL_systhread_c.h28
-rw-r--r--distrib/sdl-1.2.15/src/thread/pth/SDL_syscond.c164
-rw-r--r--distrib/sdl-1.2.15/src/thread/pth/SDL_sysmutex.c87
-rw-r--r--distrib/sdl-1.2.15/src/thread/pth/SDL_sysmutex_c.h31
-rw-r--r--distrib/sdl-1.2.15/src/thread/pth/SDL_systhread.c103
-rw-r--r--distrib/sdl-1.2.15/src/thread/pth/SDL_systhread_c.h31
-rw-r--r--distrib/sdl-1.2.15/src/thread/pthread/SDL_syscond.c155
-rw-r--r--distrib/sdl-1.2.15/src/thread/pthread/SDL_sysmutex.c153
-rw-r--r--distrib/sdl-1.2.15/src/thread/pthread/SDL_sysmutex_c.h31
-rw-r--r--distrib/sdl-1.2.15/src/thread/pthread/SDL_syssem.c190
-rw-r--r--distrib/sdl-1.2.15/src/thread/pthread/SDL_systhread.c120
-rw-r--r--distrib/sdl-1.2.15/src/thread/pthread/SDL_systhread_c.h26
-rw-r--r--distrib/sdl-1.2.15/src/thread/riscos/SDL_syscond.c160
-rw-r--r--distrib/sdl-1.2.15/src/thread/riscos/SDL_sysmutex.c153
-rw-r--r--distrib/sdl-1.2.15/src/thread/riscos/SDL_sysmutex_c.h34
-rw-r--r--distrib/sdl-1.2.15/src/thread/riscos/SDL_syssem.c203
-rw-r--r--distrib/sdl-1.2.15/src/thread/riscos/SDL_systhread.c144
-rw-r--r--distrib/sdl-1.2.15/src/thread/riscos/SDL_systhread_c.h34
-rw-r--r--distrib/sdl-1.2.15/src/thread/symbian/SDL_sysmutex.cpp130
-rw-r--r--distrib/sdl-1.2.15/src/thread/symbian/SDL_syssem.cpp214
-rw-r--r--distrib/sdl-1.2.15/src/thread/symbian/SDL_systhread.cpp146
-rw-r--r--distrib/sdl-1.2.15/src/thread/symbian/SDL_systhread_c.h30
-rw-r--r--distrib/sdl-1.2.15/src/thread/win32/SDL_sysmutex.c95
-rw-r--r--distrib/sdl-1.2.15/src/thread/win32/SDL_syssem.c164
-rw-r--r--distrib/sdl-1.2.15/src/thread/win32/SDL_systhread.c162
-rw-r--r--distrib/sdl-1.2.15/src/thread/win32/SDL_systhread_c.h28
-rw-r--r--distrib/sdl-1.2.15/src/thread/win32/win_ce_semaphore.c (renamed from distrib/sdl-1.2.12/src/thread/win32/win_ce_semaphore.c)0
-rw-r--r--distrib/sdl-1.2.15/src/thread/win32/win_ce_semaphore.h (renamed from distrib/sdl-1.2.12/src/thread/win32/win_ce_semaphore.h)0
-rw-r--r--distrib/sdl-1.2.15/src/timer/SDL_systimer.h40
-rw-r--r--distrib/sdl-1.2.15/src/timer/SDL_timer.c285
-rw-r--r--distrib/sdl-1.2.15/src/timer/SDL_timer_c.h46
-rw-r--r--distrib/sdl-1.2.15/src/timer/beos/SDL_systimer.c95
-rw-r--r--distrib/sdl-1.2.15/src/timer/dc/SDL_systimer.c100
-rw-r--r--distrib/sdl-1.2.15/src/timer/dummy/SDL_systimer.c91
-rw-r--r--distrib/sdl-1.2.15/src/timer/macos/FastTimes.c352
-rw-r--r--distrib/sdl-1.2.15/src/timer/macos/FastTimes.h27
-rw-r--r--distrib/sdl-1.2.15/src/timer/macos/SDL_MPWtimer.c152
-rw-r--r--distrib/sdl-1.2.15/src/timer/macos/SDL_systimer.c186
-rw-r--r--distrib/sdl-1.2.15/src/timer/mint/SDL_systimer.c149
-rw-r--r--distrib/sdl-1.2.15/src/timer/mint/SDL_vbltimer.S228
-rw-r--r--distrib/sdl-1.2.15/src/timer/mint/SDL_vbltimer_s.h35
-rw-r--r--distrib/sdl-1.2.15/src/timer/nds/SDL_systimer.c73
-rw-r--r--distrib/sdl-1.2.15/src/timer/os2/SDL_systimer.c227
-rw-r--r--distrib/sdl-1.2.15/src/timer/riscos/SDL_systimer.c233
-rw-r--r--distrib/sdl-1.2.15/src/timer/symbian/SDL_systimer.cpp114
-rw-r--r--distrib/sdl-1.2.15/src/timer/unix/SDL_systimer.c240
-rw-r--r--distrib/sdl-1.2.15/src/timer/win32/SDL_systimer.c160
-rw-r--r--distrib/sdl-1.2.15/src/timer/wince/SDL_systimer.c198
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_RLEaccel.c1941
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_RLEaccel_c.h31
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_blit.c360
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_blit.h528
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_blit_0.c471
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_blit_1.c523
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_blit_A.c2873
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_blit_N.c2492
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_bmp.c549
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_cursor.c758
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_cursor_c.h73
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_gamma.c233
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_glfuncs.h (renamed from distrib/sdl-1.2.12/src/video/SDL_glfuncs.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_leaks.h31
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_pixels.c626
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_pixels_c.h46
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_stretch.c358
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_stretch_c.h29
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_surface.c941
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_sysvideo.h439
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_video.c2041
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_yuv.c150
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_yuv_mmx.c428
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_yuv_sw.c1299
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_yuv_sw_c.h37
-rw-r--r--distrib/sdl-1.2.15/src/video/SDL_yuvfuncs.h37
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/README (renamed from distrib/sdl-1.2.12/src/video/Xext/README)0
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/XME/xme.c410
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/Xinerama/Xinerama.c324
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/Xv/Xv.c (renamed from distrib/sdl-1.2.12/src/video/Xext/Xv/Xv.c)0
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/Xv/Xvlibint.h81
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/Xxf86dga/XF86DGA.c721
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/Xxf86dga/XF86DGA2.c993
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/Xxf86vm/XF86VMode.c1226
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/extensions/Xext.h (renamed from distrib/sdl-1.2.12/src/video/Xext/extensions/Xext.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/extensions/Xinerama.h (renamed from distrib/sdl-1.2.12/src/video/Xext/extensions/Xinerama.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/extensions/Xv.h (renamed from distrib/sdl-1.2.12/src/video/Xext/extensions/Xv.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/extensions/Xvlib.h (renamed from distrib/sdl-1.2.12/src/video/Xext/extensions/Xvlib.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/extensions/Xvproto.h (renamed from distrib/sdl-1.2.12/src/video/Xext/extensions/Xvproto.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/extensions/extutil.h (renamed from distrib/sdl-1.2.12/src/video/Xext/extensions/extutil.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/extensions/panoramiXext.h (renamed from distrib/sdl-1.2.12/src/video/Xext/extensions/panoramiXext.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/extensions/panoramiXproto.h (renamed from distrib/sdl-1.2.12/src/video/Xext/extensions/panoramiXproto.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/extensions/xf86dga.h (renamed from distrib/sdl-1.2.12/src/video/Xext/extensions/xf86dga.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/extensions/xf86dga1.h (renamed from distrib/sdl-1.2.12/src/video/Xext/extensions/xf86dga1.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/extensions/xf86dga1str.h (renamed from distrib/sdl-1.2.12/src/video/Xext/extensions/xf86dga1str.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/extensions/xf86dgastr.h (renamed from distrib/sdl-1.2.12/src/video/Xext/extensions/xf86dgastr.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/extensions/xf86vmode.h (renamed from distrib/sdl-1.2.12/src/video/Xext/extensions/xf86vmode.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/extensions/xf86vmstr.h (renamed from distrib/sdl-1.2.12/src/video/Xext/extensions/xf86vmstr.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/Xext/extensions/xme.h (renamed from distrib/sdl-1.2.12/src/video/Xext/extensions/xme.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/aalib/SDL_aaevents.c202
-rw-r--r--distrib/sdl-1.2.15/src/video/aalib/SDL_aaevents_c.h35
-rw-r--r--distrib/sdl-1.2.15/src/video/aalib/SDL_aamouse.c35
-rw-r--r--distrib/sdl-1.2.15/src/video/aalib/SDL_aamouse_c.h26
-rw-r--r--distrib/sdl-1.2.15/src/video/aalib/SDL_aavideo.c388
-rw-r--r--distrib/sdl-1.2.15/src/video/aalib/SDL_aavideo.h66
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_ataric2p.S452
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_ataric2p_s.h75
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_ataridevmouse.c159
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_ataridevmouse_c.h42
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarieddi.S42
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarieddi_s.h54
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarievents.c234
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarievents_c.h52
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarigl.c1086
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarigl_c.h109
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarikeys.h140
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarimxalloc.c52
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarimxalloc_c.h37
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarisuper.h61
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_biosevents.c131
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_biosevents_c.h42
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_gemdosevents.c132
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_gemdosevents_c.h42
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_ikbdevents.c124
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_ikbdevents_c.h42
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_ikbdinterrupt.S404
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_ikbdinterrupt_s.h61
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_xbiosevents.c155
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_xbiosevents_c.h48
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_xbiosinterrupt.S212
-rw-r--r--distrib/sdl-1.2.15/src/video/ataricommon/SDL_xbiosinterrupt_s.h52
-rw-r--r--distrib/sdl-1.2.15/src/video/blank_cursor.h33
-rw-r--r--distrib/sdl-1.2.15/src/video/bwindow/SDL_BView.h116
-rw-r--r--distrib/sdl-1.2.15/src/video/bwindow/SDL_BWin.h290
-rw-r--r--distrib/sdl-1.2.15/src/video/bwindow/SDL_lowvideo.h58
-rw-r--r--distrib/sdl-1.2.15/src/video/bwindow/SDL_sysevents.cc415
-rw-r--r--distrib/sdl-1.2.15/src/video/bwindow/SDL_sysevents_c.h31
-rw-r--r--distrib/sdl-1.2.15/src/video/bwindow/SDL_sysmouse.cc153
-rw-r--r--distrib/sdl-1.2.15/src/video/bwindow/SDL_sysmouse_c.h33
-rw-r--r--distrib/sdl-1.2.15/src/video/bwindow/SDL_sysvideo.cc841
-rw-r--r--distrib/sdl-1.2.15/src/video/bwindow/SDL_syswm.cc92
-rw-r--r--distrib/sdl-1.2.15/src/video/bwindow/SDL_syswm_c.h32
-rw-r--r--distrib/sdl-1.2.15/src/video/bwindow/SDL_sysyuv.cc314
-rw-r--r--distrib/sdl-1.2.15/src/video/bwindow/SDL_sysyuv.h73
-rw-r--r--distrib/sdl-1.2.15/src/video/caca/SDL_cacaevents.c101
-rw-r--r--distrib/sdl-1.2.15/src/video/caca/SDL_cacaevents_c.h35
-rw-r--r--distrib/sdl-1.2.15/src/video/caca/SDL_cacavideo.c304
-rw-r--r--distrib/sdl-1.2.15/src/video/caca/SDL_cacavideo.h76
-rw-r--r--distrib/sdl-1.2.15/src/video/dc/SDL_dcevents.c152
-rw-r--r--distrib/sdl-1.2.15/src/video/dc/SDL_dcevents_c.h33
-rw-r--r--distrib/sdl-1.2.15/src/video/dc/SDL_dcmouse.c35
-rw-r--r--distrib/sdl-1.2.15/src/video/dc/SDL_dcmouse_c.h26
-rw-r--r--distrib/sdl-1.2.15/src/video/dc/SDL_dcvideo.c445
-rw-r--r--distrib/sdl-1.2.15/src/video/dc/SDL_dcvideo.h42
-rw-r--r--distrib/sdl-1.2.15/src/video/default_cursor.h116
-rw-r--r--distrib/sdl-1.2.15/src/video/dga/SDL_dgaevents.c163
-rw-r--r--distrib/sdl-1.2.15/src/video/dga/SDL_dgaevents_c.h28
-rw-r--r--distrib/sdl-1.2.15/src/video/dga/SDL_dgamouse.c35
-rw-r--r--distrib/sdl-1.2.15/src/video/dga/SDL_dgamouse_c.h26
-rw-r--r--distrib/sdl-1.2.15/src/video/dga/SDL_dgavideo.c1101
-rw-r--r--distrib/sdl-1.2.15/src/video/dga/SDL_dgavideo.h124
-rw-r--r--distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_events.c219
-rw-r--r--distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_events.h29
-rw-r--r--distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_keys.h (renamed from distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_keys.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_video.c1171
-rw-r--r--distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_video.h62
-rw-r--r--distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_yuv.c290
-rw-r--r--distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_yuv.h38
-rw-r--r--distrib/sdl-1.2.15/src/video/dummy/SDL_nullevents.c45
-rw-r--r--distrib/sdl-1.2.15/src/video/dummy/SDL_nullevents_c.h33
-rw-r--r--distrib/sdl-1.2.15/src/video/dummy/SDL_nullmouse.c33
-rw-r--r--distrib/sdl-1.2.15/src/video/dummy/SDL_nullmouse_c.h26
-rw-r--r--distrib/sdl-1.2.15/src/video/dummy/SDL_nullvideo.c239
-rw-r--r--distrib/sdl-1.2.15/src/video/dummy/SDL_nullvideo.h40
-rw-r--r--distrib/sdl-1.2.15/src/video/e_log.h (renamed from distrib/sdl-1.2.12/src/video/e_log.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/e_pow.h (renamed from distrib/sdl-1.2.12/src/video/e_pow.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/e_sqrt.h (renamed from distrib/sdl-1.2.12/src/video/e_sqrt.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/fbcon/3dfx_mmio.h56
-rw-r--r--distrib/sdl-1.2.15/src/video/fbcon/3dfx_regs.h83
-rw-r--r--distrib/sdl-1.2.15/src/video/fbcon/SDL_fb3dfx.c215
-rw-r--r--distrib/sdl-1.2.15/src/video/fbcon/SDL_fb3dfx.h29
-rw-r--r--distrib/sdl-1.2.15/src/video/fbcon/SDL_fbelo.c442
-rw-r--r--distrib/sdl-1.2.15/src/video/fbcon/SDL_fbelo.h55
-rw-r--r--distrib/sdl-1.2.15/src/video/fbcon/SDL_fbevents.c1254
-rw-r--r--distrib/sdl-1.2.15/src/video/fbcon/SDL_fbevents_c.h38
-rw-r--r--distrib/sdl-1.2.15/src/video/fbcon/SDL_fbkeys.h (renamed from distrib/sdl-1.2.12/src/video/fbcon/SDL_fbkeys.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/fbcon/SDL_fbmatrox.c280
-rw-r--r--distrib/sdl-1.2.15/src/video/fbcon/SDL_fbmatrox.h29
-rw-r--r--distrib/sdl-1.2.15/src/video/fbcon/SDL_fbmouse.c33
-rw-r--r--distrib/sdl-1.2.15/src/video/fbcon/SDL_fbmouse_c.h26
-rw-r--r--distrib/sdl-1.2.15/src/video/fbcon/SDL_fbriva.c222
-rw-r--r--distrib/sdl-1.2.15/src/video/fbcon/SDL_fbriva.h36
-rw-r--r--distrib/sdl-1.2.15/src/video/fbcon/SDL_fbvideo.c1982
-rw-r--r--distrib/sdl-1.2.15/src/video/fbcon/SDL_fbvideo.h200
-rw-r--r--distrib/sdl-1.2.15/src/video/fbcon/matrox_mmio.h51
-rw-r--r--distrib/sdl-1.2.15/src/video/fbcon/matrox_regs.h (renamed from distrib/sdl-1.2.12/src/video/fbcon/matrox_regs.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/fbcon/riva_mmio.h (renamed from distrib/sdl-1.2.12/src/video/fbcon/riva_mmio.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/fbcon/riva_regs.h43
-rw-r--r--distrib/sdl-1.2.15/src/video/gapi/SDL_gapivideo.c1287
-rw-r--r--distrib/sdl-1.2.15/src/video/gapi/SDL_gapivideo.h160
-rw-r--r--distrib/sdl-1.2.15/src/video/gem/SDL_gemevents.c375
-rw-r--r--distrib/sdl-1.2.15/src/video/gem/SDL_gemevents_c.h33
-rw-r--r--distrib/sdl-1.2.15/src/video/gem/SDL_gemmouse.c205
-rw-r--r--distrib/sdl-1.2.15/src/video/gem/SDL_gemmouse_c.h34
-rw-r--r--distrib/sdl-1.2.15/src/video/gem/SDL_gemvideo.c1337
-rw-r--r--distrib/sdl-1.2.15/src/video/gem/SDL_gemvideo.h191
-rw-r--r--distrib/sdl-1.2.15/src/video/gem/SDL_gemwm.c116
-rw-r--r--distrib/sdl-1.2.15/src/video/gem/SDL_gemwm_c.h37
-rw-r--r--distrib/sdl-1.2.15/src/video/ggi/SDL_ggievents.c264
-rwxr-xr-xdistrib/sdl-1.2.15/src/video/ggi/SDL_ggievents_c.h29
-rw-r--r--distrib/sdl-1.2.15/src/video/ggi/SDL_ggikeys.h (renamed from distrib/sdl-1.2.12/src/video/ggi/SDL_ggikeys.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/ggi/SDL_ggimouse.c32
-rwxr-xr-xdistrib/sdl-1.2.15/src/video/ggi/SDL_ggimouse_c.h26
-rw-r--r--distrib/sdl-1.2.15/src/video/ggi/SDL_ggivideo.c378
-rw-r--r--distrib/sdl-1.2.15/src/video/ggi/SDL_ggivideo.h48
-rw-r--r--distrib/sdl-1.2.15/src/video/ipod/SDL_ipodvideo.c733
-rw-r--r--distrib/sdl-1.2.15/src/video/ipod/SDL_ipodvideo.h38
-rw-r--r--distrib/sdl-1.2.15/src/video/maccommon/SDL_lowvideo.h102
-rw-r--r--distrib/sdl-1.2.15/src/video/maccommon/SDL_macevents.c746
-rw-r--r--distrib/sdl-1.2.15/src/video/maccommon/SDL_macevents_c.h32
-rw-r--r--distrib/sdl-1.2.15/src/video/maccommon/SDL_macgl.c197
-rw-r--r--distrib/sdl-1.2.15/src/video/maccommon/SDL_macgl_c.h47
-rw-r--r--distrib/sdl-1.2.15/src/video/maccommon/SDL_mackeys.h140
-rw-r--r--distrib/sdl-1.2.15/src/video/maccommon/SDL_macmouse.c129
-rw-r--r--distrib/sdl-1.2.15/src/video/maccommon/SDL_macmouse_c.h34
-rw-r--r--distrib/sdl-1.2.15/src/video/maccommon/SDL_macwm.c442
-rw-r--r--distrib/sdl-1.2.15/src/video/maccommon/SDL_macwm_c.h41
-rw-r--r--distrib/sdl-1.2.15/src/video/macdsp/SDL_dspvideo.c1422
-rw-r--r--distrib/sdl-1.2.15/src/video/macdsp/SDL_dspvideo.h54
-rw-r--r--distrib/sdl-1.2.15/src/video/macrom/SDL_romvideo.c745
-rw-r--r--distrib/sdl-1.2.15/src/video/macrom/SDL_romvideo.h29
-rw-r--r--distrib/sdl-1.2.15/src/video/math_private.h173
-rw-r--r--distrib/sdl-1.2.15/src/video/mmx.h704
-rw-r--r--distrib/sdl-1.2.15/src/video/nanox/SDL_nxevents.c382
-rw-r--r--distrib/sdl-1.2.15/src/video/nanox/SDL_nxevents_c.h32
-rw-r--r--distrib/sdl-1.2.15/src/video/nanox/SDL_nximage.c230
-rw-r--r--distrib/sdl-1.2.15/src/video/nanox/SDL_nximage_c.h35
-rw-r--r--distrib/sdl-1.2.15/src/video/nanox/SDL_nxmodes.c84
-rw-r--r--distrib/sdl-1.2.15/src/video/nanox/SDL_nxmodes_c.h34
-rw-r--r--distrib/sdl-1.2.15/src/video/nanox/SDL_nxmouse.c79
-rw-r--r--distrib/sdl-1.2.15/src/video/nanox/SDL_nxmouse_c.h29
-rw-r--r--distrib/sdl-1.2.15/src/video/nanox/SDL_nxvideo.c544
-rw-r--r--distrib/sdl-1.2.15/src/video/nanox/SDL_nxvideo.h96
-rw-r--r--distrib/sdl-1.2.15/src/video/nanox/SDL_nxwm.c61
-rw-r--r--distrib/sdl-1.2.15/src/video/nanox/SDL_nxwm_c.h32
-rw-r--r--distrib/sdl-1.2.15/src/video/nds/SDL_ndsevents.c83
-rw-r--r--distrib/sdl-1.2.15/src/video/nds/SDL_ndsevents_c.h51
-rw-r--r--distrib/sdl-1.2.15/src/video/nds/SDL_ndsmouse.c34
-rw-r--r--distrib/sdl-1.2.15/src/video/nds/SDL_ndsmouse_c.h26
-rw-r--r--distrib/sdl-1.2.15/src/video/nds/SDL_ndsvideo.c500
-rw-r--r--distrib/sdl-1.2.15/src/video/nds/SDL_ndsvideo.h61
-rw-r--r--distrib/sdl-1.2.15/src/video/os2fslib/SDL_os2fslib.c3018
-rw-r--r--distrib/sdl-1.2.15/src/video/os2fslib/SDL_os2fslib.h71
-rw-r--r--distrib/sdl-1.2.15/src/video/os2fslib/SDL_vkeys.h74
-rw-r--r--distrib/sdl-1.2.15/src/video/photon/SDL_ph_events.c624
-rw-r--r--distrib/sdl-1.2.15/src/video/photon/SDL_ph_events_c.h37
-rw-r--r--distrib/sdl-1.2.15/src/video/photon/SDL_ph_gl.c406
-rw-r--r--distrib/sdl-1.2.15/src/video/photon/SDL_ph_gl.h41
-rw-r--r--distrib/sdl-1.2.15/src/video/photon/SDL_ph_image.c1059
-rw-r--r--distrib/sdl-1.2.15/src/video/photon/SDL_ph_image_c.h59
-rw-r--r--distrib/sdl-1.2.15/src/video/photon/SDL_ph_modes.c390
-rw-r--r--distrib/sdl-1.2.15/src/video/photon/SDL_ph_modes_c.h43
-rw-r--r--distrib/sdl-1.2.15/src/video/photon/SDL_ph_mouse.c220
-rw-r--r--distrib/sdl-1.2.15/src/video/photon/SDL_ph_mouse_c.h39
-rw-r--r--distrib/sdl-1.2.15/src/video/photon/SDL_ph_video.c648
-rw-r--r--distrib/sdl-1.2.15/src/video/photon/SDL_ph_video.h157
-rw-r--r--distrib/sdl-1.2.15/src/video/photon/SDL_ph_wm.c118
-rw-r--r--distrib/sdl-1.2.15/src/video/photon/SDL_ph_wm_c.h37
-rw-r--r--distrib/sdl-1.2.15/src/video/photon/SDL_phyuv.c504
-rw-r--r--distrib/sdl-1.2.15/src/video/photon/SDL_phyuv_c.h62
-rw-r--r--distrib/sdl-1.2.15/src/video/picogui/SDL_pgevents.c117
-rw-r--r--distrib/sdl-1.2.15/src/video/picogui/SDL_pgevents_c.h37
-rw-r--r--distrib/sdl-1.2.15/src/video/picogui/SDL_pgvideo.c364
-rw-r--r--distrib/sdl-1.2.15/src/video/picogui/SDL_pgvideo.h50
-rw-r--r--distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsevents.c977
-rw-r--r--distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsevents_c.h38
-rw-r--r--distrib/sdl-1.2.15/src/video/ps2gs/SDL_gskeys.h (renamed from distrib/sdl-1.2.12/src/video/ps2gs/SDL_gskeys.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsmouse.c146
-rw-r--r--distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsmouse_c.h37
-rw-r--r--distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsvideo.c689
-rw-r--r--distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsvideo.h95
-rw-r--r--distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsyuv.c461
-rw-r--r--distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsyuv_c.h37
-rw-r--r--distrib/sdl-1.2.15/src/video/ps3/SDL_ps3events.c44
-rw-r--r--distrib/sdl-1.2.15/src/video/ps3/SDL_ps3events_c.h41
-rw-r--r--distrib/sdl-1.2.15/src/video/ps3/SDL_ps3video.c621
-rw-r--r--distrib/sdl-1.2.15/src/video/ps3/SDL_ps3video.h165
-rw-r--r--distrib/sdl-1.2.15/src/video/ps3/SDL_ps3yuv.c340
-rw-r--r--distrib/sdl-1.2.15/src/video/ps3/SDL_ps3yuv_c.h44
-rw-r--r--distrib/sdl-1.2.15/src/video/ps3/spulibs/Makefile83
-rw-r--r--distrib/sdl-1.2.15/src/video/ps3/spulibs/bilin_scaler.c2050
-rw-r--r--distrib/sdl-1.2.15/src/video/ps3/spulibs/fb_writer.c193
-rw-r--r--distrib/sdl-1.2.15/src/video/ps3/spulibs/spu_common.h108
-rw-r--r--distrib/sdl-1.2.15/src/video/ps3/spulibs/yuv2rgb_converter.c629
-rw-r--r--distrib/sdl-1.2.15/src/video/qtopia/SDL_QPEApp.cc63
-rw-r--r--distrib/sdl-1.2.15/src/video/qtopia/SDL_QPEApp.h33
-rw-r--r--distrib/sdl-1.2.15/src/video/qtopia/SDL_QWin.cc527
-rw-r--r--distrib/sdl-1.2.15/src/video/qtopia/SDL_QWin.h110
-rw-r--r--distrib/sdl-1.2.15/src/video/qtopia/SDL_lowvideo.h65
-rw-r--r--distrib/sdl-1.2.15/src/video/qtopia/SDL_sysevents.cc269
-rw-r--r--distrib/sdl-1.2.15/src/video/qtopia/SDL_sysevents_c.h31
-rw-r--r--distrib/sdl-1.2.15/src/video/qtopia/SDL_sysmouse.cc56
-rw-r--r--distrib/sdl-1.2.15/src/video/qtopia/SDL_sysmouse_c.h32
-rw-r--r--distrib/sdl-1.2.15/src/video/qtopia/SDL_sysvideo.cc403
-rw-r--r--distrib/sdl-1.2.15/src/video/qtopia/SDL_syswm.cc35
-rw-r--r--distrib/sdl-1.2.15/src/video/qtopia/SDL_syswm_c.h28
-rw-r--r--distrib/sdl-1.2.15/src/video/quartz/CGS.h84
-rw-r--r--distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzEvents.m1063
-rw-r--r--distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzGL.m292
-rw-r--r--distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzKeys.h146
-rw-r--r--distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzVideo.h235
-rw-r--r--distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzVideo.m1695
-rw-r--r--distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzWM.h28
-rw-r--r--distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzWM.m574
-rw-r--r--distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzWindow.h51
-rw-r--r--distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzWindow.m231
-rw-r--r--distrib/sdl-1.2.15/src/video/riscos/SDL_riscosASM.S116
-rw-r--r--distrib/sdl-1.2.15/src/video/riscos/SDL_riscosFullScreenVideo.c777
-rw-r--r--distrib/sdl-1.2.15/src/video/riscos/SDL_riscosevents.c549
-rw-r--r--distrib/sdl-1.2.15/src/video/riscos/SDL_riscosevents_c.h34
-rw-r--r--distrib/sdl-1.2.15/src/video/riscos/SDL_riscosmouse.c371
-rw-r--r--distrib/sdl-1.2.15/src/video/riscos/SDL_riscosmouse_c.h44
-rw-r--r--distrib/sdl-1.2.15/src/video/riscos/SDL_riscossprite.c265
-rw-r--r--distrib/sdl-1.2.15/src/video/riscos/SDL_riscostask.c350
-rw-r--r--distrib/sdl-1.2.15/src/video/riscos/SDL_riscostask.h39
-rw-r--r--distrib/sdl-1.2.15/src/video/riscos/SDL_riscosvideo.c316
-rw-r--r--distrib/sdl-1.2.15/src/video/riscos/SDL_riscosvideo.h62
-rw-r--r--distrib/sdl-1.2.15/src/video/riscos/SDL_wimppoll.c330
-rw-r--r--distrib/sdl-1.2.15/src/video/riscos/SDL_wimpvideo.c501
-rw-r--r--distrib/sdl-1.2.15/src/video/svga/SDL_svgaevents.c412
-rw-r--r--distrib/sdl-1.2.15/src/video/svga/SDL_svgaevents_c.h35
-rw-r--r--distrib/sdl-1.2.15/src/video/svga/SDL_svgamouse.c33
-rw-r--r--distrib/sdl-1.2.15/src/video/svga/SDL_svgamouse_c.h26
-rw-r--r--distrib/sdl-1.2.15/src/video/svga/SDL_svgavideo.c584
-rw-r--r--distrib/sdl-1.2.15/src/video/svga/SDL_svgavideo.h58
-rw-r--r--distrib/sdl-1.2.15/src/video/symbian/EKA1/SDL_epocevents.cpp626
-rw-r--r--distrib/sdl-1.2.15/src/video/symbian/EKA1/SDL_epocvideo.cpp1356
-rw-r--r--distrib/sdl-1.2.15/src/video/symbian/EKA1/SDL_epocvideo.h34
-rw-r--r--distrib/sdl-1.2.15/src/video/symbian/EKA2/SDL_epocevents.cpp521
-rw-r--r--distrib/sdl-1.2.15/src/video/symbian/EKA2/SDL_epocvideo.cpp594
-rw-r--r--distrib/sdl-1.2.15/src/video/symbian/EKA2/SDL_epocvideo.h51
-rw-r--r--distrib/sdl-1.2.15/src/video/symbian/EKA2/dsa.cpp1505
-rw-r--r--distrib/sdl-1.2.15/src/video/symbian/EKA2/dsa_new.cpp1443
-rw-r--r--distrib/sdl-1.2.15/src/video/symbian/EKA2/dsa_old.cpp1075
-rw-r--r--distrib/sdl-1.2.15/src/video/symbian/SDL_epocevents_c.h60
-rw-r--r--distrib/sdl-1.2.15/src/video/vgl/SDL_vglevents.c299
-rw-r--r--distrib/sdl-1.2.15/src/video/vgl/SDL_vglevents_c.h155
-rw-r--r--distrib/sdl-1.2.15/src/video/vgl/SDL_vglmouse.c56
-rw-r--r--distrib/sdl-1.2.15/src/video/vgl/SDL_vglmouse_c.h32
-rw-r--r--distrib/sdl-1.2.15/src/video/vgl/SDL_vglvideo.c624
-rw-r--r--distrib/sdl-1.2.15/src/video/vgl/SDL_vglvideo.h65
-rw-r--r--distrib/sdl-1.2.15/src/video/wincommon/SDL_lowvideo.h152
-rw-r--r--distrib/sdl-1.2.15/src/video/wincommon/SDL_sysevents.c855
-rw-r--r--distrib/sdl-1.2.15/src/video/wincommon/SDL_sysmouse.c259
-rw-r--r--distrib/sdl-1.2.15/src/video/wincommon/SDL_sysmouse_c.h33
-rw-r--r--distrib/sdl-1.2.15/src/video/wincommon/SDL_syswm.c297
-rw-r--r--distrib/sdl-1.2.15/src/video/wincommon/SDL_syswm_c.h35
-rw-r--r--distrib/sdl-1.2.15/src/video/wincommon/SDL_wingl.c659
-rw-r--r--distrib/sdl-1.2.15/src/video/wincommon/SDL_wingl_c.h135
-rw-r--r--distrib/sdl-1.2.15/src/video/wincommon/wmmsg.h (renamed from distrib/sdl-1.2.12/src/video/wincommon/wmmsg.h)0
-rw-r--r--distrib/sdl-1.2.15/src/video/windib/SDL_dibevents.c704
-rw-r--r--distrib/sdl-1.2.15/src/video/windib/SDL_dibevents_c.h35
-rw-r--r--distrib/sdl-1.2.15/src/video/windib/SDL_dibvideo.c1499
-rw-r--r--distrib/sdl-1.2.15/src/video/windib/SDL_dibvideo.h59
-rw-r--r--distrib/sdl-1.2.15/src/video/windib/SDL_gapidibvideo.h56
-rw-r--r--distrib/sdl-1.2.15/src/video/windib/SDL_vkeys.h75
-rw-r--r--distrib/sdl-1.2.15/src/video/windx5/SDL_dx5events.c1005
-rw-r--r--distrib/sdl-1.2.15/src/video/windx5/SDL_dx5events_c.h37
-rw-r--r--distrib/sdl-1.2.15/src/video/windx5/SDL_dx5video.c2537
-rw-r--r--distrib/sdl-1.2.15/src/video/windx5/SDL_dx5video.h61
-rw-r--r--distrib/sdl-1.2.15/src/video/windx5/SDL_dx5yuv.c296
-rw-r--r--distrib/sdl-1.2.15/src/video/windx5/SDL_dx5yuv_c.h38
-rw-r--r--distrib/sdl-1.2.15/src/video/windx5/directx.h97
-rw-r--r--distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsevents.c233
-rw-r--r--distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsevents_c.h36
-rw-r--r--distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsmouse.c33
-rw-r--r--distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsmouse_c.h26
-rw-r--r--distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsvideo.c609
-rw-r--r--distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsvideo.h76
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11dga.c90
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11dga_c.h33
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11dyn.c223
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11dyn.h93
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11events.c1414
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11events_c.h34
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11gamma.c142
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11gamma_c.h32
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11gl.c577
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11gl_c.h99
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11image.c316
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11image_c.h38
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11modes.c1143
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11modes_c.h43
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11mouse.c288
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11mouse_c.h33
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11sym.h211
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11video.c1580
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11video.h217
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11wm.c620
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11wm_c.h38
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11yuv.c538
-rw-r--r--distrib/sdl-1.2.15/src/video/x11/SDL_x11yuv_c.h41
-rw-r--r--distrib/sdl-1.2.15/src/video/xbios/SDL_xbios.c1116
-rw-r--r--distrib/sdl-1.2.15/src/video/xbios/SDL_xbios.h111
-rw-r--r--distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_blowup.c77
-rw-r--r--distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_blowup.h86
-rw-r--r--distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_centscreen.c104
-rw-r--r--distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_centscreen.h114
-rw-r--r--distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_milan.c106
-rw-r--r--distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_milan.h129
-rw-r--r--distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_sb3.c83
-rw-r--r--distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_sb3.h82
-rw-r--r--distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_tveille.c63
-rw-r--r--distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_tveille.h64
-rw-r--r--distrib/sdl-1.2.15/symbian.zipbin0 -> 378899 bytes
-rw-r--r--distrib/sdl-1.2.15/test/COPYING8
-rw-r--r--distrib/sdl-1.2.15/test/Makefile.in117
-rw-r--r--distrib/sdl-1.2.15/test/README35
-rw-r--r--distrib/sdl-1.2.15/test/acinclude.m4181
-rwxr-xr-xdistrib/sdl-1.2.15/test/autogen.sh12
-rw-r--r--distrib/sdl-1.2.15/test/checkkeys.c146
-rw-r--r--distrib/sdl-1.2.15/test/configure.in105
-rwxr-xr-xdistrib/sdl-1.2.15/test/gcc-fat.sh134
-rw-r--r--distrib/sdl-1.2.15/test/graywin.c257
-rw-r--r--distrib/sdl-1.2.15/test/icon.bmpbin0 -> 578 bytes
-rw-r--r--distrib/sdl-1.2.15/test/loopwave.c114
-rw-r--r--distrib/sdl-1.2.15/test/moose.datbin0 -> 56320 bytes
-rw-r--r--distrib/sdl-1.2.15/test/picture.xbm14
-rw-r--r--distrib/sdl-1.2.15/test/sail.bmpbin0 -> 15858 bytes
-rw-r--r--distrib/sdl-1.2.15/test/sample.bmpbin0 -> 69202 bytes
-rw-r--r--distrib/sdl-1.2.15/test/sample.wavbin0 -> 121946 bytes
-rw-r--r--distrib/sdl-1.2.15/test/testalpha.c547
-rw-r--r--distrib/sdl-1.2.15/test/testbitmap.c184
-rw-r--r--distrib/sdl-1.2.15/test/testblitspeed.c420
-rw-r--r--distrib/sdl-1.2.15/test/testcdrom.c209
-rw-r--r--distrib/sdl-1.2.15/test/testcursor.c216
-rw-r--r--distrib/sdl-1.2.15/test/testdyngl.c209
-rw-r--r--distrib/sdl-1.2.15/test/testerror.c61
-rw-r--r--distrib/sdl-1.2.15/test/testfile.c182
-rw-r--r--distrib/sdl-1.2.15/test/testgamma.c197
-rw-r--r--distrib/sdl-1.2.15/test/testgl.c856
-rw-r--r--distrib/sdl-1.2.15/test/testhread.c82
-rw-r--r--distrib/sdl-1.2.15/test/testiconv.c73
-rw-r--r--distrib/sdl-1.2.15/test/testjoystick.c188
-rw-r--r--distrib/sdl-1.2.15/test/testkeys.c25
-rw-r--r--distrib/sdl-1.2.15/test/testloadso.c71
-rw-r--r--distrib/sdl-1.2.15/test/testlock.c102
-rw-r--r--distrib/sdl-1.2.15/test/testoverlay.c594
-rw-r--r--distrib/sdl-1.2.15/test/testoverlay2.c600
-rw-r--r--distrib/sdl-1.2.15/test/testpalette.c342
-rw-r--r--distrib/sdl-1.2.15/test/testplatform.c210
-rw-r--r--distrib/sdl-1.2.15/test/testsem.c103
-rw-r--r--distrib/sdl-1.2.15/test/testsprite.c323
-rw-r--r--distrib/sdl-1.2.15/test/testtimer.c87
-rw-r--r--distrib/sdl-1.2.15/test/testver.c37
-rw-r--r--distrib/sdl-1.2.15/test/testvidinfo.c465
-rw-r--r--distrib/sdl-1.2.15/test/testwin.c377
-rw-r--r--distrib/sdl-1.2.15/test/testwm.c443
-rw-r--r--distrib/sdl-1.2.15/test/threadwin.c338
-rw-r--r--distrib/sdl-1.2.15/test/torturethread.c91
-rw-r--r--distrib/sdl-1.2.15/test/utf8.txt287
-rw-r--r--docs/ANDROID-KERNEL.TXT5
-rw-r--r--exec.c2
-rw-r--r--hw/android_mips.c282
-rw-r--r--hw/boards.h3
-rw-r--r--hw/goldfish_pipe.c48
-rw-r--r--hw/goldfish_pipe.h15
-rw-r--r--hw/mips_pic.c39
-rw-r--r--net-android.c2
-rw-r--r--net.c2
-rw-r--r--osdep.c8
-rw-r--r--qemu-common.h16
-rw-r--r--sockets.c55
-rw-r--r--softmmu_outside_jit.h4
-rw-r--r--tap-win32.c8
-rw-r--r--target-arm/exec.h2
-rw-r--r--target-i386/exec.h2
-rw-r--r--target-mips/cpu.h33
-rw-r--r--target-mips/exec.h20
-rw-r--r--target-mips/helper.c223
-rw-r--r--target-mips/machine.c2
-rw-r--r--target-mips/op_helper.c176
-rw-r--r--target-mips/translate.c1
-rw-r--r--tcg/tcg.c9
-rw-r--r--telephony/android_modem.c2
-rw-r--r--vl-android.c78
2060 files changed, 387944 insertions, 173934 deletions
diff --git a/.gitignore b/.gitignore
index db1f286..6937091 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
-images/android_icon.o
+images/emulator_icon.o
objs/*
*.*~
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 0bfecdc..b64769e 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -1,3 +1,6 @@
# This empty file is here solely for the purpose of optimizing the Android build
# Please keep it there, and empty, thanks :-)
#
+
+$(call add-clean-step, rm -rf $(OUT_DIR)/host/linux-x86/obj/{SHARED,STATIC}_LIBRARIES/emulator*)
+$(call add-clean-step, rm -rf $(OUT_DIR)/host/linux-x86/obj/EXECUTABLES/emulator*)
diff --git a/INSTALL b/INSTALL
index 989b714..c9d178a 100644
--- a/INSTALL
+++ b/INSTALL
@@ -77,7 +77,7 @@ these simple steps:
1/ First, build Android's patched libSDL as a static library,
this can be done as:
- cd $TOP/external/qemu/distrib/sdl-1.2.12
+ cd $TOP/external/qemu/distrib/sdl-1.2.15
./android-configure --prefix=<PATH>
make
make install
diff --git a/Makefile.android b/Makefile.android
index 8116758..c7d43af 100644
--- a/Makefile.android
+++ b/Makefile.android
@@ -1,12 +1,18 @@
-ifneq (,$(filter $(TARGET_ARCH),arm x86))
+ifneq ($(filter true% %true,$(BUILD_EMULATOR)$(BUILD_STANDALONE_EMULATOR)),)
+
+ifneq (,$(filter $(TARGET_ARCH),arm x86 mips))
LOCAL_PATH:= $(call my-dir)
# determine the target cpu
ifeq ($(TARGET_ARCH),arm)
EMULATOR_TARGET_CPU := target-arm
-else
+endif
+ifeq ($(TARGET_ARCH),x86)
EMULATOR_TARGET_CPU := target-i386
endif
+ifeq ($(TARGET_ARCH),mips)
+EMULATOR_TARGET_CPU := target-mips
+endif
# determine the host tag to use
QEMU_HOST_TAG := $(HOST_PREBUILT_TAG)
@@ -29,18 +35,14 @@ MY_CC := $(HOST_CC)
MY_CXX := $(HOST_CXX)
MY_AR := $(HOST_AR)
-MY_OPTIM := -O2 -g -fno-PIC -falign-functions=0 -fomit-frame-pointer
-ifeq ($(BUILD_DEBUG_EMULATOR),true)
- MY_OPTIM := -O0 -g
-endif
-
-MY_CFLAGS := $(CONFIG_INCLUDES) $(MY_OPTIM)
+MY_CFLAGS := $(CONFIG_INCLUDES) -O2 -g -fno-PIC -falign-functions=0 -fomit-frame-pointer
# Overwrite configuration for debug builds.
#
ifeq ($(BUILD_DEBUG_EMULATOR),true)
- MY_CFLAGS := $(CONFIG_INCLUDES) -O0 -g \
- -fno-PIC -falign-functions=0
+ MY_CFLAGS := $(CONFIG_INCLUDES)
+ MY_CFLAGS += -O0 -g
+ MY_CFLAGS += -fno-PIC -falign-functions=0
endif
MY_LDLIBS :=
@@ -71,22 +73,9 @@ endif
ifeq ($(HOST_OS),darwin)
MY_CFLAGS += -mdynamic-no-pic -D_DARWIN_C_SOURCE=1
- # When building on Leopard or above, we need to use the 10.4 SDK
- # or the generated binary will not run on Tiger.
- DARWIN_VERSION := $(strip $(shell sw_vers -productVersion))
- ifneq ($(filter 10.1 10.2 10.3 10.1.% 10.2.% 10.3.% 10.4 10.4.%,$(DARWIN_VERSION)),)
- $(error Building the Android emulator requires OS X 10.5 or above)
- endif
- ifneq ($(filter 10.6 10.6.%,$(DARWIN_VERSION)),)
- # We are on Snow Leopard
- LEOPARD_SDK := /Developer/SDKs/MacOSX10.5.sdk
- ifeq ($(strip $(wildcard $(LEOPARD_SDK))),)
- $(info Please install the 10.5 SDK on this machine at $(LEOPARD_SDK))
- $(error Aborting the build.)
- endif
- MY_CFLAGS += -isysroot $(LEOPARD_SDK) -mmacosx-version-min=10.5 -DMACOSX_DEPLOYMENT_TARGET=10.5
- MY_LDLIBS += -isysroot $(LEOPARD_SDK) -Wl,-syslibroot,$(LEOPARD_SDK) -mmacosx-version-min=10.5
- endif
+ MY_CFLAGS += -isysroot $(mac_sdk_root) -mmacosx-version-min=$(mac_sdk_version) -DMACOSX_DEPLOYMENT_TARGET=$(mac_sdk_version)
+ MY_LDLIBS += -isysroot $(mac_sdk_root) -Wl,-syslibroot,$(mac_sdk_root) -mmacosx-version-min=$(mac_sdk_version)
+
endif
# BUILD_STANDALONE_EMULATOR is only defined when building with
@@ -116,6 +105,9 @@ ifneq ($(BUILD_STANDALONE_EMULATOR),true)
endif
ccache :=
endif
+
+ QEMU_OPENGLES_INCLUDE := sdk/emulator/opengl/host/include
+ QEMU_OPENGLES_LIBS := $(HOST_OUT)
endif
@@ -129,6 +121,10 @@ ifneq ($(combo_target)$(TARGET_SIMULATOR),HOST_true)
MY_LDLIBS += -m32
endif
endif
+
+ ifneq ($(BUILD_HOST_static),)
+ MY_LDLIBS += -static
+ endif
endif
# Enable warning, except those related to missing field initializers
@@ -157,7 +153,6 @@ start-emulator-library = \
$(eval LOCAL_CFLAGS := $(MY_CFLAGS)) \
$(eval LOCAL_AR := $(MY_AR)) \
$(eval LOCAL_LDLIBS := $(MY_LDLIBS)) \
- $(eval LOCAL_MODULE_TAGS := debug) \
$(eval LOCAL_MODULE := $1) \
$(eval LOCAL_MODULE_CLASS := STATIC_LIBRARIES)
@@ -202,16 +197,43 @@ endif
ifeq ($(HOST_OS),darwin)
QEMU_SYSTEM_LDLIBS += -Wl,-framework,Cocoa,-framework,QTKit,-framework,CoreVideo
- ifneq ($(filter 10.7 10.7.% 10.8 10.8.%,$(DARWIN_VERSION)),)
- # Lion (and above) / XCode4 needs to be explicitly told the dynamic library
- # lookup symbols in the precompiled libSDL are resolved at
- # runtime
+
+ # SDK 10.6+ doesn't have __dyld_func_lookup anymore. Dynamic library lookup symbols
+ # are instead resolved at runtime
+ OSX_VERSION_MAJOR := $(shell echo $(mac_sdk_version) | cut -d . -f 2)
+ OSX_VERSION_MAJOR_GREATER_THAN_OR_EQUAL_TO_6 := $(shell [ $(OSX_VERSION_MAJOR) -ge 6 ] && echo true)
+ ifeq ($(OSX_VERSION_MAJOR_GREATER_THAN_OR_EQUAL_TO_6),true)
QEMU_SYSTEM_LDLIBS += -undefined dynamic_lookup
endif
endif
include $(LOCAL_PATH)/Makefile.common
+ifeq ($(HOST_OS),windows)
+ # on Windows, link the icon file as well into the executable
+ # unfortunately, our build system doesn't help us much, so we need
+ # to use some weird pathnames to make this work...
+
+ # Locate windres executable
+ WINDRES := windres
+ ifneq ($(USE_MINGW),)
+ # When building the Windows emulator under Linux, use the MinGW one
+ WINDRES := i586-mingw32msvc-windres
+ endif
+
+ # Usage: $(eval $(call insert-windows-icon))
+ define insert-windows-icon
+ LOCAL_PREBUILT_OBJ_FILES += images/emulator_icon.o
+ endef
+
+# This seems to be the only way to add an object file that was not generated from
+# a C/C++/Java source file to our build system. and very unfortunately,
+# $(TOPDIR)/$(LOCALPATH) will always be prepended to this value, which forces
+# us to put the object file in the source directory.
+$(LOCAL_PATH)/images/emulator_icon.o: $(LOCAL_PATH)/images/android_icon.rc
+ $(WINDRES) $< -I $(LOCAL_PATH)/images -o $@
+endif
+
# We want to build all variants of the emulator binaries. This makes
# it easier to catch target-specific regressions during emulator development.
EMULATOR_TARGET_ARCH := arm
@@ -220,6 +242,9 @@ include $(LOCAL_PATH)/Makefile.target
EMULATOR_TARGET_ARCH := x86
include $(LOCAL_PATH)/Makefile.target
+EMULATOR_TARGET_ARCH := mips
+include $(LOCAL_PATH)/Makefile.target
+
##############################################################################
##############################################################################
###
@@ -231,6 +256,10 @@ $(call start-emulator-program, emulator)
LOCAL_SRC_FILES := android/main-emulator.c
LOCAL_STATIC_LIBRARIES := emulator-common
+ifeq ($(HOST_OS),windows)
+$(eval $(call insert-windows-icon))
+endif
+
$(call end-emulator-program)
##############################################################################
@@ -246,7 +275,6 @@ LOCAL_STATIC_LIBRARIES := \
emulator-libui \
emulator-common \
-
LOCAL_CFLAGS += -DCONFIG_STANDALONE_UI=1
LOCAL_CFLAGS += $(EMULATOR_COMMON_CFLAGS) $(EMULATOR_LIBUI_CFLAGS)
@@ -280,4 +308,5 @@ $(call end-emulator-program)
## VOILA!!
-endif # TARGET_ARCH == arm || TARGET_ARCH == x86
+endif # TARGET_ARCH == arm || TARGET_ARCH == x86 || TARGET_ARCH == mips
+endif # BUILD_EMULATOR == true || BUILD_STANDALONE_EMULATOR == true
diff --git a/Makefile.common b/Makefile.common
index 3b37429..882d638 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -139,12 +139,10 @@ $(call gen-hw-config-defs)
$(call end-emulator-library)
## another for 64-bit
-# NOTE: only linux in non-standalone mode on 64-bit hosts is supported, because
+# NOTE: only linux and darwin in non-standalone mode is supported, because
# 1) For Windows: amd64-mingw32msvc-gcc doesn't work, see http://b/issue?id=5949152.
-# 2) For MacOSX: 64-bit libSDL*.a 1.2.x depends on NSQuickDrawView doesn't exist
-# 3) Standalone has --try-64
-ifeq ($(HOST_OS),linux)
- ifeq ($(HOST_BITS),64)
+# 2) Standalone has --try-64
+ifneq ($(filter linux darwin,$(HOST_OS)),)
ifneq ($(BUILD_STANDALONE_EMULATOR),true)
$(call start-emulator-library, emulator64-common)
LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) -m64
@@ -152,8 +150,7 @@ ifeq ($(HOST_OS),linux)
$(call gen-hw-config-defs)
$(call end-emulator-library)
endif # BUILD_STANDALONE_EMULATOR == nil
- endif # HOST_BITS == 64
-endif # HOST_OS == linux
+endif # HOST_OS == linux || darwin
##############################################################################
##############################################################################
@@ -166,7 +163,9 @@ endif # HOST_OS == linux
common_LOCAL_CFLAGS =
common_LOCAL_SRC_FILES =
-EMULATOR_LIBUI_CFLAGS :=
+ifneq ($(QEMU_OPENGLES_INCLUDE),)
+ EMULATOR_LIBUI_CFLAGS := -I$(QEMU_OPENGLES_INCLUDE)
+endif
common_LOCAL_CFLAGS += $(EMULATOR_COMMON_CFLAGS)
@@ -198,14 +197,6 @@ ifeq ($(QEMU_HOST_TAG),linux-x86)
BUILD_SDL_FROM_SOURCES := false
endif
-# On darwin-x86, a bug in the Android build system prevents the compilation
-# of Objective-C sources. Fixed recently in AOSP, but we still use the
-# prebuilts for the benefit of older platform branches.
-#
-ifeq ($(QEMU_HOST_TAG),darwin-x86)
- BUILD_SDL_FROM_SOURCES := false
-endif
-
# If we're building with android-configure.sh && make, always build from
# sources to catch regressions as soon as they happen.
#
@@ -238,7 +229,7 @@ ifneq ($(BUILD_SDL_FROM_SOURCES),true)
else # BUILD_SDL_FROM_SOURCES
- SDL_DIR := distrib/sdl-1.2.12
+ SDL_DIR := distrib/sdl-1.2.15
include $(LOCAL_PATH)/$(SDL_DIR)/sources.make
common_LOCAL_SRC_FILES += $(SDL_SOURCES)
@@ -296,8 +287,7 @@ $(call end-emulator-library)
## another for 64-bit, see note in emulator64-common
-ifeq ($(HOST_OS),linux)
- ifeq ($(HOST_BITS),64)
+ifneq ($(filter linux darwin,$(HOST_OS)),)
ifneq ($(BUILD_STANDALONE_EMULATOR),true)
$(call start-emulator-library, emulator64-libui)
LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) -m64
@@ -305,8 +295,7 @@ ifeq ($(HOST_OS),linux)
$(call gen-hw-config-defs)
$(call end-emulator-library)
endif # BUILD_STANDALONE_EMULATOR == nil
- endif # HOST_BITS == 64
-endif # HOST_OS == linux
+endif # HOST_OS == linux || darwin
##############################################################################
@@ -325,18 +314,6 @@ EMULATOR_LIBQEMU_CFLAGS :=
common_LOCAL_CFLAGS += $(EMULATOR_COMMON_CFLAGS)
-###########################################################
-# Jpeg configuration
-#
-LIBJPEG_DIR := distrib/jpeg-6b
-include $(LOCAL_PATH)/$(LIBJPEG_DIR)/sources.make
-
-EMULATOR_LIBQEMU_CFLAGS += \
- $(LIBJPEG_CFLAGS) \
- -I$(LOCAL_PATH)/$(LIBJPEG_DIR)
-
-common_LOCAL_SRC_FILES += $(LIBJPEG_SOURCES)
-
AUDIO_SOURCES := noaudio.c wavaudio.c wavcapture.c mixeng.c
AUDIO_CFLAGS := -I$(LOCAL_PATH)/audio -DHAS_AUDIO
AUDIO_LDLIBS :=
@@ -480,7 +457,6 @@ CORE_MISC_SOURCES = \
android/hw-pipe-net.c \
android/qemu-setup.c \
android/snapshot.c \
- android/android-device.c \
android/async-socket-connector.c \
android/async-socket.c \
android/sdk-controller-socket.c \
@@ -529,7 +505,7 @@ endif
common_LOCAL_SRC_FILES += $(CORE_MISC_SOURCES)
# Required
-common_LOCAL_CFLAGS += -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
+common_LOCAL_CFLAGS += -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1 -I$(LOCAL_PATH)/distrib/jpeg-6b
SLIRP_SOURCES := \
bootp.c \
@@ -623,8 +599,7 @@ $(call end-emulator-library)
## another for 64-bit, see note in emulator64-common
-ifeq ($(HOST_OS),linux)
- ifeq ($(HOST_BITS),64)
+ifneq ($(filter linux darwin,$(HOST_OS)),)
ifneq ($(BUILD_STANDALONE_EMULATOR),true)
$(call start-emulator-library, emulator64-libqemu)
# gdbstub-xml.c contains C-compilable arrays corresponding to the content
@@ -644,8 +619,7 @@ ifeq ($(HOST_OS),linux)
$(call gen-hw-config-defs)
$(call end-emulator-library)
endif # BUILD_STANDALONE_EMULATOR == nil
- endif # HOST_BITS == 64
-endif # HOST_OS == linux
+endif # HOST_OS == linux || darwin
# Block sources, we must compile them with each executable because they
@@ -678,6 +652,46 @@ endif
BLOCK_CFLAGS += $(EMULATOR_COMMON_CFLAGS)
BLOCK_CFLAGS += -DCONFIG_BDRV_WHITELIST=""
+##############################################################################
+##############################################################################
+###
+### emulator-libjpeg: TARGET-INDEPENDENT QEMU FUNCTIONS
+###
+### THESE ARE USED BY EVERYTHING EXCEPT 'emulator-ui'
+###
+
+common_LOCAL_CFLAGS =
+common_LOCAL_SRC_FILES =
+
+###########################################################
+# Jpeg configuration
+#
+LIBJPEG_DIR := distrib/jpeg-6b
+include $(LOCAL_PATH)/$(LIBJPEG_DIR)/sources.make
+
+common_LOCAL_SRC_FILES += $(LIBJPEG_SOURCES)
+
+common_LOCAL_CFLAGS += \
+ $(LIBJPEG_CFLAGS) \
+ -I$(LOCAL_PATH)/$(LIBJPEG_DIR)
+
+## one for 32-bit
+$(call start-emulator-library, emulator-libjpeg)
+LOCAL_CFLAGS += $(common_LOCAL_CFLAGS)
+LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
+$(call end-emulator-library)
+
+
+## another for 64-bit, see note in emulator64-common
+ifneq ($(filter linux darwin,$(HOST_OS)),)
+ ifneq ($(BUILD_STANDALONE_EMULATOR),true)
+ $(call start-emulator-library, emulator64-libjpeg)
+ LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) -m64
+ LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
+ $(call end-emulator-library)
+ endif # BUILD_STANDALONE_EMULATOR == nil
+endif # HOST_OS == linux
+
##############################################################################
##############################################################################
@@ -719,8 +733,7 @@ $(call end-emulator-library)
## another for 64-bit, see note in emulator64-common
-ifeq ($(HOST_OS),linux)
- ifeq ($(HOST_BITS),64)
+ifneq ($(filter linux darwin,$(HOST_OS)),)
ifneq ($(BUILD_STANDALONE_EMULATOR),true)
$(call start-emulator-library, emulator64-libelff)
LOCAL_CPP_EXTENSION := .cc
@@ -728,8 +741,7 @@ ifeq ($(HOST_OS),linux)
LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
$(call end-emulator-library)
endif # BUILD_STANDALONE_EMULATOR == nil
- endif # HOST_BITS == 64
-endif # HOST_OS == linux
+endif # HOST_OS == linux || darwin
##############################################################################
diff --git a/Makefile.target b/Makefile.target
index 916ab21..3e45c61 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -1,6 +1,6 @@
# This file is included several times to build target-specific
# modules for the Android emulator. It will be called several times
-# (e.g. once for the arm target, and once for the x86 target).
+# for arm, x86 and mips
#
ifndef EMULATOR_TARGET_ARCH
@@ -26,7 +26,7 @@ EMULATOR_TARGET_CFLAGS := \
-I$(LOCAL_PATH)/android/config/target-$(EMULATOR_TARGET_ARCH) \
-I$(LOCAL_PATH)/target-$(EMULATOR_TARGET_CPU) \
-I$(LOCAL_PATH)/fpu \
- -DNEED_CPU_H \
+ -DNEED_CPU_H
TCG_TARGET := $(HOST_ARCH)
ifeq ($(HOST_ARCH),x86)
@@ -96,7 +96,7 @@ HW_SOURCES += android_arm.c \
goldfish_switch.c \
goldfish_timer.c \
goldfish_trace.c \
- arm_boot.c \
+ arm_boot.c
# The following sources must be compiled with the final executables
# because they contain device_init() or machine_init() statements.
@@ -135,6 +135,31 @@ HW_OBJ_CFLAGS := $(EMULATOR_TARGET_CFLAGS)
endif
+ifeq ($(EMULATOR_TARGET_ARCH),mips)
+HW_SOURCES += \
+ android_mips.c \
+ mips_pic.c \
+ goldfish_interrupt.c \
+ goldfish_switch.c \
+ goldfish_timer.c \
+ goldfish_trace.c \
+ mips_timer.c \
+ mips_int.c
+
+# The following sources must be compiled with the final executables
+# because they contain device_init() or machine_init() statements.
+HW_OBJ_SOURCES := hw/smc91c111.c
+HW_OBJ_CFLAGS := $(EMULATOR_TARGET_CFLAGS)
+
+common_LOCAL_SRC_FILES += mips-dis.c
+
+# smc91c111.c requires <zlib.h>
+LOCAL_CFLAGS += $(ZLIB_CFLAGS)
+ifeq ($(ARCH_HAS_BIGENDIAN),true)
+ LOCAL_CFLAGS += -DTARGET_WORDS_BIGENDIAN
+endif
+
+endif
common_LOCAL_SRC_FILES += $(HW_SOURCES:%=hw/%)
common_LOCAL_SRC_FILES += \
@@ -143,7 +168,7 @@ common_LOCAL_SRC_FILES += \
translate-all.c \
trace.c \
varint.c \
- softmmu_outside_jit.c \
+ softmmu_outside_jit.c
##############################################################################
# CPU-specific emulation.
@@ -165,7 +190,7 @@ common_LOCAL_SRC_FILES += \
target-arm/machine.c \
hw/armv7m.c \
hw/armv7m_nvic.c \
- arm-semi.c \
+ arm-semi.c
common_LOCAL_SRC_FILES += fpu/softfloat.c
endif
@@ -192,6 +217,16 @@ endif
common_LOCAL_SRC_FILES += fpu/softfloat-native.c
endif
+ifeq ($(EMULATOR_TARGET_ARCH), mips)
+common_LOCAL_SRC_FILES += \
+ target-mips/op_helper.c \
+ target-mips/helper.c \
+ target-mips/translate.c \
+ target-mips/machine.c
+
+common_LOCAL_SRC_FILES += fpu/softfloat.c
+endif
+
# compile KVM only if target is x86 on x86 Linux
QEMU_KVM_TAG := $(QEMU_HOST_TAG)-$(EMULATOR_TARGET_ARCH)
QEMU_DO_KVM := $(if $(filter linux-x86-x86 linux-x86_64-x86,$(QEMU_KVM_TAG)),true,false)
@@ -220,7 +255,7 @@ MCHK_SOURCES := \
memcheck_proc_management.c \
memcheck_malloc_map.c \
memcheck_mmrange_map.c \
- memcheck_util.c \
+ memcheck_util.c
common_LOCAL_SRC_FILES += $(MCHK_SOURCES:%=memcheck/%)
@@ -246,8 +281,7 @@ $(call gen-hx-header,qemu-options.hx,qemu-options.def,os-posix.c os-win32.c)
$(call end-emulator-library)
## another for 64-bit, see note in file Makefile.common emulator64-common
-ifeq ($(HOST_OS),linux)
- ifeq ($(HOST_BITS),64)
+ifneq ($(filter linux darwin,$(HOST_OS)),)
ifneq ($(BUILD_STANDALONE_EMULATOR),true)
$(call start-emulator-library, emulator64-target-$(EMULATOR_TARGET_CPU))
LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) -m64
@@ -256,8 +290,7 @@ ifeq ($(HOST_OS),linux)
$(call gen-hx-header,qemu-options.hx,qemu-options.def,os-posix.c os-win32.c)
$(call end-emulator-library)
endif # BUILD_STANDALONE_EMULATOR == nil
- endif # HOST_BITS == 64
-endif # HOST_OS == linux
+endif # HOST_OS == linux || darwin
@@ -274,22 +307,25 @@ LOCAL_CFLAGS += \
$(ELFF_CFLAGS) \
$(EMULATOR_LIBQEMU_CFLAGS) \
$(EMULATOR_TARGET_CFLAGS) \
- -DCONFIG_STANDALONE_CORE \
+ -DCONFIG_STANDALONE_CORE
-LOCAL_CFLAGS += -Wno-missing-field-initializers
+ifneq ($(QEMU_OPENGLES_INCLUDE),)
+ LOCAL_CFLAGS += -I$(QEMU_OPENGLES_INCLUDE)
+endif
+LOCAL_CFLAGS += -Wno-missing-field-initializers
LOCAL_STATIC_LIBRARIES := \
emulator-libqemu \
emulator-target-$(EMULATOR_TARGET_CPU) \
+ emulator-libjpeg \
emulator-libelff \
- emulator-common \
-
+ emulator-common
LOCAL_LDLIBS += \
$(EMULATOR_COMMON_LDLIBS) \
$(EMULATOR_LIBQEMU_LDLIBS) \
- $(ELFF_LDLIBS) \
+ $(ELFF_LDLIBS)
LOCAL_SRC_FILES := \
audio/audio.c \
@@ -311,7 +347,7 @@ LOCAL_SRC_FILES := \
android/protocol/user-events-impl.c \
android/protocol/ui-commands-proxy.c \
android/protocol/core-commands-impl.c \
- android/protocol/core-commands-qemu.c \
+ android/protocol/core-commands-qemu.c
$(call gen-hx-header,qemu-monitor.hx,qemu-monitor.h,monitor.c)
$(call gen-hx-header,qemu-options.hx,qemu-options.def,vl-android.c qemu-options.h)
@@ -325,7 +361,7 @@ endif
# Generate a completely static executable if needed.
# Note that this means no sound and graphics on Linux.
#
-ifeq ($(CONFIG_STATIC_EXECUTABLE),true)
+ifneq ($(strip $(CONFIG_STATIC_EXECUTABLE)$(BUILD_HOST_static)),)
LOCAL_SRC_FILES += dynlink-static.c
LOCAL_LDLIBS += -static
endif
@@ -338,8 +374,6 @@ LOCAL_CFLAGS += $(HW_OBJ_CFLAGS)
LOCAL_SRC_FILES += $(BLOCK_SOURCES)
LOCAL_CFLAGS += $(BLOCK_CFLAGS)
-LOCAL_MODULE_TAGS := debug
-
$(call end-emulator-program)
##############################################################################
@@ -359,13 +393,13 @@ common_LOCAL_STATIC_LIBRARIES := \
emulator-libqemu \
emulator-target-$(EMULATOR_TARGET_CPU) \
emulator-libelff \
- emulator-common \
+ emulator-common
common_LOCAL_LDLIBS += \
$(EMULATOR_COMMON_LDLIBS) \
$(EMULATOR_LIBQEMU_LDLIBS) \
$(EMULATOR_LIBUI_LDLIBS) \
- $(ELFF_LDLIBS) \
+ $(ELFF_LDLIBS)
common_LOCAL_CFLAGS += \
$(EMULATOR_TARGET_CFLAGS) \
@@ -411,7 +445,7 @@ common_LOCAL_SRC_FILES += $(SDLMAIN_SOURCES)
# Generate a completely static executable if needed.
# Note that this means no sound and graphics on Linux.
#
-ifeq ($(CONFIG_STATIC_EXECUTABLE),true)
+ifneq ($(strip $(CONFIG_STATIC_EXECUTABLE)$(BUILD_HOST_static)),)
common_LOCAL_SRC_FILES += dynlink-static.c
common_LOCAL_LDLIBS += -static
endif
@@ -422,6 +456,7 @@ LOCAL_STATIC_LIBRARIES += \
emulator-libui \
emulator-libqemu \
emulator-target-$(EMULATOR_TARGET_CPU) \
+ emulator-libjpeg \
emulator-libelff \
emulator-common \
$(SDL_STATIC_LIBRARIES)
@@ -431,18 +466,23 @@ LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
$(call gen-hx-header,qemu-monitor.hx,qemu-monitor.h,monitor.c)
$(call gen-hx-header,qemu-options.hx,qemu-options.def,vl-android.c qemu-options.h)
$(call gen-hw-config-defs)
+
+ifeq ($(HOST_OS),windows)
+$(eval $(call insert-windows-icon))
+endif
+
$(call end-emulator-program)
## another for 64-bit, see note in file Makefile.common emulator64-common
-ifeq ($(HOST_OS),linux)
- ifeq ($(HOST_BITS),64)
+ifneq ($(filter linux darwin,$(HOST_OS)),)
ifneq ($(BUILD_STANDALONE_EMULATOR),true)
$(call start-emulator-program, emulator64-$(EMULATOR_TARGET_ARCH))
LOCAL_STATIC_LIBRARIES += \
emulator64-libui \
emulator64-libqemu \
emulator64-target-$(EMULATOR_TARGET_CPU) \
+ emulator64-libjpeg \
emulator64-libelff \
emulator64-common \
$(SDL_STATIC_LIBRARIES_64)
@@ -454,5 +494,5 @@ ifeq ($(HOST_OS),linux)
$(call gen-hw-config-defs)
$(call end-emulator-program)
endif # BUILD_STANDALONE_EMULATOR == nil
- endif # HOST_BITS == 64
-endif # HOST_OS == linux
+endif # HOST_OS == linux || darwin
+
diff --git a/android-configure.sh b/android-configure.sh
index 5620e0e..38af78e 100755
--- a/android-configure.sh
+++ b/android-configure.sh
@@ -22,7 +22,6 @@ OPTION_IGNORE_AUDIO=no
OPTION_NO_PREBUILTS=no
OPTION_TRY_64=no
OPTION_HELP=no
-OPTION_DEBUG=no
OPTION_STATIC=no
OPTION_MINGW=no
@@ -60,8 +59,6 @@ for opt do
;;
--no-strip) OPTION_NO_STRIP=yes
;;
- --debug) OPTION_DEBUG=yes
- ;;
--ignore-audio) OPTION_IGNORE_AUDIO=yes
;;
--no-prebuilts) OPTION_NO_PREBUILTS=yes
@@ -196,15 +193,9 @@ if [ "$IN_ANDROID_BUILD" = "yes" ] ; then
# use ccache if USE_CCACHE is defined and the corresponding
# binary is available.
#
- # note: located in PREBUILT/ccache/ccache in the new tree layout
- # located in PREBUILT/ccache in the old one
- #
if [ -n "$USE_CCACHE" ] ; then
CCACHE="$ANDROID_PREBUILT/ccache/ccache$EXE"
if [ ! -f $CCACHE ] ; then
- CCACHE="$ANDROID_PREBUILT/ccache$EXE"
- fi
- if [ ! -f $CCACHE ] ; then
CCACHE="$ANDROID_PREBUILTS/ccache/ccache$EXE"
fi
if [ -f $CCACHE ] ; then
@@ -240,7 +231,7 @@ if [ "$IN_ANDROID_BUILD" = "yes" ] ; then
GLES_SUPPORT=yes
if [ -z "$GLES_INCLUDE" ]; then
log "GLES : Probing for headers"
- GLES_INCLUDE=$ANDROID_TOP/development/tools/emulator/opengl/host/include
+ GLES_INCLUDE=$ANDROID_TOP/sdk/emulator/opengl/host/include
if [ -d "$GLES_INCLUDE" ]; then
log "GLES : Headers in $GLES_INCLUDE"
else
@@ -261,6 +252,32 @@ if [ "$IN_ANDROID_BUILD" = "yes" ] ; then
fi
fi
fi
+else
+ if [ "$GLES_PROBE" = "yes" ]; then
+ GLES_SUPPORT=yes
+ if [ -z "$GLES_INCLUDE" ]; then
+ log "GLES : Probing for headers"
+ GLES_INCLUDE=../../sdk/emulator/opengl/host/include
+ if [ -d "$GLES_INCLUDE" ]; then
+ log "GLES : Headers in $GLES_INCLUDE"
+ else
+ echo "Warning: Could not find OpenGLES emulation include dir: $GLES_INCLUDE"
+ echo "Disabling GLES emulation from this build!"
+ GLES_SUPPORT=no
+ fi
+ fi
+ if [ -z "$GLES_LIBS" ]; then
+ log "GLES : Probing for host libraries"
+ GLES_LIBS=../../out/host/$OS/lib
+ if [ -d "$GLES_LIBS" ]; then
+ echo "GLES : Libs in $GLES_LIBS"
+ else
+ echo "Warning: Could nof find OpenGLES emulation libraries in: $GLES_LIBS"
+ echo "Disabling GLES emulation from this build!"
+ GLES_SUPPORT=no
+ fi
+ fi
+ fi
fi # IN_ANDROID_BUILD = no
if [ "$GLES_SUPPORT" = "yes" ]; then
@@ -521,6 +538,10 @@ if [ $TARGET_ARCH = x86 ] ; then
echo "TARGET_ARCH := x86" >> $config_mk
fi
+if [ $TARGET_ARCH = mips ] ; then
+echo "TARGET_ARCH := mips" >> $config_mk
+fi
+
echo "HOST_PREBUILT_TAG := $TARGET_OS" >> $config_mk
echo "HOST_EXEEXT := $TARGET_EXEEXT" >> $config_mk
echo "PREBUILT := $ANDROID_PREBUILT" >> $config_mk
diff --git a/android/adb-qemud.c b/android/adb-qemud.c
index 1d2498e..9d82251 100644
--- a/android/adb-qemud.c
+++ b/android/adb-qemud.c
@@ -33,7 +33,8 @@
#define SERVICE_NAME "adb"
#define DEBUG_SERVICE_NAME "adb-debug"
-
+/* Maximum length of the message that can be received from the guest. */
+#define ADB_MAX_MSG_LEN 8
/* Enumerates ADB client state values. */
typedef enum AdbClientState {
/* Waiting on a connection from ADB host. */
@@ -58,6 +59,10 @@ struct AdbClient {
QemudClient* qemud_client;
/* Connection state. */
AdbClientState state;
+ /* Buffer, collecting accept / stop messages from client. */
+ char msg_buffer[ADB_MAX_MSG_LEN];
+ /* Current position in message buffer. */
+ int msg_cur;
};
/* ADB debugging client descriptor. */
@@ -183,17 +188,36 @@ _adb_client_recv(void* opaque, uint8_t* msg, int msglen, QemudClient* client)
D("ADB client %p(o=%p) received from guest %d bytes in %s",
adb_client, adb_client->opaque, msglen, QB(msg, msglen));
+ if (adb_client->state == ADBC_STATE_CONNECTED) {
+ /* Connection is fully established. Dispatch the message to the host. */
+ adb_server_on_guest_message(adb_client->opaque, msg, msglen);
+ return;
+ }
+
+ /*
+ * At this point we expect either "accept", or "start" messages. Depending
+ * on the state of the pipe (although small) these messages could be broken
+ * into pieces. So, simply checking msg for "accept", or "start" may not
+ * work. Lets collect them first in internal buffer, and then will see.
+ */
+
+ /* Make sure tha message doesn't overflow the buffer. */
+ if ((msglen + adb_client->msg_cur) > sizeof(adb_client->msg_buffer)) {
+ D("Unexpected message in ADB client.");
+ adb_client->msg_cur = 0;
+ return;
+ }
+ /* Append to current message. */
+ memcpy(adb_client->msg_buffer + adb_client->msg_cur, msg, msglen);
+ adb_client->msg_cur += msglen;
+
/* Properly dispatch the message, depending on the client state. */
switch (adb_client->state) {
- case ADBC_STATE_CONNECTED:
- /* Connection is fully established. Dispatch the message to the
- * host. */
- adb_server_on_guest_message(adb_client->opaque, msg, msglen);
- break;
-
case ADBC_STATE_WAIT_ON_HOST:
/* At this state the only message that is allowed is 'accept' */
- if (msglen == 6 && !memcmp(msg, "accept", 6)) {
+ if (adb_client->msg_cur == 6 &&
+ !memcmp(adb_client->msg_buffer, "accept", 6)) {
+ adb_client->msg_cur = 0;
/* Register ADB guest connection with the ADB server. */
adb_client->opaque =
adb_server_register_guest(adb_client, &_adb_client_routines);
@@ -210,7 +234,9 @@ _adb_client_recv(void* opaque, uint8_t* msg, int msglen, QemudClient* client)
case ADBC_STATE_HOST_CONNECTED:
/* At this state the only message that is allowed is 'start' */
- if (msglen == 5 && !memcmp(msg, "start", 5)) {
+ if (adb_client->msg_cur &&
+ !memcmp(adb_client->msg_buffer, "start", 5)) {
+ adb_client->msg_cur = 0;
adb_client->state = ADBC_STATE_CONNECTED;
adb_server_complete_connection(adb_client->opaque);
} else {
diff --git a/android/android-device.c b/android/android-device.c
deleted file mode 100644
index 5f88108..0000000
--- a/android/android-device.c
+++ /dev/null
@@ -1,1526 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * Encapsulates exchange protocol between the emulator, and an Android device
- * that is connected to the host via USB. The communication is established over
- * a TCP port forwarding, enabled by ADB.
- */
-
-#include "android/android-device.h"
-#include "utils/panic.h"
-#include "iolooper.h"
-
-#define E(...) derror(__VA_ARGS__)
-#define W(...) dwarning(__VA_ARGS__)
-#define D(...) VERBOSE_PRINT(adevice,__VA_ARGS__)
-#define D_ACTIVE VERBOSE_CHECK(adevice)
-
-/********************************************************************************
- * Common android device socket
- *******************************************************************************/
-
-/* Milliseconds between retrying asynchronous connections to the device. */
-#define ADS_RETRY_CONNECTION_TIMEOUT 3000
-
-/* Socket type. */
-typedef enum ADSType {
- /* Query socket. */
- ADS_TYPE_QUERY = 0,
- /* Events socket. */
- ADS_TYPE_EVENT = 1
-} ADSType;
-
-/* Status of the socket. */
-typedef enum ADSStatus {
- /* Socket is disconnected. */
- ADS_DISCONNECTED,
- /* Connection process has been started. */
- ADS_CONNECTING,
- /* Connection has been established. */
- ADS_CONNECTED,
- /* Socket has been registered with the server. */
- ADS_REGISTERED,
-} ADSStatus;
-
-/* Identifies socket as a "query" socket with the server. */
-static const char* _ads_query_socket_id = "query";
-/* Identifies socket as an "event" socket with the server. */
-static const char* _ads_event_socket_id = "event";
-
-/* Android device socket descriptor. */
-typedef struct AndroidDevSocket AndroidDevSocket;
-
-/*
- * Callback routines.
- */
-
-/* Callback routine that is called when a socket is connected.
- * Param:
- * opaque - Opaque pointer associated with the socket. Typicaly it's the same
- * pointer that is associated with AndroidDevice instance.
- * ads - Connection socket.
- * failure - If zero, indicates that socket has been successuly connected. If a
- * connection error has occured, this parameter contains the error code (as
- * in 'errno).
- */
-typedef void (*ads_socket_connected_cb)(void* opaque,
- struct AndroidDevSocket* ads,
- int failure);
-
-/* Android device socket descriptor. */
-struct AndroidDevSocket {
- /* Socket type. */
- ADSType type;
- /* Socket status. */
- ADSStatus socket_status;
- /* TCP address for the socket. */
- SockAddress address;
- /* Android device descriptor that owns the socket. */
- AndroidDevice* ad;
- /* Opaque pointer associated with the socket. Typicaly it's the same
- * pointer that is associated with AndroidDevice instance.*/
- void* opaque;
- /* Deadline for current I/O performed on the socket. */
- Duration deadline;
- /* Socket's file descriptor. */
- int fd;
-};
-
-/* Query socket descriptor. */
-typedef struct AndroidQuerySocket {
- /* Common device socket. */
- AndroidDevSocket dev_socket;
-} AndroidQuerySocket;
-
-/* Describes data to send via an asynchronous socket. */
-typedef struct AsyncSendBuffer {
- /* Next buffer to send. */
- struct AsyncSendBuffer* next;
- /* Callback to invoke when data transfer is completed. */
- async_send_cb complete_cb;
- /* An opaque pointer to pass to the transfer completion callback. */
- void* complete_opaque;
- /* Data to send. */
- uint8_t* data;
- /* Size of the entire data buffer. */
- int data_size;
- /* Remaining bytes to send. */
- int data_remaining;
- /* Boolean flag indicating whether to free data buffer upon completion. */
- int free_on_completion;
-} AsyncSendBuffer;
-
-/* Event socket descriptor. */
-typedef struct AndroidEventSocket {
- /* Common socket descriptor. */
- AndroidDevSocket dev_socket;
- /* Asynchronous connector to the device. */
- AsyncConnector connector[1];
- /* I/O port for asynchronous I/O on this socket. */
- LoopIo io[1];
- /* Asynchronous string reader. */
- AsyncLineReader alr;
- /* Callback to call at the end of the asynchronous connection to this socket.
- * Can be NULL. */
- ads_socket_connected_cb on_connected;
- /* Callback to call when an event is received on this socket. Can be NULL. */
- event_cb on_event;
- /* Lists buffers that are pending to be sent. */
- AsyncSendBuffer* send_pending;
-} AndroidEventSocket;
-
-/* Android device descriptor. */
-struct AndroidDevice {
- /* Query socket for the device. */
- AndroidQuerySocket query_socket;
- /* Event socket for the device. */
- AndroidEventSocket event_socket;
- /* An opaque pointer associated with this descriptor. */
- void* opaque;
- /* I/O looper for synchronous I/O on the sockets for this device. */
- IoLooper* io_looper;
- /* Timer that is used to retry asynchronous connections. */
- LoopTimer timer[1];
- /* I/O looper for asynchronous I/O. */
- Looper* looper;
- /* Callback to call when device is fully connected. */
- device_connected_cb on_connected;
- /* I/O failure callback .*/
- io_failure_cb on_io_failure;
-};
-
-/* Creates descriptor for a buffer to send asynchronously.
- * Param:
- * data, size - Buffer to send.
- * free_on_close - Boolean flag indicating whether to free data buffer upon
- * completion.
- * cb - Callback to invoke when data transfer is completed.
- * opaque - An opaque pointer to pass to the transfer completion callback.
- */
-static AsyncSendBuffer*
-_async_send_buffer_create(void* data,
- int size,
- int free_on_close,
- async_send_cb cb,
- void* opaque)
-{
- AsyncSendBuffer* desc = malloc(sizeof(AsyncSendBuffer));
- if (desc == NULL) {
- APANIC("Unable to allocate %d bytes for AsyncSendBuffer",
- sizeof(AsyncSendBuffer));
- }
- desc->next = NULL;
- desc->data = (uint8_t*)data;
- desc->data_size = desc->data_remaining = size;
- desc->free_on_completion = free_on_close;
- desc->complete_cb = cb;
- desc->complete_opaque = opaque;
-
- return desc;
-}
-
-/* Completes data transfer for the given descriptor.
- * Note that this routine will free the descriptor.
- * Param:
- * desc - Asynchronous data transfer descriptor. Will be freed upon the exit
- * from this routine.
- * res - Data transfer result.
- */
-static void
-_async_send_buffer_complete(AsyncSendBuffer* desc, ATResult res)
-{
- /* Invoke completion callback (if present) */
- if (desc->complete_cb) {
- desc->complete_cb(desc->complete_opaque, res, desc->data, desc->data_size,
- desc->data_size - desc->data_remaining);
- }
-
- /* Free data buffer (if required) */
- if (desc->free_on_completion) {
- free(desc->data);
- }
-
- /* Free the descriptor itself. */
- free(desc);
-}
-
-/********************************************************************************
- * Common socket declarations
- *******************************************************************************/
-
-/* Initializes common device socket.
- * Param:
- * ads - Socket descriptor to initialize.
- * opaque - An opaque pointer to associate with the socket. Typicaly it's the
- * same pointer that is associated with AndroidDevice instance.
- * ad - Android device descriptor that owns the socket.
- * port - Socket's TCP port.
- * type - Socket type (query, or event).
- */
-static int _android_dev_socket_init(AndroidDevSocket* ads,
- void* opaque,
- AndroidDevice* ad,
- int port,
- ADSType type);
-
-/* Destroys socket descriptor. */
-static void _android_dev_socket_destroy(AndroidDevSocket* ads);
-
-/* Callback that is ivoked from _android_dev_socket_connect when a file
- * descriptor has been created for a socket.
- * Param:
- * ads - Socket descritor.
- * opaque - An opaque pointer associated with the callback.
- */
-typedef void (*on_socked_fd_created)(AndroidDevSocket* ads, void* opaque);
-
-/* Synchronously connects to the socket, and registers it with the server.
- * Param:
- * ads - Socket to connect. Must have 'deadline' field properly setup.
- * cb, opaque - A callback to invoke (and opaque parameters to pass to the
- * callback) when a file descriptor has been created for a socket. These
- * parameters are optional and can be NULL.
- * Return:
- * 0 on success, -1 on failure with errno containing the reason for failure.
- */
-static int _android_dev_socket_connect(AndroidDevSocket* ads,
- on_socked_fd_created cb,
- void* opaque);
-
-/* Synchronously registers a connected socket with the server.
- * Param:
- * ads - Socket to register. Must be connected, and must have 'deadline' field
- * properly setup.
- * Return:
- * 0 on success, -1 on failure with errno containing the reason for failure.
- */
-static int _android_dev_socket_register(AndroidDevSocket* ads);
-
-/* Disconnects the socket (if it was connected) */
-static void _android_dev_socket_disconnect(AndroidDevSocket* ads);
-
-/* Synchronously sends data to the socket.
- * Param:
- * ads - Socket to send the data to. Must be connected, and must have 'deadline'
- * field properly setup.
- * buff, buffsize - Buffer to send.
- * Return:
- * Number of bytes sent on success, or -1 on failure with errno containing the
- * reason for failure.
- */
-static int _android_dev_socket_send(AndroidDevSocket* ads,
- const char* buff,
- int buffsize);
-
-/* Synchronously receives data from the socket.
- * Param:
- * ads - Socket to receive the data from. Must be connected, and must have
- * 'deadline' field properly setup.
- * buff, buffsize - Buffer where to receive data.
- * Return:
- * Number of bytes received on success, or -1 on failure with errno containing
- * the reason for failure.
- */
-static int _android_dev_socket_recv(AndroidDevSocket* ads,
- char* buf,
- int bufsize);
-
-/* Synchronously reads zero-terminated string from the socket.
- * Param:
- * ads - Socket to read the string from. Must be connected, and must have
- * 'deadline' field properly setup.
- * str, strsize - Buffer where to read the string.
- * Return:
- * Number of charactes read into the string buffer (including zero-terminator)
- * on success, or -1 on failure with 'errno' containing the reason for failure.
- * If this routine returns -1, and errno contains ENOMEM, this is an indicator
- * that supplied string buffer was too small for the receiving string.
- */
-static int _android_dev_socket_read_string(AndroidDevSocket* ads,
- char* str,
- int strsize);
-
-/* Synchronously reads zero-terminated query response from the socket.
- * All queries respond with an 'ok', or 'ko' prefix, indicating a success, or
- * failure. Prefix can be followed by more query response data, separated from
- * the prefix with a ':' character. This routine helps separating prefix from the
- * data, by placing only the query response data into provided buffer. 'ko' or
- * 'ok' will be encoded in the return value.
- * Param:
- * ads - Socket to read the response from. Must be connected, and must have
- * 'deadline' field properly setup.
- * data, datasize - Buffer where to read the query response data.
- * Return:
- * Number of charactes read into the data buffer (including zero-terminator) on
- * success, or -1 on failure with errno containing the reason for failure.
- * If the query has been completed with 'ko', this routine will return -1, with
- * errno set to 0. If this routine returned -1, and errno is set to EINVAL, this
- * indicates that reply string didn't match expected query reply format.
- */
-static int _android_dev_socket_read_response(AndroidDevSocket* ads,
- char* str,
- int strsize);
-
-/* Gets ID string for the channel. */
-AINLINED const char*
-_ads_id_str(AndroidDevSocket* ads)
-{
- return (ads->type == ADS_TYPE_QUERY) ? _ads_query_socket_id :
- _ads_event_socket_id;
-}
-
-/* Gets socket's TCP port. */
-AINLINED int
-_ads_port(AndroidDevSocket* ads)
-{
- return sock_address_get_port(&ads->address);
-}
-
-/* Gets synchronous I/O looper for the socket. */
-AINLINED IoLooper*
-_ads_io_looper(AndroidDevSocket* ads)
-{
- return ads->ad->io_looper;
-}
-
-/* Sets deadline on a socket operation, given relative timeout.
- * Param:
- * ads - Socket descriptor to set deadline for.
- * to - Relative timeout (in millisec) for the operation.
- * AD_INFINITE_WAIT passed in this parameter means "no deadline".
- */
-AINLINED void
-_ads_set_deadline(AndroidDevSocket* ads, int to)
-{
- ads->deadline = (to == AD_INFINITE_WAIT) ? DURATION_INFINITE :
- iolooper_now() + to;
-}
-
-/********************************************************************************
- * Common socket implementation
- *******************************************************************************/
-
-static int
-_android_dev_socket_init(AndroidDevSocket* ads,
- void* opaque,
- AndroidDevice* ad,
- int port,
- ADSType type)
-{
- ads->type = type;
- ads->socket_status = ADS_DISCONNECTED;
- ads->opaque = opaque;
- ads->ad = ad;
- ads->fd = -1;
- sock_address_init_inet(&ads->address, SOCK_ADDRESS_INET_LOOPBACK, port);
-
- return 0;
-}
-
-static void
-_android_dev_socket_destroy(AndroidDevSocket* ads)
-{
- /* Make sure it's disconnected. */
- _android_dev_socket_disconnect(ads);
-
- /* Finalize socket address. */
- sock_address_done(&ads->address);
- memset(&ads->address, 0, sizeof(ads->address));
-}
-
-static int
-_android_dev_socket_connect(AndroidDevSocket* ads,
- on_socked_fd_created cb,
- void* opaque)
-{
- int res;
-
- /* Create communication socket. */
- ads->fd = socket_create_inet(SOCKET_STREAM);
- if (ads->fd < 0) {
- D("Unable to create socket for channel '%s'@%d: %s",
- _ads_id_str(ads), _ads_port(ads), strerror(errno));
- return -1;
- }
- socket_set_nonblock(ads->fd);
-
- /* Invoke FD creation callback (if required) */
- if (cb != NULL) {
- cb(ads, opaque);
- }
-
- /* Synchronously connect to it. */
- ads->socket_status = ADS_CONNECTING;
- iolooper_add_write(_ads_io_looper(ads), ads->fd);
- res = socket_connect(ads->fd, &ads->address);
- while (res < 0 && errno == EINTR) {
- res = socket_connect(ads->fd, &ads->address);
- }
-
- if (res && (errno == EINPROGRESS || errno == EWOULDBLOCK || errno == EAGAIN)) {
- /* Connection is delayed. Wait for it until timeout expires. */
- res = iolooper_wait_absolute(_ads_io_looper(ads), ads->deadline);
- if (res > 0) {
- /* Pick up on possible connection error. */
- errno = socket_get_error(ads->fd);
- res = (errno == 0) ? 0 : -1;
- } else {
- res = -1;
- }
- }
- iolooper_del_write(_ads_io_looper(ads), ads->fd);
-
- if (res == 0) {
- D("Channel '%s'@%d is connected", _ads_id_str(ads), _ads_port(ads));
- /* Socket is connected. Now register it with the server. */
- ads->socket_status = ADS_CONNECTED;
- res = _android_dev_socket_register(ads);
- } else {
- D("Unable to connect channel '%s' to port %d: %s",
- _ads_id_str(ads), _ads_port(ads), strerror(errno));
- }
-
- if (res) {
- _android_dev_socket_disconnect(ads);
- }
-
- return res;
-}
-
-static int
-_android_dev_socket_register(AndroidDevSocket* ads)
-{
- /* Make sure that socket is connected. */
- if (ads->socket_status < ADS_CONNECTED) {
- D("Attempt to register a disconnected channel '%s'@%d",
- _ads_id_str(ads), _ads_port(ads));
- errno = ECONNRESET;
- return -1;
- }
-
- /* Register this socket accordingly to its type. */
- const char* reg_str = _ads_id_str(ads);
- int res = _android_dev_socket_send(ads, reg_str, strlen(reg_str) + 1);
- if (res > 0) {
- /* Receive reply. Note that according to the protocol, the server should
- * reply to channel registration with 'ok', or 'ko' (just like with queries),
- * so we can use query reply reader here. */
- char reply[256];
- res = _android_dev_socket_read_response(ads, reply, sizeof(reply));
- if (res >= 0) {
- /* Socket is now registered. */
- ads->socket_status = ADS_REGISTERED;
- D("Channel '%s'@%d is registered", _ads_id_str(ads), _ads_port(ads));
- res = 0;
- } else {
- if (errno == 0) {
- /* 'ko' condition */
- D("Device failed registration of channel '%s'@%d: %s",
- _ads_id_str(ads), _ads_port(ads), reply);
- errno = EINVAL;
- } else {
- D("I/O failure while registering channel '%s'@%d: %s",
- _ads_id_str(ads), _ads_port(ads), strerror(errno));
- }
- res = -1;
- }
- } else {
- D("Unable to send registration query for channel '%s'@%d: %s",
- _ads_id_str(ads), _ads_port(ads), strerror(errno));
- res = -1;
- }
-
- return res;
-}
-
-static void
-_android_dev_socket_disconnect(AndroidDevSocket* ads)
-{
- /* Preserve errno */
- const int save_error = errno;
- if (ads->socket_status != ADS_DISCONNECTED) {
- /* Reset I/O looper for this socket. */
- iolooper_modify(_ads_io_looper(ads), ads->fd,
- IOLOOPER_READ | IOLOOPER_WRITE, 0);
-
- /* Mark as disconnected. */
- ads->socket_status = ADS_DISCONNECTED;
-
- /* Close socket. */
- if (ads->fd >= 0) {
- socket_close(ads->fd);
- ads->fd = -1;
- }
- }
- errno = save_error;
-}
-
-static int
-_android_dev_socket_send(AndroidDevSocket* ads, const char* buff, int to_send)
-{
- int sent = 0;
-
- /* Make sure that socket is connected. */
- if (ads->socket_status < ADS_CONNECTED) {
- D("Attempt to send via disconnected channel '%s'@%d",
- _ads_id_str(ads), _ads_port(ads));
- errno = ECONNRESET;
- return -1;
- }
-
- iolooper_add_write(_ads_io_looper(ads), ads->fd);
- do {
- int res = socket_send(ads->fd, buff + sent, to_send - sent);
- if (res == 0) {
- /* Disconnection. */
- errno = ECONNRESET;
- sent = -1;
- break;
- }
-
- if (res < 0) {
- if (errno == EINTR) {
- /* loop on EINTR */
- continue;
- }
-
- if (errno == EWOULDBLOCK || errno == EAGAIN) {
- res = iolooper_wait_absolute(_ads_io_looper(ads), ads->deadline);
- if (res > 0) {
- /* Ready to write. */
- continue;
- }
- }
- sent = -1;
- break;
- }
- sent += res;
- } while (sent < to_send);
- iolooper_del_write(_ads_io_looper(ads), ads->fd);
-
- /* In case of an I/O failure we have to invoke failure callback. Note that we
- * report I/O failures only on registered sockets. */
- if (sent < 0) {
- D("I/O error while sending data via channel '%s'@%d: %s",
- _ads_id_str(ads), _ads_port(ads), strerror(errno));
-
- if (ads->ad->on_io_failure != NULL && ads->socket_status > ADS_CONNECTED) {
- const char save_error = errno;
- ads->ad->on_io_failure(ads->opaque, ads->ad, save_error);
- errno = save_error;
- }
- }
-
- return sent;
-}
-
-static int
-_android_dev_socket_recv(AndroidDevSocket* ads, char* buf, int bufsize)
-{
- int recvd = 0;
-
- /* Make sure that socket is connected. */
- if (ads->socket_status < ADS_CONNECTED) {
- D("Attempt to receive from disconnected channel '%s'@%d",
- _ads_id_str(ads), _ads_port(ads));
- errno = ECONNRESET;
- return -1;
- }
-
- iolooper_add_read(_ads_io_looper(ads), ads->fd);
- do {
- int res = socket_recv(ads->fd, buf + recvd, bufsize - recvd);
- if (res == 0) {
- /* Disconnection. */
- errno = ECONNRESET;
- recvd = -1;
- break;
- }
-
- if (res < 0) {
- if (errno == EINTR) {
- /* loop on EINTR */
- continue;
- }
-
- if (errno == EWOULDBLOCK || errno == EAGAIN) {
- res = iolooper_wait_absolute(_ads_io_looper(ads), ads->deadline);
- if (res > 0) {
- /* Ready to read. */
- continue;
- }
- }
- recvd = -1;
- break;
- }
- recvd += res;
- } while (recvd < bufsize);
- iolooper_del_read(_ads_io_looper(ads), ads->fd);
-
- /* In case of an I/O failure we have to invoke failure callback. Note that we
- * report I/O failures only on registered sockets. */
- if (recvd < 0) {
- D("I/O error while receiving from channel '%s'@%d: %s",
- _ads_id_str(ads), _ads_port(ads), strerror(errno));
-
- if (ads->ad->on_io_failure != NULL && ads->socket_status > ADS_CONNECTED) {
- const char save_error = errno;
- ads->ad->on_io_failure(ads->opaque, ads->ad, save_error);
- errno = save_error;
- }
- }
-
- return recvd;
-}
-
-static int
-_android_dev_socket_read_string(AndroidDevSocket* ads, char* str, int strsize)
-{
- int n;
-
- /* Char by char read from the socket, until zero-terminator is read. */
- for (n = 0; n < strsize; n++) {
- if (_android_dev_socket_recv(ads, str + n, 1) > 0) {
- if (str[n] == '\0') {
- /* Done. */
- return n + 1; /* Including zero-terminator. */
- }
- } else {
- /* I/O error. */
- return -1;
- }
- }
-
- /* Buffer was too small. Report that by setting errno to ENOMEM. */
- D("Buffer %d is too small to receive a string from channel '%s'@%d",
- strsize, _ads_id_str(ads), _ads_port(ads));
- errno = ENOMEM;
- return -1;
-}
-
-static int
-_android_dev_socket_read_response(AndroidDevSocket* ads, char* data, int datasize)
-{
- int n, res;
- int success = 0;
- int failure = 0;
- int bad_format = 0;
- char ok[4];
-
- *data = '\0';
-
- /* Char by char read from the socket, until ok/ko is read. */
- for (n = 0; n < 2; n++) {
- res = _android_dev_socket_recv(ads, ok + n, 1);
- if (res > 0) {
- if (ok[n] == '\0') {
- /* EOS is unexpected here! */
- D("Bad query reply format on channel '%s'@%d: '%s' is too short.",
- _ads_id_str(ads), _ads_port(ads), ok);
- errno = EINVAL;
- return -1;
- }
- } else {
- /* I/O error. */
- return -1;
- }
- }
-
- /* Next character must be either ':', or '\0' */
- res = _android_dev_socket_recv(ads, ok + n, 1);
- if (res <= 0) {
- /* I/O error. */
- return -1;
- }
-
- /*
- * Verify format.
- */
-
- /* Check ok / ko */
- success = memcmp(ok, "ok", 2) == 0;
- failure = memcmp(ok, "ko", 2) == 0;
-
- /* Check the prefix: 'ok'|'ko' & ':'|'\0' */
- if ((success || failure) && (ok[n] == '\0' || ok[n] == ':')) {
- /* Format is good. */
- if (ok[n] == '\0') {
- /* We're done: no extra data in response. */
- errno = 0;
- return success ? 0 : -1;
- }
- /* Reset buffer offset, so we will start to read the remaining query
- * data to the beginning of the supplied buffer. */
- n = 0;
- } else {
- /* Bad format. Lets move what we've read to the main buffer, and
- * continue filling it in. */
- bad_format = 1;
- n++;
- memcpy(data, ok, n);
- }
-
- /* Read the remainder of reply to the supplied data buffer. */
- res = _android_dev_socket_read_string(ads, data + n, datasize - n);
- if (res < 0) {
- return res;
- }
-
- /* Lets see if format was bad */
- if (bad_format) {
- D("Bad query reply format on channel '%s'@%d: %s.",
- _ads_id_str(ads), _ads_port(ads), data);
- errno = EINVAL;
- return -1;
- } else {
- errno = 0;
- return success ? n : -1;
- }
-}
-
-/********************************************************************************
- * Query socket declarations
- *******************************************************************************/
-
-/* Initializes query socket descriptor.
- * Param:
- * adsquery - Socket descriptor to initialize.
- * opaque - An opaque pointer to associate with the socket. Typicaly it's the
- * same pointer that is associated with AndroidDevice instance.
- * ad - Android device descriptor that owns the socket.
- * port - TCP socket port.
- */
-static int _android_query_socket_init(AndroidQuerySocket* adsquery,
- void* opaque,
- AndroidDevice* ad,
- int port);
-
-/* Destroys query socket descriptor. */
-static void _android_query_socket_destroy(AndroidQuerySocket* adsquery);
-
-/* Synchronously connects the query socket, and registers it with the server.
- * Param:
- * adsquery - Descriptor for the query socket to connect. Must have 'deadline'
- * field properly setup.
- * cb - Callback to invoke when socket connection is completed. Can be NULL.
- * Return:
- * Zero on success, or non-zero on failure.
- */
-static int _android_query_socket_connect(AndroidQuerySocket* adsquery);
-
-/* Disconnects the query socket. */
-static void _android_query_socket_disconnect(AndroidQuerySocket* adsquery);
-
-/********************************************************************************
- * Query socket implementation
- *******************************************************************************/
-
-static int
-_android_query_socket_init(AndroidQuerySocket* adsquery,
- void* opaque,
- AndroidDevice* ad,
- int port)
-{
- return _android_dev_socket_init(&adsquery->dev_socket, opaque, ad, port,
- ADS_TYPE_QUERY);
-}
-
-static void
-_android_query_socket_destroy(AndroidQuerySocket* adsquery)
-{
- _android_query_socket_disconnect(adsquery);
- _android_dev_socket_destroy(&adsquery->dev_socket);
-}
-
-static int
-_android_query_socket_connect(AndroidQuerySocket* adsquery)
-{
- return _android_dev_socket_connect(&adsquery->dev_socket, NULL, NULL);
-}
-
-static void
-_android_query_socket_disconnect(AndroidQuerySocket* adsquery)
-{
- _android_dev_socket_disconnect(&adsquery->dev_socket);
-}
-
-/********************************************************************************
- * Events socket declarations
- *******************************************************************************/
-
-/* Initializes event socket descriptor.
- * Param:
- * adsevent - Socket descriptor to initialize.
- * opaque - An opaque pointer to associate with the socket. Typicaly it's the
- * same pointer that is associated with AndroidDevice instance.
- * ad - Android device descriptor that owns the socket.
- * port - TCP socket port.
- */
-static int _android_event_socket_init(AndroidEventSocket* adsevent,
- void* opaque,
- AndroidDevice* ad,
- int port);
-
-/* Destroys the event socket descriptor. */
-static void _android_event_socket_destroy(AndroidEventSocket* adsevent);
-
-/* Synchronously connects event socket.
- * Param:
- * adsevent - Descriptor for the event socket to connect. Must have 'deadline'
- * field properly setup.
- * Return:
- * Zero on success, or non-zero on failure.
- */
-static int _android_event_socket_connect_sync(AndroidEventSocket* adsevent);
-
-/* Initiates asynchronous event socket connection.
- * Param:
- * adsevent - Descriptor for the event socket to connect. Must have 'deadline'
- * field properly setup.
- * cb - Callback to invoke when socket connection is completed. Can be NULL.
- * Return:
- * Zero on success, or non-zero on failure.
- */
-static int _android_event_socket_connect_async(AndroidEventSocket* adsevent,
- ads_socket_connected_cb cb);
-
-/* Disconnects the event socket. */
-static void _android_event_socket_disconnect(AndroidEventSocket* adsevent);
-
-/* Initiates listening on the event socket.
- * Param:
- * adsevent - Descriptor for the event socket to listen on.
- * str, strsize - Buffer where to read the string.
- * cb - A callback to call when the event string is read. Can be NULL.
- * Return:
- * Zero on success, or non-zero on failure.
- */
-static int _android_event_socket_listen(AndroidEventSocket* adsevent,
- char* str,
- int strsize,
- event_cb cb);
-
-/* Asynchronously sends data via event socket.
- * Param:
- * adsevent - Descriptor for the event socket to send data to.
- * data, size - Buffer containing data to send.
- * free_on_close - A boolean flag indicating whether the data buffer should be
- * freed upon data transfer completion.
- * cb - Callback to invoke when data transfer is completed.
- * opaque - An opaque pointer to pass to the transfer completion callback.
- */
-static int _android_event_socket_send(AndroidEventSocket* adsevent,
- void* data,
- int size,
- int free_on_close,
- async_send_cb cb,
- void* opaque);
-
-/* Cancels all asynchronous data transfers on the event socket.
- * Param:
- * adsevent - Descriptor for the event socket to cancel data transfer.
- * reason - Reason for the cancellation.
- */
-static void _android_event_socket_cancel_send(AndroidEventSocket* adsevent,
- ATResult reason);
-
-/* Event socket's asynchronous I/O looper callback.
- * Param:
- * opaque - AndroidEventSocket instance.
- * fd - Socket's FD.
- * events - I/O type bitsmask (read | write).
- */
-static void _on_event_socket_io(void* opaque, int fd, unsigned events);
-
-/* Callback that is invoked when asynchronous event socket connection is
- * completed. */
-static void _on_event_socket_connected(AndroidEventSocket* adsevent, int failure);
-
-/* Callback that is invoked when an event is received from the device. */
-static void _on_event_received(AndroidEventSocket* adsevent);
-
-/* Gets I/O looper for asynchronous I/O on event socket. */
-AINLINED Looper*
-_aes_looper(AndroidEventSocket* adsevent)
-{
- return adsevent->dev_socket.ad->looper;
-}
-
-/********************************************************************************
- * Events socket implementation
- *******************************************************************************/
-
-static int
-_android_event_socket_init(AndroidEventSocket* adsevent,
- void* opaque,
- AndroidDevice* ad,
- int port)
-{
- return _android_dev_socket_init(&adsevent->dev_socket, opaque, ad, port,
- ADS_TYPE_EVENT);
-}
-
-static void
-_android_event_socket_destroy(AndroidEventSocket* adsevent)
-{
- _android_event_socket_disconnect(adsevent);
- _android_dev_socket_destroy(&adsevent->dev_socket);
-}
-
-/* A callback invoked when file descriptor is created for the event socket.
- * We use this callback to initialize the event socket for async I/O right after
- * the FD has been created.
- */
-static void
-_on_event_fd_created(AndroidDevSocket* ads, void* opaque)
-{
- AndroidEventSocket* adsevent = (AndroidEventSocket*)opaque;
- /* Prepare for async I/O on the event socket. */
- loopIo_init(adsevent->io, _aes_looper(adsevent), ads->fd,
- _on_event_socket_io, adsevent);
-}
-
-static int
-_android_event_socket_connect_sync(AndroidEventSocket* adsevent)
-{
- return _android_dev_socket_connect(&adsevent->dev_socket,
- _on_event_fd_created, adsevent);
-}
-
-static int
-_android_event_socket_connect_async(AndroidEventSocket* adsevent,
- ads_socket_connected_cb cb)
-{
- AsyncStatus status;
- AndroidDevSocket* ads = &adsevent->dev_socket;
-
- /* Create asynchronous socket. */
- ads->fd = socket_create_inet(SOCKET_STREAM);
- if (ads->fd < 0) {
- D("Unable to create socket for channel '%s'@%d: %s",
- _ads_id_str(ads), _ads_port(ads), strerror(errno));
- if (cb != NULL) {
- cb(ads->opaque, ads, errno);
- }
- return -1;
- }
- socket_set_nonblock(ads->fd);
-
- /* Prepare for async I/O on the event socket. */
- loopIo_init(adsevent->io, _aes_looper(adsevent), ads->fd,
- _on_event_socket_io, adsevent);
-
- /* Try to connect. */
- ads->socket_status = ADS_CONNECTING;
- adsevent->on_connected = cb;
- status = asyncConnector_init(adsevent->connector, &ads->address, adsevent->io);
- switch (status) {
- case ASYNC_COMPLETE:
- /* We're connected to the device socket. */
- ads->socket_status = ADS_CONNECTED;
- _on_event_socket_connected(adsevent, 0);
- break;
- case ASYNC_ERROR:
- _on_event_socket_connected(adsevent, errno);
- break;
- case ASYNC_NEED_MORE:
- /* Attempt to connect would block, so connection competion is
- * delegates to the looper's I/O routine. */
- default:
- break;
- }
-
- return 0;
-}
-
-static void
-_android_event_socket_disconnect(AndroidEventSocket* adsevent)
-{
- AndroidDevSocket* ads = &adsevent->dev_socket;
-
- if (ads->socket_status != ADS_DISCONNECTED) {
- /* Cancel data transfer. */
- _android_event_socket_cancel_send(adsevent, ATR_DISCONNECT);
-
- /* Stop all async I/O. */
- loopIo_done(adsevent->io);
-
- /* Disconnect common socket. */
- _android_dev_socket_disconnect(ads);
- }
-}
-
-static int
-_android_event_socket_listen(AndroidEventSocket* adsevent,
- char* str,
- int strsize,
- event_cb cb)
-{
- AsyncStatus status;
- AndroidDevSocket* ads = &adsevent->dev_socket;
-
- /* Make sure that device is connected. */
- if (ads->socket_status < ADS_CONNECTED) {
- D("Attempt to listen on a disconnected channel '%s'@%d",
- _ads_id_str(ads), _ads_port(ads));
- errno = ECONNRESET;
- return -1;
- }
-
- /* NOTE: only one reader at any given time! */
- adsevent->on_event = cb;
- asyncLineReader_init(&adsevent->alr, str, strsize, adsevent->io);
- /* Default EOL for the line reader was '\n'. */
- asyncLineReader_setEOL(&adsevent->alr, '\0');
- status = asyncLineReader_read(&adsevent->alr);
- if (status == ASYNC_COMPLETE) {
- /* Data has been transferred immediately. Do the callback here. */
- _on_event_received(adsevent);
- } else if (status == ASYNC_ERROR) {
- D("Error while listening on channel '%s'@%d: %s",
- _ads_id_str(ads), _ads_port(ads), strerror(errno));
- /* There is one special failure here, when buffer was too small to
- * contain the entire string. This is not an I/O, but rather a
- * protocol error. So we don't report it to the I/O failure
- * callback. */
- if (errno == ENOMEM) {
- _on_event_received(adsevent);
- } else {
- if (ads->ad->on_io_failure != NULL) {
- ads->ad->on_io_failure(ads->ad->opaque, ads->ad, errno);
- }
- }
- return -1;
- }
- return 0;
-}
-
-static int
-_android_event_socket_send(AndroidEventSocket* adsevent,
- void* data,
- int size,
- int free_on_close,
- async_send_cb cb,
- void* opaque)
-{
- /* Create data transfer descriptor, and place it at the end of the list. */
- AsyncSendBuffer* const desc =
- _async_send_buffer_create(data, size, free_on_close, cb, opaque);
- AsyncSendBuffer** place = &adsevent->send_pending;
- while (*place != NULL) {
- place = &((*place)->next);
- }
- *place = desc;
-
- /* We're ready to transfer data. */
- loopIo_wantWrite(adsevent->io);
-
- return 0;
-}
-
-static void
-_android_event_socket_cancel_send(AndroidEventSocket* adsevent, ATResult reason)
-{
- while (adsevent->send_pending != NULL) {
- AsyncSendBuffer* const to_cancel = adsevent->send_pending;
- adsevent->send_pending = to_cancel->next;
- _async_send_buffer_complete(to_cancel, reason);
- }
- loopIo_dontWantWrite(adsevent->io);
-}
-
-static void
-_on_event_socket_io(void* opaque, int fd, unsigned events)
-{
- AsyncStatus status;
- AndroidEventSocket* adsevent = (AndroidEventSocket*)opaque;
- AndroidDevSocket* ads = &adsevent->dev_socket;
-
- /* Lets see if we're still wating on a connection to occur. */
- if (ads->socket_status == ADS_CONNECTING) {
- /* Complete socket connection. */
- status = asyncConnector_run(adsevent->connector);
- if (status == ASYNC_COMPLETE) {
- /* We're connected to the device socket. */
- ads->socket_status = ADS_CONNECTED;
- D("Channel '%s'@%d is connected asynchronously",
- _ads_id_str(ads), _ads_port(ads));
- _on_event_socket_connected(adsevent, 0);
- } else if (status == ASYNC_ERROR) {
- _on_event_socket_connected(adsevent, adsevent->connector->error);
- }
- return;
- }
-
- /*
- * Device is connected. Continue with the data transfer.
- */
-
- if ((events & LOOP_IO_READ) != 0) {
- /* Continue reading data. */
- status = asyncLineReader_read(&adsevent->alr);
- if (status == ASYNC_COMPLETE) {
- errno = 0;
- _on_event_received(adsevent);
- } else if (status == ASYNC_ERROR) {
- D("I/O failure while reading from channel '%s'@%d: %s",
- _ads_id_str(ads), _ads_port(ads), strerror(errno));
- /* There is one special failure here, when buffer was too small to
- * contain the entire string. This is not an I/O, but rather a
- * protocol error. So we don't report it to the I/O failure
- * callback. */
- if (errno == ENOMEM) {
- _on_event_received(adsevent);
- } else {
- if (ads->ad->on_io_failure != NULL) {
- ads->ad->on_io_failure(ads->ad->opaque, ads->ad, errno);
- }
- }
- }
- }
-
- if ((events & LOOP_IO_WRITE) != 0) {
- while (adsevent->send_pending != NULL) {
- AsyncSendBuffer* to_send = adsevent->send_pending;
- const int offset = to_send->data_size - to_send->data_remaining;
- const int sent = socket_send(ads->fd, to_send->data + offset,
- to_send->data_remaining);
- if (sent < 0) {
- if (errno == EWOULDBLOCK) {
- /* Try again later. */
- return;
- } else {
- /* An error has occured. */
- _android_event_socket_cancel_send(adsevent, ATR_IO_ERROR);
- if (ads->ad->on_io_failure != NULL) {
- ads->ad->on_io_failure(ads->ad->opaque, ads->ad, errno);
- }
- return;
- }
- } else if (sent == 0) {
- /* Disconnect condition. */
- _android_event_socket_cancel_send(adsevent, ATR_DISCONNECT);
- if (ads->ad->on_io_failure != NULL) {
- ads->ad->on_io_failure(ads->ad->opaque, ads->ad, errno);
- }
- return;
- } else if (sent == to_send->data_remaining) {
- /* All data is sent. */
- errno = 0;
- adsevent->send_pending = to_send->next;
- _async_send_buffer_complete(to_send, ATR_SUCCESS);
- } else {
- /* Chunk is sent. */
- to_send->data_remaining -= sent;
- return;
- }
- }
- loopIo_dontWantWrite(adsevent->io);
- }
-}
-
-static void
-_on_event_socket_connected(AndroidEventSocket* adsevent, int failure)
-{
- int res;
- AndroidDevSocket* ads = &adsevent->dev_socket;
-
- if (failure) {
- _android_event_socket_disconnect(adsevent);
- if (adsevent->on_connected != NULL) {
- adsevent->on_connected(ads->opaque, ads, failure);
- }
- return;
- }
-
- /* Complete event socket connection by identifying it as "event" socket with
- * the application. */
- ads->socket_status = ADS_CONNECTED;
- res = _android_dev_socket_register(ads);
-
- if (res) {
- const int save_error = errno;
- _android_event_socket_disconnect(adsevent);
- errno = save_error;
- }
-
- /* Notify callback about connection completion. */
- if (adsevent->on_connected != NULL) {
- if (res) {
- adsevent->on_connected(ads->opaque, ads, errno);
- } else {
- adsevent->on_connected(ads->opaque, ads, 0);
- }
- }
-}
-
-static void
-_on_event_received(AndroidEventSocket* adsevent)
-{
- if (adsevent->on_event != NULL) {
- AndroidDevice* ad = adsevent->dev_socket.ad;
- adsevent->on_event(ad->opaque, ad, (char*)adsevent->alr.buffer,
- adsevent->alr.pos);
- }
-}
-
-/********************************************************************************
- * Android device connection
- *******************************************************************************/
-
-/* Callback that is invoked when event socket is connected and registered as part
- * of the _android_device_connect_async API.
- * Param:
- * opaque - Opaque pointer associated with AndroidDevice instance.
- * ads - Common socket descriptor for the event socket.
- * failure - If zero connection has succeeded, otherwise contains 'errno'-reason
- * for connection failure.
- */
-static void
-_on_android_device_connected_async(void* opaque,
- AndroidDevSocket* ads,
- int failure)
-{
- int res;
- AndroidDevice* ad = ads->ad;
-
- if (failure) {
- /* Depending on the failure code we will either retry, or bail out. */
- switch (failure) {
- case EPIPE:
- case EAGAIN:
- case EINPROGRESS:
- case EALREADY:
- case EHOSTUNREACH:
- case EHOSTDOWN:
- case ECONNREFUSED:
- case ESHUTDOWN:
- case ENOTCONN:
- case ECONNRESET:
- case ECONNABORTED:
- case ENETRESET:
- case ENETUNREACH:
- case ENETDOWN:
- case EBUSY:
-#if !defined(_DARWIN_C_SOURCE) && !defined(_WIN32)
- case ERESTART:
- case ECOMM:
- case ENONET:
-#endif /* !_DARWIN_C_SOURCE && !_WIN32 */
- /* Device is not available / reachable at the moment.
- * Retry connection later. */
- loopTimer_startRelative(ad->timer, ADS_RETRY_CONNECTION_TIMEOUT);
- return;
- default:
- D("Failed to asynchronously connect channel '%s':%d %s",
- _ads_id_str(ads), _ads_port(ads), strerror(errno));
- if (ad->on_connected != NULL) {
- ad->on_connected(ad->opaque, ad, failure);
- }
- break;
- }
- return;
- }
-
- /* Event socket is connected. Connect the query socket now. Give it 5
- * seconds to connect. */
- _ads_set_deadline(&ad->query_socket.dev_socket, 5000);
- res = _android_query_socket_connect(&ad->query_socket);
- if (res == 0) {
- /* Query socket is connected. */
- if (ad->on_connected != NULL) {
- ad->on_connected(ad->opaque, ad, 0);
- }
- } else {
- /* If connection completion has failed - disconnect the sockets. */
- _android_event_socket_disconnect(&ad->event_socket);
- _android_query_socket_disconnect(&ad->query_socket);
-
- if (ad->on_connected != NULL) {
- ad->on_connected(ad->opaque, ad, errno);
- }
- }
-}
-
-static void
-_on_timer(void* opaque)
-{
- /* Retry the connection. */
- AndroidDevice* ad = (AndroidDevice*)opaque;
- android_device_connect_async(ad, ad->on_connected);
-}
-
-/* Destroys and frees the descriptor. */
-static void
-_android_device_free(AndroidDevice* ad)
-{
- if (ad != NULL) {
- _android_event_socket_destroy(&ad->event_socket);
- _android_query_socket_destroy(&ad->query_socket);
-
- /* Delete asynchronous I/O looper. */
- if (ad->looper != NULL ) {
- loopTimer_done(ad->timer);
- looper_free(ad->looper);
- }
-
- /* Delete synchronous I/O looper. */
- if (ad->io_looper != NULL) {
- iolooper_reset(ad->io_looper);
- iolooper_free(ad->io_looper);
- }
-
- AFREE(ad);
- }
-}
-
-/********************************************************************************
- * Android device API
- *******************************************************************************/
-
-AndroidDevice*
-android_device_init(void* opaque, int port, io_failure_cb on_io_failure)
-{
- int res;
- AndroidDevice* ad;
-
- ANEW0(ad);
-
- ad->opaque = opaque;
- ad->on_io_failure = on_io_failure;
-
- /* Create I/O looper for synchronous I/O on the device. */
- ad->io_looper = iolooper_new();
- if (ad->io_looper == NULL) {
- E("Unable to create synchronous I/O looper for android device.");
- _android_device_free(ad);
- return NULL;
- }
-
- /* Create a looper for asynchronous I/O on the device. */
- ad->looper = looper_newCore();
- if (ad->looper != NULL) {
- /* Create a timer that will be used for connection retries. */
- loopTimer_init(ad->timer, ad->looper, _on_timer, ad);
- } else {
- E("Unable to create asynchronous I/O looper for android device.");
- _android_device_free(ad);
- return NULL;
- }
-
- /* Init query socket. */
- res = _android_query_socket_init(&ad->query_socket, opaque, ad, port);
- if (res) {
- _android_device_free(ad);
- return NULL;
- }
-
- /* Init event socket. */
- res = _android_event_socket_init(&ad->event_socket, opaque, ad, port);
- if (res) {
- _android_device_free(ad);
- return NULL;
- }
-
- return ad;
-}
-
-void
-android_device_destroy(AndroidDevice* ad)
-{
- if (ad != NULL) {
- _android_device_free(ad);
- }
-}
-
-int
-android_device_connect_sync(AndroidDevice* ad, int to)
-{
- int res;
-
- /* Setup deadline for the connections. */
- _ads_set_deadline(&ad->query_socket.dev_socket, to);
- ad->event_socket.dev_socket.deadline = ad->query_socket.dev_socket.deadline;
-
- /* Connect the query socket first. */
- res = _android_query_socket_connect(&ad->query_socket);
- if (!res) {
- /* Connect to the event socket next. */
- res = _android_event_socket_connect_sync(&ad->event_socket);
- }
-
- return res;
-}
-
-int
-android_device_connect_async(AndroidDevice* ad, device_connected_cb on_connected)
-{
- /* No deadline for async connections. */
- ad->query_socket.dev_socket.deadline = DURATION_INFINITE;
- ad->event_socket.dev_socket.deadline = DURATION_INFINITE;
-
- /* Connect to the event socket first, and delegate query socket connection
- * into callback invoked when event socket is connected. NOTE: In case of
- * failure 'on_connected' callback has already been called from
- * _on_android_device_connected_async routine. */
- ad->on_connected = on_connected;
- return _android_event_socket_connect_async(&ad->event_socket,
- _on_android_device_connected_async);
-}
-
-void
-android_device_disconnect(AndroidDevice* ad)
-{
- _android_event_socket_disconnect(&ad->event_socket);
- _android_query_socket_disconnect(&ad->query_socket);
-}
-
-int
-android_device_query(AndroidDevice* ad,
- const char* query,
- char* buff,
- size_t buffsize,
- int to)
-{
- int res;
-
- /* Setup deadline for the query. */
- _ads_set_deadline(&ad->query_socket.dev_socket, to);
-
- /* Send the query. */
- res = _android_dev_socket_send(&ad->query_socket.dev_socket, query,
- strlen(query) + 1);
- if (res > 0) {
- /* Receive the response. */
- res = _android_dev_socket_read_response(&ad->query_socket.dev_socket,
- buff, buffsize);
- return (res >= 0) ? 0 : -1;
- }
-
- return -1;
-}
-
-int
-android_device_start_query(AndroidDevice* ad, const char* query, int to)
-{
- int res;
-
- /* Setup deadline for the query. */
- _ads_set_deadline(&ad->query_socket.dev_socket, to);
-
- /* Send the query header. */
- res = _android_dev_socket_send(&ad->query_socket.dev_socket, query,
- strlen(query) + 1);
- return (res > 0) ? 0 : -1;
-}
-
-int
-android_device_send_query_data(AndroidDevice* ad, const void* data, int size)
-{
- return _android_dev_socket_send(&ad->query_socket.dev_socket, data, size);
-}
-
-int
-android_device_complete_query(AndroidDevice* ad, char* buff, size_t buffsize)
-{
- /* Receive the response to the query. */
- const int res = _android_dev_socket_read_response(&ad->query_socket.dev_socket,
- buff, buffsize);
- return (res >= 0) ? 0 : -1;
-}
-
-int
-android_device_listen(AndroidDevice* ad,
- char* buff,
- int buffsize,
- event_cb on_event)
-{
- return _android_event_socket_listen(&ad->event_socket, buff, buffsize,
- on_event);
-}
-
-int
-android_device_send_async(AndroidDevice* ad,
- void* data,
- int size,
- int free_on_close,
- async_send_cb cb,
- void* opaque)
-{
- return _android_event_socket_send(&ad->event_socket, data, size,
- free_on_close, cb, opaque);
-}
diff --git a/android/android-device.h b/android/android-device.h
deleted file mode 100644
index 6825819..0000000
--- a/android/android-device.h
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_ANDROID_DEVICE_H_
-#define ANDROID_ANDROID_DEVICE_H_
-
-/*
- * Encapsulates an exchange protocol between the emulator, and an Android device
- * that is connected to the host via USB. The communication is established over
- * a TCP port forwarding, enabled by ADB (always use 'adb -d forward ...' variant
- * of this command, so ADB will know to enable port forwarding on the connected
- * device, and not on the emulator's guest system).
- *
- * Exchange protocol contains two channel:
- *
- * - Query channel.
- * - Event channel.
- *
- * Both channels are implemented on top of TCP sockets that are connected to the
- * same port.
- *
- * I QUERY CHANNEL.
- * Query channel is intended to send queries to and receive responses from the
- * connected device. It is implemented on top of iolooper_xxx API (see iolooper.h)
- * because it must work outside of the main event loop. This is required to enable
- * proper initialization of components (such as sensors) that must be set up
- * before emulator enters the main loop.
- *
- * II EVENT CHANNEL.
- * Event channel is intended to listen on events sent from the device, and
- * asynchronously report them back to the client of this API by invoking an event
- * callback that was registered by the client. Event channel is implemented on
- * top of asyncXxx API (see android/async-utils.*). Note that using of asyncXxx
- * API limits the use of event channel to the time after the emulator has entered
- * its main event loop. The only exception is if event channel is connected from
- * android_device_connect_sync API, in which case iolooper_xxx API is used to
- * establish the connection. However, even in this case listening for events will
- * not be available until after the emulator enters its event loop, since event
- * listening always uses asyncXxx API.
- *
- * III. ESTABLISHING CONNECTION.
- * ADB port forwarding requires that the server socket is to be run on the device,
- * while emulator must use a client socket for communication. Thus, it's the
- * emulator that initiates the connection.
- *
- * There are two ways how emulator can initiate the connection:
- *
- * - Synchronous connection.
- * - Asynchronous connection.
- *
- * III.I SYNCHROUNOUS CONNECTION.
- * Synchronous connection is initiated via android_device_connect_sync API, and
- * completes synchronously.
- *
- * This API should be used when connection with the device is required at the time
- * of the call. For instance, when initializing sensor emulation, connection with
- * the device is required to properly set up the emulator before the guest system
- * starts, and before emulator enters its main event loop.
- *
- * III.II ASYNCHRONOUS CONNECTION.
- * Asynchronous connection is initiated via android_device_connect_async API. The
- * main difference with the synchronous connection is that this API will not fail
- * if connection is not immediately available. If connection is not available at
- * the time of the call, the API will schedule a retry (based on a timer), and
- * will continue reprying untill connection becomes available, or until an error
- * occurs that prevent further retries.
- *
- * This API should be used when ... Well, whenever appropriate. For instance,
- * sensor emulation will use this API to restore lost connection with the device.
- *
- * NOTE: Asynchronous connection will complete no sooner than the emulator enters
- * its main loop.
- *
- * IV EXCHANGE PROTOCOL.
- * Obviously, there must be some application running on the device, that implements
- * a socket server listening on the forwarded TCP port, and accepting the clients.
- *
- * IV.I Query vs. event channel.
- * The exchange protocol assumes, that when a channel is connected, it will
- * identify itself by sending a string containing channel type. Only after such
- * identification has been made the channel becomes available for use.
- *
- * IV.II Message format.
- * All data that is transferred in both directions over both channels are zero-
- * terminated strings.
- */
-
-#include "qemu-common.h"
-#include "android/async-utils.h"
-#include "android/utils/debug.h"
-
-/* TCP port reserved for sensor emulation. */
-#define AD_SENSOR_PORT 1968
-
-/* Definis infinite timeout. */
-#define AD_INFINITE_WAIT -1
-
-/* Enumerates results of asynchronous data transfer.
- */
-typedef enum ATResult {
- /* Data transfer has been completed. */
- ATR_SUCCESS,
- /* Socket got disconnected while data transfer has been in progress. */
- ATR_DISCONNECT,
- /* An I/O error has occured. 'errno' contains error value. */
- ATR_IO_ERROR,
-} ATResult;
-
-/* Android device descriptor. */
-typedef struct AndroidDevice AndroidDevice;
-
-/********************************************************************************
- * Callback declarations
- *******************************************************************************/
-
-/* Callback routine that is invoked when android device is connected, or failed
- * to connect. As discussed above, this callback is called when both, query and
- * event channels have been connected. This callback is used only for asynchronous
- * connections.
- * Param:
- * opaque - Opaque pointer that was passed to android_device_init API.
- * ad - Androd device descriptor for the connection.
- * failure - Zero indicates that connection with the device has been successfuly
- * established. Non-zero vaule passed in this parameter indicates a failure,
- * and contains 'errno'-reason for failure.
- */
-typedef void (*device_connected_cb)(void* opaque, AndroidDevice* ad, int failure);
-
-/* Callback routine that is invoked on an event received in the event channel.
- * NOTE: It's important to check 'errno' in this callback. If 'errno' is set to
- * ENOMEM, this signals that buffer passed to android_device_listen was too small
- * to contain the entire event message.
- * Param:
- * opaque - Opaque pointer that was passed to android_device_init API.
- * ad - Androd device descriptor for the connection.
- * msg - Event message (a zero-terminated string) received from the device.
- * msgsize - Event message size (including zero-terminator).
- */
-typedef void (*event_cb)(void* opaque, AndroidDevice* ad, char* msg, int msgsize);
-
-/* Callback routine that is invoked when an I/O failure occurs on a channel.
- * Note that this callback will not be invoked on connection failures.
- * Param:
- * opaque - Opaque pointer that was passed to android_device_init API.
- * ad - Android device instance
- * failure - Contains 'errno' indicating the reason for failure.
- */
-typedef void (*io_failure_cb)(void* opaque, AndroidDevice* ad, int failure);
-
-/* Callback routine that is invoked when an asynchronous data send has been
- * completed.
- * Param:
- * opaque - An opaque pointer associated with the data.
- * res - Result of data transfer.
- * data, size - Transferred data buffer.
- * sent - Number of sent bytes.
- */
-typedef void (*async_send_cb)(void* opaque,
- ATResult res,
- void* data,
- int size,
- int sent);
-
-/********************************************************************************
- * Android Device API.
- *******************************************************************************/
-
-/* Initializes android device descriptor.
- * Param:
- * opaque - An opaque pointer to associate with the descriptor. This pointer
- * will be passed to all callbacks (see above) that were invoked by the
- * initializing android device instance.
- * port - TCP port to use for connection.
- * on_io_failure - Callback to invoke when an I/O failure occurs on a channel
- * used by the initializing android device instance. Can be NULL.
- * Return:
- * Initialized android device descriptor on success, or NULL on failure.
- */
-extern AndroidDevice* android_device_init(void* opaque,
- int port,
- io_failure_cb on_io_failure);
-
-/* Disconnects and destroys android device descriptor.
- * Param:
- * ad - Android device descriptor, returned from android_device_init API.
- * Note that memory allocated for this descriptor will be freed in this
- * routine.
- */
-extern void android_device_destroy(AndroidDevice* ad);
-
-/* Synchronously connects to the device. See notes above for more details.
- * Param:
- * ad - Android device descriptor, returned from android_device_init API.
- * to - Milliseconds to wait for connection to be established.
- * Return:
- * Zero on success, or non-zero value on failure with 'errno' properly set.
- */
-extern int android_device_connect_sync(AndroidDevice* ad, int to);
-
-/* Asynchronously connects to the device. See notes above for more details.
- * Param:
- * ad - Android device descriptor, returned from android_device_init API.
- * on_connected - Callback to invoke when connection is completed (i,e, both,
- * event, and query channels have been connected). This parameter can be
- * NULL. Note that connection errors will be also reported through this
- * callback. Also note that this callback will be invoked even if this
- * routine returns with a failure.
- * Return:
- * Zero on success, or non-zero value on failure with 'errno' properly set.
- */
-extern int android_device_connect_async(AndroidDevice* ad,
- device_connected_cb on_connected);
-
-/* Disconnects from the android device.
- * Param:
- * ad - Android device descriptor, returned from android_device_init API.
- */
-extern void android_device_disconnect(AndroidDevice* ad);
-
-/* Queries the device via query channel.
- * Param:
- * ad - Android device descriptor, returned from android_device_init API.
- * query - Zero-terminated query string.
- * buff, buffsize - Buffer where to receive the response to the query.
- * to - Milliseconds to wait for the entire query to complete.
- * Return:
- * Zero on success, or non-zero value on failure with 'errno' properly set:
- * - 0 Indicates that the server has failed the query.
- * - Anything else indicates an I/O error.
- */
-extern int android_device_query(AndroidDevice* ad,
- const char* query,
- char* buff,
- size_t buffsize,
- int to);
-
-/* Starts a query that may require more than one buffer transfer.
- * This routine allows to initiate a query that may require more than one call to
- * send_data, or may have a format that differs from the usual (a zero-terminated
- * string). For instance, sending a BLOB data should use this routine to start a
- * a query, then use android_device_send_query_data to transfer the data, and
- * then call android_device_complete_query to obtain the response.
- * Param:
- * ad - Android device descriptor, returned from android_device_init API.
- * query - Zero-terminated query string.
- * to - Milliseconds to wait for the entire query to complete.
- * Return:
- * Zero on success, or non-zero value on failure with 'errno' properly set:
- * - 0 Indicates that the server has failed the query.
- * - Anything else indicates an I/O error.
- */
-extern int android_device_start_query(AndroidDevice* ad,
- const char* query,
- int to);
-
-/* Sends data block for a query started with android_device_start_query
- * Param:
- * ad - Android device descriptor, returned from android_device_init API.
- * data, size - Data to transfer.
- * Return:
- * Number of bytes transferred on success, or -1 on failure with errno
- * containing the reason for failure.
- */
-extern int android_device_send_query_data(AndroidDevice* ad,
- const void* data,
- int size);
-
-/* Completes a query started with android_device_start_query, and receives the
- * query response.
- * Param:
- * ad - Android device descriptor, returned from android_device_init API.
- * buff, buffsize - Buffer where to receive the response to the query.
- * Return:
- * Zero on success, or non-zero value on failure with 'errno' properly set.
- */
-extern int android_device_complete_query(AndroidDevice* ad, char* buff, size_t buffsize);
-
-/* Start listening on the event channel.
- * Param:
- * ad - Android device descriptor, returned from android_device_init API.
- * buff, buffsize - Buffer where to receive the event message.
- * on_event - Callback to invoke on event. Note that this callback will be
- * invoked even if this routine returns with a failure.
- * Return:
- * Zero on success, or non-zero value on failure with 'errno' properly set.
- */
-extern int android_device_listen(AndroidDevice* ad,
- char* buff,
- int buffsize,
- event_cb on_event);
-
-/* Asynchronously sends data to the android device.
- * Param:
- * ad - Android device descriptor, returned from android_device_init API.
- * data, size - Buffer containing data to send.
- * free_on_close - A boolean flag indicating whether the data buffer should be
- * freed upon data transfer completion.
- * cb - Callback to invoke when data transfer is completed.
- * opaque - An opaque pointer to pass to the transfer completion callback.
- */
-extern int android_device_send_async(AndroidDevice* ad,
- void* data,
- int size,
- int free_on_close,
- async_send_cb cb,
- void* opaque);
-
-#endif /* ANDROID_ANDROID_DEVICE_H_ */
diff --git a/android/android.h b/android/android.h
index 189b5c2..e32f9f5 100644
--- a/android/android.h
+++ b/android/android.h
@@ -97,6 +97,13 @@ extern int android_parse_network_speed(const char* speed);
* accordingly. returns -1 on error, 0 on success */
extern int android_parse_network_latency(const char* delay);
+/** in qemu_setup.c */
+
+#define ANDROID_GLSTRING_BUF_SIZE 128
+extern char android_gl_vendor[ANDROID_GLSTRING_BUF_SIZE];
+extern char android_gl_renderer[ANDROID_GLSTRING_BUF_SIZE];
+extern char android_gl_version[ANDROID_GLSTRING_BUF_SIZE];
+
extern void android_emulation_setup( void );
extern void android_emulation_teardown( void );
diff --git a/android/async-socket-connector.c b/android/async-socket-connector.c
index 836016c..f4d51b5 100644
--- a/android/async-socket-connector.c
+++ b/android/async-socket-connector.c
@@ -20,8 +20,6 @@
* a TCP port forwarding, enabled by ADB.
*/
-#include "qemu-common.h"
-#include "android/async-utils.h"
#include "android/utils/debug.h"
#include "android/async-socket-connector.h"
#include "utils/panic.h"
@@ -314,11 +312,15 @@ async_socket_connector_new(const SockAddress* address,
connector->ref_count = 1;
/* Copy socket address. */
+#ifdef _WIN32
+ connector->address = *address;
+#else
if (sock_address_get_family(address) == SOCKET_UNIX) {
sock_address_init_unix(&connector->address, sock_address_get_path(address));
} else {
connector->address = *address;
}
+#endif
/* Create a looper for asynchronous I/O. */
if (looper == NULL) {
diff --git a/android/async-socket-connector.h b/android/async-socket-connector.h
index bedc2df..d49d203 100644
--- a/android/async-socket-connector.h
+++ b/android/async-socket-connector.h
@@ -17,7 +17,9 @@
#ifndef ANDROID_ASYNC_SOCKET_CONNECTOR_H_
#define ANDROID_ASYNC_SOCKET_CONNECTOR_H_
+#include "qemu-common.h"
#include "android/async-io-common.h"
+#include "android/async-utils.h"
/*
* Contains declaration of an API that allows asynchronous connection to a
diff --git a/android/async-socket.c b/android/async-socket.c
index 5e2ae29..ab4e4b6 100644
--- a/android/async-socket.c
+++ b/android/async-socket.c
@@ -20,8 +20,6 @@
* a TCP port forwarding, enabled by ADB.
*/
-#include "qemu-common.h"
-#include "android/async-utils.h"
#include "android/utils/debug.h"
#include "android/async-socket-connector.h"
#include "android/async-socket.h"
@@ -683,10 +681,10 @@ static void
_async_socket_close_socket(AsyncSocket* as)
{
if (as->fd >= 0) {
- loopIo_done(as->io);
- socket_close(as->fd);
T("ASocket %s: Socket handle %d is closed.",
_async_socket_string(as), as->fd);
+ loopIo_done(as->io);
+ socket_close(as->fd);
as->fd = -1;
}
}
@@ -1217,15 +1215,22 @@ async_socket_read_abs(AsyncSocket* as,
AsyncSocketIO* const asr =
_async_socket_reader_new(as, buffer, len, reader_cb, reader_opaque,
deadline);
- /* Add new reader to the list. Note that we use initial reference from I/O
- * 'new' routine as "in the list" reference counter. */
- if (as->readers_head == NULL) {
- as->readers_head = as->readers_tail = asr;
+ if (async_socket_is_connected(as)) {
+ /* Add new reader to the list. Note that we use initial reference from I/O
+ * 'new' routine as "in the list" reference counter. */
+ if (as->readers_head == NULL) {
+ as->readers_head = as->readers_tail = asr;
+ } else {
+ as->readers_tail->next = asr;
+ as->readers_tail = asr;
+ }
+ loopIo_wantRead(as->io);
} else {
- as->readers_tail->next = asr;
- as->readers_tail = asr;
+ D("ASocket %s: Read on a disconnected socket.", _async_socket_string(as));
+ errno = ECONNRESET;
+ reader_cb(reader_opaque, asr, ASIO_STATE_FAILED);
+ async_socket_io_release(asr);
}
- loopIo_wantRead(as->io);
}
void
@@ -1253,15 +1258,22 @@ async_socket_write_abs(AsyncSocket* as,
AsyncSocketIO* const asw =
_async_socket_writer_new(as, buffer, len, writer_cb, writer_opaque,
deadline);
- /* Add new writer to the list. Note that we use initial reference from I/O
- * 'new' routine as "in the list" reference counter. */
- if (as->writers_head == NULL) {
- as->writers_head = as->writers_tail = asw;
+ if (async_socket_is_connected(as)) {
+ /* Add new writer to the list. Note that we use initial reference from I/O
+ * 'new' routine as "in the list" reference counter. */
+ if (as->writers_head == NULL) {
+ as->writers_head = as->writers_tail = asw;
+ } else {
+ as->writers_tail->next = asw;
+ as->writers_tail = asw;
+ }
+ loopIo_wantWrite(as->io);
} else {
- as->writers_tail->next = asw;
- as->writers_tail = asw;
+ D("ASocket %s: Write on a disconnected socket.", _async_socket_string(as));
+ errno = ECONNRESET;
+ writer_cb(writer_opaque, asw, ASIO_STATE_FAILED);
+ async_socket_io_release(asw);
}
- loopIo_wantWrite(as->io);
}
void
@@ -1294,3 +1306,9 @@ async_socket_get_port(const AsyncSocket* as)
{
return sock_address_get_port(&as->address);
}
+
+int
+async_socket_is_connected(const AsyncSocket* as)
+{
+ return as->fd >= 0;
+}
diff --git a/android/async-socket.h b/android/async-socket.h
index 503907b..bdfd272 100644
--- a/android/async-socket.h
+++ b/android/async-socket.h
@@ -17,7 +17,9 @@
#ifndef ANDROID_ASYNC_SOCKET_H_
#define ANDROID_ASYNC_SOCKET_H_
+#include "qemu-common.h"
#include "android/async-io-common.h"
+#include "android/async-utils.h"
/*
* Contains declaration of an API that encapsulates communication via an
@@ -264,4 +266,10 @@ extern void* async_socket_get_client_opaque(const AsyncSocket* as);
/* Gets TCP port for the socket. */
extern int async_socket_get_port(const AsyncSocket* as);
+/* Checks if socket is connected.
+ * Return:
+ * Boolean: 1 - socket is connected, 0 - socket is not connected.
+ */
+extern int async_socket_is_connected(const AsyncSocket* as);
+
#endif /* ANDROID_ASYNC_SOCKET_H_ */
diff --git a/android/avd/hardware-properties.ini b/android/avd/hardware-properties.ini
index 582083c..0ef6091 100644
--- a/android/avd/hardware-properties.ini
+++ b/android/avd/hardware-properties.ini
@@ -262,7 +262,7 @@ name = hw.sensors.magnetic_field
type = boolean
default = yes
abstract = Magnetic field support
-description = Provides magnetic field senosr values.
+description = Provides magnetic field sensor values.
# Orientation sensor
name = hw.sensors.orientation
@@ -276,7 +276,7 @@ name = hw.sensors.temperature
type = boolean
default = yes
abstract = Temperature support
-description = Provides temperatore sensor values.
+description = Provides temperature sensor values.
# Kernel image.
#
diff --git a/android/avd/util.c b/android/avd/util.c
index a174ee3..cc51e0f 100644
--- a/android/avd/util.c
+++ b/android/avd/util.c
@@ -254,6 +254,8 @@ path_getBuildTargetArch( const char* androidOut )
result = "arm";
else if (!strcmp("armeabi-v7a", cpuAbi))
result = "arm";
+ else if (!strncmp("mips", cpuAbi, 4))
+ result = "mips";
else
result = cpuAbi;
diff --git a/android/build/common.sh b/android/build/common.sh
index c7235ae..e3e190b 100644
--- a/android/build/common.sh
+++ b/android/build/common.sh
@@ -499,10 +499,10 @@ locate_android_prebuilt ()
{
# locate prebuilt directory
ANDROID_PREBUILT_HOST_TAG=$OS
- ANDROID_PREBUILT=$ANDROID_TOP/prebuilt/$ANDROID_PREBUILT_HOST_TAG
- ANDROID_PREBUILTS=$ANDROID_TOP/prebuilts/misc/$ANDROID_PREBUILT_HOST_TAG
+ ANDROID_PREBUILT=$ANDROID_TOP/prebuilt/$ANDROID_PREBUILT_HOST_TAG # AOSP still has it
+ ANDROID_PREBUILTS=$ANDROID_TOP/prebuilts/misc/$ANDROID_PREBUILT_HOST_TAG # AOSP does't have it yet
if [ ! -d $ANDROID_PREBUILT ] ; then
- # this can happen when building on x86_64
+ # this can happen when building on x86_64, or in AOSP
case $OS in
linux-x86_64)
ANDROID_PREBUILT_HOST_TAG=linux-x86
@@ -511,8 +511,7 @@ locate_android_prebuilt ()
*)
esac
if [ ! -d $ANDROID_PREBUILT ] ; then
- echo "Can't find the prebuilt directory $ANDROID_PREBUILT in Android build"
- exit 1
+ ANDROID_PREBUILT=
fi
fi
if [ ! -d $ANDROID_PREBUILTS ] ; then
@@ -525,8 +524,7 @@ locate_android_prebuilt ()
*)
esac
if [ ! -d $ANDROID_PREBUILTS ] ; then
- echo "Can't find the prebuilts directory $ANDROID_PREBUILTS in Android build"
- exit 1
+ ANDROID_PREBUILTS=
fi
fi
log "Prebuilt : ANDROID_PREBUILT=$ANDROID_PREBUILT"
diff --git a/android/camera/camera-capture-windows.c b/android/camera/camera-capture-windows.c
index e1c5538..7f9df39 100755
--- a/android/camera/camera-capture-windows.c
+++ b/android/camera/camera-capture-windows.c
@@ -19,6 +19,7 @@
* This code uses capXxx API, available via capCreateCaptureWindow.
*/
+#include <windows.h>
#include <vfw.h>
#include "android/camera/camera-capture.h"
#include "android/camera/camera-format-converters.h"
diff --git a/android/cmdline-options.h b/android/cmdline-options.h
index eb8ede0..5e8d59f 100644
--- a/android/cmdline-options.h
+++ b/android/cmdline-options.h
@@ -72,6 +72,7 @@ CFG_PARAM( initdata, "<file>", "same as '-init-data <file>'" )
CFG_PARAM( data, "<file>", "data image (default <datadir>/userdata-qemu.img" )
CFG_PARAM( partition_size, "<size>", "system/data partition size in MBs" )
CFG_PARAM( cache, "<file>", "cache partition image (default is temporary file)" )
+OPT_PARAM( cache_size, "<size>", "cache partition size in MBs" )
CFG_FLAG ( no_cache, "disable the cache partition" )
CFG_FLAG ( nocache, "same as -no-cache" )
OPT_PARAM( sdcard, "<file>", "SD card image (default <system>/sdcard.img")
diff --git a/android/config/darwin-x86/config-host.h b/android/config/darwin-x86/config-host.h
index 97a83dc..d5e8507 100644
--- a/android/config/darwin-x86/config-host.h
+++ b/android/config/darwin-x86/config-host.h
@@ -26,3 +26,4 @@
#define CONFIG_ANDROID 1
#define CONFIG_POSIX 1
#define CONFIG_MADVISE 1
+#define CONFIG_ANDROID_OPENGLES 1
diff --git a/android/config/linux-x86/config-host.h b/android/config/linux-x86/config-host.h
index 70b9ce7..d9f04fa 100644
--- a/android/config/linux-x86/config-host.h
+++ b/android/config/linux-x86/config-host.h
@@ -26,3 +26,4 @@
#define CONFIG_POSIX 1
#define CONFIG_ANDROID 1
#define CONFIG_MADVISE 1
+#define CONFIG_ANDROID_OPENGLES 1
diff --git a/android/config/target-mips/config.h b/android/config/target-mips/config.h
new file mode 100644
index 0000000..4002cdc
--- /dev/null
+++ b/android/config/target-mips/config.h
@@ -0,0 +1,5 @@
+/* MIPS-specific configuration */
+#include "android/config/config.h"
+
+#define TARGET_MIPS 1
+#define CONFIG_SOFTFLOAT 1
diff --git a/android/config/windows/config-host.h b/android/config/windows/config-host.h
index 1b50927..2d2fdc6 100644
--- a/android/config/windows/config-host.h
+++ b/android/config/windows/config-host.h
@@ -18,3 +18,4 @@
#define QEMU_PKGVERSION "Android"
#define CONFIG_WIN32 1
#define CONFIG_ANDROID 1
+#define CONFIG_ANDROID_OPENGLES 1
diff --git a/android/help.c b/android/help.c
index c6ffb87..1570160 100644
--- a/android/help.c
+++ b/android/help.c
@@ -585,6 +585,15 @@ help_cache(stralloc_t* out)
}
static void
+help_cache_size(stralloc_t* out)
+{
+ PRINTF(
+ " use '-cache <size>' to specify a /cache partition size in MB. By default,\n"
+ " the cache partition size is set to 66MB\n\n"
+ );
+}
+
+static void
help_no_cache(stralloc_t* out)
{
PRINTF(
diff --git a/android/hw-events.h b/android/hw-events.h
index 488c299..b8340bd 100644
--- a/android/hw-events.h
+++ b/android/hw-events.h
@@ -41,6 +41,17 @@ typedef enum {
/* BEWARE: The following codes are defined by the Linux kernel headers.
* The Android "Menu" key is KEY_SOFT1, *not* KEY_MENU
*/
+/* NOTE: mingw's winnt.h define DELETE to constant
+ i586-mingw32msvc: #define DELETE 0x00010000L
+ x86_64-w64-mingw32-gcc: #define DELETE (0x00010000L)
+
+ KEY_CODE belows glues "KEY_" and "DELETE".
+ While KEY_0x00010000L may not mean anything,
+ KEY_(0x00010000L) is absolutely harmful to compiler.
+ Undefine DELETE below
+ */
+#undef DELETE
+
#define EVENT_KEY_LIST \
KEY_CODE(ESC ,1) \
KEY_CODE(1 ,2) \
diff --git a/android/hw-pipe-net.c b/android/hw-pipe-net.c
index 5a25401..1c71f18 100644
--- a/android/hw-pipe-net.c
+++ b/android/hw-pipe-net.c
@@ -204,10 +204,9 @@ netPipe_initFromAddress( void* hwpipe, const SockAddress* address, Looper* loop
}
loopIo_init(pipe->io, looper, fd, netPipe_io_func, pipe);
- asyncConnector_init(pipe->connector, address, pipe->io);
+ status = asyncConnector_init(pipe->connector, address, pipe->io);
pipe->state = STATE_CONNECTING;
- status = asyncConnector_run(pipe->connector);
if (status == ASYNC_ERROR) {
D("%s: Could not connect to socket: %s",
__FUNCTION__, errno_str);
@@ -234,6 +233,17 @@ netPipe_closeFromGuest( void* opaque )
netPipe_free(pipe);
}
+static int netPipeReadySend(NetPipe *pipe)
+{
+ if (pipe->state == STATE_CONNECTED)
+ return 0;
+ else if (pipe->state == STATE_CONNECTING)
+ return PIPE_ERROR_AGAIN;
+ else if (pipe->hwpipe == NULL)
+ return PIPE_ERROR_INVAL;
+ else
+ return PIPE_ERROR_IO;
+}
static int
netPipe_sendBuffers( void* opaque, const GoldfishPipeBuffer* buffers, int numBuffers )
@@ -245,6 +255,10 @@ netPipe_sendBuffers( void* opaque, const GoldfishPipeBuffer* buffers, int numBuf
const GoldfishPipeBuffer* buff = buffers;
const GoldfishPipeBuffer* buffEnd = buff + numBuffers;
+ ret = netPipeReadySend(pipe);
+ if (ret != 0)
+ return ret;
+
for (; buff < buffEnd; buff++)
count += buff->size;
@@ -478,19 +492,18 @@ openglesPipe_init( void* hwpipe, void* _looper, const char* args )
return NULL;
}
+ char server_addr[PATH_MAX];
+ android_gles_server_path(server_addr, sizeof(server_addr));
#ifndef _WIN32
if (android_gles_fast_pipes) {
- char unix_path[PATH_MAX];
- android_gles_unix_path(unix_path, sizeof(unix_path), ANDROID_OPENGLES_BASE_PORT);
- pipe = (NetPipe *)netPipe_initUnix(hwpipe, _looper, unix_path);
- D("Creating Unix OpenGLES pipe for GPU emulation: %s", unix_path);
+ pipe = (NetPipe *)netPipe_initUnix(hwpipe, _looper, server_addr);
+ D("Creating Unix OpenGLES pipe for GPU emulation: %s", server_addr);
} else {
#else /* _WIN32 */
{
#endif
/* Connect through TCP as a fallback */
- snprintf(temp, sizeof temp, "%d", ANDROID_OPENGLES_BASE_PORT);
- pipe = (NetPipe *)netPipe_initTcp(hwpipe, _looper, temp);
+ pipe = (NetPipe *)netPipe_initTcp(hwpipe, _looper, server_addr);
D("Creating TCP OpenGLES pipe for GPU emulation!");
}
if (pipe != NULL) {
diff --git a/android/hw-sensors.c b/android/hw-sensors.c
index 17b2491..a7daea5 100644
--- a/android/hw-sensors.c
+++ b/android/hw-sensors.c
@@ -438,7 +438,7 @@ _hwSensorClient_receive( HwSensorClient* cl, uint8_t* msg, int msglen )
}
/* If emulating device is connected update sensor state there too. */
- if (hw->sensors_port != NULL && sensors_port_is_connected(hw->sensors_port)) {
+ if (hw->sensors_port != NULL) {
if (enabled) {
sensors_port_enable_sensor(hw->sensors_port, (const char*)msg);
} else {
@@ -692,11 +692,6 @@ _hwSensors_init( HwSensors* h )
h->sensors[ANDROID_SENSOR_TEMPERATURE].enabled = 1;
}
- if (h->sensors_port != NULL) {
- /* Init sensors on the attached device. */
- sensors_port_init_sensors(h->sensors_port);
- }
-
/* XXX: TODO: Add other tests when we add the corresponding
* properties to hardware-properties.ini et al. */
diff --git a/android/main-common.c b/android/main-common.c
index 04d200a..2d535c7 100644
--- a/android/main-common.c
+++ b/android/main-common.c
@@ -232,7 +232,7 @@ sdl_set_window_icon( void )
SDL_GetWMInfo(&wminfo);
- SetClassLong( wminfo.window, GCL_HICON, (LONG)icon );
+ SetClassLongPtr( wminfo.window, GCLP_HICON, (LONG)icon );
#else /* !_WIN32 */
unsigned icon_w, icon_h;
size_t icon_bytes;
diff --git a/android/main.c b/android/main.c
index 51d481c..4178a6b 100644
--- a/android/main.c
+++ b/android/main.c
@@ -407,6 +407,9 @@ int main(int argc, char **argv)
#elif defined(TARGET_I386)
free(android_hw->hw_cpu_arch);
android_hw->hw_cpu_arch = ASTRDUP("x86");
+#elif defined(TARGET_MIPS)
+ free(android_hw->hw_cpu_arch);
+ android_hw->hw_cpu_arch = ASTRDUP("mips");
#endif
}
@@ -723,6 +726,18 @@ int main(int argc, char **argv)
}
}
+ if (hw->disk_cachePartition_path && opts->cache_size) {
+ /* Set cache partition size per user options. */
+ char* end;
+ long sizeMB = strtol(opts->cache_size, &end, 0);
+
+ if (sizeMB < 0 || *end != 0) {
+ derror( "-cache-size must be followed by a positive integer" );
+ exit(1);
+ }
+ hw->disk_cachePartition_size = (uint64_t) sizeMB * ONE_MB;
+ }
+
/** SD CARD PARTITION */
if (!hw->hw_sdCard) {
diff --git a/android/multitouch-port.c b/android/multitouch-port.c
index 9a9313c..88a76fe 100644
--- a/android/multitouch-port.c
+++ b/android/multitouch-port.c
@@ -19,47 +19,102 @@
#include "android/hw-events.h"
#include "android/charmap.h"
#include "android/multitouch-screen.h"
+#include "android/sdk-controller-socket.h"
#include "android/multitouch-port.h"
#include "android/globals.h" /* for android_hw */
+#include "android/opengles.h"
#include "android/utils/misc.h"
#include "android/utils/jpeg-compress.h"
+#include "android/utils/debug.h"
#define E(...) derror(__VA_ARGS__)
#define W(...) dwarning(__VA_ARGS__)
#define D(...) VERBOSE_PRINT(mtport,__VA_ARGS__)
#define D_ACTIVE VERBOSE_CHECK(mtport)
-/* Query timeout in milliseconds. */
-#define MTSP_QUERY_TIMEOUT 3000
-#define MTSP_MAX_MSG 2048
-#define MTSP_MAX_EVENT 2048
+#define TRACE_ON 1
+
+#if TRACE_ON
+#define T(...) VERBOSE_PRINT(mtport,__VA_ARGS__)
+#else
+#define T(...)
+#endif
+
+/* Timeout (millisec) to use when communicating with SDK controller. */
+#define SDKCTL_MT_TIMEOUT 3000
+
+/*
+ * Message types used in multi-touch emulation.
+ */
+
+/* Pointer move message. */
+#define SDKCTL_MT_MOVE 1
+/* First pointer down message. */
+#define SDKCTL_MT_FISRT_DOWN 2
+/* Last pointer up message. */
+#define SDKCTL_MT_LAST_UP 3
+/* Pointer down message. */
+#define SDKCTL_MT_POINTER_DOWN 4
+/* Pointer up message. */
+#define SDKCTL_MT_POINTER_UP 5
+/* Sends framebuffer update. */
+#define SDKCTL_MT_FB_UPDATE 6
+/* Framebuffer update has been received. */
+#define SDKCTL_MT_FB_UPDATE_RECEIVED 7
+/* Framebuffer update has been handled. */
+#define SDKCTL_MT_FB_UPDATE_HANDLED 8
/* Multi-touch port descriptor. */
struct AndroidMTSPort {
/* Caller identifier. */
- void* opaque;
- /* Connected android device. */
- AndroidDevice* device;
+ void* opaque;
+ /* Communication socket. */
+ SDKCtlSocket* sdkctl;
/* Initialized JPEG compressor instance. */
- AJPEGDesc* jpeg_compressor;
- /* Connection status: 1 connected, 0 - disconnected. */
- int is_connected;
- /* Buffer where to receive multitouch messages. */
- char mts_msg[MTSP_MAX_MSG];
- /* Buffer where to receive multitouch events. */
- char events[MTSP_MAX_EVENT];
+ AJPEGDesc* jpeg_compressor;
+ /* Direct packet descriptor for framebuffer updates. */
+ SDKCtlDirectPacket* fb_packet;
};
+/* Data sent with SDKCTL_MT_QUERY_START */
+typedef struct QueryDispData {
+ /* Width of the emulator display. */
+ int width;
+ /* Height of the emulator display. */
+ int height;
+} QueryDispData;
+
+/* Multi-touch event structure received from SDK controller port. */
+typedef struct AndroidMTEvent {
+ /* Pointer identifier. */
+ int pid;
+ /* Pointer 'x' coordinate. */
+ int x;
+ /* Pointer 'y' coordinate. */
+ int y;
+ /* Pointer pressure. */
+ int pressure;
+} AndroidMTEvent;
+
+/* Multi-touch pointer descriptor received from SDK controller port. */
+typedef struct AndroidMTPtr {
+ /* Pointer identifier. */
+ int pid;
+} AndroidMTPtr;
+
/* Destroys and frees the descriptor. */
static void
_mts_port_free(AndroidMTSPort* mtsp)
{
if (mtsp != NULL) {
+ if (mtsp->fb_packet != NULL) {
+ sdkctl_direct_packet_release(mtsp->fb_packet);
+ }
if (mtsp->jpeg_compressor != NULL) {
jpeg_compressor_destroy(mtsp->jpeg_compressor);
}
- if (mtsp->device != NULL) {
- android_device_destroy(mtsp->device);
+ if (mtsp->sdkctl != NULL) {
+ sdkctl_socket_release(mtsp->sdkctl);
}
AFREE(mtsp);
}
@@ -114,170 +169,186 @@ _on_action_move(int tracking_id, int x, int y, int pressure)
* Multi-touch event handlers
*******************************************************************************/
-/* Handles "pointer move" event. */
+/* Handles "pointer move" event.
+ * Param:
+ * param - Array of moving pointers.
+ * pointers_count - Number of pointers in the array.
+ */
static void
-_on_move(const char* param)
+_on_move(const AndroidMTEvent* param, int pointers_count)
{
- const char* pid = param;
- D(">>> MOVE: %s", param);
- while (pid && *pid) {
- int pid_val, x, y, pressure = 0;
- if (!get_token_value_int(pid, "pid", &pid_val) &&
- !get_token_value_int(pid, "x", &x) &&
- !get_token_value_int(pid, "y", &y)) {
- get_token_value_int(pid, "pressure", &pressure);
- _on_action_move(pid_val, x, y, pressure);
- pid = strstr(pid + 1, "pid");
- } else {
- break;
- }
+ int n;
+ for (n = 0; n < pointers_count; n++, param++) {
+ T("Multi-touch: MOVE(%d): %d-> %d:%d:%d",
+ n, param->pid, param->x, param->y, param->pressure);
+ _on_action_move(param->pid, param->x, param->y, param->pressure);
}
}
/* Handles "first pointer down" event. */
static void
-_on_down(const char* param)
+_on_down(const AndroidMTEvent* param)
{
- int pid_val, x, y, pressure = 0;
- D(">>> 1-ST DOWN: %s", param);
- if (!get_token_value_int(param, "pid", &pid_val) &&
- !get_token_value_int(param, "x", &x) &&
- !get_token_value_int(param, "y", &y)) {
- get_token_value_int(param, "pressure", &pressure);
- _on_action_down(pid_val, x, y, pressure);
- } else {
- W("Invalid parameters '%s' for MTS 'down' event", param);
- }
+ T("Multi-touch: 1-ST DOWN: %d-> %d:%d:%d",
+ param->pid, param->x, param->y, param->pressure);
+ _on_action_down(param->pid, param->x, param->y, param->pressure);
}
/* Handles "last pointer up" event. */
static void
-_on_up(const char* param)
+_on_up(const AndroidMTPtr* param)
{
- int pid_val;
- D(">>> LAST UP: %s", param);
- if (!get_token_value_int(param, "pid", &pid_val)) {
- _on_action_up(pid_val);
- } else {
- W("Invalid parameters '%s' for MTS 'up' event", param);
- }
+ T("Multi-touch: LAST UP: %d", param->pid);
+ _on_action_up(param->pid);
}
/* Handles "next pointer down" event. */
static void
-_on_pdown(const char* param)
+_on_pdown(const AndroidMTEvent* param)
{
- int pid_val, x, y, pressure = 0;
- D(">>> DOWN: %s", param);
- if (!get_token_value_int(param, "pid", &pid_val) &&
- !get_token_value_int(param, "x", &x) &&
- !get_token_value_int(param, "y", &y)) {
- get_token_value_int(param, "pressure", &pressure);
- _on_action_pointer_down(pid_val, x, y, pressure);
- } else {
- W("Invalid parameters '%s' for MTS 'pointer down' event", param);
- }
+ T("Multi-touch: DOWN: %d-> %d:%d:%d",
+ param->pid, param->x, param->y, param->pressure);
+ _on_action_pointer_down(param->pid, param->x, param->y, param->pressure);
}
/* Handles "next pointer up" event. */
static void
-_on_pup(const char* param)
+_on_pup(const AndroidMTPtr* param)
{
- int pid_val;
- D(">>> UP: %s", param);
- if (!get_token_value_int(param, "pid", &pid_val)) {
- _on_action_pointer_up(pid_val);
- } else {
- W("Invalid parameters '%s' for MTS 'up' event", param);
- }
+ T("Multi-touch: UP: %d", param->pid);
+ _on_action_pointer_up(param->pid);
}
/********************************************************************************
* Device communication callbacks
*******************************************************************************/
-/* Main event handler.
- * This routine is invoked when an event message has been received from the
- * device.
- */
-static void
-_on_event_received(void* opaque, AndroidDevice* ad, char* msg, int msgsize)
+/* A callback that is invoked on SDK controller socket connection events. */
+static AsyncIOAction
+_on_multitouch_socket_connection(void* opaque,
+ SDKCtlSocket* sdkctl,
+ AsyncIOState status)
{
- char* action;
- int res;
- AndroidMTSPort* mtsp = (AndroidMTSPort*)opaque;
-
- if (errno) {
- D("Multi-touch notification has failed: %s", strerror(errno));
- return;
- }
-
- /* Dispatch the event to an appropriate handler. */
- res = get_token_value_alloc(msg, "action", &action);
- if (!res) {
- const char* param = strchr(msg, ' ');
- if (param) {
- param++;
+ if (status == ASIO_STATE_FAILED) {
+ /* Reconnect (after timeout delay) on failures */
+ if (sdkctl_socket_is_handshake_ok(sdkctl)) {
+ sdkctl_socket_reconnect(sdkctl, SDKCTL_DEFAULT_TCP_PORT,
+ SDKCTL_MT_TIMEOUT);
}
- if (!strcmp(action, "move")) {
- _on_move(param);
- } else if (!strcmp(action, "down")) {
- _on_down(param);
- } else if (!strcmp(action, "up")) {
- _on_up(param);
- } else if (!strcmp(action, "pdown")) {
- _on_pdown(param);
- } else if (!strcmp(action, "pup")) {
- _on_pup(param);
- } else {
- D("Unknown multi-touch event action '%s'", action);
- }
- free(action);
}
-
- /* Listen to the next event. */
- android_device_listen(ad, mtsp->events, sizeof(mtsp->events),
- _on_event_received);
+ return ASIO_ACTION_DONE;
}
-/* A callback that is invoked when android device is connected (i.e. both,
- * command and event channels have been established).
- * Param:
- * opaque - AndroidMTSPort instance.
- * ad - Android device used by this port.
- * failure - Connections status.
- */
+/* A callback that is invoked on SDK controller port connection events. */
static void
-_on_device_connected(void* opaque, AndroidDevice* ad, int failure)
+_on_multitouch_port_connection(void* opaque,
+ SDKCtlSocket* sdkctl,
+ SdkCtlPortStatus status)
{
- if (!failure) {
- AndroidMTSPort* mtsp = (AndroidMTSPort*)opaque;
- mtsp->is_connected = 1;
- D("Multi-touch emulation has started");
- android_device_listen(mtsp->device, mtsp->events, sizeof(mtsp->events),
- _on_event_received);
- mts_port_start(mtsp);
+ switch (status) {
+ case SDKCTL_PORT_CONNECTED:
+ D("Multi-touch: SDK Controller is connected");
+ break;
+
+ case SDKCTL_PORT_DISCONNECTED:
+ D("Multi-touch: SDK Controller is disconnected");
+ // Disable OpenGLES framebuffer updates.
+ if (android_hw->hw_gpu_enabled) {
+ android_setPostCallback(NULL, NULL);
+ }
+ break;
+
+ case SDKCTL_PORT_ENABLED:
+ D("Multi-touch: SDK Controller port is enabled.");
+ // Enable OpenGLES framebuffer updates.
+ if (android_hw->hw_gpu_enabled) {
+ android_setPostCallback(multitouch_opengles_fb_update, NULL);
+ }
+ /* Refresh (possibly stale) device screen. */
+ multitouch_refresh_screen();
+ break;
+
+ case SDKCTL_PORT_DISABLED:
+ D("Multi-touch: SDK Controller port is disabled.");
+ // Disable OpenGLES framebuffer updates.
+ if (android_hw->hw_gpu_enabled) {
+ android_setPostCallback(NULL, NULL);
+ }
+ break;
+
+ case SDKCTL_HANDSHAKE_CONNECTED:
+ D("Multi-touch: Handshake succeeded with connected port.");
+ break;
+
+ case SDKCTL_HANDSHAKE_NO_PORT:
+ D("Multi-touch: Handshake succeeded with disconnected port.");
+ break;
+
+ case SDKCTL_HANDSHAKE_DUP:
+ W("Multi-touch: Handshake failed due to port duplication.");
+ sdkctl_socket_disconnect(sdkctl);
+ break;
+
+ case SDKCTL_HANDSHAKE_UNKNOWN_QUERY:
+ W("Multi-touch: Handshake failed due to unknown query.");
+ sdkctl_socket_disconnect(sdkctl);
+ break;
+
+ case SDKCTL_HANDSHAKE_UNKNOWN_RESPONSE:
+ default:
+ W("Multi-touch: Handshake failed due to unknown reason.");
+ sdkctl_socket_disconnect(sdkctl);
+ break;
}
}
-/* Invoked when an I/O failure occurs on a socket.
- * Note that this callback will not be invoked on connection failures.
- * Param:
- * opaque - AndroidMTSPort instance.
- * ad - Android device instance
- * ads - Connection socket where failure has occured.
- * failure - Contains 'errno' indicating the reason for failure.
- */
+/* A callback that is invoked when a message is received from the device. */
static void
-_on_io_failure(void* opaque, AndroidDevice* ad, int failure)
+_on_multitouch_message(void* client_opaque,
+ SDKCtlSocket* sdkctl,
+ SDKCtlMessage* message,
+ int msg_type,
+ void* msg_data,
+ int msg_size)
{
- AndroidMTSPort* mtsp = (AndroidMTSPort*)opaque;
- E("Multi-touch port got disconnected: %s", strerror(failure));
- mtsp->is_connected = 0;
- android_device_disconnect(ad);
+ switch (msg_type) {
+ case SDKCTL_MT_MOVE: {
+ assert((msg_size / sizeof(AndroidMTEvent)) && !(msg_size % sizeof(AndroidMTEvent)));
+ _on_move((const AndroidMTEvent*)msg_data, msg_size / sizeof(AndroidMTEvent));
+ break;
+ }
+
+ case SDKCTL_MT_FISRT_DOWN:
+ assert(msg_size / sizeof(AndroidMTEvent) && !(msg_size % sizeof(AndroidMTEvent)));
+ _on_down((const AndroidMTEvent*)msg_data);
+ break;
+
+ case SDKCTL_MT_LAST_UP:
+ _on_up((const AndroidMTPtr*)msg_data);
+ break;
+
+ case SDKCTL_MT_POINTER_DOWN:
+ assert(msg_size / sizeof(AndroidMTEvent) && !(msg_size % sizeof(AndroidMTEvent)));
+ _on_pdown((const AndroidMTEvent*)msg_data);
+ break;
- /* Try to reconnect again. */
- android_device_connect_async(ad, _on_device_connected);
+ case SDKCTL_MT_POINTER_UP:
+ _on_pup((const AndroidMTPtr*)msg_data);
+ break;
+
+ case SDKCTL_MT_FB_UPDATE_RECEIVED:
+ D("Framebuffer update ACK.");
+ break;
+
+ case SDKCTL_MT_FB_UPDATE_HANDLED:
+ D("Framebuffer update handled.");
+ multitouch_fb_updated();
+ break;
+
+ default:
+ W("Multi-touch: Unknown message %d", msg_type);
+ break;
+ }
}
/********************************************************************************
@@ -288,31 +359,32 @@ AndroidMTSPort*
mts_port_create(void* opaque)
{
AndroidMTSPort* mtsp;
- int res;
ANEW0(mtsp);
- mtsp->opaque = opaque;
- mtsp->is_connected = 0;
+ mtsp->opaque = opaque;
/* Initialize default MTS descriptor. */
multitouch_init(mtsp);
- /* Create JPEG compressor. Put "$BLOB:%09d\0" + MTFrameHeader header in front
- * of the compressed data. this way we will have entire query ready to be
+ /* Create JPEG compressor. Put message header + MTFrameHeader in front of the
+ * compressed data. this way we will have entire query ready to be
* transmitted to the device. */
- mtsp->jpeg_compressor = jpeg_compressor_create(16 + sizeof(MTFrameHeader), 4096);
+ mtsp->jpeg_compressor =
+ jpeg_compressor_create(sdkctl_message_get_header_size() + sizeof(MTFrameHeader), 4096);
- mtsp->device = android_device_init(mtsp, AD_MULTITOUCH_PORT, _on_io_failure);
- if (mtsp->device == NULL) {
- _mts_port_free(mtsp);
- return NULL;
- }
+ mtsp->sdkctl = sdkctl_socket_new(SDKCTL_MT_TIMEOUT, "multi-touch",
+ _on_multitouch_socket_connection,
+ _on_multitouch_port_connection,
+ _on_multitouch_message, mtsp);
+ sdkctl_init_recycler(mtsp->sdkctl, 64, 8);
- res = android_device_connect_async(mtsp->device, _on_device_connected);
- if (res != 0) {
- mts_port_destroy(mtsp);
- return NULL;
- }
+ /* Create a direct packet that will wrap up framebuffer updates. Note that
+ * we need to do this after we have initialized the recycler! */
+ mtsp->fb_packet = sdkctl_direct_packet_new(mtsp->sdkctl);
+
+ /* Now we can initiate connection witm MT port on the device. */
+ sdkctl_socket_connect(mtsp->sdkctl, SDKCTL_DEFAULT_TCP_PORT,
+ SDKCTL_MT_TIMEOUT);
return mtsp;
}
@@ -323,75 +395,6 @@ mts_port_destroy(AndroidMTSPort* mtsp)
_mts_port_free(mtsp);
}
-int
-mts_port_is_connected(AndroidMTSPort* mtsp)
-{
- return mtsp->is_connected;
-}
-
-int
-mts_port_start(AndroidMTSPort* mtsp)
-{
- char qresp[MTSP_MAX_MSG];
- char query[256];
- AndroidHwConfig* config = android_hw;
-
- /* Query the device to start capturing multi-touch events, also providing
- * the device with width / height of the emulator's screen. This is required
- * so device can properly adjust multi-touch event coordinates, and display
- * emulator's framebuffer. */
- snprintf(query, sizeof(query), "start:%dx%d",
- config->hw_lcd_width, config->hw_lcd_height);
- int res = android_device_query(mtsp->device, query, qresp, sizeof(qresp),
- MTSP_QUERY_TIMEOUT);
- if (!res) {
- /* By protocol device should reply with its view dimensions. */
- if (*qresp) {
- int width, height;
- if (sscanf(qresp, "%dx%d", &width, &height) == 2) {
- multitouch_set_device_screen_size(width, height);
- D("Multi-touch emulation has started. Device dims: %dx%d",
- width, height);
- } else {
- E("Unexpected reply to MTS 'start' query: %s", qresp);
- android_device_query(mtsp->device, "stop", qresp, sizeof(qresp),
- MTSP_QUERY_TIMEOUT);
- res = -1;
- }
- } else {
- E("MTS protocol error: no reply to query 'start'");
- android_device_query(mtsp->device, "stop", qresp, sizeof(qresp),
- MTSP_QUERY_TIMEOUT);
- res = -1;
- }
- } else {
- if (errno) {
- D("Query 'start' failed on I/O: %s", strerror(errno));
- } else {
- D("Query 'start' failed on device: %s", qresp);
- }
- }
- return res;
-}
-
-int
-mts_port_stop(AndroidMTSPort* mtsp)
-{
- char qresp[MTSP_MAX_MSG];
- const int res =
- android_device_query(mtsp->device, "stop", qresp, sizeof(qresp),
- MTSP_QUERY_TIMEOUT);
- if (res) {
- if (errno) {
- D("Query 'stop' failed on I/O: %s", strerror(errno));
- } else {
- D("Query 'stop' failed on device: %s", qresp);
- }
- }
-
- return res;
-}
-
/********************************************************************************
* Handling framebuffer updates
*******************************************************************************/
@@ -412,6 +415,8 @@ _fb_compress(const AndroidMTSPort* mtsp,
int jpeg_quality,
int ydir)
{
+ T("Multi-touch: compressing %d bytes frame buffer", fmt->w * fmt->h * fmt->bpp);
+
jpeg_compressor_compress_fb(mtsp->jpeg_compressor, fmt->x, fmt->y, fmt->w,
fmt->h, fmt->disp_height, fmt->bpp, fmt->bpl,
fb, jpeg_quality, ydir);
@@ -421,15 +426,12 @@ int
mts_port_send_frame(AndroidMTSPort* mtsp,
MTFrameHeader* fmt,
const uint8_t* fb,
- async_send_cb cb,
+ on_sdkctl_direct_cb cb,
void* cb_opaque,
int ydir)
{
- char* query;
- int blob_size, off;
-
/* Make sure that port is connected. */
- if (!mts_port_is_connected(mtsp)) {
+ if (!sdkctl_socket_is_port_ready(mtsp->sdkctl)) {
return -1;
}
@@ -437,31 +439,32 @@ mts_port_send_frame(AndroidMTSPort* mtsp,
fmt->format = MTFB_JPEG;
_fb_compress(mtsp, fmt, fb, 10, ydir);
- /* Total size of the blob: header + JPEG image. */
- blob_size = sizeof(MTFrameHeader) +
- jpeg_compressor_get_jpeg_size(mtsp->jpeg_compressor);
+ /* Total size of the update data: header + JPEG image. */
+ const int update_size =
+ sizeof(MTFrameHeader) + jpeg_compressor_get_jpeg_size(mtsp->jpeg_compressor);
+
+ /* Update message starts at the beginning of the buffer allocated by the
+ * compressor's destination manager. */
+ uint8_t* const msg = (uint8_t*)jpeg_compressor_get_buffer(mtsp->jpeg_compressor);
- /* Query starts at the beginning of the buffer allocated by the compressor's
- * destination manager. */
- query = (char*)jpeg_compressor_get_buffer(mtsp->jpeg_compressor);
+ /* Initialize message header. */
+ sdkctl_init_message_header(msg, SDKCTL_MT_FB_UPDATE, update_size);
- /* Build the $BLOB query to transfer to the device. */
- snprintf(query, jpeg_compressor_get_header_size(mtsp->jpeg_compressor),
- "$BLOB:%09d", blob_size);
- off = strlen(query) + 1;
+ /* Copy framebuffer update header to the message. */
+ memcpy(msg + sdkctl_message_get_header_size(), fmt, sizeof(MTFrameHeader));
- /* Copy framebuffer update header to the query. */
- memcpy(query + off, fmt, sizeof(MTFrameHeader));
+ /* Compression rate... */
+ const float comp_rate = ((float)jpeg_compressor_get_jpeg_size(mtsp->jpeg_compressor) / (fmt->w * fmt->h * fmt->bpp)) * 100;
/* Zeroing the rectangle in the update header we indicate that it contains
* no updates. */
fmt->x = fmt->y = fmt->w = fmt->h = 0;
- /* Initiate asynchronous transfer of the updated framebuffer rectangle. */
- if (android_device_send_async(mtsp->device, query, off + blob_size, 0, cb, cb_opaque)) {
- D("Unable to send query '%s': %s", query, strerror(errno));
- return -1;
- }
+ /* Send update to the device. */
+ sdkctl_direct_packet_send(mtsp->fb_packet, msg, cb, cb_opaque);
+
+ T("Multi-touch: Sent %d bytes in framebuffer update. Compression rate is %.2f%%",
+ update_size, comp_rate);
return 0;
}
diff --git a/android/multitouch-port.h b/android/multitouch-port.h
index d99b3fd..5652b43 100644
--- a/android/multitouch-port.h
+++ b/android/multitouch-port.h
@@ -17,17 +17,14 @@
#ifndef ANDROID_ANDROID_MULTITOUCH_PORT_H_
#define ANDROID_ANDROID_MULTITOUCH_PORT_H_
+#include "android/sdk-controller-socket.h"
+
/*
* Encapsulates exchange protocol between the multi-touch screen emulator, and an
* application running on an Android device that provides touch events, and is
* connected to the host via USB.
*/
-#include "android/android-device.h"
-
-/* TCP port reserved for multi-touch emulation. */
-#define AD_MULTITOUCH_PORT 1969
-
/*
* Codes that define transmitted framebuffer format:
*
@@ -89,28 +86,6 @@ extern AndroidMTSPort* mts_port_create(void* opaque);
/* Disconnects from the multi-touch port, and destroys the descriptor. */
extern void mts_port_destroy(AndroidMTSPort* amtp);
-/* Checks if port is connected to a MT-emulating application on the device.
- * Note that connection can go out and then be restored at any time after
- * mts_port_create API succeeded.
- */
-extern int mts_port_is_connected(AndroidMTSPort* amtp);
-
-/* Queries the connected application to start delivering multi-touch events.
- * Param:
- * amtp - Android multi-touch port instance returned from mts_port_create.
- * Return:
- * Zero on success, failure otherwise.
- */
-extern int mts_port_start(AndroidMTSPort* amtp);
-
-/* Queries the connected application to stop delivering multi-touch events.
- * Param:
- * amtp - Android multi-touch port instance returned from mts_port_create.
- * Return:
- * Zero on success, failure otherwise.
- */
-extern int mts_port_stop(AndroidMTSPort* amtp);
-
/* Sends framebuffer update to the multi-touch emulation application, running on
* the android device.
* Param:
@@ -129,7 +104,7 @@ extern int mts_port_stop(AndroidMTSPort* amtp);
extern int mts_port_send_frame(AndroidMTSPort* mtsp,
MTFrameHeader* fmt,
const uint8_t* fb,
- async_send_cb cb,
+ on_sdkctl_direct_cb cb,
void* cb_opaque,
int ydir);
diff --git a/android/multitouch-screen.c b/android/multitouch-screen.c
index bd96f79..36f937d 100644
--- a/android/multitouch-screen.c
+++ b/android/multitouch-screen.c
@@ -29,6 +29,15 @@
#define D(...) VERBOSE_PRINT(mtscreen,__VA_ARGS__)
#define D_ACTIVE VERBOSE_CHECK(mtscreen)
+#define TRACE_ON 1
+
+#if TRACE_ON
+#define T(...) VERBOSE_PRINT(mtscreen,__VA_ARGS__)
+#else
+#define T(...)
+#endif
+
+
/* Maximum number of pointers, supported by multi-touch emulation. */
#define MTS_POINTERS_NUM 10
/* Signals that pointer is not tracked (or is "up"). */
@@ -54,10 +63,6 @@ typedef struct MTSState {
AndroidMTSPort* mtsp;
/* Emulator's display state. */
DisplayState* ds;
- /* Screen width of the device that emulates multi-touch. */
- int device_width;
- /* Screen height of the device that emulates multi-touch. */
- int device_height;
/* Number of tracked pointers. */
int tracked_ptr_num;
/* Index in the 'tracked_pointers' array of the last pointer for which
@@ -82,7 +87,7 @@ typedef struct MTSState {
} MTSState;
/* Default multi-touch screen descriptor */
-static MTSState _MTSState;
+static MTSState _MTSState = { 0 };
/* Pushes event to the event device. */
static void
@@ -239,24 +244,27 @@ static int _is_mt_initialized = 0;
/* Callback that is invoked when framebuffer update has been transmitted to the
* device. */
-static void
-_on_fb_sent(void* opaque, ATResult res, void* data, int size, int sent)
+static AsyncIOAction
+_on_fb_sent(void* opaque, SDKCtlDirectPacket* packet, AsyncIOState status)
{
MTSState* const mts_state = (MTSState*)opaque;
- /* Lets see if we have accumulated more changes while transmission has been
- * in progress. */
- if (mts_state->fb_header.w && mts_state->fb_header.h) {
- /* Send accumulated updates. */
- if (mts_port_send_frame(mts_state->mtsp, &mts_state->fb_header,
- mts_state->current_fb, _on_fb_sent, mts_state,
- mts_state->ydir)) {
- mts_state->fb_transfer_in_progress = 0;
+ if (status == ASIO_STATE_SUCCEEDED) {
+ /* Lets see if we have accumulated more changes while transmission has been
+ * in progress. */
+ if (mts_state->fb_header.w && mts_state->fb_header.h &&
+ !mts_state->fb_transfer_in_progress) {
+ mts_state->fb_transfer_in_progress = 1;
+ /* Send accumulated updates. */
+ if (mts_port_send_frame(mts_state->mtsp, &mts_state->fb_header,
+ mts_state->current_fb, _on_fb_sent, mts_state,
+ mts_state->ydir)) {
+ mts_state->fb_transfer_in_progress = 0;
+ }
}
- } else {
- /* Framebuffer transfer is completed, and no more updates are pending. */
- mts_state->fb_transfer_in_progress = 0;
}
+
+ return ASIO_ACTION_DONE;
}
/* Common handler for framebuffer updates invoked by both, software, and OpenGLES
@@ -324,6 +332,9 @@ _mt_fb_update(void* opaque, int x, int y, int w, int h)
MTSState* const mts_state = (MTSState*)opaque;
const DisplaySurface* const surface = mts_state->ds->surface;
+ T("Multi-touch: Software renderer framebuffer update: %d:%d -> %dx%d",
+ x, y, w, h);
+
/* TODO: For sofware renderer general framebuffer properties can change on
* the fly. Find a callback that can catch that. For now, just copy FB
* properties over in every FB update. */
@@ -336,6 +347,7 @@ _mt_fb_update(void* opaque, int x, int y, int w, int h)
_mt_fb_common_update(mts_state, x, y, w, h);
}
+
void
multitouch_opengles_fb_update(void* context,
int w, int h, int ydir,
@@ -349,6 +361,8 @@ multitouch_opengles_fb_update(void* context,
return;
}
+ T("Multi-touch: openGLES framebuffer update: 0:0 -> %dx%d", w, h);
+
/* GLES format is always RGBA8888 */
mts_state->fb_header.bpp = 4;
mts_state->fb_header.bpl = 4 * w;
@@ -362,6 +376,44 @@ multitouch_opengles_fb_update(void* context,
}
void
+multitouch_refresh_screen(void)
+{
+ MTSState* const mts_state = &_MTSState;
+
+ /* Make sure MT port is initialized. */
+ if (!_is_mt_initialized) {
+ return;
+ }
+
+ /* Lets see if any updates have been received so far. */
+ if (NULL != mts_state->current_fb) {
+ _mt_fb_common_update(mts_state, 0, 0, mts_state->fb_header.disp_width,
+ mts_state->fb_header.disp_height);
+ }
+}
+
+void
+multitouch_fb_updated(void)
+{
+ MTSState* const mts_state = &_MTSState;
+
+ /* This concludes framebuffer update. */
+ mts_state->fb_transfer_in_progress = 0;
+
+ /* Lets see if we have accumulated more changes while transmission has been
+ * in progress. */
+ if (mts_state->fb_header.w && mts_state->fb_header.h) {
+ mts_state->fb_transfer_in_progress = 1;
+ /* Send accumulated updates. */
+ if (mts_port_send_frame(mts_state->mtsp, &mts_state->fb_header,
+ mts_state->current_fb, _on_fb_sent, mts_state,
+ mts_state->ydir)) {
+ mts_state->fb_transfer_in_progress = 0;
+ }
+ }
+}
+
+void
multitouch_init(AndroidMTSPort* mtsp)
{
if (!_is_mt_initialized) {
@@ -380,8 +432,6 @@ multitouch_init(AndroidMTSPort* mtsp)
for (index = 0; index < MTS_POINTERS_NUM; index++) {
mts_state->tracked_pointers[index].tracking_id = MTS_POINTER_UP;
}
- mts_state->device_width = android_hw->hw_lcd_width;
- mts_state->device_height = android_hw->hw_lcd_height;
mts_state->mtsp = mtsp;
mts_state->fb_header.header_size = sizeof(MTFrameHeader);
mts_state->fb_transfer_in_progress = 0;
@@ -453,12 +503,3 @@ multitouch_get_max_slot()
{
return MTS_POINTERS_NUM - 1;
}
-
-void
-multitouch_set_device_screen_size(int width, int height)
-{
- MTSState* const mts_state = &_MTSState;
-
- mts_state->device_width = width;
- mts_state->device_height = height;
-}
diff --git a/android/multitouch-screen.h b/android/multitouch-screen.h
index 433944d..baca224 100644
--- a/android/multitouch-screen.h
+++ b/android/multitouch-screen.h
@@ -17,6 +17,7 @@
#ifndef ANDROID_MULTITOUCH_SCREEN_H_
#define ANDROID_MULTITOUCH_SCREEN_H_
+#include "android/sdk-controller-socket.h"
#include "android/multitouch-port.h"
/*
@@ -61,9 +62,6 @@ extern void multitouch_update_pointer(MTESource source,
/* Gets maximum slot index available for the multi-touch emulation. */
extern int multitouch_get_max_slot();
-/* Saves screen size reported by the device that emulates multi-touch. */
-extern void multitouch_set_device_screen_size(int width, int height);
-
/* A callback set to monitor OpenGLES framebuffer updates.
* This callback is called by the renderer just before each new frame is
* displayed, providing a copy of the framebuffer contents.
@@ -97,4 +95,12 @@ extern void multitouch_opengles_fb_update(void* context,
int type,
unsigned char* pixels);
+/* Pushes the entire framebuffer to the device. This will force the device to
+ * refresh the entire screen.
+ */
+extern void multitouch_refresh_screen(void);
+
+/* Framebuffer update has been handled by the device. */
+extern void multitouch_fb_updated(void);
+
#endif /* ANDROID_MULTITOUCH_SCREEN_H_ */
diff --git a/android/opengles.c b/android/opengles.c
index f116f25..1fa6421 100644
--- a/android/opengles.c
+++ b/android/opengles.c
@@ -12,20 +12,28 @@
#include "config-host.h"
#include "android/opengles.h"
+#include <assert.h>
+
+/* Declared in "android/globals.h" */
+int android_gles_fast_pipes = 1;
+
+#if CONFIG_ANDROID_OPENGLES
+
#include "android/globals.h"
#include <android/utils/debug.h>
#include <android/utils/path.h>
#include <android/utils/bufprint.h>
#include <android/utils/dll.h>
+
+#define RENDER_API_NO_PROTOTYPES 1
+#include <libOpenglRender/render_api.h>
+
#include <stdio.h>
#include <stdlib.h>
#define D(...) VERBOSE_PRINT(init,__VA_ARGS__)
#define DD(...) VERBOSE_PRINT(gles,__VA_ARGS__)
-/* Declared in "android/globals.h" */
-int android_gles_fast_pipes = 1;
-
/* Name of the GLES rendering library we're going to use */
#if HOST_LONG_BITS == 32
#define RENDERER_LIB_NAME "libOpenglRender"
@@ -35,22 +43,16 @@ int android_gles_fast_pipes = 1;
#error Unknown HOST_LONG_BITS
#endif
-/* These definitions *must* match those under:
- * development/tools/emulator/opengl/host/include/libOpenglRender/render_api.h
- */
#define DYNLINK_FUNCTIONS \
- DYNLINK_FUNC(int,initLibrary,(void),(),return) \
- DYNLINK_FUNC(int,setStreamMode,(int a),(a),return) \
- DYNLINK_FUNC(int,initOpenGLRenderer,(int width, int height, int port, OnPostFn onPost, void* onPostContext),(width,height,port,onPost,onPostContext),return) \
- DYNLINK_FUNC(int,createOpenGLSubwindow,(void* window, int x, int y, int width, int height, float zRot),(window,x,y,width,height,zRot),return)\
- DYNLINK_FUNC(int,destroyOpenGLSubwindow,(void),(),return)\
- DYNLINK_FUNC(void,repaintOpenGLDisplay,(void),(),)\
- DYNLINK_FUNC(void,stopOpenGLRenderer,(void),(),)
-
-#define STREAM_MODE_DEFAULT 0
-#define STREAM_MODE_TCP 1
-#define STREAM_MODE_UNIX 2
-#define STREAM_MODE_PIPE 3
+ DYNLINK_FUNC(initLibrary) \
+ DYNLINK_FUNC(setStreamMode) \
+ DYNLINK_FUNC(initOpenGLRenderer) \
+ DYNLINK_FUNC(setPostCallback) \
+ DYNLINK_FUNC(getHardwareStrings) \
+ DYNLINK_FUNC(createOpenGLSubwindow) \
+ DYNLINK_FUNC(destroyOpenGLSubwindow) \
+ DYNLINK_FUNC(repaintOpenGLDisplay) \
+ DYNLINK_FUNC(stopOpenGLRenderer)
#ifndef CONFIG_STANDALONE_UI
/* Defined in android/hw-pipe-net.c */
@@ -58,16 +60,13 @@ extern int android_init_opengles_pipes(void);
#endif
static ADynamicLibrary* rendererLib;
+static int rendererStarted;
+static char rendererAddress[256];
-/* Define the pointers and the wrapper functions to call them */
-#define DYNLINK_FUNC(result,name,sig,params,ret) \
- static result (*_ptr_##name) sig; \
- static result name sig { \
- ret (*_ptr_##name) params ; \
- }
-
+/* Define the function pointers */
+#define DYNLINK_FUNC(name) \
+ static name##Fn name = NULL;
DYNLINK_FUNCTIONS
-
#undef DYNLINK_FUNC
static int
@@ -75,10 +74,11 @@ initOpenglesEmulationFuncs(ADynamicLibrary* rendererLib)
{
void* symbol;
char* error;
-#define DYNLINK_FUNC(result,name,sig,params,ret) \
- symbol = adynamicLibrary_findSymbol( rendererLib, #name, &error ); \
+
+#define DYNLINK_FUNC(name) \
+ symbol = adynamicLibrary_findSymbol(rendererLib, #name, &error); \
if (symbol != NULL) { \
- _ptr_##name = symbol; \
+ name = symbol; \
} else { \
derror("GLES emulation: Could not find required symbol (%s): %s", #name, error); \
free(error); \
@@ -86,6 +86,7 @@ initOpenglesEmulationFuncs(ADynamicLibrary* rendererLib)
}
DYNLINK_FUNCTIONS
#undef DYNLINK_FUNC
+
return 0;
}
@@ -126,10 +127,10 @@ android_initOpenglesEmulation(void)
/* XXX: NEED Win32 pipe implementation */
setStreamMode(STREAM_MODE_TCP);
#else
- setStreamMode(STREAM_MODE_UNIX);
+ setStreamMode(STREAM_MODE_UNIX);
#endif
} else {
- setStreamMode(STREAM_MODE_TCP);
+ setStreamMode(STREAM_MODE_TCP);
}
return 0;
@@ -141,33 +142,113 @@ BAD_EXIT:
}
int
-android_startOpenglesRenderer(int width, int height, OnPostFn onPost, void* onPostContext)
+android_startOpenglesRenderer(int width, int height)
{
if (!rendererLib) {
D("Can't start OpenGLES renderer without support libraries");
return -1;
}
- if (initOpenGLRenderer(width, height, ANDROID_OPENGLES_BASE_PORT, onPost, onPostContext) != 0) {
+ if (rendererStarted) {
+ return 0;
+ }
+
+ if (!initOpenGLRenderer(width, height, rendererAddress, sizeof(rendererAddress))) {
D("Can't start OpenGLES renderer?");
return -1;
}
+
+ rendererStarted = 1;
return 0;
}
void
-android_stopOpenglesRenderer(void)
+android_setPostCallback(OnPostFunc onPost, void* onPostContext)
{
if (rendererLib) {
+ setPostCallback(onPost, onPostContext);
+ }
+}
+
+static void strncpy_safe(char* dst, const char* src, size_t n)
+{
+ strncpy(dst, src, n);
+ dst[n-1] = '\0';
+}
+
+static void extractBaseString(char* dst, const char* src, size_t dstSize)
+{
+ const char* begin = strchr(src, '(');
+ const char* end = strrchr(src, ')');
+
+ if (!begin || !end) {
+ strncpy_safe(dst, src, dstSize);
+ return;
+ }
+ begin += 1;
+
+ // "foo (bar)"
+ // ^ ^
+ // b e
+ // = 5 8
+ // substring with NUL-terminator is end-begin+1 bytes
+ if (end - begin + 1 > dstSize) {
+ end = begin + dstSize - 1;
+ }
+
+ strncpy_safe(dst, begin, end - begin + 1);
+}
+
+void
+android_getOpenglesHardwareStrings(char* vendor, size_t vendorBufSize,
+ char* renderer, size_t rendererBufSize,
+ char* version, size_t versionBufSize)
+{
+ const char *vendorSrc, *rendererSrc, *versionSrc;
+
+ assert(vendorBufSize > 0 && rendererBufSize > 0 && versionBufSize > 0);
+ assert(vendor != NULL && renderer != NULL && version != NULL);
+
+ if (!rendererStarted) {
+ D("Can't get OpenGL ES hardware strings when renderer not started");
+ vendor[0] = renderer[0] = version[0] = '\0';
+ return;
+ }
+
+ getHardwareStrings(&vendorSrc, &rendererSrc, &versionSrc);
+ if (!vendorSrc) vendorSrc = "";
+ if (!rendererSrc) rendererSrc = "";
+ if (!versionSrc) versionSrc = "";
+
+ /* Special case for the default ES to GL translators: extract the strings
+ * of the underlying OpenGL implementation. */
+ if (strncmp(vendorSrc, "Google", 6) == 0 &&
+ strncmp(rendererSrc, "Android Emulator OpenGL ES Translator", 37) == 0) {
+ extractBaseString(vendor, vendorSrc, vendorBufSize);
+ extractBaseString(renderer, rendererSrc, rendererBufSize);
+ extractBaseString(version, versionSrc, versionBufSize);
+ } else {
+ strncpy_safe(vendor, vendorSrc, vendorBufSize);
+ strncpy_safe(renderer, rendererSrc, rendererBufSize);
+ strncpy_safe(version, versionSrc, versionBufSize);
+ }
+}
+
+void
+android_stopOpenglesRenderer(void)
+{
+ if (rendererStarted) {
stopOpenGLRenderer();
+ rendererStarted = 0;
}
}
int
android_showOpenglesWindow(void* window, int x, int y, int width, int height, float rotation)
{
- if (rendererLib) {
- return createOpenGLSubwindow(window, x, y, width, height, rotation);
+ if (rendererStarted) {
+ int success = createOpenGLSubwindow((FBNativeWindowType)window, x, y, width, height, rotation);
+ return success ? 0 : -1;
} else {
return -1;
}
@@ -176,8 +257,9 @@ android_showOpenglesWindow(void* window, int x, int y, int width, int height, fl
int
android_hideOpenglesWindow(void)
{
- if (rendererLib) {
- return destroyOpenGLSubwindow();
+ if (rendererStarted) {
+ int success = destroyOpenGLSubwindow();
+ return success ? 0 : -1;
} else {
return -1;
}
@@ -186,22 +268,62 @@ android_hideOpenglesWindow(void)
void
android_redrawOpenglesWindow(void)
{
- if (rendererLib) {
+ if (rendererStarted) {
repaintOpenGLDisplay();
}
}
void
-android_gles_unix_path(char* buff, size_t buffsize, int port)
+android_gles_server_path(char* buff, size_t buffsize)
{
- const char* user = getenv("USER");
- char *p = buff, *end = buff + buffsize;
+ strncpy_safe(buff, rendererAddress, buffsize);
+}
- /* The logic here must correspond to the one inside
- * development/tools/emulator/opengl/shared/libOpenglCodecCommon/UnixStream.cpp */
- p = bufprint(p, end, "/tmp/");
- if (user && user[0]) {
- p = bufprint(p, end, "android-%s/", user);
- }
- p = bufprint(p, end, "qemu-gles-%d", port);
+#else // CONFIG_ANDROID_OPENGLES
+
+int android_initOpenglesEmulation(void)
+{
+ return -1;
+}
+
+int android_startOpenglesRenderer(int width, int height)
+{
+ return -1;
+}
+
+void
+android_setPostCallback(OnPostFunc onPost, void* onPostContext)
+{
+}
+
+void android_getOpenglesHardwareStrings(char* vendor, size_t vendorBufSize,
+ char* renderer, size_t rendererBufSize,
+ char* version, size_t versionBufSize)
+{
+ assert(vendorBufSize > 0 && rendererBufSize > 0 && versionBufSize > 0);
+ assert(vendor != NULL && renderer != NULL && version != NULL);
+ vendor[0] = renderer[0] = version[0] = 0;
+}
+
+void android_stopOpenglesRenderer(void)
+{}
+
+int android_showOpenglesWindow(void* window, int x, int y, int width, int height, float rotation)
+{
+ return -1;
+}
+
+int android_hideOpenglesWindow(void)
+{
+ return -1;
}
+
+void android_redrawOpenglesWindow(void)
+{}
+
+void android_gles_server_path(char* buff, size_t buffsize)
+{
+ buff[0] = '\0';
+}
+
+#endif // !CONFIG_ANDROID_OPENGLES
diff --git a/android/opengles.h b/android/opengles.h
index 7bb6a3a..6330287 100644
--- a/android/opengles.h
+++ b/android/opengles.h
@@ -14,12 +14,6 @@
#include <stddef.h>
-#define ANDROID_OPENGLES_BASE_PORT 22468
-
-/* See the description in render_api.h. */
-typedef void (*OnPostFn)(void* context, int width, int height, int ydir,
- int format, int type, unsigned char* pixels);
-
/* Call this function to initialize the hardware opengles emulation.
* This function will abort if we can't find the corresponding host
* libraries through dlopen() or equivalent.
@@ -30,8 +24,24 @@ int android_initOpenglesEmulation(void);
* At the moment, this must be done before the VM starts. The onPost callback
* may be NULL.
*/
-int android_startOpenglesRenderer(int width, int height,
- OnPostFn onPost, void* onPostContext);
+int android_startOpenglesRenderer(int width, int height);
+
+/* See the description in render_api.h. */
+typedef void (*OnPostFunc)(void* context, int width, int height, int ydir,
+ int format, int type, unsigned char* pixels);
+void android_setPostCallback(OnPostFunc onPost, void* onPostContext);
+
+/* Retrieve the Vendor/Renderer/Version strings describing the underlying GL
+ * implementation. The call only works while the renderer is started.
+ *
+ * Each string is copied into the corresponding buffer. If the original string
+ * (including NUL terminator) is more than xxBufSize bytes, it will be
+ * truncated. In all cases, including failure, the buffer will be NUL-
+ * terminated when this function returns.
+ */
+void android_getOpenglesHardwareStrings(char* vendor, size_t vendorBufSize,
+ char* renderer, size_t rendererBufSize,
+ char* version, size_t versionBufSize);
int android_showOpenglesWindow(void* window, int x, int y, int width, int height, float rotation);
@@ -47,8 +57,10 @@ void android_stopOpenglesRenderer(void);
*/
extern int android_gles_fast_pipes;
-/* Write the path of the Unix socket we're going to use to access GLES on a given <port> */
-/* The result is only valid on Unix systems */
-void android_gles_unix_path(char* buff, size_t buffsize, int port);
+/* Get the address of the socket that clients should connect to to access GLES.
+ * For TCP this is just the port number (as a string) on the loopback address.
+ * For UNIX and Win32 pipes it is the full pathname of the pipe.
+ */
+void android_gles_server_path(char* buff, size_t buffsize);
#endif /* ANDROID_OPENGLES_H */
diff --git a/android/qemu-setup.c b/android/qemu-setup.c
index 181c95b..8b8f0b0 100644
--- a/android/qemu-setup.c
+++ b/android/qemu-setup.c
@@ -47,6 +47,11 @@ char* op_http_proxy = NULL;
/* Base port for the emulated system. */
int android_base_port;
+/* Strings describing the host system's OpenGL implementation */
+char android_gl_vendor[ANDROID_GLSTRING_BUF_SIZE];
+char android_gl_renderer[ANDROID_GLSTRING_BUF_SIZE];
+char android_gl_version[ANDROID_GLSTRING_BUF_SIZE];
+
/*** APPLICATION DIRECTORY
*** Where are we ?
***/
@@ -483,6 +488,14 @@ void android_emulation_setup( void )
char tmp[PATH_MAX];
const char* appdir = get_app_dir();
+ const size_t ARGSLEN =
+ PATH_MAX + // max ping program path
+ 10 + // max VERSION_STRING length
+ 3*ANDROID_GLSTRING_BUF_SIZE + // max GL string lengths
+ 29 + // static args characters
+ 1; // NUL terminator
+ char args[ARGSLEN];
+
if (snprintf( tmp, PATH_MAX, "%s%s%s", appdir, PATH_SEP,
_ANDROID_PING_PROGRAM ) >= PATH_MAX) {
dprint( "Application directory too long: %s", appdir);
@@ -507,10 +520,12 @@ void android_emulation_setup( void )
if (!comspec) comspec = "cmd.exe";
// Run
- char args[PATH_MAX + 30];
- if (snprintf( args, PATH_MAX, "/C \"%s\" ping emulator " VERSION_STRING,
- tmp) >= PATH_MAX ) {
- D( "DDMS path too long: %s", tmp);
+ if (snprintf(args, ARGSLEN,
+ "/C \"%s\" ping emulator " VERSION_STRING " \"%s\" \"%s\" \"%s\"",
+ tmp, android_gl_vendor, android_gl_renderer, android_gl_version)
+ >= ARGSLEN)
+ {
+ D( "DDMS command line too long: %s", args);
return;
}
@@ -540,13 +555,17 @@ void android_emulation_setup( void )
int fd = open("/dev/null", O_WRONLY);
dup2(fd, 1);
dup2(fd, 2);
- execl( tmp, _ANDROID_PING_PROGRAM, "ping", "emulator", VERSION_STRING, NULL );
+ execl( tmp, _ANDROID_PING_PROGRAM, "ping", "emulator", VERSION_STRING,
+ android_gl_vendor, android_gl_renderer, android_gl_version,
+ NULL );
}
END_NOSIGALRM
/* don't do anything in the parent or in case of error */
- strncat( tmp, " ping emulator " VERSION_STRING, PATH_MAX - strlen(tmp) );
- D( "ping command: %s", tmp );
+ snprintf(args, ARGSLEN,
+ "%s ping emulator " VERSION_STRING " \"%s\" \"%s\" \"%s\"",
+ tmp, android_gl_vendor, android_gl_renderer, android_gl_version);
+ D( "ping command: %s", args );
#endif
}
}
diff --git a/android/sdk-controller-socket.c b/android/sdk-controller-socket.c
index a300169..8b0d813 100644
--- a/android/sdk-controller-socket.c
+++ b/android/sdk-controller-socket.c
@@ -20,8 +20,6 @@
* a TCP port forwarding, enabled by ADB.
*/
-#include "qemu-common.h"
-#include "android/async-utils.h"
#include "android/utils/debug.h"
#include "android/async-socket-connector.h"
#include "android/async-socket.h"
@@ -34,7 +32,7 @@
#define D(...) VERBOSE_PRINT(sdkctlsocket,__VA_ARGS__)
#define D_ACTIVE VERBOSE_CHECK(sdkctlsocket)
-#define TRACE_ON 1
+#define TRACE_ON 0
#if TRACE_ON
#define T(...) VERBOSE_PRINT(sdkctlsocket,__VA_ARGS__)
@@ -53,12 +51,8 @@ struct SDKCtlRecycled {
};
};
-/********************************************************************************
- * SDKCtlPacket declarations
- *******************************************************************************/
-
/*
- * Types of the packets of data sent via SDK controller socket.
+ * Types of the data packets sent via SDK controller socket.
*/
/* The packet is a message. */
@@ -68,12 +62,56 @@ struct SDKCtlRecycled {
/* The packet is a response to a query. */
#define SDKCTL_PACKET_QUERY_RESPONSE 3
+/*
+ * Types of intenal port messages sent via SDK controller socket.
+ */
+
+/* Port is connected.
+ * This message is sent by SDK controller when the service connects a socket with
+ * a port that provides requested emulation functionality.
+ */
+#define SDKCTL_MSG_PORT_CONNECTED -1
+/* Port is disconnected.
+ * This message is sent by SDK controller when a port that provides requested
+ * emulation functionality disconnects from the socket.
+ */
+#define SDKCTL_MSG_PORT_DISCONNECTED -2
+/* Port is enabled.
+ * This message is sent by SDK controller when a port that provides requested
+ * emulation functionality is ready to do the emulation.
+ */
+#define SDKCTL_MSG_PORT_ENABLED -3
+/* Port is disabled.
+ * This message is sent by SDK controller when a port that provides requested
+ * emulation functionality is not ready to do the emulation.
+ */
+#define SDKCTL_MSG_PORT_DISABLED -4
+
+/*
+ * Types of internal queries sent via SDK controller socket.
+ */
+
+/* Handshake query.
+ * This query is sent to SDK controller service as part of the connection
+ * protocol implementation.
+ */
+#define SDKCTL_QUERY_HANDSHAKE -1
+
+/********************************************************************************
+ * SDKCtlPacket declarations
+ *******************************************************************************/
+
+/* Packet signature value ('SDKC'). */
+static const int _sdkctl_packet_sig = 0x53444B43;
+
/* Data packet descriptor.
*
* All packets, sent and received via SDK controller socket begin with this
* header, with packet data immediately following this header.
*/
typedef struct SDKCtlPacketHeader {
+ /* Signature. */
+ int signature;
/* Total size of the data to transfer with this packet, including this
* header. The transferring data should immediatelly follow this header. */
int size;
@@ -83,42 +121,60 @@ typedef struct SDKCtlPacketHeader {
} SDKCtlPacketHeader;
/* Packet descriptor, allocated by this API for data packets to be sent to SDK
- * controller service on the device.
+ * controller.
*
* When packet descriptors are allocated by this API, they are allocated large
* enough to contain this header, and packet data to send to the service,
* immediately following this descriptor.
*/
-struct SDKCtlPacket {
+typedef struct SDKCtlPacket {
/* Supports recycling. Don't put anything in front: recycler expects this
* to be the first field in recyclable descriptor. */
- SDKCtlRecycled recycling;
+ SDKCtlRecycled recycling;
- /* Next packet in the list of packets to send. */
- SDKCtlPacket* next;
/* SDK controller socket that transmits this packet. */
- SDKCtlSocket* sdkctl;
+ SDKCtlSocket* sdkctl;
/* Number of outstanding references to the packet. */
- int ref_count;
+ int ref_count;
/* Common packet header. Packet data immediately follows this header, so it
- * must be last field in SDKCtlPacket descriptor. */
- SDKCtlPacketHeader header;
-};
+ * must be the last field in SDKCtlPacket descriptor. */
+ SDKCtlPacketHeader header;
+} SDKCtlPacket;
/********************************************************************************
- * SDKCtlQuery declarations
+ * SDKCtlDirectPacket declarations
*******************************************************************************/
-/*
- * Types of queries sent via SDK controller socket.
+/* Direct packet descriptor, allocated by this API for direct data packets to be
+ * sent to SDK controller service on the device.
+ *
+ * Direct packet (unlike SDKCtlPacket) don't contain data buffer, but rather
+ * reference data allocated by the client. This is useful when client sends large
+ * amount of data (such as framebuffer updates sent my multi-touch port), and
+ * regular packet descriptors for such large transfer cannot be obtained from the
+ * recycler.
*/
+struct SDKCtlDirectPacket {
+ /* Supports recycling. Don't put anything in front: recycler expects this
+ * to be the first field in recyclable descriptor. */
+ SDKCtlRecycled recycling;
-/* Handshake query.
- * This query is sent to SDK controller service as part of the connection
- * protocol implementation.
- */
-#define SDKCTL_QUERY_HANDSHAKE -1
+ /* SDKCtlSocket that owns this packet. */
+ SDKCtlSocket* sdkctl;
+ /* Packet to send. */
+ SDKCtlPacketHeader* packet;
+ /* Callback to invoke on packet transmission events. */
+ on_sdkctl_direct_cb on_sent;
+ /* An opaque pointer to pass to on_sent callback. */
+ void* on_sent_opaque;
+ /* Number of outstanding references to the packet. */
+ int ref_count;
+};
+
+/********************************************************************************
+ * SDKCtlQuery declarations
+ *******************************************************************************/
/* Query packet descriptor.
*
@@ -131,8 +187,7 @@ typedef struct SDKCtlQueryHeader {
/* A unique query identifier. This ID is used to track the query in the
* asynchronous environment in whcih SDK controller socket operates. */
int query_id;
- /* Query type. See SDKCTL_QUERY_XXX for the list of query types used by SDK
- * controller. */
+ /* Query type. */
int query_type;
} SDKCtlQueryHeader;
@@ -148,12 +203,12 @@ struct SDKCtlQuery {
* to be the first field in recyclable descriptor. */
SDKCtlRecycled recycling;
- /* Next query in the list of active, or recycled queries. */
+ /* Next query in the list of active queries. */
SDKCtlQuery* next;
/* A timer to run time out on this query after it has been sent. */
LoopTimer timer[1];
/* Absolute time for this query's deadline. This is the value that query's
- * timer is set for after query has been transmitted to the service. */
+ * timer is set to after query has been transmitted to the service. */
Duration deadline;
/* SDK controller socket that owns the query. */
SDKCtlSocket* sdkctl;
@@ -163,20 +218,21 @@ struct SDKCtlQuery {
void* query_opaque;
/* Points to an address of a buffer where to save query response. */
void** response_buffer;
- /* Points to a variable containing size of the response buffer (on the way in),
- * or actual query response size (when query is completed). */
+ /* Points to a variable containing size of the response buffer (on the way
+ * in), or actual query response size (when query is completed). */
uint32_t* response_size;
/* Internal response buffer, allocated if query creator didn't provide its
* own. This field is valid only if response_buffer field is NULL, or is
* pointing to this field. */
void* internal_resp_buffer;
- /* Internal response buffer size This field is valid only if response_size
- * field is NULL, or is pointing to this field. */
+ /* Internal response buffer size used if query creator didn't provide its
+ * own. This field is valid only if response_size field is NULL, or is
+ * pointing to this field. */
uint32_t internal_resp_size;
/* Number of outstanding references to the query. */
int ref_count;
- /* Common packet header. Query data immediately follows this header, so it
+ /* Common query header. Query data immediately follows this header, so it
* must be last field in SDKCtlQuery descriptor. */
SDKCtlQueryHeader header;
};
@@ -195,6 +251,34 @@ typedef struct SDKCtlQueryReplyHeader {
} SDKCtlQueryReplyHeader;
/********************************************************************************
+ * SDKCtlMessage declarations
+ *******************************************************************************/
+
+/* Message packet descriptor.
+ *
+ * All messages, sent and received via SDK controller socket begin with this
+ * header, with message data immediately following this header.
+ */
+typedef struct SDKCtlMessageHeader {
+ /* Data packet header for this query. */
+ SDKCtlPacketHeader packet;
+ /* Message type. */
+ int msg_type;
+} SDKCtlMessageHeader;
+
+/* Message packet descriptor.
+ *
+ * All messages, sent and received via SDK controller socket begin with this
+ * header, with message data immediately following this header.
+ */
+struct SDKCtlMessage {
+ /* Data packet descriptor for this message. */
+ SDKCtlPacket packet;
+ /* Message type. */
+ int msg_type;
+};
+
+/********************************************************************************
* SDK Control Socket declarations
*******************************************************************************/
@@ -229,13 +313,15 @@ typedef struct SDKCtlIODispatcher {
/* Unites all types of headers used in SDK controller data exchange. */
union {
/* Common packet header. */
- SDKCtlPacketHeader header;
+ SDKCtlPacketHeader packet_header;
/* Header for a query packet. */
SDKCtlQueryHeader query_header;
+ /* Header for a message packet. */
+ SDKCtlMessageHeader message_header;
/* Header for a query response packet. */
SDKCtlQueryReplyHeader query_reply_header;
};
- /* Descriptor of a packet packet received from SDK controller. */
+ /* Descriptor of a packet that is being received from SDK controller. */
SDKCtlPacket* packet;
/* A query for which a reply is currently being received. */
SDKCtlQuery* current_query;
@@ -244,42 +330,43 @@ typedef struct SDKCtlIODispatcher {
/* SDK controller socket descriptor. */
struct SDKCtlSocket {
/* SDK controller socket state */
- SDKCtlSocketState state;
+ SDKCtlSocketState state;
+ /* SDK controller port status */
+ SdkCtlPortStatus port_status;
/* I/O dispatcher for the socket. */
- SDKCtlIODispatcher io_dispatcher;
+ SDKCtlIODispatcher io_dispatcher;
/* Asynchronous socket connected to SDK Controller on the device. */
- AsyncSocket* as;
+ AsyncSocket* as;
/* Client callback that monitors this socket connection. */
- on_sdkctl_connection_cb on_connection;
- /* A callback to invoke when handshake message is received from the
- * SDK controller. */
- on_sdkctl_handshake_cb on_handshake;
+ on_sdkctl_socket_connection_cb on_socket_connection;
+ /* Client callback that monitors SDK controller prt connection. */
+ on_sdkctl_port_connection_cb on_port_connection;
/* A callback to invoke when a message is received from the SDK controller. */
- on_sdkctl_message_cb on_message;
+ on_sdkctl_message_cb on_message;
/* An opaque pointer associated with this socket. */
- void* opaque;
- /* Name of an SDK controller service this socket is connected to. */
- char* service_name;
+ void* opaque;
+ /* Name of an SDK controller port this socket is connected to. */
+ char* service_name;
/* I/O looper for timers. */
- Looper* looper;
+ Looper* looper;
/* Head of the active query list. */
- SDKCtlQuery* query_head;
+ SDKCtlQuery* query_head;
/* Tail of the active query list. */
- SDKCtlQuery* query_tail;
+ SDKCtlQuery* query_tail;
/* Query ID generator that gets incremented for each new query. */
- int next_query_id;
+ int next_query_id;
/* Timeout before trying to reconnect after disconnection. */
- int reconnect_to;
+ int reconnect_to;
/* Number of outstanding references to this descriptor. */
- int ref_count;
+ int ref_count;
/* Head of the recycled memory */
- SDKCtlRecycled* recycler;
+ SDKCtlRecycled* recycler;
/* Recyclable block size. */
- uint32_t recycler_block_size;
+ uint32_t recycler_block_size;
/* Maximum number of blocks to recycle. */
- int recycler_max;
+ int recycler_max;
/* Number of blocs in the recycler. */
- int recycler_count;
+ int recycler_count;
};
/********************************************************************************
@@ -294,16 +381,18 @@ _sdkctl_socket_alloc_recycler(SDKCtlSocket* sdkctl, uint32_t size)
SDKCtlRecycled* block = NULL;
if (sdkctl->recycler != NULL && size <= sdkctl->recycler_block_size) {
+ assert(sdkctl->recycler_count > 0);
/* There are blocks in the recycler, and requested size fits. */
block = sdkctl->recycler;
sdkctl->recycler = block->next;
block->size = sdkctl->recycler_block_size;
sdkctl->recycler_count--;
} else if (size <= sdkctl->recycler_block_size) {
- /* There are no blocks in the recycler, but requested size fits. */
+ /* There are no blocks in the recycler, but requested size fits. Lets
+ * allocate block that we can later recycle. */
block = malloc(sdkctl->recycler_block_size);
if (block == NULL) {
- APANIC("SDKCtl %s: Unable to allocate %d bytes block",
+ APANIC("SDKCtl %s: Unable to allocate %d bytes block.",
sdkctl->service_name, sdkctl->recycler_block_size);
}
block->size = sdkctl->recycler_block_size;
@@ -324,18 +413,19 @@ _sdkctl_socket_alloc_recycler(SDKCtlSocket* sdkctl, uint32_t size)
static void
_sdkctl_socket_free_recycler(SDKCtlSocket* sdkctl, void* mem)
{
- SDKCtlRecycled* block = (SDKCtlRecycled*)mem;
+ SDKCtlRecycled* const block = (SDKCtlRecycled*)mem;
- if (sdkctl->recycler_count == sdkctl->recycler_max ||
- block->size != sdkctl->recycler_block_size) {
- /* Recycler is full, or block cannot be recycled. */
+ if (block->size != sdkctl->recycler_block_size ||
+ sdkctl->recycler_count == sdkctl->recycler_max) {
+ /* Recycler is full, or block cannot be recycled. Just free the memory. */
free(mem);
- return;
+ } else {
+ /* Add that block to the recycler. */
+ assert(sdkctl->recycler_count >= 0);
+ block->next = sdkctl->recycler;
+ sdkctl->recycler = block;
+ sdkctl->recycler_count++;
}
-
- block->next = sdkctl->recycler;
- sdkctl->recycler = block;
- sdkctl->recycler_count++;
}
/* Empties the recycler for a given SDKCtlSocket. */
@@ -344,7 +434,7 @@ _sdkctl_socket_empty_recycler(SDKCtlSocket* sdkctl)
{
SDKCtlRecycled* block = sdkctl->recycler;
while (block != NULL) {
- void* to_free = block;
+ void* const to_free = block;
block = block->next;
free(to_free);
}
@@ -366,6 +456,7 @@ _sdkctl_socket_add_query(SDKCtlQuery* query)
{
SDKCtlSocket* const sdkctl = query->sdkctl;
if (sdkctl->query_head == NULL) {
+ assert(sdkctl->query_tail == NULL);
sdkctl->query_head = sdkctl->query_tail = query;
} else {
sdkctl->query_tail->next = query;
@@ -378,7 +469,9 @@ _sdkctl_socket_add_query(SDKCtlQuery* query)
/* Removes a query from the list of active queries.
* Param:
- * query - Query to remove from the list of active queries.
+ * query - Query to remove from the list of active queries. If query has been
+ * removed from the list, it will be dereferenced to offset the reference
+ * that wad made when the query has been added to the list.
* Return:
* Boolean: 1 if query has been removed, or 0 if query has not been found in the
* list of active queries.
@@ -390,11 +483,11 @@ _sdkctl_socket_remove_query(SDKCtlQuery* query)
SDKCtlQuery* prev = NULL;
SDKCtlQuery* head = sdkctl->query_head;
- /* Quick check: the query could be currently handled by dispatcher. */
+ /* Quick check: the query could be currently handled by the dispatcher. */
if (sdkctl->io_dispatcher.current_query == query) {
/* Release the query from dispatcher. */
- sdkctl_query_release(query);
sdkctl->io_dispatcher.current_query = NULL;
+ sdkctl_query_release(query);
return 1;
}
@@ -403,32 +496,34 @@ _sdkctl_socket_remove_query(SDKCtlQuery* query)
prev = head;
head = head->next;
}
- if (head != NULL) {
- if (prev == NULL) {
- /* Query is at the head of the list. */
- assert(query == sdkctl->query_head);
- sdkctl->query_head = query->next;
- } else {
- /* Query is in the middle / at the end of the list. */
- assert(query != sdkctl->query_head);
- prev->next = query->next;
- }
- if (sdkctl->query_tail == query) {
- /* Query is at the tail of the list. */
- assert(query->next == NULL);
- sdkctl->query_tail = prev;
- }
- query->next = NULL;
+ if (head == NULL) {
+ D("SDKCtl %s: Query %p is not found in the list.",
+ sdkctl->service_name, query);
+ return 0;
+ }
- /* Release query that is now removed from the list. Note that query
- * passed to this routine should hold an extra reference, owned by the
- * caller. */
- sdkctl_query_release(query);
- return 1;
+ if (prev == NULL) {
+ /* Query is at the head of the list. */
+ assert(query == sdkctl->query_head);
+ sdkctl->query_head = query->next;
} else {
- D("%s: Query %p is not found in the list.", sdkctl->service_name, query);
- return 0;
+ /* Query is in the middle / at the end of the list. */
+ assert(query != sdkctl->query_head);
+ prev->next = query->next;
+ }
+ if (sdkctl->query_tail == query) {
+ /* Query is at the tail of the list. */
+ assert(query->next == NULL);
+ sdkctl->query_tail = prev;
}
+ query->next = NULL;
+
+ /* Release query that is now removed from the list. Note that query
+ * passed to this routine should hold an extra reference, owned by the
+ * caller. */
+ sdkctl_query_release(query);
+
+ return 1;
}
/* Removes a query (based on query ID) from the list of active queries.
@@ -437,11 +532,14 @@ _sdkctl_socket_remove_query(SDKCtlQuery* query)
* query_id - Identifies the query to remove.
* Return:
* A query removed from the list of active queries, or NULL if query with the
- * given ID has not been found in the list.
+ * given ID has not been found in the list. Note that query returned from this
+ * routine still holds the reference made when the query has been added to the
+ * list.
*/
static SDKCtlQuery*
_sdkctl_socket_remove_query_id(SDKCtlSocket* sdkctl, int query_id)
{
+ SDKCtlQuery* query = NULL;
SDKCtlQuery* prev = NULL;
SDKCtlQuery* head = sdkctl->query_head;
@@ -449,7 +547,7 @@ _sdkctl_socket_remove_query_id(SDKCtlSocket* sdkctl, int query_id)
if (sdkctl->io_dispatcher.current_query != NULL &&
sdkctl->io_dispatcher.current_query->header.query_id == query_id) {
/* Release the query from dispatcher. */
- SDKCtlQuery* const query = sdkctl->io_dispatcher.current_query;
+ query = sdkctl->io_dispatcher.current_query;
sdkctl->io_dispatcher.current_query = NULL;
return query;
}
@@ -459,37 +557,38 @@ _sdkctl_socket_remove_query_id(SDKCtlSocket* sdkctl, int query_id)
prev = head;
head = head->next;
}
- if (head != NULL) {
- /* Query is found in the list. */
- SDKCtlQuery* const query = head;
- if (prev == NULL) {
- /* Query is at the head of the list. */
- assert(query == sdkctl->query_head);
- sdkctl->query_head = query->next;
- } else {
- /* Query is in the middle, or at the end of the list. */
- assert(query != sdkctl->query_head);
- prev->next = query->next;
- }
- if (sdkctl->query_tail == query) {
- /* Query is at the tail of the list. */
- assert(query->next == NULL);
- sdkctl->query_tail = prev;
- }
- query->next = NULL;
- return query;
- } else {
- D("%s: Query ID %d is not found in the list.",
+ if (head == NULL) {
+ D("SDKCtl %s: Query ID %d is not found in the list.",
sdkctl->service_name, query_id);
return NULL;
}
+
+ /* Query is found in the list. */
+ query = head;
+ if (prev == NULL) {
+ /* Query is at the head of the list. */
+ assert(query == sdkctl->query_head);
+ sdkctl->query_head = query->next;
+ } else {
+ /* Query is in the middle, or at the end of the list. */
+ assert(query != sdkctl->query_head);
+ prev->next = query->next;
+ }
+ if (sdkctl->query_tail == query) {
+ /* Query is at the tail of the list. */
+ assert(query->next == NULL);
+ sdkctl->query_tail = prev;
+ }
+ query->next = NULL;
+
+ return query;
}
/* Pulls the first query from the list of active queries.
* Param:
* sdkctl - SDKCtlSocket instance that owns the query.
* Return:
- * A query removed pulled from the list of active queries, or NULL if query
+ * A query removed from the head of the list of active queries, or NULL if query
* list is empty.
*/
static SDKCtlQuery*
@@ -519,19 +618,24 @@ _sdkctl_socket_next_query_id(SDKCtlSocket* sdkctl)
/* Alocates a packet. */
static SDKCtlPacket*
-_sdkctl_packet_new(SDKCtlSocket* sdkctl, int size, int type)
+_sdkctl_packet_new(SDKCtlSocket* sdkctl, uint32_t size, int type)
{
- const uint32_t total_size = sizeof(SDKCtlPacket) + size;
- SDKCtlPacket* const packet = _sdkctl_socket_alloc_recycler(sdkctl, total_size);
+ /* Allocate packet descriptor large enough to contain packet data. */
+ SDKCtlPacket* const packet =
+ _sdkctl_socket_alloc_recycler(sdkctl, sizeof(SDKCtlPacket) + size);
- packet->sdkctl = sdkctl;
- packet->ref_count = 1;
- packet->header.size = size;
- packet->header.type = type;
+ packet->sdkctl = sdkctl;
+ packet->ref_count = 1;
+ packet->header.signature = _sdkctl_packet_sig;
+ packet->header.size = size;
+ packet->header.type = type;
/* Refence SDKCTlSocket that owns this packet. */
sdkctl_socket_reference(sdkctl);
+ T("SDKCtl %s: Packet %p of type %d is allocated for %d bytes transfer.",
+ sdkctl->service_name, packet, type, size);
+
return packet;
}
@@ -541,23 +645,27 @@ _sdkctl_packet_free(SDKCtlPacket* packet)
{
SDKCtlSocket* const sdkctl = packet->sdkctl;
- /* Free allocated resources. */
+ /* Recycle packet. */
_sdkctl_socket_free_recycler(packet->sdkctl, packet);
+ T("SDKCtl %s: Packet %p is freed.", sdkctl->service_name, packet);
+
/* Release SDKCTlSocket that owned this packet. */
sdkctl_socket_release(sdkctl);
}
+/* References a packet. */
int
-sdkctl_packet_reference(SDKCtlPacket* packet)
+_sdkctl_packet_reference(SDKCtlPacket* packet)
{
assert(packet->ref_count > 0);
packet->ref_count++;
return packet->ref_count;
}
+/* Releases a packet. */
int
-sdkctl_packet_release(SDKCtlPacket* packet)
+_sdkctl_packet_release(SDKCtlPacket* packet)
{
assert(packet->ref_count > 0);
packet->ref_count--;
@@ -569,6 +677,272 @@ sdkctl_packet_release(SDKCtlPacket* packet)
return packet->ref_count;
}
+/* An I/O callback invoked on packet transmission.
+ * Param:
+ * io_opaque SDKCtlPacket instance of the packet that's being sent with this I/O.
+ * asio - Write I/O descriptor.
+ * status - I/O status.
+ */
+static AsyncIOAction
+_on_sdkctl_packet_send_io(void* io_opaque,
+ AsyncSocketIO* asio,
+ AsyncIOState status)
+{
+ SDKCtlPacket* const packet = (SDKCtlPacket*)io_opaque;
+ AsyncIOAction action = ASIO_ACTION_DONE;
+
+ /* Reference the packet while we're in this callback. */
+ _sdkctl_packet_reference(packet);
+
+ /* Lets see what's going on with query transmission. */
+ switch (status) {
+ case ASIO_STATE_SUCCEEDED:
+ /* Packet has been sent to the service. */
+ T("SDKCtl %s: Packet %p transmission has succeeded.",
+ packet->sdkctl->service_name, packet);
+ break;
+
+ case ASIO_STATE_CANCELLED:
+ T("SDKCtl %s: Packet %p is cancelled.",
+ packet->sdkctl->service_name, packet);
+ break;
+
+ case ASIO_STATE_FAILED:
+ T("SDKCtl %s: Packet %p has failed: %d -> %s",
+ packet->sdkctl->service_name, packet, errno, strerror(errno));
+ break;
+
+ case ASIO_STATE_FINISHED:
+ /* Time to disassociate the packet with the I/O. */
+ _sdkctl_packet_release(packet);
+ break;
+
+ default:
+ /* Transitional state. */
+ break;
+ }
+
+ _sdkctl_packet_release(packet);
+
+ return action;
+}
+
+/* Transmits a packet to SDK Controller.
+ * Param:
+ * packet - Packet to transmit.
+ */
+static void
+_sdkctl_packet_transmit(SDKCtlPacket* packet)
+{
+ assert(packet->header.signature == _sdkctl_packet_sig);
+
+ /* Reference to associate with the I/O */
+ _sdkctl_packet_reference(packet);
+
+ /* Transmit the packet to SDK controller. */
+ async_socket_write_rel(packet->sdkctl->as, &packet->header, packet->header.size,
+ _on_sdkctl_packet_send_io, packet, -1);
+
+ T("SDKCtl %s: Packet %p size %d is being sent.",
+ packet->sdkctl->service_name, packet, packet->header.size);
+}
+
+/********************************************************************************
+ * SDKCtlDirectPacket implementation
+ ********************************************************************************/
+
+SDKCtlDirectPacket*
+sdkctl_direct_packet_new(SDKCtlSocket* sdkctl)
+{
+ SDKCtlDirectPacket* const packet =
+ _sdkctl_socket_alloc_recycler(sdkctl, sizeof(SDKCtlDirectPacket));
+
+ packet->sdkctl = sdkctl;
+ packet->ref_count = 1;
+
+ /* Refence SDKCTlSocket that owns this packet. */
+ sdkctl_socket_reference(packet->sdkctl);
+
+ T("SDKCtl %s: Direct packet %p is allocated.", sdkctl->service_name, packet);
+
+ return packet;
+}
+
+/* Frees a direct packet. */
+static void
+_sdkctl_direct_packet_free(SDKCtlDirectPacket* packet)
+{
+ SDKCtlSocket* const sdkctl = packet->sdkctl;
+
+ /* Free allocated resources. */
+ _sdkctl_socket_free_recycler(packet->sdkctl, packet);
+
+ T("SDKCtl %s: Direct packet %p is freed.", sdkctl->service_name, packet);
+
+ /* Release SDKCTlSocket that owned this packet. */
+ sdkctl_socket_release(sdkctl);
+}
+
+/* References a packet. */
+int
+sdkctl_direct_packet_reference(SDKCtlDirectPacket* packet)
+{
+ assert(packet->ref_count > 0);
+ packet->ref_count++;
+ return packet->ref_count;
+}
+
+/* Releases a packet. */
+int
+sdkctl_direct_packet_release(SDKCtlDirectPacket* packet)
+{
+ assert(packet->ref_count > 0);
+ packet->ref_count--;
+ if (packet->ref_count == 0) {
+ /* Last reference has been dropped. Destroy this object. */
+ _sdkctl_direct_packet_free(packet);
+ return 0;
+ }
+ return packet->ref_count;
+}
+
+/* An I/O callback invoked on direct packet transmission.
+ * Param:
+ * io_opaque SDKCtlDirectPacket instance of the packet that's being sent with
+ * this I/O.
+ * asio - Write I/O descriptor.
+ * status - I/O status.
+ */
+static AsyncIOAction
+_on_sdkctl_direct_packet_send_io(void* io_opaque,
+ AsyncSocketIO* asio,
+ AsyncIOState status)
+{
+ SDKCtlDirectPacket* const packet = (SDKCtlDirectPacket*)io_opaque;
+ AsyncIOAction action = ASIO_ACTION_DONE;
+
+ /* Reference the packet while we're in this callback. */
+ sdkctl_direct_packet_reference(packet);
+
+ /* Lets see what's going on with query transmission. */
+ switch (status) {
+ case ASIO_STATE_SUCCEEDED:
+ /* Packet has been sent to the service. */
+ T("SDKCtl %s: Direct packet %p transmission has succeeded.",
+ packet->sdkctl->service_name, packet);
+ packet->on_sent(packet->on_sent_opaque, packet, status);
+ break;
+
+ case ASIO_STATE_CANCELLED:
+ T("SDKCtl %s: Direct packet %p is cancelled.",
+ packet->sdkctl->service_name, packet);
+ packet->on_sent(packet->on_sent_opaque, packet, status);
+ break;
+
+ case ASIO_STATE_FAILED:
+ T("SDKCtl %s: Direct packet %p has failed: %d -> %s",
+ packet->sdkctl->service_name, packet, errno, strerror(errno));
+ packet->on_sent(packet->on_sent_opaque, packet, status);
+ break;
+
+ case ASIO_STATE_FINISHED:
+ /* Time to disassociate with the I/O. */
+ sdkctl_direct_packet_release(packet);
+ break;
+
+ default:
+ /* Transitional state. */
+ break;
+ }
+
+ sdkctl_direct_packet_release(packet);
+
+ return action;
+}
+
+void
+sdkctl_direct_packet_send(SDKCtlDirectPacket* packet,
+ void* data,
+ on_sdkctl_direct_cb cb,
+ void* cb_opaque)
+{
+ packet->packet = (SDKCtlPacketHeader*)data;
+ packet->on_sent = cb;
+ packet->on_sent_opaque = cb_opaque;
+ assert(packet->packet->signature == _sdkctl_packet_sig);
+
+ /* Reference for I/O */
+ sdkctl_direct_packet_reference(packet);
+
+ /* Transmit the packet to SDK controller. */
+ async_socket_write_rel(packet->sdkctl->as, packet->packet, packet->packet->size,
+ _on_sdkctl_direct_packet_send_io, packet, -1);
+
+ T("SDKCtl %s: Direct packet %p size %d is being sent",
+ packet->sdkctl->service_name, packet, packet->packet->size);
+}
+
+/********************************************************************************
+ * SDKCtlMessage implementation
+ *******************************************************************************/
+
+/* Alocates a message descriptor. */
+static SDKCtlMessage*
+_sdkctl_message_new(SDKCtlSocket* sdkctl, uint32_t msg_size, int msg_type)
+{
+ SDKCtlMessage* const msg =
+ (SDKCtlMessage*)_sdkctl_packet_new(sdkctl,
+ sizeof(SDKCtlMessageHeader) + msg_size,
+ SDKCTL_PACKET_MESSAGE);
+ msg->msg_type = msg_type;
+
+ return msg;
+}
+
+int
+sdkctl_message_reference(SDKCtlMessage* msg)
+{
+ return _sdkctl_packet_reference(&msg->packet);
+}
+
+int
+sdkctl_message_release(SDKCtlMessage* msg)
+{
+ return _sdkctl_packet_release(&msg->packet);
+}
+
+SDKCtlMessage*
+sdkctl_message_send(SDKCtlSocket* sdkctl,
+ int msg_type,
+ const void* data,
+ uint32_t size)
+{
+ SDKCtlMessage* const msg = _sdkctl_message_new(sdkctl, size, msg_type);
+ if (size != 0 && data != NULL) {
+ memcpy(msg + 1, data, size);
+ }
+ _sdkctl_packet_transmit(&msg->packet);
+
+ return msg;
+}
+
+int
+sdkctl_message_get_header_size(void)
+{
+ return sizeof(SDKCtlMessageHeader);
+}
+
+void
+sdkctl_init_message_header(void* msg, int msg_type, int msg_size)
+{
+ SDKCtlMessageHeader* const msg_header = (SDKCtlMessageHeader*)msg;
+
+ msg_header->packet.signature = _sdkctl_packet_sig;
+ msg_header->packet.size = sizeof(SDKCtlMessageHeader) + msg_size;
+ msg_header->packet.type = SDKCTL_PACKET_MESSAGE;
+ msg_header->msg_type = msg_type;
+}
+
/********************************************************************************
* SDKCtlQuery implementation
*******************************************************************************/
@@ -579,19 +953,21 @@ _sdkctl_query_free(SDKCtlQuery* query)
{
if (query != NULL) {
SDKCtlSocket* const sdkctl = query->sdkctl;
- T("SDKCtl %s: Query %p ID %d is freed.",
- sdkctl->service_name, query, query->header.query_id);
-
- /* Free allocated resources. */
if (query->internal_resp_buffer != NULL &&
(query->response_buffer == NULL ||
query->response_buffer == &query->internal_resp_buffer)) {
+ /* This query used its internal buffer to receive the response.
+ * Free it. */
free(query->internal_resp_buffer);
}
loopTimer_done(query->timer);
+
+ /* Recyle the descriptor. */
_sdkctl_socket_free_recycler(sdkctl, query);
+ T("SDKCtl %s: Query %p is freed.", sdkctl->service_name, query);
+
/* Release socket that owned this query. */
sdkctl_socket_release(sdkctl);
}
@@ -609,8 +985,8 @@ _sdkctl_query_cancel_timeout(SDKCtlQuery* query)
{
loopTimer_stop(query->timer);
- T("SDKCtl %s: Query %p ID %d deadline is cancelled.",
- query->sdkctl->service_name, query, query->header.query_id);
+ T("SDKCtl %s: Query %p ID %d deadline %lld is cancelled.",
+ query->sdkctl->service_name, query, query->header.query_id, query->deadline);
}
/*
@@ -639,7 +1015,7 @@ _on_sdkctl_query_cancelled(SDKCtlQuery* query)
* Query cancellation means that SDK controller is disconnected. In turn,
* this means that SDK controller socket will handle disconnection in its
* connection callback. So, at this point all we need to do here is to inform
- * the client, and then unlist the query.
+ * the client about query cancellation.
*/
/* Cancel deadline, and inform the client about query cancellation. */
@@ -676,12 +1052,11 @@ _on_skdctl_query_timeout(void* opaque)
sdkctl_query_release(query);
}
-/* A callback that is invoked when query has been sent to the SDK controller
- * service. */
+/* A callback that is invoked when query has been sent to the SDK controller. */
static void
_on_sdkctl_query_sent(SDKCtlQuery* query)
{
- T("SDKCtl %s: sent %d bytes of query %p ID %d of type %d",
+ T("SDKCtl %s: Sent %d bytes of query %p ID %d of type %d",
query->sdkctl->service_name, query->header.packet.size, query,
query->header.query_id, query->header.query_type);
@@ -710,31 +1085,25 @@ _on_sdkctl_query_send_io(void* io_opaque,
/* Reference the query while we're in this callback. */
sdkctl_query_reference(query);
- if (status == ASIO_STATE_SUCCEEDED) {
- /* Query has been sent to the service. */
- _on_sdkctl_query_sent(query);
-
- sdkctl_query_release(query);
-
- return ASIO_ACTION_DONE;
- }
-
/* Lets see what's going on with query transmission. */
switch (status) {
+ case ASIO_STATE_SUCCEEDED:
+ /* Query has been sent to the service. */
+ _on_sdkctl_query_sent(query);
+ break;
+
case ASIO_STATE_CANCELLED:
- T("SDKCtl %s: Query %p ID %d is cancelled in %s I/O.",
- query->sdkctl->service_name, query, query->header.query_id,
- async_socket_io_is_read(asio) ? "READ" : "WRITE");
+ T("SDKCtl %s: Query %p ID %d is cancelled in transmission.",
+ query->sdkctl->service_name, query, query->header.query_id);
/* Remove the query from the list of active queries. */
_sdkctl_socket_remove_query(query);
_on_sdkctl_query_cancelled(query);
break;
case ASIO_STATE_TIMED_OUT:
- D("SDKCtl %s: Query %p ID %d with deadline %lld has timed out in %s I/O at %lld",
+ D("SDKCtl %s: Query %p ID %d with deadline %lld has timed out in transmission at %lld",
query->sdkctl->service_name, query, query->header.query_id,
- query->deadline, async_socket_io_is_read(asio) ? "READ" : "WRITE",
- async_socket_deadline(query->sdkctl->as, 0));
+ query->deadline, async_socket_deadline(query->sdkctl->as, 0));
/* Invoke query's callback. */
action = query->query_cb(query->query_opaque, query, status);
/* For actions other than retry we need to stop the query. */
@@ -744,9 +1113,8 @@ _on_sdkctl_query_send_io(void* io_opaque,
break;
case ASIO_STATE_FAILED:
- T("SDKCtl %s: Query %p ID %d failed in %s I/O: %d -> %s",
+ T("SDKCtl %s: Query %p ID %d failed in transmission: %d -> %s",
query->sdkctl->service_name, query, query->header.query_id,
- async_socket_io_is_read(asio) ? "READ" : "WRITE",
errno, strerror(errno));
/* Invoke query's callback. Note that we will let the client to
* decide what to do on I/O failure. */
@@ -779,23 +1147,23 @@ _on_sdkctl_query_send_io(void* io_opaque,
SDKCtlQuery*
sdkctl_query_new(SDKCtlSocket* sdkctl, int query_type, uint32_t in_data_size)
{
- const uint32_t total_size = sizeof(SDKCtlQuery) + in_data_size;
-
- SDKCtlQuery* const query = _sdkctl_socket_alloc_recycler(sdkctl, total_size);
- query->next = NULL;
- query->sdkctl = sdkctl;
- query->response_buffer = NULL;
- query->response_size = NULL;
- query->internal_resp_buffer = NULL;
- query->internal_resp_size = 0;
- query->query_cb = NULL;
- query->query_opaque = NULL;
- query->deadline = DURATION_INFINITE;
- query->ref_count = 1;
- query->header.packet.size = sizeof(SDKCtlQueryHeader) + in_data_size;
- query->header.packet.type = SDKCTL_PACKET_QUERY;
- query->header.query_id = _sdkctl_socket_next_query_id(sdkctl);
- query->header.query_type = query_type;
+ SDKCtlQuery* const query =
+ _sdkctl_socket_alloc_recycler(sdkctl, sizeof(SDKCtlQuery) + in_data_size);
+ query->next = NULL;
+ query->sdkctl = sdkctl;
+ query->response_buffer = NULL;
+ query->response_size = NULL;
+ query->internal_resp_buffer = NULL;
+ query->internal_resp_size = 0;
+ query->query_cb = NULL;
+ query->query_opaque = NULL;
+ query->deadline = DURATION_INFINITE;
+ query->ref_count = 1;
+ query->header.packet.signature = _sdkctl_packet_sig;
+ query->header.packet.size = sizeof(SDKCtlQueryHeader) + in_data_size;
+ query->header.packet.type = SDKCTL_PACKET_QUERY;
+ query->header.query_id = _sdkctl_socket_next_query_id(sdkctl);
+ query->header.query_type = query_type;
/* Initialize timer to fire up on query deadline expiration. */
loopTimer_init(query->timer, sdkctl->looper, _on_skdctl_query_timeout, query);
@@ -822,21 +1190,19 @@ sdkctl_query_new_ex(SDKCtlSocket* sdkctl,
{
SDKCtlQuery* const query = sdkctl_query_new(sdkctl, query_type, in_data_size);
- query->response_buffer = response_buffer;
+ query->response_buffer = response_buffer;
if (query->response_buffer == NULL) {
/* Creator didn't supply a buffer. Use internal one instead. */
query->response_buffer = &query->internal_resp_buffer;
- query->internal_resp_buffer = NULL;
}
- query->response_size = response_size;
+ query->response_size = response_size;
if (query->response_size == NULL) {
/* Creator didn't supply a buffer for response size. Use internal one
* instead. */
query->response_size = &query->internal_resp_size;
- query->internal_resp_size = 0;
}
- query->query_cb = query_cb;
- query->query_opaque = query_opaque;
+ query->query_cb = query_cb;
+ query->query_opaque = query_opaque;
/* Init query's input buffer. */
if (in_data_size != 0 && in_data != NULL) {
memcpy(query + 1, in_data, in_data_size);
@@ -859,11 +1225,12 @@ sdkctl_query_send(SDKCtlQuery* query, int to)
/* Reference query associated with write I/O. */
sdkctl_query_reference(query);
+ assert(query->header.packet.signature == _sdkctl_packet_sig);
/* Transmit the query to SDK controller. */
async_socket_write_abs(sdkctl->as, &query->header, query->header.packet.size,
_on_sdkctl_query_send_io, query, query->deadline);
- T("SDKCtl %s: Query %p ID %d type %d is sent with deadline at %lld",
+ T("SDKCtl %s: Query %p ID %d type %d is being sent with deadline at %lld",
query->sdkctl->service_name, query, query->header.query_id,
query->header.query_type, query->deadline);
}
@@ -908,20 +1275,73 @@ sdkctl_query_release(SDKCtlQuery* query)
return query->ref_count;
}
+void*
+sdkctl_query_get_buffer_in(SDKCtlQuery* query)
+{
+ /* Query buffer starts right after the header. */
+ return query + 1;
+}
+
+void*
+sdkctl_query_get_buffer_out(SDKCtlQuery* query)
+{
+ return query->response_buffer != NULL ? *query->response_buffer :
+ query->internal_resp_buffer;
+}
+
/********************************************************************************
* SDKCtlPacket implementation
*******************************************************************************/
-/* A packet has been received from SDK controller. */
+/* A packet has been received from SDK controller.
+ * Note that we expect the packet to be a message, since queries, and query
+ * replies are handled separately. */
static void
_on_sdkctl_packet_received(SDKCtlSocket* sdkctl, SDKCtlPacket* packet)
{
T("SDKCtl %s: Received packet size: %d, type: %d",
sdkctl->service_name, packet->header.size, packet->header.type);
- /* Dispatch received packet to the client. */
- sdkctl->on_message(sdkctl->opaque, sdkctl, packet, packet->header.type,
- packet + 1, packet->header.size - sizeof(SDKCtlPacketHeader));
+ assert(packet->header.signature == _sdkctl_packet_sig);
+ if (packet->header.type == SDKCTL_PACKET_MESSAGE) {
+ SDKCtlMessage* const msg = (SDKCtlMessage*)packet;
+ /* Lets see if this is an internal protocol message. */
+ switch (msg->msg_type) {
+ case SDKCTL_MSG_PORT_CONNECTED:
+ sdkctl->port_status = SDKCTL_PORT_CONNECTED;
+ sdkctl->on_port_connection(sdkctl->opaque, sdkctl,
+ SDKCTL_PORT_CONNECTED);
+ break;
+
+ case SDKCTL_MSG_PORT_DISCONNECTED:
+ sdkctl->port_status = SDKCTL_PORT_DISCONNECTED;
+ sdkctl->on_port_connection(sdkctl->opaque, sdkctl,
+ SDKCTL_PORT_DISCONNECTED);
+ break;
+
+ case SDKCTL_MSG_PORT_ENABLED:
+ sdkctl->port_status = SDKCTL_PORT_ENABLED;
+ sdkctl->on_port_connection(sdkctl->opaque, sdkctl,
+ SDKCTL_PORT_ENABLED);
+ break;
+
+ case SDKCTL_MSG_PORT_DISABLED:
+ sdkctl->port_status = SDKCTL_PORT_DISABLED;
+ sdkctl->on_port_connection(sdkctl->opaque, sdkctl,
+ SDKCTL_PORT_DISABLED);
+ break;
+
+ default:
+ /* This is a higher-level message. Dispatch the message to the
+ * client. */
+ sdkctl->on_message(sdkctl->opaque, sdkctl, msg, msg->msg_type, msg + 1,
+ packet->header.size - sizeof(SDKCtlMessageHeader));
+ break;
+ }
+ } else {
+ E("SDKCtl %s: Received unknown packet type %d size %d",
+ sdkctl->service_name, packet->header.type, packet->header.size);
+ }
}
/********************************************************************************
@@ -949,7 +1369,7 @@ _sdkctl_io_dispatcher_start(SDKCtlSocket* sdkctl) {
dispatcher->current_query = NULL;
/* Register a packet header reader with the socket. */
- async_socket_read_rel(dispatcher->sdkctl->as, &dispatcher->header,
+ async_socket_read_rel(dispatcher->sdkctl->as, &dispatcher->packet_header,
sizeof(SDKCtlPacketHeader), _on_sdkctl_io_dispatcher_io,
dispatcher, -1);
}
@@ -969,12 +1389,14 @@ _sdkctl_io_dispatcher_reset(SDKCtlSocket* sdkctl) {
/* Free packet data buffer. */
if (dispatcher->packet != NULL) {
- sdkctl_packet_release(dispatcher->packet);
+ _sdkctl_packet_release(dispatcher->packet);
dispatcher->packet = NULL;
}
/* Reset dispatcher state. */
dispatcher->state = SDKCTL_IODISP_EXPECT_HEADER;
+
+ T("SDKCtl %s: I/O Dispatcher is reset", sdkctl->service_name);
}
/*
@@ -999,7 +1421,7 @@ _on_io_dispatcher_io_failure(SDKCtlIODispatcher* dispatcher,
/* Report disconnection to the client, and let it restore connection in this
* callback. */
- sdkctl->on_connection(sdkctl->opaque, sdkctl, ASIO_STATE_FAILED);
+ sdkctl->on_socket_connection(sdkctl->opaque, sdkctl, ASIO_STATE_FAILED);
}
/* A callback that is invoked when dispatcher's reader has been cancelled. */
@@ -1020,7 +1442,7 @@ _on_io_dispatcher_io_cancelled(SDKCtlIODispatcher* dispatcher,
/* Discard packet data we've received so far. */
if (dispatcher->packet != NULL) {
- sdkctl_packet_release(dispatcher->packet);
+ _sdkctl_packet_release(dispatcher->packet);
dispatcher->packet = NULL;
}
}
@@ -1033,8 +1455,20 @@ _on_io_dispatcher_packet_header(SDKCtlIODispatcher* dispatcher,
SDKCtlSocket* const sdkctl = dispatcher->sdkctl;
T("SDKCtl %s: Packet header type %d, size %d is received.",
- dispatcher->sdkctl->service_name, dispatcher->header.type,
- dispatcher->header.size);
+ dispatcher->sdkctl->service_name, dispatcher->packet_header.type,
+ dispatcher->packet_header.size);
+
+ /* Make sure we have a valid packet header. */
+ if (dispatcher->packet_header.signature != _sdkctl_packet_sig) {
+ E("SDKCtl %s: Invalid packet signature %x for packet type %d, size %d",
+ sdkctl->service_name, dispatcher->packet_header.signature,
+ dispatcher->packet_header.type, dispatcher->packet_header.size);
+ /* This is a protocol failure. Treat it as I/O failure: disconnect, and
+ * let the client to decide what to do next. */
+ errno = EINVAL;
+ _on_io_dispatcher_io_failure(dispatcher, asio);
+ return ASIO_ACTION_DONE;
+ }
/* Here we have three choices for the packet, that define the rest of
* the data that follow it:
@@ -1044,7 +1478,7 @@ _on_io_dispatcher_packet_header(SDKCtlIODispatcher* dispatcher,
* Update the state accordingly, and initiate reading of the
* remaining of the packet.
*/
- if (dispatcher->header.type == SDKCTL_PACKET_QUERY_RESPONSE) {
+ if (dispatcher->packet_header.type == SDKCTL_PACKET_QUERY_RESPONSE) {
/* This is a response to the query. Before receiving response data we
* need to locate the relevant query, and use its response buffer to read
* the data. For that we need to obtain query ID firts. So, initiate
@@ -1059,11 +1493,11 @@ _on_io_dispatcher_packet_header(SDKCtlIODispatcher* dispatcher,
* there. */
dispatcher->state = SDKCTL_IODISP_EXPECT_DATA;
dispatcher->packet =
- _sdkctl_packet_new(sdkctl, dispatcher->header.size,
- dispatcher->header.type);
+ _sdkctl_packet_new(sdkctl, dispatcher->packet_header.size,
+ dispatcher->packet_header.type);
/* Initiate reading of the packet data. */
async_socket_read_rel(sdkctl->as, dispatcher->packet + 1,
- dispatcher->header.size - sizeof(SDKCtlPacketHeader),
+ dispatcher->packet_header.size - sizeof(SDKCtlPacketHeader),
_on_sdkctl_io_dispatcher_io, dispatcher, -1);
}
@@ -1075,18 +1509,19 @@ static AsyncIOAction
_on_io_dispatcher_packet(SDKCtlIODispatcher* dispatcher, AsyncSocketIO* asio)
{
SDKCtlSocket* const sdkctl = dispatcher->sdkctl;
+ SDKCtlPacket* const packet = dispatcher->packet;
+ dispatcher->packet = NULL;
T("SDKCtl %s: Packet type %d, size %d is received.",
- dispatcher->sdkctl->service_name, dispatcher->header.type,
- dispatcher->header.size);
+ dispatcher->sdkctl->service_name, dispatcher->packet_header.type,
+ dispatcher->packet_header.size);
- _on_sdkctl_packet_received(sdkctl, dispatcher->packet);
- sdkctl_packet_release(dispatcher->packet);
- dispatcher->packet = NULL;
+ _on_sdkctl_packet_received(sdkctl, packet);
+ _sdkctl_packet_release(packet);
/* Get ready for the next I/O cycle. */
dispatcher->state = SDKCTL_IODISP_EXPECT_HEADER;
- async_socket_read_rel(sdkctl->as, &dispatcher->header, sizeof(SDKCtlPacketHeader),
+ async_socket_read_rel(sdkctl->as, &dispatcher->packet_header, sizeof(SDKCtlPacketHeader),
_on_sdkctl_io_dispatcher_io, dispatcher, -1);
return ASIO_ACTION_DONE;
}
@@ -1107,6 +1542,9 @@ _on_io_dispatcher_query_reply_header(SDKCtlIODispatcher* dispatcher,
dispatcher->current_query =
_sdkctl_socket_remove_query_id(sdkctl, dispatcher->query_reply_header.query_id);
query = dispatcher->current_query;
+ const uint32_t query_data_size =
+ dispatcher->packet_header.size - sizeof(SDKCtlQueryReplyHeader);
+ dispatcher->state = SDKCTL_IODISP_EXPECT_QUERY_REPLY_DATA;
if (query == NULL) {
D("%s: Query #%d is not found by dispatcher",
@@ -1116,13 +1554,12 @@ _on_io_dispatcher_query_reply_header(SDKCtlIODispatcher* dispatcher,
* and then discard when it's over. */
dispatcher->state = SDKCTL_IODISP_EXPECT_QUERY_REPLY_DATA;
dispatcher->packet =
- _sdkctl_packet_new(sdkctl, dispatcher->header.size,
- dispatcher->header.type);
+ _sdkctl_packet_new(sdkctl, dispatcher->packet_header.size,
+ dispatcher->packet_header.type);
/* Copy query reply info to the packet. */
memcpy(&dispatcher->packet->header, &dispatcher->query_reply_header,
sizeof(SDKCtlQueryReplyHeader));
- async_socket_read_rel(sdkctl->as, &dispatcher->query_header + 1,
- dispatcher->header.size - sizeof(SDKCtlQueryReplyHeader),
+ async_socket_read_rel(sdkctl->as, dispatcher->packet + 1, query_data_size,
_on_sdkctl_io_dispatcher_io, dispatcher, -1);
} else {
/* Prepare to receive query reply. For the simplicity sake, cancel query
@@ -1130,9 +1567,6 @@ _on_io_dispatcher_query_reply_header(SDKCtlIODispatcher* dispatcher,
* receiving query's reply. */
_sdkctl_query_cancel_timeout(query);
- /* Adjust the reply buffer set for the query (if needed). */
- const uint32_t query_data_size =
- dispatcher->header.size - sizeof(SDKCtlQueryReplyHeader);
if (*query->response_size < query_data_size) {
*query->response_buffer = malloc(query_data_size);
if (*query->response_buffer == NULL) {
@@ -1144,7 +1578,6 @@ _on_io_dispatcher_query_reply_header(SDKCtlIODispatcher* dispatcher,
*query->response_size = query_data_size;
/* Start reading query response. */
- dispatcher->state = SDKCTL_IODISP_EXPECT_QUERY_REPLY_DATA;
async_socket_read_rel(sdkctl->as, *query->response_buffer,
*query->response_size, _on_sdkctl_io_dispatcher_io,
dispatcher, -1);
@@ -1176,14 +1609,14 @@ _on_io_dispatcher_query_reply(SDKCtlIODispatcher* dispatcher, AsyncSocketIO* asi
/* This was "read up in the air" for a cancelled query. Just discard the
* read data. */
if (dispatcher->packet != NULL) {
- sdkctl_packet_release(dispatcher->packet);
+ _sdkctl_packet_release(dispatcher->packet);
dispatcher->packet = NULL;
}
}
/* Get ready for the next I/O cycle. */
dispatcher->state = SDKCTL_IODISP_EXPECT_HEADER;
- async_socket_read_rel(sdkctl->as, &dispatcher->header, sizeof(SDKCtlPacketHeader),
+ async_socket_read_rel(sdkctl->as, &dispatcher->packet_header, sizeof(SDKCtlPacketHeader),
_on_sdkctl_io_dispatcher_io, dispatcher, -1);
return ASIO_ACTION_DONE;
}
@@ -1351,6 +1784,7 @@ _sdkctl_socket_disconnect_socket(SDKCtlSocket* sdkctl)
}
sdkctl->state = SDKCTL_SOCKET_DISCONNECTED;
+ sdkctl->port_status = SDKCTL_PORT_DISCONNECTED;
}
/* Frees SDKCtlSocket instance. */
@@ -1358,6 +1792,8 @@ static void
_sdkctl_socket_free(SDKCtlSocket* sdkctl)
{
if (sdkctl != NULL) {
+ T("SDKCtl %s: descriptor is destroing.", sdkctl->service_name);
+
/* Disconnect, and release the socket. */
if (sdkctl->as != NULL) {
async_socket_disconnect(sdkctl->as);
@@ -1394,7 +1830,7 @@ _on_async_socket_connected(SDKCtlSocket* sdkctl)
/* Notify the client that connection is established. */
const AsyncIOAction action =
- sdkctl->on_connection(sdkctl->opaque, sdkctl, ASIO_STATE_SUCCEEDED);
+ sdkctl->on_socket_connection(sdkctl->opaque, sdkctl, ASIO_STATE_SUCCEEDED);
if (action == ASIO_ACTION_DONE) {
/* Initialize, and start main I/O dispatcher. */
@@ -1418,8 +1854,8 @@ _on_async_socket_disconnected(SDKCtlSocket* sdkctl)
_sdkctl_socket_disconnect_socket(sdkctl);
- AsyncIOAction action = sdkctl->on_connection(sdkctl->opaque, sdkctl,
- ASIO_STATE_FAILED);
+ AsyncIOAction action = sdkctl->on_socket_connection(sdkctl->opaque, sdkctl,
+ ASIO_STATE_FAILED);
if (action == ASIO_ACTION_DONE) {
/* Default action for disconnect is to reestablish the connection. */
action = ASIO_ACTION_RETRY;
@@ -1481,35 +1917,38 @@ _on_async_socket_connection(void* client_opaque,
SDKCtlSocket*
sdkctl_socket_new(int reconnect_to,
const char* service_name,
- on_sdkctl_connection_cb on_connection,
- on_sdkctl_handshake_cb on_handshake,
+ on_sdkctl_socket_connection_cb on_socket_connection,
+ on_sdkctl_port_connection_cb on_port_connection,
on_sdkctl_message_cb on_message,
void* opaque)
{
SDKCtlSocket* sdkctl;
ANEW0(sdkctl);
- sdkctl->state = SDKCTL_SOCKET_DISCONNECTED;
- sdkctl->opaque = opaque;
- sdkctl->service_name = ASTRDUP(service_name);
- sdkctl->on_connection = on_connection;
- sdkctl->on_handshake = on_handshake;
- sdkctl->on_message = on_message;
- sdkctl->reconnect_to = reconnect_to;
- sdkctl->as = NULL;
- sdkctl->next_query_id = 0;
- sdkctl->query_head = sdkctl->query_tail = NULL;
- sdkctl->ref_count = 1;
- sdkctl->recycler = NULL;
- sdkctl->recycler_block_size = 0;
- sdkctl->recycler_max = 0;
- sdkctl->recycler_count = 0;
+ sdkctl->state = SDKCTL_SOCKET_DISCONNECTED;
+ sdkctl->port_status = SDKCTL_PORT_DISCONNECTED;
+ sdkctl->opaque = opaque;
+ sdkctl->service_name = ASTRDUP(service_name);
+ sdkctl->on_socket_connection = on_socket_connection;
+ sdkctl->on_port_connection = on_port_connection;
+ sdkctl->on_message = on_message;
+ sdkctl->reconnect_to = reconnect_to;
+ sdkctl->as = NULL;
+ sdkctl->next_query_id = 0;
+ sdkctl->query_head = sdkctl->query_tail = NULL;
+ sdkctl->ref_count = 1;
+ sdkctl->recycler = NULL;
+ sdkctl->recycler_block_size = 0;
+ sdkctl->recycler_max = 0;
+ sdkctl->recycler_count = 0;
+
+ T("SDKCtl %s: descriptor is created.", sdkctl->service_name);
sdkctl->looper = looper_newCore();
if (sdkctl->looper == NULL) {
E("Unable to create I/O looper for SDKCtl socket '%s'",
service_name);
- on_connection(opaque, sdkctl, ASIO_STATE_FAILED);
+ on_socket_connection(opaque, sdkctl, ASIO_STATE_FAILED);
_sdkctl_socket_free(sdkctl);
return NULL;
}
@@ -1569,7 +2008,7 @@ sdkctl_socket_connect(SDKCtlSocket* sdkctl, int port, int retry_to)
if (sdkctl->as == NULL) {
E("Unable to allocate AsyncSocket for SDKCtl socket '%s'",
sdkctl->service_name);
- sdkctl->on_connection(sdkctl->opaque, sdkctl, ASIO_STATE_FAILED);
+ sdkctl->on_socket_connection(sdkctl->opaque, sdkctl, ASIO_STATE_FAILED);
} else {
async_socket_connect(sdkctl->as, retry_to);
}
@@ -1599,11 +2038,54 @@ sdkctl_socket_disconnect(SDKCtlSocket* sdkctl)
_sdkctl_socket_disconnect_socket(sdkctl);
}
+int
+sdkctl_socket_is_connected(SDKCtlSocket* sdkctl)
+{
+ return (sdkctl->state == SDKCTL_SOCKET_CONNECTED) ? 1 : 0;
+}
+
+int
+sdkctl_socket_is_port_ready(SDKCtlSocket* sdkctl)
+{
+ return (sdkctl->port_status == SDKCTL_PORT_ENABLED) ? 1 : 0;
+}
+
+SdkCtlPortStatus
+sdkctl_socket_get_port_status(SDKCtlSocket* sdkctl)
+{
+ return sdkctl->port_status;
+}
+
+int
+sdkctl_socket_is_handshake_ok(SDKCtlSocket* sdkctl)
+{
+ switch (sdkctl->port_status) {
+ case SDKCTL_HANDSHAKE_DUP:
+ case SDKCTL_HANDSHAKE_UNKNOWN_QUERY:
+ case SDKCTL_HANDSHAKE_UNKNOWN_RESPONSE:
+ return 0;
+ default:
+ return 1;
+ }
+}
/********************************************************************************
* Handshake query
*******************************************************************************/
+/*
+ * Handshake result values.
+ */
+
+/* Handshake has succeeded completed, and service-side port is connected. */
+#define SDKCTL_HANDSHAKE_RESP_CONNECTED 0
+/* Handshake has succeeded completed, but service-side port is not connected. */
+#define SDKCTL_HANDSHAKE_RESP_NOPORT 1
+/* Handshake has failed due to duplicate connection request. */
+#define SDKCTL_HANDSHAKE_RESP_DUP -1
+/* Handshake has failed due to unknown query. */
+#define SDKCTL_HANDSHAKE_RESP_QUERY_UNKNOWN -2
+
/* A callback that is ivoked on handshake I/O events. */
static AsyncIOAction
_on_handshake_io(void* query_opaque,
@@ -1613,12 +2095,41 @@ _on_handshake_io(void* query_opaque,
SDKCtlSocket* const sdkctl = (SDKCtlSocket*)query_opaque;
if (status == ASIO_STATE_SUCCEEDED) {
- D("SDKCtl %s: %d bytes of handshake reply is received.",
- sdkctl->service_name, *query->response_size);
+ const int* res = (const int*)(*query->response_buffer);
+ SdkCtlPortStatus handshake_status;
+ switch (*res) {
+ case SDKCTL_HANDSHAKE_RESP_CONNECTED:
+ D("SDKCtl %s: Handshake succeeded. Port is connected",
+ sdkctl->service_name);
+ handshake_status = SDKCTL_HANDSHAKE_CONNECTED;
+ break;
+
+ case SDKCTL_HANDSHAKE_RESP_NOPORT:
+ D("SDKCtl %s: Handshake succeeded. Port is not connected",
+ sdkctl->service_name);
+ handshake_status = SDKCTL_HANDSHAKE_NO_PORT;
+ break;
+
+ case SDKCTL_HANDSHAKE_RESP_DUP:
+ D("SDKCtl %s: Handshake failed: duplicate connection.",
+ sdkctl->service_name);
+ handshake_status = SDKCTL_HANDSHAKE_DUP;
+ break;
- /* Handshake is received. Inform the client. */
- sdkctl->on_handshake(sdkctl->opaque, sdkctl, *query->response_buffer,
- *query->response_size, status);
+ case SDKCTL_HANDSHAKE_RESP_QUERY_UNKNOWN:
+ D("SDKCtl %s: Handshake failed: unknown query.",
+ sdkctl->service_name);
+ handshake_status = SDKCTL_HANDSHAKE_UNKNOWN_QUERY;
+ break;
+
+ default:
+ E("SDKCtl %s: Unknown handshake response: %d",
+ sdkctl->service_name, *res);
+ handshake_status = SDKCTL_HANDSHAKE_UNKNOWN_RESPONSE;
+ break;
+ }
+ sdkctl->port_status = handshake_status;
+ sdkctl->on_port_connection(sdkctl->opaque, sdkctl, handshake_status);
} else {
/* Something is going on with the handshake... */
switch (status) {
@@ -1627,9 +2138,8 @@ _on_handshake_io(void* query_opaque,
case ASIO_STATE_CANCELLED:
D("SDKCtl %s: Handshake failed: I/O state %d. Error: %d -> %s",
sdkctl->service_name, status, errno, strerror(errno));
- sdkctl->on_handshake(sdkctl->opaque, sdkctl,
- *query->response_buffer,
- *query->response_size, status);
+ sdkctl->on_socket_connection(sdkctl->opaque, sdkctl,
+ ASIO_STATE_FAILED);
break;
default:
@@ -1663,7 +2173,7 @@ _on_sdkctl_endianness_io(void* io_opaque,
case ASIO_STATE_CANCELLED:
D("SDKCtl %s: endianness failed: I/O state %d. Error: %d -> %s",
sdkctl->service_name, status, errno, strerror(errno));
- sdkctl->on_handshake(sdkctl->opaque, sdkctl, NULL, 0, status);
+ sdkctl->on_socket_connection(sdkctl->opaque, sdkctl, ASIO_STATE_FAILED);
break;
default:
@@ -1682,7 +2192,7 @@ static const char _host_end = 0;
static const char _host_end = 1;
#endif
- D("SDKCtl %s: Sending endianness: %d...", sdkctl->service_name, _host_end);
+ D("SDKCtl %s: Sending endianness: %d", sdkctl->service_name, _host_end);
/* Before we can send any structured data to the SDK controller we need to
* report endianness of the host. */
diff --git a/android/sdk-controller-socket.h b/android/sdk-controller-socket.h
index 03b12f4..e58a4e2 100644
--- a/android/sdk-controller-socket.h
+++ b/android/sdk-controller-socket.h
@@ -18,6 +18,7 @@
#define ANDROID_SDKCONTROL_SOCKET_H_
#include "android/async-socket.h"
+#include "android/async-utils.h"
/*
* Contains declaration of an API that encapsulates communication protocol with
@@ -102,20 +103,29 @@
* interested in that particular descriptor.
*
* There are three types of data in the exchange protocol:
- * - A packet - the simplest type of data that doesn't require any replies.
+ * - A message - the simplest type of data that doesn't require any replies.
* - A query - A message that require a reply, and
* - A query reply - A message that delivers query reply.
*/
+/* Default TCP port to use for connection with SDK controller. */
+#define SDKCTL_DEFAULT_TCP_PORT 1970
+
/* Declares SDK controller socket descriptor. */
typedef struct SDKCtlSocket SDKCtlSocket;
-/* Declares SDK controller data packet descriptor. */
-typedef struct SDKCtlPacket SDKCtlPacket;
+/* Declares SDK controller message descriptor. */
+typedef struct SDKCtlMessage SDKCtlMessage;
/* Declares SDK controller query descriptor. */
typedef struct SDKCtlQuery SDKCtlQuery;
+/* Declares SDK controller direct packet descriptor.
+ * Direct packet (unlike message, or query packets) doesn't contain data buffer,
+ * but rather references message, or query data allocated by the client.
+ */
+typedef struct SDKCtlDirectPacket SDKCtlDirectPacket;
+
/* Defines client's callback set to monitor SDK controller socket connection.
*
* SDKCtlSocket will invoke this callback when connection to TCP port is
@@ -137,30 +147,52 @@ typedef struct SDKCtlQuery SDKCtlQuery;
* Return:
* One of the AsyncIOAction values.
*/
-typedef AsyncIOAction (*on_sdkctl_connection_cb)(void* client_opaque,
- SDKCtlSocket* sdkctl,
- AsyncIOState status);
+typedef AsyncIOAction (*on_sdkctl_socket_connection_cb)(void* client_opaque,
+ SDKCtlSocket* sdkctl,
+ AsyncIOState status);
+
+/* Enumerates port connection statuses passed to port connection callback.
+ */
+typedef enum SdkCtlPortStatus {
+ /* Service-side port has connected to the socket. */
+ SDKCTL_PORT_DISCONNECTED,
+ /* Service-side port has disconnected from the socket. */
+ SDKCTL_PORT_CONNECTED,
+ /* Service-side port has enabled emulation */
+ SDKCTL_PORT_ENABLED,
+ /* Service-side port has disabled emulation */
+ SDKCTL_PORT_DISABLED,
+ /* Handshake request has succeeded, and service-side port is connected. */
+ SDKCTL_HANDSHAKE_CONNECTED,
+ /* Handshake request has succeeded, but service-side port is not connected. */
+ SDKCTL_HANDSHAKE_NO_PORT,
+ /* Handshake request has failed due to port duplication. */
+ SDKCTL_HANDSHAKE_DUP,
+ /* Handshake request has failed on an unknown query. */
+ SDKCTL_HANDSHAKE_UNKNOWN_QUERY,
+ /* Handshake request has failed on an unknown response. */
+ SDKCTL_HANDSHAKE_UNKNOWN_RESPONSE,
+} SdkCtlPortStatus;
-/* Defines client's callback set to receive handshake reply from the SdkController
- * service running on the device.
+/* Defines client's callback set to receive port connection status.
*
- * Successful handshake means that connection between the client and SDK
- * controller service has been established.
+ * Port connection is different than socket connection, and indicates whether
+ * or not a service-side port that provides requested emulation functionality is
+ * hooked up with the connected socket. For instance, multi-touch port may be
+ * inactive at the time when socket is connected. So, there is a successful
+ * socket connection, but there is no service at the device end that provides
+ * multi-touch functionality. So, for multi-touch example, this callback will be
+ * invoked when multi-touch port at the device end becomes active, and hooks up
+ * with the socket that was connected before.
*
* Param:
* client_opaque - An opaque pointer associated with the client.
* sdkctl - Initialized SDKCtlSocket instance.
- * handshake - Handshake message received from the SDK controller service.
- * handshake_size - Size of the fandshake message received from the SDK
- * controller service.
- * status - Handshake status. Note that handshake, and handshake_size are valid
- * only if this parameter is set to ASIO_STATE_SUCCEEDED.
- */
-typedef void (*on_sdkctl_handshake_cb)(void* client_opaque,
- SDKCtlSocket* sdkctl,
- void* handshake,
- uint32_t handshake_size,
- AsyncIOState status);
+ * status - Port connection status.
+ */
+typedef void (*on_sdkctl_port_connection_cb)(void* client_opaque,
+ SDKCtlSocket* sdkctl,
+ SdkCtlPortStatus status);
/* Defines a message notification callback.
* Param:
@@ -176,7 +208,7 @@ typedef void (*on_sdkctl_handshake_cb)(void* client_opaque,
*/
typedef void (*on_sdkctl_message_cb)(void* client_opaque,
SDKCtlSocket* sdkctl,
- SDKCtlPacket* message,
+ SDKCtlMessage* message,
int msg_type,
void* msg_data,
int msg_size);
@@ -203,27 +235,114 @@ typedef AsyncIOAction (*on_sdkctl_query_cb)(void* query_opaque,
SDKCtlQuery* query,
AsyncIOState status);
+/* Defines direct packet completion callback.
+ * Param:
+ * opaque - An opaque pointer associated with the direct packet by the client.
+ * packet - Packet descriptor. Note that packet descriptor will be released
+ * upon exit from this callback (thus, could be freed). If the client is
+ * interested in working with that packet after the callback returns, it
+ * should reference the packet descriptor in this callback.
+ * status - Packet status. Can be one of these:
+ * - ASIO_STATE_SUCCEEDED : Packet has been successfully sent.
+ * - ASIO_STATE_FAILED : Packet has failed on an I/O.
+ * - ASIO_STATE_CANCELLED : Packet has been cancelled due to socket
+ * disconnection.
+ * Return:
+ * One of the AsyncIOAction values.
+ */
+typedef AsyncIOAction (*on_sdkctl_direct_cb)(void* opaque,
+ SDKCtlDirectPacket* packet,
+ AsyncIOState status);
+
/********************************************************************************
- * SDKCtlPacket API
+ * SDKCtlDirectPacket API
********************************************************************************/
-/* References SDKCtlPacket object.
+/* Creates new SDKCtlDirectPacket descriptor.
* Param:
- * packet - Initialized SDKCtlPacket instance.
+ * sdkctl - Initialized SDKCtlSocket instance to create a direct packet for.
+ * Return:
+ * Referenced SDKCtlDirectPacket instance.
+ */
+extern SDKCtlDirectPacket* sdkctl_direct_packet_new(SDKCtlSocket* sdkctl);
+
+/* References SDKCtlDirectPacket object.
+ * Param:
+ * packet - Initialized SDKCtlDirectPacket instance.
* Return:
* Number of outstanding references to the object.
*/
-extern int sdkctl_packet_reference(SDKCtlPacket* packet);
+extern int sdkctl_direct_packet_reference(SDKCtlDirectPacket* packet);
-/* Releases SDKCtlPacket object.
+/* Releases SDKCtlDirectPacket object.
* Note that upon exiting from this routine the object might be destroyed, even
* if this routine returns value other than zero.
* Param:
- * packet - Initialized SDKCtlPacket instance.
+ * packet - Initialized SDKCtlDirectPacket instance.
* Return:
* Number of outstanding references to the object.
*/
-extern int sdkctl_packet_release(SDKCtlPacket* packet);
+extern int sdkctl_direct_packet_release(SDKCtlDirectPacket* packet);
+
+/* Sends direct packet.
+ * Param:
+ * packet - Packet descriptor for the direct packet to send.
+ * data - Data to send with the packet. Must be fully initialized message, or
+ * query header.
+ * cb, cb_opaque - Callback to invoke on packet transmission events.
+ */
+extern void sdkctl_direct_packet_send(SDKCtlDirectPacket* packet,
+ void* data,
+ on_sdkctl_direct_cb cb,
+ void* cb_opaque);
+
+/********************************************************************************
+ * SDKCtlMessage API
+ ********************************************************************************/
+
+/* References SDKCtlMessage object.
+ * Param:
+ * msg - Initialized SDKCtlMessage instance.
+ * Return:
+ * Number of outstanding references to the object.
+ */
+extern int sdkctl_message_reference(SDKCtlMessage* msg);
+
+/* Releases SDKCtlMessage object.
+ * Note that upon exiting from this routine the object might be destroyed, even
+ * if this routine returns value other than zero.
+ * Param:
+ * msg - Initialized SDKCtlMessage instance.
+ * Return:
+ * Number of outstanding references to the object.
+ */
+extern int sdkctl_message_release(SDKCtlMessage* msg);
+
+/* Builds and sends a message to the device.
+ * Param:
+ * sdkctl - SDKCtlSocket instance for the message.
+ * msg_type - Defines message type.
+ * data - Message data. Can be NULL if there is no data associated with the
+ * message.
+ * size - Byte size of the data buffer.
+ * Return:
+ * Referenced SDKCtlQuery descriptor.
+ */
+extern SDKCtlMessage* sdkctl_message_send(SDKCtlSocket* sdkctl,
+ int msg_type,
+ const void* data,
+ uint32_t size);
+
+/* Gets message header size */
+extern int sdkctl_message_get_header_size(void);
+
+/* Initializes message header.
+ * Param:
+ * msg - Beginning of the message packet.
+ * msg_type - Message type.
+ * msg_size - Message data size.
+ */
+extern void sdkctl_init_message_header(void* msg, int msg_type, int msg_size);
/********************************************************************************
* SDKCtlQuery API
@@ -349,6 +468,14 @@ extern int sdkctl_query_release(SDKCtlQuery* query);
*/
extern void* sdkctl_query_get_buffer_in(SDKCtlQuery* query);
+/* Gets address of query's output data buffer (response data).
+ * Param:
+ * query - Query to get data buffer for.
+ * Return:
+ * Address of query's output data buffer.
+ */
+extern void* sdkctl_query_get_buffer_out(SDKCtlQuery* query);
+
/********************************************************************************
* SDKCtlSocket API
********************************************************************************/
@@ -359,8 +486,8 @@ extern void* sdkctl_query_get_buffer_in(SDKCtlQuery* query);
* attempts after disconnection, or on connection failures.
* service_name - Name of the SdkController service for this socket (such as
* 'sensors', 'milti-touch', etc.)
- * on_connection - A callback to invoke on socket connection events.
- * on_handshake - A callback to invoke on handshake events.
+ * on_socket_connection - A callback to invoke on socket connection events.
+ * on_port_connection - A callback to invoke on port connection events.
* on_message - A callback to invoke when a message is received from the SDK
* controller.
* opaque - An opaque pointer to associate with the socket.
@@ -369,8 +496,8 @@ extern void* sdkctl_query_get_buffer_in(SDKCtlQuery* query);
*/
extern SDKCtlSocket* sdkctl_socket_new(int reconnect_to,
const char* service_name,
- on_sdkctl_connection_cb on_connection,
- on_sdkctl_handshake_cb on_handshake,
+ on_sdkctl_socket_connection_cb on_socket_connection,
+ on_sdkctl_port_connection_cb on_port_connection,
on_sdkctl_message_cb on_message,
void* opaque);
@@ -437,4 +564,36 @@ extern void sdkctl_socket_reconnect(SDKCtlSocket* sdkctl, int port, int retry_to
*/
extern void sdkctl_socket_disconnect(SDKCtlSocket* sdkctl);
+/* Checks if SDK controller socket is connected.
+ * Param:
+ * sdkctl - Initialized SDKCtlSocket instance.
+ * Return:
+ * Boolean: 1 if socket is connected, 0 if socket is not connected.
+ */
+extern int sdkctl_socket_is_connected(SDKCtlSocket* sdkctl);
+
+/* Checks if SDK controller port is ready for emulation.
+ * Param:
+ * sdkctl - Initialized SDKCtlSocket instance.
+ * Return:
+ * Boolean: 1 if port is ready, 0 if port is not ready.
+ */
+extern int sdkctl_socket_is_port_ready(SDKCtlSocket* sdkctl);
+
+/* Gets status of the SDK controller port for this socket.
+ * Param:
+ * sdkctl - Initialized SDKCtlSocket instance.
+ * Return:
+ * Status of the SDK controller port for this socket.
+ */
+extern SdkCtlPortStatus sdkctl_socket_get_port_status(SDKCtlSocket* sdkctl);
+
+/* Checks if handshake was successful.
+ * Param:
+ * sdkctl - Initialized SDKCtlSocket instance.
+ * Return:
+ * Boolean: 1 if handshake was successful, 0 if handshake was not successful.
+ */
+extern int sdkctl_socket_is_handshake_ok(SDKCtlSocket* sdkctl);
+
#endif /* ANDROID_SDKCONTROL_SOCKET_H_ */
diff --git a/android/sensors-port.c b/android/sensors-port.c
index 8620783..6831fe3 100644
--- a/android/sensors-port.c
+++ b/android/sensors-port.c
@@ -14,370 +14,474 @@
* limitations under the License.
*/
+#include "android/sdk-controller-socket.h"
#include "android/sensors-port.h"
#include "android/hw-sensors.h"
+#include "android/utils/debug.h"
#define E(...) derror(__VA_ARGS__)
#define W(...) dwarning(__VA_ARGS__)
#define D(...) VERBOSE_PRINT(sensors_port,__VA_ARGS__)
#define D_ACTIVE VERBOSE_CHECK(sensors_port)
-/* Maximum number of sensors supported. */
-#define ASP_MAX_SENSOR 12
+#define TRACE_ON 1
+
+#if TRACE_ON
+#define T(...) VERBOSE_PRINT(sensors_port,__VA_ARGS__)
+#else
+#define T(...)
+#endif
+
+/* Timeout (millisec) to use when communicating with SDK controller. */
+#define SDKCTL_SENSORS_TIMEOUT 3000
-/* Maximum length of a sensor message. */
-#define ASP_MAX_SENSOR_MSG 1024
+/*
+ * Queries sent to sensors port of the SDK controller.
+ */
-/* Maximum length of a sensor event. */
-#define ASP_MAX_SENSOR_EVENT 256
+/* Queries the port for list of available sensors. */
+#define SDKCTL_SENSORS_QUERY_LIST 1
-/* Query timeout in milliseconds. */
-#define ASP_QUERY_TIMEOUT 3000
+/*
+ * Messages sent between the emuator, and sensors port of the SDK controller.
+ */
+
+/* Starts sensor emulation. */
+#define SDKCTL_SENSORS_START 1
+/* Stops sensor emulation. */
+#define SENSOR_SENSORS_STOP 2
+/* Enables emulation for a sensor. */
+#define SDKCTL_SENSORS_ENABLE 3
+/* Disables emulation for a sensor. */
+#define SDKCTL_SENSORS_DISABLE 4
+/* This message delivers sensor values. */
+#define SDKCTL_SENSORS_SENSOR_EVENT 5
+
+
+/* Describes a sensor on the device.
+ * When SDK controller sensors port replies to a "list" query, it replies with
+ * a flat buffer containing entries of this type following each other. End of
+ * each entry is a zero-terminator for its 'sensor_name' field. The end of the
+ * entire list is marked with an entry, containing -1 at its 'sensor_id' field.
+ */
+typedef struct SensorEntry {
+ /* Identifies sensor on the device. Value -1 indicates list terminator,
+ * rather than a valid sensor descriptor. */
+ int sensor_id;
+ /* Beginning of zero-terminated sensor name. */
+ char sensor_name[1];
+} SensorEntry;
+
+/* Describes a sensor in the array of emulated sensors. */
+typedef struct SensorDescriptor {
+ /* Identifies sensor on the device. */
+ int sensor_id;
+ /* Identifies sensor in emulator. */
+ int emulator_id;
+ /* Sensor name. */
+ char* sensor_name;
+} SensorDescriptor;
+
+/* Sensor event message descriptor.
+ * Entries of this type are sent along with SDKCTL_SENSORS_SENSOR_EVENT message
+ */
+typedef struct SensorEvent {
+ /* Identifies a device sensor for which values have been delivered. */
+ int sensor_id;
+ /* Sensor values. */
+ float fvalues[3];
+} SensorEvent;
/* Sensors port descriptor. */
struct AndroidSensorsPort {
/* Caller identifier. */
- void* opaque;
- /* Connected android device. */
- AndroidDevice* device;
- /* String containing list of all available sensors. */
- char sensors[ASP_MAX_SENSOR * 64];
- /* Array of available sensor names. Note that each string in this array
- * points inside the 'sensors' buffer. */
- const char* sensor_list[ASP_MAX_SENSOR];
- /* Number of available sensors. */
- int sensors_num;
- /* Connection status: 1 connected, 0 - disconnected. */
- int is_connected;
- /* Buffer where to receive sensor messages. */
- char sensor_msg[ASP_MAX_SENSOR_MSG];
- /* Buffer where to receive sensor events. */
- char events[ASP_MAX_SENSOR_EVENT];
+ void* opaque;
+ /* Communication socket. */
+ SDKCtlSocket* sdkctl;
+ /* Lists sensors available for emulation. */
+ SensorDescriptor** sensors;
+ /* Number of sensors in 'sensors' list. */
+ int sensors_count;
};
+/********************************************************************************
+ * Sensors port internals
+ *******************************************************************************/
+
+/* Checks if sensor descriptor is the terminator.
+ * Return:
+ * Boolean, 1 if it is a terminator, 0 if it is not.
+ */
+static int
+_sensor_entry_is_terminator(const SensorEntry* entry)
+{
+ return entry == NULL || entry->sensor_id == -1;
+}
+
+/* Gets next sensor descriptor.
+ * Return:
+ * Next sensor desciptor, or NULL if there are no more descriptors in the list.
+ */
+static const SensorEntry*
+_sensor_entry_next(const SensorEntry* entry)
+{
+ if (!_sensor_entry_is_terminator(entry)) {
+ /* Next descriptor begins right after zero-terminator for the sensor_name
+ * field of this descriptor. */
+ entry = (const SensorEntry*)(entry->sensor_name + strlen(entry->sensor_name) + 1);
+ if (!_sensor_entry_is_terminator(entry)) {
+ return entry;
+ }
+ }
+ return NULL;
+}
+
+/* Gets number of entries in the list. */
+static int
+_sensor_entry_list_size(const SensorEntry* entry) {
+ int ret = 0;
+ while (!_sensor_entry_is_terminator(entry)) {
+ ret++;
+ entry = _sensor_entry_next(entry);
+ }
+ return ret;
+}
+
+/* Discards sensors saved in AndroidSensorsPort's array. */
+static void
+_sensors_port_discard_sensors(AndroidSensorsPort* asp)
+{
+ if (asp->sensors != NULL) {
+ int n;
+ for (n = 0; n < asp->sensors_count; n++) {
+ if (asp->sensors[n] != NULL) {
+ free(asp->sensors[n]->sensor_name);
+ AFREE(asp->sensors[n]);
+ }
+ }
+ free(asp->sensors);
+ asp->sensors = NULL;
+ }
+ asp->sensors_count = 0;
+}
+
+
/* Destroys and frees the descriptor. */
static void
_sensors_port_free(AndroidSensorsPort* asp)
{
if (asp != NULL) {
- if (asp->device != NULL) {
- android_device_destroy(asp->device);
+ _sensors_port_discard_sensors(asp);
+ if (asp->sdkctl != NULL) {
+ sdkctl_socket_release(asp->sdkctl);
}
AFREE(asp);
}
}
-/********************************************************************************
- * Sensors port callbacks
- *******************************************************************************/
+/* Parses flat sensor list, and saves its entries into 'sensors' array filed of
+ * the AndroidSensorsPort descriptor. */
+static void
+_sensors_port_save_sensors(AndroidSensorsPort* asp, const SensorEntry* list)
+{
+ const int count = _sensor_entry_list_size(list);
+ if (count != 0) {
+ int n;
+ /* Allocate array for sensor descriptors. */
+ asp->sensors = malloc(sizeof(SensorDescriptor*) * count);
+
+ /* Iterate through the flat sensor list, filling up array of emulated
+ * sensors. */
+ const SensorEntry* entry = _sensor_entry_is_terminator(list) ? NULL : list;
+ for (n = 0; n < count && entry != NULL; n++) {
+ /* Get emulator-side ID for the sensor. < 0 value indicates that
+ * sensor is not supported by the emulator. */
+ const int emulator_id =
+ android_sensors_get_id_from_name((char*)entry->sensor_name);
+ if (emulator_id >= 0) {
+ SensorDescriptor* desc;
+ ANEW0(desc);
+ desc->emulator_id = emulator_id;
+ desc->sensor_id = entry->sensor_id;
+ desc->sensor_name = ASTRDUP(entry->sensor_name);
+
+ asp->sensors[asp->sensors_count++] = desc;
+ D("Sensors: Emulated sensor '%s': Device id = %d, Emulator id = %d",
+ desc->sensor_name, desc->sensor_id, desc->emulator_id);
+ } else {
+ D("Sensors: Sensor '%s' is not support by emulator",
+ entry->sensor_name);
+ }
+ entry = _sensor_entry_next(entry);
+ }
+ D("Sensors: Emulating %d sensors", asp->sensors_count);
+ }
+}
-/* A callback that invoked on sensor events.
+/* Finds sensor descriptor for an SDK controller-side ID. */
+static const SensorDescriptor*
+_sensor_from_sdkctl_id(AndroidSensorsPort* asp, int id)
+{
+ int n;
+ for (n = 0; n < asp->sensors_count; n++) {
+ if (asp->sensors[n]->sensor_id == id) {
+ return asp->sensors[n];
+ }
+ }
+ return NULL;
+}
+
+/* Initiates sensor emulation.
* Param:
- * opaque - AndroidSensorsPort instance.
- * ad - Android device used by this sensors port.
- * msg, msgsize - Sensor event message
- * failure - Message receiving status.
+ * asp - Android sensors port instance returned from sensors_port_create.
+ * Return:
+ * Zero on success, failure otherwise.
*/
static void
-_on_sensor_received(void* opaque, AndroidDevice* ad, char* msg, int msgsize)
+_sensors_port_start(AndroidSensorsPort* asp)
{
- float fvalues[3] = {0, 0, 0};
- char sensor[ASP_MAX_SENSOR_MSG];
- char* value;
- int id;
- AndroidSensorsPort* asp = (AndroidSensorsPort*)opaque;
-
- if (errno) {
- D("Sensors notification has failed on sensors port: %s", strerror(errno));
- return;
- }
+ int n;
- /* Parse notification, separating sensor name from parameters. */
- memcpy(sensor, msg, msgsize);
- value = strchr(sensor, ':');
- if (value == NULL) {
- W("Bad format for sensor notification: %s", msg);
+ if (!sdkctl_socket_is_port_ready(asp->sdkctl)) {
+ /* SDK controller side is not ready for emulation. Retreat... */
+ D("Sensors: SDK controller side is not ready for emulation.");
return;
}
- sensor[value-sensor] = '\0';
- value++;
-
- id = android_sensors_get_id_from_name(sensor);
- if (id >= 0) {
- /* Parse the value part to get the sensor values(a, b, c) */
- int i;
- char* pnext;
- char* pend = value + strlen(value);
- for (i = 0; i < 3; i++, value = pnext + 1) {
- pnext=strchr( value, ':' );
- if (pnext) {
- *pnext = 0;
- } else {
- pnext = pend;
- }
- if (pnext > value) {
- if (1 != sscanf( value,"%g", &fvalues[i] )) {
- W("Bad parameters in sensor notification %s", msg);
- return;
- }
- }
+ /* Disable all sensors, and reenable only those that are emulated by
+ * hardware. */
+ sensors_port_disable_sensor(asp, "all");
+
+ /* Walk throuh the list of enabled sensors enabling them on the device. */
+ for (n = 0; n < asp->sensors_count; n++) {
+ if (android_sensors_get_sensor_status(asp->sensors[n]->emulator_id) == 1) {
+ /* Reenable emulation for this sensor. */
+ sensors_port_enable_sensor(asp, asp->sensors[n]->sensor_name);
+ D("Sensors: Sensor '%s' is enabled on SDK controller.",
+ asp->sensors[n]->sensor_name);
}
- android_sensors_set(id, fvalues[0], fvalues[1], fvalues[2]);
- } else {
- W("Unknown sensor name '%s' in '%s'", sensor, msg);
}
- /* Listen to the next event. */
- android_device_listen(ad, asp->events, sizeof(asp->events), _on_sensor_received);
+ /* Start the emulation. */
+ SDKCtlMessage* const msg =
+ sdkctl_message_send(asp->sdkctl, SDKCTL_SENSORS_START, NULL, 0);
+ sdkctl_message_release(msg);
+
+ D("Sensors: Emulation has been started.");
}
-/* A callback that is invoked when android device is connected (i.e. both, command
- * and event channels have been stablished.
- * Param:
- * opaque - AndroidSensorsPort instance.
- * ad - Android device used by this sensors port.
- * failure - Connections status.
- */
-static void
-_on_device_connected(void* opaque, AndroidDevice* ad, int failure)
+/********************************************************************************
+ * Sensors port callbacks
+ *******************************************************************************/
+
+/* Completion for the "list" query. */
+static AsyncIOAction
+_on_sensor_list_query(void* query_opaque,
+ SDKCtlQuery* query,
+ AsyncIOState status)
{
- if (!failure) {
- AndroidSensorsPort* asp = (AndroidSensorsPort*)opaque;
- asp->is_connected = 1;
- D("Sensor emulation has started");
- /* Initialize sensors on device. */
- sensors_port_init_sensors(asp);
+ AndroidSensorsPort* const asp = (AndroidSensorsPort*)(query_opaque);
+ if (status != ASIO_STATE_SUCCEEDED) {
+ /* We don't really care about failures at this point. They will
+ * eventually surface up in another place. */
+ return ASIO_ACTION_DONE;
}
+
+ /* Parse query response which is a flat list of SensorEntry entries. */
+ const SensorEntry* const list =
+ (const SensorEntry*)sdkctl_query_get_buffer_out(query);
+ D("Sensors: Sensor list received with %d sensors.",
+ _sensor_entry_list_size(list));
+ _sensors_port_save_sensors(asp, list);
+
+ /* At this point we are ready to statr sensor emulation. */
+ _sensors_port_start(asp);
+
+ return ASIO_ACTION_DONE;
}
-/* Invoked when an I/O failure occurs on a socket.
- * Note that this callback will not be invoked on connection failures.
+/* A callback that is invoked on sensor events.
* Param:
- * opaque - AndroidSensorsPort instance.
- * ad - Android device instance
- * ads - Connection socket where failure has occured.
- * failure - Contains 'errno' indicating the reason for failure.
+ * asp - AndroidSensorsPort instance.
+ * event - Sensor event.
*/
static void
-_on_io_failure(void* opaque, AndroidDevice* ad, int failure)
+_on_sensor_event(AndroidSensorsPort* asp, const SensorEvent* event)
{
- AndroidSensorsPort* asp = (AndroidSensorsPort*)opaque;
- E("Sensors port got disconnected: %s", strerror(failure));
- asp->is_connected = false;
- android_device_disconnect(ad);
- android_device_connect_async(ad, _on_device_connected);
+ /* Find corresponding server descriptor. */
+ const SensorDescriptor* const desc =
+ _sensor_from_sdkctl_id(asp, event->sensor_id);
+ if (desc != NULL) {
+ T("Sensors: %s -> %f, %f, %f", desc->sensor_name,
+ event->fvalues[0], event->fvalues[1],
+ event->fvalues[2]);
+ /* Fire up sensor change in the guest. */
+ android_sensors_set(desc->emulator_id, event->fvalues[0],
+ event->fvalues[1], event->fvalues[2]);
+ } else {
+ W("Sensors: No descriptor for sensor %d", event->sensor_id);
+ }
}
-/********************************************************************************
- * Sensors port API
- *******************************************************************************/
-
-#include "android/sdk-controller-socket.h"
-
+/* A callback that is invoked on SDK controller socket connection events. */
static AsyncIOAction
-_on_sdkctl_connection(void* client_opaque, SDKCtlSocket* sdkctl, AsyncIOState status)
+_on_sensors_socket_connection(void* client_opaque,
+ SDKCtlSocket* sdkctl,
+ AsyncIOState status)
{
+ AndroidSensorsPort* const asp = (AndroidSensorsPort*)client_opaque;
if (status == ASIO_STATE_FAILED) {
- sdkctl_socket_reconnect(sdkctl, 1970, 20);
+ /* Disconnection could mean that user is swapping devices. New device may
+ * have different set of sensors, so we need to re-query sensor list on
+ * reconnection. */
+ _sensors_port_discard_sensors(asp);
+
+ /* Reconnect (after timeout delay) on failures */
+ if (sdkctl_socket_is_handshake_ok(sdkctl)) {
+ sdkctl_socket_reconnect(sdkctl, SDKCTL_DEFAULT_TCP_PORT,
+ SDKCTL_SENSORS_TIMEOUT);
+ }
}
return ASIO_ACTION_DONE;
}
-void on_sdkctl_handshake(void* client_opaque,
- SDKCtlSocket* sdkctl,
- void* handshake,
- uint32_t handshake_size,
- AsyncIOState status)
+/* A callback that is invoked on SDK controller port connection events. */
+static void
+_on_sensors_port_connection(void* client_opaque,
+ SDKCtlSocket* sdkctl,
+ SdkCtlPortStatus status)
{
- if (status == ASIO_STATE_SUCCEEDED) {
- printf("---------- Handshake %d bytes received.\n", handshake_size);
- } else {
- printf("!!!!!!!!!! Handshake failed with status %d: %d -> %s\n",
- status, errno, strerror(errno));
- sdkctl_socket_reconnect(sdkctl, 1970, 20);
+ AndroidSensorsPort* const asp = (AndroidSensorsPort*)client_opaque;
+ switch (status) {
+ case SDKCTL_PORT_CONNECTED: {
+ D("Sensors: SDK Controller is connected.");
+ /* Query list of available sensors. */
+ SDKCtlQuery* const query =
+ sdkctl_query_build_and_send(asp->sdkctl, SDKCTL_SENSORS_QUERY_LIST,
+ 0, NULL, NULL, NULL,
+ _on_sensor_list_query, asp,
+ SDKCTL_SENSORS_TIMEOUT);
+ sdkctl_query_release(query);
+ break;
+ }
+
+ case SDKCTL_PORT_DISCONNECTED:
+ _sensors_port_discard_sensors(asp);
+ D("Sensors: SDK Controller is disconnected.");
+ break;
+
+ case SDKCTL_PORT_ENABLED:
+ _sensors_port_start(asp);
+ D("Sensors: SDK Controller is enabled.");
+ break;
+
+ case SDKCTL_PORT_DISABLED:
+ D("Sensors: SDK Controller is disabled.");
+ break;
+
+ case SDKCTL_HANDSHAKE_CONNECTED:
+ D("Sensors: SDK Controller has succeeded handshake, and port is connected.");
+ break;
+
+ case SDKCTL_HANDSHAKE_NO_PORT:
+ D("Sensors: SDK Controller has succeeded handshake, and port is not connected.");
+ break;
+
+ case SDKCTL_HANDSHAKE_DUP:
+ E("Sensors: SDK Controller has failed the handshake due to port duplication.");
+ sdkctl_socket_disconnect(sdkctl);
+ break;
+
+ case SDKCTL_HANDSHAKE_UNKNOWN_QUERY:
+ E("Sensors: SDK Controller has failed the handshake due to unknown query.");
+ sdkctl_socket_disconnect(sdkctl);
+ break;
+
+ case SDKCTL_HANDSHAKE_UNKNOWN_RESPONSE:
+ default:
+ E("Sensors: Handshake has failed due to unknown reasons.");
+ sdkctl_socket_disconnect(sdkctl);
+ break;
}
}
-void on_sdkctl_message(void* client_opaque,
- SDKCtlSocket* sdkctl,
- SDKCtlPacket* message,
- int msg_type,
- void* msg_data,
- int msg_size)
+/* A callback that is invoked when a message is received from SDK controller. */
+static void
+_on_sensors_message(void* client_opaque,
+ SDKCtlSocket* sdkctl,
+ SDKCtlMessage* message,
+ int msg_type,
+ void* msg_data,
+ int msg_size)
{
- printf("########################################################\n");
+ AndroidSensorsPort* const asp = (AndroidSensorsPort*)client_opaque;
+ switch (msg_type) {
+ case SDKCTL_SENSORS_SENSOR_EVENT:
+ _on_sensor_event(asp, (const SensorEvent*)msg_data);
+ break;
+
+ default:
+ E("Sensors: Unknown message type %d", msg_type);
+ break;
+ }
}
+/********************************************************************************
+ * Sensors port API
+ *******************************************************************************/
+
AndroidSensorsPort*
sensors_port_create(void* opaque)
{
AndroidSensorsPort* asp;
- char* wrk;
- int res;
-
- SDKCtlSocket* sdkctl = sdkctl_socket_new(20, "test", _on_sdkctl_connection,
- on_sdkctl_handshake, on_sdkctl_message,
- NULL);
-// sdkctl_init_recycler(sdkctl, 64, 8);
- sdkctl_socket_connect(sdkctl, 1970, 20);
ANEW0(asp);
asp->opaque = opaque;
- asp->is_connected = 0;
-
- asp->device = android_device_init(asp, AD_SENSOR_PORT, _on_io_failure);
- if (asp->device == NULL) {
- _sensors_port_free(asp);
- return NULL;
- }
-
- res = android_device_connect_sync(asp->device, ASP_QUERY_TIMEOUT);
- if (res != 0) {
- sensors_port_destroy(asp);
- return NULL;
- }
-
- res = android_device_query(asp->device, "list",
- asp->sensors, sizeof(asp->sensors),
- ASP_QUERY_TIMEOUT);
- if (res != 0) {
- sensors_port_destroy(asp);
- return NULL;
- }
-
- /* Parse sensor list. */
- asp->sensors_num = 0;
- wrk = asp->sensors;
-
- while (wrk != NULL && *wrk != '\0' && *wrk != '\n') {
- asp->sensor_list[asp->sensors_num] = wrk;
- asp->sensors_num++;
- wrk = strchr(wrk, '\n');
- if (wrk != NULL) {
- *wrk = '\0'; wrk++;
- }
- }
-
- android_device_listen(asp->device, asp->events, sizeof(asp->events),
- _on_sensor_received);
+ asp->sensors = NULL;
+ asp->sensors_count = 0;
+ asp->sdkctl = sdkctl_socket_new(SDKCTL_SENSORS_TIMEOUT, "sensors",
+ _on_sensors_socket_connection,
+ _on_sensors_port_connection,
+ _on_sensors_message, asp);
+ sdkctl_init_recycler(asp->sdkctl, 76, 8);
+ sdkctl_socket_connect(asp->sdkctl, SDKCTL_DEFAULT_TCP_PORT,
+ SDKCTL_SENSORS_TIMEOUT);
return asp;
}
-int
-sensors_port_init_sensors(AndroidSensorsPort* asp)
-{
- int res, id;
-
- /* Disable all sensors for now. Reenable only those that are emulated. */
- res = sensors_port_disable_sensor(asp, "all");
- if (res) {
- return res;
- }
-
- /* Start listening on sensor events. */
- res = android_device_listen(asp->device, asp->events, sizeof(asp->events),
- _on_sensor_received);
- if (res) {
- return res;
- }
-
- /* Walk throuh the list of enabled sensors enabling them on the device. */
- for (id = 0; id < MAX_SENSORS; id++) {
- if (android_sensors_get_sensor_status(id) == 1) {
- res = sensors_port_enable_sensor(asp, android_sensors_get_name_from_id(id));
- if (res == 0) {
- D("Sensor '%s' is enabled on the device.",
- android_sensors_get_name_from_id(id));
- }
- }
- }
-
- /* Start sensor events. */
- return sensors_port_start(asp);
-}
-
void
sensors_port_destroy(AndroidSensorsPort* asp)
{
+ if (asp->sdkctl != NULL) {
+ sdkctl_socket_disconnect(asp->sdkctl);
+ }
_sensors_port_free(asp);
}
int
-sensors_port_is_connected(AndroidSensorsPort* asp)
-{
- return asp->is_connected;
-}
-
-int
sensors_port_enable_sensor(AndroidSensorsPort* asp, const char* name)
{
- char query[1024];
- char qresp[1024];
- snprintf(query, sizeof(query), "enable:%s", name);
- const int res =
- android_device_query(asp->device, query, qresp, sizeof(qresp),
- ASP_QUERY_TIMEOUT);
- if (res) {
- if (errno) {
- D("Query '%s' failed on I/O: %s", query, strerror(errno));
- } else {
- D("Query '%s' failed on device: %s", query, qresp);
- }
+ if (asp->sdkctl != NULL && sdkctl_socket_is_port_ready(asp->sdkctl)) {
+ SDKCtlMessage* const msg = sdkctl_message_send(asp->sdkctl,
+ SDKCTL_SENSORS_ENABLE,
+ name, strlen(name));
+ sdkctl_message_release(msg);
+ return 0;
+ } else {
+ return -1;
}
- return res;
}
int
sensors_port_disable_sensor(AndroidSensorsPort* asp, const char* name)
{
- char query[1024];
- char qresp[1024];
- snprintf(query, sizeof(query), "disable:%s", name);
- const int res =
- android_device_query(asp->device, query, qresp, sizeof(qresp),
- ASP_QUERY_TIMEOUT);
- if (res) {
- if (errno) {
- D("Query '%s' failed on I/O: %s", query, strerror(errno));
- } else {
- D("Query '%s' failed on device: %s", query, qresp);
- }
- }
- return res;
-}
-
-int
-sensors_port_start(AndroidSensorsPort* asp)
-{
- char qresp[ASP_MAX_SENSOR_MSG];
- const int res =
- android_device_query(asp->device, "start", qresp, sizeof(qresp),
- ASP_QUERY_TIMEOUT);
- if (res) {
- if (errno) {
- D("Query 'start' failed on I/O: %s", strerror(errno));
- } else {
- D("Query 'start' failed on device: %s", qresp);
- }
- }
- return res;
-}
-
-int
-sensors_port_stop(AndroidSensorsPort* asp)
-{
- char qresp[ASP_MAX_SENSOR_MSG];
- const int res =
- android_device_query(asp->device, "stop", qresp, sizeof(qresp),
- ASP_QUERY_TIMEOUT);
- if (res) {
- if (errno) {
- D("Query 'stop' failed on I/O: %s", strerror(errno));
- } else {
- D("Query 'stop' failed on device: %s", qresp);
- }
+ if (asp->sdkctl != NULL && sdkctl_socket_is_port_ready(asp->sdkctl)) {
+ SDKCtlMessage* const msg = sdkctl_message_send(asp->sdkctl,
+ SDKCTL_SENSORS_DISABLE,
+ name, strlen(name));
+ sdkctl_message_release(msg);
+ return 0;
+ } else {
+ return -1;
}
-
- return res;
}
diff --git a/android/sensors-port.h b/android/sensors-port.h
index dc5c966..a35d700 100644
--- a/android/sensors-port.h
+++ b/android/sensors-port.h
@@ -23,8 +23,6 @@
* the host via USB.
*/
-#include "android/android-device.h"
-
/* Declares sensors port descriptor. */
typedef struct AndroidSensorsPort AndroidSensorsPort;
@@ -42,15 +40,6 @@ extern AndroidSensorsPort* sensors_port_create(void* opaque);
/* Disconnects from the sensors port, and destroys the descriptor. */
extern void sensors_port_destroy(AndroidSensorsPort* asp);
-/* Initializes sensors on the connected device. */
-extern int sensors_port_init_sensors(AndroidSensorsPort* asp);
-
-/* Checks if port is connected to a sensor reading application on the device.
- * Note that connection can go out and then be restored at any time after
- * sensors_port_create API succeeded.
- */
-extern int sensors_port_is_connected(AndroidSensorsPort* asp);
-
/* Enables events from a particular sensor.
* Param:
* asp - Android sensors port instance returned from sensors_port_create.
@@ -72,20 +61,4 @@ extern int sensors_port_enable_sensor(AndroidSensorsPort* asp, const char* name)
*/
extern int sensors_port_disable_sensor(AndroidSensorsPort* asp, const char* name);
-/* Queries the connected application to start delivering sensor events.
- * Param:
- * asp - Android sensors port instance returned from sensors_port_create.
- * Return:
- * Zero on success, failure otherwise.
- */
-extern int sensors_port_start(AndroidSensorsPort* asp);
-
-/* Queries the connected application to stop delivering sensor events.
- * Param:
- * asp - Android sensors port instance returned from sensors_port_create.
- * Return:
- * Zero on success, failure otherwise.
- */
-extern int sensors_port_stop(AndroidSensorsPort* asp);
-
#endif /* ANDROID_SENSORS_PORT_H_ */
diff --git a/android/skin/scaler.c b/android/skin/scaler.c
index 5672869..bafd84e 100644
--- a/android/skin/scaler.c
+++ b/android/skin/scaler.c
@@ -150,6 +150,34 @@ skin_scaler_scale( SkinScaler* scaler,
else
scale_generic( &op );
}
+
+ // The optimized scale functions in argb.h assume the destination is ARGB.
+ // If that's not the case, do a channel reorder now.
+ if (dst_surface->format->Rshift != 16 ||
+ dst_surface->format->Gshift != 8 ||
+ dst_surface->format->Bshift != 0)
+ {
+ uint32_t rshift = dst_surface->format->Rshift;
+ uint32_t gshift = dst_surface->format->Gshift;
+ uint32_t bshift = dst_surface->format->Bshift;
+ uint32_t ashift = dst_surface->format->Ashift;
+ uint32_t amask = dst_surface->format->Amask; // may be 0x00
+ int x, y;
+
+ for (y = 0; y < op.rd.h; y++)
+ {
+ uint32_t* line = (uint32_t*)(op.dst_line + y*op.dst_pitch);
+ for (x = 0; x < op.rd.w; x++) {
+ uint32_t r = (line[x] & 0x00ff0000) >> 16;
+ uint32_t g = (line[x] & 0x0000ff00) >> 8;
+ uint32_t b = (line[x] & 0x000000ff) >> 0;
+ uint32_t a = (line[x] & 0xff000000) >> 24;
+ line[x] = (r << rshift) | (g << gshift) | (b << bshift) |
+ ((a << ashift) & amask);
+ }
+ }
+ }
+
SDL_UnlockSurface( dst_surface );
SDL_UnlockSurface( src_surface );
diff --git a/android/skin/window.c b/android/skin/window.c
index 5d8c684..65276ac 100644
--- a/android/skin/window.c
+++ b/android/skin/window.c
@@ -148,22 +148,25 @@ display_init( ADisplay* disp, SkinDisplay* sdisp, SkinLocation* loc, SkinRect
return (disp->data == NULL) ? -1 : 0;
}
-static __inline__ uint32_t rgb565_to_argb32( uint32_t pix )
+static __inline__ uint32_t rgb565_to_rgba32(uint32_t pix,
+ uint32_t rshift, uint32_t gshift, uint32_t bshift, uint32_t amask)
{
- uint32_t r = ((pix & 0xf800) << 8) | ((pix & 0xe000) << 3);
- uint32_t g = ((pix & 0x07e0) << 5) | ((pix & 0x0600) >> 1);
- uint32_t b = ((pix & 0x001f) << 3) | ((pix & 0x001c) >> 2);
- return 0xff000000 | r | g | b;
+ uint32_t r8 = ((pix & 0xf800) >> 8) | ((pix & 0xe000) >> 13);
+ uint32_t g8 = ((pix & 0x07e0) >> 3) | ((pix & 0x0600) >> 9);
+ uint32_t b8 = ((pix & 0x001f) << 3) | ((pix & 0x001c) >> 2);
+ return (r8 << rshift) | (g8 << gshift) | (b8 << bshift) | amask;
}
/* The framebuffer format is R,G,B,X in framebuffer memory, on a
* little-endian system, this translates to XBGR after a load.
*/
-static __inline__ uint32_t xbgr_to_argb32( uint32_t pix )
+static __inline__ uint32_t xbgr_to_rgba32(uint32_t pix,
+ uint32_t rshift, uint32_t gshift, uint32_t bshift, uint32_t amask)
{
- uint32_t g = (pix & 0x0000ff00);
- uint32_t rb = (pix & 0xff00ff);
- return 0xff000000 | (rb << 16) | g | (rb >> 16);
+ uint32_t r8 = (pix & 0x00ff0000) >> 16;
+ uint32_t g8 = (pix & 0x0000ff00) >> 8;
+ uint32_t b8 = (pix & 0x000000ff) >> 0;
+ return (r8 << rshift) | (g8 << gshift) | (b8 << bshift) | amask;
}
static void
@@ -392,6 +395,10 @@ display_redraw_rect16( ADisplay* disp, SkinRect* rect, SDL_Surface* surface)
int src_pitch = disp->datasize.w*2;
uint8_t* src_line = (uint8_t*)disp->data;
int yy, xx;
+ uint32_t rshift = surface->format->Rshift;
+ uint32_t gshift = surface->format->Gshift;
+ uint32_t bshift = surface->format->Bshift;
+ uint32_t amask = surface->format->Amask; // may be 0x00 for non-alpha format
switch ( disp->rotation & 3 )
{
@@ -405,7 +412,7 @@ display_redraw_rect16( ADisplay* disp, SkinRect* rect, SDL_Surface* surface)
xx = 0;
DUFF4(w, {
- dst[xx] = rgb565_to_argb32(src[xx]);
+ dst[xx] = rgb565_to_rgba32(src[xx], rshift, gshift, bshift, amask);
xx++;
});
src_line += src_pitch;
@@ -422,7 +429,7 @@ display_redraw_rect16( ADisplay* disp, SkinRect* rect, SDL_Surface* surface)
uint8_t* src = src_line;
DUFF4(w, {
- dst[0] = rgb565_to_argb32(((uint16_t*)src)[0]);
+ dst[0] = rgb565_to_rgba32(((uint16_t*)src)[0], rshift, gshift, bshift, amask);
src -= src_pitch;
dst += 1;
});
@@ -440,7 +447,7 @@ display_redraw_rect16( ADisplay* disp, SkinRect* rect, SDL_Surface* surface)
uint32_t* dst = (uint32_t*)dst_line;
DUFF4(w, {
- dst[0] = rgb565_to_argb32(src[0]);
+ dst[0] = rgb565_to_rgba32(src[0], rshift, gshift, bshift, amask);
src -= 1;
dst += 1;
});
@@ -458,7 +465,7 @@ display_redraw_rect16( ADisplay* disp, SkinRect* rect, SDL_Surface* surface)
uint8_t* src = src_line;
DUFF4(w, {
- dst[0] = rgb565_to_argb32(((uint16_t*)src)[0]);
+ dst[0] = rgb565_to_rgba32(((uint16_t*)src)[0], rshift, gshift, bshift, amask);
dst += 1;
src += src_pitch;
});
@@ -482,6 +489,10 @@ display_redraw_rect32( ADisplay* disp, SkinRect* rect,SDL_Surface* surface)
int src_pitch = disp->datasize.w*4;
uint8_t* src_line = (uint8_t*)disp->data;
int yy;
+ uint32_t rshift = surface->format->Rshift;
+ uint32_t gshift = surface->format->Gshift;
+ uint32_t bshift = surface->format->Bshift;
+ uint32_t amask = surface->format->Amask; // may be 0x00 for non-alpha format
switch ( disp->rotation & 3 )
{
@@ -493,7 +504,7 @@ display_redraw_rect32( ADisplay* disp, SkinRect* rect,SDL_Surface* surface)
uint32_t* dst = (uint32_t*)dst_line;
DUFF4(w, {
- dst[0] = xbgr_to_argb32(src[0]);
+ dst[0] = xbgr_to_rgba32(src[0], rshift, gshift, bshift, amask);
dst++;
src++;
});
@@ -511,7 +522,7 @@ display_redraw_rect32( ADisplay* disp, SkinRect* rect,SDL_Surface* surface)
uint8_t* src = src_line;
DUFF4(w, {
- dst[0] = xbgr_to_argb32(*(uint32_t*)src);
+ dst[0] = xbgr_to_rgba32(*(uint32_t*)src, rshift, gshift, bshift, amask);
src -= src_pitch;
dst += 1;
});
@@ -529,7 +540,7 @@ display_redraw_rect32( ADisplay* disp, SkinRect* rect,SDL_Surface* surface)
uint32_t* dst = (uint32_t*)dst_line;
DUFF4(w, {
- dst[0] = xbgr_to_argb32(src[0]);
+ dst[0] = xbgr_to_rgba32(src[0], rshift, gshift, bshift, amask);
src -= 1;
dst += 1;
});
@@ -547,7 +558,7 @@ display_redraw_rect32( ADisplay* disp, SkinRect* rect,SDL_Surface* surface)
uint8_t* src = src_line;
DUFF4(w, {
- dst[0] = xbgr_to_argb32(*(uint32_t*)src);
+ dst[0] = xbgr_to_rgba32(*(uint32_t*)src, rshift, gshift, bshift, amask);
dst += 1;
src += src_pitch;
});
diff --git a/android/utils/path.c b/android/utils/path.c
index 1bcdc4e..3e9d97b 100644
--- a/android/utils/path.c
+++ b/android/utils/path.c
@@ -78,8 +78,12 @@ path_parent( const char* path, int levels )
while (base > path && !ispathsep(base[-1]))
base--;
- if (base <= path) /* we can't go that far */
+ if (base <= path) {
+ if (end == base+1 && base[0] == '.' && levels == 1)
+ return strdup("..");
+ /* we can't go that far */
return NULL;
+ }
if (end == base+1 && base[0] == '.')
goto Next;
diff --git a/distrib/README b/distrib/README
index 8a2cf52..22d276f 100644
--- a/distrib/README
+++ b/distrib/README
@@ -39,12 +39,4 @@ it is based on QEMU 0.8.2 with many changes used to support the following featur
"dynamic ticks" that make this mode un-necessary for Android.
-it also uses a patched version of LibSDL-1.2.12 which implements the following:
-
- - prevent a fatal bug in Quartz Extreme's QuickDraw emulation to crash the program
- whenever SDL_WINDOW_POS is set in the environment before starting the program.
- the patch implements a simple workaround to this system-level problem.
-
- - new APIs: SDL_WM_GetPos() and SDL_WM_SetPos() are used to retrieve and set the emulator
- window position. this allows us to implement a simple-yet-useful feature: the emulator remembers
- its position among restarts.
+it also uses a patched version of LibSDL-1.2.15.
diff --git a/distrib/build-kernel.sh b/distrib/build-kernel.sh
index 20d85c6..5838da3 100755
--- a/distrib/build-kernel.sh
+++ b/distrib/build-kernel.sh
@@ -6,7 +6,7 @@
MACHINE=goldfish
VARIANT=goldfish
OUTPUT=/tmp/kernel-qemu
-CROSSPREFIX=arm-eabi-
+CROSSPREFIX=arm-linux-androideabi-
CONFIG=goldfish
# Determine the host architecture, and which default prebuilt tag we need.
@@ -127,12 +127,16 @@ if [ -n "$OPTION_CROSS" ] ; then
else
case $ARCH in
arm)
- CROSSTOOLCHAIN=arm-eabi-4.4.3
- CROSSPREFIX=arm-eabi-
+ CROSSTOOLCHAIN=arm-linux-androideabi-4.6
+ CROSSPREFIX=arm-linux-androideabi-
;;
x86)
- CROSSTOOLCHAIN=i686-android-linux-4.4.3
- CROSSPREFIX=i686-android-linux-
+ CROSSTOOLCHAIN=i686-linux-android-4.6
+ CROSSPREFIX=i686-linux-android-
+ ;;
+ mips)
+ CROSSTOOLCHAIN=mipsel-linux-android-4.6
+ CROSSPREFIX=mipsel-linux-android-
;;
*)
echo "ERROR: Unsupported architecture!"
@@ -148,6 +152,9 @@ case $ARCH in
x86)
ZIMAGE=bzImage
;;
+ mips)
+ ZIMAGE=
+ ;;
esac
# If the cross-compiler is not in the path, try to find it automatically
@@ -159,13 +166,13 @@ if [ $? != 0 ] ; then
# Assume this script is under external/qemu/distrib/ in the
# Android source tree.
BUILD_TOP=$(dirname $0)/../../..
- if [ ! -d "$BUILD_TOP/prebuilt" ]; then
+ if [ ! -d "$BUILD_TOP/prebuilts" ]; then
BUILD_TOP=
else
BUILD_TOP=$(cd $BUILD_TOP && pwd)
fi
fi
- CROSSPREFIX=$BUILD_TOP/prebuilt/$HOST_TAG/toolchain/$CROSSTOOLCHAIN/bin/$CROSSPREFIX
+ CROSSPREFIX=$BUILD_TOP/prebuilts/gcc/$HOST_TAG/$ARCH/$CROSSTOOLCHAIN/bin/$CROSSPREFIX
if [ "$BUILD_TOP" -a -f ${CROSSPREFIX}gcc ]; then
echo "Auto-config: --cross=$CROSSPREFIX"
else
@@ -184,15 +191,11 @@ fi
# Special magic redirection with our magic toolbox script
-# This is needed to add extra compiler flags for x86
+# This is needed to add extra compiler flags to compiler.
+# See kernel-toolchain/android-kernel-toolchain-* for details
#
-# We could use that for ARM, but don't need to at the moment.
-#
-if [ "$ARCH" = "x86" ]; then
- export REAL_CROSS_COMPILE="$CROSS_COMPILE"
- export ARCH
- CROSS_COMPILE=$(dirname "$0")/kernel-toolchain/android-kernel-toolchain-
-fi
+export REAL_CROSS_COMPILE="$CROSS_COMPILE"
+CROSS_COMPILE=$(dirname "$0")/kernel-toolchain/android-kernel-toolchain-
# Do the build
#
@@ -225,8 +228,12 @@ case $CONFIG in
OUTPUT_VMLINUX=vmlinux-$CONFIG
esac
-cp -f arch/$ARCH/boot/$ZIMAGE $OUTPUT/$OUTPUT_KERNEL
cp -f vmlinux $OUTPUT/$OUTPUT_VMLINUX
-
+if [ ! -z $ZIMAGE ]; then
+ cp -f arch/$ARCH/boot/$ZIMAGE $OUTPUT/$OUTPUT_KERNEL
+else
+ cp -f vmlinux $OUTPUT/$OUTPUT_KERNEL
+fi
echo "Kernel $CONFIG prebuilt images ($OUTPUT_KERNEL and $OUTPUT_VMLINUX) copied to $OUTPUT successfully !"
+
exit 0
diff --git a/distrib/jpeg-6b/jddctmgr.c b/distrib/jpeg-6b/jddctmgr.c
index 74a96db..95e5849 100644
--- a/distrib/jpeg-6b/jddctmgr.c
+++ b/distrib/jpeg-6b/jddctmgr.c
@@ -50,6 +50,13 @@ void jpeg_idct_armv6 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
#endif
+#ifdef ANDROID_INTELSSE2_IDCT
+extern short __attribute__((aligned(16))) quantptrSSE[DCTSIZE2];
+extern void jpeg_idct_intelsse (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JCOEFPTR coef_block,
+ JSAMPARRAY output_buf, JDIMENSION output_col);
+#endif
+
/*
* The decompressor input side (jdinput.c) saves away the appropriate
* quantization table for each component at the start of the first scan
@@ -151,6 +158,13 @@ start_pass (j_decompress_ptr cinfo)
method = JDCT_IFAST;
break;
#else /* ANDROID_ARMV6_IDCT */
+#ifdef ANDROID_INTELSSE2_IDCT
+ case JDCT_ISLOW:
+ case JDCT_IFAST:
+ method_ptr = jpeg_idct_intelsse;
+ method = JDCT_ISLOW; /* Use quant table of ISLOW.*/
+ break;
+#else
#ifdef DCT_ISLOW_SUPPORTED
case JDCT_ISLOW:
method_ptr = jpeg_idct_islow;
@@ -163,6 +177,7 @@ start_pass (j_decompress_ptr cinfo)
method = JDCT_IFAST;
break;
#endif
+#endif
#endif /* ANDROID_ARMV6_IDCT */
#ifdef DCT_FLOAT_SUPPORTED
case JDCT_FLOAT:
diff --git a/distrib/jpeg-6b/jdphuff.c b/distrib/jpeg-6b/jdphuff.c
index 922017e..cccfdd9 100644
--- a/distrib/jpeg-6b/jdphuff.c
+++ b/distrib/jpeg-6b/jdphuff.c
@@ -82,6 +82,10 @@ METHODDEF(boolean) decode_mcu_DC_refine JPP((j_decompress_ptr cinfo,
JBLOCKROW *MCU_data));
METHODDEF(boolean) decode_mcu_AC_refine JPP((j_decompress_ptr cinfo,
JBLOCKROW *MCU_data));
+GLOBAL(void) jpeg_configure_huffman_decoder_progressive(
+ j_decompress_ptr cinfo, huffman_offset_data offset);
+GLOBAL(void) jpeg_get_huffman_decoder_configuration_progressive(
+ j_decompress_ptr cinfo, huffman_offset_data *offset);
/*
* Initialize for a Huffman-compressed scan.
diff --git a/distrib/jpeg-6b/jidctintelsse.c b/distrib/jpeg-6b/jidctintelsse.c
new file mode 100644
index 0000000..cb5c93b
--- /dev/null
+++ b/distrib/jpeg-6b/jidctintelsse.c
@@ -0,0 +1,332 @@
+/*
+ * Copyright (C) 2010-2011 Intel Corporation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define JPEG_INTERNALS
+#include "jinclude.h"
+#include "jpeglib.h"
+#include "jdct.h" /* Private declarations for DCT subsystem */
+
+#ifdef ANDROID_INTELSSE2_IDCT
+#include <emmintrin.h>
+
+#if DCTSIZE != 8
+ Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
+#endif
+
+#define BITS_INV_ACC 4
+#define SHIFT_INV_ROW 12
+#define SHIFT_INV_COL 5
+const short RND_INV_ROW = 2048;
+const short RND_INV_COL = 16;
+const short RND_INV_CORR = 15;
+
+static const short __attribute__ ((aligned(16))) M128_one_corr[8] = {1,1,1,1,1,1,1,1};
+static const short __attribute__ ((aligned(16))) M128_round_inv_row[8] = {2048,0,2048,0,2048,0,2048,0};
+static const short __attribute__ ((aligned(16))) M128_round_inv_col[8] = {16,16,16,16,16,16,16,16};
+static const short __attribute__ ((aligned(16))) M128_round_inv_corr[8] = {15,15,15,15,15,15,15,15};
+
+static const short __attribute__ ((aligned(16))) M128_tg_1_16[8] = {13036, 13036, 13036, 13036, 13036, 13036, 13036, 13036};
+static const short __attribute__ ((aligned(16))) M128_tg_2_16[8] = {27146, 27146, 27146, 27146, 27146, 27146, 27146, 27146};
+static const short __attribute__ ((aligned(16))) M128_tg_3_16[8] = {-21746, -21746, -21746, -21746, -21746, -21746, -21746, -21746};
+static const short __attribute__ ((aligned(16))) M128_cos_4_16[8] = {-19195, -19195, -19195, -19195, -19195, -19195, -19195, -19195};
+
+static const short __attribute__ ((aligned(16))) jpeg_adjust[8] = {128, 128, 128, 128, 128, 128, 128, 128};
+
+// Table for rows 0,4
+static const short __attribute__ ((aligned(16))) M128_tab_i_04[32] = {
+16384, 21407, 16384, 8867,
+16384, -8867, 16384, -21407,
+16384, 8867, -16384, -21407,
+-16384, 21407, 16384, -8867,
+22725, 19266, 19266, -4520,
+12873, -22725, 4520, -12873,
+12873, 4520, -22725, -12873,
+4520, 19266, 19266, -22725
+};
+
+// Table for rows 1,7
+static const short __attribute__ ((aligned(16))) M128_tab_i_17[32] = {
+22725, 29692, 22725, 12299,
+22725, -12299, 22725, -29692,
+22725, 12299, -22725, -29692,
+-22725, 29692, 22725, -12299,
+31521, 26722, 26722, -6270,
+17855, -31521, 6270, -17855,
+17855, 6270, -31521, -17855,
+6270, 26722, 26722, -31521
+};
+
+// Table for rows 2,6
+static const short __attribute__ ((aligned(16))) M128_tab_i_26[32] = {
+21407, 27969, 21407, 11585,
+21407, -11585, 21407, -27969,
+21407, 11585, -21407, -27969,
+-21407, 27969, 21407, -11585,
+29692, 25172, 25172, -5906,
+16819, -29692, 5906, -16819,
+16819, 5906, -29692, -16819,
+5906, 25172, 25172, -29692
+};
+
+// Table for rows 3,5
+static const short __attribute__ ((aligned(16))) M128_tab_i_35[32] = {
+19266, 25172, 19266, 10426,
+19266, -10426, 19266, -25172,
+19266, 10426, -19266, -25172,
+-19266, 25172, 19266, -10426,
+26722, 22654, 22654, -5315,
+15137, -26722, 5315, -15137,
+15137, 5315, -26722, -15137,
+5315, 22654, 22654, -26722
+};
+
+
+/*
+ * Perform dequantization and inverse DCT on one block of coefficients by SSE.
+ */
+
+GLOBAL(void)
+jpeg_idct_intelsse (j_decompress_ptr cinfo, jpeg_component_info * compptr,
+ JCOEFPTR coef_block,
+ JSAMPARRAY output_buf, JDIMENSION output_col)
+{
+ __m128i row0, tmp1, tmp2, tmp3, row2, tmp5, tmp6, tmp7;
+ int ctr;
+ JSAMPROW outptrTemp;
+ JSAMPLE *range_limit = IDCT_range_limit(cinfo);
+ short __attribute__((aligned(16))) quantptrSSE[DCTSIZE2];
+ short __attribute__((aligned(16))) workspaceSSE[DCTSIZE2];
+ short __attribute__((aligned(16))) coef_blockSSE[DCTSIZE2];
+ __m128i x0, x1, x2, x3, x4, x5, x6, x7;
+ __m128i* tg3, *tg1, *tg2, *cos4;
+ __m128i tm765, tp765, tm465, tp465, tp03, tm03, tp12, tm12, tp65, tm65;
+ __m128i t0, t1, t2, t3, t4, t5, t6, t7;
+ __m128i temp, temp2;
+ short * wsptr;
+ unsigned char * outptr;
+
+#define iDCT_8_2ROWs(table1, table2) \
+ row0 = _mm_shufflelo_epi16(row0, 0xD8); /*x7, x6, x5, x4, x3, x1, x2, x0*/ \
+ row2 = _mm_shufflelo_epi16(row2, 0xD8); \
+ tmp1 = _mm_shuffle_epi32(row0, 0); /*x2, x0, x2, x0, x2, x0, x2, x0*/ \
+ tmp5 = _mm_shuffle_epi32(row2, 0); \
+ \
+ tmp3 = _mm_shuffle_epi32(row0, 0x55); /*x3, x1, x3, x1, x3, x1, x3, x1*/ \
+ tmp7 = _mm_shuffle_epi32(row2, 0x55); \
+ row0 = _mm_shufflehi_epi16(row0, 0xD8); /*x7, x5, x6, x4, x3, x1, x2, x0*/ \
+ row2 = _mm_shufflehi_epi16(row2, 0xD8); \
+ \
+ tmp1 = _mm_madd_epi16(tmp1, * ( __m128i*)table1); /*x2*w13+x0*w12, x2*w9+x0*w8, x2*w5+x0*w4, x2*w1+x0*w0*/ \
+ tmp5 = _mm_madd_epi16(tmp5, * ( __m128i*)table2); \
+ \
+ tmp2 = _mm_shuffle_epi32(row0, 0xAA); /*x6, x4, x6, x4, x6, x4, x6, x4*/ \
+ tmp6 = _mm_shuffle_epi32(row2, 0xAA); \
+ row0 = _mm_shuffle_epi32(row0, 0xFF); /*x7, x5, x7, x5, x7, x5, x7, x5*/ \
+ row2 = _mm_shuffle_epi32(row2, 0xFF); \
+\
+ tmp3 = _mm_madd_epi16(tmp3, * ( __m128i*)(table1+16)); /*x3*w29+x1*w28, x3*w25+x1*w24, x3*w21+x1*w20, x3*w17+x1*w16*/ \
+ tmp7 = _mm_madd_epi16(tmp7, * ( __m128i*)(table2+16) ); \
+ row0 = _mm_madd_epi16(row0, * ( __m128i*)(table1+24)); /*x7*w31+x5*w30, x7*w27+x5*w26, x7*w23+x5*w22, x7*w19+x5*w18*/ \
+ row2 = _mm_madd_epi16(row2, * ( __m128i*)(table2+24) ); \
+ tmp2 = _mm_madd_epi16(tmp2, * ( __m128i*)(table1+8) ); /*x6*w15+x4*w14, x6*w11+x4*w10, x6*w7+x4*w6, x6*w3+x4*w2*/ \
+ tmp6 = _mm_madd_epi16(tmp6, * ( __m128i*)(table2+8) ); \
+ \
+ tmp1 = _mm_add_epi32(tmp1, * ( __m128i*)M128_round_inv_row); \
+ tmp5 = _mm_add_epi32(tmp5, * ( __m128i*)M128_round_inv_row); \
+ row0 = _mm_add_epi32(row0, tmp3); /*b3, b2, b1, b0*/ \
+ row2 = _mm_add_epi32(row2, tmp7); \
+ tmp1 = _mm_add_epi32(tmp1, tmp2); /*a3, a2, a1, a0*/ \
+ tmp5 = _mm_add_epi32(tmp5, tmp6); \
+ \
+ tmp2 = tmp1; \
+ tmp6 = tmp5; \
+ tmp2 = _mm_sub_epi32(tmp2, row0); /*for row0. y4= a3-b3, y5=a2-b2, y6=a1-b1, y7=a0-b0 */ \
+ tmp6 = _mm_sub_epi32(tmp6, row2); \
+ row0 = _mm_add_epi32(row0, tmp1); /*y3=a3+b3,y2=a2+b2,y1=a1+b1,y0=a0+b0*/ \
+ row2 = _mm_add_epi32(row2, tmp5); \
+ tmp2 = _mm_srai_epi32(tmp2, SHIFT_INV_ROW); \
+ tmp6 = _mm_srai_epi32(tmp6, SHIFT_INV_ROW); \
+ row0 = _mm_srai_epi32(row0, SHIFT_INV_ROW); \
+ row2 = _mm_srai_epi32(row2, SHIFT_INV_ROW); \
+ tmp2 = _mm_shuffle_epi32(tmp2, 0x1B); /*y7, y6, y5, y4*/ \
+ tmp6 = _mm_shuffle_epi32(tmp6, 0x1B); \
+ row0 = _mm_packs_epi32(row0, tmp2); /*row0 = y7,y6,y5,y4,y3,y2,y1,y0*/ \
+ row2 = _mm_packs_epi32(row2, tmp6); /*row2 = y7,...y0*/
+
+
+#define iDCT_8_COL() \
+ x3 = _mm_load_si128(( __m128i*)(wsptr+24));\
+ x1 = _mm_load_si128(( __m128i*)(wsptr+8));\
+ x5 = row0;\
+ x7 = row2;\
+\
+ tg3 = ( __m128i*)(M128_tg_3_16);\
+ tg1 = ( __m128i*)(M128_tg_1_16);\
+ tg2 = ( __m128i*)(M128_tg_2_16);\
+ cos4 =(__m128i*)(M128_cos_4_16);\
+\
+ temp = _mm_mulhi_epi16(x5, *tg3); /*row5*tg3*/ \
+ temp2 = _mm_mulhi_epi16(x3, *tg3);\
+ temp = _mm_adds_epi16(temp, x5); /*coef adjustment*/ \
+ temp2 = _mm_adds_epi16(temp2, x3);\
+ tm765 = _mm_adds_epi16(temp, x3);\
+ tm465 = _mm_subs_epi16(x5, temp2);\
+\
+ temp = _mm_mulhi_epi16(x7, *tg1); /*row7*tg1*/ \
+ temp2 = _mm_mulhi_epi16(x1, *tg1);\
+ tp765 = _mm_adds_epi16(temp, x1);\
+ tp465 = _mm_subs_epi16(temp2, x7); /*row1*tg1 - row7*/ \
+\
+ t7 = _mm_adds_epi16(tp765, tm765);\
+ t7 = _mm_adds_epi16(t7, *( __m128i*)M128_one_corr);\
+ tp65 = _mm_subs_epi16(tp765, tm765);\
+ t4 = _mm_adds_epi16(tp465, tm465);\
+ tm65 = _mm_subs_epi16(tp465, tm465);\
+ tm65 = _mm_adds_epi16(tm65, *( __m128i*)M128_one_corr);\
+\
+ x0 = _mm_load_si128(( __m128i*)(wsptr));\
+ x4 = _mm_load_si128(( __m128i*)(wsptr+32));\
+ x2 = _mm_load_si128(( __m128i*)(wsptr+16));\
+ x6 = _mm_load_si128(( __m128i*)(wsptr+48));\
+\
+ /*t6 = ( tp65 + tm65 ) * cos_4_16;*/ \
+ temp = _mm_adds_epi16(tp65, tm65);\
+ temp2 = _mm_subs_epi16(tp65, tm65);\
+ t6 = _mm_mulhi_epi16(temp, *cos4);\
+ t5 = _mm_mulhi_epi16(temp2, *cos4);\
+ t6 = _mm_adds_epi16(t6, temp);\
+ t6 = _mm_or_si128(t6, *( __m128i*)M128_one_corr);\
+ t5 = _mm_adds_epi16(t5, temp2);\
+ t5 = _mm_or_si128(t5, *( __m128i*)M128_one_corr);\
+\
+ tp03 = _mm_adds_epi16(x0, x4);\
+ tp12 = _mm_subs_epi16(x0, x4);\
+\
+ temp = _mm_mulhi_epi16(x6, *tg2);\
+ temp2 = _mm_mulhi_epi16(x2, *tg2);\
+ tm03 = _mm_adds_epi16(temp, x2);\
+ tm12 = _mm_subs_epi16(temp2, x6);\
+\
+ t0 = _mm_adds_epi16(tp03, tm03);\
+ t0 = _mm_adds_epi16(t0, *( __m128i*)M128_round_inv_col);\
+ t3 = _mm_subs_epi16(tp03, tm03);\
+ t3 = _mm_adds_epi16(t3, *( __m128i*)M128_round_inv_corr);\
+ t1 = _mm_adds_epi16(tp12, tm12);\
+ t1 = _mm_adds_epi16(t1, *( __m128i*)M128_round_inv_col);\
+ t2 = _mm_subs_epi16(tp12, tm12);\
+ t2 = _mm_adds_epi16(t2, *( __m128i*)M128_round_inv_corr);\
+\
+ temp = _mm_adds_epi16(t0, t7); /*y0*/ \
+ temp2 = _mm_adds_epi16(t1, t6); /*y1*/ \
+ temp = _mm_srai_epi16(temp, SHIFT_INV_COL);\
+ temp2 = _mm_srai_epi16(temp2, SHIFT_INV_COL);\
+ temp = _mm_adds_epi16(temp, *( __m128i*)jpeg_adjust); /*Add 128 for jpeg decoding*/ \
+ temp2 = _mm_adds_epi16(temp2, *( __m128i*)jpeg_adjust);\
+\
+ temp = _mm_packus_epi16(temp, temp2);\
+ _mm_store_si128(( __m128i*)(outptr), temp); /*store y0, y1*/ \
+\
+ temp = _mm_adds_epi16(t2, t5);\
+ temp2 = _mm_adds_epi16(t3, t4);\
+ temp = _mm_srai_epi16(temp, SHIFT_INV_COL);\
+ temp2 = _mm_srai_epi16(temp2, SHIFT_INV_COL);\
+ temp = _mm_adds_epi16(temp, *( __m128i*)jpeg_adjust);\
+ temp2 = _mm_adds_epi16(temp2, *( __m128i*)jpeg_adjust);\
+\
+ temp = _mm_packus_epi16(temp, temp2);\
+ _mm_store_si128(( __m128i*)(outptr+16), temp); /*store y2, y3*/ \
+\
+ temp = _mm_subs_epi16(t3, t4);\
+ temp2 = _mm_subs_epi16(t2, t5);\
+ temp = _mm_srai_epi16(temp, SHIFT_INV_COL);\
+ temp2 = _mm_srai_epi16(temp2, SHIFT_INV_COL);\
+ temp = _mm_adds_epi16(temp, *( __m128i*)jpeg_adjust);\
+ temp2 = _mm_adds_epi16(temp2, *( __m128i*)jpeg_adjust);\
+\
+ temp = _mm_packus_epi16(temp, temp2);\
+ _mm_store_si128(( __m128i*)(outptr+32), temp); /*store y4, y5*/ \
+\
+ temp = _mm_subs_epi16(t1, t6);\
+ temp2 = _mm_subs_epi16(t0, t7);\
+ temp = _mm_srai_epi16(temp, SHIFT_INV_COL);\
+ temp2 = _mm_srai_epi16(temp2, SHIFT_INV_COL);\
+ temp = _mm_adds_epi16(temp, *( __m128i*)jpeg_adjust);\
+ temp2 = _mm_adds_epi16(temp2, *( __m128i*)jpeg_adjust);\
+\
+ temp = _mm_packus_epi16(temp, temp2);\
+ _mm_store_si128(( __m128i*)(outptr+48), temp); /*store y6, y7*/
+
+
+ /*Memcpy to do 16byte alignment. */
+ memcpy((char*)quantptrSSE, (char*)compptr->dct_table, sizeof(quantptrSSE));
+ memcpy((char*)coef_blockSSE, (char*)coef_block, sizeof(coef_blockSSE));
+
+ wsptr = (short *)workspaceSSE;
+ outptr = (unsigned char*)workspaceSSE;
+
+ // row 0 and row 2
+ row0 = _mm_load_si128((__m128i const*)(coef_blockSSE));
+ row2 = _mm_load_si128((__m128i const*)(coef_blockSSE+8*2));
+ row0 = _mm_mullo_epi16( row0, *(__m128i const*)quantptrSSE );
+ row2 = _mm_mullo_epi16( row2, *(__m128i const*)(quantptrSSE+8*2) );
+
+ iDCT_8_2ROWs(M128_tab_i_04, M128_tab_i_26);
+
+ _mm_store_si128((__m128i*)(wsptr), row0);
+ _mm_store_si128((__m128i*)(wsptr+8*2), row2);
+
+ // row 4 and row 6
+ row0 = _mm_load_si128((__m128i const*)(coef_blockSSE+8*4));
+ row2 = _mm_load_si128((__m128i const*)(coef_blockSSE+8*6));
+ row0 = _mm_mullo_epi16(row0, *(__m128i const*)(quantptrSSE+8*4) );
+ row2 = _mm_mullo_epi16(row2, *(__m128i const*)(quantptrSSE+8*6) );
+
+ iDCT_8_2ROWs(M128_tab_i_04, M128_tab_i_26);
+
+ _mm_store_si128((__m128i*)(wsptr+32), row0);
+ _mm_store_si128((__m128i*)(wsptr+48), row2);
+
+ // row 3 and row 1
+ row0 = _mm_load_si128((__m128i const*)(coef_blockSSE+8*3));
+ row2 = _mm_load_si128((__m128i const*)(coef_blockSSE+8*1));
+ row0 = _mm_mullo_epi16(row0, *(__m128i const*)(quantptrSSE+24) );
+ row2 = _mm_mullo_epi16(row2, *(__m128i const*)(quantptrSSE+8) );
+
+ iDCT_8_2ROWs(M128_tab_i_35, M128_tab_i_17);
+
+ _mm_store_si128((__m128i*)(wsptr+24), row0);
+ _mm_store_si128((__m128i*)(wsptr+8), row2);
+
+ // row 5 and row 7
+ row0 = _mm_load_si128((__m128i const*)(coef_blockSSE+8*5));
+ row2 = _mm_load_si128((__m128i const*)(coef_blockSSE+8*7));
+ row0 = _mm_mullo_epi16(row0, *(__m128i const*)(quantptrSSE+40) );
+ row2 = _mm_mullo_epi16(row2, *(__m128i const*)(quantptrSSE+56));
+
+ iDCT_8_2ROWs( M128_tab_i_35, M128_tab_i_17);
+
+ iDCT_8_COL();
+
+ for(ctr = 0; ctr < DCTSIZE; ctr++)
+ {
+ outptrTemp = output_buf[ctr] + output_col;
+ memcpy(outptrTemp, outptr, DCTSIZE);
+ outptr += DCTSIZE; /* advance pointer to next row */
+ }
+
+ return;
+}
+#endif /* ANDROID_INTELSSE2_IDCT */
diff --git a/distrib/jpeg-6b/jmorecfg.h b/distrib/jpeg-6b/jmorecfg.h
index 9dfde01..95df28b 100644
--- a/distrib/jpeg-6b/jmorecfg.h
+++ b/distrib/jpeg-6b/jmorecfg.h
@@ -366,8 +366,12 @@ typedef int boolean;
*/
#ifndef MULTIPLIER
+#ifdef ANDROID_INTELSSE2_IDCT
+ #define MULTIPLIER short
+#else
#define MULTIPLIER int /* type for fastest integer multiply */
#endif
+#endif
/* FAST_FLOAT should be either float or double, whichever is done faster
diff --git a/distrib/jpeg-6b/sources.make b/distrib/jpeg-6b/sources.make
index 5139fce..57c7d47 100644
--- a/distrib/jpeg-6b/sources.make
+++ b/distrib/jpeg-6b/sources.make
@@ -7,7 +7,7 @@ LIBJPEG_SOURCES := jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.
jdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c \
jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \
jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c jquant1.c \
- jquant2.c jutils.c jmemmgr.c
+ jquant2.c jutils.c jmemmgr.c jidctintelsse.c
# jmem-ashmem.c doesn't compile for Windows.
#LIBJPEG_CFLAGS += -DUSE_ANDROID_ASHMEM
@@ -19,6 +19,7 @@ LIBJPEG_SOURCES += jmem-android.c
LIBJPEG_CFLAGS += -DAVOID_TABLES
LIBJPEG_CFLAGS += -O3 -fstrict-aliasing
+LIBJPEG_CFLAGS += -DANDROID_INTELSSE2_IDCT -msse2
#LIBJPEG_CFLAGS += -march=armv6j
# enable tile based decode
diff --git a/distrib/kernel-toolchain/toolbox.sh b/distrib/kernel-toolchain/toolbox.sh
index 94e89b2..89b49bb 100755
--- a/distrib/kernel-toolchain/toolbox.sh
+++ b/distrib/kernel-toolchain/toolbox.sh
@@ -1,17 +1,17 @@
#!/bin/sh
#
-# This is a wrapper around our x86 toolchain that allows us to add a few
+# This is a wrapper around our toolchain that allows us to add a few
# compiler flags.
-# The issue is that our x86 toolchain is NDK-compatible, and hence enforces
-# -mfpmath=sse and -fpic by default. When building the kernel, we need to
-# disable this.
+# The issue is that our toolchain are NDK-compatible, and hence enforces
+# -fpic (and also -mfpmath=sse for x86) by default. When building the
+# kernel, we need to disable this.
#
# Also support ccache compilation if USE_CCACHE is defined as "1"
#
# REAL_CROSS_COMPILE must be defined, and its value must be one of the
# CROSS_COMPILE values that are supported by the Kernel build system
-# (e.g. "i686-android-linux-")
+# (e.g. "i686-linux-android-")
#
if [ -z "$REAL_CROSS_COMPILE" ]; then
echo "ERROR: The REAL_CROSS_COMPILE environment variable should be defined!"
@@ -43,9 +43,13 @@ PROGSUFFIX=${PROGNAME##$PROGPREFIX}
EXTRA_FLAGS=
-# Special case #1: For x86, disable SSE FPU arithmetic, and PIC code
-if [ "$ARCH" = "x86" -a "$PROGSUFFIX" = gcc ]; then
- EXTRA_FLAGS=$EXTRA_FLAGS" -mfpmath=387 -fno-pic"
+if [ "$PROGSUFFIX" = gcc ]; then
+ # Special case #1: For all, disable PIC code
+ EXTRA_FLAGS=$EXTRA_FLAGS" -fno-pic"
+ if [ "$ARCH" = "x86" ]; then
+ # Special case #2: For x86, disable SSE FPU arithmetic too
+ EXTRA_FLAGS=$EXTRA_FLAGS" -mfpmath=387"
+ fi
fi
# Invoke real cross-compiler toolchain program now
diff --git a/distrib/libpng-1.2.19/sources.make b/distrib/libpng-1.2.19/sources.make
index f512f7b..4d11126 100644
--- a/distrib/libpng-1.2.19/sources.make
+++ b/distrib/libpng-1.2.19/sources.make
@@ -7,8 +7,10 @@ LIBPNG_SOURCES := png.c pngerror.c pngget.c pngmem.c pngpread.c pngread.c \
# Enable MMX code path for x86, except on Darwin where it fails
PNG_MMX := no
ifeq ($(HOST_ARCH),x86)
+ifneq ($(BUILD_DEBUG_EMULATOR),true)
PNG_MMX := yes
endif
+endif
ifeq ($(HOST_OS),darwin)
PNG_MMX := no
endif
@@ -20,4 +22,3 @@ else
endif
LIBPNG_SOURCES := $(LIBPNG_SOURCES:%=$(LIBPNG_DIR)/%)
-
diff --git a/distrib/sdl-1.2.12/CREDITS b/distrib/sdl-1.2.12/CREDITS
deleted file mode 100644
index 7a21c12..0000000
--- a/distrib/sdl-1.2.12/CREDITS
+++ /dev/null
@@ -1,92 +0,0 @@
-
-Simple DirectMedia Layer CREDITS
-Thanks to everyone who made this possible, including:
-
-* Cliff Matthews, for giving me a reason to start this project. :)
- -- Executor rocks! *grin*
-
-* Scott Call, for making a home for SDL on the 'Net... Thanks! :)
-
-* The Linux Fund, C Magazine, Educational Technology Resources Inc.,
- Gareth Noyce, Jesse Pavel, Keith Kitchin, Jeremy Horvath, Thomas Nicholson,
- Hans-Peter Gygax, the Eternal Lands Development Team, Lars Brubaker,
- and Phoenix Kokido for financial contributions
-
-* Gaëtan de Menten for writing the PHP and SQL behind the SDL website
-
-* Tim Jones for the new look of the SDL website
-
-* Marco Kraus for setting up SDL merchandise
-
-* Martin Donlon for his work on the SDL Documentation Project
-
-* Ryan Gordon for helping everybody out and keeping the dream alive. :)
-
-* Mattias Engdegård, for help with the Solaris port and lots of other help
-
-* Max Watson, Matt Slot, and Kyle for help with the MacOS Classic port
-
-* Stan Shebs, for the initial Mac OS X port
-
-* Eric Wing, Max Horn, and Darrell Walisser for unflagging work on the Mac OS X port
-
-* Patrick Trainor, Jim Boucher, and Mike Gorchak for the QNX Neutrino port
-
-* Carsten Griwodz for the AIX port
-
-* Gabriele Greco, for the Amiga port
-
-* Patrice Mandin, for the Atari port
-
-* Hannu Viitala for the EPOC port
-
-* Marcus Mertama for the S60 port.
-
-* Peter Valchev for nagging me about the OpenBSD port until I got it right. :)
-
-* Kent B Mein, for a place to do the IRIX port
-
-* Ash, for a place to do the OSF/1 Alpha port
-
-* David Sowsy, for help with the BeOS port
-
-* Eugenia Loli, for endless work on porting SDL games to BeOS
-
-* Jon Taylor for the GGI front-end
-
-* Paulus Esterhazy, for the Visual C++ testing and libraries
-
-* Brenda Tantzen, for Metrowerks CodeWarrior on MacOS
-
-* Chris Nentwich, for the Hermes assembly blitters
-
-* Michael Vance and Jim Kutter for the X11 OpenGL support
-
-* Stephane Peter, for the AAlib front-end and multi-threaded timer idea.
-
-* Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation
-
-* Peter Wiklund, for the 1998 winning SDL logo,
- and Arto Hamara, Steven Wong, and Kent Mein for other logo entries.
-
-* Arne Claus, for the 2004 winning SDL logo,
- and Shandy Brown, Jac, Alex Lyman, Mikkel Gjoel, #Guy, Jonas Hartmann,
- Daniel Liljeberg, Ronald Sowa, DocD, Pekka Jaervinen, Patrick Avella,
- Erkki Kontilla, Levon Gavalian, Hal Emerich, David Wiktorsson,
- S. Schury and F. Hufsky, Ciska de Ruyver, Shredweat, Tyler Montbriand,
- Martin Andersson, Merlyn Wysard, Fernando Ibanez, David Miller,
- Andre Bommele, lovesby.com, Francisco Camenforte Torres, and David Igreja
- for other logo entries.
-
-* Bob Pendleton and David Olofson for being long time contributors to
- the SDL mailing list.
-
-* Everybody at Loki Software, Inc. for their great contributions!
-
- And a big hand to everyone else who gave me appreciation, advice,
- and suggestions, especially the good folks on the SDL mailing list.
-
-THANKS! :)
-
- -- Sam Lantinga <slouken@libsdl.org>
-
diff --git a/distrib/sdl-1.2.12/Makefile b/distrib/sdl-1.2.12/Makefile
deleted file mode 100644
index 3bca609..0000000
--- a/distrib/sdl-1.2.12/Makefile
+++ /dev/null
@@ -1,71 +0,0 @@
-# Copyright (C) 2008 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# this is a set of definitions that allow the usage of Makefile.android
-# even if we're not using the Android build system.
-#
-
-OBJS_DIR := objs
-CONFIG_MAKE := $(OBJS_DIR)/config.make
-CONFIG_H := $(OBJS_DIR)/config-host.h
-
-ifeq ($(wildcard $(CONFIG_MAKE)),)
- $(error "The configuration file '$(CONFIG_MAKE)' doesnt' exist, please run the "android-configure.sh" script)
-endif
-
-include $(CONFIG_MAKE)
-
-ifeq ($(strip $(BUILD_SYSTEM)),)
- $(error "The BUILD_SYSTEM variable was not defined by your configuration sub-makefile. Aborting")
-endif
-
-include $(BUILD_SYSTEM)/definitions.make
-
-VPATH := $(OBJS_DIR)
-VPATH += :$(SRC_PATH)/include
-VPATH += :$(SRC_PATH)
-
-.PHONY: all libraries executables clean clean-config clean-objs-dir \
- clean-executables clean-libraries
-
-CLEAR_VARS := $(BUILD_SYSTEM)/clear_vars.make
-BUILD_HOST_EXECUTABLE := $(BUILD_SYSTEM)/host_executable.make
-BUILD_HOST_STATIC_LIBRARY := $(BUILD_SYSTEM)/host_static_library.make
-
-DEPENDENCY_DIRS :=
-
-all: libraries executables
-EXECUTABLES :=
-LIBRARIES :=
-
-clean: clean-intermediates
-
-distclean: clean clean-config
-
-# let's roll
-include Makefile.android
-
-libraries: $(LIBRARIES)
-executables: $(EXECUTABLES)
-
-clean-intermediates:
- rm -rf $(OBJS_DIR)/intermediates $(EXECUTABLES) $(LIBRARIES)
-
-clean-config:
- rm -f $(CONFIG_MAKE) $(CONFIG_H)
-
-# include dependency information
-DEPENDENCY_DIRS := $(sort $(DEPENDENCY_DIRS))
--include $(wildcard $(DEPENDENCY_DIRS:%=%/*.d))
diff --git a/distrib/sdl-1.2.12/README.ANDROID b/distrib/sdl-1.2.12/README.ANDROID
deleted file mode 100644
index ae7f4aa..0000000
--- a/distrib/sdl-1.2.12/README.ANDROID
+++ /dev/null
@@ -1,9 +0,0 @@
-This is a modified version of SDL 1.2.12 that is used by the Android QEMU emulator.
-The modifications are the following:
-
-To build it as a static library on Linux, OS X and Windows:
-
-./android-configure.sh [--prefix=<path>]
-make -j2
-make install
-
diff --git a/distrib/sdl-1.2.12/android-configure.sh b/distrib/sdl-1.2.12/android-configure.sh
deleted file mode 100755
index 95bb91f..0000000
--- a/distrib/sdl-1.2.12/android-configure.sh
+++ /dev/null
@@ -1,553 +0,0 @@
-#/bin/sh
-#
-# this script is used to rebuild SDL from sources in the current
-# directory. It depends on the Android emulator build scripts
-# that should normally be located in ../emulator/android/build
-# but you can also use ANDROID_QEMU_PATH in your environment
-# to point to the top of the Android emulator sources
-#
-#
-
-# first, let's see which system we're running this on
-cd `dirname $0`
-
-# try to find the Android build directory automatically
-if [ -z "$ANDROID_QEMU_PATH" ] ; then
- if [ -f ../../android/build/common.sh ] ; then
- ANDROID_QEMU_PATH=../..
- else
- echo "You must define ANDROID_QEMU_PATH in your environment to point"
- echo "to the directory containing the Android emulator's sources."
- exit 1
- fi
-fi
-
-if [ ! -d $ANDROID_QEMU_PATH ] ; then
- echo "Your ANDROID_QEMU_PATH does not point to a valid directory."
- exit 1
-fi
-
-if [ ! -f $ANDROID_QEMU_PATH/android/build/common.sh ] ; then
- echo "Your ANDROID_QEMU_PATH does not point to a directory that"
- echo "contains the Android emulator build scripts."
- exit 1
-fi
-
-# source common functions definitions
-. $ANDROID_QEMU_PATH/android/build/common.sh
-
-# Parse options
-OPTION_TRY_64=no
-OPTION_HELP=no
-OPTION_TARGETS=
-OPTION_FORCE_AUTODETECT=no
-OPTION_NO_TIGER=no
-
-if [ -z "$CC" ] ; then
- CC=gcc
-fi
-
-for opt do
- optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
- case "$opt" in
- --help|-h|-\?) OPTION_HELP=yes
- ;;
- --verbose)
- if [ "$VERBOSE" = "yes" ] ; then
- VERBOSE2=yes
- else
- VERBOSE=yes
- fi
- ;;
- --cc=*) CC="$optarg" ; HOSTCC=$CC
- ;;
- --try-64) OPTION_TRY_64=yes
- ;;
- --prefix=*) OPTION_TARGETS="$OPTION_TARGETS $optarg"
- ;;
- --force-autodetect) OPTION_FORCE_AUTODETECT=yes
- ;;
- --no-tiger) OPTION_NO_TIGER=yes
- ;;
- *)
- echo "unknown option '$opt', use --help"
- exit 1
- esac
-done
-
-# Print the help message
-#
-if [ "$OPTION_HELP" = "yes" ] ; then
- cat << EOF
-
-Usage: rebuild.sh [options]
-Options: [defaults in brackets after descriptions]
-EOF
- echo "Standard options:"
- echo " --help print this message"
- echo " --cc=PATH specify C compiler [$CC]"
- echo " --try-64 try to build a 64-bit executable (may crash)"
- echo " --verbose verbose configuration"
- echo " --force-autodetect force feature auto-detection"
- echo " --no-tiger do not generate Tiger-compatible binaries (OS X only)"
- echo ""
- exit 1
-fi
-
-# we only support generating 32-bit binaris on 64-bit systems.
-# And we may need to add a -Wa,--32 to CFLAGS to let the assembler
-# generate 32-bit binaries on Linux x86_64.
-#
-if [ "$OPTION_TRY_64" != "yes" ] ; then
- force_32bit_binaries
-fi
-
-# default target
-if [ -z "$OPTION_TARGETS" ] ; then
- OPTION_TARGETS=out/$OS
-fi
-
-# we can build SDL with Cygwin, so enable it
-enable_cygwin
-
-setup_toolchain
-
-###
-### Special compiler and linker flags
-###
-
-case "$OS" in
- linux-*)
- BUILD_CFLAGS="-D_GNU_SOURCE=1 -fvisibility=hidden -DXTHREADS -D_REENTRANT"
- # prevent -fstack-protector or the generated binaries will not link
- BUILD_CFLAGS="$BUILD_CFLAGS -fno-stack-protector"
- ;;
- darwin-*)
- BUILD_CFLAGS="-D_GNU_SOURCE=1 -fvisibility=hidden -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings"
- # detect the 10.4 SDK and use it automatically
- TIGER_SDK=/Developer/SDKs/MacOSX10.4u.sdk
- if [ ! -d $TIGER_SDK -a $OPTION_NO_TIGER = no ] ; then
- echo "Please install the 10.4 SDK at $TIGER_SDK to generate Tiger-compatible binaries."
- echo "If you don't want compatibility, use --no-tiger option instead."
- exit 1
- fi
- if [ -d $TIGER_SDK ] ; then
- TIGER_OPTS="-isysroot $TIGER_SDK -mmacosx-version-min=10.4"
- BUILD_CFLAGS="$BUILD_CFLAGS $TIGER_OPTS"
- BUILD_LDFLAGS="$BUILD_LDFLAGS $TIGER_OPTS -Wl,-syslibroot,$(TIGER_SDK)"
- echo "Using OS X 10.4 SDK to generate Tiger-compatible binaries."
- else
- echo "Warning: the generated binaries will not be compatible with Tiger."
- fi
- ;;
- windows)
- BUILD_CFLAGS="-D_GNU_SOURCE=1"
- ;;
- *)
- BUILD_CFLAGS=
-esac
-
-# BUILD_CFLAGS are used to build SDL, but SDL_CFLAGS are used
-# when clients want to use its facilities
-#
-case "$HOST_OS" in
- linux)
- SDL_CFLAGS="-D_GNU_SOURCE=1 -D_REENTRANT"
- SDL_STATIC_LIBS="-lm -ldl -lpthread -lrt"
- ;;
- darwin)
- SDL_CFLAGS="-D_GNU_SOURCE=1 -D_THREAD_SAFE"
- SDL_STATIC_LIBS="-Wl,-framework,OpenGL -Wl,-framework,Cocoa -Wl,-framework,QuickTime -Wl,-framework,ApplicationServices -Wl,-framework,Carbon -Wl,-framework,IOKit"
- ;;
- windows)
- SDL_CFLAGS="-D_GNU_SOURCE=1 -Dmain=SDL_main"
- SDL_STATIC_LIBS="-luser32 -lgdi32 -lwinmm"
- ;;
- *)
- SDL_CFLAGS=
- SDL_STATIC_LIBS=
-esac
-
-DOLLAR="$"
-SDL_STATIC_LIBS="$DOLLAR{libdir}/libSDLmain.a $DOLLAR{libdir}/libSDL.a $SDL_STATIC_LIBS"
-
-###
-### Features probes
-###
-
-CONFIG_LIBC=yes
-
-###
-### Configuration files generation
-###
-
-# create the objs directory that is going to contain all generated files
-# including the configuration ones
-#
-mkdir -p objs
-
-config_add ()
-{
- echo "$1" >> $config_h
-}
-
-# used to add a macro define/undef line to the configuration
-# $1: macro name
-# $2: 1, 0, yes or no
-# $3: optional log prefix
-config_add_macro ()
-{
- local logname
- logname="${3:-CfgMacro }"
- case "$2" in
- 0|no|false)
- config_add "/* #undef $1 */"
- log "$logname: $1=0"
- ;;
- 1|yes|true)
- config_add "#define $1 1"
- log "$logname: $1=1"
- ;;
- esac
-}
-
-# used to add host-os-specific driver macros to the config file
-# $1 : driver prefix, e.g. DRIVERS_VIDEO
-# $2 : macro prefix
-# this will look for DRIVERS_VIDEO_${HOST_OS}, and, if it is not
-# defined in DRIVERS_VIDEO_default
-#
-# then this will call 'config_add ${2}_${driver}' for each driver listed
-#
-config_add_driver_macros ()
-{
- local driver_list="`var_value ${1}_${HOST_OS}`"
- local driver_name
- if [ -z "$driver_list" ] ; then
- driver_list="`var_value ${1}_default`"
- fi
- for driver_name in $driver_list; do
- config_add_macro "${2}_${driver_name}" yes
- done
-}
-
-config_h=objs/SDL_config.h
-
-# a function used to check the availability of a given Standard C header
-# $1 : header name, without the .h suffix nor enclosing brackets (e.g. 'memory' for <memory.h>)
-# this will update the configuration with a relevant line
-sdl_check_header ()
-{
- local result
- local header
- local macro
- header="<$1.h>"
- macro=`to_uppercase $1`
- macro=`echo $macro | tr '/' '_'`
- feature_check_header result "$header"
- config_add_macro HAVE_${macro}_H $result "StdCHeader "
-}
-
-# call sdl_check_header with a list of header names
-sdl_check_headers ()
-{
- for hh in $*; do
- sdl_check_header "$hh"
- done
-}
-
-# a function used to check that a given function is available in the C library
-# this will update the configuration with a relevant line
-# $1: function name
-# $2: optional, libraries to link against
-#
-sdl_check_func ()
-{
- local result
- local funcname
- local macro
- funcname="$1"
- macro=`to_uppercase $1`
- rm -f $TMPC
- cat > $TMPC <<EOF
-#undef $funcname
-#define $funcname _innocuous_$funcname
-#include <assert.h>
-#undef $funcname
-
-typedef void (*func_t)(void);
-extern void $funcname(void);
-func_t _dummy = $funcname;
-int main(void)
-{
- return _dummy == $funcname;
-}
-EOF
- EXTRA_LDFLAGS="$2"
- feature_check_link result
- config_add_macro HAVE_${macro} $result "StdCFunc "
-}
-
-# call sdl_check_func with a list of functions
-sdl_check_funcs ()
-{
- for ff in $*; do
- sdl_check_func "$ff"
- done
-}
-
-# check endianess of the host platform
-sdl_check_endianess ()
-{
- cat > $TMPC <<EOF
- int main(void)
- {
- union {
- unsigned short v;
- unsigned char b[2];
- } u;
-
- u.v = 0x1234;
- return (u.b[0] == 0x12);
- }
-EOF
- feature_run_exec test_e
- if [ "$test_e" = "1" ] ; then
- eval $1=4321
- else
- eval $1=1234
- fi
-}
-
-
-generate_SDL_config_h ()
-{
- echo "/* This file was autogenerated by '$PROGNAME' - do not edit */" > $config_h
-
- config_add "#ifndef _SDL_config_h"
- config_add "#define _SDL_config_h"
- config_add ""
- config_add "#include \"SDL_platform.h\""
- config_add ""
-
- # true for all architectures these days
- config_add_macro SDL_HAS_64BIT_TYPE 1
-
- sdl_check_endianess ENDIANESS
- config_add "#define SDL_BYTEORDER $ENDIANESS"
- config_add ""
-
- config_add_macro HAVE_LIBC $CONFIG_LIBC
-
- config_add "#if HAVE_LIBC"
- config_add ""
- config_add "/* Useful headers */"
-
- sdl_check_headers alloca sys/types stdio
-
- # just like configure - force it to 1
- config_add "#define STDC_HEADERS 1"
-
- sdl_check_headers stdlib stdarg malloc memory string strings inttypes stdint ctype math iconv signal altivec
-
- config_add "/* C library functions */"
-
- sdl_check_funcs malloc calloc realloc free alloc
-
- config_add "#ifndef _WIN32 /* Don't use on Windows */"
-
- sdl_check_funcs getenv putenv unsetenv
-
- config_add "#endif"
- sdl_check_funcs qsort abs bcopy memset memcpy memmove memcmp strlen strlcpy strlcat
- sdl_check_funcs strdup _strrev _strupr _strlwr index rindex strchr strrchr itoa _ltoa
- sdl_check_funcs _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull
- sdl_check_funcs strtod atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp
- sdl_check_funcs vsnprintf iconv sigaction setjmp nanosleep
-
- sdl_check_func clock_gettime -lrt
- sdl_check_func dlvsym -ldl
-
- sdl_check_funcs getpagesize
-
- config_add "#else"
- config_add "/* We may need some replacement for stdarg.h here */"
- config_add "#include <stdarg.h>"
- config_add "#endif /* HAVE_LIBC */"
- config_add ""
-
- config_add "/* Allow disabling of core subsystems */"
-
- config_add_macro SDL_AUDIO_DISABLED yes
- config_add_macro SDL_CDROM_DISABLED yes
- config_add_macro SDL_CPUINFO_DISABLED no
- config_add_macro SDL_EVENTS_DISABLED no
- config_add_macro SDL_FILE_DISABLED yes
- config_add_macro SDL_JOYSTICK_DISABLED yes
- config_add_macro SDL_LOADSO_DISABLED no
- config_add_macro SDL_THREADS_DISABLED no
- config_add_macro SDL_TIMERS_DISABLED no
- config_add_macro SDL_VIDEO_DISABLED no
-
- config_add ""
- config_add "/* Enable various shared object loading systems */"
-
- config_add_driver_macros DRIVERS_LOADSO SDL_LOADSO
-
- config_add ""
- config_add "/* Enable various threading systems */"
-
- config_add_driver_macros DRIVERS_THREAD SDL_THREAD
-
- config_add ""
- config_add "/* Enable various timer systems */"
-
- config_add_driver_macros DRIVERS_TIMER SDL_TIMER
-
- config_add ""
- config_add "/* Enable various video drivers */"
-
- config_add_driver_macros DRIVERS_VIDEO SDL_VIDEO_DRIVER
-
- config_add_driver_macros DRIVERS_MAIN SDL_MAIN
-
- # the following defines are good enough for all recent Unix distributions
- config_add "#define SDL_VIDEO_DRIVER_X11_DYNAMIC \"libX11.so.6\""
- config_add "#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT \"libXext.so.6\""
- config_add "#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR \"libXrandr.so.2\""
- config_add "#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER \"libXrender.so.1\""
-
- # todo: OpenGL support ?
- # todo: Assembly routines support ?
-
- config_add "#endif /* _SDL_config_h */"
-}
-
-### Build the config sub-makefile
-###
-
-make_add ()
-{
- echo "$1" >> $config_mk
-}
-
-make_add_driver_macros ()
-{
- local driver_list="`var_value ${1}_${HOST_OS}`"
- local driver_name
- if [ -z "$driver_list" ] ; then
- driver_list="`var_value ${1}_default`"
- fi
- for driver_name in $driver_list; do
- make_add "SDL_$2_${driver_name} := yes"
- done
-}
-
-generate_sdl_config_mk ()
-{
- CFLAGS="$CFLAGS $BUILD_CFLAGS"
- LDFLAGS="$LDFLAGS $BUILD_LDFLAGS"
- create_config_mk
-
- make_add ""
- PWD=`pwd`
- make_add "SRC_PATH=$PWD"
- make_add "BUILD_SYSTEM=$ANDROID_QEMU_PATH/android/build"
-
- make_add "SDL_CONFIG_LIBC := $CONFIG_LIBC"
- make_add "SDL_CONFIG_CPUINFO := yes"
-
- make_add_driver_macros DRIVERS_LOADSO CONFIG_LOADSO
- make_add_driver_macros DRIVERS_THREAD CONFIG_THREAD
- make_add_driver_macros DRIVERS_TIMER CONFIG_TIMER
- make_add_driver_macros DRIVERS_VIDEO CONFIG_VIDEO
-
- make_add_driver_macros DRIVERS_MAIN CONFIG_MAIN
-
- make_add "INSTALL_TARGETS := $OPTION_TARGETS"
-}
-
-### Build the final sdl-config script from the template
-###
-
-generate_sdl_config ()
-{
- # build a sed script that will replace all @VARIABLES@ in the template
- # with appropriate values
- rm -f $TMPC
-
- # replace @exec_prefix@ with "{prefix}", and @libdir@ with "{libdir}"
- cat > $TMPC <<EOF
-s!@exec_prefix@!\$\{prefix\}!g
-s!@libdir@!\$\{exec_prefix\}/libs!g
-s!@includedir@!\$\{prefix\}/include!g
-EOF
-
- # we want to enable static linking, do @ENABLE_STATIC_FALSE@ and @ENABLE_STATIC_TRUE@
- cat >> $TMPC <<EOF
-s!@ENABLE_STATIC_FALSE@!\#!g
-s!@ENABLE_STATIC_TRUE@!!g
-s!@ENABLE_SHARED_TRUE@!\#!g
-s!@ENABLE_SHARED_FALSE@!!g
-EOF
-
- # set the version to 1.2.12
- cat >> $TMPC <<EOF
-s!@SDL_VERSION@!1.2.12!g
-EOF
-
- #
- cat >> $TMPC <<EOF
-s!@SDL_CFLAGS@!$SDL_CFLAGS!g
-s!@SDL_STATIC_LIBS@!$SDL_STATIC_LIBS!g
-EOF
-
- cat sdl-config.in | sed -f $TMPC > objs/sdl-config
- chmod +x objs/sdl-config
-}
-
-# copy a configuration file or perform auto-detection if one is not available
-# or the --force-autodetect option was used
-# $1: basename of config file
-# $2: command to run to perform auto-detection/generation
-#
-copy_or_autodetect ()
-{
- if [ "$OPTION_FORCE_AUTODETECT" != "yes" -a -f android/build/$OS/$1 ] ; then
- log "Setup : Copying $1 from android/build/$OS"
- cp -f android/build/$OS/$1 objs/$1
- else
- log "Setup : Auto-generating $1"
- eval $2
- fi
-}
-
-generate_all ()
-{
- copy_or_autodetect SDL_config.h generate_SDL_config_h
- generate_sdl_config_mk
- copy_or_autodetect sdl-config generate_sdl_config
-}
-
-DRIVERS_LOADSO_default=DLOPEN
-DRIVERS_LOADSO_darwin=DLCOMPAT
-DRIVERS_LOADSO_windows=WIN32
-
-# TODO: determine if PTHREAD_RECURSIVE or PTHREAD_RECURSIVE_NP is valid for the platform
-DRIVERS_THREAD_default="PTHREAD PTHREAD_RECURSIVE_MUTEX"
-DRIVERS_THREAD_linux="PTHREAD PTHREAD_RECURSIVE_MUTEX_NP"
-DRIVERS_THREAD_windows=WIN32
-
-DRIVERS_TIMER_default=UNIX
-DRIVERS_TIMER_windows=WIN32
-
-# TODO: actually compute this properly for X11 and dynamic loading !!
-DRIVERS_VIDEO_default="X11 X11_DPMS X11_XINERAMA X11_XME"
-DRIVERS_VIDEO_darwin="QUARTZ"
-DRIVERS_VIDEO_windows="WINDIB"
-
-DRIVERS_MAIN_default=DUMMY
-DRIVERS_MAIN_darwin=MACOSX
-DRIVERS_MAIN_windows=WIN32
-
-generate_all
diff --git a/distrib/sdl-1.2.12/include/SDL.h b/distrib/sdl-1.2.12/include/SDL.h
deleted file mode 100644
index 60ac26c..0000000
--- a/distrib/sdl-1.2.12/include/SDL.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* Main include header for the SDL library */
-
-#ifndef _SDL_H
-#define _SDL_H
-
-#include "SDL_main.h"
-#include "SDL_stdinc.h"
-#include "SDL_audio.h"
-#include "SDL_cdrom.h"
-#include "SDL_cpuinfo.h"
-#include "SDL_endian.h"
-#include "SDL_error.h"
-#include "SDL_events.h"
-#include "SDL_loadso.h"
-#include "SDL_mutex.h"
-#include "SDL_rwops.h"
-#include "SDL_thread.h"
-#include "SDL_timer.h"
-#include "SDL_video.h"
-#include "SDL_version.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* As of version 0.5, SDL is loaded dynamically into the application */
-
-/* These are the flags which may be passed to SDL_Init() -- you should
- specify the subsystems which you will be using in your application.
-*/
-#define SDL_INIT_TIMER 0x00000001
-#define SDL_INIT_AUDIO 0x00000010
-#define SDL_INIT_VIDEO 0x00000020
-#define SDL_INIT_CDROM 0x00000100
-#define SDL_INIT_JOYSTICK 0x00000200
-#define SDL_INIT_NOPARACHUTE 0x00100000 /* Don't catch fatal signals */
-#define SDL_INIT_EVENTTHREAD 0x01000000 /* Not supported on all OS's */
-#define SDL_INIT_EVERYTHING 0x0000FFFF
-
-/* This function loads the SDL dynamically linked library and initializes
- * the subsystems specified by 'flags' (and those satisfying dependencies)
- * Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
- * signal handlers for some commonly ignored fatal signals (like SIGSEGV)
- */
-extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
-
-/* This function initializes specific SDL subsystems */
-extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
-
-/* This function cleans up specific SDL subsystems */
-extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
-
-/* This function returns mask of the specified subsystems which have
- been initialized.
- If 'flags' is 0, it returns a mask of all initialized subsystems.
-*/
-extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
-
-/* This function cleans up all initialized subsystems and unloads the
- * dynamically linked library. You should call it upon all exit conditions.
- */
-extern DECLSPEC void SDLCALL SDL_Quit(void);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_H */
diff --git a/distrib/sdl-1.2.12/include/SDL_active.h b/distrib/sdl-1.2.12/include/SDL_active.h
deleted file mode 100644
index 2cf474c..0000000
--- a/distrib/sdl-1.2.12/include/SDL_active.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* Include file for SDL application focus event handling */
-
-#ifndef _SDL_active_h
-#define _SDL_active_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* The available application states */
-#define SDL_APPMOUSEFOCUS 0x01 /* The app has mouse coverage */
-#define SDL_APPINPUTFOCUS 0x02 /* The app has input focus */
-#define SDL_APPACTIVE 0x04 /* The application is active */
-
-/* Function prototypes */
-/*
- * This function returns the current state of the application, which is a
- * bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and
- * SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to
- * see your application, otherwise it has been iconified or disabled.
- */
-extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_active_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_audio.h b/distrib/sdl-1.2.12/include/SDL_audio.h
deleted file mode 100644
index 68ec475..0000000
--- a/distrib/sdl-1.2.12/include/SDL_audio.h
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* Access to the raw audio mixing buffer for the SDL library */
-
-#ifndef _SDL_audio_h
-#define _SDL_audio_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-#include "SDL_endian.h"
-#include "SDL_mutex.h"
-#include "SDL_thread.h"
-#include "SDL_rwops.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* The calculated values in this structure are calculated by SDL_OpenAudio() */
-typedef struct SDL_AudioSpec {
- int freq; /* DSP frequency -- samples per second */
- Uint16 format; /* Audio data format */
- Uint8 channels; /* Number of channels: 1 mono, 2 stereo */
- Uint8 silence; /* Audio buffer silence value (calculated) */
- Uint16 samples; /* Audio buffer size in samples (power of 2) */
- Uint16 padding; /* Necessary for some compile environments */
- Uint32 size; /* Audio buffer size in bytes (calculated) */
- /* This function is called when the audio device needs more data.
- 'stream' is a pointer to the audio data buffer
- 'len' is the length of that buffer in bytes.
- Once the callback returns, the buffer will no longer be valid.
- Stereo samples are stored in a LRLRLR ordering.
- */
- void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len);
- void *userdata;
-} SDL_AudioSpec;
-
-/* 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
-
-/* Native audio byte ordering */
-#if SDL_BYTEORDER == SDL_LIL_ENDIAN
-#define AUDIO_U16SYS AUDIO_U16LSB
-#define AUDIO_S16SYS AUDIO_S16LSB
-#else
-#define AUDIO_U16SYS AUDIO_U16MSB
-#define AUDIO_S16SYS AUDIO_S16MSB
-#endif
-
-
-/* A structure to hold a set of audio conversion filters and buffers */
-typedef struct SDL_AudioCVT {
- int needed; /* Set to 1 if conversion possible */
- Uint16 src_format; /* Source audio format */
- Uint16 dst_format; /* Target audio format */
- double rate_incr; /* Rate conversion increment */
- Uint8 *buf; /* Buffer to hold entire audio data */
- int len; /* Length of original audio buffer */
- int len_cvt; /* Length of converted audio buffer */
- int len_mult; /* buffer must be len*len_mult big */
- double len_ratio; /* Given len, final size is len*len_ratio */
- void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
- int filter_index; /* Current audio conversion function */
-} SDL_AudioCVT;
-
-
-/* Function prototypes */
-
-/* These functions are used internally, and should not be used unless you
- * have a specific need to specify the audio driver you want to use.
- * You should normally use SDL_Init() or SDL_InitSubSystem().
- */
-extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name);
-extern DECLSPEC void SDLCALL SDL_AudioQuit(void);
-
-/* This function fills the given character buffer with the name of the
- * current audio driver, and returns a pointer to it if the audio driver has
- * been initialized. It returns NULL if no driver has been initialized.
- */
-extern DECLSPEC char * SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen);
-
-/*
- * This function opens the audio device with the desired parameters, and
- * returns 0 if successful, placing the actual hardware parameters in the
- * structure pointed to by 'obtained'. If 'obtained' is NULL, the audio
- * data passed to the callback function will be guaranteed to be in the
- * requested format, and will be automatically converted to the hardware
- * audio format if necessary. This function returns -1 if it failed
- * to open the audio device, or couldn't set up the audio thread.
- *
- * When filling in the desired audio spec structure,
- * 'desired->freq' should be the desired audio frequency in samples-per-second.
- * 'desired->format' should be the desired audio format.
- * 'desired->samples' is the desired size of the audio buffer, in samples.
- * This number should be a power of two, and may be adjusted by the audio
- * driver to a value more suitable for the hardware. Good values seem to
- * range between 512 and 8096 inclusive, depending on the application and
- * CPU speed. Smaller values yield faster response time, but can lead
- * to underflow if the application is doing heavy processing and cannot
- * fill the audio buffer in time. A stereo sample consists of both right
- * and left channels in LR ordering.
- * Note that the number of samples is directly related to time by the
- * following formula: ms = (samples*1000)/freq
- * 'desired->size' is the size in bytes of the audio buffer, and is
- * calculated by SDL_OpenAudio().
- * 'desired->silence' is the value used to set the buffer to silence,
- * and is calculated by SDL_OpenAudio().
- * 'desired->callback' should be set to a function that will be called
- * when the audio device is ready for more data. It is passed a pointer
- * to the audio buffer, and the length in bytes of the audio buffer.
- * This function usually runs in a separate thread, and so you should
- * protect data structures that it accesses by calling SDL_LockAudio()
- * and SDL_UnlockAudio() in your code.
- * 'desired->userdata' is passed as the first parameter to your callback
- * function.
- *
- * The audio device starts out playing silence when it's opened, and should
- * be enabled for playing by calling SDL_PauseAudio(0) when you are ready
- * for your audio callback function to be called. Since the audio driver
- * may modify the requested size of the audio buffer, you should allocate
- * any local mixing buffers after you open the audio device.
- */
-extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained);
-
-/*
- * Get the current audio state:
- */
-typedef enum {
- SDL_AUDIO_STOPPED = 0,
- SDL_AUDIO_PLAYING,
- SDL_AUDIO_PAUSED
-} SDL_audiostatus;
-extern DECLSPEC SDL_audiostatus SDLCALL SDL_GetAudioStatus(void);
-
-/*
- * This function pauses and unpauses the audio callback processing.
- * It should be called with a parameter of 0 after opening the audio
- * device to start playing sound. This is so you can safely initialize
- * data for your callback function after opening the audio device.
- * Silence will be written to the audio device during the pause.
- */
-extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on);
-
-/*
- * This function loads a WAVE from the data source, automatically freeing
- * that source if 'freesrc' is non-zero. For example, to load a WAVE file,
- * you could do:
- * SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...);
- *
- * If this function succeeds, it returns the given SDL_AudioSpec,
- * filled with the audio data format of the wave data, and sets
- * 'audio_buf' to a malloc()'d buffer containing the audio data,
- * and sets 'audio_len' to the length of that audio buffer, in bytes.
- * You need to free the audio buffer with SDL_FreeWAV() when you are
- * done with it.
- *
- * This function returns NULL and sets the SDL error message if the
- * wave file cannot be opened, uses an unknown data format, or is
- * corrupt. Currently raw and MS-ADPCM WAVE files are supported.
- */
-extern DECLSPEC SDL_AudioSpec * SDLCALL SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
-
-/* Compatibility convenience function -- loads a WAV from a file */
-#define SDL_LoadWAV(file, 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()
- */
-extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 *audio_buf);
-
-/*
- * This function takes a source format and rate and a destination format
- * and rate, and initializes the 'cvt' structure with information needed
- * by SDL_ConvertAudio() to convert a buffer of audio data from one format
- * to the other.
- * This function returns 0, or -1 if there was an error.
- */
-extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT *cvt,
- Uint16 src_format, Uint8 src_channels, int src_rate,
- Uint16 dst_format, Uint8 dst_channels, int dst_rate);
-
-/* Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(),
- * created an audio buffer cvt->buf, and filled it with cvt->len bytes of
- * audio data in the source format, this function will convert it in-place
- * to the desired format.
- * The data conversion may expand the size of the audio data, so the buffer
- * cvt->buf should be allocated after the cvt structure is initialized by
- * SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long.
- */
-extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT *cvt);
-
-/*
- * This takes two audio buffers of the playing audio format and mixes
- * them, performing addition, volume adjustment, and overflow clipping.
- * The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME
- * for full audio volume. Note this does not change hardware volume.
- * This is provided for convenience -- you can mix your own audio data.
- */
-#define SDL_MIX_MAXVOLUME 128
-extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume);
-
-/*
- * The lock manipulated by these functions protects the callback function.
- * During a LockAudio/UnlockAudio pair, you can be guaranteed that the
- * callback function is not running. Do not call these from the callback
- * function or you will cause deadlock.
- */
-extern DECLSPEC void SDLCALL SDL_LockAudio(void);
-extern DECLSPEC void SDLCALL SDL_UnlockAudio(void);
-
-/*
- * This function shuts down audio processing and closes the audio device.
- */
-extern DECLSPEC void SDLCALL SDL_CloseAudio(void);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_audio_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_byteorder.h b/distrib/sdl-1.2.12/include/SDL_byteorder.h
deleted file mode 100644
index 3871cfe..0000000
--- a/distrib/sdl-1.2.12/include/SDL_byteorder.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* DEPRECATED */
-#include "SDL_endian.h"
diff --git a/distrib/sdl-1.2.12/include/SDL_cdrom.h b/distrib/sdl-1.2.12/include/SDL_cdrom.h
deleted file mode 100644
index 5f8f0c6..0000000
--- a/distrib/sdl-1.2.12/include/SDL_cdrom.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* This is the CD-audio control API for Simple DirectMedia Layer */
-
-#ifndef _SDL_cdrom_h
-#define _SDL_cdrom_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* In order to use these functions, SDL_Init() must have been called
- with the SDL_INIT_CDROM flag. This causes SDL to scan the system
- for CD-ROM drives, and load appropriate drivers.
-*/
-
-/* The maximum number of CD-ROM tracks on a disk */
-#define SDL_MAX_TRACKS 99
-
-/* The types of CD-ROM track possible */
-#define SDL_AUDIO_TRACK 0x00
-#define SDL_DATA_TRACK 0x04
-
-/* The possible states which a CD-ROM drive can be in. */
-typedef enum {
- CD_TRAYEMPTY,
- CD_STOPPED,
- CD_PLAYING,
- CD_PAUSED,
- CD_ERROR = -1
-} CDstatus;
-
-/* Given a status, returns true if there's a disk in the drive */
-#define CD_INDRIVE(status) ((int)(status) > 0)
-
-typedef struct SDL_CDtrack {
- Uint8 id; /* Track number */
- Uint8 type; /* Data or audio track */
- Uint16 unused;
- Uint32 length; /* Length, in frames, of this track */
- Uint32 offset; /* Offset, in frames, from start of disk */
-} SDL_CDtrack;
-
-/* This structure is only current as of the last call to SDL_CDStatus() */
-typedef struct SDL_CD {
- int id; /* Private drive identifier */
- CDstatus status; /* Current drive status */
-
- /* The rest of this structure is only valid if there's a CD in drive */
- int numtracks; /* Number of tracks on disk */
- int cur_track; /* Current track position */
- int cur_frame; /* Current frame offset within current track */
- SDL_CDtrack track[SDL_MAX_TRACKS+1];
-} SDL_CD;
-
-/* Conversion functions from frames to Minute/Second/Frames and vice versa */
-#define CD_FPS 75
-#define FRAMES_TO_MSF(f, M,S,F) { \
- int value = f; \
- *(F) = value%CD_FPS; \
- value /= CD_FPS; \
- *(S) = value%60; \
- value /= 60; \
- *(M) = value; \
-}
-#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F))
-
-/* CD-audio API functions: */
-
-/* Returns the number of CD-ROM drives on the system, or -1 if
- SDL_Init() has not been called with the SDL_INIT_CDROM flag.
- */
-extern DECLSPEC int SDLCALL SDL_CDNumDrives(void);
-
-/* Returns a human-readable, system-dependent identifier for the CD-ROM.
- Example:
- "/dev/cdrom"
- "E:"
- "/dev/disk/ide/1/master"
-*/
-extern DECLSPEC const char * SDLCALL SDL_CDName(int drive);
-
-/* Opens a CD-ROM drive for access. It returns a drive handle on success,
- or NULL if the drive was invalid or busy. This newly opened CD-ROM
- becomes the default CD used when other CD functions are passed a NULL
- CD-ROM handle.
- Drives are numbered starting with 0. Drive 0 is the system default CD-ROM.
-*/
-extern DECLSPEC SDL_CD * SDLCALL SDL_CDOpen(int drive);
-
-/* This function returns the current status of the given drive.
- If the drive has a CD in it, the table of contents of the CD and current
- play position of the CD will be stored in the SDL_CD structure.
-*/
-extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD *cdrom);
-
-/* Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks'
- tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play
- until the end of the CD. This function will skip data tracks.
- This function should only be called after calling SDL_CDStatus() to
- get track information about the CD.
- For example:
- // Play entire CD:
- if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
- SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
- // Play last track:
- if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
- SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0);
- }
- // Play first and second track and 10 seconds of third track:
- if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
- SDL_CDPlayTracks(cdrom, 0, 0, 2, 10);
-
- This function returns 0, or -1 if there was an error.
-*/
-extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom,
- int start_track, int start_frame, int ntracks, int nframes);
-
-/* Play the given CD starting at 'start' frame for 'length' frames.
- It returns 0, or -1 if there was an error.
-*/
-extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD *cdrom, int start, int length);
-
-/* Pause play -- returns 0, or -1 on error */
-extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD *cdrom);
-
-/* Resume play -- returns 0, or -1 on error */
-extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD *cdrom);
-
-/* Stop play -- returns 0, or -1 on error */
-extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD *cdrom);
-
-/* Eject CD-ROM -- returns 0, or -1 on error */
-extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD *cdrom);
-
-/* Closes the handle for the CD-ROM drive */
-extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD *cdrom);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_video_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_config.h.default b/distrib/sdl-1.2.12/include/SDL_config.h.default
deleted file mode 100644
index c82f42a..0000000
--- a/distrib/sdl-1.2.12/include/SDL_config.h.default
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-#ifndef _SDL_config_h
-#define _SDL_config_h
-
-#include "SDL_platform.h"
-
-/* Add any platform that doesn't build using the configure system */
-#if defined(__DREAMCAST__)
-#include "SDL_config_dreamcast.h"
-#elif defined(__MACOS__)
-#include "SDL_config_macos.h"
-#elif defined(__MACOSX__)
-#include "SDL_config_macosx.h"
-#elif defined(__SYMBIAN32__)
-#include "SDL_config_symbian.h" /* must be before win32! */
-#elif defined(__WIN32__)
-#include "SDL_config_win32.h"
-#elif defined(__OS2__)
-#include "SDL_config_os2.h"
-#else
-#include "SDL_config_minimal.h"
-#endif /* platform config */
-
-#endif /* _SDL_config_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_config.h.in b/distrib/sdl-1.2.12/include/SDL_config.h.in
deleted file mode 100644
index 13a3f9a..0000000
--- a/distrib/sdl-1.2.12/include/SDL_config.h.in
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-#ifndef _SDL_config_h
-#define _SDL_config_h
-
-/* This is a set of defines to configure the SDL features */
-
-/* General platform specific identifiers */
-#include "SDL_platform.h"
-
-/* Make sure that this isn't included by Visual C++ */
-#ifdef _MSC_VER
-#error You should copy include/SDL_config.h.default to include/SDL_config.h
-#endif
-
-/* C language features */
-#undef const
-#undef inline
-#undef volatile
-
-/* C datatypes */
-#undef size_t
-#undef int8_t
-#undef uint8_t
-#undef int16_t
-#undef uint16_t
-#undef int32_t
-#undef uint32_t
-#undef int64_t
-#undef uint64_t
-#undef uintptr_t
-#undef SDL_HAS_64BIT_TYPE
-
-/* Endianness */
-#undef SDL_BYTEORDER
-
-/* Comment this if you want to build without any C library requirements */
-#undef HAVE_LIBC
-#if HAVE_LIBC
-
-/* Useful headers */
-#undef HAVE_ALLOCA_H
-#undef HAVE_SYS_TYPES_H
-#undef HAVE_STDIO_H
-#undef STDC_HEADERS
-#undef HAVE_STDLIB_H
-#undef HAVE_STDARG_H
-#undef HAVE_MALLOC_H
-#undef HAVE_MEMORY_H
-#undef HAVE_STRING_H
-#undef HAVE_STRINGS_H
-#undef HAVE_INTTYPES_H
-#undef HAVE_STDINT_H
-#undef HAVE_CTYPE_H
-#undef HAVE_MATH_H
-#undef HAVE_ICONV_H
-#undef HAVE_SIGNAL_H
-#undef HAVE_ALTIVEC_H
-
-/* C library functions */
-#undef HAVE_MALLOC
-#undef HAVE_CALLOC
-#undef HAVE_REALLOC
-#undef HAVE_FREE
-#undef HAVE_ALLOCA
-#ifndef _WIN32 /* Don't use C runtime versions of these on Windows */
-#undef HAVE_GETENV
-#undef HAVE_PUTENV
-#undef HAVE_UNSETENV
-#endif
-#undef HAVE_QSORT
-#undef HAVE_ABS
-#undef HAVE_BCOPY
-#undef HAVE_MEMSET
-#undef HAVE_MEMCPY
-#undef HAVE_MEMMOVE
-#undef HAVE_MEMCMP
-#undef HAVE_STRLEN
-#undef HAVE_STRLCPY
-#undef HAVE_STRLCAT
-#undef HAVE_STRDUP
-#undef HAVE__STRREV
-#undef HAVE__STRUPR
-#undef HAVE__STRLWR
-#undef HAVE_INDEX
-#undef HAVE_RINDEX
-#undef HAVE_STRCHR
-#undef HAVE_STRRCHR
-#undef HAVE_STRSTR
-#undef HAVE_ITOA
-#undef HAVE__LTOA
-#undef HAVE__UITOA
-#undef HAVE__ULTOA
-#undef HAVE_STRTOL
-#undef HAVE_STRTOUL
-#undef HAVE__I64TOA
-#undef HAVE__UI64TOA
-#undef HAVE_STRTOLL
-#undef HAVE_STRTOULL
-#undef HAVE_STRTOD
-#undef HAVE_ATOI
-#undef HAVE_ATOF
-#undef HAVE_STRCMP
-#undef HAVE_STRNCMP
-#undef HAVE__STRICMP
-#undef HAVE_STRCASECMP
-#undef HAVE__STRNICMP
-#undef HAVE_STRNCASECMP
-#undef HAVE_SSCANF
-#undef HAVE_SNPRINTF
-#undef HAVE_VSNPRINTF
-#undef HAVE_ICONV
-#undef HAVE_SIGACTION
-#undef HAVE_SETJMP
-#undef HAVE_NANOSLEEP
-#undef HAVE_CLOCK_GETTIME
-#undef HAVE_DLVSYM
-#undef HAVE_GETPAGESIZE
-
-#else
-/* We may need some replacement for stdarg.h here */
-#include <stdarg.h>
-#endif /* HAVE_LIBC */
-
-/* Allow disabling of core subsystems */
-#undef SDL_AUDIO_DISABLED
-#undef SDL_CDROM_DISABLED
-#undef SDL_CPUINFO_DISABLED
-#undef SDL_EVENTS_DISABLED
-#undef SDL_FILE_DISABLED
-#undef SDL_JOYSTICK_DISABLED
-#undef SDL_LOADSO_DISABLED
-#undef SDL_THREADS_DISABLED
-#undef SDL_TIMERS_DISABLED
-#undef SDL_VIDEO_DISABLED
-
-/* Enable various audio drivers */
-#undef SDL_AUDIO_DRIVER_ALSA
-#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
-#undef SDL_AUDIO_DRIVER_ARTS
-#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
-#undef SDL_AUDIO_DRIVER_BAUDIO
-#undef SDL_AUDIO_DRIVER_BSD
-#undef SDL_AUDIO_DRIVER_COREAUDIO
-#undef SDL_AUDIO_DRIVER_DART
-#undef SDL_AUDIO_DRIVER_DC
-#undef SDL_AUDIO_DRIVER_DISK
-#undef SDL_AUDIO_DRIVER_DUMMY
-#undef SDL_AUDIO_DRIVER_DMEDIA
-#undef SDL_AUDIO_DRIVER_DSOUND
-#undef SDL_AUDIO_DRIVER_PULSE
-#undef SDL_AUDIO_DRIVER_PULSE_DYNAMIC
-#undef SDL_AUDIO_DRIVER_ESD
-#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC
-#undef SDL_AUDIO_DRIVER_MINT
-#undef SDL_AUDIO_DRIVER_MMEAUDIO
-#undef SDL_AUDIO_DRIVER_NAS
-#undef SDL_AUDIO_DRIVER_OSS
-#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
-#undef SDL_AUDIO_DRIVER_PAUD
-#undef SDL_AUDIO_DRIVER_QNXNTO
-#undef SDL_AUDIO_DRIVER_SNDMGR
-#undef SDL_AUDIO_DRIVER_SUNAUDIO
-#undef SDL_AUDIO_DRIVER_WAVEOUT
-
-/* Enable various cdrom drivers */
-#undef SDL_CDROM_AIX
-#undef SDL_CDROM_BEOS
-#undef SDL_CDROM_BSDI
-#undef SDL_CDROM_DC
-#undef SDL_CDROM_DUMMY
-#undef SDL_CDROM_FREEBSD
-#undef SDL_CDROM_LINUX
-#undef SDL_CDROM_MACOS
-#undef SDL_CDROM_MACOSX
-#undef SDL_CDROM_MINT
-#undef SDL_CDROM_OPENBSD
-#undef SDL_CDROM_OS2
-#undef SDL_CDROM_OSF
-#undef SDL_CDROM_QNX
-#undef SDL_CDROM_WIN32
-
-/* Enable various input drivers */
-#undef SDL_INPUT_TSLIB
-#undef SDL_JOYSTICK_BEOS
-#undef SDL_JOYSTICK_DC
-#undef SDL_JOYSTICK_DUMMY
-#undef SDL_JOYSTICK_IOKIT
-#undef SDL_JOYSTICK_LINUX
-#undef SDL_JOYSTICK_LINUXEV
-#undef SDL_JOYSTICK_MACOS
-#undef SDL_JOYSTICK_MINT
-#undef SDL_JOYSTICK_OS2
-#undef SDL_JOYSTICK_RISCOS
-#undef SDL_JOYSTICK_WINMM
-#undef SDL_JOYSTICK_USBHID
-#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
-
-/* Enable various shared object loading systems */
-#undef SDL_LOADSO_BEOS
-#undef SDL_LOADSO_DLCOMPAT
-#undef SDL_LOADSO_DLOPEN
-#undef SDL_LOADSO_DUMMY
-#undef SDL_LOADSO_LDG
-#undef SDL_LOADSO_MACOS
-#undef SDL_LOADSO_OS2
-#undef SDL_LOADSO_WIN32
-
-/* Enable various threading systems */
-#undef SDL_THREAD_BEOS
-#undef SDL_THREAD_DC
-#undef SDL_THREAD_OS2
-#undef SDL_THREAD_PTH
-#undef SDL_THREAD_PTHREAD
-#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
-#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
-#undef SDL_THREAD_SPROC
-#undef SDL_THREAD_WIN32
-
-/* Enable various timer systems */
-#undef SDL_TIMER_BEOS
-#undef SDL_TIMER_DC
-#undef SDL_TIMER_DUMMY
-#undef SDL_TIMER_MACOS
-#undef SDL_TIMER_MINT
-#undef SDL_TIMER_OS2
-#undef SDL_TIMER_RISCOS
-#undef SDL_TIMER_UNIX
-#undef SDL_TIMER_WIN32
-#undef SDL_TIMER_WINCE
-
-/* Enable various video drivers */
-#undef SDL_VIDEO_DRIVER_AALIB
-#undef SDL_VIDEO_DRIVER_BWINDOW
-#undef SDL_VIDEO_DRIVER_DC
-#undef SDL_VIDEO_DRIVER_DDRAW
-#undef SDL_VIDEO_DRIVER_DGA
-#undef SDL_VIDEO_DRIVER_DIRECTFB
-#undef SDL_VIDEO_DRIVER_DRAWSPROCKET
-#undef SDL_VIDEO_DRIVER_DUMMY
-#undef SDL_VIDEO_DRIVER_FBCON
-#undef SDL_VIDEO_DRIVER_GAPI
-#undef SDL_VIDEO_DRIVER_GEM
-#undef SDL_VIDEO_DRIVER_GGI
-#undef SDL_VIDEO_DRIVER_IPOD
-#undef SDL_VIDEO_DRIVER_NANOX
-#undef SDL_VIDEO_DRIVER_OS2FS
-#undef SDL_VIDEO_DRIVER_PHOTON
-#undef SDL_VIDEO_DRIVER_PICOGUI
-#undef SDL_VIDEO_DRIVER_PS2GS
-#undef SDL_VIDEO_DRIVER_QTOPIA
-#undef SDL_VIDEO_DRIVER_QUARTZ
-#undef SDL_VIDEO_DRIVER_RISCOS
-#undef SDL_VIDEO_DRIVER_SVGALIB
-#undef SDL_VIDEO_DRIVER_TOOLBOX
-#undef SDL_VIDEO_DRIVER_VGL
-#undef SDL_VIDEO_DRIVER_WINDIB
-#undef SDL_VIDEO_DRIVER_WSCONS
-#undef SDL_VIDEO_DRIVER_X11
-#undef SDL_VIDEO_DRIVER_X11_DGAMOUSE
-#undef SDL_VIDEO_DRIVER_X11_DPMS
-#undef SDL_VIDEO_DRIVER_X11_DYNAMIC
-#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
-#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR
-#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER
-#undef SDL_VIDEO_DRIVER_X11_VIDMODE
-#undef SDL_VIDEO_DRIVER_X11_XINERAMA
-#undef SDL_VIDEO_DRIVER_X11_XME
-#undef SDL_VIDEO_DRIVER_X11_XRANDR
-#undef SDL_VIDEO_DRIVER_X11_XV
-#undef SDL_VIDEO_DRIVER_XBIOS
-
-/* Enable OpenGL support */
-#undef SDL_VIDEO_OPENGL
-#undef SDL_VIDEO_OPENGL_GLX
-#undef SDL_VIDEO_OPENGL_WGL
-#undef SDL_VIDEO_OPENGL_OSMESA
-#undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC
-
-/* Enable assembly routines */
-#undef SDL_ASSEMBLY_ROUTINES
-#undef SDL_HERMES_BLITTERS
-#undef SDL_ALTIVEC_BLITTERS
-
-#endif /* _SDL_config_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_config_amiga.h b/distrib/sdl-1.2.12/include/SDL_config_amiga.h
deleted file mode 100644
index 23e0861..0000000
--- a/distrib/sdl-1.2.12/include/SDL_config_amiga.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-#ifndef _SDL_config_amiga_h
-#define _SDL_config_amiga_h
-
-#include "SDL_platform.h"
-
-/* This is a set of defines to configure the SDL features */
-
-#define SDL_HAS_64BIT_TYPE 1
-
-/* Useful headers */
-#define HAVE_SYS_TYPES_H 1
-#define HAVE_STDIO_H 1
-#define STDC_HEADERS 1
-#define HAVE_STRING_H 1
-#define HAVE_INTTYPES_H 1
-#define HAVE_SIGNAL_H 1
-
-/* C library functions */
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC 1
-#define HAVE_FREE 1
-#define HAVE_ALLOCA 1
-#define HAVE_GETENV 1
-#define HAVE_PUTENV 1
-#define HAVE_MEMSET 1
-#define HAVE_MEMCPY 1
-#define HAVE_MEMMOVE 1
-#define HAVE_MEMCMP 1
-
-/* Enable various audio drivers */
-#define SDL_AUDIO_DRIVER_AHI 1
-#define SDL_AUDIO_DRIVER_DISK 1
-#define SDL_AUDIO_DRIVER_DUMMY 1
-
-/* Enable various cdrom drivers */
-#define SDL_CDROM_DUMMY 1
-
-/* Enable various input drivers */
-#define SDL_JOYSTICK_AMIGA 1
-
-/* Enable various shared object loading systems */
-#define SDL_LOADSO_DUMMY 1
-
-/* Enable various threading systems */
-#define SDL_THREAD_AMIGA 1
-
-/* Enable various timer systems */
-#define SDL_TIMER_AMIGA 1
-
-/* Enable various video drivers */
-#define SDL_VIDEO_DRIVER_CYBERGRAPHICS 1
-#define SDL_VIDEO_DRIVER_DUMMY 1
-
-/* Enable OpenGL support */
-#define SDL_VIDEO_OPENGL 1
-
-#endif /* _SDL_config_amiga_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_config_dreamcast.h b/distrib/sdl-1.2.12/include/SDL_config_dreamcast.h
deleted file mode 100644
index 9cbeea3..0000000
--- a/distrib/sdl-1.2.12/include/SDL_config_dreamcast.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-#ifndef _SDL_config_dreamcast_h
-#define _SDL_config_dreamcast_h
-
-#include "SDL_platform.h"
-
-/* This is a set of defines to configure the SDL features */
-
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef signed short int16_t;
-typedef unsigned short uint16_t;
-typedef signed int int32_t;
-typedef unsigned int uint32_t;
-typedef signed long long int64_t;
-typedef unsigned long long uint64_t;
-typedef unsigned long uintptr_t;
-#define SDL_HAS_64BIT_TYPE 1
-
-/* Useful headers */
-#define HAVE_SYS_TYPES_H 1
-#define HAVE_STDIO_H 1
-#define STDC_HEADERS 1
-#define HAVE_STRING_H 1
-#define HAVE_CTYPE_H 1
-
-/* C library functions */
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC 1
-#define HAVE_FREE 1
-#define HAVE_ALLOCA 1
-#define HAVE_GETENV 1
-#define HAVE_PUTENV 1
-#define HAVE_QSORT 1
-#define HAVE_ABS 1
-#define HAVE_BCOPY 1
-#define HAVE_MEMSET 1
-#define HAVE_MEMCPY 1
-#define HAVE_MEMMOVE 1
-#define HAVE_MEMCMP 1
-#define HAVE_STRLEN 1
-#define HAVE_STRDUP 1
-#define HAVE_INDEX 1
-#define HAVE_RINDEX 1
-#define HAVE_STRCHR 1
-#define HAVE_STRRCHR 1
-#define HAVE_STRSTR 1
-#define HAVE_STRTOL 1
-#define HAVE_STRTOD 1
-#define HAVE_ATOI 1
-#define HAVE_ATOF 1
-#define HAVE_STRCMP 1
-#define HAVE_STRNCMP 1
-#define HAVE_STRICMP 1
-#define HAVE_STRCASECMP 1
-#define HAVE_SSCANF 1
-#define HAVE_SNPRINTF 1
-#define HAVE_VSNPRINTF 1
-
-/* Enable various audio drivers */
-#define SDL_AUDIO_DRIVER_DC 1
-#define SDL_AUDIO_DRIVER_DISK 1
-#define SDL_AUDIO_DRIVER_DUMMY 1
-
-/* Enable various cdrom drivers */
-#define SDL_CDROM_DC 1
-
-/* Enable various input drivers */
-#define SDL_JOYSTICK_DC 1
-
-/* Enable various shared object loading systems */
-#define SDL_LOADSO_DUMMY 1
-
-/* Enable various threading systems */
-#define SDL_THREAD_DC 1
-
-/* Enable various timer systems */
-#define SDL_TIMER_DC 1
-
-/* Enable various video drivers */
-#define SDL_VIDEO_DRIVER_DC 1
-#define SDL_VIDEO_DRIVER_DUMMY 1
-
-#endif /* _SDL_config_dreamcast_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_config_macos.h b/distrib/sdl-1.2.12/include/SDL_config_macos.h
deleted file mode 100644
index c4a1c59..0000000
--- a/distrib/sdl-1.2.12/include/SDL_config_macos.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-#ifndef _SDL_config_macos_h
-#define _SDL_config_macos_h
-
-#include "SDL_platform.h"
-
-/* This is a set of defines to configure the SDL features */
-
-#include <MacTypes.h>
-
-typedef SInt8 int8_t;
-typedef UInt8 uint8_t;
-typedef SInt16 int16_t;
-typedef UInt16 uint16_t;
-typedef SInt32 int32_t;
-typedef UInt32 uint32_t;
-typedef SInt64 int64_t;
-typedef UInt64 uint64_t;
-typedef unsigned long uintptr_t;
-
-#define SDL_HAS_64BIT_TYPE 1
-
-/* Useful headers */
-#define HAVE_STDIO_H 1
-#define STDC_HEADERS 1
-#define HAVE_STRING_H 1
-#define HAVE_CTYPE_H 1
-#define HAVE_MATH_H 1
-#define HAVE_SIGNAL_H 1
-
-/* C library functions */
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC 1
-#define HAVE_FREE 1
-#define HAVE_ALLOCA 1
-#define HAVE_ABS 1
-#define HAVE_MEMSET 1
-#define HAVE_MEMCPY 1
-#define HAVE_MEMMOVE 1
-#define HAVE_MEMCMP 1
-#define HAVE_STRLEN 1
-#define HAVE_STRCHR 1
-#define HAVE_STRRCHR 1
-#define HAVE_STRSTR 1
-#define HAVE_ITOA 1
-#define HAVE_STRTOL 1
-#define HAVE_STRTOD 1
-#define HAVE_ATOI 1
-#define HAVE_ATOF 1
-#define HAVE_STRCMP 1
-#define HAVE_STRNCMP 1
-#define HAVE_SSCANF 1
-
-/* Enable various audio drivers */
-#define SDL_AUDIO_DRIVER_SNDMGR 1
-#define SDL_AUDIO_DRIVER_DISK 1
-#define SDL_AUDIO_DRIVER_DUMMY 1
-
-/* Enable various cdrom drivers */
-#if TARGET_API_MAC_CARBON
-#define SDL_CDROM_DUMMY 1
-#else
-#define SDL_CDROM_MACOS 1
-#endif
-
-/* Enable various input drivers */
-#if TARGET_API_MAC_CARBON
-#define SDL_JOYSTICK_DUMMY 1
-#else
-#define SDL_JOYSTICK_MACOS 1
-#endif
-
-/* Enable various shared object loading systems */
-#define SDL_LOADSO_MACOS 1
-
-/* Enable various threading systems */
-#define SDL_THREADS_DISABLED 1
-
-/* Enable various timer systems */
-#define SDL_TIMER_MACOS 1
-
-/* Enable various video drivers */
-#define SDL_VIDEO_DRIVER_DUMMY 1
-#define SDL_VIDEO_DRIVER_DRAWSPROCKET 1
-#define SDL_VIDEO_DRIVER_TOOLBOX 1
-
-/* Enable OpenGL support */
-#define SDL_VIDEO_OPENGL 1
-
-#endif /* _SDL_config_macos_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_config_macosx.h b/distrib/sdl-1.2.12/include/SDL_config_macosx.h
deleted file mode 100644
index 481c22e..0000000
--- a/distrib/sdl-1.2.12/include/SDL_config_macosx.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-#ifndef _SDL_config_macosx_h
-#define _SDL_config_macosx_h
-
-#include "SDL_platform.h"
-
-/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */
-#include <AvailabilityMacros.h>
-
-/* This is a set of defines to configure the SDL features */
-
-#define SDL_HAS_64BIT_TYPE 1
-
-/* 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
-
-/* C library functions */
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC 1
-#define HAVE_FREE 1
-#define HAVE_ALLOCA 1
-#define HAVE_GETENV 1
-#define HAVE_PUTENV 1
-#define HAVE_UNSETENV 1
-#define HAVE_QSORT 1
-#define HAVE_ABS 1
-#define HAVE_BCOPY 1
-#define HAVE_MEMSET 1
-#define HAVE_MEMCPY 1
-#define HAVE_MEMMOVE 1
-#define HAVE_MEMCMP 1
-#define HAVE_STRLEN 1
-#define HAVE_STRLCPY 1
-#define HAVE_STRLCAT 1
-#define HAVE_STRDUP 1
-#define HAVE_STRCHR 1
-#define HAVE_STRRCHR 1
-#define HAVE_STRSTR 1
-#define HAVE_STRTOL 1
-#define HAVE_STRTOUL 1
-#define HAVE_STRTOLL 1
-#define HAVE_STRTOULL 1
-#define HAVE_STRTOD 1
-#define HAVE_ATOI 1
-#define HAVE_ATOF 1
-#define HAVE_STRCMP 1
-#define HAVE_STRNCMP 1
-#define HAVE_STRCASECMP 1
-#define HAVE_STRNCASECMP 1
-#define HAVE_SSCANF 1
-#define HAVE_SNPRINTF 1
-#define HAVE_VSNPRINTF 1
-#define HAVE_SIGACTION 1
-#define HAVE_SETJMP 1
-#define HAVE_NANOSLEEP 1
-
-/* Enable various audio drivers */
-#define SDL_AUDIO_DRIVER_COREAUDIO 1
-#define SDL_AUDIO_DRIVER_SNDMGR 1
-#define SDL_AUDIO_DRIVER_DISK 1
-#define SDL_AUDIO_DRIVER_DUMMY 1
-
-/* Enable various cdrom drivers */
-#define SDL_CDROM_MACOSX 1
-
-/* Enable various input drivers */
-#define SDL_JOYSTICK_IOKIT 1
-
-/* Enable various shared object loading systems */
-#ifdef __ppc__
-/* For Mac OS X 10.2 compatibility */
-#define SDL_LOADSO_DLCOMPAT 1
-#else
-#define SDL_LOADSO_DLOPEN 1
-#endif
-
-/* Enable various threading systems */
-#define SDL_THREAD_PTHREAD 1
-#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
-
-/* Enable various timer systems */
-#define SDL_TIMER_UNIX 1
-
-/* Enable various video drivers */
-#define SDL_VIDEO_DRIVER_DUMMY 1
-#if ((defined TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON))
-#define SDL_VIDEO_DRIVER_TOOLBOX 1
-#else
-#define SDL_VIDEO_DRIVER_QUARTZ 1
-#endif
-
-/* Enable OpenGL support */
-#define SDL_VIDEO_OPENGL 1
-
-/* Enable assembly routines */
-#define SDL_ASSEMBLY_ROUTINES 1
-#ifdef __ppc__
-#define SDL_ALTIVEC_BLITTERS 1
-#endif
-
-#endif /* _SDL_config_macosx_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_config_minimal.h b/distrib/sdl-1.2.12/include/SDL_config_minimal.h
deleted file mode 100644
index 78b6148..0000000
--- a/distrib/sdl-1.2.12/include/SDL_config_minimal.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-#ifndef _SDL_config_minimal_h
-#define _SDL_config_minimal_h
-
-#include "SDL_platform.h"
-
-/* This is the minimal configuration that can be used to build SDL */
-
-#include <stdarg.h>
-
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef signed short int16_t;
-typedef unsigned short uint16_t;
-typedef signed int int32_t;
-typedef unsigned int uint32_t;
-typedef unsigned int size_t;
-typedef unsigned long uintptr_t;
-
-/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
-#define SDL_AUDIO_DRIVER_DUMMY 1
-
-/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */
-#define SDL_CDROM_DISABLED 1
-
-/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */
-#define SDL_JOYSTICK_DISABLED 1
-
-/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
-#define SDL_LOADSO_DISABLED 1
-
-/* Enable the stub thread support (src/thread/generic/\*.c) */
-#define SDL_THREADS_DISABLED 1
-
-/* Enable the stub timer support (src/timer/dummy/\*.c) */
-#define SDL_TIMERS_DISABLED 1
-
-/* Enable the dummy video driver (src/video/dummy/\*.c) */
-#define SDL_VIDEO_DRIVER_DUMMY 1
-
-#endif /* _SDL_config_minimal_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_config_os2.h b/distrib/sdl-1.2.12/include/SDL_config_os2.h
deleted file mode 100644
index 8cdea9f..0000000
--- a/distrib/sdl-1.2.12/include/SDL_config_os2.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-#ifndef _SDL_config_os2_h
-#define _SDL_config_os2_h
-
-#include "SDL_platform.h"
-
-/* This is a set of defines to configure the SDL features */
-
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef signed short int16_t;
-typedef unsigned short uint16_t;
-typedef signed int int32_t;
-typedef unsigned int uint32_t;
-typedef unsigned int size_t;
-typedef unsigned long uintptr_t;
-typedef signed long long int64_t;
-typedef unsigned long long uint64_t;
-
-#define SDL_HAS_64BIT_TYPE 1
-
-/* Use Watcom's LIBC */
-#define HAVE_LIBC 1
-
-/* Useful headers */
-#define HAVE_SYS_TYPES_H 1
-#define HAVE_STDIO_H 1
-#define STDC_HEADERS 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STDARG_H 1
-#define HAVE_MALLOC_H 1
-#define HAVE_MEMORY_H 1
-#define HAVE_STRING_H 1
-#define HAVE_STRINGS_H 1
-#define HAVE_INTTYPES_H 1
-#define HAVE_STDINT_H 1
-#define HAVE_CTYPE_H 1
-#define HAVE_MATH_H 1
-#define HAVE_SIGNAL_H 1
-
-/* C library functions */
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC 1
-#define HAVE_FREE 1
-#define HAVE_ALLOCA 1
-#define HAVE_GETENV 1
-#define HAVE_PUTENV 1
-#define HAVE_UNSETENV 1
-#define HAVE_QSORT 1
-#define HAVE_ABS 1
-#define HAVE_BCOPY 1
-#define HAVE_MEMSET 1
-#define HAVE_MEMCPY 1
-#define HAVE_MEMMOVE 1
-#define HAVE_MEMCMP 1
-#define HAVE_STRLEN 1
-#define HAVE_STRLCPY 1
-#define HAVE_STRLCAT 1
-#define HAVE_STRDUP 1
-#define HAVE__STRREV 1
-#define HAVE__STRUPR 1
-#define HAVE__STRLWR 1
-#define HAVE_INDEX 1
-#define HAVE_RINDEX 1
-#define HAVE_STRCHR 1
-#define HAVE_STRRCHR 1
-#define HAVE_STRSTR 1
-#define HAVE_ITOA 1
-#define HAVE__LTOA 1
-#define HAVE__UITOA 1
-#define HAVE__ULTOA 1
-#define HAVE_STRTOL 1
-#define HAVE__I64TOA 1
-#define HAVE__UI64TOA 1
-#define HAVE_STRTOLL 1
-#define HAVE_STRTOD 1
-#define HAVE_ATOI 1
-#define HAVE_ATOF 1
-#define HAVE_STRCMP 1
-#define HAVE_STRNCMP 1
-#define HAVE_STRICMP 1
-#define HAVE_STRCASECMP 1
-#define HAVE_SSCANF 1
-#define HAVE_SNPRINTF 1
-#define HAVE_VSNPRINTF 1
-#define HAVE_SETJMP 1
-#define HAVE_CLOCK_GETTIME 1
-
-/* Enable various audio drivers */
-#define SDL_AUDIO_DRIVER_DART 1
-#define SDL_AUDIO_DRIVER_DISK 1
-#define SDL_AUDIO_DRIVER_DUMMY 1
-
-/* Enable various cdrom drivers */
-#define SDL_CDROM_OS2 1
-
-/* Enable various input drivers */
-#define SDL_JOYSTICK_OS2 1
-
-/* Enable various shared object loading systems */
-#define SDL_LOADSO_OS2 1
-
-/* Enable various threading systems */
-#define SDL_THREAD_OS2 1
-
-/* Enable various timer systems */
-#define SDL_TIMER_OS2 1
-
-/* Enable various video drivers */
-#define SDL_VIDEO_DRIVER_DUMMY 1
-#define SDL_VIDEO_DRIVER_OS2FS 1
-
-/* Enable OpenGL support */
-/* Nothing here yet for OS/2... :( */
-
-/* Enable assembly routines where available */
-#define SDL_ASSEMBLY_ROUTINES 1
-
-#endif /* _SDL_config_os2_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_config_win32.h b/distrib/sdl-1.2.12/include/SDL_config_win32.h
deleted file mode 100644
index cfb44d2..0000000
--- a/distrib/sdl-1.2.12/include/SDL_config_win32.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-#ifndef _SDL_config_win32_h
-#define _SDL_config_win32_h
-
-#include "SDL_platform.h"
-
-/* This is a set of defines to configure the SDL features */
-
-#if defined(__GNUC__) || defined(__DMC__)
-#define HAVE_STDINT_H 1
-#elif defined(_MSC_VER)
-typedef signed __int8 int8_t;
-typedef unsigned __int8 uint8_t;
-typedef signed __int16 int16_t;
-typedef unsigned __int16 uint16_t;
-typedef signed __int32 int32_t;
-typedef unsigned __int32 uint32_t;
-typedef signed __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-#ifndef _UINTPTR_T_DEFINED
-#ifdef _WIN64
-typedef unsigned __int64 uintptr_t;
-#else
-typedef unsigned int uintptr_t;
-#endif
-#define _UINTPTR_T_DEFINED
-#endif
-/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
-#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
-#define DWORD_PTR DWORD
-#endif
-#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
-#define LONG_PTR LONG
-#endif
-#else /* !__GNUC__ && !_MSC_VER */
-typedef signed char int8_t;
-typedef unsigned char uint8_t;
-typedef signed short int16_t;
-typedef unsigned short uint16_t;
-typedef signed int int32_t;
-typedef unsigned int uint32_t;
-typedef signed long long int64_t;
-typedef unsigned long long uint64_t;
-#ifndef _SIZE_T_DEFINED_
-#define _SIZE_T_DEFINED_
-typedef unsigned int size_t;
-#endif
-typedef unsigned int uintptr_t;
-#endif /* __GNUC__ || _MSC_VER */
-#define SDL_HAS_64BIT_TYPE 1
-
-/* Enabled for SDL 1.2 (binary compatibility) */
-#define HAVE_LIBC 1
-#ifdef HAVE_LIBC
-/* Useful headers */
-#define HAVE_STDIO_H 1
-#define STDC_HEADERS 1
-#define HAVE_STRING_H 1
-#define HAVE_CTYPE_H 1
-#define HAVE_MATH_H 1
-#ifndef _WIN32_WCE
-#define HAVE_SIGNAL_H 1
-#endif
-
-/* C library functions */
-#define HAVE_MALLOC 1
-#define HAVE_CALLOC 1
-#define HAVE_REALLOC 1
-#define HAVE_FREE 1
-#define HAVE_ALLOCA 1
-#define HAVE_QSORT 1
-#define HAVE_ABS 1
-#define HAVE_MEMSET 1
-#define HAVE_MEMCPY 1
-#define HAVE_MEMMOVE 1
-#define HAVE_MEMCMP 1
-#define HAVE_STRLEN 1
-#define HAVE__STRREV 1
-#define HAVE__STRUPR 1
-#define HAVE__STRLWR 1
-#define HAVE_STRCHR 1
-#define HAVE_STRRCHR 1
-#define HAVE_STRSTR 1
-#define HAVE_ITOA 1
-#define HAVE__LTOA 1
-#define HAVE__ULTOA 1
-#define HAVE_STRTOL 1
-#define HAVE_STRTOUL 1
-#define HAVE_STRTOLL 1
-#define HAVE_STRTOD 1
-#define HAVE_ATOI 1
-#define HAVE_ATOF 1
-#define HAVE_STRCMP 1
-#define HAVE_STRNCMP 1
-#define HAVE__STRICMP 1
-#define HAVE__STRNICMP 1
-#define HAVE_SSCANF 1
-#else
-#define HAVE_STDARG_H 1
-#define HAVE_STDDEF_H 1
-#endif
-
-/* Enable various audio drivers */
-#ifndef _WIN32_WCE
-#define SDL_AUDIO_DRIVER_DSOUND 1
-#endif
-#define SDL_AUDIO_DRIVER_WAVEOUT 1
-#define SDL_AUDIO_DRIVER_DISK 1
-#define SDL_AUDIO_DRIVER_DUMMY 1
-
-/* Enable various cdrom drivers */
-#ifdef _WIN32_WCE
-#define SDL_CDROM_DISABLED 1
-#else
-#define SDL_CDROM_WIN32 1
-#endif
-
-/* Enable various input drivers */
-#ifdef _WIN32_WCE
-#define SDL_JOYSTICK_DISABLED 1
-#else
-#define SDL_JOYSTICK_WINMM 1
-#endif
-
-/* Enable various shared object loading systems */
-#define SDL_LOADSO_WIN32 1
-
-/* Enable various threading systems */
-#define SDL_THREAD_WIN32 1
-
-/* Enable various timer systems */
-#ifdef _WIN32_WCE
-#define SDL_TIMER_WINCE 1
-#else
-#define SDL_TIMER_WIN32 1
-#endif
-
-/* Enable various video drivers */
-#ifdef _WIN32_WCE
-#define SDL_VIDEO_DRIVER_GAPI 1
-#endif
-#ifndef _WIN32_WCE
-#define SDL_VIDEO_DRIVER_DDRAW 1
-#endif
-#define SDL_VIDEO_DRIVER_DUMMY 1
-#define SDL_VIDEO_DRIVER_WINDIB 1
-
-/* Enable OpenGL support */
-#ifndef _WIN32_WCE
-#define SDL_VIDEO_OPENGL 1
-#define SDL_VIDEO_OPENGL_WGL 1
-#endif
-
-/* Enable assembly routines (Win64 doesn't have inline asm) */
-#ifndef _WIN64
-#define SDL_ASSEMBLY_ROUTINES 1
-#endif
-
-#endif /* _SDL_config_win32_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_copying.h b/distrib/sdl-1.2.12/include/SDL_copying.h
deleted file mode 100644
index 39e122d..0000000
--- a/distrib/sdl-1.2.12/include/SDL_copying.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
diff --git a/distrib/sdl-1.2.12/include/SDL_cpuinfo.h b/distrib/sdl-1.2.12/include/SDL_cpuinfo.h
deleted file mode 100644
index 72acbdd..0000000
--- a/distrib/sdl-1.2.12/include/SDL_cpuinfo.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* CPU feature detection for SDL */
-
-#ifndef _SDL_cpuinfo_h
-#define _SDL_cpuinfo_h
-
-#include "SDL_stdinc.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* This function returns true if the CPU has the RDTSC instruction
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void);
-
-/* This function returns true if the CPU has MMX features
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
-
-/* This function returns true if the CPU has MMX Ext. features
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void);
-
-/* This function returns true if the CPU has 3DNow features
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void);
-
-/* This function returns true if the CPU has 3DNow! Ext. features
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void);
-
-/* This function returns true if the CPU has SSE features
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
-
-/* This function returns true if the CPU has SSE2 features
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
-
-/* This function returns true if the CPU has AltiVec features
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_cpuinfo_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_endian.h b/distrib/sdl-1.2.12/include/SDL_endian.h
deleted file mode 100644
index 8f8db4c..0000000
--- a/distrib/sdl-1.2.12/include/SDL_endian.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* Functions for reading and writing endian-specific values */
-
-#ifndef _SDL_endian_h
-#define _SDL_endian_h
-
-#include "SDL_stdinc.h"
-
-/* The two types of endianness */
-#define SDL_LIL_ENDIAN 1234
-#define SDL_BIG_ENDIAN 4321
-
-#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
-#if defined(__hppa__) || \
- defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
- (defined(__MIPS__) && defined(__MISPEB__)) || \
- defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
- defined(__sparc__)
-#define SDL_BYTEORDER SDL_BIG_ENDIAN
-#else
-#define SDL_BYTEORDER SDL_LIL_ENDIAN
-#endif
-#endif /* !SDL_BYTEORDER */
-
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Use inline functions for compilers that support them, and static
- functions for those that do not. Because these functions become
- static for compilers that do not support inline functions, this
- header should only be included in files that actually use them.
-*/
-#if defined(__GNUC__) && defined(__i386__) && \
- !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
-static __inline__ Uint16 SDL_Swap16(Uint16 x)
-{
- __asm__("xchgb %b0,%h0" : "=q" (x) : "0" (x));
- return x;
-}
-#elif defined(__GNUC__) && defined(__x86_64__)
-static __inline__ Uint16 SDL_Swap16(Uint16 x)
-{
- __asm__("xchgb %b0,%h0" : "=Q" (x) : "0" (x));
- return x;
-}
-#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
-static __inline__ Uint16 SDL_Swap16(Uint16 x)
-{
- Uint16 result;
-
- __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x));
- return result;
-}
-#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__))
-static __inline__ Uint16 SDL_Swap16(Uint16 x)
-{
- __asm__("rorw #8,%0" : "=d" (x) : "0" (x) : "cc");
- return x;
-}
-#else
-static __inline__ Uint16 SDL_Swap16(Uint16 x) {
- return((x<<8)|(x>>8));
-}
-#endif
-
-#if defined(__GNUC__) && defined(__i386__) && \
- !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
-static __inline__ Uint32 SDL_Swap32(Uint32 x)
-{
- __asm__("bswap %0" : "=r" (x) : "0" (x));
- return x;
-}
-#elif defined(__GNUC__) && defined(__x86_64__)
-static __inline__ Uint32 SDL_Swap32(Uint32 x)
-{
- __asm__("bswapl %0" : "=r" (x) : "0" (x));
- return x;
-}
-#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
-static __inline__ Uint32 SDL_Swap32(Uint32 x)
-{
- Uint32 result;
-
- __asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x));
- __asm__("rlwimi %0,%2,8,8,15" : "=&r" (result) : "0" (result), "r" (x));
- __asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x));
- return result;
-}
-#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__))
-static __inline__ Uint32 SDL_Swap32(Uint32 x)
-{
- __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) : "0" (x) : "cc");
- return x;
-}
-#else
-static __inline__ Uint32 SDL_Swap32(Uint32 x) {
- return((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24));
-}
-#endif
-
-#ifdef SDL_HAS_64BIT_TYPE
-#if defined(__GNUC__) && defined(__i386__) && \
- !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
-static __inline__ Uint64 SDL_Swap64(Uint64 x)
-{
- union {
- struct { Uint32 a,b; } s;
- Uint64 u;
- } v;
- v.u = x;
- __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
- : "=r" (v.s.a), "=r" (v.s.b)
- : "0" (v.s.a), "1" (v.s.b));
- return v.u;
-}
-#elif defined(__GNUC__) && defined(__x86_64__)
-static __inline__ Uint64 SDL_Swap64(Uint64 x)
-{
- __asm__("bswapq %0" : "=r" (x) : "0" (x));
- return x;
-}
-#else
-static __inline__ Uint64 SDL_Swap64(Uint64 x)
-{
- Uint32 hi, lo;
-
- /* Separate into high and low 32-bit values and swap them */
- lo = (Uint32)(x&0xFFFFFFFF);
- x >>= 32;
- hi = (Uint32)(x&0xFFFFFFFF);
- x = SDL_Swap32(lo);
- x <<= 32;
- x |= SDL_Swap32(hi);
- return(x);
-}
-#endif
-#else
-/* This is mainly to keep compilers from complaining in SDL code.
- If there is no real 64-bit datatype, then compilers will complain about
- the fake 64-bit datatype that SDL provides when it compiles user code.
-*/
-#define SDL_Swap64(X) (X)
-#endif /* SDL_HAS_64BIT_TYPE */
-
-
-/* Byteswap item from the specified endianness to the native endianness */
-#if SDL_BYTEORDER == SDL_LIL_ENDIAN
-#define SDL_SwapLE16(X) (X)
-#define SDL_SwapLE32(X) (X)
-#define SDL_SwapLE64(X) (X)
-#define SDL_SwapBE16(X) SDL_Swap16(X)
-#define SDL_SwapBE32(X) SDL_Swap32(X)
-#define SDL_SwapBE64(X) SDL_Swap64(X)
-#else
-#define SDL_SwapLE16(X) SDL_Swap16(X)
-#define SDL_SwapLE32(X) SDL_Swap32(X)
-#define SDL_SwapLE64(X) SDL_Swap64(X)
-#define SDL_SwapBE16(X) (X)
-#define SDL_SwapBE32(X) (X)
-#define SDL_SwapBE64(X) (X)
-#endif
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_endian_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_error.h b/distrib/sdl-1.2.12/include/SDL_error.h
deleted file mode 100644
index 26d6bfa..0000000
--- a/distrib/sdl-1.2.12/include/SDL_error.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* Simple error message routines for SDL */
-
-#ifndef _SDL_error_h
-#define _SDL_error_h
-
-#include "SDL_stdinc.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Public functions */
-extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...);
-extern DECLSPEC char * SDLCALL SDL_GetError(void);
-extern DECLSPEC void SDLCALL SDL_ClearError(void);
-
-/* Private error message function - used internally */
-#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
-#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
-typedef enum {
- SDL_ENOMEM,
- SDL_EFREAD,
- SDL_EFWRITE,
- SDL_EFSEEK,
- SDL_UNSUPPORTED,
- SDL_LASTERROR
-} SDL_errorcode;
-extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_error_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_events.h b/distrib/sdl-1.2.12/include/SDL_events.h
deleted file mode 100644
index 9fe918c..0000000
--- a/distrib/sdl-1.2.12/include/SDL_events.h
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* Include file for SDL event handling */
-
-#ifndef _SDL_events_h
-#define _SDL_events_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-#include "SDL_active.h"
-#include "SDL_keyboard.h"
-#include "SDL_mouse.h"
-#include "SDL_joystick.h"
-#include "SDL_quit.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* General keyboard/mouse state definitions */
-#define SDL_RELEASED 0
-#define SDL_PRESSED 1
-
-/* Event enumerations */
-typedef enum {
- SDL_NOEVENT = 0, /* Unused (do not remove) */
- SDL_ACTIVEEVENT, /* Application loses/gains visibility */
- SDL_KEYDOWN, /* Keys pressed */
- SDL_KEYUP, /* Keys released */
- SDL_MOUSEMOTION, /* Mouse moved */
- SDL_MOUSEBUTTONDOWN, /* Mouse button pressed */
- SDL_MOUSEBUTTONUP, /* Mouse button released */
- SDL_JOYAXISMOTION, /* Joystick axis motion */
- SDL_JOYBALLMOTION, /* Joystick trackball motion */
- SDL_JOYHATMOTION, /* Joystick hat position change */
- SDL_JOYBUTTONDOWN, /* Joystick button pressed */
- SDL_JOYBUTTONUP, /* Joystick button released */
- SDL_QUIT, /* User-requested quit */
- SDL_SYSWMEVENT, /* System specific event */
- SDL_EVENT_RESERVEDA, /* Reserved for future use.. */
- SDL_EVENT_RESERVEDB, /* Reserved for future use.. */
- SDL_VIDEORESIZE, /* User resized video mode */
- SDL_VIDEOEXPOSE, /* Screen needs to be redrawn */
- SDL_EVENT_RESERVED2, /* Reserved for future use.. */
- SDL_EVENT_RESERVED3, /* Reserved for future use.. */
- SDL_EVENT_RESERVED4, /* Reserved for future use.. */
- SDL_EVENT_RESERVED5, /* Reserved for future use.. */
- SDL_EVENT_RESERVED6, /* Reserved for future use.. */
- SDL_EVENT_RESERVED7, /* Reserved for future use.. */
- /* Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */
- SDL_USEREVENT = 24,
- /* This last event is only for bounding internal arrays
- It is the number of bits in the event mask datatype -- Uint32
- */
- SDL_NUMEVENTS = 32
-} SDL_EventType;
-
-/* Predefined event masks */
-#define SDL_EVENTMASK(X) (1<<(X))
-typedef enum {
- SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT),
- SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN),
- SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP),
- SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN)|
- SDL_EVENTMASK(SDL_KEYUP),
- SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION),
- SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
- SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
- SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION)|
- SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)|
- SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
- SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION),
- SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION),
- SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION),
- SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN),
- SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP),
- SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION)|
- SDL_EVENTMASK(SDL_JOYBALLMOTION)|
- SDL_EVENTMASK(SDL_JOYHATMOTION)|
- SDL_EVENTMASK(SDL_JOYBUTTONDOWN)|
- SDL_EVENTMASK(SDL_JOYBUTTONUP),
- SDL_VIDEORESIZEMASK = SDL_EVENTMASK(SDL_VIDEORESIZE),
- SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE),
- SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT),
- SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT)
-} SDL_EventMask ;
-#define SDL_ALLEVENTS 0xFFFFFFFF
-
-/* Application visibility event structure */
-typedef struct SDL_ActiveEvent {
- Uint8 type; /* SDL_ACTIVEEVENT */
- Uint8 gain; /* Whether given states were gained or lost (1/0) */
- Uint8 state; /* A mask of the focus states */
-} SDL_ActiveEvent;
-
-/* Keyboard event structure */
-typedef struct SDL_KeyboardEvent {
- Uint8 type; /* SDL_KEYDOWN or SDL_KEYUP */
- Uint8 which; /* The keyboard device index */
- Uint8 state; /* SDL_PRESSED or SDL_RELEASED */
- SDL_keysym keysym;
-} SDL_KeyboardEvent;
-
-/* Mouse motion event structure */
-typedef struct SDL_MouseMotionEvent {
- Uint8 type; /* SDL_MOUSEMOTION */
- Uint8 which; /* The mouse device index */
- Uint8 state; /* The current button state */
- Uint16 x, y; /* The X/Y coordinates of the mouse */
- Sint16 xrel; /* The relative motion in the X direction */
- Sint16 yrel; /* The relative motion in the Y direction */
-} SDL_MouseMotionEvent;
-
-/* Mouse button event structure */
-typedef struct SDL_MouseButtonEvent {
- Uint8 type; /* SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */
- Uint8 which; /* The mouse device index */
- Uint8 button; /* The mouse button index */
- Uint8 state; /* SDL_PRESSED or SDL_RELEASED */
- Uint16 x, y; /* The X/Y coordinates of the mouse at press time */
-} SDL_MouseButtonEvent;
-
-/* Joystick axis motion event structure */
-typedef struct SDL_JoyAxisEvent {
- Uint8 type; /* SDL_JOYAXISMOTION */
- Uint8 which; /* The joystick device index */
- Uint8 axis; /* The joystick axis index */
- Sint16 value; /* The axis value (range: -32768 to 32767) */
-} SDL_JoyAxisEvent;
-
-/* Joystick trackball motion event structure */
-typedef struct SDL_JoyBallEvent {
- Uint8 type; /* SDL_JOYBALLMOTION */
- Uint8 which; /* The joystick device index */
- Uint8 ball; /* The joystick trackball index */
- Sint16 xrel; /* The relative motion in the X direction */
- Sint16 yrel; /* The relative motion in the Y direction */
-} SDL_JoyBallEvent;
-
-/* Joystick hat position change event structure */
-typedef struct SDL_JoyHatEvent {
- Uint8 type; /* SDL_JOYHATMOTION */
- Uint8 which; /* The joystick device index */
- Uint8 hat; /* The joystick hat index */
- Uint8 value; /* The hat position value:
- SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP
- SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT
- SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN
- Note that zero means the POV is centered.
- */
-} SDL_JoyHatEvent;
-
-/* Joystick button event structure */
-typedef struct SDL_JoyButtonEvent {
- Uint8 type; /* SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */
- Uint8 which; /* The joystick device index */
- Uint8 button; /* The joystick button index */
- Uint8 state; /* SDL_PRESSED or SDL_RELEASED */
-} SDL_JoyButtonEvent;
-
-/* The "window resized" event
- When you get this event, you are responsible for setting a new video
- mode with the new width and height.
- */
-typedef struct SDL_ResizeEvent {
- Uint8 type; /* SDL_VIDEORESIZE */
- int w; /* New width */
- int h; /* New height */
-} SDL_ResizeEvent;
-
-/* The "screen redraw" event */
-typedef struct SDL_ExposeEvent {
- Uint8 type; /* SDL_VIDEOEXPOSE */
-} SDL_ExposeEvent;
-
-/* The "quit requested" event */
-typedef struct SDL_QuitEvent {
- Uint8 type; /* SDL_QUIT */
-} SDL_QuitEvent;
-
-/* A user-defined event type */
-typedef struct SDL_UserEvent {
- Uint8 type; /* SDL_USEREVENT through SDL_NUMEVENTS-1 */
- int code; /* User defined event code */
- void *data1; /* User defined data pointer */
- void *data2; /* User defined data pointer */
-} SDL_UserEvent;
-
-/* If you want to use this event, you should include SDL_syswm.h */
-struct SDL_SysWMmsg;
-typedef struct SDL_SysWMmsg SDL_SysWMmsg;
-typedef struct SDL_SysWMEvent {
- Uint8 type;
- SDL_SysWMmsg *msg;
-} SDL_SysWMEvent;
-
-/* General event structure */
-typedef union SDL_Event {
- Uint8 type;
- SDL_ActiveEvent active;
- SDL_KeyboardEvent key;
- SDL_MouseMotionEvent motion;
- SDL_MouseButtonEvent button;
- SDL_JoyAxisEvent jaxis;
- SDL_JoyBallEvent jball;
- SDL_JoyHatEvent jhat;
- SDL_JoyButtonEvent jbutton;
- SDL_ResizeEvent resize;
- SDL_ExposeEvent expose;
- SDL_QuitEvent quit;
- SDL_UserEvent user;
- SDL_SysWMEvent syswm;
-} SDL_Event;
-
-
-/* Function prototypes */
-
-/* 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);
-
-/* Checks the event queue for messages and optionally returns them.
- If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to
- the back of the event queue.
- If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front
- of the event queue, matching 'mask', will be returned and will not
- be removed from the queue.
- If 'action' is SDL_GETEVENT, up to 'numevents' events at the front
- of the event queue, matching 'mask', will be returned and will be
- removed from the queue.
- This function returns the number of events actually stored, or -1
- if there was an error. This function is thread-safe.
-*/
-typedef enum {
- SDL_ADDEVENT,
- SDL_PEEKEVENT,
- SDL_GETEVENT
-} SDL_eventaction;
-/* */
-extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents,
- SDL_eventaction action, Uint32 mask);
-
-/* Polls for currently pending events, and returns 1 if there are any pending
- events, or 0 if there are none available. If 'event' is not NULL, the next
- event is removed from the queue and stored in that area.
- */
-extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event *event);
-
-/* Waits indefinitely for the next available event, returning 1, or 0 if there
- was an error while waiting for events. If 'event' is not NULL, the next
- event is removed from the queue and stored in that area.
- */
-extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event *event);
-
-/* Add an event to the event queue.
- This function returns 0 on success, or -1 if the event queue was full
- or there was some other error.
- */
-extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event);
-
-/*
- This function sets up a filter to process all events before they
- change internal state and are posted to the internal event queue.
-
- The filter is protypted as:
-*/
-typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event);
-/*
- If the filter returns 1, then the event will be added to the internal queue.
- If it returns 0, then the event will be dropped from the queue, 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
- it may run in a different thread!
-
- There is one caveat when dealing with the SDL_QUITEVENT event type. The
- event filter is only called when the window manager desires to close the
- application window. If the event filter returns 1, then the window will
- be closed, otherwise the window will remain open if possible.
- If the quit event is generated by an interrupt signal, it will bypass the
- internal queue and be delivered to the application at the next event poll.
-*/
-extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter);
-
-/*
- Return the current event filter - can be used to "chain" filters.
- If there is no event filter set, this function returns NULL.
-*/
-extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void);
-
-/*
- This function allows you to set the state of processing certain events.
- If 'state' is set to SDL_IGNORE, that event will be automatically dropped
- from the event queue and will not event be filtered.
- If 'state' is set to SDL_ENABLE, that event will be processed normally.
- If 'state' is set to SDL_QUERY, SDL_EventState() will return the
- current processing state of the specified event.
-*/
-#define SDL_QUERY -1
-#define SDL_IGNORE 0
-#define SDL_DISABLE 0
-#define SDL_ENABLE 1
-extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_events_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_getenv.h b/distrib/sdl-1.2.12/include/SDL_getenv.h
deleted file mode 100644
index 853b9ce..0000000
--- a/distrib/sdl-1.2.12/include/SDL_getenv.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* DEPRECATED */
-#include "SDL_stdinc.h"
diff --git a/distrib/sdl-1.2.12/include/SDL_joystick.h b/distrib/sdl-1.2.12/include/SDL_joystick.h
deleted file mode 100644
index e4f72f1..0000000
--- a/distrib/sdl-1.2.12/include/SDL_joystick.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* Include file for SDL joystick event handling */
-
-#ifndef _SDL_joystick_h
-#define _SDL_joystick_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* 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.
-*/
-
-/* The joystick structure used to identify an SDL joystick */
-struct _SDL_Joystick;
-typedef struct _SDL_Joystick SDL_Joystick;
-
-
-/* Function prototypes */
-/*
- * Count the number of joysticks attached to the system
- */
-extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
-
-/*
- * Get the implementation dependent name of a joystick.
- * This can be called before any joysticks are opened.
- * If no name can be found, this function returns NULL.
- */
-extern DECLSPEC const char * SDLCALL SDL_JoystickName(int device_index);
-
-/*
- * Open a joystick for use - the index passed as an argument refers to
- * the N'th joystick on the system. This index is the value which will
- * identify this joystick in future joystick events.
- *
- * This function returns a joystick identifier, or NULL if an error occurred.
- */
-extern DECLSPEC SDL_Joystick * SDLCALL SDL_JoystickOpen(int device_index);
-
-/*
- * Returns 1 if the joystick has been opened, or 0 if it has not.
- */
-extern DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index);
-
-/*
- * Get the device index of an opened joystick.
- */
-extern DECLSPEC int SDLCALL SDL_JoystickIndex(SDL_Joystick *joystick);
-
-/*
- * Get the number of general axis controls on a joystick
- */
-extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick);
-
-/*
- * Get the number of trackballs on a joystick
- * Joystick trackballs have only relative motion events associated
- * with them and their state cannot be polled.
- */
-extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick);
-
-/*
- * Get the number of POV hats on a joystick
- */
-extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick);
-
-/*
- * Get the number of buttons on a joystick
- */
-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.
- */
-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, int axis);
-
-/*
- * Get the current state of a POV hat on a joystick
- * The return value is one of the following 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)
-/*
- * The hat indices start at index 0.
- */
-extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat);
-
-/*
- * Get the ball axis change since the last poll
- * This returns 0, or -1 if you passed it invalid parameters.
- * The ball indices start at index 0.
- */
-extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);
-
-/*
- * 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, int button);
-
-/*
- * Close a joystick previously opened with SDL_JoystickOpen()
- */
-extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_joystick_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_keyboard.h b/distrib/sdl-1.2.12/include/SDL_keyboard.h
deleted file mode 100644
index 1ad7dca..0000000
--- a/distrib/sdl-1.2.12/include/SDL_keyboard.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* Include file for SDL keyboard event handling */
-
-#ifndef _SDL_keyboard_h
-#define _SDL_keyboard_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-#include "SDL_keysym.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Keysym structure
- - The scancode is hardware dependent, and should not be used by general
- applications. If no hardware scancode is available, it will be 0.
-
- - The 'unicode' translated character is only available when character
- translation is enabled by the SDL_EnableUNICODE() API. If non-zero,
- this is a UNICODE character corresponding to the keypress. If the
- high 9 bits of the character are 0, then this maps to the equivalent
- ASCII character:
- char ch;
- if ( (keysym.unicode & 0xFF80) == 0 ) {
- ch = keysym.unicode & 0x7F;
- } else {
- An international character..
- }
- */
-typedef struct SDL_keysym {
- Uint8 scancode; /* hardware specific scancode */
- SDLKey sym; /* SDL virtual keysym */
- SDLMod mod; /* current key modifiers */
- Uint16 unicode; /* translated character */
-} SDL_keysym;
-
-/* This is the mask which refers to all hotkey bindings */
-#define SDL_ALL_HOTKEYS 0xFFFFFFFF
-
-/* Function prototypes */
-/*
- * Enable/Disable UNICODE translation of keyboard input.
- * This translation has some overhead, so translation defaults off.
- * If 'enable' is 1, translation is enabled.
- * If 'enable' is 0, translation is disabled.
- * If 'enable' is -1, the translation state is not changed.
- * It returns the previous state of keyboard translation.
- */
-extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable);
-
-/*
- * Enable/Disable keyboard repeat. Keyboard repeat defaults to off.
- * 'delay' is the initial delay in ms between the time when a key is
- * pressed, and keyboard repeat begins.
- * 'interval' is the time in ms between keyboard repeat events.
- */
-#define SDL_DEFAULT_REPEAT_DELAY 500
-#define SDL_DEFAULT_REPEAT_INTERVAL 30
-/*
- * If 'delay' is set to 0, keyboard repeat is disabled.
- */
-extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval);
-extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval);
-
-/*
- * Get a snapshot of the current state of the keyboard.
- * Returns an array of keystates, indexed by the SDLK_* syms.
- * Used:
- * Uint8 *keystate = SDL_GetKeyState(NULL);
- * if ( keystate[SDLK_RETURN] ) ... <RETURN> is pressed.
- */
-extern DECLSPEC Uint8 * SDLCALL SDL_GetKeyState(int *numkeys);
-
-/*
- * Get the current key modifier state
- */
-extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void);
-
-/*
- * Set the current key modifier state
- * This does not change the keyboard state, only the key modifier flags.
- */
-extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate);
-
-/*
- * Get the name of an SDL virtual keysym
- */
-extern DECLSPEC char * SDLCALL SDL_GetKeyName(SDLKey key);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_keyboard_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_keysym.h b/distrib/sdl-1.2.12/include/SDL_keysym.h
deleted file mode 100644
index ff44a03..0000000
--- a/distrib/sdl-1.2.12/include/SDL_keysym.h
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-#ifndef _SDL_keysym_h
-#define _SDL_keysym_h
-
-/* What we really want is a mapping of every raw key on the keyboard.
- To support international keyboards, we use the range 0xA1 - 0xFF
- as international virtual keycodes. We'll follow in the footsteps of X11...
- The names of the keys
- */
-
-typedef enum {
- /* The keyboard syms have been cleverly chosen to map to ASCII */
- SDLK_UNKNOWN = 0,
- SDLK_FIRST = 0,
- SDLK_BACKSPACE = 8,
- SDLK_TAB = 9,
- SDLK_CLEAR = 12,
- SDLK_RETURN = 13,
- SDLK_PAUSE = 19,
- SDLK_ESCAPE = 27,
- SDLK_SPACE = 32,
- SDLK_EXCLAIM = 33,
- SDLK_QUOTEDBL = 34,
- SDLK_HASH = 35,
- SDLK_DOLLAR = 36,
- SDLK_AMPERSAND = 38,
- SDLK_QUOTE = 39,
- SDLK_LEFTPAREN = 40,
- SDLK_RIGHTPAREN = 41,
- SDLK_ASTERISK = 42,
- SDLK_PLUS = 43,
- SDLK_COMMA = 44,
- SDLK_MINUS = 45,
- SDLK_PERIOD = 46,
- SDLK_SLASH = 47,
- SDLK_0 = 48,
- SDLK_1 = 49,
- SDLK_2 = 50,
- SDLK_3 = 51,
- SDLK_4 = 52,
- SDLK_5 = 53,
- SDLK_6 = 54,
- SDLK_7 = 55,
- SDLK_8 = 56,
- SDLK_9 = 57,
- SDLK_COLON = 58,
- SDLK_SEMICOLON = 59,
- SDLK_LESS = 60,
- SDLK_EQUALS = 61,
- SDLK_GREATER = 62,
- SDLK_QUESTION = 63,
- SDLK_AT = 64,
- /*
- Skip uppercase letters
- */
- SDLK_LEFTBRACKET = 91,
- SDLK_BACKSLASH = 92,
- SDLK_RIGHTBRACKET = 93,
- SDLK_CARET = 94,
- SDLK_UNDERSCORE = 95,
- SDLK_BACKQUOTE = 96,
- SDLK_a = 97,
- SDLK_b = 98,
- SDLK_c = 99,
- SDLK_d = 100,
- SDLK_e = 101,
- SDLK_f = 102,
- SDLK_g = 103,
- SDLK_h = 104,
- SDLK_i = 105,
- SDLK_j = 106,
- SDLK_k = 107,
- SDLK_l = 108,
- SDLK_m = 109,
- SDLK_n = 110,
- SDLK_o = 111,
- SDLK_p = 112,
- SDLK_q = 113,
- SDLK_r = 114,
- SDLK_s = 115,
- SDLK_t = 116,
- SDLK_u = 117,
- SDLK_v = 118,
- SDLK_w = 119,
- SDLK_x = 120,
- SDLK_y = 121,
- SDLK_z = 122,
- SDLK_DELETE = 127,
- /* End of ASCII mapped keysyms */
-
- /* International keyboard syms */
- SDLK_WORLD_0 = 160, /* 0xA0 */
- SDLK_WORLD_1 = 161,
- SDLK_WORLD_2 = 162,
- SDLK_WORLD_3 = 163,
- SDLK_WORLD_4 = 164,
- SDLK_WORLD_5 = 165,
- SDLK_WORLD_6 = 166,
- SDLK_WORLD_7 = 167,
- SDLK_WORLD_8 = 168,
- SDLK_WORLD_9 = 169,
- SDLK_WORLD_10 = 170,
- SDLK_WORLD_11 = 171,
- SDLK_WORLD_12 = 172,
- SDLK_WORLD_13 = 173,
- SDLK_WORLD_14 = 174,
- SDLK_WORLD_15 = 175,
- SDLK_WORLD_16 = 176,
- SDLK_WORLD_17 = 177,
- SDLK_WORLD_18 = 178,
- SDLK_WORLD_19 = 179,
- SDLK_WORLD_20 = 180,
- SDLK_WORLD_21 = 181,
- SDLK_WORLD_22 = 182,
- SDLK_WORLD_23 = 183,
- SDLK_WORLD_24 = 184,
- SDLK_WORLD_25 = 185,
- SDLK_WORLD_26 = 186,
- SDLK_WORLD_27 = 187,
- SDLK_WORLD_28 = 188,
- SDLK_WORLD_29 = 189,
- SDLK_WORLD_30 = 190,
- SDLK_WORLD_31 = 191,
- SDLK_WORLD_32 = 192,
- SDLK_WORLD_33 = 193,
- SDLK_WORLD_34 = 194,
- SDLK_WORLD_35 = 195,
- SDLK_WORLD_36 = 196,
- SDLK_WORLD_37 = 197,
- SDLK_WORLD_38 = 198,
- SDLK_WORLD_39 = 199,
- SDLK_WORLD_40 = 200,
- SDLK_WORLD_41 = 201,
- SDLK_WORLD_42 = 202,
- SDLK_WORLD_43 = 203,
- SDLK_WORLD_44 = 204,
- SDLK_WORLD_45 = 205,
- SDLK_WORLD_46 = 206,
- SDLK_WORLD_47 = 207,
- SDLK_WORLD_48 = 208,
- SDLK_WORLD_49 = 209,
- SDLK_WORLD_50 = 210,
- SDLK_WORLD_51 = 211,
- SDLK_WORLD_52 = 212,
- SDLK_WORLD_53 = 213,
- SDLK_WORLD_54 = 214,
- SDLK_WORLD_55 = 215,
- SDLK_WORLD_56 = 216,
- SDLK_WORLD_57 = 217,
- SDLK_WORLD_58 = 218,
- SDLK_WORLD_59 = 219,
- SDLK_WORLD_60 = 220,
- SDLK_WORLD_61 = 221,
- SDLK_WORLD_62 = 222,
- SDLK_WORLD_63 = 223,
- SDLK_WORLD_64 = 224,
- SDLK_WORLD_65 = 225,
- SDLK_WORLD_66 = 226,
- SDLK_WORLD_67 = 227,
- SDLK_WORLD_68 = 228,
- SDLK_WORLD_69 = 229,
- SDLK_WORLD_70 = 230,
- SDLK_WORLD_71 = 231,
- SDLK_WORLD_72 = 232,
- SDLK_WORLD_73 = 233,
- SDLK_WORLD_74 = 234,
- SDLK_WORLD_75 = 235,
- SDLK_WORLD_76 = 236,
- SDLK_WORLD_77 = 237,
- SDLK_WORLD_78 = 238,
- SDLK_WORLD_79 = 239,
- SDLK_WORLD_80 = 240,
- SDLK_WORLD_81 = 241,
- SDLK_WORLD_82 = 242,
- SDLK_WORLD_83 = 243,
- SDLK_WORLD_84 = 244,
- SDLK_WORLD_85 = 245,
- SDLK_WORLD_86 = 246,
- SDLK_WORLD_87 = 247,
- SDLK_WORLD_88 = 248,
- SDLK_WORLD_89 = 249,
- SDLK_WORLD_90 = 250,
- SDLK_WORLD_91 = 251,
- SDLK_WORLD_92 = 252,
- SDLK_WORLD_93 = 253,
- SDLK_WORLD_94 = 254,
- SDLK_WORLD_95 = 255, /* 0xFF */
-
- /* Numeric keypad */
- SDLK_KP0 = 256,
- SDLK_KP1 = 257,
- SDLK_KP2 = 258,
- SDLK_KP3 = 259,
- SDLK_KP4 = 260,
- SDLK_KP5 = 261,
- SDLK_KP6 = 262,
- SDLK_KP7 = 263,
- SDLK_KP8 = 264,
- SDLK_KP9 = 265,
- SDLK_KP_PERIOD = 266,
- SDLK_KP_DIVIDE = 267,
- SDLK_KP_MULTIPLY = 268,
- SDLK_KP_MINUS = 269,
- SDLK_KP_PLUS = 270,
- SDLK_KP_ENTER = 271,
- SDLK_KP_EQUALS = 272,
-
- /* Arrows + Home/End pad */
- SDLK_UP = 273,
- SDLK_DOWN = 274,
- SDLK_RIGHT = 275,
- SDLK_LEFT = 276,
- SDLK_INSERT = 277,
- SDLK_HOME = 278,
- SDLK_END = 279,
- SDLK_PAGEUP = 280,
- SDLK_PAGEDOWN = 281,
-
- /* Function keys */
- SDLK_F1 = 282,
- SDLK_F2 = 283,
- SDLK_F3 = 284,
- SDLK_F4 = 285,
- SDLK_F5 = 286,
- SDLK_F6 = 287,
- SDLK_F7 = 288,
- SDLK_F8 = 289,
- SDLK_F9 = 290,
- SDLK_F10 = 291,
- SDLK_F11 = 292,
- SDLK_F12 = 293,
- SDLK_F13 = 294,
- SDLK_F14 = 295,
- SDLK_F15 = 296,
-
- /* Key state modifier keys */
- SDLK_NUMLOCK = 300,
- SDLK_CAPSLOCK = 301,
- SDLK_SCROLLOCK = 302,
- SDLK_RSHIFT = 303,
- SDLK_LSHIFT = 304,
- SDLK_RCTRL = 305,
- SDLK_LCTRL = 306,
- SDLK_RALT = 307,
- SDLK_LALT = 308,
- SDLK_RMETA = 309,
- SDLK_LMETA = 310,
- SDLK_LSUPER = 311, /* Left "Windows" key */
- SDLK_RSUPER = 312, /* Right "Windows" key */
- SDLK_MODE = 313, /* "Alt Gr" key */
- SDLK_COMPOSE = 314, /* Multi-key compose key */
-
- /* Miscellaneous function keys */
- SDLK_HELP = 315,
- SDLK_PRINT = 316,
- SDLK_SYSREQ = 317,
- SDLK_BREAK = 318,
- SDLK_MENU = 319,
- SDLK_POWER = 320, /* Power Macintosh power key */
- SDLK_EURO = 321, /* Some european keyboards */
- SDLK_UNDO = 322, /* Atari keyboard has Undo */
-
- /* Add any other keys here */
-
- SDLK_LAST
-} SDLKey;
-
-/* Enumeration of valid key mods (possibly OR'd together) */
-typedef enum {
- KMOD_NONE = 0x0000,
- KMOD_LSHIFT= 0x0001,
- KMOD_RSHIFT= 0x0002,
- KMOD_LCTRL = 0x0040,
- KMOD_RCTRL = 0x0080,
- KMOD_LALT = 0x0100,
- KMOD_RALT = 0x0200,
- KMOD_LMETA = 0x0400,
- KMOD_RMETA = 0x0800,
- KMOD_NUM = 0x1000,
- KMOD_CAPS = 0x2000,
- KMOD_MODE = 0x4000,
- KMOD_RESERVED = 0x8000
-} SDLMod;
-
-#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
-#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
-#define KMOD_ALT (KMOD_LALT|KMOD_RALT)
-#define KMOD_META (KMOD_LMETA|KMOD_RMETA)
-
-#endif /* _SDL_keysym_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_loadso.h b/distrib/sdl-1.2.12/include/SDL_loadso.h
deleted file mode 100644
index ce96449..0000000
--- a/distrib/sdl-1.2.12/include/SDL_loadso.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* System dependent library loading routines */
-
-/* Some things to keep in mind:
- - These functions only work on C function names. Other languages may
- have name mangling and intrinsic language support that varies from
- compiler to compiler.
- - Make sure you declare your function pointers with the same calling
- convention as the actual library function. Your code will crash
- mysteriously if you do not do this.
- - Avoid namespace collisions. If you load a symbol from the library,
- it is not defined whether or not it goes into the global symbol
- namespace for the application. If it does and it conflicts with
- symbols in your code or other shared libraries, you will not get
- the results you expect. :)
-*/
-
-
-#ifndef _SDL_loadso_h
-#define _SDL_loadso_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* This function dynamically loads a shared object and returns a pointer
- * to the object handle (or NULL if there was an error).
- * The 'sofile' parameter is a system dependent name of the object file.
- */
-extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile);
-
-/* Given an object handle, this function looks up the address of the
- * named function in the shared object and returns it. This address
- * is no longer valid after calling SDL_UnloadObject().
- */
-extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name);
-
-/* Unload a shared object from memory */
-extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_loadso_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_main.h b/distrib/sdl-1.2.12/include/SDL_main.h
deleted file mode 100644
index cf8b728..0000000
--- a/distrib/sdl-1.2.12/include/SDL_main.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-#ifndef _SDL_main_h
-#define _SDL_main_h
-
-#include "SDL_stdinc.h"
-
-/* Redefine main() on Win32 and MacOS so that it is called by winmain.c */
-
-#if defined(__WIN32__) || \
- (defined(__MWERKS__) && !defined(__BEOS__)) || \
- defined(__MACOS__) || defined(__MACOSX__) || \
- defined(__SYMBIAN32__) || defined(QWS)
-
-#ifdef __cplusplus
-#define C_LINKAGE "C"
-#else
-#define C_LINKAGE
-#endif /* __cplusplus */
-
-/* The application's main() function must be called with C linkage,
- and should be declared like this:
-#ifdef __cplusplus
-extern "C"
-#endif
- int main(int argc, char *argv[])
- {
- }
- */
-#define main SDL_main
-
-/* The prototype for the application's main() function */
-extern C_LINKAGE int SDL_main(int argc, char *argv[]);
-
-
-/* From the SDL library code -- needed for registering the app on Win32 */
-#ifdef __WIN32__
-
-#include "begin_code.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* This should be called from your WinMain() function, if any */
-extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst);
-/* This can also be called, but is no longer necessary */
-extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst);
-/* This can also be called, but is no longer necessary (SDL_Quit calls it) */
-extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-#endif
-
-/* From the SDL library code -- needed for registering QuickDraw on MacOS */
-#if defined(__MACOS__)
-
-#include "begin_code.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Forward declaration so we don't need to include QuickDraw.h */
-struct QDGlobals;
-
-/* This should be called from your main() function, if any */
-extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd);
-
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-#endif
-
-#endif /* Need to redefine main()? */
-
-#endif /* _SDL_main_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_mouse.h b/distrib/sdl-1.2.12/include/SDL_mouse.h
deleted file mode 100644
index c2364d8..0000000
--- a/distrib/sdl-1.2.12/include/SDL_mouse.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* Include file for SDL mouse event handling */
-
-#ifndef _SDL_mouse_h
-#define _SDL_mouse_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-#include "SDL_video.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct WMcursor WMcursor; /* Implementation dependent */
-typedef struct SDL_Cursor {
- SDL_Rect area; /* The area of the mouse cursor */
- Sint16 hot_x, hot_y; /* The "tip" of the cursor */
- Uint8 *data; /* B/W cursor data */
- Uint8 *mask; /* B/W cursor mask */
- Uint8 *save[2]; /* Place to save cursor area */
- WMcursor *wm_cursor; /* Window-manager cursor */
-} SDL_Cursor;
-
-/* Function prototypes */
-/*
- * Retrieve the current state of the mouse.
- * The current button state is returned as a button bitmask, which can
- * be tested using the SDL_BUTTON(X) macros, and x and y are set to the
- * current mouse cursor position. You can pass NULL for either x or y.
- */
-extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y);
-
-/*
- * Retrieve the current state of the mouse.
- * The current button state is returned as a button bitmask, which can
- * be tested using the SDL_BUTTON(X) macros, and x and y are set to the
- * mouse deltas since the last call to SDL_GetRelativeMouseState().
- */
-extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
-
-/*
- * Set the position of the mouse cursor (generates a mouse motion event)
- */
-extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);
-
-/*
- * Create a cursor using the specified data and mask (in MSB format).
- * The cursor width must be a multiple of 8 bits.
- *
- * The cursor is created in black and white according to the following:
- * data mask resulting pixel on screen
- * 0 1 White
- * 1 1 Black
- * 0 0 Transparent
- * 1 0 Inverted color if possible, black if not.
- *
- * Cursors created with this function must be freed with SDL_FreeCursor().
- */
-extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor
- (Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
-
-/*
- * Set the currently active cursor to the specified one.
- * If the cursor is currently visible, the change will be immediately
- * represented on the display.
- */
-extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor);
-
-/*
- * Returns the currently active cursor.
- */
-extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void);
-
-/*
- * Deallocates a cursor created with SDL_CreateCursor().
- */
-extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor);
-
-/*
- * Toggle whether or not the cursor is shown on the screen.
- * The cursor start off displayed, but can be turned off.
- * SDL_ShowCursor() returns 1 if the cursor was being displayed
- * before the call, or 0 if it was not. You can query the current
- * state by passing a 'toggle' value of -1.
- */
-extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
-
-/* Used as a mask when testing buttons in buttonstate
- Button 1: Left mouse button
- Button 2: Middle mouse button
- Button 3: Right mouse button
- Button 4: Mouse wheel up (may also be a real button)
- Button 5: Mouse wheel down (may also be a real button)
- */
-#define SDL_BUTTON(X) (1 << ((X)-1))
-#define SDL_BUTTON_LEFT 1
-#define SDL_BUTTON_MIDDLE 2
-#define SDL_BUTTON_RIGHT 3
-#define SDL_BUTTON_WHEELUP 4
-#define SDL_BUTTON_WHEELDOWN 5
-#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)
-#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)
-#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_mouse_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_mutex.h b/distrib/sdl-1.2.12/include/SDL_mutex.h
deleted file mode 100644
index 0016528..0000000
--- a/distrib/sdl-1.2.12/include/SDL_mutex.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-#ifndef _SDL_mutex_h
-#define _SDL_mutex_h
-
-/* Functions to provide thread synchronization primitives
-
- These are independent of the other SDL routines.
-*/
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Synchronization functions which can time out return this value
- if they time out.
-*/
-#define SDL_MUTEX_TIMEDOUT 1
-
-/* This is the timeout value which corresponds to never time out */
-#define SDL_MUTEX_MAXWAIT (~(Uint32)0)
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Mutex functions */
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/* The SDL mutex structure, defined in SDL_mutex.c */
-struct SDL_mutex;
-typedef struct SDL_mutex SDL_mutex;
-
-/* Create a mutex, initialized unlocked */
-extern DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void);
-
-/* Lock the mutex (Returns 0, or -1 on error) */
-#define SDL_LockMutex(m) SDL_mutexP(m)
-extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex);
-
-/* Unlock the mutex (Returns 0, or -1 on error)
- 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_UnlockMutex(m) SDL_mutexV(m)
-extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex);
-
-/* Destroy a mutex */
-extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex);
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Semaphore functions */
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/* The SDL semaphore structure, defined in SDL_sem.c */
-struct SDL_semaphore;
-typedef struct SDL_semaphore SDL_sem;
-
-/* Create a semaphore, initialized with value, returns NULL on failure. */
-extern DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value);
-
-/* Destroy a semaphore */
-extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem);
-
-/* This function suspends the calling thread until the semaphore pointed
- * to by sem has a positive count. It then atomically decreases the semaphore
- * count.
- */
-extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem);
-
-/* Non-blocking variant of SDL_SemWait(), returns 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, returns 0 if
- the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in
- the allotted time, and -1 on error.
- On some platforms this function is implemented by looping with a delay
- of 1 ms, and so should be avoided if possible.
-*/
-extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms);
-
-/* Atomically increases the semaphore's count (not blocking), returns 0,
- or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem);
-
-/* Returns the current count of the semaphore */
-extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem);
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Condition variable functions */
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/* The SDL condition variable structure, defined in SDL_cond.c */
-struct SDL_cond;
-typedef struct SDL_cond SDL_cond;
-
-/* Create a condition variable */
-extern DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void);
-
-/* Destroy a condition variable */
-extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond);
-
-/* Restart one of the threads that are waiting on the condition variable,
- returns 0 or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond);
-
-/* Restart all threads that are waiting on the condition variable,
- returns 0 or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond);
-
-/* Wait on the condition variable, unlocking the provided mutex.
- The mutex must be locked before entering this function!
- The mutex is re-locked once the condition variable is signaled.
- Returns 0 when it is signaled, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond *cond, SDL_mutex *mut);
-
-/* Waits for at most 'ms' milliseconds, and returns 0 if the condition
- variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not
- signaled in the allotted time, and -1 on error.
- On some platforms this function is implemented by looping with a delay
- of 1 ms, and so should be avoided if possible.
-*/
-extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_mutex_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_opengl.h b/distrib/sdl-1.2.12/include/SDL_opengl.h
deleted file mode 100644
index 36c0a30..0000000
--- a/distrib/sdl-1.2.12/include/SDL_opengl.h
+++ /dev/null
@@ -1,6551 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* This is a simple file to encapsulate the OpenGL API headers */
-
-#include "SDL_config.h"
-
-#ifdef __WIN32__
-#define WIN32_LEAN_AND_MEAN
-#ifndef NOMINMAX
-#define NOMINMAX /* Don't defined min() and max() */
-#endif
-#include <windows.h>
-#endif
-#ifndef NO_SDL_GLEXT
-#define __glext_h_ /* Don't let gl.h include glext.h */
-#endif
-#if defined(__MACOSX__)
-#include <OpenGL/gl.h> /* Header File For The OpenGL Library */
-#include <OpenGL/glu.h> /* Header File For The GLU Library */
-#elif defined(__MACOS__)
-#include <gl.h> /* Header File For The OpenGL Library */
-#include <glu.h> /* Header File For The GLU Library */
-#else
-#include <GL/gl.h> /* Header File For The OpenGL Library */
-#include <GL/glu.h> /* Header File For The GLU Library */
-#endif
-#ifndef NO_SDL_GLEXT
-#undef __glext_h_
-#endif
-
-/* This file taken from "GLext.h" from the Jeff Molofee OpenGL tutorials.
- It is included here because glext.h is not available on some systems.
- If you don't want this version included, simply define "NO_SDL_GLEXT"
- */
-#ifndef NO_SDL_GLEXT
-#if !defined(__glext_h_) && !defined(GL_GLEXT_LEGACY)
-#define __glext_h_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.1 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: This software was created using the
-** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
-** not been independently verified as being compliant with the OpenGL(R)
-** version 1.2.1 Specification.
-*/
-
-#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
-#define WIN32_LEAN_AND_MEAN 1
-#include <windows.h>
-#endif
-
-#ifndef APIENTRY
-#define APIENTRY
-#endif
-#ifndef APIENTRYP
-#define APIENTRYP APIENTRY *
-#endif
-#ifndef GLAPI
-#define GLAPI extern
-#endif
-
-/*************************************************************/
-
-/* Header file version number, required by OpenGL ABI for Linux */
-/* glext.h last updated 2005/06/20 */
-/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
-#define GL_GLEXT_VERSION 29
-
-#ifndef GL_VERSION_1_2
-#define GL_UNSIGNED_BYTE_3_3_2 0x8032
-#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
-#define GL_UNSIGNED_INT_8_8_8_8 0x8035
-#define GL_UNSIGNED_INT_10_10_10_2 0x8036
-#define GL_RESCALE_NORMAL 0x803A
-#define GL_TEXTURE_BINDING_3D 0x806A
-#define GL_PACK_SKIP_IMAGES 0x806B
-#define GL_PACK_IMAGE_HEIGHT 0x806C
-#define GL_UNPACK_SKIP_IMAGES 0x806D
-#define GL_UNPACK_IMAGE_HEIGHT 0x806E
-#define GL_TEXTURE_3D 0x806F
-#define GL_PROXY_TEXTURE_3D 0x8070
-#define GL_TEXTURE_DEPTH 0x8071
-#define GL_TEXTURE_WRAP_R 0x8072
-#define GL_MAX_3D_TEXTURE_SIZE 0x8073
-#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
-#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
-#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
-#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
-#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
-#define GL_BGR 0x80E0
-#define GL_BGRA 0x80E1
-#define GL_MAX_ELEMENTS_VERTICES 0x80E8
-#define GL_MAX_ELEMENTS_INDICES 0x80E9
-#define GL_CLAMP_TO_EDGE 0x812F
-#define GL_TEXTURE_MIN_LOD 0x813A
-#define GL_TEXTURE_MAX_LOD 0x813B
-#define GL_TEXTURE_BASE_LEVEL 0x813C
-#define GL_TEXTURE_MAX_LEVEL 0x813D
-#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
-#define GL_SINGLE_COLOR 0x81F9
-#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
-#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
-#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
-#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
-#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
-#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
-#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-#endif
-
-#ifndef GL_ARB_imaging
-#define GL_CONSTANT_COLOR 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
-#define GL_CONSTANT_ALPHA 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
-#define GL_BLEND_COLOR 0x8005
-#define GL_FUNC_ADD 0x8006
-#define GL_MIN 0x8007
-#define GL_MAX 0x8008
-#define GL_BLEND_EQUATION 0x8009
-#define GL_FUNC_SUBTRACT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT 0x800B
-#define GL_CONVOLUTION_1D 0x8010
-#define GL_CONVOLUTION_2D 0x8011
-#define GL_SEPARABLE_2D 0x8012
-#define GL_CONVOLUTION_BORDER_MODE 0x8013
-#define GL_CONVOLUTION_FILTER_SCALE 0x8014
-#define GL_CONVOLUTION_FILTER_BIAS 0x8015
-#define GL_REDUCE 0x8016
-#define GL_CONVOLUTION_FORMAT 0x8017
-#define GL_CONVOLUTION_WIDTH 0x8018
-#define GL_CONVOLUTION_HEIGHT 0x8019
-#define GL_MAX_CONVOLUTION_WIDTH 0x801A
-#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
-#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
-#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
-#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
-#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
-#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
-#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
-#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
-#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
-#define GL_HISTOGRAM 0x8024
-#define GL_PROXY_HISTOGRAM 0x8025
-#define GL_HISTOGRAM_WIDTH 0x8026
-#define GL_HISTOGRAM_FORMAT 0x8027
-#define GL_HISTOGRAM_RED_SIZE 0x8028
-#define GL_HISTOGRAM_GREEN_SIZE 0x8029
-#define GL_HISTOGRAM_BLUE_SIZE 0x802A
-#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
-#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
-#define GL_HISTOGRAM_SINK 0x802D
-#define GL_MINMAX 0x802E
-#define GL_MINMAX_FORMAT 0x802F
-#define GL_MINMAX_SINK 0x8030
-#define GL_TABLE_TOO_LARGE 0x8031
-#define GL_COLOR_MATRIX 0x80B1
-#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
-#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
-#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
-#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
-#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
-#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
-#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
-#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
-#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
-#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
-#define GL_COLOR_TABLE 0x80D0
-#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
-#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
-#define GL_PROXY_COLOR_TABLE 0x80D3
-#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
-#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
-#define GL_COLOR_TABLE_SCALE 0x80D6
-#define GL_COLOR_TABLE_BIAS 0x80D7
-#define GL_COLOR_TABLE_FORMAT 0x80D8
-#define GL_COLOR_TABLE_WIDTH 0x80D9
-#define GL_COLOR_TABLE_RED_SIZE 0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
-#define GL_CONSTANT_BORDER 0x8151
-#define GL_REPLICATE_BORDER 0x8153
-#define GL_CONVOLUTION_BORDER_COLOR 0x8154
-#endif
-
-#ifndef GL_VERSION_1_3
-#define GL_TEXTURE0 0x84C0
-#define GL_TEXTURE1 0x84C1
-#define GL_TEXTURE2 0x84C2
-#define GL_TEXTURE3 0x84C3
-#define GL_TEXTURE4 0x84C4
-#define GL_TEXTURE5 0x84C5
-#define GL_TEXTURE6 0x84C6
-#define GL_TEXTURE7 0x84C7
-#define GL_TEXTURE8 0x84C8
-#define GL_TEXTURE9 0x84C9
-#define GL_TEXTURE10 0x84CA
-#define GL_TEXTURE11 0x84CB
-#define GL_TEXTURE12 0x84CC
-#define GL_TEXTURE13 0x84CD
-#define GL_TEXTURE14 0x84CE
-#define GL_TEXTURE15 0x84CF
-#define GL_TEXTURE16 0x84D0
-#define GL_TEXTURE17 0x84D1
-#define GL_TEXTURE18 0x84D2
-#define GL_TEXTURE19 0x84D3
-#define GL_TEXTURE20 0x84D4
-#define GL_TEXTURE21 0x84D5
-#define GL_TEXTURE22 0x84D6
-#define GL_TEXTURE23 0x84D7
-#define GL_TEXTURE24 0x84D8
-#define GL_TEXTURE25 0x84D9
-#define GL_TEXTURE26 0x84DA
-#define GL_TEXTURE27 0x84DB
-#define GL_TEXTURE28 0x84DC
-#define GL_TEXTURE29 0x84DD
-#define GL_TEXTURE30 0x84DE
-#define GL_TEXTURE31 0x84DF
-#define GL_ACTIVE_TEXTURE 0x84E0
-#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
-#define GL_MAX_TEXTURE_UNITS 0x84E2
-#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
-#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
-#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
-#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
-#define GL_MULTISAMPLE 0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
-#define GL_SAMPLE_COVERAGE 0x80A0
-#define GL_SAMPLE_BUFFERS 0x80A8
-#define GL_SAMPLES 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
-#define GL_MULTISAMPLE_BIT 0x20000000
-#define GL_NORMAL_MAP 0x8511
-#define GL_REFLECTION_MAP 0x8512
-#define GL_TEXTURE_CUBE_MAP 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
-#define GL_COMPRESSED_ALPHA 0x84E9
-#define GL_COMPRESSED_LUMINANCE 0x84EA
-#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
-#define GL_COMPRESSED_INTENSITY 0x84EC
-#define GL_COMPRESSED_RGB 0x84ED
-#define GL_COMPRESSED_RGBA 0x84EE
-#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
-#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
-#define GL_TEXTURE_COMPRESSED 0x86A1
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
-#define GL_CLAMP_TO_BORDER 0x812D
-#define GL_COMBINE 0x8570
-#define GL_COMBINE_RGB 0x8571
-#define GL_COMBINE_ALPHA 0x8572
-#define GL_SOURCE0_RGB 0x8580
-#define GL_SOURCE1_RGB 0x8581
-#define GL_SOURCE2_RGB 0x8582
-#define GL_SOURCE0_ALPHA 0x8588
-#define GL_SOURCE1_ALPHA 0x8589
-#define GL_SOURCE2_ALPHA 0x858A
-#define GL_OPERAND0_RGB 0x8590
-#define GL_OPERAND1_RGB 0x8591
-#define GL_OPERAND2_RGB 0x8592
-#define GL_OPERAND0_ALPHA 0x8598
-#define GL_OPERAND1_ALPHA 0x8599
-#define GL_OPERAND2_ALPHA 0x859A
-#define GL_RGB_SCALE 0x8573
-#define GL_ADD_SIGNED 0x8574
-#define GL_INTERPOLATE 0x8575
-#define GL_SUBTRACT 0x84E7
-#define GL_CONSTANT 0x8576
-#define GL_PRIMARY_COLOR 0x8577
-#define GL_PREVIOUS 0x8578
-#define GL_DOT3_RGB 0x86AE
-#define GL_DOT3_RGBA 0x86AF
-#endif
-
-#ifndef GL_VERSION_1_4
-#define GL_BLEND_DST_RGB 0x80C8
-#define GL_BLEND_SRC_RGB 0x80C9
-#define GL_BLEND_DST_ALPHA 0x80CA
-#define GL_BLEND_SRC_ALPHA 0x80CB
-#define GL_POINT_SIZE_MIN 0x8126
-#define GL_POINT_SIZE_MAX 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
-#define GL_POINT_DISTANCE_ATTENUATION 0x8129
-#define GL_GENERATE_MIPMAP 0x8191
-#define GL_GENERATE_MIPMAP_HINT 0x8192
-#define GL_DEPTH_COMPONENT16 0x81A5
-#define GL_DEPTH_COMPONENT24 0x81A6
-#define GL_DEPTH_COMPONENT32 0x81A7
-#define GL_MIRRORED_REPEAT 0x8370
-#define GL_FOG_COORDINATE_SOURCE 0x8450
-#define GL_FOG_COORDINATE 0x8451
-#define GL_FRAGMENT_DEPTH 0x8452
-#define GL_CURRENT_FOG_COORDINATE 0x8453
-#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454
-#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455
-#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456
-#define GL_FOG_COORDINATE_ARRAY 0x8457
-#define GL_COLOR_SUM 0x8458
-#define GL_CURRENT_SECONDARY_COLOR 0x8459
-#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A
-#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B
-#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C
-#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
-#define GL_SECONDARY_COLOR_ARRAY 0x845E
-#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
-#define GL_TEXTURE_FILTER_CONTROL 0x8500
-#define GL_TEXTURE_LOD_BIAS 0x8501
-#define GL_INCR_WRAP 0x8507
-#define GL_DECR_WRAP 0x8508
-#define GL_TEXTURE_DEPTH_SIZE 0x884A
-#define GL_DEPTH_TEXTURE_MODE 0x884B
-#define GL_TEXTURE_COMPARE_MODE 0x884C
-#define GL_TEXTURE_COMPARE_FUNC 0x884D
-#define GL_COMPARE_R_TO_TEXTURE 0x884E
-#endif
-
-#ifndef GL_VERSION_1_5
-#define GL_BUFFER_SIZE 0x8764
-#define GL_BUFFER_USAGE 0x8765
-#define GL_QUERY_COUNTER_BITS 0x8864
-#define GL_CURRENT_QUERY 0x8865
-#define GL_QUERY_RESULT 0x8866
-#define GL_QUERY_RESULT_AVAILABLE 0x8867
-#define GL_ARRAY_BUFFER 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER 0x8893
-#define GL_ARRAY_BUFFER_BINDING 0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
-#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
-#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
-#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
-#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899
-#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
-#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
-#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
-#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
-#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
-#define GL_READ_ONLY 0x88B8
-#define GL_WRITE_ONLY 0x88B9
-#define GL_READ_WRITE 0x88BA
-#define GL_BUFFER_ACCESS 0x88BB
-#define GL_BUFFER_MAPPED 0x88BC
-#define GL_BUFFER_MAP_POINTER 0x88BD
-#define GL_STREAM_DRAW 0x88E0
-#define GL_STREAM_READ 0x88E1
-#define GL_STREAM_COPY 0x88E2
-#define GL_STATIC_DRAW 0x88E4
-#define GL_STATIC_READ 0x88E5
-#define GL_STATIC_COPY 0x88E6
-#define GL_DYNAMIC_DRAW 0x88E8
-#define GL_DYNAMIC_READ 0x88E9
-#define GL_DYNAMIC_COPY 0x88EA
-#define GL_SAMPLES_PASSED 0x8914
-#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE
-#define GL_FOG_COORD GL_FOG_COORDINATE
-#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE
-#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE
-#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE
-#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER
-#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY
-#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING
-#define GL_SRC0_RGB GL_SOURCE0_RGB
-#define GL_SRC1_RGB GL_SOURCE1_RGB
-#define GL_SRC2_RGB GL_SOURCE2_RGB
-#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA
-#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA
-#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA
-#endif
-
-#ifndef GL_VERSION_2_0
-#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
-#define GL_CURRENT_VERTEX_ATTRIB 0x8626
-#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
-#define GL_STENCIL_BACK_FUNC 0x8800
-#define GL_STENCIL_BACK_FAIL 0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
-#define GL_MAX_DRAW_BUFFERS 0x8824
-#define GL_DRAW_BUFFER0 0x8825
-#define GL_DRAW_BUFFER1 0x8826
-#define GL_DRAW_BUFFER2 0x8827
-#define GL_DRAW_BUFFER3 0x8828
-#define GL_DRAW_BUFFER4 0x8829
-#define GL_DRAW_BUFFER5 0x882A
-#define GL_DRAW_BUFFER6 0x882B
-#define GL_DRAW_BUFFER7 0x882C
-#define GL_DRAW_BUFFER8 0x882D
-#define GL_DRAW_BUFFER9 0x882E
-#define GL_DRAW_BUFFER10 0x882F
-#define GL_DRAW_BUFFER11 0x8830
-#define GL_DRAW_BUFFER12 0x8831
-#define GL_DRAW_BUFFER13 0x8832
-#define GL_DRAW_BUFFER14 0x8833
-#define GL_DRAW_BUFFER15 0x8834
-#define GL_BLEND_EQUATION_ALPHA 0x883D
-#define GL_POINT_SPRITE 0x8861
-#define GL_COORD_REPLACE 0x8862
-#define GL_MAX_VERTEX_ATTRIBS 0x8869
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
-#define GL_MAX_TEXTURE_COORDS 0x8871
-#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
-#define GL_FRAGMENT_SHADER 0x8B30
-#define GL_VERTEX_SHADER 0x8B31
-#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
-#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
-#define GL_MAX_VARYING_FLOATS 0x8B4B
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
-#define GL_SHADER_TYPE 0x8B4F
-#define GL_FLOAT_VEC2 0x8B50
-#define GL_FLOAT_VEC3 0x8B51
-#define GL_FLOAT_VEC4 0x8B52
-#define GL_INT_VEC2 0x8B53
-#define GL_INT_VEC3 0x8B54
-#define GL_INT_VEC4 0x8B55
-#define GL_BOOL 0x8B56
-#define GL_BOOL_VEC2 0x8B57
-#define GL_BOOL_VEC3 0x8B58
-#define GL_BOOL_VEC4 0x8B59
-#define GL_FLOAT_MAT2 0x8B5A
-#define GL_FLOAT_MAT3 0x8B5B
-#define GL_FLOAT_MAT4 0x8B5C
-#define GL_SAMPLER_1D 0x8B5D
-#define GL_SAMPLER_2D 0x8B5E
-#define GL_SAMPLER_3D 0x8B5F
-#define GL_SAMPLER_CUBE 0x8B60
-#define GL_SAMPLER_1D_SHADOW 0x8B61
-#define GL_SAMPLER_2D_SHADOW 0x8B62
-#define GL_DELETE_STATUS 0x8B80
-#define GL_COMPILE_STATUS 0x8B81
-#define GL_LINK_STATUS 0x8B82
-#define GL_VALIDATE_STATUS 0x8B83
-#define GL_INFO_LOG_LENGTH 0x8B84
-#define GL_ATTACHED_SHADERS 0x8B85
-#define GL_ACTIVE_UNIFORMS 0x8B86
-#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
-#define GL_SHADER_SOURCE_LENGTH 0x8B88
-#define GL_ACTIVE_ATTRIBUTES 0x8B89
-#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
-#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
-#define GL_CURRENT_PROGRAM 0x8B8D
-#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
-#define GL_LOWER_LEFT 0x8CA1
-#define GL_UPPER_LEFT 0x8CA2
-#define GL_STENCIL_BACK_REF 0x8CA3
-#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
-#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
-#endif
-
-#ifndef GL_ARB_multitexture
-#define GL_TEXTURE0_ARB 0x84C0
-#define GL_TEXTURE1_ARB 0x84C1
-#define GL_TEXTURE2_ARB 0x84C2
-#define GL_TEXTURE3_ARB 0x84C3
-#define GL_TEXTURE4_ARB 0x84C4
-#define GL_TEXTURE5_ARB 0x84C5
-#define GL_TEXTURE6_ARB 0x84C6
-#define GL_TEXTURE7_ARB 0x84C7
-#define GL_TEXTURE8_ARB 0x84C8
-#define GL_TEXTURE9_ARB 0x84C9
-#define GL_TEXTURE10_ARB 0x84CA
-#define GL_TEXTURE11_ARB 0x84CB
-#define GL_TEXTURE12_ARB 0x84CC
-#define GL_TEXTURE13_ARB 0x84CD
-#define GL_TEXTURE14_ARB 0x84CE
-#define GL_TEXTURE15_ARB 0x84CF
-#define GL_TEXTURE16_ARB 0x84D0
-#define GL_TEXTURE17_ARB 0x84D1
-#define GL_TEXTURE18_ARB 0x84D2
-#define GL_TEXTURE19_ARB 0x84D3
-#define GL_TEXTURE20_ARB 0x84D4
-#define GL_TEXTURE21_ARB 0x84D5
-#define GL_TEXTURE22_ARB 0x84D6
-#define GL_TEXTURE23_ARB 0x84D7
-#define GL_TEXTURE24_ARB 0x84D8
-#define GL_TEXTURE25_ARB 0x84D9
-#define GL_TEXTURE26_ARB 0x84DA
-#define GL_TEXTURE27_ARB 0x84DB
-#define GL_TEXTURE28_ARB 0x84DC
-#define GL_TEXTURE29_ARB 0x84DD
-#define GL_TEXTURE30_ARB 0x84DE
-#define GL_TEXTURE31_ARB 0x84DF
-#define GL_ACTIVE_TEXTURE_ARB 0x84E0
-#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
-#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
-#endif
-
-#ifndef GL_ARB_transpose_matrix
-#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3
-#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4
-#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5
-#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6
-#endif
-
-#ifndef GL_ARB_multisample
-#define GL_MULTISAMPLE_ARB 0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F
-#define GL_SAMPLE_COVERAGE_ARB 0x80A0
-#define GL_SAMPLE_BUFFERS_ARB 0x80A8
-#define GL_SAMPLES_ARB 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB
-#define GL_MULTISAMPLE_BIT_ARB 0x20000000
-#endif
-
-#ifndef GL_ARB_texture_env_add
-#endif
-
-#ifndef GL_ARB_texture_cube_map
-#define GL_NORMAL_MAP_ARB 0x8511
-#define GL_REFLECTION_MAP_ARB 0x8512
-#define GL_TEXTURE_CUBE_MAP_ARB 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C
-#endif
-
-#ifndef GL_ARB_texture_compression
-#define GL_COMPRESSED_ALPHA_ARB 0x84E9
-#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA
-#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
-#define GL_COMPRESSED_INTENSITY_ARB 0x84EC
-#define GL_COMPRESSED_RGB_ARB 0x84ED
-#define GL_COMPRESSED_RGBA_ARB 0x84EE
-#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF
-#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
-#define GL_TEXTURE_COMPRESSED_ARB 0x86A1
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
-#endif
-
-#ifndef GL_ARB_texture_border_clamp
-#define GL_CLAMP_TO_BORDER_ARB 0x812D
-#endif
-
-#ifndef GL_ARB_point_parameters
-#define GL_POINT_SIZE_MIN_ARB 0x8126
-#define GL_POINT_SIZE_MAX_ARB 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128
-#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129
-#endif
-
-#ifndef GL_ARB_vertex_blend
-#define GL_MAX_VERTEX_UNITS_ARB 0x86A4
-#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5
-#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6
-#define GL_VERTEX_BLEND_ARB 0x86A7
-#define GL_CURRENT_WEIGHT_ARB 0x86A8
-#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9
-#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA
-#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB
-#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC
-#define GL_WEIGHT_ARRAY_ARB 0x86AD
-#define GL_MODELVIEW0_ARB 0x1700
-#define GL_MODELVIEW1_ARB 0x850A
-#define GL_MODELVIEW2_ARB 0x8722
-#define GL_MODELVIEW3_ARB 0x8723
-#define GL_MODELVIEW4_ARB 0x8724
-#define GL_MODELVIEW5_ARB 0x8725
-#define GL_MODELVIEW6_ARB 0x8726
-#define GL_MODELVIEW7_ARB 0x8727
-#define GL_MODELVIEW8_ARB 0x8728
-#define GL_MODELVIEW9_ARB 0x8729
-#define GL_MODELVIEW10_ARB 0x872A
-#define GL_MODELVIEW11_ARB 0x872B
-#define GL_MODELVIEW12_ARB 0x872C
-#define GL_MODELVIEW13_ARB 0x872D
-#define GL_MODELVIEW14_ARB 0x872E
-#define GL_MODELVIEW15_ARB 0x872F
-#define GL_MODELVIEW16_ARB 0x8730
-#define GL_MODELVIEW17_ARB 0x8731
-#define GL_MODELVIEW18_ARB 0x8732
-#define GL_MODELVIEW19_ARB 0x8733
-#define GL_MODELVIEW20_ARB 0x8734
-#define GL_MODELVIEW21_ARB 0x8735
-#define GL_MODELVIEW22_ARB 0x8736
-#define GL_MODELVIEW23_ARB 0x8737
-#define GL_MODELVIEW24_ARB 0x8738
-#define GL_MODELVIEW25_ARB 0x8739
-#define GL_MODELVIEW26_ARB 0x873A
-#define GL_MODELVIEW27_ARB 0x873B
-#define GL_MODELVIEW28_ARB 0x873C
-#define GL_MODELVIEW29_ARB 0x873D
-#define GL_MODELVIEW30_ARB 0x873E
-#define GL_MODELVIEW31_ARB 0x873F
-#endif
-
-#ifndef GL_ARB_matrix_palette
-#define GL_MATRIX_PALETTE_ARB 0x8840
-#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841
-#define GL_MAX_PALETTE_MATRICES_ARB 0x8842
-#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843
-#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844
-#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845
-#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846
-#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847
-#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848
-#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849
-#endif
-
-#ifndef GL_ARB_texture_env_combine
-#define GL_COMBINE_ARB 0x8570
-#define GL_COMBINE_RGB_ARB 0x8571
-#define GL_COMBINE_ALPHA_ARB 0x8572
-#define GL_SOURCE0_RGB_ARB 0x8580
-#define GL_SOURCE1_RGB_ARB 0x8581
-#define GL_SOURCE2_RGB_ARB 0x8582
-#define GL_SOURCE0_ALPHA_ARB 0x8588
-#define GL_SOURCE1_ALPHA_ARB 0x8589
-#define GL_SOURCE2_ALPHA_ARB 0x858A
-#define GL_OPERAND0_RGB_ARB 0x8590
-#define GL_OPERAND1_RGB_ARB 0x8591
-#define GL_OPERAND2_RGB_ARB 0x8592
-#define GL_OPERAND0_ALPHA_ARB 0x8598
-#define GL_OPERAND1_ALPHA_ARB 0x8599
-#define GL_OPERAND2_ALPHA_ARB 0x859A
-#define GL_RGB_SCALE_ARB 0x8573
-#define GL_ADD_SIGNED_ARB 0x8574
-#define GL_INTERPOLATE_ARB 0x8575
-#define GL_SUBTRACT_ARB 0x84E7
-#define GL_CONSTANT_ARB 0x8576
-#define GL_PRIMARY_COLOR_ARB 0x8577
-#define GL_PREVIOUS_ARB 0x8578
-#endif
-
-#ifndef GL_ARB_texture_env_crossbar
-#endif
-
-#ifndef GL_ARB_texture_env_dot3
-#define GL_DOT3_RGB_ARB 0x86AE
-#define GL_DOT3_RGBA_ARB 0x86AF
-#endif
-
-#ifndef GL_ARB_texture_mirrored_repeat
-#define GL_MIRRORED_REPEAT_ARB 0x8370
-#endif
-
-#ifndef GL_ARB_depth_texture
-#define GL_DEPTH_COMPONENT16_ARB 0x81A5
-#define GL_DEPTH_COMPONENT24_ARB 0x81A6
-#define GL_DEPTH_COMPONENT32_ARB 0x81A7
-#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A
-#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B
-#endif
-
-#ifndef GL_ARB_shadow
-#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C
-#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D
-#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E
-#endif
-
-#ifndef GL_ARB_shadow_ambient
-#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
-#endif
-
-#ifndef GL_ARB_window_pos
-#endif
-
-#ifndef GL_ARB_vertex_program
-#define GL_COLOR_SUM_ARB 0x8458
-#define GL_VERTEX_PROGRAM_ARB 0x8620
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625
-#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626
-#define GL_PROGRAM_LENGTH_ARB 0x8627
-#define GL_PROGRAM_STRING_ARB 0x8628
-#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E
-#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F
-#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640
-#define GL_CURRENT_MATRIX_ARB 0x8641
-#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645
-#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B
-#define GL_PROGRAM_BINDING_ARB 0x8677
-#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A
-#define GL_PROGRAM_ERROR_STRING_ARB 0x8874
-#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875
-#define GL_PROGRAM_FORMAT_ARB 0x8876
-#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0
-#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1
-#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2
-#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3
-#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4
-#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5
-#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6
-#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7
-#define GL_PROGRAM_PARAMETERS_ARB 0x88A8
-#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9
-#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA
-#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB
-#define GL_PROGRAM_ATTRIBS_ARB 0x88AC
-#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD
-#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE
-#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF
-#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0
-#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1
-#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2
-#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3
-#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4
-#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5
-#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6
-#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7
-#define GL_MATRIX0_ARB 0x88C0
-#define GL_MATRIX1_ARB 0x88C1
-#define GL_MATRIX2_ARB 0x88C2
-#define GL_MATRIX3_ARB 0x88C3
-#define GL_MATRIX4_ARB 0x88C4
-#define GL_MATRIX5_ARB 0x88C5
-#define GL_MATRIX6_ARB 0x88C6
-#define GL_MATRIX7_ARB 0x88C7
-#define GL_MATRIX8_ARB 0x88C8
-#define GL_MATRIX9_ARB 0x88C9
-#define GL_MATRIX10_ARB 0x88CA
-#define GL_MATRIX11_ARB 0x88CB
-#define GL_MATRIX12_ARB 0x88CC
-#define GL_MATRIX13_ARB 0x88CD
-#define GL_MATRIX14_ARB 0x88CE
-#define GL_MATRIX15_ARB 0x88CF
-#define GL_MATRIX16_ARB 0x88D0
-#define GL_MATRIX17_ARB 0x88D1
-#define GL_MATRIX18_ARB 0x88D2
-#define GL_MATRIX19_ARB 0x88D3
-#define GL_MATRIX20_ARB 0x88D4
-#define GL_MATRIX21_ARB 0x88D5
-#define GL_MATRIX22_ARB 0x88D6
-#define GL_MATRIX23_ARB 0x88D7
-#define GL_MATRIX24_ARB 0x88D8
-#define GL_MATRIX25_ARB 0x88D9
-#define GL_MATRIX26_ARB 0x88DA
-#define GL_MATRIX27_ARB 0x88DB
-#define GL_MATRIX28_ARB 0x88DC
-#define GL_MATRIX29_ARB 0x88DD
-#define GL_MATRIX30_ARB 0x88DE
-#define GL_MATRIX31_ARB 0x88DF
-#endif
-
-#ifndef GL_ARB_fragment_program
-#define GL_FRAGMENT_PROGRAM_ARB 0x8804
-#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805
-#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806
-#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807
-#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808
-#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809
-#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A
-#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B
-#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C
-#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D
-#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E
-#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F
-#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810
-#define GL_MAX_TEXTURE_COORDS_ARB 0x8871
-#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872
-#endif
-
-#ifndef GL_ARB_vertex_buffer_object
-#define GL_BUFFER_SIZE_ARB 0x8764
-#define GL_BUFFER_USAGE_ARB 0x8765
-#define GL_ARRAY_BUFFER_ARB 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893
-#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
-#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
-#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
-#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
-#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
-#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
-#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
-#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
-#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
-#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
-#define GL_READ_ONLY_ARB 0x88B8
-#define GL_WRITE_ONLY_ARB 0x88B9
-#define GL_READ_WRITE_ARB 0x88BA
-#define GL_BUFFER_ACCESS_ARB 0x88BB
-#define GL_BUFFER_MAPPED_ARB 0x88BC
-#define GL_BUFFER_MAP_POINTER_ARB 0x88BD
-#define GL_STREAM_DRAW_ARB 0x88E0
-#define GL_STREAM_READ_ARB 0x88E1
-#define GL_STREAM_COPY_ARB 0x88E2
-#define GL_STATIC_DRAW_ARB 0x88E4
-#define GL_STATIC_READ_ARB 0x88E5
-#define GL_STATIC_COPY_ARB 0x88E6
-#define GL_DYNAMIC_DRAW_ARB 0x88E8
-#define GL_DYNAMIC_READ_ARB 0x88E9
-#define GL_DYNAMIC_COPY_ARB 0x88EA
-#endif
-
-#ifndef GL_ARB_occlusion_query
-#define GL_QUERY_COUNTER_BITS_ARB 0x8864
-#define GL_CURRENT_QUERY_ARB 0x8865
-#define GL_QUERY_RESULT_ARB 0x8866
-#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867
-#define GL_SAMPLES_PASSED_ARB 0x8914
-#endif
-
-#ifndef GL_ARB_shader_objects
-#define GL_PROGRAM_OBJECT_ARB 0x8B40
-#define GL_SHADER_OBJECT_ARB 0x8B48
-#define GL_OBJECT_TYPE_ARB 0x8B4E
-#define GL_OBJECT_SUBTYPE_ARB 0x8B4F
-#define GL_FLOAT_VEC2_ARB 0x8B50
-#define GL_FLOAT_VEC3_ARB 0x8B51
-#define GL_FLOAT_VEC4_ARB 0x8B52
-#define GL_INT_VEC2_ARB 0x8B53
-#define GL_INT_VEC3_ARB 0x8B54
-#define GL_INT_VEC4_ARB 0x8B55
-#define GL_BOOL_ARB 0x8B56
-#define GL_BOOL_VEC2_ARB 0x8B57
-#define GL_BOOL_VEC3_ARB 0x8B58
-#define GL_BOOL_VEC4_ARB 0x8B59
-#define GL_FLOAT_MAT2_ARB 0x8B5A
-#define GL_FLOAT_MAT3_ARB 0x8B5B
-#define GL_FLOAT_MAT4_ARB 0x8B5C
-#define GL_SAMPLER_1D_ARB 0x8B5D
-#define GL_SAMPLER_2D_ARB 0x8B5E
-#define GL_SAMPLER_3D_ARB 0x8B5F
-#define GL_SAMPLER_CUBE_ARB 0x8B60
-#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61
-#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62
-#define GL_SAMPLER_2D_RECT_ARB 0x8B63
-#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64
-#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80
-#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81
-#define GL_OBJECT_LINK_STATUS_ARB 0x8B82
-#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83
-#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84
-#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85
-#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86
-#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
-#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88
-#endif
-
-#ifndef GL_ARB_vertex_shader
-#define GL_VERTEX_SHADER_ARB 0x8B31
-#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A
-#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D
-#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89
-#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A
-#endif
-
-#ifndef GL_ARB_fragment_shader
-#define GL_FRAGMENT_SHADER_ARB 0x8B30
-#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
-#endif
-
-#ifndef GL_ARB_shading_language_100
-#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C
-#endif
-
-#ifndef GL_ARB_texture_non_power_of_two
-#endif
-
-#ifndef GL_ARB_point_sprite
-#define GL_POINT_SPRITE_ARB 0x8861
-#define GL_COORD_REPLACE_ARB 0x8862
-#endif
-
-#ifndef GL_ARB_fragment_program_shadow
-#endif
-
-#ifndef GL_ARB_draw_buffers
-#define GL_MAX_DRAW_BUFFERS_ARB 0x8824
-#define GL_DRAW_BUFFER0_ARB 0x8825
-#define GL_DRAW_BUFFER1_ARB 0x8826
-#define GL_DRAW_BUFFER2_ARB 0x8827
-#define GL_DRAW_BUFFER3_ARB 0x8828
-#define GL_DRAW_BUFFER4_ARB 0x8829
-#define GL_DRAW_BUFFER5_ARB 0x882A
-#define GL_DRAW_BUFFER6_ARB 0x882B
-#define GL_DRAW_BUFFER7_ARB 0x882C
-#define GL_DRAW_BUFFER8_ARB 0x882D
-#define GL_DRAW_BUFFER9_ARB 0x882E
-#define GL_DRAW_BUFFER10_ARB 0x882F
-#define GL_DRAW_BUFFER11_ARB 0x8830
-#define GL_DRAW_BUFFER12_ARB 0x8831
-#define GL_DRAW_BUFFER13_ARB 0x8832
-#define GL_DRAW_BUFFER14_ARB 0x8833
-#define GL_DRAW_BUFFER15_ARB 0x8834
-#endif
-
-#ifndef GL_ARB_texture_rectangle
-#define GL_TEXTURE_RECTANGLE_ARB 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
-#endif
-
-#ifndef GL_ARB_color_buffer_float
-#define GL_RGBA_FLOAT_MODE_ARB 0x8820
-#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A
-#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B
-#define GL_CLAMP_READ_COLOR_ARB 0x891C
-#define GL_FIXED_ONLY_ARB 0x891D
-#endif
-
-#ifndef GL_ARB_half_float_pixel
-#define GL_HALF_FLOAT_ARB 0x140B
-#endif
-
-#ifndef GL_ARB_texture_float
-#define GL_TEXTURE_RED_TYPE_ARB 0x8C10
-#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11
-#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12
-#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13
-#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14
-#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15
-#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16
-#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17
-#define GL_RGBA32F_ARB 0x8814
-#define GL_RGB32F_ARB 0x8815
-#define GL_ALPHA32F_ARB 0x8816
-#define GL_INTENSITY32F_ARB 0x8817
-#define GL_LUMINANCE32F_ARB 0x8818
-#define GL_LUMINANCE_ALPHA32F_ARB 0x8819
-#define GL_RGBA16F_ARB 0x881A
-#define GL_RGB16F_ARB 0x881B
-#define GL_ALPHA16F_ARB 0x881C
-#define GL_INTENSITY16F_ARB 0x881D
-#define GL_LUMINANCE16F_ARB 0x881E
-#define GL_LUMINANCE_ALPHA16F_ARB 0x881F
-#endif
-
-#ifndef GL_ARB_pixel_buffer_object
-#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
-#endif
-
-#ifndef GL_EXT_abgr
-#define GL_ABGR_EXT 0x8000
-#endif
-
-#ifndef GL_EXT_blend_color
-#define GL_CONSTANT_COLOR_EXT 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002
-#define GL_CONSTANT_ALPHA_EXT 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004
-#define GL_BLEND_COLOR_EXT 0x8005
-#endif
-
-#ifndef GL_EXT_polygon_offset
-#define GL_POLYGON_OFFSET_EXT 0x8037
-#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038
-#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039
-#endif
-
-#ifndef GL_EXT_texture
-#define GL_ALPHA4_EXT 0x803B
-#define GL_ALPHA8_EXT 0x803C
-#define GL_ALPHA12_EXT 0x803D
-#define GL_ALPHA16_EXT 0x803E
-#define GL_LUMINANCE4_EXT 0x803F
-#define GL_LUMINANCE8_EXT 0x8040
-#define GL_LUMINANCE12_EXT 0x8041
-#define GL_LUMINANCE16_EXT 0x8042
-#define GL_LUMINANCE4_ALPHA4_EXT 0x8043
-#define GL_LUMINANCE6_ALPHA2_EXT 0x8044
-#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
-#define GL_LUMINANCE12_ALPHA4_EXT 0x8046
-#define GL_LUMINANCE12_ALPHA12_EXT 0x8047
-#define GL_LUMINANCE16_ALPHA16_EXT 0x8048
-#define GL_INTENSITY_EXT 0x8049
-#define GL_INTENSITY4_EXT 0x804A
-#define GL_INTENSITY8_EXT 0x804B
-#define GL_INTENSITY12_EXT 0x804C
-#define GL_INTENSITY16_EXT 0x804D
-#define GL_RGB2_EXT 0x804E
-#define GL_RGB4_EXT 0x804F
-#define GL_RGB5_EXT 0x8050
-#define GL_RGB8_EXT 0x8051
-#define GL_RGB10_EXT 0x8052
-#define GL_RGB12_EXT 0x8053
-#define GL_RGB16_EXT 0x8054
-#define GL_RGBA2_EXT 0x8055
-#define GL_RGBA4_EXT 0x8056
-#define GL_RGB5_A1_EXT 0x8057
-#define GL_RGBA8_EXT 0x8058
-#define GL_RGB10_A2_EXT 0x8059
-#define GL_RGBA12_EXT 0x805A
-#define GL_RGBA16_EXT 0x805B
-#define GL_TEXTURE_RED_SIZE_EXT 0x805C
-#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D
-#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E
-#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F
-#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060
-#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061
-#define GL_REPLACE_EXT 0x8062
-#define GL_PROXY_TEXTURE_1D_EXT 0x8063
-#define GL_PROXY_TEXTURE_2D_EXT 0x8064
-#define GL_TEXTURE_TOO_LARGE_EXT 0x8065
-#endif
-
-#ifndef GL_EXT_texture3D
-#define GL_PACK_SKIP_IMAGES_EXT 0x806B
-#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C
-#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D
-#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E
-#define GL_TEXTURE_3D_EXT 0x806F
-#define GL_PROXY_TEXTURE_3D_EXT 0x8070
-#define GL_TEXTURE_DEPTH_EXT 0x8071
-#define GL_TEXTURE_WRAP_R_EXT 0x8072
-#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073
-#endif
-
-#ifndef GL_SGIS_texture_filter4
-#define GL_FILTER4_SGIS 0x8146
-#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147
-#endif
-
-#ifndef GL_EXT_subtexture
-#endif
-
-#ifndef GL_EXT_copy_texture
-#endif
-
-#ifndef GL_EXT_histogram
-#define GL_HISTOGRAM_EXT 0x8024
-#define GL_PROXY_HISTOGRAM_EXT 0x8025
-#define GL_HISTOGRAM_WIDTH_EXT 0x8026
-#define GL_HISTOGRAM_FORMAT_EXT 0x8027
-#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028
-#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029
-#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A
-#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B
-#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C
-#define GL_HISTOGRAM_SINK_EXT 0x802D
-#define GL_MINMAX_EXT 0x802E
-#define GL_MINMAX_FORMAT_EXT 0x802F
-#define GL_MINMAX_SINK_EXT 0x8030
-#define GL_TABLE_TOO_LARGE_EXT 0x8031
-#endif
-
-#ifndef GL_EXT_convolution
-#define GL_CONVOLUTION_1D_EXT 0x8010
-#define GL_CONVOLUTION_2D_EXT 0x8011
-#define GL_SEPARABLE_2D_EXT 0x8012
-#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013
-#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014
-#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015
-#define GL_REDUCE_EXT 0x8016
-#define GL_CONVOLUTION_FORMAT_EXT 0x8017
-#define GL_CONVOLUTION_WIDTH_EXT 0x8018
-#define GL_CONVOLUTION_HEIGHT_EXT 0x8019
-#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A
-#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B
-#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C
-#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D
-#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E
-#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F
-#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020
-#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021
-#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022
-#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023
-#endif
-
-#ifndef GL_SGI_color_matrix
-#define GL_COLOR_MATRIX_SGI 0x80B1
-#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2
-#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3
-#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4
-#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5
-#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6
-#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7
-#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8
-#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9
-#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA
-#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB
-#endif
-
-#ifndef GL_SGI_color_table
-#define GL_COLOR_TABLE_SGI 0x80D0
-#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1
-#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2
-#define GL_PROXY_COLOR_TABLE_SGI 0x80D3
-#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4
-#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5
-#define GL_COLOR_TABLE_SCALE_SGI 0x80D6
-#define GL_COLOR_TABLE_BIAS_SGI 0x80D7
-#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8
-#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9
-#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF
-#endif
-
-#ifndef GL_SGIS_pixel_texture
-#define GL_PIXEL_TEXTURE_SGIS 0x8353
-#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354
-#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355
-#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356
-#endif
-
-#ifndef GL_SGIX_pixel_texture
-#define GL_PIXEL_TEX_GEN_SGIX 0x8139
-#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B
-#endif
-
-#ifndef GL_SGIS_texture4D
-#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130
-#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131
-#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132
-#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133
-#define GL_TEXTURE_4D_SGIS 0x8134
-#define GL_PROXY_TEXTURE_4D_SGIS 0x8135
-#define GL_TEXTURE_4DSIZE_SGIS 0x8136
-#define GL_TEXTURE_WRAP_Q_SGIS 0x8137
-#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138
-#define GL_TEXTURE_4D_BINDING_SGIS 0x814F
-#endif
-
-#ifndef GL_SGI_texture_color_table
-#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC
-#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD
-#endif
-
-#ifndef GL_EXT_cmyka
-#define GL_CMYK_EXT 0x800C
-#define GL_CMYKA_EXT 0x800D
-#define GL_PACK_CMYK_HINT_EXT 0x800E
-#define GL_UNPACK_CMYK_HINT_EXT 0x800F
-#endif
-
-#ifndef GL_EXT_texture_object
-#define GL_TEXTURE_PRIORITY_EXT 0x8066
-#define GL_TEXTURE_RESIDENT_EXT 0x8067
-#define GL_TEXTURE_1D_BINDING_EXT 0x8068
-#define GL_TEXTURE_2D_BINDING_EXT 0x8069
-#define GL_TEXTURE_3D_BINDING_EXT 0x806A
-#endif
-
-#ifndef GL_SGIS_detail_texture
-#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095
-#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096
-#define GL_LINEAR_DETAIL_SGIS 0x8097
-#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098
-#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099
-#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A
-#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B
-#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C
-#endif
-
-#ifndef GL_SGIS_sharpen_texture
-#define GL_LINEAR_SHARPEN_SGIS 0x80AD
-#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE
-#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF
-#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0
-#endif
-
-#ifndef GL_EXT_packed_pixels
-#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032
-#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034
-#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035
-#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036
-#endif
-
-#ifndef GL_SGIS_texture_lod
-#define GL_TEXTURE_MIN_LOD_SGIS 0x813A
-#define GL_TEXTURE_MAX_LOD_SGIS 0x813B
-#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C
-#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D
-#endif
-
-#ifndef GL_SGIS_multisample
-#define GL_MULTISAMPLE_SGIS 0x809D
-#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F
-#define GL_SAMPLE_MASK_SGIS 0x80A0
-#define GL_1PASS_SGIS 0x80A1
-#define GL_2PASS_0_SGIS 0x80A2
-#define GL_2PASS_1_SGIS 0x80A3
-#define GL_4PASS_0_SGIS 0x80A4
-#define GL_4PASS_1_SGIS 0x80A5
-#define GL_4PASS_2_SGIS 0x80A6
-#define GL_4PASS_3_SGIS 0x80A7
-#define GL_SAMPLE_BUFFERS_SGIS 0x80A8
-#define GL_SAMPLES_SGIS 0x80A9
-#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA
-#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB
-#define GL_SAMPLE_PATTERN_SGIS 0x80AC
-#endif
-
-#ifndef GL_EXT_rescale_normal
-#define GL_RESCALE_NORMAL_EXT 0x803A
-#endif
-
-#ifndef GL_EXT_vertex_array
-#define GL_VERTEX_ARRAY_EXT 0x8074
-#define GL_NORMAL_ARRAY_EXT 0x8075
-#define GL_COLOR_ARRAY_EXT 0x8076
-#define GL_INDEX_ARRAY_EXT 0x8077
-#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078
-#define GL_EDGE_FLAG_ARRAY_EXT 0x8079
-#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A
-#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B
-#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C
-#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D
-#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E
-#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F
-#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080
-#define GL_COLOR_ARRAY_SIZE_EXT 0x8081
-#define GL_COLOR_ARRAY_TYPE_EXT 0x8082
-#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083
-#define GL_COLOR_ARRAY_COUNT_EXT 0x8084
-#define GL_INDEX_ARRAY_TYPE_EXT 0x8085
-#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086
-#define GL_INDEX_ARRAY_COUNT_EXT 0x8087
-#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088
-#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089
-#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
-#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B
-#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C
-#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D
-#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E
-#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F
-#define GL_COLOR_ARRAY_POINTER_EXT 0x8090
-#define GL_INDEX_ARRAY_POINTER_EXT 0x8091
-#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
-#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093
-#endif
-
-#ifndef GL_EXT_misc_attribute
-#endif
-
-#ifndef GL_SGIS_generate_mipmap
-#define GL_GENERATE_MIPMAP_SGIS 0x8191
-#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
-#endif
-
-#ifndef GL_SGIX_clipmap
-#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170
-#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171
-#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172
-#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173
-#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174
-#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175
-#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176
-#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177
-#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178
-#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D
-#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E
-#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F
-#endif
-
-#ifndef GL_SGIX_shadow
-#define GL_TEXTURE_COMPARE_SGIX 0x819A
-#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B
-#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C
-#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D
-#endif
-
-#ifndef GL_SGIS_texture_edge_clamp
-#define GL_CLAMP_TO_EDGE_SGIS 0x812F
-#endif
-
-#ifndef GL_SGIS_texture_border_clamp
-#define GL_CLAMP_TO_BORDER_SGIS 0x812D
-#endif
-
-#ifndef GL_EXT_blend_minmax
-#define GL_FUNC_ADD_EXT 0x8006
-#define GL_MIN_EXT 0x8007
-#define GL_MAX_EXT 0x8008
-#define GL_BLEND_EQUATION_EXT 0x8009
-#endif
-
-#ifndef GL_EXT_blend_subtract
-#define GL_FUNC_SUBTRACT_EXT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B
-#endif
-
-#ifndef GL_EXT_blend_logic_op
-#endif
-
-#ifndef GL_SGIX_interlace
-#define GL_INTERLACE_SGIX 0x8094
-#endif
-
-#ifndef GL_SGIX_pixel_tiles
-#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E
-#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F
-#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140
-#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141
-#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142
-#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143
-#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144
-#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145
-#endif
-
-#ifndef GL_SGIS_texture_select
-#define GL_DUAL_ALPHA4_SGIS 0x8110
-#define GL_DUAL_ALPHA8_SGIS 0x8111
-#define GL_DUAL_ALPHA12_SGIS 0x8112
-#define GL_DUAL_ALPHA16_SGIS 0x8113
-#define GL_DUAL_LUMINANCE4_SGIS 0x8114
-#define GL_DUAL_LUMINANCE8_SGIS 0x8115
-#define GL_DUAL_LUMINANCE12_SGIS 0x8116
-#define GL_DUAL_LUMINANCE16_SGIS 0x8117
-#define GL_DUAL_INTENSITY4_SGIS 0x8118
-#define GL_DUAL_INTENSITY8_SGIS 0x8119
-#define GL_DUAL_INTENSITY12_SGIS 0x811A
-#define GL_DUAL_INTENSITY16_SGIS 0x811B
-#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C
-#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D
-#define GL_QUAD_ALPHA4_SGIS 0x811E
-#define GL_QUAD_ALPHA8_SGIS 0x811F
-#define GL_QUAD_LUMINANCE4_SGIS 0x8120
-#define GL_QUAD_LUMINANCE8_SGIS 0x8121
-#define GL_QUAD_INTENSITY4_SGIS 0x8122
-#define GL_QUAD_INTENSITY8_SGIS 0x8123
-#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124
-#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125
-#endif
-
-#ifndef GL_SGIX_sprite
-#define GL_SPRITE_SGIX 0x8148
-#define GL_SPRITE_MODE_SGIX 0x8149
-#define GL_SPRITE_AXIS_SGIX 0x814A
-#define GL_SPRITE_TRANSLATION_SGIX 0x814B
-#define GL_SPRITE_AXIAL_SGIX 0x814C
-#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D
-#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E
-#endif
-
-#ifndef GL_SGIX_texture_multi_buffer
-#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E
-#endif
-
-#ifndef GL_EXT_point_parameters
-#define GL_POINT_SIZE_MIN_EXT 0x8126
-#define GL_POINT_SIZE_MAX_EXT 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128
-#define GL_DISTANCE_ATTENUATION_EXT 0x8129
-#endif
-
-#ifndef GL_SGIS_point_parameters
-#define GL_POINT_SIZE_MIN_SGIS 0x8126
-#define GL_POINT_SIZE_MAX_SGIS 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128
-#define GL_DISTANCE_ATTENUATION_SGIS 0x8129
-#endif
-
-#ifndef GL_SGIX_instruments
-#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180
-#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181
-#endif
-
-#ifndef GL_SGIX_texture_scale_bias
-#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179
-#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A
-#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B
-#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C
-#endif
-
-#ifndef GL_SGIX_framezoom
-#define GL_FRAMEZOOM_SGIX 0x818B
-#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C
-#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D
-#endif
-
-#ifndef GL_SGIX_tag_sample_buffer
-#endif
-
-#ifndef GL_FfdMaskSGIX
-#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001
-#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002
-#endif
-
-#ifndef GL_SGIX_polynomial_ffd
-#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194
-#define GL_TEXTURE_DEFORMATION_SGIX 0x8195
-#define GL_DEFORMATIONS_MASK_SGIX 0x8196
-#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197
-#endif
-
-#ifndef GL_SGIX_reference_plane
-#define GL_REFERENCE_PLANE_SGIX 0x817D
-#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E
-#endif
-
-#ifndef GL_SGIX_flush_raster
-#endif
-
-#ifndef GL_SGIX_depth_texture
-#define GL_DEPTH_COMPONENT16_SGIX 0x81A5
-#define GL_DEPTH_COMPONENT24_SGIX 0x81A6
-#define GL_DEPTH_COMPONENT32_SGIX 0x81A7
-#endif
-
-#ifndef GL_SGIS_fog_function
-#define GL_FOG_FUNC_SGIS 0x812A
-#define GL_FOG_FUNC_POINTS_SGIS 0x812B
-#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C
-#endif
-
-#ifndef GL_SGIX_fog_offset
-#define GL_FOG_OFFSET_SGIX 0x8198
-#define GL_FOG_OFFSET_VALUE_SGIX 0x8199
-#endif
-
-#ifndef GL_HP_image_transform
-#define GL_IMAGE_SCALE_X_HP 0x8155
-#define GL_IMAGE_SCALE_Y_HP 0x8156
-#define GL_IMAGE_TRANSLATE_X_HP 0x8157
-#define GL_IMAGE_TRANSLATE_Y_HP 0x8158
-#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159
-#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A
-#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B
-#define GL_IMAGE_MAG_FILTER_HP 0x815C
-#define GL_IMAGE_MIN_FILTER_HP 0x815D
-#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E
-#define GL_CUBIC_HP 0x815F
-#define GL_AVERAGE_HP 0x8160
-#define GL_IMAGE_TRANSFORM_2D_HP 0x8161
-#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162
-#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163
-#endif
-
-#ifndef GL_HP_convolution_border_modes
-#define GL_IGNORE_BORDER_HP 0x8150
-#define GL_CONSTANT_BORDER_HP 0x8151
-#define GL_REPLICATE_BORDER_HP 0x8153
-#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154
-#endif
-
-#ifndef GL_INGR_palette_buffer
-#endif
-
-#ifndef GL_SGIX_texture_add_env
-#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE
-#endif
-
-#ifndef GL_EXT_color_subtable
-#endif
-
-#ifndef GL_PGI_vertex_hints
-#define GL_VERTEX_DATA_HINT_PGI 0x1A22A
-#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B
-#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C
-#define GL_MAX_VERTEX_HINT_PGI 0x1A22D
-#define GL_COLOR3_BIT_PGI 0x00010000
-#define GL_COLOR4_BIT_PGI 0x00020000
-#define GL_EDGEFLAG_BIT_PGI 0x00040000
-#define GL_INDEX_BIT_PGI 0x00080000
-#define GL_MAT_AMBIENT_BIT_PGI 0x00100000
-#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000
-#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000
-#define GL_MAT_EMISSION_BIT_PGI 0x00800000
-#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000
-#define GL_MAT_SHININESS_BIT_PGI 0x02000000
-#define GL_MAT_SPECULAR_BIT_PGI 0x04000000
-#define GL_NORMAL_BIT_PGI 0x08000000
-#define GL_TEXCOORD1_BIT_PGI 0x10000000
-#define GL_TEXCOORD2_BIT_PGI 0x20000000
-#define GL_TEXCOORD3_BIT_PGI 0x40000000
-#define GL_TEXCOORD4_BIT_PGI 0x80000000
-#define GL_VERTEX23_BIT_PGI 0x00000004
-#define GL_VERTEX4_BIT_PGI 0x00000008
-#endif
-
-#ifndef GL_PGI_misc_hints
-#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8
-#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD
-#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE
-#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202
-#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203
-#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204
-#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C
-#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D
-#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E
-#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F
-#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210
-#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211
-#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216
-#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217
-#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218
-#define GL_FULL_STIPPLE_HINT_PGI 0x1A219
-#define GL_CLIP_NEAR_HINT_PGI 0x1A220
-#define GL_CLIP_FAR_HINT_PGI 0x1A221
-#define GL_WIDE_LINE_HINT_PGI 0x1A222
-#define GL_BACK_NORMALS_HINT_PGI 0x1A223
-#endif
-
-#ifndef GL_EXT_paletted_texture
-#define GL_COLOR_INDEX1_EXT 0x80E2
-#define GL_COLOR_INDEX2_EXT 0x80E3
-#define GL_COLOR_INDEX4_EXT 0x80E4
-#define GL_COLOR_INDEX8_EXT 0x80E5
-#define GL_COLOR_INDEX12_EXT 0x80E6
-#define GL_COLOR_INDEX16_EXT 0x80E7
-#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED
-#endif
-
-#ifndef GL_EXT_clip_volume_hint
-#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0
-#endif
-
-#ifndef GL_SGIX_list_priority
-#define GL_LIST_PRIORITY_SGIX 0x8182
-#endif
-
-#ifndef GL_SGIX_ir_instrument1
-#define GL_IR_INSTRUMENT1_SGIX 0x817F
-#endif
-
-#ifndef GL_SGIX_calligraphic_fragment
-#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183
-#endif
-
-#ifndef GL_SGIX_texture_lod_bias
-#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E
-#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F
-#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190
-#endif
-
-#ifndef GL_SGIX_shadow_ambient
-#define GL_SHADOW_AMBIENT_SGIX 0x80BF
-#endif
-
-#ifndef GL_EXT_index_texture
-#endif
-
-#ifndef GL_EXT_index_material
-#define GL_INDEX_MATERIAL_EXT 0x81B8
-#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9
-#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA
-#endif
-
-#ifndef GL_EXT_index_func
-#define GL_INDEX_TEST_EXT 0x81B5
-#define GL_INDEX_TEST_FUNC_EXT 0x81B6
-#define GL_INDEX_TEST_REF_EXT 0x81B7
-#endif
-
-#ifndef GL_EXT_index_array_formats
-#define GL_IUI_V2F_EXT 0x81AD
-#define GL_IUI_V3F_EXT 0x81AE
-#define GL_IUI_N3F_V2F_EXT 0x81AF
-#define GL_IUI_N3F_V3F_EXT 0x81B0
-#define GL_T2F_IUI_V2F_EXT 0x81B1
-#define GL_T2F_IUI_V3F_EXT 0x81B2
-#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3
-#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4
-#endif
-
-#ifndef GL_EXT_compiled_vertex_array
-#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8
-#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9
-#endif
-
-#ifndef GL_EXT_cull_vertex
-#define GL_CULL_VERTEX_EXT 0x81AA
-#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB
-#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC
-#endif
-
-#ifndef GL_SGIX_ycrcb
-#define GL_YCRCB_422_SGIX 0x81BB
-#define GL_YCRCB_444_SGIX 0x81BC
-#endif
-
-#ifndef GL_SGIX_fragment_lighting
-#define GL_FRAGMENT_LIGHTING_SGIX 0x8400
-#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401
-#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402
-#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403
-#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404
-#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405
-#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406
-#define GL_LIGHT_ENV_MODE_SGIX 0x8407
-#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408
-#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409
-#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A
-#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B
-#define GL_FRAGMENT_LIGHT0_SGIX 0x840C
-#define GL_FRAGMENT_LIGHT1_SGIX 0x840D
-#define GL_FRAGMENT_LIGHT2_SGIX 0x840E
-#define GL_FRAGMENT_LIGHT3_SGIX 0x840F
-#define GL_FRAGMENT_LIGHT4_SGIX 0x8410
-#define GL_FRAGMENT_LIGHT5_SGIX 0x8411
-#define GL_FRAGMENT_LIGHT6_SGIX 0x8412
-#define GL_FRAGMENT_LIGHT7_SGIX 0x8413
-#endif
-
-#ifndef GL_IBM_rasterpos_clip
-#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262
-#endif
-
-#ifndef GL_HP_texture_lighting
-#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167
-#define GL_TEXTURE_POST_SPECULAR_HP 0x8168
-#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169
-#endif
-
-#ifndef GL_EXT_draw_range_elements
-#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8
-#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9
-#endif
-
-#ifndef GL_WIN_phong_shading
-#define GL_PHONG_WIN 0x80EA
-#define GL_PHONG_HINT_WIN 0x80EB
-#endif
-
-#ifndef GL_WIN_specular_fog
-#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC
-#endif
-
-#ifndef GL_EXT_light_texture
-#define GL_FRAGMENT_MATERIAL_EXT 0x8349
-#define GL_FRAGMENT_NORMAL_EXT 0x834A
-#define GL_FRAGMENT_COLOR_EXT 0x834C
-#define GL_ATTENUATION_EXT 0x834D
-#define GL_SHADOW_ATTENUATION_EXT 0x834E
-#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F
-#define GL_TEXTURE_LIGHT_EXT 0x8350
-#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351
-#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352
-/* reuse GL_FRAGMENT_DEPTH_EXT */
-#endif
-
-#ifndef GL_SGIX_blend_alpha_minmax
-#define GL_ALPHA_MIN_SGIX 0x8320
-#define GL_ALPHA_MAX_SGIX 0x8321
-#endif
-
-#ifndef GL_SGIX_impact_pixel_texture
-#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184
-#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185
-#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186
-#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187
-#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188
-#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189
-#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A
-#endif
-
-#ifndef GL_EXT_bgra
-#define GL_BGR_EXT 0x80E0
-#define GL_BGRA_EXT 0x80E1
-#endif
-
-#ifndef GL_SGIX_async
-#define GL_ASYNC_MARKER_SGIX 0x8329
-#endif
-
-#ifndef GL_SGIX_async_pixel
-#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C
-#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D
-#define GL_ASYNC_READ_PIXELS_SGIX 0x835E
-#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F
-#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360
-#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361
-#endif
-
-#ifndef GL_SGIX_async_histogram
-#define GL_ASYNC_HISTOGRAM_SGIX 0x832C
-#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D
-#endif
-
-#ifndef GL_INTEL_texture_scissor
-#endif
-
-#ifndef GL_INTEL_parallel_arrays
-#define GL_PARALLEL_ARRAYS_INTEL 0x83F4
-#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5
-#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6
-#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7
-#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8
-#endif
-
-#ifndef GL_HP_occlusion_test
-#define GL_OCCLUSION_TEST_HP 0x8165
-#define GL_OCCLUSION_TEST_RESULT_HP 0x8166
-#endif
-
-#ifndef GL_EXT_pixel_transform
-#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330
-#define GL_PIXEL_MAG_FILTER_EXT 0x8331
-#define GL_PIXEL_MIN_FILTER_EXT 0x8332
-#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333
-#define GL_CUBIC_EXT 0x8334
-#define GL_AVERAGE_EXT 0x8335
-#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336
-#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337
-#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338
-#endif
-
-#ifndef GL_EXT_pixel_transform_color_table
-#endif
-
-#ifndef GL_EXT_shared_texture_palette
-#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
-#endif
-
-#ifndef GL_EXT_separate_specular_color
-#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8
-#define GL_SINGLE_COLOR_EXT 0x81F9
-#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA
-#endif
-
-#ifndef GL_EXT_secondary_color
-#define GL_COLOR_SUM_EXT 0x8458
-#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459
-#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
-#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
-#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
-#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
-#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E
-#endif
-
-#ifndef GL_EXT_texture_perturb_normal
-#define GL_PERTURB_EXT 0x85AE
-#define GL_TEXTURE_NORMAL_EXT 0x85AF
-#endif
-
-#ifndef GL_EXT_multi_draw_arrays
-#endif
-
-#ifndef GL_EXT_fog_coord
-#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450
-#define GL_FOG_COORDINATE_EXT 0x8451
-#define GL_FRAGMENT_DEPTH_EXT 0x8452
-#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453
-#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454
-#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455
-#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456
-#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457
-#endif
-
-#ifndef GL_REND_screen_coordinates
-#define GL_SCREEN_COORDINATES_REND 0x8490
-#define GL_INVERTED_SCREEN_W_REND 0x8491
-#endif
-
-#ifndef GL_EXT_coordinate_frame
-#define GL_TANGENT_ARRAY_EXT 0x8439
-#define GL_BINORMAL_ARRAY_EXT 0x843A
-#define GL_CURRENT_TANGENT_EXT 0x843B
-#define GL_CURRENT_BINORMAL_EXT 0x843C
-#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E
-#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F
-#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440
-#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441
-#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442
-#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443
-#define GL_MAP1_TANGENT_EXT 0x8444
-#define GL_MAP2_TANGENT_EXT 0x8445
-#define GL_MAP1_BINORMAL_EXT 0x8446
-#define GL_MAP2_BINORMAL_EXT 0x8447
-#endif
-
-#ifndef GL_EXT_texture_env_combine
-#define GL_COMBINE_EXT 0x8570
-#define GL_COMBINE_RGB_EXT 0x8571
-#define GL_COMBINE_ALPHA_EXT 0x8572
-#define GL_RGB_SCALE_EXT 0x8573
-#define GL_ADD_SIGNED_EXT 0x8574
-#define GL_INTERPOLATE_EXT 0x8575
-#define GL_CONSTANT_EXT 0x8576
-#define GL_PRIMARY_COLOR_EXT 0x8577
-#define GL_PREVIOUS_EXT 0x8578
-#define GL_SOURCE0_RGB_EXT 0x8580
-#define GL_SOURCE1_RGB_EXT 0x8581
-#define GL_SOURCE2_RGB_EXT 0x8582
-#define GL_SOURCE0_ALPHA_EXT 0x8588
-#define GL_SOURCE1_ALPHA_EXT 0x8589
-#define GL_SOURCE2_ALPHA_EXT 0x858A
-#define GL_OPERAND0_RGB_EXT 0x8590
-#define GL_OPERAND1_RGB_EXT 0x8591
-#define GL_OPERAND2_RGB_EXT 0x8592
-#define GL_OPERAND0_ALPHA_EXT 0x8598
-#define GL_OPERAND1_ALPHA_EXT 0x8599
-#define GL_OPERAND2_ALPHA_EXT 0x859A
-#endif
-
-#ifndef GL_APPLE_specular_vector
-#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0
-#endif
-
-#ifndef GL_APPLE_transform_hint
-#define GL_TRANSFORM_HINT_APPLE 0x85B1
-#endif
-
-#ifndef GL_SGIX_fog_scale
-#define GL_FOG_SCALE_SGIX 0x81FC
-#define GL_FOG_SCALE_VALUE_SGIX 0x81FD
-#endif
-
-#ifndef GL_SUNX_constant_data
-#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5
-#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6
-#endif
-
-#ifndef GL_SUN_global_alpha
-#define GL_GLOBAL_ALPHA_SUN 0x81D9
-#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA
-#endif
-
-#ifndef GL_SUN_triangle_list
-#define GL_RESTART_SUN 0x0001
-#define GL_REPLACE_MIDDLE_SUN 0x0002
-#define GL_REPLACE_OLDEST_SUN 0x0003
-#define GL_TRIANGLE_LIST_SUN 0x81D7
-#define GL_REPLACEMENT_CODE_SUN 0x81D8
-#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0
-#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1
-#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2
-#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3
-#define GL_R1UI_V3F_SUN 0x85C4
-#define GL_R1UI_C4UB_V3F_SUN 0x85C5
-#define GL_R1UI_C3F_V3F_SUN 0x85C6
-#define GL_R1UI_N3F_V3F_SUN 0x85C7
-#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8
-#define GL_R1UI_T2F_V3F_SUN 0x85C9
-#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA
-#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB
-#endif
-
-#ifndef GL_SUN_vertex
-#endif
-
-#ifndef GL_EXT_blend_func_separate
-#define GL_BLEND_DST_RGB_EXT 0x80C8
-#define GL_BLEND_SRC_RGB_EXT 0x80C9
-#define GL_BLEND_DST_ALPHA_EXT 0x80CA
-#define GL_BLEND_SRC_ALPHA_EXT 0x80CB
-#endif
-
-#ifndef GL_INGR_color_clamp
-#define GL_RED_MIN_CLAMP_INGR 0x8560
-#define GL_GREEN_MIN_CLAMP_INGR 0x8561
-#define GL_BLUE_MIN_CLAMP_INGR 0x8562
-#define GL_ALPHA_MIN_CLAMP_INGR 0x8563
-#define GL_RED_MAX_CLAMP_INGR 0x8564
-#define GL_GREEN_MAX_CLAMP_INGR 0x8565
-#define GL_BLUE_MAX_CLAMP_INGR 0x8566
-#define GL_ALPHA_MAX_CLAMP_INGR 0x8567
-#endif
-
-#ifndef GL_INGR_interlace_read
-#define GL_INTERLACE_READ_INGR 0x8568
-#endif
-
-#ifndef GL_EXT_stencil_wrap
-#define GL_INCR_WRAP_EXT 0x8507
-#define GL_DECR_WRAP_EXT 0x8508
-#endif
-
-#ifndef GL_EXT_422_pixels
-#define GL_422_EXT 0x80CC
-#define GL_422_REV_EXT 0x80CD
-#define GL_422_AVERAGE_EXT 0x80CE
-#define GL_422_REV_AVERAGE_EXT 0x80CF
-#endif
-
-#ifndef GL_NV_texgen_reflection
-#define GL_NORMAL_MAP_NV 0x8511
-#define GL_REFLECTION_MAP_NV 0x8512
-#endif
-
-#ifndef GL_EXT_texture_cube_map
-#define GL_NORMAL_MAP_EXT 0x8511
-#define GL_REFLECTION_MAP_EXT 0x8512
-#define GL_TEXTURE_CUBE_MAP_EXT 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C
-#endif
-
-#ifndef GL_SUN_convolution_border_modes
-#define GL_WRAP_BORDER_SUN 0x81D4
-#endif
-
-#ifndef GL_EXT_texture_env_add
-#endif
-
-#ifndef GL_EXT_texture_lod_bias
-#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD
-#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500
-#define GL_TEXTURE_LOD_BIAS_EXT 0x8501
-#endif
-
-#ifndef GL_EXT_texture_filter_anisotropic
-#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
-#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
-#endif
-
-#ifndef GL_EXT_vertex_weighting
-#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH
-#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502
-#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX
-#define GL_MODELVIEW1_MATRIX_EXT 0x8506
-#define GL_VERTEX_WEIGHTING_EXT 0x8509
-#define GL_MODELVIEW0_EXT GL_MODELVIEW
-#define GL_MODELVIEW1_EXT 0x850A
-#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B
-#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C
-#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D
-#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E
-#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F
-#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510
-#endif
-
-#ifndef GL_NV_light_max_exponent
-#define GL_MAX_SHININESS_NV 0x8504
-#define GL_MAX_SPOT_EXPONENT_NV 0x8505
-#endif
-
-#ifndef GL_NV_vertex_array_range
-#define GL_VERTEX_ARRAY_RANGE_NV 0x851D
-#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E
-#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F
-#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520
-#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521
-#endif
-
-#ifndef GL_NV_register_combiners
-#define GL_REGISTER_COMBINERS_NV 0x8522
-#define GL_VARIABLE_A_NV 0x8523
-#define GL_VARIABLE_B_NV 0x8524
-#define GL_VARIABLE_C_NV 0x8525
-#define GL_VARIABLE_D_NV 0x8526
-#define GL_VARIABLE_E_NV 0x8527
-#define GL_VARIABLE_F_NV 0x8528
-#define GL_VARIABLE_G_NV 0x8529
-#define GL_CONSTANT_COLOR0_NV 0x852A
-#define GL_CONSTANT_COLOR1_NV 0x852B
-#define GL_PRIMARY_COLOR_NV 0x852C
-#define GL_SECONDARY_COLOR_NV 0x852D
-#define GL_SPARE0_NV 0x852E
-#define GL_SPARE1_NV 0x852F
-#define GL_DISCARD_NV 0x8530
-#define GL_E_TIMES_F_NV 0x8531
-#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532
-#define GL_UNSIGNED_IDENTITY_NV 0x8536
-#define GL_UNSIGNED_INVERT_NV 0x8537
-#define GL_EXPAND_NORMAL_NV 0x8538
-#define GL_EXPAND_NEGATE_NV 0x8539
-#define GL_HALF_BIAS_NORMAL_NV 0x853A
-#define GL_HALF_BIAS_NEGATE_NV 0x853B
-#define GL_SIGNED_IDENTITY_NV 0x853C
-#define GL_SIGNED_NEGATE_NV 0x853D
-#define GL_SCALE_BY_TWO_NV 0x853E
-#define GL_SCALE_BY_FOUR_NV 0x853F
-#define GL_SCALE_BY_ONE_HALF_NV 0x8540
-#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541
-#define GL_COMBINER_INPUT_NV 0x8542
-#define GL_COMBINER_MAPPING_NV 0x8543
-#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544
-#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545
-#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546
-#define GL_COMBINER_MUX_SUM_NV 0x8547
-#define GL_COMBINER_SCALE_NV 0x8548
-#define GL_COMBINER_BIAS_NV 0x8549
-#define GL_COMBINER_AB_OUTPUT_NV 0x854A
-#define GL_COMBINER_CD_OUTPUT_NV 0x854B
-#define GL_COMBINER_SUM_OUTPUT_NV 0x854C
-#define GL_MAX_GENERAL_COMBINERS_NV 0x854D
-#define GL_NUM_GENERAL_COMBINERS_NV 0x854E
-#define GL_COLOR_SUM_CLAMP_NV 0x854F
-#define GL_COMBINER0_NV 0x8550
-#define GL_COMBINER1_NV 0x8551
-#define GL_COMBINER2_NV 0x8552
-#define GL_COMBINER3_NV 0x8553
-#define GL_COMBINER4_NV 0x8554
-#define GL_COMBINER5_NV 0x8555
-#define GL_COMBINER6_NV 0x8556
-#define GL_COMBINER7_NV 0x8557
-/* reuse GL_TEXTURE0_ARB */
-/* reuse GL_TEXTURE1_ARB */
-/* reuse GL_ZERO */
-/* reuse GL_NONE */
-/* reuse GL_FOG */
-#endif
-
-#ifndef GL_NV_fog_distance
-#define GL_FOG_DISTANCE_MODE_NV 0x855A
-#define GL_EYE_RADIAL_NV 0x855B
-#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C
-/* reuse GL_EYE_PLANE */
-#endif
-
-#ifndef GL_NV_texgen_emboss
-#define GL_EMBOSS_LIGHT_NV 0x855D
-#define GL_EMBOSS_CONSTANT_NV 0x855E
-#define GL_EMBOSS_MAP_NV 0x855F
-#endif
-
-#ifndef GL_NV_blend_square
-#endif
-
-#ifndef GL_NV_texture_env_combine4
-#define GL_COMBINE4_NV 0x8503
-#define GL_SOURCE3_RGB_NV 0x8583
-#define GL_SOURCE3_ALPHA_NV 0x858B
-#define GL_OPERAND3_RGB_NV 0x8593
-#define GL_OPERAND3_ALPHA_NV 0x859B
-#endif
-
-#ifndef GL_MESA_resize_buffers
-#endif
-
-#ifndef GL_MESA_window_pos
-#endif
-
-#ifndef GL_EXT_texture_compression_s3tc
-#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
-#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
-#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
-#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
-#endif
-
-#ifndef GL_IBM_cull_vertex
-#define GL_CULL_VERTEX_IBM 103050
-#endif
-
-#ifndef GL_IBM_multimode_draw_arrays
-#endif
-
-#ifndef GL_IBM_vertex_array_lists
-#define GL_VERTEX_ARRAY_LIST_IBM 103070
-#define GL_NORMAL_ARRAY_LIST_IBM 103071
-#define GL_COLOR_ARRAY_LIST_IBM 103072
-#define GL_INDEX_ARRAY_LIST_IBM 103073
-#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074
-#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075
-#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076
-#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077
-#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080
-#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081
-#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082
-#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083
-#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084
-#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085
-#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086
-#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087
-#endif
-
-#ifndef GL_SGIX_subsample
-#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0
-#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1
-#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2
-#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3
-#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4
-#endif
-
-#ifndef GL_SGIX_ycrcb_subsample
-#endif
-
-#ifndef GL_SGIX_ycrcba
-#define GL_YCRCB_SGIX 0x8318
-#define GL_YCRCBA_SGIX 0x8319
-#endif
-
-#ifndef GL_SGI_depth_pass_instrument
-#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310
-#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311
-#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312
-#endif
-
-#ifndef GL_3DFX_texture_compression_FXT1
-#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0
-#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1
-#endif
-
-#ifndef GL_3DFX_multisample
-#define GL_MULTISAMPLE_3DFX 0x86B2
-#define GL_SAMPLE_BUFFERS_3DFX 0x86B3
-#define GL_SAMPLES_3DFX 0x86B4
-#define GL_MULTISAMPLE_BIT_3DFX 0x20000000
-#endif
-
-#ifndef GL_3DFX_tbuffer
-#endif
-
-#ifndef GL_EXT_multisample
-#define GL_MULTISAMPLE_EXT 0x809D
-#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F
-#define GL_SAMPLE_MASK_EXT 0x80A0
-#define GL_1PASS_EXT 0x80A1
-#define GL_2PASS_0_EXT 0x80A2
-#define GL_2PASS_1_EXT 0x80A3
-#define GL_4PASS_0_EXT 0x80A4
-#define GL_4PASS_1_EXT 0x80A5
-#define GL_4PASS_2_EXT 0x80A6
-#define GL_4PASS_3_EXT 0x80A7
-#define GL_SAMPLE_BUFFERS_EXT 0x80A8
-#define GL_SAMPLES_EXT 0x80A9
-#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA
-#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB
-#define GL_SAMPLE_PATTERN_EXT 0x80AC
-#define GL_MULTISAMPLE_BIT_EXT 0x20000000
-#endif
-
-#ifndef GL_SGIX_vertex_preclip
-#define GL_VERTEX_PRECLIP_SGIX 0x83EE
-#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF
-#endif
-
-#ifndef GL_SGIX_convolution_accuracy
-#define GL_CONVOLUTION_HINT_SGIX 0x8316
-#endif
-
-#ifndef GL_SGIX_resample
-#define GL_PACK_RESAMPLE_SGIX 0x842C
-#define GL_UNPACK_RESAMPLE_SGIX 0x842D
-#define GL_RESAMPLE_REPLICATE_SGIX 0x842E
-#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F
-#define GL_RESAMPLE_DECIMATE_SGIX 0x8430
-#endif
-
-#ifndef GL_SGIS_point_line_texgen
-#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0
-#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1
-#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2
-#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3
-#define GL_EYE_POINT_SGIS 0x81F4
-#define GL_OBJECT_POINT_SGIS 0x81F5
-#define GL_EYE_LINE_SGIS 0x81F6
-#define GL_OBJECT_LINE_SGIS 0x81F7
-#endif
-
-#ifndef GL_SGIS_texture_color_mask
-#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF
-#endif
-
-#ifndef GL_EXT_texture_env_dot3
-#define GL_DOT3_RGB_EXT 0x8740
-#define GL_DOT3_RGBA_EXT 0x8741
-#endif
-
-#ifndef GL_ATI_texture_mirror_once
-#define GL_MIRROR_CLAMP_ATI 0x8742
-#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743
-#endif
-
-#ifndef GL_NV_fence
-#define GL_ALL_COMPLETED_NV 0x84F2
-#define GL_FENCE_STATUS_NV 0x84F3
-#define GL_FENCE_CONDITION_NV 0x84F4
-#endif
-
-#ifndef GL_IBM_texture_mirrored_repeat
-#define GL_MIRRORED_REPEAT_IBM 0x8370
-#endif
-
-#ifndef GL_NV_evaluators
-#define GL_EVAL_2D_NV 0x86C0
-#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1
-#define GL_MAP_TESSELLATION_NV 0x86C2
-#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3
-#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4
-#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5
-#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6
-#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7
-#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8
-#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9
-#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA
-#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB
-#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC
-#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD
-#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE
-#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF
-#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0
-#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1
-#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2
-#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3
-#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4
-#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5
-#define GL_MAX_MAP_TESSELLATION_NV 0x86D6
-#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7
-#endif
-
-#ifndef GL_NV_packed_depth_stencil
-#define GL_DEPTH_STENCIL_NV 0x84F9
-#define GL_UNSIGNED_INT_24_8_NV 0x84FA
-#endif
-
-#ifndef GL_NV_register_combiners2
-#define GL_PER_STAGE_CONSTANTS_NV 0x8535
-#endif
-
-#ifndef GL_NV_texture_compression_vtc
-#endif
-
-#ifndef GL_NV_texture_rectangle
-#define GL_TEXTURE_RECTANGLE_NV 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8
-#endif
-
-#ifndef GL_NV_texture_shader
-#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C
-#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D
-#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
-#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9
-#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA
-#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB
-#define GL_DSDT_MAG_INTENSITY_NV 0x86DC
-#define GL_SHADER_CONSISTENT_NV 0x86DD
-#define GL_TEXTURE_SHADER_NV 0x86DE
-#define GL_SHADER_OPERATION_NV 0x86DF
-#define GL_CULL_MODES_NV 0x86E0
-#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1
-#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2
-#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3
-#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV
-#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV
-#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV
-#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4
-#define GL_CONST_EYE_NV 0x86E5
-#define GL_PASS_THROUGH_NV 0x86E6
-#define GL_CULL_FRAGMENT_NV 0x86E7
-#define GL_OFFSET_TEXTURE_2D_NV 0x86E8
-#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9
-#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA
-#define GL_DOT_PRODUCT_NV 0x86EC
-#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED
-#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE
-#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0
-#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1
-#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2
-#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3
-#define GL_HILO_NV 0x86F4
-#define GL_DSDT_NV 0x86F5
-#define GL_DSDT_MAG_NV 0x86F6
-#define GL_DSDT_MAG_VIB_NV 0x86F7
-#define GL_HILO16_NV 0x86F8
-#define GL_SIGNED_HILO_NV 0x86F9
-#define GL_SIGNED_HILO16_NV 0x86FA
-#define GL_SIGNED_RGBA_NV 0x86FB
-#define GL_SIGNED_RGBA8_NV 0x86FC
-#define GL_SIGNED_RGB_NV 0x86FE
-#define GL_SIGNED_RGB8_NV 0x86FF
-#define GL_SIGNED_LUMINANCE_NV 0x8701
-#define GL_SIGNED_LUMINANCE8_NV 0x8702
-#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703
-#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704
-#define GL_SIGNED_ALPHA_NV 0x8705
-#define GL_SIGNED_ALPHA8_NV 0x8706
-#define GL_SIGNED_INTENSITY_NV 0x8707
-#define GL_SIGNED_INTENSITY8_NV 0x8708
-#define GL_DSDT8_NV 0x8709
-#define GL_DSDT8_MAG8_NV 0x870A
-#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B
-#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C
-#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
-#define GL_HI_SCALE_NV 0x870E
-#define GL_LO_SCALE_NV 0x870F
-#define GL_DS_SCALE_NV 0x8710
-#define GL_DT_SCALE_NV 0x8711
-#define GL_MAGNITUDE_SCALE_NV 0x8712
-#define GL_VIBRANCE_SCALE_NV 0x8713
-#define GL_HI_BIAS_NV 0x8714
-#define GL_LO_BIAS_NV 0x8715
-#define GL_DS_BIAS_NV 0x8716
-#define GL_DT_BIAS_NV 0x8717
-#define GL_MAGNITUDE_BIAS_NV 0x8718
-#define GL_VIBRANCE_BIAS_NV 0x8719
-#define GL_TEXTURE_BORDER_VALUES_NV 0x871A
-#define GL_TEXTURE_HI_SIZE_NV 0x871B
-#define GL_TEXTURE_LO_SIZE_NV 0x871C
-#define GL_TEXTURE_DS_SIZE_NV 0x871D
-#define GL_TEXTURE_DT_SIZE_NV 0x871E
-#define GL_TEXTURE_MAG_SIZE_NV 0x871F
-#endif
-
-#ifndef GL_NV_texture_shader2
-#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF
-#endif
-
-#ifndef GL_NV_vertex_array_range2
-#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533
-#endif
-
-#ifndef GL_NV_vertex_program
-#define GL_VERTEX_PROGRAM_NV 0x8620
-#define GL_VERTEX_STATE_PROGRAM_NV 0x8621
-#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623
-#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624
-#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625
-#define GL_CURRENT_ATTRIB_NV 0x8626
-#define GL_PROGRAM_LENGTH_NV 0x8627
-#define GL_PROGRAM_STRING_NV 0x8628
-#define GL_MODELVIEW_PROJECTION_NV 0x8629
-#define GL_IDENTITY_NV 0x862A
-#define GL_INVERSE_NV 0x862B
-#define GL_TRANSPOSE_NV 0x862C
-#define GL_INVERSE_TRANSPOSE_NV 0x862D
-#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E
-#define GL_MAX_TRACK_MATRICES_NV 0x862F
-#define GL_MATRIX0_NV 0x8630
-#define GL_MATRIX1_NV 0x8631
-#define GL_MATRIX2_NV 0x8632
-#define GL_MATRIX3_NV 0x8633
-#define GL_MATRIX4_NV 0x8634
-#define GL_MATRIX5_NV 0x8635
-#define GL_MATRIX6_NV 0x8636
-#define GL_MATRIX7_NV 0x8637
-#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640
-#define GL_CURRENT_MATRIX_NV 0x8641
-#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643
-#define GL_PROGRAM_PARAMETER_NV 0x8644
-#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645
-#define GL_PROGRAM_TARGET_NV 0x8646
-#define GL_PROGRAM_RESIDENT_NV 0x8647
-#define GL_TRACK_MATRIX_NV 0x8648
-#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649
-#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A
-#define GL_PROGRAM_ERROR_POSITION_NV 0x864B
-#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650
-#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651
-#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652
-#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653
-#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654
-#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655
-#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656
-#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657
-#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658
-#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659
-#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A
-#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B
-#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C
-#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D
-#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E
-#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F
-#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660
-#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661
-#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662
-#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663
-#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664
-#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665
-#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666
-#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667
-#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668
-#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669
-#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A
-#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B
-#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C
-#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D
-#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E
-#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F
-#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670
-#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671
-#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672
-#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673
-#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674
-#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675
-#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676
-#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677
-#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678
-#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679
-#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A
-#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B
-#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C
-#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D
-#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E
-#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F
-#endif
-
-#ifndef GL_SGIX_texture_coordinate_clamp
-#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369
-#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A
-#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B
-#endif
-
-#ifndef GL_SGIX_scalebias_hint
-#define GL_SCALEBIAS_HINT_SGIX 0x8322
-#endif
-
-#ifndef GL_OML_interlace
-#define GL_INTERLACE_OML 0x8980
-#define GL_INTERLACE_READ_OML 0x8981
-#endif
-
-#ifndef GL_OML_subsample
-#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982
-#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983
-#endif
-
-#ifndef GL_OML_resample
-#define GL_PACK_RESAMPLE_OML 0x8984
-#define GL_UNPACK_RESAMPLE_OML 0x8985
-#define GL_RESAMPLE_REPLICATE_OML 0x8986
-#define GL_RESAMPLE_ZERO_FILL_OML 0x8987
-#define GL_RESAMPLE_AVERAGE_OML 0x8988
-#define GL_RESAMPLE_DECIMATE_OML 0x8989
-#endif
-
-#ifndef GL_NV_copy_depth_to_color
-#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E
-#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F
-#endif
-
-#ifndef GL_ATI_envmap_bumpmap
-#define GL_BUMP_ROT_MATRIX_ATI 0x8775
-#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776
-#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777
-#define GL_BUMP_TEX_UNITS_ATI 0x8778
-#define GL_DUDV_ATI 0x8779
-#define GL_DU8DV8_ATI 0x877A
-#define GL_BUMP_ENVMAP_ATI 0x877B
-#define GL_BUMP_TARGET_ATI 0x877C
-#endif
-
-#ifndef GL_ATI_fragment_shader
-#define GL_FRAGMENT_SHADER_ATI 0x8920
-#define GL_REG_0_ATI 0x8921
-#define GL_REG_1_ATI 0x8922
-#define GL_REG_2_ATI 0x8923
-#define GL_REG_3_ATI 0x8924
-#define GL_REG_4_ATI 0x8925
-#define GL_REG_5_ATI 0x8926
-#define GL_REG_6_ATI 0x8927
-#define GL_REG_7_ATI 0x8928
-#define GL_REG_8_ATI 0x8929
-#define GL_REG_9_ATI 0x892A
-#define GL_REG_10_ATI 0x892B
-#define GL_REG_11_ATI 0x892C
-#define GL_REG_12_ATI 0x892D
-#define GL_REG_13_ATI 0x892E
-#define GL_REG_14_ATI 0x892F
-#define GL_REG_15_ATI 0x8930
-#define GL_REG_16_ATI 0x8931
-#define GL_REG_17_ATI 0x8932
-#define GL_REG_18_ATI 0x8933
-#define GL_REG_19_ATI 0x8934
-#define GL_REG_20_ATI 0x8935
-#define GL_REG_21_ATI 0x8936
-#define GL_REG_22_ATI 0x8937
-#define GL_REG_23_ATI 0x8938
-#define GL_REG_24_ATI 0x8939
-#define GL_REG_25_ATI 0x893A
-#define GL_REG_26_ATI 0x893B
-#define GL_REG_27_ATI 0x893C
-#define GL_REG_28_ATI 0x893D
-#define GL_REG_29_ATI 0x893E
-#define GL_REG_30_ATI 0x893F
-#define GL_REG_31_ATI 0x8940
-#define GL_CON_0_ATI 0x8941
-#define GL_CON_1_ATI 0x8942
-#define GL_CON_2_ATI 0x8943
-#define GL_CON_3_ATI 0x8944
-#define GL_CON_4_ATI 0x8945
-#define GL_CON_5_ATI 0x8946
-#define GL_CON_6_ATI 0x8947
-#define GL_CON_7_ATI 0x8948
-#define GL_CON_8_ATI 0x8949
-#define GL_CON_9_ATI 0x894A
-#define GL_CON_10_ATI 0x894B
-#define GL_CON_11_ATI 0x894C
-#define GL_CON_12_ATI 0x894D
-#define GL_CON_13_ATI 0x894E
-#define GL_CON_14_ATI 0x894F
-#define GL_CON_15_ATI 0x8950
-#define GL_CON_16_ATI 0x8951
-#define GL_CON_17_ATI 0x8952
-#define GL_CON_18_ATI 0x8953
-#define GL_CON_19_ATI 0x8954
-#define GL_CON_20_ATI 0x8955
-#define GL_CON_21_ATI 0x8956
-#define GL_CON_22_ATI 0x8957
-#define GL_CON_23_ATI 0x8958
-#define GL_CON_24_ATI 0x8959
-#define GL_CON_25_ATI 0x895A
-#define GL_CON_26_ATI 0x895B
-#define GL_CON_27_ATI 0x895C
-#define GL_CON_28_ATI 0x895D
-#define GL_CON_29_ATI 0x895E
-#define GL_CON_30_ATI 0x895F
-#define GL_CON_31_ATI 0x8960
-#define GL_MOV_ATI 0x8961
-#define GL_ADD_ATI 0x8963
-#define GL_MUL_ATI 0x8964
-#define GL_SUB_ATI 0x8965
-#define GL_DOT3_ATI 0x8966
-#define GL_DOT4_ATI 0x8967
-#define GL_MAD_ATI 0x8968
-#define GL_LERP_ATI 0x8969
-#define GL_CND_ATI 0x896A
-#define GL_CND0_ATI 0x896B
-#define GL_DOT2_ADD_ATI 0x896C
-#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D
-#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E
-#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F
-#define GL_NUM_PASSES_ATI 0x8970
-#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971
-#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972
-#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973
-#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974
-#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975
-#define GL_SWIZZLE_STR_ATI 0x8976
-#define GL_SWIZZLE_STQ_ATI 0x8977
-#define GL_SWIZZLE_STR_DR_ATI 0x8978
-#define GL_SWIZZLE_STQ_DQ_ATI 0x8979
-#define GL_SWIZZLE_STRQ_ATI 0x897A
-#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B
-#define GL_RED_BIT_ATI 0x00000001
-#define GL_GREEN_BIT_ATI 0x00000002
-#define GL_BLUE_BIT_ATI 0x00000004
-#define GL_2X_BIT_ATI 0x00000001
-#define GL_4X_BIT_ATI 0x00000002
-#define GL_8X_BIT_ATI 0x00000004
-#define GL_HALF_BIT_ATI 0x00000008
-#define GL_QUARTER_BIT_ATI 0x00000010
-#define GL_EIGHTH_BIT_ATI 0x00000020
-#define GL_SATURATE_BIT_ATI 0x00000040
-#define GL_COMP_BIT_ATI 0x00000002
-#define GL_NEGATE_BIT_ATI 0x00000004
-#define GL_BIAS_BIT_ATI 0x00000008
-#endif
-
-#ifndef GL_ATI_pn_triangles
-#define GL_PN_TRIANGLES_ATI 0x87F0
-#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1
-#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2
-#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3
-#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4
-#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5
-#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6
-#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7
-#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8
-#endif
-
-#ifndef GL_ATI_vertex_array_object
-#define GL_STATIC_ATI 0x8760
-#define GL_DYNAMIC_ATI 0x8761
-#define GL_PRESERVE_ATI 0x8762
-#define GL_DISCARD_ATI 0x8763
-#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764
-#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765
-#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766
-#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767
-#endif
-
-#ifndef GL_EXT_vertex_shader
-#define GL_VERTEX_SHADER_EXT 0x8780
-#define GL_VERTEX_SHADER_BINDING_EXT 0x8781
-#define GL_OP_INDEX_EXT 0x8782
-#define GL_OP_NEGATE_EXT 0x8783
-#define GL_OP_DOT3_EXT 0x8784
-#define GL_OP_DOT4_EXT 0x8785
-#define GL_OP_MUL_EXT 0x8786
-#define GL_OP_ADD_EXT 0x8787
-#define GL_OP_MADD_EXT 0x8788
-#define GL_OP_FRAC_EXT 0x8789
-#define GL_OP_MAX_EXT 0x878A
-#define GL_OP_MIN_EXT 0x878B
-#define GL_OP_SET_GE_EXT 0x878C
-#define GL_OP_SET_LT_EXT 0x878D
-#define GL_OP_CLAMP_EXT 0x878E
-#define GL_OP_FLOOR_EXT 0x878F
-#define GL_OP_ROUND_EXT 0x8790
-#define GL_OP_EXP_BASE_2_EXT 0x8791
-#define GL_OP_LOG_BASE_2_EXT 0x8792
-#define GL_OP_POWER_EXT 0x8793
-#define GL_OP_RECIP_EXT 0x8794
-#define GL_OP_RECIP_SQRT_EXT 0x8795
-#define GL_OP_SUB_EXT 0x8796
-#define GL_OP_CROSS_PRODUCT_EXT 0x8797
-#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798
-#define GL_OP_MOV_EXT 0x8799
-#define GL_OUTPUT_VERTEX_EXT 0x879A
-#define GL_OUTPUT_COLOR0_EXT 0x879B
-#define GL_OUTPUT_COLOR1_EXT 0x879C
-#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D
-#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E
-#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F
-#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0
-#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1
-#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2
-#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3
-#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4
-#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5
-#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6
-#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7
-#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8
-#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9
-#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA
-#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB
-#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC
-#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD
-#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE
-#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF
-#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0
-#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1
-#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2
-#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3
-#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4
-#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5
-#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6
-#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7
-#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8
-#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9
-#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA
-#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB
-#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC
-#define GL_OUTPUT_FOG_EXT 0x87BD
-#define GL_SCALAR_EXT 0x87BE
-#define GL_VECTOR_EXT 0x87BF
-#define GL_MATRIX_EXT 0x87C0
-#define GL_VARIANT_EXT 0x87C1
-#define GL_INVARIANT_EXT 0x87C2
-#define GL_LOCAL_CONSTANT_EXT 0x87C3
-#define GL_LOCAL_EXT 0x87C4
-#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5
-#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6
-#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7
-#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8
-#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE
-#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF
-#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0
-#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1
-#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2
-#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3
-#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4
-#define GL_X_EXT 0x87D5
-#define GL_Y_EXT 0x87D6
-#define GL_Z_EXT 0x87D7
-#define GL_W_EXT 0x87D8
-#define GL_NEGATIVE_X_EXT 0x87D9
-#define GL_NEGATIVE_Y_EXT 0x87DA
-#define GL_NEGATIVE_Z_EXT 0x87DB
-#define GL_NEGATIVE_W_EXT 0x87DC
-#define GL_ZERO_EXT 0x87DD
-#define GL_ONE_EXT 0x87DE
-#define GL_NEGATIVE_ONE_EXT 0x87DF
-#define GL_NORMALIZED_RANGE_EXT 0x87E0
-#define GL_FULL_RANGE_EXT 0x87E1
-#define GL_CURRENT_VERTEX_EXT 0x87E2
-#define GL_MVP_MATRIX_EXT 0x87E3
-#define GL_VARIANT_VALUE_EXT 0x87E4
-#define GL_VARIANT_DATATYPE_EXT 0x87E5
-#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6
-#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7
-#define GL_VARIANT_ARRAY_EXT 0x87E8
-#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9
-#define GL_INVARIANT_VALUE_EXT 0x87EA
-#define GL_INVARIANT_DATATYPE_EXT 0x87EB
-#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC
-#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED
-#endif
-
-#ifndef GL_ATI_vertex_streams
-#define GL_MAX_VERTEX_STREAMS_ATI 0x876B
-#define GL_VERTEX_STREAM0_ATI 0x876C
-#define GL_VERTEX_STREAM1_ATI 0x876D
-#define GL_VERTEX_STREAM2_ATI 0x876E
-#define GL_VERTEX_STREAM3_ATI 0x876F
-#define GL_VERTEX_STREAM4_ATI 0x8770
-#define GL_VERTEX_STREAM5_ATI 0x8771
-#define GL_VERTEX_STREAM6_ATI 0x8772
-#define GL_VERTEX_STREAM7_ATI 0x8773
-#define GL_VERTEX_SOURCE_ATI 0x8774
-#endif
-
-#ifndef GL_ATI_element_array
-#define GL_ELEMENT_ARRAY_ATI 0x8768
-#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769
-#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A
-#endif
-
-#ifndef GL_SUN_mesh_array
-#define GL_QUAD_MESH_SUN 0x8614
-#define GL_TRIANGLE_MESH_SUN 0x8615
-#endif
-
-#ifndef GL_SUN_slice_accum
-#define GL_SLICE_ACCUM_SUN 0x85CC
-#endif
-
-#ifndef GL_NV_multisample_filter_hint
-#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534
-#endif
-
-#ifndef GL_NV_depth_clamp
-#define GL_DEPTH_CLAMP_NV 0x864F
-#endif
-
-#ifndef GL_NV_occlusion_query
-#define GL_PIXEL_COUNTER_BITS_NV 0x8864
-#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865
-#define GL_PIXEL_COUNT_NV 0x8866
-#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867
-#endif
-
-#ifndef GL_NV_point_sprite
-#define GL_POINT_SPRITE_NV 0x8861
-#define GL_COORD_REPLACE_NV 0x8862
-#define GL_POINT_SPRITE_R_MODE_NV 0x8863
-#endif
-
-#ifndef GL_NV_texture_shader3
-#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850
-#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851
-#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852
-#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853
-#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854
-#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855
-#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856
-#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857
-#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858
-#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859
-#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A
-#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B
-#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C
-#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D
-#define GL_HILO8_NV 0x885E
-#define GL_SIGNED_HILO8_NV 0x885F
-#define GL_FORCE_BLUE_TO_ONE_NV 0x8860
-#endif
-
-#ifndef GL_NV_vertex_program1_1
-#endif
-
-#ifndef GL_EXT_shadow_funcs
-#endif
-
-#ifndef GL_EXT_stencil_two_side
-#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910
-#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911
-#endif
-
-#ifndef GL_ATI_text_fragment_shader
-#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200
-#endif
-
-#ifndef GL_APPLE_client_storage
-#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
-#endif
-
-#ifndef GL_APPLE_element_array
-#define GL_ELEMENT_ARRAY_APPLE 0x8768
-#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769
-#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A
-#endif
-
-#ifndef GL_APPLE_fence
-#define GL_DRAW_PIXELS_APPLE 0x8A0A
-#define GL_FENCE_APPLE 0x8A0B
-#endif
-
-#ifndef GL_APPLE_vertex_array_object
-#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5
-#endif
-
-#ifndef GL_APPLE_vertex_array_range
-#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D
-#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E
-#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F
-#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521
-#define GL_STORAGE_CACHED_APPLE 0x85BE
-#define GL_STORAGE_SHARED_APPLE 0x85BF
-#endif
-
-#ifndef GL_APPLE_ycbcr_422
-#define GL_YCBCR_422_APPLE 0x85B9
-#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
-#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
-#endif
-
-#ifndef GL_S3_s3tc
-#define GL_RGB_S3TC 0x83A0
-#define GL_RGB4_S3TC 0x83A1
-#define GL_RGBA_S3TC 0x83A2
-#define GL_RGBA4_S3TC 0x83A3
-#endif
-
-#ifndef GL_ATI_draw_buffers
-#define GL_MAX_DRAW_BUFFERS_ATI 0x8824
-#define GL_DRAW_BUFFER0_ATI 0x8825
-#define GL_DRAW_BUFFER1_ATI 0x8826
-#define GL_DRAW_BUFFER2_ATI 0x8827
-#define GL_DRAW_BUFFER3_ATI 0x8828
-#define GL_DRAW_BUFFER4_ATI 0x8829
-#define GL_DRAW_BUFFER5_ATI 0x882A
-#define GL_DRAW_BUFFER6_ATI 0x882B
-#define GL_DRAW_BUFFER7_ATI 0x882C
-#define GL_DRAW_BUFFER8_ATI 0x882D
-#define GL_DRAW_BUFFER9_ATI 0x882E
-#define GL_DRAW_BUFFER10_ATI 0x882F
-#define GL_DRAW_BUFFER11_ATI 0x8830
-#define GL_DRAW_BUFFER12_ATI 0x8831
-#define GL_DRAW_BUFFER13_ATI 0x8832
-#define GL_DRAW_BUFFER14_ATI 0x8833
-#define GL_DRAW_BUFFER15_ATI 0x8834
-#endif
-
-#ifndef GL_ATI_pixel_format_float
-#define GL_TYPE_RGBA_FLOAT_ATI 0x8820
-#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
-#endif
-
-#ifndef GL_ATI_texture_env_combine3
-#define GL_MODULATE_ADD_ATI 0x8744
-#define GL_MODULATE_SIGNED_ADD_ATI 0x8745
-#define GL_MODULATE_SUBTRACT_ATI 0x8746
-#endif
-
-#ifndef GL_ATI_texture_float
-#define GL_RGBA_FLOAT32_ATI 0x8814
-#define GL_RGB_FLOAT32_ATI 0x8815
-#define GL_ALPHA_FLOAT32_ATI 0x8816
-#define GL_INTENSITY_FLOAT32_ATI 0x8817
-#define GL_LUMINANCE_FLOAT32_ATI 0x8818
-#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819
-#define GL_RGBA_FLOAT16_ATI 0x881A
-#define GL_RGB_FLOAT16_ATI 0x881B
-#define GL_ALPHA_FLOAT16_ATI 0x881C
-#define GL_INTENSITY_FLOAT16_ATI 0x881D
-#define GL_LUMINANCE_FLOAT16_ATI 0x881E
-#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F
-#endif
-
-#ifndef GL_NV_float_buffer
-#define GL_FLOAT_R_NV 0x8880
-#define GL_FLOAT_RG_NV 0x8881
-#define GL_FLOAT_RGB_NV 0x8882
-#define GL_FLOAT_RGBA_NV 0x8883
-#define GL_FLOAT_R16_NV 0x8884
-#define GL_FLOAT_R32_NV 0x8885
-#define GL_FLOAT_RG16_NV 0x8886
-#define GL_FLOAT_RG32_NV 0x8887
-#define GL_FLOAT_RGB16_NV 0x8888
-#define GL_FLOAT_RGB32_NV 0x8889
-#define GL_FLOAT_RGBA16_NV 0x888A
-#define GL_FLOAT_RGBA32_NV 0x888B
-#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C
-#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D
-#define GL_FLOAT_RGBA_MODE_NV 0x888E
-#endif
-
-#ifndef GL_NV_fragment_program
-#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868
-#define GL_FRAGMENT_PROGRAM_NV 0x8870
-#define GL_MAX_TEXTURE_COORDS_NV 0x8871
-#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872
-#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873
-#define GL_PROGRAM_ERROR_STRING_NV 0x8874
-#endif
-
-#ifndef GL_NV_half_float
-#define GL_HALF_FLOAT_NV 0x140B
-#endif
-
-#ifndef GL_NV_pixel_data_range
-#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878
-#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879
-#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A
-#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B
-#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C
-#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D
-#endif
-
-#ifndef GL_NV_primitive_restart
-#define GL_PRIMITIVE_RESTART_NV 0x8558
-#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559
-#endif
-
-#ifndef GL_NV_texture_expand_normal
-#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F
-#endif
-
-#ifndef GL_NV_vertex_program2
-#endif
-
-#ifndef GL_ATI_map_object_buffer
-#endif
-
-#ifndef GL_ATI_separate_stencil
-#define GL_STENCIL_BACK_FUNC_ATI 0x8800
-#define GL_STENCIL_BACK_FAIL_ATI 0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803
-#endif
-
-#ifndef GL_ATI_vertex_attrib_array_object
-#endif
-
-#ifndef GL_OES_read_format
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
-#endif
-
-#ifndef GL_EXT_depth_bounds_test
-#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890
-#define GL_DEPTH_BOUNDS_EXT 0x8891
-#endif
-
-#ifndef GL_EXT_texture_mirror_clamp
-#define GL_MIRROR_CLAMP_EXT 0x8742
-#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743
-#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912
-#endif
-
-#ifndef GL_EXT_blend_equation_separate
-#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION
-#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D
-#endif
-
-#ifndef GL_MESA_pack_invert
-#define GL_PACK_INVERT_MESA 0x8758
-#endif
-
-#ifndef GL_MESA_ycbcr_texture
-#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA
-#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB
-#define GL_YCBCR_MESA 0x8757
-#endif
-
-#ifndef GL_EXT_pixel_buffer_object
-#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF
-#endif
-
-#ifndef GL_NV_fragment_program_option
-#endif
-
-#ifndef GL_NV_fragment_program2
-#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4
-#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5
-#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6
-#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7
-#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8
-#endif
-
-#ifndef GL_NV_vertex_program2_option
-/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
-/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */
-#endif
-
-#ifndef GL_NV_vertex_program3
-/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
-#endif
-
-#ifndef GL_EXT_framebuffer_object
-#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
-#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
-#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
-#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
-#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8
-#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
-#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
-#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
-#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
-#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
-#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
-#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
-#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
-#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
-#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
-#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
-#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
-#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
-#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
-#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
-#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
-#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
-#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
-#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
-#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
-#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
-#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
-#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
-#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
-#define GL_FRAMEBUFFER_EXT 0x8D40
-#define GL_RENDERBUFFER_EXT 0x8D41
-#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
-#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
-#define GL_STENCIL_INDEX1_EXT 0x8D46
-#define GL_STENCIL_INDEX4_EXT 0x8D47
-#define GL_STENCIL_INDEX8_EXT 0x8D48
-#define GL_STENCIL_INDEX16_EXT 0x8D49
-#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
-#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
-#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
-#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
-#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
-#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
-#endif
-
-#ifndef GL_GREMEDY_string_marker
-#endif
-
-
-/*************************************************************/
-
-#include <stddef.h>
-#ifndef GL_VERSION_2_0
-/* GL type for program/shader text */
-typedef char GLchar; /* native character */
-#endif
-
-#ifndef GL_VERSION_1_5
-/* GL types for handling large vertex buffer objects */
-typedef ptrdiff_t GLintptr;
-typedef ptrdiff_t GLsizeiptr;
-#endif
-
-#ifndef GL_ARB_vertex_buffer_object
-/* GL types for handling large vertex buffer objects */
-typedef ptrdiff_t GLintptrARB;
-typedef ptrdiff_t GLsizeiptrARB;
-#endif
-
-#ifndef GL_ARB_shader_objects
-/* GL types for handling shader object handles and program/shader text */
-typedef char GLcharARB; /* native character */
-typedef unsigned int GLhandleARB; /* shader object handle */
-#endif
-
-/* GL types for "half" precision (s10e5) float data in host memory */
-#ifndef GL_ARB_half_float_pixel
-typedef unsigned short GLhalfARB;
-#endif
-
-#ifndef GL_NV_half_float
-typedef unsigned short GLhalfNV;
-#endif
-
-#ifndef GL_VERSION_1_2
-#define GL_VERSION_1_2 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf);
-GLAPI void APIENTRY glBlendEquation (GLenum);
-GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
-GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei);
-GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei);
-GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint);
-GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei);
-GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
-GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
-GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
-GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean);
-GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean);
-GLAPI void APIENTRY glResetHistogram (GLenum);
-GLAPI void APIENTRY glResetMinmax (GLenum);
-GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
-
-#ifndef GL_VERSION_1_3
-#define GL_VERSION_1_3 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glActiveTexture (GLenum);
-GLAPI void APIENTRY glClientActiveTexture (GLenum);
-GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint);
-GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort);
-GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *);
-GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint);
-GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort);
-GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *);
-GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint);
-GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *);
-GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *);
-GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *);
-GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *);
-GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *);
-GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *);
-GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean);
-GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
-typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
-#endif
-
-#ifndef GL_VERSION_1_4
-#define GL_VERSION_1_4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glFogCoordf (GLfloat);
-GLAPI void APIENTRY glFogCoordfv (const GLfloat *);
-GLAPI void APIENTRY glFogCoordd (GLdouble);
-GLAPI void APIENTRY glFogCoorddv (const GLdouble *);
-GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei);
-GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
-GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat);
-GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *);
-GLAPI void APIENTRY glPointParameteri (GLenum, GLint);
-GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *);
-GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte);
-GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *);
-GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *);
-GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *);
-GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint);
-GLAPI void APIENTRY glSecondaryColor3iv (const GLint *);
-GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *);
-GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte);
-GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *);
-GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *);
-GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort);
-GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *);
-GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble);
-GLAPI void APIENTRY glWindowPos2dv (const GLdouble *);
-GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat);
-GLAPI void APIENTRY glWindowPos2fv (const GLfloat *);
-GLAPI void APIENTRY glWindowPos2i (GLint, GLint);
-GLAPI void APIENTRY glWindowPos2iv (const GLint *);
-GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort);
-GLAPI void APIENTRY glWindowPos2sv (const GLshort *);
-GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glWindowPos3dv (const GLdouble *);
-GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glWindowPos3fv (const GLfloat *);
-GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint);
-GLAPI void APIENTRY glWindowPos3iv (const GLint *);
-GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glWindowPos3sv (const GLshort *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord);
-typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v);
-#endif
-
-#ifndef GL_VERSION_1_5
-#define GL_VERSION_1_5 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *);
-GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *);
-GLAPI GLboolean APIENTRY glIsQuery (GLuint);
-GLAPI void APIENTRY glBeginQuery (GLenum, GLuint);
-GLAPI void APIENTRY glEndQuery (GLenum);
-GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *);
-GLAPI void APIENTRY glBindBuffer (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *);
-GLAPI GLboolean APIENTRY glIsBuffer (GLuint);
-GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum);
-GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *);
-GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *);
-GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum);
-GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum);
-GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
-typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
-typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
-typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
-typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
-typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
-typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
-typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
-typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params);
-#endif
-
-#ifndef GL_VERSION_2_0
-#define GL_VERSION_2_0 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum);
-GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *);
-GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint);
-GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint);
-GLAPI void APIENTRY glAttachShader (GLuint, GLuint);
-GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *);
-GLAPI void APIENTRY glCompileShader (GLuint);
-GLAPI GLuint APIENTRY glCreateProgram (void);
-GLAPI GLuint APIENTRY glCreateShader (GLenum);
-GLAPI void APIENTRY glDeleteProgram (GLuint);
-GLAPI void APIENTRY glDeleteShader (GLuint);
-GLAPI void APIENTRY glDetachShader (GLuint, GLuint);
-GLAPI void APIENTRY glDisableVertexAttribArray (GLuint);
-GLAPI void APIENTRY glEnableVertexAttribArray (GLuint);
-GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
-GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
-GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *);
-GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *);
-GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
-GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
-GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *);
-GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *);
-GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *);
-GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *);
-GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *);
-GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *);
-GLAPI GLboolean APIENTRY glIsProgram (GLuint);
-GLAPI GLboolean APIENTRY glIsShader (GLuint);
-GLAPI void APIENTRY glLinkProgram (GLuint);
-GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *);
-GLAPI void APIENTRY glUseProgram (GLuint);
-GLAPI void APIENTRY glUniform1f (GLint, GLfloat);
-GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat);
-GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glUniform1i (GLint, GLint);
-GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint);
-GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glValidateProgram (GLuint);
-GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble);
-GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat);
-GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort);
-GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *);
-GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
-GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *);
-GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *);
-GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *);
-GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *);
-GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *);
-GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
-typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
-typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
-typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
-typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
-typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
-typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
-typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
-typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
-typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
-typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
-typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
-typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
-typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
-typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
-typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
-typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
-typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
-typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
-typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_ARB_multitexture
-#define GL_ARB_multitexture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glActiveTextureARB (GLenum);
-GLAPI void APIENTRY glClientActiveTextureARB (GLenum);
-GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint);
-GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort);
-GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *);
-GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint);
-GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort);
-GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *);
-GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint);
-GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *);
-GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *);
-GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *);
-GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *);
-GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
-#endif
-
-#ifndef GL_ARB_transpose_matrix
-#define GL_ARB_transpose_matrix 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *);
-GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *);
-GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *);
-GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
-typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
-#endif
-
-#ifndef GL_ARB_multisample
-#define GL_ARB_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert);
-#endif
-
-#ifndef GL_ARB_texture_env_add
-#define GL_ARB_texture_env_add 1
-#endif
-
-#ifndef GL_ARB_texture_cube_map
-#define GL_ARB_texture_cube_map 1
-#endif
-
-#ifndef GL_ARB_texture_compression
-#define GL_ARB_texture_compression 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img);
-#endif
-
-#ifndef GL_ARB_texture_border_clamp
-#define GL_ARB_texture_border_clamp 1
-#endif
-
-#ifndef GL_ARB_point_parameters
-#define GL_ARB_point_parameters 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat);
-GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);
-#endif
-
-#ifndef GL_ARB_vertex_blend
-#define GL_ARB_vertex_blend 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *);
-GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *);
-GLAPI void APIENTRY glWeightivARB (GLint, const GLint *);
-GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *);
-GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *);
-GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *);
-GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *);
-GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *);
-GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glVertexBlendARB (GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights);
-typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights);
-typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights);
-typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights);
-typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights);
-typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights);
-typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights);
-typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights);
-typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count);
-#endif
-
-#ifndef GL_ARB_matrix_palette
-#define GL_ARB_matrix_palette 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint);
-GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *);
-GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *);
-GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *);
-GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index);
-typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices);
-typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices);
-typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices);
-typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_ARB_texture_env_combine
-#define GL_ARB_texture_env_combine 1
-#endif
-
-#ifndef GL_ARB_texture_env_crossbar
-#define GL_ARB_texture_env_crossbar 1
-#endif
-
-#ifndef GL_ARB_texture_env_dot3
-#define GL_ARB_texture_env_dot3 1
-#endif
-
-#ifndef GL_ARB_texture_mirrored_repeat
-#define GL_ARB_texture_mirrored_repeat 1
-#endif
-
-#ifndef GL_ARB_depth_texture
-#define GL_ARB_depth_texture 1
-#endif
-
-#ifndef GL_ARB_shadow
-#define GL_ARB_shadow 1
-#endif
-
-#ifndef GL_ARB_shadow_ambient
-#define GL_ARB_shadow_ambient 1
-#endif
-
-#ifndef GL_ARB_window_pos
-#define GL_ARB_window_pos 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble);
-GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *);
-GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat);
-GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *);
-GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint);
-GLAPI void APIENTRY glWindowPos2ivARB (const GLint *);
-GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort);
-GLAPI void APIENTRY glWindowPos2svARB (const GLshort *);
-GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *);
-GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *);
-GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint);
-GLAPI void APIENTRY glWindowPos3ivARB (const GLint *);
-GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glWindowPos3svARB (const GLshort *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v);
-#endif
-
-#ifndef GL_ARB_vertex_program
-#define GL_ARB_vertex_program 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble);
-GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat);
-GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort);
-GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *);
-GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
-GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *);
-GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *);
-GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *);
-GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *);
-GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *);
-GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *);
-GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *);
-GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint);
-GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint);
-GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *);
-GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *);
-GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *);
-GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *);
-GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *);
-GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *);
-GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *);
-GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *);
-GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *);
-GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *);
-GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *);
-GLAPI GLboolean APIENTRY glIsProgramARB (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
-typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
-typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs);
-typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program);
-#endif
-
-#ifndef GL_ARB_fragment_program
-#define GL_ARB_fragment_program 1
-/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */
-#endif
-
-#ifndef GL_ARB_vertex_buffer_object
-#define GL_ARB_vertex_buffer_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *);
-GLAPI GLboolean APIENTRY glIsBufferARB (GLuint);
-GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
-GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *);
-GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *);
-GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum);
-GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum);
-GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
-typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);
-typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);
-typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
-typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
-typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
-typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
-typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params);
-#endif
-
-#ifndef GL_ARB_occlusion_query
-#define GL_ARB_occlusion_query 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *);
-GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *);
-GLAPI GLboolean APIENTRY glIsQueryARB (GLuint);
-GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint);
-GLAPI void APIENTRY glEndQueryARB (GLenum);
-GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids);
-typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params);
-#endif
-
-#ifndef GL_ARB_shader_objects
-#define GL_ARB_shader_objects 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB);
-GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum);
-GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB);
-GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum);
-GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *);
-GLAPI void APIENTRY glCompileShaderARB (GLhandleARB);
-GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void);
-GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB);
-GLAPI void APIENTRY glLinkProgramARB (GLhandleARB);
-GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB);
-GLAPI void APIENTRY glValidateProgramARB (GLhandleARB);
-GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat);
-GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat);
-GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glUniform1iARB (GLint, GLint);
-GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint);
-GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *);
-GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
-GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *);
-GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
-GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *);
-GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *);
-GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
-GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *);
-GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *);
-GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
-typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname);
-typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);
-typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
-typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
-typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
-typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void);
-typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);
-typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);
-typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);
-typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);
-typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);
-typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);
-typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);
-typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);
-typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
-typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
-typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
-typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
-typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params);
-typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
-#endif
-
-#ifndef GL_ARB_vertex_shader
-#define GL_ARB_vertex_shader 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *);
-GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
-GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name);
-typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
-typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
-#endif
-
-#ifndef GL_ARB_fragment_shader
-#define GL_ARB_fragment_shader 1
-#endif
-
-#ifndef GL_ARB_shading_language_100
-#define GL_ARB_shading_language_100 1
-#endif
-
-#ifndef GL_ARB_texture_non_power_of_two
-#define GL_ARB_texture_non_power_of_two 1
-#endif
-
-#ifndef GL_ARB_point_sprite
-#define GL_ARB_point_sprite 1
-#endif
-
-#ifndef GL_ARB_fragment_program_shadow
-#define GL_ARB_fragment_program_shadow 1
-#endif
-
-#ifndef GL_ARB_draw_buffers
-#define GL_ARB_draw_buffers 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs);
-#endif
-
-#ifndef GL_ARB_texture_rectangle
-#define GL_ARB_texture_rectangle 1
-#endif
-
-#ifndef GL_ARB_color_buffer_float
-#define GL_ARB_color_buffer_float 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glClampColorARB (GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
-#endif
-
-#ifndef GL_ARB_half_float_pixel
-#define GL_ARB_half_float_pixel 1
-#endif
-
-#ifndef GL_ARB_texture_float
-#define GL_ARB_texture_float 1
-#endif
-
-#ifndef GL_ARB_pixel_buffer_object
-#define GL_ARB_pixel_buffer_object 1
-#endif
-
-#ifndef GL_EXT_abgr
-#define GL_EXT_abgr 1
-#endif
-
-#ifndef GL_EXT_blend_color
-#define GL_EXT_blend_color 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-#endif
-
-#ifndef GL_EXT_polygon_offset
-#define GL_EXT_polygon_offset 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);
-#endif
-
-#ifndef GL_EXT_texture
-#define GL_EXT_texture 1
-#endif
-
-#ifndef GL_EXT_texture3D
-#define GL_EXT_texture3D 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-#endif
-
-#ifndef GL_SGIS_texture_filter4
-#define GL_SGIS_texture_filter4 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights);
-typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
-#endif
-
-#ifndef GL_EXT_subtexture
-#define GL_EXT_subtexture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-#endif
-
-#ifndef GL_EXT_copy_texture
-#define GL_EXT_copy_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
-GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
-GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei);
-GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
-GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-#endif
-
-#ifndef GL_EXT_histogram
-#define GL_EXT_histogram 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean);
-GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean);
-GLAPI void APIENTRY glResetHistogramEXT (GLenum);
-GLAPI void APIENTRY glResetMinmaxEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink);
-typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target);
-#endif
-
-#ifndef GL_EXT_convolution
-#define GL_EXT_convolution 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint);
-GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei);
-GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
-GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
-GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params);
-typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
-#endif
-
-#ifndef GL_EXT_color_matrix
-#define GL_EXT_color_matrix 1
-#endif
-
-#ifndef GL_SGI_color_table
-#define GL_SGI_color_table 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei);
-GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_SGIX_pixel_texture
-#define GL_SGIX_pixel_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelTexGenSGIX (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);
-#endif
-
-#ifndef GL_SGIS_pixel_texture
-#define GL_SGIS_pixel_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint);
-GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *);
-GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat);
-GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *);
-GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *);
-GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_SGIS_texture4D
-#define GL_SGIS_texture4D 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);
-#endif
-
-#ifndef GL_SGI_texture_color_table
-#define GL_SGI_texture_color_table 1
-#endif
-
-#ifndef GL_EXT_cmyka
-#define GL_EXT_cmyka 1
-#endif
-
-#ifndef GL_EXT_texture_object
-#define GL_EXT_texture_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *);
-GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *);
-GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint);
-GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences);
-typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);
-typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures);
-typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures);
-typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture);
-typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities);
-#endif
-
-#ifndef GL_SGIS_detail_texture
-#define GL_SGIS_detail_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
-typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
-#endif
-
-#ifndef GL_SGIS_sharpen_texture
-#define GL_SGIS_sharpen_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
-typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
-#endif
-
-#ifndef GL_EXT_packed_pixels
-#define GL_EXT_packed_pixels 1
-#endif
-
-#ifndef GL_SGIS_texture_lod
-#define GL_SGIS_texture_lod 1
-#endif
-
-#ifndef GL_SGIS_multisample
-#define GL_SGIS_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean);
-GLAPI void APIENTRY glSamplePatternSGIS (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);
-typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);
-#endif
-
-#ifndef GL_EXT_rescale_normal
-#define GL_EXT_rescale_normal 1
-#endif
-
-#ifndef GL_EXT_vertex_array
-#define GL_EXT_vertex_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glArrayElementEXT (GLint);
-GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei);
-GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *);
-GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *);
-GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i);
-typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer);
-typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params);
-typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-#endif
-
-#ifndef GL_EXT_misc_attribute
-#define GL_EXT_misc_attribute 1
-#endif
-
-#ifndef GL_SGIS_generate_mipmap
-#define GL_SGIS_generate_mipmap 1
-#endif
-
-#ifndef GL_SGIX_clipmap
-#define GL_SGIX_clipmap 1
-#endif
-
-#ifndef GL_SGIX_shadow
-#define GL_SGIX_shadow 1
-#endif
-
-#ifndef GL_SGIS_texture_edge_clamp
-#define GL_SGIS_texture_edge_clamp 1
-#endif
-
-#ifndef GL_SGIS_texture_border_clamp
-#define GL_SGIS_texture_border_clamp 1
-#endif
-
-#ifndef GL_EXT_blend_minmax
-#define GL_EXT_blend_minmax 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);
-#endif
-
-#ifndef GL_EXT_blend_subtract
-#define GL_EXT_blend_subtract 1
-#endif
-
-#ifndef GL_EXT_blend_logic_op
-#define GL_EXT_blend_logic_op 1
-#endif
-
-#ifndef GL_SGIX_interlace
-#define GL_SGIX_interlace 1
-#endif
-
-#ifndef GL_SGIX_pixel_tiles
-#define GL_SGIX_pixel_tiles 1
-#endif
-
-#ifndef GL_SGIX_texture_select
-#define GL_SGIX_texture_select 1
-#endif
-
-#ifndef GL_SGIX_sprite
-#define GL_SGIX_sprite 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat);
-GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *);
-GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint);
-GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params);
-#endif
-
-#ifndef GL_SGIX_texture_multi_buffer
-#define GL_SGIX_texture_multi_buffer 1
-#endif
-
-#ifndef GL_EXT_point_parameters
-#define GL_EXT_point_parameters 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat);
-GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
-#endif
-
-#ifndef GL_SGIS_point_parameters
-#define GL_SGIS_point_parameters 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat);
-GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
-#endif
-
-#ifndef GL_SGIX_instruments
-#define GL_SGIX_instruments 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLint APIENTRY glGetInstrumentsSGIX (void);
-GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *);
-GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *);
-GLAPI void APIENTRY glReadInstrumentsSGIX (GLint);
-GLAPI void APIENTRY glStartInstrumentsSGIX (void);
-GLAPI void APIENTRY glStopInstrumentsSGIX (GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void);
-typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer);
-typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p);
-typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker);
-typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void);
-typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker);
-#endif
-
-#ifndef GL_SGIX_texture_scale_bias
-#define GL_SGIX_texture_scale_bias 1
-#endif
-
-#ifndef GL_SGIX_framezoom
-#define GL_SGIX_framezoom 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFrameZoomSGIX (GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor);
-#endif
-
-#ifndef GL_SGIX_tag_sample_buffer
-#define GL_SGIX_tag_sample_buffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTagSampleBufferSGIX (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);
-#endif
-
-#ifndef GL_SGIX_polynomial_ffd
-#define GL_SGIX_polynomial_ffd 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *);
-GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *);
-GLAPI void APIENTRY glDeformSGIX (GLbitfield);
-GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
-typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
-typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask);
-typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask);
-#endif
-
-#ifndef GL_SGIX_reference_plane
-#define GL_SGIX_reference_plane 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation);
-#endif
-
-#ifndef GL_SGIX_flush_raster
-#define GL_SGIX_flush_raster 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFlushRasterSGIX (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void);
-#endif
-
-#ifndef GL_SGIX_depth_texture
-#define GL_SGIX_depth_texture 1
-#endif
-
-#ifndef GL_SGIS_fog_function
-#define GL_SGIS_fog_function 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *);
-GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points);
-typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points);
-#endif
-
-#ifndef GL_SGIX_fog_offset
-#define GL_SGIX_fog_offset 1
-#endif
-
-#ifndef GL_HP_image_transform
-#define GL_HP_image_transform 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint);
-GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_HP_convolution_border_modes
-#define GL_HP_convolution_border_modes 1
-#endif
-
-#ifndef GL_SGIX_texture_add_env
-#define GL_SGIX_texture_add_env 1
-#endif
-
-#ifndef GL_EXT_color_subtable
-#define GL_EXT_color_subtable 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
-typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-#endif
-
-#ifndef GL_PGI_vertex_hints
-#define GL_PGI_vertex_hints 1
-#endif
-
-#ifndef GL_PGI_misc_hints
-#define GL_PGI_misc_hints 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glHintPGI (GLenum, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode);
-#endif
-
-#ifndef GL_EXT_paletted_texture
-#define GL_EXT_paletted_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
-GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *);
-GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_EXT_clip_volume_hint
-#define GL_EXT_clip_volume_hint 1
-#endif
-
-#ifndef GL_SGIX_list_priority
-#define GL_SGIX_list_priority 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat);
-GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *);
-GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint);
-GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params);
-#endif
-
-#ifndef GL_SGIX_ir_instrument1
-#define GL_SGIX_ir_instrument1 1
-#endif
-
-#ifndef GL_SGIX_calligraphic_fragment
-#define GL_SGIX_calligraphic_fragment 1
-#endif
-
-#ifndef GL_SGIX_texture_lod_bias
-#define GL_SGIX_texture_lod_bias 1
-#endif
-
-#ifndef GL_SGIX_shadow_ambient
-#define GL_SGIX_shadow_ambient 1
-#endif
-
-#ifndef GL_EXT_index_texture
-#define GL_EXT_index_texture 1
-#endif
-
-#ifndef GL_EXT_index_material
-#define GL_EXT_index_material 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);
-#endif
-
-#ifndef GL_EXT_index_func
-#define GL_EXT_index_func 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref);
-#endif
-
-#ifndef GL_EXT_index_array_formats
-#define GL_EXT_index_array_formats 1
-#endif
-
-#ifndef GL_EXT_compiled_vertex_array
-#define GL_EXT_compiled_vertex_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei);
-GLAPI void APIENTRY glUnlockArraysEXT (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void);
-#endif
-
-#ifndef GL_EXT_cull_vertex
-#define GL_EXT_cull_vertex 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *);
-GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_SGIX_ycrcb
-#define GL_SGIX_ycrcb 1
-#endif
-
-#ifndef GL_SGIX_fragment_lighting
-#define GL_SGIX_fragment_lighting 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum);
-GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint);
-GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat);
-GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *);
-GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint);
-GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *);
-GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint);
-GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param);
-#endif
-
-#ifndef GL_IBM_rasterpos_clip
-#define GL_IBM_rasterpos_clip 1
-#endif
-
-#ifndef GL_HP_texture_lighting
-#define GL_HP_texture_lighting 1
-#endif
-
-#ifndef GL_EXT_draw_range_elements
-#define GL_EXT_draw_range_elements 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-#endif
-
-#ifndef GL_WIN_phong_shading
-#define GL_WIN_phong_shading 1
-#endif
-
-#ifndef GL_WIN_specular_fog
-#define GL_WIN_specular_fog 1
-#endif
-
-#ifndef GL_EXT_light_texture
-#define GL_EXT_light_texture 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glApplyTextureEXT (GLenum);
-GLAPI void APIENTRY glTextureLightEXT (GLenum);
-GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);
-typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);
-typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode);
-#endif
-
-#ifndef GL_SGIX_blend_alpha_minmax
-#define GL_SGIX_blend_alpha_minmax 1
-#endif
-
-#ifndef GL_EXT_bgra
-#define GL_EXT_bgra 1
-#endif
-
-#ifndef GL_SGIX_async
-#define GL_SGIX_async 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint);
-GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *);
-GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *);
-GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei);
-GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei);
-GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker);
-typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp);
-typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp);
-typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range);
-typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range);
-typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker);
-#endif
-
-#ifndef GL_SGIX_async_pixel
-#define GL_SGIX_async_pixel 1
-#endif
-
-#ifndef GL_SGIX_async_histogram
-#define GL_SGIX_async_histogram 1
-#endif
-
-#ifndef GL_INTEL_parallel_arrays
-#define GL_INTEL_parallel_arrays 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *);
-GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *);
-GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *);
-GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
-typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer);
-typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
-typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
-#endif
-
-#ifndef GL_HP_occlusion_test
-#define GL_HP_occlusion_test 1
-#endif
-
-#ifndef GL_EXT_pixel_transform
-#define GL_EXT_pixel_transform 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint);
-GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat);
-GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
-#endif
-
-#ifndef GL_EXT_pixel_transform_color_table
-#define GL_EXT_pixel_transform_color_table 1
-#endif
-
-#ifndef GL_EXT_shared_texture_palette
-#define GL_EXT_shared_texture_palette 1
-#endif
-
-#ifndef GL_EXT_separate_specular_color
-#define GL_EXT_separate_specular_color 1
-#endif
-
-#ifndef GL_EXT_secondary_color
-#define GL_EXT_secondary_color 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte);
-GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *);
-GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *);
-GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *);
-GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint);
-GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *);
-GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *);
-GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte);
-GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *);
-GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *);
-GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort);
-GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *);
-GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_EXT_texture_perturb_normal
-#define GL_EXT_texture_perturb_normal 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTextureNormalEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode);
-#endif
-
-#ifndef GL_EXT_multi_draw_arrays
-#define GL_EXT_multi_draw_arrays 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei);
-GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
-#endif
-
-#ifndef GL_EXT_fog_coord
-#define GL_EXT_fog_coord 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFogCoordfEXT (GLfloat);
-GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *);
-GLAPI void APIENTRY glFogCoorddEXT (GLdouble);
-GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *);
-GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
-typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord);
-typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);
-typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_REND_screen_coordinates
-#define GL_REND_screen_coordinates 1
-#endif
-
-#ifndef GL_EXT_coordinate_frame
-#define GL_EXT_coordinate_frame 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte);
-GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *);
-GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *);
-GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *);
-GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint);
-GLAPI void APIENTRY glTangent3ivEXT (const GLint *);
-GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glTangent3svEXT (const GLshort *);
-GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte);
-GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *);
-GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *);
-GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *);
-GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint);
-GLAPI void APIENTRY glBinormal3ivEXT (const GLint *);
-GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glBinormal3svEXT (const GLshort *);
-GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz);
-typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz);
-typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz);
-typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz);
-typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz);
-typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz);
-typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v);
-typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz);
-typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz);
-typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz);
-typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz);
-typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_EXT_texture_env_combine
-#define GL_EXT_texture_env_combine 1
-#endif
-
-#ifndef GL_APPLE_specular_vector
-#define GL_APPLE_specular_vector 1
-#endif
-
-#ifndef GL_APPLE_transform_hint
-#define GL_APPLE_transform_hint 1
-#endif
-
-#ifndef GL_SGIX_fog_scale
-#define GL_SGIX_fog_scale 1
-#endif
-
-#ifndef GL_SUNX_constant_data
-#define GL_SUNX_constant_data 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFinishTextureSUNX (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void);
-#endif
-
-#ifndef GL_SUN_global_alpha
-#define GL_SUN_global_alpha 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte);
-GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort);
-GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint);
-GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat);
-GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble);
-GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte);
-GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort);
-GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor);
-typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor);
-#endif
-
-#ifndef GL_SUN_triangle_list
-#define GL_SUN_triangle_list 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint);
-GLAPI void APIENTRY glReplacementCodeusSUN (GLushort);
-GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte);
-GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *);
-GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *);
-GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *);
-GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer);
-#endif
-
-#ifndef GL_SUN_vertex
-#define GL_SUN_vertex 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat);
-GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *);
-GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *);
-GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *);
-GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-#endif
-
-#ifndef GL_EXT_blend_func_separate
-#define GL_EXT_blend_func_separate 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-#endif
-
-#ifndef GL_INGR_blend_func_separate
-#define GL_INGR_blend_func_separate 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-#endif
-
-#ifndef GL_INGR_color_clamp
-#define GL_INGR_color_clamp 1
-#endif
-
-#ifndef GL_INGR_interlace_read
-#define GL_INGR_interlace_read 1
-#endif
-
-#ifndef GL_EXT_stencil_wrap
-#define GL_EXT_stencil_wrap 1
-#endif
-
-#ifndef GL_EXT_422_pixels
-#define GL_EXT_422_pixels 1
-#endif
-
-#ifndef GL_NV_texgen_reflection
-#define GL_NV_texgen_reflection 1
-#endif
-
-#ifndef GL_SUN_convolution_border_modes
-#define GL_SUN_convolution_border_modes 1
-#endif
-
-#ifndef GL_EXT_texture_env_add
-#define GL_EXT_texture_env_add 1
-#endif
-
-#ifndef GL_EXT_texture_lod_bias
-#define GL_EXT_texture_lod_bias 1
-#endif
-
-#ifndef GL_EXT_texture_filter_anisotropic
-#define GL_EXT_texture_filter_anisotropic 1
-#endif
-
-#ifndef GL_EXT_vertex_weighting
-#define GL_EXT_vertex_weighting 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexWeightfEXT (GLfloat);
-GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *);
-GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer);
-#endif
-
-#ifndef GL_NV_light_max_exponent
-#define GL_NV_light_max_exponent 1
-#endif
-
-#ifndef GL_NV_vertex_array_range
-#define GL_NV_vertex_array_range 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glFlushVertexArrayRangeNV (void);
-GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);
-typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer);
-#endif
-
-#ifndef GL_NV_register_combiners
-#define GL_NV_register_combiners 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *);
-GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat);
-GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *);
-GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint);
-GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean);
-GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
-typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_NV_fog_distance
-#define GL_NV_fog_distance 1
-#endif
-
-#ifndef GL_NV_texgen_emboss
-#define GL_NV_texgen_emboss 1
-#endif
-
-#ifndef GL_NV_blend_square
-#define GL_NV_blend_square 1
-#endif
-
-#ifndef GL_NV_texture_env_combine4
-#define GL_NV_texture_env_combine4 1
-#endif
-
-#ifndef GL_MESA_resize_buffers
-#define GL_MESA_resize_buffers 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glResizeBuffersMESA (void);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void);
-#endif
-
-#ifndef GL_MESA_window_pos
-#define GL_MESA_window_pos 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble);
-GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *);
-GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat);
-GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *);
-GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint);
-GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *);
-GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort);
-GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *);
-GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *);
-GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *);
-GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint);
-GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *);
-GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *);
-GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *);
-GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *);
-GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *);
-GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v);
-typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v);
-#endif
-
-#ifndef GL_IBM_cull_vertex
-#define GL_IBM_cull_vertex 1
-#endif
-
-#ifndef GL_IBM_multimode_draw_arrays
-#define GL_IBM_multimode_draw_arrays 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint);
-GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
-typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);
-#endif
-
-#ifndef GL_IBM_vertex_array_lists
-#define GL_IBM_vertex_array_lists 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
-GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
-GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint);
-GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
-GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
-GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
-GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
-GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
-#endif
-
-#ifndef GL_SGIX_subsample
-#define GL_SGIX_subsample 1
-#endif
-
-#ifndef GL_SGIX_ycrcba
-#define GL_SGIX_ycrcba 1
-#endif
-
-#ifndef GL_SGIX_ycrcb_subsample
-#define GL_SGIX_ycrcb_subsample 1
-#endif
-
-#ifndef GL_SGIX_depth_pass_instrument
-#define GL_SGIX_depth_pass_instrument 1
-#endif
-
-#ifndef GL_3DFX_texture_compression_FXT1
-#define GL_3DFX_texture_compression_FXT1 1
-#endif
-
-#ifndef GL_3DFX_multisample
-#define GL_3DFX_multisample 1
-#endif
-
-#ifndef GL_3DFX_tbuffer
-#define GL_3DFX_tbuffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTbufferMask3DFX (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);
-#endif
-
-#ifndef GL_EXT_multisample
-#define GL_EXT_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean);
-GLAPI void APIENTRY glSamplePatternEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);
-typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);
-#endif
-
-#ifndef GL_SGIX_vertex_preclip
-#define GL_SGIX_vertex_preclip 1
-#endif
-
-#ifndef GL_SGIX_convolution_accuracy
-#define GL_SGIX_convolution_accuracy 1
-#endif
-
-#ifndef GL_SGIX_resample
-#define GL_SGIX_resample 1
-#endif
-
-#ifndef GL_SGIS_point_line_texgen
-#define GL_SGIS_point_line_texgen 1
-#endif
-
-#ifndef GL_SGIS_texture_color_mask
-#define GL_SGIS_texture_color_mask 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-#endif
-
-#ifndef GL_SGIX_igloo_interface
-#define GL_SGIX_igloo_interface 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params);
-#endif
-
-#ifndef GL_EXT_texture_env_dot3
-#define GL_EXT_texture_env_dot3 1
-#endif
-
-#ifndef GL_ATI_texture_mirror_once
-#define GL_ATI_texture_mirror_once 1
-#endif
-
-#ifndef GL_NV_fence
-#define GL_NV_fence 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *);
-GLAPI GLboolean APIENTRY glIsFenceNV (GLuint);
-GLAPI GLboolean APIENTRY glTestFenceNV (GLuint);
-GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glFinishFenceNV (GLuint);
-GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
-typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
-typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
-typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
-typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
-#endif
-
-#ifndef GL_NV_evaluators
-#define GL_NV_evaluators 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *);
-GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *);
-GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *);
-GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);
-typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);
-typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode);
-#endif
-
-#ifndef GL_NV_packed_depth_stencil
-#define GL_NV_packed_depth_stencil 1
-#endif
-
-#ifndef GL_NV_register_combiners2
-#define GL_NV_register_combiners2 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *);
-GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params);
-#endif
-
-#ifndef GL_NV_texture_compression_vtc
-#define GL_NV_texture_compression_vtc 1
-#endif
-
-#ifndef GL_NV_texture_rectangle
-#define GL_NV_texture_rectangle 1
-#endif
-
-#ifndef GL_NV_texture_shader
-#define GL_NV_texture_shader 1
-#endif
-
-#ifndef GL_NV_texture_shader2
-#define GL_NV_texture_shader2 1
-#endif
-
-#ifndef GL_NV_vertex_array_range2
-#define GL_NV_vertex_array_range2 1
-#endif
-
-#ifndef GL_NV_vertex_program
-#define GL_NV_vertex_program 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *);
-GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *);
-GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *);
-GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *);
-GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *);
-GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *);
-GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *);
-GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *);
-GLAPI GLboolean APIENTRY glIsProgramNV (GLuint);
-GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *);
-GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *);
-GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *);
-GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *);
-GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *);
-GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *);
-GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum);
-GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *);
-GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble);
-GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat);
-GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort);
-GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *);
-GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
-GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *);
-GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *);
-GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *);
-GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *);
-GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *);
-GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *);
-GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *);
-GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *);
-GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *);
-GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *);
-GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences);
-typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
-typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
-typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params);
-typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs);
-typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program);
-typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
-typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
-typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v);
-#endif
-
-#ifndef GL_SGIX_texture_coordinate_clamp
-#define GL_SGIX_texture_coordinate_clamp 1
-#endif
-
-#ifndef GL_SGIX_scalebias_hint
-#define GL_SGIX_scalebias_hint 1
-#endif
-
-#ifndef GL_OML_interlace
-#define GL_OML_interlace 1
-#endif
-
-#ifndef GL_OML_subsample
-#define GL_OML_subsample 1
-#endif
-
-#ifndef GL_OML_resample
-#define GL_OML_resample 1
-#endif
-
-#ifndef GL_NV_copy_depth_to_color
-#define GL_NV_copy_depth_to_color 1
-#endif
-
-#ifndef GL_ATI_envmap_bumpmap
-#define GL_ATI_envmap_bumpmap 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *);
-GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *);
-GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *);
-GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param);
-typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param);
-typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);
-typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);
-#endif
-
-#ifndef GL_ATI_fragment_shader
-#define GL_ATI_fragment_shader 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint);
-GLAPI void APIENTRY glBindFragmentShaderATI (GLuint);
-GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint);
-GLAPI void APIENTRY glBeginFragmentShaderATI (void);
-GLAPI void APIENTRY glEndFragmentShaderATI (void);
-GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum);
-GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum);
-GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);
-typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void);
-typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void);
-typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle);
-typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle);
-typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value);
-#endif
-
-#ifndef GL_ATI_pn_triangles
-#define GL_ATI_pn_triangles 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint);
-GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);
-#endif
-
-#ifndef GL_ATI_vertex_array_object
-#define GL_ATI_vertex_array_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum);
-GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint);
-GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum);
-GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glFreeObjectBufferATI (GLuint);
-GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint);
-GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint);
-GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage);
-typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);
-typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_EXT_vertex_shader
-#define GL_EXT_vertex_shader 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBeginVertexShaderEXT (void);
-GLAPI void APIENTRY glEndVertexShaderEXT (void);
-GLAPI void APIENTRY glBindVertexShaderEXT (GLuint);
-GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint);
-GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint);
-GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint);
-GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint);
-GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint);
-GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint);
-GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *);
-GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *);
-GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *);
-GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *);
-GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *);
-GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *);
-GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *);
-GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *);
-GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *);
-GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *);
-GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *);
-GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint);
-GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint);
-GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum);
-GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum);
-GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum);
-GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum);
-GLAPI GLuint APIENTRY glBindParameterEXT (GLenum);
-GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum);
-GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *);
-GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *);
-GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *);
-GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *);
-GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void);
-typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void);
-typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id);
-typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range);
-typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1);
-typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
-typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
-typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
-typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
-typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
-typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
-typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
-typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr);
-typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr);
-typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr);
-typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr);
-typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr);
-typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr);
-typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr);
-typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr);
-typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr);
-typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
-typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value);
-typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value);
-typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap);
-typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data);
-typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-#endif
-
-#ifndef GL_ATI_vertex_streams
-#define GL_ATI_vertex_streams 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort);
-GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *);
-GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint);
-GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *);
-GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat);
-GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *);
-GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble);
-GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *);
-GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort);
-GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *);
-GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint);
-GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *);
-GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *);
-GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *);
-GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *);
-GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint);
-GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *);
-GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *);
-GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *);
-GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *);
-GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint);
-GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *);
-GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *);
-GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *);
-GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte);
-GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *);
-GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort);
-GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *);
-GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint);
-GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *);
-GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *);
-GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *);
-GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum);
-GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint);
-GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
-typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream);
-typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param);
-#endif
-
-#ifndef GL_ATI_element_array
-#define GL_ATI_element_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *);
-GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei);
-GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count);
-#endif
-
-#ifndef GL_SUN_mesh_array
-#define GL_SUN_mesh_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width);
-#endif
-
-#ifndef GL_SUN_slice_accum
-#define GL_SUN_slice_accum 1
-#endif
-
-#ifndef GL_NV_multisample_filter_hint
-#define GL_NV_multisample_filter_hint 1
-#endif
-
-#ifndef GL_NV_depth_clamp
-#define GL_NV_depth_clamp 1
-#endif
-
-#ifndef GL_NV_occlusion_query
-#define GL_NV_occlusion_query 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *);
-GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *);
-GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint);
-GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint);
-GLAPI void APIENTRY glEndOcclusionQueryNV (void);
-GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *);
-GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);
-typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);
-typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
-typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void);
-typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params);
-#endif
-
-#ifndef GL_NV_point_sprite
-#define GL_NV_point_sprite 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint);
-GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);
-typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
-#endif
-
-#ifndef GL_NV_texture_shader3
-#define GL_NV_texture_shader3 1
-#endif
-
-#ifndef GL_NV_vertex_program1_1
-#define GL_NV_vertex_program1_1 1
-#endif
-
-#ifndef GL_EXT_shadow_funcs
-#define GL_EXT_shadow_funcs 1
-#endif
-
-#ifndef GL_EXT_stencil_two_side
-#define GL_EXT_stencil_two_side 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
-#endif
-
-#ifndef GL_ATI_text_fragment_shader
-#define GL_ATI_text_fragment_shader 1
-#endif
-
-#ifndef GL_APPLE_client_storage
-#define GL_APPLE_client_storage 1
-#endif
-
-#ifndef GL_APPLE_element_array
-#define GL_APPLE_element_array 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *);
-GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei);
-GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei);
-GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei);
-GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer);
-typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
-typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
-#endif
-
-#ifndef GL_APPLE_fence
-#define GL_APPLE_fence 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *);
-GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *);
-GLAPI void APIENTRY glSetFenceAPPLE (GLuint);
-GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint);
-GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint);
-GLAPI void APIENTRY glFinishFenceAPPLE (GLuint);
-GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint);
-GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences);
-typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences);
-typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence);
-typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name);
-typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name);
-#endif
-
-#ifndef GL_APPLE_vertex_array_object
-#define GL_APPLE_vertex_array_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint);
-GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, const GLuint *);
-GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
-typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
-typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
-typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
-#endif
-
-#ifndef GL_APPLE_vertex_array_range
-#define GL_APPLE_vertex_array_range 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *);
-GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *);
-GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
-typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
-typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param);
-#endif
-
-#ifndef GL_APPLE_ycbcr_422
-#define GL_APPLE_ycbcr_422 1
-#endif
-
-#ifndef GL_S3_s3tc
-#define GL_S3_s3tc 1
-#endif
-
-#ifndef GL_ATI_draw_buffers
-#define GL_ATI_draw_buffers 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs);
-#endif
-
-#ifndef GL_ATI_pixel_format_float
-#define GL_ATI_pixel_format_float 1
-/* This is really a WGL extension, but defines some associated GL enums.
- * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string.
- */
-#endif
-
-#ifndef GL_ATI_texture_env_combine3
-#define GL_ATI_texture_env_combine3 1
-#endif
-
-#ifndef GL_ATI_texture_float
-#define GL_ATI_texture_float 1
-#endif
-
-#ifndef GL_NV_float_buffer
-#define GL_NV_float_buffer 1
-#endif
-
-#ifndef GL_NV_fragment_program
-#define GL_NV_fragment_program 1
-/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat);
-GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble);
-GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *);
-GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *);
-GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *);
-GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
-typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
-typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
-#endif
-
-#ifndef GL_NV_half_float
-#define GL_NV_half_float 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV);
-GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV);
-GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *);
-GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *);
-GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *);
-GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *);
-GLAPI void APIENTRY glFogCoordhNV (GLhalfNV);
-GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *);
-GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *);
-GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV);
-GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV);
-GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
-GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *);
-GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y);
-typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z);
-typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
-typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
-typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
-typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
-typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s);
-typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t);
-typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r);
-typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
-typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
-typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog);
-typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
-typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight);
-typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
-typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
-#endif
-
-#ifndef GL_NV_pixel_data_range
-#define GL_NV_pixel_data_range 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *);
-GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer);
-typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target);
-#endif
-
-#ifndef GL_NV_primitive_restart
-#define GL_NV_primitive_restart 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glPrimitiveRestartNV (void);
-GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void);
-typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);
-#endif
-
-#ifndef GL_NV_texture_expand_normal
-#define GL_NV_texture_expand_normal 1
-#endif
-
-#ifndef GL_NV_vertex_program2
-#define GL_NV_vertex_program2 1
-#endif
-
-#ifndef GL_ATI_map_object_buffer
-#define GL_ATI_map_object_buffer 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint);
-GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);
-#endif
-
-#ifndef GL_ATI_separate_stencil
-#define GL_ATI_separate_stencil 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum);
-GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
-#endif
-
-#ifndef GL_ATI_vertex_attrib_array_object
-#define GL_ATI_vertex_attrib_array_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint);
-GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *);
-GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params);
-typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params);
-#endif
-
-#ifndef GL_OES_read_format
-#define GL_OES_read_format 1
-#endif
-
-#ifndef GL_EXT_depth_bounds_test
-#define GL_EXT_depth_bounds_test 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax);
-#endif
-
-#ifndef GL_EXT_texture_mirror_clamp
-#define GL_EXT_texture_mirror_clamp 1
-#endif
-
-#ifndef GL_EXT_blend_equation_separate
-#define GL_EXT_blend_equation_separate 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha);
-#endif
-
-#ifndef GL_MESA_pack_invert
-#define GL_MESA_pack_invert 1
-#endif
-
-#ifndef GL_MESA_ycbcr_texture
-#define GL_MESA_ycbcr_texture 1
-#endif
-
-#ifndef GL_EXT_pixel_buffer_object
-#define GL_EXT_pixel_buffer_object 1
-#endif
-
-#ifndef GL_NV_fragment_program_option
-#define GL_NV_fragment_program_option 1
-#endif
-
-#ifndef GL_NV_fragment_program2
-#define GL_NV_fragment_program2 1
-#endif
-
-#ifndef GL_NV_vertex_program2_option
-#define GL_NV_vertex_program2_option 1
-#endif
-
-#ifndef GL_NV_vertex_program3
-#define GL_NV_vertex_program3 1
-#endif
-
-#ifndef GL_EXT_framebuffer_object
-#define GL_EXT_framebuffer_object 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint);
-GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *);
-GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei);
-GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *);
-GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint);
-GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint);
-GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *);
-GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *);
-GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum);
-GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
-GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
-GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint);
-GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint);
-GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *);
-GLAPI void APIENTRY glGenerateMipmapEXT (GLenum);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
-typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
-typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
-typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
-typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
-typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
-typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
-typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
-#endif
-
-#ifndef GL_GREMEDY_string_marker
-#define GL_GREMEDY_string_marker 1
-#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *);
-#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string);
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-#endif /* NO_SDL_GLEXT */
diff --git a/distrib/sdl-1.2.12/include/SDL_platform.h b/distrib/sdl-1.2.12/include/SDL_platform.h
deleted file mode 100644
index 1bfee29..0000000
--- a/distrib/sdl-1.2.12/include/SDL_platform.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* Try to get a standard set of platform defines */
-
-#ifndef _SDL_platform_h
-#define _SDL_platform_h
-
-#if defined(_AIX)
-#undef __AIX__
-#define __AIX__ 1
-#endif
-#if defined(__BEOS__)
-#undef __BEOS__
-#define __BEOS__ 1
-#endif
-#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
-#undef __BSDI__
-#define __BSDI__ 1
-#endif
-#if defined(_arch_dreamcast)
-#undef __DREAMCAST__
-#define __DREAMCAST__ 1
-#endif
-#if defined(__FreeBSD__) || defined(__DragonFly__)
-#undef __FREEBSD__
-#define __FREEBSD__ 1
-#endif
-#if defined(hpux) || defined(__hpux) || defined(__hpux__)
-#undef __HPUX__
-#define __HPUX__ 1
-#endif
-#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
-#undef __IRIX__
-#define __IRIX__ 1
-#endif
-#if defined(linux) || defined(__linux) || defined(__linux__)
-#undef __LINUX__
-#define __LINUX__ 1
-#endif
-#if defined(__APPLE__)
-#undef __MACOSX__
-#define __MACOSX__ 1
-#elif defined(macintosh)
-#undef __MACOS__
-#define __MACOS__ 1
-#endif
-#if defined(__NetBSD__)
-#undef __NETBSD__
-#define __NETBSD__ 1
-#endif
-#if defined(__OpenBSD__)
-#undef __OPENBSD__
-#define __OPENBSD__ 1
-#endif
-#if defined(__OS2__)
-#undef __OS2__
-#define __OS2__ 1
-#endif
-#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
-#undef __OSF__
-#define __OSF__ 1
-#endif
-#if defined(__QNXNTO__)
-#undef __QNXNTO__
-#define __QNXNTO__ 1
-#endif
-#if defined(riscos) || defined(__riscos) || defined(__riscos__)
-#undef __RISCOS__
-#define __RISCOS__ 1
-#endif
-#if defined(__SVR4)
-#undef __SOLARIS__
-#define __SOLARIS__ 1
-#endif
-#if defined(WIN32) || defined(_WIN32)
-#undef __WIN32__
-#define __WIN32__ 1
-#endif
-
-#endif /* _SDL_platform_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_quit.h b/distrib/sdl-1.2.12/include/SDL_quit.h
deleted file mode 100644
index fcf40fb..0000000
--- a/distrib/sdl-1.2.12/include/SDL_quit.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* Include file for SDL quit event handling */
-
-#ifndef _SDL_quit_h
-#define _SDL_quit_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-
-/*
- An SDL_QUITEVENT 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
- complete, but have no effect.
-
- SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
- and SIGTERM (system termination request), if handlers do not already
- exist, that generate SDL_QUITEVENT events as well. There is no way
- to determine the cause of an SDL_QUITEVENT, but setting a signal
- handler in your application will override the default generation of
- quit events for that signal.
-*/
-
-/* There are no functions directly affecting the quit event */
-#define SDL_QuitRequested() \
- (SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK))
-
-#endif /* _SDL_quit_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_rwops.h b/distrib/sdl-1.2.12/include/SDL_rwops.h
deleted file mode 100644
index 8c17701..0000000
--- a/distrib/sdl-1.2.12/include/SDL_rwops.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* This file provides a general interface for SDL to read and write
- data sources. It can easily be extended to files, memory, etc.
-*/
-
-#ifndef _SDL_rwops_h
-#define _SDL_rwops_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* This is the read/write operation structure -- very basic */
-
-typedef struct SDL_RWops {
- /* Seek to 'offset' relative to whence, one of stdio's whence values:
- SEEK_SET, SEEK_CUR, SEEK_END
- Returns the final offset in the data source.
- */
- int (SDLCALL *seek)(struct SDL_RWops *context, int offset, int whence);
-
- /* Read up to 'num' objects each of size 'objsize' from the data
- source to the area pointed at by 'ptr'.
- Returns the number of objects read, or -1 if the read failed.
- */
- int (SDLCALL *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum);
-
- /* Write exactly 'num' objects each of size 'objsize' from the area
- pointed at by 'ptr' to data source.
- Returns 'num', or -1 if the write failed.
- */
- int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int size, int num);
-
- /* Close and free an allocated SDL_FSops structure */
- int (SDLCALL *close)(struct SDL_RWops *context);
-
- Uint32 type;
- union {
-#if defined(__WIN32__) && !defined(__SYMBIAN32__)
- struct {
- int append;
- void *h;
- struct {
- void *data;
- int size;
- int left;
- } buffer;
- } win32io;
-#endif
-#ifdef HAVE_STDIO_H
- struct {
- int autoclose;
- FILE *fp;
- } stdio;
-#endif
- struct {
- Uint8 *base;
- Uint8 *here;
- Uint8 *stop;
- } mem;
- struct {
- void *data1;
- } unknown;
- } hidden;
-
-} SDL_RWops;
-
-
-/* Functions to create SDL_RWops structures from various data sources */
-
-extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFile(const char *file, const char *mode);
-
-#ifdef HAVE_STDIO_H
-extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFP(FILE *fp, int autoclose);
-#endif
-
-extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromMem(void *mem, int size);
-extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromConstMem(const void *mem, int size);
-
-extern DECLSPEC SDL_RWops * SDLCALL SDL_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 */
-
-/* Macros to easily read and write from an SDL_RWops structure */
-#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence)
-#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR)
-#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n)
-#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n)
-#define SDL_RWclose(ctx) (ctx)->close(ctx)
-
-
-/* Read an item of the specified endianness and return in native format */
-extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops *src);
-extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops *src);
-extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops *src);
-extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops *src);
-extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops *src);
-extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops *src);
-
-/* Write an item of native format to the specified endianness */
-extern DECLSPEC int SDLCALL SDL_WriteLE16(SDL_RWops *dst, Uint16 value);
-extern DECLSPEC int SDLCALL SDL_WriteBE16(SDL_RWops *dst, Uint16 value);
-extern DECLSPEC int SDLCALL SDL_WriteLE32(SDL_RWops *dst, Uint32 value);
-extern DECLSPEC int SDLCALL SDL_WriteBE32(SDL_RWops *dst, Uint32 value);
-extern DECLSPEC int SDLCALL SDL_WriteLE64(SDL_RWops *dst, Uint64 value);
-extern DECLSPEC int SDLCALL SDL_WriteBE64(SDL_RWops *dst, Uint64 value);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_rwops_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_stdinc.h b/distrib/sdl-1.2.12/include/SDL_stdinc.h
deleted file mode 100644
index 891a9ac..0000000
--- a/distrib/sdl-1.2.12/include/SDL_stdinc.h
+++ /dev/null
@@ -1,594 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* This is a general header that includes C language support */
-
-#ifndef _SDL_stdinc_h
-#define _SDL_stdinc_h
-
-#include "SDL_config.h"
-
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_STDIO_H
-#include <stdio.h>
-#endif
-#if defined(STDC_HEADERS)
-# include <stdlib.h>
-# include <stddef.h>
-# include <stdarg.h>
-#else
-# if defined(HAVE_STDLIB_H)
-# include <stdlib.h>
-# elif defined(HAVE_MALLOC_H)
-# include <malloc.h>
-# endif
-# if defined(HAVE_STDDEF_H)
-# include <stddef.h>
-# endif
-# if defined(HAVE_STDARG_H)
-# include <stdarg.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#if defined(HAVE_INTTYPES_H)
-# include <inttypes.h>
-#elif defined(HAVE_STDINT_H)
-# include <stdint.h>
-#endif
-#ifdef HAVE_CTYPE_H
-# include <ctype.h>
-#endif
-#ifdef HAVE_ICONV_H
-# include <iconv.h>
-#endif
-
-/* The number of elements in an array */
-#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
-#define SDL_TABLESIZE(table) SDL_arraysize(table)
-
-/* Basic data types */
-typedef enum SDL_bool {
- SDL_FALSE = 0,
- SDL_TRUE = 1
-} SDL_bool;
-
-typedef int8_t Sint8;
-typedef uint8_t Uint8;
-typedef int16_t Sint16;
-typedef uint16_t Uint16;
-typedef int32_t Sint32;
-typedef uint32_t Uint32;
-
-#ifdef SDL_HAS_64BIT_TYPE
-typedef int64_t Sint64;
-#ifndef SYMBIAN32_GCCE
-typedef uint64_t Uint64;
-#endif
-#else
-/* This is really just a hack to prevent the compiler from complaining */
-typedef struct {
- Uint32 hi;
- Uint32 lo;
-} Uint64, Sint64;
-#endif
-
-/* Make sure the types really have the right sizes */
-#define SDL_COMPILE_TIME_ASSERT(name, x) \
- typedef int SDL_dummy_ ## name[(x) * 2 - 1]
-
-SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);
-SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1);
-SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2);
-SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2);
-SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4);
-SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4);
-SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
-SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
-
-/* Check to make sure enums are the size of ints, for structure packing.
- For both Watcom C/C++ and Borland C/C++ the compiler option that makes
- enums having the size of an int must be enabled.
- This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11).
-*/
-/* Enable enums always int in CodeWarrior (for MPW use "-enum int") */
-#ifdef __MWERKS__
-#pragma enumsalwaysint on
-#endif
-
-typedef enum {
- DUMMY_ENUM_VALUE
-} SDL_DUMMY_ENUM;
-
-#ifndef __NDS__
-SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
-#endif
-
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef HAVE_MALLOC
-#define SDL_malloc malloc
-#else
-extern DECLSPEC void * SDLCALL SDL_malloc(size_t size);
-#endif
-
-#ifdef HAVE_CALLOC
-#define SDL_calloc calloc
-#else
-extern DECLSPEC void * SDLCALL SDL_calloc(size_t nmemb, size_t size);
-#endif
-
-#ifdef HAVE_REALLOC
-#define SDL_realloc realloc
-#else
-extern DECLSPEC void * SDLCALL SDL_realloc(void *mem, size_t size);
-#endif
-
-#ifdef HAVE_FREE
-#define SDL_free free
-#else
-extern DECLSPEC void SDLCALL SDL_free(void *mem);
-#endif
-
-#if defined(HAVE_ALLOCA) && !defined(alloca)
-# if defined(HAVE_ALLOCA_H)
-# include <alloca.h>
-# elif defined(__GNUC__)
-# define alloca __builtin_alloca
-# elif defined(_MSC_VER)
-# include <malloc.h>
-# define alloca _alloca
-# elif defined(__WATCOMC__)
-# include <malloc.h>
-# elif defined(__DMC__)
-# include <stdlib.h>
-# elif defined(__AIX__)
- #pragma alloca
-# elif defined(__MRC__)
- void *alloca (unsigned);
-# else
- char *alloca ();
-# endif
-#endif
-#ifdef HAVE_ALLOCA
-#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count))
-#define SDL_stack_free(data)
-#else
-#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count))
-#define SDL_stack_free(data) SDL_free(data)
-#endif
-
-#ifdef HAVE_GETENV
-#define SDL_getenv getenv
-#else
-extern DECLSPEC char * SDLCALL SDL_getenv(const char *name);
-#endif
-
-#ifdef HAVE_PUTENV
-#define SDL_putenv putenv
-#else
-extern DECLSPEC int SDLCALL SDL_putenv(const char *variable);
-#endif
-
-#ifdef HAVE_QSORT
-#define SDL_qsort qsort
-#else
-extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size,
- int (*compare)(const void *, const void *));
-#endif
-
-#ifdef HAVE_ABS
-#define SDL_abs abs
-#else
-#define SDL_abs(X) ((X) < 0 ? -(X) : (X))
-#endif
-
-#define SDL_min(x, y) (((x) < (y)) ? (x) : (y))
-#define SDL_max(x, y) (((x) > (y)) ? (x) : (y))
-
-#ifdef HAVE_CTYPE_H
-#define SDL_isdigit(X) isdigit(X)
-#define SDL_isspace(X) isspace(X)
-#define SDL_toupper(X) toupper(X)
-#define SDL_tolower(X) tolower(X)
-#else
-#define SDL_isdigit(X) (((X) >= '0') && ((X) <= '9'))
-#define SDL_isspace(X) (((X) == ' ') || ((X) == '\t') || ((X) == '\r') || ((X) == '\n'))
-#define SDL_toupper(X) (((X) >= 'a') && ((X) <= 'z') ? ('A'+((X)-'a')) : (X))
-#define SDL_tolower(X) (((X) >= 'A') && ((X) <= 'Z') ? ('a'+((X)-'A')) : (X))
-#endif
-
-#ifdef HAVE_MEMSET
-#define SDL_memset memset
-#else
-extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len);
-#endif
-
-#if defined(__GNUC__) && defined(i386)
-#define SDL_memset4(dst, val, len) \
-do { \
- int u0, u1, u2; \
- __asm__ __volatile__ ( \
- "cld\n\t" \
- "rep ; stosl\n\t" \
- : "=&D" (u0), "=&a" (u1), "=&c" (u2) \
- : "0" (dst), "1" (val), "2" ((Uint32)(len)) \
- : "memory" ); \
-} while(0)
-#endif
-#ifndef SDL_memset4
-#define SDL_memset4(dst, val, len) \
-do { \
- unsigned _count = (len); \
- unsigned _n = (_count + 3) / 4; \
- Uint32 *_p = (Uint32 *)(dst); \
- Uint32 _val = (val); \
- switch (_count % 4) { \
- case 0: do { *_p++ = _val; \
- case 3: *_p++ = _val; \
- case 2: *_p++ = _val; \
- case 1: *_p++ = _val; \
- } while ( --_n ); \
- } \
-} while(0)
-#endif
-
-/* We can count on memcpy existing on Mac OS X and being well-tuned. */
-#if defined(__MACH__) && defined(__APPLE__)
-#define SDL_memcpy(dst, src, len) memcpy(dst, src, len)
-#elif defined(__GNUC__) && defined(i386)
-#define SDL_memcpy(dst, src, len) \
-do { \
- int u0, u1, u2; \
- __asm__ __volatile__ ( \
- "cld\n\t" \
- "rep ; movsl\n\t" \
- "testb $2,%b4\n\t" \
- "je 1f\n\t" \
- "movsw\n" \
- "1:\ttestb $1,%b4\n\t" \
- "je 2f\n\t" \
- "movsb\n" \
- "2:" \
- : "=&c" (u0), "=&D" (u1), "=&S" (u2) \
- : "0" ((unsigned)(len)/4), "q" (len), "1" (dst),"2" (src) \
- : "memory" ); \
-} while(0)
-#endif
-#ifndef SDL_memcpy
-#ifdef HAVE_MEMCPY
-#define SDL_memcpy memcpy
-#elif defined(HAVE_BCOPY)
-#define SDL_memcpy(d, s, n) bcopy((s), (d), (n))
-#else
-extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len);
-#endif
-#endif
-
-/* We can count on memcpy existing on Mac OS X and being well-tuned. */
-#if defined(__MACH__) && defined(__APPLE__)
-#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4)
-#elif defined(__GNUC__) && defined(i386)
-#define SDL_memcpy4(dst, src, len) \
-do { \
- int ecx, edi, esi; \
- __asm__ __volatile__ ( \
- "cld\n\t" \
- "rep ; movsl" \
- : "=&c" (ecx), "=&D" (edi), "=&S" (esi) \
- : "0" ((unsigned)(len)), "1" (dst), "2" (src) \
- : "memory" ); \
-} while(0)
-#endif
-#ifndef SDL_memcpy4
-#define SDL_memcpy4(dst, src, len) SDL_memcpy(dst, src, (len) << 2)
-#endif
-
-#if defined(__GNUC__) && defined(i386)
-#define SDL_revcpy(dst, src, len) \
-do { \
- int u0, u1, u2; \
- char *dstp = (char *)(dst); \
- char *srcp = (char *)(src); \
- int n = (len); \
- if ( n >= 4 ) { \
- __asm__ __volatile__ ( \
- "std\n\t" \
- "rep ; movsl\n\t" \
- : "=&c" (u0), "=&D" (u1), "=&S" (u2) \
- : "0" (n >> 2), \
- "1" (dstp+(n-4)), "2" (srcp+(n-4)) \
- : "memory" ); \
- } \
- switch (n & 3) { \
- case 3: dstp[2] = srcp[2]; \
- case 2: dstp[1] = srcp[1]; \
- case 1: dstp[0] = srcp[0]; \
- break; \
- default: \
- break; \
- } \
-} while(0)
-#endif
-#ifndef SDL_revcpy
-extern DECLSPEC void * SDLCALL SDL_revcpy(void *dst, const void *src, size_t len);
-#endif
-
-#ifdef HAVE_MEMMOVE
-#define SDL_memmove memmove
-#elif defined(HAVE_BCOPY)
-#define SDL_memmove(d, s, n) bcopy((s), (d), (n))
-#else
-#define SDL_memmove(dst, src, len) \
-do { \
- if ( dst < src ) { \
- SDL_memcpy(dst, src, len); \
- } else { \
- SDL_revcpy(dst, src, len); \
- } \
-} while(0)
-#endif
-
-#ifdef HAVE_MEMCMP
-#define SDL_memcmp memcmp
-#else
-extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len);
-#endif
-
-#ifdef HAVE_STRLEN
-#define SDL_strlen strlen
-#else
-extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string);
-#endif
-
-#ifdef HAVE_STRLCPY
-#define SDL_strlcpy strlcpy
-#else
-extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen);
-#endif
-
-#ifdef HAVE_STRLCAT
-#define SDL_strlcat strlcat
-#else
-extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, size_t maxlen);
-#endif
-
-#ifdef HAVE_STRDUP
-#define SDL_strdup strdup
-#else
-extern DECLSPEC char * SDLCALL SDL_strdup(const char *string);
-#endif
-
-#ifdef HAVE__STRREV
-#define SDL_strrev _strrev
-#else
-extern DECLSPEC char * SDLCALL SDL_strrev(char *string);
-#endif
-
-#ifdef HAVE__STRUPR
-#define SDL_strupr _strupr
-#else
-extern DECLSPEC char * SDLCALL SDL_strupr(char *string);
-#endif
-
-#ifdef HAVE__STRLWR
-#define SDL_strlwr _strlwr
-#else
-extern DECLSPEC char * SDLCALL SDL_strlwr(char *string);
-#endif
-
-#ifdef HAVE_STRCHR
-#define SDL_strchr strchr
-#elif defined(HAVE_INDEX)
-#define SDL_strchr index
-#else
-extern DECLSPEC char * SDLCALL SDL_strchr(const char *string, int c);
-#endif
-
-#ifdef HAVE_STRRCHR
-#define SDL_strrchr strrchr
-#elif defined(HAVE_RINDEX)
-#define SDL_strrchr rindex
-#else
-extern DECLSPEC char * SDLCALL SDL_strrchr(const char *string, int c);
-#endif
-
-#ifdef HAVE_STRSTR
-#define SDL_strstr strstr
-#else
-extern DECLSPEC char * SDLCALL SDL_strstr(const char *haystack, const char *needle);
-#endif
-
-#ifdef HAVE_ITOA
-#define SDL_itoa itoa
-#else
-#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix)
-#endif
-
-#ifdef HAVE__LTOA
-#define SDL_ltoa _ltoa
-#else
-extern DECLSPEC char * SDLCALL SDL_ltoa(long value, char *string, int radix);
-#endif
-
-#ifdef HAVE__UITOA
-#define SDL_uitoa _uitoa
-#else
-#define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix)
-#endif
-
-#ifdef HAVE__ULTOA
-#define SDL_ultoa _ultoa
-#else
-extern DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *string, int radix);
-#endif
-
-#ifdef HAVE_STRTOL
-#define SDL_strtol strtol
-#else
-extern DECLSPEC long SDLCALL SDL_strtol(const char *string, char **endp, int base);
-#endif
-
-#ifdef HAVE_STRTOUL
-#define SDL_strtoul strtoul
-#else
-extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string, char **endp, int base);
-#endif
-
-#ifdef SDL_HAS_64BIT_TYPE
-
-#ifdef HAVE__I64TOA
-#define SDL_lltoa _i64toa
-#else
-extern DECLSPEC char* SDLCALL SDL_lltoa(Sint64 value, char *string, int radix);
-#endif
-
-#ifdef HAVE__UI64TOA
-#define SDL_ulltoa _ui64toa
-#else
-extern DECLSPEC char* SDLCALL SDL_ulltoa(Uint64 value, char *string, int radix);
-#endif
-
-#ifdef HAVE_STRTOLL
-#define SDL_strtoll strtoll
-#else
-extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *string, char **endp, int base);
-#endif
-
-#ifdef HAVE_STRTOULL
-#define SDL_strtoull strtoull
-#else
-extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp, int base);
-#endif
-
-#endif /* SDL_HAS_64BIT_TYPE */
-
-#ifdef HAVE_STRTOD
-#define SDL_strtod strtod
-#else
-extern DECLSPEC double SDLCALL SDL_strtod(const char *string, char **endp);
-#endif
-
-#ifdef HAVE_ATOI
-#define SDL_atoi atoi
-#else
-#define SDL_atoi(X) SDL_strtol(X, NULL, 0)
-#endif
-
-#ifdef HAVE_ATOF
-#define SDL_atof atof
-#else
-#define SDL_atof(X) SDL_strtod(X, NULL)
-#endif
-
-#ifdef HAVE_STRCMP
-#define SDL_strcmp strcmp
-#else
-extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2);
-#endif
-
-#ifdef HAVE_STRNCMP
-#define SDL_strncmp strncmp
-#else
-extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen);
-#endif
-
-#ifdef HAVE_STRCASECMP
-#define SDL_strcasecmp strcasecmp
-#elif defined(HAVE__STRICMP)
-#define SDL_strcasecmp _stricmp
-#else
-extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2);
-#endif
-
-#ifdef HAVE_STRNCASECMP
-#define SDL_strncasecmp strncasecmp
-#elif defined(HAVE__STRNICMP)
-#define SDL_strncasecmp _strnicmp
-#else
-extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen);
-#endif
-
-#ifdef HAVE_SSCANF
-#define SDL_sscanf sscanf
-#else
-extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...);
-#endif
-
-#ifdef HAVE_SNPRINTF
-#define SDL_snprintf snprintf
-#else
-extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...);
-#endif
-
-#ifdef HAVE_VSNPRINTF
-#define SDL_vsnprintf vsnprintf
-#else
-extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap);
-#endif
-
-/* 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
-
-#ifdef HAVE_ICONV
-#define SDL_iconv_t iconv_t
-#define SDL_iconv_open iconv_open
-#define SDL_iconv_close iconv_close
-#else
-typedef struct _SDL_iconv_t *SDL_iconv_t;
-extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, const char *fromcode);
-extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd);
-#endif
-extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
-/* This function converts a string between encodings in one pass, returning a
- string that must be freed with SDL_free() or NULL on error.
-*/
-extern DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft);
-#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
-#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1)
-#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1)
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_stdinc_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_syswm.h b/distrib/sdl-1.2.12/include/SDL_syswm.h
deleted file mode 100644
index 0502037..0000000
--- a/distrib/sdl-1.2.12/include/SDL_syswm.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* Include file for SDL custom system window manager hooks */
-
-#ifndef _SDL_syswm_h
-#define _SDL_syswm_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-#include "SDL_version.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Your application has access to a special type of event 'SDL_SYSWMEVENT',
- which contains window-manager specific information and arrives whenever
- an unhandled window event occurs. This event is ignored by default, but
- you can enable it with SDL_EventState()
-*/
-#ifdef SDL_PROTOTYPES_ONLY
-struct SDL_SysWMinfo;
-typedef struct SDL_SysWMinfo SDL_SysWMinfo;
-#else
-
-/* This is the structure for custom window manager events */
-#if defined(SDL_VIDEO_DRIVER_X11)
-#if defined(__APPLE__) && defined(__MACH__)
-/* conflicts with Quickdraw.h */
-#define Cursor X11Cursor
-#endif
-
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-
-#if defined(__APPLE__) && defined(__MACH__)
-/* matches the re-define above */
-#undef Cursor
-#endif
-
-/* These are the various supported subsystems under UNIX */
-typedef enum {
- SDL_SYSWM_X11
-} SDL_SYSWM_TYPE;
-
-/* The UNIX custom event structure */
-struct SDL_SysWMmsg {
- SDL_version version;
- SDL_SYSWM_TYPE subsystem;
- union {
- XEvent xevent;
- } event;
-};
-
-/* The UNIX custom window manager information structure.
- When this structure is returned, it holds information about which
- low level system it is using, and will be one of SDL_SYSWM_TYPE.
- */
-typedef struct SDL_SysWMinfo {
- SDL_version version;
- SDL_SYSWM_TYPE subsystem;
- union {
- struct {
- Display *display; /* The X11 display */
- Window window; /* The X11 display window */
- /* These locking functions should be called around
- any X11 functions using the display variable,
- but not the gfxdisplay variable.
- They lock the event thread, so should not be
- called around event functions or from event filters.
- */
- void (*lock_func)(void);
- void (*unlock_func)(void);
-
- /* Introduced in SDL 1.0.2 */
- Window fswindow; /* The X11 fullscreen window */
- Window wmwindow; /* The X11 managed input window */
-
- /* Introduced in SDL 1.2.12 */
- Display *gfxdisplay; /* The X11 display to which rendering is done */
- } x11;
- } info;
-} SDL_SysWMinfo;
-
-#elif defined(SDL_VIDEO_DRIVER_NANOX)
-#include <microwin/nano-X.h>
-
-/* The generic custom event structure */
-struct SDL_SysWMmsg {
- SDL_version version;
- int data;
-};
-
-/* The windows custom window manager information structure */
-typedef struct SDL_SysWMinfo {
- SDL_version version ;
- GR_WINDOW_ID window ; /* The display window */
-} SDL_SysWMinfo;
-
-#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-/* The windows custom event structure */
-struct SDL_SysWMmsg {
- SDL_version version;
- HWND hwnd; /* The window for the message */
- UINT msg; /* The type of message */
- WPARAM wParam; /* WORD message parameter */
- LPARAM lParam; /* LONG message parameter */
-};
-
-/* The windows custom window manager information structure */
-typedef struct SDL_SysWMinfo {
- SDL_version version;
- HWND window; /* The Win32 display window */
- HGLRC hglrc; /* The OpenGL context, if any */
-} SDL_SysWMinfo;
-
-#elif defined(SDL_VIDEO_DRIVER_RISCOS)
-
-/* RISC OS custom event structure */
-struct SDL_SysWMmsg {
- SDL_version version;
- int eventCode; /* The window for the message */
- int pollBlock[64];
-};
-
-/* The RISC OS custom window manager information structure */
-typedef struct SDL_SysWMinfo {
- SDL_version version;
- int wimpVersion; /* Wimp version running under */
- int taskHandle; /* The RISC OS task handle */
- int window; /* The RISC OS display window */
-} SDL_SysWMinfo;
-
-#elif defined(SDL_VIDEO_DRIVER_PHOTON)
-#include <sys/neutrino.h>
-#include <Ph.h>
-
-/* The QNX custom event structure */
-struct SDL_SysWMmsg {
- SDL_version version;
- int data;
-};
-
-/* The QNX custom window manager information structure */
-typedef struct SDL_SysWMinfo {
- SDL_version version;
- int data;
-} SDL_SysWMinfo;
-
-#elif defined(SDL_VIDEO_DRIVER_QUARTZ)
-
-struct SDL_SysWMmsg {
- SDL_version version;
- int data;
-};
-
-typedef struct SDL_SysWMinfo {
- SDL_version version;
- void* nsWindowPtr;
-} SDL_SysWMinfo;
-
-#else
-
-/* The generic custom event structure */
-struct SDL_SysWMmsg {
- SDL_version version;
- int data;
-};
-
-/* The generic custom window manager information structure */
-typedef struct SDL_SysWMinfo {
- SDL_version version;
- int data;
-} SDL_SysWMinfo;
-
-#endif /* video driver type */
-
-#endif /* SDL_PROTOTYPES_ONLY */
-
-/* Function prototypes */
-/*
- * This function gives you custom hooks into the window manager information.
- * It fills the structure pointed to by 'info' with custom information and
- * returns 1 if the function is implemented. If it's not implemented, or
- * the version member of the 'info' structure is invalid, it returns 0.
- *
- * You typically use this function like this:
- * SDL_SysWMInfo info;
- * SDL_VERSION(&info.version);
- * if ( SDL_GetWMInfo(&info) ) { ... }
- */
-extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_syswm_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_thread.h b/distrib/sdl-1.2.12/include/SDL_thread.h
deleted file mode 100644
index 403ee46..0000000
--- a/distrib/sdl-1.2.12/include/SDL_thread.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-#ifndef _SDL_thread_h
-#define _SDL_thread_h
-
-/* Header for the SDL thread management routines
-
- These are independent of the other SDL routines.
-*/
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-
-/* Thread synchronization primitives */
-#include "SDL_mutex.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* The SDL thread structure, defined in SDL_thread.c */
-struct SDL_Thread;
-typedef struct SDL_Thread SDL_Thread;
-
-/* Create a thread */
-#if ((defined(__WIN32__) && !defined(HAVE_LIBC)) || defined(__OS2__)) && !defined(__SYMBIAN32__)
-/*
- We compile SDL into a DLL on OS/2. This means, that it's the DLL which
- creates a new thread for the calling process with the SDL_CreateThread()
- API. There is a problem with this, that only the RTL of the SDL.DLL will
- be initialized for those threads, and not the RTL of the calling application!
- To solve this, we make a little hack here.
- We'll always use the caller's _beginthread() and _endthread() APIs to
- start a new thread. This way, if it's the SDL.DLL which uses this API,
- then the RTL of SDL.DLL will be used to create the new thread, and if it's
- the application, then the RTL of the application will be used.
- So, in short:
- Always use the _beginthread() and _endthread() of the calling runtime library!
-*/
-#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
-#ifndef _WIN32_WCE
-#include <process.h> /* This has _beginthread() and _endthread() defined! */
-#endif
-
-#ifdef __OS2__
-typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg);
-typedef void (*pfnSDL_CurrentEndThread)(void);
-#elif __GNUC__
-typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
- unsigned (__stdcall *func)(void *), void *arg,
- unsigned, unsigned *threadID);
-typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
-#else
-typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
- unsigned (__stdcall *func)(void *), void *arg,
- unsigned, unsigned *threadID);
-typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
-#endif
-
-extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread);
-
-#ifdef __OS2__
-#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthread, _endthread)
-#elif defined(_WIN32_WCE)
-#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, NULL, NULL)
-#else
-#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex)
-#endif
-#else
-extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data);
-#endif
-
-/* Get the 32-bit thread identifier for the current thread */
-extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void);
-
-/* Get the 32-bit thread identifier for the specified thread,
- equivalent to SDL_ThreadID() if the specified thread is NULL.
- */
-extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread);
-
-/* Wait for a thread to finish.
- The return code for the thread function is placed in the area
- pointed to by 'status', if 'status' is not NULL.
- */
-extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status);
-
-/* Forcefully kill a thread without worrying about its state */
-extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread);
-
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_thread_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_timer.h b/distrib/sdl-1.2.12/include/SDL_timer.h
deleted file mode 100644
index d21159f..0000000
--- a/distrib/sdl-1.2.12/include/SDL_timer.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-#ifndef _SDL_timer_h
-#define _SDL_timer_h
-
-/* Header for the SDL time management routines */
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* This is the OS scheduler timeslice, in milliseconds */
-#define SDL_TIMESLICE 10
-
-/* This is the maximum resolution of the SDL timer on all platforms */
-#define TIMER_RESOLUTION 10 /* Experimentally determined */
-
-/* Get the number of milliseconds since the SDL library initialization.
- * Note that this value wraps if the program runs for more than ~49 days.
- */
-extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
-
-/* Wait a specified number of milliseconds before returning */
-extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
-
-/* Function prototype for the timer callback function */
-typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval);
-
-/* Set a callback to run after the specified number of milliseconds has
- * elapsed. The callback function is passed the current timer interval
- * and returns the next timer interval. If the returned value is the
- * same as the one passed in, the periodic alarm continues, otherwise a
- * new alarm is scheduled. If the callback returns 0, the periodic alarm
- * is cancelled.
- *
- * To cancel a currently running timer, call SDL_SetTimer(0, NULL);
- *
- * The timer callback function may run in a different thread than your
- * main code, and so shouldn't call any functions from within itself.
- *
- * The maximum resolution of this timer is 10 ms, which means that if
- * you request a 16 ms timer, your callback will run approximately 20 ms
- * later on an unloaded system. If you wanted to set a flag signaling
- * a frame update at 30 frames per second (every 33 ms), you might set a
- * timer for 30 ms:
- * SDL_SetTimer((33/10)*10, flag_update);
- *
- * If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init().
- *
- * Under UNIX, you should not use raise or use SIGALRM and this function
- * in the same program, as it is implemented using setitimer(). You also
- * should not use this function in multi-threaded applications as signals
- * to multi-threaded apps have undefined behavior in some implementations.
- *
- * This function returns 0 if successful, or -1 if there was an error.
- */
-extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback);
-
-/* New timer API, supports multiple timers
- * Written by Stephane Peter <megastep@lokigames.com>
- */
-
-/* Function prototype for the new timer callback function.
- * The callback function is passed the current timer interval and returns
- * the next timer interval. If the returned value is the same as the one
- * passed in, the periodic alarm continues, otherwise a new alarm is
- * scheduled. If the callback returns 0, the periodic alarm is cancelled.
- */
-typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param);
-
-/* Definition of the timer ID type */
-typedef struct _SDL_TimerID *SDL_TimerID;
-
-/* Add a new timer to the pool of timers already running.
- Returns a timer ID, or NULL when an error occurs.
- */
-extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param);
-
-/* Remove one of the multiple timers knowing its ID.
- * Returns a boolean value indicating success.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_timer_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_types.h b/distrib/sdl-1.2.12/include/SDL_types.h
deleted file mode 100644
index 853b9ce..0000000
--- a/distrib/sdl-1.2.12/include/SDL_types.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* DEPRECATED */
-#include "SDL_stdinc.h"
diff --git a/distrib/sdl-1.2.12/include/SDL_version.h b/distrib/sdl-1.2.12/include/SDL_version.h
deleted file mode 100644
index 610ffe6..0000000
--- a/distrib/sdl-1.2.12/include/SDL_version.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* This header defines the current SDL version */
-
-#ifndef _SDL_version_h
-#define _SDL_version_h
-
-#include "SDL_stdinc.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
-*/
-#define SDL_MAJOR_VERSION 1
-#define SDL_MINOR_VERSION 2
-#define SDL_PATCHLEVEL 12
-
-typedef struct SDL_version {
- Uint8 major;
- Uint8 minor;
- Uint8 patch;
-} SDL_version;
-
-/* This macro can be used to fill a version structure with the compile-time
- * version of the SDL library.
- */
-#define SDL_VERSION(X) \
-{ \
- (X)->major = SDL_MAJOR_VERSION; \
- (X)->minor = SDL_MINOR_VERSION; \
- (X)->patch = SDL_PATCHLEVEL; \
-}
-
-/* This macro turns the version numbers into a numeric value:
- (1,2,3) -> (1203)
- This assumes that there will never be more than 100 patchlevels
-*/
-#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)
-
-/* 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))
-
-/* This function gets the version of the dynamically linked SDL library.
- it should NOT be used to fill a version structure, instead you should
- use the SDL_Version() macro.
- */
-extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_version_h */
diff --git a/distrib/sdl-1.2.12/include/SDL_video.h b/distrib/sdl-1.2.12/include/SDL_video.h
deleted file mode 100644
index 64bdc34..0000000
--- a/distrib/sdl-1.2.12/include/SDL_video.h
+++ /dev/null
@@ -1,922 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* Header file for access to the SDL raw framebuffer window */
-
-#ifndef _SDL_video_h
-#define _SDL_video_h
-
-#include "SDL_stdinc.h"
-#include "SDL_error.h"
-#include "SDL_rwops.h"
-
-#include "begin_code.h"
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Transparency definitions: These define alpha as the opacity of a surface */
-#define SDL_ALPHA_OPAQUE 255
-#define SDL_ALPHA_TRANSPARENT 0
-
-/* Useful data types */
-typedef struct SDL_Rect {
- Sint16 x, y;
- Uint16 w, h;
-} SDL_Rect;
-
-typedef struct SDL_Color {
- Uint8 r;
- Uint8 g;
- Uint8 b;
- Uint8 unused;
-} SDL_Color;
-#define SDL_Colour SDL_Color
-
-typedef struct SDL_Palette {
- int ncolors;
- SDL_Color *colors;
-} SDL_Palette;
-
-/* Everything in the pixel format structure is read-only */
-typedef struct SDL_PixelFormat {
- SDL_Palette *palette;
- Uint8 BitsPerPixel;
- Uint8 BytesPerPixel;
- Uint8 Rloss;
- Uint8 Gloss;
- Uint8 Bloss;
- Uint8 Aloss;
- Uint8 Rshift;
- Uint8 Gshift;
- Uint8 Bshift;
- Uint8 Ashift;
- Uint32 Rmask;
- Uint32 Gmask;
- Uint32 Bmask;
- Uint32 Amask;
-
- /* RGB color key information */
- Uint32 colorkey;
- /* Alpha value information (per-surface alpha) */
- Uint8 alpha;
-} SDL_PixelFormat;
-
-/* This structure should be treated as read-only, except for 'pixels',
- which, if not NULL, contains the raw pixel data for the surface.
-*/
-typedef struct SDL_Surface {
- Uint32 flags; /* Read-only */
- SDL_PixelFormat *format; /* Read-only */
- int w, h; /* Read-only */
- Uint16 pitch; /* Read-only */
- void *pixels; /* Read-write */
- int offset; /* Private */
-
- /* Hardware-specific surface info */
- struct private_hwdata *hwdata;
-
- /* clipping information */
- SDL_Rect clip_rect; /* Read-only */
- Uint32 unused1; /* for binary compatibility */
-
- /* Allow recursive locks */
- Uint32 locked; /* Private */
-
- /* info for fast blit mapping to other surfaces */
- struct SDL_BlitMap *map; /* Private */
-
- /* format version, bumped at every change to invalidate blit maps */
- unsigned int format_version; /* Private */
-
- /* Reference count -- used when freeing surface */
- int refcount; /* Read-mostly */
-} SDL_Surface;
-
-/* These are the currently supported flags for the SDL_surface */
-/* Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */
-#define SDL_SWSURFACE 0x00000000 /* Surface is in system memory */
-#define SDL_HWSURFACE 0x00000001 /* Surface is in video memory */
-#define SDL_ASYNCBLIT 0x00000004 /* Use asynchronous blits if possible */
-/* Available for SDL_SetVideoMode() */
-#define SDL_ANYFORMAT 0x10000000 /* Allow any video depth/pixel-format */
-#define SDL_HWPALETTE 0x20000000 /* Surface has exclusive palette */
-#define SDL_DOUBLEBUF 0x40000000 /* Set up double-buffered video mode */
-#define SDL_FULLSCREEN 0x80000000 /* Surface is a full screen display */
-#define SDL_OPENGL 0x00000002 /* Create an OpenGL rendering context */
-#define SDL_OPENGLBLIT 0x0000000A /* Create an OpenGL rendering context and use it for blitting */
-#define SDL_RESIZABLE 0x00000010 /* This video mode may be resized */
-#define SDL_NOFRAME 0x00000020 /* No window caption or edge frame */
-/* Used internally (read-only) */
-#define SDL_HWACCEL 0x00000100 /* Blit uses hardware acceleration */
-#define SDL_SRCCOLORKEY 0x00001000 /* Blit uses a source color key */
-#define SDL_RLEACCELOK 0x00002000 /* Private flag */
-#define SDL_RLEACCEL 0x00004000 /* Surface is RLE encoded */
-#define SDL_SRCALPHA 0x00010000 /* Blit uses source alpha blending */
-#define SDL_PREALLOC 0x01000000 /* Surface uses preallocated memory */
-
-/* Evaluates to true if the surface needs to be locked before access */
-#define SDL_MUSTLOCK(surface) \
- (surface->offset || \
- ((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0))
-
-/* typedef for private surface blitting functions */
-typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect,
- struct SDL_Surface *dst, SDL_Rect *dstrect);
-
-
-/* Useful for determining the video hardware capabilities */
-typedef struct SDL_VideoInfo {
- Uint32 hw_available :1; /* Flag: Can you create hardware surfaces? */
- Uint32 wm_available :1; /* Flag: Can you talk to a window manager? */
- Uint32 UnusedBits1 :6;
- Uint32 UnusedBits2 :1;
- Uint32 blit_hw :1; /* Flag: Accelerated blits HW --> HW */
- Uint32 blit_hw_CC :1; /* Flag: Accelerated blits with Colorkey */
- Uint32 blit_hw_A :1; /* Flag: Accelerated blits with Alpha */
- Uint32 blit_sw :1; /* Flag: Accelerated blits SW --> HW */
- Uint32 blit_sw_CC :1; /* Flag: Accelerated blits with Colorkey */
- Uint32 blit_sw_A :1; /* Flag: Accelerated blits with Alpha */
- Uint32 blit_fill :1; /* Flag: Accelerated color fill */
- Uint32 UnusedBits3 :16;
- Uint32 video_mem; /* The total amount of video memory (in K) */
- SDL_PixelFormat *vfmt; /* Value: The format of the video surface */
- int current_w; /* Value: The current video mode width */
- int current_h; /* Value: The current video mode height */
-} SDL_VideoInfo;
-
-
-/* The most common video overlay formats.
- For an explanation of these pixel formats, see:
- http://www.webartz.com/fourcc/indexyuv.htm
-
- For information on the relationship between color spaces, see:
- http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
- */
-#define SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U (3 planes) */
-#define SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V (3 planes) */
-#define SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 (1 plane) */
-#define SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 (1 plane) */
-#define SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 (1 plane) */
-
-/* The YUV hardware video overlay */
-typedef struct SDL_Overlay {
- Uint32 format; /* Read-only */
- int w, h; /* Read-only */
- int planes; /* Read-only */
- Uint16 *pitches; /* Read-only */
- Uint8 **pixels; /* Read-write */
-
- /* Hardware-specific surface info */
- struct private_yuvhwfuncs *hwfuncs;
- struct private_yuvhwdata *hwdata;
-
- /* Special flags */
- Uint32 hw_overlay :1; /* Flag: This overlay hardware accelerated? */
- Uint32 UnusedBits :31;
-} SDL_Overlay;
-
-
-/* Public enumeration for setting the OpenGL window attributes. */
-typedef enum {
- SDL_GL_RED_SIZE,
- SDL_GL_GREEN_SIZE,
- SDL_GL_BLUE_SIZE,
- SDL_GL_ALPHA_SIZE,
- SDL_GL_BUFFER_SIZE,
- SDL_GL_DOUBLEBUFFER,
- SDL_GL_DEPTH_SIZE,
- SDL_GL_STENCIL_SIZE,
- SDL_GL_ACCUM_RED_SIZE,
- SDL_GL_ACCUM_GREEN_SIZE,
- SDL_GL_ACCUM_BLUE_SIZE,
- SDL_GL_ACCUM_ALPHA_SIZE,
- SDL_GL_STEREO,
- SDL_GL_MULTISAMPLEBUFFERS,
- SDL_GL_MULTISAMPLESAMPLES,
- SDL_GL_ACCELERATED_VISUAL,
- SDL_GL_SWAP_CONTROL
-} SDL_GLattr;
-
-/* flags for SDL_SetPalette() */
-#define SDL_LOGPAL 0x01
-#define SDL_PHYSPAL 0x02
-
-/* Function prototypes */
-
-/* These functions are used internally, and should not be used unless you
- * have a specific need to specify the video driver you want to use.
- * You should normally use SDL_Init() or SDL_InitSubSystem().
- *
- * SDL_VideoInit() initializes the video subsystem -- sets up a connection
- * to the window manager, etc, and determines the current video mode and
- * pixel format, but does not initialize a window or graphics mode.
- * Note that event handling is activated by this routine.
- *
- * If you use both sound and video in your application, you need to call
- * SDL_Init() before opening the sound device, otherwise under Win32 DirectX,
- * you won't be able to set full-screen display modes.
- */
-extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name, Uint32 flags);
-extern DECLSPEC void SDLCALL SDL_VideoQuit(void);
-
-/* This function fills the given character buffer with the name of the
- * video driver, and returns a pointer to it if the video driver has
- * been initialized. It returns NULL if no driver has been initialized.
- */
-extern DECLSPEC char * SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen);
-
-/*
- * This function returns a pointer to the current display surface.
- * If SDL is doing format conversion on the display surface, this
- * function returns the publicly visible surface, not the real video
- * surface.
- */
-extern DECLSPEC SDL_Surface * SDLCALL SDL_GetVideoSurface(void);
-
-/*
- * This function returns a read-only pointer to information about the
- * video hardware. If this is called before SDL_SetVideoMode(), the 'vfmt'
- * member of the returned structure will contain the pixel format of the
- * "best" video mode.
- */
-extern DECLSPEC const SDL_VideoInfo * SDLCALL SDL_GetVideoInfo(void);
-
-/*
- * Check to see if a particular video mode is supported.
- * It returns 0 if the requested mode is not supported under any bit depth,
- * or returns the bits-per-pixel of the closest available mode with the
- * given width and height. If this bits-per-pixel is different from the
- * one used when setting the video mode, SDL_SetVideoMode() will succeed,
- * but will emulate the requested bits-per-pixel with a shadow surface.
- *
- * The arguments to SDL_VideoModeOK() are the same ones you would pass to
- * SDL_SetVideoMode()
- */
-extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags);
-
-/*
- * Return a pointer to an array of available screen dimensions for the
- * given format and video flags, sorted largest to smallest. Returns
- * NULL if there are no dimensions available for a particular format,
- * or (SDL_Rect **)-1 if any dimension is okay for the given format.
- *
- * If 'format' is NULL, the mode list will be for the format given
- * by SDL_GetVideoInfo()->vfmt
- */
-extern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags);
-
-/*
- * Set up a video mode with the specified width, height and bits-per-pixel.
- *
- * If 'bpp' is 0, it is treated as the current display bits per pixel.
- *
- * If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the
- * requested bits-per-pixel, but will return whatever video pixel format is
- * available. The default is to emulate the requested pixel format if it
- * is not natively available.
- *
- * If SDL_HWSURFACE is set in 'flags', the video surface will be placed in
- * video memory, if possible, and you may have to call SDL_LockSurface()
- * in order to access the raw framebuffer. Otherwise, the video surface
- * will be created in system memory.
- *
- * If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle
- * updates asynchronously, but you must always lock before accessing pixels.
- * SDL will wait for updates to complete before returning from the lock.
- *
- * If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee
- * that the colors set by SDL_SetColors() will be the colors you get.
- * Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all
- * of the colors exactly the way they are requested, and you should look
- * at the video surface structure to determine the actual palette.
- * If SDL cannot guarantee that the colors you request can be set,
- * i.e. if the colormap is shared, then the video surface may be created
- * under emulation in system memory, overriding the SDL_HWSURFACE flag.
- *
- * If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set
- * a fullscreen video mode. The default is to create a windowed mode
- * if the current graphics system has a window manager.
- * If the SDL library is able to set a fullscreen video mode, this flag
- * will be set in the surface that is returned.
- *
- * If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up
- * two surfaces in video memory and swap between them when you call
- * SDL_Flip(). This is usually slower than the normal single-buffering
- * scheme, but prevents "tearing" artifacts caused by modifying video
- * memory while the monitor is refreshing. It should only be used by
- * applications that redraw the entire screen on every update.
- *
- * If SDL_RESIZABLE is set in 'flags', the SDL library will allow the
- * window manager, if any, to resize the window at runtime. When this
- * occurs, SDL will send a SDL_VIDEORESIZE event to you application,
- * and you must respond to the event by re-calling SDL_SetVideoMode()
- * with the requested size (or another size that suits the application).
- *
- * If SDL_NOFRAME is set in 'flags', the SDL library will create a window
- * without any title bar or frame decoration. Fullscreen video modes have
- * this flag set automatically.
- *
- * This function returns the video framebuffer surface, or NULL if it fails.
- *
- * If you rely on functionality provided by certain video flags, check the
- * flags of the returned surface to make sure that functionality is available.
- * SDL will fall back to reduced functionality if the exact flags you wanted
- * are not available.
- */
-extern DECLSPEC SDL_Surface * SDLCALL SDL_SetVideoMode
- (int width, int height, int bpp, Uint32 flags);
-
-/*
- * Makes sure the given list of rectangles is updated on the given screen.
- * If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire
- * screen.
- * These functions should not be called while 'screen' is locked.
- */
-extern DECLSPEC void SDLCALL SDL_UpdateRects
- (SDL_Surface *screen, int numrects, SDL_Rect *rects);
-extern DECLSPEC void SDLCALL SDL_UpdateRect
- (SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h);
-
-/*
- * On hardware that supports double-buffering, this function sets up a flip
- * and returns. The hardware will wait for vertical retrace, and then swap
- * video buffers before the next video surface blit or lock will return.
- * On hardware that doesn not support double-buffering, this is equivalent
- * to calling SDL_UpdateRect(screen, 0, 0, 0, 0);
- * The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when
- * setting the video mode for this function to perform hardware flipping.
- * This function returns 0 if successful, or -1 if there was an error.
- */
-extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface *screen);
-
-/*
- * Set the gamma correction for each of the color channels.
- * The gamma values range (approximately) between 0.1 and 10.0
- *
- * If this function isn't supported directly by the hardware, it will
- * be emulated using gamma ramps, if available. If successful, this
- * function returns 0, otherwise it returns -1.
- */
-extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue);
-
-/*
- * Set the gamma translation table for the red, green, and blue channels
- * of the video hardware. Each table is an array of 256 16-bit quantities,
- * representing a mapping between the input and output for that channel.
- * The input is the index into the array, and the output is the 16-bit
- * gamma value at that index, scaled to the output color precision.
- *
- * You may pass NULL for any of the channels to leave it unchanged.
- * If the call succeeds, it will return 0. If the display driver or
- * hardware does not support gamma translation, or otherwise fails,
- * this function will return -1.
- */
-extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue);
-
-/*
- * Retrieve the current values of the gamma translation tables.
- *
- * You must pass in valid pointers to arrays of 256 16-bit quantities.
- * Any of the pointers may be NULL to ignore that channel.
- * If the call succeeds, it will return 0. If the display driver or
- * hardware does not support gamma translation, or otherwise fails,
- * this function will return -1.
- */
-extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue);
-
-/*
- * Sets a portion of the colormap for the given 8-bit surface. If 'surface'
- * is not a palettized surface, this function does nothing, returning 0.
- * If all of the colors were set as passed to SDL_SetColors(), it will
- * return 1. If not all the color entries were set exactly as given,
- * it will return 0, and you should look at the surface palette to
- * determine the actual color palette.
- *
- * When 'surface' is the surface associated with the current display, the
- * display colormap will be updated with the requested colors. If
- * SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors()
- * will always return 1, and the palette is guaranteed to be set the way
- * you desire, even if the window colormap has to be warped or run under
- * emulation.
- */
-extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface *surface,
- SDL_Color *colors, int firstcolor, int ncolors);
-
-/*
- * Sets a portion of the colormap for a given 8-bit surface.
- * 'flags' is one or both of:
- * SDL_LOGPAL -- set logical palette, which controls how blits are mapped
- * to/from the surface,
- * SDL_PHYSPAL -- set physical palette, which controls how pixels look on
- * the screen
- * Only screens have physical palettes. Separate change of physical/logical
- * palettes is only possible if the screen has SDL_HWPALETTE set.
- *
- * The return value is 1 if all colours could be set as requested, and 0
- * otherwise.
- *
- * SDL_SetColors() is equivalent to calling this function with
- * flags = (SDL_LOGPAL|SDL_PHYSPAL).
- */
-extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface *surface, int flags,
- SDL_Color *colors, int firstcolor,
- int ncolors);
-
-/*
- * Maps an RGB triple to an opaque pixel value for a given pixel format
- */
-extern DECLSPEC Uint32 SDLCALL SDL_MapRGB
-(const SDL_PixelFormat * const format,
- const Uint8 r, const Uint8 g, const Uint8 b);
-
-/*
- * Maps an RGBA quadruple to a pixel value for a given pixel format
- */
-extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA
-(const SDL_PixelFormat * const format,
- const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a);
-
-/*
- * Maps a pixel value into the RGB components for a given pixel format
- */
-extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, SDL_PixelFormat *fmt,
- Uint8 *r, Uint8 *g, Uint8 *b);
-
-/*
- * Maps a pixel value into the RGBA components for a given pixel format
- */
-extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, SDL_PixelFormat *fmt,
- Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
-
-/*
- * Allocate and free an RGB surface (must be called after SDL_SetVideoMode)
- * If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
- * If the depth is greater than 8 bits, the pixel format is set using the
- * flags '[RGB]mask'.
- * If the function runs out of memory, it will return NULL.
- *
- * The 'flags' tell what kind of surface to create.
- * SDL_SWSURFACE means that the surface should be created in system memory.
- * SDL_HWSURFACE means that the surface should be created in video memory,
- * with the same format as the display surface. This is useful for surfaces
- * that will not change much, to take advantage of hardware acceleration
- * when being blitted to the display surface.
- * SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with
- * this surface, but you must always lock it before accessing the pixels.
- * SDL will wait for current blits to finish before returning from the lock.
- * SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits.
- * If the hardware supports acceleration of colorkey blits between
- * two surfaces in video memory, SDL will try to place the surface in
- * video memory. If this isn't possible or if there is no hardware
- * acceleration available, the surface will be placed in system memory.
- * SDL_SRCALPHA means that the surface will be used for alpha blits and
- * if the hardware supports hardware acceleration of alpha blits between
- * two surfaces in video memory, to place the surface in video memory
- * if possible, otherwise it will be placed in system memory.
- * If the surface is created in video memory, blits will be _much_ faster,
- * but the surface format must be identical to the video surface format,
- * and the only way to access the pixels member of the surface is to use
- * the SDL_LockSurface() and SDL_UnlockSurface() calls.
- * If the requested surface actually resides in video memory, SDL_HWSURFACE
- * will be set in the flags member of the returned surface. If for some
- * reason the surface could not be placed in video memory, it will not have
- * the SDL_HWSURFACE flag set, and will be created in system memory instead.
- */
-#define SDL_AllocSurface SDL_CreateRGBSurface
-extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurface
- (Uint32 flags, int width, int height, int depth,
- Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
-extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
- int width, int height, int depth, int pitch,
- Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
-extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface);
-
-/*
- * SDL_LockSurface() sets up a surface for directly accessing the pixels.
- * Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write
- * to and read from 'surface->pixels', using the pixel format stored in
- * 'surface->format'. Once you are done accessing the surface, you should
- * use SDL_UnlockSurface() to release it.
- *
- * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates
- * to 0, then you can read and write to the surface at any time, and the
- * pixel format of the surface will not change. In particular, if the
- * SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you
- * will not need to lock the display surface before accessing it.
- *
- * No operating system or library calls should be made between lock/unlock
- * pairs, as critical system locks may be held during this time.
- *
- * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
- */
-extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface);
-extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface);
-
-/*
- * Load a surface from a seekable SDL data source (memory or file.)
- * If 'freesrc' is non-zero, the source will be closed after being read.
- * Returns the new surface, or NULL if there was an error.
- * The new surface should be freed with SDL_FreeSurface().
- */
-extern DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, int freesrc);
-
-/* Convenience macro -- load a surface from a file */
-#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
-
-/*
- * Save a surface to a seekable SDL data source (memory or file.)
- * If 'freedst' is non-zero, the source will be closed after being written.
- * Returns 0 if successful or -1 if there was an error.
- */
-extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
- (SDL_Surface *surface, SDL_RWops *dst, int freedst);
-
-/* Convenience macro -- save a surface to a file */
-#define SDL_SaveBMP(surface, file) \
- SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
-
-/*
- * Sets the color key (transparent pixel) in a blittable surface.
- * If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL),
- * 'key' will be the transparent pixel in the source image of a blit.
- * SDL_RLEACCEL requests RLE acceleration for the surface if present,
- * and removes RLE acceleration if absent.
- * If 'flag' is 0, this function clears any current color key.
- * This function returns 0, or -1 if there was an error.
- */
-extern DECLSPEC int SDLCALL SDL_SetColorKey
- (SDL_Surface *surface, Uint32 flag, Uint32 key);
-
-/*
- * This function sets the alpha value for the entire surface, as opposed to
- * using the alpha component of each pixel. This value measures the range
- * of transparency of the surface, 0 being completely transparent to 255
- * being completely opaque. An 'alpha' value of 255 causes blits to be
- * opaque, the source pixels copied to the destination (the default). Note
- * that per-surface alpha can be combined with colorkey transparency.
- *
- * If 'flag' is 0, alpha blending is disabled for the surface.
- * If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface.
- * OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the
- * surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed.
- *
- * The 'alpha' parameter is ignored for surfaces that have an alpha channel.
- */
-extern DECLSPEC int SDLCALL SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha);
-
-/*
- * Sets the clipping rectangle for the destination surface in a blit.
- *
- * If the clip rectangle is NULL, clipping will be disabled.
- * If the clip rectangle doesn't intersect the surface, the function will
- * return SDL_FALSE and blits will be completely clipped. Otherwise the
- * function returns SDL_TRUE and blits to the surface will be clipped to
- * the intersection of the surface area and the clipping rectangle.
- *
- * Note that blits are automatically clipped to the edges of the source
- * and destination surfaces.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect);
-
-/*
- * Gets the clipping rectangle for the destination surface in a blit.
- * 'rect' must be a pointer to a valid rectangle which will be filled
- * with the correct values.
- */
-extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect);
-
-/*
- * Creates a new surface of the specified format, and then copies and maps
- * the given surface to it so the blit of the converted surface will be as
- * fast as possible. If this function fails, it returns NULL.
- *
- * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those
- * semantics. You can also pass SDL_RLEACCEL in the flags parameter and
- * SDL will try to RLE accelerate colorkey and alpha blits in the resulting
- * surface.
- *
- * This function is used internally by SDL_DisplayFormat().
- */
-extern DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface
- (SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags);
-
-/*
- * This performs a fast blit from the source surface to the destination
- * surface. It assumes that the source and destination rectangles are
- * the same size. If either 'srcrect' or 'dstrect' are NULL, the entire
- * surface (src or dst) is copied. The final blit rectangles are saved
- * in 'srcrect' and 'dstrect' after all clipping is performed.
- * If the blit is successful, it returns 0, otherwise it returns -1.
- *
- * The blit function should not be called on a locked surface.
- *
- * The blit semantics for surfaces with and without alpha and colorkey
- * are defined as follows:
- *
- * RGBA->RGB:
- * SDL_SRCALPHA set:
- * alpha-blend (using alpha-channel).
- * SDL_SRCCOLORKEY ignored.
- * SDL_SRCALPHA not set:
- * copy RGB.
- * if SDL_SRCCOLORKEY set, only copy the pixels matching the
- * RGB values of the source colour key, ignoring alpha in the
- * comparison.
- *
- * RGB->RGBA:
- * SDL_SRCALPHA set:
- * alpha-blend (using the source per-surface alpha value);
- * set destination alpha to opaque.
- * SDL_SRCALPHA not set:
- * copy RGB, set destination alpha to source per-surface alpha value.
- * both:
- * if SDL_SRCCOLORKEY set, only copy the pixels matching the
- * source colour key.
- *
- * RGBA->RGBA:
- * SDL_SRCALPHA set:
- * alpha-blend (using the source alpha channel) the RGB values;
- * leave destination alpha untouched. [Note: is this correct?]
- * SDL_SRCCOLORKEY ignored.
- * SDL_SRCALPHA not set:
- * copy all of RGBA to the destination.
- * if SDL_SRCCOLORKEY set, only copy the pixels matching the
- * RGB values of the source colour key, ignoring alpha in the
- * comparison.
- *
- * RGB->RGB:
- * SDL_SRCALPHA set:
- * alpha-blend (using the source per-surface alpha value).
- * SDL_SRCALPHA not set:
- * copy RGB.
- * both:
- * if SDL_SRCCOLORKEY set, only copy the pixels matching the
- * source colour key.
- *
- * If either of the surfaces were in video memory, and the blit returns -2,
- * the video memory was lost, so it should be reloaded with artwork and
- * re-blitted:
- while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
- while ( SDL_LockSurface(image) < 0 )
- Sleep(10);
- -- Write image pixels to image->pixels --
- SDL_UnlockSurface(image);
- }
- * This happens under DirectX 5.0 when the system switches away from your
- * fullscreen application. The lock will also fail until you have access
- * to the video memory again.
- */
-/* You should call SDL_BlitSurface() unless you know exactly how SDL
- blitting works internally and how to use the other blit functions.
-*/
-#define SDL_BlitSurface SDL_UpperBlit
-
-/* This is the public blit function, SDL_BlitSurface(), and it performs
- rectangle validation and clipping before passing it to SDL_LowerBlit()
-*/
-extern DECLSPEC int SDLCALL SDL_UpperBlit
- (SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect);
-/* This is a semi-private blit function and it performs low-level surface
- blitting only.
-*/
-extern DECLSPEC int SDLCALL SDL_LowerBlit
- (SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect);
-
-/*
- * This function performs a fast fill of the given rectangle with 'color'
- * The given rectangle is clipped to the destination surface clip area
- * and the final fill rectangle is saved in the passed in pointer.
- * If 'dstrect' is NULL, the whole surface will be filled with 'color'
- * The color should be a pixel of the format used by the surface, and
- * can be generated by the SDL_MapRGB() function.
- * This function returns 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_FillRect
- (SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);
-
-/*
- * This function takes a surface and copies it to a new surface of the
- * pixel format and colors of the video framebuffer, suitable for fast
- * blitting onto the display surface. It calls SDL_ConvertSurface()
- *
- * If you want to take advantage of hardware colorkey or alpha blit
- * acceleration, you should set the colorkey and alpha value before
- * calling this function.
- *
- * If the conversion fails or runs out of memory, it returns NULL
- */
-extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormat(SDL_Surface *surface);
-
-/*
- * This function takes a surface and copies it to a new surface of the
- * pixel format and colors of the video framebuffer (if possible),
- * suitable for fast alpha blitting onto the display surface.
- * The new surface will always have an alpha channel.
- *
- * If you want to take advantage of hardware colorkey or alpha blit
- * acceleration, you should set the colorkey and alpha value before
- * calling this function.
- *
- * If the conversion fails or runs out of memory, it returns NULL
- */
-extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *surface);
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* YUV video surface overlay functions */
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/* This function creates a video output overlay
- Calling the returned surface an overlay is something of a misnomer because
- the contents of the display surface underneath the area where the overlay
- is shown is undefined - it may be overwritten with the converted YUV data.
-*/
-extern DECLSPEC SDL_Overlay * SDLCALL SDL_CreateYUVOverlay(int width, int height,
- Uint32 format, SDL_Surface *display);
-
-/* Lock an overlay for direct access, and unlock it when you are done */
-extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay *overlay);
-extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay *overlay);
-
-/* Blit a video overlay to the display surface.
- The contents of the video surface underneath the blit destination are
- not defined.
- The width and height of the destination rectangle may be different from
- that of the overlay, but currently only 2x scaling is supported.
-*/
-extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect);
-
-/* Free a video overlay */
-extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay *overlay);
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* OpenGL support functions. */
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*
- * Dynamically load an OpenGL library, or the default one if path is NULL
- *
- * 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().
- */
-extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
-
-/*
- * Get the address of a GL function
- */
-extern DECLSPEC void * SDLCALL SDL_GL_GetProcAddress(const char* proc);
-
-/*
- * Set an attribute of the OpenGL subsystem before intialization.
- */
-extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
-
-/*
- * Get an attribute of the OpenGL subsystem from the windowing
- * interface, such as glX. This is of course different from getting
- * the values from SDL's internal OpenGL subsystem, which only
- * stores the values you request before initialization.
- *
- * Developers should track the values they pass into SDL_GL_SetAttribute
- * themselves if they want to retrieve these values.
- */
-extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int* value);
-
-/*
- * Swap the OpenGL buffers, if double-buffering is supported.
- */
-extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void);
-
-/*
- * Internal functions that should not be called unless you have read
- * and understood the source code for these functions.
- */
-extern DECLSPEC void SDLCALL SDL_GL_UpdateRects(int numrects, SDL_Rect* rects);
-extern DECLSPEC void SDLCALL SDL_GL_Lock(void);
-extern DECLSPEC void SDLCALL SDL_GL_Unlock(void);
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* These functions allow interaction with the window manager, if any. */
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/*
- * Sets/Gets the title and icon text of the display window (UTF-8 encoded)
- */
-extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title, const char *icon);
-extern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon);
-
-/*
- * Sets the icon for the display window.
- * This function must be called before the first call to SDL_SetVideoMode().
- * It takes an icon surface, and a mask in MSB format.
- * If 'mask' is NULL, the entire icon surface will be used as the icon.
- */
-extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask);
-
-/*
- * This function iconifies the window, and returns 1 if it succeeded.
- * If the function succeeds, it generates an SDL_APPACTIVE loss event.
- * This function is a noop and returns 0 in non-windowed environments.
- */
-extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void);
-
-/*
- * Toggle fullscreen mode without changing the contents of the screen.
- * If the display surface does not require locking before accessing
- * the pixel information, then the memory pointers will not change.
- *
- * If this function was able to toggle fullscreen mode (change from
- * running in a window to fullscreen, or vice-versa), it will return 1.
- * If it is not implemented, or fails, it returns 0.
- *
- * The next call to SDL_SetVideoMode() will set the mode fullscreen
- * attribute based on the flags parameter - if SDL_FULLSCREEN is not
- * set, then the display will be windowed by default where supported.
- *
- * This is currently only implemented in the X11 video driver.
- */
-extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface *surface);
-
-/*
- * This function allows you to set and query the input grab state of
- * the application. It returns the new input grab state.
- */
-typedef enum {
- SDL_GRAB_QUERY = -1,
- SDL_GRAB_OFF = 0,
- SDL_GRAB_ON = 1,
- SDL_GRAB_FULLSCREEN /* Used internally */
-} SDL_GrabMode;
-/*
- * Grabbing means that the mouse is confined to the application window,
- * and nearly all keyboard input is passed directly to the application,
- * and not interpreted by a window manager, if any.
- */
-extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode);
-
-/*
- * Move the SDL Window to a specify position. does nothing in fullscreen mode
- *
- */
-extern DECLSPEC void SDL_WM_SetPos(int x, int y);
-
-/*
- * Get the current SDL window position. returns (0,0) in fullscreen mode
- */
-extern DECLSPEC void SDL_WM_GetPos(int *px, int *py);
-
-/*
- * If the window is fully visible, return TRUE; otherwise, recenter the window
- * if the 'recenter' parameter is non-0, and return FALSE.
- */
-extern DECLSPEC int SDL_WM_IsFullyVisible( int recenter );
-
-/*
- * Get the resolution of the main monitor in DPIs, if available.
- * Return 0 on success, or -1 if the data is not available
- */
-extern DECLSPEC int SDL_WM_GetMonitorDPI( int *xDpi, int *yDpi );
-
-/*
- * Get the coordinates of the monitor in virtual desktop space.
- * In the case of multi-monitor systems, returns the rectangle of
- * the 'nearest' monitor relative to the main SDL_window.
- * Returns 0 on success, or -1 if the data is not available.
- */
-extern DECLSPEC int SDL_WM_GetMonitorRect( SDL_Rect *rect );
-
-/* Not in public API at the moment - do not use! */
-extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect);
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-}
-#endif
-#include "close_code.h"
-
-#endif /* _SDL_video_h */
diff --git a/distrib/sdl-1.2.12/include/begin_code.h b/distrib/sdl-1.2.12/include/begin_code.h
deleted file mode 100644
index b03787f..0000000
--- a/distrib/sdl-1.2.12/include/begin_code.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* This file sets things up for C dynamic library function definitions,
- static inlined functions, and structures aligned at 4-byte alignment.
- If you don't like ugly C preprocessor code, don't look at this file. :)
-*/
-
-/* This shouldn't be nested -- included it around code only. */
-#ifdef _begin_code_h
-#error Nested inclusion of begin_code.h
-#endif
-#define _begin_code_h
-
-/* Some compilers use a special export keyword */
-#ifndef DECLSPEC
-# if defined(__BEOS__)
-# if defined(__GNUC__)
-# define DECLSPEC __declspec(dllexport)
-# else
-# define DECLSPEC __declspec(export)
-# endif
-# elif defined(__WIN32__)
-# ifdef __BORLANDC__
-# ifdef BUILD_SDL
-# define DECLSPEC
-# else
-# define DECLSPEC __declspec(dllimport)
-# endif
-# else
-# define DECLSPEC __declspec(dllexport)
-# endif
-# elif defined(__OS2__)
-# ifdef __WATCOMC__
-# ifdef BUILD_SDL
-# define DECLSPEC __declspec(dllexport)
-# else
-# define DECLSPEC
-# endif
-# else
-# define DECLSPEC
-# endif
-# else
-# if defined(__GNUC__) && __GNUC__ >= 4
-# define DECLSPEC __attribute__ ((visibility("default")))
-# else
-# define DECLSPEC
-# endif
-# endif
-#endif
-
-/* By default SDL uses the C calling convention */
-#ifndef SDLCALL
-#if defined(__WIN32__) && !defined(__GNUC__)
-#define SDLCALL __cdecl
-#else
-#ifdef __OS2__
-/* But on OS/2, we use the _System calling convention */
-/* to be compatible with every compiler */
-#define SDLCALL _System
-#else
-#define SDLCALL
-#endif
-#endif
-#endif /* SDLCALL */
-
-#ifdef __SYMBIAN32__
-#ifndef EKA2
-#undef DECLSPEC
-#define DECLSPEC
-#elif !defined(__WINS__)
-#undef DECLSPEC
-#define DECLSPEC __declspec(dllexport)
-#endif //EKA2
-#endif //__SYMBIAN32__
-
-/* Force structure packing at 4 byte alignment.
- This is necessary if the header is included in code which has structure
- packing set to an alternate value, say for loading structures from disk.
- The packing is reset to the previous value in close_code.h
- */
-#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
-#ifdef _MSC_VER
-#pragma warning(disable: 4103)
-#endif
-#ifdef __BORLANDC__
-#pragma nopackwarning
-#endif
-#pragma pack(push,4)
-#elif (defined(__MWERKS__) && defined(__MACOS__))
-#pragma options align=mac68k4byte
-#pragma enumsalwaysint on
-#endif /* Compiler needs structure packing set */
-
-/* Set up compiler-specific options for inlining functions */
-#ifndef SDL_INLINE_OKAY
-#ifdef __GNUC__
-#define SDL_INLINE_OKAY
-#else
-/* Add any special compiler-specific cases here */
-#if defined(_MSC_VER) || defined(__BORLANDC__) || \
- defined(__DMC__) || defined(__SC__) || \
- defined(__WATCOMC__) || defined(__LCC__) || \
- defined(__DECC) || defined(__EABI__)
-#ifndef __inline__
-#define __inline__ __inline
-#endif
-#define SDL_INLINE_OKAY
-#else
-#if !defined(__MRC__) && !defined(_SGI_SOURCE)
-#ifndef __inline__
-#define __inline__ inline
-#endif
-#define SDL_INLINE_OKAY
-#endif /* Not a funky compiler */
-#endif /* Visual C++ */
-#endif /* GNU C */
-#endif /* SDL_INLINE_OKAY */
-
-/* If inlining isn't supported, remove "__inline__", turning static
- inlined functions into static functions (resulting in code bloat
- in all files which include the offending header files)
-*/
-#ifndef SDL_INLINE_OKAY
-#define __inline__
-#endif
-
-/* Apparently this is needed by several Windows compilers */
-#if !defined(__MACH__)
-#ifndef NULL
-#ifdef __cplusplus
-#define NULL 0
-#else
-#define NULL ((void *)0)
-#endif
-#endif /* NULL */
-#endif /* ! Mac OS X - breaks precompiled headers */
diff --git a/distrib/sdl-1.2.12/include/close_code.h b/distrib/sdl-1.2.12/include/close_code.h
deleted file mode 100644
index afbb650..0000000
--- a/distrib/sdl-1.2.12/include/close_code.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* This file reverses the effects of begin_code.h and should be included
- after you finish any function and structure declarations in your headers
-*/
-
-#undef _begin_code_h
-
-/* Reset structure packing at previous byte alignment */
-#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__)
-#ifdef __BORLANDC__
-#pragma nopackwarning
-#endif
-#if (defined(__MWERKS__) && defined(__MACOS__))
-#pragma options align=reset
-#pragma enumsalwaysint reset
-#else
-#pragma pack(pop)
-#endif
-#endif /* Compiler needs structure packing set */
-
diff --git a/distrib/sdl-1.2.12/sources.make b/distrib/sdl-1.2.12/sources.make
deleted file mode 100644
index dadcb3f..0000000
--- a/distrib/sdl-1.2.12/sources.make
+++ /dev/null
@@ -1,244 +0,0 @@
-# This is included from the main Android emulator build script
-# to declare the SDL-related sources, compiler flags and libraries
-#
-
-SDL_CFLAGS :=
-SDL_LDLIBS :=
-SDL_STATIC_LIBRARIES :=
-
-SDL_SOURCES :=
-
-ifeq ($(HOST_OS),linux)
- SDL_CONFIG_LOADSO_DLOPEN := yes
- SDL_CONFIG_THREAD_PTHREAD := yes
- SDL_CONFIG_THREAD_PTHREAD_RECURSIVE_MUTEX_NP := yes
- SDL_CONFIG_TIMER_UNIX := yes
- SDL_CONFIG_VIDEO_X11 := yes
- SDL_CONFIG_VIDEO_X11_DPMS := yes
- SDL_CONFIG_VIDEO_X11_XINERAMA := yes
- SDL_CONFIG_VIDEO_X11_XME := yes
- SDL_CONFIG_MAIN_DUMMY := yes
-
- SDL_CFLAGS += -D_GNU_SOURCE=1 -D_REENTRANT
- SDL_LDLIBS += -lm -ldl -lpthread -lrt
-endif
-
-ifeq ($(HOST_OS),freebsd)
- SDL_CONFIG_LOADSO_DLOPEN := yes
- SDL_CONFIG_THREAD_PTHREAD := yes
- SDL_CONFIG_THREAD_PTHREAD_RECURSIVE_MUTEX := yes
- SDL_CONFIG_TIMER_UNIX := yes
- SDL_CONFIG_VIDEO_X11 := yes
- SDL_CONFIG_VIDEO_X11_DPMS := yes
- SDL_CONFIG_VIDEO_X11_XINERAMA := yes
- SDL_CONFIG_VIDEO_X11_XME := yes
- SDL_CONFIG_MAIN_DUMMY := yes
-
- SDL_CFLAGS += -D_GNU_SOURCE=1 -D_REENTRANT
- SDL_LDLIBS += -lm -ldl -lpthread
-endif
-
-ifeq ($(HOST_OS),darwin)
- SDL_CONFIG_LOADSO_DLCOMPAT := yes
- SDL_CONFIG_THREAD_PTHREAD := yes
- SDL_CONFIG_THREAD_PTHREAD_RECURSIVE_MUTEX := yes
- SDL_CONFIG_TIMER_UNIX := yes
- SDL_CONFIG_VIDEO_QUARTZ := yes
- SDL_CONFIG_MAIN_MACOSX := yes
-
- SDL_CFLAGS += -D_GNU_SOURCE=1 -DTHREAD_SAFE
- FRAMEWORKS := OpenGL Cocoa QuickTime ApplicationServices Carbon IOKit
- SDL_LDLIBS += $(FRAMEWORKS:%=-Wl,-framework,%)
-endif
-
-ifeq ($(HOST_OS),windows)
- SDL_CONFIG_LOADSO_WIN32 := yes
- SDL_CONFIG_THREAD_WIN32 := yes
- SDL_CONFIG_TIMER_WIN32 := yes
- SDL_CONFIG_VIDEO_WINDIB := yes
- SDL_CONFIG_MAIN_WIN32 := yes
-
- SDL_CFLAGS += -D_GNU_SOURCE=1 -Dmain=SDL_main -DNO_STDIO_REDIRECT=1
- SDL_LDLIBS += -luser32 -lgdi32 -lwinmm
-endif
-
-
-# the main src/ sources
-#
-SRCS := SDL.c \
- SDL_error.c \
- SDL_fatal.c \
-
-SRCS += events/SDL_active.c \
- events/SDL_events.c \
- events/SDL_expose.c \
- events/SDL_keyboard.c \
- events/SDL_mouse.c \
- events/SDL_quit.c \
- events/SDL_resize.c \
-
-SRCS += file/SDL_rwops.c
-
-SRCS += stdlib/SDL_getenv.c \
- stdlib/SDL_iconv.c \
- stdlib/SDL_malloc.c \
- stdlib/SDL_qsort.c \
- stdlib/SDL_stdlib.c \
- stdlib/SDL_string.c
-
-SRCS += cpuinfo/SDL_cpuinfo.c
-
-SDL_SOURCES += $(SRCS:%=$(SDL_DIR)/src/%)
-
-# the LoadSO sources
-#
-
-SRCS :=
-
-ifeq ($(SDL_CONFIG_LOADSO_DLOPEN),yes)
- SRCS += dlopen/SDL_sysloadso.c
- SDL_LDLIBS += -ldl
-endif
-
-ifeq ($(SDL_CONFIG_LOADSO_DLCOMPAT),yes)
- SRCS += macosx/SDL_dlcompat.c
-endif
-
-ifeq ($(SDL_CONFIG_LOADSO_WIN32),yes)
- SRCS += win32/SDL_sysloadso.c
-endif
-
-SDL_SOURCES += $(SRCS:%=$(SDL_DIR)/src/loadso/%)
-
-# the Thread sources
-#
-
-SRCS := SDL_thread.c
-
-ifeq ($(SDL_CONFIG_THREAD_PTHREAD),yes)
- SRCS += pthread/SDL_syscond.c \
- pthread/SDL_sysmutex.c \
- pthread/SDL_syssem.c \
- pthread/SDL_systhread.c
-endif
-
-ifeq ($(SDL_CONFIG_THREAD_WIN32),yes)
- SRCS += win32/SDL_sysmutex.c \
- win32/SDL_syssem.c \
- win32/SDL_systhread.c
-endif
-
-SDL_SOURCES += $(SRCS:%=$(SDL_DIR)/src/thread/%)
-
-# the Timer sources
-#
-
-SRCS := SDL_timer.c
-
-ifeq ($(SDL_CONFIG_TIMER_UNIX),yes)
- SRCS += unix/SDL_systimer.c
-endif
-
-ifeq ($(SDL_CONFIG_TIMER_WIN32),yes)
- SRCS += win32/SDL_systimer.c
-endif
-
-SDL_SOURCES += $(SRCS:%=$(SDL_DIR)/src/timer/%)
-
-# the Video sources
-#
-
-SRCS := SDL_RLEaccel.c \
- SDL_blit.c \
- SDL_blit_0.c \
- SDL_blit_1.c \
- SDL_blit_A.c \
- SDL_blit_N.c \
- SDL_bmp.c \
- SDL_cursor.c \
- SDL_gamma.c \
- SDL_pixels.c \
- SDL_stretch.c \
- SDL_surface.c \
- SDL_video.c \
- SDL_yuv.c \
- SDL_yuv_mmx.c \
- SDL_yuv_sw.c \
-
-SRCS += dummy/SDL_nullevents.c \
- dummy/SDL_nullmouse.c \
- dummy/SDL_nullvideo.c
-
-ifeq ($(SDL_CONFIG_VIDEO_WINDIB),yes)
- SRCS += windib/SDL_dibevents.c \
- windib/SDL_dibvideo.c \
- wincommon/SDL_sysevents.c \
- wincommon/SDL_sysmouse.c \
- wincommon/SDL_syswm.c \
- wincommon/SDL_wingl.c
-endif
-
-ifeq ($(SDL_CONFIG_VIDEO_QUARTZ),yes)
- SRCS += quartz/SDL_QuartzGL.m \
- quartz/SDL_QuartzVideo.m \
- quartz/SDL_QuartzWM.m \
- quartz/SDL_QuartzWindow.m \
- quartz/SDL_QuartzYUV.m \
- quartz/SDL_QuartzEvents.m \
- maccommon/SDL_macevents.c \
- maccommon/SDL_macgl.c \
- maccommon/SDL_macmouse.c \
- maccommon/SDL_macwm.c
-
-endif
-
-ifeq ($(SDL_CONFIG_VIDEO_X11),yes)
- SRCS += x11/SDL_x11dyn.c \
- x11/SDL_x11dga.c \
- x11/SDL_x11events.c \
- x11/SDL_x11gamma.c \
- x11/SDL_x11gl.c \
- x11/SDL_x11image.c \
- x11/SDL_x11modes.c \
- x11/SDL_x11mouse.c \
- x11/SDL_x11video.c \
- x11/SDL_x11wm.c \
- x11/SDL_x11yuv.c
-endif
-
-ifeq ($(SDL_CONFIG_VIDEO_X11_DGAMOUSE),yes)
- SRCS += x11/SDL_x11dga.c
-endif
-
-ifeq ($(SDL_CONFIG_VIDEO_X11_XME),yes)
- SRCS += Xext/XME/xme.c
-endif
-
-ifeq ($(SDL_CONFIG_VIDEO_X11_XINERAMA),yes)
- SRCS += Xext/Xinerama/Xinerama.c
-endif
-
-ifeq ($(SDL_CONFIG_VIDEO_X11_XV),yes)
- SRCS += Xext/Xv/Xv.c
-endif
-
-SDL_SOURCES += $(SRCS:%=$(SDL_DIR)/src/video/%)
-
-## Build libSDLmain
-##
-
-SRCS :=
-
-ifeq ($(SDL_CONFIG_MAIN_DUMMY),yes)
- SRCS += dummy/SDL_dummy_main.c
-endif
-
-ifeq ($(SDL_CONFIG_MAIN_MACOSX),yes)
- SRCS += macosx/SDLMain.m
-endif
-
-ifeq ($(SDL_CONFIG_MAIN_WIN32),yes)
- SRCS += win32/SDL_win32_main.c
-endif
-
-SDLMAIN_SOURCES := $(SRCS:%=$(SDL_DIR)/src/main/%)
diff --git a/distrib/sdl-1.2.12/src/SDL.c b/distrib/sdl-1.2.12/src/SDL.c
deleted file mode 100644
index eec4e7e..0000000
--- a/distrib/sdl-1.2.12/src/SDL.c
+++ /dev/null
@@ -1,350 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Initialization code for SDL */
-
-#include "SDL.h"
-#include "SDL_fatal.h"
-#if !SDL_VIDEO_DISABLED
-#include "video/SDL_leaks.h"
-#endif
-
-#if SDL_THREAD_PTH
-#include <pth.h>
-#endif
-
-/* Initialization/Cleanup routines */
-#if !SDL_JOYSTICK_DISABLED
-extern int SDL_JoystickInit(void);
-extern void SDL_JoystickQuit(void);
-#endif
-#if !SDL_CDROM_DISABLED
-extern int SDL_CDROMInit(void);
-extern void SDL_CDROMQuit(void);
-#endif
-#if !SDL_TIMERS_DISABLED
-extern void SDL_StartTicks(void);
-extern int SDL_TimerInit(void);
-extern void SDL_TimerQuit(void);
-#endif
-
-/* The current SDL version */
-static SDL_version version =
- { SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL };
-
-/* The initialized subsystems */
-static Uint32 SDL_initialized = 0;
-#if !SDL_TIMERS_DISABLED
-static Uint32 ticks_started = 0;
-#endif
-
-#ifdef CHECK_LEAKS
-int surfaces_allocated = 0;
-#endif
-
-int SDL_InitSubSystem(Uint32 flags)
-{
-#if !SDL_VIDEO_DISABLED
- /* Initialize the video/event subsystem */
- if ( (flags & SDL_INIT_VIDEO) && !(SDL_initialized & SDL_INIT_VIDEO) ) {
- if ( SDL_VideoInit(SDL_getenv("SDL_VIDEODRIVER"),
- (flags&SDL_INIT_EVENTTHREAD)) < 0 ) {
- return(-1);
- }
- SDL_initialized |= SDL_INIT_VIDEO;
- }
-#else
- if ( flags & SDL_INIT_VIDEO ) {
- SDL_SetError("SDL not built with video support");
- return(-1);
- }
-#endif
-
-#if !SDL_AUDIO_DISABLED
- /* Initialize the audio subsystem */
- if ( (flags & SDL_INIT_AUDIO) && !(SDL_initialized & SDL_INIT_AUDIO) ) {
- if ( SDL_AudioInit(SDL_getenv("SDL_AUDIODRIVER")) < 0 ) {
- return(-1);
- }
- SDL_initialized |= SDL_INIT_AUDIO;
- }
-#else
- if ( flags & SDL_INIT_AUDIO ) {
- SDL_SetError("SDL not built with audio support");
- return(-1);
- }
-#endif
-
-#if !SDL_TIMERS_DISABLED
- /* Initialize the timer subsystem */
- if ( ! ticks_started ) {
- SDL_StartTicks();
- ticks_started = 1;
- }
- if ( (flags & SDL_INIT_TIMER) && !(SDL_initialized & SDL_INIT_TIMER) ) {
- if ( SDL_TimerInit() < 0 ) {
- return(-1);
- }
- SDL_initialized |= SDL_INIT_TIMER;
- }
-#else
- if ( flags & SDL_INIT_TIMER ) {
- SDL_SetError("SDL not built with timer support");
- return(-1);
- }
-#endif
-
-#if !SDL_JOYSTICK_DISABLED
- /* Initialize the joystick subsystem */
- if ( (flags & SDL_INIT_JOYSTICK) &&
- !(SDL_initialized & SDL_INIT_JOYSTICK) ) {
- if ( SDL_JoystickInit() < 0 ) {
- return(-1);
- }
- SDL_initialized |= SDL_INIT_JOYSTICK;
- }
-#else
- if ( flags & SDL_INIT_JOYSTICK ) {
- SDL_SetError("SDL not built with joystick support");
- return(-1);
- }
-#endif
-
-#if !SDL_CDROM_DISABLED
- /* Initialize the CD-ROM subsystem */
- if ( (flags & SDL_INIT_CDROM) && !(SDL_initialized & SDL_INIT_CDROM) ) {
- if ( SDL_CDROMInit() < 0 ) {
- return(-1);
- }
- SDL_initialized |= SDL_INIT_CDROM;
- }
-#else
- if ( flags & SDL_INIT_CDROM ) {
- SDL_SetError("SDL not built with cdrom support");
- return(-1);
- }
-#endif
- return(0);
-}
-
-int SDL_Init(Uint32 flags)
-{
-#if !SDL_THREADS_DISABLED && SDL_THREAD_PTH
- if (!pth_init()) {
- return -1;
- }
-#endif
-
- /* Clear the error message */
- SDL_ClearError();
-
- /* Initialize the desired subsystems */
- if ( SDL_InitSubSystem(flags) < 0 ) {
- return(-1);
- }
-
- /* Everything is initialized */
- if ( !(flags & SDL_INIT_NOPARACHUTE) ) {
- SDL_InstallParachute();
- }
- return(0);
-}
-
-void SDL_QuitSubSystem(Uint32 flags)
-{
- /* Shut down requested initialized subsystems */
-#if !SDL_CDROM_DISABLED
- if ( (flags & SDL_initialized & SDL_INIT_CDROM) ) {
- SDL_CDROMQuit();
- SDL_initialized &= ~SDL_INIT_CDROM;
- }
-#endif
-#if !SDL_JOYSTICK_DISABLED
- if ( (flags & SDL_initialized & SDL_INIT_JOYSTICK) ) {
- SDL_JoystickQuit();
- SDL_initialized &= ~SDL_INIT_JOYSTICK;
- }
-#endif
-#if !SDL_TIMERS_DISABLED
- if ( (flags & SDL_initialized & SDL_INIT_TIMER) ) {
- SDL_TimerQuit();
- SDL_initialized &= ~SDL_INIT_TIMER;
- }
-#endif
-#if !SDL_AUDIO_DISABLED
- if ( (flags & SDL_initialized & SDL_INIT_AUDIO) ) {
- SDL_AudioQuit();
- SDL_initialized &= ~SDL_INIT_AUDIO;
- }
-#endif
-#if !SDL_VIDEO_DISABLED
- if ( (flags & SDL_initialized & SDL_INIT_VIDEO) ) {
- SDL_VideoQuit();
- SDL_initialized &= ~SDL_INIT_VIDEO;
- }
-#endif
-}
-
-Uint32 SDL_WasInit(Uint32 flags)
-{
- if ( ! flags ) {
- flags = SDL_INIT_EVERYTHING;
- }
- return (SDL_initialized&flags);
-}
-
-void SDL_Quit(void)
-{
- /* Quit all subsystems */
-#ifdef DEBUG_BUILD
- printf("[SDL_Quit] : Enter! Calling QuitSubSystem()\n"); fflush(stdout);
-#endif
- SDL_QuitSubSystem(SDL_INIT_EVERYTHING);
-
-#ifdef CHECK_LEAKS
-#ifdef DEBUG_BUILD
- printf("[SDL_Quit] : CHECK_LEAKS\n"); fflush(stdout);
-#endif
-
- /* Print the number of surfaces not freed */
- if ( surfaces_allocated != 0 ) {
- fprintf(stderr, "SDL Warning: %d SDL surfaces extant\n",
- surfaces_allocated);
- }
-#endif
-#ifdef DEBUG_BUILD
- printf("[SDL_Quit] : SDL_UninstallParachute()\n"); fflush(stdout);
-#endif
-
- /* Uninstall any parachute signal handlers */
- SDL_UninstallParachute();
-
-#if !SDL_THREADS_DISABLED && SDL_THREAD_PTH
- pth_kill();
-#endif
-#ifdef DEBUG_BUILD
- printf("[SDL_Quit] : Returning!\n"); fflush(stdout);
-#endif
-
-}
-
-/* Return the library version number */
-const SDL_version * SDL_Linked_Version(void)
-{
- return(&version);
-}
-
-#if defined(__OS2__)
-/* Building for OS/2 */
-#ifdef __WATCOMC__
-
-#define INCL_DOSERRORS
-#define INCL_DOSEXCEPTIONS
-#include <os2.h>
-
-/* Exception handler to prevent the Audio thread hanging, making a zombie process! */
-ULONG _System SDL_Main_ExceptionHandler(PEXCEPTIONREPORTRECORD pERepRec,
- PEXCEPTIONREGISTRATIONRECORD pERegRec,
- PCONTEXTRECORD pCtxRec,
- PVOID p)
-{
- if (pERepRec->fHandlerFlags & EH_EXIT_UNWIND)
- return XCPT_CONTINUE_SEARCH;
- if (pERepRec->fHandlerFlags & EH_UNWINDING)
- return XCPT_CONTINUE_SEARCH;
- if (pERepRec->fHandlerFlags & EH_NESTED_CALL)
- return XCPT_CONTINUE_SEARCH;
-
- /* Do cleanup at every fatal exception! */
- if (((pERepRec->ExceptionNum & XCPT_SEVERITY_CODE) == XCPT_FATAL_EXCEPTION) &&
- (pERepRec->ExceptionNum != XCPT_BREAKPOINT) &&
- (pERepRec->ExceptionNum != XCPT_SINGLE_STEP)
- )
- {
- if (SDL_initialized & SDL_INIT_AUDIO)
- {
- /* This removes the zombie audio thread in case of emergency. */
-#ifdef DEBUG_BUILD
- printf("[SDL_Main_ExceptionHandler] : Calling SDL_CloseAudio()!\n");
-#endif
- SDL_CloseAudio();
- }
- }
- return (XCPT_CONTINUE_SEARCH);
-}
-
-
-EXCEPTIONREGISTRATIONRECORD SDL_Main_xcpthand = {0, SDL_Main_ExceptionHandler};
-
-/* The main DLL entry for DLL Initialization and Uninitialization: */
-unsigned _System LibMain(unsigned hmod, unsigned termination)
-{
- if (termination)
- {
-#ifdef DEBUG_BUILD
-/* printf("[SDL DLL Unintialization] : Removing exception handler\n"); */
-#endif
- DosUnsetExceptionHandler(&SDL_Main_xcpthand);
- return 1;
- } else
- {
-#ifdef DEBUG_BUILD
- /* Make stdout and stderr unbuffered! */
- setbuf(stdout, NULL);
- setbuf(stderr, NULL);
-#endif
- /* Fire up exception handler */
-#ifdef DEBUG_BUILD
-/* printf("[SDL DLL Initialization] : Setting exception handler\n"); */
-#endif
- /* Set exception handler */
- DosSetExceptionHandler(&SDL_Main_xcpthand);
-
- return 1;
- }
-}
-#endif /* __WATCOMC__ */
-
-#elif defined(__WIN32__) && !defined(__SYMBIAN32__)
-
-#if !defined(HAVE_LIBC) || (defined(__WATCOMC__) && defined(BUILD_DLL))
-/* Need to include DllMain() on Watcom C for some reason.. */
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-BOOL APIENTRY _DllMainCRTStartup( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved )
-{
- switch (ul_reason_for_call) {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
-#endif /* building DLL with Watcom C */
-
-#endif /* OS/2 elif __WIN32__ */
diff --git a/distrib/sdl-1.2.12/src/SDL_error.c b/distrib/sdl-1.2.12/src/SDL_error.c
deleted file mode 100644
index 11632f2..0000000
--- a/distrib/sdl-1.2.12/src/SDL_error.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Simple error handling in SDL */
-
-#include "SDL_error.h"
-#include "SDL_error_c.h"
-
-/* Routine to get the thread-specific error variable */
-#if SDL_THREADS_DISABLED
-/* The SDL_arraysize(The ),default (non-thread-safe) global error variable */
-static SDL_error SDL_global_error;
-#define SDL_GetErrBuf() (&SDL_global_error)
-#else
-extern SDL_error *SDL_GetErrBuf(void);
-#endif /* SDL_THREADS_DISABLED */
-
-#define SDL_ERRBUFIZE 1024
-
-/* Private functions */
-
-static const char *SDL_LookupString(const char *key)
-{
- /* FIXME: Add code to lookup key in language string hash-table */
- return key;
-}
-
-/* Public functions */
-
-void SDL_SetError (const char *fmt, ...)
-{
- va_list ap;
- SDL_error *error;
-
- /* Copy in the key, mark error as valid */
- error = SDL_GetErrBuf();
- error->error = 1;
- SDL_strlcpy((char *)error->key, fmt, sizeof(error->key));
-
- va_start(ap, fmt);
- error->argc = 0;
- while ( *fmt ) {
- if ( *fmt++ == '%' ) {
- while ( *fmt == '.' || (*fmt >= '0' && *fmt <= '9') ) {
- ++fmt;
- }
- switch (*fmt++) {
- case 0: /* Malformed format string.. */
- --fmt;
- break;
- case 'c':
- case 'i':
- case 'd':
- case 'u':
- case 'o':
- case 'x':
- case 'X':
- error->args[error->argc++].value_i =
- va_arg(ap, int);
- break;
- case 'f':
- error->args[error->argc++].value_f =
- va_arg(ap, double);
- break;
- case 'p':
- error->args[error->argc++].value_ptr =
- va_arg(ap, void *);
- break;
- case 's':
- {
- int i = error->argc;
- const char *str = va_arg(ap, const char *);
- if (str == NULL)
- str = "(null)";
- SDL_strlcpy((char *)error->args[i].buf, str, ERR_MAX_STRLEN);
- error->argc++;
- }
- break;
- default:
- break;
- }
- if ( error->argc >= ERR_MAX_ARGS ) {
- break;
- }
- }
- }
- va_end(ap);
-
- /* If we are in debug mode, print out an error message */
-#ifdef DEBUG_ERROR
- fprintf(stderr, "SDL_SetError: %s\n", SDL_GetError());
-#endif
-}
-
-/* This function has a bit more overhead than most error functions
- so that it supports internationalization and thread-safe errors.
-*/
-char *SDL_GetErrorMsg(char *errstr, unsigned int maxlen)
-{
- SDL_error *error;
-
- /* Clear the error string */
- *errstr = '\0'; --maxlen;
-
- /* Get the thread-safe error, and print it out */
- error = SDL_GetErrBuf();
- if ( error->error ) {
- const char *fmt;
- char *msg = errstr;
- int len;
- int argi;
-
- fmt = SDL_LookupString(error->key);
- argi = 0;
- while ( *fmt && (maxlen > 0) ) {
- if ( *fmt == '%' ) {
- char tmp[32], *spot = tmp;
- *spot++ = *fmt++;
- while ( (*fmt == '.' || (*fmt >= '0' && *fmt <= '9')) && spot < (tmp+SDL_arraysize(tmp)-2) ) {
- *spot++ = *fmt++;
- }
- *spot++ = *fmt++;
- *spot++ = '\0';
- switch (spot[-2]) {
- case '%':
- *msg++ = '%';
- maxlen -= 1;
- break;
- case 'c':
- case 'i':
- case 'd':
- case 'u':
- case 'o':
- case 'x':
- case 'X':
- len = SDL_snprintf(msg, maxlen, tmp, error->args[argi++].value_i);
- msg += len;
- maxlen -= len;
- break;
- case 'f':
- len = SDL_snprintf(msg, maxlen, tmp, error->args[argi++].value_f);
- msg += len;
- maxlen -= len;
- break;
- case 'p':
- len = SDL_snprintf(msg, maxlen, tmp, error->args[argi++].value_ptr);
- msg += len;
- maxlen -= len;
- break;
- case 's':
- len = SDL_snprintf(msg, maxlen, tmp, SDL_LookupString(error->args[argi++].buf));
- msg += len;
- maxlen -= len;
- break;
- }
- } else {
- *msg++ = *fmt++;
- maxlen -= 1;
- }
- }
- *msg = 0; /* NULL terminate the string */
- }
- return(errstr);
-}
-
-/* Available for backwards compatibility */
-char *SDL_GetError (void)
-{
- static char errmsg[SDL_ERRBUFIZE];
-
- return((char *)SDL_GetErrorMsg(errmsg, SDL_ERRBUFIZE));
-}
-
-void SDL_ClearError(void)
-{
- SDL_error *error;
-
- error = SDL_GetErrBuf();
- error->error = 0;
-}
-
-/* Very common errors go here */
-void SDL_Error(SDL_errorcode code)
-{
- switch (code) {
- case SDL_ENOMEM:
- SDL_SetError("Out of memory");
- break;
- case SDL_EFREAD:
- SDL_SetError("Error reading from datastream");
- break;
- case SDL_EFWRITE:
- SDL_SetError("Error writing to datastream");
- break;
- case SDL_EFSEEK:
- SDL_SetError("Error seeking in datastream");
- break;
- default:
- SDL_SetError("Unknown SDL error");
- break;
- }
-}
-
-#ifdef TEST_ERROR
-int main(int argc, char *argv[])
-{
- char buffer[BUFSIZ+1];
-
- SDL_SetError("Hi there!");
- printf("Error 1: %s\n", SDL_GetError());
- SDL_ClearError();
- SDL_memset(buffer, '1', BUFSIZ);
- buffer[BUFSIZ] = 0;
- SDL_SetError("This is the error: %s (%f)", buffer, 1.0);
- printf("Error 2: %s\n", SDL_GetError());
- exit(0);
-}
-#endif
diff --git a/distrib/sdl-1.2.12/src/SDL_error_c.h b/distrib/sdl-1.2.12/src/SDL_error_c.h
deleted file mode 100644
index 990acb5..0000000
--- a/distrib/sdl-1.2.12/src/SDL_error_c.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This file defines a structure that carries language-independent
- error messages
-*/
-
-#ifndef _SDL_error_c_h
-#define _SDL_error_c_h
-
-#define ERR_MAX_STRLEN 128
-#define ERR_MAX_ARGS 5
-
-typedef struct SDL_error {
- /* This is a numeric value corresponding to the current error */
- int error;
-
- /* This is a key used to index into a language hashtable containing
- internationalized versions of the SDL error messages. If the key
- is not in the hashtable, or no hashtable is available, the key is
- used directly as an error message format string.
- */
- char key[ERR_MAX_STRLEN];
-
- /* These are the arguments for the error functions */
- int argc;
- union {
- void *value_ptr;
-#if 0 /* What is a character anyway? (UNICODE issues) */
- unsigned char value_c;
-#endif
- int value_i;
- double value_f;
- char buf[ERR_MAX_STRLEN];
- } args[ERR_MAX_ARGS];
-} SDL_error;
-
-#endif /* _SDL_error_c_h */
diff --git a/distrib/sdl-1.2.12/src/SDL_fatal.c b/distrib/sdl-1.2.12/src/SDL_fatal.c
deleted file mode 100644
index 784836b..0000000
--- a/distrib/sdl-1.2.12/src/SDL_fatal.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* General fatal signal handling code for SDL */
-
-#ifdef HAVE_SIGNAL_H
-
-#include <signal.h>
-
-#include "SDL.h"
-#include "SDL_fatal.h"
-
-/* This installs some signal handlers for the more common fatal signals,
- so that if the programmer is lazy, the app doesn't die so horribly if
- the program crashes.
-*/
-
-static void SDL_Parachute(int sig)
-{
- signal(sig, SIG_DFL);
- SDL_Quit();
- raise(sig);
-}
-
-static int SDL_fatal_signals[] = {
- SIGSEGV,
-#ifdef SIGBUS
- SIGBUS,
-#endif
-#ifdef SIGFPE
- SIGFPE,
-#endif
-#ifdef SIGQUIT
- SIGQUIT,
-#endif
- 0
-};
-
-void SDL_InstallParachute(void)
-{
- /* Set a handler for any fatal signal not already handled */
- int i;
-#ifdef HAVE_SIGACTION
- struct sigaction action;
-
- for ( i=0; SDL_fatal_signals[i]; ++i ) {
- sigaction(SDL_fatal_signals[i], NULL, &action);
- if ( action.sa_handler == SIG_DFL ) {
- action.sa_handler = SDL_Parachute;
- sigaction(SDL_fatal_signals[i], &action, NULL);
- }
- }
-#ifdef SIGALRM
- /* Set SIGALRM to be ignored -- necessary on Solaris */
- sigaction(SIGALRM, NULL, &action);
- if ( action.sa_handler == SIG_DFL ) {
- action.sa_handler = SIG_IGN;
- sigaction(SIGALRM, &action, NULL);
- }
-#endif
-#else
- void (*ohandler)(int);
-
- for ( i=0; SDL_fatal_signals[i]; ++i ) {
- ohandler = signal(SDL_fatal_signals[i], SDL_Parachute);
- if ( ohandler != SIG_DFL ) {
- signal(SDL_fatal_signals[i], ohandler);
- }
- }
-#endif /* HAVE_SIGACTION */
- return;
-}
-
-void SDL_UninstallParachute(void)
-{
- /* Remove a handler for any fatal signal handled */
- int i;
-#ifdef HAVE_SIGACTION
- struct sigaction action;
-
- for ( i=0; SDL_fatal_signals[i]; ++i ) {
- sigaction(SDL_fatal_signals[i], NULL, &action);
- if ( action.sa_handler == SDL_Parachute ) {
- action.sa_handler = SIG_DFL;
- sigaction(SDL_fatal_signals[i], &action, NULL);
- }
- }
-#else
- void (*ohandler)(int);
-
- for ( i=0; SDL_fatal_signals[i]; ++i ) {
- ohandler = signal(SDL_fatal_signals[i], SIG_DFL);
- if ( ohandler != SDL_Parachute ) {
- signal(SDL_fatal_signals[i], ohandler);
- }
- }
-#endif /* HAVE_SIGACTION */
-}
-
-#else
-
-/* No signals on this platform, nothing to do.. */
-
-void SDL_InstallParachute(void)
-{
- return;
-}
-
-void SDL_UninstallParachute(void)
-{
- return;
-}
-
-#endif /* HAVE_SIGNAL_H */
diff --git a/distrib/sdl-1.2.12/src/SDL_fatal.h b/distrib/sdl-1.2.12/src/SDL_fatal.h
deleted file mode 100644
index 34b6069..0000000
--- a/distrib/sdl-1.2.12/src/SDL_fatal.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* General fatal signal handling code for SDL */
-
-extern void SDL_InstallParachute(void);
-extern void SDL_UninstallParachute(void);
-
diff --git a/distrib/sdl-1.2.12/src/audio/SDL_audio.c b/distrib/sdl-1.2.12/src/audio/SDL_audio.c
deleted file mode 100644
index 3e2316d..0000000
--- a/distrib/sdl-1.2.12/src/audio/SDL_audio.c
+++ /dev/null
@@ -1,695 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Allow access to a raw mixing buffer */
-
-#include "SDL.h"
-#include "SDL_audio_c.h"
-#include "SDL_audiomem.h"
-#include "SDL_sysaudio.h"
-
-#ifdef __OS2__
-/* We'll need the DosSetPriority() API! */
-#define INCL_DOSPROCESS
-#include <os2.h>
-#endif
-
-/* Available audio drivers */
-static AudioBootStrap *bootstrap[] = {
-#if SDL_AUDIO_DRIVER_BSD
- &BSD_AUDIO_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_OSS
- &DSP_bootstrap,
- &DMA_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_ALSA
- &ALSA_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_PULSE
- &PULSE_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_QNXNTO
- &QNXNTOAUDIO_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_SUNAUDIO
- &SUNAUDIO_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_DMEDIA
- &DMEDIA_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_ARTS
- &ARTS_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_ESD
- &ESD_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_NAS
- &NAS_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_DSOUND
- &DSOUND_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_WAVEOUT
- &WAVEOUT_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_PAUD
- &Paud_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_BAUDIO
- &BAUDIO_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_COREAUDIO
- &COREAUDIO_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_SNDMGR
- &SNDMGR_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_MINT
- &MINTAUDIO_GSXB_bootstrap,
- &MINTAUDIO_MCSN_bootstrap,
- &MINTAUDIO_STFA_bootstrap,
- &MINTAUDIO_XBIOS_bootstrap,
- &MINTAUDIO_DMA8_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_DISK
- &DISKAUD_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_DUMMY
- &DUMMYAUD_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_DC
- &DCAUD_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_NDS
- &NDSAUD_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_MMEAUDIO
- &MMEAUDIO_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_DART
- &DART_bootstrap,
-#endif
-#if SDL_AUDIO_DRIVER_EPOCAUDIO
- &EPOCAudio_bootstrap,
-#endif
- NULL
-};
-SDL_AudioDevice *current_audio = NULL;
-
-/* Various local functions */
-int SDL_AudioInit(const char *driver_name);
-void SDL_AudioQuit(void);
-
-/* The general mixing thread function */
-int SDLCALL SDL_RunAudio(void *audiop)
-{
- SDL_AudioDevice *audio = (SDL_AudioDevice *)audiop;
- Uint8 *stream;
- int stream_len;
- void *udata;
- void (SDLCALL *fill)(void *userdata,Uint8 *stream, int len);
- int silence;
-
- /* Perform any thread setup */
- if ( audio->ThreadInit ) {
- audio->ThreadInit(audio);
- }
- audio->threadid = SDL_ThreadID();
-
- /* Set up the mixing function */
- fill = audio->spec.callback;
- udata = audio->spec.userdata;
-
- if ( audio->convert.needed ) {
- if ( audio->convert.src_format == AUDIO_U8 ) {
- silence = 0x80;
- } else {
- silence = 0;
- }
- stream_len = audio->convert.len;
- } else {
- silence = audio->spec.silence;
- stream_len = audio->spec.size;
- }
-
-#ifdef __OS2__
- /* Increase the priority of this thread to make sure that
- the audio will be continuous all the time! */
-#ifdef USE_DOSSETPRIORITY
- if (SDL_getenv("SDL_USE_TIMECRITICAL_AUDIO"))
- {
-#ifdef DEBUG_BUILD
- printf("[SDL_RunAudio] : Setting priority to TimeCritical+0! (TID%d)\n", SDL_ThreadID());
-#endif
- DosSetPriority(PRTYS_THREAD, PRTYC_TIMECRITICAL, 0, 0);
- }
- else
- {
-#ifdef DEBUG_BUILD
- printf("[SDL_RunAudio] : Setting priority to ForegroundServer+0! (TID%d)\n", SDL_ThreadID());
-#endif
- DosSetPriority(PRTYS_THREAD, PRTYC_FOREGROUNDSERVER, 0, 0);
- }
-#endif
-#endif
-
- /* Loop, filling the audio buffers */
- while ( audio->enabled ) {
-
- /* Fill the current buffer with sound */
- if ( audio->convert.needed ) {
- if ( audio->convert.buf ) {
- stream = audio->convert.buf;
- } else {
- continue;
- }
- } else {
- stream = audio->GetAudioBuf(audio);
- if ( stream == NULL ) {
- stream = audio->fake_stream;
- }
- }
-
- SDL_memset(stream, silence, stream_len);
-
- if ( ! audio->paused ) {
- SDL_mutexP(audio->mixer_lock);
- (*fill)(udata, stream, stream_len);
- SDL_mutexV(audio->mixer_lock);
- }
-
- /* Convert the audio if necessary */
- if ( audio->convert.needed ) {
- SDL_ConvertAudio(&audio->convert);
- stream = audio->GetAudioBuf(audio);
- if ( stream == NULL ) {
- stream = audio->fake_stream;
- }
- SDL_memcpy(stream, audio->convert.buf,
- audio->convert.len_cvt);
- }
-
- /* Ready current buffer for play and change current buffer */
- if ( stream != audio->fake_stream ) {
- audio->PlayAudio(audio);
- }
-
- /* Wait for an audio buffer to become available */
- if ( stream == audio->fake_stream ) {
- SDL_Delay((audio->spec.samples*1000)/audio->spec.freq);
- } else {
- audio->WaitAudio(audio);
- }
- }
-
- /* Wait for the audio to drain.. */
- if ( audio->WaitDone ) {
- audio->WaitDone(audio);
- }
-
-#ifdef __OS2__
-#ifdef DEBUG_BUILD
- printf("[SDL_RunAudio] : Task exiting. (TID%d)\n", SDL_ThreadID());
-#endif
-#endif
- return(0);
-}
-
-static void SDL_LockAudio_Default(SDL_AudioDevice *audio)
-{
- if ( audio->thread && (SDL_ThreadID() == audio->threadid) ) {
- return;
- }
- SDL_mutexP(audio->mixer_lock);
-}
-
-static void SDL_UnlockAudio_Default(SDL_AudioDevice *audio)
-{
- if ( audio->thread && (SDL_ThreadID() == audio->threadid) ) {
- return;
- }
- SDL_mutexV(audio->mixer_lock);
-}
-
-static Uint16 SDL_ParseAudioFormat(const char *string)
-{
- Uint16 format = 0;
-
- switch (*string) {
- case 'U':
- ++string;
- format |= 0x0000;
- break;
- case 'S':
- ++string;
- format |= 0x8000;
- break;
- default:
- return 0;
- }
- switch (SDL_atoi(string)) {
- case 8:
- string += 1;
- format |= 8;
- break;
- case 16:
- string += 2;
- format |= 16;
- if ( SDL_strcmp(string, "LSB") == 0
-#if SDL_BYTEORDER == SDL_LIL_ENDIAN
- || SDL_strcmp(string, "SYS") == 0
-#endif
- ) {
- format |= 0x0000;
- }
- if ( SDL_strcmp(string, "MSB") == 0
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
- || SDL_strcmp(string, "SYS") == 0
-#endif
- ) {
- format |= 0x1000;
- }
- break;
- default:
- return 0;
- }
- return format;
-}
-
-int SDL_AudioInit(const char *driver_name)
-{
- SDL_AudioDevice *audio;
- int i = 0, idx;
-
- /* Check to make sure we don't overwrite 'current_audio' */
- if ( current_audio != NULL ) {
- SDL_AudioQuit();
- }
-
- /* Select the proper audio driver */
- audio = NULL;
- idx = 0;
-#if SDL_AUDIO_DRIVER_ESD
- if ( (driver_name == NULL) && (SDL_getenv("ESPEAKER") != NULL) ) {
- /* Ahem, we know that if ESPEAKER is set, user probably wants
- to use ESD, but don't start it if it's not already running.
- This probably isn't the place to do this, but... Shh! :)
- */
- for ( i=0; bootstrap[i]; ++i ) {
- if ( SDL_strcasecmp(bootstrap[i]->name, "esd") == 0 ) {
-#ifdef HAVE_PUTENV
- const char *esd_no_spawn;
-
- /* Don't start ESD if it's not running */
- esd_no_spawn = getenv("ESD_NO_SPAWN");
- if ( esd_no_spawn == NULL ) {
- putenv("ESD_NO_SPAWN=1");
- }
-#endif
- if ( bootstrap[i]->available() ) {
- audio = bootstrap[i]->create(0);
- break;
- }
-#ifdef HAVE_UNSETENV
- if ( esd_no_spawn == NULL ) {
- unsetenv("ESD_NO_SPAWN");
- }
-#endif
- }
- }
- }
-#endif /* SDL_AUDIO_DRIVER_ESD */
- if ( audio == NULL ) {
- if ( driver_name != NULL ) {
-#if 0 /* This will be replaced with a better driver selection API */
- if ( SDL_strrchr(driver_name, ':') != NULL ) {
- idx = atoi(SDL_strrchr(driver_name, ':')+1);
- }
-#endif
- for ( i=0; bootstrap[i]; ++i ) {
- if (SDL_strcasecmp(bootstrap[i]->name, driver_name) == 0) {
- if ( bootstrap[i]->available() ) {
- audio=bootstrap[i]->create(idx);
- break;
- }
- }
- }
- } else {
- for ( i=0; bootstrap[i]; ++i ) {
- if ( bootstrap[i]->available() ) {
- audio = bootstrap[i]->create(idx);
- if ( audio != NULL ) {
- break;
- }
- }
- }
- }
- if ( audio == NULL ) {
- SDL_SetError("No available audio device");
-#if 0 /* Don't fail SDL_Init() if audio isn't available.
- SDL_OpenAudio() will handle it at that point. *sigh*
- */
- return(-1);
-#endif
- }
- }
- current_audio = audio;
- if ( current_audio ) {
- current_audio->name = bootstrap[i]->name;
- if ( !current_audio->LockAudio && !current_audio->UnlockAudio ) {
- current_audio->LockAudio = SDL_LockAudio_Default;
- current_audio->UnlockAudio = SDL_UnlockAudio_Default;
- }
- }
- return(0);
-}
-
-char *SDL_AudioDriverName(char *namebuf, int maxlen)
-{
- if ( current_audio != NULL ) {
- SDL_strlcpy(namebuf, current_audio->name, maxlen);
- return(namebuf);
- }
- return(NULL);
-}
-
-int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained)
-{
- SDL_AudioDevice *audio;
- const char *env;
-
- /* Start up the audio driver, if necessary */
- if ( ! current_audio ) {
- if ( (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) ||
- (current_audio == NULL) ) {
- return(-1);
- }
- }
- audio = current_audio;
-
- if (audio->opened) {
- SDL_SetError("Audio device is already opened");
- return(-1);
- }
-
- /* Verify some parameters */
- if ( desired->freq == 0 ) {
- env = SDL_getenv("SDL_AUDIO_FREQUENCY");
- if ( env ) {
- desired->freq = SDL_atoi(env);
- }
- }
- if ( desired->freq == 0 ) {
- /* Pick some default audio frequency */
- desired->freq = 22050;
- }
- if ( desired->format == 0 ) {
- env = SDL_getenv("SDL_AUDIO_FORMAT");
- if ( env ) {
- desired->format = SDL_ParseAudioFormat(env);
- }
- }
- if ( desired->format == 0 ) {
- /* Pick some default audio format */
- desired->format = AUDIO_S16;
- }
- if ( desired->channels == 0 ) {
- env = SDL_getenv("SDL_AUDIO_CHANNELS");
- if ( env ) {
- desired->channels = (Uint8)SDL_atoi(env);
- }
- }
- if ( desired->channels == 0 ) {
- /* Pick a default number of channels */
- desired->channels = 2;
- }
- switch ( desired->channels ) {
- case 1: /* Mono */
- case 2: /* Stereo */
- case 4: /* surround */
- case 6: /* surround with center and lfe */
- break;
- default:
- SDL_SetError("1 (mono) and 2 (stereo) channels supported");
- return(-1);
- }
- if ( desired->samples == 0 ) {
- env = SDL_getenv("SDL_AUDIO_SAMPLES");
- if ( env ) {
- desired->samples = (Uint16)SDL_atoi(env);
- }
- }
- if ( desired->samples == 0 ) {
- /* Pick a default of ~46 ms at desired frequency */
- int samples = (desired->freq / 1000) * 46;
- int power2 = 1;
- while ( power2 < samples ) {
- power2 *= 2;
- }
- desired->samples = power2;
- }
- if ( desired->callback == NULL ) {
- SDL_SetError("SDL_OpenAudio() passed a NULL callback");
- return(-1);
- }
-
-#if SDL_THREADS_DISABLED
- /* Uses interrupt driven audio, without thread */
-#else
- /* Create a semaphore for locking the sound buffers */
- audio->mixer_lock = SDL_CreateMutex();
- if ( audio->mixer_lock == NULL ) {
- SDL_SetError("Couldn't create mixer lock");
- SDL_CloseAudio();
- return(-1);
- }
-#endif /* SDL_THREADS_DISABLED */
-
- /* Calculate the silence and size of the audio specification */
- SDL_CalculateAudioSpec(desired);
-
- /* Open the audio subsystem */
- SDL_memcpy(&audio->spec, desired, sizeof(audio->spec));
- audio->convert.needed = 0;
- audio->enabled = 1;
- audio->paused = 1;
-
- audio->opened = audio->OpenAudio(audio, &audio->spec)+1;
-
- if ( ! audio->opened ) {
- SDL_CloseAudio();
- return(-1);
- }
-
- /* If the audio driver changes the buffer size, accept it */
- if ( audio->spec.samples != desired->samples ) {
- desired->samples = audio->spec.samples;
- SDL_CalculateAudioSpec(desired);
- }
-
- /* Allocate a fake audio memory buffer */
- audio->fake_stream = SDL_AllocAudioMem(audio->spec.size);
- if ( audio->fake_stream == NULL ) {
- SDL_CloseAudio();
- SDL_OutOfMemory();
- return(-1);
- }
-
- /* See if we need to do any conversion */
- if ( obtained != NULL ) {
- SDL_memcpy(obtained, &audio->spec, sizeof(audio->spec));
- } else if ( desired->freq != audio->spec.freq ||
- desired->format != audio->spec.format ||
- desired->channels != audio->spec.channels ) {
- /* Build an audio conversion block */
- if ( SDL_BuildAudioCVT(&audio->convert,
- desired->format, desired->channels,
- desired->freq,
- audio->spec.format, audio->spec.channels,
- audio->spec.freq) < 0 ) {
- SDL_CloseAudio();
- return(-1);
- }
- if ( audio->convert.needed ) {
- audio->convert.len = (int) ( ((double) desired->size) /
- audio->convert.len_ratio );
- audio->convert.buf =(Uint8 *)SDL_AllocAudioMem(
- audio->convert.len*audio->convert.len_mult);
- if ( audio->convert.buf == NULL ) {
- SDL_CloseAudio();
- SDL_OutOfMemory();
- return(-1);
- }
- }
- }
-
- /* Start the audio thread if necessary */
- switch (audio->opened) {
- case 1:
- /* Start the audio thread */
-#if (defined(__WIN32__) && !defined(_WIN32_WCE)) && !defined(HAVE_LIBC) && !defined(__SYMBIAN32__)
-#undef SDL_CreateThread
- audio->thread = SDL_CreateThread(SDL_RunAudio, audio, NULL, NULL);
-#else
- audio->thread = SDL_CreateThread(SDL_RunAudio, audio);
-#endif
- if ( audio->thread == NULL ) {
- SDL_CloseAudio();
- SDL_SetError("Couldn't create audio thread");
- return(-1);
- }
- break;
-
- default:
- /* The audio is now playing */
- break;
- }
-
- return(0);
-}
-
-SDL_audiostatus SDL_GetAudioStatus(void)
-{
- SDL_AudioDevice *audio = current_audio;
- SDL_audiostatus status;
-
- status = SDL_AUDIO_STOPPED;
- if ( audio && audio->enabled ) {
- if ( audio->paused ) {
- status = SDL_AUDIO_PAUSED;
- } else {
- status = SDL_AUDIO_PLAYING;
- }
- }
- return(status);
-}
-
-void SDL_PauseAudio (int pause_on)
-{
- SDL_AudioDevice *audio = current_audio;
-
- if ( audio ) {
- audio->paused = pause_on;
- }
-}
-
-void SDL_LockAudio (void)
-{
- SDL_AudioDevice *audio = current_audio;
-
- /* Obtain a lock on the mixing buffers */
- if ( audio && audio->LockAudio ) {
- audio->LockAudio(audio);
- }
-}
-
-void SDL_UnlockAudio (void)
-{
- SDL_AudioDevice *audio = current_audio;
-
- /* Release lock on the mixing buffers */
- if ( audio && audio->UnlockAudio ) {
- audio->UnlockAudio(audio);
- }
-}
-
-void SDL_CloseAudio (void)
-{
- SDL_QuitSubSystem(SDL_INIT_AUDIO);
-}
-
-void SDL_AudioQuit(void)
-{
- SDL_AudioDevice *audio = current_audio;
-
- if ( audio ) {
- audio->enabled = 0;
- if ( audio->thread != NULL ) {
- SDL_WaitThread(audio->thread, NULL);
- }
- if ( audio->mixer_lock != NULL ) {
- SDL_DestroyMutex(audio->mixer_lock);
- }
- if ( audio->fake_stream != NULL ) {
- SDL_FreeAudioMem(audio->fake_stream);
- }
- if ( audio->convert.needed ) {
- SDL_FreeAudioMem(audio->convert.buf);
-
- }
- if ( audio->opened ) {
- audio->CloseAudio(audio);
- audio->opened = 0;
- }
- /* Free the driver data */
- audio->free(audio);
- current_audio = NULL;
- }
-}
-
-#define NUM_FORMATS 6
-static int format_idx;
-static int format_idx_sub;
-static Uint16 format_list[NUM_FORMATS][NUM_FORMATS] = {
- { AUDIO_U8, AUDIO_S8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB },
- { AUDIO_S8, AUDIO_U8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB },
- { AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_U8, AUDIO_S8 },
- { AUDIO_S16MSB, AUDIO_S16LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_U8, AUDIO_S8 },
- { AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U8, AUDIO_S8 },
- { AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_S16MSB, AUDIO_S16LSB, AUDIO_U8, AUDIO_S8 },
-};
-
-Uint16 SDL_FirstAudioFormat(Uint16 format)
-{
- for ( format_idx=0; format_idx < NUM_FORMATS; ++format_idx ) {
- if ( format_list[format_idx][0] == format ) {
- break;
- }
- }
- format_idx_sub = 0;
- return(SDL_NextAudioFormat());
-}
-
-Uint16 SDL_NextAudioFormat(void)
-{
- if ( (format_idx == NUM_FORMATS) || (format_idx_sub == NUM_FORMATS) ) {
- return(0);
- }
- return(format_list[format_idx][format_idx_sub++]);
-}
-
-void SDL_CalculateAudioSpec(SDL_AudioSpec *spec)
-{
- switch (spec->format) {
- case AUDIO_U8:
- spec->silence = 0x80;
- break;
- default:
- spec->silence = 0x00;
- break;
- }
- spec->size = (spec->format&0xFF)/8;
- spec->size *= spec->channels;
- spec->size *= spec->samples;
-}
diff --git a/distrib/sdl-1.2.12/src/audio/SDL_audio_c.h b/distrib/sdl-1.2.12/src/audio/SDL_audio_c.h
deleted file mode 100644
index f584895..0000000
--- a/distrib/sdl-1.2.12/src/audio/SDL_audio_c.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Functions and variables exported from SDL_audio.c for SDL_sysaudio.c */
-
-/* Functions to get a list of "close" audio formats */
-extern Uint16 SDL_FirstAudioFormat(Uint16 format);
-extern Uint16 SDL_NextAudioFormat(void);
-
-/* Function to calculate the size and silence for a SDL_AudioSpec */
-extern void SDL_CalculateAudioSpec(SDL_AudioSpec *spec);
-
-/* The actual mixing thread function */
-extern int SDLCALL SDL_RunAudio(void *audiop);
diff --git a/distrib/sdl-1.2.12/src/audio/SDL_audiocvt.c b/distrib/sdl-1.2.12/src/audio/SDL_audiocvt.c
deleted file mode 100644
index 68c99e1..0000000
--- a/distrib/sdl-1.2.12/src/audio/SDL_audiocvt.c
+++ /dev/null
@@ -1,1510 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Functions for audio drivers to perform runtime conversion of audio format */
-
-#include "SDL_audio.h"
-
-
-/* Effectively mix right and left channels into a single channel */
-void SDLCALL SDL_ConvertMono(SDL_AudioCVT *cvt, Uint16 format)
-{
- int i;
- Sint32 sample;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting to mono\n");
-#endif
- switch (format&0x8018) {
-
- case AUDIO_U8: {
- Uint8 *src, *dst;
-
- src = cvt->buf;
- dst = cvt->buf;
- for ( i=cvt->len_cvt/2; i; --i ) {
- sample = src[0] + src[1];
- *dst = (Uint8)(sample / 2);
- src += 2;
- dst += 1;
- }
- }
- break;
-
- case AUDIO_S8: {
- Sint8 *src, *dst;
-
- src = (Sint8 *)cvt->buf;
- dst = (Sint8 *)cvt->buf;
- for ( i=cvt->len_cvt/2; i; --i ) {
- sample = src[0] + src[1];
- *dst = (Sint8)(sample / 2);
- src += 2;
- dst += 1;
- }
- }
- break;
-
- case AUDIO_U16: {
- Uint8 *src, *dst;
-
- src = cvt->buf;
- dst = cvt->buf;
- if ( (format & 0x1000) == 0x1000 ) {
- for ( i=cvt->len_cvt/4; i; --i ) {
- sample = (Uint16)((src[0]<<8)|src[1])+
- (Uint16)((src[2]<<8)|src[3]);
- sample /= 2;
- dst[1] = (sample&0xFF);
- sample >>= 8;
- dst[0] = (sample&0xFF);
- src += 4;
- dst += 2;
- }
- } else {
- for ( i=cvt->len_cvt/4; i; --i ) {
- sample = (Uint16)((src[1]<<8)|src[0])+
- (Uint16)((src[3]<<8)|src[2]);
- sample /= 2;
- dst[0] = (sample&0xFF);
- sample >>= 8;
- dst[1] = (sample&0xFF);
- src += 4;
- dst += 2;
- }
- }
- }
- break;
-
- case AUDIO_S16: {
- Uint8 *src, *dst;
-
- src = cvt->buf;
- dst = cvt->buf;
- if ( (format & 0x1000) == 0x1000 ) {
- for ( i=cvt->len_cvt/4; i; --i ) {
- sample = (Sint16)((src[0]<<8)|src[1])+
- (Sint16)((src[2]<<8)|src[3]);
- sample /= 2;
- dst[1] = (sample&0xFF);
- sample >>= 8;
- dst[0] = (sample&0xFF);
- src += 4;
- dst += 2;
- }
- } else {
- for ( i=cvt->len_cvt/4; i; --i ) {
- sample = (Sint16)((src[1]<<8)|src[0])+
- (Sint16)((src[3]<<8)|src[2]);
- sample /= 2;
- dst[0] = (sample&0xFF);
- sample >>= 8;
- dst[1] = (sample&0xFF);
- src += 4;
- dst += 2;
- }
- }
- }
- break;
- }
- cvt->len_cvt /= 2;
- if ( cvt->filters[++cvt->filter_index] ) {
- cvt->filters[cvt->filter_index](cvt, format);
- }
-}
-
-/* Discard top 4 channels */
-void SDLCALL SDL_ConvertStrip(SDL_AudioCVT *cvt, Uint16 format)
-{
- int i;
- Sint32 lsample, rsample;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting down to stereo\n");
-#endif
- switch (format&0x8018) {
-
- case AUDIO_U8: {
- Uint8 *src, *dst;
-
- src = cvt->buf;
- dst = cvt->buf;
- for ( i=cvt->len_cvt/6; i; --i ) {
- dst[0] = src[0];
- dst[1] = src[1];
- src += 6;
- dst += 2;
- }
- }
- break;
-
- case AUDIO_S8: {
- Sint8 *src, *dst;
-
- src = (Sint8 *)cvt->buf;
- dst = (Sint8 *)cvt->buf;
- for ( i=cvt->len_cvt/6; i; --i ) {
- dst[0] = src[0];
- dst[1] = src[1];
- src += 6;
- dst += 2;
- }
- }
- break;
-
- case AUDIO_U16: {
- Uint8 *src, *dst;
-
- src = cvt->buf;
- dst = cvt->buf;
- if ( (format & 0x1000) == 0x1000 ) {
- for ( i=cvt->len_cvt/12; i; --i ) {
- lsample = (Uint16)((src[0]<<8)|src[1]);
- rsample = (Uint16)((src[2]<<8)|src[3]);
- dst[1] = (lsample&0xFF);
- lsample >>= 8;
- dst[0] = (lsample&0xFF);
- dst[3] = (rsample&0xFF);
- rsample >>= 8;
- dst[2] = (rsample&0xFF);
- src += 12;
- dst += 4;
- }
- } else {
- for ( i=cvt->len_cvt/12; i; --i ) {
- lsample = (Uint16)((src[1]<<8)|src[0]);
- rsample = (Uint16)((src[3]<<8)|src[2]);
- dst[0] = (lsample&0xFF);
- lsample >>= 8;
- dst[1] = (lsample&0xFF);
- dst[2] = (rsample&0xFF);
- rsample >>= 8;
- dst[3] = (rsample&0xFF);
- src += 12;
- dst += 4;
- }
- }
- }
- break;
-
- case AUDIO_S16: {
- Uint8 *src, *dst;
-
- src = cvt->buf;
- dst = cvt->buf;
- if ( (format & 0x1000) == 0x1000 ) {
- for ( i=cvt->len_cvt/12; i; --i ) {
- lsample = (Sint16)((src[0]<<8)|src[1]);
- rsample = (Sint16)((src[2]<<8)|src[3]);
- dst[1] = (lsample&0xFF);
- lsample >>= 8;
- dst[0] = (lsample&0xFF);
- dst[3] = (rsample&0xFF);
- rsample >>= 8;
- dst[2] = (rsample&0xFF);
- src += 12;
- dst += 4;
- }
- } else {
- for ( i=cvt->len_cvt/12; i; --i ) {
- lsample = (Sint16)((src[1]<<8)|src[0]);
- rsample = (Sint16)((src[3]<<8)|src[2]);
- dst[0] = (lsample&0xFF);
- lsample >>= 8;
- dst[1] = (lsample&0xFF);
- dst[2] = (rsample&0xFF);
- rsample >>= 8;
- dst[3] = (rsample&0xFF);
- src += 12;
- dst += 4;
- }
- }
- }
- break;
- }
- cvt->len_cvt /= 3;
- if ( cvt->filters[++cvt->filter_index] ) {
- cvt->filters[cvt->filter_index](cvt, format);
- }
-}
-
-
-/* Discard top 2 channels of 6 */
-void SDLCALL SDL_ConvertStrip_2(SDL_AudioCVT *cvt, Uint16 format)
-{
- int i;
- Sint32 lsample, rsample;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting 6 down to quad\n");
-#endif
- switch (format&0x8018) {
-
- case AUDIO_U8: {
- Uint8 *src, *dst;
-
- src = cvt->buf;
- dst = cvt->buf;
- for ( i=cvt->len_cvt/4; i; --i ) {
- dst[0] = src[0];
- dst[1] = src[1];
- src += 4;
- dst += 2;
- }
- }
- break;
-
- case AUDIO_S8: {
- Sint8 *src, *dst;
-
- src = (Sint8 *)cvt->buf;
- dst = (Sint8 *)cvt->buf;
- for ( i=cvt->len_cvt/4; i; --i ) {
- dst[0] = src[0];
- dst[1] = src[1];
- src += 4;
- dst += 2;
- }
- }
- break;
-
- case AUDIO_U16: {
- Uint8 *src, *dst;
-
- src = cvt->buf;
- dst = cvt->buf;
- if ( (format & 0x1000) == 0x1000 ) {
- for ( i=cvt->len_cvt/8; i; --i ) {
- lsample = (Uint16)((src[0]<<8)|src[1]);
- rsample = (Uint16)((src[2]<<8)|src[3]);
- dst[1] = (lsample&0xFF);
- lsample >>= 8;
- dst[0] = (lsample&0xFF);
- dst[3] = (rsample&0xFF);
- rsample >>= 8;
- dst[2] = (rsample&0xFF);
- src += 8;
- dst += 4;
- }
- } else {
- for ( i=cvt->len_cvt/8; i; --i ) {
- lsample = (Uint16)((src[1]<<8)|src[0]);
- rsample = (Uint16)((src[3]<<8)|src[2]);
- dst[0] = (lsample&0xFF);
- lsample >>= 8;
- dst[1] = (lsample&0xFF);
- dst[2] = (rsample&0xFF);
- rsample >>= 8;
- dst[3] = (rsample&0xFF);
- src += 8;
- dst += 4;
- }
- }
- }
- break;
-
- case AUDIO_S16: {
- Uint8 *src, *dst;
-
- src = cvt->buf;
- dst = cvt->buf;
- if ( (format & 0x1000) == 0x1000 ) {
- for ( i=cvt->len_cvt/8; i; --i ) {
- lsample = (Sint16)((src[0]<<8)|src[1]);
- rsample = (Sint16)((src[2]<<8)|src[3]);
- dst[1] = (lsample&0xFF);
- lsample >>= 8;
- dst[0] = (lsample&0xFF);
- dst[3] = (rsample&0xFF);
- rsample >>= 8;
- dst[2] = (rsample&0xFF);
- src += 8;
- dst += 4;
- }
- } else {
- for ( i=cvt->len_cvt/8; i; --i ) {
- lsample = (Sint16)((src[1]<<8)|src[0]);
- rsample = (Sint16)((src[3]<<8)|src[2]);
- dst[0] = (lsample&0xFF);
- lsample >>= 8;
- dst[1] = (lsample&0xFF);
- dst[2] = (rsample&0xFF);
- rsample >>= 8;
- dst[3] = (rsample&0xFF);
- src += 8;
- dst += 4;
- }
- }
- }
- break;
- }
- cvt->len_cvt /= 2;
- if ( cvt->filters[++cvt->filter_index] ) {
- cvt->filters[cvt->filter_index](cvt, format);
- }
-}
-
-/* Duplicate a mono channel to both stereo channels */
-void SDLCALL SDL_ConvertStereo(SDL_AudioCVT *cvt, Uint16 format)
-{
- int i;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting to stereo\n");
-#endif
- if ( (format & 0xFF) == 16 ) {
- Uint16 *src, *dst;
-
- src = (Uint16 *)(cvt->buf+cvt->len_cvt);
- dst = (Uint16 *)(cvt->buf+cvt->len_cvt*2);
- for ( i=cvt->len_cvt/2; i; --i ) {
- dst -= 2;
- src -= 1;
- dst[0] = src[0];
- dst[1] = src[0];
- }
- } else {
- Uint8 *src, *dst;
-
- src = cvt->buf+cvt->len_cvt;
- dst = cvt->buf+cvt->len_cvt*2;
- for ( i=cvt->len_cvt; i; --i ) {
- dst -= 2;
- src -= 1;
- dst[0] = src[0];
- dst[1] = src[0];
- }
- }
- cvt->len_cvt *= 2;
- if ( cvt->filters[++cvt->filter_index] ) {
- cvt->filters[cvt->filter_index](cvt, format);
- }
-}
-
-
-/* Duplicate a stereo channel to a pseudo-5.1 stream */
-void SDLCALL SDL_ConvertSurround(SDL_AudioCVT *cvt, Uint16 format)
-{
- int i;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting stereo to surround\n");
-#endif
- switch (format&0x8018) {
-
- case AUDIO_U8: {
- Uint8 *src, *dst, lf, rf, ce;
-
- src = (Uint8 *)(cvt->buf+cvt->len_cvt);
- dst = (Uint8 *)(cvt->buf+cvt->len_cvt*3);
- for ( i=cvt->len_cvt; i; --i ) {
- dst -= 6;
- src -= 2;
- lf = src[0];
- rf = src[1];
- ce = (lf/2) + (rf/2);
- dst[0] = lf;
- dst[1] = rf;
- dst[2] = lf - ce;
- dst[3] = rf - ce;
- dst[4] = ce;
- dst[5] = ce;
- }
- }
- break;
-
- case AUDIO_S8: {
- Sint8 *src, *dst, lf, rf, ce;
-
- src = (Sint8 *)cvt->buf+cvt->len_cvt;
- dst = (Sint8 *)cvt->buf+cvt->len_cvt*3;
- for ( i=cvt->len_cvt; i; --i ) {
- dst -= 6;
- src -= 2;
- lf = src[0];
- rf = src[1];
- ce = (lf/2) + (rf/2);
- dst[0] = lf;
- dst[1] = rf;
- dst[2] = lf - ce;
- dst[3] = rf - ce;
- dst[4] = ce;
- dst[5] = ce;
- }
- }
- break;
-
- case AUDIO_U16: {
- Uint8 *src, *dst;
- Uint16 lf, rf, ce, lr, rr;
-
- src = cvt->buf+cvt->len_cvt;
- dst = cvt->buf+cvt->len_cvt*3;
-
- if ( (format & 0x1000) == 0x1000 ) {
- for ( i=cvt->len_cvt/4; i; --i ) {
- dst -= 12;
- src -= 4;
- lf = (Uint16)((src[0]<<8)|src[1]);
- rf = (Uint16)((src[2]<<8)|src[3]);
- ce = (lf/2) + (rf/2);
- rr = lf - ce;
- lr = rf - ce;
- dst[1] = (lf&0xFF);
- dst[0] = ((lf>>8)&0xFF);
- dst[3] = (rf&0xFF);
- dst[2] = ((rf>>8)&0xFF);
-
- dst[1+4] = (lr&0xFF);
- dst[0+4] = ((lr>>8)&0xFF);
- dst[3+4] = (rr&0xFF);
- dst[2+4] = ((rr>>8)&0xFF);
-
- dst[1+8] = (ce&0xFF);
- dst[0+8] = ((ce>>8)&0xFF);
- dst[3+8] = (ce&0xFF);
- dst[2+8] = ((ce>>8)&0xFF);
- }
- } else {
- for ( i=cvt->len_cvt/4; i; --i ) {
- dst -= 12;
- src -= 4;
- lf = (Uint16)((src[1]<<8)|src[0]);
- rf = (Uint16)((src[3]<<8)|src[2]);
- ce = (lf/2) + (rf/2);
- rr = lf - ce;
- lr = rf - ce;
- dst[0] = (lf&0xFF);
- dst[1] = ((lf>>8)&0xFF);
- dst[2] = (rf&0xFF);
- dst[3] = ((rf>>8)&0xFF);
-
- dst[0+4] = (lr&0xFF);
- dst[1+4] = ((lr>>8)&0xFF);
- dst[2+4] = (rr&0xFF);
- dst[3+4] = ((rr>>8)&0xFF);
-
- dst[0+8] = (ce&0xFF);
- dst[1+8] = ((ce>>8)&0xFF);
- dst[2+8] = (ce&0xFF);
- dst[3+8] = ((ce>>8)&0xFF);
- }
- }
- }
- break;
-
- case AUDIO_S16: {
- Uint8 *src, *dst;
- Sint16 lf, rf, ce, lr, rr;
-
- src = cvt->buf+cvt->len_cvt;
- dst = cvt->buf+cvt->len_cvt*3;
-
- if ( (format & 0x1000) == 0x1000 ) {
- for ( i=cvt->len_cvt/4; i; --i ) {
- dst -= 12;
- src -= 4;
- lf = (Sint16)((src[0]<<8)|src[1]);
- rf = (Sint16)((src[2]<<8)|src[3]);
- ce = (lf/2) + (rf/2);
- rr = lf - ce;
- lr = rf - ce;
- dst[1] = (lf&0xFF);
- dst[0] = ((lf>>8)&0xFF);
- dst[3] = (rf&0xFF);
- dst[2] = ((rf>>8)&0xFF);
-
- dst[1+4] = (lr&0xFF);
- dst[0+4] = ((lr>>8)&0xFF);
- dst[3+4] = (rr&0xFF);
- dst[2+4] = ((rr>>8)&0xFF);
-
- dst[1+8] = (ce&0xFF);
- dst[0+8] = ((ce>>8)&0xFF);
- dst[3+8] = (ce&0xFF);
- dst[2+8] = ((ce>>8)&0xFF);
- }
- } else {
- for ( i=cvt->len_cvt/4; i; --i ) {
- dst -= 12;
- src -= 4;
- lf = (Sint16)((src[1]<<8)|src[0]);
- rf = (Sint16)((src[3]<<8)|src[2]);
- ce = (lf/2) + (rf/2);
- rr = lf - ce;
- lr = rf - ce;
- dst[0] = (lf&0xFF);
- dst[1] = ((lf>>8)&0xFF);
- dst[2] = (rf&0xFF);
- dst[3] = ((rf>>8)&0xFF);
-
- dst[0+4] = (lr&0xFF);
- dst[1+4] = ((lr>>8)&0xFF);
- dst[2+4] = (rr&0xFF);
- dst[3+4] = ((rr>>8)&0xFF);
-
- dst[0+8] = (ce&0xFF);
- dst[1+8] = ((ce>>8)&0xFF);
- dst[2+8] = (ce&0xFF);
- dst[3+8] = ((ce>>8)&0xFF);
- }
- }
- }
- break;
- }
- cvt->len_cvt *= 3;
- if ( cvt->filters[++cvt->filter_index] ) {
- cvt->filters[cvt->filter_index](cvt, format);
- }
-}
-
-
-/* Duplicate a stereo channel to a pseudo-4.0 stream */
-void SDLCALL SDL_ConvertSurround_4(SDL_AudioCVT *cvt, Uint16 format)
-{
- int i;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting stereo to quad\n");
-#endif
- switch (format&0x8018) {
-
- case AUDIO_U8: {
- Uint8 *src, *dst, lf, rf, ce;
-
- src = (Uint8 *)(cvt->buf+cvt->len_cvt);
- dst = (Uint8 *)(cvt->buf+cvt->len_cvt*2);
- for ( i=cvt->len_cvt; i; --i ) {
- dst -= 4;
- src -= 2;
- lf = src[0];
- rf = src[1];
- ce = (lf/2) + (rf/2);
- dst[0] = lf;
- dst[1] = rf;
- dst[2] = lf - ce;
- dst[3] = rf - ce;
- }
- }
- break;
-
- case AUDIO_S8: {
- Sint8 *src, *dst, lf, rf, ce;
-
- src = (Sint8 *)cvt->buf+cvt->len_cvt;
- dst = (Sint8 *)cvt->buf+cvt->len_cvt*2;
- for ( i=cvt->len_cvt; i; --i ) {
- dst -= 4;
- src -= 2;
- lf = src[0];
- rf = src[1];
- ce = (lf/2) + (rf/2);
- dst[0] = lf;
- dst[1] = rf;
- dst[2] = lf - ce;
- dst[3] = rf - ce;
- }
- }
- break;
-
- case AUDIO_U16: {
- Uint8 *src, *dst;
- Uint16 lf, rf, ce, lr, rr;
-
- src = cvt->buf+cvt->len_cvt;
- dst = cvt->buf+cvt->len_cvt*2;
-
- if ( (format & 0x1000) == 0x1000 ) {
- for ( i=cvt->len_cvt/4; i; --i ) {
- dst -= 8;
- src -= 4;
- lf = (Uint16)((src[0]<<8)|src[1]);
- rf = (Uint16)((src[2]<<8)|src[3]);
- ce = (lf/2) + (rf/2);
- rr = lf - ce;
- lr = rf - ce;
- dst[1] = (lf&0xFF);
- dst[0] = ((lf>>8)&0xFF);
- dst[3] = (rf&0xFF);
- dst[2] = ((rf>>8)&0xFF);
-
- dst[1+4] = (lr&0xFF);
- dst[0+4] = ((lr>>8)&0xFF);
- dst[3+4] = (rr&0xFF);
- dst[2+4] = ((rr>>8)&0xFF);
- }
- } else {
- for ( i=cvt->len_cvt/4; i; --i ) {
- dst -= 8;
- src -= 4;
- lf = (Uint16)((src[1]<<8)|src[0]);
- rf = (Uint16)((src[3]<<8)|src[2]);
- ce = (lf/2) + (rf/2);
- rr = lf - ce;
- lr = rf - ce;
- dst[0] = (lf&0xFF);
- dst[1] = ((lf>>8)&0xFF);
- dst[2] = (rf&0xFF);
- dst[3] = ((rf>>8)&0xFF);
-
- dst[0+4] = (lr&0xFF);
- dst[1+4] = ((lr>>8)&0xFF);
- dst[2+4] = (rr&0xFF);
- dst[3+4] = ((rr>>8)&0xFF);
- }
- }
- }
- break;
-
- case AUDIO_S16: {
- Uint8 *src, *dst;
- Sint16 lf, rf, ce, lr, rr;
-
- src = cvt->buf+cvt->len_cvt;
- dst = cvt->buf+cvt->len_cvt*2;
-
- if ( (format & 0x1000) == 0x1000 ) {
- for ( i=cvt->len_cvt/4; i; --i ) {
- dst -= 8;
- src -= 4;
- lf = (Sint16)((src[0]<<8)|src[1]);
- rf = (Sint16)((src[2]<<8)|src[3]);
- ce = (lf/2) + (rf/2);
- rr = lf - ce;
- lr = rf - ce;
- dst[1] = (lf&0xFF);
- dst[0] = ((lf>>8)&0xFF);
- dst[3] = (rf&0xFF);
- dst[2] = ((rf>>8)&0xFF);
-
- dst[1+4] = (lr&0xFF);
- dst[0+4] = ((lr>>8)&0xFF);
- dst[3+4] = (rr&0xFF);
- dst[2+4] = ((rr>>8)&0xFF);
- }
- } else {
- for ( i=cvt->len_cvt/4; i; --i ) {
- dst -= 8;
- src -= 4;
- lf = (Sint16)((src[1]<<8)|src[0]);
- rf = (Sint16)((src[3]<<8)|src[2]);
- ce = (lf/2) + (rf/2);
- rr = lf - ce;
- lr = rf - ce;
- dst[0] = (lf&0xFF);
- dst[1] = ((lf>>8)&0xFF);
- dst[2] = (rf&0xFF);
- dst[3] = ((rf>>8)&0xFF);
-
- dst[0+4] = (lr&0xFF);
- dst[1+4] = ((lr>>8)&0xFF);
- dst[2+4] = (rr&0xFF);
- dst[3+4] = ((rr>>8)&0xFF);
- }
- }
- }
- break;
- }
- cvt->len_cvt *= 2;
- if ( cvt->filters[++cvt->filter_index] ) {
- cvt->filters[cvt->filter_index](cvt, format);
- }
-}
-
-
-/* Convert 8-bit to 16-bit - LSB */
-void SDLCALL SDL_Convert16LSB(SDL_AudioCVT *cvt, Uint16 format)
-{
- int i;
- Uint8 *src, *dst;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting to 16-bit LSB\n");
-#endif
- src = cvt->buf+cvt->len_cvt;
- dst = cvt->buf+cvt->len_cvt*2;
- for ( i=cvt->len_cvt; i; --i ) {
- src -= 1;
- dst -= 2;
- dst[1] = *src;
- dst[0] = 0;
- }
- format = ((format & ~0x0008) | AUDIO_U16LSB);
- cvt->len_cvt *= 2;
- if ( cvt->filters[++cvt->filter_index] ) {
- cvt->filters[cvt->filter_index](cvt, format);
- }
-}
-/* Convert 8-bit to 16-bit - MSB */
-void SDLCALL SDL_Convert16MSB(SDL_AudioCVT *cvt, Uint16 format)
-{
- int i;
- Uint8 *src, *dst;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting to 16-bit MSB\n");
-#endif
- src = cvt->buf+cvt->len_cvt;
- dst = cvt->buf+cvt->len_cvt*2;
- for ( i=cvt->len_cvt; i; --i ) {
- src -= 1;
- dst -= 2;
- dst[0] = *src;
- dst[1] = 0;
- }
- format = ((format & ~0x0008) | AUDIO_U16MSB);
- cvt->len_cvt *= 2;
- if ( cvt->filters[++cvt->filter_index] ) {
- cvt->filters[cvt->filter_index](cvt, format);
- }
-}
-
-/* Convert 16-bit to 8-bit */
-void SDLCALL SDL_Convert8(SDL_AudioCVT *cvt, Uint16 format)
-{
- int i;
- Uint8 *src, *dst;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting to 8-bit\n");
-#endif
- src = cvt->buf;
- dst = cvt->buf;
- if ( (format & 0x1000) != 0x1000 ) { /* Little endian */
- ++src;
- }
- for ( i=cvt->len_cvt/2; i; --i ) {
- *dst = *src;
- src += 2;
- dst += 1;
- }
- format = ((format & ~0x9010) | AUDIO_U8);
- cvt->len_cvt /= 2;
- if ( cvt->filters[++cvt->filter_index] ) {
- cvt->filters[cvt->filter_index](cvt, format);
- }
-}
-
-/* Toggle signed/unsigned */
-void SDLCALL SDL_ConvertSign(SDL_AudioCVT *cvt, Uint16 format)
-{
- int i;
- Uint8 *data;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting audio signedness\n");
-#endif
- data = cvt->buf;
- if ( (format & 0xFF) == 16 ) {
- if ( (format & 0x1000) != 0x1000 ) { /* Little endian */
- ++data;
- }
- for ( i=cvt->len_cvt/2; i; --i ) {
- *data ^= 0x80;
- data += 2;
- }
- } else {
- for ( i=cvt->len_cvt; i; --i ) {
- *data++ ^= 0x80;
- }
- }
- format = (format ^ 0x8000);
- if ( cvt->filters[++cvt->filter_index] ) {
- cvt->filters[cvt->filter_index](cvt, format);
- }
-}
-
-/* Toggle endianness */
-void SDLCALL SDL_ConvertEndian(SDL_AudioCVT *cvt, Uint16 format)
-{
- int i;
- Uint8 *data, tmp;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting audio endianness\n");
-#endif
- data = cvt->buf;
- for ( i=cvt->len_cvt/2; i; --i ) {
- tmp = data[0];
- data[0] = data[1];
- data[1] = tmp;
- data += 2;
- }
- format = (format ^ 0x1000);
- if ( cvt->filters[++cvt->filter_index] ) {
- cvt->filters[cvt->filter_index](cvt, format);
- }
-}
-
-/* Convert rate up by multiple of 2 */
-void SDLCALL SDL_RateMUL2(SDL_AudioCVT *cvt, Uint16 format)
-{
- int i;
- Uint8 *src, *dst;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting audio rate * 2\n");
-#endif
- src = cvt->buf+cvt->len_cvt;
- dst = cvt->buf+cvt->len_cvt*2;
- switch (format & 0xFF) {
- case 8:
- for ( i=cvt->len_cvt; i; --i ) {
- src -= 1;
- dst -= 2;
- dst[0] = src[0];
- dst[1] = src[0];
- }
- break;
- case 16:
- for ( i=cvt->len_cvt/2; i; --i ) {
- src -= 2;
- dst -= 4;
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[0];
- dst[3] = src[1];
- }
- break;
- }
- cvt->len_cvt *= 2;
- if ( cvt->filters[++cvt->filter_index] ) {
- cvt->filters[cvt->filter_index](cvt, format);
- }
-}
-
-
-/* Convert rate up by multiple of 2, for stereo */
-void SDLCALL SDL_RateMUL2_c2(SDL_AudioCVT *cvt, Uint16 format)
-{
- int i;
- Uint8 *src, *dst;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting audio rate * 2\n");
-#endif
- src = cvt->buf+cvt->len_cvt;
- dst = cvt->buf+cvt->len_cvt*2;
- switch (format & 0xFF) {
- case 8:
- for ( i=cvt->len_cvt/2; i; --i ) {
- src -= 2;
- dst -= 4;
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[0];
- dst[3] = src[1];
- }
- break;
- case 16:
- for ( i=cvt->len_cvt/4; i; --i ) {
- src -= 4;
- dst -= 8;
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- dst[3] = src[3];
- dst[4] = src[0];
- dst[5] = src[1];
- dst[6] = src[2];
- dst[7] = src[3];
- }
- break;
- }
- cvt->len_cvt *= 2;
- if ( cvt->filters[++cvt->filter_index] ) {
- cvt->filters[cvt->filter_index](cvt, format);
- }
-}
-
-/* Convert rate up by multiple of 2, for quad */
-void SDLCALL SDL_RateMUL2_c4(SDL_AudioCVT *cvt, Uint16 format)
-{
- int i;
- Uint8 *src, *dst;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting audio rate * 2\n");
-#endif
- src = cvt->buf+cvt->len_cvt;
- dst = cvt->buf+cvt->len_cvt*2;
- switch (format & 0xFF) {
- case 8:
- for ( i=cvt->len_cvt/4; i; --i ) {
- src -= 4;
- dst -= 8;
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- dst[3] = src[3];
- dst[4] = src[0];
- dst[5] = src[1];
- dst[6] = src[2];
- dst[7] = src[3];
- }
- break;
- case 16:
- for ( i=cvt->len_cvt/8; i; --i ) {
- src -= 8;
- dst -= 16;
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- dst[3] = src[3];
- dst[4] = src[4];
- dst[5] = src[5];
- dst[6] = src[6];
- dst[7] = src[7];
- dst[8] = src[0];
- dst[9] = src[1];
- dst[10] = src[2];
- dst[11] = src[3];
- dst[12] = src[4];
- dst[13] = src[5];
- dst[14] = src[6];
- dst[15] = src[7];
- }
- break;
- }
- cvt->len_cvt *= 2;
- if ( cvt->filters[++cvt->filter_index] ) {
- cvt->filters[cvt->filter_index](cvt, format);
- }
-}
-
-
-/* Convert rate up by multiple of 2, for 5.1 */
-void SDLCALL SDL_RateMUL2_c6(SDL_AudioCVT *cvt, Uint16 format)
-{
- int i;
- Uint8 *src, *dst;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting audio rate * 2\n");
-#endif
- src = cvt->buf+cvt->len_cvt;
- dst = cvt->buf+cvt->len_cvt*2;
- switch (format & 0xFF) {
- case 8:
- for ( i=cvt->len_cvt/6; i; --i ) {
- src -= 6;
- dst -= 12;
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- dst[3] = src[3];
- dst[4] = src[4];
- dst[5] = src[5];
- dst[6] = src[0];
- dst[7] = src[1];
- dst[8] = src[2];
- dst[9] = src[3];
- dst[10] = src[4];
- dst[11] = src[5];
- }
- break;
- case 16:
- for ( i=cvt->len_cvt/12; i; --i ) {
- src -= 12;
- dst -= 24;
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- dst[3] = src[3];
- dst[4] = src[4];
- dst[5] = src[5];
- dst[6] = src[6];
- dst[7] = src[7];
- dst[8] = src[8];
- dst[9] = src[9];
- dst[10] = src[10];
- dst[11] = src[11];
- dst[12] = src[0];
- dst[13] = src[1];
- dst[14] = src[2];
- dst[15] = src[3];
- dst[16] = src[4];
- dst[17] = src[5];
- dst[18] = src[6];
- dst[19] = src[7];
- dst[20] = src[8];
- dst[21] = src[9];
- dst[22] = src[10];
- dst[23] = src[11];
- }
- break;
- }
- cvt->len_cvt *= 2;
- if ( cvt->filters[++cvt->filter_index] ) {
- cvt->filters[cvt->filter_index](cvt, format);
- }
-}
-
-/* Convert rate down by multiple of 2 */
-void SDLCALL SDL_RateDIV2(SDL_AudioCVT *cvt, Uint16 format)
-{
- int i;
- Uint8 *src, *dst;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting audio rate / 2\n");
-#endif
- src = cvt->buf;
- dst = cvt->buf;
- switch (format & 0xFF) {
- case 8:
- for ( i=cvt->len_cvt/2; i; --i ) {
- dst[0] = src[0];
- src += 2;
- dst += 1;
- }
- break;
- case 16:
- for ( i=cvt->len_cvt/4; i; --i ) {
- dst[0] = src[0];
- dst[1] = src[1];
- src += 4;
- dst += 2;
- }
- break;
- }
- cvt->len_cvt /= 2;
- if ( cvt->filters[++cvt->filter_index] ) {
- cvt->filters[cvt->filter_index](cvt, format);
- }
-}
-
-
-/* Convert rate down by multiple of 2, for stereo */
-void SDLCALL SDL_RateDIV2_c2(SDL_AudioCVT *cvt, Uint16 format)
-{
- int i;
- Uint8 *src, *dst;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting audio rate / 2\n");
-#endif
- src = cvt->buf;
- dst = cvt->buf;
- switch (format & 0xFF) {
- case 8:
- for ( i=cvt->len_cvt/4; i; --i ) {
- dst[0] = src[0];
- dst[1] = src[1];
- src += 4;
- dst += 2;
- }
- break;
- case 16:
- for ( i=cvt->len_cvt/8; i; --i ) {
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- dst[3] = src[3];
- src += 8;
- dst += 4;
- }
- break;
- }
- cvt->len_cvt /= 2;
- if ( cvt->filters[++cvt->filter_index] ) {
- cvt->filters[cvt->filter_index](cvt, format);
- }
-}
-
-
-/* Convert rate down by multiple of 2, for quad */
-void SDLCALL SDL_RateDIV2_c4(SDL_AudioCVT *cvt, Uint16 format)
-{
- int i;
- Uint8 *src, *dst;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting audio rate / 2\n");
-#endif
- src = cvt->buf;
- dst = cvt->buf;
- switch (format & 0xFF) {
- case 8:
- for ( i=cvt->len_cvt/8; i; --i ) {
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- dst[3] = src[3];
- src += 8;
- dst += 4;
- }
- break;
- case 16:
- for ( i=cvt->len_cvt/16; i; --i ) {
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- dst[3] = src[3];
- dst[4] = src[4];
- dst[5] = src[5];
- dst[6] = src[6];
- dst[7] = src[7];
- src += 16;
- dst += 8;
- }
- break;
- }
- cvt->len_cvt /= 2;
- if ( cvt->filters[++cvt->filter_index] ) {
- cvt->filters[cvt->filter_index](cvt, format);
- }
-}
-
-/* Convert rate down by multiple of 2, for 5.1 */
-void SDLCALL SDL_RateDIV2_c6(SDL_AudioCVT *cvt, Uint16 format)
-{
- int i;
- Uint8 *src, *dst;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting audio rate / 2\n");
-#endif
- src = cvt->buf;
- dst = cvt->buf;
- switch (format & 0xFF) {
- case 8:
- for ( i=cvt->len_cvt/12; i; --i ) {
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- dst[3] = src[3];
- dst[4] = src[4];
- dst[5] = src[5];
- src += 12;
- dst += 6;
- }
- break;
- case 16:
- for ( i=cvt->len_cvt/24; i; --i ) {
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- dst[3] = src[3];
- dst[4] = src[4];
- dst[5] = src[5];
- dst[6] = src[6];
- dst[7] = src[7];
- dst[8] = src[8];
- dst[9] = src[9];
- dst[10] = src[10];
- dst[11] = src[11];
- src += 24;
- dst += 12;
- }
- break;
- }
- cvt->len_cvt /= 2;
- if ( cvt->filters[++cvt->filter_index] ) {
- cvt->filters[cvt->filter_index](cvt, format);
- }
-}
-
-/* Very slow rate conversion routine */
-void SDLCALL SDL_RateSLOW(SDL_AudioCVT *cvt, Uint16 format)
-{
- double ipos;
- int i, clen;
-
-#ifdef DEBUG_CONVERT
- fprintf(stderr, "Converting audio rate * %4.4f\n", 1.0/cvt->rate_incr);
-#endif
- clen = (int)((double)cvt->len_cvt / cvt->rate_incr);
- if ( cvt->rate_incr > 1.0 ) {
- switch (format & 0xFF) {
- case 8: {
- Uint8 *output;
-
- output = cvt->buf;
- ipos = 0.0;
- for ( i=clen; i; --i ) {
- *output = cvt->buf[(int)ipos];
- ipos += cvt->rate_incr;
- output += 1;
- }
- }
- break;
-
- case 16: {
- Uint16 *output;
-
- clen &= ~1;
- output = (Uint16 *)cvt->buf;
- ipos = 0.0;
- for ( i=clen/2; i; --i ) {
- *output=((Uint16 *)cvt->buf)[(int)ipos];
- ipos += cvt->rate_incr;
- output += 1;
- }
- }
- break;
- }
- } else {
- switch (format & 0xFF) {
- case 8: {
- Uint8 *output;
-
- output = cvt->buf+clen;
- ipos = (double)cvt->len_cvt;
- for ( i=clen; i; --i ) {
- ipos -= cvt->rate_incr;
- output -= 1;
- *output = cvt->buf[(int)ipos];
- }
- }
- break;
-
- case 16: {
- Uint16 *output;
-
- clen &= ~1;
- output = (Uint16 *)(cvt->buf+clen);
- ipos = (double)cvt->len_cvt/2;
- for ( i=clen/2; i; --i ) {
- ipos -= cvt->rate_incr;
- output -= 1;
- *output=((Uint16 *)cvt->buf)[(int)ipos];
- }
- }
- break;
- }
- }
- cvt->len_cvt = clen;
- if ( cvt->filters[++cvt->filter_index] ) {
- cvt->filters[cvt->filter_index](cvt, format);
- }
-}
-
-int SDL_ConvertAudio(SDL_AudioCVT *cvt)
-{
- /* Make sure there's data to convert */
- if ( cvt->buf == NULL ) {
- SDL_SetError("No buffer allocated for conversion");
- return(-1);
- }
- /* Return okay if no conversion is necessary */
- cvt->len_cvt = cvt->len;
- if ( cvt->filters[0] == NULL ) {
- return(0);
- }
-
- /* Set up the conversion and go! */
- cvt->filter_index = 0;
- cvt->filters[0](cvt, cvt->src_format);
- return(0);
-}
-
-/* Creates a set of audio filters to convert from one format to another.
- Returns -1 if the format conversion is not supported, or 1 if the
- audio filter is set up.
-*/
-
-int SDL_BuildAudioCVT(SDL_AudioCVT *cvt,
- Uint16 src_format, Uint8 src_channels, int src_rate,
- Uint16 dst_format, Uint8 dst_channels, int dst_rate)
-{
-/*printf("Build format %04x->%04x, channels %u->%u, rate %d->%d\n",
- src_format, dst_format, src_channels, dst_channels, src_rate, dst_rate);*/
- /* Start off with no conversion necessary */
- cvt->needed = 0;
- cvt->filter_index = 0;
- cvt->filters[0] = NULL;
- cvt->len_mult = 1;
- cvt->len_ratio = 1.0;
-
- /* First filter: Endian conversion from src to dst */
- if ( (src_format & 0x1000) != (dst_format & 0x1000)
- && ((src_format & 0xff) == 16) && ((dst_format & 0xff) == 16)) {
- cvt->filters[cvt->filter_index++] = SDL_ConvertEndian;
- }
-
- /* Second filter: Sign conversion -- signed/unsigned */
- if ( (src_format & 0x8000) != (dst_format & 0x8000) ) {
- cvt->filters[cvt->filter_index++] = SDL_ConvertSign;
- }
-
- /* Next filter: Convert 16 bit <--> 8 bit PCM */
- if ( (src_format & 0xFF) != (dst_format & 0xFF) ) {
- switch (dst_format&0x10FF) {
- case AUDIO_U8:
- cvt->filters[cvt->filter_index++] =
- SDL_Convert8;
- cvt->len_ratio /= 2;
- break;
- case AUDIO_U16LSB:
- cvt->filters[cvt->filter_index++] =
- SDL_Convert16LSB;
- cvt->len_mult *= 2;
- cvt->len_ratio *= 2;
- break;
- case AUDIO_U16MSB:
- cvt->filters[cvt->filter_index++] =
- SDL_Convert16MSB;
- cvt->len_mult *= 2;
- cvt->len_ratio *= 2;
- break;
- }
- }
-
- /* Last filter: Mono/Stereo conversion */
- if ( src_channels != dst_channels ) {
- if ( (src_channels == 1) && (dst_channels > 1) ) {
- cvt->filters[cvt->filter_index++] =
- SDL_ConvertStereo;
- cvt->len_mult *= 2;
- src_channels = 2;
- cvt->len_ratio *= 2;
- }
- if ( (src_channels == 2) &&
- (dst_channels == 6) ) {
- cvt->filters[cvt->filter_index++] =
- SDL_ConvertSurround;
- src_channels = 6;
- cvt->len_mult *= 3;
- cvt->len_ratio *= 3;
- }
- if ( (src_channels == 2) &&
- (dst_channels == 4) ) {
- cvt->filters[cvt->filter_index++] =
- SDL_ConvertSurround_4;
- src_channels = 4;
- cvt->len_mult *= 2;
- cvt->len_ratio *= 2;
- }
- while ( (src_channels*2) <= dst_channels ) {
- cvt->filters[cvt->filter_index++] =
- SDL_ConvertStereo;
- cvt->len_mult *= 2;
- src_channels *= 2;
- cvt->len_ratio *= 2;
- }
- if ( (src_channels == 6) &&
- (dst_channels <= 2) ) {
- cvt->filters[cvt->filter_index++] =
- SDL_ConvertStrip;
- src_channels = 2;
- cvt->len_ratio /= 3;
- }
- if ( (src_channels == 6) &&
- (dst_channels == 4) ) {
- cvt->filters[cvt->filter_index++] =
- SDL_ConvertStrip_2;
- src_channels = 4;
- cvt->len_ratio /= 2;
- }
- /* This assumes that 4 channel audio is in the format:
- Left {front/back} + Right {front/back}
- so converting to L/R stereo works properly.
- */
- while ( ((src_channels%2) == 0) &&
- ((src_channels/2) >= dst_channels) ) {
- cvt->filters[cvt->filter_index++] =
- SDL_ConvertMono;
- src_channels /= 2;
- cvt->len_ratio /= 2;
- }
- if ( src_channels != dst_channels ) {
- /* Uh oh.. */;
- }
- }
-
- /* Do rate conversion */
- cvt->rate_incr = 0.0;
- if ( (src_rate/100) != (dst_rate/100) ) {
- Uint32 hi_rate, lo_rate;
- int len_mult;
- double len_ratio;
- void (SDLCALL *rate_cvt)(SDL_AudioCVT *cvt, Uint16 format);
-
- if ( src_rate > dst_rate ) {
- hi_rate = src_rate;
- lo_rate = dst_rate;
- switch (src_channels) {
- case 1: rate_cvt = SDL_RateDIV2; break;
- case 2: rate_cvt = SDL_RateDIV2_c2; break;
- case 4: rate_cvt = SDL_RateDIV2_c4; break;
- case 6: rate_cvt = SDL_RateDIV2_c6; break;
- default: return -1;
- }
- len_mult = 1;
- len_ratio = 0.5;
- } else {
- hi_rate = dst_rate;
- lo_rate = src_rate;
- switch (src_channels) {
- case 1: rate_cvt = SDL_RateMUL2; break;
- case 2: rate_cvt = SDL_RateMUL2_c2; break;
- case 4: rate_cvt = SDL_RateMUL2_c4; break;
- case 6: rate_cvt = SDL_RateMUL2_c6; break;
- default: return -1;
- }
- len_mult = 2;
- len_ratio = 2.0;
- }
- /* If hi_rate = lo_rate*2^x then conversion is easy */
- while ( ((lo_rate*2)/100) <= (hi_rate/100) ) {
- cvt->filters[cvt->filter_index++] = rate_cvt;
- cvt->len_mult *= len_mult;
- lo_rate *= 2;
- cvt->len_ratio *= len_ratio;
- }
- /* We may need a slow conversion here to finish up */
- if ( (lo_rate/100) != (hi_rate/100) ) {
-#if 1
- /* The problem with this is that if the input buffer is
- say 1K, and the conversion rate is say 1.1, then the
- output buffer is 1.1K, which may not be an acceptable
- buffer size for the audio driver (not a power of 2)
- */
- /* For now, punt and hope the rate distortion isn't great.
- */
-#else
- if ( src_rate < dst_rate ) {
- cvt->rate_incr = (double)lo_rate/hi_rate;
- cvt->len_mult *= 2;
- cvt->len_ratio /= cvt->rate_incr;
- } else {
- cvt->rate_incr = (double)hi_rate/lo_rate;
- cvt->len_ratio *= cvt->rate_incr;
- }
- cvt->filters[cvt->filter_index++] = SDL_RateSLOW;
-#endif
- }
- }
-
- /* Set up the filter information */
- if ( cvt->filter_index != 0 ) {
- cvt->needed = 1;
- cvt->src_format = src_format;
- cvt->dst_format = dst_format;
- cvt->len = 0;
- cvt->buf = NULL;
- cvt->filters[cvt->filter_index] = NULL;
- }
- return(cvt->needed);
-}
diff --git a/distrib/sdl-1.2.12/src/audio/SDL_audiodev.c b/distrib/sdl-1.2.12/src/audio/SDL_audiodev.c
deleted file mode 100644
index 90671f9..0000000
--- a/distrib/sdl-1.2.12/src/audio/SDL_audiodev.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Get the name of the audio device we use for output */
-
-#if SDL_AUDIO_DRIVER_BSD || SDL_AUDIO_DRIVER_OSS || SDL_AUDIO_DRIVER_SUNAUDIO
-
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include "SDL_stdinc.h"
-#include "SDL_audiodev_c.h"
-
-#ifndef _PATH_DEV_DSP
-#if defined(__NETBSD__) || defined(__OPENBSD__)
-#define _PATH_DEV_DSP "/dev/audio"
-#else
-#define _PATH_DEV_DSP "/dev/dsp"
-#endif
-#endif
-#ifndef _PATH_DEV_DSP24
-#define _PATH_DEV_DSP24 "/dev/sound/dsp"
-#endif
-#ifndef _PATH_DEV_AUDIO
-#define _PATH_DEV_AUDIO "/dev/audio"
-#endif
-
-
-int SDL_OpenAudioPath(char *path, int maxlen, int flags, int classic)
-{
- const char *audiodev;
- int audio_fd;
- char audiopath[1024];
-
- /* Figure out what our audio device is */
- if ( ((audiodev=SDL_getenv("SDL_PATH_DSP")) == NULL) &&
- ((audiodev=SDL_getenv("AUDIODEV")) == NULL) ) {
- if ( classic ) {
- audiodev = _PATH_DEV_AUDIO;
- } else {
- struct stat sb;
-
- /* Added support for /dev/sound/\* in Linux 2.4 */
- if ( ((stat("/dev/sound", &sb) == 0) && S_ISDIR(sb.st_mode)) &&
- ((stat(_PATH_DEV_DSP24, &sb) == 0) && S_ISCHR(sb.st_mode)) ) {
- audiodev = _PATH_DEV_DSP24;
- } else {
- audiodev = _PATH_DEV_DSP;
- }
- }
- }
- audio_fd = open(audiodev, flags, 0);
-
- /* If the first open fails, look for other devices */
- if ( (audio_fd < 0) && (SDL_strlen(audiodev) < (sizeof(audiopath)-3)) ) {
- int exists, instance;
- struct stat sb;
-
- instance = 1;
- do { /* Don't use errno ENOENT - it may not be thread-safe */
- SDL_snprintf(audiopath, SDL_arraysize(audiopath),
- "%s%d", audiodev, instance++);
- exists = 0;
- if ( stat(audiopath, &sb) == 0 ) {
- exists = 1;
- audio_fd = open(audiopath, flags, 0);
- }
- } while ( exists && (audio_fd < 0) );
- audiodev = audiopath;
- }
- if ( path != NULL ) {
- SDL_strlcpy(path, audiodev, maxlen);
- path[maxlen-1] = '\0';
- }
- return(audio_fd);
-}
-
-#elif SDL_AUDIO_DRIVER_PAUD
-
-/* Get the name of the audio device we use for output */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include "SDL_stdinc.h"
-#include "SDL_audiodev_c.h"
-
-#ifndef _PATH_DEV_DSP
-#define _PATH_DEV_DSP "/dev/%caud%c/%c"
-#endif
-
-char devsettings[][3] =
-{
- { 'p', '0', '1' }, { 'p', '0', '2' }, { 'p', '0', '3' }, { 'p', '0', '4' },
- { 'p', '1', '1' }, { 'p', '1', '2' }, { 'p', '1', '3' }, { 'p', '1', '4' },
- { 'p', '2', '1' }, { 'p', '2', '2' }, { 'p', '2', '3' }, { 'p', '2', '4' },
- { 'p', '3', '1' }, { 'p', '3', '2' }, { 'p', '3', '3' }, { 'p', '3', '4' },
- { 'b', '0', '1' }, { 'b', '0', '2' }, { 'b', '0', '3' }, { 'b', '0', '4' },
- { 'b', '1', '1' }, { 'b', '1', '2' }, { 'b', '1', '3' }, { 'b', '1', '4' },
- { 'b', '2', '1' }, { 'b', '2', '2' }, { 'b', '2', '3' }, { 'b', '2', '4' },
- { 'b', '3', '1' }, { 'b', '3', '2' }, { 'b', '3', '3' }, { 'b', '3', '4' },
- { '\0', '\0', '\0' }
-};
-
-static int OpenUserDefinedDevice(char *path, int maxlen, int flags)
-{
- const char *audiodev;
- int audio_fd;
-
- /* Figure out what our audio device is */
- if ((audiodev=SDL_getenv("SDL_PATH_DSP")) == NULL) {
- audiodev=SDL_getenv("AUDIODEV");
- }
- if ( audiodev == NULL ) {
- return -1;
- }
- audio_fd = open(audiodev, flags, 0);
- if ( path != NULL ) {
- SDL_strlcpy(path, audiodev, maxlen);
- path[maxlen-1] = '\0';
- }
- return audio_fd;
-}
-
-int SDL_OpenAudioPath(char *path, int maxlen, int flags, int classic)
-{
- struct stat sb;
- int audio_fd;
- char audiopath[1024];
- int cycle;
-
- audio_fd = OpenUserDefinedDevice(path,maxlen,flags);
- if ( audio_fd != -1 ) {
- return audio_fd;
- }
-
- cycle = 0;
- while( devsettings[cycle][0] != '\0' ) {
- SDL_snprintf( audiopath, SDL_arraysize(audiopath),
- _PATH_DEV_DSP,
- devsettings[cycle][0],
- devsettings[cycle][1],
- devsettings[cycle][2]);
-
- if ( stat(audiopath, &sb) == 0 ) {
- audio_fd = open(audiopath, flags, 0);
- if ( audio_fd > 0 ) {
- if ( path != NULL ) {
- SDL_strlcpy( path, audiopath, maxlen );
- }
- return audio_fd;
- }
- }
- }
- return -1;
-}
-
-#endif /* Audio driver selection */
diff --git a/distrib/sdl-1.2.12/src/audio/SDL_audiodev_c.h b/distrib/sdl-1.2.12/src/audio/SDL_audiodev_c.h
deleted file mode 100644
index 055fd65..0000000
--- a/distrib/sdl-1.2.12/src/audio/SDL_audiodev_c.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Open the audio device, storing the pathname in 'path' */
-extern int SDL_OpenAudioPath(char *path, int maxlen, int flags, int classic);
-
diff --git a/distrib/sdl-1.2.12/src/audio/SDL_audiomem.h b/distrib/sdl-1.2.12/src/audio/SDL_audiomem.h
deleted file mode 100644
index 3d759eb..0000000
--- a/distrib/sdl-1.2.12/src/audio/SDL_audiomem.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#define SDL_AllocAudioMem SDL_malloc
-#define SDL_FreeAudioMem SDL_free
diff --git a/distrib/sdl-1.2.12/src/audio/SDL_mixer.c b/distrib/sdl-1.2.12/src/audio/SDL_mixer.c
deleted file mode 100644
index 5e07a07..0000000
--- a/distrib/sdl-1.2.12/src/audio/SDL_mixer.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This provides the default mixing callback for the SDL audio routines */
-
-#include "SDL_cpuinfo.h"
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "SDL_sysaudio.h"
-#include "SDL_mixer_MMX.h"
-#include "SDL_mixer_MMX_VC.h"
-#include "SDL_mixer_m68k.h"
-
-/* This table is used to add two sound values together and pin
- * the value to avoid overflow. (used with permission from ARDI)
- * Changed to use 0xFE instead of 0xFF for better sound quality.
- */
-static const Uint8 mix8[] =
-{
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03,
- 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,
- 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19,
- 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24,
- 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A,
- 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45,
- 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50,
- 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B,
- 0x5C, 0x5D, 0x5E, 0x5F, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66,
- 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71,
- 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C,
- 0x7D, 0x7E, 0x7F, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
- 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92,
- 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D,
- 0x9E, 0x9F, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8,
- 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3,
- 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE,
- 0xBF, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9,
- 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4,
- 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
- 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA,
- 0xEB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5,
- 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFE, 0xFE,
- 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
- 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
- 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
- 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
- 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
- 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
- 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
- 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
- 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
- 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
- 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
- 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE
-};
-
-/* 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)
-
-void SDL_MixAudio (Uint8 *dst, const Uint8 *src, Uint32 len, int volume)
-{
- Uint16 format;
-
- if ( volume == 0 ) {
- return;
- }
- /* Mix the user-level audio format */
- if ( current_audio ) {
- if ( current_audio->convert.needed ) {
- format = current_audio->convert.src_format;
- } else {
- format = current_audio->spec.format;
- }
- } else {
- /* HACK HACK HACK */
- format = AUDIO_S16;
- }
- switch (format) {
-
- case AUDIO_U8: {
-#if defined(__GNUC__) && defined(__M68000__) && defined(SDL_ASSEMBLY_ROUTINES)
- SDL_MixAudio_m68k_U8((char*)dst,(char*)src,(unsigned long)len,(long)volume,(char *)mix8);
-#else
- Uint8 src_sample;
-
- while ( len-- ) {
- src_sample = *src;
- ADJUST_VOLUME_U8(src_sample, volume);
- *dst = mix8[*dst+src_sample];
- ++dst;
- ++src;
- }
-#endif
- }
- break;
-
- case AUDIO_S8: {
-#if defined(__GNUC__) && defined(__i386__) && defined(SDL_ASSEMBLY_ROUTINES)
- if (SDL_HasMMX())
- {
- SDL_MixAudio_MMX_S8((char*)dst,(char*)src,(unsigned int)len,(int)volume);
- }
- else
-#elif ((defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)) && defined(SDL_ASSEMBLY_ROUTINES)
- if (SDL_HasMMX())
- {
- SDL_MixAudio_MMX_S8_VC((char*)dst,(char*)src,(unsigned int)len,(int)volume);
- }
- else
-#endif
-#if defined(__GNUC__) && defined(__M68000__) && defined(SDL_ASSEMBLY_ROUTINES)
- SDL_MixAudio_m68k_S8((char*)dst,(char*)src,(unsigned long)len,(long)volume);
-#else
- {
- Sint8 *dst8, *src8;
- Sint8 src_sample;
- int dst_sample;
- const int max_audioval = ((1<<(8-1))-1);
- const int min_audioval = -(1<<(8-1));
-
- src8 = (Sint8 *)src;
- dst8 = (Sint8 *)dst;
- while ( len-- ) {
- src_sample = *src8;
- ADJUST_VOLUME(src_sample, volume);
- dst_sample = *dst8 + src_sample;
- if ( dst_sample > max_audioval ) {
- *dst8 = max_audioval;
- } else
- if ( dst_sample < min_audioval ) {
- *dst8 = min_audioval;
- } else {
- *dst8 = dst_sample;
- }
- ++dst8;
- ++src8;
- }
- }
-#endif
- }
- break;
-
- case AUDIO_S16LSB: {
-#if defined(__GNUC__) && defined(__i386__) && defined(SDL_ASSEMBLY_ROUTINES)
- if (SDL_HasMMX())
- {
- SDL_MixAudio_MMX_S16((char*)dst,(char*)src,(unsigned int)len,(int)volume);
- }
- else
-#elif ((defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)) && defined(SDL_ASSEMBLY_ROUTINES)
- if (SDL_HasMMX())
- {
- SDL_MixAudio_MMX_S16_VC((char*)dst,(char*)src,(unsigned int)len,(int)volume);
- }
- else
-#endif
-#if defined(__GNUC__) && defined(__M68000__) && defined(SDL_ASSEMBLY_ROUTINES)
- SDL_MixAudio_m68k_S16LSB((short*)dst,(short*)src,(unsigned long)len,(long)volume);
-#else
- {
- Sint16 src1, src2;
- int dst_sample;
- const int max_audioval = ((1<<(16-1))-1);
- const int min_audioval = -(1<<(16-1));
-
- len /= 2;
- while ( len-- ) {
- src1 = ((src[1])<<8|src[0]);
- ADJUST_VOLUME(src1, volume);
- src2 = ((dst[1])<<8|dst[0]);
- src += 2;
- dst_sample = src1+src2;
- if ( dst_sample > max_audioval ) {
- dst_sample = max_audioval;
- } else
- if ( dst_sample < min_audioval ) {
- dst_sample = min_audioval;
- }
- dst[0] = dst_sample&0xFF;
- dst_sample >>= 8;
- dst[1] = dst_sample&0xFF;
- dst += 2;
- }
- }
-#endif
- }
- break;
-
- case AUDIO_S16MSB: {
-#if defined(__GNUC__) && defined(__M68000__) && defined(SDL_ASSEMBLY_ROUTINES)
- SDL_MixAudio_m68k_S16MSB((short*)dst,(short*)src,(unsigned long)len,(long)volume);
-#else
- Sint16 src1, src2;
- int dst_sample;
- const int max_audioval = ((1<<(16-1))-1);
- const int min_audioval = -(1<<(16-1));
-
- len /= 2;
- while ( len-- ) {
- src1 = ((src[0])<<8|src[1]);
- ADJUST_VOLUME(src1, volume);
- src2 = ((dst[0])<<8|dst[1]);
- src += 2;
- dst_sample = src1+src2;
- if ( dst_sample > max_audioval ) {
- dst_sample = max_audioval;
- } else
- if ( dst_sample < min_audioval ) {
- dst_sample = min_audioval;
- }
- dst[1] = dst_sample&0xFF;
- dst_sample >>= 8;
- dst[0] = dst_sample&0xFF;
- dst += 2;
- }
-#endif
- }
- break;
-
- default: /* If this happens... FIXME! */
- SDL_SetError("SDL_MixAudio(): unknown audio format");
- return;
- }
-}
-
diff --git a/distrib/sdl-1.2.12/src/audio/SDL_mixer_MMX.c b/distrib/sdl-1.2.12/src/audio/SDL_mixer_MMX.c
deleted file mode 100644
index 9d24ba0..0000000
--- a/distrib/sdl-1.2.12/src/audio/SDL_mixer_MMX.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- MMX assembler version of SDL_MixAudio for signed little endian 16 bit samples and signed 8 bit samples
- Copyright 2002 Stephane Marchesin (stephane.marchesin@wanadoo.fr)
- This code is licensed under the LGPL (see COPYING for details)
-
- Assumes buffer size in bytes is a multiple of 16
- Assumes SDL_MIX_MAXVOLUME = 128
-*/
-
-
-/***********************************************
-* Mixing for 16 bit signed buffers
-***********************************************/
-
-#if defined(__GNUC__) && defined(__i386__) && defined(SDL_ASSEMBLY_ROUTINES)
-void SDL_MixAudio_MMX_S16(char* dst,char* src,unsigned int size,int volume)
-{
- __asm__ __volatile__ (
-
-" movl %3,%%eax\n" /* eax = volume */
-
-" movl %2,%%edx\n" /* edx = size */
-
-" shrl $4,%%edx\n" /* process 16 bytes per iteration = 8 samples */
-
-" jz .endS16\n"
-
-" pxor %%mm0,%%mm0\n"
-
-" movd %%eax,%%mm0\n"
-" movq %%mm0,%%mm1\n"
-" psllq $16,%%mm0\n"
-" por %%mm1,%%mm0\n"
-" psllq $16,%%mm0\n"
-" por %%mm1,%%mm0\n"
-" psllq $16,%%mm0\n"
-" por %%mm1,%%mm0\n" /* mm0 = vol|vol|vol|vol */
-
-".align 8\n"
-" .mixloopS16:\n"
-
-" movq (%1),%%mm1\n" /* mm1 = a|b|c|d */
-
-" movq %%mm1,%%mm2\n" /* mm2 = a|b|c|d */
-
-" movq 8(%1),%%mm4\n" /* mm4 = e|f|g|h */
-
- /* pré charger le buffer dst dans mm7 */
-" movq (%0),%%mm7\n" /* mm7 = dst[0] */
-
- /* multiplier par le volume */
-" pmullw %%mm0,%%mm1\n" /* mm1 = l(a*v)|l(b*v)|l(c*v)|l(d*v) */
-
-" pmulhw %%mm0,%%mm2\n" /* mm2 = h(a*v)|h(b*v)|h(c*v)|h(d*v) */
-" movq %%mm4,%%mm5\n" /* mm5 = e|f|g|h */
-
-" pmullw %%mm0,%%mm4\n" /* mm4 = l(e*v)|l(f*v)|l(g*v)|l(h*v) */
-
-" pmulhw %%mm0,%%mm5\n" /* mm5 = h(e*v)|h(f*v)|h(g*v)|h(h*v) */
-" movq %%mm1,%%mm3\n" /* mm3 = l(a*v)|l(b*v)|l(c*v)|l(d*v) */
-
-" punpckhwd %%mm2,%%mm1\n" /* mm1 = a*v|b*v */
-
-" movq %%mm4,%%mm6\n" /* mm6 = l(e*v)|l(f*v)|l(g*v)|l(h*v) */
-" punpcklwd %%mm2,%%mm3\n" /* mm3 = c*v|d*v */
-
-" punpckhwd %%mm5,%%mm4\n" /* mm4 = e*f|f*v */
-
-" punpcklwd %%mm5,%%mm6\n" /* mm6 = g*v|h*v */
-
- /* pré charger le buffer dst dans mm5 */
-" movq 8(%0),%%mm5\n" /* mm5 = dst[1] */
-
- /* diviser par 128 */
-" psrad $7,%%mm1\n" /* mm1 = a*v/128|b*v/128 , 128 = SDL_MIX_MAXVOLUME */
-" add $16,%1\n"
-
-" psrad $7,%%mm3\n" /* mm3 = c*v/128|d*v/128 */
-
-" psrad $7,%%mm4\n" /* mm4 = e*v/128|f*v/128 */
-
- /* mm1 = le sample avec le volume modifié */
-" packssdw %%mm1,%%mm3\n" /* mm3 = s(a*v|b*v|c*v|d*v) */
-
-" psrad $7,%%mm6\n" /* mm6= g*v/128|h*v/128 */
-" paddsw %%mm7,%%mm3\n" /* mm3 = adjust_volume(src)+dst */
-
- /* mm4 = le sample avec le volume modifié */
-" packssdw %%mm4,%%mm6\n" /* mm6 = s(e*v|f*v|g*v|h*v) */
-" movq %%mm3,(%0)\n"
-
-" paddsw %%mm5,%%mm6\n" /* mm6 = adjust_volume(src)+dst */
-
-" movq %%mm6,8(%0)\n"
-
-" add $16,%0\n"
-
-" dec %%edx\n"
-
-" jnz .mixloopS16\n"
-
-" emms\n"
-
-".endS16:\n"
- :
- : "r" (dst), "r"(src),"m"(size),
- "m"(volume)
- : "eax","edx","memory"
- );
-}
-
-
-
-/*////////////////////////////////////////////// */
-/* Mixing for 8 bit signed buffers */
-/*////////////////////////////////////////////// */
-
-void SDL_MixAudio_MMX_S8(char* dst,char* src,unsigned int size,int volume)
-{
- __asm__ __volatile__ (
-
-" movl %3,%%eax\n" /* eax = volume */
-
-" movd %%eax,%%mm0\n"
-" movq %%mm0,%%mm1\n"
-" psllq $16,%%mm0\n"
-" por %%mm1,%%mm0\n"
-" psllq $16,%%mm0\n"
-" por %%mm1,%%mm0\n"
-" psllq $16,%%mm0\n"
-" por %%mm1,%%mm0\n"
-
-" movl %2,%%edx\n" /* edx = size */
-" shr $3,%%edx\n" /* process 8 bytes per iteration = 8 samples */
-
-" cmp $0,%%edx\n"
-" je .endS8\n"
-
-".align 8\n"
-" .mixloopS8:\n"
-
-" pxor %%mm2,%%mm2\n" /* mm2 = 0 */
-" movq (%1),%%mm1\n" /* mm1 = a|b|c|d|e|f|g|h */
-
-" movq %%mm1,%%mm3\n" /* mm3 = a|b|c|d|e|f|g|h */
-
- /* on va faire le "sign extension" en faisant un cmp avec 0 qui retourne 1 si <0, 0 si >0 */
-" pcmpgtb %%mm1,%%mm2\n" /* mm2 = 11111111|00000000|00000000.... */
-
-" punpckhbw %%mm2,%%mm1\n" /* mm1 = 0|a|0|b|0|c|0|d */
-
-" punpcklbw %%mm2,%%mm3\n" /* mm3 = 0|e|0|f|0|g|0|h */
-" movq (%0),%%mm2\n" /* mm2 = destination */
-
-" pmullw %%mm0,%%mm1\n" /* mm1 = v*a|v*b|v*c|v*d */
-" add $8,%1\n"
-
-" pmullw %%mm0,%%mm3\n" /* mm3 = v*e|v*f|v*g|v*h */
-" psraw $7,%%mm1\n" /* mm1 = v*a/128|v*b/128|v*c/128|v*d/128 */
-
-" psraw $7,%%mm3\n" /* mm3 = v*e/128|v*f/128|v*g/128|v*h/128 */
-
-" packsswb %%mm1,%%mm3\n" /* mm1 = v*a/128|v*b/128|v*c/128|v*d/128|v*e/128|v*f/128|v*g/128|v*h/128 */
-
-" paddsb %%mm2,%%mm3\n" /* add to destination buffer */
-
-" movq %%mm3,(%0)\n" /* store back to ram */
-" add $8,%0\n"
-
-" dec %%edx\n"
-
-" jnz .mixloopS8\n"
-
-".endS8:\n"
-" emms\n"
- :
- : "r" (dst), "r"(src),"m"(size),
- "m"(volume)
- : "eax","edx","memory"
- );
-}
-#endif
-
diff --git a/distrib/sdl-1.2.12/src/audio/SDL_mixer_MMX.h b/distrib/sdl-1.2.12/src/audio/SDL_mixer_MMX.h
deleted file mode 100644
index 5a62683..0000000
--- a/distrib/sdl-1.2.12/src/audio/SDL_mixer_MMX.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- headers for MMX assembler version of SDL_MixAudio
- Copyright 2002 Stephane Marchesin (stephane.marchesin@wanadoo.fr)
- This code is licensed under the LGPL (see COPYING for details)
-
- Assumes buffer size in bytes is a multiple of 16
- Assumes SDL_MIX_MAXVOLUME = 128
-*/
-#include "SDL_config.h"
-
-#if defined(__GNUC__) && defined(__i386__) && defined(SDL_ASSEMBLY_ROUTINES)
-void SDL_MixAudio_MMX_S16(char* ,char* ,unsigned int ,int );
-void SDL_MixAudio_MMX_S8(char* ,char* ,unsigned int ,int );
-#endif
-
diff --git a/distrib/sdl-1.2.12/src/audio/SDL_mixer_MMX_VC.c b/distrib/sdl-1.2.12/src/audio/SDL_mixer_MMX_VC.c
deleted file mode 100644
index 89b646a..0000000
--- a/distrib/sdl-1.2.12/src/audio/SDL_mixer_MMX_VC.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_mixer_MMX_VC.h"
-
-#if ((defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)) && defined(SDL_ASSEMBLY_ROUTINES)
-// MMX assembler version of SDL_MixAudio for signed little endian 16 bit samples and signed 8 bit samples
-// Copyright 2002 Stephane Marchesin (stephane.marchesin@wanadoo.fr)
-// Converted to Intel ASM notation by Cth
-// This code is licensed under the LGPL (see COPYING for details)
-//
-// Assumes buffer size in bytes is a multiple of 16
-// Assumes SDL_MIX_MAXVOLUME = 128
-
-
-////////////////////////////////////////////////
-// Mixing for 16 bit signed buffers
-////////////////////////////////////////////////
-
-void SDL_MixAudio_MMX_S16_VC(char* dst,char* src,unsigned int nSize,int volume)
-{
- __asm
- {
-
- push edi
- push esi
- push ebx
-
- mov edi, dst // edi = dst
- mov esi, src // esi = src
- mov eax, volume // eax = volume
- mov ebx, nSize // ebx = size
- shr ebx, 4 // process 16 bytes per iteration = 8 samples
- jz endS16
-
- pxor mm0, mm0
- movd mm0, eax //%%eax,%%mm0
- movq mm1, mm0 //%%mm0,%%mm1
- psllq mm0, 16 //$16,%%mm0
- por mm0, mm1 //%%mm1,%%mm0
- psllq mm0, 16 //$16,%%mm0
- por mm0, mm1 //%%mm1,%%mm0
- psllq mm0, 16 //$16,%%mm0
- por mm0, mm1 //%%mm1,%%mm0 // mm0 = vol|vol|vol|vol
-
- #ifndef __WATCOMC__
- align 16
- #endif
-mixloopS16:
- movq mm1, [esi] //(%%esi),%%mm1\n" // mm1 = a|b|c|d
- movq mm2, mm1 //%%mm1,%%mm2\n" // mm2 = a|b|c|d
- movq mm4, [esi + 8] //8(%%esi),%%mm4\n" // mm4 = e|f|g|h
- // pre charger le buffer dst dans mm7
- movq mm7, [edi] //(%%edi),%%mm7\n" // mm7 = dst[0]"
- // multiplier par le volume
- pmullw mm1, mm0 //%%mm0,%%mm1\n" // mm1 = l(a*v)|l(b*v)|l(c*v)|l(d*v)
- pmulhw mm2, mm0 //%%mm0,%%mm2\n" // mm2 = h(a*v)|h(b*v)|h(c*v)|h(d*v)
- movq mm5, mm4 //%%mm4,%%mm5\n" // mm5 = e|f|g|h
- pmullw mm4, mm0 //%%mm0,%%mm4\n" // mm4 = l(e*v)|l(f*v)|l(g*v)|l(h*v)
- pmulhw mm5, mm0 //%%mm0,%%mm5\n" // mm5 = h(e*v)|h(f*v)|h(g*v)|h(h*v)
- movq mm3, mm1 //%%mm1,%%mm3\n" // mm3 = l(a*v)|l(b*v)|l(c*v)|l(d*v)
- punpckhwd mm1, mm2 //%%mm2,%%mm1\n" // mm1 = a*v|b*v
- movq mm6, mm4 //%%mm4,%%mm6\n" // mm6 = l(e*v)|l(f*v)|l(g*v)|l(h*v)
- punpcklwd mm3, mm2 //%%mm2,%%mm3\n" // mm3 = c*v|d*v
- punpckhwd mm4, mm5 //%%mm5,%%mm4\n" // mm4 = e*f|f*v
- punpcklwd mm6, mm5 //%%mm5,%%mm6\n" // mm6 = g*v|h*v
- // pre charger le buffer dst dans mm5
- movq mm5, [edi + 8] //8(%%edi),%%mm5\n" // mm5 = dst[1]
- // diviser par 128
- psrad mm1, 7 //$7,%%mm1\n" // mm1 = a*v/128|b*v/128 , 128 = SDL_MIX_MAXVOLUME
- add esi, 16 //$16,%%esi\n"
- psrad mm3, 7 //$7,%%mm3\n" // mm3 = c*v/128|d*v/128
- psrad mm4, 7 //$7,%%mm4\n" // mm4 = e*v/128|f*v/128
- // mm1 = le sample avec le volume modifie
- packssdw mm3, mm1 //%%mm1,%%mm3\n" // mm3 = s(a*v|b*v|c*v|d*v)
- psrad mm6, 7 //$7,%%mm6\n" // mm6= g*v/128|h*v/128
- paddsw mm3, mm7 //%%mm7,%%mm3\n" // mm3 = adjust_volume(src)+dst
- // mm4 = le sample avec le volume modifie
- packssdw mm6, mm4 //%%mm4,%%mm6\n" // mm6 = s(e*v|f*v|g*v|h*v)
- movq [edi], mm3 //%%mm3,(%%edi)\n"
- paddsw mm6, mm5 //%%mm5,%%mm6\n" // mm6 = adjust_volume(src)+dst
- movq [edi + 8], mm6 //%%mm6,8(%%edi)\n"
- add edi, 16 //$16,%%edi\n"
- dec ebx //%%ebx\n"
- jnz mixloopS16
-
-ends16:
- emms
-
- pop ebx
- pop esi
- pop edi
- }
-
-}
-
-////////////////////////////////////////////////
-// Mixing for 8 bit signed buffers
-////////////////////////////////////////////////
-
-void SDL_MixAudio_MMX_S8_VC(char* dst,char* src,unsigned int nSize,int volume)
-{
- _asm
- {
-
- push edi
- push esi
- push ebx
-
- mov edi, dst //movl %0,%%edi // edi = dst
- mov esi, src //%1,%%esi // esi = src
- mov eax, volume //%3,%%eax // eax = volume
-
- movd mm0, eax //%%eax,%%mm0
- movq mm1, mm0 //%%mm0,%%mm1
- psllq mm0, 16 //$16,%%mm0
- por mm0, mm1 //%%mm1,%%mm0
- psllq mm0, 16 //$16,%%mm0
- por mm0, mm1 //%%mm1,%%mm0
- psllq mm0, 16 //$16,%%mm0
- por mm0, mm1 //%%mm1,%%mm0
-
- mov ebx, nSize //%2,%%ebx // ebx = size
- shr ebx, 3 //$3,%%ebx // process 8 bytes per iteration = 8 samples
- cmp ebx, 0 //$0,%%ebx
- je endS8
-
- #ifndef __WATCOMC__
- align 16
- #endif
-mixloopS8:
- pxor mm2, mm2 //%%mm2,%%mm2 // mm2 = 0
- movq mm1, [esi] //(%%esi),%%mm1 // mm1 = a|b|c|d|e|f|g|h
- movq mm3, mm1 //%%mm1,%%mm3 // mm3 = a|b|c|d|e|f|g|h
- // on va faire le "sign extension" en faisant un cmp avec 0 qui retourne 1 si <0, 0 si >0
- pcmpgtb mm2, mm1 //%%mm1,%%mm2 // mm2 = 11111111|00000000|00000000....
- punpckhbw mm1, mm2 //%%mm2,%%mm1 // mm1 = 0|a|0|b|0|c|0|d
- punpcklbw mm3, mm2 //%%mm2,%%mm3 // mm3 = 0|e|0|f|0|g|0|h
- movq mm2, [edi] //(%%edi),%%mm2 // mm2 = destination
- pmullw mm1, mm0 //%%mm0,%%mm1 // mm1 = v*a|v*b|v*c|v*d
- add esi, 8 //$8,%%esi
- pmullw mm3, mm0 //%%mm0,%%mm3 // mm3 = v*e|v*f|v*g|v*h
- psraw mm1, 7 //$7,%%mm1 // mm1 = v*a/128|v*b/128|v*c/128|v*d/128
- psraw mm3, 7 //$7,%%mm3 // mm3 = v*e/128|v*f/128|v*g/128|v*h/128
- packsswb mm3, mm1 //%%mm1,%%mm3 // mm1 = v*a/128|v*b/128|v*c/128|v*d/128|v*e/128|v*f/128|v*g/128|v*h/128
- paddsb mm3, mm2 //%%mm2,%%mm3 // add to destination buffer
- movq [edi], mm3 //%%mm3,(%%edi) // store back to ram
- add edi, 8 //$8,%%edi
- dec ebx //%%ebx
- jnz mixloopS8
-
-endS8:
- emms
-
- pop ebx
- pop esi
- pop edi
- }
-}
-
-#endif /* SDL_ASSEMBLY_ROUTINES */
diff --git a/distrib/sdl-1.2.12/src/audio/SDL_mixer_MMX_VC.h b/distrib/sdl-1.2.12/src/audio/SDL_mixer_MMX_VC.h
deleted file mode 100644
index bfe02a9..0000000
--- a/distrib/sdl-1.2.12/src/audio/SDL_mixer_MMX_VC.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-
-#if ((defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)) && defined(SDL_ASSEMBLY_ROUTINES)
-/* headers for MMX assembler version of SDL_MixAudio
- Copyright 2002 Stephane Marchesin (stephane.marchesin@wanadoo.fr)
- Converted to Intel ASM notation by Cth
- This code is licensed under the LGPL (see COPYING for details)
-
- Assumes buffer size in bytes is a multiple of 16
- Assumes SDL_MIX_MAXVOLUME = 128
-*/
-void SDL_MixAudio_MMX_S16_VC(char* ,char* ,unsigned int ,int );
-void SDL_MixAudio_MMX_S8_VC(char* ,char* ,unsigned int ,int );
-#endif
diff --git a/distrib/sdl-1.2.12/src/audio/SDL_mixer_m68k.c b/distrib/sdl-1.2.12/src/audio/SDL_mixer_m68k.c
deleted file mode 100644
index f8786da..0000000
--- a/distrib/sdl-1.2.12/src/audio/SDL_mixer_m68k.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- m68k assembly mix routines
-
- Patrice Mandin
-*/
-
-#if defined(__M68000__) && defined(__GNUC__)
-void SDL_MixAudio_m68k_U8(char* dst, char* src, long len, long volume, char* mix8)
-{
- __asm__ __volatile__ (
-
- "tstl %2\n"
-" beqs stoploop_u8\n"
-"mixloop_u8:\n"
-
- /* Mix a sample */
-
-" moveq #0,%%d0\n"
-" moveq #0,%%d1\n"
-
-" moveb %1@+,%%d0\n" /* d0 = *src++ */
-" sub #128,%%d0\n" /* d0 -= 128 */
-" muls %3,%%d0\n" /* d0 *= volume (0<=volume<=128) */
-" moveb %0@,%%d1\n" /* d1 = *dst */
-" asr #7,%%d0\n" /* d0 /= 128 (SDL_MIX_MAXVOLUME) */
-" add #128,%%d0\n" /* d0 += 128 */
-
-" add %%d1,%%d0\n"
-
-" moveb %4@(%%d0:w),%0@+\n"
-
- /* Loop till done */
-
-" subql #1,%2\n"
-" bhis mixloop_u8\n"
-"stoploop_u8:\n"
-
- : /* no return value */
- : /* input */
- "a"(dst), "a"(src), "d"(len), "d"(volume), "a"(mix8)
- : /* clobbered registers */
- "d0", "d1", "cc", "memory"
- );
-}
-
-void SDL_MixAudio_m68k_S8(char* dst, char* src, long len, long volume)
-{
- __asm__ __volatile__ (
-
- "tstl %2\n"
-" beqs stoploop_s8\n"
-" moveq #-128,%%d2\n"
-" moveq #127,%%d3\n"
-"mixloop_s8:\n"
-
- /* Mix a sample */
-
-" moveq #0,%%d0\n"
-" moveq #0,%%d1\n"
-
-" moveb %1@+,%%d0\n" /* d0 = *src++ */
-" muls %3,%%d0\n" /* d0 *= volume (0<=volume<=128) */
-" moveb %0@,%%d1\n" /* d1 = *dst */
-" asr #7,%%d0\n" /* d0 /= 128 (SDL_MIX_MAXVOLUME) */
-
-" add %%d1,%%d0\n"
-
-" cmp %%d2,%%d0\n"
-" bges lower_limit_s8\n"
-" move %%d2,%%d0\n"
-"lower_limit_s8:\n"
-
-" cmp %%d3,%%d0\n"
-" bles upper_limit_s8\n"
-" move %%d3,%%d0\n"
-"upper_limit_s8:\n"
-" moveb %%d0,%0@+\n"
-
- /* Loop till done */
-
-" subql #1,%2\n"
-" bhis mixloop_s8\n"
-"stoploop_s8:\n"
-
- : /* no return value */
- : /* input */
- "a"(dst), "a"(src), "d"(len), "d"(volume)
- : /* clobbered registers */
- "d0", "d1", "d2", "d3", "cc", "memory"
- );
-}
-
-void SDL_MixAudio_m68k_S16MSB(short* dst, short* src, long len, long volume)
-{
- __asm__ __volatile__ (
-
- "tstl %2\n"
-" beqs stoploop_s16msb\n"
-" movel #-32768,%%d2\n"
-" movel #32767,%%d3\n"
-" lsrl #1,%2\n"
-"mixloop_s16msb:\n"
-
- /* Mix a sample */
-
-" move %1@+,%%d0\n" /* d0 = *src++ */
-" muls %3,%%d0\n" /* d0 *= volume (0<=volume<=128) */
-" move %0@,%%d1\n" /* d1 = *dst */
-" extl %%d1\n" /* extend d1 to 32 bits */
-" asrl #7,%%d0\n" /* d0 /= 128 (SDL_MIX_MAXVOLUME) */
-
-" addl %%d1,%%d0\n"
-
-" cmpl %%d2,%%d0\n"
-" bges lower_limit_s16msb\n"
-" move %%d2,%%d0\n"
-"lower_limit_s16msb:\n"
-
-" cmpl %%d3,%%d0\n"
-" bles upper_limit_s16msb\n"
-" move %%d3,%%d0\n"
-"upper_limit_s16msb:\n"
-" move %%d0,%0@+\n"
-
- /* Loop till done */
-
-" subql #1,%2\n"
-" bhis mixloop_s16msb\n"
-"stoploop_s16msb:\n"
-
- : /* no return value */
- : /* input */
- "a"(dst), "a"(src), "d"(len), "d"(volume)
- : /* clobbered registers */
- "d0", "d1", "d2", "d3", "cc", "memory"
- );
-}
-
-void SDL_MixAudio_m68k_S16LSB(short* dst, short* src, long len, long volume)
-{
- __asm__ __volatile__ (
-
- "tstl %2\n"
-" beqs stoploop_s16lsb\n"
-" movel #-32768,%%d2\n"
-" movel #32767,%%d3\n"
-" lsrl #1,%2\n"
-"mixloop_s16lsb:\n"
-
- /* Mix a sample */
-
-" move %1@+,%%d0\n" /* d0 = *src++ */
-" rorw #8,%%d0\n"
-" muls %3,%%d0\n" /* d0 *= volume (0<=volume<=128) */
-" move %0@,%%d1\n" /* d1 = *dst */
-" rorw #8,%%d1\n"
-" extl %%d1\n" /* extend d1 to 32 bits */
-" asrl #7,%%d0\n" /* d0 /= 128 (SDL_MIX_MAXVOLUME) */
-
-" addl %%d1,%%d0\n"
-
-" cmpl %%d2,%%d0\n"
-" bges lower_limit_s16lsb\n"
-" move %%d2,%%d0\n"
-"lower_limit_s16lsb:\n"
-
-" cmpl %%d3,%%d0\n"
-" bles upper_limit_s16lsb\n"
-" move %%d3,%%d0\n"
-"upper_limit_s16lsb:\n"
-" rorw #8,%%d0\n"
-" move %%d0,%0@+\n"
-
- /* Loop till done */
-
-" subql #1,%2\n"
-" bhis mixloop_s16lsb\n"
-"stoploop_s16lsb:\n"
-
- : /* no return value */
- : /* input */
- "a"(dst), "a"(src), "d"(len), "d"(volume)
- : /* clobbered registers */
- "d0", "d1", "d2", "d3", "cc", "memory"
- );
-}
-#endif
-
diff --git a/distrib/sdl-1.2.12/src/audio/SDL_mixer_m68k.h b/distrib/sdl-1.2.12/src/audio/SDL_mixer_m68k.h
deleted file mode 100644
index d451dc4..0000000
--- a/distrib/sdl-1.2.12/src/audio/SDL_mixer_m68k.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- m68k assembly mix routines
-
- Patrice Mandin
-*/
-
-#if defined(__M68000__) && defined(__GNUC__)
-void SDL_MixAudio_m68k_U8(char* dst,char* src, long len, long volume, char* mix8);
-void SDL_MixAudio_m68k_S8(char* dst,char* src, long len, long volume);
-
-void SDL_MixAudio_m68k_S16MSB(short* dst,short* src, long len, long volume);
-void SDL_MixAudio_m68k_S16LSB(short* dst,short* src, long len, long volume);
-#endif
diff --git a/distrib/sdl-1.2.12/src/audio/SDL_sysaudio.h b/distrib/sdl-1.2.12/src/audio/SDL_sysaudio.h
deleted file mode 100644
index 1fc920a..0000000
--- a/distrib/sdl-1.2.12/src/audio/SDL_sysaudio.h
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is SDL_free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_sysaudio_h
-#define _SDL_sysaudio_h
-
-#include "SDL_mutex.h"
-#include "SDL_thread.h"
-
-/* The SDL audio driver */
-typedef struct SDL_AudioDevice SDL_AudioDevice;
-
-/* Define the SDL audio driver structure */
-#define _THIS SDL_AudioDevice *_this
-#ifndef _STATUS
-#define _STATUS SDL_status *status
-#endif
-struct SDL_AudioDevice {
- /* * * */
- /* The name of this audio driver */
- const char *name;
-
- /* * * */
- /* The description of this audio driver */
- const char *desc;
-
- /* * * */
- /* Public driver functions */
- int (*OpenAudio)(_THIS, SDL_AudioSpec *spec);
- void (*ThreadInit)(_THIS); /* Called by audio thread at start */
- void (*WaitAudio)(_THIS);
- void (*PlayAudio)(_THIS);
- Uint8 *(*GetAudioBuf)(_THIS);
- void (*WaitDone)(_THIS);
- void (*CloseAudio)(_THIS);
-
- /* * * */
- /* Lock / Unlock functions added for the Mac port */
- void (*LockAudio)(_THIS);
- void (*UnlockAudio)(_THIS);
-
- /* * * */
- /* Data common to all devices */
-
- /* The current audio specification (shared with audio thread) */
- SDL_AudioSpec spec;
-
- /* An audio conversion block for audio format emulation */
- SDL_AudioCVT convert;
-
- /* Current state flags */
- int enabled;
- int paused;
- int opened;
-
- /* Fake audio buffer for when the audio hardware is busy */
- Uint8 *fake_stream;
-
- /* A semaphore for locking the mixing buffers */
- SDL_mutex *mixer_lock;
-
- /* A thread to feed the audio device */
- SDL_Thread *thread;
- Uint32 threadid;
-
- /* * * */
- /* Data private to this driver */
- struct SDL_PrivateAudioData *hidden;
-
- /* * * */
- /* The function used to dispose of this structure */
- void (*free)(_THIS);
-};
-#undef _THIS
-
-typedef struct AudioBootStrap {
- const char *name;
- const char *desc;
- int (*available)(void);
- SDL_AudioDevice *(*create)(int devindex);
-} AudioBootStrap;
-
-#if SDL_AUDIO_DRIVER_BSD
-extern AudioBootStrap BSD_AUDIO_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_PULSE
-extern AudioBootStrap PULSE_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_OSS
-extern AudioBootStrap DSP_bootstrap;
-extern AudioBootStrap DMA_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_ALSA
-extern AudioBootStrap ALSA_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_QNXNTO
-extern AudioBootStrap QNXNTOAUDIO_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_SUNAUDIO
-extern AudioBootStrap SUNAUDIO_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_DMEDIA
-extern AudioBootStrap DMEDIA_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_ARTS
-extern AudioBootStrap ARTS_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_ESD
-extern AudioBootStrap ESD_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_NAS
-extern AudioBootStrap NAS_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_DSOUND
-extern AudioBootStrap DSOUND_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_WAVEOUT
-extern AudioBootStrap WAVEOUT_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_PAUD
-extern AudioBootStrap Paud_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_BAUDIO
-extern AudioBootStrap BAUDIO_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_COREAUDIO
-extern AudioBootStrap COREAUDIO_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_SNDMGR
-extern AudioBootStrap SNDMGR_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_MINT
-extern AudioBootStrap MINTAUDIO_GSXB_bootstrap;
-extern AudioBootStrap MINTAUDIO_MCSN_bootstrap;
-extern AudioBootStrap MINTAUDIO_STFA_bootstrap;
-extern AudioBootStrap MINTAUDIO_XBIOS_bootstrap;
-extern AudioBootStrap MINTAUDIO_DMA8_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_DISK
-extern AudioBootStrap DISKAUD_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_DUMMY
-extern AudioBootStrap DUMMYAUD_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_DC
-extern AudioBootStrap DCAUD_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_NDS
-extern AudioBootStrap NDSAUD_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_MMEAUDIO
-extern AudioBootStrap MMEAUDIO_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_DART
-extern AudioBootStrap DART_bootstrap;
-#endif
-#if SDL_AUDIO_DRIVER_EPOCAUDIO
-extern AudioBootStrap EPOCAudio_bootstrap;
-#endif
-
-/* This is the current audio device */
-extern SDL_AudioDevice *current_audio;
-
-#endif /* _SDL_sysaudio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/SDL_wave.c b/distrib/sdl-1.2.12/src/audio/SDL_wave.c
deleted file mode 100644
index 465195e..0000000
--- a/distrib/sdl-1.2.12/src/audio/SDL_wave.c
+++ /dev/null
@@ -1,597 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Microsoft WAVE file loading routines */
-
-#include "SDL_audio.h"
-#include "SDL_wave.h"
-
-
-static int ReadChunk(SDL_RWops *src, Chunk *chunk);
-
-struct MS_ADPCM_decodestate {
- Uint8 hPredictor;
- Uint16 iDelta;
- Sint16 iSamp1;
- Sint16 iSamp2;
-};
-static struct MS_ADPCM_decoder {
- WaveFMT wavefmt;
- Uint16 wSamplesPerBlock;
- Uint16 wNumCoef;
- Sint16 aCoeff[7][2];
- /* * * */
- struct MS_ADPCM_decodestate state[2];
-} MS_ADPCM_state;
-
-static int InitMS_ADPCM(WaveFMT *format)
-{
- Uint8 *rogue_feel;
- Uint16 extra_info;
- int i;
-
- /* Set the rogue pointer to the MS_ADPCM specific data */
- MS_ADPCM_state.wavefmt.encoding = SDL_SwapLE16(format->encoding);
- MS_ADPCM_state.wavefmt.channels = SDL_SwapLE16(format->channels);
- MS_ADPCM_state.wavefmt.frequency = SDL_SwapLE32(format->frequency);
- MS_ADPCM_state.wavefmt.byterate = SDL_SwapLE32(format->byterate);
- MS_ADPCM_state.wavefmt.blockalign = SDL_SwapLE16(format->blockalign);
- MS_ADPCM_state.wavefmt.bitspersample =
- SDL_SwapLE16(format->bitspersample);
- rogue_feel = (Uint8 *)format+sizeof(*format);
- if ( sizeof(*format) == 16 ) {
- extra_info = ((rogue_feel[1]<<8)|rogue_feel[0]);
- rogue_feel += sizeof(Uint16);
- }
- MS_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1]<<8)|rogue_feel[0]);
- rogue_feel += sizeof(Uint16);
- MS_ADPCM_state.wNumCoef = ((rogue_feel[1]<<8)|rogue_feel[0]);
- rogue_feel += sizeof(Uint16);
- if ( MS_ADPCM_state.wNumCoef != 7 ) {
- SDL_SetError("Unknown set of MS_ADPCM coefficients");
- return(-1);
- }
- for ( i=0; i<MS_ADPCM_state.wNumCoef; ++i ) {
- MS_ADPCM_state.aCoeff[i][0] = ((rogue_feel[1]<<8)|rogue_feel[0]);
- rogue_feel += sizeof(Uint16);
- MS_ADPCM_state.aCoeff[i][1] = ((rogue_feel[1]<<8)|rogue_feel[0]);
- rogue_feel += sizeof(Uint16);
- }
- return(0);
-}
-
-static Sint32 MS_ADPCM_nibble(struct MS_ADPCM_decodestate *state,
- Uint8 nybble, Sint16 *coeff)
-{
- const Sint32 max_audioval = ((1<<(16-1))-1);
- const Sint32 min_audioval = -(1<<(16-1));
- const Sint32 adaptive[] = {
- 230, 230, 230, 230, 307, 409, 512, 614,
- 768, 614, 512, 409, 307, 230, 230, 230
- };
- Sint32 new_sample, delta;
-
- new_sample = ((state->iSamp1 * coeff[0]) +
- (state->iSamp2 * coeff[1]))/256;
- if ( nybble & 0x08 ) {
- new_sample += state->iDelta * (nybble-0x10);
- } else {
- new_sample += state->iDelta * nybble;
- }
- if ( new_sample < min_audioval ) {
- new_sample = min_audioval;
- } else
- if ( new_sample > max_audioval ) {
- new_sample = max_audioval;
- }
- delta = ((Sint32)state->iDelta * adaptive[nybble])/256;
- if ( delta < 16 ) {
- delta = 16;
- }
- state->iDelta = (Uint16)delta;
- state->iSamp2 = state->iSamp1;
- state->iSamp1 = (Sint16)new_sample;
- return(new_sample);
-}
-
-static int MS_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len)
-{
- struct MS_ADPCM_decodestate *state[2];
- Uint8 *freeable, *encoded, *decoded;
- Sint32 encoded_len, samplesleft;
- Sint8 nybble, stereo;
- Sint16 *coeff[2];
- Sint32 new_sample;
-
- /* Allocate the proper sized output buffer */
- encoded_len = *audio_len;
- encoded = *audio_buf;
- freeable = *audio_buf;
- *audio_len = (encoded_len/MS_ADPCM_state.wavefmt.blockalign) *
- MS_ADPCM_state.wSamplesPerBlock*
- MS_ADPCM_state.wavefmt.channels*sizeof(Sint16);
- *audio_buf = (Uint8 *)SDL_malloc(*audio_len);
- if ( *audio_buf == NULL ) {
- SDL_Error(SDL_ENOMEM);
- return(-1);
- }
- decoded = *audio_buf;
-
- /* Get ready... Go! */
- stereo = (MS_ADPCM_state.wavefmt.channels == 2);
- state[0] = &MS_ADPCM_state.state[0];
- state[1] = &MS_ADPCM_state.state[stereo];
- while ( encoded_len >= MS_ADPCM_state.wavefmt.blockalign ) {
- /* Grab the initial information for this block */
- state[0]->hPredictor = *encoded++;
- if ( stereo ) {
- state[1]->hPredictor = *encoded++;
- }
- state[0]->iDelta = ((encoded[1]<<8)|encoded[0]);
- encoded += sizeof(Sint16);
- if ( stereo ) {
- state[1]->iDelta = ((encoded[1]<<8)|encoded[0]);
- encoded += sizeof(Sint16);
- }
- state[0]->iSamp1 = ((encoded[1]<<8)|encoded[0]);
- encoded += sizeof(Sint16);
- if ( stereo ) {
- state[1]->iSamp1 = ((encoded[1]<<8)|encoded[0]);
- encoded += sizeof(Sint16);
- }
- state[0]->iSamp2 = ((encoded[1]<<8)|encoded[0]);
- encoded += sizeof(Sint16);
- if ( stereo ) {
- state[1]->iSamp2 = ((encoded[1]<<8)|encoded[0]);
- encoded += sizeof(Sint16);
- }
- coeff[0] = MS_ADPCM_state.aCoeff[state[0]->hPredictor];
- coeff[1] = MS_ADPCM_state.aCoeff[state[1]->hPredictor];
-
- /* Store the two initial samples we start with */
- decoded[0] = state[0]->iSamp2&0xFF;
- decoded[1] = state[0]->iSamp2>>8;
- decoded += 2;
- if ( stereo ) {
- decoded[0] = state[1]->iSamp2&0xFF;
- decoded[1] = state[1]->iSamp2>>8;
- decoded += 2;
- }
- decoded[0] = state[0]->iSamp1&0xFF;
- decoded[1] = state[0]->iSamp1>>8;
- decoded += 2;
- if ( stereo ) {
- decoded[0] = state[1]->iSamp1&0xFF;
- decoded[1] = state[1]->iSamp1>>8;
- decoded += 2;
- }
-
- /* Decode and store the other samples in this block */
- samplesleft = (MS_ADPCM_state.wSamplesPerBlock-2)*
- MS_ADPCM_state.wavefmt.channels;
- while ( samplesleft > 0 ) {
- nybble = (*encoded)>>4;
- new_sample = MS_ADPCM_nibble(state[0],nybble,coeff[0]);
- decoded[0] = new_sample&0xFF;
- new_sample >>= 8;
- decoded[1] = new_sample&0xFF;
- decoded += 2;
-
- nybble = (*encoded)&0x0F;
- new_sample = MS_ADPCM_nibble(state[1],nybble,coeff[1]);
- decoded[0] = new_sample&0xFF;
- new_sample >>= 8;
- decoded[1] = new_sample&0xFF;
- decoded += 2;
-
- ++encoded;
- samplesleft -= 2;
- }
- encoded_len -= MS_ADPCM_state.wavefmt.blockalign;
- }
- SDL_free(freeable);
- return(0);
-}
-
-struct IMA_ADPCM_decodestate {
- Sint32 sample;
- Sint8 index;
-};
-static struct IMA_ADPCM_decoder {
- WaveFMT wavefmt;
- Uint16 wSamplesPerBlock;
- /* * * */
- struct IMA_ADPCM_decodestate state[2];
-} IMA_ADPCM_state;
-
-static int InitIMA_ADPCM(WaveFMT *format)
-{
- Uint8 *rogue_feel;
- Uint16 extra_info;
-
- /* Set the rogue pointer to the IMA_ADPCM specific data */
- IMA_ADPCM_state.wavefmt.encoding = SDL_SwapLE16(format->encoding);
- IMA_ADPCM_state.wavefmt.channels = SDL_SwapLE16(format->channels);
- IMA_ADPCM_state.wavefmt.frequency = SDL_SwapLE32(format->frequency);
- IMA_ADPCM_state.wavefmt.byterate = SDL_SwapLE32(format->byterate);
- IMA_ADPCM_state.wavefmt.blockalign = SDL_SwapLE16(format->blockalign);
- IMA_ADPCM_state.wavefmt.bitspersample =
- SDL_SwapLE16(format->bitspersample);
- rogue_feel = (Uint8 *)format+sizeof(*format);
- if ( sizeof(*format) == 16 ) {
- extra_info = ((rogue_feel[1]<<8)|rogue_feel[0]);
- rogue_feel += sizeof(Uint16);
- }
- IMA_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1]<<8)|rogue_feel[0]);
- return(0);
-}
-
-static Sint32 IMA_ADPCM_nibble(struct IMA_ADPCM_decodestate *state,Uint8 nybble)
-{
- const Sint32 max_audioval = ((1<<(16-1))-1);
- const Sint32 min_audioval = -(1<<(16-1));
- const int index_table[16] = {
- -1, -1, -1, -1,
- 2, 4, 6, 8,
- -1, -1, -1, -1,
- 2, 4, 6, 8
- };
- const Sint32 step_table[89] = {
- 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, 25, 28, 31,
- 34, 37, 41, 45, 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 130,
- 143, 157, 173, 190, 209, 230, 253, 279, 307, 337, 371, 408,
- 449, 494, 544, 598, 658, 724, 796, 876, 963, 1060, 1166, 1282,
- 1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024, 3327,
- 3660, 4026, 4428, 4871, 5358, 5894, 6484, 7132, 7845, 8630,
- 9493, 10442, 11487, 12635, 13899, 15289, 16818, 18500, 20350,
- 22385, 24623, 27086, 29794, 32767
- };
- Sint32 delta, step;
-
- /* Compute difference and new sample value */
- step = step_table[state->index];
- delta = step >> 3;
- if ( nybble & 0x04 ) delta += step;
- if ( nybble & 0x02 ) delta += (step >> 1);
- if ( nybble & 0x01 ) delta += (step >> 2);
- if ( nybble & 0x08 ) delta = -delta;
- state->sample += delta;
-
- /* Update index value */
- state->index += index_table[nybble];
- if ( state->index > 88 ) {
- state->index = 88;
- } else
- if ( state->index < 0 ) {
- state->index = 0;
- }
-
- /* Clamp output sample */
- if ( state->sample > max_audioval ) {
- state->sample = max_audioval;
- } else
- if ( state->sample < min_audioval ) {
- state->sample = min_audioval;
- }
- return(state->sample);
-}
-
-/* Fill the decode buffer with a channel block of data (8 samples) */
-static void Fill_IMA_ADPCM_block(Uint8 *decoded, Uint8 *encoded,
- int channel, int numchannels, struct IMA_ADPCM_decodestate *state)
-{
- int i;
- Sint8 nybble;
- Sint32 new_sample;
-
- decoded += (channel * 2);
- for ( i=0; i<4; ++i ) {
- nybble = (*encoded)&0x0F;
- new_sample = IMA_ADPCM_nibble(state, nybble);
- decoded[0] = new_sample&0xFF;
- new_sample >>= 8;
- decoded[1] = new_sample&0xFF;
- decoded += 2 * numchannels;
-
- nybble = (*encoded)>>4;
- new_sample = IMA_ADPCM_nibble(state, nybble);
- decoded[0] = new_sample&0xFF;
- new_sample >>= 8;
- decoded[1] = new_sample&0xFF;
- decoded += 2 * numchannels;
-
- ++encoded;
- }
-}
-
-static int IMA_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len)
-{
- struct IMA_ADPCM_decodestate *state;
- Uint8 *freeable, *encoded, *decoded;
- Sint32 encoded_len, samplesleft;
- unsigned int c, channels;
-
- /* Check to make sure we have enough variables in the state array */
- channels = IMA_ADPCM_state.wavefmt.channels;
- if ( channels > SDL_arraysize(IMA_ADPCM_state.state) ) {
- SDL_SetError("IMA ADPCM decoder can only handle %d channels",
- SDL_arraysize(IMA_ADPCM_state.state));
- return(-1);
- }
- state = IMA_ADPCM_state.state;
-
- /* Allocate the proper sized output buffer */
- encoded_len = *audio_len;
- encoded = *audio_buf;
- freeable = *audio_buf;
- *audio_len = (encoded_len/IMA_ADPCM_state.wavefmt.blockalign) *
- IMA_ADPCM_state.wSamplesPerBlock*
- IMA_ADPCM_state.wavefmt.channels*sizeof(Sint16);
- *audio_buf = (Uint8 *)SDL_malloc(*audio_len);
- if ( *audio_buf == NULL ) {
- SDL_Error(SDL_ENOMEM);
- return(-1);
- }
- decoded = *audio_buf;
-
- /* Get ready... Go! */
- while ( encoded_len >= IMA_ADPCM_state.wavefmt.blockalign ) {
- /* Grab the initial information for this block */
- for ( c=0; c<channels; ++c ) {
- /* Fill the state information for this block */
- state[c].sample = ((encoded[1]<<8)|encoded[0]);
- encoded += 2;
- if ( state[c].sample & 0x8000 ) {
- state[c].sample -= 0x10000;
- }
- state[c].index = *encoded++;
- /* Reserved byte in buffer header, should be 0 */
- if ( *encoded++ != 0 ) {
- /* Uh oh, corrupt data? Buggy code? */;
- }
-
- /* Store the initial sample we start with */
- decoded[0] = (Uint8)(state[c].sample&0xFF);
- decoded[1] = (Uint8)(state[c].sample>>8);
- decoded += 2;
- }
-
- /* Decode and store the other samples in this block */
- samplesleft = (IMA_ADPCM_state.wSamplesPerBlock-1)*channels;
- while ( samplesleft > 0 ) {
- for ( c=0; c<channels; ++c ) {
- Fill_IMA_ADPCM_block(decoded, encoded,
- c, channels, &state[c]);
- encoded += 4;
- samplesleft -= 8;
- }
- decoded += (channels * 8 * 2);
- }
- encoded_len -= IMA_ADPCM_state.wavefmt.blockalign;
- }
- SDL_free(freeable);
- return(0);
-}
-
-SDL_AudioSpec * SDL_LoadWAV_RW (SDL_RWops *src, int freesrc,
- SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
-{
- int was_error;
- Chunk chunk;
- int lenread;
- int MS_ADPCM_encoded, IMA_ADPCM_encoded;
- int samplesize;
-
- /* WAV magic header */
- Uint32 RIFFchunk;
- Uint32 wavelen = 0;
- Uint32 WAVEmagic;
- Uint32 headerDiff = 0;
-
- /* FMT chunk */
- WaveFMT *format = NULL;
-
- /* Make sure we are passed a valid data source */
- was_error = 0;
- if ( src == NULL ) {
- was_error = 1;
- goto done;
- }
-
- /* Check the magic header */
- RIFFchunk = SDL_ReadLE32(src);
- wavelen = SDL_ReadLE32(src);
- if ( wavelen == WAVE ) { /* The RIFFchunk has already been read */
- WAVEmagic = wavelen;
- wavelen = RIFFchunk;
- RIFFchunk = RIFF;
- } else {
- WAVEmagic = SDL_ReadLE32(src);
- }
- if ( (RIFFchunk != RIFF) || (WAVEmagic != WAVE) ) {
- SDL_SetError("Unrecognized file type (not WAVE)");
- was_error = 1;
- goto done;
- }
- headerDiff += sizeof(Uint32); /* for WAVE */
-
- /* Read the audio data format chunk */
- chunk.data = NULL;
- do {
- if ( chunk.data != NULL ) {
- SDL_free(chunk.data);
- }
- lenread = ReadChunk(src, &chunk);
- if ( lenread < 0 ) {
- was_error = 1;
- goto done;
- }
- /* 2 Uint32's for chunk header+len, plus the lenread */
- headerDiff += lenread + 2 * sizeof(Uint32);
- } while ( (chunk.magic == FACT) || (chunk.magic == LIST) );
-
- /* Decode the audio data format */
- format = (WaveFMT *)chunk.data;
- if ( chunk.magic != FMT ) {
- SDL_SetError("Complex WAVE files not supported");
- was_error = 1;
- goto done;
- }
- MS_ADPCM_encoded = IMA_ADPCM_encoded = 0;
- switch (SDL_SwapLE16(format->encoding)) {
- case PCM_CODE:
- /* We can understand this */
- break;
- case MS_ADPCM_CODE:
- /* Try to understand this */
- if ( InitMS_ADPCM(format) < 0 ) {
- was_error = 1;
- goto done;
- }
- MS_ADPCM_encoded = 1;
- break;
- case IMA_ADPCM_CODE:
- /* Try to understand this */
- if ( InitIMA_ADPCM(format) < 0 ) {
- was_error = 1;
- goto done;
- }
- IMA_ADPCM_encoded = 1;
- break;
- case MP3_CODE:
- SDL_SetError("MPEG Layer 3 data not supported",
- SDL_SwapLE16(format->encoding));
- was_error = 1;
- goto done;
- default:
- SDL_SetError("Unknown WAVE data format: 0x%.4x",
- SDL_SwapLE16(format->encoding));
- was_error = 1;
- goto done;
- }
- SDL_memset(spec, 0, (sizeof *spec));
- spec->freq = SDL_SwapLE32(format->frequency);
- switch (SDL_SwapLE16(format->bitspersample)) {
- case 4:
- if ( MS_ADPCM_encoded || IMA_ADPCM_encoded ) {
- spec->format = AUDIO_S16;
- } else {
- was_error = 1;
- }
- break;
- case 8:
- spec->format = AUDIO_U8;
- break;
- case 16:
- spec->format = AUDIO_S16;
- break;
- default:
- was_error = 1;
- break;
- }
- if ( was_error ) {
- SDL_SetError("Unknown %d-bit PCM data format",
- SDL_SwapLE16(format->bitspersample));
- goto done;
- }
- spec->channels = (Uint8)SDL_SwapLE16(format->channels);
- spec->samples = 4096; /* Good default buffer size */
-
- /* Read the audio data chunk */
- *audio_buf = NULL;
- do {
- if ( *audio_buf != NULL ) {
- SDL_free(*audio_buf);
- }
- lenread = ReadChunk(src, &chunk);
- if ( lenread < 0 ) {
- was_error = 1;
- goto done;
- }
- *audio_len = lenread;
- *audio_buf = chunk.data;
- if(chunk.magic != DATA) headerDiff += lenread + 2 * sizeof(Uint32);
- } while ( chunk.magic != DATA );
- headerDiff += 2 * sizeof(Uint32); /* for the data chunk and len */
-
- if ( MS_ADPCM_encoded ) {
- if ( MS_ADPCM_decode(audio_buf, audio_len) < 0 ) {
- was_error = 1;
- goto done;
- }
- }
- if ( IMA_ADPCM_encoded ) {
- if ( IMA_ADPCM_decode(audio_buf, audio_len) < 0 ) {
- was_error = 1;
- goto done;
- }
- }
-
- /* Don't return a buffer that isn't a multiple of samplesize */
- samplesize = ((spec->format & 0xFF)/8)*spec->channels;
- *audio_len &= ~(samplesize-1);
-
-done:
- if ( format != NULL ) {
- SDL_free(format);
- }
- if ( src ) {
- if ( freesrc ) {
- SDL_RWclose(src);
- } else {
- /* seek to the end of the file (given by the RIFF chunk) */
- SDL_RWseek(src, wavelen - chunk.length - headerDiff, RW_SEEK_CUR);
- }
- }
- if ( was_error ) {
- spec = NULL;
- }
- return(spec);
-}
-
-/* Since the WAV memory is allocated in the shared library, it must also
- be freed here. (Necessary under Win32, VC++)
- */
-void SDL_FreeWAV(Uint8 *audio_buf)
-{
- if ( audio_buf != NULL ) {
- SDL_free(audio_buf);
- }
-}
-
-static int ReadChunk(SDL_RWops *src, Chunk *chunk)
-{
- chunk->magic = SDL_ReadLE32(src);
- chunk->length = SDL_ReadLE32(src);
- chunk->data = (Uint8 *)SDL_malloc(chunk->length);
- if ( chunk->data == NULL ) {
- SDL_Error(SDL_ENOMEM);
- return(-1);
- }
- if ( SDL_RWread(src, chunk->data, chunk->length, 1) != 1 ) {
- SDL_Error(SDL_EFREAD);
- SDL_free(chunk->data);
- return(-1);
- }
- return(chunk->length);
-}
diff --git a/distrib/sdl-1.2.12/src/audio/SDL_wave.h b/distrib/sdl-1.2.12/src/audio/SDL_wave.h
deleted file mode 100644
index a0af6eb..0000000
--- a/distrib/sdl-1.2.12/src/audio/SDL_wave.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is SDL_free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* WAVE files are little-endian */
-
-/*******************************************/
-/* Define values for Microsoft WAVE format */
-/*******************************************/
-#define RIFF 0x46464952 /* "RIFF" */
-#define WAVE 0x45564157 /* "WAVE" */
-#define FACT 0x74636166 /* "fact" */
-#define LIST 0x5453494c /* "LIST" */
-#define FMT 0x20746D66 /* "fmt " */
-#define DATA 0x61746164 /* "data" */
-#define PCM_CODE 0x0001
-#define MS_ADPCM_CODE 0x0002
-#define IMA_ADPCM_CODE 0x0011
-#define MP3_CODE 0x0055
-#define WAVE_MONO 1
-#define WAVE_STEREO 2
-
-/* Normally, these three chunks come consecutively in a WAVE file */
-typedef struct WaveFMT {
-/* Not saved in the chunk we read:
- Uint32 FMTchunk;
- Uint32 fmtlen;
-*/
- Uint16 encoding;
- Uint16 channels; /* 1 = mono, 2 = stereo */
- Uint32 frequency; /* One of 11025, 22050, or 44100 Hz */
- Uint32 byterate; /* Average bytes per second */
- Uint16 blockalign; /* Bytes per sample block */
- Uint16 bitspersample; /* One of 8, 12, 16, or 4 for ADPCM */
-} WaveFMT;
-
-/* The general chunk found in the WAVE file */
-typedef struct Chunk {
- Uint32 magic;
- Uint32 length;
- Uint8 *data;
-} Chunk;
-
diff --git a/distrib/sdl-1.2.12/src/audio/alsa/SDL_alsa_audio.c b/distrib/sdl-1.2.12/src/audio/alsa/SDL_alsa_audio.c
deleted file mode 100644
index a5138d1..0000000
--- a/distrib/sdl-1.2.12/src/audio/alsa/SDL_alsa_audio.c
+++ /dev/null
@@ -1,538 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Allow access to a raw mixing buffer */
-
-#include <sys/types.h>
-#include <signal.h> /* For kill() */
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "SDL_alsa_audio.h"
-
-#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
-#include <dlfcn.h>
-#include "SDL_name.h"
-#include "SDL_loadso.h"
-#else
-#define SDL_NAME(X) X
-#endif
-
-
-/* The tag name used by ALSA audio */
-#define DRIVER_NAME "alsa"
-
-/* The default ALSA audio driver */
-#define DEFAULT_DEVICE "default"
-
-/* Audio driver functions */
-static int ALSA_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void ALSA_WaitAudio(_THIS);
-static void ALSA_PlayAudio(_THIS);
-static Uint8 *ALSA_GetAudioBuf(_THIS);
-static void ALSA_CloseAudio(_THIS);
-
-#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
-
-static const char *alsa_library = SDL_AUDIO_DRIVER_ALSA_DYNAMIC;
-static void *alsa_handle = NULL;
-static int alsa_loaded = 0;
-
-static int (*SDL_snd_pcm_open)(snd_pcm_t **pcm, const char *name, snd_pcm_stream_t stream, int mode);
-static int (*SDL_NAME(snd_pcm_open))(snd_pcm_t **pcm, const char *name, snd_pcm_stream_t stream, int mode);
-static int (*SDL_NAME(snd_pcm_close))(snd_pcm_t *pcm);
-static snd_pcm_sframes_t (*SDL_NAME(snd_pcm_writei))(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
-static int (*SDL_NAME(snd_pcm_resume))(snd_pcm_t *pcm);
-static int (*SDL_NAME(snd_pcm_prepare))(snd_pcm_t *pcm);
-static int (*SDL_NAME(snd_pcm_drain))(snd_pcm_t *pcm);
-static const char *(*SDL_NAME(snd_strerror))(int errnum);
-static size_t (*SDL_NAME(snd_pcm_hw_params_sizeof))(void);
-static size_t (*SDL_NAME(snd_pcm_sw_params_sizeof))(void);
-static int (*SDL_NAME(snd_pcm_hw_params_any))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
-static int (*SDL_NAME(snd_pcm_hw_params_set_access))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t access);
-static int (*SDL_NAME(snd_pcm_hw_params_set_format))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
-static int (*SDL_NAME(snd_pcm_hw_params_set_channels))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
-static int (*SDL_NAME(snd_pcm_hw_params_get_channels))(const snd_pcm_hw_params_t *params);
-static unsigned int (*SDL_NAME(snd_pcm_hw_params_set_rate_near))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int *dir);
-static snd_pcm_uframes_t (*SDL_NAME(snd_pcm_hw_params_set_period_size_near))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val, int *dir);
-static snd_pcm_sframes_t (*SDL_NAME(snd_pcm_hw_params_get_period_size))(const snd_pcm_hw_params_t *params);
-static unsigned int (*SDL_NAME(snd_pcm_hw_params_set_periods_near))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int *dir);
-static int (*SDL_NAME(snd_pcm_hw_params_get_periods))(snd_pcm_hw_params_t *params);
-static int (*SDL_NAME(snd_pcm_hw_params))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
-/*
-*/
-static int (*SDL_NAME(snd_pcm_sw_params_current))(snd_pcm_t *pcm, snd_pcm_sw_params_t *swparams);
-static int (*SDL_NAME(snd_pcm_sw_params_set_start_threshold))(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
-static int (*SDL_NAME(snd_pcm_sw_params_set_avail_min))(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
-static int (*SDL_NAME(snd_pcm_sw_params))(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
-static int (*SDL_NAME(snd_pcm_nonblock))(snd_pcm_t *pcm, int nonblock);
-#define snd_pcm_hw_params_sizeof SDL_NAME(snd_pcm_hw_params_sizeof)
-#define snd_pcm_sw_params_sizeof SDL_NAME(snd_pcm_sw_params_sizeof)
-
-/* cast funcs to char* first, to please GCC's strict aliasing rules. */
-static struct {
- const char *name;
- void **func;
-} alsa_functions[] = {
- { "snd_pcm_open", (void**)(char*)&SDL_NAME(snd_pcm_open) },
- { "snd_pcm_close", (void**)(char*)&SDL_NAME(snd_pcm_close) },
- { "snd_pcm_writei", (void**)(char*)&SDL_NAME(snd_pcm_writei) },
- { "snd_pcm_resume", (void**)(char*)&SDL_NAME(snd_pcm_resume) },
- { "snd_pcm_prepare", (void**)(char*)&SDL_NAME(snd_pcm_prepare) },
- { "snd_pcm_drain", (void**)(char*)&SDL_NAME(snd_pcm_drain) },
- { "snd_strerror", (void**)(char*)&SDL_NAME(snd_strerror) },
- { "snd_pcm_hw_params_sizeof", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_sizeof) },
- { "snd_pcm_sw_params_sizeof", (void**)(char*)&SDL_NAME(snd_pcm_sw_params_sizeof) },
- { "snd_pcm_hw_params_any", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_any) },
- { "snd_pcm_hw_params_set_access", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_set_access) },
- { "snd_pcm_hw_params_set_format", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_set_format) },
- { "snd_pcm_hw_params_set_channels", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_set_channels) },
- { "snd_pcm_hw_params_get_channels", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_get_channels) },
- { "snd_pcm_hw_params_set_rate_near", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_set_rate_near) },
- { "snd_pcm_hw_params_set_period_size_near", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_set_period_size_near) },
- { "snd_pcm_hw_params_get_period_size", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_get_period_size) },
- { "snd_pcm_hw_params_set_periods_near", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_set_periods_near) },
- { "snd_pcm_hw_params_get_periods", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_get_periods) },
- { "snd_pcm_hw_params", (void**)(char*)&SDL_NAME(snd_pcm_hw_params) },
- { "snd_pcm_sw_params_current", (void**)(char*)&SDL_NAME(snd_pcm_sw_params_current) },
- { "snd_pcm_sw_params_set_start_threshold", (void**)(char*)&SDL_NAME(snd_pcm_sw_params_set_start_threshold) },
- { "snd_pcm_sw_params_set_avail_min", (void**)(char*)&SDL_NAME(snd_pcm_sw_params_set_avail_min) },
- { "snd_pcm_sw_params", (void**)(char*)&SDL_NAME(snd_pcm_sw_params) },
- { "snd_pcm_nonblock", (void**)(char*)&SDL_NAME(snd_pcm_nonblock) },
-};
-
-static void UnloadALSALibrary(void) {
- if (alsa_loaded) {
-/* SDL_UnloadObject(alsa_handle);*/
- dlclose(alsa_handle);
- alsa_handle = NULL;
- alsa_loaded = 0;
- }
-}
-
-static int LoadALSALibrary(void) {
- int i, retval = -1;
-
-/* alsa_handle = SDL_LoadObject(alsa_library);*/
- alsa_handle = dlopen(alsa_library,RTLD_NOW);
- if (alsa_handle) {
- alsa_loaded = 1;
- retval = 0;
- for (i = 0; i < SDL_arraysize(alsa_functions); i++) {
-/* *alsa_functions[i].func = SDL_LoadFunction(alsa_handle,alsa_functions[i].name);*/
-#if HAVE_DLVSYM
- *alsa_functions[i].func = dlvsym(alsa_handle,alsa_functions[i].name,"ALSA_0.9");
- if (!*alsa_functions[i].func)
-#endif
- *alsa_functions[i].func = dlsym(alsa_handle,alsa_functions[i].name);
- if (!*alsa_functions[i].func) {
- retval = -1;
- UnloadALSALibrary();
- break;
- }
- }
- }
- return retval;
-}
-
-#else
-
-static void UnloadALSALibrary(void) {
- return;
-}
-
-static int LoadALSALibrary(void) {
- return 0;
-}
-
-#endif /* SDL_AUDIO_DRIVER_ALSA_DYNAMIC */
-
-static const char *get_audio_device(int channels)
-{
- const char *device;
-
- device = SDL_getenv("AUDIODEV"); /* Is there a standard variable name? */
- if ( device == NULL ) {
- if (channels == 6) device = "surround51";
- else if (channels == 4) device = "surround40";
- else device = DEFAULT_DEVICE;
- }
- return device;
-}
-
-/* Audio driver bootstrap functions */
-
-static int Audio_Available(void)
-{
- int available;
- int status;
- snd_pcm_t *handle;
-
- available = 0;
- if (LoadALSALibrary() < 0) {
- return available;
- }
- status = SDL_NAME(snd_pcm_open)(&handle, get_audio_device(2), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK);
- if ( status >= 0 ) {
- available = 1;
- SDL_NAME(snd_pcm_close)(handle);
- }
- UnloadALSALibrary();
- return(available);
-}
-
-static void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
- UnloadALSALibrary();
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- LoadALSALibrary();
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
- /* Set the function pointers */
- this->OpenAudio = ALSA_OpenAudio;
- this->WaitAudio = ALSA_WaitAudio;
- this->PlayAudio = ALSA_PlayAudio;
- this->GetAudioBuf = ALSA_GetAudioBuf;
- this->CloseAudio = ALSA_CloseAudio;
-
- this->free = Audio_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap ALSA_bootstrap = {
- DRIVER_NAME, "ALSA 0.9 PCM audio",
- Audio_Available, Audio_CreateDevice
-};
-
-/* This function waits until it is possible to write a full sound buffer */
-static void ALSA_WaitAudio(_THIS)
-{
- /* Check to see if the thread-parent process is still alive */
- { static int cnt = 0;
- /* Note that this only works with thread implementations
- that use a different process id for each thread.
- */
- if (parent && (((++cnt)%10) == 0)) { /* Check every 10 loops */
- if ( kill(parent, 0) < 0 ) {
- this->enabled = 0;
- }
- }
- }
-}
-
-
-/*
- * http://bugzilla.libsdl.org/show_bug.cgi?id=110
- * "For Linux ALSA, this is FL-FR-RL-RR-C-LFE
- * and for Windows DirectX [and CoreAudio], this is FL-FR-C-LFE-RL-RR"
- */
-#define SWIZ6(T) \
- T *ptr = (T *) mixbuf; \
- const Uint32 count = (this->spec.samples / 6); \
- Uint32 i; \
- for (i = 0; i < count; i++, ptr += 6) { \
- T tmp; \
- tmp = ptr[2]; ptr[2] = ptr[4]; ptr[4] = tmp; \
- tmp = ptr[3]; ptr[3] = ptr[5]; ptr[5] = tmp; \
- }
-
-static __inline__ void swizzle_alsa_channels_6_64bit(_THIS) { SWIZ6(Uint64); }
-static __inline__ void swizzle_alsa_channels_6_32bit(_THIS) { SWIZ6(Uint32); }
-static __inline__ void swizzle_alsa_channels_6_16bit(_THIS) { SWIZ6(Uint16); }
-static __inline__ void swizzle_alsa_channels_6_8bit(_THIS) { SWIZ6(Uint8); }
-
-#undef SWIZ6
-
-
-/*
- * Called right before feeding this->mixbuf to the hardware. Swizzle channels
- * from Windows/Mac order to the format alsalib will want.
- */
-static __inline__ void swizzle_alsa_channels(_THIS)
-{
- if (this->spec.channels == 6) {
- const Uint16 fmtsize = (this->spec.format & 0xFF); /* bits/channel. */
- if (fmtsize == 16)
- swizzle_alsa_channels_6_16bit(this);
- else if (fmtsize == 8)
- swizzle_alsa_channels_6_8bit(this);
- else if (fmtsize == 32)
- swizzle_alsa_channels_6_32bit(this);
- else if (fmtsize == 64)
- swizzle_alsa_channels_6_64bit(this);
- }
-
- /* !!! FIXME: update this for 7.1 if needed, later. */
-}
-
-
-static void ALSA_PlayAudio(_THIS)
-{
- int status;
- int sample_len;
- signed short *sample_buf;
-
- swizzle_alsa_channels(this);
-
- sample_len = this->spec.samples;
- sample_buf = (signed short *)mixbuf;
-
- while ( sample_len > 0 ) {
- status = SDL_NAME(snd_pcm_writei)(pcm_handle, sample_buf, sample_len);
- if ( status < 0 ) {
- if ( status == -EAGAIN ) {
- SDL_Delay(1);
- continue;
- }
- if ( status == -ESTRPIPE ) {
- do {
- SDL_Delay(1);
- status = SDL_NAME(snd_pcm_resume)(pcm_handle);
- } while ( status == -EAGAIN );
- }
- if ( status < 0 ) {
- status = SDL_NAME(snd_pcm_prepare)(pcm_handle);
- }
- if ( status < 0 ) {
- /* Hmm, not much we can do - abort */
- this->enabled = 0;
- return;
- }
- continue;
- }
- sample_buf += status * this->spec.channels;
- sample_len -= status;
- }
-}
-
-static Uint8 *ALSA_GetAudioBuf(_THIS)
-{
- return(mixbuf);
-}
-
-static void ALSA_CloseAudio(_THIS)
-{
- if ( mixbuf != NULL ) {
- SDL_FreeAudioMem(mixbuf);
- mixbuf = NULL;
- }
- if ( pcm_handle ) {
- SDL_NAME(snd_pcm_drain)(pcm_handle);
- SDL_NAME(snd_pcm_close)(pcm_handle);
- pcm_handle = NULL;
- }
-}
-
-static int ALSA_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- int status;
- snd_pcm_hw_params_t *hwparams;
- snd_pcm_sw_params_t *swparams;
- snd_pcm_format_t format;
- snd_pcm_uframes_t frames;
- Uint16 test_format;
-
- /* Open the audio device */
- /* Name of device should depend on # channels in spec */
- status = SDL_NAME(snd_pcm_open)(&pcm_handle, get_audio_device(spec->channels), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK);
-
- if ( status < 0 ) {
- SDL_SetError("Couldn't open audio device: %s", SDL_NAME(snd_strerror)(status));
- return(-1);
- }
-
- /* Figure out what the hardware is capable of */
- snd_pcm_hw_params_alloca(&hwparams);
- status = SDL_NAME(snd_pcm_hw_params_any)(pcm_handle, hwparams);
- if ( status < 0 ) {
- SDL_SetError("Couldn't get hardware config: %s", SDL_NAME(snd_strerror)(status));
- ALSA_CloseAudio(this);
- return(-1);
- }
-
- /* SDL only uses interleaved sample output */
- status = SDL_NAME(snd_pcm_hw_params_set_access)(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED);
- if ( status < 0 ) {
- SDL_SetError("Couldn't set interleaved access: %s", SDL_NAME(snd_strerror)(status));
- ALSA_CloseAudio(this);
- return(-1);
- }
-
- /* Try for a closest match on audio format */
- status = -1;
- for ( test_format = SDL_FirstAudioFormat(spec->format);
- test_format && (status < 0); ) {
- switch ( test_format ) {
- case AUDIO_U8:
- format = SND_PCM_FORMAT_U8;
- break;
- case AUDIO_S8:
- format = SND_PCM_FORMAT_S8;
- break;
- case AUDIO_S16LSB:
- format = SND_PCM_FORMAT_S16_LE;
- break;
- case AUDIO_S16MSB:
- format = SND_PCM_FORMAT_S16_BE;
- break;
- case AUDIO_U16LSB:
- format = SND_PCM_FORMAT_U16_LE;
- break;
- case AUDIO_U16MSB:
- format = SND_PCM_FORMAT_U16_BE;
- break;
- default:
- format = 0;
- break;
- }
- if ( format != 0 ) {
- status = SDL_NAME(snd_pcm_hw_params_set_format)(pcm_handle, hwparams, format);
- }
- if ( status < 0 ) {
- test_format = SDL_NextAudioFormat();
- }
- }
- if ( status < 0 ) {
- SDL_SetError("Couldn't find any hardware audio formats");
- ALSA_CloseAudio(this);
- return(-1);
- }
- spec->format = test_format;
-
- /* Set the number of channels */
- status = SDL_NAME(snd_pcm_hw_params_set_channels)(pcm_handle, hwparams, spec->channels);
- if ( status < 0 ) {
- status = SDL_NAME(snd_pcm_hw_params_get_channels)(hwparams);
- if ( (status <= 0) || (status > 2) ) {
- SDL_SetError("Couldn't set audio channels");
- ALSA_CloseAudio(this);
- return(-1);
- }
- spec->channels = status;
- }
-
- /* Set the audio rate */
- status = SDL_NAME(snd_pcm_hw_params_set_rate_near)(pcm_handle, hwparams, spec->freq, NULL);
- if ( status < 0 ) {
- SDL_SetError("Couldn't set audio frequency: %s", SDL_NAME(snd_strerror)(status));
- ALSA_CloseAudio(this);
- return(-1);
- }
- spec->freq = status;
-
- /* Set the buffer size, in samples */
- frames = spec->samples;
- frames = SDL_NAME(snd_pcm_hw_params_set_period_size_near)(pcm_handle, hwparams, frames, NULL);
- spec->samples = frames;
- SDL_NAME(snd_pcm_hw_params_set_periods_near)(pcm_handle, hwparams, 2, NULL);
-
- /* "set" the hardware with the desired parameters */
- status = SDL_NAME(snd_pcm_hw_params)(pcm_handle, hwparams);
- if ( status < 0 ) {
- SDL_SetError("Couldn't set hardware audio parameters: %s", SDL_NAME(snd_strerror)(status));
- ALSA_CloseAudio(this);
- return(-1);
- }
-
-/* This is useful for debugging... */
-/*
-{ snd_pcm_sframes_t bufsize; int fragments;
- bufsize = SDL_NAME(snd_pcm_hw_params_get_period_size)(hwparams);
- fragments = SDL_NAME(snd_pcm_hw_params_get_periods)(hwparams);
-
- fprintf(stderr, "ALSA: bufsize = %ld, fragments = %d\n", bufsize, fragments);
-}
-*/
-
- /* Set the software parameters */
- snd_pcm_sw_params_alloca(&swparams);
- status = SDL_NAME(snd_pcm_sw_params_current)(pcm_handle, swparams);
- if ( status < 0 ) {
- SDL_SetError("Couldn't get software config: %s", SDL_NAME(snd_strerror)(status));
- ALSA_CloseAudio(this);
- return(-1);
- }
- status = SDL_NAME(snd_pcm_sw_params_set_start_threshold)(pcm_handle, swparams, 0);
- if ( status < 0 ) {
- SDL_SetError("Couldn't set start threshold: %s", SDL_NAME(snd_strerror)(status));
- ALSA_CloseAudio(this);
- return(-1);
- }
- status = SDL_NAME(snd_pcm_sw_params_set_avail_min)(pcm_handle, swparams, frames);
- if ( status < 0 ) {
- SDL_SetError("Couldn't set avail min: %s", SDL_NAME(snd_strerror)(status));
- ALSA_CloseAudio(this);
- return(-1);
- }
- status = SDL_NAME(snd_pcm_sw_params)(pcm_handle, swparams);
- if ( status < 0 ) {
- SDL_SetError("Couldn't set software audio parameters: %s", SDL_NAME(snd_strerror)(status));
- ALSA_CloseAudio(this);
- return(-1);
- }
-
- /* Calculate the final parameters for this audio specification */
- SDL_CalculateAudioSpec(spec);
-
- /* Allocate mixing buffer */
- mixlen = spec->size;
- mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen);
- if ( mixbuf == NULL ) {
- ALSA_CloseAudio(this);
- return(-1);
- }
- SDL_memset(mixbuf, spec->silence, spec->size);
-
- /* Get the parent process id (we're the parent of the audio thread) */
- parent = getpid();
-
- /* Switch to blocking mode for playback */
- SDL_NAME(snd_pcm_nonblock)(pcm_handle, 0);
-
- /* We're ready to rock and roll. :-) */
- return(0);
-}
diff --git a/distrib/sdl-1.2.12/src/audio/alsa/SDL_alsa_audio.h b/distrib/sdl-1.2.12/src/audio/alsa/SDL_alsa_audio.h
deleted file mode 100644
index fd9ac03..0000000
--- a/distrib/sdl-1.2.12/src/audio/alsa/SDL_alsa_audio.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _ALSA_PCM_audio_h
-#define _ALSA_PCM_audio_h
-
-#define ALSA_PCM_OLD_HW_PARAMS_API
-#define ALSA_PCM_OLD_SW_PARAMS_API
-#include <alsa/asoundlib.h>
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData {
- /* The audio device handle */
- snd_pcm_t *pcm_handle;
-
- /* The parent process id, to detect when application quits */
- pid_t parent;
-
- /* Raw mixing buffer */
- Uint8 *mixbuf;
- int mixlen;
-};
-
-/* Old variable names */
-#define pcm_handle (this->hidden->pcm_handle)
-#define parent (this->hidden->parent)
-#define mixbuf (this->hidden->mixbuf)
-#define mixlen (this->hidden->mixlen)
-
-#endif /* _ALSA_PCM_audio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/amigaos/SDL_ahiaudio.c b/distrib/sdl-1.2.12/src/audio/amigaos/SDL_ahiaudio.c
deleted file mode 100644
index c9a4c1a..0000000
--- a/distrib/sdl-1.2.12/src/audio/amigaos/SDL_ahiaudio.c
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Allow access to a raw mixing buffer (for AmigaOS) */
-
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "SDL_ahiaudio.h"
-
-/* Audio driver functions */
-static int AHI_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void AHI_WaitAudio(_THIS);
-static void AHI_PlayAudio(_THIS);
-static Uint8 *AHI_GetAudioBuf(_THIS);
-static void AHI_CloseAudio(_THIS);
-
-#ifndef __SASC
- #define mymalloc(x) AllocVec(x,MEMF_PUBLIC)
- #define myfree FreeVec
-#else
- #define mymalloc malloc
- #define myfree free
-#endif
-
-/* Audio driver bootstrap functions */
-
-static int Audio_Available(void)
-{
- int ok=0;
- struct MsgPort *p;
- struct AHIRequest *req;
-
- if(p=CreateMsgPort())
- {
- if(req=(struct AHIRequest *)CreateIORequest(p,sizeof(struct AHIRequest)))
- {
- req->ahir_Version=4;
-
- if(!OpenDevice(AHINAME,0,(struct IORequest *)req,NULL))
- {
- D(bug("AHI available.\n"));
- ok=1;
- CloseDevice((struct IORequest *)req);
- }
- DeleteIORequest((struct IORequest *)req);
- }
- DeleteMsgPort(p);
- }
-
- D(if(!ok) bug("AHI not available\n"));
- return ok;
-}
-
-static void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
-#ifndef NO_AMIGADEBUG
- D(bug("AHI created...\n"));
-#endif
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
- /* Set the function pointers */
- this->OpenAudio = AHI_OpenAudio;
- this->WaitAudio = AHI_WaitAudio;
- this->PlayAudio = AHI_PlayAudio;
- this->GetAudioBuf = AHI_GetAudioBuf;
- this->CloseAudio = AHI_CloseAudio;
-
- this->free = Audio_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap AHI_bootstrap = {
- "AHI", Audio_Available, Audio_CreateDevice
-};
-
-
-void static AHI_WaitAudio(_THIS)
-{
- if(!CheckIO((struct IORequest *)audio_req[current_buffer]))
- {
- WaitIO((struct IORequest *)audio_req[current_buffer]);
-// AbortIO((struct IORequest *)audio_req[current_buffer]);
- }
-}
-
-static void AHI_PlayAudio(_THIS)
-{
- if(playing>1)
- WaitIO((struct IORequest *)audio_req[current_buffer]);
-
- /* Write the audio data out */
- audio_req[current_buffer] -> ahir_Std. io_Message.mn_Node.ln_Pri = 60;
- audio_req[current_buffer] -> ahir_Std. io_Data = mixbuf[current_buffer];
- audio_req[current_buffer] -> ahir_Std. io_Length = this->hidden->size;
- audio_req[current_buffer] -> ahir_Std. io_Offset = 0;
- audio_req[current_buffer] -> ahir_Std . io_Command = CMD_WRITE;
- audio_req[current_buffer] -> ahir_Frequency = this->hidden->freq;
- audio_req[current_buffer] -> ahir_Volume = 0x10000;
- audio_req[current_buffer] -> ahir_Type = this->hidden->type;
- audio_req[current_buffer] -> ahir_Position = 0x8000;
- audio_req[current_buffer] -> ahir_Link = (playing>0 ? audio_req[current_buffer^1] : NULL);
-
- SendIO((struct IORequest *)audio_req[current_buffer]);
- current_buffer^=1;
-
- playing++;
-}
-
-static Uint8 *AHI_GetAudioBuf(_THIS)
-{
- return(mixbuf[current_buffer]);
-}
-
-static void AHI_CloseAudio(_THIS)
-{
- D(bug("Closing audio...\n"));
-
- playing=0;
-
- if(audio_req[0])
- {
- if(audio_req[1])
- {
- D(bug("Break req[1]...\n"));
-
- AbortIO((struct IORequest *)audio_req[1]);
- WaitIO((struct IORequest *)audio_req[1]);
- }
-
- D(bug("Break req[0]...\n"));
-
- AbortIO((struct IORequest *)audio_req[0]);
- WaitIO((struct IORequest *)audio_req[0]);
-
- if(audio_req[1])
- {
- D(bug("Break AGAIN req[1]...\n"));
- AbortIO((struct IORequest *)audio_req[1]);
- WaitIO((struct IORequest *)audio_req[1]);
- }
-// Double abort to be sure to break the dbuffering process.
-
- SDL_Delay(200);
-
- D(bug("Reqs breaked, closing device...\n"));
- CloseDevice((struct IORequest *)audio_req[0]);
- D(bug("Device closed, freeing memory...\n"));
- myfree(audio_req[1]);
- D(bug("Memory freed, deleting IOReq...\n"));
- DeleteIORequest((struct IORequest *)audio_req[0]);
- audio_req[0]=audio_req[1]=NULL;
- }
-
- D(bug("Freeing mixbuf[0]...\n"));
- if ( mixbuf[0] != NULL ) {
- myfree(mixbuf[0]);
-// SDL_FreeAudioMem(mixbuf[0]);
- mixbuf[0] = NULL;
- }
-
- D(bug("Freeing mixbuf[1]...\n"));
- if ( mixbuf[1] != NULL ) {
- myfree(mixbuf[1]);
-// SDL_FreeAudioMem(mixbuf[1]);
- mixbuf[1] = NULL;
- }
-
- D(bug("Freeing audio_port...\n"));
-
- if ( audio_port != NULL ) {
- DeleteMsgPort(audio_port);
- audio_port = NULL;
- }
- D(bug("...done!\n"));
-}
-
-static int AHI_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
-// int width;
-
- D(bug("AHI opening...\n"));
-
- /* Determine the audio parameters from the AudioSpec */
- switch ( spec->format & 0xFF ) {
-
- case 8: { /* Signed 8 bit audio data */
- D(bug("Samples a 8 bit...\n"));
- spec->format = AUDIO_S8;
- this->hidden->bytespersample=1;
- if(spec->channels<2)
- this->hidden->type = AHIST_M8S;
- else
- this->hidden->type = AHIST_S8S;
- }
- break;
-
- case 16: { /* Signed 16 bit audio data */
- D(bug("Samples a 16 bit...\n"));
- spec->format = AUDIO_S16MSB;
- this->hidden->bytespersample=2;
- if(spec->channels<2)
- this->hidden->type = AHIST_M16S;
- else
- this->hidden->type = AHIST_S16S;
- }
- break;
-
- default: {
- SDL_SetError("Unsupported audio format");
- return(-1);
- }
- }
-
- if(spec->channels!=1 && spec->channels!=2)
- {
- D(bug("Wrong channel number!\n"));
- SDL_SetError("Channel number non supported");
- return -1;
- }
-
- D(bug("Before CalculateAudioSpec\n"));
- /* Update the fragment size as size in bytes */
- SDL_CalculateAudioSpec(spec);
-
- D(bug("Before CreateMsgPort\n"));
-
- if(!(audio_port=CreateMsgPort()))
- {
- SDL_SetError("Unable to create a MsgPort");
- return -1;
- }
-
- D(bug("Before CreateIORequest\n"));
-
- if(!(audio_req[0]=(struct AHIRequest *)CreateIORequest(audio_port,sizeof(struct AHIRequest))))
- {
- SDL_SetError("Unable to create an AHIRequest");
- DeleteMsgPort(audio_port);
- return -1;
- }
-
- audio_req[0]->ahir_Version = 4;
-
- if(OpenDevice(AHINAME,0,(struct IORequest *)audio_req[0],NULL))
- {
- SDL_SetError("Unable to open AHI device!\n");
- DeleteIORequest((struct IORequest *)audio_req[0]);
- DeleteMsgPort(audio_port);
- return -1;
- }
-
- D(bug("AFTER opendevice\n"));
-
- /* Set output frequency and size */
- this->hidden->freq = spec->freq;
- this->hidden->size = spec->size;
-
- D(bug("Before buffer allocation\n"));
-
- /* Allocate mixing buffer */
- mixbuf[0] = (Uint8 *)mymalloc(spec->size);
- mixbuf[1] = (Uint8 *)mymalloc(spec->size);
-
- D(bug("Before audio_req allocation\n"));
-
- if(!(audio_req[1]=mymalloc(sizeof(struct AHIRequest))))
- {
- SDL_OutOfMemory();
- return(-1);
- }
-
- D(bug("Before audio_req memcpy\n"));
-
- SDL_memcpy(audio_req[1],audio_req[0],sizeof(struct AHIRequest));
-
- if ( mixbuf[0] == NULL || mixbuf[1] == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
-
- D(bug("Before mixbuf memset\n"));
-
- SDL_memset(mixbuf[0], spec->silence, spec->size);
- SDL_memset(mixbuf[1], spec->silence, spec->size);
-
- current_buffer=0;
- playing=0;
-
- D(bug("AHI opened: freq:%ld mixbuf:%lx/%lx buflen:%ld bits:%ld channels:%ld\n",spec->freq,mixbuf[0],mixbuf[1],spec->size,this->hidden->bytespersample*8,spec->channels));
-
- /* We're ready to rock and roll. :-) */
- return(0);
-}
diff --git a/distrib/sdl-1.2.12/src/audio/amigaos/SDL_ahiaudio.h b/distrib/sdl-1.2.12/src/audio/amigaos/SDL_ahiaudio.h
deleted file mode 100644
index b9ef339..0000000
--- a/distrib/sdl-1.2.12/src/audio/amigaos/SDL_ahiaudio.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_ahiaudio_h
-#define _SDL_ahiaudio_h
-
-#include <exec/exec.h>
-#include <dos/dos.h>
-#ifdef __SASC
-#include <proto/exec.h>
-#else
-#include <inline/exec.h>
-#endif
-
-#include <devices/ahi.h>
-#include "mydebug.h"
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData {
- /* The handle for the audio device */
- struct AHIRequest *audio_req[2];
- struct MsgPort *audio_port;
- Sint32 freq,type,bytespersample,size;
- Uint8 *mixbuf[2]; /* The app mixing buffer */
- int current_buffer;
- Uint32 playing;
-};
-
-/* Old variable names */
-#define audio_port (this->hidden->audio_port)
-#define audio_req (this->hidden->audio_req)
-#define mixbuf (this->hidden->mixbuf)
-#define current_buffer (this->hidden->current_buffer)
-#define playing (this->hidden->playing)
-
-#endif /* _SDL_ahiaudio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/arts/SDL_artsaudio.c b/distrib/sdl-1.2.12/src/audio/arts/SDL_artsaudio.c
deleted file mode 100644
index 204e582..0000000
--- a/distrib/sdl-1.2.12/src/audio/arts/SDL_artsaudio.c
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Allow access to a raw mixing buffer */
-
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-#include <unistd.h>
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_audiodev_c.h"
-#include "SDL_artsaudio.h"
-
-#ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
-#include "SDL_name.h"
-#include "SDL_loadso.h"
-#else
-#define SDL_NAME(X) X
-#endif
-
-/* The tag name used by artsc audio */
-#define ARTS_DRIVER_NAME "arts"
-
-/* Audio driver functions */
-static int ARTS_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void ARTS_WaitAudio(_THIS);
-static void ARTS_PlayAudio(_THIS);
-static Uint8 *ARTS_GetAudioBuf(_THIS);
-static void ARTS_CloseAudio(_THIS);
-
-#ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
-
-static const char *arts_library = SDL_AUDIO_DRIVER_ARTS_DYNAMIC;
-static void *arts_handle = NULL;
-static int arts_loaded = 0;
-
-static int (*SDL_NAME(arts_init))(void);
-static void (*SDL_NAME(arts_free))(void);
-static arts_stream_t (*SDL_NAME(arts_play_stream))(int rate, int bits, int channels, const char *name);
-static int (*SDL_NAME(arts_stream_set))(arts_stream_t s, arts_parameter_t param, int value);
-static int (*SDL_NAME(arts_stream_get))(arts_stream_t s, arts_parameter_t param);
-static int (*SDL_NAME(arts_write))(arts_stream_t s, const void *buffer, int count);
-static void (*SDL_NAME(arts_close_stream))(arts_stream_t s);
-static int (*SDL_NAME(arts_suspended))(void);
-static const char *(*SDL_NAME(arts_error_text))(int errorcode);
-
-static struct {
- const char *name;
- void **func;
-} arts_functions[] = {
- { "arts_init", (void **)&SDL_NAME(arts_init) },
- { "arts_free", (void **)&SDL_NAME(arts_free) },
- { "arts_play_stream", (void **)&SDL_NAME(arts_play_stream) },
- { "arts_stream_set", (void **)&SDL_NAME(arts_stream_set) },
- { "arts_stream_get", (void **)&SDL_NAME(arts_stream_get) },
- { "arts_write", (void **)&SDL_NAME(arts_write) },
- { "arts_close_stream", (void **)&SDL_NAME(arts_close_stream) },
- { "arts_suspended", (void **)&SDL_NAME(arts_suspended) },
- { "arts_error_text", (void **)&SDL_NAME(arts_error_text) },
-};
-
-static void UnloadARTSLibrary()
-{
- if ( arts_loaded ) {
- SDL_UnloadObject(arts_handle);
- arts_handle = NULL;
- arts_loaded = 0;
- }
-}
-
-static int LoadARTSLibrary(void)
-{
- int i, retval = -1;
-
- arts_handle = SDL_LoadObject(arts_library);
- if ( arts_handle ) {
- arts_loaded = 1;
- retval = 0;
- for ( i=0; i<SDL_arraysize(arts_functions); ++i ) {
- *arts_functions[i].func = SDL_LoadFunction(arts_handle, arts_functions[i].name);
- if ( !*arts_functions[i].func ) {
- retval = -1;
- UnloadARTSLibrary();
- break;
- }
- }
- }
- return retval;
-}
-
-#else
-
-static void UnloadARTSLibrary()
-{
- return;
-}
-
-static int LoadARTSLibrary(void)
-{
- return 0;
-}
-
-#endif /* SDL_AUDIO_DRIVER_ARTS_DYNAMIC */
-
-/* Audio driver bootstrap functions */
-
-static int Audio_Available(void)
-{
- int available = 0;
-
- if ( LoadARTSLibrary() < 0 ) {
- return available;
- }
- if ( SDL_NAME(arts_init)() == 0 ) {
- if ( SDL_NAME(arts_suspended)() ) {
- /* Play a stream so aRts doesn't crash */
- arts_stream_t stream2;
- stream2=SDL_NAME(arts_play_stream)(44100, 16, 2, "SDL");
- SDL_NAME(arts_write)(stream2, "", 0);
- SDL_NAME(arts_close_stream)(stream2);
- available = 1;
- }
- SDL_NAME(arts_free)();
- }
- UnloadARTSLibrary();
-
- return available;
-}
-
-static void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
- UnloadARTSLibrary();
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- LoadARTSLibrary();
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
- stream = 0;
-
- /* Set the function pointers */
- this->OpenAudio = ARTS_OpenAudio;
- this->WaitAudio = ARTS_WaitAudio;
- this->PlayAudio = ARTS_PlayAudio;
- this->GetAudioBuf = ARTS_GetAudioBuf;
- this->CloseAudio = ARTS_CloseAudio;
-
- this->free = Audio_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap ARTS_bootstrap = {
- ARTS_DRIVER_NAME, "Analog Realtime Synthesizer",
- Audio_Available, Audio_CreateDevice
-};
-
-/* This function waits until it is possible to write a full sound buffer */
-static void ARTS_WaitAudio(_THIS)
-{
- Sint32 ticks;
-
- /* Check to see if the thread-parent process is still alive */
- { static int cnt = 0;
- /* Note that this only works with thread implementations
- that use a different process id for each thread.
- */
- if (parent && (((++cnt)%10) == 0)) { /* Check every 10 loops */
- if ( kill(parent, 0) < 0 ) {
- this->enabled = 0;
- }
- }
- }
-
- /* Use timer for general audio synchronization */
- ticks = ((Sint32)(next_frame - SDL_GetTicks()))-FUDGE_TICKS;
- if ( ticks > 0 ) {
- SDL_Delay(ticks);
- }
-}
-
-static void ARTS_PlayAudio(_THIS)
-{
- int written;
-
- /* Write the audio data */
- written = SDL_NAME(arts_write)(stream, mixbuf, mixlen);
-
- /* If timer synchronization is enabled, set the next write frame */
- if ( frame_ticks ) {
- next_frame += frame_ticks;
- }
-
- /* If we couldn't write, assume fatal error for now */
- if ( written < 0 ) {
- this->enabled = 0;
- }
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Wrote %d bytes of audio data\n", written);
-#endif
-}
-
-static Uint8 *ARTS_GetAudioBuf(_THIS)
-{
- return(mixbuf);
-}
-
-static void ARTS_CloseAudio(_THIS)
-{
- if ( mixbuf != NULL ) {
- SDL_FreeAudioMem(mixbuf);
- mixbuf = NULL;
- }
- if ( stream ) {
- SDL_NAME(arts_close_stream)(stream);
- stream = 0;
- }
- SDL_NAME(arts_free)();
-}
-
-static int ARTS_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- int bits, frag_spec;
- Uint16 test_format, format;
- int error_code;
-
- /* Reset the timer synchronization flag */
- frame_ticks = 0.0;
-
- mixbuf = NULL;
-
- /* Try for a closest match on audio format */
- format = 0;
- bits = 0;
- for ( test_format = SDL_FirstAudioFormat(spec->format);
- ! format && test_format; ) {
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Trying format 0x%4.4x\n", test_format);
-#endif
- switch ( test_format ) {
- case AUDIO_U8:
- bits = 8;
- format = 1;
- break;
- case AUDIO_S16LSB:
- bits = 16;
- format = 1;
- break;
- default:
- format = 0;
- break;
- }
- if ( ! format ) {
- test_format = SDL_NextAudioFormat();
- }
- }
- if ( format == 0 ) {
- SDL_SetError("Couldn't find any hardware audio formats");
- return(-1);
- }
- spec->format = test_format;
-
- error_code = SDL_NAME(arts_init)();
- if ( error_code != 0 ) {
- SDL_SetError("Unable to initialize ARTS: %s", SDL_NAME(arts_error_text)(error_code));
- return(-1);
- }
- if ( ! SDL_NAME(arts_suspended)() ) {
- SDL_SetError("ARTS can not open audio device");
- return(-1);
- }
- stream = SDL_NAME(arts_play_stream)(spec->freq, bits, spec->channels, "SDL");
-
- /* Calculate the final parameters for this audio specification */
- SDL_CalculateAudioSpec(spec);
-
- /* Determine the power of two of the fragment size */
- for ( frag_spec = 0; (0x01<<frag_spec) < spec->size; ++frag_spec );
- if ( (0x01<<frag_spec) != spec->size ) {
- SDL_SetError("Fragment size must be a power of two");
- return(-1);
- }
- frag_spec |= 0x00020000; /* two fragments, for low latency */
-
-#ifdef ARTS_P_PACKET_SETTINGS
- SDL_NAME(arts_stream_set)(stream, ARTS_P_PACKET_SETTINGS, frag_spec);
-#else
- SDL_NAME(arts_stream_set)(stream, ARTS_P_PACKET_SIZE, frag_spec&0xffff);
- SDL_NAME(arts_stream_set)(stream, ARTS_P_PACKET_COUNT, frag_spec>>16);
-#endif
- spec->size = SDL_NAME(arts_stream_get)(stream, ARTS_P_PACKET_SIZE);
-
- /* Allocate mixing buffer */
- mixlen = spec->size;
- mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen);
- if ( mixbuf == NULL ) {
- return(-1);
- }
- SDL_memset(mixbuf, spec->silence, spec->size);
-
- /* Get the parent process id (we're the parent of the audio thread) */
- parent = getpid();
-
- /* We're ready to rock and roll. :-) */
- return(0);
-}
diff --git a/distrib/sdl-1.2.12/src/audio/arts/SDL_artsaudio.h b/distrib/sdl-1.2.12/src/audio/arts/SDL_artsaudio.h
deleted file mode 100644
index 5569a3d..0000000
--- a/distrib/sdl-1.2.12/src/audio/arts/SDL_artsaudio.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_artscaudio_h
-#define _SDL_artscaudio_h
-
-#include <artsc.h>
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData {
- /* The stream descriptor for the audio device */
- arts_stream_t stream;
-
- /* The parent process id, to detect when application quits */
- pid_t parent;
-
- /* Raw mixing buffer */
- Uint8 *mixbuf;
- int mixlen;
-
- /* Support for audio timing using a timer, in addition to select() */
- float frame_ticks;
- float next_frame;
-};
-#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */
-
-/* Old variable names */
-#define stream (this->hidden->stream)
-#define parent (this->hidden->parent)
-#define mixbuf (this->hidden->mixbuf)
-#define mixlen (this->hidden->mixlen)
-#define frame_ticks (this->hidden->frame_ticks)
-#define next_frame (this->hidden->next_frame)
-
-#endif /* _SDL_artscaudio_h */
-
diff --git a/distrib/sdl-1.2.12/src/audio/baudio/SDL_beaudio.cc b/distrib/sdl-1.2.12/src/audio/baudio/SDL_beaudio.cc
deleted file mode 100644
index fce0ecb..0000000
--- a/distrib/sdl-1.2.12/src/audio/baudio/SDL_beaudio.cc
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Allow access to the audio stream on BeOS */
-
-#include <SoundPlayer.h>
-
-#include "../../main/beos/SDL_BeApp.h"
-
-extern "C" {
-
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_sysaudio.h"
-#include "../../thread/beos/SDL_systhread_c.h"
-#include "SDL_beaudio.h"
-
-
-/* Audio driver functions */
-static int BE_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void BE_WaitAudio(_THIS);
-static void BE_PlayAudio(_THIS);
-static Uint8 *BE_GetAudioBuf(_THIS);
-static void BE_CloseAudio(_THIS);
-
-/* Audio driver bootstrap functions */
-
-static int Audio_Available(void)
-{
- return(1);
-}
-
-static void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *device;
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( device ) {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *device->hidden));
- }
- if ( (device == NULL) || (device->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( device ) {
- SDL_free(device);
- }
- return(0);
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
-
- /* Set the function pointers */
- device->OpenAudio = BE_OpenAudio;
- device->WaitAudio = BE_WaitAudio;
- device->PlayAudio = BE_PlayAudio;
- device->GetAudioBuf = BE_GetAudioBuf;
- device->CloseAudio = BE_CloseAudio;
-
- device->free = Audio_DeleteDevice;
-
- return device;
-}
-
-AudioBootStrap BAUDIO_bootstrap = {
- "baudio", "BeOS BSoundPlayer",
- Audio_Available, Audio_CreateDevice
-};
-
-/* The BeOS callback for handling the audio buffer */
-static void FillSound(void *device, void *stream, size_t len,
- const media_raw_audio_format &format)
-{
- SDL_AudioDevice *audio = (SDL_AudioDevice *)device;
-
- /* Silence the buffer, since it's ours */
- SDL_memset(stream, audio->spec.silence, len);
-
- /* Only do soemthing if audio is enabled */
- if ( ! audio->enabled )
- return;
-
- if ( ! audio->paused ) {
- if ( audio->convert.needed ) {
- SDL_mutexP(audio->mixer_lock);
- (*audio->spec.callback)(audio->spec.userdata,
- (Uint8 *)audio->convert.buf,audio->convert.len);
- SDL_mutexV(audio->mixer_lock);
- SDL_ConvertAudio(&audio->convert);
- SDL_memcpy(stream,audio->convert.buf,audio->convert.len_cvt);
- } else {
- SDL_mutexP(audio->mixer_lock);
- (*audio->spec.callback)(audio->spec.userdata,
- (Uint8 *)stream, len);
- SDL_mutexV(audio->mixer_lock);
- }
- }
- return;
-}
-
-/* Dummy functions -- we don't use thread-based audio */
-void BE_WaitAudio(_THIS)
-{
- return;
-}
-void BE_PlayAudio(_THIS)
-{
- return;
-}
-Uint8 *BE_GetAudioBuf(_THIS)
-{
- return(NULL);
-}
-
-void BE_CloseAudio(_THIS)
-{
- if ( audio_obj ) {
- audio_obj->Stop();
- delete audio_obj;
- audio_obj = NULL;
- }
-
- /* Quit the Be Application, if there's nothing left to do */
- SDL_QuitBeApp();
-}
-
-int BE_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- int valid_datatype = 0;
- media_raw_audio_format format;
- Uint16 test_format = SDL_FirstAudioFormat(spec->format);
-
- /* Parse the audio format and fill the Be raw audio format */
- memset(&format, '\0', sizeof (media_raw_audio_format));
- format.byte_order = B_MEDIA_LITTLE_ENDIAN;
- format.frame_rate = (float) spec->freq;
- format.channel_count = spec->channels; /* !!! FIXME: support > 2? */
- while ((!valid_datatype) && (test_format)) {
- valid_datatype = 1;
- spec->format = test_format;
- switch (test_format) {
- case AUDIO_S8:
- format.format = media_raw_audio_format::B_AUDIO_CHAR;
- break;
-
- case AUDIO_U8:
- format.format = media_raw_audio_format::B_AUDIO_UCHAR;
- break;
-
- case AUDIO_S16LSB:
- format.format = media_raw_audio_format::B_AUDIO_SHORT;
- break;
-
- case AUDIO_S16MSB:
- format.format = media_raw_audio_format::B_AUDIO_SHORT;
- format.byte_order = B_MEDIA_BIG_ENDIAN;
- break;
-
- default:
- valid_datatype = 0;
- test_format = SDL_NextAudioFormat();
- break;
- }
- }
-
- if (!valid_datatype) { /* shouldn't happen, but just in case... */
- SDL_SetError("Unsupported audio format");
- return (-1);
- }
-
- /* Initialize the Be Application, if it's not already started */
- if (SDL_InitBeApp() < 0) {
- return (-1);
- }
-
- format.buffer_size = spec->samples;
-
- /* Calculate the final parameters for this audio specification */
- SDL_CalculateAudioSpec(spec);
-
- /* Subscribe to the audio stream (creates a new thread) */
- { sigset_t omask;
- SDL_MaskSignals(&omask);
- audio_obj = new BSoundPlayer(&format, "SDL Audio", FillSound,
- NULL, _this);
- SDL_UnmaskSignals(&omask);
- }
- if ( audio_obj->Start() == B_NO_ERROR ) {
- audio_obj->SetHasData(true);
- } else {
- SDL_SetError("Unable to start Be audio");
- return(-1);
- }
-
- /* We're running! */
- return(1);
-}
-
-}; /* Extern C */
diff --git a/distrib/sdl-1.2.12/src/audio/baudio/SDL_beaudio.h b/distrib/sdl-1.2.12/src/audio/baudio/SDL_beaudio.h
deleted file mode 100644
index 942c60e..0000000
--- a/distrib/sdl-1.2.12/src/audio/baudio/SDL_beaudio.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_lowaudio_h
-#define _SDL_lowaudio_h
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_AudioDevice *_this
-
-struct SDL_PrivateAudioData {
- BSoundPlayer *audio_obj;
-};
-
-/* Old variable names */
-#define audio_obj (_this->hidden->audio_obj)
-
-#endif /* _SDL_lowaudio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/bsd/SDL_bsdaudio.c b/distrib/sdl-1.2.12/src/audio/bsd/SDL_bsdaudio.c
deleted file mode 100644
index f1946c0..0000000
--- a/distrib/sdl-1.2.12/src/audio/bsd/SDL_bsdaudio.c
+++ /dev/null
@@ -1,404 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * Driver for native OpenBSD/NetBSD audio(4).
- * vedge@vedge.com.ar.
- */
-
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/audioio.h>
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_audiodev_c.h"
-#include "SDL_bsdaudio.h"
-
-/* The tag name used by NetBSD/OpenBSD audio */
-#ifdef __NetBSD__
-#define BSD_AUDIO_DRIVER_NAME "netbsd"
-#define BSD_AUDIO_DRIVER_DESC "Native NetBSD audio"
-#else
-#define BSD_AUDIO_DRIVER_NAME "openbsd"
-#define BSD_AUDIO_DRIVER_DESC "Native OpenBSD audio"
-#endif
-
-/* Open the audio device for playback, and don't block if busy */
-/* #define USE_BLOCKING_WRITES */
-
-/* Use timer for synchronization */
-/* #define USE_TIMER_SYNC */
-
-/* #define DEBUG_AUDIO */
-/* #define DEBUG_AUDIO_STREAM */
-
-#ifdef USE_BLOCKING_WRITES
-#define OPEN_FLAGS O_WRONLY
-#else
-#define OPEN_FLAGS (O_WRONLY|O_NONBLOCK)
-#endif
-
-/* Audio driver functions */
-static void OBSD_WaitAudio(_THIS);
-static int OBSD_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void OBSD_PlayAudio(_THIS);
-static Uint8 *OBSD_GetAudioBuf(_THIS);
-static void OBSD_CloseAudio(_THIS);
-
-#ifdef DEBUG_AUDIO
-static void OBSD_Status(_THIS);
-#endif
-
-/* Audio driver bootstrap functions */
-
-static int
-Audio_Available(void)
-{
- int fd;
- int available;
-
- available = 0;
- fd = SDL_OpenAudioPath(NULL, 0, OPEN_FLAGS, 0);
- if(fd >= 0) {
- available = 1;
- close(fd);
- }
- return(available);
-}
-
-static void
-Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_AudioDevice
-*Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice*)SDL_malloc(sizeof(SDL_AudioDevice));
- if(this) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden =
- (struct SDL_PrivateAudioData*)SDL_malloc((sizeof *this->hidden));
- }
- if((this == NULL) || (this->hidden == NULL)) {
- SDL_OutOfMemory();
- if(this) SDL_free(this);
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
- audio_fd = -1;
-
- /* Set the function pointers */
- this->OpenAudio = OBSD_OpenAudio;
- this->WaitAudio = OBSD_WaitAudio;
- this->PlayAudio = OBSD_PlayAudio;
- this->GetAudioBuf = OBSD_GetAudioBuf;
- this->CloseAudio = OBSD_CloseAudio;
-
- this->free = Audio_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap BSD_AUDIO_bootstrap = {
- BSD_AUDIO_DRIVER_NAME, BSD_AUDIO_DRIVER_DESC,
- Audio_Available, Audio_CreateDevice
-};
-
-/* This function waits until it is possible to write a full sound buffer */
-static void
-OBSD_WaitAudio(_THIS)
-{
-#ifndef USE_BLOCKING_WRITES /* Not necessary when using blocking writes */
- /* See if we need to use timed audio synchronization */
- if ( frame_ticks ) {
- /* Use timer for general audio synchronization */
- Sint32 ticks;
-
- ticks = ((Sint32)(next_frame - SDL_GetTicks()))-FUDGE_TICKS;
- if ( ticks > 0 ) {
- SDL_Delay(ticks);
- }
- } else {
- /* Use select() for audio synchronization */
- fd_set fdset;
- struct timeval timeout;
-
- FD_ZERO(&fdset);
- FD_SET(audio_fd, &fdset);
- timeout.tv_sec = 10;
- timeout.tv_usec = 0;
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Waiting for audio to get ready\n");
-#endif
- if ( select(audio_fd+1, NULL, &fdset, NULL, &timeout) <= 0 ) {
- const char *message =
- "Audio timeout - buggy audio driver? (disabled)";
- /* In general we should never print to the screen,
- but in this case we have no other way of letting
- the user know what happened.
- */
- fprintf(stderr, "SDL: %s\n", message);
- this->enabled = 0;
- /* Don't try to close - may hang */
- audio_fd = -1;
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Done disabling audio\n");
-#endif
- }
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Ready!\n");
-#endif
- }
-#endif /* !USE_BLOCKING_WRITES */
-}
-
-static void
-OBSD_PlayAudio(_THIS)
-{
- int written, p=0;
-
- /* Write the audio data, checking for EAGAIN on broken audio drivers */
- do {
- written = write(audio_fd, &mixbuf[p], mixlen-p);
- if (written>0)
- p += written;
- if (written == -1 && errno != 0 && errno != EAGAIN && errno != EINTR)
- {
- /* Non recoverable error has occurred. It should be reported!!! */
- perror("audio");
- break;
- }
-
- if ( p < written || ((written < 0) && ((errno == 0) || (errno == EAGAIN))) ) {
- SDL_Delay(1); /* Let a little CPU time go by */
- }
- } while ( p < written );
-
- /* If timer synchronization is enabled, set the next write frame */
- if ( frame_ticks ) {
- next_frame += frame_ticks;
- }
-
- /* If we couldn't write, assume fatal error for now */
- if ( written < 0 ) {
- this->enabled = 0;
- }
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Wrote %d bytes of audio data\n", written);
-#endif
-}
-
-static Uint8
-*OBSD_GetAudioBuf(_THIS)
-{
- return(mixbuf);
-}
-
-static void
-OBSD_CloseAudio(_THIS)
-{
- if(mixbuf != NULL) {
- SDL_FreeAudioMem(mixbuf);
- mixbuf = NULL;
- }
- if(audio_fd >= 0) {
- close(audio_fd);
- audio_fd = -1;
- }
-}
-
-#ifdef DEBUG_AUDIO
-void
-OBSD_Status(_THIS)
-{
- audio_info_t info;
-
- if(ioctl(audio_fd, AUDIO_GETINFO, &info) < 0) {
- fprintf(stderr,"AUDIO_GETINFO failed.\n");
- return;
- }
-
- fprintf(stderr,"\n"
-"[play/record info]\n"
-"buffer size : %d bytes\n"
-"sample rate : %i Hz\n"
-"channels : %i\n"
-"precision : %i-bit\n"
-"encoding : 0x%x\n"
-"seek : %i\n"
-"sample count : %i\n"
-"EOF count : %i\n"
-"paused : %s\n"
-"error occured : %s\n"
-"waiting : %s\n"
-"active : %s\n"
-"",
- info.play.buffer_size,
- info.play.sample_rate,
- info.play.channels,
- info.play.precision,
- info.play.encoding,
- info.play.seek,
- info.play.samples,
- info.play.eof,
- info.play.pause ? "yes" : "no",
- info.play.error ? "yes" : "no",
- info.play.waiting ? "yes" : "no",
- info.play.active ? "yes": "no");
-
- fprintf(stderr,"\n"
-"[audio info]\n"
-"monitor_gain : %i\n"
-"hw block size : %d bytes\n"
-"hi watermark : %i\n"
-"lo watermark : %i\n"
-"audio mode : %s\n"
-"",
- info.monitor_gain,
- info.blocksize,
- info.hiwat, info.lowat,
- (info.mode == AUMODE_PLAY) ? "PLAY"
- : (info.mode = AUMODE_RECORD) ? "RECORD"
- : (info.mode == AUMODE_PLAY_ALL ? "PLAY_ALL"
- : "?"));
-}
-#endif /* DEBUG_AUDIO */
-
-static int
-OBSD_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- char audiodev[64];
- Uint16 format;
- audio_info_t info;
-
- AUDIO_INITINFO(&info);
-
- /* Calculate the final parameters for this audio specification */
- SDL_CalculateAudioSpec(spec);
-
-#ifdef USE_TIMER_SYNC
- frame_ticks = 0.0;
-#endif
-
- /* Open the audio device */
- audio_fd = SDL_OpenAudioPath(audiodev, sizeof(audiodev), OPEN_FLAGS, 0);
- if(audio_fd < 0) {
- SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno));
- return(-1);
- }
-
- /* Set to play mode */
- info.mode = AUMODE_PLAY;
- if(ioctl(audio_fd, AUDIO_SETINFO, &info) < 0) {
- SDL_SetError("Couldn't put device into play mode");
- return(-1);
- }
-
- mixbuf = NULL;
- AUDIO_INITINFO(&info);
- for (format = SDL_FirstAudioFormat(spec->format);
- format; format = SDL_NextAudioFormat())
- {
- switch(format) {
- case AUDIO_U8:
- info.play.encoding = AUDIO_ENCODING_ULINEAR;
- info.play.precision = 8;
- break;
- case AUDIO_S8:
- info.play.encoding = AUDIO_ENCODING_SLINEAR;
- info.play.precision = 8;
- break;
- case AUDIO_S16LSB:
- info.play.encoding = AUDIO_ENCODING_SLINEAR_LE;
- info.play.precision = 16;
- break;
- case AUDIO_S16MSB:
- info.play.encoding = AUDIO_ENCODING_SLINEAR_BE;
- info.play.precision = 16;
- break;
- case AUDIO_U16LSB:
- info.play.encoding = AUDIO_ENCODING_ULINEAR_LE;
- info.play.precision = 16;
- break;
- case AUDIO_U16MSB:
- info.play.encoding = AUDIO_ENCODING_ULINEAR_BE;
- info.play.precision = 16;
- break;
- default:
- continue;
- }
- if (ioctl(audio_fd, AUDIO_SETINFO, &info) == 0)
- break;
- }
-
- if(!format) {
- SDL_SetError("No supported encoding for 0x%x", spec->format);
- return(-1);
- }
-
- spec->format = format;
-
- AUDIO_INITINFO(&info);
- info.play.channels = spec->channels;
- if (ioctl(audio_fd, AUDIO_SETINFO, &info) == -1)
- spec->channels = 1;
- AUDIO_INITINFO(&info);
- info.play.sample_rate = spec->freq;
- info.blocksize = spec->size;
- info.hiwat = 5;
- info.lowat = 3;
- (void)ioctl(audio_fd, AUDIO_SETINFO, &info);
- (void)ioctl(audio_fd, AUDIO_GETINFO, &info);
- spec->freq = info.play.sample_rate;
- /* Allocate mixing buffer */
- mixlen = spec->size;
- mixbuf = (Uint8*)SDL_AllocAudioMem(mixlen);
- if(mixbuf == NULL) {
- return(-1);
- }
- SDL_memset(mixbuf, spec->silence, spec->size);
-
- /* Get the parent process id (we're the parent of the audio thread) */
- parent = getpid();
-
-#ifdef DEBUG_AUDIO
- OBSD_Status(this);
-#endif
-
- /* We're ready to rock and roll. :-) */
- return(0);
-}
diff --git a/distrib/sdl-1.2.12/src/audio/bsd/SDL_bsdaudio.h b/distrib/sdl-1.2.12/src/audio/bsd/SDL_bsdaudio.h
deleted file mode 100644
index 8e8db89..0000000
--- a/distrib/sdl-1.2.12/src/audio/bsd/SDL_bsdaudio.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_openbsdaudio_h
-#define _SDL_openbsdaudio_h
-
-#include "../SDL_sysaudio.h"
-
-#define _THIS SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData
-{
- /* The file descriptor for the audio device */
- int audio_fd;
-
- /* The parent process id, to detect when application quits */
- pid_t parent;
-
- /* Raw mixing buffer */
- Uint8 *mixbuf;
- int mixlen;
-
- /* Support for audio timing using a timer, in addition to select() */
- float frame_ticks;
- float next_frame;
-};
-
-#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */
-
-/* Old variable names */
-#define audio_fd (this->hidden->audio_fd)
-#define parent (this->hidden->parent)
-#define mixbuf (this->hidden->mixbuf)
-#define mixlen (this->hidden->mixlen)
-#define frame_ticks (this->hidden->frame_ticks)
-#define next_frame (this->hidden->next_frame)
-
-#endif /* _SDL_openbsdaudio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/dart/SDL_dart.c b/distrib/sdl-1.2.12/src/audio/dart/SDL_dart.c
deleted file mode 100644
index a37a5e2..0000000
--- a/distrib/sdl-1.2.12/src/audio/dart/SDL_dart.c
+++ /dev/null
@@ -1,441 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Allow access to a raw mixing buffer */
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "SDL_dart.h"
-
-// Buffer states:
-#define BUFFER_EMPTY 0
-#define BUFFER_USED 1
-
-typedef struct _tMixBufferDesc {
- int iBufferUsage; // BUFFER_EMPTY or BUFFER_USED
- SDL_AudioDevice *pSDLAudioDevice;
-} tMixBufferDesc, *pMixBufferDesc;
-
-
-//---------------------------------------------------------------------
-// DARTEventFunc
-//
-// This function is called by DART, when an event occures, like end of
-// playback of a buffer, etc...
-//---------------------------------------------------------------------
-LONG APIENTRY DARTEventFunc(ULONG ulStatus,
- PMCI_MIX_BUFFER pBuffer,
- ULONG ulFlags)
-{
- if (ulFlags && MIX_WRITE_COMPLETE)
- { // Playback of buffer completed!
-
- // Get pointer to buffer description
- pMixBufferDesc pBufDesc;
-
- if (pBuffer)
- {
- pBufDesc = (pMixBufferDesc) (*pBuffer).ulUserParm;
-
- if (pBufDesc)
- {
- SDL_AudioDevice *pSDLAudioDevice = pBufDesc->pSDLAudioDevice;
- // Set the buffer to be empty
- pBufDesc->iBufferUsage = BUFFER_EMPTY;
- // And notify DART feeder thread that it will have to work a bit.
- if (pSDLAudioDevice)
- DosPostEventSem(pSDLAudioDevice->hidden->hevAudioBufferPlayed);
- }
- }
- }
- return TRUE;
-}
-
-
-int DART_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- Uint16 test_format = SDL_FirstAudioFormat(spec->format);
- int valid_datatype = 0;
- MCI_AMP_OPEN_PARMS AmpOpenParms;
- MCI_GENERIC_PARMS GenericParms;
- int iDeviceOrd = 0; // Default device to be used
- int bOpenShared = 1; // Try opening it shared
- int iBits = 16; // Default is 16 bits signed
- int iFreq = 44100; // Default is 44KHz
- int iChannels = 2; // Default is 2 channels (Stereo)
- int iNumBufs = 2; // Number of audio buffers: 2
- int iBufSize;
- int iOpenMode;
- int iSilence;
- int rc;
-
- // First thing is to try to open a given DART device!
- SDL_memset(&AmpOpenParms, 0, sizeof(MCI_AMP_OPEN_PARMS));
- // pszDeviceType should contain the device type in low word, and device ordinal in high word!
- AmpOpenParms.pszDeviceType = (PSZ) (MCI_DEVTYPE_AUDIO_AMPMIX | (iDeviceOrd << 16));
-
- iOpenMode = MCI_WAIT | MCI_OPEN_TYPE_ID;
- if (bOpenShared) iOpenMode |= MCI_OPEN_SHAREABLE;
-
- rc = mciSendCommand( 0, MCI_OPEN,
- iOpenMode,
- (PVOID) &AmpOpenParms, 0);
- if (rc!=MCIERR_SUCCESS) // No audio available??
- return (-1);
- // Save the device ID we got from DART!
- // We will use this in the next calls!
- iDeviceOrd = AmpOpenParms.usDeviceID;
-
- // Determine the audio parameters from the AudioSpec
- if (spec->channels > 2)
- spec->channels = 2; // !!! FIXME: more than stereo support in OS/2?
-
- while ((!valid_datatype) && (test_format)) {
- spec->format = test_format;
- valid_datatype = 1;
- switch (test_format) {
- case AUDIO_U8:
- // Unsigned 8 bit audio data
- iSilence = 0x80;
- iBits = 8;
- break;
-
- case AUDIO_S16LSB:
- // Signed 16 bit audio data
- iSilence = 0x00;
- iBits = 16;
- break;
-
- default:
- valid_datatype = 0;
- test_format = SDL_NextAudioFormat();
- break;
- }
- }
-
- if (!valid_datatype) { // shouldn't happen, but just in case...
- // Close DART, and exit with error code!
- mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0);
- SDL_SetError("Unsupported audio format");
- return (-1);
- }
-
- iFreq = spec->freq;
- iChannels = spec->channels;
- /* Update the fragment size as size in bytes */
- SDL_CalculateAudioSpec(spec);
- iBufSize = spec->size;
-
- // Now query this device if it supports the given freq/bits/channels!
- SDL_memset(&(_this->hidden->MixSetupParms), 0, sizeof(MCI_MIXSETUP_PARMS));
- _this->hidden->MixSetupParms.ulBitsPerSample = iBits;
- _this->hidden->MixSetupParms.ulFormatTag = MCI_WAVE_FORMAT_PCM;
- _this->hidden->MixSetupParms.ulSamplesPerSec = iFreq;
- _this->hidden->MixSetupParms.ulChannels = iChannels;
- _this->hidden->MixSetupParms.ulFormatMode = MCI_PLAY;
- _this->hidden->MixSetupParms.ulDeviceType = MCI_DEVTYPE_WAVEFORM_AUDIO;
- _this->hidden->MixSetupParms.pmixEvent = DARTEventFunc;
- rc = mciSendCommand (iDeviceOrd, MCI_MIXSETUP,
- MCI_WAIT | MCI_MIXSETUP_QUERYMODE,
- &(_this->hidden->MixSetupParms), 0);
- if (rc!=MCIERR_SUCCESS)
- { // The device cannot handle this format!
- // Close DART, and exit with error code!
- mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0);
- SDL_SetError("Audio device doesn't support requested audio format");
- return(-1);
- }
- // The device can handle this format, so initialize!
- rc = mciSendCommand(iDeviceOrd, MCI_MIXSETUP,
- MCI_WAIT | MCI_MIXSETUP_INIT,
- &(_this->hidden->MixSetupParms), 0);
- if (rc!=MCIERR_SUCCESS)
- { // The device could not be opened!
- // Close DART, and exit with error code!
- mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0);
- SDL_SetError("Audio device could not be set up");
- return(-1);
- }
- // Ok, the device is initialized.
- // Now we should allocate buffers. For this, we need a place where
- // the buffer descriptors will be:
- _this->hidden->pMixBuffers = (MCI_MIX_BUFFER *) SDL_malloc(sizeof(MCI_MIX_BUFFER)*iNumBufs);
- if (!(_this->hidden->pMixBuffers))
- { // Not enough memory!
- // Close DART, and exit with error code!
- mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0);
- SDL_SetError("Not enough memory for audio buffer descriptors");
- return(-1);
- }
- // Now that we have the place for buffer list, we can ask DART for the
- // buffers!
- _this->hidden->BufferParms.ulNumBuffers = iNumBufs; // Number of buffers
- _this->hidden->BufferParms.ulBufferSize = iBufSize; // each with this size
- _this->hidden->BufferParms.pBufList = _this->hidden->pMixBuffers; // getting descriptorts into this list
- // Allocate buffers!
- rc = mciSendCommand(iDeviceOrd, MCI_BUFFER,
- MCI_WAIT | MCI_ALLOCATE_MEMORY,
- &(_this->hidden->BufferParms), 0);
- if ((rc!=MCIERR_SUCCESS) || (iNumBufs != _this->hidden->BufferParms.ulNumBuffers) || (_this->hidden->BufferParms.ulBufferSize==0))
- { // Could not allocate memory!
- // Close DART, and exit with error code!
- SDL_free(_this->hidden->pMixBuffers); _this->hidden->pMixBuffers = NULL;
- mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0);
- SDL_SetError("DART could not allocate buffers");
- return(-1);
- }
- // Ok, we have all the buffers allocated, let's mark them!
- {
- int i;
- for (i=0; i<iNumBufs; i++)
- {
- pMixBufferDesc pBufferDesc = (pMixBufferDesc) SDL_malloc(sizeof(tMixBufferDesc));;
- // Check if this buffer was really allocated by DART
- if ((!(_this->hidden->pMixBuffers[i].pBuffer)) || (!pBufferDesc))
- { // Wrong buffer!
- // Close DART, and exit with error code!
- // Free buffer descriptions
- { int j;
- for (j=0; j<i; j++) SDL_free((void *)(_this->hidden->pMixBuffers[j].ulUserParm));
- }
- // and cleanup
- mciSendCommand(iDeviceOrd, MCI_BUFFER, MCI_WAIT | MCI_DEALLOCATE_MEMORY, &(_this->hidden->BufferParms), 0);
- SDL_free(_this->hidden->pMixBuffers); _this->hidden->pMixBuffers = NULL;
- mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0);
- SDL_SetError("Error at internal buffer check");
- return(-1);
- }
- pBufferDesc->iBufferUsage = BUFFER_EMPTY;
- pBufferDesc->pSDLAudioDevice = _this;
-
- _this->hidden->pMixBuffers[i].ulBufferLength = _this->hidden->BufferParms.ulBufferSize;
- _this->hidden->pMixBuffers[i].ulUserParm = (ULONG) pBufferDesc; // User parameter: Description of buffer
- _this->hidden->pMixBuffers[i].ulFlags = 0; // Some stuff should be flagged here for DART, like end of
- // audio data, but as we will continously send
- // audio data, there will be no end.:)
- SDL_memset(_this->hidden->pMixBuffers[i].pBuffer, iSilence, iBufSize);
- }
- }
- _this->hidden->iNextFreeBuffer = 0;
- _this->hidden->iLastPlayedBuf = -1;
- // Create event semaphore
- if (DosCreateEventSem(NULL, &(_this->hidden->hevAudioBufferPlayed), 0, FALSE)!=NO_ERROR)
- {
- // Could not create event semaphore!
- {
- int i;
- for (i=0; i<iNumBufs; i++) SDL_free((void *)(_this->hidden->pMixBuffers[i].ulUserParm));
- }
- mciSendCommand(iDeviceOrd, MCI_BUFFER, MCI_WAIT | MCI_DEALLOCATE_MEMORY, &(_this->hidden->BufferParms), 0);
- SDL_free(_this->hidden->pMixBuffers); _this->hidden->pMixBuffers = NULL;
- mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0);
- SDL_SetError("Could not create event semaphore");
- return(-1);
- }
-
- // Store the new settings in global variables
- _this->hidden->iCurrDeviceOrd = iDeviceOrd;
- _this->hidden->iCurrFreq = iFreq;
- _this->hidden->iCurrBits = iBits;
- _this->hidden->iCurrChannels = iChannels;
- _this->hidden->iCurrNumBufs = iNumBufs;
- _this->hidden->iCurrBufSize = iBufSize;
-
- return (0);
-}
-
-
-
-void DART_ThreadInit(_THIS)
-{
- return;
-}
-
-/* This function waits until it is possible to write a full sound buffer */
-void DART_WaitAudio(_THIS)
-{
- int i;
- pMixBufferDesc pBufDesc;
- ULONG ulPostCount;
-
- DosResetEventSem(_this->hidden->hevAudioBufferPlayed, &ulPostCount);
- // If there is already an empty buffer, then return now!
- for (i=0; i<_this->hidden->iCurrNumBufs; i++)
- {
- pBufDesc = (pMixBufferDesc) _this->hidden->pMixBuffers[i].ulUserParm;
- if (pBufDesc->iBufferUsage == BUFFER_EMPTY)
- return;
- }
- // If there is no empty buffer, wait for one to be empty!
- DosWaitEventSem(_this->hidden->hevAudioBufferPlayed, 1000); // Wait max 1 sec!!! Important!
- return;
-}
-
-void DART_PlayAudio(_THIS)
-{
- int iFreeBuf = _this->hidden->iNextFreeBuffer;
- pMixBufferDesc pBufDesc;
-
- pBufDesc = (pMixBufferDesc) _this->hidden->pMixBuffers[iFreeBuf].ulUserParm;
- pBufDesc->iBufferUsage = BUFFER_USED;
- // Send it to DART to be queued
- _this->hidden->MixSetupParms.pmixWrite(_this->hidden->MixSetupParms.ulMixHandle,
- &(_this->hidden->pMixBuffers[iFreeBuf]), 1);
-
- _this->hidden->iLastPlayedBuf = iFreeBuf;
- iFreeBuf = (iFreeBuf+1) % _this->hidden->iCurrNumBufs;
- _this->hidden->iNextFreeBuffer = iFreeBuf;
-}
-
-Uint8 *DART_GetAudioBuf(_THIS)
-{
- int iFreeBuf;
- Uint8 *pResult;
- pMixBufferDesc pBufDesc;
-
- if (_this)
- {
- if (_this->hidden)
- {
- iFreeBuf = _this->hidden->iNextFreeBuffer;
- pBufDesc = (pMixBufferDesc) _this->hidden->pMixBuffers[iFreeBuf].ulUserParm;
-
- if (pBufDesc)
- {
- if (pBufDesc->iBufferUsage == BUFFER_EMPTY)
- {
- pResult = _this->hidden->pMixBuffers[iFreeBuf].pBuffer;
- return pResult;
- }
- } else
- printf("[DART_GetAudioBuf] : ERROR! pBufDesc = %p\n", pBufDesc);
- } else
- printf("[DART_GetAudioBuf] : ERROR! _this->hidden = %p\n", _this->hidden);
- } else
- printf("[DART_GetAudioBuf] : ERROR! _this = %p\n", _this);
- return NULL;
-}
-
-void DART_WaitDone(_THIS)
-{
- pMixBufferDesc pBufDesc;
- ULONG ulPostCount;
- APIRET rc;
-
- pBufDesc = (pMixBufferDesc) _this->hidden->pMixBuffers[_this->hidden->iLastPlayedBuf].ulUserParm;
- rc = NO_ERROR;
- while ((pBufDesc->iBufferUsage != BUFFER_EMPTY) && (rc==NO_ERROR))
- {
- DosResetEventSem(_this->hidden->hevAudioBufferPlayed, &ulPostCount);
- rc = DosWaitEventSem(_this->hidden->hevAudioBufferPlayed, 1000); // 1 sec timeout! Important!
- }
-}
-
-void DART_CloseAudio(_THIS)
-{
- MCI_GENERIC_PARMS GenericParms;
- int rc;
-
- // Stop DART playback
- rc = mciSendCommand(_this->hidden->iCurrDeviceOrd, MCI_STOP, MCI_WAIT, &GenericParms, 0);
- if (rc!=MCIERR_SUCCESS)
- {
-#ifdef SFX_DEBUG_BUILD
- printf("Could not stop DART playback!\n");
- fflush(stdout);
-#endif
- }
-
- // Close event semaphore
- DosCloseEventSem(_this->hidden->hevAudioBufferPlayed);
-
- // Free memory of buffer descriptions
- {
- int i;
- for (i=0; i<_this->hidden->iCurrNumBufs; i++) SDL_free((void *)(_this->hidden->pMixBuffers[i].ulUserParm));
- }
-
- // Deallocate buffers
- rc = mciSendCommand(_this->hidden->iCurrDeviceOrd, MCI_BUFFER, MCI_WAIT | MCI_DEALLOCATE_MEMORY, &(_this->hidden->BufferParms), 0);
-
- // Free bufferlist
- SDL_free(_this->hidden->pMixBuffers); _this->hidden->pMixBuffers = NULL;
-
- // Close dart
- rc = mciSendCommand(_this->hidden->iCurrDeviceOrd, MCI_CLOSE, MCI_WAIT, &(GenericParms), 0);
-}
-
-/* Audio driver bootstrap functions */
-
-int Audio_Available(void)
-{
- return(1);
-}
-
-void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this )
- {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) )
- {
- SDL_OutOfMemory();
- if ( this )
- SDL_free(this);
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
- /* Set the function pointers */
- this->OpenAudio = DART_OpenAudio;
- this->ThreadInit = DART_ThreadInit;
- this->WaitAudio = DART_WaitAudio;
- this->PlayAudio = DART_PlayAudio;
- this->GetAudioBuf = DART_GetAudioBuf;
- this->WaitDone = DART_WaitDone;
- this->CloseAudio = DART_CloseAudio;
-
- this->free = Audio_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap DART_bootstrap = {
- "dart", "OS/2 Direct Audio RouTines (DART)",
- Audio_Available, Audio_CreateDevice
-};
-
diff --git a/distrib/sdl-1.2.12/src/audio/dart/SDL_dart.h b/distrib/sdl-1.2.12/src/audio/dart/SDL_dart.h
deleted file mode 100644
index 895da00..0000000
--- a/distrib/sdl-1.2.12/src/audio/dart/SDL_dart.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_lowaudio_h
-#define _SDL_lowaudio_h
-
-#define INCL_TYPES
-#define INCL_DOSSEMAPHORES
-#define INCL_DOSRESOURCES
-#define INCL_DOSMISC
-#define INCL_DOSERRORS
-
-#define INCL_OS2MM
-#define INCL_MMIOOS2
-#define INCL_MCIOS2
-#include <os2.h>
-#include <os2me.h> // DART stuff and MMIO stuff
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS SDL_AudioDevice *_this
-
-/* The DirectSound objects */
-struct SDL_PrivateAudioData
-{
- int iCurrDeviceOrd;
- int iCurrFreq;
- int iCurrBits;
- int iCurrChannels;
- int iCurrNumBufs;
- int iCurrBufSize;
-
- int iLastPlayedBuf;
- int iNextFreeBuffer;
-
- MCI_BUFFER_PARMS BufferParms; // Sound buffer parameters
- MCI_MIX_BUFFER *pMixBuffers; // Sound buffers
- MCI_MIXSETUP_PARMS MixSetupParms; // Mixer setup parameters
- HEV hevAudioBufferPlayed; // Event semaphore to indicate that an audio buffer has been played by DART
-};
-
-#endif /* _SDL_lowaudio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/dc/SDL_dcaudio.c b/distrib/sdl-1.2.12/src/audio/dc/SDL_dcaudio.c
deleted file mode 100644
index a28ea5a..0000000
--- a/distrib/sdl-1.2.12/src/audio/dc/SDL_dcaudio.c
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
-*/
-#include "SDL_config.h"
-
-/* Output dreamcast aica */
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_audiodev_c.h"
-#include "SDL_dcaudio.h"
-
-#include "aica.h"
-#include <dc/spu.h>
-
-/* Audio driver functions */
-static int DCAUD_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void DCAUD_WaitAudio(_THIS);
-static void DCAUD_PlayAudio(_THIS);
-static Uint8 *DCAUD_GetAudioBuf(_THIS);
-static void DCAUD_CloseAudio(_THIS);
-
-/* Audio driver bootstrap functions */
-static int DCAUD_Available(void)
-{
- return 1;
-}
-
-static void DCAUD_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_AudioDevice *DCAUD_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
- /* Set the function pointers */
- this->OpenAudio = DCAUD_OpenAudio;
- this->WaitAudio = DCAUD_WaitAudio;
- this->PlayAudio = DCAUD_PlayAudio;
- this->GetAudioBuf = DCAUD_GetAudioBuf;
- this->CloseAudio = DCAUD_CloseAudio;
-
- this->free = DCAUD_DeleteDevice;
-
- spu_init();
-
- return this;
-}
-
-AudioBootStrap DCAUD_bootstrap = {
- "dcaudio", "Dreamcast AICA audio",
- DCAUD_Available, DCAUD_CreateDevice
-};
-
-/* This function waits until it is possible to write a full sound buffer */
-static void DCAUD_WaitAudio(_THIS)
-{
- if (this->hidden->playing) {
- /* wait */
- while(aica_get_pos(0)/this->spec.samples == this->hidden->nextbuf) {
- thd_pass();
- }
- }
-}
-
-#define SPU_RAM_BASE 0xa0800000
-
-static void spu_memload_stereo8(int leftpos,int rightpos,void *src0,size_t size)
-{
- uint8 *src = src0;
- uint32 *left = (uint32*)(leftpos +SPU_RAM_BASE);
- uint32 *right = (uint32*)(rightpos+SPU_RAM_BASE);
- size = (size+7)/8;
- while(size--) {
- unsigned lval,rval;
- lval = *src++;
- rval = *src++;
- lval|= (*src++)<<8;
- rval|= (*src++)<<8;
- lval|= (*src++)<<16;
- rval|= (*src++)<<16;
- lval|= (*src++)<<24;
- rval|= (*src++)<<24;
- g2_write_32(left++,lval);
- g2_write_32(right++,rval);
- g2_fifo_wait();
- }
-}
-
-static void spu_memload_stereo16(int leftpos,int rightpos,void *src0,size_t size)
-{
- uint16 *src = src0;
- uint32 *left = (uint32*)(leftpos +SPU_RAM_BASE);
- uint32 *right = (uint32*)(rightpos+SPU_RAM_BASE);
- size = (size+7)/8;
- while(size--) {
- unsigned lval,rval;
- lval = *src++;
- rval = *src++;
- lval|= (*src++)<<16;
- rval|= (*src++)<<16;
- g2_write_32(left++,lval);
- g2_write_32(right++,rval);
- g2_fifo_wait();
- }
-}
-
-static void DCAUD_PlayAudio(_THIS)
-{
- SDL_AudioSpec *spec = &this->spec;
- unsigned int offset;
-
- if (this->hidden->playing) {
- /* wait */
- while(aica_get_pos(0)/spec->samples == this->hidden->nextbuf) {
- thd_pass();
- }
- }
-
- offset = this->hidden->nextbuf*spec->size;
- this->hidden->nextbuf^=1;
- /* Write the audio data, checking for EAGAIN on broken audio drivers */
- if (spec->channels==1) {
- spu_memload(this->hidden->leftpos+offset,this->hidden->mixbuf,this->hidden->mixlen);
- } else {
- offset/=2;
- if ((this->spec.format&255)==8) {
- spu_memload_stereo8(this->hidden->leftpos+offset,this->hidden->rightpos+offset,this->hidden->mixbuf,this->hidden->mixlen);
- } else {
- spu_memload_stereo16(this->hidden->leftpos+offset,this->hidden->rightpos+offset,this->hidden->mixbuf,this->hidden->mixlen);
- }
- }
-
- if (!this->hidden->playing) {
- int mode;
- this->hidden->playing = 1;
- mode = (spec->format==AUDIO_S8)?SM_8BIT:SM_16BIT;
- if (spec->channels==1) {
- aica_play(0,mode,this->hidden->leftpos,0,spec->samples*2,spec->freq,255,128,1);
- } else {
- aica_play(0,mode,this->hidden->leftpos ,0,spec->samples*2,spec->freq,255,0,1);
- aica_play(1,mode,this->hidden->rightpos,0,spec->samples*2,spec->freq,255,255,1);
- }
- }
-}
-
-static Uint8 *DCAUD_GetAudioBuf(_THIS)
-{
- return(this->hidden->mixbuf);
-}
-
-static void DCAUD_CloseAudio(_THIS)
-{
- aica_stop(0);
- if (this->spec.channels==2) aica_stop(1);
- if ( this->hidden->mixbuf != NULL ) {
- SDL_FreeAudioMem(this->hidden->mixbuf);
- this->hidden->mixbuf = NULL;
- }
-}
-
-static int DCAUD_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- Uint16 test_format = SDL_FirstAudioFormat(spec->format);
- int valid_datatype = 0;
- while ((!valid_datatype) && (test_format)) {
- spec->format = test_format;
- switch (test_format) {
- /* only formats Dreamcast accepts... */
- case AUDIO_S8:
- case AUDIO_S16LSB:
- valid_datatype = 1;
- break;
-
- default:
- test_format = SDL_NextAudioFormat();
- break;
- }
- }
-
- if (!valid_datatype) { /* shouldn't happen, but just in case... */
- SDL_SetError("Unsupported audio format");
- return (-1);
- }
-
- if (spec->channels > 2)
- spec->channels = 2; /* no more than stereo on the Dreamcast. */
-
- /* Update the fragment size as size in bytes */
- SDL_CalculateAudioSpec(spec);
-
- /* Allocate mixing buffer */
- this->hidden->mixlen = spec->size;
- this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
- if ( this->hidden->mixbuf == NULL ) {
- return(-1);
- }
- SDL_memset(this->hidden->mixbuf, spec->silence, spec->size);
- this->hidden->leftpos = 0x11000;
- this->hidden->rightpos = 0x11000+spec->size;
- this->hidden->playing = 0;
- this->hidden->nextbuf = 0;
-
- /* We're ready to rock and roll. :-) */
- return(0);
-}
diff --git a/distrib/sdl-1.2.12/src/audio/dc/SDL_dcaudio.h b/distrib/sdl-1.2.12/src/audio/dc/SDL_dcaudio.h
deleted file mode 100644
index a5b01d3..0000000
--- a/distrib/sdl-1.2.12/src/audio/dc/SDL_dcaudio.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_dcaudio_h
-#define _SDL_dcaudio_h
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData {
- /* The file descriptor for the audio device */
- Uint8 *mixbuf;
- Uint32 mixlen;
- int playing;
- int leftpos,rightpos;
- int nextbuf;
-};
-
-#endif /* _SDL_dcaudio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/dc/aica.h b/distrib/sdl-1.2.12/src/audio/dc/aica.h
deleted file mode 100644
index 93155d2..0000000
--- a/distrib/sdl-1.2.12/src/audio/dc/aica.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _AICA_H_
-#define _AICA_H_
-
-#define AICA_MEM 0xa0800000
-
-#define SM_8BIT 1
-#define SM_16BIT 0
-#define SM_ADPCM 2
-
-void aica_play(int ch,int mode,unsigned long smpptr,int looptst,int loopend,int freq,int vol,int pan,int loopflag);
-void aica_stop(int ch);
-void aica_vol(int ch,int vol);
-void aica_pan(int ch,int pan);
-void aica_freq(int ch,int freq);
-int aica_get_pos(int ch);
-
-#endif
diff --git a/distrib/sdl-1.2.12/src/audio/disk/SDL_diskaudio.c b/distrib/sdl-1.2.12/src/audio/disk/SDL_diskaudio.c
deleted file mode 100644
index d896d9d..0000000
--- a/distrib/sdl-1.2.12/src/audio/disk/SDL_diskaudio.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- This file written by Ryan C. Gordon (icculus@icculus.org)
-*/
-#include "SDL_config.h"
-
-/* Output raw audio data to a file. */
-
-#if HAVE_STDIO_H
-#include <stdio.h>
-#endif
-
-#include "SDL_rwops.h"
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_audiodev_c.h"
-#include "SDL_diskaudio.h"
-
-/* The tag name used by DISK audio */
-#define DISKAUD_DRIVER_NAME "disk"
-
-/* environment variables and defaults. */
-#define DISKENVR_OUTFILE "SDL_DISKAUDIOFILE"
-#define DISKDEFAULT_OUTFILE "sdlaudio.raw"
-#define DISKENVR_WRITEDELAY "SDL_DISKAUDIODELAY"
-#define DISKDEFAULT_WRITEDELAY 150
-
-/* Audio driver functions */
-static int DISKAUD_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void DISKAUD_WaitAudio(_THIS);
-static void DISKAUD_PlayAudio(_THIS);
-static Uint8 *DISKAUD_GetAudioBuf(_THIS);
-static void DISKAUD_CloseAudio(_THIS);
-
-static const char *DISKAUD_GetOutputFilename(void)
-{
- const char *envr = SDL_getenv(DISKENVR_OUTFILE);
- return((envr != NULL) ? envr : DISKDEFAULT_OUTFILE);
-}
-
-/* Audio driver bootstrap functions */
-static int DISKAUD_Available(void)
-{
- const char *envr = SDL_getenv("SDL_AUDIODRIVER");
- if (envr && (SDL_strcmp(envr, DISKAUD_DRIVER_NAME) == 0)) {
- return(1);
- }
- return(0);
-}
-
-static void DISKAUD_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_AudioDevice *DISKAUD_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
- const char *envr;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
- envr = SDL_getenv(DISKENVR_WRITEDELAY);
- this->hidden->write_delay = (envr) ? SDL_atoi(envr) : DISKDEFAULT_WRITEDELAY;
-
- /* Set the function pointers */
- this->OpenAudio = DISKAUD_OpenAudio;
- this->WaitAudio = DISKAUD_WaitAudio;
- this->PlayAudio = DISKAUD_PlayAudio;
- this->GetAudioBuf = DISKAUD_GetAudioBuf;
- this->CloseAudio = DISKAUD_CloseAudio;
-
- this->free = DISKAUD_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap DISKAUD_bootstrap = {
- DISKAUD_DRIVER_NAME, "direct-to-disk audio",
- DISKAUD_Available, DISKAUD_CreateDevice
-};
-
-/* This function waits until it is possible to write a full sound buffer */
-static void DISKAUD_WaitAudio(_THIS)
-{
- SDL_Delay(this->hidden->write_delay);
-}
-
-static void DISKAUD_PlayAudio(_THIS)
-{
- int written;
-
- /* Write the audio data */
- written = SDL_RWwrite(this->hidden->output,
- this->hidden->mixbuf, 1,
- this->hidden->mixlen);
-
- /* If we couldn't write, assume fatal error for now */
- if ( (Uint32)written != this->hidden->mixlen ) {
- this->enabled = 0;
- }
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Wrote %d bytes of audio data\n", written);
-#endif
-}
-
-static Uint8 *DISKAUD_GetAudioBuf(_THIS)
-{
- return(this->hidden->mixbuf);
-}
-
-static void DISKAUD_CloseAudio(_THIS)
-{
- if ( this->hidden->mixbuf != NULL ) {
- SDL_FreeAudioMem(this->hidden->mixbuf);
- this->hidden->mixbuf = NULL;
- }
- if ( this->hidden->output != NULL ) {
- SDL_RWclose(this->hidden->output);
- this->hidden->output = NULL;
- }
-}
-
-static int DISKAUD_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- const char *fname = DISKAUD_GetOutputFilename();
-
- /* Open the audio device */
- this->hidden->output = SDL_RWFromFile(fname, "wb");
- if ( this->hidden->output == NULL ) {
- return(-1);
- }
-
-#if HAVE_STDIO_H
- fprintf(stderr, "WARNING: You are using the SDL disk writer"
- " audio driver!\n Writing to file [%s].\n", fname);
-#endif
-
- /* Allocate mixing buffer */
- this->hidden->mixlen = spec->size;
- this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
- if ( this->hidden->mixbuf == NULL ) {
- return(-1);
- }
- SDL_memset(this->hidden->mixbuf, spec->silence, spec->size);
-
- /* We're ready to rock and roll. :-) */
- return(0);
-}
-
diff --git a/distrib/sdl-1.2.12/src/audio/disk/SDL_diskaudio.h b/distrib/sdl-1.2.12/src/audio/disk/SDL_diskaudio.h
deleted file mode 100644
index 2ddd68f..0000000
--- a/distrib/sdl-1.2.12/src/audio/disk/SDL_diskaudio.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_diskaudio_h
-#define _SDL_diskaudio_h
-
-#include "SDL_rwops.h"
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData {
- /* The file descriptor for the audio device */
- SDL_RWops *output;
- Uint8 *mixbuf;
- Uint32 mixlen;
- Uint32 write_delay;
-};
-
-#endif /* _SDL_diskaudio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/dma/SDL_dmaaudio.c b/distrib/sdl-1.2.12/src/audio/dma/SDL_dmaaudio.c
deleted file mode 100644
index 84734a3..0000000
--- a/distrib/sdl-1.2.12/src/audio/dma/SDL_dmaaudio.c
+++ /dev/null
@@ -1,455 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Allow access to a raw mixing buffer */
-
-#include <stdio.h>
-#include <string.h> /* For strerror() */
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-
-#if SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
-/* This is installed on some systems */
-#include <soundcard.h>
-#else
-/* This is recommended by OSS */
-#include <sys/soundcard.h>
-#endif
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((Uint8 *)-1)
-#endif
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_audiodev_c.h"
-#include "SDL_dmaaudio.h"
-
-/* The tag name used by DMA audio */
-#define DMA_DRIVER_NAME "dma"
-
-/* Open the audio device for playback, and don't block if busy */
-#define OPEN_FLAGS (O_RDWR|O_NONBLOCK)
-
-/* Audio driver functions */
-static int DMA_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void DMA_WaitAudio(_THIS);
-static void DMA_PlayAudio(_THIS);
-static Uint8 *DMA_GetAudioBuf(_THIS);
-static void DMA_CloseAudio(_THIS);
-
-/* Audio driver bootstrap functions */
-
-static int Audio_Available(void)
-{
- int available;
- int fd;
-
- available = 0;
-
- fd = SDL_OpenAudioPath(NULL, 0, OPEN_FLAGS, 0);
- if ( fd >= 0 ) {
- int caps;
- struct audio_buf_info info;
-
- if ( (ioctl(fd, SNDCTL_DSP_GETCAPS, &caps) == 0) &&
- (caps & DSP_CAP_TRIGGER) && (caps & DSP_CAP_MMAP) &&
- (ioctl(fd, SNDCTL_DSP_GETOSPACE, &info) == 0) ) {
- available = 1;
- }
- close(fd);
- }
- return(available);
-}
-
-static void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
- audio_fd = -1;
-
- /* Set the function pointers */
- this->OpenAudio = DMA_OpenAudio;
- this->WaitAudio = DMA_WaitAudio;
- this->PlayAudio = DMA_PlayAudio;
- this->GetAudioBuf = DMA_GetAudioBuf;
- this->CloseAudio = DMA_CloseAudio;
-
- this->free = Audio_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap DMA_bootstrap = {
- DMA_DRIVER_NAME, "OSS /dev/dsp DMA audio",
- Audio_Available, Audio_CreateDevice
-};
-
-/* This function waits until it is possible to write a full sound buffer */
-static void DMA_WaitAudio(_THIS)
-{
- fd_set fdset;
-
- /* Check to see if the thread-parent process is still alive */
- { static int cnt = 0;
- /* Note that this only works with thread implementations
- that use a different process id for each thread.
- */
- if (parent && (((++cnt)%10) == 0)) { /* Check every 10 loops */
- if ( kill(parent, 0) < 0 ) {
- this->enabled = 0;
- }
- }
- }
-
- /* See if we need to use timed audio synchronization */
- if ( frame_ticks ) {
- /* Use timer for general audio synchronization */
- Sint32 ticks;
-
- ticks = ((Sint32)(next_frame - SDL_GetTicks()))-FUDGE_TICKS;
- if ( ticks > 0 ) {
- SDL_Delay(ticks);
- }
- } else {
- /* Use select() for audio synchronization */
- struct timeval timeout;
- FD_ZERO(&fdset);
- FD_SET(audio_fd, &fdset);
- timeout.tv_sec = 10;
- timeout.tv_usec = 0;
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Waiting for audio to get ready\n");
-#endif
- if ( select(audio_fd+1, NULL, &fdset, NULL, &timeout) <= 0 ) {
- const char *message =
-#ifdef AUDIO_OSPACE_HACK
- "Audio timeout - buggy audio driver? (trying ospace)";
-#else
- "Audio timeout - buggy audio driver? (disabled)";
-#endif
- /* In general we should never print to the screen,
- but in this case we have no other way of letting
- the user know what happened.
- */
- fprintf(stderr, "SDL: %s\n", message);
-#ifdef AUDIO_OSPACE_HACK
- /* We may be able to use GET_OSPACE trick */
- frame_ticks = (float)(this->spec->samples*1000) /
- this->spec->freq;
- next_frame = SDL_GetTicks()+frame_ticks;
-#else
- this->enabled = 0;
- /* Don't try to close - may hang */
- audio_fd = -1;
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Done disabling audio\n");
-#endif
-#endif /* AUDIO_OSPACE_HACK */
- }
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Ready!\n");
-#endif
- }
-}
-
-static void DMA_PlayAudio(_THIS)
-{
- /* If timer synchronization is enabled, set the next write frame */
- if ( frame_ticks ) {
- next_frame += frame_ticks;
- }
- return;
-}
-
-static Uint8 *DMA_GetAudioBuf(_THIS)
-{
- count_info info;
- int playing;
- int filling;
-
- /* Get number of blocks, looping if we're not using select() */
- do {
- if ( ioctl(audio_fd, SNDCTL_DSP_GETOPTR, &info) < 0 ) {
- /* Uh oh... */
- this->enabled = 0;
- return(NULL);
- }
- } while ( frame_ticks && (info.blocks < 1) );
-#ifdef DEBUG_AUDIO
- if ( info.blocks > 1 ) {
- printf("Warning: audio underflow (%d frags)\n", info.blocks-1);
- }
-#endif
- playing = info.ptr / this->spec.size;
- filling = (playing + 1)%num_buffers;
- return (dma_buf + (filling * this->spec.size));
-}
-
-static void DMA_CloseAudio(_THIS)
-{
- if ( dma_buf != NULL ) {
- munmap(dma_buf, dma_len);
- dma_buf = NULL;
- }
- if ( audio_fd >= 0 ) {
- close(audio_fd);
- audio_fd = -1;
- }
-}
-
-static int DMA_ReopenAudio(_THIS, const char *audiodev, int format, int stereo,
- SDL_AudioSpec *spec)
-{
- int frag_spec;
- int value;
-
- /* Close and then reopen the audio device */
- close(audio_fd);
- audio_fd = open(audiodev, O_RDWR, 0);
- if ( audio_fd < 0 ) {
- SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno));
- return(-1);
- }
-
- /* Calculate the final parameters for this audio specification */
- SDL_CalculateAudioSpec(spec);
-
- /* Determine the power of two of the fragment size */
- for ( frag_spec = 0; (0x01<<frag_spec) < spec->size; ++frag_spec );
- if ( (0x01<<frag_spec) != spec->size ) {
- SDL_SetError("Fragment size must be a power of two");
- return(-1);
- }
-
- /* Set the audio buffering parameters */
- if ( ioctl(audio_fd, SNDCTL_DSP_SETFRAGMENT, &frag_spec) < 0 ) {
- SDL_SetError("Couldn't set audio fragment spec");
- return(-1);
- }
-
- /* Set the audio format */
- value = format;
- if ( (ioctl(audio_fd, SNDCTL_DSP_SETFMT, &value) < 0) ||
- (value != format) ) {
- SDL_SetError("Couldn't set audio format");
- return(-1);
- }
-
- /* Set mono or stereo audio */
- value = (spec->channels > 1);
- if ( (ioctl(audio_fd, SNDCTL_DSP_STEREO, &stereo) < 0) ||
- (value != stereo) ) {
- SDL_SetError("Couldn't set audio channels");
- return(-1);
- }
-
- /* Set the DSP frequency */
- value = spec->freq;
- if ( ioctl(audio_fd, SNDCTL_DSP_SPEED, &value) < 0 ) {
- SDL_SetError("Couldn't set audio frequency");
- return(-1);
- }
- spec->freq = value;
-
- /* We successfully re-opened the audio */
- return(0);
-}
-
-static int DMA_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- char audiodev[1024];
- int format;
- int stereo;
- int value;
- Uint16 test_format;
- struct audio_buf_info info;
-
- /* Reset the timer synchronization flag */
- frame_ticks = 0.0;
-
- /* Open the audio device */
- audio_fd = SDL_OpenAudioPath(audiodev, sizeof(audiodev), OPEN_FLAGS, 0);
- if ( audio_fd < 0 ) {
- SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno));
- return(-1);
- }
- dma_buf = NULL;
- ioctl(audio_fd, SNDCTL_DSP_RESET, 0);
-
- /* Get a list of supported hardware formats */
- if ( ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &value) < 0 ) {
- SDL_SetError("Couldn't get audio format list");
- return(-1);
- }
-
- /* Try for a closest match on audio format */
- format = 0;
- for ( test_format = SDL_FirstAudioFormat(spec->format);
- ! format && test_format; ) {
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Trying format 0x%4.4x\n", test_format);
-#endif
- switch ( test_format ) {
- case AUDIO_U8:
- if ( value & AFMT_U8 ) {
- format = AFMT_U8;
- }
- break;
- case AUDIO_S8:
- if ( value & AFMT_S8 ) {
- format = AFMT_S8;
- }
- break;
- case AUDIO_S16LSB:
- if ( value & AFMT_S16_LE ) {
- format = AFMT_S16_LE;
- }
- break;
- case AUDIO_S16MSB:
- if ( value & AFMT_S16_BE ) {
- format = AFMT_S16_BE;
- }
- break;
- case AUDIO_U16LSB:
- if ( value & AFMT_U16_LE ) {
- format = AFMT_U16_LE;
- }
- break;
- case AUDIO_U16MSB:
- if ( value & AFMT_U16_BE ) {
- format = AFMT_U16_BE;
- }
- break;
- default:
- format = 0;
- break;
- }
- if ( ! format ) {
- test_format = SDL_NextAudioFormat();
- }
- }
- if ( format == 0 ) {
- SDL_SetError("Couldn't find any hardware audio formats");
- return(-1);
- }
- spec->format = test_format;
-
- /* Set the audio format */
- value = format;
- if ( (ioctl(audio_fd, SNDCTL_DSP_SETFMT, &value) < 0) ||
- (value != format) ) {
- SDL_SetError("Couldn't set audio format");
- return(-1);
- }
-
- /* Set mono or stereo audio (currently only two channels supported) */
- stereo = (spec->channels > 1);
- ioctl(audio_fd, SNDCTL_DSP_STEREO, &stereo);
- if ( stereo ) {
- spec->channels = 2;
- } else {
- spec->channels = 1;
- }
-
- /* Because some drivers don't allow setting the buffer size
- after setting the format, we must re-open the audio device
- once we know what format and channels are supported
- */
- if ( DMA_ReopenAudio(this, audiodev, format, stereo, spec) < 0 ) {
- /* Error is set by DMA_ReopenAudio() */
- return(-1);
- }
-
- /* Memory map the audio buffer */
- if ( ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info) < 0 ) {
- SDL_SetError("Couldn't get OSPACE parameters");
- return(-1);
- }
- spec->size = info.fragsize;
- spec->samples = spec->size / ((spec->format & 0xFF) / 8);
- spec->samples /= spec->channels;
- num_buffers = info.fragstotal;
- dma_len = num_buffers*spec->size;
- dma_buf = (Uint8 *)mmap(NULL, dma_len, PROT_WRITE, MAP_SHARED,
- audio_fd, 0);
- if ( dma_buf == MAP_FAILED ) {
- SDL_SetError("DMA memory map failed");
- dma_buf = NULL;
- return(-1);
- }
- SDL_memset(dma_buf, spec->silence, dma_len);
-
- /* Check to see if we need to use select() workaround */
- { char *workaround;
- workaround = SDL_getenv("SDL_DSP_NOSELECT");
- if ( workaround ) {
- frame_ticks = (float)(spec->samples*1000)/spec->freq;
- next_frame = SDL_GetTicks()+frame_ticks;
- }
- }
-
- /* Trigger audio playback */
- value = 0;
- ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &value);
- value = PCM_ENABLE_OUTPUT;
- if ( ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &value) < 0 ) {
- SDL_SetError("Couldn't trigger audio output");
- return(-1);
- }
-
- /* Get the parent process id (we're the parent of the audio thread) */
- parent = getpid();
-
- /* We're ready to rock and roll. :-) */
- return(0);
-}
diff --git a/distrib/sdl-1.2.12/src/audio/dma/SDL_dmaaudio.h b/distrib/sdl-1.2.12/src/audio/dma/SDL_dmaaudio.h
deleted file mode 100644
index ca8c05a..0000000
--- a/distrib/sdl-1.2.12/src/audio/dma/SDL_dmaaudio.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_dspaudio_h
-#define _SDL_dspaudio_h
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData {
- /* The file descriptor for the audio device */
- int audio_fd;
-
- /* The parent process id, to detect when application quits */
- pid_t parent;
-
- /* Raw mixing buffer */
- Uint8 *dma_buf;
- int dma_len;
- int num_buffers;
-
- /* Support for audio timing using a timer, in addition to select() */
- float frame_ticks;
- float next_frame;
-};
-#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */
-
-/* Old variable names */
-#define audio_fd (this->hidden->audio_fd)
-#define parent (this->hidden->parent)
-#define dma_buf (this->hidden->dma_buf)
-#define dma_len (this->hidden->dma_len)
-#define num_buffers (this->hidden->num_buffers)
-#define frame_ticks (this->hidden->frame_ticks)
-#define next_frame (this->hidden->next_frame)
-
-#endif /* _SDL_dspaudio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/dmedia/SDL_irixaudio.c b/distrib/sdl-1.2.12/src/audio/dmedia/SDL_irixaudio.c
deleted file mode 100644
index f9bd310..0000000
--- a/distrib/sdl-1.2.12/src/audio/dmedia/SDL_irixaudio.c
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Allow access to a raw mixing buffer (For IRIX 6.5 and higher) */
-/* patch for IRIX 5 by Georg Schwarz 18/07/2004 */
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "SDL_irixaudio.h"
-
-
-#ifndef AL_RESOURCE /* as a test whether we use the old IRIX audio libraries */
-#define OLD_IRIX_AUDIO
-#define alClosePort(x) ALcloseport(x)
-#define alFreeConfig(x) ALfreeconfig(x)
-#define alGetFillable(x) ALgetfillable(x)
-#define alNewConfig() ALnewconfig()
-#define alOpenPort(x,y,z) ALopenport(x,y,z)
-#define alSetChannels(x,y) ALsetchannels(x,y)
-#define alSetQueueSize(x,y) ALsetqueuesize(x,y)
-#define alSetSampFmt(x,y) ALsetsampfmt(x,y)
-#define alSetWidth(x,y) ALsetwidth(x,y)
-#endif
-
-/* Audio driver functions */
-static int AL_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void AL_WaitAudio(_THIS);
-static void AL_PlayAudio(_THIS);
-static Uint8 *AL_GetAudioBuf(_THIS);
-static void AL_CloseAudio(_THIS);
-
-/* Audio driver bootstrap functions */
-
-static int Audio_Available(void)
-{
- return 1;
-}
-
-static void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
- /* Set the function pointers */
- this->OpenAudio = AL_OpenAudio;
- this->WaitAudio = AL_WaitAudio;
- this->PlayAudio = AL_PlayAudio;
- this->GetAudioBuf = AL_GetAudioBuf;
- this->CloseAudio = AL_CloseAudio;
-
- this->free = Audio_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap DMEDIA_bootstrap = {
- "AL", "IRIX DMedia audio",
- Audio_Available, Audio_CreateDevice
-};
-
-
-void static AL_WaitAudio(_THIS)
-{
- Sint32 timeleft;
-
- timeleft = this->spec.samples - alGetFillable(audio_port);
- if ( timeleft > 0 ) {
- timeleft /= (this->spec.freq/1000);
- SDL_Delay((Uint32)timeleft);
- }
-}
-
-static void AL_PlayAudio(_THIS)
-{
- /* Write the audio data out */
- if ( alWriteFrames(audio_port, mixbuf, this->spec.samples) < 0 ) {
- /* Assume fatal error, for now */
- this->enabled = 0;
- }
-}
-
-static Uint8 *AL_GetAudioBuf(_THIS)
-{
- return(mixbuf);
-}
-
-static void AL_CloseAudio(_THIS)
-{
- if ( mixbuf != NULL ) {
- SDL_FreeAudioMem(mixbuf);
- mixbuf = NULL;
- }
- if ( audio_port != NULL ) {
- alClosePort(audio_port);
- audio_port = NULL;
- }
-}
-
-static int AL_OpenAudio(_THIS, SDL_AudioSpec * spec)
-{
- Uint16 test_format = SDL_FirstAudioFormat(spec->format);
- long width = 0;
- long fmt = 0;
- int valid = 0;
-
-#ifdef OLD_IRIX_AUDIO
- {
- long audio_param[2];
- audio_param[0] = AL_OUTPUT_RATE;
- audio_param[1] = spec->freq;
- valid = (ALsetparams(AL_DEFAULT_DEVICE, audio_param, 2) < 0);
- }
-#else
- {
- ALpv audio_param;
- audio_param.param = AL_RATE;
- audio_param.value.i = spec->freq;
- valid = (alSetParams(AL_DEFAULT_OUTPUT, &audio_param, 1) < 0);
- }
-#endif
-
- while ((!valid) && (test_format)) {
- valid = 1;
- spec->format = test_format;
-
- switch (test_format) {
- case AUDIO_S8:
- width = AL_SAMPLE_8;
- fmt = AL_SAMPFMT_TWOSCOMP;
- break;
-
- case AUDIO_S16SYS:
- width = AL_SAMPLE_16;
- fmt = AL_SAMPFMT_TWOSCOMP;
- break;
-
- default:
- valid = 0;
- test_format = SDL_NextAudioFormat();
- break;
- }
-
- if (valid) {
- ALconfig audio_config = alNewConfig();
- valid = 0;
- if (audio_config) {
- if (alSetChannels(audio_config, spec->channels) < 0) {
- if (spec->channels > 2) { /* can't handle > stereo? */
- spec->channels = 2; /* try again below. */
- }
- }
-
- if ((alSetSampFmt(audio_config, fmt) >= 0) &&
- ((!width) || (alSetWidth(audio_config, width) >= 0)) &&
- (alSetQueueSize(audio_config, spec->samples * 2) >= 0) &&
- (alSetChannels(audio_config, spec->channels) >= 0)) {
-
- audio_port = alOpenPort("SDL audio", "w", audio_config);
- if (audio_port == NULL) {
- /* docs say AL_BAD_CHANNELS happens here, too. */
- int err = oserror();
- if (err == AL_BAD_CHANNELS) {
- spec->channels = 2;
- alSetChannels(audio_config, spec->channels);
- audio_port = alOpenPort("SDL audio", "w",
- audio_config);
- }
- }
-
- if (audio_port != NULL) {
- valid = 1;
- }
- }
-
- alFreeConfig(audio_config);
- }
- }
- }
-
- if (!valid) {
- SDL_SetError("Unsupported audio format");
- return (-1);
- }
-
- /* Update the fragment size as size in bytes */
- SDL_CalculateAudioSpec(spec);
-
- /* Allocate mixing buffer */
- mixbuf = (Uint8 *) SDL_AllocAudioMem(spec->size);
- if (mixbuf == NULL) {
- SDL_OutOfMemory();
- return (-1);
- }
- SDL_memset(mixbuf, spec->silence, spec->size);
-
- /* We're ready to rock and roll. :-) */
- return (0);
-}
-
diff --git a/distrib/sdl-1.2.12/src/audio/dmedia/SDL_irixaudio.h b/distrib/sdl-1.2.12/src/audio/dmedia/SDL_irixaudio.h
deleted file mode 100644
index 751de41..0000000
--- a/distrib/sdl-1.2.12/src/audio/dmedia/SDL_irixaudio.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_lowaudio_h
-#define _SDL_lowaudio_h
-
-#include <dmedia/audio.h>
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData {
- /* The handle for the audio device */
- ALport audio_port;
-
- Uint8 *mixbuf; /* The app mixing buffer */
-};
-
-/* Old variable names */
-#define audio_port (this->hidden->audio_port)
-#define mixbuf (this->hidden->mixbuf)
-
-#endif /* _SDL_lowaudio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/dsp/SDL_dspaudio.c b/distrib/sdl-1.2.12/src/audio/dsp/SDL_dspaudio.c
deleted file mode 100644
index 95617e3..0000000
--- a/distrib/sdl-1.2.12/src/audio/dsp/SDL_dspaudio.c
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- Modified in Oct 2004 by Hannu Savolainen
- hannu@opensound.com
-*/
-#include "SDL_config.h"
-
-/* Allow access to a raw mixing buffer */
-
-#include <stdio.h> /* For perror() */
-#include <string.h> /* For strerror() */
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-
-#if SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
-/* This is installed on some systems */
-#include <soundcard.h>
-#else
-/* This is recommended by OSS */
-#include <sys/soundcard.h>
-#endif
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_audiodev_c.h"
-#include "SDL_dspaudio.h"
-
-/* The tag name used by DSP audio */
-#define DSP_DRIVER_NAME "dsp"
-
-/* Open the audio device for playback, and don't block if busy */
-#define OPEN_FLAGS (O_WRONLY|O_NONBLOCK)
-
-/* Audio driver functions */
-static int DSP_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void DSP_WaitAudio(_THIS);
-static void DSP_PlayAudio(_THIS);
-static Uint8 *DSP_GetAudioBuf(_THIS);
-static void DSP_CloseAudio(_THIS);
-
-/* Audio driver bootstrap functions */
-
-static int Audio_Available(void)
-{
- int fd;
- int available;
-
- available = 0;
- fd = SDL_OpenAudioPath(NULL, 0, OPEN_FLAGS, 0);
- if ( fd >= 0 ) {
- available = 1;
- close(fd);
- }
- return(available);
-}
-
-static void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
- audio_fd = -1;
-
- /* Set the function pointers */
- this->OpenAudio = DSP_OpenAudio;
- this->WaitAudio = DSP_WaitAudio;
- this->PlayAudio = DSP_PlayAudio;
- this->GetAudioBuf = DSP_GetAudioBuf;
- this->CloseAudio = DSP_CloseAudio;
-
- this->free = Audio_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap DSP_bootstrap = {
- DSP_DRIVER_NAME, "OSS /dev/dsp standard audio",
- Audio_Available, Audio_CreateDevice
-};
-
-/* This function waits until it is possible to write a full sound buffer */
-static void DSP_WaitAudio(_THIS)
-{
- /* Not needed at all since OSS handles waiting automagically */
-}
-
-static void DSP_PlayAudio(_THIS)
-{
- if (write(audio_fd, mixbuf, mixlen)==-1)
- {
- perror("Audio write");
- this->enabled = 0;
- }
-
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Wrote %d bytes of audio data\n", mixlen);
-#endif
-}
-
-static Uint8 *DSP_GetAudioBuf(_THIS)
-{
- return(mixbuf);
-}
-
-static void DSP_CloseAudio(_THIS)
-{
- if ( mixbuf != NULL ) {
- SDL_FreeAudioMem(mixbuf);
- mixbuf = NULL;
- }
- if ( audio_fd >= 0 ) {
- close(audio_fd);
- audio_fd = -1;
- }
-}
-
-static int DSP_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- char audiodev[1024];
- int format;
- int value;
- int frag_spec;
- Uint16 test_format;
-
- /* Make sure fragment size stays a power of 2, or OSS fails. */
- /* I don't know which of these are actually legal values, though... */
- if (spec->channels > 8)
- spec->channels = 8;
- else if (spec->channels > 4)
- spec->channels = 4;
- else if (spec->channels > 2)
- spec->channels = 2;
-
- /* Open the audio device */
- audio_fd = SDL_OpenAudioPath(audiodev, sizeof(audiodev), OPEN_FLAGS, 0);
- if ( audio_fd < 0 ) {
- SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno));
- return(-1);
- }
- mixbuf = NULL;
-
- /* Make the file descriptor use blocking writes with fcntl() */
- { long flags;
- flags = fcntl(audio_fd, F_GETFL);
- flags &= ~O_NONBLOCK;
- if ( fcntl(audio_fd, F_SETFL, flags) < 0 ) {
- SDL_SetError("Couldn't set audio blocking mode");
- DSP_CloseAudio(this);
- return(-1);
- }
- }
-
- /* Get a list of supported hardware formats */
- if ( ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &value) < 0 ) {
- perror("SNDCTL_DSP_GETFMTS");
- SDL_SetError("Couldn't get audio format list");
- DSP_CloseAudio(this);
- return(-1);
- }
-
- /* Try for a closest match on audio format */
- format = 0;
- for ( test_format = SDL_FirstAudioFormat(spec->format);
- ! format && test_format; ) {
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Trying format 0x%4.4x\n", test_format);
-#endif
- switch ( test_format ) {
- case AUDIO_U8:
- if ( value & AFMT_U8 ) {
- format = AFMT_U8;
- }
- break;
- case AUDIO_S16LSB:
- if ( value & AFMT_S16_LE ) {
- format = AFMT_S16_LE;
- }
- break;
- case AUDIO_S16MSB:
- if ( value & AFMT_S16_BE ) {
- format = AFMT_S16_BE;
- }
- break;
-#if 0
-/*
- * These formats are not used by any real life systems so they are not
- * needed here.
- */
- case AUDIO_S8:
- if ( value & AFMT_S8 ) {
- format = AFMT_S8;
- }
- break;
- case AUDIO_U16LSB:
- if ( value & AFMT_U16_LE ) {
- format = AFMT_U16_LE;
- }
- break;
- case AUDIO_U16MSB:
- if ( value & AFMT_U16_BE ) {
- format = AFMT_U16_BE;
- }
- break;
-#endif
- default:
- format = 0;
- break;
- }
- if ( ! format ) {
- test_format = SDL_NextAudioFormat();
- }
- }
- if ( format == 0 ) {
- SDL_SetError("Couldn't find any hardware audio formats");
- DSP_CloseAudio(this);
- return(-1);
- }
- spec->format = test_format;
-
- /* Set the audio format */
- value = format;
- if ( (ioctl(audio_fd, SNDCTL_DSP_SETFMT, &value) < 0) ||
- (value != format) ) {
- perror("SNDCTL_DSP_SETFMT");
- SDL_SetError("Couldn't set audio format");
- DSP_CloseAudio(this);
- return(-1);
- }
-
- /* Set the number of channels of output */
- value = spec->channels;
- if ( ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &value) < 0 ) {
- perror("SNDCTL_DSP_CHANNELS");
- SDL_SetError("Cannot set the number of channels");
- DSP_CloseAudio(this);
- return(-1);
- }
- spec->channels = value;
-
- /* Set the DSP frequency */
- value = spec->freq;
- if ( ioctl(audio_fd, SNDCTL_DSP_SPEED, &value) < 0 ) {
- perror("SNDCTL_DSP_SPEED");
- SDL_SetError("Couldn't set audio frequency");
- DSP_CloseAudio(this);
- return(-1);
- }
- spec->freq = value;
-
- /* Calculate the final parameters for this audio specification */
- SDL_CalculateAudioSpec(spec);
-
- /* Determine the power of two of the fragment size */
- for ( frag_spec = 0; (0x01U<<frag_spec) < spec->size; ++frag_spec );
- if ( (0x01U<<frag_spec) != spec->size ) {
- SDL_SetError("Fragment size must be a power of two");
- DSP_CloseAudio(this);
- return(-1);
- }
- frag_spec |= 0x00020000; /* two fragments, for low latency */
-
- /* Set the audio buffering parameters */
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Requesting %d fragments of size %d\n",
- (frag_spec >> 16), 1<<(frag_spec&0xFFFF));
-#endif
- if ( ioctl(audio_fd, SNDCTL_DSP_SETFRAGMENT, &frag_spec) < 0 ) {
- perror("SNDCTL_DSP_SETFRAGMENT");
- }
-#ifdef DEBUG_AUDIO
- { audio_buf_info info;
- ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info);
- fprintf(stderr, "fragments = %d\n", info.fragments);
- fprintf(stderr, "fragstotal = %d\n", info.fragstotal);
- fprintf(stderr, "fragsize = %d\n", info.fragsize);
- fprintf(stderr, "bytes = %d\n", info.bytes);
- }
-#endif
-
- /* Allocate mixing buffer */
- mixlen = spec->size;
- mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen);
- if ( mixbuf == NULL ) {
- DSP_CloseAudio(this);
- return(-1);
- }
- SDL_memset(mixbuf, spec->silence, spec->size);
-
- /* Get the parent process id (we're the parent of the audio thread) */
- parent = getpid();
-
- /* We're ready to rock and roll. :-) */
- return(0);
-}
diff --git a/distrib/sdl-1.2.12/src/audio/dsp/SDL_dspaudio.h b/distrib/sdl-1.2.12/src/audio/dsp/SDL_dspaudio.h
deleted file mode 100644
index 0bf803f..0000000
--- a/distrib/sdl-1.2.12/src/audio/dsp/SDL_dspaudio.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_dspaudio_h
-#define _SDL_dspaudio_h
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData {
- /* The file descriptor for the audio device */
- int audio_fd;
-
- /* The parent process id, to detect when application quits */
- pid_t parent;
-
- /* Raw mixing buffer */
- Uint8 *mixbuf;
- int mixlen;
-};
-#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */
-
-/* Old variable names */
-#define audio_fd (this->hidden->audio_fd)
-#define parent (this->hidden->parent)
-#define mixbuf (this->hidden->mixbuf)
-#define mixlen (this->hidden->mixlen)
-#define frame_ticks (this->hidden->frame_ticks)
-#define next_frame (this->hidden->next_frame)
-
-#endif /* _SDL_dspaudio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/dummy/SDL_dummyaudio.c b/distrib/sdl-1.2.12/src/audio/dummy/SDL_dummyaudio.c
deleted file mode 100644
index 6e9a3f0..0000000
--- a/distrib/sdl-1.2.12/src/audio/dummy/SDL_dummyaudio.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- This file written by Ryan C. Gordon (icculus@icculus.org)
-*/
-#include "SDL_config.h"
-
-/* Output audio to nowhere... */
-
-#include "SDL_rwops.h"
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_audiodev_c.h"
-#include "SDL_dummyaudio.h"
-
-/* The tag name used by DUMMY audio */
-#define DUMMYAUD_DRIVER_NAME "dummy"
-
-/* Audio driver functions */
-static int DUMMYAUD_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void DUMMYAUD_WaitAudio(_THIS);
-static void DUMMYAUD_PlayAudio(_THIS);
-static Uint8 *DUMMYAUD_GetAudioBuf(_THIS);
-static void DUMMYAUD_CloseAudio(_THIS);
-
-/* Audio driver bootstrap functions */
-static int DUMMYAUD_Available(void)
-{
- const char *envr = SDL_getenv("SDL_AUDIODRIVER");
- if (envr && (SDL_strcmp(envr, DUMMYAUD_DRIVER_NAME) == 0)) {
- return(1);
- }
- return(0);
-}
-
-static void DUMMYAUD_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_AudioDevice *DUMMYAUD_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
- /* Set the function pointers */
- this->OpenAudio = DUMMYAUD_OpenAudio;
- this->WaitAudio = DUMMYAUD_WaitAudio;
- this->PlayAudio = DUMMYAUD_PlayAudio;
- this->GetAudioBuf = DUMMYAUD_GetAudioBuf;
- this->CloseAudio = DUMMYAUD_CloseAudio;
-
- this->free = DUMMYAUD_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap DUMMYAUD_bootstrap = {
- DUMMYAUD_DRIVER_NAME, "SDL dummy audio driver",
- DUMMYAUD_Available, DUMMYAUD_CreateDevice
-};
-
-/* This function waits until it is possible to write a full sound buffer */
-static void DUMMYAUD_WaitAudio(_THIS)
-{
- /* Don't block on first calls to simulate initial fragment filling. */
- if (this->hidden->initial_calls)
- this->hidden->initial_calls--;
- else
- SDL_Delay(this->hidden->write_delay);
-}
-
-static void DUMMYAUD_PlayAudio(_THIS)
-{
- /* no-op...this is a null driver. */
-}
-
-static Uint8 *DUMMYAUD_GetAudioBuf(_THIS)
-{
- return(this->hidden->mixbuf);
-}
-
-static void DUMMYAUD_CloseAudio(_THIS)
-{
- if ( this->hidden->mixbuf != NULL ) {
- SDL_FreeAudioMem(this->hidden->mixbuf);
- this->hidden->mixbuf = NULL;
- }
-}
-
-static int DUMMYAUD_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- float bytes_per_sec = 0.0f;
-
- /* Allocate mixing buffer */
- this->hidden->mixlen = spec->size;
- this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
- if ( this->hidden->mixbuf == NULL ) {
- return(-1);
- }
- SDL_memset(this->hidden->mixbuf, spec->silence, spec->size);
-
- bytes_per_sec = (float) (((spec->format & 0xFF) / 8) *
- spec->channels * spec->freq);
-
- /*
- * We try to make this request more audio at the correct rate for
- * a given audio spec, so timing stays fairly faithful.
- * Also, we have it not block at all for the first two calls, so
- * it seems like we're filling two audio fragments right out of the
- * gate, like other SDL drivers tend to do.
- */
- this->hidden->initial_calls = 2;
- this->hidden->write_delay =
- (Uint32) ((((float) spec->size) / bytes_per_sec) * 1000.0f);
-
- /* We're ready to rock and roll. :-) */
- return(0);
-}
-
diff --git a/distrib/sdl-1.2.12/src/audio/dummy/SDL_dummyaudio.h b/distrib/sdl-1.2.12/src/audio/dummy/SDL_dummyaudio.h
deleted file mode 100644
index ff16cc7..0000000
--- a/distrib/sdl-1.2.12/src/audio/dummy/SDL_dummyaudio.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_dummyaudio_h
-#define _SDL_dummyaudio_h
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData {
- /* The file descriptor for the audio device */
- Uint8 *mixbuf;
- Uint32 mixlen;
- Uint32 write_delay;
- Uint32 initial_calls;
-};
-
-#endif /* _SDL_dummyaudio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/esd/SDL_esdaudio.c b/distrib/sdl-1.2.12/src/audio/esd/SDL_esdaudio.c
deleted file mode 100644
index d35e89a..0000000
--- a/distrib/sdl-1.2.12/src/audio/esd/SDL_esdaudio.c
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Allow access to an ESD network stream mixing buffer */
-
-#include <sys/types.h>
-#include <unistd.h>
-#include <signal.h>
-#include <errno.h>
-#include <esd.h>
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_audiodev_c.h"
-#include "SDL_esdaudio.h"
-
-#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC
-#include "SDL_name.h"
-#include "SDL_loadso.h"
-#else
-#define SDL_NAME(X) X
-#endif
-
-/* The tag name used by ESD audio */
-#define ESD_DRIVER_NAME "esd"
-
-/* Audio driver functions */
-static int ESD_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void ESD_WaitAudio(_THIS);
-static void ESD_PlayAudio(_THIS);
-static Uint8 *ESD_GetAudioBuf(_THIS);
-static void ESD_CloseAudio(_THIS);
-
-#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC
-
-static const char *esd_library = SDL_AUDIO_DRIVER_ESD_DYNAMIC;
-static void *esd_handle = NULL;
-static int esd_loaded = 0;
-
-static int (*SDL_NAME(esd_open_sound))( const char *host );
-static int (*SDL_NAME(esd_close))( int esd );
-static int (*SDL_NAME(esd_play_stream))( esd_format_t format, int rate,
- const char *host, const char *name );
-static struct {
- const char *name;
- void **func;
-} esd_functions[] = {
- { "esd_open_sound", (void **)&SDL_NAME(esd_open_sound) },
- { "esd_close", (void **)&SDL_NAME(esd_close) },
- { "esd_play_stream", (void **)&SDL_NAME(esd_play_stream) },
-};
-
-static void UnloadESDLibrary()
-{
- if ( esd_loaded ) {
- SDL_UnloadObject(esd_handle);
- esd_handle = NULL;
- esd_loaded = 0;
- }
-}
-
-static int LoadESDLibrary(void)
-{
- int i, retval = -1;
-
- esd_handle = SDL_LoadObject(esd_library);
- if ( esd_handle ) {
- esd_loaded = 1;
- retval = 0;
- for ( i=0; i<SDL_arraysize(esd_functions); ++i ) {
- *esd_functions[i].func = SDL_LoadFunction(esd_handle, esd_functions[i].name);
- if ( !*esd_functions[i].func ) {
- retval = -1;
- UnloadESDLibrary();
- break;
- }
- }
- }
- return retval;
-}
-
-#else
-
-static void UnloadESDLibrary()
-{
- return;
-}
-
-static int LoadESDLibrary(void)
-{
- return 0;
-}
-
-#endif /* SDL_AUDIO_DRIVER_ESD_DYNAMIC */
-
-/* Audio driver bootstrap functions */
-
-static int Audio_Available(void)
-{
- int connection;
- int available;
-
- available = 0;
- if ( LoadESDLibrary() < 0 ) {
- return available;
- }
- connection = SDL_NAME(esd_open_sound)(NULL);
- if ( connection >= 0 ) {
- available = 1;
- SDL_NAME(esd_close)(connection);
- }
- UnloadESDLibrary();
- return(available);
-}
-
-static void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
- UnloadESDLibrary();
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- LoadESDLibrary();
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
- audio_fd = -1;
-
- /* Set the function pointers */
- this->OpenAudio = ESD_OpenAudio;
- this->WaitAudio = ESD_WaitAudio;
- this->PlayAudio = ESD_PlayAudio;
- this->GetAudioBuf = ESD_GetAudioBuf;
- this->CloseAudio = ESD_CloseAudio;
-
- this->free = Audio_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap ESD_bootstrap = {
- ESD_DRIVER_NAME, "Enlightened Sound Daemon",
- Audio_Available, Audio_CreateDevice
-};
-
-/* This function waits until it is possible to write a full sound buffer */
-static void ESD_WaitAudio(_THIS)
-{
- Sint32 ticks;
-
- /* Check to see if the thread-parent process is still alive */
- { static int cnt = 0;
- /* Note that this only works with thread implementations
- that use a different process id for each thread.
- */
- if (parent && (((++cnt)%10) == 0)) { /* Check every 10 loops */
- if ( kill(parent, 0) < 0 ) {
- this->enabled = 0;
- }
- }
- }
-
- /* Use timer for general audio synchronization */
- ticks = ((Sint32)(next_frame - SDL_GetTicks()))-FUDGE_TICKS;
- if ( ticks > 0 ) {
- SDL_Delay(ticks);
- }
-}
-
-static void ESD_PlayAudio(_THIS)
-{
- int written;
-
- /* Write the audio data, checking for EAGAIN on broken audio drivers */
- do {
- written = write(audio_fd, mixbuf, mixlen);
- if ( (written < 0) && ((errno == 0) || (errno == EAGAIN)) ) {
- SDL_Delay(1); /* Let a little CPU time go by */
- }
- } while ( (written < 0) &&
- ((errno == 0) || (errno == EAGAIN) || (errno == EINTR)) );
-
- /* Set the next write frame */
- next_frame += frame_ticks;
-
- /* If we couldn't write, assume fatal error for now */
- if ( written < 0 ) {
- this->enabled = 0;
- }
-}
-
-static Uint8 *ESD_GetAudioBuf(_THIS)
-{
- return(mixbuf);
-}
-
-static void ESD_CloseAudio(_THIS)
-{
- if ( mixbuf != NULL ) {
- SDL_FreeAudioMem(mixbuf);
- mixbuf = NULL;
- }
- if ( audio_fd >= 0 ) {
- SDL_NAME(esd_close)(audio_fd);
- audio_fd = -1;
- }
-}
-
-/* Try to get the name of the program */
-static char *get_progname(void)
-{
- char *progname = NULL;
-#ifdef __LINUX__
- FILE *fp;
- static char temp[BUFSIZ];
-
- SDL_snprintf(temp, SDL_arraysize(temp), "/proc/%d/cmdline", getpid());
- fp = fopen(temp, "r");
- if ( fp != NULL ) {
- if ( fgets(temp, sizeof(temp)-1, fp) ) {
- progname = SDL_strrchr(temp, '/');
- if ( progname == NULL ) {
- progname = temp;
- } else {
- progname = progname+1;
- }
- }
- fclose(fp);
- }
-#endif
- return(progname);
-}
-
-static int ESD_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- esd_format_t format;
-
- /* Convert audio spec to the ESD audio format */
- format = (ESD_STREAM | ESD_PLAY);
- switch ( spec->format & 0xFF ) {
- case 8:
- format |= ESD_BITS8;
- break;
- case 16:
- format |= ESD_BITS16;
- break;
- default:
- SDL_SetError("Unsupported ESD audio format");
- return(-1);
- }
- if ( spec->channels == 1 ) {
- format |= ESD_MONO;
- } else {
- format |= ESD_STEREO;
- }
-#if 0
- spec->samples = ESD_BUF_SIZE; /* Darn, no way to change this yet */
-#endif
-
- /* Open a connection to the ESD audio server */
- audio_fd = SDL_NAME(esd_play_stream)(format, spec->freq, NULL, get_progname());
- if ( audio_fd < 0 ) {
- SDL_SetError("Couldn't open ESD connection");
- return(-1);
- }
-
- /* Calculate the final parameters for this audio specification */
- SDL_CalculateAudioSpec(spec);
- frame_ticks = (float)(spec->samples*1000)/spec->freq;
- next_frame = SDL_GetTicks()+frame_ticks;
-
- /* Allocate mixing buffer */
- mixlen = spec->size;
- mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen);
- if ( mixbuf == NULL ) {
- return(-1);
- }
- SDL_memset(mixbuf, spec->silence, spec->size);
-
- /* Get the parent process id (we're the parent of the audio thread) */
- parent = getpid();
-
- /* We're ready to rock and roll. :-) */
- return(0);
-}
diff --git a/distrib/sdl-1.2.12/src/audio/esd/SDL_esdaudio.h b/distrib/sdl-1.2.12/src/audio/esd/SDL_esdaudio.h
deleted file mode 100644
index cffb276..0000000
--- a/distrib/sdl-1.2.12/src/audio/esd/SDL_esdaudio.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_esdaudio_h
-#define _SDL_esdaudio_h
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData {
- /* The file descriptor for the audio device */
- int audio_fd;
-
- /* The parent process id, to detect when application quits */
- pid_t parent;
-
- /* Raw mixing buffer */
- Uint8 *mixbuf;
- int mixlen;
-
- /* Support for audio timing using a timer */
- float frame_ticks;
- float next_frame;
-};
-#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */
-
-/* Old variable names */
-#define audio_fd (this->hidden->audio_fd)
-#define parent (this->hidden->parent)
-#define mixbuf (this->hidden->mixbuf)
-#define mixlen (this->hidden->mixlen)
-#define frame_ticks (this->hidden->frame_ticks)
-#define next_frame (this->hidden->next_frame)
-
-#endif /* _SDL_esdaudio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/macosx/SDL_coreaudio.c b/distrib/sdl-1.2.12/src/audio/macosx/SDL_coreaudio.c
deleted file mode 100644
index 2cae958..0000000
--- a/distrib/sdl-1.2.12/src/audio/macosx/SDL_coreaudio.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <AudioUnit/AudioUnit.h>
-
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_sysaudio.h"
-#include "SDL_coreaudio.h"
-
-
-/* Audio driver functions */
-
-static int Core_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void Core_WaitAudio(_THIS);
-static void Core_PlayAudio(_THIS);
-static Uint8 *Core_GetAudioBuf(_THIS);
-static void Core_CloseAudio(_THIS);
-
-/* Audio driver bootstrap functions */
-
-static int Audio_Available(void)
-{
- return(1);
-}
-
-static void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
- /* Set the function pointers */
- this->OpenAudio = Core_OpenAudio;
- this->WaitAudio = Core_WaitAudio;
- this->PlayAudio = Core_PlayAudio;
- this->GetAudioBuf = Core_GetAudioBuf;
- this->CloseAudio = Core_CloseAudio;
-
- this->free = Audio_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap COREAUDIO_bootstrap = {
- "coreaudio", "Mac OS X CoreAudio",
- Audio_Available, Audio_CreateDevice
-};
-
-/* The CoreAudio callback */
-static OSStatus audioCallback (void *inRefCon,
- AudioUnitRenderActionFlags inActionFlags,
- const AudioTimeStamp *inTimeStamp,
- UInt32 inBusNumber,
- AudioBuffer *ioData)
-{
- SDL_AudioDevice *this = (SDL_AudioDevice *)inRefCon;
- UInt32 remaining, len;
- void *ptr;
-
- /* Only do anything if audio is enabled and not paused */
- if ( ! this->enabled || this->paused ) {
- SDL_memset(ioData->mData, this->spec.silence, ioData->mDataByteSize);
- return 0;
- }
-
- /* No SDL conversion should be needed here, ever, since we accept
- any input format in OpenAudio, and leave the conversion to CoreAudio.
- */
- /*
- assert(!this->convert.needed);
- assert(this->spec.channels == ioData->mNumberChannels);
- */
-
- remaining = ioData->mDataByteSize;
- ptr = ioData->mData;
- while (remaining > 0) {
- if (bufferOffset >= bufferSize) {
- /* Generate the data */
- SDL_memset(buffer, this->spec.silence, bufferSize);
- SDL_mutexP(this->mixer_lock);
- (*this->spec.callback)(this->spec.userdata,
- buffer, bufferSize);
- SDL_mutexV(this->mixer_lock);
- bufferOffset = 0;
- }
-
- len = bufferSize - bufferOffset;
- if (len > remaining)
- len = remaining;
- SDL_memcpy(ptr, (char *)buffer + bufferOffset, len);
- ptr = (char *)ptr + len;
- remaining -= len;
- bufferOffset += len;
- }
-
- return 0;
-}
-
-/* Dummy functions -- we don't use thread-based audio */
-void Core_WaitAudio(_THIS)
-{
- return;
-}
-
-void Core_PlayAudio(_THIS)
-{
- return;
-}
-
-Uint8 *Core_GetAudioBuf(_THIS)
-{
- return(NULL);
-}
-
-void Core_CloseAudio(_THIS)
-{
- OSStatus result;
- struct AudioUnitInputCallback callback;
-
- /* stop processing the audio unit */
- result = AudioOutputUnitStop (outputAudioUnit);
- if (result != noErr) {
- SDL_SetError("Core_CloseAudio: AudioOutputUnitStop");
- return;
- }
-
- /* Remove the input callback */
- callback.inputProc = 0;
- callback.inputProcRefCon = 0;
- result = AudioUnitSetProperty (outputAudioUnit,
- kAudioUnitProperty_SetInputCallback,
- kAudioUnitScope_Input,
- 0,
- &callback,
- sizeof(callback));
- if (result != noErr) {
- SDL_SetError("Core_CloseAudio: AudioUnitSetProperty (kAudioUnitProperty_SetInputCallback)");
- return;
- }
-
- result = CloseComponent(outputAudioUnit);
- if (result != noErr) {
- SDL_SetError("Core_CloseAudio: CloseComponent");
- return;
- }
-
- SDL_free(buffer);
-}
-
-#define CHECK_RESULT(msg) \
- if (result != noErr) { \
- SDL_SetError("Failed to start CoreAudio: " msg); \
- return -1; \
- }
-
-
-int Core_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- OSStatus result = noErr;
- Component comp;
- ComponentDescription desc;
- struct AudioUnitInputCallback callback;
- AudioStreamBasicDescription requestedDesc;
-
- /* Setup a AudioStreamBasicDescription with the requested format */
- requestedDesc.mFormatID = kAudioFormatLinearPCM;
- requestedDesc.mFormatFlags = kLinearPCMFormatFlagIsPacked;
- requestedDesc.mChannelsPerFrame = spec->channels;
- requestedDesc.mSampleRate = spec->freq;
-
- requestedDesc.mBitsPerChannel = spec->format & 0xFF;
- if (spec->format & 0x8000)
- requestedDesc.mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger;
- if (spec->format & 0x1000)
- requestedDesc.mFormatFlags |= kLinearPCMFormatFlagIsBigEndian;
-
- requestedDesc.mFramesPerPacket = 1;
- requestedDesc.mBytesPerFrame = requestedDesc.mBitsPerChannel * requestedDesc.mChannelsPerFrame / 8;
- requestedDesc.mBytesPerPacket = requestedDesc.mBytesPerFrame * requestedDesc.mFramesPerPacket;
-
-
- /* Locate the default output audio unit */
- desc.componentType = kAudioUnitComponentType;
- desc.componentSubType = kAudioUnitSubType_Output;
- desc.componentManufacturer = kAudioUnitID_DefaultOutput;
- desc.componentFlags = 0;
- desc.componentFlagsMask = 0;
-
- comp = FindNextComponent (NULL, &desc);
- if (comp == NULL) {
- SDL_SetError ("Failed to start CoreAudio: FindNextComponent returned NULL");
- return -1;
- }
-
- /* Open & initialize the default output audio unit */
- result = OpenAComponent (comp, &outputAudioUnit);
- CHECK_RESULT("OpenAComponent")
-
- result = AudioUnitInitialize (outputAudioUnit);
- CHECK_RESULT("AudioUnitInitialize")
-
- /* Set the input format of the audio unit. */
- result = AudioUnitSetProperty (outputAudioUnit,
- kAudioUnitProperty_StreamFormat,
- kAudioUnitScope_Input,
- 0,
- &requestedDesc,
- sizeof (requestedDesc));
- CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_StreamFormat)")
-
- /* Set the audio callback */
- callback.inputProc = audioCallback;
- callback.inputProcRefCon = this;
- result = AudioUnitSetProperty (outputAudioUnit,
- kAudioUnitProperty_SetInputCallback,
- kAudioUnitScope_Input,
- 0,
- &callback,
- sizeof(callback));
- CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_SetInputCallback)")
-
- /* Calculate the final parameters for this audio specification */
- SDL_CalculateAudioSpec(spec);
-
- /* Allocate a sample buffer */
- bufferOffset = bufferSize = this->spec.size;
- buffer = SDL_malloc(bufferSize);
-
- /* Finally, start processing of the audio unit */
- result = AudioOutputUnitStart (outputAudioUnit);
- CHECK_RESULT("AudioOutputUnitStart")
-
-
- /* We're running! */
- return(1);
-}
diff --git a/distrib/sdl-1.2.12/src/audio/macosx/SDL_coreaudio.h b/distrib/sdl-1.2.12/src/audio/macosx/SDL_coreaudio.h
deleted file mode 100644
index de2490c..0000000
--- a/distrib/sdl-1.2.12/src/audio/macosx/SDL_coreaudio.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_coreaudio_h
-#define _SDL_coreaudio_h
-
-#include "../SDL_sysaudio.h"
-#include <AudioUnit/AUNTComponent.h>
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData {
- AudioUnit outputAudioUnit;
- void *buffer;
- UInt32 bufferOffset;
- UInt32 bufferSize;
-};
-
-/* Old variable names */
-#define outputAudioUnit (this->hidden->outputAudioUnit)
-#define buffer (this->hidden->buffer)
-#define bufferOffset (this->hidden->bufferOffset)
-#define bufferSize (this->hidden->bufferSize)
-
-#endif /* _SDL_coreaudio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/macrom/SDL_romaudio.c b/distrib/sdl-1.2.12/src/audio/macrom/SDL_romaudio.c
deleted file mode 100644
index 140c033..0000000
--- a/distrib/sdl-1.2.12/src/audio/macrom/SDL_romaudio.c
+++ /dev/null
@@ -1,496 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#if defined(__APPLE__) && defined(__MACH__)
-# include <Carbon/Carbon.h>
-#elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335)
-# include <Carbon.h>
-#else
-# include <Sound.h> /* SoundManager interface */
-# include <Gestalt.h>
-# include <DriverServices.h>
-#endif
-
-#if !defined(NewSndCallBackUPP) && (UNIVERSAL_INTERFACES_VERSION < 0x0335)
-#if !defined(NewSndCallBackProc) /* avoid circular redefinition... */
-#define NewSndCallBackUPP NewSndCallBackProc
-#endif
-#if !defined(NewSndCallBackUPP)
-#define NewSndCallBackUPP NewSndCallBackProc
-#endif
-#endif
-
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_sysaudio.h"
-#include "SDL_romaudio.h"
-
-/* Audio driver functions */
-
-static void Mac_CloseAudio(_THIS);
-static int Mac_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void Mac_LockAudio(_THIS);
-static void Mac_UnlockAudio(_THIS);
-
-/* Audio driver bootstrap functions */
-
-
-static int Audio_Available(void)
-{
- return(1);
-}
-
-static void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
- /* Set the function pointers */
- this->OpenAudio = Mac_OpenAudio;
- this->CloseAudio = Mac_CloseAudio;
- this->LockAudio = Mac_LockAudio;
- this->UnlockAudio = Mac_UnlockAudio;
- this->free = Audio_DeleteDevice;
-
-#ifdef __MACOSX__ /* Mac OS X uses threaded audio, so normal thread code is okay */
- this->LockAudio = NULL;
- this->UnlockAudio = NULL;
-#endif
- return this;
-}
-
-AudioBootStrap SNDMGR_bootstrap = {
- "sndmgr", "MacOS SoundManager 3.0",
- Audio_Available, Audio_CreateDevice
-};
-
-#if defined(TARGET_API_MAC_CARBON) || defined(USE_RYANS_SOUNDCODE)
-/* This works correctly on Mac OS X */
-
-#pragma options align=power
-
-static volatile SInt32 audio_is_locked = 0;
-static volatile SInt32 need_to_mix = 0;
-
-static UInt8 *buffer[2];
-static volatile UInt32 running = 0;
-static CmpSoundHeader header;
-static volatile Uint32 fill_me = 0;
-
-static void mix_buffer(SDL_AudioDevice *audio, UInt8 *buffer)
-{
- if ( ! audio->paused ) {
-#ifdef __MACOSX__
- SDL_mutexP(audio->mixer_lock);
-#endif
- if ( audio->convert.needed ) {
- audio->spec.callback(audio->spec.userdata,
- (Uint8 *)audio->convert.buf,audio->convert.len);
- SDL_ConvertAudio(&audio->convert);
- if ( audio->convert.len_cvt != audio->spec.size ) {
- /* Uh oh... probably crashes here */;
- }
- SDL_memcpy(buffer, audio->convert.buf, audio->convert.len_cvt);
- } else {
- audio->spec.callback(audio->spec.userdata, buffer, audio->spec.size);
- }
-#ifdef __MACOSX__
- SDL_mutexV(audio->mixer_lock);
-#endif
- }
-
- DecrementAtomic((SInt32 *) &need_to_mix);
-}
-
-static void Mac_LockAudio(_THIS)
-{
- IncrementAtomic((SInt32 *) &audio_is_locked);
-}
-
-static void Mac_UnlockAudio(_THIS)
-{
- SInt32 oldval;
-
- oldval = DecrementAtomic((SInt32 *) &audio_is_locked);
- if ( oldval != 1 ) /* != 1 means audio is still locked. */
- return;
-
- /* Did we miss the chance to mix in an interrupt? Do it now. */
- if ( BitAndAtomic (0xFFFFFFFF, (UInt32 *) &need_to_mix) ) {
- /*
- * Note that this could be a problem if you missed an interrupt
- * while the audio was locked, and get preempted by a second
- * interrupt here, but that means you locked for way too long anyhow.
- */
- mix_buffer (this, buffer[fill_me]);
- }
-}
-
-static void callBackProc (SndChannel *chan, SndCommand *cmd_passed ) {
- UInt32 play_me;
- SndCommand cmd;
- SDL_AudioDevice *audio = (SDL_AudioDevice *)chan->userInfo;
-
- IncrementAtomic((SInt32 *) &need_to_mix);
-
- fill_me = cmd_passed->param2; /* buffer that has just finished playing, so fill it */
- play_me = ! fill_me; /* filled buffer to play _now_ */
-
- if ( ! audio->enabled ) {
- return;
- }
-
- /* queue previously mixed buffer for playback. */
- header.samplePtr = (Ptr)buffer[play_me];
- cmd.cmd = bufferCmd;
- cmd.param1 = 0;
- cmd.param2 = (long)&header;
- SndDoCommand (chan, &cmd, 0);
-
- memset (buffer[fill_me], 0, audio->spec.size);
-
- /*
- * if audio device isn't locked, mix the next buffer to be queued in
- * the memory block that just finished playing.
- */
- if ( ! BitAndAtomic(0xFFFFFFFF, (UInt32 *) &audio_is_locked) ) {
- mix_buffer (audio, buffer[fill_me]);
- }
-
- /* set this callback to run again when current buffer drains. */
- if ( running ) {
- cmd.cmd = callBackCmd;
- cmd.param1 = 0;
- cmd.param2 = play_me;
-
- SndDoCommand (chan, &cmd, 0);
- }
-}
-
-static int Mac_OpenAudio(_THIS, SDL_AudioSpec *spec) {
-
- SndCallBackUPP callback;
- int sample_bits;
- int i;
- long initOptions;
-
- /* Very few conversions are required, but... */
- switch (spec->format) {
- case AUDIO_S8:
- spec->format = AUDIO_U8;
- break;
- case AUDIO_U16LSB:
- spec->format = AUDIO_S16LSB;
- break;
- case AUDIO_U16MSB:
- spec->format = AUDIO_S16MSB;
- break;
- }
- SDL_CalculateAudioSpec(spec);
-
- /* initialize bufferCmd header */
- memset (&header, 0, sizeof(header));
- callback = (SndCallBackUPP) NewSndCallBackUPP (callBackProc);
- sample_bits = spec->size / spec->samples / spec->channels * 8;
-
-#ifdef DEBUG_AUDIO
- fprintf(stderr,
- "Audio format 0x%x, channels = %d, sample_bits = %d, frequency = %d\n",
- spec->format, spec->channels, sample_bits, spec->freq);
-#endif /* DEBUG_AUDIO */
-
- header.numChannels = spec->channels;
- header.sampleSize = sample_bits;
- header.sampleRate = spec->freq << 16;
- header.numFrames = spec->samples;
- header.encode = cmpSH;
-
- /* Note that we install the 16bitLittleEndian Converter if needed. */
- if ( spec->format == 0x8010 ) {
- header.compressionID = fixedCompression;
- header.format = k16BitLittleEndianFormat;
- }
-
- /* allocate 2 buffers */
- for (i=0; i<2; i++) {
- buffer[i] = (UInt8*)malloc (sizeof(UInt8) * spec->size);
- if (buffer[i] == NULL) {
- SDL_OutOfMemory();
- return (-1);
- }
- memset (buffer[i], 0, spec->size);
- }
-
- /* Create the sound manager channel */
- channel = (SndChannelPtr)SDL_malloc(sizeof(*channel));
- if ( channel == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
- if ( spec->channels >= 2 ) {
- initOptions = initStereo;
- } else {
- initOptions = initMono;
- }
- channel->userInfo = (long)this;
- channel->qLength = 128;
- if ( SndNewChannel(&channel, sampledSynth, initOptions, callback) != noErr ) {
- SDL_SetError("Unable to create audio channel");
- SDL_free(channel);
- channel = NULL;
- return(-1);
- }
-
- /* start playback */
- {
- SndCommand cmd;
- cmd.cmd = callBackCmd;
- cmd.param2 = 0;
- running = 1;
- SndDoCommand (channel, &cmd, 0);
- }
-
- return 1;
-}
-
-static void Mac_CloseAudio(_THIS) {
-
- int i;
-
- running = 0;
-
- if (channel) {
- SndDisposeChannel (channel, true);
- channel = NULL;
- }
-
- for ( i=0; i<2; ++i ) {
- if ( buffer[i] ) {
- SDL_free(buffer[i]);
- buffer[i] = NULL;
- }
- }
-}
-
-#else /* !TARGET_API_MAC_CARBON && !USE_RYANS_SOUNDCODE */
-
-static void Mac_LockAudio(_THIS)
-{
- /* no-op. */
-}
-
-static void Mac_UnlockAudio(_THIS)
-{
- /* no-op. */
-}
-
-
-/* This function is called by Sound Manager when it has exhausted one of
- the buffers, so we'll zero it to silence and fill it with audio if
- we're not paused.
-*/
-static pascal
-void sndDoubleBackProc (SndChannelPtr chan, SndDoubleBufferPtr newbuf)
-{
- SDL_AudioDevice *audio = (SDL_AudioDevice *)newbuf->dbUserInfo[0];
-
- /* If audio is quitting, don't do anything */
- if ( ! audio->enabled ) {
- return;
- }
- memset (newbuf->dbSoundData, 0, audio->spec.size);
- newbuf->dbNumFrames = audio->spec.samples;
- if ( ! audio->paused ) {
- if ( audio->convert.needed ) {
- audio->spec.callback(audio->spec.userdata,
- (Uint8 *)audio->convert.buf,audio->convert.len);
- SDL_ConvertAudio(&audio->convert);
-#if 0
- if ( audio->convert.len_cvt != audio->spec.size ) {
- /* Uh oh... probably crashes here */;
- }
-#endif
- SDL_memcpy(newbuf->dbSoundData, audio->convert.buf,
- audio->convert.len_cvt);
- } else {
- audio->spec.callback(audio->spec.userdata,
- (Uint8 *)newbuf->dbSoundData, audio->spec.size);
- }
- }
- newbuf->dbFlags |= dbBufferReady;
-}
-
-static int DoubleBufferAudio_Available(void)
-{
- int available;
- NumVersion sndversion;
- long response;
-
- available = 0;
- sndversion = SndSoundManagerVersion();
- if ( sndversion.majorRev >= 3 ) {
- if ( Gestalt(gestaltSoundAttr, &response) == noErr ) {
- if ( (response & (1 << gestaltSndPlayDoubleBuffer)) ) {
- available = 1;
- }
- }
- } else {
- if ( Gestalt(gestaltSoundAttr, &response) == noErr ) {
- if ( (response & (1 << gestaltHasASC)) ) {
- available = 1;
- }
- }
- }
- return(available);
-}
-
-static void Mac_CloseAudio(_THIS)
-{
- int i;
-
- if ( channel != NULL ) {
- /* Clean up the audio channel */
- SndDisposeChannel(channel, true);
- channel = NULL;
- }
- for ( i=0; i<2; ++i ) {
- if ( audio_buf[i] ) {
- SDL_free(audio_buf[i]);
- audio_buf[i] = NULL;
- }
- }
-}
-
-static int Mac_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- SndDoubleBufferHeader2 audio_dbh;
- int i;
- long initOptions;
- int sample_bits;
- SndDoubleBackUPP doubleBackProc;
-
- /* Check to make sure double-buffered audio is available */
- if ( ! DoubleBufferAudio_Available() ) {
- SDL_SetError("Sound manager doesn't support double-buffering");
- return(-1);
- }
-
- /* Very few conversions are required, but... */
- switch (spec->format) {
- case AUDIO_S8:
- spec->format = AUDIO_U8;
- break;
- case AUDIO_U16LSB:
- spec->format = AUDIO_S16LSB;
- break;
- case AUDIO_U16MSB:
- spec->format = AUDIO_S16MSB;
- break;
- }
- SDL_CalculateAudioSpec(spec);
-
- /* initialize the double-back header */
- SDL_memset(&audio_dbh, 0, sizeof(audio_dbh));
- doubleBackProc = NewSndDoubleBackProc (sndDoubleBackProc);
- sample_bits = spec->size / spec->samples / spec->channels * 8;
-
- audio_dbh.dbhNumChannels = spec->channels;
- audio_dbh.dbhSampleSize = sample_bits;
- audio_dbh.dbhCompressionID = 0;
- audio_dbh.dbhPacketSize = 0;
- audio_dbh.dbhSampleRate = spec->freq << 16;
- audio_dbh.dbhDoubleBack = doubleBackProc;
- audio_dbh.dbhFormat = 0;
-
- /* Note that we install the 16bitLittleEndian Converter if needed. */
- if ( spec->format == 0x8010 ) {
- audio_dbh.dbhCompressionID = fixedCompression;
- audio_dbh.dbhFormat = k16BitLittleEndianFormat;
- }
-
- /* allocate the 2 double-back buffers */
- for ( i=0; i<2; ++i ) {
- audio_buf[i] = SDL_calloc(1, sizeof(SndDoubleBuffer)+spec->size);
- if ( audio_buf[i] == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
- audio_buf[i]->dbNumFrames = spec->samples;
- audio_buf[i]->dbFlags = dbBufferReady;
- audio_buf[i]->dbUserInfo[0] = (long)this;
- audio_dbh.dbhBufferPtr[i] = audio_buf[i];
- }
-
- /* Create the sound manager channel */
- channel = (SndChannelPtr)SDL_malloc(sizeof(*channel));
- if ( channel == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
- if ( spec->channels >= 2 ) {
- initOptions = initStereo;
- } else {
- initOptions = initMono;
- }
- channel->userInfo = 0;
- channel->qLength = 128;
- if ( SndNewChannel(&channel, sampledSynth, initOptions, 0L) != noErr ) {
- SDL_SetError("Unable to create audio channel");
- SDL_free(channel);
- channel = NULL;
- return(-1);
- }
-
- /* Start playback */
- if ( SndPlayDoubleBuffer(channel, (SndDoubleBufferHeaderPtr)&audio_dbh)
- != noErr ) {
- SDL_SetError("Unable to play double buffered audio");
- return(-1);
- }
-
- return 1;
-}
-
-#endif /* TARGET_API_MAC_CARBON || USE_RYANS_SOUNDCODE */
-
diff --git a/distrib/sdl-1.2.12/src/audio/macrom/SDL_romaudio.h b/distrib/sdl-1.2.12/src/audio/macrom/SDL_romaudio.h
deleted file mode 100644
index be5dc69..0000000
--- a/distrib/sdl-1.2.12/src/audio/macrom/SDL_romaudio.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_romaudio_h
-#define _SDL_romaudio_h
-
-#include "../SDL_sysaudio.h"
-
-/* This is Ryan's improved MacOS sound code, with locking support */
-#define USE_RYANS_SOUNDCODE
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData {
- /* Sound manager audio channel */
- SndChannelPtr channel;
-#if defined(TARGET_API_MAC_CARBON) || defined(USE_RYANS_SOUNDCODE)
- /* FIXME: Add Ryan's static data here */
-#else
- /* Double buffering variables */
- SndDoubleBufferPtr audio_buf[2];
-#endif
-};
-
-/* Old variable names */
-#define channel (this->hidden->channel)
-#define audio_buf (this->hidden->audio_buf)
-
-#endif /* _SDL_romaudio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio.c b/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio.c
deleted file mode 100644
index afdec64..0000000
--- a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- Audio interrupt variables and callback function
-
- Patrice Mandin
-*/
-
-#include <unistd.h>
-
-#include <mint/osbind.h>
-#include <mint/falcon.h>
-#include <mint/mintbind.h>
-#include <mint/cookie.h>
-
-#include "SDL_audio.h"
-#include "SDL_mintaudio.h"
-#include "SDL_mintaudio_stfa.h"
-
-/* The audio device */
-
-SDL_AudioDevice *SDL_MintAudio_device;
-Uint8 *SDL_MintAudio_audiobuf[2]; /* Pointers to buffers */
-unsigned long SDL_MintAudio_audiosize; /* Length of audio buffer=spec->size */
-volatile unsigned short SDL_MintAudio_numbuf; /* Buffer to play */
-volatile unsigned short SDL_MintAudio_mutex;
-volatile unsigned long SDL_MintAudio_clocktics;
-cookie_stfa_t *SDL_MintAudio_stfa;
-unsigned short SDL_MintAudio_hasfpu;
-
-/* MiNT thread variables */
-SDL_bool SDL_MintAudio_mint_present;
-SDL_bool SDL_MintAudio_quit_thread;
-SDL_bool SDL_MintAudio_thread_finished;
-long SDL_MintAudio_thread_pid;
-
-/* The callback function, called by each driver whenever needed */
-
-void SDL_MintAudio_Callback(void)
-{
- Uint8 *buffer;
- SDL_AudioDevice *audio = SDL_MintAudio_device;
-
- buffer = SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf];
- SDL_memset(buffer, audio->spec.silence, audio->spec.size);
-
- if (audio->paused)
- return;
-
- if (audio->convert.needed) {
- int silence;
-
- if ( audio->convert.src_format == AUDIO_U8 ) {
- silence = 0x80;
- } else {
- silence = 0;
- }
- SDL_memset(audio->convert.buf, silence, audio->convert.len);
- audio->spec.callback(audio->spec.userdata,
- (Uint8 *)audio->convert.buf,audio->convert.len);
- SDL_ConvertAudio(&audio->convert);
- SDL_memcpy(buffer, audio->convert.buf, audio->convert.len_cvt);
- } else {
- audio->spec.callback(audio->spec.userdata, buffer, audio->spec.size);
- }
-}
-
-/* Add a new frequency/clock/predivisor to the current list */
-void SDL_MintAudio_AddFrequency(_THIS, Uint32 frequency, Uint32 clock,
- Uint32 prediv, int gpio_bits)
-{
- int i, p;
-
- if (MINTAUDIO_freqcount==MINTAUDIO_maxfreqs) {
- return;
- }
-
- /* Search where to insert the frequency (highest first) */
- for (p=0; p<MINTAUDIO_freqcount; p++) {
- if (frequency > MINTAUDIO_frequencies[p].frequency) {
- break;
- }
- }
-
- /* Put all following ones farer */
- if (MINTAUDIO_freqcount>0) {
- for (i=MINTAUDIO_freqcount; i>p; i--) {
- SDL_memcpy(&MINTAUDIO_frequencies[i], &MINTAUDIO_frequencies[i-1], sizeof(mint_frequency_t));
- }
- }
-
- /* And insert new one */
- MINTAUDIO_frequencies[p].frequency = frequency;
- MINTAUDIO_frequencies[p].masterclock = clock;
- MINTAUDIO_frequencies[p].predivisor = prediv;
- MINTAUDIO_frequencies[p].gpio_bits = gpio_bits;
-
- MINTAUDIO_freqcount++;
-}
-
-/* Search for the nearest frequency */
-int SDL_MintAudio_SearchFrequency(_THIS, int desired_freq)
-{
- int i;
-
- /* Only 1 freq ? */
- if (MINTAUDIO_freqcount==1) {
- return 0;
- }
-
- /* Check the array */
- for (i=0; i<MINTAUDIO_freqcount; i++) {
- if (desired_freq >= ((MINTAUDIO_frequencies[i].frequency+
- MINTAUDIO_frequencies[i+1].frequency)>>1)) {
- return i;
- }
- }
-
- /* Not in the array, give the latest */
- return MINTAUDIO_freqcount-1;
-}
-
-/* Check if FPU is present */
-void SDL_MintAudio_CheckFpu(void)
-{
- unsigned long cookie_fpu;
-
- SDL_MintAudio_hasfpu = 0;
- if (Getcookie(C__FPU, &cookie_fpu) != C_FOUND) {
- return;
- }
- switch ((cookie_fpu>>16)&0xfffe) {
- case 2:
- case 4:
- case 6:
- case 8:
- case 16:
- SDL_MintAudio_hasfpu = 1;
- break;
- }
-}
-
-/* The thread function, used under MiNT with xbios */
-int SDL_MintAudio_Thread(long param)
-{
- SndBufPtr pointers;
- SDL_bool buffers_filled[2] = {SDL_FALSE, SDL_FALSE};
-
- SDL_MintAudio_thread_finished = SDL_FALSE;
- while (!SDL_MintAudio_quit_thread) {
- if (Buffptr(&pointers)!=0)
- continue;
-
- if (( (unsigned long)pointers.play>=(unsigned long)SDL_MintAudio_audiobuf[0])
- && ( (unsigned long)pointers.play<=(unsigned long)SDL_MintAudio_audiobuf[1]))
- {
- /* DMA is reading buffer #0, setup buffer #1 if not already done */
- if (!buffers_filled[1]) {
- SDL_MintAudio_numbuf = 1;
- SDL_MintAudio_Callback();
- Setbuffer(0, SDL_MintAudio_audiobuf[1], SDL_MintAudio_audiobuf[1] + SDL_MintAudio_audiosize);
- buffers_filled[1]=SDL_TRUE;
- buffers_filled[0]=SDL_FALSE;
- }
- } else {
- /* DMA is reading buffer #1, setup buffer #0 if not already done */
- if (!buffers_filled[0]) {
- SDL_MintAudio_numbuf = 0;
- SDL_MintAudio_Callback();
- Setbuffer(0, SDL_MintAudio_audiobuf[0], SDL_MintAudio_audiobuf[0] + SDL_MintAudio_audiosize);
- buffers_filled[0]=SDL_TRUE;
- buffers_filled[1]=SDL_FALSE;
- }
- }
-
- usleep(100);
- }
- SDL_MintAudio_thread_finished = SDL_TRUE;
- return 0;
-}
-
-void SDL_MintAudio_WaitThread(void)
-{
- if (!SDL_MintAudio_mint_present)
- return;
-
- if (SDL_MintAudio_thread_finished)
- return;
-
- SDL_MintAudio_quit_thread = SDL_TRUE;
- while (!SDL_MintAudio_thread_finished) {
- Syield();
- }
-}
diff --git a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio.h b/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio.h
deleted file mode 100644
index 9a02580..0000000
--- a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- MiNT audio driver
-
- Patrice Mandin
-*/
-
-#ifndef _SDL_mintaudio_h
-#define _SDL_mintaudio_h
-
-#include "../SDL_sysaudio.h"
-#include "SDL_mintaudio_stfa.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS SDL_AudioDevice *this
-
-/* 16 predivisors with 3 clocks max. */
-#define MINTAUDIO_maxfreqs (16*3)
-
-typedef struct {
- Uint32 frequency;
- Uint32 masterclock;
- Uint32 predivisor;
- int gpio_bits; /* in case of external clock */
-} mint_frequency_t;
-
-struct SDL_PrivateAudioData {
- mint_frequency_t frequencies[MINTAUDIO_maxfreqs];
- int freq_count; /* Number of frequencies in the array */
- int numfreq; /* Number of selected frequency */
-};
-
-/* Old variable names */
-
-#define MINTAUDIO_frequencies (this->hidden->frequencies)
-#define MINTAUDIO_freqcount (this->hidden->freq_count)
-#define MINTAUDIO_numfreq (this->hidden->numfreq)
-
-/* _MCH cookie (values>>16) */
-enum {
- MCH_ST=0,
- MCH_STE,
- MCH_TT,
- MCH_F30,
- MCH_CLONE,
- MCH_ARANYM
-};
-
-/* Master clocks for replay frequencies */
-#define MASTERCLOCK_STE 8010666 /* Not sure of this one */
-#define MASTERCLOCK_TT 16107953 /* Not sure of this one */
-#define MASTERCLOCK_FALCON1 25175000
-#define MASTERCLOCK_FALCON2 32000000 /* Only usable for DSP56K */
-#define MASTERCLOCK_FALCONEXT -1 /* Clock on DSP56K port, unknown */
-#define MASTERCLOCK_44K 22579200 /* Standard clock for 44.1 Khz */
-#define MASTERCLOCK_48K 24576000 /* Standard clock for 48 Khz */
-
-/* Master clock predivisors */
-#define MASTERPREDIV_STE 160
-#define MASTERPREDIV_TT 320
-#define MASTERPREDIV_FALCON 256
-#define MASTERPREDIV_MILAN 256
-
-/* MFP 68901 interrupt sources */
-enum {
- MFP_PARALLEL=0,
- MFP_DCD,
- MFP_CTS,
- MFP_BITBLT,
- MFP_TIMERD,
- MFP_BAUDRATE=MFP_TIMERD,
- MFP_TIMERC,
- MFP_200HZ=MFP_TIMERC,
- MFP_ACIA,
- MFP_DISK,
- MFP_TIMERB,
- MFP_HBLANK=MFP_TIMERB,
- MFP_TERR,
- MFP_TBE,
- MFP_RERR,
- MFP_RBF,
- MFP_TIMERA,
- MFP_DMASOUND=MFP_TIMERA,
- MFP_RING,
- MFP_MONODETECT
-};
-
-/* Xbtimer() timers */
-enum {
- XB_TIMERA=0,
- XB_TIMERB,
- XB_TIMERC,
- XB_TIMERD
-};
-
-/* Variables */
-extern SDL_AudioDevice *SDL_MintAudio_device;
-extern Uint8 *SDL_MintAudio_audiobuf[2]; /* Pointers to buffers */
-extern unsigned long SDL_MintAudio_audiosize; /* Length of audio buffer=spec->size */
-extern volatile unsigned short SDL_MintAudio_numbuf; /* Buffer to play */
-extern volatile unsigned short SDL_MintAudio_mutex;
-extern cookie_stfa_t *SDL_MintAudio_stfa;
-extern volatile unsigned long SDL_MintAudio_clocktics;
-extern unsigned short SDL_MintAudio_hasfpu; /* To preserve fpu registers if needed */
-
-/* MiNT thread variables */
-extern SDL_bool SDL_MintAudio_mint_present;
-extern SDL_bool SDL_MintAudio_quit_thread;
-extern SDL_bool SDL_MintAudio_thread_finished;
-extern long SDL_MintAudio_thread_pid;
-
-/* Functions */
-void SDL_MintAudio_Callback(void);
-void SDL_MintAudio_AddFrequency(_THIS, Uint32 frequency, Uint32 clock,
- Uint32 prediv, int gpio_bits);
-int SDL_MintAudio_SearchFrequency(_THIS, int desired_freq);
-void SDL_MintAudio_CheckFpu(void);
-
-/* MiNT thread functions */
-int SDL_MintAudio_Thread(long param);
-void SDL_MintAudio_WaitThread(void);
-
-/* ASM interrupt functions */
-void SDL_MintAudio_GsxbInterrupt(void);
-void SDL_MintAudio_EmptyGsxbInterrupt(void);
-void SDL_MintAudio_XbiosInterruptMeasureClock(void);
-void SDL_MintAudio_XbiosInterrupt(void);
-void SDL_MintAudio_Dma8Interrupt(void);
-void SDL_MintAudio_StfaInterrupt(void);
-
-#endif /* _SDL_mintaudio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_dma8.c b/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_dma8.c
deleted file mode 100644
index d4c43cf..0000000
--- a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_dma8.c
+++ /dev/null
@@ -1,361 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- MiNT audio driver
- using DMA 8bits (hardware access)
-
- Patrice Mandin
-*/
-
-/* Mint includes */
-#include <mint/osbind.h>
-#include <mint/falcon.h>
-#include <mint/cookie.h>
-
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_sysaudio.h"
-
-#include "../../video/ataricommon/SDL_atarimxalloc_c.h"
-
-#include "SDL_mintaudio.h"
-#include "SDL_mintaudio_dma8.h"
-
-/*--- Defines ---*/
-
-#define MINT_AUDIO_DRIVER_NAME "mint_dma8"
-
-/* Debug print info */
-#define DEBUG_NAME "audio:dma8: "
-#if 0
-#define DEBUG_PRINT(what) \
- { \
- printf what; \
- }
-#else
-#define DEBUG_PRINT(what)
-#endif
-
-/*--- Static variables ---*/
-
-static unsigned long cookie_snd, cookie_mch;
-
-/*--- Audio driver functions ---*/
-
-static void Mint_CloseAudio(_THIS);
-static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void Mint_LockAudio(_THIS);
-static void Mint_UnlockAudio(_THIS);
-
-/* To check/init hardware audio */
-static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec);
-static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec);
-
-/*--- Audio driver bootstrap functions ---*/
-
-static int Audio_Available(void)
-{
- const char *envr = SDL_getenv("SDL_AUDIODRIVER");
-
- /* Check if user asked a different audio driver */
- if ((envr) && (SDL_strcmp(envr, MINT_AUDIO_DRIVER_NAME)!=0)) {
- DEBUG_PRINT((DEBUG_NAME "user asked a different audio driver\n"));
- return 0;
- }
-
- /* Cookie _MCH present ? if not, assume ST machine */
- if (Getcookie(C__MCH, &cookie_mch) == C_NOTFOUND) {
- cookie_mch = MCH_ST;
- }
-
- /* Cookie _SND present ? if not, assume ST machine */
- if (Getcookie(C__SND, &cookie_snd) == C_NOTFOUND) {
- cookie_snd = SND_PSG;
- }
-
- /* Check if we have 8 bits audio */
- if ((cookie_snd & SND_8BIT)==0) {
- DEBUG_PRINT((DEBUG_NAME "no 8 bits sound\n"));
- return(0);
- }
-
- /* Check if audio is lockable */
- if (cookie_snd & SND_16BIT) {
- if (Locksnd()!=1) {
- DEBUG_PRINT((DEBUG_NAME "audio locked by other application\n"));
- return(0);
- }
-
- Unlocksnd();
- }
-
- DEBUG_PRINT((DEBUG_NAME "8 bits audio available!\n"));
- return(1);
-}
-
-static void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
- /* Set the function pointers */
- this->OpenAudio = Mint_OpenAudio;
- this->CloseAudio = Mint_CloseAudio;
- this->LockAudio = Mint_LockAudio;
- this->UnlockAudio = Mint_UnlockAudio;
- this->free = Audio_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap MINTAUDIO_DMA8_bootstrap = {
- MINT_AUDIO_DRIVER_NAME, "MiNT DMA 8 bits audio driver",
- Audio_Available, Audio_CreateDevice
-};
-
-static void Mint_LockAudio(_THIS)
-{
- void *oldpile;
-
- /* Stop replay */
- oldpile=(void *)Super(0);
- DMAAUDIO_IO.control=0;
- Super(oldpile);
-}
-
-static void Mint_UnlockAudio(_THIS)
-{
- void *oldpile;
-
- /* Restart replay */
- oldpile=(void *)Super(0);
- DMAAUDIO_IO.control=3;
- Super(oldpile);
-}
-
-static void Mint_CloseAudio(_THIS)
-{
- void *oldpile;
-
- /* Stop replay */
- oldpile=(void *)Super(0);
- DMAAUDIO_IO.control=0;
- Super(oldpile);
-
- DEBUG_PRINT((DEBUG_NAME "closeaudio: replay stopped\n"));
-
- /* Disable interrupt */
- Jdisint(MFP_DMASOUND);
-
- DEBUG_PRINT((DEBUG_NAME "closeaudio: interrupt disabled\n"));
-
- /* Wait if currently playing sound */
- while (SDL_MintAudio_mutex != 0) {
- }
-
- DEBUG_PRINT((DEBUG_NAME "closeaudio: no more interrupt running\n"));
-
- /* Clear buffers */
- if (SDL_MintAudio_audiobuf[0]) {
- Mfree(SDL_MintAudio_audiobuf[0]);
- SDL_MintAudio_audiobuf[0] = SDL_MintAudio_audiobuf[1] = NULL;
- }
-
- DEBUG_PRINT((DEBUG_NAME "closeaudio: buffers freed\n"));
-}
-
-static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
-{
- int i, masterprediv, sfreq;
- unsigned long masterclock;
-
- DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff));
- DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
- DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
- DEBUG_PRINT(("channels=%d, ", spec->channels));
- DEBUG_PRINT(("freq=%d\n", spec->freq));
-
- if (spec->channels > 2)
- spec->channels = 2;
-
- /* Check formats available */
- spec->format = AUDIO_S8;
-
- /* Calculate and select the closest frequency */
- sfreq=0;
- masterclock=MASTERCLOCK_STE;
- masterprediv=MASTERPREDIV_STE;
- switch(cookie_mch>>16) {
-/*
- case MCH_STE:
- masterclock=MASTERCLOCK_STE;
- masterprediv=MASTERPREDIV_STE;
- break;
-*/
- case MCH_TT:
- masterclock=MASTERCLOCK_TT;
- masterprediv=MASTERPREDIV_TT;
- break;
- case MCH_F30:
- case MCH_ARANYM:
- masterclock=MASTERCLOCK_FALCON1;
- masterprediv=MASTERPREDIV_FALCON;
- sfreq=1;
- break;
- }
-
- MINTAUDIO_freqcount=0;
- for (i=sfreq;i<4;i++) {
- SDL_MintAudio_AddFrequency(this, masterclock/(masterprediv*(1<<i)),
- masterclock, i-sfreq, -1);
- }
-
-#if 1
- for (i=0; i<MINTAUDIO_freqcount; i++) {
- DEBUG_PRINT((DEBUG_NAME "freq %d: %lu Hz, clock %lu, prediv %d\n",
- i, MINTAUDIO_frequencies[i].frequency, MINTAUDIO_frequencies[i].masterclock,
- MINTAUDIO_frequencies[i].predivisor
- ));
- }
-#endif
-
- MINTAUDIO_numfreq=SDL_MintAudio_SearchFrequency(this, spec->freq);
- spec->freq=MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
-
- DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff));
- DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
- DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
- DEBUG_PRINT(("channels=%d, ", spec->channels));
- DEBUG_PRINT(("freq=%d\n", spec->freq));
-
- return 0;
-}
-
-static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec)
-{
- void *oldpile;
- unsigned long buffer;
- unsigned char mode;
-
- /* Set replay tracks */
- if (cookie_snd & SND_16BIT) {
- Settracks(0,0);
- Setmontracks(0);
- }
-
- oldpile=(void *)Super(0);
-
- /* Stop currently playing sound */
- DMAAUDIO_IO.control=0;
-
- /* Set buffer */
- buffer = (unsigned long) SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf];
- DMAAUDIO_IO.start_high = (buffer>>16) & 255;
- DMAAUDIO_IO.start_mid = (buffer>>8) & 255;
- DMAAUDIO_IO.start_low = buffer & 255;
-
- buffer += SDL_MintAudio_audiosize;
- DMAAUDIO_IO.end_high = (buffer>>16) & 255;
- DMAAUDIO_IO.end_mid = (buffer>>8) & 255;
- DMAAUDIO_IO.end_low = buffer & 255;
-
- mode = 3-MINTAUDIO_frequencies[MINTAUDIO_numfreq].predivisor;
- if (spec->channels==1) {
- mode |= 1<<7;
- }
- DMAAUDIO_IO.sound_ctrl = mode;
-
- /* Set interrupt */
- Jdisint(MFP_DMASOUND);
- Xbtimer(XB_TIMERA, 8, 1, SDL_MintAudio_Dma8Interrupt);
- Jenabint(MFP_DMASOUND);
-
- if (cookie_snd & SND_16BIT) {
- if (Setinterrupt(SI_TIMERA, SI_PLAY)<0) {
- DEBUG_PRINT((DEBUG_NAME "Setinterrupt() failed\n"));
- }
- }
-
- /* Go */
- DMAAUDIO_IO.control = 3; /* playback + repeat */
-
- Super(oldpile);
-}
-
-static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- SDL_MintAudio_device = this;
-
- /* Check audio capabilities */
- if (Mint_CheckAudio(this, spec)==-1) {
- return -1;
- }
-
- SDL_CalculateAudioSpec(spec);
-
- /* Allocate memory for audio buffers in DMA-able RAM */
- DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size));
-
- SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM);
- if (SDL_MintAudio_audiobuf[0]==NULL) {
- SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer");
- return (-1);
- }
- SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + spec->size ;
- SDL_MintAudio_numbuf=0;
- SDL_memset(SDL_MintAudio_audiobuf[0], spec->silence, spec->size *2);
- SDL_MintAudio_audiosize = spec->size;
- SDL_MintAudio_mutex = 0;
-
- DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n", SDL_MintAudio_audiobuf[0]));
- DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n", SDL_MintAudio_audiobuf[1]));
-
- SDL_MintAudio_CheckFpu();
-
- /* Setup audio hardware */
- Mint_InitAudio(this, spec);
-
- return(1); /* We don't use threaded audio */
-}
diff --git a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_dma8.h b/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_dma8.h
deleted file mode 100644
index 698fed4..0000000
--- a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_dma8.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- DMA 8bits and Falcon Codec audio definitions
-
- Patrice Mandin, Didier Méquignon
-*/
-
-#ifndef _SDL_mintaudio_dma8_h
-#define _SDL_mintaudio_dma8_h
-
-#define DMAAUDIO_IO_BASE (0xffff8900)
-struct DMAAUDIO_IO_S {
- unsigned char int_ctrl;
- unsigned char control;
-
- unsigned char dummy1;
- unsigned char start_high;
- unsigned char dummy2;
- unsigned char start_mid;
- unsigned char dummy3;
- unsigned char start_low;
-
- unsigned char dummy4;
- unsigned char cur_high;
- unsigned char dummy5;
- unsigned char cur_mid;
- unsigned char dummy6;
- unsigned char cur_low;
-
- unsigned char dummy7;
- unsigned char end_high;
- unsigned char dummy8;
- unsigned char end_mid;
- unsigned char dummy9;
- unsigned char end_low;
-
- unsigned char dummy10[12];
-
- unsigned char track_ctrl; /* CODEC only */
- unsigned char sound_ctrl;
- unsigned short sound_data;
- unsigned short sound_mask;
-
- unsigned char dummy11[10];
-
- unsigned short dev_ctrl;
- unsigned short dest_ctrl;
- unsigned short sync_div;
- unsigned char track_rec;
- unsigned char adderin_input;
- unsigned char channel_input;
- unsigned char channel_amplification;
- unsigned char channel_reduction;
-
- unsigned char dummy12[6];
-
- unsigned char data_direction;
- unsigned char dummy13;
- unsigned char dev_data;
-};
-#define DMAAUDIO_IO ((*(volatile struct DMAAUDIO_IO_S *)DMAAUDIO_IO_BASE))
-
-#endif /* _SDL_mintaudio_dma8_h */
diff --git a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_gsxb.c b/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_gsxb.c
deleted file mode 100644
index 41f78c9..0000000
--- a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_gsxb.c
+++ /dev/null
@@ -1,436 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- MiNT audio driver
- using XBIOS functions (GSXB compatible driver)
-
- Patrice Mandin
-*/
-
-/* Mint includes */
-#include <mint/osbind.h>
-#include <mint/falcon.h>
-#include <mint/cookie.h>
-
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_sysaudio.h"
-
-#include "../../video/ataricommon/SDL_atarimxalloc_c.h"
-
-#include "SDL_mintaudio.h"
-#include "SDL_mintaudio_gsxb.h"
-
-/*--- Defines ---*/
-
-#define MINT_AUDIO_DRIVER_NAME "mint_gsxb"
-
-/* Debug print info */
-#define DEBUG_NAME "audio:gsxb: "
-#if 0
-#define DEBUG_PRINT(what) \
- { \
- printf what; \
- }
-#else
-#define DEBUG_PRINT(what)
-#endif
-
-/*--- Static variables ---*/
-
-static unsigned long cookie_snd, cookie_gsxb;
-
-/*--- Audio driver functions ---*/
-
-static void Mint_CloseAudio(_THIS);
-static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void Mint_LockAudio(_THIS);
-static void Mint_UnlockAudio(_THIS);
-
-/* To check/init hardware audio */
-static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec);
-static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec);
-
-/* GSXB callbacks */
-static void Mint_GsxbInterrupt(void);
-static void Mint_GsxbNullInterrupt(void);
-
-/*--- Audio driver bootstrap functions ---*/
-
-static int Audio_Available(void)
-{
- const char *envr = SDL_getenv("SDL_AUDIODRIVER");
-
- /* Check if user asked a different audio driver */
- if ((envr) && (SDL_strcmp(envr, MINT_AUDIO_DRIVER_NAME)!=0)) {
- DEBUG_PRINT((DEBUG_NAME "user asked a different audio driver\n"));
- return(0);
- }
-
- /* Cookie _SND present ? if not, assume ST machine */
- if (Getcookie(C__SND, &cookie_snd) == C_NOTFOUND) {
- cookie_snd = SND_PSG;
- }
-
- /* Check if we have 16 bits audio */
- if ((cookie_snd & SND_16BIT)==0) {
- DEBUG_PRINT((DEBUG_NAME "no 16 bits sound\n"));
- return(0);
- }
-
- /* Cookie GSXB present ? */
- cookie_gsxb = (Getcookie(C_GSXB, &cookie_gsxb) == C_FOUND);
-
- /* Is it GSXB ? */
- if (((cookie_snd & SND_GSXB)==0) || (cookie_gsxb==0)) {
- DEBUG_PRINT((DEBUG_NAME "no GSXB audio\n"));
- return(0);
- }
-
- /* Check if audio is lockable */
- if (Locksnd()!=1) {
- DEBUG_PRINT((DEBUG_NAME "audio locked by other application\n"));
- return(0);
- }
-
- Unlocksnd();
-
- DEBUG_PRINT((DEBUG_NAME "GSXB audio available!\n"));
- return(1);
-}
-
-static void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
- /* Set the function pointers */
- this->OpenAudio = Mint_OpenAudio;
- this->CloseAudio = Mint_CloseAudio;
- this->LockAudio = Mint_LockAudio;
- this->UnlockAudio = Mint_UnlockAudio;
- this->free = Audio_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap MINTAUDIO_GSXB_bootstrap = {
- MINT_AUDIO_DRIVER_NAME, "MiNT GSXB audio driver",
- Audio_Available, Audio_CreateDevice
-};
-
-static void Mint_LockAudio(_THIS)
-{
- /* Stop replay */
- Buffoper(0);
-}
-
-static void Mint_UnlockAudio(_THIS)
-{
- /* Restart replay */
- Buffoper(SB_PLA_ENA|SB_PLA_RPT);
-}
-
-static void Mint_CloseAudio(_THIS)
-{
- /* Stop replay */
- Buffoper(0);
-
- /* Uninstall interrupt */
- if (NSetinterrupt(2, SI_NONE, Mint_GsxbNullInterrupt)<0) {
- DEBUG_PRINT((DEBUG_NAME "NSetinterrupt() failed in close\n"));
- }
-
- /* Wait if currently playing sound */
- while (SDL_MintAudio_mutex != 0) {
- }
-
- /* Clear buffers */
- if (SDL_MintAudio_audiobuf[0]) {
- Mfree(SDL_MintAudio_audiobuf[0]);
- SDL_MintAudio_audiobuf[0] = SDL_MintAudio_audiobuf[1] = NULL;
- }
-
- /* Unlock sound system */
- Unlocksnd();
-}
-
-static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
-{
- long snd_format;
- int i, resolution, format_signed, format_bigendian;
- Uint16 test_format = SDL_FirstAudioFormat(spec->format);
- int valid_datatype = 0;
-
- resolution = spec->format & 0x00ff;
- format_signed = ((spec->format & 0x8000)!=0);
- format_bigendian = ((spec->format & 0x1000)!=0);
-
- DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff));
- DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
- DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
- DEBUG_PRINT(("channels=%d, ", spec->channels));
- DEBUG_PRINT(("freq=%d\n", spec->freq));
-
- if (spec->channels > 2) {
- spec->channels = 2; /* no more than stereo! */
- }
-
- while ((!valid_datatype) && (test_format)) {
- /* Check formats available */
- snd_format = Sndstatus(SND_QUERYFORMATS);
- spec->format = test_format;
- resolution = spec->format & 0xff;
- format_signed = (spec->format & (1<<15));
- format_bigendian = (spec->format & (1<<12));
- switch (test_format) {
- case AUDIO_U8:
- case AUDIO_S8:
- if (snd_format & SND_FORMAT8) {
- valid_datatype = 1;
- snd_format = Sndstatus(SND_QUERY8BIT);
- }
- break;
-
- case AUDIO_U16LSB:
- case AUDIO_S16LSB:
- case AUDIO_U16MSB:
- case AUDIO_S16MSB:
- if (snd_format & SND_FORMAT16) {
- valid_datatype = 1;
- snd_format = Sndstatus(SND_QUERY16BIT);
- }
- break;
-
- default:
- test_format = SDL_NextAudioFormat();
- break;
- }
- }
-
- if (!valid_datatype) {
- SDL_SetError("Unsupported audio format");
- return (-1);
- }
-
- /* Check signed/unsigned format */
- if (format_signed) {
- if (snd_format & SND_FORMATSIGNED) {
- /* Ok */
- } else if (snd_format & SND_FORMATUNSIGNED) {
- /* Give unsigned format */
- spec->format = spec->format & (~0x8000);
- }
- } else {
- if (snd_format & SND_FORMATUNSIGNED) {
- /* Ok */
- } else if (snd_format & SND_FORMATSIGNED) {
- /* Give signed format */
- spec->format |= 0x8000;
- }
- }
-
- if (format_bigendian) {
- if (snd_format & SND_FORMATBIGENDIAN) {
- /* Ok */
- } else if (snd_format & SND_FORMATLITTLEENDIAN) {
- /* Give little endian format */
- spec->format = spec->format & (~0x1000);
- }
- } else {
- if (snd_format & SND_FORMATLITTLEENDIAN) {
- /* Ok */
- } else if (snd_format & SND_FORMATBIGENDIAN) {
- /* Give big endian format */
- spec->format |= 0x1000;
- }
- }
-
- /* Calculate and select the closest frequency */
- MINTAUDIO_freqcount=0;
- for (i=1;i<4;i++) {
- SDL_MintAudio_AddFrequency(this,
- MASTERCLOCK_44K/(MASTERPREDIV_MILAN*(1<<i)), MASTERCLOCK_44K,
- (1<<i)-1, -1);
- }
-
-#if 1
- for (i=0; i<MINTAUDIO_freqcount; i++) {
- DEBUG_PRINT((DEBUG_NAME "freq %d: %lu Hz, clock %lu, prediv %d\n",
- i, MINTAUDIO_frequencies[i].frequency, MINTAUDIO_frequencies[i].masterclock,
- MINTAUDIO_frequencies[i].predivisor
- ));
- }
-#endif
-
- MINTAUDIO_numfreq=SDL_MintAudio_SearchFrequency(this, spec->freq);
- spec->freq=MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
-
- DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff));
- DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
- DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
- DEBUG_PRINT(("channels=%d, ", spec->channels));
- DEBUG_PRINT(("freq=%d\n", spec->freq));
-
- return 0;
-}
-
-static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec)
-{
- int channels_mode, prediv;
- void *buffer;
-
- /* Stop currently playing sound */
- Buffoper(0);
-
- /* Set replay tracks */
- Settracks(0,0);
- Setmontracks(0);
-
- /* Select replay format */
- switch (spec->format & 0xff) {
- case 8:
- if (spec->channels==2) {
- channels_mode=STEREO8;
- } else {
- channels_mode=MONO8;
- }
- break;
- case 16:
- if (spec->channels==2) {
- channels_mode=STEREO16;
- } else {
- channels_mode=MONO16;
- }
- break;
- default:
- channels_mode=STEREO16;
- break;
- }
- if (Setmode(channels_mode)<0) {
- DEBUG_PRINT((DEBUG_NAME "Setmode() failed\n"));
- }
-
- prediv = MINTAUDIO_frequencies[MINTAUDIO_numfreq].predivisor;
- Devconnect(DMAPLAY, DAC, CLKEXT, prediv, 1);
-
- /* Set buffer */
- buffer = SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf];
- if (Setbuffer(0, buffer, buffer + spec->size)<0) {
- DEBUG_PRINT((DEBUG_NAME "Setbuffer() failed\n"));
- }
-
- /* Install interrupt */
- if (NSetinterrupt(2, SI_PLAY, Mint_GsxbInterrupt)<0) {
- DEBUG_PRINT((DEBUG_NAME "NSetinterrupt() failed\n"));
- }
-
- /* Go */
- Buffoper(SB_PLA_ENA|SB_PLA_RPT);
- DEBUG_PRINT((DEBUG_NAME "hardware initialized\n"));
-}
-
-static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- /* Lock sound system */
- if (Locksnd()!=1) {
- SDL_SetError("Mint_OpenAudio: Audio system already in use");
- return(-1);
- }
-
- SDL_MintAudio_device = this;
-
- /* Check audio capabilities */
- if (Mint_CheckAudio(this, spec)==-1) {
- return -1;
- }
-
- SDL_CalculateAudioSpec(spec);
-
- /* Allocate memory for audio buffers in DMA-able RAM */
- DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size));
-
- SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM);
- if (SDL_MintAudio_audiobuf[0]==NULL) {
- SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer");
- return (-1);
- }
- SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + spec->size ;
- SDL_MintAudio_numbuf=0;
- SDL_memset(SDL_MintAudio_audiobuf[0], spec->silence, spec->size *2);
- SDL_MintAudio_audiosize = spec->size;
- SDL_MintAudio_mutex = 0;
-
- DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n", SDL_MintAudio_audiobuf[0]));
- DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n", SDL_MintAudio_audiobuf[1]));
-
- SDL_MintAudio_CheckFpu();
-
- /* Setup audio hardware */
- Mint_InitAudio(this, spec);
-
- return(1); /* We don't use threaded audio */
-}
-
-static void Mint_GsxbInterrupt(void)
-{
- Uint8 *newbuf;
-
- if (SDL_MintAudio_mutex)
- return;
-
- SDL_MintAudio_mutex=1;
-
- SDL_MintAudio_numbuf ^= 1;
- SDL_MintAudio_Callback();
- newbuf = SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf];
- Setbuffer(0, newbuf, newbuf + SDL_MintAudio_audiosize);
-
- SDL_MintAudio_mutex=0;
-}
-
-static void Mint_GsxbNullInterrupt(void)
-{
-}
diff --git a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_gsxb.h b/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_gsxb.h
deleted file mode 100644
index 595e313..0000000
--- a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_gsxb.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * GSXB audio definitions
- *
- * Patrice Mandin
- */
-
-#ifndef _SDL_mintaudio_gsxb_h
-#define _SDL_mintaudio_gsxb_h
-
-#include <mint/falcon.h> /* for trap_14_xxx macros */
-
-/* GSXB Cookie */
-
-#define C_GSXB 0x47535842L
-
-/* Bit 5 in cookie _SND */
-
-#define SND_GSXB (1<<5)
-
-/* NSoundcmd modes */
-
-#define SETRATE 7 /* Set sample rate */
-#define SET8BITFORMAT 8 /* 8 bits format */
-#define SET16BITFORMAT 9 /* 16 bits format */
-#define SET24BITFORMAT 10 /* 24 bits format */
-#define SET32BITFORMAT 11 /* 32 bits format */
-#define LTATTEN_MASTER 12 /* Attenuation */
-#define RTATTEN_MASTER 13
-#define LTATTEN_MICIN 14
-#define RTATTEN_MICIN 15
-#define LTATTEN_FMGEN 16
-#define RTATTEN_FMGEN 17
-#define LTATTEN_LINEIN 18
-#define RTATTEN_LINEIN 19
-#define LTATTEN_CDIN 20
-#define RTATTEN_CDIN 21
-#define LTATTEN_VIDIN 22
-#define RTATTEN_VIDIN 23
-#define LTATTEN_AUXIN 24
-#define RTATTEN_AUXIN 25
-
-/* Setmode modes */
-
-#define MONO16 3
-#define STEREO24 4
-#define STEREO32 5
-#define MONO24 6
-#define MONO32 7
-
-/* Sndstatus modes */
-
-#define SND_QUERYFORMATS 2
-#define SND_QUERYMIXERS 3
-#define SND_QUERYSOURCES 4
-#define SND_QUERYDUPLEX 5
-#define SND_QUERY8BIT 8
-#define SND_QUERY16BIT 9
-#define SND_QUERY24BIT 10
-#define SND_QUERY32BIT 11
-
-#define SND_FORMAT8 (1<<0)
-#define SND_FORMAT16 (1<<1)
-#define SND_FORMAT24 (1<<2)
-#define SND_FORMAT32 (1<<3)
-
-#define SND_FORMATSIGNED (1<<0)
-#define SND_FORMATUNSIGNED (1<<1)
-#define SND_FORMATBIGENDIAN (1<<2)
-#define SND_FORMATLITTLEENDIAN (1<<3)
-
-/* Devconnect prescalers */
-
-#define CLK_44K 1
-#define CLK_22K 3
-#define CLK_11K 7
-
-/* Extra xbios functions */
-
-#define NSoundcmd(mode,data,data2) \
- (long)trap_14_wwl((short)130,(short)(mode),(short)(data),(long)(data2))
-#define NSetinterrupt(src_inter,cause,inth_addr) \
- (long)trap_14_wwwl((short)135,(short)(src_inter),(short)(cause), \
- (long)(inth_addr))
-
-#endif /* _SDL_mintaudio_gsxb_h */
diff --git a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_it.S b/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_it.S
deleted file mode 100644
index c751a59..0000000
--- a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_it.S
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/*
- Audio interrupts
-
- Patrice Mandin, Didier Méquignon
- */
-
- .text
-
- .globl _SDL_MintAudio_Callback
-
- .globl _SDL_MintAudio_XbiosInterrupt
- .globl _SDL_MintAudio_XbiosInterruptMeasureClock
- .globl _SDL_MintAudio_Dma8Interrupt
- .globl _SDL_MintAudio_StfaInterrupt
-
- .globl _SDL_MintAudio_mutex
- .globl _SDL_MintAudio_audiobuf
- .globl _SDL_MintAudio_numbuf
- .globl _SDL_MintAudio_audiosize
- .globl _SDL_MintAudio_clocktics
- .globl _SDL_MintAudio_hasfpu
-
- .globl _SDL_MintAudio_stfa
-
-/*
- How it works:
- - Audio is playing buffer #0 (resp. #1)
- - We must calculate a sample in buffer #1 (resp. #0)
- so we first call the callback to do it
- - Then we swap the buffers
-*/
-
-#define savptr 0x4a2
-#define savamt 0x46
-
-/*--- Xbios interrupt vector to measure Falcon external clock ---*/
-
-_SDL_MintAudio_XbiosInterruptMeasureClock: /* 1 mS */
-
- btst #0,0xFFFF8901:w /* state DMA sound */
- beqs SDL_MintAudio_EndIntMeasure
- addql #1,_SDL_MintAudio_clocktics
-SDL_MintAudio_EndIntMeasure:
- bclr #5,0xFFFFFA0F:w /* Clear service bit */
- rte
-
-/*--- Xbios interrupt vector ---*/
-
-_SDL_MintAudio_XbiosInterrupt:
-
- /* Reenable interrupts, so other interrupts can work */
- movew #0x2300,sr
-
- /* Clear service bit, so other MFP interrupts can work */
- bclr #5,0xfffffa0f:w
-
- /* Check if we are not already running */
- tstw _SDL_MintAudio_mutex
- bne SDL_MintAudio_XbiosEnd
- notw _SDL_MintAudio_mutex
-
- /* Swap buffers */
- eorw #1,_SDL_MintAudio_numbuf
-
- moveml d0-d7/a0-a6,sp@-
-
- /* Save FPU if needed */
- tstw _SDL_MintAudio_hasfpu
- beqs SDL_MintAudio_Xbios_nofpu1
- .chip 68060
- fsave sp@-
- fmoveml fpcr/fpsr/fpiar,sp@-
- fmovemx fp0-fp7,sp@-
- .chip 68000
-SDL_MintAudio_Xbios_nofpu1:
-
- /* Callback */
- jsr _SDL_MintAudio_Callback
-
- /* Restore FPU if needed */
- tstw _SDL_MintAudio_hasfpu
- beqs SDL_MintAudio_Xbios_nofpu2
- .chip 68060
- fmovemx sp@+,fp0-fp7
- fmoveml sp@+,fpcr/fpsr/fpiar
- frestore sp@+
- .chip 68000
-SDL_MintAudio_Xbios_nofpu2:
-
- /* Reserve space for registers */
- subl #savamt,savptr
-
- /* Set new buffer */
-
- moveq #0,d0
- movel _SDL_MintAudio_audiosize,d1
-
- movew _SDL_MintAudio_numbuf,d0
- lsll #2,d0
- lea _SDL_MintAudio_audiobuf,a0
- movel a0@(d0:l),a1
-
- lea a1@(d1:l),a2
-
- movel a2,sp@-
- movel a1,sp@-
- clrw sp@-
- movew #131,sp@-
- trap #14
- lea sp@(12),sp
-
- /* Restore registers space */
- addl #savamt,savptr
-
- moveml sp@+,d0-d7/a0-a6
-
- clrw _SDL_MintAudio_mutex
-SDL_MintAudio_XbiosEnd:
- rte
-
-/*--- DMA 8 bits interrupt vector ---*/
-
-_SDL_MintAudio_Dma8Interrupt:
-
- /* Reenable interrupts, so other interrupts can work */
- movew #0x2300,sr
-
- /* Clear service bit, so other MFP interrupts can work */
- bclr #5,0xfffffa0f:w
-
- /* Check if we are not already running */
- tstw _SDL_MintAudio_mutex
- bne SDL_MintAudio_Dma8End
- notw _SDL_MintAudio_mutex
-
- /* Swap buffers */
- eorw #1,_SDL_MintAudio_numbuf
-
- moveml d0-d1/a0-a1,sp@-
-
- /* Save FPU if needed */
- tstw _SDL_MintAudio_hasfpu
- beqs SDL_MintAudio_Dma8_nofpu1
- .chip 68060
- fsave sp@-
- fmoveml fpcr/fpsr/fpiar,sp@-
- fmovemx fp0-fp7,sp@-
- .chip 68000
-SDL_MintAudio_Dma8_nofpu1:
-
- /* Callback */
- jsr _SDL_MintAudio_Callback
-
- /* Restore FPU if needed */
- tstw _SDL_MintAudio_hasfpu
- beqs SDL_MintAudio_Dma8_nofpu2
- .chip 68060
- fmovemx sp@+,fp0-fp7
- fmoveml sp@+,fpcr/fpsr/fpiar
- frestore sp@+
- .chip 68000
-SDL_MintAudio_Dma8_nofpu2:
-
- /* Set new buffer */
-
- moveq #0,d0
-
- movew _SDL_MintAudio_numbuf,d0
- lslw #2,d0
- lea _SDL_MintAudio_audiobuf,a0
- movel a0@(d0:w),d1
-
- /* Modify DMA addresses */
- lea 0xffff8900:w,a0
-
- moveb d1,a0@(0x07) /* Start address */
- rorl #8,d1
- moveb d1,a0@(0x05)
- rorl #8,d1
- moveb d1,a0@(0x03)
- swap d1
-
- addl _SDL_MintAudio_audiosize,d1
-
- moveb d1,a0@(0x13) /* End address */
- rorl #8,d1
- moveb d1,a0@(0x11)
- rorl #8,d1
- moveb d1,a0@(0x0f)
-
- moveml sp@+,d0-d1/a0-a1
-
- clrw _SDL_MintAudio_mutex
-SDL_MintAudio_Dma8End:
- rte
-
-/*--- STFA interrupt vector ---*/
-
-STFA_SOUND_START = 6
-STFA_SOUND_END = STFA_SOUND_START+8
-
-_SDL_MintAudio_StfaInterrupt:
-
- /* Reenable interrupts, so other interrupts can work */
- movew #0x2300,sr
-
- /* Check if we are not already running */
- tstw _SDL_MintAudio_mutex
- bnes SDL_MintAudio_StfaEnd
- notw _SDL_MintAudio_mutex
-
- /* Swap buffers */
- eorw #1,_SDL_MintAudio_numbuf
-
- moveml d0-d7/a0-a6,sp@-
-
- /* Save FPU if needed */
- tstw _SDL_MintAudio_hasfpu
- beqs SDL_MintAudio_Stfa_nofpu1
- .chip 68060
- fsave sp@-
- fmoveml fpcr/fpsr/fpiar,sp@-
- fmovemx fp0-fp7,sp@-
- .chip 68000
-SDL_MintAudio_Stfa_nofpu1:
-
- /* Callback */
- jsr _SDL_MintAudio_Callback
-
- /* Restore FPU if needed */
- tstw _SDL_MintAudio_hasfpu
- beqs SDL_MintAudio_Stfa_nofpu2
- .chip 68060
- fmovemx sp@+,fp0-fp7
- fmoveml sp@+,fpcr/fpsr/fpiar
- frestore sp@+
- .chip 68000
-SDL_MintAudio_Stfa_nofpu2:
-
- /* Set new buffer */
-
- moveq #0,d0
- movel _SDL_MintAudio_stfa,a1
-
- movew _SDL_MintAudio_numbuf,d0
- lslw #2,d0
- lea _SDL_MintAudio_audiobuf,a0
- movel a0@(d0:w),d1
-
- /* Modify STFA replay buffers */
- movel d1,a1@(STFA_SOUND_START)
- addl _SDL_MintAudio_audiosize,d1
- movel d1,a1@(STFA_SOUND_END)
-
- moveml sp@+,d0-d7/a0-a6
-
- clrw _SDL_MintAudio_mutex
-SDL_MintAudio_StfaEnd:
- rte
diff --git a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_mcsn.c b/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_mcsn.c
deleted file mode 100644
index a464184..0000000
--- a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_mcsn.c
+++ /dev/null
@@ -1,404 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- MiNT audio driver
- using XBIOS functions (MacSound compatible driver)
-
- Patrice Mandin
-*/
-
-#include <support.h>
-
-/* Mint includes */
-#include <mint/osbind.h>
-#include <mint/falcon.h>
-#include <mint/cookie.h>
-
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_sysaudio.h"
-
-#include "../../video/ataricommon/SDL_atarimxalloc_c.h"
-
-#include "SDL_mintaudio.h"
-#include "SDL_mintaudio_mcsn.h"
-
-/*--- Defines ---*/
-
-#define MINT_AUDIO_DRIVER_NAME "mint_mcsn"
-
-/* Debug print info */
-#define DEBUG_NAME "audio:mcsn: "
-#if 0
-#define DEBUG_PRINT(what) \
- { \
- printf what; \
- }
-#else
-#define DEBUG_PRINT(what)
-#endif
-
-/*--- Static variables ---*/
-
-static unsigned long cookie_snd, cookie_mch;
-static cookie_mcsn_t *cookie_mcsn;
-
-/*--- Audio driver functions ---*/
-
-static void Mint_CloseAudio(_THIS);
-static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void Mint_LockAudio(_THIS);
-static void Mint_UnlockAudio(_THIS);
-
-/* To check/init hardware audio */
-static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec);
-static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec);
-
-/*--- Audio driver bootstrap functions ---*/
-
-static int Audio_Available(void)
-{
- unsigned long dummy;
- const char *envr = SDL_getenv("SDL_AUDIODRIVER");
-
- SDL_MintAudio_mint_present = (Getcookie(C_MiNT, &dummy) == C_FOUND);
-
- /* We can't use XBIOS in interrupt with Magic, don't know about thread */
- if (Getcookie(C_MagX, &dummy) == C_FOUND) {
- return(0);
- }
-
- /* Check if user asked a different audio driver */
- if ((envr) && (SDL_strcmp(envr, MINT_AUDIO_DRIVER_NAME)!=0)) {
- DEBUG_PRINT((DEBUG_NAME "user asked a different audio driver\n"));
- return(0);
- }
-
- /* Cookie _MCH present ? if not, assume ST machine */
- if (Getcookie(C__MCH, &cookie_mch) == C_NOTFOUND) {
- cookie_mch = MCH_ST;
- }
-
- /* Cookie _SND present ? if not, assume ST machine */
- if (Getcookie(C__SND, &cookie_snd) == C_NOTFOUND) {
- cookie_snd = SND_PSG;
- }
-
- /* Check if we have 16 bits audio */
- if ((cookie_snd & SND_16BIT)==0) {
- DEBUG_PRINT((DEBUG_NAME "no 16 bits sound\n"));
- return(0);
- }
-
- /* Cookie MCSN present ? */
- if (Getcookie(C_McSn, (long *) &cookie_mcsn) != C_FOUND) {
- DEBUG_PRINT((DEBUG_NAME "no MCSN audio\n"));
- return(0);
- }
-
- /* Check if interrupt at end of replay */
- if (cookie_mcsn->pint == 0) {
- DEBUG_PRINT((DEBUG_NAME "no interrupt at end of replay\n"));
- return(0);
- }
-
- /* Check if audio is lockable */
- if (Locksnd()!=1) {
- DEBUG_PRINT((DEBUG_NAME "audio locked by other application\n"));
- return(0);
- }
-
- Unlocksnd();
-
- DEBUG_PRINT((DEBUG_NAME "MCSN audio available!\n"));
- return(1);
-}
-
-static void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
- /* Set the function pointers */
- this->OpenAudio = Mint_OpenAudio;
- this->CloseAudio = Mint_CloseAudio;
- this->LockAudio = Mint_LockAudio;
- this->UnlockAudio = Mint_UnlockAudio;
- this->free = Audio_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap MINTAUDIO_MCSN_bootstrap = {
- MINT_AUDIO_DRIVER_NAME, "MiNT MCSN audio driver",
- Audio_Available, Audio_CreateDevice
-};
-
-static void Mint_LockAudio(_THIS)
-{
- /* Stop replay */
- Buffoper(0);
-}
-
-static void Mint_UnlockAudio(_THIS)
-{
- /* Restart replay */
- Buffoper(SB_PLA_ENA|SB_PLA_RPT);
-}
-
-static void Mint_CloseAudio(_THIS)
-{
- /* Stop replay */
- SDL_MintAudio_WaitThread();
- Buffoper(0);
-
- if (!SDL_MintAudio_mint_present) {
- /* Uninstall interrupt */
- Jdisint(MFP_DMASOUND);
- }
-
- /* Wait if currently playing sound */
- while (SDL_MintAudio_mutex != 0) {
- }
-
- /* Clear buffers */
- if (SDL_MintAudio_audiobuf[0]) {
- Mfree(SDL_MintAudio_audiobuf[0]);
- SDL_MintAudio_audiobuf[0] = SDL_MintAudio_audiobuf[1] = NULL;
- }
-
- /* Unlock sound system */
- Unlocksnd();
-}
-
-static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
-{
- int i;
- unsigned long masterclock, masterprediv;
-
- DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff));
- DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
- DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
- DEBUG_PRINT(("channels=%d, ", spec->channels));
- DEBUG_PRINT(("freq=%d\n", spec->freq));
-
- if (spec->channels > 2) {
- spec->channels = 2; /* no more than stereo! */
- }
-
- /* Check formats available */
- MINTAUDIO_freqcount=0;
- switch(cookie_mcsn->play) {
- case MCSN_ST:
- spec->channels=1;
- spec->format=8; /* FIXME: is it signed or unsigned ? */
- SDL_MintAudio_AddFrequency(this, 12500, 0, 0, -1);
- break;
- case MCSN_TT: /* Also STE, Mega STE */
- spec->format=AUDIO_S8;
- masterclock=MASTERCLOCK_STE;
- masterprediv=MASTERPREDIV_STE;
- if ((cookie_mch>>16)==MCH_TT) {
- masterclock=MASTERCLOCK_TT;
- masterprediv=MASTERPREDIV_TT;
- }
- for (i=0; i<4; i++) {
- SDL_MintAudio_AddFrequency(this, masterclock/(masterprediv*(1<<i)),
- masterclock, 3-i, -1);
- }
- break;
- case MCSN_FALCON: /* Also Mac */
- for (i=1; i<12; i++) {
- /* Remove unusable Falcon codec predivisors */
- if ((i==6) || (i==8) || (i==10)) {
- continue;
- }
- SDL_MintAudio_AddFrequency(this, MASTERCLOCK_FALCON1/(MASTERPREDIV_FALCON*(i+1)),
- CLK25M, i+1, -1);
- }
- if (cookie_mcsn->res1 != 0) {
- for (i=1; i<4; i++) {
- SDL_MintAudio_AddFrequency(this, (cookie_mcsn->res1)/(MASTERPREDIV_FALCON*(1<<i)),
- CLKEXT, (1<<i)-1, -1);
- }
- }
- spec->format |= 0x8000; /* Audio is always signed */
- if ((spec->format & 0x00ff)==16) {
- spec->format |= 0x1000; /* Audio is always big endian */
- spec->channels=2; /* 16 bits always stereo */
- }
- break;
- }
-
-#if 1
- for (i=0; i<MINTAUDIO_freqcount; i++) {
- DEBUG_PRINT((DEBUG_NAME "freq %d: %lu Hz, clock %lu, prediv %d\n",
- i, MINTAUDIO_frequencies[i].frequency, MINTAUDIO_frequencies[i].masterclock,
- MINTAUDIO_frequencies[i].predivisor
- ));
- }
-#endif
-
- MINTAUDIO_numfreq=SDL_MintAudio_SearchFrequency(this, spec->freq);
- spec->freq=MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
-
- DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff));
- DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
- DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
- DEBUG_PRINT(("channels=%d, ", spec->channels));
- DEBUG_PRINT(("freq=%d\n", spec->freq));
-
- return 0;
-}
-
-static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec)
-{
- int channels_mode, prediv, dmaclock;
- void *buffer;
-
- /* Stop currently playing sound */
- SDL_MintAudio_quit_thread = SDL_FALSE;
- SDL_MintAudio_thread_finished = SDL_TRUE;
- SDL_MintAudio_WaitThread();
- Buffoper(0);
-
- /* Set replay tracks */
- Settracks(0,0);
- Setmontracks(0);
-
- /* Select replay format */
- channels_mode=STEREO16;
- switch (spec->format & 0xff) {
- case 8:
- if (spec->channels==2) {
- channels_mode=STEREO8;
- } else {
- channels_mode=MONO8;
- }
- break;
- }
- if (Setmode(channels_mode)<0) {
- DEBUG_PRINT((DEBUG_NAME "Setmode() failed\n"));
- }
-
- dmaclock = MINTAUDIO_frequencies[MINTAUDIO_numfreq].masterclock;
- prediv = MINTAUDIO_frequencies[MINTAUDIO_numfreq].predivisor;
- switch(cookie_mcsn->play) {
- case MCSN_TT:
- Devconnect(DMAPLAY, DAC, CLK25M, CLKOLD, 1);
- Soundcmd(SETPRESCALE, prediv);
- DEBUG_PRINT((DEBUG_NAME "STE/TT prescaler selected\n"));
- break;
- case MCSN_FALCON:
- Devconnect(DMAPLAY, DAC, dmaclock, prediv, 1);
- DEBUG_PRINT((DEBUG_NAME "Falcon prescaler selected\n"));
- break;
- }
-
- /* Set buffer */
- buffer = SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf];
- if (Setbuffer(0, buffer, buffer + spec->size)<0) {
- DEBUG_PRINT((DEBUG_NAME "Setbuffer() failed\n"));
- }
-
- if (SDL_MintAudio_mint_present) {
- SDL_MintAudio_thread_pid = tfork(SDL_MintAudio_Thread, 0);
- } else {
- /* Install interrupt */
- Jdisint(MFP_DMASOUND);
- Xbtimer(XB_TIMERA, 8, 1, SDL_MintAudio_XbiosInterrupt);
- Jenabint(MFP_DMASOUND);
-
- if (Setinterrupt(SI_TIMERA, SI_PLAY)<0) {
- DEBUG_PRINT((DEBUG_NAME "Setinterrupt() failed\n"));
- }
- }
-
- /* Go */
- Buffoper(SB_PLA_ENA|SB_PLA_RPT);
- DEBUG_PRINT((DEBUG_NAME "hardware initialized\n"));
-}
-
-static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- /* Lock sound system */
- if (Locksnd()!=1) {
- SDL_SetError("Mint_OpenAudio: Audio system already in use");
- return(-1);
- }
-
- SDL_MintAudio_device = this;
-
- /* Check audio capabilities */
- if (Mint_CheckAudio(this, spec)==-1) {
- return -1;
- }
-
- SDL_CalculateAudioSpec(spec);
-
- /* Allocate memory for audio buffers in DMA-able RAM */
- DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size));
-
- SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM);
- if (SDL_MintAudio_audiobuf[0]==NULL) {
- SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer");
- return (-1);
- }
- SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + spec->size ;
- SDL_MintAudio_numbuf=0;
- SDL_memset(SDL_MintAudio_audiobuf[0], spec->silence, spec->size *2);
- SDL_MintAudio_audiosize = spec->size;
- SDL_MintAudio_mutex = 0;
-
- DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n", SDL_MintAudio_audiobuf[0]));
- DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n", SDL_MintAudio_audiobuf[1]));
-
- SDL_MintAudio_CheckFpu();
-
- /* Setup audio hardware */
- Mint_InitAudio(this, spec);
-
- return(1); /* We don't use SDL threaded audio */
-}
diff --git a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_mcsn.h b/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_mcsn.h
deleted file mode 100644
index f253ddd..0000000
--- a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_mcsn.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- MCSN control structure
-
- Patrice Mandin
-*/
-
-#ifndef _SDL_mintaudio_mcsh_h
-#define _SDL_mintaudio_mcsh_h
-
-typedef struct {
- unsigned short version; /* Version */
- unsigned short size; /* Size of structure */
-
- unsigned short play; /* Replay capability */
- unsigned short record; /* Record capability */
- unsigned short dsp; /* DSP56K present */
- unsigned short pint; /* Interrupt at end of replay */
- unsigned short rint; /* Interrupt at end of record */
-
- unsigned long res1; /* Frequency of external clock */
- unsigned long res2;
- unsigned long res3;
- unsigned long res4;
-} cookie_mcsn_t __attribute__((packed));
-
-enum {
- MCSN_ST=0,
- MCSN_TT,
- MCSN_STE=MCSN_TT,
- MCSN_FALCON,
- MCSN_MAC=MCSN_FALCON
-};
-
-#define SETSMPFREQ 7 /* Set sample frequency */
-
-#endif /* _SDL_mintaudio_mcsh_h */
diff --git a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_stfa.c b/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_stfa.c
deleted file mode 100644
index 4ad1fdd..0000000
--- a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_stfa.c
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- MiNT audio driver
- using XBIOS functions (STFA driver)
-
- Patrice Mandin
-*/
-
-/* Mint includes */
-#include <mint/osbind.h>
-#include <mint/falcon.h>
-#include <mint/cookie.h>
-
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_sysaudio.h"
-
-#include "../../video/ataricommon/SDL_atarimxalloc_c.h"
-
-#include "SDL_mintaudio.h"
-#include "SDL_mintaudio_stfa.h"
-
-/*--- Defines ---*/
-
-#define MINT_AUDIO_DRIVER_NAME "mint_stfa"
-
-/* Debug print info */
-#define DEBUG_NAME "audio:stfa: "
-#if 0
-#define DEBUG_PRINT(what) \
- { \
- printf what; \
- }
-#else
-#define DEBUG_PRINT(what)
-#endif
-
-/*--- Static variables ---*/
-
-static unsigned long cookie_snd, cookie_mch;
-static cookie_stfa_t *cookie_stfa;
-
-static const int freqs[16]={
- 4995, 6269, 7493, 8192,
- 9830, 10971, 12538, 14985,
- 16384, 19819, 21943, 24576,
- 30720, 32336, 43885, 49152
-};
-
-/*--- Audio driver functions ---*/
-
-static void Mint_CloseAudio(_THIS);
-static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void Mint_LockAudio(_THIS);
-static void Mint_UnlockAudio(_THIS);
-
-/* To check/init hardware audio */
-static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec);
-static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec);
-
-/*--- Audio driver bootstrap functions ---*/
-
-static int Audio_Available(void)
-{
- const char *envr = SDL_getenv("SDL_AUDIODRIVER");
-
- /* Check if user asked a different audio driver */
- if ((envr) && (SDL_strcmp(envr, MINT_AUDIO_DRIVER_NAME)!=0)) {
- DEBUG_PRINT((DEBUG_NAME "user asked a different audio driver\n"));
- return(0);
- }
-
- /* Cookie _MCH present ? if not, assume ST machine */
- if (Getcookie(C__MCH, &cookie_mch) == C_NOTFOUND) {
- cookie_mch = MCH_ST;
- }
-
- /* Cookie _SND present ? if not, assume ST machine */
- if (Getcookie(C__SND, &cookie_snd) == C_NOTFOUND) {
- cookie_snd = SND_PSG;
- }
-
- /* Cookie STFA present ? */
- if (Getcookie(C_STFA, (long *) &cookie_stfa) != C_FOUND) {
- DEBUG_PRINT((DEBUG_NAME "no STFA audio\n"));
- return(0);
- }
-
- SDL_MintAudio_stfa = cookie_stfa;
-
- DEBUG_PRINT((DEBUG_NAME "STFA audio available!\n"));
- return(1);
-}
-
-static void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
- /* Set the function pointers */
- this->OpenAudio = Mint_OpenAudio;
- this->CloseAudio = Mint_CloseAudio;
- this->LockAudio = Mint_LockAudio;
- this->UnlockAudio = Mint_UnlockAudio;
- this->free = Audio_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap MINTAUDIO_STFA_bootstrap = {
- MINT_AUDIO_DRIVER_NAME, "MiNT STFA audio driver",
- Audio_Available, Audio_CreateDevice
-};
-
-static void Mint_LockAudio(_THIS)
-{
- void *oldpile;
-
- /* Stop replay */
- oldpile=(void *)Super(0);
- cookie_stfa->sound_enable=STFA_PLAY_DISABLE;
- Super(oldpile);
-}
-
-static void Mint_UnlockAudio(_THIS)
-{
- void *oldpile;
-
- /* Restart replay */
- oldpile=(void *)Super(0);
- cookie_stfa->sound_enable=STFA_PLAY_ENABLE|STFA_PLAY_REPEAT;
- Super(oldpile);
-}
-
-static void Mint_CloseAudio(_THIS)
-{
- void *oldpile;
-
- /* Stop replay */
- oldpile=(void *)Super(0);
- cookie_stfa->sound_enable=STFA_PLAY_DISABLE;
- Super(oldpile);
-
- /* Wait if currently playing sound */
- while (SDL_MintAudio_mutex != 0) {
- }
-
- /* Clear buffers */
- if (SDL_MintAudio_audiobuf[0]) {
- Mfree(SDL_MintAudio_audiobuf[0]);
- SDL_MintAudio_audiobuf[0] = SDL_MintAudio_audiobuf[1] = NULL;
- }
-}
-
-static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
-{
- int i;
-
- DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff));
- DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
- DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
- DEBUG_PRINT(("channels=%d, ", spec->channels));
- DEBUG_PRINT(("freq=%d\n", spec->freq));
-
- if (spec->channels > 2) {
- spec->channels = 2; /* no more than stereo! */
- }
-
- /* Check formats available */
- MINTAUDIO_freqcount=0;
- for (i=0;i<16;i++) {
- SDL_MintAudio_AddFrequency(this, freqs[i], 0, i, -1);
- }
-
-#if 1
- for (i=0; i<MINTAUDIO_freqcount; i++) {
- DEBUG_PRINT((DEBUG_NAME "freq %d: %lu Hz, clock %lu, prediv %d\n",
- i, MINTAUDIO_frequencies[i].frequency, MINTAUDIO_frequencies[i].masterclock,
- MINTAUDIO_frequencies[i].predivisor
- ));
- }
-#endif
-
- MINTAUDIO_numfreq=SDL_MintAudio_SearchFrequency(this, spec->freq);
- spec->freq=MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
-
- DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff));
- DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
- DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
- DEBUG_PRINT(("channels=%d, ", spec->channels));
- DEBUG_PRINT(("freq=%d\n", spec->freq));
-
- return 0;
-}
-
-static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec)
-{
- void *buffer;
- void *oldpile;
-
- buffer = SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf];
-
- oldpile=(void *)Super(0);
-
- /* Stop replay */
- cookie_stfa->sound_enable=STFA_PLAY_DISABLE;
-
- /* Select replay format */
- cookie_stfa->sound_control = MINTAUDIO_frequencies[MINTAUDIO_numfreq].predivisor;
- if ((spec->format & 0xff)==8) {
- cookie_stfa->sound_control |= STFA_FORMAT_8BIT;
- } else {
- cookie_stfa->sound_control |= STFA_FORMAT_16BIT;
- }
- if (spec->channels==2) {
- cookie_stfa->sound_control |= STFA_FORMAT_STEREO;
- } else {
- cookie_stfa->sound_control |= STFA_FORMAT_MONO;
- }
- if ((spec->format & 0x8000)!=0) {
- cookie_stfa->sound_control |= STFA_FORMAT_SIGNED;
- } else {
- cookie_stfa->sound_control |= STFA_FORMAT_UNSIGNED;
- }
- if ((spec->format & 0x1000)!=0) {
- cookie_stfa->sound_control |= STFA_FORMAT_BIGENDIAN;
- } else {
- cookie_stfa->sound_control |= STFA_FORMAT_LITENDIAN;
- }
-
- /* Set buffer */
- cookie_stfa->sound_start = (unsigned long) buffer;
- cookie_stfa->sound_end = (unsigned long) (buffer + spec->size);
-
- /* Set interrupt */
- cookie_stfa->stfa_it = SDL_MintAudio_StfaInterrupt;
-
- /* Restart replay */
- cookie_stfa->sound_enable=STFA_PLAY_ENABLE|STFA_PLAY_REPEAT;
-
- Super(oldpile);
-
- DEBUG_PRINT((DEBUG_NAME "hardware initialized\n"));
-}
-
-static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- SDL_MintAudio_device = this;
-
- /* Check audio capabilities */
- if (Mint_CheckAudio(this, spec)==-1) {
- return -1;
- }
-
- SDL_CalculateAudioSpec(spec);
-
- /* Allocate memory for audio buffers in DMA-able RAM */
- DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size));
-
- SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM);
- if (SDL_MintAudio_audiobuf[0]==NULL) {
- SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer");
- return (-1);
- }
- SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + spec->size ;
- SDL_MintAudio_numbuf=0;
- SDL_memset(SDL_MintAudio_audiobuf[0], spec->silence, spec->size *2);
- SDL_MintAudio_audiosize = spec->size;
- SDL_MintAudio_mutex = 0;
-
- DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n", SDL_MintAudio_audiobuf[0]));
- DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n", SDL_MintAudio_audiobuf[1]));
-
- SDL_MintAudio_CheckFpu();
-
- /* Setup audio hardware */
- Mint_InitAudio(this, spec);
-
- return(1); /* We don't use threaded audio */
-}
diff --git a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_stfa.h b/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_stfa.h
deleted file mode 100644
index d4bf2d6..0000000
--- a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_stfa.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- STFA control structure
-
- Patrice Mandin
-*/
-
-#ifndef _SDL_mintaudio_stfa_h
-#define _SDL_mintaudio_stfa_h
-
-/*--- Defines ---*/
-
-#define C_STFA 0x53544641L /* Sound treiber für atari (seb/The removers) */
-
-#define STFA_PLAY_ENABLE (1<<0)
-#define STFA_PLAY_DISABLE (0<<0)
-#define STFA_PLAY_REPEAT (1<<1)
-#define STFA_PLAY_SINGLE (0<<1)
-
-#define STFA_FORMAT_SIGNED (1<<15)
-#define STFA_FORMAT_UNSIGNED (0<<15)
-#define STFA_FORMAT_STEREO (1<<14)
-#define STFA_FORMAT_MONO (0<<14)
-#define STFA_FORMAT_16BIT (1<<13)
-#define STFA_FORMAT_8BIT (0<<13)
-#define STFA_FORMAT_LITENDIAN (1<<9)
-#define STFA_FORMAT_BIGENDIAN (0<<9)
-#define STFA_FORMAT_FREQ_MASK 0x0f
-enum {
- STFA_FORMAT_F4995=0,
- STFA_FORMAT_F6269,
- STFA_FORMAT_F7493,
- STFA_FORMAT_F8192,
-
- STFA_FORMAT_F9830,
- STFA_FORMAT_F10971,
- STFA_FORMAT_F12538,
- STFA_FORMAT_F14985,
-
- STFA_FORMAT_F16384,
- STFA_FORMAT_F19819,
- STFA_FORMAT_F21943,
- STFA_FORMAT_F24576,
-
- STFA_FORMAT_F30720,
- STFA_FORMAT_F32336,
- STFA_FORMAT_F43885,
- STFA_FORMAT_F49152
-};
-
-/*--- Types ---*/
-
-typedef struct {
- unsigned short sound_enable;
- unsigned short sound_control;
- unsigned short sound_output;
- unsigned long sound_start;
- unsigned long sound_current;
- unsigned long sound_end;
- unsigned short version;
- void *old_vbl;
- void *old_timera;
- unsigned long old_mfp_status;
- void *new_vbl;
- void *drivers_list;
- void *play_stop;
- unsigned short frequency;
- void *set_frequency;
-
- unsigned short frequency_threshold;
- unsigned short *custom_freq_table;
- unsigned short stfa_on_off;
- void *new_drivers_list;
- unsigned long old_bit_2_of_cookie_snd;
- void (*stfa_it)(void);
-} cookie_stfa_t __attribute__((packed));
-
-#endif /* _SDL_mintaudio_stfa_h */
diff --git a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_xbios.c b/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_xbios.c
deleted file mode 100644
index 4a1af3f..0000000
--- a/distrib/sdl-1.2.12/src/audio/mint/SDL_mintaudio_xbios.c
+++ /dev/null
@@ -1,495 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- MiNT audio driver
- using XBIOS functions (Falcon)
-
- Patrice Mandin, Didier Méquignon
-*/
-
-#include <unistd.h>
-#include <support.h>
-
-/* Mint includes */
-#include <mint/osbind.h>
-#include <mint/falcon.h>
-#include <mint/cookie.h>
-
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_sysaudio.h"
-
-#include "../../video/ataricommon/SDL_atarimxalloc_c.h"
-
-#include "SDL_mintaudio.h"
-#include "SDL_mintaudio_dma8.h"
-
-/*--- Defines ---*/
-
-#define MINT_AUDIO_DRIVER_NAME "mint_xbios"
-
-/* Debug print info */
-#define DEBUG_NAME "audio:xbios: "
-#if 0
-#define DEBUG_PRINT(what) \
- { \
- printf what; \
- }
-#else
-#define DEBUG_PRINT(what)
-#endif
-
-/*--- Static variables ---*/
-
-static unsigned long cookie_snd;
-
-/*--- Audio driver functions ---*/
-
-static void Mint_CloseAudio(_THIS);
-static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void Mint_LockAudio(_THIS);
-static void Mint_UnlockAudio(_THIS);
-
-/* To check/init hardware audio */
-static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec);
-static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec);
-
-/*--- Audio driver bootstrap functions ---*/
-
-static int Audio_Available(void)
-{
- unsigned long dummy;
- const char *envr = SDL_getenv("SDL_AUDIODRIVER");
-
- /*SDL_MintAudio_mint_present = (Getcookie(C_MiNT, &dummy) == C_FOUND);*/
- SDL_MintAudio_mint_present = SDL_FALSE;
-
- /* We can't use XBIOS in interrupt with Magic, don't know about thread */
- if (Getcookie(C_MagX, &dummy) == C_FOUND) {
- return(0);
- }
-
- /* Check if user asked a different audio driver */
- if ((envr) && (SDL_strcmp(envr, MINT_AUDIO_DRIVER_NAME)!=0)) {
- DEBUG_PRINT((DEBUG_NAME "user asked a different audio driver\n"));
- return(0);
- }
-
- /* Cookie _SND present ? if not, assume ST machine */
- if (Getcookie(C__SND, &cookie_snd) == C_NOTFOUND) {
- cookie_snd = SND_PSG;
- }
-
- /* Check if we have 16 bits audio */
- if ((cookie_snd & SND_16BIT)==0) {
- DEBUG_PRINT((DEBUG_NAME "no 16 bits sound\n"));
- return(0);
- }
-
- /* Check if audio is lockable */
- if (Locksnd()!=1) {
- DEBUG_PRINT((DEBUG_NAME "audio locked by other application\n"));
- return(0);
- }
-
- Unlocksnd();
-
- DEBUG_PRINT((DEBUG_NAME "XBIOS audio available!\n"));
- return(1);
-}
-
-static void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
- /* Set the function pointers */
- this->OpenAudio = Mint_OpenAudio;
- this->CloseAudio = Mint_CloseAudio;
- this->LockAudio = Mint_LockAudio;
- this->UnlockAudio = Mint_UnlockAudio;
- this->free = Audio_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap MINTAUDIO_XBIOS_bootstrap = {
- MINT_AUDIO_DRIVER_NAME, "MiNT XBIOS audio driver",
- Audio_Available, Audio_CreateDevice
-};
-
-static void Mint_LockAudio(_THIS)
-{
- /* Stop replay */
- Buffoper(0);
-}
-
-static void Mint_UnlockAudio(_THIS)
-{
- /* Restart replay */
- Buffoper(SB_PLA_ENA|SB_PLA_RPT);
-}
-
-static void Mint_CloseAudio(_THIS)
-{
- /* Stop replay */
- SDL_MintAudio_WaitThread();
- Buffoper(0);
-
- if (!SDL_MintAudio_mint_present) {
- /* Uninstall interrupt */
- Jdisint(MFP_DMASOUND);
- }
-
- /* Wait if currently playing sound */
- while (SDL_MintAudio_mutex != 0) {
- }
-
- /* Clear buffers */
- if (SDL_MintAudio_audiobuf[0]) {
- Mfree(SDL_MintAudio_audiobuf[0]);
- SDL_MintAudio_audiobuf[0] = SDL_MintAudio_audiobuf[1] = NULL;
- }
-
- /* Unlock sound system */
- Unlocksnd();
-}
-
-/* Falcon XBIOS implementation of Devconnect() is buggy with external clock */
-static void Devconnect2(int src, int dst, int sclk, int pre)
-{
- static const unsigned short MASK1[3] = { 0, 0x6000, 0 };
- static const unsigned short MASK2[4] = { 0xFFF0, 0xFF8F, 0xF0FF, 0x0FFF };
- static const unsigned short INDEX1[4] = { 1, 3, 5, 7 };
- static const unsigned short INDEX2[4] = { 0, 2, 4, 6 };
- unsigned short sync_div,dev_ctrl,dest_ctrl;
- void *oldstack;
-
- if (dst==0) {
- return;
- }
-
- oldstack=(void *)Super(0);
-
- dev_ctrl = DMAAUDIO_IO.dev_ctrl;
- dest_ctrl = DMAAUDIO_IO.dest_ctrl;
- dev_ctrl &= MASK2[src];
-
- if (src==ADC) {
- dev_ctrl |= MASK1[sclk];
- } else {
- dev_ctrl |= (INDEX1[sclk] << (src<<4));
- }
-
- if (dst & DMAREC) {
- dest_ctrl &= 0xFFF0;
- dest_ctrl |= INDEX1[src];
- }
-
- if (dst & DSPRECV) {
- dest_ctrl &= 0xFF8F;
- dest_ctrl |= (INDEX1[src]<<4);
- }
-
- if (dst & EXTOUT) {
- dest_ctrl &= 0xF0FF;
- dest_ctrl |= (INDEX1[src]<<8);
- }
-
- if (dst & DAC) {
- dev_ctrl &= 0x0FFF;
- dev_ctrl |= MASK1[sclk];
- dest_ctrl &= 0x0FFF;
- dest_ctrl |= (INDEX2[src]<<12);
- }
-
- sync_div = DMAAUDIO_IO.sync_div;
- if (sclk==CLKEXT) {
- pre<<=8;
- sync_div &= 0xF0FF;
- } else {
- sync_div &= 0xFFF0;
- }
- sync_div |= pre;
-
- DMAAUDIO_IO.dev_ctrl = dev_ctrl;
- DMAAUDIO_IO.dest_ctrl = dest_ctrl;
- DMAAUDIO_IO.sync_div = sync_div;
-
- Super(oldstack);
-}
-
-static void Mint_CheckExternalClock(_THIS)
-{
-#define SIZE_BUF_CLOCK_MEASURE (44100/10)
-
- unsigned long cookie_snd;
- char *buffer;
- int i, j;
-
- /* DSP present with its GPIO port ? */
- if (Getcookie(C__SND, &cookie_snd) == C_NOTFOUND) {
- return;
- }
- if ((cookie_snd & SND_DSP)==0) {
- return;
- }
-
- buffer = Atari_SysMalloc(SIZE_BUF_CLOCK_MEASURE, MX_STRAM);
- if (buffer==NULL) {
- DEBUG_PRINT((DEBUG_NAME "Not enough memory for the measure\n"));
- return;
- }
- SDL_memset(buffer, 0, SIZE_BUF_CLOCK_MEASURE);
-
- Buffoper(0);
- Settracks(0,0);
- Setmontracks(0);
- Setmode(MONO8);
- Jdisint(MFP_TIMERA);
-
- for (i=0; i<2; i++) {
- Gpio(GPIO_SET,7); /* DSP port gpio outputs */
- Gpio(GPIO_WRITE,2+i); /* 22.5792/24.576 MHz for 44.1/48KHz */
- Devconnect2(DMAPLAY, DAC, CLKEXT, CLK50K); /* Matrix and clock source */
- Setbuffer(0, buffer, buffer + SIZE_BUF_CLOCK_MEASURE); /* Set buffer */
- Xbtimer(XB_TIMERA, 5, 38, SDL_MintAudio_XbiosInterruptMeasureClock); /* delay mode timer A, prediv /64, 1KHz */
- Jenabint(MFP_TIMERA);
- SDL_MintAudio_clocktics = 0;
- Buffoper(SB_PLA_ENA);
- usleep(110000);
-
- if((Buffoper(-1) & 1)==0) {
- if (SDL_MintAudio_clocktics) {
- unsigned long khz;
-
- khz = ((SIZE_BUF_CLOCK_MEASURE/SDL_MintAudio_clocktics) +1) & 0xFFFFFFFE;
- DEBUG_PRINT((DEBUG_NAME "measure %d: freq=%lu KHz\n", i+1, khz));
-
- if(khz==44) {
- for (j=1; j<4; j++) {
- SDL_MintAudio_AddFrequency(this, MASTERCLOCK_44K/(MASTERPREDIV_FALCON*(1<<j)), MASTERCLOCK_44K, (1<<j)-1, 2+i);
- }
- } else if (khz==48) {
- for (j=1; j<4; j++) {
- SDL_MintAudio_AddFrequency(this, MASTERCLOCK_48K/(MASTERPREDIV_FALCON*(1<<j)), MASTERCLOCK_48K, (1<<j)-1, 2+i);
- }
- }
- } else {
- DEBUG_PRINT((DEBUG_NAME "No measure\n"));
- }
- } else {
- DEBUG_PRINT((DEBUG_NAME "No SDMA clock\n"));
- }
-
- Buffoper(0); /* stop */
- Jdisint(MFP_TIMERA); /* Uninstall interrupt */
- }
-
- Mfree(buffer);
-}
-
-static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
-{
- int i;
- Uint32 extclock;
-
- DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff));
- DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
- DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
- DEBUG_PRINT(("channels=%d, ", spec->channels));
- DEBUG_PRINT(("freq=%d\n", spec->freq));
-
- if (spec->channels > 2) {
- spec->channels = 2; /* no more than stereo! */
- }
-
- spec->format |= 0x8000; /* Audio is always signed */
- if ((spec->format & 0x00ff)==16) {
- spec->format |= 0x1000; /* Audio is always big endian */
- spec->channels=2; /* 16 bits always stereo */
- }
-
- MINTAUDIO_freqcount=0;
-
- /* Add external clocks if present */
- Mint_CheckExternalClock(this);
-
- /* Standard clocks */
- for (i=1;i<12;i++) {
- /* Remove unusable Falcon codec predivisors */
- if ((i==6) || (i==8) || (i==10)) {
- continue;
- }
- SDL_MintAudio_AddFrequency(this, MASTERCLOCK_FALCON1/(MASTERPREDIV_FALCON*(i+1)), MASTERCLOCK_FALCON1, i, -1);
- }
-
-#if 1
- for (i=0; i<MINTAUDIO_freqcount; i++) {
- DEBUG_PRINT((DEBUG_NAME "freq %d: %lu Hz, clock %lu, prediv %d\n",
- i, MINTAUDIO_frequencies[i].frequency, MINTAUDIO_frequencies[i].masterclock,
- MINTAUDIO_frequencies[i].predivisor
- ));
- }
-#endif
-
- MINTAUDIO_numfreq=SDL_MintAudio_SearchFrequency(this, spec->freq);
- spec->freq=MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
-
- DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff));
- DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
- DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
- DEBUG_PRINT(("channels=%d, ", spec->channels));
- DEBUG_PRINT(("freq=%d\n", spec->freq));
-
- return 0;
-}
-
-static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec)
-{
- int channels_mode, dmaclock, prediv;
- void *buffer;
-
- /* Stop currently playing sound */
- SDL_MintAudio_quit_thread = SDL_FALSE;
- SDL_MintAudio_thread_finished = SDL_TRUE;
- SDL_MintAudio_WaitThread();
- Buffoper(0);
-
- /* Set replay tracks */
- Settracks(0,0);
- Setmontracks(0);
-
- /* Select replay format */
- channels_mode=STEREO16;
- switch (spec->format & 0xff) {
- case 8:
- if (spec->channels==2) {
- channels_mode=STEREO8;
- } else {
- channels_mode=MONO8;
- }
- break;
- }
- if (Setmode(channels_mode)<0) {
- DEBUG_PRINT((DEBUG_NAME "Setmode() failed\n"));
- }
-
- dmaclock = MINTAUDIO_frequencies[MINTAUDIO_numfreq].masterclock;
- prediv = MINTAUDIO_frequencies[MINTAUDIO_numfreq].predivisor;
- if (MINTAUDIO_frequencies[MINTAUDIO_numfreq].gpio_bits != -1) {
- Gpio(GPIO_SET,7); /* DSP port gpio outputs */
- Gpio(GPIO_WRITE, MINTAUDIO_frequencies[MINTAUDIO_numfreq].gpio_bits);
- Devconnect2(DMAPLAY, DAC|EXTOUT, CLKEXT, prediv);
- } else {
- Devconnect2(DMAPLAY, DAC, CLK25M, prediv);
- }
-
- /* Set buffer */
- buffer = SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf];
- if (Setbuffer(0, buffer, buffer + spec->size)<0) {
- DEBUG_PRINT((DEBUG_NAME "Setbuffer() failed\n"));
- }
-
- if (SDL_MintAudio_mint_present) {
- SDL_MintAudio_thread_pid = tfork(SDL_MintAudio_Thread, 0);
- } else {
- /* Install interrupt */
- Jdisint(MFP_DMASOUND);
- /*Xbtimer(XB_TIMERA, 8, 1, SDL_MintAudio_XbiosInterrupt);*/
- Xbtimer(XB_TIMERA, 8, 1, SDL_MintAudio_Dma8Interrupt);
- Jenabint(MFP_DMASOUND);
-
- if (Setinterrupt(SI_TIMERA, SI_PLAY)<0) {
- DEBUG_PRINT((DEBUG_NAME "Setinterrupt() failed\n"));
- }
- }
-
- /* Go */
- Buffoper(SB_PLA_ENA|SB_PLA_RPT);
- DEBUG_PRINT((DEBUG_NAME "hardware initialized\n"));
-}
-
-static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- /* Lock sound system */
- if (Locksnd()!=1) {
- SDL_SetError("Mint_OpenAudio: Audio system already in use");
- return(-1);
- }
-
- SDL_MintAudio_device = this;
-
- /* Check audio capabilities */
- if (Mint_CheckAudio(this, spec)==-1) {
- return -1;
- }
-
- SDL_CalculateAudioSpec(spec);
-
- /* Allocate memory for audio buffers in DMA-able RAM */
- DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size));
-
- SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM);
- if (SDL_MintAudio_audiobuf[0]==NULL) {
- SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer");
- return (-1);
- }
- SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + spec->size ;
- SDL_MintAudio_numbuf=0;
- SDL_memset(SDL_MintAudio_audiobuf[0], spec->silence, spec->size *2);
- SDL_MintAudio_audiosize = spec->size;
- SDL_MintAudio_mutex = 0;
-
- DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n", SDL_MintAudio_audiobuf[0]));
- DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n", SDL_MintAudio_audiobuf[1]));
-
- SDL_MintAudio_CheckFpu();
-
- /* Setup audio hardware */
- Mint_InitAudio(this, spec);
-
- return(1); /* We don't use SDL threaded audio */
-}
diff --git a/distrib/sdl-1.2.12/src/audio/mme/SDL_mmeaudio.c b/distrib/sdl-1.2.12/src/audio/mme/SDL_mmeaudio.c
deleted file mode 100644
index cb4d2be..0000000
--- a/distrib/sdl-1.2.12/src/audio/mme/SDL_mmeaudio.c
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Tru64 UNIX MME support */
-#include <mme_api.h>
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "SDL_mmeaudio.h"
-
-static BOOL inUse[NUM_BUFFERS];
-
-/* Audio driver functions */
-static int MME_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void MME_WaitAudio(_THIS);
-static Uint8 *MME_GetAudioBuf(_THIS);
-static void MME_PlayAudio(_THIS);
-static void MME_WaitDone(_THIS);
-static void MME_CloseAudio(_THIS);
-
-/* Audio driver bootstrap functions */
-static int Audio_Available(void)
-{
- return(1);
-}
-
-static void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- if ( device ) {
- if ( device->hidden ) {
- SDL_free(device->hidden);
- device->hidden = NULL;
- }
- SDL_free(device);
- device = NULL;
- }
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
-/* Initialize all variables that we clean on shutdown */
- this = SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
- /* Set the function pointers */
- this->OpenAudio = MME_OpenAudio;
- this->WaitAudio = MME_WaitAudio;
- this->PlayAudio = MME_PlayAudio;
- this->GetAudioBuf = MME_GetAudioBuf;
- this->WaitDone = MME_WaitDone;
- this->CloseAudio = MME_CloseAudio;
- this->free = Audio_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap MMEAUDIO_bootstrap = {
- "waveout", "Tru64 MME WaveOut",
- Audio_Available, Audio_CreateDevice
-};
-
-static void SetMMerror(char *function, MMRESULT code)
-{
- int len;
- char errbuf[MAXERRORLENGTH];
-
- SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: ", function);
- len = SDL_strlen(errbuf);
- waveOutGetErrorText(code, errbuf+len, MAXERRORLENGTH-len);
- SDL_SetError("%s",errbuf);
-}
-
-static void CALLBACK MME_CALLBACK(HWAVEOUT hwo,
- UINT uMsg,
- DWORD dwInstance,
- LPARAM dwParam1,
- LPARAM dwParam2)
-{
- WAVEHDR *wp = (WAVEHDR *) dwParam1;
-
- if ( uMsg == WOM_DONE )
- inUse[wp->dwUser] = FALSE;
-}
-
-static int MME_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- MMRESULT result;
- int i;
-
- mixbuf = NULL;
-
- /* Set basic WAVE format parameters */
- shm = mmeAllocMem(sizeof(*shm));
- if ( shm == NULL ) {
- SDL_SetError("Out of memory: shm");
- return(-1);
- }
- shm->sound = 0;
- shm->wFmt.wf.wFormatTag = WAVE_FORMAT_PCM;
-
- /* Determine the audio parameters from the AudioSpec */
- switch ( spec->format & 0xFF ) {
- case 8:
- /* Unsigned 8 bit audio data */
- spec->format = AUDIO_U8;
- shm->wFmt.wBitsPerSample = 8;
- break;
- case 16:
- /* Signed 16 bit audio data */
- spec->format = AUDIO_S16;
- shm->wFmt.wBitsPerSample = 16;
- break;
- default:
- SDL_SetError("Unsupported audio format");
- return(-1);
- }
-
- shm->wFmt.wf.nChannels = spec->channels;
- shm->wFmt.wf.nSamplesPerSec = spec->freq;
- shm->wFmt.wf.nBlockAlign =
- shm->wFmt.wf.nChannels * shm->wFmt.wBitsPerSample / 8;
- shm->wFmt.wf.nAvgBytesPerSec =
- shm->wFmt.wf.nSamplesPerSec * shm->wFmt.wf.nBlockAlign;
-
- /* Check the buffer size -- minimum of 1/4 second (word aligned) */
- if ( spec->samples < (spec->freq/4) )
- spec->samples = ((spec->freq/4)+3)&~3;
-
- /* Update the fragment size as size in bytes */
- SDL_CalculateAudioSpec(spec);
-
- /* Open the audio device */
- result = waveOutOpen(&(shm->sound),
- WAVE_MAPPER,
- &(shm->wFmt.wf),
- MME_CALLBACK,
- NULL,
- (CALLBACK_FUNCTION|WAVE_OPEN_SHAREABLE));
- if ( result != MMSYSERR_NOERROR ) {
- SetMMerror("waveOutOpen()", result);
- return(-1);
- }
-
- /* Create the sound buffers */
- mixbuf = (Uint8 *)mmeAllocBuffer(NUM_BUFFERS * (spec->size));
- if ( mixbuf == NULL ) {
- SDL_SetError("Out of memory: mixbuf");
- return(-1);
- }
-
- for (i = 0; i < NUM_BUFFERS; i++) {
- shm->wHdr[i].lpData = &mixbuf[i * (spec->size)];
- shm->wHdr[i].dwBufferLength = spec->size;
- shm->wHdr[i].dwFlags = 0;
- shm->wHdr[i].dwUser = i;
- shm->wHdr[i].dwLoops = 0; /* loop control counter */
- shm->wHdr[i].lpNext = NULL; /* reserved for driver */
- shm->wHdr[i].reserved = 0;
- inUse[i] = FALSE;
- }
- next_buffer = 0;
- return 0;
-}
-
-static void MME_WaitAudio(_THIS)
-{
- while ( inUse[next_buffer] ) {
- mmeWaitForCallbacks();
- mmeProcessCallbacks();
- }
-}
-
-static Uint8 *MME_GetAudioBuf(_THIS)
-{
- Uint8 *retval;
-
- inUse[next_buffer] = TRUE;
- retval = (Uint8 *)(shm->wHdr[next_buffer].lpData);
- return retval;
-}
-
-static void MME_PlayAudio(_THIS)
-{
- /* Queue it up */
- waveOutWrite(shm->sound, &(shm->wHdr[next_buffer]), sizeof(WAVEHDR));
- next_buffer = (next_buffer+1)%NUM_BUFFERS;
-}
-
-static void MME_WaitDone(_THIS)
-{
- MMRESULT result;
- int i;
-
- if ( shm->sound ) {
- for (i = 0; i < NUM_BUFFERS; i++)
- while ( inUse[i] ) {
- mmeWaitForCallbacks();
- mmeProcessCallbacks();
- }
- result = waveOutReset(shm->sound);
- if ( result != MMSYSERR_NOERROR )
- SetMMerror("waveOutReset()", result);
- mmeProcessCallbacks();
- }
-}
-
-static void MME_CloseAudio(_THIS)
-{
- MMRESULT result;
-
- if ( mixbuf ) {
- result = mmeFreeBuffer(mixbuf);
- if (result != MMSYSERR_NOERROR )
- SetMMerror("mmeFreeBuffer", result);
- mixbuf = NULL;
- }
-
- if ( shm ) {
- if ( shm->sound ) {
- result = waveOutClose(shm->sound);
- if (result != MMSYSERR_NOERROR )
- SetMMerror("waveOutClose()", result);
- mmeProcessCallbacks();
- }
- result = mmeFreeMem(shm);
- if (result != MMSYSERR_NOERROR )
- SetMMerror("mmeFreeMem()", result);
- shm = NULL;
- }
-}
-
diff --git a/distrib/sdl-1.2.12/src/audio/mme/SDL_mmeaudio.h b/distrib/sdl-1.2.12/src/audio/mme/SDL_mmeaudio.h
deleted file mode 100644
index 06d9d83..0000000
--- a/distrib/sdl-1.2.12/src/audio/mme/SDL_mmeaudio.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Allow access to a raw mixing buffer */
-
-#ifndef _SDL_lowaudio_h
-#define _SDL_lowaudio_h
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_AudioDevice *this
-#define NUM_BUFFERS 2
-
-struct SharedMem {
- HWAVEOUT sound;
- WAVEHDR wHdr[NUM_BUFFERS];
- PCMWAVEFORMAT wFmt;
-};
-
-struct SDL_PrivateAudioData {
- Uint8 *mixbuf; /* The raw allocated mixing buffer */
- struct SharedMem *shm;
- int next_buffer;
-};
-
-#define shm (this->hidden->shm)
-#define mixbuf (this->hidden->mixbuf)
-#define next_buffer (this->hidden->next_buffer)
-/* Old variable names */
-#endif /* _SDL_lowaudio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/nas/SDL_nasaudio.c b/distrib/sdl-1.2.12/src/audio/nas/SDL_nasaudio.c
deleted file mode 100644
index b5d2a3b..0000000
--- a/distrib/sdl-1.2.12/src/audio/nas/SDL_nasaudio.c
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- This driver was written by:
- Erik Inge Bolsø
- knan@mo.himolde.no
-*/
-#include "SDL_config.h"
-
-/* Allow access to a raw mixing buffer */
-
-#include <signal.h>
-#include <unistd.h>
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_audiodev_c.h"
-#include "SDL_nasaudio.h"
-
-/* The tag name used by artsc audio */
-#define NAS_DRIVER_NAME "nas"
-
-static struct SDL_PrivateAudioData *this2 = NULL;
-
-/* Audio driver functions */
-static int NAS_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void NAS_WaitAudio(_THIS);
-static void NAS_PlayAudio(_THIS);
-static Uint8 *NAS_GetAudioBuf(_THIS);
-static void NAS_CloseAudio(_THIS);
-
-/* Audio driver bootstrap functions */
-
-static int Audio_Available(void)
-{
- AuServer *aud = AuOpenServer("", 0, NULL, 0, NULL, NULL);
- if (!aud) return 0;
-
- AuCloseServer(aud);
- return 1;
-}
-
-static void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
- /* Set the function pointers */
- this->OpenAudio = NAS_OpenAudio;
- this->WaitAudio = NAS_WaitAudio;
- this->PlayAudio = NAS_PlayAudio;
- this->GetAudioBuf = NAS_GetAudioBuf;
- this->CloseAudio = NAS_CloseAudio;
-
- this->free = Audio_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap NAS_bootstrap = {
- NAS_DRIVER_NAME, "Network Audio System",
- Audio_Available, Audio_CreateDevice
-};
-
-/* This function waits until it is possible to write a full sound buffer */
-static void NAS_WaitAudio(_THIS)
-{
- while ( this->hidden->buf_free < this->hidden->mixlen ) {
- AuEvent ev;
- AuNextEvent(this->hidden->aud, AuTrue, &ev);
- AuDispatchEvent(this->hidden->aud, &ev);
- }
-}
-
-static void NAS_PlayAudio(_THIS)
-{
- while (this->hidden->mixlen > this->hidden->buf_free) { /* We think the buffer is full? Yikes! Ask the server for events,
- in the hope that some of them is LowWater events telling us more
- of the buffer is free now than what we think. */
- AuEvent ev;
- AuNextEvent(this->hidden->aud, AuTrue, &ev);
- AuDispatchEvent(this->hidden->aud, &ev);
- }
- this->hidden->buf_free -= this->hidden->mixlen;
-
- /* Write the audio data */
- AuWriteElement(this->hidden->aud, this->hidden->flow, 0, this->hidden->mixlen, this->hidden->mixbuf, AuFalse, NULL);
-
- this->hidden->written += this->hidden->mixlen;
-
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Wrote %d bytes of audio data\n", this->hidden->mixlen);
-#endif
-}
-
-static Uint8 *NAS_GetAudioBuf(_THIS)
-{
- return(this->hidden->mixbuf);
-}
-
-static void NAS_CloseAudio(_THIS)
-{
- if ( this->hidden->mixbuf != NULL ) {
- SDL_FreeAudioMem(this->hidden->mixbuf);
- this->hidden->mixbuf = NULL;
- }
- if ( this->hidden->aud ) {
- AuCloseServer(this->hidden->aud);
- this->hidden->aud = 0;
- }
-}
-
-static unsigned char sdlformat_to_auformat(unsigned int fmt)
-{
- switch (fmt)
- {
- case AUDIO_U8:
- return AuFormatLinearUnsigned8;
- case AUDIO_S8:
- return AuFormatLinearSigned8;
- case AUDIO_U16LSB:
- return AuFormatLinearUnsigned16LSB;
- case AUDIO_U16MSB:
- return AuFormatLinearUnsigned16MSB;
- case AUDIO_S16LSB:
- return AuFormatLinearSigned16LSB;
- case AUDIO_S16MSB:
- return AuFormatLinearSigned16MSB;
- }
- return AuNone;
-}
-
-static AuBool
-event_handler(AuServer* aud, AuEvent* ev, AuEventHandlerRec* hnd)
-{
- switch (ev->type) {
- case AuEventTypeElementNotify: {
- AuElementNotifyEvent* event = (AuElementNotifyEvent *)ev;
-
- switch (event->kind) {
- case AuElementNotifyKindLowWater:
- if (this2->buf_free >= 0) {
- this2->really += event->num_bytes;
- gettimeofday(&this2->last_tv, 0);
- this2->buf_free += event->num_bytes;
- } else {
- this2->buf_free = event->num_bytes;
- }
- break;
- case AuElementNotifyKindState:
- switch (event->cur_state) {
- case AuStatePause:
- if (event->reason != AuReasonUser) {
- if (this2->buf_free >= 0) {
- this2->really += event->num_bytes;
- gettimeofday(&this2->last_tv, 0);
- this2->buf_free += event->num_bytes;
- } else {
- this2->buf_free = event->num_bytes;
- }
- }
- break;
- }
- }
- }
- }
- return AuTrue;
-}
-
-static AuDeviceID
-find_device(_THIS, int nch)
-{
- int i;
- for (i = 0; i < AuServerNumDevices(this->hidden->aud); i++) {
- if ((AuDeviceKind(AuServerDevice(this->hidden->aud, i)) ==
- AuComponentKindPhysicalOutput) &&
- AuDeviceNumTracks(AuServerDevice(this->hidden->aud, i)) == nch) {
- return AuDeviceIdentifier(AuServerDevice(this->hidden->aud, i));
- }
- }
- return AuNone;
-}
-
-static int NAS_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- AuElement elms[3];
- int buffer_size;
- Uint16 test_format, format;
-
- this->hidden->mixbuf = NULL;
-
- /* Try for a closest match on audio format */
- format = 0;
- for ( test_format = SDL_FirstAudioFormat(spec->format);
- ! format && test_format; ) {
- format = sdlformat_to_auformat(test_format);
-
- if (format == AuNone) {
- test_format = SDL_NextAudioFormat();
- }
- }
- if ( format == 0 ) {
- SDL_SetError("Couldn't find any hardware audio formats");
- return(-1);
- }
- spec->format = test_format;
-
- this->hidden->aud = AuOpenServer("", 0, NULL, 0, NULL, NULL);
- if (this->hidden->aud == 0)
- {
- SDL_SetError("Couldn't open connection to NAS server");
- return (-1);
- }
-
- this->hidden->dev = find_device(this, spec->channels);
- if ((this->hidden->dev == AuNone) || (!(this->hidden->flow = AuCreateFlow(this->hidden->aud, NULL)))) {
- AuCloseServer(this->hidden->aud);
- this->hidden->aud = 0;
- SDL_SetError("Couldn't find a fitting playback device on NAS server");
- return (-1);
- }
-
- buffer_size = spec->freq;
- if (buffer_size < 4096)
- buffer_size = 4096;
-
- if (buffer_size > 32768)
- buffer_size = 32768; /* So that the buffer won't get unmanageably big. */
-
- /* Calculate the final parameters for this audio specification */
- SDL_CalculateAudioSpec(spec);
-
- this2 = this->hidden;
-
- AuMakeElementImportClient(elms, spec->freq, format, spec->channels, AuTrue,
- buffer_size, buffer_size / 4, 0, NULL);
- AuMakeElementExportDevice(elms+1, 0, this->hidden->dev, spec->freq,
- AuUnlimitedSamples, 0, NULL);
- AuSetElements(this->hidden->aud, this->hidden->flow, AuTrue, 2, elms, NULL);
- AuRegisterEventHandler(this->hidden->aud, AuEventHandlerIDMask, 0, this->hidden->flow,
- event_handler, (AuPointer) NULL);
-
- AuStartFlow(this->hidden->aud, this->hidden->flow, NULL);
-
- /* Allocate mixing buffer */
- this->hidden->mixlen = spec->size;
- this->hidden->mixbuf = (Uint8 *)SDL_AllocAudioMem(this->hidden->mixlen);
- if ( this->hidden->mixbuf == NULL ) {
- return(-1);
- }
- SDL_memset(this->hidden->mixbuf, spec->silence, spec->size);
-
- /* Get the parent process id (we're the parent of the audio thread) */
- this->hidden->parent = getpid();
-
- /* We're ready to rock and roll. :-) */
- return(0);
-}
diff --git a/distrib/sdl-1.2.12/src/audio/nas/SDL_nasaudio.h b/distrib/sdl-1.2.12/src/audio/nas/SDL_nasaudio.h
deleted file mode 100644
index 390d669..0000000
--- a/distrib/sdl-1.2.12/src/audio/nas/SDL_nasaudio.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- This driver was written by:
- Erik Inge Bolsø
- knan@mo.himolde.no
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_nasaudio_h
-#define _SDL_nasaudio_h
-
-#ifdef __sgi
-#include <nas/audiolib.h>
-#else
-#include <audio/audiolib.h>
-#endif
-#include <sys/time.h>
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData {
- AuServer* aud;
- AuFlowID flow;
- AuDeviceID dev;
-
- /* The parent process id, to detect when application quits */
- pid_t parent;
-
- /* Raw mixing buffer */
- Uint8 *mixbuf;
- int mixlen;
-
- int written;
- int really;
- int bps;
- struct timeval last_tv;
- int buf_free;
-};
-#endif /* _SDL_nasaudio_h */
-
diff --git a/distrib/sdl-1.2.12/src/audio/nto/SDL_nto_audio.c b/distrib/sdl-1.2.12/src/audio/nto/SDL_nto_audio.c
deleted file mode 100644
index db86bae..0000000
--- a/distrib/sdl-1.2.12/src/audio/nto/SDL_nto_audio.c
+++ /dev/null
@@ -1,507 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sched.h>
-#include <sys/select.h>
-#include <sys/neutrino.h>
-#include <sys/asoundlib.h>
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "SDL_nto_audio.h"
-
-/* The tag name used by NTO audio */
-#define DRIVER_NAME "qsa-nto"
-
-/* default channel communication parameters */
-#define DEFAULT_CPARAMS_RATE 22050
-#define DEFAULT_CPARAMS_VOICES 1
-/* FIXME: need to add in the near future flexible logic with frag_size and frags count */
-#define DEFAULT_CPARAMS_FRAG_SIZE 4096
-#define DEFAULT_CPARAMS_FRAGS_MIN 1
-#define DEFAULT_CPARAMS_FRAGS_MAX 1
-
-/* Open the audio device for playback, and don't block if busy */
-#define OPEN_FLAGS SND_PCM_OPEN_PLAYBACK
-
-#define QSA_NO_WORKAROUNDS 0x00000000
-#define QSA_MMAP_WORKAROUND 0x00000001
-
-struct BuggyCards
-{
- char* cardname;
- unsigned long bugtype;
-};
-
-#define QSA_WA_CARDS 3
-
-struct BuggyCards buggycards[QSA_WA_CARDS]=
-{
- {"Sound Blaster Live!", QSA_MMAP_WORKAROUND},
- {"Vortex 8820", QSA_MMAP_WORKAROUND},
- {"Vortex 8830", QSA_MMAP_WORKAROUND},
-};
-
-/* Audio driver functions */
-static void NTO_ThreadInit(_THIS);
-static int NTO_OpenAudio(_THIS, SDL_AudioSpec* spec);
-static void NTO_WaitAudio(_THIS);
-static void NTO_PlayAudio(_THIS);
-static Uint8* NTO_GetAudioBuf(_THIS);
-static void NTO_CloseAudio(_THIS);
-
-/* card names check to apply the workarounds */
-static int NTO_CheckBuggyCards(_THIS, unsigned long checkfor)
-{
- char scardname[33];
- int it;
-
- if (snd_card_get_name(cardno, scardname, 32)<0)
- {
- return 0;
- }
-
- for (it=0; it<QSA_WA_CARDS; it++)
- {
- if (SDL_strcmp(buggycards[it].cardname, scardname)==0)
- {
- if (buggycards[it].bugtype==checkfor)
- {
- return 1;
- }
- }
- }
-
- return 0;
-}
-
-static void NTO_ThreadInit(_THIS)
-{
- int status;
- struct sched_param param;
-
- /* increasing default 10 priority to 25 to avoid jerky sound */
- status=SchedGet(0, 0, &param);
- param.sched_priority=param.sched_curpriority+15;
- status=SchedSet(0, 0, SCHED_NOCHANGE, &param);
-}
-
-/* PCM transfer channel parameters initialize function */
-static void NTO_InitAudioParams(snd_pcm_channel_params_t* cpars)
-{
- SDL_memset(cpars, 0, sizeof(snd_pcm_channel_params_t));
-
- cpars->channel = SND_PCM_CHANNEL_PLAYBACK;
- cpars->mode = SND_PCM_MODE_BLOCK;
- cpars->start_mode = SND_PCM_START_DATA;
- cpars->stop_mode = SND_PCM_STOP_STOP;
- cpars->format.format = SND_PCM_SFMT_S16_LE;
- cpars->format.interleave = 1;
- cpars->format.rate = DEFAULT_CPARAMS_RATE;
- cpars->format.voices = DEFAULT_CPARAMS_VOICES;
- cpars->buf.block.frag_size = DEFAULT_CPARAMS_FRAG_SIZE;
- cpars->buf.block.frags_min = DEFAULT_CPARAMS_FRAGS_MIN;
- cpars->buf.block.frags_max = DEFAULT_CPARAMS_FRAGS_MAX;
-}
-
-static int NTO_AudioAvailable(void)
-{
- /* See if we can open a nonblocking channel.
- Return value '1' means we can.
- Return value '0' means we cannot. */
-
- int available;
- int rval;
- snd_pcm_t* handle;
-
- available = 0;
- handle = NULL;
-
- rval = snd_pcm_open_preferred(&handle, NULL, NULL, OPEN_FLAGS);
-
- if (rval >= 0)
- {
- available = 1;
-
- if ((rval = snd_pcm_close(handle)) < 0)
- {
- SDL_SetError("NTO_AudioAvailable(): snd_pcm_close failed: %s\n", snd_strerror(rval));
- available = 0;
- }
- }
- else
- {
- SDL_SetError("NTO_AudioAvailable(): there are no available audio devices.\n");
- }
-
- return (available);
-}
-
-static void NTO_DeleteAudioDevice(SDL_AudioDevice *device)
-{
- if ((device)&&(device->hidden))
- {
- SDL_free(device->hidden);
- }
- if (device)
- {
- SDL_free(device);
- }
-}
-
-static SDL_AudioDevice* NTO_CreateAudioDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if (this)
- {
- SDL_memset(this, 0, sizeof(SDL_AudioDevice));
- this->hidden = (struct SDL_PrivateAudioData *)SDL_malloc(sizeof(struct SDL_PrivateAudioData));
- }
- if ((this == NULL) || (this->hidden == NULL))
- {
- SDL_OutOfMemory();
- if (this)
- {
- SDL_free(this);
- }
- return (0);
- }
- SDL_memset(this->hidden, 0, sizeof(struct SDL_PrivateAudioData));
- audio_handle = NULL;
-
- /* Set the function pointers */
- this->ThreadInit = NTO_ThreadInit;
- this->OpenAudio = NTO_OpenAudio;
- this->WaitAudio = NTO_WaitAudio;
- this->PlayAudio = NTO_PlayAudio;
- this->GetAudioBuf = NTO_GetAudioBuf;
- this->CloseAudio = NTO_CloseAudio;
-
- this->free = NTO_DeleteAudioDevice;
-
- return this;
-}
-
-AudioBootStrap QNXNTOAUDIO_bootstrap =
-{
- DRIVER_NAME, "QNX6 QSA-NTO Audio",
- NTO_AudioAvailable,
- NTO_CreateAudioDevice
-};
-
-/* This function waits until it is possible to write a full sound buffer */
-static void NTO_WaitAudio(_THIS)
-{
- fd_set wfds;
- int selectret;
-
- FD_ZERO(&wfds);
- FD_SET(audio_fd, &wfds);
-
- do {
- selectret=select(audio_fd + 1, NULL, &wfds, NULL, NULL);
- switch (selectret)
- {
- case -1:
- case 0: SDL_SetError("NTO_WaitAudio(): select() failed: %s\n", strerror(errno));
- return;
- default: if (FD_ISSET(audio_fd, &wfds))
- {
- return;
- }
- break;
- }
- } while(1);
-}
-
-static void NTO_PlayAudio(_THIS)
-{
- int written, rval;
- int towrite;
- void* pcmbuffer;
-
- if (!this->enabled)
- {
- return;
- }
-
- towrite = this->spec.size;
- pcmbuffer = pcm_buf;
-
- /* Write the audio data, checking for EAGAIN (buffer full) and underrun */
- do {
- written = snd_pcm_plugin_write(audio_handle, pcm_buf, towrite);
- if (written != towrite)
- {
- if ((errno == EAGAIN) || (errno == EWOULDBLOCK))
- {
- /* Let a little CPU time go by and try to write again */
- SDL_Delay(1);
- /* if we wrote some data */
- towrite -= written;
- pcmbuffer += written * this->spec.channels;
- continue;
- }
- else
- {
- if ((errno == EINVAL) || (errno == EIO))
- {
- SDL_memset(&cstatus, 0, sizeof(cstatus));
- cstatus.channel = SND_PCM_CHANNEL_PLAYBACK;
- if ((rval = snd_pcm_plugin_status(audio_handle, &cstatus)) < 0)
- {
- SDL_SetError("NTO_PlayAudio(): snd_pcm_plugin_status failed: %s\n", snd_strerror(rval));
- return;
- }
- if ((cstatus.status == SND_PCM_STATUS_UNDERRUN) || (cstatus.status == SND_PCM_STATUS_READY))
- {
- if ((rval = snd_pcm_plugin_prepare(audio_handle, SND_PCM_CHANNEL_PLAYBACK)) < 0)
- {
- SDL_SetError("NTO_PlayAudio(): snd_pcm_plugin_prepare failed: %s\n", snd_strerror(rval));
- return;
- }
- }
- continue;
- }
- else
- {
- return;
- }
- }
- }
- else
- {
- /* we wrote all remaining data */
- towrite -= written;
- pcmbuffer += written * this->spec.channels;
- }
- } while ((towrite > 0) && (this->enabled));
-
- /* If we couldn't write, assume fatal error for now */
- if (towrite != 0)
- {
- this->enabled = 0;
- }
-
- return;
-}
-
-static Uint8* NTO_GetAudioBuf(_THIS)
-{
- return pcm_buf;
-}
-
-static void NTO_CloseAudio(_THIS)
-{
- int rval;
-
- this->enabled = 0;
-
- if (audio_handle != NULL)
- {
- if ((rval = snd_pcm_plugin_flush(audio_handle, SND_PCM_CHANNEL_PLAYBACK)) < 0)
- {
- SDL_SetError("NTO_CloseAudio(): snd_pcm_plugin_flush failed: %s\n", snd_strerror(rval));
- return;
- }
- if ((rval = snd_pcm_close(audio_handle)) < 0)
- {
- SDL_SetError("NTO_CloseAudio(): snd_pcm_close failed: %s\n",snd_strerror(rval));
- return;
- }
- audio_handle = NULL;
- }
-}
-
-static int NTO_OpenAudio(_THIS, SDL_AudioSpec* spec)
-{
- int rval;
- int format;
- Uint16 test_format;
- int found;
-
- audio_handle = NULL;
- this->enabled = 0;
-
- if (pcm_buf != NULL)
- {
- SDL_FreeAudioMem(pcm_buf);
- pcm_buf = NULL;
- }
-
- /* initialize channel transfer parameters to default */
- NTO_InitAudioParams(&cparams);
-
- /* Open the audio device */
- rval = snd_pcm_open_preferred(&audio_handle, &cardno, &deviceno, OPEN_FLAGS);
- if (rval < 0)
- {
- SDL_SetError("NTO_OpenAudio(): snd_pcm_open failed: %s\n", snd_strerror(rval));
- return (-1);
- }
-
- if (!NTO_CheckBuggyCards(this, QSA_MMAP_WORKAROUND))
- {
- /* enable count status parameter */
- if ((rval = snd_pcm_plugin_set_disable(audio_handle, PLUGIN_DISABLE_MMAP)) < 0)
- {
- SDL_SetError("snd_pcm_plugin_set_disable failed: %s\n", snd_strerror(rval));
- return (-1);
- }
- }
-
- /* Try for a closest match on audio format */
- format = 0;
- /* can't use format as SND_PCM_SFMT_U8 = 0 in nto */
- found = 0;
-
- for (test_format=SDL_FirstAudioFormat(spec->format); !found ;)
- {
- /* if match found set format to equivalent ALSA format */
- switch (test_format)
- {
- case AUDIO_U8:
- format = SND_PCM_SFMT_U8;
- found = 1;
- break;
- case AUDIO_S8:
- format = SND_PCM_SFMT_S8;
- found = 1;
- break;
- case AUDIO_S16LSB:
- format = SND_PCM_SFMT_S16_LE;
- found = 1;
- break;
- case AUDIO_S16MSB:
- format = SND_PCM_SFMT_S16_BE;
- found = 1;
- break;
- case AUDIO_U16LSB:
- format = SND_PCM_SFMT_U16_LE;
- found = 1;
- break;
- case AUDIO_U16MSB:
- format = SND_PCM_SFMT_U16_BE;
- found = 1;
- break;
- default:
- break;
- }
-
- if (!found)
- {
- test_format = SDL_NextAudioFormat();
- }
- }
-
- /* assumes test_format not 0 on success */
- if (test_format == 0)
- {
- SDL_SetError("NTO_OpenAudio(): Couldn't find any hardware audio formats");
- return (-1);
- }
-
- spec->format = test_format;
-
- /* Set the audio format */
- cparams.format.format = format;
-
- /* Set mono or stereo audio (currently only two channels supported) */
- cparams.format.voices = spec->channels;
-
- /* Set rate */
- cparams.format.rate = spec->freq;
-
- /* Setup the transfer parameters according to cparams */
- rval = snd_pcm_plugin_params(audio_handle, &cparams);
- if (rval < 0)
- {
- SDL_SetError("NTO_OpenAudio(): snd_pcm_channel_params failed: %s\n", snd_strerror(rval));
- return (-1);
- }
-
- /* Make sure channel is setup right one last time */
- SDL_memset(&csetup, 0x00, sizeof(csetup));
- csetup.channel = SND_PCM_CHANNEL_PLAYBACK;
- if (snd_pcm_plugin_setup(audio_handle, &csetup) < 0)
- {
- SDL_SetError("NTO_OpenAudio(): Unable to setup playback channel\n");
- return -1;
- }
-
-
- /* Calculate the final parameters for this audio specification */
- SDL_CalculateAudioSpec(spec);
-
- pcm_len = spec->size;
-
- if (pcm_len==0)
- {
- pcm_len = csetup.buf.block.frag_size * spec->channels * (snd_pcm_format_width(format)/8);
- }
-
- /* Allocate memory to the audio buffer and initialize with silence (Note that
- buffer size must be a multiple of fragment size, so find closest multiple)
- */
- pcm_buf = (Uint8*)SDL_AllocAudioMem(pcm_len);
- if (pcm_buf == NULL)
- {
- SDL_SetError("NTO_OpenAudio(): pcm buffer allocation failed\n");
- return (-1);
- }
- SDL_memset(pcm_buf, spec->silence, pcm_len);
-
- /* get the file descriptor */
- if ((audio_fd = snd_pcm_file_descriptor(audio_handle, SND_PCM_CHANNEL_PLAYBACK)) < 0)
- {
- SDL_SetError("NTO_OpenAudio(): snd_pcm_file_descriptor failed with error code: %s\n", snd_strerror(rval));
- return (-1);
- }
-
- /* Trigger audio playback */
- rval = snd_pcm_plugin_prepare(audio_handle, SND_PCM_CHANNEL_PLAYBACK);
- if (rval < 0)
- {
- SDL_SetError("snd_pcm_plugin_prepare failed: %s\n", snd_strerror(rval));
- return (-1);
- }
-
- this->enabled = 1;
-
- /* Get the parent process id (we're the parent of the audio thread) */
- parent = getpid();
-
- /* We're really ready to rock and roll. :-) */
- return (0);
-}
diff --git a/distrib/sdl-1.2.12/src/audio/nto/SDL_nto_audio.h b/distrib/sdl-1.2.12/src/audio/nto/SDL_nto_audio.h
deleted file mode 100644
index 14fd00d..0000000
--- a/distrib/sdl-1.2.12/src/audio/nto/SDL_nto_audio.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef __SDL_NTO_AUDIO_H__
-#define __SDL_NTO_AUDIO_H__
-
-#include <sys/asoundlib.h>
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the audio functions */
-#define _THIS SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData
-{
- /* The audio device handle */
- int cardno;
- int deviceno;
- snd_pcm_t* audio_handle;
-
- /* The audio file descriptor */
- int audio_fd;
-
- /* The parent process id, to detect when application quits */
- pid_t parent;
-
- /* Raw mixing buffer */
- Uint8* pcm_buf;
- Uint32 pcm_len;
-
- /* QSA parameters */
- snd_pcm_channel_status_t cstatus;
- snd_pcm_channel_params_t cparams;
- snd_pcm_channel_setup_t csetup;
-};
-
-#define cardno (this->hidden->cardno)
-#define deviceno (this->hidden->deviceno)
-#define audio_handle (this->hidden->audio_handle)
-#define audio_fd (this->hidden->audio_fd)
-#define parent (this->hidden->parent)
-#define pcm_buf (this->hidden->pcm_buf)
-#define pcm_len (this->hidden->pcm_len)
-#define cstatus (this->hidden->cstatus)
-#define cparams (this->hidden->cparams)
-#define csetup (this->hidden->csetup)
-
-#endif /* __SDL_NTO_AUDIO_H__ */
diff --git a/distrib/sdl-1.2.12/src/audio/paudio/SDL_paudio.c b/distrib/sdl-1.2.12/src/audio/paudio/SDL_paudio.c
deleted file mode 100644
index 7b07b59..0000000
--- a/distrib/sdl-1.2.12/src/audio/paudio/SDL_paudio.c
+++ /dev/null
@@ -1,511 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Carsten Griwodz
- griff@kom.tu-darmstadt.de
-
- based on linux/SDL_dspaudio.c by Sam Lantinga
-*/
-#include "SDL_config.h"
-
-/* Allow access to a raw mixing buffer */
-
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_audiodev_c.h"
-#include "SDL_paudio.h"
-
-#define DEBUG_AUDIO 1
-
-/* A conflict within AIX 4.3.3 <sys/> headers and probably others as well.
- * I guess nobody ever uses audio... Shame over AIX header files. */
-#include <sys/machine.h>
-#undef BIG_ENDIAN
-#include <sys/audio.h>
-
-/* The tag name used by paud audio */
-#define Paud_DRIVER_NAME "paud"
-
-/* Open the audio device for playback, and don't block if busy */
-/* #define OPEN_FLAGS (O_WRONLY|O_NONBLOCK) */
-#define OPEN_FLAGS O_WRONLY
-
-/* Audio driver functions */
-static int Paud_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void Paud_WaitAudio(_THIS);
-static void Paud_PlayAudio(_THIS);
-static Uint8 *Paud_GetAudioBuf(_THIS);
-static void Paud_CloseAudio(_THIS);
-
-/* Audio driver bootstrap functions */
-
-static int Audio_Available(void)
-{
- int fd;
- int available;
-
- available = 0;
- fd = SDL_OpenAudioPath(NULL, 0, OPEN_FLAGS, 0);
- if ( fd >= 0 ) {
- available = 1;
- close(fd);
- }
- return(available);
-}
-
-static void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
- audio_fd = -1;
-
- /* Set the function pointers */
- this->OpenAudio = Paud_OpenAudio;
- this->WaitAudio = Paud_WaitAudio;
- this->PlayAudio = Paud_PlayAudio;
- this->GetAudioBuf = Paud_GetAudioBuf;
- this->CloseAudio = Paud_CloseAudio;
-
- this->free = Audio_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap Paud_bootstrap = {
- Paud_DRIVER_NAME, "AIX Paudio",
- Audio_Available, Audio_CreateDevice
-};
-
-/* This function waits until it is possible to write a full sound buffer */
-static void Paud_WaitAudio(_THIS)
-{
- fd_set fdset;
-
- /* See if we need to use timed audio synchronization */
- if ( frame_ticks ) {
- /* Use timer for general audio synchronization */
- Sint32 ticks;
-
- ticks = ((Sint32)(next_frame - SDL_GetTicks()))-FUDGE_TICKS;
- if ( ticks > 0 ) {
- SDL_Delay(ticks);
- }
- } else {
- audio_buffer paud_bufinfo;
-
- /* Use select() for audio synchronization */
- struct timeval timeout;
- FD_ZERO(&fdset);
- FD_SET(audio_fd, &fdset);
-
- if ( ioctl(audio_fd, AUDIO_BUFFER, &paud_bufinfo) < 0 ) {
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Couldn't get audio buffer information\n");
-#endif
- timeout.tv_sec = 10;
- timeout.tv_usec = 0;
- } else {
- long ms_in_buf = paud_bufinfo.write_buf_time;
- timeout.tv_sec = ms_in_buf/1000;
- ms_in_buf = ms_in_buf - timeout.tv_sec*1000;
- timeout.tv_usec = ms_in_buf*1000;
-#ifdef DEBUG_AUDIO
- fprintf( stderr,
- "Waiting for write_buf_time=%ld,%ld\n",
- timeout.tv_sec,
- timeout.tv_usec );
-#endif
- }
-
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Waiting for audio to get ready\n");
-#endif
- if ( select(audio_fd+1, NULL, &fdset, NULL, &timeout) <= 0 ) {
- const char *message = "Audio timeout - buggy audio driver? (disabled)";
- /*
- * In general we should never print to the screen,
- * but in this case we have no other way of letting
- * the user know what happened.
- */
- fprintf(stderr, "SDL: %s - %s\n", strerror(errno), message);
- this->enabled = 0;
- /* Don't try to close - may hang */
- audio_fd = -1;
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Done disabling audio\n");
-#endif
- }
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Ready!\n");
-#endif
- }
-}
-
-static void Paud_PlayAudio(_THIS)
-{
- int written;
-
- /* Write the audio data, checking for EAGAIN on broken audio drivers */
- do {
- written = write(audio_fd, mixbuf, mixlen);
- if ( (written < 0) && ((errno == 0) || (errno == EAGAIN)) ) {
- SDL_Delay(1); /* Let a little CPU time go by */
- }
- } while ( (written < 0) &&
- ((errno == 0) || (errno == EAGAIN) || (errno == EINTR)) );
-
- /* If timer synchronization is enabled, set the next write frame */
- if ( frame_ticks ) {
- next_frame += frame_ticks;
- }
-
- /* If we couldn't write, assume fatal error for now */
- if ( written < 0 ) {
- this->enabled = 0;
- }
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Wrote %d bytes of audio data\n", written);
-#endif
-}
-
-static Uint8 *Paud_GetAudioBuf(_THIS)
-{
- return mixbuf;
-}
-
-static void Paud_CloseAudio(_THIS)
-{
- if ( mixbuf != NULL ) {
- SDL_FreeAudioMem(mixbuf);
- mixbuf = NULL;
- }
- if ( audio_fd >= 0 ) {
- close(audio_fd);
- audio_fd = -1;
- }
-}
-
-static int Paud_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- char audiodev[1024];
- int format;
- int bytes_per_sample;
- Uint16 test_format;
- audio_init paud_init;
- audio_buffer paud_bufinfo;
- audio_status paud_status;
- audio_control paud_control;
- audio_change paud_change;
-
- /* Reset the timer synchronization flag */
- frame_ticks = 0.0;
-
- /* Open the audio device */
- audio_fd = SDL_OpenAudioPath(audiodev, sizeof(audiodev), OPEN_FLAGS, 0);
- if ( audio_fd < 0 ) {
- SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno));
- return -1;
- }
-
- /*
- * We can't set the buffer size - just ask the device for the maximum
- * that we can have.
- */
- if ( ioctl(audio_fd, AUDIO_BUFFER, &paud_bufinfo) < 0 ) {
- SDL_SetError("Couldn't get audio buffer information");
- return -1;
- }
-
- mixbuf = NULL;
-
- if ( spec->channels > 1 )
- spec->channels = 2;
- else
- spec->channels = 1;
-
- /*
- * Fields in the audio_init structure:
- *
- * Ignored by us:
- *
- * paud.loadpath[LOAD_PATH]; * DSP code to load, MWave chip only?
- * paud.slot_number; * slot number of the adapter
- * paud.device_id; * adapter identification number
- *
- * Input:
- *
- * paud.srate; * the sampling rate in Hz
- * paud.bits_per_sample; * 8, 16, 32, ...
- * paud.bsize; * block size for this rate
- * paud.mode; * ADPCM, PCM, MU_LAW, A_LAW, SOURCE_MIX
- * paud.channels; * 1=mono, 2=stereo
- * paud.flags; * FIXED - fixed length data
- * * LEFT_ALIGNED, RIGHT_ALIGNED (var len only)
- * * TWOS_COMPLEMENT - 2's complement data
- * * SIGNED - signed? comment seems wrong in sys/audio.h
- * * BIG_ENDIAN
- * paud.operation; * PLAY, RECORD
- *
- * Output:
- *
- * paud.flags; * PITCH - pitch is supported
- * * INPUT - input is supported
- * * OUTPUT - output is supported
- * * MONITOR - monitor is supported
- * * VOLUME - volume is supported
- * * VOLUME_DELAY - volume delay is supported
- * * BALANCE - balance is supported
- * * BALANCE_DELAY - balance delay is supported
- * * TREBLE - treble control is supported
- * * BASS - bass control is supported
- * * BESTFIT_PROVIDED - best fit returned
- * * LOAD_CODE - DSP load needed
- * paud.rc; * NO_PLAY - DSP code can't do play requests
- * * NO_RECORD - DSP code can't do record requests
- * * INVALID_REQUEST - request was invalid
- * * CONFLICT - conflict with open's flags
- * * OVERLOADED - out of DSP MIPS or memory
- * paud.position_resolution; * smallest increment for position
- */
-
- paud_init.srate = spec->freq;
- paud_init.mode = PCM;
- paud_init.operation = PLAY;
- paud_init.channels = spec->channels;
-
- /* Try for a closest match on audio format */
- format = 0;
- for ( test_format = SDL_FirstAudioFormat(spec->format);
- ! format && test_format; ) {
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Trying format 0x%4.4x\n", test_format);
-#endif
- switch ( test_format ) {
- case AUDIO_U8:
- bytes_per_sample = 1;
- paud_init.bits_per_sample = 8;
- paud_init.flags = TWOS_COMPLEMENT | FIXED;
- format = 1;
- break;
- case AUDIO_S8:
- bytes_per_sample = 1;
- paud_init.bits_per_sample = 8;
- paud_init.flags = SIGNED |
- TWOS_COMPLEMENT | FIXED;
- format = 1;
- break;
- case AUDIO_S16LSB:
- bytes_per_sample = 2;
- paud_init.bits_per_sample = 16;
- paud_init.flags = SIGNED |
- TWOS_COMPLEMENT | FIXED;
- format = 1;
- break;
- case AUDIO_S16MSB:
- bytes_per_sample = 2;
- paud_init.bits_per_sample = 16;
- paud_init.flags = BIG_ENDIAN |
- SIGNED |
- TWOS_COMPLEMENT | FIXED;
- format = 1;
- break;
- case AUDIO_U16LSB:
- bytes_per_sample = 2;
- paud_init.bits_per_sample = 16;
- paud_init.flags = TWOS_COMPLEMENT | FIXED;
- format = 1;
- break;
- case AUDIO_U16MSB:
- bytes_per_sample = 2;
- paud_init.bits_per_sample = 16;
- paud_init.flags = BIG_ENDIAN |
- TWOS_COMPLEMENT | FIXED;
- format = 1;
- break;
- default:
- break;
- }
- if ( ! format ) {
- test_format = SDL_NextAudioFormat();
- }
- }
- if ( format == 0 ) {
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Couldn't find any hardware audio formats\n");
-#endif
- SDL_SetError("Couldn't find any hardware audio formats");
- return -1;
- }
- spec->format = test_format;
-
- /*
- * We know the buffer size and the max number of subsequent writes
- * that can be pending. If more than one can pend, allow the application
- * to do something like double buffering between our write buffer and
- * the device's own buffer that we are filling with write() anyway.
- *
- * We calculate spec->samples like this because SDL_CalculateAudioSpec()
- * will give put paud_bufinfo.write_buf_cap (or paud_bufinfo.write_buf_cap/2)
- * into spec->size in return.
- */
- if ( paud_bufinfo.request_buf_cap == 1 )
- {
- spec->samples = paud_bufinfo.write_buf_cap
- / bytes_per_sample
- / spec->channels;
- }
- else
- {
- spec->samples = paud_bufinfo.write_buf_cap
- / bytes_per_sample
- / spec->channels
- / 2;
- }
- paud_init.bsize = bytes_per_sample * spec->channels;
-
- SDL_CalculateAudioSpec(spec);
-
- /*
- * The AIX paud device init can't modify the values of the audio_init
- * structure that we pass to it. So we don't need any recalculation
- * of this stuff and no reinit call as in linux dsp and dma code.
- *
- * /dev/paud supports all of the encoding formats, so we don't need
- * to do anything like reopening the device, either.
- */
- if ( ioctl(audio_fd, AUDIO_INIT, &paud_init) < 0 ) {
- switch ( paud_init.rc )
- {
- case 1 :
- SDL_SetError("Couldn't set audio format: DSP can't do play requests");
- return -1;
- break;
- case 2 :
- SDL_SetError("Couldn't set audio format: DSP can't do record requests");
- return -1;
- break;
- case 4 :
- SDL_SetError("Couldn't set audio format: request was invalid");
- return -1;
- break;
- case 5 :
- SDL_SetError("Couldn't set audio format: conflict with open's flags");
- return -1;
- break;
- case 6 :
- SDL_SetError("Couldn't set audio format: out of DSP MIPS or memory");
- return -1;
- break;
- default :
- SDL_SetError("Couldn't set audio format: not documented in sys/audio.h");
- return -1;
- break;
- }
- }
-
- /* Allocate mixing buffer */
- mixlen = spec->size;
- mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen);
- if ( mixbuf == NULL ) {
- return -1;
- }
- SDL_memset(mixbuf, spec->silence, spec->size);
-
- /*
- * Set some paramters: full volume, first speaker that we can find.
- * Ignore the other settings for now.
- */
- paud_change.input = AUDIO_IGNORE; /* the new input source */
- paud_change.output = OUTPUT_1; /* EXTERNAL_SPEAKER,INTERNAL_SPEAKER,OUTPUT_1 */
- paud_change.monitor = AUDIO_IGNORE; /* the new monitor state */
- paud_change.volume = 0x7fffffff; /* volume level [0-0x7fffffff] */
- paud_change.volume_delay = AUDIO_IGNORE; /* the new volume delay */
- paud_change.balance = 0x3fffffff; /* the new balance */
- paud_change.balance_delay = AUDIO_IGNORE; /* the new balance delay */
- paud_change.treble = AUDIO_IGNORE; /* the new treble state */
- paud_change.bass = AUDIO_IGNORE; /* the new bass state */
- paud_change.pitch = AUDIO_IGNORE; /* the new pitch state */
-
- paud_control.ioctl_request = AUDIO_CHANGE;
- paud_control.request_info = (char*)&paud_change;
- if ( ioctl(audio_fd, AUDIO_CONTROL, &paud_control) < 0 ) {
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Can't change audio display settings\n" );
-#endif
- }
-
- /*
- * Tell the device to expect data. Actual start will wait for
- * the first write() call.
- */
- paud_control.ioctl_request = AUDIO_START;
- paud_control.position = 0;
- if ( ioctl(audio_fd, AUDIO_CONTROL, &paud_control) < 0 ) {
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Can't start audio play\n" );
-#endif
- SDL_SetError("Can't start audio play");
- return -1;
- }
-
- /* Check to see if we need to use select() workaround */
- { char *workaround;
- workaround = SDL_getenv("SDL_DSP_NOSELECT");
- if ( workaround ) {
- frame_ticks = (float)(spec->samples*1000)/spec->freq;
- next_frame = SDL_GetTicks()+frame_ticks;
- }
- }
-
- /* Get the parent process id (we're the parent of the audio thread) */
- parent = getpid();
-
- /* We're ready to rock and roll. :-) */
- return 0;
-}
-
diff --git a/distrib/sdl-1.2.12/src/audio/paudio/SDL_paudio.h b/distrib/sdl-1.2.12/src/audio/paudio/SDL_paudio.h
deleted file mode 100644
index a3f22ed..0000000
--- a/distrib/sdl-1.2.12/src/audio/paudio/SDL_paudio.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_paudaudio_h
-#define _SDL_paudaudio_h
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData {
- /* The file descriptor for the audio device */
- int audio_fd;
-
- /* The parent process id, to detect when application quits */
- pid_t parent;
-
- /* Raw mixing buffer */
- Uint8 *mixbuf;
- int mixlen;
-
- /* Support for audio timing using a timer, in addition to select() */
- float frame_ticks;
- float next_frame;
-};
-#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */
-
-/* Old variable names */
-#define audio_fd (this->hidden->audio_fd)
-#define parent (this->hidden->parent)
-#define mixbuf (this->hidden->mixbuf)
-#define mixlen (this->hidden->mixlen)
-#define frame_ticks (this->hidden->frame_ticks)
-#define next_frame (this->hidden->next_frame)
-
-#endif /* _SDL_paudaudio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/sun/SDL_sunaudio.c b/distrib/sdl-1.2.12/src/audio/sun/SDL_sunaudio.c
deleted file mode 100644
index 5ddaba1..0000000
--- a/distrib/sdl-1.2.12/src/audio/sun/SDL_sunaudio.c
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Allow access to a raw mixing buffer */
-
-#include <fcntl.h>
-#include <errno.h>
-#ifdef __NETBSD__
-#include <sys/ioctl.h>
-#include <sys/audioio.h>
-#endif
-#ifdef __SVR4
-#include <sys/audioio.h>
-#else
-#include <sys/time.h>
-#include <sys/types.h>
-#endif
-#include <unistd.h>
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audiomem.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_audiodev_c.h"
-#include "SDL_sunaudio.h"
-
-/* Open the audio device for playback, and don't block if busy */
-#define OPEN_FLAGS (O_WRONLY|O_NONBLOCK)
-
-/* Audio driver functions */
-static int DSP_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void DSP_WaitAudio(_THIS);
-static void DSP_PlayAudio(_THIS);
-static Uint8 *DSP_GetAudioBuf(_THIS);
-static void DSP_CloseAudio(_THIS);
-
-static Uint8 snd2au(int sample);
-
-/* Audio driver bootstrap functions */
-
-static int Audio_Available(void)
-{
- int fd;
- int available;
-
- available = 0;
- fd = SDL_OpenAudioPath(NULL, 0, OPEN_FLAGS, 1);
- if ( fd >= 0 ) {
- available = 1;
- close(fd);
- }
- return(available);
-}
-
-static void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
- audio_fd = -1;
-
- /* Set the function pointers */
- this->OpenAudio = DSP_OpenAudio;
- this->WaitAudio = DSP_WaitAudio;
- this->PlayAudio = DSP_PlayAudio;
- this->GetAudioBuf = DSP_GetAudioBuf;
- this->CloseAudio = DSP_CloseAudio;
-
- this->free = Audio_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap SUNAUDIO_bootstrap = {
- "audio", "UNIX /dev/audio interface",
- Audio_Available, Audio_CreateDevice
-};
-
-#ifdef DEBUG_AUDIO
-void CheckUnderflow(_THIS)
-{
-#ifdef AUDIO_GETINFO
- audio_info_t info;
- int left;
-
- ioctl(audio_fd, AUDIO_GETINFO, &info);
- left = (written - info.play.samples);
- if ( written && (left == 0) ) {
- fprintf(stderr, "audio underflow!\n");
- }
-#endif
-}
-#endif
-
-void DSP_WaitAudio(_THIS)
-{
-#ifdef AUDIO_GETINFO
-#define SLEEP_FUDGE 10 /* 10 ms scheduling fudge factor */
- audio_info_t info;
- Sint32 left;
-
- ioctl(audio_fd, AUDIO_GETINFO, &info);
- left = (written - info.play.samples);
- if ( left > fragsize ) {
- Sint32 sleepy;
-
- sleepy = ((left - fragsize)/frequency);
- sleepy -= SLEEP_FUDGE;
- if ( sleepy > 0 ) {
- SDL_Delay(sleepy);
- }
- }
-#else
- fd_set fdset;
-
- FD_ZERO(&fdset);
- FD_SET(audio_fd, &fdset);
- select(audio_fd+1, NULL, &fdset, NULL, NULL);
-#endif
-}
-
-void DSP_PlayAudio(_THIS)
-{
- /* Write the audio data */
- if ( ulaw_only ) {
- /* Assuming that this->spec.freq >= 8000 Hz */
- int accum, incr, pos;
- Uint8 *aubuf;
-
- accum = 0;
- incr = this->spec.freq/8;
- aubuf = ulaw_buf;
- switch (audio_fmt & 0xFF) {
- case 8: {
- Uint8 *sndbuf;
-
- sndbuf = mixbuf;
- for ( pos=0; pos < fragsize; ++pos ) {
- *aubuf = snd2au((0x80-*sndbuf)*64);
- accum += incr;
- while ( accum > 0 ) {
- accum -= 1000;
- sndbuf += 1;
- }
- aubuf += 1;
- }
- }
- break;
- case 16: {
- Sint16 *sndbuf;
-
- sndbuf = (Sint16 *)mixbuf;
- for ( pos=0; pos < fragsize; ++pos ) {
- *aubuf = snd2au(*sndbuf/4);
- accum += incr;
- while ( accum > 0 ) {
- accum -= 1000;
- sndbuf += 1;
- }
- aubuf += 1;
- }
- }
- break;
- }
-#ifdef DEBUG_AUDIO
- CheckUnderflow(this);
-#endif
- if ( write(audio_fd, ulaw_buf, fragsize) < 0 ) {
- /* Assume fatal error, for now */
- this->enabled = 0;
- }
- written += fragsize;
- } else {
-#ifdef DEBUG_AUDIO
- CheckUnderflow(this);
-#endif
- if ( write(audio_fd, mixbuf, this->spec.size) < 0 ) {
- /* Assume fatal error, for now */
- this->enabled = 0;
- }
- written += fragsize;
- }
-}
-
-Uint8 *DSP_GetAudioBuf(_THIS)
-{
- return(mixbuf);
-}
-
-void DSP_CloseAudio(_THIS)
-{
- if ( mixbuf != NULL ) {
- SDL_FreeAudioMem(mixbuf);
- mixbuf = NULL;
- }
- if ( ulaw_buf != NULL ) {
- SDL_free(ulaw_buf);
- ulaw_buf = NULL;
- }
- close(audio_fd);
-}
-
-int DSP_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- char audiodev[1024];
-#ifdef AUDIO_SETINFO
- int enc;
-#endif
- int desired_freq = spec->freq;
-
- /* Initialize our freeable variables, in case we fail*/
- audio_fd = -1;
- mixbuf = NULL;
- ulaw_buf = NULL;
-
- /* Determine the audio parameters from the AudioSpec */
- switch ( spec->format & 0xFF ) {
-
- case 8: { /* Unsigned 8 bit audio data */
- spec->format = AUDIO_U8;
-#ifdef AUDIO_SETINFO
- enc = AUDIO_ENCODING_LINEAR8;
-#endif
- }
- break;
-
- case 16: { /* Signed 16 bit audio data */
- spec->format = AUDIO_S16SYS;
-#ifdef AUDIO_SETINFO
- enc = AUDIO_ENCODING_LINEAR;
-#endif
- }
- break;
-
- default: {
- SDL_SetError("Unsupported audio format");
- return(-1);
- }
- }
- audio_fmt = spec->format;
-
- /* Open the audio device */
- audio_fd = SDL_OpenAudioPath(audiodev, sizeof(audiodev), OPEN_FLAGS, 1);
- if ( audio_fd < 0 ) {
- SDL_SetError("Couldn't open %s: %s", audiodev,
- strerror(errno));
- return(-1);
- }
-
- ulaw_only = 0; /* modern Suns do support linear audio */
-#ifdef AUDIO_SETINFO
- for(;;) {
- audio_info_t info;
- AUDIO_INITINFO(&info); /* init all fields to "no change" */
-
- /* Try to set the requested settings */
- info.play.sample_rate = spec->freq;
- info.play.channels = spec->channels;
- info.play.precision = (enc == AUDIO_ENCODING_ULAW)
- ? 8 : spec->format & 0xff;
- info.play.encoding = enc;
- if( ioctl(audio_fd, AUDIO_SETINFO, &info) == 0 ) {
-
- /* Check to be sure we got what we wanted */
- if(ioctl(audio_fd, AUDIO_GETINFO, &info) < 0) {
- SDL_SetError("Error getting audio parameters: %s",
- strerror(errno));
- return -1;
- }
- if(info.play.encoding == enc
- && info.play.precision == (spec->format & 0xff)
- && info.play.channels == spec->channels) {
- /* Yow! All seems to be well! */
- spec->freq = info.play.sample_rate;
- break;
- }
- }
-
- switch(enc) {
- case AUDIO_ENCODING_LINEAR8:
- /* unsigned 8bit apparently not supported here */
- enc = AUDIO_ENCODING_LINEAR;
- spec->format = AUDIO_S16SYS;
- break; /* try again */
-
- case AUDIO_ENCODING_LINEAR:
- /* linear 16bit didn't work either, resort to µ-law */
- enc = AUDIO_ENCODING_ULAW;
- spec->channels = 1;
- spec->freq = 8000;
- spec->format = AUDIO_U8;
- ulaw_only = 1;
- break;
-
- default:
- /* oh well... */
- SDL_SetError("Error setting audio parameters: %s",
- strerror(errno));
- return -1;
- }
- }
-#endif /* AUDIO_SETINFO */
- written = 0;
-
- /* We can actually convert on-the-fly to U-Law */
- if ( ulaw_only ) {
- spec->freq = desired_freq;
- fragsize = (spec->samples*1000)/(spec->freq/8);
- frequency = 8;
- ulaw_buf = (Uint8 *)SDL_malloc(fragsize);
- if ( ulaw_buf == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
- spec->channels = 1;
- } else {
- fragsize = spec->samples;
- frequency = spec->freq/1000;
- }
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Audio device %s U-Law only\n",
- ulaw_only ? "is" : "is not");
- fprintf(stderr, "format=0x%x chan=%d freq=%d\n",
- spec->format, spec->channels, spec->freq);
-#endif
-
- /* Update the fragment size as size in bytes */
- SDL_CalculateAudioSpec(spec);
-
- /* Allocate mixing buffer */
- mixbuf = (Uint8 *)SDL_AllocAudioMem(spec->size);
- if ( mixbuf == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
- SDL_memset(mixbuf, spec->silence, spec->size);
-
- /* We're ready to rock and roll. :-) */
- return(0);
-}
-
-/************************************************************************/
-/* This function (snd2au()) copyrighted: */
-/************************************************************************/
-/* Copyright 1989 by Rich Gopstein and Harris Corporation */
-/* */
-/* Permission to use, copy, modify, and distribute this software */
-/* and its documentation for any purpose and without fee is */
-/* hereby granted, provided that the above copyright notice */
-/* appears in all copies and that both that copyright notice and */
-/* this permission notice appear in supporting documentation, and */
-/* that the name of Rich Gopstein and Harris Corporation not be */
-/* used in advertising or publicity pertaining to distribution */
-/* of the software without specific, written prior permission. */
-/* Rich Gopstein and Harris Corporation make no representations */
-/* about the suitability of this software for any purpose. It */
-/* provided "as is" without express or implied warranty. */
-/************************************************************************/
-
-static Uint8 snd2au(int sample)
-{
-
- int mask;
-
- if (sample < 0) {
- sample = -sample;
- mask = 0x7f;
- } else {
- mask = 0xff;
- }
-
- if (sample < 32) {
- sample = 0xF0 | (15 - sample / 2);
- } else if (sample < 96) {
- sample = 0xE0 | (15 - (sample - 32) / 4);
- } else if (sample < 224) {
- sample = 0xD0 | (15 - (sample - 96) / 8);
- } else if (sample < 480) {
- sample = 0xC0 | (15 - (sample - 224) / 16);
- } else if (sample < 992) {
- sample = 0xB0 | (15 - (sample - 480) / 32);
- } else if (sample < 2016) {
- sample = 0xA0 | (15 - (sample - 992) / 64);
- } else if (sample < 4064) {
- sample = 0x90 | (15 - (sample - 2016) / 128);
- } else if (sample < 8160) {
- sample = 0x80 | (15 - (sample - 4064) / 256);
- } else {
- sample = 0x80;
- }
- return (mask & sample);
-}
diff --git a/distrib/sdl-1.2.12/src/audio/sun/SDL_sunaudio.h b/distrib/sdl-1.2.12/src/audio/sun/SDL_sunaudio.h
deleted file mode 100644
index 51b0d5e..0000000
--- a/distrib/sdl-1.2.12/src/audio/sun/SDL_sunaudio.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_lowaudio_h
-#define _SDL_lowaudio_h
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData {
- /* The file descriptor for the audio device */
- int audio_fd;
-
- Uint16 audio_fmt; /* The app audio format */
- Uint8 *mixbuf; /* The app mixing buffer */
- int ulaw_only; /* Flag -- does hardware only output U-law? */
- Uint8 *ulaw_buf; /* The U-law mixing buffer */
- Sint32 written; /* The number of samples written */
- int fragsize; /* The audio fragment size in samples */
- int frequency; /* The audio frequency in KHz */
-};
-
-/* Old variable names */
-#define audio_fd (this->hidden->audio_fd)
-#define audio_fmt (this->hidden->audio_fmt)
-#define mixbuf (this->hidden->mixbuf)
-#define ulaw_only (this->hidden->ulaw_only)
-#define ulaw_buf (this->hidden->ulaw_buf)
-#define written (this->hidden->written)
-#define fragsize (this->hidden->fragsize)
-#define frequency (this->hidden->frequency)
-
-#endif /* _SDL_lowaudio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/ums/SDL_umsaudio.c b/distrib/sdl-1.2.12/src/audio/ums/SDL_umsaudio.c
deleted file mode 100644
index e873b56..0000000
--- a/distrib/sdl-1.2.12/src/audio/ums/SDL_umsaudio.c
+++ /dev/null
@@ -1,547 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Carsten Griwodz
- griff@kom.tu-darmstadt.de
-
- based on linux/SDL_dspaudio.c by Sam Lantinga
-*/
-#include "SDL_config.h"
-
-/* Allow access to a raw mixing buffer */
-
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "../SDL_audiodev_c.h"
-#include "SDL_umsaudio.h"
-
-/* The tag name used by UMS audio */
-#define UMS_DRIVER_NAME "ums"
-
-#define DEBUG_AUDIO 1
-
-/* Audio driver functions */
-static int UMS_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void UMS_PlayAudio(_THIS);
-static Uint8 *UMS_GetAudioBuf(_THIS);
-static void UMS_CloseAudio(_THIS);
-
-static UMSAudioDevice_ReturnCode UADOpen(_THIS, string device, string mode, long flags);
-static UMSAudioDevice_ReturnCode UADClose(_THIS);
-static UMSAudioDevice_ReturnCode UADGetBitsPerSample(_THIS, long* bits);
-static UMSAudioDevice_ReturnCode UADSetBitsPerSample(_THIS, long bits);
-static UMSAudioDevice_ReturnCode UADSetSampleRate(_THIS, long rate, long* set_rate);
-static UMSAudioDevice_ReturnCode UADSetByteOrder(_THIS, string byte_order);
-static UMSAudioDevice_ReturnCode UADSetAudioFormatType(_THIS, string fmt);
-static UMSAudioDevice_ReturnCode UADSetNumberFormat(_THIS, string fmt);
-static UMSAudioDevice_ReturnCode UADInitialize(_THIS);
-static UMSAudioDevice_ReturnCode UADStart(_THIS);
-static UMSAudioDevice_ReturnCode UADStop(_THIS);
-static UMSAudioDevice_ReturnCode UADSetTimeFormat(_THIS, UMSAudioTypes_TimeFormat fmt );
-static UMSAudioDevice_ReturnCode UADWriteBuffSize(_THIS, long* buff_size );
-static UMSAudioDevice_ReturnCode UADWriteBuffRemain(_THIS, long* buff_size );
-static UMSAudioDevice_ReturnCode UADWriteBuffUsed(_THIS, long* buff_size );
-static UMSAudioDevice_ReturnCode UADSetDMABufferSize(_THIS, long bytes, long* bytes_ret );
-static UMSAudioDevice_ReturnCode UADSetVolume(_THIS, long volume );
-static UMSAudioDevice_ReturnCode UADSetBalance(_THIS, long balance );
-static UMSAudioDevice_ReturnCode UADSetChannels(_THIS, long channels );
-static UMSAudioDevice_ReturnCode UADPlayRemainingData(_THIS, boolean block );
-static UMSAudioDevice_ReturnCode UADEnableOutput(_THIS, string output, long* left_gain, long* right_gain);
-static UMSAudioDevice_ReturnCode UADWrite(_THIS, UMSAudioTypes_Buffer* buff, long samples, long* samples_written);
-
-/* Audio driver bootstrap functions */
-static int Audio_Available(void)
-{
- return 1;
-}
-
-static void Audio_DeleteDevice(_THIS)
-{
- if(this->hidden->playbuf._buffer) SDL_free(this->hidden->playbuf._buffer);
- if(this->hidden->fillbuf._buffer) SDL_free(this->hidden->fillbuf._buffer);
- _somFree( this->hidden->umsdev );
- SDL_free(this->hidden);
- SDL_free(this);
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /*
- * Allocate and initialize management storage and private management
- * storage for this SDL-using library.
- */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Creating UMS Audio device\n");
-#endif
-
- /*
- * Calls for UMS env initialization and audio object construction.
- */
- this->hidden->ev = somGetGlobalEnvironment();
- this->hidden->umsdev = UMSAudioDeviceNew();
-
- /*
- * Set the function pointers.
- */
- this->OpenAudio = UMS_OpenAudio;
- this->WaitAudio = NULL; /* we do blocking output */
- this->PlayAudio = UMS_PlayAudio;
- this->GetAudioBuf = UMS_GetAudioBuf;
- this->CloseAudio = UMS_CloseAudio;
- this->free = Audio_DeleteDevice;
-
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "done\n");
-#endif
- return this;
-}
-
-AudioBootStrap UMS_bootstrap = {
- UMS_DRIVER_NAME, "AIX UMS audio",
- Audio_Available, Audio_CreateDevice
-};
-
-static Uint8 *UMS_GetAudioBuf(_THIS)
-{
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "enter UMS_GetAudioBuf\n");
-#endif
- return this->hidden->fillbuf._buffer;
-/*
- long bufSize;
- UMSAudioDevice_ReturnCode rc;
-
- rc = UADSetTimeFormat(this, UMSAudioTypes_Bytes );
- rc = UADWriteBuffSize(this, bufSize );
-*/
-}
-
-static void UMS_CloseAudio(_THIS)
-{
- UMSAudioDevice_ReturnCode rc;
-
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "enter UMS_CloseAudio\n");
-#endif
- rc = UADPlayRemainingData(this, TRUE);
- rc = UADStop(this);
- rc = UADClose(this);
-}
-
-static void UMS_PlayAudio(_THIS)
-{
- UMSAudioDevice_ReturnCode rc;
- long samplesToWrite;
- long samplesWritten;
- UMSAudioTypes_Buffer swpbuf;
-
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "enter UMS_PlayAudio\n");
-#endif
- samplesToWrite = this->hidden->playbuf._length/this->hidden->bytesPerSample;
- do
- {
- rc = UADWrite(this, &this->hidden->playbuf,
- samplesToWrite,
- &samplesWritten );
- samplesToWrite -= samplesWritten;
-
- /* rc values: UMSAudioDevice_Success
- * UMSAudioDevice_Failure
- * UMSAudioDevice_Preempted
- * UMSAudioDevice_Interrupted
- * UMSAudioDevice_DeviceError
- */
- if ( rc == UMSAudioDevice_DeviceError ) {
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Returning from PlayAudio with devices error\n");
-#endif
- return;
- }
- }
- while(samplesToWrite>0);
-
- SDL_LockAudio();
- SDL_memcpy( &swpbuf, &this->hidden->playbuf, sizeof(UMSAudioTypes_Buffer) );
- SDL_memcpy( &this->hidden->playbuf, &this->hidden->fillbuf, sizeof(UMSAudioTypes_Buffer) );
- SDL_memcpy( &this->hidden->fillbuf, &swpbuf, sizeof(UMSAudioTypes_Buffer) );
- SDL_UnlockAudio();
-
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Wrote audio data and swapped buffer\n");
-#endif
-}
-
-#if 0
-// /* Set the DSP frequency */
-// value = spec->freq;
-// if ( ioctl(this->hidden->audio_fd, SOUND_PCM_WRITE_RATE, &value) < 0 ) {
-// SDL_SetError("Couldn't set audio frequency");
-// return(-1);
-// }
-// spec->freq = value;
-#endif
-
-static int UMS_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- char* audiodev = "/dev/paud0";
- long lgain;
- long rgain;
- long outRate;
- long outBufSize;
- long bitsPerSample;
- long samplesPerSec;
- long success;
- Uint16 test_format;
- int frag_spec;
- UMSAudioDevice_ReturnCode rc;
-
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "enter UMS_OpenAudio\n");
-#endif
- rc = UADOpen(this, audiodev,"PLAY", UMSAudioDevice_BlockingIO);
- if ( rc != UMSAudioDevice_Success ) {
- SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno));
- return -1;
- }
-
- rc = UADSetAudioFormatType(this, "PCM");
-
- success = 0;
- test_format = SDL_FirstAudioFormat(spec->format);
- do
- {
-#ifdef DEBUG_AUDIO
- fprintf(stderr, "Trying format 0x%4.4x\n", test_format);
-#endif
- switch ( test_format )
- {
- case AUDIO_U8:
-/* from the mac code: better ? */
-/* sample_bits = spec->size / spec->samples / spec->channels * 8; */
- success = 1;
- bitsPerSample = 8;
- rc = UADSetSampleRate(this, spec->freq << 16, &outRate );
- rc = UADSetByteOrder(this, "MSB"); /* irrelevant */
- rc = UADSetNumberFormat(this, "UNSIGNED");
- break;
- case AUDIO_S8:
- success = 1;
- bitsPerSample = 8;
- rc = UADSetSampleRate(this, spec->freq << 16, &outRate );
- rc = UADSetByteOrder(this, "MSB"); /* irrelevant */
- rc = UADSetNumberFormat(this, "SIGNED");
- break;
- case AUDIO_S16LSB:
- success = 1;
- bitsPerSample = 16;
- rc = UADSetSampleRate(this, spec->freq << 16, &outRate );
- rc = UADSetByteOrder(this, "LSB");
- rc = UADSetNumberFormat(this, "SIGNED");
- break;
- case AUDIO_S16MSB:
- success = 1;
- bitsPerSample = 16;
- rc = UADSetSampleRate(this, spec->freq << 16, &outRate );
- rc = UADSetByteOrder(this, "MSB");
- rc = UADSetNumberFormat(this, "SIGNED");
- break;
- case AUDIO_U16LSB:
- success = 1;
- bitsPerSample = 16;
- rc = UADSetSampleRate(this, spec->freq << 16, &outRate );
- rc = UADSetByteOrder(this, "LSB");
- rc = UADSetNumberFormat(this, "UNSIGNED");
- break;
- case AUDIO_U16MSB:
- success = 1;
- bitsPerSample = 16;
- rc = UADSetSampleRate(this, spec->freq << 16, &outRate );
- rc = UADSetByteOrder(this, "MSB");
- rc = UADSetNumberFormat(this, "UNSIGNED");
- break;
- default:
- break;
- }
- if ( ! success ) {
- test_format = SDL_NextAudioFormat();
- }
- }
- while ( ! success && test_format );
-
- if ( success == 0 ) {
- SDL_SetError("Couldn't find any hardware audio formats");
- return -1;
- }
-
- spec->format = test_format;
-
- for ( frag_spec = 0; (0x01<<frag_spec) < spec->size; ++frag_spec );
- if ( (0x01<<frag_spec) != spec->size ) {
- SDL_SetError("Fragment size must be a power of two");
- return -1;
- }
- if ( frag_spec > 2048 ) frag_spec = 2048;
-
- this->hidden->bytesPerSample = (bitsPerSample / 8) * spec->channels;
- samplesPerSec = this->hidden->bytesPerSample * outRate;
-
- this->hidden->playbuf._length = 0;
- this->hidden->playbuf._maximum = spec->size;
- this->hidden->playbuf._buffer = (unsigned char*)SDL_malloc(spec->size);
- this->hidden->fillbuf._length = 0;
- this->hidden->fillbuf._maximum = spec->size;
- this->hidden->fillbuf._buffer = (unsigned char*)SDL_malloc(spec->size);
-
- rc = UADSetBitsPerSample(this, bitsPerSample );
- rc = UADSetDMABufferSize(this, frag_spec, &outBufSize );
- rc = UADSetChannels(this, spec->channels); /* functions reduces to mono or stereo */
-
- lgain = 100; /*maximum left input gain*/
- rgain = 100; /*maimum right input gain*/
- rc = UADEnableOutput(this, "LINE_OUT",&lgain,&rgain);
- rc = UADInitialize(this);
- rc = UADStart(this);
- rc = UADSetVolume(this, 100);
- rc = UADSetBalance(this, 0);
-
- /* We're ready to rock and roll. :-) */
- return 0;
-}
-
-
-static UMSAudioDevice_ReturnCode UADGetBitsPerSample(_THIS, long* bits)
-{
- return UMSAudioDevice_get_bits_per_sample( this->hidden->umsdev,
- this->hidden->ev,
- bits );
-}
-
-static UMSAudioDevice_ReturnCode UADSetBitsPerSample(_THIS, long bits)
-{
- return UMSAudioDevice_set_bits_per_sample( this->hidden->umsdev,
- this->hidden->ev,
- bits );
-}
-
-static UMSAudioDevice_ReturnCode UADSetSampleRate(_THIS, long rate, long* set_rate)
-{
- /* from the mac code: sample rate = spec->freq << 16; */
- return UMSAudioDevice_set_sample_rate( this->hidden->umsdev,
- this->hidden->ev,
- rate,
- set_rate );
-}
-
-static UMSAudioDevice_ReturnCode UADSetByteOrder(_THIS, string byte_order)
-{
- return UMSAudioDevice_set_byte_order( this->hidden->umsdev,
- this->hidden->ev,
- byte_order );
-}
-
-static UMSAudioDevice_ReturnCode UADSetAudioFormatType(_THIS, string fmt)
-{
- /* possible PCM, A_LAW or MU_LAW */
- return UMSAudioDevice_set_audio_format_type( this->hidden->umsdev,
- this->hidden->ev,
- fmt );
-}
-
-static UMSAudioDevice_ReturnCode UADSetNumberFormat(_THIS, string fmt)
-{
- /* possible SIGNED, UNSIGNED, or TWOS_COMPLEMENT */
- return UMSAudioDevice_set_number_format( this->hidden->umsdev,
- this->hidden->ev,
- fmt );
-}
-
-static UMSAudioDevice_ReturnCode UADInitialize(_THIS)
-{
- return UMSAudioDevice_initialize( this->hidden->umsdev,
- this->hidden->ev );
-}
-
-static UMSAudioDevice_ReturnCode UADStart(_THIS)
-{
- return UMSAudioDevice_start( this->hidden->umsdev,
- this->hidden->ev );
-}
-
-static UMSAudioDevice_ReturnCode UADSetTimeFormat(_THIS, UMSAudioTypes_TimeFormat fmt )
-{
- /*
- * Switches the time format to the new format, immediately.
- * possible UMSAudioTypes_Msecs, UMSAudioTypes_Bytes or UMSAudioTypes_Samples
- */
- return UMSAudioDevice_set_time_format( this->hidden->umsdev,
- this->hidden->ev,
- fmt );
-}
-
-static UMSAudioDevice_ReturnCode UADWriteBuffSize(_THIS, long* buff_size )
-{
- /*
- * returns write buffer size in the current time format
- */
- return UMSAudioDevice_write_buff_size( this->hidden->umsdev,
- this->hidden->ev,
- buff_size );
-}
-
-static UMSAudioDevice_ReturnCode UADWriteBuffRemain(_THIS, long* buff_size )
-{
- /*
- * returns amount of available space in the write buffer
- * in the current time format
- */
- return UMSAudioDevice_write_buff_remain( this->hidden->umsdev,
- this->hidden->ev,
- buff_size );
-}
-
-static UMSAudioDevice_ReturnCode UADWriteBuffUsed(_THIS, long* buff_size )
-{
- /*
- * returns amount of filled space in the write buffer
- * in the current time format
- */
- return UMSAudioDevice_write_buff_used( this->hidden->umsdev,
- this->hidden->ev,
- buff_size );
-}
-
-static UMSAudioDevice_ReturnCode UADSetDMABufferSize(_THIS, long bytes, long* bytes_ret )
-{
- /*
- * Request a new DMA buffer size, maximum requested size 2048.
- * Takes effect with next initialize() call.
- * Devices may or may not support DMA.
- */
- return UMSAudioDevice_set_DMA_buffer_size( this->hidden->umsdev,
- this->hidden->ev,
- bytes,
- bytes_ret );
-}
-
-static UMSAudioDevice_ReturnCode UADSetVolume(_THIS, long volume )
-{
- /*
- * Set the volume.
- * Takes effect immediately.
- */
- return UMSAudioDevice_set_volume( this->hidden->umsdev,
- this->hidden->ev,
- volume );
-}
-
-static UMSAudioDevice_ReturnCode UADSetBalance(_THIS, long balance )
-{
- /*
- * Set the balance.
- * Takes effect immediately.
- */
- return UMSAudioDevice_set_balance( this->hidden->umsdev,
- this->hidden->ev,
- balance );
-}
-
-static UMSAudioDevice_ReturnCode UADSetChannels(_THIS, long channels )
-{
- /*
- * Set mono or stereo.
- * Takes effect with next initialize() call.
- */
- if ( channels != 1 ) channels = 2;
- return UMSAudioDevice_set_number_of_channels( this->hidden->umsdev,
- this->hidden->ev,
- channels );
-}
-
-static UMSAudioDevice_ReturnCode UADOpen(_THIS, string device, string mode, long flags)
-{
- return UMSAudioDevice_open( this->hidden->umsdev,
- this->hidden->ev,
- device,
- mode,
- flags );
-}
-
-static UMSAudioDevice_ReturnCode UADWrite(_THIS, UMSAudioTypes_Buffer* buff,
- long samples,
- long* samples_written)
-{
- return UMSAudioDevice_write( this->hidden->umsdev,
- this->hidden->ev,
- buff,
- samples,
- samples_written );
-}
-
-static UMSAudioDevice_ReturnCode UADPlayRemainingData(_THIS, boolean block )
-{
- return UMSAudioDevice_play_remaining_data( this->hidden->umsdev,
- this->hidden->ev,
- block);
-}
-
-static UMSAudioDevice_ReturnCode UADStop(_THIS)
-{
- return UMSAudioDevice_stop( this->hidden->umsdev,
- this->hidden->ev );
-}
-
-static UMSAudioDevice_ReturnCode UADClose(_THIS)
-{
- return UMSAudioDevice_close( this->hidden->umsdev,
- this->hidden->ev );
-}
-
-static UMSAudioDevice_ReturnCode UADEnableOutput(_THIS, string output, long* left_gain, long* right_gain)
-{
- return UMSAudioDevice_enable_output( this->hidden->umsdev,
- this->hidden->ev,
- output,
- left_gain,
- right_gain );
-}
-
diff --git a/distrib/sdl-1.2.12/src/audio/ums/SDL_umsaudio.h b/distrib/sdl-1.2.12/src/audio/ums/SDL_umsaudio.h
deleted file mode 100644
index 97410cc..0000000
--- a/distrib/sdl-1.2.12/src/audio/ums/SDL_umsaudio.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Carsten Griwodz
- griff@kom.tu-darmstadt.de
-
- based on linux/SDL_dspaudio.h by Sam Lantinga
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_UMSaudio_h
-#define _SDL_UMSaudio_h
-
-#include <UMS/UMSAudioDevice.h>
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_AudioDevice *this
-
-struct SDL_PrivateAudioData
-{
- /* Pointer to the (open) UMS audio device */
- Environment* ev;
- UMSAudioDevice umsdev;
-
- /* Raw mixing buffer */
- UMSAudioTypes_Buffer playbuf;
- UMSAudioTypes_Buffer fillbuf;
-
- long bytesPerSample;
-};
-
-#endif /* _SDL_UMSaudio_h */
-
diff --git a/distrib/sdl-1.2.12/src/audio/windib/SDL_dibaudio.c b/distrib/sdl-1.2.12/src/audio/windib/SDL_dibaudio.c
deleted file mode 100644
index 3a86126..0000000
--- a/distrib/sdl-1.2.12/src/audio/windib/SDL_dibaudio.c
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Allow access to a raw mixing buffer */
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <mmsystem.h>
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "SDL_dibaudio.h"
-#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
-#include "win_ce_semaphore.h"
-#endif
-
-
-/* Audio driver functions */
-static int DIB_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void DIB_ThreadInit(_THIS);
-static void DIB_WaitAudio(_THIS);
-static Uint8 *DIB_GetAudioBuf(_THIS);
-static void DIB_PlayAudio(_THIS);
-static void DIB_WaitDone(_THIS);
-static void DIB_CloseAudio(_THIS);
-
-int volatile dibaudio_thread_debug = 0;
-int volatile dibaudio_cb_debug = 0;
-int volatile dibaudio_main_debug = 0;
-
-/* Audio driver bootstrap functions */
-
-static int Audio_Available(void)
-{
- return(1);
-}
-
-static void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
- /* Set the function pointers */
- this->OpenAudio = DIB_OpenAudio;
- this->ThreadInit = DIB_ThreadInit;
- this->WaitAudio = DIB_WaitAudio;
- this->PlayAudio = DIB_PlayAudio;
- this->GetAudioBuf = DIB_GetAudioBuf;
- this->WaitDone = DIB_WaitDone;
- this->CloseAudio = DIB_CloseAudio;
-
- this->free = Audio_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap WAVEOUT_bootstrap = {
- "waveout", "Win95/98/NT/2000 WaveOut",
- Audio_Available, Audio_CreateDevice
-};
-
-
-/* The Win32 callback for filling the WAVE device */
-static void CALLBACK FillSound(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance,
- DWORD dwParam1, DWORD dwParam2)
-{
- SDL_AudioDevice *this = (SDL_AudioDevice *)dwInstance;
-
- /* Only service "buffer done playing" messages */
- if ( uMsg != WOM_DONE )
- return;
-
- /* Signal that we are done playing a buffer */
- dibaudio_cb_debug = 1;
- EnterCriticalSection( &audio_cs );
- dibaudio_cb_debug = 2;
- SetEvent( audio_event );
- dibaudio_cb_debug = 3;
- LeaveCriticalSection( &audio_cs );
- dibaudio_cb_debug = 4;
-}
-
-static void SetMMerror(char *function, MMRESULT code)
-{
- size_t len;
- char errbuf[MAXERRORLENGTH];
-#ifdef _WIN32_WCE
- wchar_t werrbuf[MAXERRORLENGTH];
-#endif
-
- SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: ", function);
- len = SDL_strlen(errbuf);
-
-#ifdef _WIN32_WCE
- /* UNICODE version */
- waveOutGetErrorText(code, werrbuf, MAXERRORLENGTH-len);
- WideCharToMultiByte(CP_ACP,0,werrbuf,-1,errbuf+len,MAXERRORLENGTH-len,NULL,NULL);
-#else
- waveOutGetErrorText(code, errbuf+len, (UINT)(MAXERRORLENGTH-len));
-#endif
-
- SDL_SetError("%s",errbuf);
-}
-
-/* Set high priority for the audio thread */
-static void DIB_ThreadInit(_THIS)
-{
- SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST);
-}
-
-void DIB_WaitAudio(_THIS)
-{
- /* Wait for an audio chunk to finish */
- dibaudio_thread_debug = 1;
- WaitForSingleObject(audio_event, INFINITE);
- dibaudio_thread_debug = 2;
- ResetEvent( audio_event );
- dibaudio_thread_debug = 3;
-}
-
-Uint8 *DIB_GetAudioBuf(_THIS)
-{
- Uint8 *retval;
-
- dibaudio_thread_debug = 4;
- EnterCriticalSection( &audio_cs );
- dibaudio_thread_debug = 5;
- retval = (Uint8 *)(wavebuf[next_buffer].lpData);
- return retval;
-}
-
-void DIB_PlayAudio(_THIS)
-{
- /* Queue it up */
- dibaudio_thread_debug = 6;
- waveOutWrite(sound, &wavebuf[next_buffer], sizeof(wavebuf[0]));
- dibaudio_thread_debug = 7;
- next_buffer = (next_buffer+1)%NUM_BUFFERS;
- LeaveCriticalSection( &audio_cs );
- dibaudio_thread_debug = 8;
-}
-
-void DIB_WaitDone(_THIS)
-{
- int i, left, tries = 5;
-
- dibaudio_thread_debug = 9;
-
- /* give some time for the wave output to send the last buffer,
- * but don't hang if one was cancelled
- */
- do {
- left = NUM_BUFFERS;
- for ( i=0; i<NUM_BUFFERS; ++i ) {
- if ( wavebuf[i].dwFlags & WHDR_DONE ) {
- --left;
- }
- }
- if ( left == 0 )
- break;
-
- SDL_Delay(100);
- } while ( --tries > 0 );
-
- dibaudio_thread_debug = 10;
-}
-
-void DIB_CloseAudio(_THIS)
-{
- int i;
-
- /* Close up audio */
- if ( audio_event != INVALID_HANDLE_VALUE ) {
-#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
- CloseSynchHandle(audio_event);
-#else
- CloseHandle(audio_event);
-#endif
- }
- if ( sound ) {
- waveOutReset(sound);
- }
-
- /* Clean up mixing buffers */
- for ( i=0; i<NUM_BUFFERS; ++i ) {
- if ( wavebuf[i].dwUser != 0xFFFF ) {
- waveOutUnprepareHeader(sound, &wavebuf[i],
- sizeof(wavebuf[i]));
- wavebuf[i].dwUser = 0xFFFF;
- }
- }
- /* Free raw mixing buffer */
- if ( mixbuf != NULL ) {
- SDL_free(mixbuf);
- mixbuf = NULL;
- }
-
- if ( sound )
- waveOutClose(sound);
-}
-
-int DIB_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- MMRESULT result;
- int i;
- WAVEFORMATEX waveformat;
-
- /* Initialize the wavebuf structures for closing */
- sound = NULL;
- InitializeCriticalSection( &audio_cs );
- audio_event = INVALID_HANDLE_VALUE;
- for ( i = 0; i < NUM_BUFFERS; ++i )
- wavebuf[i].dwUser = 0xFFFF;
- mixbuf = NULL;
-
- /* Set basic WAVE format parameters */
- SDL_memset(&waveformat, 0, sizeof(waveformat));
- waveformat.wFormatTag = WAVE_FORMAT_PCM;
-
- /* Determine the audio parameters from the AudioSpec */
- switch ( spec->format & 0xFF ) {
- case 8:
- /* Unsigned 8 bit audio data */
- spec->format = AUDIO_U8;
- waveformat.wBitsPerSample = 8;
- break;
- case 16:
- /* Signed 16 bit audio data */
- spec->format = AUDIO_S16;
- waveformat.wBitsPerSample = 16;
- break;
- default:
- SDL_SetError("Unsupported audio format");
- return(-1);
- }
- waveformat.nChannels = spec->channels;
- waveformat.nSamplesPerSec = spec->freq;
- waveformat.nBlockAlign =
- waveformat.nChannels * (waveformat.wBitsPerSample/8);
- waveformat.nAvgBytesPerSec =
- waveformat.nSamplesPerSec * waveformat.nBlockAlign;
-
- /* Check the buffer size -- minimum of 1/4 second (word aligned) */
- if ( spec->samples < (spec->freq/4) )
- spec->samples = ((spec->freq/4)+3)&~3;
-
- /* Update the fragment size as size in bytes */
- SDL_CalculateAudioSpec(spec);
-
- /* Open the audio device */
- result = waveOutOpen(&sound, WAVE_MAPPER, &waveformat,
- (DWORD_PTR)FillSound, (DWORD_PTR)this, CALLBACK_FUNCTION);
- if ( result != MMSYSERR_NOERROR ) {
- SetMMerror("waveOutOpen()", result);
- return(-1);
- }
-
-#ifdef SOUND_DEBUG
- /* Check the sound device we retrieved */
- {
- WAVEOUTCAPS caps;
-
- result = waveOutGetDevCaps((UINT)sound, &caps, sizeof(caps));
- if ( result != MMSYSERR_NOERROR ) {
- SetMMerror("waveOutGetDevCaps()", result);
- return(-1);
- }
- printf("Audio device: %s\n", caps.szPname);
- }
-#endif
-
- /* Create the audio buffer semaphore */
- audio_event = CreateEvent( NULL, TRUE, FALSE, NULL );
- if ( audio_event == NULL ) {
- SDL_SetError("Couldn't create semaphore");
- return(-1);
- }
-
- /* Create the sound buffers */
- mixbuf = (Uint8 *)SDL_malloc(NUM_BUFFERS*spec->size);
- if ( mixbuf == NULL ) {
- SDL_SetError("Out of memory");
- return(-1);
- }
- for ( i = 0; i < NUM_BUFFERS; ++i ) {
- SDL_memset(&wavebuf[i], 0, sizeof(wavebuf[i]));
- wavebuf[i].lpData = (LPSTR) &mixbuf[i*spec->size];
- wavebuf[i].dwBufferLength = spec->size;
- wavebuf[i].dwFlags = WHDR_DONE;
- result = waveOutPrepareHeader(sound, &wavebuf[i],
- sizeof(wavebuf[i]));
- if ( result != MMSYSERR_NOERROR ) {
- SetMMerror("waveOutPrepareHeader()", result);
- return(-1);
- }
- }
-
- /* Ready to go! */
- next_buffer = 0;
- return(0);
-}
diff --git a/distrib/sdl-1.2.12/src/audio/windib/SDL_dibaudio.h b/distrib/sdl-1.2.12/src/audio/windib/SDL_dibaudio.h
deleted file mode 100644
index d268aba..0000000
--- a/distrib/sdl-1.2.12/src/audio/windib/SDL_dibaudio.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_lowaudio_h
-#define _SDL_lowaudio_h
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_AudioDevice *this
-
-#define NUM_BUFFERS 2 /* -- Don't lower this! */
-
-struct SDL_PrivateAudioData {
- HWAVEOUT sound;
- CRITICAL_SECTION audio_cs;
- HANDLE audio_event;
- Uint8* mixbuf; /* The raw allocated mixing buffer */
- WAVEHDR wavebuf[NUM_BUFFERS]; /* Wave audio fragments */
- int cur_buffer;
- int next_buffer;
-};
-
-/* Old variable names */
-#define sound (this->hidden->sound)
-#define audio_event (this->hidden->audio_event)
-#define audio_cs (this->hidden->audio_cs)
-#define mixbuf (this->hidden->mixbuf)
-#define wavebuf (this->hidden->wavebuf)
-#define cur_buffer (this->hidden->cur_buffer)
-#define next_buffer (this->hidden->next_buffer)
-
-#endif /* _SDL_lowaudio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/windx5/SDL_dx5audio.c b/distrib/sdl-1.2.12/src/audio/windx5/SDL_dx5audio.c
deleted file mode 100644
index 26bd2e8..0000000
--- a/distrib/sdl-1.2.12/src/audio/windx5/SDL_dx5audio.c
+++ /dev/null
@@ -1,705 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Allow access to a raw mixing buffer */
-
-#include "SDL_timer.h"
-#include "SDL_audio.h"
-#include "../SDL_audio_c.h"
-#include "SDL_dx5audio.h"
-
-/* Define this if you want to use DirectX 6 DirectSoundNotify interface */
-//#define USE_POSITION_NOTIFY
-
-/* DirectX function pointers for audio */
-HRESULT (WINAPI *DSoundCreate)(LPGUID, LPDIRECTSOUND *, LPUNKNOWN);
-
-/* Audio driver functions */
-static int DX5_OpenAudio(_THIS, SDL_AudioSpec *spec);
-static void DX5_ThreadInit(_THIS);
-static void DX5_WaitAudio_BusyWait(_THIS);
-#ifdef USE_POSITION_NOTIFY
-static void DX6_WaitAudio_EventWait(_THIS);
-#endif
-static void DX5_PlayAudio(_THIS);
-static Uint8 *DX5_GetAudioBuf(_THIS);
-static void DX5_WaitDone(_THIS);
-static void DX5_CloseAudio(_THIS);
-
-/* Audio driver bootstrap functions */
-
-static int Audio_Available(void)
-{
- HINSTANCE DSoundDLL;
- int dsound_ok;
-
- /* Version check DSOUND.DLL (Is DirectX okay?) */
- dsound_ok = 0;
- DSoundDLL = LoadLibrary(TEXT("DSOUND.DLL"));
- if ( DSoundDLL != NULL ) {
- /* We just use basic DirectSound, we're okay */
- /* Yay! */
- /* Unfortunately, the sound drivers on NT have
- higher latencies than the audio buffers used
- by many SDL applications, so there are gaps
- in the audio - it sounds terrible. Punt for now.
- */
- OSVERSIONINFO ver;
- ver.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
- GetVersionEx(&ver);
- switch (ver.dwPlatformId) {
- case VER_PLATFORM_WIN32_NT:
- if ( ver.dwMajorVersion > 4 ) {
- /* Win2K */
- dsound_ok = 1;
- } else {
- /* WinNT */
- dsound_ok = 0;
- }
- break;
- default:
- /* Win95 or Win98 */
- dsound_ok = 1;
- break;
- }
- /* Now check for DirectX 5 or better - otherwise
- * we will fail later in DX5_OpenAudio without a chance
- * to fall back to the DIB driver. */
- if (dsound_ok) {
- /* DirectSoundCaptureCreate was added in DX5 */
- if (!GetProcAddress(DSoundDLL, TEXT("DirectSoundCaptureCreate")))
- dsound_ok = 0;
-
- }
- /* Clean up.. */
- FreeLibrary(DSoundDLL);
- }
- return(dsound_ok);
-}
-
-/* Functions for loading the DirectX functions dynamically */
-static HINSTANCE DSoundDLL = NULL;
-
-static void DX5_Unload(void)
-{
- if ( DSoundDLL != NULL ) {
- FreeLibrary(DSoundDLL);
- DSoundCreate = NULL;
- DSoundDLL = NULL;
- }
-}
-static int DX5_Load(void)
-{
- int status;
-
- DX5_Unload();
- DSoundDLL = LoadLibrary(TEXT("DSOUND.DLL"));
- if ( DSoundDLL != NULL ) {
- DSoundCreate = (void *)GetProcAddress(DSoundDLL,
- TEXT("DirectSoundCreate"));
- }
- if ( DSoundDLL && DSoundCreate ) {
- status = 0;
- } else {
- DX5_Unload();
- status = -1;
- }
- return status;
-}
-
-static void Audio_DeleteDevice(SDL_AudioDevice *device)
-{
- DX5_Unload();
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_AudioDevice *Audio_CreateDevice(int devindex)
-{
- SDL_AudioDevice *this;
-
- /* Load DirectX */
- if ( DX5_Load() < 0 ) {
- return(NULL);
- }
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateAudioData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
-
- /* Set the function pointers */
- this->OpenAudio = DX5_OpenAudio;
- this->ThreadInit = DX5_ThreadInit;
- this->WaitAudio = DX5_WaitAudio_BusyWait;
- this->PlayAudio = DX5_PlayAudio;
- this->GetAudioBuf = DX5_GetAudioBuf;
- this->WaitDone = DX5_WaitDone;
- this->CloseAudio = DX5_CloseAudio;
-
- this->free = Audio_DeleteDevice;
-
- return this;
-}
-
-AudioBootStrap DSOUND_bootstrap = {
- "dsound", "Win95/98/2000 DirectSound",
- Audio_Available, Audio_CreateDevice
-};
-
-static void SetDSerror(const char *function, int code)
-{
- static const char *error;
- static char errbuf[1024];
-
- errbuf[0] = 0;
- switch (code) {
- case E_NOINTERFACE:
- error =
- "Unsupported interface\n-- Is DirectX 5.0 or later installed?";
- break;
- case DSERR_ALLOCATED:
- error = "Audio device in use";
- break;
- case DSERR_BADFORMAT:
- error = "Unsupported audio format";
- break;
- case DSERR_BUFFERLOST:
- error = "Mixing buffer was lost";
- break;
- case DSERR_CONTROLUNAVAIL:
- error = "Control requested is not available";
- break;
- case DSERR_INVALIDCALL:
- error = "Invalid call for the current state";
- break;
- case DSERR_INVALIDPARAM:
- error = "Invalid parameter";
- break;
- case DSERR_NODRIVER:
- error = "No audio device found";
- break;
- case DSERR_OUTOFMEMORY:
- error = "Out of memory";
- break;
- case DSERR_PRIOLEVELNEEDED:
- error = "Caller doesn't have priority";
- break;
- case DSERR_UNSUPPORTED:
- error = "Function not supported";
- break;
- default:
- SDL_snprintf(errbuf, SDL_arraysize(errbuf),
- "%s: Unknown DirectSound error: 0x%x",
- function, code);
- break;
- }
- if ( ! errbuf[0] ) {
- SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: %s", function, error);
- }
- SDL_SetError("%s", errbuf);
- return;
-}
-
-/* DirectSound needs to be associated with a window */
-static HWND mainwin = NULL;
-/* */
-void DX5_SoundFocus(HWND hwnd)
-{
- mainwin = hwnd;
-}
-
-static void DX5_ThreadInit(_THIS)
-{
- SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST);
-}
-
-static void DX5_WaitAudio_BusyWait(_THIS)
-{
- DWORD status;
- DWORD cursor, junk;
- HRESULT result;
-
- /* Semi-busy wait, since we have no way of getting play notification
- on a primary mixing buffer located in hardware (DirectX 5.0)
- */
- result = IDirectSoundBuffer_GetCurrentPosition(mixbuf, &junk, &cursor);
- if ( result != DS_OK ) {
- if ( result == DSERR_BUFFERLOST ) {
- IDirectSoundBuffer_Restore(mixbuf);
- }
-#ifdef DEBUG_SOUND
- SetDSerror("DirectSound GetCurrentPosition", result);
-#endif
- return;
- }
-
- while ( (cursor/mixlen) == lastchunk ) {
- /* FIXME: find out how much time is left and sleep that long */
- SDL_Delay(1);
-
- /* Try to restore a lost sound buffer */
- IDirectSoundBuffer_GetStatus(mixbuf, &status);
- if ( (status&DSBSTATUS_BUFFERLOST) ) {
- IDirectSoundBuffer_Restore(mixbuf);
- IDirectSoundBuffer_GetStatus(mixbuf, &status);
- if ( (status&DSBSTATUS_BUFFERLOST) ) {
- break;
- }
- }
- if ( ! (status&DSBSTATUS_PLAYING) ) {
- result = IDirectSoundBuffer_Play(mixbuf, 0, 0, DSBPLAY_LOOPING);
- if ( result == DS_OK ) {
- continue;
- }
-#ifdef DEBUG_SOUND
- SetDSerror("DirectSound Play", result);
-#endif
- return;
- }
-
- /* Find out where we are playing */
- result = IDirectSoundBuffer_GetCurrentPosition(mixbuf,
- &junk, &cursor);
- if ( result != DS_OK ) {
- SetDSerror("DirectSound GetCurrentPosition", result);
- return;
- }
- }
-}
-
-#ifdef USE_POSITION_NOTIFY
-static void DX6_WaitAudio_EventWait(_THIS)
-{
- DWORD status;
- HRESULT result;
-
- /* Try to restore a lost sound buffer */
- IDirectSoundBuffer_GetStatus(mixbuf, &status);
- if ( (status&DSBSTATUS_BUFFERLOST) ) {
- IDirectSoundBuffer_Restore(mixbuf);
- IDirectSoundBuffer_GetStatus(mixbuf, &status);
- if ( (status&DSBSTATUS_BUFFERLOST) ) {
- return;
- }
- }
- if ( ! (status&DSBSTATUS_PLAYING) ) {
- result = IDirectSoundBuffer_Play(mixbuf, 0, 0, DSBPLAY_LOOPING);
- if ( result != DS_OK ) {
-#ifdef DEBUG_SOUND
- SetDSerror("DirectSound Play", result);
-#endif
- return;
- }
- }
- WaitForSingleObject(audio_event, INFINITE);
-}
-#endif /* USE_POSITION_NOTIFY */
-
-static void DX5_PlayAudio(_THIS)
-{
- /* Unlock the buffer, allowing it to play */
- if ( locked_buf ) {
- IDirectSoundBuffer_Unlock(mixbuf, locked_buf, mixlen, NULL, 0);
- }
-
-}
-
-static Uint8 *DX5_GetAudioBuf(_THIS)
-{
- DWORD cursor, junk;
- HRESULT result;
- DWORD rawlen;
-
- /* Figure out which blocks to fill next */
- locked_buf = NULL;
- result = IDirectSoundBuffer_GetCurrentPosition(mixbuf, &junk, &cursor);
- if ( result == DSERR_BUFFERLOST ) {
- IDirectSoundBuffer_Restore(mixbuf);
- result = IDirectSoundBuffer_GetCurrentPosition(mixbuf,
- &junk, &cursor);
- }
- if ( result != DS_OK ) {
- SetDSerror("DirectSound GetCurrentPosition", result);
- return(NULL);
- }
- cursor /= mixlen;
-#ifdef DEBUG_SOUND
- /* Detect audio dropouts */
- { DWORD spot = cursor;
- if ( spot < lastchunk ) {
- spot += NUM_BUFFERS;
- }
- if ( spot > lastchunk+1 ) {
- fprintf(stderr, "Audio dropout, missed %d fragments\n",
- (spot - (lastchunk+1)));
- }
- }
-#endif
- lastchunk = cursor;
- cursor = (cursor+1)%NUM_BUFFERS;
- cursor *= mixlen;
-
- /* Lock the audio buffer */
- result = IDirectSoundBuffer_Lock(mixbuf, cursor, mixlen,
- (LPVOID *)&locked_buf, &rawlen, NULL, &junk, 0);
- if ( result == DSERR_BUFFERLOST ) {
- IDirectSoundBuffer_Restore(mixbuf);
- result = IDirectSoundBuffer_Lock(mixbuf, cursor, mixlen,
- (LPVOID *)&locked_buf, &rawlen, NULL, &junk, 0);
- }
- if ( result != DS_OK ) {
- SetDSerror("DirectSound Lock", result);
- return(NULL);
- }
- return(locked_buf);
-}
-
-static void DX5_WaitDone(_THIS)
-{
- Uint8 *stream;
-
- /* Wait for the playing chunk to finish */
- stream = this->GetAudioBuf(this);
- if ( stream != NULL ) {
- SDL_memset(stream, silence, mixlen);
- this->PlayAudio(this);
- }
- this->WaitAudio(this);
-
- /* Stop the looping sound buffer */
- IDirectSoundBuffer_Stop(mixbuf);
-}
-
-static void DX5_CloseAudio(_THIS)
-{
- if ( sound != NULL ) {
- if ( mixbuf != NULL ) {
- /* Clean up the audio buffer */
- IDirectSoundBuffer_Release(mixbuf);
- mixbuf = NULL;
- }
- if ( audio_event != NULL ) {
- CloseHandle(audio_event);
- audio_event = NULL;
- }
- IDirectSound_Release(sound);
- sound = NULL;
- }
-}
-
-#ifdef USE_PRIMARY_BUFFER
-/* This function tries to create a primary audio buffer, and returns the
- number of audio chunks available in the created buffer.
-*/
-static int CreatePrimary(LPDIRECTSOUND sndObj, HWND focus,
- LPDIRECTSOUNDBUFFER *sndbuf, WAVEFORMATEX *wavefmt, Uint32 chunksize)
-{
- HRESULT result;
- DSBUFFERDESC format;
- DSBCAPS caps;
- int numchunks;
-
- /* Try to set primary mixing privileges */
- result = IDirectSound_SetCooperativeLevel(sndObj, focus,
- DSSCL_WRITEPRIMARY);
- if ( result != DS_OK ) {
-#ifdef DEBUG_SOUND
- SetDSerror("DirectSound SetCooperativeLevel", result);
-#endif
- return(-1);
- }
-
- /* Try to create the primary buffer */
- SDL_memset(&format, 0, sizeof(format));
- format.dwSize = sizeof(format);
- format.dwFlags=(DSBCAPS_PRIMARYBUFFER|DSBCAPS_GETCURRENTPOSITION2);
- format.dwFlags |= DSBCAPS_STICKYFOCUS;
-#ifdef USE_POSITION_NOTIFY
- format.dwFlags |= DSBCAPS_CTRLPOSITIONNOTIFY;
-#endif
- result = IDirectSound_CreateSoundBuffer(sndObj, &format, sndbuf, NULL);
- if ( result != DS_OK ) {
-#ifdef DEBUG_SOUND
- SetDSerror("DirectSound CreateSoundBuffer", result);
-#endif
- return(-1);
- }
-
- /* Check the size of the fragment buffer */
- SDL_memset(&caps, 0, sizeof(caps));
- caps.dwSize = sizeof(caps);
- result = IDirectSoundBuffer_GetCaps(*sndbuf, &caps);
- if ( result != DS_OK ) {
-#ifdef DEBUG_SOUND
- SetDSerror("DirectSound GetCaps", result);
-#endif
- IDirectSoundBuffer_Release(*sndbuf);
- return(-1);
- }
- if ( (chunksize > caps.dwBufferBytes) ||
- ((caps.dwBufferBytes%chunksize) != 0) ) {
- /* The primary buffer size is not a multiple of 'chunksize'
- -- this hopefully doesn't happen when 'chunksize' is a
- power of 2.
- */
- IDirectSoundBuffer_Release(*sndbuf);
- SDL_SetError(
-"Primary buffer size is: %d, cannot break it into chunks of %d bytes\n",
- caps.dwBufferBytes, chunksize);
- return(-1);
- }
- numchunks = (caps.dwBufferBytes/chunksize);
-
- /* Set the primary audio format */
- result = IDirectSoundBuffer_SetFormat(*sndbuf, wavefmt);
- if ( result != DS_OK ) {
-#ifdef DEBUG_SOUND
- SetDSerror("DirectSound SetFormat", result);
-#endif
- IDirectSoundBuffer_Release(*sndbuf);
- return(-1);
- }
- return(numchunks);
-}
-#endif /* USE_PRIMARY_BUFFER */
-
-/* This function tries to create a secondary audio buffer, and returns the
- number of audio chunks available in the created buffer.
-*/
-static int CreateSecondary(LPDIRECTSOUND sndObj, HWND focus,
- LPDIRECTSOUNDBUFFER *sndbuf, WAVEFORMATEX *wavefmt, Uint32 chunksize)
-{
- const int numchunks = 8;
- HRESULT result;
- DSBUFFERDESC format;
- LPVOID pvAudioPtr1, pvAudioPtr2;
- DWORD dwAudioBytes1, dwAudioBytes2;
-
- /* Try to set primary mixing privileges */
- if ( focus ) {
- result = IDirectSound_SetCooperativeLevel(sndObj,
- focus, DSSCL_PRIORITY);
- } else {
- result = IDirectSound_SetCooperativeLevel(sndObj,
- GetDesktopWindow(), DSSCL_NORMAL);
- }
- if ( result != DS_OK ) {
-#ifdef DEBUG_SOUND
- SetDSerror("DirectSound SetCooperativeLevel", result);
-#endif
- return(-1);
- }
-
- /* Try to create the secondary buffer */
- SDL_memset(&format, 0, sizeof(format));
- format.dwSize = sizeof(format);
- format.dwFlags = DSBCAPS_GETCURRENTPOSITION2;
-#ifdef USE_POSITION_NOTIFY
- format.dwFlags |= DSBCAPS_CTRLPOSITIONNOTIFY;
-#endif
- if ( ! focus ) {
- format.dwFlags |= DSBCAPS_GLOBALFOCUS;
- } else {
- format.dwFlags |= DSBCAPS_STICKYFOCUS;
- }
- format.dwBufferBytes = numchunks*chunksize;
- if ( (format.dwBufferBytes < DSBSIZE_MIN) ||
- (format.dwBufferBytes > DSBSIZE_MAX) ) {
- SDL_SetError("Sound buffer size must be between %d and %d",
- DSBSIZE_MIN/numchunks, DSBSIZE_MAX/numchunks);
- return(-1);
- }
- format.dwReserved = 0;
- format.lpwfxFormat = wavefmt;
- result = IDirectSound_CreateSoundBuffer(sndObj, &format, sndbuf, NULL);
- if ( result != DS_OK ) {
- SetDSerror("DirectSound CreateSoundBuffer", result);
- return(-1);
- }
- IDirectSoundBuffer_SetFormat(*sndbuf, wavefmt);
-
- /* Silence the initial audio buffer */
- result = IDirectSoundBuffer_Lock(*sndbuf, 0, format.dwBufferBytes,
- (LPVOID *)&pvAudioPtr1, &dwAudioBytes1,
- (LPVOID *)&pvAudioPtr2, &dwAudioBytes2,
- DSBLOCK_ENTIREBUFFER);
- if ( result == DS_OK ) {
- if ( wavefmt->wBitsPerSample == 8 ) {
- SDL_memset(pvAudioPtr1, 0x80, dwAudioBytes1);
- } else {
- SDL_memset(pvAudioPtr1, 0x00, dwAudioBytes1);
- }
- IDirectSoundBuffer_Unlock(*sndbuf,
- (LPVOID)pvAudioPtr1, dwAudioBytes1,
- (LPVOID)pvAudioPtr2, dwAudioBytes2);
- }
-
- /* We're ready to go */
- return(numchunks);
-}
-
-/* This function tries to set position notify events on the mixing buffer */
-#ifdef USE_POSITION_NOTIFY
-static int CreateAudioEvent(_THIS)
-{
- LPDIRECTSOUNDNOTIFY notify;
- DSBPOSITIONNOTIFY *notify_positions;
- int i, retval;
- HRESULT result;
-
- /* Default to fail on exit */
- retval = -1;
- notify = NULL;
-
- /* Query for the interface */
- result = IDirectSoundBuffer_QueryInterface(mixbuf,
- &IID_IDirectSoundNotify, (void *)&notify);
- if ( result != DS_OK ) {
- goto done;
- }
-
- /* Allocate the notify structures */
- notify_positions = (DSBPOSITIONNOTIFY *)SDL_malloc(NUM_BUFFERS*
- sizeof(*notify_positions));
- if ( notify_positions == NULL ) {
- goto done;
- }
-
- /* Create the notify event */
- audio_event = CreateEvent(NULL, FALSE, FALSE, NULL);
- if ( audio_event == NULL ) {
- goto done;
- }
-
- /* Set up the notify structures */
- for ( i=0; i<NUM_BUFFERS; ++i ) {
- notify_positions[i].dwOffset = i*mixlen;
- notify_positions[i].hEventNotify = audio_event;
- }
- result = IDirectSoundNotify_SetNotificationPositions(notify,
- NUM_BUFFERS, notify_positions);
- if ( result == DS_OK ) {
- retval = 0;
- }
-done:
- if ( notify != NULL ) {
- IDirectSoundNotify_Release(notify);
- }
- return(retval);
-}
-#endif /* USE_POSITION_NOTIFY */
-
-static int DX5_OpenAudio(_THIS, SDL_AudioSpec *spec)
-{
- HRESULT result;
- WAVEFORMATEX waveformat;
-
- /* Set basic WAVE format parameters */
- SDL_memset(&waveformat, 0, sizeof(waveformat));
- waveformat.wFormatTag = WAVE_FORMAT_PCM;
-
- /* Determine the audio parameters from the AudioSpec */
- switch ( spec->format & 0xFF ) {
- case 8:
- /* Unsigned 8 bit audio data */
- spec->format = AUDIO_U8;
- silence = 0x80;
- waveformat.wBitsPerSample = 8;
- break;
- case 16:
- /* Signed 16 bit audio data */
- spec->format = AUDIO_S16;
- silence = 0x00;
- waveformat.wBitsPerSample = 16;
- break;
- default:
- SDL_SetError("Unsupported audio format");
- return(-1);
- }
- waveformat.nChannels = spec->channels;
- waveformat.nSamplesPerSec = spec->freq;
- waveformat.nBlockAlign =
- waveformat.nChannels * (waveformat.wBitsPerSample/8);
- waveformat.nAvgBytesPerSec =
- waveformat.nSamplesPerSec * waveformat.nBlockAlign;
-
- /* Update the fragment size as size in bytes */
- SDL_CalculateAudioSpec(spec);
-
- /* Open the audio device */
- result = DSoundCreate(NULL, &sound, NULL);
- if ( result != DS_OK ) {
- SetDSerror("DirectSoundCreate", result);
- return(-1);
- }
-
- /* Create the audio buffer to which we write */
- NUM_BUFFERS = -1;
-#ifdef USE_PRIMARY_BUFFER
- if ( mainwin ) {
- NUM_BUFFERS = CreatePrimary(sound, mainwin, &mixbuf,
- &waveformat, spec->size);
- }
-#endif /* USE_PRIMARY_BUFFER */
- if ( NUM_BUFFERS < 0 ) {
- NUM_BUFFERS = CreateSecondary(sound, mainwin, &mixbuf,
- &waveformat, spec->size);
- if ( NUM_BUFFERS < 0 ) {
- return(-1);
- }
-#ifdef DEBUG_SOUND
- fprintf(stderr, "Using secondary audio buffer\n");
-#endif
- }
-#ifdef DEBUG_SOUND
- else
- fprintf(stderr, "Using primary audio buffer\n");
-#endif
-
- /* The buffer will auto-start playing in DX5_WaitAudio() */
- lastchunk = 0;
- mixlen = spec->size;
-
-#ifdef USE_POSITION_NOTIFY
- /* See if we can use DirectX 6 event notification */
- if ( CreateAudioEvent(this) == 0 ) {
- this->WaitAudio = DX6_WaitAudio_EventWait;
- } else {
- this->WaitAudio = DX5_WaitAudio_BusyWait;
- }
-#endif
- return(0);
-}
-
diff --git a/distrib/sdl-1.2.12/src/audio/windx5/SDL_dx5audio.h b/distrib/sdl-1.2.12/src/audio/windx5/SDL_dx5audio.h
deleted file mode 100644
index eebdf6d..0000000
--- a/distrib/sdl-1.2.12/src/audio/windx5/SDL_dx5audio.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_lowaudio_h
-#define _SDL_lowaudio_h
-
-#include "directx.h"
-
-#include "../SDL_sysaudio.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_AudioDevice *this
-
-/* The DirectSound objects */
-struct SDL_PrivateAudioData {
- LPDIRECTSOUND sound;
- LPDIRECTSOUNDBUFFER mixbuf;
- int NUM_BUFFERS;
- int mixlen, silence;
- DWORD lastchunk;
- Uint8 *locked_buf;
- HANDLE audio_event;
-};
-
-/* Old variable names */
-#define sound (this->hidden->sound)
-#define mixbuf (this->hidden->mixbuf)
-#define NUM_BUFFERS (this->hidden->NUM_BUFFERS)
-#define mixlen (this->hidden->mixlen)
-#define silence (this->hidden->silence)
-#define lastchunk (this->hidden->lastchunk)
-#define locked_buf (this->hidden->locked_buf)
-#define audio_event (this->hidden->audio_event)
-
-#endif /* _SDL_lowaudio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/windx5/directx.h b/distrib/sdl-1.2.12/src/audio/windx5/directx.h
deleted file mode 100644
index d14d6c6..0000000
--- a/distrib/sdl-1.2.12/src/audio/windx5/directx.h
+++ /dev/null
@@ -1,84 +0,0 @@
-
-#ifndef _directx_h
-#define _directx_h
-
-/* Include all of the DirectX 5.0 headers and adds any necessary tweaks */
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <mmsystem.h>
-#ifndef WIN32
-#define WIN32
-#endif
-#undef WINNT
-
-/* Far pointers don't exist in 32-bit code */
-#ifndef FAR
-#define FAR
-#endif
-
-/* Error codes not yet included in Win32 API header files */
-#ifndef MAKE_HRESULT
-#define MAKE_HRESULT(sev,fac,code) \
- ((HRESULT)(((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))))
-#endif
-
-#ifndef S_OK
-#define S_OK (HRESULT)0x00000000L
-#endif
-
-#ifndef SUCCEEDED
-#define SUCCEEDED(x) ((HRESULT)(x) >= 0)
-#endif
-#ifndef FAILED
-#define FAILED(x) ((HRESULT)(x)<0)
-#endif
-
-#ifndef E_FAIL
-#define E_FAIL (HRESULT)0x80000008L
-#endif
-#ifndef E_NOINTERFACE
-#define E_NOINTERFACE (HRESULT)0x80004002L
-#endif
-#ifndef E_OUTOFMEMORY
-#define E_OUTOFMEMORY (HRESULT)0x8007000EL
-#endif
-#ifndef E_INVALIDARG
-#define E_INVALIDARG (HRESULT)0x80070057L
-#endif
-#ifndef E_NOTIMPL
-#define E_NOTIMPL (HRESULT)0x80004001L
-#endif
-#ifndef REGDB_E_CLASSNOTREG
-#define REGDB_E_CLASSNOTREG (HRESULT)0x80040154L
-#endif
-
-/* Severity codes */
-#ifndef SEVERITY_ERROR
-#define SEVERITY_ERROR 1
-#endif
-
-/* Error facility codes */
-#ifndef FACILITY_WIN32
-#define FACILITY_WIN32 7
-#endif
-
-#ifndef FIELD_OFFSET
-#define FIELD_OFFSET(type, field) ((LONG)&(((type *)0)->field))
-#endif
-
-/* DirectX headers (if it isn't included, I haven't tested it yet)
- */
-/* We need these defines to mark what version of DirectX API we use */
-#define DIRECTDRAW_VERSION 0x0700
-#define DIRECTSOUND_VERSION 0x0500
-#define DIRECTINPUT_VERSION 0x0500
-
-#ifdef __GNUC__
-#define NONAMELESSUNION
-#endif
-#include <ddraw.h>
-#include <dsound.h>
-#include <dinput.h>
-
-#endif /* _directx_h */
diff --git a/distrib/sdl-1.2.12/src/cdrom/SDL_cdrom.c b/distrib/sdl-1.2.12/src/cdrom/SDL_cdrom.c
deleted file mode 100644
index e842b5a..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/SDL_cdrom.c
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This is the CD-audio control API for Simple DirectMedia Layer */
-
-#include "SDL_cdrom.h"
-#include "SDL_syscdrom.h"
-
-#if !defined(__MACOS__)
-#define CLIP_FRAMES 10 /* Some CD-ROMs won't go all the way */
-#endif
-
-static int SDL_cdinitted = 0;
-static SDL_CD *default_cdrom;
-
-/* The system level CD-ROM control functions */
-struct CDcaps SDL_CDcaps = {
- NULL, /* Name */
- NULL, /* Open */
- NULL, /* GetTOC */
- NULL, /* Status */
- NULL, /* Play */
- NULL, /* Pause */
- NULL, /* Resume */
- NULL, /* Stop */
- NULL, /* Eject */
- NULL, /* Close */
-};
-int SDL_numcds;
-
-int SDL_CDROMInit(void)
-{
- int retval;
-
- SDL_numcds = 0;
- retval = SDL_SYS_CDInit();
- if ( retval == 0 ) {
- SDL_cdinitted = 1;
- }
- default_cdrom = NULL;
- return(retval);
-}
-
-/* Check to see if the CD-ROM subsystem has been initialized */
-static int CheckInit(int check_cdrom, SDL_CD **cdrom)
-{
- int okay;
-
- okay = SDL_cdinitted;
- if ( check_cdrom && (*cdrom == NULL) ) {
- *cdrom = default_cdrom;
- if ( *cdrom == NULL ) {
- SDL_SetError("CD-ROM not opened");
- okay = 0;
- }
- }
- if ( ! SDL_cdinitted ) {
- SDL_SetError("CD-ROM subsystem not initialized");
- }
- return(okay);
-}
-
-int SDL_CDNumDrives(void)
-{
- if ( ! CheckInit(0, NULL) ) {
- return(-1);
- }
- return(SDL_numcds);
-}
-
-const char *SDL_CDName(int drive)
-{
- if ( ! CheckInit(0, NULL) ) {
- return(NULL);
- }
- if ( drive >= SDL_numcds ) {
- SDL_SetError("Invalid CD-ROM drive index");
- return(NULL);
- }
- if ( SDL_CDcaps.Name ) {
- return(SDL_CDcaps.Name(drive));
- } else {
- return("");
- }
-}
-
-SDL_CD *SDL_CDOpen(int drive)
-{
- struct SDL_CD *cdrom;
-
- if ( ! CheckInit(0, NULL) ) {
- return(NULL);
- }
- if ( drive >= SDL_numcds ) {
- SDL_SetError("Invalid CD-ROM drive index");
- return(NULL);
- }
- cdrom = (SDL_CD *)SDL_malloc(sizeof(*cdrom));
- if ( cdrom == NULL ) {
- SDL_OutOfMemory();
- return(NULL);
- }
- SDL_memset(cdrom, 0, sizeof(*cdrom));
- cdrom->id = SDL_CDcaps.Open(drive);
- if ( cdrom->id < 0 ) {
- SDL_free(cdrom);
- return(NULL);
- }
- default_cdrom = cdrom;
- return(cdrom);
-}
-
-CDstatus SDL_CDStatus(SDL_CD *cdrom)
-{
- CDstatus status;
- int i;
- Uint32 position;
-
- /* Check if the CD-ROM subsystem has been initialized */
- if ( ! CheckInit(1, &cdrom) ) {
- return(CD_ERROR);
- }
-
- /* Get the current status of the drive */
- cdrom->numtracks = 0;
- cdrom->cur_track = 0;
- cdrom->cur_frame = 0;
- status = SDL_CDcaps.Status(cdrom, &i);
- position = (Uint32)i;
- cdrom->status = status;
-
- /* Get the table of contents, if there's a CD available */
- if ( CD_INDRIVE(status) ) {
- if ( SDL_CDcaps.GetTOC(cdrom) < 0 ) {
- status = CD_ERROR;
- }
- /* If the drive is playing, get current play position */
- if ( (status == CD_PLAYING) || (status == CD_PAUSED) ) {
- for ( i=1; cdrom->track[i].offset <= position; ++i ) {
- /* Keep looking */;
- }
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Current position: %d, track = %d (offset is %d)\n",
- position, i-1, cdrom->track[i-1].offset);
-#endif
- cdrom->cur_track = i-1;
- position -= cdrom->track[cdrom->cur_track].offset;
- cdrom->cur_frame = position;
- }
- }
- return(status);
-}
-
-int SDL_CDPlayTracks(SDL_CD *cdrom,
- int strack, int sframe, int ntracks, int nframes)
-{
- int etrack, eframe;
- int start, length;
-
- /* Check if the CD-ROM subsystem has been initialized */
- if ( ! CheckInit(1, &cdrom) ) {
- return(CD_ERROR);
- }
-
- /* Determine the starting and ending tracks */
- if ( (strack < 0) || (strack >= cdrom->numtracks) ) {
- SDL_SetError("Invalid starting track");
- return(CD_ERROR);
- }
- if ( ! ntracks && ! nframes ) {
- etrack = cdrom->numtracks;
- eframe = 0;
- } else {
- etrack = strack+ntracks;
- if ( etrack == strack ) {
- eframe = sframe + nframes;
- } else {
- eframe = nframes;
- }
- }
- if ( etrack > cdrom->numtracks ) {
- SDL_SetError("Invalid play length");
- return(CD_ERROR);
- }
-
- /* Skip data tracks and verify frame offsets */
- while ( (strack <= etrack) &&
- (cdrom->track[strack].type == SDL_DATA_TRACK) ) {
- ++strack;
- }
- if ( sframe >= (int)cdrom->track[strack].length ) {
- SDL_SetError("Invalid starting frame for track %d", strack);
- return(CD_ERROR);
- }
- while ( (etrack > strack) &&
- (cdrom->track[etrack-1].type == SDL_DATA_TRACK) ) {
- --etrack;
- }
- if ( eframe > (int)cdrom->track[etrack].length ) {
- SDL_SetError("Invalid ending frame for track %d", etrack);
- return(CD_ERROR);
- }
-
- /* Determine start frame and play length */
- start = (cdrom->track[strack].offset+sframe);
- length = (cdrom->track[etrack].offset+eframe)-start;
-#ifdef CLIP_FRAMES
- /* I've never seen this necessary, but xmcd does it.. */
- length -= CLIP_FRAMES; /* CLIP_FRAMES == 10 */
-#endif
- if ( length < 0 ) {
- return(0);
- }
-
- /* Play! */
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Playing %d frames at offset %d\n", length, start);
-#endif
- return(SDL_CDcaps.Play(cdrom, start, length));
-}
-
-int SDL_CDPlay(SDL_CD *cdrom, int sframe, int length)
-{
- /* Check if the CD-ROM subsystem has been initialized */
- if ( ! CheckInit(1, &cdrom) ) {
- return(CD_ERROR);
- }
-
- return(SDL_CDcaps.Play(cdrom, sframe, length));
-}
-
-int SDL_CDPause(SDL_CD *cdrom)
-{
- CDstatus status;
- int retval;
-
- /* Check if the CD-ROM subsystem has been initialized */
- if ( ! CheckInit(1, &cdrom) ) {
- return(CD_ERROR);
- }
-
- status = SDL_CDcaps.Status(cdrom, NULL);
- switch (status) {
- case CD_PLAYING:
- retval = SDL_CDcaps.Pause(cdrom);
- break;
- default:
- retval = 0;
- break;
- }
- return(retval);
-}
-
-int SDL_CDResume(SDL_CD *cdrom)
-{
- CDstatus status;
- int retval;
-
- /* Check if the CD-ROM subsystem has been initialized */
- if ( ! CheckInit(1, &cdrom) ) {
- return(CD_ERROR);
- }
-
- status = SDL_CDcaps.Status(cdrom, NULL);
- switch (status) {
- case CD_PAUSED:
- retval = SDL_CDcaps.Resume(cdrom);
- default:
- retval = 0;
- break;
- }
- return(retval);
-}
-
-int SDL_CDStop(SDL_CD *cdrom)
-{
- CDstatus status;
- int retval;
-
- /* Check if the CD-ROM subsystem has been initialized */
- if ( ! CheckInit(1, &cdrom) ) {
- return(CD_ERROR);
- }
-
- status = SDL_CDcaps.Status(cdrom, NULL);
- switch (status) {
- case CD_PLAYING:
- case CD_PAUSED:
- retval = SDL_CDcaps.Stop(cdrom);
- default:
- retval = 0;
- break;
- }
- return(retval);
-}
-
-int SDL_CDEject(SDL_CD *cdrom)
-{
- /* Check if the CD-ROM subsystem has been initialized */
- if ( ! CheckInit(1, &cdrom) ) {
- return(CD_ERROR);
- }
- return(SDL_CDcaps.Eject(cdrom));
-}
-
-void SDL_CDClose(SDL_CD *cdrom)
-{
- /* Check if the CD-ROM subsystem has been initialized */
- if ( ! CheckInit(1, &cdrom) ) {
- return;
- }
- SDL_CDcaps.Close(cdrom);
- SDL_free(cdrom);
- default_cdrom = NULL;
-}
-
-void SDL_CDROMQuit(void)
-{
- SDL_SYS_CDQuit();
- SDL_cdinitted = 0;
-}
diff --git a/distrib/sdl-1.2.12/src/cdrom/SDL_syscdrom.h b/distrib/sdl-1.2.12/src/cdrom/SDL_syscdrom.h
deleted file mode 100644
index b51e07b..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/SDL_syscdrom.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is SDL_free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This is the system specific header for the SDL CD-ROM API */
-
-/* Structure of CD audio control functions */
-extern struct CDcaps {
- /* Get the name of the specified drive */
- const char *(*Name)(int drive);
-
- /* Open the specified drive, returning a drive id, or -1 on error */
- int (*Open)(int drive);
-
- /* Get table-of-contents (number of tracks + track info) for disk.
- The TOC information should be stored in the cdrom structure.
- This function should return 0 on success, or -1 on error.
- */
- int (*GetTOC)(SDL_CD *cdrom);
-
- /* Return the current status and play position, in frames, of the
- drive. 'position' may be NULL, and if so, should be ignored.
- */
- CDstatus (*Status)(SDL_CD *cdrom, int *position);
-
- /* Play from frame 'start' to 'start+len' */
- int (*Play)(SDL_CD *cdrom, int start, int len);
-
- /* Pause play */
- int (*Pause)(SDL_CD *cdrom);
-
- /* Resume play */
- int (*Resume)(SDL_CD *cdrom);
-
- /* Stop play */
- int (*Stop)(SDL_CD *cdrom);
-
- /* Eject the current disk */
- int (*Eject)(SDL_CD *cdrom);
-
- /* Close the specified drive */
- void (*Close)(SDL_CD *cdrom);
-} SDL_CDcaps;
-
-/* The number of available CD-ROM drives on the system */
-extern int SDL_numcds;
-
-/* Function to scan the system for CD-ROM drives and fill SDL_CDcaps.
- * This function should set SDL_numcds to the number of available CD
- * drives. Drive 0 should be the system default CD-ROM.
- * It should return 0, or -1 on an unrecoverable fatal error.
-*/
-extern int SDL_SYS_CDInit(void);
-
-/* Function to perform any system-specific CD-ROM related cleanup */
-extern void SDL_SYS_CDQuit(void);
-
diff --git a/distrib/sdl-1.2.12/src/cdrom/aix/SDL_syscdrom.c b/distrib/sdl-1.2.12/src/cdrom/aix/SDL_syscdrom.c
deleted file mode 100644
index 41f23a9..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/aix/SDL_syscdrom.c
+++ /dev/null
@@ -1,660 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Carsten Griwodz
- griff@kom.tu-darmstadt.de
-
- based on linux/SDL_syscdrom.c by Sam Lantinga
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_CDROM_AIX
-
-/* Functions for system-level CD-ROM audio control */
-
-/*#define DEBUG_CDROM 1*/
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <unistd.h>
-
-#include <sys/ioctl.h>
-#include <sys/devinfo.h>
-#include <sys/mntctl.h>
-#include <sys/statfs.h>
-#include <sys/vmount.h>
-#include <fstab.h>
-#include <sys/scdisk.h>
-
-#include "SDL_cdrom.h"
-#include "../SDL_syscdrom.h"
-
-/* The maximum number of CD-ROM drives we'll detect */
-#define MAX_DRIVES 16
-
-/* A list of available CD-ROM drives */
-static char *SDL_cdlist[MAX_DRIVES];
-static dev_t SDL_cdmode[MAX_DRIVES];
-
-/* The system-dependent CD control functions */
-static const char *SDL_SYS_CDName(int drive);
-static int SDL_SYS_CDOpen(int drive);
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
-static int SDL_SYS_CDPause(SDL_CD *cdrom);
-static int SDL_SYS_CDResume(SDL_CD *cdrom);
-static int SDL_SYS_CDStop(SDL_CD *cdrom);
-static int SDL_SYS_CDEject(SDL_CD *cdrom);
-static void SDL_SYS_CDClose(SDL_CD *cdrom);
-static int SDL_SYS_CDioctl(int id, int command, void *arg);
-
-/* Check a drive to see if it is a CD-ROM */
-static int CheckDrive(char *drive, struct stat *stbuf)
-{
- int is_cd;
- int cdfd;
- int ret;
- struct devinfo info;
-
- /* If it doesn't exist, return -1 */
- if ( stat(drive, stbuf) < 0 ) {
- return -1;
- }
-
- /* If it does exist, verify that it's an available CD-ROM */
- is_cd = 0;
- if ( S_ISCHR(stbuf->st_mode) || S_ISBLK(stbuf->st_mode) ) {
- cdfd = open(drive, (O_RDONLY|O_EXCL|O_NONBLOCK), 0);
- if ( cdfd >= 0 ) {
- ret = SDL_SYS_CDioctl( cdfd, IOCINFO, &info );
- if ( ret < 0 ) {
- /* Some kind of error */
- is_cd = 0;
- } else {
- if ( info.devtype == DD_CDROM ) {
- is_cd = 1;
- } else {
- is_cd = 0;
- }
- }
- close(cdfd);
- }
-#ifdef DEBUG_CDROM
- else
- {
- fprintf(stderr, "Could not open drive %s (%s)\n", drive, strerror(errno));
- }
-#endif
- }
- return is_cd;
-}
-
-/* Add a CD-ROM drive to our list of valid drives */
-static void AddDrive(char *drive, struct stat *stbuf)
-{
- int i;
-
- if ( SDL_numcds < MAX_DRIVES ) {
- /* Check to make sure it's not already in our list.
- This can happen when we see a drive via symbolic link.
- */
- for ( i=0; i<SDL_numcds; ++i ) {
- if ( stbuf->st_rdev == SDL_cdmode[i] ) {
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Duplicate drive detected: %s == %s\n", drive, SDL_cdlist[i]);
-#endif
- return;
- }
- }
-
- /* Add this drive to our list */
- i = SDL_numcds;
- SDL_cdlist[i] = SDL_strdup(drive);
- if ( SDL_cdlist[i] == NULL ) {
- SDL_OutOfMemory();
- return;
- }
- SDL_cdmode[i] = stbuf->st_rdev;
- ++SDL_numcds;
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Added CD-ROM drive: %s\n", drive);
-#endif
- }
-}
-
-static void CheckMounts()
-{
- char* buffer;
- int bufsz;
- struct vmount* ptr;
- int ret;
-
- buffer = (char*)SDL_malloc(10);
- bufsz = 10;
- if ( buffer==NULL )
- {
- fprintf(stderr, "Could not allocate 10 bytes in aix/SDL_syscdrom.c:CheckMounts\n" );
- exit ( -10 );
- }
-
- do
- {
- /* mntctrl() returns an array of all mounted filesystems */
- ret = mntctl ( MCTL_QUERY, bufsz, buffer );
- if ( ret == 0 )
- {
- /* Buffer was too small, realloc. */
- bufsz = *(int*)buffer; /* Required size is in first word. */
- /* (whatever a word is in AIX 4.3.3) */
- /* int seems to be OK in 32bit mode. */
- SDL_free(buffer);
- buffer = (char*)SDL_malloc(bufsz);
- if ( buffer==NULL )
- {
- fprintf(stderr,
- "Could not allocate %d bytes in aix/SDL_syscdrom.c:CheckMounts\n",
- bufsz );
- exit ( -10 );
- }
- }
- else if ( ret < 0 )
- {
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Error reading vmount structures\n");
-#endif
- return;
- }
- }
- while ( ret == 0 );
-
-#ifdef DEBUG_CDROM
- fprintf ( stderr, "Read %d vmount structures\n",ret );
-#endif
- ptr = (struct vmount*)buffer;
- do
- {
- switch(ptr->vmt_gfstype)
- {
- case MNT_CDROM :
- {
- struct stat stbuf;
- char* text;
-
- text = (char*)ptr + ptr->vmt_data[VMT_OBJECT].vmt_off;
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Checking mount path: %s mounted on %s\n",
- text, (char*)ptr + ptr->vmt_data[VMT_STUB].vmt_off );
-#endif
- if ( CheckDrive( text, &stbuf) > 0)
- {
- AddDrive( text, &stbuf);
- }
- }
- break;
- default :
- break;
- }
- ptr = (struct vmount*)((char*)ptr + ptr->vmt_length);
- ret--;
- }
- while ( ret > 0 );
-
- free ( buffer );
-}
-
-static int CheckNonmounts()
-{
-#ifdef _THREAD_SAFE
- AFILE_t fsFile = NULL;
- int passNo = 0;
- int ret;
- struct fstab entry;
- struct stat stbuf;
-
- ret = setfsent_r( &fsFile, &passNo );
- if ( ret != 0 ) return -1;
- do
- {
- ret = getfsent_r ( &entry, &fsFile, &passNo );
- if ( ret == 0 ) {
- char* l = SDL_strrchr(entry.fs_spec,'/');
- if ( l != NULL ) {
- if ( !SDL_strncmp("cd",++l,2) ) {
-#ifdef DEBUG_CDROM
- fprintf(stderr,
- "Found unmounted CD ROM drive with device name %s\n",
- entry.fs_spec);
-#endif
- if ( CheckDrive( entry.fs_spec, &stbuf) > 0)
- {
- AddDrive( entry.fs_spec, &stbuf);
- }
- }
- }
- }
- }
- while ( ret == 0 );
- ret = endfsent_r ( &fsFile );
- if ( ret != 0 ) return -1;
- return 0;
-#else
- struct fstab* entry;
- struct stat stbuf;
-
- setfsent();
- do
- {
- entry = getfsent();
- if ( entry != NULL ) {
- char* l = SDL_strrchr(entry->fs_spec,'/');
- if ( l != NULL ) {
- if ( !SDL_strncmp("cd",++l,2) ) {
-#ifdef DEBUG_CDROM
- fprintf(stderr,"Found unmounted CD ROM drive with device name %s", entry->fs_spec);
-#endif
- if ( CheckDrive( entry->fs_spec, &stbuf) > 0)
- {
- AddDrive( entry->fs_spec, &stbuf);
- }
- }
- }
- }
- }
- while ( entry != NULL );
- endfsent();
-#endif
-}
-
-int SDL_SYS_CDInit(void)
-{
- char *SDLcdrom;
- struct stat stbuf;
-
- /* Fill in our driver capabilities */
- SDL_CDcaps.Name = SDL_SYS_CDName;
- SDL_CDcaps.Open = SDL_SYS_CDOpen;
- SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
- SDL_CDcaps.Status = SDL_SYS_CDStatus;
- SDL_CDcaps.Play = SDL_SYS_CDPlay;
- SDL_CDcaps.Pause = SDL_SYS_CDPause;
- SDL_CDcaps.Resume = SDL_SYS_CDResume;
- SDL_CDcaps.Stop = SDL_SYS_CDStop;
- SDL_CDcaps.Eject = SDL_SYS_CDEject;
- SDL_CDcaps.Close = SDL_SYS_CDClose;
-
- /* Look in the environment for our CD-ROM drive list */
- SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */
- if ( SDLcdrom != NULL ) {
- char *cdpath, *delim;
- size_t len = SDL_strlen(SDLcdrom)+1;
- cdpath = SDL_stack_alloc(char, len);
- if ( cdpath != NULL ) {
- SDL_strlcpy(cdpath, SDLcdrom, len);
- SDLcdrom = cdpath;
- do {
- delim = SDL_strchr(SDLcdrom, ':');
- if ( delim ) {
- *delim++ = '\0';
- }
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Checking CD-ROM drive from SDL_CDROM: %s\n", SDLcdrom);
-#endif
- if ( CheckDrive(SDLcdrom, &stbuf) > 0 ) {
- AddDrive(SDLcdrom, &stbuf);
- }
- if ( delim ) {
- SDLcdrom = delim;
- } else {
- SDLcdrom = NULL;
- }
- } while ( SDLcdrom );
- SDL_stack_free(cdpath);
- }
-
- /* If we found our drives, there's nothing left to do */
- if ( SDL_numcds > 0 ) {
- return(0);
- }
- }
-
- CheckMounts();
- CheckNonmounts();
-
- return 0;
-}
-
-/* General ioctl() CD-ROM command function */
-static int SDL_SYS_CDioctl(int id, int command, void *arg)
-{
- int retval;
-
- retval = ioctl(id, command, arg);
- if ( retval < 0 ) {
- SDL_SetError("ioctl() error: %s", strerror(errno));
- }
- return retval;
-}
-
-static const char *SDL_SYS_CDName(int drive)
-{
- return(SDL_cdlist[drive]);
-}
-
-static int SDL_SYS_CDOpen(int drive)
-{
- int fd;
- char* lastsl;
- char* cdromname;
- size_t len;
-
- /*
- * We found /dev/cd? drives and that is in our list. But we can
- * open only the /dev/rcd? versions of those devices for Audio CD.
- */
- len = SDL_strlen(SDL_cdlist[drive])+2;
- cdromname = (char*)SDL_malloc(len);
- SDL_strlcpy(cdromname,SDL_cdlist[drive],len);
- lastsl = SDL_strrchr(cdromname,'/');
- if (lastsl) {
- *lastsl = 0;
- SDL_strlcat(cdromname,"/r",len);
- lastsl = SDL_strrchr(SDL_cdlist[drive],'/');
- if (lastsl) {
- lastsl++;
- SDL_strlcat(cdromname,lastsl,len);
- }
- }
-
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Should open drive %s, opening %s\n", SDL_cdlist[drive], cdromname);
-#endif
-
- /*
- * Use exclusive access. Don't use SC_DIAGNOSTICS as xmcd does because they
- * require root priviledges, and we don't want that. SC_SINGLE provides
- * exclusive access with less trouble.
- */
- fd = openx(cdromname, O_RDONLY, NULL, SC_SINGLE);
- if ( fd < 0 )
- {
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Could not open drive %s (%s)\n", cdromname, strerror(errno));
-#endif
- }
- else
- {
- struct mode_form_op cdMode;
- int ret;
-#ifdef DEBUG_CDROM
- cdMode.action = CD_GET_MODE;
- ret = SDL_SYS_CDioctl(fd, DK_CD_MODE, &cdMode);
- if ( ret < 0 ) {
- fprintf(stderr,
- "Could not get drive mode for %s (%s)\n",
- cdromname, strerror(errno));
- } else {
- switch(cdMode.cd_mode_form) {
- case CD_MODE1 :
- fprintf(stderr,
- "Drive mode for %s is %s\n",
- cdromname, "CD-ROM Data Mode 1");
- break;
- case CD_MODE2_FORM1 :
- fprintf(stderr,
- "Drive mode for %s is %s\n",
- cdromname, "CD-ROM XA Data Mode 2 Form 1");
- break;
- case CD_MODE2_FORM2 :
- fprintf(stderr,
- "Drive mode for %s is %s\n",
- cdromname, "CD-ROM XA Data Mode 2 Form 2");
- break;
- case CD_DA :
- fprintf(stderr,
- "Drive mode for %s is %s\n",
- cdromname, "CD-DA");
- break;
- default :
- fprintf(stderr,
- "Drive mode for %s is %s\n",
- cdromname, "unknown");
- break;
- }
- }
-#endif
-
- cdMode.action = CD_CHG_MODE;
- cdMode.cd_mode_form = CD_DA;
- ret = SDL_SYS_CDioctl(fd, DK_CD_MODE, &cdMode);
- if ( ret < 0 ) {
-#ifdef DEBUG_CDROM
- fprintf(stderr,
- "Could not set drive mode for %s (%s)\n",
- cdromname, strerror(errno));
-#endif
- SDL_SetError("ioctl() error: Could not set CD drive mode, %s",
- strerror(errno));
- } else {
-#ifdef DEBUG_CDROM
- fprintf(stderr,
- "Drive mode for %s set to CD_DA\n",
- cdromname);
-#endif
- }
- }
- SDL_free(cdromname);
- return fd;
-}
-
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
-{
- struct cd_audio_cmd cmd;
- struct cd_audio_cmd entry;
- int i;
- int okay;
-
- cmd.audio_cmds = CD_TRK_INFO_AUDIO;
- cmd.msf_flag = FALSE;
- if ( SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd) < 0 ) {
- return -1;
- }
-
- okay = 0;
- cdrom->numtracks = cmd.indexing.track_index.last_track
- - cmd.indexing.track_index.first_track+1;
- if ( cdrom->numtracks > SDL_MAX_TRACKS ) {
- cdrom->numtracks = SDL_MAX_TRACKS;
- }
-
- /* Read all the track TOC entries */
- for ( i=0; i<=cdrom->numtracks; ++i ) {
- if ( i == cdrom->numtracks ) {
- cdrom->track[i].id = 0xAA;;
- } else {
- cdrom->track[i].id = cmd.indexing.track_index.first_track+i;
- }
- entry.audio_cmds = CD_GET_TRK_MSF;
- entry.indexing.track_msf.track = cdrom->track[i].id;
- if ( SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &entry) < 0 ) {
- break;
- } else {
- cdrom->track[i].type = 0; /* don't know how to detect 0x04 data track */
- cdrom->track[i].offset = MSF_TO_FRAMES(
- entry.indexing.track_msf.mins,
- entry.indexing.track_msf.secs,
- entry.indexing.track_msf.frames);
- cdrom->track[i].length = 0;
- if ( i > 0 ) {
- cdrom->track[i-1].length = cdrom->track[i].offset
- - cdrom->track[i-1].offset;
- }
- }
- }
- if ( i == (cdrom->numtracks+1) ) {
- okay = 1;
- }
- return(okay ? 0 : -1);
-}
-
-/* Get CD-ROM status */
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
-{
- CDstatus status;
- struct cd_audio_cmd cmd;
- cmd.audio_cmds = CD_INFO_AUDIO;
-
- if ( SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd) < 0 ) {
-#ifdef DEBUG_CDROM
- fprintf(stderr, "ioctl failed in SDL_SYS_CDStatus (%s)\n", SDL_GetError());
-#endif
- status = CD_ERROR;
- } else {
- switch (cmd.status) {
- case CD_NO_AUDIO:
- case CD_COMPLETED:
- status = CD_STOPPED;
- break;
- case CD_PLAY_AUDIO:
- status = CD_PLAYING;
- break;
- case CD_PAUSE_AUDIO:
- status = CD_PAUSED;
- break;
- case CD_NOT_VALID:
-#ifdef DEBUG_CDROM
- fprintf(stderr, "cdStatus failed with CD_NOT_VALID\n");
-#endif
- status = CD_ERROR;
- break;
- case CD_STATUS_ERROR:
-#ifdef DEBUG_CDROM
- fprintf(stderr, "cdStatus failed with CD_STATUS_ERROR\n");
-#endif
- status = CD_ERROR;
- break;
- default:
-#ifdef DEBUG_CDROM
- fprintf(stderr, "cdStatus failed with unknown error\n");
-#endif
- status = CD_ERROR;
- break;
- }
- }
- if ( position ) {
- if ( status == CD_PLAYING || (status == CD_PAUSED) ) {
- *position = MSF_TO_FRAMES( cmd.indexing.info_audio.current_mins,
- cmd.indexing.info_audio.current_secs,
- cmd.indexing.info_audio.current_frames);
- } else {
- *position = 0;
- }
- }
- return status;
-}
-
-/* Start play */
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
-{
- struct cd_audio_cmd cmd;
-
- /*
- * My CD Rom is muted by default. I think I read that this is new with
- * AIX 4.3. SDL does not change the volume, so I need a kludge. Maybe
- * its better to do this elsewhere?
- */
- cmd.audio_cmds = CD_PLAY_AUDIO | CD_SET_VOLUME;
- cmd.msf_flag = TRUE;
- FRAMES_TO_MSF(start,
- &cmd.indexing.msf.first_mins,
- &cmd.indexing.msf.first_secs,
- &cmd.indexing.msf.first_frames);
- FRAMES_TO_MSF(start+length,
- &cmd.indexing.msf.last_mins,
- &cmd.indexing.msf.last_secs,
- &cmd.indexing.msf.last_frames);
- cmd.volume_type = CD_VOLUME_ALL;
- cmd.all_channel_vol = 255; /* This is a uchar. What is a good value? No docu! */
- cmd.out_port_0_sel = CD_AUDIO_CHNL_0;
- cmd.out_port_1_sel = CD_AUDIO_CHNL_1;
- cmd.out_port_2_sel = CD_AUDIO_CHNL_2;
- cmd.out_port_3_sel = CD_AUDIO_CHNL_3;
-
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Trying to play from %d:%d:%d to %d:%d:%d\n",
- cmd.indexing.msf.first_mins,
- cmd.indexing.msf.first_secs,
- cmd.indexing.msf.first_frames,
- cmd.indexing.msf.last_mins,
- cmd.indexing.msf.last_secs,
- cmd.indexing.msf.last_frames);
-#endif
- return(SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd));
-}
-
-/* Pause play */
-static int SDL_SYS_CDPause(SDL_CD *cdrom)
-{
- struct cd_audio_cmd cmd;
- cmd.audio_cmds = CD_PAUSE_AUDIO;
- return(SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd));
-}
-
-/* Resume play */
-static int SDL_SYS_CDResume(SDL_CD *cdrom)
-{
- struct cd_audio_cmd cmd;
- cmd.audio_cmds = CD_RESUME_AUDIO;
- return(SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd));
-}
-
-/* Stop play */
-static int SDL_SYS_CDStop(SDL_CD *cdrom)
-{
- struct cd_audio_cmd cmd;
- cmd.audio_cmds = CD_STOP_AUDIO;
- return(SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd));
-}
-
-/* Eject the CD-ROM */
-static int SDL_SYS_CDEject(SDL_CD *cdrom)
-{
- return(SDL_SYS_CDioctl(cdrom->id, DKEJECT, 0));
-}
-
-/* Close the CD-ROM handle */
-static void SDL_SYS_CDClose(SDL_CD *cdrom)
-{
- close(cdrom->id);
-}
-
-void SDL_SYS_CDQuit(void)
-{
- int i;
-
- if ( SDL_numcds > 0 ) {
- for ( i=0; i<SDL_numcds; ++i ) {
- SDL_free(SDL_cdlist[i]);
- }
- SDL_numcds = 0;
- }
-}
-
-#endif /* SDL_CDROM_AIX */
diff --git a/distrib/sdl-1.2.12/src/cdrom/beos/SDL_syscdrom.cc b/distrib/sdl-1.2.12/src/cdrom/beos/SDL_syscdrom.cc
deleted file mode 100644
index af9094a..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/beos/SDL_syscdrom.cc
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_CDROM_BEOS
-
-/* Functions for system-level CD-ROM audio control on BeOS
- (not completely implemented yet)
- */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include <scsi.h>
-#include <Directory.h>
-#include <Entry.h>
-#include <Path.h>
-
-#include "SDL_cdrom.h"
-extern "C" {
-#include "../SDL_syscdrom.h"
-}
-
-/* Constants to help us get at the SCSI table-of-contents info */
-#define CD_NUMTRACKS(toc) toc.toc_data[3]
-#define CD_TRACK(toc, track) (&toc.toc_data[6+(track)*8])
-#define CD_TRACK_N(toc, track) CD_TRACK(toc, track)[0]
-#define CD_TRACK_M(toc, track) CD_TRACK(toc, track)[3]
-#define CD_TRACK_S(toc, track) CD_TRACK(toc, track)[4]
-#define CD_TRACK_F(toc, track) CD_TRACK(toc, track)[5]
-
-/* Constants to help us get at the SCSI position info */
-#define POS_TRACK(pos) pos.position[6]
-#define POS_ABS_M(pos) pos.position[9]
-#define POS_ABS_S(pos) pos.position[10]
-#define POS_ABS_F(pos) pos.position[11]
-#define POS_REL_M(pos) pos.position[13]
-#define POS_REL_S(pos) pos.position[14]
-#define POS_REL_F(pos) pos.position[15]
-
-/* The maximum number of CD-ROM drives we'll detect */
-#define MAX_DRIVES 16
-
-/* A list of available CD-ROM drives */
-static char *SDL_cdlist[MAX_DRIVES];
-
-/* The system-dependent CD control functions */
-static const char *SDL_SYS_CDName(int drive);
-static int SDL_SYS_CDOpen(int drive);
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
-static int SDL_SYS_CDPause(SDL_CD *cdrom);
-static int SDL_SYS_CDResume(SDL_CD *cdrom);
-static int SDL_SYS_CDStop(SDL_CD *cdrom);
-static int SDL_SYS_CDEject(SDL_CD *cdrom);
-static void SDL_SYS_CDClose(SDL_CD *cdrom);
-int try_dir(const char *directory);
-
-
-/* Check a drive to see if it is a CD-ROM */
-static int CheckDrive(char *drive)
-{
- struct stat stbuf;
- int is_cd, cdfd;
- device_geometry info;
-
- /* If it doesn't exist, return -1 */
- if ( stat(drive, &stbuf) < 0 ) {
- return(-1);
- }
-
- /* If it does exist, verify that it's an available CD-ROM */
- is_cd = 0;
- cdfd = open(drive, 0);
- if ( cdfd >= 0 ) {
- if ( ioctl(cdfd, B_GET_GEOMETRY, &info) == B_NO_ERROR ) {
- if ( info.device_type == B_CD ) {
- is_cd = 1;
- }
- }
- close(cdfd);
- } else {
- /* This can happen when the drive is open .. (?) */;
- is_cd = 1;
- }
- return(is_cd);
-}
-
-/* Add a CD-ROM drive to our list of valid drives */
-static void AddDrive(char *drive)
-{
- int i;
- size_t len;
-
- if ( SDL_numcds < MAX_DRIVES ) {
- /* Add this drive to our list */
- i = SDL_numcds;
- len = SDL_strlen(drive)+1;
- SDL_cdlist[i] = (char *)SDL_malloc(len);
- if ( SDL_cdlist[i] == NULL ) {
- SDL_OutOfMemory();
- return;
- }
- SDL_strlcpy(SDL_cdlist[i], drive, len);
- ++SDL_numcds;
-#ifdef CDROM_DEBUG
- fprintf(stderr, "Added CD-ROM drive: %s\n", drive);
-#endif
- }
-}
-
-/* IDE bus scanning magic */
-enum {
- IDE_GET_DEVICES_INFO = B_DEVICE_OP_CODES_END + 50,
-};
-struct ide_ctrl_info {
- bool ide_0_present;
- bool ide_0_master_present;
- bool ide_0_slave_present;
- int ide_0_master_type;
- int ide_0_slave_type;
- bool ide_1_present;
- bool ide_1_master_present;
- bool ide_1_slave_present;
- int ide_1_master_type;
- int ide_1_slave_type;
-};
-
-int SDL_SYS_CDInit(void)
-{
- char *SDLcdrom;
- int raw_fd;
- struct ide_ctrl_info info;
-
- /* Fill in our driver capabilities */
- SDL_CDcaps.Name = SDL_SYS_CDName;
- SDL_CDcaps.Open = SDL_SYS_CDOpen;
- SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
- SDL_CDcaps.Status = SDL_SYS_CDStatus;
- SDL_CDcaps.Play = SDL_SYS_CDPlay;
- SDL_CDcaps.Pause = SDL_SYS_CDPause;
- SDL_CDcaps.Resume = SDL_SYS_CDResume;
- SDL_CDcaps.Stop = SDL_SYS_CDStop;
- SDL_CDcaps.Eject = SDL_SYS_CDEject;
- SDL_CDcaps.Close = SDL_SYS_CDClose;
-
- /* Look in the environment for our CD-ROM drive list */
- SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */
- if ( SDLcdrom != NULL ) {
- char *cdpath, *delim;
- size_t len = SDL_strlen(SDLcdrom)+1;
- cdpath = SDL_stack_alloc(char, len);
- if ( cdpath != NULL ) {
- SDL_strlcpy(cdpath, SDLcdrom, len);
- SDLcdrom = cdpath;
- do {
- delim = SDL_strchr(SDLcdrom, ':');
- if ( delim ) {
- *delim++ = '\0';
- }
- if ( CheckDrive(SDLcdrom) > 0 ) {
- AddDrive(SDLcdrom);
- }
- if ( delim ) {
- SDLcdrom = delim;
- } else {
- SDLcdrom = NULL;
- }
- } while ( SDLcdrom );
- SDL_stack_free(cdpath);
- }
-
- /* If we found our drives, there's nothing left to do */
- if ( SDL_numcds > 0 ) {
- return(0);
- }
- }
-
- /* Scan the system for CD-ROM drives */
- try_dir("/dev/disk");
- return 0;
-}
-
-
-int try_dir(const char *directory)
-{
- BDirectory dir;
- dir.SetTo(directory);
- if(dir.InitCheck() != B_NO_ERROR) {
- return false;
- }
- dir.Rewind();
- BEntry entry;
- while(dir.GetNextEntry(&entry) >= 0) {
- BPath path;
- const char *name;
- entry_ref e;
-
- if(entry.GetPath(&path) != B_NO_ERROR)
- continue;
- name = path.Path();
-
- if(entry.GetRef(&e) != B_NO_ERROR)
- continue;
-
- if(entry.IsDirectory()) {
- if(SDL_strcmp(e.name, "floppy") == 0)
- continue; /* ignore floppy (it is not silent) */
- int devfd = try_dir(name);
- if(devfd >= 0)
- return devfd;
- }
- else {
- int devfd;
- device_geometry g;
-
- if(SDL_strcmp(e.name, "raw") != 0)
- continue; /* ignore partitions */
-
- devfd = open(name, O_RDONLY);
- if(devfd < 0)
- continue;
-
- if(ioctl(devfd, B_GET_GEOMETRY, &g, sizeof(g)) >= 0) {
- if(g.device_type == B_CD)
- {
- AddDrive(strdup(name));
- }
- }
- close(devfd);
- }
- }
- return B_ERROR;
-}
-
-
-/* General ioctl() CD-ROM command function */
-static int SDL_SYS_CDioctl(int index, int command, void *arg)
-{
- int okay;
- int fd;
-
- okay = 0;
- fd = open(SDL_cdlist[index], 0);
- if ( fd >= 0 ) {
- if ( ioctl(fd, command, arg) == B_NO_ERROR ) {
- okay = 1;
- }
- close(fd);
- }
- return(okay ? 0 : -1);
-}
-
-static const char *SDL_SYS_CDName(int drive)
-{
- return(SDL_cdlist[drive]);
-}
-
-static int SDL_SYS_CDOpen(int drive)
-{
- return(drive);
-}
-
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
-{
- int i;
- scsi_toc toc;
-
- if ( SDL_SYS_CDioctl(cdrom->id, B_SCSI_GET_TOC, &toc) == 0 ) {
- cdrom->numtracks = CD_NUMTRACKS(toc);
- if ( cdrom->numtracks > SDL_MAX_TRACKS ) {
- cdrom->numtracks = SDL_MAX_TRACKS;
- }
- for ( i=0; i<=cdrom->numtracks; ++i ) {
- cdrom->track[i].id = CD_TRACK_N(toc, i);
- /* FIXME: How do we tell on BeOS? */
- cdrom->track[i].type = SDL_AUDIO_TRACK;
- cdrom->track[i].offset = MSF_TO_FRAMES(
- CD_TRACK_M(toc, i),
- CD_TRACK_S(toc, i),
- CD_TRACK_F(toc, i));
- cdrom->track[i].length = 0;
- if ( i > 0 ) {
- cdrom->track[i-1].length =
- cdrom->track[i].offset-
- cdrom->track[i-1].offset;
- }
- }
- return(0);
- } else {
- return(-1);
- }
-}
-
-/* Get CD-ROM status */
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
-{
- CDstatus status;
- int fd;
- int cur_frame;
- scsi_position pos;
-
- fd = open(SDL_cdlist[cdrom->id], 0);
- cur_frame = 0;
- if ( fd >= 0 ) {
- if ( ioctl(fd, B_SCSI_GET_POSITION, &pos) == B_NO_ERROR ) {
- cur_frame = MSF_TO_FRAMES(
- POS_ABS_M(pos), POS_ABS_S(pos), POS_ABS_F(pos));
- }
- if ( ! pos.position[1] || (pos.position[1] >= 0x13) ||
- ((pos.position[1] == 0x12) && (!pos.position[6])) ) {
- status = CD_STOPPED;
- } else
- if ( pos.position[1] == 0x11 ) {
- status = CD_PLAYING;
- } else {
- status = CD_PAUSED;
- }
- close(fd);
- } else {
- status = CD_TRAYEMPTY;
- }
- if ( position ) {
- *position = cur_frame;
- }
- return(status);
-}
-
-/* Start play */
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
-{
- int okay;
- int fd;
- scsi_play_position pos;
-
- okay = 0;
- fd = open(SDL_cdlist[cdrom->id], 0);
- if ( fd >= 0 ) {
- FRAMES_TO_MSF(start, &pos.start_m, &pos.start_s, &pos.start_f);
- FRAMES_TO_MSF(start+length, &pos.end_m, &pos.end_s, &pos.end_f);
- if ( ioctl(fd, B_SCSI_PLAY_POSITION, &pos) == B_NO_ERROR ) {
- okay = 1;
- }
- close(fd);
- }
- return(okay ? 0 : -1);
-}
-
-/* Pause play */
-static int SDL_SYS_CDPause(SDL_CD *cdrom)
-{
- return(SDL_SYS_CDioctl(cdrom->id, B_SCSI_PAUSE_AUDIO, 0));
-}
-
-/* Resume play */
-static int SDL_SYS_CDResume(SDL_CD *cdrom)
-{
- return(SDL_SYS_CDioctl(cdrom->id, B_SCSI_RESUME_AUDIO, 0));
-}
-
-/* Stop play */
-static int SDL_SYS_CDStop(SDL_CD *cdrom)
-{
- return(SDL_SYS_CDioctl(cdrom->id, B_SCSI_STOP_AUDIO, 0));
-}
-
-/* Eject the CD-ROM */
-static int SDL_SYS_CDEject(SDL_CD *cdrom)
-{
- return(SDL_SYS_CDioctl(cdrom->id, B_SCSI_EJECT, 0));
-}
-
-/* Close the CD-ROM handle */
-static void SDL_SYS_CDClose(SDL_CD *cdrom)
-{
- close(cdrom->id);
-}
-
-void SDL_SYS_CDQuit(void)
-{
- int i;
-
- if ( SDL_numcds > 0 ) {
- for ( i=0; i<SDL_numcds; ++i ) {
- SDL_free(SDL_cdlist[i]);
- }
- SDL_numcds = 0;
- }
-}
-
-#endif /* SDL_CDROM_BEOS */
diff --git a/distrib/sdl-1.2.12/src/cdrom/bsdi/SDL_syscdrom.c b/distrib/sdl-1.2.12/src/cdrom/bsdi/SDL_syscdrom.c
deleted file mode 100644
index 7687f21..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/bsdi/SDL_syscdrom.c
+++ /dev/null
@@ -1,542 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_CDROM_BSDI
-
-/*
- * Functions for system-level CD-ROM audio control for BSD/OS 4.x
- * This started life out as a copy of the freebsd/SDL_cdrom.c file but was
- * heavily modified. Works for standard (MMC) SCSI and ATAPI CDrom drives.
- *
- * Steven Schultz - sms@to.gd-es.com
-*/
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <err.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include </sys/dev/scsi/scsi.h>
-#include </sys/dev/scsi/scsi_ioctl.h>
-
-#include "SDL_cdrom.h"
-#include "../SDL_syscdrom.h"
-
-/*
- * The msf_to_frame and frame_to_msf were yanked from libcdrom and inlined
- * here so that -lcdrom doesn't have to be dragged in for something so simple.
-*/
-
-#define FRAMES_PER_SECOND 75
-#define FRAMES_PER_MINUTE (FRAMES_PER_SECOND * 60)
-
-int
-msf_to_frame(int minute, int second, int frame)
- {
- return(minute * FRAMES_PER_MINUTE + second * FRAMES_PER_SECOND + frame);
- }
-
-void
-frame_to_msf(int frame, int *minp, int *secp, int *framep)
- {
- *minp = frame / FRAMES_PER_MINUTE;
- *secp = (frame % FRAMES_PER_MINUTE) / FRAMES_PER_SECOND;
- *framep = frame % FRAMES_PER_SECOND;
- }
-
-/* The maximum number of CD-ROM drives we'll detect */
-#define MAX_DRIVES 16
-
-/* A list of available CD-ROM drives */
-static char *SDL_cdlist[MAX_DRIVES];
-static dev_t SDL_cdmode[MAX_DRIVES];
-
-/* The system-dependent CD control functions */
-static const char *SDL_SYS_CDName(int drive);
-static int SDL_SYS_CDOpen(int drive);
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
-static int SDL_SYS_CDPause(SDL_CD *cdrom);
-static int SDL_SYS_CDResume(SDL_CD *cdrom);
-static int SDL_SYS_CDStop(SDL_CD *cdrom);
-static int SDL_SYS_CDEject(SDL_CD *cdrom);
-static void SDL_SYS_CDClose(SDL_CD *cdrom);
-
-typedef struct scsi_cdb cdb_t;
-
-static int scsi_cmd(int fd,
- struct scsi_cdb *cdb,
- int cdblen,
- int rw,
- caddr_t data,
- int datalen,
- struct scsi_user_cdb *sus)
- {
- int scsistatus;
- unsigned char *cp;
- struct scsi_user_cdb suc;
-
- /* safety checks */
- if (!cdb) return(-1);
- if (rw != SUC_READ && rw != SUC_WRITE) return(-1);
-
- suc.suc_flags = rw;
- suc.suc_cdblen = cdblen;
- bcopy(cdb, suc.suc_cdb, cdblen);
- suc.suc_datalen = datalen;
- suc.suc_data = data;
- suc.suc_timeout = 10; /* 10 secs max for TUR or SENSE */
- if (ioctl(fd, SCSIRAWCDB, &suc) == -1)
- return(-11);
- scsistatus = suc.suc_sus.sus_status;
- cp = suc.suc_sus.sus_sense;
-
-/*
- * If a place to copy the sense data back to has been provided then the
- * caller is responsible for checking the errors and printing any information
- * out if the status was not successful.
-*/
- if (scsistatus != 0 && !sus)
- {
- fprintf(stderr,"scsistatus = %x cmd = %x\n",
- scsistatus, cdb[0]);
- fprintf(stderr, "sense %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x\n",
- cp[0], cp[1], cp[2], cp[3], cp[4], cp[5],
- cp[6], cp[7], cp[8], cp[9], cp[10], cp[11],
- cp[12], cp[13], cp[14], cp[15]);
- return(1);
- }
- if (sus)
- bcopy(&suc, sus, sizeof (struct scsi_user_cdb));
- if (scsistatus)
- return(1); /* Return non-zero for unsuccessful status */
- return(0);
- }
-
-/* request vendor brand and model */
-unsigned char *Inquiry(int fd)
- {
- static struct scsi_cdb6 cdb =
- {
- 0x12,
- 0, 0, 0,
- 56,
- 0
- };
- static unsigned char Inqbuffer[56];
-
- if (scsi_cmd(fd, (cdb_t *)&cdb, 6, SUC_READ, Inqbuffer,
- sizeof(Inqbuffer), 0))
- return("\377");
- return(Inqbuffer);
- }
-
-#define ADD_SENSECODE 12
-#define ADD_SC_QUALIFIER 13
-
-int TestForMedium(int fd)
- {
- int sts, asc, ascq;
- struct scsi_user_cdb sus;
- static struct scsi_cdb6 cdb =
- {
- CMD_TEST_UNIT_READY, /* command */
- 0, /* reserved */
- 0, /* reserved */
- 0, /* reserved */
- 0, /* reserved */
- 0 /* reserved */
- };
-
-again: sts = scsi_cmd(fd, (cdb_t *)&cdb, 6, SUC_READ, 0, 0, &sus);
- asc = sus.suc_sus.sus_sense[ADD_SENSECODE];
- ascq = sus.suc_sus.sus_sense[ADD_SC_QUALIFIER];
- if (asc == 0x3a && ascq == 0x0) /* no medium */
- return(0);
- if (asc == 0x28 && ascq == 0x0) /* medium changed */
- goto again;
- if (asc == 0x4 && ascq == 0x1 ) /* coming ready */
- {
- sleep(2);
- goto again;
- }
- return(1);
- }
-
-/* Check a drive to see if it is a CD-ROM */
-static int CheckDrive(char *drive, struct stat *stbuf)
-{
- int is_cd = 0, cdfd;
- char *p;
-
- /* If it doesn't exist, return -1 */
- if ( stat(drive, stbuf) < 0 ) {
- return(-1);
- }
-
- /* If it does exist, verify that it's an available CD-ROM */
- cdfd = open(drive, (O_RDONLY|O_EXCL|O_NONBLOCK), 0);
- if ( cdfd >= 0 ) {
- p = Inquiry(cdfd);
- if (*p == TYPE_ROM)
- is_cd = 1;
- close(cdfd);
- }
- return(is_cd);
-}
-
-/* Add a CD-ROM drive to our list of valid drives */
-static void AddDrive(char *drive, struct stat *stbuf)
-{
- int i;
-
- if ( SDL_numcds < MAX_DRIVES ) {
- /* Check to make sure it's not already in our list.
- This can happen when we see a drive via symbolic link.
- */
- for ( i=0; i<SDL_numcds; ++i ) {
- if ( stbuf->st_rdev == SDL_cdmode[i] ) {
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Duplicate drive detected: %s == %s\n", drive, SDL_cdlist[i]);
-#endif
- return;
- }
- }
-
- /* Add this drive to our list */
- i = SDL_numcds;
- SDL_cdlist[i] = SDL_strdup(drive);
- if ( SDL_cdlist[i] == NULL ) {
- SDL_OutOfMemory();
- return;
- }
- SDL_cdmode[i] = stbuf->st_rdev;
- ++SDL_numcds;
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Added CD-ROM drive: %s\n", drive);
-#endif
- }
-}
-
-int SDL_SYS_CDInit(void)
-{
- /* checklist: /dev/rsr?c */
- static char *checklist[] = {
- "?0 rsr?", NULL
- };
- char *SDLcdrom;
- int i, j, exists;
- char drive[32];
- struct stat stbuf;
-
- /* Fill in our driver capabilities */
- SDL_CDcaps.Name = SDL_SYS_CDName;
- SDL_CDcaps.Open = SDL_SYS_CDOpen;
- SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
- SDL_CDcaps.Status = SDL_SYS_CDStatus;
- SDL_CDcaps.Play = SDL_SYS_CDPlay;
- SDL_CDcaps.Pause = SDL_SYS_CDPause;
- SDL_CDcaps.Resume = SDL_SYS_CDResume;
- SDL_CDcaps.Stop = SDL_SYS_CDStop;
- SDL_CDcaps.Eject = SDL_SYS_CDEject;
- SDL_CDcaps.Close = SDL_SYS_CDClose;
-
- /* Look in the environment for our CD-ROM drive list */
- SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */
- if ( SDLcdrom != NULL ) {
- char *cdpath, *delim;
- size_t len = SDL_strlen(SDLcdrom)+1;
- cdpath = SDL_stack_alloc(char, len);
- if ( cdpath != NULL ) {
- SDL_strlcpy(cdpath, SDLcdrom, len);
- SDLcdrom = cdpath;
- do {
- delim = SDL_strchr(SDLcdrom, ':');
- if ( delim ) {
- *delim++ = '\0';
- }
- if ( CheckDrive(SDLcdrom, &stbuf) > 0 ) {
- AddDrive(SDLcdrom, &stbuf);
- }
- if ( delim ) {
- SDLcdrom = delim;
- } else {
- SDLcdrom = NULL;
- }
- } while ( SDLcdrom );
- SDL_stack_free(cdpath);
- }
-
- /* If we found our drives, there's nothing left to do */
- if ( SDL_numcds > 0 ) {
- return(0);
- }
- }
-
- /* Scan the system for CD-ROM drives */
- for ( i=0; checklist[i]; ++i ) {
- if ( checklist[i][0] == '?' ) {
- char *insert;
- exists = 1;
- for ( j=checklist[i][1]; exists; ++j ) {
- SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%sc", &checklist[i][3]);
- insert = SDL_strchr(drive, '?');
- if ( insert != NULL ) {
- *insert = j;
- }
- switch (CheckDrive(drive, &stbuf)) {
- /* Drive exists and is a CD-ROM */
- case 1:
- AddDrive(drive, &stbuf);
- break;
- /* Drive exists, but isn't a CD-ROM */
- case 0:
- break;
- /* Drive doesn't exist */
- case -1:
- exists = 0;
- break;
- }
- }
- } else {
- SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]);
- if ( CheckDrive(drive, &stbuf) > 0 ) {
- AddDrive(drive, &stbuf);
- }
- }
- }
- return(0);
-}
-
-static const char *SDL_SYS_CDName(int drive)
-{
- return(SDL_cdlist[drive]);
-}
-
-static int SDL_SYS_CDOpen(int drive)
-{
- return(open(SDL_cdlist[drive], O_RDONLY | O_NONBLOCK | O_EXCL, 0));
-}
-
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
- {
- u_char cdb[10], buf[4], *p, *toc;
- struct scsi_user_cdb sus;
- int i, sts, first_track, last_track, ntracks, toc_size;
-
- bzero(cdb, sizeof (cdb));
- cdb[0] = 0x43; /* Read TOC */
- cdb[1] = 0x2; /* MSF */
- cdb[8] = 4; /* size TOC header */
- sts = scsi_cmd(cdrom->id, (cdb_t *)cdb, 10, SUC_READ, buf, 4, &sus);
- if (sts < 0)
- return(-1);
- first_track = buf[2];
- last_track = buf[3];
- ntracks = last_track - first_track + 1;
- cdrom->numtracks = ntracks;
- toc_size = 4 + (ntracks + 1) * 8;
- toc = (u_char *)SDL_malloc(toc_size);
- if (toc == NULL)
- return(-1);
- bzero(cdb, sizeof (cdb));
- cdb[0] = 0x43;
- cdb[1] = 0x2;
- cdb[6] = first_track;
- cdb[7] = toc_size >> 8;
- cdb[8] = toc_size & 0xff;
- sts = scsi_cmd(cdrom->id, (cdb_t *)cdb, 10, SUC_READ, toc, toc_size,
- &sus);
- if (sts < 0)
- {
- SDL_free(toc);
- return(-1);
- }
-
- for (i = 0, p = toc+4; i <= ntracks; i++, p+= 8)
- {
- if (i == ntracks)
- cdrom->track[i].id = 0xAA; /* Leadout */
- else
- cdrom->track[i].id = first_track + i;
- if (p[1] & 0x20)
- cdrom->track[i].type = SDL_DATA_TRACK;
- else
- cdrom->track[i].type = SDL_AUDIO_TRACK;
- cdrom->track[i].offset = msf_to_frame(p[5], p[6], p[7]);
- cdrom->track[i].length = 0;
- if (i > 0)
- cdrom->track[i-1].length = cdrom->track[i].offset -
- cdrom->track[i-1].offset;
- }
- SDL_free(toc);
- return(0);
- }
-
-/* Get CD-ROM status */
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
- {
- CDstatus status;
- u_char cdb[10], buf[16];
- int sts;
- struct scsi_user_cdb sus;
-
- bzero(cdb, sizeof (cdb));
- cdb[0] = 0x42; /* read subq */
- cdb[1] = 0x2; /* MSF */
- cdb[2] = 0x40; /* q channel */
- cdb[3] = 1; /* current pos */
- cdb[7] = sizeof (buf) >> 8;
- cdb[8] = sizeof (buf) & 0xff;
- sts = scsi_cmd(cdrom->id, (cdb_t *)cdb, 10, SUC_READ, buf, sizeof (buf),
- &sus);
- if (sts < 0)
- return(-1);
- if (sts)
- {
- if (TestForMedium(cdrom->id) == 0)
- status = CD_TRAYEMPTY;
- else
- status = CD_ERROR;
- }
- else
- {
- switch (buf[1])
- {
- case 0x11:
- status = CD_PLAYING;
- break;
- case 0x12:
- status = CD_PAUSED;
- break;
- case 0x13:
- case 0x14:
- case 0x15:
- status = CD_STOPPED;
- break;
- default:
- status = CD_ERROR;
- break;
- }
- }
- if (position)
- {
- if ( status == CD_PLAYING || (status == CD_PAUSED) )
- *position = msf_to_frame(buf[9], buf[10], buf[11]);
- else
- *position = 0;
- }
- return(status);
- }
-
-/* Start play */
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
- {
- u_char cdb[10];
- int sts, minute, second, frame, eminute, esecond, eframe;
- struct scsi_user_cdb sus;
-
- bzero(cdb, sizeof(cdb));
- cdb[0] = 0x47; /* Play */
- frame_to_msf(start, &minute, &second, &frame);
- frame_to_msf(start + length, &eminute, &esecond, &eframe);
- cdb[3] = minute;
- cdb[4] = second;
- cdb[5] = frame;
- cdb[6] = eminute;
- cdb[7] = esecond;
- cdb[8] = eframe;
- sts = scsi_cmd(cdrom->id, (cdb_t *)cdb, 10, SUC_READ, 0, 0, &sus);
- return(sts);
- }
-
-static int
-pauseresume(SDL_CD *cdrom, int flag)
- {
- u_char cdb[10];
- struct scsi_user_cdb sus;
-
- bzero(cdb, sizeof (cdb));
- cdb[0] = 0x4b;
- cdb[8] = flag & 0x1;
- return(scsi_cmd(cdrom->id, (cdb_t *)cdb, 10, SUC_READ, 0, 0, &sus));
- }
-
-/* Pause play */
-static int SDL_SYS_CDPause(SDL_CD *cdrom)
-{
- return(pauseresume(cdrom, 0));
-}
-
-/* Resume play */
-static int SDL_SYS_CDResume(SDL_CD *cdrom)
-{
- return(pauseresume(cdrom, 1));
-}
-
-/* Stop play */
-static int SDL_SYS_CDStop(SDL_CD *cdrom)
-{
- u_char cdb[6];
- struct scsi_user_cdb sus;
-
- bzero(cdb, sizeof (cdb));
- cdb[0] = 0x1b; /* stop */
- cdb[1] = 1; /* immediate */
- return(scsi_cmd(cdrom->id, (cdb_t *)cdb, 6, SUC_READ, 0, 0, &sus));
-}
-
-/* Eject the CD-ROM */
-static int SDL_SYS_CDEject(SDL_CD *cdrom)
-{
- u_char cdb[6];
- struct scsi_user_cdb sus;
-
- bzero(cdb, sizeof (cdb));
- cdb[0] = 0x1b; /* stop */
- cdb[1] = 1; /* immediate */
- cdb[4] = 2; /* eject */
- return(scsi_cmd(cdrom->id, (cdb_t *)cdb, 6, SUC_READ, 0, 0, &sus));
-}
-
-/* Close the CD-ROM handle */
-static void SDL_SYS_CDClose(SDL_CD *cdrom)
- {
- close(cdrom->id);
- }
-
-void SDL_SYS_CDQuit(void)
-{
- int i;
-
- if ( SDL_numcds > 0 ) {
- for ( i=0; i<SDL_numcds; ++i ) {
- SDL_free(SDL_cdlist[i]);
- }
- }
- SDL_numcds = 0;
-}
-
-#endif /* SDL_CDROM_BSDI */
diff --git a/distrib/sdl-1.2.12/src/cdrom/dc/SDL_syscdrom.c b/distrib/sdl-1.2.12/src/cdrom/dc/SDL_syscdrom.c
deleted file mode 100644
index d89e089..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/dc/SDL_syscdrom.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_CDROM_DC
-
-/* Functions for system-level CD-ROM audio control */
-
-#include <dc/cdrom.h>
-#include <dc/spu.h>
-
-#include "SDL_cdrom.h"
-#include "../SDL_syscdrom.h"
-
-/* The system-dependent CD control functions */
-static const char *SDL_SYS_CDName(int drive);
-static int SDL_SYS_CDOpen(int drive);
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
-static int SDL_SYS_CDPause(SDL_CD *cdrom);
-static int SDL_SYS_CDResume(SDL_CD *cdrom);
-static int SDL_SYS_CDStop(SDL_CD *cdrom);
-static int SDL_SYS_CDEject(SDL_CD *cdrom);
-static void SDL_SYS_CDClose(SDL_CD *cdrom);
-
-
-int SDL_SYS_CDInit(void)
-{
- /* Fill in our driver capabilities */
- SDL_CDcaps.Name = SDL_SYS_CDName;
- SDL_CDcaps.Open = SDL_SYS_CDOpen;
- SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
- SDL_CDcaps.Status = SDL_SYS_CDStatus;
- SDL_CDcaps.Play = SDL_SYS_CDPlay;
- SDL_CDcaps.Pause = SDL_SYS_CDPause;
- SDL_CDcaps.Resume = SDL_SYS_CDResume;
- SDL_CDcaps.Stop = SDL_SYS_CDStop;
- SDL_CDcaps.Eject = SDL_SYS_CDEject;
- SDL_CDcaps.Close = SDL_SYS_CDClose;
-
- return(0);
-}
-
-static const char *SDL_SYS_CDName(int drive)
-{
- return "/cd";
-}
-
-static int SDL_SYS_CDOpen(int drive)
-{
- return(drive);
-}
-
-#define TRACK_CDDA 0
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
-{
- CDROM_TOC toc;
- int ret,i;
-
- ret = cdrom_read_toc(&toc,0);
- if (ret!=ERR_OK) {
- return -1;
- }
-
- cdrom->numtracks = TOC_TRACK(toc.last)-TOC_TRACK(toc.first)+1;
- for(i=0;i<cdrom->numtracks;i++) {
- unsigned long entry = toc.entry[i];
- cdrom->track[i].id = i+1;
- cdrom->track[i].type = (TOC_CTRL(toc.entry[i])==TRACK_CDDA)?SDL_AUDIO_TRACK:SDL_DATA_TRACK;
- cdrom->track[i].offset = TOC_LBA(entry)-150;
- cdrom->track[i].length = TOC_LBA((i+1<toc.last)?toc.entry[i+1]:toc.leadout_sector)-TOC_LBA(entry);
- }
-
- return 0;
-}
-
-/* Get CD-ROM status */
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
-{
- int ret,dc_status,disc_type;
-
- ret = cdrom_get_status(&dc_status,&disc_type);
- if (ret!=ERR_OK) return CD_ERROR;
-
- switch(dc_status) {
-// case CD_STATUS_BUSY:
- case CD_STATUS_PAUSED:
- return CD_PAUSED;
- case CD_STATUS_STANDBY:
- return CD_STOPPED;
- case CD_STATUS_PLAYING:
- return CD_PLAYING;
-// case CD_STATUS_SEEKING:
-// case CD_STATUS_SCANING:
- case CD_STATUS_OPEN:
- case CD_STATUS_NO_DISC:
- return CD_TRAYEMPTY;
- default:
- return CD_ERROR;
- }
-}
-
-/* Start play */
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
-{
- int ret = cdrom_cdda_play(start-150,start-150+length,1,CDDA_SECTORS);
- return ret==ERR_OK?0:-1;
-}
-
-/* Pause play */
-static int SDL_SYS_CDPause(SDL_CD *cdrom)
-{
- int ret=cdrom_cdda_pause();
- return ret==ERR_OK?0:-1;
-}
-
-/* Resume play */
-static int SDL_SYS_CDResume(SDL_CD *cdrom)
-{
- int ret=cdrom_cdda_resume();
- return ret==ERR_OK?0:-1;
-}
-
-/* Stop play */
-static int SDL_SYS_CDStop(SDL_CD *cdrom)
-{
- int ret=cdrom_spin_down();
- return ret==ERR_OK?0:-1;
-}
-
-/* Eject the CD-ROM */
-static int SDL_SYS_CDEject(SDL_CD *cdrom)
-{
- return -1;
-}
-
-/* Close the CD-ROM handle */
-static void SDL_SYS_CDClose(SDL_CD *cdrom)
-{
-}
-
-void SDL_SYS_CDQuit(void)
-{
-
-}
-
-#endif /* SDL_CDROM_DC */
diff --git a/distrib/sdl-1.2.12/src/cdrom/dummy/SDL_syscdrom.c b/distrib/sdl-1.2.12/src/cdrom/dummy/SDL_syscdrom.c
deleted file mode 100644
index 4a99303..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/dummy/SDL_syscdrom.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#if defined(SDL_CDROM_DUMMY) || defined(SDL_CDROM_DISABLED)
-
-/* Stub functions for system-level CD-ROM audio control */
-
-#include "SDL_cdrom.h"
-#include "../SDL_syscdrom.h"
-
-int SDL_SYS_CDInit(void)
-{
- return(0);
-}
-
-void SDL_SYS_CDQuit(void)
-{
- return;
-}
-
-#endif /* SDL_CDROM_DUMMY || SDL_CDROM_DISABLED */
diff --git a/distrib/sdl-1.2.12/src/cdrom/freebsd/SDL_syscdrom.c b/distrib/sdl-1.2.12/src/cdrom/freebsd/SDL_syscdrom.c
deleted file mode 100644
index 30b5c90..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/freebsd/SDL_syscdrom.c
+++ /dev/null
@@ -1,406 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_CDROM_FREEBSD
-
-/* Functions for system-level CD-ROM audio control */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <unistd.h>
-#include <sys/cdio.h>
-
-#include "SDL_cdrom.h"
-#include "../SDL_syscdrom.h"
-
-
-/* The maximum number of CD-ROM drives we'll detect */
-#define MAX_DRIVES 16
-
-/* A list of available CD-ROM drives */
-static char *SDL_cdlist[MAX_DRIVES];
-static dev_t SDL_cdmode[MAX_DRIVES];
-
-/* The system-dependent CD control functions */
-static const char *SDL_SYS_CDName(int drive);
-static int SDL_SYS_CDOpen(int drive);
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
-static int SDL_SYS_CDPause(SDL_CD *cdrom);
-static int SDL_SYS_CDResume(SDL_CD *cdrom);
-static int SDL_SYS_CDStop(SDL_CD *cdrom);
-static int SDL_SYS_CDEject(SDL_CD *cdrom);
-static void SDL_SYS_CDClose(SDL_CD *cdrom);
-
-/* Some ioctl() errno values which occur when the tray is empty */
-#define ERRNO_TRAYEMPTY(errno) \
- ((errno == EIO) || (errno == ENOENT) || (errno == EINVAL))
-
-/* Check a drive to see if it is a CD-ROM */
-static int CheckDrive(char *drive, struct stat *stbuf)
-{
- int is_cd, cdfd;
- struct ioc_read_subchannel info;
-
- /* If it doesn't exist, return -1 */
- if ( stat(drive, stbuf) < 0 ) {
- return(-1);
- }
-
- /* If it does exist, verify that it's an available CD-ROM */
- is_cd = 0;
- if ( S_ISCHR(stbuf->st_mode) || S_ISBLK(stbuf->st_mode) ) {
- cdfd = open(drive, (O_RDONLY|O_EXCL|O_NONBLOCK), 0);
- if ( cdfd >= 0 ) {
- info.address_format = CD_MSF_FORMAT;
- info.data_format = CD_CURRENT_POSITION;
- info.data_len = 0;
- info.data = NULL;
- /* Under Linux, EIO occurs when a disk is not present.
- This isn't 100% reliable, so we use the USE_MNTENT
- code above instead.
- */
- if ( (ioctl(cdfd, CDIOCREADSUBCHANNEL, &info) == 0) ||
- ERRNO_TRAYEMPTY(errno) ) {
- is_cd = 1;
- }
- close(cdfd);
- }
- }
- return(is_cd);
-}
-
-/* Add a CD-ROM drive to our list of valid drives */
-static void AddDrive(char *drive, struct stat *stbuf)
-{
- int i;
-
- if ( SDL_numcds < MAX_DRIVES ) {
- /* Check to make sure it's not already in our list.
- This can happen when we see a drive via symbolic link.
- */
- for ( i=0; i<SDL_numcds; ++i ) {
- if ( stbuf->st_rdev == SDL_cdmode[i] ) {
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Duplicate drive detected: %s == %s\n", drive, SDL_cdlist[i]);
-#endif
- return;
- }
- }
-
- /* Add this drive to our list */
- i = SDL_numcds;
- SDL_cdlist[i] = SDL_strdup(drive);
- if ( SDL_cdlist[i] == NULL ) {
- SDL_OutOfMemory();
- return;
- }
- SDL_cdmode[i] = stbuf->st_rdev;
- ++SDL_numcds;
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Added CD-ROM drive: %s\n", drive);
-#endif
- }
-}
-
-int SDL_SYS_CDInit(void)
-{
- /* checklist: /dev/cdrom,/dev/cd?c /dev/acd?c
- /dev/matcd?c /dev/mcd?c /dev/scd?c */
- static char *checklist[] = {
- "cdrom", "?0 cd?", "?0 acd?", "?0 matcd?", "?0 mcd?", "?0 scd?",NULL
- };
- char *SDLcdrom;
- int i, j, exists;
- char drive[32];
- struct stat stbuf;
-
- /* Fill in our driver capabilities */
- SDL_CDcaps.Name = SDL_SYS_CDName;
- SDL_CDcaps.Open = SDL_SYS_CDOpen;
- SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
- SDL_CDcaps.Status = SDL_SYS_CDStatus;
- SDL_CDcaps.Play = SDL_SYS_CDPlay;
- SDL_CDcaps.Pause = SDL_SYS_CDPause;
- SDL_CDcaps.Resume = SDL_SYS_CDResume;
- SDL_CDcaps.Stop = SDL_SYS_CDStop;
- SDL_CDcaps.Eject = SDL_SYS_CDEject;
- SDL_CDcaps.Close = SDL_SYS_CDClose;
-
- /* Look in the environment for our CD-ROM drive list */
- SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */
- if ( SDLcdrom != NULL ) {
- char *cdpath, *delim;
- size_t len = SDL_strlen(SDLcdrom)+1;
- cdpath = SDL_stack_alloc(char, len);
- if ( cdpath != NULL ) {
- SDL_strlcpy(cdpath, SDLcdrom, len);
- SDLcdrom = cdpath;
- do {
- delim = SDL_strchr(SDLcdrom, ':');
- if ( delim ) {
- *delim++ = '\0';
- }
- if ( CheckDrive(SDLcdrom, &stbuf) > 0 ) {
- AddDrive(SDLcdrom, &stbuf);
- }
- if ( delim ) {
- SDLcdrom = delim;
- } else {
- SDLcdrom = NULL;
- }
- } while ( SDLcdrom );
- SDL_stack_free(cdpath);
- }
-
- /* If we found our drives, there's nothing left to do */
- if ( SDL_numcds > 0 ) {
- return(0);
- }
- }
-
- /* Scan the system for CD-ROM drives */
- for ( i=0; checklist[i]; ++i ) {
- if ( checklist[i][0] == '?' ) {
- char *insert;
- exists = 1;
- for ( j=checklist[i][1]; exists; ++j ) {
- SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%sc", &checklist[i][3]);
- insert = SDL_strchr(drive, '?');
- if ( insert != NULL ) {
- *insert = j;
- }
- switch (CheckDrive(drive, &stbuf)) {
- /* Drive exists and is a CD-ROM */
- case 1:
- AddDrive(drive, &stbuf);
- break;
- /* Drive exists, but isn't a CD-ROM */
- case 0:
- break;
- /* Drive doesn't exist */
- case -1:
- exists = 0;
- break;
- }
- }
- } else {
- SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]);
- if ( CheckDrive(drive, &stbuf) > 0 ) {
- AddDrive(drive, &stbuf);
- }
- }
- }
- return(0);
-}
-
-/* General ioctl() CD-ROM command function */
-static int SDL_SYS_CDioctl(int id, int command, void *arg)
-{
- int retval;
-
- retval = ioctl(id, command, arg);
- if ( retval < 0 ) {
- SDL_SetError("ioctl() error: %s", strerror(errno));
- }
- return(retval);
-}
-
-static const char *SDL_SYS_CDName(int drive)
-{
- return(SDL_cdlist[drive]);
-}
-
-static int SDL_SYS_CDOpen(int drive)
-{
- return(open(SDL_cdlist[drive], (O_RDONLY|O_EXCL|O_NONBLOCK), 0));
-}
-
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
-{
- struct ioc_toc_header toc;
- int i, okay;
- struct ioc_read_toc_entry entry;
- struct cd_toc_entry data;
-
- okay = 0;
- if ( SDL_SYS_CDioctl(cdrom->id, CDIOREADTOCHEADER, &toc) == 0 ) {
- cdrom->numtracks = toc.ending_track-toc.starting_track+1;
- if ( cdrom->numtracks > SDL_MAX_TRACKS ) {
- cdrom->numtracks = SDL_MAX_TRACKS;
- }
- /* Read all the track TOC entries */
- for ( i=0; i<=cdrom->numtracks; ++i ) {
- if ( i == cdrom->numtracks ) {
- cdrom->track[i].id = 0xAA; /* CDROM_LEADOUT */
- } else {
- cdrom->track[i].id = toc.starting_track+i;
- }
- entry.starting_track = cdrom->track[i].id;
- entry.address_format = CD_MSF_FORMAT;
- entry.data_len = sizeof(data);
- entry.data = &data;
- if ( SDL_SYS_CDioctl(cdrom->id, CDIOREADTOCENTRYS,
- &entry) < 0 ) {
- break;
- } else {
- cdrom->track[i].type = data.control;
- cdrom->track[i].offset = MSF_TO_FRAMES(
- data.addr.msf.minute,
- data.addr.msf.second,
- data.addr.msf.frame);
- cdrom->track[i].length = 0;
- if ( i > 0 ) {
- cdrom->track[i-1].length =
- cdrom->track[i].offset-
- cdrom->track[i-1].offset;
- }
- }
- }
- if ( i == (cdrom->numtracks+1) ) {
- okay = 1;
- }
- }
- return(okay ? 0 : -1);
-}
-
-/* Get CD-ROM status */
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
-{
- CDstatus status;
- struct ioc_toc_header toc;
- struct ioc_read_subchannel info;
- struct cd_sub_channel_info data;
-
- info.address_format = CD_MSF_FORMAT;
- info.data_format = CD_CURRENT_POSITION;
- info.track = 0;
- info.data_len = sizeof(data);
- info.data = &data;
- if ( ioctl(cdrom->id, CDIOCREADSUBCHANNEL, &info) < 0 ) {
- if ( ERRNO_TRAYEMPTY(errno) ) {
- status = CD_TRAYEMPTY;
- } else {
- status = CD_ERROR;
- }
- } else {
- switch (data.header.audio_status) {
- case CD_AS_AUDIO_INVALID:
- case CD_AS_NO_STATUS:
- /* Try to determine if there's a CD available */
- if (ioctl(cdrom->id,CDIOREADTOCHEADER,&toc)==0)
- status = CD_STOPPED;
- else
- status = CD_TRAYEMPTY;
- break;
- case CD_AS_PLAY_COMPLETED:
- status = CD_STOPPED;
- break;
- case CD_AS_PLAY_IN_PROGRESS:
- status = CD_PLAYING;
- break;
- case CD_AS_PLAY_PAUSED:
- status = CD_PAUSED;
- break;
- default:
- status = CD_ERROR;
- break;
- }
- }
- if ( position ) {
- if ( status == CD_PLAYING || (status == CD_PAUSED) ) {
- *position = MSF_TO_FRAMES(
- data.what.position.absaddr.msf.minute,
- data.what.position.absaddr.msf.second,
- data.what.position.absaddr.msf.frame);
- } else {
- *position = 0;
- }
- }
- return(status);
-}
-
-/* Start play */
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
-{
- struct ioc_play_msf playtime;
-
- FRAMES_TO_MSF(start,
- &playtime.start_m, &playtime.start_s, &playtime.start_f);
- FRAMES_TO_MSF(start+length,
- &playtime.end_m, &playtime.end_s, &playtime.end_f);
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Trying to play from %d:%d:%d to %d:%d:%d\n",
- playtime.cdmsf_min0, playtime.cdmsf_sec0, playtime.cdmsf_frame0,
- playtime.cdmsf_min1, playtime.cdmsf_sec1, playtime.cdmsf_frame1);
-#endif
- ioctl(cdrom->id, CDIOCSTART, 0);
- return(SDL_SYS_CDioctl(cdrom->id, CDIOCPLAYMSF, &playtime));
-}
-
-/* Pause play */
-static int SDL_SYS_CDPause(SDL_CD *cdrom)
-{
- return(SDL_SYS_CDioctl(cdrom->id, CDIOCPAUSE, 0));
-}
-
-/* Resume play */
-static int SDL_SYS_CDResume(SDL_CD *cdrom)
-{
- return(SDL_SYS_CDioctl(cdrom->id, CDIOCRESUME, 0));
-}
-
-/* Stop play */
-static int SDL_SYS_CDStop(SDL_CD *cdrom)
-{
- return(SDL_SYS_CDioctl(cdrom->id, CDIOCSTOP, 0));
-}
-
-/* Eject the CD-ROM */
-static int SDL_SYS_CDEject(SDL_CD *cdrom)
-{
- return(SDL_SYS_CDioctl(cdrom->id, CDIOCEJECT, 0));
-}
-
-/* Close the CD-ROM handle */
-static void SDL_SYS_CDClose(SDL_CD *cdrom)
-{
- close(cdrom->id);
-}
-
-void SDL_SYS_CDQuit(void)
-{
- int i;
-
- if ( SDL_numcds > 0 ) {
- for ( i=0; i<SDL_numcds; ++i ) {
- SDL_free(SDL_cdlist[i]);
- }
- SDL_numcds = 0;
- }
-}
-
-#endif /* SDL_CDROM_FREEBSD */
diff --git a/distrib/sdl-1.2.12/src/cdrom/linux/SDL_syscdrom.c b/distrib/sdl-1.2.12/src/cdrom/linux/SDL_syscdrom.c
deleted file mode 100644
index 2535b28..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/linux/SDL_syscdrom.c
+++ /dev/null
@@ -1,564 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_CDROM_LINUX
-
-/* Functions for system-level CD-ROM audio control */
-
-#include <string.h> /* For strerror() */
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <unistd.h>
-#ifdef __LINUX__
-#ifdef HAVE_LINUX_VERSION_H
-/* linux 2.6.9 workaround */
-#include <linux/version.h>
-#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,9)
-#include <asm/types.h>
-#define __le64 __u64
-#define __le32 __u32
-#define __le16 __u16
-#define __be64 __u64
-#define __be32 __u32
-#define __be16 __u16
-#endif /* linux 2.6.9 workaround */
-#endif /* HAVE_LINUX_VERSION_H */
-#include <linux/cdrom.h>
-#endif
-#ifdef __SVR4
-#include <sys/cdio.h>
-#endif
-
-/* Define this to use the alternative getmntent() code */
-#ifndef __SVR4
-#define USE_MNTENT
-#endif
-
-#ifdef USE_MNTENT
-#if defined(__USLC__)
-#include <sys/mntent.h>
-#else
-#include <mntent.h>
-#endif
-
-#ifndef _PATH_MNTTAB
-#ifdef MNTTAB
-#define _PATH_MNTTAB MNTTAB
-#else
-#define _PATH_MNTTAB "/etc/fstab"
-#endif
-#endif /* !_PATH_MNTTAB */
-
-#ifndef _PATH_MOUNTED
-#define _PATH_MOUNTED "/etc/mtab"
-#endif /* !_PATH_MOUNTED */
-
-#ifndef MNTTYPE_CDROM
-#define MNTTYPE_CDROM "iso9660"
-#endif
-#ifndef MNTTYPE_SUPER
-#define MNTTYPE_SUPER "supermount"
-#endif
-#endif /* USE_MNTENT */
-
-#include "SDL_cdrom.h"
-#include "../SDL_syscdrom.h"
-
-
-/* The maximum number of CD-ROM drives we'll detect */
-#define MAX_DRIVES 16
-
-/* A list of available CD-ROM drives */
-static char *SDL_cdlist[MAX_DRIVES];
-static dev_t SDL_cdmode[MAX_DRIVES];
-
-/* The system-dependent CD control functions */
-static const char *SDL_SYS_CDName(int drive);
-static int SDL_SYS_CDOpen(int drive);
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
-static int SDL_SYS_CDPause(SDL_CD *cdrom);
-static int SDL_SYS_CDResume(SDL_CD *cdrom);
-static int SDL_SYS_CDStop(SDL_CD *cdrom);
-static int SDL_SYS_CDEject(SDL_CD *cdrom);
-static void SDL_SYS_CDClose(SDL_CD *cdrom);
-
-/* Some ioctl() errno values which occur when the tray is empty */
-#ifndef ENOMEDIUM
-#define ENOMEDIUM ENOENT
-#endif
-#define ERRNO_TRAYEMPTY(errno) \
- ((errno == EIO) || (errno == ENOENT) || \
- (errno == EINVAL) || (errno == ENOMEDIUM))
-
-/* Check a drive to see if it is a CD-ROM */
-static int CheckDrive(char *drive, char *mnttype, struct stat *stbuf)
-{
- int is_cd, cdfd;
- struct cdrom_subchnl info;
-
- /* If it doesn't exist, return -1 */
- if ( stat(drive, stbuf) < 0 ) {
- return(-1);
- }
-
- /* If it does exist, verify that it's an available CD-ROM */
- is_cd = 0;
- if ( S_ISCHR(stbuf->st_mode) || S_ISBLK(stbuf->st_mode) ) {
- cdfd = open(drive, (O_RDONLY|O_NONBLOCK), 0);
- if ( cdfd >= 0 ) {
- info.cdsc_format = CDROM_MSF;
- /* Under Linux, EIO occurs when a disk is not present.
- */
- if ( (ioctl(cdfd, CDROMSUBCHNL, &info) == 0) ||
- ERRNO_TRAYEMPTY(errno) ) {
- is_cd = 1;
- }
- close(cdfd);
- }
-#ifdef USE_MNTENT
- /* Even if we can't read it, it might be mounted */
- else if ( mnttype && (SDL_strcmp(mnttype, MNTTYPE_CDROM) == 0) ) {
- is_cd = 1;
- }
-#endif
- }
- return(is_cd);
-}
-
-/* Add a CD-ROM drive to our list of valid drives */
-static void AddDrive(char *drive, struct stat *stbuf)
-{
- int i;
-
- if ( SDL_numcds < MAX_DRIVES ) {
- /* Check to make sure it's not already in our list.
- This can happen when we see a drive via symbolic link.
- */
- for ( i=0; i<SDL_numcds; ++i ) {
- if ( stbuf->st_rdev == SDL_cdmode[i] ) {
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Duplicate drive detected: %s == %s\n", drive, SDL_cdlist[i]);
-#endif
- return;
- }
- }
-
- /* Add this drive to our list */
- i = SDL_numcds;
- SDL_cdlist[i] = SDL_strdup(drive);
- if ( SDL_cdlist[i] == NULL ) {
- SDL_OutOfMemory();
- return;
- }
- SDL_cdmode[i] = stbuf->st_rdev;
- ++SDL_numcds;
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Added CD-ROM drive: %s\n", drive);
-#endif
- }
-}
-
-#ifdef USE_MNTENT
-static void CheckMounts(const char *mtab)
-{
- FILE *mntfp;
- struct mntent *mntent;
- struct stat stbuf;
-
- mntfp = setmntent(mtab, "r");
- if ( mntfp != NULL ) {
- char *tmp;
- char *mnt_type;
- size_t mnt_type_len;
- char *mnt_dev;
- size_t mnt_dev_len;
-
- while ( (mntent=getmntent(mntfp)) != NULL ) {
- mnt_type_len = SDL_strlen(mntent->mnt_type) + 1;
- mnt_type = SDL_stack_alloc(char, mnt_type_len);
- if (mnt_type == NULL)
- continue; /* maybe you'll get lucky next time. */
-
- mnt_dev_len = SDL_strlen(mntent->mnt_fsname) + 1;
- mnt_dev = SDL_stack_alloc(char, mnt_dev_len);
- if (mnt_dev == NULL) {
- SDL_stack_free(mnt_type);
- continue;
- }
-
- SDL_strlcpy(mnt_type, mntent->mnt_type, mnt_type_len);
- SDL_strlcpy(mnt_dev, mntent->mnt_fsname, mnt_dev_len);
-
- /* Handle "supermount" filesystem mounts */
- if ( SDL_strcmp(mnt_type, MNTTYPE_SUPER) == 0 ) {
- tmp = SDL_strstr(mntent->mnt_opts, "fs=");
- if ( tmp ) {
- SDL_stack_free(mnt_type);
- mnt_type = SDL_strdup(tmp + SDL_strlen("fs="));
- if ( mnt_type ) {
- tmp = SDL_strchr(mnt_type, ',');
- if ( tmp ) {
- *tmp = '\0';
- }
- }
- }
- tmp = SDL_strstr(mntent->mnt_opts, "dev=");
- if ( tmp ) {
- SDL_stack_free(mnt_dev);
- mnt_dev = SDL_strdup(tmp + SDL_strlen("dev="));
- if ( mnt_dev ) {
- tmp = SDL_strchr(mnt_dev, ',');
- if ( tmp ) {
- *tmp = '\0';
- }
- }
- }
- }
- if ( SDL_strcmp(mnt_type, MNTTYPE_CDROM) == 0 ) {
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Checking mount path from %s: %s mounted on %s of %s\n",
- mtab, mnt_dev, mntent->mnt_dir, mnt_type);
-#endif
- if (CheckDrive(mnt_dev, mnt_type, &stbuf) > 0) {
- AddDrive(mnt_dev, &stbuf);
- }
- }
- SDL_stack_free(mnt_dev);
- SDL_stack_free(mnt_type);
- }
- endmntent(mntfp);
- }
-}
-#endif /* USE_MNTENT */
-
-int SDL_SYS_CDInit(void)
-{
- /* checklist: /dev/cdrom, /dev/hd?, /dev/scd? /dev/sr? */
- static char *checklist[] = {
- "cdrom", "?a hd?", "?0 scd?", "?0 sr?", NULL
- };
- char *SDLcdrom;
- int i, j, exists;
- char drive[32];
- struct stat stbuf;
-
- /* Fill in our driver capabilities */
- SDL_CDcaps.Name = SDL_SYS_CDName;
- SDL_CDcaps.Open = SDL_SYS_CDOpen;
- SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
- SDL_CDcaps.Status = SDL_SYS_CDStatus;
- SDL_CDcaps.Play = SDL_SYS_CDPlay;
- SDL_CDcaps.Pause = SDL_SYS_CDPause;
- SDL_CDcaps.Resume = SDL_SYS_CDResume;
- SDL_CDcaps.Stop = SDL_SYS_CDStop;
- SDL_CDcaps.Eject = SDL_SYS_CDEject;
- SDL_CDcaps.Close = SDL_SYS_CDClose;
-
- /* Look in the environment for our CD-ROM drive list */
- SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */
- if ( SDLcdrom != NULL ) {
- char *cdpath, *delim;
- size_t len = SDL_strlen(SDLcdrom)+1;
- cdpath = SDL_stack_alloc(char, len);
- if ( cdpath != NULL ) {
- SDL_strlcpy(cdpath, SDLcdrom, len);
- SDLcdrom = cdpath;
- do {
- delim = SDL_strchr(SDLcdrom, ':');
- if ( delim ) {
- *delim++ = '\0';
- }
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Checking CD-ROM drive from SDL_CDROM: %s\n", SDLcdrom);
-#endif
- if ( CheckDrive(SDLcdrom, NULL, &stbuf) > 0 ) {
- AddDrive(SDLcdrom, &stbuf);
- }
- if ( delim ) {
- SDLcdrom = delim;
- } else {
- SDLcdrom = NULL;
- }
- } while ( SDLcdrom );
- SDL_stack_free(cdpath);
- }
-
- /* If we found our drives, there's nothing left to do */
- if ( SDL_numcds > 0 ) {
- return(0);
- }
- }
-
-#ifdef USE_MNTENT
- /* Check /dev/cdrom first :-) */
- if (CheckDrive("/dev/cdrom", NULL, &stbuf) > 0) {
- AddDrive("/dev/cdrom", &stbuf);
- }
-
- /* Now check the currently mounted CD drives */
- CheckMounts(_PATH_MOUNTED);
-
- /* Finally check possible mountable drives in /etc/fstab */
- CheckMounts(_PATH_MNTTAB);
-
- /* If we found our drives, there's nothing left to do */
- if ( SDL_numcds > 0 ) {
- return(0);
- }
-#endif /* USE_MNTENT */
-
- /* Scan the system for CD-ROM drives.
- Not always 100% reliable, so use the USE_MNTENT code above first.
- */
- for ( i=0; checklist[i]; ++i ) {
- if ( checklist[i][0] == '?' ) {
- char *insert;
- exists = 1;
- for ( j=checklist[i][1]; exists; ++j ) {
- SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", &checklist[i][3]);
- insert = SDL_strchr(drive, '?');
- if ( insert != NULL ) {
- *insert = j;
- }
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Checking possible CD-ROM drive: %s\n", drive);
-#endif
- switch (CheckDrive(drive, NULL, &stbuf)) {
- /* Drive exists and is a CD-ROM */
- case 1:
- AddDrive(drive, &stbuf);
- break;
- /* Drive exists, but isn't a CD-ROM */
- case 0:
- break;
- /* Drive doesn't exist */
- case -1:
- exists = 0;
- break;
- }
- }
- } else {
- SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]);
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Checking possible CD-ROM drive: %s\n", drive);
-#endif
- if ( CheckDrive(drive, NULL, &stbuf) > 0 ) {
- AddDrive(drive, &stbuf);
- }
- }
- }
- return(0);
-}
-
-/* General ioctl() CD-ROM command function */
-static int SDL_SYS_CDioctl(int id, int command, void *arg)
-{
- int retval;
-
- retval = ioctl(id, command, arg);
- if ( retval < 0 ) {
- SDL_SetError("ioctl() error: %s", strerror(errno));
- }
- return(retval);
-}
-
-static const char *SDL_SYS_CDName(int drive)
-{
- return(SDL_cdlist[drive]);
-}
-
-static int SDL_SYS_CDOpen(int drive)
-{
- return(open(SDL_cdlist[drive], (O_RDONLY|O_NONBLOCK), 0));
-}
-
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
-{
- struct cdrom_tochdr toc;
- int i, okay;
- struct cdrom_tocentry entry;
-
- okay = 0;
- if ( SDL_SYS_CDioctl(cdrom->id, CDROMREADTOCHDR, &toc) == 0 ) {
- cdrom->numtracks = toc.cdth_trk1-toc.cdth_trk0+1;
- if ( cdrom->numtracks > SDL_MAX_TRACKS ) {
- cdrom->numtracks = SDL_MAX_TRACKS;
- }
- /* Read all the track TOC entries */
- for ( i=0; i<=cdrom->numtracks; ++i ) {
- if ( i == cdrom->numtracks ) {
- cdrom->track[i].id = CDROM_LEADOUT;
- } else {
- cdrom->track[i].id = toc.cdth_trk0+i;
- }
- entry.cdte_track = cdrom->track[i].id;
- entry.cdte_format = CDROM_MSF;
- if ( SDL_SYS_CDioctl(cdrom->id, CDROMREADTOCENTRY,
- &entry) < 0 ) {
- break;
- } else {
- if ( entry.cdte_ctrl & CDROM_DATA_TRACK ) {
- cdrom->track[i].type = SDL_DATA_TRACK;
- } else {
- cdrom->track[i].type = SDL_AUDIO_TRACK;
- }
- cdrom->track[i].offset = MSF_TO_FRAMES(
- entry.cdte_addr.msf.minute,
- entry.cdte_addr.msf.second,
- entry.cdte_addr.msf.frame);
- cdrom->track[i].length = 0;
- if ( i > 0 ) {
- cdrom->track[i-1].length =
- cdrom->track[i].offset-
- cdrom->track[i-1].offset;
- }
- }
- }
- if ( i == (cdrom->numtracks+1) ) {
- okay = 1;
- }
- }
- return(okay ? 0 : -1);
-}
-
-/* Get CD-ROM status */
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
-{
- CDstatus status;
- struct cdrom_tochdr toc;
- struct cdrom_subchnl info;
-
- info.cdsc_format = CDROM_MSF;
- if ( ioctl(cdrom->id, CDROMSUBCHNL, &info) < 0 ) {
- if ( ERRNO_TRAYEMPTY(errno) ) {
- status = CD_TRAYEMPTY;
- } else {
- status = CD_ERROR;
- }
- } else {
- switch (info.cdsc_audiostatus) {
- case CDROM_AUDIO_INVALID:
- case CDROM_AUDIO_NO_STATUS:
- /* Try to determine if there's a CD available */
- if (ioctl(cdrom->id, CDROMREADTOCHDR, &toc)==0)
- status = CD_STOPPED;
- else
- status = CD_TRAYEMPTY;
- break;
- case CDROM_AUDIO_COMPLETED:
- status = CD_STOPPED;
- break;
- case CDROM_AUDIO_PLAY:
- status = CD_PLAYING;
- break;
- case CDROM_AUDIO_PAUSED:
- /* Workaround buggy CD-ROM drive */
- if ( info.cdsc_trk == CDROM_LEADOUT ) {
- status = CD_STOPPED;
- } else {
- status = CD_PAUSED;
- }
- break;
- default:
- status = CD_ERROR;
- break;
- }
- }
- if ( position ) {
- if ( status == CD_PLAYING || (status == CD_PAUSED) ) {
- *position = MSF_TO_FRAMES(
- info.cdsc_absaddr.msf.minute,
- info.cdsc_absaddr.msf.second,
- info.cdsc_absaddr.msf.frame);
- } else {
- *position = 0;
- }
- }
- return(status);
-}
-
-/* Start play */
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
-{
- struct cdrom_msf playtime;
-
- FRAMES_TO_MSF(start,
- &playtime.cdmsf_min0, &playtime.cdmsf_sec0, &playtime.cdmsf_frame0);
- FRAMES_TO_MSF(start+length,
- &playtime.cdmsf_min1, &playtime.cdmsf_sec1, &playtime.cdmsf_frame1);
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Trying to play from %d:%d:%d to %d:%d:%d\n",
- playtime.cdmsf_min0, playtime.cdmsf_sec0, playtime.cdmsf_frame0,
- playtime.cdmsf_min1, playtime.cdmsf_sec1, playtime.cdmsf_frame1);
-#endif
- return(SDL_SYS_CDioctl(cdrom->id, CDROMPLAYMSF, &playtime));
-}
-
-/* Pause play */
-static int SDL_SYS_CDPause(SDL_CD *cdrom)
-{
- return(SDL_SYS_CDioctl(cdrom->id, CDROMPAUSE, 0));
-}
-
-/* Resume play */
-static int SDL_SYS_CDResume(SDL_CD *cdrom)
-{
- return(SDL_SYS_CDioctl(cdrom->id, CDROMRESUME, 0));
-}
-
-/* Stop play */
-static int SDL_SYS_CDStop(SDL_CD *cdrom)
-{
- return(SDL_SYS_CDioctl(cdrom->id, CDROMSTOP, 0));
-}
-
-/* Eject the CD-ROM */
-static int SDL_SYS_CDEject(SDL_CD *cdrom)
-{
- return(SDL_SYS_CDioctl(cdrom->id, CDROMEJECT, 0));
-}
-
-/* Close the CD-ROM handle */
-static void SDL_SYS_CDClose(SDL_CD *cdrom)
-{
- close(cdrom->id);
-}
-
-void SDL_SYS_CDQuit(void)
-{
- int i;
-
- if ( SDL_numcds > 0 ) {
- for ( i=0; i<SDL_numcds; ++i ) {
- SDL_free(SDL_cdlist[i]);
- }
- SDL_numcds = 0;
- }
-}
-
-#endif /* SDL_CDROM_LINUX */
diff --git a/distrib/sdl-1.2.12/src/cdrom/macos/SDL_syscdrom.c b/distrib/sdl-1.2.12/src/cdrom/macos/SDL_syscdrom.c
deleted file mode 100644
index bbe69e9..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/macos/SDL_syscdrom.c
+++ /dev/null
@@ -1,525 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_CDROM_MACOS
-
-/* MacOS functions for system-level CD-ROM audio control */
-
-#include <Devices.h>
-#include <Files.h>
-#include <LowMem.h> /* Use entry table macros, not functions in InterfaceLib */
-
-#include "SDL_cdrom.h"
-#include "../SDL_syscdrom.h"
-#include "SDL_syscdrom_c.h"
-
-/* Added by Matt Slot */
-#if !defined(LMGetUnitTableEntryCount)
- #define LMGetUnitTableEntryCount() *(short *)0x01D2
-#endif
-
-/* The maximum number of CD-ROM drives we'll detect */
-#define MAX_DRIVES 26
-
-/* A list of available CD-ROM drives */
-static long SDL_cdversion = 0;
-static struct {
- short dRefNum;
- short driveNum;
- long frames;
- char name[256];
- Boolean hasAudio;
- } SDL_cdlist[MAX_DRIVES];
-static StringPtr gDriverName = "\p.AppleCD";
-
-/* The system-dependent CD control functions */
-static const char *SDL_SYS_CDName(int drive);
-static int SDL_SYS_CDOpen(int drive);
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
-static int SDL_SYS_CDPause(SDL_CD *cdrom);
-static int SDL_SYS_CDResume(SDL_CD *cdrom);
-static int SDL_SYS_CDStop(SDL_CD *cdrom);
-static int SDL_SYS_CDEject(SDL_CD *cdrom);
-static void SDL_SYS_CDClose(SDL_CD *cdrom);
-
-static short SDL_SYS_ShortToBCD(short value)
-{
- return((value % 10) + (value / 10) * 0x10); /* Convert value to BCD */
-}
-
-static short SDL_SYS_BCDToShort(short value)
-{
- return((value % 0x10) + (value / 0x10) * 10); /* Convert value from BCD */
-}
-
-int SDL_SYS_CDInit(void)
-{
- SInt16 dRefNum = 0;
- SInt16 first, last;
-
- SDL_numcds = 0;
-
- /* Check that the software is available */
- if (Gestalt(kGestaltAudioCDSelector, &SDL_cdversion) ||
- !SDL_cdversion) return(0);
-
- /* Fill in our driver capabilities */
- SDL_CDcaps.Name = SDL_SYS_CDName;
- SDL_CDcaps.Open = SDL_SYS_CDOpen;
- SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
- SDL_CDcaps.Status = SDL_SYS_CDStatus;
- SDL_CDcaps.Play = SDL_SYS_CDPlay;
- SDL_CDcaps.Pause = SDL_SYS_CDPause;
- SDL_CDcaps.Resume = SDL_SYS_CDResume;
- SDL_CDcaps.Stop = SDL_SYS_CDStop;
- SDL_CDcaps.Eject = SDL_SYS_CDEject;
- SDL_CDcaps.Close = SDL_SYS_CDClose;
-
- /* Walk the list, count each AudioCD driver, and save the refnums */
- first = -1;
- last = 0 - LMGetUnitTableEntryCount();
- for(dRefNum = first; dRefNum >= last; dRefNum--) {
- Str255 driverName;
- StringPtr namePtr;
- DCtlHandle deviceEntry;
-
- deviceEntry = GetDCtlEntry(dRefNum);
- if (! deviceEntry) continue;
-
- /* Is this an .AppleCD ? */
- namePtr = (*deviceEntry)->dCtlFlags & (1L << dRAMBased) ?
- ((StringPtr) ((DCtlPtr) deviceEntry)->dCtlDriver + 18) :
- ((StringPtr) (*deviceEntry)->dCtlDriver + 18);
- BlockMoveData(namePtr, driverName, namePtr[0]+1);
- if (driverName[0] > gDriverName[0]) driverName[0] = gDriverName[0];
- if (! EqualString(driverName, gDriverName, false, false)) continue;
-
- /* Record the basic info for each drive */
- SDL_cdlist[SDL_numcds].dRefNum = dRefNum;
- BlockMoveData(namePtr + 1, SDL_cdlist[SDL_numcds].name, namePtr[0]);
- SDL_cdlist[SDL_numcds].name[namePtr[0]] = 0;
- SDL_cdlist[SDL_numcds].hasAudio = false;
- SDL_numcds++;
- }
- return(0);
-}
-
-static const char *SDL_SYS_CDName(int drive)
-{
- return(SDL_cdlist[drive].name);
-}
-
-static int get_drivenum(int drive)
-{
- QHdr *driveQ = GetDrvQHdr();
- DrvQEl *driveElem;
-
- /* Update the drive number */
- SDL_cdlist[drive].driveNum = 0;
- if ( driveQ->qTail ) {
- driveQ->qTail->qLink = 0;
- }
- for ( driveElem=(DrvQEl *)driveQ->qHead; driveElem;
- driveElem = (DrvQEl *)driveElem->qLink ) {
- if ( driveElem->dQRefNum == SDL_cdlist[drive].dRefNum ) {
- SDL_cdlist[drive].driveNum = driveElem->dQDrive;
- break;
- }
- }
- return(SDL_cdlist[drive].driveNum);
-}
-
-static int SDL_SYS_CDOpen(int drive)
-{
- return(drive);
-}
-
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
-{
- CDCntrlParam cdpb;
- CDTrackData tracks[SDL_MAX_TRACKS];
- long i, leadout;
-
- /* Get the number of tracks on the CD by examining the TOC */
- SDL_memset(&cdpb, 0, sizeof(cdpb));
- cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
- cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
- cdpb.csCode = kReadTOC;
- cdpb.csParam.words[0] = kGetTrackRange;
- if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
- SDL_SetError("PBControlSync() failed");
- return(-1);
- }
-
- cdrom->numtracks =
- SDL_SYS_BCDToShort(cdpb.csParam.bytes[1]) -
- SDL_SYS_BCDToShort(cdpb.csParam.bytes[0]) + 1;
- if ( cdrom->numtracks > SDL_MAX_TRACKS )
- cdrom->numtracks = SDL_MAX_TRACKS;
- cdrom->status = CD_STOPPED;
- cdrom->cur_track = 0; /* Apparently these are set elsewhere */
- cdrom->cur_frame = 0; /* Apparently these are set elsewhere */
-
-
- /* Get the lead out area of the CD by examining the TOC */
- SDL_memset(&cdpb, 0, sizeof(cdpb));
- cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
- cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
- cdpb.csCode = kReadTOC;
- cdpb.csParam.words[0] = kGetLeadOutArea;
- if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
- SDL_SetError("PBControlSync() failed");
- return(-1);
- }
-
- leadout = MSF_TO_FRAMES(
- SDL_SYS_BCDToShort(cdpb.csParam.bytes[0]),
- SDL_SYS_BCDToShort(cdpb.csParam.bytes[1]),
- SDL_SYS_BCDToShort(cdpb.csParam.bytes[2]));
-
- /* Get an array of track locations by examining the TOC */
- SDL_memset(tracks, 0, sizeof(tracks));
- SDL_memset(&cdpb, 0, sizeof(cdpb));
- cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
- cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
- cdpb.csCode = kReadTOC;
- cdpb.csParam.words[0] = kGetTrackEntries; /* Type of Query */
- * ((long *) (cdpb.csParam.words+1)) = (long) tracks;
- cdpb.csParam.words[3] = cdrom->numtracks * sizeof(tracks[0]);
- * ((char *) (cdpb.csParam.words+4)) = 1; /* First track */
- if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
- SDL_SetError("PBControlSync() failed");
- return(-1);
- }
-
- /* Read all the track TOC entries */
- SDL_cdlist[cdrom->id].hasAudio = false;
- for ( i=0; i<cdrom->numtracks; ++i )
- {
- cdrom->track[i].id = i+1;
- if (tracks[i].entry.control & kDataTrackMask)
- cdrom->track[i].type = SDL_DATA_TRACK;
- else
- {
- cdrom->track[i].type = SDL_AUDIO_TRACK;
- SDL_cdlist[SDL_numcds].hasAudio = true;
- }
-
- cdrom->track[i].offset = MSF_TO_FRAMES(
- SDL_SYS_BCDToShort(tracks[i].entry.min),
- SDL_SYS_BCDToShort(tracks[i].entry.min),
- SDL_SYS_BCDToShort(tracks[i].entry.frame));
- cdrom->track[i].length = MSF_TO_FRAMES(
- SDL_SYS_BCDToShort(tracks[i+1].entry.min),
- SDL_SYS_BCDToShort(tracks[i+1].entry.min),
- SDL_SYS_BCDToShort(tracks[i+1].entry.frame)) -
- cdrom->track[i].offset;
- }
-
- /* Apparently SDL wants a fake last entry */
- cdrom->track[i].offset = leadout;
- cdrom->track[i].length = 0;
-
- return(0);
-}
-
-/* Get CD-ROM status */
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
-{
- CDCntrlParam cdpb;
- CDstatus status = CD_ERROR;
- Boolean spinning = false;
-
- if (position) *position = 0;
-
- /* Get the number of tracks on the CD by examining the TOC */
- if ( ! get_drivenum(cdrom->id) ) {
- return(CD_TRAYEMPTY);
- }
- SDL_memset(&cdpb, 0, sizeof(cdpb));
- cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
- cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
- cdpb.csCode = kReadTOC;
- cdpb.csParam.words[0] = kGetTrackRange;
- if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
- SDL_SetError("PBControlSync() failed");
- return(CD_ERROR);
- }
-
- cdrom->numtracks =
- SDL_SYS_BCDToShort(cdpb.csParam.bytes[1]) -
- SDL_SYS_BCDToShort(cdpb.csParam.bytes[0]) + 1;
- if ( cdrom->numtracks > SDL_MAX_TRACKS )
- cdrom->numtracks = SDL_MAX_TRACKS;
- cdrom->cur_track = 0; /* Apparently these are set elsewhere */
- cdrom->cur_frame = 0; /* Apparently these are set elsewhere */
-
-
- if (1 || SDL_cdlist[cdrom->id].hasAudio) {
- /* Get the current playback status */
- SDL_memset(&cdpb, 0, sizeof(cdpb));
- cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
- cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
- cdpb.csCode = kAudioStatus;
- if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
- SDL_SetError("PBControlSync() failed");
- return(-1);
- }
-
- switch(cdpb.csParam.cd.status) {
- case kStatusPlaying:
- status = CD_PLAYING;
- spinning = true;
- break;
- case kStatusPaused:
- status = CD_PAUSED;
- spinning = true;
- break;
- case kStatusMuted:
- status = CD_PLAYING; /* What should I do here? */
- spinning = true;
- break;
- case kStatusDone:
- status = CD_STOPPED;
- spinning = true;
- break;
- case kStatusStopped:
- status = CD_STOPPED;
- spinning = false;
- break;
- case kStatusError:
- default:
- status = CD_ERROR;
- spinning = false;
- break;
- }
-
- if (spinning && position) *position = MSF_TO_FRAMES(
- SDL_SYS_BCDToShort(cdpb.csParam.cd.minute),
- SDL_SYS_BCDToShort(cdpb.csParam.cd.second),
- SDL_SYS_BCDToShort(cdpb.csParam.cd.frame));
- }
- else
- status = CD_ERROR; /* What should I do here? */
-
- return(status);
-}
-
-/* Start play */
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
-{
- CDCntrlParam cdpb;
-
- /* Pause the current audio playback to avoid audible artifacts */
- if ( SDL_SYS_CDPause(cdrom) < 0 ) {
- return(-1);
- }
-
- /* Specify the AudioCD playback mode */
- SDL_memset(&cdpb, 0, sizeof(cdpb));
- cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
- cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
- cdpb.csCode = kSetPlayMode;
- cdpb.csParam.bytes[0] = false; /* Repeat? */
- cdpb.csParam.bytes[1] = kPlayModeSequential; /* Play mode */
- /* ¥¥¥ÊTreat as soft error, NEC Drive doesnt support this call ¥¥¥ */
- PBControlSync((ParmBlkPtr) &cdpb);
-
-#if 1
- /* Specify the end of audio playback */
- SDL_memset(&cdpb, 0, sizeof(cdpb));
- cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
- cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
- cdpb.csCode = kAudioStop;
- cdpb.csParam.words[0] = kBlockPosition; /* Position Mode */
- *(long *) (cdpb.csParam.words + 1) = start+length-1; /* Search Address */
- if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
- SDL_SetError("PBControlSync() failed");
- return(-1);
- }
-
- /* Specify the start of audio playback, and start it */
- SDL_memset(&cdpb, 0, sizeof(cdpb));
- cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
- cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
- cdpb.csCode = kAudioPlay;
- cdpb.csParam.words[0] = kBlockPosition; /* Position Mode */
- *(long *) (cdpb.csParam.words + 1) = start+1; /* Search Address */
- cdpb.csParam.words[3] = false; /* Stop address? */
- cdpb.csParam.words[4] = kStereoPlayMode; /* Audio Play Mode */
- if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
- SDL_SetError("PBControlSync() failed");
- return(-1);
- }
-#else
- /* Specify the end of audio playback */
- FRAMES_TO_MSF(start+length, &m, &s, &f);
- SDL_memset(&cdpb, 0, sizeof(cdpb));
- cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
- cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
- cdpb.csCode = kAudioStop;
- cdpb.csParam.words[0] = kTrackPosition; /* Position Mode */
- cdpb.csParam.words[1] = 0; /* Search Address (hiword)*/
- cdpb.csParam.words[2] = /* Search Address (loword)*/
- SDL_SYS_ShortToBCD(cdrom->numtracks);
- if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
- SDL_SetError("PBControlSync() failed");
- return(-1);
- }
-
- /* Specify the start of audio playback, and start it */
- FRAMES_TO_MSF(start, &m, &s, &f);
- SDL_memset(&cdpb, 0, sizeof(cdpb));
- cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
- cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
- cdpb.csCode = kAudioPlay;
- cdpb.csParam.words[0] = kTrackPosition; /* Position Mode */
- cdpb.csParam.words[1] = 0; /* Search Address (hiword)*/
- cdpb.csParam.words[2] = SDL_SYS_ShortToBCD(1); /* Search Address (loword)*/
- cdpb.csParam.words[3] = false; /* Stop address? */
- cdpb.csParam.words[4] = kStereoPlayMode; /* Audio Play Mode */
- if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
- SDL_SetError("PBControlSync() failed");
- return(-1);
- }
-#endif
-
- return(0);
-}
-
-/* Pause play */
-static int SDL_SYS_CDPause(SDL_CD *cdrom)
-{
- CDCntrlParam cdpb;
-
- SDL_memset(&cdpb, 0, sizeof(cdpb));
- cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
- cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
- cdpb.csCode = kAudioPause;
- cdpb.csParam.words[0] = 0; /* Pause/Continue Flag (hiword) */
- cdpb.csParam.words[1] = 1; /* Pause/Continue Flag (loword) */
- if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
- SDL_SetError("PBControlSync() failed");
- return(-1);
- }
- return(0);
-}
-
-/* Resume play */
-static int SDL_SYS_CDResume(SDL_CD *cdrom)
-{
- CDCntrlParam cdpb;
-
- SDL_memset(&cdpb, 0, sizeof(cdpb));
- cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
- cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
- cdpb.csCode = kAudioPause;
- cdpb.csParam.words[0] = 0; /* Pause/Continue Flag (hiword) */
- cdpb.csParam.words[1] = 0; /* Pause/Continue Flag (loword) */
- if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
- SDL_SetError("PBControlSync() failed");
- return(-1);
- }
- return(0);
-}
-
-/* Stop play */
-static int SDL_SYS_CDStop(SDL_CD *cdrom)
-{
- CDCntrlParam cdpb;
-
- SDL_memset(&cdpb, 0, sizeof(cdpb));
- cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
- cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
- cdpb.csCode = kAudioStop;
- cdpb.csParam.words[0] = 0; /* Position Mode */
- cdpb.csParam.words[1] = 0; /* Search Address (hiword) */
- cdpb.csParam.words[2] = 0; /* Search Address (loword) */
- if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
- SDL_SetError("PBControlSync() failed");
- return(-1);
- }
- return(0);
-}
-
-/* Eject the CD-ROM */
-static int SDL_SYS_CDEject(SDL_CD *cdrom)
-{
- Boolean disk = false;
- QHdr *driveQ = GetDrvQHdr();
- DrvQEl *driveElem;
- HParamBlockRec hpb;
- ParamBlockRec cpb;
-
- for ( driveElem = (DrvQEl *) driveQ->qHead; driveElem; driveElem =
- (driveElem) ? ((DrvQEl *) driveElem->qLink) :
- ((DrvQEl *) driveQ->qHead) ) {
- if ( driveQ->qTail ) {
- driveQ->qTail->qLink = 0;
- }
- if ( driveElem->dQRefNum != SDL_cdlist[cdrom->id].dRefNum ) {
- continue;
- }
-
- /* Does drive contain mounted volume? If not, skip */
- SDL_memset(&hpb, 0, sizeof(hpb));
- hpb.volumeParam.ioVRefNum = driveElem->dQDrive;
- if ( PBHGetVInfoSync(&hpb) != noErr ) {
- continue;
- }
- if ( (UnmountVol(0, driveElem->dQDrive) == noErr) &&
- (Eject(0, driveElem->dQDrive) == noErr) ) {
- driveElem = 0; /* Clear pointer to reset our loop */
- disk = true;
- }
- }
-
- /* If no disk is present, just eject the tray */
- if (! disk) {
- SDL_memset(&cpb, 0, sizeof(cpb));
- cpb.cntrlParam.ioVRefNum = 0; /* No Drive */
- cpb.cntrlParam.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
- cpb.cntrlParam.csCode = kEjectTheDisc;
- if ( PBControlSync((ParmBlkPtr)&cpb) != noErr ) {
- SDL_SetError("PBControlSync() failed");
- return(-1);
- }
- }
- return(0);
-}
-
-/* Close the CD-ROM handle */
-static void SDL_SYS_CDClose(SDL_CD *cdrom)
-{
- return;
-}
-
-void SDL_SYS_CDQuit(void)
-{
- while(SDL_numcds--)
- SDL_memset(SDL_cdlist + SDL_numcds, 0, sizeof(SDL_cdlist[0]));
-}
-
-#endif /* SDL_CDROM_MACOS */
diff --git a/distrib/sdl-1.2.12/src/cdrom/macos/SDL_syscdrom_c.h b/distrib/sdl-1.2.12/src/cdrom/macos/SDL_syscdrom_c.h
deleted file mode 100644
index 835826e..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/macos/SDL_syscdrom_c.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This is the MacOS specific header for the SDL CD-ROM API
- Contributed by Matt Slot
- */
-
-/* AppleCD Control calls */
-#define kVerifyTheDisc 5 /* Returns noErr if there is disc inserted */
-#define kEjectTheDisc 7 /* Eject disc from drive */
-#define kUserEject 80 /* Enable/disable the CD-ROM eject button */
-#define kReadTOC 100 /* Extract various TOC information from the disc */
-#define kReadQ 101 /* Extract Q subcode info for the current track */
-#define kAudioTrackSearch 103 /* Start playback from the indicated position */
-#define kAudioPlay 104 /* Start playback from the indicated position */
-#define kAudioPause 105 /* Pause/continue the playback */
-#define kAudioStop 106 /* Stop playback at the indicated position */
-#define kAudioStatus 107 /* Return audio play status */
-#define kAudioControl 109 /* Set the output volume for the audio channels */
-#define kReadAudioVolume 112 /* Get the output volume for the audio channels */
-#define kSetTrackList 122 /* Set the track program for the audio CD to play */
-#define kGetTrackList 123 /* Get the track program the audio CD is playing */
-#define kGetTrackIndex 124 /* Get the track index the audio CD is playing */
-#define kSetPlayMode 125 /* Set the audio tracks play mode */
-#define kGetPlayMode 126 /* Get the audio tracks play mode */
-
-/* AppleCD Status calls */
-#define kGetDriveType 96 /* Get the type of the physical CD-ROM drive */
-#define kWhoIsThere 97 /* Get a bitmap of SCSI IDs the driver controls */
-#define kGetBlockSize 98 /* Get current block size of the CD-ROM drive */
-
-/* AppleCD other constants */
-#define kBlockPosition 0 /* Position at the specified logical block number */
-#define kAbsMSFPosition 1 /* Position at the specified Min/Sec/Frame (in BCD) */
-#define kTrackPosition 2 /* Position at the specified track number (in BCD) */
-#define kIndexPosition 3 /* Position at the nth track in program (in BCD) */
-
-#define kMutedPlayMode 0 /* Play the audio track with no output */
-#define kStereoPlayMode 9 /* Play the audio track in normal stereo */
-
-#define kControlFieldMask 0x0D /* Bits 3,2,0 in the nibble */
-#define kDataTrackMask 0x04 /* Indicates Data Track */
-
-#define kGetTrackRange 1 /* Query TOC for track numbers */
-#define kGetLeadOutArea 2 /* Query TOC for "Lead Out" end of audio data */
-#define kGetTrackEntries 3 /* Query TOC for track starts and data types */
-
-#define kStatusPlaying 0 /* Audio Play operation in progress */
-#define kStatusPaused 1 /* CD-ROM device in Hold Track ("Pause") state */
-#define kStatusMuted 2 /* MUTING-ON operation in progress */
-#define kStatusDone 3 /* Audio Play completed */
-#define kStatusError 4 /* Error occurred during audio play operation */
-#define kStatusStopped 5 /* Audio play operation not requested */
-
-#define kPlayModeSequential 0 /* Play tracks in order */
-#define kPlayModeShuffled 1 /* Play tracks randomly */
-#define kPlayModeProgrammed 2 /* Use custom playlist */
-
-/* AppleCD Gestalt selectors */
-#define kGestaltAudioCDSelector 'aucd'
-#define kDriverVersion52 0x00000520
-#define kDriverVersion51 0x00000510
-#define kDriverVersion50 0x00000500
-
-/* Drive type constants */
-#define kDriveAppleCD_SC 1
-#define kDriveAppleCD_SCPlus_or_150 2
-#define kDriveAppleCD_300_or_300Plus 3
-
-/* Misc constants */
-#define kFirstSCSIDevice -33
-#define kLastSCSIDevice -40
-
-#if PRAGMA_STRUCT_ALIGN
- #pragma options align=mac68k
-#endif
-
-/* AppleCD driver parameter block */
-typedef struct CDCntrlParam {
- QElemPtr qLink;
- short qType;
- short ioTrap;
- Ptr ioCmdAddr;
- IOCompletionUPP ioCompletion;
- OSErr ioResult;
- StringPtr ioNamePtr;
- short ioVRefNum;
- short ioCRefNum;
- short csCode;
-
- union {
- long longs[6];
- short words[11];
- unsigned char bytes[22];
- struct {
- unsigned char status;
- unsigned char play;
- unsigned char control;
- unsigned char minute;
- unsigned char second;
- unsigned char frame;
- } cd;
- } csParam;
-
- } CDCntrlParam, *CDCntrlParamPtr;
-
-typedef union CDTrackData {
- long value; /* Treat as a longword value */
- struct {
- unsigned char reserved : 4; /* Unused by AppleCD driver */
- unsigned char control : 4; /* Track flags (data track?) */
- unsigned char min; /* Start of track (BCD) */
- unsigned char sec; /* Start of track (BCD) */
- unsigned char frame; /* Start of track (BCD) */
- } entry; /* Broken into fields */
- } CDTrackData, *CDTrackPtr;
-
-#if PRAGMA_STRUCT_ALIGN
- #pragma options align=reset
-#endif
diff --git a/distrib/sdl-1.2.12/src/cdrom/macosx/AudioFilePlayer.c b/distrib/sdl-1.2.12/src/cdrom/macosx/AudioFilePlayer.c
deleted file mode 100644
index 333eb0c..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/macosx/AudioFilePlayer.c
+++ /dev/null
@@ -1,354 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- This file based on Apple sample code. We haven't changed the file name,
- so if you want to see the original search for it on apple.com/developer
-*/
-#include "SDL_config.h"
-
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- AudioFilePlayer.cpp
-*/
-#include "AudioFilePlayer.h"
-
-/*
-void ThrowResult (OSStatus result, const char* str)
-{
- SDL_SetError ("Error: %s %d", str, result);
- throw result;
-}
-*/
-
-#if DEBUG
-static void PrintStreamDesc (AudioStreamBasicDescription *inDesc)
-{
- if (!inDesc) {
- printf ("Can't print a NULL desc!\n");
- return;
- }
-
- printf ("- - - - - - - - - - - - - - - - - - - -\n");
- printf (" Sample Rate:%f\n", inDesc->mSampleRate);
- printf (" Format ID:%s\n", (char*)&inDesc->mFormatID);
- printf (" Format Flags:%lX\n", inDesc->mFormatFlags);
- printf (" Bytes per Packet:%ld\n", inDesc->mBytesPerPacket);
- printf (" Frames per Packet:%ld\n", inDesc->mFramesPerPacket);
- printf (" Bytes per Frame:%ld\n", inDesc->mBytesPerFrame);
- printf (" Channels per Frame:%ld\n", inDesc->mChannelsPerFrame);
- printf (" Bits per Channel:%ld\n", inDesc->mBitsPerChannel);
- printf ("- - - - - - - - - - - - - - - - - - - -\n");
-}
-#endif
-
-
-static int AudioFilePlayer_SetDestination (AudioFilePlayer *afp, AudioUnit *inDestUnit)
-{
- /*if (afp->mConnected) throw static_cast<OSStatus>(-1);*/ /* can't set dest if already engaged */
- if (afp->mConnected)
- return 0 ;
-
- SDL_memcpy(&afp->mPlayUnit, inDestUnit, sizeof (afp->mPlayUnit));
-
- OSStatus result = noErr;
-
-
- /* we can "down" cast a component instance to a component */
- ComponentDescription desc;
- result = GetComponentInfo ((Component)*inDestUnit, &desc, 0, 0, 0);
- if (result) return 0; /*THROW_RESULT("GetComponentInfo")*/
-
- /* we're going to use this to know which convert routine to call
- a v1 audio unit will have a type of 'aunt'
- a v2 audio unit will have one of several different types. */
- if (desc.componentType != kAudioUnitComponentType) {
- result = badComponentInstance;
- /*THROW_RESULT("BAD COMPONENT")*/
- if (result) return 0;
- }
-
- /* Set the input format of the audio unit. */
- result = AudioUnitSetProperty (*inDestUnit,
- kAudioUnitProperty_StreamFormat,
- kAudioUnitScope_Input,
- 0,
- &afp->mFileDescription,
- sizeof (afp->mFileDescription));
- /*THROW_RESULT("AudioUnitSetProperty")*/
- if (result) return 0;
- return 1;
-}
-
-static void AudioFilePlayer_SetNotifier(AudioFilePlayer *afp, AudioFilePlayNotifier inNotifier, void *inRefCon)
-{
- afp->mNotifier = inNotifier;
- afp->mRefCon = inRefCon;
-}
-
-static int AudioFilePlayer_IsConnected(AudioFilePlayer *afp)
-{
- return afp->mConnected;
-}
-
-static AudioUnit AudioFilePlayer_GetDestUnit(AudioFilePlayer *afp)
-{
- return afp->mPlayUnit;
-}
-
-static void AudioFilePlayer_Print(AudioFilePlayer *afp)
-{
-#if DEBUG
- printf ("Is Connected:%s\n", (IsConnected() ? "true" : "false"));
- printf ("- - - - - - - - - - - - - - \n");
-#endif
-}
-
-static void AudioFilePlayer_SetStartFrame (AudioFilePlayer *afp, int frame)
-{
- SInt64 position = frame * 2352;
-
- afp->mStartFrame = frame;
- afp->mAudioFileManager->SetPosition (afp->mAudioFileManager, position);
-}
-
-
-static int AudioFilePlayer_GetCurrentFrame (AudioFilePlayer *afp)
-{
- return afp->mStartFrame + (afp->mAudioFileManager->GetByteCounter(afp->mAudioFileManager) / 2352);
-}
-
-static void AudioFilePlayer_SetStopFrame (AudioFilePlayer *afp, int frame)
-{
- SInt64 position = frame * 2352;
-
- afp->mAudioFileManager->SetEndOfFile (afp->mAudioFileManager, position);
-}
-
-void delete_AudioFilePlayer(AudioFilePlayer *afp)
-{
- if (afp != NULL)
- {
- afp->Disconnect(afp);
-
- if (afp->mAudioFileManager) {
- delete_AudioFileManager(afp->mAudioFileManager);
- afp->mAudioFileManager = 0;
- }
-
- if (afp->mForkRefNum) {
- FSCloseFork (afp->mForkRefNum);
- afp->mForkRefNum = 0;
- }
- SDL_free(afp);
- }
-}
-
-static int AudioFilePlayer_Connect(AudioFilePlayer *afp)
-{
-#if DEBUG
- printf ("Connect:%x, engaged=%d\n", (int)afp->mPlayUnit, (afp->mConnected ? 1 : 0));
-#endif
- if (!afp->mConnected)
- {
- if (!afp->mAudioFileManager->DoConnect(afp->mAudioFileManager))
- return 0;
-
- /* set the render callback for the file data to be supplied to the sound converter AU */
- afp->mInputCallback.inputProc = afp->mAudioFileManager->FileInputProc;
- afp->mInputCallback.inputProcRefCon = afp->mAudioFileManager;
-
- OSStatus result = AudioUnitSetProperty (afp->mPlayUnit,
- kAudioUnitProperty_SetInputCallback,
- kAudioUnitScope_Input,
- 0,
- &afp->mInputCallback,
- sizeof(afp->mInputCallback));
- if (result) return 0; /*THROW_RESULT("AudioUnitSetProperty")*/
- afp->mConnected = 1;
- }
-
- return 1;
-}
-
-/* warning noted, now please go away ;-) */
-/* #warning This should redirect the calling of notification code to some other thread */
-static void AudioFilePlayer_DoNotification (AudioFilePlayer *afp, OSStatus inStatus)
-{
- if (afp->mNotifier) {
- (*afp->mNotifier) (afp->mRefCon, inStatus);
- } else {
- SDL_SetError ("Notification posted with no notifier in place");
-
- if (inStatus == kAudioFilePlay_FileIsFinished)
- afp->Disconnect(afp);
- else if (inStatus != kAudioFilePlayErr_FilePlayUnderrun)
- afp->Disconnect(afp);
- }
-}
-
-static void AudioFilePlayer_Disconnect (AudioFilePlayer *afp)
-{
-#if DEBUG
- printf ("Disconnect:%x,%ld, engaged=%d\n", (int)afp->mPlayUnit, 0, (afp->mConnected ? 1 : 0));
-#endif
- if (afp->mConnected)
- {
- afp->mConnected = 0;
-
- afp->mInputCallback.inputProc = 0;
- afp->mInputCallback.inputProcRefCon = 0;
- OSStatus result = AudioUnitSetProperty (afp->mPlayUnit,
- kAudioUnitProperty_SetInputCallback,
- kAudioUnitScope_Input,
- 0,
- &afp->mInputCallback,
- sizeof(afp->mInputCallback));
- if (result)
- SDL_SetError ("AudioUnitSetProperty:RemoveInputCallback:%ld", result);
-
- afp->mAudioFileManager->Disconnect(afp->mAudioFileManager);
- }
-}
-
-typedef struct {
- UInt32 offset;
- UInt32 blockSize;
-} SSNDData;
-
-static int AudioFilePlayer_OpenFile (AudioFilePlayer *afp, const FSRef *inRef, SInt64 *outFileDataSize)
-{
- ContainerChunk chunkHeader;
- ChunkHeader chunk;
- SSNDData ssndData;
-
- OSErr result;
- HFSUniStr255 dfName;
- ByteCount actual;
- SInt64 offset;
-
- /* Open the data fork of the input file */
- result = FSGetDataForkName(&dfName);
- if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): FSGetDataForkName")*/
-
- result = FSOpenFork(inRef, dfName.length, dfName.unicode, fsRdPerm, &afp->mForkRefNum);
- if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): FSOpenFork")*/
-
- /* Read the file header, and check if it's indeed an AIFC file */
- result = FSReadFork(afp->mForkRefNum, fsAtMark, 0, sizeof(chunkHeader), &chunkHeader, &actual);
- if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): FSReadFork")*/
-
- if (chunkHeader.ckID != 'FORM') {
- result = -1;
- if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): chunk id is not 'FORM'");*/
- }
-
- if (chunkHeader.formType != 'AIFC') {
- result = -1;
- if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): file format is not 'AIFC'");*/
- }
-
- /* Search for the SSND chunk. We ignore all compression etc. information
- in other chunks. Of course that is kind of evil, but for now we are lazy
- and rely on the cdfs to always give us the same fixed format.
- TODO: Parse the COMM chunk we currently skip to fill in mFileDescription.
- */
- offset = 0;
- do {
- result = FSReadFork(afp->mForkRefNum, fsFromMark, offset, sizeof(chunk), &chunk, &actual);
- if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): FSReadFork")*/
-
- /* Skip the chunk data */
- offset = chunk.ckSize;
- } while (chunk.ckID != 'SSND');
-
- /* Read the header of the SSND chunk. After this, we are positioned right
- at the start of the audio data. */
- result = FSReadFork(afp->mForkRefNum, fsAtMark, 0, sizeof(ssndData), &ssndData, &actual);
- if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): FSReadFork")*/
-
- result = FSSetForkPosition(afp->mForkRefNum, fsFromMark, ssndData.offset);
- if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): FSSetForkPosition")*/
-
- /* Data size */
- *outFileDataSize = chunk.ckSize - ssndData.offset - 8;
-
- /* File format */
- afp->mFileDescription.mSampleRate = 44100;
- afp->mFileDescription.mFormatID = kAudioFormatLinearPCM;
- afp->mFileDescription.mFormatFlags = kLinearPCMFormatFlagIsPacked | kLinearPCMFormatFlagIsSignedInteger;
- afp->mFileDescription.mBytesPerPacket = 4;
- afp->mFileDescription.mFramesPerPacket = 1;
- afp->mFileDescription.mBytesPerFrame = 4;
- afp->mFileDescription.mChannelsPerFrame = 2;
- afp->mFileDescription.mBitsPerChannel = 16;
-
- return 1;
-}
-
-AudioFilePlayer *new_AudioFilePlayer (const FSRef *inFileRef)
-{
- SInt64 fileDataSize = 0;
-
- AudioFilePlayer *afp = (AudioFilePlayer *) SDL_malloc(sizeof (AudioFilePlayer));
- if (afp == NULL)
- return NULL;
- SDL_memset(afp, '\0', sizeof (*afp));
-
- #define SET_AUDIOFILEPLAYER_METHOD(m) afp->m = AudioFilePlayer_##m
- SET_AUDIOFILEPLAYER_METHOD(SetDestination);
- SET_AUDIOFILEPLAYER_METHOD(SetNotifier);
- SET_AUDIOFILEPLAYER_METHOD(SetStartFrame);
- SET_AUDIOFILEPLAYER_METHOD(GetCurrentFrame);
- SET_AUDIOFILEPLAYER_METHOD(SetStopFrame);
- SET_AUDIOFILEPLAYER_METHOD(Connect);
- SET_AUDIOFILEPLAYER_METHOD(Disconnect);
- SET_AUDIOFILEPLAYER_METHOD(DoNotification);
- SET_AUDIOFILEPLAYER_METHOD(IsConnected);
- SET_AUDIOFILEPLAYER_METHOD(GetDestUnit);
- SET_AUDIOFILEPLAYER_METHOD(Print);
- SET_AUDIOFILEPLAYER_METHOD(OpenFile);
- #undef SET_AUDIOFILEPLAYER_METHOD
-
- if (!afp->OpenFile (afp, inFileRef, &fileDataSize))
- {
- SDL_free(afp);
- return NULL;
- }
-
- /* we want about 4 seconds worth of data for the buffer */
- int bytesPerSecond = (UInt32) (4 * afp->mFileDescription.mSampleRate * afp->mFileDescription.mBytesPerFrame);
-
-#if DEBUG
- printf("File format:\n");
- PrintStreamDesc (&afp->mFileDescription);
-#endif
-
- afp->mAudioFileManager = new_AudioFileManager(afp, afp->mForkRefNum,
- fileDataSize,
- bytesPerSecond);
- if (afp->mAudioFileManager == NULL)
- {
- delete_AudioFilePlayer(afp);
- return NULL;
- }
-
- return afp;
-}
-
diff --git a/distrib/sdl-1.2.12/src/cdrom/macosx/AudioFilePlayer.h b/distrib/sdl-1.2.12/src/cdrom/macosx/AudioFilePlayer.h
deleted file mode 100644
index 1d7eb19..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/macosx/AudioFilePlayer.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- This file based on Apple sample code. We haven't changed the file name,
- so if you want to see the original search for it on apple.com/developer
-*/
-#include "SDL_config.h"
-
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- AudioFilePlayer.h
-*/
-#ifndef __AudioFilePlayer_H__
-#define __AudioFilePlayer_H__
-
-#include <CoreServices/CoreServices.h>
-
-#include <AudioUnit/AudioUnit.h>
-
-#include "SDL_error.h"
-
-const char* AudioFilePlayerErrorStr (OSStatus error);
-
-/*
-void ThrowResult (OSStatus result, const char *str);
-
-#define THROW_RESULT(str) \
- if (result) { \
- ThrowResult (result, str); \
- }
-*/
-
-typedef void (*AudioFilePlayNotifier)(void *inRefCon,
- OSStatus inStatus);
-
-enum {
- kAudioFilePlayErr_FilePlayUnderrun = -10000,
- kAudioFilePlay_FileIsFinished = -10001,
- kAudioFilePlay_PlayerIsUninitialized = -10002
-};
-
-
-struct S_AudioFileManager;
-
-#pragma mark __________ AudioFilePlayer
-typedef struct S_AudioFilePlayer
-{
-/*public:*/
- int (*SetDestination)(struct S_AudioFilePlayer *afp, AudioUnit *inDestUnit);
- void (*SetNotifier)(struct S_AudioFilePlayer *afp, AudioFilePlayNotifier inNotifier, void *inRefCon);
- void (*SetStartFrame)(struct S_AudioFilePlayer *afp, int frame); /* seek in the file */
- int (*GetCurrentFrame)(struct S_AudioFilePlayer *afp); /* get the current frame position */
- void (*SetStopFrame)(struct S_AudioFilePlayer *afp, int frame); /* set limit in the file */
- int (*Connect)(struct S_AudioFilePlayer *afp);
- void (*Disconnect)(struct S_AudioFilePlayer *afp);
- void (*DoNotification)(struct S_AudioFilePlayer *afp, OSStatus inError);
- int (*IsConnected)(struct S_AudioFilePlayer *afp);
- AudioUnit (*GetDestUnit)(struct S_AudioFilePlayer *afp);
- void (*Print)(struct S_AudioFilePlayer *afp);
-
-/*private:*/
- AudioUnit mPlayUnit;
- SInt16 mForkRefNum;
-
- AudioUnitInputCallback mInputCallback;
-
- AudioStreamBasicDescription mFileDescription;
-
- int mConnected;
-
- struct S_AudioFileManager* mAudioFileManager;
-
- AudioFilePlayNotifier mNotifier;
- void* mRefCon;
-
- int mStartFrame;
-
-#pragma mark __________ Private_Methods
-
- int (*OpenFile)(struct S_AudioFilePlayer *afp, const FSRef *inRef, SInt64 *outFileSize);
-} AudioFilePlayer;
-
-
-AudioFilePlayer *new_AudioFilePlayer(const FSRef *inFileRef);
-void delete_AudioFilePlayer(AudioFilePlayer *afp);
-
-
-
-#pragma mark __________ AudioFileManager
-typedef struct S_AudioFileManager
-{
-/*public:*/
- /* this method should NOT be called by an object of this class
- as it is called by the parent's Disconnect() method */
- void (*Disconnect)(struct S_AudioFileManager *afm);
- int (*DoConnect)(struct S_AudioFileManager *afm);
- OSStatus (*Read)(struct S_AudioFileManager *afm, char *buffer, UInt32 *len);
- const char* (*GetFileBuffer)(struct S_AudioFileManager *afm);
- const AudioFilePlayer *(*GetParent)(struct S_AudioFileManager *afm);
- void (*SetPosition)(struct S_AudioFileManager *afm, SInt64 pos); /* seek/rewind in the file */
- int (*GetByteCounter)(struct S_AudioFileManager *afm); /* return actual bytes streamed to audio hardware */
- void (*SetEndOfFile)(struct S_AudioFileManager *afm, SInt64 pos); /* set the "EOF" (will behave just like it reached eof) */
-
-/*protected:*/
- AudioFilePlayer* mParent;
- SInt16 mForkRefNum;
- SInt64 mAudioDataOffset;
-
- char* mFileBuffer;
-
- int mByteCounter;
-
- int mReadFromFirstBuffer;
- int mLockUnsuccessful;
- int mIsEngaged;
-
- int mNumTimesAskedSinceFinished;
-
-
- void* mTmpBuffer;
- UInt32 mBufferSize;
- UInt32 mBufferOffset;
-/*public:*/
- UInt32 mChunkSize;
- SInt64 mFileLength;
- SInt64 mReadFilePosition;
- int mWriteToFirstBuffer;
- int mFinishedReadingData;
-
-/*protected:*/
- OSStatus (*Render)(struct S_AudioFileManager *afm, AudioBuffer *ioData);
- OSStatus (*GetFileData)(struct S_AudioFileManager *afm, void** inOutData, UInt32 *inOutDataSize);
- void (*AfterRender)(struct S_AudioFileManager *afm);
-
-/*public:*/
- /*static*/
- OSStatus (*FileInputProc)(void *inRefCon,
- AudioUnitRenderActionFlags inActionFlags,
- const AudioTimeStamp *inTimeStamp,
- UInt32 inBusNumber,
- AudioBuffer *ioData);
-} AudioFileManager;
-
-
-AudioFileManager *new_AudioFileManager (AudioFilePlayer *inParent,
- SInt16 inForkRefNum,
- SInt64 inFileLength,
- UInt32 inChunkSize);
-
-void delete_AudioFileManager(AudioFileManager *afm);
-
-#endif
-
diff --git a/distrib/sdl-1.2.12/src/cdrom/macosx/AudioFileReaderThread.c b/distrib/sdl-1.2.12/src/cdrom/macosx/AudioFileReaderThread.c
deleted file mode 100644
index db7fe9b..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/macosx/AudioFileReaderThread.c
+++ /dev/null
@@ -1,605 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- This file based on Apple sample code. We haven't changed the file name,
- so if you want to see the original search for it on apple.com/developer
-*/
-#include "SDL_config.h"
-
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- AudioFileManager.cpp
-*/
-#include "AudioFilePlayer.h"
-#include <mach/mach.h> /* used for setting policy of thread */
-#include "SDLOSXCAGuard.h"
-#include <pthread.h>
-
-/*#include <list>*/
-
-/*typedef void *FileData;*/
-typedef struct S_FileData
-{
- AudioFileManager *obj;
- struct S_FileData *next;
-} FileData;
-
-
-typedef struct S_FileReaderThread {
-/*public:*/
- SDLOSXCAGuard* (*GetGuard)(struct S_FileReaderThread *frt);
- void (*AddReader)(struct S_FileReaderThread *frt);
- void (*RemoveReader)(struct S_FileReaderThread *frt, AudioFileManager* inItem);
- int (*TryNextRead)(struct S_FileReaderThread *frt, AudioFileManager* inItem);
-
- int mThreadShouldDie;
-
-/*private:*/
- /*typedef std::list<AudioFileManager*> FileData;*/
-
- SDLOSXCAGuard *mGuard;
- UInt32 mThreadPriority;
-
- int mNumReaders;
- FileData *mFileData;
-
-
- void (*ReadNextChunk)(struct S_FileReaderThread *frt);
- int (*StartFixedPriorityThread)(struct S_FileReaderThread *frt);
- /*static*/
- UInt32 (*GetThreadBasePriority)(pthread_t inThread);
- /*static*/
- void* (*DiskReaderEntry)(void *inRefCon);
-} FileReaderThread;
-
-
-static SDLOSXCAGuard* FileReaderThread_GetGuard(FileReaderThread *frt)
-{
- return frt->mGuard;
-}
-
-/* returns 1 if succeeded */
-static int FileReaderThread_TryNextRead (FileReaderThread *frt, AudioFileManager* inItem)
-{
- int didLock = 0;
- int succeeded = 0;
- if (frt->mGuard->Try(frt->mGuard, &didLock))
- {
- /*frt->mFileData.push_back (inItem);*/
- /* !!! FIXME: this could be faster with a "tail" member. --ryan. */
- FileData *i = frt->mFileData;
- FileData *prev = NULL;
-
- FileData *newfd = (FileData *) SDL_malloc(sizeof (FileData));
- newfd->obj = inItem;
- newfd->next = NULL;
-
- while (i != NULL) { prev = i; i = i->next; }
- if (prev == NULL)
- frt->mFileData = newfd;
- else
- prev->next = newfd;
-
- frt->mGuard->Notify(frt->mGuard);
- succeeded = 1;
-
- if (didLock)
- frt->mGuard->Unlock(frt->mGuard);
- }
-
- return succeeded;
-}
-
-static void FileReaderThread_AddReader(FileReaderThread *frt)
-{
- if (frt->mNumReaders == 0)
- {
- frt->mThreadShouldDie = 0;
- frt->StartFixedPriorityThread (frt);
- }
- frt->mNumReaders++;
-}
-
-static void FileReaderThread_RemoveReader (FileReaderThread *frt, AudioFileManager* inItem)
-{
- if (frt->mNumReaders > 0)
- {
- int bNeedsRelease = frt->mGuard->Lock(frt->mGuard);
-
- /*frt->mFileData.remove (inItem);*/
- FileData *i = frt->mFileData;
- FileData *prev = NULL;
- while (i != NULL)
- {
- FileData *next = i->next;
- if (i->obj != inItem)
- prev = i;
- else
- {
- if (prev == NULL)
- frt->mFileData = next;
- else
- prev->next = next;
- SDL_free(i);
- }
- i = next;
- }
-
- if (--frt->mNumReaders == 0) {
- frt->mThreadShouldDie = 1;
- frt->mGuard->Notify(frt->mGuard); /* wake up thread so it will quit */
- frt->mGuard->Wait(frt->mGuard); /* wait for thread to die */
- }
-
- if (bNeedsRelease) frt->mGuard->Unlock(frt->mGuard);
- }
-}
-
-static int FileReaderThread_StartFixedPriorityThread (FileReaderThread *frt)
-{
- pthread_attr_t theThreadAttrs;
- pthread_t pThread;
-
- OSStatus result = pthread_attr_init(&theThreadAttrs);
- if (result) return 0; /*THROW_RESULT("pthread_attr_init - Thread attributes could not be created.")*/
-
- result = pthread_attr_setdetachstate(&theThreadAttrs, PTHREAD_CREATE_DETACHED);
- if (result) return 0; /*THROW_RESULT("pthread_attr_setdetachstate - Thread attributes could not be detached.")*/
-
- result = pthread_create (&pThread, &theThreadAttrs, frt->DiskReaderEntry, frt);
- if (result) return 0; /*THROW_RESULT("pthread_create - Create and start the thread.")*/
-
- pthread_attr_destroy(&theThreadAttrs);
-
- /* we've now created the thread and started it
- we'll now set the priority of the thread to the nominated priority
- and we'll also make the thread fixed */
- thread_extended_policy_data_t theFixedPolicy;
- thread_precedence_policy_data_t thePrecedencePolicy;
- SInt32 relativePriority;
-
- /* make thread fixed */
- theFixedPolicy.timeshare = 0; /* set to 1 for a non-fixed thread */
- result = thread_policy_set (pthread_mach_thread_np(pThread), THREAD_EXTENDED_POLICY, (thread_policy_t)&theFixedPolicy, THREAD_EXTENDED_POLICY_COUNT);
- if (result) return 0; /*THROW_RESULT("thread_policy - Couldn't set thread as fixed priority.")*/
- /* set priority */
- /* precedency policy's "importance" value is relative to spawning thread's priority */
- relativePriority = frt->mThreadPriority - frt->GetThreadBasePriority(pthread_self());
-
- thePrecedencePolicy.importance = relativePriority;
- result = thread_policy_set (pthread_mach_thread_np(pThread), THREAD_PRECEDENCE_POLICY, (thread_policy_t)&thePrecedencePolicy, THREAD_PRECEDENCE_POLICY_COUNT);
- if (result) return 0; /*THROW_RESULT("thread_policy - Couldn't set thread priority.")*/
-
- return 1;
-}
-
-static UInt32 FileReaderThread_GetThreadBasePriority (pthread_t inThread)
-{
- thread_basic_info_data_t threadInfo;
- policy_info_data_t thePolicyInfo;
- unsigned int count;
-
- /* get basic info */
- count = THREAD_BASIC_INFO_COUNT;
- thread_info (pthread_mach_thread_np (inThread), THREAD_BASIC_INFO, (integer_t*)&threadInfo, &count);
-
- switch (threadInfo.policy) {
- case POLICY_TIMESHARE:
- count = POLICY_TIMESHARE_INFO_COUNT;
- thread_info(pthread_mach_thread_np (inThread), THREAD_SCHED_TIMESHARE_INFO, (integer_t*)&(thePolicyInfo.ts), &count);
- return thePolicyInfo.ts.base_priority;
- break;
-
- case POLICY_FIFO:
- count = POLICY_FIFO_INFO_COUNT;
- thread_info(pthread_mach_thread_np (inThread), THREAD_SCHED_FIFO_INFO, (integer_t*)&(thePolicyInfo.fifo), &count);
- if (thePolicyInfo.fifo.depressed) {
- return thePolicyInfo.fifo.depress_priority;
- } else {
- return thePolicyInfo.fifo.base_priority;
- }
- break;
-
- case POLICY_RR:
- count = POLICY_RR_INFO_COUNT;
- thread_info(pthread_mach_thread_np (inThread), THREAD_SCHED_RR_INFO, (integer_t*)&(thePolicyInfo.rr), &count);
- if (thePolicyInfo.rr.depressed) {
- return thePolicyInfo.rr.depress_priority;
- } else {
- return thePolicyInfo.rr.base_priority;
- }
- break;
- }
-
- return 0;
-}
-
-static void *FileReaderThread_DiskReaderEntry (void *inRefCon)
-{
- FileReaderThread *frt = (FileReaderThread *)inRefCon;
- frt->ReadNextChunk(frt);
- #if DEBUG
- printf ("finished with reading file\n");
- #endif
-
- return 0;
-}
-
-static void FileReaderThread_ReadNextChunk (FileReaderThread *frt)
-{
- OSStatus result;
- UInt32 dataChunkSize;
- AudioFileManager* theItem = 0;
-
- for (;;)
- {
- { /* this is a scoped based lock */
- int bNeedsRelease = frt->mGuard->Lock(frt->mGuard);
-
- if (frt->mThreadShouldDie) {
- frt->mGuard->Notify(frt->mGuard);
- if (bNeedsRelease) frt->mGuard->Unlock(frt->mGuard);
- return;
- }
-
- /*if (frt->mFileData.empty())*/
- if (frt->mFileData == NULL)
- {
- frt->mGuard->Wait(frt->mGuard);
- }
-
- /* kill thread */
- if (frt->mThreadShouldDie) {
-
- frt->mGuard->Notify(frt->mGuard);
- if (bNeedsRelease) frt->mGuard->Unlock(frt->mGuard);
- return;
- }
-
- /*theItem = frt->mFileData.front();*/
- /*frt->mFileData.pop_front();*/
- theItem = NULL;
- if (frt->mFileData != NULL)
- {
- FileData *next = frt->mFileData->next;
- theItem = frt->mFileData->obj;
- SDL_free(frt->mFileData);
- frt->mFileData = next;
- }
-
- if (bNeedsRelease) frt->mGuard->Unlock(frt->mGuard);
- }
-
- if ((theItem->mFileLength - theItem->mReadFilePosition) < theItem->mChunkSize)
- dataChunkSize = theItem->mFileLength - theItem->mReadFilePosition;
- else
- dataChunkSize = theItem->mChunkSize;
-
- /* this is the exit condition for the thread */
- if (dataChunkSize <= 0) {
- theItem->mFinishedReadingData = 1;
- continue;
- }
- /* construct pointer */
- char* writePtr = (char *) (theItem->GetFileBuffer(theItem) +
- (theItem->mWriteToFirstBuffer ? 0 : theItem->mChunkSize));
-
- /* read data */
- result = theItem->Read(theItem, writePtr, &dataChunkSize);
- if (result != noErr && result != eofErr) {
- AudioFilePlayer *afp = (AudioFilePlayer *) theItem->GetParent(theItem);
- afp->DoNotification(afp, result);
- continue;
- }
-
- if (dataChunkSize != theItem->mChunkSize)
- {
- writePtr += dataChunkSize;
-
- /* can't exit yet.. we still have to pass the partial buffer back */
- SDL_memset(writePtr, 0, (theItem->mChunkSize - dataChunkSize));
- }
-
- theItem->mWriteToFirstBuffer = !theItem->mWriteToFirstBuffer; /* switch buffers */
-
- if (result == eofErr)
- theItem->mReadFilePosition = theItem->mFileLength;
- else
- theItem->mReadFilePosition += dataChunkSize; /* increment count */
- }
-}
-
-void delete_FileReaderThread(FileReaderThread *frt)
-{
- if (frt != NULL)
- {
- delete_SDLOSXCAGuard(frt->mGuard);
- SDL_free(frt);
- }
-}
-
-FileReaderThread *new_FileReaderThread ()
-{
- FileReaderThread *frt = (FileReaderThread *) SDL_malloc(sizeof (FileReaderThread));
- if (frt == NULL)
- return NULL;
- SDL_memset(frt, '\0', sizeof (*frt));
-
- frt->mGuard = new_SDLOSXCAGuard();
- if (frt->mGuard == NULL)
- {
- SDL_free(frt);
- return NULL;
- }
-
- #define SET_FILEREADERTHREAD_METHOD(m) frt->m = FileReaderThread_##m
- SET_FILEREADERTHREAD_METHOD(GetGuard);
- SET_FILEREADERTHREAD_METHOD(AddReader);
- SET_FILEREADERTHREAD_METHOD(RemoveReader);
- SET_FILEREADERTHREAD_METHOD(TryNextRead);
- SET_FILEREADERTHREAD_METHOD(ReadNextChunk);
- SET_FILEREADERTHREAD_METHOD(StartFixedPriorityThread);
- SET_FILEREADERTHREAD_METHOD(GetThreadBasePriority);
- SET_FILEREADERTHREAD_METHOD(DiskReaderEntry);
- #undef SET_FILEREADERTHREAD_METHOD
-
- frt->mThreadPriority = 62;
- return frt;
-}
-
-
-static FileReaderThread *sReaderThread;
-
-
-static int AudioFileManager_DoConnect (AudioFileManager *afm)
-{
- if (!afm->mIsEngaged)
- {
- OSStatus result;
-
- /*afm->mReadFilePosition = 0;*/
- afm->mFinishedReadingData = 0;
-
- afm->mNumTimesAskedSinceFinished = 0;
- afm->mLockUnsuccessful = 0;
-
- UInt32 dataChunkSize;
-
- if ((afm->mFileLength - afm->mReadFilePosition) < afm->mChunkSize)
- dataChunkSize = afm->mFileLength - afm->mReadFilePosition;
- else
- dataChunkSize = afm->mChunkSize;
-
- result = afm->Read(afm, afm->mFileBuffer, &dataChunkSize);
- if (result) return 0; /*THROW_RESULT("AudioFileManager::DoConnect(): Read")*/
-
- afm->mReadFilePosition += dataChunkSize;
-
- afm->mWriteToFirstBuffer = 0;
- afm->mReadFromFirstBuffer = 1;
-
- sReaderThread->AddReader(sReaderThread);
-
- afm->mIsEngaged = 1;
- }
- /*
- else
- throw static_cast<OSStatus>(-1); */ /* thread has already been started */
-
- return 1;
-}
-
-static void AudioFileManager_Disconnect (AudioFileManager *afm)
-{
- if (afm->mIsEngaged)
- {
- sReaderThread->RemoveReader (sReaderThread, afm);
- afm->mIsEngaged = 0;
- }
-}
-
-static OSStatus AudioFileManager_Read(AudioFileManager *afm, char *buffer, UInt32 *len)
-{
- return FSReadFork (afm->mForkRefNum,
- fsFromStart,
- afm->mReadFilePosition + afm->mAudioDataOffset,
- *len,
- buffer,
- len);
-}
-
-static OSStatus AudioFileManager_GetFileData (AudioFileManager *afm, void** inOutData, UInt32 *inOutDataSize)
-{
- if (afm->mFinishedReadingData)
- {
- ++afm->mNumTimesAskedSinceFinished;
- *inOutDataSize = 0;
- *inOutData = 0;
- return noErr;
- }
-
- if (afm->mReadFromFirstBuffer == afm->mWriteToFirstBuffer) {
- #if DEBUG
- printf ("* * * * * * * Can't keep up with reading file\n");
- #endif
-
- afm->mParent->DoNotification (afm->mParent, kAudioFilePlayErr_FilePlayUnderrun);
- *inOutDataSize = 0;
- *inOutData = 0;
- } else {
- *inOutDataSize = afm->mChunkSize;
- *inOutData = afm->mReadFromFirstBuffer ? afm->mFileBuffer : (afm->mFileBuffer + afm->mChunkSize);
- }
-
- afm->mLockUnsuccessful = !sReaderThread->TryNextRead (sReaderThread, afm);
-
- afm->mReadFromFirstBuffer = !afm->mReadFromFirstBuffer;
-
- return noErr;
-}
-
-static void AudioFileManager_AfterRender (AudioFileManager *afm)
-{
- if (afm->mNumTimesAskedSinceFinished > 0)
- {
- int didLock = 0;
- SDLOSXCAGuard *guard = sReaderThread->GetGuard(sReaderThread);
- if (guard->Try(guard, &didLock)) {
- afm->mParent->DoNotification (afm->mParent, kAudioFilePlay_FileIsFinished);
- if (didLock)
- guard->Unlock(guard);
- }
- }
-
- if (afm->mLockUnsuccessful)
- afm->mLockUnsuccessful = !sReaderThread->TryNextRead (sReaderThread, afm);
-}
-
-static void AudioFileManager_SetPosition (AudioFileManager *afm, SInt64 pos)
-{
- if (pos < 0 || pos >= afm->mFileLength) {
- SDL_SetError ("AudioFileManager::SetPosition - position invalid: %d filelen=%d\n",
- (unsigned int)pos, (unsigned int)afm->mFileLength);
- pos = 0;
- }
-
- afm->mReadFilePosition = pos;
-}
-
-static void AudioFileManager_SetEndOfFile (AudioFileManager *afm, SInt64 pos)
-{
- if (pos <= 0 || pos > afm->mFileLength) {
- SDL_SetError ("AudioFileManager::SetEndOfFile - position beyond actual eof\n");
- pos = afm->mFileLength;
- }
-
- afm->mFileLength = pos;
-}
-
-static const char *AudioFileManager_GetFileBuffer(AudioFileManager *afm)
-{
- return afm->mFileBuffer;
-}
-
-const AudioFilePlayer *AudioFileManager_GetParent(AudioFileManager *afm)
-{
- return afm->mParent;
-}
-
-static int AudioFileManager_GetByteCounter(AudioFileManager *afm)
-{
- return afm->mByteCounter;
-}
-
-
-static OSStatus AudioFileManager_FileInputProc (void *inRefCon,
- AudioUnitRenderActionFlags inActionFlags,
- const AudioTimeStamp *inTimeStamp,
- UInt32 inBusNumber,
- AudioBuffer *ioData)
-{
- AudioFileManager* afm = (AudioFileManager*)inRefCon;
- return afm->Render(afm, ioData);
-}
-
-static OSStatus AudioFileManager_Render (AudioFileManager *afm, AudioBuffer *ioData)
-{
- OSStatus result = noErr;
-
- if (afm->mBufferOffset >= afm->mBufferSize) {
- result = afm->GetFileData(afm, &afm->mTmpBuffer, &afm->mBufferSize);
- if (result) {
- SDL_SetError ("AudioConverterFillBuffer:%ld\n", result);
- afm->mParent->DoNotification(afm->mParent, result);
- return result;
- }
-
- afm->mBufferOffset = 0;
- }
-
- if (ioData->mDataByteSize > afm->mBufferSize - afm->mBufferOffset)
- ioData->mDataByteSize = afm->mBufferSize - afm->mBufferOffset;
- ioData->mData = (char *)afm->mTmpBuffer + afm->mBufferOffset;
- afm->mBufferOffset += ioData->mDataByteSize;
-
- afm->mByteCounter += ioData->mDataByteSize;
- afm->AfterRender(afm);
- return result;
-}
-
-
-void delete_AudioFileManager (AudioFileManager *afm)
-{
- if (afm != NULL) {
- if (afm->mFileBuffer) {
- free(afm->mFileBuffer);
- }
-
- SDL_free(afm);
- }
-}
-
-
-AudioFileManager *new_AudioFileManager(AudioFilePlayer *inParent,
- SInt16 inForkRefNum,
- SInt64 inFileLength,
- UInt32 inChunkSize)
-{
- AudioFileManager *afm;
-
- if (sReaderThread == NULL)
- {
- sReaderThread = new_FileReaderThread();
- if (sReaderThread == NULL)
- return NULL;
- }
-
- afm = (AudioFileManager *) SDL_malloc(sizeof (AudioFileManager));
- if (afm == NULL)
- return NULL;
- SDL_memset(afm, '\0', sizeof (*afm));
-
- #define SET_AUDIOFILEMANAGER_METHOD(m) afm->m = AudioFileManager_##m
- SET_AUDIOFILEMANAGER_METHOD(Disconnect);
- SET_AUDIOFILEMANAGER_METHOD(DoConnect);
- SET_AUDIOFILEMANAGER_METHOD(Read);
- SET_AUDIOFILEMANAGER_METHOD(GetFileBuffer);
- SET_AUDIOFILEMANAGER_METHOD(GetParent);
- SET_AUDIOFILEMANAGER_METHOD(SetPosition);
- SET_AUDIOFILEMANAGER_METHOD(GetByteCounter);
- SET_AUDIOFILEMANAGER_METHOD(SetEndOfFile);
- SET_AUDIOFILEMANAGER_METHOD(Render);
- SET_AUDIOFILEMANAGER_METHOD(GetFileData);
- SET_AUDIOFILEMANAGER_METHOD(AfterRender);
- SET_AUDIOFILEMANAGER_METHOD(FileInputProc);
- #undef SET_AUDIOFILEMANAGER_METHOD
-
- afm->mParent = inParent;
- afm->mForkRefNum = inForkRefNum;
- afm->mBufferSize = inChunkSize;
- afm->mBufferOffset = inChunkSize;
- afm->mChunkSize = inChunkSize;
- afm->mFileLength = inFileLength;
- afm->mFileBuffer = (char*) SDL_malloc(afm->mChunkSize * 2);
- FSGetForkPosition(afm->mForkRefNum, &afm->mAudioDataOffset);
- assert (afm->mFileBuffer != NULL);
- return afm;
-}
-
diff --git a/distrib/sdl-1.2.12/src/cdrom/macosx/CDPlayer.c b/distrib/sdl-1.2.12/src/cdrom/macosx/CDPlayer.c
deleted file mode 100644
index 16dc213..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/macosx/CDPlayer.c
+++ /dev/null
@@ -1,628 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "CDPlayer.h"
-#include "AudioFilePlayer.h"
-#include "SDLOSXCAGuard.h"
-
-/* we're exporting these functions into C land for SDL_syscdrom.c */
-/*extern "C" {*/
-
-/*///////////////////////////////////////////////////////////////////////////
- Constants
- //////////////////////////////////////////////////////////////////////////*/
-
-#define kAudioCDFilesystemID (UInt16)(('J' << 8) | 'H') /* 'JH'; this avoids compiler warning */
-
-/* XML PList keys */
-#define kRawTOCDataString "Format 0x02 TOC Data"
-#define kSessionsString "Sessions"
-#define kSessionTypeString "Session Type"
-#define kTrackArrayString "Track Array"
-#define kFirstTrackInSessionString "First Track"
-#define kLastTrackInSessionString "Last Track"
-#define kLeadoutBlockString "Leadout Block"
-#define kDataKeyString "Data"
-#define kPointKeyString "Point"
-#define kSessionNumberKeyString "Session Number"
-#define kStartBlockKeyString "Start Block"
-
-/*///////////////////////////////////////////////////////////////////////////
- Globals
- //////////////////////////////////////////////////////////////////////////*/
-
-#pragma mark -- Globals --
-
-static int playBackWasInit = 0;
-static AudioUnit theUnit;
-static AudioFilePlayer* thePlayer = NULL;
-static CDPlayerCompletionProc completionProc = NULL;
-static SDL_mutex *apiMutex = NULL;
-static SDL_sem *callbackSem;
-static SDL_CD* theCDROM;
-
-/*///////////////////////////////////////////////////////////////////////////
- Prototypes
- //////////////////////////////////////////////////////////////////////////*/
-
-#pragma mark -- Prototypes --
-
-static OSStatus CheckInit ();
-
-static void FilePlayNotificationHandler (void* inRefCon, OSStatus inStatus);
-
-static int RunCallBackThread (void* inRefCon);
-
-
-#pragma mark -- Public Functions --
-
-void Lock ()
-{
- if (!apiMutex) {
- apiMutex = SDL_CreateMutex();
- }
- SDL_mutexP(apiMutex);
-}
-
-void Unlock ()
-{
- SDL_mutexV(apiMutex);
-}
-
-int DetectAudioCDVolumes(FSVolumeRefNum *volumes, int numVolumes)
-{
- int volumeIndex;
- int cdVolumeCount = 0;
- OSStatus result = noErr;
-
- for (volumeIndex = 1; result == noErr || result != nsvErr; volumeIndex++)
- {
- FSVolumeRefNum actualVolume;
- FSVolumeInfo volumeInfo;
-
- memset (&volumeInfo, 0, sizeof(volumeInfo));
-
- result = FSGetVolumeInfo (kFSInvalidVolumeRefNum,
- volumeIndex,
- &actualVolume,
- kFSVolInfoFSInfo,
- &volumeInfo,
- NULL,
- NULL);
-
- if (result == noErr)
- {
- if (volumeInfo.filesystemID == kAudioCDFilesystemID) /* It's an audio CD */
- {
- if (volumes != NULL && cdVolumeCount < numVolumes)
- volumes[cdVolumeCount] = actualVolume;
-
- cdVolumeCount++;
- }
- }
- else
- {
- /* I'm commenting this out because it seems to be harmless */
- /*SDL_SetError ("DetectAudioCDVolumes: FSGetVolumeInfo returned %d", result);*/
- }
- }
-
- return cdVolumeCount;
-}
-
-int ReadTOCData (FSVolumeRefNum theVolume, SDL_CD *theCD)
-{
- HFSUniStr255 dataForkName;
- OSStatus theErr;
- SInt16 forkRefNum;
- SInt64 forkSize;
- Ptr forkData = 0;
- ByteCount actualRead;
- CFDataRef dataRef = 0;
- CFPropertyListRef propertyListRef = 0;
-
- FSRefParam fsRefPB;
- FSRef tocPlistFSRef;
-
- const char* error = "Unspecified Error";
-
- /* get stuff from .TOC.plist */
- fsRefPB.ioCompletion = NULL;
- fsRefPB.ioNamePtr = "\p.TOC.plist";
- fsRefPB.ioVRefNum = theVolume;
- fsRefPB.ioDirID = 0;
- fsRefPB.newRef = &tocPlistFSRef;
-
- theErr = PBMakeFSRefSync (&fsRefPB);
- if(theErr != noErr) {
- error = "PBMakeFSRefSync";
- goto bail;
- }
-
- /* Load and parse the TOC XML data */
-
- theErr = FSGetDataForkName (&dataForkName);
- if (theErr != noErr) {
- error = "FSGetDataForkName";
- goto bail;
- }
-
- theErr = FSOpenFork (&tocPlistFSRef, dataForkName.length, dataForkName.unicode, fsRdPerm, &forkRefNum);
- if (theErr != noErr) {
- error = "FSOpenFork";
- goto bail;
- }
-
- theErr = FSGetForkSize (forkRefNum, &forkSize);
- if (theErr != noErr) {
- error = "FSGetForkSize";
- goto bail;
- }
-
- /* Allocate some memory for the XML data */
- forkData = NewPtr (forkSize);
- if(forkData == NULL) {
- error = "NewPtr";
- goto bail;
- }
-
- theErr = FSReadFork (forkRefNum, fsFromStart, 0 /* offset location */, forkSize, forkData, &actualRead);
- if(theErr != noErr) {
- error = "FSReadFork";
- goto bail;
- }
-
- dataRef = CFDataCreate (kCFAllocatorDefault, (UInt8 *)forkData, forkSize);
- if(dataRef == 0) {
- error = "CFDataCreate";
- goto bail;
- }
-
- propertyListRef = CFPropertyListCreateFromXMLData (kCFAllocatorDefault,
- dataRef,
- kCFPropertyListImmutable,
- NULL);
- if (propertyListRef == NULL) {
- error = "CFPropertyListCreateFromXMLData";
- goto bail;
- }
-
- /* Now we got the Property List in memory. Parse it. */
-
- /* First, make sure the root item is a CFDictionary. If not, release and bail. */
- if(CFGetTypeID(propertyListRef)== CFDictionaryGetTypeID())
- {
- CFDictionaryRef dictRef = (CFDictionaryRef)propertyListRef;
-
- CFDataRef theRawTOCDataRef;
- CFArrayRef theSessionArrayRef;
- CFIndex numSessions;
- CFIndex index;
-
- /* This is how we get the Raw TOC Data */
- theRawTOCDataRef = (CFDataRef)CFDictionaryGetValue (dictRef, CFSTR(kRawTOCDataString));
-
- /* Get the session array info. */
- theSessionArrayRef = (CFArrayRef)CFDictionaryGetValue (dictRef, CFSTR(kSessionsString));
-
- /* Find out how many sessions there are. */
- numSessions = CFArrayGetCount (theSessionArrayRef);
-
- /* Initialize the total number of tracks to 0 */
- theCD->numtracks = 0;
-
- /* Iterate over all sessions, collecting the track data */
- for(index = 0; index < numSessions; index++)
- {
- CFDictionaryRef theSessionDict;
- CFNumberRef leadoutBlock;
- CFArrayRef trackArray;
- CFIndex numTracks;
- CFIndex trackIndex;
- UInt32 value = 0;
-
- theSessionDict = (CFDictionaryRef) CFArrayGetValueAtIndex (theSessionArrayRef, index);
- leadoutBlock = (CFNumberRef) CFDictionaryGetValue (theSessionDict, CFSTR(kLeadoutBlockString));
-
- trackArray = (CFArrayRef)CFDictionaryGetValue (theSessionDict, CFSTR(kTrackArrayString));
-
- numTracks = CFArrayGetCount (trackArray);
-
- for(trackIndex = 0; trackIndex < numTracks; trackIndex++) {
-
- CFDictionaryRef theTrackDict;
- CFNumberRef trackNumber;
- CFNumberRef sessionNumber;
- CFNumberRef startBlock;
- CFBooleanRef isDataTrack;
- UInt32 value;
-
- theTrackDict = (CFDictionaryRef) CFArrayGetValueAtIndex (trackArray, trackIndex);
-
- trackNumber = (CFNumberRef) CFDictionaryGetValue (theTrackDict, CFSTR(kPointKeyString));
- sessionNumber = (CFNumberRef) CFDictionaryGetValue (theTrackDict, CFSTR(kSessionNumberKeyString));
- startBlock = (CFNumberRef) CFDictionaryGetValue (theTrackDict, CFSTR(kStartBlockKeyString));
- isDataTrack = (CFBooleanRef) CFDictionaryGetValue (theTrackDict, CFSTR(kDataKeyString));
-
- /* Fill in the SDL_CD struct */
- int idx = theCD->numtracks++;
-
- CFNumberGetValue (trackNumber, kCFNumberSInt32Type, &value);
- theCD->track[idx].id = value;
-
- CFNumberGetValue (startBlock, kCFNumberSInt32Type, &value);
- theCD->track[idx].offset = value;
-
- theCD->track[idx].type = (isDataTrack == kCFBooleanTrue) ? SDL_DATA_TRACK : SDL_AUDIO_TRACK;
-
- /* Since the track lengths are not stored in .TOC.plist we compute them. */
- if (trackIndex > 0) {
- theCD->track[idx-1].length = theCD->track[idx].offset - theCD->track[idx-1].offset;
- }
- }
-
- /* Compute the length of the last track */
- CFNumberGetValue (leadoutBlock, kCFNumberSInt32Type, &value);
-
- theCD->track[theCD->numtracks-1].length =
- value - theCD->track[theCD->numtracks-1].offset;
-
- /* Set offset to leadout track */
- theCD->track[theCD->numtracks].offset = value;
- }
-
- }
-
- theErr = 0;
- goto cleanup;
-bail:
- SDL_SetError ("ReadTOCData: %s returned %d", error, theErr);
- theErr = -1;
-cleanup:
-
- if (propertyListRef != NULL)
- CFRelease(propertyListRef);
- if (dataRef != NULL)
- CFRelease(dataRef);
- if (forkData != NULL)
- DisposePtr(forkData);
-
- FSCloseFork (forkRefNum);
-
- return theErr;
-}
-
-int ListTrackFiles (FSVolumeRefNum theVolume, FSRef *trackFiles, int numTracks)
-{
- OSStatus result = -1;
- FSIterator iterator;
- ItemCount actualObjects;
- FSRef rootDirectory;
- FSRef ref;
- HFSUniStr255 nameStr;
-
- result = FSGetVolumeInfo (theVolume,
- 0,
- NULL,
- kFSVolInfoFSInfo,
- NULL,
- NULL,
- &rootDirectory);
-
- if (result != noErr) {
- SDL_SetError ("ListTrackFiles: FSGetVolumeInfo returned %d", result);
- return result;
- }
-
- result = FSOpenIterator (&rootDirectory, kFSIterateFlat, &iterator);
- if (result == noErr) {
- do
- {
- result = FSGetCatalogInfoBulk (iterator, 1, &actualObjects,
- NULL, kFSCatInfoNone, NULL, &ref, NULL, &nameStr);
- if (result == noErr) {
-
- CFStringRef name;
- name = CFStringCreateWithCharacters (NULL, nameStr.unicode, nameStr.length);
-
- /* Look for .aiff extension */
- if (CFStringHasSuffix (name, CFSTR(".aiff")) ||
- CFStringHasSuffix (name, CFSTR(".cdda"))) {
-
- /* Extract the track id from the filename */
- int trackID = 0, i = 0;
- while (i < nameStr.length && !isdigit(nameStr.unicode[i])) {
- ++i;
- }
- while (i < nameStr.length && isdigit(nameStr.unicode[i])) {
- trackID = 10 * trackID +(nameStr.unicode[i] - '0');
- ++i;
- }
-
- #if DEBUG_CDROM
- printf("Found AIFF for track %d: '%s'\n", trackID,
- CFStringGetCStringPtr (name, CFStringGetSystemEncoding()));
- #endif
-
- /* Track ID's start at 1, but we want to start at 0 */
- trackID--;
-
- assert(0 <= trackID && trackID <= SDL_MAX_TRACKS);
-
- if (trackID < numTracks)
- memcpy (&trackFiles[trackID], &ref, sizeof(FSRef));
- }
- CFRelease (name);
- }
- } while(noErr == result);
- FSCloseIterator (iterator);
- }
-
- return 0;
-}
-
-int LoadFile (const FSRef *ref, int startFrame, int stopFrame)
-{
- int error = -1;
-
- if (CheckInit () < 0)
- goto bail;
-
- /* release any currently playing file */
- if (ReleaseFile () < 0)
- goto bail;
-
- #if DEBUG_CDROM
- printf ("LoadFile: %d %d\n", startFrame, stopFrame);
- #endif
-
- /*try {*/
-
- /* create a new player, and attach to the audio unit */
-
- thePlayer = new_AudioFilePlayer(ref);
- if (thePlayer == NULL) {
- SDL_SetError ("LoadFile: Could not create player");
- return -3; /*throw (-3);*/
- }
-
- if (!thePlayer->SetDestination(thePlayer, &theUnit))
- goto bail;
-
- if (startFrame >= 0)
- thePlayer->SetStartFrame (thePlayer, startFrame);
-
- if (stopFrame >= 0 && stopFrame > startFrame)
- thePlayer->SetStopFrame (thePlayer, stopFrame);
-
- /* we set the notifier later */
- /*thePlayer->SetNotifier(thePlayer, FilePlayNotificationHandler, NULL);*/
-
- if (!thePlayer->Connect(thePlayer))
- goto bail;
-
- #if DEBUG_CDROM
- thePlayer->Print(thePlayer);
- fflush (stdout);
- #endif
- /*}
- catch (...)
- {
- goto bail;
- }*/
-
- error = 0;
-
- bail:
- return error;
-}
-
-int ReleaseFile ()
-{
- int error = -1;
-
- /* (Don't see any way that the original C++ code could throw here.) --ryan. */
- /*try {*/
- if (thePlayer != NULL) {
-
- thePlayer->Disconnect(thePlayer);
-
- delete_AudioFilePlayer(thePlayer);
-
- thePlayer = NULL;
- }
- /*}
- catch (...)
- {
- goto bail;
- }*/
-
- error = 0;
-
-/* bail: */
- return error;
-}
-
-int PlayFile ()
-{
- OSStatus result = -1;
-
- if (CheckInit () < 0)
- goto bail;
-
- /*try {*/
-
- // start processing of the audio unit
- result = AudioOutputUnitStart (theUnit);
- if (result) goto bail; //THROW_RESULT("PlayFile: AudioOutputUnitStart")
-
- /*}
- catch (...)
- {
- goto bail;
- }*/
-
- result = 0;
-
-bail:
- return result;
-}
-
-int PauseFile ()
-{
- OSStatus result = -1;
-
- if (CheckInit () < 0)
- goto bail;
-
- /*try {*/
-
- /* stop processing the audio unit */
- result = AudioOutputUnitStop (theUnit);
- if (result) goto bail; /*THROW_RESULT("PauseFile: AudioOutputUnitStop")*/
- /*}
- catch (...)
- {
- goto bail;
- }*/
-
- result = 0;
-bail:
- return result;
-}
-
-void SetCompletionProc (CDPlayerCompletionProc proc, SDL_CD *cdrom)
-{
- assert(thePlayer != NULL);
-
- theCDROM = cdrom;
- completionProc = proc;
- thePlayer->SetNotifier (thePlayer, FilePlayNotificationHandler, cdrom);
-}
-
-int GetCurrentFrame ()
-{
- int frame;
-
- if (thePlayer == NULL)
- frame = 0;
- else
- frame = thePlayer->GetCurrentFrame (thePlayer);
-
- return frame;
-}
-
-
-#pragma mark -- Private Functions --
-
-static OSStatus CheckInit ()
-{
- if (playBackWasInit)
- return 0;
-
- OSStatus result = noErr;
-
- /* Create the callback semaphore */
- callbackSem = SDL_CreateSemaphore(0);
-
- /* Start callback thread */
- SDL_CreateThread(RunCallBackThread, NULL);
-
- { /*try {*/
- ComponentDescription desc;
-
- desc.componentType = kAudioUnitComponentType;
- desc.componentSubType = kAudioUnitSubType_Output;
- desc.componentManufacturer = kAudioUnitID_DefaultOutput;
- desc.componentFlags = 0;
- desc.componentFlagsMask = 0;
-
- Component comp = FindNextComponent (NULL, &desc);
- if (comp == NULL) {
- SDL_SetError ("CheckInit: FindNextComponent returned NULL");
- if (result) return -1; //throw(internalComponentErr);
- }
-
- result = OpenAComponent (comp, &theUnit);
- if (result) return -1; //THROW_RESULT("CheckInit: OpenAComponent")
-
- // you need to initialize the output unit before you set it as a destination
- result = AudioUnitInitialize (theUnit);
- if (result) return -1; //THROW_RESULT("CheckInit: AudioUnitInitialize")
-
-
- playBackWasInit = true;
- }
- /*catch (...)
- {
- return -1;
- }*/
-
- return 0;
-}
-
-static void FilePlayNotificationHandler(void * inRefCon, OSStatus inStatus)
-{
- if (inStatus == kAudioFilePlay_FileIsFinished) {
-
- /* notify non-CA thread to perform the callback */
- SDL_SemPost(callbackSem);
-
- } else if (inStatus == kAudioFilePlayErr_FilePlayUnderrun) {
-
- SDL_SetError ("CDPlayer Notification: buffer underrun");
- } else if (inStatus == kAudioFilePlay_PlayerIsUninitialized) {
-
- SDL_SetError ("CDPlayer Notification: player is uninitialized");
- } else {
-
- SDL_SetError ("CDPlayer Notification: unknown error %ld", inStatus);
- }
-}
-
-static int RunCallBackThread (void *param)
-{
- for (;;) {
-
- SDL_SemWait(callbackSem);
-
- if (completionProc && theCDROM) {
- #if DEBUG_CDROM
- printf ("callback!\n");
- #endif
- (*completionProc)(theCDROM);
- } else {
- #if DEBUG_CDROM
- printf ("callback?\n");
- #endif
- }
- }
-
- #if DEBUG_CDROM
- printf ("thread dying now...\n");
- #endif
-
- return 0;
-}
-
-/*}; // extern "C" */
diff --git a/distrib/sdl-1.2.12/src/cdrom/macosx/CDPlayer.h b/distrib/sdl-1.2.12/src/cdrom/macosx/CDPlayer.h
deleted file mode 100644
index 5b41128..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/macosx/CDPlayer.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef __CDPlayer__H__
-#define __CDPlayer__H__ 1
-
-#include <string.h>
-
-#include <Carbon/Carbon.h>
-#include <CoreFoundation/CoreFoundation.h>
-#include <AudioUnit/AudioUnit.h>
-
-#include "SDL.h"
-#include "SDL_thread.h"
-#include "SDL_mutex.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef void (*CDPlayerCompletionProc)(SDL_CD *cdrom) ;
-
-void Lock ();
-
-void Unlock();
-
-int LoadFile (const FSRef *ref, int startFrame, int endFrame); /* pass -1 to do nothing */
-
-int ReleaseFile ();
-
-int PlayFile ();
-
-int PauseFile ();
-
-void SetCompletionProc (CDPlayerCompletionProc proc, SDL_CD *cdrom);
-
-int ReadTOCData (FSVolumeRefNum theVolume, SDL_CD *theCD);
-
-int ListTrackFiles (FSVolumeRefNum theVolume, FSRef *trackFiles, int numTracks);
-
-int DetectAudioCDVolumes (FSVolumeRefNum *volumes, int numVolumes);
-
-int GetCurrentFrame ();
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif /* __CD_Player__H__ */
diff --git a/distrib/sdl-1.2.12/src/cdrom/macosx/SDLOSXCAGuard.c b/distrib/sdl-1.2.12/src/cdrom/macosx/SDLOSXCAGuard.c
deleted file mode 100644
index 7689c4e..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/macosx/SDLOSXCAGuard.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- Note: This file hasn't been modified so technically we have to keep the disclaimer :-(
-
- Copyright: © Copyright 2002 Apple Computer, Inc. All rights reserved.
-
- Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
- ("Apple") in consideration of your agreement to the following terms, and your
- use, installation, modification or redistribution of this Apple software
- constitutes acceptance of these terms. If you do not agree with these terms,
- please do not use, install, modify or redistribute this Apple software.
-
- In consideration of your agreement to abide by the following terms, and subject
- to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs
- copyrights in this original Apple software (the "Apple Software"), to use,
- reproduce, modify and redistribute the Apple Software, with or without
- modifications, in source and/or binary forms; provided that if you redistribute
- the Apple Software in its entirety and without modifications, you must retain
- this notice and the following text and disclaimers in all such redistributions of
- the Apple Software. Neither the name, trademarks, service marks or logos of
- Apple Computer, Inc. may be used to endorse or promote products derived from the
- Apple Software without specific prior written permission from Apple. Except as
- expressly stated in this notice, no other rights or licenses, express or implied,
- are granted by Apple herein, including but not limited to any patent rights that
- may be infringed by your derivative works or by other works in which the Apple
- Software may be incorporated.
-
- The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
- WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
- WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
- COMBINATION WITH YOUR PRODUCTS.
-
- IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
- OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
- (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/*=============================================================================
- CAGuard.cp
-
-=============================================================================*/
-
-/*=============================================================================
- Includes
- =============================================================================*/
-
-/*
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-*/
-#include "SDL_stdinc.h"
-
-/*#define NDEBUG 1*/
-/*
-#include <assert.h>
-*/
-#define assert(X)
-
-
-#include "SDLOSXCAGuard.h"
-
-/*#warning Need a try-based Locker too*/
-/*=============================================================================
- SDLOSXCAGuard
- =============================================================================*/
-
-static int SDLOSXCAGuard_Lock(SDLOSXCAGuard *cag)
-{
- int theAnswer = 0;
-
- if(pthread_self() != cag->mOwner)
- {
- OSStatus theError = pthread_mutex_lock(&cag->mMutex);
- (void)theError;
- assert(theError == 0);
- cag->mOwner = pthread_self();
- theAnswer = 1;
- }
-
- return theAnswer;
-}
-
-static void SDLOSXCAGuard_Unlock(SDLOSXCAGuard *cag)
-{
- OSStatus theError;
- assert(pthread_self() == cag->mOwner);
-
- cag->mOwner = 0;
- theError = pthread_mutex_unlock(&cag->mMutex);
- (void)theError;
- assert(theError == 0);
-}
-
-static int SDLOSXCAGuard_Try (SDLOSXCAGuard *cag, int *outWasLocked)
-{
- int theAnswer = 0;
- *outWasLocked = 0;
-
- if (pthread_self() == cag->mOwner) {
- theAnswer = 1;
- *outWasLocked = 0;
- } else {
- OSStatus theError = pthread_mutex_trylock(&cag->mMutex);
- if (theError == 0) {
- cag->mOwner = pthread_self();
- theAnswer = 1;
- *outWasLocked = 1;
- }
- }
-
- return theAnswer;
-}
-
-static void SDLOSXCAGuard_Wait(SDLOSXCAGuard *cag)
-{
- OSStatus theError;
- assert(pthread_self() == cag->mOwner);
-
- cag->mOwner = 0;
-
- theError = pthread_cond_wait(&cag->mCondVar, &cag->mMutex);
- (void)theError;
- assert(theError == 0);
- cag->mOwner = pthread_self();
-}
-
-static void SDLOSXCAGuard_Notify(SDLOSXCAGuard *cag)
-{
- OSStatus theError = pthread_cond_signal(&cag->mCondVar);
- (void)theError;
- assert(theError == 0);
-}
-
-
-SDLOSXCAGuard *new_SDLOSXCAGuard(void)
-{
- OSStatus theError;
- SDLOSXCAGuard *cag = (SDLOSXCAGuard *) SDL_malloc(sizeof (SDLOSXCAGuard));
- if (cag == NULL)
- return NULL;
- SDL_memset(cag, '\0', sizeof (*cag));
-
- #define SET_SDLOSXCAGUARD_METHOD(m) cag->m = SDLOSXCAGuard_##m
- SET_SDLOSXCAGUARD_METHOD(Lock);
- SET_SDLOSXCAGUARD_METHOD(Unlock);
- SET_SDLOSXCAGUARD_METHOD(Try);
- SET_SDLOSXCAGUARD_METHOD(Wait);
- SET_SDLOSXCAGUARD_METHOD(Notify);
- #undef SET_SDLOSXCAGUARD_METHOD
-
- theError = pthread_mutex_init(&cag->mMutex, NULL);
- (void)theError;
- assert(theError == 0);
-
- theError = pthread_cond_init(&cag->mCondVar, NULL);
- (void)theError;
- assert(theError == 0);
-
- cag->mOwner = 0;
- return cag;
-}
-
-void delete_SDLOSXCAGuard(SDLOSXCAGuard *cag)
-{
- if (cag != NULL)
- {
- pthread_mutex_destroy(&cag->mMutex);
- pthread_cond_destroy(&cag->mCondVar);
- SDL_free(cag);
- }
-}
-
diff --git a/distrib/sdl-1.2.12/src/cdrom/macosx/SDLOSXCAGuard.h b/distrib/sdl-1.2.12/src/cdrom/macosx/SDLOSXCAGuard.h
deleted file mode 100644
index 520387a..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/macosx/SDLOSXCAGuard.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- Note: This file hasn't been modified so technically we have to keep the disclaimer :-(
-
-
- Copyright: © Copyright 2002 Apple Computer, Inc. All rights reserved.
-
- Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
- ("Apple") in consideration of your agreement to the following terms, and your
- use, installation, modification or redistribution of this Apple software
- constitutes acceptance of these terms. If you do not agree with these terms,
- please do not use, install, modify or redistribute this Apple software.
-
- In consideration of your agreement to abide by the following terms, and subject
- to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs
- copyrights in this original Apple software (the "Apple Software"), to use,
- reproduce, modify and redistribute the Apple Software, with or without
- modifications, in source and/or binary forms; provided that if you redistribute
- the Apple Software in its entirety and without modifications, you must retain
- this notice and the following text and disclaimers in all such redistributions of
- the Apple Software. Neither the name, trademarks, service marks or logos of
- Apple Computer, Inc. may be used to endorse or promote products derived from the
- Apple Software without specific prior written permission from Apple. Except as
- expressly stated in this notice, no other rights or licenses, express or implied,
- are granted by Apple herein, including but not limited to any patent rights that
- may be infringed by your derivative works or by other works in which the Apple
- Software may be incorporated.
-
- The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
- WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
- WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
- COMBINATION WITH YOUR PRODUCTS.
-
- IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
- OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
- (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/*=============================================================================
- CAGuard.h
-
-=============================================================================*/
-#if !defined(__CAGuard_h__)
-#define __CAGuard_h__
-
-/*=============================================================================
- Includes
- =============================================================================*/
-
-#include <CoreAudio/CoreAudioTypes.h>
-#include <pthread.h>
-
-
-/*=============================================================================
- CAGuard
-
- This is your typical mutex with signalling implemented via pthreads.
- Lock() will return true if and only if the guard is locked on that call.
- A thread that already has the guard will receive 'false' if it locks it
- again. Use of the stack-based CAGuard::Locker class is highly recommended
- to properly manage the recursive nesting. The Wait calls with timeouts
- will return true if and only if the timeout period expired. They will
- return false if they receive notification any other way.
- =============================================================================*/
-
-typedef struct S_SDLOSXCAGuard
-{
-
-/* Construction/Destruction */
-/*public:*/
-/* Actions */
-/*public:*/
- int (*Lock)(struct S_SDLOSXCAGuard *cag);
- void (*Unlock)(struct S_SDLOSXCAGuard *cag);
- int (*Try)(struct S_SDLOSXCAGuard *cag, int *outWasLocked); /* returns true if lock is free, false if not */
- void (*Wait)(struct S_SDLOSXCAGuard *cag);
- void (*Notify)(struct S_SDLOSXCAGuard *cag);
-
-/* Implementation */
-/*protected:*/
- pthread_mutex_t mMutex;
- pthread_cond_t mCondVar;
- pthread_t mOwner;
-} SDLOSXCAGuard;
-
-SDLOSXCAGuard *new_SDLOSXCAGuard(void);
-void delete_SDLOSXCAGuard(SDLOSXCAGuard *cag);
-
-#endif
-
diff --git a/distrib/sdl-1.2.12/src/cdrom/macosx/SDL_syscdrom.c b/distrib/sdl-1.2.12/src/cdrom/macosx/SDL_syscdrom.c
deleted file mode 100644
index ea43d8b..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/macosx/SDL_syscdrom.c
+++ /dev/null
@@ -1,505 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_CDROM_MACOSX
-
-#include "SDL_syscdrom_c.h"
-
-#pragma mark -- Globals --
-
-static FSRef** tracks;
-static FSVolumeRefNum* volumes;
-static CDstatus status;
-static int nextTrackFrame;
-static int nextTrackFramesRemaining;
-static int fakeCD;
-static int currentTrack;
-static int didReadTOC;
-static int cacheTOCNumTracks;
-static int currentDrive; /* Only allow 1 drive in use at a time */
-
-#pragma mark -- Prototypes --
-
-static const char *SDL_SYS_CDName (int drive);
-static int SDL_SYS_CDOpen (int drive);
-static int SDL_SYS_CDGetTOC (SDL_CD *cdrom);
-static CDstatus SDL_SYS_CDStatus (SDL_CD *cdrom, int *position);
-static int SDL_SYS_CDPlay (SDL_CD *cdrom, int start, int length);
-static int SDL_SYS_CDPause (SDL_CD *cdrom);
-static int SDL_SYS_CDResume (SDL_CD *cdrom);
-static int SDL_SYS_CDStop (SDL_CD *cdrom);
-static int SDL_SYS_CDEject (SDL_CD *cdrom);
-static void SDL_SYS_CDClose (SDL_CD *cdrom);
-
-#pragma mark -- Helper Functions --
-
-/* Read a list of tracks from the volume */
-static int LoadTracks (SDL_CD *cdrom)
-{
- /* Check if tracks are already loaded */
- if ( tracks[cdrom->id] != NULL )
- return 0;
-
- /* Allocate memory for tracks */
- tracks[cdrom->id] = (FSRef*) SDL_calloc (1, sizeof(**tracks) * cdrom->numtracks);
- if (tracks[cdrom->id] == NULL) {
- SDL_OutOfMemory ();
- return -1;
- }
-
- /* Load tracks */
- if (ListTrackFiles (volumes[cdrom->id], tracks[cdrom->id], cdrom->numtracks) < 0)
- return -1;
-
- return 0;
-}
-
-/* Find a file for a given start frame and length */
-static FSRef* GetFileForOffset (SDL_CD *cdrom, int start, int length, int *outStartFrame, int *outStopFrame)
-{
- int i;
-
- for (i = 0; i < cdrom->numtracks; i++) {
-
- if (cdrom->track[i].offset <= start &&
- start < (cdrom->track[i].offset + cdrom->track[i].length))
- break;
- }
-
- if (i == cdrom->numtracks)
- return NULL;
-
- currentTrack = i;
-
- *outStartFrame = start - cdrom->track[i].offset;
-
- if ((*outStartFrame + length) < cdrom->track[i].length) {
- *outStopFrame = *outStartFrame + length;
- length = 0;
- nextTrackFrame = -1;
- nextTrackFramesRemaining = -1;
- }
- else {
- *outStopFrame = -1;
- length -= cdrom->track[i].length - *outStartFrame;
- nextTrackFrame = cdrom->track[i+1].offset;
- nextTrackFramesRemaining = length;
- }
-
- return &tracks[cdrom->id][i];
-}
-
-/* Setup another file for playback, or stop playback (called from another thread) */
-static void CompletionProc (SDL_CD *cdrom)
-{
-
- Lock ();
-
- if (nextTrackFrame > 0 && nextTrackFramesRemaining > 0) {
-
- /* Load the next file to play */
- int startFrame, stopFrame;
- FSRef *file;
-
- PauseFile ();
- ReleaseFile ();
-
- file = GetFileForOffset (cdrom, nextTrackFrame,
- nextTrackFramesRemaining, &startFrame, &stopFrame);
-
- if (file == NULL) {
- status = CD_STOPPED;
- Unlock ();
- return;
- }
-
- LoadFile (file, startFrame, stopFrame);
-
- SetCompletionProc (CompletionProc, cdrom);
-
- PlayFile ();
- }
- else {
-
- /* Release the current file */
- PauseFile ();
- ReleaseFile ();
- status = CD_STOPPED;
- }
-
- Unlock ();
-}
-
-
-#pragma mark -- Driver Functions --
-
-/* Initialize */
-int SDL_SYS_CDInit (void)
-{
- /* Initialize globals */
- volumes = NULL;
- tracks = NULL;
- status = CD_STOPPED;
- nextTrackFrame = -1;
- nextTrackFramesRemaining = -1;
- fakeCD = SDL_FALSE;
- currentTrack = -1;
- didReadTOC = SDL_FALSE;
- cacheTOCNumTracks = -1;
- currentDrive = -1;
-
- /* Fill in function pointers */
- SDL_CDcaps.Name = SDL_SYS_CDName;
- SDL_CDcaps.Open = SDL_SYS_CDOpen;
- SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
- SDL_CDcaps.Status = SDL_SYS_CDStatus;
- SDL_CDcaps.Play = SDL_SYS_CDPlay;
- SDL_CDcaps.Pause = SDL_SYS_CDPause;
- SDL_CDcaps.Resume = SDL_SYS_CDResume;
- SDL_CDcaps.Stop = SDL_SYS_CDStop;
- SDL_CDcaps.Eject = SDL_SYS_CDEject;
- SDL_CDcaps.Close = SDL_SYS_CDClose;
-
- /*
- Read the list of "drives"
-
- This is currently a hack that infers drives from
- mounted audio CD volumes, rather than
- actual CD-ROM devices - which means it may not
- act as expected sometimes.
- */
-
- /* Find out how many cd volumes are mounted */
- SDL_numcds = DetectAudioCDVolumes (NULL, 0);
-
- /*
- If there are no volumes, fake a cd device
- so tray empty can be reported.
- */
- if (SDL_numcds == 0) {
-
- fakeCD = SDL_TRUE;
- SDL_numcds = 1;
- status = CD_TRAYEMPTY;
-
- return 0;
- }
-
- /* Allocate space for volumes */
- volumes = (FSVolumeRefNum*) SDL_calloc (1, sizeof(*volumes) * SDL_numcds);
- if (volumes == NULL) {
- SDL_OutOfMemory ();
- return -1;
- }
-
- /* Allocate space for tracks */
- tracks = (FSRef**) SDL_calloc (1, sizeof(*tracks) * (SDL_numcds + 1));
- if (tracks == NULL) {
- SDL_OutOfMemory ();
- return -1;
- }
-
- /* Mark the end of the tracks array */
- tracks[ SDL_numcds ] = (FSRef*)-1;
-
- /*
- Redetect, now save all volumes for later
- Update SDL_numcds just in case it changed
- */
- {
- int numVolumes = SDL_numcds;
-
- SDL_numcds = DetectAudioCDVolumes (volumes, numVolumes);
-
- /* If more cds suddenly show up, ignore them */
- if (SDL_numcds > numVolumes) {
- SDL_SetError ("Some CD's were added but they will be ignored");
- SDL_numcds = numVolumes;
- }
- }
-
- return 0;
-}
-
-/* Shutdown and cleanup */
-void SDL_SYS_CDQuit(void)
-{
- ReleaseFile();
-
- if (volumes != NULL)
- free (volumes);
-
- if (tracks != NULL) {
-
- FSRef **ptr;
- for (ptr = tracks; *ptr != (FSRef*)-1; ptr++)
- if (*ptr != NULL)
- free (*ptr);
-
- free (tracks);
- }
-}
-
-/* Get the Unix disk name of the volume */
-static const char *SDL_SYS_CDName (int drive)
-{
- OSStatus err = noErr;
- HParamBlockRec pb;
- GetVolParmsInfoBuffer volParmsInfo;
-
- if (fakeCD)
- return "Fake CD-ROM Device";
-
- pb.ioParam.ioNamePtr = NULL;
- pb.ioParam.ioVRefNum = volumes[drive];
- pb.ioParam.ioBuffer = (Ptr)&volParmsInfo;
- pb.ioParam.ioReqCount = (SInt32)sizeof(volParmsInfo);
- err = PBHGetVolParmsSync(&pb);
-
- if (err != noErr) {
- SDL_SetError ("PBHGetVolParmsSync returned %d", err);
- return NULL;
- }
-
- return volParmsInfo.vMDeviceID;
-}
-
-/* Open the "device" */
-static int SDL_SYS_CDOpen (int drive)
-{
- /* Only allow 1 device to be open */
- if (currentDrive >= 0) {
- SDL_SetError ("Only one cdrom is supported");
- return -1;
- }
- else
- currentDrive = drive;
-
- return drive;
-}
-
-/* Get the table of contents */
-static int SDL_SYS_CDGetTOC (SDL_CD *cdrom)
-{
- if (fakeCD) {
- SDL_SetError (kErrorFakeDevice);
- return -1;
- }
-
- if (didReadTOC) {
- cdrom->numtracks = cacheTOCNumTracks;
- return 0;
- }
-
-
- ReadTOCData (volumes[cdrom->id], cdrom);
- didReadTOC = SDL_TRUE;
- cacheTOCNumTracks = cdrom->numtracks;
-
- return 0;
-}
-
-/* Get CD-ROM status */
-static CDstatus SDL_SYS_CDStatus (SDL_CD *cdrom, int *position)
-{
- if (position) {
- int trackFrame;
-
- Lock ();
- trackFrame = GetCurrentFrame ();
- Unlock ();
-
- *position = cdrom->track[currentTrack].offset + trackFrame;
- }
-
- return status;
-}
-
-/* Start playback */
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
-{
- int startFrame, stopFrame;
- FSRef *ref;
-
- if (fakeCD) {
- SDL_SetError (kErrorFakeDevice);
- return -1;
- }
-
- Lock();
-
- if (LoadTracks (cdrom) < 0)
- return -2;
-
- if (PauseFile () < 0)
- return -3;
-
- if (ReleaseFile () < 0)
- return -4;
-
- ref = GetFileForOffset (cdrom, start, length, &startFrame, &stopFrame);
- if (ref == NULL) {
- SDL_SetError ("SDL_SYS_CDPlay: No file for start=%d, length=%d", start, length);
- return -5;
- }
-
- if (LoadFile (ref, startFrame, stopFrame) < 0)
- return -6;
-
- SetCompletionProc (CompletionProc, cdrom);
-
- if (PlayFile () < 0)
- return -7;
-
- status = CD_PLAYING;
-
- Unlock();
-
- return 0;
-}
-
-/* Pause playback */
-static int SDL_SYS_CDPause(SDL_CD *cdrom)
-{
- if (fakeCD) {
- SDL_SetError (kErrorFakeDevice);
- return -1;
- }
-
- Lock ();
-
- if (PauseFile () < 0) {
- Unlock ();
- return -2;
- }
-
- status = CD_PAUSED;
-
- Unlock ();
-
- return 0;
-}
-
-/* Resume playback */
-static int SDL_SYS_CDResume(SDL_CD *cdrom)
-{
- if (fakeCD) {
- SDL_SetError (kErrorFakeDevice);
- return -1;
- }
-
- Lock ();
-
- if (PlayFile () < 0) {
- Unlock ();
- return -2;
- }
-
- status = CD_PLAYING;
-
- Unlock ();
-
- return 0;
-}
-
-/* Stop playback */
-static int SDL_SYS_CDStop(SDL_CD *cdrom)
-{
- if (fakeCD) {
- SDL_SetError (kErrorFakeDevice);
- return -1;
- }
-
- Lock ();
-
- if (PauseFile () < 0) {
- Unlock ();
- return -2;
- }
-
- if (ReleaseFile () < 0) {
- Unlock ();
- return -3;
- }
-
- status = CD_STOPPED;
-
- Unlock ();
-
- return 0;
-}
-
-/* Eject the CD-ROM (Unmount the volume) */
-static int SDL_SYS_CDEject(SDL_CD *cdrom)
-{
- OSStatus err;
- pid_t dissenter;
-
- if (fakeCD) {
- SDL_SetError (kErrorFakeDevice);
- return -1;
- }
-
- Lock ();
-
- if (PauseFile () < 0) {
- Unlock ();
- return -2;
- }
-
- if (ReleaseFile () < 0) {
- Unlock ();
- return -3;
- }
-
- status = CD_STOPPED;
-
- /* Eject the volume */
- err = FSEjectVolumeSync(volumes[cdrom->id], kNilOptions, &dissenter);
-
- if (err != noErr) {
- Unlock ();
- SDL_SetError ("PBUnmountVol returned %d", err);
- return -4;
- }
-
- status = CD_TRAYEMPTY;
-
- /* Invalidate volume and track info */
- volumes[cdrom->id] = 0;
- free (tracks[cdrom->id]);
- tracks[cdrom->id] = NULL;
-
- Unlock ();
-
- return 0;
-}
-
-/* Close the CD-ROM */
-static void SDL_SYS_CDClose(SDL_CD *cdrom)
-{
- currentDrive = -1;
- return;
-}
-
-#endif /* SDL_CDROM_MACOSX */
diff --git a/distrib/sdl-1.2.12/src/cdrom/macosx/SDL_syscdrom_c.h b/distrib/sdl-1.2.12/src/cdrom/macosx/SDL_syscdrom_c.h
deleted file mode 100644
index cc13198..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/macosx/SDL_syscdrom_c.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This is the Mac OS X / CoreAudio specific header for the SDL CD-ROM API
- Contributed by Darrell Walisser and Max Horn
- */
-
-/***********************************************************************************
- Implementation Notes
- *********************
-
- This code has several limitations currently (all of which are proabaly fixable):
-
- 1. A CD-ROM device is inferred from a mounted cdfs volume, so device 0 is
- not necessarily the first CD-ROM device on the system. (Somewhat easy to fix
- by useing the device name from the volume id's to reorder the volumes)
-
- 2. You can only open and control 1 CD-ROM device at a time. (Challenging to fix,
- due to extensive code restructuring)
-
- 3. The status reported by SDL_CDStatus only changes to from CD_PLAYING to CD_STOPPED in
- 1-second intervals (because the audio is buffered in 1-second chunks) If
- the audio data is less than 1 second, the remainder is filled with silence.
-
- If you need to play sequences back-to-back that are less that 1 second long,
- use the frame position to determine when to play the next sequence, instead
- of SDL_CDStatus.
-
- This may be possible to fix with a clever usage of the AudioUnit API.
-
- 4. When new volumes are inserted, our volume information is not updated. The only way
- to refresh this information is to reinit the CD-ROM subsystem of SDL. To fix this,
- one would probably have to fix point 1 above first, then figure out how to register
- for a notification when new media is mounted in order to perform an automatic
- rescan for cdfs volumes.
-
-
-
- So, here comes a description of how this all works.
-
- < Initializing >
-
- To get things rolling, we have to locate mounted volumes that contain
- audio (since nearly all Macs don't have analog audio-in on the sound card).
- That's easy, since these volumes have a flag that indicates this special
- filesystem. See DetectAudioCDVolumes() in CDPlayer.cpp for this code.
-
- Next, we parse the invisible .TOC.plist in the root of the volume, which gets us
- the track information (number, offset, length, leadout, etc). See ReadTOCData() in
- CDPlayer.cpp for the skinny on this.
-
-
- < The Playback Loop >
-
- Now come the tricky parts. Let's start with basic audio playback. When a frame
- range to play is requested, we must first find the .aiff files on the volume,
- hopefully in the right order. Since these files all begin with a number "1 Audio Track",
- etc, this is used to determine the correct track order.
-
- Once all files are determined, we have to find what file corresponds to the start
- and length parameter to SDL_SYS_CDPlay(). Again, this is quite simple by walking the
- cdrom's track list. At this point, we also save the offset to the next track and frames
- remaining, if we're going to have to play another file after the first one. See
- GetFileForOffset() for this code.
-
- At this point we have all info needed to start playback, so we hand off to the LoadFile()
- function, which proceeds to do its magic and plays back the file.
-
- When the file is finished playing, CompletionProc() is invoked, at which time we can
- play the next file if the previously saved next track and frames remaining
- indicates that we should.
-
-
- < Magic >
-
- OK, so it's not really magic, but since I don't fully understand all the hidden details it
- seems like it to me ;-) The API's involved are the AudioUnit and AudioFile API's. These
- appear to be an extension of CoreAudio for creating modular playback and f/x entities.
- The important thing is that CPU usage is very low and reliability is very high. You'd
- be hard-pressed to find a way to stutter the playback with other CPU-intensive tasks.
-
- One part of this magic is that it uses multiple threads, which carries the usual potential
- for disaster if not handled carefully. Playback currently requires 4 additional threads:
- 1. The coreaudio runloop thread
- 2. The coreaudio device i/o thread
- 3. The file streaming thread
- 4. The notification/callback thread
-
- The first 2 threads are necessary evil - CoreAudio creates this no matter what the situation
- is (even the SDL sound implementation creates theses suckers). The last two are are created
- by us.
-
- The file is streamed from disk using a threaded double-buffer approach.
- This way, the high latency operation of reading from disk can be performed without interrupting
- the real-time device thread (which amounts to avoiding dropouts). The device thread grabs the
- buffer that isn't being read and sends it to the CoreAudio mixer where it eventually gets
- to the sound card.
-
- The device thread posts a notification when the file streaming thread is out of data. This
- notification must be handled in a separate thread to avoid potential deadlock in the
- device thread. That's where the notification thread comes in. This thread is signaled
- whenever a notification needs to be processed, so another file can be played back if need be.
-
- The API in CDPlayer.cpp contains synchronization because otherwise both the notification thread
- and main thread (or another other thread using the SDL CD api) can potentially call it at the same time.
-
-************************************************************************************/
-
-
-#include "SDL_cdrom.h"
-#include "../SDL_syscdrom.h"
-
-#include "CDPlayer.h"
-
-#define kErrorFakeDevice "Error: Cannot proceed since we're faking a CD-ROM device. Reinit the CD-ROM subsystem to scan for new volumes."
-
diff --git a/distrib/sdl-1.2.12/src/cdrom/mint/SDL_syscdrom.c b/distrib/sdl-1.2.12/src/cdrom/mint/SDL_syscdrom.c
deleted file mode 100644
index c817899..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/mint/SDL_syscdrom.c
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_CDROM_MINT
-
-/*
- Atari MetaDOS CD-ROM functions
-
- Patrice Mandin
-*/
-
-#include <errno.h>
-
-#include <cdromio.h>
-#include <metados.h>
-
-#include "SDL_cdrom.h"
-#include "../SDL_syscdrom.h"
-
-/* Some ioctl() errno values which occur when the tray is empty */
-#ifndef ENOMEDIUM
-#define ENOMEDIUM ENOENT
-#endif
-#define ERRNO_TRAYEMPTY(errno) \
- ((errno == EIO) || (errno == ENOENT) || \
- (errno == EINVAL) || (errno == ENOMEDIUM))
-
-/* The maximum number of CD-ROM drives we'll detect */
-#define MAX_DRIVES 32
-
-typedef struct {
- unsigned char device[3]; /* Physical device letter + ':' + '\0' */
- metaopen_t metaopen; /* Infos on opened drive */
-} metados_drive_t;
-
-static metados_drive_t metados_drives[MAX_DRIVES];
-
-/* The system-dependent CD control functions */
-static const char *SDL_SYS_CDName(int drive);
-static int SDL_SYS_CDOpen(int drive);
-static void SDL_SYS_CDClose(SDL_CD *cdrom);
-static int SDL_SYS_CDioctl(int id, int command, void *arg);
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
-static int SDL_SYS_CDPause(SDL_CD *cdrom);
-static int SDL_SYS_CDResume(SDL_CD *cdrom);
-static int SDL_SYS_CDStop(SDL_CD *cdrom);
-static int SDL_SYS_CDEject(SDL_CD *cdrom);
-
-int SDL_SYS_CDInit(void)
-{
- metainit_t metainit={0,0,0,0};
- metaopen_t metaopen;
- int i, handle;
- struct cdrom_subchnl info;
-
- Metainit(&metainit);
- if (metainit.version == NULL) {
-#ifdef DEBUG_CDROM
- fprintf(stderr, "MetaDOS not installed\n");
-#endif
- return -1;
- }
-
- if (metainit.drives_map == 0) {
-#ifdef DEBUG_CDROM
- fprintf(stderr, "No MetaDOS devices present\n");
-#endif
- return -1;
- }
-
- SDL_numcds = 0;
-
- for (i='A'; i<='Z'; i++) {
- metados_drives[SDL_numcds].device[0] = 0;
- metados_drives[SDL_numcds].device[1] = ':';
- metados_drives[SDL_numcds].device[2] = 0;
-
- if (metainit.drives_map & (1<<(i-'A'))) {
- handle = Metaopen(i, &metaopen);
- if (handle == 0) {
-
- info.cdsc_format = CDROM_MSF;
- if ( (Metaioctl(i, METADOS_IOCTL_MAGIC, CDROMSUBCHNL, &info) == 0) || ERRNO_TRAYEMPTY(errno) ) {
- metados_drives[SDL_numcds].device[0] = i;
- ++SDL_numcds;
- }
-
- Metaclose(i);
- }
- }
- }
-
- /* Fill in our driver capabilities */
- SDL_CDcaps.Name = SDL_SYS_CDName;
- SDL_CDcaps.Open = SDL_SYS_CDOpen;
- SDL_CDcaps.Close = SDL_SYS_CDClose;
-
- SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
- SDL_CDcaps.Status = SDL_SYS_CDStatus;
- SDL_CDcaps.Play = SDL_SYS_CDPlay;
- SDL_CDcaps.Pause = SDL_SYS_CDPause;
- SDL_CDcaps.Resume = SDL_SYS_CDResume;
- SDL_CDcaps.Stop = SDL_SYS_CDStop;
- SDL_CDcaps.Eject = SDL_SYS_CDEject;
-
- return 0;
-}
-
-void SDL_SYS_CDQuit(void)
-{
- SDL_numcds = 0;
-}
-
-static const char *SDL_SYS_CDName(int drive)
-{
- return(metados_drives[drive].device);
-}
-
-static int SDL_SYS_CDOpen(int drive)
-{
- int handle;
-
- handle = Metaopen(metados_drives[drive].device[0], &(metados_drives[drive].metaopen));
- if (handle == 0) {
- return drive;
- }
-
- return -1;
-}
-
-static void SDL_SYS_CDClose(SDL_CD *cdrom)
-{
- Metaclose(metados_drives[cdrom->id].device[0]);
-}
-
-static int SDL_SYS_CDioctl(int id, int command, void *arg)
-{
- int retval;
-
- retval = Metaioctl(metados_drives[id].device[0], METADOS_IOCTL_MAGIC, command, arg);
- if ( retval < 0 ) {
- SDL_SetError("ioctl() error: %s", strerror(errno));
- }
- return(retval);
-}
-
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
-{
- int i,okay;
- struct cdrom_tochdr toc;
- struct cdrom_tocentry entry;
-
- /* Use standard ioctl() */
- if (SDL_SYS_CDioctl(cdrom->id, CDROMREADTOCHDR, &toc)<0) {
- return -1;
- }
-
- cdrom->numtracks = toc.cdth_trk1-toc.cdth_trk0+1;
- if ( cdrom->numtracks > SDL_MAX_TRACKS ) {
- cdrom->numtracks = SDL_MAX_TRACKS;
- }
-
- /* Read all the track TOC entries */
- okay=1;
- for ( i=0; i<=cdrom->numtracks; ++i ) {
- if ( i == cdrom->numtracks ) {
- cdrom->track[i].id = CDROM_LEADOUT;
- } else {
- cdrom->track[i].id = toc.cdth_trk0+i;
- }
- entry.cdte_track = cdrom->track[i].id;
- entry.cdte_format = CDROM_MSF;
- if ( SDL_SYS_CDioctl(cdrom->id, CDROMREADTOCENTRY, &entry) < 0 ) {
- okay=0;
- break;
- } else {
- if ( entry.cdte_ctrl & CDROM_DATA_TRACK ) {
- cdrom->track[i].type = SDL_DATA_TRACK;
- } else {
- cdrom->track[i].type = SDL_AUDIO_TRACK;
- }
- cdrom->track[i].offset = MSF_TO_FRAMES(
- entry.cdte_addr.msf.minute,
- entry.cdte_addr.msf.second,
- entry.cdte_addr.msf.frame);
- cdrom->track[i].length = 0;
- if ( i > 0 ) {
- cdrom->track[i-1].length = cdrom->track[i].offset-cdrom->track[i-1].offset;
- }
- }
- }
-
- return(okay ? 0 : -1);
-}
-
-/* Get CD-ROM status */
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
-{
- CDstatus status;
- struct cdrom_tochdr toc;
- struct cdrom_subchnl info;
-
- info.cdsc_format = CDROM_MSF;
- if ( SDL_SYS_CDioctl(cdrom->id, CDROMSUBCHNL, &info) < 0 ) {
- if ( ERRNO_TRAYEMPTY(errno) ) {
- status = CD_TRAYEMPTY;
- } else {
- status = CD_ERROR;
- }
- } else {
- switch (info.cdsc_audiostatus) {
- case CDROM_AUDIO_INVALID:
- case CDROM_AUDIO_NO_STATUS:
- /* Try to determine if there's a CD available */
- if (SDL_SYS_CDioctl(cdrom->id, CDROMREADTOCHDR, &toc)==0) {
- status = CD_STOPPED;
- } else {
- status = CD_TRAYEMPTY;
- }
- break;
- case CDROM_AUDIO_COMPLETED:
- status = CD_STOPPED;
- break;
- case CDROM_AUDIO_PLAY:
- status = CD_PLAYING;
- break;
- case CDROM_AUDIO_PAUSED:
- /* Workaround buggy CD-ROM drive */
- if ( info.cdsc_trk == CDROM_LEADOUT ) {
- status = CD_STOPPED;
- } else {
- status = CD_PAUSED;
- }
- break;
- default:
- status = CD_ERROR;
- break;
- }
- }
- if ( position ) {
- if ( status == CD_PLAYING || (status == CD_PAUSED) ) {
- *position = MSF_TO_FRAMES(
- info.cdsc_absaddr.msf.minute,
- info.cdsc_absaddr.msf.second,
- info.cdsc_absaddr.msf.frame);
- } else {
- *position = 0;
- }
- }
- return(status);
-}
-
-/* Start play */
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
-{
- struct cdrom_msf playtime;
-
- FRAMES_TO_MSF(start,
- &playtime.cdmsf_min0, &playtime.cdmsf_sec0, &playtime.cdmsf_frame0);
- FRAMES_TO_MSF(start+length,
- &playtime.cdmsf_min1, &playtime.cdmsf_sec1, &playtime.cdmsf_frame1);
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Trying to play from %d:%d:%d to %d:%d:%d\n",
- playtime.cdmsf_min0, playtime.cdmsf_sec0, playtime.cdmsf_frame0,
- playtime.cdmsf_min1, playtime.cdmsf_sec1, playtime.cdmsf_frame1);
-#endif
-
- return SDL_SYS_CDioctl(cdrom->id, CDROMPLAYMSF, &playtime);
-}
-
-/* Pause play */
-static int SDL_SYS_CDPause(SDL_CD *cdrom)
-{
- return SDL_SYS_CDioctl(cdrom->id, CDROMPAUSE, 0);
-}
-
-/* Resume play */
-static int SDL_SYS_CDResume(SDL_CD *cdrom)
-{
- return SDL_SYS_CDioctl(cdrom->id, CDROMRESUME, 0);
-}
-
-/* Stop play */
-static int SDL_SYS_CDStop(SDL_CD *cdrom)
-{
- return SDL_SYS_CDioctl(cdrom->id, CDROMSTOP, 0);
-}
-
-/* Eject the CD-ROM */
-static int SDL_SYS_CDEject(SDL_CD *cdrom)
-{
- return SDL_SYS_CDioctl(cdrom->id, CDROMEJECT, 0);
-}
-
-#endif /* SDL_CDROM_MINT */
diff --git a/distrib/sdl-1.2.12/src/cdrom/openbsd/SDL_syscdrom.c b/distrib/sdl-1.2.12/src/cdrom/openbsd/SDL_syscdrom.c
deleted file mode 100644
index 1d77c82..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/openbsd/SDL_syscdrom.c
+++ /dev/null
@@ -1,415 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_CDROM_OPENBSD
-
-/* Functions for system-level CD-ROM audio control */
-
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <sys/cdio.h>
-
-#include "SDL_cdrom.h"
-#include "../SDL_syscdrom.h"
-
-
-/* The maximum number of CD-ROM drives we'll detect */
-#define MAX_DRIVES 16
-
-/* A list of available CD-ROM drives */
-static char *SDL_cdlist[MAX_DRIVES];
-static dev_t SDL_cdmode[MAX_DRIVES];
-
-/* The system-dependent CD control functions */
-static const char *SDL_SYS_CDName(int drive);
-static int SDL_SYS_CDOpen(int drive);
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
-static int SDL_SYS_CDPause(SDL_CD *cdrom);
-static int SDL_SYS_CDResume(SDL_CD *cdrom);
-static int SDL_SYS_CDStop(SDL_CD *cdrom);
-static int SDL_SYS_CDEject(SDL_CD *cdrom);
-static void SDL_SYS_CDClose(SDL_CD *cdrom);
-
-/* Some ioctl() errno values which occur when the tray is empty */
-#define ERRNO_TRAYEMPTY(errno) \
- ((errno == EIO) || (errno == ENOENT) || (errno == EINVAL) || \
- (errno == ENODEV))
-
-/* Check a drive to see if it is a CD-ROM */
-static int CheckDrive(char *drive, struct stat *stbuf)
-{
- int is_cd, cdfd;
- struct ioc_read_subchannel info;
-
- /* If it doesn't exist, return -1 */
- if ( stat(drive, stbuf) < 0 ) {
- return(-1);
- }
-
- /* If it does exist, verify that it's an available CD-ROM */
- is_cd = 0;
- if ( S_ISCHR(stbuf->st_mode) || S_ISBLK(stbuf->st_mode) ) {
- cdfd = open(drive, (O_RDONLY|O_EXCL|O_NONBLOCK), 0);
- if ( cdfd >= 0 ) {
- info.address_format = CD_MSF_FORMAT;
- info.data_format = CD_CURRENT_POSITION;
- info.data_len = 0;
- info.data = NULL;
- /* Under Linux, EIO occurs when a disk is not present.
- This isn't 100% reliable, so we use the USE_MNTENT
- code above instead.
- */
- if ( (ioctl(cdfd, CDIOCREADSUBCHANNEL, &info) == 0) ||
- ERRNO_TRAYEMPTY(errno) ) {
- is_cd = 1;
- }
- close(cdfd);
- }
- else if (ERRNO_TRAYEMPTY(errno))
- is_cd = 1;
- }
- return(is_cd);
-}
-
-/* Add a CD-ROM drive to our list of valid drives */
-static void AddDrive(char *drive, struct stat *stbuf)
-{
- int i;
-
- if ( SDL_numcds < MAX_DRIVES ) {
- /* Check to make sure it's not already in our list.
- This can happen when we see a drive via symbolic link.
- */
- for ( i=0; i<SDL_numcds; ++i ) {
- if ( stbuf->st_rdev == SDL_cdmode[i] ) {
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Duplicate drive detected: %s == %s\n", drive, SDL_cdlist[i]);
-#endif
- return;
- }
- }
-
- /* Add this drive to our list */
- i = SDL_numcds;
- SDL_cdlist[i] = SDL_strdup(drive);
- if ( SDL_cdlist[i] == NULL ) {
- SDL_OutOfMemory();
- return;
- }
- SDL_cdmode[i] = stbuf->st_rdev;
- ++SDL_numcds;
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Added CD-ROM drive: %s\n", drive);
-#endif
- }
-}
-
-int SDL_SYS_CDInit(void)
-{
- static char *checklist[] = {
-#if defined(__OPENBSD__)
- "?0 cd?c", "cdrom", NULL
-#elif defined(__NETBSD__)
- "?0 cd?d", "?0 cd?c", "cdrom", NULL
-#else
- "?0 cd?c", "?0 acd?c", "cdrom", NULL
-#endif
- };
- char *SDLcdrom;
- int i, j, exists;
- char drive[32];
- struct stat stbuf;
-
- /* Fill in our driver capabilities */
- SDL_CDcaps.Name = SDL_SYS_CDName;
- SDL_CDcaps.Open = SDL_SYS_CDOpen;
- SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
- SDL_CDcaps.Status = SDL_SYS_CDStatus;
- SDL_CDcaps.Play = SDL_SYS_CDPlay;
- SDL_CDcaps.Pause = SDL_SYS_CDPause;
- SDL_CDcaps.Resume = SDL_SYS_CDResume;
- SDL_CDcaps.Stop = SDL_SYS_CDStop;
- SDL_CDcaps.Eject = SDL_SYS_CDEject;
- SDL_CDcaps.Close = SDL_SYS_CDClose;
-
- /* Look in the environment for our CD-ROM drive list */
- SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */
- if ( SDLcdrom != NULL ) {
- char *cdpath, *delim;
- size_t len = SDL_strlen(SDLcdrom)+1;
- cdpath = SDL_stack_alloc(char, len);
- if ( cdpath != NULL ) {
- SDL_strlcpy(cdpath, SDLcdrom, len);
- SDLcdrom = cdpath;
- do {
- delim = SDL_strchr(SDLcdrom, ':');
- if ( delim ) {
- *delim++ = '\0';
- }
- if ( CheckDrive(SDLcdrom, &stbuf) > 0 ) {
- AddDrive(SDLcdrom, &stbuf);
- }
- if ( delim ) {
- SDLcdrom = delim;
- } else {
- SDLcdrom = NULL;
- }
- } while ( SDLcdrom );
- SDL_stack_free(cdpath);
- }
-
- /* If we found our drives, there's nothing left to do */
- if ( SDL_numcds > 0 ) {
- return(0);
- }
- }
-
- /* Scan the system for CD-ROM drives */
- for ( i=0; checklist[i]; ++i ) {
- if ( checklist[i][0] == '?' ) {
- char *insert;
- exists = 1;
- for ( j=checklist[i][1]; exists; ++j ) {
- SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", &checklist[i][3]);
- insert = SDL_strchr(drive, '?');
- if ( insert != NULL ) {
- *insert = j;
- }
- switch (CheckDrive(drive, &stbuf)) {
- /* Drive exists and is a CD-ROM */
- case 1:
- AddDrive(drive, &stbuf);
- break;
- /* Drive exists, but isn't a CD-ROM */
- case 0:
- break;
- /* Drive doesn't exist */
- case -1:
- exists = 0;
- break;
- }
- }
- } else {
- SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]);
- if ( CheckDrive(drive, &stbuf) > 0 ) {
- AddDrive(drive, &stbuf);
- }
- }
- }
- return(0);
-}
-
-/* General ioctl() CD-ROM command function */
-static int SDL_SYS_CDioctl(int id, int command, void *arg)
-{
- int retval;
-
- retval = ioctl(id, command, arg);
- if ( retval < 0 ) {
- SDL_SetError("ioctl() error: %s", strerror(errno));
- }
- return(retval);
-}
-
-static const char *SDL_SYS_CDName(int drive)
-{
- return(SDL_cdlist[drive]);
-}
-
-static int SDL_SYS_CDOpen(int drive)
-{
- return(open(SDL_cdlist[drive], (O_RDONLY|O_EXCL|O_NONBLOCK), 0));
-}
-
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
-{
- struct ioc_toc_header toc;
- int i, okay;
- struct ioc_read_toc_entry entry;
- struct cd_toc_entry data;
-
- okay = 0;
- if ( SDL_SYS_CDioctl(cdrom->id, CDIOREADTOCHEADER, &toc) == 0 ) {
- cdrom->numtracks = toc.ending_track-toc.starting_track+1;
- if ( cdrom->numtracks > SDL_MAX_TRACKS ) {
- cdrom->numtracks = SDL_MAX_TRACKS;
- }
- /* Read all the track TOC entries */
- for ( i=0; i<=cdrom->numtracks; ++i ) {
- if ( i == cdrom->numtracks ) {
- cdrom->track[i].id = 0xAA; /* CDROM_LEADOUT */
- } else {
- cdrom->track[i].id = toc.starting_track+i;
- }
- entry.starting_track = cdrom->track[i].id;
- entry.address_format = CD_MSF_FORMAT;
- entry.data_len = sizeof(data);
- entry.data = &data;
- if ( SDL_SYS_CDioctl(cdrom->id, CDIOREADTOCENTRYS,
- &entry) < 0 ) {
- break;
- } else {
- cdrom->track[i].type = data.control;
- cdrom->track[i].offset = MSF_TO_FRAMES(
- data.addr.msf.minute,
- data.addr.msf.second,
- data.addr.msf.frame);
- cdrom->track[i].length = 0;
- if ( i > 0 ) {
- cdrom->track[i-1].length =
- cdrom->track[i].offset-
- cdrom->track[i-1].offset;
- }
- }
- }
- if ( i == (cdrom->numtracks+1) ) {
- okay = 1;
- }
- }
- return(okay ? 0 : -1);
-}
-
-/* Get CD-ROM status */
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
-{
- CDstatus status;
- struct ioc_toc_header toc;
- struct ioc_read_subchannel info;
- struct cd_sub_channel_info data;
-
- info.address_format = CD_MSF_FORMAT;
- info.data_format = CD_CURRENT_POSITION;
- info.track = 0;
- info.data_len = sizeof(data);
- info.data = &data;
- if ( ioctl(cdrom->id, CDIOCREADSUBCHANNEL, &info) < 0 ) {
- if ( ERRNO_TRAYEMPTY(errno) ) {
- status = CD_TRAYEMPTY;
- } else {
- status = CD_ERROR;
- }
- } else {
- switch (data.header.audio_status) {
- case CD_AS_AUDIO_INVALID:
- case CD_AS_NO_STATUS:
- /* Try to determine if there's a CD available */
- if (ioctl(cdrom->id,CDIOREADTOCHEADER,&toc)==0)
- status = CD_STOPPED;
- else
- status = CD_TRAYEMPTY;
- break;
- case CD_AS_PLAY_COMPLETED:
- status = CD_STOPPED;
- break;
- case CD_AS_PLAY_IN_PROGRESS:
- status = CD_PLAYING;
- break;
- case CD_AS_PLAY_PAUSED:
- status = CD_PAUSED;
- break;
- default:
- status = CD_ERROR;
- break;
- }
- }
- if ( position ) {
- if ( status == CD_PLAYING || (status == CD_PAUSED) ) {
- *position = MSF_TO_FRAMES(
- data.what.position.absaddr.msf.minute,
- data.what.position.absaddr.msf.second,
- data.what.position.absaddr.msf.frame);
- } else {
- *position = 0;
- }
- }
- return(status);
-}
-
-/* Start play */
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
-{
- struct ioc_play_msf playtime;
-
- FRAMES_TO_MSF(start,
- &playtime.start_m, &playtime.start_s, &playtime.start_f);
- FRAMES_TO_MSF(start+length,
- &playtime.end_m, &playtime.end_s, &playtime.end_f);
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Trying to play from %d:%d:%d to %d:%d:%d\n",
- playtime.start_m, playtime.start_s, playtime.start_f,
- playtime.end_m, playtime.end_s, playtime.end_f);
-#endif
- ioctl(cdrom->id, CDIOCSTART, 0);
- return(SDL_SYS_CDioctl(cdrom->id, CDIOCPLAYMSF, &playtime));
-}
-
-/* Pause play */
-static int SDL_SYS_CDPause(SDL_CD *cdrom)
-{
- return(SDL_SYS_CDioctl(cdrom->id, CDIOCPAUSE, 0));
-}
-
-/* Resume play */
-static int SDL_SYS_CDResume(SDL_CD *cdrom)
-{
- return(SDL_SYS_CDioctl(cdrom->id, CDIOCRESUME, 0));
-}
-
-/* Stop play */
-static int SDL_SYS_CDStop(SDL_CD *cdrom)
-{
- return(SDL_SYS_CDioctl(cdrom->id, CDIOCSTOP, 0));
-}
-
-/* Eject the CD-ROM */
-static int SDL_SYS_CDEject(SDL_CD *cdrom)
-{
- return(SDL_SYS_CDioctl(cdrom->id, CDIOCEJECT, 0));
-}
-
-/* Close the CD-ROM handle */
-static void SDL_SYS_CDClose(SDL_CD *cdrom)
-{
- close(cdrom->id);
-}
-
-void SDL_SYS_CDQuit(void)
-{
- int i;
-
- if ( SDL_numcds > 0 ) {
- for ( i=0; i<SDL_numcds; ++i ) {
- SDL_free(SDL_cdlist[i]);
- }
- SDL_numcds = 0;
- }
-}
-
-#endif /* SDL_CDROM_OPENBSD */
diff --git a/distrib/sdl-1.2.12/src/cdrom/os2/SDL_syscdrom.c b/distrib/sdl-1.2.12/src/cdrom/os2/SDL_syscdrom.c
deleted file mode 100644
index 56205fd..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/os2/SDL_syscdrom.c
+++ /dev/null
@@ -1,393 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_CDROM_OS2
-
-/* Functions for system-level CD-ROM audio control */
-
-#define INCL_MCIOS2
-#include <os2.h>
-#include <os2me.h>
-
-#include "SDL_cdrom.h"
-#include "../SDL_syscdrom.h"
-
-/* Size of MCI result buffer (in bytes) */
-#define MCI_CMDRETBUFSIZE 128
-
-/* The maximum number of CD-ROM drives we'll detect */
-#define MAX_DRIVES 16
-
-/* A list of available CD-ROM drives */
-static char *SDL_cdlist[MAX_DRIVES];
-//static dev_t SDL_cdmode[MAX_DRIVES];
-
-/* The system-dependent CD control functions */
-static const char *SDL_SYS_CDName(int drive);
-static int SDL_SYS_CDOpen(int drive);
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
-static int SDL_SYS_CDPause(SDL_CD *cdrom);
-static int SDL_SYS_CDResume(SDL_CD *cdrom);
-static int SDL_SYS_CDStop(SDL_CD *cdrom);
-static int SDL_SYS_CDEject(SDL_CD *cdrom);
-static void SDL_SYS_CDClose(SDL_CD *cdrom);
-
-/* MCI Timing Functions */
-#define MCI_MMTIMEPERSECOND 3000
-#define FRAMESFROMMM(mmtime) (((mmtime)*CD_FPS)/MCI_MMTIMEPERSECOND)
-
-
-/* Ready for MCI CDAudio Devices */
-int SDL_SYS_CDInit(void)
-{
-int i; /* generig counter */
-MCI_SYSINFO_PARMS msp; /* Structure to MCI SysInfo parameters */
-CHAR SysInfoRet[MCI_CMDRETBUFSIZE]; /* Buffer for MCI Command result */
-
-/* Fill in our driver capabilities */
-SDL_CDcaps.Name = SDL_SYS_CDName;
-SDL_CDcaps.Open = SDL_SYS_CDOpen;
-SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
-SDL_CDcaps.Status = SDL_SYS_CDStatus;
-SDL_CDcaps.Play = SDL_SYS_CDPlay;
-SDL_CDcaps.Pause = SDL_SYS_CDPause;
-SDL_CDcaps.Resume = SDL_SYS_CDResume;
-SDL_CDcaps.Stop = SDL_SYS_CDStop;
-SDL_CDcaps.Eject = SDL_SYS_CDEject;
-SDL_CDcaps.Close = SDL_SYS_CDClose;
-
-/* Get the number of CD ROMs in the System */
-/* Clean SysInfo structure */
-SDL_memset(&msp, 0x00, sizeof(MCI_SYSINFO_PARMS));
-/* Prepare structure to Ask Numer of Audio CDs */
-msp.usDeviceType = MCI_DEVTYPE_CD_AUDIO; /* CD Audio Type */
-msp.pszReturn = (PSZ)&SysInfoRet; /* Return Structure */
-msp.ulRetSize = MCI_CMDRETBUFSIZE; /* Size of ret struct */
-if (LOUSHORT(mciSendCommand(0,MCI_SYSINFO, MCI_SYSINFO_QUANTITY | MCI_WAIT, (PVOID)&msp, 0)) != MCIERR_SUCCESS) return(CD_ERROR);
-SDL_numcds = atoi(SysInfoRet);
-if (SDL_numcds > MAX_DRIVES) SDL_numcds = MAX_DRIVES; /* Limit maximum CD number */
-
-/* Get and Add their system name to the SDL_cdlist */
-msp.pszReturn = (PSZ)&SysInfoRet; /* Return Structure */
-msp.ulRetSize = MCI_CMDRETBUFSIZE; /* Size of ret struct */
-msp.usDeviceType = MCI_DEVTYPE_CD_AUDIO; /* CD Audio Type */
-for (i=0; i<SDL_numcds; i++)
- {
- msp.ulNumber = i+1;
- mciSendCommand(0,MCI_SYSINFO, MCI_SYSINFO_NAME | MCI_WAIT,&msp, 0);
- SDL_cdlist[i] = SDL_strdup(SysInfoRet);
- if ( SDL_cdlist[i] == NULL )
- {
- SDL_OutOfMemory();
- return(-1);
- }
- }
-return(0);
-}
-
-/* Return CDAudio System Dependent Device Name - Ready for MCI*/
-static const char *SDL_SYS_CDName(int drive)
-{
-return(SDL_cdlist[drive]);
-}
-
-/* Open CDAudio Device - Ready for MCI */
-static int SDL_SYS_CDOpen(int drive)
-{
-MCI_OPEN_PARMS mop;
-MCI_SET_PARMS msp;
-MCI_GENERIC_PARMS mgp;
-
-/* Open the device */
-mop.hwndCallback = (HWND)NULL; // None
-mop.usDeviceID = (USHORT)NULL; // Will be returned.
-mop.pszDeviceType = (PSZ)SDL_cdlist[drive]; // CDAudio Device
-if (LOUSHORT(mciSendCommand(0,MCI_OPEN,MCI_WAIT,&mop, 0)) != MCIERR_SUCCESS) return(CD_ERROR);
-/* Set time format */
-msp.hwndCallback = (HWND)NULL; // None
-msp.ulTimeFormat = MCI_FORMAT_MSF; // Minute : Second : Frame structure
-msp.ulSpeedFormat = (ULONG)NULL; // No change
-msp.ulAudio = (ULONG)NULL; // No Channel
-msp.ulLevel = (ULONG)NULL; // No Volume
-msp.ulOver = (ULONG)NULL; // No Delay
-msp.ulItem = (ULONG)NULL; // No item
-msp.ulValue = (ULONG)NULL; // No value for item flag
-if (LOUSHORT(mciSendCommand(mop.usDeviceID,MCI_SET,MCI_WAIT | MCI_SET_TIME_FORMAT,&msp, 0)) == MCIERR_SUCCESS) return (mop.usDeviceID);
-/* Error setting time format? - Close opened device */
-mgp.hwndCallback = (HWND)NULL; // None
-mciSendCommand(mop.usDeviceID,MCI_CLOSE,MCI_WAIT,&mgp, 0);
-return(CD_ERROR);
-}
-
-/* Get CD Table Of Contents - Ready for MCI */
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
-{
-MCI_TOC_PARMS mtp;
-MCI_STATUS_PARMS msp;
-MCI_TOC_REC * mtr;
-INT i;
-
-/* Correction because MCI cannot read TOC while CD is playing (it'll stop!) */
-if (cdrom->status == CD_PLAYING || cdrom->status == CD_PAUSED) return 0;
-
-/* Get Number of Tracks */
-msp.hwndCallback = (HWND)NULL; /* None */
-msp.ulReturn = (ULONG)NULL; /* We want this information */
-msp.ulItem = MCI_STATUS_NUMBER_OF_TRACKS;
-msp.ulValue = (ULONG)NULL; /* No additional information */
-if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STATUS,MCI_WAIT | MCI_STATUS_ITEM,&msp, 0)) != MCIERR_SUCCESS) return(CD_ERROR);
-cdrom->numtracks = msp.ulReturn;
-if ( cdrom->numtracks > SDL_MAX_TRACKS )
- {
- cdrom->numtracks = SDL_MAX_TRACKS;
- }
-/* Alocate space for TOC data */
-mtr = (MCI_TOC_REC *)SDL_malloc(cdrom->numtracks*sizeof(MCI_TOC_REC));
-if ( mtr == NULL )
- {
- SDL_OutOfMemory();
- return(-1);
- }
-/* Get TOC from CD */
-mtp.pBuf = mtr;
-mtp.ulBufSize = cdrom->numtracks*sizeof(MCI_TOC_REC);
-if (LOUSHORT(mciSendCommand(cdrom->id,MCI_GETTOC,MCI_WAIT,&mtp, 0)) != MCIERR_SUCCESS)
- {
- SDL_OutOfMemory();
- SDL_free(mtr);
- return(CD_ERROR);
- }
-/* Fill SDL Tracks Structure */
-for (i=0; i<cdrom->numtracks; i++)
- {
- /* Set Track ID */
- cdrom->track[i].id = (mtr+i)->TrackNum;
- /* Set Track Type */
- msp.hwndCallback = (HWND)NULL; /* None */
- msp.ulReturn = (ULONG)NULL; /* We want this information */
- msp.ulItem = MCI_CD_STATUS_TRACK_TYPE;
- msp.ulValue = (ULONG)((mtr+i)->TrackNum); /* Track Number? */
- if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STATUS,MCI_WAIT | MCI_TRACK | MCI_STATUS_ITEM,&msp, 0)) != MCIERR_SUCCESS)
- {
- SDL_free(mtr);
- return (CD_ERROR);
- }
- if (msp.ulReturn==MCI_CD_TRACK_AUDIO) cdrom->track[i].type = SDL_AUDIO_TRACK;
- else cdrom->track[i].type = SDL_DATA_TRACK;
- /* Set Track Length - values from MCI are in MMTIMEs - 3000 MMTIME = 1 second */
- cdrom->track[i].length = FRAMESFROMMM((mtr+i)->ulEndAddr - (mtr+i)->ulStartAddr);
- /* Set Track Offset */
- cdrom->track[i].offset = FRAMESFROMMM((mtr+i)->ulStartAddr);
- }
-SDL_free(mtr);
-return(0);
-}
-
-
-/* Get CD-ROM status - Ready for MCI */
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
-{
-CDstatus status;
-MCI_STATUS_PARMS msp;
-
-/* Get Status from MCI */
-msp.hwndCallback = (HWND)NULL; /* None */
-msp.ulReturn = (ULONG)NULL; /* We want this information */
-msp.ulItem = MCI_STATUS_MODE;
-msp.ulValue = (ULONG)NULL; /* No additional information */
-if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STATUS,MCI_WAIT | MCI_STATUS_ITEM,&msp, 0)) != MCIERR_SUCCESS) status = CD_ERROR;
-else
- {
- switch(msp.ulReturn)
- {
- case MCI_MODE_NOT_READY:
- status = CD_TRAYEMPTY;
- break;
- case MCI_MODE_PAUSE:
- status = CD_PAUSED;
- break;
- case MCI_MODE_PLAY:
- status = CD_PLAYING;
- break;
- case MCI_MODE_STOP:
- status = CD_STOPPED;
- break;
- /* These cases should not occour */
- case MCI_MODE_RECORD:
- case MCI_MODE_SEEK:
- default:
- status = CD_ERROR;
- break;
- }
- }
-
-/* Determine position */
-if (position != NULL) /* The SDL $&$&%# CDROM call sends NULL pointer here! */
- {
- if ((status == CD_PLAYING) || (status == CD_PAUSED))
- {
- /* Get Position */
- msp.hwndCallback = (HWND)NULL; /* None */
- msp.ulReturn = (ULONG)NULL; /* We want this information */
- msp.ulItem = MCI_STATUS_POSITION;
- msp.ulValue = (ULONG)NULL; /* No additiona info */
- if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STATUS,MCI_WAIT | MCI_STATUS_ITEM,&msp, 0)) != MCIERR_SUCCESS) return (CD_ERROR);
- /* Convert from MSF (format selected in the Open process) to Frames (format that will be returned) */
- *position = MSF_TO_FRAMES(MSF_MINUTE(msp.ulReturn),MSF_SECOND(msp.ulReturn),MSF_FRAME(msp.ulReturn));
- }
- else *position = 0;
- }
-return(status);
-}
-
-/* Start play - Ready for MCI */
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
-{
-MCI_GENERIC_PARMS mgp;
-MCI_STATUS_PARMS msp;
-MCI_PLAY_PARMS mpp;
-ULONG min,sec,frm;
-
-/* Start MSF */
-FRAMES_TO_MSF(start, &min, &sec, &frm);
-MSF_MINUTE(mpp.ulFrom) = min;
-MSF_SECOND(mpp.ulFrom) = sec;
-MSF_FRAME(mpp.ulFrom) = frm;
-/* End MSF */
-FRAMES_TO_MSF(start+length, &min, &sec, &frm);
-MSF_MINUTE(mpp.ulTo) = min;
-MSF_SECOND(mpp.ulTo) = sec;
-MSF_FRAME(mpp.ulTo) = frm;
-#ifdef DEBUG_CDROM
- fprintf(stderr, "Trying to play from %d:%d:%d to %d:%d:%d\n",
- playtime.cdmsf_min0, playtime.cdmsf_sec0, playtime.cdmsf_frame0,
- playtime.cdmsf_min1, playtime.cdmsf_sec1, playtime.cdmsf_frame1);
-#endif
-/* Verifies if it is paused first... and if it is, unpause before stopping it. */
-msp.hwndCallback = (HWND)NULL; /* None */
-msp.ulReturn = (ULONG)NULL; /* We want this information */
-msp.ulItem = MCI_STATUS_MODE;
-msp.ulValue = (ULONG)NULL; /* No additional information */
-if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STATUS,MCI_WAIT | MCI_STATUS_ITEM,&msp, 0)) == MCIERR_SUCCESS)
- {
- if (msp.ulReturn == MCI_MODE_PAUSE)
- {
- mgp.hwndCallback = (HWND)NULL; // None
- mciSendCommand(cdrom->id,MCI_RESUME,0,&mgp, 0);
- }
- }
-/* Now play it. */
-mpp.hwndCallback = (HWND)NULL; // We do not want the info. temp
-if (LOUSHORT(mciSendCommand(cdrom->id,MCI_PLAY,MCI_FROM | MCI_TO,&mpp, 0)) == MCIERR_SUCCESS) return 0;
-return (CD_ERROR);
-}
-
-/* Pause play - Ready for MCI */
-static int SDL_SYS_CDPause(SDL_CD *cdrom)
-{
-MCI_GENERIC_PARMS mgp;
-
-mgp.hwndCallback = (HWND)NULL; // None
-if (LOUSHORT(mciSendCommand(cdrom->id,MCI_PAUSE,MCI_WAIT,&mgp, 0)) == MCIERR_SUCCESS) return 0;
-return(CD_ERROR);
-}
-
-/* Resume play - Ready for MCI */
-static int SDL_SYS_CDResume(SDL_CD *cdrom)
-{
-MCI_GENERIC_PARMS mgp;
-
-mgp.hwndCallback = (HWND)NULL; // None
-if (LOUSHORT(mciSendCommand(cdrom->id,MCI_RESUME,MCI_WAIT,&mgp, 0)) == MCIERR_SUCCESS) return 0;
-return(CD_ERROR);
-}
-
-/* Stop play - Ready for MCI */
-static int SDL_SYS_CDStop(SDL_CD *cdrom)
-{
-MCI_GENERIC_PARMS mgp;
-MCI_STATUS_PARMS msp;
-
-/* Verifies if it is paused first... and if it is, unpause before stopping it. */
-msp.hwndCallback = (HWND)NULL; /* None */
-msp.ulReturn = (ULONG)NULL; /* We want this information */
-msp.ulItem = MCI_STATUS_MODE;
-msp.ulValue = (ULONG)NULL; /* No additional information */
-if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STATUS,MCI_WAIT | MCI_STATUS_ITEM,&msp, 0)) == MCIERR_SUCCESS)
- {
- if (msp.ulReturn == MCI_MODE_PAUSE)
- {
- mgp.hwndCallback = (HWND)NULL; // None
- mciSendCommand(cdrom->id,MCI_RESUME,0,&mgp, 0);
- }
- }
-/* Now stops the media */
-mgp.hwndCallback = (HWND)NULL; // None
-if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STOP,MCI_WAIT,&mgp, 0)) == MCIERR_SUCCESS) return 0;
-return(CD_ERROR);
-}
-
-/* Eject the CD-ROM - Ready for MCI */
-static int SDL_SYS_CDEject(SDL_CD *cdrom)
-{
-MCI_SET_PARMS msp;
-
-msp.hwndCallback = (HWND)NULL; // None
-msp.ulTimeFormat = (ULONG)NULL; // No change
-msp.ulSpeedFormat = (ULONG)NULL; // No change
-msp.ulAudio = (ULONG)NULL; // No Channel
-msp.ulLevel = (ULONG)NULL; // No Volume
-msp.ulOver = (ULONG)NULL; // No Delay
-msp.ulItem = (ULONG)NULL; // No item
-msp.ulValue = (ULONG)NULL; // No value for item flag
-if (LOUSHORT(mciSendCommand(cdrom->id,MCI_SET,MCI_WAIT | MCI_SET_DOOR_OPEN,&msp, 0)) == MCIERR_SUCCESS) return 0;
-return(CD_ERROR);
-}
-
-/* Close the CD-ROM handle - Ready for MCI */
-static void SDL_SYS_CDClose(SDL_CD *cdrom)
-{
-MCI_GENERIC_PARMS mgp;
-
-mgp.hwndCallback = (HWND)NULL; // None
-mciSendCommand(cdrom->id,MCI_CLOSE,MCI_WAIT,&mgp, 0);
-}
-
-/* Finalize CDROM Subsystem - Ready for MCI */
-void SDL_SYS_CDQuit(void)
-{
-int i;
-
-if ( SDL_numcds > 0 )
- {
- for ( i=0; i<SDL_numcds; ++i )
- {
- SDL_free(SDL_cdlist[i]);
- }
- SDL_numcds = 0;
- }
-}
-
-#endif /* SDL_CDROM_OS2 */
diff --git a/distrib/sdl-1.2.12/src/cdrom/qnx/SDL_syscdrom.c b/distrib/sdl-1.2.12/src/cdrom/qnx/SDL_syscdrom.c
deleted file mode 100644
index d41d640..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/qnx/SDL_syscdrom.c
+++ /dev/null
@@ -1,551 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_CDROM_QNX
-
-/* Functions for system-level CD-ROM audio control */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <unistd.h>
-#include <sys/cdrom.h>
-#include <sys/dcmd_cam.h>
-
-#include "SDL_timer.h"
-#include "SDL_cdrom.h"
-#include "../SDL_syscdrom.h"
-
-/* The maximum number of CD-ROM drives we'll detect */
-#define MAX_DRIVES 16
-
-#define QNX_CD_OPENMODE O_RDONLY | O_EXCL
-
-/* A list of available CD-ROM drives */
-static char *SDL_cdlist[MAX_DRIVES];
-static dev_t SDL_cdmode[MAX_DRIVES];
-static int SDL_cdopen[MAX_DRIVES];
-
-/* The system-dependent CD control functions */
-static const char *SDL_SYS_CDName(int drive);
-static int SDL_SYS_CDOpen(int drive);
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
-static int SDL_SYS_CDPause(SDL_CD *cdrom);
-static int SDL_SYS_CDResume(SDL_CD *cdrom);
-static int SDL_SYS_CDStop(SDL_CD *cdrom);
-static int SDL_SYS_CDEject(SDL_CD *cdrom);
-static void SDL_SYS_CDClose(SDL_CD *cdrom);
-
-/* Check a drive to see if it is a CD-ROM */
-static int CheckDrive(char *drive, struct stat *stbuf)
-{
- int is_cd, cdfd;
- cam_devinfo_t dinfo;
- int devctlret=0;
-
- int atapi;
- int removable;
- int cdb10;
-
- /* If it doesn't exist, return -1 */
- if (stat(drive, stbuf) < 0)
- {
- return(-1);
- }
-
- /* If it does exist, verify that it's an available CD-ROM */
- is_cd = 0;
-
- if (S_ISCHR(stbuf->st_mode) || S_ISBLK(stbuf->st_mode))
- {
- cdfd = open(drive, QNX_CD_OPENMODE);
- if ( cdfd >= 0 )
- {
- devctlret=devctl(cdfd, DCMD_CAM_DEVINFO, &dinfo, sizeof(cam_devinfo_t), NULL);
-
- if (devctlret==EOK)
- {
- atapi=dinfo.flags & DEV_ATAPI;
- removable=dinfo.flags & DEV_REMOVABLE;
- cdb10=dinfo.flags & DEV_CDB_10; /* I'm not sure about that flag */
-
- /* in the near future need to add more checks for splitting cdroms from other devices */
- if ((atapi)&&(removable))
- {
- is_cd = 1;
- }
- }
-
- close(cdfd);
- }
- }
- return(is_cd);
-}
-
-/* Add a CD-ROM drive to our list of valid drives */
-static void AddDrive(char *drive, struct stat *stbuf)
-{
- int i;
-
- if (SDL_numcds < MAX_DRIVES)
- {
- /* Check to make sure it's not already in our list.
- This can happen when we see a drive via symbolic link. */
-
- for (i=0; i<SDL_numcds; ++i)
- {
- if (stbuf->st_rdev == SDL_cdmode[i])
- {
- return;
- }
- }
-
- /* Add this drive to our list */
-
- i = SDL_numcds;
- SDL_cdlist[i] = SDL_strdup(drive);
- if (SDL_cdlist[i] == NULL)
- {
- SDL_OutOfMemory();
- return;
- }
- SDL_cdmode[i] = stbuf->st_rdev;
- ++SDL_numcds;
- }
-}
-
-int SDL_SYS_CDInit(void)
-{
- /* checklist: /dev/cdrom, /dev/cd?, /dev/scd? */
- static char *checklist[]={"cdrom", "?0 cd?", "?1 cd?", "?0 scd?", NULL};
-
- char *SDLcdrom;
- int i, j, exists;
- char drive[32];
- struct stat stbuf;
-
- /* Fill in our driver capabilities */
- SDL_CDcaps.Name = SDL_SYS_CDName;
- SDL_CDcaps.Open = SDL_SYS_CDOpen;
- SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
- SDL_CDcaps.Status = SDL_SYS_CDStatus;
- SDL_CDcaps.Play = SDL_SYS_CDPlay;
- SDL_CDcaps.Pause = SDL_SYS_CDPause;
- SDL_CDcaps.Resume = SDL_SYS_CDResume;
- SDL_CDcaps.Stop = SDL_SYS_CDStop;
- SDL_CDcaps.Eject = SDL_SYS_CDEject;
- SDL_CDcaps.Close = SDL_SYS_CDClose;
-
- /* clearing device open status */
- for (i=0; i<MAX_DRIVES; i++)
- {
- SDL_cdopen[i]=0;
- }
-
- /* Look in the environment for our CD-ROM drive list */
- SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */
- if ( SDLcdrom != NULL )
- {
- char *cdpath, *delim;
- size_t len = SDL_strlen(SDLcdrom)+1;
- cdpath = SDL_stack_alloc(char, len);
- if (cdpath != NULL)
- {
- SDL_strlcpy(cdpath, SDLcdrom, len);
- SDLcdrom = cdpath;
- do {
- delim = SDL_strchr(SDLcdrom, ':');
- if (delim)
- {
- *delim++ = '\0';
- }
- if (CheckDrive(SDLcdrom, &stbuf) > 0)
- {
- AddDrive(SDLcdrom, &stbuf);
- }
- if (delim)
- {
- SDLcdrom = delim;
- }
- else
- {
- SDLcdrom = NULL;
- }
- } while (SDLcdrom);
- SDL_stack_free(cdpath);
- }
-
- /* If we found our drives, there's nothing left to do */
- if (SDL_numcds > 0)
- {
- return(0);
- }
- }
-
- /* Scan the system for CD-ROM drives */
- for ( i=0; checklist[i]; ++i )
- {
- if (checklist[i][0] == '?')
- {
- char* insert;
- exists = 1;
-
- for ( j=checklist[i][1]; exists; ++j )
- {
- SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", &checklist[i][3]);
- insert = SDL_strchr(drive, '?');
- if (insert != NULL)
- {
- *insert = j;
- }
- switch (CheckDrive(drive, &stbuf))
- {
- /* Drive exists and is a CD-ROM */
- case 1:
- AddDrive(drive, &stbuf);
- break;
- /* Drive exists, but isn't a CD-ROM */
- case 0:
- break;
- /* Drive doesn't exist */
- case -1:
- exists = 0;
- break;
- }
- }
- }
- else
- {
- SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]);
- if (CheckDrive(drive, &stbuf) > 0)
- {
- AddDrive(drive, &stbuf);
- }
- }
- }
- return(0);
-}
-
-static const char *SDL_SYS_CDName(int drive)
-{
- return(SDL_cdlist[drive]);
-}
-
-static int SDL_SYS_CDOpen(int drive)
-{
- int handle;
-
- handle=open(SDL_cdlist[drive], QNX_CD_OPENMODE);
-
- if (handle>0)
- {
- SDL_cdopen[drive]=handle;
- }
-
- return (handle);
-}
-
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
-{
- cdrom_read_toc_t toc;
- int i, okay;
-
- okay = 0;
- if (devctl(cdrom->id, DCMD_CAM_CDROMREADTOC, &toc, sizeof(toc), NULL) == 0)
- {
- cdrom->numtracks = toc.last_track - toc.first_track + 1;
- if (cdrom->numtracks > SDL_MAX_TRACKS)
- {
- cdrom->numtracks = SDL_MAX_TRACKS;
- }
- /* Read all the track TOC entries */
- for (i=0; i<=cdrom->numtracks; ++i)
- {
- if (i == cdrom->numtracks)
- {
- cdrom->track[i].id = CDROM_LEADOUT;
- }
- else
- {
- cdrom->track[i].id = toc.first_track+i;
- }
-
- cdrom->track[i].type = toc.toc_entry[i].control_adr & 0x0F;
- cdrom->track[i].offset = toc.toc_entry[i].addr.lba;
- cdrom->track[i].length = 0;
-
- if (i > 0)
- {
- cdrom->track[i-1].length = cdrom->track[i].offset-cdrom->track[i-1].offset;
- }
- }
- if (i == (cdrom->numtracks+1))
- {
- okay = 1;
- }
- }
- return (okay ? 0 : -1);
-}
-
-/* Get CD-ROM status */
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
-{
- CDstatus status;
-
- cdrom_read_toc_t toc;
- cdrom_subch_data_t info;
- cam_devinfo_t dinfo;
-
- int devctlret=0;
- int drive=-1;
- int i;
- int eagaincnt=0;
-
- /* check media presence before read subchannel call, some cdroms can lockups */
- /* if no media, while calling read subchannel functions. */
- devctlret=devctl(cdrom->id, DCMD_CAM_DEVINFO, &dinfo, sizeof(cam_devinfo_t), NULL);
-
- if (devctlret==EOK)
- {
- if ((dinfo.flags & DEV_NO_MEDIA)!=0)
- {
- status = CD_TRAYEMPTY;
- if (position)
- {
- *position = 0;
- }
- return (status);
- }
- }
-
- /* if media exists, then do other stuff */
-
- SDL_memset(&info, 0x00, sizeof(info));
- info.subch_command.data_format = CDROM_SUBCH_CURRENT_POSITION;
-
- do {
- devctlret=devctl(cdrom->id, DCMD_CAM_CDROMSUBCHNL, &info, sizeof(info), NULL);
- if (devctlret==EIO)
- {
- /* big workaround for media change, handle is unusable after that,
- that bug was found in QNX 6.2, 6.2.1 is not released yet. */
-
- for (i=0; i<MAX_DRIVES; i++)
- {
- if (SDL_cdopen[i]==cdrom->id)
- {
- drive=i;
- break;
- }
- }
- if (drive==-1)
- {
- /* that cannot happen, but ... */
- break;
- }
- close(cdrom->id);
- cdrom->id=open(SDL_cdlist[drive], QNX_CD_OPENMODE);
- devctlret=EAGAIN;
- }
- if (devctlret==EAGAIN)
- {
- eagaincnt++;
- }
- if (eagaincnt==2)
- {
- /* workaround for broken cdroms, which can return always EAGAIN when its not ready, */
- /* that mean errornous media or just no media avail */
- devctlret=ENXIO;
- break;
- }
- } while ((devctlret==EAGAIN)||(devctlret==ESTALE));
-
- if (devctlret != 0)
- {
- if (devctlret==ENXIO)
- {
- status = CD_TRAYEMPTY;
- }
- else
- {
- status = CD_ERROR;
- }
- }
- else
- {
- switch (info.current_position.header.audio_status)
- {
- case CDROM_AUDIO_INVALID:
- case CDROM_AUDIO_NO_STATUS:
- /* Try to determine if there's a CD available */
- if (devctl(cdrom->id, DCMD_CAM_CDROMREADTOC, &toc, sizeof(toc), NULL)==0)
- status = CD_STOPPED;
- else
- status = CD_TRAYEMPTY;
- break;
- case CDROM_AUDIO_COMPLETED:
- status = CD_STOPPED;
- break;
- case CDROM_AUDIO_PLAY:
- status = CD_PLAYING;
- break;
- case CDROM_AUDIO_PAUSED:
- /* Workaround buggy CD-ROM drive */
- if (info.current_position.data_format == CDROM_LEADOUT)
- {
- status = CD_STOPPED;
- }
- else
- {
- status = CD_PAUSED;
- }
- break;
- default:
- status = CD_ERROR;
- break;
- }
- }
-
- if (position)
- {
- if (status==CD_PLAYING || (status==CD_PAUSED))
- {
- *position = MSF_TO_FRAMES(info.current_position.addr.msf.minute,
- info.current_position.addr.msf.second,
- info.current_position.addr.msf.frame);
- }
- else
- {
- *position = 0;
- }
- }
-
- return (status);
-}
-
-/* Start play */
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
-{
- cdrom_playmsf_t playtime;
-
- FRAMES_TO_MSF(start, &playtime.start_minute, &playtime.start_second, &playtime.start_frame);
- FRAMES_TO_MSF(start+length, &playtime.end_minute, &playtime.end_second, &playtime.end_frame);
-
- if (devctl(cdrom->id, DCMD_CAM_CDROMPLAYMSF, &playtime, sizeof(playtime), NULL) != 0)
- {
- return -1;
- }
- else
- {
- return 0;
- }
-}
-
-/* Pause play */
-static int SDL_SYS_CDPause(SDL_CD *cdrom)
-{
- if (devctl(cdrom->id, DCMD_CAM_CDROMPAUSE, NULL, 0, NULL)!=0)
- {
- return -1;
- }
- else
- {
- return 0;
- }
-}
-
-/* Resume play */
-static int SDL_SYS_CDResume(SDL_CD *cdrom)
-{
- if (devctl(cdrom->id, DCMD_CAM_CDROMRESUME, NULL, 0, NULL)!=0)
- {
- return -1;
- }
- else
- {
- return 0;
- }
-}
-
-/* Stop play */
-static int SDL_SYS_CDStop(SDL_CD *cdrom)
-{
- if (devctl(cdrom->id, DCMD_CAM_CDROMSTOP, NULL, 0, NULL)!=0)
- {
- return -1;
- }
- else
- {
- return 0;
- }
-}
-
-/* Eject the CD-ROM */
-static int SDL_SYS_CDEject(SDL_CD *cdrom)
-{
- if (devctl(cdrom->id, DCMD_CAM_EJECT_MEDIA, NULL, 0, NULL)!=0)
- {
- return -1;
- }
- else
- {
- return 0;
- }
-}
-
-/* Close the CD-ROM handle */
-static void SDL_SYS_CDClose(SDL_CD *cdrom)
-{
- int i;
-
- for (i=0; i<MAX_DRIVES; i++)
- {
- if (SDL_cdopen[i]==cdrom->id)
- {
- SDL_cdopen[i]=0;
- break;
- }
- }
-
- close(cdrom->id);
-}
-
-void SDL_SYS_CDQuit(void)
-{
- int i;
-
- if (SDL_numcds > 0)
- {
- for (i=0; i<SDL_numcds; ++i)
- {
- SDL_free(SDL_cdlist[i]);
- }
- SDL_numcds = 0;
- }
-}
-
-#endif /* SDL_CDROM_QNX */
diff --git a/distrib/sdl-1.2.12/src/cdrom/win32/SDL_syscdrom.c b/distrib/sdl-1.2.12/src/cdrom/win32/SDL_syscdrom.c
deleted file mode 100644
index 3d0587d..0000000
--- a/distrib/sdl-1.2.12/src/cdrom/win32/SDL_syscdrom.c
+++ /dev/null
@@ -1,385 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_CDROM_WIN32
-
-/* Functions for system-level CD-ROM audio control */
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <mmsystem.h>
-
-#include "SDL_cdrom.h"
-#include "../SDL_syscdrom.h"
-
-/* This really broken?? */
-#define BROKEN_MCI_PAUSE /* Pausing actually stops play -- Doh! */
-
-/* The maximum number of CD-ROM drives we'll detect (Don't change!) */
-#define MAX_DRIVES 26
-
-/* A list of available CD-ROM drives */
-static char *SDL_cdlist[MAX_DRIVES];
-static MCIDEVICEID SDL_mciID[MAX_DRIVES];
-#ifdef BROKEN_MCI_PAUSE
-static int SDL_paused[MAX_DRIVES];
-#endif
-static int SDL_CD_end_position;
-
-/* The system-dependent CD control functions */
-static const char *SDL_SYS_CDName(int drive);
-static int SDL_SYS_CDOpen(int drive);
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
-static int SDL_SYS_CDPause(SDL_CD *cdrom);
-static int SDL_SYS_CDResume(SDL_CD *cdrom);
-static int SDL_SYS_CDStop(SDL_CD *cdrom);
-static int SDL_SYS_CDEject(SDL_CD *cdrom);
-static void SDL_SYS_CDClose(SDL_CD *cdrom);
-
-
-/* Add a CD-ROM drive to our list of valid drives */
-static void AddDrive(char *drive)
-{
- int i;
-
- if ( SDL_numcds < MAX_DRIVES ) {
- /* Add this drive to our list */
- i = SDL_numcds;
- SDL_cdlist[i] = SDL_strdup(drive);
- if ( SDL_cdlist[i] == NULL ) {
- SDL_OutOfMemory();
- return;
- }
- ++SDL_numcds;
-#ifdef CDROM_DEBUG
- fprintf(stderr, "Added CD-ROM drive: %s\n", drive);
-#endif
- }
-}
-
-int SDL_SYS_CDInit(void)
-{
- /* checklist: Drive 'A' - 'Z' */
- int i;
- char drive[4];
-
- /* Fill in our driver capabilities */
- SDL_CDcaps.Name = SDL_SYS_CDName;
- SDL_CDcaps.Open = SDL_SYS_CDOpen;
- SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
- SDL_CDcaps.Status = SDL_SYS_CDStatus;
- SDL_CDcaps.Play = SDL_SYS_CDPlay;
- SDL_CDcaps.Pause = SDL_SYS_CDPause;
- SDL_CDcaps.Resume = SDL_SYS_CDResume;
- SDL_CDcaps.Stop = SDL_SYS_CDStop;
- SDL_CDcaps.Eject = SDL_SYS_CDEject;
- SDL_CDcaps.Close = SDL_SYS_CDClose;
-
- /* Scan the system for CD-ROM drives */
- for ( i='A'; i<='Z'; ++i ) {
- SDL_snprintf(drive, SDL_arraysize(drive), "%c:\\", i);
- if ( GetDriveType(drive) == DRIVE_CDROM ) {
- AddDrive(drive);
- }
- }
- SDL_memset(SDL_mciID, 0, sizeof(SDL_mciID));
- return(0);
-}
-
-/* General ioctl() CD-ROM command function */
-static int SDL_SYS_CDioctl(int id, UINT msg, DWORD flags, void *arg)
-{
- MCIERROR mci_error;
-
- mci_error = mciSendCommand(SDL_mciID[id], msg, flags, (DWORD_PTR)arg);
- if ( mci_error ) {
- char error[256];
-
- mciGetErrorString(mci_error, error, 256);
- SDL_SetError("mciSendCommand() error: %s", error);
- }
- return(!mci_error ? 0 : -1);
-}
-
-static const char *SDL_SYS_CDName(int drive)
-{
- return(SDL_cdlist[drive]);
-}
-
-static int SDL_SYS_CDOpen(int drive)
-{
- MCI_OPEN_PARMS mci_open;
- MCI_SET_PARMS mci_set;
- char device[3];
- DWORD flags;
-
- /* Open the requested device */
- mci_open.lpstrDeviceType = (LPCSTR) MCI_DEVTYPE_CD_AUDIO;
- device[0] = *SDL_cdlist[drive];
- device[1] = ':';
- device[2] = '\0';
- mci_open.lpstrElementName = device;
- flags =
- (MCI_OPEN_TYPE|MCI_OPEN_SHAREABLE|MCI_OPEN_TYPE_ID|MCI_OPEN_ELEMENT);
- if ( SDL_SYS_CDioctl(0, MCI_OPEN, flags, &mci_open) < 0 ) {
- flags &= ~MCI_OPEN_SHAREABLE;
- if ( SDL_SYS_CDioctl(0, MCI_OPEN, flags, &mci_open) < 0 ) {
- return(-1);
- }
- }
- SDL_mciID[drive] = mci_open.wDeviceID;
-
- /* Set the minute-second-frame time format */
- mci_set.dwTimeFormat = MCI_FORMAT_MSF;
- SDL_SYS_CDioctl(drive, MCI_SET, MCI_SET_TIME_FORMAT, &mci_set);
-
-#ifdef BROKEN_MCI_PAUSE
- SDL_paused[drive] = 0;
-#endif
- return(drive);
-}
-
-static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
-{
- MCI_STATUS_PARMS mci_status;
- int i, okay;
- DWORD flags;
-
- okay = 0;
- mci_status.dwItem = MCI_STATUS_NUMBER_OF_TRACKS;
- flags = MCI_STATUS_ITEM | MCI_WAIT;
- if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags, &mci_status) == 0 ) {
- cdrom->numtracks = mci_status.dwReturn;
- if ( cdrom->numtracks > SDL_MAX_TRACKS ) {
- cdrom->numtracks = SDL_MAX_TRACKS;
- }
- /* Read all the track TOC entries */
- flags = MCI_STATUS_ITEM | MCI_TRACK | MCI_WAIT;
- for ( i=0; i<cdrom->numtracks; ++i ) {
- cdrom->track[i].id = i+1;
- mci_status.dwTrack = cdrom->track[i].id;
-#ifdef MCI_CDA_STATUS_TYPE_TRACK
- mci_status.dwItem = MCI_CDA_STATUS_TYPE_TRACK;
- if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags,
- &mci_status) < 0 ) {
- break;
- }
- if ( mci_status.dwReturn == MCI_CDA_TRACK_AUDIO ) {
- cdrom->track[i].type = SDL_AUDIO_TRACK;
- } else {
- cdrom->track[i].type = SDL_DATA_TRACK;
- }
-#else
- cdrom->track[i].type = SDL_AUDIO_TRACK;
-#endif
- mci_status.dwItem = MCI_STATUS_POSITION;
- if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags,
- &mci_status) < 0 ) {
- break;
- }
- cdrom->track[i].offset = MSF_TO_FRAMES(
- MCI_MSF_MINUTE(mci_status.dwReturn),
- MCI_MSF_SECOND(mci_status.dwReturn),
- MCI_MSF_FRAME(mci_status.dwReturn));
- cdrom->track[i].length = 0;
- if ( i > 0 ) {
- cdrom->track[i-1].length =
- cdrom->track[i].offset-
- cdrom->track[i-1].offset;
- }
- }
- if ( i == cdrom->numtracks ) {
- mci_status.dwTrack = cdrom->track[i - 1].id;
- mci_status.dwItem = MCI_STATUS_LENGTH;
- if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags,
- &mci_status) == 0 ) {
- cdrom->track[i - 1].length = MSF_TO_FRAMES(
- MCI_MSF_MINUTE(mci_status.dwReturn),
- MCI_MSF_SECOND(mci_status.dwReturn),
- MCI_MSF_FRAME(mci_status.dwReturn));
- /* compute lead-out offset */
- cdrom->track[i].offset = cdrom->track[i - 1].offset +
- cdrom->track[i - 1].length;
- cdrom->track[i].length = 0;
- okay = 1;
- }
- }
- }
- return(okay ? 0 : -1);
-}
-
-/* Get CD-ROM status */
-static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
-{
- CDstatus status;
- MCI_STATUS_PARMS mci_status;
- DWORD flags;
-
- flags = MCI_STATUS_ITEM | MCI_WAIT;
- mci_status.dwItem = MCI_STATUS_MODE;
- if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags, &mci_status) < 0 ) {
- status = CD_ERROR;
- } else {
- switch (mci_status.dwReturn) {
- case MCI_MODE_NOT_READY:
- case MCI_MODE_OPEN:
- status = CD_TRAYEMPTY;
- break;
- case MCI_MODE_STOP:
-#ifdef BROKEN_MCI_PAUSE
- if ( SDL_paused[cdrom->id] ) {
- status = CD_PAUSED;
- } else {
- status = CD_STOPPED;
- }
-#else
- status = CD_STOPPED;
-#endif /* BROKEN_MCI_PAUSE */
- break;
- case MCI_MODE_PLAY:
-#ifdef BROKEN_MCI_PAUSE
- if ( SDL_paused[cdrom->id] ) {
- status = CD_PAUSED;
- } else {
- status = CD_PLAYING;
- }
-#else
- status = CD_PLAYING;
-#endif /* BROKEN_MCI_PAUSE */
- break;
- case MCI_MODE_PAUSE:
- status = CD_PAUSED;
- break;
- default:
- status = CD_ERROR;
- break;
- }
- }
- if ( position ) {
- if ( status == CD_PLAYING || (status == CD_PAUSED) ) {
- mci_status.dwItem = MCI_STATUS_POSITION;
- if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags,
- &mci_status) == 0 ) {
- *position = MSF_TO_FRAMES(
- MCI_MSF_MINUTE(mci_status.dwReturn),
- MCI_MSF_SECOND(mci_status.dwReturn),
- MCI_MSF_FRAME(mci_status.dwReturn));
- } else {
- *position = 0;
- }
- } else {
- *position = 0;
- }
- }
- return(status);
-}
-
-/* Start play */
-static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
-{
- MCI_PLAY_PARMS mci_play;
- int m, s, f;
- DWORD flags;
-
- flags = MCI_FROM | MCI_TO | MCI_NOTIFY;
- mci_play.dwCallback = 0;
- FRAMES_TO_MSF(start, &m, &s, &f);
- mci_play.dwFrom = MCI_MAKE_MSF(m, s, f);
- FRAMES_TO_MSF(start+length, &m, &s, &f);
- mci_play.dwTo = MCI_MAKE_MSF(m, s, f);
- SDL_CD_end_position = mci_play.dwTo;
- return(SDL_SYS_CDioctl(cdrom->id, MCI_PLAY, flags, &mci_play));
-}
-
-/* Pause play */
-static int SDL_SYS_CDPause(SDL_CD *cdrom)
-{
-#ifdef BROKEN_MCI_PAUSE
- SDL_paused[cdrom->id] = 1;
-#endif
- return(SDL_SYS_CDioctl(cdrom->id, MCI_PAUSE, MCI_WAIT, NULL));
-}
-
-/* Resume play */
-static int SDL_SYS_CDResume(SDL_CD *cdrom)
-{
-#ifdef BROKEN_MCI_PAUSE
- MCI_STATUS_PARMS mci_status;
- int okay;
- int flags;
-
- okay = 0;
- /* Play from the current play position to the end position set earlier */
- flags = MCI_STATUS_ITEM | MCI_WAIT;
- mci_status.dwItem = MCI_STATUS_POSITION;
- if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags, &mci_status) == 0 ) {
- MCI_PLAY_PARMS mci_play;
-
- flags = MCI_FROM | MCI_TO | MCI_NOTIFY;
- mci_play.dwCallback = 0;
- mci_play.dwFrom = mci_status.dwReturn;
- mci_play.dwTo = SDL_CD_end_position;
- if (SDL_SYS_CDioctl(cdrom->id,MCI_PLAY,flags,&mci_play) == 0) {
- okay = 1;
- SDL_paused[cdrom->id] = 0;
- }
- }
- return(okay ? 0 : -1);
-#else
- return(SDL_SYS_CDioctl(cdrom->id, MCI_RESUME, MCI_WAIT, NULL));
-#endif /* BROKEN_MCI_PAUSE */
-}
-
-/* Stop play */
-static int SDL_SYS_CDStop(SDL_CD *cdrom)
-{
- return(SDL_SYS_CDioctl(cdrom->id, MCI_STOP, MCI_WAIT, NULL));
-}
-
-/* Eject the CD-ROM */
-static int SDL_SYS_CDEject(SDL_CD *cdrom)
-{
- return(SDL_SYS_CDioctl(cdrom->id, MCI_SET, MCI_SET_DOOR_OPEN, NULL));
-}
-
-/* Close the CD-ROM handle */
-static void SDL_SYS_CDClose(SDL_CD *cdrom)
-{
- SDL_SYS_CDioctl(cdrom->id, MCI_CLOSE, MCI_WAIT, NULL);
-}
-
-void SDL_SYS_CDQuit(void)
-{
- int i;
-
- if ( SDL_numcds > 0 ) {
- for ( i=0; i<SDL_numcds; ++i ) {
- SDL_free(SDL_cdlist[i]);
- }
- SDL_numcds = 0;
- }
-}
-
-#endif /* SDL_CDROM_WIN32 */
diff --git a/distrib/sdl-1.2.12/src/cpuinfo/SDL_cpuinfo.c b/distrib/sdl-1.2.12/src/cpuinfo/SDL_cpuinfo.c
deleted file mode 100644
index be3987e..0000000
--- a/distrib/sdl-1.2.12/src/cpuinfo/SDL_cpuinfo.c
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* CPU feature detection for SDL */
-
-#include "SDL.h"
-#include "SDL_cpuinfo.h"
-
-#if defined(__MACOSX__) && defined(__ppc__)
-#include <sys/sysctl.h> /* For AltiVec check */
-#elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
-#include <signal.h>
-#include <setjmp.h>
-#endif
-
-#define CPU_HAS_RDTSC 0x00000001
-#define CPU_HAS_MMX 0x00000002
-#define CPU_HAS_MMXEXT 0x00000004
-#define CPU_HAS_3DNOW 0x00000010
-#define CPU_HAS_3DNOWEXT 0x00000020
-#define CPU_HAS_SSE 0x00000040
-#define CPU_HAS_SSE2 0x00000080
-#define CPU_HAS_ALTIVEC 0x00000100
-
-#if SDL_ALTIVEC_BLITTERS && HAVE_SETJMP && !__MACOSX__
-/* This is the brute force way of detecting instruction sets...
- the idea is borrowed from the libmpeg2 library - thanks!
- */
-static jmp_buf jmpbuf;
-static void illegal_instruction(int sig)
-{
- longjmp(jmpbuf, 1);
-}
-#endif /* HAVE_SETJMP */
-
-static __inline__ int CPU_haveCPUID(void)
-{
- int has_CPUID = 0;
-#if defined(__GNUC__) && defined(i386)
- __asm__ (
-" pushfl # Get original EFLAGS \n"
-" popl %%eax \n"
-" movl %%eax,%%ecx \n"
-" xorl $0x200000,%%eax # Flip ID bit in EFLAGS \n"
-" pushl %%eax # Save new EFLAGS value on stack \n"
-" popfl # Replace current EFLAGS value \n"
-" pushfl # Get new EFLAGS \n"
-" popl %%eax # Store new EFLAGS in EAX \n"
-" xorl %%ecx,%%eax # Can not toggle ID bit, \n"
-" jz 1f # Processor=80486 \n"
-" movl $1,%0 # We have CPUID support \n"
-"1: \n"
- : "=m" (has_CPUID)
- :
- : "%eax", "%ecx"
- );
-#elif defined(__GNUC__) && defined(__x86_64__)
-/* Technically, if this is being compiled under __x86_64__ then it has
-CPUid by definition. But it's nice to be able to prove it. :) */
- __asm__ (
-" pushfq # Get original EFLAGS \n"
-" popq %%rax \n"
-" movq %%rax,%%rcx \n"
-" xorl $0x200000,%%eax # Flip ID bit in EFLAGS \n"
-" pushq %%rax # Save new EFLAGS value on stack \n"
-" popfq # Replace current EFLAGS value \n"
-" pushfq # Get new EFLAGS \n"
-" popq %%rax # Store new EFLAGS in EAX \n"
-" xorl %%ecx,%%eax # Can not toggle ID bit, \n"
-" jz 1f # Processor=80486 \n"
-" movl $1,%0 # We have CPUID support \n"
-"1: \n"
- : "=m" (has_CPUID)
- :
- : "%rax", "%rcx"
- );
-#elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
- __asm {
- pushfd ; Get original EFLAGS
- pop eax
- mov ecx, eax
- xor eax, 200000h ; Flip ID bit in EFLAGS
- push eax ; Save new EFLAGS value on stack
- popfd ; Replace current EFLAGS value
- pushfd ; Get new EFLAGS
- pop eax ; Store new EFLAGS in EAX
- xor eax, ecx ; Can not toggle ID bit,
- jz done ; Processor=80486
- mov has_CPUID,1 ; We have CPUID support
-done:
- }
-#elif defined(__sun) && defined(__i386)
- __asm (
-" pushfl \n"
-" popl %eax \n"
-" movl %eax,%ecx \n"
-" xorl $0x200000,%eax \n"
-" pushl %eax \n"
-" popfl \n"
-" pushfl \n"
-" popl %eax \n"
-" xorl %ecx,%eax \n"
-" jz 1f \n"
-" movl $1,-8(%ebp) \n"
-"1: \n"
- );
-#elif defined(__sun) && defined(__amd64)
- __asm (
-" pushfq \n"
-" popq %rax \n"
-" movq %rax,%rcx \n"
-" xorl $0x200000,%eax \n"
-" pushq %rax \n"
-" popfq \n"
-" pushfq \n"
-" popq %rax \n"
-" xorl %ecx,%eax \n"
-" jz 1f \n"
-" movl $1,-8(%rbp) \n"
-"1: \n"
- );
-#endif
- return has_CPUID;
-}
-
-static __inline__ int CPU_getCPUIDFeatures(void)
-{
- int features = 0;
-#if defined(__GNUC__) && ( defined(i386) || defined(__x86_64__) )
- __asm__ (
-" movl %%ebx,%%edi\n"
-" xorl %%eax,%%eax # Set up for CPUID instruction \n"
-" cpuid # Get and save vendor ID \n"
-" cmpl $1,%%eax # Make sure 1 is valid input for CPUID\n"
-" jl 1f # We dont have the CPUID instruction\n"
-" xorl %%eax,%%eax \n"
-" incl %%eax \n"
-" cpuid # Get family/model/stepping/features\n"
-" movl %%edx,%0 \n"
-"1: \n"
-" movl %%edi,%%ebx\n"
- : "=m" (features)
- :
- : "%eax", "%ecx", "%edx", "%edi"
- );
-#elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
- __asm {
- xor eax, eax ; Set up for CPUID instruction
- cpuid ; Get and save vendor ID
- cmp eax, 1 ; Make sure 1 is valid input for CPUID
- jl done ; We dont have the CPUID instruction
- xor eax, eax
- inc eax
- cpuid ; Get family/model/stepping/features
- mov features, edx
-done:
- }
-#elif defined(__sun) && (defined(__i386) || defined(__amd64))
- __asm(
-" movl %ebx,%edi\n"
-" xorl %eax,%eax \n"
-" cpuid \n"
-" cmpl $1,%eax \n"
-" jl 1f \n"
-" xorl %eax,%eax \n"
-" incl %eax \n"
-" cpuid \n"
-#ifdef __i386
-" movl %edx,-8(%ebp) \n"
-#else
-" movl %edx,-8(%rbp) \n"
-#endif
-"1: \n"
-" movl %edi,%ebx\n" );
-#endif
- return features;
-}
-
-static __inline__ int CPU_getCPUIDFeaturesExt(void)
-{
- int features = 0;
-#if defined(__GNUC__) && (defined(i386) || defined (__x86_64__) )
- __asm__ (
-" movl %%ebx,%%edi\n"
-" movl $0x80000000,%%eax # Query for extended functions \n"
-" cpuid # Get extended function limit \n"
-" cmpl $0x80000001,%%eax \n"
-" jl 1f # Nope, we dont have function 800000001h\n"
-" movl $0x80000001,%%eax # Setup extended function 800000001h\n"
-" cpuid # and get the information \n"
-" movl %%edx,%0 \n"
-"1: \n"
-" movl %%edi,%%ebx\n"
- : "=m" (features)
- :
- : "%eax", "%ecx", "%edx", "%edi"
- );
-#elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
- __asm {
- mov eax,80000000h ; Query for extended functions
- cpuid ; Get extended function limit
- cmp eax,80000001h
- jl done ; Nope, we dont have function 800000001h
- mov eax,80000001h ; Setup extended function 800000001h
- cpuid ; and get the information
- mov features,edx
-done:
- }
-#elif defined(__sun) && ( defined(__i386) || defined(__amd64) )
- __asm (
-" movl %ebx,%edi\n"
-" movl $0x80000000,%eax \n"
-" cpuid \n"
-" cmpl $0x80000001,%eax \n"
-" jl 1f \n"
-" movl $0x80000001,%eax \n"
-" cpuid \n"
-#ifdef __i386
-" movl %edx,-8(%ebp) \n"
-#else
-" movl %edx,-8(%rbp) \n"
-#endif
-"1: \n"
-" movl %edi,%ebx\n"
- );
-#endif
- return features;
-}
-
-static __inline__ int CPU_haveRDTSC(void)
-{
- if ( CPU_haveCPUID() ) {
- return (CPU_getCPUIDFeatures() & 0x00000010);
- }
- return 0;
-}
-
-static __inline__ int CPU_haveMMX(void)
-{
- if ( CPU_haveCPUID() ) {
- return (CPU_getCPUIDFeatures() & 0x00800000);
- }
- return 0;
-}
-
-static __inline__ int CPU_haveMMXExt(void)
-{
- if ( CPU_haveCPUID() ) {
- return (CPU_getCPUIDFeaturesExt() & 0x00400000);
- }
- return 0;
-}
-
-static __inline__ int CPU_have3DNow(void)
-{
- if ( CPU_haveCPUID() ) {
- return (CPU_getCPUIDFeaturesExt() & 0x80000000);
- }
- return 0;
-}
-
-static __inline__ int CPU_have3DNowExt(void)
-{
- if ( CPU_haveCPUID() ) {
- return (CPU_getCPUIDFeaturesExt() & 0x40000000);
- }
- return 0;
-}
-
-static __inline__ int CPU_haveSSE(void)
-{
- if ( CPU_haveCPUID() ) {
- return (CPU_getCPUIDFeatures() & 0x02000000);
- }
- return 0;
-}
-
-static __inline__ int CPU_haveSSE2(void)
-{
- if ( CPU_haveCPUID() ) {
- return (CPU_getCPUIDFeatures() & 0x04000000);
- }
- return 0;
-}
-
-static __inline__ int CPU_haveAltiVec(void)
-{
- volatile int altivec = 0;
-#if defined(__MACOSX__) && defined(__ppc__)
- int selectors[2] = { CTL_HW, HW_VECTORUNIT };
- int hasVectorUnit = 0;
- size_t length = sizeof(hasVectorUnit);
- int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0);
- if( 0 == error )
- altivec = (hasVectorUnit != 0);
-#elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
- void (*handler)(int sig);
- handler = signal(SIGILL, illegal_instruction);
- if ( setjmp(jmpbuf) == 0 ) {
- asm volatile ("mtspr 256, %0\n\t"
- "vand %%v0, %%v0, %%v0"
- :
- : "r" (-1));
- altivec = 1;
- }
- signal(SIGILL, handler);
-#endif
- return altivec;
-}
-
-static Uint32 SDL_CPUFeatures = 0xFFFFFFFF;
-
-static Uint32 SDL_GetCPUFeatures(void)
-{
- if ( SDL_CPUFeatures == 0xFFFFFFFF ) {
- SDL_CPUFeatures = 0;
- if ( CPU_haveRDTSC() ) {
- SDL_CPUFeatures |= CPU_HAS_RDTSC;
- }
- if ( CPU_haveMMX() ) {
- SDL_CPUFeatures |= CPU_HAS_MMX;
- }
- if ( CPU_haveMMXExt() ) {
- SDL_CPUFeatures |= CPU_HAS_MMXEXT;
- }
- if ( CPU_have3DNow() ) {
- SDL_CPUFeatures |= CPU_HAS_3DNOW;
- }
- if ( CPU_have3DNowExt() ) {
- SDL_CPUFeatures |= CPU_HAS_3DNOWEXT;
- }
- if ( CPU_haveSSE() ) {
- SDL_CPUFeatures |= CPU_HAS_SSE;
- }
- if ( CPU_haveSSE2() ) {
- SDL_CPUFeatures |= CPU_HAS_SSE2;
- }
- if ( CPU_haveAltiVec() ) {
- SDL_CPUFeatures |= CPU_HAS_ALTIVEC;
- }
- }
- return SDL_CPUFeatures;
-}
-
-SDL_bool SDL_HasRDTSC(void)
-{
- if ( SDL_GetCPUFeatures() & CPU_HAS_RDTSC ) {
- return SDL_TRUE;
- }
- return SDL_FALSE;
-}
-
-SDL_bool SDL_HasMMX(void)
-{
- if ( SDL_GetCPUFeatures() & CPU_HAS_MMX ) {
- return SDL_TRUE;
- }
- return SDL_FALSE;
-}
-
-SDL_bool SDL_HasMMXExt(void)
-{
- if ( SDL_GetCPUFeatures() & CPU_HAS_MMXEXT ) {
- return SDL_TRUE;
- }
- return SDL_FALSE;
-}
-
-SDL_bool SDL_Has3DNow(void)
-{
- if ( SDL_GetCPUFeatures() & CPU_HAS_3DNOW ) {
- return SDL_TRUE;
- }
- return SDL_FALSE;
-}
-
-SDL_bool SDL_Has3DNowExt(void)
-{
- if ( SDL_GetCPUFeatures() & CPU_HAS_3DNOWEXT ) {
- return SDL_TRUE;
- }
- return SDL_FALSE;
-}
-
-SDL_bool SDL_HasSSE(void)
-{
- if ( SDL_GetCPUFeatures() & CPU_HAS_SSE ) {
- return SDL_TRUE;
- }
- return SDL_FALSE;
-}
-
-SDL_bool SDL_HasSSE2(void)
-{
- if ( SDL_GetCPUFeatures() & CPU_HAS_SSE2 ) {
- return SDL_TRUE;
- }
- return SDL_FALSE;
-}
-
-SDL_bool SDL_HasAltiVec(void)
-{
- if ( SDL_GetCPUFeatures() & CPU_HAS_ALTIVEC ) {
- return SDL_TRUE;
- }
- return SDL_FALSE;
-}
-
-#ifdef TEST_MAIN
-
-#include <stdio.h>
-
-int main()
-{
- printf("RDTSC: %d\n", SDL_HasRDTSC());
- printf("MMX: %d\n", SDL_HasMMX());
- printf("MMXExt: %d\n", SDL_HasMMXExt());
- printf("3DNow: %d\n", SDL_Has3DNow());
- printf("3DNowExt: %d\n", SDL_Has3DNowExt());
- printf("SSE: %d\n", SDL_HasSSE());
- printf("SSE2: %d\n", SDL_HasSSE2());
- printf("AltiVec: %d\n", SDL_HasAltiVec());
- return 0;
-}
-
-#endif /* TEST_MAIN */
diff --git a/distrib/sdl-1.2.12/src/events/SDL_active.c b/distrib/sdl-1.2.12/src/events/SDL_active.c
deleted file mode 100644
index 17b5908..0000000
--- a/distrib/sdl-1.2.12/src/events/SDL_active.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Application focus/iconification handling code for SDL */
-
-#include "SDL_events.h"
-#include "SDL_events_c.h"
-
-
-/* These are static for our active event handling code */
-static Uint8 SDL_appstate = 0;
-
-/* Public functions */
-int SDL_AppActiveInit(void)
-{
- /* Start completely active */
- SDL_appstate = (SDL_APPACTIVE|SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS);
-
- /* That's it! */
- return(0);
-}
-void SDL_AppActiveQuit(void)
-{
-}
-
-Uint8 SDL_GetAppState(void)
-{
- return(SDL_appstate);
-}
-
-/* This is global for SDL_eventloop.c */
-int SDL_PrivateAppActive(Uint8 gain, Uint8 state)
-{
- int posted;
- Uint8 new_state;
-
- /* Modify the current state with the given mask */
- if ( gain ) {
- new_state = (SDL_appstate | state);
- } else {
- new_state = (SDL_appstate & ~state);
- }
-
- /* Drop events that don't change state */
- if ( new_state == SDL_appstate ) {
- return(0);
- }
-
- /* Update internal active state */
- SDL_appstate = new_state;
-
- /* Post the event, if desired */
- posted = 0;
- if ( SDL_ProcessEvents[SDL_ACTIVEEVENT] == SDL_ENABLE ) {
- SDL_Event event;
- SDL_memset(&event, 0, sizeof(event));
- event.type = SDL_ACTIVEEVENT;
- event.active.gain = gain;
- event.active.state = state;
- if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
- posted = 1;
- SDL_PushEvent(&event);
- }
- }
-
- /* If we lost keyboard focus, post key-up events */
- if ( (state & SDL_APPINPUTFOCUS) && !gain ) {
- SDL_ResetKeyboard();
- }
- return(posted);
-}
diff --git a/distrib/sdl-1.2.12/src/events/SDL_events.c b/distrib/sdl-1.2.12/src/events/SDL_events.c
deleted file mode 100644
index e246fb7..0000000
--- a/distrib/sdl-1.2.12/src/events/SDL_events.c
+++ /dev/null
@@ -1,500 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* General event handling code for SDL */
-
-#include "SDL.h"
-#include "SDL_syswm.h"
-#include "SDL_sysevents.h"
-#include "SDL_events_c.h"
-#include "../timer/SDL_timer_c.h"
-#if !SDL_JOYSTICK_DISABLED
-#include "../joystick/SDL_joystick_c.h"
-#endif
-
-/* Public data -- the event filter */
-SDL_EventFilter SDL_EventOK = NULL;
-Uint8 SDL_ProcessEvents[SDL_NUMEVENTS];
-static Uint32 SDL_eventstate = 0;
-
-/* Private data -- event queue */
-#define MAXEVENTS 128
-static struct {
- SDL_mutex *lock;
- int active;
- int head;
- int tail;
- SDL_Event event[MAXEVENTS];
- int wmmsg_next;
- struct SDL_SysWMmsg wmmsg[MAXEVENTS];
-} SDL_EventQ;
-
-/* Private data -- event locking structure */
-static struct {
- SDL_mutex *lock;
- int safe;
-} SDL_EventLock;
-
-/* Thread functions */
-static SDL_Thread *SDL_EventThread = NULL; /* Thread handle */
-static Uint32 event_thread; /* The event thread id */
-
-void SDL_Lock_EventThread(void)
-{
- if ( SDL_EventThread && (SDL_ThreadID() != event_thread) ) {
- /* Grab lock and spin until we're sure event thread stopped */
- SDL_mutexP(SDL_EventLock.lock);
- while ( ! SDL_EventLock.safe ) {
- SDL_Delay(1);
- }
- }
-}
-void SDL_Unlock_EventThread(void)
-{
- if ( SDL_EventThread && (SDL_ThreadID() != event_thread) ) {
- SDL_mutexV(SDL_EventLock.lock);
- }
-}
-
-#ifdef __OS2__
-/*
- * We'll increase the priority of GobbleEvents thread, so it will process
- * events in time for sure! For this, we need the DosSetPriority() API
- * from the os2.h include file.
- */
-#define INCL_DOSPROCESS
-#include <os2.h>
-#include <time.h>
-#endif
-
-static int SDLCALL SDL_GobbleEvents(void *unused)
-{
- event_thread = SDL_ThreadID();
-
-#ifdef __OS2__
-#ifdef USE_DOSSETPRIORITY
- /* Increase thread priority, so it will process events in time for sure! */
- DosSetPriority(PRTYS_THREAD, PRTYC_REGULAR, +16, 0);
-#endif
-#endif
-
- while ( SDL_EventQ.active ) {
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
-
- /* Get events from the video subsystem */
- if ( video ) {
- video->PumpEvents(this);
- }
-
- /* Queue pending key-repeat events */
- SDL_CheckKeyRepeat();
-
-#if !SDL_JOYSTICK_DISABLED
- /* Check for joystick state change */
- if ( SDL_numjoysticks && (SDL_eventstate & SDL_JOYEVENTMASK) ) {
- SDL_JoystickUpdate();
- }
-#endif
-
- /* Give up the CPU for the rest of our timeslice */
- SDL_EventLock.safe = 1;
- if ( SDL_timer_running ) {
- SDL_ThreadedTimerCheck();
- }
- SDL_Delay(1);
-
- /* Check for event locking.
- On the P of the lock mutex, if the lock is held, this thread
- will wait until the lock is released before continuing. The
- safe flag will be set, meaning that the other thread can go
- about it's business. The safe flag is reset before the V,
- so as soon as the mutex is free, other threads can see that
- it's not safe to interfere with the event thread.
- */
- SDL_mutexP(SDL_EventLock.lock);
- SDL_EventLock.safe = 0;
- SDL_mutexV(SDL_EventLock.lock);
- }
- SDL_SetTimerThreaded(0);
- event_thread = 0;
- return(0);
-}
-
-static int SDL_StartEventThread(Uint32 flags)
-{
- /* Reset everything to zero */
- SDL_EventThread = NULL;
- SDL_memset(&SDL_EventLock, 0, sizeof(SDL_EventLock));
-
- /* Create the lock and set ourselves active */
-#if !SDL_THREADS_DISABLED
- SDL_EventQ.lock = SDL_CreateMutex();
- if ( SDL_EventQ.lock == NULL ) {
-#ifdef __MACOS__ /* MacOS classic you can't multithread, so no lock needed */
- ;
-#else
- return(-1);
-#endif
- }
-#endif /* !SDL_THREADS_DISABLED */
- SDL_EventQ.active = 1;
-
- if ( (flags&SDL_INIT_EVENTTHREAD) == SDL_INIT_EVENTTHREAD ) {
- SDL_EventLock.lock = SDL_CreateMutex();
- if ( SDL_EventLock.lock == NULL ) {
- return(-1);
- }
- SDL_EventLock.safe = 0;
-
- /* The event thread will handle timers too */
- SDL_SetTimerThreaded(2);
-#if (defined(__WIN32__) && !defined(_WIN32_WCE)) && !defined(HAVE_LIBC) && !defined(__SYMBIAN32__)
-#undef SDL_CreateThread
- SDL_EventThread = SDL_CreateThread(SDL_GobbleEvents, NULL, NULL, NULL);
-#else
- SDL_EventThread = SDL_CreateThread(SDL_GobbleEvents, NULL);
-#endif
- if ( SDL_EventThread == NULL ) {
- return(-1);
- }
- } else {
- event_thread = 0;
- }
- return(0);
-}
-
-static void SDL_StopEventThread(void)
-{
- SDL_EventQ.active = 0;
- if ( SDL_EventThread ) {
- SDL_WaitThread(SDL_EventThread, NULL);
- SDL_EventThread = NULL;
- SDL_DestroyMutex(SDL_EventLock.lock);
- }
-#ifndef IPOD
- SDL_DestroyMutex(SDL_EventQ.lock);
-#endif
-}
-
-Uint32 SDL_EventThreadID(void)
-{
- return(event_thread);
-}
-
-/* Public functions */
-
-void SDL_StopEventLoop(void)
-{
- /* Halt the event thread, if running */
- SDL_StopEventThread();
-
- /* Shutdown event handlers */
- SDL_AppActiveQuit();
- SDL_KeyboardQuit();
- SDL_MouseQuit();
- SDL_QuitQuit();
-
- /* Clean out EventQ */
- SDL_EventQ.head = 0;
- SDL_EventQ.tail = 0;
- SDL_EventQ.wmmsg_next = 0;
-}
-
-/* This function (and associated calls) may be called more than once */
-int SDL_StartEventLoop(Uint32 flags)
-{
- int retcode;
-
- /* Clean out the event queue */
- SDL_EventThread = NULL;
- SDL_EventQ.lock = NULL;
- SDL_StopEventLoop();
-
- /* No filter to start with, process most event types */
- SDL_EventOK = NULL;
- SDL_memset(SDL_ProcessEvents,SDL_ENABLE,sizeof(SDL_ProcessEvents));
- SDL_eventstate = ~0;
- /* It's not save to call SDL_EventState() yet */
- SDL_eventstate &= ~(0x00000001 << SDL_SYSWMEVENT);
- SDL_ProcessEvents[SDL_SYSWMEVENT] = SDL_IGNORE;
-
- /* Initialize event handlers */
- retcode = 0;
- retcode += SDL_AppActiveInit();
- retcode += SDL_KeyboardInit();
- retcode += SDL_MouseInit();
- retcode += SDL_QuitInit();
- if ( retcode < 0 ) {
- /* We don't expect them to fail, but... */
- return(-1);
- }
-
- /* Create the lock and event thread */
- if ( SDL_StartEventThread(flags) < 0 ) {
- SDL_StopEventLoop();
- return(-1);
- }
- return(0);
-}
-
-
-/* Add an event to the event queue -- called with the queue locked */
-static int SDL_AddEvent(SDL_Event *event)
-{
- int tail, added;
-
- tail = (SDL_EventQ.tail+1)%MAXEVENTS;
- if ( tail == SDL_EventQ.head ) {
- /* Overflow, drop event */
- added = 0;
- } else {
- SDL_EventQ.event[SDL_EventQ.tail] = *event;
- if (event->type == SDL_SYSWMEVENT) {
- /* Note that it's possible to lose an event */
- int next = SDL_EventQ.wmmsg_next;
- SDL_EventQ.wmmsg[next] = *event->syswm.msg;
- SDL_EventQ.event[SDL_EventQ.tail].syswm.msg =
- &SDL_EventQ.wmmsg[next];
- SDL_EventQ.wmmsg_next = (next+1)%MAXEVENTS;
- }
- SDL_EventQ.tail = tail;
- added = 1;
- }
- return(added);
-}
-
-/* Cut an event, and return the next valid spot, or the tail */
-/* -- called with the queue locked */
-static int SDL_CutEvent(int spot)
-{
- if ( spot == SDL_EventQ.head ) {
- SDL_EventQ.head = (SDL_EventQ.head+1)%MAXEVENTS;
- return(SDL_EventQ.head);
- } else
- if ( (spot+1)%MAXEVENTS == SDL_EventQ.tail ) {
- SDL_EventQ.tail = spot;
- return(SDL_EventQ.tail);
- } else
- /* We cut the middle -- shift everything over */
- {
- int here, next;
-
- /* This can probably be optimized with SDL_memcpy() -- careful! */
- if ( --SDL_EventQ.tail < 0 ) {
- SDL_EventQ.tail = MAXEVENTS-1;
- }
- for ( here=spot; here != SDL_EventQ.tail; here = next ) {
- next = (here+1)%MAXEVENTS;
- SDL_EventQ.event[here] = SDL_EventQ.event[next];
- }
- return(spot);
- }
- /* NOTREACHED */
-}
-
-/* Lock the event queue, take a peep at it, and unlock it */
-int SDL_PeepEvents(SDL_Event *events, int numevents, SDL_eventaction action,
- Uint32 mask)
-{
- int i, used;
-
- /* Don't look after we've quit */
- if ( ! SDL_EventQ.active ) {
- return(-1);
- }
- /* Lock the event queue */
- used = 0;
- if ( SDL_mutexP(SDL_EventQ.lock) == 0 ) {
- if ( action == SDL_ADDEVENT ) {
- for ( i=0; i<numevents; ++i ) {
- used += SDL_AddEvent(&events[i]);
- }
- } else {
- SDL_Event tmpevent;
- int spot;
-
- /* If 'events' is NULL, just see if they exist */
- if ( events == NULL ) {
- action = SDL_PEEKEVENT;
- numevents = 1;
- events = &tmpevent;
- }
- spot = SDL_EventQ.head;
- while ((used < numevents)&&(spot != SDL_EventQ.tail)) {
- if ( mask & SDL_EVENTMASK(SDL_EventQ.event[spot].type) ) {
- events[used++] = SDL_EventQ.event[spot];
- if ( action == SDL_GETEVENT ) {
- spot = SDL_CutEvent(spot);
- } else {
- spot = (spot+1)%MAXEVENTS;
- }
- } else {
- spot = (spot+1)%MAXEVENTS;
- }
- }
- }
- SDL_mutexV(SDL_EventQ.lock);
- } else {
- SDL_SetError("Couldn't lock event queue");
- used = -1;
- }
- return(used);
-}
-
-/* Run the system dependent event loops */
-void SDL_PumpEvents(void)
-{
- if ( !SDL_EventThread ) {
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
-
- /* Get events from the video subsystem */
- if ( video ) {
- video->PumpEvents(this);
- }
-
- /* Queue pending key-repeat events */
- SDL_CheckKeyRepeat();
-
-#if !SDL_JOYSTICK_DISABLED
- /* Check for joystick state change */
- if ( SDL_numjoysticks && (SDL_eventstate & SDL_JOYEVENTMASK) ) {
- SDL_JoystickUpdate();
- }
-#endif
- }
-}
-
-/* Public functions */
-
-int SDL_PollEvent (SDL_Event *event)
-{
- SDL_PumpEvents();
-
- /* We can't return -1, just return 0 (no event) on error */
- if ( SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS) <= 0 )
- return 0;
- return 1;
-}
-
-int SDL_WaitEvent (SDL_Event *event)
-{
- while ( 1 ) {
- SDL_PumpEvents();
- switch(SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS)) {
- case -1: return 0;
- case 1: return 1;
- case 0: SDL_Delay(10);
- }
- }
-}
-
-int SDL_PushEvent(SDL_Event *event)
-{
- if ( SDL_PeepEvents(event, 1, SDL_ADDEVENT, 0) <= 0 )
- return -1;
- return 0;
-}
-
-void SDL_SetEventFilter (SDL_EventFilter filter)
-{
- SDL_Event bitbucket;
-
- /* Set filter and discard pending events */
- SDL_EventOK = filter;
- while ( SDL_PollEvent(&bitbucket) > 0 )
- ;
-}
-
-SDL_EventFilter SDL_GetEventFilter(void)
-{
- return(SDL_EventOK);
-}
-
-Uint8 SDL_EventState (Uint8 type, int state)
-{
- SDL_Event bitbucket;
- Uint8 current_state;
-
- /* If SDL_ALLEVENTS was specified... */
- if ( type == 0xFF ) {
- current_state = SDL_IGNORE;
- for ( type=0; type<SDL_NUMEVENTS; ++type ) {
- if ( SDL_ProcessEvents[type] != SDL_IGNORE ) {
- current_state = SDL_ENABLE;
- }
- SDL_ProcessEvents[type] = state;
- if ( state == SDL_ENABLE ) {
- SDL_eventstate |= (0x00000001 << (type));
- } else {
- SDL_eventstate &= ~(0x00000001 << (type));
- }
- }
- while ( SDL_PollEvent(&bitbucket) > 0 )
- ;
- return(current_state);
- }
-
- /* Just set the state for one event type */
- current_state = SDL_ProcessEvents[type];
- switch (state) {
- case SDL_IGNORE:
- case SDL_ENABLE:
- /* Set state and discard pending events */
- SDL_ProcessEvents[type] = state;
- if ( state == SDL_ENABLE ) {
- SDL_eventstate |= (0x00000001 << (type));
- } else {
- SDL_eventstate &= ~(0x00000001 << (type));
- }
- while ( SDL_PollEvent(&bitbucket) > 0 )
- ;
- break;
- default:
- /* Querying state? */
- break;
- }
- return(current_state);
-}
-
-/* This is a generic event handler.
- */
-int SDL_PrivateSysWMEvent(SDL_SysWMmsg *message)
-{
- int posted;
-
- posted = 0;
- if ( SDL_ProcessEvents[SDL_SYSWMEVENT] == SDL_ENABLE ) {
- SDL_Event event;
- SDL_memset(&event, 0, sizeof(event));
- event.type = SDL_SYSWMEVENT;
- event.syswm.msg = message;
- if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
- posted = 1;
- SDL_PushEvent(&event);
- }
- }
- /* Update internal event state */
- return(posted);
-}
diff --git a/distrib/sdl-1.2.12/src/events/SDL_events_c.h b/distrib/sdl-1.2.12/src/events/SDL_events_c.h
deleted file mode 100644
index 6b5a38c..0000000
--- a/distrib/sdl-1.2.12/src/events/SDL_events_c.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Useful functions and variables from SDL_events.c */
-#include "SDL_events.h"
-
-/* Start and stop the event processing loop */
-extern int SDL_StartEventLoop(Uint32 flags);
-extern void SDL_StopEventLoop(void);
-extern void SDL_QuitInterrupt(void);
-
-extern void SDL_Lock_EventThread(void);
-extern void SDL_Unlock_EventThread(void);
-extern Uint32 SDL_EventThreadID(void);
-
-/* Event handler init routines */
-extern int SDL_AppActiveInit(void);
-extern int SDL_KeyboardInit(void);
-extern int SDL_MouseInit(void);
-extern int SDL_QuitInit(void);
-
-/* Event handler quit routines */
-extern void SDL_AppActiveQuit(void);
-extern void SDL_KeyboardQuit(void);
-extern void SDL_MouseQuit(void);
-extern void SDL_QuitQuit(void);
-
-/* The event filter function */
-extern SDL_EventFilter SDL_EventOK;
-
-/* The array of event processing states */
-extern Uint8 SDL_ProcessEvents[SDL_NUMEVENTS];
-
-/* Internal event queueing functions
- (from SDL_active.c, SDL_mouse.c, SDL_keyboard.c, SDL_quit.c, SDL_events.c)
- */
-extern int SDL_PrivateAppActive(Uint8 gain, Uint8 state);
-extern int SDL_PrivateMouseMotion(Uint8 buttonstate, int relative,
- Sint16 x, Sint16 y);
-extern int SDL_PrivateMouseButton(Uint8 state, Uint8 button,Sint16 x,Sint16 y);
-extern int SDL_PrivateKeyboard(Uint8 state, SDL_keysym *key);
-extern int SDL_PrivateResize(int w, int h);
-extern int SDL_PrivateExpose(void);
-extern int SDL_PrivateQuit(void);
-extern int SDL_PrivateSysWMEvent(SDL_SysWMmsg *message);
-
-/* Used by the activity event handler to remove mouse focus */
-extern void SDL_ResetMouse(void);
-
-/* Used by the activity event handler to remove keyboard focus */
-extern void SDL_ResetKeyboard(void);
-
-/* Used by the event loop to queue pending keyboard repeat events */
-extern void SDL_CheckKeyRepeat(void);
-
-/* Used by the OS keyboard code to detect whether or not to do UNICODE */
-#ifndef DEFAULT_UNICODE_TRANSLATION
-#define DEFAULT_UNICODE_TRANSLATION 0 /* Default off because of overhead */
-#endif
-extern int SDL_TranslateUNICODE;
diff --git a/distrib/sdl-1.2.12/src/events/SDL_expose.c b/distrib/sdl-1.2.12/src/events/SDL_expose.c
deleted file mode 100644
index d325ea1..0000000
--- a/distrib/sdl-1.2.12/src/events/SDL_expose.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Refresh event handling code for SDL */
-
-#include "SDL_events.h"
-#include "SDL_events_c.h"
-
-
-/* This is global for SDL_eventloop.c */
-int SDL_PrivateExpose(void)
-{
- int posted;
- SDL_Event events[32];
-
- /* Pull out all old refresh events */
- SDL_PeepEvents(events, sizeof(events)/sizeof(events[0]),
- SDL_GETEVENT, SDL_VIDEOEXPOSEMASK);
-
- /* Post the event, if desired */
- posted = 0;
- if ( SDL_ProcessEvents[SDL_VIDEOEXPOSE] == SDL_ENABLE ) {
- SDL_Event event;
- event.type = SDL_VIDEOEXPOSE;
- if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
- posted = 1;
- SDL_PushEvent(&event);
- }
- }
- return(posted);
-}
diff --git a/distrib/sdl-1.2.12/src/events/SDL_keyboard.c b/distrib/sdl-1.2.12/src/events/SDL_keyboard.c
deleted file mode 100644
index 5f7af42..0000000
--- a/distrib/sdl-1.2.12/src/events/SDL_keyboard.c
+++ /dev/null
@@ -1,578 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* General keyboard handling code for SDL */
-
-#include "SDL_timer.h"
-#include "SDL_events.h"
-#include "SDL_events_c.h"
-#include "SDL_sysevents.h"
-
-
-/* Global keystate information */
-static Uint8 SDL_KeyState[SDLK_LAST];
-static SDLMod SDL_ModState;
-int SDL_TranslateUNICODE = 0;
-
-static const char *keynames[SDLK_LAST]; /* Array of keycode names */
-
-/*
- * jk 991215 - added
- */
-struct {
- int firsttime; /* if we check against the delay or repeat value */
- int delay; /* the delay before we start repeating */
- int interval; /* the delay between key repeat events */
- Uint32 timestamp; /* the time the first keydown event occurred */
-
- SDL_Event evt; /* the event we are supposed to repeat */
-} SDL_KeyRepeat;
-
-/* Public functions */
-int SDL_KeyboardInit(void)
-{
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
-
- /* Set default mode of UNICODE translation */
- SDL_EnableUNICODE(DEFAULT_UNICODE_TRANSLATION);
-
- /* Initialize the tables */
- SDL_ModState = KMOD_NONE;
- SDL_memset((void*)keynames, 0, sizeof(keynames));
- SDL_memset(SDL_KeyState, 0, sizeof(SDL_KeyState));
- video->InitOSKeymap(this);
-
- SDL_EnableKeyRepeat(0, 0);
-
- /* Fill in the blanks in keynames */
- keynames[SDLK_BACKSPACE] = "backspace";
- keynames[SDLK_TAB] = "tab";
- keynames[SDLK_CLEAR] = "clear";
- keynames[SDLK_RETURN] = "return";
- keynames[SDLK_PAUSE] = "pause";
- keynames[SDLK_ESCAPE] = "escape";
- keynames[SDLK_SPACE] = "space";
- keynames[SDLK_EXCLAIM] = "!";
- keynames[SDLK_QUOTEDBL] = "\"";
- keynames[SDLK_HASH] = "#";
- keynames[SDLK_DOLLAR] = "$";
- keynames[SDLK_AMPERSAND] = "&";
- keynames[SDLK_QUOTE] = "'";
- keynames[SDLK_LEFTPAREN] = "(";
- keynames[SDLK_RIGHTPAREN] = ")";
- keynames[SDLK_ASTERISK] = "*";
- keynames[SDLK_PLUS] = "+";
- keynames[SDLK_COMMA] = ",";
- keynames[SDLK_MINUS] = "-";
- keynames[SDLK_PERIOD] = ".";
- keynames[SDLK_SLASH] = "/";
- keynames[SDLK_0] = "0";
- keynames[SDLK_1] = "1";
- keynames[SDLK_2] = "2";
- keynames[SDLK_3] = "3";
- keynames[SDLK_4] = "4";
- keynames[SDLK_5] = "5";
- keynames[SDLK_6] = "6";
- keynames[SDLK_7] = "7";
- keynames[SDLK_8] = "8";
- keynames[SDLK_9] = "9";
- keynames[SDLK_COLON] = ":";
- keynames[SDLK_SEMICOLON] = ";";
- keynames[SDLK_LESS] = "<";
- keynames[SDLK_EQUALS] = "=";
- keynames[SDLK_GREATER] = ">";
- keynames[SDLK_QUESTION] = "?";
- keynames[SDLK_AT] = "@";
- keynames[SDLK_LEFTBRACKET] = "[";
- keynames[SDLK_BACKSLASH] = "\\";
- keynames[SDLK_RIGHTBRACKET] = "]";
- keynames[SDLK_CARET] = "^";
- keynames[SDLK_UNDERSCORE] = "_";
- keynames[SDLK_BACKQUOTE] = "`";
- keynames[SDLK_a] = "a";
- keynames[SDLK_b] = "b";
- keynames[SDLK_c] = "c";
- keynames[SDLK_d] = "d";
- keynames[SDLK_e] = "e";
- keynames[SDLK_f] = "f";
- keynames[SDLK_g] = "g";
- keynames[SDLK_h] = "h";
- keynames[SDLK_i] = "i";
- keynames[SDLK_j] = "j";
- keynames[SDLK_k] = "k";
- keynames[SDLK_l] = "l";
- keynames[SDLK_m] = "m";
- keynames[SDLK_n] = "n";
- keynames[SDLK_o] = "o";
- keynames[SDLK_p] = "p";
- keynames[SDLK_q] = "q";
- keynames[SDLK_r] = "r";
- keynames[SDLK_s] = "s";
- keynames[SDLK_t] = "t";
- keynames[SDLK_u] = "u";
- keynames[SDLK_v] = "v";
- keynames[SDLK_w] = "w";
- keynames[SDLK_x] = "x";
- keynames[SDLK_y] = "y";
- keynames[SDLK_z] = "z";
- keynames[SDLK_DELETE] = "delete";
-
- keynames[SDLK_WORLD_0] = "world 0";
- keynames[SDLK_WORLD_1] = "world 1";
- keynames[SDLK_WORLD_2] = "world 2";
- keynames[SDLK_WORLD_3] = "world 3";
- keynames[SDLK_WORLD_4] = "world 4";
- keynames[SDLK_WORLD_5] = "world 5";
- keynames[SDLK_WORLD_6] = "world 6";
- keynames[SDLK_WORLD_7] = "world 7";
- keynames[SDLK_WORLD_8] = "world 8";
- keynames[SDLK_WORLD_9] = "world 9";
- keynames[SDLK_WORLD_10] = "world 10";
- keynames[SDLK_WORLD_11] = "world 11";
- keynames[SDLK_WORLD_12] = "world 12";
- keynames[SDLK_WORLD_13] = "world 13";
- keynames[SDLK_WORLD_14] = "world 14";
- keynames[SDLK_WORLD_15] = "world 15";
- keynames[SDLK_WORLD_16] = "world 16";
- keynames[SDLK_WORLD_17] = "world 17";
- keynames[SDLK_WORLD_18] = "world 18";
- keynames[SDLK_WORLD_19] = "world 19";
- keynames[SDLK_WORLD_20] = "world 20";
- keynames[SDLK_WORLD_21] = "world 21";
- keynames[SDLK_WORLD_22] = "world 22";
- keynames[SDLK_WORLD_23] = "world 23";
- keynames[SDLK_WORLD_24] = "world 24";
- keynames[SDLK_WORLD_25] = "world 25";
- keynames[SDLK_WORLD_26] = "world 26";
- keynames[SDLK_WORLD_27] = "world 27";
- keynames[SDLK_WORLD_28] = "world 28";
- keynames[SDLK_WORLD_29] = "world 29";
- keynames[SDLK_WORLD_30] = "world 30";
- keynames[SDLK_WORLD_31] = "world 31";
- keynames[SDLK_WORLD_32] = "world 32";
- keynames[SDLK_WORLD_33] = "world 33";
- keynames[SDLK_WORLD_34] = "world 34";
- keynames[SDLK_WORLD_35] = "world 35";
- keynames[SDLK_WORLD_36] = "world 36";
- keynames[SDLK_WORLD_37] = "world 37";
- keynames[SDLK_WORLD_38] = "world 38";
- keynames[SDLK_WORLD_39] = "world 39";
- keynames[SDLK_WORLD_40] = "world 40";
- keynames[SDLK_WORLD_41] = "world 41";
- keynames[SDLK_WORLD_42] = "world 42";
- keynames[SDLK_WORLD_43] = "world 43";
- keynames[SDLK_WORLD_44] = "world 44";
- keynames[SDLK_WORLD_45] = "world 45";
- keynames[SDLK_WORLD_46] = "world 46";
- keynames[SDLK_WORLD_47] = "world 47";
- keynames[SDLK_WORLD_48] = "world 48";
- keynames[SDLK_WORLD_49] = "world 49";
- keynames[SDLK_WORLD_50] = "world 50";
- keynames[SDLK_WORLD_51] = "world 51";
- keynames[SDLK_WORLD_52] = "world 52";
- keynames[SDLK_WORLD_53] = "world 53";
- keynames[SDLK_WORLD_54] = "world 54";
- keynames[SDLK_WORLD_55] = "world 55";
- keynames[SDLK_WORLD_56] = "world 56";
- keynames[SDLK_WORLD_57] = "world 57";
- keynames[SDLK_WORLD_58] = "world 58";
- keynames[SDLK_WORLD_59] = "world 59";
- keynames[SDLK_WORLD_60] = "world 60";
- keynames[SDLK_WORLD_61] = "world 61";
- keynames[SDLK_WORLD_62] = "world 62";
- keynames[SDLK_WORLD_63] = "world 63";
- keynames[SDLK_WORLD_64] = "world 64";
- keynames[SDLK_WORLD_65] = "world 65";
- keynames[SDLK_WORLD_66] = "world 66";
- keynames[SDLK_WORLD_67] = "world 67";
- keynames[SDLK_WORLD_68] = "world 68";
- keynames[SDLK_WORLD_69] = "world 69";
- keynames[SDLK_WORLD_70] = "world 70";
- keynames[SDLK_WORLD_71] = "world 71";
- keynames[SDLK_WORLD_72] = "world 72";
- keynames[SDLK_WORLD_73] = "world 73";
- keynames[SDLK_WORLD_74] = "world 74";
- keynames[SDLK_WORLD_75] = "world 75";
- keynames[SDLK_WORLD_76] = "world 76";
- keynames[SDLK_WORLD_77] = "world 77";
- keynames[SDLK_WORLD_78] = "world 78";
- keynames[SDLK_WORLD_79] = "world 79";
- keynames[SDLK_WORLD_80] = "world 80";
- keynames[SDLK_WORLD_81] = "world 81";
- keynames[SDLK_WORLD_82] = "world 82";
- keynames[SDLK_WORLD_83] = "world 83";
- keynames[SDLK_WORLD_84] = "world 84";
- keynames[SDLK_WORLD_85] = "world 85";
- keynames[SDLK_WORLD_86] = "world 86";
- keynames[SDLK_WORLD_87] = "world 87";
- keynames[SDLK_WORLD_88] = "world 88";
- keynames[SDLK_WORLD_89] = "world 89";
- keynames[SDLK_WORLD_90] = "world 90";
- keynames[SDLK_WORLD_91] = "world 91";
- keynames[SDLK_WORLD_92] = "world 92";
- keynames[SDLK_WORLD_93] = "world 93";
- keynames[SDLK_WORLD_94] = "world 94";
- keynames[SDLK_WORLD_95] = "world 95";
-
- keynames[SDLK_KP0] = "[0]";
- keynames[SDLK_KP1] = "[1]";
- keynames[SDLK_KP2] = "[2]";
- keynames[SDLK_KP3] = "[3]";
- keynames[SDLK_KP4] = "[4]";
- keynames[SDLK_KP5] = "[5]";
- keynames[SDLK_KP6] = "[6]";
- keynames[SDLK_KP7] = "[7]";
- keynames[SDLK_KP8] = "[8]";
- keynames[SDLK_KP9] = "[9]";
- keynames[SDLK_KP_PERIOD] = "[.]";
- keynames[SDLK_KP_DIVIDE] = "[/]";
- keynames[SDLK_KP_MULTIPLY] = "[*]";
- keynames[SDLK_KP_MINUS] = "[-]";
- keynames[SDLK_KP_PLUS] = "[+]";
- keynames[SDLK_KP_ENTER] = "enter";
- keynames[SDLK_KP_EQUALS] = "equals";
-
- keynames[SDLK_UP] = "up";
- keynames[SDLK_DOWN] = "down";
- keynames[SDLK_RIGHT] = "right";
- keynames[SDLK_LEFT] = "left";
- keynames[SDLK_DOWN] = "down";
- keynames[SDLK_INSERT] = "insert";
- keynames[SDLK_HOME] = "home";
- keynames[SDLK_END] = "end";
- keynames[SDLK_PAGEUP] = "page up";
- keynames[SDLK_PAGEDOWN] = "page down";
-
- keynames[SDLK_F1] = "f1";
- keynames[SDLK_F2] = "f2";
- keynames[SDLK_F3] = "f3";
- keynames[SDLK_F4] = "f4";
- keynames[SDLK_F5] = "f5";
- keynames[SDLK_F6] = "f6";
- keynames[SDLK_F7] = "f7";
- keynames[SDLK_F8] = "f8";
- keynames[SDLK_F9] = "f9";
- keynames[SDLK_F10] = "f10";
- keynames[SDLK_F11] = "f11";
- keynames[SDLK_F12] = "f12";
- keynames[SDLK_F13] = "f13";
- keynames[SDLK_F14] = "f14";
- keynames[SDLK_F15] = "f15";
-
- keynames[SDLK_NUMLOCK] = "numlock";
- keynames[SDLK_CAPSLOCK] = "caps lock";
- keynames[SDLK_SCROLLOCK] = "scroll lock";
- keynames[SDLK_RSHIFT] = "right shift";
- keynames[SDLK_LSHIFT] = "left shift";
- keynames[SDLK_RCTRL] = "right ctrl";
- keynames[SDLK_LCTRL] = "left ctrl";
- keynames[SDLK_RALT] = "right alt";
- keynames[SDLK_LALT] = "left alt";
- keynames[SDLK_RMETA] = "right meta";
- keynames[SDLK_LMETA] = "left meta";
- keynames[SDLK_LSUPER] = "left super"; /* "Windows" keys */
- keynames[SDLK_RSUPER] = "right super";
- keynames[SDLK_MODE] = "alt gr";
- keynames[SDLK_COMPOSE] = "compose";
-
- keynames[SDLK_HELP] = "help";
- keynames[SDLK_PRINT] = "print screen";
- keynames[SDLK_SYSREQ] = "sys req";
- keynames[SDLK_BREAK] = "break";
- keynames[SDLK_MENU] = "menu";
- keynames[SDLK_POWER] = "power";
- keynames[SDLK_EURO] = "euro";
- keynames[SDLK_UNDO] = "undo";
-
- /* Done. Whew. */
- return(0);
-}
-void SDL_KeyboardQuit(void)
-{
-}
-
-/* We lost the keyboard, so post key up messages for all pressed keys */
-void SDL_ResetKeyboard(void)
-{
- SDL_keysym keysym;
- SDLKey key;
-
- SDL_memset(&keysym, 0, (sizeof keysym));
- for ( key=SDLK_FIRST; key<SDLK_LAST; ++key ) {
- if ( SDL_KeyState[key] == SDL_PRESSED ) {
- keysym.sym = key;
- SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
- }
- }
- SDL_KeyRepeat.timestamp = 0;
-}
-
-int SDL_EnableUNICODE(int enable)
-{
- int old_mode;
-
- old_mode = SDL_TranslateUNICODE;
- if ( enable >= 0 ) {
- SDL_TranslateUNICODE = enable;
- }
- return(old_mode);
-}
-
-Uint8 * SDL_GetKeyState (int *numkeys)
-{
- if ( numkeys != (int *)0 )
- *numkeys = SDLK_LAST;
- return(SDL_KeyState);
-}
-SDLMod SDL_GetModState (void)
-{
- return(SDL_ModState);
-}
-void SDL_SetModState (SDLMod modstate)
-{
- SDL_ModState = modstate;
-}
-
-char *SDL_GetKeyName(SDLKey key)
-{
- const char *keyname;
-
- keyname = NULL;
- if ( key < SDLK_LAST ) {
- keyname = keynames[key];
- }
- if ( keyname == NULL ) {
- keyname = "unknown key";
- }
- /* FIXME: make this function const in 1.3 */
- return (char *)(keyname);
-}
-
-/* These are global for SDL_eventloop.c */
-int SDL_PrivateKeyboard(Uint8 state, SDL_keysym *keysym)
-{
- SDL_Event event;
- int posted, repeatable;
- Uint16 modstate;
-
- SDL_memset(&event, 0, sizeof(event));
-
-#if 0
-printf("The '%s' key has been %s\n", SDL_GetKeyName(keysym->sym),
- state == SDL_PRESSED ? "pressed" : "released");
-#endif
- /* Set up the keysym */
- modstate = (Uint16)SDL_ModState;
-
- repeatable = 0;
-
- if ( state == SDL_PRESSED ) {
- keysym->mod = (SDLMod)modstate;
- switch (keysym->sym) {
- case SDLK_UNKNOWN:
- break;
- case SDLK_NUMLOCK:
- modstate ^= KMOD_NUM;
- if ( ! (modstate&KMOD_NUM) )
- state = SDL_RELEASED;
- keysym->mod = (SDLMod)modstate;
- break;
- case SDLK_CAPSLOCK:
- modstate ^= KMOD_CAPS;
- if ( ! (modstate&KMOD_CAPS) )
- state = SDL_RELEASED;
- keysym->mod = (SDLMod)modstate;
- break;
- case SDLK_LCTRL:
- modstate |= KMOD_LCTRL;
- break;
- case SDLK_RCTRL:
- modstate |= KMOD_RCTRL;
- break;
- case SDLK_LSHIFT:
- modstate |= KMOD_LSHIFT;
- break;
- case SDLK_RSHIFT:
- modstate |= KMOD_RSHIFT;
- break;
- case SDLK_LALT:
- modstate |= KMOD_LALT;
- break;
- case SDLK_RALT:
- modstate |= KMOD_RALT;
- break;
- case SDLK_LMETA:
- modstate |= KMOD_LMETA;
- break;
- case SDLK_RMETA:
- modstate |= KMOD_RMETA;
- break;
- case SDLK_MODE:
- modstate |= KMOD_MODE;
- break;
- default:
- repeatable = 1;
- break;
- }
- } else {
- switch (keysym->sym) {
- case SDLK_UNKNOWN:
- break;
- case SDLK_NUMLOCK:
- case SDLK_CAPSLOCK:
- /* Only send keydown events */
- return(0);
- case SDLK_LCTRL:
- modstate &= ~KMOD_LCTRL;
- break;
- case SDLK_RCTRL:
- modstate &= ~KMOD_RCTRL;
- break;
- case SDLK_LSHIFT:
- modstate &= ~KMOD_LSHIFT;
- break;
- case SDLK_RSHIFT:
- modstate &= ~KMOD_RSHIFT;
- break;
- case SDLK_LALT:
- modstate &= ~KMOD_LALT;
- break;
- case SDLK_RALT:
- modstate &= ~KMOD_RALT;
- break;
- case SDLK_LMETA:
- modstate &= ~KMOD_LMETA;
- break;
- case SDLK_RMETA:
- modstate &= ~KMOD_RMETA;
- break;
- case SDLK_MODE:
- modstate &= ~KMOD_MODE;
- break;
- default:
- break;
- }
- keysym->mod = (SDLMod)modstate;
- }
-
- /* Figure out what type of event this is */
- switch (state) {
- case SDL_PRESSED:
- event.type = SDL_KEYDOWN;
- break;
- case SDL_RELEASED:
- event.type = SDL_KEYUP;
- /*
- * jk 991215 - Added
- */
- if ( SDL_KeyRepeat.timestamp &&
- SDL_KeyRepeat.evt.key.keysym.sym == keysym->sym ) {
- SDL_KeyRepeat.timestamp = 0;
- }
- break;
- default:
- /* Invalid state -- bail */
- return(0);
- }
-
- if ( keysym->sym != SDLK_UNKNOWN ) {
- /* Drop events that don't change state */
- if ( SDL_KeyState[keysym->sym] == state ) {
-#if 0
-printf("Keyboard event didn't change state - dropped!\n");
-#endif
- return(0);
- }
-
- /* Update internal keyboard state */
- SDL_ModState = (SDLMod)modstate;
- SDL_KeyState[keysym->sym] = state;
- }
-
- /* Post the event, if desired */
- posted = 0;
- if ( SDL_ProcessEvents[event.type] == SDL_ENABLE ) {
- event.key.state = state;
- event.key.keysym = *keysym;
- /*
- * jk 991215 - Added
- */
- if (repeatable && (SDL_KeyRepeat.delay != 0)) {
- SDL_KeyRepeat.evt = event;
- SDL_KeyRepeat.firsttime = 1;
- SDL_KeyRepeat.timestamp=SDL_GetTicks();
- }
- if ( (SDL_EventOK == NULL) || SDL_EventOK(&event) ) {
- posted = 1;
- SDL_PushEvent(&event);
- }
- }
- return(posted);
-}
-
-/*
- * jk 991215 - Added
- */
-void SDL_CheckKeyRepeat(void)
-{
- if ( SDL_KeyRepeat.timestamp ) {
- Uint32 now, interval;
-
- now = SDL_GetTicks();
- interval = (now - SDL_KeyRepeat.timestamp);
- if ( SDL_KeyRepeat.firsttime ) {
- if ( interval > (Uint32)SDL_KeyRepeat.delay ) {
- SDL_KeyRepeat.timestamp = now;
- SDL_KeyRepeat.firsttime = 0;
- }
- } else {
- if ( interval > (Uint32)SDL_KeyRepeat.interval ) {
- SDL_KeyRepeat.timestamp = now;
- if ( (SDL_EventOK == NULL) || SDL_EventOK(&SDL_KeyRepeat.evt) ) {
- SDL_PushEvent(&SDL_KeyRepeat.evt);
- }
- }
- }
- }
-}
-
-int SDL_EnableKeyRepeat(int delay, int interval)
-{
- if ( (delay < 0) || (interval < 0) ) {
- SDL_SetError("keyboard repeat value less than zero");
- return(-1);
- }
- SDL_KeyRepeat.firsttime = 0;
- SDL_KeyRepeat.delay = delay;
- SDL_KeyRepeat.interval = interval;
- SDL_KeyRepeat.timestamp = 0;
- return(0);
-}
-
-void SDL_GetKeyRepeat(int *delay, int *interval)
-{
- *delay = SDL_KeyRepeat.delay;
- *interval = SDL_KeyRepeat.interval;
-}
-
diff --git a/distrib/sdl-1.2.12/src/events/SDL_mouse.c b/distrib/sdl-1.2.12/src/events/SDL_mouse.c
deleted file mode 100644
index f72ef3c..0000000
--- a/distrib/sdl-1.2.12/src/events/SDL_mouse.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* General mouse handling code for SDL */
-
-#include "SDL_events.h"
-#include "SDL_events_c.h"
-#include "../video/SDL_cursor_c.h"
-#include "../video/SDL_sysvideo.h"
-
-
-/* These are static for our mouse handling code */
-static Sint16 SDL_MouseX = 0;
-static Sint16 SDL_MouseY = 0;
-static Sint16 SDL_DeltaX = 0;
-static Sint16 SDL_DeltaY = 0;
-static Uint8 SDL_ButtonState = 0;
-
-
-/* Public functions */
-int SDL_MouseInit(void)
-{
- /* The mouse is at (0,0) */
- SDL_MouseX = 0;
- SDL_MouseY = 0;
- SDL_DeltaX = 0;
- SDL_DeltaY = 0;
- SDL_ButtonState = 0;
-
- /* That's it! */
- return(0);
-}
-void SDL_MouseQuit(void)
-{
-}
-
-/* We lost the mouse, so post button up messages for all pressed buttons */
-void SDL_ResetMouse(void)
-{
- Uint8 i;
- for ( i = 0; i < sizeof(SDL_ButtonState)*8; ++i ) {
- if ( SDL_ButtonState & SDL_BUTTON(i) ) {
- SDL_PrivateMouseButton(SDL_RELEASED, i, 0, 0);
- }
- }
-}
-
-Uint8 SDL_GetMouseState (int *x, int *y)
-{
- if ( x ) {
- *x = SDL_MouseX;
- }
- if ( y ) {
- *y = SDL_MouseY;
- }
- return(SDL_ButtonState);
-}
-
-Uint8 SDL_GetRelativeMouseState (int *x, int *y)
-{
- if ( x )
- *x = SDL_DeltaX;
- if ( y )
- *y = SDL_DeltaY;
- SDL_DeltaX = 0;
- SDL_DeltaY = 0;
- return(SDL_ButtonState);
-}
-
-static void ClipOffset(Sint16 *x, Sint16 *y)
-{
- /* This clips absolute mouse coordinates when the apparent
- display surface is smaller than the real display surface.
- */
- if ( SDL_VideoSurface->offset ) {
- *y -= SDL_VideoSurface->offset/SDL_VideoSurface->pitch;
- *x -= (SDL_VideoSurface->offset%SDL_VideoSurface->pitch)/
- SDL_VideoSurface->format->BytesPerPixel;
- }
-}
-
-/* These are global for SDL_eventloop.c */
-int SDL_PrivateMouseMotion(Uint8 buttonstate, int relative, Sint16 x, Sint16 y)
-{
- int posted;
- Uint16 X, Y;
- Sint16 Xrel;
- Sint16 Yrel;
-
- /* Don't handle mouse motion if there's no cursor surface */
- if ( SDL_VideoSurface == NULL ) {
- return(0);
- }
-
- /* Default buttonstate is the current one */
- if ( ! buttonstate ) {
- buttonstate = SDL_ButtonState;
- }
-
- Xrel = x;
- Yrel = y;
- if ( relative ) {
- /* Push the cursor around */
- x = (SDL_MouseX+x);
- y = (SDL_MouseY+y);
- } else {
- /* Do we need to clip {x,y} ? */
- ClipOffset(&x, &y);
- }
-
- /* Mouse coordinates range from 0 - width-1 and 0 - height-1 */
- if ( x < 0 )
- X = 0;
- else
- if ( x >= SDL_VideoSurface->w )
- X = SDL_VideoSurface->w-1;
- else
- X = (Uint16)x;
-
- if ( y < 0 )
- Y = 0;
- else
- if ( y >= SDL_VideoSurface->h )
- Y = SDL_VideoSurface->h-1;
- else
- Y = (Uint16)y;
-
- /* If not relative mode, generate relative motion from clamped X/Y.
- This prevents lots of extraneous large delta relative motion when
- the screen is windowed mode and the mouse is outside the window.
- */
- if ( ! relative ) {
- Xrel = X-SDL_MouseX;
- Yrel = Y-SDL_MouseY;
- }
-
- /* Drop events that don't change state */
- if ( ! Xrel && ! Yrel ) {
-#if 0
-printf("Mouse event didn't change state - dropped!\n");
-#endif
- return(0);
- }
-
- /* Update internal mouse state */
- SDL_ButtonState = buttonstate;
- SDL_MouseX = X;
- SDL_MouseY = Y;
- SDL_DeltaX += Xrel;
- SDL_DeltaY += Yrel;
- SDL_MoveCursor(SDL_MouseX, SDL_MouseY);
-
- /* Post the event, if desired */
- posted = 0;
- if ( SDL_ProcessEvents[SDL_MOUSEMOTION] == SDL_ENABLE ) {
- SDL_Event event;
- SDL_memset(&event, 0, sizeof(event));
- event.type = SDL_MOUSEMOTION;
- event.motion.state = buttonstate;
- event.motion.x = X;
- event.motion.y = Y;
- event.motion.xrel = Xrel;
- event.motion.yrel = Yrel;
- if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
- posted = 1;
- SDL_PushEvent(&event);
- }
- }
- return(posted);
-}
-
-int SDL_PrivateMouseButton(Uint8 state, Uint8 button, Sint16 x, Sint16 y)
-{
- SDL_Event event;
- int posted;
- int move_mouse;
- Uint8 buttonstate;
-
- SDL_memset(&event, 0, sizeof(event));
-
- /* Check parameters */
- if ( x || y ) {
- ClipOffset(&x, &y);
- move_mouse = 1;
- /* Mouse coordinates range from 0 - width-1 and 0 - height-1 */
- if ( x < 0 )
- x = 0;
- else
- if ( x >= SDL_VideoSurface->w )
- x = SDL_VideoSurface->w-1;
-
- if ( y < 0 )
- y = 0;
- else
- if ( y >= SDL_VideoSurface->h )
- y = SDL_VideoSurface->h-1;
- } else {
- move_mouse = 0;
- }
- if ( ! x )
- x = SDL_MouseX;
- if ( ! y )
- y = SDL_MouseY;
-
- /* Figure out which event to perform */
- buttonstate = SDL_ButtonState;
- switch ( state ) {
- case SDL_PRESSED:
- event.type = SDL_MOUSEBUTTONDOWN;
- buttonstate |= SDL_BUTTON(button);
- break;
- case SDL_RELEASED:
- event.type = SDL_MOUSEBUTTONUP;
- buttonstate &= ~SDL_BUTTON(button);
- break;
- default:
- /* Invalid state -- bail */
- return(0);
- }
-
- /* Update internal mouse state */
- SDL_ButtonState = buttonstate;
- if ( move_mouse ) {
- SDL_MouseX = x;
- SDL_MouseY = y;
- SDL_MoveCursor(SDL_MouseX, SDL_MouseY);
- }
-
- /* Post the event, if desired */
- posted = 0;
- if ( SDL_ProcessEvents[event.type] == SDL_ENABLE ) {
- event.button.state = state;
- event.button.button = button;
- event.button.x = x;
- event.button.y = y;
- if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
- posted = 1;
- SDL_PushEvent(&event);
- }
- }
- return(posted);
-}
-
diff --git a/distrib/sdl-1.2.12/src/events/SDL_quit.c b/distrib/sdl-1.2.12/src/events/SDL_quit.c
deleted file mode 100644
index 591f327..0000000
--- a/distrib/sdl-1.2.12/src/events/SDL_quit.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* General quit handling code for SDL */
-
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-
-#include "SDL_events.h"
-#include "SDL_events_c.h"
-
-
-#ifdef HAVE_SIGNAL_H
-static void SDL_HandleSIG(int sig)
-{
- /* Reset the signal handler */
- signal(sig, SDL_HandleSIG);
-
- /* Signal a quit interrupt */
- SDL_PrivateQuit();
-}
-#endif /* HAVE_SIGNAL_H */
-
-/* Public functions */
-int SDL_QuitInit(void)
-{
-#ifdef HAVE_SIGNAL_H
- void (*ohandler)(int);
-
- /* Both SIGINT and SIGTERM are translated into quit interrupts */
- ohandler = signal(SIGINT, SDL_HandleSIG);
- if ( ohandler != SIG_DFL )
- signal(SIGINT, ohandler);
- ohandler = signal(SIGTERM, SDL_HandleSIG);
- if ( ohandler != SIG_DFL )
- signal(SIGTERM, ohandler);
-#endif /* HAVE_SIGNAL_H */
-
- /* That's it! */
- return(0);
-}
-void SDL_QuitQuit(void)
-{
-#ifdef HAVE_SIGNAL_H
- void (*ohandler)(int);
-
- ohandler = signal(SIGINT, SIG_DFL);
- if ( ohandler != SDL_HandleSIG )
- signal(SIGINT, ohandler);
- ohandler = signal(SIGTERM, SIG_DFL);
- if ( ohandler != SDL_HandleSIG )
- signal(SIGTERM, ohandler);
-#endif /* HAVE_SIGNAL_H */
-}
-
-/* This function returns 1 if it's okay to close the application window */
-int SDL_PrivateQuit(void)
-{
- int posted;
-
- posted = 0;
- if ( SDL_ProcessEvents[SDL_QUIT] == SDL_ENABLE ) {
- SDL_Event event;
- event.type = SDL_QUIT;
- if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
- posted = 1;
- SDL_PushEvent(&event);
- }
- }
- return(posted);
-}
diff --git a/distrib/sdl-1.2.12/src/events/SDL_resize.c b/distrib/sdl-1.2.12/src/events/SDL_resize.c
deleted file mode 100644
index f625f70..0000000
--- a/distrib/sdl-1.2.12/src/events/SDL_resize.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Resize event handling code for SDL */
-
-#include "SDL_events.h"
-#include "SDL_events_c.h"
-#include "../video/SDL_sysvideo.h"
-
-
-/* Keep the last resize event so we don't post duplicates */
-static struct {
- int w;
- int h;
-} last_resize;
-
-/* This is global for SDL_eventloop.c */
-int SDL_PrivateResize(int w, int h)
-{
- int posted;
- SDL_Event events[32];
-
- /* See if this event would change the video surface */
- if ( !w || !h
-#ifndef __OS2__
- || ((last_resize.w == w) && (last_resize.h == h))
-#endif
- ) {
- return(0);
- }
- last_resize.w = w;
- last_resize.h = h;
- if ( ! SDL_VideoSurface ||
- ((w == SDL_VideoSurface->w) && (h == SDL_VideoSurface->h)) ) {
- return(0);
- }
-
- /* Pull out all old resize events */
- SDL_PeepEvents(events, sizeof(events)/sizeof(events[0]),
- SDL_GETEVENT, SDL_VIDEORESIZEMASK);
-
- /* Post the event, if desired */
- posted = 0;
- if ( SDL_ProcessEvents[SDL_VIDEORESIZE] == SDL_ENABLE ) {
- SDL_Event event;
- event.type = SDL_VIDEORESIZE;
- event.resize.w = w;
- event.resize.h = h;
- if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
- posted = 1;
- SDL_PushEvent(&event);
- }
- }
- return(posted);
-}
diff --git a/distrib/sdl-1.2.12/src/events/SDL_sysevents.h b/distrib/sdl-1.2.12/src/events/SDL_sysevents.h
deleted file mode 100644
index 07d55b4..0000000
--- a/distrib/sdl-1.2.12/src/events/SDL_sysevents.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is SDL_free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "../video/SDL_sysvideo.h"
-
-/* Useful functions and variables from SDL_sysevents.c */
-
-#ifdef __BEOS__ /* The Be event loop runs in a separate thread */
-#define MUST_THREAD_EVENTS
-#endif
-
-#ifdef __WIN32__ /* Win32 doesn't allow a separate event thread */
-#define CANT_THREAD_EVENTS
-#endif
-
-#ifdef IPOD /* iPod doesn't support threading at all */
-#define CANT_THREAD_EVENTS
-#endif
-
-#ifdef __MACOS__ /* MacOS 7/8 don't support preemptive multi-tasking */
-#define CANT_THREAD_EVENTS
-#endif
-
-#ifdef __OS2__ /* The OS/2 event loop runs in a separate thread */
-#define MUST_THREAD_EVENTS
-#endif
diff --git a/distrib/sdl-1.2.12/src/file/SDL_rwops.c b/distrib/sdl-1.2.12/src/file/SDL_rwops.c
deleted file mode 100644
index e463bf1..0000000
--- a/distrib/sdl-1.2.12/src/file/SDL_rwops.c
+++ /dev/null
@@ -1,612 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This 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"
-
-
-#if defined(__WIN32__) && !defined(__SYMBIAN32__)
-
-/* Functions to read/write Win32 API file pointers */
-/* Will not use it on WinCE because stdio is buffered, it means
- faster, and all stdio functions anyway are embedded in coredll.dll -
- the main wince dll*/
-
-#define WINDOWS_LEAN_AND_MEAN
-#include <windows.h>
-
-#ifndef INVALID_SET_FILE_POINTER
-#define INVALID_SET_FILE_POINTER 0xFFFFFFFF
-#endif
-
-#define READAHEAD_BUFFER_SIZE 1024
-
-static int SDLCALL win32_file_open(SDL_RWops *context, const char *filename, const char *mode)
-{
-#ifndef _WIN32_WCE
- UINT old_error_mode;
-#endif
- HANDLE h;
- DWORD r_right, w_right;
- DWORD must_exist, truncate;
- int a_mode;
-
- if (!context)
- return -1; /* failed (invalid call) */
-
- context->hidden.win32io.h = INVALID_HANDLE_VALUE; /* mark this as unusable */
- context->hidden.win32io.buffer.data = NULL;
- context->hidden.win32io.buffer.size = 0;
- context->hidden.win32io.buffer.left = 0;
-
- /* "r" = reading, file must exist */
- /* "w" = writing, truncate existing, file may not exist */
- /* "r+"= reading or writing, file must exist */
- /* "a" = writing, append file may not exist */
- /* "a+"= append + read, file may not exist */
- /* "w+" = read, write, truncate. file may not exist */
-
- must_exist = ( SDL_strchr(mode,'r') != NULL ) ? OPEN_EXISTING : 0;
- truncate = ( SDL_strchr(mode,'w') != NULL ) ? CREATE_ALWAYS : 0;
- r_right = ( SDL_strchr(mode,'+') != NULL || must_exist ) ? GENERIC_READ : 0;
- a_mode = ( SDL_strchr(mode,'a') != NULL ) ? OPEN_ALWAYS : 0;
- w_right = ( a_mode || SDL_strchr(mode,'+') || truncate ) ? GENERIC_WRITE : 0;
-
- if (!r_right && !w_right) /* inconsistent mode */
- return -1; /* failed (invalid call) */
-
- context->hidden.win32io.buffer.data = (char *)SDL_malloc(READAHEAD_BUFFER_SIZE);
- if (!context->hidden.win32io.buffer.data) {
- SDL_OutOfMemory();
- return -1;
- }
-
-#ifdef _WIN32_WCE
- {
- size_t size = SDL_strlen(filename)+1;
- wchar_t *filenameW = SDL_stack_alloc(wchar_t, size);
-
- if ( MultiByteToWideChar(CP_UTF8, 0, filename, -1, filenameW, size) == 0 ) {
- SDL_stack_free(filenameW);
- SDL_free(context->hidden.win32io.buffer.data);
- context->hidden.win32io.buffer.data = NULL;
- SDL_SetError("Unable to convert filename to Unicode");
- return -1;
- }
- h = CreateFile(filenameW, (w_right|r_right), (w_right)? 0 : FILE_SHARE_READ,
- NULL, (must_exist|truncate|a_mode), FILE_ATTRIBUTE_NORMAL,NULL);
- SDL_stack_free(filenameW);
- }
-#else
- /* Do not open a dialog box if failure */
- old_error_mode = SetErrorMode(SEM_NOOPENFILEERRORBOX|SEM_FAILCRITICALERRORS);
-
- h = CreateFile(filename, (w_right|r_right), (w_right)? 0 : FILE_SHARE_READ,
- NULL, (must_exist|truncate|a_mode), FILE_ATTRIBUTE_NORMAL,NULL);
-
- /* restore old behaviour */
- SetErrorMode(old_error_mode);
-#endif /* _WIN32_WCE */
-
- if (h==INVALID_HANDLE_VALUE) {
- SDL_free(context->hidden.win32io.buffer.data);
- context->hidden.win32io.buffer.data = NULL;
- SDL_SetError("Couldn't open %s",filename);
- return -2; /* failed (CreateFile) */
- }
- context->hidden.win32io.h = h;
- context->hidden.win32io.append = a_mode;
-
- return 0; /* ok */
-}
-static int SDLCALL win32_file_seek(SDL_RWops *context, int offset, int whence)
-{
- DWORD win32whence;
- int file_pos;
-
- if (!context || context->hidden.win32io.h == INVALID_HANDLE_VALUE) {
- SDL_SetError("win32_file_seek: invalid context/file not opened");
- return -1;
- }
-
- /* FIXME: We may be able to satisfy the seek within buffered data */
- if (whence == RW_SEEK_CUR && context->hidden.win32io.buffer.left) {
- offset -= context->hidden.win32io.buffer.left;
- }
- context->hidden.win32io.buffer.left = 0;
-
- switch (whence) {
- case RW_SEEK_SET:
- win32whence = FILE_BEGIN; break;
- case RW_SEEK_CUR:
- win32whence = FILE_CURRENT; break;
- case RW_SEEK_END:
- win32whence = FILE_END; break;
- default:
- SDL_SetError("win32_file_seek: Unknown value for 'whence'");
- return -1;
- }
-
- file_pos = SetFilePointer(context->hidden.win32io.h,offset,NULL,win32whence);
-
- if ( file_pos != INVALID_SET_FILE_POINTER )
- return file_pos; /* success */
-
- SDL_Error(SDL_EFSEEK);
- return -1; /* error */
-}
-static int SDLCALL win32_file_read(SDL_RWops *context, void *ptr, int size, int maxnum)
-{
- int total_need;
- int total_read = 0;
- int read_ahead;
- DWORD byte_read;
-
- total_need = size*maxnum;
-
- if (!context || context->hidden.win32io.h == INVALID_HANDLE_VALUE || total_need<=0 || !size)
- return 0;
-
- if (context->hidden.win32io.buffer.left > 0) {
- void *data = (char *)context->hidden.win32io.buffer.data +
- context->hidden.win32io.buffer.size -
- context->hidden.win32io.buffer.left;
- read_ahead = SDL_min(total_need, context->hidden.win32io.buffer.left);
- SDL_memcpy(ptr, data, read_ahead);
- context->hidden.win32io.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.win32io.h,context->hidden.win32io.buffer.data,READAHEAD_BUFFER_SIZE,&byte_read,NULL)) {
- SDL_Error(SDL_EFREAD);
- return 0;
- }
- read_ahead = SDL_min(total_need, (int)byte_read);
- SDL_memcpy(ptr, context->hidden.win32io.buffer.data, read_ahead);
- context->hidden.win32io.buffer.size = byte_read;
- context->hidden.win32io.buffer.left = byte_read-read_ahead;
- total_read += read_ahead;
- } else {
- if (!ReadFile(context->hidden.win32io.h,ptr,total_need,&byte_read,NULL)) {
- SDL_Error(SDL_EFREAD);
- return 0;
- }
- total_read += byte_read;
- }
- return (total_read/size);
-}
-static int SDLCALL win32_file_write(SDL_RWops *context, const void *ptr, int size, int num)
-{
-
- int total_bytes;
- DWORD byte_written,nwritten;
-
- total_bytes = size*num;
-
- if (!context || context->hidden.win32io.h==INVALID_HANDLE_VALUE || total_bytes<=0 || !size)
- return 0;
-
- if (context->hidden.win32io.buffer.left) {
- SetFilePointer(context->hidden.win32io.h,-context->hidden.win32io.buffer.left,NULL,FILE_CURRENT);
- context->hidden.win32io.buffer.left = 0;
- }
-
- /* if in append mode, we must go to the EOF before write */
- if (context->hidden.win32io.append) {
- if ( SetFilePointer(context->hidden.win32io.h,0L,NULL,FILE_END) == INVALID_SET_FILE_POINTER ) {
- SDL_Error(SDL_EFWRITE);
- return 0;
- }
- }
-
- if (!WriteFile(context->hidden.win32io.h,ptr,total_bytes,&byte_written,NULL)) {
- SDL_Error(SDL_EFWRITE);
- return 0;
- }
-
- nwritten = byte_written/size;
- return nwritten;
-}
-static int SDLCALL win32_file_close(SDL_RWops *context)
-{
-
- if ( context ) {
- if (context->hidden.win32io.h != INVALID_HANDLE_VALUE) {
- CloseHandle(context->hidden.win32io.h);
- context->hidden.win32io.h = INVALID_HANDLE_VALUE; /* to be sure */
- }
- if (context->hidden.win32io.buffer.data) {
- SDL_free(context->hidden.win32io.buffer.data);
- context->hidden.win32io.buffer.data = NULL;
- }
- SDL_FreeRW(context);
- }
- return(0);
-}
-#endif /* __WIN32__ */
-
-#ifdef HAVE_STDIO_H
-
-/* Functions to read/write stdio file pointers */
-
-static int SDLCALL stdio_seek(SDL_RWops *context, int offset, int whence)
-{
- if ( fseek(context->hidden.stdio.fp, offset, whence) == 0 ) {
- return(ftell(context->hidden.stdio.fp));
- } else {
- SDL_Error(SDL_EFSEEK);
- return(-1);
- }
-}
-static int SDLCALL stdio_read(SDL_RWops *context, void *ptr, int size, int 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 int SDLCALL stdio_write(SDL_RWops *context, const void *ptr, int size, int 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)
-{
- if ( context ) {
- if ( context->hidden.stdio.autoclose ) {
- /* WARNING: Check the return value here! */
- fclose(context->hidden.stdio.fp);
- }
- SDL_FreeRW(context);
- }
- return(0);
-}
-#endif /* !HAVE_STDIO_H */
-
-/* Functions to read/write memory pointers */
-
-static int SDLCALL mem_seek(SDL_RWops *context, int 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:
- SDL_SetError("Unknown value for 'whence'");
- return(-1);
- }
- if ( newpos < context->hidden.mem.base ) {
- newpos = context->hidden.mem.base;
- }
- if ( newpos > context->hidden.mem.stop ) {
- newpos = context->hidden.mem.stop;
- }
- context->hidden.mem.here = newpos;
- return(context->hidden.mem.here-context->hidden.mem.base);
-}
-static int SDLCALL mem_read(SDL_RWops *context, void *ptr, int size, int 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 int SDLCALL mem_write(SDL_RWops *context, const void *ptr, int size, int num)
-{
- if ( (context->hidden.mem.here + (num*size)) > context->hidden.mem.stop ) {
- num = (context->hidden.mem.stop-context->hidden.mem.here)/size;
- }
- SDL_memcpy(context->hidden.mem.here, ptr, num*size);
- context->hidden.mem.here += num*size;
- return(num);
-}
-static int SDLCALL mem_writeconst(SDL_RWops *context, const void *ptr, int size, int num)
-{
- SDL_SetError("Can't write to read-only memory");
- return(-1);
-}
-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 */
-
-#ifdef __MACOS__
-/*
- * translate unix-style slash-separated filename to mac-style colon-separated
- * name; return malloced string
- */
-static char *unix_to_mac(const char *file)
-{
- int flen = SDL_strlen(file);
- char *path = SDL_malloc(flen + 2);
- const char *src = file;
- char *dst = path;
- if(*src == '/') {
- /* really depends on filesystem layout, hope for the best */
- src++;
- } else {
- /* Check if this is a MacOS path to begin with */
- if(*src != ':')
- *dst++ = ':'; /* relative paths begin with ':' */
- }
- while(src < file + flen) {
- const char *end = SDL_strchr(src, '/');
- int len;
- if(!end)
- end = file + flen; /* last component */
- len = end - src;
- if(len == 0 || (len == 1 && src[0] == '.')) {
- /* remove repeated slashes and . */
- } else {
- if(len == 2 && src[0] == '.' && src[1] == '.') {
- /* replace .. with the empty string */
- } else {
- SDL_memcpy(dst, src, len);
- dst += len;
- }
- if(end < file + flen)
- *dst++ = ':';
- }
- src = end + 1;
- }
- *dst++ = '\0';
- return path;
-}
-#endif /* __MACOS__ */
-
-SDL_RWops *SDL_RWFromFile(const char *file, const char *mode)
-{
- SDL_RWops *rwops = NULL;
-#ifdef HAVE_STDIO_H
- FILE *fp = NULL;
-#endif
- if ( !file || !*file || !mode || !*mode ) {
- SDL_SetError("SDL_RWFromFile(): No file or no mode specified");
- return NULL;
- }
-
-#if defined(__WIN32__) && !defined(__SYMBIAN32__)
- rwops = SDL_AllocRW();
- if (!rwops)
- return NULL; /* SDL_SetError already setup by SDL_AllocRW() */
- if (win32_file_open(rwops,file,mode) < 0) {
- SDL_FreeRW(rwops);
- return NULL;
- }
- rwops->seek = win32_file_seek;
- rwops->read = win32_file_read;
- rwops->write = win32_file_write;
- rwops->close = win32_file_close;
-
-#elif HAVE_STDIO_H
-
-#ifdef __MACOS__
- {
- char *mpath = unix_to_mac(file);
- fp = fopen(mpath, mode);
- SDL_free(mpath);
- }
-#else
- fp = fopen(file, mode);
-#endif
- if ( fp == NULL ) {
- SDL_SetError("Couldn't open %s", file);
- } else {
- rwops = SDL_RWFromFP(fp, 1);
- }
-#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, int autoclose)
-{
- SDL_RWops *rwops = NULL;
-
- rwops = SDL_AllocRW();
- if ( rwops != NULL ) {
- rwops->seek = stdio_seek;
- rwops->read = stdio_read;
- rwops->write = stdio_write;
- rwops->close = stdio_close;
- rwops->hidden.stdio.fp = fp;
- rwops->hidden.stdio.autoclose = autoclose;
- }
- return(rwops);
-}
-#endif /* HAVE_STDIO_H */
-
-SDL_RWops *SDL_RWFromMem(void *mem, int size)
-{
- SDL_RWops *rwops;
-
- rwops = SDL_AllocRW();
- if ( rwops != NULL ) {
- rwops->seek = mem_seek;
- rwops->read = mem_read;
- rwops->write = mem_write;
- rwops->close = mem_close;
- rwops->hidden.mem.base = (Uint8 *)mem;
- rwops->hidden.mem.here = rwops->hidden.mem.base;
- rwops->hidden.mem.stop = rwops->hidden.mem.base+size;
- }
- return(rwops);
-}
-
-SDL_RWops *SDL_RWFromConstMem(const void *mem, int size)
-{
- SDL_RWops *rwops;
-
- rwops = SDL_AllocRW();
- if ( rwops != NULL ) {
- rwops->seek = mem_seek;
- rwops->read = mem_read;
- rwops->write = mem_writeconst;
- rwops->close = mem_close;
- rwops->hidden.mem.base = (Uint8 *)mem;
- rwops->hidden.mem.here = rwops->hidden.mem.base;
- rwops->hidden.mem.stop = rwops->hidden.mem.base+size;
- }
- return(rwops);
-}
-
-SDL_RWops *SDL_AllocRW(void)
-{
- SDL_RWops *area;
-
- area = (SDL_RWops *)SDL_malloc(sizeof *area);
- if ( area == NULL ) {
- SDL_OutOfMemory();
- }
- return(area);
-}
-
-void SDL_FreeRW(SDL_RWops *area)
-{
- SDL_free(area);
-}
-
-/* Functions for dynamically reading and writing endian-specific values */
-
-Uint16 SDL_ReadLE16 (SDL_RWops *src)
-{
- Uint16 value;
-
- SDL_RWread(src, &value, (sizeof value), 1);
- return(SDL_SwapLE16(value));
-}
-Uint16 SDL_ReadBE16 (SDL_RWops *src)
-{
- Uint16 value;
-
- SDL_RWread(src, &value, (sizeof value), 1);
- return(SDL_SwapBE16(value));
-}
-Uint32 SDL_ReadLE32 (SDL_RWops *src)
-{
- Uint32 value;
-
- SDL_RWread(src, &value, (sizeof value), 1);
- return(SDL_SwapLE32(value));
-}
-Uint32 SDL_ReadBE32 (SDL_RWops *src)
-{
- Uint32 value;
-
- SDL_RWread(src, &value, (sizeof value), 1);
- return(SDL_SwapBE32(value));
-}
-Uint64 SDL_ReadLE64 (SDL_RWops *src)
-{
- Uint64 value;
-
- SDL_RWread(src, &value, (sizeof value), 1);
- return(SDL_SwapLE64(value));
-}
-Uint64 SDL_ReadBE64 (SDL_RWops *src)
-{
- Uint64 value;
-
- SDL_RWread(src, &value, (sizeof value), 1);
- return(SDL_SwapBE64(value));
-}
-
-int SDL_WriteLE16 (SDL_RWops *dst, Uint16 value)
-{
- value = SDL_SwapLE16(value);
- return(SDL_RWwrite(dst, &value, (sizeof value), 1));
-}
-int SDL_WriteBE16 (SDL_RWops *dst, Uint16 value)
-{
- value = SDL_SwapBE16(value);
- return(SDL_RWwrite(dst, &value, (sizeof value), 1));
-}
-int SDL_WriteLE32 (SDL_RWops *dst, Uint32 value)
-{
- value = SDL_SwapLE32(value);
- return(SDL_RWwrite(dst, &value, (sizeof value), 1));
-}
-int SDL_WriteBE32 (SDL_RWops *dst, Uint32 value)
-{
- value = SDL_SwapBE32(value);
- return(SDL_RWwrite(dst, &value, (sizeof value), 1));
-}
-int SDL_WriteLE64 (SDL_RWops *dst, Uint64 value)
-{
- value = SDL_SwapLE64(value);
- return(SDL_RWwrite(dst, &value, (sizeof value), 1));
-}
-int SDL_WriteBE64 (SDL_RWops *dst, Uint64 value)
-{
- value = SDL_SwapBE64(value);
- return(SDL_RWwrite(dst, &value, (sizeof value), 1));
-}
diff --git a/distrib/sdl-1.2.12/src/hermes/HeadMMX.h b/distrib/sdl-1.2.12/src/hermes/HeadMMX.h
deleted file mode 100644
index 11cf6da..0000000
--- a/distrib/sdl-1.2.12/src/hermes/HeadMMX.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- Header definitions for the MMX routines for the HERMES library
- Copyright (c) 1998 Christian Nentwich (c.nentwich@cs.ucl.ac.uk)
- This source code is licensed under the GNU LGPL
-
- Please refer to the file COPYING.LIB contained in the distribution for
- licensing conditions
-*/
-#include "SDL_config.h"
-
-#ifndef __HERMES_HEAD_MMX__
-#define __HERMES_HEAD_MMX__
-
-
-/* If you cannot stand ifdefs, then please do not look into this file, it's
- going to end your life :) */
-
-#ifdef X86_ASSEMBLER
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void STACKCALL ConvertMMX(HermesConverterInterface *);
-
-void STACKCALL ClearMMX_32(HermesClearInterface *);
-void STACKCALL ClearMMX_24(HermesClearInterface *);
-void STACKCALL ClearMMX_16(HermesClearInterface *);
-void STACKCALL ClearMMX_8(HermesClearInterface *);
-
-void ConvertMMXpII32_24RGB888();
-void ConvertMMXpII32_16RGB565();
-void ConvertMMXpII32_16BGR565();
-void ConvertMMXpII32_16RGB555();
-void ConvertMMXpII32_16BGR565();
-void ConvertMMXpII32_16BGR555();
-
-void ConvertMMXp32_16RGB555();
-
-#ifdef __cplusplus
-}
-#endif
-
-
-
-/* Fix the underscore business with ELF compilers */
-
-#if defined(__ELF__) && defined(__GNUC__)
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- extern void _ConvertMMX(HermesConverterInterface *);
- extern void _ConvertMMXpII32_24RGB888();
- extern void _ConvertMMXpII32_16RGB565();
- extern void _ConvertMMXpII32_16BGR565();
- extern void _ConvertMMXpII32_16RGB555();
- extern void _ConvertMMXpII32_16BGR555();
-
- #define ConvertMMX _ConvertMMX
- #define ConvertMMXpII32_24RGB888 _ConvertMMXpII32_24RGB888
- #define ConvertMMXpII32_16RGB565 _ConvertMMXpII32_16RGB565
- #define ConvertMMXpII32_16BGR565 _ConvertMMXpII32_16BGR565
- #define ConvertMMXpII32_16RGB555 _ConvertMMXpII32_16RGB555
- #define ConvertMMXpII32_16BGR555 _ConvertMMXpII32_16BGR555
-
- #ifdef __cplusplus
- }
- #endif
-
-#endif /* ELF and GNUC */
-
-
-
-
-/* Make it work with Watcom */
-#ifdef __WATCOMC__
-#pragma warning 601 9
-
-#pragma aux ConvertMMX "_*" modify [EAX EBX ECX EDX ESI EDI]
-
-#pragma aux ClearMMX_32 "_*" modify [EAX EBX ECX EDX ESI EDI]
-#pragma aux ClearMMX_24 "_*" modify [EAX EBX ECX EDX ESI EDI]
-#pragma aux ClearMMX_16 "_*" modify [EAX EBX ECX EDX ESI EDI]
-#pragma aux ClearMMX_8 "_*" modify [EAX EBX ECX EDX ESI EDI]
-
-#pragma aux ConvertMMXpII32_24RGB888 "_*"
-#pragma aux ConvertMMXpII32_16RGB565 "_*"
-#pragma aux ConvertMMXpII32_16BGR565 "_*"
-#pragma aux ConvertMMXpII32_16RGB555 "_*"
-#pragma aux ConvertMMXpII32_16BGR555 "_*"
-#pragma aux ConvertMMXp32_16RGB555 "_*"
-
-#endif /* WATCOM */
-
-#endif /* X86_ASSEMBLER */
-
-
-#endif
diff --git a/distrib/sdl-1.2.12/src/hermes/HeadX86.h b/distrib/sdl-1.2.12/src/hermes/HeadX86.h
deleted file mode 100644
index 54e0cc9..0000000
--- a/distrib/sdl-1.2.12/src/hermes/HeadX86.h
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- Header definitions for the x86 routines for the HERMES library
- Copyright (c) 1998 Christian Nentwich (brn@eleet.mcb.at)
- This source code is licensed under the GNU LGPL
-
- Please refer to the file COPYING.LIB contained in the distribution for
- licensing conditions
-*/
-
-#ifndef __HERMES_HEAD_X86__
-#define __HERMES_HEAD_X86__
-
-
-#ifdef X86_ASSEMBLER
-
-/* If you can't stand IFDEFS, then close your eyes now, please :) */
-
-/* Ok, we start with normal function definitions */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-void STACKCALL ConvertX86(HermesConverterInterface *);
-void STACKCALL ClearX86_32(HermesClearInterface *);
-void STACKCALL ClearX86_24(HermesClearInterface *);
-void STACKCALL ClearX86_16(HermesClearInterface *);
-void STACKCALL ClearX86_8(HermesClearInterface *);
-
-int STACKCALL Hermes_X86_CPU();
-
-void ConvertX86p32_32BGR888();
-void ConvertX86p32_32RGBA888();
-void ConvertX86p32_32BGRA888();
-void ConvertX86p32_24RGB888();
-void ConvertX86p32_24BGR888();
-void ConvertX86p32_16RGB565();
-void ConvertX86p32_16BGR565();
-void ConvertX86p32_16RGB555();
-void ConvertX86p32_16BGR555();
-void ConvertX86p32_8RGB332();
-
-void ConvertX86p16_32RGB888();
-void ConvertX86p16_32BGR888();
-void ConvertX86p16_32RGBA888();
-void ConvertX86p16_32BGRA888();
-void ConvertX86p16_24RGB888();
-void ConvertX86p16_24BGR888();
-void ConvertX86p16_16BGR565();
-void ConvertX86p16_16RGB555();
-void ConvertX86p16_16BGR555();
-void ConvertX86p16_8RGB332();
-
-void CopyX86p_4byte();
-void CopyX86p_3byte();
-void CopyX86p_2byte();
-void CopyX86p_1byte();
-
-void ConvertX86pI8_32();
-void ConvertX86pI8_24();
-void ConvertX86pI8_16();
-
-extern int ConvertX86p16_32RGB888_LUT_X86[512];
-extern int ConvertX86p16_32BGR888_LUT_X86[512];
-extern int ConvertX86p16_32RGBA888_LUT_X86[512];
-extern int ConvertX86p16_32BGRA888_LUT_X86[512];
-
-#ifdef __cplusplus
-}
-#endif
-
-
-
-
-/* Now fix up the ELF underscore problem */
-
-#if defined(__ELF__) && defined(__GNUC__)
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- extern int _Hermes_X86_CPU();
-
- extern void _ConvertX86(HermesConverterInterface *);
-
- extern void _ConvertX86p32_32BGR888();
- extern void _ConvertX86p32_32RGBA888();
- extern void _ConvertX86p32_32BGRA888();
- extern void _ConvertX86p32_24RGB888();
- extern void _ConvertX86p32_24BGR888();
- extern void _ConvertX86p32_16RGB565();
- extern void _ConvertX86p32_16BGR565();
- extern void _ConvertX86p32_16RGB555();
- extern void _ConvertX86p32_16BGR555();
- extern void _ConvertX86p32_8RGB332();
-
- extern void _ConvertX86p16_16BGR565();
- extern void _ConvertX86p16_16RGB555();
- extern void _ConvertX86p16_16BGR555();
- extern void _ConvertX86p16_8RGB332();
-
-
- #define Hermes_X86_CPU _Hermes_X86_CPU
-
- #define ConvertX86 _ConvertX86
-
- #define ConvertX86p32_32BGR888 _ConvertX86p32_32BGR888
- #define ConvertX86p32_32RGBA888 _ConvertX86p32_32RGBA888
- #define ConvertX86p32_32BGRA888 _ConvertX86p32_32BGRA888
- #define ConvertX86p32_24RGB888 _ConvertX86p32_24RGB888
- #define ConvertX86p32_24BGR888 _ConvertX86p32_24BGR888
- #define ConvertX86p32_16RGB565 _ConvertX86p32_16RGB565
- #define ConvertX86p32_16BGR565 _ConvertX86p32_16BGR565
- #define ConvertX86p32_16RGB555 _ConvertX86p32_16RGB555
- #define ConvertX86p32_16BGR555 _ConvertX86p32_16BGR555
- #define ConvertX86p32_8RGB332 _ConvertX86p32_8RGB332
-
- #define ConvertX86p16_16BGR565 _ConvertX86p16_16BGR565
- #define ConvertX86p16_16RGB555 _ConvertX86p16_16RGB555
- #define ConvertX86p16_16BGR555 _ConvertX86p16_16BGR555
- #define ConvertX86p16_8RGB332 _ConvertX86p16_8RGB332
-
-
- #ifdef __cplusplus
- }
- #endif
-
-#endif /* ELF & GNU */
-
-
-
-/* Make it run with WATCOM C */
-#ifdef __WATCOMC__
-#pragma warning 601 9
-
-#pragma aux Hermes_X86_CPU "_*"
-
-#pragma aux ConvertX86 "_*" modify [EAX EBX ECX EDX ESI EDI]
-#pragma aux ClearX86_32 "_*" modify [EAX EBX ECX EDX ESI EDI]
-#pragma aux ClearX86_24 "_*" modify [EAX EBX ECX EDX ESI EDI]
-#pragma aux ClearX86_16 "_*" modify [EAX EBX ECX EDX ESI EDI]
-#pragma aux ClearX86_8 "_*" modify [EAX EBX ECX EDX ESI EDI]
-
-#pragma aux ConvertX86p32_32BGR888 "_*"
-#pragma aux ConvertX86p32_32RGBA888 "_*"
-#pragma aux ConvertX86p32_32BGRA888 "_*"
-#pragma aux ConvertX86p32_24RGB888 "_*"
-#pragma aux ConvertX86p32_24BGR888 "_*"
-#pragma aux ConvertX86p32_16RGB565 "_*"
-#pragma aux ConvertX86p32_16BGR565 "_*"
-#pragma aux ConvertX86p32_16RGB555 "_*"
-#pragma aux ConvertX86p32_16BGR555 "_*"
-#pragma aux ConvertX86p32_8RGB332 "_*"
-
-#pragma aux ConvertX86p16_32RGB888 "_*"
-#pragma aux ConvertX86p16_32BGR888 "_*"
-#pragma aux ConvertX86p16_32RGBA888 "_*"
-#pragma aux ConvertX86p16_32BGRA888 "_*"
-#pragma aux ConvertX86p16_24RGB888 "_*"
-#pragma aux ConvertX86p16_24BGR888 "_*"
-#pragma aux ConvertX86p16_16BGR565 "_*"
-#pragma aux ConvertX86p16_16RGB555 "_*"
-#pragma aux ConvertX86p16_16BGR555 "_*"
-#pragma aux ConvertX86p16_8RGB332 "_*"
-
-#pragma aux CopyX86p_4byte "_*"
-#pragma aux CopyX86p_3byte "_*"
-#pragma aux CopyX86p_2byte "_*"
-#pragma aux CopyX86p_1byte "_*"
-
-#pragma aux ConvertX86pI8_32 "_*"
-#pragma aux ConvertX86pI8_24 "_*"
-#pragma aux ConvertX86pI8_16 "_*"
-
-#pragma aux ConvertX86p16_32RGB888_LUT_X86 "_*"
-#pragma aux ConvertX86p16_32BGR888_LUT_X86 "_*"
-#pragma aux ConvertX86p16_32RGBA888_LUT_X86 "_*"
-#pragma aux ConvertX86p16_32BGRA888_LUT_X86 "_*"
-
-#endif /* __WATCOMC__ */
-
-
-#endif /* X86_ASSEMBLER */
-
-
-#endif
diff --git a/distrib/sdl-1.2.12/src/hermes/mmx_main.asm b/distrib/sdl-1.2.12/src/hermes/mmx_main.asm
deleted file mode 100644
index c3886d6..0000000
--- a/distrib/sdl-1.2.12/src/hermes/mmx_main.asm
+++ /dev/null
@@ -1,74 +0,0 @@
-;
-; mmx format converter main loops for HERMES
-; Some routines Copyright (c) 1998 Christian Nentwich (c.nentwich@cs.ucl.ac.uk)
-; This source code is licensed under the GNU LGPL
-;
-; Please refer to the file COPYING.LIB contained in the distribution for
-; licensing conditions
-;
-
-BITS 32
-
-%include "common.inc"
-
-SDL_FUNC _ConvertMMX
-
-SECTION .text
-
-;; _ConvertMMX:
-;; [ESP+8] ConverterInfo*
-;; --------------------------------------------------------------------------
-;; ConverterInfo (ebp+..)
-;; 0: void *s_pixels
-;; 4: int s_width
-;; 8: int s_height
-;; 12: int s_add
-;; 16: void *d_pixels
-;; 20: int d_width
-;; 24: int d_height
-;; 28: int d_add
-;; 32: void (*converter_function)()
-;; 36: int32 *lookup
-
-_ConvertMMX:
- push ebp
- mov ebp,esp
-
-; Save the registers used by the blitters, necessary for optimized code
- pusha
-
- mov eax,[ebp+8]
-
- cmp dword [eax+4],BYTE 0
- je endconvert
-
- mov ebp,eax
-
- mov esi,[ebp+0]
- mov edi,[ebp+16]
-
-y_loop:
- mov ecx,[ebp+4]
-
- call [ebp+32]
-
- add esi,[ebp+12]
- add edi,[ebp+28]
-
- dec dword [ebp+8]
- jnz y_loop
-
-
-; Restore the registers used by the blitters, necessary for optimized code
- popa
-
- pop ebp
-
-endconvert:
- emms
-
- ret
-
-%ifidn __OUTPUT_FORMAT__,elf
-section .note.GNU-stack noalloc noexec nowrite progbits
-%endif
diff --git a/distrib/sdl-1.2.12/src/hermes/mmxp2_32.asm b/distrib/sdl-1.2.12/src/hermes/mmxp2_32.asm
deleted file mode 100644
index d2d31ec..0000000
--- a/distrib/sdl-1.2.12/src/hermes/mmxp2_32.asm
+++ /dev/null
@@ -1,405 +0,0 @@
-;
-; pII-optimised MMX format converters for HERMES
-; Copyright (c) 1998 Christian Nentwich (c.nentwich@cs.ucl.ac.uk)
-; and (c) 1999 Jonathan Matthew (jmatthew@uq.net.au)
-; This source code is licensed under the GNU LGPL
-;
-; Please refer to the file COPYING.LIB contained in the distribution for
-; licensing conditions
-;
-; COPYRIGHT NOTICE
-;
-; This file partly contains code that is (c) Intel Corporation, specifically
-; the mode detection routine, and the converter to 15 bit (8 pixel
-; conversion routine from the mmx programming tutorial pages).
-;
-;
-; These routines aren't exactly pII optimised - it's just that as they
-; are, they're terrible on p5 MMXs, but less so on pIIs. Someone needs to
-; optimise them for p5 MMXs..
-
-BITS 32
-
-%include "common.inc"
-
-SDL_FUNC _ConvertMMXpII32_24RGB888
-SDL_FUNC _ConvertMMXpII32_16RGB565
-SDL_FUNC _ConvertMMXpII32_16BGR565
-SDL_FUNC _ConvertMMXpII32_16RGB555
-SDL_FUNC _ConvertMMXpII32_16BGR555
-
-;; Macros for conversion routines
-
-%macro _push_immq_mask 1
- push dword %1
- push dword %1
-%endmacro
-
-%macro load_immq 2
- _push_immq_mask %2
- movq %1, [esp]
-%endmacro
-
-%macro pand_immq 2
- _push_immq_mask %2
- pand %1, [esp]
-%endmacro
-
-%define CLEANUP_IMMQ_LOADS(num) \
- add esp, byte 8 * num
-
-%define mmx32_rgb888_mask 00ffffffh
-%define mmx32_rgb565_b 000000f8h
-%define mmx32_rgb565_g 0000fc00h
-%define mmx32_rgb565_r 00f80000h
-
-%define mmx32_rgb555_rb 00f800f8h
-%define mmx32_rgb555_g 0000f800h
-%define mmx32_rgb555_mul 20000008h
-%define mmx32_bgr555_mul 00082000h
-
-SECTION .text
-
-_ConvertMMXpII32_24RGB888:
-
- ; set up mm6 as the mask, mm7 as zero
- load_immq mm6, mmx32_rgb888_mask
- CLEANUP_IMMQ_LOADS(1)
- pxor mm7, mm7
-
- mov edx, ecx ; save ecx
- and ecx, 0fffffffch ; clear lower two bits
- jnz .L1
- jmp .L2
-
-.L1:
-
- movq mm0, [esi] ; A R G B a r g b
- pand mm0, mm6 ; 0 R G B 0 r g b
- movq mm1, [esi+8] ; A R G B a r g b
- pand mm1, mm6 ; 0 R G B 0 r g b
-
- movq mm2, mm0 ; 0 R G B 0 r g b
- punpckhdq mm2, mm7 ; 0 0 0 0 0 R G B
- punpckldq mm0, mm7 ; 0 0 0 0 0 r g b
- psllq mm2, 24 ; 0 0 R G B 0 0 0
- por mm0, mm2 ; 0 0 R G B r g b
-
- movq mm3, mm1 ; 0 R G B 0 r g b
- psllq mm3, 48 ; g b 0 0 0 0 0 0
- por mm0, mm3 ; g b R G B r g b
-
- movq mm4, mm1 ; 0 R G B 0 r g b
- punpckhdq mm4, mm7 ; 0 0 0 0 0 R G B
- punpckldq mm1, mm7 ; 0 0 0 0 0 r g b
- psrlq mm1, 16 ; 0 0 0 R G B 0 r
- psllq mm4, 8 ; 0 0 0 0 R G B 0
- por mm1, mm4 ; 0 0 0 0 R G B r
-
- movq [edi], mm0
- add esi, BYTE 16
- movd [edi+8], mm1
- add edi, BYTE 12
- sub ecx, BYTE 4
- jnz .L1
-
-.L2:
- mov ecx, edx
- and ecx, BYTE 3
- jz .L4
-.L3:
- mov al, [esi]
- mov bl, [esi+1]
- mov dl, [esi+2]
- mov [edi], al
- mov [edi+1], bl
- mov [edi+2], dl
- add esi, BYTE 4
- add edi, BYTE 3
- dec ecx
- jnz .L3
-.L4:
- return
-
-
-
-_ConvertMMXpII32_16RGB565:
-
- ; set up masks
- load_immq mm5, mmx32_rgb565_b
- load_immq mm6, mmx32_rgb565_g
- load_immq mm7, mmx32_rgb565_r
- CLEANUP_IMMQ_LOADS(3)
-
- mov edx, ecx
- shr ecx, 2
- jnz .L1
- jmp .L2 ; not necessary at the moment, but doesn't hurt (much)
-
-.L1:
- movq mm0, [esi] ; argb
- movq mm1, mm0 ; argb
- pand mm0, mm6 ; 00g0
- movq mm3, mm1 ; argb
- pand mm1, mm5 ; 000b
- pand mm3, mm7 ; 0r00
- pslld mm1, 2 ; 0 0 000000bb bbb00000
- por mm0, mm1 ; 0 0 ggggggbb bbb00000
- psrld mm0, 5 ; 0 0 00000ggg gggbbbbb
-
- movq mm4, [esi+8] ; argb
- movq mm2, mm4 ; argb
- pand mm4, mm6 ; 00g0
- movq mm1, mm2 ; argb
- pand mm2, mm5 ; 000b
- pand mm1, mm7 ; 0r00
- pslld mm2, 2 ; 0 0 000000bb bbb00000
- por mm4, mm2 ; 0 0 ggggggbb bbb00000
- psrld mm4, 5 ; 0 0 00000ggg gggbbbbb
-
- packuswb mm3, mm1 ; R 0 r 0
- packssdw mm0, mm4 ; as above.. ish
- por mm0, mm3 ; done.
- movq [edi], mm0
-
- add esi, 16
- add edi, 8
- dec ecx
- jnz .L1
-
-.L2:
- mov ecx, edx
- and ecx, BYTE 3
- jz .L4
-.L3:
- mov al, [esi]
- mov bh, [esi+1]
- mov ah, [esi+2]
- shr al, 3
- and eax, 0F81Fh ; BYTE?
- shr ebx, 5
- and ebx, 07E0h ; BYTE?
- add eax, ebx
- mov [edi], al
- mov [edi+1], ah
- add esi, BYTE 4
- add edi, BYTE 2
- dec ecx
- jnz .L3
-
-.L4:
- retn
-
-
-_ConvertMMXpII32_16BGR565:
-
- load_immq mm5, mmx32_rgb565_r
- load_immq mm6, mmx32_rgb565_g
- load_immq mm7, mmx32_rgb565_b
- CLEANUP_IMMQ_LOADS(3)
-
- mov edx, ecx
- shr ecx, 2
- jnz .L1
- jmp .L2
-
-.L1:
- movq mm0, [esi] ; a r g b
- movq mm1, mm0 ; a r g b
- pand mm0, mm6 ; 0 0 g 0
- movq mm3, mm1 ; a r g b
- pand mm1, mm5 ; 0 r 0 0
- pand mm3, mm7 ; 0 0 0 b
-
- psllq mm3, 16 ; 0 b 0 0
- psrld mm1, 14 ; 0 0 000000rr rrr00000
- por mm0, mm1 ; 0 0 ggggggrr rrr00000
- psrld mm0, 5 ; 0 0 00000ggg gggrrrrr
-
- movq mm4, [esi+8] ; a r g b
- movq mm2, mm4 ; a r g b
- pand mm4, mm6 ; 0 0 g 0
- movq mm1, mm2 ; a r g b
- pand mm2, mm5 ; 0 r 0 0
- pand mm1, mm7 ; 0 0 0 b
-
- psllq mm1, 16 ; 0 b 0 0
- psrld mm2, 14 ; 0 0 000000rr rrr00000
- por mm4, mm2 ; 0 0 ggggggrr rrr00000
- psrld mm4, 5 ; 0 0 00000ggg gggrrrrr
-
- packuswb mm3, mm1 ; BBBBB000 00000000 bbbbb000 00000000
- packssdw mm0, mm4 ; 00000GGG GGGRRRRR 00000GGG GGGRRRRR
- por mm0, mm3 ; BBBBBGGG GGGRRRRR bbbbbggg gggrrrrr
- movq [edi], mm0
-
- add esi, BYTE 16
- add edi, BYTE 8
- dec ecx
- jnz .L1
-
-.L2:
- and edx, BYTE 3
- jz .L4
-.L3:
- mov al, [esi+2]
- mov bh, [esi+1]
- mov ah, [esi]
- shr al, 3
- and eax, 0F81Fh ; BYTE ?
- shr ebx, 5
- and ebx, 07E0h ; BYTE ?
- add eax, ebx
- mov [edi], al
- mov [edi+1], ah
- add esi, BYTE 4
- add edi, BYTE 2
- dec edx
- jnz .L3
-
-.L4:
- retn
-
-_ConvertMMXpII32_16BGR555:
-
- ; the 16BGR555 converter is identical to the RGB555 one,
- ; except it uses a different multiplier for the pmaddwd
- ; instruction. cool huh.
-
- load_immq mm7, mmx32_bgr555_mul
- jmp _convert_bgr555_cheat
-
-; This is the same as the Intel version.. they obviously went to
-; much more trouble to expand/coil the loop than I did, so theirs
-; would almost certainly be faster, even if only a little.
-; I did rename 'mmx32_rgb555_add' to 'mmx32_rgb555_mul', which is
-; (I think) a more accurate name..
-_ConvertMMXpII32_16RGB555:
-
- load_immq mm7, mmx32_rgb555_mul
-_convert_bgr555_cheat:
- load_immq mm6, mmx32_rgb555_g
- CLEANUP_IMMQ_LOADS(2)
-
- mov edx,ecx ; Save ecx
-
- and ecx,DWORD 0fffffff8h ; clear lower three bits
- jnz .L_OK
- jmp near .L2
-
-.L_OK:
-
- movq mm2,[esi+8]
-
- movq mm0,[esi]
- movq mm3,mm2
-
- pand_immq mm3, mmx32_rgb555_rb
- movq mm1,mm0
-
- pand_immq mm1, mmx32_rgb555_rb
- pmaddwd mm3,mm7
-
- CLEANUP_IMMQ_LOADS(2)
-
- pmaddwd mm1,mm7
- pand mm2,mm6
-
-.L1:
- movq mm4,[esi+24]
- pand mm0,mm6
-
- movq mm5,[esi+16]
- por mm3,mm2
-
- psrld mm3,6
- por mm1,mm0
-
- movq mm0,mm4
- psrld mm1,6
-
- pand_immq mm0, mmx32_rgb555_rb
- packssdw mm1,mm3
-
- movq mm3,mm5
- pmaddwd mm0,mm7
-
- pand_immq mm3, mmx32_rgb555_rb
- pand mm4,mm6
-
- movq [edi],mm1
- pmaddwd mm3,mm7
-
- add esi,BYTE 32
- por mm4,mm0
-
- pand mm5,mm6
- psrld mm4,6
-
- movq mm2,[esi+8]
- por mm5,mm3
-
- movq mm0,[esi]
- psrld mm5,6
-
- movq mm3,mm2
- movq mm1,mm0
-
- pand_immq mm3, mmx32_rgb555_rb
- packssdw mm5,mm4
-
- pand_immq mm1, mmx32_rgb555_rb
- pand mm2,mm6
-
- CLEANUP_IMMQ_LOADS(4)
-
- movq [edi+8],mm5
- pmaddwd mm3,mm7
-
- pmaddwd mm1,mm7
- add edi,BYTE 16
-
- sub ecx,BYTE 8
- jz .L2
- jmp .L1
-
-
-.L2:
- mov ecx,edx
-
- and ecx,BYTE 7
- jz .L4
-
-.L3:
- mov ebx,[esi]
- add esi,BYTE 4
-
- mov eax,ebx
- mov edx,ebx
-
- shr eax,3
- shr edx,6
-
- and eax,BYTE 0000000000011111b
- and edx, 0000001111100000b
-
- shr ebx,9
-
- or eax,edx
-
- and ebx, 0111110000000000b
-
- or eax,ebx
-
- mov [edi],ax
- add edi,BYTE 2
-
- dec ecx
- jnz .L3
-
-.L4:
- retn
-
-%ifidn __OUTPUT_FORMAT__,elf
-section .note.GNU-stack noalloc noexec nowrite progbits
-%endif
diff --git a/distrib/sdl-1.2.12/src/hermes/x86_main.asm b/distrib/sdl-1.2.12/src/hermes/x86_main.asm
deleted file mode 100644
index e78bf8f..0000000
--- a/distrib/sdl-1.2.12/src/hermes/x86_main.asm
+++ /dev/null
@@ -1,75 +0,0 @@
-;
-; x86 format converters for HERMES
-; Some routines Copyright (c) 1998 Christian Nentwich (brn@eleet.mcb.at)
-; This source code is licensed under the GNU LGPL
-;
-; Please refer to the file COPYING.LIB contained in the distribution for
-; licensing conditions
-;
-; Most routines are (c) Glenn Fiedler (ptc@gaffer.org), used with permission
-;
-
-BITS 32
-
-%include "common.inc"
-
-SDL_FUNC _ConvertX86
-
-SECTION .text
-
-;; _ConvertX86:
-;; [ESP+8] ConverterInfo*
-;; --------------------------------------------------------------------------
-;; ConverterInfo (ebp+..)
-;; 0: void *s_pixels
-;; 4: int s_width
-;; 8: int s_height
-;; 12: int s_add
-;; 16: void *d_pixels
-;; 20: int d_width
-;; 24: int d_height
-;; 28: int d_add
-;; 32: void (*converter_function)()
-;; 36: int32 *lookup
-
-_ConvertX86:
- push ebp
- mov ebp,esp
-
-; Save the registers used by the blitters, necessary for optimized code
- pusha
-
- mov eax,[ebp+8]
-
- cmp dword [eax+4],BYTE 0
- je endconvert
-
- mov ebp,eax
-
- mov esi,[ebp+0]
- mov edi,[ebp+16]
-
-y_loop:
- mov ecx,[ebp+4]
-
- call [ebp+32]
-
- add esi,[ebp+12]
- add edi,[ebp+28]
-
- dec dword [ebp+8]
- jnz y_loop
-
-; Restore the registers used by the blitters, necessary for optimized code
- popa
-
- pop ebp
-
-endconvert:
- ret
-
-
-
-%ifidn __OUTPUT_FORMAT__,elf
-section .note.GNU-stack noalloc noexec nowrite progbits
-%endif
diff --git a/distrib/sdl-1.2.12/src/hermes/x86p_16.asm b/distrib/sdl-1.2.12/src/hermes/x86p_16.asm
deleted file mode 100644
index e35c75d..0000000
--- a/distrib/sdl-1.2.12/src/hermes/x86p_16.asm
+++ /dev/null
@@ -1,490 +0,0 @@
-;
-; x86 format converters for HERMES
-; Copyright (c) 1998 Glenn Fielder (gaffer@gaffer.org)
-; This source code is licensed under the GNU LGPL
-;
-; Please refer to the file COPYING.LIB contained in the distribution for
-; licensing conditions
-;
-; Routines adjusted for Hermes by Christian Nentwich (brn@eleet.mcb.at)
-; Used with permission.
-;
-
-BITS 32
-
-%include "common.inc"
-
-SDL_FUNC _ConvertX86p16_16BGR565
-SDL_FUNC _ConvertX86p16_16RGB555
-SDL_FUNC _ConvertX86p16_16BGR555
-SDL_FUNC _ConvertX86p16_8RGB332
-
-EXTERN _ConvertX86
-
-SECTION .text
-
-_ConvertX86p16_16BGR565:
-
- ; check short
- cmp ecx,BYTE 16
- ja .L3
-
-
-.L1 ; short loop
- mov al,[esi]
- mov ah,[esi+1]
- mov ebx,eax
- mov edx,eax
- shr eax,11
- and eax,BYTE 11111b
- and ebx,11111100000b
- shl edx,11
- add eax,ebx
- add eax,edx
- mov [edi],al
- mov [edi+1],ah
- add esi,BYTE 2
- add edi,BYTE 2
- dec ecx
- jnz .L1
-.L2
- retn
-
-.L3 ; head
- mov eax,edi
- and eax,BYTE 11b
- jz .L4
- mov al,[esi]
- mov ah,[esi+1]
- mov ebx,eax
- mov edx,eax
- shr eax,11
- and eax,BYTE 11111b
- and ebx,11111100000b
- shl edx,11
- add eax,ebx
- add eax,edx
- mov [edi],al
- mov [edi+1],ah
- add esi,BYTE 2
- add edi,BYTE 2
- dec ecx
-
-.L4 ; save count
- push ecx
-
- ; unroll twice
- shr ecx,1
-
- ; point arrays to end
- lea esi,[esi+ecx*4]
- lea edi,[edi+ecx*4]
-
- ; negative counter
- neg ecx
- jmp SHORT .L6
-
-.L5 mov [edi+ecx*4-4],eax
-.L6 mov eax,[esi+ecx*4]
-
- mov ebx,[esi+ecx*4]
- and eax,07E007E0h
-
- mov edx,[esi+ecx*4]
- and ebx,0F800F800h
-
- shr ebx,11
- and edx,001F001Fh
-
- shl edx,11
- add eax,ebx
-
- add eax,edx
- inc ecx
-
- jnz .L5
-
- mov [edi+ecx*4-4],eax
-
- ; tail
- pop ecx
- and ecx,BYTE 1
- jz .L7
- mov al,[esi]
- mov ah,[esi+1]
- mov ebx,eax
- mov edx,eax
- shr eax,11
- and eax,BYTE 11111b
- and ebx,11111100000b
- shl edx,11
- add eax,ebx
- add eax,edx
- mov [edi],al
- mov [edi+1],ah
- add esi,BYTE 2
- add edi,BYTE 2
-
-.L7
- retn
-
-
-
-
-
-
-_ConvertX86p16_16RGB555:
-
- ; check short
- cmp ecx,BYTE 32
- ja .L3
-
-
-.L1 ; short loop
- mov al,[esi]
- mov ah,[esi+1]
- mov ebx,eax
- shr ebx,1
- and ebx, 0111111111100000b
- and eax,BYTE 0000000000011111b
- add eax,ebx
- mov [edi],al
- mov [edi+1],ah
- add esi,BYTE 2
- add edi,BYTE 2
- dec ecx
- jnz .L1
-.L2
- retn
-
-.L3 ; head
- mov eax,edi
- and eax,BYTE 11b
- jz .L4
- mov al,[esi]
- mov ah,[esi+1]
- mov ebx,eax
- shr ebx,1
- and ebx, 0111111111100000b
- and eax,BYTE 0000000000011111b
- add eax,ebx
- mov [edi],al
- mov [edi+1],ah
- add esi,BYTE 2
- add edi,BYTE 2
- dec ecx
-
-.L4 ; save ebp
- push ebp
-
- ; save count
- push ecx
-
- ; unroll four times
- shr ecx,2
-
- ; point arrays to end
- lea esi,[esi+ecx*8]
- lea edi,[edi+ecx*8]
-
- ; negative counter
- xor ebp,ebp
- sub ebp,ecx
-
-.L5 mov eax,[esi+ebp*8] ; agi?
- mov ecx,[esi+ebp*8+4]
-
- mov ebx,eax
- mov edx,ecx
-
- and eax,0FFC0FFC0h
- and ecx,0FFC0FFC0h
-
- shr eax,1
- and ebx,001F001Fh
-
- shr ecx,1
- and edx,001F001Fh
-
- add eax,ebx
- add ecx,edx
-
- mov [edi+ebp*8],eax
- mov [edi+ebp*8+4],ecx
-
- inc ebp
- jnz .L5
-
- ; tail
- pop ecx
-.L6 and ecx,BYTE 11b
- jz .L7
- mov al,[esi]
- mov ah,[esi+1]
- mov ebx,eax
- shr ebx,1
- and ebx, 0111111111100000b
- and eax,BYTE 0000000000011111b
- add eax,ebx
- mov [edi],al
- mov [edi+1],ah
- add esi,BYTE 2
- add edi,BYTE 2
- dec ecx
- jmp SHORT .L6
-
-.L7 pop ebp
- retn
-
-
-
-
-
-
-_ConvertX86p16_16BGR555:
-
- ; check short
- cmp ecx,BYTE 16
- ja .L3
-
-
-.L1 ; short loop
- mov al,[esi]
- mov ah,[esi+1]
- mov ebx,eax
- mov edx,eax
- shr eax,11
- and eax,BYTE 11111b
- shr ebx,1
- and ebx,1111100000b
- shl edx,10
- and edx,0111110000000000b
- add eax,ebx
- add eax,edx
- mov [edi],al
- mov [edi+1],ah
- add esi,BYTE 2
- add edi,BYTE 2
- dec ecx
- jnz .L1
-.L2
- retn
-
-.L3 ; head
- mov eax,edi
- and eax,BYTE 11b
- jz .L4
- mov al,[esi]
- mov ah,[esi+1]
- mov ebx,eax
- mov edx,eax
- shr eax,11
- and eax,BYTE 11111b
- shr ebx,1
- and ebx,1111100000b
- shl edx,10
- and edx,0111110000000000b
- add eax,ebx
- add eax,edx
- mov [edi],al
- mov [edi+1],ah
- add esi,BYTE 2
- add edi,BYTE 2
- dec ecx
-
-.L4 ; save count
- push ecx
-
- ; unroll twice
- shr ecx,1
-
- ; point arrays to end
- lea esi,[esi+ecx*4]
- lea edi,[edi+ecx*4]
-
- ; negative counter
- neg ecx
- jmp SHORT .L6
-
-.L5 mov [edi+ecx*4-4],eax
-.L6 mov eax,[esi+ecx*4]
-
- shr eax,1
- mov ebx,[esi+ecx*4]
-
- and eax,03E003E0h
- mov edx,[esi+ecx*4]
-
- and ebx,0F800F800h
-
- shr ebx,11
- and edx,001F001Fh
-
- shl edx,10
- add eax,ebx
-
- add eax,edx
- inc ecx
-
- jnz .L5
-
- mov [edi+ecx*4-4],eax
-
- ; tail
- pop ecx
- and ecx,BYTE 1
- jz .L7
- mov al,[esi]
- mov ah,[esi+1]
- mov ebx,eax
- mov edx,eax
- shr eax,11
- and eax,BYTE 11111b
- shr ebx,1
- and ebx,1111100000b
- shl edx,10
- and edx,0111110000000000b
- add eax,ebx
- add eax,edx
- mov [edi],al
- mov [edi+1],ah
- add esi,BYTE 2
- add edi,BYTE 2
-
-.L7
- retn
-
-
-
-
-
-
-_ConvertX86p16_8RGB332:
-
- ; check short
- cmp ecx,BYTE 16
- ja .L3
-
-
-.L1 ; short loop
- mov al,[esi+0]
- mov ah,[esi+1]
- mov ebx,eax
- mov edx,eax
- and eax,BYTE 11000b ; blue
- shr eax,3
- and ebx,11100000000b ; green
- shr ebx,6
- and edx,1110000000000000b ; red
- shr edx,8
- add eax,ebx
- add eax,edx
- mov [edi],al
- add esi,BYTE 2
- inc edi
- dec ecx
- jnz .L1
-.L2
- retn
-
-.L3 mov eax,edi
- and eax,BYTE 11b
- jz .L4
- mov al,[esi+0]
- mov ah,[esi+1]
- mov ebx,eax
- mov edx,eax
- and eax,BYTE 11000b ; blue
- shr eax,3
- and ebx,11100000000b ; green
- shr ebx,6
- and edx,1110000000000000b ; red
- shr edx,8
- add eax,ebx
- add eax,edx
- mov [edi],al
- add esi,BYTE 2
- inc edi
- dec ecx
- jmp SHORT .L3
-
-.L4 ; save ebp
- push ebp
-
- ; save count
- push ecx
-
- ; unroll 4 times
- shr ecx,2
-
- ; prestep
- mov dl,[esi+0]
- mov bl,[esi+1]
- mov dh,[esi+2]
-
-.L5 shl edx,16
- mov bh,[esi+3]
-
- shl ebx,16
- mov dl,[esi+4]
-
- mov dh,[esi+6]
- mov bl,[esi+5]
-
- and edx,00011000000110000001100000011000b
- mov bh,[esi+7]
-
- ror edx,16+3
- mov eax,ebx ; setup eax for reds
-
- and ebx,00000111000001110000011100000111b
- and eax,11100000111000001110000011100000b ; reds
-
- ror ebx,16-2
- add esi,BYTE 8
-
- ror eax,16
- add edi,BYTE 4
-
- add eax,ebx
- mov bl,[esi+1] ; greens
-
- add eax,edx
- mov dl,[esi+0] ; blues
-
- mov [edi-4],eax
- mov dh,[esi+2]
-
- dec ecx
- jnz .L5
-
- ; check tail
- pop ecx
- and ecx,BYTE 11b
- jz .L7
-
-.L6 ; tail
- mov al,[esi+0]
- mov ah,[esi+1]
- mov ebx,eax
- mov edx,eax
- and eax,BYTE 11000b ; blue
- shr eax,3
- and ebx,11100000000b ; green
- shr ebx,6
- and edx,1110000000000000b ; red
- shr edx,8
- add eax,ebx
- add eax,edx
- mov [edi],al
- add esi,BYTE 2
- inc edi
- dec ecx
- jnz .L6
-
-.L7 pop ebp
- retn
-
-%ifidn __OUTPUT_FORMAT__,elf
-section .note.GNU-stack noalloc noexec nowrite progbits
-%endif
diff --git a/distrib/sdl-1.2.12/src/hermes/x86p_32.asm b/distrib/sdl-1.2.12/src/hermes/x86p_32.asm
deleted file mode 100644
index 4446c1c..0000000
--- a/distrib/sdl-1.2.12/src/hermes/x86p_32.asm
+++ /dev/null
@@ -1,1045 +0,0 @@
-;
-; x86 format converters for HERMES
-; Some routines Copyright (c) 1998 Christian Nentwich (brn@eleet.mcb.at)
-; This source code is licensed under the GNU LGPL
-;
-; Please refer to the file COPYING.LIB contained in the distribution for
-; licensing conditions
-;
-; Most routines are (c) Glenn Fiedler (ptc@gaffer.org), used with permission
-;
-
-BITS 32
-
-%include "common.inc"
-
-SDL_FUNC _ConvertX86p32_32BGR888
-SDL_FUNC _ConvertX86p32_32RGBA888
-SDL_FUNC _ConvertX86p32_32BGRA888
-SDL_FUNC _ConvertX86p32_24RGB888
-SDL_FUNC _ConvertX86p32_24BGR888
-SDL_FUNC _ConvertX86p32_16RGB565
-SDL_FUNC _ConvertX86p32_16BGR565
-SDL_FUNC _ConvertX86p32_16RGB555
-SDL_FUNC _ConvertX86p32_16BGR555
-SDL_FUNC _ConvertX86p32_8RGB332
-
-SECTION .text
-
-;; _Convert_*
-;; Paramters:
-;; ESI = source
-;; EDI = dest
-;; ECX = amount (NOT 0!!! (the _ConvertX86 routine checks for that though))
-;; Destroys:
-;; EAX, EBX, EDX
-
-
-_ConvertX86p32_32BGR888:
-
- ; check short
- cmp ecx,BYTE 32
- ja .L3
-
-.L1 ; short loop
- mov edx,[esi]
- bswap edx
- ror edx,8
- mov [edi],edx
- add esi,BYTE 4
- add edi,BYTE 4
- dec ecx
- jnz .L1
-.L2
- retn
-
-.L3 ; save ebp
- push ebp
-
- ; unroll four times
- mov ebp,ecx
- shr ebp,2
-
- ; save count
- push ecx
-
-.L4 mov eax,[esi]
- mov ebx,[esi+4]
-
- bswap eax
-
- bswap ebx
-
- ror eax,8
- mov ecx,[esi+8]
-
- ror ebx,8
- mov edx,[esi+12]
-
- bswap ecx
-
- bswap edx
-
- ror ecx,8
- mov [edi+0],eax
-
- ror edx,8
- mov [edi+4],ebx
-
- mov [edi+8],ecx
- mov [edi+12],edx
-
- add esi,BYTE 16
- add edi,BYTE 16
-
- dec ebp
- jnz .L4
-
- ; check tail
- pop ecx
- and ecx,BYTE 11b
- jz .L6
-
-.L5 ; tail loop
- mov edx,[esi]
- bswap edx
- ror edx,8
- mov [edi],edx
- add esi,BYTE 4
- add edi,BYTE 4
- dec ecx
- jnz .L5
-
-.L6 pop ebp
- retn
-
-
-
-
-_ConvertX86p32_32RGBA888:
-
- ; check short
- cmp ecx,BYTE 32
- ja .L3
-
-.L1 ; short loop
- mov edx,[esi]
- rol edx,8
- mov [edi],edx
- add esi,BYTE 4
- add edi,BYTE 4
- dec ecx
- jnz .L1
-.L2
- retn
-
-.L3 ; save ebp
- push ebp
-
- ; unroll four times
- mov ebp,ecx
- shr ebp,2
-
- ; save count
- push ecx
-
-.L4 mov eax,[esi]
- mov ebx,[esi+4]
-
- rol eax,8
- mov ecx,[esi+8]
-
- rol ebx,8
- mov edx,[esi+12]
-
- rol ecx,8
- mov [edi+0],eax
-
- rol edx,8
- mov [edi+4],ebx
-
- mov [edi+8],ecx
- mov [edi+12],edx
-
- add esi,BYTE 16
- add edi,BYTE 16
-
- dec ebp
- jnz .L4
-
- ; check tail
- pop ecx
- and ecx,BYTE 11b
- jz .L6
-
-.L5 ; tail loop
- mov edx,[esi]
- rol edx,8
- mov [edi],edx
- add esi,BYTE 4
- add edi,BYTE 4
- dec ecx
- jnz .L5
-
-.L6 pop ebp
- retn
-
-
-
-
-_ConvertX86p32_32BGRA888:
-
- ; check short
- cmp ecx,BYTE 32
- ja .L3
-
-.L1 ; short loop
- mov edx,[esi]
- bswap edx
- mov [edi],edx
- add esi,BYTE 4
- add edi,BYTE 4
- dec ecx
- jnz .L1
-.L2
- retn
-
-.L3 ; save ebp
- push ebp
-
- ; unroll four times
- mov ebp,ecx
- shr ebp,2
-
- ; save count
- push ecx
-
-.L4 mov eax,[esi]
- mov ebx,[esi+4]
-
- mov ecx,[esi+8]
- mov edx,[esi+12]
-
- bswap eax
-
- bswap ebx
-
- bswap ecx
-
- bswap edx
-
- mov [edi+0],eax
- mov [edi+4],ebx
-
- mov [edi+8],ecx
- mov [edi+12],edx
-
- add esi,BYTE 16
- add edi,BYTE 16
-
- dec ebp
- jnz .L4
-
- ; check tail
- pop ecx
- and ecx,BYTE 11b
- jz .L6
-
-.L5 ; tail loop
- mov edx,[esi]
- bswap edx
- mov [edi],edx
- add esi,BYTE 4
- add edi,BYTE 4
- dec ecx
- jnz .L5
-
-.L6 pop ebp
- retn
-
-
-
-
-;; 32 bit RGB 888 to 24 BIT RGB 888
-
-_ConvertX86p32_24RGB888:
-
- ; check short
- cmp ecx,BYTE 32
- ja .L3
-
-.L1 ; short loop
- mov al,[esi]
- mov bl,[esi+1]
- mov dl,[esi+2]
- mov [edi],al
- mov [edi+1],bl
- mov [edi+2],dl
- add esi,BYTE 4
- add edi,BYTE 3
- dec ecx
- jnz .L1
-.L2
- retn
-
-.L3 ; head
- mov edx,edi
- and edx,BYTE 11b
- jz .L4
- mov al,[esi]
- mov bl,[esi+1]
- mov dl,[esi+2]
- mov [edi],al
- mov [edi+1],bl
- mov [edi+2],dl
- add esi,BYTE 4
- add edi,BYTE 3
- dec ecx
- jmp SHORT .L3
-
-.L4 ; unroll 4 times
- push ebp
- mov ebp,ecx
- shr ebp,2
-
- ; save count
- push ecx
-
-.L5 mov eax,[esi] ; first dword eax = [A][R][G][B]
- mov ebx,[esi+4] ; second dword ebx = [a][r][g][b]
-
- shl eax,8 ; eax = [R][G][B][.]
- mov ecx,[esi+12] ; third dword ecx = [a][r][g][b]
-
- shl ebx,8 ; ebx = [r][g][b][.]
- mov al,[esi+4] ; eax = [R][G][B][b]
-
- ror eax,8 ; eax = [b][R][G][B] (done)
- mov bh,[esi+8+1] ; ebx = [r][g][G][.]
-
- mov [edi],eax
- add edi,BYTE 3*4
-
- shl ecx,8 ; ecx = [r][g][b][.]
- mov bl,[esi+8+0] ; ebx = [r][g][G][B]
-
- rol ebx,16 ; ebx = [G][B][r][g] (done)
- mov cl,[esi+8+2] ; ecx = [r][g][b][R] (done)
-
- mov [edi+4-3*4],ebx
- add esi,BYTE 4*4
-
- mov [edi+8-3*4],ecx
- dec ebp
-
- jnz .L5
-
- ; check tail
- pop ecx
- and ecx,BYTE 11b
- jz .L7
-
-.L6 ; tail loop
- mov al,[esi]
- mov bl,[esi+1]
- mov dl,[esi+2]
- mov [edi],al
- mov [edi+1],bl
- mov [edi+2],dl
- add esi,BYTE 4
- add edi,BYTE 3
- dec ecx
- jnz .L6
-
-.L7 pop ebp
- retn
-
-
-
-
-;; 32 bit RGB 888 to 24 bit BGR 888
-
-_ConvertX86p32_24BGR888:
-
- ; check short
- cmp ecx,BYTE 32
- ja .L3
-
-
-.L1 ; short loop
- mov dl,[esi]
- mov bl,[esi+1]
- mov al,[esi+2]
- mov [edi],al
- mov [edi+1],bl
- mov [edi+2],dl
- add esi,BYTE 4
- add edi,BYTE 3
- dec ecx
- jnz .L1
-.L2
- retn
-
-.L3 ; head
- mov edx,edi
- and edx,BYTE 11b
- jz .L4
- mov dl,[esi]
- mov bl,[esi+1]
- mov al,[esi+2]
- mov [edi],al
- mov [edi+1],bl
- mov [edi+2],dl
- add esi,BYTE 4
- add edi,BYTE 3
- dec ecx
- jmp SHORT .L3
-
-.L4 ; unroll 4 times
- push ebp
- mov ebp,ecx
- shr ebp,2
-
- ; save count
- push ecx
-
-.L5
- mov eax,[esi] ; first dword eax = [A][R][G][B]
- mov ebx,[esi+4] ; second dword ebx = [a][r][g][b]
-
- bswap eax ; eax = [B][G][R][A]
-
- bswap ebx ; ebx = [b][g][r][a]
-
- mov al,[esi+4+2] ; eax = [B][G][R][r]
- mov bh,[esi+4+4+1] ; ebx = [b][g][G][a]
-
- ror eax,8 ; eax = [r][B][G][R] (done)
- mov bl,[esi+4+4+2] ; ebx = [b][g][G][R]
-
- ror ebx,16 ; ebx = [G][R][b][g] (done)
- mov [edi],eax
-
- mov [edi+4],ebx
- mov ecx,[esi+12] ; third dword ecx = [a][r][g][b]
-
- bswap ecx ; ecx = [b][g][r][a]
-
- mov cl,[esi+8] ; ecx = [b][g][r][B] (done)
- add esi,BYTE 4*4
-
- mov [edi+8],ecx
- add edi,BYTE 3*4
-
- dec ebp
- jnz .L5
-
- ; check tail
- pop ecx
- and ecx,BYTE 11b
- jz .L7
-
-.L6 ; tail loop
- mov dl,[esi]
- mov bl,[esi+1]
- mov al,[esi+2]
- mov [edi],al
- mov [edi+1],bl
- mov [edi+2],dl
- add esi,BYTE 4
- add edi,BYTE 3
- dec ecx
- jnz .L6
-
-.L7
- pop ebp
- retn
-
-
-
-
-;; 32 bit RGB 888 to 16 BIT RGB 565
-
-_ConvertX86p32_16RGB565:
- ; check short
- cmp ecx,BYTE 16
- ja .L3
-
-.L1 ; short loop
- mov bl,[esi+0] ; blue
- mov al,[esi+1] ; green
- mov ah,[esi+2] ; red
- shr ah,3
- and al,11111100b
- shl eax,3
- shr bl,3
- add al,bl
- mov [edi+0],al
- mov [edi+1],ah
- add esi,BYTE 4
- add edi,BYTE 2
- dec ecx
- jnz .L1
-
-.L2: ; End of short loop
- retn
-
-
-.L3 ; head
- mov ebx,edi
- and ebx,BYTE 11b
- jz .L4
-
- mov bl,[esi+0] ; blue
- mov al,[esi+1] ; green
- mov ah,[esi+2] ; red
- shr ah,3
- and al,11111100b
- shl eax,3
- shr bl,3
- add al,bl
- mov [edi+0],al
- mov [edi+1],ah
- add esi,BYTE 4
- add edi,BYTE 2
- dec ecx
-
-.L4:
- ; save count
- push ecx
-
- ; unroll twice
- shr ecx,1
-
- ; point arrays to end
- lea esi,[esi+ecx*8]
- lea edi,[edi+ecx*4]
-
- ; negative counter
- neg ecx
- jmp SHORT .L6
-
-.L5:
- mov [edi+ecx*4-4],eax
-.L6:
- mov eax,[esi+ecx*8]
-
- shr ah,2
- mov ebx,[esi+ecx*8+4]
-
- shr eax,3
- mov edx,[esi+ecx*8+4]
-
- shr bh,2
- mov dl,[esi+ecx*8+2]
-
- shl ebx,13
- and eax,000007FFh
-
- shl edx,8
- and ebx,07FF0000h
-
- and edx,0F800F800h
- add eax,ebx
-
- add eax,edx
- inc ecx
-
- jnz .L5
-
- mov [edi+ecx*4-4],eax
-
- ; tail
- pop ecx
- test cl,1
- jz .L7
-
- mov bl,[esi+0] ; blue
- mov al,[esi+1] ; green
- mov ah,[esi+2] ; red
- shr ah,3
- and al,11111100b
- shl eax,3
- shr bl,3
- add al,bl
- mov [edi+0],al
- mov [edi+1],ah
- add esi,BYTE 4
- add edi,BYTE 2
-
-.L7:
- retn
-
-
-
-
-;; 32 bit RGB 888 to 16 BIT BGR 565
-
-_ConvertX86p32_16BGR565:
-
- ; check short
- cmp ecx,BYTE 16
- ja .L3
-
-.L1 ; short loop
- mov ah,[esi+0] ; blue
- mov al,[esi+1] ; green
- mov bl,[esi+2] ; red
- shr ah,3
- and al,11111100b
- shl eax,3
- shr bl,3
- add al,bl
- mov [edi+0],al
- mov [edi+1],ah
- add esi,BYTE 4
- add edi,BYTE 2
- dec ecx
- jnz .L1
-.L2
- retn
-
-.L3 ; head
- mov ebx,edi
- and ebx,BYTE 11b
- jz .L4
- mov ah,[esi+0] ; blue
- mov al,[esi+1] ; green
- mov bl,[esi+2] ; red
- shr ah,3
- and al,11111100b
- shl eax,3
- shr bl,3
- add al,bl
- mov [edi+0],al
- mov [edi+1],ah
- add esi,BYTE 4
- add edi,BYTE 2
- dec ecx
-
-.L4 ; save count
- push ecx
-
- ; unroll twice
- shr ecx,1
-
- ; point arrays to end
- lea esi,[esi+ecx*8]
- lea edi,[edi+ecx*4]
-
- ; negative count
- neg ecx
- jmp SHORT .L6
-
-.L5
- mov [edi+ecx*4-4],eax
-.L6
- mov edx,[esi+ecx*8+4]
-
- mov bh,[esi+ecx*8+4]
- mov ah,[esi+ecx*8]
-
- shr bh,3
- mov al,[esi+ecx*8+1]
-
- shr ah,3
- mov bl,[esi+ecx*8+5]
-
- shl eax,3
- mov dl,[esi+ecx*8+2]
-
- shl ebx,19
- and eax,0000FFE0h
-
- shr edx,3
- and ebx,0FFE00000h
-
- and edx,001F001Fh
- add eax,ebx
-
- add eax,edx
- inc ecx
-
- jnz .L5
-
- mov [edi+ecx*4-4],eax
-
- ; tail
- pop ecx
- and ecx,BYTE 1
- jz .L7
- mov ah,[esi+0] ; blue
- mov al,[esi+1] ; green
- mov bl,[esi+2] ; red
- shr ah,3
- and al,11111100b
- shl eax,3
- shr bl,3
- add al,bl
- mov [edi+0],al
- mov [edi+1],ah
- add esi,BYTE 4
- add edi,BYTE 2
-
-.L7
- retn
-
-
-
-
-;; 32 BIT RGB TO 16 BIT RGB 555
-
-_ConvertX86p32_16RGB555:
-
- ; check short
- cmp ecx,BYTE 16
- ja .L3
-
-.L1 ; short loop
- mov bl,[esi+0] ; blue
- mov al,[esi+1] ; green
- mov ah,[esi+2] ; red
- shr ah,3
- and al,11111000b
- shl eax,2
- shr bl,3
- add al,bl
- mov [edi+0],al
- mov [edi+1],ah
- add esi,BYTE 4
- add edi,BYTE 2
- dec ecx
- jnz .L1
-.L2
- retn
-
-.L3 ; head
- mov ebx,edi
- and ebx,BYTE 11b
- jz .L4
- mov bl,[esi+0] ; blue
- mov al,[esi+1] ; green
- mov ah,[esi+2] ; red
- shr ah,3
- and al,11111000b
- shl eax,2
- shr bl,3
- add al,bl
- mov [edi+0],al
- mov [edi+1],ah
- add esi,BYTE 4
- add edi,BYTE 2
- dec ecx
-
-.L4 ; save count
- push ecx
-
- ; unroll twice
- shr ecx,1
-
- ; point arrays to end
- lea esi,[esi+ecx*8]
- lea edi,[edi+ecx*4]
-
- ; negative counter
- neg ecx
- jmp SHORT .L6
-
-.L5
- mov [edi+ecx*4-4],eax
-.L6
- mov eax,[esi+ecx*8]
-
- shr ah,3
- mov ebx,[esi+ecx*8+4]
-
- shr eax,3
- mov edx,[esi+ecx*8+4]
-
- shr bh,3
- mov dl,[esi+ecx*8+2]
-
- shl ebx,13
- and eax,000007FFh
-
- shl edx,7
- and ebx,07FF0000h
-
- and edx,07C007C00h
- add eax,ebx
-
- add eax,edx
- inc ecx
-
- jnz .L5
-
- mov [edi+ecx*4-4],eax
-
- ; tail
- pop ecx
- and ecx,BYTE 1
- jz .L7
- mov bl,[esi+0] ; blue
- mov al,[esi+1] ; green
- mov ah,[esi+2] ; red
- shr ah,3
- and al,11111000b
- shl eax,2
- shr bl,3
- add al,bl
- mov [edi+0],al
- mov [edi+1],ah
- add esi,BYTE 4
- add edi,BYTE 2
-
-.L7
- retn
-
-
-
-
-;; 32 BIT RGB TO 16 BIT BGR 555
-
-_ConvertX86p32_16BGR555:
-
- ; check short
- cmp ecx,BYTE 16
- ja .L3
-
-
-.L1 ; short loop
- mov ah,[esi+0] ; blue
- mov al,[esi+1] ; green
- mov bl,[esi+2] ; red
- shr ah,3
- and al,11111000b
- shl eax,2
- shr bl,3
- add al,bl
- mov [edi+0],al
- mov [edi+1],ah
- add esi,BYTE 4
- add edi,BYTE 2
- dec ecx
- jnz .L1
-.L2
- retn
-
-.L3 ; head
- mov ebx,edi
- and ebx,BYTE 11b
- jz .L4
- mov ah,[esi+0] ; blue
- mov al,[esi+1] ; green
- mov bl,[esi+2] ; red
- shr ah,3
- and al,11111000b
- shl eax,2
- shr bl,3
- add al,bl
- mov [edi+0],al
- mov [edi+1],ah
- add esi,BYTE 4
- add edi,BYTE 2
- dec ecx
-
-.L4 ; save count
- push ecx
-
- ; unroll twice
- shr ecx,1
-
- ; point arrays to end
- lea esi,[esi+ecx*8]
- lea edi,[edi+ecx*4]
-
- ; negative counter
- neg ecx
- jmp SHORT .L6
-
-.L5
- mov [edi+ecx*4-4],eax
-.L6
- mov edx,[esi+ecx*8+4]
-
- mov bh,[esi+ecx*8+4]
- mov ah,[esi+ecx*8]
-
- shr bh,3
- mov al,[esi+ecx*8+1]
-
- shr ah,3
- mov bl,[esi+ecx*8+5]
-
- shl eax,2
- mov dl,[esi+ecx*8+2]
-
- shl ebx,18
- and eax,00007FE0h
-
- shr edx,3
- and ebx,07FE00000h
-
- and edx,001F001Fh
- add eax,ebx
-
- add eax,edx
- inc ecx
-
- jnz .L5
-
- mov [edi+ecx*4-4],eax
-
- ; tail
- pop ecx
- and ecx,BYTE 1
- jz .L7
- mov ah,[esi+0] ; blue
- mov al,[esi+1] ; green
- mov bl,[esi+2] ; red
- shr ah,3
- and al,11111000b
- shl eax,2
- shr bl,3
- add al,bl
- mov [edi+0],al
- mov [edi+1],ah
- add esi,BYTE 4
- add edi,BYTE 2
-
-.L7
- retn
-
-
-
-
-
-;; FROM 32 BIT RGB to 8 BIT RGB (rrrgggbbb)
-;; This routine writes FOUR pixels at once (dword) and then, if they exist
-;; the trailing three pixels
-_ConvertX86p32_8RGB332:
-
-
-.L_ALIGNED
- push ecx
-
- shr ecx,2 ; We will draw 4 pixels at once
- jnz .L1
-
- jmp .L2 ; short jump out of range :(
-
-.L1:
- mov eax,[esi] ; first pair of pixels
- mov edx,[esi+4]
-
- shr dl,6
- mov ebx,eax
-
- shr al,6
- and ah,0e0h
-
- shr ebx,16
- and dh,0e0h
-
- shr ah,3
- and bl,0e0h
-
- shr dh,3
-
- or al,bl
-
- mov ebx,edx
- or al,ah
-
- shr ebx,16
- or dl,dh
-
- and bl,0e0h
-
- or dl,bl
-
- mov ah,dl
-
-
-
- mov ebx,[esi+8] ; second pair of pixels
-
- mov edx,ebx
- and bh,0e0h
-
- shr bl,6
- and edx,0e00000h
-
- shr edx,16
-
- shr bh,3
-
- ror eax,16
- or bl,dl
-
- mov edx,[esi+12]
- or bl,bh
-
- mov al,bl
-
- mov ebx,edx
- and dh,0e0h
-
- shr dl,6
- and ebx,0e00000h
-
- shr dh,3
- mov ah,dl
-
- shr ebx,16
- or ah,dh
-
- or ah,bl
-
- rol eax,16
- add esi,BYTE 16
-
- mov [edi],eax
- add edi,BYTE 4
-
- dec ecx
- jz .L2 ; L1 out of range for short jump :(
-
- jmp .L1
-.L2:
-
- pop ecx
- and ecx,BYTE 3 ; mask out number of pixels to draw
-
- jz .L4 ; Nothing to do anymore
-
-.L3:
- mov eax,[esi] ; single pixel conversion for trailing pixels
-
- mov ebx,eax
-
- shr al,6
- and ah,0e0h
-
- shr ebx,16
-
- shr ah,3
- and bl,0e0h
-
- or al,ah
- or al,bl
-
- mov [edi],al
-
- inc edi
- add esi,BYTE 4
-
- dec ecx
- jnz .L3
-
-.L4:
- retn
-
-%ifidn __OUTPUT_FORMAT__,elf
-section .note.GNU-stack noalloc noexec nowrite progbits
-%endif
diff --git a/distrib/sdl-1.2.12/src/joystick/SDL_joystick.c b/distrib/sdl-1.2.12/src/joystick/SDL_joystick.c
deleted file mode 100644
index 5984a32..0000000
--- a/distrib/sdl-1.2.12/src/joystick/SDL_joystick.c
+++ /dev/null
@@ -1,573 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This is the joystick API for Simple DirectMedia Layer */
-
-#include "SDL_events.h"
-#include "SDL_sysjoystick.h"
-#include "SDL_joystick_c.h"
-#if !SDL_EVENTS_DISABLED
-#include "../events/SDL_events_c.h"
-#endif
-
-/* This is used for Quake III Arena */
-#if SDL_EVENTS_DISABLED
-#define SDL_Lock_EventThread()
-#define SDL_Unlock_EventThread()
-#endif
-
-Uint8 SDL_numjoysticks = 0;
-SDL_Joystick **SDL_joysticks = NULL;
-static SDL_Joystick *default_joystick = NULL;
-
-int SDL_JoystickInit(void)
-{
- int arraylen;
- int status;
-
- SDL_numjoysticks = 0;
- status = SDL_SYS_JoystickInit();
- if ( status >= 0 ) {
- arraylen = (status+1)*sizeof(*SDL_joysticks);
- SDL_joysticks = (SDL_Joystick **)SDL_malloc(arraylen);
- if ( SDL_joysticks == NULL ) {
- SDL_numjoysticks = 0;
- } else {
- SDL_memset(SDL_joysticks, 0, arraylen);
- SDL_numjoysticks = status;
- }
- status = 0;
- }
- default_joystick = NULL;
- return(status);
-}
-
-/*
- * Count the number of joysticks attached to the system
- */
-int SDL_NumJoysticks(void)
-{
- return SDL_numjoysticks;
-}
-
-/*
- * Get the implementation dependent name of a joystick
- */
-const char *SDL_JoystickName(int device_index)
-{
- if ( (device_index < 0) || (device_index >= SDL_numjoysticks) ) {
- SDL_SetError("There are %d joysticks available",
- SDL_numjoysticks);
- return(NULL);
- }
- return(SDL_SYS_JoystickName(device_index));
-}
-
-/*
- * Open a joystick for use - the index passed as an argument refers to
- * the N'th joystick on the system. This index is the value which will
- * identify this joystick in future joystick events.
- *
- * This function returns a joystick identifier, or NULL if an error occurred.
- */
-SDL_Joystick *SDL_JoystickOpen(int device_index)
-{
- int i;
- SDL_Joystick *joystick;
-
- if ( (device_index < 0) || (device_index >= SDL_numjoysticks) ) {
- SDL_SetError("There are %d joysticks available",
- SDL_numjoysticks);
- return(NULL);
- }
-
- /* If the joystick is already open, return it */
- for ( i=0; SDL_joysticks[i]; ++i ) {
- if ( device_index == SDL_joysticks[i]->index ) {
- joystick = SDL_joysticks[i];
- ++joystick->ref_count;
- return(joystick);
- }
- }
-
- /* Create and initialize the joystick */
- joystick = (SDL_Joystick *)SDL_malloc((sizeof *joystick));
- if ( joystick != NULL ) {
- SDL_memset(joystick, 0, (sizeof *joystick));
- joystick->index = device_index;
- if ( SDL_SYS_JoystickOpen(joystick) < 0 ) {
- SDL_free(joystick);
- joystick = NULL;
- } else {
- if ( joystick->naxes > 0 ) {
- joystick->axes = (Sint16 *)SDL_malloc
- (joystick->naxes*sizeof(Sint16));
- }
- if ( joystick->nhats > 0 ) {
- joystick->hats = (Uint8 *)SDL_malloc
- (joystick->nhats*sizeof(Uint8));
- }
- if ( joystick->nballs > 0 ) {
- joystick->balls = (struct balldelta *)SDL_malloc
- (joystick->nballs*sizeof(*joystick->balls));
- }
- if ( joystick->nbuttons > 0 ) {
- joystick->buttons = (Uint8 *)SDL_malloc
- (joystick->nbuttons*sizeof(Uint8));
- }
- if ( ((joystick->naxes > 0) && !joystick->axes)
- || ((joystick->nhats > 0) && !joystick->hats)
- || ((joystick->nballs > 0) && !joystick->balls)
- || ((joystick->nbuttons > 0) && !joystick->buttons)) {
- SDL_OutOfMemory();
- SDL_JoystickClose(joystick);
- joystick = NULL;
- }
- if ( joystick->axes ) {
- SDL_memset(joystick->axes, 0,
- joystick->naxes*sizeof(Sint16));
- }
- if ( joystick->hats ) {
- SDL_memset(joystick->hats, 0,
- joystick->nhats*sizeof(Uint8));
- }
- if ( joystick->balls ) {
- SDL_memset(joystick->balls, 0,
- joystick->nballs*sizeof(*joystick->balls));
- }
- if ( joystick->buttons ) {
- SDL_memset(joystick->buttons, 0,
- joystick->nbuttons*sizeof(Uint8));
- }
- }
- }
- if ( joystick ) {
- /* Add joystick to list */
- ++joystick->ref_count;
- SDL_Lock_EventThread();
- for ( i=0; SDL_joysticks[i]; ++i )
- /* Skip to next joystick */;
- SDL_joysticks[i] = joystick;
- SDL_Unlock_EventThread();
- }
- return(joystick);
-}
-
-/*
- * Returns 1 if the joystick has been opened, or 0 if it has not.
- */
-int SDL_JoystickOpened(int device_index)
-{
- int i, opened;
-
- opened = 0;
- for ( i=0; SDL_joysticks[i]; ++i ) {
- if ( SDL_joysticks[i]->index == (Uint8)device_index ) {
- opened = 1;
- break;
- }
- }
- return(opened);
-}
-
-static int ValidJoystick(SDL_Joystick **joystick)
-{
- int valid;
-
- if ( *joystick == NULL ) {
- *joystick = default_joystick;
- }
- if ( *joystick == NULL ) {
- SDL_SetError("Joystick hasn't been opened yet");
- valid = 0;
- } else {
- valid = 1;
- }
- return valid;
-}
-
-/*
- * Get the device index of an opened joystick.
- */
-int SDL_JoystickIndex(SDL_Joystick *joystick)
-{
- if ( ! ValidJoystick(&joystick) ) {
- return(-1);
- }
- return(joystick->index);
-}
-
-/*
- * Get the number of multi-dimensional axis controls on a joystick
- */
-int SDL_JoystickNumAxes(SDL_Joystick *joystick)
-{
- if ( ! ValidJoystick(&joystick) ) {
- return(-1);
- }
- return(joystick->naxes);
-}
-
-/*
- * Get the number of hats on a joystick
- */
-int SDL_JoystickNumHats(SDL_Joystick *joystick)
-{
- if ( ! ValidJoystick(&joystick) ) {
- return(-1);
- }
- return(joystick->nhats);
-}
-
-/*
- * Get the number of trackballs on a joystick
- */
-int SDL_JoystickNumBalls(SDL_Joystick *joystick)
-{
- if ( ! ValidJoystick(&joystick) ) {
- return(-1);
- }
- return(joystick->nballs);
-}
-
-/*
- * Get the number of buttons on a joystick
- */
-int SDL_JoystickNumButtons(SDL_Joystick *joystick)
-{
- if ( ! ValidJoystick(&joystick) ) {
- return(-1);
- }
- return(joystick->nbuttons);
-}
-
-/*
- * Get the current state of an axis control on a joystick
- */
-Sint16 SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis)
-{
- Sint16 state;
-
- if ( ! ValidJoystick(&joystick) ) {
- return(0);
- }
- if ( axis < joystick->naxes ) {
- state = joystick->axes[axis];
- } else {
- SDL_SetError("Joystick only has %d axes", joystick->naxes);
- state = 0;
- }
- return(state);
-}
-
-/*
- * Get the current state of a hat on a joystick
- */
-Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat)
-{
- Uint8 state;
-
- if ( ! ValidJoystick(&joystick) ) {
- return(0);
- }
- if ( hat < joystick->nhats ) {
- state = joystick->hats[hat];
- } else {
- SDL_SetError("Joystick only has %d hats", joystick->nhats);
- state = 0;
- }
- return(state);
-}
-
-/*
- * Get the ball axis change since the last poll
- */
-int SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy)
-{
- int retval;
-
- if ( ! ValidJoystick(&joystick) ) {
- return(-1);
- }
-
- retval = 0;
- if ( ball < joystick->nballs ) {
- if ( dx ) {
- *dx = joystick->balls[ball].dx;
- }
- if ( dy ) {
- *dy = joystick->balls[ball].dy;
- }
- joystick->balls[ball].dx = 0;
- joystick->balls[ball].dy = 0;
- } else {
- SDL_SetError("Joystick only has %d balls", joystick->nballs);
- retval = -1;
- }
- return(retval);
-}
-
-/*
- * Get the current state of a button on a joystick
- */
-Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button)
-{
- Uint8 state;
-
- if ( ! ValidJoystick(&joystick) ) {
- return(0);
- }
- if ( button < joystick->nbuttons ) {
- state = joystick->buttons[button];
- } else {
- SDL_SetError("Joystick only has %d buttons",joystick->nbuttons);
- state = 0;
- }
- return(state);
-}
-
-/*
- * Close a joystick previously opened with SDL_JoystickOpen()
- */
-void SDL_JoystickClose(SDL_Joystick *joystick)
-{
- int i;
-
- if ( ! ValidJoystick(&joystick) ) {
- return;
- }
-
- /* First decrement ref count */
- if ( --joystick->ref_count > 0 ) {
- return;
- }
-
- /* Lock the event queue - prevent joystick polling */
- SDL_Lock_EventThread();
-
- if ( joystick == default_joystick ) {
- default_joystick = NULL;
- }
- SDL_SYS_JoystickClose(joystick);
-
- /* Remove joystick from list */
- for ( i=0; SDL_joysticks[i]; ++i ) {
- if ( joystick == SDL_joysticks[i] ) {
- SDL_memcpy(&SDL_joysticks[i], &SDL_joysticks[i+1],
- (SDL_numjoysticks-i)*sizeof(joystick));
- break;
- }
- }
-
- /* Let the event thread keep running */
- SDL_Unlock_EventThread();
-
- /* Free the data associated with this joystick */
- if ( joystick->axes ) {
- SDL_free(joystick->axes);
- }
- if ( joystick->hats ) {
- SDL_free(joystick->hats);
- }
- if ( joystick->balls ) {
- SDL_free(joystick->balls);
- }
- if ( joystick->buttons ) {
- SDL_free(joystick->buttons);
- }
- SDL_free(joystick);
-}
-
-void SDL_JoystickQuit(void)
-{
- /* Stop the event polling */
- SDL_Lock_EventThread();
- SDL_numjoysticks = 0;
- SDL_Unlock_EventThread();
-
- /* Quit the joystick setup */
- SDL_SYS_JoystickQuit();
- if ( SDL_joysticks ) {
- SDL_free(SDL_joysticks);
- SDL_joysticks = NULL;
- }
-}
-
-
-/* These are global for SDL_sysjoystick.c and SDL_events.c */
-
-int SDL_PrivateJoystickAxis(SDL_Joystick *joystick, Uint8 axis, Sint16 value)
-{
- int posted;
-
- /* Update internal joystick state */
- joystick->axes[axis] = value;
-
- /* Post the event, if desired */
- posted = 0;
-#if !SDL_EVENTS_DISABLED
- if ( SDL_ProcessEvents[SDL_JOYAXISMOTION] == SDL_ENABLE ) {
- SDL_Event event;
- event.type = SDL_JOYAXISMOTION;
- event.jaxis.which = joystick->index;
- event.jaxis.axis = axis;
- event.jaxis.value = value;
- if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
- posted = 1;
- SDL_PushEvent(&event);
- }
- }
-#endif /* !SDL_EVENTS_DISABLED */
- return(posted);
-}
-
-int SDL_PrivateJoystickHat(SDL_Joystick *joystick, Uint8 hat, Uint8 value)
-{
- int posted;
-
- /* Update internal joystick state */
- joystick->hats[hat] = value;
-
- /* Post the event, if desired */
- posted = 0;
-#if !SDL_EVENTS_DISABLED
- if ( SDL_ProcessEvents[SDL_JOYHATMOTION] == SDL_ENABLE ) {
- SDL_Event event;
- event.jhat.type = SDL_JOYHATMOTION;
- event.jhat.which = joystick->index;
- event.jhat.hat = hat;
- event.jhat.value = value;
- if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
- posted = 1;
- SDL_PushEvent(&event);
- }
- }
-#endif /* !SDL_EVENTS_DISABLED */
- return(posted);
-}
-
-int SDL_PrivateJoystickBall(SDL_Joystick *joystick, Uint8 ball,
- Sint16 xrel, Sint16 yrel)
-{
- int posted;
-
- /* Update internal mouse state */
- joystick->balls[ball].dx += xrel;
- joystick->balls[ball].dy += yrel;
-
- /* Post the event, if desired */
- posted = 0;
-#if !SDL_EVENTS_DISABLED
- if ( SDL_ProcessEvents[SDL_JOYBALLMOTION] == SDL_ENABLE ) {
- SDL_Event event;
- event.jball.type = SDL_JOYBALLMOTION;
- event.jball.which = joystick->index;
- event.jball.ball = ball;
- event.jball.xrel = xrel;
- event.jball.yrel = yrel;
- if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
- posted = 1;
- SDL_PushEvent(&event);
- }
- }
-#endif /* !SDL_EVENTS_DISABLED */
- return(posted);
-}
-
-int SDL_PrivateJoystickButton(SDL_Joystick *joystick, Uint8 button, Uint8 state)
-{
- int posted;
-#if !SDL_EVENTS_DISABLED
- SDL_Event event;
-
- switch ( state ) {
- case SDL_PRESSED:
- event.type = SDL_JOYBUTTONDOWN;
- break;
- case SDL_RELEASED:
- event.type = SDL_JOYBUTTONUP;
- break;
- default:
- /* Invalid state -- bail */
- return(0);
- }
-#endif /* !SDL_EVENTS_DISABLED */
-
- /* Update internal joystick state */
- joystick->buttons[button] = state;
-
- /* Post the event, if desired */
- posted = 0;
-#if !SDL_EVENTS_DISABLED
- if ( SDL_ProcessEvents[event.type] == SDL_ENABLE ) {
- event.jbutton.which = joystick->index;
- event.jbutton.button = button;
- event.jbutton.state = state;
- if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
- posted = 1;
- SDL_PushEvent(&event);
- }
- }
-#endif /* !SDL_EVENTS_DISABLED */
- return(posted);
-}
-
-void SDL_JoystickUpdate(void)
-{
- int i;
-
- for ( i=0; SDL_joysticks[i]; ++i ) {
- SDL_SYS_JoystickUpdate(SDL_joysticks[i]);
- }
-}
-
-int SDL_JoystickEventState(int state)
-{
-#if SDL_EVENTS_DISABLED
- return SDL_IGNORE;
-#else
- const Uint8 event_list[] = {
- SDL_JOYAXISMOTION, SDL_JOYBALLMOTION, SDL_JOYHATMOTION,
- SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP,
- };
- unsigned int i;
-
- switch (state) {
- case SDL_QUERY:
- state = SDL_IGNORE;
- for ( i=0; i<SDL_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 */
-}
diff --git a/distrib/sdl-1.2.12/src/joystick/SDL_joystick_c.h b/distrib/sdl-1.2.12/src/joystick/SDL_joystick_c.h
deleted file mode 100644
index 2cb1e3b..0000000
--- a/distrib/sdl-1.2.12/src/joystick/SDL_joystick_c.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Useful functions and variables from SDL_joystick.c */
-#include "SDL_joystick.h"
-
-/* The number of available joysticks on the system */
-extern Uint8 SDL_numjoysticks;
-
-/* Internal event queueing functions */
-extern int SDL_PrivateJoystickAxis(SDL_Joystick *joystick,
- Uint8 axis, Sint16 value);
-extern int SDL_PrivateJoystickBall(SDL_Joystick *joystick,
- Uint8 ball, Sint16 xrel, Sint16 yrel);
-extern int SDL_PrivateJoystickHat(SDL_Joystick *joystick,
- Uint8 hat, Uint8 value);
-extern int SDL_PrivateJoystickButton(SDL_Joystick *joystick,
- Uint8 button, Uint8 state);
diff --git a/distrib/sdl-1.2.12/src/joystick/SDL_sysjoystick.h b/distrib/sdl-1.2.12/src/joystick/SDL_sysjoystick.h
deleted file mode 100644
index 16c534c..0000000
--- a/distrib/sdl-1.2.12/src/joystick/SDL_sysjoystick.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is SDL_free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This is the system specific header for the SDL joystick API */
-
-#include "SDL_joystick.h"
-
-/* The SDL joystick structure */
-struct _SDL_Joystick {
- Uint8 index; /* Device index */
- const char *name; /* Joystick name - system dependent */
-
- int naxes; /* Number of axis controls on the joystick */
- Sint16 *axes; /* Current axis states */
-
- int nhats; /* Number of hats on the joystick */
- Uint8 *hats; /* Current hat states */
-
- int nballs; /* Number of trackballs on the joystick */
- struct balldelta {
- int dx;
- int dy;
- } *balls; /* Current ball motion deltas */
-
- int nbuttons; /* Number of buttons on the joystick */
- Uint8 *buttons; /* Current button states */
-
- struct joystick_hwdata *hwdata; /* Driver dependent information */
-
- int ref_count; /* Reference count for multiple opens */
-};
-
-/* Function to scan the system for joysticks.
- * Joystick 0 should be the system default joystick.
- * This function should return the number of available joysticks, or -1
- * on an unrecoverable fatal error.
- */
-extern int SDL_SYS_JoystickInit(void);
-
-/* Function to get the device-dependent name of a joystick */
-extern const char *SDL_SYS_JoystickName(int index);
-
-/* Function to open a joystick for use.
- The joystick to open is specified by the index field of the joystick.
- This should fill the nbuttons and naxes fields of the joystick structure.
- It returns 0, or -1 if there is an error.
- */
-extern int SDL_SYS_JoystickOpen(SDL_Joystick *joystick);
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-extern void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick);
-
-/* Function to close a joystick after use */
-extern void SDL_SYS_JoystickClose(SDL_Joystick *joystick);
-
-/* Function to perform any system-specific joystick related cleanup */
-extern void SDL_SYS_JoystickQuit(void);
-
diff --git a/distrib/sdl-1.2.12/src/joystick/amigaos/SDL_sysjoystick.c b/distrib/sdl-1.2.12/src/joystick/amigaos/SDL_sysjoystick.c
deleted file mode 100644
index 35e4ebe..0000000
--- a/distrib/sdl-1.2.12/src/joystick/amigaos/SDL_sysjoystick.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_JOYSTICK_AMIGA
-
-/* This is the system specific header for the SDL joystick API */
-
-#include <libraries/lowlevel.h>
-#if defined(__SASC) || defined(STORMC4_WOS)
-#include <proto/exec.h>
-#include <proto/lowlevel.h>
-#include <proto/graphics.h>
-#else
-#include <inline/exec.h>
-#include <inline/lowlevel.h>
-#include <inline/graphics.h>
-#endif
-#include "mydebug.h"
-
-extern struct ExecBase *SysBase;
-extern struct GfxBase *GfxBase;
-
-#include "SDL_joystick.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-
-/* Function to scan the system for joysticks.
- * This function should set SDL_numjoysticks to the number of available
- * joysticks. Joystick 0 should be the system default joystick.
- * It should return 0, or -1 on an unrecoverable fatal error.
- */
-
-
-/* Amiga specific datas */
-struct Library *LowLevelBase=NULL;
-
-ULONG joybut[]=
-{
- JPF_BUTTON_RED,
- JPF_BUTTON_BLUE,
- JPF_BUTTON_PLAY,
- JPF_BUTTON_YELLOW,
- JPF_BUTTON_GREEN,
- JPF_BUTTON_FORWARD,
- JPF_BUTTON_REVERSE,
-};
-
-struct joystick_hwdata
-{
- ULONG joystate;
-};
-
-int SDL_SYS_JoystickInit(void)
-{
- if(!LowLevelBase)
- {
- if(LowLevelBase=OpenLibrary("lowlevel.library",37))
- return 2;
- }
- else
- return 2;
-
- D(bug("%ld joysticks available.\n",SDL_numjoysticks));
-
- return 0;
-}
-
-/* Function to get the device-dependent name of a joystick */
-const char *SDL_SYS_JoystickName(int index)
-{
- if(index<2&&LowLevelBase)
- {
- switch(index)
- {
- case 0:
- return "Port 1 Amiga Joystick/Joypad";
- case 1:
- return "Port 2 Amiga Joystick/Joypad";
- }
- }
-
- SDL_SetError("No joystick available with that index");
- return(NULL);
-}
-
-/* Function to open a joystick for use.
- The joystick to open is specified by the index field of the joystick.
- This should fill the nbuttons and naxes fields of the joystick structure.
- It returns 0, or -1 if there is an error.
- */
-
-int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
-{
- ULONG temp,i;
- D(bug("Opening joystick %ld\n",joystick->index));
-
- if(!(joystick->hwdata=SDL_malloc(sizeof(struct joystick_hwdata))))
- return -1;
-
-/* This loop is to check if the controller is a joypad */
-
- for(i=0;i<20;i++)
- {
- temp=ReadJoyPort(joystick->index^1); // fix to invert amiga joyports
- WaitTOF();
- }
-
- if((temp&JP_TYPE_MASK)==JP_TYPE_GAMECTLR)
- joystick->nbuttons=7;
- else
- joystick->nbuttons=3;
-
- joystick->nhats=0;
- joystick->nballs=0;
- joystick->naxes=2;
- joystick->hwdata->joystate=0L;
-
- return 0;
-}
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
-{
- ULONG data;
- int i;
-
- if(joystick->index<2)
- {
- data=ReadJoyPort(joystick->index);
-
- if(data&JP_DIRECTION_MASK)
- {
- if(data&JPF_JOY_DOWN)
- {
- if(!(joystick->hwdata->joystate&JPF_JOY_DOWN))
- SDL_PrivateJoystickAxis(joystick,0,127);
- }
- else if(data&JPF_JOY_UP)
- {
- if(!(joystick->hwdata->joystate&JPF_JOY_UP))
- SDL_PrivateJoystickAxis(joystick,0,-127);
- }
- else if(joystick->hwdata->joystate&(JPF_JOY_UP|JPF_JOY_DOWN))
- SDL_PrivateJoystickAxis(joystick,0,0);
-
- if(data&JPF_JOY_LEFT)
- {
- if(!(joystick->hwdata->joystate&JPF_JOY_LEFT))
- SDL_PrivateJoystickAxis(joystick,1,-127);
- }
- else if(data&JPF_JOY_RIGHT)
- {
- if(!(joystick->hwdata->joystate&JPF_JOY_RIGHT))
- SDL_PrivateJoystickAxis(joystick,1,127);
- }
- else if(joystick->hwdata->joystate&(JPF_JOY_LEFT|JPF_JOY_RIGHT))
- SDL_PrivateJoystickAxis(joystick,1,0);
- }
- else if(joystick->hwdata->joystate&(JPF_JOY_LEFT|JPF_JOY_RIGHT))
- {
- SDL_PrivateJoystickAxis(joystick,1,0);
- }
- else if(joystick->hwdata->joystate&(JPF_JOY_UP|JPF_JOY_DOWN))
- {
- SDL_PrivateJoystickAxis(joystick,0,0);
- }
-
- for(i=0;i<joystick->nbuttons;i++)
- {
- if( (data&joybut[i]) )
- {
- if(i==1)
- data&=(~(joybut[2]));
-
- if(!(joystick->hwdata->joystate&joybut[i]))
- SDL_PrivateJoystickButton(joystick,i,SDL_PRESSED);
- }
- else if(joystick->hwdata->joystate&joybut[i])
- SDL_PrivateJoystickButton(joystick,i,SDL_RELEASED);
- }
-
- joystick->hwdata->joystate=data;
- }
-
- return;
-}
-
-/* Function to close a joystick after use */
-void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
-{
- if(joystick->hwdata)
- SDL_free(joystick->hwdata);
- return;
-}
-
-/* Function to perform any system-specific joystick related cleanup */
-
-void SDL_SYS_JoystickQuit(void)
-{
- if(LowLevelBase)
- {
- CloseLibrary(LowLevelBase);
- LowLevelBase=NULL;
- SDL_numjoysticks=0;
- }
- return;
-}
-
-#endif /* SDL_JOYSTICK_AMIGA */
diff --git a/distrib/sdl-1.2.12/src/joystick/beos/SDL_bejoystick.cc b/distrib/sdl-1.2.12/src/joystick/beos/SDL_bejoystick.cc
deleted file mode 100644
index 7c52b86..0000000
--- a/distrib/sdl-1.2.12/src/joystick/beos/SDL_bejoystick.cc
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_JOYSTICK_BEOS
-
-/* This is the system specific header for the SDL joystick API */
-
-#include <be/support/String.h>
-#include <be/device/Joystick.h>
-
-extern "C" {
-
-#include "SDL_joystick.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-
-
-/* The maximum number of joysticks we'll detect */
-#define MAX_JOYSTICKS 16
-
-/* A list of available joysticks */
-static char *SDL_joyport[MAX_JOYSTICKS];
-static char *SDL_joyname[MAX_JOYSTICKS];
-
-/* The private structure used to keep track of a joystick */
-struct joystick_hwdata {
- BJoystick *stick;
- uint8 *new_hats;
- int16 *new_axes;
-};
-
-/* Function to scan the system for joysticks.
- * This function should set SDL_numjoysticks to the number of available
- * joysticks. Joystick 0 should be the system default joystick.
- * It should return 0, or -1 on an unrecoverable fatal error.
- */
-int SDL_SYS_JoystickInit(void)
-{
- BJoystick joystick;
- int numjoysticks;
- int i;
- int32 nports;
- char name[B_OS_NAME_LENGTH];
-
- /* Search for attached joysticks */
- nports = joystick.CountDevices();
- numjoysticks = 0;
- SDL_memset(SDL_joyport, 0, (sizeof SDL_joyport));
- SDL_memset(SDL_joyname, 0, (sizeof SDL_joyname));
- for ( i=0; (SDL_numjoysticks < MAX_JOYSTICKS) && (i < nports); ++i ) {
- if ( joystick.GetDeviceName(i, name) == B_OK ) {
- if ( joystick.Open(name) != B_ERROR ) {
- BString stick_name;
- joystick.GetControllerName(&stick_name);
- SDL_joyport[numjoysticks] = strdup(name);
- SDL_joyname[numjoysticks] =
- strdup(stick_name.String());
- numjoysticks++;
- joystick.Close();
- }
- }
- }
- return(numjoysticks);
-}
-
-/* Function to get the device-dependent name of a joystick */
-const char *SDL_SYS_JoystickName(int index)
-{
- return SDL_joyname[index];
-}
-
-/* Function to open a joystick for use.
- The joystick to open is specified by the index field of the joystick.
- This should fill the nbuttons and naxes fields of the joystick structure.
- It returns 0, or -1 if there is an error.
- */
-int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
-{
- BJoystick *stick;
-
- /* Create the joystick data structure */
- joystick->hwdata = (struct joystick_hwdata *)
- SDL_malloc(sizeof(*joystick->hwdata));
- if ( joystick->hwdata == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
- SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
- stick = new BJoystick;
- joystick->hwdata->stick = stick;
-
- /* Open the requested joystick for use */
- if ( stick->Open(SDL_joyport[joystick->index]) == B_ERROR ) {
- SDL_SetError("Unable to open joystick");
- SDL_SYS_JoystickClose(joystick);
- return(-1);
- }
-
- /* Set the joystick to calibrated mode */
- stick->EnableCalibration();
-
- /* Get the number of buttons, hats, and axes on the joystick */
- joystick->nbuttons = stick->CountButtons();
- joystick->naxes = stick->CountAxes();
- joystick->nhats = stick->CountHats();
-
- joystick->hwdata->new_axes = (int16 *)
- SDL_malloc(joystick->naxes*sizeof(int16));
- joystick->hwdata->new_hats = (uint8 *)
- SDL_malloc(joystick->nhats*sizeof(uint8));
- if ( ! joystick->hwdata->new_hats || ! joystick->hwdata->new_axes ) {
- SDL_OutOfMemory();
- SDL_SYS_JoystickClose(joystick);
- return(-1);
- }
-
- /* We're done! */
- return(0);
-}
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
-{
- static const Uint8 hat_map[9] = {
- SDL_HAT_CENTERED,
- SDL_HAT_UP,
- SDL_HAT_RIGHTUP,
- SDL_HAT_RIGHT,
- SDL_HAT_RIGHTDOWN,
- SDL_HAT_DOWN,
- SDL_HAT_LEFTDOWN,
- SDL_HAT_LEFT,
- SDL_HAT_LEFTUP
- };
- const int JITTER = (32768/10); /* 10% jitter threshold (ok?) */
-
- BJoystick *stick;
- int i, change;
- int16 *axes;
- uint8 *hats;
- uint32 buttons;
-
- /* Set up data pointers */
- stick = joystick->hwdata->stick;
- axes = joystick->hwdata->new_axes;
- hats = joystick->hwdata->new_hats;
-
- /* Get the new joystick state */
- stick->Update();
- stick->GetAxisValues(axes);
- stick->GetHatValues(hats);
- buttons = stick->ButtonValues();
-
- /* Generate axis motion events */
- for ( i=0; i<joystick->naxes; ++i ) {
- change = ((int32)axes[i] - joystick->axes[i]);
- if ( (change > JITTER) || (change < -JITTER) ) {
- SDL_PrivateJoystickAxis(joystick, i, axes[i]);
- }
- }
-
- /* Generate hat change events */
- for ( i=0; i<joystick->nhats; ++i ) {
- if ( hats[i] != joystick->hats[i] ) {
- SDL_PrivateJoystickHat(joystick, i, hat_map[hats[i]]);
- }
- }
-
- /* Generate button events */
- for ( i=0; i<joystick->nbuttons; ++i ) {
- if ( (buttons&0x01) != joystick->buttons[i] ) {
- SDL_PrivateJoystickButton(joystick, i, (buttons&0x01));
- }
- buttons >>= 1;
- }
-}
-
-/* Function to close a joystick after use */
-void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
-{
- if ( joystick->hwdata ) {
- joystick->hwdata->stick->Close();
- delete joystick->hwdata->stick;
- if ( joystick->hwdata->new_hats ) {
- SDL_free(joystick->hwdata->new_hats);
- }
- if ( joystick->hwdata->new_axes ) {
- SDL_free(joystick->hwdata->new_axes);
- }
- SDL_free(joystick->hwdata);
- joystick->hwdata = NULL;
- }
-}
-
-/* Function to perform any system-specific joystick related cleanup */
-void SDL_SYS_JoystickQuit(void)
-{
- int i;
-
- for ( i=0; SDL_joyport[i]; ++i ) {
- SDL_free(SDL_joyport[i]);
- }
- SDL_joyport[0] = NULL;
-
- for ( i=0; SDL_joyname[i]; ++i ) {
- SDL_free(SDL_joyname[i]);
- }
- SDL_joyname[0] = NULL;
-}
-
-}; // extern "C"
-
-#endif /* SDL_JOYSTICK_BEOS */
diff --git a/distrib/sdl-1.2.12/src/joystick/bsd/SDL_sysjoystick.c b/distrib/sdl-1.2.12/src/joystick/bsd/SDL_sysjoystick.c
deleted file mode 100644
index 926899d..0000000
--- a/distrib/sdl-1.2.12/src/joystick/bsd/SDL_sysjoystick.c
+++ /dev/null
@@ -1,591 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_JOYSTICK_USBHID
-
-/*
- * Joystick driver for the uhid(4) interface found in OpenBSD,
- * NetBSD and FreeBSD.
- *
- * Maintainer: <vedge at csoft.org>
- */
-
-#include <sys/param.h>
-
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-
-#if defined(HAVE_USB_H)
-#include <usb.h>
-#endif
-#ifdef __DragonFly__
-#include <bus/usb/usb.h>
-#include <bus/usb/usbhid.h>
-#else
-#include <dev/usb/usb.h>
-#include <dev/usb/usbhid.h>
-#endif
-
-#if defined(HAVE_USBHID_H)
-#include <usbhid.h>
-#elif defined(HAVE_LIBUSB_H)
-#include <libusb.h>
-#elif defined(HAVE_LIBUSBHID_H)
-#include <libusbhid.h>
-#endif
-
-#ifdef __FREEBSD__
-#ifndef __DragonFly__
-#include <osreldate.h>
-#endif
-#include <sys/joystick.h>
-#endif
-
-#if SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
-#include <machine/joystick.h>
-#endif
-
-#include "SDL_joystick.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-
-#define MAX_UHID_JOYS 4
-#define MAX_JOY_JOYS 2
-#define MAX_JOYS (MAX_UHID_JOYS + MAX_JOY_JOYS)
-
-struct report {
- struct usb_ctl_report *buf; /* Buffer */
- size_t size; /* Buffer size */
- int rid; /* Report ID */
- enum {
- SREPORT_UNINIT,
- SREPORT_CLEAN,
- SREPORT_DIRTY
- } status;
-};
-
-static struct {
- int uhid_report;
- hid_kind_t kind;
- const char *name;
-} const repinfo[] = {
- { UHID_INPUT_REPORT, hid_input, "input" },
- { UHID_OUTPUT_REPORT, hid_output, "output" },
- { UHID_FEATURE_REPORT, hid_feature, "feature" }
-};
-
-enum {
- REPORT_INPUT = 0,
- REPORT_OUTPUT = 1,
- REPORT_FEATURE = 2
-};
-
-enum {
- JOYAXE_X,
- JOYAXE_Y,
- JOYAXE_Z,
- JOYAXE_SLIDER,
- JOYAXE_WHEEL,
- JOYAXE_RX,
- JOYAXE_RY,
- JOYAXE_RZ,
- JOYAXE_count
-};
-
-struct joystick_hwdata {
- int fd;
- char *path;
- enum {
- BSDJOY_UHID, /* uhid(4) */
- BSDJOY_JOY /* joy(4) */
- } type;
- struct report_desc *repdesc;
- struct report inreport;
- int axis_map[JOYAXE_count]; /* map present JOYAXE_* to 0,1,..*/
- int x;
- int y;
- int xmin;
- int ymin;
- int xmax;
- int ymax;
-};
-
-static char *joynames[MAX_JOYS];
-static char *joydevnames[MAX_JOYS];
-
-static int report_alloc(struct report *, struct report_desc *, int);
-static void report_free(struct report *);
-
-#ifdef USBHID_UCR_DATA
-#define REP_BUF_DATA(rep) ((rep)->buf->ucr_data)
-#else
-#define REP_BUF_DATA(rep) ((rep)->buf->data)
-#endif
-
-int
-SDL_SYS_JoystickInit(void)
-{
- char s[16];
- int i, fd;
-
- SDL_numjoysticks = 0;
-
- SDL_memset(joynames, 0, sizeof(joynames));
- SDL_memset(joydevnames, 0, sizeof(joydevnames));
-
- for (i = 0; i < MAX_UHID_JOYS; i++) {
- SDL_Joystick nj;
-
- SDL_snprintf(s, SDL_arraysize(s), "/dev/uhid%d", i);
-
- nj.index = SDL_numjoysticks;
- joynames[nj.index] = strdup(s);
-
- if (SDL_SYS_JoystickOpen(&nj) == 0) {
- SDL_SYS_JoystickClose(&nj);
- SDL_numjoysticks++;
- } else {
- SDL_free(joynames[nj.index]);
- joynames[nj.index] = NULL;
- }
- }
- for (i = 0; i < MAX_JOY_JOYS; i++) {
- SDL_snprintf(s, SDL_arraysize(s), "/dev/joy%d", i);
- fd = open(s, O_RDONLY);
- if (fd != -1) {
- joynames[SDL_numjoysticks++] = strdup(s);
- close(fd);
- }
- }
-
- /* Read the default USB HID usage table. */
- hid_init(NULL);
-
- return (SDL_numjoysticks);
-}
-
-const char *
-SDL_SYS_JoystickName(int index)
-{
- if (joydevnames[index] != NULL) {
- return (joydevnames[index]);
- }
- return (joynames[index]);
-}
-
-static int
-usage_to_joyaxe(unsigned usage)
-{
- int joyaxe;
- switch (usage) {
- case HUG_X:
- joyaxe = JOYAXE_X; break;
- case HUG_Y:
- joyaxe = JOYAXE_Y; break;
- case HUG_Z:
- joyaxe = JOYAXE_Z; break;
- case HUG_SLIDER:
- joyaxe = JOYAXE_SLIDER; break;
- case HUG_WHEEL:
- joyaxe = JOYAXE_WHEEL; break;
- case HUG_RX:
- joyaxe = JOYAXE_RX; break;
- case HUG_RY:
- joyaxe = JOYAXE_RY; break;
- case HUG_RZ:
- joyaxe = JOYAXE_RZ; break;
- default:
- joyaxe = -1;
- }
- return joyaxe;
-}
-
-static unsigned
-hatval_to_sdl(Sint32 hatval)
-{
- static const unsigned hat_dir_map[8] = {
- SDL_HAT_UP, SDL_HAT_RIGHTUP, SDL_HAT_RIGHT, SDL_HAT_RIGHTDOWN,
- SDL_HAT_DOWN, SDL_HAT_LEFTDOWN, SDL_HAT_LEFT, SDL_HAT_LEFTUP
- };
- unsigned result;
- if ((hatval & 7) == hatval)
- result = hat_dir_map[hatval];
- else
- result = SDL_HAT_CENTERED;
- return result;
-}
-
-
-int
-SDL_SYS_JoystickOpen(SDL_Joystick *joy)
-{
- char *path = joynames[joy->index];
- struct joystick_hwdata *hw;
- struct hid_item hitem;
- struct hid_data *hdata;
- struct report *rep;
- int fd;
- int i;
-
- fd = open(path, O_RDONLY);
- if (fd == -1) {
- SDL_SetError("%s: %s", path, strerror(errno));
- return (-1);
- }
-
- hw = (struct joystick_hwdata *)SDL_malloc(sizeof(struct joystick_hwdata));
- if (hw == NULL) {
- SDL_OutOfMemory();
- close(fd);
- return (-1);
- }
- joy->hwdata = hw;
- hw->fd = fd;
- hw->path = strdup(path);
- hw->x = 0;
- hw->y = 0;
- hw->xmin = 0xffff;
- hw->ymin = 0xffff;
- hw->xmax = 0;
- hw->ymax = 0;
- if (! SDL_strncmp(path, "/dev/joy", 8)) {
- hw->type = BSDJOY_JOY;
- joy->naxes = 2;
- joy->nbuttons = 2;
- joy->nhats = 0;
- joy->nballs = 0;
- joydevnames[joy->index] = strdup("Gameport joystick");
- goto usbend;
- } else {
- hw->type = BSDJOY_UHID;
- }
-
- {
- int ax;
- for (ax = 0; ax < JOYAXE_count; ax++)
- hw->axis_map[ax] = -1;
- }
- hw->repdesc = hid_get_report_desc(fd);
- if (hw->repdesc == NULL) {
- SDL_SetError("%s: USB_GET_REPORT_DESC: %s", hw->path,
- strerror(errno));
- goto usberr;
- }
-
- rep = &hw->inreport;
- if (ioctl(fd, USB_GET_REPORT_ID, &rep->rid) < 0) {
- rep->rid = -1; /* XXX */
- }
- if (report_alloc(rep, hw->repdesc, REPORT_INPUT) < 0) {
- goto usberr;
- }
- if (rep->size <= 0) {
- SDL_SetError("%s: Input report descriptor has invalid length",
- hw->path);
- goto usberr;
- }
-
-#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_version >= 500111)
- hdata = hid_start_parse(hw->repdesc, 1 << hid_input, rep->rid);
-#else
- hdata = hid_start_parse(hw->repdesc, 1 << hid_input);
-#endif
- if (hdata == NULL) {
- SDL_SetError("%s: Cannot start HID parser", hw->path);
- goto usberr;
- }
- joy->naxes = 0;
- joy->nbuttons = 0;
- joy->nhats = 0;
- joy->nballs = 0;
- for (i=0; i<JOYAXE_count; i++)
- hw->axis_map[i] = -1;
-
- while (hid_get_item(hdata, &hitem) > 0) {
- char *sp;
- const char *s;
-
- switch (hitem.kind) {
- case hid_collection:
- switch (HID_PAGE(hitem.usage)) {
- case HUP_GENERIC_DESKTOP:
- switch (HID_USAGE(hitem.usage)) {
- case HUG_JOYSTICK:
- case HUG_GAME_PAD:
- s = hid_usage_in_page(hitem.usage);
- sp = SDL_malloc(SDL_strlen(s) + 5);
- SDL_snprintf(sp, SDL_strlen(s) + 5, "%s (%d)", s,
- joy->index);
- joydevnames[joy->index] = sp;
- }
- }
- break;
- case hid_input:
- switch (HID_PAGE(hitem.usage)) {
- case HUP_GENERIC_DESKTOP: {
- unsigned usage = HID_USAGE(hitem.usage);
- int joyaxe = usage_to_joyaxe(usage);
- if (joyaxe >= 0) {
- hw->axis_map[joyaxe] = 1;
- } else if (usage == HUG_HAT_SWITCH) {
- joy->nhats++;
- }
- break;
- }
- case HUP_BUTTON:
- joy->nbuttons++;
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- }
- hid_end_parse(hdata);
- for (i=0; i<JOYAXE_count; i++)
- if (hw->axis_map[i] > 0)
- hw->axis_map[i] = joy->naxes++;
-
-usbend:
- /* The poll blocks the event thread. */
- fcntl(fd, F_SETFL, O_NONBLOCK);
-
- return (0);
-usberr:
- close(hw->fd);
- SDL_free(hw->path);
- SDL_free(hw);
- return (-1);
-}
-
-void
-SDL_SYS_JoystickUpdate(SDL_Joystick *joy)
-{
- struct hid_item hitem;
- struct hid_data *hdata;
- struct report *rep;
- int nbutton, naxe = -1;
- Sint32 v;
-
-#if defined(__FREEBSD__) || SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
- struct joystick gameport;
-
- if (joy->hwdata->type == BSDJOY_JOY) {
- if (read(joy->hwdata->fd, &gameport, sizeof gameport) != sizeof gameport)
- return;
- if (abs(joy->hwdata->x - gameport.x) > 8) {
- joy->hwdata->x = gameport.x;
- if (joy->hwdata->x < joy->hwdata->xmin) {
- joy->hwdata->xmin = joy->hwdata->x;
- }
- if (joy->hwdata->x > joy->hwdata->xmax) {
- joy->hwdata->xmax = joy->hwdata->x;
- }
- if (joy->hwdata->xmin == joy->hwdata->xmax) {
- joy->hwdata->xmin--;
- joy->hwdata->xmax++;
- }
- v = (Sint32)joy->hwdata->x;
- v -= (joy->hwdata->xmax + joy->hwdata->xmin + 1)/2;
- v *= 32768/((joy->hwdata->xmax - joy->hwdata->xmin + 1)/2);
- SDL_PrivateJoystickAxis(joy, 0, v);
- }
- if (abs(joy->hwdata->y - gameport.y) > 8) {
- joy->hwdata->y = gameport.y;
- if (joy->hwdata->y < joy->hwdata->ymin) {
- joy->hwdata->ymin = joy->hwdata->y;
- }
- if (joy->hwdata->y > joy->hwdata->ymax) {
- joy->hwdata->ymax = joy->hwdata->y;
- }
- if (joy->hwdata->ymin == joy->hwdata->ymax) {
- joy->hwdata->ymin--;
- joy->hwdata->ymax++;
- }
- v = (Sint32)joy->hwdata->y;
- v -= (joy->hwdata->ymax + joy->hwdata->ymin + 1)/2;
- v *= 32768/((joy->hwdata->ymax - joy->hwdata->ymin + 1)/2);
- SDL_PrivateJoystickAxis(joy, 1, v);
- }
- if (gameport.b1 != joy->buttons[0]) {
- SDL_PrivateJoystickButton(joy, 0, gameport.b1);
- }
- if (gameport.b2 != joy->buttons[1]) {
- SDL_PrivateJoystickButton(joy, 1, gameport.b2);
- }
- return;
- }
-#endif /* defined(__FREEBSD__) || SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H */
-
- rep = &joy->hwdata->inreport;
-
- if (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) != rep->size) {
- return;
- }
-#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_version >= 500111)
- hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input, rep->rid);
-#else
- hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input);
-#endif
- if (hdata == NULL) {
- fprintf(stderr, "%s: Cannot start HID parser\n",
- joy->hwdata->path);
- return;
- }
-
- for (nbutton = 0; hid_get_item(hdata, &hitem) > 0;) {
- switch (hitem.kind) {
- case hid_input:
- switch (HID_PAGE(hitem.usage)) {
- case HUP_GENERIC_DESKTOP: {
- unsigned usage = HID_USAGE(hitem.usage);
- int joyaxe = usage_to_joyaxe(usage);
- if (joyaxe >= 0) {
- naxe = joy->hwdata->axis_map[joyaxe];
- /* scaleaxe */
- v = (Sint32)hid_get_data(REP_BUF_DATA(rep),
- &hitem);
- v -= (hitem.logical_maximum + hitem.logical_minimum + 1)/2;
- v *= 32768/((hitem.logical_maximum - hitem.logical_minimum + 1)/2);
- if (v != joy->axes[naxe]) {
- SDL_PrivateJoystickAxis(joy, naxe, v);
- }
- } else if (usage == HUG_HAT_SWITCH) {
- v = (Sint32)hid_get_data(REP_BUF_DATA(rep),
- &hitem);
- SDL_PrivateJoystickHat(joy, 0,
- hatval_to_sdl(v)-hitem.logical_minimum);
- }
- break;
- }
- case HUP_BUTTON:
- v = (Sint32)hid_get_data(REP_BUF_DATA(rep),
- &hitem);
- if (joy->buttons[nbutton] != v) {
- SDL_PrivateJoystickButton(joy,
- nbutton, v);
- }
- nbutton++;
- break;
- default:
- continue;
- }
- break;
- default:
- break;
- }
- }
- hid_end_parse(hdata);
-
- return;
-}
-
-/* Function to close a joystick after use */
-void
-SDL_SYS_JoystickClose(SDL_Joystick *joy)
-{
- if (SDL_strncmp(joy->hwdata->path, "/dev/joy", 8)) {
- report_free(&joy->hwdata->inreport);
- hid_dispose_report_desc(joy->hwdata->repdesc);
- }
- close(joy->hwdata->fd);
- SDL_free(joy->hwdata->path);
- SDL_free(joy->hwdata);
-
- return;
-}
-
-void
-SDL_SYS_JoystickQuit(void)
-{
- int i;
-
- for (i = 0; i < MAX_JOYS; i++) {
- if (joynames[i] != NULL)
- SDL_free(joynames[i]);
- if (joydevnames[i] != NULL)
- SDL_free(joydevnames[i]);
- }
-
- return;
-}
-
-static int
-report_alloc(struct report *r, struct report_desc *rd, int repind)
-{
- int len;
-
-#ifdef __DragonFly__
- len = hid_report_size(rd, r->rid, repinfo[repind].kind);
-#elif __FREEBSD__
-# if (__FreeBSD_version >= 460000)
-# if (__FreeBSD_version <= 500111)
- len = hid_report_size(rd, r->rid, repinfo[repind].kind);
-# else
- len = hid_report_size(rd, repinfo[repind].kind, r->rid);
-# endif
-# else
- len = hid_report_size(rd, repinfo[repind].kind, &r->rid);
-# endif
-#else
-# ifdef USBHID_NEW
- len = hid_report_size(rd, repinfo[repind].kind, r->rid);
-# else
- len = hid_report_size(rd, repinfo[repind].kind, &r->rid);
-# endif
-#endif
-
- if (len < 0) {
- SDL_SetError("Negative HID report size");
- return (-1);
- }
- r->size = len;
-
- if (r->size > 0) {
- r->buf = SDL_malloc(sizeof(*r->buf) - sizeof(REP_BUF_DATA(r)) +
- r->size);
- if (r->buf == NULL) {
- SDL_OutOfMemory();
- return (-1);
- }
- } else {
- r->buf = NULL;
- }
-
- r->status = SREPORT_CLEAN;
- return (0);
-}
-
-static void
-report_free(struct report *r)
-{
- if (r->buf != NULL) {
- SDL_free(r->buf);
- }
- r->status = SREPORT_UNINIT;
-}
-
-#endif /* SDL_JOYSTICK_USBHID */
diff --git a/distrib/sdl-1.2.12/src/joystick/darwin/SDL_sysjoystick.c b/distrib/sdl-1.2.12/src/joystick/darwin/SDL_sysjoystick.c
deleted file mode 100644
index 8fd983e..0000000
--- a/distrib/sdl-1.2.12/src/joystick/darwin/SDL_sysjoystick.c
+++ /dev/null
@@ -1,841 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_JOYSTICK_IOKIT
-
-/* SDL joystick driver for Darwin / Mac OS X, based on the IOKit HID API */
-/* Written 2001 by Max Horn */
-
-#include <unistd.h>
-#include <ctype.h>
-#include <sysexits.h>
-#include <mach/mach.h>
-#include <mach/mach_error.h>
-#include <IOKit/IOKitLib.h>
-#include <IOKit/IOCFPlugIn.h>
-#ifdef MACOS_10_0_4
-#include <IOKit/hidsystem/IOHIDUsageTables.h>
-#else
-/* The header was moved here in Mac OS X 10.1 */
-#include <Kernel/IOKit/hidsystem/IOHIDUsageTables.h>
-#endif
-#include <IOKit/hid/IOHIDLib.h>
-#include <IOKit/hid/IOHIDKeys.h>
-#include <CoreFoundation/CoreFoundation.h>
-#include <Carbon/Carbon.h> /* for NewPtrClear, DisposePtr */
-
-#include "SDL_joystick.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-
-struct recElement
-{
- IOHIDElementCookie cookie; /* unique value which identifies element, will NOT change */
- long min; /* reported min value possible */
- long max; /* reported max value possible */
-#if 0
- /* TODO: maybe should handle the following stuff somehow? */
-
- long scaledMin; /* reported scaled min value possible */
- long scaledMax; /* reported scaled max value possible */
- long size; /* size in bits of data return from element */
- Boolean relative; /* are reports relative to last report (deltas) */
- Boolean wrapping; /* does element wrap around (one value higher than max is min) */
- Boolean nonLinear; /* are the values reported non-linear relative to element movement */
- Boolean preferredState; /* does element have a preferred state (such as a button) */
- Boolean nullState; /* does element have null state */
-#endif /* 0 */
-
- /* runtime variables used for auto-calibration */
- long minReport; /* min returned value */
- long maxReport; /* max returned value */
-
- struct recElement * pNext; /* next element in list */
-};
-typedef struct recElement recElement;
-
-struct joystick_hwdata
-{
- IOHIDDeviceInterface ** interface; /* interface to device, NULL = no interface */
-
- char product[256]; /* name of product */
- long usage; /* usage page from IOUSBHID Parser.h which defines general usage */
- long usagePage; /* usage within above page from IOUSBHID Parser.h which defines specific usage */
-
- long axes; /* number of axis (calculated, not reported by device) */
- long buttons; /* number of buttons (calculated, not reported by device) */
- long hats; /* number of hat switches (calculated, not reported by device) */
- long elements; /* number of total elements (shouldbe total of above) (calculated, not reported by device) */
-
- recElement* firstAxis;
- recElement* firstButton;
- recElement* firstHat;
-
- int removed;
- int uncentered;
-
- struct joystick_hwdata* pNext; /* next device */
-};
-typedef struct joystick_hwdata recDevice;
-
-
-/* Linked list of all available devices */
-static recDevice *gpDeviceList = NULL;
-
-
-static void HIDReportErrorNum (char * strError, long numError)
-{
- SDL_SetError(strError);
-}
-
-static void HIDGetCollectionElements (CFMutableDictionaryRef deviceProperties, recDevice *pDevice);
-
-/* returns current value for element, polling element
- * will return 0 on error conditions which should be accounted for by application
- */
-
-static SInt32 HIDGetElementValue (recDevice *pDevice, recElement *pElement)
-{
- IOReturn result = kIOReturnSuccess;
- IOHIDEventStruct hidEvent;
- hidEvent.value = 0;
-
- if (NULL != pDevice && NULL != pElement && NULL != pDevice->interface)
- {
- result = (*(pDevice->interface))->getElementValue(pDevice->interface, pElement->cookie, &hidEvent);
- if (kIOReturnSuccess == result)
- {
- /* record min and max for auto calibration */
- if (hidEvent.value < pElement->minReport)
- pElement->minReport = hidEvent.value;
- if (hidEvent.value > pElement->maxReport)
- pElement->maxReport = hidEvent.value;
- }
- }
-
- /* auto user scale */
- return hidEvent.value;
-}
-
-static SInt32 HIDScaledCalibratedValue (recDevice *pDevice, recElement *pElement, long min, long max)
-{
- float deviceScale = max - min;
- float readScale = pElement->maxReport - pElement->minReport;
- SInt32 value = HIDGetElementValue(pDevice, pElement);
- if (readScale == 0)
- return value; /* no scaling at all */
- else
- return ((value - pElement->minReport) * deviceScale / readScale) + min;
-}
-
-
-static void HIDRemovalCallback(void * target,
- IOReturn result,
- void * refcon,
- void * sender)
-{
- recDevice *device = (recDevice *) refcon;
- device->removed = 1;
- device->uncentered = 1;
-}
-
-
-
-/* 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
- */
-
-static IOReturn HIDCreateOpenDeviceInterface (io_object_t hidDevice, recDevice *pDevice)
-{
- IOReturn result = kIOReturnSuccess;
- HRESULT plugInResult = S_OK;
- SInt32 score = 0;
- IOCFPlugInInterface ** ppPlugInInterface = NULL;
-
- if (NULL == pDevice->interface)
- {
- result = IOCreatePlugInInterfaceForService (hidDevice, kIOHIDDeviceUserClientTypeID,
- kIOCFPlugInInterfaceID, &ppPlugInInterface, &score);
- if (kIOReturnSuccess == result)
- {
- /* Call a method of the intermediate plug-in to create the device interface */
- plugInResult = (*ppPlugInInterface)->QueryInterface (ppPlugInInterface,
- CFUUIDGetUUIDBytes (kIOHIDDeviceInterfaceID), (void *) &(pDevice->interface));
- if (S_OK != plugInResult)
- HIDReportErrorNum ("CouldnÕt query HID class device interface from plugInInterface", plugInResult);
- (*ppPlugInInterface)->Release (ppPlugInInterface);
- }
- else
- HIDReportErrorNum ("Failed to create **plugInInterface via IOCreatePlugInInterfaceForService.", result);
- }
- if (NULL != pDevice->interface)
- {
- result = (*(pDevice->interface))->open (pDevice->interface, 0);
- if (kIOReturnSuccess != result)
- HIDReportErrorNum ("Failed to open pDevice->interface via open.", result);
- else
- (*(pDevice->interface))->setRemovalCallback (pDevice->interface, HIDRemovalCallback, pDevice, pDevice);
-
- }
- return result;
-}
-
-/* Closes and releases interface to device, should be done prior to exting application
- * Note: will have no affect if device or interface do not exist
- * application will "own" the device if interface is not closed
- * (device may have to be plug and re-plugged in different location to get it working again without a restart)
- */
-
-static IOReturn HIDCloseReleaseInterface (recDevice *pDevice)
-{
- IOReturn result = kIOReturnSuccess;
-
- if ((NULL != pDevice) && (NULL != pDevice->interface))
- {
- /* close the interface */
- result = (*(pDevice->interface))->close (pDevice->interface);
- if (kIOReturnNotOpen == result)
- {
- /* do nothing as device was not opened, thus can't be closed */
- }
- else if (kIOReturnSuccess != result)
- HIDReportErrorNum ("Failed to close IOHIDDeviceInterface.", result);
- /* release the interface */
- result = (*(pDevice->interface))->Release (pDevice->interface);
- if (kIOReturnSuccess != result)
- HIDReportErrorNum ("Failed to release IOHIDDeviceInterface.", result);
- pDevice->interface = NULL;
- }
- return result;
-}
-
-/* extracts actual specific element information from each element CF dictionary entry */
-
-static void HIDGetElementInfo (CFTypeRef refElement, recElement *pElement)
-{
- long number;
- CFTypeRef refType;
-
- refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementCookieKey));
- if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number))
- pElement->cookie = (IOHIDElementCookie) number;
- refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementMinKey));
- if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number))
- pElement->minReport = pElement->min = number;
- refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementMaxKey));
- if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number))
- pElement->maxReport = pElement->max = number;
-/*
- TODO: maybe should handle the following stuff somehow?
-
- refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementScaledMinKey));
- if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number))
- pElement->scaledMin = number;
- refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementScaledMaxKey));
- if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number))
- pElement->scaledMax = number;
- refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementSizeKey));
- if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number))
- pElement->size = number;
- refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementIsRelativeKey));
- if (refType)
- pElement->relative = CFBooleanGetValue (refType);
- refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementIsWrappingKey));
- if (refType)
- pElement->wrapping = CFBooleanGetValue (refType);
- refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementIsNonLinearKey));
- if (refType)
- pElement->nonLinear = CFBooleanGetValue (refType);
- refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementHasPreferedStateKey));
- if (refType)
- pElement->preferredState = CFBooleanGetValue (refType);
- refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementHasNullStateKey));
- if (refType)
- pElement->nullState = CFBooleanGetValue (refType);
-*/
-}
-
-/* examines CF dictionary vlaue in device element hierarchy to determine if it is element of interest or a collection of more elements
- * if element of interest allocate storage, add to list and retrieve element specific info
- * if collection then pass on to deconstruction collection into additional individual elements
- */
-
-static void HIDAddElement (CFTypeRef refElement, recDevice* pDevice)
-{
- recElement* element = NULL;
- recElement** headElement = NULL;
- long elementType, usagePage, usage;
- CFTypeRef refElementType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementTypeKey));
- CFTypeRef refUsagePage = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementUsagePageKey));
- CFTypeRef refUsage = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementUsageKey));
-
-
- if ((refElementType) && (CFNumberGetValue (refElementType, kCFNumberLongType, &elementType)))
- {
- /* look at types of interest */
- if ((elementType == kIOHIDElementTypeInput_Misc) || (elementType == kIOHIDElementTypeInput_Button) ||
- (elementType == kIOHIDElementTypeInput_Axis))
- {
- if (refUsagePage && CFNumberGetValue (refUsagePage, kCFNumberLongType, &usagePage) &&
- refUsage && CFNumberGetValue (refUsage, kCFNumberLongType, &usage))
- {
- switch (usagePage) /* only interested in kHIDPage_GenericDesktop and kHIDPage_Button */
- {
- case kHIDPage_GenericDesktop:
- {
- switch (usage) /* look at usage to determine function */
- {
- case kHIDUsage_GD_X:
- case kHIDUsage_GD_Y:
- case kHIDUsage_GD_Z:
- case kHIDUsage_GD_Rx:
- case kHIDUsage_GD_Ry:
- case kHIDUsage_GD_Rz:
- case kHIDUsage_GD_Slider:
- case kHIDUsage_GD_Dial:
- case kHIDUsage_GD_Wheel:
- element = (recElement *) NewPtrClear (sizeof (recElement));
- if (element)
- {
- pDevice->axes++;
- headElement = &(pDevice->firstAxis);
- }
- break;
- case kHIDUsage_GD_Hatswitch:
- element = (recElement *) NewPtrClear (sizeof (recElement));
- if (element)
- {
- pDevice->hats++;
- headElement = &(pDevice->firstHat);
- }
- break;
- }
- }
- break;
- case kHIDPage_Button:
- element = (recElement *) NewPtrClear (sizeof (recElement));
- if (element)
- {
- pDevice->buttons++;
- headElement = &(pDevice->firstButton);
- }
- break;
- default:
- break;
- }
- }
- }
- else if (kIOHIDElementTypeCollection == elementType)
- HIDGetCollectionElements ((CFMutableDictionaryRef) refElement, pDevice);
- }
-
- if (element && headElement) /* add to list */
- {
- pDevice->elements++;
- if (NULL == *headElement)
- *headElement = element;
- else
- {
- recElement *elementPrevious, *elementCurrent;
- elementCurrent = *headElement;
- while (elementCurrent)
- {
- elementPrevious = elementCurrent;
- elementCurrent = elementPrevious->pNext;
- }
- elementPrevious->pNext = element;
- }
- element->pNext = NULL;
- HIDGetElementInfo (refElement, element);
- }
-}
-
-/* collects information from each array member in device element list (each array memeber = element) */
-
-static void HIDGetElementsCFArrayHandler (const void * value, void * parameter)
-{
- if (CFGetTypeID (value) == CFDictionaryGetTypeID ())
- HIDAddElement ((CFTypeRef) value, (recDevice *) parameter);
-}
-
-/* handles retrieval of element information from arrays of elements in device IO registry information */
-
-static void HIDGetElements (CFTypeRef refElementCurrent, recDevice *pDevice)
-{
- CFTypeID type = CFGetTypeID (refElementCurrent);
- if (type == CFArrayGetTypeID()) /* if element is an array */
- {
- CFRange range = {0, CFArrayGetCount (refElementCurrent)};
- /* CountElementsCFArrayHandler called for each array member */
- CFArrayApplyFunction (refElementCurrent, range, HIDGetElementsCFArrayHandler, pDevice);
- }
-}
-
-/* handles extracting element information from element collection CF types
- * used from top level element decoding and hierarchy deconstruction to flatten device element list
- */
-
-static void HIDGetCollectionElements (CFMutableDictionaryRef deviceProperties, recDevice *pDevice)
-{
- CFTypeRef refElementTop = CFDictionaryGetValue (deviceProperties, CFSTR(kIOHIDElementKey));
- if (refElementTop)
- HIDGetElements (refElementTop, pDevice);
-}
-
-/* use top level element usage page and usage to discern device usage page and usage setting appropriate vlaues in device record */
-
-static void HIDTopLevelElementHandler (const void * value, void * parameter)
-{
- CFTypeRef refCF = 0;
- if (CFGetTypeID (value) != CFDictionaryGetTypeID ())
- return;
- refCF = CFDictionaryGetValue (value, CFSTR(kIOHIDElementUsagePageKey));
- if (!CFNumberGetValue (refCF, kCFNumberLongType, &((recDevice *) parameter)->usagePage))
- SDL_SetError ("CFNumberGetValue error retrieving pDevice->usagePage.");
- refCF = CFDictionaryGetValue (value, CFSTR(kIOHIDElementUsageKey));
- if (!CFNumberGetValue (refCF, kCFNumberLongType, &((recDevice *) parameter)->usage))
- SDL_SetError ("CFNumberGetValue error retrieving pDevice->usage.");
-}
-
-/* extracts device info from CF dictionary records in IO registry */
-
-static void HIDGetDeviceInfo (io_object_t hidDevice, CFMutableDictionaryRef hidProperties, recDevice *pDevice)
-{
- CFMutableDictionaryRef usbProperties = 0;
- io_registry_entry_t parent1, parent2;
-
- /* Mac OS X currently is not mirroring all USB properties to HID page so need to look at USB device page also
- * get dictionary for usb properties: step up two levels and get CF dictionary for USB properties
- */
- if ((KERN_SUCCESS == IORegistryEntryGetParentEntry (hidDevice, kIOServicePlane, &parent1)) &&
- (KERN_SUCCESS == IORegistryEntryGetParentEntry (parent1, kIOServicePlane, &parent2)) &&
- (KERN_SUCCESS == IORegistryEntryCreateCFProperties (parent2, &usbProperties, kCFAllocatorDefault, kNilOptions)))
- {
- if (usbProperties)
- {
- CFTypeRef refCF = 0;
- /* get device info
- * try hid dictionary first, if fail then go to usb dictionary
- */
-
-
- /* get product name */
- refCF = CFDictionaryGetValue (hidProperties, CFSTR(kIOHIDProductKey));
- if (!refCF)
- refCF = CFDictionaryGetValue (usbProperties, CFSTR("USB Product Name"));
- if (refCF)
- {
- if (!CFStringGetCString (refCF, pDevice->product, 256, CFStringGetSystemEncoding ()))
- SDL_SetError ("CFStringGetCString error retrieving pDevice->product.");
- }
-
- /* get usage page and usage */
- refCF = CFDictionaryGetValue (hidProperties, CFSTR(kIOHIDPrimaryUsagePageKey));
- if (refCF)
- {
- if (!CFNumberGetValue (refCF, kCFNumberLongType, &pDevice->usagePage))
- SDL_SetError ("CFNumberGetValue error retrieving pDevice->usagePage.");
- refCF = CFDictionaryGetValue (hidProperties, CFSTR(kIOHIDPrimaryUsageKey));
- if (refCF)
- if (!CFNumberGetValue (refCF, kCFNumberLongType, &pDevice->usage))
- SDL_SetError ("CFNumberGetValue error retrieving pDevice->usage.");
- }
-
- if (NULL == refCF) /* get top level element HID usage page or usage */
- {
- /* use top level element instead */
- CFTypeRef refCFTopElement = 0;
- refCFTopElement = CFDictionaryGetValue (hidProperties, CFSTR(kIOHIDElementKey));
- {
- /* refCFTopElement points to an array of element dictionaries */
- CFRange range = {0, CFArrayGetCount (refCFTopElement)};
- CFArrayApplyFunction (refCFTopElement, range, HIDTopLevelElementHandler, pDevice);
- }
- }
-
- CFRelease (usbProperties);
- }
- else
- SDL_SetError ("IORegistryEntryCreateCFProperties failed to create usbProperties.");
-
- if (kIOReturnSuccess != IOObjectRelease (parent2))
- SDL_SetError ("IOObjectRelease error with parent2.");
- if (kIOReturnSuccess != IOObjectRelease (parent1))
- SDL_SetError ("IOObjectRelease error with parent1.");
- }
-}
-
-
-static recDevice *HIDBuildDevice (io_object_t hidDevice)
-{
- recDevice *pDevice = (recDevice *) NewPtrClear (sizeof (recDevice));
- if (pDevice)
- {
- /* get dictionary for HID properties */
- CFMutableDictionaryRef hidProperties = 0;
- kern_return_t result = IORegistryEntryCreateCFProperties (hidDevice, &hidProperties, kCFAllocatorDefault, kNilOptions);
- if ((result == KERN_SUCCESS) && hidProperties)
- {
- /* create device interface */
- result = HIDCreateOpenDeviceInterface (hidDevice, pDevice);
- if (kIOReturnSuccess == result)
- {
- HIDGetDeviceInfo (hidDevice, hidProperties, pDevice); /* hidDevice used to find parents in registry tree */
- HIDGetCollectionElements (hidProperties, pDevice);
- }
- else
- {
- DisposePtr((Ptr)pDevice);
- pDevice = NULL;
- }
- CFRelease (hidProperties);
- }
- else
- {
- DisposePtr((Ptr)pDevice);
- pDevice = NULL;
- }
- }
- return pDevice;
-}
-
-/* disposes of the element list associated with a device and the memory associated with the list
- */
-
-static void HIDDisposeElementList (recElement **elementList)
-{
- recElement *pElement = *elementList;
- while (pElement)
- {
- recElement *pElementNext = pElement->pNext;
- DisposePtr ((Ptr) pElement);
- pElement = pElementNext;
- }
- *elementList = NULL;
-}
-
-/* disposes of a single device, closing and releaseing interface, freeing memory fro device and elements, setting device pointer to NULL
- * all your device no longer belong to us... (i.e., you do not 'own' the device anymore)
- */
-
-static recDevice *HIDDisposeDevice (recDevice **ppDevice)
-{
- kern_return_t result = KERN_SUCCESS;
- recDevice *pDeviceNext = NULL;
- if (*ppDevice)
- {
- /* save next device prior to disposing of this device */
- pDeviceNext = (*ppDevice)->pNext;
-
- /* free element lists */
- HIDDisposeElementList (&(*ppDevice)->firstAxis);
- HIDDisposeElementList (&(*ppDevice)->firstButton);
- HIDDisposeElementList (&(*ppDevice)->firstHat);
-
- result = HIDCloseReleaseInterface (*ppDevice); /* function sanity checks interface value (now application does not own device) */
- if (kIOReturnSuccess != result)
- HIDReportErrorNum ("HIDCloseReleaseInterface failed when trying to dipose device.", result);
- DisposePtr ((Ptr)*ppDevice);
- *ppDevice = NULL;
- }
- return pDeviceNext;
-}
-
-
-/* Function to scan the system for joysticks.
- * Joystick 0 should be the system default joystick.
- * This function should return the number of available joysticks, or -1
- * on an unrecoverable fatal error.
- */
-int SDL_SYS_JoystickInit(void)
-{
- IOReturn result = kIOReturnSuccess;
- mach_port_t masterPort = 0;
- io_iterator_t hidObjectIterator = 0;
- CFMutableDictionaryRef hidMatchDictionary = NULL;
- recDevice *device, *lastDevice;
- io_object_t ioHIDDeviceObject = 0;
-
- SDL_numjoysticks = 0;
-
- if (gpDeviceList)
- {
- SDL_SetError("Joystick: Device list already inited.");
- return -1;
- }
-
- result = IOMasterPort (bootstrap_port, &masterPort);
- if (kIOReturnSuccess != result)
- {
- SDL_SetError("Joystick: IOMasterPort error with bootstrap_port.");
- return -1;
- }
-
- /* Set up a matching dictionary to search I/O Registry by class name for all HID class devices. */
- hidMatchDictionary = IOServiceMatching (kIOHIDDeviceKey);
- if (hidMatchDictionary)
- {
- /* Add key for device type (joystick, in this case) to refine the matching dictionary. */
-
- /* NOTE: we now perform this filtering later
- UInt32 usagePage = kHIDPage_GenericDesktop;
- UInt32 usage = kHIDUsage_GD_Joystick;
- CFNumberRef refUsage = NULL, refUsagePage = NULL;
-
- refUsage = CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &usage);
- CFDictionarySetValue (hidMatchDictionary, CFSTR (kIOHIDPrimaryUsageKey), refUsage);
- refUsagePage = CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &usagePage);
- CFDictionarySetValue (hidMatchDictionary, CFSTR (kIOHIDPrimaryUsagePageKey), refUsagePage);
- */
- }
- else
- {
- SDL_SetError("Joystick: Failed to get HID CFMutableDictionaryRef via IOServiceMatching.");
- return -1;
- }
-
- /*/ Now search I/O Registry for matching devices. */
- result = IOServiceGetMatchingServices (masterPort, hidMatchDictionary, &hidObjectIterator);
- /* Check for errors */
- if (kIOReturnSuccess != result)
- {
- SDL_SetError("Joystick: Couldn't create a HID object iterator.");
- return -1;
- }
- if (!hidObjectIterator) /* there are no joysticks */
- {
- gpDeviceList = NULL;
- SDL_numjoysticks = 0;
- return 0;
- }
- /* IOServiceGetMatchingServices consumes a reference to the dictionary, so we don't need to release the dictionary ref. */
-
- /* build flat linked list of devices from device iterator */
-
- gpDeviceList = lastDevice = NULL;
-
- while ((ioHIDDeviceObject = IOIteratorNext (hidObjectIterator)))
- {
- /* build a device record */
- device = HIDBuildDevice (ioHIDDeviceObject);
- if (!device)
- continue;
-
- /* dump device object, it is no longer needed */
- result = IOObjectRelease (ioHIDDeviceObject);
-/* if (KERN_SUCCESS != result)
- HIDReportErrorNum ("IOObjectRelease error with ioHIDDeviceObject.", result);
-*/
-
- /* Filter device list to non-keyboard/mouse stuff */
- if ( (device->usagePage != kHIDPage_GenericDesktop) ||
- ((device->usage != kHIDUsage_GD_Joystick &&
- device->usage != kHIDUsage_GD_GamePad &&
- device->usage != kHIDUsage_GD_MultiAxisController)) ) {
-
- /* release memory for the device */
- HIDDisposeDevice (&device);
- DisposePtr((Ptr)device);
- continue;
- }
-
- /* Add device to the end of the list */
- if (lastDevice)
- lastDevice->pNext = device;
- else
- gpDeviceList = device;
- lastDevice = device;
- }
- result = IOObjectRelease (hidObjectIterator); /* release the iterator */
-
- /* Count the total number of devices we found */
- device = gpDeviceList;
- while (device)
- {
- SDL_numjoysticks++;
- device = device->pNext;
- }
-
- return SDL_numjoysticks;
-}
-
-/* Function to get the device-dependent name of a joystick */
-const char *SDL_SYS_JoystickName(int index)
-{
- recDevice *device = gpDeviceList;
-
- for (; index > 0; index--)
- device = device->pNext;
-
- return device->product;
-}
-
-/* Function to open a joystick for use.
- * The joystick to open is specified by the index field of the joystick.
- * This should fill the nbuttons and naxes fields of the joystick structure.
- * It returns 0, or -1 if there is an error.
- */
-int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
-{
- recDevice *device = gpDeviceList;
- int index;
-
- for (index = joystick->index; index > 0; index--)
- device = device->pNext;
-
- joystick->hwdata = device;
- joystick->name = device->product;
-
- joystick->naxes = device->axes;
- joystick->nhats = device->hats;
- joystick->nballs = 0;
- joystick->nbuttons = device->buttons;
-
- return 0;
-}
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
-{
- recDevice *device = joystick->hwdata;
- recElement *element;
- SInt32 value;
- int i;
-
- if (device->removed) /* device was unplugged; ignore it. */
- {
- if (device->uncentered)
- {
- device->uncentered = 0;
-
- /* Tell the app that everything is centered/unpressed... */
- for (i = 0; i < device->axes; i++)
- SDL_PrivateJoystickAxis(joystick, i, 0);
-
- for (i = 0; i < device->buttons; i++)
- SDL_PrivateJoystickButton(joystick, i, 0);
-
- for (i = 0; i < device->hats; i++)
- SDL_PrivateJoystickHat(joystick, i, SDL_HAT_CENTERED);
- }
-
- return;
- }
-
- element = device->firstAxis;
- i = 0;
- while (element)
- {
- value = HIDScaledCalibratedValue(device, element, -32768, 32767);
- if ( value != joystick->axes[i] )
- SDL_PrivateJoystickAxis(joystick, i, value);
- element = element->pNext;
- ++i;
- }
-
- element = device->firstButton;
- i = 0;
- while (element)
- {
- value = HIDGetElementValue(device, element);
- if (value > 1) /* handle pressure-sensitive buttons */
- value = 1;
- if ( value != joystick->buttons[i] )
- SDL_PrivateJoystickButton(joystick, i, value);
- element = element->pNext;
- ++i;
- }
-
- element = device->firstHat;
- i = 0;
- while (element)
- {
- Uint8 pos = 0;
-
- value = HIDGetElementValue(device, element);
- if (element->max == 3) /* 4 position hatswitch - scale up value */
- value *= 2;
- else if (element->max != 7) /* Neither a 4 nor 8 positions - fall back to default position (centered) */
- value = -1;
- switch(value)
- {
- case 0:
- pos = SDL_HAT_UP;
- break;
- case 1:
- pos = SDL_HAT_RIGHTUP;
- break;
- case 2:
- pos = SDL_HAT_RIGHT;
- break;
- case 3:
- pos = SDL_HAT_RIGHTDOWN;
- break;
- case 4:
- pos = SDL_HAT_DOWN;
- break;
- case 5:
- pos = SDL_HAT_LEFTDOWN;
- break;
- case 6:
- pos = SDL_HAT_LEFT;
- break;
- case 7:
- pos = SDL_HAT_LEFTUP;
- break;
- default:
- /* Every other value is mapped to center. We do that because some
- * joysticks use 8 and some 15 for this value, and apparently
- * there are even more variants out there - so we try to be generous.
- */
- pos = SDL_HAT_CENTERED;
- break;
- }
- if ( pos != joystick->hats[i] )
- SDL_PrivateJoystickHat(joystick, i, pos);
- element = element->pNext;
- ++i;
- }
-
- return;
-}
-
-/* Function to close a joystick after use */
-void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
-{
- /* Should we do anything here? */
- return;
-}
-
-/* Function to perform any system-specific joystick related cleanup */
-void SDL_SYS_JoystickQuit(void)
-{
- while (NULL != gpDeviceList)
- gpDeviceList = HIDDisposeDevice (&gpDeviceList);
-}
-
-#endif /* SDL_JOYSTICK_IOKIT */
diff --git a/distrib/sdl-1.2.12/src/joystick/dc/SDL_sysjoystick.c b/distrib/sdl-1.2.12/src/joystick/dc/SDL_sysjoystick.c
deleted file mode 100644
index ac72473..0000000
--- a/distrib/sdl-1.2.12/src/joystick/dc/SDL_sysjoystick.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_JOYSTICK_DC
-
-#include "SDL_events.h"
-#include "SDL_joystick.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-
-#include <dc/maple.h>
-#include <dc/maple/controller.h>
-
-#define MAX_JOYSTICKS 8 /* only 2 are supported in the multimedia API */
-#define MAX_AXES 6 /* each joystick can have up to 6 axes */
-#define MAX_BUTTONS 8 /* and 8 buttons */
-#define MAX_HATS 2
-
-#define JOYNAMELEN 8
-
-/* array to hold joystick ID values */
-static uint8 SYS_Joystick_addr[MAX_JOYSTICKS];
-
-/* The private structure used to keep track of a joystick */
-struct joystick_hwdata
-{
- cont_cond_t prev_cond;
- int prev_buttons;
-};
-
-/* Function to scan the system for joysticks.
- * This function should set SDL_numjoysticks to the number of available
- * joysticks. Joystick 0 should be the system default joystick.
- * It should return 0, or -1 on an unrecoverable fatal error.
- */
-int SDL_SYS_JoystickInit(void)
-{
- int numdevs;
-
- int p,u;
-
- numdevs = 0;
- for(p=0;p<MAPLE_PORT_COUNT;p++) {
- for(u=0;u<MAPLE_UNIT_COUNT;u++) {
- if (maple_device_func(p,u)&MAPLE_FUNC_CONTROLLER) {
- SYS_Joystick_addr[numdevs] = maple_addr(p,u);
- numdevs++;
- }
- }
- }
-
- return(numdevs);
-}
-
-/* Function to get the device-dependent name of a joystick */
-const char *SDL_SYS_JoystickName(int index)
-{
- maple_device_t *dev;
- if (maple_compat_resolve(SYS_Joystick_addr[index],&dev,MAPLE_FUNC_CONTROLLER)!=0) return NULL;
- return dev->info.product_name;
-}
-
-/* Function to open a joystick for use.
- The joystick to open is specified by the index field of the joystick.
- This should fill the nbuttons and naxes fields of the joystick structure.
- It returns 0, or -1 if there is an error.
- */
-int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
-{
- /* allocate memory for system specific hardware data */
- joystick->hwdata = (struct joystick_hwdata *) SDL_malloc(sizeof(*joystick->hwdata));
- if (joystick->hwdata == NULL)
- {
- SDL_OutOfMemory();
- return(-1);
- }
- SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
-
- /* fill nbuttons, naxes, and nhats fields */
- joystick->nbuttons = MAX_BUTTONS;
- joystick->naxes = MAX_AXES;
- joystick->nhats = MAX_HATS;
- return(0);
-}
-
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-
-void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
-{
-const int sdl_buttons[] = {
- CONT_C,
- CONT_B,
- CONT_A,
- CONT_START,
- CONT_Z,
- CONT_Y,
- CONT_X,
- CONT_D
-};
-
- uint8 addr;
- cont_cond_t cond,*prev_cond;
- int buttons,prev_buttons,i,changed;
-
- addr = SYS_Joystick_addr[joystick->index];
- if (cont_get_cond(addr,&cond)<0) return;
-
- buttons = cond.buttons;
- prev_buttons = joystick->hwdata->prev_buttons;
- changed = buttons^prev_buttons;
-
- if ((changed)&(CONT_DPAD_UP|CONT_DPAD_DOWN|CONT_DPAD_LEFT|CONT_DPAD_RIGHT)) {
- int hat = SDL_HAT_CENTERED;
- if (buttons&CONT_DPAD_UP) hat|=SDL_HAT_UP;
- if (buttons&CONT_DPAD_DOWN) hat|=SDL_HAT_DOWN;
- if (buttons&CONT_DPAD_LEFT) hat|=SDL_HAT_LEFT;
- if (buttons&CONT_DPAD_RIGHT) hat|=SDL_HAT_RIGHT;
- SDL_PrivateJoystickHat(joystick, 0, hat);
- }
- if ((changed)&(CONT_DPAD2_UP|CONT_DPAD2_DOWN|CONT_DPAD2_LEFT|CONT_DPAD2_RIGHT)) {
- int hat = SDL_HAT_CENTERED;
- if (buttons&CONT_DPAD2_UP) hat|=SDL_HAT_UP;
- if (buttons&CONT_DPAD2_DOWN) hat|=SDL_HAT_DOWN;
- if (buttons&CONT_DPAD2_LEFT) hat|=SDL_HAT_LEFT;
- if (buttons&CONT_DPAD2_RIGHT) hat|=SDL_HAT_RIGHT;
- SDL_PrivateJoystickHat(joystick, 1, hat);
- }
-
- for(i=0;i<sizeof(sdl_buttons)/sizeof(sdl_buttons[0]);i++) {
- if (changed & sdl_buttons[i]) {
- SDL_PrivateJoystickButton(joystick, i, (buttons & sdl_buttons[i])?SDL_PRESSED:SDL_RELEASED);
- }
- }
-
- prev_cond = &joystick->hwdata->prev_cond;
- if (cond.joyx!=prev_cond->joyx)
- SDL_PrivateJoystickAxis(joystick, 0, cond.joyx-128);
- if (cond.joyy!=prev_cond->joyy)
- SDL_PrivateJoystickAxis(joystick, 1, cond.joyy-128);
- if (cond.rtrig!=prev_cond->rtrig)
- SDL_PrivateJoystickAxis(joystick, 2, cond.rtrig);
- if (cond.ltrig!=prev_cond->ltrig)
- SDL_PrivateJoystickAxis(joystick, 3, cond.ltrig);
- if (cond.joy2x!=prev_cond->joy2x)
- SDL_PrivateJoystickAxis(joystick, 4, cond.joy2x-128);
- if (cond.joy2y!=prev_cond->joy2y)
- SDL_PrivateJoystickAxis(joystick, 5, cond.joy2y-128);
-
- joystick->hwdata->prev_buttons = buttons;
- joystick->hwdata->prev_cond = cond;
-}
-
-/* Function to close a joystick after use */
-void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
-{
- if (joystick->hwdata != NULL) {
- /* free system specific hardware data */
- SDL_free(joystick->hwdata);
- }
-}
-
-/* Function to perform any system-specific joystick related cleanup */
-void SDL_SYS_JoystickQuit(void)
-{
- return;
-}
-
-#endif /* SDL_JOYSTICK_DC */
diff --git a/distrib/sdl-1.2.12/src/joystick/dummy/SDL_sysjoystick.c b/distrib/sdl-1.2.12/src/joystick/dummy/SDL_sysjoystick.c
deleted file mode 100644
index f3209a2..0000000
--- a/distrib/sdl-1.2.12/src/joystick/dummy/SDL_sysjoystick.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#if defined(SDL_JOYSTICK_DUMMY) || defined(SDL_JOYSTICK_DISABLED)
-
-/* This is the system specific header for the SDL joystick API */
-
-#include "SDL_joystick.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-
-/* Function to scan the system for joysticks.
- * This function should set SDL_numjoysticks to the number of available
- * joysticks. Joystick 0 should be the system default joystick.
- * It should return 0, or -1 on an unrecoverable fatal error.
- */
-int SDL_SYS_JoystickInit(void)
-{
- SDL_numjoysticks = 0;
- return(0);
-}
-
-/* Function to get the device-dependent name of a joystick */
-const char *SDL_SYS_JoystickName(int index)
-{
- SDL_SetError("Logic error: No joysticks available");
- return(NULL);
-}
-
-/* Function to open a joystick for use.
- The joystick to open is specified by the index field of the joystick.
- This should fill the nbuttons and naxes fields of the joystick structure.
- It returns 0, or -1 if there is an error.
- */
-int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
-{
- SDL_SetError("Logic error: No joysticks available");
- return(-1);
-}
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
-{
- return;
-}
-
-/* Function to close a joystick after use */
-void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
-{
- return;
-}
-
-/* Function to perform any system-specific joystick related cleanup */
-void SDL_SYS_JoystickQuit(void)
-{
- return;
-}
-
-#endif /* SDL_JOYSTICK_DUMMY || SDL_JOYSTICK_DISABLED */
diff --git a/distrib/sdl-1.2.12/src/joystick/linux/SDL_sysjoystick.c b/distrib/sdl-1.2.12/src/joystick/linux/SDL_sysjoystick.c
deleted file mode 100644
index d90bae6..0000000
--- a/distrib/sdl-1.2.12/src/joystick/linux/SDL_sysjoystick.c
+++ /dev/null
@@ -1,1199 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_JOYSTICK_LINUX
-
-/* This is the system specific header for the SDL joystick API */
-
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <limits.h> /* For the definition of PATH_MAX */
-#include <linux/joystick.h>
-#if SDL_INPUT_LINUXEV
-#include <linux/input.h>
-#endif
-
-#include "SDL_joystick.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-
-/* Special joystick configurations */
-static struct {
- const char *name;
- int naxes;
- int nhats;
- int nballs;
-} special_joysticks[] = {
- { "MadCatz Panther XL", 3, 2, 1 }, /* We don't handle rudder (axis 8) */
- { "SideWinder Precision Pro", 4, 1, 0 },
- { "SideWinder 3D Pro", 4, 1, 0 },
- { "Microsoft SideWinder 3D Pro", 4, 1, 0 },
- { "Microsoft SideWinder Precision Pro", 4, 1, 0 },
- { "Microsoft SideWinder Dual Strike USB version 1.0", 2, 1, 0 },
- { "WingMan Interceptor", 3, 3, 0 },
- { "WingMan Extreme Digital 3D", 4, 1, 0 },
- { "Microsoft SideWinder Precision 2 Joystick", 4, 1, 0 },
- { "Logitech Inc. WingMan Extreme Digital 3D", 4, 1, 0 },
- { "Saitek Saitek X45", 6, 1, 0 }
-};
-
-#ifndef NO_LOGICAL_JOYSTICKS
-
-/*
- Some USB HIDs show up as a single joystick even though they actually
- control 2 or more joysticks.
-*/
-/*
- This code handles the MP-8800 (Quad) and MP-8866 (Dual), which can
- be identified by their transparent blue design. It's quite trivial
- to add other joysticks with similar quirky behavior.
- -id
-*/
-
-struct joystick_logical_mapping {
- int njoy;
- int nthing;
-};
-
-/*
- {logical joy, logical axis},
- {logical joy, logical hat},
- {logical joy, logical ball},
- {logical joy, logical button}
-*/
-
-static struct joystick_logical_mapping mp88xx_1_logical_axismap[] = {
- {0,0},{0,1},{0,2},{0,3},{0,4},{0,5}
-};
-static struct joystick_logical_mapping mp88xx_1_logical_buttonmap[] = {
- {0,0},{0,1},{0,2},{0,3},{0,4},{0,5},{0,6},{0,7},{0,8},{0,9},{0,10},{0,11}
-};
-
-static struct joystick_logical_mapping mp88xx_2_logical_axismap[] = {
- {0,0},{0,1},{0,2},{1,0},{1,1},{0,3},
- {1,2},{1,3},{0,4},{0,5},{1,4},{1,5}
-};
-static struct joystick_logical_mapping mp88xx_2_logical_buttonmap[] = {
- {0,0},{0,1},{0,2},{0,3},{0,4},{0,5},{0,6},{0,7},{0,8},{0,9},{0,10},{0,11},
- {1,0},{1,1},{1,2},{1,3},{1,4},{1,5},{1,6},{1,7},{1,8},{1,9},{1,10},{1,11}
-};
-
-static struct joystick_logical_mapping mp88xx_3_logical_axismap[] = {
- {0,0},{0,1},{0,2},{1,0},{1,1},{0,3},
- {1,2},{1,3},{2,0},{2,1},{2,2},{2,3},
- {0,4},{0,5},{1,4},{1,5},{2,4},{2,5}
-};
-static struct joystick_logical_mapping mp88xx_3_logical_buttonmap[] = {
- {0,0},{0,1},{0,2},{0,3},{0,4},{0,5},{0,6},{0,7},{0,8},{0,9},{0,10},{0,11},
- {1,0},{1,1},{1,2},{1,3},{1,4},{1,5},{1,6},{1,7},{1,8},{1,9},{1,10},{1,11},
- {2,0},{2,1},{2,2},{2,3},{2,4},{2,5},{2,6},{2,7},{2,8},{2,9},{2,10},{2,11}
-};
-
-static struct joystick_logical_mapping mp88xx_4_logical_axismap[] = {
- {0,0},{0,1},{0,2},{1,0},{1,1},{0,3},
- {1,2},{1,3},{2,0},{2,1},{2,2},{2,3},
- {3,0},{3,1},{3,2},{3,3},{0,4},{0,5},
- {1,4},{1,5},{2,4},{2,5},{3,4},{3,5}
-};
-static struct joystick_logical_mapping mp88xx_4_logical_buttonmap[] = {
- {0,0},{0,1},{0,2},{0,3},{0,4},{0,5},{0,6},{0,7},{0,8},{0,9},{0,10},{0,11},
- {1,0},{1,1},{1,2},{1,3},{1,4},{1,5},{1,6},{1,7},{1,8},{1,9},{1,10},{1,11},
- {2,0},{2,1},{2,2},{2,3},{2,4},{2,5},{2,6},{2,7},{2,8},{2,9},{2,10},{2,11},
- {3,0},{3,1},{3,2},{3,3},{3,4},{3,5},{3,6},{3,7},{3,8},{3,9},{3,10},{3,11}
-};
-
-struct joystick_logical_layout {
- int naxes;
- int nhats;
- int nballs;
- int nbuttons;
-};
-
-static struct joystick_logical_layout mp88xx_1_logical_layout[] = {
- {6, 0, 0, 12}
-};
-static struct joystick_logical_layout mp88xx_2_logical_layout[] = {
- {6, 0, 0, 12},
- {6, 0, 0, 12}
-};
-static struct joystick_logical_layout mp88xx_3_logical_layout[] = {
- {6, 0, 0, 12},
- {6, 0, 0, 12},
- {6, 0, 0, 12}
-};
-static struct joystick_logical_layout mp88xx_4_logical_layout[] = {
- {6, 0, 0, 12},
- {6, 0, 0, 12},
- {6, 0, 0, 12},
- {6, 0, 0, 12}
-};
-
-/*
- This array sets up a means of mapping a single physical joystick to
- multiple logical joysticks. (djm)
-
- njoys
- the number of logical joysticks
-
- layouts
- an array of layout structures, one to describe each logical joystick
-
- axes, hats, balls, buttons
- arrays that map a physical thingy to a logical thingy
- */
-struct joystick_logicalmap {
- const char *name;
- int nbuttons;
- int njoys;
- struct joystick_logical_layout *layout;
- struct joystick_logical_mapping *axismap;
- struct joystick_logical_mapping *hatmap;
- struct joystick_logical_mapping *ballmap;
- struct joystick_logical_mapping *buttonmap;
-};
-
-static struct joystick_logicalmap joystick_logicalmap[] = {
- {
- "WiseGroup.,Ltd MP-8866 Dual USB Joypad",
- 12,
- 1,
- mp88xx_1_logical_layout,
- mp88xx_1_logical_axismap,
- NULL,
- NULL,
- mp88xx_1_logical_buttonmap
- },
- {
- "WiseGroup.,Ltd MP-8866 Dual USB Joypad",
- 24,
- 2,
- mp88xx_2_logical_layout,
- mp88xx_2_logical_axismap,
- NULL,
- NULL,
- mp88xx_2_logical_buttonmap
- },
- {
- "WiseGroup.,Ltd MP-8800 Quad USB Joypad",
- 12,
- 1,
- mp88xx_1_logical_layout,
- mp88xx_1_logical_axismap,
- NULL,
- NULL,
- mp88xx_1_logical_buttonmap
- },
- {
- "WiseGroup.,Ltd MP-8800 Quad USB Joypad",
- 24,
- 2,
- mp88xx_2_logical_layout,
- mp88xx_2_logical_axismap,
- NULL,
- NULL,
- mp88xx_2_logical_buttonmap
- },
- {
- "WiseGroup.,Ltd MP-8800 Quad USB Joypad",
- 36,
- 3,
- mp88xx_3_logical_layout,
- mp88xx_3_logical_axismap,
- NULL,
- NULL,
- mp88xx_3_logical_buttonmap
- },
- {
- "WiseGroup.,Ltd MP-8800 Quad USB Joypad",
- 48,
- 4,
- mp88xx_4_logical_layout,
- mp88xx_4_logical_axismap,
- NULL,
- NULL,
- mp88xx_4_logical_buttonmap
- }
-};
-
-/* find the head of a linked list, given a point in it
- */
-#define SDL_joylist_head(i, start)\
- for(i = start; SDL_joylist[i].fname == NULL;) i = SDL_joylist[i].prev;
-
-#define SDL_logical_joydecl(d) d
-
-
-#else
-
-#define SDL_logical_joydecl(d)
-
-#endif /* USE_LOGICAL_JOYSTICKS */
-
-/* The maximum number of joysticks we'll detect */
-#define MAX_JOYSTICKS 32
-
-/* A list of available joysticks */
-static struct
-{
- char* fname;
-#ifndef NO_LOGICAL_JOYSTICKS
- SDL_Joystick* joy;
- struct joystick_logicalmap* map;
- int prev;
- int next;
- int logicalno;
-#endif /* USE_LOGICAL_JOYSTICKS */
-} SDL_joylist[MAX_JOYSTICKS];
-
-
-/* The private structure used to keep track of a joystick */
-struct joystick_hwdata {
- int fd;
- /* The current linux joystick driver maps hats to two axes */
- struct hwdata_hat {
- int axis[2];
- } *hats;
- /* The current linux joystick driver maps balls to two axes */
- struct hwdata_ball {
- int axis[2];
- } *balls;
-
- /* Support for the Linux 2.4 unified input interface */
-#if SDL_INPUT_LINUXEV
- SDL_bool is_hid;
- Uint8 key_map[KEY_MAX-BTN_MISC];
- Uint8 abs_map[ABS_MAX];
- struct axis_correct {
- int used;
- int coef[3];
- } abs_correct[ABS_MAX];
-#endif
-};
-
-
-#ifndef NO_LOGICAL_JOYSTICKS
-
-static int CountLogicalJoysticks(int max)
-{
- register int i, j, k, ret, prev;
- const char* name;
- int nbuttons, fd;
- unsigned char n;
-
- ret = 0;
-
- for(i = 0; i < max; i++) {
- name = SDL_SYS_JoystickName(i);
-
- fd = open(SDL_joylist[i].fname, O_RDONLY, 0);
- if ( fd >= 0 ) {
- if ( ioctl(fd, JSIOCGBUTTONS, &n) < 0 ) {
- nbuttons = -1;
- } else {
- nbuttons = n;
- }
- close(fd);
- }
- else {
- nbuttons=-1;
- }
-
- if (name) {
- for(j = 0; j < SDL_arraysize(joystick_logicalmap); j++) {
- if (!SDL_strcmp(name, joystick_logicalmap[j].name) && (nbuttons==-1 || nbuttons==joystick_logicalmap[j].nbuttons)) {
- prev = i;
- SDL_joylist[prev].map = &(joystick_logicalmap[j]);
-
- for(k = 1; k < joystick_logicalmap[j].njoys; k++) {
- SDL_joylist[prev].next = max + ret;
- SDL_joylist[max+ret].prev = prev;
-
- prev = max + ret;
- SDL_joylist[prev].logicalno = k;
- SDL_joylist[prev].map = &(joystick_logicalmap[j]);
- ret++;
- }
-
- break;
- }
- }
- }
- }
-
- return ret;
-}
-
-static void LogicalSuffix(int logicalno, char* namebuf, int len)
-{
- register int slen;
- const static char suffixs[] =
- "01020304050607080910111213141516171819"
- "20212223242526272829303132";
- const char* suffix;
- slen = SDL_strlen(namebuf);
- suffix = NULL;
-
- if (logicalno*2<sizeof(suffixs))
- suffix = suffixs + (logicalno*2);
-
- if (slen + 4 < len && suffix) {
- namebuf[slen++] = ' ';
- namebuf[slen++] = '#';
- namebuf[slen++] = suffix[0];
- namebuf[slen++] = suffix[1];
- namebuf[slen++] = 0;
- }
-}
-
-#endif /* USE_LOGICAL_JOYSTICKS */
-
-#if SDL_INPUT_LINUXEV
-#define test_bit(nr, addr) \
- (((1UL << ((nr) & 31)) & (((const unsigned int *) addr)[(nr) >> 5])) != 0)
-
-static int EV_IsJoystick(int fd)
-{
- unsigned long evbit[40];
- unsigned long keybit[40];
- unsigned long absbit[40];
-
- if ( (ioctl(fd, EVIOCGBIT(0, sizeof(evbit)), evbit) < 0) ||
- (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) < 0) ||
- (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) < 0) ) {
- return(0);
- }
- if (!(test_bit(EV_KEY, evbit) && test_bit(EV_ABS, evbit) &&
- test_bit(ABS_X, absbit) && test_bit(ABS_Y, absbit) &&
- (test_bit(BTN_TRIGGER, keybit) || test_bit(BTN_A, keybit) || test_bit(BTN_1, keybit)))) return 0;
- return(1);
-}
-
-#endif /* SDL_INPUT_LINUXEV */
-
-/* Function to scan the system for joysticks */
-int SDL_SYS_JoystickInit(void)
-{
- /* The base path of the joystick devices */
- const char *joydev_pattern[] = {
-#if SDL_INPUT_LINUXEV
- "/dev/input/event%d",
-#endif
- "/dev/input/js%d",
- "/dev/js%d"
- };
- int numjoysticks;
- int i, j;
- int fd;
- char path[PATH_MAX];
- dev_t dev_nums[MAX_JOYSTICKS]; /* major/minor device numbers */
- struct stat sb;
- int n, duplicate;
-
- numjoysticks = 0;
-
- /* First see if the user specified a joystick to use */
- if ( SDL_getenv("SDL_JOYSTICK_DEVICE") != NULL ) {
- SDL_strlcpy(path, SDL_getenv("SDL_JOYSTICK_DEVICE"), sizeof(path));
- if ( stat(path, &sb) == 0 ) {
- fd = open(path, O_RDONLY, 0);
- if ( fd >= 0 ) {
- /* Assume the user knows what they're doing. */
- SDL_joylist[numjoysticks].fname = SDL_strdup(path);
- if ( SDL_joylist[numjoysticks].fname ) {
- dev_nums[numjoysticks] = sb.st_rdev;
- ++numjoysticks;
- }
- close(fd);
- }
- }
- }
-
- for ( i=0; i<SDL_arraysize(joydev_pattern); ++i ) {
- for ( j=0; j < MAX_JOYSTICKS; ++j ) {
- SDL_snprintf(path, SDL_arraysize(path), joydev_pattern[i], j);
-
- /* rcg06302000 replaced access(F_OK) call with stat().
- * stat() will fail if the file doesn't exist, so it's
- * equivalent behaviour.
- */
- if ( stat(path, &sb) == 0 ) {
- /* Check to make sure it's not already in list.
- * This happens when we see a stick via symlink.
- */
- duplicate = 0;
- for (n=0; (n<numjoysticks) && !duplicate; ++n) {
- if ( sb.st_rdev == dev_nums[n] ) {
- duplicate = 1;
- }
- }
- if (duplicate) {
- continue;
- }
-
- fd = open(path, O_RDONLY, 0);
- if ( fd < 0 ) {
- continue;
- }
-#if SDL_INPUT_LINUXEV
-#ifdef DEBUG_INPUT_EVENTS
- printf("Checking %s\n", path);
-#endif
- if ( (i == 0) && ! EV_IsJoystick(fd) ) {
- close(fd);
- continue;
- }
-#endif
- close(fd);
-
- /* We're fine, add this joystick */
- SDL_joylist[numjoysticks].fname = SDL_strdup(path);
- if ( SDL_joylist[numjoysticks].fname ) {
- dev_nums[numjoysticks] = sb.st_rdev;
- ++numjoysticks;
- }
- } else
- break;
- }
-
-#if SDL_INPUT_LINUXEV
- /* This is a special case...
- If the event devices are valid then the joystick devices
- will be duplicates but without extra information about their
- hats or balls. Unfortunately, the event devices can't
- currently be calibrated, so it's a win-lose situation.
- So : /dev/input/eventX = /dev/input/jsY = /dev/jsY
- */
- if ( (i == 0) && (numjoysticks > 0) )
- break;
-#endif
- }
-#ifndef NO_LOGICAL_JOYSTICKS
- numjoysticks += CountLogicalJoysticks(numjoysticks);
-#endif
-
- return(numjoysticks);
-}
-
-/* Function to get the device-dependent name of a joystick */
-const char *SDL_SYS_JoystickName(int index)
-{
- int fd;
- static char namebuf[128];
- char *name;
- SDL_logical_joydecl(int oindex = index);
-
-#ifndef NO_LOGICAL_JOYSTICKS
- SDL_joylist_head(index, index);
-#endif
- name = NULL;
- fd = open(SDL_joylist[index].fname, O_RDONLY, 0);
- if ( fd >= 0 ) {
- if (
-#if SDL_INPUT_LINUXEV
- (ioctl(fd, EVIOCGNAME(sizeof(namebuf)), namebuf) <= 0) &&
-#endif
- (ioctl(fd, JSIOCGNAME(sizeof(namebuf)), namebuf) <= 0) ) {
- name = SDL_joylist[index].fname;
- } else {
- name = namebuf;
- }
- close(fd);
-
-
-#ifndef NO_LOGICAL_JOYSTICKS
- if (SDL_joylist[oindex].prev || SDL_joylist[oindex].next || index!=oindex)
- {
- LogicalSuffix(SDL_joylist[oindex].logicalno, namebuf, 128);
- }
-#endif
- }
- return name;
-}
-
-static int allocate_hatdata(SDL_Joystick *joystick)
-{
- int i;
-
- joystick->hwdata->hats = (struct hwdata_hat *)SDL_malloc(
- joystick->nhats * sizeof(struct hwdata_hat));
- if ( joystick->hwdata->hats == NULL ) {
- return(-1);
- }
- for ( i=0; i<joystick->nhats; ++i ) {
- joystick->hwdata->hats[i].axis[0] = 1;
- joystick->hwdata->hats[i].axis[1] = 1;
- }
- return(0);
-}
-
-static int allocate_balldata(SDL_Joystick *joystick)
-{
- int i;
-
- joystick->hwdata->balls = (struct hwdata_ball *)SDL_malloc(
- joystick->nballs * sizeof(struct hwdata_ball));
- if ( joystick->hwdata->balls == NULL ) {
- return(-1);
- }
- for ( i=0; i<joystick->nballs; ++i ) {
- joystick->hwdata->balls[i].axis[0] = 0;
- joystick->hwdata->balls[i].axis[1] = 0;
- }
- return(0);
-}
-
-static SDL_bool JS_ConfigJoystick(SDL_Joystick *joystick, int fd)
-{
- SDL_bool handled;
- unsigned char n;
- int old_axes, tmp_naxes, tmp_nhats, tmp_nballs;
- const char *name;
- char *env, env_name[128];
- int i;
-
- handled = SDL_FALSE;
-
- /* Default joystick device settings */
- if ( ioctl(fd, JSIOCGAXES, &n) < 0 ) {
- joystick->naxes = 2;
- } else {
- joystick->naxes = n;
- }
- if ( ioctl(fd, JSIOCGBUTTONS, &n) < 0 ) {
- joystick->nbuttons = 2;
- } else {
- joystick->nbuttons = n;
- }
-
- name = SDL_SYS_JoystickName(joystick->index);
- old_axes = joystick->naxes;
-
- /* Generic analog joystick support */
- if ( SDL_strstr(name, "Analog") == name && SDL_strstr(name, "-hat") ) {
- if ( SDL_sscanf(name,"Analog %d-axis %*d-button %d-hat",
- &tmp_naxes, &tmp_nhats) == 2 ) {
-
- joystick->naxes = tmp_naxes;
- joystick->nhats = tmp_nhats;
-
- handled = SDL_TRUE;
- }
- }
-
- /* Special joystick support */
- for ( i=0; i < SDL_arraysize(special_joysticks); ++i ) {
- if ( SDL_strcmp(name, special_joysticks[i].name) == 0 ) {
-
- joystick->naxes = special_joysticks[i].naxes;
- joystick->nhats = special_joysticks[i].nhats;
- joystick->nballs = special_joysticks[i].nballs;
-
- handled = SDL_TRUE;
- break;
- }
- }
-
- /* User environment joystick support */
- if ( (env = SDL_getenv("SDL_LINUX_JOYSTICK")) ) {
- *env_name = '\0';
- if ( *env == '\'' && SDL_sscanf(env, "'%[^']s'", env_name) == 1 )
- env += SDL_strlen(env_name)+2;
- else if ( SDL_sscanf(env, "%s", env_name) == 1 )
- env += SDL_strlen(env_name);
-
- if ( SDL_strcmp(name, env_name) == 0 ) {
-
- if ( SDL_sscanf(env, "%d %d %d", &tmp_naxes, &tmp_nhats,
- &tmp_nballs) == 3 ) {
-
- joystick->naxes = tmp_naxes;
- joystick->nhats = tmp_nhats;
- joystick->nballs = tmp_nballs;
-
- handled = SDL_TRUE;
- }
- }
- }
-
- /* Remap hats and balls */
- if (handled) {
- if ( joystick->nhats > 0 ) {
- if ( allocate_hatdata(joystick) < 0 ) {
- joystick->nhats = 0;
- }
- }
- if ( joystick->nballs > 0 ) {
- if ( allocate_balldata(joystick) < 0 ) {
- joystick->nballs = 0;
- }
- }
- }
-
- return(handled);
-}
-
-#if SDL_INPUT_LINUXEV
-
-static SDL_bool EV_ConfigJoystick(SDL_Joystick *joystick, int fd)
-{
- int i, t;
- unsigned long keybit[40];
- unsigned long absbit[40];
- unsigned long relbit[40];
-
- /* See if this device uses the new unified event API */
- if ( (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) >= 0) &&
- (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) >= 0) &&
- (ioctl(fd, EVIOCGBIT(EV_REL, sizeof(relbit)), relbit) >= 0) ) {
- joystick->hwdata->is_hid = SDL_TRUE;
-
- /* Get the number of buttons, axes, and other thingamajigs */
- for ( i=BTN_JOYSTICK; i < KEY_MAX; ++i ) {
- if ( test_bit(i, keybit) ) {
-#ifdef DEBUG_INPUT_EVENTS
- printf("Joystick has button: 0x%x\n", i);
-#endif
- joystick->hwdata->key_map[i-BTN_MISC] =
- joystick->nbuttons;
- ++joystick->nbuttons;
- }
- }
- for ( i=BTN_MISC; i < BTN_JOYSTICK; ++i ) {
- if ( test_bit(i, keybit) ) {
-#ifdef DEBUG_INPUT_EVENTS
- printf("Joystick has button: 0x%x\n", i);
-#endif
- joystick->hwdata->key_map[i-BTN_MISC] =
- joystick->nbuttons;
- ++joystick->nbuttons;
- }
- }
- for ( i=0; i<ABS_MAX; ++i ) {
- /* Skip hats */
- if ( i == ABS_HAT0X ) {
- i = ABS_HAT3Y;
- continue;
- }
- if ( test_bit(i, absbit) ) {
- int values[5];
-
- if ( ioctl(fd, EVIOCGABS(i), values) < 0 )
- continue;
-#ifdef DEBUG_INPUT_EVENTS
- printf("Joystick has absolute axis: %x\n", i);
- printf("Values = { %d, %d, %d, %d, %d }\n",
- values[0], values[1],
- values[2], values[3], values[4]);
-#endif /* DEBUG_INPUT_EVENTS */
- joystick->hwdata->abs_map[i] = joystick->naxes;
- if ( values[1] == values[2] ) {
- joystick->hwdata->abs_correct[i].used = 0;
- } else {
- joystick->hwdata->abs_correct[i].used = 1;
- joystick->hwdata->abs_correct[i].coef[0] =
- (values[2] + values[1]) / 2 - values[4];
- joystick->hwdata->abs_correct[i].coef[1] =
- (values[2] + values[1]) / 2 + values[4];
- t = ((values[2] - values[1]) / 2 - 2 * values[4]);
- if ( t != 0 ) {
- joystick->hwdata->abs_correct[i].coef[2] = (1 << 29) / t;
- } else {
- joystick->hwdata->abs_correct[i].coef[2] = 0;
- }
- }
- ++joystick->naxes;
- }
- }
- for ( i=ABS_HAT0X; i <= ABS_HAT3Y; i += 2 ) {
- if ( test_bit(i, absbit) || test_bit(i+1, absbit) ) {
-#ifdef DEBUG_INPUT_EVENTS
- printf("Joystick has hat %d\n",(i-ABS_HAT0X)/2);
-#endif
- ++joystick->nhats;
- }
- }
- if ( test_bit(REL_X, relbit) || test_bit(REL_Y, relbit) ) {
- ++joystick->nballs;
- }
-
- /* Allocate data to keep track of these thingamajigs */
- if ( joystick->nhats > 0 ) {
- if ( allocate_hatdata(joystick) < 0 ) {
- joystick->nhats = 0;
- }
- }
- if ( joystick->nballs > 0 ) {
- if ( allocate_balldata(joystick) < 0 ) {
- joystick->nballs = 0;
- }
- }
- }
- return(joystick->hwdata->is_hid);
-}
-
-#endif /* SDL_INPUT_LINUXEV */
-
-#ifndef NO_LOGICAL_JOYSTICKS
-static void ConfigLogicalJoystick(SDL_Joystick *joystick)
-{
- struct joystick_logical_layout* layout;
-
- layout = SDL_joylist[joystick->index].map->layout +
- SDL_joylist[joystick->index].logicalno;
-
- joystick->nbuttons = layout->nbuttons;
- joystick->nhats = layout->nhats;
- joystick->naxes = layout->naxes;
- joystick->nballs = layout->nballs;
-}
-#endif
-
-
-/* Function to open a joystick for use.
- The joystick to open is specified by the index field of the joystick.
- This should fill the nbuttons and naxes fields of the joystick structure.
- It returns 0, or -1 if there is an error.
- */
-int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
-{
- int fd;
- SDL_logical_joydecl(int realindex);
- SDL_logical_joydecl(SDL_Joystick *realjoy = NULL);
-
- /* Open the joystick and set the joystick file descriptor */
-#ifndef NO_LOGICAL_JOYSTICKS
- if (SDL_joylist[joystick->index].fname == NULL) {
- SDL_joylist_head(realindex, joystick->index);
- realjoy = SDL_JoystickOpen(realindex);
-
- if (realjoy == NULL)
- return(-1);
-
- fd = realjoy->hwdata->fd;
-
- } else {
- fd = open(SDL_joylist[joystick->index].fname, O_RDONLY, 0);
- }
- SDL_joylist[joystick->index].joy = joystick;
-#else
- fd = open(SDL_joylist[joystick->index].fname, O_RDONLY, 0);
-#endif
-
- if ( fd < 0 ) {
- SDL_SetError("Unable to open %s\n",
- SDL_joylist[joystick->index]);
- return(-1);
- }
- joystick->hwdata = (struct joystick_hwdata *)
- SDL_malloc(sizeof(*joystick->hwdata));
- if ( joystick->hwdata == NULL ) {
- SDL_OutOfMemory();
- close(fd);
- return(-1);
- }
- SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
- joystick->hwdata->fd = fd;
-
- /* Set the joystick to non-blocking read mode */
- fcntl(fd, F_SETFL, O_NONBLOCK);
-
- /* Get the number of buttons and axes on the joystick */
-#ifndef NO_LOGICAL_JOYSTICKS
- if (realjoy)
- ConfigLogicalJoystick(joystick);
- else
-#endif
-#if SDL_INPUT_LINUXEV
- if ( ! EV_ConfigJoystick(joystick, fd) )
-#endif
- JS_ConfigJoystick(joystick, fd);
-
- return(0);
-}
-
-#ifndef NO_LOGICAL_JOYSTICKS
-
-static SDL_Joystick* FindLogicalJoystick(
- SDL_Joystick *joystick, struct joystick_logical_mapping* v)
-{
- SDL_Joystick *logicaljoy;
- register int i;
-
- i = joystick->index;
- logicaljoy = NULL;
-
- /* get the fake joystick that will receive the event
- */
- for(;;) {
-
- if (SDL_joylist[i].logicalno == v->njoy) {
- logicaljoy = SDL_joylist[i].joy;
- break;
- }
-
- if (SDL_joylist[i].next == 0)
- break;
-
- i = SDL_joylist[i].next;
-
- }
-
- return logicaljoy;
-}
-
-static int LogicalJoystickButton(
- SDL_Joystick *joystick, Uint8 button, Uint8 state){
- struct joystick_logical_mapping* buttons;
- SDL_Joystick *logicaljoy = NULL;
-
- /* if there's no map then this is just a regular joystick
- */
- if (SDL_joylist[joystick->index].map == NULL)
- return 0;
-
- /* get the logical joystick that will receive the event
- */
- buttons = SDL_joylist[joystick->index].map->buttonmap+button;
- logicaljoy = FindLogicalJoystick(joystick, buttons);
-
- if (logicaljoy == NULL)
- return 1;
-
- SDL_PrivateJoystickButton(logicaljoy, buttons->nthing, state);
-
- return 1;
-}
-
-static int LogicalJoystickAxis(
- SDL_Joystick *joystick, Uint8 axis, Sint16 value)
-{
- struct joystick_logical_mapping* axes;
- SDL_Joystick *logicaljoy = NULL;
-
- /* if there's no map then this is just a regular joystick
- */
- if (SDL_joylist[joystick->index].map == NULL)
- return 0;
-
- /* get the logical joystick that will receive the event
- */
- axes = SDL_joylist[joystick->index].map->axismap+axis;
- logicaljoy = FindLogicalJoystick(joystick, axes);
-
- if (logicaljoy == NULL)
- return 1;
-
- SDL_PrivateJoystickAxis(logicaljoy, axes->nthing, value);
-
- return 1;
-}
-#endif /* USE_LOGICAL_JOYSTICKS */
-
-static __inline__
-void HandleHat(SDL_Joystick *stick, Uint8 hat, int axis, int value)
-{
- struct hwdata_hat *the_hat;
- const Uint8 position_map[3][3] = {
- { SDL_HAT_LEFTUP, SDL_HAT_UP, SDL_HAT_RIGHTUP },
- { SDL_HAT_LEFT, SDL_HAT_CENTERED, SDL_HAT_RIGHT },
- { SDL_HAT_LEFTDOWN, SDL_HAT_DOWN, SDL_HAT_RIGHTDOWN }
- };
- SDL_logical_joydecl(SDL_Joystick *logicaljoy = NULL);
- SDL_logical_joydecl(struct joystick_logical_mapping* hats = NULL);
-
- the_hat = &stick->hwdata->hats[hat];
- if ( value < 0 ) {
- value = 0;
- } else
- if ( value == 0 ) {
- value = 1;
- } else
- if ( value > 0 ) {
- value = 2;
- }
- if ( value != the_hat->axis[axis] ) {
- the_hat->axis[axis] = value;
-
-#ifndef NO_LOGICAL_JOYSTICKS
- /* if there's no map then this is just a regular joystick
- */
- if (SDL_joylist[stick->index].map != NULL) {
-
- /* get the fake joystick that will receive the event
- */
- hats = SDL_joylist[stick->index].map->hatmap+hat;
- logicaljoy = FindLogicalJoystick(stick, hats);
- }
-
- if (logicaljoy) {
- stick = logicaljoy;
- hat = hats->nthing;
- }
-#endif /* USE_LOGICAL_JOYSTICKS */
-
- SDL_PrivateJoystickHat(stick, hat,
- position_map[the_hat->axis[1]][the_hat->axis[0]]);
- }
-}
-
-static __inline__
-void HandleBall(SDL_Joystick *stick, Uint8 ball, int axis, int value)
-{
- stick->hwdata->balls[ball].axis[axis] += value;
-}
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-static __inline__ void JS_HandleEvents(SDL_Joystick *joystick)
-{
- struct js_event events[32];
- int i, len;
- Uint8 other_axis;
-
-#ifndef NO_LOGICAL_JOYSTICKS
- if (SDL_joylist[joystick->index].fname == NULL) {
- SDL_joylist_head(i, joystick->index);
- JS_HandleEvents(SDL_joylist[i].joy);
- return;
- }
-#endif
-
- while ((len=read(joystick->hwdata->fd, events, (sizeof events))) > 0) {
- len /= sizeof(events[0]);
- for ( i=0; i<len; ++i ) {
- switch (events[i].type & ~JS_EVENT_INIT) {
- case JS_EVENT_AXIS:
- if ( events[i].number < joystick->naxes ) {
-#ifndef NO_LOGICAL_JOYSTICKS
- if (!LogicalJoystickAxis(joystick,
- events[i].number, events[i].value))
-#endif
- SDL_PrivateJoystickAxis(joystick,
- events[i].number, events[i].value);
- break;
- }
- events[i].number -= joystick->naxes;
- other_axis = (events[i].number / 2);
- if ( other_axis < joystick->nhats ) {
- HandleHat(joystick, other_axis,
- events[i].number%2,
- events[i].value);
- break;
- }
- events[i].number -= joystick->nhats*2;
- other_axis = (events[i].number / 2);
- if ( other_axis < joystick->nballs ) {
- HandleBall(joystick, other_axis,
- events[i].number%2,
- events[i].value);
- break;
- }
- break;
- case JS_EVENT_BUTTON:
-#ifndef NO_LOGICAL_JOYSTICKS
- if (!LogicalJoystickButton(joystick,
- events[i].number, events[i].value))
-#endif
- SDL_PrivateJoystickButton(joystick,
- events[i].number, events[i].value);
- break;
- default:
- /* ?? */
- break;
- }
- }
- }
-}
-#if SDL_INPUT_LINUXEV
-static __inline__ int EV_AxisCorrect(SDL_Joystick *joystick, int which, int value)
-{
- struct axis_correct *correct;
-
- correct = &joystick->hwdata->abs_correct[which];
- if ( correct->used ) {
- if ( value > correct->coef[0] ) {
- if ( value < correct->coef[1] ) {
- return 0;
- }
- value -= correct->coef[1];
- } else {
- value -= correct->coef[0];
- }
- value *= correct->coef[2];
- value >>= 14;
- }
-
- /* Clamp and return */
- if ( value < -32768 ) return -32768;
- if ( value > 32767 ) return 32767;
-
- return value;
-}
-
-static __inline__ void EV_HandleEvents(SDL_Joystick *joystick)
-{
- struct input_event events[32];
- int i, len;
- int code;
-
-#ifndef NO_LOGICAL_JOYSTICKS
- if (SDL_joylist[joystick->index].fname == NULL) {
- SDL_joylist_head(i, joystick->index);
- return EV_HandleEvents(SDL_joylist[i].joy);
- }
-#endif
-
- while ((len=read(joystick->hwdata->fd, events, (sizeof events))) > 0) {
- len /= sizeof(events[0]);
- for ( i=0; i<len; ++i ) {
- code = events[i].code;
- switch (events[i].type) {
- case EV_KEY:
- if ( code >= BTN_MISC ) {
- code -= BTN_MISC;
-#ifndef NO_LOGICAL_JOYSTICKS
- if (!LogicalJoystickButton(joystick,
- joystick->hwdata->key_map[code],
- events[i].value))
-#endif
- SDL_PrivateJoystickButton(joystick,
- joystick->hwdata->key_map[code],
- events[i].value);
- }
- break;
- case EV_ABS:
- switch (code) {
- case ABS_HAT0X:
- case ABS_HAT0Y:
- case ABS_HAT1X:
- case ABS_HAT1Y:
- case ABS_HAT2X:
- case ABS_HAT2Y:
- case ABS_HAT3X:
- case ABS_HAT3Y:
- code -= ABS_HAT0X;
- HandleHat(joystick, code/2, code%2,
- events[i].value);
- break;
- default:
- events[i].value = EV_AxisCorrect(joystick, code, events[i].value);
-#ifndef NO_LOGICAL_JOYSTICKS
- if (!LogicalJoystickAxis(joystick,
- joystick->hwdata->abs_map[code],
- events[i].value))
-#endif
- SDL_PrivateJoystickAxis(joystick,
- joystick->hwdata->abs_map[code],
- events[i].value);
- break;
- }
- break;
- case EV_REL:
- switch (code) {
- case REL_X:
- case REL_Y:
- code -= REL_X;
- HandleBall(joystick, code/2, code%2,
- events[i].value);
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- }
- }
-}
-#endif /* SDL_INPUT_LINUXEV */
-
-void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
-{
- int i;
-
-#if SDL_INPUT_LINUXEV
- if ( joystick->hwdata->is_hid )
- EV_HandleEvents(joystick);
- else
-#endif
- JS_HandleEvents(joystick);
-
- /* Deliver ball motion updates */
- for ( i=0; i<joystick->nballs; ++i ) {
- int xrel, yrel;
-
- xrel = joystick->hwdata->balls[i].axis[0];
- yrel = joystick->hwdata->balls[i].axis[1];
- if ( xrel || yrel ) {
- joystick->hwdata->balls[i].axis[0] = 0;
- joystick->hwdata->balls[i].axis[1] = 0;
- SDL_PrivateJoystickBall(joystick, (Uint8)i, xrel, yrel);
- }
- }
-}
-
-/* Function to close a joystick after use */
-void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
-{
-#ifndef NO_LOGICAL_JOYSTICKS
- register int i;
- if (SDL_joylist[joystick->index].fname == NULL) {
- SDL_joylist_head(i, joystick->index);
- SDL_JoystickClose(SDL_joylist[i].joy);
- }
-#endif
-
- if ( joystick->hwdata ) {
-#ifndef NO_LOGICAL_JOYSTICKS
- if (SDL_joylist[joystick->index].fname != NULL)
-#endif
- close(joystick->hwdata->fd);
- if ( joystick->hwdata->hats ) {
- SDL_free(joystick->hwdata->hats);
- }
- if ( joystick->hwdata->balls ) {
- SDL_free(joystick->hwdata->balls);
- }
- SDL_free(joystick->hwdata);
- joystick->hwdata = NULL;
- }
-}
-
-/* Function to perform any system-specific joystick related cleanup */
-void SDL_SYS_JoystickQuit(void)
-{
- int i;
-
- for ( i=0; SDL_joylist[i].fname; ++i ) {
- SDL_free(SDL_joylist[i].fname);
- }
- SDL_joylist[0].fname = NULL;
-}
-
-#endif /* SDL_JOYSTICK_LINUX */
diff --git a/distrib/sdl-1.2.12/src/joystick/macos/SDL_sysjoystick.c b/distrib/sdl-1.2.12/src/joystick/macos/SDL_sysjoystick.c
deleted file mode 100644
index 25609b3..0000000
--- a/distrib/sdl-1.2.12/src/joystick/macos/SDL_sysjoystick.c
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_JOYSTICK_MACOS
-
-/* SDL stuff -- "SDL_sysjoystick.c"
- MacOS joystick functions by Frederick Reitberger
-
- The code that follows is meant for SDL. Use at your own risk.
-*/
-
-#include <InputSprocket.h>
-
-#include "SDL_joystick.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-
-
-/* The max number of joysticks we will detect */
-#define MAX_JOYSTICKS 16
-/* Limit ourselves to 32 elements per device */
-#define kMaxReferences 32
-
-#define ISpSymmetricAxisToFloat(axis) ((((float) axis) - kISpAxisMiddle) / (kISpAxisMaximum-kISpAxisMiddle))
-#define ISpAsymmetricAxisToFloat(axis) (((float) axis) / (kISpAxisMaximum))
-
-
-static ISpDeviceReference SYS_Joysticks[MAX_JOYSTICKS];
-static ISpElementListReference SYS_Elements[MAX_JOYSTICKS];
-static ISpDeviceDefinition SYS_DevDef[MAX_JOYSTICKS];
-
-struct joystick_hwdata
-{
- char name[64];
-/* Uint8 id;*/
- ISpElementReference refs[kMaxReferences];
- /* gonna need some sort of mapping info */
-};
-
-
-/* Function to scan the system for joysticks.
- * Joystick 0 should be the system default joystick.
- * This function should return the number of available joysticks, or -1
- * on an unrecoverable fatal error.
- */
-int SDL_SYS_JoystickInit(void)
-{
- static ISpDeviceClass classes[4] = {
- kISpDeviceClass_Joystick,
- #if kISpDeviceClass_Gamepad
- kISpDeviceClass_Gamepad,
- #endif
- kISpDeviceClass_Wheel,
- 0
- };
- OSErr err;
- int i;
- UInt32 count, numJoysticks;
-
- if ( (Ptr)0 == (Ptr)ISpStartup ) {
- SDL_SetError("InputSprocket not installed");
- return -1; // InputSprocket not installed
- }
-
- if( (Ptr)0 == (Ptr)ISpGetVersion ) {
- SDL_SetError("InputSprocket not version 1.1 or newer");
- return -1; // old version of ISp (not at least 1.1)
- }
-
- ISpStartup();
-
- /* Get all the joysticks */
- numJoysticks = 0;
- for ( i=0; classes[i]; ++i ) {
- count = 0;
- err = ISpDevices_ExtractByClass(
- classes[i],
- MAX_JOYSTICKS-numJoysticks,
- &count,
- &SYS_Joysticks[numJoysticks]);
- numJoysticks += count;
- }
-
- for(i = 0; i < numJoysticks; i++)
- {
- ISpDevice_GetDefinition(
- SYS_Joysticks[i], sizeof(ISpDeviceDefinition),
- &SYS_DevDef[i]);
-
- err = ISpElementList_New(
- 0, NULL,
- &SYS_Elements[i], 0);
-
- if (err) {
- SDL_OutOfMemory();
- return -1;
- }
-
- ISpDevice_GetElementList(
- SYS_Joysticks[i],
- &SYS_Elements[i]);
- }
-
- ISpDevices_Deactivate(numJoysticks, SYS_Joysticks);
-
- return numJoysticks;
-}
-
-/* Function to get the device-dependent name of a joystick */
-const char *SDL_SYS_JoystickName(int index)
-{
- static char name[64];
- int len;
-
- /* convert pascal string to c-string */
- len = SYS_DevDef[index].deviceName[0];
- if ( len >= sizeof(name) ) {
- len = (sizeof(name) - 1);
- }
- SDL_memcpy(name, &SYS_DevDef[index].deviceName[1], len);
- name[len] = '\0';
-
- return name;
-}
-
-/* Function to open a joystick for use.
- The joystick to open is specified by the index field of the joystick.
- This should fill the nbuttons and naxes fields of the joystick structure.
- It returns 0, or -1 if there is an error.
- */
-int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
-{
- int index;
- UInt32 count, gotCount, count2;
- long numAxis, numButtons, numHats, numBalls;
-
- count = kMaxReferences;
- count2 = 0;
- numAxis = numButtons = numHats = numBalls = 0;
-
- index = joystick->index;
-
- /* allocate memory for system specific hardware data */
- joystick->hwdata = (struct joystick_hwdata *) SDL_malloc(sizeof(*joystick->hwdata));
- if (joystick->hwdata == NULL)
- {
- SDL_OutOfMemory();
- return(-1);
- }
- SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
- SDL_strlcpy(joystick->hwdata->name, SDL_SYS_JoystickName(index), SDL_arraysize(joystick->hwdata->name));
- joystick->name = joystick->hwdata->name;
-
- ISpElementList_ExtractByKind(
- SYS_Elements[index],
- kISpElementKind_Axis,
- count,
- &gotCount,
- joystick->hwdata->refs);
-
- numAxis = gotCount;
- count -= gotCount;
- count2 += gotCount;
-
- ISpElementList_ExtractByKind(
- SYS_Elements[index],
- kISpElementKind_DPad,
- count,
- &gotCount,
- &(joystick->hwdata->refs[count2]));
-
- numHats = gotCount;
- count -= gotCount;
- count2 += gotCount;
-
- ISpElementList_ExtractByKind(
- SYS_Elements[index],
- kISpElementKind_Button,
- count,
- &gotCount,
- &(joystick->hwdata->refs[count2]));
-
- numButtons = gotCount;
- count -= gotCount;
- count2 += gotCount;
-
- joystick->naxes = numAxis;
- joystick->nhats = numHats;
- joystick->nballs = numBalls;
- joystick->nbuttons = numButtons;
-
- ISpDevices_Activate(
- 1,
- &SYS_Joysticks[index]);
-
- return 0;
-}
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
-{
- int i, j;
- ISpAxisData a;
- ISpDPadData b;
- //ISpDeltaData c;
- ISpButtonData d;
-
- for(i = 0, j = 0; i < joystick->naxes; i++, j++)
- {
- Sint16 value;
-
- ISpElement_GetSimpleState(
- joystick->hwdata->refs[j],
- &a);
- value = (ISpSymmetricAxisToFloat(a)* 32767.0);
- if ( value != joystick->axes[i] ) {
- SDL_PrivateJoystickAxis(joystick, i, value);
- }
- }
-
- for(i = 0; i < joystick->nhats; i++, j++)
- {
- Uint8 pos;
-
- ISpElement_GetSimpleState(
- joystick->hwdata->refs[j],
- &b);
- switch(b) {
- case kISpPadIdle:
- pos = SDL_HAT_CENTERED;
- break;
- case kISpPadLeft:
- pos = SDL_HAT_LEFT;
- break;
- case kISpPadUpLeft:
- pos = SDL_HAT_LEFTUP;
- break;
- case kISpPadUp:
- pos = SDL_HAT_UP;
- break;
- case kISpPadUpRight:
- pos = SDL_HAT_RIGHTUP;
- break;
- case kISpPadRight:
- pos = SDL_HAT_RIGHT;
- break;
- case kISpPadDownRight:
- pos = SDL_HAT_RIGHTDOWN;
- break;
- case kISpPadDown:
- pos = SDL_HAT_DOWN;
- break;
- case kISpPadDownLeft:
- pos = SDL_HAT_LEFTDOWN;
- break;
- }
- if ( pos != joystick->hats[i] ) {
- SDL_PrivateJoystickHat(joystick, i, pos);
- }
- }
-
- for(i = 0; i < joystick->nballs; i++, j++)
- {
- /* ignore balls right now */
- }
-
- for(i = 0; i < joystick->nbuttons; i++, j++)
- {
- ISpElement_GetSimpleState(
- joystick->hwdata->refs[j],
- &d);
- if ( d != joystick->buttons[i] ) {
- SDL_PrivateJoystickButton(joystick, i, d);
- }
- }
-}
-
-/* Function to close a joystick after use */
-void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
-{
- int index;
-
- index = joystick->index;
-
- ISpDevices_Deactivate(
- 1,
- &SYS_Joysticks[index]);
-}
-
-/* Function to perform any system-specific joystick related cleanup */
-void SDL_SYS_JoystickQuit(void)
-{
- ISpShutdown();
-}
-
-#endif /* SDL_JOYSTICK_MACOS */
diff --git a/distrib/sdl-1.2.12/src/joystick/mint/SDL_sysjoystick.c b/distrib/sdl-1.2.12/src/joystick/mint/SDL_sysjoystick.c
deleted file mode 100644
index 364e568..0000000
--- a/distrib/sdl-1.2.12/src/joystick/mint/SDL_sysjoystick.c
+++ /dev/null
@@ -1,683 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_JOYSTICK_MINT
-
-/*
- * Atari Joystick/Joypad drivers
- *
- * Patrice Mandin
- */
-
-#include <mint/cookie.h>
-#include <mint/osbind.h>
-
-#include "SDL_events.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-
-#include "../../video/ataricommon/SDL_ikbdinterrupt_s.h"
-#include "../../video/ataricommon/SDL_xbiosevents_c.h"
-#include "../../video/ataricommon/SDL_xbiosinterrupt_s.h"
-
-/*--- Const ---*/
-
-/* We can have:
- 1 joystick on IKBD port 1, read via hardware I/O
- or same joystick on IKBD port 1, read via xbios
- 1 joypad on port A (up to 4 with teamtap)
- or 2 joysticks on joypad port A
- or 1 analog paddle on joypad port A
- or 1 lightpen on joypad port A
- 1 joypad on port B (up to 4 with teamtap)
- or 2 joysticks on joypad port B
- or 1 analog paddle on joypad port B
- 2 joysticks on parallel port
-*/
-
-enum {
- IKBD_JOY1=0,
- XBIOS_JOY1,
- PORTA_PAD0,
- PORTA_PAD1,
- PORTA_PAD2,
- PORTA_PAD3,
- PORTB_PAD0,
- PORTB_PAD1,
- PORTB_PAD2,
- PORTB_PAD3,
- PORTA_JOY0,
- PORTA_JOY1,
- PORTB_JOY0,
- PORTB_JOY1,
- PORTA_LP,
- PORTA_ANPAD,
- PORTB_ANPAD,
-#if 0
- PARA_JOY0,
- PARA_JOY1,
-#endif
- MAX_JOYSTICKS
-};
-
-enum {
- MCH_ST=0,
- MCH_STE,
- MCH_TT,
- MCH_F30,
- MCH_CLONE,
- MCH_ARANYM
-};
-
-/* Joypad buttons
- * Procontroller note:
- * L,R are connected to 4,6
- * X,Y,Z are connected to 7,8,9
- */
-
-enum {
- JP_UP=0, JP_DOWN, JP_LEFT, JP_RIGHT,
- JP_KPMULT, JP_KP7, JP_KP4, JP_KP1,
- JP_KP0, JP_KP8, JP_KP5, JP_KP2,
- JP_KPNUM, JP_KP9, JP_KP6, JP_KP3,
- JP_PAUSE, JP_FIRE0, JP_UNDEF0, JP_FIRE1,
- JP_UNDEF1, JP_FIRE2, JP_UNDEF2, JP_OPTION
-};
-
-#define JP_NUM_BUTTONS 17
-
-#define PORT_JS_RIGHT (1<<0)
-#define PORT_JS_LEFT (1<<1)
-#define PORT_JS_DOWN (1<<2)
-#define PORT_JS_UP (1<<3)
-#define PORT_JS_FIRE (1<<4)
-
-/*--- Types ---*/
-
-typedef struct {
- SDL_bool enabled;
- unsigned char *name;
- Uint32 prevstate;
-} atarijoy_t;
-
-/*--- Variables ---*/
-
-static atarijoy_t atarijoysticks[MAX_JOYSTICKS]={
- {SDL_FALSE,"IKBD joystick port 1",0},
- {SDL_FALSE,"Xbios joystick port 1",0},
- {SDL_FALSE,"Joypad 0 port A",0},
- {SDL_FALSE,"Joypad 1 port A",0},
- {SDL_FALSE,"Joypad 2 port A",0},
- {SDL_FALSE,"Joypad 3 port A",0},
- {SDL_FALSE,"Joypad 0 port B",0},
- {SDL_FALSE,"Joypad 1 port B",0},
- {SDL_FALSE,"Joypad 2 port B",0},
- {SDL_FALSE,"Joypad 3 port B",0},
- {SDL_FALSE,"Joystick 0 port A",0},
- {SDL_FALSE,"Joystick 1 port A",0},
- {SDL_FALSE,"Joystick 0 port B",0},
- {SDL_FALSE,"Joystick 1 port B",0},
- {SDL_FALSE,"Lightpen port A",0},
- {SDL_FALSE,"Analog paddle port A",0},
- {SDL_FALSE,"Analog paddle port B",0}
-#if 0
- ,{SDL_FALSE,"Joystick 0 parallel port",0},
- {SDL_FALSE,"Joystick 1 parallel port",0}
-#endif
-};
-
-static const int jp_buttons[JP_NUM_BUTTONS]={
- JP_FIRE0, JP_FIRE1, JP_FIRE2, JP_PAUSE,
- JP_OPTION, JP_KPMULT, JP_KPNUM, JP_KP0,
- JP_KP1, JP_KP2, JP_KP3, JP_KP4,
- JP_KP5, JP_KP6, JP_KP7, JP_KP8,
- JP_KP9
-};
-
-static SDL_bool joypad_ports_enabled=SDL_FALSE;
-
-/* Updated joypad ports */
-static Uint16 jp_paddles[4];
-static Uint16 jp_lightpens[2];
-static Uint16 jp_directions;
-static Uint16 jp_fires;
-static Uint32 jp_joypads[8];
-
-/*--- Functions prototypes ---*/
-
-static int GetEnabledAtariJoystick(int index);
-static void UpdateJoypads(void);
-
-/*--- Functions ---*/
-
-int SDL_SYS_JoystickInit(void)
-{
- int i;
- unsigned long cookie_mch;
- const char *envr=SDL_getenv("SDL_JOYSTICK_ATARI");
-
-#define TEST_JOY_ENABLED(env,idstring,num) \
- if (SDL_strstr(env,idstring"-off")) { \
- atarijoysticks[num].enabled=SDL_FALSE; \
- } \
- if (SDL_strstr(env,idstring"-on")) { \
- atarijoysticks[num].enabled=SDL_TRUE; \
- }
-
- /* Cookie _MCH present ? if not, assume ST machine */
- if (Getcookie(C__MCH, &cookie_mch) != C_FOUND) {
- cookie_mch = MCH_ST << 16;
- }
-
- /* Enable some default joysticks */
- if ((cookie_mch == MCH_ST<<16) || ((cookie_mch>>16) == MCH_STE) ||
- (cookie_mch == MCH_TT<<16) || (cookie_mch == MCH_F30<<16) ||
- (cookie_mch == MCH_ARANYM<<16)) {
- atarijoysticks[IKBD_JOY1].enabled=(SDL_AtariIkbd_enabled!=0);
- }
- if ((cookie_mch == MCH_STE<<16) || (cookie_mch == MCH_F30<<16)) {
- atarijoysticks[PORTA_PAD0].enabled =
- atarijoysticks[PORTA_PAD1].enabled =
- atarijoysticks[PORTA_PAD2].enabled =
- atarijoysticks[PORTA_PAD3].enabled =
- atarijoysticks[PORTB_PAD0].enabled =
- atarijoysticks[PORTB_PAD1].enabled =
- atarijoysticks[PORTB_PAD2].enabled =
- atarijoysticks[PORTB_PAD3].enabled = SDL_TRUE;
- }
- if (!atarijoysticks[IKBD_JOY1].enabled) {
- atarijoysticks[XBIOS_JOY1].enabled=(SDL_AtariXbios_enabled!=0);
- }
-
- /* Read environment for joysticks to enable */
- if (envr) {
- /* IKBD on any Atari, maybe clones */
- if ((cookie_mch == MCH_ST<<16) || ((cookie_mch>>16) == MCH_STE) ||
- (cookie_mch == MCH_TT<<16) || (cookie_mch == MCH_F30<<16) ||
- (cookie_mch == MCH_ARANYM<<16)) {
- if (SDL_AtariIkbd_enabled!=0) {
- TEST_JOY_ENABLED(envr, "ikbd-joy1", IKBD_JOY1);
- }
- }
- /* Joypads ports only on STE and Falcon */
- if ((cookie_mch == MCH_STE<<16) || (cookie_mch == MCH_F30<<16)) {
- TEST_JOY_ENABLED(envr, "porta-pad", PORTA_PAD0);
- if (!atarijoysticks[PORTA_PAD0].enabled) {
- TEST_JOY_ENABLED(envr, "porta-joy0", PORTA_JOY0);
- TEST_JOY_ENABLED(envr, "porta-joy1", PORTA_JOY1);
- if (!(atarijoysticks[PORTA_JOY0].enabled) && !(atarijoysticks[PORTA_JOY1].enabled)) {
- TEST_JOY_ENABLED(envr, "porta-lp", PORTA_LP);
- if (!atarijoysticks[PORTA_LP].enabled) {
- TEST_JOY_ENABLED(envr, "porta-anpad", PORTA_ANPAD);
- }
- }
- }
-
- TEST_JOY_ENABLED(envr, "portb-pad", PORTB_PAD0);
- if (!atarijoysticks[PORTB_PAD0].enabled) {
- TEST_JOY_ENABLED(envr, "portb-joy0", PORTB_JOY0);
- TEST_JOY_ENABLED(envr, "portb-joy1", PORTB_JOY1);
- if (!(atarijoysticks[PORTB_JOY0].enabled) && !(atarijoysticks[PORTB_JOY1].enabled)) {
- TEST_JOY_ENABLED(envr, "portb-anpad", PORTB_ANPAD);
- }
- }
- }
-
- if (!atarijoysticks[IKBD_JOY1].enabled) {
- if (SDL_AtariXbios_enabled!=0) {
- TEST_JOY_ENABLED(envr, "xbios-joy1", XBIOS_JOY1);
- }
- }
-#if 0
- /* Parallel port on any Atari, maybe clones */
- if ((cookie_mch == MCH_ST<<16) || ((cookie_mch>>16) == MCH_STE) ||
- (cookie_mch == MCH_TT<<16) || (cookie_mch == MCH_F30<<16)) {
- TEST_JOY_ENABLED(envr, "para-joy0", PARA_JOY0);
- TEST_JOY_ENABLED(envr, "para-joy1", PARA_JOY1);
- }
-#endif
- }
-
- /* Need to update joypad ports ? */
- joypad_ports_enabled=SDL_FALSE;
- for (i=PORTA_PAD0;i<=PORTB_ANPAD;i++) {
- if (atarijoysticks[i].enabled) {
- joypad_ports_enabled=SDL_TRUE;
- break;
- }
- }
-
- SDL_numjoysticks = 0;
- for (i=0;i<MAX_JOYSTICKS;i++) {
- if (atarijoysticks[i].enabled) {
- ++SDL_numjoysticks;
- }
- }
-
- return(SDL_numjoysticks);
-}
-
-static int GetEnabledAtariJoystick(int index)
-{
- int i,j;
-
- /* Return the nth'index' enabled atari joystick */
- j=0;
- for (i=0;i<MAX_JOYSTICKS;i++) {
- if (!atarijoysticks[i].enabled) {
- continue;
- }
-
- if (j==index) {
- break;
- }
-
- ++j;
- }
- if (i==MAX_JOYSTICKS)
- return -1;
-
- return i;
-}
-
-const char *SDL_SYS_JoystickName(int index)
-{
- int numjoystick;
-
- numjoystick=GetEnabledAtariJoystick(index);
- if (numjoystick==-1)
- return NULL;
-
- return(atarijoysticks[numjoystick].name);
-}
-
-int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
-{
- int numjoystick;
-
- numjoystick=GetEnabledAtariJoystick(joystick->index);
- if (numjoystick==-1)
- return -1;
-
- joystick->naxes=0;
- joystick->nhats=0;
- joystick->nballs=0;
-
- switch(numjoystick) {
- case PORTA_PAD0:
- case PORTA_PAD1:
- case PORTA_PAD2:
- case PORTA_PAD3:
- case PORTB_PAD0:
- case PORTB_PAD1:
- case PORTB_PAD2:
- case PORTB_PAD3:
- joystick->nhats=1;
- joystick->nbuttons=JP_NUM_BUTTONS;
- break;
- case PORTA_LP:
- case PORTA_ANPAD:
- case PORTB_ANPAD:
- joystick->naxes=2;
- joystick->nbuttons=2;
- break;
- default:
- joystick->nhats=1;
- joystick->nbuttons=1;
- break;
- }
-
- return(0);
-}
-
-void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
-{
- int numjoystick;
- Uint8 hatstate;
- Uint32 curstate,prevstate;
-
- numjoystick=GetEnabledAtariJoystick(joystick->index);
- if (numjoystick==-1)
- return;
-
- prevstate = atarijoysticks[numjoystick].prevstate;
-
- if (joypad_ports_enabled) {
- Supexec(UpdateJoypads);
- }
-
- switch (numjoystick) {
- case IKBD_JOY1:
- case XBIOS_JOY1:
- {
- curstate = 0;
-
- if (numjoystick==IKBD_JOY1) {
- curstate = SDL_AtariIkbd_joystick & 0xff;
- }
- if (numjoystick==XBIOS_JOY1) {
- curstate = SDL_AtariXbios_joystick & 0xff;
- }
-
- if (curstate != prevstate) {
- hatstate = SDL_HAT_CENTERED;
- if (curstate & IKBD_JOY_LEFT) {
- hatstate |= SDL_HAT_LEFT;
- }
- if (curstate & IKBD_JOY_RIGHT) {
- hatstate |= SDL_HAT_RIGHT;
- }
- if (curstate & IKBD_JOY_UP) {
- hatstate |= SDL_HAT_UP;
- }
- if (curstate & IKBD_JOY_DOWN) {
- hatstate |= SDL_HAT_DOWN;
- }
- SDL_PrivateJoystickHat(joystick, 0, hatstate);
-
- /* Button */
- if ((curstate & IKBD_JOY_FIRE) && !(prevstate & IKBD_JOY_FIRE)) {
- SDL_PrivateJoystickButton(joystick,0,SDL_PRESSED);
- }
- if (!(curstate & IKBD_JOY_FIRE) && (prevstate & IKBD_JOY_FIRE)) {
- SDL_PrivateJoystickButton(joystick,0,SDL_RELEASED);
- }
- }
- atarijoysticks[numjoystick].prevstate = curstate;
- }
- break;
- case PORTA_PAD0:
- case PORTA_PAD1:
- case PORTA_PAD2:
- case PORTA_PAD3:
- case PORTB_PAD0:
- case PORTB_PAD1:
- case PORTB_PAD2:
- case PORTB_PAD3:
- {
- int numjoypad,i;
-
- numjoypad = 0;
- switch(numjoystick) {
- case PORTA_PAD0:
- numjoypad = 0; break;
- case PORTA_PAD1:
- numjoypad = 1; break;
- case PORTA_PAD2:
- numjoypad = 2; break;
- case PORTA_PAD3:
- numjoypad = 3; break;
- case PORTB_PAD0:
- numjoypad = 4; break;
- case PORTB_PAD1:
- numjoypad = 5; break;
- case PORTB_PAD2:
- numjoypad = 6; break;
- case PORTB_PAD3:
- numjoypad = 7; break;
- }
-
- curstate=jp_joypads[numjoypad];
- if (curstate!=prevstate) {
- hatstate = SDL_HAT_CENTERED;
- if (curstate & (1<<JP_LEFT)) {
- hatstate |= SDL_HAT_LEFT;
- }
- if (curstate & (1<<JP_RIGHT)) {
- hatstate |= SDL_HAT_RIGHT;
- }
- if (curstate & (1<<JP_UP)) {
- hatstate |= SDL_HAT_UP;
- }
- if (curstate & (1<<JP_DOWN)) {
- hatstate |= SDL_HAT_DOWN;
- }
- SDL_PrivateJoystickHat(joystick, 0, hatstate);
-
- /* Buttons */
- for (i=0;i<JP_NUM_BUTTONS;i++) {
- int button;
-
- button=1<<jp_buttons[i];
-
- if ((curstate & button) && !(prevstate & button)) {
- SDL_PrivateJoystickButton(joystick,i,SDL_PRESSED);
- }
- if (!(curstate & button) && (prevstate & button)) {
- SDL_PrivateJoystickButton(joystick,i,SDL_RELEASED);
- }
- }
- }
- atarijoysticks[numjoystick].prevstate = curstate;
- }
- break;
- case PORTA_JOY0:
- case PORTA_JOY1:
- case PORTB_JOY0:
- case PORTB_JOY1:
- {
- int fire_shift=0,dir_shift=0;
-
- if (numjoystick==PORTA_JOY0) { fire_shift=0; dir_shift=0; }
- if (numjoystick==PORTA_JOY1) { fire_shift=1; dir_shift=4; }
- if (numjoystick==PORTB_JOY0) { fire_shift=2; dir_shift=8; }
- if (numjoystick==PORTB_JOY1) { fire_shift=3; dir_shift=12; }
-
- curstate = (jp_directions>>dir_shift) & 15;
- curstate |= ((jp_fires>>fire_shift) & 1)<<4;
-
- if (curstate != prevstate) {
- hatstate = SDL_HAT_CENTERED;
- if (curstate & PORT_JS_LEFT) {
- hatstate |= SDL_HAT_LEFT;
- }
- if (curstate & PORT_JS_RIGHT) {
- hatstate |= SDL_HAT_RIGHT;
- }
- if (curstate & PORT_JS_UP) {
- hatstate |= SDL_HAT_UP;
- }
- if (curstate & PORT_JS_DOWN) {
- hatstate |= SDL_HAT_DOWN;
- }
- SDL_PrivateJoystickHat(joystick, 0, hatstate);
-
- /* Button */
- if ((curstate & PORT_JS_FIRE) && !(prevstate & PORT_JS_FIRE)) {
- SDL_PrivateJoystickButton(joystick,0,SDL_PRESSED);
- }
- if (!(curstate & PORT_JS_FIRE) && (prevstate & PORT_JS_FIRE)) {
- SDL_PrivateJoystickButton(joystick,0,SDL_RELEASED);
- }
- }
- atarijoysticks[numjoystick].prevstate = curstate;
- }
- break;
- case PORTA_LP:
- {
- int i;
-
- curstate = jp_lightpens[0]>>1;
- curstate |= (jp_lightpens[1]>>1)<<15;
- curstate |= (jp_fires & 3)<<30;
-
- if (curstate != prevstate) {
- /* X axis */
- SDL_PrivateJoystickAxis(joystick,0,jp_lightpens[0] ^ 0x8000);
- /* Y axis */
- SDL_PrivateJoystickAxis(joystick,1,jp_lightpens[1] ^ 0x8000);
- /* Buttons */
- for (i=0;i<2;i++) {
- int button;
-
- button=1<<(30+i);
-
- if ((curstate & button) && !(prevstate & button)) {
- SDL_PrivateJoystickButton(joystick,i,SDL_PRESSED);
- }
- if (!(curstate & button) && (prevstate & button)) {
- SDL_PrivateJoystickButton(joystick,i,SDL_RELEASED);
- }
- }
- }
- atarijoysticks[numjoystick].prevstate = curstate;
- }
- break;
- case PORTA_ANPAD:
- case PORTB_ANPAD:
- {
- int numpaddle, i;
-
- numpaddle=0<<1;
- if (numjoystick==PORTB_ANPAD) numpaddle=1<<1;
-
- curstate = jp_paddles[numpaddle]>>1;
- curstate |= (jp_paddles[numpaddle+1]>>1)<<15;
- curstate |= ((jp_fires>>numpaddle) & 3)<<30;
-
- if (curstate != prevstate) {
- /* X axis */
- SDL_PrivateJoystickAxis(joystick,0,jp_paddles[numpaddle] ^ 0x8000);
- /* Y axis */
- SDL_PrivateJoystickAxis(joystick,1,jp_paddles[numpaddle+1] ^ 0x8000);
- /* Buttons */
- for (i=0;i<2;i++) {
- int button;
-
- button=1<<(30+i);
-
- if ((curstate & button) && !(prevstate & button)) {
- SDL_PrivateJoystickButton(joystick,i,SDL_PRESSED);
- }
- if (!(curstate & button) && (prevstate & button)) {
- SDL_PrivateJoystickButton(joystick,i,SDL_RELEASED);
- }
- }
- }
- atarijoysticks[numjoystick].prevstate = curstate;
- }
- break;
-#if 0
- case PARA_JOY0:
- case PARA_JOY1:
- break;
-#endif
- };
-
- return;
-}
-
-void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
-{
- return;
-}
-
-void SDL_SYS_JoystickQuit(void)
-{
- SDL_numjoysticks=0;
- return;
-}
-
-/*--- Joypad I/O read/write interface ---*/
-
-#define JOYPAD_IO_BASE (0xffff9200)
-struct JOYPAD_IO_S {
- Uint16 fires;
- Uint16 directions;
- Uint16 dummy1[6];
- Uint16 paddles[4];
- Uint16 dummy2[4];
- Uint16 lightpens[2];
-};
-#define JOYPAD_IO ((*(volatile struct JOYPAD_IO_S *)JOYPAD_IO_BASE))
-
-static const Uint16 joypad_masks[8*4]={
- 0xfffe, 0xfffd, 0xfffb, 0xfff7,
- 0xfff0, 0xfff1, 0xfff2, 0xfff3,
- 0xfff4, 0xfff5, 0xfff6, 0xfff8,
- 0xfff9, 0xfffa, 0xfffc, 0xffff,
- 0xffef, 0xffdf, 0xffbf, 0xff7f,
- 0xff0f, 0xff1f, 0xff2f, 0xff3f,
- 0xff4f, 0xff5f, 0xff6f, 0xff8f,
- 0xff9f, 0xffaf, 0xffcf, 0xffff
-};
-
-static void UpdateJoypads(void)
-{
- Uint16 tmp, i, j;
- Uint32 cur_fire, cur_dir;
-
- /*--- This function is called in supervisor mode ---*/
-
- /* Update joysticks */
- jp_fires = (~(JOYPAD_IO.fires)) & 15;
- jp_directions = (~(JOYPAD_IO.directions));
-
- /* Update lightpen */
- tmp = JOYPAD_IO.lightpens[0] & 1023;
- jp_lightpens[0] = (tmp<<6) | (tmp>>4);
- tmp = JOYPAD_IO.lightpens[1] & 1023;
- jp_lightpens[1] = (tmp<<6) | (tmp>>4);
-
- /* Update paddles */
- tmp = (JOYPAD_IO.paddles[0] & 255);
- jp_paddles[0] = (tmp<<8) | tmp;
- tmp = (JOYPAD_IO.paddles[1] & 255);
- jp_paddles[1] = (tmp<<8) | tmp;
- tmp = (JOYPAD_IO.paddles[2] & 255);
- jp_paddles[2] = (tmp<<8) | tmp;
- tmp = (JOYPAD_IO.paddles[3] & 255);
- jp_paddles[3] = (tmp<<8) | tmp;
-
- /* Update joypads on teamtap port A */
- for (i=0; i<4; i++) {
- jp_joypads[i] = 0;
- for (j=0; j<4; j++) {
- JOYPAD_IO.directions = joypad_masks[(i*4)+j];
-
- cur_fire = (~(JOYPAD_IO.fires) & 3)<<16;
- cur_dir = (~(JOYPAD_IO.directions)>>8) & 15;
-
- jp_joypads[i] |= cur_fire<<(j*2);
- jp_joypads[i] |= cur_dir<<(j*4);
- }
- }
-
- /* Update joypads on teamtap port B */
- for (i=4; i<8; i++) {
- jp_joypads[i] = 0;
- for (j=0; j<4; j++) {
- JOYPAD_IO.directions = joypad_masks[(i*4)+j];
-
- cur_fire = (~(JOYPAD_IO.fires) & 0xc)<<14;
- cur_dir = (~(JOYPAD_IO.directions)>>12) & 15;
-
- jp_joypads[i] |= cur_fire<<(j*2);
- jp_joypads[i] |= cur_dir<<(j*4);
- }
- }
-
- JOYPAD_IO.directions=0xffff;
-}
-
-#endif /* SDL_JOYSTICK_MINT */
diff --git a/distrib/sdl-1.2.12/src/joystick/os2/SDL_sysjoystick.c b/distrib/sdl-1.2.12/src/joystick/os2/SDL_sysjoystick.c
deleted file mode 100644
index 15dca4e..0000000
--- a/distrib/sdl-1.2.12/src/joystick/os2/SDL_sysjoystick.c
+++ /dev/null
@@ -1,668 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_JOYSTICK_OS2
-
-/* OS/2 Joystick driver, contributed by Daniel Caetano */
-
-#include <mem.h>
-
-#define INCL_DOSDEVICES
-#define INCL_DOSDEVIOCTL
-#define INCL_DOSMEMMGR
-#include <os2.h>
-#include "joyos2.h"
-
-#include "SDL_joystick.h"
-#include "SDL_events.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-
-HFILE hJoyPort = NULL; /* Joystick GAME$ Port Address */
-#define MAX_JOYSTICKS 2 /* Maximum of two joysticks */
-#define MAX_AXES 4 /* each joystick can have up to 4 axes */
-#define MAX_BUTTONS 8 /* 8 buttons */
-#define MAX_HATS 0 /* 0 hats - OS/2 doesn't support it */
-#define MAX_BALLS 0 /* and 0 balls - OS/2 doesn't support it */
-#define AXIS_MIN -32768 /* minimum value for axes coordinate */
-#define AXIS_MAX 32767 /* maximum value for axes coordinate */
-#define MAX_JOYNAME 128 /* Joystick name may have 128 characters */
-/* limit axes to 256 possible positions to filter out noise */
-#define JOY_AXIS_THRESHOLD (((AXIS_MAX)-(AXIS_MIN))/256)
-/* Calc Button Flag for buttons A to D */
-#define JOY_BUTTON_FLAG(n) (1<<n)
-
-/* Joystick data... hold information about detected devices */
-typedef struct SYS_JoyData_s
-{
-Sint8 id; // Device ID
-char szDeviceName[MAX_JOYNAME]; // Device Name
-char axes; // Number of axes
-char buttons; // Number of buttons
-char hats; // Number of buttons
-char balls; // Number of buttons
-int axes_min[MAX_AXES]; // minimum callibration value for axes
-int axes_med[MAX_AXES]; // medium callibration value for axes
-int axes_max[MAX_AXES]; // maximum callibration value for axes
-int buttoncalc[4]; // Used for buttons 5, 6, 7 and 8.
-} SYS_JoyData_t, *SYS_JoyData_p;
-
-SYS_JoyData_t SYS_JoyData[MAX_JOYSTICKS];
-
-
-/* Structure used to convert data from OS/2 driver format to SDL format */
-struct joystick_hwdata
-{
-Sint8 id;
-struct _transaxes
- {
- int offset; /* Center Offset */
- float scale1; /* Center to left/up Scale */
- float scale2; /* Center to right/down Scale */
- } transaxes[MAX_AXES];
-};
-
-/* Structure used to get values from Joystick Environment Variable */
-struct _joycfg
-{
-char name[MAX_JOYNAME];
-unsigned int axes;
-unsigned int buttons;
-unsigned int hats;
-unsigned int balls;
-};
-
-/* OS/2 Implementation Function Prototypes */
-APIRET joyPortOpen(HFILE * hGame);
-void joyPortClose(HFILE * hGame);
-int joyGetData(char *joyenv, char *name, char stopchar, size_t maxchars);
-int joyGetEnv(struct _joycfg * joydata);
-
-
-
-/************************************************************************/
-/* Function to scan the system for joysticks. */
-/* This function should set SDL_numjoysticks to the number of available */
-/* joysticks. Joystick 0 should be the system default joystick. */
-/* It should return 0, or -1 on an unrecoverable fatal error. */
-/************************************************************************/
-int SDL_SYS_JoystickInit(void)
-{
-APIRET rc; /* Generic OS/2 return code */
-GAME_PORT_STRUCT stJoyStatus; /* Joystick Status Structure */
-GAME_PARM_STRUCT stGameParms; /* Joystick Parameter Structure */
-GAME_CALIB_STRUCT stGameCalib; /* Calibration Struct */
-ULONG ulDataLen; /* Size of data */
-ULONG ulLastTick; /* Tick Counter for timing operations */
-Uint8 maxdevs; /* Maximum number of devices */
-Uint8 numdevs; /* Number of present devices */
-Uint8 maxbut; /* Maximum number of buttons... */
-Uint8 i; /* Temporary Count Vars */
-Uint8 ucNewJoystickMask; /* Mask for Joystick Detection */
-struct _joycfg joycfg; /* Joy Configuration from envvar */
-
-
-/* Get Max Number of Devices */
-rc = joyPortOpen(&hJoyPort); /* Open GAME$ port */
-if (rc != 0) return 0; /* Cannot open... report no joystick */
-ulDataLen = sizeof(stGameParms);
-rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_GET_PARMS,
- NULL, 0, NULL, &stGameParms, ulDataLen, &ulDataLen); /* Ask device info */
-if (rc != 0)
- {
- joyPortClose(&hJoyPort);
- SDL_SetError("Could not read joystick port.");
- return -1;
- }
-if (stGameParms.useA != 0) maxdevs++;
-if (stGameParms.useB != 0) maxdevs++;
-if ( maxdevs > MAX_JOYSTICKS ) maxdevs = MAX_JOYSTICKS;
-
-/* Defines min/max axes values (callibration) */
-ulDataLen = sizeof(stGameCalib);
-rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_GET_CALIB,
- NULL, 0, NULL, &stGameCalib, ulDataLen, &ulDataLen);
-if (rc != 0)
- {
- joyPortClose(&hJoyPort);
- SDL_SetError("Could not read callibration data.");
- return -1;
- }
-
-/* Determine how many joysticks are active */
-numdevs = 0; /* Points no device */
-ucNewJoystickMask = 0x0F; /* read all 4 joystick axis */
-ulDataLen = sizeof(ucNewJoystickMask);
-rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_PORT_RESET,
- &ucNewJoystickMask, ulDataLen, &ulDataLen, NULL, 0, NULL);
-if (rc == 0)
- {
- ulDataLen = sizeof(stJoyStatus);
- rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_PORT_GET,
- NULL, 0, NULL, &stJoyStatus, ulDataLen, &ulDataLen);
- if (rc != 0)
- {
- joyPortClose(&hJoyPort);
- SDL_SetError("Could not call joystick port.");
- return -1;
- }
- ulLastTick = stJoyStatus.ulJs_Ticks;
- while (stJoyStatus.ulJs_Ticks == ulLastTick)
- {
- rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_PORT_GET,
- NULL, 0, NULL, &stJoyStatus, ulDataLen, &ulDataLen);
- }
- if ((stJoyStatus.ucJs_JoyStickMask & 0x03) > 0) numdevs++;
- if (((stJoyStatus.ucJs_JoyStickMask >> 2) & 0x03) > 0) numdevs++;
- }
-
-if (numdevs>maxdevs) numdevs=maxdevs;
-
-/* If *any* joystick was detected... Let's configure SDL for them */
-if (numdevs > 0)
- {
- /* Verify if it is a "user defined" joystick */
- if (joyGetEnv(&joycfg))
- {
- GAME_3POS_STRUCT * axis[4];
- axis[0] = &stGameCalib.Ax;
- axis[1] = &stGameCalib.Ay;
- axis[2] = &stGameCalib.Bx;
- axis[3] = &stGameCalib.By;
- /* Say it has one device only (user defined is always one device only) */
- numdevs = 1;
- /* Define Device 0 as... */
- SYS_JoyData[0].id=0;
- /* Define Number of Axes... up to 4 */
- if (joycfg.axes>MAX_AXES) joycfg.axes = MAX_AXES;
- SYS_JoyData[0].axes = joycfg.axes;
- /* Define number of buttons... 8 if 2 axes, 6 if 3 axes and 4 if 4 axes */
- maxbut = MAX_BUTTONS;
- if (joycfg.axes>2) maxbut-=((joycfg.axes-2)<<1); /* MAX_BUTTONS - 2*(axes-2) */
- if (joycfg.buttons > maxbut) joycfg.buttons = maxbut;
- SYS_JoyData[0].buttons = joycfg.buttons;
- /* Define number of hats */
- if (joycfg.hats > MAX_HATS) joycfg.hats = MAX_HATS;
- SYS_JoyData[0].hats = joycfg.hats;
- /* Define number of balls */
- if (joycfg.balls > MAX_BALLS) joycfg.balls = MAX_BALLS;
- SYS_JoyData[0].balls = joycfg.balls;
- /* Initialize Axes Callibration Values */
- for (i=0; i<joycfg.axes; i++)
- {
- SYS_JoyData[0].axes_min[i] = axis[i]->lower;
- SYS_JoyData[0].axes_med[i] = axis[i]->centre;
- SYS_JoyData[0].axes_max[i] = axis[i]->upper;
- }
- /* Initialize Buttons 5 to 8 structures */
- if (joycfg.buttons>=5) SYS_JoyData[0].buttoncalc[0]=((axis[2]->lower+axis[3]->centre)>>1);
- if (joycfg.buttons>=6) SYS_JoyData[0].buttoncalc[1]=((axis[3]->lower+axis[3]->centre)>>1);
- if (joycfg.buttons>=7) SYS_JoyData[0].buttoncalc[2]=((axis[2]->upper+axis[3]->centre)>>1);
- if (joycfg.buttons>=8) SYS_JoyData[0].buttoncalc[3]=((axis[3]->upper+axis[3]->centre)>>1);
- /* Intialize Joystick Name */
- SDL_strlcpy (SYS_JoyData[0].szDeviceName,joycfg.name, SDL_arraysize(SYS_JoyData[0].szDeviceName));
- }
- /* Default Init ... autoconfig */
- else
- {
- /* if two devices were detected... configure as Joy1 4 axis and Joy2 2 axis */
- if (numdevs==2)
- {
- /* Define Device 0 as 4 axes, 4 buttons */
- SYS_JoyData[0].id=0;
- SYS_JoyData[0].axes = 4;
- SYS_JoyData[0].buttons = 4;
- SYS_JoyData[0].hats = 0;
- SYS_JoyData[0].balls = 0;
- SYS_JoyData[0].axes_min[0] = stGameCalib.Ax.lower;
- SYS_JoyData[0].axes_med[0] = stGameCalib.Ax.centre;
- SYS_JoyData[0].axes_max[0] = stGameCalib.Ax.upper;
- SYS_JoyData[0].axes_min[1] = stGameCalib.Ay.lower;
- SYS_JoyData[0].axes_med[1] = stGameCalib.Ay.centre;
- SYS_JoyData[0].axes_max[1] = stGameCalib.Ay.upper;
- SYS_JoyData[0].axes_min[2] = stGameCalib.Bx.lower;
- SYS_JoyData[0].axes_med[2] = stGameCalib.Bx.centre;
- SYS_JoyData[0].axes_max[2] = stGameCalib.Bx.upper;
- SYS_JoyData[0].axes_min[3] = stGameCalib.By.lower;
- SYS_JoyData[0].axes_med[3] = stGameCalib.By.centre;
- SYS_JoyData[0].axes_max[3] = stGameCalib.By.upper;
- /* Define Device 1 as 2 axes, 2 buttons */
- SYS_JoyData[1].id=1;
- SYS_JoyData[1].axes = 2;
- SYS_JoyData[1].buttons = 2;
- SYS_JoyData[1].hats = 0;
- SYS_JoyData[1].balls = 0;
- SYS_JoyData[1].axes_min[0] = stGameCalib.Bx.lower;
- SYS_JoyData[1].axes_med[0] = stGameCalib.Bx.centre;
- SYS_JoyData[1].axes_max[0] = stGameCalib.Bx.upper;
- SYS_JoyData[1].axes_min[1] = stGameCalib.By.lower;
- SYS_JoyData[1].axes_med[1] = stGameCalib.By.centre;
- SYS_JoyData[1].axes_max[1] = stGameCalib.By.upper;
- }
- /* One joystick only? */
- else
- {
- /* If it is joystick A... */
- if ((stJoyStatus.ucJs_JoyStickMask & 0x03) > 0)
- {
- /* Define Device 0 as 2 axes, 4 buttons */
- SYS_JoyData[0].id=0;
- SYS_JoyData[0].axes = 2;
- SYS_JoyData[0].buttons = 4;
- SYS_JoyData[0].hats = 0;
- SYS_JoyData[0].balls = 0;
- SYS_JoyData[0].axes_min[0] = stGameCalib.Ax.lower;
- SYS_JoyData[0].axes_med[0] = stGameCalib.Ax.centre;
- SYS_JoyData[0].axes_max[0] = stGameCalib.Ax.upper;
- SYS_JoyData[0].axes_min[1] = stGameCalib.Ay.lower;
- SYS_JoyData[0].axes_med[1] = stGameCalib.Ay.centre;
- SYS_JoyData[0].axes_max[1] = stGameCalib.Ay.upper;
- }
- /* If not, it is joystick B */
- else
- {
- /* Define Device 1 as 2 axes, 2 buttons */
- SYS_JoyData[0].id=1;
- SYS_JoyData[0].axes = 2;
- SYS_JoyData[0].buttons = 2;
- SYS_JoyData[0].hats = 0;
- SYS_JoyData[0].balls = 0;
- SYS_JoyData[0].axes_min[0] = stGameCalib.Bx.lower;
- SYS_JoyData[0].axes_med[0] = stGameCalib.Bx.centre;
- SYS_JoyData[0].axes_max[0] = stGameCalib.Bx.upper;
- SYS_JoyData[0].axes_min[1] = stGameCalib.By.lower;
- SYS_JoyData[0].axes_med[1] = stGameCalib.By.centre;
- SYS_JoyData[0].axes_max[1] = stGameCalib.By.upper;
- }
- }
- /* Hack to define Joystick Port Names */
- if ( numdevs > maxdevs ) numdevs = maxdevs;
- for (i=0; i<numdevs; i++)
- SDL_snprintf (SYS_JoyData[i].szDeviceName, SDL_arraysize(SYS_JoyData[i].szDeviceName), "Default Joystick %c", 'A'+SYS_JoyData[i].id);
-
- }
- }
-/* Return the number of devices found */
-return(numdevs);
-}
-
-
-/***********************************************************/
-/* Function to get the device-dependent name of a joystick */
-/***********************************************************/
-const char *SDL_SYS_JoystickName(int index)
-{
-/* No need to verify if device exists, already done in upper layer */
-return(SYS_JoyData[index].szDeviceName);
-}
-
-
-
-/******************************************************************************/
-/* Function to open a joystick for use. */
-/* The joystick to open is specified by the index field of the joystick. */
-/* This should fill the nbuttons and naxes fields of the joystick structure. */
-/* It returns 0, or -1 if there is an error. */
-/******************************************************************************/
-int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
-{
-int index; /* Index shortcut for index in joystick structure */
-int i; /* Generic Counter */
-
-/* allocate memory for system specific hardware data */
-joystick->hwdata = (struct joystick_hwdata *) SDL_malloc(sizeof(*joystick->hwdata));
-if (joystick->hwdata == NULL)
- {
- SDL_OutOfMemory();
- return(-1);
- }
-/* Reset Hardware Data */
-SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
-
-/* ShortCut Pointer */
-index = joystick->index;
-/* Define offsets and scales for all axes */
-joystick->hwdata->id = SYS_JoyData[index].id;
-for ( i = 0; i < MAX_AXES; ++i )
- {
- if ( (i<2) || i < SYS_JoyData[index].axes )
- {
- joystick->hwdata->transaxes[i].offset = ((AXIS_MAX + AXIS_MIN)>>1) - SYS_JoyData[index].axes_med[i];
- //joystick->hwdata->transaxes[i].scale = (float)((AXIS_MAX - AXIS_MIN)/(SYS_JoyData[index].axes_max[i]-SYS_JoyData[index].axes_min[i]));
- joystick->hwdata->transaxes[i].scale1 = (float)abs((AXIS_MIN/SYS_JoyData[index].axes_min[i]));
- joystick->hwdata->transaxes[i].scale2 = (float)abs((AXIS_MAX/SYS_JoyData[index].axes_max[i]));
- }
- else
- {
- joystick->hwdata->transaxes[i].offset = 0;
- //joystick->hwdata->transaxes[i].scale = 1.0; /* Just in case */
- joystick->hwdata->transaxes[i].scale1 = 1.0; /* Just in case */
- joystick->hwdata->transaxes[i].scale2 = 1.0; /* Just in case */
- }
- }
-
-/* fill nbuttons, naxes, and nhats fields */
-joystick->nbuttons = SYS_JoyData[index].buttons;
-joystick->naxes = SYS_JoyData[index].axes;
-/* joystick->nhats = SYS_JoyData[index].hats; */
-joystick->nhats = 0; /* No support for hats at this time */
-/* joystick->nballs = SYS_JoyData[index].balls; */
-joystick->nballs = 0; /* No support for balls at this time */
-return 0;
-}
-
-
-
-/***************************************************************************/
-/* Function to update the state of a joystick - called as a device poll. */
-/* This function shouldn't update the joystick structure directly, */
-/* but instead should call SDL_PrivateJoystick*() to deliver events */
-/* and update joystick device state. */
-/***************************************************************************/
-void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
-{
-APIRET rc; /* Generic OS/2 return code */
-int index; /* index shortcurt to joystick index */
-int i; /* Generic counter */
-int normbut; /* Number of buttons reported by joystick */
-int corr; /* Correction for button names */
-Sint16 value, change; /* Values used to update axis values */
-struct _transaxes *transaxes; /* Shortcut for Correction structure */
-Uint32 pos[MAX_AXES]; /* Vector to inform the Axis status */
-ULONG ulDataLen; /* Size of data */
-GAME_STATUS_STRUCT stGameStatus; /* Joystick Status Structure */
-
-ulDataLen = sizeof(stGameStatus);
-rc = DosDevIOCtl(hJoyPort, IOCTL_CAT_USER, GAME_GET_STATUS,
- NULL, 0, NULL, &stGameStatus, ulDataLen, &ulDataLen);
-if (rc != 0)
- {
- SDL_SetError("Could not read joystick status.");
- return; /* Could not read data */
- }
-
-/* Shortcut pointer */
-index = joystick->index;
-/* joystick motion events */
-
-if (SYS_JoyData[index].id == 0)
- {
- pos[0] = stGameStatus.curdata.A.x;
- pos[1] = stGameStatus.curdata.A.y;
- if (SYS_JoyData[index].axes >= 3) pos[2] = stGameStatus.curdata.B.x;
- else pos[2]=0;
- if (SYS_JoyData[index].axes >= 4) pos[3] = stGameStatus.curdata.B.y;
- else pos[3]=0;
- pos[4]=0; /* OS/2 basic drivers do not support more than 4 axes joysticks */
- pos[5]=0;
- }
-else if (SYS_JoyData[index].id == 1)
- {
- pos[0] = stGameStatus.curdata.B.x;
- pos[1] = stGameStatus.curdata.B.y;
- pos[2]=0;
- pos[3]=0;
- pos[4]=0;
- pos[5]=0;
- }
-
-/* Corrects the movements using the callibration */
-transaxes = joystick->hwdata->transaxes;
-for (i = 0; i < joystick->naxes; i++)
- {
- value = pos[i] + transaxes[i].offset;
- if (value<0)
- {
- value*=transaxes[i].scale1;
- if (value>0) value = AXIS_MIN;
- }
- else
- {
- value*=transaxes[i].scale2;
- if (value<0) value = AXIS_MAX;
- }
- change = (value - joystick->axes[i]);
- if ( (change < -JOY_AXIS_THRESHOLD) || (change > JOY_AXIS_THRESHOLD) )
- {
- SDL_PrivateJoystickAxis(joystick, (Uint8)i, (Sint16)value);
- }
- }
-
-/* joystick button A to D events */
-if (SYS_JoyData[index].id == 1) corr = 2;
-else corr = 0;
-normbut=4; /* Number of normal buttons */
-if (joystick->nbuttons<normbut) normbut = joystick->nbuttons;
-for ( i = corr; (i-corr) < normbut; ++i )
- {
- /*
- Button A: 1110 0000
- Button B: 1101 0000
- Button C: 1011 0000
- Button D: 0111 0000
- */
- if ( (~stGameStatus.curdata.butMask)>>4 & JOY_BUTTON_FLAG(i) )
- {
- if ( ! joystick->buttons[i-corr] )
- {
- SDL_PrivateJoystickButton(joystick, (Uint8)(i-corr), SDL_PRESSED);
- }
- }
- else
- {
- if ( joystick->buttons[i-corr] )
- {
- SDL_PrivateJoystickButton(joystick, (Uint8)(i-corr), SDL_RELEASED);
- }
- }
- }
-
-/* Joystick button E to H buttons */
- /*
- Button E: Axis 2 X Left
- Button F: Axis 2 Y Up
- Button G: Axis 2 X Right
- Button H: Axis 2 Y Down
- */
-if (joystick->nbuttons>=5)
- {
- if (stGameStatus.curdata.B.x < SYS_JoyData[index].buttoncalc[0]) SDL_PrivateJoystickButton(joystick, (Uint8)4, SDL_PRESSED);
- else SDL_PrivateJoystickButton(joystick, (Uint8)4, SDL_RELEASED);
- }
-if (joystick->nbuttons>=6)
- {
- if (stGameStatus.curdata.B.y < SYS_JoyData[index].buttoncalc[1]) SDL_PrivateJoystickButton(joystick, (Uint8)5, SDL_PRESSED);
- else SDL_PrivateJoystickButton(joystick, (Uint8)5, SDL_RELEASED);
- }
-if (joystick->nbuttons>=7)
- {
- if (stGameStatus.curdata.B.x > SYS_JoyData[index].buttoncalc[2]) SDL_PrivateJoystickButton(joystick, (Uint8)6, SDL_PRESSED);
- else SDL_PrivateJoystickButton(joystick, (Uint8)6, SDL_RELEASED);
- }
-if (joystick->nbuttons>=8)
- {
- if (stGameStatus.curdata.B.y > SYS_JoyData[index].buttoncalc[3]) SDL_PrivateJoystickButton(joystick, (Uint8)7, SDL_PRESSED);
- else SDL_PrivateJoystickButton(joystick, (Uint8)7, SDL_RELEASED);
- }
-
-/* joystick hat events */
-/* Not Supported under OS/2 */
-/* joystick ball events */
-/* Not Supported under OS/2 */
-}
-
-
-
-/******************************************/
-/* Function to close a joystick after use */
-/******************************************/
-void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
-{
-if (joystick->hwdata != NULL)
- {
- /* free system specific hardware data */
- SDL_free(joystick->hwdata);
- }
-}
-
-
-
-/********************************************************************/
-/* Function to perform any system-specific joystick related cleanup */
-/********************************************************************/
-void SDL_SYS_JoystickQuit(void)
-{
-joyPortClose(&hJoyPort);
-}
-
-
-
-/************************/
-/************************/
-/* OS/2 Implementations */
-/************************/
-/************************/
-
-
-/*****************************************/
-/* Open Joystick Port, if not opened yet */
-/*****************************************/
-APIRET joyPortOpen(HFILE * hGame)
-{
-APIRET rc; /* Generic Return Code */
-ULONG ulAction; /* ? */
-ULONG ulVersion; /* Version of joystick driver */
-ULONG ulDataLen; /* Size of version data */
-
-/* Verifies if joyport is not already open... */
-if (*hGame != NULL) return 0;
-/* Open GAME$ for read */
-rc = DosOpen((PSZ)GAMEPDDNAME, hGame, &ulAction, 0, FILE_READONLY,
- FILE_OPEN, OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE, NULL);
-if (rc != 0)
- {
- SDL_SetError("Could not open Joystick Port.");
- return -1;
- }
-
-/* Get Joystick Driver Version... must be 2.0 or higher */
-ulVersion = 0;
-ulDataLen = sizeof(ulVersion);
-rc = DosDevIOCtl( *hGame, IOCTL_CAT_USER, GAME_GET_VERSION,
- NULL, 0, NULL, &ulVersion, ulDataLen, &ulDataLen);
-if (rc != 0)
- {
- joyPortClose(hGame);
- SDL_SetError("Could not get Joystick Driver version.");
- return -1;
- }
-if (ulVersion < GAME_VERSION)
- {
- joyPortClose(hGame);
- SDL_SetError("Driver too old. At least IBM driver version 2.0 required.");
- return -1;
- }
-return 0;
-}
-
-
-
-/****************************/
-/* Close JoyPort, if opened */
-/****************************/
-void joyPortClose(HFILE * hGame)
-{
-if (*hGame != NULL) DosClose(*hGame);
-*hGame = NULL;
-}
-
-
-
-/***************************/
-/* Get SDL Joystick EnvVar */
-/***************************/
-int joyGetEnv(struct _joycfg * joydata)
-{
-char *joyenv; /* Pointer to tested character */
-char tempnumber[5]; /* Temporary place to put numeric texts */
-
-joyenv = SDL_getenv("SDL_OS2_JOYSTICK");
-if (joyenv == NULL) return 0;
-/* Joystick Environment is defined! */
-while (*joyenv==' ' && *joyenv!=0) joyenv++; /* jump spaces... */
-/* If the string name starts with '... get if fully */
-if (*joyenv=='\'') joyenv+=joyGetData(++joyenv,joydata->name,'\'',sizeof(joydata->name));
-/* If not, get it until the next space */
-else if (*joyenv=='\"') joyenv+=joyGetData(++joyenv,joydata->name,'\"',sizeof(joydata->name));
-else joyenv+=joyGetData(joyenv,joydata->name,' ',sizeof(joydata->name));
-/* Now get the number of axes */
-while (*joyenv==' ' && *joyenv!=0) joyenv++; /* jump spaces... */
-joyenv+=joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber));
-joydata->axes = atoi(tempnumber);
-/* Now get the number of buttons */
-while (*joyenv==' ' && *joyenv!=0) joyenv++; /* jump spaces... */
-joyenv+=joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber));
-joydata->buttons = atoi(tempnumber);
-/* Now get the number of hats */
-while (*joyenv==' ' && *joyenv!=0) joyenv++; /* jump spaces... */
-joyenv+=joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber));
-joydata->hats = atoi(tempnumber);
-/* Now get the number of balls */
-while (*joyenv==' ' && *joyenv!=0) joyenv++; /* jump spaces... */
-joyenv+=joyGetData(joyenv,tempnumber,' ',sizeof(tempnumber));
-joydata->balls = atoi(tempnumber);
-return 1;
-}
-
-
-
-/************************************************************************/
-/* Get a text from in the string starting in joyenv until it finds */
-/* the stopchar or maxchars is reached. The result is placed in name. */
-/************************************************************************/
-int joyGetData(char *joyenv, char *name, char stopchar, size_t maxchars)
-{
-char *nameptr; /* Pointer to the selected character */
-int chcnt=0; /* Count how many characters where copied */
-
-nameptr=name;
-while (*joyenv!=stopchar && *joyenv!=0)
- {
- if (nameptr<(name+(maxchars-1)))
- {
- *nameptr = *joyenv; /* Only copy if smaller than maximum */
- nameptr++;
- }
- chcnt++;
- joyenv++;
- }
-if (*joyenv==stopchar)
- {
- joyenv++; /* Jump stopchar */
- chcnt++;
- }
-*nameptr = 0; /* Mark last byte */
-return chcnt;
-}
-
-#endif /* SDL_JOYSTICK_OS2 */
diff --git a/distrib/sdl-1.2.12/src/joystick/os2/joyos2.h b/distrib/sdl-1.2.12/src/joystick/os2/joyos2.h
deleted file mode 100644
index 2980010..0000000
--- a/distrib/sdl-1.2.12/src/joystick/os2/joyos2.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/*****************************************************************************/
-/* */
-/* COPYRIGHT Copyright (C) 1995 IBM Corporation */
-/* */
-/* The following IBM OS/2 source code is provided to you solely for */
-/* the purpose of assisting you in your development of OS/2 device */
-/* drivers. You may use this code in accordance with the IBM License */
-/* Agreement provided in the IBM Device Driver Source Kit for OS/2. This */
-/* Copyright statement may not be removed. */
-/* */
-/*****************************************************************************/
-#ifndef JOYOS2_H
-#define JOYOS2_H
-
-/****** GAMEPORT.SYS joystick definitions, start *****************************/
-#define GAME_VERSION 0x20 /* 2.0 First IBM version */
-#define GAMEPDDNAME "GAME$ "
-#define IOCTL_CAT_USER 0x80
-#define GAME_PORT_GET 0x20 /* read GAMEPORT.SYS values */
-#define GAME_PORT_RESET 0x60 /* reset joystick mask with given value */
-
-#pragma pack(1) /* pack structure size is 1 byte */
-typedef struct { /* GAMEPORT.SYS structure */
- USHORT usJs_AxCnt; /* Joystick_A X position */
- USHORT usJs_AyCnt; /* Joystick_A Y position */
- USHORT usJs_BxCnt; /* Joystick_B X position */
- USHORT usJs_ByCnt; /* Joystick_B Y position */
- USHORT usJs_ButtonA1Cnt; /* button A1 press count */
- USHORT usJs_ButtonA2Cnt; /* button A2 press count */
- USHORT usJs_ButtonB1Cnt; /* button B1 press count */
- USHORT usJs_ButtonB2Cnt; /* button B2 press count */
- UCHAR ucJs_JoyStickMask; /* mask of connected joystick pots */
- UCHAR ucJs_ButtonStatus; /* bits of switches down */
- ULONG ulJs_Ticks; /* joystick clock ticks */
-} GAME_PORT_STRUCT;
-#pragma pack() /*reset to normal pack size */
-/****** GAMEPORT.SYS joystick definitions, end *******************************/
-
-
-/****************************************************************************/
-#define GAME_GET_VERSION 0x01
-#define GAME_GET_PARMS 0x02
-#define GAME_SET_PARMS 0x03
-#define GAME_GET_CALIB 0x04
-#define GAME_SET_CALIB 0x05
-#define GAME_GET_DIGSET 0x06
-#define GAME_SET_DIGSET 0x07
-#define GAME_GET_STATUS 0x10
-#define GAME_GET_STATUS_BUTWAIT 0x11
-#define GAME_GET_STATUS_SAMPWAIT 0x12
-/****************************************************************************/
-
-/****************************************************************************/
-// bit masks for each axis
-#define JOY_AX_BIT 0x01
-#define JOY_AY_BIT 0x02
-#define JOY_A_BITS (JOY_AX_BIT|JOY_AY_BIT)
-#define JOY_BX_BIT 0x04
-#define JOY_BY_BIT 0x08
-#define JOY_B_BITS (JOY_BX_BIT|JOY_BY_BIT)
-#define JOY_ALLPOS_BITS (JOY_A_BITS|JOY_B_BITS)
-
-// bit masks for each button
-#define JOY_BUT1_BIT 0x10
-#define JOY_BUT2_BIT 0x20
-#define JOY_BUT3_BIT 0x40
-#define JOY_BUT4_BIT 0x80
-#define JOY_ALL_BUTS (JOY_BUT1_BIT|JOY_BUT2_BIT|JOY_BUT3_BIT|JOY_BUT4_BIT)
-/****************************************************************************/
-
-/****************************************************************************/
-// 1-D position struct used for each axis
-typedef SHORT GAME_POS; /* some data formats require signed values */
-
-// simple 2-D position for each joystick
-typedef struct
-{
- GAME_POS x;
- GAME_POS y;
-}
-GAME_2DPOS_STRUCT;
-
-// struct defining the instantaneous state of both sticks and all buttons
-typedef struct
-{
- GAME_2DPOS_STRUCT A;
- GAME_2DPOS_STRUCT B;
- USHORT butMask;
-}
-GAME_DATA_STRUCT;
-
-// struct to be used for calibration and digital response on each axis
-typedef struct
-{
- GAME_POS lower;
- GAME_POS centre;
- GAME_POS upper;
-}
-GAME_3POS_STRUCT;
-/****************************************************************************/
-
-/****************************************************************************/
-// status struct returned to OS/2 applications:
-// current data for all sticks as well as button counts since last read
-typedef struct
-{
- GAME_DATA_STRUCT curdata;
- USHORT b1cnt;
- USHORT b2cnt;
- USHORT b3cnt;
- USHORT b4cnt;
-}
-GAME_STATUS_STRUCT;
-/****************************************************************************/
-
-/****************************************************************************/
-/* in use bitmasks originating in 0.2b */
-#define GAME_USE_BOTH_OLDMASK 0x01 /* for backward compat with bool */
-#define GAME_USE_X_NEWMASK 0x02
-#define GAME_USE_Y_NEWMASK 0x04
-#define GAME_USE_X_EITHERMASK (GAME_USE_X_NEWMASK|GAME_USE_BOTH_OLDMASK)
-#define GAME_USE_Y_EITHERMASK (GAME_USE_Y_NEWMASK|GAME_USE_BOTH_OLDMASK)
-#define GAME_USE_BOTH_NEWMASK (GAME_USE_X_NEWMASK|GAME_USE_Y_NEWMASK)
-
-/* only timed sampling implemented in version 1.0 */
-#define GAME_MODE_TIMED 1 /* timed sampling */
-#define GAME_MODE_REQUEST 2 /* request driven sampling */
-
-/* only raw implemented in version 1.0 */
-#define GAME_DATA_FORMAT_RAW 1 /* [l,c,r] */
-#define GAME_DATA_FORMAT_SIGNED 2 /* [-l,0,+r] */
-#define GAME_DATA_FORMAT_BINARY 3 /* {-1,0,+1} */
-#define GAME_DATA_FORMAT_SCALED 4 /* [-10,+10] */
-
-// parameters defining the operation of the driver
-typedef struct
-{
- USHORT useA; /* new bitmasks: see above */
- USHORT useB;
- USHORT mode; /* see consts above */
- USHORT format; /* see consts above */
- USHORT sampDiv; /* samp freq = 32 / n */
- USHORT scale; /* scaling factor */
- USHORT res1; /* must be 0 */
- USHORT res2; /* must be 0 */
-}
-GAME_PARM_STRUCT;
-/****************************************************************************/
-
-/****************************************************************************/
-// calibration values for each axis:
-// - upper limit on value to be considered in lower range
-// - centre value
-// - lower limit on value to be considered in upper range
-typedef struct
-{
- GAME_3POS_STRUCT Ax;
- GAME_3POS_STRUCT Ay;
- GAME_3POS_STRUCT Bx;
- GAME_3POS_STRUCT By;
-}
-GAME_CALIB_STRUCT;
-/****************************************************************************/
-
-/****************************************************************************/
-// struct defining the digital response values for all axes
-typedef struct
-{
- GAME_3POS_STRUCT Ax;
- GAME_3POS_STRUCT Ay;
- GAME_3POS_STRUCT Bx;
- GAME_3POS_STRUCT By;
-}
-GAME_DIGSET_STRUCT;
-/****************************************************************************/
-
-#endif
diff --git a/distrib/sdl-1.2.12/src/joystick/riscos/SDL_sysjoystick.c b/distrib/sdl-1.2.12/src/joystick/riscos/SDL_sysjoystick.c
deleted file mode 100644
index ed8ac91..0000000
--- a/distrib/sdl-1.2.12/src/joystick/riscos/SDL_sysjoystick.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_JOYSTICK_RISCOS
-
-/*
- RISC OS - Joystick support by Alan Buckley (alan_baa@hotmail.com) - 10 April 2003
-
- Note: Currently assumes joystick is present if joystick module is loaded
- and that there is one joystick with four buttons.
-*/
-
-/* This is the system specific header for the SDL joystick API */
-
-#include "SDL_events.h"
-#include "SDL_joystick.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-
-#include "kernel.h"
-
-#define JOYSTICK_READ 0x43F40
-
-struct joystick_hwdata
-{
- int joystate;
-};
-
-
-/* Function to scan the system for joysticks.
- * This function should set SDL_numjoysticks to the number of available
- * joysticks. Joystick 0 should be the system default joystick.
- * It should return number of joysticks, or -1 on an unrecoverable fatal error.
- */
-int SDL_SYS_JoystickInit(void)
-{
- _kernel_swi_regs regs;
-
- /* Try to read joystick 0 */
- regs.r[0] = 0;
- if (_kernel_swi(JOYSTICK_READ, &regs, &regs) == NULL)
- {
- /* Switch works so assume we've got a joystick */
- return 1;
- }
- /* Switch fails so it looks like there's no joystick here */
-
- return(0);
-}
-
-/* Function to get the device-dependent name of a joystick */
-const char *SDL_SYS_JoystickName(int index)
-{
- if (index == 0)
- {
- return "RISC OS Joystick 0";
- }
-
- SDL_SetError("No joystick available with that index");
- return(NULL);
-}
-
-/* Function to open a joystick for use.
- The joystick to open is specified by the index field of the joystick.
- This should fill the nbuttons and naxes fields of the joystick structure.
- It returns 0, or -1 if there is an error.
- */
-int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
-{
- _kernel_swi_regs regs;
-
- if(!(joystick->hwdata=SDL_malloc(sizeof(struct joystick_hwdata))))
- return -1;
-
- regs.r[0] = joystick->index;
-
- /* Don't know how to get exact count of buttons so assume max of 4 for now */
- joystick->nbuttons=4;
-
- joystick->nhats=0;
- joystick->nballs=0;
- joystick->naxes=2;
- joystick->hwdata->joystate=0;
-
- return 0;
-
-}
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
-{
- _kernel_swi_regs regs;
- regs.r[0] = joystick->index;
-
- if (_kernel_swi(JOYSTICK_READ, &regs, &regs) == NULL)
- {
- int newstate = regs.r[0];
- int oldstate = joystick->hwdata->joystate;
- if (newstate != oldstate)
- {
- if ((newstate & 0xFF) != (oldstate & 0xFF))
- {
- int y = regs.r[0] & 0xFF;
- /* Convert to signed values */
- if (y >= 128) y -= 256;
- SDL_PrivateJoystickAxis(joystick,1,-y * 256); /* Up and down opposite to result in SDL */
- }
- if ((newstate & 0xFF00) != (oldstate & 0xFF00))
- {
- int x = (regs.r[0] & 0xFF00) >> 8;
- if (x >= 128) x -= 256;
- SDL_PrivateJoystickAxis(joystick,0,x * 256);
- }
-
- if ((newstate & 0xFF0000) != (oldstate & 0xFF0000))
- {
- int buttons = (regs.r[0] & 0xFF0000) >> 16;
- int oldbuttons = (oldstate & 0xFF0000) >> 16;
- int i;
- for (i = 0; i < joystick->nbuttons; i++)
- {
- if ((buttons & (1<<i)) != (oldbuttons & (1<<i)))
- {
- if (buttons & (1<<i)) SDL_PrivateJoystickButton(joystick,i,SDL_PRESSED);
- else SDL_PrivateJoystickButton(joystick,i,SDL_RELEASED);
- }
- }
- }
- joystick->hwdata->joystate = newstate;
- }
- }
-
- return;
-}
-
-/* Function to close a joystick after use */
-void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
-{
- if(joystick->hwdata)
- SDL_free(joystick->hwdata);
- return;
-}
-
-/* Function to perform any system-specific joystick related cleanup */
-void SDL_SYS_JoystickQuit(void)
-{
- SDL_numjoysticks=0;
-
- return;
-}
-
-#endif /* SDL_JOYSTICK_RISCOS */
diff --git a/distrib/sdl-1.2.12/src/joystick/win32/SDL_mmjoystick.c b/distrib/sdl-1.2.12/src/joystick/win32/SDL_mmjoystick.c
deleted file mode 100644
index e71f8f8..0000000
--- a/distrib/sdl-1.2.12/src/joystick/win32/SDL_mmjoystick.c
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_JOYSTICK_WINMM
-
-/* Win32 MultiMedia Joystick driver, contributed by Andrei de A. Formiga */
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <mmsystem.h>
-#include <regstr.h>
-
-#include "SDL_events.h"
-#include "SDL_joystick.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-
-#define MAX_JOYSTICKS 16
-#define MAX_AXES 6 /* each joystick can have up to 6 axes */
-#define MAX_BUTTONS 32 /* and 32 buttons */
-#define AXIS_MIN -32768 /* minimum value for axis coordinate */
-#define AXIS_MAX 32767 /* maximum value for axis coordinate */
-/* limit axis to 256 possible positions to filter out noise */
-#define JOY_AXIS_THRESHOLD (((AXIS_MAX)-(AXIS_MIN))/256)
-#define JOY_BUTTON_FLAG(n) (1<<n)
-
-
-/* array to hold joystick ID values */
-static UINT SYS_JoystickID[MAX_JOYSTICKS];
-static JOYCAPS SYS_Joystick[MAX_JOYSTICKS];
-static char *SYS_JoystickName[MAX_JOYSTICKS];
-
-/* The private structure used to keep track of a joystick */
-struct joystick_hwdata
-{
- /* joystick ID */
- UINT id;
-
- /* values used to translate device-specific coordinates into
- SDL-standard ranges */
- struct _transaxis {
- int offset;
- float scale;
- } transaxis[6];
-};
-
-/* Convert a win32 Multimedia API return code to a text message */
-static void SetMMerror(char *function, int code);
-
-
-static char *GetJoystickName(int index, const char *szRegKey)
-{
- /* added 7/24/2004 by Eckhard Stolberg */
- /*
- see if there is a joystick for the current
- index (1-16) listed in the registry
- */
- char *name = NULL;
- HKEY hTopKey;
- HKEY hKey;
- DWORD regsize;
- LONG regresult;
- char regkey[256];
- char regvalue[256];
- char regname[256];
-
- SDL_snprintf(regkey, SDL_arraysize(regkey), "%s\\%s\\%s",
- REGSTR_PATH_JOYCONFIG, szRegKey, REGSTR_KEY_JOYCURR);
- hTopKey = HKEY_LOCAL_MACHINE;
- regresult = RegOpenKeyExA(hTopKey, regkey, 0, KEY_READ, &hKey);
- if (regresult != ERROR_SUCCESS) {
- hTopKey = HKEY_CURRENT_USER;
- regresult = RegOpenKeyExA(hTopKey, regkey, 0, KEY_READ, &hKey);
- }
- if (regresult != ERROR_SUCCESS) {
- return NULL;
- }
-
- /* find the registry key name for the joystick's properties */
- regsize = sizeof(regname);
- SDL_snprintf(regvalue, SDL_arraysize(regvalue), "Joystick%d%s", index+1, REGSTR_VAL_JOYOEMNAME);
- regresult = RegQueryValueExA(hKey, regvalue, 0, 0, (LPBYTE)regname, &regsize);
- RegCloseKey(hKey);
-
- if (regresult != ERROR_SUCCESS) {
- return NULL;
- }
-
- /* open that registry key */
- SDL_snprintf(regkey, SDL_arraysize(regkey), "%s\\%s", REGSTR_PATH_JOYOEM, regname);
- regresult = RegOpenKeyExA(hTopKey, regkey, 0, KEY_READ, &hKey);
- if (regresult != ERROR_SUCCESS) {
- return NULL;
- }
-
- /* find the size for the OEM name text */
- regsize = sizeof(regvalue);
- regresult = RegQueryValueExA(hKey, REGSTR_VAL_JOYOEMNAME, 0, 0, NULL, &regsize);
- if (regresult == ERROR_SUCCESS) {
- /* allocate enough memory for the OEM name text ... */
- name = (char *) SDL_malloc(regsize);
- if ( name ) {
- /* ... and read it from the registry */
- regresult = RegQueryValueExA(hKey,
- REGSTR_VAL_JOYOEMNAME, 0, 0,
- (LPBYTE) name, &regsize);
- }
- }
- RegCloseKey(hKey);
-
- return(name);
-}
-
-/* Function to scan the system for joysticks.
- * This function should set SDL_numjoysticks to the number of available
- * joysticks. Joystick 0 should be the system default joystick.
- * It should return 0, or -1 on an unrecoverable fatal error.
- */
-int SDL_SYS_JoystickInit(void)
-{
- int i;
- int maxdevs;
- int numdevs;
- JOYINFOEX joyinfo;
- JOYCAPS joycaps;
- MMRESULT result;
-
- /* Reset the joystick ID & name mapping tables */
- for ( i = 0; i < MAX_JOYSTICKS; ++i ) {
- SYS_JoystickID[i] = 0;
- SYS_JoystickName[i] = NULL;
- }
-
- /* Loop over all potential joystick devices */
- numdevs = 0;
- maxdevs = joyGetNumDevs();
- for ( i = JOYSTICKID1; i < maxdevs && numdevs < MAX_JOYSTICKS; ++i ) {
-
- joyinfo.dwSize = sizeof(joyinfo);
- joyinfo.dwFlags = JOY_RETURNALL;
- result = joyGetPosEx(i, &joyinfo);
- if ( result == JOYERR_NOERROR ) {
- result = joyGetDevCaps(i, &joycaps, sizeof(joycaps));
- if ( result == JOYERR_NOERROR ) {
- SYS_JoystickID[numdevs] = i;
- SYS_Joystick[numdevs] = joycaps;
- SYS_JoystickName[numdevs] = GetJoystickName(i, joycaps.szRegKey);
- numdevs++;
- }
- }
- }
- return(numdevs);
-}
-
-/* Function to get the device-dependent name of a joystick */
-const char *SDL_SYS_JoystickName(int index)
-{
- if ( SYS_JoystickName[index] != NULL ) {
- return(SYS_JoystickName[index]);
- } else {
- return(SYS_Joystick[index].szPname);
- }
-}
-
-/* Function to open a joystick for use.
- The joystick to open is specified by the index field of the joystick.
- This should fill the nbuttons and naxes fields of the joystick structure.
- It returns 0, or -1 if there is an error.
- */
-int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
-{
- int index, i;
- int caps_flags[MAX_AXES-2] =
- { JOYCAPS_HASZ, JOYCAPS_HASR, JOYCAPS_HASU, JOYCAPS_HASV };
- int axis_min[MAX_AXES], axis_max[MAX_AXES];
-
-
- /* shortcut */
- index = joystick->index;
- axis_min[0] = SYS_Joystick[index].wXmin;
- axis_max[0] = SYS_Joystick[index].wXmax;
- axis_min[1] = SYS_Joystick[index].wYmin;
- axis_max[1] = SYS_Joystick[index].wYmax;
- axis_min[2] = SYS_Joystick[index].wZmin;
- axis_max[2] = SYS_Joystick[index].wZmax;
- axis_min[3] = SYS_Joystick[index].wRmin;
- axis_max[3] = SYS_Joystick[index].wRmax;
- axis_min[4] = SYS_Joystick[index].wUmin;
- axis_max[4] = SYS_Joystick[index].wUmax;
- axis_min[5] = SYS_Joystick[index].wVmin;
- axis_max[5] = SYS_Joystick[index].wVmax;
-
- /* allocate memory for system specific hardware data */
- joystick->hwdata = (struct joystick_hwdata *) SDL_malloc(sizeof(*joystick->hwdata));
- if (joystick->hwdata == NULL)
- {
- SDL_OutOfMemory();
- return(-1);
- }
- SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
-
- /* set hardware data */
- joystick->hwdata->id = SYS_JoystickID[index];
- for ( i = 0; i < MAX_AXES; ++i ) {
- if ( (i<2) || (SYS_Joystick[index].wCaps & caps_flags[i-2]) ) {
- joystick->hwdata->transaxis[i].offset =
- AXIS_MIN - axis_min[i];
- joystick->hwdata->transaxis[i].scale =
- (float)(AXIS_MAX - AXIS_MIN) / (axis_max[i] - axis_min[i]);
- } else {
- joystick->hwdata->transaxis[i].offset = 0;
- joystick->hwdata->transaxis[i].scale = 1.0; /* Just in case */
- }
- }
-
- /* fill nbuttons, naxes, and nhats fields */
- joystick->nbuttons = SYS_Joystick[index].wNumButtons;
- joystick->naxes = SYS_Joystick[index].wNumAxes;
- if ( SYS_Joystick[index].wCaps & JOYCAPS_HASPOV ) {
- joystick->nhats = 1;
- } else {
- joystick->nhats = 0;
- }
- return(0);
-}
-
-static Uint8 TranslatePOV(DWORD value)
-{
- Uint8 pos;
-
- pos = SDL_HAT_CENTERED;
- if ( value != JOY_POVCENTERED ) {
- if ( (value > JOY_POVLEFT) || (value < JOY_POVRIGHT) ) {
- pos |= SDL_HAT_UP;
- }
- if ( (value > JOY_POVFORWARD) && (value < JOY_POVBACKWARD) ) {
- pos |= SDL_HAT_RIGHT;
- }
- if ( (value > JOY_POVRIGHT) && (value < JOY_POVLEFT) ) {
- pos |= SDL_HAT_DOWN;
- }
- if ( value > JOY_POVBACKWARD ) {
- pos |= SDL_HAT_LEFT;
- }
- }
- return(pos);
-}
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
-{
- MMRESULT result;
- int i;
- DWORD flags[MAX_AXES] = { JOY_RETURNX, JOY_RETURNY, JOY_RETURNZ,
- JOY_RETURNR, JOY_RETURNU, JOY_RETURNV };
- DWORD pos[MAX_AXES];
- struct _transaxis *transaxis;
- int value, change;
- JOYINFOEX joyinfo;
-
- joyinfo.dwSize = sizeof(joyinfo);
- joyinfo.dwFlags = JOY_RETURNALL|JOY_RETURNPOVCTS;
- if ( ! joystick->hats ) {
- joyinfo.dwFlags &= ~(JOY_RETURNPOV|JOY_RETURNPOVCTS);
- }
- result = joyGetPosEx(joystick->hwdata->id, &joyinfo);
- if ( result != JOYERR_NOERROR ) {
- SetMMerror("joyGetPosEx", result);
- return;
- }
-
- /* joystick motion events */
- pos[0] = joyinfo.dwXpos;
- pos[1] = joyinfo.dwYpos;
- pos[2] = joyinfo.dwZpos;
- pos[3] = joyinfo.dwRpos;
- pos[4] = joyinfo.dwUpos;
- pos[5] = joyinfo.dwVpos;
-
- transaxis = joystick->hwdata->transaxis;
- for (i = 0; i < joystick->naxes; i++) {
- if (joyinfo.dwFlags & flags[i]) {
- value = (int)(((float)pos[i] + transaxis[i].offset) * transaxis[i].scale);
- change = (value - joystick->axes[i]);
- if ( (change < -JOY_AXIS_THRESHOLD) || (change > JOY_AXIS_THRESHOLD) ) {
- SDL_PrivateJoystickAxis(joystick, (Uint8)i, (Sint16)value);
- }
- }
- }
-
- /* joystick button events */
- if ( joyinfo.dwFlags & JOY_RETURNBUTTONS ) {
- for ( i = 0; i < joystick->nbuttons; ++i ) {
- if ( joyinfo.dwButtons & JOY_BUTTON_FLAG(i) ) {
- if ( ! joystick->buttons[i] ) {
- SDL_PrivateJoystickButton(joystick, (Uint8)i, SDL_PRESSED);
- }
- } else {
- if ( joystick->buttons[i] ) {
- SDL_PrivateJoystickButton(joystick, (Uint8)i, SDL_RELEASED);
- }
- }
- }
- }
-
- /* joystick hat events */
- if ( joyinfo.dwFlags & JOY_RETURNPOV ) {
- Uint8 pos;
-
- pos = TranslatePOV(joyinfo.dwPOV);
- if ( pos != joystick->hats[0] ) {
- SDL_PrivateJoystickHat(joystick, 0, pos);
- }
- }
-}
-
-/* Function to close a joystick after use */
-void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
-{
- if (joystick->hwdata != NULL) {
- /* free system specific hardware data */
- SDL_free(joystick->hwdata);
- }
-}
-
-/* Function to perform any system-specific joystick related cleanup */
-void SDL_SYS_JoystickQuit(void)
-{
- int i;
- for (i = 0; i < MAX_JOYSTICKS; i++) {
- if ( SYS_JoystickName[i] != NULL ) {
- SDL_free(SYS_JoystickName[i]);
- }
- }
-}
-
-
-/* implementation functions */
-void SetMMerror(char *function, int code)
-{
- static char *error;
- static char errbuf[1024];
-
- errbuf[0] = 0;
- switch (code)
- {
- case MMSYSERR_NODRIVER:
- error = "Joystick driver not present";
- break;
-
- case MMSYSERR_INVALPARAM:
- case JOYERR_PARMS:
- error = "Invalid parameter(s)";
- break;
-
- case MMSYSERR_BADDEVICEID:
- error = "Bad device ID";
- break;
-
- case JOYERR_UNPLUGGED:
- error = "Joystick not attached";
- break;
-
- case JOYERR_NOCANDO:
- error = "Can't capture joystick input";
- break;
-
- default:
- SDL_snprintf(errbuf, SDL_arraysize(errbuf),
- "%s: Unknown Multimedia system error: 0x%x",
- function, code);
- break;
- }
-
- if ( ! errbuf[0] ) {
- SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: %s", function, error);
- }
- SDL_SetError("%s", errbuf);
-}
-
-#endif /* SDL_JOYSTICK_WINMM */
diff --git a/distrib/sdl-1.2.12/src/loadso/beos/SDL_sysloadso.c b/distrib/sdl-1.2.12/src/loadso/beos/SDL_sysloadso.c
deleted file mode 100644
index ba06d93..0000000
--- a/distrib/sdl-1.2.12/src/loadso/beos/SDL_sysloadso.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_LOADSO_BEOS
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* System dependent library loading routines */
-
-#include <stdio.h>
-#include <be/kernel/image.h>
-
-#include "SDL_loadso.h"
-
-void *
-SDL_LoadObject(const char *sofile)
-{
- void *handle = NULL;
- image_id library_id = load_add_on(sofile);
- if (library_id < 0) {
- SDL_SetError(strerror((int) library_id));
- } else {
- handle = (void *) (library_id);
- }
- return (handle);
-}
-
-void *
-SDL_LoadFunction(void *handle, const char *name)
-{
- void *sym = NULL;
- image_id library_id = (image_id) handle;
- status_t rc = get_image_symbol(library_id, name, B_SYMBOL_TYPE_TEXT, &sym);
- if (rc != B_NO_ERROR) {
- SDL_SetError(strerror(rc));
- }
- return (sym);
-}
-
-void
-SDL_UnloadObject(void *handle)
-{
- image_id library_id;
- if (handle != NULL) {
- library_id = (image_id) handle;
- unload_add_on(library_id);
- }
-}
-
-#endif /* SDL_LOADSO_BEOS */
-
-/* vi: set ts=4 sw=4 expandtab: */
-
diff --git a/distrib/sdl-1.2.12/src/loadso/dlopen/SDL_sysloadso.c b/distrib/sdl-1.2.12/src/loadso/dlopen/SDL_sysloadso.c
deleted file mode 100644
index 550acad..0000000
--- a/distrib/sdl-1.2.12/src/loadso/dlopen/SDL_sysloadso.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_LOADSO_DLOPEN
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* System dependent library loading routines */
-
-#include <stdio.h>
-#include <dlfcn.h>
-
-#include "SDL_loadso.h"
-
-void *SDL_LoadObject(const char *sofile)
-{
- void *handle = dlopen(sofile, RTLD_NOW);
- const char *loaderror = (char *)dlerror();
- if ( handle == NULL ) {
- SDL_SetError("Failed loading %s: %s", sofile, loaderror);
- }
- return(handle);
-}
-
-void *SDL_LoadFunction(void *handle, const char *name)
-{
- void *symbol = dlsym(handle, name);
- if ( symbol == NULL ) {
- /* append an underscore for platforms that need that. */
- size_t len = 1+SDL_strlen(name)+1;
- char *_name = SDL_stack_alloc(char, len);
- _name[0] = '_';
- SDL_strlcpy(&_name[1], name, len);
- symbol = dlsym(handle, _name);
- SDL_stack_free(_name);
- if ( symbol == NULL ) {
- SDL_SetError("Failed loading %s: %s", name, (const char *)dlerror());
- }
- }
- return(symbol);
-}
-
-void SDL_UnloadObject(void *handle)
-{
- if ( handle != NULL ) {
- dlclose(handle);
- }
-}
-
-#endif /* SDL_LOADSO_DLOPEN */
diff --git a/distrib/sdl-1.2.12/src/loadso/dummy/SDL_sysloadso.c b/distrib/sdl-1.2.12/src/loadso/dummy/SDL_sysloadso.c
deleted file mode 100644
index 6cd16b9..0000000
--- a/distrib/sdl-1.2.12/src/loadso/dummy/SDL_sysloadso.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#if defined(SDL_LOADSO_DUMMY) || defined(SDL_LOADSO_DISABLED)
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* System dependent library loading routines */
-
-#include "SDL_loadso.h"
-
-void *SDL_LoadObject(const char *sofile)
-{
- const char *loaderror = "SDL_LoadObject() not implemented";
- SDL_SetError("Failed loading %s: %s", sofile, loaderror);
- return(NULL);
-}
-
-void *SDL_LoadFunction(void *handle, const char *name)
-{
- const char *loaderror = "SDL_LoadFunction() not implemented";
- SDL_SetError("Failed loading %s: %s", name, loaderror);
- return(NULL);
-}
-
-void SDL_UnloadObject(void *handle)
-{
- /* no-op. */
-}
-
-#endif /* SDL_LOADSO_DUMMY || SDL_LOADSO_DISABLED */
diff --git a/distrib/sdl-1.2.12/src/loadso/macos/SDL_sysloadso.c b/distrib/sdl-1.2.12/src/loadso/macos/SDL_sysloadso.c
deleted file mode 100644
index 9a6df1d..0000000
--- a/distrib/sdl-1.2.12/src/loadso/macos/SDL_sysloadso.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_LOADSO_MACOS
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* System dependent library loading routines */
-
-#include <stdio.h>
-#include <string.h>
-#define OLDP2C 1
-#include <Strings.h>
-#include <CodeFragments.h>
-#include <Errors.h>
-
-#include "SDL_loadso.h"
-
-void *SDL_LoadObject(const char *sofile)
-{
- void *handle = NULL;
- const char *loaderror = NULL;
- CFragConnectionID library_id;
- Ptr mainAddr;
- Str255 errName;
- OSErr error;
- char psofile[512];
-
- SDL_strlcpy(psofile, sofile, SDL_arraysize(psofile));
- error = GetSharedLibrary(C2PStr(psofile), kCompiledCFragArch,
- kLoadCFrag, &library_id, &mainAddr, errName);
- switch (error) {
- case noErr:
- loaderror = NULL;
- break;
- case cfragNoLibraryErr:
- loaderror = "Library not found";
- break;
- case cfragUnresolvedErr:
- loaderror = "Unabled to resolve symbols";
- break;
- case cfragNoPrivateMemErr:
- case cfragNoClientMemErr:
- loaderror = "Out of memory";
- break;
- default:
- loaderror = "Unknown Code Fragment Manager error";
- break;
- }
- if ( loaderror == NULL ) {
- handle = (void *)(library_id);
- } else {
- SDL_SetError("Failed loading %s: %s", sofile, loaderror);
- }
- return(handle);
-}
-
-void *SDL_LoadFunction(void *handle, const char *name)
-{
- void *symbol = NULL;
- const char *loaderror = NULL;
- CFragSymbolClass class;
- CFragConnectionID library_id = (CFragConnectionID)handle;
- char pname[512];
-
- SDL_strlcpy(pname, name, SDL_arraysize(pname));
- if ( FindSymbol(library_id, C2PStr(pname),
- (char **)&symbol, &class) != noErr ) {
- loaderror = "Symbol not found";
- }
-
- if ( symbol == NULL ) {
- SDL_SetError("Failed loading %s: %s", name, loaderror);
- }
- return(symbol);
-}
-
-void SDL_UnloadObject(void *handle)
-{
- CFragConnectionID library_id;
- if ( handle != NULL ) {
- library_id = (CFragConnectionID)handle;
- CloseConnection(&library_id);
- }
-}
-
-#endif /* SDL_LOADSO_MACOS */
diff --git a/distrib/sdl-1.2.12/src/loadso/macosx/SDL_dlcompat.c b/distrib/sdl-1.2.12/src/loadso/macosx/SDL_dlcompat.c
deleted file mode 100644
index 8628dd1..0000000
--- a/distrib/sdl-1.2.12/src/loadso/macosx/SDL_dlcompat.c
+++ /dev/null
@@ -1,1407 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_LOADSO_DLCOMPAT
-
-/* Please note that dlcompat apparently ships in current Mac OS X versions
- * as a system library that provides compatibility with the Unix "dlopen"
- * interface. In order to allow SDL to work on older OS X releases and also
- * not conflict with the system lib on newer versions, we include dlcompat
- * in SDL and change the symbols to prevent symbol clash with any existing
- * system libraries. --ryan.
- */
-
-/* here is the dlcompat license: */
-
-/*
-Copyright (c) 2002 Jorge Acereda <jacereda@users.sourceforge.net> &
- Peter O'Gorman <ogorman@users.sourceforge.net>
-
-Portions may be copyright others, see the AUTHORS file included with this
-distribution.
-
-Maintained by Peter O'Gorman <ogorman@users.sourceforge.net>
-
-Bug Reports and other queries should go to <ogorman@users.sourceforge.net>
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdarg.h>
-#include <limits.h>
-#include <mach-o/dyld.h>
-#include <mach-o/nlist.h>
-#include <mach-o/getsect.h>
-
-#include "SDL_stdinc.h"
-
-/* Just playing to see if it would compile with the freebsd headers, it does,
- * but because of the different values for RTLD_LOCAL etc, it would break binary
- * compat... oh well
- */
-#ifndef __BSD_VISIBLE
-#define __BSD_VISIBLE 1
-#endif
-
-/*include "dlfcn.h"*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined (__GNUC__) && __GNUC__ > 3
-#define dl_restrict __restrict
-#else
-#define dl_restrict
-#endif
-
-#if 0
-#ifndef _POSIX_SOURCE
-/*
- * Structure filled in by dladdr().
- */
-typedef struct SDL_OSX_dl_info {
- const char *dli_fname; /* Pathname of shared object */
- void *dli_fbase; /* Base address of shared object */
- const char *dli_sname; /* Name of nearest symbol */
- void *dli_saddr; /* Address of nearest symbol */
-} SDL_OSX_Dl_info;
-
-static int SDL_OSX_dladdr(const void * dl_restrict, SDL_OSX_Dl_info * dl_restrict);
-#endif /* ! _POSIX_SOURCE */
-#endif /* 0 */
-
-static int SDL_OSX_dlclose(void * handle);
-static const char * SDL_OSX_dlerror(void);
-static void * SDL_OSX_dlopen(const char *path, int mode);
-static void * SDL_OSX_dlsym(void * dl_restrict handle, const char * dl_restrict symbol);
-
-#define RTLD_LAZY 0x1
-#define RTLD_NOW 0x2
-#define RTLD_LOCAL 0x4
-#define RTLD_GLOBAL 0x8
-
-#ifndef _POSIX_SOURCE
-#define RTLD_NOLOAD 0x10
-#define RTLD_NODELETE 0x80
-
-/*
- * Special handle arguments for SDL_OSX_dlsym().
- */
-#define RTLD_NEXT ((void *) -1) /* Search subsequent objects. */
-#define RTLD_DEFAULT ((void *) -2) /* Use default search algorithm. */
-#endif /* ! _POSIX_SOURCE */
-
-#ifdef __cplusplus
-}
-#endif
-
-#ifndef dl_restrict
-#define dl_restrict __restrict
-#endif
-/* This is not available on 10.1 */
-#ifndef LC_LOAD_WEAK_DYLIB
-#define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD)
-#endif
-
-/* With this stuff here, this thing may actually compile/run on 10.0 systems
- * Not that I have a 10.0 system to test it on anylonger
- */
-#ifndef LC_REQ_DYLD
-#define LC_REQ_DYLD 0x80000000
-#endif
-#ifndef NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED
-#define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 0x4
-#endif
-#ifndef NSADDIMAGE_OPTION_RETURN_ON_ERROR
-#define NSADDIMAGE_OPTION_RETURN_ON_ERROR 0x1
-#endif
-#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND
-#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0
-#endif
-#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR
-#define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4
-#endif
-/* These symbols will be looked for in dyld */
-static const struct mach_header *(*dyld_NSAddImage) (const char *, unsigned long) = 0;
-static int (*dyld_NSIsSymbolNameDefinedInImage) (const struct mach_header *, const char *) = 0;
-static NSSymbol(*dyld_NSLookupSymbolInImage)
- (const struct mach_header *, const char *, unsigned long) = 0;
-
-/* Define this to make dlcompat reuse data block. This way in theory we save
- * a little bit of overhead. However we then couldn't correctly catch excess
- * calls to SDL_OSX_dlclose(). Hence we don't use this feature
- */
-#undef REUSE_STATUS
-
-/* Size of the internal error message buffer (used by dlerror()) */
-#define ERR_STR_LEN 251
-
-/* Maximum number of search paths supported by getSearchPath */
-#define MAX_SEARCH_PATHS 32
-
-
-#define MAGIC_DYLIB_OFI ((NSObjectFileImage) 'DYOF')
-#define MAGIC_DYLIB_MOD ((NSModule) 'DYMO')
-
-/* internal flags */
-#define DL_IN_LIST 0x01
-
-/* our mutex */
-static pthread_mutex_t dlcompat_mutex;
-/* Our thread specific storage
- */
-static pthread_key_t dlerror_key;
-
-struct dlthread
-{
- int lockcnt;
- unsigned char errset;
- char errstr[ERR_STR_LEN];
-};
-
-/* This is our central data structure. Whenever a module is loaded via
- * SDL_OSX_dlopen(), we create such a struct.
- */
-struct dlstatus
-{
- struct dlstatus *next; /* pointer to next element in the linked list */
- NSModule module;
- const struct mach_header *lib;
- int refs; /* reference count */
- int mode; /* mode in which this module was loaded */
- dev_t device;
- ino_t inode;
- int flags; /* Any internal flags we may need */
-};
-
-/* Head node of the dlstatus list */
-static struct dlstatus mainStatus = { 0, MAGIC_DYLIB_MOD, NULL, -1, RTLD_GLOBAL, 0, 0, 0 };
-static struct dlstatus *stqueue = &mainStatus;
-
-
-/* Storage for the last error message (used by dlerror()) */
-/* static char err_str[ERR_STR_LEN]; */
-/* static int err_filled = 0; */
-
-/* Prototypes to internal functions */
-static void debug(const char *fmt, ...);
-static void error(const char *str, ...);
-static const char *safegetenv(const char *s);
-static const char *searchList(void);
-static const char *getSearchPath(int i);
-static const char *getFullPath(int i, const char *file);
-static const struct stat *findFile(const char *file, const char **fullPath);
-static int isValidStatus(struct dlstatus *status);
-static inline int isFlagSet(int mode, int flag);
-static struct dlstatus *lookupStatus(const struct stat *sbuf);
-static void insertStatus(struct dlstatus *dls, const struct stat *sbuf);
-static int promoteLocalToGlobal(struct dlstatus *dls);
-static void *reference(struct dlstatus *dls, int mode);
-static void *dlsymIntern(struct dlstatus *dls, const char *symbol, int canSetError);
-static struct dlstatus *allocStatus(void);
-static struct dlstatus *loadModule(const char *path, const struct stat *sbuf, int mode);
-static NSSymbol search_linked_libs(const struct mach_header *mh, const char *symbol);
-static const char *get_lib_name(const struct mach_header *mh);
-static const struct mach_header *get_mach_header_from_NSModule(NSModule mod);
-static void dlcompat_init_func(void);
-static inline void dlcompat_init_check(void);
-static inline void dolock(void);
-static inline void dounlock(void);
-static void dlerrorfree(void *data);
-static void resetdlerror(void);
-static const struct mach_header *my_find_image(const char *name);
-static const struct mach_header *image_for_address(const void *address);
-static inline char *dyld_error_str(void);
-
-#if FINK_BUILD
-/* Two Global Functions */
-static void *dlsym_prepend_underscore(void *handle, const char *symbol);
-static void *dlsym_auto_underscore(void *handle, const char *symbol);
-
-/* And their _intern counterparts */
-static void *dlsym_prepend_underscore_intern(void *handle, const char *symbol);
-static void *dlsym_auto_underscore_intern(void *handle, const char *symbol);
-#endif
-
-/* Functions */
-
-static void debug(const char *fmt, ...)
-{
-#if DEBUG > 1
- va_list arg;
- va_start(arg, fmt);
- fprintf(stderr, "DLDEBUG: ");
- vfprintf(stderr, fmt, arg);
- fprintf(stderr, "\n");
- fflush(stderr);
- va_end(arg);
-#endif
-}
-
-static void error(const char *str, ...)
-{
- va_list arg;
- struct dlthread *tss;
- char * err_str;
- va_start(arg, str);
- tss = pthread_getspecific(dlerror_key);
- err_str = tss->errstr;
- SDL_strlcpy(err_str, "dlcompat: ", ERR_STR_LEN);
- vsnprintf(err_str + 10, ERR_STR_LEN - 10, str, arg);
- va_end(arg);
- debug("ERROR: %s\n", err_str);
- tss->errset = 1;
-}
-
-static void warning(const char *str)
-{
-#if DEBUG > 0
- fprintf(stderr, "WARNING: dlcompat: %s\n", str);
-#endif
-}
-
-static const char *safegetenv(const char *s)
-{
- const char *ss = SDL_getenv(s);
- return ss ? ss : "";
-}
-
-/* because this is only used for debugging and error reporting functions, we
- * don't really care about how elegant it is... it could use the load
- * commands to find the install name of the library, but...
- */
-static const char *get_lib_name(const struct mach_header *mh)
-{
- unsigned long count = _dyld_image_count();
- unsigned long i;
- const char *val = NULL;
- if (mh)
- {
- for (i = 0; i < count; i++)
- {
- if (mh == _dyld_get_image_header(i))
- {
- val = _dyld_get_image_name(i);
- break;
- }
- }
- }
- return val;
-}
-
-/* Returns the mach_header for the module bu going through all the loaded images
- * and finding the one with the same name as the module. There really ought to be
- * an api for doing this, would be faster, but there isn't one right now
- */
-static const struct mach_header *get_mach_header_from_NSModule(NSModule mod)
-{
- const char *mod_name = NSNameOfModule(mod);
- const struct mach_header *mh = NULL;
- unsigned long count = _dyld_image_count();
- unsigned long i;
- debug("Module name: %s", mod_name);
- for (i = 0; i < count; i++)
- {
- if (!SDL_strcmp(mod_name, _dyld_get_image_name(i)))
- {
- mh = _dyld_get_image_header(i);
- break;
- }
- }
- return mh;
-}
-
-
-/* Compute and return a list of all directories that we should search when
- * trying to locate a module. We first look at the values of LD_LIBRARY_PATH
- * and DYLD_LIBRARY_PATH, and then finally fall back to looking into
- * /usr/lib and /lib. Since both of the environments variables can contain a
- * list of colon seperated paths, we simply concat them and the two other paths
- * into one big string, which we then can easily parse.
- * Splitting this string into the actual path list is done by getSearchPath()
- */
-static const char *searchList()
-{
- size_t buf_size;
- static char *buf=NULL;
- const char *ldlp = safegetenv("LD_LIBRARY_PATH");
- const char *dyldlp = safegetenv("DYLD_LIBRARY_PATH");
- const char *stdpath = SDL_getenv("DYLD_FALLBACK_LIBRARY_PATH");
- if (!stdpath)
- stdpath = "/usr/local/lib:/lib:/usr/lib";
- if (!buf)
- {
- buf_size = SDL_strlen(ldlp) + SDL_strlen(dyldlp) + SDL_strlen(stdpath) + 4;
- buf = SDL_malloc(buf_size);
- SDL_snprintf(buf, buf_size, "%s%s%s%s%s%c", dyldlp, (dyldlp[0] ? ":" : ""), ldlp, (ldlp[0] ? ":" : ""),
- stdpath, '\0');
- }
- return buf;
-}
-
-/* Returns the ith search path from the list as computed by searchList() */
-static const char *getSearchPath(int i)
-{
- static const char *list = 0;
- static char **path = (char **)0;
- static int end = 0;
- static int numsize = MAX_SEARCH_PATHS;
- static char **tmp;
- /* So we can call SDL_free() in the "destructor" we use i=-1 to return the alloc'd array */
- if (i == -1)
- {
- return (const char*)path;
- }
- if (!path)
- {
- path = (char **)SDL_calloc(MAX_SEARCH_PATHS, sizeof(char **));
- }
- if (!list && !end)
- list = searchList();
- if (i >= (numsize))
- {
- debug("Increasing size for long PATH");
- tmp = (char **)SDL_calloc((MAX_SEARCH_PATHS + numsize), sizeof(char **));
- if (tmp)
- {
- SDL_memcpy(tmp, path, sizeof(char **) * numsize);
- SDL_free(path);
- path = tmp;
- numsize += MAX_SEARCH_PATHS;
- }
- else
- {
- return 0;
- }
- }
-
- while (!path[i] && !end)
- {
- path[i] = strsep((char **)&list, ":");
-
- if (path[i][0] == 0)
- path[i] = 0;
- end = (list == 0);
- }
- return path[i];
-}
-
-static const char *getFullPath(int i, const char *file)
-{
- static char buf[PATH_MAX];
- const char *path = getSearchPath(i);
- if (path)
- {
- SDL_snprintf(buf, PATH_MAX, "%s/%s", path, file);
- }
- return path ? buf : 0;
-}
-
-/* Given a file name, try to determine the full path for that file. Starts
- * its search in the current directory, and then tries all paths in the
- * search list in the order they are specified there.
- */
-static const struct stat *findFile(const char *file, const char **fullPath)
-{
- int i = 0;
- static struct stat sbuf;
- char *fileName;
- debug("finding file %s", file);
- *fullPath = file;
- if (0 == stat(file, &sbuf))
- return &sbuf;
- if (SDL_strchr(file, '/'))
- return 0; /* If the path had a / we don't look in env var places */
- fileName = NULL;
- if (!fileName)
- fileName = (char *)file;
- while ((*fullPath = getFullPath(i++, fileName)))
- {
- if (0 == stat(*fullPath, &sbuf))
- return &sbuf;
- }
- ;
- return 0;
-}
-
-/* Determine whether a given dlstatus is valid or not */
-static int isValidStatus(struct dlstatus *status)
-{
- /* Walk the list to verify status is contained in it */
- struct dlstatus *dls = stqueue;
- while (dls && status != dls)
- dls = dls->next;
- if (dls == 0)
- error("invalid handle");
- else if ((dls->module == 0) || (dls->refs == 0))
- error("handle to closed library");
- else
- return TRUE;
- return FALSE;
-}
-
-static inline int isFlagSet(int mode, int flag)
-{
- return (mode & flag) == flag;
-}
-
-static struct dlstatus *lookupStatus(const struct stat *sbuf)
-{
- struct dlstatus *dls = stqueue;
- debug("looking for status");
- while (dls && ( /* isFlagSet(dls->mode, RTLD_UNSHARED) */ 0
- || sbuf->st_dev != dls->device || sbuf->st_ino != dls->inode))
- dls = dls->next;
- return dls;
-}
-
-static void insertStatus(struct dlstatus *dls, const struct stat *sbuf)
-{
- debug("inserting status");
- dls->inode = sbuf->st_ino;
- dls->device = sbuf->st_dev;
- dls->refs = 0;
- dls->mode = 0;
- if ((dls->flags & DL_IN_LIST) == 0)
- {
- dls->next = stqueue;
- stqueue = dls;
- dls->flags |= DL_IN_LIST;
- }
-}
-
-static struct dlstatus *allocStatus()
-{
- struct dlstatus *dls;
-#ifdef REUSE_STATUS
- dls = stqueue;
- while (dls && dls->module)
- dls = dls->next;
- if (!dls)
-#endif
- dls = SDL_calloc(sizeof(*dls),1);
- return dls;
-}
-
-static int promoteLocalToGlobal(struct dlstatus *dls)
-{
- static int (*p) (NSModule module) = 0;
- debug("promoting");
- if (!p)
- _dyld_func_lookup("__dyld_NSMakePrivateModulePublic", (void **)&p);
- return (dls->module == MAGIC_DYLIB_MOD) || (p && p(dls->module));
-}
-
-static void *reference(struct dlstatus *dls, int mode)
-{
- if (dls)
- {
- if (dls->module == MAGIC_DYLIB_MOD && isFlagSet(mode, RTLD_LOCAL))
- {
- warning("trying to open a .dylib with RTLD_LOCAL");
- error("unable to open a .dylib with RTLD_LOCAL");
- return NULL;
- }
- if (isFlagSet(mode, RTLD_GLOBAL) &&
- !isFlagSet(dls->mode, RTLD_GLOBAL) && !promoteLocalToGlobal(dls))
- {
- error("unable to promote local module to global");
- return NULL;
- }
- dls->mode |= mode;
- dls->refs++;
- }
- else
- debug("reference called with NULL argument");
-
- return dls;
-}
-
-static const struct mach_header *my_find_image(const char *name)
-{
- const struct mach_header *mh = 0;
- const char *id = NULL;
- int i = _dyld_image_count();
- int j;
- mh = (struct mach_header *)
- dyld_NSAddImage(name, NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED |
- NSADDIMAGE_OPTION_RETURN_ON_ERROR);
- if (!mh)
- {
- for (j = 0; j < i; j++)
- {
- id = _dyld_get_image_name(j);
- if (!SDL_strcmp(id, name))
- {
- mh = _dyld_get_image_header(j);
- break;
- }
- }
- }
- return mh;
-}
-
-/*
- * dyld adds libraries by first adding the directly dependant libraries in link order, and
- * then adding the dependencies for those libraries, so we should do the same... but we don't
- * bother adding the extra dependencies, if the symbols are neither in the loaded image nor
- * any of it's direct dependencies, then it probably isn't there.
- */
-static NSSymbol search_linked_libs(const struct mach_header * mh, const char *symbol)
-{
- unsigned int n;
- struct load_command *lc = 0;
- struct mach_header *wh;
- NSSymbol nssym = 0;
- if (dyld_NSAddImage && dyld_NSIsSymbolNameDefinedInImage && dyld_NSLookupSymbolInImage)
- {
- lc = (struct load_command *)((char *)mh + sizeof(struct mach_header));
- for (n = 0; n < mh->ncmds; n++, lc = (struct load_command *)((char *)lc + lc->cmdsize))
- {
- if ((LC_LOAD_DYLIB == lc->cmd) || (LC_LOAD_WEAK_DYLIB == lc->cmd))
- {
- if ((wh = (struct mach_header *)
- my_find_image((char *)(((struct dylib_command *)lc)->dylib.name.offset +
- (char *)lc))))
- {
- if (dyld_NSIsSymbolNameDefinedInImage(wh, symbol))
- {
- nssym = dyld_NSLookupSymbolInImage(wh,
- symbol,
- NSLOOKUPSYMBOLINIMAGE_OPTION_BIND |
- NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR);
- break;
- }
- }
- }
- }
- if ((!nssym) && NSIsSymbolNameDefined(symbol))
- {
- /* I've never seen this debug message...*/
- debug("Symbol \"%s\" is defined but was not found", symbol);
- }
- }
- return nssym;
-}
-
-/* Up to the caller to SDL_free() returned string */
-static inline char *dyld_error_str()
-{
- NSLinkEditErrors dylder;
- int dylderno;
- const char *dylderrstr;
- const char *dyldfile;
- char* retStr = NULL;
- NSLinkEditError(&dylder, &dylderno, &dyldfile, &dylderrstr);
- if (dylderrstr && *dylderrstr)
- {
- retStr = SDL_strdup(dylderrstr);
- }
- return retStr;
-}
-
-static void *dlsymIntern(struct dlstatus *dls, const char *symbol, int canSetError)
-{
- NSSymbol nssym = 0;
-#ifdef __GCC__
- void *caller = __builtin_return_address(1); /* Be *very* careful about inlining */
-#else
- void *caller = NULL;
-#endif
- const struct mach_header *caller_mh = 0;
- char *savedErrorStr = NULL;
- resetdlerror();
-#ifndef RTLD_SELF
-#define RTLD_SELF ((void *) -3)
-#endif
- if (NULL == dls)
- dls = RTLD_SELF;
- if ((RTLD_NEXT == dls) || (RTLD_SELF == dls))
- {
- if (dyld_NSIsSymbolNameDefinedInImage && dyld_NSLookupSymbolInImage && caller)
- {
- caller_mh = image_for_address(caller);
- if (RTLD_SELF == dls)
- {
- /* FIXME: We should be using the NSModule api, if SELF is an MH_BUNDLE
- * But it appears to work anyway, and looking at the code in dyld_libfuncs.c
- * this is acceptable.
- */
- if (dyld_NSIsSymbolNameDefinedInImage(caller_mh, symbol))
- {
- nssym = dyld_NSLookupSymbolInImage(caller_mh,
- symbol,
- NSLOOKUPSYMBOLINIMAGE_OPTION_BIND |
- NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR);
- }
- }
- if (!nssym)
- {
- if (RTLD_SELF == dls)
- savedErrorStr = dyld_error_str();
- nssym = search_linked_libs(caller_mh, symbol);
- }
- }
- else
- {
- if (canSetError)
- error("RTLD_SELF and RTLD_NEXT are not supported");
- return NULL;
- }
- }
- if (!nssym)
- {
-
- if (RTLD_DEFAULT == dls)
- {
- dls = &mainStatus;
- }
- if (!isValidStatus(dls))
- return NULL;
-
- if (dls->module != MAGIC_DYLIB_MOD)
- {
- nssym = NSLookupSymbolInModule(dls->module, symbol);
- if (!nssym && NSIsSymbolNameDefined(symbol))
- {
- debug("Searching dependencies");
- savedErrorStr = dyld_error_str();
- nssym = search_linked_libs(get_mach_header_from_NSModule(dls->module), symbol);
- }
- }
- else if (dls->lib && dyld_NSIsSymbolNameDefinedInImage && dyld_NSLookupSymbolInImage)
- {
- if (dyld_NSIsSymbolNameDefinedInImage(dls->lib, symbol))
- {
- nssym = dyld_NSLookupSymbolInImage(dls->lib,
- symbol,
- NSLOOKUPSYMBOLINIMAGE_OPTION_BIND |
- NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR);
- }
- else if (NSIsSymbolNameDefined(symbol))
- {
- debug("Searching dependencies");
- savedErrorStr = dyld_error_str();
- nssym = search_linked_libs(dls->lib, symbol);
- }
- }
- else if (dls->module == MAGIC_DYLIB_MOD)
- {
- /* Global context, use NSLookupAndBindSymbol */
- if (NSIsSymbolNameDefined(symbol))
- {
- /* There doesn't seem to be a return on error option for this call???
- this is potentially broken, if binding fails, it will improperly
- exit the application. */
- nssym = NSLookupAndBindSymbol(symbol);
- }
- else
- {
- if (savedErrorStr)
- SDL_free(savedErrorStr);
- savedErrorStr = SDL_malloc(256);
- SDL_snprintf(savedErrorStr, 256, "Symbol \"%s\" not in global context",symbol);
- }
- }
- }
- /* Error reporting */
- if (!nssym)
- {
- if (!savedErrorStr || !SDL_strlen(savedErrorStr))
- {
- if (savedErrorStr)
- SDL_free(savedErrorStr);
- savedErrorStr = SDL_malloc(256);
- SDL_snprintf(savedErrorStr, 256,"Symbol \"%s\" not found",symbol);
- }
- if (canSetError)
- {
- error(savedErrorStr);
- }
- else
- {
- debug(savedErrorStr);
- }
- if (savedErrorStr)
- SDL_free(savedErrorStr);
- return NULL;
- }
- return NSAddressOfSymbol(nssym);
-}
-
-static struct dlstatus *loadModule(const char *path, const struct stat *sbuf, int mode)
-{
- NSObjectFileImage ofi = 0;
- NSObjectFileImageReturnCode ofirc;
- struct dlstatus *dls;
- NSLinkEditErrors ler;
- int lerno;
- const char *errstr;
- const char *file;
- void (*init) (void);
-
- ofirc = NSCreateObjectFileImageFromFile(path, &ofi);
- switch (ofirc)
- {
- case NSObjectFileImageSuccess:
- break;
- case NSObjectFileImageInappropriateFile:
- if (dyld_NSAddImage && dyld_NSIsSymbolNameDefinedInImage && dyld_NSLookupSymbolInImage)
- {
- if (isFlagSet(mode, RTLD_LOCAL))
- {
- warning("trying to open a .dylib with RTLD_LOCAL");
- error("unable to open this file with RTLD_LOCAL");
- return NULL;
- }
- }
- else
- {
- error("opening this file is unsupported on this system");
- return NULL;
- }
- break;
- case NSObjectFileImageFailure:
- error("object file setup failure");
- return NULL;
- case NSObjectFileImageArch:
- error("no object for this architecture");
- return NULL;
- case NSObjectFileImageFormat:
- error("bad object file format");
- return NULL;
- case NSObjectFileImageAccess:
- error("can't read object file");
- return NULL;
- default:
- error("unknown error from NSCreateObjectFileImageFromFile()");
- return NULL;
- }
- dls = lookupStatus(sbuf);
- if (!dls)
- {
- dls = allocStatus();
- }
- if (!dls)
- {
- error("unable to allocate memory");
- return NULL;
- }
- // dls->lib = 0;
- if (ofirc == NSObjectFileImageInappropriateFile)
- {
- if ((dls->lib = dyld_NSAddImage(path, NSADDIMAGE_OPTION_RETURN_ON_ERROR)))
- {
- debug("Dynamic lib loaded at %ld", dls->lib);
- ofi = MAGIC_DYLIB_OFI;
- dls->module = MAGIC_DYLIB_MOD;
- ofirc = NSObjectFileImageSuccess;
- /* Although it is possible with a bit of work to modify this so it works and
- functions with RTLD_NOW, I don't deem it necessary at the moment */
- }
- if (!(dls->module))
- {
- NSLinkEditError(&ler, &lerno, &file, &errstr);
- if (!errstr || (!SDL_strlen(errstr)))
- error("Can't open this file type");
- else
- error(errstr);
- if ((dls->flags & DL_IN_LIST) == 0)
- {
- SDL_free(dls);
- }
- return NULL;
- }
- }
- else
- {
- dls->module = NSLinkModule(ofi, path,
- NSLINKMODULE_OPTION_RETURN_ON_ERROR |
- NSLINKMODULE_OPTION_PRIVATE |
- (isFlagSet(mode, RTLD_NOW) ? NSLINKMODULE_OPTION_BINDNOW : 0));
- NSDestroyObjectFileImage(ofi);
- if (dls->module)
- {
- dls->lib = get_mach_header_from_NSModule(dls->module);
- }
- }
- if (!dls->module)
- {
- NSLinkEditError(&ler, &lerno, &file, &errstr);
- if ((dls->flags & DL_IN_LIST) == 0)
- {
- SDL_free(dls);
- }
- error(errstr);
- return NULL;
- }
-
- insertStatus(dls, sbuf);
- dls = reference(dls, mode);
- if ((init = dlsymIntern(dls, "__init", 0)))
- {
- debug("calling _init()");
- init();
- }
- return dls;
-}
-
-inline static void dlcompat_init_check(void)
-{
- static pthread_mutex_t l = PTHREAD_MUTEX_INITIALIZER;
- static int init_done = 0;
-
- pthread_mutex_lock(&l);
- if (!init_done) {
- dlcompat_init_func();
- init_done = 1;
- }
- pthread_mutex_unlock(&l);
-}
-
-static void dlcompat_init_func(void)
-{
- _dyld_func_lookup("__dyld_NSAddImage", (void **)&dyld_NSAddImage);
- _dyld_func_lookup("__dyld_NSIsSymbolNameDefinedInImage",
- (void **)&dyld_NSIsSymbolNameDefinedInImage);
- _dyld_func_lookup("__dyld_NSLookupSymbolInImage", (void **)&dyld_NSLookupSymbolInImage);
- if (pthread_mutex_init(&dlcompat_mutex, NULL))
- exit(1);
- if (pthread_key_create(&dlerror_key, &dlerrorfree))
- exit(1);
-}
-
-static void resetdlerror()
-{
- struct dlthread *tss;
- tss = pthread_getspecific(dlerror_key);
- tss->errset = 0;
-}
-
-static void dlerrorfree(void *data)
-{
- SDL_free(data);
-}
-
-/* We kind of want a recursive lock here, but meet a little trouble
- * because they are not available pre OS X 10.2, so we fake it
- * using thread specific storage to keep a lock count
- */
-static inline void dolock(void)
-{
- int err = 0;
- struct dlthread *tss;
- dlcompat_init_check();
- tss = pthread_getspecific(dlerror_key);
- if (!tss)
- {
- tss = SDL_malloc(sizeof(struct dlthread));
- tss->lockcnt = 0;
- tss->errset = 0;
- if (pthread_setspecific(dlerror_key, tss))
- {
- fprintf(stderr,"dlcompat: pthread_setspecific failed\n");
- exit(1);
- }
- }
- if (!tss->lockcnt)
- err = pthread_mutex_lock(&dlcompat_mutex);
- tss->lockcnt = tss->lockcnt +1;
- if (err)
- exit(err);
-}
-
-static inline void dounlock(void)
-{
- int err = 0;
- struct dlthread *tss;
- tss = pthread_getspecific(dlerror_key);
- tss->lockcnt = tss->lockcnt -1;
- if (!tss->lockcnt)
- err = pthread_mutex_unlock(&dlcompat_mutex);
- if (err)
- exit(err);
-}
-
-static void *SDL_OSX_dlopen(const char *path, int mode)
-{
- const struct stat *sbuf;
- struct dlstatus *dls;
- const char *fullPath;
-
- dolock();
- resetdlerror();
- if (!path)
- {
- dls = &mainStatus;
- goto dlopenok;
- }
- if (!(sbuf = findFile(path, &fullPath)))
- {
- error("file \"%s\" not found", path);
- goto dlopenerror;
- }
- /* Now checks that it hasn't been closed already */
- if ((dls = lookupStatus(sbuf)) && (dls->refs > 0))
- {
- /* debug("status found"); */
- dls = reference(dls, mode);
- goto dlopenok;
- }
-#ifdef RTLD_NOLOAD
- if (isFlagSet(mode, RTLD_NOLOAD))
- {
- error("no existing handle and RTLD_NOLOAD specified");
- goto dlopenerror;
- }
-#endif
- if (isFlagSet(mode, RTLD_LAZY) && isFlagSet(mode, RTLD_NOW))
- {
- error("how can I load something both RTLD_LAZY and RTLD_NOW?");
- goto dlopenerror;
- }
- dls = loadModule(fullPath, sbuf, mode);
-
- dlopenok:
- dounlock();
- return (void *)dls;
- dlopenerror:
- dounlock();
- return NULL;
-}
-
-#if !FINK_BUILD
-static void *SDL_OSX_dlsym(void * dl_restrict handle, const char * dl_restrict symbol)
-{
- int sym_len = SDL_strlen(symbol);
- void *value = NULL;
- char *malloc_sym = NULL;
- dolock();
- malloc_sym = SDL_malloc(sym_len + 2);
- if (malloc_sym)
- {
- SDL_snprintf(malloc_sym, sym_len+2, "_%s", symbol);
- value = dlsymIntern(handle, malloc_sym, 1);
- SDL_free(malloc_sym);
- }
- else
- {
- error("Unable to allocate memory");
- goto dlsymerror;
- }
- dounlock();
- return value;
- dlsymerror:
- dounlock();
- return NULL;
-}
-#endif
-
-#if FINK_BUILD
-
-static void *dlsym_prepend_underscore(void *handle, const char *symbol)
-{
- void *answer;
- dolock();
- answer = dlsym_prepend_underscore_intern(handle, symbol);
- dounlock();
- return answer;
-}
-
-static void *dlsym_prepend_underscore_intern(void *handle, const char *symbol)
-{
-/*
- * A quick and easy way for porting packages which call dlsym(handle,"sym")
- * If the porter adds -Ddlsym=dlsym_prepend_underscore to the CFLAGS then
- * this function will be called, and will add the required underscore.
- *
- * Note that I haven't figured out yet which should be "standard", prepend
- * the underscore always, or not at all. These global functions need to go away
- * for opendarwin.
- */
- int sym_len = SDL_strlen(symbol);
- void *value = NULL;
- char *malloc_sym = NULL;
- malloc_sym = SDL_malloc(sym_len + 2);
- if (malloc_sym)
- {
- SDL_snprintf(malloc_sym, sym_len+2, "_%s", symbol);
- value = dlsymIntern(handle, malloc_sym, 1);
- SDL_free(malloc_sym);
- }
- else
- {
- error("Unable to allocate memory");
- }
- return value;
-}
-
-static void *dlsym_auto_underscore(void *handle, const char *symbol)
-{
- void *answer;
- dolock();
- answer = dlsym_auto_underscore_intern(handle, symbol);
- dounlock();
- return answer;
-
-}
-static void *dlsym_auto_underscore_intern(void *handle, const char *symbol)
-{
- struct dlstatus *dls = handle;
- void *addr = 0;
- addr = dlsymIntern(dls, symbol, 0);
- if (!addr)
- addr = dlsym_prepend_underscore_intern(handle, symbol);
- return addr;
-}
-
-
-static void *SDL_OSX_dlsym(void * dl_restrict handle, const char * dl_restrict symbol)
-{
- struct dlstatus *dls = handle;
- void *addr = 0;
- dolock();
- addr = dlsymIntern(dls, symbol, 1);
- dounlock();
- return addr;
-}
-#endif
-
-static int SDL_OSX_dlclose(void *handle)
-{
- struct dlstatus *dls = handle;
- dolock();
- resetdlerror();
- if (!isValidStatus(dls))
- {
- goto dlcloseerror;
- }
- if (dls->module == MAGIC_DYLIB_MOD)
- {
- const char *name;
- if (!dls->lib)
- {
- name = "global context";
- }
- else
- {
- name = get_lib_name(dls->lib);
- }
- warning("trying to close a .dylib!");
- error("Not closing \"%s\" - dynamic libraries cannot be closed", name);
- goto dlcloseerror;
- }
- if (!dls->module)
- {
- error("module already closed");
- goto dlcloseerror;
- }
-
- if (dls->refs == 1)
- {
- unsigned long options = 0;
- void (*fini) (void);
- if ((fini = dlsymIntern(dls, "__fini", 0)))
- {
- debug("calling _fini()");
- fini();
- }
- options |= NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES;
-#ifdef RTLD_NODELETE
- if (isFlagSet(dls->mode, RTLD_NODELETE))
- options |= NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED;
-#endif
- if (!NSUnLinkModule(dls->module, options))
- {
- error("unable to unlink module");
- goto dlcloseerror;
- }
- dls->refs--;
- dls->module = 0;
- /* Note: the dlstatus struct dls is neither removed from the list
- * nor is the memory it occupies freed. This shouldn't pose a
- * problem in mostly all cases, though.
- */
- }
- dounlock();
- return 0;
- dlcloseerror:
- dounlock();
- return 1;
-}
-
-static const char *SDL_OSX_dlerror(void)
-{
- struct dlthread *tss;
- const char * err_str = NULL;
- dlcompat_init_check();
- tss = pthread_getspecific(dlerror_key);
- if (tss != NULL && tss->errset != 0) {
- tss->errset = 0;
- err_str = tss->errstr;
- }
- return (err_str);
-}
-
-/* Given an address, return the mach_header for the image containing it
- * or zero if the given address is not contained in any loaded images.
- */
-static const struct mach_header *image_for_address(const void *address)
-{
- unsigned long i;
- unsigned long j;
- unsigned long count = _dyld_image_count();
- const struct mach_header *mh = 0;
- struct load_command *lc = 0;
- unsigned long addr = 0;
- for (i = 0; i < count; i++)
- {
- addr = (unsigned long)address - _dyld_get_image_vmaddr_slide(i);
- mh = _dyld_get_image_header(i);
- if (mh)
- {
- lc = (struct load_command *)((char *)mh + sizeof(struct mach_header));
- for (j = 0; j < mh->ncmds; j++, lc = (struct load_command *)((char *)lc + lc->cmdsize))
- {
- if (LC_SEGMENT == lc->cmd &&
- addr >= ((struct segment_command *)lc)->vmaddr &&
- addr <
- ((struct segment_command *)lc)->vmaddr + ((struct segment_command *)lc)->vmsize)
- {
- goto image_found;
- }
- }
- }
- mh = 0;
- }
- image_found:
- return mh;
-}
-
-#if 0 /* unused */
-static int SDL_OSX_dladdr(const void * dl_restrict p, SDL_OSX_Dl_info * dl_restrict info)
-{
-/*
- FIXME: USe the routine image_for_address.
-*/
- unsigned long i;
- unsigned long j;
- unsigned long count = _dyld_image_count();
- struct mach_header *mh = 0;
- struct load_command *lc = 0;
- unsigned long addr = NULL;
- unsigned long table_off = (unsigned long)0;
- int found = 0;
- if (!info)
- return 0;
- dolock();
- resetdlerror();
- info->dli_fname = 0;
- info->dli_fbase = 0;
- info->dli_sname = 0;
- info->dli_saddr = 0;
-/* Some of this was swiped from code posted by Douglas Davidson <ddavidso AT apple DOT com>
- * to darwin-development AT lists DOT apple DOT com and slightly modified
- */
- for (i = 0; i < count; i++)
- {
- addr = (unsigned long)p - _dyld_get_image_vmaddr_slide(i);
- mh = _dyld_get_image_header(i);
- if (mh)
- {
- lc = (struct load_command *)((char *)mh + sizeof(struct mach_header));
- for (j = 0; j < mh->ncmds; j++, lc = (struct load_command *)((char *)lc + lc->cmdsize))
- {
- if (LC_SEGMENT == lc->cmd &&
- addr >= ((struct segment_command *)lc)->vmaddr &&
- addr <
- ((struct segment_command *)lc)->vmaddr + ((struct segment_command *)lc)->vmsize)
- {
- info->dli_fname = _dyld_get_image_name(i);
- info->dli_fbase = (void *)mh;
- found = 1;
- break;
- }
- }
- if (found)
- break;
- }
- }
- if (!found)
- {
- dounlock();
- return 0;
- }
- lc = (struct load_command *)((char *)mh + sizeof(struct mach_header));
- for (j = 0; j < mh->ncmds; j++, lc = (struct load_command *)((char *)lc + lc->cmdsize))
- {
- if (LC_SEGMENT == lc->cmd)
- {
- if (!SDL_strcmp(((struct segment_command *)lc)->segname, "__LINKEDIT"))
- break;
- }
- }
- table_off =
- ((unsigned long)((struct segment_command *)lc)->vmaddr) -
- ((unsigned long)((struct segment_command *)lc)->fileoff) + _dyld_get_image_vmaddr_slide(i);
- debug("table off %x", table_off);
-
- lc = (struct load_command *)((char *)mh + sizeof(struct mach_header));
- for (j = 0; j < mh->ncmds; j++, lc = (struct load_command *)((char *)lc + lc->cmdsize))
- {
- if (LC_SYMTAB == lc->cmd)
- {
-
- struct nlist *symtable = (struct nlist *)(((struct symtab_command *)lc)->symoff + table_off);
- unsigned long numsyms = ((struct symtab_command *)lc)->nsyms;
- struct nlist *nearest = NULL;
- unsigned long diff = 0xffffffff;
- unsigned long strtable = (unsigned long)(((struct symtab_command *)lc)->stroff + table_off);
- debug("symtable %x", symtable);
- for (i = 0; i < numsyms; i++)
- {
- /* Ignore the following kinds of Symbols */
- if ((!symtable->n_value) /* Undefined */
- || (symtable->n_type >= N_PEXT) /* Debug symbol */
- || (!(symtable->n_type & N_EXT)) /* Local Symbol */
- )
- {
- symtable++;
- continue;
- }
- if ((addr >= symtable->n_value) && (diff >= (symtable->n_value - addr)))
- {
- diff = (unsigned long)symtable->n_value - addr;
- nearest = symtable;
- }
- symtable++;
- }
- if (nearest)
- {
- info->dli_saddr = nearest->n_value + ((void *)p - addr);
- info->dli_sname = (char *)(strtable + nearest->n_un.n_strx);
- }
- }
- }
- dounlock();
- return 1;
-}
-#endif
-
-/*
- * Implement the dlfunc() interface, which behaves exactly the same as
- * dlsym() except that it returns a function pointer instead of a data
- * pointer. This can be used by applications to avoid compiler warnings
- * about undefined behavior, and is intended as prior art for future
- * POSIX standardization. This function requires that all pointer types
- * have the same representation, which is true on all platforms FreeBSD
- * runs on, but is not guaranteed by the C standard.
- */
-#if 0
-static dlfunc_t SDL_OSX_dlfunc(void * dl_restrict handle, const char * dl_restrict symbol)
-{
- union
- {
- void *d;
- dlfunc_t f;
- } rv;
- int sym_len = SDL_strlen(symbol);
- char *malloc_sym = NULL;
- dolock();
- malloc_sym = SDL_malloc(sym_len + 2);
- if (malloc_sym)
- {
- SDL_snprintf(malloc_sym, sym_len+2, "_%s", symbol);
- rv.d = dlsymIntern(handle, malloc_sym, 1);
- SDL_free(malloc_sym);
- }
- else
- {
- error("Unable to allocate memory");
- goto dlfuncerror;
- }
- dounlock();
- return rv.f;
- dlfuncerror:
- dounlock();
- return NULL;
-}
-#endif
-
-
-
-/* dlcompat ends, here's the SDL interface... --ryan. */
-
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* System dependent library loading routines */
-
-#include "SDL_loadso.h"
-
-void *SDL_LoadObject(const char *sofile)
-{
- void *handle = SDL_OSX_dlopen(sofile, RTLD_NOW);
- const char *loaderror = SDL_OSX_dlerror();
- if ( handle == NULL ) {
- SDL_SetError("Failed loading %s: %s", sofile, loaderror);
- }
- return(handle);
-}
-
-void *SDL_LoadFunction(void *handle, const char *name)
-{
- void *symbol = SDL_OSX_dlsym(handle, name);
- if ( symbol == NULL ) {
- SDL_SetError("Failed loading %s: %s", name, SDL_OSX_dlerror());
- }
- return(symbol);
-}
-
-void SDL_UnloadObject(void *handle)
-{
- if ( handle != NULL ) {
- SDL_OSX_dlclose(handle);
- }
-}
-
-#endif /* SDL_LOADSO_DLCOMPAT */
diff --git a/distrib/sdl-1.2.12/src/loadso/mint/SDL_sysloadso.c b/distrib/sdl-1.2.12/src/loadso/mint/SDL_sysloadso.c
deleted file mode 100644
index d089e1b..0000000
--- a/distrib/sdl-1.2.12/src/loadso/mint/SDL_sysloadso.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_LOADSO_LDG
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* System dependent library loading routines */
-
-#include <stdio.h>
-#include <gem.h>
-#include <ldg.h>
-
-#include "SDL_loadso.h"
-
-void *SDL_LoadObject(const char *sofile)
-{
- const char *loaderror = "Unknown error";
- void *handle = (void *)ldg_open((char *)sofile, ldg_global);
- if ( handle == NULL ) {
- SDL_SetError("Failed loading %s: %s", sofile, loaderror);
- }
- return(handle);
-}
-
-void *SDL_LoadFunction(void *handle, const char *name)
-{
- const char *loaderror = "Unknown error";
- void *symbol = (void *)ldg_find((char *)name, (LDG *)handle);
- if ( symbol == NULL ) {
- SDL_SetError("Failed loading %s: %s", name, loaderror);
- }
- return(symbol);
-}
-
-void SDL_UnloadObject(void *handle)
-{
- if ( handle != NULL ) {
- ldg_close((LDG *)handle, ldg_global);
- }
-}
-
-#endif /* SDL_LOADSO_LDG */
diff --git a/distrib/sdl-1.2.12/src/loadso/os2/SDL_sysloadso.c b/distrib/sdl-1.2.12/src/loadso/os2/SDL_sysloadso.c
deleted file mode 100644
index 0067591..0000000
--- a/distrib/sdl-1.2.12/src/loadso/os2/SDL_sysloadso.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_LOADSO_OS2
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* System dependent library loading routines */
-
-#include <stdio.h>
-#define INCL_DOSERRORS
-#define INCL_DOSMODULEMGR
-#include <os2.h>
-
-#include "SDL_loadso.h"
-
-void *SDL_LoadObject(const char *sofile)
-{
- HMODULE handle = NULL;
- char buf[512];
- APIRET ulrc = DosLoadModule(buf, sizeof (buf), (char *) sofile, &handle);
-
- /* Generate an error message if all loads failed */
- if ((ulrc != NO_ERROR) || (handle == NULL))
- SDL_SetError("Failed loading %s: %s", sofile, buf);
-
- return((void *) handle);
-}
-
-void *SDL_LoadFunction(void *handle, const char *name)
-{
- const char *loaderror = "Unknown error";
- void *symbol = NULL;
- APIRET ulrc = DosQueryProcAddr((HMODULE)handle, 0, (char *)name, &symbol);
- if (ulrc == ERROR_INVALID_HANDLE)
- loaderror = "Invalid module handle";
- else if (ulrc == ERROR_INVALID_NAME)
- loaderror = "Symbol not found";
-
- if (symbol == NULL)
- SDL_SetError("Failed loading %s: %s", name, loaderror);
-
- return(symbol);
-}
-
-void SDL_UnloadObject(void *handle)
-{
- if ( handle != NULL )
- DosFreeModule((HMODULE) handle);
-}
-
-#endif /* SDL_LOADSO_OS2 */
diff --git a/distrib/sdl-1.2.12/src/loadso/win32/SDL_sysloadso.c b/distrib/sdl-1.2.12/src/loadso/win32/SDL_sysloadso.c
deleted file mode 100644
index 8ed7c68..0000000
--- a/distrib/sdl-1.2.12/src/loadso/win32/SDL_sysloadso.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_LOADSO_WIN32
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* System dependent library loading routines */
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-#include "SDL_loadso.h"
-
-void *SDL_LoadObject(const char *sofile)
-{
- void *handle = NULL;
- const char *loaderror = "Unknown error";
-
-#if defined(_WIN32_WCE)
- char errbuf[512];
-
- wchar_t *errbuf_t = SDL_malloc(512 * sizeof(wchar_t));
- wchar_t *sofile_t = SDL_malloc((MAX_PATH+1) * sizeof(wchar_t));
-
- MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, sofile, -1, sofile_t, MAX_PATH);
- handle = (void *)LoadLibrary(sofile_t);
-
- /* Generate an error message if all loads failed */
- if ( handle == NULL ) {
- FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS |
- FORMAT_MESSAGE_FROM_SYSTEM),
- NULL, GetLastError(),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- errbuf_t, SDL_arraysize(errbuf), NULL);
- WideCharToMultiByte(CP_ACP, 0, errbuf_t, -1, errbuf, 511, NULL, NULL);
- loaderror = errbuf;
- }
-
- SDL_free(sofile_t);
- SDL_free(errbuf_t);
-
-#else /*if defined(__WIN32__)*/
- char errbuf[512];
-
- handle = (void *)LoadLibrary(sofile);
-
- /* Generate an error message if all loads failed */
- if ( handle == NULL ) {
- FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS |
- FORMAT_MESSAGE_FROM_SYSTEM),
- NULL, GetLastError(),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- errbuf, SDL_arraysize(errbuf), NULL);
- loaderror = errbuf;
- }
-#endif
-
- if ( handle == NULL ) {
- SDL_SetError("Failed loading %s: %s", sofile, loaderror);
- }
- return(handle);
-}
-
-void *SDL_LoadFunction(void *handle, const char *name)
-{
- void *symbol = NULL;
- const char *loaderror = "Unknown error";
-
-#if defined(_WIN32_WCE)
- char errbuf[512];
- int length = SDL_strlen(name);
-
- wchar_t *name_t = SDL_malloc((length + 1) * sizeof(wchar_t));
- wchar_t *errbuf_t = SDL_malloc(512 * sizeof(wchar_t));
-
- MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, name, -1, name_t, length);
-
- symbol = (void *)GetProcAddress((HMODULE)handle, name_t);
- if ( symbol == NULL ) {
- FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS |
- FORMAT_MESSAGE_FROM_SYSTEM),
- NULL, GetLastError(),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- errbuf_t, SDL_arraysize(errbuf), NULL);
- WideCharToMultiByte(CP_ACP, 0, errbuf_t, -1, errbuf, 511, NULL, NULL);
- loaderror = errbuf;
- }
-
- SDL_free(name_t);
- SDL_free(errbuf_t);
-
-#else /*if defined(WIN32)*/
- char errbuf[512];
-
- symbol = (void *)GetProcAddress((HMODULE)handle, name);
- if ( symbol == NULL ) {
- FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS |
- FORMAT_MESSAGE_FROM_SYSTEM),
- NULL, GetLastError(),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- errbuf, SDL_arraysize(errbuf), NULL);
- loaderror = errbuf;
- }
-#endif
-
- if ( symbol == NULL ) {
- SDL_SetError("Failed loading %s: %s", name, loaderror);
- }
- return(symbol);
-}
-
-void SDL_UnloadObject(void *handle)
-{
- if ( handle != NULL ) {
- FreeLibrary((HMODULE)handle);
- }
-}
-
-#endif /* SDL_LOADSO_WIN32 */
diff --git a/distrib/sdl-1.2.12/src/main/beos/SDL_BeApp.cc b/distrib/sdl-1.2.12/src/main/beos/SDL_BeApp.cc
deleted file mode 100644
index 96268cc..0000000
--- a/distrib/sdl-1.2.12/src/main/beos/SDL_BeApp.cc
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Handle the BeApp specific portions of the application */
-
-#include <AppKit.h>
-#include <storage/Path.h>
-#include <storage/Entry.h>
-#include <unistd.h>
-
-#include "SDL_BeApp.h"
-#include "SDL_thread.h"
-#include "SDL_timer.h"
-#include "SDL_error.h"
-
-/* Flag to tell whether or not the Be application is active or not */
-int SDL_BeAppActive = 0;
-static SDL_Thread *SDL_AppThread = NULL;
-
-static int StartBeApp(void *unused)
-{
- BApplication *App;
-
- App = new BApplication("application/x-SDL-executable");
-
- App->Run();
- delete App;
- return(0);
-}
-
-/* Initialize the Be Application, if it's not already started */
-int SDL_InitBeApp(void)
-{
- /* Create the BApplication that handles appserver interaction */
- if ( SDL_BeAppActive <= 0 ) {
- SDL_AppThread = SDL_CreateThread(StartBeApp, NULL);
- if ( SDL_AppThread == NULL ) {
- SDL_SetError("Couldn't create BApplication thread");
- return(-1);
- }
-
- /* Change working to directory to that of executable */
- app_info info;
- if (B_OK == be_app->GetAppInfo(&info)) {
- entry_ref ref = info.ref;
- BEntry entry;
- if (B_OK == entry.SetTo(&ref)) {
- BPath path;
- if (B_OK == path.SetTo(&entry)) {
- if (B_OK == path.GetParent(&path)) {
- chdir(path.Path());
- }
- }
- }
- }
-
- do {
- SDL_Delay(10);
- } while ( (be_app == NULL) || be_app->IsLaunching() );
-
- /* Mark the application active */
- SDL_BeAppActive = 0;
- }
-
- /* Increment the application reference count */
- ++SDL_BeAppActive;
-
- /* The app is running, and we're ready to go */
- return(0);
-}
-
-/* Quit the Be Application, if there's nothing left to do */
-void SDL_QuitBeApp(void)
-{
- /* Decrement the application reference count */
- --SDL_BeAppActive;
-
- /* If the reference count reached zero, clean up the app */
- if ( SDL_BeAppActive == 0 ) {
- if ( SDL_AppThread != NULL ) {
- if ( be_app != NULL ) { /* Not tested */
- be_app->PostMessage(B_QUIT_REQUESTED);
- }
- SDL_WaitThread(SDL_AppThread, NULL);
- SDL_AppThread = NULL;
- }
- /* be_app should now be NULL since be_app has quit */
- }
-}
diff --git a/distrib/sdl-1.2.12/src/main/beos/SDL_BeApp.h b/distrib/sdl-1.2.12/src/main/beos/SDL_BeApp.h
deleted file mode 100644
index f55dc1d..0000000
--- a/distrib/sdl-1.2.12/src/main/beos/SDL_BeApp.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Handle the BeApp specific portions of the application */
-
-/* Initialize the Be Application, if it's not already started */
-extern int SDL_InitBeApp(void);
-
-/* Quit the Be Application, if there's nothing left to do */
-extern void SDL_QuitBeApp(void);
-
-/* Flag to tell whether the app is active or not */
-extern int SDL_BeAppActive;
diff --git a/distrib/sdl-1.2.12/src/main/epoc/SDL_main.cpp b/distrib/sdl-1.2.12/src/main/epoc/SDL_main.cpp
deleted file mode 100644
index 0139c70..0000000
--- a/distrib/sdl-1.2.12/src/main/epoc/SDL_main.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/*
- SDL_main.cpp
- The Epoc executable startup functions
-
- Epoc version by Hannu Viitala (hannu.j.viitala@mbnet.fi)
-*/
-
-#include <e32std.h>
-#include <e32def.h>
-#include <e32svr.h>
-#include <e32base.h>
-#include <estlib.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <w32std.h>
-#include <apgtask.h>
-
-#include "SDL_error.h"
-
-#ifndef EXPORT_C
-# ifdef __VC32__
-# define IMPORT_C __declspec(dllexport)
-# define EXPORT_C __declspec(dllexport)
-# endif
-# ifdef __GCC32__
-# define IMPORT_C
-# define EXPORT_C __declspec(dllexport)
-# endif
-#endif
-
-#if defined(__WINS__)
-#include <estw32.h>
-IMPORT_C void RegisterWsExe(const TDesC &aName);
-#endif
-
-/* The prototype for the application's main() function */
-#define main SDL_main
-extern "C" int main (int argc, char *argv[], char *envp[]);
-extern "C" void exit (int ret);
-
-
-/* Epoc main function */
-
-GLDEF_C TInt E32Main()
- {
- /* Get the clean-up stack */
- CTrapCleanup* cleanup = CTrapCleanup::New();
-
- #if defined(__WINS__)
- /* arrange for access to Win32 stdin/stdout/stderr */
- RWin32Stream::StartServer();
- #endif
-
- /* Arrange for multi-threaded operation */
- SpawnPosixServerThread();
-
- /* Get args and environment */
- int argc=0;
- char** argv=0;
- char** envp=0;
- __crt0(argc,argv,envp);
-
- #if defined(__WINS__)
- /* Cause the graphical Window Server to come into existence */
- RSemaphore sem;
- sem.CreateGlobal(_L("WsExeSem"),0);
- RegisterWsExe(sem.FullName());
- #endif
-
-
- /* Start the application! */
-
- /* Create stdlib */
- _REENT;
-
- /* Set process and thread priority */
- RThread currentThread;
-
- currentThread.Rename(_L("SdlProgram"));
- currentThread.SetProcessPriority(EPriorityLow);
- currentThread.SetPriority(EPriorityMuchLess);
-
- /* Call stdlib main */
- int ret = main(argc, argv, envp); /* !! process exits here if there is "exit()" in main! */
-
- /* Call exit */
- exit(ret); /* !! process exits here! */
-
- /* Free resources and return */
- CloseSTDLIB();
- delete cleanup;
- return(KErrNone);
- }
-
-/* Epoc dll entry point */
-#if defined(__WINS__)
-GLDEF_C TInt E32Dll(TDllReason)
- {
- return(KErrNone);
- }
-
-EXPORT_C TInt WinsMain(TAny *)
- {
- E32Main();
- return KErrNone;
- }
-#endif
diff --git a/distrib/sdl-1.2.12/src/main/macos/SDL.r b/distrib/sdl-1.2.12/src/main/macos/SDL.r
deleted file mode 100644
index 104507a..0000000
--- a/distrib/sdl-1.2.12/src/main/macos/SDL.r
+++ /dev/null
@@ -1,58 +0,0 @@
-data 'DLOG' (1000) {
- $"0072 0040 00EA 01B3 0001 0100 0000 0000 0000 03E8 0C43 6F6D 6D61 6E64 204C 696E" /* .r.@.ê.³...........è.Command Lin */
- $"6500 280A" /* e.(Â */
-};
-
-data 'DLOG' (1001) {
- $"0072 0040 00DB 01AC 0001 0100 0000 0000 0000 03E9 0C45 7272 6F72 2057 696E 646F" /* .r.@.Û.¬...........é.Error Windo */
- $"7700 280A" /* w.(Â */
-};
-
-data 'DLOG' (1002) {
- $"00B8 00BE 0147 01D8 0005 0100 0000 0000 0000 03EA 1643 6F6E 6669 726D 2044 6973" /* .¸.¾.G.Ø...........ê.Confirm Dis */
- $"706C 6179 2043 6861 6E67 6510 280A" /* play Change.(Â */
-};
-
-data 'DITL' (1000) {
- $"0005 0000 0000 0052 0113 0066 0158 0402 4F4B 0000 0000 0052 00C2 0066 0107 0406" /* .......R...f.X..OK.....R.Â.f.... */
- $"4361 6E63 656C 0000 0000 000F 0084 001F 0155 1000 0000 0000 0054 0019 0066 007D" /* Cancel.......„...U.......T...f.} */
- $"050E 4F75 7470 7574 2074 6F20 6669 6C65 0000 0000 000F 0018 001F 007F 080D 436F" /* ..Output to file..............Co */
- $"6D6D 616E 6420 4C69 6E65 3A00 0000 0000 0030 0018 0040 0158 0702 0080" /* mmand Line:......0...@.X...€ */
-};
-
-data 'DITL' (1001) {
- $"0001 0000 0000 0046 0120 005A 015A 0402 4F4B 0000 0000 0010 000A 0038 0160 0800" /* .......F. .Z.Z..OK.......Â.8.`.. */
-};
-
-data 'DITL' (1002) {
- $"0002 0000 0000 006F 001E 0083 0058 0406 4361 6E63 656C 0000 0000 006E 00C0 0082" /* .......o...ƒ.X..Cancel.....n.À.‚ */
- $"00FA 0402 4F4B 0000 0000 000E 000F 005F 010C 88B3 5468 6520 7365 7474 696E 6720" /* .ú..OK........._..ˆ³The setting */
- $"666F 7220 796F 7572 206D 6F6E 6974 6F72 2068 6173 2062 6565 6E20 6368 616E 6765" /* for your monitor has been change */
- $"642C 2061 6E64 2069 7420 6D61 7920 6E6F 7420 6265 2064 6973 706C 6179 6564 2063" /* d, and it may not be displayed c */
- $"6F72 7265 6374 6C79 2E20 546F 2063 6F6E 6669 726D 2074 6865 2064 6973 706C 6179" /* orrectly. To confirm the display */
- $"2069 7320 636F 7272 6563 742C 2063 6C69 636B 204F 4B2E 2054 6F20 7265 7475 726E" /* is correct, click OK. To return */
- $"2074 6F20 7468 6520 6F72 6967 696E 616C 2073 6574 7469 6E67 2C20 636C 6963 6B20" /* to the original setting, click */
- $"4361 6E63 656C 2E00" /* Cancel.. */
-};
-
-data 'MENU' (128, preload) {
- $"0080 0000 0000 0000 0000 FFFF FFFB 0114 0C41 626F 7574 2053 444C 2E2E 2E00 0000" /* .€........ÿÿÿû...About SDL...... */
- $"0001 2D00 0000 0000" /* ..-..... */
-};
-
-data 'MENU' (129) {
- $"0081 0000 0000 0000 0000 FFFF FFFF 0C56 6964 656F 2044 7269 7665 7219 4472 6177" /* .........ÿÿÿÿ.Video Driver.Draw */
- $"5370 726F 636B 6574 2028 4675 6C6C 7363 7265 656E 2900 0000 001E 546F 6F6C 426F" /* Sprocket (Fullscreen).....ToolBo */
- $"7820 2028 4675 6C6C 7363 7265 656E 2F57 696E 646F 7765 6429 0000 0000 00" /* x (Fullscreen/Windowed)..... */
-};
-
-data 'CNTL' (128) {
- $"0000 0000 0010 0140 0000 0100 0064 0081 03F0 0000 0000 0D56 6964 656F 2044 7269" /* .......@.....d..ð.....Video Dri */
- $"7665 723A" /* ver: */
-};
-
-data 'TMPL' (128, "CLne") {
- $"0C43 6F6D 6D61 6E64 204C 696E 6550 5354 520C 5669 6465 6F20 4472 6976 6572 5053" /* .Command LinePSTR.Video DriverPS */
- $"5452 0C53 6176 6520 546F 2046 696C 6542 4F4F 4C" /* TR.Save To FileBOOL */
-};
-
diff --git a/distrib/sdl-1.2.12/src/main/macos/SDL_main.c b/distrib/sdl-1.2.12/src/main/macos/SDL_main.c
deleted file mode 100644
index 348638b..0000000
--- a/distrib/sdl-1.2.12/src/main/macos/SDL_main.c
+++ /dev/null
@@ -1,610 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* This file takes care of command line argument parsing, and stdio redirection
- in the MacOS environment. (stdio/stderr is *not* directed for Mach-O builds)
- */
-
-#if defined(__APPLE__) && defined(__MACH__)
-#include <Carbon/Carbon.h>
-#elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335)
-#include <Carbon.h>
-#else
-#include <Dialogs.h>
-#include <Fonts.h>
-#include <Events.h>
-#include <Resources.h>
-#include <Folders.h>
-#endif
-
-/* Include the SDL main definition header */
-#include "SDL.h"
-#include "SDL_main.h"
-#ifdef main
-#undef main
-#endif
-
-#if !(defined(__APPLE__) && defined(__MACH__))
-/* The standard output files */
-#define STDOUT_FILE "stdout.txt"
-#define STDERR_FILE "stderr.txt"
-#endif
-
-#if !defined(__MWERKS__) && !TARGET_API_MAC_CARBON
- /* In MPW, the qd global has been removed from the libraries */
- QDGlobals qd;
-#endif
-
-/* Structure for keeping prefs in 1 variable */
-typedef struct {
- Str255 command_line;
- Str255 video_driver_name;
- Boolean output_to_file;
-} PrefsRecord;
-
-/* See if the command key is held down at startup */
-static Boolean CommandKeyIsDown(void)
-{
- KeyMap theKeyMap;
-
- GetKeys(theKeyMap);
-
- if (((unsigned char *) theKeyMap)[6] & 0x80) {
- return(true);
- }
- return(false);
-}
-
-#if !(defined(__APPLE__) && defined(__MACH__))
-
-/* Parse a command line buffer into arguments */
-static int ParseCommandLine(char *cmdline, char **argv)
-{
- char *bufp;
- int argc;
-
- argc = 0;
- for ( bufp = cmdline; *bufp; ) {
- /* Skip leading whitespace */
- while ( SDL_isspace(*bufp) ) {
- ++bufp;
- }
- /* Skip over argument */
- if ( *bufp == '"' ) {
- ++bufp;
- if ( *bufp ) {
- if ( argv ) {
- argv[argc] = bufp;
- }
- ++argc;
- }
- /* Skip over word */
- while ( *bufp && (*bufp != '"') ) {
- ++bufp;
- }
- } else {
- if ( *bufp ) {
- if ( argv ) {
- argv[argc] = bufp;
- }
- ++argc;
- }
- /* Skip over word */
- while ( *bufp && ! SDL_isspace(*bufp) ) {
- ++bufp;
- }
- }
- if ( *bufp ) {
- if ( argv ) {
- *bufp = '\0';
- }
- ++bufp;
- }
- }
- if ( argv ) {
- argv[argc] = NULL;
- }
- return(argc);
-}
-
-/* Remove the output files if there was no output written */
-static void cleanup_output(void)
-{
- FILE *file;
- int empty;
-
- /* Flush the output in case anything is queued */
- fclose(stdout);
- fclose(stderr);
-
- /* See if the files have any output in them */
- file = fopen(STDOUT_FILE, "rb");
- if ( file ) {
- empty = (fgetc(file) == EOF) ? 1 : 0;
- fclose(file);
- if ( empty ) {
- remove(STDOUT_FILE);
- }
- }
- file = fopen(STDERR_FILE, "rb");
- if ( file ) {
- empty = (fgetc(file) == EOF) ? 1 : 0;
- fclose(file);
- if ( empty ) {
- remove(STDERR_FILE);
- }
- }
-}
-
-#endif //!(defined(__APPLE__) && defined(__MACH__))
-
-static int getCurrentAppName (StrFileName name) {
-
- ProcessSerialNumber process;
- ProcessInfoRec process_info;
- FSSpec process_fsp;
-
- process.highLongOfPSN = 0;
- process.lowLongOfPSN = kCurrentProcess;
- process_info.processInfoLength = sizeof (process_info);
- process_info.processName = NULL;
- process_info.processAppSpec = &process_fsp;
-
- if ( noErr != GetProcessInformation (&process, &process_info) )
- return 0;
-
- SDL_memcpy(name, process_fsp.name, process_fsp.name[0] + 1);
- return 1;
-}
-
-static int getPrefsFile (FSSpec *prefs_fsp, int create) {
-
- /* The prefs file name is the application name, possibly truncated, */
- /* plus " Preferences */
-
- #define SUFFIX " Preferences"
- #define MAX_NAME 19 /* 31 - strlen (SUFFIX) */
-
- short volume_ref_number;
- long directory_id;
- StrFileName prefs_name;
- StrFileName app_name;
-
- /* Get Preferences folder - works with Multiple Users */
- if ( noErr != FindFolder ( kOnSystemDisk, kPreferencesFolderType, kDontCreateFolder,
- &volume_ref_number, &directory_id) )
- exit (-1);
-
- if ( ! getCurrentAppName (app_name) )
- exit (-1);
-
- /* Truncate if name is too long */
- if (app_name[0] > MAX_NAME )
- app_name[0] = MAX_NAME;
-
- SDL_memcpy(prefs_name + 1, app_name + 1, app_name[0]);
- SDL_memcpy(prefs_name + app_name[0] + 1, SUFFIX, strlen (SUFFIX));
- prefs_name[0] = app_name[0] + strlen (SUFFIX);
-
- /* Make the file spec for prefs file */
- if ( noErr != FSMakeFSSpec (volume_ref_number, directory_id, prefs_name, prefs_fsp) ) {
- if ( !create )
- return 0;
- else {
- /* Create the prefs file */
- SDL_memcpy(prefs_fsp->name, prefs_name, prefs_name[0] + 1);
- prefs_fsp->parID = directory_id;
- prefs_fsp->vRefNum = volume_ref_number;
-
- FSpCreateResFile (prefs_fsp, 0x3f3f3f3f, 'pref', 0); // '????' parsed as trigraph
-
- if ( noErr != ResError () )
- return 0;
- }
- }
- return 1;
-}
-
-static int readPrefsResource (PrefsRecord *prefs) {
-
- Handle prefs_handle;
-
- prefs_handle = Get1Resource( 'CLne', 128 );
-
- if (prefs_handle != NULL) {
- int offset = 0;
-// int j = 0;
-
- HLock(prefs_handle);
-
- /* Get command line string */
- SDL_memcpy(prefs->command_line, *prefs_handle, (*prefs_handle)[0]+1);
-
- /* Get video driver name */
- offset += (*prefs_handle)[0] + 1;
- SDL_memcpy(prefs->video_driver_name, *prefs_handle + offset, (*prefs_handle)[offset] + 1);
-
- /* Get save-to-file option (1 or 0) */
- offset += (*prefs_handle)[offset] + 1;
- prefs->output_to_file = (*prefs_handle)[offset];
-
- ReleaseResource( prefs_handle );
-
- return ResError() == noErr;
- }
-
- return 0;
-}
-
-static int writePrefsResource (PrefsRecord *prefs, short resource_file) {
-
- Handle prefs_handle;
-
- UseResFile (resource_file);
-
- prefs_handle = Get1Resource ( 'CLne', 128 );
- if (prefs_handle != NULL)
- RemoveResource (prefs_handle);
-
- prefs_handle = NewHandle ( prefs->command_line[0] + prefs->video_driver_name[0] + 4 );
- if (prefs_handle != NULL) {
-
- int offset;
-
- HLock (prefs_handle);
-
- /* Command line text */
- offset = 0;
- SDL_memcpy(*prefs_handle, prefs->command_line, prefs->command_line[0] + 1);
-
- /* Video driver name */
- offset += prefs->command_line[0] + 1;
- SDL_memcpy(*prefs_handle + offset, prefs->video_driver_name, prefs->video_driver_name[0] + 1);
-
- /* Output-to-file option */
- offset += prefs->video_driver_name[0] + 1;
- *( *((char**)prefs_handle) + offset) = (char)prefs->output_to_file;
- *( *((char**)prefs_handle) + offset + 1) = 0;
-
- AddResource (prefs_handle, 'CLne', 128, "\pCommand Line");
- WriteResource (prefs_handle);
- UpdateResFile (resource_file);
- DisposeHandle (prefs_handle);
-
- return ResError() == noErr;
- }
-
- return 0;
-}
-
-static int readPreferences (PrefsRecord *prefs) {
-
- int no_error = 1;
- FSSpec prefs_fsp;
-
- /* Check for prefs file first */
- if ( getPrefsFile (&prefs_fsp, 0) ) {
-
- short prefs_resource;
-
- prefs_resource = FSpOpenResFile (&prefs_fsp, fsRdPerm);
- if ( prefs_resource == -1 ) /* this shouldn't happen, but... */
- return 0;
-
- UseResFile (prefs_resource);
- no_error = readPrefsResource (prefs);
- CloseResFile (prefs_resource);
- }
-
- /* Fall back to application's resource fork (reading only, so this is safe) */
- else {
-
- no_error = readPrefsResource (prefs);
- }
-
- return no_error;
-}
-
-static int writePreferences (PrefsRecord *prefs) {
-
- int no_error = 1;
- FSSpec prefs_fsp;
-
- /* Get prefs file, create if it doesn't exist */
- if ( getPrefsFile (&prefs_fsp, 1) ) {
-
- short prefs_resource;
-
- prefs_resource = FSpOpenResFile (&prefs_fsp, fsRdWrPerm);
- if (prefs_resource == -1)
- return 0;
- no_error = writePrefsResource (prefs, prefs_resource);
- CloseResFile (prefs_resource);
- }
-
- return no_error;
-}
-
-/* This is where execution begins */
-int main(int argc, char *argv[])
-{
-
-#if !(defined(__APPLE__) && defined(__MACH__))
-#pragma unused(argc, argv)
-#endif
-
-#define DEFAULT_ARGS "\p" /* pascal string for default args */
-#define DEFAULT_VIDEO_DRIVER "\ptoolbox" /* pascal string for default video driver name */
-#define DEFAULT_OUTPUT_TO_FILE 1 /* 1 == output to file, 0 == no output */
-
-#define VIDEO_ID_DRAWSPROCKET 1 /* these correspond to popup menu choices */
-#define VIDEO_ID_TOOLBOX 2
-
- PrefsRecord prefs = { DEFAULT_ARGS, DEFAULT_VIDEO_DRIVER, DEFAULT_OUTPUT_TO_FILE };
-
-#if !(defined(__APPLE__) && defined(__MACH__))
- int nargs;
- char **args;
- char *commandLine;
-
- StrFileName appNameText;
-#endif
- int videodriver = VIDEO_ID_TOOLBOX;
- int settingsChanged = 0;
-
- long i;
-
- /* Kyle's SDL command-line dialog code ... */
-#if !TARGET_API_MAC_CARBON
- InitGraf (&qd.thePort);
- InitFonts ();
- InitWindows ();
- InitMenus ();
- InitDialogs (nil);
-#endif
- InitCursor ();
- FlushEvents(everyEvent,0);
-#if !TARGET_API_MAC_CARBON
- MaxApplZone ();
-#endif
- MoreMasters ();
- MoreMasters ();
-#if 0
- /* Intialize SDL, and put up a dialog if we fail */
- if ( SDL_Init (0) < 0 ) {
-
-#define kErr_OK 1
-#define kErr_Text 2
-
- DialogPtr errorDialog;
- short dummyType;
- Rect dummyRect;
- Handle dummyHandle;
- short itemHit;
-
- errorDialog = GetNewDialog (1001, nil, (WindowPtr)-1);
- if (errorDialog == NULL)
- return -1;
- DrawDialog (errorDialog);
-
- GetDialogItem (errorDialog, kErr_Text, &dummyType, &dummyHandle, &dummyRect);
- SetDialogItemText (dummyHandle, "\pError Initializing SDL");
-
-#if TARGET_API_MAC_CARBON
- SetPort (GetDialogPort(errorDialog));
-#else
- SetPort (errorDialog);
-#endif
- do {
- ModalDialog (nil, &itemHit);
- } while (itemHit != kErr_OK);
-
- DisposeDialog (errorDialog);
- exit (-1);
- }
- atexit(cleanup_output);
- atexit(SDL_Quit);
-#endif
-
-/* Set up SDL's QuickDraw environment */
-#if !TARGET_API_MAC_CARBON
- SDL_InitQuickDraw(&qd);
-#endif
-
- if ( readPreferences (&prefs) ) {
-
- if (SDL_memcmp(prefs.video_driver_name+1, "DSp", 3) == 0)
- videodriver = 1;
- else if (SDL_memcmp(prefs.video_driver_name+1, "toolbox", 7) == 0)
- videodriver = 2;
- }
-
- if ( CommandKeyIsDown() ) {
-
-#define kCL_OK 1
-#define kCL_Cancel 2
-#define kCL_Text 3
-#define kCL_File 4
-#define kCL_Video 6
-
- DialogPtr commandDialog;
- short dummyType;
- Rect dummyRect;
- Handle dummyHandle;
- short itemHit;
- #if TARGET_API_MAC_CARBON
- ControlRef control;
- #endif
-
- /* Assume that they will change settings, rather than do exhaustive check */
- settingsChanged = 1;
-
- /* Create dialog and display it */
- commandDialog = GetNewDialog (1000, nil, (WindowPtr)-1);
- #if TARGET_API_MAC_CARBON
- SetPort ( GetDialogPort(commandDialog) );
- #else
- SetPort (commandDialog);
- #endif
-
- /* Setup controls */
- #if TARGET_API_MAC_CARBON
- GetDialogItemAsControl(commandDialog, kCL_File, &control);
- SetControlValue (control, prefs.output_to_file);
- #else
- GetDialogItem (commandDialog, kCL_File, &dummyType, &dummyHandle, &dummyRect); /* MJS */
- SetControlValue ((ControlHandle)dummyHandle, prefs.output_to_file );
- #endif
-
- GetDialogItem (commandDialog, kCL_Text, &dummyType, &dummyHandle, &dummyRect);
- SetDialogItemText (dummyHandle, prefs.command_line);
-
- #if TARGET_API_MAC_CARBON
- GetDialogItemAsControl(commandDialog, kCL_Video, &control);
- SetControlValue (control, videodriver);
- #else
- GetDialogItem (commandDialog, kCL_Video, &dummyType, &dummyHandle, &dummyRect);
- SetControlValue ((ControlRef)dummyHandle, videodriver);
- #endif
-
- SetDialogDefaultItem (commandDialog, kCL_OK);
- SetDialogCancelItem (commandDialog, kCL_Cancel);
-
- do {
-
- ModalDialog(nil, &itemHit); /* wait for user response */
-
- /* Toggle command-line output checkbox */
- if ( itemHit == kCL_File ) {
- #if TARGET_API_MAC_CARBON
- GetDialogItemAsControl(commandDialog, kCL_File, &control);
- SetControlValue (control, !GetControlValue(control));
- #else
- GetDialogItem(commandDialog, kCL_File, &dummyType, &dummyHandle, &dummyRect); /* MJS */
- SetControlValue((ControlHandle)dummyHandle, !GetControlValue((ControlHandle)dummyHandle) );
- #endif
- }
-
- } while (itemHit != kCL_OK && itemHit != kCL_Cancel);
-
- /* Get control values, even if they did not change */
- GetDialogItem (commandDialog, kCL_Text, &dummyType, &dummyHandle, &dummyRect); /* MJS */
- GetDialogItemText (dummyHandle, prefs.command_line);
-
- #if TARGET_API_MAC_CARBON
- GetDialogItemAsControl(commandDialog, kCL_File, &control);
- prefs.output_to_file = GetControlValue(control);
- #else
- GetDialogItem (commandDialog, kCL_File, &dummyType, &dummyHandle, &dummyRect); /* MJS */
- prefs.output_to_file = GetControlValue ((ControlHandle)dummyHandle);
- #endif
-
- #if TARGET_API_MAC_CARBON
- GetDialogItemAsControl(commandDialog, kCL_Video, &control);
- videodriver = GetControlValue(control);
- #else
- GetDialogItem (commandDialog, kCL_Video, &dummyType, &dummyHandle, &dummyRect);
- videodriver = GetControlValue ((ControlRef)dummyHandle);
- #endif
-
- DisposeDialog (commandDialog);
-
- if (itemHit == kCL_Cancel ) {
- exit (0);
- }
- }
-
- /* Set pseudo-environment variables for video driver, update prefs */
- switch ( videodriver ) {
- case VIDEO_ID_DRAWSPROCKET:
- SDL_putenv("SDL_VIDEODRIVER=DSp");
- SDL_memcpy(prefs.video_driver_name, "\pDSp", 4);
- break;
- case VIDEO_ID_TOOLBOX:
- SDL_putenv("SDL_VIDEODRIVER=toolbox");
- SDL_memcpy(prefs.video_driver_name, "\ptoolbox", 8);
- break;
- }
-
-#if !(defined(__APPLE__) && defined(__MACH__))
- /* Redirect standard I/O to files */
- if ( prefs.output_to_file ) {
- freopen (STDOUT_FILE, "w", stdout);
- freopen (STDERR_FILE, "w", stderr);
- } else {
- fclose (stdout);
- fclose (stderr);
- }
-#endif
-
- if (settingsChanged) {
- /* Save the prefs, even if they might not have changed (but probably did) */
- if ( ! writePreferences (&prefs) )
- fprintf (stderr, "WARNING: Could not save preferences!\n");
- }
-
-#if !(defined(__APPLE__) && defined(__MACH__))
- appNameText[0] = 0;
- getCurrentAppName (appNameText); /* check for error here ? */
-
- commandLine = (char*) malloc (appNameText[0] + prefs.command_line[0] + 2);
- if ( commandLine == NULL ) {
- exit(-1);
- }
-
- /* Rather than rewrite ParseCommandLine method, let's replace */
- /* any spaces in application name with underscores, */
- /* so that the app name is only 1 argument */
- for (i = 1; i < 1+appNameText[0]; i++)
- if ( appNameText[i] == ' ' ) appNameText[i] = '_';
-
- /* Copy app name & full command text to command-line C-string */
- SDL_memcpy(commandLine, appNameText + 1, appNameText[0]);
- commandLine[appNameText[0]] = ' ';
- SDL_memcpy(commandLine + appNameText[0] + 1, prefs.command_line + 1, prefs.command_line[0]);
- commandLine[ appNameText[0] + 1 + prefs.command_line[0] ] = '\0';
-
- /* Parse C-string into argv and argc */
- nargs = ParseCommandLine (commandLine, NULL);
- args = (char **)malloc((nargs+1)*(sizeof *args));
- if ( args == NULL ) {
- exit(-1);
- }
- ParseCommandLine (commandLine, args);
-
- /* Run the main application code */
- SDL_main(nargs, args);
- free (args);
- free (commandLine);
-
- /* Remove useless stdout.txt and stderr.txt */
- cleanup_output ();
-#else // defined(__APPLE__) && defined(__MACH__)
- SDL_main(argc, argv);
-#endif
-
- /* Exit cleanly, calling atexit() functions */
- exit (0);
-
- /* Never reached, but keeps the compiler quiet */
- return (0);
-}
diff --git a/distrib/sdl-1.2.12/src/main/macos/SIZE.r b/distrib/sdl-1.2.12/src/main/macos/SIZE.r
deleted file mode 100644
index b9cd942..0000000
--- a/distrib/sdl-1.2.12/src/main/macos/SIZE.r
+++ /dev/null
@@ -1,24 +0,0 @@
-
-#include "Processes.r"
-
-resource 'SIZE' (-1) {
- reserved,
- acceptSuspendResumeEvents,
- reserved,
- canBackground,
- doesActivateOnFGSwitch,
- backgroundAndForeground,
- getFrontClicks,
- ignoreAppDiedEvents,
- is32BitCompatible,
- isHighLevelEventAware,
- onlyLocalHLEvents,
- notStationeryAware,
- useTextEditServices,
- reserved,
- reserved,
- reserved,
- 5242880, // 5 megs minimum
- 5242880 // 5 megs maximum
-};
-
diff --git a/distrib/sdl-1.2.12/src/main/macos/exports/Makefile b/distrib/sdl-1.2.12/src/main/macos/exports/Makefile
deleted file mode 100644
index 0fd79fd..0000000
--- a/distrib/sdl-1.2.12/src/main/macos/exports/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-
-EXPORTS = SDL.x
-HEADERS = \
- ../../../../include/SDL.h \
- ../../../../include/SDL_active.h \
- ../../../../include/SDL_audio.h \
- ../../../../include/SDL_cdrom.h \
- ../../../../include/SDL_copying.h \
- ../../../../include/SDL_cpuinfo.h \
- ../../../../include/SDL_endian.h \
- ../../../../include/SDL_error.h \
- ../../../../include/SDL_events.h \
- ../../../../include/SDL_joystick.h \
- ../../../../include/SDL_keyboard.h \
- ../../../../include/SDL_keysym.h \
- ../../../../include/SDL_loadso.h \
- ../../../../include/SDL_mouse.h \
- ../../../../include/SDL_mutex.h \
- ../../../../include/SDL_quit.h \
- ../../../../include/SDL_rwops.h \
- ../../../../include/SDL_syswm.h \
- ../../../../include/SDL_thread.h \
- ../../../../include/SDL_timer.h \
- ../../../../include/SDL_version.h \
- ../../../../include/SDL_video.h
-
-
-all: $(EXPORTS)
-
-$(EXPORTS): Makefile gendef.pl $(HEADERS)
- perl gendef.pl $(HEADERS) >$@ || rm $@
-
-clean:
- rm -f $(EXPORTS)
diff --git a/distrib/sdl-1.2.12/src/main/macos/exports/SDL.x b/distrib/sdl-1.2.12/src/main/macos/exports/SDL.x
deleted file mode 100644
index 44db7a4..0000000
--- a/distrib/sdl-1.2.12/src/main/macos/exports/SDL.x
+++ /dev/null
@@ -1,209 +0,0 @@
- SDL_Init
- SDL_InitSubSystem
- SDL_QuitSubSystem
- SDL_WasInit
- SDL_Quit
- SDL_GetAppState
- SDL_AudioInit
- SDL_AudioQuit
- SDL_AudioDriverName
- SDL_OpenAudio
- SDL_GetAudioStatus
- SDL_PauseAudio
- SDL_LoadWAV_RW
- SDL_FreeWAV
- SDL_BuildAudioCVT
- SDL_ConvertAudio
- SDL_MixAudio
- SDL_LockAudio
- SDL_UnlockAudio
- SDL_CloseAudio
- SDL_CDNumDrives
- SDL_CDName
- SDL_CDOpen
- SDL_CDStatus
- SDL_CDPlayTracks
- SDL_CDPlay
- SDL_CDPause
- SDL_CDResume
- SDL_CDStop
- SDL_CDEject
- SDL_CDClose
- SDL_HasRDTSC
- SDL_HasMMX
- SDL_HasMMXExt
- SDL_Has3DNow
- SDL_Has3DNowExt
- SDL_HasSSE
- SDL_HasSSE2
- SDL_HasAltiVec
- SDL_SetError
- SDL_GetError
- SDL_ClearError
- SDL_Error
- SDL_PumpEvents
- SDL_PeepEvents
- SDL_PollEvent
- SDL_WaitEvent
- SDL_PushEvent
- SDL_SetEventFilter
- SDL_GetEventFilter
- SDL_EventState
- SDL_NumJoysticks
- SDL_JoystickName
- SDL_JoystickOpen
- SDL_JoystickOpened
- SDL_JoystickIndex
- SDL_JoystickNumAxes
- SDL_JoystickNumBalls
- SDL_JoystickNumHats
- SDL_JoystickNumButtons
- SDL_JoystickUpdate
- SDL_JoystickEventState
- SDL_JoystickGetAxis
- SDL_JoystickGetHat
- SDL_JoystickGetBall
- SDL_JoystickGetButton
- SDL_JoystickClose
- SDL_EnableUNICODE
- SDL_EnableKeyRepeat
- SDL_GetKeyRepeat
- SDL_GetKeyState
- SDL_GetModState
- SDL_SetModState
- SDL_GetKeyName
- SDL_LoadObject
- SDL_LoadFunction
- SDL_UnloadObject
- SDL_GetMouseState
- SDL_GetRelativeMouseState
- SDL_WarpMouse
- SDL_CreateCursor
- SDL_SetCursor
- SDL_GetCursor
- SDL_FreeCursor
- SDL_ShowCursor
- SDL_CreateMutex
- SDL_mutexP
- SDL_mutexV
- SDL_DestroyMutex
- SDL_CreateSemaphore
- SDL_DestroySemaphore
- SDL_SemWait
- SDL_SemTryWait
- SDL_SemWaitTimeout
- SDL_SemPost
- SDL_SemValue
- SDL_CreateCond
- SDL_DestroyCond
- SDL_CondSignal
- SDL_CondBroadcast
- SDL_CondWait
- SDL_CondWaitTimeout
- SDL_RWFromFile
- SDL_RWFromFP
- SDL_RWFromMem
- SDL_RWFromConstMem
- SDL_AllocRW
- SDL_FreeRW
- SDL_ReadLE16
- SDL_ReadBE16
- SDL_ReadLE32
- SDL_ReadBE32
- SDL_ReadLE64
- SDL_ReadBE64
- SDL_WriteLE16
- SDL_WriteBE16
- SDL_WriteLE32
- SDL_WriteBE32
- SDL_WriteLE64
- SDL_WriteBE64
- SDL_GetWMInfo
- SDL_CreateThread
- SDL_CreateThread
- SDL_ThreadID
- SDL_GetThreadID
- SDL_WaitThread
- SDL_KillThread
- SDL_GetTicks
- SDL_Delay
- SDL_SetTimer
- SDL_AddTimer
- SDL_RemoveTimer
- SDL_Linked_Version
- SDL_VideoInit
- SDL_VideoQuit
- SDL_VideoDriverName
- SDL_GetVideoSurface
- SDL_GetVideoInfo
- SDL_VideoModeOK
- SDL_ListModes
- SDL_SetVideoMode
- SDL_UpdateRects
- SDL_UpdateRect
- SDL_Flip
- SDL_SetGamma
- SDL_SetGammaRamp
- SDL_GetGammaRamp
- SDL_SetColors
- SDL_SetPalette
- SDL_MapRGB
- SDL_MapRGBA
- SDL_GetRGB
- SDL_GetRGBA
- SDL_CreateRGBSurface
- SDL_CreateRGBSurfaceFrom
- SDL_FreeSurface
- SDL_LockSurface
- SDL_UnlockSurface
- SDL_LoadBMP_RW
- SDL_SaveBMP_RW
- SDL_SetColorKey
- SDL_SetAlpha
- SDL_SetClipRect
- SDL_GetClipRect
- SDL_ConvertSurface
- SDL_UpperBlit
- SDL_LowerBlit
- SDL_FillRect
- SDL_DisplayFormat
- SDL_DisplayFormatAlpha
- SDL_CreateYUVOverlay
- SDL_LockYUVOverlay
- SDL_UnlockYUVOverlay
- SDL_DisplayYUVOverlay
- SDL_FreeYUVOverlay
- SDL_GL_LoadLibrary
- SDL_GL_GetProcAddress
- SDL_GL_SetAttribute
- SDL_GL_GetAttribute
- SDL_GL_SwapBuffers
- SDL_GL_UpdateRects
- SDL_GL_Lock
- SDL_GL_Unlock
- SDL_WM_SetCaption
- SDL_WM_GetCaption
- SDL_WM_SetIcon
- SDL_WM_IconifyWindow
- SDL_WM_ToggleFullScreen
- SDL_WM_GrabInput
- SDL_SoftStretch
- SDL_putenv
- SDL_getenv
- SDL_qsort
- SDL_revcpy
- SDL_strlcpy
- SDL_strlcat
- SDL_strdup
- SDL_strrev
- SDL_strupr
- SDL_strlwr
- SDL_ltoa
- SDL_ultoa
- SDL_strcasecmp
- SDL_strncasecmp
- SDL_snprintf
- SDL_vsnprintf
- SDL_iconv
- SDL_iconv_string
- SDL_InitQuickDraw
diff --git a/distrib/sdl-1.2.12/src/main/macos/exports/gendef.pl b/distrib/sdl-1.2.12/src/main/macos/exports/gendef.pl
deleted file mode 100644
index c27394b..0000000
--- a/distrib/sdl-1.2.12/src/main/macos/exports/gendef.pl
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/perl
-#
-# Program to take a set of header files and generate DLL export definitions
-
-# Special exports to ignore for this platform
-
-while ( ($file = shift(@ARGV)) ) {
- if ( ! defined(open(FILE, $file)) ) {
- warn "Couldn't open $file: $!\n";
- next;
- }
- $printed_header = 0;
- $file =~ s,.*/,,;
- while (<FILE>) {
- if ( / DECLSPEC.* SDLCALL ([^\s\(]+)/ ) {
- if ( not $exclude{$1} ) {
- print "\t$1\n";
- }
- }
- }
- close(FILE);
-}
-
-# Special exports to include for this platform
-print "\tSDL_putenv\n";
-print "\tSDL_getenv\n";
-print "\tSDL_qsort\n";
-print "\tSDL_revcpy\n";
-print "\tSDL_strlcpy\n";
-print "\tSDL_strlcat\n";
-print "\tSDL_strdup\n";
-print "\tSDL_strrev\n";
-print "\tSDL_strupr\n";
-print "\tSDL_strlwr\n";
-print "\tSDL_ltoa\n";
-print "\tSDL_ultoa\n";
-print "\tSDL_strcasecmp\n";
-print "\tSDL_strncasecmp\n";
-print "\tSDL_snprintf\n";
-print "\tSDL_vsnprintf\n";
-print "\tSDL_iconv\n";
-print "\tSDL_iconv_string\n";
-print "\tSDL_InitQuickDraw\n";
diff --git a/distrib/sdl-1.2.12/src/main/macosx/SDLMain.h b/distrib/sdl-1.2.12/src/main/macosx/SDLMain.h
deleted file mode 100644
index 4683df5..0000000
--- a/distrib/sdl-1.2.12/src/main/macosx/SDLMain.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/* SDLMain.m - main entry point for our Cocoa-ized SDL app
- Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
- Non-NIB-Code & other changes: Max Horn <max@quendi.de>
-
- Feel free to customize this file to suit your needs
-*/
-
-#import <Cocoa/Cocoa.h>
-
-@interface SDLMain : NSObject
-@end
diff --git a/distrib/sdl-1.2.12/src/main/macosx/SDLMain.m b/distrib/sdl-1.2.12/src/main/macosx/SDLMain.m
deleted file mode 100644
index 3b89ee8..0000000
--- a/distrib/sdl-1.2.12/src/main/macosx/SDLMain.m
+++ /dev/null
@@ -1,398 +0,0 @@
-/* SDLMain.m - main entry point for our Cocoa-ized SDL app
- Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
- Non-NIB-Code & other changes: Max Horn <max@quendi.de>
-
- Feel free to customize this file to suit your needs
-*/
-
-#import "SDL.h"
-#import "SDLMain.h"
-#import <sys/param.h> /* for MAXPATHLEN */
-#import <unistd.h>
-
-/* For some reaon, Apple removed setAppleMenu from the headers in 10.4,
- but the method still is there and works. To avoid warnings, we declare
- it ourselves here. */
-@interface NSApplication(SDL_Missing_Methods)
-- (void)setAppleMenu:(NSMenu *)menu;
-@end
-
-/* Use this flag to determine whether we use SDLMain.nib or not */
-#define SDL_USE_NIB_FILE 0
-
-/* Use this flag to determine whether we use CPS (docking) or not */
-#define SDL_USE_CPS 1
-#ifdef SDL_USE_CPS
-/* Portions of CPS.h */
-typedef struct CPSProcessSerNum
-{
- UInt32 lo;
- UInt32 hi;
-} CPSProcessSerNum;
-
-extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
-extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
-extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
-
-#endif /* SDL_USE_CPS */
-
-static int gArgc;
-static char **gArgv;
-static BOOL gFinderLaunch;
-static BOOL gCalledAppMainline = FALSE;
-
-static NSString *getApplicationName(void)
-{
- NSDictionary *dict;
- NSString *appName = 0;
-
- /* Determine the application name */
- dict = (NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
- if (dict)
- appName = [dict objectForKey: @"CFBundleName"];
-
- if (![appName length])
- appName = [[NSProcessInfo processInfo] processName];
-
- return appName;
-}
-
-#if SDL_USE_NIB_FILE
-/* A helper category for NSString */
-@interface NSString (ReplaceSubString)
-- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
-@end
-#endif
-
-@interface SDLApplication : NSApplication
-@end
-
-@implementation SDLApplication
-/* Invoked from the Quit menu item */
-- (void)terminate:(id)sender
-{
- /* Post a SDL_QUIT event */
- SDL_Event event;
- event.type = SDL_QUIT;
- SDL_PushEvent(&event);
-}
-@end
-
-/* The main class of the application, the application's delegate */
-@implementation SDLMain
-
-/* Set the working directory to the .app's parent directory */
-- (void) setupWorkingDirectory:(BOOL)shouldChdir
-{
- if (shouldChdir)
- {
- char parentdir[MAXPATHLEN];
- CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
- CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
- if (CFURLGetFileSystemRepresentation(url2, true, (UInt8 *)parentdir, MAXPATHLEN)) {
- assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */
- }
- CFRelease(url);
- CFRelease(url2);
- }
-
-}
-
-#if SDL_USE_NIB_FILE
-
-/* Fix menu to contain the real app name instead of "SDL App" */
-- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
-{
- NSRange aRange;
- NSEnumerator *enumerator;
- NSMenuItem *menuItem;
-
- aRange = [[aMenu title] rangeOfString:@"SDL App"];
- if (aRange.length != 0)
- [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
-
- enumerator = [[aMenu itemArray] objectEnumerator];
- while ((menuItem = [enumerator nextObject]))
- {
- aRange = [[menuItem title] rangeOfString:@"SDL App"];
- if (aRange.length != 0)
- [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
- if ([menuItem hasSubmenu])
- [self fixMenu:[menuItem submenu] withAppName:appName];
- }
- [ aMenu sizeToFit ];
-}
-
-#else
-
-static void setApplicationMenu(void)
-{
- /* warning: this code is very odd */
- NSMenu *appleMenu;
- NSMenuItem *menuItem;
- NSString *title;
- NSString *appName;
-
- appName = getApplicationName();
- appleMenu = [[NSMenu alloc] initWithTitle:@""];
-
- /* Add menu items */
- title = [@"About " stringByAppendingString:appName];
- [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
-
- [appleMenu addItem:[NSMenuItem separatorItem]];
-
- title = [@"Hide " stringByAppendingString:appName];
- [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
-
- menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
- [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
-
- [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
-
- [appleMenu addItem:[NSMenuItem separatorItem]];
-
- title = [@"Quit " stringByAppendingString:appName];
- [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
-
-
- /* Put menu into the menubar */
- menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
- [menuItem setSubmenu:appleMenu];
- [[NSApp mainMenu] addItem:menuItem];
-
- /* Tell the application object that this is now the application menu */
- [NSApp setAppleMenu:appleMenu];
-
- /* Finally give up our references to the objects */
- [appleMenu release];
- [menuItem release];
-}
-
-/* Create a window menu */
-static void setupWindowMenu(void)
-{
- NSMenu *windowMenu;
- NSMenuItem *windowMenuItem;
- NSMenuItem *menuItem;
-
- windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
-
- /* "Minimize" item */
- menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
- [windowMenu addItem:menuItem];
- [menuItem release];
-
- /* Put menu into the menubar */
- windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
- [windowMenuItem setSubmenu:windowMenu];
- [[NSApp mainMenu] addItem:windowMenuItem];
-
- /* Tell the application object that this is now the window menu */
- [NSApp setWindowsMenu:windowMenu];
-
- /* Finally give up our references to the objects */
- [windowMenu release];
- [windowMenuItem release];
-}
-
-/* Replacement for NSApplicationMain */
-static void CustomApplicationMain (int argc, char **argv)
-{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- SDLMain *sdlMain;
-
- /* Ensure the application object is initialised */
- [SDLApplication sharedApplication];
-
-#ifdef SDL_USE_CPS
- {
- CPSProcessSerNum PSN;
- /* Tell the dock about us */
- if (!CPSGetCurrentProcess(&PSN))
- if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
- if (!CPSSetFrontProcess(&PSN))
- [SDLApplication sharedApplication];
- }
-#endif /* SDL_USE_CPS */
-
- /* Set up the menubar */
- [NSApp setMainMenu:[[NSMenu alloc] init]];
- setApplicationMenu();
- setupWindowMenu();
-
- /* Create SDLMain and make it the app delegate */
- sdlMain = [[SDLMain alloc] init];
- [NSApp setDelegate:sdlMain];
-
- /* Start the main event loop */
- [NSApp run];
-
- [sdlMain release];
- [pool release];
-}
-
-#endif
-
-
-/*
- * Catch document open requests...this lets us notice files when the app
- * was launched by double-clicking a document, or when a document was
- * dragged/dropped on the app's icon. You need to have a
- * CFBundleDocumentsType section in your Info.plist to get this message,
- * apparently.
- *
- * Files are added to gArgv, so to the app, they'll look like command line
- * arguments. Previously, apps launched from the finder had nothing but
- * an argv[0].
- *
- * This message may be received multiple times to open several docs on launch.
- *
- * This message is ignored once the app's mainline has been called.
- */
-- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
-{
- const char *temparg;
- size_t arglen;
- char *arg;
- char **newargv;
-
- if (!gFinderLaunch) /* MacOS is passing command line args. */
- return FALSE;
-
- if (gCalledAppMainline) /* app has started, ignore this document. */
- return FALSE;
-
- temparg = [filename UTF8String];
- arglen = SDL_strlen(temparg) + 1;
- arg = (char *) SDL_malloc(arglen);
- if (arg == NULL)
- return FALSE;
-
- newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
- if (newargv == NULL)
- {
- SDL_free(arg);
- return FALSE;
- }
- gArgv = newargv;
-
- SDL_strlcpy(arg, temparg, arglen);
- gArgv[gArgc++] = arg;
- gArgv[gArgc] = NULL;
- return TRUE;
-}
-
-
-/* Called when the internal event loop has just started running */
-- (void) applicationDidFinishLaunching: (NSNotification *) note
-{
- int status;
-
- /* Set the working directory to the .app's parent directory */
- [self setupWorkingDirectory:gFinderLaunch];
-
-#if SDL_USE_NIB_FILE
- /* Set the main menu to contain the real app name instead of "SDL App" */
- [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
-#endif
-
- /* Hand off to main application code */
- gCalledAppMainline = TRUE;
- status = SDL_main (gArgc, gArgv);
-
- /* We're done, thank you for playing */
- exit(status);
-}
-@end
-
-
-@implementation NSString (ReplaceSubString)
-
-- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
-{
- unsigned int bufferSize;
- unsigned int selfLen = [self length];
- unsigned int aStringLen = [aString length];
- unichar *buffer;
- NSRange localRange;
- NSString *result;
-
- bufferSize = selfLen + aStringLen - aRange.length;
- buffer = NSAllocateMemoryPages(bufferSize*sizeof(unichar));
-
- /* Get first part into buffer */
- localRange.location = 0;
- localRange.length = aRange.location;
- [self getCharacters:buffer range:localRange];
-
- /* Get middle part into buffer */
- localRange.location = 0;
- localRange.length = aStringLen;
- [aString getCharacters:(buffer+aRange.location) range:localRange];
-
- /* Get last part into buffer */
- localRange.location = aRange.location + aRange.length;
- localRange.length = selfLen - localRange.location;
- [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];
-
- /* Build output string */
- result = [NSString stringWithCharacters:buffer length:bufferSize];
-
- NSDeallocateMemoryPages(buffer, bufferSize);
-
- return result;
-}
-
-@end
-
-
-
-#ifdef main
-# undef main
-#endif
-
-
-/* Main entry point to executable - should *not* be SDL_main! */
-int main (int argc, char **argv)
-{
- /* Copy the arguments into a global variable */
- /* This is passed if we are launched by double-clicking */
- if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
- gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
- gArgv[0] = argv[0];
- gArgv[1] = NULL;
- gArgc = 1;
- gFinderLaunch = YES;
- } else {
- int i;
- gArgc = argc;
- gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
- for (i = 0; i <= argc; i++)
- gArgv[i] = argv[i];
- gFinderLaunch = NO;
- }
-
-/* ANDROID_BEGIN */
- /* if -no-window is used, we don't want to launch a graphical
- * application that creates a Menu bar and steals the focus.
- */
- {
- int nn;
- for (nn = 0; nn < argc; nn++) {
- if ( !strcmp( argv[nn], "-no-window" ) ) {
- return SDL_main (argc, argv);
- }
- }
- }
-/* ANDROID_END */
-
-#if SDL_USE_NIB_FILE
- [SDLApplication poseAsClass:[NSApplication class]];
- NSApplicationMain (argc, argv);
-#else
- CustomApplicationMain (argc, argv);
-#endif
- return 0;
-}
-
diff --git a/distrib/sdl-1.2.12/src/main/win32/SDL_win32_main.c b/distrib/sdl-1.2.12/src/main/win32/SDL_win32_main.c
deleted file mode 100644
index ae0be45..0000000
--- a/distrib/sdl-1.2.12/src/main/win32/SDL_win32_main.c
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- SDL_main.c, placed in the public domain by Sam Lantinga 4/13/98
-
- The WinMain function -- calls your program's main() function
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-#ifdef _WIN32_WCE
-# define DIR_SEPERATOR TEXT("\\")
-# undef _getcwd
-# define _getcwd(str,len) wcscpy(str,TEXT(""))
-# define setbuf(f,b)
-# define setvbuf(w,x,y,z)
-# define fopen _wfopen
-# define freopen _wfreopen
-# define remove(x) DeleteFile(x)
-#else
-# define DIR_SEPERATOR TEXT("/")
-# include <direct.h>
-#endif
-
-/* Include the SDL main definition header */
-#include "SDL.h"
-#include "SDL_main.h"
-
-#ifdef main
-# ifndef _WIN32_WCE_EMULATION
-# undef main
-# endif /* _WIN32_WCE_EMULATION */
-#endif /* main */
-
-/* The standard output files */
-#define STDOUT_FILE TEXT("stdout.txt")
-#define STDERR_FILE TEXT("stderr.txt")
-
-#ifndef NO_STDIO_REDIRECT
-# ifdef _WIN32_WCE
- static wchar_t stdoutPath[MAX_PATH];
- static wchar_t stderrPath[MAX_PATH];
-# else
- static char stdoutPath[MAX_PATH];
- static char stderrPath[MAX_PATH];
-# endif
-#endif
-
-#if defined(_WIN32_WCE) && _WIN32_WCE < 300
-/* seems to be undefined in Win CE although in online help */
-#define isspace(a) (((CHAR)a == ' ') || ((CHAR)a == '\t'))
-#endif /* _WIN32_WCE < 300 */
-
-/* Parse a command line buffer into arguments */
-static int ParseCommandLine(char *cmdline, char **argv)
-{
- char *bufp;
- int argc;
-
- argc = 0;
- for ( bufp = cmdline; *bufp; ) {
- /* Skip leading whitespace */
- while ( isspace(*bufp) ) {
- ++bufp;
- }
- /* Skip over argument */
- if ( *bufp == '"' ) {
- ++bufp;
- if ( *bufp ) {
- if ( argv ) {
- argv[argc] = bufp;
- }
- ++argc;
- }
- /* Skip over word */
- while ( *bufp && (*bufp != '"') ) {
- ++bufp;
- }
- } else {
- if ( *bufp ) {
- if ( argv ) {
- argv[argc] = bufp;
- }
- ++argc;
- }
- /* Skip over word */
- while ( *bufp && ! isspace(*bufp) ) {
- ++bufp;
- }
- }
- if ( *bufp ) {
- if ( argv ) {
- *bufp = '\0';
- }
- ++bufp;
- }
- }
- if ( argv ) {
- argv[argc] = NULL;
- }
- return(argc);
-}
-
-/* Show an error message */
-static void ShowError(const char *title, const char *message)
-{
-/* If USE_MESSAGEBOX is defined, you need to link with user32.lib */
-#ifdef USE_MESSAGEBOX
- MessageBox(NULL, message, title, MB_ICONEXCLAMATION|MB_OK);
-#else
- fprintf(stderr, "%s: %s\n", title, message);
-#endif
-}
-
-/* Pop up an out of memory message, returns to Windows */
-static BOOL OutOfMemory(void)
-{
- ShowError("Fatal Error", "Out of memory - aborting");
- return FALSE;
-}
-
-/* SDL_Quit() shouldn't be used with atexit() directly because
- calling conventions may differ... */
-static void cleanup(void)
-{
- SDL_Quit();
-}
-
-/* Remove the output files if there was no output written */
-static void cleanup_output(void)
-{
-#ifndef NO_STDIO_REDIRECT
- FILE *file;
- int empty;
-#endif
-
- /* Flush the output in case anything is queued */
- fclose(stdout);
- fclose(stderr);
-
-#ifndef NO_STDIO_REDIRECT
- /* See if the files have any output in them */
- if ( stdoutPath[0] ) {
- file = fopen(stdoutPath, TEXT("rb"));
- if ( file ) {
- empty = (fgetc(file) == EOF) ? 1 : 0;
- fclose(file);
- if ( empty ) {
- remove(stdoutPath);
- }
- }
- }
- if ( stderrPath[0] ) {
- file = fopen(stderrPath, TEXT("rb"));
- if ( file ) {
- empty = (fgetc(file) == EOF) ? 1 : 0;
- fclose(file);
- if ( empty ) {
- remove(stderrPath);
- }
- }
- }
-#endif
-}
-
-#if defined(_MSC_VER) && !defined(_WIN32_WCE)
-/* The VC++ compiler needs main defined */
-#define console_main main
-#endif
-
-/* This is where execution begins [console apps] */
-int console_main(int argc, char *argv[])
-{
- size_t n;
- char *bufp, *appname;
- int status;
-
- /* Get the class name from argv[0] */
- appname = argv[0];
- if ( (bufp=SDL_strrchr(argv[0], '\\')) != NULL ) {
- appname = bufp+1;
- } else
- if ( (bufp=SDL_strrchr(argv[0], '/')) != NULL ) {
- appname = bufp+1;
- }
-
- if ( (bufp=SDL_strrchr(appname, '.')) == NULL )
- n = SDL_strlen(appname);
- else
- n = (bufp-appname);
-
- bufp = SDL_stack_alloc(char, n+1);
- if ( bufp == NULL ) {
- return OutOfMemory();
- }
- SDL_strlcpy(bufp, appname, n+1);
- appname = bufp;
-
- /* Load SDL dynamic link library */
- if ( SDL_Init(SDL_INIT_NOPARACHUTE) < 0 ) {
- ShowError("WinMain() error", SDL_GetError());
- return(FALSE);
- }
- atexit(cleanup_output);
- atexit(cleanup);
-
- /* Sam:
- We still need to pass in the application handle so that
- DirectInput will initialize properly when SDL_RegisterApp()
- is called later in the video initialization.
- */
- SDL_SetModuleHandle(GetModuleHandle(NULL));
-
- /* Run the application main() code */
- status = SDL_main(argc, argv);
-
- /* Exit cleanly, calling atexit() functions */
- exit(status);
-
- /* Hush little compiler, don't you cry... */
- return 0;
-}
-
-/* This is where execution begins [windowed apps] */
-#ifdef _WIN32_WCE
-int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPWSTR szCmdLine, int sw)
-#else
-int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
-#endif
-{
- HINSTANCE handle;
- char **argv;
- int argc;
- char *cmdline;
-#ifdef _WIN32_WCE
- wchar_t *bufp;
- int nLen;
-#else
- char *bufp;
- size_t nLen;
-#endif
-#ifndef NO_STDIO_REDIRECT
- DWORD pathlen;
-#ifdef _WIN32_WCE
- wchar_t path[MAX_PATH];
-#else
- char path[MAX_PATH];
-#endif
- FILE *newfp;
-#endif
-
- /* Start up DDHELP.EXE before opening any files, so DDHELP doesn't
- keep them open. This is a hack.. hopefully it will be fixed
- someday. DDHELP.EXE starts up the first time DDRAW.DLL is loaded.
- */
- handle = LoadLibrary(TEXT("DDRAW.DLL"));
- if ( handle != NULL ) {
- FreeLibrary(handle);
- }
-
-#ifndef NO_STDIO_REDIRECT
- pathlen = GetModuleFileName(NULL, path, SDL_arraysize(path));
- while ( pathlen > 0 && path[pathlen] != '\\' ) {
- --pathlen;
- }
- path[pathlen] = '\0';
-
-#ifdef _WIN32_WCE
- wcsncpy( stdoutPath, path, SDL_arraysize(stdoutPath) );
- wcsncat( stdoutPath, DIR_SEPERATOR STDOUT_FILE, SDL_arraysize(stdoutPath) );
-#else
- SDL_strlcpy( stdoutPath, path, SDL_arraysize(stdoutPath) );
- SDL_strlcat( stdoutPath, DIR_SEPERATOR STDOUT_FILE, SDL_arraysize(stdoutPath) );
-#endif
-
- /* Redirect standard input and standard output */
- newfp = freopen(stdoutPath, TEXT("w"), stdout);
-
-#ifndef _WIN32_WCE
- if ( newfp == NULL ) { /* This happens on NT */
-#if !defined(stdout)
- stdout = fopen(stdoutPath, TEXT("w"));
-#else
- newfp = fopen(stdoutPath, TEXT("w"));
- if ( newfp ) {
- *stdout = *newfp;
- }
-#endif
- }
-#endif /* _WIN32_WCE */
-
-#ifdef _WIN32_WCE
- wcsncpy( stderrPath, path, SDL_arraysize(stdoutPath) );
- wcsncat( stderrPath, DIR_SEPERATOR STDOUT_FILE, SDL_arraysize(stdoutPath) );
-#else
- SDL_strlcpy( stderrPath, path, SDL_arraysize(stderrPath) );
- SDL_strlcat( stderrPath, DIR_SEPERATOR STDERR_FILE, SDL_arraysize(stderrPath) );
-#endif
-
- newfp = freopen(stderrPath, TEXT("w"), stderr);
-#ifndef _WIN32_WCE
- if ( newfp == NULL ) { /* This happens on NT */
-#if !defined(stderr)
- stderr = fopen(stderrPath, TEXT("w"));
-#else
- newfp = fopen(stderrPath, TEXT("w"));
- if ( newfp ) {
- *stderr = *newfp;
- }
-#endif
- }
-#endif /* _WIN32_WCE */
-
- setvbuf(stdout, NULL, _IOLBF, BUFSIZ); /* Line buffered */
- setbuf(stderr, NULL); /* No buffering */
-#endif /* !NO_STDIO_REDIRECT */
-
-#ifdef _WIN32_WCE
- nLen = wcslen(szCmdLine)+128+1;
- bufp = SDL_stack_alloc(wchar_t, nLen*2);
- wcscpy (bufp, TEXT("\""));
- GetModuleFileName(NULL, bufp+1, 128-3);
- wcscpy (bufp+wcslen(bufp), TEXT("\" "));
- wcsncpy(bufp+wcslen(bufp), szCmdLine,nLen-wcslen(bufp));
- nLen = wcslen(bufp)+1;
- cmdline = SDL_stack_alloc(char, nLen);
- if ( cmdline == NULL ) {
- return OutOfMemory();
- }
- WideCharToMultiByte(CP_ACP, 0, bufp, -1, cmdline, nLen, NULL, NULL);
-#else
- /* Grab the command line */
- bufp = GetCommandLine();
- nLen = SDL_strlen(bufp)+1;
- cmdline = SDL_stack_alloc(char, nLen);
- if ( cmdline == NULL ) {
- return OutOfMemory();
- }
- SDL_strlcpy(cmdline, bufp, nLen);
-#endif
-
- /* Parse it into argv and argc */
- argc = ParseCommandLine(cmdline, NULL);
- argv = SDL_stack_alloc(char*, argc+1);
- if ( argv == NULL ) {
- return OutOfMemory();
- }
- ParseCommandLine(cmdline, argv);
-
- /* Run the main program (after a little SDL initialization) */
- console_main(argc, argv);
-
- /* Hush little compiler, don't you cry... */
- return 0;
-}
diff --git a/distrib/sdl-1.2.12/src/main/win32/version.rc b/distrib/sdl-1.2.12/src/main/win32/version.rc
deleted file mode 100644
index d1b27f1..0000000
--- a/distrib/sdl-1.2.12/src/main/win32/version.rc
+++ /dev/null
@@ -1,39 +0,0 @@
-#define APSTUDIO_READONLY_SYMBOLS
-#include "afxres.h"
-#undef APSTUDIO_READONLY_SYMBOLS
-
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,2,12,0
- PRODUCTVERSION 1,2,12,0
- FILEFLAGSMASK 0x3fL
- FILEFLAGS 0x0L
- FILEOS 0x40004L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "CompanyName", "\0"
- VALUE "FileDescription", "SDL\0"
- VALUE "FileVersion", "1, 2, 12, 0\0"
- VALUE "InternalName", "SDL\0"
- VALUE "LegalCopyright", "Copyright © 2007 Sam Lantinga\0"
- VALUE "OriginalFilename", "SDL.dll\0"
- VALUE "ProductName", "Simple DirectMedia Layer\0"
- VALUE "ProductVersion", "1, 2, 12, 0\0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
diff --git a/distrib/sdl-1.2.12/src/stdlib/SDL_getenv.c b/distrib/sdl-1.2.12/src/stdlib/SDL_getenv.c
deleted file mode 100644
index d52707a..0000000
--- a/distrib/sdl-1.2.12/src/stdlib/SDL_getenv.c
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_stdinc.h"
-
-#ifndef HAVE_GETENV
-
-#if defined(__WIN32__) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__)
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-/* Note this isn't thread-safe! */
-
-static char *SDL_envmem = NULL; /* Ugh, memory leak */
-static size_t SDL_envmemlen = 0;
-
-/* Put a variable of the form "name=value" into the environment */
-int SDL_putenv(const char *variable)
-{
- size_t bufferlen;
- char *value;
- const char *sep;
-
- sep = SDL_strchr(variable, '=');
- if ( sep == NULL ) {
- return -1;
- }
- bufferlen = SDL_strlen(variable)+1;
- if ( bufferlen > SDL_envmemlen ) {
- char *newmem = (char *)SDL_realloc(SDL_envmem, bufferlen);
- if ( newmem == NULL ) {
- return -1;
- }
- SDL_envmem = newmem;
- SDL_envmemlen = bufferlen;
- }
- SDL_strlcpy(SDL_envmem, variable, bufferlen);
- value = SDL_envmem + (sep - variable);
- *value++ = '\0';
- if ( !SetEnvironmentVariable(SDL_envmem, *value ? value : NULL) ) {
- return -1;
- }
- return 0;
-}
-
-/* Retrieve a variable named "name" from the environment */
-char *SDL_getenv(const char *name)
-{
- size_t bufferlen;
-
- bufferlen = GetEnvironmentVariable(name, SDL_envmem, (DWORD)SDL_envmemlen);
- if ( bufferlen == 0 ) {
- return NULL;
- }
- if ( bufferlen > SDL_envmemlen ) {
- char *newmem = (char *)SDL_realloc(SDL_envmem, bufferlen);
- if ( newmem == NULL ) {
- return NULL;
- }
- SDL_envmem = newmem;
- SDL_envmemlen = bufferlen;
- GetEnvironmentVariable(name, SDL_envmem, (DWORD)SDL_envmemlen);
- }
- return SDL_envmem;
-}
-
-#else /* roll our own */
-
-static char **SDL_env = (char **)0;
-
-/* Put a variable of the form "name=value" into the environment */
-int SDL_putenv(const char *variable)
-{
- const char *name, *value;
- int added;
- int len, i;
- char **new_env;
- char *new_variable;
-
- /* A little error checking */
- if ( ! variable ) {
- return(-1);
- }
- name = variable;
- for ( value=variable; *value && (*value != '='); ++value ) {
- /* Keep looking for '=' */ ;
- }
- if ( *value ) {
- ++value;
- } else {
- return(-1);
- }
-
- /* Allocate memory for the variable */
- new_variable = SDL_strdup(variable);
- if ( ! new_variable ) {
- return(-1);
- }
-
- /* Actually put it into the environment */
- added = 0;
- i = 0;
- if ( SDL_env ) {
- /* Check to see if it's already there... */
- len = (value - name);
- for ( ; SDL_env[i]; ++i ) {
- if ( SDL_strncmp(SDL_env[i], name, len) == 0 ) {
- break;
- }
- }
- /* If we found it, just replace the entry */
- if ( SDL_env[i] ) {
- SDL_free(SDL_env[i]);
- SDL_env[i] = new_variable;
- added = 1;
- }
- }
-
- /* Didn't find it in the environment, expand and add */
- if ( ! added ) {
- new_env = SDL_realloc(SDL_env, (i+2)*sizeof(char *));
- if ( new_env ) {
- SDL_env = new_env;
- SDL_env[i++] = new_variable;
- SDL_env[i++] = (char *)0;
- added = 1;
- } else {
- SDL_free(new_variable);
- }
- }
- return (added ? 0 : -1);
-}
-
-/* Retrieve a variable named "name" from the environment */
-char *SDL_getenv(const char *name)
-{
- int len, i;
- char *value;
-
- value = (char *)0;
- if ( SDL_env ) {
- len = SDL_strlen(name);
- for ( i=0; SDL_env[i] && !value; ++i ) {
- if ( (SDL_strncmp(SDL_env[i], name, len) == 0) &&
- (SDL_env[i][len] == '=') ) {
- value = &SDL_env[i][len+1];
- }
- }
- }
- return value;
-}
-
-#endif /* __WIN32__ */
-
-#endif /* !HAVE_GETENV */
-
-#ifdef TEST_MAIN
-#include <stdio.h>
-
-int main(int argc, char *argv[])
-{
- char *value;
-
- printf("Checking for non-existent variable... ");
- fflush(stdout);
- if ( ! SDL_getenv("EXISTS") ) {
- printf("okay\n");
- } else {
- printf("failed\n");
- }
- printf("Setting FIRST=VALUE1 in the environment... ");
- fflush(stdout);
- if ( SDL_putenv("FIRST=VALUE1") == 0 ) {
- printf("okay\n");
- } else {
- printf("failed\n");
- }
- printf("Getting FIRST from the environment... ");
- fflush(stdout);
- value = SDL_getenv("FIRST");
- if ( value && (SDL_strcmp(value, "VALUE1") == 0) ) {
- printf("okay\n");
- } else {
- printf("failed\n");
- }
- printf("Setting SECOND=VALUE2 in the environment... ");
- fflush(stdout);
- if ( SDL_putenv("SECOND=VALUE2") == 0 ) {
- printf("okay\n");
- } else {
- printf("failed\n");
- }
- printf("Getting SECOND from the environment... ");
- fflush(stdout);
- value = SDL_getenv("SECOND");
- if ( value && (SDL_strcmp(value, "VALUE2") == 0) ) {
- printf("okay\n");
- } else {
- printf("failed\n");
- }
- printf("Setting FIRST=NOVALUE in the environment... ");
- fflush(stdout);
- if ( SDL_putenv("FIRST=NOVALUE") == 0 ) {
- printf("okay\n");
- } else {
- printf("failed\n");
- }
- printf("Getting FIRST from the environment... ");
- fflush(stdout);
- value = SDL_getenv("FIRST");
- if ( value && (SDL_strcmp(value, "NOVALUE") == 0) ) {
- printf("okay\n");
- } else {
- printf("failed\n");
- }
- printf("Checking for non-existent variable... ");
- fflush(stdout);
- if ( ! SDL_getenv("EXISTS") ) {
- printf("okay\n");
- } else {
- printf("failed\n");
- }
- return(0);
-}
-#endif /* TEST_MAIN */
-
diff --git a/distrib/sdl-1.2.12/src/stdlib/SDL_iconv.c b/distrib/sdl-1.2.12/src/stdlib/SDL_iconv.c
deleted file mode 100644
index 307c73c..0000000
--- a/distrib/sdl-1.2.12/src/stdlib/SDL_iconv.c
+++ /dev/null
@@ -1,881 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This file contains portable iconv functions for SDL */
-
-#include "SDL_stdinc.h"
-#include "SDL_endian.h"
-
-#ifdef HAVE_ICONV
-
-/* Depending on which standard the iconv() was implemented with,
- iconv() may or may not use const char ** for the inbuf param.
- If we get this wrong, it's just a warning, so no big deal.
-*/
-#if defined(_XGP6) || \
- defined(__GLIBC__) && ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2))
-#define ICONV_INBUF_NONCONST
-#endif
-
-#include <errno.h>
-
-size_t SDL_iconv(SDL_iconv_t cd,
- const char **inbuf, size_t *inbytesleft,
- char **outbuf, size_t *outbytesleft)
-{
- size_t retCode;
-#ifdef ICONV_INBUF_NONCONST
- retCode = iconv(cd, (char **)inbuf, inbytesleft, outbuf, outbytesleft);
-#else
- retCode = iconv(cd, inbuf, inbytesleft, outbuf, outbytesleft);
-#endif
- if ( retCode == (size_t)-1 ) {
- switch(errno) {
- case E2BIG:
- return SDL_ICONV_E2BIG;
- case EILSEQ:
- return SDL_ICONV_EILSEQ;
- case EINVAL:
- return SDL_ICONV_EINVAL;
- default:
- return SDL_ICONV_ERROR;
- }
- }
- return retCode;
-}
-
-#else
-
-/* Lots of useful information on Unicode at:
- http://www.cl.cam.ac.uk/~mgk25/unicode.html
-*/
-
-#define UNICODE_BOM 0xFEFF
-
-#define UNKNOWN_ASCII '?'
-#define UNKNOWN_UNICODE 0xFFFD
-
-enum {
- ENCODING_UNKNOWN,
- ENCODING_ASCII,
- ENCODING_LATIN1,
- ENCODING_UTF8,
- ENCODING_UTF16, /* Needs byte order marker */
- ENCODING_UTF16BE,
- ENCODING_UTF16LE,
- ENCODING_UTF32, /* Needs byte order marker */
- ENCODING_UTF32BE,
- ENCODING_UTF32LE,
- ENCODING_UCS2, /* Native byte order assumed */
- ENCODING_UCS4, /* Native byte order assumed */
-};
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-#define ENCODING_UTF16NATIVE ENCODING_UTF16BE
-#define ENCODING_UTF32NATIVE ENCODING_UTF32BE
-#else
-#define ENCODING_UTF16NATIVE ENCODING_UTF16LE
-#define ENCODING_UTF32NATIVE ENCODING_UTF32LE
-#endif
-
-struct _SDL_iconv_t
-{
- int src_fmt;
- int dst_fmt;
-};
-
-static struct {
- const char *name;
- int format;
-} encodings[] = {
- { "ASCII", ENCODING_ASCII },
- { "US-ASCII", ENCODING_ASCII },
- { "8859-1", ENCODING_LATIN1 },
- { "ISO-8859-1", ENCODING_LATIN1 },
- { "UTF8", ENCODING_UTF8 },
- { "UTF-8", ENCODING_UTF8 },
- { "UTF16", ENCODING_UTF16 },
- { "UTF-16", ENCODING_UTF16 },
- { "UTF16BE", ENCODING_UTF16BE },
- { "UTF-16BE", ENCODING_UTF16BE },
- { "UTF16LE", ENCODING_UTF16LE },
- { "UTF-16LE", ENCODING_UTF16LE },
- { "UTF32", ENCODING_UTF32 },
- { "UTF-32", ENCODING_UTF32 },
- { "UTF32BE", ENCODING_UTF32BE },
- { "UTF-32BE", ENCODING_UTF32BE },
- { "UTF32LE", ENCODING_UTF32LE },
- { "UTF-32LE", ENCODING_UTF32LE },
- { "UCS2", ENCODING_UCS2 },
- { "UCS-2", ENCODING_UCS2 },
- { "UCS4", ENCODING_UCS4 },
- { "UCS-4", ENCODING_UCS4 },
-};
-
-static const char *getlocale(char *buffer, size_t bufsize)
-{
- const char *lang;
- char *ptr;
-
- lang = SDL_getenv("LC_ALL");
- if ( !lang ) {
- lang = SDL_getenv("LC_CTYPE");
- }
- if ( !lang ) {
- lang = SDL_getenv("LC_MESSAGES");
- }
- if ( !lang ) {
- lang = SDL_getenv("LANG");
- }
- if ( !lang || !*lang || SDL_strcmp(lang, "C") == 0 ) {
- lang = "ASCII";
- }
-
- /* We need to trim down strings like "en_US.UTF-8@blah" to "UTF-8" */
- ptr = SDL_strchr(lang, '.');
- if (ptr != NULL) {
- lang = ptr + 1;
- }
-
- SDL_strlcpy(buffer, lang, bufsize);
- ptr = SDL_strchr(buffer, '@');
- if (ptr != NULL) {
- *ptr = '\0'; /* chop end of string. */
- }
-
- return buffer;
-}
-
-SDL_iconv_t SDL_iconv_open(const char *tocode, const char *fromcode)
-{
- int src_fmt = ENCODING_UNKNOWN;
- int dst_fmt = ENCODING_UNKNOWN;
- int i;
- char fromcode_buffer[64];
- char tocode_buffer[64];
-
- if ( !fromcode || !*fromcode ) {
- fromcode = getlocale(fromcode_buffer, sizeof(fromcode_buffer));
- }
- if ( !tocode || !*tocode ) {
- tocode = getlocale(tocode_buffer, sizeof(tocode_buffer));
- }
- for ( i = 0; i < SDL_arraysize(encodings); ++i ) {
- if ( SDL_strcasecmp(fromcode, encodings[i].name) == 0 ) {
- src_fmt = encodings[i].format;
- if ( dst_fmt != ENCODING_UNKNOWN ) {
- break;
- }
- }
- if ( SDL_strcasecmp(tocode, encodings[i].name) == 0 ) {
- dst_fmt = encodings[i].format;
- if ( src_fmt != ENCODING_UNKNOWN ) {
- break;
- }
- }
- }
- if ( src_fmt != ENCODING_UNKNOWN && dst_fmt != ENCODING_UNKNOWN ) {
- SDL_iconv_t cd = (SDL_iconv_t)SDL_malloc(sizeof(*cd));
- if ( cd ) {
- cd->src_fmt = src_fmt;
- cd->dst_fmt = dst_fmt;
- return cd;
- }
- }
- return (SDL_iconv_t)-1;
-}
-
-size_t SDL_iconv(SDL_iconv_t cd,
- const char **inbuf, size_t *inbytesleft,
- char **outbuf, size_t *outbytesleft)
-{
- /* For simplicity, we'll convert everything to and from UCS-4 */
- const char *src;
- char *dst;
- size_t srclen, dstlen;
- Uint32 ch = 0;
- size_t total;
-
- if ( !inbuf || !*inbuf ) {
- /* Reset the context */
- return 0;
- }
- if ( !outbuf || !*outbuf || !outbytesleft || !*outbytesleft ) {
- return SDL_ICONV_E2BIG;
- }
- src = *inbuf;
- srclen = (inbytesleft ? *inbytesleft : 0);
- dst = *outbuf;
- dstlen = *outbytesleft;
-
- switch ( cd->src_fmt ) {
- case ENCODING_UTF16:
- /* Scan for a byte order marker */
- {
- Uint8 *p = (Uint8 *)src;
- size_t n = srclen / 2;
- while ( n ) {
- if ( p[0] == 0xFF && p[1] == 0xFE ) {
- cd->src_fmt = ENCODING_UTF16BE;
- break;
- } else if ( p[0] == 0xFE && p[1] == 0xFF ) {
- cd->src_fmt = ENCODING_UTF16LE;
- break;
- }
- p += 2;
- --n;
- }
- if ( n == 0 ) {
- /* We can't tell, default to host order */
- cd->src_fmt = ENCODING_UTF16NATIVE;
- }
- }
- break;
- case ENCODING_UTF32:
- /* Scan for a byte order marker */
- {
- Uint8 *p = (Uint8 *)src;
- size_t n = srclen / 4;
- while ( n ) {
- if ( p[0] == 0xFF && p[1] == 0xFE &&
- p[2] == 0x00 && p[3] == 0x00 ) {
- cd->src_fmt = ENCODING_UTF32BE;
- break;
- } else if ( p[0] == 0x00 && p[1] == 0x00 &&
- p[2] == 0xFE && p[3] == 0xFF ) {
- cd->src_fmt = ENCODING_UTF32LE;
- break;
- }
- p += 4;
- --n;
- }
- if ( n == 0 ) {
- /* We can't tell, default to host order */
- cd->src_fmt = ENCODING_UTF32NATIVE;
- }
- }
- break;
- }
-
- switch ( cd->dst_fmt ) {
- case ENCODING_UTF16:
- /* Default to host order, need to add byte order marker */
- if ( dstlen < 2 ) {
- return SDL_ICONV_E2BIG;
- }
- *(Uint16 *)dst = UNICODE_BOM;
- dst += 2;
- dstlen -= 2;
- cd->dst_fmt = ENCODING_UTF16NATIVE;
- break;
- case ENCODING_UTF32:
- /* Default to host order, need to add byte order marker */
- if ( dstlen < 4 ) {
- return SDL_ICONV_E2BIG;
- }
- *(Uint32 *)dst = UNICODE_BOM;
- dst += 4;
- dstlen -= 4;
- cd->dst_fmt = ENCODING_UTF32NATIVE;
- break;
- }
-
- total = 0;
- while ( srclen > 0 ) {
- /* Decode a character */
- switch ( cd->src_fmt ) {
- case ENCODING_ASCII:
- {
- Uint8 *p = (Uint8 *)src;
- ch = (Uint32)(p[0] & 0x7F);
- ++src;
- --srclen;
- }
- break;
- case ENCODING_LATIN1:
- {
- Uint8 *p = (Uint8 *)src;
- ch = (Uint32)p[0];
- ++src;
- --srclen;
- }
- break;
- case ENCODING_UTF8: /* RFC 3629 */
- {
- Uint8 *p = (Uint8 *)src;
- size_t left = 0;
- SDL_bool overlong = SDL_FALSE;
- if ( p[0] >= 0xFC ) {
- if ( (p[0] & 0xFE) != 0xFC ) {
- /* Skip illegal sequences
- return SDL_ICONV_EILSEQ;
- */
- ch = UNKNOWN_UNICODE;
- } else {
- if ( p[0] == 0xFC ) {
- overlong = SDL_TRUE;
- }
- ch = (Uint32)(p[0] & 0x01);
- left = 5;
- }
- } else if ( p[0] >= 0xF8 ) {
- if ( (p[0] & 0xFC) != 0xF8 ) {
- /* Skip illegal sequences
- return SDL_ICONV_EILSEQ;
- */
- ch = UNKNOWN_UNICODE;
- } else {
- if ( p[0] == 0xF8 ) {
- overlong = SDL_TRUE;
- }
- ch = (Uint32)(p[0] & 0x03);
- left = 4;
- }
- } else if ( p[0] >= 0xF0 ) {
- if ( (p[0] & 0xF8) != 0xF0 ) {
- /* Skip illegal sequences
- return SDL_ICONV_EILSEQ;
- */
- ch = UNKNOWN_UNICODE;
- } else {
- if ( p[0] == 0xF0 ) {
- overlong = SDL_TRUE;
- }
- ch = (Uint32)(p[0] & 0x07);
- left = 3;
- }
- } else if ( p[0] >= 0xE0 ) {
- if ( (p[0] & 0xF0) != 0xE0 ) {
- /* Skip illegal sequences
- return SDL_ICONV_EILSEQ;
- */
- ch = UNKNOWN_UNICODE;
- } else {
- if ( p[0] == 0xE0 ) {
- overlong = SDL_TRUE;
- }
- ch = (Uint32)(p[0] & 0x0F);
- left = 2;
- }
- } else if ( p[0] >= 0xC0 ) {
- if ( (p[0] & 0xE0) != 0xC0 ) {
- /* Skip illegal sequences
- return SDL_ICONV_EILSEQ;
- */
- ch = UNKNOWN_UNICODE;
- } else {
- if ( (p[0] & 0xCE) == 0xC0 ) {
- overlong = SDL_TRUE;
- }
- ch = (Uint32)(p[0] & 0x1F);
- left = 1;
- }
- } else {
- if ( (p[0] & 0x80) != 0x00 ) {
- /* Skip illegal sequences
- return SDL_ICONV_EILSEQ;
- */
- ch = UNKNOWN_UNICODE;
- } else {
- ch = (Uint32)p[0];
- }
- }
- ++src;
- --srclen;
- if ( srclen < left ) {
- return SDL_ICONV_EINVAL;
- }
- while ( left-- ) {
- ++p;
- if ( (p[0] & 0xC0) != 0x80 ) {
- /* Skip illegal sequences
- return SDL_ICONV_EILSEQ;
- */
- ch = UNKNOWN_UNICODE;
- break;
- }
- ch <<= 6;
- ch |= (p[0] & 0x3F);
- ++src;
- --srclen;
- }
- if ( overlong ) {
- /* Potential security risk
- return SDL_ICONV_EILSEQ;
- */
- ch = UNKNOWN_UNICODE;
- }
- if ( (ch >= 0xD800 && ch <= 0xDFFF) ||
- (ch == 0xFFFE || ch == 0xFFFF) ||
- ch > 0x10FFFF ) {
- /* Skip illegal sequences
- return SDL_ICONV_EILSEQ;
- */
- ch = UNKNOWN_UNICODE;
- }
- }
- break;
- case ENCODING_UTF16BE: /* RFC 2781 */
- {
- Uint8 *p = (Uint8 *)src;
- Uint16 W1, W2;
- if ( srclen < 2 ) {
- return SDL_ICONV_EINVAL;
- }
- W1 = ((Uint16)p[0] << 8) |
- (Uint16)p[1];
- src += 2;
- srclen -= 2;
- if ( W1 < 0xD800 || W1 > 0xDFFF ) {
- ch = (Uint32)W1;
- break;
- }
- if ( W1 > 0xDBFF ) {
- /* Skip illegal sequences
- return SDL_ICONV_EILSEQ;
- */
- ch = UNKNOWN_UNICODE;
- break;
- }
- if ( srclen < 2 ) {
- return SDL_ICONV_EINVAL;
- }
- p = (Uint8 *)src;
- W2 = ((Uint16)p[0] << 8) |
- (Uint16)p[1];
- src += 2;
- srclen -= 2;
- if ( W2 < 0xDC00 || W2 > 0xDFFF ) {
- /* Skip illegal sequences
- return SDL_ICONV_EILSEQ;
- */
- ch = UNKNOWN_UNICODE;
- break;
- }
- ch = (((Uint32)(W1 & 0x3FF) << 10) |
- (Uint32)(W2 & 0x3FF)) + 0x10000;
- }
- break;
- case ENCODING_UTF16LE: /* RFC 2781 */
- {
- Uint8 *p = (Uint8 *)src;
- Uint16 W1, W2;
- if ( srclen < 2 ) {
- return SDL_ICONV_EINVAL;
- }
- W1 = ((Uint16)p[1] << 8) |
- (Uint16)p[0];
- src += 2;
- srclen -= 2;
- if ( W1 < 0xD800 || W1 > 0xDFFF ) {
- ch = (Uint32)W1;
- break;
- }
- if ( W1 > 0xDBFF ) {
- /* Skip illegal sequences
- return SDL_ICONV_EILSEQ;
- */
- ch = UNKNOWN_UNICODE;
- break;
- }
- if ( srclen < 2 ) {
- return SDL_ICONV_EINVAL;
- }
- p = (Uint8 *)src;
- W2 = ((Uint16)p[1] << 8) |
- (Uint16)p[0];
- src += 2;
- srclen -= 2;
- if ( W2 < 0xDC00 || W2 > 0xDFFF ) {
- /* Skip illegal sequences
- return SDL_ICONV_EILSEQ;
- */
- ch = UNKNOWN_UNICODE;
- break;
- }
- ch = (((Uint32)(W1 & 0x3FF) << 10) |
- (Uint32)(W2 & 0x3FF)) + 0x10000;
- }
- break;
- case ENCODING_UTF32BE:
- {
- Uint8 *p = (Uint8 *)src;
- if ( srclen < 4 ) {
- return SDL_ICONV_EINVAL;
- }
- ch = ((Uint32)p[0] << 24) |
- ((Uint32)p[1] << 16) |
- ((Uint32)p[2] << 8) |
- (Uint32)p[3];
- src += 4;
- srclen -= 4;
- }
- break;
- case ENCODING_UTF32LE:
- {
- Uint8 *p = (Uint8 *)src;
- if ( srclen < 4 ) {
- return SDL_ICONV_EINVAL;
- }
- ch = ((Uint32)p[3] << 24) |
- ((Uint32)p[2] << 16) |
- ((Uint32)p[1] << 8) |
- (Uint32)p[0];
- src += 4;
- srclen -= 4;
- }
- break;
- case ENCODING_UCS2:
- {
- Uint16 *p = (Uint16 *)src;
- if ( srclen < 2 ) {
- return SDL_ICONV_EINVAL;
- }
- ch = *p;
- src += 2;
- srclen -= 2;
- }
- break;
- case ENCODING_UCS4:
- {
- Uint32 *p = (Uint32 *)src;
- if ( srclen < 4 ) {
- return SDL_ICONV_EINVAL;
- }
- ch = *p;
- src += 4;
- srclen -= 4;
- }
- break;
- }
-
- /* Encode a character */
- switch ( cd->dst_fmt ) {
- case ENCODING_ASCII:
- {
- Uint8 *p = (Uint8 *)dst;
- if ( dstlen < 1 ) {
- return SDL_ICONV_E2BIG;
- }
- if ( ch > 0x7F ) {
- *p = UNKNOWN_ASCII;
- } else {
- *p = (Uint8)ch;
- }
- ++dst;
- --dstlen;
- }
- break;
- case ENCODING_LATIN1:
- {
- Uint8 *p = (Uint8 *)dst;
- if ( dstlen < 1 ) {
- return SDL_ICONV_E2BIG;
- }
- if ( ch > 0xFF ) {
- *p = UNKNOWN_ASCII;
- } else {
- *p = (Uint8)ch;
- }
- ++dst;
- --dstlen;
- }
- break;
- case ENCODING_UTF8: /* RFC 3629 */
- {
- Uint8 *p = (Uint8 *)dst;
- if ( ch > 0x10FFFF ) {
- ch = UNKNOWN_UNICODE;
- }
- if ( ch <= 0x7F ) {
- if ( dstlen < 1 ) {
- return SDL_ICONV_E2BIG;
- }
- *p = (Uint8)ch;
- ++dst;
- --dstlen;
- } else if ( ch <= 0x7FF ) {
- if ( dstlen < 2 ) {
- return SDL_ICONV_E2BIG;
- }
- p[0] = 0xC0 | (Uint8)((ch >> 6) & 0x1F);
- p[1] = 0x80 | (Uint8)(ch & 0x3F);
- dst += 2;
- dstlen -= 2;
- } else if ( ch <= 0xFFFF ) {
- if ( dstlen < 3 ) {
- return SDL_ICONV_E2BIG;
- }
- p[0] = 0xE0 | (Uint8)((ch >> 12) & 0x0F);
- p[1] = 0x80 | (Uint8)((ch >> 6) & 0x3F);
- p[2] = 0x80 | (Uint8)(ch & 0x3F);
- dst += 3;
- dstlen -= 3;
- } else if ( ch <= 0x1FFFFF ) {
- if ( dstlen < 4 ) {
- return SDL_ICONV_E2BIG;
- }
- p[0] = 0xF0 | (Uint8)((ch >> 18) & 0x07);
- p[1] = 0x80 | (Uint8)((ch >> 12) & 0x3F);
- p[2] = 0x80 | (Uint8)((ch >> 6) & 0x3F);
- p[3] = 0x80 | (Uint8)(ch & 0x3F);
- dst += 4;
- dstlen -= 4;
- } else if ( ch <= 0x3FFFFFF ) {
- if ( dstlen < 5 ) {
- return SDL_ICONV_E2BIG;
- }
- p[0] = 0xF8 | (Uint8)((ch >> 24) & 0x03);
- p[1] = 0x80 | (Uint8)((ch >> 18) & 0x3F);
- p[2] = 0x80 | (Uint8)((ch >> 12) & 0x3F);
- p[3] = 0x80 | (Uint8)((ch >> 6) & 0x3F);
- p[4] = 0x80 | (Uint8)(ch & 0x3F);
- dst += 5;
- dstlen -= 5;
- } else {
- if ( dstlen < 6 ) {
- return SDL_ICONV_E2BIG;
- }
- p[0] = 0xFC | (Uint8)((ch >> 30) & 0x01);
- p[1] = 0x80 | (Uint8)((ch >> 24) & 0x3F);
- p[2] = 0x80 | (Uint8)((ch >> 18) & 0x3F);
- p[3] = 0x80 | (Uint8)((ch >> 12) & 0x3F);
- p[4] = 0x80 | (Uint8)((ch >> 6) & 0x3F);
- p[5] = 0x80 | (Uint8)(ch & 0x3F);
- dst += 6;
- dstlen -= 6;
- }
- }
- break;
- case ENCODING_UTF16BE: /* RFC 2781 */
- {
- Uint8 *p = (Uint8 *)dst;
- if ( ch > 0x10FFFF ) {
- ch = UNKNOWN_UNICODE;
- }
- if ( ch < 0x10000 ) {
- if ( dstlen < 2 ) {
- return SDL_ICONV_E2BIG;
- }
- p[0] = (Uint8)(ch >> 8);
- p[1] = (Uint8)ch;
- dst += 2;
- dstlen -= 2;
- } else {
- Uint16 W1, W2;
- if ( dstlen < 4 ) {
- return SDL_ICONV_E2BIG;
- }
- ch = ch - 0x10000;
- W1 = 0xD800 | (Uint16)((ch >> 10) & 0x3FF);
- W2 = 0xDC00 | (Uint16)(ch & 0x3FF);
- p[0] = (Uint8)(W1 >> 8);
- p[1] = (Uint8)W1;
- p[2] = (Uint8)(W2 >> 8);
- p[3] = (Uint8)W2;
- dst += 4;
- dstlen -= 4;
- }
- }
- break;
- case ENCODING_UTF16LE: /* RFC 2781 */
- {
- Uint8 *p = (Uint8 *)dst;
- if ( ch > 0x10FFFF ) {
- ch = UNKNOWN_UNICODE;
- }
- if ( ch < 0x10000 ) {
- if ( dstlen < 2 ) {
- return SDL_ICONV_E2BIG;
- }
- p[1] = (Uint8)(ch >> 8);
- p[0] = (Uint8)ch;
- dst += 2;
- dstlen -= 2;
- } else {
- Uint16 W1, W2;
- if ( dstlen < 4 ) {
- return SDL_ICONV_E2BIG;
- }
- ch = ch - 0x10000;
- W1 = 0xD800 | (Uint16)((ch >> 10) & 0x3FF);
- W2 = 0xDC00 | (Uint16)(ch & 0x3FF);
- p[1] = (Uint8)(W1 >> 8);
- p[0] = (Uint8)W1;
- p[3] = (Uint8)(W2 >> 8);
- p[2] = (Uint8)W2;
- dst += 4;
- dstlen -= 4;
- }
- }
- break;
- case ENCODING_UTF32BE:
- {
- Uint8 *p = (Uint8 *)dst;
- if ( ch > 0x10FFFF ) {
- ch = UNKNOWN_UNICODE;
- }
- if ( dstlen < 4 ) {
- return SDL_ICONV_E2BIG;
- }
- p[0] = (Uint8)(ch >> 24);
- p[1] = (Uint8)(ch >> 16);
- p[2] = (Uint8)(ch >> 8);
- p[3] = (Uint8)ch;
- dst += 4;
- dstlen -= 4;
- }
- break;
- case ENCODING_UTF32LE:
- {
- Uint8 *p = (Uint8 *)dst;
- if ( ch > 0x10FFFF ) {
- ch = UNKNOWN_UNICODE;
- }
- if ( dstlen < 4 ) {
- return SDL_ICONV_E2BIG;
- }
- p[3] = (Uint8)(ch >> 24);
- p[2] = (Uint8)(ch >> 16);
- p[1] = (Uint8)(ch >> 8);
- p[0] = (Uint8)ch;
- dst += 4;
- dstlen -= 4;
- }
- break;
- case ENCODING_UCS2:
- {
- Uint16 *p = (Uint16 *)dst;
- if ( ch > 0xFFFF ) {
- ch = UNKNOWN_UNICODE;
- }
- if ( dstlen < 2 ) {
- return SDL_ICONV_E2BIG;
- }
- *p = (Uint16)ch;
- dst += 2;
- dstlen -= 2;
- }
- break;
- case ENCODING_UCS4:
- {
- Uint32 *p = (Uint32 *)dst;
- if ( ch > 0x7FFFFFFF ) {
- ch = UNKNOWN_UNICODE;
- }
- if ( dstlen < 4 ) {
- return SDL_ICONV_E2BIG;
- }
- *p = ch;
- dst += 4;
- dstlen -= 4;
- }
- break;
- }
-
- /* Update state */
- *inbuf = src;
- *inbytesleft = srclen;
- *outbuf = dst;
- *outbytesleft = dstlen;
- ++total;
- }
- return total;
-}
-
-int SDL_iconv_close(SDL_iconv_t cd)
-{
- if ( cd && cd != (SDL_iconv_t)-1 ) {
- SDL_free(cd);
- }
- return 0;
-}
-
-#endif /* !HAVE_ICONV */
-
-char *SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft)
-{
- SDL_iconv_t cd;
- char *string;
- size_t stringsize;
- char *outbuf;
- size_t outbytesleft;
- size_t retCode = 0;
-
- cd = SDL_iconv_open(tocode, fromcode);
- if ( cd == (SDL_iconv_t)-1 ) {
- /* See if we can recover here (fixes iconv on Solaris 11) */
- if ( !tocode || !*tocode ) {
- tocode = "UTF-8";
- }
- if ( !fromcode || !*fromcode ) {
- tocode = "UTF-8";
- }
- cd = SDL_iconv_open(tocode, fromcode);
- }
- if ( cd == (SDL_iconv_t)-1 ) {
- return NULL;
- }
-
- stringsize = inbytesleft > 4 ? inbytesleft : 4;
- string = SDL_malloc(stringsize);
- if ( !string ) {
- SDL_iconv_close(cd);
- return NULL;
- }
- outbuf = string;
- outbytesleft = stringsize;
- SDL_memset(outbuf, 0, 4);
-
- while ( inbytesleft > 0 ) {
- retCode = SDL_iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
- switch (retCode) {
- case SDL_ICONV_E2BIG:
- {
- char *oldstring = string;
- stringsize *= 2;
- string = SDL_realloc(string, stringsize);
- if ( !string ) {
- SDL_iconv_close(cd);
- return NULL;
- }
- outbuf = string + (outbuf - oldstring);
- outbytesleft = stringsize - (outbuf - string);
- SDL_memset(outbuf, 0, 4);
- }
- break;
- case SDL_ICONV_EILSEQ:
- /* Try skipping some input data - not perfect, but... */
- ++inbuf;
- --inbytesleft;
- break;
- case SDL_ICONV_EINVAL:
- case SDL_ICONV_ERROR:
- /* We can't continue... */
- inbytesleft = 0;
- break;
- }
- }
- SDL_iconv_close(cd);
-
- return string;
-}
diff --git a/distrib/sdl-1.2.12/src/stdlib/SDL_malloc.c b/distrib/sdl-1.2.12/src/stdlib/SDL_malloc.c
deleted file mode 100644
index 3a6009e..0000000
--- a/distrib/sdl-1.2.12/src/stdlib/SDL_malloc.c
+++ /dev/null
@@ -1,5111 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This file contains portable memory management functions for SDL */
-
-#include "SDL_stdinc.h"
-
-#ifndef HAVE_MALLOC
-
-#define LACKS_SYS_TYPES_H
-#define LACKS_STDIO_H
-#define LACKS_STRINGS_H
-#define LACKS_STRING_H
-#define LACKS_STDLIB_H
-#define ABORT
-
-/*
- This is a version (aka dlmalloc) of malloc/free/realloc written by
- Doug Lea and released to the public domain, as explained at
- http://creativecommons.org/licenses/publicdomain. Send questions,
- comments, complaints, performance data, etc to dl@cs.oswego.edu
-
-* Version 2.8.3 Thu Sep 22 11:16:15 2005 Doug Lea (dl at gee)
-
- Note: There may be an updated version of this malloc obtainable at
- ftp://gee.cs.oswego.edu/pub/misc/malloc.c
- Check before installing!
-
-* Quickstart
-
- This library is all in one file to simplify the most common usage:
- ftp it, compile it (-O3), and link it into another program. All of
- the compile-time options default to reasonable values for use on
- most platforms. You might later want to step through various
- compile-time and dynamic tuning options.
-
- For convenience, an include file for code using this malloc is at:
- ftp://gee.cs.oswego.edu/pub/misc/malloc-2.8.3.h
- You don't really need this .h file unless you call functions not
- defined in your system include files. The .h file contains only the
- excerpts from this file needed for using this malloc on ANSI C/C++
- systems, so long as you haven't changed compile-time options about
- naming and tuning parameters. If you do, then you can create your
- own malloc.h that does include all settings by cutting at the point
- indicated below. Note that you may already by default be using a C
- library containing a malloc that is based on some version of this
- malloc (for example in linux). You might still want to use the one
- in this file to customize settings or to avoid overheads associated
- with library versions.
-
-* Vital statistics:
-
- Supported pointer/size_t representation: 4 or 8 bytes
- size_t MUST be an unsigned type of the same width as
- pointers. (If you are using an ancient system that declares
- size_t as a signed type, or need it to be a different width
- than pointers, you can use a previous release of this malloc
- (e.g. 2.7.2) supporting these.)
-
- Alignment: 8 bytes (default)
- This suffices for nearly all current machines and C compilers.
- However, you can define MALLOC_ALIGNMENT to be wider than this
- if necessary (up to 128bytes), at the expense of using more space.
-
- Minimum overhead per allocated chunk: 4 or 8 bytes (if 4byte sizes)
- 8 or 16 bytes (if 8byte sizes)
- Each malloced chunk has a hidden word of overhead holding size
- and status information, and additional cross-check word
- if FOOTERS is defined.
-
- Minimum allocated size: 4-byte ptrs: 16 bytes (including overhead)
- 8-byte ptrs: 32 bytes (including overhead)
-
- Even a request for zero bytes (i.e., malloc(0)) returns a
- pointer to something of the minimum allocatable size.
- The maximum overhead wastage (i.e., number of extra bytes
- allocated than were requested in malloc) is less than or equal
- to the minimum size, except for requests >= mmap_threshold that
- are serviced via mmap(), where the worst case wastage is about
- 32 bytes plus the remainder from a system page (the minimal
- mmap unit); typically 4096 or 8192 bytes.
-
- Security: static-safe; optionally more or less
- The "security" of malloc refers to the ability of malicious
- code to accentuate the effects of errors (for example, freeing
- space that is not currently malloc'ed or overwriting past the
- ends of chunks) in code that calls malloc. This malloc
- guarantees not to modify any memory locations below the base of
- heap, i.e., static variables, even in the presence of usage
- errors. The routines additionally detect most improper frees
- and reallocs. All this holds as long as the static bookkeeping
- for malloc itself is not corrupted by some other means. This
- is only one aspect of security -- these checks do not, and
- cannot, detect all possible programming errors.
-
- If FOOTERS is defined nonzero, then each allocated chunk
- carries an additional check word to verify that it was malloced
- from its space. These check words are the same within each
- execution of a program using malloc, but differ across
- executions, so externally crafted fake chunks cannot be
- freed. This improves security by rejecting frees/reallocs that
- could corrupt heap memory, in addition to the checks preventing
- writes to statics that are always on. This may further improve
- security at the expense of time and space overhead. (Note that
- FOOTERS may also be worth using with MSPACES.)
-
- By default detected errors cause the program to abort (calling
- "abort()"). You can override this to instead proceed past
- errors by defining PROCEED_ON_ERROR. In this case, a bad free
- has no effect, and a malloc that encounters a bad address
- caused by user overwrites will ignore the bad address by
- dropping pointers and indices to all known memory. This may
- be appropriate for programs that should continue if at all
- possible in the face of programming errors, although they may
- run out of memory because dropped memory is never reclaimed.
-
- If you don't like either of these options, you can define
- CORRUPTION_ERROR_ACTION and USAGE_ERROR_ACTION to do anything
- else. And if if you are sure that your program using malloc has
- no errors or vulnerabilities, you can define INSECURE to 1,
- which might (or might not) provide a small performance improvement.
-
- Thread-safety: NOT thread-safe unless USE_LOCKS defined
- When USE_LOCKS is defined, each public call to malloc, free,
- etc is surrounded with either a pthread mutex or a win32
- spinlock (depending on WIN32). This is not especially fast, and
- can be a major bottleneck. It is designed only to provide
- minimal protection in concurrent environments, and to provide a
- basis for extensions. If you are using malloc in a concurrent
- program, consider instead using ptmalloc, which is derived from
- a version of this malloc. (See http://www.malloc.de).
-
- System requirements: Any combination of MORECORE and/or MMAP/MUNMAP
- This malloc can use unix sbrk or any emulation (invoked using
- the CALL_MORECORE macro) and/or mmap/munmap or any emulation
- (invoked using CALL_MMAP/CALL_MUNMAP) to get and release system
- memory. On most unix systems, it tends to work best if both
- MORECORE and MMAP are enabled. On Win32, it uses emulations
- based on VirtualAlloc. It also uses common C library functions
- like memset.
-
- Compliance: I believe it is compliant with the Single Unix Specification
- (See http://www.unix.org). Also SVID/XPG, ANSI C, and probably
- others as well.
-
-* Overview of algorithms
-
- This is not the fastest, most space-conserving, most portable, or
- most tunable malloc ever written. However it is among the fastest
- while also being among the most space-conserving, portable and
- tunable. Consistent balance across these factors results in a good
- general-purpose allocator for malloc-intensive programs.
-
- In most ways, this malloc is a best-fit allocator. Generally, it
- chooses the best-fitting existing chunk for a request, with ties
- broken in approximately least-recently-used order. (This strategy
- normally maintains low fragmentation.) However, for requests less
- than 256bytes, it deviates from best-fit when there is not an
- exactly fitting available chunk by preferring to use space adjacent
- to that used for the previous small request, as well as by breaking
- ties in approximately most-recently-used order. (These enhance
- locality of series of small allocations.) And for very large requests
- (>= 256Kb by default), it relies on system memory mapping
- facilities, if supported. (This helps avoid carrying around and
- possibly fragmenting memory used only for large chunks.)
-
- All operations (except malloc_stats and mallinfo) have execution
- times that are bounded by a constant factor of the number of bits in
- a size_t, not counting any clearing in calloc or copying in realloc,
- or actions surrounding MORECORE and MMAP that have times
- proportional to the number of non-contiguous regions returned by
- system allocation routines, which is often just 1.
-
- The implementation is not very modular and seriously overuses
- macros. Perhaps someday all C compilers will do as good a job
- inlining modular code as can now be done by brute-force expansion,
- but now, enough of them seem not to.
-
- Some compilers issue a lot of warnings about code that is
- dead/unreachable only on some platforms, and also about intentional
- uses of negation on unsigned types. All known cases of each can be
- ignored.
-
- For a longer but out of date high-level description, see
- http://gee.cs.oswego.edu/dl/html/malloc.html
-
-* MSPACES
- If MSPACES is defined, then in addition to malloc, free, etc.,
- this file also defines mspace_malloc, mspace_free, etc. These
- are versions of malloc routines that take an "mspace" argument
- obtained using create_mspace, to control all internal bookkeeping.
- If ONLY_MSPACES is defined, only these versions are compiled.
- So if you would like to use this allocator for only some allocations,
- and your system malloc for others, you can compile with
- ONLY_MSPACES and then do something like...
- static mspace mymspace = create_mspace(0,0); // for example
- #define mymalloc(bytes) mspace_malloc(mymspace, bytes)
-
- (Note: If you only need one instance of an mspace, you can instead
- use "USE_DL_PREFIX" to relabel the global malloc.)
-
- You can similarly create thread-local allocators by storing
- mspaces as thread-locals. For example:
- static __thread mspace tlms = 0;
- void* tlmalloc(size_t bytes) {
- if (tlms == 0) tlms = create_mspace(0, 0);
- return mspace_malloc(tlms, bytes);
- }
- void tlfree(void* mem) { mspace_free(tlms, mem); }
-
- Unless FOOTERS is defined, each mspace is completely independent.
- You cannot allocate from one and free to another (although
- conformance is only weakly checked, so usage errors are not always
- caught). If FOOTERS is defined, then each chunk carries around a tag
- indicating its originating mspace, and frees are directed to their
- originating spaces.
-
- ------------------------- Compile-time options ---------------------------
-
-Be careful in setting #define values for numerical constants of type
-size_t. On some systems, literal values are not automatically extended
-to size_t precision unless they are explicitly casted.
-
-WIN32 default: defined if _WIN32 defined
- Defining WIN32 sets up defaults for MS environment and compilers.
- Otherwise defaults are for unix.
-
-MALLOC_ALIGNMENT default: (size_t)8
- Controls the minimum alignment for malloc'ed chunks. It must be a
- power of two and at least 8, even on machines for which smaller
- alignments would suffice. It may be defined as larger than this
- though. Note however that code and data structures are optimized for
- the case of 8-byte alignment.
-
-MSPACES default: 0 (false)
- If true, compile in support for independent allocation spaces.
- This is only supported if HAVE_MMAP is true.
-
-ONLY_MSPACES default: 0 (false)
- If true, only compile in mspace versions, not regular versions.
-
-USE_LOCKS default: 0 (false)
- Causes each call to each public routine to be surrounded with
- pthread or WIN32 mutex lock/unlock. (If set true, this can be
- overridden on a per-mspace basis for mspace versions.)
-
-FOOTERS default: 0
- If true, provide extra checking and dispatching by placing
- information in the footers of allocated chunks. This adds
- space and time overhead.
-
-INSECURE default: 0
- If true, omit checks for usage errors and heap space overwrites.
-
-USE_DL_PREFIX default: NOT defined
- Causes compiler to prefix all public routines with the string 'dl'.
- This can be useful when you only want to use this malloc in one part
- of a program, using your regular system malloc elsewhere.
-
-ABORT default: defined as abort()
- Defines how to abort on failed checks. On most systems, a failed
- check cannot die with an "assert" or even print an informative
- message, because the underlying print routines in turn call malloc,
- which will fail again. Generally, the best policy is to simply call
- abort(). It's not very useful to do more than this because many
- errors due to overwriting will show up as address faults (null, odd
- addresses etc) rather than malloc-triggered checks, so will also
- abort. Also, most compilers know that abort() does not return, so
- can better optimize code conditionally calling it.
-
-PROCEED_ON_ERROR default: defined as 0 (false)
- Controls whether detected bad addresses cause them to bypassed
- rather than aborting. If set, detected bad arguments to free and
- realloc are ignored. And all bookkeeping information is zeroed out
- upon a detected overwrite of freed heap space, thus losing the
- ability to ever return it from malloc again, but enabling the
- application to proceed. If PROCEED_ON_ERROR is defined, the
- static variable malloc_corruption_error_count is compiled in
- and can be examined to see if errors have occurred. This option
- generates slower code than the default abort policy.
-
-DEBUG default: NOT defined
- The DEBUG setting is mainly intended for people trying to modify
- this code or diagnose problems when porting to new platforms.
- However, it may also be able to better isolate user errors than just
- using runtime checks. The assertions in the check routines spell
- out in more detail the assumptions and invariants underlying the
- algorithms. The checking is fairly extensive, and will slow down
- execution noticeably. Calling malloc_stats or mallinfo with DEBUG
- set will attempt to check every non-mmapped allocated and free chunk
- in the course of computing the summaries.
-
-ABORT_ON_ASSERT_FAILURE default: defined as 1 (true)
- Debugging assertion failures can be nearly impossible if your
- version of the assert macro causes malloc to be called, which will
- lead to a cascade of further failures, blowing the runtime stack.
- ABORT_ON_ASSERT_FAILURE cause assertions failures to call abort(),
- which will usually make debugging easier.
-
-MALLOC_FAILURE_ACTION default: sets errno to ENOMEM, or no-op on win32
- The action to take before "return 0" when malloc fails to be able to
- return memory because there is none available.
-
-HAVE_MORECORE default: 1 (true) unless win32 or ONLY_MSPACES
- True if this system supports sbrk or an emulation of it.
-
-MORECORE default: sbrk
- The name of the sbrk-style system routine to call to obtain more
- memory. See below for guidance on writing custom MORECORE
- functions. The type of the argument to sbrk/MORECORE varies across
- systems. It cannot be size_t, because it supports negative
- arguments, so it is normally the signed type of the same width as
- size_t (sometimes declared as "intptr_t"). It doesn't much matter
- though. Internally, we only call it with arguments less than half
- the max value of a size_t, which should work across all reasonable
- possibilities, although sometimes generating compiler warnings. See
- near the end of this file for guidelines for creating a custom
- version of MORECORE.
-
-MORECORE_CONTIGUOUS default: 1 (true)
- If true, take advantage of fact that consecutive calls to MORECORE
- with positive arguments always return contiguous increasing
- addresses. This is true of unix sbrk. It does not hurt too much to
- set it true anyway, since malloc copes with non-contiguities.
- Setting it false when definitely non-contiguous saves time
- and possibly wasted space it would take to discover this though.
-
-MORECORE_CANNOT_TRIM default: NOT defined
- True if MORECORE cannot release space back to the system when given
- negative arguments. This is generally necessary only if you are
- using a hand-crafted MORECORE function that cannot handle negative
- arguments.
-
-HAVE_MMAP default: 1 (true)
- True if this system supports mmap or an emulation of it. If so, and
- HAVE_MORECORE is not true, MMAP is used for all system
- allocation. If set and HAVE_MORECORE is true as well, MMAP is
- primarily used to directly allocate very large blocks. It is also
- used as a backup strategy in cases where MORECORE fails to provide
- space from system. Note: A single call to MUNMAP is assumed to be
- able to unmap memory that may have be allocated using multiple calls
- to MMAP, so long as they are adjacent.
-
-HAVE_MREMAP default: 1 on linux, else 0
- If true realloc() uses mremap() to re-allocate large blocks and
- extend or shrink allocation spaces.
-
-MMAP_CLEARS default: 1 on unix
- True if mmap clears memory so calloc doesn't need to. This is true
- for standard unix mmap using /dev/zero.
-
-USE_BUILTIN_FFS default: 0 (i.e., not used)
- Causes malloc to use the builtin ffs() function to compute indices.
- Some compilers may recognize and intrinsify ffs to be faster than the
- supplied C version. Also, the case of x86 using gcc is special-cased
- to an asm instruction, so is already as fast as it can be, and so
- this setting has no effect. (On most x86s, the asm version is only
- slightly faster than the C version.)
-
-malloc_getpagesize default: derive from system includes, or 4096.
- The system page size. To the extent possible, this malloc manages
- memory from the system in page-size units. This may be (and
- usually is) a function rather than a constant. This is ignored
- if WIN32, where page size is determined using getSystemInfo during
- initialization.
-
-USE_DEV_RANDOM default: 0 (i.e., not used)
- Causes malloc to use /dev/random to initialize secure magic seed for
- stamping footers. Otherwise, the current time is used.
-
-NO_MALLINFO default: 0
- If defined, don't compile "mallinfo". This can be a simple way
- of dealing with mismatches between system declarations and
- those in this file.
-
-MALLINFO_FIELD_TYPE default: size_t
- The type of the fields in the mallinfo struct. This was originally
- defined as "int" in SVID etc, but is more usefully defined as
- 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
- realloc(p, 0).
-
-LACKS_UNISTD_H, LACKS_FCNTL_H, LACKS_SYS_PARAM_H, LACKS_SYS_MMAN_H
-LACKS_STRINGS_H, LACKS_STRING_H, LACKS_SYS_TYPES_H, LACKS_ERRNO_H
-LACKS_STDLIB_H default: NOT defined unless on WIN32
- Define these if your system does not have these header files.
- You might need to manually insert some of the declarations they provide.
-
-DEFAULT_GRANULARITY default: page size if MORECORE_CONTIGUOUS,
- system_info.dwAllocationGranularity in WIN32,
- otherwise 64K.
- Also settable using mallopt(M_GRANULARITY, x)
- The unit for allocating and deallocating memory from the system. On
- most systems with contiguous MORECORE, there is no reason to
- make this more than a page. However, systems with MMAP tend to
- either require or encourage larger granularities. You can increase
- this value to prevent system allocation functions to be called so
- often, especially if they are slow. The value must be at least one
- page and must be a power of two. Setting to 0 causes initialization
- to either page size or win32 region size. (Note: In previous
- versions of malloc, the equivalent of this option was called
- "TOP_PAD")
-
-DEFAULT_TRIM_THRESHOLD default: 2MB
- Also settable using mallopt(M_TRIM_THRESHOLD, x)
- The maximum amount of unused top-most memory to keep before
- releasing via malloc_trim in free(). Automatic trimming is mainly
- useful in long-lived programs using contiguous MORECORE. Because
- trimming via sbrk can be slow on some systems, and can sometimes be
- wasteful (in cases where programs immediately afterward allocate
- more large chunks) the value should be high enough so that your
- overall system performance would improve by releasing this much
- memory. As a rough guide, you might set to a value close to the
- average size of a process (program) running on your system.
- Releasing this much memory would allow such a process to run in
- memory. Generally, it is worth tuning trim thresholds when a
- program undergoes phases where several large chunks are allocated
- and released in ways that can reuse each other's storage, perhaps
- mixed with phases where there are no such chunks at all. The trim
- value must be greater than page size to have any useful effect. To
- disable trimming completely, you can set to MAX_SIZE_T. Note that the trick
- some people use of mallocing a huge space and then freeing it at
- program startup, in an attempt to reserve system memory, doesn't
- have the intended effect under automatic trimming, since that memory
- will immediately be returned to the system.
-
-DEFAULT_MMAP_THRESHOLD default: 256K
- Also settable using mallopt(M_MMAP_THRESHOLD, x)
- The request size threshold for using MMAP to directly service a
- request. Requests of at least this size that cannot be allocated
- using already-existing space will be serviced via mmap. (If enough
- normal freed space already exists it is used instead.) Using mmap
- segregates relatively large chunks of memory so that they can be
- individually obtained and released from the host system. A request
- serviced through mmap is never reused by any other request (at least
- not directly; the system may just so happen to remap successive
- requests to the same locations). Segregating space in this way has
- the benefits that: Mmapped space can always be individually released
- back to the system, which helps keep the system level memory demands
- of a long-lived program low. Also, mapped memory doesn't become
- `locked' between other chunks, as can happen with normally allocated
- chunks, which means that even trimming via malloc_trim would not
- release them. However, it has the disadvantage that the space
- cannot be reclaimed, consolidated, and then used to service later
- requests, as happens with normal chunks. The advantages of mmap
- nearly always outweigh disadvantages for "large" chunks, but the
- value of "large" may vary across systems. The default is an
- empirically derived value that works well in most systems. You can
- disable mmap by setting to MAX_SIZE_T.
-
-*/
-
-#ifndef WIN32
-#ifdef _WIN32
-#define WIN32 1
-#endif /* _WIN32 */
-#endif /* WIN32 */
-#ifdef WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#define HAVE_MMAP 1
-#define HAVE_MORECORE 0
-#define LACKS_UNISTD_H
-#define LACKS_SYS_PARAM_H
-#define LACKS_SYS_MMAN_H
-#define LACKS_STRING_H
-#define LACKS_STRINGS_H
-#define LACKS_SYS_TYPES_H
-#define LACKS_ERRNO_H
-#define LACKS_FCNTL_H
-#define MALLOC_FAILURE_ACTION
-#define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */
-#endif /* WIN32 */
-
-#if defined(DARWIN) || defined(_DARWIN)
-/* Mac OSX docs advise not to use sbrk; it seems better to use mmap */
-#ifndef HAVE_MORECORE
-#define HAVE_MORECORE 0
-#define HAVE_MMAP 1
-#endif /* HAVE_MORECORE */
-#endif /* DARWIN */
-
-#ifndef LACKS_SYS_TYPES_H
-#include <sys/types.h> /* For size_t */
-#endif /* LACKS_SYS_TYPES_H */
-
-/* The maximum possible size_t value has all bits set */
-#define MAX_SIZE_T (~(size_t)0)
-
-#ifndef ONLY_MSPACES
-#define ONLY_MSPACES 0
-#endif /* ONLY_MSPACES */
-#ifndef MSPACES
-#if ONLY_MSPACES
-#define MSPACES 1
-#else /* ONLY_MSPACES */
-#define MSPACES 0
-#endif /* ONLY_MSPACES */
-#endif /* MSPACES */
-#ifndef MALLOC_ALIGNMENT
-#define MALLOC_ALIGNMENT ((size_t)8U)
-#endif /* MALLOC_ALIGNMENT */
-#ifndef FOOTERS
-#define FOOTERS 0
-#endif /* FOOTERS */
-#ifndef ABORT
-#define ABORT abort()
-#endif /* ABORT */
-#ifndef ABORT_ON_ASSERT_FAILURE
-#define ABORT_ON_ASSERT_FAILURE 1
-#endif /* ABORT_ON_ASSERT_FAILURE */
-#ifndef PROCEED_ON_ERROR
-#define PROCEED_ON_ERROR 0
-#endif /* PROCEED_ON_ERROR */
-#ifndef USE_LOCKS
-#define USE_LOCKS 0
-#endif /* USE_LOCKS */
-#ifndef INSECURE
-#define INSECURE 0
-#endif /* INSECURE */
-#ifndef HAVE_MMAP
-#define HAVE_MMAP 1
-#endif /* HAVE_MMAP */
-#ifndef MMAP_CLEARS
-#define MMAP_CLEARS 1
-#endif /* MMAP_CLEARS */
-#ifndef HAVE_MREMAP
-#ifdef linux
-#define HAVE_MREMAP 1
-#else /* linux */
-#define HAVE_MREMAP 0
-#endif /* linux */
-#endif /* HAVE_MREMAP */
-#ifndef MALLOC_FAILURE_ACTION
-#define MALLOC_FAILURE_ACTION errno = ENOMEM;
-#endif /* MALLOC_FAILURE_ACTION */
-#ifndef HAVE_MORECORE
-#if ONLY_MSPACES
-#define HAVE_MORECORE 0
-#else /* ONLY_MSPACES */
-#define HAVE_MORECORE 1
-#endif /* ONLY_MSPACES */
-#endif /* HAVE_MORECORE */
-#if !HAVE_MORECORE
-#define MORECORE_CONTIGUOUS 0
-#else /* !HAVE_MORECORE */
-#ifndef MORECORE
-#define MORECORE sbrk
-#endif /* MORECORE */
-#ifndef MORECORE_CONTIGUOUS
-#define MORECORE_CONTIGUOUS 1
-#endif /* MORECORE_CONTIGUOUS */
-#endif /* HAVE_MORECORE */
-#ifndef DEFAULT_GRANULARITY
-#if MORECORE_CONTIGUOUS
-#define DEFAULT_GRANULARITY (0) /* 0 means to compute in init_mparams */
-#else /* MORECORE_CONTIGUOUS */
-#define DEFAULT_GRANULARITY ((size_t)64U * (size_t)1024U)
-#endif /* MORECORE_CONTIGUOUS */
-#endif /* DEFAULT_GRANULARITY */
-#ifndef DEFAULT_TRIM_THRESHOLD
-#ifndef MORECORE_CANNOT_TRIM
-#define DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U)
-#else /* MORECORE_CANNOT_TRIM */
-#define DEFAULT_TRIM_THRESHOLD MAX_SIZE_T
-#endif /* MORECORE_CANNOT_TRIM */
-#endif /* DEFAULT_TRIM_THRESHOLD */
-#ifndef DEFAULT_MMAP_THRESHOLD
-#if HAVE_MMAP
-#define DEFAULT_MMAP_THRESHOLD ((size_t)256U * (size_t)1024U)
-#else /* HAVE_MMAP */
-#define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T
-#endif /* HAVE_MMAP */
-#endif /* DEFAULT_MMAP_THRESHOLD */
-#ifndef USE_BUILTIN_FFS
-#define USE_BUILTIN_FFS 0
-#endif /* USE_BUILTIN_FFS */
-#ifndef USE_DEV_RANDOM
-#define USE_DEV_RANDOM 0
-#endif /* USE_DEV_RANDOM */
-#ifndef NO_MALLINFO
-#define NO_MALLINFO 0
-#endif /* NO_MALLINFO */
-#ifndef MALLINFO_FIELD_TYPE
-#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
-
-/*
- mallopt tuning options. SVID/XPG defines four standard parameter
- numbers for mallopt, normally defined in malloc.h. None of these
- are used in this malloc, so setting them has no effect. But this
- malloc does support the following options.
-*/
-
-#define M_TRIM_THRESHOLD (-1)
-#define M_GRANULARITY (-2)
-#define M_MMAP_THRESHOLD (-3)
-
-/* ------------------------ Mallinfo declarations ------------------------ */
-
-#if !NO_MALLINFO
-/*
- This version of malloc supports the standard SVID/XPG mallinfo
- routine that returns a struct containing usage properties and
- statistics. It should work on any system that has a
- /usr/include/malloc.h defining struct mallinfo. The main
- declaration needed is the mallinfo struct that is returned (by-copy)
- by mallinfo(). The malloinfo struct contains a bunch of fields that
- are not even meaningful in this version of malloc. These fields are
- are instead filled by mallinfo() with other numbers that might be of
- interest.
-
- HAVE_USR_INCLUDE_MALLOC_H should be set if you have a
- /usr/include/malloc.h file that includes a declaration of struct
- mallinfo. If so, it is included; else a compliant version is
- declared below. These must be precisely the same for mallinfo() to
- work. The original SVID version of this struct, defined on most
- systems with mallinfo, declares all fields as ints. But some others
- define as unsigned long. If your system defines the fields using a
- type of different width than listed here, you MUST #include your
- system version and #define HAVE_USR_INCLUDE_MALLOC_H.
-*/
-
-/* #define HAVE_USR_INCLUDE_MALLOC_H */
-
-#ifdef HAVE_USR_INCLUDE_MALLOC_H
-#include "/usr/include/malloc.h"
-#else /* HAVE_USR_INCLUDE_MALLOC_H */
-
-struct mallinfo {
- MALLINFO_FIELD_TYPE arena; /* non-mmapped space allocated from system */
- MALLINFO_FIELD_TYPE ordblks; /* number of free chunks */
- MALLINFO_FIELD_TYPE smblks; /* always 0 */
- MALLINFO_FIELD_TYPE hblks; /* always 0 */
- MALLINFO_FIELD_TYPE hblkhd; /* space in mmapped regions */
- MALLINFO_FIELD_TYPE usmblks; /* maximum total allocated space */
- MALLINFO_FIELD_TYPE fsmblks; /* always 0 */
- MALLINFO_FIELD_TYPE uordblks; /* total allocated space */
- MALLINFO_FIELD_TYPE fordblks; /* total free space */
- MALLINFO_FIELD_TYPE keepcost; /* releasable (via malloc_trim) space */
-};
-
-#endif /* HAVE_USR_INCLUDE_MALLOC_H */
-#endif /* NO_MALLINFO */
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#if !ONLY_MSPACES
-
-/* ------------------- Declarations of public routines ------------------- */
-
-#ifndef USE_DL_PREFIX
-#define dlcalloc calloc
-#define dlfree free
-#define dlmalloc malloc
-#define dlmemalign memalign
-#define dlrealloc realloc
-#define dlvalloc valloc
-#define dlpvalloc pvalloc
-#define dlmallinfo mallinfo
-#define dlmallopt mallopt
-#define dlmalloc_trim malloc_trim
-#define dlmalloc_stats malloc_stats
-#define dlmalloc_usable_size malloc_usable_size
-#define dlmalloc_footprint malloc_footprint
-#define dlmalloc_max_footprint malloc_max_footprint
-#define dlindependent_calloc independent_calloc
-#define dlindependent_comalloc independent_comalloc
-#endif /* USE_DL_PREFIX */
-
-
-/*
- malloc(size_t n)
- Returns a pointer to a newly allocated chunk of at least n bytes, or
- null if no space is available, in which case errno is set to ENOMEM
- on ANSI C systems.
-
- If n is zero, malloc returns a minimum-sized chunk. (The minimum
- size is 16 bytes on most 32bit systems, and 32 bytes on 64bit
- systems.) Note that size_t is an unsigned type, so calls with
- arguments that would be negative if signed are interpreted as
- requests for huge amounts of space, which will often fail. The
- maximum supported value of n differs across systems, but is in all
- cases less than the maximum representable value of a size_t.
-*/
-void* dlmalloc(size_t);
-
-/*
- free(void* p)
- Releases the chunk of memory pointed to by p, that had been previously
- allocated using malloc or a related routine such as realloc.
- It has no effect if p is null. If p was not malloced or already
- freed, free(p) will by default cause the current program to abort.
-*/
-void dlfree(void*);
-
-/*
- calloc(size_t n_elements, size_t element_size);
- Returns a pointer to n_elements * element_size bytes, with all locations
- set to zero.
-*/
-void* dlcalloc(size_t, size_t);
-
-/*
- realloc(void* p, size_t n)
- Returns a pointer to a chunk of size n that contains the same data
- as does chunk p up to the minimum of (n, p's size) bytes, or null
- if no space is available.
-
- The returned pointer may or may not be the same as p. The algorithm
- prefers extending p in most cases when possible, otherwise it
- employs the equivalent of a malloc-copy-free sequence.
-
- If p is null, realloc is equivalent to malloc.
-
- If space is not available, realloc returns null, errno is set (if on
- ANSI) and p is NOT freed.
-
- if n is for fewer bytes than already held by p, the newly unused
- space is lopped off and freed if possible. realloc with a size
- argument of zero (re)allocates a minimum-sized chunk.
-
- The old unix realloc convention of allowing the last-free'd chunk
- to be used as an argument to realloc is not supported.
-*/
-
-void* dlrealloc(void*, size_t);
-
-/*
- memalign(size_t alignment, size_t n);
- Returns a pointer to a newly allocated chunk of n bytes, aligned
- in accord with the alignment argument.
-
- The alignment argument should be a power of two. If the argument is
- not a power of two, the nearest greater power is used.
- 8-byte alignment is guaranteed by normal malloc calls, so don't
- bother calling memalign with an argument of 8 or less.
-
- Overreliance on memalign is a sure way to fragment space.
-*/
-void* dlmemalign(size_t, size_t);
-
-/*
- valloc(size_t n);
- Equivalent to memalign(pagesize, n), where pagesize is the page
- size of the system. If the pagesize is unknown, 4096 is used.
-*/
-void* dlvalloc(size_t);
-
-/*
- mallopt(int parameter_number, int parameter_value)
- Sets tunable parameters The format is to provide a
- (parameter-number, parameter-value) pair. mallopt then sets the
- corresponding parameter to the argument value if it can (i.e., so
- long as the value is meaningful), and returns 1 if successful else
- 0. SVID/XPG/ANSI defines four standard param numbers for mallopt,
- normally defined in malloc.h. None of these are use in this malloc,
- so setting them has no effect. But this malloc also supports other
- options in mallopt. See below for details. Briefly, supported
- parameters are as follows (listed defaults are for "typical"
- configurations).
-
- Symbol param # default allowed param values
- M_TRIM_THRESHOLD -1 2*1024*1024 any (MAX_SIZE_T disables)
- M_GRANULARITY -2 page size any power of 2 >= page size
- M_MMAP_THRESHOLD -3 256*1024 any (or 0 if no MMAP support)
-*/
-int dlmallopt(int, int);
-
-/*
- malloc_footprint();
- Returns the number of bytes obtained from the system. The total
- number of bytes allocated by malloc, realloc etc., is less than this
- value. Unlike mallinfo, this function returns only a precomputed
- result, so can be called frequently to monitor memory consumption.
- Even if locks are otherwise defined, this function does not use them,
- so results might not be up to date.
-*/
-size_t dlmalloc_footprint(void);
-
-/*
- malloc_max_footprint();
- Returns the maximum number of bytes obtained from the system. This
- value will be greater than current footprint if deallocated space
- has been reclaimed by the system. The peak number of bytes allocated
- by malloc, realloc etc., is less than this value. Unlike mallinfo,
- this function returns only a precomputed result, so can be called
- frequently to monitor memory consumption. Even if locks are
- otherwise defined, this function does not use them, so results might
- not be up to date.
-*/
-size_t dlmalloc_max_footprint(void);
-
-#if !NO_MALLINFO
-/*
- mallinfo()
- Returns (by copy) a struct containing various summary statistics:
-
- arena: current total non-mmapped bytes allocated from system
- ordblks: the number of free chunks
- smblks: always zero.
- hblks: current number of mmapped regions
- hblkhd: total bytes held in mmapped regions
- usmblks: the maximum total allocated space. This will be greater
- than current total if trimming has occurred.
- fsmblks: always zero
- uordblks: current total allocated space (normal or mmapped)
- fordblks: total free space
- keepcost: the maximum number of bytes that could ideally be released
- back to system via malloc_trim. ("ideally" means that
- it ignores page restrictions etc.)
-
- Because these fields are ints, but internal bookkeeping may
- be kept as longs, the reported values may wrap around zero and
- thus be inaccurate.
-*/
-struct mallinfo dlmallinfo(void);
-#endif /* NO_MALLINFO */
-
-/*
- independent_calloc(size_t n_elements, size_t element_size, void* chunks[]);
-
- independent_calloc is similar to calloc, but instead of returning a
- single cleared space, it returns an array of pointers to n_elements
- independent elements that can hold contents of size elem_size, each
- of which starts out cleared, and can be independently freed,
- realloc'ed etc. The elements are guaranteed to be adjacently
- allocated (this is not guaranteed to occur with multiple callocs or
- mallocs), which may also improve cache locality in some
- applications.
-
- The "chunks" argument is optional (i.e., may be null, which is
- probably the most typical usage). If it is null, the returned array
- is itself dynamically allocated and should also be freed when it is
- no longer needed. Otherwise, the chunks array must be of at least
- n_elements in length. It is filled in with the pointers to the
- chunks.
-
- In either case, independent_calloc returns this pointer array, or
- null if the allocation failed. If n_elements is zero and "chunks"
- is null, it returns a chunk representing an array with zero elements
- (which should be freed if not wanted).
-
- Each element must be individually freed when it is no longer
- needed. If you'd like to instead be able to free all at once, you
- should instead use regular calloc and assign pointers into this
- space to represent elements. (In this case though, you cannot
- independently free elements.)
-
- independent_calloc simplifies and speeds up implementations of many
- kinds of pools. It may also be useful when constructing large data
- structures that initially have a fixed number of fixed-sized nodes,
- but the number is not known at compile time, and some of the nodes
- may later need to be freed. For example:
-
- struct Node { int item; struct Node* next; };
-
- struct Node* build_list() {
- struct Node** pool;
- int n = read_number_of_nodes_needed();
- if (n <= 0) return 0;
- pool = (struct Node**)(independent_calloc(n, sizeof(struct Node), 0);
- if (pool == 0) die();
- // organize into a linked list...
- struct Node* first = pool[0];
- for (i = 0; i < n-1; ++i)
- pool[i]->next = pool[i+1];
- free(pool); // Can now free the array (or not, if it is needed later)
- return first;
- }
-*/
-void** dlindependent_calloc(size_t, size_t, void**);
-
-/*
- independent_comalloc(size_t n_elements, size_t sizes[], void* chunks[]);
-
- independent_comalloc allocates, all at once, a set of n_elements
- chunks with sizes indicated in the "sizes" array. It returns
- an array of pointers to these elements, each of which can be
- independently freed, realloc'ed etc. The elements are guaranteed to
- be adjacently allocated (this is not guaranteed to occur with
- multiple callocs or mallocs), which may also improve cache locality
- in some applications.
-
- The "chunks" argument is optional (i.e., may be null). If it is null
- the returned array is itself dynamically allocated and should also
- be freed when it is no longer needed. Otherwise, the chunks array
- must be of at least n_elements in length. It is filled in with the
- pointers to the chunks.
-
- In either case, independent_comalloc returns this pointer array, or
- null if the allocation failed. If n_elements is zero and chunks is
- null, it returns a chunk representing an array with zero elements
- (which should be freed if not wanted).
-
- Each element must be individually freed when it is no longer
- needed. If you'd like to instead be able to free all at once, you
- should instead use a single regular malloc, and assign pointers at
- particular offsets in the aggregate space. (In this case though, you
- cannot independently free elements.)
-
- independent_comallac differs from independent_calloc in that each
- element may have a different size, and also that it does not
- automatically clear elements.
-
- independent_comalloc can be used to speed up allocation in cases
- where several structs or objects must always be allocated at the
- same time. For example:
-
- struct Head { ... }
- struct Foot { ... }
-
- void send_message(char* msg) {
- int msglen = strlen(msg);
- size_t sizes[3] = { sizeof(struct Head), msglen, sizeof(struct Foot) };
- void* chunks[3];
- if (independent_comalloc(3, sizes, chunks) == 0)
- die();
- struct Head* head = (struct Head*)(chunks[0]);
- char* body = (char*)(chunks[1]);
- struct Foot* foot = (struct Foot*)(chunks[2]);
- // ...
- }
-
- In general though, independent_comalloc is worth using only for
- larger values of n_elements. For small values, you probably won't
- detect enough difference from series of malloc calls to bother.
-
- Overuse of independent_comalloc can increase overall memory usage,
- since it cannot reuse existing noncontiguous small chunks that
- might be available for some of the elements.
-*/
-void** dlindependent_comalloc(size_t, size_t*, void**);
-
-
-/*
- pvalloc(size_t n);
- Equivalent to valloc(minimum-page-that-holds(n)), that is,
- round up n to nearest pagesize.
- */
-void* dlpvalloc(size_t);
-
-/*
- malloc_trim(size_t pad);
-
- If possible, gives memory back to the system (via negative arguments
- to sbrk) if there is unused memory at the `high' end of the malloc
- pool or in unused MMAP segments. You can call this after freeing
- large blocks of memory to potentially reduce the system-level memory
- requirements of a program. However, it cannot guarantee to reduce
- memory. Under some allocation patterns, some large free blocks of
- memory will be locked between two used chunks, so they cannot be
- given back to the system.
-
- The `pad' argument to malloc_trim represents the amount of free
- trailing space to leave untrimmed. If this argument is zero, only
- the minimum amount of memory to maintain internal data structures
- will be left. Non-zero arguments can be supplied to maintain enough
- trailing space to service future expected allocations without having
- to re-obtain memory from the system.
-
- Malloc_trim returns 1 if it actually released any memory, else 0.
-*/
-int dlmalloc_trim(size_t);
-
-/*
- malloc_usable_size(void* p);
-
- Returns the number of bytes you can actually use in
- an allocated chunk, which may be more than you requested (although
- often not) due to alignment and minimum size constraints.
- You can use this many bytes without worrying about
- overwriting other allocated objects. This is not a particularly great
- programming practice. malloc_usable_size can be more useful in
- debugging and assertions, for example:
-
- p = malloc(n);
- assert(malloc_usable_size(p) >= 256);
-*/
-size_t dlmalloc_usable_size(void*);
-
-/*
- malloc_stats();
- Prints on stderr the amount of space obtained from the system (both
- via sbrk and mmap), the maximum amount (which may be more than
- current if malloc_trim and/or munmap got called), and the current
- number of bytes allocated via malloc (or realloc, etc) but not yet
- freed. Note that this is the number of bytes allocated, not the
- number requested. It will be larger than the number requested
- because of alignment and bookkeeping overhead. Because it includes
- alignment wastage as being in use, this figure may be greater than
- zero even when no user-level chunks are allocated.
-
- The reported current and maximum system memory can be inaccurate if
- a program makes other calls to system memory allocation functions
- (normally sbrk) outside of malloc.
-
- malloc_stats prints only the most commonly interesting statistics.
- More information can be obtained by calling mallinfo.
-*/
-void dlmalloc_stats(void);
-
-#endif /* ONLY_MSPACES */
-
-#if MSPACES
-
-/*
- mspace is an opaque type representing an independent
- region of space that supports mspace_malloc, etc.
-*/
-typedef void* mspace;
-
-/*
- create_mspace creates and returns a new independent space with the
- given initial capacity, or, if 0, the default granularity size. It
- returns null if there is no system memory available to create the
- space. If argument locked is non-zero, the space uses a separate
- lock to control access. The capacity of the space will grow
- dynamically as needed to service mspace_malloc requests. You can
- control the sizes of incremental increases of this space by
- compiling with a different DEFAULT_GRANULARITY or dynamically
- setting with mallopt(M_GRANULARITY, value).
-*/
-mspace create_mspace(size_t capacity, int locked);
-
-/*
- destroy_mspace destroys the given space, and attempts to return all
- of its memory back to the system, returning the total number of
- bytes freed. After destruction, the results of access to all memory
- used by the space become undefined.
-*/
-size_t destroy_mspace(mspace msp);
-
-/*
- create_mspace_with_base uses the memory supplied as the initial base
- of a new mspace. Part (less than 128*sizeof(size_t) bytes) of this
- space is used for bookkeeping, so the capacity must be at least this
- large. (Otherwise 0 is returned.) When this initial space is
- exhausted, additional memory will be obtained from the system.
- Destroying this space will deallocate all additionally allocated
- space (if possible) but not the initial base.
-*/
-mspace create_mspace_with_base(void* base, size_t capacity, int locked);
-
-/*
- mspace_malloc behaves as malloc, but operates within
- the given space.
-*/
-void* mspace_malloc(mspace msp, size_t bytes);
-
-/*
- mspace_free behaves as free, but operates within
- the given space.
-
- If compiled with FOOTERS==1, mspace_free is not actually needed.
- free may be called instead of mspace_free because freed chunks from
- any space are handled by their originating spaces.
-*/
-void mspace_free(mspace msp, void* mem);
-
-/*
- mspace_realloc behaves as realloc, but operates within
- the given space.
-
- If compiled with FOOTERS==1, mspace_realloc is not actually
- needed. realloc may be called instead of mspace_realloc because
- realloced chunks from any space are handled by their originating
- spaces.
-*/
-void* mspace_realloc(mspace msp, void* mem, size_t newsize);
-
-/*
- mspace_calloc behaves as calloc, but operates within
- the given space.
-*/
-void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size);
-
-/*
- mspace_memalign behaves as memalign, but operates within
- the given space.
-*/
-void* mspace_memalign(mspace msp, size_t alignment, size_t bytes);
-
-/*
- mspace_independent_calloc behaves as independent_calloc, but
- operates within the given space.
-*/
-void** mspace_independent_calloc(mspace msp, size_t n_elements,
- size_t elem_size, void* chunks[]);
-
-/*
- mspace_independent_comalloc behaves as independent_comalloc, but
- operates within the given space.
-*/
-void** mspace_independent_comalloc(mspace msp, size_t n_elements,
- size_t sizes[], void* chunks[]);
-
-/*
- mspace_footprint() returns the number of bytes obtained from the
- system for this space.
-*/
-size_t mspace_footprint(mspace msp);
-
-/*
- mspace_max_footprint() returns the peak number of bytes obtained from the
- system for this space.
-*/
-size_t mspace_max_footprint(mspace msp);
-
-
-#if !NO_MALLINFO
-/*
- mspace_mallinfo behaves as mallinfo, but reports properties of
- the given space.
-*/
-struct mallinfo mspace_mallinfo(mspace msp);
-#endif /* NO_MALLINFO */
-
-/*
- mspace_malloc_stats behaves as malloc_stats, but reports
- properties of the given space.
-*/
-void mspace_malloc_stats(mspace msp);
-
-/*
- mspace_trim behaves as malloc_trim, but
- operates within the given space.
-*/
-int mspace_trim(mspace msp, size_t pad);
-
-/*
- An alias for mallopt.
-*/
-int mspace_mallopt(int, int);
-
-#endif /* MSPACES */
-
-#ifdef __cplusplus
-}; /* end of extern "C" */
-#endif /* __cplusplus */
-
-/*
- ========================================================================
- To make a fully customizable malloc.h header file, cut everything
- above this line, put into file malloc.h, edit to suit, and #include it
- on the next line, as well as in programs that use this malloc.
- ========================================================================
-*/
-
-/* #include "malloc.h" */
-
-/*------------------------------ internal #includes ---------------------- */
-
-#ifdef _MSC_VER
-#pragma warning( disable : 4146 ) /* no "unsigned" warnings */
-#endif /* _MSC_VER */
-
-#ifndef LACKS_STDIO_H
-#include <stdio.h> /* for printing in malloc_stats */
-#endif
-
-#ifndef LACKS_ERRNO_H
-#include <errno.h> /* for MALLOC_FAILURE_ACTION */
-#endif /* LACKS_ERRNO_H */
-#if FOOTERS
-#include <time.h> /* for magic initialization */
-#endif /* FOOTERS */
-#ifndef LACKS_STDLIB_H
-#include <stdlib.h> /* for abort() */
-#endif /* LACKS_STDLIB_H */
-#ifdef DEBUG
-#if ABORT_ON_ASSERT_FAILURE
-#define assert(x) if(!(x)) ABORT
-#else /* ABORT_ON_ASSERT_FAILURE */
-#include <assert.h>
-#endif /* ABORT_ON_ASSERT_FAILURE */
-#else /* DEBUG */
-#define assert(x)
-#endif /* DEBUG */
-#ifndef LACKS_STRING_H
-#include <string.h> /* for memset etc */
-#endif /* LACKS_STRING_H */
-#if USE_BUILTIN_FFS
-#ifndef LACKS_STRINGS_H
-#include <strings.h> /* for ffs */
-#endif /* LACKS_STRINGS_H */
-#endif /* USE_BUILTIN_FFS */
-#if HAVE_MMAP
-#ifndef LACKS_SYS_MMAN_H
-#include <sys/mman.h> /* for mmap */
-#endif /* LACKS_SYS_MMAN_H */
-#ifndef LACKS_FCNTL_H
-#include <fcntl.h>
-#endif /* LACKS_FCNTL_H */
-#endif /* HAVE_MMAP */
-#if HAVE_MORECORE
-#ifndef LACKS_UNISTD_H
-#include <unistd.h> /* for sbrk */
-#else /* LACKS_UNISTD_H */
-#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
-extern void* sbrk(ptrdiff_t);
-#endif /* FreeBSD etc */
-#endif /* LACKS_UNISTD_H */
-#endif /* HAVE_MMAP */
-
-#ifndef WIN32
-#ifndef malloc_getpagesize
-# ifdef _SC_PAGESIZE /* some SVR4 systems omit an underscore */
-# ifndef _SC_PAGE_SIZE
-# define _SC_PAGE_SIZE _SC_PAGESIZE
-# endif
-# endif
-# ifdef _SC_PAGE_SIZE
-# define malloc_getpagesize sysconf(_SC_PAGE_SIZE)
-# else
-# if defined(BSD) || defined(DGUX) || defined(HAVE_GETPAGESIZE)
- extern size_t getpagesize();
-# define malloc_getpagesize getpagesize()
-# else
-# ifdef WIN32 /* use supplied emulation of getpagesize */
-# define malloc_getpagesize getpagesize()
-# else
-# ifndef LACKS_SYS_PARAM_H
-# include <sys/param.h>
-# endif
-# ifdef EXEC_PAGESIZE
-# define malloc_getpagesize EXEC_PAGESIZE
-# else
-# ifdef NBPG
-# ifndef CLSIZE
-# define malloc_getpagesize NBPG
-# else
-# define malloc_getpagesize (NBPG * CLSIZE)
-# endif
-# else
-# ifdef NBPC
-# define malloc_getpagesize NBPC
-# else
-# ifdef PAGESIZE
-# define malloc_getpagesize PAGESIZE
-# else /* just guess */
-# define malloc_getpagesize ((size_t)4096U)
-# endif
-# endif
-# endif
-# endif
-# endif
-# endif
-# endif
-#endif
-#endif
-
-/* ------------------- size_t and alignment properties -------------------- */
-
-/* The byte and bit size of a size_t */
-#define SIZE_T_SIZE (sizeof(size_t))
-#define SIZE_T_BITSIZE (sizeof(size_t) << 3)
-
-/* Some constants coerced to size_t */
-/* Annoying but necessary to avoid errors on some plaftorms */
-#define SIZE_T_ZERO ((size_t)0)
-#define SIZE_T_ONE ((size_t)1)
-#define SIZE_T_TWO ((size_t)2)
-#define TWO_SIZE_T_SIZES (SIZE_T_SIZE<<1)
-#define FOUR_SIZE_T_SIZES (SIZE_T_SIZE<<2)
-#define SIX_SIZE_T_SIZES (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES)
-#define HALF_MAX_SIZE_T (MAX_SIZE_T / 2U)
-
-/* The bit mask value corresponding to MALLOC_ALIGNMENT */
-#define CHUNK_ALIGN_MASK (MALLOC_ALIGNMENT - SIZE_T_ONE)
-
-/* True if address a has acceptable alignment */
-#define is_aligned(A) (((size_t)((A)) & (CHUNK_ALIGN_MASK)) == 0)
-
-/* the number of bytes to offset an address to align it */
-#define align_offset(A)\
- ((((size_t)(A) & CHUNK_ALIGN_MASK) == 0)? 0 :\
- ((MALLOC_ALIGNMENT - ((size_t)(A) & CHUNK_ALIGN_MASK)) & CHUNK_ALIGN_MASK))
-
-/* -------------------------- MMAP preliminaries ------------------------- */
-
-/*
- If HAVE_MORECORE or HAVE_MMAP are false, we just define calls and
- checks to fail so compiler optimizer can delete code rather than
- using so many "#if"s.
-*/
-
-
-/* MORECORE and MMAP must return MFAIL on failure */
-#define MFAIL ((void*)(MAX_SIZE_T))
-#define CMFAIL ((char*)(MFAIL)) /* defined for convenience */
-
-#if !HAVE_MMAP
-#define IS_MMAPPED_BIT (SIZE_T_ZERO)
-#define USE_MMAP_BIT (SIZE_T_ZERO)
-#define CALL_MMAP(s) MFAIL
-#define CALL_MUNMAP(a, s) (-1)
-#define DIRECT_MMAP(s) MFAIL
-
-#else /* HAVE_MMAP */
-#define IS_MMAPPED_BIT (SIZE_T_ONE)
-#define USE_MMAP_BIT (SIZE_T_ONE)
-
-#ifndef WIN32
-#define CALL_MUNMAP(a, s) munmap((a), (s))
-#define MMAP_PROT (PROT_READ|PROT_WRITE)
-#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
-#define MAP_ANONYMOUS MAP_ANON
-#endif /* MAP_ANON */
-#ifdef MAP_ANONYMOUS
-#define MMAP_FLAGS (MAP_PRIVATE|MAP_ANONYMOUS)
-#define CALL_MMAP(s) mmap(0, (s), MMAP_PROT, MMAP_FLAGS, -1, 0)
-#else /* MAP_ANONYMOUS */
-/*
- Nearly all versions of mmap support MAP_ANONYMOUS, so the following
- is unlikely to be needed, but is supplied just in case.
-*/
-#define MMAP_FLAGS (MAP_PRIVATE)
-static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */
-#define CALL_MMAP(s) ((dev_zero_fd < 0) ? \
- (dev_zero_fd = open("/dev/zero", O_RDWR), \
- mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0)) : \
- mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0))
-#endif /* MAP_ANONYMOUS */
-
-#define DIRECT_MMAP(s) CALL_MMAP(s)
-#else /* WIN32 */
-
-/* Win32 MMAP via VirtualAlloc */
-static void* win32mmap(size_t size) {
- void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE);
- return (ptr != 0)? ptr: MFAIL;
-}
-
-/* For direct MMAP, use MEM_TOP_DOWN to minimize interference */
-static void* win32direct_mmap(size_t size) {
- void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN,
- PAGE_READWRITE);
- return (ptr != 0)? ptr: MFAIL;
-}
-
-/* This function supports releasing coalesed segments */
-static int win32munmap(void* ptr, size_t size) {
- MEMORY_BASIC_INFORMATION minfo;
- char* cptr = ptr;
- while (size) {
- if (VirtualQuery(cptr, &minfo, sizeof(minfo)) == 0)
- return -1;
- if (minfo.BaseAddress != cptr || minfo.AllocationBase != cptr ||
- minfo.State != MEM_COMMIT || minfo.RegionSize > size)
- return -1;
- if (VirtualFree(cptr, 0, MEM_RELEASE) == 0)
- return -1;
- cptr += minfo.RegionSize;
- size -= minfo.RegionSize;
- }
- return 0;
-}
-
-#define CALL_MMAP(s) win32mmap(s)
-#define CALL_MUNMAP(a, s) win32munmap((a), (s))
-#define DIRECT_MMAP(s) win32direct_mmap(s)
-#endif /* WIN32 */
-#endif /* HAVE_MMAP */
-
-#if HAVE_MMAP && HAVE_MREMAP
-#define CALL_MREMAP(addr, osz, nsz, mv) mremap((addr), (osz), (nsz), (mv))
-#else /* HAVE_MMAP && HAVE_MREMAP */
-#define CALL_MREMAP(addr, osz, nsz, mv) MFAIL
-#endif /* HAVE_MMAP && HAVE_MREMAP */
-
-#if HAVE_MORECORE
-#define CALL_MORECORE(S) MORECORE(S)
-#else /* HAVE_MORECORE */
-#define CALL_MORECORE(S) MFAIL
-#endif /* HAVE_MORECORE */
-
-/* mstate bit set if continguous morecore disabled or failed */
-#define USE_NONCONTIGUOUS_BIT (4U)
-
-/* segment bit set in create_mspace_with_base */
-#define EXTERN_BIT (8U)
-
-
-/* --------------------------- Lock preliminaries ------------------------ */
-
-#if USE_LOCKS
-
-/*
- When locks are defined, there are up to two global locks:
-
- * If HAVE_MORECORE, morecore_mutex protects sequences of calls to
- MORECORE. In many cases sys_alloc requires two calls, that should
- not be interleaved with calls by other threads. This does not
- protect against direct calls to MORECORE by other threads not
- using this lock, so there is still code to cope the best we can on
- interference.
-
- * magic_init_mutex ensures that mparams.magic and other
- unique mparams values are initialized only once.
-*/
-
-#ifndef WIN32
-/* By default use posix locks */
-#include <pthread.h>
-#define MLOCK_T pthread_mutex_t
-#define INITIAL_LOCK(l) pthread_mutex_init(l, NULL)
-#define ACQUIRE_LOCK(l) pthread_mutex_lock(l)
-#define RELEASE_LOCK(l) pthread_mutex_unlock(l)
-
-#if HAVE_MORECORE
-static MLOCK_T morecore_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* HAVE_MORECORE */
-
-static MLOCK_T magic_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-#else /* WIN32 */
-/*
- Because lock-protected regions have bounded times, and there
- are no recursive lock calls, we can use simple spinlocks.
-*/
-
-#define MLOCK_T long
-static int win32_acquire_lock (MLOCK_T *sl) {
- for (;;) {
-#ifdef InterlockedCompareExchangePointer
- if (!InterlockedCompareExchange(sl, 1, 0))
- return 0;
-#else /* Use older void* version */
- if (!InterlockedCompareExchange((void**)sl, (void*)1, (void*)0))
- return 0;
-#endif /* InterlockedCompareExchangePointer */
- Sleep (0);
- }
-}
-
-static void win32_release_lock (MLOCK_T *sl) {
- InterlockedExchange (sl, 0);
-}
-
-#define INITIAL_LOCK(l) *(l)=0
-#define ACQUIRE_LOCK(l) win32_acquire_lock(l)
-#define RELEASE_LOCK(l) win32_release_lock(l)
-#if HAVE_MORECORE
-static MLOCK_T morecore_mutex;
-#endif /* HAVE_MORECORE */
-static MLOCK_T magic_init_mutex;
-#endif /* WIN32 */
-
-#define USE_LOCK_BIT (2U)
-#else /* USE_LOCKS */
-#define USE_LOCK_BIT (0U)
-#define INITIAL_LOCK(l)
-#endif /* USE_LOCKS */
-
-#if USE_LOCKS && HAVE_MORECORE
-#define ACQUIRE_MORECORE_LOCK() ACQUIRE_LOCK(&morecore_mutex);
-#define RELEASE_MORECORE_LOCK() RELEASE_LOCK(&morecore_mutex);
-#else /* USE_LOCKS && HAVE_MORECORE */
-#define ACQUIRE_MORECORE_LOCK()
-#define RELEASE_MORECORE_LOCK()
-#endif /* USE_LOCKS && HAVE_MORECORE */
-
-#if USE_LOCKS
-#define ACQUIRE_MAGIC_INIT_LOCK() ACQUIRE_LOCK(&magic_init_mutex);
-#define RELEASE_MAGIC_INIT_LOCK() RELEASE_LOCK(&magic_init_mutex);
-#else /* USE_LOCKS */
-#define ACQUIRE_MAGIC_INIT_LOCK()
-#define RELEASE_MAGIC_INIT_LOCK()
-#endif /* USE_LOCKS */
-
-
-/* ----------------------- Chunk representations ------------------------ */
-
-/*
- (The following includes lightly edited explanations by Colin Plumb.)
-
- The malloc_chunk declaration below is misleading (but accurate and
- necessary). It declares a "view" into memory allowing access to
- necessary fields at known offsets from a given base.
-
- Chunks of memory are maintained using a `boundary tag' method as
- originally described by Knuth. (See the paper by Paul Wilson
- ftp://ftp.cs.utexas.edu/pub/garbage/allocsrv.ps for a survey of such
- techniques.) Sizes of free chunks are stored both in the front of
- each chunk and at the end. This makes consolidating fragmented
- chunks into bigger chunks fast. The head fields also hold bits
- representing whether chunks are free or in use.
-
- Here are some pictures to make it clearer. They are "exploded" to
- show that the state of a chunk can be thought of as extending from
- the high 31 bits of the head field of its header through the
- prev_foot and PINUSE_BIT bit of the following chunk header.
-
- A chunk that's in use looks like:
-
- chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Size of previous chunk (if P = 1) |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P|
- | Size of this chunk 1| +-+
- mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | |
- +- -+
- | |
- +- -+
- | :
- +- size - sizeof(size_t) available payload bytes -+
- : |
- chunk-> +- -+
- | |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |1|
- | Size of next chunk (may or may not be in use) | +-+
- mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
- And if it's free, it looks like this:
-
- chunk-> +- -+
- | User payload (must be in use, or we would have merged!) |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P|
- | Size of this chunk 0| +-+
- mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Next pointer |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Prev pointer |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | :
- +- size - sizeof(struct chunk) unused bytes -+
- : |
- chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Size of this chunk |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0|
- | Size of next chunk (must be in use, or we would have merged)| +-+
- mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | :
- +- User payload -+
- : |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |0|
- +-+
- Note that since we always merge adjacent free chunks, the chunks
- adjacent to a free chunk must be in use.
-
- Given a pointer to a chunk (which can be derived trivially from the
- payload pointer) we can, in O(1) time, find out whether the adjacent
- chunks are free, and if so, unlink them from the lists that they
- are on and merge them with the current chunk.
-
- Chunks always begin on even word boundaries, so the mem portion
- (which is returned to the user) is also on an even word boundary, and
- thus at least double-word aligned.
-
- The P (PINUSE_BIT) bit, stored in the unused low-order bit of the
- chunk size (which is always a multiple of two words), is an in-use
- bit for the *previous* chunk. If that bit is *clear*, then the
- word before the current chunk size contains the previous chunk
- size, and can be used to find the front of the previous chunk.
- The very first chunk allocated always has this bit set, preventing
- access to non-existent (or non-owned) memory. If pinuse is set for
- any given chunk, then you CANNOT determine the size of the
- previous chunk, and might even get a memory addressing fault when
- trying to do so.
-
- The C (CINUSE_BIT) bit, stored in the unused second-lowest bit of
- the chunk size redundantly records whether the current chunk is
- inuse. This redundancy enables usage checks within free and realloc,
- and reduces indirection when freeing and consolidating chunks.
-
- Each freshly allocated chunk must have both cinuse and pinuse set.
- That is, each allocated chunk borders either a previously allocated
- and still in-use chunk, or the base of its memory arena. This is
- ensured by making all allocations from the the `lowest' part of any
- found chunk. Further, no free chunk physically borders another one,
- so each free chunk is known to be preceded and followed by either
- inuse chunks or the ends of memory.
-
- Note that the `foot' of the current chunk is actually represented
- as the prev_foot of the NEXT chunk. This makes it easier to
- deal with alignments etc but can be very confusing when trying
- to extend or adapt this code.
-
- The exceptions to all this are
-
- 1. The special chunk `top' is the top-most available chunk (i.e.,
- the one bordering the end of available memory). It is treated
- specially. Top is never included in any bin, is used only if
- no other chunk is available, and is released back to the
- system if it is very large (see M_TRIM_THRESHOLD). In effect,
- the top chunk is treated as larger (and thus less well
- fitting) than any other available chunk. The top chunk
- doesn't update its trailing size field since there is no next
- contiguous chunk that would have to index off it. However,
- space is still allocated for it (TOP_FOOT_SIZE) to enable
- separation or merging when space is extended.
-
- 3. Chunks allocated via mmap, which have the lowest-order bit
- (IS_MMAPPED_BIT) set in their prev_foot fields, and do not set
- PINUSE_BIT in their head fields. Because they are allocated
- one-by-one, each must carry its own prev_foot field, which is
- also used to hold the offset this chunk has within its mmapped
- region, which is needed to preserve alignment. Each mmapped
- chunk is trailed by the first two fields of a fake next-chunk
- for sake of usage checks.
-
-*/
-
-struct malloc_chunk {
- size_t prev_foot; /* Size of previous chunk (if free). */
- size_t head; /* Size and inuse bits. */
- struct malloc_chunk* fd; /* double links -- used only if free. */
- struct malloc_chunk* bk;
-};
-
-typedef struct malloc_chunk mchunk;
-typedef struct malloc_chunk* mchunkptr;
-typedef struct malloc_chunk* sbinptr; /* The type of bins of chunks */
-typedef size_t bindex_t; /* Described below */
-typedef unsigned int binmap_t; /* Described below */
-typedef unsigned int flag_t; /* The type of various bit flag sets */
-
-/* ------------------- Chunks sizes and alignments ----------------------- */
-
-#define MCHUNK_SIZE (sizeof(mchunk))
-
-#if FOOTERS
-#define CHUNK_OVERHEAD (TWO_SIZE_T_SIZES)
-#else /* FOOTERS */
-#define CHUNK_OVERHEAD (SIZE_T_SIZE)
-#endif /* FOOTERS */
-
-/* MMapped chunks need a second word of overhead ... */
-#define MMAP_CHUNK_OVERHEAD (TWO_SIZE_T_SIZES)
-/* ... and additional padding for fake next-chunk at foot */
-#define MMAP_FOOT_PAD (FOUR_SIZE_T_SIZES)
-
-/* The smallest size we can malloc is an aligned minimal chunk */
-#define MIN_CHUNK_SIZE\
- ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK)
-
-/* conversion from malloc headers to user pointers, and back */
-#define chunk2mem(p) ((void*)((char*)(p) + TWO_SIZE_T_SIZES))
-#define mem2chunk(mem) ((mchunkptr)((char*)(mem) - TWO_SIZE_T_SIZES))
-/* chunk associated with aligned address A */
-#define align_as_chunk(A) (mchunkptr)((A) + align_offset(chunk2mem(A)))
-
-/* Bounds on request (not chunk) sizes. */
-#define MAX_REQUEST ((-MIN_CHUNK_SIZE) << 2)
-#define MIN_REQUEST (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE)
-
-/* pad request bytes into a usable size */
-#define pad_request(req) \
- (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK)
-
-/* pad request, checking for minimum (but not maximum) */
-#define request2size(req) \
- (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req))
-
-
-/* ------------------ Operations on head and foot fields ----------------- */
-
-/*
- The head field of a chunk is or'ed with PINUSE_BIT when previous
- adjacent chunk in use, and or'ed with CINUSE_BIT if this chunk is in
- use. If the chunk was obtained with mmap, the prev_foot field has
- IS_MMAPPED_BIT set, otherwise holding the offset of the base of the
- mmapped region to the base of the chunk.
-*/
-
-#define PINUSE_BIT (SIZE_T_ONE)
-#define CINUSE_BIT (SIZE_T_TWO)
-#define INUSE_BITS (PINUSE_BIT|CINUSE_BIT)
-
-/* Head value for fenceposts */
-#define FENCEPOST_HEAD (INUSE_BITS|SIZE_T_SIZE)
-
-/* extraction of fields from head words */
-#define cinuse(p) ((p)->head & CINUSE_BIT)
-#define pinuse(p) ((p)->head & PINUSE_BIT)
-#define chunksize(p) ((p)->head & ~(INUSE_BITS))
-
-#define clear_pinuse(p) ((p)->head &= ~PINUSE_BIT)
-#define clear_cinuse(p) ((p)->head &= ~CINUSE_BIT)
-
-/* Treat space at ptr +/- offset as a chunk */
-#define chunk_plus_offset(p, s) ((mchunkptr)(((char*)(p)) + (s)))
-#define chunk_minus_offset(p, s) ((mchunkptr)(((char*)(p)) - (s)))
-
-/* Ptr to next or previous physical malloc_chunk. */
-#define next_chunk(p) ((mchunkptr)( ((char*)(p)) + ((p)->head & ~INUSE_BITS)))
-#define prev_chunk(p) ((mchunkptr)( ((char*)(p)) - ((p)->prev_foot) ))
-
-/* extract next chunk's pinuse bit */
-#define next_pinuse(p) ((next_chunk(p)->head) & PINUSE_BIT)
-
-/* Get/set size at footer */
-#define get_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot)
-#define set_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot = (s))
-
-/* Set size, pinuse bit, and foot */
-#define set_size_and_pinuse_of_free_chunk(p, s)\
- ((p)->head = (s|PINUSE_BIT), set_foot(p, s))
-
-/* Set size, pinuse bit, foot, and clear next pinuse */
-#define set_free_with_pinuse(p, s, n)\
- (clear_pinuse(n), set_size_and_pinuse_of_free_chunk(p, s))
-
-#define is_mmapped(p)\
- (!((p)->head & PINUSE_BIT) && ((p)->prev_foot & IS_MMAPPED_BIT))
-
-/* Get the internal overhead associated with chunk p */
-#define overhead_for(p)\
- (is_mmapped(p)? MMAP_CHUNK_OVERHEAD : CHUNK_OVERHEAD)
-
-/* Return true if malloced space is not necessarily cleared */
-#if MMAP_CLEARS
-#define calloc_must_clear(p) (!is_mmapped(p))
-#else /* MMAP_CLEARS */
-#define calloc_must_clear(p) (1)
-#endif /* MMAP_CLEARS */
-
-/* ---------------------- Overlaid data structures ----------------------- */
-
-/*
- When chunks are not in use, they are treated as nodes of either
- lists or trees.
-
- "Small" chunks are stored in circular doubly-linked lists, and look
- like this:
-
- chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Size of previous chunk |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- `head:' | Size of chunk, in bytes |P|
- mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Forward pointer to next chunk in list |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Back pointer to previous chunk in list |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Unused space (may be 0 bytes long) .
- . .
- . |
-nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- `foot:' | Size of chunk, in bytes |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
- Larger chunks are kept in a form of bitwise digital trees (aka
- tries) keyed on chunksizes. Because malloc_tree_chunks are only for
- free chunks greater than 256 bytes, their size doesn't impose any
- constraints on user chunk sizes. Each node looks like:
-
- chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Size of previous chunk |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- `head:' | Size of chunk, in bytes |P|
- mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Forward pointer to next chunk of same size |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Back pointer to previous chunk of same size |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Pointer to left child (child[0]) |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Pointer to right child (child[1]) |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Pointer to parent |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | bin index of this chunk |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Unused space .
- . |
-nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- `foot:' | Size of chunk, in bytes |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
- Each tree holding treenodes is a tree of unique chunk sizes. Chunks
- of the same size are arranged in a circularly-linked list, with only
- the oldest chunk (the next to be used, in our FIFO ordering)
- actually in the tree. (Tree members are distinguished by a non-null
- parent pointer.) If a chunk with the same size an an existing node
- is inserted, it is linked off the existing node using pointers that
- work in the same way as fd/bk pointers of small chunks.
-
- Each tree contains a power of 2 sized range of chunk sizes (the
- smallest is 0x100 <= x < 0x180), which is is divided in half at each
- tree level, with the chunks in the smaller half of the range (0x100
- <= x < 0x140 for the top nose) in the left subtree and the larger
- half (0x140 <= x < 0x180) in the right subtree. This is, of course,
- done by inspecting individual bits.
-
- Using these rules, each node's left subtree contains all smaller
- sizes than its right subtree. However, the node at the root of each
- subtree has no particular ordering relationship to either. (The
- dividing line between the subtree sizes is based on trie relation.)
- If we remove the last chunk of a given size from the interior of the
- tree, we need to replace it with a leaf node. The tree ordering
- rules permit a node to be replaced by any leaf below it.
-
- The smallest chunk in a tree (a common operation in a best-fit
- allocator) can be found by walking a path to the leftmost leaf in
- the tree. Unlike a usual binary tree, where we follow left child
- pointers until we reach a null, here we follow the right child
- pointer any time the left one is null, until we reach a leaf with
- both child pointers null. The smallest chunk in the tree will be
- somewhere along that path.
-
- The worst case number of steps to add, find, or remove a node is
- bounded by the number of bits differentiating chunks within
- bins. Under current bin calculations, this ranges from 6 up to 21
- (for 32 bit sizes) or up to 53 (for 64 bit sizes). The typical case
- is of course much better.
-*/
-
-struct malloc_tree_chunk {
- /* The first four fields must be compatible with malloc_chunk */
- size_t prev_foot;
- size_t head;
- struct malloc_tree_chunk* fd;
- struct malloc_tree_chunk* bk;
-
- struct malloc_tree_chunk* child[2];
- struct malloc_tree_chunk* parent;
- bindex_t index;
-};
-
-typedef struct malloc_tree_chunk tchunk;
-typedef struct malloc_tree_chunk* tchunkptr;
-typedef struct malloc_tree_chunk* tbinptr; /* The type of bins of trees */
-
-/* A little helper macro for trees */
-#define leftmost_child(t) ((t)->child[0] != 0? (t)->child[0] : (t)->child[1])
-
-/* ----------------------------- Segments -------------------------------- */
-
-/*
- Each malloc space may include non-contiguous segments, held in a
- list headed by an embedded malloc_segment record representing the
- top-most space. Segments also include flags holding properties of
- the space. Large chunks that are directly allocated by mmap are not
- included in this list. They are instead independently created and
- destroyed without otherwise keeping track of them.
-
- Segment management mainly comes into play for spaces allocated by
- MMAP. Any call to MMAP might or might not return memory that is
- adjacent to an existing segment. MORECORE normally contiguously
- extends the current space, so this space is almost always adjacent,
- which is simpler and faster to deal with. (This is why MORECORE is
- used preferentially to MMAP when both are available -- see
- sys_alloc.) When allocating using MMAP, we don't use any of the
- hinting mechanisms (inconsistently) supported in various
- implementations of unix mmap, or distinguish reserving from
- committing memory. Instead, we just ask for space, and exploit
- contiguity when we get it. It is probably possible to do
- better than this on some systems, but no general scheme seems
- to be significantly better.
-
- Management entails a simpler variant of the consolidation scheme
- used for chunks to reduce fragmentation -- new adjacent memory is
- normally prepended or appended to an existing segment. However,
- there are limitations compared to chunk consolidation that mostly
- reflect the fact that segment processing is relatively infrequent
- (occurring only when getting memory from system) and that we
- don't expect to have huge numbers of segments:
-
- * Segments are not indexed, so traversal requires linear scans. (It
- would be possible to index these, but is not worth the extra
- overhead and complexity for most programs on most platforms.)
- * New segments are only appended to old ones when holding top-most
- memory; if they cannot be prepended to others, they are held in
- different segments.
-
- Except for the top-most segment of an mstate, each segment record
- is kept at the tail of its segment. Segments are added by pushing
- segment records onto the list headed by &mstate.seg for the
- containing mstate.
-
- Segment flags control allocation/merge/deallocation policies:
- * If EXTERN_BIT set, then we did not allocate this segment,
- and so should not try to deallocate or merge with others.
- (This currently holds only for the initial segment passed
- into create_mspace_with_base.)
- * If IS_MMAPPED_BIT set, the segment may be merged with
- other surrounding mmapped segments and trimmed/de-allocated
- using munmap.
- * If neither bit is set, then the segment was obtained using
- MORECORE so can be merged with surrounding MORECORE'd segments
- and deallocated/trimmed using MORECORE with negative arguments.
-*/
-
-struct malloc_segment {
- char* base; /* base address */
- size_t size; /* allocated size */
- struct malloc_segment* next; /* ptr to next segment */
- flag_t sflags; /* mmap and extern flag */
-};
-
-#define is_mmapped_segment(S) ((S)->sflags & IS_MMAPPED_BIT)
-#define is_extern_segment(S) ((S)->sflags & EXTERN_BIT)
-
-typedef struct malloc_segment msegment;
-typedef struct malloc_segment* msegmentptr;
-
-/* ---------------------------- malloc_state ----------------------------- */
-
-/*
- A malloc_state holds all of the bookkeeping for a space.
- The main fields are:
-
- Top
- The topmost chunk of the currently active segment. Its size is
- cached in topsize. The actual size of topmost space is
- topsize+TOP_FOOT_SIZE, which includes space reserved for adding
- fenceposts and segment records if necessary when getting more
- space from the system. The size at which to autotrim top is
- cached from mparams in trim_check, except that it is disabled if
- an autotrim fails.
-
- Designated victim (dv)
- This is the preferred chunk for servicing small requests that
- don't have exact fits. It is normally the chunk split off most
- recently to service another small request. Its size is cached in
- dvsize. The link fields of this chunk are not maintained since it
- is not kept in a bin.
-
- SmallBins
- An array of bin headers for free chunks. These bins hold chunks
- with sizes less than MIN_LARGE_SIZE bytes. Each bin contains
- chunks of all the same size, spaced 8 bytes apart. To simplify
- use in double-linked lists, each bin header acts as a malloc_chunk
- pointing to the real first node, if it exists (else pointing to
- itself). This avoids special-casing for headers. But to avoid
- waste, we allocate only the fd/bk pointers of bins, and then use
- repositioning tricks to treat these as the fields of a chunk.
-
- TreeBins
- Treebins are pointers to the roots of trees holding a range of
- sizes. There are 2 equally spaced treebins for each power of two
- from TREE_SHIFT to TREE_SHIFT+16. The last bin holds anything
- larger.
-
- Bin maps
- There is one bit map for small bins ("smallmap") and one for
- treebins ("treemap). Each bin sets its bit when non-empty, and
- clears the bit when empty. Bit operations are then used to avoid
- bin-by-bin searching -- nearly all "search" is done without ever
- looking at bins that won't be selected. The bit maps
- conservatively use 32 bits per map word, even if on 64bit system.
- For a good description of some of the bit-based techniques used
- here, see Henry S. Warren Jr's book "Hacker's Delight" (and
- supplement at http://hackersdelight.org/). Many of these are
- intended to reduce the branchiness of paths through malloc etc, as
- well as to reduce the number of memory locations read or written.
-
- Segments
- A list of segments headed by an embedded malloc_segment record
- representing the initial space.
-
- Address check support
- The least_addr field is the least address ever obtained from
- MORECORE or MMAP. Attempted frees and reallocs of any address less
- than this are trapped (unless INSECURE is defined).
-
- Magic tag
- A cross-check field that should always hold same value as mparams.magic.
-
- Flags
- Bits recording whether to use MMAP, locks, or contiguous MORECORE
-
- Statistics
- Each space keeps track of current and maximum system memory
- obtained via MORECORE or MMAP.
-
- Locking
- If USE_LOCKS is defined, the "mutex" lock is acquired and released
- around every public call using this mspace.
-*/
-
-/* Bin types, widths and sizes */
-#define NSMALLBINS (32U)
-#define NTREEBINS (32U)
-#define SMALLBIN_SHIFT (3U)
-#define SMALLBIN_WIDTH (SIZE_T_ONE << SMALLBIN_SHIFT)
-#define TREEBIN_SHIFT (8U)
-#define MIN_LARGE_SIZE (SIZE_T_ONE << TREEBIN_SHIFT)
-#define MAX_SMALL_SIZE (MIN_LARGE_SIZE - SIZE_T_ONE)
-#define MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD)
-
-struct malloc_state {
- binmap_t smallmap;
- binmap_t treemap;
- size_t dvsize;
- size_t topsize;
- char* least_addr;
- mchunkptr dv;
- mchunkptr top;
- size_t trim_check;
- size_t magic;
- mchunkptr smallbins[(NSMALLBINS+1)*2];
- tbinptr treebins[NTREEBINS];
- size_t footprint;
- size_t max_footprint;
- flag_t mflags;
-#if USE_LOCKS
- MLOCK_T mutex; /* locate lock among fields that rarely change */
-#endif /* USE_LOCKS */
- msegment seg;
-};
-
-typedef struct malloc_state* mstate;
-
-/* ------------- Global malloc_state and malloc_params ------------------- */
-
-/*
- malloc_params holds global properties, including those that can be
- dynamically set using mallopt. There is a single instance, mparams,
- initialized in init_mparams.
-*/
-
-struct malloc_params {
- size_t magic;
- size_t page_size;
- size_t granularity;
- size_t mmap_threshold;
- size_t trim_threshold;
- flag_t default_mflags;
-};
-
-static struct malloc_params mparams;
-
-/* The global malloc_state used for all non-"mspace" calls */
-static struct malloc_state _gm_;
-#define gm (&_gm_)
-#define is_global(M) ((M) == &_gm_)
-#define is_initialized(M) ((M)->top != 0)
-
-/* -------------------------- system alloc setup ------------------------- */
-
-/* Operations on mflags */
-
-#define use_lock(M) ((M)->mflags & USE_LOCK_BIT)
-#define enable_lock(M) ((M)->mflags |= USE_LOCK_BIT)
-#define disable_lock(M) ((M)->mflags &= ~USE_LOCK_BIT)
-
-#define use_mmap(M) ((M)->mflags & USE_MMAP_BIT)
-#define enable_mmap(M) ((M)->mflags |= USE_MMAP_BIT)
-#define disable_mmap(M) ((M)->mflags &= ~USE_MMAP_BIT)
-
-#define use_noncontiguous(M) ((M)->mflags & USE_NONCONTIGUOUS_BIT)
-#define disable_contiguous(M) ((M)->mflags |= USE_NONCONTIGUOUS_BIT)
-
-#define set_lock(M,L)\
- ((M)->mflags = (L)?\
- ((M)->mflags | USE_LOCK_BIT) :\
- ((M)->mflags & ~USE_LOCK_BIT))
-
-/* page-align a size */
-#define page_align(S)\
- (((S) + (mparams.page_size)) & ~(mparams.page_size - SIZE_T_ONE))
-
-/* granularity-align a size */
-#define granularity_align(S)\
- (((S) + (mparams.granularity)) & ~(mparams.granularity - SIZE_T_ONE))
-
-#define is_page_aligned(S)\
- (((size_t)(S) & (mparams.page_size - SIZE_T_ONE)) == 0)
-#define is_granularity_aligned(S)\
- (((size_t)(S) & (mparams.granularity - SIZE_T_ONE)) == 0)
-
-/* True if segment S holds address A */
-#define segment_holds(S, A)\
- ((char*)(A) >= S->base && (char*)(A) < S->base + S->size)
-
-/* Return segment holding given address */
-static msegmentptr segment_holding(mstate m, char* addr) {
- msegmentptr sp = &m->seg;
- for (;;) {
- if (addr >= sp->base && addr < sp->base + sp->size)
- return sp;
- if ((sp = sp->next) == 0)
- return 0;
- }
-}
-
-/* Return true if segment contains a segment link */
-static int has_segment_link(mstate m, msegmentptr ss) {
- msegmentptr sp = &m->seg;
- for (;;) {
- if ((char*)sp >= ss->base && (char*)sp < ss->base + ss->size)
- return 1;
- if ((sp = sp->next) == 0)
- return 0;
- }
-}
-
-#ifndef MORECORE_CANNOT_TRIM
-#define should_trim(M,s) ((s) > (M)->trim_check)
-#else /* MORECORE_CANNOT_TRIM */
-#define should_trim(M,s) (0)
-#endif /* MORECORE_CANNOT_TRIM */
-
-/*
- TOP_FOOT_SIZE is padding at the end of a segment, including space
- that may be needed to place segment records and fenceposts when new
- noncontiguous segments are added.
-*/
-#define TOP_FOOT_SIZE\
- (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE)
-
-
-/* ------------------------------- Hooks -------------------------------- */
-
-/*
- PREACTION should be defined to return 0 on success, and nonzero on
- failure. If you are not using locking, you can redefine these to do
- anything you like.
-*/
-
-#if USE_LOCKS
-
-/* Ensure locks are initialized */
-#define GLOBALLY_INITIALIZE() (mparams.page_size == 0 && init_mparams())
-
-#define PREACTION(M) ((GLOBALLY_INITIALIZE() || use_lock(M))? ACQUIRE_LOCK(&(M)->mutex) : 0)
-#define POSTACTION(M) { if (use_lock(M)) RELEASE_LOCK(&(M)->mutex); }
-#else /* USE_LOCKS */
-
-#ifndef PREACTION
-#define PREACTION(M) (0)
-#endif /* PREACTION */
-
-#ifndef POSTACTION
-#define POSTACTION(M)
-#endif /* POSTACTION */
-
-#endif /* USE_LOCKS */
-
-/*
- CORRUPTION_ERROR_ACTION is triggered upon detected bad addresses.
- USAGE_ERROR_ACTION is triggered on detected bad frees and
- reallocs. The argument p is an address that might have triggered the
- fault. It is ignored by the two predefined actions, but might be
- useful in custom actions that try to help diagnose errors.
-*/
-
-#if PROCEED_ON_ERROR
-
-/* A count of the number of corruption errors causing resets */
-int malloc_corruption_error_count;
-
-/* default corruption action */
-static void reset_on_error(mstate m);
-
-#define CORRUPTION_ERROR_ACTION(m) reset_on_error(m)
-#define USAGE_ERROR_ACTION(m, p)
-
-#else /* PROCEED_ON_ERROR */
-
-#ifndef CORRUPTION_ERROR_ACTION
-#define CORRUPTION_ERROR_ACTION(m) ABORT
-#endif /* CORRUPTION_ERROR_ACTION */
-
-#ifndef USAGE_ERROR_ACTION
-#define USAGE_ERROR_ACTION(m,p) ABORT
-#endif /* USAGE_ERROR_ACTION */
-
-#endif /* PROCEED_ON_ERROR */
-
-/* -------------------------- Debugging setup ---------------------------- */
-
-#if ! DEBUG
-
-#define check_free_chunk(M,P)
-#define check_inuse_chunk(M,P)
-#define check_malloced_chunk(M,P,N)
-#define check_mmapped_chunk(M,P)
-#define check_malloc_state(M)
-#define check_top_chunk(M,P)
-
-#else /* DEBUG */
-#define check_free_chunk(M,P) do_check_free_chunk(M,P)
-#define check_inuse_chunk(M,P) do_check_inuse_chunk(M,P)
-#define check_top_chunk(M,P) do_check_top_chunk(M,P)
-#define check_malloced_chunk(M,P,N) do_check_malloced_chunk(M,P,N)
-#define check_mmapped_chunk(M,P) do_check_mmapped_chunk(M,P)
-#define check_malloc_state(M) do_check_malloc_state(M)
-
-static void do_check_any_chunk(mstate m, mchunkptr p);
-static void do_check_top_chunk(mstate m, mchunkptr p);
-static void do_check_mmapped_chunk(mstate m, mchunkptr p);
-static void do_check_inuse_chunk(mstate m, mchunkptr p);
-static void do_check_free_chunk(mstate m, mchunkptr p);
-static void do_check_malloced_chunk(mstate m, void* mem, size_t s);
-static void do_check_tree(mstate m, tchunkptr t);
-static void do_check_treebin(mstate m, bindex_t i);
-static void do_check_smallbin(mstate m, bindex_t i);
-static void do_check_malloc_state(mstate m);
-static int bin_find(mstate m, mchunkptr x);
-static size_t traverse_and_check(mstate m);
-#endif /* DEBUG */
-
-/* ---------------------------- Indexing Bins ---------------------------- */
-
-#define is_small(s) (((s) >> SMALLBIN_SHIFT) < NSMALLBINS)
-#define small_index(s) ((s) >> SMALLBIN_SHIFT)
-#define small_index2size(i) ((i) << SMALLBIN_SHIFT)
-#define MIN_SMALL_INDEX (small_index(MIN_CHUNK_SIZE))
-
-/* addressing by index. See above about smallbin repositioning */
-#define smallbin_at(M, i) ((sbinptr)((char*)&((M)->smallbins[(i)<<1])))
-#define treebin_at(M,i) (&((M)->treebins[i]))
-
-/* assign tree index for size S to variable I */
-#if defined(__GNUC__) && defined(i386)
-#define compute_tree_index(S, I)\
-{\
- size_t X = S >> TREEBIN_SHIFT;\
- if (X == 0)\
- I = 0;\
- else if (X > 0xFFFF)\
- I = NTREEBINS-1;\
- else {\
- unsigned int K;\
- __asm__("bsrl %1,%0\n\t" : "=r" (K) : "rm" (X));\
- I = (bindex_t)((K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1)));\
- }\
-}
-#else /* GNUC */
-#define compute_tree_index(S, I)\
-{\
- size_t X = S >> TREEBIN_SHIFT;\
- if (X == 0)\
- I = 0;\
- else if (X > 0xFFFF)\
- I = NTREEBINS-1;\
- else {\
- unsigned int Y = (unsigned int)X;\
- unsigned int N = ((Y - 0x100) >> 16) & 8;\
- unsigned int K = (((Y <<= N) - 0x1000) >> 16) & 4;\
- N += K;\
- N += K = (((Y <<= K) - 0x4000) >> 16) & 2;\
- K = 14 - N + ((Y <<= K) >> 15);\
- I = (K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1));\
- }\
-}
-#endif /* GNUC */
-
-/* Bit representing maximum resolved size in a treebin at i */
-#define bit_for_tree_index(i) \
- (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2)
-
-/* Shift placing maximum resolved bit in a treebin at i as sign bit */
-#define leftshift_for_tree_index(i) \
- ((i == NTREEBINS-1)? 0 : \
- ((SIZE_T_BITSIZE-SIZE_T_ONE) - (((i) >> 1) + TREEBIN_SHIFT - 2)))
-
-/* The size of the smallest chunk held in bin with index i */
-#define minsize_for_tree_index(i) \
- ((SIZE_T_ONE << (((i) >> 1) + TREEBIN_SHIFT)) | \
- (((size_t)((i) & SIZE_T_ONE)) << (((i) >> 1) + TREEBIN_SHIFT - 1)))
-
-
-/* ------------------------ Operations on bin maps ----------------------- */
-
-/* bit corresponding to given index */
-#define idx2bit(i) ((binmap_t)(1) << (i))
-
-/* Mark/Clear bits with given index */
-#define mark_smallmap(M,i) ((M)->smallmap |= idx2bit(i))
-#define clear_smallmap(M,i) ((M)->smallmap &= ~idx2bit(i))
-#define smallmap_is_marked(M,i) ((M)->smallmap & idx2bit(i))
-
-#define mark_treemap(M,i) ((M)->treemap |= idx2bit(i))
-#define clear_treemap(M,i) ((M)->treemap &= ~idx2bit(i))
-#define treemap_is_marked(M,i) ((M)->treemap & idx2bit(i))
-
-/* index corresponding to given bit */
-
-#if defined(__GNUC__) && defined(i386)
-#define compute_bit2idx(X, I)\
-{\
- unsigned int J;\
- __asm__("bsfl %1,%0\n\t" : "=r" (J) : "rm" (X));\
- I = (bindex_t)J;\
-}
-
-#else /* GNUC */
-#if USE_BUILTIN_FFS
-#define compute_bit2idx(X, I) I = ffs(X)-1
-
-#else /* USE_BUILTIN_FFS */
-#define compute_bit2idx(X, I)\
-{\
- unsigned int Y = X - 1;\
- unsigned int K = Y >> (16-4) & 16;\
- unsigned int N = K; Y >>= K;\
- N += K = Y >> (8-3) & 8; Y >>= K;\
- N += K = Y >> (4-2) & 4; Y >>= K;\
- N += K = Y >> (2-1) & 2; Y >>= K;\
- N += K = Y >> (1-0) & 1; Y >>= K;\
- I = (bindex_t)(N + Y);\
-}
-#endif /* USE_BUILTIN_FFS */
-#endif /* GNUC */
-
-/* isolate the least set bit of a bitmap */
-#define least_bit(x) ((x) & -(x))
-
-/* mask with all bits to left of least bit of x on */
-#define left_bits(x) ((x<<1) | -(x<<1))
-
-/* mask with all bits to left of or equal to least bit of x on */
-#define same_or_left_bits(x) ((x) | -(x))
-
-
-/* ----------------------- Runtime Check Support ------------------------- */
-
-/*
- For security, the main invariant is that malloc/free/etc never
- writes to a static address other than malloc_state, unless static
- malloc_state itself has been corrupted, which cannot occur via
- malloc (because of these checks). In essence this means that we
- believe all pointers, sizes, maps etc held in malloc_state, but
- check all of those linked or offsetted from other embedded data
- structures. These checks are interspersed with main code in a way
- that tends to minimize their run-time cost.
-
- When FOOTERS is defined, in addition to range checking, we also
- verify footer fields of inuse chunks, which can be used guarantee
- that the mstate controlling malloc/free is intact. This is a
- streamlined version of the approach described by William Robertson
- et al in "Run-time Detection of Heap-based Overflows" LISA'03
- http://www.usenix.org/events/lisa03/tech/robertson.html The footer
- of an inuse chunk holds the xor of its mstate and a random seed,
- that is checked upon calls to free() and realloc(). This is
- (probablistically) unguessable from outside the program, but can be
- computed by any code successfully malloc'ing any chunk, so does not
- itself provide protection against code that has already broken
- security through some other means. Unlike Robertson et al, we
- always dynamically check addresses of all offset chunks (previous,
- next, etc). This turns out to be cheaper than relying on hashes.
-*/
-
-#if !INSECURE
-/* Check if address a is at least as high as any from MORECORE or MMAP */
-#define ok_address(M, a) ((char*)(a) >= (M)->least_addr)
-/* Check if address of next chunk n is higher than base chunk p */
-#define ok_next(p, n) ((char*)(p) < (char*)(n))
-/* Check if p has its cinuse bit on */
-#define ok_cinuse(p) cinuse(p)
-/* Check if p has its pinuse bit on */
-#define ok_pinuse(p) pinuse(p)
-
-#else /* !INSECURE */
-#define ok_address(M, a) (1)
-#define ok_next(b, n) (1)
-#define ok_cinuse(p) (1)
-#define ok_pinuse(p) (1)
-#endif /* !INSECURE */
-
-#if (FOOTERS && !INSECURE)
-/* Check if (alleged) mstate m has expected magic field */
-#define ok_magic(M) ((M)->magic == mparams.magic)
-#else /* (FOOTERS && !INSECURE) */
-#define ok_magic(M) (1)
-#endif /* (FOOTERS && !INSECURE) */
-
-
-/* In gcc, use __builtin_expect to minimize impact of checks */
-#if !INSECURE
-#if defined(__GNUC__) && __GNUC__ >= 3
-#define RTCHECK(e) __builtin_expect(e, 1)
-#else /* GNUC */
-#define RTCHECK(e) (e)
-#endif /* GNUC */
-#else /* !INSECURE */
-#define RTCHECK(e) (1)
-#endif /* !INSECURE */
-
-/* macros to set up inuse chunks with or without footers */
-
-#if !FOOTERS
-
-#define mark_inuse_foot(M,p,s)
-
-/* Set cinuse bit and pinuse bit of next chunk */
-#define set_inuse(M,p,s)\
- ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\
- ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)
-
-/* Set cinuse and pinuse of this chunk and pinuse of next chunk */
-#define set_inuse_and_pinuse(M,p,s)\
- ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\
- ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)
-
-/* Set size, cinuse and pinuse bit of this chunk */
-#define set_size_and_pinuse_of_inuse_chunk(M, p, s)\
- ((p)->head = (s|PINUSE_BIT|CINUSE_BIT))
-
-#else /* FOOTERS */
-
-/* Set foot of inuse chunk to be xor of mstate and seed */
-#define mark_inuse_foot(M,p,s)\
- (((mchunkptr)((char*)(p) + (s)))->prev_foot = ((size_t)(M) ^ mparams.magic))
-
-#define get_mstate_for(p)\
- ((mstate)(((mchunkptr)((char*)(p) +\
- (chunksize(p))))->prev_foot ^ mparams.magic))
-
-#define set_inuse(M,p,s)\
- ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\
- (((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT), \
- mark_inuse_foot(M,p,s))
-
-#define set_inuse_and_pinuse(M,p,s)\
- ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\
- (((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT),\
- mark_inuse_foot(M,p,s))
-
-#define set_size_and_pinuse_of_inuse_chunk(M, p, s)\
- ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\
- mark_inuse_foot(M, p, s))
-
-#endif /* !FOOTERS */
-
-/* ---------------------------- setting mparams -------------------------- */
-
-/* Initialize mparams */
-static int init_mparams(void) {
- if (mparams.page_size == 0) {
- size_t s;
-
- mparams.mmap_threshold = DEFAULT_MMAP_THRESHOLD;
- mparams.trim_threshold = DEFAULT_TRIM_THRESHOLD;
-#if MORECORE_CONTIGUOUS
- mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT;
-#else /* MORECORE_CONTIGUOUS */
- mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT|USE_NONCONTIGUOUS_BIT;
-#endif /* MORECORE_CONTIGUOUS */
-
-#if (FOOTERS && !INSECURE)
- {
-#if USE_DEV_RANDOM
- int fd;
- unsigned char buf[sizeof(size_t)];
- /* Try to use /dev/urandom, else fall back on using time */
- if ((fd = open("/dev/urandom", O_RDONLY)) >= 0 &&
- read(fd, buf, sizeof(buf)) == sizeof(buf)) {
- s = *((size_t *) buf);
- close(fd);
- }
- else
-#endif /* USE_DEV_RANDOM */
- s = (size_t)(time(0) ^ (size_t)0x55555555U);
-
- s |= (size_t)8U; /* ensure nonzero */
- s &= ~(size_t)7U; /* improve chances of fault for bad values */
-
- }
-#else /* (FOOTERS && !INSECURE) */
- s = (size_t)0x58585858U;
-#endif /* (FOOTERS && !INSECURE) */
- ACQUIRE_MAGIC_INIT_LOCK();
- if (mparams.magic == 0) {
- mparams.magic = s;
- /* Set up lock for main malloc area */
- INITIAL_LOCK(&gm->mutex);
- gm->mflags = mparams.default_mflags;
- }
- RELEASE_MAGIC_INIT_LOCK();
-
-#ifndef WIN32
- mparams.page_size = malloc_getpagesize;
- mparams.granularity = ((DEFAULT_GRANULARITY != 0)?
- DEFAULT_GRANULARITY : mparams.page_size);
-#else /* WIN32 */
- {
- SYSTEM_INFO system_info;
- GetSystemInfo(&system_info);
- mparams.page_size = system_info.dwPageSize;
- mparams.granularity = system_info.dwAllocationGranularity;
- }
-#endif /* WIN32 */
-
- /* Sanity-check configuration:
- size_t must be unsigned and as wide as pointer type.
- ints must be at least 4 bytes.
- alignment must be at least 8.
- Alignment, min chunk size, and page size must all be powers of 2.
- */
- if ((sizeof(size_t) != sizeof(char*)) ||
- (MAX_SIZE_T < MIN_CHUNK_SIZE) ||
- (sizeof(int) < 4) ||
- (MALLOC_ALIGNMENT < (size_t)8U) ||
- ((MALLOC_ALIGNMENT & (MALLOC_ALIGNMENT-SIZE_T_ONE)) != 0) ||
- ((MCHUNK_SIZE & (MCHUNK_SIZE-SIZE_T_ONE)) != 0) ||
- ((mparams.granularity & (mparams.granularity-SIZE_T_ONE)) != 0) ||
- ((mparams.page_size & (mparams.page_size-SIZE_T_ONE)) != 0))
- ABORT;
- }
- return 0;
-}
-
-/* support for mallopt */
-static int change_mparam(int param_number, int value) {
- size_t val = (size_t)value;
- init_mparams();
- switch(param_number) {
- case M_TRIM_THRESHOLD:
- mparams.trim_threshold = val;
- return 1;
- case M_GRANULARITY:
- if (val >= mparams.page_size && ((val & (val-1)) == 0)) {
- mparams.granularity = val;
- return 1;
- }
- else
- return 0;
- case M_MMAP_THRESHOLD:
- mparams.mmap_threshold = val;
- return 1;
- default:
- return 0;
- }
-}
-
-#if DEBUG
-/* ------------------------- Debugging Support --------------------------- */
-
-/* Check properties of any chunk, whether free, inuse, mmapped etc */
-static void do_check_any_chunk(mstate m, mchunkptr p) {
- assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD));
- assert(ok_address(m, p));
-}
-
-/* Check properties of top chunk */
-static void do_check_top_chunk(mstate m, mchunkptr p) {
- msegmentptr sp = segment_holding(m, (char*)p);
- size_t sz = chunksize(p);
- assert(sp != 0);
- assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD));
- assert(ok_address(m, p));
- assert(sz == m->topsize);
- assert(sz > 0);
- assert(sz == ((sp->base + sp->size) - (char*)p) - TOP_FOOT_SIZE);
- assert(pinuse(p));
- assert(!next_pinuse(p));
-}
-
-/* Check properties of (inuse) mmapped chunks */
-static void do_check_mmapped_chunk(mstate m, mchunkptr p) {
- size_t sz = chunksize(p);
- size_t len = (sz + (p->prev_foot & ~IS_MMAPPED_BIT) + MMAP_FOOT_PAD);
- assert(is_mmapped(p));
- assert(use_mmap(m));
- assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD));
- assert(ok_address(m, p));
- assert(!is_small(sz));
- assert((len & (mparams.page_size-SIZE_T_ONE)) == 0);
- assert(chunk_plus_offset(p, sz)->head == FENCEPOST_HEAD);
- assert(chunk_plus_offset(p, sz+SIZE_T_SIZE)->head == 0);
-}
-
-/* Check properties of inuse chunks */
-static void do_check_inuse_chunk(mstate m, mchunkptr p) {
- do_check_any_chunk(m, p);
- assert(cinuse(p));
- assert(next_pinuse(p));
- /* If not pinuse and not mmapped, previous chunk has OK offset */
- assert(is_mmapped(p) || pinuse(p) || next_chunk(prev_chunk(p)) == p);
- if (is_mmapped(p))
- do_check_mmapped_chunk(m, p);
-}
-
-/* Check properties of free chunks */
-static void do_check_free_chunk(mstate m, mchunkptr p) {
- size_t sz = p->head & ~(PINUSE_BIT|CINUSE_BIT);
- mchunkptr next = chunk_plus_offset(p, sz);
- do_check_any_chunk(m, p);
- assert(!cinuse(p));
- assert(!next_pinuse(p));
- assert (!is_mmapped(p));
- if (p != m->dv && p != m->top) {
- if (sz >= MIN_CHUNK_SIZE) {
- assert((sz & CHUNK_ALIGN_MASK) == 0);
- assert(is_aligned(chunk2mem(p)));
- assert(next->prev_foot == sz);
- assert(pinuse(p));
- assert (next == m->top || cinuse(next));
- assert(p->fd->bk == p);
- assert(p->bk->fd == p);
- }
- else /* markers are always of size SIZE_T_SIZE */
- assert(sz == SIZE_T_SIZE);
- }
-}
-
-/* Check properties of malloced chunks at the point they are malloced */
-static void do_check_malloced_chunk(mstate m, void* mem, size_t s) {
- if (mem != 0) {
- mchunkptr p = mem2chunk(mem);
- size_t sz = p->head & ~(PINUSE_BIT|CINUSE_BIT);
- do_check_inuse_chunk(m, p);
- assert((sz & CHUNK_ALIGN_MASK) == 0);
- assert(sz >= MIN_CHUNK_SIZE);
- assert(sz >= s);
- /* unless mmapped, size is less than MIN_CHUNK_SIZE more than request */
- assert(is_mmapped(p) || sz < (s + MIN_CHUNK_SIZE));
- }
-}
-
-/* Check a tree and its subtrees. */
-static void do_check_tree(mstate m, tchunkptr t) {
- tchunkptr head = 0;
- tchunkptr u = t;
- bindex_t tindex = t->index;
- size_t tsize = chunksize(t);
- bindex_t idx;
- compute_tree_index(tsize, idx);
- assert(tindex == idx);
- assert(tsize >= MIN_LARGE_SIZE);
- assert(tsize >= minsize_for_tree_index(idx));
- assert((idx == NTREEBINS-1) || (tsize < minsize_for_tree_index((idx+1))));
-
- do { /* traverse through chain of same-sized nodes */
- do_check_any_chunk(m, ((mchunkptr)u));
- assert(u->index == tindex);
- assert(chunksize(u) == tsize);
- assert(!cinuse(u));
- assert(!next_pinuse(u));
- assert(u->fd->bk == u);
- assert(u->bk->fd == u);
- if (u->parent == 0) {
- assert(u->child[0] == 0);
- assert(u->child[1] == 0);
- }
- else {
- assert(head == 0); /* only one node on chain has parent */
- head = u;
- assert(u->parent != u);
- assert (u->parent->child[0] == u ||
- u->parent->child[1] == u ||
- *((tbinptr*)(u->parent)) == u);
- if (u->child[0] != 0) {
- assert(u->child[0]->parent == u);
- assert(u->child[0] != u);
- do_check_tree(m, u->child[0]);
- }
- if (u->child[1] != 0) {
- assert(u->child[1]->parent == u);
- assert(u->child[1] != u);
- do_check_tree(m, u->child[1]);
- }
- if (u->child[0] != 0 && u->child[1] != 0) {
- assert(chunksize(u->child[0]) < chunksize(u->child[1]));
- }
- }
- u = u->fd;
- } while (u != t);
- assert(head != 0);
-}
-
-/* Check all the chunks in a treebin. */
-static void do_check_treebin(mstate m, bindex_t i) {
- tbinptr* tb = treebin_at(m, i);
- tchunkptr t = *tb;
- int empty = (m->treemap & (1U << i)) == 0;
- if (t == 0)
- assert(empty);
- if (!empty)
- do_check_tree(m, t);
-}
-
-/* Check all the chunks in a smallbin. */
-static void do_check_smallbin(mstate m, bindex_t i) {
- sbinptr b = smallbin_at(m, i);
- mchunkptr p = b->bk;
- unsigned int empty = (m->smallmap & (1U << i)) == 0;
- if (p == b)
- assert(empty);
- if (!empty) {
- for (; p != b; p = p->bk) {
- size_t size = chunksize(p);
- mchunkptr q;
- /* each chunk claims to be free */
- do_check_free_chunk(m, p);
- /* chunk belongs in bin */
- assert(small_index(size) == i);
- assert(p->bk == b || chunksize(p->bk) == chunksize(p));
- /* chunk is followed by an inuse chunk */
- q = next_chunk(p);
- if (q->head != FENCEPOST_HEAD)
- do_check_inuse_chunk(m, q);
- }
- }
-}
-
-/* Find x in a bin. Used in other check functions. */
-static int bin_find(mstate m, mchunkptr x) {
- size_t size = chunksize(x);
- if (is_small(size)) {
- bindex_t sidx = small_index(size);
- sbinptr b = smallbin_at(m, sidx);
- if (smallmap_is_marked(m, sidx)) {
- mchunkptr p = b;
- do {
- if (p == x)
- return 1;
- } while ((p = p->fd) != b);
- }
- }
- else {
- bindex_t tidx;
- compute_tree_index(size, tidx);
- if (treemap_is_marked(m, tidx)) {
- tchunkptr t = *treebin_at(m, tidx);
- size_t sizebits = size << leftshift_for_tree_index(tidx);
- while (t != 0 && chunksize(t) != size) {
- t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1];
- sizebits <<= 1;
- }
- if (t != 0) {
- tchunkptr u = t;
- do {
- if (u == (tchunkptr)x)
- return 1;
- } while ((u = u->fd) != t);
- }
- }
- }
- return 0;
-}
-
-/* Traverse each chunk and check it; return total */
-static size_t traverse_and_check(mstate m) {
- size_t sum = 0;
- if (is_initialized(m)) {
- msegmentptr s = &m->seg;
- sum += m->topsize + TOP_FOOT_SIZE;
- while (s != 0) {
- mchunkptr q = align_as_chunk(s->base);
- mchunkptr lastq = 0;
- assert(pinuse(q));
- while (segment_holds(s, q) &&
- q != m->top && q->head != FENCEPOST_HEAD) {
- sum += chunksize(q);
- if (cinuse(q)) {
- assert(!bin_find(m, q));
- do_check_inuse_chunk(m, q);
- }
- else {
- assert(q == m->dv || bin_find(m, q));
- assert(lastq == 0 || cinuse(lastq)); /* Not 2 consecutive free */
- do_check_free_chunk(m, q);
- }
- lastq = q;
- q = next_chunk(q);
- }
- s = s->next;
- }
- }
- return sum;
-}
-
-/* Check all properties of malloc_state. */
-static void do_check_malloc_state(mstate m) {
- bindex_t i;
- size_t total;
- /* check bins */
- for (i = 0; i < NSMALLBINS; ++i)
- do_check_smallbin(m, i);
- for (i = 0; i < NTREEBINS; ++i)
- do_check_treebin(m, i);
-
- if (m->dvsize != 0) { /* check dv chunk */
- do_check_any_chunk(m, m->dv);
- assert(m->dvsize == chunksize(m->dv));
- assert(m->dvsize >= MIN_CHUNK_SIZE);
- assert(bin_find(m, m->dv) == 0);
- }
-
- if (m->top != 0) { /* check top chunk */
- do_check_top_chunk(m, m->top);
- assert(m->topsize == chunksize(m->top));
- assert(m->topsize > 0);
- assert(bin_find(m, m->top) == 0);
- }
-
- total = traverse_and_check(m);
- assert(total <= m->footprint);
- assert(m->footprint <= m->max_footprint);
-}
-#endif /* DEBUG */
-
-/* ----------------------------- statistics ------------------------------ */
-
-#if !NO_MALLINFO
-static struct mallinfo internal_mallinfo(mstate m) {
- struct mallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
- if (!PREACTION(m)) {
- check_malloc_state(m);
- if (is_initialized(m)) {
- size_t nfree = SIZE_T_ONE; /* top always free */
- size_t mfree = m->topsize + TOP_FOOT_SIZE;
- size_t sum = mfree;
- msegmentptr s = &m->seg;
- while (s != 0) {
- mchunkptr q = align_as_chunk(s->base);
- while (segment_holds(s, q) &&
- q != m->top && q->head != FENCEPOST_HEAD) {
- size_t sz = chunksize(q);
- sum += sz;
- if (!cinuse(q)) {
- mfree += sz;
- ++nfree;
- }
- q = next_chunk(q);
- }
- s = s->next;
- }
-
- nm.arena = sum;
- nm.ordblks = nfree;
- nm.hblkhd = m->footprint - sum;
- nm.usmblks = m->max_footprint;
- nm.uordblks = m->footprint - mfree;
- nm.fordblks = mfree;
- nm.keepcost = m->topsize;
- }
-
- POSTACTION(m);
- }
- return nm;
-}
-#endif /* !NO_MALLINFO */
-
-static void internal_malloc_stats(mstate m) {
- if (!PREACTION(m)) {
- size_t maxfp = 0;
- size_t fp = 0;
- size_t used = 0;
- check_malloc_state(m);
- if (is_initialized(m)) {
- msegmentptr s = &m->seg;
- maxfp = m->max_footprint;
- fp = m->footprint;
- used = fp - (m->topsize + TOP_FOOT_SIZE);
-
- while (s != 0) {
- mchunkptr q = align_as_chunk(s->base);
- while (segment_holds(s, q) &&
- q != m->top && q->head != FENCEPOST_HEAD) {
- if (!cinuse(q))
- used -= chunksize(q);
- q = next_chunk(q);
- }
- s = s->next;
- }
- }
-
-#ifndef LACKS_STDIO_H
- fprintf(stderr, "max system bytes = %10lu\n", (unsigned long)(maxfp));
- fprintf(stderr, "system bytes = %10lu\n", (unsigned long)(fp));
- fprintf(stderr, "in use bytes = %10lu\n", (unsigned long)(used));
-#endif
-
- POSTACTION(m);
- }
-}
-
-/* ----------------------- Operations on smallbins ----------------------- */
-
-/*
- Various forms of linking and unlinking are defined as macros. Even
- the ones for trees, which are very long but have very short typical
- paths. This is ugly but reduces reliance on inlining support of
- compilers.
-*/
-
-/* Link a free chunk into a smallbin */
-#define insert_small_chunk(M, P, S) {\
- bindex_t I = small_index(S);\
- mchunkptr B = smallbin_at(M, I);\
- mchunkptr F = B;\
- assert(S >= MIN_CHUNK_SIZE);\
- if (!smallmap_is_marked(M, I))\
- mark_smallmap(M, I);\
- else if (RTCHECK(ok_address(M, B->fd)))\
- F = B->fd;\
- else {\
- CORRUPTION_ERROR_ACTION(M);\
- }\
- B->fd = P;\
- F->bk = P;\
- P->fd = F;\
- P->bk = B;\
-}
-
-/* Unlink a chunk from a smallbin */
-#define unlink_small_chunk(M, P, S) {\
- mchunkptr F = P->fd;\
- mchunkptr B = P->bk;\
- bindex_t I = small_index(S);\
- assert(P != B);\
- assert(P != F);\
- assert(chunksize(P) == small_index2size(I));\
- if (F == B)\
- clear_smallmap(M, I);\
- else if (RTCHECK((F == smallbin_at(M,I) || ok_address(M, F)) &&\
- (B == smallbin_at(M,I) || ok_address(M, B)))) {\
- F->bk = B;\
- B->fd = F;\
- }\
- else {\
- CORRUPTION_ERROR_ACTION(M);\
- }\
-}
-
-/* Unlink the first chunk from a smallbin */
-#define unlink_first_small_chunk(M, B, P, I) {\
- mchunkptr F = P->fd;\
- assert(P != B);\
- assert(P != F);\
- assert(chunksize(P) == small_index2size(I));\
- if (B == F)\
- clear_smallmap(M, I);\
- else if (RTCHECK(ok_address(M, F))) {\
- B->fd = F;\
- F->bk = B;\
- }\
- else {\
- CORRUPTION_ERROR_ACTION(M);\
- }\
-}
-
-/* Replace dv node, binning the old one */
-/* Used only when dvsize known to be small */
-#define replace_dv(M, P, S) {\
- size_t DVS = M->dvsize;\
- if (DVS != 0) {\
- mchunkptr DV = M->dv;\
- assert(is_small(DVS));\
- insert_small_chunk(M, DV, DVS);\
- }\
- M->dvsize = S;\
- M->dv = P;\
-}
-
-/* ------------------------- Operations on trees ------------------------- */
-
-/* Insert chunk into tree */
-#define insert_large_chunk(M, X, S) {\
- tbinptr* H;\
- bindex_t I;\
- compute_tree_index(S, I);\
- H = treebin_at(M, I);\
- X->index = I;\
- X->child[0] = X->child[1] = 0;\
- if (!treemap_is_marked(M, I)) {\
- mark_treemap(M, I);\
- *H = X;\
- X->parent = (tchunkptr)H;\
- X->fd = X->bk = X;\
- }\
- else {\
- tchunkptr T = *H;\
- size_t K = S << leftshift_for_tree_index(I);\
- for (;;) {\
- if (chunksize(T) != S) {\
- tchunkptr* C = &(T->child[(K >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]);\
- K <<= 1;\
- if (*C != 0)\
- T = *C;\
- else if (RTCHECK(ok_address(M, C))) {\
- *C = X;\
- X->parent = T;\
- X->fd = X->bk = X;\
- break;\
- }\
- else {\
- CORRUPTION_ERROR_ACTION(M);\
- break;\
- }\
- }\
- else {\
- tchunkptr F = T->fd;\
- if (RTCHECK(ok_address(M, T) && ok_address(M, F))) {\
- T->fd = F->bk = X;\
- X->fd = F;\
- X->bk = T;\
- X->parent = 0;\
- break;\
- }\
- else {\
- CORRUPTION_ERROR_ACTION(M);\
- break;\
- }\
- }\
- }\
- }\
-}
-
-/*
- Unlink steps:
-
- 1. If x is a chained node, unlink it from its same-sized fd/bk links
- and choose its bk node as its replacement.
- 2. If x was the last node of its size, but not a leaf node, it must
- be replaced with a leaf node (not merely one with an open left or
- right), to make sure that lefts and rights of descendents
- correspond properly to bit masks. We use the rightmost descendent
- of x. We could use any other leaf, but this is easy to locate and
- tends to counteract removal of leftmosts elsewhere, and so keeps
- paths shorter than minimally guaranteed. This doesn't loop much
- because on average a node in a tree is near the bottom.
- 3. If x is the base of a chain (i.e., has parent links) relink
- x's parent and children to x's replacement (or null if none).
-*/
-
-#define unlink_large_chunk(M, X) {\
- tchunkptr XP = X->parent;\
- tchunkptr R;\
- if (X->bk != X) {\
- tchunkptr F = X->fd;\
- R = X->bk;\
- if (RTCHECK(ok_address(M, F))) {\
- F->bk = R;\
- R->fd = F;\
- }\
- else {\
- CORRUPTION_ERROR_ACTION(M);\
- }\
- }\
- else {\
- tchunkptr* RP;\
- if (((R = *(RP = &(X->child[1]))) != 0) ||\
- ((R = *(RP = &(X->child[0]))) != 0)) {\
- tchunkptr* CP;\
- while ((*(CP = &(R->child[1])) != 0) ||\
- (*(CP = &(R->child[0])) != 0)) {\
- R = *(RP = CP);\
- }\
- if (RTCHECK(ok_address(M, RP)))\
- *RP = 0;\
- else {\
- CORRUPTION_ERROR_ACTION(M);\
- }\
- }\
- }\
- if (XP != 0) {\
- tbinptr* H = treebin_at(M, X->index);\
- if (X == *H) {\
- if ((*H = R) == 0) \
- clear_treemap(M, X->index);\
- }\
- else if (RTCHECK(ok_address(M, XP))) {\
- if (XP->child[0] == X) \
- XP->child[0] = R;\
- else \
- XP->child[1] = R;\
- }\
- else\
- CORRUPTION_ERROR_ACTION(M);\
- if (R != 0) {\
- if (RTCHECK(ok_address(M, R))) {\
- tchunkptr C0, C1;\
- R->parent = XP;\
- if ((C0 = X->child[0]) != 0) {\
- if (RTCHECK(ok_address(M, C0))) {\
- R->child[0] = C0;\
- C0->parent = R;\
- }\
- else\
- CORRUPTION_ERROR_ACTION(M);\
- }\
- if ((C1 = X->child[1]) != 0) {\
- if (RTCHECK(ok_address(M, C1))) {\
- R->child[1] = C1;\
- C1->parent = R;\
- }\
- else\
- CORRUPTION_ERROR_ACTION(M);\
- }\
- }\
- else\
- CORRUPTION_ERROR_ACTION(M);\
- }\
- }\
-}
-
-/* Relays to large vs small bin operations */
-
-#define insert_chunk(M, P, S)\
- if (is_small(S)) insert_small_chunk(M, P, S)\
- else { tchunkptr TP = (tchunkptr)(P); insert_large_chunk(M, TP, S); }
-
-#define unlink_chunk(M, P, S)\
- if (is_small(S)) unlink_small_chunk(M, P, S)\
- else { tchunkptr TP = (tchunkptr)(P); unlink_large_chunk(M, TP); }
-
-
-/* Relays to internal calls to malloc/free from realloc, memalign etc */
-
-#if ONLY_MSPACES
-#define internal_malloc(m, b) mspace_malloc(m, b)
-#define internal_free(m, mem) mspace_free(m,mem);
-#else /* ONLY_MSPACES */
-#if MSPACES
-#define internal_malloc(m, b)\
- (m == gm)? dlmalloc(b) : mspace_malloc(m, b)
-#define internal_free(m, mem)\
- if (m == gm) dlfree(mem); else mspace_free(m,mem);
-#else /* MSPACES */
-#define internal_malloc(m, b) dlmalloc(b)
-#define internal_free(m, mem) dlfree(mem)
-#endif /* MSPACES */
-#endif /* ONLY_MSPACES */
-
-/* ----------------------- Direct-mmapping chunks ----------------------- */
-
-/*
- Directly mmapped chunks are set up with an offset to the start of
- the mmapped region stored in the prev_foot field of the chunk. This
- allows reconstruction of the required argument to MUNMAP when freed,
- and also allows adjustment of the returned chunk to meet alignment
- requirements (especially in memalign). There is also enough space
- allocated to hold a fake next chunk of size SIZE_T_SIZE to maintain
- the PINUSE bit so frees can be checked.
-*/
-
-/* Malloc using mmap */
-static void* mmap_alloc(mstate m, size_t nb) {
- size_t mmsize = granularity_align(nb + SIX_SIZE_T_SIZES + CHUNK_ALIGN_MASK);
- if (mmsize > nb) { /* Check for wrap around 0 */
- char* mm = (char*)(DIRECT_MMAP(mmsize));
- if (mm != CMFAIL) {
- size_t offset = align_offset(chunk2mem(mm));
- size_t psize = mmsize - offset - MMAP_FOOT_PAD;
- mchunkptr p = (mchunkptr)(mm + offset);
- p->prev_foot = offset | IS_MMAPPED_BIT;
- (p)->head = (psize|CINUSE_BIT);
- mark_inuse_foot(m, p, psize);
- chunk_plus_offset(p, psize)->head = FENCEPOST_HEAD;
- chunk_plus_offset(p, psize+SIZE_T_SIZE)->head = 0;
-
- if (mm < m->least_addr)
- m->least_addr = mm;
- if ((m->footprint += mmsize) > m->max_footprint)
- m->max_footprint = m->footprint;
- assert(is_aligned(chunk2mem(p)));
- check_mmapped_chunk(m, p);
- return chunk2mem(p);
- }
- }
- return 0;
-}
-
-/* Realloc using mmap */
-static mchunkptr mmap_resize(mstate m, mchunkptr oldp, size_t nb) {
- size_t oldsize = chunksize(oldp);
- if (is_small(nb)) /* Can't shrink mmap regions below small size */
- return 0;
- /* Keep old chunk if big enough but not too big */
- if (oldsize >= nb + SIZE_T_SIZE &&
- (oldsize - nb) <= (mparams.granularity << 1))
- return oldp;
- else {
- size_t offset = oldp->prev_foot & ~IS_MMAPPED_BIT;
- size_t oldmmsize = oldsize + offset + MMAP_FOOT_PAD;
- size_t newmmsize = granularity_align(nb + SIX_SIZE_T_SIZES +
- CHUNK_ALIGN_MASK);
- char* cp = (char*)CALL_MREMAP((char*)oldp - offset,
- oldmmsize, newmmsize, 1);
- if (cp != CMFAIL) {
- mchunkptr newp = (mchunkptr)(cp + offset);
- size_t psize = newmmsize - offset - MMAP_FOOT_PAD;
- newp->head = (psize|CINUSE_BIT);
- mark_inuse_foot(m, newp, psize);
- chunk_plus_offset(newp, psize)->head = FENCEPOST_HEAD;
- chunk_plus_offset(newp, psize+SIZE_T_SIZE)->head = 0;
-
- if (cp < m->least_addr)
- m->least_addr = cp;
- if ((m->footprint += newmmsize - oldmmsize) > m->max_footprint)
- m->max_footprint = m->footprint;
- check_mmapped_chunk(m, newp);
- return newp;
- }
- }
- return 0;
-}
-
-/* -------------------------- mspace management -------------------------- */
-
-/* Initialize top chunk and its size */
-static void init_top(mstate m, mchunkptr p, size_t psize) {
- /* Ensure alignment */
- size_t offset = align_offset(chunk2mem(p));
- p = (mchunkptr)((char*)p + offset);
- psize -= offset;
-
- m->top = p;
- m->topsize = psize;
- p->head = psize | PINUSE_BIT;
- /* set size of fake trailing chunk holding overhead space only once */
- chunk_plus_offset(p, psize)->head = TOP_FOOT_SIZE;
- m->trim_check = mparams.trim_threshold; /* reset on each update */
-}
-
-/* Initialize bins for a new mstate that is otherwise zeroed out */
-static void init_bins(mstate m) {
- /* Establish circular links for smallbins */
- bindex_t i;
- for (i = 0; i < NSMALLBINS; ++i) {
- sbinptr bin = smallbin_at(m,i);
- bin->fd = bin->bk = bin;
- }
-}
-
-#if PROCEED_ON_ERROR
-
-/* default corruption action */
-static void reset_on_error(mstate m) {
- int i;
- ++malloc_corruption_error_count;
- /* Reinitialize fields to forget about all memory */
- m->smallbins = m->treebins = 0;
- m->dvsize = m->topsize = 0;
- m->seg.base = 0;
- m->seg.size = 0;
- m->seg.next = 0;
- m->top = m->dv = 0;
- for (i = 0; i < NTREEBINS; ++i)
- *treebin_at(m, i) = 0;
- init_bins(m);
-}
-#endif /* PROCEED_ON_ERROR */
-
-/* Allocate chunk and prepend remainder with chunk in successor base. */
-static void* prepend_alloc(mstate m, char* newbase, char* oldbase,
- size_t nb) {
- mchunkptr p = align_as_chunk(newbase);
- mchunkptr oldfirst = align_as_chunk(oldbase);
- size_t psize = (char*)oldfirst - (char*)p;
- mchunkptr q = chunk_plus_offset(p, nb);
- size_t qsize = psize - nb;
- set_size_and_pinuse_of_inuse_chunk(m, p, nb);
-
- assert((char*)oldfirst > (char*)q);
- assert(pinuse(oldfirst));
- assert(qsize >= MIN_CHUNK_SIZE);
-
- /* consolidate remainder with first chunk of old base */
- if (oldfirst == m->top) {
- size_t tsize = m->topsize += qsize;
- m->top = q;
- q->head = tsize | PINUSE_BIT;
- check_top_chunk(m, q);
- }
- else if (oldfirst == m->dv) {
- size_t dsize = m->dvsize += qsize;
- m->dv = q;
- set_size_and_pinuse_of_free_chunk(q, dsize);
- }
- else {
- if (!cinuse(oldfirst)) {
- size_t nsize = chunksize(oldfirst);
- unlink_chunk(m, oldfirst, nsize);
- oldfirst = chunk_plus_offset(oldfirst, nsize);
- qsize += nsize;
- }
- set_free_with_pinuse(q, qsize, oldfirst);
- insert_chunk(m, q, qsize);
- check_free_chunk(m, q);
- }
-
- check_malloced_chunk(m, chunk2mem(p), nb);
- return chunk2mem(p);
-}
-
-
-/* Add a segment to hold a new noncontiguous region */
-static void add_segment(mstate m, char* tbase, size_t tsize, flag_t mmapped) {
- /* Determine locations and sizes of segment, fenceposts, old top */
- char* old_top = (char*)m->top;
- msegmentptr oldsp = segment_holding(m, old_top);
- char* old_end = oldsp->base + oldsp->size;
- size_t ssize = pad_request(sizeof(struct malloc_segment));
- char* rawsp = old_end - (ssize + FOUR_SIZE_T_SIZES + CHUNK_ALIGN_MASK);
- size_t offset = align_offset(chunk2mem(rawsp));
- char* asp = rawsp + offset;
- char* csp = (asp < (old_top + MIN_CHUNK_SIZE))? old_top : asp;
- mchunkptr sp = (mchunkptr)csp;
- msegmentptr ss = (msegmentptr)(chunk2mem(sp));
- mchunkptr tnext = chunk_plus_offset(sp, ssize);
- mchunkptr p = tnext;
- int nfences = 0;
-
- /* reset top to new space */
- init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE);
-
- /* Set up segment record */
- assert(is_aligned(ss));
- set_size_and_pinuse_of_inuse_chunk(m, sp, ssize);
- *ss = m->seg; /* Push current record */
- m->seg.base = tbase;
- m->seg.size = tsize;
- m->seg.sflags = mmapped;
- m->seg.next = ss;
-
- /* Insert trailing fenceposts */
- for (;;) {
- mchunkptr nextp = chunk_plus_offset(p, SIZE_T_SIZE);
- p->head = FENCEPOST_HEAD;
- ++nfences;
- if ((char*)(&(nextp->head)) < old_end)
- p = nextp;
- else
- break;
- }
- assert(nfences >= 2);
-
- /* Insert the rest of old top into a bin as an ordinary free chunk */
- if (csp != old_top) {
- mchunkptr q = (mchunkptr)old_top;
- size_t psize = csp - old_top;
- mchunkptr tn = chunk_plus_offset(q, psize);
- set_free_with_pinuse(q, psize, tn);
- insert_chunk(m, q, psize);
- }
-
- check_top_chunk(m, m->top);
-}
-
-/* -------------------------- System allocation -------------------------- */
-
-/* Get memory from system using MORECORE or MMAP */
-static void* sys_alloc(mstate m, size_t nb) {
- char* tbase = CMFAIL;
- size_t tsize = 0;
- flag_t mmap_flag = 0;
-
- init_mparams();
-
- /* Directly map large chunks */
- if (use_mmap(m) && nb >= mparams.mmap_threshold) {
- void* mem = mmap_alloc(m, nb);
- if (mem != 0)
- return mem;
- }
-
- /*
- Try getting memory in any of three ways (in most-preferred to
- least-preferred order):
- 1. A call to MORECORE that can normally contiguously extend memory.
- (disabled if not MORECORE_CONTIGUOUS or not HAVE_MORECORE or
- or main space is mmapped or a previous contiguous call failed)
- 2. A call to MMAP new space (disabled if not HAVE_MMAP).
- Note that under the default settings, if MORECORE is unable to
- fulfill a request, and HAVE_MMAP is true, then mmap is
- used as a noncontiguous system allocator. This is a useful backup
- strategy for systems with holes in address spaces -- in this case
- sbrk cannot contiguously expand the heap, but mmap may be able to
- find space.
- 3. A call to MORECORE that cannot usually contiguously extend memory.
- (disabled if not HAVE_MORECORE)
- */
-
- if (MORECORE_CONTIGUOUS && !use_noncontiguous(m)) {
- char* br = CMFAIL;
- msegmentptr ss = (m->top == 0)? 0 : segment_holding(m, (char*)m->top);
- size_t asize = 0;
- ACQUIRE_MORECORE_LOCK();
-
- if (ss == 0) { /* First time through or recovery */
- char* base = (char*)CALL_MORECORE(0);
- if (base != CMFAIL) {
- asize = granularity_align(nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE);
- /* Adjust to end on a page boundary */
- if (!is_page_aligned(base))
- asize += (page_align((size_t)base) - (size_t)base);
- /* Can't call MORECORE if size is negative when treated as signed */
- if (asize < HALF_MAX_SIZE_T &&
- (br = (char*)(CALL_MORECORE(asize))) == base) {
- tbase = base;
- tsize = asize;
- }
- }
- }
- else {
- /* Subtract out existing available top space from MORECORE request. */
- asize = granularity_align(nb - m->topsize + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE);
- /* Use mem here only if it did continuously extend old space */
- if (asize < HALF_MAX_SIZE_T &&
- (br = (char*)(CALL_MORECORE(asize))) == ss->base+ss->size) {
- tbase = br;
- tsize = asize;
- }
- }
-
- if (tbase == CMFAIL) { /* Cope with partial failure */
- if (br != CMFAIL) { /* Try to use/extend the space we did get */
- if (asize < HALF_MAX_SIZE_T &&
- asize < nb + TOP_FOOT_SIZE + SIZE_T_ONE) {
- size_t esize = granularity_align(nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE - asize);
- if (esize < HALF_MAX_SIZE_T) {
- char* end = (char*)CALL_MORECORE(esize);
- if (end != CMFAIL)
- asize += esize;
- else { /* Can't use; try to release */
- end = (char*)CALL_MORECORE(-asize);
- br = CMFAIL;
- }
- }
- }
- }
- if (br != CMFAIL) { /* Use the space we did get */
- tbase = br;
- tsize = asize;
- }
- else
- disable_contiguous(m); /* Don't try contiguous path in the future */
- }
-
- RELEASE_MORECORE_LOCK();
- }
-
- if (HAVE_MMAP && tbase == CMFAIL) { /* Try MMAP */
- size_t req = nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE;
- size_t rsize = granularity_align(req);
- if (rsize > nb) { /* Fail if wraps around zero */
- char* mp = (char*)(CALL_MMAP(rsize));
- if (mp != CMFAIL) {
- tbase = mp;
- tsize = rsize;
- mmap_flag = IS_MMAPPED_BIT;
- }
- }
- }
-
- if (HAVE_MORECORE && tbase == CMFAIL) { /* Try noncontiguous MORECORE */
- size_t asize = granularity_align(nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE);
- if (asize < HALF_MAX_SIZE_T) {
- char* br = CMFAIL;
- char* end = CMFAIL;
- ACQUIRE_MORECORE_LOCK();
- br = (char*)(CALL_MORECORE(asize));
- end = (char*)(CALL_MORECORE(0));
- RELEASE_MORECORE_LOCK();
- if (br != CMFAIL && end != CMFAIL && br < end) {
- size_t ssize = end - br;
- if (ssize > nb + TOP_FOOT_SIZE) {
- tbase = br;
- tsize = ssize;
- }
- }
- }
- }
-
- if (tbase != CMFAIL) {
-
- if ((m->footprint += tsize) > m->max_footprint)
- m->max_footprint = m->footprint;
-
- if (!is_initialized(m)) { /* first-time initialization */
- m->seg.base = m->least_addr = tbase;
- m->seg.size = tsize;
- m->seg.sflags = mmap_flag;
- m->magic = mparams.magic;
- init_bins(m);
- if (is_global(m))
- init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE);
- else {
- /* Offset top by embedded malloc_state */
- mchunkptr mn = next_chunk(mem2chunk(m));
- init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) -TOP_FOOT_SIZE);
- }
- }
-
- else {
- /* Try to merge with an existing segment */
- msegmentptr sp = &m->seg;
- while (sp != 0 && tbase != sp->base + sp->size)
- sp = sp->next;
- if (sp != 0 &&
- !is_extern_segment(sp) &&
- (sp->sflags & IS_MMAPPED_BIT) == mmap_flag &&
- segment_holds(sp, m->top)) { /* append */
- sp->size += tsize;
- init_top(m, m->top, m->topsize + tsize);
- }
- else {
- if (tbase < m->least_addr)
- m->least_addr = tbase;
- sp = &m->seg;
- while (sp != 0 && sp->base != tbase + tsize)
- sp = sp->next;
- if (sp != 0 &&
- !is_extern_segment(sp) &&
- (sp->sflags & IS_MMAPPED_BIT) == mmap_flag) {
- char* oldbase = sp->base;
- sp->base = tbase;
- sp->size += tsize;
- return prepend_alloc(m, tbase, oldbase, nb);
- }
- else
- add_segment(m, tbase, tsize, mmap_flag);
- }
- }
-
- if (nb < m->topsize) { /* Allocate from new or extended top space */
- size_t rsize = m->topsize -= nb;
- mchunkptr p = m->top;
- mchunkptr r = m->top = chunk_plus_offset(p, nb);
- r->head = rsize | PINUSE_BIT;
- set_size_and_pinuse_of_inuse_chunk(m, p, nb);
- check_top_chunk(m, m->top);
- check_malloced_chunk(m, chunk2mem(p), nb);
- return chunk2mem(p);
- }
- }
-
- MALLOC_FAILURE_ACTION;
- return 0;
-}
-
-/* ----------------------- system deallocation -------------------------- */
-
-/* Unmap and unlink any mmapped segments that don't contain used chunks */
-static size_t release_unused_segments(mstate m) {
- size_t released = 0;
- msegmentptr pred = &m->seg;
- msegmentptr sp = pred->next;
- while (sp != 0) {
- char* base = sp->base;
- size_t size = sp->size;
- msegmentptr next = sp->next;
- if (is_mmapped_segment(sp) && !is_extern_segment(sp)) {
- mchunkptr p = align_as_chunk(base);
- size_t psize = chunksize(p);
- /* Can unmap if first chunk holds entire segment and not pinned */
- if (!cinuse(p) && (char*)p + psize >= base + size - TOP_FOOT_SIZE) {
- tchunkptr tp = (tchunkptr)p;
- assert(segment_holds(sp, (char*)sp));
- if (p == m->dv) {
- m->dv = 0;
- m->dvsize = 0;
- }
- else {
- unlink_large_chunk(m, tp);
- }
- if (CALL_MUNMAP(base, size) == 0) {
- released += size;
- m->footprint -= size;
- /* unlink obsoleted record */
- sp = pred;
- sp->next = next;
- }
- else { /* back out if cannot unmap */
- insert_large_chunk(m, tp, psize);
- }
- }
- }
- pred = sp;
- sp = next;
- }
- return released;
-}
-
-static int sys_trim(mstate m, size_t pad) {
- size_t released = 0;
- if (pad < MAX_REQUEST && is_initialized(m)) {
- pad += TOP_FOOT_SIZE; /* ensure enough room for segment overhead */
-
- if (m->topsize > pad) {
- /* Shrink top space in granularity-size units, keeping at least one */
- size_t unit = mparams.granularity;
- size_t extra = ((m->topsize - pad + (unit - SIZE_T_ONE)) / unit -
- SIZE_T_ONE) * unit;
- msegmentptr sp = segment_holding(m, (char*)m->top);
-
- if (!is_extern_segment(sp)) {
- if (is_mmapped_segment(sp)) {
- if (HAVE_MMAP &&
- sp->size >= extra &&
- !has_segment_link(m, sp)) { /* can't shrink if pinned */
- size_t newsize = sp->size - extra;
- /* Prefer mremap, fall back to munmap */
- if ((CALL_MREMAP(sp->base, sp->size, newsize, 0) != MFAIL) ||
- (CALL_MUNMAP(sp->base + newsize, extra) == 0)) {
- released = extra;
- }
- }
- }
- else if (HAVE_MORECORE) {
- if (extra >= HALF_MAX_SIZE_T) /* Avoid wrapping negative */
- extra = (HALF_MAX_SIZE_T) + SIZE_T_ONE - unit;
- ACQUIRE_MORECORE_LOCK();
- {
- /* Make sure end of memory is where we last set it. */
- char* old_br = (char*)(CALL_MORECORE(0));
- if (old_br == sp->base + sp->size) {
- char* rel_br = (char*)(CALL_MORECORE(-extra));
- char* new_br = (char*)(CALL_MORECORE(0));
- if (rel_br != CMFAIL && new_br < old_br)
- released = old_br - new_br;
- }
- }
- RELEASE_MORECORE_LOCK();
- }
- }
-
- if (released != 0) {
- sp->size -= released;
- m->footprint -= released;
- init_top(m, m->top, m->topsize - released);
- check_top_chunk(m, m->top);
- }
- }
-
- /* Unmap any unused mmapped segments */
- if (HAVE_MMAP)
- released += release_unused_segments(m);
-
- /* On failure, disable autotrim to avoid repeated failed future calls */
- if (released == 0)
- m->trim_check = MAX_SIZE_T;
- }
-
- return (released != 0)? 1 : 0;
-}
-
-/* ---------------------------- malloc support --------------------------- */
-
-/* allocate a large request from the best fitting chunk in a treebin */
-static void* tmalloc_large(mstate m, size_t nb) {
- tchunkptr v = 0;
- size_t rsize = -nb; /* Unsigned negation */
- tchunkptr t;
- bindex_t idx;
- compute_tree_index(nb, idx);
-
- if ((t = *treebin_at(m, idx)) != 0) {
- /* Traverse tree for this bin looking for node with size == nb */
- size_t sizebits = nb << leftshift_for_tree_index(idx);
- tchunkptr rst = 0; /* The deepest untaken right subtree */
- for (;;) {
- tchunkptr rt;
- size_t trem = chunksize(t) - nb;
- if (trem < rsize) {
- v = t;
- if ((rsize = trem) == 0)
- break;
- }
- rt = t->child[1];
- t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1];
- if (rt != 0 && rt != t)
- rst = rt;
- if (t == 0) {
- t = rst; /* set t to least subtree holding sizes > nb */
- break;
- }
- sizebits <<= 1;
- }
- }
-
- if (t == 0 && v == 0) { /* set t to root of next non-empty treebin */
- binmap_t leftbits = left_bits(idx2bit(idx)) & m->treemap;
- if (leftbits != 0) {
- bindex_t i;
- binmap_t leastbit = least_bit(leftbits);
- compute_bit2idx(leastbit, i);
- t = *treebin_at(m, i);
- }
- }
-
- while (t != 0) { /* find smallest of tree or subtree */
- size_t trem = chunksize(t) - nb;
- if (trem < rsize) {
- rsize = trem;
- v = t;
- }
- t = leftmost_child(t);
- }
-
- /* If dv is a better fit, return 0 so malloc will use it */
- if (v != 0 && rsize < (size_t)(m->dvsize - nb)) {
- if (RTCHECK(ok_address(m, v))) { /* split */
- mchunkptr r = chunk_plus_offset(v, nb);
- assert(chunksize(v) == rsize + nb);
- if (RTCHECK(ok_next(v, r))) {
- unlink_large_chunk(m, v);
- if (rsize < MIN_CHUNK_SIZE)
- set_inuse_and_pinuse(m, v, (rsize + nb));
- else {
- set_size_and_pinuse_of_inuse_chunk(m, v, nb);
- set_size_and_pinuse_of_free_chunk(r, rsize);
- insert_chunk(m, r, rsize);
- }
- return chunk2mem(v);
- }
- }
- CORRUPTION_ERROR_ACTION(m);
- }
- return 0;
-}
-
-/* allocate a small request from the best fitting chunk in a treebin */
-static void* tmalloc_small(mstate m, size_t nb) {
- tchunkptr t, v;
- size_t rsize;
- bindex_t i;
- binmap_t leastbit = least_bit(m->treemap);
- compute_bit2idx(leastbit, i);
-
- v = t = *treebin_at(m, i);
- rsize = chunksize(t) - nb;
-
- while ((t = leftmost_child(t)) != 0) {
- size_t trem = chunksize(t) - nb;
- if (trem < rsize) {
- rsize = trem;
- v = t;
- }
- }
-
- if (RTCHECK(ok_address(m, v))) {
- mchunkptr r = chunk_plus_offset(v, nb);
- assert(chunksize(v) == rsize + nb);
- if (RTCHECK(ok_next(v, r))) {
- unlink_large_chunk(m, v);
- if (rsize < MIN_CHUNK_SIZE)
- set_inuse_and_pinuse(m, v, (rsize + nb));
- else {
- set_size_and_pinuse_of_inuse_chunk(m, v, nb);
- set_size_and_pinuse_of_free_chunk(r, rsize);
- replace_dv(m, r, rsize);
- }
- return chunk2mem(v);
- }
- }
-
- CORRUPTION_ERROR_ACTION(m);
- return 0;
-}
-
-/* --------------------------- realloc support --------------------------- */
-
-static void* internal_realloc(mstate m, void* oldmem, size_t bytes) {
- if (bytes >= MAX_REQUEST) {
- MALLOC_FAILURE_ACTION;
- return 0;
- }
- if (!PREACTION(m)) {
- mchunkptr oldp = mem2chunk(oldmem);
- size_t oldsize = chunksize(oldp);
- mchunkptr next = chunk_plus_offset(oldp, oldsize);
- mchunkptr newp = 0;
- void* extra = 0;
-
- /* Try to either shrink or extend into top. Else malloc-copy-free */
-
- if (RTCHECK(ok_address(m, oldp) && ok_cinuse(oldp) &&
- ok_next(oldp, next) && ok_pinuse(next))) {
- size_t nb = request2size(bytes);
- if (is_mmapped(oldp))
- newp = mmap_resize(m, oldp, nb);
- else if (oldsize >= nb) { /* already big enough */
- size_t rsize = oldsize - nb;
- newp = oldp;
- if (rsize >= MIN_CHUNK_SIZE) {
- mchunkptr remainder = chunk_plus_offset(newp, nb);
- set_inuse(m, newp, nb);
- set_inuse(m, remainder, rsize);
- extra = chunk2mem(remainder);
- }
- }
- else if (next == m->top && oldsize + m->topsize > nb) {
- /* Expand into top */
- size_t newsize = oldsize + m->topsize;
- size_t newtopsize = newsize - nb;
- mchunkptr newtop = chunk_plus_offset(oldp, nb);
- set_inuse(m, oldp, nb);
- newtop->head = newtopsize |PINUSE_BIT;
- m->top = newtop;
- m->topsize = newtopsize;
- newp = oldp;
- }
- }
- else {
- USAGE_ERROR_ACTION(m, oldmem);
- POSTACTION(m);
- return 0;
- }
-
- POSTACTION(m);
-
- if (newp != 0) {
- if (extra != 0) {
- internal_free(m, extra);
- }
- check_inuse_chunk(m, newp);
- return chunk2mem(newp);
- }
- else {
- void* newmem = internal_malloc(m, bytes);
- if (newmem != 0) {
- size_t oc = oldsize - overhead_for(oldp);
- memcpy(newmem, oldmem, (oc < bytes)? oc : bytes);
- internal_free(m, oldmem);
- }
- return newmem;
- }
- }
- return 0;
-}
-
-/* --------------------------- memalign support -------------------------- */
-
-static void* internal_memalign(mstate m, size_t alignment, size_t bytes) {
- if (alignment <= MALLOC_ALIGNMENT) /* Can just use malloc */
- return internal_malloc(m, bytes);
- if (alignment < MIN_CHUNK_SIZE) /* must be at least a minimum chunk size */
- alignment = MIN_CHUNK_SIZE;
- if ((alignment & (alignment-SIZE_T_ONE)) != 0) {/* Ensure a power of 2 */
- size_t a = MALLOC_ALIGNMENT << 1;
- while (a < alignment) a <<= 1;
- alignment = a;
- }
-
- if (bytes >= MAX_REQUEST - alignment) {
- if (m != 0) { /* Test isn't needed but avoids compiler warning */
- MALLOC_FAILURE_ACTION;
- }
- }
- else {
- size_t nb = request2size(bytes);
- size_t req = nb + alignment + MIN_CHUNK_SIZE - CHUNK_OVERHEAD;
- char* mem = (char*)internal_malloc(m, req);
- if (mem != 0) {
- void* leader = 0;
- void* trailer = 0;
- mchunkptr p = mem2chunk(mem);
-
- if (PREACTION(m)) return 0;
- if ((((size_t)(mem)) % alignment) != 0) { /* misaligned */
- /*
- Find an aligned spot inside chunk. Since we need to give
- back leading space in a chunk of at least MIN_CHUNK_SIZE, if
- the first calculation places us at a spot with less than
- MIN_CHUNK_SIZE leader, we can move to the next aligned spot.
- We've allocated enough total room so that this is always
- possible.
- */
- char* br = (char*)mem2chunk((size_t)(((size_t)(mem +
- alignment -
- SIZE_T_ONE)) &
- -alignment));
- char* pos = ((size_t)(br - (char*)(p)) >= MIN_CHUNK_SIZE)?
- br : br+alignment;
- mchunkptr newp = (mchunkptr)pos;
- size_t leadsize = pos - (char*)(p);
- size_t newsize = chunksize(p) - leadsize;
-
- if (is_mmapped(p)) { /* For mmapped chunks, just adjust offset */
- newp->prev_foot = p->prev_foot + leadsize;
- newp->head = (newsize|CINUSE_BIT);
- }
- else { /* Otherwise, give back leader, use the rest */
- set_inuse(m, newp, newsize);
- set_inuse(m, p, leadsize);
- leader = chunk2mem(p);
- }
- p = newp;
- }
-
- /* Give back spare room at the end */
- if (!is_mmapped(p)) {
- size_t size = chunksize(p);
- if (size > nb + MIN_CHUNK_SIZE) {
- size_t remainder_size = size - nb;
- mchunkptr remainder = chunk_plus_offset(p, nb);
- set_inuse(m, p, nb);
- set_inuse(m, remainder, remainder_size);
- trailer = chunk2mem(remainder);
- }
- }
-
- assert (chunksize(p) >= nb);
- assert((((size_t)(chunk2mem(p))) % alignment) == 0);
- check_inuse_chunk(m, p);
- POSTACTION(m);
- if (leader != 0) {
- internal_free(m, leader);
- }
- if (trailer != 0) {
- internal_free(m, trailer);
- }
- return chunk2mem(p);
- }
- }
- return 0;
-}
-
-/* ------------------------ comalloc/coalloc support --------------------- */
-
-static void** ialloc(mstate m,
- size_t n_elements,
- size_t* sizes,
- int opts,
- void* chunks[]) {
- /*
- This provides common support for independent_X routines, handling
- all of the combinations that can result.
-
- The opts arg has:
- bit 0 set if all elements are same size (using sizes[0])
- bit 1 set if elements should be zeroed
- */
-
- size_t element_size; /* chunksize of each element, if all same */
- size_t contents_size; /* total size of elements */
- size_t array_size; /* request size of pointer array */
- void* mem; /* malloced aggregate space */
- mchunkptr p; /* corresponding chunk */
- size_t remainder_size; /* remaining bytes while splitting */
- void** marray; /* either "chunks" or malloced ptr array */
- mchunkptr array_chunk; /* chunk for malloced ptr array */
- flag_t was_enabled; /* to disable mmap */
- size_t size;
- size_t i;
-
- /* compute array length, if needed */
- if (chunks != 0) {
- if (n_elements == 0)
- return chunks; /* nothing to do */
- marray = chunks;
- array_size = 0;
- }
- else {
- /* if empty req, must still return chunk representing empty array */
- if (n_elements == 0)
- return (void**)internal_malloc(m, 0);
- marray = 0;
- array_size = request2size(n_elements * (sizeof(void*)));
- }
-
- /* compute total element size */
- if (opts & 0x1) { /* all-same-size */
- element_size = request2size(*sizes);
- contents_size = n_elements * element_size;
- }
- else { /* add up all the sizes */
- element_size = 0;
- contents_size = 0;
- for (i = 0; i != n_elements; ++i)
- contents_size += request2size(sizes[i]);
- }
-
- size = contents_size + array_size;
-
- /*
- Allocate the aggregate chunk. First disable direct-mmapping so
- malloc won't use it, since we would not be able to later
- free/realloc space internal to a segregated mmap region.
- */
- was_enabled = use_mmap(m);
- disable_mmap(m);
- mem = internal_malloc(m, size - CHUNK_OVERHEAD);
- if (was_enabled)
- enable_mmap(m);
- if (mem == 0)
- return 0;
-
- if (PREACTION(m)) return 0;
- p = mem2chunk(mem);
- remainder_size = chunksize(p);
-
- assert(!is_mmapped(p));
-
- if (opts & 0x2) { /* optionally clear the elements */
- memset((size_t*)mem, 0, remainder_size - SIZE_T_SIZE - array_size);
- }
-
- /* If not provided, allocate the pointer array as final part of chunk */
- if (marray == 0) {
- size_t array_chunk_size;
- array_chunk = chunk_plus_offset(p, contents_size);
- array_chunk_size = remainder_size - contents_size;
- marray = (void**) (chunk2mem(array_chunk));
- set_size_and_pinuse_of_inuse_chunk(m, array_chunk, array_chunk_size);
- remainder_size = contents_size;
- }
-
- /* split out elements */
- for (i = 0; ; ++i) {
- marray[i] = chunk2mem(p);
- if (i != n_elements-1) {
- if (element_size != 0)
- size = element_size;
- else
- size = request2size(sizes[i]);
- remainder_size -= size;
- set_size_and_pinuse_of_inuse_chunk(m, p, size);
- p = chunk_plus_offset(p, size);
- }
- else { /* the final element absorbs any overallocation slop */
- set_size_and_pinuse_of_inuse_chunk(m, p, remainder_size);
- break;
- }
- }
-
-#if DEBUG
- if (marray != chunks) {
- /* final element must have exactly exhausted chunk */
- if (element_size != 0) {
- assert(remainder_size == element_size);
- }
- else {
- assert(remainder_size == request2size(sizes[i]));
- }
- check_inuse_chunk(m, mem2chunk(marray));
- }
- for (i = 0; i != n_elements; ++i)
- check_inuse_chunk(m, mem2chunk(marray[i]));
-
-#endif /* DEBUG */
-
- POSTACTION(m);
- return marray;
-}
-
-
-/* -------------------------- public routines ---------------------------- */
-
-#if !ONLY_MSPACES
-
-void* dlmalloc(size_t bytes) {
- /*
- Basic algorithm:
- If a small request (< 256 bytes minus per-chunk overhead):
- 1. If one exists, use a remainderless chunk in associated smallbin.
- (Remainderless means that there are too few excess bytes to
- represent as a chunk.)
- 2. If it is big enough, use the dv chunk, which is normally the
- chunk adjacent to the one used for the most recent small request.
- 3. If one exists, split the smallest available chunk in a bin,
- saving remainder in dv.
- 4. If it is big enough, use the top chunk.
- 5. If available, get memory from system and use it
- Otherwise, for a large request:
- 1. Find the smallest available binned chunk that fits, and use it
- if it is better fitting than dv chunk, splitting if necessary.
- 2. If better fitting than any binned chunk, use the dv chunk.
- 3. If it is big enough, use the top chunk.
- 4. If request size >= mmap threshold, try to directly mmap this chunk.
- 5. If available, get memory from system and use it
-
- The ugly goto's here ensure that postaction occurs along all paths.
- */
-
- if (!PREACTION(gm)) {
- void* mem;
- size_t nb;
- if (bytes <= MAX_SMALL_REQUEST) {
- bindex_t idx;
- binmap_t smallbits;
- nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes);
- idx = small_index(nb);
- smallbits = gm->smallmap >> idx;
-
- if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */
- mchunkptr b, p;
- idx += ~smallbits & 1; /* Uses next bin if idx empty */
- b = smallbin_at(gm, idx);
- p = b->fd;
- assert(chunksize(p) == small_index2size(idx));
- unlink_first_small_chunk(gm, b, p, idx);
- set_inuse_and_pinuse(gm, p, small_index2size(idx));
- mem = chunk2mem(p);
- check_malloced_chunk(gm, mem, nb);
- goto postaction;
- }
-
- else if (nb > gm->dvsize) {
- if (smallbits != 0) { /* Use chunk in next nonempty smallbin */
- mchunkptr b, p, r;
- size_t rsize;
- bindex_t i;
- binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx));
- binmap_t leastbit = least_bit(leftbits);
- compute_bit2idx(leastbit, i);
- b = smallbin_at(gm, i);
- p = b->fd;
- assert(chunksize(p) == small_index2size(i));
- unlink_first_small_chunk(gm, b, p, i);
- rsize = small_index2size(i) - nb;
- /* Fit here cannot be remainderless if 4byte sizes */
- if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE)
- set_inuse_and_pinuse(gm, p, small_index2size(i));
- else {
- set_size_and_pinuse_of_inuse_chunk(gm, p, nb);
- r = chunk_plus_offset(p, nb);
- set_size_and_pinuse_of_free_chunk(r, rsize);
- replace_dv(gm, r, rsize);
- }
- mem = chunk2mem(p);
- check_malloced_chunk(gm, mem, nb);
- goto postaction;
- }
-
- else if (gm->treemap != 0 && (mem = tmalloc_small(gm, nb)) != 0) {
- check_malloced_chunk(gm, mem, nb);
- goto postaction;
- }
- }
- }
- else if (bytes >= MAX_REQUEST)
- nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */
- else {
- nb = pad_request(bytes);
- if (gm->treemap != 0 && (mem = tmalloc_large(gm, nb)) != 0) {
- check_malloced_chunk(gm, mem, nb);
- goto postaction;
- }
- }
-
- if (nb <= gm->dvsize) {
- size_t rsize = gm->dvsize - nb;
- mchunkptr p = gm->dv;
- if (rsize >= MIN_CHUNK_SIZE) { /* split dv */
- mchunkptr r = gm->dv = chunk_plus_offset(p, nb);
- gm->dvsize = rsize;
- set_size_and_pinuse_of_free_chunk(r, rsize);
- set_size_and_pinuse_of_inuse_chunk(gm, p, nb);
- }
- else { /* exhaust dv */
- size_t dvs = gm->dvsize;
- gm->dvsize = 0;
- gm->dv = 0;
- set_inuse_and_pinuse(gm, p, dvs);
- }
- mem = chunk2mem(p);
- check_malloced_chunk(gm, mem, nb);
- goto postaction;
- }
-
- else if (nb < gm->topsize) { /* Split top */
- size_t rsize = gm->topsize -= nb;
- mchunkptr p = gm->top;
- mchunkptr r = gm->top = chunk_plus_offset(p, nb);
- r->head = rsize | PINUSE_BIT;
- set_size_and_pinuse_of_inuse_chunk(gm, p, nb);
- mem = chunk2mem(p);
- check_top_chunk(gm, gm->top);
- check_malloced_chunk(gm, mem, nb);
- goto postaction;
- }
-
- mem = sys_alloc(gm, nb);
-
- postaction:
- POSTACTION(gm);
- return mem;
- }
-
- return 0;
-}
-
-void dlfree(void* mem) {
- /*
- Consolidate freed chunks with preceeding or succeeding bordering
- free chunks, if they exist, and then place in a bin. Intermixed
- with special cases for top, dv, mmapped chunks, and usage errors.
- */
-
- if (mem != 0) {
- mchunkptr p = mem2chunk(mem);
-#if FOOTERS
- mstate fm = get_mstate_for(p);
- if (!ok_magic(fm)) {
- USAGE_ERROR_ACTION(fm, p);
- return;
- }
-#else /* FOOTERS */
-#define fm gm
-#endif /* FOOTERS */
- if (!PREACTION(fm)) {
- check_inuse_chunk(fm, p);
- if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) {
- size_t psize = chunksize(p);
- mchunkptr next = chunk_plus_offset(p, psize);
- if (!pinuse(p)) {
- size_t prevsize = p->prev_foot;
- if ((prevsize & IS_MMAPPED_BIT) != 0) {
- prevsize &= ~IS_MMAPPED_BIT;
- psize += prevsize + MMAP_FOOT_PAD;
- if (CALL_MUNMAP((char*)p - prevsize, psize) == 0)
- fm->footprint -= psize;
- goto postaction;
- }
- else {
- mchunkptr prev = chunk_minus_offset(p, prevsize);
- psize += prevsize;
- p = prev;
- if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */
- if (p != fm->dv) {
- unlink_chunk(fm, p, prevsize);
- }
- else if ((next->head & INUSE_BITS) == INUSE_BITS) {
- fm->dvsize = psize;
- set_free_with_pinuse(p, psize, next);
- goto postaction;
- }
- }
- else
- goto erroraction;
- }
- }
-
- if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) {
- if (!cinuse(next)) { /* consolidate forward */
- if (next == fm->top) {
- size_t tsize = fm->topsize += psize;
- fm->top = p;
- p->head = tsize | PINUSE_BIT;
- if (p == fm->dv) {
- fm->dv = 0;
- fm->dvsize = 0;
- }
- if (should_trim(fm, tsize))
- sys_trim(fm, 0);
- goto postaction;
- }
- else if (next == fm->dv) {
- size_t dsize = fm->dvsize += psize;
- fm->dv = p;
- set_size_and_pinuse_of_free_chunk(p, dsize);
- goto postaction;
- }
- else {
- size_t nsize = chunksize(next);
- psize += nsize;
- unlink_chunk(fm, next, nsize);
- set_size_and_pinuse_of_free_chunk(p, psize);
- if (p == fm->dv) {
- fm->dvsize = psize;
- goto postaction;
- }
- }
- }
- else
- set_free_with_pinuse(p, psize, next);
- insert_chunk(fm, p, psize);
- check_free_chunk(fm, p);
- goto postaction;
- }
- }
- erroraction:
- USAGE_ERROR_ACTION(fm, p);
- postaction:
- POSTACTION(fm);
- }
- }
-#if !FOOTERS
-#undef fm
-#endif /* FOOTERS */
-}
-
-void* dlcalloc(size_t n_elements, size_t elem_size) {
- void* mem;
- size_t req = 0;
- if (n_elements != 0) {
- req = n_elements * elem_size;
- if (((n_elements | elem_size) & ~(size_t)0xffff) &&
- (req / n_elements != elem_size))
- req = MAX_SIZE_T; /* force downstream failure on overflow */
- }
- mem = dlmalloc(req);
- if (mem != 0 && calloc_must_clear(mem2chunk(mem)))
- memset(mem, 0, req);
- return mem;
-}
-
-void* dlrealloc(void* oldmem, size_t bytes) {
- if (oldmem == 0)
- return dlmalloc(bytes);
-#ifdef REALLOC_ZERO_BYTES_FREES
- if (bytes == 0) {
- dlfree(oldmem);
- return 0;
- }
-#endif /* REALLOC_ZERO_BYTES_FREES */
- else {
-#if ! FOOTERS
- mstate m = gm;
-#else /* FOOTERS */
- mstate m = get_mstate_for(mem2chunk(oldmem));
- if (!ok_magic(m)) {
- USAGE_ERROR_ACTION(m, oldmem);
- return 0;
- }
-#endif /* FOOTERS */
- return internal_realloc(m, oldmem, bytes);
- }
-}
-
-void* dlmemalign(size_t alignment, size_t bytes) {
- return internal_memalign(gm, alignment, bytes);
-}
-
-void** dlindependent_calloc(size_t n_elements, size_t elem_size,
- void* chunks[]) {
- size_t sz = elem_size; /* serves as 1-element array */
- return ialloc(gm, n_elements, &sz, 3, chunks);
-}
-
-void** dlindependent_comalloc(size_t n_elements, size_t sizes[],
- void* chunks[]) {
- return ialloc(gm, n_elements, sizes, 0, chunks);
-}
-
-void* dlvalloc(size_t bytes) {
- size_t pagesz;
- init_mparams();
- pagesz = mparams.page_size;
- return dlmemalign(pagesz, bytes);
-}
-
-void* dlpvalloc(size_t bytes) {
- size_t pagesz;
- init_mparams();
- pagesz = mparams.page_size;
- return dlmemalign(pagesz, (bytes + pagesz - SIZE_T_ONE) & ~(pagesz - SIZE_T_ONE));
-}
-
-int dlmalloc_trim(size_t pad) {
- int result = 0;
- if (!PREACTION(gm)) {
- result = sys_trim(gm, pad);
- POSTACTION(gm);
- }
- return result;
-}
-
-size_t dlmalloc_footprint(void) {
- return gm->footprint;
-}
-
-size_t dlmalloc_max_footprint(void) {
- return gm->max_footprint;
-}
-
-#if !NO_MALLINFO
-struct mallinfo dlmallinfo(void) {
- return internal_mallinfo(gm);
-}
-#endif /* NO_MALLINFO */
-
-void dlmalloc_stats() {
- internal_malloc_stats(gm);
-}
-
-size_t dlmalloc_usable_size(void* mem) {
- if (mem != 0) {
- mchunkptr p = mem2chunk(mem);
- if (cinuse(p))
- return chunksize(p) - overhead_for(p);
- }
- return 0;
-}
-
-int dlmallopt(int param_number, int value) {
- return change_mparam(param_number, value);
-}
-
-#endif /* !ONLY_MSPACES */
-
-/* ----------------------------- user mspaces ---------------------------- */
-
-#if MSPACES
-
-static mstate init_user_mstate(char* tbase, size_t tsize) {
- size_t msize = pad_request(sizeof(struct malloc_state));
- mchunkptr mn;
- mchunkptr msp = align_as_chunk(tbase);
- mstate m = (mstate)(chunk2mem(msp));
- memset(m, 0, msize);
- INITIAL_LOCK(&m->mutex);
- msp->head = (msize|PINUSE_BIT|CINUSE_BIT);
- m->seg.base = m->least_addr = tbase;
- m->seg.size = m->footprint = m->max_footprint = tsize;
- m->magic = mparams.magic;
- m->mflags = mparams.default_mflags;
- disable_contiguous(m);
- init_bins(m);
- mn = next_chunk(mem2chunk(m));
- init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) - TOP_FOOT_SIZE);
- check_top_chunk(m, m->top);
- return m;
-}
-
-mspace create_mspace(size_t capacity, int locked) {
- mstate m = 0;
- size_t msize = pad_request(sizeof(struct malloc_state));
- init_mparams(); /* Ensure pagesize etc initialized */
-
- if (capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) {
- size_t rs = ((capacity == 0)? mparams.granularity :
- (capacity + TOP_FOOT_SIZE + msize));
- size_t tsize = granularity_align(rs);
- char* tbase = (char*)(CALL_MMAP(tsize));
- if (tbase != CMFAIL) {
- m = init_user_mstate(tbase, tsize);
- m->seg.sflags = IS_MMAPPED_BIT;
- set_lock(m, locked);
- }
- }
- return (mspace)m;
-}
-
-mspace create_mspace_with_base(void* base, size_t capacity, int locked) {
- mstate m = 0;
- size_t msize = pad_request(sizeof(struct malloc_state));
- init_mparams(); /* Ensure pagesize etc initialized */
-
- if (capacity > msize + TOP_FOOT_SIZE &&
- capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) {
- m = init_user_mstate((char*)base, capacity);
- m->seg.sflags = EXTERN_BIT;
- set_lock(m, locked);
- }
- return (mspace)m;
-}
-
-size_t destroy_mspace(mspace msp) {
- size_t freed = 0;
- mstate ms = (mstate)msp;
- if (ok_magic(ms)) {
- msegmentptr sp = &ms->seg;
- while (sp != 0) {
- char* base = sp->base;
- size_t size = sp->size;
- flag_t flag = sp->sflags;
- sp = sp->next;
- if ((flag & IS_MMAPPED_BIT) && !(flag & EXTERN_BIT) &&
- CALL_MUNMAP(base, size) == 0)
- freed += size;
- }
- }
- else {
- USAGE_ERROR_ACTION(ms,ms);
- }
- return freed;
-}
-
-/*
- mspace versions of routines are near-clones of the global
- versions. This is not so nice but better than the alternatives.
-*/
-
-
-void* mspace_malloc(mspace msp, size_t bytes) {
- mstate ms = (mstate)msp;
- if (!ok_magic(ms)) {
- USAGE_ERROR_ACTION(ms,ms);
- return 0;
- }
- if (!PREACTION(ms)) {
- void* mem;
- size_t nb;
- if (bytes <= MAX_SMALL_REQUEST) {
- bindex_t idx;
- binmap_t smallbits;
- nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes);
- idx = small_index(nb);
- smallbits = ms->smallmap >> idx;
-
- if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */
- mchunkptr b, p;
- idx += ~smallbits & 1; /* Uses next bin if idx empty */
- b = smallbin_at(ms, idx);
- p = b->fd;
- assert(chunksize(p) == small_index2size(idx));
- unlink_first_small_chunk(ms, b, p, idx);
- set_inuse_and_pinuse(ms, p, small_index2size(idx));
- mem = chunk2mem(p);
- check_malloced_chunk(ms, mem, nb);
- goto postaction;
- }
-
- else if (nb > ms->dvsize) {
- if (smallbits != 0) { /* Use chunk in next nonempty smallbin */
- mchunkptr b, p, r;
- size_t rsize;
- bindex_t i;
- binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx));
- binmap_t leastbit = least_bit(leftbits);
- compute_bit2idx(leastbit, i);
- b = smallbin_at(ms, i);
- p = b->fd;
- assert(chunksize(p) == small_index2size(i));
- unlink_first_small_chunk(ms, b, p, i);
- rsize = small_index2size(i) - nb;
- /* Fit here cannot be remainderless if 4byte sizes */
- if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE)
- set_inuse_and_pinuse(ms, p, small_index2size(i));
- else {
- set_size_and_pinuse_of_inuse_chunk(ms, p, nb);
- r = chunk_plus_offset(p, nb);
- set_size_and_pinuse_of_free_chunk(r, rsize);
- replace_dv(ms, r, rsize);
- }
- mem = chunk2mem(p);
- check_malloced_chunk(ms, mem, nb);
- goto postaction;
- }
-
- else if (ms->treemap != 0 && (mem = tmalloc_small(ms, nb)) != 0) {
- check_malloced_chunk(ms, mem, nb);
- goto postaction;
- }
- }
- }
- else if (bytes >= MAX_REQUEST)
- nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */
- else {
- nb = pad_request(bytes);
- if (ms->treemap != 0 && (mem = tmalloc_large(ms, nb)) != 0) {
- check_malloced_chunk(ms, mem, nb);
- goto postaction;
- }
- }
-
- if (nb <= ms->dvsize) {
- size_t rsize = ms->dvsize - nb;
- mchunkptr p = ms->dv;
- if (rsize >= MIN_CHUNK_SIZE) { /* split dv */
- mchunkptr r = ms->dv = chunk_plus_offset(p, nb);
- ms->dvsize = rsize;
- set_size_and_pinuse_of_free_chunk(r, rsize);
- set_size_and_pinuse_of_inuse_chunk(ms, p, nb);
- }
- else { /* exhaust dv */
- size_t dvs = ms->dvsize;
- ms->dvsize = 0;
- ms->dv = 0;
- set_inuse_and_pinuse(ms, p, dvs);
- }
- mem = chunk2mem(p);
- check_malloced_chunk(ms, mem, nb);
- goto postaction;
- }
-
- else if (nb < ms->topsize) { /* Split top */
- size_t rsize = ms->topsize -= nb;
- mchunkptr p = ms->top;
- mchunkptr r = ms->top = chunk_plus_offset(p, nb);
- r->head = rsize | PINUSE_BIT;
- set_size_and_pinuse_of_inuse_chunk(ms, p, nb);
- mem = chunk2mem(p);
- check_top_chunk(ms, ms->top);
- check_malloced_chunk(ms, mem, nb);
- goto postaction;
- }
-
- mem = sys_alloc(ms, nb);
-
- postaction:
- POSTACTION(ms);
- return mem;
- }
-
- return 0;
-}
-
-void mspace_free(mspace msp, void* mem) {
- if (mem != 0) {
- mchunkptr p = mem2chunk(mem);
-#if FOOTERS
- mstate fm = get_mstate_for(p);
-#else /* FOOTERS */
- mstate fm = (mstate)msp;
-#endif /* FOOTERS */
- if (!ok_magic(fm)) {
- USAGE_ERROR_ACTION(fm, p);
- return;
- }
- if (!PREACTION(fm)) {
- check_inuse_chunk(fm, p);
- if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) {
- size_t psize = chunksize(p);
- mchunkptr next = chunk_plus_offset(p, psize);
- if (!pinuse(p)) {
- size_t prevsize = p->prev_foot;
- if ((prevsize & IS_MMAPPED_BIT) != 0) {
- prevsize &= ~IS_MMAPPED_BIT;
- psize += prevsize + MMAP_FOOT_PAD;
- if (CALL_MUNMAP((char*)p - prevsize, psize) == 0)
- fm->footprint -= psize;
- goto postaction;
- }
- else {
- mchunkptr prev = chunk_minus_offset(p, prevsize);
- psize += prevsize;
- p = prev;
- if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */
- if (p != fm->dv) {
- unlink_chunk(fm, p, prevsize);
- }
- else if ((next->head & INUSE_BITS) == INUSE_BITS) {
- fm->dvsize = psize;
- set_free_with_pinuse(p, psize, next);
- goto postaction;
- }
- }
- else
- goto erroraction;
- }
- }
-
- if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) {
- if (!cinuse(next)) { /* consolidate forward */
- if (next == fm->top) {
- size_t tsize = fm->topsize += psize;
- fm->top = p;
- p->head = tsize | PINUSE_BIT;
- if (p == fm->dv) {
- fm->dv = 0;
- fm->dvsize = 0;
- }
- if (should_trim(fm, tsize))
- sys_trim(fm, 0);
- goto postaction;
- }
- else if (next == fm->dv) {
- size_t dsize = fm->dvsize += psize;
- fm->dv = p;
- set_size_and_pinuse_of_free_chunk(p, dsize);
- goto postaction;
- }
- else {
- size_t nsize = chunksize(next);
- psize += nsize;
- unlink_chunk(fm, next, nsize);
- set_size_and_pinuse_of_free_chunk(p, psize);
- if (p == fm->dv) {
- fm->dvsize = psize;
- goto postaction;
- }
- }
- }
- else
- set_free_with_pinuse(p, psize, next);
- insert_chunk(fm, p, psize);
- check_free_chunk(fm, p);
- goto postaction;
- }
- }
- erroraction:
- USAGE_ERROR_ACTION(fm, p);
- postaction:
- POSTACTION(fm);
- }
- }
-}
-
-void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size) {
- void* mem;
- size_t req = 0;
- mstate ms = (mstate)msp;
- if (!ok_magic(ms)) {
- USAGE_ERROR_ACTION(ms,ms);
- return 0;
- }
- if (n_elements != 0) {
- req = n_elements * elem_size;
- if (((n_elements | elem_size) & ~(size_t)0xffff) &&
- (req / n_elements != elem_size))
- req = MAX_SIZE_T; /* force downstream failure on overflow */
- }
- mem = internal_malloc(ms, req);
- if (mem != 0 && calloc_must_clear(mem2chunk(mem)))
- memset(mem, 0, req);
- return mem;
-}
-
-void* mspace_realloc(mspace msp, void* oldmem, size_t bytes) {
- if (oldmem == 0)
- return mspace_malloc(msp, bytes);
-#ifdef REALLOC_ZERO_BYTES_FREES
- if (bytes == 0) {
- mspace_free(msp, oldmem);
- return 0;
- }
-#endif /* REALLOC_ZERO_BYTES_FREES */
- else {
-#if FOOTERS
- mchunkptr p = mem2chunk(oldmem);
- mstate ms = get_mstate_for(p);
-#else /* FOOTERS */
- mstate ms = (mstate)msp;
-#endif /* FOOTERS */
- if (!ok_magic(ms)) {
- USAGE_ERROR_ACTION(ms,ms);
- return 0;
- }
- return internal_realloc(ms, oldmem, bytes);
- }
-}
-
-void* mspace_memalign(mspace msp, size_t alignment, size_t bytes) {
- mstate ms = (mstate)msp;
- if (!ok_magic(ms)) {
- USAGE_ERROR_ACTION(ms,ms);
- return 0;
- }
- return internal_memalign(ms, alignment, bytes);
-}
-
-void** mspace_independent_calloc(mspace msp, size_t n_elements,
- size_t elem_size, void* chunks[]) {
- size_t sz = elem_size; /* serves as 1-element array */
- mstate ms = (mstate)msp;
- if (!ok_magic(ms)) {
- USAGE_ERROR_ACTION(ms,ms);
- return 0;
- }
- return ialloc(ms, n_elements, &sz, 3, chunks);
-}
-
-void** mspace_independent_comalloc(mspace msp, size_t n_elements,
- size_t sizes[], void* chunks[]) {
- mstate ms = (mstate)msp;
- if (!ok_magic(ms)) {
- USAGE_ERROR_ACTION(ms,ms);
- return 0;
- }
- return ialloc(ms, n_elements, sizes, 0, chunks);
-}
-
-int mspace_trim(mspace msp, size_t pad) {
- int result = 0;
- mstate ms = (mstate)msp;
- if (ok_magic(ms)) {
- if (!PREACTION(ms)) {
- result = sys_trim(ms, pad);
- POSTACTION(ms);
- }
- }
- else {
- USAGE_ERROR_ACTION(ms,ms);
- }
- return result;
-}
-
-void mspace_malloc_stats(mspace msp) {
- mstate ms = (mstate)msp;
- if (ok_magic(ms)) {
- internal_malloc_stats(ms);
- }
- else {
- USAGE_ERROR_ACTION(ms,ms);
- }
-}
-
-size_t mspace_footprint(mspace msp) {
- size_t result;
- mstate ms = (mstate)msp;
- if (ok_magic(ms)) {
- result = ms->footprint;
- }
- USAGE_ERROR_ACTION(ms,ms);
- return result;
-}
-
-
-size_t mspace_max_footprint(mspace msp) {
- size_t result;
- mstate ms = (mstate)msp;
- if (ok_magic(ms)) {
- result = ms->max_footprint;
- }
- USAGE_ERROR_ACTION(ms,ms);
- return result;
-}
-
-
-#if !NO_MALLINFO
-struct mallinfo mspace_mallinfo(mspace msp) {
- mstate ms = (mstate)msp;
- if (!ok_magic(ms)) {
- USAGE_ERROR_ACTION(ms,ms);
- }
- return internal_mallinfo(ms);
-}
-#endif /* NO_MALLINFO */
-
-int mspace_mallopt(int param_number, int value) {
- return change_mparam(param_number, value);
-}
-
-#endif /* MSPACES */
-
-/* -------------------- Alternative MORECORE functions ------------------- */
-
-/*
- Guidelines for creating a custom version of MORECORE:
-
- * For best performance, MORECORE should allocate in multiples of pagesize.
- * MORECORE may allocate more memory than requested. (Or even less,
- but this will usually result in a malloc failure.)
- * MORECORE must not allocate memory when given argument zero, but
- instead return one past the end address of memory from previous
- nonzero call.
- * For best performance, consecutive calls to MORECORE with positive
- arguments should return increasing addresses, indicating that
- space has been contiguously extended.
- * Even though consecutive calls to MORECORE need not return contiguous
- addresses, it must be OK for malloc'ed chunks to span multiple
- regions in those cases where they do happen to be contiguous.
- * MORECORE need not handle negative arguments -- it may instead
- just return MFAIL when given negative arguments.
- Negative arguments are always multiples of pagesize. MORECORE
- must not misinterpret negative args as large positive unsigned
- args. You can suppress all such calls from even occurring by defining
- MORECORE_CANNOT_TRIM,
-
- As an example alternative MORECORE, here is a custom allocator
- kindly contributed for pre-OSX macOS. It uses virtually but not
- necessarily physically contiguous non-paged memory (locked in,
- present and won't get swapped out). You can use it by uncommenting
- this section, adding some #includes, and setting up the appropriate
- defines above:
-
- #define MORECORE osMoreCore
-
- There is also a shutdown routine that should somehow be called for
- cleanup upon program exit.
-
- #define MAX_POOL_ENTRIES 100
- #define MINIMUM_MORECORE_SIZE (64 * 1024U)
- static int next_os_pool;
- void *our_os_pools[MAX_POOL_ENTRIES];
-
- void *osMoreCore(int size)
- {
- void *ptr = 0;
- static void *sbrk_top = 0;
-
- if (size > 0)
- {
- if (size < MINIMUM_MORECORE_SIZE)
- size = MINIMUM_MORECORE_SIZE;
- if (CurrentExecutionLevel() == kTaskLevel)
- ptr = PoolAllocateResident(size + RM_PAGE_SIZE, 0);
- if (ptr == 0)
- {
- return (void *) MFAIL;
- }
- // save ptrs so they can be freed during cleanup
- our_os_pools[next_os_pool] = ptr;
- next_os_pool++;
- ptr = (void *) ((((size_t) ptr) + RM_PAGE_MASK) & ~RM_PAGE_MASK);
- sbrk_top = (char *) ptr + size;
- return ptr;
- }
- else if (size < 0)
- {
- // we don't currently support shrink behavior
- return (void *) MFAIL;
- }
- else
- {
- return sbrk_top;
- }
- }
-
- // cleanup any allocated memory pools
- // called as last thing before shutting down driver
-
- void osCleanupMem(void)
- {
- void **ptr;
-
- for (ptr = our_os_pools; ptr < &our_os_pools[MAX_POOL_ENTRIES]; ptr++)
- if (*ptr)
- {
- PoolDeallocate(*ptr);
- *ptr = 0;
- }
- }
-
-*/
-
-
-/* -----------------------------------------------------------------------
-History:
- V2.8.3 Thu Sep 22 11:16:32 2005 Doug Lea (dl at gee)
- * Add max_footprint functions
- * Ensure all appropriate literals are size_t
- * Fix conditional compilation problem for some #define settings
- * Avoid concatenating segments with the one provided
- in create_mspace_with_base
- * Rename some variables to avoid compiler shadowing warnings
- * Use explicit lock initialization.
- * Better handling of sbrk interference.
- * Simplify and fix segment insertion, trimming and mspace_destroy
- * Reinstate REALLOC_ZERO_BYTES_FREES option from 2.7.x
- * Thanks especially to Dennis Flanagan for help on these.
-
- V2.8.2 Sun Jun 12 16:01:10 2005 Doug Lea (dl at gee)
- * Fix memalign brace error.
-
- V2.8.1 Wed Jun 8 16:11:46 2005 Doug Lea (dl at gee)
- * Fix improper #endif nesting in C++
- * Add explicit casts needed for C++
-
- V2.8.0 Mon May 30 14:09:02 2005 Doug Lea (dl at gee)
- * Use trees for large bins
- * Support mspaces
- * Use segments to unify sbrk-based and mmap-based system allocation,
- removing need for emulation on most platforms without sbrk.
- * Default safety checks
- * Optional footer checks. Thanks to William Robertson for the idea.
- * Internal code refactoring
- * Incorporate suggestions and platform-specific changes.
- Thanks to Dennis Flanagan, Colin Plumb, Niall Douglas,
- Aaron Bachmann, Emery Berger, and others.
- * Speed up non-fastbin processing enough to remove fastbins.
- * Remove useless cfree() to avoid conflicts with other apps.
- * Remove internal memcpy, memset. Compilers handle builtins better.
- * Remove some options that no one ever used and rename others.
-
- V2.7.2 Sat Aug 17 09:07:30 2002 Doug Lea (dl at gee)
- * Fix malloc_state bitmap array misdeclaration
-
- V2.7.1 Thu Jul 25 10:58:03 2002 Doug Lea (dl at gee)
- * Allow tuning of FIRST_SORTED_BIN_SIZE
- * Use PTR_UINT as type for all ptr->int casts. Thanks to John Belmonte.
- * Better detection and support for non-contiguousness of MORECORE.
- Thanks to Andreas Mueller, Conal Walsh, and Wolfram Gloger
- * Bypass most of malloc if no frees. Thanks To Emery Berger.
- * Fix freeing of old top non-contiguous chunk im sysmalloc.
- * Raised default trim and map thresholds to 256K.
- * Fix mmap-related #defines. Thanks to Lubos Lunak.
- * Fix copy macros; added LACKS_FCNTL_H. Thanks to Neal Walfield.
- * Branch-free bin calculation
- * Default trim and mmap thresholds now 256K.
-
- V2.7.0 Sun Mar 11 14:14:06 2001 Doug Lea (dl at gee)
- * Introduce independent_comalloc and independent_calloc.
- Thanks to Michael Pachos for motivation and help.
- * Make optional .h file available
- * Allow > 2GB requests on 32bit systems.
- * new WIN32 sbrk, mmap, munmap, lock code from <Walter@GeNeSys-e.de>.
- Thanks also to Andreas Mueller <a.mueller at paradatec.de>,
- and Anonymous.
- * Allow override of MALLOC_ALIGNMENT (Thanks to Ruud Waij for
- helping test this.)
- * memalign: check alignment arg
- * realloc: don't try to shift chunks backwards, since this
- leads to more fragmentation in some programs and doesn't
- seem to help in any others.
- * Collect all cases in malloc requiring system memory into sysmalloc
- * Use mmap as backup to sbrk
- * Place all internal state in malloc_state
- * Introduce fastbins (although similar to 2.5.1)
- * Many minor tunings and cosmetic improvements
- * Introduce USE_PUBLIC_MALLOC_WRAPPERS, USE_MALLOC_LOCK
- * Introduce MALLOC_FAILURE_ACTION, MORECORE_CONTIGUOUS
- Thanks to Tony E. Bennett <tbennett@nvidia.com> and others.
- * Include errno.h to support default failure action.
-
- V2.6.6 Sun Dec 5 07:42:19 1999 Doug Lea (dl at gee)
- * return null for negative arguments
- * Added Several WIN32 cleanups from Martin C. Fong <mcfong at yahoo.com>
- * Add 'LACKS_SYS_PARAM_H' for those systems without 'sys/param.h'
- (e.g. WIN32 platforms)
- * Cleanup header file inclusion for WIN32 platforms
- * Cleanup code to avoid Microsoft Visual C++ compiler complaints
- * Add 'USE_DL_PREFIX' to quickly allow co-existence with existing
- memory allocation routines
- * Set 'malloc_getpagesize' for WIN32 platforms (needs more work)
- * Use 'assert' rather than 'ASSERT' in WIN32 code to conform to
- usage of 'assert' in non-WIN32 code
- * Improve WIN32 'sbrk()' emulation's 'findRegion()' routine to
- avoid infinite loop
- * Always call 'fREe()' rather than 'free()'
-
- V2.6.5 Wed Jun 17 15:57:31 1998 Doug Lea (dl at gee)
- * Fixed ordering problem with boundary-stamping
-
- V2.6.3 Sun May 19 08:17:58 1996 Doug Lea (dl at gee)
- * Added pvalloc, as recommended by H.J. Liu
- * Added 64bit pointer support mainly from Wolfram Gloger
- * Added anonymously donated WIN32 sbrk emulation
- * Malloc, calloc, getpagesize: add optimizations from Raymond Nijssen
- * malloc_extend_top: fix mask error that caused wastage after
- foreign sbrks
- * Add linux mremap support code from HJ Liu
-
- V2.6.2 Tue Dec 5 06:52:55 1995 Doug Lea (dl at gee)
- * Integrated most documentation with the code.
- * Add support for mmap, with help from
- Wolfram Gloger (Gloger@lrz.uni-muenchen.de).
- * Use last_remainder in more cases.
- * Pack bins using idea from colin@nyx10.cs.du.edu
- * Use ordered bins instead of best-fit threshhold
- * Eliminate block-local decls to simplify tracing and debugging.
- * Support another case of realloc via move into top
- * Fix error occuring when initial sbrk_base not word-aligned.
- * Rely on page size for units instead of SBRK_UNIT to
- avoid surprises about sbrk alignment conventions.
- * Add mallinfo, mallopt. Thanks to Raymond Nijssen
- (raymond@es.ele.tue.nl) for the suggestion.
- * Add `pad' argument to malloc_trim and top_pad mallopt parameter.
- * More precautions for cases where other routines call sbrk,
- courtesy of Wolfram Gloger (Gloger@lrz.uni-muenchen.de).
- * Added macros etc., allowing use in linux libc from
- H.J. Lu (hjl@gnu.ai.mit.edu)
- * Inverted this history list
-
- V2.6.1 Sat Dec 2 14:10:57 1995 Doug Lea (dl at gee)
- * Re-tuned and fixed to behave more nicely with V2.6.0 changes.
- * Removed all preallocation code since under current scheme
- the work required to undo bad preallocations exceeds
- the work saved in good cases for most test programs.
- * No longer use return list or unconsolidated bins since
- no scheme using them consistently outperforms those that don't
- given above changes.
- * Use best fit for very large chunks to prevent some worst-cases.
- * Added some support for debugging
-
- V2.6.0 Sat Nov 4 07:05:23 1995 Doug Lea (dl at gee)
- * Removed footers when chunks are in use. Thanks to
- Paul Wilson (wilson@cs.texas.edu) for the suggestion.
-
- V2.5.4 Wed Nov 1 07:54:51 1995 Doug Lea (dl at gee)
- * Added malloc_trim, with help from Wolfram Gloger
- (wmglo@Dent.MED.Uni-Muenchen.DE).
-
- V2.5.3 Tue Apr 26 10:16:01 1994 Doug Lea (dl at g)
-
- V2.5.2 Tue Apr 5 16:20:40 1994 Doug Lea (dl at g)
- * realloc: try to expand in both directions
- * malloc: swap order of clean-bin strategy;
- * realloc: only conditionally expand backwards
- * Try not to scavenge used bins
- * Use bin counts as a guide to preallocation
- * Occasionally bin return list chunks in first scan
- * Add a few optimizations from colin@nyx10.cs.du.edu
-
- V2.5.1 Sat Aug 14 15:40:43 1993 Doug Lea (dl at g)
- * faster bin computation & slightly different binning
- * merged all consolidations to one part of malloc proper
- (eliminating old malloc_find_space & malloc_clean_bin)
- * Scan 2 returns chunks (not just 1)
- * Propagate failure in realloc if malloc returns 0
- * Add stuff to allow compilation on non-ANSI compilers
- from kpv@research.att.com
-
- V2.5 Sat Aug 7 07:41:59 1993 Doug Lea (dl at g.oswego.edu)
- * removed potential for odd address access in prev_chunk
- * removed dependency on getpagesize.h
- * misc cosmetics and a bit more internal documentation
- * anticosmetics: mangled names in macros to evade debugger strangeness
- * tested on sparc, hp-700, dec-mips, rs6000
- with gcc & native cc (hp, dec only) allowing
- Detlefs & Zorn comparison study (in SIGPLAN Notices.)
-
- 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/distrib/sdl-1.2.12/src/stdlib/SDL_qsort.c b/distrib/sdl-1.2.12/src/stdlib/SDL_qsort.c
deleted file mode 100644
index 9278d25..0000000
--- a/distrib/sdl-1.2.12/src/stdlib/SDL_qsort.c
+++ /dev/null
@@ -1,425 +0,0 @@
-/* qsort.c
- * (c) 1998 Gareth McCaughan
- *
- * This is a drop-in replacement for the C library's |qsort()| routine.
- *
- * Features:
- * - Median-of-three pivoting (and more)
- * - Truncation and final polishing by a single insertion sort
- * - Early truncation when no swaps needed in pivoting step
- * - Explicit recursion, guaranteed not to overflow
- * - A few little wrinkles stolen from the GNU |qsort()|.
- * - separate code for non-aligned / aligned / word-size objects
- *
- * This code may be reproduced freely provided
- * - this file is retained unaltered apart from minor
- * changes for portability and efficiency
- * - no changes are made to this comment
- * - any changes that *are* made are clearly flagged
- * - the _ID string below is altered by inserting, after
- * the date, the string " altered" followed at your option
- * by other material. (Exceptions: you may change the name
- * of the exported routine without changing the ID string.
- * You may change the values of the macros TRUNC_* and
- * PIVOT_THRESHOLD without changing the ID string, provided
- * they remain constants with TRUNC_nonaligned, TRUNC_aligned
- * and TRUNC_words/WORD_BYTES between 8 and 24, and
- * PIVOT_THRESHOLD between 32 and 200.)
- *
- * You may use it in anything you like; you may make money
- * out of it; you may distribute it in object form or as
- * part of an executable without including source code;
- * you don't have to credit me. (But it would be nice if
- * you did.)
- *
- * If you find problems with this code, or find ways of
- * making it significantly faster, please let me know!
- * My e-mail address, valid as of early 1998 and certainly
- * OK for at least the next 18 months, is
- * gjm11@dpmms.cam.ac.uk
- * Thanks!
- *
- * Gareth McCaughan Peterhouse Cambridge 1998
- */
-#include "SDL_config.h"
-
-/*
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-*/
-#include "SDL_stdinc.h"
-
-#define assert(X)
-#define malloc SDL_malloc
-#define free SDL_free
-#define memcpy SDL_memcpy
-#define memmove SDL_memmove
-#define qsort SDL_qsort
-
-
-#ifndef HAVE_QSORT
-
-static char _ID[]="<qsort.c gjm 1.12 1998-03-19>";
-
-/* How many bytes are there per word? (Must be a power of 2,
- * and must in fact equal sizeof(int).)
- */
-#define WORD_BYTES sizeof(int)
-
-/* How big does our stack need to be? Answer: one entry per
- * bit in a |size_t|.
- */
-#define STACK_SIZE (8*sizeof(size_t))
-
-/* Different situations have slightly different requirements,
- * and we make life epsilon easier by using different truncation
- * points for the three different cases.
- * So far, I have tuned TRUNC_words and guessed that the same
- * value might work well for the other two cases. Of course
- * what works well on my machine might work badly on yours.
- */
-#define TRUNC_nonaligned 12
-#define TRUNC_aligned 12
-#define TRUNC_words 12*WORD_BYTES /* nb different meaning */
-
-/* We use a simple pivoting algorithm for shortish sub-arrays
- * and a more complicated one for larger ones. The threshold
- * is PIVOT_THRESHOLD.
- */
-#define PIVOT_THRESHOLD 40
-
-typedef struct { char * first; char * last; } stack_entry;
-#define pushLeft {stack[stacktop].first=ffirst;stack[stacktop++].last=last;}
-#define pushRight {stack[stacktop].first=first;stack[stacktop++].last=llast;}
-#define doLeft {first=ffirst;llast=last;continue;}
-#define doRight {ffirst=first;last=llast;continue;}
-#define pop {if (--stacktop<0) break;\
- first=ffirst=stack[stacktop].first;\
- last=llast=stack[stacktop].last;\
- continue;}
-
-/* Some comments on the implementation.
- * 1. When we finish partitioning the array into "low"
- * and "high", we forget entirely about short subarrays,
- * because they'll be done later by insertion sort.
- * Doing lots of little insertion sorts might be a win
- * on large datasets for locality-of-reference reasons,
- * but it makes the code much nastier and increases
- * bookkeeping overhead.
- * 2. We always save the shorter and get to work on the
- * longer. This guarantees that every time we push
- * an item onto the stack its size is <= 1/2 of that
- * of its parent; so the stack can't need more than
- * log_2(max-array-size) entries.
- * 3. We choose a pivot by looking at the first, last
- * and middle elements. We arrange them into order
- * because it's easy to do that in conjunction with
- * choosing the pivot, and it makes things a little
- * easier in the partitioning step. Anyway, the pivot
- * is the middle of these three. It's still possible
- * to construct datasets where the algorithm takes
- * time of order n^2, but it simply never happens in
- * practice.
- * 3' Newsflash: On further investigation I find that
- * it's easy to construct datasets where median-of-3
- * simply isn't good enough. So on large-ish subarrays
- * we do a more sophisticated pivoting: we take three
- * sets of 3 elements, find their medians, and then
- * take the median of those.
- * 4. We copy the pivot element to a separate place
- * because that way we can always do our comparisons
- * directly against a pointer to that separate place,
- * and don't have to wonder "did we move the pivot
- * element?". This makes the inner loop better.
- * 5. It's possible to make the pivoting even more
- * reliable by looking at more candidates when n
- * is larger. (Taking this to its logical conclusion
- * results in a variant of quicksort that doesn't
- * have that n^2 worst case.) However, the overhead
- * from the extra bookkeeping means that it's just
- * not worth while.
- * 6. This is pretty clean and portable code. Here are
- * all the potential portability pitfalls and problems
- * I know of:
- * - In one place (the insertion sort) I construct
- * a pointer that points just past the end of the
- * supplied array, and assume that (a) it won't
- * compare equal to any pointer within the array,
- * and (b) it will compare equal to a pointer
- * obtained by stepping off the end of the array.
- * These might fail on some segmented architectures.
- * - I assume that there are 8 bits in a |char| when
- * computing the size of stack needed. This would
- * fail on machines with 9-bit or 16-bit bytes.
- * - I assume that if |((int)base&(sizeof(int)-1))==0|
- * and |(size&(sizeof(int)-1))==0| then it's safe to
- * get at array elements via |int*|s, and that if
- * actually |size==sizeof(int)| as well then it's
- * safe to treat the elements as |int|s. This might
- * fail on systems that convert pointers to integers
- * in non-standard ways.
- * - I assume that |8*sizeof(size_t)<=INT_MAX|. This
- * would be false on a machine with 8-bit |char|s,
- * 16-bit |int|s and 4096-bit |size_t|s. :-)
- */
-
-/* The recursion logic is the same in each case: */
-#define Recurse(Trunc) \
- { size_t l=last-ffirst,r=llast-first; \
- if (l<Trunc) { \
- if (r>=Trunc) doRight \
- else pop \
- } \
- else if (l<=r) { pushLeft; doRight } \
- else if (r>=Trunc) { pushRight; doLeft }\
- else doLeft \
- }
-
-/* and so is the pivoting logic: */
-#define Pivot(swapper,sz) \
- if ((size_t)(last-first)>PIVOT_THRESHOLD*sz) mid=pivot_big(first,mid,last,sz,compare);\
- else { \
- if (compare(first,mid)<0) { \
- if (compare(mid,last)>0) { \
- swapper(mid,last); \
- if (compare(first,mid)>0) swapper(first,mid);\
- } \
- } \
- else { \
- if (compare(mid,last)>0) swapper(first,last)\
- else { \
- swapper(first,mid); \
- if (compare(mid,last)>0) swapper(mid,last);\
- } \
- } \
- first+=sz; last-=sz; \
- }
-
-#ifdef DEBUG_QSORT
-#include <stdio.h>
-#endif
-
-/* and so is the partitioning logic: */
-#define Partition(swapper,sz) { \
- int swapped=0; \
- do { \
- while (compare(first,pivot)<0) first+=sz; \
- while (compare(pivot,last)<0) last-=sz; \
- if (first<last) { \
- swapper(first,last); swapped=1; \
- first+=sz; last-=sz; } \
- else if (first==last) { first+=sz; last-=sz; break; }\
- } while (first<=last); \
- if (!swapped) pop \
-}
-
-/* and so is the pre-insertion-sort operation of putting
- * the smallest element into place as a sentinel.
- * Doing this makes the inner loop nicer. I got this
- * idea from the GNU implementation of qsort().
- */
-#define PreInsertion(swapper,limit,sz) \
- first=base; \
- last=first + (nmemb>limit ? limit : nmemb-1)*sz;\
- while (last!=base) { \
- if (compare(first,last)>0) first=last; \
- last-=sz; } \
- if (first!=base) swapper(first,(char*)base);
-
-/* and so is the insertion sort, in the first two cases: */
-#define Insertion(swapper) \
- last=((char*)base)+nmemb*size; \
- for (first=((char*)base)+size;first!=last;first+=size) { \
- char *test; \
- /* Find the right place for |first|. \
- * My apologies for var reuse. */ \
- for (test=first-size;compare(test,first)>0;test-=size) ; \
- test+=size; \
- if (test!=first) { \
- /* Shift everything in [test,first) \
- * up by one, and place |first| \
- * where |test| is. */ \
- memcpy(pivot,first,size); \
- memmove(test+size,test,first-test); \
- memcpy(test,pivot,size); \
- } \
- }
-
-#define SWAP_nonaligned(a,b) { \
- register char *aa=(a),*bb=(b); \
- register size_t sz=size; \
- do { register char t=*aa; *aa++=*bb; *bb++=t; } while (--sz); }
-
-#define SWAP_aligned(a,b) { \
- register int *aa=(int*)(a),*bb=(int*)(b); \
- register size_t sz=size; \
- do { register int t=*aa;*aa++=*bb; *bb++=t; } while (sz-=WORD_BYTES); }
-
-#define SWAP_words(a,b) { \
- register int t=*((int*)a); *((int*)a)=*((int*)b); *((int*)b)=t; }
-
-/* ---------------------------------------------------------------------- */
-
-static char * pivot_big(char *first, char *mid, char *last, size_t size,
- int compare(const void *, const void *)) {
- size_t d=(((last-first)/size)>>3)*size;
- char *m1,*m2,*m3;
- { char *a=first, *b=first+d, *c=first+2*d;
-#ifdef DEBUG_QSORT
-fprintf(stderr,"< %d %d %d\n",*(int*)a,*(int*)b,*(int*)c);
-#endif
- m1 = compare(a,b)<0 ?
- (compare(b,c)<0 ? b : (compare(a,c)<0 ? c : a))
- : (compare(a,c)<0 ? a : (compare(b,c)<0 ? c : b));
- }
- { char *a=mid-d, *b=mid, *c=mid+d;
-#ifdef DEBUG_QSORT
-fprintf(stderr,". %d %d %d\n",*(int*)a,*(int*)b,*(int*)c);
-#endif
- m2 = compare(a,b)<0 ?
- (compare(b,c)<0 ? b : (compare(a,c)<0 ? c : a))
- : (compare(a,c)<0 ? a : (compare(b,c)<0 ? c : b));
- }
- { char *a=last-2*d, *b=last-d, *c=last;
-#ifdef DEBUG_QSORT
-fprintf(stderr,"> %d %d %d\n",*(int*)a,*(int*)b,*(int*)c);
-#endif
- m3 = compare(a,b)<0 ?
- (compare(b,c)<0 ? b : (compare(a,c)<0 ? c : a))
- : (compare(a,c)<0 ? a : (compare(b,c)<0 ? c : b));
- }
-#ifdef DEBUG_QSORT
-fprintf(stderr,"-> %d %d %d\n",*(int*)m1,*(int*)m2,*(int*)m3);
-#endif
- return compare(m1,m2)<0 ?
- (compare(m2,m3)<0 ? m2 : (compare(m1,m3)<0 ? m3 : m1))
- : (compare(m1,m3)<0 ? m1 : (compare(m2,m3)<0 ? m3 : m2));
-}
-
-/* ---------------------------------------------------------------------- */
-
-static void qsort_nonaligned(void *base, size_t nmemb, size_t size,
- int (*compare)(const void *, const void *)) {
-
- stack_entry stack[STACK_SIZE];
- int stacktop=0;
- char *first,*last;
- char *pivot=malloc(size);
- size_t trunc=TRUNC_nonaligned*size;
- assert(pivot!=0);
-
- first=(char*)base; last=first+(nmemb-1)*size;
-
- if ((size_t)(last-first)>trunc) {
- char *ffirst=first, *llast=last;
- while (1) {
- /* Select pivot */
- { char * mid=first+size*((last-first)/size >> 1);
- Pivot(SWAP_nonaligned,size);
- memcpy(pivot,mid,size);
- }
- /* Partition. */
- Partition(SWAP_nonaligned,size);
- /* Prepare to recurse/iterate. */
- Recurse(trunc)
- }
- }
- PreInsertion(SWAP_nonaligned,TRUNC_nonaligned,size);
- Insertion(SWAP_nonaligned);
- free(pivot);
-}
-
-static void qsort_aligned(void *base, size_t nmemb, size_t size,
- int (*compare)(const void *, const void *)) {
-
- stack_entry stack[STACK_SIZE];
- int stacktop=0;
- char *first,*last;
- char *pivot=malloc(size);
- size_t trunc=TRUNC_aligned*size;
- assert(pivot!=0);
-
- first=(char*)base; last=first+(nmemb-1)*size;
-
- if ((size_t)(last-first)>trunc) {
- char *ffirst=first,*llast=last;
- while (1) {
- /* Select pivot */
- { char * mid=first+size*((last-first)/size >> 1);
- Pivot(SWAP_aligned,size);
- memcpy(pivot,mid,size);
- }
- /* Partition. */
- Partition(SWAP_aligned,size);
- /* Prepare to recurse/iterate. */
- Recurse(trunc)
- }
- }
- PreInsertion(SWAP_aligned,TRUNC_aligned,size);
- Insertion(SWAP_aligned);
- free(pivot);
-}
-
-static void qsort_words(void *base, size_t nmemb,
- int (*compare)(const void *, const void *)) {
-
- stack_entry stack[STACK_SIZE];
- int stacktop=0;
- char *first,*last;
- char *pivot=malloc(WORD_BYTES);
- assert(pivot!=0);
-
- first=(char*)base; last=first+(nmemb-1)*WORD_BYTES;
-
- if (last-first>TRUNC_words) {
- char *ffirst=first, *llast=last;
- while (1) {
-#ifdef DEBUG_QSORT
-fprintf(stderr,"Doing %d:%d: ",
- (first-(char*)base)/WORD_BYTES,
- (last-(char*)base)/WORD_BYTES);
-#endif
- /* Select pivot */
- { char * mid=first+WORD_BYTES*((last-first) / (2*WORD_BYTES));
- Pivot(SWAP_words,WORD_BYTES);
- *(int*)pivot=*(int*)mid;
- }
-#ifdef DEBUG_QSORT
-fprintf(stderr,"pivot=%d\n",*(int*)pivot);
-#endif
- /* Partition. */
- Partition(SWAP_words,WORD_BYTES);
- /* Prepare to recurse/iterate. */
- Recurse(TRUNC_words)
- }
- }
- PreInsertion(SWAP_words,(TRUNC_words/WORD_BYTES),WORD_BYTES);
- /* Now do insertion sort. */
- last=((char*)base)+nmemb*WORD_BYTES;
- for (first=((char*)base)+WORD_BYTES;first!=last;first+=WORD_BYTES) {
- /* Find the right place for |first|. My apologies for var reuse */
- int *pl=(int*)(first-WORD_BYTES),*pr=(int*)first;
- *(int*)pivot=*(int*)first;
- for (;compare(pl,pivot)>0;pr=pl,--pl) {
- *pr=*pl; }
- if (pr!=(int*)first) *pr=*(int*)pivot;
- }
- free(pivot);
-}
-
-/* ---------------------------------------------------------------------- */
-
-void qsort(void *base, size_t nmemb, size_t size,
- int (*compare)(const void *, const void *)) {
-
- if (nmemb<=1) return;
- if (((uintptr_t)base|size)&(WORD_BYTES-1))
- qsort_nonaligned(base,nmemb,size,compare);
- else if (size!=WORD_BYTES)
- qsort_aligned(base,nmemb,size,compare);
- else
- qsort_words(base,nmemb,compare);
-}
-
-#endif /* !HAVE_QSORT */
diff --git a/distrib/sdl-1.2.12/src/stdlib/SDL_stdlib.c b/distrib/sdl-1.2.12/src/stdlib/SDL_stdlib.c
deleted file mode 100644
index b9c3bac..0000000
--- a/distrib/sdl-1.2.12/src/stdlib/SDL_stdlib.c
+++ /dev/null
@@ -1,620 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This file contains portable stdlib functions for SDL */
-
-#include "SDL_stdinc.h"
-
-#ifndef HAVE_LIBC
-/* These are some C runtime intrinsics that need to be defined */
-
-#if defined(_MSC_VER)
-
-#ifndef __FLTUSED__
-#define __FLTUSED__
-#ifdef __cplusplus
- extern "C"
-#endif
- __declspec(selectany) int _fltused=1;
-#endif
-
-/* Float to long */
-void __declspec(naked) _ftol()
-{
- __asm {
- push ebp
- mov ebp,esp
- sub esp,20h
- and esp,0FFFFFFF0h
- fld st(0)
- fst dword ptr [esp+18h]
- fistp qword ptr [esp+10h]
- fild qword ptr [esp+10h]
- mov edx,dword ptr [esp+18h]
- mov eax,dword ptr [esp+10h]
- test eax,eax
- je integer_QnaN_or_zero
-arg_is_not_integer_QnaN:
- fsubp st(1),st
- test edx,edx
- jns positive
- fstp dword ptr [esp]
- mov ecx,dword ptr [esp]
- xor ecx,80000000h
- add ecx,7FFFFFFFh
- adc eax,0
- mov edx,dword ptr [esp+14h]
- adc edx,0
- jmp localexit
-positive:
- fstp dword ptr [esp]
- mov ecx,dword ptr [esp]
- add ecx,7FFFFFFFh
- sbb eax,0
- mov edx,dword ptr [esp+14h]
- sbb edx,0
- jmp localexit
-integer_QnaN_or_zero:
- mov edx,dword ptr [esp+14h]
- test edx,7FFFFFFFh
- jne arg_is_not_integer_QnaN
- fstp dword ptr [esp+18h]
- fstp dword ptr [esp+18h]
-localexit:
- leave
- ret
- }
-}
-void __declspec(naked) _ftol2_sse()
-{
- _ftol();
-}
-
-/* 64-bit math operators for 32-bit systems */
-void __declspec(naked) _allmul()
-{
- __asm {
- push ebp
- mov ebp,esp
- push edi
- push esi
- push ebx
- sub esp,0Ch
- mov eax,dword ptr [ebp+10h]
- mov edi,dword ptr [ebp+8]
- mov ebx,eax
- mov esi,eax
- sar esi,1Fh
- mov eax,dword ptr [ebp+8]
- mul ebx
- imul edi,esi
- mov ecx,edx
- mov dword ptr [ebp-18h],eax
- mov edx,dword ptr [ebp+0Ch]
- add ecx,edi
- imul ebx,edx
- mov eax,dword ptr [ebp-18h]
- lea ebx,[ebx+ecx]
- mov dword ptr [ebp-14h],ebx
- mov edx,dword ptr [ebp-14h]
- add esp,0Ch
- pop ebx
- pop esi
- pop edi
- pop ebp
- ret
- }
-}
-void __declspec(naked) _alldiv()
-{
- __asm {
- push edi
- push esi
- push ebx
- xor edi,edi
- mov eax,dword ptr [esp+14h]
- or eax,eax
- jge L1
- inc edi
- mov edx,dword ptr [esp+10h]
- neg eax
- neg edx
- sbb eax,0
- mov dword ptr [esp+14h],eax
- mov dword ptr [esp+10h],edx
-L1:
- mov eax,dword ptr [esp+1Ch]
- or eax,eax
- jge L2
- inc edi
- mov edx,dword ptr [esp+18h]
- neg eax
- neg edx
- sbb eax,0
- mov dword ptr [esp+1Ch],eax
- mov dword ptr [esp+18h],edx
-L2:
- or eax,eax
- jne L3
- mov ecx,dword ptr [esp+18h]
- mov eax,dword ptr [esp+14h]
- xor edx,edx
- div ecx
- mov ebx,eax
- mov eax,dword ptr [esp+10h]
- div ecx
- mov edx,ebx
- jmp L4
-L3:
- mov ebx,eax
- mov ecx,dword ptr [esp+18h]
- mov edx,dword ptr [esp+14h]
- mov eax,dword ptr [esp+10h]
-L5:
- shr ebx,1
- rcr ecx,1
- shr edx,1
- rcr eax,1
- or ebx,ebx
- jne L5
- div ecx
- mov esi,eax
- mul dword ptr [esp+1Ch]
- mov ecx,eax
- mov eax,dword ptr [esp+18h]
- mul esi
- add edx,ecx
- jb L6
- cmp edx,dword ptr [esp+14h]
- ja L6
- jb L7
- cmp eax,dword ptr [esp+10h]
- jbe L7
-L6:
- dec esi
-L7:
- xor edx,edx
- mov eax,esi
-L4:
- dec edi
- jne L8
- neg edx
- neg eax
- sbb edx,0
-L8:
- pop ebx
- pop esi
- pop edi
- ret 10h
- }
-}
-void __declspec(naked) _aulldiv()
-{
- __asm {
- push ebx
- push esi
- mov eax,dword ptr [esp+18h]
- or eax,eax
- jne L1
- mov ecx,dword ptr [esp+14h]
- mov eax,dword ptr [esp+10h]
- xor edx,edx
- div ecx
- mov ebx,eax
- mov eax,dword ptr [esp+0Ch]
- div ecx
- mov edx,ebx
- jmp L2
-L1:
- mov ecx,eax
- mov ebx,dword ptr [esp+14h]
- mov edx,dword ptr [esp+10h]
- mov eax,dword ptr [esp+0Ch]
-L3:
- shr ecx,1
- rcr ebx,1
- shr edx,1
- rcr eax,1
- or ecx,ecx
- jne L3
- div ebx
- mov esi,eax
- mul dword ptr [esp+18h]
- mov ecx,eax
- mov eax,dword ptr [esp+14h]
- mul esi
- add edx,ecx
- jb L4
- cmp edx,dword ptr [esp+10h]
- ja L4
- jb L5
- cmp eax,dword ptr [esp+0Ch]
- jbe L5
-L4:
- dec esi
-L5:
- xor edx,edx
- mov eax,esi
-L2:
- pop esi
- pop ebx
- ret 10h
- }
-}
-void __declspec(naked) _allrem()
-{
- __asm {
- push ebx
- push edi
- xor edi,edi
- mov eax,dword ptr [esp+10h]
- or eax,eax
- jge L1
- inc edi
- mov edx,dword ptr [esp+0Ch]
- neg eax
- neg edx
- sbb eax,0
- mov dword ptr [esp+10h],eax
- mov dword ptr [esp+0Ch],edx
-L1:
- mov eax,dword ptr [esp+18h]
- or eax,eax
- jge L2
- mov edx,dword ptr [esp+14h]
- neg eax
- neg edx
- sbb eax,0
- mov dword ptr [esp+18h],eax
- mov dword ptr [esp+14h],edx
-L2:
- or eax,eax
- jne L3
- mov ecx,dword ptr [esp+14h]
- mov eax,dword ptr [esp+10h]
- xor edx,edx
- div ecx
- mov eax,dword ptr [esp+0Ch]
- div ecx
- mov eax,edx
- xor edx,edx
- dec edi
- jns L4
- jmp L8
-L3:
- mov ebx,eax
- mov ecx,dword ptr [esp+14h]
- mov edx,dword ptr [esp+10h]
- mov eax,dword ptr [esp+0Ch]
-L5:
- shr ebx,1
- rcr ecx,1
- shr edx,1
- rcr eax,1
- or ebx,ebx
- jne L5
- div ecx
- mov ecx,eax
- mul dword ptr [esp+18h]
- xchg eax,ecx
- mul dword ptr [esp+14h]
- add edx,ecx
- jb L6
- cmp edx,dword ptr [esp+10h]
- ja L6
- jb L7
- cmp eax,dword ptr [esp+0Ch]
- jbe L7
-L6:
- sub eax,dword ptr [esp+14h]
- sbb edx,dword ptr [esp+18h]
-L7:
- sub eax,dword ptr [esp+0Ch]
- sbb edx,dword ptr [esp+10h]
- dec edi
- jns L8
-L4:
- neg edx
- neg eax
- sbb edx,0
-L8:
- pop edi
- pop ebx
- ret 10h
- }
-}
-void __declspec(naked) _aullrem()
-{
- __asm {
- push ebx
- mov eax,dword ptr [esp+14h]
- or eax,eax
- jne L1
- mov ecx,dword ptr [esp+10h]
- mov eax,dword ptr [esp+0Ch]
- xor edx,edx
- div ecx
- mov eax,dword ptr [esp+8]
- div ecx
- mov eax,edx
- xor edx,edx
- jmp L2
-L1:
- mov ecx,eax
- mov ebx,dword ptr [esp+10h]
- mov edx,dword ptr [esp+0Ch]
- mov eax,dword ptr [esp+8]
-L3:
- shr ecx,1
- rcr ebx,1
- shr edx,1
- rcr eax,1
- or ecx,ecx
- jne L3
- div ebx
- mov ecx,eax
- mul dword ptr [esp+14h]
- xchg eax,ecx
- mul dword ptr [esp+10h]
- add edx,ecx
- jb L4
- cmp edx,dword ptr [esp+0Ch]
- ja L4
- jb L5
- cmp eax,dword ptr [esp+8]
- jbe L5
-L4:
- sub eax,dword ptr [esp+10h]
- sbb edx,dword ptr [esp+14h]
-L5:
- sub eax,dword ptr [esp+8]
- sbb edx,dword ptr [esp+0Ch]
- neg edx
- neg eax
- sbb edx,0
-L2:
- pop ebx
- ret 10h
- }
-}
-void __declspec(naked) _alldvrm()
-{
- __asm {
- push edi
- push esi
- push ebp
- xor edi,edi
- xor ebp,ebp
- mov eax,dword ptr [esp+14h]
- or eax,eax
- jge L1
- inc edi
- inc ebp
- mov edx,dword ptr [esp+10h]
- neg eax
- neg edx
- sbb eax,0
- mov dword ptr [esp+14h],eax
- mov dword ptr [esp+10h],edx
-L1:
- mov eax,dword ptr [esp+1Ch]
- or eax,eax
- jge L2
- inc edi
- mov edx,dword ptr [esp+18h]
- neg eax
- neg edx
- sbb eax,0
- mov dword ptr [esp+1Ch],eax
- mov dword ptr [esp+18h],edx
-L2:
- or eax,eax
- jne L3
- mov ecx,dword ptr [esp+18h]
- mov eax,dword ptr [esp+14h]
- xor edx,edx
- div ecx
- mov ebx,eax
- mov eax,dword ptr [esp+10h]
- div ecx
- mov esi,eax
- mov eax,ebx
- mul dword ptr [esp+18h]
- mov ecx,eax
- mov eax,esi
- mul dword ptr [esp+18h]
- add edx,ecx
- jmp L4
-L3:
- mov ebx,eax
- mov ecx,dword ptr [esp+18h]
- mov edx,dword ptr [esp+14h]
- mov eax,dword ptr [esp+10h]
-L5:
- shr ebx,1
- rcr ecx,1
- shr edx,1
- rcr eax,1
- or ebx,ebx
- jne L5
- div ecx
- mov esi,eax
- mul dword ptr [esp+1Ch]
- mov ecx,eax
- mov eax,dword ptr [esp+18h]
- mul esi
- add edx,ecx
- jb L6
- cmp edx,dword ptr [esp+14h]
- ja L6
- jb L7
- cmp eax,dword ptr [esp+10h]
- jbe L7
-L6:
- dec esi
- sub eax,dword ptr [esp+18h]
- sbb edx,dword ptr [esp+1Ch]
-L7:
- xor ebx,ebx
-L4:
- sub eax,dword ptr [esp+10h]
- sbb edx,dword ptr [esp+14h]
- dec ebp
- jns L9
- neg edx
- neg eax
- sbb edx,0
-L9:
- mov ecx,edx
- mov edx,ebx
- mov ebx,ecx
- mov ecx,eax
- mov eax,esi
- dec edi
- jne L8
- neg edx
- neg eax
- sbb edx,0
-L8:
- pop ebp
- pop esi
- pop edi
- ret 10h
- }
-}
-void __declspec(naked) _aulldvrm()
-{
- __asm {
- push esi
- mov eax,dword ptr [esp+14h]
- or eax,eax
- jne L1
- mov ecx,dword ptr [esp+10h]
- mov eax,dword ptr [esp+0Ch]
- xor edx,edx
- div ecx
- mov ebx,eax
- mov eax,dword ptr [esp+8]
- div ecx
- mov esi,eax
- mov eax,ebx
- mul dword ptr [esp+10h]
- mov ecx,eax
- mov eax,esi
- mul dword ptr [esp+10h]
- add edx,ecx
- jmp L2
-L1:
- mov ecx,eax
- mov ebx,dword ptr [esp+10h]
- mov edx,dword ptr [esp+0Ch]
- mov eax,dword ptr [esp+8]
-L3:
- shr ecx,1
- rcr ebx,1
- shr edx,1
- rcr eax,1
- or ecx,ecx
- jne L3
- div ebx
- mov esi,eax
- mul dword ptr [esp+14h]
- mov ecx,eax
- mov eax,dword ptr [esp+10h]
- mul esi
- add edx,ecx
- jb L4
- cmp edx,dword ptr [esp+0Ch]
- ja L4
- jb L5
- cmp eax,dword ptr [esp+8]
- jbe L5
-L4:
- dec esi
- sub eax,dword ptr [esp+10h]
- sbb edx,dword ptr [esp+14h]
-L5:
- xor ebx,ebx
-L2:
- sub eax,dword ptr [esp+8]
- sbb edx,dword ptr [esp+0Ch]
- neg edx
- neg eax
- sbb edx,0
- mov ecx,edx
- mov edx,ebx
- mov ebx,ecx
- mov ecx,eax
- mov eax,esi
- pop esi
- ret 10h
- }
-}
-void __declspec(naked) _allshl()
-{
- __asm {
- cmp cl,40h
- jae RETZERO
- cmp cl,20h
- jae MORE32
- shld edx,eax,cl
- shl eax,cl
- ret
-MORE32:
- mov edx,eax
- xor eax,eax
- and cl,1Fh
- shl edx,cl
- ret
-RETZERO:
- xor eax,eax
- xor edx,edx
- ret
- }
-}
-void __declspec(naked) _aullshr()
-{
- __asm {
- cmp cl,40h
- jae RETZERO
- cmp cl,20h
- jae MORE32
- shrd eax,edx,cl
- shr edx,cl
- ret
-MORE32:
- mov eax,edx
- xor edx,edx
- and cl,1Fh
- shr eax,cl
- ret
-RETZERO:
- xor eax,eax
- xor edx,edx
- ret
- }
-}
-
-#endif /* MSC_VER */
-
-#endif /* !HAVE_LIBC */
diff --git a/distrib/sdl-1.2.12/src/stdlib/SDL_string.c b/distrib/sdl-1.2.12/src/stdlib/SDL_string.c
deleted file mode 100644
index 0ab5af6..0000000
--- a/distrib/sdl-1.2.12/src/stdlib/SDL_string.c
+++ /dev/null
@@ -1,1248 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This file contains portable string manipulation functions for SDL */
-
-#include "SDL_stdinc.h"
-
-
-#define SDL_isupperhex(X) (((X) >= 'A') && ((X) <= 'F'))
-#define SDL_islowerhex(X) (((X) >= 'a') && ((X) <= 'f'))
-
-#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOL)
-static size_t SDL_ScanLong(const char *text, int radix, long *valuep)
-{
- const char *textstart = text;
- long value = 0;
- SDL_bool negative = SDL_FALSE;
-
- if ( *text == '-' ) {
- negative = SDL_TRUE;
- ++text;
- }
- if ( radix == 16 && SDL_strncmp(text, "0x", 2) == 0 ) {
- text += 2;
- }
- for ( ; ; ) {
- int v;
- if ( SDL_isdigit((unsigned char) *text) ) {
- v = *text - '0';
- } else if ( radix == 16 && SDL_isupperhex(*text) ) {
- v = 10 + (*text - 'A');
- } else if ( radix == 16 && SDL_islowerhex(*text) ) {
- v = 10 + (*text - 'a');
- } else {
- break;
- }
- value *= radix;
- value += v;
- ++text;
- }
- if ( valuep ) {
- if ( negative && value ) {
- *valuep = -value;
- } else {
- *valuep = value;
- }
- }
- return (text - textstart);
-}
-#endif
-
-#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOUL) || !defined(HAVE_STRTOD)
-static size_t SDL_ScanUnsignedLong(const char *text, int radix, unsigned long *valuep)
-{
- const char *textstart = text;
- unsigned long value = 0;
-
- if ( radix == 16 && SDL_strncmp(text, "0x", 2) == 0 ) {
- text += 2;
- }
- for ( ; ; ) {
- int v;
- if ( SDL_isdigit((unsigned char) *text) ) {
- v = *text - '0';
- } else if ( radix == 16 && SDL_isupperhex(*text) ) {
- v = 10 + (*text - 'A');
- } else if ( radix == 16 && SDL_islowerhex(*text) ) {
- v = 10 + (*text - 'a');
- } else {
- break;
- }
- value *= radix;
- value += v;
- ++text;
- }
- if ( valuep ) {
- *valuep = value;
- }
- return (text - textstart);
-}
-#endif
-
-#ifndef HAVE_SSCANF
-static size_t SDL_ScanUintPtrT(const char *text, int radix, uintptr_t *valuep)
-{
- const char *textstart = text;
- uintptr_t value = 0;
-
- if ( radix == 16 && SDL_strncmp(text, "0x", 2) == 0 ) {
- text += 2;
- }
- for ( ; ; ) {
- int v;
- if ( SDL_isdigit((unsigned char) *text) ) {
- v = *text - '0';
- } else if ( radix == 16 && SDL_isupperhex(*text) ) {
- v = 10 + (*text - 'A');
- } else if ( radix == 16 && SDL_islowerhex(*text) ) {
- v = 10 + (*text - 'a');
- } else {
- break;
- }
- value *= radix;
- value += v;
- ++text;
- }
- if ( valuep ) {
- *valuep = value;
- }
- return (text - textstart);
-}
-#endif
-
-#ifdef SDL_HAS_64BIT_TYPE
-#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOLL)
-static size_t SDL_ScanLongLong(const char *text, int radix, Sint64 *valuep)
-{
- const char *textstart = text;
- Sint64 value = 0;
- SDL_bool negative = SDL_FALSE;
-
- if ( *text == '-' ) {
- negative = SDL_TRUE;
- ++text;
- }
- if ( radix == 16 && SDL_strncmp(text, "0x", 2) == 0 ) {
- text += 2;
- }
- for ( ; ; ) {
- int v;
- if ( SDL_isdigit((unsigned char) *text) ) {
- v = *text - '0';
- } else if ( radix == 16 && SDL_isupperhex(*text) ) {
- v = 10 + (*text - 'A');
- } else if ( radix == 16 && SDL_islowerhex(*text) ) {
- v = 10 + (*text - 'a');
- } else {
- break;
- }
- value *= radix;
- value += v;
- ++text;
- }
- if ( valuep ) {
- if ( negative && value ) {
- *valuep = -value;
- } else {
- *valuep = value;
- }
- }
- return (text - textstart);
-}
-#endif
-
-#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOULL)
-static size_t SDL_ScanUnsignedLongLong(const char *text, int radix, Uint64 *valuep)
-{
- const char *textstart = text;
- Uint64 value = 0;
-
- if ( radix == 16 && SDL_strncmp(text, "0x", 2) == 0 ) {
- text += 2;
- }
- for ( ; ; ) {
- int v;
- if ( SDL_isdigit((unsigned char) *text) ) {
- v = *text - '0';
- } else if ( radix == 16 && SDL_isupperhex(*text) ) {
- v = 10 + (*text - 'A');
- } else if ( radix == 16 && SDL_islowerhex(*text) ) {
- v = 10 + (*text - 'a');
- } else {
- break;
- }
- value *= radix;
- value += v;
- ++text;
- }
- if ( valuep ) {
- *valuep = value;
- }
- return (text - textstart);
-}
-#endif
-#endif /* SDL_HAS_64BIT_TYPE */
-
-#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOD)
-static size_t SDL_ScanFloat(const char *text, double *valuep)
-{
- const char *textstart = text;
- unsigned long lvalue = 0;
- double value = 0.0;
- SDL_bool negative = SDL_FALSE;
-
- if ( *text == '-' ) {
- negative = SDL_TRUE;
- ++text;
- }
- text += SDL_ScanUnsignedLong(text, 10, &lvalue);
- value += lvalue;
- if ( *text == '.' ) {
- int mult = 10;
- ++text;
- while ( SDL_isdigit((unsigned char) *text) ) {
- lvalue = *text - '0';
- value += (double)lvalue / mult;
- mult *= 10;
- ++text;
- }
- }
- if ( valuep ) {
- if ( negative && value ) {
- *valuep = -value;
- } else {
- *valuep = value;
- }
- }
- return (text - textstart);
-}
-#endif
-
-#ifndef SDL_memset
-void *SDL_memset(void *dst, int c, size_t len)
-{
- size_t left = (len % 4);
- if ( len >= 4 ) {
- Uint32 value = 0;
- Uint32 *dstp = (Uint32 *)dst;
- int i;
- for (i = 0; i < 4; ++i) {
- value <<= 8;
- value |= c;
- }
- len /= 4;
- while ( len-- ) {
- *dstp++ = value;
- }
- }
- if ( left > 0 ) {
- Uint8 value = (Uint8)c;
- Uint8 *dstp = (Uint8 *)dst;
- switch(left) {
- case 3:
- *dstp++ = value;
- case 2:
- *dstp++ = value;
- case 1:
- *dstp++ = value;
- }
- }
- return dst;
-}
-#endif
-
-#ifndef SDL_memcpy
-void *SDL_memcpy(void *dst, const void *src, size_t len)
-{
- char *srcp = (char *)src;
- char *dstp = (char *)dst;
- while ( len-- ) {
- *dstp++ = *srcp++;
- }
- return dst;
-}
-#endif
-
-#ifndef SDL_revcpy
-void *SDL_revcpy(void *dst, const void *src, size_t len)
-{
- char *srcp = (char *)src;
- char *dstp = (char *)dst;
- srcp += len-1;
- dstp += len-1;
- while ( len-- ) {
- *dstp-- = *srcp--;
- }
- return dst;
-}
-#endif
-
-#ifndef SDL_memcmp
-int SDL_memcmp(const void *s1, const void *s2, size_t len)
-{
- char *s1p = (char *)s1;
- char *s2p = (char *)s2;
- while ( len-- ) {
- if ( *s1p != *s2p ) {
- return (*s1p - *s2p);
- }
- ++s1p;
- ++s2p;
- }
- return 0;
-}
-#endif
-
-#ifndef HAVE_STRLEN
-size_t SDL_strlen(const char *string)
-{
- size_t len = 0;
- while ( *string++ ) {
- ++len;
- }
- return len;
-}
-#endif
-
-#ifndef HAVE_STRLCPY
-size_t SDL_strlcpy(char *dst, const char *src, size_t maxlen)
-{
- size_t srclen = SDL_strlen(src);
- if ( maxlen > 0 ) {
- size_t len = SDL_min(srclen, maxlen-1);
- SDL_memcpy(dst, src, len);
- dst[len] = '\0';
- }
- return srclen;
-}
-#endif
-
-#ifndef HAVE_STRLCAT
-size_t SDL_strlcat(char *dst, const char *src, size_t maxlen)
-{
- 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
-
-#ifndef HAVE_STRDUP
-char *SDL_strdup(const char *string)
-{
- size_t len = SDL_strlen(string)+1;
- char *newstr = SDL_malloc(len);
- if ( newstr ) {
- SDL_strlcpy(newstr, string, len);
- }
- return newstr;
-}
-#endif
-
-#ifndef HAVE__STRREV
-char *SDL_strrev(char *string)
-{
- size_t len = SDL_strlen(string);
- char *a = &string[0];
- char *b = &string[len-1];
- len /= 2;
- while ( len-- ) {
- char c = *a;
- *a++ = *b;
- *b-- = c;
- }
- return string;
-}
-#endif
-
-#ifndef HAVE__STRUPR
-char *SDL_strupr(char *string)
-{
- char *bufp = string;
- while ( *bufp ) {
- *bufp = SDL_toupper((unsigned char) *bufp);
- ++bufp;
- }
- return string;
-}
-#endif
-
-#ifndef HAVE__STRLWR
-char *SDL_strlwr(char *string)
-{
- char *bufp = string;
- while ( *bufp ) {
- *bufp = SDL_tolower((unsigned char) *bufp);
- ++bufp;
- }
- return string;
-}
-#endif
-
-#ifndef HAVE_STRCHR
-char *SDL_strchr(const char *string, int c)
-{
- while ( *string ) {
- if ( *string == c ) {
- return (char *)string;
- }
- ++string;
- }
- return NULL;
-}
-#endif
-
-#ifndef HAVE_STRRCHR
-char *SDL_strrchr(const char *string, int c)
-{
- const char *bufp = string + SDL_strlen(string) - 1;
- while ( bufp >= string ) {
- if ( *bufp == c ) {
- return (char *)bufp;
- }
- --bufp;
- }
- return NULL;
-}
-#endif
-
-#ifndef HAVE_STRSTR
-char *SDL_strstr(const char *haystack, const char *needle)
-{
- size_t length = SDL_strlen(needle);
- while ( *haystack ) {
- if ( SDL_strncmp(haystack, needle, length) == 0 ) {
- return (char *)haystack;
- }
- ++haystack;
- }
- return NULL;
-}
-#endif
-
-#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',
- 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
- 'U', 'V', 'W', 'X', 'Y', 'Z'
-};
-#endif /* ntoa() conversion table */
-
-#ifndef HAVE__LTOA
-char *SDL_ltoa(long 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
-
-#ifndef HAVE__ULTOA
-char *SDL_ultoa(unsigned long 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
-
-#ifndef HAVE_STRTOL
-long SDL_strtol(const char *string, char **endp, int base)
-{
- size_t len;
- long value;
-
- if ( !base ) {
- if ( (SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0) ) {
- base = 16;
- } else {
- base = 10;
- }
- }
-
- len = SDL_ScanLong(string, base, &value);
- if ( endp ) {
- *endp = (char *)string + len;
- }
- return value;
-}
-#endif
-
-#ifndef HAVE_STRTOUL
-unsigned long SDL_strtoul(const char *string, char **endp, int base)
-{
- size_t len;
- unsigned long value;
-
- if ( !base ) {
- if ( (SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0) ) {
- base = 16;
- } else {
- base = 10;
- }
- }
-
- len = SDL_ScanUnsignedLong(string, base, &value);
- if ( endp ) {
- *endp = (char *)string + len;
- }
- return value;
-}
-#endif
-
-#ifdef SDL_HAS_64BIT_TYPE
-
-#ifndef HAVE__I64TOA
-char *SDL_lltoa(Sint64 value, char *string, int radix)
-{
- char *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
-
-#ifndef HAVE__UI64TOA
-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
-
-#ifndef HAVE_STRTOLL
-Sint64 SDL_strtoll(const char *string, char **endp, int base)
-{
- size_t len;
- Sint64 value;
-
- if ( !base ) {
- if ( (SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0) ) {
- base = 16;
- } else {
- base = 10;
- }
- }
-
- len = SDL_ScanLongLong(string, base, &value);
- if ( endp ) {
- *endp = (char *)string + len;
- }
- return value;
-}
-#endif
-
-#ifndef HAVE_STRTOULL
-Uint64 SDL_strtoull(const char *string, char **endp, int base)
-{
- size_t len;
- Uint64 value;
-
- if ( !base ) {
- if ( (SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0) ) {
- base = 16;
- } else {
- base = 10;
- }
- }
-
- len = SDL_ScanUnsignedLongLong(string, base, &value);
- if ( endp ) {
- *endp = (char *)string + len;
- }
- return value;
-}
-#endif
-
-#endif /* SDL_HAS_64BIT_TYPE */
-
-#ifndef HAVE_STRTOD
-double SDL_strtod(const char *string, char **endp)
-{
- size_t len;
- double value;
-
- len = SDL_ScanFloat(string, &value);
- if ( endp ) {
- *endp = (char *)string + len;
- }
- return value;
-}
-#endif
-
-#ifndef HAVE_STRCMP
-int SDL_strcmp(const char *str1, const char *str2)
-{
- while (*str1 && *str2) {
- if ( *str1 != *str2 )
- break;
- ++str1;
- ++str2;
- }
- return (int)((unsigned char)*str1 - (unsigned char)*str2);
-}
-#endif
-
-#ifndef HAVE_STRNCMP
-int SDL_strncmp(const char *str1, const char *str2, size_t maxlen)
-{
- while ( *str1 && *str2 && maxlen ) {
- if ( *str1 != *str2 )
- break;
- ++str1;
- ++str2;
- --maxlen;
- }
- if ( ! maxlen ) {
- return 0;
- }
- return (int)((unsigned char)*str1 - (unsigned char)*str2);
-}
-#endif
-
-#if !defined(HAVE_STRCASECMP) && !defined(HAVE__STRICMP)
-int SDL_strcasecmp(const char *str1, const char *str2)
-{
- char a = 0;
- char b = 0;
- while ( *str1 && *str2 ) {
- a = SDL_tolower((unsigned char) *str1);
- b = SDL_tolower((unsigned char) *str2);
- if ( a != b )
- break;
- ++str1;
- ++str2;
- }
- return (int)((unsigned char)a - (unsigned char)b);
-}
-#endif
-
-#if !defined(HAVE_STRNCASECMP) && !defined(HAVE__STRNICMP)
-int SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen)
-{
- char a = 0;
- char b = 0;
- while ( *str1 && *str2 && maxlen ) {
- a = SDL_tolower((unsigned char) *str1);
- b = SDL_tolower((unsigned char) *str2);
- if ( a != b )
- break;
- ++str1;
- ++str2;
- --maxlen;
- }
- return (int)((unsigned char)a - (unsigned char)b);
-}
-#endif
-
-#ifndef HAVE_SSCANF
-int SDL_sscanf(const char *text, const char *fmt, ...)
-{
- va_list ap;
- int retval = 0;
-
- va_start(ap, fmt);
- while ( *fmt ) {
- if ( *fmt == ' ' ) {
- while ( SDL_isspace((unsigned char) *text) ) {
- ++text;
- }
- ++fmt;
- continue;
- }
- if ( *fmt == '%' ) {
- SDL_bool done = SDL_FALSE;
- long count = 0;
- int radix = 10;
- enum {
- DO_SHORT,
- DO_INT,
- DO_LONG,
- DO_LONGLONG
- } inttype = DO_INT;
- SDL_bool suppress = SDL_FALSE;
-
- ++fmt;
- if ( *fmt == '%' ) {
- if ( *text == '%' ) {
- ++text;
- ++fmt;
- continue;
- }
- break;
- }
- if ( *fmt == '*' ) {
- suppress = SDL_TRUE;
- ++fmt;
- }
- fmt += SDL_ScanLong(fmt, 10, &count);
-
- if ( *fmt == 'c' ) {
- if ( ! count ) {
- count = 1;
- }
- if ( suppress ) {
- while ( count-- ) {
- ++text;
- }
- } else {
- char *valuep = va_arg(ap, char*);
- while ( count-- ) {
- *valuep++ = *text++;
- }
- ++retval;
- }
- continue;
- }
-
- while ( SDL_isspace((unsigned char) *text) ) {
- ++text;
- }
-
- /* FIXME: implement more of the format specifiers */
- while (!done) {
- switch(*fmt) {
- case '*':
- suppress = SDL_TRUE;
- break;
- case 'h':
- if ( inttype > DO_SHORT ) {
- ++inttype;
- }
- break;
- case 'l':
- if ( inttype < DO_LONGLONG ) {
- ++inttype;
- }
- break;
- case 'I':
- if ( SDL_strncmp(fmt, "I64", 3) == 0 ) {
- fmt += 2;
- inttype = DO_LONGLONG;
- }
- break;
- case 'i':
- {
- int index = 0;
- if ( text[index] == '-' ) {
- ++index;
- }
- if ( text[index] == '0' ) {
- if ( SDL_tolower((unsigned char) text[index+1]) == 'x' ) {
- radix = 16;
- } else {
- radix = 8;
- }
- }
- }
- /* Fall through to %d handling */
- case 'd':
-#ifdef SDL_HAS_64BIT_TYPE
- if ( inttype == DO_LONGLONG ) {
- Sint64 value;
- text += SDL_ScanLongLong(text, radix, &value);
- if ( ! suppress ) {
- Sint64 *valuep = va_arg(ap, Sint64*);
- *valuep = value;
- ++retval;
- }
- }
- else
-#endif /* SDL_HAS_64BIT_TYPE */
- {
- long value;
- text += SDL_ScanLong(text, radix, &value);
- if ( ! suppress ) {
- switch (inttype) {
- case DO_SHORT:
- { short* valuep = va_arg(ap, short*);
- *valuep = (short)value;
- }
- break;
- case DO_INT:
- { int* valuep = va_arg(ap, int*);
- *valuep = (int)value;
- }
- break;
- case DO_LONG:
- { long* valuep = va_arg(ap, long*);
- *valuep = value;
- }
- break;
- case DO_LONGLONG:
- /* Handled above */
- break;
- }
- ++retval;
- }
- }
- done = SDL_TRUE;
- break;
- case 'o':
- if ( radix == 10 ) {
- radix = 8;
- }
- /* Fall through to unsigned handling */
- case 'x':
- case 'X':
- if ( radix == 10 ) {
- radix = 16;
- }
- /* Fall through to unsigned handling */
- case 'u':
-#ifdef SDL_HAS_64BIT_TYPE
- if ( inttype == DO_LONGLONG ) {
- Uint64 value;
- text += SDL_ScanUnsignedLongLong(text, radix, &value);
- if ( ! suppress ) {
- Uint64 *valuep = va_arg(ap, Uint64*);
- *valuep = value;
- ++retval;
- }
- }
- else
-#endif /* SDL_HAS_64BIT_TYPE */
- {
- unsigned long value;
- text += SDL_ScanUnsignedLong(text, radix, &value);
- if ( ! suppress ) {
- switch (inttype) {
- case DO_SHORT:
- { short* valuep = va_arg(ap, short*);
- *valuep = (short)value;
- }
- break;
- case DO_INT:
- { int* valuep = va_arg(ap, int*);
- *valuep = (int)value;
- }
- break;
- case DO_LONG:
- { long* valuep = va_arg(ap, long*);
- *valuep = value;
- }
- break;
- case DO_LONGLONG:
- /* Handled above */
- break;
- }
- ++retval;
- }
- }
- done = SDL_TRUE;
- break;
- case 'p':
- {
- uintptr_t value;
- text += SDL_ScanUintPtrT(text, 16, &value);
- if ( ! suppress ) {
- void** valuep = va_arg(ap, void**);
- *valuep = (void*)value;
- ++retval;
- }
- }
- done = SDL_TRUE;
- break;
- case 'f':
- {
- double value;
- text += SDL_ScanFloat(text, &value);
- if ( ! suppress ) {
- float* valuep = va_arg(ap, float*);
- *valuep = (float)value;
- ++retval;
- }
- }
- done = SDL_TRUE;
- break;
- case 's':
- if ( suppress ) {
- while ( !SDL_isspace((unsigned char) *text) ) {
- ++text;
- if ( count ) {
- if ( --count == 0 ) {
- break;
- }
- }
- }
- } else {
- char *valuep = va_arg(ap, char*);
- while ( !SDL_isspace((unsigned char) *text) ) {
- *valuep++ = *text++;
- if ( count ) {
- if ( --count == 0 ) {
- break;
- }
- }
- }
- *valuep = '\0';
- ++retval;
- }
- done = SDL_TRUE;
- break;
- default:
- done = SDL_TRUE;
- break;
- }
- ++fmt;
- }
- continue;
- }
- if ( *text == *fmt ) {
- ++text;
- ++fmt;
- continue;
- }
- /* Text didn't match format specifier */
- break;
- }
- va_end(ap);
-
- return retval;
-}
-#endif
-
-#ifndef HAVE_SNPRINTF
-int SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...)
-{
- va_list ap;
- int retval;
-
- va_start(ap, fmt);
- retval = SDL_vsnprintf(text, maxlen, fmt, ap);
- va_end(ap);
-
- return retval;
-}
-#endif
-
-#ifndef HAVE_VSNPRINTF
-static size_t SDL_PrintLong(char *text, long value, int radix, size_t maxlen)
-{
- char num[130];
- size_t size;
-
- SDL_ltoa(value, num, radix);
- size = SDL_strlen(num);
- if ( size >= maxlen ) {
- size = maxlen-1;
- }
- SDL_strlcpy(text, num, size+1);
-
- return size;
-}
-static size_t SDL_PrintUnsignedLong(char *text, unsigned long value, int radix, size_t maxlen)
-{
- 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;
-}
-#ifdef SDL_HAS_64BIT_TYPE
-static size_t SDL_PrintLongLong(char *text, Sint64 value, int radix, size_t maxlen)
-{
- 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;
-}
-static size_t SDL_PrintUnsignedLongLong(char *text, Uint64 value, int radix, size_t maxlen)
-{
- 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;
-}
-#endif /* SDL_HAS_64BIT_TYPE */
-static size_t SDL_PrintFloat(char *text, double arg, size_t 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;
- arg = -arg;
- }
- value = (unsigned long)arg;
- len = SDL_PrintUnsignedLong(text, value, 10, maxlen);
- text += len;
- maxlen -= len;
- arg -= value;
- if ( arg > precision && maxlen ) {
- int mult = 10;
- *text++ = '.';
- while ( (arg > precision) && maxlen ) {
- value = (unsigned long)(arg * mult);
- len = SDL_PrintUnsignedLong(text, value, 10, maxlen);
- text += len;
- maxlen -= len;
- arg -= (double)value / mult;
- mult *= 10;
- }
- }
- } else {
- *text++ = '0';
- }
- return (text - textstart);
-}
-static size_t SDL_PrintString(char *text, const char *string, size_t maxlen)
-{
- char *textstart = text;
- while ( *string && maxlen-- ) {
- *text++ = *string++;
- }
- return (text - textstart);
-}
-int SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap)
-{
- char *textstart = text;
- if ( maxlen <= 0 ) {
- return 0;
- }
- --maxlen; /* For the trailing '\0' */
- while ( *fmt && maxlen ) {
- if ( *fmt == '%' ) {
- SDL_bool done = SDL_FALSE;
- size_t len = 0;
- SDL_bool do_lowercase = SDL_FALSE;
- int radix = 10;
- enum {
- DO_INT,
- DO_LONG,
- DO_LONGLONG
- } inttype = DO_INT;
-
- ++fmt;
- /* FIXME: implement more of the format specifiers */
- while ( *fmt == '.' || (*fmt >= '0' && *fmt <= '9') ) {
- ++fmt;
- }
- while (!done) {
- switch(*fmt) {
- case '%':
- *text = '%';
- len = 1;
- done = SDL_TRUE;
- break;
- case 'c':
- /* char is promoted to int when passed through (...) */
- *text = (char)va_arg(ap, int);
- len = 1;
- done = SDL_TRUE;
- break;
- case 'h':
- /* short is promoted to int when passed through (...) */
- break;
- case 'l':
- if ( inttype < DO_LONGLONG ) {
- ++inttype;
- }
- break;
- case 'I':
- if ( SDL_strncmp(fmt, "I64", 3) == 0 ) {
- fmt += 2;
- inttype = DO_LONGLONG;
- }
- break;
- case 'i':
- case 'd':
- switch (inttype) {
- case DO_INT:
- len = SDL_PrintLong(text, (long)va_arg(ap, int), radix, maxlen);
- break;
- case DO_LONG:
- len = SDL_PrintLong(text, va_arg(ap, long), radix, maxlen);
- break;
- case DO_LONGLONG:
-#ifdef SDL_HAS_64BIT_TYPE
- len = SDL_PrintLongLong(text, va_arg(ap, Sint64), radix, maxlen);
-#else
- len = SDL_PrintLong(text, va_arg(ap, long), radix, maxlen);
-#endif
- break;
- }
- done = SDL_TRUE;
- break;
- case 'p':
- case 'x':
- do_lowercase = SDL_TRUE;
- /* Fall through to 'X' handling */
- case 'X':
- if ( radix == 10 ) {
- radix = 16;
- }
- if ( *fmt == 'p' ) {
- inttype = DO_LONG;
- }
- /* Fall through to unsigned handling */
- case 'o':
- if ( radix == 10 ) {
- radix = 8;
- }
- /* Fall through to unsigned handling */
- case 'u':
- switch (inttype) {
- case DO_INT:
- len = SDL_PrintUnsignedLong(text, (unsigned long)va_arg(ap, unsigned int), radix, maxlen);
- break;
- case DO_LONG:
- len = SDL_PrintUnsignedLong(text, va_arg(ap, unsigned long), radix, maxlen);
- break;
- case DO_LONGLONG:
-#ifdef SDL_HAS_64BIT_TYPE
- len = SDL_PrintUnsignedLongLong(text, va_arg(ap, Uint64), radix, maxlen);
-#else
- len = SDL_PrintUnsignedLong(text, va_arg(ap, unsigned long), radix, maxlen);
-#endif
- break;
- }
- if ( do_lowercase ) {
- SDL_strlwr(text);
- }
- done = SDL_TRUE;
- break;
- case 'f':
- len = SDL_PrintFloat(text, va_arg(ap, double), maxlen);
- done = SDL_TRUE;
- break;
- case 's':
- len = SDL_PrintString(text, va_arg(ap, char*), maxlen);
- done = SDL_TRUE;
- break;
- default:
- done = SDL_TRUE;
- break;
- }
- ++fmt;
- }
- text += len;
- maxlen -= len;
- } else {
- *text++ = *fmt++;
- --maxlen;
- }
- }
- *text = '\0';
-
- return (text - textstart);
-}
-#endif
diff --git a/distrib/sdl-1.2.12/src/thread/SDL_systhread.h b/distrib/sdl-1.2.12/src/thread/SDL_systhread.h
deleted file mode 100644
index ab9545c..0000000
--- a/distrib/sdl-1.2.12/src/thread/SDL_systhread.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* These are functions that need to be implemented by a port of SDL */
-
-#ifndef _SDL_systhread_h
-#define _SDL_systhread_h
-
-#include "SDL_thread.h"
-
-/* This function creates a thread, passing args to SDL_RunThread(),
- saves a system-dependent thread id in thread->id, and returns 0
- on success.
-*/
-#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
-extern int SDL_SYS_CreateThread(SDL_Thread *thread, void *args, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread);
-#else
-extern int SDL_SYS_CreateThread(SDL_Thread *thread, void *args);
-#endif
-
-/* This function does any necessary setup in the child thread */
-extern void SDL_SYS_SetupThread(void);
-
-/* This function waits for the thread to finish and frees any data
- allocated by SDL_SYS_CreateThread()
- */
-extern void SDL_SYS_WaitThread(SDL_Thread *thread);
-
-/* This function kills the thread and returns */
-extern void SDL_SYS_KillThread(SDL_Thread *thread);
-
-#endif /* _SDL_systhread_h */
diff --git a/distrib/sdl-1.2.12/src/thread/SDL_thread.c b/distrib/sdl-1.2.12/src/thread/SDL_thread.c
deleted file mode 100644
index 09b07bb..0000000
--- a/distrib/sdl-1.2.12/src/thread/SDL_thread.c
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* System independent thread management routines for SDL */
-
-#include "SDL_mutex.h"
-#include "SDL_thread.h"
-#include "SDL_thread_c.h"
-#include "SDL_systhread.h"
-
-#define ARRAY_CHUNKSIZE 32
-/* The array of threads currently active in the application
- (except the main thread)
- The manipulation of an array here is safer than using a linked list.
-*/
-static int SDL_maxthreads = 0;
-static int SDL_numthreads = 0;
-static SDL_Thread **SDL_Threads = NULL;
-static SDL_mutex *thread_lock = NULL;
-
-int SDL_ThreadsInit(void)
-{
- int retval;
-
- 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.
- */
-void SDL_ThreadsQuit(void)
-{
- SDL_mutex *mutex;
-
- mutex = thread_lock;
- thread_lock = NULL;
- if ( mutex != NULL ) {
- SDL_DestroyMutex(mutex);
- }
-}
-
-/* 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;
- }
- }
- SDL_mutexP(thread_lock);
-
- /* Expand the list of threads, if necessary */
-#ifdef DEBUG_THREADS
- printf("Adding thread (%d already - %d max)\n",
- SDL_numthreads, SDL_maxthreads);
-#endif
- if ( SDL_numthreads == SDL_maxthreads ) {
- SDL_Thread **threads;
- threads = (SDL_Thread **)SDL_realloc(SDL_Threads,
- (SDL_maxthreads+ARRAY_CHUNKSIZE)*(sizeof *threads));
- if ( threads == NULL ) {
- SDL_OutOfMemory();
- goto done;
- }
- SDL_maxthreads += ARRAY_CHUNKSIZE;
- SDL_Threads = threads;
- }
- SDL_Threads[SDL_numthreads++] = thread;
-done:
- SDL_mutexV(thread_lock);
-}
-
-static void SDL_DelThread(SDL_Thread *thread)
-{
- int i;
-
- if ( !thread_lock ) {
- return;
- }
- SDL_mutexP(thread_lock);
- for ( i=0; i<SDL_numthreads; ++i ) {
- if ( thread == SDL_Threads[i] ) {
- 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);
-
- if ( SDL_Threads == NULL ) {
- SDL_ThreadsQuit();
- }
-}
-
-/* The default (non-thread-safe) global error variable */
-static SDL_error SDL_global_error;
-
-/* Routine to get the thread-specific error variable */
-SDL_error *SDL_GetErrBuf(void)
-{
- SDL_error *errbuf;
-
- errbuf = &SDL_global_error;
- if ( SDL_Threads ) {
- int i;
- Uint32 this_thread;
-
- this_thread = SDL_ThreadID();
- SDL_mutexP(thread_lock);
- for ( i=0; i<SDL_numthreads; ++i ) {
- if ( this_thread == SDL_Threads[i]->threadid ) {
- errbuf = &SDL_Threads[i]->errbuf;
- break;
- }
- }
- SDL_mutexV(thread_lock);
- }
- return(errbuf);
-}
-
-
-/* Arguments and callback to setup and run the user thread function */
-typedef struct {
- int (SDLCALL *func)(void *);
- void *data;
- SDL_Thread *info;
- SDL_sem *wait;
-} thread_args;
-
-void SDL_RunThread(void *data)
-{
- thread_args *args;
- int (SDLCALL *userfunc)(void *);
- void *userdata;
- int *statusloc;
-
- /* Perform any system-dependent setup
- - this function cannot fail, and cannot use SDL_SetError()
- */
- SDL_SYS_SetupThread();
-
- /* Get the thread id */
- args = (thread_args *)data;
- args->info->threadid = SDL_ThreadID();
-
- /* Figure out what function to run */
- userfunc = args->func;
- userdata = args->data;
- statusloc = &args->info->status;
-
- /* Wake up the parent thread */
- SDL_SemPost(args->wait);
-
- /* Run the function */
- *statusloc = userfunc(userdata);
-}
-
-#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
-#undef SDL_CreateThread
-DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread)
-#else
-DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data)
-#endif
-{
- SDL_Thread *thread;
- thread_args *args;
- int ret;
-
- /* Allocate memory for the thread info structure */
- thread = (SDL_Thread *)SDL_malloc(sizeof(*thread));
- if ( thread == NULL ) {
- SDL_OutOfMemory();
- return(NULL);
- }
- SDL_memset(thread, 0, (sizeof *thread));
- thread->status = -1;
-
- /* Set up the arguments for the thread */
- args = (thread_args *)SDL_malloc(sizeof(*args));
- if ( args == NULL ) {
- SDL_OutOfMemory();
- SDL_free(thread);
- return(NULL);
- }
- args->func = fn;
- args->data = data;
- args->info = thread;
- args->wait = SDL_CreateSemaphore(0);
- if ( args->wait == NULL ) {
- SDL_free(thread);
- SDL_free(args);
- return(NULL);
- }
-
- /* Add the thread to the list of available threads */
- SDL_AddThread(thread);
-
- /* Create the thread and go! */
-#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
- ret = SDL_SYS_CreateThread(thread, args, pfnBeginThread, pfnEndThread);
-#else
- ret = SDL_SYS_CreateThread(thread, args);
-#endif
- if ( ret >= 0 ) {
- /* Wait for the thread function to use arguments */
- SDL_SemWait(args->wait);
- } else {
- /* Oops, failed. Gotta free everything */
- SDL_DelThread(thread);
- SDL_free(thread);
- thread = NULL;
- }
- SDL_DestroySemaphore(args->wait);
- SDL_free(args);
-
- /* Everything is running now */
- return(thread);
-}
-
-void SDL_WaitThread(SDL_Thread *thread, int *status)
-{
- if ( thread ) {
- SDL_SYS_WaitThread(thread);
- if ( status ) {
- *status = thread->status;
- }
- SDL_DelThread(thread);
- SDL_free(thread);
- }
-}
-
-Uint32 SDL_GetThreadID(SDL_Thread *thread)
-{
- Uint32 id;
-
- if ( thread ) {
- id = thread->threadid;
- } else {
- id = SDL_ThreadID();
- }
- return(id);
-}
-
-void SDL_KillThread(SDL_Thread *thread)
-{
- if ( thread ) {
- SDL_SYS_KillThread(thread);
- SDL_WaitThread(thread, NULL);
- }
-}
-
diff --git a/distrib/sdl-1.2.12/src/thread/SDL_thread_c.h b/distrib/sdl-1.2.12/src/thread/SDL_thread_c.h
deleted file mode 100644
index 472d8a0..0000000
--- a/distrib/sdl-1.2.12/src/thread/SDL_thread_c.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_thread_c_h
-#define _SDL_thread_c_h
-
-/* Need the definitions of SYS_ThreadHandle */
-#if SDL_THREADS_DISABLED
-#include "generic/SDL_systhread_c.h"
-#elif SDL_THREAD_BEOS
-#include "beos/SDL_systhread_c.h"
-#elif SDL_THREAD_DC
-#include "dc/SDL_systhread_c.h"
-#elif SDL_THREAD_OS2
-#include "os2/SDL_systhread_c.h"
-#elif SDL_THREAD_PTH
-#include "pth/SDL_systhread_c.h"
-#elif SDL_THREAD_PTHREAD
-#include "pthread/SDL_systhread_c.h"
-#elif SDL_THREAD_SPROC
-#include "irix/SDL_systhread_c.h"
-#elif SDL_THREAD_WIN32
-#include "win32/SDL_systhread_c.h"
-#elif SDL_THREAD_SYMBIAN
-#include "symbian/SDL_systhread_c.h"
-#else
-#error Need thread implementation for this platform
-#include "generic/SDL_systhread_c.h"
-#endif
-#include "../SDL_error_c.h"
-
-/* This is the system-independent thread info structure */
-struct SDL_Thread {
- Uint32 threadid;
- SYS_ThreadHandle handle;
- int status;
- SDL_error errbuf;
- void *data;
-};
-
-/* This is the function called to run a thread */
-extern void SDL_RunThread(void *data);
-
-#endif /* _SDL_thread_c_h */
diff --git a/distrib/sdl-1.2.12/src/thread/amigaos/SDL_syssem.c b/distrib/sdl-1.2.12/src/thread/amigaos/SDL_syssem.c
deleted file mode 100644
index a31a213..0000000
--- a/distrib/sdl-1.2.12/src/thread/amigaos/SDL_syssem.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* An implementation of semaphores using mutexes and condition variables */
-
-#include "SDL_thread.h"
-#include "SDL_systhread_c.h"
-
-
-struct SDL_semaphore
-{
- struct SignalSemaphore Sem;
-};
-
-#undef D
-
-#define D(x)
-
-SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
-{
- SDL_sem *sem;
-
- sem = (SDL_sem *)SDL_malloc(sizeof(*sem));
-
- if ( ! sem ) {
- SDL_OutOfMemory();
- return(0);
- }
-
- D(bug("Creating semaphore %lx...\n",sem));
-
- SDL_memset(sem,0,sizeof(*sem));
-
- InitSemaphore(&sem->Sem);
-
- return(sem);
-}
-
-void SDL_DestroySemaphore(SDL_sem *sem)
-{
- D(bug("Destroying semaphore %lx...\n",sem));
-
- if ( sem ) {
-// Condizioni per liberare i task in attesa?
- SDL_free(sem);
- }
-}
-
-int SDL_SemTryWait(SDL_sem *sem)
-{
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- D(bug("TryWait semaphore...%lx\n",sem));
-
- ObtainSemaphore(&sem->Sem);
-// ReleaseSemaphore(&sem->Sem);
-
- return 1;
-}
-
-int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
-{
- int retval;
-
-
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- D(bug("WaitTimeout (%ld) semaphore...%lx\n",timeout,sem));
-
- /* A timeout of 0 is an easy case */
- if ( timeout == 0 ) {
- ObtainSemaphore(&sem->Sem);
- return 1;
- }
- if(!(retval=AttemptSemaphore(&sem->Sem)))
- {
- SDL_Delay(timeout);
- retval=AttemptSemaphore(&sem->Sem);
- }
-
- if(retval==TRUE)
- {
-// ReleaseSemaphore(&sem->Sem);
- retval=1;
- }
-
- return retval;
-}
-
-int SDL_SemWait(SDL_sem *sem)
-{
- ObtainSemaphore(&sem->Sem);
- return 0;
-}
-
-Uint32 SDL_SemValue(SDL_sem *sem)
-{
- Uint32 value;
-
- value = 0;
- if ( sem ) {
- #ifdef STORMC4_WOS
- value = sem->Sem.ssppc_SS.ss_NestCount;
- #else
- value = sem->Sem.ss_NestCount;
- #endif
- }
- return value;
-}
-
-int SDL_SemPost(SDL_sem *sem)
-{
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
- D(bug("SemPost semaphore...%lx\n",sem));
-
- ReleaseSemaphore(&sem->Sem);
- return 0;
-}
-
diff --git a/distrib/sdl-1.2.12/src/thread/amigaos/SDL_systhread.c b/distrib/sdl-1.2.12/src/thread/amigaos/SDL_systhread.c
deleted file mode 100644
index c6b42e7..0000000
--- a/distrib/sdl-1.2.12/src/thread/amigaos/SDL_systhread.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* BeOS thread management routines for SDL */
-
-#include "SDL_mutex.h"
-#include "SDL_thread.h"
-#include "../SDL_thread_c.h"
-#include "../SDL_systhread.h"
-#include "mydebug.h"
-
-typedef struct {
- int (*func)(void *);
- void *data;
- SDL_Thread *info;
- struct Task *wait;
-} thread_args;
-
-#ifndef MORPHOS
-
-#if defined(__SASC) && !defined(__PPC__)
-__saveds __asm Uint32 RunThread(register __a0 char *args )
-#elif defined(__PPC__)
-Uint32 RunThread(char *args)
-#else
-Uint32 __saveds RunThread(char *args __asm("a0") )
-#endif
-{
- #ifdef STORMC4_WOS
- thread_args *data=(thread_args *)args;
- #else
- thread_args *data=(thread_args *)atol(args);
- #endif
-
- struct Task *Father;
-
- D(bug("Received data: %lx\n",data));
- Father=data->wait;
-
- SDL_RunThread(data);
-
- Signal(Father,SIGBREAKF_CTRL_F);
- D(bug("Thread with data %lx ended\n",data));
- return(0);
-}
-
-#else
-
-#include <emul/emulinterface.h>
-
-Uint32 RunTheThread(void)
-{
- thread_args *data=(thread_args *)atol((char *)REG_A0);
- struct Task *Father;
-
- D(bug("Received data: %lx\n",data));
- Father=data->wait;
-
- SDL_RunThread(data);
-
- Signal(Father,SIGBREAKF_CTRL_F);
- D(bug("Thread with data %lx ended\n",data));
- return(0);
-}
-
-struct EmulLibEntry RunThreadStruct=
-{
- TRAP_LIB,
- 0,
- (ULONG)RunTheThread
-};
-
-void *RunThread=&RunThreadStruct;
-#endif
-
-
-int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
-{
- /* Create the thread and go! */
- char buffer[20];
-
- D(bug("Sending %lx to the new thread...\n",args));
-
- if(args)
- SDL_snprintf(buffer, SDL_arraysize(buffer),"%ld",args);
-
- #ifdef STORMC4_WOS
- thread->handle=CreateTaskPPCTags(TASKATTR_CODE, RunThread,
- TASKATTR_NAME, "SDL subtask",
- TASKATTR_STACKSIZE, 100000,
- (args ? TASKATTR_R3 : TAG_IGNORE), args,
- TASKATTR_INHERITR2, TRUE,
- TAG_DONE);
- #else
- thread->handle=(struct Task *)CreateNewProcTags(NP_Output,Output(),
- NP_Name,(ULONG)"SDL subtask",
- NP_CloseOutput, FALSE,
- NP_StackSize,20000,
- NP_Entry,(ULONG)RunThread,
- args ? NP_Arguments : TAG_IGNORE,(ULONG)buffer,
- TAG_DONE);
- #endif
-
- if(!thread->handle)
- {
- SDL_SetError("Not enough resources to create thread");
- return(-1);
- }
-
- return(0);
-}
-
-void SDL_SYS_SetupThread(void)
-{
-}
-
-Uint32 SDL_ThreadID(void)
-{
- return((Uint32)FindTask(NULL));
-}
-
-void SDL_SYS_WaitThread(SDL_Thread *thread)
-{
- SetSignal(0L,SIGBREAKF_CTRL_F|SIGBREAKF_CTRL_C);
- Wait(SIGBREAKF_CTRL_F|SIGBREAKF_CTRL_C);
-}
-
-void SDL_SYS_KillThread(SDL_Thread *thread)
-{
- Signal((struct Task *)thread->handle,SIGBREAKF_CTRL_C);
-}
diff --git a/distrib/sdl-1.2.12/src/thread/amigaos/SDL_systhread_c.h b/distrib/sdl-1.2.12/src/thread/amigaos/SDL_systhread_c.h
deleted file mode 100644
index 53ba3c8..0000000
--- a/distrib/sdl-1.2.12/src/thread/amigaos/SDL_systhread_c.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <exec/exec.h>
-#include <dos/dos.h>
-#include <dos/dostags.h>
-#if defined (__SASC) || defined(STORMC4_WOS)
-#include <proto/dos.h>
-#include <proto/exec.h>
-#else
-#include <inline/dos.h>
-#include <inline/exec.h>
-#endif
-
-#include "mydebug.h"
-
-extern struct ExecBase *SysBase;
-extern struct DosLibrary *DOSBase;
-
-#ifdef STORMC4_WOS
-#include <proto/powerpc.h>
-
-/* use powerpc.library functions instead og exec */
-#define SYS_ThreadHandle struct TaskPPC *
-#define Signal SignalPPC
-#define Wait WaitPPC
-#define Task TaskPPC
-#define FindTask FindTaskPPC
-#define SetSignal SetSignalPPC
-
-#define InitSemaphore InitSemaphorePPC
-#define ObtainSemaphore ObtainSemaphorePPC
-#define AttemptSemaphore AttemptSemaphorePPC
-#define ReleaseSemaphore ReleaseSemaphorePPC
-#define SignalSemaphore SignalSemaphorePPC
-
-#else
-
-#define SYS_ThreadHandle struct Task *
-#endif /*STORMC4_WOS*/
-
diff --git a/distrib/sdl-1.2.12/src/thread/amigaos/SDL_thread.c b/distrib/sdl-1.2.12/src/thread/amigaos/SDL_thread.c
deleted file mode 100644
index 7698f49..0000000
--- a/distrib/sdl-1.2.12/src/thread/amigaos/SDL_thread.c
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* System independent thread management routines for SDL */
-
-#include "SDL_mutex.h"
-#include "SDL_thread.h"
-#include "../SDL_thread_c.h"
-#include "../SDL_systhread.h"
-
-#define ARRAY_CHUNKSIZE 32
-/* The array of threads currently active in the application
- (except the main thread)
- The manipulation of an array here is safer than using a linked list.
-*/
-static int SDL_maxthreads = 0;
-static int SDL_numthreads = 0;
-static SDL_Thread **SDL_Threads = NULL;
-static struct SignalSemaphore thread_lock;
-int thread_lock_created = 0;
-
-int SDL_ThreadsInit(void)
-{
- InitSemaphore(&thread_lock);
- thread_lock_created=1;
- return 0;
-}
-
-/* This should never be called...
- If this is called by SDL_Quit(), we don't know whether or not we should
- clean up threads here. If any threads are still running after this call,
- they will no longer have access to any per-thread data.
- */
-void SDL_ThreadsQuit()
-{
- thread_lock_created=0;
-}
-
-/* Routines for manipulating the thread list */
-static void SDL_AddThread(SDL_Thread *thread)
-{
- SDL_Thread **threads;
-
- /* 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_created ) {
- if ( SDL_ThreadsInit() < 0 ) {
- return;
- }
- }
- ObtainSemaphore(&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 ) {
- threads=(SDL_Thread **)SDL_malloc((SDL_maxthreads+ARRAY_CHUNKSIZE)*
- (sizeof *threads));
- if ( threads == NULL ) {
- SDL_OutOfMemory();
- goto done;
- }
- SDL_memcpy(threads, SDL_Threads, SDL_numthreads*(sizeof *threads));
- SDL_maxthreads += ARRAY_CHUNKSIZE;
- if ( SDL_Threads ) {
- SDL_free(SDL_Threads);
- }
- SDL_Threads = threads;
- }
- SDL_Threads[SDL_numthreads++] = thread;
-done:
- ReleaseSemaphore(&thread_lock);
-}
-
-static void SDL_DelThread(SDL_Thread *thread)
-{
- int i;
-
- if ( thread_lock_created ) {
- ObtainSemaphore(&thread_lock);
- for ( i=0; i<SDL_numthreads; ++i ) {
- if ( thread == SDL_Threads[i] ) {
- break;
- }
- }
- if ( i < SDL_numthreads ) {
- --SDL_numthreads;
- while ( i < SDL_numthreads ) {
- SDL_Threads[i] = SDL_Threads[i+1];
- ++i;
- }
-#ifdef DEBUG_THREADS
- printf("Deleting thread (%d left - %d max)\n",
- SDL_numthreads, SDL_maxthreads);
-#endif
- }
- ReleaseSemaphore(&thread_lock);
- }
-}
-
-/* The default (non-thread-safe) global error variable */
-static SDL_error SDL_global_error;
-
-/* Routine to get the thread-specific error variable */
-SDL_error *SDL_GetErrBuf(void)
-{
- SDL_error *errbuf;
-
- errbuf = &SDL_global_error;
- if ( SDL_Threads ) {
- int i;
- Uint32 this_thread;
-
- this_thread = SDL_ThreadID();
- ObtainSemaphore(&thread_lock);
- for ( i=0; i<SDL_numthreads; ++i ) {
- if ( this_thread == SDL_Threads[i]->threadid ) {
- errbuf = &SDL_Threads[i]->errbuf;
- break;
- }
- }
- ReleaseSemaphore(&thread_lock);
- }
- return(errbuf);
-}
-
-
-/* Arguments and callback to setup and run the user thread function */
-typedef struct {
- int (*func)(void *);
- void *data;
- SDL_Thread *info;
- struct Task *wait;
-} thread_args;
-
-void SDL_RunThread(void *data)
-{
- thread_args *args;
- int (*userfunc)(void *);
- void *userdata;
- int *statusloc;
-
- /* Perform any system-dependent setup
- - this function cannot fail, and cannot use SDL_SetError()
- */
- SDL_SYS_SetupThread();
-
- /* Get the thread id */
- args = (thread_args *)data;
- args->info->threadid = SDL_ThreadID();
-
- /* Figure out what function to run */
- userfunc = args->func;
- userdata = args->data;
- statusloc = &args->info->status;
-
- /* Wake up the parent thread */
- Signal(args->wait,SIGBREAKF_CTRL_E);
-
- /* Run the function */
- *statusloc = userfunc(userdata);
-}
-
-SDL_Thread *SDL_CreateThread(int (*fn)(void *), void *data)
-{
- SDL_Thread *thread;
- thread_args *args;
- int ret;
-
- /* Allocate memory for the thread info structure */
- thread = (SDL_Thread *)SDL_malloc(sizeof(*thread));
- if ( thread == NULL ) {
- SDL_OutOfMemory();
- return(NULL);
- }
- SDL_memset(thread, 0, (sizeof *thread));
- thread->status = -1;
-
- /* Set up the arguments for the thread */
- args = (thread_args *)SDL_malloc(sizeof(*args));
- if ( args == NULL ) {
- SDL_OutOfMemory();
- SDL_free(thread);
- return(NULL);
- }
- args->func = fn;
- args->data = data;
- args->info = thread;
- args->wait = FindTask(NULL);
- if ( args->wait == NULL ) {
- SDL_free(thread);
- SDL_free(args);
- SDL_OutOfMemory();
- return(NULL);
- }
-
- /* Add the thread to the list of available threads */
- SDL_AddThread(thread);
-
- D(bug("Starting thread...\n"));
-
- /* Create the thread and go! */
- ret = SDL_SYS_CreateThread(thread, args);
- if ( ret >= 0 ) {
- D(bug("Waiting for thread CTRL_E...\n"));
- /* Wait for the thread function to use arguments */
- Wait(SIGBREAKF_CTRL_E);
- D(bug(" Arrived."));
- } else {
- /* Oops, failed. Gotta free everything */
- SDL_DelThread(thread);
- SDL_free(thread);
- thread = NULL;
- }
- SDL_free(args);
-
- /* Everything is running now */
- return(thread);
-}
-
-void SDL_WaitThread(SDL_Thread *thread, int *status)
-{
- if ( thread ) {
- SDL_SYS_WaitThread(thread);
- if ( status ) {
- *status = thread->status;
- }
- SDL_DelThread(thread);
- SDL_free(thread);
- }
-}
-
-Uint32 SDL_GetThreadID(SDL_Thread *thread)
-{
- Uint32 id;
-
- if ( thread ) {
- id = thread->threadid;
- } else {
- id = SDL_ThreadID();
- }
- return(id);
-}
-
-void SDL_KillThread(SDL_Thread *thread)
-{
- if ( thread ) {
- SDL_SYS_KillThread(thread);
- SDL_WaitThread(thread, NULL);
- }
-}
-
diff --git a/distrib/sdl-1.2.12/src/thread/beos/SDL_syssem.c b/distrib/sdl-1.2.12/src/thread/beos/SDL_syssem.c
deleted file mode 100644
index 5ea4f37..0000000
--- a/distrib/sdl-1.2.12/src/thread/beos/SDL_syssem.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Semaphores in the BeOS environment */
-
-#include <be/kernel/OS.h>
-
-#include "SDL_thread.h"
-
-
-struct SDL_semaphore {
- sem_id id;
-};
-
-/* Create a counting semaphore */
-SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
-{
- SDL_sem *sem;
-
- sem = (SDL_sem *)SDL_malloc(sizeof(*sem));
- if ( sem ) {
- sem->id = create_sem(initial_value, "SDL semaphore");
- if ( sem->id < B_NO_ERROR ) {
- SDL_SetError("create_sem() failed");
- SDL_free(sem);
- sem = NULL;
- }
- } else {
- SDL_OutOfMemory();
- }
- return(sem);
-}
-
-/* Free the semaphore */
-void SDL_DestroySemaphore(SDL_sem *sem)
-{
- if ( sem ) {
- if ( sem->id >= B_NO_ERROR ) {
- delete_sem(sem->id);
- }
- SDL_free(sem);
- }
-}
-
-int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
-{
- int32 val;
- int retval;
-
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- tryagain:
- if ( timeout == SDL_MUTEX_MAXWAIT ) {
- val = acquire_sem(sem->id);
- } else {
- timeout *= 1000; /* BeOS uses a timeout in microseconds */
- val = acquire_sem_etc(sem->id, 1, B_RELATIVE_TIMEOUT, timeout);
- }
- switch (val) {
- case B_INTERRUPTED:
- goto tryagain;
- case B_NO_ERROR:
- retval = 0;
- break;
- case B_TIMED_OUT:
- retval = SDL_MUTEX_TIMEDOUT;
- break;
- case B_WOULD_BLOCK:
- retval = SDL_MUTEX_TIMEDOUT;
- break;
- default:
- SDL_SetError("acquire_sem() failed");
- retval = -1;
- break;
- }
-
- return retval;
-}
-
-int SDL_SemTryWait(SDL_sem *sem)
-{
- return SDL_SemWaitTimeout(sem, 0);
-}
-
-int SDL_SemWait(SDL_sem *sem)
-{
- return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT);
-}
-
-/* Returns the current count of the semaphore */
-Uint32 SDL_SemValue(SDL_sem *sem)
-{
- int32 count;
- Uint32 value;
-
- value = 0;
- if ( sem ) {
- get_sem_count(sem->id, &count);
- if ( count > 0 ) {
- value = (Uint32)count;
- }
- }
- return value;
-}
-
-/* Atomically increases the semaphore's count (not blocking) */
-int SDL_SemPost(SDL_sem *sem)
-{
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- if ( release_sem(sem->id) != B_NO_ERROR ) {
- SDL_SetError("release_sem() failed");
- return -1;
- }
- return 0;
-}
diff --git a/distrib/sdl-1.2.12/src/thread/beos/SDL_systhread.c b/distrib/sdl-1.2.12/src/thread/beos/SDL_systhread.c
deleted file mode 100644
index 904fcc7..0000000
--- a/distrib/sdl-1.2.12/src/thread/beos/SDL_systhread.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* BeOS thread management routines for SDL */
-
-#include <stdio.h>
-#include <signal.h>
-#include <be/kernel/OS.h>
-
-#include "SDL_mutex.h"
-#include "SDL_thread.h"
-#include "../SDL_thread_c.h"
-#include "../SDL_systhread.h"
-
-
-static int sig_list[] = {
- SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGWINCH, 0
-};
-
-void SDL_MaskSignals(sigset_t *omask)
-{
- sigset_t mask;
- int i;
-
- sigemptyset(&mask);
- for ( i=0; sig_list[i]; ++i ) {
- sigaddset(&mask, sig_list[i]);
- }
- sigprocmask(SIG_BLOCK, &mask, omask);
-}
-void SDL_UnmaskSignals(sigset_t *omask)
-{
- sigprocmask(SIG_SETMASK, omask, NULL);
-}
-
-static int32 RunThread(void *data)
-{
- SDL_RunThread(data);
- return(0);
-}
-
-int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
-{
- /* Create the thread and go! */
- thread->handle=spawn_thread(RunThread, "SDL", B_NORMAL_PRIORITY, args);
- if ( (thread->handle == B_NO_MORE_THREADS) ||
- (thread->handle == B_NO_MEMORY) ) {
- SDL_SetError("Not enough resources to create thread");
- return(-1);
- }
- resume_thread(thread->handle);
- return(0);
-}
-
-void SDL_SYS_SetupThread(void)
-{
- /* Mask asynchronous signals for this thread */
- SDL_MaskSignals(NULL);
-}
-
-Uint32 SDL_ThreadID(void)
-{
- return((Uint32)find_thread(NULL));
-}
-
-void SDL_SYS_WaitThread(SDL_Thread *thread)
-{
- status_t the_status;
-
- wait_for_thread(thread->handle, &the_status);
-}
-
-void SDL_SYS_KillThread(SDL_Thread *thread)
-{
- kill_thread(thread->handle);
-}
diff --git a/distrib/sdl-1.2.12/src/thread/beos/SDL_systhread_c.h b/distrib/sdl-1.2.12/src/thread/beos/SDL_systhread_c.h
deleted file mode 100644
index 0d8d854..0000000
--- a/distrib/sdl-1.2.12/src/thread/beos/SDL_systhread_c.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <signal.h>
-#include <be/kernel/OS.h>
-
-typedef thread_id SYS_ThreadHandle;
-
-/* Functions needed to work with system threads in other portions of SDL */
-extern void SDL_MaskSignals(sigset_t *omask);
-extern void SDL_UnmaskSignals(sigset_t *omask);
diff --git a/distrib/sdl-1.2.12/src/thread/dc/SDL_syscond.c b/distrib/sdl-1.2.12/src/thread/dc/SDL_syscond.c
deleted file mode 100644
index 6a9d2dc..0000000
--- a/distrib/sdl-1.2.12/src/thread/dc/SDL_syscond.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* An implementation of condition variables using semaphores and mutexes */
-/*
- This implementation borrows heavily from the BeOS condition variable
- implementation, written by Christopher Tate and Owen Smith. Thanks!
- */
-
-#include "SDL_thread.h"
-
-struct SDL_cond
-{
- SDL_mutex *lock;
- int waiting;
- int signals;
- SDL_sem *wait_sem;
- SDL_sem *wait_done;
-};
-
-/* Create a condition variable */
-SDL_cond * SDL_CreateCond(void)
-{
- SDL_cond *cond;
-
- cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond));
- if ( cond ) {
- cond->lock = SDL_CreateMutex();
- cond->wait_sem = SDL_CreateSemaphore(0);
- cond->wait_done = SDL_CreateSemaphore(0);
- cond->waiting = cond->signals = 0;
- if ( ! cond->lock || ! cond->wait_sem || ! cond->wait_done ) {
- SDL_DestroyCond(cond);
- cond = NULL;
- }
- } else {
- SDL_OutOfMemory();
- }
- return(cond);
-}
-
-/* Destroy a condition variable */
-void SDL_DestroyCond(SDL_cond *cond)
-{
- if ( cond ) {
- if ( cond->wait_sem ) {
- SDL_DestroySemaphore(cond->wait_sem);
- }
- if ( cond->wait_done ) {
- SDL_DestroySemaphore(cond->wait_done);
- }
- if ( cond->lock ) {
- SDL_DestroyMutex(cond->lock);
- }
- SDL_free(cond);
- }
-}
-
-/* Restart one of the threads that are waiting on the condition variable */
-int SDL_CondSignal(SDL_cond *cond)
-{
- if ( ! cond ) {
- SDL_SetError("Passed a NULL condition variable");
- return -1;
- }
-
- /* If there are waiting threads not already signalled, then
- signal the condition and wait for the thread to respond.
- */
- SDL_LockMutex(cond->lock);
- if ( cond->waiting > cond->signals ) {
- ++cond->signals;
- SDL_SemPost(cond->wait_sem);
- SDL_UnlockMutex(cond->lock);
- SDL_SemWait(cond->wait_done);
- } else {
- SDL_UnlockMutex(cond->lock);
- }
-
- return 0;
-}
-
-/* Restart all threads that are waiting on the condition variable */
-int SDL_CondBroadcast(SDL_cond *cond)
-{
- if ( ! cond ) {
- SDL_SetError("Passed a NULL condition variable");
- return -1;
- }
-
- /* If there are waiting threads not already signalled, then
- signal the condition and wait for the thread to respond.
- */
- SDL_LockMutex(cond->lock);
- if ( cond->waiting > cond->signals ) {
- int i, num_waiting;
-
- num_waiting = (cond->waiting - cond->signals);
- cond->signals = cond->waiting;
- for ( i=0; i<num_waiting; ++i ) {
- SDL_SemPost(cond->wait_sem);
- }
- /* Now all released threads are blocked here, waiting for us.
- Collect them all (and win fabulous prizes!) :-)
- */
- SDL_UnlockMutex(cond->lock);
- for ( i=0; i<num_waiting; ++i ) {
- SDL_SemWait(cond->wait_done);
- }
- } else {
- SDL_UnlockMutex(cond->lock);
- }
-
- return 0;
-}
-
-/* Wait on the condition variable for at most 'ms' milliseconds.
- The mutex must be locked before entering this function!
- The mutex is unlocked during the wait, and locked again after the wait.
-
-Typical use:
-
-Thread A:
- SDL_LockMutex(lock);
- while ( ! condition ) {
- SDL_CondWait(cond);
- }
- SDL_UnlockMutex(lock);
-
-Thread B:
- SDL_LockMutex(lock);
- ...
- condition = true;
- ...
- SDL_UnlockMutex(lock);
- */
-int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms)
-{
- int retval;
-
- if ( ! cond ) {
- SDL_SetError("Passed a NULL condition variable");
- return -1;
- }
-
- /* Obtain the protection mutex, and increment the number of waiters.
- This allows the signal mechanism to only perform a signal if there
- are waiting threads.
- */
- SDL_LockMutex(cond->lock);
- ++cond->waiting;
- SDL_UnlockMutex(cond->lock);
-
- /* Unlock the mutex, as is required by condition variable semantics */
- SDL_UnlockMutex(mutex);
-
- /* Wait for a signal */
- if ( ms == SDL_MUTEX_MAXWAIT ) {
- retval = SDL_SemWait(cond->wait_sem);
- } else {
- retval = SDL_SemWaitTimeout(cond->wait_sem, ms);
- }
-
- /* Let the signaler know we have completed the wait, otherwise
- the signaler can race ahead and get the condition semaphore
- if we are stopped between the mutex unlock and semaphore wait,
- giving a deadlock. See the following URL for details:
- http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html
- */
- SDL_LockMutex(cond->lock);
- if ( cond->signals > 0 ) {
- /* If we timed out, we need to eat a condition signal */
- if ( retval > 0 ) {
- SDL_SemWait(cond->wait_sem);
- }
- /* We always notify the signal thread that we are done */
- SDL_SemPost(cond->wait_done);
-
- /* Signal handshake complete */
- --cond->signals;
- }
- --cond->waiting;
- SDL_UnlockMutex(cond->lock);
-
- /* Lock the mutex, as is required by condition variable semantics */
- SDL_LockMutex(mutex);
-
- return retval;
-}
-
-/* Wait on the condition variable forever */
-int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex)
-{
- return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT);
-}
diff --git a/distrib/sdl-1.2.12/src/thread/dc/SDL_syscond_c.h b/distrib/sdl-1.2.12/src/thread/dc/SDL_syscond_c.h
deleted file mode 100644
index 27d5509..0000000
--- a/distrib/sdl-1.2.12/src/thread/dc/SDL_syscond_c.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
diff --git a/distrib/sdl-1.2.12/src/thread/dc/SDL_sysmutex.c b/distrib/sdl-1.2.12/src/thread/dc/SDL_sysmutex.c
deleted file mode 100644
index 8e3d5f7..0000000
--- a/distrib/sdl-1.2.12/src/thread/dc/SDL_sysmutex.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* An implementation of mutexes using semaphores */
-
-#include "SDL_thread.h"
-#include "SDL_systhread_c.h"
-
-#include <arch/spinlock.h>
-
-struct SDL_mutex {
- int recursive;
- Uint32 owner;
- spinlock_t mutex;
-};
-
-/* Create a mutex */
-SDL_mutex *SDL_CreateMutex(void)
-{
- SDL_mutex *mutex;
-
- /* Allocate mutex memory */
- mutex = (SDL_mutex *)SDL_malloc(sizeof(*mutex));
- if ( mutex ) {
- spinlock_init(&mutex->mutex);
- mutex->recursive = 0;
- mutex->owner = 0;
- } else {
- SDL_OutOfMemory();
- }
- return mutex;
-}
-
-/* Free the mutex */
-void SDL_DestroyMutex(SDL_mutex *mutex)
-{
- if ( mutex ) {
- SDL_free(mutex);
- }
-}
-
-/* Lock the semaphore */
-int SDL_mutexP(SDL_mutex *mutex)
-{
-#if SDL_THREADS_DISABLED
- return SDL_arraysize(return ),0;
-#else
- Uint32 this_thread;
-
- if ( mutex == NULL ) {
- SDL_SetError("Passed a NULL mutex");
- return -1;
- }
-
- this_thread = SDL_ThreadID();
- if ( mutex->owner == this_thread ) {
- ++mutex->recursive;
- } else {
- /* The order of operations is important.
- We set the locking thread id after we obtain the lock
- so unlocks from other threads will fail.
- */
- spinlock_lock(&mutex->mutex);
- mutex->owner = this_thread;
- mutex->recursive = 0;
- }
-
- return 0;
-#endif /* SDL_THREADS_DISABLED */
-}
-
-/* Unlock the mutex */
-int SDL_mutexV(SDL_mutex *mutex)
-{
-#if SDL_THREADS_DISABLED
- return 0;
-#else
- if ( mutex == NULL ) {
- SDL_SetError("Passed a NULL mutex");
- return -1;
- }
-
- /* If we don't own the mutex, we can't unlock it */
- if ( SDL_ThreadID() != mutex->owner ) {
- SDL_SetError("mutex not owned by this thread");
- return -1;
- }
-
- if ( mutex->recursive ) {
- --mutex->recursive;
- } else {
- /* The order of operations is important.
- First reset the owner so another thread doesn't lock
- the mutex and set the ownership before we reset it,
- then release the lock semaphore.
- */
- mutex->owner = 0;
- spinlock_unlock(&mutex->mutex);
- }
- return 0;
-#endif /* SDL_THREADS_DISABLED */
-}
diff --git a/distrib/sdl-1.2.12/src/thread/dc/SDL_sysmutex_c.h b/distrib/sdl-1.2.12/src/thread/dc/SDL_sysmutex_c.h
deleted file mode 100644
index 27d5509..0000000
--- a/distrib/sdl-1.2.12/src/thread/dc/SDL_sysmutex_c.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
diff --git a/distrib/sdl-1.2.12/src/thread/dc/SDL_syssem.c b/distrib/sdl-1.2.12/src/thread/dc/SDL_syssem.c
deleted file mode 100644
index d9888f7..0000000
--- a/distrib/sdl-1.2.12/src/thread/dc/SDL_syssem.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-#include <errno.h>
-
-#include "SDL_config.h"
-
-/* An implementation of semaphores using mutexes and condition variables */
-
-#include "SDL_timer.h"
-#include "SDL_thread.h"
-#include "SDL_systhread_c.h"
-
-
-#if SDL_THREADS_DISABLED
-
-SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
-{
- SDL_SetError("SDL not configured with thread support");
- return (SDL_sem *)0;
-}
-
-void SDL_DestroySemaphore(SDL_sem *sem)
-{
- return;
-}
-
-int SDL_SemTryWait(SDL_sem *sem)
-{
- SDL_SetError("SDL not configured with thread support");
- return -1;
-}
-
-int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
-{
- SDL_SetError("SDL not configured with thread support");
- return -1;
-}
-
-int SDL_SemWait(SDL_sem *sem)
-{
- SDL_SetError("SDL not configured with thread support");
- return -1;
-}
-
-Uint32 SDL_SemValue(SDL_sem *sem)
-{
- return 0;
-}
-
-int SDL_SemPost(SDL_sem *sem)
-{
- SDL_SetError("SDL not configured with thread support");
- return -1;
-}
-
-#else
-
-#include <kos/sem.h>
-
-struct SDL_semaphore
-{
- semaphore_t sem;
-};
-
-SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
-{
- return (SDL_sem *)sem_create(initial_value);
-}
-
-/* WARNING:
- You cannot call this function when another thread is using the semaphore.
-*/
-void SDL_DestroySemaphore(SDL_sem *sem)
-{
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return;
- }
-
- sem_destroy(&sem->sem);
-}
-
-int SDL_SemTryWait(SDL_sem *sem)
-{
- int retval;
-
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- retval = sem_trywait(&sem->sem);
- if (retval==0) return 0;
- else return SDL_MUTEX_TIMEDOUT;
-
- return retval;
-}
-
-int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
-{
- int retval;
-
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- /* A timeout of 0 is an easy case */
- if ( timeout == 0 ) {
- return SDL_SemTryWait(sem);
- }
-
- retval = sem_wait_timed(&sem->sem,timeout);
- if (retval==-1) retval= SDL_MUTEX_TIMEDOUT;
-
- return retval;
-}
-
-int SDL_SemWait(SDL_sem *sem)
-{
- int retval;
-
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- while ( ((retval = sem_wait(&sem->sem)) == -1) && (errno == EINTR) ) {}
- return retval;
-}
-
-Uint32 SDL_SemValue(SDL_sem *sem)
-{
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- return sem_count(&sem->sem);
-}
-
-int SDL_SemPost(SDL_sem *sem)
-{
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- sem_signal(&sem->sem);
- return 0;
-}
-
-#endif /* SDL_THREADS_DISABLED */
diff --git a/distrib/sdl-1.2.12/src/thread/dc/SDL_syssem_c.h b/distrib/sdl-1.2.12/src/thread/dc/SDL_syssem_c.h
deleted file mode 100644
index 27d5509..0000000
--- a/distrib/sdl-1.2.12/src/thread/dc/SDL_syssem_c.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
diff --git a/distrib/sdl-1.2.12/src/thread/dc/SDL_systhread.c b/distrib/sdl-1.2.12/src/thread/dc/SDL_systhread.c
deleted file mode 100644
index 8c782cc..0000000
--- a/distrib/sdl-1.2.12/src/thread/dc/SDL_systhread.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Thread management routines for SDL */
-
-#include "SDL_thread.h"
-#include "../SDL_thread_c.h"
-#include "../SDL_systhread.h"
-
-#include <kos/thread.h>
-
-int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
-{
- thread->handle = thd_create(SDL_RunThread,args);
- if (thread->handle == NULL) {
- SDL_SetError("Not enough resources to create thread");
- return(-1);
- }
- return(0);
-}
-
-void SDL_SYS_SetupThread(void)
-{
- return;
-}
-
-Uint32 SDL_ThreadID(void)
-{
- return (Uint32)thd_get_current();
-}
-
-void SDL_SYS_WaitThread(SDL_Thread *thread)
-{
- thd_wait(thread->handle);
-}
-
-void SDL_SYS_KillThread(SDL_Thread *thread)
-{
- thd_destroy(thread->handle);
-}
diff --git a/distrib/sdl-1.2.12/src/thread/dc/SDL_systhread_c.h b/distrib/sdl-1.2.12/src/thread/dc/SDL_systhread_c.h
deleted file mode 100644
index 8f9553f..0000000
--- a/distrib/sdl-1.2.12/src/thread/dc/SDL_systhread_c.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-typedef struct kthread* SYS_ThreadHandle;
diff --git a/distrib/sdl-1.2.12/src/thread/epoc/SDL_sysmutex.cpp b/distrib/sdl-1.2.12/src/thread/epoc/SDL_sysmutex.cpp
deleted file mode 100644
index 1792012..0000000
--- a/distrib/sdl-1.2.12/src/thread/epoc/SDL_sysmutex.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- SDL_sysmutex.cpp
-
- Epoc version by Markus Mertama (w@iki.fi)
-*/
-
-
-/* Mutex functions using the Win32 API */
-
-#include<e32std.h>
-
-#include "SDL_error.h"
-#include "SDL_mutex.h"
-
-
-
-struct SDL_mutex
- {
- TInt handle;
- };
-
-extern TInt CreateUnique(TInt (*aFunc)(const TDesC& aName, TAny*, TAny*), TAny*, TAny*);
-
-TInt NewMutex(const TDesC& aName, TAny* aPtr1, TAny*)
- {
- return ((RMutex*)aPtr1)->CreateGlobal(aName);
- }
-
-/* Create a mutex */
-SDL_mutex *SDL_CreateMutex(void)
-{
- RMutex rmutex;
-
- TInt status = CreateUnique(NewMutex, &rmutex, NULL);
- if(status != KErrNone)
- {
- SDL_SetError("Couldn't create mutex");
- }
- SDL_mutex* mutex = new /*(ELeave)*/ SDL_mutex;
- mutex->handle = rmutex.Handle();
- return(mutex);
-}
-
-/* Free the mutex */
-void SDL_DestroyMutex(SDL_mutex *mutex)
-{
- if ( mutex )
- {
- RMutex rmutex;
- rmutex.SetHandle(mutex->handle);
- rmutex.Signal();
- rmutex.Close();
- delete(mutex);
- mutex = NULL;
- }
-}
-
-/* Lock the mutex */
-int SDL_mutexP(SDL_mutex *mutex)
-{
- if ( mutex == NULL ) {
- SDL_SetError("Passed a NULL mutex");
- return -1;
- }
- RMutex rmutex;
- rmutex.SetHandle(mutex->handle);
- rmutex.Wait();
- return(0);
-}
-
-/* Unlock the mutex */
-int SDL_mutexV(SDL_mutex *mutex)
-{
- if ( mutex == NULL ) {
- SDL_SetError("Passed a NULL mutex");
- return -1;
- }
- RMutex rmutex;
- rmutex.SetHandle(mutex->handle);
- rmutex.Signal();
- return(0);
-}
diff --git a/distrib/sdl-1.2.12/src/thread/epoc/SDL_syssem.cpp b/distrib/sdl-1.2.12/src/thread/epoc/SDL_syssem.cpp
deleted file mode 100644
index c3982d2..0000000
--- a/distrib/sdl-1.2.12/src/thread/epoc/SDL_syssem.cpp
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- SDL_syssem.cpp
-
- Epoc version by Markus Mertama (w@iki.fi)
-*/
-
-/* Semaphore functions using the Win32 API */
-
-#include <e32std.h>
-
-#include "SDL_error.h"
-#include "SDL_thread.h"
-
-
-#define SDL_MUTEX_TIMEOUT -2
-
-struct SDL_semaphore
- {
- TInt handle;
- TInt count;
- };
-
-extern TInt CreateUnique(TInt (*aFunc)(const TDesC& aName, TAny*, TAny*), TAny*, TAny*);
-extern TInt NewThread(const TDesC& aName, TAny* aPtr1, TAny* aPtr2);
-
-TInt NewSema(const TDesC& aName, TAny* aPtr1, TAny* aPtr2)
- {
- TInt value = *((TInt*) aPtr2);
- return ((RSemaphore*)aPtr1)->CreateGlobal(aName, value);
- }
-
-/* Create a semaphore */
-SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
-{
- RSemaphore s;
- TInt status = CreateUnique(NewSema, &s, &initial_value);
- if(status != KErrNone)
- {
- SDL_SetError("Couldn't create semaphore");
- }
- SDL_semaphore* sem = new /*(ELeave)*/ SDL_semaphore;
- sem->handle = s.Handle();
- sem->count = initial_value;
- return(sem);
-}
-
-/* Free the semaphore */
-void SDL_DestroySemaphore(SDL_sem *sem)
-{
- if ( sem )
- {
- RSemaphore sema;
- sema.SetHandle(sem->handle);
- sema.Signal(sema.Count());
- sema.Close();
- delete sem;
- sem = NULL;
- }
-}
-
-
- struct TInfo
- {
- TInfo(TInt aTime, TInt aHandle) :
- iTime(aTime), iHandle(aHandle), iVal(0) {}
- TInt iTime;
- TInt iHandle;
- TInt iVal;
- };
-
-TBool ThreadRun(TAny* aInfo)
- {
- TInfo* info = STATIC_CAST(TInfo*, aInfo);
- User::After(info->iTime);
- RSemaphore sema;
- sema.SetHandle(info->iHandle);
- sema.Signal();
- info->iVal = SDL_MUTEX_TIMEOUT;
- return 0;
- }
-
-
-
-
-void _WaitAll(SDL_sem *sem)
- {
- //since SemTryWait may changed the counter.
- //this may not be atomic, but hopes it works.
- RSemaphore sema;
- sema.SetHandle(sem->handle);
- sema.Wait();
- while(sem->count < 0)
- {
- sema.Wait();
- }
- }
-
-int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
-{
- if ( ! sem ) {
- SDL_SetError("Passed a NULL sem");
- return -1;
- }
-
- if ( timeout == SDL_MUTEX_MAXWAIT )
- {
- _WaitAll(sem);
- return SDL_MUTEX_MAXWAIT;
- }
-
-
- RThread thread;
-
- TInfo* info = new (ELeave)TInfo(timeout, sem->handle);
-
- TInt status = CreateUnique(NewThread, &thread, info);
-
- if(status != KErrNone)
- return status;
-
- thread.Resume();
-
- _WaitAll(sem);
-
- if(thread.ExitType() == EExitPending)
- {
- thread.Kill(SDL_MUTEX_TIMEOUT);
- }
-
- thread.Close();
-
- return info->iVal;
-}
-
-int SDL_SemTryWait(SDL_sem *sem)
-{
- if(sem->count > 0)
- {
- sem->count--;
- }
- return SDL_MUTEX_TIMEOUT;
-}
-
-int SDL_SemWait(SDL_sem *sem)
-{
- return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT);
-}
-
-/* Returns the current count of the semaphore */
-Uint32 SDL_SemValue(SDL_sem *sem)
-{
- if ( ! sem ) {
- SDL_SetError("Passed a NULL sem");
- return 0;
- }
- return sem->count;
-}
-
-int SDL_SemPost(SDL_sem *sem)
-{
- if ( ! sem ) {
- SDL_SetError("Passed a NULL sem");
- return -1;
- }
- sem->count++;
- RSemaphore sema;
- sema.SetHandle(sem->handle);
- sema.Signal();
- return 0;
-}
diff --git a/distrib/sdl-1.2.12/src/thread/epoc/SDL_systhread.cpp b/distrib/sdl-1.2.12/src/thread/epoc/SDL_systhread.cpp
deleted file mode 100644
index 708f004..0000000
--- a/distrib/sdl-1.2.12/src/thread/epoc/SDL_systhread.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- SDL_systhread.cpp
- Epoc thread management routines for SDL
-
- Epoc version by Markus Mertama (w@iki.fi)
-*/
-
-
-extern "C" {
-#undef NULL
-#include "SDL_error.h"
-#include "SDL_thread.h"
-#include "../SDL_systhread.h"
- };
-
-#include <e32std.h>
-
-
-static int object_count;
-
-int RunThread(TAny* data)
-{
- SDL_RunThread(data);
- return(0);
-}
-
-
-TInt NewThread(const TDesC& aName, TAny* aPtr1, TAny* aPtr2)
- {
- return ((RThread*)(aPtr1))->Create(aName,
- RunThread,
- KDefaultStackSize,
- NULL,
- aPtr2);
- }
-
-int CreateUnique(TInt (*aFunc)(const TDesC& aName, TAny*, TAny*), TAny* aPtr1, TAny* aPtr2)
- {
- TBuf<16> name;
- TInt status = KErrNone;
- do
- {
- object_count++;
- name.Format(_L("SDL_%x"), object_count);
- status = aFunc(name, aPtr1, aPtr2);
- }
- while(status == KErrAlreadyExists);
- return status;
- }
-
-
-int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
-{
- RThread rthread;
-
- TInt status = CreateUnique(NewThread, &rthread, args);
- if (status != KErrNone)
- {
- delete(((RThread*)(thread->handle)));
- thread->handle = NULL;
- SDL_SetError("Not enough resources to create thread");
- return(-1);
- }
- rthread.Resume();
- thread->handle = rthread.Handle();
- return(0);
-}
-
-void SDL_SYS_SetupThread(void)
-{
- return;
-}
-
-Uint32 SDL_ThreadID(void)
-{
- RThread current;
- TThreadId id = current.Id();
- return id;
-}
-
-void SDL_SYS_WaitThread(SDL_Thread *thread)
-{
- RUndertaker taker;
- taker.Create();
- TRequestStatus status;
- taker.Logon(status, thread->handle);
- User::WaitForRequest(status);
- taker.Close();
-}
-
-/* WARNING: This function is really a last resort.
- * Threads should be signaled and then exit by themselves.
- * TerminateThread() doesn't perform stack and DLL cleanup.
- */
-void SDL_SYS_KillThread(SDL_Thread *thread)
-{
- RThread rthread;
- rthread.SetHandle(thread->handle);
- rthread.Kill(0);
- rthread.Close();
-}
diff --git a/distrib/sdl-1.2.12/src/thread/epoc/SDL_systhread_c.h b/distrib/sdl-1.2.12/src/thread/epoc/SDL_systhread_c.h
deleted file mode 100644
index 6f5fd94..0000000
--- a/distrib/sdl-1.2.12/src/thread/epoc/SDL_systhread_c.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- SDL_systhread_c.h
-
- Epoc version by Markus Mertama (w@iki.fi)
-*/
-
-typedef int SYS_ThreadHandle;
-
diff --git a/distrib/sdl-1.2.12/src/thread/generic/SDL_syscond.c b/distrib/sdl-1.2.12/src/thread/generic/SDL_syscond.c
deleted file mode 100644
index 6a9d2dc..0000000
--- a/distrib/sdl-1.2.12/src/thread/generic/SDL_syscond.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* An implementation of condition variables using semaphores and mutexes */
-/*
- This implementation borrows heavily from the BeOS condition variable
- implementation, written by Christopher Tate and Owen Smith. Thanks!
- */
-
-#include "SDL_thread.h"
-
-struct SDL_cond
-{
- SDL_mutex *lock;
- int waiting;
- int signals;
- SDL_sem *wait_sem;
- SDL_sem *wait_done;
-};
-
-/* Create a condition variable */
-SDL_cond * SDL_CreateCond(void)
-{
- SDL_cond *cond;
-
- cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond));
- if ( cond ) {
- cond->lock = SDL_CreateMutex();
- cond->wait_sem = SDL_CreateSemaphore(0);
- cond->wait_done = SDL_CreateSemaphore(0);
- cond->waiting = cond->signals = 0;
- if ( ! cond->lock || ! cond->wait_sem || ! cond->wait_done ) {
- SDL_DestroyCond(cond);
- cond = NULL;
- }
- } else {
- SDL_OutOfMemory();
- }
- return(cond);
-}
-
-/* Destroy a condition variable */
-void SDL_DestroyCond(SDL_cond *cond)
-{
- if ( cond ) {
- if ( cond->wait_sem ) {
- SDL_DestroySemaphore(cond->wait_sem);
- }
- if ( cond->wait_done ) {
- SDL_DestroySemaphore(cond->wait_done);
- }
- if ( cond->lock ) {
- SDL_DestroyMutex(cond->lock);
- }
- SDL_free(cond);
- }
-}
-
-/* Restart one of the threads that are waiting on the condition variable */
-int SDL_CondSignal(SDL_cond *cond)
-{
- if ( ! cond ) {
- SDL_SetError("Passed a NULL condition variable");
- return -1;
- }
-
- /* If there are waiting threads not already signalled, then
- signal the condition and wait for the thread to respond.
- */
- SDL_LockMutex(cond->lock);
- if ( cond->waiting > cond->signals ) {
- ++cond->signals;
- SDL_SemPost(cond->wait_sem);
- SDL_UnlockMutex(cond->lock);
- SDL_SemWait(cond->wait_done);
- } else {
- SDL_UnlockMutex(cond->lock);
- }
-
- return 0;
-}
-
-/* Restart all threads that are waiting on the condition variable */
-int SDL_CondBroadcast(SDL_cond *cond)
-{
- if ( ! cond ) {
- SDL_SetError("Passed a NULL condition variable");
- return -1;
- }
-
- /* If there are waiting threads not already signalled, then
- signal the condition and wait for the thread to respond.
- */
- SDL_LockMutex(cond->lock);
- if ( cond->waiting > cond->signals ) {
- int i, num_waiting;
-
- num_waiting = (cond->waiting - cond->signals);
- cond->signals = cond->waiting;
- for ( i=0; i<num_waiting; ++i ) {
- SDL_SemPost(cond->wait_sem);
- }
- /* Now all released threads are blocked here, waiting for us.
- Collect them all (and win fabulous prizes!) :-)
- */
- SDL_UnlockMutex(cond->lock);
- for ( i=0; i<num_waiting; ++i ) {
- SDL_SemWait(cond->wait_done);
- }
- } else {
- SDL_UnlockMutex(cond->lock);
- }
-
- return 0;
-}
-
-/* Wait on the condition variable for at most 'ms' milliseconds.
- The mutex must be locked before entering this function!
- The mutex is unlocked during the wait, and locked again after the wait.
-
-Typical use:
-
-Thread A:
- SDL_LockMutex(lock);
- while ( ! condition ) {
- SDL_CondWait(cond);
- }
- SDL_UnlockMutex(lock);
-
-Thread B:
- SDL_LockMutex(lock);
- ...
- condition = true;
- ...
- SDL_UnlockMutex(lock);
- */
-int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms)
-{
- int retval;
-
- if ( ! cond ) {
- SDL_SetError("Passed a NULL condition variable");
- return -1;
- }
-
- /* Obtain the protection mutex, and increment the number of waiters.
- This allows the signal mechanism to only perform a signal if there
- are waiting threads.
- */
- SDL_LockMutex(cond->lock);
- ++cond->waiting;
- SDL_UnlockMutex(cond->lock);
-
- /* Unlock the mutex, as is required by condition variable semantics */
- SDL_UnlockMutex(mutex);
-
- /* Wait for a signal */
- if ( ms == SDL_MUTEX_MAXWAIT ) {
- retval = SDL_SemWait(cond->wait_sem);
- } else {
- retval = SDL_SemWaitTimeout(cond->wait_sem, ms);
- }
-
- /* Let the signaler know we have completed the wait, otherwise
- the signaler can race ahead and get the condition semaphore
- if we are stopped between the mutex unlock and semaphore wait,
- giving a deadlock. See the following URL for details:
- http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html
- */
- SDL_LockMutex(cond->lock);
- if ( cond->signals > 0 ) {
- /* If we timed out, we need to eat a condition signal */
- if ( retval > 0 ) {
- SDL_SemWait(cond->wait_sem);
- }
- /* We always notify the signal thread that we are done */
- SDL_SemPost(cond->wait_done);
-
- /* Signal handshake complete */
- --cond->signals;
- }
- --cond->waiting;
- SDL_UnlockMutex(cond->lock);
-
- /* Lock the mutex, as is required by condition variable semantics */
- SDL_LockMutex(mutex);
-
- return retval;
-}
-
-/* Wait on the condition variable forever */
-int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex)
-{
- return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT);
-}
diff --git a/distrib/sdl-1.2.12/src/thread/generic/SDL_sysmutex.c b/distrib/sdl-1.2.12/src/thread/generic/SDL_sysmutex.c
deleted file mode 100644
index 18099d2..0000000
--- a/distrib/sdl-1.2.12/src/thread/generic/SDL_sysmutex.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* An implementation of mutexes using semaphores */
-
-#include "SDL_thread.h"
-#include "SDL_systhread_c.h"
-
-
-struct SDL_mutex {
- int recursive;
- Uint32 owner;
- SDL_sem *sem;
-};
-
-/* Create a mutex */
-SDL_mutex *SDL_CreateMutex(void)
-{
- SDL_mutex *mutex;
-
- /* Allocate mutex memory */
- mutex = (SDL_mutex *)SDL_malloc(sizeof(*mutex));
- if ( mutex ) {
- /* Create the mutex semaphore, with initial value 1 */
- mutex->sem = SDL_CreateSemaphore(1);
- mutex->recursive = 0;
- mutex->owner = 0;
- if ( ! mutex->sem ) {
- SDL_free(mutex);
- mutex = NULL;
- }
- } else {
- SDL_OutOfMemory();
- }
- return mutex;
-}
-
-/* Free the mutex */
-void SDL_DestroyMutex(SDL_mutex *mutex)
-{
- if ( mutex ) {
- if ( mutex->sem ) {
- SDL_DestroySemaphore(mutex->sem);
- }
- SDL_free(mutex);
- }
-}
-
-/* Lock the semaphore */
-int SDL_mutexP(SDL_mutex *mutex)
-{
-#if SDL_THREADS_DISABLED
- return 0;
-#else
- Uint32 this_thread;
-
- if ( mutex == NULL ) {
- SDL_SetError("Passed a NULL mutex");
- return -1;
- }
-
- this_thread = SDL_ThreadID();
- if ( mutex->owner == this_thread ) {
- ++mutex->recursive;
- } else {
- /* The order of operations is important.
- We set the locking thread id after we obtain the lock
- so unlocks from other threads will fail.
- */
- SDL_SemWait(mutex->sem);
- mutex->owner = this_thread;
- mutex->recursive = 0;
- }
-
- return 0;
-#endif /* SDL_THREADS_DISABLED */
-}
-
-/* Unlock the mutex */
-int SDL_mutexV(SDL_mutex *mutex)
-{
-#if SDL_THREADS_DISABLED
- return 0;
-#else
- if ( mutex == NULL ) {
- SDL_SetError("Passed a NULL mutex");
- return -1;
- }
-
- /* If we don't own the mutex, we can't unlock it */
- if ( SDL_ThreadID() != mutex->owner ) {
- SDL_SetError("mutex not owned by this thread");
- return -1;
- }
-
- if ( mutex->recursive ) {
- --mutex->recursive;
- } else {
- /* The order of operations is important.
- First reset the owner so another thread doesn't lock
- the mutex and set the ownership before we reset it,
- then release the lock semaphore.
- */
- mutex->owner = 0;
- SDL_SemPost(mutex->sem);
- }
- return 0;
-#endif /* SDL_THREADS_DISABLED */
-}
diff --git a/distrib/sdl-1.2.12/src/thread/generic/SDL_sysmutex_c.h b/distrib/sdl-1.2.12/src/thread/generic/SDL_sysmutex_c.h
deleted file mode 100644
index 27d5509..0000000
--- a/distrib/sdl-1.2.12/src/thread/generic/SDL_sysmutex_c.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
diff --git a/distrib/sdl-1.2.12/src/thread/generic/SDL_syssem.c b/distrib/sdl-1.2.12/src/thread/generic/SDL_syssem.c
deleted file mode 100644
index c3ffd3f..0000000
--- a/distrib/sdl-1.2.12/src/thread/generic/SDL_syssem.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* An implementation of semaphores using mutexes and condition variables */
-
-#include "SDL_timer.h"
-#include "SDL_thread.h"
-#include "SDL_systhread_c.h"
-
-
-#if SDL_THREADS_DISABLED
-
-SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
-{
- SDL_SetError("SDL not configured with thread support");
- return (SDL_sem *)0;
-}
-
-void SDL_DestroySemaphore(SDL_sem *sem)
-{
- return;
-}
-
-int SDL_SemTryWait(SDL_sem *sem)
-{
- SDL_SetError("SDL not configured with thread support");
- return -1;
-}
-
-int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
-{
- SDL_SetError("SDL not configured with thread support");
- return -1;
-}
-
-int SDL_SemWait(SDL_sem *sem)
-{
- SDL_SetError("SDL not configured with thread support");
- return -1;
-}
-
-Uint32 SDL_SemValue(SDL_sem *sem)
-{
- return 0;
-}
-
-int SDL_SemPost(SDL_sem *sem)
-{
- SDL_SetError("SDL not configured with thread support");
- return -1;
-}
-
-#else
-
-struct SDL_semaphore
-{
- Uint32 count;
- Uint32 waiters_count;
- SDL_mutex *count_lock;
- SDL_cond *count_nonzero;
-};
-
-SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
-{
- SDL_sem *sem;
-
- sem = (SDL_sem *)SDL_malloc(sizeof(*sem));
- if ( ! sem ) {
- SDL_OutOfMemory();
- return NULL;
- }
- sem->count = initial_value;
- sem->waiters_count = 0;
-
- sem->count_lock = SDL_CreateMutex();
- sem->count_nonzero = SDL_CreateCond();
- if ( ! sem->count_lock || ! sem->count_nonzero ) {
- SDL_DestroySemaphore(sem);
- return NULL;
- }
-
- return sem;
-}
-
-/* WARNING:
- You cannot call this function when another thread is using the semaphore.
-*/
-void SDL_DestroySemaphore(SDL_sem *sem)
-{
- if ( sem ) {
- sem->count = 0xFFFFFFFF;
- while ( sem->waiters_count > 0) {
- SDL_CondSignal(sem->count_nonzero);
- SDL_Delay(10);
- }
- SDL_DestroyCond(sem->count_nonzero);
- if ( sem->count_lock ) {
- SDL_mutexP(sem->count_lock);
- SDL_mutexV(sem->count_lock);
- SDL_DestroyMutex(sem->count_lock);
- }
- SDL_free(sem);
- }
-}
-
-int SDL_SemTryWait(SDL_sem *sem)
-{
- int retval;
-
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- retval = SDL_MUTEX_TIMEDOUT;
- SDL_LockMutex(sem->count_lock);
- if ( sem->count > 0 ) {
- --sem->count;
- retval = 0;
- }
- SDL_UnlockMutex(sem->count_lock);
-
- return retval;
-}
-
-int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
-{
- int retval;
-
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- /* A timeout of 0 is an easy case */
- if ( timeout == 0 ) {
- return SDL_SemTryWait(sem);
- }
-
- SDL_LockMutex(sem->count_lock);
- ++sem->waiters_count;
- retval = 0;
- while ( (sem->count == 0) && (retval != SDL_MUTEX_TIMEDOUT) ) {
- retval = SDL_CondWaitTimeout(sem->count_nonzero,
- sem->count_lock, timeout);
- }
- --sem->waiters_count;
- --sem->count;
- SDL_UnlockMutex(sem->count_lock);
-
- return retval;
-}
-
-int SDL_SemWait(SDL_sem *sem)
-{
- return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT);
-}
-
-Uint32 SDL_SemValue(SDL_sem *sem)
-{
- Uint32 value;
-
- value = 0;
- if ( sem ) {
- SDL_LockMutex(sem->count_lock);
- value = sem->count;
- SDL_UnlockMutex(sem->count_lock);
- }
- return value;
-}
-
-int SDL_SemPost(SDL_sem *sem)
-{
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- SDL_LockMutex(sem->count_lock);
- if ( sem->waiters_count > 0 ) {
- SDL_CondSignal(sem->count_nonzero);
- }
- ++sem->count;
- SDL_UnlockMutex(sem->count_lock);
-
- return 0;
-}
-
-#endif /* SDL_THREADS_DISABLED */
diff --git a/distrib/sdl-1.2.12/src/thread/generic/SDL_systhread.c b/distrib/sdl-1.2.12/src/thread/generic/SDL_systhread.c
deleted file mode 100644
index 6739ad4..0000000
--- a/distrib/sdl-1.2.12/src/thread/generic/SDL_systhread.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Thread management routines for SDL */
-
-#include "SDL_thread.h"
-#include "../SDL_systhread.h"
-
-int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
-{
- SDL_SetError("Threads are not supported on this platform");
- return(-1);
-}
-
-void SDL_SYS_SetupThread(void)
-{
- return;
-}
-
-Uint32 SDL_ThreadID(void)
-{
- return(0);
-}
-
-void SDL_SYS_WaitThread(SDL_Thread *thread)
-{
- return;
-}
-
-void SDL_SYS_KillThread(SDL_Thread *thread)
-{
- return;
-}
-
diff --git a/distrib/sdl-1.2.12/src/thread/generic/SDL_systhread_c.h b/distrib/sdl-1.2.12/src/thread/generic/SDL_systhread_c.h
deleted file mode 100644
index 7e876b0..0000000
--- a/distrib/sdl-1.2.12/src/thread/generic/SDL_systhread_c.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Stub until we implement threads on this platform */
-typedef int SYS_ThreadHandle;
diff --git a/distrib/sdl-1.2.12/src/thread/irix/SDL_syssem.c b/distrib/sdl-1.2.12/src/thread/irix/SDL_syssem.c
deleted file mode 100644
index 8b3311b..0000000
--- a/distrib/sdl-1.2.12/src/thread/irix/SDL_syssem.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_thread.h"
-#include "SDL_timer.h"
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/sem.h>
-#include <errno.h>
-
-#include "SDL_error.h"
-#include "SDL_thread.h"
-
-
-struct SDL_semaphore {
- int id;
-};
-
-/* Not defined by many operating systems, use configure to detect */
-/*
-#if !defined(HAVE_SEMUN)
-union semun {
- int val;
- struct semid_ds *buf;
- ushort *array;
-};
-#endif
-*/
-
-static struct sembuf op_trywait[2] = {
- { 0, -1, (IPC_NOWAIT|SEM_UNDO) } /* Decrement semaphore, no block */
-};
-static struct sembuf op_wait[2] = {
- { 0, -1, SEM_UNDO } /* Decrement semaphore */
-};
-static struct sembuf op_post[1] = {
- { 0, 1, (IPC_NOWAIT|SEM_UNDO) } /* Increment semaphore */
-};
-
-/* Create a blockable semaphore */
-SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
-{
- extern int _creating_thread_lock; /* SDL_threads.c */
- SDL_sem *sem;
- union semun init;
-
- sem = (SDL_sem *)SDL_malloc(sizeof(*sem));
- if ( sem == NULL ) {
- SDL_OutOfMemory();
- return(NULL);
- }
- sem->id = semget(IPC_PRIVATE, 1, (0600|IPC_CREAT));
- if ( sem->id < 0 ) {
- SDL_SetError("Couldn't create semaphore");
- SDL_free(sem);
- return(NULL);
- }
- init.val = initial_value; /* Initialize semaphore */
- semctl(sem->id, 0, SETVAL, init);
- return(sem);
-}
-
-void SDL_DestroySemaphore(SDL_sem *sem)
-{
- if ( sem ) {
-#ifdef __IRIX__
- semctl(sem->id, 0, IPC_RMID);
-#else
- union semun dummy;
- dummy.val = 0;
- semctl(sem->id, 0, IPC_RMID, dummy);
-#endif
- SDL_free(sem);
- }
-}
-
-int SDL_SemTryWait(SDL_sem *sem)
-{
- int retval;
-
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- retval = 0;
- tryagain:
- if ( semop(sem->id, op_trywait, 1) < 0 ) {
- if ( errno == EINTR ) {
- goto tryagain;
- }
- retval = SDL_MUTEX_TIMEDOUT;
- }
- return retval;
-}
-
-int SDL_SemWait(SDL_sem *sem)
-{
- int retval;
-
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- retval = 0;
- tryagain:
- if ( semop(sem->id, op_wait, 1) < 0 ) {
- if ( errno == EINTR ) {
- goto tryagain;
- }
- SDL_SetError("Semaphore operation error");
- retval = -1;
- }
- return retval;
-}
-
-int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
-{
- int retval;
-
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- /* Try the easy cases first */
- if ( timeout == 0 ) {
- return SDL_SemTryWait(sem);
- }
- if ( timeout == SDL_MUTEX_MAXWAIT ) {
- return SDL_SemWait(sem);
- }
-
- /* Ack! We have to busy wait... */
- timeout += SDL_GetTicks();
- do {
- retval = SDL_SemTryWait(sem);
- if ( retval == 0 ) {
- break;
- }
- SDL_Delay(1);
- } while ( SDL_GetTicks() < timeout );
-
- return retval;
-}
-
-Uint32 SDL_SemValue(SDL_sem *sem)
-{
- int semval;
- Uint32 value;
-
- value = 0;
- if ( sem ) {
- tryagain:
-#ifdef __IRIX__
- semval = semctl(sem->id, 0, GETVAL);
-#else
- {
- union semun arg;
- arg.val = 0;
- semval = semctl(sem->id, 0, GETVAL, arg);
- }
-#endif
- if ( semval < 0 ) {
- if ( errno == EINTR ) {
- goto tryagain;
- }
- } else {
- value = (Uint32)semval;
- }
- }
- return value;
-}
-
-int SDL_SemPost(SDL_sem *sem)
-{
- int retval;
-
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- retval = 0;
- tryagain:
- if ( semop(sem->id, op_post, 1) < 0 ) {
- if ( errno == EINTR ) {
- goto tryagain;
- }
- SDL_SetError("Semaphore operation error");
- retval = -1;
- }
- return retval;
-}
diff --git a/distrib/sdl-1.2.12/src/thread/irix/SDL_systhread.c b/distrib/sdl-1.2.12/src/thread/irix/SDL_systhread.c
deleted file mode 100644
index 16a8659..0000000
--- a/distrib/sdl-1.2.12/src/thread/irix/SDL_systhread.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* IRIX thread management routines for SDL */
-
-#include <errno.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/prctl.h>
-
-#include "SDL_thread.h"
-#include "../SDL_systhread.h"
-
-
-static int sig_list[] = {
- SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCLD, SIGWINCH,
- SIGVTALRM, SIGPROF, 0
-};
-
-
-int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
-{
- /* Create the thread and go! */
- if ( sproc(SDL_RunThread, PR_SALL, args) < 0 ) {
- SDL_SetError("Not enough resources to create thread");
- return(-1);
- }
- return(0);
-}
-
-void SDL_SYS_SetupThread(void)
-{
- int i;
- sigset_t mask;
-
- /* Mask asynchronous signals for this thread */
- sigemptyset(&mask);
- for ( i=0; sig_list[i]; ++i ) {
- sigaddset(&mask, sig_list[i]);
- }
- sigprocmask(SIG_BLOCK, &mask, NULL);
-}
-
-/* WARNING: This may not work for systems with 64-bit pid_t */
-Uint32 SDL_ThreadID(void)
-{
- return((Uint32)getpid());
-}
-
-/* WARNING: This may not work for systems with 64-bit pid_t */
-void SDL_WaitThread(SDL_Thread *thread, int *status)
-{
- errno = 0;
- while ( errno != ECHILD ) {
- waitpid(thread->handle, NULL, 0);
- }
-}
-
-/* WARNING: This may not work for systems with 64-bit pid_t */
-void SDL_KillThread(SDL_Thread *thread)
-{
- kill(thread->handle, SIGKILL);
-}
-
diff --git a/distrib/sdl-1.2.12/src/thread/irix/SDL_systhread_c.h b/distrib/sdl-1.2.12/src/thread/irix/SDL_systhread_c.h
deleted file mode 100644
index 76e141a..0000000
--- a/distrib/sdl-1.2.12/src/thread/irix/SDL_systhread_c.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <sys/types.h>
-
-typedef pid_t SYS_ThreadHandle;
-
diff --git a/distrib/sdl-1.2.12/src/thread/os2/SDL_syscond.c b/distrib/sdl-1.2.12/src/thread/os2/SDL_syscond.c
deleted file mode 100644
index 25577e4..0000000
--- a/distrib/sdl-1.2.12/src/thread/os2/SDL_syscond.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* An implementation of condition variables using semaphores and mutexes */
-/*
- This implementation borrows heavily from the BeOS condition variable
- implementation, written by Christopher Tate and Owen Smith. Thanks!
- */
-
-#include "SDL_thread.h"
-
-struct SDL_cond
-{
- SDL_mutex *lock;
- int waiting;
- int signals;
- SDL_sem *wait_sem;
- SDL_sem *wait_done;
-};
-
-/* Create a condition variable */
-DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void)
-{
- SDL_cond *cond;
-
- cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond));
- if ( cond ) {
- cond->lock = SDL_CreateMutex();
- cond->wait_sem = SDL_CreateSemaphore(0);
- cond->wait_done = SDL_CreateSemaphore(0);
- cond->waiting = cond->signals = 0;
- if ( ! cond->lock || ! cond->wait_sem || ! cond->wait_done ) {
- SDL_DestroyCond(cond);
- cond = NULL;
- }
- } else {
- SDL_OutOfMemory();
- }
- return(cond);
-}
-
-/* Destroy a condition variable */
-DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond)
-{
- if ( cond ) {
- if ( cond->wait_sem ) {
- SDL_DestroySemaphore(cond->wait_sem);
- }
- if ( cond->wait_done ) {
- SDL_DestroySemaphore(cond->wait_done);
- }
- if ( cond->lock ) {
- SDL_DestroyMutex(cond->lock);
- }
- SDL_free(cond);
- }
-}
-
-/* Restart one of the threads that are waiting on the condition variable */
-DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond)
-{
- if ( ! cond ) {
- SDL_SetError("Passed a NULL condition variable");
- return -1;
- }
-
- /* If there are waiting threads not already signalled, then
- signal the condition and wait for the thread to respond.
- */
- SDL_LockMutex(cond->lock);
- if ( cond->waiting > cond->signals ) {
- ++cond->signals;
- SDL_SemPost(cond->wait_sem);
- SDL_UnlockMutex(cond->lock);
- SDL_SemWait(cond->wait_done);
- } else {
- SDL_UnlockMutex(cond->lock);
- }
-
- return 0;
-}
-
-/* Restart all threads that are waiting on the condition variable */
-DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond)
-{
- if ( ! cond ) {
- SDL_SetError("Passed a NULL condition variable");
- return -1;
- }
-
- /* If there are waiting threads not already signalled, then
- signal the condition and wait for the thread to respond.
- */
- SDL_LockMutex(cond->lock);
- if ( cond->waiting > cond->signals ) {
- int i, num_waiting;
-
- num_waiting = (cond->waiting - cond->signals);
- cond->signals = cond->waiting;
- for ( i=0; i<num_waiting; ++i ) {
- SDL_SemPost(cond->wait_sem);
- }
- /* Now all released threads are blocked here, waiting for us.
- Collect them all (and win fabulous prizes!) :-)
- */
- SDL_UnlockMutex(cond->lock);
- for ( i=0; i<num_waiting; ++i ) {
- SDL_SemWait(cond->wait_done);
- }
- } else {
- SDL_UnlockMutex(cond->lock);
- }
-
- return 0;
-}
-
-/* Wait on the condition variable for at most 'ms' milliseconds.
- The mutex must be locked before entering this function!
- The mutex is unlocked during the wait, and locked again after the wait.
-
-Typical use:
-
-Thread A:
- SDL_LockMutex(lock);
- while ( ! condition ) {
- SDL_CondWait(cond);
- }
- SDL_UnlockMutex(lock);
-
-Thread B:
- SDL_LockMutex(lock);
- ...
- condition = true;
- ...
- SDL_UnlockMutex(lock);
- */
-DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms)
-{
- int retval;
-
- if ( ! cond ) {
- SDL_SetError("Passed a NULL condition variable");
- return -1;
- }
-
- /* Obtain the protection mutex, and increment the number of waiters.
- This allows the signal mechanism to only perform a signal if there
- are waiting threads.
- */
- SDL_LockMutex(cond->lock);
- ++cond->waiting;
- SDL_UnlockMutex(cond->lock);
-
- /* Unlock the mutex, as is required by condition variable semantics */
- SDL_UnlockMutex(mutex);
-
- /* Wait for a signal */
- if ( ms == SDL_MUTEX_MAXWAIT ) {
- retval = SDL_SemWait(cond->wait_sem);
- } else {
- retval = SDL_SemWaitTimeout(cond->wait_sem, ms);
- }
-
- /* Let the signaler know we have completed the wait, otherwise
- the signaler can race ahead and get the condition semaphore
- if we are stopped between the mutex unlock and semaphore wait,
- giving a deadlock. See the following URL for details:
- http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html
- */
- SDL_LockMutex(cond->lock);
- if ( cond->signals > 0 ) {
- /* If we timed out, we need to eat a condition signal */
- if ( retval > 0 ) {
- SDL_SemWait(cond->wait_sem);
- }
- /* We always notify the signal thread that we are done */
- SDL_SemPost(cond->wait_done);
-
- /* Signal handshake complete */
- --cond->signals;
- }
- --cond->waiting;
- SDL_UnlockMutex(cond->lock);
-
- /* Lock the mutex, as is required by condition variable semantics */
- SDL_LockMutex(mutex);
-
- return retval;
-}
-
-/* Wait on the condition variable forever */
-DECLSPEC int SDLCALL SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex)
-{
- return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT);
-}
diff --git a/distrib/sdl-1.2.12/src/thread/os2/SDL_syscond_c.h b/distrib/sdl-1.2.12/src/thread/os2/SDL_syscond_c.h
deleted file mode 100644
index 27d5509..0000000
--- a/distrib/sdl-1.2.12/src/thread/os2/SDL_syscond_c.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
diff --git a/distrib/sdl-1.2.12/src/thread/os2/SDL_sysmutex.c b/distrib/sdl-1.2.12/src/thread/os2/SDL_sysmutex.c
deleted file mode 100644
index ea75cce..0000000
--- a/distrib/sdl-1.2.12/src/thread/os2/SDL_sysmutex.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Mutex functions using the OS/2 API */
-
-#define INCL_DOSERRORS
-#define INCL_DOSSEMAPHORES
-#include <os2.h>
-
-#include "SDL_mutex.h"
-
-
-struct SDL_mutex {
- HMTX hmtxID;
-};
-
-/* Create a mutex */
-DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void)
-{
- SDL_mutex *mutex;
- APIRET ulrc;
-
- /* Allocate mutex memory */
- mutex = (SDL_mutex *)SDL_malloc(sizeof(*mutex));
- if (mutex)
- {
- /* Create the mutex, with initial value signaled */
- ulrc = DosCreateMutexSem(NULL, // Create unnamed semaphore
- &(mutex->hmtxID), // Pointer to handle
- 0L, // Flags: create it private (not shared)
- FALSE); // Initial value: unowned
- if (ulrc!=NO_ERROR)
- {
- SDL_SetError("Couldn't create mutex");
- SDL_free(mutex);
- mutex = NULL;
- }
- } else {
- SDL_OutOfMemory();
- }
- return(mutex);
-}
-
-/* Free the mutex */
-DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex)
-{
- if ( mutex )
- {
- if ( mutex->hmtxID )
- {
- DosCloseMutexSem(mutex->hmtxID);
- mutex->hmtxID = 0;
- }
- SDL_free(mutex);
- }
-}
-
-/* Lock the mutex */
-DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex)
-{
- if ( mutex == NULL )
- {
- SDL_SetError("Passed a NULL mutex");
- return -1;
- }
- if ( DosRequestMutexSem(mutex->hmtxID, SEM_INDEFINITE_WAIT) != NO_ERROR )
- {
- SDL_SetError("Couldn't wait on mutex");
- return -1;
- }
- return(0);
-}
-
-/* Unlock the mutex */
-DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex)
-{
- if ( mutex == NULL )
- {
- SDL_SetError("Passed a NULL mutex");
- return -1;
- }
- if ( DosReleaseMutexSem(mutex->hmtxID) != NO_ERROR )
- {
- SDL_SetError("Couldn't release mutex");
- return -1;
- }
- return(0);
-}
diff --git a/distrib/sdl-1.2.12/src/thread/os2/SDL_syssem.c b/distrib/sdl-1.2.12/src/thread/os2/SDL_syssem.c
deleted file mode 100644
index d445934..0000000
--- a/distrib/sdl-1.2.12/src/thread/os2/SDL_syssem.c
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Semaphore functions using the OS/2 API */
-
-#define INCL_DOS
-#define INCL_DOSERRORS
-#define INCL_DOSSEMAPHORES
-#include <os2.h>
-
-#include "SDL_thread.h"
-#include "SDL_timer.h"
-
-
-struct SDL_semaphore {
- HMTX id;
- HEV changed;
- Uint32 value;
-};
-
-
-/* Create a semaphore */
-DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value)
-{
- SDL_sem *sem;
- ULONG ulrc;
-
- /* Allocate sem memory */
- sem = (SDL_sem *)SDL_malloc(sizeof(*sem));
- if ( sem ) {
- /* Create the mutex semaphore */
- ulrc = DosCreateMutexSem(NULL,&(sem->id),0,TRUE);
- if ( ulrc ) {
- SDL_SetError("Couldn't create semaphore");
- SDL_free(sem);
- sem = NULL;
- } else
- {
- DosCreateEventSem(NULL, &(sem->changed), 0, FALSE);
- sem->value = initial_value;
- DosReleaseMutexSem(sem->id);
- }
- } else {
- SDL_OutOfMemory();
- }
- return(sem);
-}
-
-/* Free the semaphore */
-DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem)
-{
- if ( sem ) {
- if ( sem->id ) {
- DosCloseEventSem(sem->changed);
- DosCloseMutexSem(sem->id);
- sem->id = 0;
- }
- SDL_free(sem);
- }
-}
-
-DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
-{
- ULONG ulrc;
-
- if ( ! sem ) {
- SDL_SetError("Passed a NULL sem");
- return -1;
- }
-
- if ( timeout == SDL_MUTEX_MAXWAIT ) {
- while (1) {
- ulrc = DosRequestMutexSem(sem->id, SEM_INDEFINITE_WAIT);
- if (ulrc) {
- /* if error waiting mutex */
- SDL_SetError("DosRequestMutexSem() failed");
- return -1;
- } else if (sem->value) {
- sem->value--;
- DosReleaseMutexSem(sem->id);
- return 0;
- } else {
- ULONG ulPostCount;
- DosResetEventSem(sem->changed, &ulPostCount);
- DosReleaseMutexSem(sem->id);
- /* continue waiting until somebody posts the semaphore */
- DosWaitEventSem(sem->changed, SEM_INDEFINITE_WAIT);
- }
- }
- } else
- if ( timeout == 0 )
- {
- ulrc = DosRequestMutexSem(sem->id, SEM_INDEFINITE_WAIT);
- if (ulrc==NO_ERROR)
- {
- if (sem->value)
- {
- sem->value--;
- DosReleaseMutexSem(sem->id);
- return 0;
- } else
- {
- DosReleaseMutexSem(sem->id);
- return SDL_MUTEX_TIMEDOUT;
- }
- } else
- {
- SDL_SetError("DosRequestMutexSem() failed");
- return -1;
- }
- } else {
- ulrc = DosRequestMutexSem(sem->id, SEM_INDEFINITE_WAIT);
- if (ulrc) {
- /* if error waiting mutex */
- SDL_SetError("DosRequestMutexSem() failed");
- return -1;
- } else
- if (sem->value) {
- sem->value--;
- DosReleaseMutexSem(sem->id);
- return 0;
- } else {
- ULONG ulPostCount;
- DosResetEventSem(sem->changed, &ulPostCount);
- DosReleaseMutexSem(sem->id);
- /* continue waiting until somebody posts the semaphore */
- ulrc = DosWaitEventSem(sem->changed, timeout);
- if (ulrc==NO_ERROR)
- return 0;
- else
- return SDL_MUTEX_TIMEDOUT;
- }
- }
- /* never reached */
- return -1;
-}
-
-DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem *sem)
-{
- return SDL_SemWaitTimeout(sem, 0);
-}
-
-DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem)
-{
- return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT);
-}
-
-/* Returns the current count of the semaphore */
-DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem)
-{
- if ( ! sem ) {
- SDL_SetError("Passed a NULL sem");
- return 0;
- }
- return sem->value;
-}
-
-DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem)
-{
- if ( ! sem ) {
- SDL_SetError("Passed a NULL sem");
- return -1;
- }
- if ( DosRequestMutexSem(sem->id,SEM_INDEFINITE_WAIT) ) {
- SDL_SetError("DosRequestMutexSem() failed");
- return -1;
- }
- sem->value++;
- DosPostEventSem(sem->changed);
- DosReleaseMutexSem(sem->id);
- return 0;
-}
diff --git a/distrib/sdl-1.2.12/src/thread/os2/SDL_systhread.c b/distrib/sdl-1.2.12/src/thread/os2/SDL_systhread.c
deleted file mode 100644
index 5a174d9..0000000
--- a/distrib/sdl-1.2.12/src/thread/os2/SDL_systhread.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* OS/2 thread management routines for SDL */
-
-#include <process.h>
-#define INCL_DOSERRORS
-#define INCL_DOSPROCESS
-#include <os2.h>
-
-#include "SDL_thread.h"
-#include "../SDL_systhread.h"
-#include "../SDL_thread_c.h"
-
-typedef struct ThreadStartParms
-{
- void *args;
- pfnSDL_CurrentEndThread pfnCurrentEndThread;
-} tThreadStartParms, *pThreadStartParms;
-
-static void threadfunc(void *pparm)
-{
- pThreadStartParms pThreadParms = pparm;
- pfnSDL_CurrentEndThread pfnCurrentEndThread = NULL;
-
- // Call the thread function!
- SDL_RunThread(pThreadParms->args);
-
- // Get the current endthread we have to use!
- if (pThreadParms)
- {
- pfnCurrentEndThread = pThreadParms->pfnCurrentEndThread;
- SDL_free(pThreadParms);
- }
- // Call endthread!
- if (pfnCurrentEndThread)
- (*pfnCurrentEndThread)();
-}
-
-int SDL_SYS_CreateThread(SDL_Thread *thread, void *args, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread)
-{
- pThreadStartParms pThreadParms = SDL_malloc(sizeof(tThreadStartParms));
- if (!pThreadParms)
- {
- SDL_SetError("Not enough memory to create thread");
- return(-1);
- }
-
- // Save the function which we will have to call to clear the RTL of calling app!
- pThreadParms->pfnCurrentEndThread = pfnEndThread;
- // Also save the real parameters we have to pass to thread function
- pThreadParms->args = args;
- // Start the thread using the runtime library of calling app!
- thread->threadid = thread->handle = (*pfnBeginThread)(threadfunc, NULL, 512*1024, pThreadParms);
- if ((int)thread->threadid <= 0)
- {
- SDL_SetError("Not enough resources to create thread");
- return(-1);
- }
- return(0);
-}
-
-void SDL_SYS_SetupThread(void)
-{
- return;
-}
-
-DECLSPEC Uint32 SDLCALL SDL_ThreadID(void)
-{
- PTIB tib;
- DosGetInfoBlocks(&tib, NULL);
- return((Uint32) (tib->tib_ptib2->tib2_ultid));
-}
-
-void SDL_SYS_WaitThread(SDL_Thread *thread)
-{
- TID tid = thread->handle;
- DosWaitThread(&tid, DCWW_WAIT);
-}
-
-/* WARNING: This function is really a last resort.
- * Threads should be signaled and then exit by themselves.
- * TerminateThread() doesn't perform stack and DLL cleanup.
- */
-void SDL_SYS_KillThread(SDL_Thread *thread)
-{
- DosKillThread(thread->handle);
-}
diff --git a/distrib/sdl-1.2.12/src/thread/os2/SDL_systhread_c.h b/distrib/sdl-1.2.12/src/thread/os2/SDL_systhread_c.h
deleted file mode 100644
index 186419d..0000000
--- a/distrib/sdl-1.2.12/src/thread/os2/SDL_systhread_c.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#define INCL_DOSPROCESS
-#include <os2.h>
-
-typedef TID SYS_ThreadHandle;
-
diff --git a/distrib/sdl-1.2.12/src/thread/pth/SDL_syscond.c b/distrib/sdl-1.2.12/src/thread/pth/SDL_syscond.c
deleted file mode 100644
index 715aff1..0000000
--- a/distrib/sdl-1.2.12/src/thread/pth/SDL_syscond.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * GNU pth conditions variables
- *
- * Patrice Mandin
- */
-
-#include <pth.h>
-
-#include "SDL_thread.h"
-#include "SDL_sysmutex_c.h"
-
-struct SDL_cond
-{
- pth_cond_t condpth_p;
-};
-
-/* Create a condition variable */
-SDL_cond * SDL_CreateCond(void)
-{
- SDL_cond *cond;
-
- cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond));
- if ( cond ) {
- if ( pth_cond_init(&(cond->condpth_p)) < 0 ) {
- SDL_SetError("pthread_cond_init() failed");
- SDL_free(cond);
- cond = NULL;
- }
- } else {
- SDL_OutOfMemory();
- }
- return(cond);
-}
-
-/* Destroy a condition variable */
-void SDL_DestroyCond(SDL_cond *cond)
-{
- if ( cond ) {
- SDL_free(cond);
- }
-}
-
-/* Restart one of the threads that are waiting on the condition variable */
-int SDL_CondSignal(SDL_cond *cond)
-{
- int retval;
-
- if ( ! cond ) {
- SDL_SetError("Passed a NULL condition variable");
- return -1;
- }
-
- retval = 0;
- if ( pth_cond_notify(&(cond->condpth_p), FALSE) != 0 ) {
- SDL_SetError("pth_cond_notify() failed");
- retval = -1;
- }
- return retval;
-}
-
-/* Restart all threads that are waiting on the condition variable */
-int SDL_CondBroadcast(SDL_cond *cond)
-{
- int retval;
-
- if ( ! cond ) {
- SDL_SetError("Passed a NULL condition variable");
- return -1;
- }
-
- retval = 0;
- if ( pth_cond_notify(&(cond->condpth_p), TRUE) != 0 ) {
- SDL_SetError("pth_cond_notify() failed");
- retval = -1;
- }
- return retval;
-}
-
-/* Wait on the condition variable for at most 'ms' milliseconds.
- The mutex must be locked before entering this function!
- The mutex is unlocked during the wait, and locked again after the wait.
-
-Typical use:
-
-Thread A:
- SDL_LockMutex(lock);
- while ( ! condition ) {
- SDL_CondWait(cond);
- }
- SDL_UnlockMutex(lock);
-
-Thread B:
- SDL_LockMutex(lock);
- ...
- condition = true;
- ...
- SDL_UnlockMutex(lock);
- */
-int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms)
-{
- int retval;
- pth_event_t ev;
- int sec;
-
- if ( ! cond ) {
- SDL_SetError("Passed a NULL condition variable");
- return -1;
- }
-
- retval = 0;
-
- sec = ms/1000;
- ev = pth_event(PTH_EVENT_TIME, pth_timeout(sec,(ms-sec*1000)*1000));
-
- if ( pth_cond_await(&(cond->condpth_p), &(mutex->mutexpth_p), ev) != 0 ) {
- SDL_SetError("pth_cond_await() failed");
- retval = -1;
- }
-
- pth_event_free(ev, PTH_FREE_ALL);
-
- return retval;
-}
-
-/* Wait on the condition variable forever */
-int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex)
-{
- int retval;
-
- if ( ! cond ) {
- SDL_SetError("Passed a NULL condition variable");
- return -1;
- }
-
- retval = 0;
- if ( pth_cond_await(&(cond->condpth_p), &(mutex->mutexpth_p), NULL) != 0 ) {
- SDL_SetError("pth_cond_await() failed");
- retval = -1;
- }
- return retval;
-}
diff --git a/distrib/sdl-1.2.12/src/thread/pth/SDL_sysmutex.c b/distrib/sdl-1.2.12/src/thread/pth/SDL_sysmutex.c
deleted file mode 100644
index 9d5b197..0000000
--- a/distrib/sdl-1.2.12/src/thread/pth/SDL_sysmutex.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * GNU pth mutexes
- *
- * Patrice Mandin
- */
-
-#include <pth.h>
-
-#include "SDL_mutex.h"
-#include "SDL_sysmutex_c.h"
-
-/* Create a mutex */
-SDL_mutex *SDL_CreateMutex(void)
-{
- SDL_mutex *mutex;
-
- /* Allocate mutex memory */
- mutex = (SDL_mutex *)SDL_malloc(sizeof(*mutex));
- if ( mutex ) {
- /* Create the mutex, with initial value signaled */
- if (!pth_mutex_init(&(mutex->mutexpth_p))) {
- SDL_SetError("Couldn't create mutex");
- SDL_free(mutex);
- mutex = NULL;
- }
- } else {
- SDL_OutOfMemory();
- }
- return(mutex);
-}
-
-/* Free the mutex */
-void SDL_DestroyMutex(SDL_mutex *mutex)
-{
- if ( mutex ) {
- SDL_free(mutex);
- }
-}
-
-/* Lock the mutex */
-int SDL_mutexP(SDL_mutex *mutex)
-{
- if ( mutex == NULL ) {
- SDL_SetError("Passed a NULL mutex");
- return -1;
- }
-
- pth_mutex_acquire(&(mutex->mutexpth_p), FALSE, NULL);
-
- return(0);
-}
-
-/* Unlock the mutex */
-int SDL_mutexV(SDL_mutex *mutex)
-{
- if ( mutex == NULL ) {
- SDL_SetError("Passed a NULL mutex");
- return -1;
- }
-
- pth_mutex_release(&(mutex->mutexpth_p));
-
- return(0);
-}
diff --git a/distrib/sdl-1.2.12/src/thread/pth/SDL_sysmutex_c.h b/distrib/sdl-1.2.12/src/thread/pth/SDL_sysmutex_c.h
deleted file mode 100644
index e0e9ef5..0000000
--- a/distrib/sdl-1.2.12/src/thread/pth/SDL_sysmutex_c.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_SYSMUTEX_C_H_
-#define _SDL_SYSMUTEX_C_H_
-
-struct SDL_mutex {
- pth_mutex_t mutexpth_p;
-};
-
-#endif /* _SDL_SYSMUTEX_C_H_ */
diff --git a/distrib/sdl-1.2.12/src/thread/pth/SDL_systhread.c b/distrib/sdl-1.2.12/src/thread/pth/SDL_systhread.c
deleted file mode 100644
index 284003a..0000000
--- a/distrib/sdl-1.2.12/src/thread/pth/SDL_systhread.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * GNU pth threads
- *
- * Patrice Mandin
- */
-
-#include <pth.h>
-#include <signal.h>
-
-#include "SDL_thread.h"
-#include "../SDL_thread_c.h"
-#include "../SDL_systhread.h"
-
-/* List of signals to mask in the subthreads */
-static int sig_list[] = {
- SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH,
- SIGVTALRM, SIGPROF, 0
-};
-
-static void *RunThread(void *data)
-{
- SDL_RunThread(data);
- pth_exit((void*)0);
- return((void *)0); /* Prevent compiler warning */
-}
-
-int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
-{
- pth_attr_t type;
-
- /* Create a new attribute */
- type = pth_attr_new();
- if ( type == NULL ) {
- SDL_SetError("Couldn't initialize pth attributes");
- return(-1);
- }
- pth_attr_set(type, PTH_ATTR_JOINABLE, TRUE);
-
- /* Create the thread and go! */
- thread->handle = pth_spawn(type, RunThread, args);
- if ( thread->handle == NULL ) {
- SDL_SetError("Not enough resources to create thread");
- return(-1);
- }
- return(0);
-}
-
-void SDL_SYS_SetupThread(void)
-{
- int i;
- sigset_t mask;
- int oldstate;
-
- /* Mask asynchronous signals for this thread */
- sigemptyset(&mask);
- for ( i=0; sig_list[i]; ++i ) {
- sigaddset(&mask, sig_list[i]);
- }
- pth_sigmask(SIG_BLOCK, &mask, 0);
-
- /* Allow ourselves to be asynchronously cancelled */
- pth_cancel_state(PTH_CANCEL_ASYNCHRONOUS, &oldstate);
-}
-
-/* WARNING: This may not work for systems with 64-bit pid_t */
-Uint32 SDL_ThreadID(void)
-{
- return((Uint32)pth_self());
-}
-
-void SDL_SYS_WaitThread(SDL_Thread *thread)
-{
- pth_join(thread->handle, NULL);
-}
-
-void SDL_SYS_KillThread(SDL_Thread *thread)
-{
- pth_cancel(thread->handle);
- pth_join(thread->handle, NULL);
-}
diff --git a/distrib/sdl-1.2.12/src/thread/pth/SDL_systhread_c.h b/distrib/sdl-1.2.12/src/thread/pth/SDL_systhread_c.h
deleted file mode 100644
index 791eb1b..0000000
--- a/distrib/sdl-1.2.12/src/thread/pth/SDL_systhread_c.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_SYSTHREAD_C_H_
-#define _SDL_SYSTHREAD_C_H_
-
-#include <pth.h>
-
-typedef pth_t SYS_ThreadHandle;
-
-#endif /* _SDL_SYSTHREAD_C_H_ */
diff --git a/distrib/sdl-1.2.12/src/thread/pthread/SDL_syscond.c b/distrib/sdl-1.2.12/src/thread/pthread/SDL_syscond.c
deleted file mode 100644
index 333f83c..0000000
--- a/distrib/sdl-1.2.12/src/thread/pthread/SDL_syscond.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <sys/time.h>
-#include <unistd.h>
-#include <errno.h>
-#include <pthread.h>
-
-#include "SDL_thread.h"
-#include "SDL_sysmutex_c.h"
-
-struct SDL_cond
-{
- pthread_cond_t cond;
-};
-
-/* Create a condition variable */
-SDL_cond * SDL_CreateCond(void)
-{
- SDL_cond *cond;
-
- cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond));
- if ( cond ) {
- if ( pthread_cond_init(&cond->cond, NULL) < 0 ) {
- SDL_SetError("pthread_cond_init() failed");
- SDL_free(cond);
- cond = NULL;
- }
- }
- return(cond);
-}
-
-/* Destroy a condition variable */
-void SDL_DestroyCond(SDL_cond *cond)
-{
- if ( cond ) {
- pthread_cond_destroy(&cond->cond);
- SDL_free(cond);
- }
-}
-
-/* Restart one of the threads that are waiting on the condition variable */
-int SDL_CondSignal(SDL_cond *cond)
-{
- int retval;
-
- if ( ! cond ) {
- SDL_SetError("Passed a NULL condition variable");
- return -1;
- }
-
- retval = 0;
- if ( pthread_cond_signal(&cond->cond) != 0 ) {
- SDL_SetError("pthread_cond_signal() failed");
- retval = -1;
- }
- return retval;
-}
-
-/* Restart all threads that are waiting on the condition variable */
-int SDL_CondBroadcast(SDL_cond *cond)
-{
- int retval;
-
- if ( ! cond ) {
- SDL_SetError("Passed a NULL condition variable");
- return -1;
- }
-
- retval = 0;
- if ( pthread_cond_broadcast(&cond->cond) != 0 ) {
- SDL_SetError("pthread_cond_broadcast() failed");
- retval = -1;
- }
- return retval;
-}
-
-int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms)
-{
- int retval;
- struct timeval delta;
- struct timespec abstime;
-
- if ( ! cond ) {
- SDL_SetError("Passed a NULL condition variable");
- return -1;
- }
-
- gettimeofday(&delta, NULL);
-
- abstime.tv_sec = delta.tv_sec + (ms/1000);
- abstime.tv_nsec = (delta.tv_usec + (ms%1000) * 1000) * 1000;
- if ( abstime.tv_nsec > 1000000000 ) {
- abstime.tv_sec += 1;
- abstime.tv_nsec -= 1000000000;
- }
-
- tryagain:
- retval = pthread_cond_timedwait(&cond->cond, &mutex->id, &abstime);
- switch (retval) {
- case EINTR:
- goto tryagain;
- break;
- case ETIMEDOUT:
- retval = SDL_MUTEX_TIMEDOUT;
- break;
- case 0:
- break;
- default:
- SDL_SetError("pthread_cond_timedwait() failed");
- retval = -1;
- break;
- }
- return retval;
-}
-
-/* Wait on the condition variable, unlocking the provided mutex.
- The mutex must be locked before entering this function!
- */
-int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex)
-{
- int retval;
-
- if ( ! cond ) {
- SDL_SetError("Passed a NULL condition variable");
- return -1;
- }
-
- retval = 0;
- if ( pthread_cond_wait(&cond->cond, &mutex->id) != 0 ) {
- SDL_SetError("pthread_cond_wait() failed");
- retval = -1;
- }
- return retval;
-}
diff --git a/distrib/sdl-1.2.12/src/thread/pthread/SDL_sysmutex.c b/distrib/sdl-1.2.12/src/thread/pthread/SDL_sysmutex.c
deleted file mode 100644
index 42e99b4..0000000
--- a/distrib/sdl-1.2.12/src/thread/pthread/SDL_sysmutex.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <pthread.h>
-
-#include "SDL_thread.h"
-
-#if !SDL_THREAD_PTHREAD_RECURSIVE_MUTEX && \
- !SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
-#define FAKE_RECURSIVE_MUTEX
-#endif
-
-struct SDL_mutex {
- pthread_mutex_t id;
-#if FAKE_RECURSIVE_MUTEX
- int recursive;
- pthread_t owner;
-#endif
-};
-
-SDL_mutex *SDL_CreateMutex (void)
-{
- SDL_mutex *mutex;
- pthread_mutexattr_t attr;
-
- /* Allocate the structure */
- mutex = (SDL_mutex *)SDL_calloc(1, sizeof(*mutex));
- if ( mutex ) {
- pthread_mutexattr_init(&attr);
-#if SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
-#elif SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
- pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
-#else
- /* No extra attributes necessary */
-#endif
- if ( pthread_mutex_init(&mutex->id, &attr) != 0 ) {
- SDL_SetError("pthread_mutex_init() failed");
- SDL_free(mutex);
- mutex = NULL;
- }
- } else {
- SDL_OutOfMemory();
- }
- return(mutex);
-}
-
-void SDL_DestroyMutex(SDL_mutex *mutex)
-{
- if ( mutex ) {
- pthread_mutex_destroy(&mutex->id);
- SDL_free(mutex);
- }
-}
-
-/* Lock the mutex */
-int SDL_mutexP(SDL_mutex *mutex)
-{
- int retval;
-#if FAKE_RECURSIVE_MUTEX
- pthread_t this_thread;
-#endif
-
- if ( mutex == NULL ) {
- SDL_SetError("Passed a NULL mutex");
- return -1;
- }
-
- retval = 0;
-#if FAKE_RECURSIVE_MUTEX
- this_thread = pthread_self();
- if ( mutex->owner == this_thread ) {
- ++mutex->recursive;
- } else {
- /* The order of operations is important.
- We set the locking thread id after we obtain the lock
- so unlocks from other threads will fail.
- */
- if ( pthread_mutex_lock(&mutex->id) == 0 ) {
- mutex->owner = this_thread;
- mutex->recursive = 0;
- } else {
- SDL_SetError("pthread_mutex_lock() failed");
- retval = -1;
- }
- }
-#else
- if ( pthread_mutex_lock(&mutex->id) < 0 ) {
- SDL_SetError("pthread_mutex_lock() failed");
- retval = -1;
- }
-#endif
- return retval;
-}
-
-int SDL_mutexV(SDL_mutex *mutex)
-{
- int retval;
-
- if ( mutex == NULL ) {
- SDL_SetError("Passed a NULL mutex");
- return -1;
- }
-
- retval = 0;
-#if FAKE_RECURSIVE_MUTEX
- /* We can only unlock the mutex if we own it */
- if ( pthread_self() == mutex->owner ) {
- if ( mutex->recursive ) {
- --mutex->recursive;
- } else {
- /* The order of operations is important.
- First reset the owner so another thread doesn't lock
- the mutex and set the ownership before we reset it,
- then release the lock semaphore.
- */
- mutex->owner = 0;
- pthread_mutex_unlock(&mutex->id);
- }
- } else {
- SDL_SetError("mutex not owned by this thread");
- retval = -1;
- }
-
-#else
- if ( pthread_mutex_unlock(&mutex->id) < 0 ) {
- SDL_SetError("pthread_mutex_unlock() failed");
- retval = -1;
- }
-#endif /* FAKE_RECURSIVE_MUTEX */
-
- return retval;
-}
diff --git a/distrib/sdl-1.2.12/src/thread/pthread/SDL_sysmutex_c.h b/distrib/sdl-1.2.12/src/thread/pthread/SDL_sysmutex_c.h
deleted file mode 100644
index 187e7c8..0000000
--- a/distrib/sdl-1.2.12/src/thread/pthread/SDL_sysmutex_c.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_mutex_c_h
-#define _SDL_mutex_c_h
-
-struct SDL_mutex {
- pthread_mutex_t id;
-};
-
-#endif /* _SDL_mutex_c_h */
diff --git a/distrib/sdl-1.2.12/src/thread/pthread/SDL_syssem.c b/distrib/sdl-1.2.12/src/thread/pthread/SDL_syssem.c
deleted file mode 100644
index c43195a..0000000
--- a/distrib/sdl-1.2.12/src/thread/pthread/SDL_syssem.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <pthread.h>
-#include <semaphore.h>
-#include <errno.h>
-
-#include "SDL_thread.h"
-#include "SDL_timer.h"
-
-/* Wrapper around POSIX 1003.1b semaphores */
-
-#ifdef __MACOSX__
-/* Mac OS X doesn't support sem_getvalue() as of version 10.4 */
-#include "../generic/SDL_syssem.c"
-#else
-
-struct SDL_semaphore {
- sem_t sem;
-};
-
-/* Create a semaphore, initialized with value */
-SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
-{
- SDL_sem *sem = (SDL_sem *) SDL_malloc(sizeof(SDL_sem));
- if ( sem ) {
- if ( sem_init(&sem->sem, 0, initial_value) < 0 ) {
- SDL_SetError("sem_init() failed");
- SDL_free(sem);
- sem = NULL;
- }
- } else {
- SDL_OutOfMemory();
- }
- return sem;
-}
-
-void SDL_DestroySemaphore(SDL_sem *sem)
-{
- if ( sem ) {
- sem_destroy(&sem->sem);
- SDL_free(sem);
- }
-}
-
-int SDL_SemTryWait(SDL_sem *sem)
-{
- int retval;
-
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
- retval = SDL_MUTEX_TIMEDOUT;
- if ( sem_trywait(&sem->sem) == 0 ) {
- retval = 0;
- }
- return retval;
-}
-
-int SDL_SemWait(SDL_sem *sem)
-{
- int retval;
-
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- while ( ((retval = sem_wait(&sem->sem)) == -1) && (errno == EINTR) ) {}
- if ( retval < 0 ) {
- SDL_SetError("sem_wait() failed");
- }
- return retval;
-}
-
-int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
-{
- int retval;
-
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- /* Try the easy cases first */
- if ( timeout == 0 ) {
- return SDL_SemTryWait(sem);
- }
- if ( timeout == SDL_MUTEX_MAXWAIT ) {
- return SDL_SemWait(sem);
- }
-
- /* Ack! We have to busy wait... */
- /* FIXME: Use sem_timedwait()? */
- timeout += SDL_GetTicks();
- do {
- retval = SDL_SemTryWait(sem);
- if ( retval == 0 ) {
- break;
- }
- SDL_Delay(1);
- } while ( SDL_GetTicks() < timeout );
-
- return retval;
-}
-
-Uint32 SDL_SemValue(SDL_sem *sem)
-{
- int ret = 0;
- if ( sem ) {
- sem_getvalue(&sem->sem, &ret);
- if ( ret < 0 ) {
- ret = 0;
- }
- }
- return (Uint32)ret;
-}
-
-int SDL_SemPost(SDL_sem *sem)
-{
- int retval;
-
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- retval = sem_post(&sem->sem);
- if ( retval < 0 ) {
- SDL_SetError("sem_post() failed");
- }
- return retval;
-}
-
-#endif /* __MACOSX__ */
diff --git a/distrib/sdl-1.2.12/src/thread/pthread/SDL_systhread.c b/distrib/sdl-1.2.12/src/thread/pthread/SDL_systhread.c
deleted file mode 100644
index e9923fa..0000000
--- a/distrib/sdl-1.2.12/src/thread/pthread/SDL_systhread.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <pthread.h>
-#include <signal.h>
-
-#include "SDL_thread.h"
-#include "../SDL_thread_c.h"
-#include "../SDL_systhread.h"
-
-/* List of signals to mask in the subthreads */
-static int sig_list[] = {
- SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH,
- SIGVTALRM, SIGPROF, 0
-};
-
-#ifdef __RISCOS__
-/* RISC OS needs to know the main thread for
- * it's timer and event processing. */
-int riscos_using_threads = 0;
-Uint32 riscos_main_thread = 0; /* Thread running events */
-#endif
-
-
-static void *RunThread(void *data)
-{
- SDL_RunThread(data);
- pthread_exit((void*)0);
- return((void *)0); /* Prevent compiler warning */
-}
-
-int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
-{
- pthread_attr_t type;
-
- /* Set the thread attributes */
- if ( pthread_attr_init(&type) != 0 ) {
- SDL_SetError("Couldn't initialize pthread attributes");
- return(-1);
- }
- pthread_attr_setdetachstate(&type, PTHREAD_CREATE_JOINABLE);
-
- /* Create the thread and go! */
- if ( pthread_create(&thread->handle, &type, RunThread, args) != 0 ) {
- SDL_SetError("Not enough resources to create thread");
- return(-1);
- }
-
-#ifdef __RISCOS__
- if (riscos_using_threads == 0) {
- riscos_using_threads = 1;
- riscos_main_thread = SDL_ThreadID();
- }
-#endif
-
- return(0);
-}
-
-void SDL_SYS_SetupThread(void)
-{
- int i;
- sigset_t mask;
-
- /* Mask asynchronous signals for this thread */
- sigemptyset(&mask);
- for ( i=0; sig_list[i]; ++i ) {
- sigaddset(&mask, sig_list[i]);
- }
- pthread_sigmask(SIG_BLOCK, &mask, 0);
-
-#ifdef PTHREAD_CANCEL_ASYNCHRONOUS
- /* Allow ourselves to be asynchronously cancelled */
- { int oldstate;
- pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldstate);
- }
-#endif
-}
-
-/* WARNING: This may not work for systems with 64-bit pid_t */
-Uint32 SDL_ThreadID(void)
-{
- return((Uint32)pthread_self());
-}
-
-void SDL_SYS_WaitThread(SDL_Thread *thread)
-{
- pthread_join(thread->handle, 0);
-}
-
-void SDL_SYS_KillThread(SDL_Thread *thread)
-{
-#ifdef PTHREAD_CANCEL_ASYNCHRONOUS
- pthread_cancel(thread->handle);
-#else
-#ifdef __FREEBSD__
-#warning For some reason, this doesnt actually kill a thread - FreeBSD 3.2
-#endif
- pthread_kill(thread->handle, SIGKILL);
-#endif
-}
diff --git a/distrib/sdl-1.2.12/src/thread/pthread/SDL_systhread_c.h b/distrib/sdl-1.2.12/src/thread/pthread/SDL_systhread_c.h
deleted file mode 100644
index 2aab23a..0000000
--- a/distrib/sdl-1.2.12/src/thread/pthread/SDL_systhread_c.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <pthread.h>
-
-typedef pthread_t SYS_ThreadHandle;
diff --git a/distrib/sdl-1.2.12/src/thread/riscos/SDL_syscond.c b/distrib/sdl-1.2.12/src/thread/riscos/SDL_syscond.c
deleted file mode 100644
index c04739a..0000000
--- a/distrib/sdl-1.2.12/src/thread/riscos/SDL_syscond.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* RISC OS implementations uses pthreads based on linux code */
-
-#if SDL_THREADS_DISABLED
-#include "../generic/SDL_syscond.c"
-#else
-#include <sys/time.h>
-#include <unistd.h>
-#include <pthread.h>
-
-#include "SDL_thread.h"
-#include "SDL_sysmutex_c.h"
-
-struct SDL_cond
-{
- pthread_cond_t cond;
-};
-
-/* Create a condition variable */
-SDL_cond * SDL_CreateCond(void)
-{
- SDL_cond *cond;
-
- cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond));
- if ( cond ) {
- if ( pthread_cond_init(&cond->cond, NULL) < 0 ) {
- SDL_SetError("pthread_cond_init() failed");
- SDL_free(cond);
- cond = NULL;
- }
- }
- return(cond);
-}
-
-/* Destroy a condition variable */
-void SDL_DestroyCond(SDL_cond *cond)
-{
- if ( cond ) {
- pthread_cond_destroy(&cond->cond);
- SDL_free(cond);
- }
-}
-
-/* Restart one of the threads that are waiting on the condition variable */
-int SDL_CondSignal(SDL_cond *cond)
-{
- int retval;
-
- if ( ! cond ) {
- SDL_SetError("Passed a NULL condition variable");
- return -1;
- }
-
- retval = 0;
- if ( pthread_cond_signal(&cond->cond) != 0 ) {
- SDL_SetError("pthread_cond_signal() failed");
- retval = -1;
- }
- return retval;
-}
-
-/* Restart all threads that are waiting on the condition variable */
-int SDL_CondBroadcast(SDL_cond *cond)
-{
- int retval;
-
- if ( ! cond ) {
- SDL_SetError("Passed a NULL condition variable");
- return -1;
- }
-
- retval = 0;
- if ( pthread_cond_broadcast(&cond->cond) != 0 ) {
- SDL_SetError("pthread_cond_broadcast() failed");
- retval = -1;
- }
- return retval;
-}
-
-int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms)
-{
- int retval;
- struct timeval delta;
- struct timespec abstime;
-
- if ( ! cond ) {
- SDL_SetError("Passed a NULL condition variable");
- return -1;
- }
-
- gettimeofday(&delta, NULL);
-
- abstime.tv_sec = delta.tv_sec + (ms/1000);
- abstime.tv_nsec = (delta.tv_usec + (ms%1000) * 1000) * 1000;
- if ( abstime.tv_nsec > 1000000000 ) {
- abstime.tv_sec += 1;
- abstime.tv_nsec -= 1000000000;
- }
-
- tryagain:
- retval = pthread_cond_timedwait(&cond->cond, &mutex->id, &abstime);
- switch (retval) {
- case EINTR:
- goto tryagain;
- break;
- case ETIMEDOUT:
- retval = SDL_MUTEX_TIMEDOUT;
- break;
- case 0:
- break;
- default:
- SDL_SetError("pthread_cond_timedwait() failed");
- retval = -1;
- break;
- }
- return retval;
-}
-
-/* Wait on the condition variable, unlocking the provided mutex.
- The mutex must be locked before entering this function!
- */
-int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex)
-{
- int retval;
-
- if ( ! cond ) {
- SDL_SetError("Passed a NULL condition variable");
- return -1;
- }
-
- retval = 0;
- if ( pthread_cond_wait(&cond->cond, &mutex->id) != 0 ) {
- SDL_SetError("pthread_cond_wait() failed");
- retval = -1;
- }
- return retval;
-}
-#endif
diff --git a/distrib/sdl-1.2.12/src/thread/riscos/SDL_sysmutex.c b/distrib/sdl-1.2.12/src/thread/riscos/SDL_sysmutex.c
deleted file mode 100644
index aa4d65e..0000000
--- a/distrib/sdl-1.2.12/src/thread/riscos/SDL_sysmutex.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* RISC OS implementations uses pthreads based on linux code */
-
-#include "SDL_thread.h"
-
-#if SDL_THREADS_DISABLED
-#include "../generic/SDL_sysmutex.c"
-#else
-
-#include <pthread.h>
-
-struct SDL_mutex {
- pthread_mutex_t id;
-#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX
- int recursive;
- pthread_t owner;
-#endif
-};
-
-SDL_mutex *SDL_CreateMutex (void)
-{
- SDL_mutex *mutex;
- pthread_mutexattr_t attr;
-
- /* Allocate the structure */
- mutex = (SDL_mutex *)SDL_calloc(1, sizeof(*mutex));
- if ( mutex ) {
- pthread_mutexattr_init(&attr);
-#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX
- /* No extra attributes necessary */
-#else
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
-#endif /* SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX */
- if ( pthread_mutex_init(&mutex->id, &attr) != 0 ) {
- SDL_SetError("pthread_mutex_init() failed");
- SDL_free(mutex);
- mutex = NULL;
- }
- } else {
- SDL_OutOfMemory();
- }
- return(mutex);
-}
-
-void SDL_DestroyMutex(SDL_mutex *mutex)
-{
- if ( mutex ) {
- pthread_mutex_destroy(&mutex->id);
- SDL_free(mutex);
- }
-}
-
-/* Lock the mutex */
-int SDL_mutexP(SDL_mutex *mutex)
-{
- int retval;
-#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX
- pthread_t this_thread;
-#endif
-
- if ( mutex == NULL ) {
- SDL_SetError("Passed a NULL mutex");
- return -1;
- }
-
- retval = 0;
-#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX
- this_thread = pthread_self();
- if ( mutex->owner == this_thread ) {
- ++mutex->recursive;
- } else {
- /* The order of operations is important.
- We set the locking thread id after we obtain the lock
- so unlocks from other threads will fail.
- */
- if ( pthread_mutex_lock(&mutex->id) == 0 ) {
- mutex->owner = this_thread;
- mutex->recursive = 0;
- } else {
- SDL_SetError("pthread_mutex_lock() failed");
- retval = -1;
- }
- }
-#else
- if ( pthread_mutex_lock(&mutex->id) < 0 ) {
- SDL_SetError("pthread_mutex_lock() failed");
- retval = -1;
- }
-#endif
- return retval;
-}
-
-int SDL_mutexV(SDL_mutex *mutex)
-{
- int retval;
-
- if ( mutex == NULL ) {
- SDL_SetError("Passed a NULL mutex");
- return -1;
- }
-
- retval = 0;
-#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX
- /* We can only unlock the mutex if we own it */
- if ( pthread_self() == mutex->owner ) {
- if ( mutex->recursive ) {
- --mutex->recursive;
- } else {
- /* The order of operations is important.
- First reset the owner so another thread doesn't lock
- the mutex and set the ownership before we reset it,
- then release the lock semaphore.
- */
- mutex->owner = 0;
- pthread_mutex_unlock(&mutex->id);
- }
- } else {
- SDL_SetError("mutex not owned by this thread");
- retval = -1;
- }
-
-#else
- if ( pthread_mutex_unlock(&mutex->id) < 0 ) {
- SDL_SetError("pthread_mutex_unlock() failed");
- retval = -1;
- }
-#endif /* SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX */
-
- return retval;
-}
-#endif
diff --git a/distrib/sdl-1.2.12/src/thread/riscos/SDL_sysmutex_c.h b/distrib/sdl-1.2.12/src/thread/riscos/SDL_sysmutex_c.h
deleted file mode 100644
index fcd03d2..0000000
--- a/distrib/sdl-1.2.12/src/thread/riscos/SDL_sysmutex_c.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_mutex_c_h
-#define _SDL_mutex_c_h
-
-#if !SDL_THREADS_DISABLED
-struct SDL_mutex {
- pthread_mutex_t id;
-};
-#endif
-
-
-#endif /* _SDL_mutex_c_h */
diff --git a/distrib/sdl-1.2.12/src/thread/riscos/SDL_syssem.c b/distrib/sdl-1.2.12/src/thread/riscos/SDL_syssem.c
deleted file mode 100644
index 775eee3..0000000
--- a/distrib/sdl-1.2.12/src/thread/riscos/SDL_syssem.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-#include <errno.h>
-
-#include "SDL_config.h"
-
-/* RISC OS semiphores based on linux code */
-
-
-#include "SDL_timer.h"
-#include "SDL_thread.h"
-#include "SDL_systhread_c.h"
-
-#if !SDL_THREADS_DISABLED
-
-SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
-{
- SDL_SetError("SDL not configured with thread support");
- return (SDL_sem *)0;
-}
-
-void SDL_DestroySemaphore(SDL_sem *sem)
-{
- return;
-}
-
-int SDL_SemTryWait(SDL_sem *sem)
-{
- SDL_SetError("SDL not configured with thread support");
- return -1;
-}
-
-int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
-{
- SDL_SetError("SDL not configured with thread support");
- return -1;
-}
-
-int SDL_SemWait(SDL_sem *sem)
-{
- SDL_SetError("SDL not configured with thread support");
- return -1;
-}
-
-Uint32 SDL_SemValue(SDL_sem *sem)
-{
- return 0;
-}
-
-int SDL_SemPost(SDL_sem *sem)
-{
- SDL_SetError("SDL not configured with thread support");
- return -1;
-}
-
-#else
-
-
-#include <unistd.h> /* For getpid() */
-#include <pthread.h>
-#include <semaphore.h>
-
-struct SDL_semaphore {
- sem_t *sem;
- sem_t sem_data;
-};
-
-/* Create a semaphore, initialized with value */
-SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
-{
- SDL_sem *sem = (SDL_sem *) SDL_malloc(sizeof(SDL_sem));
- if ( sem ) {
- if ( sem_init(&sem->sem_data, 0, initial_value) < 0 ) {
- SDL_SetError("sem_init() failed");
- SDL_free(sem);
- sem = NULL;
- } else {
- sem->sem = &sem->sem_data;
- }
- } else {
- SDL_OutOfMemory();
- }
- return sem;
-}
-
-void SDL_DestroySemaphore(SDL_sem *sem)
-{
- if ( sem ) {
- sem_destroy(sem->sem);
- SDL_free(sem);
- }
-}
-
-int SDL_SemTryWait(SDL_sem *sem)
-{
- int retval;
-
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
- retval = SDL_MUTEX_TIMEDOUT;
- if ( sem_trywait(sem->sem) == 0 ) {
- retval = 0;
- }
- return retval;
-}
-
-int SDL_SemWait(SDL_sem *sem)
-{
- int retval;
-
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- while ( ((retval = sem_wait(sem->sem)) == -1) && (errno == EINTR) ) {}
- if ( retval < 0 ) {
- SDL_SetError("sem_wait() failed");
- }
- return retval;
-}
-
-int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
-{
- int retval;
-
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- /* Try the easy cases first */
- if ( timeout == 0 ) {
- return SDL_SemTryWait(sem);
- }
- if ( timeout == SDL_MUTEX_MAXWAIT ) {
- return SDL_SemWait(sem);
- }
-
- /* Ack! We have to busy wait... */
- timeout += SDL_GetTicks();
- do {
- retval = SDL_SemTryWait(sem);
- if ( retval == 0 ) {
- break;
- }
- SDL_Delay(1);
- } while ( SDL_GetTicks() < timeout );
-
- return retval;
-}
-
-Uint32 SDL_SemValue(SDL_sem *sem)
-{
- int ret = 0;
- if ( sem ) {
- sem_getvalue(sem->sem, &ret);
- if ( ret < 0 ) {
- ret = 0;
- }
- }
- return (Uint32)ret;
-}
-
-int SDL_SemPost(SDL_sem *sem)
-{
- int retval;
-
- if ( ! sem ) {
- SDL_SetError("Passed a NULL semaphore");
- return -1;
- }
-
- retval = sem_post(sem->sem);
- if ( retval < 0 ) {
- SDL_SetError("sem_post() failed");
- }
- return retval;
-}
-
-#endif /* !SDL_THREADS_DISABLED */
diff --git a/distrib/sdl-1.2.12/src/thread/riscos/SDL_systhread.c b/distrib/sdl-1.2.12/src/thread/riscos/SDL_systhread.c
deleted file mode 100644
index 318bb9d..0000000
--- a/distrib/sdl-1.2.12/src/thread/riscos/SDL_systhread.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* RISC OS version based on pthreads linux source */
-
-#include "SDL_thread.h"
-#include "../SDL_systhread.h"
-
-#if SDL_THREADS_DISABLED
-
-int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
-{
- SDL_SetError("Threads have not been compiled into this version of the library");
- return(-1);
-}
-
-void SDL_SYS_SetupThread(void)
-{
- return;
-}
-
-Uint32 SDL_ThreadID(void)
-{
- return(0);
-}
-
-void SDL_SYS_WaitThread(SDL_Thread *thread)
-{
- return;
-}
-
-void SDL_SYS_KillThread(SDL_Thread *thread)
-{
- return;
-}
-
-#else
-
-#include <signal.h>
-
-/* List of signals to mask in the subthreads */
-static int sig_list[] = {
- SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH,
- SIGVTALRM, SIGPROF, 0
-};
-
-#include <pthread.h>
-
-int riscos_using_threads = 0;
-Uint32 riscos_main_thread = 0; /* Thread running events */
-
-static void *RunThread(void *data)
-{
- SDL_RunThread(data);
- pthread_exit((void*)0);
- return((void *)0); /* Prevent compiler warning */
-}
-
-int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
-{
- pthread_attr_t type;
-
- /* Set the thread attributes */
- if ( pthread_attr_init(&type) != 0 ) {
- SDL_SetError("Couldn't initialize pthread attributes");
- return(-1);
- }
- pthread_attr_setdetachstate(&type, PTHREAD_CREATE_JOINABLE);
-
- /* Create the thread and go! */
- if ( pthread_create(&thread->handle, &type, RunThread, args) != 0 ) {
- SDL_SetError("Not enough resources to create thread");
- return(-1);
- }
-
- if (riscos_using_threads == 0)
- {
- riscos_using_threads = 1;
- riscos_main_thread = SDL_ThreadID();
- }
-
- return(0);
-}
-
-void SDL_SYS_SetupThread(void)
-{
- int i;
- sigset_t mask;
-
- /* Mask asynchronous signals for this thread */
- sigemptyset(&mask);
- for ( i=0; sig_list[i]; ++i ) {
- sigaddset(&mask, sig_list[i]);
- }
- pthread_sigmask(SIG_BLOCK, &mask, 0);
-
-#ifdef PTHREAD_CANCEL_ASYNCHRONOUS
- /* Allow ourselves to be asynchronously cancelled */
- { int oldstate;
- pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldstate);
- }
-#endif
-}
-
-Uint32 SDL_ThreadID(void)
-{
- return((Uint32)pthread_self());
-}
-
-void SDL_SYS_WaitThread(SDL_Thread *thread)
-{
- pthread_join(thread->handle, 0);
-}
-
-void SDL_SYS_KillThread(SDL_Thread *thread)
-{
-#ifdef PTHREAD_CANCEL_ASYNCHRONOUS
- pthread_cancel(thread->handle);
-#else
- pthread_kill(thread->handle, SIGKILL);
-#endif
-}
-
-#endif
diff --git a/distrib/sdl-1.2.12/src/thread/riscos/SDL_systhread_c.h b/distrib/sdl-1.2.12/src/thread/riscos/SDL_systhread_c.h
deleted file mode 100644
index 22867a6..0000000
--- a/distrib/sdl-1.2.12/src/thread/riscos/SDL_systhread_c.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#if SDL_THREADS_DISABLED
-
-typedef int SYS_ThreadHandle;
-
-#else
-
-#include <pthread.h>
-
-typedef pthread_t SYS_ThreadHandle;
-
-#endif
diff --git a/distrib/sdl-1.2.12/src/thread/win32/SDL_sysmutex.c b/distrib/sdl-1.2.12/src/thread/win32/SDL_sysmutex.c
deleted file mode 100644
index da83829..0000000
--- a/distrib/sdl-1.2.12/src/thread/win32/SDL_sysmutex.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Mutex functions using the Win32 API */
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-#include "SDL_mutex.h"
-
-
-struct SDL_mutex {
- HANDLE id;
-};
-
-/* Create a mutex */
-SDL_mutex *SDL_CreateMutex(void)
-{
- SDL_mutex *mutex;
-
- /* Allocate mutex memory */
- mutex = (SDL_mutex *)SDL_malloc(sizeof(*mutex));
- if ( mutex ) {
- /* Create the mutex, with initial value signaled */
- mutex->id = CreateMutex(NULL, FALSE, NULL);
- if ( ! mutex->id ) {
- SDL_SetError("Couldn't create mutex");
- SDL_free(mutex);
- mutex = NULL;
- }
- } else {
- SDL_OutOfMemory();
- }
- return(mutex);
-}
-
-/* Free the mutex */
-void SDL_DestroyMutex(SDL_mutex *mutex)
-{
- if ( mutex ) {
- if ( mutex->id ) {
- CloseHandle(mutex->id);
- mutex->id = 0;
- }
- SDL_free(mutex);
- }
-}
-
-/* Lock the mutex */
-int SDL_mutexP(SDL_mutex *mutex)
-{
- if ( mutex == NULL ) {
- SDL_SetError("Passed a NULL mutex");
- return -1;
- }
- if ( WaitForSingleObject(mutex->id, INFINITE) == WAIT_FAILED ) {
- SDL_SetError("Couldn't wait on mutex");
- return -1;
- }
- return(0);
-}
-
-/* Unlock the mutex */
-int SDL_mutexV(SDL_mutex *mutex)
-{
- if ( mutex == NULL ) {
- SDL_SetError("Passed a NULL mutex");
- return -1;
- }
- if ( ReleaseMutex(mutex->id) == FALSE ) {
- SDL_SetError("Couldn't release mutex");
- return -1;
- }
- return(0);
-}
diff --git a/distrib/sdl-1.2.12/src/thread/win32/SDL_syssem.c b/distrib/sdl-1.2.12/src/thread/win32/SDL_syssem.c
deleted file mode 100644
index c7a1bfd..0000000
--- a/distrib/sdl-1.2.12/src/thread/win32/SDL_syssem.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Semaphore functions using the Win32 API */
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-#include "SDL_thread.h"
-#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
-#include "win_ce_semaphore.h"
-#endif
-
-
-struct SDL_semaphore {
-#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
- SYNCHHANDLE id;
-#else
- HANDLE id;
-#endif
- Uint32 volatile count;
-};
-
-
-/* Create a semaphore */
-SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
-{
- SDL_sem *sem;
-
- /* Allocate sem memory */
- sem = (SDL_sem *)SDL_malloc(sizeof(*sem));
- if ( sem ) {
- /* Create the semaphore, with max value 32K */
-#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
- sem->id = CreateSemaphoreCE(NULL, initial_value, 32*1024, NULL);
-#else
- sem->id = CreateSemaphore(NULL, initial_value, 32*1024, NULL);
-#endif
- sem->count = initial_value;
- if ( ! sem->id ) {
- SDL_SetError("Couldn't create semaphore");
- SDL_free(sem);
- sem = NULL;
- }
- } else {
- SDL_OutOfMemory();
- }
- return(sem);
-}
-
-/* Free the semaphore */
-void SDL_DestroySemaphore(SDL_sem *sem)
-{
- if ( sem ) {
- if ( sem->id ) {
-#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
- CloseSynchHandle(sem->id);
-#else
- CloseHandle(sem->id);
-#endif
- sem->id = 0;
- }
- SDL_free(sem);
- }
-}
-
-int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
-{
- int retval;
- DWORD dwMilliseconds;
-
- if ( ! sem ) {
- SDL_SetError("Passed a NULL sem");
- return -1;
- }
-
- if ( timeout == SDL_MUTEX_MAXWAIT ) {
- dwMilliseconds = INFINITE;
- } else {
- dwMilliseconds = (DWORD)timeout;
- }
-#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
- switch (WaitForSemaphoreCE(sem->id, dwMilliseconds)) {
-#else
- switch (WaitForSingleObject(sem->id, dwMilliseconds)) {
-#endif
- case WAIT_OBJECT_0:
- --sem->count;
- retval = 0;
- break;
- case WAIT_TIMEOUT:
- retval = SDL_MUTEX_TIMEDOUT;
- break;
- default:
- SDL_SetError("WaitForSingleObject() failed");
- retval = -1;
- break;
- }
- return retval;
-}
-
-int SDL_SemTryWait(SDL_sem *sem)
-{
- return SDL_SemWaitTimeout(sem, 0);
-}
-
-int SDL_SemWait(SDL_sem *sem)
-{
- return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT);
-}
-
-/* Returns the current count of the semaphore */
-Uint32 SDL_SemValue(SDL_sem *sem)
-{
- if ( ! sem ) {
- SDL_SetError("Passed a NULL sem");
- return 0;
- }
- return sem->count;
-}
-
-int SDL_SemPost(SDL_sem *sem)
-{
- if ( ! sem ) {
- SDL_SetError("Passed a NULL sem");
- return -1;
- }
- /* Increase the counter in the first place, because
- * after a successful release the semaphore may
- * immediately get destroyed by another thread which
- * is waiting for this semaphore.
- */
- ++sem->count;
-#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
- if ( ReleaseSemaphoreCE(sem->id, 1, NULL) == FALSE ) {
-#else
- if ( ReleaseSemaphore(sem->id, 1, NULL) == FALSE ) {
-#endif
- --sem->count; /* restore */
- SDL_SetError("ReleaseSemaphore() failed");
- return -1;
- }
- return 0;
-}
diff --git a/distrib/sdl-1.2.12/src/thread/win32/SDL_systhread.c b/distrib/sdl-1.2.12/src/thread/win32/SDL_systhread.c
deleted file mode 100644
index 67b176d..0000000
--- a/distrib/sdl-1.2.12/src/thread/win32/SDL_systhread.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Win32 thread management routines for SDL */
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-#include "SDL_thread.h"
-#include "../SDL_thread_c.h"
-#include "../SDL_systhread.h"
-
-#ifndef SDL_PASSED_BEGINTHREAD_ENDTHREAD
-#ifndef _WIN32_WCE
-/* We'll use the C library from this DLL */
-#include <process.h>
-#endif
-
-#if __GNUC__
-typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
- unsigned (__stdcall *func)(void *), void *arg,
- unsigned, unsigned *threadID);
-typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
-#elif defined(__WATCOMC__)
-/* This is for Watcom targets except OS2 */
-#if __WATCOMC__ < 1240
-#define __watcall
-#endif
-typedef unsigned long (__watcall *pfnSDL_CurrentBeginThread) (void *, unsigned,
- unsigned (__stdcall *func)(void *), void *arg,
- unsigned, unsigned *threadID);
-typedef void (__watcall *pfnSDL_CurrentEndThread)(unsigned code);
-#else
-typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
- unsigned (__stdcall *func)(void *), void *arg,
- unsigned, unsigned *threadID);
-typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
-#endif
-#endif /* !SDL_PASSED_BEGINTHREAD_ENDTHREAD */
-
-
-typedef struct ThreadStartParms
-{
- void *args;
- pfnSDL_CurrentEndThread pfnCurrentEndThread;
-} tThreadStartParms, *pThreadStartParms;
-
-static unsigned __stdcall RunThread(void *data)
-{
- pThreadStartParms pThreadParms = (pThreadStartParms)data;
- pfnSDL_CurrentEndThread pfnCurrentEndThread = NULL;
-
- // Call the thread function!
- SDL_RunThread(pThreadParms->args);
-
- // Get the current endthread we have to use!
- if (pThreadParms)
- {
- pfnCurrentEndThread = pThreadParms->pfnCurrentEndThread;
- SDL_free(pThreadParms);
- }
- // Call endthread!
- if (pfnCurrentEndThread)
- (*pfnCurrentEndThread)(0);
- return(0);
-}
-
-#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
-int SDL_SYS_CreateThread(SDL_Thread *thread, void *args, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread)
-{
-#else
-int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
-{
-#ifdef _WIN32_WCE
- pfnSDL_CurrentBeginThread pfnBeginThread = NULL;
- pfnSDL_CurrentEndThread pfnEndThread = NULL;
-#else
- pfnSDL_CurrentBeginThread pfnBeginThread = _beginthreadex;
- pfnSDL_CurrentEndThread pfnEndThread = _endthreadex;
-#endif
-#endif /* SDL_PASSED_BEGINTHREAD_ENDTHREAD */
- unsigned threadid;
- pThreadStartParms pThreadParms = (pThreadStartParms)SDL_malloc(sizeof(tThreadStartParms));
- if (!pThreadParms) {
- SDL_OutOfMemory();
- return(-1);
- }
-
- // Save the function which we will have to call to clear the RTL of calling app!
- pThreadParms->pfnCurrentEndThread = pfnEndThread;
- // Also save the real parameters we have to pass to thread function
- pThreadParms->args = args;
-
- if (pfnBeginThread) {
- thread->handle = (SYS_ThreadHandle) pfnBeginThread(NULL, 0, RunThread,
- pThreadParms, 0, &threadid);
- } else {
- thread->handle = CreateThread(NULL, 0, RunThread, pThreadParms, 0, &threadid);
- }
- if (thread->handle == NULL) {
- SDL_SetError("Not enough resources to create thread");
- return(-1);
- }
- return(0);
-}
-
-void SDL_SYS_SetupThread(void)
-{
- return;
-}
-
-Uint32 SDL_ThreadID(void)
-{
- return((Uint32)GetCurrentThreadId());
-}
-
-void SDL_SYS_WaitThread(SDL_Thread *thread)
-{
- WaitForSingleObject(thread->handle, INFINITE);
- CloseHandle(thread->handle);
-}
-
-/* WARNING: This function is really a last resort.
- * Threads should be signaled and then exit by themselves.
- * TerminateThread() doesn't perform stack and DLL cleanup.
- */
-void SDL_SYS_KillThread(SDL_Thread *thread)
-{
- TerminateThread(thread->handle, FALSE);
-}
diff --git a/distrib/sdl-1.2.12/src/thread/win32/SDL_systhread_c.h b/distrib/sdl-1.2.12/src/thread/win32/SDL_systhread_c.h
deleted file mode 100644
index 906a958..0000000
--- a/distrib/sdl-1.2.12/src/thread/win32/SDL_systhread_c.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-typedef HANDLE SYS_ThreadHandle;
-
diff --git a/distrib/sdl-1.2.12/src/timer/SDL_systimer.h b/distrib/sdl-1.2.12/src/timer/SDL_systimer.h
deleted file mode 100644
index e9c7b3b..0000000
--- a/distrib/sdl-1.2.12/src/timer/SDL_systimer.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* The system dependent timer handling functions */
-
-#include "SDL_timer.h"
-#include "SDL_timer_c.h"
-
-
-/* Initialize the system dependent timer subsystem */
-extern int SDL_SYS_TimerInit(void);
-
-/* Quit the system dependent timer subsystem */
-extern void SDL_SYS_TimerQuit(void);
-
-/* Start a timer set up by SDL_SetTimer() */
-extern int SDL_SYS_StartTimer(void);
-
-/* Stop a previously started timer */
-extern void SDL_SYS_StopTimer(void);
diff --git a/distrib/sdl-1.2.12/src/timer/SDL_timer.c b/distrib/sdl-1.2.12/src/timer/SDL_timer.c
deleted file mode 100644
index 2c98431..0000000
--- a/distrib/sdl-1.2.12/src/timer/SDL_timer.c
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_timer.h"
-#include "SDL_timer_c.h"
-#include "SDL_mutex.h"
-#include "SDL_systimer.h"
-
-/* #define DEBUG_TIMERS */
-
-int SDL_timer_started = 0;
-int SDL_timer_running = 0;
-
-/* Data to handle a single periodic alarm */
-Uint32 SDL_alarm_interval = 0;
-SDL_TimerCallback SDL_alarm_callback;
-
-/* Data used for a thread-based timer */
-static int SDL_timer_threaded = 0;
-
-struct _SDL_TimerID {
- Uint32 interval;
- SDL_NewTimerCallback cb;
- void *param;
- Uint32 last_alarm;
- struct _SDL_TimerID *next;
-};
-
-static SDL_TimerID SDL_timers = NULL;
-static SDL_mutex *SDL_timer_mutex;
-static volatile SDL_bool list_changed = SDL_FALSE;
-
-/* Set whether or not the timer should use a thread.
- This should not be called while the timer subsystem is running.
-*/
-int SDL_SetTimerThreaded(int value)
-{
- int retval;
-
- if ( SDL_timer_started ) {
- SDL_SetError("Timer already initialized");
- retval = -1;
- } else {
- retval = 0;
- SDL_timer_threaded = value;
- }
- return retval;
-}
-
-int SDL_TimerInit(void)
-{
- int retval;
-
- retval = 0;
- if ( SDL_timer_started ) {
- SDL_TimerQuit();
- }
- if ( ! SDL_timer_threaded ) {
- retval = SDL_SYS_TimerInit();
- }
- if ( SDL_timer_threaded ) {
- SDL_timer_mutex = SDL_CreateMutex();
- }
- if ( retval == 0 ) {
- SDL_timer_started = 1;
- }
- return(retval);
-}
-
-void SDL_TimerQuit(void)
-{
- SDL_SetTimer(0, NULL);
- if ( SDL_timer_threaded < 2 ) {
- SDL_SYS_TimerQuit();
- }
- if ( SDL_timer_threaded ) {
- SDL_DestroyMutex(SDL_timer_mutex);
- SDL_timer_mutex = NULL;
- }
- SDL_timer_started = 0;
- SDL_timer_threaded = 0;
-}
-
-void SDL_ThreadedTimerCheck(void)
-{
- Uint32 now, ms;
- SDL_TimerID t, prev, next;
- SDL_bool removed;
-
- SDL_mutexP(SDL_timer_mutex);
- list_changed = SDL_FALSE;
- now = SDL_GetTicks();
- for ( prev = NULL, t = SDL_timers; t; t = next ) {
- removed = SDL_FALSE;
- ms = t->interval - SDL_TIMESLICE;
- next = t->next;
- if ( (int)(now - t->last_alarm) > (int)ms ) {
- struct _SDL_TimerID timer;
-
- if ( (now - t->last_alarm) < t->interval ) {
- t->last_alarm += t->interval;
- } else {
- t->last_alarm = now;
- }
-#ifdef DEBUG_TIMERS
- printf("Executing timer %p (thread = %d)\n",
- t, SDL_ThreadID());
-#endif
- timer = *t;
- SDL_mutexV(SDL_timer_mutex);
- ms = timer.cb(timer.interval, timer.param);
- SDL_mutexP(SDL_timer_mutex);
- if ( list_changed ) {
- /* Abort, list of timers modified */
- /* FIXME: what if ms was changed? */
- break;
- }
- if ( ms != t->interval ) {
- if ( ms ) {
- t->interval = ROUND_RESOLUTION(ms);
- } else {
- /* Remove timer from the list */
-#ifdef DEBUG_TIMERS
- printf("SDL: Removing timer %p\n", t);
-#endif
- if ( prev ) {
- prev->next = next;
- } else {
- SDL_timers = next;
- }
- SDL_free(t);
- --SDL_timer_running;
- removed = SDL_TRUE;
- }
- }
- }
- /* Don't update prev if the timer has disappeared */
- if ( ! removed ) {
- prev = t;
- }
- }
- SDL_mutexV(SDL_timer_mutex);
-}
-
-static SDL_TimerID SDL_AddTimerInternal(Uint32 interval, SDL_NewTimerCallback callback, void *param)
-{
- SDL_TimerID t;
- t = (SDL_TimerID) SDL_malloc(sizeof(struct _SDL_TimerID));
- if ( t ) {
- t->interval = ROUND_RESOLUTION(interval);
- t->cb = callback;
- t->param = param;
- t->last_alarm = SDL_GetTicks();
- t->next = SDL_timers;
- SDL_timers = t;
- ++SDL_timer_running;
- list_changed = SDL_TRUE;
- }
-#ifdef DEBUG_TIMERS
- printf("SDL_AddTimer(%d) = %08x num_timers = %d\n", interval, (Uint32)t, SDL_timer_running);
-#endif
- return t;
-}
-
-SDL_TimerID SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param)
-{
- SDL_TimerID t;
- if ( ! SDL_timer_mutex ) {
- if ( SDL_timer_started ) {
- SDL_SetError("This platform doesn't support multiple timers");
- } else {
- SDL_SetError("You must call SDL_Init(SDL_INIT_TIMER) first");
- }
- return NULL;
- }
- if ( ! SDL_timer_threaded ) {
- SDL_SetError("Multiple timers require threaded events!");
- return NULL;
- }
- SDL_mutexP(SDL_timer_mutex);
- t = SDL_AddTimerInternal(interval, callback, param);
- SDL_mutexV(SDL_timer_mutex);
- return t;
-}
-
-SDL_bool SDL_RemoveTimer(SDL_TimerID id)
-{
- SDL_TimerID t, prev = NULL;
- SDL_bool removed;
-
- removed = SDL_FALSE;
- SDL_mutexP(SDL_timer_mutex);
- /* Look for id in the linked list of timers */
- for (t = SDL_timers; t; prev=t, t = t->next ) {
- if ( t == id ) {
- if(prev) {
- prev->next = t->next;
- } else {
- SDL_timers = t->next;
- }
- SDL_free(t);
- --SDL_timer_running;
- removed = SDL_TRUE;
- list_changed = SDL_TRUE;
- break;
- }
- }
-#ifdef DEBUG_TIMERS
- printf("SDL_RemoveTimer(%08x) = %d num_timers = %d thread = %d\n", (Uint32)id, removed, SDL_timer_running, SDL_ThreadID());
-#endif
- SDL_mutexV(SDL_timer_mutex);
- return removed;
-}
-
-/* Old style callback functions are wrapped through this */
-static Uint32 SDLCALL callback_wrapper(Uint32 ms, void *param)
-{
- SDL_TimerCallback func = (SDL_TimerCallback) param;
- return (*func)(ms);
-}
-
-int SDL_SetTimer(Uint32 ms, SDL_TimerCallback callback)
-{
- int retval;
-
-#ifdef DEBUG_TIMERS
- printf("SDL_SetTimer(%d)\n", ms);
-#endif
- retval = 0;
-
- if ( SDL_timer_threaded ) {
- SDL_mutexP(SDL_timer_mutex);
- }
- if ( SDL_timer_running ) { /* Stop any currently running timer */
- if ( SDL_timer_threaded ) {
- while ( SDL_timers ) {
- SDL_TimerID freeme = SDL_timers;
- SDL_timers = SDL_timers->next;
- SDL_free(freeme);
- }
- SDL_timer_running = 0;
- list_changed = SDL_TRUE;
- } else {
- SDL_SYS_StopTimer();
- SDL_timer_running = 0;
- }
- }
- if ( ms ) {
- if ( SDL_timer_threaded ) {
- if ( SDL_AddTimerInternal(ms, callback_wrapper, (void *)callback) == NULL ) {
- retval = -1;
- }
- } else {
- SDL_timer_running = 1;
- SDL_alarm_interval = ms;
- SDL_alarm_callback = callback;
- retval = SDL_SYS_StartTimer();
- }
- }
- if ( SDL_timer_threaded ) {
- SDL_mutexV(SDL_timer_mutex);
- }
-
- return retval;
-}
diff --git a/distrib/sdl-1.2.12/src/timer/SDL_timer_c.h b/distrib/sdl-1.2.12/src/timer/SDL_timer_c.h
deleted file mode 100644
index a69cd12..0000000
--- a/distrib/sdl-1.2.12/src/timer/SDL_timer_c.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Useful functions and variables from SDL_timer.c */
-#include "SDL_timer.h"
-
-#define ROUND_RESOLUTION(X) \
- (((X+TIMER_RESOLUTION-1)/TIMER_RESOLUTION)*TIMER_RESOLUTION)
-
-extern int SDL_timer_started;
-extern int SDL_timer_running;
-
-/* Data to handle a single periodic alarm */
-extern Uint32 SDL_alarm_interval;
-extern SDL_TimerCallback SDL_alarm_callback;
-
-/* Set whether or not the timer should use a thread.
- This should be called while the timer subsystem is running.
-*/
-extern int SDL_SetTimerThreaded(int value);
-
-extern int SDL_TimerInit(void);
-extern void SDL_TimerQuit(void);
-
-/* This function is called from the SDL event thread if it is available */
-extern void SDL_ThreadedTimerCheck(void);
diff --git a/distrib/sdl-1.2.12/src/timer/amigaos/SDL_systimer.c b/distrib/sdl-1.2.12/src/timer/amigaos/SDL_systimer.c
deleted file mode 100644
index a213b61..0000000
--- a/distrib/sdl-1.2.12/src/timer/amigaos/SDL_systimer.c
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_TIMER_AMIGA
-
-#include <stdio.h>
-#include <time.h>
-#include <signal.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <exec/types.h>
-#ifdef __SASC
-#include <proto/dos.h>
-#include <clib/graphics_protos.h>
-#include <pragmas/graphics.h>
-#include <clib/exec_protos.h>
-#include <pragmas/exec.h>
-#elif defined(STORMC4_WOS)
-#include <proto/dos.h>
-#include <proto/exec.h>
-#include <proto/graphics.h>
-#else
-#include <inline/dos.h>
-#include <inline/exec.h>
-#include <inline/graphics.h>
-#endif
-#include "mydebug.h"
-
-extern struct DosLibrary *DOSBase;
-extern struct ExecBase *SysBase;
-static struct GfxBase *GfxBase;
-
-#include "SDL_timer.h"
-#include "../SDL_timer_c.h"
-
-/* The first ticks value of the application */
-
-#if !defined(__PPC__) || defined(STORMC4_WOS) || defined(MORPHOS)
-static clock_t start;
-
-void SDL_StartTicks(void)
-{
- /* Set first ticks value */
- start=clock();
-}
-
-Uint32 SDL_GetTicks (void)
-{
- clock_t ticks;
-
- ticks=clock()-start;
-
-#ifdef __SASC
-// CLOCKS_PER_SEC == 1000 !
-
- return(ticks);
-#else
-// CLOCKS_PER_SEC != 1000 !
-
- return ticks*(1000/CLOCKS_PER_SEC);
-#endif
-}
-
-void SDL_Delay (Uint32 ms)
-{
-// Do a busy wait if time is less than 50ms
-
- if(ms<50)
- {
- clock_t to_wait=clock();
-
-#ifndef __SASC
- ms*=(CLOCKS_PER_SEC/1000);
-#endif
- to_wait+=ms;
-
- while(clock()<to_wait);
- }
- else
- {
- Delay(ms/20);
- }
-}
-
-#else
-
-ULONG MY_CLOCKS_PER_SEC;
-
-void PPC_TimerInit(void);
-APTR MyTimer;
-
-ULONG start[2];
-
-void SDL_StartTicks(void)
-{
- /* Set first ticks value */
- if(!MyTimer)
- PPC_TimerInit();
-
- PPCGetTimerObject(MyTimer,PPCTIMERTAG_CURRENTTICKS,start);
- start[1]>>=10;
- start[1]|=((result[0]&0x3ff)<<22);
- start[0]>>=10;
-}
-
-Uint32 SDL_GetTicks (void)
-{
- ULONG result[2];
- PPCGetTimerObject(MyTimer,PPCTIMERTAG_CURRENTTICKS,result);
-
-// PPCAsr64p(result,10);
-// Non va, la emulo:
-
- result[1]>>=10;
- result[1]|=((result[0]&0x3ff)<<22);
-
-// Non mi interessa piu' result[0]
-
- return result[1]*1000/MY_CLOCKS_PER_SEC;
-}
-
-void SDL_Delay (Uint32 ms)
-{
-// Do a busy wait if time is less than 50ms
-
- if(ms<50)
- {
- ULONG to_wait[2],actual[2];
- PPCGetTimerObject(MyTimer,PPCTIMERTAG_CURRENTTICKS,result);
- actual[1]=0;
- to_wait[1]+=ms*1000/MY_CLOCKS_PER_SEC;
-
- while(actual[1]<to_wait[1])
- {
- PPCGetTimerObject(MyTimer,PPCTIMERTAG_CURRENTTICKS,actual);
- }
- }
- else
- {
- Delay(ms/50);
- }
-}
-
-void PPC_TimerInit(void)
-{
- struct TagItem tags[]=
- {
- PPCTIMERTAG_CPU,TRUE,
- TAG_DONE,0
- };
-
-
- if(MyTimer=PPCCreateTimerObject(tags))
- {
- ULONG result[2];
-
- PPCGetTimerObject(MyTimer,PPCTIMERTAG_TICKSPERSEC,result);
- D(bug("Timer inizializzato, TPS: %lu - %lu\n",result[0],result[1]));
-// PPCAsr64p(result,10);
- result[1]>>=10;
- result[1]|=((result[0]&0x3ff)<<22);
- result[0]>>=10;
-
- D(bug("Shiftato TPS: %lu - %lu\n",result[0],result[1]));
- MY_CLOCKS_PER_SEC=result[1];
-
- PPCGetTimerObject(MyTimer,PPCTIMERTAG_CURRENTTICKS,result);
-
- D(bug("Current ticks: %lu - %lu\n",result[0],result[1]));
- result[1]>>=10;
- result[1]|=((result[0]&0x3ff)<<22);
- result[0]>>=10;
-// PPCAsr64p(result,10);
- D(bug("Shiftato: %lu - %lu\n",result[0],result[1]));
- }
- else
- {
- D(bug("Errore nell'inizializzazione del timer!\n"));
- }
-}
-
-#endif
-
-#include "SDL_thread.h"
-
-/* Data to handle a single periodic alarm */
-static int timer_alive = 0;
-static SDL_Thread *timer_thread = NULL;
-
-static int RunTimer(void *unused)
-{
- D(bug("SYSTimer: Entering RunTimer loop..."));
-
- if(GfxBase==NULL)
- GfxBase=(struct GfxBase *)OpenLibrary("graphics.library",37);
-
- while ( timer_alive ) {
- if ( SDL_timer_running ) {
- SDL_ThreadedTimerCheck();
- }
- if(GfxBase)
- WaitTOF(); // Check the timer every fifth of seconds. Was SDL_Delay(1)->BusyWait!
- else
- Delay(1);
- }
- D(bug("SYSTimer: EXITING RunTimer loop..."));
- return(0);
-}
-
-/* This is only called if the event thread is not running */
-int SDL_SYS_TimerInit(void)
-{
- D(bug("Creating thread for the timer (NOITIMER)...\n"));
-
- timer_alive = 1;
- timer_thread = SDL_CreateThread(RunTimer, NULL);
- if ( timer_thread == NULL )
- {
- D(bug("Creazione del thread fallita...\n"));
-
- return(-1);
- }
- return(SDL_SetTimerThreaded(1));
-}
-
-void SDL_SYS_TimerQuit(void)
-{
- timer_alive = 0;
- if ( timer_thread ) {
- SDL_WaitThread(timer_thread, NULL);
- timer_thread = NULL;
- }
-}
-
-int SDL_SYS_StartTimer(void)
-{
- SDL_SetError("Internal logic error: AmigaOS uses threaded timer");
- return(-1);
-}
-
-void SDL_SYS_StopTimer(void)
-{
- return;
-}
-
-#endif /* SDL_TIMER_AMIGA */
diff --git a/distrib/sdl-1.2.12/src/timer/beos/SDL_systimer.c b/distrib/sdl-1.2.12/src/timer/beos/SDL_systimer.c
deleted file mode 100644
index 74ff7f6..0000000
--- a/distrib/sdl-1.2.12/src/timer/beos/SDL_systimer.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_TIMER_BEOS
-
-#include <be/kernel/OS.h>
-
-#include "SDL_thread.h"
-#include "SDL_timer.h"
-#include "../SDL_timer_c.h"
-
-static bigtime_t start;
-
-void SDL_StartTicks(void)
-{
- /* Set first ticks value */
- start = system_time();
-}
-
-Uint32 SDL_GetTicks(void)
-{
- return((system_time()-start)/1000);
-}
-
-void SDL_Delay(Uint32 ms)
-{
- snooze(ms*1000);
-}
-
-/* Data to handle a single periodic alarm */
-static int timer_alive = 0;
-static SDL_Thread *timer = NULL;
-
-static int RunTimer(void *unused)
-{
- while ( timer_alive ) {
- if ( SDL_timer_running ) {
- SDL_ThreadedTimerCheck();
- }
- SDL_Delay(10);
- }
- return(0);
-}
-
-/* This is only called if the event thread is not running */
-int SDL_SYS_TimerInit(void)
-{
- timer_alive = 1;
- timer = SDL_CreateThread(RunTimer, NULL);
- if ( timer == NULL )
- return(-1);
- return(SDL_SetTimerThreaded(1));
-}
-
-void SDL_SYS_TimerQuit(void)
-{
- timer_alive = 0;
- if ( timer ) {
- SDL_WaitThread(timer, NULL);
- timer = NULL;
- }
-}
-
-int SDL_SYS_StartTimer(void)
-{
- SDL_SetError("Internal logic error: BeOS uses threaded timer");
- return(-1);
-}
-
-void SDL_SYS_StopTimer(void)
-{
- return;
-}
-
-#endif /* SDL_TIMER_BEOS */
diff --git a/distrib/sdl-1.2.12/src/timer/dc/SDL_systimer.c b/distrib/sdl-1.2.12/src/timer/dc/SDL_systimer.c
deleted file mode 100644
index d04a654..0000000
--- a/distrib/sdl-1.2.12/src/timer/dc/SDL_systimer.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_TIMER_DC
-
-#include <kos.h>
-
-#include "SDL_thread.h"
-#include "SDL_timer.h"
-#include "../SDL_timer_c.h"
-
-static unsigned start;
-
-/*
- jif = ms * HZ /1000
- ms = jif * 1000/HZ
-*/
-
-void SDL_StartTicks(void)
-{
- /* Set first ticks value */
- start = jiffies;
-}
-
-Uint32 SDL_GetTicks(void)
-{
- return((jiffies-start)*1000/HZ);
-}
-
-void SDL_Delay(Uint32 ms)
-{
- thd_sleep(ms);
-}
-
-/* Data to handle a single periodic alarm */
-static int timer_alive = 0;
-static SDL_Thread *timer = NULL;
-
-static int RunTimer(void *unused)
-{
- while ( timer_alive ) {
- if ( SDL_timer_running ) {
- SDL_ThreadedTimerCheck();
- }
- SDL_Delay(10);
- }
- return(0);
-}
-
-/* This is only called if the event thread is not running */
-int SDL_SYS_TimerInit(void)
-{
- timer_alive = 1;
- timer = SDL_CreateThread(RunTimer, NULL);
- if ( timer == NULL )
- return(-1);
- return(SDL_SetTimerThreaded(1));
-}
-
-void SDL_SYS_TimerQuit(void)
-{
- timer_alive = 0;
- if ( timer ) {
- SDL_WaitThread(timer, NULL);
- timer = NULL;
- }
-}
-
-int SDL_SYS_StartTimer(void)
-{
- SDL_SetError("Internal logic error: DC uses threaded timer");
- return(-1);
-}
-
-void SDL_SYS_StopTimer(void)
-{
- return;
-}
-
-#endif /* SDL_TIMER_DC */
diff --git a/distrib/sdl-1.2.12/src/timer/dummy/SDL_systimer.c b/distrib/sdl-1.2.12/src/timer/dummy/SDL_systimer.c
deleted file mode 100644
index f4dae03..0000000
--- a/distrib/sdl-1.2.12/src/timer/dummy/SDL_systimer.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#if defined(SDL_TIMER_DUMMY) || defined(SDL_TIMERS_DISABLED)
-
-#include "SDL_timer.h"
-#include "../SDL_timer_c.h"
-
-void SDL_StartTicks(void)
-{
-}
-
-Uint32 SDL_GetTicks (void)
-{
- SDL_Unsupported();
- return 0;
-}
-
-void SDL_Delay (Uint32 ms)
-{
- SDL_Unsupported();
-}
-
-#include "SDL_thread.h"
-
-/* Data to handle a single periodic alarm */
-static int timer_alive = 0;
-static SDL_Thread *timer = NULL;
-
-static int RunTimer(void *unused)
-{
- while ( timer_alive ) {
- if ( SDL_timer_running ) {
- SDL_ThreadedTimerCheck();
- }
- SDL_Delay(1);
- }
- return(0);
-}
-
-/* This is only called if the event thread is not running */
-int SDL_SYS_TimerInit(void)
-{
- timer_alive = 1;
- timer = SDL_CreateThread(RunTimer, NULL);
- if ( timer == NULL )
- return(-1);
- return(SDL_SetTimerThreaded(1));
-}
-
-void SDL_SYS_TimerQuit(void)
-{
- timer_alive = 0;
- if ( timer ) {
- SDL_WaitThread(timer, NULL);
- timer = NULL;
- }
-}
-
-int SDL_SYS_StartTimer(void)
-{
- SDL_SetError("Internal logic error: threaded timer in use");
- return(-1);
-}
-
-void SDL_SYS_StopTimer(void)
-{
- return;
-}
-
-#endif /* SDL_TIMER_DUMMY || SDL_TIMERS_DISABLED */
diff --git a/distrib/sdl-1.2.12/src/timer/epoc/SDL_systimer.cpp b/distrib/sdl-1.2.12/src/timer/epoc/SDL_systimer.cpp
deleted file mode 100644
index 413135c..0000000
--- a/distrib/sdl-1.2.12/src/timer/epoc/SDL_systimer.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_TIMER_EPOC
-
-/*
- SDL_systimer.cpp
-
- Epoc version by Hannu Viitala (hannu.j.viitala@mbnet.fi)
-*/
-
-#include <e32std.h>
-#include <e32hal.h>
-
-extern "C" {
-#include "SDL_error.h"
-#include "SDL_thread.h"
-#include "SDL_timer.h"
-#include "../SDL_timer_c.h"
-
-static TUint start = 0;
-static TInt tickPeriodMilliSeconds;
-
-
-void SDL_StartTicks(void)
-{
- /* Set first ticks value */
- start = User::TickCount();
-
- TTimeIntervalMicroSeconds32 period;
- TInt tmp = UserHal::TickPeriod(period);
- tickPeriodMilliSeconds = period.Int() / 1000;
-}
-
-Uint32 SDL_GetTicks(void)
-{
- TUint deltaTics = User::TickCount() - start;
- return(deltaTics * tickPeriodMilliSeconds);
-}
-
-void SDL_Delay(Uint32 ms)
-{
-
- User::After(TTimeIntervalMicroSeconds32(ms*1000));
-}
-
-/* Data to handle a single periodic alarm */
-static int timer_alive = 0;
-static SDL_Thread *timer = NULL;
-
-static int RunTimer(void *unused)
-{
- Uint32 ms;
-
- while ( timer_alive ) {
- if ( SDL_timer_running ) {
- SDL_ThreadedTimerCheck();
- }
- SDL_Delay(10);
- }
- return(0);
-}
-
-/* This is only called if the event thread is not running */
-int SDL_SYS_TimerInit(void)
-{
- timer_alive = 1;
- timer = SDL_CreateThread(RunTimer, NULL);
- if ( timer == NULL )
- return(-1);
- return(SDL_SetTimerThreaded(1));
-}
-
-void SDL_SYS_TimerQuit(void)
-{
- timer_alive = 0;
- if ( timer ) {
- SDL_WaitThread(timer, NULL);
- timer = NULL;
- }
-}
-
-int SDL_SYS_StartTimer(void)
-{
- SDL_SetError("Internal logic error: Epoc uses threaded timer");
- return(-1);
-}
-
-void SDL_SYS_StopTimer(void)
-{
- return;
-}
-
-}; // extern "C"
-
-#endif /* SDL_TIMER_EPOC */
diff --git a/distrib/sdl-1.2.12/src/timer/macos/FastTimes.c b/distrib/sdl-1.2.12/src/timer/macos/FastTimes.c
deleted file mode 100644
index 8eb4260..0000000
--- a/distrib/sdl-1.2.12/src/timer/macos/FastTimes.c
+++ /dev/null
@@ -1,352 +0,0 @@
-/* File "FastTimes.c" - Original code by Matt Slot <fprefect@ambrosiasw.com> */
-/* Created 4/24/99 - This file is hereby placed in the public domain */
-/* Updated 5/21/99 - Calibrate to VIA, add TBR support, renamed functions */
-/* Updated 10/4/99 - Use AbsoluteToNanoseconds() in case Absolute = double */
-/* Updated 2/15/00 - Check for native Time Manager, no need to calibrate */
-/* Updated 2/19/00 - Fixed default value for gScale under native Time Mgr */
-/* Updated 3/21/00 - Fixed ns conversion, create 2 different scale factors */
-/* Updated 5/03/00 - Added copyright and placed into PD. No code changes */
-/* Updated 8/01/00 - Made "Carbon-compatible" by replacing LMGetTicks() */
-
-/* This file is Copyright (C) Matt Slot, 1999-2000. It is hereby placed into
- the public domain. The author makes no warranty as to fitness or stability */
-
-#include <Gestalt.h>
-#include <LowMem.h>
-#include <CodeFragments.h>
-#include <DriverServices.h>
-#include <Timer.h>
-
-#include "FastTimes.h"
-
-#ifdef TARGET_CPU_PPC
-#undef GENERATINGPOWERPC /* stop whining */
-#define GENERATINGPOWERPC TARGET_CPU_PPC
-#endif
-
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-/*
- On 680x0 machines, we just use Microseconds().
-
- On PowerPC machines, we try several methods:
- * DriverServicesLib is available on all PCI PowerMacs, and perhaps
- some NuBus PowerMacs. If it is, we use UpTime() : Overhead = 2.1 µsec.
- * The PowerPC 601 has a built-in "real time clock" RTC, and we fall
- back to that, accessing it directly from asm. Overhead = 1.3 µsec.
- * Later PowerPCs have an accurate "time base register" TBR, and we
- fall back to that, access it from PowerPC asm. Overhead = 1.3 µsec.
- * We can also try Microseconds() which is emulated : Overhead = 36 µsec.
-
- On PowerPC machines, we avoid the following:
- * OpenTransport is available on all PCI and some NuBus PowerMacs, but it
- uses UpTime() if available and falls back to Microseconds() otherwise.
- * InputSprocket is available on many PowerMacs, but again it uses
- UpTime() if available and falls back to Microseconds() otherwise.
-
- Another PowerPC note: certain configurations, especially 3rd party upgrade
- cards, may return inaccurate timings for the CPU or memory bus -- causing
- skew in various system routines (up to 20% drift!). The VIA chip is very
- accurate, and it's the basis for the Time Manager and Microseconds().
- Unfortunately, it's also very slow because the MacOS has to (a) switch to
- 68K and (b) poll for a VIA event.
-
- We compensate for the drift by calibrating a floating point scale factor
- between our fast method and the accurate timer at startup, then convert
- each sample quickly on the fly. I'd rather not have the initialization
- overhead -- but it's simply necessary for accurate timing. You can drop
- it down to 30 ticks if you prefer, but that's as low as I'd recommend.
-
- Under MacOS 9, "new world" Macs (iMacs, B+W G3s and G+W G4s) have a native
- Time Manager implementation: UpTime(), Microseconds(), and TickCount() are
- all based on the same underlying counter. This makes it silly to calibrate
- UpTime() against TickCount(). We now check for this feature using Gestalt(),
- and skip the whole calibration step if possible.
-
-*/
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-
-#define RTCToNano(w) ((double) (w).hi * 1000000000.0 + (double) (w).lo)
-#define WideTo64bit(w) (*(UInt64 *) &(w))
-
-/* LMGetTicks() is not in Carbon and TickCount() has a fair bit of overhead,
- so for speed we always read lowmem directly. This is a Mac OS X no-no, but
- it always work on those systems that don't have a native Time Manager (ie,
- anything before MacOS 9) -- regardless whether we are in Carbon or not! */
-#define MyLMGetTicks() (*(volatile UInt32 *) 0x16A)
-
-#if GENERATINGPOWERPC
-
-static asm UnsignedWide PollRTC(void);
-static asm UnsignedWide PollTBR(void);
-static Ptr FindFunctionInSharedLib(StringPtr libName, StringPtr funcName);
-
-static Boolean gInited = false;
-static Boolean gNative = false;
-static Boolean gUseRTC = false;
-static Boolean gUseTBR = false;
-static double gScaleUSec = 1.0 / 1000.0; /* 1 / ( nsec / usec) */
-static double gScaleMSec = 1.0 / 1000000.0; /* 1 / ( nsec / msec) */
-
-/* Functions loaded from DriverServicesLib */
-typedef AbsoluteTime (*UpTimeProcPtr)(void);
-typedef Nanoseconds (*A2NSProcPtr)(AbsoluteTime);
-static UpTimeProcPtr gUpTime = NULL;
-static A2NSProcPtr gA2NS = NULL;
-
-#endif /* GENERATINGPOWERPC */
-
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-
-void FastInitialize() {
- SInt32 result;
-
- if (!gInited) {
-
-#if GENERATINGPOWERPC
-
- /* Initialize the feature flags */
- gNative = gUseRTC = gUseTBR = false;
-
- /* We use CFM to find and load needed symbols from shared libraries, so
- the application doesn't have to weak-link them, for convenience. */
- gUpTime = (UpTimeProcPtr) FindFunctionInSharedLib(
- "\pDriverServicesLib", "\pUpTime");
- if (gUpTime) gA2NS = (A2NSProcPtr) FindFunctionInSharedLib(
- "\pDriverServicesLib", "\pAbsoluteToNanoseconds");
- if (!gA2NS) gUpTime = nil; /* Pedantic but necessary */
-
- if (gUpTime) {
- /* If we loaded UpTime(), then we need to know if the system has
- a native implementation of the Time Manager. If so, then it's
- pointless to calculate a scale factor against the missing VIA */
-
- /* gestaltNativeTimeMgr = 4 in some future version of the headers */
- if (!Gestalt(gestaltTimeMgrVersion, &result) &&
- (result > gestaltExtendedTimeMgr))
- gNative = true;
- }
- else {
- /* If no DriverServicesLib, use Gestalt() to get the processor type.
- Only NuBus PowerMacs with old System Software won't have DSL, so
- we know it should either be a 601 or 603. */
-
- /* Use the processor gestalt to determine which register to use */
- if (!Gestalt(gestaltNativeCPUtype, &result)) {
- if (result == gestaltCPU601) gUseRTC = true;
- else if (result > gestaltCPU601) gUseTBR = true;
- }
- }
-
- /* Now calculate a scale factor to keep us accurate. */
- if ((gUpTime && !gNative) || gUseRTC || gUseTBR) {
- UInt64 tick, usec1, usec2;
- UnsignedWide wide;
-
- /* Wait for the beginning of the very next tick */
- for(tick = MyLMGetTicks() + 1; tick > MyLMGetTicks(); );
-
- /* Poll the selected timer and prepare it (since we have time) */
- wide = (gUpTime) ? (*gA2NS)((*gUpTime)()) :
- ((gUseRTC) ? PollRTC() : PollTBR());
- usec1 = (gUseRTC) ? RTCToNano(wide) : WideTo64bit(wide);
-
- /* Wait for the exact 60th tick to roll over */
- while(tick + 60 > MyLMGetTicks());
-
- /* Poll the selected timer again and prepare it */
- wide = (gUpTime) ? (*gA2NS)((*gUpTime)()) :
- ((gUseRTC) ? PollRTC() : PollTBR());
- usec2 = (gUseRTC) ? RTCToNano(wide) : WideTo64bit(wide);
-
- /* Calculate a scale value that will give microseconds per second.
- Remember, there are actually 60.15 ticks in a second, not 60. */
- gScaleUSec = (60.0 * 1000000.0) / ((usec2 - usec1) * 60.15);
- gScaleMSec = gScaleUSec / 1000.0;
- }
-
-#endif /* GENERATINGPOWERPC */
-
- /* We've initialized our globals */
- gInited = true;
- }
- }
-
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-
-UInt64 FastMicroseconds() {
- UnsignedWide wide;
- UInt64 usec;
-
-#if GENERATINGPOWERPC
- /* Initialize globals the first time we are called */
- if (!gInited) FastInitialize();
-
- if (gNative) {
- /* Use DriverServices if it's available -- it's fast and compatible */
- wide = (*gA2NS)((*gUpTime)());
- usec = (double) WideTo64bit(wide) * gScaleUSec + 0.5;
- }
- else if (gUpTime) {
- /* Use DriverServices if it's available -- it's fast and compatible */
- wide = (*gA2NS)((*gUpTime)());
- usec = (double) WideTo64bit(wide) * gScaleUSec + 0.5;
- }
- else if (gUseTBR) {
- /* On a recent PowerPC, we poll the TBR directly */
- wide = PollTBR();
- usec = (double) WideTo64bit(wide) * gScaleUSec + 0.5;
- }
- else if (gUseRTC) {
- /* On a 601, we can poll the RTC instead */
- wide = PollRTC();
- usec = (double) RTCToNano(wide) * gScaleUSec + 0.5;
- }
- else
-#endif /* GENERATINGPOWERPC */
- {
- /* If all else fails, suffer the mixed mode overhead */
- Microseconds(&wide);
- usec = WideTo64bit(wide);
- }
-
- return(usec);
- }
-
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-
-UInt64 FastMilliseconds() {
- UnsignedWide wide;
- UInt64 msec;
-
-#if GENERATINGPOWERPC
- /* Initialize globals the first time we are called */
- if (!gInited) FastInitialize();
-
- if (gNative) {
- /* Use DriverServices if it's available -- it's fast and compatible */
- wide = (*gA2NS)((*gUpTime)());
- msec = (double) WideTo64bit(wide) * gScaleMSec + 0.5;
- }
- else if (gUpTime) {
- /* Use DriverServices if it's available -- it's fast and compatible */
- wide = (*gA2NS)((*gUpTime)());
- msec = (double) WideTo64bit(wide) * gScaleMSec + 0.5;
- }
- else if (gUseTBR) {
- /* On a recent PowerPC, we poll the TBR directly */
- wide = PollTBR();
- msec = (double) WideTo64bit(wide) * gScaleMSec + 0.5;
- }
- else if (gUseRTC) {
- /* On a 601, we can poll the RTC instead */
- wide = PollRTC();
- msec = (double) RTCToNano(wide) * gScaleMSec + 0.5;
- }
- else
-#endif /* GENERATINGPOWERPC */
- {
- /* If all else fails, suffer the mixed mode overhead */
- Microseconds(&wide);
- msec = ((double) WideTo64bit(wide) + 500.0) / 1000.0;
- }
-
- return(msec);
- }
-
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-
-StringPtr FastMethod() {
- StringPtr method = "\p<Unknown>";
-
-#if GENERATINGPOWERPC
- /* Initialize globals the first time we are called */
- if (!gInited) FastInitialize();
-
- if (gNative) {
- /* The Time Manager and UpTime() are entirely native on this machine */
- method = "\pNative UpTime()";
- }
- else if (gUpTime) {
- /* Use DriverServices if it's available -- it's fast and compatible */
- method = "\pUpTime()";
- }
- else if (gUseTBR) {
- /* On a recent PowerPC, we poll the TBR directly */
- method = "\pPowerPC TBR";
- }
- else if (gUseRTC) {
- /* On a 601, we can poll the RTC instead */
- method = "\pPowerPC RTC";
- }
- else
-#endif /* GENERATINGPOWERPC */
- {
- /* If all else fails, suffer the mixed mode overhead */
- method = "\pMicroseconds()";
- }
-
- return(method);
- }
-
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-#pragma mark -
-
-#if GENERATINGPOWERPC
-asm static UnsignedWide PollRTC_() {
-entry PollRTC /* Avoid CodeWarrior glue */
- machine 601
-@AGAIN:
- mfrtcu r4 /* RTCU = SPR 4 */
- mfrtcl r5 /* RTCL = SPR 5 */
- mfrtcu r6
- cmpw r4,r6
- bne @AGAIN
- stw r4,0(r3)
- stw r5,4(r3)
- blr
- }
-
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-
-asm static UnsignedWide PollTBR_() {
-entry PollTBR /* Avoid CodeWarrior glue */
- machine 604
-@AGAIN:
- mftbu r4 /* TBRU = SPR 268 */
- mftb r5 /* TBRL = SPR 269 */
- mftbu r6
- cmpw r4,r6
- bne @AGAIN
- stw r4,0(r3)
- stw r5,4(r3)
- blr
- }
-
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-
-static Ptr FindFunctionInSharedLib(StringPtr libName, StringPtr funcName) {
- OSErr error = noErr;
- Str255 errorStr;
- Ptr func = NULL;
- Ptr entry = NULL;
- CFragSymbolClass symClass;
- CFragConnectionID connID;
-
- /* Find CFM containers for the current archecture -- CFM-PPC or CFM-68K */
- if (/* error = */ GetSharedLibrary(libName, kCompiledCFragArch,
- kLoadCFrag, &connID, &entry, errorStr)) return(NULL);
- if (/* error = */ FindSymbol(connID, funcName, &func, &symClass))
- return(NULL);
-
- return(func);
- }
-#endif /* GENERATINGPOWERPC */
diff --git a/distrib/sdl-1.2.12/src/timer/macos/FastTimes.h b/distrib/sdl-1.2.12/src/timer/macos/FastTimes.h
deleted file mode 100644
index bde8db7..0000000
--- a/distrib/sdl-1.2.12/src/timer/macos/FastTimes.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* File "FastTimes.h" - Original code by Matt Slot <fprefect@ambrosiasw.com> */
-#include "SDL_config.h"
-/* Created 4/24/99 - This file is hereby placed in the public domain */
-/* Updated 5/21/99 - Calibrate to VIA, add TBR support, renamed functions */
-/* Updated 10/4/99 - Use AbsoluteToNanoseconds() in case Absolute = double */
-/* Updated 2/15/00 - Check for native Time Manager, no need to calibrate */
-/* Updated 3/21/00 - Fixed ns conversion, create 2 different scale factors */
-/* Updated 5/03/00 - Added copyright and placed into PD. No code changes */
-
-/* This file is Copyright (C) Matt Slot, 1999-2000. It is hereby placed into
- the public domain. The author makes no warranty as to fitness or stability */
-
-#ifndef __FAST_TIMES_HEADER__
-#define __FAST_TIMES_HEADER__
-
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-
-extern void FastInitialize(void);
-extern UInt64 FastMicroseconds(void);
-extern UInt64 FastMilliseconds(void);
-extern StringPtr FastMethod(void);
-
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
-
-#endif /* __FAST_TIMES_HEADER__ */
diff --git a/distrib/sdl-1.2.12/src/timer/macos/SDL_MPWtimer.c b/distrib/sdl-1.2.12/src/timer/macos/SDL_MPWtimer.c
deleted file mode 100644
index 7aee4aa..0000000
--- a/distrib/sdl-1.2.12/src/timer/macos/SDL_MPWtimer.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_TIMER_MACOS
-
-#include <Types.h>
-#include <Timer.h>
-#include <OSUtils.h>
-#include <Gestalt.h>
-#include <Processes.h>
-
-#include <LowMem.h>
-
-#include "SDL_timer.h"
-#include "../SDL_timer_c.h"
-
-#define MS_PER_TICK (1000/60) /* MacOS tick = 1/60 second */
-
-/* Note: This is only a step above the original 1/60s implementation.
- * For a good implementation, see FastTimes.[ch], by Matt Slot.
- */
-#define USE_MICROSECONDS
-#define WideTo64bit(w) (*(UInt64 *) &(w))
-
-UInt64 start;
-
-void SDL_StartTicks(void)
-{
-#ifdef USE_MICROSECONDS
- UnsignedWide now;
-
- Microseconds(&now);
- start = WideTo64bit(now);
-#else
- /* FIXME: Should we implement a wrapping algorithm, like Win32? */
-#endif
-}
-
-Uint32 SDL_GetTicks(void)
-{
-#ifdef USE_MICROSECONDS
- UnsignedWide now;
-
- Microseconds(&now);
- return (Uint32)((WideTo64bit(now)-start)/1000);
-#else
- return(LMGetTicks()*MS_PER_TICK);
-#endif
-}
-
-void SDL_Delay(Uint32 ms)
-{
-#ifdef USE_MICROSECONDS
- Uint32 end_ms;
-
- end_ms = SDL_GetTicks() + ms;
- do {
- /* FIXME: Yield CPU? */ ;
- } while ( SDL_GetTicks() < end_ms );
-#else
- UInt32 unused; /* MJS */
- Delay(ms/MS_PER_TICK, &unused);
-#endif
-}
-
-
-/* Data to handle a single periodic alarm */
-typedef struct _ExtendedTimerRec
-{
- TMTask tmTask;
- ProcessSerialNumber taskPSN;
-} ExtendedTimerRec, *ExtendedTimerPtr;
-
-static ExtendedTimerRec gExtendedTimerRec;
-
-
-int SDL_SYS_TimerInit(void)
-{
- /* We don't need a setup? */
- return(0);
-}
-
-void SDL_SYS_TimerQuit(void)
-{
- /* We don't need a cleanup? */
- return;
-}
-
-/* Our Stub routine to set up and then call the real routine. */
-pascal void TimerCallbackProc(TMTaskPtr tmTaskPtr)
-{
- Uint32 ms;
-
- WakeUpProcess(&((ExtendedTimerPtr) tmTaskPtr)->taskPSN);
-
- ms = SDL_alarm_callback(SDL_alarm_interval);
- if ( ms ) {
- SDL_alarm_interval = ROUND_RESOLUTION(ms);
- PrimeTime((QElemPtr)&gExtendedTimerRec.tmTask,
- SDL_alarm_interval);
- } else {
- SDL_alarm_interval = 0;
- }
-}
-
-int SDL_SYS_StartTimer(void)
-{
- /*
- * Configure the global structure that stores the timing information.
- */
- gExtendedTimerRec.tmTask.qLink = NULL;
- gExtendedTimerRec.tmTask.qType = 0;
- gExtendedTimerRec.tmTask.tmAddr = NewTimerUPP(TimerCallbackProc);
- gExtendedTimerRec.tmTask.tmCount = 0;
- gExtendedTimerRec.tmTask.tmWakeUp = 0;
- gExtendedTimerRec.tmTask.tmReserved = 0;
- GetCurrentProcess(&gExtendedTimerRec.taskPSN);
-
- /* Install the task record */
- InsXTime((QElemPtr)&gExtendedTimerRec.tmTask);
-
- /* Go! */
- PrimeTime((QElemPtr)&gExtendedTimerRec.tmTask, SDL_alarm_interval);
- return(0);
-}
-
-void SDL_SYS_StopTimer(void)
-{
- RmvTime((QElemPtr)&gExtendedTimerRec.tmTask);
-}
-
-#endif /* SDL_TIMER_MACOS */
diff --git a/distrib/sdl-1.2.12/src/timer/macos/SDL_systimer.c b/distrib/sdl-1.2.12/src/timer/macos/SDL_systimer.c
deleted file mode 100644
index 33fb664..0000000
--- a/distrib/sdl-1.2.12/src/timer/macos/SDL_systimer.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_TIMER_MACOS
-
-#include <Types.h>
-#include <Timer.h>
-#include <OSUtils.h>
-#include <Gestalt.h>
-#include <Processes.h>
-
-#include <LowMem.h>
-
-#include "SDL_timer.h"
-#include "../SDL_timer_c.h"
-
-#include "FastTimes.h"
-
-#if TARGET_API_MAC_CARBON
-#define NewTimerProc NewTimerUPP
-#endif
-
-#define MS_PER_TICK (1000.0/60.0) /* MacOS tick = 1/60 second */
-
-
-#define kTwoPower32 (4294967296.0) /* 2^32 */
-
-static double start_tick;
-static int is_fast_inited = 0;
-
-void SDL_StartTicks(void)
-{
- if ( ! is_fast_inited ) // important to check or FastTime may hang machine!
- SDL_SYS_TimerInit();
-
- start_tick = FastMicroseconds();
-}
-
-Uint32 SDL_GetTicks(void)
-{
-
- if ( ! is_fast_inited )
- SDL_SYS_TimerInit();
-
- return FastMilliseconds();
-}
-
-void SDL_Delay(Uint32 ms)
-{
- Uint32 stop, now;
-
- stop = SDL_GetTicks() + ms;
- do {
- #if TARGET_API_MAC_CARBON
- MPYield();
- #else
- SystemTask();
- #endif
-
- now = SDL_GetTicks();
-
- } while ( stop > now );
-}
-
-/*
-void SDL_StartTicks(void)
-{
- // FIXME: Should we implement a wrapping algorithm, like Win32?
-}
-
-Uint32 SDL_GetTicks(void)
-{
- UnsignedWide ms;
-
- Microseconds (&ms);
-
- return ( ms.lo / 1000 );
-}
-
-void SDL_Delay(Uint32 ms)
-{
-
- UnsignedWide microsecs;
- UInt32 stop;
-
- Microseconds (&microsecs);
-
- stop = microsecs.lo + (ms * 1000);
-
- while ( stop > microsecs.lo ) {
-
- SystemTask ();
-
- Microseconds (&microsecs);
- }
-
-}*/
-
-/* Data to handle a single periodic alarm */
-typedef struct _ExtendedTimerRec
-{
- TMTask tmTask;
- ProcessSerialNumber taskPSN;
-} ExtendedTimerRec, *ExtendedTimerPtr;
-
-static ExtendedTimerRec gExtendedTimerRec;
-
-
-int SDL_SYS_TimerInit(void)
-{
- FastInitialize ();
- is_fast_inited = 1;
-
- return(0);
-}
-
-void SDL_SYS_TimerQuit(void)
-{
- /* We don't need a cleanup? */
- return;
-}
-
-/* Our Stub routine to set up and then call the real routine. */
-pascal void TimerCallbackProc(TMTaskPtr tmTaskPtr)
-{
- Uint32 ms;
-
- WakeUpProcess(&((ExtendedTimerPtr) tmTaskPtr)->taskPSN);
-
- ms = SDL_alarm_callback(SDL_alarm_interval);
- if ( ms ) {
- SDL_alarm_interval = ROUND_RESOLUTION(ms);
- PrimeTime((QElemPtr)&gExtendedTimerRec.tmTask,
- SDL_alarm_interval);
- } else {
- SDL_alarm_interval = 0;
- }
-}
-
-int SDL_SYS_StartTimer(void)
-{
- /*
- * Configure the global structure that stores the timing information.
- */
- gExtendedTimerRec.tmTask.qLink = NULL;
- gExtendedTimerRec.tmTask.qType = 0;
- gExtendedTimerRec.tmTask.tmAddr = NewTimerProc(TimerCallbackProc);
- gExtendedTimerRec.tmTask.tmCount = 0;
- gExtendedTimerRec.tmTask.tmWakeUp = 0;
- gExtendedTimerRec.tmTask.tmReserved = 0;
- GetCurrentProcess(&gExtendedTimerRec.taskPSN);
-
- /* Install the task record */
- InsXTime((QElemPtr)&gExtendedTimerRec.tmTask);
-
- /* Go! */
- PrimeTime((QElemPtr)&gExtendedTimerRec.tmTask, SDL_alarm_interval);
- return(0);
-}
-
-void SDL_SYS_StopTimer(void)
-{
- RmvTime((QElemPtr)&gExtendedTimerRec.tmTask);
-}
-
-#endif /* SDL_TIMER_MACOS */
diff --git a/distrib/sdl-1.2.12/src/timer/mint/SDL_systimer.c b/distrib/sdl-1.2.12/src/timer/mint/SDL_systimer.c
deleted file mode 100644
index f9560c4..0000000
--- a/distrib/sdl-1.2.12/src/timer/mint/SDL_systimer.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_TIMER_MINT
-
-/*
- * TOS/MiNT timer driver
- * based on vbl vector
- *
- * Patrice Mandin
- */
-
-#include <stdio.h>
-#include <sys/time.h>
-#include <signal.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-
-#include <mint/cookie.h>
-#include <mint/sysvars.h>
-#include <mint/osbind.h>
-#include <mint/mintbind.h>
-
-#include "SDL_timer.h"
-#include "../SDL_timer_c.h"
-#include "SDL_thread.h"
-
-#include "SDL_vbltimer_s.h"
-
-/* from audio/mint */
-void SDL_MintAudio_CheckFpu(void);
-
-/* The first ticks value of the application */
-static Uint32 start;
-static SDL_bool read_hz200_from_vbl = SDL_FALSE;
-static int mint_present; /* can we use Syield() ? */
-
-void SDL_StartTicks(void)
-{
- void *old_stack;
- unsigned long dummy;
-
- /* Set first ticks value */
- old_stack = (void *)Super(0);
- start = *((volatile long *)_hz_200);
- Super(old_stack);
-
- start *= 5; /* One _hz_200 tic is 5ms */
-
- mint_present = (Getcookie(C_MiNT, &dummy) == C_FOUND);
-}
-
-Uint32 SDL_GetTicks (void)
-{
- Uint32 now = start;
-
- if (read_hz200_from_vbl) {
- now = SDL_Atari_hz200;
- } else {
- void *old_stack = (void *)Super(0);
- now = *((volatile long *)_hz_200);
- Super(old_stack);
- }
-
- return((now*5)-start);
-}
-
-void SDL_Delay (Uint32 ms)
-{
- Uint32 now;
-
- now = SDL_GetTicks();
- while ((SDL_GetTicks()-now)<ms){
- if (mint_present) {
- Syield();
- }
- }
-}
-
-/* Data to handle a single periodic alarm */
-static SDL_bool timer_installed=SDL_FALSE;
-
-/* This is only called if the event thread is not running */
-int SDL_SYS_TimerInit(void)
-{
- void *old_stack;
-
- SDL_MintAudio_CheckFpu();
-
- /* Install RunTimer in vbl vector */
- old_stack = (void *)Super(0);
- timer_installed = !SDL_AtariVblInstall(SDL_ThreadedTimerCheck);
- Super(old_stack);
-
- if (!timer_installed) {
- return(-1);
- }
-
- read_hz200_from_vbl = SDL_TRUE;
- return(SDL_SetTimerThreaded(0));
-}
-
-void SDL_SYS_TimerQuit(void)
-{
- /* Uninstall RunTimer vbl vector */
- if (timer_installed) {
- void *old_stack = (void *)Super(0);
- SDL_AtariVblUninstall(SDL_ThreadedTimerCheck);
- Super(old_stack);
- timer_installed = SDL_FALSE;
- }
- read_hz200_from_vbl = SDL_FALSE;
-}
-
-int SDL_SYS_StartTimer(void)
-{
- SDL_SetError("Internal logic error: MiNT uses vbl timer");
- return(-1);
-}
-
-void SDL_SYS_StopTimer(void)
-{
- return;
-}
-
-#endif /* SDL_TIMER_MINT */
diff --git a/distrib/sdl-1.2.12/src/timer/mint/SDL_vbltimer.S b/distrib/sdl-1.2.12/src/timer/mint/SDL_vbltimer.S
deleted file mode 100644
index f9c4be9..0000000
--- a/distrib/sdl-1.2.12/src/timer/mint/SDL_vbltimer.S
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/*
- * VBL queue routine
- *
- * Patrice Mandin
- */
-
-#define _vbl_queue 0x456
-#define _hz_200 0x4ba
-
- .text
-
- .globl _SDL_AtariVblInstall
- .globl _SDL_AtariVblUninstall
-
- .globl _SDL_MintAudio_hasfpu
-
-/*--- Vector installer ---*/
-
-_SDL_AtariVblInstall:
- movel sp@(4),my_vector
- lea _my_vbl,a0
-
- clrw vbl_mutex
- movel _hz_200.w, _SDL_Atari_hz200
-
- /* Stop interrupts */
-
- movew #0x2700,sr
-
- /* Read vbl_queue pointer */
- movel _vbl_queue.w,a1
-
- /* Search a free place */
- moveq #7,d0
-bcl_search_place:
- movel (a1),d1
- beqs place_found
- addql #4,a1
- dbra d0,bcl_search_place
-
- /* Not found */
- moveq #1,d0
- bras exit_vbl_queue
-
- /* Then install ourselves */
-place_found:
- movel a0,(a1)
- moveq #0,d0
-
-exit_vbl_queue:
- /* Restart interrupts */
- movew #0x2300,sr
-
- rts
-
-/*--- Vector uninstaller ---*/
-
-_SDL_AtariVblUninstall:
- movel sp@(4),d0
- cmpl my_vector,d0
- bnes badvector
-
- movel #_my_vbl,d0
-
- /* Stop interrupts */
-
- movew #0x2700,sr
-
- /* Read vbl_queue pointer */
- movel _vbl_queue.w,a1
-
- /* Search where we are */
- moveq #7,d1
-bcl2_search_place:
- cmpl (a1),d0
- bnes next_place
- clrl (a1)
- moveq #0,d1
-next_place:
- addql #4,a1
- dbra d1,bcl2_search_place
-
- /* Restart interrupts */
- movew #0x2300,sr
-badvector:
- rts
-
-/*--- Our vbl ---*/
-
-_my_vbl:
- /* Update _hz_200 */
- movel _hz_200.w, _SDL_Atari_hz200
-
- /* Verify if this is not already running */
-
- tstw vbl_mutex
- bnes vbl_end
- notw vbl_mutex
-
- moveml d0-d7/a0-a6,sp@-
-
- /* Save FPU if needed */
- tstw _SDL_MintAudio_hasfpu
- beqs SDL_AtariVbl_nofpu1
- .chip 68060
- fsave sp@-
- fmoveml fpcr/fpsr/fpiar,sp@-
- fmovemx fp0-fp7,sp@-
- .chip 68000
-SDL_AtariVbl_nofpu1:
-
- movel my_vector,a0
- jsr a0@
-
- /* Restore FPU if needed */
- tstw _SDL_MintAudio_hasfpu
- beqs SDL_AtariVbl_Xbios_nofpu2
- .chip 68060
- fmovemx sp@+,fp0-fp7
- fmoveml sp@+,fpcr/fpsr/fpiar
- frestore sp@+
- .chip 68000
-SDL_AtariVbl_Xbios_nofpu2:
-
- moveml sp@+,d0-d7/a0-a6
-
- clrw vbl_mutex
-vbl_end:
- rts
-
- .data
- .even
- .comm _SDL_Atari_hz200,4*1
- .even
- .comm vbl_mutex,2*1
- .even
- .comm my_vector,4*1
diff --git a/distrib/sdl-1.2.12/src/timer/mint/SDL_vbltimer_s.h b/distrib/sdl-1.2.12/src/timer/mint/SDL_vbltimer_s.h
deleted file mode 100644
index f893ef5..0000000
--- a/distrib/sdl-1.2.12/src/timer/mint/SDL_vbltimer_s.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * TOS/MiNT timer driver
- * based on vbl vector
- *
- * Patrice Mandin
- */
-
-extern volatile long SDL_Atari_hz200;
-
-/* Functions prototypes */
-extern int SDL_AtariVblInstall(void *newvector);
-extern void SDL_AtariVblUninstall(void *newvector);
diff --git a/distrib/sdl-1.2.12/src/timer/os2/SDL_systimer.c b/distrib/sdl-1.2.12/src/timer/os2/SDL_systimer.c
deleted file mode 100644
index 825ced9..0000000
--- a/distrib/sdl-1.2.12/src/timer/os2/SDL_systimer.c
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_TIMER_OS2
-
-#define INCL_DOSMISC
-#define INCL_DOSERRORS
-#define INCL_DOSSEMAPHORES
-#define INCL_DOSDATETIME
-#define INCL_DOSPROCESS
-#define INCL_DOSPROFILE
-#define INCL_DOSEXCEPTIONS
-#include <os2.h>
-
-#include "SDL_thread.h"
-#include "SDL_timer.h"
-#include "../SDL_timer_c.h"
-
-
-#define TIME_WRAP_VALUE (~(DWORD)0)
-
-/* The first high-resolution ticks value of the application */
-static long long hires_start_ticks;
-/* The number of ticks per second of the high-resolution performance counter */
-static ULONG hires_ticks_per_second;
-
-void SDL_StartTicks(void)
-{
- DosTmrQueryFreq(&hires_ticks_per_second);
- DosTmrQueryTime((PQWORD)&hires_start_ticks);
-}
-
-DECLSPEC Uint32 SDLCALL SDL_GetTicks(void)
-{
- long long hires_now;
- ULONG ticks = ticks;
-
- DosTmrQueryTime((PQWORD)&hires_now);
-/*
- hires_now -= hires_start_ticks;
- hires_now *= 1000;
- hires_now /= hires_ticks_per_second;
-*/
- /* inline asm to avoid runtime inclusion */
- _asm {
- push edx
- push eax
- mov eax, dword ptr hires_now
- mov edx, dword ptr hires_now+4
- sub eax, dword ptr hires_start_ticks
- sbb edx, dword ptr hires_start_ticks+4
- mov ebx,1000
- mov ecx,edx
- mul ebx
- push eax
- push edx
- mov eax,ecx
- mul ebx
- pop eax
- add edx,eax
- pop eax
- mov ebx, dword ptr hires_ticks_per_second
- div ebx
- mov dword ptr ticks, eax
- pop edx
- pop eax
- }
-
- return ticks;
-
-}
-
-/* High resolution sleep, originally made by Ilya Zakharevich */
-DECLSPEC void SDLCALL SDL_Delay(Uint32 ms)
-{
- /* This is similar to DosSleep(), but has 8ms granularity in time-critical
- threads even on Warp3. */
- HEV hevEvent1 = 0; /* Event semaphore handle */
- HTIMER htimerEvent1 = 0; /* Timer handle */
- APIRET rc = NO_ERROR; /* Return code */
- int ret = 1;
- ULONG priority = 0, nesting; /* Shut down the warnings */
- PPIB pib;
- PTIB tib;
- char *e = NULL;
- APIRET badrc;
- int switch_priority = 50;
-
- DosCreateEventSem(NULL, /* Unnamed */
- &hevEvent1, /* Handle of semaphore returned */
- DC_SEM_SHARED, /* Shared needed for DosAsyncTimer */
- FALSE); /* Semaphore is in RESET state */
-
- if (ms >= switch_priority)
- switch_priority = 0;
- if (switch_priority)
- {
- if (DosGetInfoBlocks(&tib, &pib)!=NO_ERROR)
- switch_priority = 0;
- else
- {
- /* In Warp3, to switch scheduling to 8ms step, one needs to do
- DosAsyncTimer() in time-critical thread. On laters versions,
- more and more cases of wait-for-something are covered.
-
- It turns out that on Warp3fp42 it is the priority at the time
- of DosAsyncTimer() which matters. Let's hope that this works
- with later versions too... XXXX
- */
- priority = (tib->tib_ptib2->tib2_ulpri);
- if ((priority & 0xFF00) == 0x0300) /* already time-critical */
- switch_priority = 0;
- /* Make us time-critical. Just modifying TIB is not enough... */
- /* tib->tib_ptib2->tib2_ulpri = 0x0300;*/
- /* We do not want to run at high priority if a signal causes us
- to longjmp() out of this section... */
- if (DosEnterMustComplete(&nesting))
- switch_priority = 0;
- else
- DosSetPriority(PRTYS_THREAD, PRTYC_TIMECRITICAL, 0, 0);
- }
- }
-
- if ((badrc = DosAsyncTimer(ms,
- (HSEM) hevEvent1, /* Semaphore to post */
- &htimerEvent1))) /* Timer handler (returned) */
- e = "DosAsyncTimer";
-
- if (switch_priority && tib->tib_ptib2->tib2_ulpri == 0x0300)
- {
- /* Nobody switched priority while we slept... Ignore errors... */
- /* tib->tib_ptib2->tib2_ulpri = priority; */ /* Get back... */
- if (!(rc = DosSetPriority(PRTYS_THREAD, (priority>>8) & 0xFF, 0, 0)))
- rc = DosSetPriority(PRTYS_THREAD, 0, priority & 0xFF, 0);
- }
- if (switch_priority)
- rc = DosExitMustComplete(&nesting); /* Ignore errors */
-
- /* The actual blocking call is made with "normal" priority. This way we
- should not bother with DosSleep(0) etc. to compensate for us interrupting
- higher-priority threads. The goal is to prohibit the system spending too
- much time halt()ing, not to run us "no matter what". */
- if (!e) /* Wait for AsyncTimer event */
- badrc = DosWaitEventSem(hevEvent1, SEM_INDEFINITE_WAIT);
-
- if (e) ; /* Do nothing */
- else if (badrc == ERROR_INTERRUPT)
- ret = 0;
- else if (badrc)
- e = "DosWaitEventSem";
- if ((rc = DosCloseEventSem(hevEvent1)) && !e) { /* Get rid of semaphore */
- e = "DosCloseEventSem";
- badrc = rc;
- }
- if (e)
- {
- SDL_SetError("[SDL_Delay] : Had error in %s(), rc is 0x%x\n", e, badrc);
- }
-}
-
-/* Data to handle a single periodic alarm */
-static int timer_alive = 0;
-static SDL_Thread *timer = NULL;
-
-static int SDLCALL RunTimer(void *unused)
-{
- DosSetPriority(PRTYS_THREAD, PRTYC_TIMECRITICAL, 0, 0);
- while ( timer_alive ) {
- if ( SDL_timer_running ) {
- SDL_ThreadedTimerCheck();
- }
- SDL_Delay(10);
- }
- return(0);
-}
-
-/* This is only called if the event thread is not running */
-int SDL_SYS_TimerInit(void)
-{
- timer_alive = 1;
- timer = SDL_CreateThread(RunTimer, NULL);
- if ( timer == NULL )
- return(-1);
- return(SDL_SetTimerThreaded(1));
-}
-
-void SDL_SYS_TimerQuit(void)
-{
- timer_alive = 0;
- if ( timer ) {
- SDL_WaitThread(timer, NULL);
- timer = NULL;
- }
-}
-
-int SDL_SYS_StartTimer(void)
-{
- SDL_SetError("Internal logic error: OS/2 uses threaded timer");
- return(-1);
-}
-
-void SDL_SYS_StopTimer(void)
-{
- return;
-}
-
-#endif /* SDL_TIMER_OS2 */
diff --git a/distrib/sdl-1.2.12/src/timer/riscos/SDL_systimer.c b/distrib/sdl-1.2.12/src/timer/riscos/SDL_systimer.c
deleted file mode 100644
index b782f39..0000000
--- a/distrib/sdl-1.2.12/src/timer/riscos/SDL_systimer.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_TIMER_RISCOS
-
-#include <stdio.h>
-#include <time.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-
-#include "SDL_timer.h"
-#include "../SDL_timer_c.h"
-
-#if SDL_THREADS_DISABLED
-/* Timer SDL_arraysize(Timer ),start/reset time */
-static Uint32 timerStart;
-/* Timer running function */
-void RISCOS_CheckTimer();
-#else
-#include <pthread.h>
-extern Uint32 riscos_main_thread;
-extern int riscos_using_threads;
-extern Uint32 SDL_ThreadID();
-extern Uint32 SDL_EventThreadID(void);
-#endif
-
-
-extern void RISCOS_BackgroundTasks(void);
-
-/* The first ticks value of the application */
-clock_t start;
-
-void SDL_StartTicks(void)
-{
- /* Set first ticks value */
- start = clock();
-}
-
-Uint32 SDL_GetTicks (void)
-{
- clock_t ticks;
-
- ticks=clock()-start;
-
-
-#if CLOCKS_PER_SEC == 1000
-
- return(ticks);
-
-#elif CLOCKS_PER_SEC == 100
-
- return (ticks * 10);
-
-#else
-
- return ticks*(1000/CLOCKS_PER_SEC);
-
-#endif
-
-}
-
-void SDL_Delay (Uint32 ms)
-{
- Uint32 now,then,elapsed;
-#if !SDL_THREADS_DISABLED
- int is_event_thread;
- if (riscos_using_threads)
- {
- is_event_thread = 0;
- if (SDL_EventThreadID())
- {
- if (SDL_EventThreadID() == SDL_ThreadID()) is_event_thread = 1;
- } else if (SDL_ThreadID() == riscos_main_thread) is_event_thread = 1;
- } else is_event_thread = 1;
-#endif
-
- /*TODO: Next version of Unixlib may allow us to use usleep here */
- /* for non event threads */
-
- /* Set the timeout interval - Linux only needs to do this once */
- then = SDL_GetTicks();
-
- do {
- /* Do background tasks required while sleeping as we are not multithreaded */
-#if SDL_THREADS_DISABLED
- RISCOS_BackgroundTasks();
-#else
- /* For threaded build only run background tasks in event thread */
- if (is_event_thread) RISCOS_BackgroundTasks();
-#endif
-
- /* Calculate the time interval left (in case of interrupt) */
- now = SDL_GetTicks();
- elapsed = (now-then);
- then = now;
- if ( elapsed >= ms ) {
- break;
- }
- ms -= elapsed;
-#if !SDL_THREADS_DISABLED
- /* Need to yield to let other threads have a go */
- if (riscos_using_threads) pthread_yield();
-#endif
-
- } while ( 1 );
-}
-
-#if SDL_THREADS_DISABLED
-
-/* Non-threaded version of timer */
-
-int SDL_SYS_TimerInit(void)
-{
- return(0);
-}
-
-void SDL_SYS_TimerQuit(void)
-{
- SDL_SetTimer(0, NULL);
-}
-
-int SDL_SYS_StartTimer(void)
-{
- timerStart = SDL_GetTicks();
-
- return(0);
-}
-
-void SDL_SYS_StopTimer(void)
-{
- /* Don't need to do anything as we use SDL_timer_running
- to detect if we need to check the timer */
-}
-
-
-void RISCOS_CheckTimer()
-{
- if (SDL_timer_running && SDL_GetTicks() - timerStart >= SDL_alarm_interval)
- {
- Uint32 ms;
-
- ms = SDL_alarm_callback(SDL_alarm_interval);
- if ( ms != SDL_alarm_interval )
- {
- if ( ms )
- {
- SDL_alarm_interval = ROUND_RESOLUTION(ms);
- } else
- {
- SDL_alarm_interval = 0;
- SDL_timer_running = 0;
- }
- }
- if (SDL_alarm_interval) timerStart = SDL_GetTicks();
- }
-}
-
-#else
-
-/* Threaded version of timer - based on code for linux */
-
-#include "SDL_thread.h"
-
-/* Data to handle a single periodic alarm */
-static int timer_alive = 0;
-static SDL_Thread *timer = NULL;
-
-static int RunTimer(void *unused)
-{
- while ( timer_alive ) {
- if ( SDL_timer_running ) {
- SDL_ThreadedTimerCheck();
- }
- SDL_Delay(1);
- }
- return(0);
-}
-
-/* This is only called if the event thread is not running */
-int SDL_SYS_TimerInit(void)
-{
- timer_alive = 1;
- timer = SDL_CreateThread(RunTimer, NULL);
- if ( timer == NULL )
- return(-1);
- return(SDL_SetTimerThreaded(1));
-}
-
-void SDL_SYS_TimerQuit(void)
-{
- timer_alive = 0;
- if ( timer ) {
- SDL_WaitThread(timer, NULL);
- timer = NULL;
- }
-}
-
-int SDL_SYS_StartTimer(void)
-{
- SDL_SetError("Internal logic error: RISC OS uses threaded timer");
- return(-1);
-}
-
-void SDL_SYS_StopTimer(void)
-{
- return;
-}
-
-#endif /* SDL_THREADS_DISABLED */
-
-#endif /* SDL_TIMER_RISCOS */
diff --git a/distrib/sdl-1.2.12/src/timer/unix/SDL_systimer.c b/distrib/sdl-1.2.12/src/timer/unix/SDL_systimer.c
deleted file mode 100644
index 58b53ed..0000000
--- a/distrib/sdl-1.2.12/src/timer/unix/SDL_systimer.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_TIMER_UNIX
-
-#include <stdio.h>
-#include <sys/time.h>
-#include <signal.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-
-#include "SDL_timer.h"
-#include "../SDL_timer_c.h"
-
-/* The clock_gettime provides monotonous time, so we should use it if
- it's available. The clock_gettime function is behind ifdef
- for __USE_POSIX199309
- Tommi Kyntola (tommi.kyntola@ray.fi) 27/09/2005
-*/
-#if HAVE_NANOSLEEP || HAVE_CLOCK_GETTIME
-#include <time.h>
-#endif
-
-#if SDL_THREAD_PTH
-#include <pth.h>
-#endif
-
-#if SDL_THREADS_DISABLED
-#define USE_ITIMER
-#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 */
-
-
-void SDL_StartTicks(void)
-{
- /* Set first ticks value */
-#if HAVE_CLOCK_GETTIME
- clock_gettime(CLOCK_MONOTONIC,&start);
-#else
- gettimeofday(&start, NULL);
-#endif
-}
-
-Uint32 SDL_GetTicks (void)
-{
-#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);
-#endif
-}
-
-void SDL_Delay (Uint32 ms)
-{
-#if SDL_THREAD_PTH
- pth_time_t tv;
- tv.tv_sec = ms/1000;
- tv.tv_usec = (ms%1000)*1000;
- pth_nap(tv);
-#else
- int was_error;
-
-#if HAVE_NANOSLEEP
- struct timespec elapsed, tv;
-#else
- struct timeval tv;
- Uint32 then, now, elapsed;
-#endif
-
- /* Set the timeout interval */
-#if HAVE_NANOSLEEP
- elapsed.tv_sec = ms/1000;
- elapsed.tv_nsec = (ms%1000)*1000000;
-#else
- then = SDL_GetTicks();
-#endif
- do {
- errno = 0;
-
-#if HAVE_NANOSLEEP
- tv.tv_sec = elapsed.tv_sec;
- tv.tv_nsec = elapsed.tv_nsec;
- was_error = nanosleep(&tv, &elapsed);
-#else
- /* Calculate the time interval left (in case of interrupt) */
- now = SDL_GetTicks();
- elapsed = (now-then);
- then = now;
- if ( elapsed >= ms ) {
- break;
- }
- ms -= elapsed;
- tv.tv_sec = ms/1000;
- tv.tv_usec = (ms%1000)*1000;
-
- was_error = select(0, NULL, NULL, NULL, &tv);
-#endif /* HAVE_NANOSLEEP */
- } while ( was_error && (errno == EINTR) );
-#endif /* SDL_THREAD_PTH */
-}
-
-#ifdef USE_ITIMER
-
-static void HandleAlarm(int sig)
-{
- Uint32 ms;
-
- if ( SDL_alarm_callback ) {
- ms = (*SDL_alarm_callback)(SDL_alarm_interval);
- if ( ms != SDL_alarm_interval ) {
- SDL_SetTimer(ms, SDL_alarm_callback);
- }
- }
-}
-
-int SDL_SYS_TimerInit(void)
-{
- struct sigaction action;
-
- /* Set the alarm handler (Linux specific) */
- SDL_memset(&action, 0, sizeof(action));
- action.sa_handler = HandleAlarm;
- action.sa_flags = SA_RESTART;
- sigemptyset(&action.sa_mask);
- sigaction(SIGALRM, &action, NULL);
- return(0);
-}
-
-void SDL_SYS_TimerQuit(void)
-{
- SDL_SetTimer(0, NULL);
-}
-
-int SDL_SYS_StartTimer(void)
-{
- struct itimerval timer;
-
- timer.it_value.tv_sec = (SDL_alarm_interval/1000);
- timer.it_value.tv_usec = (SDL_alarm_interval%1000)*1000;
- timer.it_interval.tv_sec = (SDL_alarm_interval/1000);
- timer.it_interval.tv_usec = (SDL_alarm_interval%1000)*1000;
- setitimer(ITIMER_REAL, &timer, NULL);
- return(0);
-}
-
-void SDL_SYS_StopTimer(void)
-{
- struct itimerval timer;
-
- SDL_memset(&timer, 0, (sizeof timer));
- setitimer(ITIMER_REAL, &timer, NULL);
-}
-
-#else /* USE_ITIMER */
-
-#include "SDL_thread.h"
-
-/* Data to handle a single periodic alarm */
-static int timer_alive = 0;
-static SDL_Thread *timer = NULL;
-
-static int RunTimer(void *unused)
-{
- while ( timer_alive ) {
- if ( SDL_timer_running ) {
- SDL_ThreadedTimerCheck();
- }
- SDL_Delay(1);
- }
- return(0);
-}
-
-/* This is only called if the event thread is not running */
-int SDL_SYS_TimerInit(void)
-{
- timer_alive = 1;
- timer = SDL_CreateThread(RunTimer, NULL);
- if ( timer == NULL )
- return(-1);
- return(SDL_SetTimerThreaded(1));
-}
-
-void SDL_SYS_TimerQuit(void)
-{
- timer_alive = 0;
- if ( timer ) {
- SDL_WaitThread(timer, NULL);
- timer = NULL;
- }
-}
-
-int SDL_SYS_StartTimer(void)
-{
- SDL_SetError("Internal logic error: Linux uses threaded timer");
- return(-1);
-}
-
-void SDL_SYS_StopTimer(void)
-{
- return;
-}
-
-#endif /* USE_ITIMER */
-
-#endif /* SDL_TIMER_UNIX */
diff --git a/distrib/sdl-1.2.12/src/timer/win32/SDL_systimer.c b/distrib/sdl-1.2.12/src/timer/win32/SDL_systimer.c
deleted file mode 100644
index 4a24d13..0000000
--- a/distrib/sdl-1.2.12/src/timer/win32/SDL_systimer.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_TIMER_WIN32
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <mmsystem.h>
-
-#include "SDL_timer.h"
-#include "../SDL_timer_c.h"
-
-#ifdef _WIN32_WCE
- #error This is WinCE. Please use src/timer/wince/SDL_systimer.c instead.
-#endif
-
-#define TIME_WRAP_VALUE (~(DWORD)0)
-
-/* The first (low-resolution) ticks value of the application */
-static DWORD start;
-
-#ifndef USE_GETTICKCOUNT
-/* Store if a high-resolution performance counter exists on the system */
-static BOOL hires_timer_available;
-/* The first high-resolution ticks value of the application */
-static LARGE_INTEGER hires_start_ticks;
-/* The number of ticks per second of the high-resolution performance counter */
-static LARGE_INTEGER hires_ticks_per_second;
-#endif
-
-void SDL_StartTicks(void)
-{
- /* Set first ticks value */
-#ifdef USE_GETTICKCOUNT
- start = GetTickCount();
-#else
-#if 0 /* Apparently there are problems with QPC on Win2K */
- if (QueryPerformanceFrequency(&hires_ticks_per_second) == TRUE)
- {
- hires_timer_available = TRUE;
- QueryPerformanceCounter(&hires_start_ticks);
- }
- else
-#endif
- {
- hires_timer_available = FALSE;
- timeBeginPeriod(1); /* use 1 ms timer precision */
- start = timeGetTime();
- }
-#endif
-}
-
-Uint32 SDL_GetTicks(void)
-{
- DWORD now, ticks;
-#ifndef USE_GETTICKCOUNT
- LARGE_INTEGER hires_now;
-#endif
-
-#ifdef USE_GETTICKCOUNT
- now = GetTickCount();
-#else
- if (hires_timer_available)
- {
- QueryPerformanceCounter(&hires_now);
-
- hires_now.QuadPart -= hires_start_ticks.QuadPart;
- hires_now.QuadPart *= 1000;
- hires_now.QuadPart /= hires_ticks_per_second.QuadPart;
-
- return (DWORD)hires_now.QuadPart;
- }
- else
- {
- now = timeGetTime();
- }
-#endif
-
- if ( now < start ) {
- ticks = (TIME_WRAP_VALUE-start) + now;
- } else {
- ticks = (now - start);
- }
- return(ticks);
-}
-
-void SDL_Delay(Uint32 ms)
-{
- Sleep(ms);
-}
-
-/* Data to handle a single periodic alarm */
-static UINT timerID = 0;
-
-static void CALLBACK HandleAlarm(UINT uID, UINT uMsg, DWORD_PTR dwUser,
- DWORD_PTR dw1, DWORD_PTR dw2)
-{
- SDL_ThreadedTimerCheck();
-}
-
-
-int SDL_SYS_TimerInit(void)
-{
- MMRESULT result;
-
- /* Set timer resolution */
- result = timeBeginPeriod(TIMER_RESOLUTION);
- if ( result != TIMERR_NOERROR ) {
- SDL_SetError("Warning: Can't set %d ms timer resolution",
- TIMER_RESOLUTION);
- }
- /* Allow 10 ms of drift so we don't chew on CPU */
- timerID = timeSetEvent(TIMER_RESOLUTION,1,HandleAlarm,0,TIME_PERIODIC);
- if ( ! timerID ) {
- SDL_SetError("timeSetEvent() failed");
- return(-1);
- }
- return(SDL_SetTimerThreaded(1));
-}
-
-void SDL_SYS_TimerQuit(void)
-{
- if ( timerID ) {
- timeKillEvent(timerID);
- }
- timeEndPeriod(TIMER_RESOLUTION);
-}
-
-int SDL_SYS_StartTimer(void)
-{
- SDL_SetError("Internal logic error: Win32 uses threaded timer");
- return(-1);
-}
-
-void SDL_SYS_StopTimer(void)
-{
- return;
-}
-
-#endif /* SDL_TIMER_WIN32 */
diff --git a/distrib/sdl-1.2.12/src/timer/wince/SDL_systimer.c b/distrib/sdl-1.2.12/src/timer/wince/SDL_systimer.c
deleted file mode 100644
index 1e129db..0000000
--- a/distrib/sdl-1.2.12/src/timer/wince/SDL_systimer.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_TIMER_WINCE
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <mmsystem.h>
-
-#include "SDL_thread.h"
-#include "SDL_timer.h"
-#include "../SDL_timer_c.h"
-
-static Uint64 start_date;
-static Uint64 start_ticks;
-
-static Uint64 wce_ticks(void)
-{
- return((Uint64)GetTickCount());
-}
-
-static Uint64 wce_date(void)
-{
- union
- {
- FILETIME ftime;
- Uint64 itime;
- } ftime;
- SYSTEMTIME stime;
-
- GetSystemTime(&stime);
- SystemTimeToFileTime(&stime,&ftime.ftime);
- ftime.itime/=10000; // Convert 100ns intervals to 1ms intervals
- // Remove ms portion, which can't be relied on
- ftime.itime -= (ftime.itime % 1000);
- return(ftime.itime);
-}
-
-static Sint32 wce_rel_ticks(void)
-{
- return((Sint32)(wce_ticks()-start_ticks));
-}
-
-static Sint32 wce_rel_date(void)
-{
- return((Sint32)(wce_date()-start_date));
-}
-
-/* Return time in ms relative to when SDL was started */
-Uint32 SDL_GetTicks()
-{
- Sint32 offset=wce_rel_date()-wce_rel_ticks();
- if((offset < -1000) || (offset > 1000))
- {
-// fprintf(stderr,"Time desync(%+d), resyncing\n",offset/1000);
- start_ticks-=offset;
- }
-
- return((Uint32)wce_rel_ticks());
-}
-
-/* Give up approx. givem milliseconds to the OS. */
-void SDL_Delay(Uint32 ms)
-{
- Sleep(ms);
-}
-
-/* Recard start-time of application for reference */
-void SDL_StartTicks(void)
-{
- start_date=wce_date();
- start_ticks=wce_ticks();
-}
-
-static UINT WIN_timer;
-
-#if ( _WIN32_WCE <= 420 )
-
-static HANDLE timersThread = 0;
-static HANDLE timersQuitEvent = 0;
-
-DWORD TimersThreadProc(void *data)
-{
- while(WaitForSingleObject(timersQuitEvent, 10) == WAIT_TIMEOUT)
- {
- SDL_ThreadedTimerCheck();
- }
- return 0;
-}
-
-int SDL_SYS_TimerInit(void)
-{
- // create a thread to process a threaded timers
- // SetTimer does not suit the needs because
- // TimerCallbackProc will be called only when WM_TIMER occured
-
- timersQuitEvent = CreateEvent(0, TRUE, FALSE, 0);
- if( !timersQuitEvent )
- {
- SDL_SetError("Cannot create event for timers thread");
- return -1;
- }
- timersThread = CreateThread(NULL, 0, TimersThreadProc, 0, 0, 0);
- if( !timersThread )
- {
- SDL_SetError("Cannot create timers thread, check amount of RAM available");
- return -1;
- }
- SetThreadPriority(timersThread, THREAD_PRIORITY_HIGHEST);
-
- return(SDL_SetTimerThreaded(1));
-}
-
-void SDL_SYS_TimerQuit(void)
-{
- SetEvent(timersQuitEvent);
- if( WaitForSingleObject(timersThread, 2000) == WAIT_TIMEOUT )
- TerminateThread(timersThread, 0);
- CloseHandle(timersThread);
- CloseHandle(timersQuitEvent);
- return;
-}
-
-#else
-
-#pragma comment(lib, "mmtimer.lib")
-
-/* Data to handle a single periodic alarm */
-static UINT timerID = 0;
-
-static void CALLBACK HandleAlarm(UINT uID, UINT uMsg, DWORD dwUser,
- DWORD dw1, DWORD dw2)
-{
- SDL_ThreadedTimerCheck();
-}
-
-
-int SDL_SYS_TimerInit(void)
-{
- MMRESULT result;
-
- /* Set timer resolution */
- result = timeBeginPeriod(TIMER_RESOLUTION);
- if ( result != TIMERR_NOERROR ) {
- SDL_SetError("Warning: Can't set %d ms timer resolution",
- TIMER_RESOLUTION);
- }
- /* Allow 10 ms of drift so we don't chew on CPU */
- timerID = timeSetEvent(TIMER_RESOLUTION,1,HandleAlarm,0,TIME_PERIODIC);
- if ( ! timerID ) {
- SDL_SetError("timeSetEvent() failed");
- return(-1);
- }
- return(SDL_SetTimerThreaded(1));
-}
-
-void SDL_SYS_TimerQuit(void)
-{
- if ( timerID ) {
- timeKillEvent(timerID);
- }
- timeEndPeriod(TIMER_RESOLUTION);
-}
-
-#endif
-
-int SDL_SYS_StartTimer(void)
-{
- SDL_SetError("Internal logic error: WinCE uses threaded timer");
- return(-1);
-}
-
-void SDL_SYS_StopTimer(void)
-{
- return;
-}
-
-#endif /* SDL_TIMER_WINCE */
diff --git a/distrib/sdl-1.2.12/src/video/SDL_RLEaccel.c b/distrib/sdl-1.2.12/src/video/SDL_RLEaccel.c
deleted file mode 100644
index cf33352..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_RLEaccel.c
+++ /dev/null
@@ -1,1943 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * RLE encoding for software colorkey and alpha-channel acceleration
- *
- * Original version by Sam Lantinga
- *
- * Mattias Engdegård (Yorick): Rewrite. New encoding format, encoder and
- * decoder. Added per-surface alpha blitter. Added per-pixel alpha
- * format, encoder and blitter.
- *
- * Many thanks to Xark and johns for hints, benchmarks and useful comments
- * leading to this code.
- *
- * Welcome to Macro Mayhem.
- */
-
-/*
- * The encoding translates the image data to a stream of segments of the form
- *
- * <skip> <run> <data>
- *
- * where <skip> is the number of transparent pixels to skip,
- * <run> is the number of opaque pixels to blit,
- * and <data> are the pixels themselves.
- *
- * This basic structure is used both for colorkeyed surfaces, used for simple
- * binary transparency and for per-surface alpha blending, and for surfaces
- * with per-pixel alpha. The details differ, however:
- *
- * Encoding of colorkeyed surfaces:
- *
- * Encoded pixels always have the same format as the target surface.
- * <skip> and <run> are unsigned 8 bit integers, except for 32 bit depth
- * where they are 16 bit. This makes the pixel data aligned at all times.
- * Segments never wrap around from one scan line to the next.
- *
- * The end of the sequence is marked by a zero <skip>,<run> pair at the *
- * beginning of a line.
- *
- * Encoding of surfaces with per-pixel alpha:
- *
- * The sequence begins with a struct RLEDestFormat describing the target
- * pixel format, to provide reliable un-encoding.
- *
- * Each scan line is encoded twice: First all completely opaque pixels,
- * encoded in the target format as described above, and then all
- * partially transparent (translucent) pixels (where 1 <= alpha <= 254),
- * in the following 32-bit format:
- *
- * For 32-bit targets, each pixel has the target RGB format but with
- * the alpha value occupying the highest 8 bits. The <skip> and <run>
- * 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.
- * i.e. if the target has the format rrrrrggggggbbbbb,
- * the encoded pixel will be 00000gggggg00000rrrrr0aaaaabbbbb.
- * The <skip> and <run> counts are 8 bit for the opaque lines, 16 bit
- * for the translucent lines. Two padding bytes may be inserted
- * before each translucent line to keep them 32-bit aligned.
- *
- * The end of the sequence is marked by a zero <skip>,<run> pair at the
- * beginning of an opaque line.
- */
-
-#include "SDL_video.h"
-#include "SDL_sysvideo.h"
-#include "SDL_blit.h"
-#include "SDL_RLEaccel_c.h"
-
-#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && SDL_ASSEMBLY_ROUTINES
-#define MMX_ASMBLIT
-#endif
-
-#ifdef MMX_ASMBLIT
-#include "mmx.h"
-#include "SDL_cpuinfo.h"
-#endif
-
-#ifndef MAX
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
-#endif
-#ifndef MIN
-#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)
-
-/*
- * Various colorkey blit methods, for opaque and per-surface alpha
- */
-
-#define OPAQUE_BLIT(to, from, length, bpp, alpha) \
- PIXEL_COPY(to, from, length, bpp)
-
-#ifdef MMX_ASMBLIT
-
-#define ALPHA_BLIT32_888MMX(to, from, length, bpp, alpha) \
- do { \
- Uint32 *srcp = (Uint32 *)(from); \
- Uint32 *dstp = (Uint32 *)(to); \
- int i = 0x00FF00FF; \
- movd_m2r(*(&i), mm3); \
- punpckldq_r2r(mm3, mm3); \
- i = 0xFF000000; \
- movd_m2r(*(&i), mm7); \
- punpckldq_r2r(mm7, mm7); \
- i = alpha | alpha << 16; \
- movd_m2r(*(&i), mm4); \
- punpckldq_r2r(mm4, mm4); \
- pcmpeqd_r2r(mm5,mm5); /* set mm5 to "1" */ \
- pxor_r2r(mm7, mm5); /* make clear alpha mask */ \
- i = length; \
- if(i & 1) { \
- movd_m2r((*srcp), mm1); /* src -> mm1 */ \
- punpcklbw_r2r(mm1, mm1); \
- pand_r2r(mm3, mm1); \
- movd_m2r((*dstp), mm2); /* dst -> mm2 */ \
- punpcklbw_r2r(mm2, mm2); \
- pand_r2r(mm3, mm2); \
- psubw_r2r(mm2, mm1); \
- pmullw_r2r(mm4, mm1); \
- psrlw_i2r(8, mm1); \
- paddw_r2r(mm1, mm2); \
- pand_r2r(mm3, mm2); \
- packuswb_r2r(mm2, mm2); \
- pand_r2r(mm5, mm2); /* 00000RGB -> mm2 */ \
- movd_r2m(mm2, *dstp); \
- ++srcp; \
- ++dstp; \
- i--; \
- } \
- for(; i > 0; --i) { \
- movq_m2r((*srcp), mm0); \
- movq_r2r(mm0, mm1); \
- punpcklbw_r2r(mm0, mm0); \
- movq_m2r((*dstp), mm2); \
- punpckhbw_r2r(mm1, mm1); \
- movq_r2r(mm2, mm6); \
- pand_r2r(mm3, mm0); \
- punpcklbw_r2r(mm2, mm2); \
- pand_r2r(mm3, mm1); \
- punpckhbw_r2r(mm6, mm6); \
- pand_r2r(mm3, mm2); \
- psubw_r2r(mm2, mm0); \
- pmullw_r2r(mm4, mm0); \
- pand_r2r(mm3, mm6); \
- psubw_r2r(mm6, mm1); \
- pmullw_r2r(mm4, mm1); \
- psrlw_i2r(8, mm0); \
- paddw_r2r(mm0, mm2); \
- psrlw_i2r(8, mm1); \
- paddw_r2r(mm1, mm6); \
- pand_r2r(mm3, mm2); \
- pand_r2r(mm3, mm6); \
- packuswb_r2r(mm2, mm2); \
- packuswb_r2r(mm6, mm6); \
- psrlq_i2r(32, mm2); \
- psllq_i2r(32, mm6); \
- por_r2r(mm6, mm2); \
- pand_r2r(mm5, mm2); /* 00000RGB -> mm2 */ \
- movq_r2m(mm2, *dstp); \
- srcp += 2; \
- dstp += 2; \
- i--; \
- } \
- emms(); \
- } while(0)
-
-#define ALPHA_BLIT16_565MMX(to, from, length, bpp, alpha) \
- do { \
- int i, n = 0; \
- Uint16 *srcp = (Uint16 *)(from); \
- Uint16 *dstp = (Uint16 *)(to); \
- Uint32 ALPHA = 0xF800; \
- movd_m2r(*(&ALPHA), mm1); \
- punpcklwd_r2r(mm1, mm1); \
- punpcklwd_r2r(mm1, mm1); \
- ALPHA = 0x07E0; \
- movd_m2r(*(&ALPHA), mm4); \
- punpcklwd_r2r(mm4, mm4); \
- punpcklwd_r2r(mm4, mm4); \
- ALPHA = 0x001F; \
- movd_m2r(*(&ALPHA), mm7); \
- punpcklwd_r2r(mm7, mm7); \
- punpcklwd_r2r(mm7, mm7); \
- alpha &= ~(1+2+4); \
- i = (Uint32)alpha | (Uint32)alpha << 16; \
- movd_m2r(*(&i), mm0); \
- punpckldq_r2r(mm0, mm0); \
- ALPHA = alpha >> 3; \
- i = ((int)(length) & 3); \
- for(; i > 0; --i) { \
- Uint32 s = *srcp++; \
- Uint32 d = *dstp; \
- s = (s | s << 16) & 0x07e0f81f; \
- d = (d | d << 16) & 0x07e0f81f; \
- d += (s - d) * ALPHA >> 5; \
- d &= 0x07e0f81f; \
- *dstp++ = d | d >> 16; \
- n++; \
- } \
- i = (int)(length) - n; \
- for(; i > 0; --i) { \
- movq_m2r((*dstp), mm3); \
- movq_m2r((*srcp), mm2); \
- movq_r2r(mm2, mm5); \
- pand_r2r(mm1 , mm5); \
- psrlq_i2r(11, mm5); \
- movq_r2r(mm3, mm6); \
- pand_r2r(mm1 , mm6); \
- psrlq_i2r(11, mm6); \
- psubw_r2r(mm6, mm5); \
- pmullw_r2r(mm0, mm5); \
- psrlw_i2r(8, mm5); \
- paddw_r2r(mm5, mm6); \
- psllq_i2r(11, mm6); \
- pand_r2r(mm1, mm6); \
- movq_r2r(mm4, mm5); \
- por_r2r(mm7, mm5); \
- pand_r2r(mm5, mm3); \
- por_r2r(mm6, mm3); \
- movq_r2r(mm2, mm5); \
- pand_r2r(mm4 , mm5); \
- psrlq_i2r(5, mm5); \
- movq_r2r(mm3, mm6); \
- pand_r2r(mm4 , mm6); \
- psrlq_i2r(5, mm6); \
- psubw_r2r(mm6, mm5); \
- pmullw_r2r(mm0, mm5); \
- psrlw_i2r(8, mm5); \
- paddw_r2r(mm5, mm6); \
- psllq_i2r(5, mm6); \
- pand_r2r(mm4, mm6); \
- movq_r2r(mm1, mm5); \
- por_r2r(mm7, mm5); \
- pand_r2r(mm5, mm3); \
- por_r2r(mm6, mm3); \
- movq_r2r(mm2, mm5); \
- pand_r2r(mm7 , mm5); \
- movq_r2r(mm3, mm6); \
- pand_r2r(mm7 , mm6); \
- psubw_r2r(mm6, mm5); \
- pmullw_r2r(mm0, mm5); \
- psrlw_i2r(8, mm5); \
- paddw_r2r(mm5, mm6); \
- pand_r2r(mm7, mm6); \
- movq_r2r(mm1, mm5); \
- por_r2r(mm4, mm5); \
- pand_r2r(mm5, mm3); \
- por_r2r(mm6, mm3); \
- movq_r2m(mm3, *dstp); \
- srcp += 4; \
- dstp += 4; \
- i -= 3; \
- } \
- emms(); \
- } while(0)
-
-#define ALPHA_BLIT16_555MMX(to, from, length, bpp, alpha) \
- do { \
- int i, n = 0; \
- Uint16 *srcp = (Uint16 *)(from); \
- Uint16 *dstp = (Uint16 *)(to); \
- Uint32 ALPHA = 0x7C00; \
- movd_m2r(*(&ALPHA), mm1); \
- punpcklwd_r2r(mm1, mm1); \
- punpcklwd_r2r(mm1, mm1); \
- ALPHA = 0x03E0; \
- movd_m2r(*(&ALPHA), mm4); \
- punpcklwd_r2r(mm4, mm4); \
- punpcklwd_r2r(mm4, mm4); \
- ALPHA = 0x001F; \
- movd_m2r(*(&ALPHA), mm7); \
- punpcklwd_r2r(mm7, mm7); \
- punpcklwd_r2r(mm7, mm7); \
- alpha &= ~(1+2+4); \
- i = (Uint32)alpha | (Uint32)alpha << 16; \
- movd_m2r(*(&i), mm0); \
- punpckldq_r2r(mm0, mm0); \
- i = ((int)(length) & 3); \
- ALPHA = alpha >> 3; \
- for(; i > 0; --i) { \
- Uint32 s = *srcp++; \
- Uint32 d = *dstp; \
- s = (s | s << 16) & 0x03e07c1f; \
- d = (d | d << 16) & 0x03e07c1f; \
- d += (s - d) * ALPHA >> 5; \
- d &= 0x03e07c1f; \
- *dstp++ = d | d >> 16; \
- n++; \
- } \
- i = (int)(length) - n; \
- for(; i > 0; --i) { \
- movq_m2r((*dstp), mm3); \
- movq_m2r((*srcp), mm2); \
- movq_r2r(mm2, mm5); \
- pand_r2r(mm1 , mm5); \
- psrlq_i2r(10, mm5); \
- movq_r2r(mm3, mm6); \
- pand_r2r(mm1 , mm6); \
- psrlq_i2r(10, mm6); \
- psubw_r2r(mm6, mm5); \
- pmullw_r2r(mm0, mm5); \
- psrlw_i2r(8, mm5); \
- paddw_r2r(mm5, mm6); \
- psllq_i2r(10, mm6); \
- pand_r2r(mm1, mm6); \
- movq_r2r(mm4, mm5); \
- por_r2r(mm7, mm5); \
- pand_r2r(mm5, mm3); \
- por_r2r(mm6, mm3); \
- movq_r2r(mm2, mm5); \
- pand_r2r(mm4 , mm5); \
- psrlq_i2r(5, mm5); \
- movq_r2r(mm3, mm6); \
- pand_r2r(mm4 , mm6); \
- psrlq_i2r(5, mm6); \
- psubw_r2r(mm6, mm5); \
- pmullw_r2r(mm0, mm5); \
- psrlw_i2r(8, mm5); \
- paddw_r2r(mm5, mm6); \
- psllq_i2r(5, mm6); \
- pand_r2r(mm4, mm6); \
- movq_r2r(mm1, mm5); \
- por_r2r(mm7, mm5); \
- pand_r2r(mm5, mm3); \
- por_r2r(mm6, mm3); \
- movq_r2r(mm2, mm5); \
- pand_r2r(mm7 , mm5); \
- movq_r2r(mm3, mm6); \
- pand_r2r(mm7 , mm6); \
- psubw_r2r(mm6, mm5); \
- pmullw_r2r(mm0, mm5); \
- psrlw_i2r(8, mm5); \
- paddw_r2r(mm5, mm6); \
- pand_r2r(mm7, mm6); \
- movq_r2r(mm1, mm5); \
- por_r2r(mm4, mm5); \
- pand_r2r(mm5, mm3); \
- por_r2r(mm6, mm3); \
- movq_r2m(mm3, *dstp); \
- srcp += 4; \
- dstp += 4; \
- i -= 3; \
- } \
- emms(); \
- } while(0)
-
-#endif
-
-/*
- * For 32bpp pixels on the form 0x00rrggbb:
- * If we treat the middle component separately, we can process the two
- * remaining in parallel. This is safe to do because of the gap to the left
- * 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; \
- } \
- } while(0)
-
-/*
- * For 16bpp pixels we can go a step further: put the middle component
- * in the high 16 bits of a 32 bit word, and process all three RGB
- * 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); \
- } \
- } 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); \
- } \
- } while(0)
-
-/*
- * The general slow catch-all function, for remaining depths and formats
- */
-#define ALPHA_BLIT_ANY(to, from, length, bpp, alpha) \
- do { \
- int i; \
- Uint8 *src = from; \
- Uint8 *dst = to; \
- for(i = 0; i < (int)(length); i++) { \
- Uint32 s, d; \
- unsigned rs, gs, bs, rd, gd, bd; \
- switch(bpp) { \
- case 2: \
- s = *(Uint16 *)src; \
- d = *(Uint16 *)dst; \
- break; \
- case 3: \
- if(SDL_BYTEORDER == SDL_BIG_ENDIAN) { \
- s = (src[0] << 16) | (src[1] << 8) | src[2]; \
- d = (dst[0] << 16) | (dst[1] << 8) | dst[2]; \
- } else { \
- s = (src[2] << 16) | (src[1] << 8) | src[0]; \
- d = (dst[2] << 16) | (dst[1] << 8) | dst[0]; \
- } \
- break; \
- case 4: \
- s = *(Uint32 *)src; \
- d = *(Uint32 *)dst; \
- break; \
- } \
- RGB_FROM_PIXEL(s, fmt, rs, gs, bs); \
- RGB_FROM_PIXEL(d, fmt, rd, gd, bd); \
- rd += (rs - rd) * alpha >> 8; \
- gd += (gs - gd) * alpha >> 8; \
- bd += (bs - bd) * alpha >> 8; \
- PIXEL_FROM_RGB(d, fmt, rd, gd, bd); \
- switch(bpp) { \
- case 2: \
- *(Uint16 *)dst = (Uint16)d; \
- break; \
- case 3: \
- if(SDL_BYTEORDER == SDL_BIG_ENDIAN) { \
- dst[0] = (Uint8)(d >> 16); \
- dst[1] = (Uint8)(d >> 8); \
- dst[2] = (Uint8)(d); \
- } else { \
- dst[0] = (Uint8)d; \
- dst[1] = (Uint8)(d >> 8); \
- dst[2] = (Uint8)(d >> 16); \
- } \
- break; \
- case 4: \
- *(Uint32 *)dst = d; \
- break; \
- } \
- src += bpp; \
- dst += bpp; \
- } \
- } while(0)
-
-#ifdef MMX_ASMBLIT
-
-#define ALPHA_BLIT32_888_50MMX(to, from, length, bpp, alpha) \
- do { \
- Uint32 *srcp = (Uint32 *)(from); \
- Uint32 *dstp = (Uint32 *)(to); \
- int i = 0x00fefefe; \
- movd_m2r(*(&i), mm4); \
- punpckldq_r2r(mm4, mm4); \
- i = 0x00010101; \
- movd_m2r(*(&i), mm3); \
- punpckldq_r2r(mm3, mm3); \
- i = (int)(length); \
- if( i & 1 ) { \
- Uint32 s = *srcp++; \
- Uint32 d = *dstp; \
- *dstp++ = (((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1) \
- + (s & d & 0x00010101); \
- i--; \
- } \
- for(; i > 0; --i) { \
- movq_m2r((*dstp), mm2); /* dst -> mm2 */ \
- movq_r2r(mm2, mm6); /* dst -> mm6 */ \
- movq_m2r((*srcp), mm1); /* src -> mm1 */ \
- movq_r2r(mm1, mm5); /* src -> mm5 */ \
- pand_r2r(mm4, mm6); /* dst & 0x00fefefe -> mm6 */ \
- pand_r2r(mm4, mm5); /* src & 0x00fefefe -> mm5 */ \
- paddd_r2r(mm6, mm5); /* (dst & 0x00fefefe) + (dst & 0x00fefefe) -> mm5 */ \
- psrld_i2r(1, mm5); \
- pand_r2r(mm1, mm2); /* s & d -> mm2 */ \
- pand_r2r(mm3, mm2); /* s & d & 0x00010101 -> mm2 */ \
- paddd_r2r(mm5, mm2); \
- movq_r2m(mm2, (*dstp)); \
- dstp += 2; \
- srcp += 2; \
- i--; \
- } \
- emms(); \
- } while(0)
-
-#endif
-
-/*
- * Special case: 50% alpha (alpha=128)
- * This is treated specially because it can be optimized very well, and
- * since it is good for many cases of semi-translucency.
- * The theory is to do all three components at the same time:
- * 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); \
- } \
- } while(0)
-
-/*
- * For 16bpp, we can actually blend two pixels in parallel, if we take
- * care to shift before we add, not after.
- */
-
-/* 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))); \
- } 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 */ \
- } \
- } while(0)
-
-#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) \
- ALPHA_BLIT16_50(to, from, length, bpp, alpha, 0xfbde)
-
-#ifdef MMX_ASMBLIT
-
-#define CHOOSE_BLIT(blitter, alpha, fmt) \
- do { \
- if(alpha == 255) { \
- switch(fmt->BytesPerPixel) { \
- case 1: blitter(1, Uint8, OPAQUE_BLIT); break; \
- case 2: blitter(2, Uint8, OPAQUE_BLIT); break; \
- case 3: blitter(3, Uint8, OPAQUE_BLIT); break; \
- case 4: blitter(4, Uint16, OPAQUE_BLIT); break; \
- } \
- } else { \
- switch(fmt->BytesPerPixel) { \
- case 1: \
- /* No 8bpp alpha blitting */ \
- break; \
- \
- case 2: \
- switch(fmt->Rmask | fmt->Gmask | fmt->Bmask) { \
- case 0xffff: \
- if(fmt->Gmask == 0x07e0 \
- || fmt->Rmask == 0x07e0 \
- || fmt->Bmask == 0x07e0) { \
- if(alpha == 128) \
- blitter(2, Uint8, ALPHA_BLIT16_565_50); \
- else { \
- if(SDL_HasMMX()) \
- blitter(2, Uint8, ALPHA_BLIT16_565MMX); \
- else \
- blitter(2, Uint8, ALPHA_BLIT16_565); \
- } \
- } else \
- goto general16; \
- break; \
- \
- case 0x7fff: \
- if(fmt->Gmask == 0x03e0 \
- || fmt->Rmask == 0x03e0 \
- || fmt->Bmask == 0x03e0) { \
- if(alpha == 128) \
- blitter(2, Uint8, ALPHA_BLIT16_555_50); \
- else { \
- if(SDL_HasMMX()) \
- blitter(2, Uint8, ALPHA_BLIT16_555MMX); \
- else \
- blitter(2, Uint8, ALPHA_BLIT16_555); \
- } \
- break; \
- } \
- /* fallthrough */ \
- \
- default: \
- general16: \
- blitter(2, Uint8, ALPHA_BLIT_ANY); \
- } \
- break; \
- \
- case 3: \
- blitter(3, Uint8, ALPHA_BLIT_ANY); \
- break; \
- \
- case 4: \
- if((fmt->Rmask | fmt->Gmask | fmt->Bmask) == 0x00ffffff \
- && (fmt->Gmask == 0xff00 || fmt->Rmask == 0xff00 \
- || fmt->Bmask == 0xff00)) { \
- if(alpha == 128) \
- { \
- if(SDL_HasMMX()) \
- blitter(4, Uint16, ALPHA_BLIT32_888_50MMX);\
- else \
- blitter(4, Uint16, ALPHA_BLIT32_888_50);\
- } \
- else \
- { \
- if(SDL_HasMMX()) \
- blitter(4, Uint16, ALPHA_BLIT32_888MMX);\
- else \
- blitter(4, Uint16, ALPHA_BLIT32_888); \
- } \
- } else \
- blitter(4, Uint16, ALPHA_BLIT_ANY); \
- break; \
- } \
- } \
- } while(0)
-
-#else
-
-#define CHOOSE_BLIT(blitter, alpha, fmt) \
- do { \
- if(alpha == 255) { \
- switch(fmt->BytesPerPixel) { \
- case 1: blitter(1, Uint8, OPAQUE_BLIT); break; \
- case 2: blitter(2, Uint8, OPAQUE_BLIT); break; \
- case 3: blitter(3, Uint8, OPAQUE_BLIT); break; \
- case 4: blitter(4, Uint16, OPAQUE_BLIT); break; \
- } \
- } else { \
- switch(fmt->BytesPerPixel) { \
- case 1: \
- /* No 8bpp alpha blitting */ \
- break; \
- \
- case 2: \
- switch(fmt->Rmask | fmt->Gmask | fmt->Bmask) { \
- case 0xffff: \
- if(fmt->Gmask == 0x07e0 \
- || fmt->Rmask == 0x07e0 \
- || fmt->Bmask == 0x07e0) { \
- if(alpha == 128) \
- blitter(2, Uint8, ALPHA_BLIT16_565_50); \
- else { \
- blitter(2, Uint8, ALPHA_BLIT16_565); \
- } \
- } else \
- goto general16; \
- break; \
- \
- case 0x7fff: \
- if(fmt->Gmask == 0x03e0 \
- || fmt->Rmask == 0x03e0 \
- || fmt->Bmask == 0x03e0) { \
- if(alpha == 128) \
- blitter(2, Uint8, ALPHA_BLIT16_555_50); \
- else { \
- blitter(2, Uint8, ALPHA_BLIT16_555); \
- } \
- break; \
- } \
- /* fallthrough */ \
- \
- default: \
- general16: \
- blitter(2, Uint8, ALPHA_BLIT_ANY); \
- } \
- break; \
- \
- case 3: \
- blitter(3, Uint8, ALPHA_BLIT_ANY); \
- break; \
- \
- case 4: \
- if((fmt->Rmask | fmt->Gmask | fmt->Bmask) == 0x00ffffff \
- && (fmt->Gmask == 0xff00 || fmt->Rmask == 0xff00 \
- || fmt->Bmask == 0xff00)) { \
- if(alpha == 128) \
- blitter(4, Uint16, ALPHA_BLIT32_888_50); \
- else \
- blitter(4, Uint16, ALPHA_BLIT32_888); \
- } else \
- blitter(4, Uint16, ALPHA_BLIT_ANY); \
- break; \
- } \
- } \
- } while(0)
-
-#endif
-
-/*
- * This takes care of the case when the surface is clipped on the left and/or
- * right. Top clipping has already been taken care of.
- */
-static void RLEClipBlit(int w, Uint8 *srcbuf, SDL_Surface *dst,
- Uint8 *dstbuf, SDL_Rect *srcrect, unsigned alpha)
-{
- 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; \
- } \
- } \
- } while(0)
-
- CHOOSE_BLIT(RLECLIPBLIT, alpha, fmt);
-
-#undef RLECLIPBLIT
-
-}
-
-
-/* blit a colorkeyed RLE surface */
-int SDL_RLEBlit(SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect)
-{
- Uint8 *dstbuf;
- Uint8 *srcbuf;
- int x, y;
- int w = src->w;
- unsigned alpha;
-
- /* Lock the destination if necessary */
- if ( SDL_MUSTLOCK(dst) ) {
- if ( SDL_LockSurface(dst) < 0 ) {
- return(-1);
- }
- }
-
- /* Set up the source and destination pointers */
- x = dstrect->x;
- y = dstrect->y;
- dstbuf = (Uint8 *)dst->pixels
- + y * dst->pitch + x * src->format->BytesPerPixel;
- srcbuf = (Uint8 *)src->map->sw_data->aux_data;
-
- {
- /* skip lines at the top if neccessary */
- int vskip = srcrect->y;
- int ofs = 0;
- if(vskip) {
-
-#define RLESKIP(bpp, Type) \
- for(;;) { \
- int run; \
- ofs += *(Type *)srcbuf; \
- run = ((Type *)srcbuf)[1]; \
- srcbuf += sizeof(Type) * 2; \
- if(run) { \
- srcbuf += run * bpp; \
- ofs += run; \
- } else if(!ofs) \
- goto done; \
- if(ofs == w) { \
- ofs = 0; \
- if(!--vskip) \
- break; \
- } \
- }
-
- switch(src->format->BytesPerPixel) {
- case 1: RLESKIP(1, Uint8); break;
- case 2: RLESKIP(2, Uint8); break;
- case 3: RLESKIP(3, Uint8); break;
- case 4: RLESKIP(4, Uint16); break;
- }
-
-#undef RLESKIP
-
- }
- }
-
- alpha = (src->flags & SDL_SRCALPHA) == SDL_SRCALPHA
- ? src->format->alpha : 255;
- /* if left or right edge clipping needed, call clip blit */
- if ( srcrect->x || srcrect->w != src->w ) {
- RLEClipBlit(w, srcbuf, dst, dstbuf, srcrect, alpha);
- } else {
- SDL_PixelFormat *fmt = src->format;
-
-#define RLEBLIT(bpp, Type, do_blit) \
- do { \
- int linecount = srcrect->h; \
- int ofs = 0; \
- for(;;) { \
- unsigned run; \
- ofs += *(Type *)srcbuf; \
- run = ((Type *)srcbuf)[1]; \
- srcbuf += 2 * sizeof(Type); \
- if(run) { \
- do_blit(dstbuf + ofs * bpp, srcbuf, run, bpp, alpha); \
- srcbuf += run * bpp; \
- ofs += run; \
- } else if(!ofs) \
- break; \
- if(ofs == w) { \
- ofs = 0; \
- dstbuf += dst->pitch; \
- if(!--linecount) \
- break; \
- } \
- } \
- } while(0)
-
- CHOOSE_BLIT(RLEBLIT, alpha, fmt);
-
-#undef RLEBLIT
- }
-
-done:
- /* Unlock the destination if necessary */
- if ( SDL_MUSTLOCK(dst) ) {
- SDL_UnlockSurface(dst);
- }
- return(0);
-}
-
-#undef OPAQUE_BLIT
-
-/*
- * Per-pixel blitting macros for translucent pixels:
- * These use the same techniques as the per-surface blitting macros
- */
-
-/*
- * 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; \
- } 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); \
- } 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); \
- } while(0)
-
-/* used to save the destination format in the encoding. Designed to be
- macro-compatible with SDL_PixelFormat but without the unneeded fields */
-typedef struct {
- Uint8 BytesPerPixel;
- Uint8 Rloss;
- Uint8 Gloss;
- Uint8 Bloss;
- Uint8 Rshift;
- Uint8 Gshift;
- Uint8 Bshift;
- Uint8 Ashift;
- Uint32 Rmask;
- Uint32 Gmask;
- Uint32 Bmask;
- Uint32 Amask;
-} RLEDestFormat;
-
-/* blit a pixel-alpha RLE surface clipped at the right and/or left edges */
-static void RLEAlphaClipBlit(int w, Uint8 *srcbuf, SDL_Surface *dst,
- Uint8 *dstbuf, SDL_Rect *srcrect)
-{
- SDL_PixelFormat *df = dst->format;
- /*
- * clipped blitter: Ptype is the destination pixel type,
- * 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); \
- } while(0)
-
- switch(df->BytesPerPixel) {
- case 2:
- if(df->Gmask == 0x07e0 || df->Rmask == 0x07e0
- || df->Bmask == 0x07e0)
- RLEALPHACLIPBLIT(Uint16, Uint8, BLIT_TRANSL_565);
- else
- RLEALPHACLIPBLIT(Uint16, Uint8, BLIT_TRANSL_555);
- break;
- case 4:
- RLEALPHACLIPBLIT(Uint32, Uint16, BLIT_TRANSL_888);
- break;
- }
-}
-
-/* blit a pixel-alpha RLE surface */
-int SDL_RLEAlphaBlit(SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect)
-{
- int x, y;
- int w = src->w;
- Uint8 *srcbuf, *dstbuf;
- SDL_PixelFormat *df = dst->format;
-
- /* Lock the destination if necessary */
- if ( SDL_MUSTLOCK(dst) ) {
- if ( SDL_LockSurface(dst) < 0 ) {
- return -1;
- }
- }
-
- x = dstrect->x;
- y = dstrect->y;
- dstbuf = (Uint8 *)dst->pixels
- + y * dst->pitch + x * df->BytesPerPixel;
- srcbuf = (Uint8 *)src->map->sw_data->aux_data + sizeof(RLEDestFormat);
-
- {
- /* skip lines at the top if necessary */
- int vskip = srcrect->y;
- if(vskip) {
- int ofs;
- if(df->BytesPerPixel == 2) {
- /* the 16/32 interleaved format */
- do {
- /* skip opaque line */
- ofs = 0;
- do {
- int run;
- ofs += srcbuf[0];
- run = srcbuf[1];
- srcbuf += 2;
- if(run) {
- srcbuf += 2 * run;
- ofs += run;
- } else if(!ofs)
- goto done;
- } while(ofs < w);
-
- /* skip padding */
- srcbuf += (uintptr_t)srcbuf & 2;
-
- /* skip translucent line */
- ofs = 0;
- do {
- int run;
- ofs += ((Uint16 *)srcbuf)[0];
- run = ((Uint16 *)srcbuf)[1];
- srcbuf += 4 * (run + 1);
- ofs += run;
- } while(ofs < w);
- } while(--vskip);
- } else {
- /* the 32/32 interleaved format */
- vskip <<= 1; /* opaque and translucent have same format */
- do {
- ofs = 0;
- do {
- int run;
- ofs += ((Uint16 *)srcbuf)[0];
- run = ((Uint16 *)srcbuf)[1];
- srcbuf += 4;
- if(run) {
- srcbuf += 4 * run;
- ofs += run;
- } else if(!ofs)
- goto done;
- } while(ofs < w);
- } while(--vskip);
- }
- }
- }
-
- /* if left or right edge clipping needed, call clip blit */
- if(srcrect->x || srcrect->w != src->w) {
- RLEAlphaClipBlit(w, srcbuf, dst, dstbuf, srcrect);
- } else {
-
- /*
- * non-clipped blitter. Ptype is the destination pixel type,
- * Ctype the translucent count type, and do_blend the
- * macro to blend one pixel.
- */
-#define RLEALPHABLIT(Ptype, Ctype, do_blend) \
- do { \
- int linecount = srcrect->h; \
- do { \
- int ofs = 0; \
- /* blit opaque pixels on one line */ \
- do { \
- unsigned run; \
- ofs += ((Ctype *)srcbuf)[0]; \
- run = ((Ctype *)srcbuf)[1]; \
- srcbuf += 2 * sizeof(Ctype); \
- if(run) { \
- PIXEL_COPY(dstbuf + ofs * sizeof(Ptype), srcbuf, \
- run, sizeof(Ptype)); \
- srcbuf += run * sizeof(Ptype); \
- ofs += run; \
- } else if(!ofs) \
- goto done; \
- } while(ofs < w); \
- /* skip padding if necessary */ \
- if(sizeof(Ptype) == 2) \
- srcbuf += (uintptr_t)srcbuf & 2; \
- /* blit translucent pixels on the same line */ \
- ofs = 0; \
- do { \
- unsigned run; \
- ofs += ((Uint16 *)srcbuf)[0]; \
- run = ((Uint16 *)srcbuf)[1]; \
- srcbuf += 4; \
- if(run) { \
- Ptype *dst = (Ptype *)dstbuf + ofs; \
- unsigned i; \
- for(i = 0; i < run; i++) { \
- Uint32 src = *(Uint32 *)srcbuf; \
- do_blend(src, *dst); \
- srcbuf += 4; \
- dst++; \
- } \
- ofs += run; \
- } \
- } while(ofs < w); \
- dstbuf += dst->pitch; \
- } while(--linecount); \
- } while(0)
-
- switch(df->BytesPerPixel) {
- case 2:
- if(df->Gmask == 0x07e0 || df->Rmask == 0x07e0
- || df->Bmask == 0x07e0)
- RLEALPHABLIT(Uint16, Uint8, BLIT_TRANSL_565);
- else
- RLEALPHABLIT(Uint16, Uint8, BLIT_TRANSL_555);
- break;
- case 4:
- RLEALPHABLIT(Uint32, Uint16, BLIT_TRANSL_888);
- break;
- }
- }
-
- done:
- /* Unlock the destination if necessary */
- if ( SDL_MUSTLOCK(dst) ) {
- SDL_UnlockSurface(dst);
- }
- return 0;
-}
-
-/*
- * Auxiliary functions:
- * The encoding functions take 32bpp rgb + a, and
- * return the number of bytes copied to the destination.
- * The decoding functions copy to 32bpp rgb + a, and
- * return the number of bytes copied from the source.
- * These are only used in the encoder and un-RLE code and are therefore not
- * highly optimised.
- */
-
-/* encode 32bpp rgb + a into 16bpp rgb, losing alpha */
-static int copy_opaque_16(void *dst, Uint32 *src, int n,
- SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt)
-{
- int i;
- Uint16 *d = dst;
- for(i = 0; i < n; i++) {
- unsigned r, g, b;
- RGB_FROM_PIXEL(*src, sfmt, r, g, b);
- PIXEL_FROM_RGB(*d, dfmt, r, g, b);
- src++;
- d++;
- }
- return n * 2;
-}
-
-/* decode opaque pixels from 16bpp to 32bpp rgb + a */
-static int uncopy_opaque_16(Uint32 *dst, void *src, int n,
- RLEDestFormat *sfmt, SDL_PixelFormat *dfmt)
-{
- int i;
- Uint16 *s = src;
- unsigned alpha = dfmt->Amask ? 255 : 0;
- for(i = 0; i < n; i++) {
- unsigned r, g, b;
- RGB_FROM_PIXEL(*s, sfmt, r, g, b);
- PIXEL_FROM_RGBA(*dst, dfmt, r, g, b, alpha);
- s++;
- dst++;
- }
- return n * 2;
-}
-
-
-
-/* encode 32bpp rgb + a into 32bpp G0RAB format for blitting into 565 */
-static int copy_transl_565(void *dst, Uint32 *src, int n,
- SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt)
-{
- int i;
- Uint32 *d = dst;
- for(i = 0; i < n; i++) {
- unsigned r, g, b, a;
- Uint16 pix;
- RGBA_FROM_8888(*src, sfmt, r, g, b, a);
- PIXEL_FROM_RGB(pix, dfmt, r, g, b);
- *d = ((pix & 0x7e0) << 16) | (pix & 0xf81f) | ((a << 2) & 0x7e0);
- src++;
- d++;
- }
- return n * 4;
-}
-
-/* encode 32bpp rgb + a into 32bpp G0RAB format for blitting into 555 */
-static int copy_transl_555(void *dst, Uint32 *src, int n,
- SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt)
-{
- int i;
- Uint32 *d = dst;
- for(i = 0; i < n; i++) {
- unsigned r, g, b, a;
- Uint16 pix;
- RGBA_FROM_8888(*src, sfmt, r, g, b, a);
- PIXEL_FROM_RGB(pix, dfmt, r, g, b);
- *d = ((pix & 0x3e0) << 16) | (pix & 0xfc1f) | ((a << 2) & 0x3e0);
- src++;
- d++;
- }
- return n * 4;
-}
-
-/* decode translucent pixels from 32bpp GORAB to 32bpp rgb + a */
-static int uncopy_transl_16(Uint32 *dst, void *src, int n,
- RLEDestFormat *sfmt, SDL_PixelFormat *dfmt)
-{
- int i;
- Uint32 *s = src;
- for(i = 0; i < n; i++) {
- unsigned r, g, b, a;
- Uint32 pix = *s++;
- a = (pix & 0x3e0) >> 2;
- pix = (pix & ~0x3e0) | pix >> 16;
- RGB_FROM_PIXEL(pix, sfmt, r, g, b);
- PIXEL_FROM_RGBA(*dst, dfmt, r, g, b, a);
- dst++;
- }
- return n * 4;
-}
-
-/* encode 32bpp rgba into 32bpp rgba, keeping alpha (dual purpose) */
-static int copy_32(void *dst, Uint32 *src, int n,
- SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt)
-{
- int i;
- Uint32 *d = dst;
- for(i = 0; i < n; i++) {
- unsigned r, g, b, a;
- Uint32 pixel;
- RGBA_FROM_8888(*src, sfmt, r, g, b, a);
- PIXEL_FROM_RGB(pixel, dfmt, r, g, b);
- *d++ = pixel | a << 24;
- src++;
- }
- return n * 4;
-}
-
-/* decode 32bpp rgba into 32bpp rgba, keeping alpha (dual purpose) */
-static int uncopy_32(Uint32 *dst, void *src, int n,
- RLEDestFormat *sfmt, SDL_PixelFormat *dfmt)
-{
- int i;
- Uint32 *s = src;
- for(i = 0; i < n; i++) {
- unsigned r, g, b, a;
- Uint32 pixel = *s++;
- RGB_FROM_PIXEL(pixel, sfmt, r, g, b);
- a = pixel >> 24;
- PIXEL_FROM_RGBA(*dst, dfmt, r, g, b, a);
- dst++;
- }
- return n * 4;
-}
-
-#define ISOPAQUE(pixel, fmt) ((((pixel) & fmt->Amask) >> fmt->Ashift) == 255)
-
-#define ISTRANSL(pixel, fmt) \
- ((unsigned)((((pixel) & fmt->Amask) >> fmt->Ashift) - 1U) < 254U)
-
-/* convert surface to be quickly alpha-blittable onto dest, if possible */
-static int RLEAlphaSurface(SDL_Surface *surface)
-{
- SDL_Surface *dest;
- SDL_PixelFormat *df;
- int maxsize = 0;
- int max_opaque_run;
- int max_transl_run = 65535;
- unsigned masksum;
- Uint8 *rlebuf, *dst;
- int (*copy_opaque)(void *, Uint32 *, int,
- SDL_PixelFormat *, SDL_PixelFormat *);
- int (*copy_transl)(void *, Uint32 *, int,
- SDL_PixelFormat *, SDL_PixelFormat *);
-
- dest = surface->map->dst;
- if(!dest)
- return -1;
- df = dest->format;
- if(surface->format->BitsPerPixel != 32)
- return -1; /* only 32bpp source supported */
-
- /* find out whether the destination is one we support,
- and determine the max size of the encoded result */
- masksum = df->Rmask | df->Gmask | df->Bmask;
- switch(df->BytesPerPixel) {
- case 2:
- /* 16bpp: only support 565 and 555 formats */
- switch(masksum) {
- case 0xffff:
- if(df->Gmask == 0x07e0
- || df->Rmask == 0x07e0 || df->Bmask == 0x07e0) {
- copy_opaque = copy_opaque_16;
- copy_transl = copy_transl_565;
- } else
- return -1;
- break;
- case 0x7fff:
- if(df->Gmask == 0x03e0
- || df->Rmask == 0x03e0 || df->Bmask == 0x03e0) {
- copy_opaque = copy_opaque_16;
- copy_transl = copy_transl_555;
- } else
- return -1;
- break;
- default:
- return -1;
- }
- max_opaque_run = 255; /* runs stored as bytes */
-
- /* worst case is alternating opaque and translucent pixels,
- with room for alignment padding between lines */
- maxsize = surface->h * (2 + (4 + 2) * (surface->w + 1)) + 2;
- break;
- case 4:
- if(masksum != 0x00ffffff)
- return -1; /* requires unused high byte */
- copy_opaque = copy_32;
- copy_transl = copy_32;
- max_opaque_run = 255; /* runs stored as short ints */
-
- /* worst case is alternating opaque and translucent pixels */
- maxsize = surface->h * 2 * 4 * (surface->w + 1) + 4;
- break;
- default:
- return -1; /* anything else unsupported right now */
- }
-
- maxsize += sizeof(RLEDestFormat);
- rlebuf = (Uint8 *)SDL_malloc(maxsize);
- if(!rlebuf) {
- SDL_OutOfMemory();
- return -1;
- }
- {
- /* save the destination format so we can undo the encoding later */
- RLEDestFormat *r = (RLEDestFormat *)rlebuf;
- r->BytesPerPixel = df->BytesPerPixel;
- r->Rloss = df->Rloss;
- r->Gloss = df->Gloss;
- r->Bloss = df->Bloss;
- r->Rshift = df->Rshift;
- r->Gshift = df->Gshift;
- r->Bshift = df->Bshift;
- r->Ashift = df->Ashift;
- r->Rmask = df->Rmask;
- r->Gmask = df->Gmask;
- r->Bmask = df->Bmask;
- r->Amask = df->Amask;
- }
- dst = rlebuf + sizeof(RLEDestFormat);
-
- /* Do the actual encoding */
- {
- int x, y;
- int h = surface->h, w = surface->w;
- SDL_PixelFormat *sf = surface->format;
- Uint32 *src = (Uint32 *)surface->pixels;
- Uint8 *lastline = dst; /* end of last non-blank line */
-
- /* opaque counts are 8 or 16 bits, depending on target depth */
-#define ADD_OPAQUE_COUNTS(n, m) \
- if(df->BytesPerPixel == 4) { \
- ((Uint16 *)dst)[0] = n; \
- ((Uint16 *)dst)[1] = m; \
- dst += 4; \
- } else { \
- dst[0] = n; \
- dst[1] = m; \
- dst += 2; \
- }
-
- /* translucent counts are always 16 bit */
-#define ADD_TRANSL_COUNTS(n, m) \
- (((Uint16 *)dst)[0] = n, ((Uint16 *)dst)[1] = m, dst += 4)
-
- for(y = 0; y < h; y++) {
- int runstart, skipstart;
- int blankline = 0;
- /* First encode all opaque pixels of a scan line */
- x = 0;
- do {
- int run, skip, len;
- skipstart = x;
- while(x < w && !ISOPAQUE(src[x], sf))
- x++;
- runstart = x;
- while(x < w && ISOPAQUE(src[x], sf))
- x++;
- skip = runstart - skipstart;
- if(skip == w)
- blankline = 1;
- run = x - runstart;
- while(skip > max_opaque_run) {
- ADD_OPAQUE_COUNTS(max_opaque_run, 0);
- skip -= max_opaque_run;
- }
- len = MIN(run, max_opaque_run);
- ADD_OPAQUE_COUNTS(skip, len);
- dst += copy_opaque(dst, src + runstart, len, sf, df);
- runstart += len;
- run -= len;
- while(run) {
- len = MIN(run, max_opaque_run);
- ADD_OPAQUE_COUNTS(0, len);
- dst += copy_opaque(dst, src + runstart, len, sf, df);
- runstart += len;
- run -= len;
- }
- } while(x < w);
-
- /* Make sure the next output address is 32-bit aligned */
- dst += (uintptr_t)dst & 2;
-
- /* Next, encode all translucent pixels of the same scan line */
- x = 0;
- do {
- int run, skip, len;
- skipstart = x;
- while(x < w && !ISTRANSL(src[x], sf))
- x++;
- runstart = x;
- while(x < w && ISTRANSL(src[x], sf))
- x++;
- skip = runstart - skipstart;
- blankline &= (skip == w);
- run = x - runstart;
- while(skip > max_transl_run) {
- ADD_TRANSL_COUNTS(max_transl_run, 0);
- skip -= max_transl_run;
- }
- len = MIN(run, max_transl_run);
- ADD_TRANSL_COUNTS(skip, len);
- dst += copy_transl(dst, src + runstart, len, sf, df);
- runstart += len;
- run -= len;
- while(run) {
- len = MIN(run, max_transl_run);
- ADD_TRANSL_COUNTS(0, len);
- dst += copy_transl(dst, src + runstart, len, sf, df);
- runstart += len;
- run -= len;
- }
- if(!blankline)
- lastline = dst;
- } while(x < w);
-
- src += surface->pitch >> 2;
- }
- dst = lastline; /* back up past trailing blank lines */
- ADD_OPAQUE_COUNTS(0, 0);
- }
-
-#undef ADD_OPAQUE_COUNTS
-#undef ADD_TRANSL_COUNTS
-
- /* Now that we have it encoded, release the original pixels */
- if((surface->flags & SDL_PREALLOC) != SDL_PREALLOC
- && (surface->flags & SDL_HWSURFACE) != SDL_HWSURFACE) {
- SDL_free( surface->pixels );
- surface->pixels = NULL;
- }
-
- /* realloc the buffer to release unused memory */
- {
- Uint8 *p = SDL_realloc(rlebuf, dst - rlebuf);
- if(!p)
- p = rlebuf;
- surface->map->sw_data->aux_data = p;
- }
-
- return 0;
-}
-
-static Uint32 getpix_8(Uint8 *srcbuf)
-{
- return *srcbuf;
-}
-
-static Uint32 getpix_16(Uint8 *srcbuf)
-{
- return *(Uint16 *)srcbuf;
-}
-
-static Uint32 getpix_24(Uint8 *srcbuf)
-{
-#if SDL_BYTEORDER == SDL_LIL_ENDIAN
- return srcbuf[0] + (srcbuf[1] << 8) + (srcbuf[2] << 16);
-#else
- return (srcbuf[0] << 16) + (srcbuf[1] << 8) + srcbuf[2];
-#endif
-}
-
-static Uint32 getpix_32(Uint8 *srcbuf)
-{
- return *(Uint32 *)srcbuf;
-}
-
-typedef Uint32 (*getpix_func)(Uint8 *);
-
-static getpix_func getpixes[4] = {
- getpix_8, getpix_16, getpix_24, getpix_32
-};
-
-static int RLEColorkeySurface(SDL_Surface *surface)
-{
- Uint8 *rlebuf, *dst;
- int maxn;
- int y;
- Uint8 *srcbuf, *curbuf, *lastline;
- int maxsize = 0;
- int skip, run;
- int bpp = surface->format->BytesPerPixel;
- getpix_func getpix;
- Uint32 ckey, rgbmask;
- int w, h;
-
- /* calculate the worst case size for the compressed surface */
- switch(bpp) {
- case 1:
- /* worst case is alternating opaque and transparent pixels,
- starting with an opaque pixel */
- maxsize = surface->h * 3 * (surface->w / 2 + 1) + 2;
- break;
- case 2:
- case 3:
- /* worst case is solid runs, at most 255 pixels wide */
- maxsize = surface->h * (2 * (surface->w / 255 + 1)
- + surface->w * bpp) + 2;
- break;
- case 4:
- /* worst case is solid runs, at most 65535 pixels wide */
- maxsize = surface->h * (4 * (surface->w / 65535 + 1)
- + surface->w * 4) + 4;
- break;
- }
-
- rlebuf = (Uint8 *)SDL_malloc(maxsize);
- if ( rlebuf == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
-
- /* Set up the conversion */
- srcbuf = (Uint8 *)surface->pixels;
- curbuf = srcbuf;
- maxn = bpp == 4 ? 65535 : 255;
- skip = run = 0;
- dst = rlebuf;
- rgbmask = ~surface->format->Amask;
- ckey = surface->format->colorkey & rgbmask;
- lastline = dst;
- getpix = getpixes[bpp - 1];
- w = surface->w;
- h = surface->h;
-
-#define ADD_COUNTS(n, m) \
- if(bpp == 4) { \
- ((Uint16 *)dst)[0] = n; \
- ((Uint16 *)dst)[1] = m; \
- dst += 4; \
- } else { \
- dst[0] = n; \
- dst[1] = m; \
- dst += 2; \
- }
-
- for(y = 0; y < h; y++) {
- int x = 0;
- int blankline = 0;
- do {
- int run, skip, len;
- int runstart;
- int skipstart = x;
-
- /* find run of transparent, then opaque pixels */
- while(x < w && (getpix(srcbuf + x * bpp) & rgbmask) == ckey)
- x++;
- runstart = x;
- while(x < w && (getpix(srcbuf + x * bpp) & rgbmask) != ckey)
- x++;
- skip = runstart - skipstart;
- if(skip == w)
- blankline = 1;
- run = x - runstart;
-
- /* encode segment */
- while(skip > maxn) {
- ADD_COUNTS(maxn, 0);
- skip -= maxn;
- }
- len = MIN(run, maxn);
- ADD_COUNTS(skip, len);
- SDL_memcpy(dst, srcbuf + runstart * bpp, len * bpp);
- dst += len * bpp;
- run -= len;
- runstart += len;
- while(run) {
- len = MIN(run, maxn);
- ADD_COUNTS(0, len);
- SDL_memcpy(dst, srcbuf + runstart * bpp, len * bpp);
- dst += len * bpp;
- runstart += len;
- run -= len;
- }
- if(!blankline)
- lastline = dst;
- } while(x < w);
-
- srcbuf += surface->pitch;
- }
- dst = lastline; /* back up bast trailing blank lines */
- ADD_COUNTS(0, 0);
-
-#undef ADD_COUNTS
-
- /* Now that we have it encoded, release the original pixels */
- if((surface->flags & SDL_PREALLOC) != SDL_PREALLOC
- && (surface->flags & SDL_HWSURFACE) != SDL_HWSURFACE) {
- SDL_free( surface->pixels );
- surface->pixels = NULL;
- }
-
- /* realloc the buffer to release unused memory */
- {
- /* If realloc returns NULL, the original block is left intact */
- Uint8 *p = SDL_realloc(rlebuf, dst - rlebuf);
- if(!p)
- p = rlebuf;
- surface->map->sw_data->aux_data = p;
- }
-
- return(0);
-}
-
-int SDL_RLESurface(SDL_Surface *surface)
-{
- int retcode;
-
- /* Clear any previous RLE conversion */
- if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) {
- SDL_UnRLESurface(surface, 1);
- }
-
- /* We don't support RLE encoding of bitmaps */
- if ( surface->format->BitsPerPixel < 8 ) {
- return(-1);
- }
-
- /* Lock the surface if it's in hardware */
- if ( SDL_MUSTLOCK(surface) ) {
- if ( SDL_LockSurface(surface) < 0 ) {
- return(-1);
- }
- }
-
- /* Encode */
- if((surface->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY) {
- retcode = RLEColorkeySurface(surface);
- } else {
- if((surface->flags & SDL_SRCALPHA) == SDL_SRCALPHA
- && surface->format->Amask != 0)
- retcode = RLEAlphaSurface(surface);
- else
- retcode = -1; /* no RLE for per-surface alpha sans ckey */
- }
-
- /* Unlock the surface if it's in hardware */
- if ( SDL_MUSTLOCK(surface) ) {
- SDL_UnlockSurface(surface);
- }
-
- if(retcode < 0)
- return -1;
-
- /* The surface is now accelerated */
- surface->flags |= SDL_RLEACCEL;
-
- return(0);
-}
-
-/*
- * 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
- * may have been reduced (when encoding for 16bpp targets).
- */
-static SDL_bool UnRLEAlpha(SDL_Surface *surface)
-{
- Uint8 *srcbuf;
- Uint32 *dst;
- SDL_PixelFormat *sf = surface->format;
- RLEDestFormat *df = surface->map->sw_data->aux_data;
- int (*uncopy_opaque)(Uint32 *, void *, int,
- RLEDestFormat *, SDL_PixelFormat *);
- int (*uncopy_transl)(Uint32 *, void *, int,
- RLEDestFormat *, SDL_PixelFormat *);
- int w = surface->w;
- int bpp = df->BytesPerPixel;
-
- if(bpp == 2) {
- uncopy_opaque = uncopy_opaque_16;
- uncopy_transl = uncopy_transl_16;
- } else {
- uncopy_opaque = uncopy_transl = uncopy_32;
- }
-
- surface->pixels = SDL_malloc(surface->h * surface->pitch);
- if ( !surface->pixels ) {
- return(SDL_FALSE);
- }
- /* fill background with transparent pixels */
- SDL_memset(surface->pixels, 0, surface->h * surface->pitch);
-
- dst = surface->pixels;
- srcbuf = (Uint8 *)(df + 1);
- for(;;) {
- /* copy opaque pixels */
- int ofs = 0;
- do {
- unsigned run;
- if(bpp == 2) {
- ofs += srcbuf[0];
- run = srcbuf[1];
- srcbuf += 2;
- } else {
- ofs += ((Uint16 *)srcbuf)[0];
- run = ((Uint16 *)srcbuf)[1];
- srcbuf += 4;
- }
- if(run) {
- srcbuf += uncopy_opaque(dst + ofs, srcbuf, run, df, sf);
- ofs += run;
- } else if(!ofs)
- return(SDL_TRUE);
- } while(ofs < w);
-
- /* skip padding if needed */
- if(bpp == 2)
- srcbuf += (uintptr_t)srcbuf & 2;
-
- /* copy translucent pixels */
- ofs = 0;
- do {
- unsigned run;
- ofs += ((Uint16 *)srcbuf)[0];
- run = ((Uint16 *)srcbuf)[1];
- srcbuf += 4;
- if(run) {
- srcbuf += uncopy_transl(dst + ofs, srcbuf, run, df, sf);
- ofs += run;
- }
- } while(ofs < w);
- dst += surface->pitch >> 2;
- }
- /* Make the compiler happy */
- return(SDL_TRUE);
-}
-
-void SDL_UnRLESurface(SDL_Surface *surface, int recode)
-{
- if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) {
- surface->flags &= ~SDL_RLEACCEL;
-
- if(recode && (surface->flags & SDL_PREALLOC) != SDL_PREALLOC
- && (surface->flags & SDL_HWSURFACE) != SDL_HWSURFACE) {
- if((surface->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY) {
- SDL_Rect full;
- unsigned alpha_flag;
-
- /* re-create the original surface */
- surface->pixels = SDL_malloc(surface->h * surface->pitch);
- if ( !surface->pixels ) {
- /* Oh crap... */
- surface->flags |= SDL_RLEACCEL;
- return;
- }
-
- /* fill it with the background colour */
- SDL_FillRect(surface, NULL, surface->format->colorkey);
-
- /* now render the encoded surface */
- full.x = full.y = 0;
- full.w = surface->w;
- full.h = surface->h;
- alpha_flag = surface->flags & SDL_SRCALPHA;
- surface->flags &= ~SDL_SRCALPHA; /* opaque blit */
- SDL_RLEBlit(surface, &full, surface, &full);
- surface->flags |= alpha_flag;
- } else {
- if ( !UnRLEAlpha(surface) ) {
- /* Oh crap... */
- surface->flags |= SDL_RLEACCEL;
- return;
- }
- }
- }
-
- if ( surface->map && surface->map->sw_data->aux_data ) {
- SDL_free(surface->map->sw_data->aux_data);
- surface->map->sw_data->aux_data = NULL;
- }
- }
-}
-
-
diff --git a/distrib/sdl-1.2.12/src/video/SDL_RLEaccel_c.h b/distrib/sdl-1.2.12/src/video/SDL_RLEaccel_c.h
deleted file mode 100644
index ba9d35d..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_RLEaccel_c.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Useful functions and variables from SDL_RLEaccel.c */
-
-extern int SDL_RLESurface(SDL_Surface *surface);
-extern int SDL_RLEBlit(SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect);
-extern int SDL_RLEAlphaBlit(SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect);
-extern void SDL_UnRLESurface(SDL_Surface *surface, int recode);
diff --git a/distrib/sdl-1.2.12/src/video/SDL_blit.c b/distrib/sdl-1.2.12/src/video/SDL_blit.c
deleted file mode 100644
index fee4738..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_blit.c
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-#include "SDL_sysvideo.h"
-#include "SDL_blit.h"
-#include "SDL_RLEaccel_c.h"
-#include "SDL_pixels_c.h"
-
-#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && SDL_ASSEMBLY_ROUTINES
-#define MMX_ASMBLIT
-#if (__GNUC__ > 2) /* SSE instructions aren't in GCC 2. */
-#define SSE_ASMBLIT
-#endif
-#endif
-
-#if defined(MMX_ASMBLIT)
-#include "SDL_cpuinfo.h"
-#include "mmx.h"
-#endif
-
-/* The general purpose software blit routine */
-static int SDL_SoftBlit(SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect)
-{
- int okay;
- int src_locked;
- int dst_locked;
-
- /* Everything is okay at the beginning... */
- okay = 1;
-
- /* Lock the destination if it's in hardware */
- dst_locked = 0;
- if ( SDL_MUSTLOCK(dst) ) {
- if ( SDL_LockSurface(dst) < 0 ) {
- okay = 0;
- } else {
- dst_locked = 1;
- }
- }
- /* Lock the source if it's in hardware */
- src_locked = 0;
- if ( SDL_MUSTLOCK(src) ) {
- if ( SDL_LockSurface(src) < 0 ) {
- okay = 0;
- } else {
- src_locked = 1;
- }
- }
-
- /* Set up source and destination buffer pointers, and BLIT! */
- if ( okay && srcrect->w && srcrect->h ) {
- SDL_BlitInfo info;
- SDL_loblit RunBlit;
-
- /* Set up the blit information */
- info.s_pixels = (Uint8 *)src->pixels +
- (Uint16)srcrect->y*src->pitch +
- (Uint16)srcrect->x*src->format->BytesPerPixel;
- info.s_width = srcrect->w;
- info.s_height = srcrect->h;
- info.s_skip=src->pitch-info.s_width*src->format->BytesPerPixel;
- info.d_pixels = (Uint8 *)dst->pixels +
- (Uint16)dstrect->y*dst->pitch +
- (Uint16)dstrect->x*dst->format->BytesPerPixel;
- info.d_width = dstrect->w;
- info.d_height = dstrect->h;
- info.d_skip=dst->pitch-info.d_width*dst->format->BytesPerPixel;
- info.aux_data = src->map->sw_data->aux_data;
- info.src = src->format;
- info.table = src->map->table;
- info.dst = dst->format;
- RunBlit = src->map->sw_data->blit;
-
- /* Run the actual software blit */
- RunBlit(&info);
- }
-
- /* We need to unlock the surfaces if they're locked */
- if ( dst_locked ) {
- SDL_UnlockSurface(dst);
- }
- if ( src_locked ) {
- SDL_UnlockSurface(src);
- }
- /* Blit is done! */
- return(okay ? 0 : -1);
-}
-
-#ifdef MMX_ASMBLIT
-static __inline__ void SDL_memcpyMMX(Uint8 *to, const Uint8 *from, int len)
-{
- int i;
-
- for(i=0; i<len/8; i++) {
- __asm__ __volatile__ (
- " movq (%0), %%mm0\n"
- " movq %%mm0, (%1)\n"
- : : "r" (from), "r" (to) : "memory");
- from+=8;
- to+=8;
- }
- if (len&7)
- SDL_memcpy(to, from, len&7);
-}
-
-#ifdef SSE_ASMBLIT
-static __inline__ void SDL_memcpySSE(Uint8 *to, const Uint8 *from, int len)
-{
- int i;
-
- __asm__ __volatile__ (
- " prefetchnta (%0)\n"
- " prefetchnta 64(%0)\n"
- " prefetchnta 128(%0)\n"
- " prefetchnta 192(%0)\n"
- : : "r" (from) );
-
- for(i=0; i<len/8; i++) {
- __asm__ __volatile__ (
- " prefetchnta 256(%0)\n"
- " movq (%0), %%mm0\n"
- " movntq %%mm0, (%1)\n"
- : : "r" (from), "r" (to) : "memory");
- from+=8;
- to+=8;
- }
- if (len&7)
- SDL_memcpy(to, from, len&7);
-}
-#endif
-#endif
-
-static void SDL_BlitCopy(SDL_BlitInfo *info)
-{
- Uint8 *src, *dst;
- int w, h;
- int srcskip, dstskip;
-
- w = info->d_width*info->dst->BytesPerPixel;
- h = info->d_height;
- src = info->s_pixels;
- dst = info->d_pixels;
- srcskip = w+info->s_skip;
- dstskip = w+info->d_skip;
-
-#ifdef SSE_ASMBLIT
- if(SDL_HasSSE())
- {
- while ( h-- ) {
- SDL_memcpySSE(dst, src, w);
- src += srcskip;
- dst += dstskip;
- }
- __asm__ __volatile__ (
- " emms\n"
- ::);
- }
- else
-#endif
-#ifdef MMX_ASMBLIT
- if(SDL_HasMMX())
- {
- while ( h-- ) {
- SDL_memcpyMMX(dst, src, w);
- src += srcskip;
- dst += dstskip;
- }
- __asm__ __volatile__ (
- " emms\n"
- ::);
- }
- else
-#endif
- while ( h-- ) {
- SDL_memcpy(dst, src, w);
- src += srcskip;
- dst += dstskip;
- }
-}
-
-static void SDL_BlitCopyOverlap(SDL_BlitInfo *info)
-{
- Uint8 *src, *dst;
- int w, h;
- int srcskip, dstskip;
-
- w = info->d_width*info->dst->BytesPerPixel;
- h = info->d_height;
- src = info->s_pixels;
- dst = info->d_pixels;
- srcskip = w+info->s_skip;
- dstskip = w+info->d_skip;
- if ( dst < src ) {
- while ( h-- ) {
- SDL_memcpy(dst, src, w);
- src += srcskip;
- dst += dstskip;
- }
- } else {
- src += ((h-1) * srcskip);
- dst += ((h-1) * dstskip);
- while ( h-- ) {
- SDL_revcpy(dst, src, w);
- src -= srcskip;
- dst -= dstskip;
- }
- }
-}
-
-/* Figure out which of many blit routines to set up on a surface */
-int SDL_CalculateBlit(SDL_Surface *surface)
-{
- int blit_index;
-
- /* Clean everything out to start */
- if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) {
- SDL_UnRLESurface(surface, 1);
- }
- surface->map->sw_blit = NULL;
-
- /* Figure out if an accelerated hardware blit is possible */
- surface->flags &= ~SDL_HWACCEL;
- if ( surface->map->identity ) {
- int hw_blit_ok;
-
- if ( (surface->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
- /* We only support accelerated blitting to hardware */
- if ( surface->map->dst->flags & SDL_HWSURFACE ) {
- hw_blit_ok = current_video->info.blit_hw;
- } else {
- hw_blit_ok = 0;
- }
- if (hw_blit_ok && (surface->flags & SDL_SRCCOLORKEY)) {
- hw_blit_ok = current_video->info.blit_hw_CC;
- }
- if ( hw_blit_ok && (surface->flags & SDL_SRCALPHA) ) {
- hw_blit_ok = current_video->info.blit_hw_A;
- }
- } else {
- /* We only support accelerated blitting to hardware */
- if ( surface->map->dst->flags & SDL_HWSURFACE ) {
- hw_blit_ok = current_video->info.blit_sw;
- } else {
- hw_blit_ok = 0;
- }
- if (hw_blit_ok && (surface->flags & SDL_SRCCOLORKEY)) {
- hw_blit_ok = current_video->info.blit_sw_CC;
- }
- if ( hw_blit_ok && (surface->flags & SDL_SRCALPHA) ) {
- hw_blit_ok = current_video->info.blit_sw_A;
- }
- }
- if ( hw_blit_ok ) {
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
- video->CheckHWBlit(this, surface, surface->map->dst);
- }
- }
-
- /* if an alpha pixel format is specified, we can accelerate alpha blits */
- if (((surface->flags & SDL_HWSURFACE) == SDL_HWSURFACE )&&(current_video->displayformatalphapixel))
- {
- if ( (surface->flags & SDL_SRCALPHA) )
- if ( current_video->info.blit_hw_A ) {
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
- video->CheckHWBlit(this, surface, surface->map->dst);
- }
- }
-
- /* Get the blit function index, based on surface mode */
- /* { 0 = nothing, 1 = colorkey, 2 = alpha, 3 = colorkey+alpha } */
- blit_index = 0;
- blit_index |= (!!(surface->flags & SDL_SRCCOLORKEY)) << 0;
- if ( surface->flags & SDL_SRCALPHA
- && (surface->format->alpha != SDL_ALPHA_OPAQUE
- || surface->format->Amask) ) {
- blit_index |= 2;
- }
-
- /* Check for special "identity" case -- copy blit */
- if ( surface->map->identity && blit_index == 0 ) {
- surface->map->sw_data->blit = SDL_BlitCopy;
-
- /* Handle overlapping blits on the same surface */
- if ( surface == surface->map->dst ) {
- surface->map->sw_data->blit = SDL_BlitCopyOverlap;
- }
- } else {
- if ( surface->format->BitsPerPixel < 8 ) {
- surface->map->sw_data->blit =
- SDL_CalculateBlit0(surface, blit_index);
- } else {
- switch ( surface->format->BytesPerPixel ) {
- case 1:
- surface->map->sw_data->blit =
- SDL_CalculateBlit1(surface, blit_index);
- break;
- case 2:
- case 3:
- case 4:
- surface->map->sw_data->blit =
- SDL_CalculateBlitN(surface, blit_index);
- break;
- default:
- surface->map->sw_data->blit = NULL;
- break;
- }
- }
- }
- /* Make sure we have a blit function */
- if ( surface->map->sw_data->blit == NULL ) {
- SDL_InvalidateMap(surface->map);
- SDL_SetError("Blit combination not supported");
- return(-1);
- }
-
- /* Choose software blitting function */
- if(surface->flags & SDL_RLEACCELOK
- && (surface->flags & SDL_HWACCEL) != SDL_HWACCEL) {
-
- if(surface->map->identity
- && (blit_index == 1
- || (blit_index == 3 && !surface->format->Amask))) {
- if ( SDL_RLESurface(surface) == 0 )
- surface->map->sw_blit = SDL_RLEBlit;
- } else if(blit_index == 2 && surface->format->Amask) {
- if ( SDL_RLESurface(surface) == 0 )
- surface->map->sw_blit = SDL_RLEAlphaBlit;
- }
- }
-
- if ( surface->map->sw_blit == NULL ) {
- surface->map->sw_blit = SDL_SoftBlit;
- }
- return(0);
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/SDL_blit.h b/distrib/sdl-1.2.12/src/video/SDL_blit.h
deleted file mode 100644
index 9c43ce2..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_blit.h
+++ /dev/null
@@ -1,541 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_blit_h
-#define _SDL_blit_h
-
-#include "SDL_endian.h"
-
-/* The structure passed to the low level blit functions */
-typedef struct {
- Uint8 *s_pixels;
- int s_width;
- int s_height;
- int s_skip;
- Uint8 *d_pixels;
- int d_width;
- int d_height;
- int d_skip;
- void *aux_data;
- SDL_PixelFormat *src;
- Uint8 *table;
- SDL_PixelFormat *dst;
-} SDL_BlitInfo;
-
-/* The type definition for the low level blit functions */
-typedef void (*SDL_loblit)(SDL_BlitInfo *info);
-
-/* This is the private info structure for software accelerated blits */
-struct private_swaccel {
- SDL_loblit blit;
- void *aux_data;
-};
-
-/* Blit mapping definition */
-typedef struct SDL_BlitMap {
- SDL_Surface *dst;
- int identity;
- Uint8 *table;
- SDL_blit hw_blit;
- SDL_blit sw_blit;
- struct private_hwaccel *hw_data;
- struct private_swaccel *sw_data;
-
- /* the version count matches the destination; mismatch indicates
- an invalid mapping */
- unsigned int format_version;
-} SDL_BlitMap;
-
-
-/* Functions found in SDL_blit.c */
-extern int SDL_CalculateBlit(SDL_Surface *surface);
-
-/* Functions found in SDL_blit_{0,1,N,A}.c */
-extern SDL_loblit SDL_CalculateBlit0(SDL_Surface *surface, int complex);
-extern SDL_loblit SDL_CalculateBlit1(SDL_Surface *surface, int complex);
-extern SDL_loblit SDL_CalculateBlitN(SDL_Surface *surface, int complex);
-extern SDL_loblit SDL_CalculateAlphaBlit(SDL_Surface *surface, int complex);
-
-/*
- * Useful macros for blitting routines
- */
-
-#define FORMAT_EQUAL(A, B) \
- ((A)->BitsPerPixel == (B)->BitsPerPixel \
- && ((A)->Rmask == (B)->Rmask) && ((A)->Amask == (B)->Amask))
-
-/* Load pixel of the specified format from a buffer and get its R-G-B values */
-/* FIXME: rescale values to 0..255 here? */
-#define RGB_FROM_PIXEL(Pixel, fmt, r, g, b) \
-{ \
- r = (((Pixel&fmt->Rmask)>>fmt->Rshift)<<fmt->Rloss); \
- g = (((Pixel&fmt->Gmask)>>fmt->Gshift)<<fmt->Gloss); \
- b = (((Pixel&fmt->Bmask)>>fmt->Bshift)<<fmt->Bloss); \
-}
-#define RGB_FROM_RGB565(Pixel, r, g, b) \
-{ \
- r = (((Pixel&0xF800)>>11)<<3); \
- g = (((Pixel&0x07E0)>>5)<<2); \
- b = ((Pixel&0x001F)<<3); \
-}
-#define RGB_FROM_RGB555(Pixel, r, g, b) \
-{ \
- r = (((Pixel&0x7C00)>>10)<<3); \
- g = (((Pixel&0x03E0)>>5)<<3); \
- b = ((Pixel&0x001F)<<3); \
-}
-#define RGB_FROM_RGB888(Pixel, r, g, b) \
-{ \
- r = ((Pixel&0xFF0000)>>16); \
- g = ((Pixel&0xFF00)>>8); \
- b = (Pixel&0xFF); \
-}
-#define RETRIEVE_RGB_PIXEL(buf, bpp, Pixel) \
-do { \
- switch (bpp) { \
- case 2: \
- Pixel = *((Uint16 *)(buf)); \
- break; \
- \
- case 3: { \
- Uint8 *B = (Uint8 *)(buf); \
- if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \
- Pixel = B[0] + (B[1] << 8) + (B[2] << 16); \
- } else { \
- Pixel = (B[0] << 16) + (B[1] << 8) + B[2]; \
- } \
- } \
- break; \
- \
- case 4: \
- Pixel = *((Uint32 *)(buf)); \
- break; \
- \
- default: \
- Pixel = 0; /* appease gcc */ \
- break; \
- } \
-} while(0)
-
-#define DISEMBLE_RGB(buf, bpp, fmt, Pixel, r, g, b) \
-do { \
- switch (bpp) { \
- case 2: \
- Pixel = *((Uint16 *)(buf)); \
- break; \
- \
- case 3: { \
- Uint8 *B = (Uint8 *)buf; \
- if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \
- Pixel = B[0] + (B[1] << 8) + (B[2] << 16); \
- } else { \
- Pixel = (B[0] << 16) + (B[1] << 8) + B[2]; \
- } \
- } \
- break; \
- \
- case 4: \
- Pixel = *((Uint32 *)(buf)); \
- break; \
- \
- default: \
- Pixel = 0; /* prevent gcc from complaining */ \
- break; \
- } \
- RGB_FROM_PIXEL(Pixel, fmt, r, g, b); \
-} while(0)
-
-/* Assemble R-G-B values into a specified pixel format and store them */
-#ifdef __NDS__ // FIXME
-#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b) \
-{ \
- Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)| \
- ((g>>fmt->Gloss)<<fmt->Gshift)| \
- ((b>>fmt->Bloss)<<fmt->Bshift) | (1<<15); \
-}
-#else
-#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b) \
-{ \
- Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)| \
- ((g>>fmt->Gloss)<<fmt->Gshift)| \
- ((b>>fmt->Bloss)<<fmt->Bshift); \
-}
-#endif // __NDS__ FIXME
-#define RGB565_FROM_RGB(Pixel, r, g, b) \
-{ \
- Pixel = ((r>>3)<<11)|((g>>2)<<5)|(b>>3); \
-}
-#define RGB555_FROM_RGB(Pixel, r, g, b) \
-{ \
- Pixel = ((r>>3)<<10)|((g>>3)<<5)|(b>>3); \
-}
-#define RGB888_FROM_RGB(Pixel, r, g, b) \
-{ \
- Pixel = (r<<16)|(g<<8)|b; \
-}
-#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 ASSEMBLE_RGB_AMASK(buf, bpp, fmt, r, g, b, Amask) \
-{ \
- switch (bpp) { \
- case 2: { \
- Uint16 *bufp; \
- Uint16 Pixel; \
- \
- bufp = (Uint16 *)buf; \
- PIXEL_FROM_RGB(Pixel, fmt, r, g, b); \
- *bufp = Pixel | (*bufp & Amask); \
- } \
- break; \
- \
- case 3: { \
- if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \
- *((buf)+fmt->Rshift/8) = r; \
- *((buf)+fmt->Gshift/8) = g; \
- *((buf)+fmt->Bshift/8) = b; \
- } else { \
- *((buf)+2-fmt->Rshift/8) = r; \
- *((buf)+2-fmt->Gshift/8) = g; \
- *((buf)+2-fmt->Bshift/8) = b; \
- } \
- } \
- break; \
- \
- case 4: { \
- Uint32 *bufp; \
- Uint32 Pixel; \
- \
- bufp = (Uint32 *)buf; \
- PIXEL_FROM_RGB(Pixel, fmt, r, g, b); \
- *bufp = Pixel | (*bufp & Amask); \
- } \
- break; \
- } \
-}
-
-/* FIXME: Should we rescale alpha into 0..255 here? */
-#define RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a) \
-{ \
- r = ((Pixel&fmt->Rmask)>>fmt->Rshift)<<fmt->Rloss; \
- g = ((Pixel&fmt->Gmask)>>fmt->Gshift)<<fmt->Gloss; \
- b = ((Pixel&fmt->Bmask)>>fmt->Bshift)<<fmt->Bloss; \
- a = ((Pixel&fmt->Amask)>>fmt->Ashift)<<fmt->Aloss; \
-}
-#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_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 DISEMBLE_RGBA(buf, bpp, fmt, Pixel, r, g, b, a) \
-do { \
- switch (bpp) { \
- case 2: \
- Pixel = *((Uint16 *)(buf)); \
- break; \
- \
- case 3: {/* FIXME: broken code (no alpha) */ \
- Uint8 *b = (Uint8 *)buf; \
- if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \
- Pixel = b[0] + (b[1] << 8) + (b[2] << 16); \
- } else { \
- Pixel = (b[0] << 16) + (b[1] << 8) + b[2]; \
- } \
- } \
- break; \
- \
- case 4: \
- Pixel = *((Uint32 *)(buf)); \
- break; \
- \
- default: \
- Pixel = 0; /* stop gcc complaints */ \
- break; \
- } \
- RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a); \
- Pixel &= ~fmt->Amask; \
-} while(0)
-
-/* FIXME: this isn't correct, especially for Alpha (maximum != 255) */
-#ifdef __NDS__ // FIXME
-#define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \
-{ \
- Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)| \
- ((g>>fmt->Gloss)<<fmt->Gshift)| \
- ((b>>fmt->Bloss)<<fmt->Bshift)| \
- ((a>>fmt->Aloss)<<fmt->Ashift) | (1<<15); \
-}
-#else
-#define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \
-{ \
- Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)| \
- ((g>>fmt->Gloss)<<fmt->Gshift)| \
- ((b>>fmt->Bloss)<<fmt->Bshift)| \
- ((a>>fmt->Aloss)<<fmt->Ashift); \
-}
-#endif // __NDS__ FIXME
-#define ASSEMBLE_RGBA(buf, bpp, fmt, r, g, b, a) \
-{ \
- switch (bpp) { \
- case 2: { \
- Uint16 Pixel; \
- \
- PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a); \
- *((Uint16 *)(buf)) = Pixel; \
- } \
- break; \
- \
- case 3: { /* FIXME: broken code (no alpha) */ \
- if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \
- *((buf)+fmt->Rshift/8) = r; \
- *((buf)+fmt->Gshift/8) = g; \
- *((buf)+fmt->Bshift/8) = b; \
- } else { \
- *((buf)+2-fmt->Rshift/8) = r; \
- *((buf)+2-fmt->Gshift/8) = g; \
- *((buf)+2-fmt->Bshift/8) = b; \
- } \
- } \
- break; \
- \
- case 4: { \
- Uint32 Pixel; \
- \
- PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a); \
- *((Uint32 *)(buf)) = Pixel; \
- } \
- break; \
- } \
-}
-
-/* Blend the RGB values of two Pixels based on a source alpha value */
-#define ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB) \
-do { \
- dR = (((sR-dR)*(A))>>8)+dR; \
- dG = (((sG-dG)*(A))>>8)+dG; \
- dB = (((sB-dB)*(A))>>8)+dB; \
-} while(0)
-
-/* Blend the RGB values of two Pixels based on a source alpha value */
-#define ACCURATE_ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB) \
-do { \
- unsigned tR, tG, tB, tA; \
- tA = 255 - sA; \
- tR = 1 + (sR * sA) + (dR * tA); \
- dR = (tR + (tR >> 8)) >> 8; \
- tG = 1 + (sG * sA) + (dG * tA); \
- dG = (tG + (tG >> 8)) >> 8; \
- tB = 1 + (sB * sA) + (dB * tA); \
- dB = (tB + (tB >> 8)) >> 8; \
-} while(0)
-
-
-/* This is a very useful loop for optimizing blitters */
-#if defined(_MSC_VER) && (_MSC_VER == 1300)
-/* There's a bug in the Visual C++ 7 optimizer when compiling this code */
-#else
-#define USE_DUFFS_LOOP
-#endif
-#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 ); \
- } \
-}
-
-/* 4-times unrolled loop */
-#define DUFFS_LOOP4(pixel_copy_increment, width) \
-{ int n = (width+3)/4; \
- switch (width & 3) { \
- case 0: do { pixel_copy_increment; \
- case 3: pixel_copy_increment; \
- case 2: pixel_copy_increment; \
- case 1: pixel_copy_increment; \
- } while ( --n > 0 ); \
- } \
-}
-
-/* 2 - times unrolled loop */
-#define DUFFS_LOOP_DOUBLE2(pixel_copy_increment, \
- double_pixel_copy_increment, width) \
-{ int n, w = width; \
- if( w & 1 ) { \
- pixel_copy_increment; \
- w--; \
- } \
- if ( w > 0 ) { \
- n = ( w + 2) / 4; \
- switch( w & 2 ) { \
- case 0: do { double_pixel_copy_increment; \
- case 2: double_pixel_copy_increment; \
- } while ( --n > 0 ); \
- } \
- } \
-}
-
-/* 2 - times unrolled loop 4 pixels */
-#define DUFFS_LOOP_QUATRO2(pixel_copy_increment, \
- double_pixel_copy_increment, \
- quatro_pixel_copy_increment, width) \
-{ int n, w = width; \
- if(w & 1) { \
- pixel_copy_increment; \
- w--; \
- } \
- if(w & 2) { \
- double_pixel_copy_increment; \
- w -= 2; \
- } \
- if ( w > 0 ) { \
- n = ( w + 7 ) / 8; \
- switch( w & 4 ) { \
- case 0: do { quatro_pixel_copy_increment; \
- case 4: quatro_pixel_copy_increment; \
- } while ( --n > 0 ); \
- } \
- } \
-}
-
-/* Use the 8-times version of the loop by default */
-#define DUFFS_LOOP(pixel_copy_increment, width) \
- DUFFS_LOOP8(pixel_copy_increment, width)
-
-#else
-
-/* Don't use Duff's device to unroll loops */
-#define DUFFS_LOOP_DOUBLE2(pixel_copy_increment, \
- double_pixel_copy_increment, width) \
-{ int n = width; \
- if( n & 1 ) { \
- pixel_copy_increment; \
- n--; \
- } \
- n=n>>1; \
- for(; n > 0; --n) { \
- double_pixel_copy_increment; \
- } \
-}
-
-/* Don't use Duff's device to unroll loops */
-#define DUFFS_LOOP_QUATRO2(pixel_copy_increment, \
- double_pixel_copy_increment, \
- quatro_pixel_copy_increment, width) \
-{ int n = width; \
- if(n & 1) { \
- pixel_copy_increment; \
- n--; \
- } \
- if(n & 2) { \
- double_pixel_copy_increment; \
- n -= 2; \
- } \
- n=n>>2; \
- for(; n > 0; --n) { \
- quatro_pixel_copy_increment; \
- } \
-}
-
-/* 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_LOOP8(pixel_copy_increment, width) \
- DUFFS_LOOP(pixel_copy_increment, width)
-#define DUFFS_LOOP4(pixel_copy_increment, width) \
- DUFFS_LOOP(pixel_copy_increment, width)
-
-#endif /* USE_DUFFS_LOOP */
-
-/* Prevent Visual C++ 6.0 from printing out stupid warnings */
-#if defined(_MSC_VER) && (_MSC_VER >= 600)
-#pragma warning(disable: 4550)
-#endif
-
-#endif /* _SDL_blit_h */
diff --git a/distrib/sdl-1.2.12/src/video/SDL_blit_0.c b/distrib/sdl-1.2.12/src/video/SDL_blit_0.c
deleted file mode 100644
index 7cab3df..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_blit_0.c
+++ /dev/null
@@ -1,471 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-#include "SDL_blit.h"
-
-/* Functions to blit from bitmaps to other surfaces */
-
-static void BlitBto1(SDL_BlitInfo *info)
-{
- int c;
- int width, height;
- Uint8 *src, *map, *dst;
- int srcskip, dstskip;
-
- /* Set up some basic variables */
- width = info->d_width;
- height = info->d_height;
- src = info->s_pixels;
- srcskip = info->s_skip;
- dst = info->d_pixels;
- dstskip = info->d_skip;
- map = info->table;
- srcskip += width-(width+7)/8;
-
- if ( map ) {
- while ( height-- ) {
- Uint8 byte = 0, bit;
- for ( c=0; c<width; ++c ) {
- if ( (c&7) == 0 ) {
- byte = *src++;
- }
- bit = (byte&0x80)>>7;
- if ( 1 ) {
- *dst = map[bit];
- }
- dst++;
- byte <<= 1;
- }
- src += srcskip;
- dst += dstskip;
- }
- } else {
- while ( height-- ) {
- Uint8 byte = 0, bit;
- for ( c=0; c<width; ++c ) {
- if ( (c&7) == 0 ) {
- byte = *src++;
- }
- bit = (byte&0x80)>>7;
- if ( 1 ) {
- *dst = bit;
- }
- dst++;
- byte <<= 1;
- }
- src += srcskip;
- dst += dstskip;
- }
- }
-}
-static void BlitBto2(SDL_BlitInfo *info)
-{
- int c;
- int width, height;
- Uint8 *src;
- Uint16 *map, *dst;
- int srcskip, dstskip;
-
- /* Set up some basic variables */
- width = info->d_width;
- height = info->d_height;
- src = info->s_pixels;
- srcskip = info->s_skip;
- dst = (Uint16 *)info->d_pixels;
- dstskip = info->d_skip/2;
- map = (Uint16 *)info->table;
- srcskip += width-(width+7)/8;
-
- while ( height-- ) {
- Uint8 byte = 0, bit;
- for ( c=0; c<width; ++c ) {
- if ( (c&7) == 0 ) {
- byte = *src++;
- }
- bit = (byte&0x80)>>7;
- if ( 1 ) {
- *dst = map[bit];
- }
- byte <<= 1;
- dst++;
- }
- src += srcskip;
- dst += dstskip;
- }
-}
-static void BlitBto3(SDL_BlitInfo *info)
-{
- int c, o;
- int width, height;
- Uint8 *src, *map, *dst;
- int srcskip, dstskip;
-
- /* Set up some basic variables */
- width = info->d_width;
- height = info->d_height;
- src = info->s_pixels;
- srcskip = info->s_skip;
- dst = info->d_pixels;
- dstskip = info->d_skip;
- map = info->table;
- srcskip += width-(width+7)/8;
-
- while ( height-- ) {
- Uint8 byte = 0, bit;
- for ( c=0; c<width; ++c ) {
- if ( (c&7) == 0 ) {
- byte = *src++;
- }
- bit = (byte&0x80)>>7;
- if ( 1 ) {
- o = bit * 4;
- dst[0] = map[o++];
- dst[1] = map[o++];
- dst[2] = map[o++];
- }
- byte <<= 1;
- dst += 3;
- }
- src += srcskip;
- dst += dstskip;
- }
-}
-static void BlitBto4(SDL_BlitInfo *info)
-{
- int width, height;
- Uint8 *src;
- Uint32 *map, *dst;
- int srcskip, dstskip;
- int c;
-
- /* Set up some basic variables */
- width = info->d_width;
- height = info->d_height;
- src = info->s_pixels;
- srcskip = info->s_skip;
- dst = (Uint32 *)info->d_pixels;
- dstskip = info->d_skip/4;
- map = (Uint32 *)info->table;
- srcskip += width-(width+7)/8;
-
- while ( height-- ) {
- Uint8 byte = 0, bit;
- for ( c=0; c<width; ++c ) {
- if ( (c&7) == 0 ) {
- byte = *src++;
- }
- bit = (byte&0x80)>>7;
- if ( 1 ) {
- *dst = map[bit];
- }
- byte <<= 1;
- dst++;
- }
- src += srcskip;
- dst += dstskip;
- }
-}
-
-static void BlitBto1Key(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- Uint8 *dst = info->d_pixels;
- int srcskip = info->s_skip;
- int dstskip = info->d_skip;
- Uint32 ckey = info->src->colorkey;
- Uint8 *palmap = info->table;
- int c;
-
- /* Set up some basic variables */
- srcskip += width-(width+7)/8;
-
- if ( palmap ) {
- while ( height-- ) {
- Uint8 byte = 0, bit;
- for ( c=0; c<width; ++c ) {
- if ( (c&7) == 0 ) {
- byte = *src++;
- }
- bit = (byte&0x80)>>7;
- if ( bit != ckey ) {
- *dst = palmap[bit];
- }
- dst++;
- byte <<= 1;
- }
- src += srcskip;
- dst += dstskip;
- }
- } else {
- while ( height-- ) {
- Uint8 byte = 0, bit;
- for ( c=0; c<width; ++c ) {
- if ( (c&7) == 0 ) {
- byte = *src++;
- }
- bit = (byte&0x80)>>7;
- if ( bit != ckey ) {
- *dst = bit;
- }
- dst++;
- byte <<= 1;
- }
- src += srcskip;
- dst += dstskip;
- }
- }
-}
-
-static void BlitBto2Key(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- Uint16 *dstp = (Uint16 *)info->d_pixels;
- int srcskip = info->s_skip;
- int dstskip = info->d_skip;
- Uint32 ckey = info->src->colorkey;
- Uint8 *palmap = info->table;
- int c;
-
- /* Set up some basic variables */
- srcskip += width-(width+7)/8;
- dstskip /= 2;
-
- while ( height-- ) {
- Uint8 byte = 0, bit;
- for ( c=0; c<width; ++c ) {
- if ( (c&7) == 0 ) {
- byte = *src++;
- }
- bit = (byte&0x80)>>7;
- if ( bit != ckey ) {
- *dstp=((Uint16 *)palmap)[bit];
- }
- byte <<= 1;
- dstp++;
- }
- src += srcskip;
- dstp += dstskip;
- }
-}
-
-static void BlitBto3Key(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- Uint8 *dst = info->d_pixels;
- int srcskip = info->s_skip;
- int dstskip = info->d_skip;
- Uint32 ckey = info->src->colorkey;
- Uint8 *palmap = info->table;
- int c;
-
- /* Set up some basic variables */
- srcskip += width-(width+7)/8;
-
- while ( height-- ) {
- Uint8 byte = 0, bit;
- for ( c=0; c<width; ++c ) {
- if ( (c&7) == 0 ) {
- byte = *src++;
- }
- bit = (byte&0x80)>>7;
- if ( bit != ckey ) {
- SDL_memcpy(dst, &palmap[bit*4], 3);
- }
- byte <<= 1;
- dst += 3;
- }
- src += srcskip;
- dst += dstskip;
- }
-}
-
-static void BlitBto4Key(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- Uint32 *dstp = (Uint32 *)info->d_pixels;
- int srcskip = info->s_skip;
- int dstskip = info->d_skip;
- Uint32 ckey = info->src->colorkey;
- Uint8 *palmap = info->table;
- int c;
-
- /* Set up some basic variables */
- srcskip += width-(width+7)/8;
- dstskip /= 4;
-
- while ( height-- ) {
- Uint8 byte = 0, bit;
- for ( c=0; c<width; ++c ) {
- if ( (c&7) == 0 ) {
- byte = *src++;
- }
- bit = (byte&0x80)>>7;
- if ( bit != ckey ) {
- *dstp=((Uint32 *)palmap)[bit];
- }
- byte <<= 1;
- dstp++;
- }
- src += srcskip;
- dstp += dstskip;
- }
-}
-
-static void BlitBtoNAlpha(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- Uint8 *dst = info->d_pixels;
- int srcskip = info->s_skip;
- int dstskip = info->d_skip;
- const SDL_Color *srcpal = info->src->palette->colors;
- SDL_PixelFormat *dstfmt = info->dst;
- int dstbpp;
- int c;
- const int A = info->src->alpha;
-
- /* Set up some basic variables */
- dstbpp = dstfmt->BytesPerPixel;
- srcskip += width-(width+7)/8;
-
- while ( height-- ) {
- Uint8 byte = 0, bit;
- for ( c=0; c<width; ++c ) {
- if ( (c&7) == 0 ) {
- byte = *src++;
- }
- 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);
- }
- byte <<= 1;
- dst += dstbpp;
- }
- src += srcskip;
- dst += dstskip;
- }
-}
-
-static void BlitBtoNAlphaKey(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- Uint8 *dst = info->d_pixels;
- int srcskip = info->s_skip;
- int dstskip = info->d_skip;
- SDL_PixelFormat *srcfmt = info->src;
- SDL_PixelFormat *dstfmt = info->dst;
- const SDL_Color *srcpal = srcfmt->palette->colors;
- int dstbpp;
- int c;
- const int A = srcfmt->alpha;
- Uint32 ckey = srcfmt->colorkey;
-
- /* Set up some basic variables */
- dstbpp = dstfmt->BytesPerPixel;
- srcskip += width-(width+7)/8;
-
- while ( height-- ) {
- Uint8 byte = 0, bit;
- for ( c=0; c<width; ++c ) {
- if ( (c&7) == 0 ) {
- byte = *src++;
- }
- 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);
- }
- byte <<= 1;
- dst += dstbpp;
- }
- src += srcskip;
- dst += dstskip;
- }
-}
-
-static SDL_loblit bitmap_blit[] = {
- NULL, BlitBto1, BlitBto2, BlitBto3, BlitBto4
-};
-
-static SDL_loblit colorkey_blit[] = {
- NULL, BlitBto1Key, BlitBto2Key, BlitBto3Key, BlitBto4Key
-};
-
-SDL_loblit SDL_CalculateBlit0(SDL_Surface *surface, int blit_index)
-{
- int which;
-
- if ( surface->format->BitsPerPixel != 1 ) {
- /* We don't support sub 8-bit packed pixel modes */
- return NULL;
- }
- if ( surface->map->dst->format->BitsPerPixel < 8 ) {
- which = 0;
- } else {
- which = surface->map->dst->format->BytesPerPixel;
- }
- switch(blit_index) {
- case 0: /* copy */
- return bitmap_blit[which];
-
- case 1: /* colorkey */
- return colorkey_blit[which];
-
- case 2: /* alpha */
- return which >= 2 ? BlitBtoNAlpha : NULL;
-
- case 4: /* alpha + colorkey */
- return which >= 2 ? BlitBtoNAlphaKey : NULL;
- }
- return NULL;
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/SDL_blit_1.c b/distrib/sdl-1.2.12/src/video/SDL_blit_1.c
deleted file mode 100644
index d31126b..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_blit_1.c
+++ /dev/null
@@ -1,523 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-#include "SDL_blit.h"
-#include "SDL_sysvideo.h"
-#include "SDL_endian.h"
-
-/* Functions to blit from 8-bit surfaces to other surfaces */
-
-static void Blit1to1(SDL_BlitInfo *info)
-{
-#ifndef USE_DUFFS_LOOP
- int c;
-#endif
- int width, height;
- Uint8 *src, *map, *dst;
- int srcskip, dstskip;
-
- /* Set up some basic variables */
- width = info->d_width;
- height = info->d_height;
- src = info->s_pixels;
- srcskip = info->s_skip;
- dst = info->d_pixels;
- dstskip = info->d_skip;
- map = info->table;
-
- while ( height-- ) {
-#ifdef USE_DUFFS_LOOP
- DUFFS_LOOP(
- {
- *dst = map[*src];
- }
- dst++;
- src++;
- , width);
-#else
- for ( c=width; c; --c ) {
- *dst = map[*src];
- dst++;
- src++;
- }
-#endif
- src += srcskip;
- dst += dstskip;
- }
-}
-/* This is now endian dependent */
-#if ( SDL_BYTEORDER == SDL_LIL_ENDIAN )
-#define HI 1
-#define LO 0
-#else /* ( SDL_BYTEORDER == SDL_BIG_ENDIAN ) */
-#define HI 0
-#define LO 1
-#endif
-static void Blit1to2(SDL_BlitInfo *info)
-{
-#ifndef USE_DUFFS_LOOP
- int c;
-#endif
- int width, height;
- Uint8 *src, *dst;
- Uint16 *map;
- int srcskip, dstskip;
-
- /* Set up some basic variables */
- width = info->d_width;
- height = info->d_height;
- src = info->s_pixels;
- srcskip = info->s_skip;
- dst = info->d_pixels;
- dstskip = info->d_skip;
- map = (Uint16 *)info->table;
-
-#ifdef USE_DUFFS_LOOP
- while ( height-- ) {
- DUFFS_LOOP(
- {
- *(Uint16 *)dst = map[*src++];
- dst += 2;
- },
- width);
- src += srcskip;
- dst += dstskip;
- }
-#else
- /* Memory align at 4-byte boundary, if necessary */
- if ( (long)dst & 0x03 ) {
- /* Don't do anything if width is 0 */
- if ( width == 0 ) {
- return;
- }
- --width;
-
- while ( height-- ) {
- /* Perform copy alignment */
- *(Uint16 *)dst = map[*src++];
- dst += 2;
-
- /* Copy in 4 pixel chunks */
- for ( c=width/4; c; --c ) {
- *(Uint32 *)dst =
- (map[src[HI]]<<16)|(map[src[LO]]);
- src += 2;
- dst += 4;
- *(Uint32 *)dst =
- (map[src[HI]]<<16)|(map[src[LO]]);
- src += 2;
- dst += 4;
- }
- /* Get any leftovers */
- switch (width & 3) {
- case 3:
- *(Uint16 *)dst = map[*src++];
- dst += 2;
- case 2:
- *(Uint32 *)dst =
- (map[src[HI]]<<16)|(map[src[LO]]);
- src += 2;
- dst += 4;
- break;
- case 1:
- *(Uint16 *)dst = map[*src++];
- dst += 2;
- break;
- }
- src += srcskip;
- dst += dstskip;
- }
- } else {
- while ( height-- ) {
- /* Copy in 4 pixel chunks */
- for ( c=width/4; c; --c ) {
- *(Uint32 *)dst =
- (map[src[HI]]<<16)|(map[src[LO]]);
- src += 2;
- dst += 4;
- *(Uint32 *)dst =
- (map[src[HI]]<<16)|(map[src[LO]]);
- src += 2;
- dst += 4;
- }
- /* Get any leftovers */
- switch (width & 3) {
- case 3:
- *(Uint16 *)dst = map[*src++];
- dst += 2;
- case 2:
- *(Uint32 *)dst =
- (map[src[HI]]<<16)|(map[src[LO]]);
- src += 2;
- dst += 4;
- break;
- case 1:
- *(Uint16 *)dst = map[*src++];
- dst += 2;
- break;
- }
- src += srcskip;
- dst += dstskip;
- }
- }
-#endif /* USE_DUFFS_LOOP */
-}
-static void Blit1to3(SDL_BlitInfo *info)
-{
-#ifndef USE_DUFFS_LOOP
- int c;
-#endif
- int o;
- int width, height;
- Uint8 *src, *map, *dst;
- int srcskip, dstskip;
-
- /* Set up some basic variables */
- width = info->d_width;
- height = info->d_height;
- src = info->s_pixels;
- srcskip = info->s_skip;
- dst = info->d_pixels;
- dstskip = info->d_skip;
- map = info->table;
-
- while ( height-- ) {
-#ifdef USE_DUFFS_LOOP
- DUFFS_LOOP(
- {
- o = *src * 4;
- dst[0] = map[o++];
- dst[1] = map[o++];
- dst[2] = map[o++];
- }
- src++;
- dst += 3;
- , width);
-#else
- for ( c=width; c; --c ) {
- o = *src * 4;
- dst[0] = map[o++];
- dst[1] = map[o++];
- dst[2] = map[o++];
- src++;
- dst += 3;
- }
-#endif /* USE_DUFFS_LOOP */
- src += srcskip;
- dst += dstskip;
- }
-}
-static void Blit1to4(SDL_BlitInfo *info)
-{
-#ifndef USE_DUFFS_LOOP
- int c;
-#endif
- int width, height;
- Uint8 *src;
- Uint32 *map, *dst;
- int srcskip, dstskip;
-
- /* Set up some basic variables */
- width = info->d_width;
- height = info->d_height;
- src = info->s_pixels;
- srcskip = info->s_skip;
- dst = (Uint32 *)info->d_pixels;
- dstskip = info->d_skip/4;
- map = (Uint32 *)info->table;
-
- while ( height-- ) {
-#ifdef USE_DUFFS_LOOP
- DUFFS_LOOP(
- *dst++ = map[*src++];
- , width);
-#else
- for ( c=width/4; c; --c ) {
- *dst++ = map[*src++];
- *dst++ = map[*src++];
- *dst++ = map[*src++];
- *dst++ = map[*src++];
- }
- switch ( width & 3 ) {
- case 3:
- *dst++ = map[*src++];
- case 2:
- *dst++ = map[*src++];
- case 1:
- *dst++ = map[*src++];
- }
-#endif /* USE_DUFFS_LOOP */
- src += srcskip;
- dst += dstskip;
- }
-}
-
-static void Blit1to1Key(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- int srcskip = info->s_skip;
- Uint8 *dst = info->d_pixels;
- int dstskip = info->d_skip;
- Uint8 *palmap = info->table;
- Uint32 ckey = info->src->colorkey;
-
- if ( palmap ) {
- while ( height-- ) {
- DUFFS_LOOP(
- {
- if ( *src != ckey ) {
- *dst = palmap[*src];
- }
- dst++;
- src++;
- },
- width);
- src += srcskip;
- dst += dstskip;
- }
- } else {
- while ( height-- ) {
- DUFFS_LOOP(
- {
- if ( *src != ckey ) {
- *dst = *src;
- }
- dst++;
- src++;
- },
- width);
- src += srcskip;
- dst += dstskip;
- }
- }
-}
-
-static void Blit1to2Key(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- int srcskip = info->s_skip;
- Uint16 *dstp = (Uint16 *)info->d_pixels;
- int dstskip = info->d_skip;
- Uint16 *palmap = (Uint16 *)info->table;
- Uint32 ckey = info->src->colorkey;
-
- /* Set up some basic variables */
- dstskip /= 2;
-
- while ( height-- ) {
- DUFFS_LOOP(
- {
- if ( *src != ckey ) {
- *dstp=palmap[*src];
- }
- src++;
- dstp++;
- },
- width);
- src += srcskip;
- dstp += dstskip;
- }
-}
-
-static void Blit1to3Key(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- int srcskip = info->s_skip;
- Uint8 *dst = info->d_pixels;
- int dstskip = info->d_skip;
- Uint8 *palmap = info->table;
- Uint32 ckey = info->src->colorkey;
- int o;
-
- while ( height-- ) {
- DUFFS_LOOP(
- {
- if ( *src != ckey ) {
- o = *src * 4;
- dst[0] = palmap[o++];
- dst[1] = palmap[o++];
- dst[2] = palmap[o++];
- }
- src++;
- dst += 3;
- },
- width);
- src += srcskip;
- dst += dstskip;
- }
-}
-
-static void Blit1to4Key(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- int srcskip = info->s_skip;
- Uint32 *dstp = (Uint32 *)info->d_pixels;
- int dstskip = info->d_skip;
- Uint32 *palmap = (Uint32 *)info->table;
- Uint32 ckey = info->src->colorkey;
-
- /* Set up some basic variables */
- dstskip /= 4;
-
- while ( height-- ) {
- DUFFS_LOOP(
- {
- if ( *src != ckey ) {
- *dstp = palmap[*src];
- }
- src++;
- dstp++;
- },
- width);
- src += srcskip;
- dstp += dstskip;
- }
-}
-
-static void Blit1toNAlpha(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- int srcskip = info->s_skip;
- Uint8 *dst = info->d_pixels;
- int dstskip = info->d_skip;
- SDL_PixelFormat *dstfmt = info->dst;
- const SDL_Color *srcpal = info->src->palette->colors;
- int dstbpp;
- const int A = info->src->alpha;
-
- /* Set up some basic variables */
- dstbpp = dstfmt->BytesPerPixel;
-
- while ( height-- ) {
- int sR, sG, sB;
- int dR, dG, dB;
- DUFFS_LOOP4(
- {
- Uint32 pixel;
- sR = srcpal[*src].r;
- sG = srcpal[*src].g;
- sB = srcpal[*src].b;
- DISEMBLE_RGB(dst, dstbpp, dstfmt,
- pixel, dR, dG, dB);
- ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB);
- ASSEMBLE_RGB(dst, dstbpp, dstfmt, dR, dG, dB);
- src++;
- dst += dstbpp;
- },
- width);
- src += srcskip;
- dst += dstskip;
- }
-}
-
-static void Blit1toNAlphaKey(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- int srcskip = info->s_skip;
- Uint8 *dst = info->d_pixels;
- int dstskip = info->d_skip;
- SDL_PixelFormat *srcfmt = info->src;
- SDL_PixelFormat *dstfmt = info->dst;
- const SDL_Color *srcpal = info->src->palette->colors;
- Uint32 ckey = srcfmt->colorkey;
- int dstbpp;
- const int A = srcfmt->alpha;
-
- /* Set up some basic variables */
- dstbpp = dstfmt->BytesPerPixel;
-
- while ( height-- ) {
- int sR, sG, sB;
- int dR, dG, dB;
- 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);
- }
- src++;
- dst += dstbpp;
- },
- width);
- src += srcskip;
- dst += dstskip;
- }
-}
-
-static SDL_loblit one_blit[] = {
- NULL, Blit1to1, Blit1to2, Blit1to3, Blit1to4
-};
-
-static SDL_loblit one_blitkey[] = {
- NULL, Blit1to1Key, Blit1to2Key, Blit1to3Key, Blit1to4Key
-};
-
-SDL_loblit SDL_CalculateBlit1(SDL_Surface *surface, int blit_index)
-{
- int which;
- SDL_PixelFormat *dstfmt;
-
- dstfmt = surface->map->dst->format;
- if ( dstfmt->BitsPerPixel < 8 ) {
- which = 0;
- } else {
- which = dstfmt->BytesPerPixel;
- }
- switch(blit_index) {
- case 0: /* copy */
- return one_blit[which];
-
- case 1: /* colorkey */
- return one_blitkey[which];
-
- case 2: /* alpha */
- /* Supporting 8bpp->8bpp alpha is doable but requires lots of
- tables which consume space and takes time to precompute,
- so is better left to the user */
- return which >= 2 ? Blit1toNAlpha : NULL;
-
- case 3: /* alpha + colorkey */
- return which >= 2 ? Blit1toNAlphaKey : NULL;
-
- }
- return NULL;
-}
diff --git a/distrib/sdl-1.2.12/src/video/SDL_blit_A.c b/distrib/sdl-1.2.12/src/video/SDL_blit_A.c
deleted file mode 100644
index b46d3f6..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_blit_A.c
+++ /dev/null
@@ -1,2872 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-#include "SDL_blit.h"
-
-/*
- In Visual C, VC6 has mmintrin.h in the "Processor Pack" add-on.
- Checking if _mm_free is #defined in malloc.h is is the only way to
- determine if the Processor Pack is installed, as far as I can tell.
-*/
-
-#if SDL_ASSEMBLY_ROUTINES
-# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
-# define MMX_ASMBLIT 1
-# define GCC_ASMBLIT 1
-# elif defined(_MSC_VER) && defined(_M_IX86)
-# if (_MSC_VER <= 1200)
-# include <malloc.h>
-# if defined(_mm_free)
-# define HAVE_MMINTRIN_H 1
-# endif
-# else /* Visual Studio > VC6 always has mmintrin.h */
-# define HAVE_MMINTRIN_H 1
-# endif
-# if HAVE_MMINTRIN_H
-# define MMX_ASMBLIT 1
-# define MSVC_ASMBLIT 1
-# endif
-# endif
-#endif /* SDL_ASSEMBLY_ROUTINES */
-
-/* Function to check the CPU flags */
-#include "SDL_cpuinfo.h"
-#if GCC_ASMBLIT
-#include "mmx.h"
-#elif MSVC_ASMBLIT
-#include <mmintrin.h>
-#include <mm3dnow.h>
-#endif
-
-/* Functions to perform alpha blended blitting */
-
-/* N->1 blending with per-surface alpha */
-static void BlitNto1SurfaceAlpha(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- int srcskip = info->s_skip;
- Uint8 *dst = info->d_pixels;
- int dstskip = info->d_skip;
- Uint8 *palmap = info->table;
- SDL_PixelFormat *srcfmt = info->src;
- SDL_PixelFormat *dstfmt = info->dst;
- int srcbpp = srcfmt->BytesPerPixel;
-
- const unsigned A = srcfmt->alpha;
-
- while ( height-- ) {
- 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);
- 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));
- } else {
- *dst = palmap[((dR>>5)<<(3+2))|
- ((dG>>5)<<(2)) |
- ((dB>>6)<<(0))];
- }
- dst++;
- src += srcbpp;
- },
- width);
- src += srcskip;
- dst += dstskip;
- }
-}
-
-/* N->1 blending with pixel alpha */
-static void BlitNto1PixelAlpha(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- int srcskip = info->s_skip;
- Uint8 *dst = info->d_pixels;
- int dstskip = info->d_skip;
- Uint8 *palmap = info->table;
- SDL_PixelFormat *srcfmt = info->src;
- SDL_PixelFormat *dstfmt = info->dst;
- int srcbpp = srcfmt->BytesPerPixel;
-
- /* FIXME: fix alpha bit field expansion here too? */
- while ( height-- ) {
- 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);
- 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));
- } else {
- *dst = palmap[((dR>>5)<<(3+2))|
- ((dG>>5)<<(2)) |
- ((dB>>6)<<(0)) ];
- }
- dst++;
- src += srcbpp;
- },
- width);
- src += srcskip;
- dst += dstskip;
- }
-}
-
-/* colorkeyed N->1 blending with per-surface alpha */
-static void BlitNto1SurfaceAlphaKey(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- int srcskip = info->s_skip;
- Uint8 *dst = info->d_pixels;
- int dstskip = info->d_skip;
- Uint8 *palmap = info->table;
- SDL_PixelFormat *srcfmt = info->src;
- SDL_PixelFormat *dstfmt = info->dst;
- int srcbpp = srcfmt->BytesPerPixel;
- Uint32 ckey = srcfmt->colorkey;
-
- const int A = srcfmt->alpha;
-
- while ( height-- ) {
- 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);
- 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));
- } else {
- *dst = palmap[((dR>>5)<<(3+2))|
- ((dG>>5)<<(2)) |
- ((dB>>6)<<(0)) ];
- }
- }
- dst++;
- src += srcbpp;
- },
- width);
- src += srcskip;
- dst += dstskip;
- }
-}
-
-#if GCC_ASMBLIT
-/* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */
-static void BlitRGBtoRGBSurfaceAlpha128MMX(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint32 *srcp = (Uint32 *)info->s_pixels;
- int srcskip = info->s_skip >> 2;
- Uint32 *dstp = (Uint32 *)info->d_pixels;
- int dstskip = info->d_skip >> 2;
- Uint32 dalpha = info->dst->Amask;
- Uint8 load[8];
-
- *(Uint64 *)load = 0x00fefefe00fefefeULL;/* alpha128 mask */
- movq_m2r(*load, mm4); /* alpha128 mask -> mm4 */
- *(Uint64 *)load = 0x0001010100010101ULL;/* !alpha128 mask */
- movq_m2r(*load, mm3); /* !alpha128 mask -> mm3 */
- movd_m2r(dalpha, mm7); /* dst alpha mask */
- punpckldq_r2r(mm7, mm7); /* dst alpha mask | dst alpha mask -> mm7 */
- while(height--) {
- DUFFS_LOOP_DOUBLE2(
- {
- Uint32 s = *srcp++;
- Uint32 d = *dstp;
- *dstp++ = ((((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1)
- + (s & d & 0x00010101)) | dalpha;
- },{
- movq_m2r((*dstp), mm2);/* 2 x dst -> mm2(ARGBARGB) */
- movq_r2r(mm2, mm6); /* 2 x dst -> mm6(ARGBARGB) */
-
- movq_m2r((*srcp), mm1);/* 2 x src -> mm1(ARGBARGB) */
- movq_r2r(mm1, mm5); /* 2 x src -> mm5(ARGBARGB) */
-
- pand_r2r(mm4, mm6); /* dst & mask -> mm6 */
- pand_r2r(mm4, mm5); /* src & mask -> mm5 */
- paddd_r2r(mm6, mm5); /* mm6 + mm5 -> mm5 */
- pand_r2r(mm1, mm2); /* src & dst -> mm2 */
- psrld_i2r(1, mm5); /* mm5 >> 1 -> mm5 */
- pand_r2r(mm3, mm2); /* mm2 & !mask -> mm2 */
- paddd_r2r(mm5, mm2); /* mm5 + mm2 -> mm2 */
-
- por_r2r(mm7, mm2); /* mm7(full alpha) | mm2 -> mm2 */
- movq_r2m(mm2, (*dstp));/* mm2 -> 2 x dst pixels */
- dstp += 2;
- srcp += 2;
- }, width);
- srcp += srcskip;
- dstp += dstskip;
- }
- emms();
-}
-
-/* fast RGB888->(A)RGB888 blending with surface alpha */
-static void BlitRGBtoRGBSurfaceAlphaMMX(SDL_BlitInfo *info)
-{
- SDL_PixelFormat* df = info->dst;
- unsigned alpha = info->src->alpha;
-
- if (alpha == 128 && (df->Rmask | df->Gmask | df->Bmask) == 0x00FFFFFF) {
- /* only call a128 version when R,G,B occupy lower bits */
- BlitRGBtoRGBSurfaceAlpha128MMX(info);
- } else {
- int width = info->d_width;
- int height = info->d_height;
- Uint32 *srcp = (Uint32 *)info->s_pixels;
- int srcskip = info->s_skip >> 2;
- Uint32 *dstp = (Uint32 *)info->d_pixels;
- int dstskip = info->d_skip >> 2;
-
- pxor_r2r(mm5, mm5); /* 0 -> mm5 */
- /* form the alpha mult */
- movd_m2r(alpha, mm4); /* 0000000A -> mm4 */
- punpcklwd_r2r(mm4, mm4); /* 00000A0A -> mm4 */
- punpckldq_r2r(mm4, mm4); /* 0A0A0A0A -> mm4 */
- alpha = (0xff << df->Rshift) | (0xff << df->Gshift) | (0xff << df->Bshift);
- movd_m2r(alpha, mm0); /* 00000FFF -> mm0 */
- punpcklbw_r2r(mm0, mm0); /* 00FFFFFF -> mm0 */
- pand_r2r(mm0, mm4); /* 0A0A0A0A -> mm4, minus 1 chan */
- /* at this point mm4 can be 000A0A0A or 0A0A0A00 or another combo */
- movd_m2r(df->Amask, mm7); /* dst alpha mask */
- punpckldq_r2r(mm7, mm7); /* dst alpha mask | dst alpha mask -> mm7 */
-
- while(height--) {
- DUFFS_LOOP_DOUBLE2({
- /* One Pixel Blend */
- movd_m2r((*srcp), mm1);/* src(ARGB) -> mm1 (0000ARGB)*/
- movd_m2r((*dstp), mm2);/* dst(ARGB) -> mm2 (0000ARGB)*/
- punpcklbw_r2r(mm5, mm1); /* 0A0R0G0B -> mm1(src) */
- punpcklbw_r2r(mm5, mm2); /* 0A0R0G0B -> mm2(dst) */
-
- psubw_r2r(mm2, mm1);/* src - dst -> mm1 */
- pmullw_r2r(mm4, mm1); /* mm1 * alpha -> mm1 */
- psrlw_i2r(8, mm1); /* mm1 >> 8 -> mm1 */
- paddb_r2r(mm1, mm2); /* mm1 + mm2(dst) -> mm2 */
-
- packuswb_r2r(mm5, mm2); /* ARGBARGB -> mm2 */
- por_r2r(mm7, mm2); /* mm7(full alpha) | mm2 -> mm2 */
- movd_r2m(mm2, *dstp);/* mm2 -> pixel */
- ++srcp;
- ++dstp;
- },{
- /* Two Pixels Blend */
- movq_m2r((*srcp), mm0);/* 2 x src -> mm0(ARGBARGB)*/
- movq_m2r((*dstp), mm2);/* 2 x dst -> mm2(ARGBARGB) */
- movq_r2r(mm0, mm1); /* 2 x src -> mm1(ARGBARGB) */
- movq_r2r(mm2, mm6); /* 2 x dst -> mm6(ARGBARGB) */
-
- punpcklbw_r2r(mm5, mm0); /* low - 0A0R0G0B -> mm0(src1) */
- punpckhbw_r2r(mm5, mm1); /* high - 0A0R0G0B -> mm1(src2) */
- punpcklbw_r2r(mm5, mm2); /* low - 0A0R0G0B -> mm2(dst1) */
- punpckhbw_r2r(mm5, mm6); /* high - 0A0R0G0B -> mm6(dst2) */
-
- psubw_r2r(mm2, mm0);/* src1 - dst1 -> mm0 */
- pmullw_r2r(mm4, mm0); /* mm0 * alpha -> mm0 */
- psrlw_i2r(8, mm0); /* mm0 >> 8 -> mm1 */
- paddb_r2r(mm0, mm2); /* mm0 + mm2(dst1) -> mm2 */
-
- psubw_r2r(mm6, mm1);/* src2 - dst2 -> mm1 */
- pmullw_r2r(mm4, mm1); /* mm1 * alpha -> mm1 */
- psrlw_i2r(8, mm1); /* mm1 >> 8 -> mm1 */
- paddb_r2r(mm1, mm6); /* mm1 + mm6(dst2) -> mm6 */
-
- packuswb_r2r(mm6, mm2); /* ARGBARGB -> mm2 */
- por_r2r(mm7, mm2); /* mm7(dst alpha) | mm2 -> mm2 */
-
- movq_r2m(mm2, *dstp);/* mm2 -> 2 x pixel */
-
- srcp += 2;
- dstp += 2;
- }, width);
- srcp += srcskip;
- dstp += dstskip;
- }
- emms();
- }
-}
-
-/* fast ARGB888->(A)RGB888 blending with pixel alpha */
-static void BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint32 *srcp = (Uint32 *)info->s_pixels;
- int srcskip = info->s_skip >> 2;
- Uint32 *dstp = (Uint32 *)info->d_pixels;
- int dstskip = info->d_skip >> 2;
- SDL_PixelFormat* sf = info->src;
- Uint32 amask = sf->Amask;
-
- pxor_r2r(mm6, mm6); /* 0 -> mm6 */
- /* form multiplication mask */
- movd_m2r(sf->Amask, mm7); /* 0000F000 -> mm7 */
- punpcklbw_r2r(mm7, mm7); /* FF000000 -> mm7 */
- pcmpeqb_r2r(mm0, mm0); /* FFFFFFFF -> mm0 */
- movq_r2r(mm0, mm3); /* FFFFFFFF -> mm3 (for later) */
- pxor_r2r(mm0, mm7); /* 00FFFFFF -> mm7 (mult mask) */
- /* form channel masks */
- movq_r2r(mm7, mm0); /* 00FFFFFF -> mm0 */
- packsswb_r2r(mm6, mm0); /* 00000FFF -> mm0 (channel mask) */
- packsswb_r2r(mm6, mm3); /* 0000FFFF -> mm3 */
- pxor_r2r(mm0, mm3); /* 0000F000 -> mm3 (~channel mask) */
- /* get alpha channel shift */
- __asm__ __volatile__ (
- "movd %0, %%mm5"
- : : "rm" ((Uint32) sf->Ashift) ); /* Ashift -> mm5 */
-
- while(height--) {
- DUFFS_LOOP4({
- Uint32 alpha = *srcp & amask;
- /* FIXME: Here we special-case opaque alpha since the
- compositioning used (>>8 instead of /255) doesn't handle
- it correctly. Also special-case alpha=0 for speed?
- Benchmark this! */
- if(alpha == 0) {
- /* do nothing */
- } else if(alpha == amask) {
- /* opaque alpha -- copy RGB, keep dst alpha */
- /* using MMX here to free up regular registers for other things */
- movd_m2r((*srcp), mm1);/* src(ARGB) -> mm1 (0000ARGB)*/
- movd_m2r((*dstp), mm2);/* dst(ARGB) -> mm2 (0000ARGB)*/
- pand_r2r(mm0, mm1); /* src & chanmask -> mm1 */
- pand_r2r(mm3, mm2); /* dst & ~chanmask -> mm2 */
- por_r2r(mm1, mm2); /* src | dst -> mm2 */
- movd_r2m(mm2, (*dstp)); /* mm2 -> dst */
- } else {
- movd_m2r((*srcp), mm1);/* src(ARGB) -> mm1 (0000ARGB)*/
- punpcklbw_r2r(mm6, mm1); /* 0A0R0G0B -> mm1 */
-
- movd_m2r((*dstp), mm2);/* dst(ARGB) -> mm2 (0000ARGB)*/
- punpcklbw_r2r(mm6, mm2); /* 0A0R0G0B -> mm2 */
-
- __asm__ __volatile__ (
- "movd %0, %%mm4"
- : : "r" (alpha) ); /* 0000A000 -> mm4 */
- psrld_r2r(mm5, mm4); /* mm4 >> mm5 -> mm4 (0000000A) */
- punpcklwd_r2r(mm4, mm4); /* 00000A0A -> mm4 */
- punpcklwd_r2r(mm4, mm4); /* 0A0A0A0A -> mm4 */
- pand_r2r(mm7, mm4); /* 000A0A0A -> mm4, preserve dst alpha on add */
-
- /* blend */
- psubw_r2r(mm2, mm1);/* src - dst -> mm1 */
- pmullw_r2r(mm4, mm1); /* mm1 * alpha -> mm1 */
- psrlw_i2r(8, mm1); /* mm1 >> 8 -> mm1(000R0G0B) */
- paddb_r2r(mm1, mm2); /* mm1 + mm2(dst) -> mm2 */
-
- packuswb_r2r(mm6, mm2); /* 0000ARGB -> mm2 */
- movd_r2m(mm2, *dstp);/* mm2 -> dst */
- }
- ++srcp;
- ++dstp;
- }, width);
- srcp += srcskip;
- dstp += dstskip;
- }
- emms();
-}
-/* End GCC_ASMBLIT */
-
-#elif MSVC_ASMBLIT
-/* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */
-static void BlitRGBtoRGBSurfaceAlpha128MMX(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint32 *srcp = (Uint32 *)info->s_pixels;
- int srcskip = info->s_skip >> 2;
- Uint32 *dstp = (Uint32 *)info->d_pixels;
- int dstskip = info->d_skip >> 2;
- Uint32 dalpha = info->dst->Amask;
-
- __m64 src1, src2, dst1, dst2, lmask, hmask, dsta;
-
- hmask = _mm_set_pi32(0x00fefefe, 0x00fefefe); /* alpha128 mask -> hmask */
- lmask = _mm_set_pi32(0x00010101, 0x00010101); /* !alpha128 mask -> lmask */
- dsta = _mm_set_pi32(dalpha, dalpha); /* dst alpha mask -> dsta */
-
- while (height--) {
- int n = width;
- if ( n & 1 ) {
- Uint32 s = *srcp++;
- Uint32 d = *dstp;
- *dstp++ = ((((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1)
- + (s & d & 0x00010101)) | dalpha;
- n--;
- }
-
- for (n >>= 1; n > 0; --n) {
- dst1 = *(__m64*)dstp; /* 2 x dst -> dst1(ARGBARGB) */
- dst2 = dst1; /* 2 x dst -> dst2(ARGBARGB) */
-
- src1 = *(__m64*)srcp; /* 2 x src -> src1(ARGBARGB) */
- src2 = src1; /* 2 x src -> src2(ARGBARGB) */
-
- dst2 = _mm_and_si64(dst2, hmask); /* dst & mask -> dst2 */
- src2 = _mm_and_si64(src2, hmask); /* src & mask -> src2 */
- src2 = _mm_add_pi32(src2, dst2); /* dst2 + src2 -> src2 */
- src2 = _mm_srli_pi32(src2, 1); /* src2 >> 1 -> src2 */
-
- dst1 = _mm_and_si64(dst1, src1); /* src & dst -> dst1 */
- dst1 = _mm_and_si64(dst1, lmask); /* dst1 & !mask -> dst1 */
- dst1 = _mm_add_pi32(dst1, src2); /* src2 + dst1 -> dst1 */
- dst1 = _mm_or_si64(dst1, dsta); /* dsta(full alpha) | dst1 -> dst1 */
-
- *(__m64*)dstp = dst1; /* dst1 -> 2 x dst pixels */
- dstp += 2;
- srcp += 2;
- }
-
- srcp += srcskip;
- dstp += dstskip;
- }
- _mm_empty();
-}
-
-/* fast RGB888->(A)RGB888 blending with surface alpha */
-static void BlitRGBtoRGBSurfaceAlphaMMX(SDL_BlitInfo *info)
-{
- SDL_PixelFormat* df = info->dst;
- Uint32 chanmask = df->Rmask | df->Gmask | df->Bmask;
- unsigned alpha = info->src->alpha;
-
- if (alpha == 128 && (df->Rmask | df->Gmask | df->Bmask) == 0x00FFFFFF) {
- /* only call a128 version when R,G,B occupy lower bits */
- BlitRGBtoRGBSurfaceAlpha128MMX(info);
- } else {
- int width = info->d_width;
- int height = info->d_height;
- Uint32 *srcp = (Uint32 *)info->s_pixels;
- int srcskip = info->s_skip >> 2;
- Uint32 *dstp = (Uint32 *)info->d_pixels;
- int dstskip = info->d_skip >> 2;
- Uint32 dalpha = df->Amask;
- Uint32 amult;
-
- __m64 src1, src2, dst1, dst2, mm_alpha, mm_zero, dsta;
-
- mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */
- /* form the alpha mult */
- amult = alpha | (alpha << 8);
- amult = amult | (amult << 16);
- chanmask = (0xff << df->Rshift) | (0xff << df->Gshift) | (0xff << df->Bshift);
- mm_alpha = _mm_set_pi32(0, amult & chanmask); /* 0000AAAA -> mm_alpha, minus 1 chan */
- mm_alpha = _mm_unpacklo_pi8(mm_alpha, mm_zero); /* 0A0A0A0A -> mm_alpha, minus 1 chan */
- /* at this point mm_alpha can be 000A0A0A or 0A0A0A00 or another combo */
- dsta = _mm_set_pi32(dalpha, dalpha); /* dst alpha mask -> dsta */
-
- while (height--) {
- int n = width;
- if (n & 1) {
- /* One Pixel Blend */
- src2 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src2 (0000ARGB)*/
- src2 = _mm_unpacklo_pi8(src2, mm_zero); /* 0A0R0G0B -> src2 */
-
- dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB)*/
- dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* 0A0R0G0B -> dst1 */
-
- src2 = _mm_sub_pi16(src2, dst1); /* src2 - dst2 -> src2 */
- src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
- src2 = _mm_srli_pi16(src2, 8); /* src2 >> 8 -> src2 */
- dst1 = _mm_add_pi8(src2, dst1); /* src2 + dst1 -> dst1 */
-
- dst1 = _mm_packs_pu16(dst1, mm_zero); /* 0000ARGB -> dst1 */
- dst1 = _mm_or_si64(dst1, dsta); /* dsta | dst1 -> dst1 */
- *dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */
-
- ++srcp;
- ++dstp;
-
- n--;
- }
-
- for (n >>= 1; n > 0; --n) {
- /* Two Pixels Blend */
- src1 = *(__m64*)srcp; /* 2 x src -> src1(ARGBARGB)*/
- src2 = src1; /* 2 x src -> src2(ARGBARGB) */
- src1 = _mm_unpacklo_pi8(src1, mm_zero); /* low - 0A0R0G0B -> src1 */
- src2 = _mm_unpackhi_pi8(src2, mm_zero); /* high - 0A0R0G0B -> src2 */
-
- dst1 = *(__m64*)dstp;/* 2 x dst -> dst1(ARGBARGB) */
- dst2 = dst1; /* 2 x dst -> dst2(ARGBARGB) */
- dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* low - 0A0R0G0B -> dst1 */
- dst2 = _mm_unpackhi_pi8(dst2, mm_zero); /* high - 0A0R0G0B -> dst2 */
-
- src1 = _mm_sub_pi16(src1, dst1);/* src1 - dst1 -> src1 */
- src1 = _mm_mullo_pi16(src1, mm_alpha); /* src1 * alpha -> src1 */
- src1 = _mm_srli_pi16(src1, 8); /* src1 >> 8 -> src1 */
- dst1 = _mm_add_pi8(src1, dst1); /* src1 + dst1(dst1) -> dst1 */
-
- src2 = _mm_sub_pi16(src2, dst2);/* src2 - dst2 -> src2 */
- src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
- src2 = _mm_srli_pi16(src2, 8); /* src2 >> 8 -> src2 */
- dst2 = _mm_add_pi8(src2, dst2); /* src2 + dst2(dst2) -> dst2 */
-
- dst1 = _mm_packs_pu16(dst1, dst2); /* 0A0R0G0B(res1), 0A0R0G0B(res2) -> dst1(ARGBARGB) */
- dst1 = _mm_or_si64(dst1, dsta); /* dsta | dst1 -> dst1 */
-
- *(__m64*)dstp = dst1; /* dst1 -> 2 x pixel */
-
- srcp += 2;
- dstp += 2;
- }
- srcp += srcskip;
- dstp += dstskip;
- }
- _mm_empty();
- }
-}
-
-/* fast ARGB888->(A)RGB888 blending with pixel alpha */
-static void BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint32 *srcp = (Uint32 *)info->s_pixels;
- int srcskip = info->s_skip >> 2;
- Uint32 *dstp = (Uint32 *)info->d_pixels;
- int dstskip = info->d_skip >> 2;
- SDL_PixelFormat* sf = info->src;
- Uint32 chanmask = sf->Rmask | sf->Gmask | sf->Bmask;
- Uint32 amask = sf->Amask;
- Uint32 ashift = sf->Ashift;
- Uint64 multmask;
-
- __m64 src1, dst1, mm_alpha, mm_zero, dmask;
-
- mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */
- multmask = ~(0xFFFFi64 << (ashift * 2));
- dmask = *(__m64*) &multmask; /* dst alpha mask -> dmask */
-
- while(height--) {
- DUFFS_LOOP4({
- Uint32 alpha = *srcp & amask;
- if (alpha == 0) {
- /* do nothing */
- } else if (alpha == amask) {
- /* opaque alpha -- copy RGB, keep dst alpha */
- *dstp = (*srcp & chanmask) | (*dstp & ~chanmask);
- } else {
- src1 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src1 (0000ARGB)*/
- src1 = _mm_unpacklo_pi8(src1, mm_zero); /* 0A0R0G0B -> src1 */
-
- dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB)*/
- dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* 0A0R0G0B -> dst1 */
-
- mm_alpha = _mm_cvtsi32_si64(alpha); /* alpha -> mm_alpha (0000000A) */
- mm_alpha = _mm_srli_si64(mm_alpha, ashift); /* mm_alpha >> ashift -> mm_alpha(0000000A) */
- mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */
- mm_alpha = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha */
- mm_alpha = _mm_and_si64(mm_alpha, dmask); /* 000A0A0A -> mm_alpha, preserve dst alpha on add */
-
- /* blend */
- src1 = _mm_sub_pi16(src1, dst1);/* src1 - dst1 -> src1 */
- src1 = _mm_mullo_pi16(src1, mm_alpha); /* (src1 - dst1) * alpha -> src1 */
- src1 = _mm_srli_pi16(src1, 8); /* src1 >> 8 -> src1(000R0G0B) */
- dst1 = _mm_add_pi8(src1, dst1); /* src1 + dst1 -> dst1(0A0R0G0B) */
- dst1 = _mm_packs_pu16(dst1, mm_zero); /* 0000ARGB -> dst1 */
-
- *dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */
- }
- ++srcp;
- ++dstp;
- }, width);
- srcp += srcskip;
- dstp += dstskip;
- }
- _mm_empty();
-}
-/* End MSVC_ASMBLIT */
-
-#endif /* GCC_ASMBLIT, MSVC_ASMBLIT */
-
-#if SDL_ALTIVEC_BLITTERS
-#if __MWERKS__
-#pragma altivec_model on
-#endif
-#if HAVE_ALTIVEC_H
-#include <altivec.h>
-#endif
-#include <assert.h>
-
-#if (defined(__MACOSX__) && (__GNUC__ < 4))
- #define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
- (vector unsigned char) ( a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p )
- #define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \
- (vector unsigned short) ( a,b,c,d,e,f,g,h )
-#else
- #define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
- (vector unsigned char) { a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p }
- #define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \
- (vector unsigned short) { a,b,c,d,e,f,g,h }
-#endif
-
-#define UNALIGNED_PTR(x) (((size_t) x) & 0x0000000F)
-#define VECPRINT(msg, v) do { \
- vector unsigned int tmpvec = (vector unsigned int)(v); \
- unsigned int *vp = (unsigned int *)&tmpvec; \
- printf("%s = %08X %08X %08X %08X\n", msg, vp[0], vp[1], vp[2], vp[3]); \
-} while (0)
-
-/* the permuation vector that takes the high bytes out of all the appropriate shorts
- (vector unsigned char)(
- 0x00, 0x10, 0x02, 0x12,
- 0x04, 0x14, 0x06, 0x16,
- 0x08, 0x18, 0x0A, 0x1A,
- 0x0C, 0x1C, 0x0E, 0x1E );
-*/
-#define VEC_MERGE_PERMUTE() (vec_add(vec_lvsl(0, (int*)NULL), (vector unsigned char)vec_splat_u16(0x0F)))
-#define VEC_U32_24() (vec_add(vec_splat_u32(12), vec_splat_u32(12)))
-#define VEC_ALPHA_MASK() ((vector unsigned char)vec_sl((vector unsigned int)vec_splat_s8(-1), VEC_U32_24()))
-#define VEC_ALIGNER(src) ((UNALIGNED_PTR(src)) \
- ? vec_lvsl(0, src) \
- : vec_add(vec_lvsl(8, src), vec_splat_u8(8)))
-
-
-#define VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1_16, v8_16) do { \
- /* vtemp1 contains source AAGGAAGGAAGGAAGG */ \
- vector unsigned short vtemp1 = vec_mule(vs, valpha); \
- /* vtemp2 contains source RRBBRRBBRRBBRRBB */ \
- vector unsigned short vtemp2 = vec_mulo(vs, valpha); \
- /* valpha2 is 255-alpha */ \
- vector unsigned char valpha2 = vec_nor(valpha, valpha); \
- /* vtemp3 contains dest AAGGAAGGAAGGAAGG */ \
- vector unsigned short vtemp3 = vec_mule(vd, valpha2); \
- /* vtemp4 contains dest RRBBRRBBRRBBRRBB */ \
- vector unsigned short vtemp4 = vec_mulo(vd, valpha2); \
- /* add source and dest */ \
- vtemp1 = vec_add(vtemp1, vtemp3); \
- vtemp2 = vec_add(vtemp2, vtemp4); \
- /* vtemp1 = (vtemp1 + 1) + ((vtemp1 + 1) >> 8) */ \
- vtemp1 = vec_add(vtemp1, v1_16); \
- vtemp3 = vec_sr(vtemp1, v8_16); \
- vtemp1 = vec_add(vtemp1, vtemp3); \
- /* vtemp2 = (vtemp2 + 1) + ((vtemp2 + 1) >> 8) */ \
- vtemp2 = vec_add(vtemp2, v1_16); \
- vtemp4 = vec_sr(vtemp2, v8_16); \
- vtemp2 = vec_add(vtemp2, vtemp4); \
- /* (>>8) and get ARGBARGBARGBARGB */ \
- vd = (vector unsigned char)vec_perm(vtemp1, vtemp2, mergePermute); \
-} while (0)
-
-/* Calculate the permute vector used for 32->32 swizzling */
-static vector unsigned char calc_swizzle32(const SDL_PixelFormat *srcfmt,
- const SDL_PixelFormat *dstfmt)
-{
- /*
- * We have to assume that the bits that aren't used by other
- * colors is alpha, and it's one complete byte, since some formats
- * leave alpha with a zero mask, but we should still swizzle the bits.
- */
- /* ARGB */
- const static struct SDL_PixelFormat default_pixel_format = {
- NULL, 0, 0,
- 0, 0, 0, 0,
- 16, 8, 0, 24,
- 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000,
- 0, 0};
- if (!srcfmt) {
- srcfmt = &default_pixel_format;
- }
- if (!dstfmt) {
- dstfmt = &default_pixel_format;
- }
- const vector unsigned char plus = VECUINT8_LITERAL
- ( 0x00, 0x00, 0x00, 0x00,
- 0x04, 0x04, 0x04, 0x04,
- 0x08, 0x08, 0x08, 0x08,
- 0x0C, 0x0C, 0x0C, 0x0C );
- vector unsigned char vswiz;
- vector unsigned int srcvec;
-#define RESHIFT(X) (3 - ((X) >> 3))
- Uint32 rmask = RESHIFT(srcfmt->Rshift) << (dstfmt->Rshift);
- Uint32 gmask = RESHIFT(srcfmt->Gshift) << (dstfmt->Gshift);
- Uint32 bmask = RESHIFT(srcfmt->Bshift) << (dstfmt->Bshift);
- Uint32 amask;
- /* Use zero for alpha if either surface doesn't have alpha */
- if (dstfmt->Amask) {
- amask = ((srcfmt->Amask) ? RESHIFT(srcfmt->Ashift) : 0x10) << (dstfmt->Ashift);
- } else {
- amask = 0x10101010 & ((dstfmt->Rmask | dstfmt->Gmask | dstfmt->Bmask) ^ 0xFFFFFFFF);
- }
-#undef RESHIFT
- ((unsigned int *)(char*)&srcvec)[0] = (rmask | gmask | bmask | amask);
- vswiz = vec_add(plus, (vector unsigned char)vec_splat(srcvec, 0));
- return(vswiz);
-}
-
-static void Blit32to565PixelAlphaAltivec(SDL_BlitInfo *info)
-{
- int height = info->d_height;
- Uint8 *src = (Uint8 *)info->s_pixels;
- int srcskip = info->s_skip;
- Uint8 *dst = (Uint8 *)info->d_pixels;
- int dstskip = info->d_skip;
- SDL_PixelFormat *srcfmt = info->src;
-
- vector unsigned char v0 = vec_splat_u8(0);
- vector unsigned short v8_16 = vec_splat_u16(8);
- vector unsigned short v1_16 = vec_splat_u16(1);
- vector unsigned short v2_16 = vec_splat_u16(2);
- vector unsigned short v3_16 = vec_splat_u16(3);
- vector unsigned int v8_32 = vec_splat_u32(8);
- vector unsigned int v16_32 = vec_add(v8_32, v8_32);
- vector unsigned short v3f = VECUINT16_LITERAL(
- 0x003f, 0x003f, 0x003f, 0x003f,
- 0x003f, 0x003f, 0x003f, 0x003f);
- vector unsigned short vfc = VECUINT16_LITERAL(
- 0x00fc, 0x00fc, 0x00fc, 0x00fc,
- 0x00fc, 0x00fc, 0x00fc, 0x00fc);
-
- /*
- 0x10 - 0x1f is the alpha
- 0x00 - 0x0e evens are the red
- 0x01 - 0x0f odds are zero
- */
- vector unsigned char vredalpha1 = VECUINT8_LITERAL(
- 0x10, 0x00, 0x01, 0x01,
- 0x10, 0x02, 0x01, 0x01,
- 0x10, 0x04, 0x01, 0x01,
- 0x10, 0x06, 0x01, 0x01
- );
- vector unsigned char vredalpha2 = (vector unsigned char)(
- vec_add((vector unsigned int)vredalpha1, vec_sl(v8_32, v16_32))
- );
- /*
- 0x00 - 0x0f is ARxx ARxx ARxx ARxx
- 0x11 - 0x0f odds are blue
- */
- vector unsigned char vblue1 = VECUINT8_LITERAL(
- 0x00, 0x01, 0x02, 0x11,
- 0x04, 0x05, 0x06, 0x13,
- 0x08, 0x09, 0x0a, 0x15,
- 0x0c, 0x0d, 0x0e, 0x17
- );
- vector unsigned char vblue2 = (vector unsigned char)(
- vec_add((vector unsigned int)vblue1, v8_32)
- );
- /*
- 0x00 - 0x0f is ARxB ARxB ARxB ARxB
- 0x10 - 0x0e evens are green
- */
- vector unsigned char vgreen1 = VECUINT8_LITERAL(
- 0x00, 0x01, 0x10, 0x03,
- 0x04, 0x05, 0x12, 0x07,
- 0x08, 0x09, 0x14, 0x0b,
- 0x0c, 0x0d, 0x16, 0x0f
- );
- vector unsigned char vgreen2 = (vector unsigned char)(
- vec_add((vector unsigned int)vgreen1, vec_sl(v8_32, v8_32))
- );
- vector unsigned char vgmerge = VECUINT8_LITERAL(
- 0x00, 0x02, 0x00, 0x06,
- 0x00, 0x0a, 0x00, 0x0e,
- 0x00, 0x12, 0x00, 0x16,
- 0x00, 0x1a, 0x00, 0x1e);
- vector unsigned char mergePermute = VEC_MERGE_PERMUTE();
- vector unsigned char vpermute = calc_swizzle32(srcfmt, NULL);
- vector unsigned char valphaPermute = vec_and(vec_lvsl(0, (int *)NULL), vec_splat_u8(0xC));
-
- vector unsigned short vf800 = (vector unsigned short)vec_splat_u8(-7);
- vf800 = vec_sl(vf800, vec_splat_u16(8));
-
- while(height--) {
- int extrawidth;
- vector unsigned char valigner;
- vector unsigned char vsrc;
- vector unsigned char voverflow;
- int width = info->d_width;
-
-#define ONE_PIXEL_BLEND(condition, widthvar) \
- while (condition) { \
- Uint32 Pixel; \
- unsigned sR, sG, sB, dR, dG, dB, sA; \
- DISEMBLE_RGBA(src, 4, srcfmt, Pixel, sR, sG, sB, sA); \
- if(sA) { \
- unsigned short dstpixel = *((unsigned short *)dst); \
- dR = (dstpixel >> 8) & 0xf8; \
- dG = (dstpixel >> 3) & 0xfc; \
- dB = (dstpixel << 3) & 0xf8; \
- ACCURATE_ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); \
- *((unsigned short *)dst) = ( \
- ((dR & 0xf8) << 8) | ((dG & 0xfc) << 3) | (dB >> 3) \
- ); \
- } \
- src += 4; \
- dst += 2; \
- widthvar--; \
- }
- ONE_PIXEL_BLEND((UNALIGNED_PTR(dst)) && (width), width);
- extrawidth = (width % 8);
- valigner = VEC_ALIGNER(src);
- vsrc = (vector unsigned char)vec_ld(0, src);
- width -= extrawidth;
- while (width) {
- vector unsigned char valpha;
- vector unsigned char vsrc1, vsrc2;
- vector unsigned char vdst1, vdst2;
- vector unsigned short vR, vG, vB;
- vector unsigned short vpixel, vrpixel, vgpixel, vbpixel;
-
- /* Load 8 pixels from src as ARGB */
- voverflow = (vector unsigned char)vec_ld(15, src);
- vsrc = vec_perm(vsrc, voverflow, valigner);
- vsrc1 = vec_perm(vsrc, vsrc, vpermute);
- src += 16;
- vsrc = (vector unsigned char)vec_ld(15, src);
- voverflow = vec_perm(voverflow, vsrc, valigner);
- vsrc2 = vec_perm(voverflow, voverflow, vpermute);
- src += 16;
-
- /* Load 8 pixels from dst as XRGB */
- voverflow = vec_ld(0, dst);
- vR = vec_and((vector unsigned short)voverflow, vf800);
- vB = vec_sl((vector unsigned short)voverflow, v3_16);
- vG = vec_sl(vB, v2_16);
- vdst1 = (vector unsigned char)vec_perm((vector unsigned char)vR, (vector unsigned char)vR, vredalpha1);
- vdst1 = vec_perm(vdst1, (vector unsigned char)vB, vblue1);
- vdst1 = vec_perm(vdst1, (vector unsigned char)vG, vgreen1);
- vdst2 = (vector unsigned char)vec_perm((vector unsigned char)vR, (vector unsigned char)vR, vredalpha2);
- vdst2 = vec_perm(vdst2, (vector unsigned char)vB, vblue2);
- vdst2 = vec_perm(vdst2, (vector unsigned char)vG, vgreen2);
-
- /* Alpha blend 8 pixels as ARGB */
- valpha = vec_perm(vsrc1, v0, valphaPermute);
- VEC_MULTIPLY_ALPHA(vsrc1, vdst1, valpha, mergePermute, v1_16, v8_16);
- valpha = vec_perm(vsrc2, v0, valphaPermute);
- VEC_MULTIPLY_ALPHA(vsrc2, vdst2, valpha, mergePermute, v1_16, v8_16);
-
- /* Convert 8 pixels to 565 */
- vpixel = (vector unsigned short)vec_packpx((vector unsigned int)vdst1, (vector unsigned int)vdst2);
- vgpixel = (vector unsigned short)vec_perm(vdst1, vdst2, vgmerge);
- vgpixel = vec_and(vgpixel, vfc);
- vgpixel = vec_sl(vgpixel, v3_16);
- vrpixel = vec_sl(vpixel, v1_16);
- vrpixel = vec_and(vrpixel, vf800);
- vbpixel = vec_and(vpixel, v3f);
- vdst1 = vec_or((vector unsigned char)vrpixel, (vector unsigned char)vgpixel);
- vdst1 = vec_or(vdst1, (vector unsigned char)vbpixel);
-
- /* Store 8 pixels */
- vec_st(vdst1, 0, dst);
-
- width -= 8;
- dst += 16;
- }
- ONE_PIXEL_BLEND((extrawidth), extrawidth);
-#undef ONE_PIXEL_BLEND
- src += srcskip;
- dst += dstskip;
- }
-}
-
-static void Blit32to32SurfaceAlphaKeyAltivec(SDL_BlitInfo *info)
-{
- unsigned alpha = info->src->alpha;
- int height = info->d_height;
- Uint32 *srcp = (Uint32 *)info->s_pixels;
- int srcskip = info->s_skip >> 2;
- Uint32 *dstp = (Uint32 *)info->d_pixels;
- int dstskip = info->d_skip >> 2;
- SDL_PixelFormat *srcfmt = info->src;
- SDL_PixelFormat *dstfmt = info->dst;
- unsigned sA = srcfmt->alpha;
- unsigned dA = dstfmt->Amask ? SDL_ALPHA_OPAQUE : 0;
- Uint32 rgbmask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask;
- Uint32 ckey = info->src->colorkey;
- vector unsigned char mergePermute;
- vector unsigned char vsrcPermute;
- vector unsigned char vdstPermute;
- vector unsigned char vsdstPermute;
- vector unsigned char valpha;
- vector unsigned char valphamask;
- vector unsigned char vbits;
- vector unsigned char v0;
- vector unsigned short v1;
- vector unsigned short v8;
- vector unsigned int vckey;
- vector unsigned int vrgbmask;
-
- mergePermute = VEC_MERGE_PERMUTE();
- v0 = vec_splat_u8(0);
- v1 = vec_splat_u16(1);
- v8 = vec_splat_u16(8);
-
- /* set the alpha to 255 on the destination surf */
- valphamask = VEC_ALPHA_MASK();
-
- vsrcPermute = calc_swizzle32(srcfmt, NULL);
- vdstPermute = calc_swizzle32(NULL, dstfmt);
- vsdstPermute = calc_swizzle32(dstfmt, NULL);
-
- /* set a vector full of alpha and 255-alpha */
- ((unsigned char *)&valpha)[0] = alpha;
- valpha = vec_splat(valpha, 0);
- vbits = (vector unsigned char)vec_splat_s8(-1);
-
- ckey &= rgbmask;
- ((unsigned int *)(char*)&vckey)[0] = ckey;
- vckey = vec_splat(vckey, 0);
- ((unsigned int *)(char*)&vrgbmask)[0] = rgbmask;
- vrgbmask = vec_splat(vrgbmask, 0);
-
- while(height--) {
- int width = info->d_width;
-#define ONE_PIXEL_BLEND(condition, widthvar) \
- while (condition) { \
- Uint32 Pixel; \
- unsigned sR, sG, sB, dR, dG, dB; \
- RETRIEVE_RGB_PIXEL(((Uint8 *)srcp), 4, Pixel); \
- if(sA && Pixel != ckey) { \
- RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB); \
- DISEMBLE_RGB(((Uint8 *)dstp), 4, dstfmt, Pixel, dR, dG, dB); \
- ACCURATE_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->d_width;
- int height = info->d_height;
- Uint32 *srcp = (Uint32 *)info->s_pixels;
- int srcskip = info->s_skip >> 2;
- Uint32 *dstp = (Uint32 *)info->d_pixels;
- int dstskip = info->d_skip >> 2;
- SDL_PixelFormat *srcfmt = info->src;
- SDL_PixelFormat *dstfmt = info->dst;
- vector unsigned char mergePermute;
- vector unsigned char valphaPermute;
- vector unsigned char vsrcPermute;
- vector unsigned char vdstPermute;
- vector unsigned char vsdstPermute;
- vector unsigned char valphamask;
- vector unsigned char vpixelmask;
- vector unsigned char v0;
- vector unsigned short v1;
- vector unsigned short v8;
-
- v0 = vec_splat_u8(0);
- v1 = vec_splat_u16(1);
- v8 = vec_splat_u16(8);
- mergePermute = VEC_MERGE_PERMUTE();
- valphamask = VEC_ALPHA_MASK();
- valphaPermute = vec_and(vec_lvsl(0, (int *)NULL), vec_splat_u8(0xC));
- vpixelmask = vec_nor(valphamask, v0);
- vsrcPermute = calc_swizzle32(srcfmt, NULL);
- vdstPermute = calc_swizzle32(NULL, dstfmt);
- vsdstPermute = calc_swizzle32(dstfmt, NULL);
-
- while ( height-- ) {
- width = info->d_width;
-#define ONE_PIXEL_BLEND(condition, widthvar) while ((condition)) { \
- Uint32 Pixel; \
- unsigned sR, sG, sB, dR, dG, dB, sA, dA; \
- DISEMBLE_RGBA((Uint8 *)srcp, 4, srcfmt, Pixel, sR, sG, sB, sA); \
- if(sA) { \
- DISEMBLE_RGBA((Uint8 *)dstp, 4, dstfmt, Pixel, dR, dG, dB, dA); \
- ACCURATE_ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); \
- ASSEMBLE_RGBA((Uint8 *)dstp, 4, dstfmt, dR, dG, dB, dA); \
- } \
- ++srcp; \
- ++dstp; \
- widthvar--; \
- }
- ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width);
- if (width > 0) {
- /* vsrcPermute */
- /* vdstPermute */
- int extrawidth = (width % 4);
- vector unsigned char valigner = VEC_ALIGNER(srcp);
- vector unsigned char vs = (vector unsigned char)vec_ld(0, srcp);
- width -= extrawidth;
- while (width) {
- vector unsigned char voverflow;
- vector unsigned char vd;
- vector unsigned char valpha;
- vector unsigned char vdstalpha;
- /* s = *srcp */
- voverflow = (vector unsigned char)vec_ld(15, srcp);
- vs = vec_perm(vs, voverflow, valigner);
- vs = vec_perm(vs, v0, vsrcPermute);
-
- valpha = vec_perm(vs, v0, valphaPermute);
-
- /* d = *dstp */
- vd = (vector unsigned char)vec_ld(0, dstp);
- vd = vec_perm(vd, v0, vsdstPermute);
- vdstalpha = vec_and(vd, valphamask);
-
- VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1, v8);
-
- /* set the alpha to the dest alpha */
- vd = vec_and(vd, vpixelmask);
- vd = vec_or(vd, vdstalpha);
- vd = vec_perm(vd, v0, vdstPermute);
-
- /* *dstp = res */
- vec_st((vector unsigned int)vd, 0, dstp);
-
- srcp += 4;
- dstp += 4;
- width -= 4;
- vs = voverflow;
-
- }
- ONE_PIXEL_BLEND((extrawidth), extrawidth);
- }
- srcp += srcskip;
- dstp += dstskip;
-#undef ONE_PIXEL_BLEND
- }
-}
-
-/* fast ARGB888->(A)RGB888 blending with pixel alpha */
-static void BlitRGBtoRGBPixelAlphaAltivec(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint32 *srcp = (Uint32 *)info->s_pixels;
- int srcskip = info->s_skip >> 2;
- Uint32 *dstp = (Uint32 *)info->d_pixels;
- int dstskip = info->d_skip >> 2;
- vector unsigned char mergePermute;
- vector unsigned char valphaPermute;
- vector unsigned char valphamask;
- vector unsigned char vpixelmask;
- vector unsigned char v0;
- vector unsigned short v1;
- vector unsigned short v8;
- v0 = vec_splat_u8(0);
- v1 = vec_splat_u16(1);
- v8 = vec_splat_u16(8);
- mergePermute = VEC_MERGE_PERMUTE();
- valphamask = VEC_ALPHA_MASK();
- valphaPermute = vec_and(vec_lvsl(0, (int *)NULL), vec_splat_u8(0xC));
-
-
- vpixelmask = vec_nor(valphamask, v0);
- while(height--) {
- width = info->d_width;
-#define ONE_PIXEL_BLEND(condition, widthvar) \
- while ((condition)) { \
- Uint32 dalpha; \
- Uint32 d; \
- Uint32 s1; \
- Uint32 d1; \
- Uint32 s = *srcp; \
- Uint32 alpha = s >> 24; \
- if(alpha) { \
- if(alpha == SDL_ALPHA_OPAQUE) { \
- *dstp = (s & 0x00ffffff) | (*dstp & 0xff000000); \
- } else { \
- d = *dstp; \
- dalpha = d & 0xff000000; \
- s1 = s & 0xff00ff; \
- d1 = d & 0xff00ff; \
- d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff; \
- s &= 0xff00; \
- d &= 0xff00; \
- d = (d + ((s - d) * alpha >> 8)) & 0xff00; \
- *dstp = d1 | d | dalpha; \
- } \
- } \
- ++srcp; \
- ++dstp; \
- widthvar--; \
- }
- ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width);
- if (width > 0) {
- int extrawidth = (width % 4);
- vector unsigned char valigner = VEC_ALIGNER(srcp);
- vector unsigned char vs = (vector unsigned char)vec_ld(0, srcp);
- width -= extrawidth;
- while (width) {
- vector unsigned char voverflow;
- vector unsigned char vd;
- vector unsigned char valpha;
- vector unsigned char vdstalpha;
- /* s = *srcp */
- voverflow = (vector unsigned char)vec_ld(15, srcp);
- vs = vec_perm(vs, voverflow, valigner);
-
- valpha = vec_perm(vs, v0, valphaPermute);
-
- /* d = *dstp */
- vd = (vector unsigned char)vec_ld(0, dstp);
- vdstalpha = vec_and(vd, valphamask);
-
- VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1, v8);
-
- /* set the alpha to the dest alpha */
- vd = vec_and(vd, vpixelmask);
- vd = vec_or(vd, vdstalpha);
-
- /* *dstp = res */
- vec_st((vector unsigned int)vd, 0, dstp);
-
- srcp += 4;
- dstp += 4;
- width -= 4;
- vs = voverflow;
- }
- ONE_PIXEL_BLEND((extrawidth), extrawidth);
- }
- srcp += srcskip;
- dstp += dstskip;
- }
-#undef ONE_PIXEL_BLEND
-}
-
-static void Blit32to32SurfaceAlphaAltivec(SDL_BlitInfo *info)
-{
- /* XXX : 6 */
- unsigned alpha = info->src->alpha;
- int height = info->d_height;
- Uint32 *srcp = (Uint32 *)info->s_pixels;
- int srcskip = info->s_skip >> 2;
- Uint32 *dstp = (Uint32 *)info->d_pixels;
- int dstskip = info->d_skip >> 2;
- SDL_PixelFormat *srcfmt = info->src;
- SDL_PixelFormat *dstfmt = info->dst;
- unsigned sA = srcfmt->alpha;
- unsigned dA = dstfmt->Amask ? SDL_ALPHA_OPAQUE : 0;
- vector unsigned char mergePermute;
- vector unsigned char vsrcPermute;
- vector unsigned char vdstPermute;
- vector unsigned char vsdstPermute;
- vector unsigned char valpha;
- vector unsigned char valphamask;
- vector unsigned char vbits;
- vector unsigned short v1;
- vector unsigned short v8;
-
- mergePermute = VEC_MERGE_PERMUTE();
- v1 = vec_splat_u16(1);
- v8 = vec_splat_u16(8);
-
- /* set the alpha to 255 on the destination surf */
- valphamask = VEC_ALPHA_MASK();
-
- vsrcPermute = calc_swizzle32(srcfmt, NULL);
- vdstPermute = calc_swizzle32(NULL, dstfmt);
- vsdstPermute = calc_swizzle32(dstfmt, NULL);
-
- /* set a vector full of alpha and 255-alpha */
- ((unsigned char *)&valpha)[0] = alpha;
- valpha = vec_splat(valpha, 0);
- vbits = (vector unsigned char)vec_splat_s8(-1);
-
- while(height--) {
- int width = info->d_width;
-#define ONE_PIXEL_BLEND(condition, widthvar) while ((condition)) { \
- Uint32 Pixel; \
- unsigned sR, sG, sB, dR, dG, dB; \
- DISEMBLE_RGB(((Uint8 *)srcp), 4, srcfmt, Pixel, sR, sG, sB); \
- DISEMBLE_RGB(((Uint8 *)dstp), 4, dstfmt, Pixel, dR, dG, dB); \
- ACCURATE_ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); \
- ASSEMBLE_RGBA(((Uint8 *)dstp), 4, dstfmt, dR, dG, dB, dA); \
- ++srcp; \
- ++dstp; \
- widthvar--; \
- }
- ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width);
- if (width > 0) {
- int extrawidth = (width % 4);
- vector unsigned char valigner = VEC_ALIGNER(srcp);
- vector unsigned char vs = (vector unsigned char)vec_ld(0, srcp);
- width -= extrawidth;
- while (width) {
- vector unsigned char voverflow;
- vector unsigned char vd;
-
- /* s = *srcp */
- voverflow = (vector unsigned char)vec_ld(15, srcp);
- vs = vec_perm(vs, voverflow, valigner);
- vs = vec_perm(vs, valpha, vsrcPermute);
-
- /* d = *dstp */
- vd = (vector unsigned char)vec_ld(0, dstp);
- vd = vec_perm(vd, vd, vsdstPermute);
-
- VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1, v8);
-
- /* set the alpha channel to full on */
- vd = vec_or(vd, valphamask);
- vd = vec_perm(vd, vbits, vdstPermute);
-
- /* *dstp = res */
- vec_st((vector unsigned int)vd, 0, dstp);
-
- srcp += 4;
- dstp += 4;
- width -= 4;
- vs = voverflow;
- }
- ONE_PIXEL_BLEND((extrawidth), extrawidth);
- }
-#undef ONE_PIXEL_BLEND
-
- srcp += srcskip;
- dstp += dstskip;
- }
-
-}
-
-
-/* fast RGB888->(A)RGB888 blending */
-static void BlitRGBtoRGBSurfaceAlphaAltivec(SDL_BlitInfo *info)
-{
- unsigned alpha = info->src->alpha;
- int height = info->d_height;
- Uint32 *srcp = (Uint32 *)info->s_pixels;
- int srcskip = info->s_skip >> 2;
- Uint32 *dstp = (Uint32 *)info->d_pixels;
- int dstskip = info->d_skip >> 2;
- vector unsigned char mergePermute;
- vector unsigned char valpha;
- vector unsigned char valphamask;
- vector unsigned short v1;
- vector unsigned short v8;
-
- mergePermute = VEC_MERGE_PERMUTE();
- v1 = vec_splat_u16(1);
- v8 = vec_splat_u16(8);
-
- /* set the alpha to 255 on the destination surf */
- valphamask = VEC_ALPHA_MASK();
-
- /* set a vector full of alpha and 255-alpha */
- ((unsigned char *)&valpha)[0] = alpha;
- valpha = vec_splat(valpha, 0);
-
- while(height--) {
- int width = info->d_width;
-#define ONE_PIXEL_BLEND(condition, widthvar) while ((condition)) { \
- Uint32 s = *srcp; \
- Uint32 d = *dstp; \
- Uint32 s1 = s & 0xff00ff; \
- Uint32 d1 = d & 0xff00ff; \
- d1 = (d1 + ((s1 - d1) * alpha >> 8)) \
- & 0xff00ff; \
- s &= 0xff00; \
- d &= 0xff00; \
- d = (d + ((s - d) * alpha >> 8)) & 0xff00; \
- *dstp = d1 | d | 0xff000000; \
- ++srcp; \
- ++dstp; \
- widthvar--; \
- }
- ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width);
- if (width > 0) {
- int extrawidth = (width % 4);
- vector unsigned char valigner = VEC_ALIGNER(srcp);
- vector unsigned char vs = (vector unsigned char)vec_ld(0, srcp);
- width -= extrawidth;
- while (width) {
- vector unsigned char voverflow;
- vector unsigned char vd;
-
- /* s = *srcp */
- voverflow = (vector unsigned char)vec_ld(15, srcp);
- vs = vec_perm(vs, voverflow, valigner);
-
- /* d = *dstp */
- vd = (vector unsigned char)vec_ld(0, dstp);
-
- VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1, v8);
-
- /* set the alpha channel to full on */
- vd = vec_or(vd, valphamask);
-
- /* *dstp = res */
- vec_st((vector unsigned int)vd, 0, dstp);
-
- srcp += 4;
- dstp += 4;
- width -= 4;
- vs = voverflow;
- }
- ONE_PIXEL_BLEND((extrawidth), extrawidth);
- }
-#undef ONE_PIXEL_BLEND
-
- srcp += srcskip;
- dstp += dstskip;
- }
-}
-#if __MWERKS__
-#pragma altivec_model off
-#endif
-#endif /* SDL_ALTIVEC_BLITTERS */
-
-/* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */
-static void BlitRGBtoRGBSurfaceAlpha128(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint32 *srcp = (Uint32 *)info->s_pixels;
- int srcskip = info->s_skip >> 2;
- Uint32 *dstp = (Uint32 *)info->d_pixels;
- int dstskip = info->d_skip >> 2;
-
- while(height--) {
- DUFFS_LOOP4({
- Uint32 s = *srcp++;
- Uint32 d = *dstp;
- *dstp++ = ((((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1)
- + (s & d & 0x00010101)) | 0xff000000;
- }, width);
- srcp += srcskip;
- dstp += dstskip;
- }
-}
-
-/* fast RGB888->(A)RGB888 blending with surface alpha */
-static void BlitRGBtoRGBSurfaceAlpha(SDL_BlitInfo *info)
-{
- unsigned alpha = info->src->alpha;
- if(alpha == 128) {
- BlitRGBtoRGBSurfaceAlpha128(info);
- } else {
- int width = info->d_width;
- int height = info->d_height;
- Uint32 *srcp = (Uint32 *)info->s_pixels;
- int srcskip = info->s_skip >> 2;
- Uint32 *dstp = (Uint32 *)info->d_pixels;
- int dstskip = info->d_skip >> 2;
- Uint32 s;
- Uint32 d;
- Uint32 s1;
- Uint32 d1;
-
- while(height--) {
- DUFFS_LOOP_DOUBLE2({
- /* One Pixel Blend */
- s = *srcp;
- d = *dstp;
- 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 | 0xff000000;
- ++srcp;
- ++dstp;
- },{
- /* Two Pixels Blend */
- s = *srcp;
- d = *dstp;
- s1 = s & 0xff00ff;
- d1 = d & 0xff00ff;
- d1 += (s1 - d1) * alpha >> 8;
- d1 &= 0xff00ff;
-
- s = ((s & 0xff00) >> 8) |
- ((srcp[1] & 0xff00) << 8);
- d = ((d & 0xff00) >> 8) |
- ((dstp[1] & 0xff00) << 8);
- d += (s - d) * alpha >> 8;
- d &= 0x00ff00ff;
-
- *dstp++ = d1 | ((d << 8) & 0xff00) | 0xff000000;
- ++srcp;
-
- s1 = *srcp;
- d1 = *dstp;
- s1 &= 0xff00ff;
- d1 &= 0xff00ff;
- d1 += (s1 - d1) * alpha >> 8;
- d1 &= 0xff00ff;
-
- *dstp = d1 | ((d >> 8) & 0xff00) | 0xff000000;
- ++srcp;
- ++dstp;
- }, width);
- srcp += srcskip;
- dstp += dstskip;
- }
- }
-}
-
-/* fast ARGB888->(A)RGB888 blending with pixel alpha */
-static void BlitRGBtoRGBPixelAlpha(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint32 *srcp = (Uint32 *)info->s_pixels;
- int srcskip = info->s_skip >> 2;
- Uint32 *dstp = (Uint32 *)info->d_pixels;
- int dstskip = info->d_skip >> 2;
-
- while(height--) {
- DUFFS_LOOP4({
- Uint32 dalpha;
- Uint32 d;
- Uint32 s1;
- Uint32 d1;
- Uint32 s = *srcp;
- Uint32 alpha = s >> 24;
- /* FIXME: Here we special-case opaque alpha since the
- compositioning used (>>8 instead of /255) doesn't handle
- it correctly. Also special-case alpha=0 for speed?
- Benchmark this! */
- if(alpha) {
- if(alpha == SDL_ALPHA_OPAQUE) {
- *dstp = (s & 0x00ffffff) | (*dstp & 0xff000000);
- } else {
- /*
- * take out the middle component (green), and process
- * the other two in parallel. One multiply less.
- */
- 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;
- }, width);
- srcp += srcskip;
- dstp += dstskip;
- }
-}
-
-#if GCC_ASMBLIT
-/* fast (as in MMX with prefetch) ARGB888->(A)RGB888 blending with pixel alpha */
-static void BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint32 *srcp = (Uint32 *)info->s_pixels;
- int srcskip = info->s_skip >> 2;
- Uint32 *dstp = (Uint32 *)info->d_pixels;
- int dstskip = info->d_skip >> 2;
- SDL_PixelFormat* sf = info->src;
- Uint32 amask = sf->Amask;
-
- __asm__ (
- /* make mm6 all zeros. */
- "pxor %%mm6, %%mm6\n"
-
- /* Make a mask to preserve the alpha. */
- "movd %0, %%mm7\n\t" /* 0000F000 -> mm7 */
- "punpcklbw %%mm7, %%mm7\n\t" /* FF000000 -> mm7 */
- "pcmpeqb %%mm4, %%mm4\n\t" /* FFFFFFFF -> mm4 */
- "movq %%mm4, %%mm3\n\t" /* FFFFFFFF -> mm3 (for later) */
- "pxor %%mm4, %%mm7\n\t" /* 00FFFFFF -> mm7 (mult mask) */
-
- /* form channel masks */
- "movq %%mm7, %%mm4\n\t" /* 00FFFFFF -> mm4 */
- "packsswb %%mm6, %%mm4\n\t" /* 00000FFF -> mm4 (channel mask) */
- "packsswb %%mm6, %%mm3\n\t" /* 0000FFFF -> mm3 */
- "pxor %%mm4, %%mm3\n\t" /* 0000F000 -> mm3 (~channel mask) */
-
- /* get alpha channel shift */
- "movd %1, %%mm5\n\t" /* Ashift -> mm5 */
-
- : /* nothing */ : "rm" (amask), "rm" ((Uint32) sf->Ashift) );
-
- while(height--) {
-
- DUFFS_LOOP4({
- Uint32 alpha;
-
- __asm__ (
- "prefetch 64(%0)\n"
- "prefetch 64(%1)\n"
- : : "r" (srcp), "r" (dstp) );
-
- alpha = *srcp & amask;
- /* FIXME: Here we special-case opaque alpha since the
- compositioning used (>>8 instead of /255) doesn't handle
- it correctly. Also special-case alpha=0 for speed?
- Benchmark this! */
- if(alpha == 0) {
- /* do nothing */
- }
- else if(alpha == amask) {
- /* opaque alpha -- copy RGB, keep dst alpha */
- /* using MMX here to free up regular registers for other things */
- __asm__ (
- "movd (%0), %%mm0\n\t" /* src(ARGB) -> mm0 (0000ARGB)*/
- "movd (%1), %%mm1\n\t" /* dst(ARGB) -> mm1 (0000ARGB)*/
- "pand %%mm4, %%mm0\n\t" /* src & chanmask -> mm0 */
- "pand %%mm3, %%mm1\n\t" /* dst & ~chanmask -> mm2 */
- "por %%mm0, %%mm1\n\t" /* src | dst -> mm1 */
- "movd %%mm1, (%1) \n\t" /* mm1 -> dst */
-
- : : "r" (srcp), "r" (dstp) );
- }
-
- else {
- __asm__ (
- /* load in the source, and dst. */
- "movd (%0), %%mm0\n" /* mm0(s) = 0 0 0 0 | As Rs Gs Bs */
- "movd (%1), %%mm1\n" /* mm1(d) = 0 0 0 0 | Ad Rd Gd Bd */
-
- /* Move the src alpha into mm2 */
-
- /* if supporting pshufw */
- /*"pshufw $0x55, %%mm0, %%mm2\n" */ /* mm2 = 0 As 0 As | 0 As 0 As */
- /*"psrlw $8, %%mm2\n" */
-
- /* else: */
- "movd %2, %%mm2\n"
- "psrld %%mm5, %%mm2\n" /* mm2 = 0 0 0 0 | 0 0 0 As */
- "punpcklwd %%mm2, %%mm2\n" /* mm2 = 0 0 0 0 | 0 As 0 As */
- "punpckldq %%mm2, %%mm2\n" /* mm2 = 0 As 0 As | 0 As 0 As */
- "pand %%mm7, %%mm2\n" /* to preserve dest alpha */
-
- /* move the colors into words. */
- "punpcklbw %%mm6, %%mm0\n" /* mm0 = 0 As 0 Rs | 0 Gs 0 Bs */
- "punpcklbw %%mm6, %%mm1\n" /* mm0 = 0 Ad 0 Rd | 0 Gd 0 Bd */
-
- /* src - dst */
- "psubw %%mm1, %%mm0\n" /* mm0 = As-Ad Rs-Rd | Gs-Gd Bs-Bd */
-
- /* A * (src-dst) */
- "pmullw %%mm2, %%mm0\n" /* mm0 = 0*As-d As*Rs-d | As*Gs-d As*Bs-d */
- "psrlw $8, %%mm0\n" /* mm0 = 0>>8 Rc>>8 | Gc>>8 Bc>>8 */
- "paddb %%mm1, %%mm0\n" /* mm0 = 0+Ad Rc+Rd | Gc+Gd Bc+Bd */
-
- "packuswb %%mm0, %%mm0\n" /* mm0 = | Ac Rc Gc Bc */
-
- "movd %%mm0, (%1)\n" /* result in mm0 */
-
- : : "r" (srcp), "r" (dstp), "r" (alpha) );
-
- }
- ++srcp;
- ++dstp;
- }, width);
- srcp += srcskip;
- dstp += dstskip;
- }
-
- __asm__ (
- "emms\n"
- : );
-}
-/* End GCC_ASMBLIT*/
-
-#elif MSVC_ASMBLIT
-/* fast (as in MMX with prefetch) ARGB888->(A)RGB888 blending with pixel alpha */
-static void BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint32 *srcp = (Uint32 *)info->s_pixels;
- int srcskip = info->s_skip >> 2;
- Uint32 *dstp = (Uint32 *)info->d_pixels;
- int dstskip = info->d_skip >> 2;
- SDL_PixelFormat* sf = info->src;
- Uint32 chanmask = sf->Rmask | sf->Gmask | sf->Bmask;
- Uint32 amask = sf->Amask;
- Uint32 ashift = sf->Ashift;
- Uint64 multmask;
-
- __m64 src1, dst1, mm_alpha, mm_zero, dmask;
-
- mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */
- multmask = ~(0xFFFFi64 << (ashift * 2));
- dmask = *(__m64*) &multmask; /* dst alpha mask -> dmask */
-
- while(height--) {
- DUFFS_LOOP4({
- Uint32 alpha;
-
- _m_prefetch(srcp + 16);
- _m_prefetch(dstp + 16);
-
- alpha = *srcp & amask;
- if (alpha == 0) {
- /* do nothing */
- } else if (alpha == amask) {
- /* copy RGB, keep dst alpha */
- *dstp = (*srcp & chanmask) | (*dstp & ~chanmask);
- } else {
- src1 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src1 (0000ARGB)*/
- src1 = _mm_unpacklo_pi8(src1, mm_zero); /* 0A0R0G0B -> src1 */
-
- dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB)*/
- dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* 0A0R0G0B -> dst1 */
-
- mm_alpha = _mm_cvtsi32_si64(alpha); /* alpha -> mm_alpha (0000000A) */
- mm_alpha = _mm_srli_si64(mm_alpha, ashift); /* mm_alpha >> ashift -> mm_alpha(0000000A) */
- mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */
- mm_alpha = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha */
- mm_alpha = _mm_and_si64(mm_alpha, dmask); /* 000A0A0A -> mm_alpha, preserve dst alpha on add */
-
- /* blend */
- src1 = _mm_sub_pi16(src1, dst1);/* src - dst -> src1 */
- src1 = _mm_mullo_pi16(src1, mm_alpha); /* (src - dst) * alpha -> src1 */
- src1 = _mm_srli_pi16(src1, 8); /* src1 >> 8 -> src1(000R0G0B) */
- dst1 = _mm_add_pi8(src1, dst1); /* src1 + dst1(dst) -> dst1(0A0R0G0B) */
- dst1 = _mm_packs_pu16(dst1, mm_zero); /* 0000ARGB -> dst1 */
-
- *dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */
- }
- ++srcp;
- ++dstp;
- }, width);
- srcp += srcskip;
- dstp += dstskip;
- }
- _mm_empty();
-}
-/* End MSVC_ASMBLIT */
-
-#endif /* GCC_ASMBLIT, MSVC_ASMBLIT */
-
-/* 16bpp special case for per-surface alpha=50%: blend 2 pixels in parallel */
-
-/* blend a single 16 bit pixel at 50% */
-#define BLEND16_50(d, s, mask) \
- ((((s & mask) + (d & mask)) >> 1) + (s & d & (~mask & 0xffff)))
-
-/* blend two 16 bit pixels at 50% */
-#define BLEND2x16_50(d, s, mask) \
- (((s & (mask | mask << 16)) >> 1) + ((d & (mask | mask << 16)) >> 1) \
- + (s & d & (~(mask | mask << 16))))
-
-static void Blit16to16SurfaceAlpha128(SDL_BlitInfo *info, Uint16 mask)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint16 *srcp = (Uint16 *)info->s_pixels;
- int srcskip = info->s_skip >> 1;
- Uint16 *dstp = (Uint16 *)info->d_pixels;
- int dstskip = info->d_skip >> 1;
-
- while(height--) {
- if(((uintptr_t)srcp ^ (uintptr_t)dstp) & 2) {
- /*
- * Source and destination not aligned, pipeline it.
- * This is mostly a win for big blits but no loss for
- * small ones
- */
- Uint32 prev_sw;
- int w = width;
-
- /* handle odd destination */
- if((uintptr_t)dstp & 2) {
- Uint16 d = *dstp, s = *srcp;
- *dstp = BLEND16_50(d, s, mask);
- dstp++;
- srcp++;
- w--;
- }
- srcp++; /* srcp is now 32-bit aligned */
-
- /* bootstrap pipeline with first halfword */
- prev_sw = ((Uint32 *)srcp)[-1];
-
- while(w > 1) {
- Uint32 sw, dw, s;
- sw = *(Uint32 *)srcp;
- dw = *(Uint32 *)dstp;
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
- s = (prev_sw << 16) + (sw >> 16);
-#else
- s = (prev_sw >> 16) + (sw << 16);
-#endif
- prev_sw = sw;
- *(Uint32 *)dstp = BLEND2x16_50(dw, s, mask);
- dstp += 2;
- srcp += 2;
- w -= 2;
- }
-
- /* final pixel if any */
- if(w) {
- Uint16 d = *dstp, s;
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
- s = (Uint16)prev_sw;
-#else
- s = (Uint16)(prev_sw >> 16);
-#endif
- *dstp = BLEND16_50(d, s, mask);
- srcp++;
- dstp++;
- }
- srcp += srcskip - 1;
- dstp += dstskip;
- } else {
- /* source and destination are aligned */
- int w = width;
-
- /* first odd pixel? */
- if((uintptr_t)srcp & 2) {
- Uint16 d = *dstp, s = *srcp;
- *dstp = BLEND16_50(d, s, mask);
- srcp++;
- dstp++;
- w--;
- }
- /* srcp and dstp are now 32-bit aligned */
-
- while(w > 1) {
- Uint32 sw = *(Uint32 *)srcp;
- Uint32 dw = *(Uint32 *)dstp;
- *(Uint32 *)dstp = BLEND2x16_50(dw, sw, mask);
- srcp += 2;
- dstp += 2;
- w -= 2;
- }
-
- /* last odd pixel? */
- if(w) {
- Uint16 d = *dstp, s = *srcp;
- *dstp = BLEND16_50(d, s, mask);
- srcp++;
- dstp++;
- }
- srcp += srcskip;
- dstp += dstskip;
- }
- }
-}
-
-#if GCC_ASMBLIT
-/* fast RGB565->RGB565 blending with surface alpha */
-static void Blit565to565SurfaceAlphaMMX(SDL_BlitInfo *info)
-{
- unsigned alpha = info->src->alpha; /* downscale alpha to 5 bits */
- if(alpha == 128) {
- Blit16to16SurfaceAlpha128(info, 0xf7de);
- } else {
- int width = info->d_width;
- int height = info->d_height;
- Uint16 *srcp = (Uint16 *)info->s_pixels;
- int srcskip = info->s_skip >> 1;
- Uint16 *dstp = (Uint16 *)info->d_pixels;
- int dstskip = info->d_skip >> 1;
- Uint32 s, d;
- Uint8 load[8];
-
- alpha &= ~(1+2+4); /* cut alpha to get the exact same behaviour */
- *(Uint64 *)load = alpha;
- alpha >>= 3; /* downscale alpha to 5 bits */
-
- movq_m2r(*load, mm0); /* alpha(0000000A) -> mm0 */
- punpcklwd_r2r(mm0, mm0); /* 00000A0A -> mm0 */
- punpcklwd_r2r(mm0, mm0); /* 0A0A0A0A -> mm0 */
- /* position alpha to allow for mullo and mulhi on diff channels
- to reduce the number of operations */
- psllq_i2r(3, mm0);
-
- /* Setup the 565 color channel masks */
- *(Uint64 *)load = 0x07E007E007E007E0ULL;
- movq_m2r(*load, mm4); /* MASKGREEN -> mm4 */
- *(Uint64 *)load = 0x001F001F001F001FULL;
- movq_m2r(*load, mm7); /* MASKBLUE -> mm7 */
- while(height--) {
- DUFFS_LOOP_QUATRO2(
- {
- s = *srcp++;
- d = *dstp;
- /*
- * shift out the middle component (green) to
- * the high 16 bits, and process all three RGB
- * components at the same time.
- */
- s = (s | s << 16) & 0x07e0f81f;
- d = (d | d << 16) & 0x07e0f81f;
- d += (s - d) * alpha >> 5;
- d &= 0x07e0f81f;
- *dstp++ = d | d >> 16;
- },{
- s = *srcp++;
- d = *dstp;
- /*
- * shift out the middle component (green) to
- * the high 16 bits, and process all three RGB
- * components at the same time.
- */
- s = (s | s << 16) & 0x07e0f81f;
- d = (d | d << 16) & 0x07e0f81f;
- d += (s - d) * alpha >> 5;
- d &= 0x07e0f81f;
- *dstp++ = d | d >> 16;
- s = *srcp++;
- d = *dstp;
- /*
- * shift out the middle component (green) to
- * the high 16 bits, and process all three RGB
- * components at the same time.
- */
- s = (s | s << 16) & 0x07e0f81f;
- d = (d | d << 16) & 0x07e0f81f;
- d += (s - d) * alpha >> 5;
- d &= 0x07e0f81f;
- *dstp++ = d | d >> 16;
- },{
- movq_m2r((*srcp), mm2);/* 4 src pixels -> mm2 */
- movq_m2r((*dstp), mm3);/* 4 dst pixels -> mm3 */
-
- /* red -- does not need a mask since the right shift clears
- the uninteresting bits */
- movq_r2r(mm2, mm5); /* src -> mm5 */
- movq_r2r(mm3, mm6); /* dst -> mm6 */
- psrlw_i2r(11, mm5); /* mm5 >> 11 -> mm5 [000r 000r 000r 000r] */
- psrlw_i2r(11, mm6); /* mm6 >> 11 -> mm6 [000r 000r 000r 000r] */
-
- /* blend */
- psubw_r2r(mm6, mm5);/* src - dst -> mm5 */
- pmullw_r2r(mm0, mm5); /* mm5 * alpha -> mm5 */
- /* alpha used is actually 11 bits
- 11 + 5 = 16 bits, so the sign bits are lost */
- psrlw_i2r(11, mm5); /* mm5 >> 11 -> mm5 */
- paddw_r2r(mm5, mm6); /* mm5 + mm6(dst) -> mm6 */
- psllw_i2r(11, mm6); /* mm6 << 11 -> mm6 */
-
- movq_r2r(mm6, mm1); /* save new reds in dsts */
-
- /* green -- process the bits in place */
- movq_r2r(mm2, mm5); /* src -> mm5 */
- movq_r2r(mm3, mm6); /* dst -> mm6 */
- pand_r2r(mm4, mm5); /* src & MASKGREEN -> mm5 */
- pand_r2r(mm4, mm6); /* dst & MASKGREEN -> mm6 */
-
- /* blend */
- psubw_r2r(mm6, mm5);/* src - dst -> mm5 */
- pmulhw_r2r(mm0, mm5); /* mm5 * alpha -> mm5 */
- /* 11 + 11 - 16 = 6 bits, so all the lower uninteresting
- bits are gone and the sign bits present */
- psllw_i2r(5, mm5); /* mm5 << 5 -> mm5 */
- paddw_r2r(mm5, mm6); /* mm5 + mm6(dst) -> mm6 */
-
- por_r2r(mm6, mm1); /* save new greens in dsts */
-
- /* blue */
- movq_r2r(mm2, mm5); /* src -> mm5 */
- movq_r2r(mm3, mm6); /* dst -> mm6 */
- pand_r2r(mm7, mm5); /* src & MASKBLUE -> mm5[000b 000b 000b 000b] */
- pand_r2r(mm7, mm6); /* dst & MASKBLUE -> mm6[000b 000b 000b 000b] */
-
- /* blend */
- psubw_r2r(mm6, mm5);/* src - dst -> mm5 */
- pmullw_r2r(mm0, mm5); /* mm5 * alpha -> mm5 */
- /* 11 + 5 = 16 bits, so the sign bits are lost and
- the interesting bits will need to be MASKed */
- psrlw_i2r(11, mm5); /* mm5 >> 11 -> mm5 */
- paddw_r2r(mm5, mm6); /* mm5 + mm6(dst) -> mm6 */
- pand_r2r(mm7, mm6); /* mm6 & MASKBLUE -> mm6[000b 000b 000b 000b] */
-
- por_r2r(mm6, mm1); /* save new blues in dsts */
-
- movq_r2m(mm1, *dstp); /* mm1 -> 4 dst pixels */
-
- srcp += 4;
- dstp += 4;
- }, width);
- srcp += srcskip;
- dstp += dstskip;
- }
- emms();
- }
-}
-
-/* fast RGB555->RGB555 blending with surface alpha */
-static void Blit555to555SurfaceAlphaMMX(SDL_BlitInfo *info)
-{
- unsigned alpha = info->src->alpha; /* downscale alpha to 5 bits */
- if(alpha == 128) {
- Blit16to16SurfaceAlpha128(info, 0xfbde);
- } else {
- int width = info->d_width;
- int height = info->d_height;
- Uint16 *srcp = (Uint16 *)info->s_pixels;
- int srcskip = info->s_skip >> 1;
- Uint16 *dstp = (Uint16 *)info->d_pixels;
- int dstskip = info->d_skip >> 1;
- Uint32 s, d;
- Uint8 load[8];
-
- alpha &= ~(1+2+4); /* cut alpha to get the exact same behaviour */
- *(Uint64 *)load = alpha;
- alpha >>= 3; /* downscale alpha to 5 bits */
-
- movq_m2r(*load, mm0); /* alpha(0000000A) -> mm0 */
- punpcklwd_r2r(mm0, mm0); /* 00000A0A -> mm0 */
- punpcklwd_r2r(mm0, mm0); /* 0A0A0A0A -> mm0 */
- /* position alpha to allow for mullo and mulhi on diff channels
- to reduce the number of operations */
- psllq_i2r(3, mm0);
-
- /* Setup the 555 color channel masks */
- *(Uint64 *)load = 0x03E003E003E003E0ULL;
- movq_m2r(*load, mm4); /* MASKGREEN -> mm4 */
- *(Uint64 *)load = 0x001F001F001F001FULL;
- movq_m2r(*load, mm7); /* MASKBLUE -> mm7 */
- while(height--) {
- DUFFS_LOOP_QUATRO2(
- {
- s = *srcp++;
- d = *dstp;
- /*
- * shift out the middle component (green) to
- * the high 16 bits, and process all three RGB
- * components at the same time.
- */
- s = (s | s << 16) & 0x03e07c1f;
- d = (d | d << 16) & 0x03e07c1f;
- d += (s - d) * alpha >> 5;
- d &= 0x03e07c1f;
- *dstp++ = d | d >> 16;
- },{
- s = *srcp++;
- d = *dstp;
- /*
- * shift out the middle component (green) to
- * the high 16 bits, and process all three RGB
- * components at the same time.
- */
- s = (s | s << 16) & 0x03e07c1f;
- d = (d | d << 16) & 0x03e07c1f;
- d += (s - d) * alpha >> 5;
- d &= 0x03e07c1f;
- *dstp++ = d | d >> 16;
- s = *srcp++;
- d = *dstp;
- /*
- * shift out the middle component (green) to
- * the high 16 bits, and process all three RGB
- * components at the same time.
- */
- s = (s | s << 16) & 0x03e07c1f;
- d = (d | d << 16) & 0x03e07c1f;
- d += (s - d) * alpha >> 5;
- d &= 0x03e07c1f;
- *dstp++ = d | d >> 16;
- },{
- movq_m2r((*srcp), mm2);/* 4 src pixels -> mm2 */
- movq_m2r((*dstp), mm3);/* 4 dst pixels -> mm3 */
-
- /* red -- process the bits in place */
- psllq_i2r(5, mm4); /* turn MASKGREEN into MASKRED */
- /* by reusing the GREEN mask we free up another mmx
- register to accumulate the result */
-
- movq_r2r(mm2, mm5); /* src -> mm5 */
- movq_r2r(mm3, mm6); /* dst -> mm6 */
- pand_r2r(mm4, mm5); /* src & MASKRED -> mm5 */
- pand_r2r(mm4, mm6); /* dst & MASKRED -> mm6 */
-
- /* blend */
- psubw_r2r(mm6, mm5);/* src - dst -> mm5 */
- pmulhw_r2r(mm0, mm5); /* mm5 * alpha -> mm5 */
- /* 11 + 15 - 16 = 10 bits, uninteresting bits will be
- cleared by a MASK below */
- psllw_i2r(5, mm5); /* mm5 << 5 -> mm5 */
- paddw_r2r(mm5, mm6); /* mm5 + mm6(dst) -> mm6 */
- pand_r2r(mm4, mm6); /* mm6 & MASKRED -> mm6 */
-
- psrlq_i2r(5, mm4); /* turn MASKRED back into MASKGREEN */
-
- movq_r2r(mm6, mm1); /* save new reds in dsts */
-
- /* green -- process the bits in place */
- movq_r2r(mm2, mm5); /* src -> mm5 */
- movq_r2r(mm3, mm6); /* dst -> mm6 */
- pand_r2r(mm4, mm5); /* src & MASKGREEN -> mm5 */
- pand_r2r(mm4, mm6); /* dst & MASKGREEN -> mm6 */
-
- /* blend */
- psubw_r2r(mm6, mm5);/* src - dst -> mm5 */
- pmulhw_r2r(mm0, mm5); /* mm5 * alpha -> mm5 */
- /* 11 + 10 - 16 = 5 bits, so all the lower uninteresting
- bits are gone and the sign bits present */
- psllw_i2r(5, mm5); /* mm5 << 5 -> mm5 */
- paddw_r2r(mm5, mm6); /* mm5 + mm6(dst) -> mm6 */
-
- por_r2r(mm6, mm1); /* save new greens in dsts */
-
- /* blue */
- movq_r2r(mm2, mm5); /* src -> mm5 */
- movq_r2r(mm3, mm6); /* dst -> mm6 */
- pand_r2r(mm7, mm5); /* src & MASKBLUE -> mm5[000b 000b 000b 000b] */
- pand_r2r(mm7, mm6); /* dst & MASKBLUE -> mm6[000b 000b 000b 000b] */
-
- /* blend */
- psubw_r2r(mm6, mm5);/* src - dst -> mm5 */
- pmullw_r2r(mm0, mm5); /* mm5 * alpha -> mm5 */
- /* 11 + 5 = 16 bits, so the sign bits are lost and
- the interesting bits will need to be MASKed */
- psrlw_i2r(11, mm5); /* mm5 >> 11 -> mm5 */
- paddw_r2r(mm5, mm6); /* mm5 + mm6(dst) -> mm6 */
- pand_r2r(mm7, mm6); /* mm6 & MASKBLUE -> mm6[000b 000b 000b 000b] */
-
- por_r2r(mm6, mm1); /* save new blues in dsts */
-
- movq_r2m(mm1, *dstp);/* mm1 -> 4 dst pixels */
-
- srcp += 4;
- dstp += 4;
- }, width);
- srcp += srcskip;
- dstp += dstskip;
- }
- emms();
- }
-}
-/* End GCC_ASMBLIT */
-
-#elif MSVC_ASMBLIT
-/* fast RGB565->RGB565 blending with surface alpha */
-static void Blit565to565SurfaceAlphaMMX(SDL_BlitInfo *info)
-{
- unsigned alpha = info->src->alpha;
- if(alpha == 128) {
- Blit16to16SurfaceAlpha128(info, 0xf7de);
- } else {
- int width = info->d_width;
- int height = info->d_height;
- Uint16 *srcp = (Uint16 *)info->s_pixels;
- int srcskip = info->s_skip >> 1;
- Uint16 *dstp = (Uint16 *)info->d_pixels;
- int dstskip = info->d_skip >> 1;
- Uint32 s, d;
-
- __m64 src1, dst1, src2, dst2, gmask, bmask, mm_res, mm_alpha;
-
- alpha &= ~(1+2+4); /* cut alpha to get the exact same behaviour */
- mm_alpha = _mm_set_pi32(0, alpha); /* 0000000A -> mm_alpha */
- alpha >>= 3; /* downscale alpha to 5 bits */
-
- mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */
- mm_alpha = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha */
- /* position alpha to allow for mullo and mulhi on diff channels
- to reduce the number of operations */
- mm_alpha = _mm_slli_si64(mm_alpha, 3);
-
- /* Setup the 565 color channel masks */
- gmask = _mm_set_pi32(0x07E007E0, 0x07E007E0); /* MASKGREEN -> gmask */
- bmask = _mm_set_pi32(0x001F001F, 0x001F001F); /* MASKBLUE -> bmask */
-
- while(height--) {
- DUFFS_LOOP_QUATRO2(
- {
- s = *srcp++;
- d = *dstp;
- /*
- * shift out the middle component (green) to
- * the high 16 bits, and process all three RGB
- * components at the same time.
- */
- s = (s | s << 16) & 0x07e0f81f;
- d = (d | d << 16) & 0x07e0f81f;
- d += (s - d) * alpha >> 5;
- d &= 0x07e0f81f;
- *dstp++ = (Uint16)(d | d >> 16);
- },{
- s = *srcp++;
- d = *dstp;
- /*
- * shift out the middle component (green) to
- * the high 16 bits, and process all three RGB
- * components at the same time.
- */
- s = (s | s << 16) & 0x07e0f81f;
- d = (d | d << 16) & 0x07e0f81f;
- d += (s - d) * alpha >> 5;
- d &= 0x07e0f81f;
- *dstp++ = (Uint16)(d | d >> 16);
- s = *srcp++;
- d = *dstp;
- /*
- * shift out the middle component (green) to
- * the high 16 bits, and process all three RGB
- * components at the same time.
- */
- s = (s | s << 16) & 0x07e0f81f;
- d = (d | d << 16) & 0x07e0f81f;
- d += (s - d) * alpha >> 5;
- d &= 0x07e0f81f;
- *dstp++ = (Uint16)(d | d >> 16);
- },{
- src1 = *(__m64*)srcp; /* 4 src pixels -> src1 */
- dst1 = *(__m64*)dstp; /* 4 dst pixels -> dst1 */
-
- /* red */
- src2 = src1;
- src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 [000r 000r 000r 000r] */
-
- dst2 = dst1;
- dst2 = _mm_srli_pi16(dst2, 11); /* dst2 >> 11 -> dst2 [000r 000r 000r 000r] */
-
- /* blend */
- src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
- src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
- src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 */
- dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
- dst2 = _mm_slli_pi16(dst2, 11); /* dst2 << 11 -> dst2 */
-
- mm_res = dst2; /* RED -> mm_res */
-
- /* green -- process the bits in place */
- src2 = src1;
- src2 = _mm_and_si64(src2, gmask); /* src & MASKGREEN -> src2 */
-
- dst2 = dst1;
- dst2 = _mm_and_si64(dst2, gmask); /* dst & MASKGREEN -> dst2 */
-
- /* blend */
- src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
- src2 = _mm_mulhi_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
- src2 = _mm_slli_pi16(src2, 5); /* src2 << 5 -> src2 */
- dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
-
- mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN -> mm_res */
-
- /* blue */
- src2 = src1;
- src2 = _mm_and_si64(src2, bmask); /* src & MASKBLUE -> src2[000b 000b 000b 000b] */
-
- dst2 = dst1;
- dst2 = _mm_and_si64(dst2, bmask); /* dst & MASKBLUE -> dst2[000b 000b 000b 000b] */
-
- /* blend */
- src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
- src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
- src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 */
- dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
- dst2 = _mm_and_si64(dst2, bmask); /* dst2 & MASKBLUE -> dst2 */
-
- mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN | BLUE -> mm_res */
-
- *(__m64*)dstp = mm_res; /* mm_res -> 4 dst pixels */
-
- srcp += 4;
- dstp += 4;
- }, width);
- srcp += srcskip;
- dstp += dstskip;
- }
- _mm_empty();
- }
-}
-
-/* fast RGB555->RGB555 blending with surface alpha */
-static void Blit555to555SurfaceAlphaMMX(SDL_BlitInfo *info)
-{
- unsigned alpha = info->src->alpha;
- if(alpha == 128) {
- Blit16to16SurfaceAlpha128(info, 0xfbde);
- } else {
- int width = info->d_width;
- int height = info->d_height;
- Uint16 *srcp = (Uint16 *)info->s_pixels;
- int srcskip = info->s_skip >> 1;
- Uint16 *dstp = (Uint16 *)info->d_pixels;
- int dstskip = info->d_skip >> 1;
- Uint32 s, d;
-
- __m64 src1, dst1, src2, dst2, rmask, gmask, bmask, mm_res, mm_alpha;
-
- alpha &= ~(1+2+4); /* cut alpha to get the exact same behaviour */
- mm_alpha = _mm_set_pi32(0, alpha); /* 0000000A -> mm_alpha */
- alpha >>= 3; /* downscale alpha to 5 bits */
-
- mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */
- mm_alpha = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha */
- /* position alpha to allow for mullo and mulhi on diff channels
- to reduce the number of operations */
- mm_alpha = _mm_slli_si64(mm_alpha, 3);
-
- /* Setup the 555 color channel masks */
- rmask = _mm_set_pi32(0x7C007C00, 0x7C007C00); /* MASKRED -> rmask */
- gmask = _mm_set_pi32(0x03E003E0, 0x03E003E0); /* MASKGREEN -> gmask */
- bmask = _mm_set_pi32(0x001F001F, 0x001F001F); /* MASKBLUE -> bmask */
-
- while(height--) {
- DUFFS_LOOP_QUATRO2(
- {
- s = *srcp++;
- d = *dstp;
- /*
- * shift out the middle component (green) to
- * the high 16 bits, and process all three RGB
- * components at the same time.
- */
- s = (s | s << 16) & 0x03e07c1f;
- d = (d | d << 16) & 0x03e07c1f;
- d += (s - d) * alpha >> 5;
- d &= 0x03e07c1f;
- *dstp++ = (Uint16)(d | d >> 16);
- },{
- s = *srcp++;
- d = *dstp;
- /*
- * shift out the middle component (green) to
- * the high 16 bits, and process all three RGB
- * components at the same time.
- */
- s = (s | s << 16) & 0x03e07c1f;
- d = (d | d << 16) & 0x03e07c1f;
- d += (s - d) * alpha >> 5;
- d &= 0x03e07c1f;
- *dstp++ = (Uint16)(d | d >> 16);
- s = *srcp++;
- d = *dstp;
- /*
- * shift out the middle component (green) to
- * the high 16 bits, and process all three RGB
- * components at the same time.
- */
- s = (s | s << 16) & 0x03e07c1f;
- d = (d | d << 16) & 0x03e07c1f;
- d += (s - d) * alpha >> 5;
- d &= 0x03e07c1f;
- *dstp++ = (Uint16)(d | d >> 16);
- },{
- src1 = *(__m64*)srcp; /* 4 src pixels -> src1 */
- dst1 = *(__m64*)dstp; /* 4 dst pixels -> dst1 */
-
- /* red -- process the bits in place */
- src2 = src1;
- src2 = _mm_and_si64(src2, rmask); /* src & MASKRED -> src2 */
-
- dst2 = dst1;
- dst2 = _mm_and_si64(dst2, rmask); /* dst & MASKRED -> dst2 */
-
- /* blend */
- src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
- src2 = _mm_mulhi_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
- src2 = _mm_slli_pi16(src2, 5); /* src2 << 5 -> src2 */
- dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
- dst2 = _mm_and_si64(dst2, rmask); /* dst2 & MASKRED -> dst2 */
-
- mm_res = dst2; /* RED -> mm_res */
-
- /* green -- process the bits in place */
- src2 = src1;
- src2 = _mm_and_si64(src2, gmask); /* src & MASKGREEN -> src2 */
-
- dst2 = dst1;
- dst2 = _mm_and_si64(dst2, gmask); /* dst & MASKGREEN -> dst2 */
-
- /* blend */
- src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
- src2 = _mm_mulhi_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
- src2 = _mm_slli_pi16(src2, 5); /* src2 << 5 -> src2 */
- dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
-
- mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN -> mm_res */
-
- /* blue */
- src2 = src1; /* src -> src2 */
- src2 = _mm_and_si64(src2, bmask); /* src & MASKBLUE -> src2[000b 000b 000b 000b] */
-
- dst2 = dst1; /* dst -> dst2 */
- dst2 = _mm_and_si64(dst2, bmask); /* dst & MASKBLUE -> dst2[000b 000b 000b 000b] */
-
- /* blend */
- src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
- src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
- src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 */
- dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
- dst2 = _mm_and_si64(dst2, bmask); /* dst2 & MASKBLUE -> dst2 */
-
- mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN | BLUE -> mm_res */
-
- *(__m64*)dstp = mm_res; /* mm_res -> 4 dst pixels */
-
- srcp += 4;
- dstp += 4;
- }, width);
- srcp += srcskip;
- dstp += dstskip;
- }
- _mm_empty();
- }
-}
-#endif /* GCC_ASMBLIT, MSVC_ASMBLIT */
-
-/* fast RGB565->RGB565 blending with surface alpha */
-static void Blit565to565SurfaceAlpha(SDL_BlitInfo *info)
-{
- unsigned alpha = info->src->alpha;
- if(alpha == 128) {
- Blit16to16SurfaceAlpha128(info, 0xf7de);
- } else {
- int width = info->d_width;
- int height = info->d_height;
- Uint16 *srcp = (Uint16 *)info->s_pixels;
- int srcskip = info->s_skip >> 1;
- Uint16 *dstp = (Uint16 *)info->d_pixels;
- int dstskip = info->d_skip >> 1;
- alpha >>= 3; /* downscale alpha to 5 bits */
-
- while(height--) {
- DUFFS_LOOP4({
- Uint32 s = *srcp++;
- Uint32 d = *dstp;
- /*
- * shift out the middle component (green) to
- * the high 16 bits, and process all three RGB
- * components at the same time.
- */
- s = (s | s << 16) & 0x07e0f81f;
- d = (d | d << 16) & 0x07e0f81f;
- d += (s - d) * alpha >> 5;
- d &= 0x07e0f81f;
- *dstp++ = (Uint16)(d | d >> 16);
- }, width);
- srcp += srcskip;
- dstp += dstskip;
- }
- }
-}
-
-/* fast RGB555->RGB555 blending with surface alpha */
-static void Blit555to555SurfaceAlpha(SDL_BlitInfo *info)
-{
- unsigned alpha = info->src->alpha; /* downscale alpha to 5 bits */
- if(alpha == 128) {
- Blit16to16SurfaceAlpha128(info, 0xfbde);
- } else {
- int width = info->d_width;
- int height = info->d_height;
- Uint16 *srcp = (Uint16 *)info->s_pixels;
- int srcskip = info->s_skip >> 1;
- Uint16 *dstp = (Uint16 *)info->d_pixels;
- int dstskip = info->d_skip >> 1;
- alpha >>= 3; /* downscale alpha to 5 bits */
-
- while(height--) {
- DUFFS_LOOP4({
- Uint32 s = *srcp++;
- Uint32 d = *dstp;
- /*
- * shift out the middle component (green) to
- * the high 16 bits, and process all three RGB
- * components at the same time.
- */
- s = (s | s << 16) & 0x03e07c1f;
- d = (d | d << 16) & 0x03e07c1f;
- d += (s - d) * alpha >> 5;
- d &= 0x03e07c1f;
- *dstp++ = (Uint16)(d | d >> 16);
- }, width);
- srcp += srcskip;
- dstp += dstskip;
- }
- }
-}
-
-/* fast ARGB8888->RGB565 blending with pixel alpha */
-static void BlitARGBto565PixelAlpha(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint32 *srcp = (Uint32 *)info->s_pixels;
- int srcskip = info->s_skip >> 2;
- Uint16 *dstp = (Uint16 *)info->d_pixels;
- int dstskip = info->d_skip >> 1;
-
- while(height--) {
- DUFFS_LOOP4({
- Uint32 s = *srcp;
- unsigned alpha = s >> 27; /* downscale alpha to 5 bits */
- /* FIXME: Here we special-case opaque alpha since the
- compositioning used (>>8 instead of /255) doesn't handle
- it correctly. Also special-case alpha=0 for speed?
- Benchmark this! */
- if(alpha) {
- if(alpha == (SDL_ALPHA_OPAQUE >> 3)) {
- *dstp = (Uint16)((s >> 8 & 0xf800) + (s >> 5 & 0x7e0) + (s >> 3 & 0x1f));
- } else {
- Uint32 d = *dstp;
- /*
- * convert source and destination to G0RAB65565
- * and blend all components at the same time
- */
- s = ((s & 0xfc00) << 11) + (s >> 8 & 0xf800)
- + (s >> 3 & 0x1f);
- d = (d | d << 16) & 0x07e0f81f;
- d += (s - d) * alpha >> 5;
- d &= 0x07e0f81f;
- *dstp = (Uint16)(d | d >> 16);
- }
- }
- srcp++;
- dstp++;
- }, width);
- srcp += srcskip;
- dstp += dstskip;
- }
-}
-
-/* fast ARGB8888->RGB555 blending with pixel alpha */
-static void BlitARGBto555PixelAlpha(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint32 *srcp = (Uint32 *)info->s_pixels;
- int srcskip = info->s_skip >> 2;
- Uint16 *dstp = (Uint16 *)info->d_pixels;
- int dstskip = info->d_skip >> 1;
-
- while(height--) {
- DUFFS_LOOP4({
- unsigned alpha;
- Uint32 s = *srcp;
- alpha = s >> 27; /* downscale alpha to 5 bits */
- /* FIXME: Here we special-case opaque alpha since the
- compositioning used (>>8 instead of /255) doesn't handle
- it correctly. Also special-case alpha=0 for speed?
- Benchmark this! */
- if(alpha) {
- if(alpha == (SDL_ALPHA_OPAQUE >> 3)) {
- *dstp = (Uint16)((s >> 9 & 0x7c00) + (s >> 6 & 0x3e0) + (s >> 3 & 0x1f));
- } else {
- Uint32 d = *dstp;
- /*
- * convert source and destination to G0RAB65565
- * and blend all components at the same time
- */
- s = ((s & 0xf800) << 10) + (s >> 9 & 0x7c00)
- + (s >> 3 & 0x1f);
- d = (d | d << 16) & 0x03e07c1f;
- d += (s - d) * alpha >> 5;
- d &= 0x03e07c1f;
- *dstp = (Uint16)(d | d >> 16);
- }
- }
- srcp++;
- dstp++;
- }, width);
- srcp += srcskip;
- dstp += dstskip;
- }
-}
-
-/* General (slow) N->N blending with per-surface alpha */
-static void BlitNtoNSurfaceAlpha(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- int srcskip = info->s_skip;
- Uint8 *dst = info->d_pixels;
- int dstskip = info->d_skip;
- SDL_PixelFormat *srcfmt = info->src;
- SDL_PixelFormat *dstfmt = info->dst;
- int srcbpp = srcfmt->BytesPerPixel;
- int dstbpp = dstfmt->BytesPerPixel;
- unsigned sA = srcfmt->alpha;
- unsigned dA = dstfmt->Amask ? SDL_ALPHA_OPAQUE : 0;
-
- if(sA) {
- while ( height-- ) {
- 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);
- ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
- src += srcbpp;
- dst += dstbpp;
- },
- width);
- src += srcskip;
- dst += dstskip;
- }
- }
-}
-
-/* General (slow) colorkeyed N->N blending with per-surface alpha */
-static void BlitNtoNSurfaceAlphaKey(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- int srcskip = info->s_skip;
- Uint8 *dst = info->d_pixels;
- int dstskip = info->d_skip;
- SDL_PixelFormat *srcfmt = info->src;
- SDL_PixelFormat *dstfmt = info->dst;
- Uint32 ckey = srcfmt->colorkey;
- int srcbpp = srcfmt->BytesPerPixel;
- int dstbpp = dstfmt->BytesPerPixel;
- unsigned sA = srcfmt->alpha;
- unsigned dA = dstfmt->Amask ? SDL_ALPHA_OPAQUE : 0;
-
- while ( height-- ) {
- 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);
- ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
- }
- src += srcbpp;
- dst += dstbpp;
- },
- width);
- src += srcskip;
- dst += dstskip;
- }
-}
-
-/* General (slow) N->N blending with pixel alpha */
-static void BlitNtoNPixelAlpha(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- int srcskip = info->s_skip;
- Uint8 *dst = info->d_pixels;
- int dstskip = info->d_skip;
- SDL_PixelFormat *srcfmt = info->src;
- SDL_PixelFormat *dstfmt = info->dst;
-
- int srcbpp;
- int dstbpp;
-
- /* Set up some basic variables */
- srcbpp = srcfmt->BytesPerPixel;
- dstbpp = dstfmt->BytesPerPixel;
-
- /* FIXME: for 8bpp source alpha, this doesn't get opaque values
- quite right. for <8bpp source alpha, it gets them very wrong
- (check all macros!)
- It is unclear whether there is a good general solution that doesn't
- need a branch (or a divide). */
- while ( height-- ) {
- 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);
- }
- src += srcbpp;
- dst += dstbpp;
- },
- width);
- src += srcskip;
- dst += dstskip;
- }
-}
-
-
-SDL_loblit SDL_CalculateAlphaBlit(SDL_Surface *surface, int blit_index)
-{
- SDL_PixelFormat *sf = surface->format;
- SDL_PixelFormat *df = surface->map->dst->format;
-
- if(sf->Amask == 0) {
- if((surface->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY) {
- if(df->BytesPerPixel == 1)
- return BlitNto1SurfaceAlphaKey;
- else
-#if SDL_ALTIVEC_BLITTERS
- if (sf->BytesPerPixel == 4 && df->BytesPerPixel == 4 &&
- !(surface->map->dst->flags & SDL_HWSURFACE) && SDL_HasAltiVec())
- return Blit32to32SurfaceAlphaKeyAltivec;
- else
-#endif
- return BlitNtoNSurfaceAlphaKey;
- } else {
- /* Per-surface alpha blits */
- switch(df->BytesPerPixel) {
- case 1:
- return BlitNto1SurfaceAlpha;
-
- case 2:
- if(surface->map->identity) {
- if(df->Gmask == 0x7e0)
- {
-#if MMX_ASMBLIT
- if(SDL_HasMMX())
- return Blit565to565SurfaceAlphaMMX;
- else
-#endif
- return Blit565to565SurfaceAlpha;
- }
- else if(df->Gmask == 0x3e0)
- {
-#if MMX_ASMBLIT
- if(SDL_HasMMX())
- return Blit555to555SurfaceAlphaMMX;
- else
-#endif
- return Blit555to555SurfaceAlpha;
- }
- }
- return BlitNtoNSurfaceAlpha;
-
- case 4:
- if(sf->Rmask == df->Rmask
- && sf->Gmask == df->Gmask
- && sf->Bmask == df->Bmask
- && sf->BytesPerPixel == 4)
- {
-#if MMX_ASMBLIT
- if(sf->Rshift % 8 == 0
- && sf->Gshift % 8 == 0
- && sf->Bshift % 8 == 0
- && SDL_HasMMX())
- return BlitRGBtoRGBSurfaceAlphaMMX;
-#endif
- if((sf->Rmask | sf->Gmask | sf->Bmask) == 0xffffff)
- {
-#if SDL_ALTIVEC_BLITTERS
- if(!(surface->map->dst->flags & SDL_HWSURFACE)
- && SDL_HasAltiVec())
- return BlitRGBtoRGBSurfaceAlphaAltivec;
-#endif
- return BlitRGBtoRGBSurfaceAlpha;
- }
- }
-#if SDL_ALTIVEC_BLITTERS
- if((sf->BytesPerPixel == 4) &&
- !(surface->map->dst->flags & SDL_HWSURFACE) && SDL_HasAltiVec())
- return Blit32to32SurfaceAlphaAltivec;
- else
-#endif
- return BlitNtoNSurfaceAlpha;
-
- case 3:
- default:
- return BlitNtoNSurfaceAlpha;
- }
- }
- } else {
- /* Per-pixel alpha blits */
- switch(df->BytesPerPixel) {
- case 1:
- return BlitNto1PixelAlpha;
-
- case 2:
-#if SDL_ALTIVEC_BLITTERS
- if(sf->BytesPerPixel == 4 && !(surface->map->dst->flags & SDL_HWSURFACE) &&
- df->Gmask == 0x7e0 &&
- df->Bmask == 0x1f && SDL_HasAltiVec())
- return Blit32to565PixelAlphaAltivec;
- else
-#endif
- if(sf->BytesPerPixel == 4 && sf->Amask == 0xff000000
- && sf->Gmask == 0xff00
- && ((sf->Rmask == 0xff && df->Rmask == 0x1f)
- || (sf->Bmask == 0xff && df->Bmask == 0x1f))) {
- if(df->Gmask == 0x7e0)
- return BlitARGBto565PixelAlpha;
- else if(df->Gmask == 0x3e0)
- return BlitARGBto555PixelAlpha;
- }
- return BlitNtoNPixelAlpha;
-
- case 4:
- if(sf->Rmask == df->Rmask
- && sf->Gmask == df->Gmask
- && sf->Bmask == df->Bmask
- && sf->BytesPerPixel == 4)
- {
-#if MMX_ASMBLIT
- if(sf->Rshift % 8 == 0
- && sf->Gshift % 8 == 0
- && sf->Bshift % 8 == 0
- && sf->Ashift % 8 == 0
- && sf->Aloss == 0)
- {
- if(SDL_Has3DNow())
- return BlitRGBtoRGBPixelAlphaMMX3DNOW;
- if(SDL_HasMMX())
- return BlitRGBtoRGBPixelAlphaMMX;
- }
-#endif
- if(sf->Amask == 0xff000000)
- {
-#if SDL_ALTIVEC_BLITTERS
- if(!(surface->map->dst->flags & SDL_HWSURFACE)
- && SDL_HasAltiVec())
- return BlitRGBtoRGBPixelAlphaAltivec;
-#endif
- return BlitRGBtoRGBPixelAlpha;
- }
- }
-#if SDL_ALTIVEC_BLITTERS
- if (sf->Amask && sf->BytesPerPixel == 4 &&
- !(surface->map->dst->flags & SDL_HWSURFACE) && SDL_HasAltiVec())
- return Blit32to32PixelAlphaAltivec;
- else
-#endif
- return BlitNtoNPixelAlpha;
-
- case 3:
- default:
- return BlitNtoNPixelAlpha;
- }
- }
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/SDL_blit_N.c b/distrib/sdl-1.2.12/src/video/SDL_blit_N.c
deleted file mode 100644
index 91d66ee..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_blit_N.c
+++ /dev/null
@@ -1,2490 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-#include "SDL_endian.h"
-#include "SDL_cpuinfo.h"
-#include "SDL_blit.h"
-
-/* Functions to blit from N-bit surfaces to other surfaces */
-
-#if SDL_ALTIVEC_BLITTERS
-#if __MWERKS__
-#pragma altivec_model on
-#endif
-#ifdef HAVE_ALTIVEC_H
-#include <altivec.h>
-#endif
-#define assert(X)
-#ifdef __MACOSX__
-#include <sys/sysctl.h>
-static size_t GetL3CacheSize( void )
-{
- const char key[] = "hw.l3cachesize";
- u_int64_t result = 0;
- size_t typeSize = sizeof( result );
-
-
- int err = sysctlbyname( key, &result, &typeSize, NULL, 0 );
- if( 0 != err ) return 0;
-
- return result;
-}
-#else
-static size_t GetL3CacheSize( void )
-{
- /* XXX: Just guess G4 */
- return 2097152;
-}
-#endif /* __MACOSX__ */
-
-#if (defined(__MACOSX__) && (__GNUC__ < 4))
- #define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
- (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 VSWIZZLE32(a,b,c,d) (vector unsigned char) \
- ( 0x00+a, 0x00+b, 0x00+c, 0x00+d, \
- 0x04+a, 0x04+b, 0x04+c, 0x04+d, \
- 0x08+a, 0x08+b, 0x08+c, 0x08+d, \
- 0x0C+a, 0x0C+b, 0x0C+c, 0x0C+d )
-
-#define MAKE8888(dstfmt, r, g, b, a) \
- ( ((r<<dstfmt->Rshift)&dstfmt->Rmask) | \
- ((g<<dstfmt->Gshift)&dstfmt->Gmask) | \
- ((b<<dstfmt->Bshift)&dstfmt->Bmask) | \
- ((a<<dstfmt->Ashift)&dstfmt->Amask) )
-
-/*
- * Data Stream Touch...Altivec cache prefetching.
- *
- * Don't use this on a G5...however, the speed boost is very significant
- * on a G4.
- */
-#define DST_CHAN_SRC 1
-#define DST_CHAN_DEST 2
-
-/* macro to set DST control word value... */
-#define DST_CTRL(size, count, stride) \
- (((size) << 24) | ((count) << 16) | (stride))
-
-#define VEC_ALIGNER(src) ((UNALIGNED_PTR(src)) \
- ? vec_lvsl(0, src) \
- : vec_add(vec_lvsl(8, src), vec_splat_u8(8)))
-
-/* Calculate the permute vector used for 32->32 swizzling */
-static vector unsigned char calc_swizzle32(const SDL_PixelFormat *srcfmt,
- const SDL_PixelFormat *dstfmt)
-{
- /*
- * We have to assume that the bits that aren't used by other
- * colors is alpha, and it's one complete byte, since some formats
- * leave alpha with a zero mask, but we should still swizzle the bits.
- */
- /* ARGB */
- const static struct SDL_PixelFormat default_pixel_format = {
- NULL, 0, 0,
- 0, 0, 0, 0,
- 16, 8, 0, 24,
- 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000,
- 0, 0};
- if (!srcfmt) {
- srcfmt = &default_pixel_format;
- }
- if (!dstfmt) {
- dstfmt = &default_pixel_format;
- }
- const vector unsigned char plus = VECUINT8_LITERAL(
- 0x00, 0x00, 0x00, 0x00,
- 0x04, 0x04, 0x04, 0x04,
- 0x08, 0x08, 0x08, 0x08,
- 0x0C, 0x0C, 0x0C, 0x0C );
- vector unsigned char vswiz;
- vector unsigned int srcvec;
-#define RESHIFT(X) (3 - ((X) >> 3))
- Uint32 rmask = RESHIFT(srcfmt->Rshift) << (dstfmt->Rshift);
- Uint32 gmask = RESHIFT(srcfmt->Gshift) << (dstfmt->Gshift);
- Uint32 bmask = RESHIFT(srcfmt->Bshift) << (dstfmt->Bshift);
- Uint32 amask;
- /* Use zero for alpha if either surface doesn't have alpha */
- if (dstfmt->Amask) {
- amask = ((srcfmt->Amask) ? RESHIFT(srcfmt->Ashift) : 0x10) << (dstfmt->Ashift);
- } else {
- amask = 0x10101010 & ((dstfmt->Rmask | dstfmt->Gmask | dstfmt->Bmask) ^ 0xFFFFFFFF);
- }
-#undef RESHIFT
- ((unsigned int *)(char*)&srcvec)[0] = (rmask | gmask | bmask | amask);
- vswiz = vec_add(plus, (vector unsigned char)vec_splat(srcvec, 0));
- return(vswiz);
-}
-
-static void Blit_RGB888_RGB565(SDL_BlitInfo *info);
-static void Blit_RGB888_RGB565Altivec(SDL_BlitInfo *info) {
- int height = info->d_height;
- Uint8 *src = (Uint8 *) info->s_pixels;
- int srcskip = info->s_skip;
- Uint8 *dst = (Uint8 *) info->d_pixels;
- int dstskip = info->d_skip;
- SDL_PixelFormat *srcfmt = info->src;
- vector unsigned char valpha = vec_splat_u8(0);
- vector unsigned char vpermute = calc_swizzle32(srcfmt, NULL);
- vector unsigned char vgmerge = VECUINT8_LITERAL(
- 0x00, 0x02, 0x00, 0x06,
- 0x00, 0x0a, 0x00, 0x0e,
- 0x00, 0x12, 0x00, 0x16,
- 0x00, 0x1a, 0x00, 0x1e);
- vector unsigned short v1 = vec_splat_u16(1);
- vector unsigned short v3 = vec_splat_u16(3);
- vector unsigned short v3f = VECUINT16_LITERAL(
- 0x003f, 0x003f, 0x003f, 0x003f,
- 0x003f, 0x003f, 0x003f, 0x003f);
- vector unsigned short vfc = VECUINT16_LITERAL(
- 0x00fc, 0x00fc, 0x00fc, 0x00fc,
- 0x00fc, 0x00fc, 0x00fc, 0x00fc);
- vector unsigned short vf800 = (vector unsigned short)vec_splat_u8(-7);
- vf800 = vec_sl(vf800, vec_splat_u16(8));
-
- while (height--) {
- vector unsigned char valigner;
- vector unsigned char voverflow;
- vector unsigned char vsrc;
-
- int width = info->d_width;
- int extrawidth;
-
- /* do scalar until we can align... */
-#define ONE_PIXEL_BLEND(condition, widthvar) \
- while (condition) { \
- Uint32 Pixel; \
- unsigned sR, sG, sB, sA; \
- DISEMBLE_RGBA((Uint8 *)src, 4, srcfmt, Pixel, \
- sR, sG, sB, sA); \
- *(Uint16 *)(dst) = (((sR << 8) & 0x0000F800) | \
- ((sG << 3) & 0x000007E0) | \
- ((sB >> 3) & 0x0000001F)); \
- dst += 2; \
- src += 4; \
- widthvar--; \
- }
-
- ONE_PIXEL_BLEND(((UNALIGNED_PTR(dst)) && (width)), width);
-
- /* After all that work, here's the vector part! */
- extrawidth = (width % 8); /* trailing unaligned stores */
- width -= extrawidth;
- vsrc = vec_ld(0, src);
- valigner = VEC_ALIGNER(src);
-
- while (width) {
- vector unsigned short vpixel, vrpixel, vgpixel, vbpixel;
- vector unsigned int vsrc1, vsrc2;
- vector unsigned char vdst;
-
- voverflow = vec_ld(15, src);
- vsrc = vec_perm(vsrc, voverflow, valigner);
- vsrc1 = (vector unsigned int)vec_perm(vsrc, valpha, vpermute);
- src += 16;
- vsrc = voverflow;
- voverflow = vec_ld(15, src);
- vsrc = vec_perm(vsrc, voverflow, valigner);
- vsrc2 = (vector unsigned int)vec_perm(vsrc, valpha, vpermute);
- /* 1555 */
- vpixel = (vector unsigned short)vec_packpx(vsrc1, vsrc2);
- vgpixel = (vector unsigned short)vec_perm(vsrc1, vsrc2, vgmerge);
- vgpixel = vec_and(vgpixel, vfc);
- vgpixel = vec_sl(vgpixel, v3);
- vrpixel = vec_sl(vpixel, v1);
- vrpixel = vec_and(vrpixel, vf800);
- vbpixel = vec_and(vpixel, v3f);
- vdst = vec_or((vector unsigned char)vrpixel, (vector unsigned char)vgpixel);
- /* 565 */
- vdst = vec_or(vdst, (vector unsigned char)vbpixel);
- vec_st(vdst, 0, dst);
-
- width -= 8;
- src += 16;
- dst += 16;
- vsrc = voverflow;
- }
-
- assert(width == 0);
-
- /* do scalar until we can align... */
- ONE_PIXEL_BLEND((extrawidth), extrawidth);
-#undef ONE_PIXEL_BLEND
-
- src += srcskip; /* move to next row, accounting for pitch. */
- dst += dstskip;
- }
-
-
-}
-
-static void Blit_RGB565_32Altivec(SDL_BlitInfo *info) {
- int height = info->d_height;
- Uint8 *src = (Uint8 *) info->s_pixels;
- int srcskip = info->s_skip;
- Uint8 *dst = (Uint8 *) info->d_pixels;
- int dstskip = info->d_skip;
- SDL_PixelFormat *srcfmt = info->src;
- SDL_PixelFormat *dstfmt = info->dst;
- unsigned alpha;
- vector unsigned char valpha;
- vector unsigned char vpermute;
- vector unsigned short vf800;
- vector unsigned int v8 = vec_splat_u32(8);
- vector unsigned int v16 = vec_add(v8, v8);
- vector unsigned short v2 = vec_splat_u16(2);
- vector unsigned short v3 = vec_splat_u16(3);
- /*
- 0x10 - 0x1f is the alpha
- 0x00 - 0x0e evens are the red
- 0x01 - 0x0f odds are zero
- */
- vector unsigned char vredalpha1 = VECUINT8_LITERAL(
- 0x10, 0x00, 0x01, 0x01,
- 0x10, 0x02, 0x01, 0x01,
- 0x10, 0x04, 0x01, 0x01,
- 0x10, 0x06, 0x01, 0x01
- );
- vector unsigned char vredalpha2 = (vector unsigned char) (
- vec_add((vector unsigned int)vredalpha1, vec_sl(v8, v16))
- );
- /*
- 0x00 - 0x0f is ARxx ARxx ARxx ARxx
- 0x11 - 0x0f odds are blue
- */
- vector unsigned char vblue1 = VECUINT8_LITERAL(
- 0x00, 0x01, 0x02, 0x11,
- 0x04, 0x05, 0x06, 0x13,
- 0x08, 0x09, 0x0a, 0x15,
- 0x0c, 0x0d, 0x0e, 0x17
- );
- vector unsigned char vblue2 = (vector unsigned char)(
- vec_add((vector unsigned int)vblue1, v8)
- );
- /*
- 0x00 - 0x0f is ARxB ARxB ARxB ARxB
- 0x10 - 0x0e evens are green
- */
- vector unsigned char vgreen1 = VECUINT8_LITERAL(
- 0x00, 0x01, 0x10, 0x03,
- 0x04, 0x05, 0x12, 0x07,
- 0x08, 0x09, 0x14, 0x0b,
- 0x0c, 0x0d, 0x16, 0x0f
- );
- vector unsigned char vgreen2 = (vector unsigned char)(
- vec_add((vector unsigned int)vgreen1, vec_sl(v8, v8))
- );
-
-
- assert(srcfmt->BytesPerPixel == 2);
- assert(dstfmt->BytesPerPixel == 4);
-
- vf800 = (vector unsigned short)vec_splat_u8(-7);
- vf800 = vec_sl(vf800, vec_splat_u16(8));
-
- if (dstfmt->Amask && srcfmt->alpha) {
- ((unsigned char *)&valpha)[0] = alpha = srcfmt->alpha;
- valpha = vec_splat(valpha, 0);
- } else {
- alpha = 0;
- valpha = vec_splat_u8(0);
- }
-
- vpermute = calc_swizzle32(NULL, dstfmt);
- while (height--) {
- vector unsigned char valigner;
- vector unsigned char voverflow;
- vector unsigned char vsrc;
-
- int width = info->d_width;
- int extrawidth;
-
- /* do scalar until we can align... */
-#define ONE_PIXEL_BLEND(condition, widthvar) \
- while (condition) { \
- unsigned sR, sG, sB; \
- unsigned short Pixel = *((unsigned short *)src); \
- sR = (Pixel >> 8) & 0xf8; \
- sG = (Pixel >> 3) & 0xfc; \
- sB = (Pixel << 3) & 0xf8; \
- ASSEMBLE_RGBA(dst, 4, dstfmt, sR, sG, sB, alpha); \
- src += 2; \
- dst += 4; \
- widthvar--; \
- }
- ONE_PIXEL_BLEND(((UNALIGNED_PTR(dst)) && (width)), width);
-
- /* After all that work, here's the vector part! */
- extrawidth = (width % 8); /* trailing unaligned stores */
- width -= extrawidth;
- vsrc = vec_ld(0, src);
- valigner = VEC_ALIGNER(src);
-
- while (width) {
- vector unsigned short vR, vG, vB;
- vector unsigned char vdst1, vdst2;
-
- voverflow = vec_ld(15, src);
- vsrc = vec_perm(vsrc, voverflow, valigner);
-
- vR = vec_and((vector unsigned short)vsrc, vf800);
- vB = vec_sl((vector unsigned short)vsrc, v3);
- vG = vec_sl(vB, v2);
-
- vdst1 = (vector unsigned char)vec_perm((vector unsigned char)vR, valpha, vredalpha1);
- vdst1 = vec_perm(vdst1, (vector unsigned char)vB, vblue1);
- vdst1 = vec_perm(vdst1, (vector unsigned char)vG, vgreen1);
- vdst1 = vec_perm(vdst1, valpha, vpermute);
- vec_st(vdst1, 0, dst);
-
- vdst2 = (vector unsigned char)vec_perm((vector unsigned char)vR, valpha, vredalpha2);
- vdst2 = vec_perm(vdst2, (vector unsigned char)vB, vblue2);
- vdst2 = vec_perm(vdst2, (vector unsigned char)vG, vgreen2);
- vdst2 = vec_perm(vdst2, valpha, vpermute);
- vec_st(vdst2, 16, dst);
-
- width -= 8;
- dst += 32;
- src += 16;
- vsrc = voverflow;
- }
-
- assert(width == 0);
-
-
- /* do scalar until we can align... */
- ONE_PIXEL_BLEND((extrawidth), extrawidth);
-#undef ONE_PIXEL_BLEND
-
- src += srcskip; /* move to next row, accounting for pitch. */
- dst += dstskip;
- }
-
-}
-
-
-static void Blit_RGB555_32Altivec(SDL_BlitInfo *info) {
- int height = info->d_height;
- Uint8 *src = (Uint8 *) info->s_pixels;
- int srcskip = info->s_skip;
- Uint8 *dst = (Uint8 *) info->d_pixels;
- int dstskip = info->d_skip;
- SDL_PixelFormat *srcfmt = info->src;
- SDL_PixelFormat *dstfmt = info->dst;
- unsigned alpha;
- vector unsigned char valpha;
- vector unsigned char vpermute;
- vector unsigned short vf800;
- vector unsigned int v8 = vec_splat_u32(8);
- vector unsigned int v16 = vec_add(v8, v8);
- vector unsigned short v1 = vec_splat_u16(1);
- vector unsigned short v3 = vec_splat_u16(3);
- /*
- 0x10 - 0x1f is the alpha
- 0x00 - 0x0e evens are the red
- 0x01 - 0x0f odds are zero
- */
- vector unsigned char vredalpha1 = VECUINT8_LITERAL(
- 0x10, 0x00, 0x01, 0x01,
- 0x10, 0x02, 0x01, 0x01,
- 0x10, 0x04, 0x01, 0x01,
- 0x10, 0x06, 0x01, 0x01
- );
- vector unsigned char vredalpha2 = (vector unsigned char)(
- vec_add((vector unsigned int)vredalpha1, vec_sl(v8, v16))
- );
- /*
- 0x00 - 0x0f is ARxx ARxx ARxx ARxx
- 0x11 - 0x0f odds are blue
- */
- vector unsigned char vblue1 = VECUINT8_LITERAL(
- 0x00, 0x01, 0x02, 0x11,
- 0x04, 0x05, 0x06, 0x13,
- 0x08, 0x09, 0x0a, 0x15,
- 0x0c, 0x0d, 0x0e, 0x17
- );
- vector unsigned char vblue2 = (vector unsigned char)(
- vec_add((vector unsigned int)vblue1, v8)
- );
- /*
- 0x00 - 0x0f is ARxB ARxB ARxB ARxB
- 0x10 - 0x0e evens are green
- */
- vector unsigned char vgreen1 = VECUINT8_LITERAL(
- 0x00, 0x01, 0x10, 0x03,
- 0x04, 0x05, 0x12, 0x07,
- 0x08, 0x09, 0x14, 0x0b,
- 0x0c, 0x0d, 0x16, 0x0f
- );
- vector unsigned char vgreen2 = (vector unsigned char)(
- vec_add((vector unsigned int)vgreen1, vec_sl(v8, v8))
- );
-
-
- assert(srcfmt->BytesPerPixel == 2);
- assert(dstfmt->BytesPerPixel == 4);
-
- vf800 = (vector unsigned short)vec_splat_u8(-7);
- vf800 = vec_sl(vf800, vec_splat_u16(8));
-
- if (dstfmt->Amask && srcfmt->alpha) {
- ((unsigned char *)&valpha)[0] = alpha = srcfmt->alpha;
- valpha = vec_splat(valpha, 0);
- } else {
- alpha = 0;
- valpha = vec_splat_u8(0);
- }
-
- vpermute = calc_swizzle32(NULL, dstfmt);
- while (height--) {
- vector unsigned char valigner;
- vector unsigned char voverflow;
- vector unsigned char vsrc;
-
- int width = info->d_width;
- int extrawidth;
-
- /* do scalar until we can align... */
-#define ONE_PIXEL_BLEND(condition, widthvar) \
- while (condition) { \
- unsigned sR, sG, sB; \
- unsigned short Pixel = *((unsigned short *)src); \
- sR = (Pixel >> 7) & 0xf8; \
- sG = (Pixel >> 2) & 0xf8; \
- sB = (Pixel << 3) & 0xf8; \
- ASSEMBLE_RGBA(dst, 4, dstfmt, sR, sG, sB, alpha); \
- src += 2; \
- dst += 4; \
- widthvar--; \
- }
- ONE_PIXEL_BLEND(((UNALIGNED_PTR(dst)) && (width)), width);
-
- /* After all that work, here's the vector part! */
- extrawidth = (width % 8); /* trailing unaligned stores */
- width -= extrawidth;
- vsrc = vec_ld(0, src);
- valigner = VEC_ALIGNER(src);
-
- while (width) {
- vector unsigned short vR, vG, vB;
- vector unsigned char vdst1, vdst2;
-
- voverflow = vec_ld(15, src);
- vsrc = vec_perm(vsrc, voverflow, valigner);
-
- vR = vec_and(vec_sl((vector unsigned short)vsrc,v1), vf800);
- vB = vec_sl((vector unsigned short)vsrc, v3);
- vG = vec_sl(vB, v3);
-
- vdst1 = (vector unsigned char)vec_perm((vector unsigned char)vR, valpha, vredalpha1);
- vdst1 = vec_perm(vdst1, (vector unsigned char)vB, vblue1);
- vdst1 = vec_perm(vdst1, (vector unsigned char)vG, vgreen1);
- vdst1 = vec_perm(vdst1, valpha, vpermute);
- vec_st(vdst1, 0, dst);
-
- vdst2 = (vector unsigned char)vec_perm((vector unsigned char)vR, valpha, vredalpha2);
- vdst2 = vec_perm(vdst2, (vector unsigned char)vB, vblue2);
- vdst2 = vec_perm(vdst2, (vector unsigned char)vG, vgreen2);
- vdst2 = vec_perm(vdst2, valpha, vpermute);
- vec_st(vdst2, 16, dst);
-
- width -= 8;
- dst += 32;
- src += 16;
- vsrc = voverflow;
- }
-
- assert(width == 0);
-
-
- /* do scalar until we can align... */
- ONE_PIXEL_BLEND((extrawidth), extrawidth);
-#undef ONE_PIXEL_BLEND
-
- src += srcskip; /* move to next row, accounting for pitch. */
- dst += dstskip;
- }
-
-}
-
-static void BlitNtoNKey(SDL_BlitInfo *info);
-static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info);
-static void Blit32to32KeyAltivec(SDL_BlitInfo *info)
-{
- int height = info->d_height;
- Uint32 *srcp = (Uint32 *) info->s_pixels;
- int srcskip = info->s_skip;
- Uint32 *dstp = (Uint32 *) info->d_pixels;
- int dstskip = info->d_skip;
- SDL_PixelFormat *srcfmt = info->src;
- int srcbpp = srcfmt->BytesPerPixel;
- SDL_PixelFormat *dstfmt = info->dst;
- int dstbpp = dstfmt->BytesPerPixel;
- int copy_alpha = (srcfmt->Amask && dstfmt->Amask);
- unsigned alpha = dstfmt->Amask ? srcfmt->alpha : 0;
- Uint32 rgbmask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask;
- Uint32 ckey = info->src->colorkey;
- vector unsigned int valpha;
- vector unsigned char vpermute;
- vector unsigned char vzero;
- vector unsigned int vckey;
- vector unsigned int vrgbmask;
- vpermute = calc_swizzle32(srcfmt, dstfmt);
- if (info->d_width < 16) {
- if(copy_alpha) {
- BlitNtoNKeyCopyAlpha(info);
- } else {
- BlitNtoNKey(info);
- }
- return;
- }
- vzero = vec_splat_u8(0);
- if (alpha) {
- ((unsigned char *)&valpha)[0] = (unsigned char)alpha;
- valpha = (vector unsigned int)vec_splat((vector unsigned char)valpha, 0);
- } else {
- valpha = (vector unsigned int)vzero;
- }
- 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--) {
-#define ONE_PIXEL_BLEND(condition, widthvar) \
- if (copy_alpha) { \
- while (condition) { \
- Uint32 Pixel; \
- unsigned sR, sG, sB, sA; \
- DISEMBLE_RGBA((Uint8 *)srcp, srcbpp, srcfmt, Pixel, \
- sR, sG, sB, sA); \
- if ( (Pixel & rgbmask) != ckey ) { \
- ASSEMBLE_RGBA((Uint8 *)dstp, dstbpp, dstfmt, \
- sR, sG, sB, sA); \
- } \
- dstp = (Uint32 *) (((Uint8 *) dstp) + dstbpp); \
- srcp = (Uint32 *) (((Uint8 *) srcp) + srcbpp); \
- widthvar--; \
- } \
- } else { \
- while (condition) { \
- Uint32 Pixel; \
- unsigned sR, sG, sB; \
- RETRIEVE_RGB_PIXEL((Uint8 *)srcp, srcbpp, Pixel); \
- if ( Pixel != ckey ) { \
- RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB); \
- ASSEMBLE_RGBA((Uint8 *)dstp, dstbpp, dstfmt, \
- sR, sG, sB, alpha); \
- } \
- dstp = (Uint32 *) (((Uint8 *)dstp) + dstbpp); \
- srcp = (Uint32 *) (((Uint8 *)srcp) + srcbpp); \
- widthvar--; \
- } \
- }
- int width = info->d_width;
- ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width);
- assert(width > 0);
- if (width > 0) {
- int extrawidth = (width % 4);
- vector unsigned char valigner = VEC_ALIGNER(srcp);
- vector unsigned int vs = vec_ld(0, srcp);
- width -= extrawidth;
- assert(width >= 4);
- while (width) {
- vector unsigned char vsel;
- vector unsigned int vd;
- vector unsigned int voverflow = vec_ld(15, srcp);
- /* load the source vec */
- vs = vec_perm(vs, voverflow, valigner);
- /* vsel is set for items that match the key */
- vsel = (vector unsigned char)vec_and(vs, vrgbmask);
- vsel = (vector unsigned char)vec_cmpeq(vs, vckey);
- /* permute the src vec to the dest format */
- vs = vec_perm(vs, valpha, vpermute);
- /* load the destination vec */
- vd = vec_ld(0, dstp);
- /* select the source and dest into vs */
- vd = (vector unsigned int)vec_sel((vector unsigned char)vs, (vector unsigned char)vd, vsel);
-
- vec_st(vd, 0, dstp);
- srcp += 4;
- width -= 4;
- dstp += 4;
- vs = voverflow;
- }
- ONE_PIXEL_BLEND((extrawidth), extrawidth);
-#undef ONE_PIXEL_BLEND
- srcp += srcskip >> 2;
- dstp += dstskip >> 2;
- }
- }
-}
-
-/* Altivec code to swizzle one 32-bit surface to a different 32-bit format. */
-/* Use this on a G5 */
-static void ConvertAltivec32to32_noprefetch(SDL_BlitInfo *info)
-{
- int height = info->d_height;
- Uint32 *src = (Uint32 *) info->s_pixels;
- int srcskip = info->s_skip;
- Uint32 *dst = (Uint32 *) info->d_pixels;
- int dstskip = info->d_skip;
- SDL_PixelFormat *srcfmt = info->src;
- SDL_PixelFormat *dstfmt = info->dst;
- vector unsigned int vzero = vec_splat_u32(0);
- vector unsigned char vpermute = calc_swizzle32(srcfmt, dstfmt);
- if (dstfmt->Amask && !srcfmt->Amask) {
- if (srcfmt->alpha) {
- vector unsigned char valpha;
- ((unsigned char *)&valpha)[0] = srcfmt->alpha;
- vzero = (vector unsigned int)vec_splat(valpha, 0);
- }
- }
-
- assert(srcfmt->BytesPerPixel == 4);
- assert(dstfmt->BytesPerPixel == 4);
-
- while (height--) {
- vector unsigned char valigner;
- vector unsigned int vbits;
- vector unsigned int voverflow;
- Uint32 bits;
- Uint8 r, g, b, a;
-
- int width = info->d_width;
- int extrawidth;
-
- /* do scalar until we can align... */
- while ((UNALIGNED_PTR(dst)) && (width)) {
- bits = *(src++);
- RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
- *(dst++) = MAKE8888(dstfmt, r, g, b, a);
- width--;
- }
-
- /* After all that work, here's the vector part! */
- extrawidth = (width % 4);
- width -= extrawidth;
- valigner = VEC_ALIGNER(src);
- vbits = vec_ld(0, src);
-
- while (width) {
- voverflow = vec_ld(15, src);
- src += 4;
- width -= 4;
- vbits = vec_perm(vbits, voverflow, valigner); /* src is ready. */
- vbits = vec_perm(vbits, vzero, vpermute); /* swizzle it. */
- vec_st(vbits, 0, dst); /* store it back out. */
- dst += 4;
- vbits = voverflow;
- }
-
- assert(width == 0);
-
- /* cover pixels at the end of the row that didn't fit in 16 bytes. */
- while (extrawidth) {
- bits = *(src++); /* max 7 pixels, don't bother with prefetch. */
- RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
- *(dst++) = MAKE8888(dstfmt, r, g, b, a);
- extrawidth--;
- }
-
- src += srcskip >> 2; /* move to next row, accounting for pitch. */
- dst += dstskip >> 2;
- }
-
-}
-
-/* Altivec code to swizzle one 32-bit surface to a different 32-bit format. */
-/* Use this on a G4 */
-static void ConvertAltivec32to32_prefetch(SDL_BlitInfo *info)
-{
- const int scalar_dst_lead = sizeof (Uint32) * 4;
- const int vector_dst_lead = sizeof (Uint32) * 16;
-
- int height = info->d_height;
- Uint32 *src = (Uint32 *) info->s_pixels;
- int srcskip = info->s_skip;
- Uint32 *dst = (Uint32 *) info->d_pixels;
- int dstskip = info->d_skip;
- SDL_PixelFormat *srcfmt = info->src;
- SDL_PixelFormat *dstfmt = info->dst;
- vector unsigned int vzero = vec_splat_u32(0);
- vector unsigned char vpermute = calc_swizzle32(srcfmt, dstfmt);
- if (dstfmt->Amask && !srcfmt->Amask) {
- if (srcfmt->alpha) {
- vector unsigned char valpha;
- ((unsigned char *)&valpha)[0] = srcfmt->alpha;
- vzero = (vector unsigned int)vec_splat(valpha, 0);
- }
- }
-
- assert(srcfmt->BytesPerPixel == 4);
- assert(dstfmt->BytesPerPixel == 4);
-
- while (height--) {
- vector unsigned char valigner;
- vector unsigned int vbits;
- vector unsigned int voverflow;
- Uint32 bits;
- Uint8 r, g, b, a;
-
- int width = info->d_width;
- int extrawidth;
-
- /* do scalar until we can align... */
- while ((UNALIGNED_PTR(dst)) && (width)) {
- vec_dstt(src+scalar_dst_lead, DST_CTRL(2,32,1024), DST_CHAN_SRC);
- vec_dstst(dst+scalar_dst_lead, DST_CTRL(2,32,1024), DST_CHAN_DEST);
- bits = *(src++);
- RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
- *(dst++) = MAKE8888(dstfmt, r, g, b, a);
- width--;
- }
-
- /* After all that work, here's the vector part! */
- extrawidth = (width % 4);
- width -= extrawidth;
- valigner = VEC_ALIGNER(src);
- vbits = vec_ld(0, src);
-
- while (width) {
- vec_dstt(src+vector_dst_lead, DST_CTRL(2,32,1024), DST_CHAN_SRC);
- vec_dstst(dst+vector_dst_lead, DST_CTRL(2,32,1024), DST_CHAN_DEST);
- voverflow = vec_ld(15, src);
- src += 4;
- width -= 4;
- vbits = vec_perm(vbits, voverflow, valigner); /* src is ready. */
- vbits = vec_perm(vbits, vzero, vpermute); /* swizzle it. */
- vec_st(vbits, 0, dst); /* store it back out. */
- dst += 4;
- vbits = voverflow;
- }
-
- assert(width == 0);
-
- /* cover pixels at the end of the row that didn't fit in 16 bytes. */
- while (extrawidth) {
- bits = *(src++); /* max 7 pixels, don't bother with prefetch. */
- RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
- *(dst++) = MAKE8888(dstfmt, r, g, b, a);
- extrawidth--;
- }
-
- src += srcskip >> 2; /* move to next row, accounting for pitch. */
- dst += dstskip >> 2;
- }
-
- vec_dss(DST_CHAN_SRC);
- vec_dss(DST_CHAN_DEST);
-}
-
-static Uint32 GetBlitFeatures( void )
-{
- static Uint32 features = 0xffffffff;
- if (features == 0xffffffff) {
- /* Provide an override for testing .. */
- char *override = SDL_getenv("SDL_ALTIVEC_BLIT_FEATURES");
- if (override) {
- features = 0;
- SDL_sscanf(override, "%u", &features);
- } else {
- features = ( 0
- /* Feature 1 is has-MMX */
- | ((SDL_HasMMX()) ? 1 : 0)
- /* Feature 2 is has-AltiVec */
- | ((SDL_HasAltiVec()) ? 2 : 0)
- /* Feature 4 is dont-use-prefetch */
- /* !!!! FIXME: Check for G5 or later, not the cache size! Always prefetch on a G4. */
- | ((GetL3CacheSize() == 0) ? 4 : 0)
- );
- }
- }
- return features;
-}
-#if __MWERKS__
-#pragma altivec_model off
-#endif
-#else
-/* Feature 1 is has-MMX */
-#define GetBlitFeatures() ((Uint32)(SDL_HasMMX() ? 1 : 0))
-#endif
-
-/* This is now endian dependent */
-#if SDL_BYTEORDER == SDL_LIL_ENDIAN
-#define HI 1
-#define LO 0
-#else /* SDL_BYTEORDER == SDL_BIG_ENDIAN */
-#define HI 0
-#define LO 1
-#endif
-
-#if SDL_HERMES_BLITTERS
-
-/* Heheheh, we coerce Hermes into using SDL blit information */
-#define X86_ASSEMBLER
-#define HermesConverterInterface SDL_BlitInfo
-#define HermesClearInterface void
-#define STACKCALL
-
-#include "../hermes/HeadMMX.h"
-#include "../hermes/HeadX86.h"
-
-#else
-
-/* Special optimized blit for RGB 8-8-8 --> RGB 3-3-2 */
-#define RGB888_RGB332(dst, src) { \
- dst = (Uint8)((((src)&0x00E00000)>>16)| \
- (((src)&0x0000E000)>>11)| \
- (((src)&0x000000C0)>>6)); \
-}
-static void Blit_RGB888_index8(SDL_BlitInfo *info)
-{
-#ifndef USE_DUFFS_LOOP
- int c;
-#endif
- int width, height;
- Uint32 *src;
- const Uint8 *map;
- Uint8 *dst;
- int srcskip, dstskip;
-
- /* Set up some basic variables */
- width = info->d_width;
- height = info->d_height;
- src = (Uint32 *)info->s_pixels;
- srcskip = info->s_skip/4;
- dst = info->d_pixels;
- dstskip = info->d_skip;
- map = info->table;
-
- if ( map == NULL ) {
- while ( height-- ) {
-#ifdef USE_DUFFS_LOOP
- DUFFS_LOOP(
- RGB888_RGB332(*dst++, *src);
- , width);
-#else
- for ( c=width/4; c; --c ) {
- /* Pack RGB into 8bit pixel */
- ++src;
- RGB888_RGB332(*dst++, *src);
- ++src;
- RGB888_RGB332(*dst++, *src);
- ++src;
- RGB888_RGB332(*dst++, *src);
- ++src;
- }
- switch ( width & 3 ) {
- case 3:
- RGB888_RGB332(*dst++, *src);
- ++src;
- case 2:
- RGB888_RGB332(*dst++, *src);
- ++src;
- case 1:
- RGB888_RGB332(*dst++, *src);
- ++src;
- }
-#endif /* USE_DUFFS_LOOP */
- src += srcskip;
- dst += dstskip;
- }
- } else {
- int Pixel;
-
- while ( height-- ) {
-#ifdef USE_DUFFS_LOOP
- DUFFS_LOOP(
- RGB888_RGB332(Pixel, *src);
- *dst++ = map[Pixel];
- ++src;
- , width);
-#else
- for ( c=width/4; c; --c ) {
- /* Pack RGB into 8bit pixel */
- RGB888_RGB332(Pixel, *src);
- *dst++ = map[Pixel];
- ++src;
- RGB888_RGB332(Pixel, *src);
- *dst++ = map[Pixel];
- ++src;
- RGB888_RGB332(Pixel, *src);
- *dst++ = map[Pixel];
- ++src;
- RGB888_RGB332(Pixel, *src);
- *dst++ = map[Pixel];
- ++src;
- }
- switch ( width & 3 ) {
- case 3:
- RGB888_RGB332(Pixel, *src);
- *dst++ = map[Pixel];
- ++src;
- case 2:
- RGB888_RGB332(Pixel, *src);
- *dst++ = map[Pixel];
- ++src;
- case 1:
- RGB888_RGB332(Pixel, *src);
- *dst++ = map[Pixel];
- ++src;
- }
-#endif /* USE_DUFFS_LOOP */
- src += srcskip;
- dst += dstskip;
- }
- }
-}
-/* Special optimized blit for RGB 8-8-8 --> RGB 5-5-5 */
-#define RGB888_RGB555(dst, src) { \
- *(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); \
-}
-static void Blit_RGB888_RGB555(SDL_BlitInfo *info)
-{
-#ifndef USE_DUFFS_LOOP
- int c;
-#endif
- int width, height;
- Uint32 *src;
- Uint16 *dst;
- int srcskip, dstskip;
-
- /* Set up some basic variables */
- width = info->d_width;
- height = info->d_height;
- src = (Uint32 *)info->s_pixels;
- srcskip = info->s_skip/4;
- dst = (Uint16 *)info->d_pixels;
- dstskip = info->d_skip/2;
-
-#ifdef USE_DUFFS_LOOP
- while ( height-- ) {
- DUFFS_LOOP(
- RGB888_RGB555(dst, src);
- ++src;
- ++dst;
- , width);
- src += srcskip;
- dst += dstskip;
- }
-#else
- /* Memory align at 4-byte boundary, if necessary */
- if ( (long)dst & 0x03 ) {
- /* Don't do anything if width is 0 */
- if ( width == 0 ) {
- return;
- }
- --width;
-
- while ( height-- ) {
- /* Perform copy alignment */
- RGB888_RGB555(dst, src);
- ++src;
- ++dst;
-
- /* Copy in 4 pixel chunks */
- for ( c=width/4; c; --c ) {
- RGB888_RGB555_TWO(dst, src);
- src += 2;
- dst += 2;
- RGB888_RGB555_TWO(dst, src);
- src += 2;
- dst += 2;
- }
- /* Get any leftovers */
- switch (width & 3) {
- case 3:
- RGB888_RGB555(dst, src);
- ++src;
- ++dst;
- case 2:
- RGB888_RGB555_TWO(dst, src);
- src += 2;
- dst += 2;
- break;
- case 1:
- RGB888_RGB555(dst, src);
- ++src;
- ++dst;
- break;
- }
- src += srcskip;
- dst += dstskip;
- }
- } else {
- while ( height-- ) {
- /* Copy in 4 pixel chunks */
- for ( c=width/4; c; --c ) {
- RGB888_RGB555_TWO(dst, src);
- src += 2;
- dst += 2;
- RGB888_RGB555_TWO(dst, src);
- src += 2;
- dst += 2;
- }
- /* Get any leftovers */
- switch (width & 3) {
- case 3:
- RGB888_RGB555(dst, src);
- ++src;
- ++dst;
- case 2:
- RGB888_RGB555_TWO(dst, src);
- src += 2;
- dst += 2;
- break;
- case 1:
- RGB888_RGB555(dst, src);
- ++src;
- ++dst;
- break;
- }
- src += srcskip;
- dst += dstskip;
- }
- }
-#endif /* USE_DUFFS_LOOP */
-}
-/* Special optimized blit for RGB 8-8-8 --> RGB 5-6-5 */
-#define RGB888_RGB565(dst, src) { \
- *(Uint16 *)(dst) = (Uint16)((((*src)&0x00F80000)>>8)| \
- (((*src)&0x0000FC00)>>5)| \
- (((*src)&0x000000F8)>>3)); \
-}
-#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); \
-}
-static void Blit_RGB888_RGB565(SDL_BlitInfo *info)
-{
-#ifndef USE_DUFFS_LOOP
- int c;
-#endif
- int width, height;
- Uint32 *src;
- Uint16 *dst;
- int srcskip, dstskip;
-
- /* Set up some basic variables */
- width = info->d_width;
- height = info->d_height;
- src = (Uint32 *)info->s_pixels;
- srcskip = info->s_skip/4;
- dst = (Uint16 *)info->d_pixels;
- dstskip = info->d_skip/2;
-
-#ifdef USE_DUFFS_LOOP
- while ( height-- ) {
- DUFFS_LOOP(
- RGB888_RGB565(dst, src);
- ++src;
- ++dst;
- , width);
- src += srcskip;
- dst += dstskip;
- }
-#else
- /* Memory align at 4-byte boundary, if necessary */
- if ( (long)dst & 0x03 ) {
- /* Don't do anything if width is 0 */
- if ( width == 0 ) {
- return;
- }
- --width;
-
- while ( height-- ) {
- /* Perform copy alignment */
- RGB888_RGB565(dst, src);
- ++src;
- ++dst;
-
- /* Copy in 4 pixel chunks */
- for ( c=width/4; c; --c ) {
- RGB888_RGB565_TWO(dst, src);
- src += 2;
- dst += 2;
- RGB888_RGB565_TWO(dst, src);
- src += 2;
- dst += 2;
- }
- /* Get any leftovers */
- switch (width & 3) {
- case 3:
- RGB888_RGB565(dst, src);
- ++src;
- ++dst;
- case 2:
- RGB888_RGB565_TWO(dst, src);
- src += 2;
- dst += 2;
- break;
- case 1:
- RGB888_RGB565(dst, src);
- ++src;
- ++dst;
- break;
- }
- src += srcskip;
- dst += dstskip;
- }
- } else {
- while ( height-- ) {
- /* Copy in 4 pixel chunks */
- for ( c=width/4; c; --c ) {
- RGB888_RGB565_TWO(dst, src);
- src += 2;
- dst += 2;
- RGB888_RGB565_TWO(dst, src);
- src += 2;
- dst += 2;
- }
- /* Get any leftovers */
- switch (width & 3) {
- case 3:
- RGB888_RGB565(dst, src);
- ++src;
- ++dst;
- case 2:
- RGB888_RGB565_TWO(dst, src);
- src += 2;
- dst += 2;
- break;
- case 1:
- RGB888_RGB565(dst, src);
- ++src;
- ++dst;
- break;
- }
- src += srcskip;
- dst += dstskip;
- }
- }
-#endif /* USE_DUFFS_LOOP */
-}
-
-#endif /* SDL_HERMES_BLITTERS */
-
-
-/* Special optimized blit for RGB 5-6-5 --> 32-bit RGB surfaces */
-#define RGB565_32(dst, src, map) (map[src[LO]*2] + map[src[HI]*2+1])
-static void Blit_RGB565_32(SDL_BlitInfo *info, const Uint32 *map)
-{
-#ifndef USE_DUFFS_LOOP
- int c;
-#endif
- int width, height;
- Uint8 *src;
- Uint32 *dst;
- int srcskip, dstskip;
-
- /* Set up some basic variables */
- width = info->d_width;
- height = info->d_height;
- src = (Uint8 *)info->s_pixels;
- srcskip = info->s_skip;
- dst = (Uint32 *)info->d_pixels;
- dstskip = info->d_skip/4;
-
-#ifdef USE_DUFFS_LOOP
- while ( height-- ) {
- DUFFS_LOOP(
- {
- *dst++ = RGB565_32(dst, src, map);
- src += 2;
- },
- width);
- src += srcskip;
- dst += dstskip;
- }
-#else
- while ( height-- ) {
- /* Copy in 4 pixel chunks */
- for ( c=width/4; c; --c ) {
- *dst++ = RGB565_32(dst, src, map);
- src += 2;
- *dst++ = RGB565_32(dst, src, map);
- src += 2;
- *dst++ = RGB565_32(dst, src, map);
- src += 2;
- *dst++ = RGB565_32(dst, src, map);
- src += 2;
- }
- /* Get any leftovers */
- switch (width & 3) {
- case 3:
- *dst++ = RGB565_32(dst, src, map);
- src += 2;
- case 2:
- *dst++ = RGB565_32(dst, src, map);
- src += 2;
- case 1:
- *dst++ = RGB565_32(dst, src, map);
- src += 2;
- break;
- }
- src += srcskip;
- dst += dstskip;
- }
-#endif /* USE_DUFFS_LOOP */
-}
-
-/* Special optimized blit for RGB 5-6-5 --> ARGB 8-8-8-8 */
-static const Uint32 RGB565_ARGB8888_LUT[512] = {
- 0x00000000, 0xff000000, 0x00000008, 0xff002000,
- 0x00000010, 0xff004000, 0x00000018, 0xff006100,
- 0x00000020, 0xff008100, 0x00000029, 0xff00a100,
- 0x00000031, 0xff00c200, 0x00000039, 0xff00e200,
- 0x00000041, 0xff080000, 0x0000004a, 0xff082000,
- 0x00000052, 0xff084000, 0x0000005a, 0xff086100,
- 0x00000062, 0xff088100, 0x0000006a, 0xff08a100,
- 0x00000073, 0xff08c200, 0x0000007b, 0xff08e200,
- 0x00000083, 0xff100000, 0x0000008b, 0xff102000,
- 0x00000094, 0xff104000, 0x0000009c, 0xff106100,
- 0x000000a4, 0xff108100, 0x000000ac, 0xff10a100,
- 0x000000b4, 0xff10c200, 0x000000bd, 0xff10e200,
- 0x000000c5, 0xff180000, 0x000000cd, 0xff182000,
- 0x000000d5, 0xff184000, 0x000000de, 0xff186100,
- 0x000000e6, 0xff188100, 0x000000ee, 0xff18a100,
- 0x000000f6, 0xff18c200, 0x000000ff, 0xff18e200,
- 0x00000400, 0xff200000, 0x00000408, 0xff202000,
- 0x00000410, 0xff204000, 0x00000418, 0xff206100,
- 0x00000420, 0xff208100, 0x00000429, 0xff20a100,
- 0x00000431, 0xff20c200, 0x00000439, 0xff20e200,
- 0x00000441, 0xff290000, 0x0000044a, 0xff292000,
- 0x00000452, 0xff294000, 0x0000045a, 0xff296100,
- 0x00000462, 0xff298100, 0x0000046a, 0xff29a100,
- 0x00000473, 0xff29c200, 0x0000047b, 0xff29e200,
- 0x00000483, 0xff310000, 0x0000048b, 0xff312000,
- 0x00000494, 0xff314000, 0x0000049c, 0xff316100,
- 0x000004a4, 0xff318100, 0x000004ac, 0xff31a100,
- 0x000004b4, 0xff31c200, 0x000004bd, 0xff31e200,
- 0x000004c5, 0xff390000, 0x000004cd, 0xff392000,
- 0x000004d5, 0xff394000, 0x000004de, 0xff396100,
- 0x000004e6, 0xff398100, 0x000004ee, 0xff39a100,
- 0x000004f6, 0xff39c200, 0x000004ff, 0xff39e200,
- 0x00000800, 0xff410000, 0x00000808, 0xff412000,
- 0x00000810, 0xff414000, 0x00000818, 0xff416100,
- 0x00000820, 0xff418100, 0x00000829, 0xff41a100,
- 0x00000831, 0xff41c200, 0x00000839, 0xff41e200,
- 0x00000841, 0xff4a0000, 0x0000084a, 0xff4a2000,
- 0x00000852, 0xff4a4000, 0x0000085a, 0xff4a6100,
- 0x00000862, 0xff4a8100, 0x0000086a, 0xff4aa100,
- 0x00000873, 0xff4ac200, 0x0000087b, 0xff4ae200,
- 0x00000883, 0xff520000, 0x0000088b, 0xff522000,
- 0x00000894, 0xff524000, 0x0000089c, 0xff526100,
- 0x000008a4, 0xff528100, 0x000008ac, 0xff52a100,
- 0x000008b4, 0xff52c200, 0x000008bd, 0xff52e200,
- 0x000008c5, 0xff5a0000, 0x000008cd, 0xff5a2000,
- 0x000008d5, 0xff5a4000, 0x000008de, 0xff5a6100,
- 0x000008e6, 0xff5a8100, 0x000008ee, 0xff5aa100,
- 0x000008f6, 0xff5ac200, 0x000008ff, 0xff5ae200,
- 0x00000c00, 0xff620000, 0x00000c08, 0xff622000,
- 0x00000c10, 0xff624000, 0x00000c18, 0xff626100,
- 0x00000c20, 0xff628100, 0x00000c29, 0xff62a100,
- 0x00000c31, 0xff62c200, 0x00000c39, 0xff62e200,
- 0x00000c41, 0xff6a0000, 0x00000c4a, 0xff6a2000,
- 0x00000c52, 0xff6a4000, 0x00000c5a, 0xff6a6100,
- 0x00000c62, 0xff6a8100, 0x00000c6a, 0xff6aa100,
- 0x00000c73, 0xff6ac200, 0x00000c7b, 0xff6ae200,
- 0x00000c83, 0xff730000, 0x00000c8b, 0xff732000,
- 0x00000c94, 0xff734000, 0x00000c9c, 0xff736100,
- 0x00000ca4, 0xff738100, 0x00000cac, 0xff73a100,
- 0x00000cb4, 0xff73c200, 0x00000cbd, 0xff73e200,
- 0x00000cc5, 0xff7b0000, 0x00000ccd, 0xff7b2000,
- 0x00000cd5, 0xff7b4000, 0x00000cde, 0xff7b6100,
- 0x00000ce6, 0xff7b8100, 0x00000cee, 0xff7ba100,
- 0x00000cf6, 0xff7bc200, 0x00000cff, 0xff7be200,
- 0x00001000, 0xff830000, 0x00001008, 0xff832000,
- 0x00001010, 0xff834000, 0x00001018, 0xff836100,
- 0x00001020, 0xff838100, 0x00001029, 0xff83a100,
- 0x00001031, 0xff83c200, 0x00001039, 0xff83e200,
- 0x00001041, 0xff8b0000, 0x0000104a, 0xff8b2000,
- 0x00001052, 0xff8b4000, 0x0000105a, 0xff8b6100,
- 0x00001062, 0xff8b8100, 0x0000106a, 0xff8ba100,
- 0x00001073, 0xff8bc200, 0x0000107b, 0xff8be200,
- 0x00001083, 0xff940000, 0x0000108b, 0xff942000,
- 0x00001094, 0xff944000, 0x0000109c, 0xff946100,
- 0x000010a4, 0xff948100, 0x000010ac, 0xff94a100,
- 0x000010b4, 0xff94c200, 0x000010bd, 0xff94e200,
- 0x000010c5, 0xff9c0000, 0x000010cd, 0xff9c2000,
- 0x000010d5, 0xff9c4000, 0x000010de, 0xff9c6100,
- 0x000010e6, 0xff9c8100, 0x000010ee, 0xff9ca100,
- 0x000010f6, 0xff9cc200, 0x000010ff, 0xff9ce200,
- 0x00001400, 0xffa40000, 0x00001408, 0xffa42000,
- 0x00001410, 0xffa44000, 0x00001418, 0xffa46100,
- 0x00001420, 0xffa48100, 0x00001429, 0xffa4a100,
- 0x00001431, 0xffa4c200, 0x00001439, 0xffa4e200,
- 0x00001441, 0xffac0000, 0x0000144a, 0xffac2000,
- 0x00001452, 0xffac4000, 0x0000145a, 0xffac6100,
- 0x00001462, 0xffac8100, 0x0000146a, 0xffaca100,
- 0x00001473, 0xffacc200, 0x0000147b, 0xfface200,
- 0x00001483, 0xffb40000, 0x0000148b, 0xffb42000,
- 0x00001494, 0xffb44000, 0x0000149c, 0xffb46100,
- 0x000014a4, 0xffb48100, 0x000014ac, 0xffb4a100,
- 0x000014b4, 0xffb4c200, 0x000014bd, 0xffb4e200,
- 0x000014c5, 0xffbd0000, 0x000014cd, 0xffbd2000,
- 0x000014d5, 0xffbd4000, 0x000014de, 0xffbd6100,
- 0x000014e6, 0xffbd8100, 0x000014ee, 0xffbda100,
- 0x000014f6, 0xffbdc200, 0x000014ff, 0xffbde200,
- 0x00001800, 0xffc50000, 0x00001808, 0xffc52000,
- 0x00001810, 0xffc54000, 0x00001818, 0xffc56100,
- 0x00001820, 0xffc58100, 0x00001829, 0xffc5a100,
- 0x00001831, 0xffc5c200, 0x00001839, 0xffc5e200,
- 0x00001841, 0xffcd0000, 0x0000184a, 0xffcd2000,
- 0x00001852, 0xffcd4000, 0x0000185a, 0xffcd6100,
- 0x00001862, 0xffcd8100, 0x0000186a, 0xffcda100,
- 0x00001873, 0xffcdc200, 0x0000187b, 0xffcde200,
- 0x00001883, 0xffd50000, 0x0000188b, 0xffd52000,
- 0x00001894, 0xffd54000, 0x0000189c, 0xffd56100,
- 0x000018a4, 0xffd58100, 0x000018ac, 0xffd5a100,
- 0x000018b4, 0xffd5c200, 0x000018bd, 0xffd5e200,
- 0x000018c5, 0xffde0000, 0x000018cd, 0xffde2000,
- 0x000018d5, 0xffde4000, 0x000018de, 0xffde6100,
- 0x000018e6, 0xffde8100, 0x000018ee, 0xffdea100,
- 0x000018f6, 0xffdec200, 0x000018ff, 0xffdee200,
- 0x00001c00, 0xffe60000, 0x00001c08, 0xffe62000,
- 0x00001c10, 0xffe64000, 0x00001c18, 0xffe66100,
- 0x00001c20, 0xffe68100, 0x00001c29, 0xffe6a100,
- 0x00001c31, 0xffe6c200, 0x00001c39, 0xffe6e200,
- 0x00001c41, 0xffee0000, 0x00001c4a, 0xffee2000,
- 0x00001c52, 0xffee4000, 0x00001c5a, 0xffee6100,
- 0x00001c62, 0xffee8100, 0x00001c6a, 0xffeea100,
- 0x00001c73, 0xffeec200, 0x00001c7b, 0xffeee200,
- 0x00001c83, 0xfff60000, 0x00001c8b, 0xfff62000,
- 0x00001c94, 0xfff64000, 0x00001c9c, 0xfff66100,
- 0x00001ca4, 0xfff68100, 0x00001cac, 0xfff6a100,
- 0x00001cb4, 0xfff6c200, 0x00001cbd, 0xfff6e200,
- 0x00001cc5, 0xffff0000, 0x00001ccd, 0xffff2000,
- 0x00001cd5, 0xffff4000, 0x00001cde, 0xffff6100,
- 0x00001ce6, 0xffff8100, 0x00001cee, 0xffffa100,
- 0x00001cf6, 0xffffc200, 0x00001cff, 0xffffe200
-};
-static void Blit_RGB565_ARGB8888(SDL_BlitInfo *info)
-{
- Blit_RGB565_32(info, RGB565_ARGB8888_LUT);
-}
-
-/* Special optimized blit for RGB 5-6-5 --> ABGR 8-8-8-8 */
-static const Uint32 RGB565_ABGR8888_LUT[512] = {
- 0xff000000, 0x00000000, 0xff080000, 0x00002000,
- 0xff100000, 0x00004000, 0xff180000, 0x00006100,
- 0xff200000, 0x00008100, 0xff290000, 0x0000a100,
- 0xff310000, 0x0000c200, 0xff390000, 0x0000e200,
- 0xff410000, 0x00000008, 0xff4a0000, 0x00002008,
- 0xff520000, 0x00004008, 0xff5a0000, 0x00006108,
- 0xff620000, 0x00008108, 0xff6a0000, 0x0000a108,
- 0xff730000, 0x0000c208, 0xff7b0000, 0x0000e208,
- 0xff830000, 0x00000010, 0xff8b0000, 0x00002010,
- 0xff940000, 0x00004010, 0xff9c0000, 0x00006110,
- 0xffa40000, 0x00008110, 0xffac0000, 0x0000a110,
- 0xffb40000, 0x0000c210, 0xffbd0000, 0x0000e210,
- 0xffc50000, 0x00000018, 0xffcd0000, 0x00002018,
- 0xffd50000, 0x00004018, 0xffde0000, 0x00006118,
- 0xffe60000, 0x00008118, 0xffee0000, 0x0000a118,
- 0xfff60000, 0x0000c218, 0xffff0000, 0x0000e218,
- 0xff000400, 0x00000020, 0xff080400, 0x00002020,
- 0xff100400, 0x00004020, 0xff180400, 0x00006120,
- 0xff200400, 0x00008120, 0xff290400, 0x0000a120,
- 0xff310400, 0x0000c220, 0xff390400, 0x0000e220,
- 0xff410400, 0x00000029, 0xff4a0400, 0x00002029,
- 0xff520400, 0x00004029, 0xff5a0400, 0x00006129,
- 0xff620400, 0x00008129, 0xff6a0400, 0x0000a129,
- 0xff730400, 0x0000c229, 0xff7b0400, 0x0000e229,
- 0xff830400, 0x00000031, 0xff8b0400, 0x00002031,
- 0xff940400, 0x00004031, 0xff9c0400, 0x00006131,
- 0xffa40400, 0x00008131, 0xffac0400, 0x0000a131,
- 0xffb40400, 0x0000c231, 0xffbd0400, 0x0000e231,
- 0xffc50400, 0x00000039, 0xffcd0400, 0x00002039,
- 0xffd50400, 0x00004039, 0xffde0400, 0x00006139,
- 0xffe60400, 0x00008139, 0xffee0400, 0x0000a139,
- 0xfff60400, 0x0000c239, 0xffff0400, 0x0000e239,
- 0xff000800, 0x00000041, 0xff080800, 0x00002041,
- 0xff100800, 0x00004041, 0xff180800, 0x00006141,
- 0xff200800, 0x00008141, 0xff290800, 0x0000a141,
- 0xff310800, 0x0000c241, 0xff390800, 0x0000e241,
- 0xff410800, 0x0000004a, 0xff4a0800, 0x0000204a,
- 0xff520800, 0x0000404a, 0xff5a0800, 0x0000614a,
- 0xff620800, 0x0000814a, 0xff6a0800, 0x0000a14a,
- 0xff730800, 0x0000c24a, 0xff7b0800, 0x0000e24a,
- 0xff830800, 0x00000052, 0xff8b0800, 0x00002052,
- 0xff940800, 0x00004052, 0xff9c0800, 0x00006152,
- 0xffa40800, 0x00008152, 0xffac0800, 0x0000a152,
- 0xffb40800, 0x0000c252, 0xffbd0800, 0x0000e252,
- 0xffc50800, 0x0000005a, 0xffcd0800, 0x0000205a,
- 0xffd50800, 0x0000405a, 0xffde0800, 0x0000615a,
- 0xffe60800, 0x0000815a, 0xffee0800, 0x0000a15a,
- 0xfff60800, 0x0000c25a, 0xffff0800, 0x0000e25a,
- 0xff000c00, 0x00000062, 0xff080c00, 0x00002062,
- 0xff100c00, 0x00004062, 0xff180c00, 0x00006162,
- 0xff200c00, 0x00008162, 0xff290c00, 0x0000a162,
- 0xff310c00, 0x0000c262, 0xff390c00, 0x0000e262,
- 0xff410c00, 0x0000006a, 0xff4a0c00, 0x0000206a,
- 0xff520c00, 0x0000406a, 0xff5a0c00, 0x0000616a,
- 0xff620c00, 0x0000816a, 0xff6a0c00, 0x0000a16a,
- 0xff730c00, 0x0000c26a, 0xff7b0c00, 0x0000e26a,
- 0xff830c00, 0x00000073, 0xff8b0c00, 0x00002073,
- 0xff940c00, 0x00004073, 0xff9c0c00, 0x00006173,
- 0xffa40c00, 0x00008173, 0xffac0c00, 0x0000a173,
- 0xffb40c00, 0x0000c273, 0xffbd0c00, 0x0000e273,
- 0xffc50c00, 0x0000007b, 0xffcd0c00, 0x0000207b,
- 0xffd50c00, 0x0000407b, 0xffde0c00, 0x0000617b,
- 0xffe60c00, 0x0000817b, 0xffee0c00, 0x0000a17b,
- 0xfff60c00, 0x0000c27b, 0xffff0c00, 0x0000e27b,
- 0xff001000, 0x00000083, 0xff081000, 0x00002083,
- 0xff101000, 0x00004083, 0xff181000, 0x00006183,
- 0xff201000, 0x00008183, 0xff291000, 0x0000a183,
- 0xff311000, 0x0000c283, 0xff391000, 0x0000e283,
- 0xff411000, 0x0000008b, 0xff4a1000, 0x0000208b,
- 0xff521000, 0x0000408b, 0xff5a1000, 0x0000618b,
- 0xff621000, 0x0000818b, 0xff6a1000, 0x0000a18b,
- 0xff731000, 0x0000c28b, 0xff7b1000, 0x0000e28b,
- 0xff831000, 0x00000094, 0xff8b1000, 0x00002094,
- 0xff941000, 0x00004094, 0xff9c1000, 0x00006194,
- 0xffa41000, 0x00008194, 0xffac1000, 0x0000a194,
- 0xffb41000, 0x0000c294, 0xffbd1000, 0x0000e294,
- 0xffc51000, 0x0000009c, 0xffcd1000, 0x0000209c,
- 0xffd51000, 0x0000409c, 0xffde1000, 0x0000619c,
- 0xffe61000, 0x0000819c, 0xffee1000, 0x0000a19c,
- 0xfff61000, 0x0000c29c, 0xffff1000, 0x0000e29c,
- 0xff001400, 0x000000a4, 0xff081400, 0x000020a4,
- 0xff101400, 0x000040a4, 0xff181400, 0x000061a4,
- 0xff201400, 0x000081a4, 0xff291400, 0x0000a1a4,
- 0xff311400, 0x0000c2a4, 0xff391400, 0x0000e2a4,
- 0xff411400, 0x000000ac, 0xff4a1400, 0x000020ac,
- 0xff521400, 0x000040ac, 0xff5a1400, 0x000061ac,
- 0xff621400, 0x000081ac, 0xff6a1400, 0x0000a1ac,
- 0xff731400, 0x0000c2ac, 0xff7b1400, 0x0000e2ac,
- 0xff831400, 0x000000b4, 0xff8b1400, 0x000020b4,
- 0xff941400, 0x000040b4, 0xff9c1400, 0x000061b4,
- 0xffa41400, 0x000081b4, 0xffac1400, 0x0000a1b4,
- 0xffb41400, 0x0000c2b4, 0xffbd1400, 0x0000e2b4,
- 0xffc51400, 0x000000bd, 0xffcd1400, 0x000020bd,
- 0xffd51400, 0x000040bd, 0xffde1400, 0x000061bd,
- 0xffe61400, 0x000081bd, 0xffee1400, 0x0000a1bd,
- 0xfff61400, 0x0000c2bd, 0xffff1400, 0x0000e2bd,
- 0xff001800, 0x000000c5, 0xff081800, 0x000020c5,
- 0xff101800, 0x000040c5, 0xff181800, 0x000061c5,
- 0xff201800, 0x000081c5, 0xff291800, 0x0000a1c5,
- 0xff311800, 0x0000c2c5, 0xff391800, 0x0000e2c5,
- 0xff411800, 0x000000cd, 0xff4a1800, 0x000020cd,
- 0xff521800, 0x000040cd, 0xff5a1800, 0x000061cd,
- 0xff621800, 0x000081cd, 0xff6a1800, 0x0000a1cd,
- 0xff731800, 0x0000c2cd, 0xff7b1800, 0x0000e2cd,
- 0xff831800, 0x000000d5, 0xff8b1800, 0x000020d5,
- 0xff941800, 0x000040d5, 0xff9c1800, 0x000061d5,
- 0xffa41800, 0x000081d5, 0xffac1800, 0x0000a1d5,
- 0xffb41800, 0x0000c2d5, 0xffbd1800, 0x0000e2d5,
- 0xffc51800, 0x000000de, 0xffcd1800, 0x000020de,
- 0xffd51800, 0x000040de, 0xffde1800, 0x000061de,
- 0xffe61800, 0x000081de, 0xffee1800, 0x0000a1de,
- 0xfff61800, 0x0000c2de, 0xffff1800, 0x0000e2de,
- 0xff001c00, 0x000000e6, 0xff081c00, 0x000020e6,
- 0xff101c00, 0x000040e6, 0xff181c00, 0x000061e6,
- 0xff201c00, 0x000081e6, 0xff291c00, 0x0000a1e6,
- 0xff311c00, 0x0000c2e6, 0xff391c00, 0x0000e2e6,
- 0xff411c00, 0x000000ee, 0xff4a1c00, 0x000020ee,
- 0xff521c00, 0x000040ee, 0xff5a1c00, 0x000061ee,
- 0xff621c00, 0x000081ee, 0xff6a1c00, 0x0000a1ee,
- 0xff731c00, 0x0000c2ee, 0xff7b1c00, 0x0000e2ee,
- 0xff831c00, 0x000000f6, 0xff8b1c00, 0x000020f6,
- 0xff941c00, 0x000040f6, 0xff9c1c00, 0x000061f6,
- 0xffa41c00, 0x000081f6, 0xffac1c00, 0x0000a1f6,
- 0xffb41c00, 0x0000c2f6, 0xffbd1c00, 0x0000e2f6,
- 0xffc51c00, 0x000000ff, 0xffcd1c00, 0x000020ff,
- 0xffd51c00, 0x000040ff, 0xffde1c00, 0x000061ff,
- 0xffe61c00, 0x000081ff, 0xffee1c00, 0x0000a1ff,
- 0xfff61c00, 0x0000c2ff, 0xffff1c00, 0x0000e2ff
-};
-static void Blit_RGB565_ABGR8888(SDL_BlitInfo *info)
-{
- Blit_RGB565_32(info, RGB565_ABGR8888_LUT);
-}
-
-/* Special optimized blit for RGB 5-6-5 --> RGBA 8-8-8-8 */
-static const Uint32 RGB565_RGBA8888_LUT[512] = {
- 0x000000ff, 0x00000000, 0x000008ff, 0x00200000,
- 0x000010ff, 0x00400000, 0x000018ff, 0x00610000,
- 0x000020ff, 0x00810000, 0x000029ff, 0x00a10000,
- 0x000031ff, 0x00c20000, 0x000039ff, 0x00e20000,
- 0x000041ff, 0x08000000, 0x00004aff, 0x08200000,
- 0x000052ff, 0x08400000, 0x00005aff, 0x08610000,
- 0x000062ff, 0x08810000, 0x00006aff, 0x08a10000,
- 0x000073ff, 0x08c20000, 0x00007bff, 0x08e20000,
- 0x000083ff, 0x10000000, 0x00008bff, 0x10200000,
- 0x000094ff, 0x10400000, 0x00009cff, 0x10610000,
- 0x0000a4ff, 0x10810000, 0x0000acff, 0x10a10000,
- 0x0000b4ff, 0x10c20000, 0x0000bdff, 0x10e20000,
- 0x0000c5ff, 0x18000000, 0x0000cdff, 0x18200000,
- 0x0000d5ff, 0x18400000, 0x0000deff, 0x18610000,
- 0x0000e6ff, 0x18810000, 0x0000eeff, 0x18a10000,
- 0x0000f6ff, 0x18c20000, 0x0000ffff, 0x18e20000,
- 0x000400ff, 0x20000000, 0x000408ff, 0x20200000,
- 0x000410ff, 0x20400000, 0x000418ff, 0x20610000,
- 0x000420ff, 0x20810000, 0x000429ff, 0x20a10000,
- 0x000431ff, 0x20c20000, 0x000439ff, 0x20e20000,
- 0x000441ff, 0x29000000, 0x00044aff, 0x29200000,
- 0x000452ff, 0x29400000, 0x00045aff, 0x29610000,
- 0x000462ff, 0x29810000, 0x00046aff, 0x29a10000,
- 0x000473ff, 0x29c20000, 0x00047bff, 0x29e20000,
- 0x000483ff, 0x31000000, 0x00048bff, 0x31200000,
- 0x000494ff, 0x31400000, 0x00049cff, 0x31610000,
- 0x0004a4ff, 0x31810000, 0x0004acff, 0x31a10000,
- 0x0004b4ff, 0x31c20000, 0x0004bdff, 0x31e20000,
- 0x0004c5ff, 0x39000000, 0x0004cdff, 0x39200000,
- 0x0004d5ff, 0x39400000, 0x0004deff, 0x39610000,
- 0x0004e6ff, 0x39810000, 0x0004eeff, 0x39a10000,
- 0x0004f6ff, 0x39c20000, 0x0004ffff, 0x39e20000,
- 0x000800ff, 0x41000000, 0x000808ff, 0x41200000,
- 0x000810ff, 0x41400000, 0x000818ff, 0x41610000,
- 0x000820ff, 0x41810000, 0x000829ff, 0x41a10000,
- 0x000831ff, 0x41c20000, 0x000839ff, 0x41e20000,
- 0x000841ff, 0x4a000000, 0x00084aff, 0x4a200000,
- 0x000852ff, 0x4a400000, 0x00085aff, 0x4a610000,
- 0x000862ff, 0x4a810000, 0x00086aff, 0x4aa10000,
- 0x000873ff, 0x4ac20000, 0x00087bff, 0x4ae20000,
- 0x000883ff, 0x52000000, 0x00088bff, 0x52200000,
- 0x000894ff, 0x52400000, 0x00089cff, 0x52610000,
- 0x0008a4ff, 0x52810000, 0x0008acff, 0x52a10000,
- 0x0008b4ff, 0x52c20000, 0x0008bdff, 0x52e20000,
- 0x0008c5ff, 0x5a000000, 0x0008cdff, 0x5a200000,
- 0x0008d5ff, 0x5a400000, 0x0008deff, 0x5a610000,
- 0x0008e6ff, 0x5a810000, 0x0008eeff, 0x5aa10000,
- 0x0008f6ff, 0x5ac20000, 0x0008ffff, 0x5ae20000,
- 0x000c00ff, 0x62000000, 0x000c08ff, 0x62200000,
- 0x000c10ff, 0x62400000, 0x000c18ff, 0x62610000,
- 0x000c20ff, 0x62810000, 0x000c29ff, 0x62a10000,
- 0x000c31ff, 0x62c20000, 0x000c39ff, 0x62e20000,
- 0x000c41ff, 0x6a000000, 0x000c4aff, 0x6a200000,
- 0x000c52ff, 0x6a400000, 0x000c5aff, 0x6a610000,
- 0x000c62ff, 0x6a810000, 0x000c6aff, 0x6aa10000,
- 0x000c73ff, 0x6ac20000, 0x000c7bff, 0x6ae20000,
- 0x000c83ff, 0x73000000, 0x000c8bff, 0x73200000,
- 0x000c94ff, 0x73400000, 0x000c9cff, 0x73610000,
- 0x000ca4ff, 0x73810000, 0x000cacff, 0x73a10000,
- 0x000cb4ff, 0x73c20000, 0x000cbdff, 0x73e20000,
- 0x000cc5ff, 0x7b000000, 0x000ccdff, 0x7b200000,
- 0x000cd5ff, 0x7b400000, 0x000cdeff, 0x7b610000,
- 0x000ce6ff, 0x7b810000, 0x000ceeff, 0x7ba10000,
- 0x000cf6ff, 0x7bc20000, 0x000cffff, 0x7be20000,
- 0x001000ff, 0x83000000, 0x001008ff, 0x83200000,
- 0x001010ff, 0x83400000, 0x001018ff, 0x83610000,
- 0x001020ff, 0x83810000, 0x001029ff, 0x83a10000,
- 0x001031ff, 0x83c20000, 0x001039ff, 0x83e20000,
- 0x001041ff, 0x8b000000, 0x00104aff, 0x8b200000,
- 0x001052ff, 0x8b400000, 0x00105aff, 0x8b610000,
- 0x001062ff, 0x8b810000, 0x00106aff, 0x8ba10000,
- 0x001073ff, 0x8bc20000, 0x00107bff, 0x8be20000,
- 0x001083ff, 0x94000000, 0x00108bff, 0x94200000,
- 0x001094ff, 0x94400000, 0x00109cff, 0x94610000,
- 0x0010a4ff, 0x94810000, 0x0010acff, 0x94a10000,
- 0x0010b4ff, 0x94c20000, 0x0010bdff, 0x94e20000,
- 0x0010c5ff, 0x9c000000, 0x0010cdff, 0x9c200000,
- 0x0010d5ff, 0x9c400000, 0x0010deff, 0x9c610000,
- 0x0010e6ff, 0x9c810000, 0x0010eeff, 0x9ca10000,
- 0x0010f6ff, 0x9cc20000, 0x0010ffff, 0x9ce20000,
- 0x001400ff, 0xa4000000, 0x001408ff, 0xa4200000,
- 0x001410ff, 0xa4400000, 0x001418ff, 0xa4610000,
- 0x001420ff, 0xa4810000, 0x001429ff, 0xa4a10000,
- 0x001431ff, 0xa4c20000, 0x001439ff, 0xa4e20000,
- 0x001441ff, 0xac000000, 0x00144aff, 0xac200000,
- 0x001452ff, 0xac400000, 0x00145aff, 0xac610000,
- 0x001462ff, 0xac810000, 0x00146aff, 0xaca10000,
- 0x001473ff, 0xacc20000, 0x00147bff, 0xace20000,
- 0x001483ff, 0xb4000000, 0x00148bff, 0xb4200000,
- 0x001494ff, 0xb4400000, 0x00149cff, 0xb4610000,
- 0x0014a4ff, 0xb4810000, 0x0014acff, 0xb4a10000,
- 0x0014b4ff, 0xb4c20000, 0x0014bdff, 0xb4e20000,
- 0x0014c5ff, 0xbd000000, 0x0014cdff, 0xbd200000,
- 0x0014d5ff, 0xbd400000, 0x0014deff, 0xbd610000,
- 0x0014e6ff, 0xbd810000, 0x0014eeff, 0xbda10000,
- 0x0014f6ff, 0xbdc20000, 0x0014ffff, 0xbde20000,
- 0x001800ff, 0xc5000000, 0x001808ff, 0xc5200000,
- 0x001810ff, 0xc5400000, 0x001818ff, 0xc5610000,
- 0x001820ff, 0xc5810000, 0x001829ff, 0xc5a10000,
- 0x001831ff, 0xc5c20000, 0x001839ff, 0xc5e20000,
- 0x001841ff, 0xcd000000, 0x00184aff, 0xcd200000,
- 0x001852ff, 0xcd400000, 0x00185aff, 0xcd610000,
- 0x001862ff, 0xcd810000, 0x00186aff, 0xcda10000,
- 0x001873ff, 0xcdc20000, 0x00187bff, 0xcde20000,
- 0x001883ff, 0xd5000000, 0x00188bff, 0xd5200000,
- 0x001894ff, 0xd5400000, 0x00189cff, 0xd5610000,
- 0x0018a4ff, 0xd5810000, 0x0018acff, 0xd5a10000,
- 0x0018b4ff, 0xd5c20000, 0x0018bdff, 0xd5e20000,
- 0x0018c5ff, 0xde000000, 0x0018cdff, 0xde200000,
- 0x0018d5ff, 0xde400000, 0x0018deff, 0xde610000,
- 0x0018e6ff, 0xde810000, 0x0018eeff, 0xdea10000,
- 0x0018f6ff, 0xdec20000, 0x0018ffff, 0xdee20000,
- 0x001c00ff, 0xe6000000, 0x001c08ff, 0xe6200000,
- 0x001c10ff, 0xe6400000, 0x001c18ff, 0xe6610000,
- 0x001c20ff, 0xe6810000, 0x001c29ff, 0xe6a10000,
- 0x001c31ff, 0xe6c20000, 0x001c39ff, 0xe6e20000,
- 0x001c41ff, 0xee000000, 0x001c4aff, 0xee200000,
- 0x001c52ff, 0xee400000, 0x001c5aff, 0xee610000,
- 0x001c62ff, 0xee810000, 0x001c6aff, 0xeea10000,
- 0x001c73ff, 0xeec20000, 0x001c7bff, 0xeee20000,
- 0x001c83ff, 0xf6000000, 0x001c8bff, 0xf6200000,
- 0x001c94ff, 0xf6400000, 0x001c9cff, 0xf6610000,
- 0x001ca4ff, 0xf6810000, 0x001cacff, 0xf6a10000,
- 0x001cb4ff, 0xf6c20000, 0x001cbdff, 0xf6e20000,
- 0x001cc5ff, 0xff000000, 0x001ccdff, 0xff200000,
- 0x001cd5ff, 0xff400000, 0x001cdeff, 0xff610000,
- 0x001ce6ff, 0xff810000, 0x001ceeff, 0xffa10000,
- 0x001cf6ff, 0xffc20000, 0x001cffff, 0xffe20000,
-};
-static void Blit_RGB565_RGBA8888(SDL_BlitInfo *info)
-{
- Blit_RGB565_32(info, RGB565_RGBA8888_LUT);
-}
-
-/* Special optimized blit for RGB 5-6-5 --> BGRA 8-8-8-8 */
-static const Uint32 RGB565_BGRA8888_LUT[512] = {
- 0x00000000, 0x000000ff, 0x08000000, 0x002000ff,
- 0x10000000, 0x004000ff, 0x18000000, 0x006100ff,
- 0x20000000, 0x008100ff, 0x29000000, 0x00a100ff,
- 0x31000000, 0x00c200ff, 0x39000000, 0x00e200ff,
- 0x41000000, 0x000008ff, 0x4a000000, 0x002008ff,
- 0x52000000, 0x004008ff, 0x5a000000, 0x006108ff,
- 0x62000000, 0x008108ff, 0x6a000000, 0x00a108ff,
- 0x73000000, 0x00c208ff, 0x7b000000, 0x00e208ff,
- 0x83000000, 0x000010ff, 0x8b000000, 0x002010ff,
- 0x94000000, 0x004010ff, 0x9c000000, 0x006110ff,
- 0xa4000000, 0x008110ff, 0xac000000, 0x00a110ff,
- 0xb4000000, 0x00c210ff, 0xbd000000, 0x00e210ff,
- 0xc5000000, 0x000018ff, 0xcd000000, 0x002018ff,
- 0xd5000000, 0x004018ff, 0xde000000, 0x006118ff,
- 0xe6000000, 0x008118ff, 0xee000000, 0x00a118ff,
- 0xf6000000, 0x00c218ff, 0xff000000, 0x00e218ff,
- 0x00040000, 0x000020ff, 0x08040000, 0x002020ff,
- 0x10040000, 0x004020ff, 0x18040000, 0x006120ff,
- 0x20040000, 0x008120ff, 0x29040000, 0x00a120ff,
- 0x31040000, 0x00c220ff, 0x39040000, 0x00e220ff,
- 0x41040000, 0x000029ff, 0x4a040000, 0x002029ff,
- 0x52040000, 0x004029ff, 0x5a040000, 0x006129ff,
- 0x62040000, 0x008129ff, 0x6a040000, 0x00a129ff,
- 0x73040000, 0x00c229ff, 0x7b040000, 0x00e229ff,
- 0x83040000, 0x000031ff, 0x8b040000, 0x002031ff,
- 0x94040000, 0x004031ff, 0x9c040000, 0x006131ff,
- 0xa4040000, 0x008131ff, 0xac040000, 0x00a131ff,
- 0xb4040000, 0x00c231ff, 0xbd040000, 0x00e231ff,
- 0xc5040000, 0x000039ff, 0xcd040000, 0x002039ff,
- 0xd5040000, 0x004039ff, 0xde040000, 0x006139ff,
- 0xe6040000, 0x008139ff, 0xee040000, 0x00a139ff,
- 0xf6040000, 0x00c239ff, 0xff040000, 0x00e239ff,
- 0x00080000, 0x000041ff, 0x08080000, 0x002041ff,
- 0x10080000, 0x004041ff, 0x18080000, 0x006141ff,
- 0x20080000, 0x008141ff, 0x29080000, 0x00a141ff,
- 0x31080000, 0x00c241ff, 0x39080000, 0x00e241ff,
- 0x41080000, 0x00004aff, 0x4a080000, 0x00204aff,
- 0x52080000, 0x00404aff, 0x5a080000, 0x00614aff,
- 0x62080000, 0x00814aff, 0x6a080000, 0x00a14aff,
- 0x73080000, 0x00c24aff, 0x7b080000, 0x00e24aff,
- 0x83080000, 0x000052ff, 0x8b080000, 0x002052ff,
- 0x94080000, 0x004052ff, 0x9c080000, 0x006152ff,
- 0xa4080000, 0x008152ff, 0xac080000, 0x00a152ff,
- 0xb4080000, 0x00c252ff, 0xbd080000, 0x00e252ff,
- 0xc5080000, 0x00005aff, 0xcd080000, 0x00205aff,
- 0xd5080000, 0x00405aff, 0xde080000, 0x00615aff,
- 0xe6080000, 0x00815aff, 0xee080000, 0x00a15aff,
- 0xf6080000, 0x00c25aff, 0xff080000, 0x00e25aff,
- 0x000c0000, 0x000062ff, 0x080c0000, 0x002062ff,
- 0x100c0000, 0x004062ff, 0x180c0000, 0x006162ff,
- 0x200c0000, 0x008162ff, 0x290c0000, 0x00a162ff,
- 0x310c0000, 0x00c262ff, 0x390c0000, 0x00e262ff,
- 0x410c0000, 0x00006aff, 0x4a0c0000, 0x00206aff,
- 0x520c0000, 0x00406aff, 0x5a0c0000, 0x00616aff,
- 0x620c0000, 0x00816aff, 0x6a0c0000, 0x00a16aff,
- 0x730c0000, 0x00c26aff, 0x7b0c0000, 0x00e26aff,
- 0x830c0000, 0x000073ff, 0x8b0c0000, 0x002073ff,
- 0x940c0000, 0x004073ff, 0x9c0c0000, 0x006173ff,
- 0xa40c0000, 0x008173ff, 0xac0c0000, 0x00a173ff,
- 0xb40c0000, 0x00c273ff, 0xbd0c0000, 0x00e273ff,
- 0xc50c0000, 0x00007bff, 0xcd0c0000, 0x00207bff,
- 0xd50c0000, 0x00407bff, 0xde0c0000, 0x00617bff,
- 0xe60c0000, 0x00817bff, 0xee0c0000, 0x00a17bff,
- 0xf60c0000, 0x00c27bff, 0xff0c0000, 0x00e27bff,
- 0x00100000, 0x000083ff, 0x08100000, 0x002083ff,
- 0x10100000, 0x004083ff, 0x18100000, 0x006183ff,
- 0x20100000, 0x008183ff, 0x29100000, 0x00a183ff,
- 0x31100000, 0x00c283ff, 0x39100000, 0x00e283ff,
- 0x41100000, 0x00008bff, 0x4a100000, 0x00208bff,
- 0x52100000, 0x00408bff, 0x5a100000, 0x00618bff,
- 0x62100000, 0x00818bff, 0x6a100000, 0x00a18bff,
- 0x73100000, 0x00c28bff, 0x7b100000, 0x00e28bff,
- 0x83100000, 0x000094ff, 0x8b100000, 0x002094ff,
- 0x94100000, 0x004094ff, 0x9c100000, 0x006194ff,
- 0xa4100000, 0x008194ff, 0xac100000, 0x00a194ff,
- 0xb4100000, 0x00c294ff, 0xbd100000, 0x00e294ff,
- 0xc5100000, 0x00009cff, 0xcd100000, 0x00209cff,
- 0xd5100000, 0x00409cff, 0xde100000, 0x00619cff,
- 0xe6100000, 0x00819cff, 0xee100000, 0x00a19cff,
- 0xf6100000, 0x00c29cff, 0xff100000, 0x00e29cff,
- 0x00140000, 0x0000a4ff, 0x08140000, 0x0020a4ff,
- 0x10140000, 0x0040a4ff, 0x18140000, 0x0061a4ff,
- 0x20140000, 0x0081a4ff, 0x29140000, 0x00a1a4ff,
- 0x31140000, 0x00c2a4ff, 0x39140000, 0x00e2a4ff,
- 0x41140000, 0x0000acff, 0x4a140000, 0x0020acff,
- 0x52140000, 0x0040acff, 0x5a140000, 0x0061acff,
- 0x62140000, 0x0081acff, 0x6a140000, 0x00a1acff,
- 0x73140000, 0x00c2acff, 0x7b140000, 0x00e2acff,
- 0x83140000, 0x0000b4ff, 0x8b140000, 0x0020b4ff,
- 0x94140000, 0x0040b4ff, 0x9c140000, 0x0061b4ff,
- 0xa4140000, 0x0081b4ff, 0xac140000, 0x00a1b4ff,
- 0xb4140000, 0x00c2b4ff, 0xbd140000, 0x00e2b4ff,
- 0xc5140000, 0x0000bdff, 0xcd140000, 0x0020bdff,
- 0xd5140000, 0x0040bdff, 0xde140000, 0x0061bdff,
- 0xe6140000, 0x0081bdff, 0xee140000, 0x00a1bdff,
- 0xf6140000, 0x00c2bdff, 0xff140000, 0x00e2bdff,
- 0x00180000, 0x0000c5ff, 0x08180000, 0x0020c5ff,
- 0x10180000, 0x0040c5ff, 0x18180000, 0x0061c5ff,
- 0x20180000, 0x0081c5ff, 0x29180000, 0x00a1c5ff,
- 0x31180000, 0x00c2c5ff, 0x39180000, 0x00e2c5ff,
- 0x41180000, 0x0000cdff, 0x4a180000, 0x0020cdff,
- 0x52180000, 0x0040cdff, 0x5a180000, 0x0061cdff,
- 0x62180000, 0x0081cdff, 0x6a180000, 0x00a1cdff,
- 0x73180000, 0x00c2cdff, 0x7b180000, 0x00e2cdff,
- 0x83180000, 0x0000d5ff, 0x8b180000, 0x0020d5ff,
- 0x94180000, 0x0040d5ff, 0x9c180000, 0x0061d5ff,
- 0xa4180000, 0x0081d5ff, 0xac180000, 0x00a1d5ff,
- 0xb4180000, 0x00c2d5ff, 0xbd180000, 0x00e2d5ff,
- 0xc5180000, 0x0000deff, 0xcd180000, 0x0020deff,
- 0xd5180000, 0x0040deff, 0xde180000, 0x0061deff,
- 0xe6180000, 0x0081deff, 0xee180000, 0x00a1deff,
- 0xf6180000, 0x00c2deff, 0xff180000, 0x00e2deff,
- 0x001c0000, 0x0000e6ff, 0x081c0000, 0x0020e6ff,
- 0x101c0000, 0x0040e6ff, 0x181c0000, 0x0061e6ff,
- 0x201c0000, 0x0081e6ff, 0x291c0000, 0x00a1e6ff,
- 0x311c0000, 0x00c2e6ff, 0x391c0000, 0x00e2e6ff,
- 0x411c0000, 0x0000eeff, 0x4a1c0000, 0x0020eeff,
- 0x521c0000, 0x0040eeff, 0x5a1c0000, 0x0061eeff,
- 0x621c0000, 0x0081eeff, 0x6a1c0000, 0x00a1eeff,
- 0x731c0000, 0x00c2eeff, 0x7b1c0000, 0x00e2eeff,
- 0x831c0000, 0x0000f6ff, 0x8b1c0000, 0x0020f6ff,
- 0x941c0000, 0x0040f6ff, 0x9c1c0000, 0x0061f6ff,
- 0xa41c0000, 0x0081f6ff, 0xac1c0000, 0x00a1f6ff,
- 0xb41c0000, 0x00c2f6ff, 0xbd1c0000, 0x00e2f6ff,
- 0xc51c0000, 0x0000ffff, 0xcd1c0000, 0x0020ffff,
- 0xd51c0000, 0x0040ffff, 0xde1c0000, 0x0061ffff,
- 0xe61c0000, 0x0081ffff, 0xee1c0000, 0x00a1ffff,
- 0xf61c0000, 0x00c2ffff, 0xff1c0000, 0x00e2ffff
-};
-static void Blit_RGB565_BGRA8888(SDL_BlitInfo *info)
-{
- Blit_RGB565_32(info, RGB565_BGRA8888_LUT);
-}
-
-/* Special optimized blit for RGB 8-8-8 --> RGB 3-3-2 */
-#ifndef RGB888_RGB332
-#define RGB888_RGB332(dst, src) { \
- dst = (((src)&0x00E00000)>>16)| \
- (((src)&0x0000E000)>>11)| \
- (((src)&0x000000C0)>>6); \
-}
-#endif
-static void Blit_RGB888_index8_map(SDL_BlitInfo *info)
-{
-#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->d_width;
- height = info->d_height;
- src = (Uint32 *)info->s_pixels;
- srcskip = info->s_skip/4;
- dst = info->d_pixels;
- dstskip = info->d_skip;
- map = info->table;
-
-#ifdef USE_DUFFS_LOOP
- while ( height-- ) {
- DUFFS_LOOP(
- RGB888_RGB332(Pixel, *src);
- *dst++ = map[Pixel];
- ++src;
- , width);
- 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)
-{
-#ifndef USE_DUFFS_LOOP
- int c;
-#endif
- int width, height;
- Uint8 *src;
- const Uint8 *map;
- Uint8 *dst;
- int srcskip, dstskip;
- int srcbpp;
- Uint32 Pixel;
- int sR, sG, sB;
- SDL_PixelFormat *srcfmt;
-
- /* Set up some basic variables */
- width = info->d_width;
- height = info->d_height;
- src = info->s_pixels;
- srcskip = info->s_skip;
- dst = info->d_pixels;
- dstskip = info->d_skip;
- map = info->table;
- srcfmt = info->src;
- srcbpp = srcfmt->BytesPerPixel;
-
- if ( map == NULL ) {
- while ( height-- ) {
-#ifdef USE_DUFFS_LOOP
- DUFFS_LOOP(
- DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
- sR, sG, sB);
- if ( 1 ) {
- /* Pack RGB into 8bit pixel */
- *dst = ((sR>>5)<<(3+2))|
- ((sG>>5)<<(2)) |
- ((sB>>6)<<(0)) ;
- }
- dst++;
- src += srcbpp;
- , width);
-#else
- for ( c=width; c; --c ) {
- DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
- sR, sG, sB);
- if ( 1 ) {
- /* Pack RGB into 8bit pixel */
- *dst = ((sR>>5)<<(3+2))|
- ((sG>>5)<<(2)) |
- ((sB>>6)<<(0)) ;
- }
- dst++;
- src += srcbpp;
- }
-#endif
- src += srcskip;
- dst += dstskip;
- }
- } else {
- while ( height-- ) {
-#ifdef USE_DUFFS_LOOP
- DUFFS_LOOP(
- DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
- sR, sG, sB);
- if ( 1 ) {
- /* Pack RGB into 8bit pixel */
- *dst = map[((sR>>5)<<(3+2))|
- ((sG>>5)<<(2)) |
- ((sB>>6)<<(0)) ];
- }
- dst++;
- src += srcbpp;
- , width);
-#else
- for ( c=width; c; --c ) {
- DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
- sR, sG, sB);
- if ( 1 ) {
- /* Pack RGB into 8bit pixel */
- *dst = map[((sR>>5)<<(3+2))|
- ((sG>>5)<<(2)) |
- ((sB>>6)<<(0)) ];
- }
- dst++;
- src += srcbpp;
- }
-#endif /* USE_DUFFS_LOOP */
- src += srcskip;
- dst += dstskip;
- }
- }
-}
-
-/* blits 32 bit RGB<->RGBA with both surfaces having the same R,G,B fields */
-static void Blit4to4MaskAlpha(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint32 *src = (Uint32 *)info->s_pixels;
- int srcskip = info->s_skip;
- Uint32 *dst = (Uint32 *)info->d_pixels;
- int dstskip = info->d_skip;
- SDL_PixelFormat *srcfmt = info->src;
- SDL_PixelFormat *dstfmt = info->dst;
-
- if (dstfmt->Amask) {
- /* RGB->RGBA, SET_ALPHA */
- Uint32 mask = (srcfmt->alpha >> dstfmt->Aloss) << dstfmt->Ashift;
-
- while ( height-- ) {
- DUFFS_LOOP(
- {
- *dst = *src | mask;
- ++dst;
- ++src;
- },
- width);
- src = (Uint32*)((Uint8*)src + srcskip);
- dst = (Uint32*)((Uint8*)dst + dstskip);
- }
- } else {
- /* RGBA->RGB, NO_ALPHA */
- Uint32 mask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask;
-
- while ( height-- ) {
- DUFFS_LOOP(
- {
- *dst = *src & mask;
- ++dst;
- ++src;
- },
- width);
- src = (Uint32*)((Uint8*)src + srcskip);
- dst = (Uint32*)((Uint8*)dst + dstskip);
- }
- }
-}
-
-static void BlitNtoN(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- int srcskip = info->s_skip;
- Uint8 *dst = info->d_pixels;
- int dstskip = info->d_skip;
- SDL_PixelFormat *srcfmt = info->src;
- int srcbpp = srcfmt->BytesPerPixel;
- SDL_PixelFormat *dstfmt = info->dst;
- int dstbpp = dstfmt->BytesPerPixel;
- unsigned alpha = dstfmt->Amask ? srcfmt->alpha : 0;
-
- while ( height-- ) {
- DUFFS_LOOP(
- {
- Uint32 Pixel;
- unsigned sR;
- unsigned sG;
- unsigned sB;
- DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
- ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, alpha);
- dst += dstbpp;
- src += srcbpp;
- },
- width);
- src += srcskip;
- dst += dstskip;
- }
-}
-
-static void BlitNtoNCopyAlpha(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- int srcskip = info->s_skip;
- Uint8 *dst = info->d_pixels;
- int dstskip = info->d_skip;
- SDL_PixelFormat *srcfmt = info->src;
- int srcbpp = srcfmt->BytesPerPixel;
- SDL_PixelFormat *dstfmt = info->dst;
- int dstbpp = dstfmt->BytesPerPixel;
- int c;
-
- /* FIXME: should map alpha to [0..255] correctly! */
- while ( height-- ) {
- for ( c=width; c; --c ) {
- Uint32 Pixel;
- unsigned sR, sG, sB, sA;
- DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel,
- sR, sG, sB, sA);
- ASSEMBLE_RGBA(dst, dstbpp, dstfmt,
- sR, sG, sB, sA);
- dst += dstbpp;
- src += srcbpp;
- }
- src += srcskip;
- dst += dstskip;
- }
-}
-
-static void BlitNto1Key(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- int srcskip = info->s_skip;
- Uint8 *dst = info->d_pixels;
- int dstskip = info->d_skip;
- SDL_PixelFormat *srcfmt = info->src;
- const Uint8 *palmap = info->table;
- Uint32 ckey = srcfmt->colorkey;
- Uint32 rgbmask = ~srcfmt->Amask;
- int srcbpp;
- Uint32 Pixel;
- unsigned sR, sG, sB;
-
- /* Set up some basic variables */
- srcbpp = srcfmt->BytesPerPixel;
- ckey &= rgbmask;
-
- if ( palmap == NULL ) {
- while ( height-- ) {
- DUFFS_LOOP(
- {
- DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
- sR, sG, sB);
- if ( (Pixel & rgbmask) != ckey ) {
- /* Pack RGB into 8bit pixel */
- *dst = (Uint8)(((sR>>5)<<(3+2))|
- ((sG>>5)<<(2)) |
- ((sB>>6)<<(0)));
- }
- dst++;
- src += srcbpp;
- },
- width);
- src += srcskip;
- dst += dstskip;
- }
- } else {
- while ( height-- ) {
- DUFFS_LOOP(
- {
- DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
- sR, sG, sB);
- if ( (Pixel & rgbmask) != ckey ) {
- /* Pack RGB into 8bit pixel */
- *dst = (Uint8)palmap[((sR>>5)<<(3+2))|
- ((sG>>5)<<(2)) |
- ((sB>>6)<<(0)) ];
- }
- dst++;
- src += srcbpp;
- },
- width);
- src += srcskip;
- dst += dstskip;
- }
- }
-}
-
-static void Blit2to2Key(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint16 *srcp = (Uint16 *)info->s_pixels;
- int srcskip = info->s_skip;
- Uint16 *dstp = (Uint16 *)info->d_pixels;
- int dstskip = info->d_skip;
- Uint32 ckey = info->src->colorkey;
- Uint32 rgbmask = ~info->src->Amask;
-
- /* Set up some basic variables */
- srcskip /= 2;
- dstskip /= 2;
- ckey &= rgbmask;
-
- while ( height-- ) {
- DUFFS_LOOP(
- {
- if ( (*srcp & rgbmask) != ckey ) {
- *dstp = *srcp;
- }
- dstp++;
- srcp++;
- },
- width);
- srcp += srcskip;
- dstp += dstskip;
- }
-}
-
-static void BlitNtoNKey(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- int srcskip = info->s_skip;
- Uint8 *dst = info->d_pixels;
- int dstskip = info->d_skip;
- Uint32 ckey = info->src->colorkey;
- SDL_PixelFormat *srcfmt = info->src;
- SDL_PixelFormat *dstfmt = info->dst;
- int srcbpp = srcfmt->BytesPerPixel;
- int dstbpp = dstfmt->BytesPerPixel;
- unsigned alpha = dstfmt->Amask ? srcfmt->alpha : 0;
- Uint32 rgbmask = ~srcfmt->Amask;
-
- /* Set up some basic variables */
- ckey &= rgbmask;
-
- while ( height-- ) {
- DUFFS_LOOP(
- {
- Uint32 Pixel;
- unsigned sR;
- unsigned sG;
- unsigned sB;
- RETRIEVE_RGB_PIXEL(src, srcbpp, Pixel);
- if ( (Pixel & rgbmask) != ckey ) {
- RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB);
- ASSEMBLE_RGBA(dst, dstbpp, dstfmt,
- sR, sG, sB, alpha);
- }
- dst += dstbpp;
- src += srcbpp;
- },
- width);
- src += srcskip;
- dst += dstskip;
- }
-}
-
-static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info)
-{
- int width = info->d_width;
- int height = info->d_height;
- Uint8 *src = info->s_pixels;
- int srcskip = info->s_skip;
- Uint8 *dst = info->d_pixels;
- int dstskip = info->d_skip;
- Uint32 ckey = info->src->colorkey;
- SDL_PixelFormat *srcfmt = info->src;
- SDL_PixelFormat *dstfmt = info->dst;
- Uint32 rgbmask = ~srcfmt->Amask;
-
- Uint8 srcbpp;
- Uint8 dstbpp;
- Uint32 Pixel;
- unsigned sR, sG, sB, sA;
-
- /* Set up some basic variables */
- srcbpp = srcfmt->BytesPerPixel;
- dstbpp = dstfmt->BytesPerPixel;
- ckey &= rgbmask;
-
- /* FIXME: should map alpha to [0..255] correctly! */
- while ( height-- ) {
- DUFFS_LOOP(
- {
- DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel,
- sR, sG, sB, sA);
- if ( (Pixel & rgbmask) != ckey ) {
- ASSEMBLE_RGBA(dst, dstbpp, dstfmt,
- sR, sG, sB, sA);
- }
- dst += dstbpp;
- src += srcbpp;
- },
- width);
- src += srcskip;
- dst += dstskip;
- }
-}
-
-/* Normal N to N optimized blitters */
-struct blit_table {
- Uint32 srcR, srcG, srcB;
- int dstbpp;
- Uint32 dstR, dstG, dstB;
- Uint32 blit_features;
- void *aux_data;
- SDL_loblit blitfunc;
- enum { NO_ALPHA=1, SET_ALPHA=2, COPY_ALPHA=4 } alpha;
-};
-static const struct blit_table normal_blit_1[] = {
- /* Default for 8-bit RGB source, an invalid combination */
- { 0,0,0, 0, 0,0,0, 0, NULL, NULL },
-};
-static const struct blit_table normal_blit_2[] = {
-#if SDL_HERMES_BLITTERS
- { 0x0000F800,0x000007E0,0x0000001F, 2, 0x0000001F,0x000007E0,0x0000F800,
- 0, ConvertX86p16_16BGR565, ConvertX86, NO_ALPHA },
- { 0x0000F800,0x000007E0,0x0000001F, 2, 0x00007C00,0x000003E0,0x0000001F,
- 0, ConvertX86p16_16RGB555, ConvertX86, NO_ALPHA },
- { 0x0000F800,0x000007E0,0x0000001F, 2, 0x0000001F,0x000003E0,0x00007C00,
- 0, ConvertX86p16_16BGR555, ConvertX86, NO_ALPHA },
-#elif SDL_ALTIVEC_BLITTERS
- /* has-altivec */
- { 0x0000F800,0x000007E0,0x0000001F, 4, 0x00000000,0x00000000,0x00000000,
- 2, NULL, Blit_RGB565_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA },
- { 0x00007C00,0x000003E0,0x0000001F, 4, 0x00000000,0x00000000,0x00000000,
- 2, NULL, Blit_RGB555_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA },
-#endif
- { 0x0000F800,0x000007E0,0x0000001F, 4, 0x00FF0000,0x0000FF00,0x000000FF,
- 0, NULL, Blit_RGB565_ARGB8888, SET_ALPHA },
- { 0x0000F800,0x000007E0,0x0000001F, 4, 0x000000FF,0x0000FF00,0x00FF0000,
- 0, NULL, Blit_RGB565_ABGR8888, SET_ALPHA },
- { 0x0000F800,0x000007E0,0x0000001F, 4, 0xFF000000,0x00FF0000,0x0000FF00,
- 0, NULL, Blit_RGB565_RGBA8888, SET_ALPHA },
- { 0x0000F800,0x000007E0,0x0000001F, 4, 0x0000FF00,0x00FF0000,0xFF000000,
- 0, NULL, Blit_RGB565_BGRA8888, SET_ALPHA },
-
- /* Default for 16-bit RGB source, used if no other blitter matches */
- { 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
-};
-static const struct blit_table normal_blit_3[] = {
- /* Default for 24-bit RGB source, never optimized */
- { 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
-};
-static const struct blit_table normal_blit_4[] = {
-#if SDL_HERMES_BLITTERS
- { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
- 1, ConvertMMXpII32_16RGB565, ConvertMMX, NO_ALPHA },
- { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
- 0, ConvertX86p32_16RGB565, ConvertX86, NO_ALPHA },
- { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000007E0,0x0000F800,
- 1, ConvertMMXpII32_16BGR565, ConvertMMX, NO_ALPHA },
- { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000007E0,0x0000F800,
- 0, ConvertX86p32_16BGR565, ConvertX86, NO_ALPHA },
- { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F,
- 1, ConvertMMXpII32_16RGB555, ConvertMMX, NO_ALPHA },
- { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F,
- 0, ConvertX86p32_16RGB555, ConvertX86, NO_ALPHA },
- { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000003E0,0x00007C00,
- 1, ConvertMMXpII32_16BGR555, ConvertMMX, NO_ALPHA },
- { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000003E0,0x00007C00,
- 0, ConvertX86p32_16BGR555, ConvertX86, NO_ALPHA },
- { 0x00FF0000,0x0000FF00,0x000000FF, 3, 0x00FF0000,0x0000FF00,0x000000FF,
- 0, ConvertX86p32_24RGB888, ConvertX86, NO_ALPHA },
- { 0x00FF0000,0x0000FF00,0x000000FF, 3, 0x000000FF,0x0000FF00,0x00FF0000,
- 0, ConvertX86p32_24BGR888, ConvertX86, NO_ALPHA },
- { 0x00FF0000,0x0000FF00,0x000000FF, 4, 0x000000FF,0x0000FF00,0x00FF0000,
- 0, ConvertX86p32_32BGR888, ConvertX86, NO_ALPHA },
- { 0x00FF0000,0x0000FF00,0x000000FF, 4, 0xFF000000,0x00FF0000,0x0000FF00,
- 0, ConvertX86p32_32RGBA888, ConvertX86, NO_ALPHA },
- { 0x00FF0000,0x0000FF00,0x000000FF, 4, 0x0000FF00,0x00FF0000,0xFF000000,
- 0, ConvertX86p32_32BGRA888, ConvertX86, NO_ALPHA },
-#else
-#if SDL_ALTIVEC_BLITTERS
- /* has-altivec | dont-use-prefetch */
- { 0x00000000,0x00000000,0x00000000, 4, 0x00000000,0x00000000,0x00000000,
- 6, NULL, ConvertAltivec32to32_noprefetch, NO_ALPHA | COPY_ALPHA | SET_ALPHA },
- /* has-altivec */
- { 0x00000000,0x00000000,0x00000000, 4, 0x00000000,0x00000000,0x00000000,
- 2, NULL, ConvertAltivec32to32_prefetch, NO_ALPHA | COPY_ALPHA | SET_ALPHA },
- /* has-altivec */
- { 0x00000000,0x00000000,0x00000000, 2, 0x0000F800,0x000007E0,0x0000001F,
- 2, NULL, Blit_RGB888_RGB565Altivec, NO_ALPHA },
-#endif
- { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
- 0, NULL, Blit_RGB888_RGB565, NO_ALPHA },
- { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F,
- 0, NULL, Blit_RGB888_RGB555, NO_ALPHA },
-#endif
- /* Default for 32-bit RGB source, used if no other blitter matches */
- { 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
-};
-static const struct blit_table *normal_blit[] = {
- normal_blit_1, normal_blit_2, normal_blit_3, normal_blit_4
-};
-
-/* Mask matches table, or table entry is zero */
-#define MASKOK(x, y) (((x) == (y)) || ((y) == 0x00000000))
-
-SDL_loblit SDL_CalculateBlitN(SDL_Surface *surface, int blit_index)
-{
- struct private_swaccel *sdata;
- SDL_PixelFormat *srcfmt;
- SDL_PixelFormat *dstfmt;
- const struct blit_table *table;
- int which;
- SDL_loblit blitfun;
-
- /* Set up data for choosing the blit */
- sdata = surface->map->sw_data;
- srcfmt = surface->format;
- dstfmt = surface->map->dst->format;
-
- if ( blit_index & 2 ) {
- /* alpha or alpha+colorkey */
- return SDL_CalculateAlphaBlit(surface, blit_index);
- }
-
- /* We don't support destinations less than 8-bits */
- if ( dstfmt->BitsPerPixel < 8 ) {
- return(NULL);
- }
-
- if(blit_index == 1) {
- /* colorkey blit: Here we don't have too many options, mostly
- because RLE is the preferred fast way to deal with this.
- If a particular case turns out to be useful we'll add it. */
-
- if(srcfmt->BytesPerPixel == 2
- && surface->map->identity)
- return Blit2to2Key;
- else if(dstfmt->BytesPerPixel == 1)
- return BlitNto1Key;
- else {
-#if SDL_ALTIVEC_BLITTERS
- if((srcfmt->BytesPerPixel == 4) && (dstfmt->BytesPerPixel == 4) && SDL_HasAltiVec()) {
- return Blit32to32KeyAltivec;
- } else
-#endif
-
- if(srcfmt->Amask && dstfmt->Amask)
- return BlitNtoNKeyCopyAlpha;
- else
- return BlitNtoNKey;
- }
- }
-
- blitfun = NULL;
- if ( dstfmt->BitsPerPixel == 8 ) {
- /* We assume 8-bit destinations are palettized */
- if ( (srcfmt->BytesPerPixel == 4) &&
- (srcfmt->Rmask == 0x00FF0000) &&
- (srcfmt->Gmask == 0x0000FF00) &&
- (srcfmt->Bmask == 0x000000FF) ) {
- if ( surface->map->table ) {
- blitfun = Blit_RGB888_index8_map;
- } else {
-#if SDL_HERMES_BLITTERS
- sdata->aux_data = ConvertX86p32_8RGB332;
- blitfun = ConvertX86;
-#else
- blitfun = Blit_RGB888_index8;
-#endif
- }
- } else {
- blitfun = BlitNto1;
- }
- } else {
- /* Now the meat, choose the blitter we want */
- int a_need = NO_ALPHA;
- if(dstfmt->Amask)
- a_need = srcfmt->Amask ? COPY_ALPHA : SET_ALPHA;
- table = normal_blit[srcfmt->BytesPerPixel-1];
- for ( which=0; table[which].dstbpp; ++which ) {
- if ( MASKOK(srcfmt->Rmask, table[which].srcR) &&
- MASKOK(srcfmt->Gmask, table[which].srcG) &&
- MASKOK(srcfmt->Bmask, table[which].srcB) &&
- MASKOK(dstfmt->Rmask, table[which].dstR) &&
- MASKOK(dstfmt->Gmask, table[which].dstG) &&
- MASKOK(dstfmt->Bmask, table[which].dstB) &&
- dstfmt->BytesPerPixel == table[which].dstbpp &&
- (a_need & table[which].alpha) == a_need &&
- ((table[which].blit_features & GetBlitFeatures()) == table[which].blit_features) )
- break;
- }
- sdata->aux_data = table[which].aux_data;
- blitfun = table[which].blitfunc;
-
- if(blitfun == BlitNtoN) { /* default C fallback catch-all. Slow! */
- /* Fastpath C fallback: 32bit RGB<->RGBA blit with matching RGB */
- if ( srcfmt->BytesPerPixel == 4 && dstfmt->BytesPerPixel == 4 &&
- srcfmt->Rmask == dstfmt->Rmask &&
- srcfmt->Gmask == dstfmt->Gmask &&
- srcfmt->Bmask == dstfmt->Bmask ) {
- blitfun = Blit4to4MaskAlpha;
- } else if ( a_need == COPY_ALPHA ) {
- blitfun = BlitNtoNCopyAlpha;
- }
- }
- }
-
-#ifdef DEBUG_ASM
-#if SDL_HERMES_BLITTERS
- if ( blitfun == ConvertMMX )
- fprintf(stderr, "Using mmx blit\n");
- else
- if ( blitfun == ConvertX86 )
- fprintf(stderr, "Using asm blit\n");
- else
-#endif
- if ( (blitfun == BlitNtoN) || (blitfun == BlitNto1) )
- fprintf(stderr, "Using C blit\n");
- else
- fprintf(stderr, "Using optimized C blit\n");
-#endif /* DEBUG_ASM */
-
- return(blitfun);
-}
diff --git a/distrib/sdl-1.2.12/src/video/SDL_bmp.c b/distrib/sdl-1.2.12/src/video/SDL_bmp.c
deleted file mode 100644
index 874cb27..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_bmp.c
+++ /dev/null
@@ -1,520 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- 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.
-
- This code currently supports Win32 DIBs in uncompressed 8 and 24 bpp.
-*/
-
-#include "SDL_video.h"
-#include "SDL_endian.h"
-
-/* Compression encodings for BMP files */
-#ifndef BI_RGB
-#define BI_RGB 0
-#define BI_RLE8 1
-#define BI_RLE4 2
-#define BI_BITFIELDS 3
-#endif
-
-
-SDL_Surface * SDL_LoadBMP_RW (SDL_RWops *src, int freesrc)
-{
- int was_error;
- long fp_offset;
- int bmpPitch;
- int i, pad;
- SDL_Surface *surface;
- Uint32 Rmask;
- Uint32 Gmask;
- Uint32 Bmask;
- SDL_Palette *palette;
- Uint8 *bits;
- int ExpandBMP;
-
- /* The Win32 BMP file header (14 bytes) */
- char magic[2];
- Uint32 bfSize;
- Uint16 bfReserved1;
- Uint16 bfReserved2;
- Uint32 bfOffBits;
-
- /* The Win32 BITMAPINFOHEADER struct (40 bytes) */
- Uint32 biSize;
- Sint32 biWidth;
- Sint32 biHeight;
- Uint16 biPlanes;
- Uint16 biBitCount;
- Uint32 biCompression;
- Uint32 biSizeImage;
- Sint32 biXPelsPerMeter;
- Sint32 biYPelsPerMeter;
- Uint32 biClrUsed;
- Uint32 biClrImportant;
-
- /* Make sure we are passed a valid data source */
- surface = NULL;
- was_error = 0;
- if ( src == NULL ) {
- was_error = 1;
- goto done;
- }
-
- /* Read in the BMP file header */
- fp_offset = SDL_RWtell(src);
- SDL_ClearError();
- if ( SDL_RWread(src, magic, 1, 2) != 2 ) {
- SDL_Error(SDL_EFREAD);
- was_error = 1;
- goto done;
- }
- if ( SDL_strncmp(magic, "BM", 2) != 0 ) {
- SDL_SetError("File is not a Windows BMP file");
- was_error = 1;
- goto done;
- }
- bfSize = SDL_ReadLE32(src);
- bfReserved1 = SDL_ReadLE16(src);
- bfReserved2 = SDL_ReadLE16(src);
- bfOffBits = SDL_ReadLE32(src);
-
- /* Read the Win32 BITMAPINFOHEADER */
- biSize = SDL_ReadLE32(src);
- if ( biSize == 12 ) {
- biWidth = (Uint32)SDL_ReadLE16(src);
- biHeight = (Uint32)SDL_ReadLE16(src);
- biPlanes = SDL_ReadLE16(src);
- biBitCount = SDL_ReadLE16(src);
- biCompression = BI_RGB;
- biSizeImage = 0;
- biXPelsPerMeter = 0;
- biYPelsPerMeter = 0;
- biClrUsed = 0;
- biClrImportant = 0;
- } else {
- biWidth = SDL_ReadLE32(src);
- biHeight = SDL_ReadLE32(src);
- biPlanes = SDL_ReadLE16(src);
- biBitCount = SDL_ReadLE16(src);
- biCompression = SDL_ReadLE32(src);
- biSizeImage = SDL_ReadLE32(src);
- biXPelsPerMeter = SDL_ReadLE32(src);
- biYPelsPerMeter = SDL_ReadLE32(src);
- biClrUsed = SDL_ReadLE32(src);
- biClrImportant = SDL_ReadLE32(src);
- }
-
- /* Check for read error */
- if ( SDL_strcmp(SDL_GetError(), "") != 0 ) {
- was_error = 1;
- goto done;
- }
-
- /* Expand 1 and 4 bit bitmaps to 8 bits per pixel */
- switch (biBitCount) {
- case 1:
- case 4:
- ExpandBMP = biBitCount;
- biBitCount = 8;
- break;
- default:
- ExpandBMP = 0;
- break;
- }
-
- /* We don't support any BMP compression right now */
- Rmask = Gmask = Bmask = 0;
- switch (biCompression) {
- case BI_RGB:
- /* If there are no masks, use the defaults */
- if ( bfOffBits == (14+biSize) ) {
- /* Default values for the BMP format */
- switch (biBitCount) {
- case 15:
- case 16:
- Rmask = 0x7C00;
- Gmask = 0x03E0;
- Bmask = 0x001F;
- break;
- case 24:
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
- Rmask = 0x000000FF;
- Gmask = 0x0000FF00;
- Bmask = 0x00FF0000;
- break;
-#endif
- case 32:
- Rmask = 0x00FF0000;
- Gmask = 0x0000FF00;
- Bmask = 0x000000FF;
- break;
- default:
- break;
- }
- break;
- }
- /* Fall through -- read the RGB masks */
-
- case BI_BITFIELDS:
- switch (biBitCount) {
- case 15:
- case 16:
- case 32:
- Rmask = SDL_ReadLE32(src);
- Gmask = SDL_ReadLE32(src);
- Bmask = SDL_ReadLE32(src);
- break;
- default:
- break;
- }
- break;
- default:
- SDL_SetError("Compressed BMP files not supported");
- was_error = 1;
- goto done;
- }
-
- /* Create a compatible surface, note that the colors are RGB ordered */
- surface = SDL_CreateRGBSurface(SDL_SWSURFACE,
- biWidth, biHeight, biBitCount, Rmask, Gmask, Bmask, 0);
- if ( surface == NULL ) {
- was_error = 1;
- goto done;
- }
-
- /* Load the palette, if any */
- palette = (surface->format)->palette;
- if ( palette ) {
- if ( biClrUsed == 0 ) {
- biClrUsed = 1 << biBitCount;
- }
- if ( biSize == 12 ) {
- for ( i = 0; i < (int)biClrUsed; ++i ) {
- SDL_RWread(src, &palette->colors[i].b, 1, 1);
- SDL_RWread(src, &palette->colors[i].g, 1, 1);
- SDL_RWread(src, &palette->colors[i].r, 1, 1);
- palette->colors[i].unused = 0;
- }
- } else {
- for ( i = 0; i < (int)biClrUsed; ++i ) {
- SDL_RWread(src, &palette->colors[i].b, 1, 1);
- SDL_RWread(src, &palette->colors[i].g, 1, 1);
- SDL_RWread(src, &palette->colors[i].r, 1, 1);
- SDL_RWread(src, &palette->colors[i].unused, 1, 1);
- }
- }
- palette->ncolors = biClrUsed;
- }
-
- /* Read the surface pixels. Note that the bmp image is upside down */
- if ( SDL_RWseek(src, fp_offset+bfOffBits, RW_SEEK_SET) < 0 ) {
- SDL_Error(SDL_EFSEEK);
- was_error = 1;
- goto done;
- }
- bits = (Uint8 *)surface->pixels+(surface->h*surface->pitch);
- switch (ExpandBMP) {
- case 1:
- bmpPitch = (biWidth + 7) >> 3;
- pad = (((bmpPitch)%4) ? (4-((bmpPitch)%4)) : 0);
- break;
- case 4:
- bmpPitch = (biWidth + 1) >> 1;
- pad = (((bmpPitch)%4) ? (4-((bmpPitch)%4)) : 0);
- break;
- default:
- pad = ((surface->pitch%4) ?
- (4-(surface->pitch%4)) : 0);
- break;
- }
- while ( bits > (Uint8 *)surface->pixels ) {
- bits -= surface->pitch;
- switch (ExpandBMP) {
- case 1:
- case 4: {
- Uint8 pixel = 0;
- int shift = (8-ExpandBMP);
- for ( i=0; i<surface->w; ++i ) {
- if ( i%(8/ExpandBMP) == 0 ) {
- if ( !SDL_RWread(src, &pixel, 1, 1) ) {
- SDL_SetError(
- "Error reading from BMP");
- was_error = 1;
- goto done;
- }
- }
- *(bits+i) = (pixel>>shift);
- pixel <<= ExpandBMP;
- } }
- break;
-
- default:
- if ( SDL_RWread(src, bits, 1, surface->pitch)
- != surface->pitch ) {
- SDL_Error(SDL_EFREAD);
- was_error = 1;
- goto done;
- }
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
- /* Byte-swap the pixels if needed. Note that the 24bpp
- case has already been taken care of above. */
- switch(biBitCount) {
- case 15:
- case 16: {
- Uint16 *pix = (Uint16 *)bits;
- for(i = 0; i < surface->w; i++)
- pix[i] = SDL_Swap16(pix[i]);
- break;
- }
-
- case 32: {
- Uint32 *pix = (Uint32 *)bits;
- for(i = 0; i < surface->w; i++)
- pix[i] = SDL_Swap32(pix[i]);
- break;
- }
- }
-#endif
- break;
- }
- /* Skip padding bytes, ugh */
- if ( pad ) {
- Uint8 padbyte;
- for ( i=0; i<pad; ++i ) {
- SDL_RWread(src, &padbyte, 1, 1);
- }
- }
- }
-done:
- if ( was_error ) {
- if ( src ) {
- SDL_RWseek(src, fp_offset, RW_SEEK_SET);
- }
- if ( surface ) {
- SDL_FreeSurface(surface);
- }
- surface = NULL;
- }
- if ( freesrc && src ) {
- SDL_RWclose(src);
- }
- return(surface);
-}
-
-int SDL_SaveBMP_RW (SDL_Surface *saveme, SDL_RWops *dst, int freedst)
-{
- long fp_offset;
- int i, pad;
- SDL_Surface *surface;
- Uint8 *bits;
-
- /* The Win32 BMP file header (14 bytes) */
- char magic[2] = { 'B', 'M' };
- Uint32 bfSize;
- Uint16 bfReserved1;
- Uint16 bfReserved2;
- Uint32 bfOffBits;
-
- /* The Win32 BITMAPINFOHEADER struct (40 bytes) */
- Uint32 biSize;
- Sint32 biWidth;
- Sint32 biHeight;
- Uint16 biPlanes;
- Uint16 biBitCount;
- Uint32 biCompression;
- Uint32 biSizeImage;
- Sint32 biXPelsPerMeter;
- Sint32 biYPelsPerMeter;
- Uint32 biClrUsed;
- Uint32 biClrImportant;
-
- /* Make sure we have somewhere to save */
- surface = NULL;
- if ( dst ) {
- if ( saveme->format->palette ) {
- if ( saveme->format->BitsPerPixel == 8 ) {
- surface = saveme;
- } else {
- SDL_SetError("%d bpp BMP files not supported",
- saveme->format->BitsPerPixel);
- }
- }
- else if ( (saveme->format->BitsPerPixel == 24) &&
-#if SDL_BYTEORDER == SDL_LIL_ENDIAN
- (saveme->format->Rmask == 0x00FF0000) &&
- (saveme->format->Gmask == 0x0000FF00) &&
- (saveme->format->Bmask == 0x000000FF)
-#else
- (saveme->format->Rmask == 0x000000FF) &&
- (saveme->format->Gmask == 0x0000FF00) &&
- (saveme->format->Bmask == 0x00FF0000)
-#endif
- ) {
- surface = saveme;
- } else {
- SDL_Rect bounds;
-
- /* Convert to 24 bits per pixel */
- surface = SDL_CreateRGBSurface(SDL_SWSURFACE,
- saveme->w, saveme->h, 24,
-#if SDL_BYTEORDER == SDL_LIL_ENDIAN
- 0x00FF0000, 0x0000FF00, 0x000000FF,
-#else
- 0x000000FF, 0x0000FF00, 0x00FF0000,
-#endif
- 0);
- if ( surface != NULL ) {
- bounds.x = 0;
- bounds.y = 0;
- bounds.w = saveme->w;
- bounds.h = saveme->h;
- if ( SDL_LowerBlit(saveme, &bounds, surface,
- &bounds) < 0 ) {
- SDL_FreeSurface(surface);
- SDL_SetError(
- "Couldn't convert image to 24 bpp");
- surface = NULL;
- }
- }
- }
- }
-
- if ( surface && (SDL_LockSurface(surface) == 0) ) {
- const int bw = surface->w*surface->format->BytesPerPixel;
-
- /* Set the BMP file header values */
- bfSize = 0; /* We'll write this when we're done */
- bfReserved1 = 0;
- bfReserved2 = 0;
- bfOffBits = 0; /* We'll write this when we're done */
-
- /* Write the BMP file header values */
- fp_offset = SDL_RWtell(dst);
- SDL_ClearError();
- SDL_RWwrite(dst, magic, 2, 1);
- SDL_WriteLE32(dst, bfSize);
- SDL_WriteLE16(dst, bfReserved1);
- SDL_WriteLE16(dst, bfReserved2);
- SDL_WriteLE32(dst, bfOffBits);
-
- /* Set the BMP info values */
- biSize = 40;
- biWidth = surface->w;
- biHeight = surface->h;
- biPlanes = 1;
- biBitCount = surface->format->BitsPerPixel;
- biCompression = BI_RGB;
- biSizeImage = surface->h*surface->pitch;
- biXPelsPerMeter = 0;
- biYPelsPerMeter = 0;
- if ( surface->format->palette ) {
- biClrUsed = surface->format->palette->ncolors;
- } else {
- biClrUsed = 0;
- }
- biClrImportant = 0;
-
- /* Write the BMP info values */
- SDL_WriteLE32(dst, biSize);
- SDL_WriteLE32(dst, biWidth);
- SDL_WriteLE32(dst, biHeight);
- SDL_WriteLE16(dst, biPlanes);
- SDL_WriteLE16(dst, biBitCount);
- SDL_WriteLE32(dst, biCompression);
- SDL_WriteLE32(dst, biSizeImage);
- SDL_WriteLE32(dst, biXPelsPerMeter);
- SDL_WriteLE32(dst, biYPelsPerMeter);
- SDL_WriteLE32(dst, biClrUsed);
- SDL_WriteLE32(dst, biClrImportant);
-
- /* Write the palette (in BGR color order) */
- if ( surface->format->palette ) {
- SDL_Color *colors;
- int ncolors;
-
- colors = surface->format->palette->colors;
- ncolors = surface->format->palette->ncolors;
- for ( i=0; i<ncolors; ++i ) {
- SDL_RWwrite(dst, &colors[i].b, 1, 1);
- SDL_RWwrite(dst, &colors[i].g, 1, 1);
- SDL_RWwrite(dst, &colors[i].r, 1, 1);
- SDL_RWwrite(dst, &colors[i].unused, 1, 1);
- }
- }
-
- /* Write the bitmap offset */
- bfOffBits = SDL_RWtell(dst)-fp_offset;
- if ( SDL_RWseek(dst, fp_offset+10, RW_SEEK_SET) < 0 ) {
- SDL_Error(SDL_EFSEEK);
- }
- SDL_WriteLE32(dst, bfOffBits);
- if ( SDL_RWseek(dst, fp_offset+bfOffBits, RW_SEEK_SET) < 0 ) {
- SDL_Error(SDL_EFSEEK);
- }
-
- /* Write the bitmap image upside down */
- bits = (Uint8 *)surface->pixels+(surface->h*surface->pitch);
- pad = ((bw%4) ? (4-(bw%4)) : 0);
- while ( bits > (Uint8 *)surface->pixels ) {
- bits -= surface->pitch;
- if ( SDL_RWwrite(dst, bits, 1, bw) != bw) {
- SDL_Error(SDL_EFWRITE);
- break;
- }
- if ( pad ) {
- const Uint8 padbyte = 0;
- for ( i=0; i<pad; ++i ) {
- SDL_RWwrite(dst, &padbyte, 1, 1);
- }
- }
- }
-
- /* Write the BMP file size */
- bfSize = SDL_RWtell(dst)-fp_offset;
- if ( SDL_RWseek(dst, fp_offset+2, RW_SEEK_SET) < 0 ) {
- SDL_Error(SDL_EFSEEK);
- }
- SDL_WriteLE32(dst, bfSize);
- if ( SDL_RWseek(dst, fp_offset+bfSize, RW_SEEK_SET) < 0 ) {
- SDL_Error(SDL_EFSEEK);
- }
-
- /* Close it up.. */
- SDL_UnlockSurface(surface);
- if ( surface != saveme ) {
- SDL_FreeSurface(surface);
- }
- }
-
- if ( freedst && dst ) {
- SDL_RWclose(dst);
- }
- return((SDL_strcmp(SDL_GetError(), "") == 0) ? 0 : -1);
-}
diff --git a/distrib/sdl-1.2.12/src/video/SDL_cursor.c b/distrib/sdl-1.2.12/src/video/SDL_cursor.c
deleted file mode 100644
index c1f8603..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_cursor.c
+++ /dev/null
@@ -1,758 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* General cursor handling code for SDL */
-
-#include "SDL_mutex.h"
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "SDL_blit.h"
-#include "SDL_sysvideo.h"
-#include "SDL_cursor_c.h"
-#include "SDL_pixels_c.h"
-#include "default_cursor.h"
-#include "../events/SDL_sysevents.h"
-#include "../events/SDL_events_c.h"
-
-/* These are static for our cursor handling code */
-volatile int SDL_cursorstate = CURSOR_VISIBLE;
-SDL_Cursor *SDL_cursor = NULL;
-static SDL_Cursor *SDL_defcursor = NULL;
-SDL_mutex *SDL_cursorlock = NULL;
-
-/* Public functions */
-void SDL_CursorQuit(void)
-{
- if ( SDL_cursor != NULL ) {
- SDL_Cursor *cursor;
-
- SDL_cursorstate &= ~CURSOR_VISIBLE;
- if ( SDL_cursor != SDL_defcursor ) {
- SDL_FreeCursor(SDL_cursor);
- }
- SDL_cursor = NULL;
- if ( SDL_defcursor != NULL ) {
- cursor = SDL_defcursor;
- SDL_defcursor = NULL;
- SDL_FreeCursor(cursor);
- }
- }
- if ( SDL_cursorlock != NULL ) {
- SDL_DestroyMutex(SDL_cursorlock);
- SDL_cursorlock = NULL;
- }
-}
-int SDL_CursorInit(Uint32 multithreaded)
-{
- /* We don't have mouse focus, and the cursor isn't drawn yet */
-#ifndef IPOD
- SDL_cursorstate = CURSOR_VISIBLE;
-#endif
-
- /* Create the default cursor */
- if ( SDL_defcursor == NULL ) {
- SDL_defcursor = SDL_CreateCursor(default_cdata, default_cmask,
- DEFAULT_CWIDTH, DEFAULT_CHEIGHT,
- DEFAULT_CHOTX, DEFAULT_CHOTY);
- SDL_SetCursor(SDL_defcursor);
- }
-
- /* Create a lock if necessary */
- if ( multithreaded ) {
- SDL_cursorlock = SDL_CreateMutex();
- }
-
- /* That's it! */
- return(0);
-}
-
-/* Multi-thread support for cursors */
-#ifndef SDL_LockCursor
-void SDL_LockCursor(void)
-{
- if ( SDL_cursorlock ) {
- SDL_mutexP(SDL_cursorlock);
- }
-}
-#endif
-#ifndef SDL_UnlockCursor
-void SDL_UnlockCursor(void)
-{
- if ( SDL_cursorlock ) {
- SDL_mutexV(SDL_cursorlock);
- }
-}
-#endif
-
-/* Software cursor drawing support */
-SDL_Cursor * SDL_CreateCursor (Uint8 *data, Uint8 *mask,
- int w, int h, int hot_x, int hot_y)
-{
- SDL_VideoDevice *video = current_video;
- int savelen;
- int i;
- SDL_Cursor *cursor;
-
- /* Make sure the width is a multiple of 8 */
- w = ((w+7)&~7);
-
- /* Sanity check the hot spot */
- if ( (hot_x < 0) || (hot_y < 0) || (hot_x >= w) || (hot_y >= h) ) {
- SDL_SetError("Cursor hot spot doesn't lie within cursor");
- return(NULL);
- }
-
- /* Allocate memory for the cursor */
- cursor = (SDL_Cursor *)SDL_malloc(sizeof *cursor);
- if ( cursor == NULL ) {
- SDL_OutOfMemory();
- return(NULL);
- }
- savelen = (w*4)*h;
- cursor->area.x = 0;
- cursor->area.y = 0;
- cursor->area.w = w;
- cursor->area.h = h;
- cursor->hot_x = hot_x;
- cursor->hot_y = hot_y;
- cursor->data = (Uint8 *)SDL_malloc((w/8)*h*2);
- cursor->mask = cursor->data+((w/8)*h);
- cursor->save[0] = (Uint8 *)SDL_malloc(savelen*2);
- cursor->save[1] = cursor->save[0] + savelen;
- cursor->wm_cursor = NULL;
- if ( ! cursor->data || ! cursor->save[0] ) {
- SDL_FreeCursor(cursor);
- SDL_OutOfMemory();
- return(NULL);
- }
- for ( i=((w/8)*h)-1; i>=0; --i ) {
- cursor->data[i] = data[i];
- cursor->mask[i] = mask[i] | data[i];
- }
- SDL_memset(cursor->save[0], 0, savelen*2);
-
- /* If the window manager gives us a good cursor, we're done! */
- if ( video->CreateWMCursor ) {
- cursor->wm_cursor = video->CreateWMCursor(video, data, mask,
- w, h, hot_x, hot_y);
- } else {
- cursor->wm_cursor = NULL;
- }
- return(cursor);
-}
-
-/* SDL_SetCursor(NULL) can be used to force the cursor redraw,
- if this is desired for any reason. This is used when setting
- the video mode and when the SDL window gains the mouse focus.
- */
-void SDL_SetCursor (SDL_Cursor *cursor)
-{
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
-
- /* Make sure that the video subsystem has been initialized */
- if ( ! video ) {
- return;
- }
-
- /* Prevent the event thread from moving the mouse */
- SDL_LockCursor();
-
- /* Set the new cursor */
- if ( cursor && (cursor != SDL_cursor) ) {
- /* Erase the current mouse position */
- if ( SHOULD_DRAWCURSOR(SDL_cursorstate) ) {
- SDL_EraseCursor(SDL_VideoSurface);
- } else if ( video->MoveWMCursor ) {
- /* If the video driver is moving the cursor directly,
- it needs to hide the old cursor before (possibly)
- showing the new one. (But don't erase NULL cursor)
- */
- if ( SDL_cursor && video->ShowWMCursor ) {
- video->ShowWMCursor(this, NULL);
- }
- }
- SDL_cursor = cursor;
- }
-
- /* Draw the new mouse cursor */
- if ( SDL_cursor && (SDL_cursorstate&CURSOR_VISIBLE) ) {
- /* Use window manager cursor if possible */
- int show_wm_cursor = 0;
- if ( SDL_cursor->wm_cursor && video->ShowWMCursor ) {
- show_wm_cursor = video->ShowWMCursor(this, SDL_cursor->wm_cursor);
- }
- if ( show_wm_cursor ) {
- SDL_cursorstate &= ~CURSOR_USINGSW;
- } else {
- SDL_cursorstate |= CURSOR_USINGSW;
- if ( video->ShowWMCursor ) {
- video->ShowWMCursor(this, NULL);
- }
- { int x, y;
- SDL_GetMouseState(&x, &y);
- SDL_cursor->area.x = (x - SDL_cursor->hot_x);
- SDL_cursor->area.y = (y - SDL_cursor->hot_y);
- }
- SDL_DrawCursor(SDL_VideoSurface);
- }
- } else {
- /* Erase window manager mouse (cursor not visible) */
- if ( SDL_cursor && (SDL_cursorstate & CURSOR_USINGSW) ) {
- SDL_EraseCursor(SDL_VideoSurface);
- } else {
- if ( video ) {
- if ( video->ShowWMCursor ) {
- video->ShowWMCursor(this, NULL);
- }
- }
- }
- }
- SDL_UnlockCursor();
-}
-
-SDL_Cursor * SDL_GetCursor (void)
-{
- return(SDL_cursor);
-}
-
-void SDL_FreeCursor (SDL_Cursor *cursor)
-{
- if ( cursor ) {
- if ( cursor == SDL_cursor ) {
- SDL_SetCursor(SDL_defcursor);
- }
- if ( cursor != SDL_defcursor ) {
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
-
- if ( cursor->data ) {
- SDL_free(cursor->data);
- }
- if ( cursor->save[0] ) {
- SDL_free(cursor->save[0]);
- }
- if ( video && cursor->wm_cursor ) {
- if ( video->FreeWMCursor ) {
- video->FreeWMCursor(this, cursor->wm_cursor);
- }
- }
- SDL_free(cursor);
- }
- }
-}
-
-int SDL_ShowCursor (int toggle)
-{
- int showing;
-
- showing = (SDL_cursorstate & CURSOR_VISIBLE);
- if ( toggle >= 0 ) {
- SDL_LockCursor();
- if ( toggle ) {
- SDL_cursorstate |= CURSOR_VISIBLE;
- } else {
- SDL_cursorstate &= ~CURSOR_VISIBLE;
- }
- SDL_UnlockCursor();
- if ( (SDL_cursorstate & CURSOR_VISIBLE) != showing ) {
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
-
- SDL_SetCursor(NULL);
- if ( video && video->CheckMouseMode ) {
- video->CheckMouseMode(this);
- }
- }
- } else {
- /* Query current state */ ;
- }
- return(showing ? 1 : 0);
-}
-
-void SDL_WarpMouse (Uint16 x, Uint16 y)
-{
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
-
- if ( !video || !SDL_PublicSurface ) {
- SDL_SetError("A video mode must be set before warping mouse");
- return;
- }
-
- /* If we have an offset video mode, offset the mouse coordinates */
- if (this->screen->pitch == 0) {
- x += this->screen->offset / this->screen->format->BytesPerPixel;
- y += this->screen->offset;
- } else {
- x += (this->screen->offset % this->screen->pitch) /
- this->screen->format->BytesPerPixel;
- y += (this->screen->offset / this->screen->pitch);
- }
-
- /* This generates a mouse motion event */
- if ( video->WarpWMCursor ) {
- video->WarpWMCursor(this, x, y);
- } else {
- SDL_PrivateMouseMotion(0, 0, x, y);
- }
-}
-
-void SDL_MoveCursor(int x, int y)
-{
- SDL_VideoDevice *video = current_video;
-
- /* Erase and update the current mouse position */
- if ( SHOULD_DRAWCURSOR(SDL_cursorstate) ) {
- /* Erase and redraw mouse cursor in new position */
- SDL_LockCursor();
- SDL_EraseCursor(SDL_VideoSurface);
- SDL_cursor->area.x = (x - SDL_cursor->hot_x);
- SDL_cursor->area.y = (y - SDL_cursor->hot_y);
- SDL_DrawCursor(SDL_VideoSurface);
- SDL_UnlockCursor();
- } else if ( video->MoveWMCursor ) {
- video->MoveWMCursor(video, x, y);
- }
-}
-
-/* Keep track of the current cursor colors */
-static int palette_changed = 1;
-static Uint8 pixels8[2];
-
-void SDL_CursorPaletteChanged(void)
-{
- palette_changed = 1;
-}
-
-void SDL_MouseRect(SDL_Rect *area)
-{
- int clip_diff;
-
- *area = SDL_cursor->area;
- if ( area->x < 0 ) {
- area->w += area->x;
- area->x = 0;
- }
- if ( area->y < 0 ) {
- area->h += area->y;
- area->y = 0;
- }
- clip_diff = (area->x+area->w)-SDL_VideoSurface->w;
- if ( clip_diff > 0 ) {
- area->w = area->w < clip_diff ? 0 : area->w-clip_diff;
- }
- clip_diff = (area->y+area->h)-SDL_VideoSurface->h;
- if ( clip_diff > 0 ) {
- area->h = area->h < clip_diff ? 0 : area->h-clip_diff;
- }
-}
-
-static void SDL_DrawCursorFast(SDL_Surface *screen, SDL_Rect *area)
-{
- const Uint32 pixels[2] = { 0xFFFFFFFF, 0x00000000 };
- int i, w, h;
- Uint8 *data, datab;
- Uint8 *mask, maskb;
-
- data = SDL_cursor->data + area->y * SDL_cursor->area.w/8;
- mask = SDL_cursor->mask + area->y * SDL_cursor->area.w/8;
- switch (screen->format->BytesPerPixel) {
-
- case 1: {
- Uint8 *dst;
- int dstskip;
-
- if ( palette_changed ) {
- pixels8[0] = (Uint8)SDL_MapRGB(screen->format, 255, 255, 255);
- pixels8[1] = (Uint8)SDL_MapRGB(screen->format, 0, 0, 0);
- palette_changed = 0;
- }
- dst = (Uint8 *)screen->pixels +
- (SDL_cursor->area.y+area->y)*screen->pitch +
- SDL_cursor->area.x;
- dstskip = screen->pitch-area->w;
-
- for ( h=area->h; h; h-- ) {
- for ( w=area->w/8; w; w-- ) {
- maskb = *mask++;
- datab = *data++;
- for ( i=0; i<8; ++i ) {
- if ( maskb & 0x80 ) {
- *dst = pixels8[datab>>7];
- }
- maskb <<= 1;
- datab <<= 1;
- dst++;
- }
- }
- dst += dstskip;
- }
- }
- break;
-
- case 2: {
- Uint16 *dst;
- int dstskip;
-
- dst = (Uint16 *)screen->pixels +
- (SDL_cursor->area.y+area->y)*screen->pitch/2 +
- SDL_cursor->area.x;
- dstskip = (screen->pitch/2)-area->w;
-
- for ( h=area->h; h; h-- ) {
- for ( w=area->w/8; w; w-- ) {
- maskb = *mask++;
- datab = *data++;
- for ( i=0; i<8; ++i ) {
- if ( maskb & 0x80 ) {
- *dst = (Uint16)pixels[datab>>7];
- }
- maskb <<= 1;
- datab <<= 1;
- dst++;
- }
- }
- dst += dstskip;
- }
- }
- break;
-
- case 3: {
- Uint8 *dst;
- int dstskip;
-
- dst = (Uint8 *)screen->pixels +
- (SDL_cursor->area.y+area->y)*screen->pitch +
- SDL_cursor->area.x*3;
- dstskip = screen->pitch-area->w*3;
-
- for ( h=area->h; h; h-- ) {
- for ( w=area->w/8; w; w-- ) {
- maskb = *mask++;
- datab = *data++;
- for ( i=0; i<8; ++i ) {
- if ( maskb & 0x80 ) {
- SDL_memset(dst,pixels[datab>>7],3);
- }
- maskb <<= 1;
- datab <<= 1;
- dst += 3;
- }
- }
- dst += dstskip;
- }
- }
- break;
-
- case 4: {
- Uint32 *dst;
- int dstskip;
-
- dst = (Uint32 *)screen->pixels +
- (SDL_cursor->area.y+area->y)*screen->pitch/4 +
- SDL_cursor->area.x;
- dstskip = (screen->pitch/4)-area->w;
-
- for ( h=area->h; h; h-- ) {
- for ( w=area->w/8; w; w-- ) {
- maskb = *mask++;
- datab = *data++;
- for ( i=0; i<8; ++i ) {
- if ( maskb & 0x80 ) {
- *dst = pixels[datab>>7];
- }
- maskb <<= 1;
- datab <<= 1;
- dst++;
- }
- }
- dst += dstskip;
- }
- }
- break;
- }
-}
-
-static void SDL_DrawCursorSlow(SDL_Surface *screen, SDL_Rect *area)
-{
- const Uint32 pixels[2] = { 0xFFFFFF, 0x000000 };
- int h;
- int x, minx, maxx;
- Uint8 *data, datab = 0;
- Uint8 *mask, maskb = 0;
- Uint8 *dst;
- int dstbpp, dstskip;
-
- data = SDL_cursor->data + area->y * SDL_cursor->area.w/8;
- mask = SDL_cursor->mask + area->y * SDL_cursor->area.w/8;
- dstbpp = screen->format->BytesPerPixel;
- dst = (Uint8 *)screen->pixels +
- (SDL_cursor->area.y+area->y)*screen->pitch +
- SDL_cursor->area.x*dstbpp;
- dstskip = screen->pitch-SDL_cursor->area.w*dstbpp;
-
- minx = area->x;
- maxx = area->x+area->w;
- if ( screen->format->BytesPerPixel == 1 ) {
- if ( palette_changed ) {
- pixels8[0] = (Uint8)SDL_MapRGB(screen->format, 255, 255, 255);
- pixels8[1] = (Uint8)SDL_MapRGB(screen->format, 0, 0, 0);
- palette_changed = 0;
- }
- for ( h=area->h; h; h-- ) {
- for ( x=0; x<SDL_cursor->area.w; ++x ) {
- if ( (x%8) == 0 ) {
- maskb = *mask++;
- datab = *data++;
- }
- if ( (x >= minx) && (x < maxx) ) {
- if ( maskb & 0x80 ) {
- SDL_memset(dst, pixels8[datab>>7], dstbpp);
- }
- }
- maskb <<= 1;
- datab <<= 1;
- dst += dstbpp;
- }
- dst += dstskip;
- }
- } else {
- for ( h=area->h; h; h-- ) {
- for ( x=0; x<SDL_cursor->area.w; ++x ) {
- if ( (x%8) == 0 ) {
- maskb = *mask++;
- datab = *data++;
- }
- if ( (x >= minx) && (x < maxx) ) {
- if ( maskb & 0x80 ) {
- SDL_memset(dst, pixels[datab>>7], dstbpp);
- }
- }
- maskb <<= 1;
- datab <<= 1;
- dst += dstbpp;
- }
- dst += dstskip;
- }
- }
-}
-
-/* This handles the ugly work of converting the saved cursor background from
- the pixel format of the shadow surface to that of the video surface.
- This is only necessary when blitting from a shadow surface of a different
- pixel format than the video surface, and using a software rendered cursor.
-*/
-static void SDL_ConvertCursorSave(SDL_Surface *screen, int w, int h)
-{
- SDL_BlitInfo info;
- SDL_loblit RunBlit;
-
- /* Make sure we can steal the blit mapping */
- if ( screen->map->dst != SDL_VideoSurface ) {
- return;
- }
-
- /* Set up the blit information */
- info.s_pixels = SDL_cursor->save[1];
- info.s_width = w;
- info.s_height = h;
- info.s_skip = 0;
- info.d_pixels = SDL_cursor->save[0];
- info.d_width = w;
- info.d_height = h;
- info.d_skip = 0;
- info.aux_data = screen->map->sw_data->aux_data;
- info.src = screen->format;
- info.table = screen->map->table;
- info.dst = SDL_VideoSurface->format;
- RunBlit = screen->map->sw_data->blit;
-
- /* Run the actual software blit */
- RunBlit(&info);
-}
-
-void SDL_DrawCursorNoLock(SDL_Surface *screen)
-{
- SDL_Rect area;
-
- /* Get the mouse rectangle, clipped to the screen */
- SDL_MouseRect(&area);
- if ( (area.w == 0) || (area.h == 0) ) {
- return;
- }
-
- /* Copy mouse background */
- { int w, h, screenbpp;
- Uint8 *src, *dst;
-
- /* Set up the copy pointers */
- screenbpp = screen->format->BytesPerPixel;
- if ( (screen == SDL_VideoSurface) ||
- FORMAT_EQUAL(screen->format, SDL_VideoSurface->format) ) {
- dst = SDL_cursor->save[0];
- } else {
- dst = SDL_cursor->save[1];
- }
- src = (Uint8 *)screen->pixels + area.y * screen->pitch +
- area.x * screenbpp;
-
- /* Perform the copy */
- w = area.w*screenbpp;
- h = area.h;
- while ( h-- ) {
- SDL_memcpy(dst, src, w);
- dst += w;
- src += screen->pitch;
- }
- }
-
- /* Draw the mouse cursor */
- area.x -= SDL_cursor->area.x;
- area.y -= SDL_cursor->area.y;
- if ( (area.x == 0) && (area.w == SDL_cursor->area.w) ) {
- SDL_DrawCursorFast(screen, &area);
- } else {
- SDL_DrawCursorSlow(screen, &area);
- }
-}
-
-void SDL_DrawCursor(SDL_Surface *screen)
-{
- /* Lock the screen if necessary */
- if ( screen == NULL ) {
- return;
- }
- if ( SDL_MUSTLOCK(screen) ) {
- if ( SDL_LockSurface(screen) < 0 ) {
- return;
- }
- }
-
- SDL_DrawCursorNoLock(screen);
-
- /* Unlock the screen and update if necessary */
- if ( SDL_MUSTLOCK(screen) ) {
- SDL_UnlockSurface(screen);
- }
- if ( (screen == SDL_VideoSurface) &&
- ((screen->flags & SDL_HWSURFACE) != SDL_HWSURFACE) ) {
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
- SDL_Rect area;
-
- SDL_MouseRect(&area);
-
- /* This can be called before a video mode is set */
- if ( video->UpdateRects ) {
- video->UpdateRects(this, 1, &area);
- }
- }
-}
-
-void SDL_EraseCursorNoLock(SDL_Surface *screen)
-{
- SDL_Rect area;
-
- /* Get the mouse rectangle, clipped to the screen */
- SDL_MouseRect(&area);
- if ( (area.w == 0) || (area.h == 0) ) {
- return;
- }
-
- /* Copy mouse background */
- { int w, h, screenbpp;
- Uint8 *src, *dst;
-
- /* Set up the copy pointers */
- screenbpp = screen->format->BytesPerPixel;
- if ( (screen == SDL_VideoSurface) ||
- FORMAT_EQUAL(screen->format, SDL_VideoSurface->format) ) {
- src = SDL_cursor->save[0];
- } else {
- src = SDL_cursor->save[1];
- }
- dst = (Uint8 *)screen->pixels + area.y * screen->pitch +
- area.x * screenbpp;
-
- /* Perform the copy */
- w = area.w*screenbpp;
- h = area.h;
- while ( h-- ) {
- SDL_memcpy(dst, src, w);
- src += w;
- dst += screen->pitch;
- }
-
- /* Perform pixel conversion on cursor background */
- if ( src > SDL_cursor->save[1] ) {
- SDL_ConvertCursorSave(screen, area.w, area.h);
- }
- }
-}
-
-void SDL_EraseCursor(SDL_Surface *screen)
-{
- /* Lock the screen if necessary */
- if ( screen == NULL ) {
- return;
- }
- if ( SDL_MUSTLOCK(screen) ) {
- if ( SDL_LockSurface(screen) < 0 ) {
- return;
- }
- }
-
- SDL_EraseCursorNoLock(screen);
-
- /* Unlock the screen and update if necessary */
- if ( SDL_MUSTLOCK(screen) ) {
- SDL_UnlockSurface(screen);
- }
- if ( (screen == SDL_VideoSurface) &&
- ((screen->flags & SDL_HWSURFACE) != SDL_HWSURFACE) ) {
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
- SDL_Rect area;
-
- SDL_MouseRect(&area);
- if ( video->UpdateRects ) {
- video->UpdateRects(this, 1, &area);
- }
- }
-}
-
-/* Reset the cursor on video mode change
- FIXME: Keep track of all cursors, and reset them all.
- */
-void SDL_ResetCursor(void)
-{
- int savelen;
-
- if ( SDL_cursor ) {
- savelen = SDL_cursor->area.w*4*SDL_cursor->area.h;
- SDL_cursor->area.x = 0;
- SDL_cursor->area.y = 0;
- SDL_memset(SDL_cursor->save[0], 0, savelen);
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/SDL_cursor_c.h b/distrib/sdl-1.2.12/src/video/SDL_cursor_c.h
deleted file mode 100644
index fc983e2..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_cursor_c.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Useful variables and functions from SDL_cursor.c */
-#include "SDL_mouse.h"
-
-extern int SDL_CursorInit(Uint32 flags);
-extern void SDL_CursorPaletteChanged(void);
-extern void SDL_DrawCursor(SDL_Surface *screen);
-extern void SDL_DrawCursorNoLock(SDL_Surface *screen);
-extern void SDL_EraseCursor(SDL_Surface *screen);
-extern void SDL_EraseCursorNoLock(SDL_Surface *screen);
-extern void SDL_UpdateCursor(SDL_Surface *screen);
-extern void SDL_ResetCursor(void);
-extern void SDL_MoveCursor(int x, int y);
-extern void SDL_CursorQuit(void);
-
-#define INLINE_MOUSELOCK
-#ifdef INLINE_MOUSELOCK
-/* Inline (macro) versions of the mouse lock functions */
-#include "SDL_mutex.h"
-
-extern SDL_mutex *SDL_cursorlock;
-
-#define SDL_LockCursor() \
- do { \
- if ( SDL_cursorlock ) { \
- SDL_mutexP(SDL_cursorlock); \
- } \
- } while ( 0 )
-#define SDL_UnlockCursor() \
- do { \
- if ( SDL_cursorlock ) { \
- SDL_mutexV(SDL_cursorlock); \
- } \
- } while ( 0 )
-#else
-extern void SDL_LockCursor(void);
-extern void SDL_UnlockCursor(void);
-#endif /* INLINE_MOUSELOCK */
-
-/* Only for low-level mouse cursor drawing */
-extern SDL_Cursor *SDL_cursor;
-extern void SDL_MouseRect(SDL_Rect *area);
-
-/* State definitions for the SDL cursor */
-#define CURSOR_VISIBLE 0x01
-#define CURSOR_USINGSW 0x10
-#define SHOULD_DRAWCURSOR(X) \
- (((X)&(CURSOR_VISIBLE|CURSOR_USINGSW)) == \
- (CURSOR_VISIBLE|CURSOR_USINGSW))
-
-extern volatile int SDL_cursorstate;
diff --git a/distrib/sdl-1.2.12/src/video/SDL_gamma.c b/distrib/sdl-1.2.12/src/video/SDL_gamma.c
deleted file mode 100644
index a70a1f5..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_gamma.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Gamma correction support */
-
-#ifdef HAVE_MATH_H
-#include <math.h> /* Used for calculating gamma ramps */
-#else
-/* Math routines from uClibc: http://www.uclibc.org */
-#include "math_private.h"
-#include "e_sqrt.h"
-#include "e_pow.h"
-#include "e_log.h"
-#define pow(x, y) __ieee754_pow(x, y)
-#define log(x) __ieee754_log(x)
-#endif
-
-#include "SDL_sysvideo.h"
-
-
-static void CalculateGammaRamp(float gamma, Uint16 *ramp)
-{
- int i;
-
- /* 0.0 gamma is all black */
- if ( gamma <= 0.0f ) {
- for ( i=0; i<256; ++i ) {
- ramp[i] = 0;
- }
- return;
- } else
- /* 1.0 gamma is identity */
- if ( gamma == 1.0f ) {
- for ( i=0; i<256; ++i ) {
- ramp[i] = (i << 8) | i;
- }
- return;
- } else
- /* Calculate a real gamma ramp */
- { int value;
- gamma = 1.0f / gamma;
- for ( i=0; i<256; ++i ) {
- value = (int)(pow((double)i/256.0, gamma)*65535.0+0.5);
- if ( value > 65535 ) {
- value = 65535;
- }
- ramp[i] = (Uint16)value;
- }
- }
-}
-static void CalculateGammaFromRamp(float *gamma, Uint16 *ramp)
-{
- /* The following is adapted from a post by Garrett Bass on OpenGL
- Gamedev list, March 4, 2000.
- */
- float sum = 0.0f;
- int i, count = 0;
-
- *gamma = 1.0;
- for ( i = 1; i < 256; ++i ) {
- if ( (ramp[i] != 0) && (ramp[i] != 65535) ) {
- double B = (double)i / 256.0;
- double A = ramp[i] / 65535.0;
- sum += (float) ( log(A) / log(B) );
- count++;
- }
- }
- if ( count && sum > 0.0f ) {
- *gamma = 1.0f / (sum / count);
- }
-}
-
-int SDL_SetGamma(float red, float green, float blue)
-{
- int succeeded;
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
-
- succeeded = -1;
- /* Prefer using SetGammaRamp(), as it's more flexible */
- {
- Uint16 ramp[3][256];
-
- CalculateGammaRamp(red, ramp[0]);
- CalculateGammaRamp(green, ramp[1]);
- CalculateGammaRamp(blue, ramp[2]);
- succeeded = SDL_SetGammaRamp(ramp[0], ramp[1], ramp[2]);
- }
- if ( (succeeded < 0) && video->SetGamma ) {
- SDL_ClearError();
- succeeded = video->SetGamma(this, red, green, blue);
- }
- return succeeded;
-}
-
-/* Calculating the gamma by integrating the gamma ramps isn't exact,
- so this function isn't officially supported.
-*/
-int SDL_GetGamma(float *red, float *green, float *blue)
-{
- int succeeded;
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
-
- succeeded = -1;
- /* Prefer using GetGammaRamp(), as it's more flexible */
- {
- Uint16 ramp[3][256];
-
- succeeded = SDL_GetGammaRamp(ramp[0], ramp[1], ramp[2]);
- if ( succeeded >= 0 ) {
- CalculateGammaFromRamp(red, ramp[0]);
- CalculateGammaFromRamp(green, ramp[1]);
- CalculateGammaFromRamp(blue, ramp[2]);
- }
- }
- if ( (succeeded < 0) && video->GetGamma ) {
- SDL_ClearError();
- succeeded = video->GetGamma(this, red, green, blue);
- }
- return succeeded;
-}
-
-int SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue)
-{
- int succeeded;
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
- SDL_Surface *screen = SDL_PublicSurface;
-
- /* Verify the screen parameter */
- if ( !screen ) {
- SDL_SetError("No video mode has been set");
- return -1;
- }
-
- /* Lazily allocate the gamma tables */
- if ( ! video->gamma ) {
- SDL_GetGammaRamp(0, 0, 0);
- }
-
- /* Fill the gamma table with the new values */
- if ( red ) {
- SDL_memcpy(&video->gamma[0*256], red, 256*sizeof(*video->gamma));
- }
- if ( green ) {
- SDL_memcpy(&video->gamma[1*256], green, 256*sizeof(*video->gamma));
- }
- if ( blue ) {
- SDL_memcpy(&video->gamma[2*256], blue, 256*sizeof(*video->gamma));
- }
-
- /* Gamma correction always possible on split palettes */
- if ( (screen->flags & SDL_HWPALETTE) == SDL_HWPALETTE ) {
- SDL_Palette *pal = screen->format->palette;
-
- /* If physical palette has been set independently, use it */
- if(video->physpal)
- pal = video->physpal;
-
- SDL_SetPalette(screen, SDL_PHYSPAL,
- pal->colors, 0, pal->ncolors);
- return 0;
- }
-
- /* Try to set the gamma ramp in the driver */
- succeeded = -1;
- if ( video->SetGammaRamp ) {
- succeeded = video->SetGammaRamp(this, video->gamma);
- } else {
- SDL_SetError("Gamma ramp manipulation not supported");
- }
- return succeeded;
-}
-
-int SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue)
-{
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
-
- /* Lazily allocate the gamma table */
- if ( ! video->gamma ) {
- video->gamma = SDL_malloc(3*256*sizeof(*video->gamma));
- if ( ! video->gamma ) {
- SDL_OutOfMemory();
- return -1;
- }
- if ( video->GetGammaRamp ) {
- /* Get the real hardware gamma */
- video->GetGammaRamp(this, video->gamma);
- } else {
- /* Assume an identity gamma */
- int i;
- for ( i=0; i<256; ++i ) {
- video->gamma[0*256+i] = (i << 8) | i;
- video->gamma[1*256+i] = (i << 8) | i;
- video->gamma[2*256+i] = (i << 8) | i;
- }
- }
- }
-
- /* Just copy from our internal table */
- if ( red ) {
- SDL_memcpy(red, &video->gamma[0*256], 256*sizeof(*red));
- }
- if ( green ) {
- SDL_memcpy(green, &video->gamma[1*256], 256*sizeof(*green));
- }
- if ( blue ) {
- SDL_memcpy(blue, &video->gamma[2*256], 256*sizeof(*blue));
- }
- return 0;
-}
diff --git a/distrib/sdl-1.2.12/src/video/SDL_leaks.h b/distrib/sdl-1.2.12/src/video/SDL_leaks.h
deleted file mode 100644
index 5151646..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_leaks.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Define this if you want surface leak detection code enabled */
-/*#define CHECK_LEAKS*/
-
-/* Global variables used to check leaks in code using SDL */
-
-#ifdef CHECK_LEAKS
-extern int surfaces_allocated;
-#endif
diff --git a/distrib/sdl-1.2.12/src/video/SDL_pixels.c b/distrib/sdl-1.2.12/src/video/SDL_pixels.c
deleted file mode 100644
index 33c16e6..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_pixels.c
+++ /dev/null
@@ -1,625 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* General (mostly internal) pixel/color manipulation routines for SDL */
-
-#include "SDL_endian.h"
-#include "SDL_video.h"
-#include "SDL_sysvideo.h"
-#include "SDL_blit.h"
-#include "SDL_pixels_c.h"
-#include "SDL_RLEaccel_c.h"
-
-/* Helper functions */
-/*
- * Allocate a pixel format structure and fill it according to the given info.
- */
-SDL_PixelFormat *SDL_AllocFormat(int bpp,
- Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
-{
- SDL_PixelFormat *format;
- Uint32 mask;
-
- /* Allocate an empty pixel format structure */
- format = SDL_malloc(sizeof(*format));
- if ( format == NULL ) {
- SDL_OutOfMemory();
- return(NULL);
- }
- SDL_memset(format, 0, sizeof(*format));
- format->alpha = SDL_ALPHA_OPAQUE;
-
- /* Set up the format */
- format->BitsPerPixel = bpp;
- format->BytesPerPixel = (bpp+7)/8;
- if ( Rmask || Bmask || Gmask ) { /* Packed pixels with custom mask */
- format->palette = NULL;
- format->Rshift = 0;
- format->Rloss = 8;
- if ( Rmask ) {
- for ( mask = Rmask; !(mask&0x01); mask >>= 1 )
- ++format->Rshift;
- for ( ; (mask&0x01); mask >>= 1 )
- --format->Rloss;
- }
- format->Gshift = 0;
- format->Gloss = 8;
- if ( Gmask ) {
- for ( mask = Gmask; !(mask&0x01); mask >>= 1 )
- ++format->Gshift;
- for ( ; (mask&0x01); mask >>= 1 )
- --format->Gloss;
- }
- format->Bshift = 0;
- format->Bloss = 8;
- if ( Bmask ) {
- for ( mask = Bmask; !(mask&0x01); mask >>= 1 )
- ++format->Bshift;
- for ( ; (mask&0x01); mask >>= 1 )
- --format->Bloss;
- }
- format->Ashift = 0;
- format->Aloss = 8;
- if ( Amask ) {
- for ( mask = Amask; !(mask&0x01); mask >>= 1 )
- ++format->Ashift;
- for ( ; (mask&0x01); mask >>= 1 )
- --format->Aloss;
- }
- format->Rmask = Rmask;
- format->Gmask = Gmask;
- format->Bmask = Bmask;
- format->Amask = Amask;
- } else if ( bpp > 8 ) { /* Packed pixels with standard mask */
- /* R-G-B */
- if ( bpp > 24 )
- bpp = 24;
- format->Rloss = 8-(bpp/3);
- format->Gloss = 8-(bpp/3)-(bpp%3);
- format->Bloss = 8-(bpp/3);
- format->Rshift = ((bpp/3)+(bpp%3))+(bpp/3);
- format->Gshift = (bpp/3);
- format->Bshift = 0;
- format->Rmask = ((0xFF>>format->Rloss)<<format->Rshift);
- format->Gmask = ((0xFF>>format->Gloss)<<format->Gshift);
- format->Bmask = ((0xFF>>format->Bloss)<<format->Bshift);
- } else {
- /* Palettized formats have no mask info */
- format->Rloss = 8;
- format->Gloss = 8;
- format->Bloss = 8;
- format->Aloss = 8;
- format->Rshift = 0;
- format->Gshift = 0;
- format->Bshift = 0;
- format->Ashift = 0;
- format->Rmask = 0;
- format->Gmask = 0;
- format->Bmask = 0;
- format->Amask = 0;
- }
- if ( bpp <= 8 ) { /* Palettized mode */
- int ncolors = 1<<bpp;
-#ifdef DEBUG_PALETTE
- fprintf(stderr,"bpp=%d ncolors=%d\n",bpp,ncolors);
-#endif
- format->palette = (SDL_Palette *)SDL_malloc(sizeof(SDL_Palette));
- if ( format->palette == NULL ) {
- SDL_FreeFormat(format);
- SDL_OutOfMemory();
- return(NULL);
- }
- (format->palette)->ncolors = ncolors;
- (format->palette)->colors = (SDL_Color *)SDL_malloc(
- (format->palette)->ncolors*sizeof(SDL_Color));
- if ( (format->palette)->colors == NULL ) {
- SDL_FreeFormat(format);
- SDL_OutOfMemory();
- return(NULL);
- }
- if ( Rmask || Bmask || Gmask ) {
- /* create palette according to masks */
- int i;
- int Rm=0,Gm=0,Bm=0;
- int Rw=0,Gw=0,Bw=0;
-#ifdef ENABLE_PALETTE_ALPHA
- int Am=0,Aw=0;
-#endif
- if(Rmask)
- {
- Rw=8-format->Rloss;
- for(i=format->Rloss;i>0;i-=Rw)
- Rm|=1<<i;
- }
-#ifdef DEBUG_PALETTE
- fprintf(stderr,"Rw=%d Rm=0x%02X\n",Rw,Rm);
-#endif
- if(Gmask)
- {
- Gw=8-format->Gloss;
- for(i=format->Gloss;i>0;i-=Gw)
- Gm|=1<<i;
- }
-#ifdef DEBUG_PALETTE
- fprintf(stderr,"Gw=%d Gm=0x%02X\n",Gw,Gm);
-#endif
- if(Bmask)
- {
- Bw=8-format->Bloss;
- for(i=format->Bloss;i>0;i-=Bw)
- Bm|=1<<i;
- }
-#ifdef DEBUG_PALETTE
- fprintf(stderr,"Bw=%d Bm=0x%02X\n",Bw,Bm);
-#endif
-#ifdef ENABLE_PALETTE_ALPHA
- if(Amask)
- {
- Aw=8-format->Aloss;
- for(i=format->Aloss;i>0;i-=Aw)
- Am|=1<<i;
- }
-# ifdef DEBUG_PALETTE
- fprintf(stderr,"Aw=%d Am=0x%02X\n",Aw,Am);
-# endif
-#endif
- for(i=0; i < ncolors; ++i) {
- int r,g,b;
- r=(i&Rmask)>>format->Rshift;
- r=(r<<format->Rloss)|((r*Rm)>>Rw);
- format->palette->colors[i].r=r;
-
- g=(i&Gmask)>>format->Gshift;
- g=(g<<format->Gloss)|((g*Gm)>>Gw);
- format->palette->colors[i].g=g;
-
- b=(i&Bmask)>>format->Bshift;
- b=(b<<format->Bloss)|((b*Bm)>>Bw);
- format->palette->colors[i].b=b;
-
-#ifdef ENABLE_PALETTE_ALPHA
- a=(i&Amask)>>format->Ashift;
- a=(a<<format->Aloss)|((a*Am)>>Aw);
- format->palette->colors[i].unused=a;
-#else
- format->palette->colors[i].unused=0;
-#endif
- }
- } else if ( ncolors == 2 ) {
- /* Create a black and white bitmap palette */
- format->palette->colors[0].r = 0xFF;
- format->palette->colors[0].g = 0xFF;
- format->palette->colors[0].b = 0xFF;
- format->palette->colors[1].r = 0x00;
- format->palette->colors[1].g = 0x00;
- format->palette->colors[1].b = 0x00;
- } else {
- /* Create an empty palette */
- SDL_memset((format->palette)->colors, 0,
- (format->palette)->ncolors*sizeof(SDL_Color));
- }
- }
- return(format);
-}
-SDL_PixelFormat *SDL_ReallocFormat(SDL_Surface *surface, int bpp,
- Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
-{
- if ( surface->format ) {
- SDL_FreeFormat(surface->format);
- SDL_FormatChanged(surface);
- }
- surface->format = SDL_AllocFormat(bpp, Rmask, Gmask, Bmask, Amask);
- return surface->format;
-}
-
-/*
- * Change any previous mappings from/to the new surface format
- */
-void SDL_FormatChanged(SDL_Surface *surface)
-{
- static int format_version = 0;
- ++format_version;
- if ( format_version < 0 ) { /* It wrapped... */
- format_version = 1;
- }
- surface->format_version = format_version;
- SDL_InvalidateMap(surface->map);
-}
-/*
- * Free a previously allocated format structure
- */
-void SDL_FreeFormat(SDL_PixelFormat *format)
-{
- if ( format ) {
- if ( format->palette ) {
- if ( format->palette->colors ) {
- SDL_free(format->palette->colors);
- }
- SDL_free(format->palette);
- }
- SDL_free(format);
- }
-}
-/*
- * Calculate an 8-bit (3 red, 3 green, 2 blue) dithered palette of colors
- */
-void SDL_DitherColors(SDL_Color *colors, int bpp)
-{
- int i;
- if(bpp != 8)
- return; /* only 8bpp supported right now */
-
- for(i = 0; i < 256; i++) {
- int r, g, b;
- /* map each bit field to the full [0, 255] interval,
- so 0 is mapped to (0, 0, 0) and 255 to (255, 255, 255) */
- r = i & 0xe0;
- r |= r >> 3 | r >> 6;
- colors[i].r = r;
- g = (i << 3) & 0xe0;
- g |= g >> 3 | g >> 6;
- colors[i].g = g;
- b = i & 0x3;
- b |= b << 2;
- b |= b << 4;
- colors[i].b = b;
- }
-}
-/*
- * Calculate the pad-aligned scanline width of a surface
- */
-Uint16 SDL_CalculatePitch(SDL_Surface *surface)
-{
- Uint16 pitch;
-
- /* Surface should be 4-byte aligned for speed */
- pitch = surface->w*surface->format->BytesPerPixel;
- switch (surface->format->BitsPerPixel) {
- case 1:
- pitch = (pitch+7)/8;
- break;
- case 4:
- pitch = (pitch+1)/2;
- break;
- default:
- break;
- }
- pitch = (pitch + 3) & ~3; /* 4-byte aligning */
- return(pitch);
-}
-/*
- * Match an RGB value to a particular palette index
- */
-Uint8 SDL_FindColor(SDL_Palette *pal, Uint8 r, Uint8 g, Uint8 b)
-{
- /* Do colorspace distance matching */
- unsigned int smallest;
- unsigned int distance;
- int rd, gd, bd;
- int i;
- Uint8 pixel=0;
-
- smallest = ~0;
- for ( i=0; i<pal->ncolors; ++i ) {
- rd = pal->colors[i].r - r;
- gd = pal->colors[i].g - g;
- bd = pal->colors[i].b - b;
- distance = (rd*rd)+(gd*gd)+(bd*bd);
- if ( distance < smallest ) {
- pixel = i;
- if ( distance == 0 ) { /* Perfect match! */
- break;
- }
- smallest = distance;
- }
- }
- return(pixel);
-}
-
-/* Find the opaque pixel value corresponding to an RGB triple */
-Uint32 SDL_MapRGB
-(const SDL_PixelFormat * const format,
- const Uint8 r, const Uint8 g, const Uint8 b)
-{
- if ( format->palette == NULL ) {
- return (r >> format->Rloss) << format->Rshift
- | (g >> format->Gloss) << format->Gshift
- | (b >> format->Bloss) << format->Bshift
- | format->Amask;
- } else {
- return SDL_FindColor(format->palette, r, g, b);
- }
-}
-
-/* Find the pixel value corresponding to an RGBA quadruple */
-Uint32 SDL_MapRGBA
-(const SDL_PixelFormat * const format,
- const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a)
-{
- if ( format->palette == NULL ) {
- return (r >> format->Rloss) << format->Rshift
- | (g >> format->Gloss) << format->Gshift
- | (b >> format->Bloss) << format->Bshift
- | ((a >> format->Aloss) << format->Ashift & format->Amask);
- } else {
- return SDL_FindColor(format->palette, r, g, b);
- }
-}
-
-void SDL_GetRGBA(Uint32 pixel, SDL_PixelFormat *fmt,
- Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a)
-{
- if ( fmt->palette == NULL ) {
- /*
- * This makes sure that the result is mapped to the
- * interval [0..255], and the maximum value for each
- * component is 255. This is important to make sure
- * that white is indeed reported as (255, 255, 255),
- * and that opaque alpha is 255.
- * This only works for RGB bit fields at least 4 bit
- * wide, which is almost always the case.
- */
- unsigned v;
- v = (pixel & fmt->Rmask) >> fmt->Rshift;
- *r = (v << fmt->Rloss) + (v >> (8 - (fmt->Rloss << 1)));
- v = (pixel & fmt->Gmask) >> fmt->Gshift;
- *g = (v << fmt->Gloss) + (v >> (8 - (fmt->Gloss << 1)));
- v = (pixel & fmt->Bmask) >> fmt->Bshift;
- *b = (v << fmt->Bloss) + (v >> (8 - (fmt->Bloss << 1)));
- if(fmt->Amask) {
- v = (pixel & fmt->Amask) >> fmt->Ashift;
- *a = (v << fmt->Aloss) + (v >> (8 - (fmt->Aloss << 1)));
- } else {
- *a = SDL_ALPHA_OPAQUE;
- }
- } else {
- *r = fmt->palette->colors[pixel].r;
- *g = fmt->palette->colors[pixel].g;
- *b = fmt->palette->colors[pixel].b;
- *a = SDL_ALPHA_OPAQUE;
- }
-}
-
-void SDL_GetRGB(Uint32 pixel, SDL_PixelFormat *fmt, Uint8 *r,Uint8 *g,Uint8 *b)
-{
- if ( fmt->palette == NULL ) {
- /* the note for SDL_GetRGBA above applies here too */
- unsigned v;
- v = (pixel & fmt->Rmask) >> fmt->Rshift;
- *r = (v << fmt->Rloss) + (v >> (8 - (fmt->Rloss << 1)));
- v = (pixel & fmt->Gmask) >> fmt->Gshift;
- *g = (v << fmt->Gloss) + (v >> (8 - (fmt->Gloss << 1)));
- v = (pixel & fmt->Bmask) >> fmt->Bshift;
- *b = (v << fmt->Bloss) + (v >> (8 - (fmt->Bloss << 1)));
- } else {
- *r = fmt->palette->colors[pixel].r;
- *g = fmt->palette->colors[pixel].g;
- *b = fmt->palette->colors[pixel].b;
- }
-}
-
-/* Apply gamma to a set of colors - this is easy. :) */
-void SDL_ApplyGamma(Uint16 *gamma, SDL_Color *colors, SDL_Color *output,
- int ncolors)
-{
- int i;
-
- for ( i=0; i<ncolors; ++i ) {
- output[i].r = gamma[0*256 + colors[i].r] >> 8;
- output[i].g = gamma[1*256 + colors[i].g] >> 8;
- output[i].b = gamma[2*256 + colors[i].b] >> 8;
- }
-}
-
-/* Map from Palette to Palette */
-static Uint8 *Map1to1(SDL_Palette *src, SDL_Palette *dst, int *identical)
-{
- Uint8 *map;
- int i;
-
- if ( identical ) {
- if ( src->ncolors <= dst->ncolors ) {
- /* If an identical palette, no need to map */
- if ( SDL_memcmp(src->colors, dst->colors, src->ncolors*
- sizeof(SDL_Color)) == 0 ) {
- *identical = 1;
- return(NULL);
- }
- }
- *identical = 0;
- }
- map = (Uint8 *)SDL_malloc(src->ncolors);
- if ( map == NULL ) {
- SDL_OutOfMemory();
- return(NULL);
- }
- for ( i=0; i<src->ncolors; ++i ) {
- map[i] = SDL_FindColor(dst,
- src->colors[i].r, src->colors[i].g, src->colors[i].b);
- }
- return(map);
-}
-/* Map from Palette to BitField */
-static Uint8 *Map1toN(SDL_PixelFormat *src, SDL_PixelFormat *dst)
-{
- Uint8 *map;
- int i;
- int bpp;
- unsigned alpha;
- SDL_Palette *pal = src->palette;
-
- bpp = ((dst->BytesPerPixel == 3) ? 4 : dst->BytesPerPixel);
- map = (Uint8 *)SDL_malloc(pal->ncolors*bpp);
- if ( map == NULL ) {
- SDL_OutOfMemory();
- return(NULL);
- }
-
- alpha = dst->Amask ? src->alpha : 0;
- /* We memory copy to the pixel map so the endianness is preserved */
- for ( i=0; i<pal->ncolors; ++i ) {
- ASSEMBLE_RGBA(&map[i*bpp], dst->BytesPerPixel, dst,
- pal->colors[i].r, pal->colors[i].g,
- pal->colors[i].b, alpha);
- }
- return(map);
-}
-/* Map from BitField to Dithered-Palette to Palette */
-static Uint8 *MapNto1(SDL_PixelFormat *src, SDL_PixelFormat *dst, int *identical)
-{
- /* Generate a 256 color dither palette */
- SDL_Palette dithered;
- SDL_Color colors[256];
- SDL_Palette *pal = dst->palette;
-
- /* SDL_DitherColors does not initialize the 'unused' component of colors,
- but Map1to1 compares it against pal, so we should initialize it. */
- SDL_memset(colors, 0, sizeof(colors));
-
- dithered.ncolors = 256;
- SDL_DitherColors(colors, 8);
- dithered.colors = colors;
- return(Map1to1(&dithered, pal, identical));
-}
-
-SDL_BlitMap *SDL_AllocBlitMap(void)
-{
- SDL_BlitMap *map;
-
- /* Allocate the empty map */
- map = (SDL_BlitMap *)SDL_malloc(sizeof(*map));
- if ( map == NULL ) {
- SDL_OutOfMemory();
- return(NULL);
- }
- SDL_memset(map, 0, sizeof(*map));
-
- /* Allocate the software blit data */
- map->sw_data = (struct private_swaccel *)SDL_malloc(sizeof(*map->sw_data));
- if ( map->sw_data == NULL ) {
- SDL_FreeBlitMap(map);
- SDL_OutOfMemory();
- return(NULL);
- }
- SDL_memset(map->sw_data, 0, sizeof(*map->sw_data));
-
- /* It's ready to go */
- return(map);
-}
-void SDL_InvalidateMap(SDL_BlitMap *map)
-{
- if ( ! map ) {
- return;
- }
- map->dst = NULL;
- map->format_version = (unsigned int)-1;
- if ( map->table ) {
- SDL_free(map->table);
- map->table = NULL;
- }
-}
-int SDL_MapSurface (SDL_Surface *src, SDL_Surface *dst)
-{
- SDL_PixelFormat *srcfmt;
- SDL_PixelFormat *dstfmt;
- SDL_BlitMap *map;
-
- /* Clear out any previous mapping */
- map = src->map;
- if ( (src->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) {
- SDL_UnRLESurface(src, 1);
- }
- SDL_InvalidateMap(map);
-
- /* Figure out what kind of mapping we're doing */
- map->identity = 0;
- srcfmt = src->format;
- dstfmt = dst->format;
- switch (srcfmt->BytesPerPixel) {
- case 1:
- switch (dstfmt->BytesPerPixel) {
- case 1:
- /* Palette --> Palette */
- /* If both SDL_HWSURFACE, assume have same palette */
- if ( ((src->flags & SDL_HWSURFACE) == SDL_HWSURFACE) &&
- ((dst->flags & SDL_HWSURFACE) == SDL_HWSURFACE) ) {
- map->identity = 1;
- } else {
- map->table = Map1to1(srcfmt->palette,
- dstfmt->palette, &map->identity);
- }
- if ( ! map->identity ) {
- if ( map->table == NULL ) {
- return(-1);
- }
- }
- if (srcfmt->BitsPerPixel!=dstfmt->BitsPerPixel)
- map->identity = 0;
- break;
-
- default:
- /* Palette --> BitField */
- map->table = Map1toN(srcfmt, dstfmt);
- if ( map->table == NULL ) {
- return(-1);
- }
- break;
- }
- break;
- default:
- switch (dstfmt->BytesPerPixel) {
- case 1:
- /* BitField --> Palette */
- map->table = MapNto1(srcfmt, dstfmt, &map->identity);
- if ( ! map->identity ) {
- if ( map->table == NULL ) {
- return(-1);
- }
- }
- map->identity = 0; /* Don't optimize to copy */
- break;
- default:
- /* BitField --> BitField */
- if ( FORMAT_EQUAL(srcfmt, dstfmt) )
- map->identity = 1;
- break;
- }
- break;
- }
-
- map->dst = dst;
- map->format_version = dst->format_version;
-
- /* Choose your blitters wisely */
- return(SDL_CalculateBlit(src));
-}
-void SDL_FreeBlitMap(SDL_BlitMap *map)
-{
- if ( map ) {
- SDL_InvalidateMap(map);
- if ( map->sw_data != NULL ) {
- SDL_free(map->sw_data);
- }
- SDL_free(map);
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/SDL_pixels_c.h b/distrib/sdl-1.2.12/src/video/SDL_pixels_c.h
deleted file mode 100644
index 6ab56b1..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_pixels_c.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Useful functions and variables from SDL_pixel.c */
-
-#include "SDL_blit.h"
-
-/* Pixel format functions */
-extern SDL_PixelFormat *SDL_AllocFormat(int bpp,
- Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
-extern SDL_PixelFormat *SDL_ReallocFormat(SDL_Surface *surface, int bpp,
- Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
-extern void SDL_FormatChanged(SDL_Surface *surface);
-extern void SDL_FreeFormat(SDL_PixelFormat *format);
-
-/* Blit mapping functions */
-extern SDL_BlitMap *SDL_AllocBlitMap(void);
-extern void SDL_InvalidateMap(SDL_BlitMap *map);
-extern int SDL_MapSurface (SDL_Surface *src, SDL_Surface *dst);
-extern void SDL_FreeBlitMap(SDL_BlitMap *map);
-
-/* Miscellaneous functions */
-extern Uint16 SDL_CalculatePitch(SDL_Surface *surface);
-extern void SDL_DitherColors(SDL_Color *colors, int bpp);
-extern Uint8 SDL_FindColor(SDL_Palette *pal, Uint8 r, Uint8 g, Uint8 b);
-extern void SDL_ApplyGamma(Uint16 *gamma, SDL_Color *colors, SDL_Color *output, int ncolors);
diff --git a/distrib/sdl-1.2.12/src/video/SDL_stretch.c b/distrib/sdl-1.2.12/src/video/SDL_stretch.c
deleted file mode 100644
index 2e08c10..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_stretch.c
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This a stretch blit implementation based on ideas given to me by
- Tomasz Cejner - thanks! :)
-
- April 27, 2000 - Sam Lantinga
-*/
-
-#include "SDL_video.h"
-#include "SDL_blit.h"
-
-/* This isn't ready for general consumption yet - it should be folded
- into the general blitting mechanism.
-*/
-
-#if ((defined(_MFC_VER) && defined(_M_IX86)/* && !defined(_WIN32_WCE) still needed? */) || \
- defined(__WATCOMC__) || \
- (defined(__GNUC__) && defined(__i386__))) && SDL_ASSEMBLY_ROUTINES
-#define USE_ASM_STRETCH
-#endif
-
-#ifdef USE_ASM_STRETCH
-
-#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
-#else
-#error Need assembly opcodes for this architecture
-#endif
-
-static unsigned char copy_row[4096];
-
-static int generate_rowbytes(int src_w, int dst_w, int bpp)
-{
- static struct {
- int bpp;
- int src_w;
- int dst_w;
- } last;
-
- int i;
- int pos, inc;
- unsigned char *eip;
- unsigned char load, store;
-
- /* See if we need to regenerate the copy buffer */
- if ( (src_w == last.src_w) &&
- (dst_w == last.dst_w) && (bpp == last.bpp) ) {
- return(0);
- }
- last.bpp = bpp;
- last.src_w = src_w;
- last.dst_w = dst_w;
-
- switch (bpp) {
- case 1:
- load = LOAD_BYTE;
- store = STORE_BYTE;
- break;
- case 2:
- case 4:
- load = LOAD_WORD;
- store = STORE_WORD;
- break;
- default:
- SDL_SetError("ASM stretch of %d bytes isn't supported\n", bpp);
- return(-1);
- }
- pos = 0x10000;
- inc = (src_w << 16) / dst_w;
- eip = copy_row;
- for ( i=0; i<dst_w; ++i ) {
- while ( pos >= 0x10000L ) {
- if ( bpp == 2 ) {
- *eip++ = PREFIX16;
- }
- *eip++ = load;
- pos -= 0x10000L;
- }
- if ( bpp == 2 ) {
- *eip++ = PREFIX16;
- }
- *eip++ = store;
- pos += inc;
- }
- *eip++ = RETURN;
-
- /* Verify that we didn't overflow (too late) */
- if ( eip > (copy_row+sizeof(copy_row)) ) {
- SDL_SetError("Copy buffer overflow");
- return(-1);
- }
- return(0);
-}
-
-#else
-
-#define DEFINE_COPY_ROW(name, type) \
-void name(type *src, int src_w, type *dst, int dst_w) \
-{ \
- int i; \
- int pos, inc; \
- type pixel = 0; \
- \
- pos = 0x10000; \
- inc = (src_w << 16) / dst_w; \
- for ( i=dst_w; i>0; --i ) { \
- while ( pos >= 0x10000L ) { \
- pixel = *src++; \
- pos -= 0x10000L; \
- } \
- *dst++ = pixel; \
- pos += inc; \
- } \
-}
-DEFINE_COPY_ROW(copy_row1, Uint8)
-DEFINE_COPY_ROW(copy_row2, Uint16)
-DEFINE_COPY_ROW(copy_row4, Uint32)
-
-#endif /* USE_ASM_STRETCH */
-
-/* The ASM code doesn't handle 24-bpp stretch blits */
-void copy_row3(Uint8 *src, int src_w, Uint8 *dst, int dst_w)
-{
- int i;
- int pos, inc;
- Uint8 pixel[3] = { 0, 0, 0 };
-
- pos = 0x10000;
- inc = (src_w << 16) / dst_w;
- for ( i=dst_w; i>0; --i ) {
- while ( pos >= 0x10000L ) {
- pixel[0] = *src++;
- pixel[1] = *src++;
- pixel[2] = *src++;
- pos -= 0x10000L;
- }
- *dst++ = pixel[0];
- *dst++ = pixel[1];
- *dst++ = pixel[2];
- pos += inc;
- }
-}
-
-/* Perform a stretch blit between two surfaces of the same format.
- NOTE: This function is not safe to call from multiple threads!
-*/
-int SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect)
-{
- int src_locked;
- int dst_locked;
- int pos, inc;
- int dst_width;
- int dst_maxrow;
- int src_row, dst_row;
- Uint8 *srcp = NULL;
- Uint8 *dstp;
- SDL_Rect full_src;
- SDL_Rect full_dst;
-#if defined(USE_ASM_STRETCH) && defined(__GNUC__)
- int u1, u2;
-#endif
- const int bpp = dst->format->BytesPerPixel;
-
- if ( src->format->BitsPerPixel != dst->format->BitsPerPixel ) {
- SDL_SetError("Only works with same format surfaces");
- return(-1);
- }
-
- /* Verify the blit rectangles */
- if ( srcrect ) {
- if ( (srcrect->x < 0) || (srcrect->y < 0) ||
- ((srcrect->x+srcrect->w) > src->w) ||
- ((srcrect->y+srcrect->h) > src->h) ) {
- SDL_SetError("Invalid source blit rectangle");
- return(-1);
- }
- } else {
- full_src.x = 0;
- full_src.y = 0;
- full_src.w = src->w;
- full_src.h = src->h;
- srcrect = &full_src;
- }
- if ( dstrect ) {
- if ( (dstrect->x < 0) || (dstrect->y < 0) ||
- ((dstrect->x+dstrect->w) > dst->w) ||
- ((dstrect->y+dstrect->h) > dst->h) ) {
- SDL_SetError("Invalid destination blit rectangle");
- return(-1);
- }
- } else {
- full_dst.x = 0;
- full_dst.y = 0;
- full_dst.w = dst->w;
- full_dst.h = dst->h;
- dstrect = &full_dst;
- }
-
- /* Lock the destination if it's in hardware */
- dst_locked = 0;
- if ( SDL_MUSTLOCK(dst) ) {
- if ( SDL_LockSurface(dst) < 0 ) {
- SDL_SetError("Unable to lock destination surface");
- return(-1);
- }
- dst_locked = 1;
- }
- /* Lock the source if it's in hardware */
- src_locked = 0;
- if ( SDL_MUSTLOCK(src) ) {
- if ( SDL_LockSurface(src) < 0 ) {
- if ( dst_locked ) {
- SDL_UnlockSurface(dst);
- }
- SDL_SetError("Unable to lock source surface");
- return(-1);
- }
- src_locked = 1;
- }
-
- /* Set up the data... */
- pos = 0x10000;
- inc = (srcrect->h << 16) / dstrect->h;
- src_row = srcrect->y;
- dst_row = dstrect->y;
- dst_width = dstrect->w*bpp;
-
-#ifdef USE_ASM_STRETCH
- /* Write the opcodes for this stretch */
- if ( (bpp != 3) &&
- (generate_rowbytes(srcrect->w, dstrect->w, bpp) < 0) ) {
- return(-1);
- }
-#endif
-
- /* Perform the stretch blit */
- for ( dst_maxrow = dst_row+dstrect->h; dst_row<dst_maxrow; ++dst_row ) {
- dstp = (Uint8 *)dst->pixels + (dst_row*dst->pitch)
- + (dstrect->x*bpp);
- while ( pos >= 0x10000L ) {
- srcp = (Uint8 *)src->pixels + (src_row*src->pitch)
- + (srcrect->x*bpp);
- ++src_row;
- pos -= 0x10000L;
- }
-#ifdef USE_ASM_STRETCH
- switch (bpp) {
- case 3:
- copy_row3(srcp, srcrect->w, dstp, dstrect->w);
- break;
- default:
-#ifdef __GNUC__
- __asm__ __volatile__ (
- "call *%4"
- : "=&D" (u1), "=&S" (u2)
- : "0" (dstp), "1" (srcp), "r" (copy_row)
- : "memory" );
-#elif defined(_MSC_VER) || defined(__WATCOMC__)
- { void *code = copy_row;
- __asm {
- push edi
- push esi
-
- mov edi, dstp
- mov esi, srcp
- call dword ptr code
-
- pop esi
- pop edi
- }
- }
-#else
-#error Need inline assembly for this compiler
-#endif
- break;
- }
-#else
- switch (bpp) {
- case 1:
- copy_row1(srcp, srcrect->w, dstp, dstrect->w);
- break;
- case 2:
- copy_row2((Uint16 *)srcp, srcrect->w,
- (Uint16 *)dstp, dstrect->w);
- break;
- case 3:
- copy_row3(srcp, srcrect->w, dstp, dstrect->w);
- break;
- case 4:
- copy_row4((Uint32 *)srcp, srcrect->w,
- (Uint32 *)dstp, dstrect->w);
- break;
- }
-#endif
- pos += inc;
- }
-
- /* We need to unlock the surfaces if they're locked */
- if ( dst_locked ) {
- SDL_UnlockSurface(dst);
- }
- if ( src_locked ) {
- SDL_UnlockSurface(src);
- }
- return(0);
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/SDL_stretch_c.h b/distrib/sdl-1.2.12/src/video/SDL_stretch_c.h
deleted file mode 100644
index ee06b26..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_stretch_c.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Perform a stretch blit between two surfaces of the same format.
- NOTE: This function is not safe to call from multiple threads!
-*/
-extern int SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect);
-
diff --git a/distrib/sdl-1.2.12/src/video/SDL_surface.c b/distrib/sdl-1.2.12/src/video/SDL_surface.c
deleted file mode 100644
index 7ef8565..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_surface.c
+++ /dev/null
@@ -1,941 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-#include "SDL_sysvideo.h"
-#include "SDL_cursor_c.h"
-#include "SDL_blit.h"
-#include "SDL_RLEaccel_c.h"
-#include "SDL_pixels_c.h"
-#include "SDL_leaks.h"
-
-
-/* Public routines */
-/*
- * Create an empty RGB surface of the appropriate depth
- */
-SDL_Surface * SDL_CreateRGBSurface (Uint32 flags,
- int width, int height, int depth,
- Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
-{
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
- SDL_Surface *screen;
- SDL_Surface *surface;
-
- /* Make sure the size requested doesn't overflow our datatypes */
- /* Next time I write a library like SDL, I'll use int for size. :) */
- if ( width >= 16384 || height >= 65536 ) {
- SDL_SetError("Width or height is too large");
- return(NULL);
- }
-
- /* Check to see if we desire the surface in video memory */
- if ( video ) {
- screen = SDL_PublicSurface;
- } else {
- screen = NULL;
- }
- if ( screen && ((screen->flags&SDL_HWSURFACE) == SDL_HWSURFACE) ) {
- if ( (flags&(SDL_SRCCOLORKEY|SDL_SRCALPHA)) != 0 ) {
- flags |= SDL_HWSURFACE;
- }
- if ( (flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
- if ( ! current_video->info.blit_hw_CC ) {
- flags &= ~SDL_HWSURFACE;
- }
- }
- if ( (flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
- if ( ! current_video->info.blit_hw_A ) {
- flags &= ~SDL_HWSURFACE;
- }
- }
- } else {
- flags &= ~SDL_HWSURFACE;
- }
-
- /* Allocate the surface */
- surface = (SDL_Surface *)SDL_malloc(sizeof(*surface));
- if ( surface == NULL ) {
- SDL_OutOfMemory();
- return(NULL);
- }
- surface->flags = SDL_SWSURFACE;
- if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
- if ((Amask) && (video->displayformatalphapixel))
- {
- depth = video->displayformatalphapixel->BitsPerPixel;
- Rmask = video->displayformatalphapixel->Rmask;
- Gmask = video->displayformatalphapixel->Gmask;
- Bmask = video->displayformatalphapixel->Bmask;
- Amask = video->displayformatalphapixel->Amask;
- }
- else
- {
- depth = screen->format->BitsPerPixel;
- Rmask = screen->format->Rmask;
- Gmask = screen->format->Gmask;
- Bmask = screen->format->Bmask;
- Amask = screen->format->Amask;
- }
- }
- surface->format = SDL_AllocFormat(depth, Rmask, Gmask, Bmask, Amask);
- if ( surface->format == NULL ) {
- SDL_free(surface);
- return(NULL);
- }
- if ( Amask ) {
- surface->flags |= SDL_SRCALPHA;
- }
- surface->w = width;
- surface->h = height;
- surface->pitch = SDL_CalculatePitch(surface);
- surface->pixels = NULL;
- surface->offset = 0;
- surface->hwdata = NULL;
- surface->locked = 0;
- surface->map = NULL;
- surface->unused1 = 0;
- SDL_SetClipRect(surface, NULL);
- SDL_FormatChanged(surface);
-
- /* Get the pixels */
- if ( ((flags&SDL_HWSURFACE) == SDL_SWSURFACE) ||
- (video->AllocHWSurface(this, surface) < 0) ) {
- if ( surface->w && surface->h ) {
- surface->pixels = SDL_malloc(surface->h*surface->pitch);
- if ( surface->pixels == NULL ) {
- SDL_FreeSurface(surface);
- SDL_OutOfMemory();
- return(NULL);
- }
- /* This is important for bitmaps */
- SDL_memset(surface->pixels, 0, surface->h*surface->pitch);
- }
- }
-
- /* Allocate an empty mapping */
- surface->map = SDL_AllocBlitMap();
- if ( surface->map == NULL ) {
- SDL_FreeSurface(surface);
- return(NULL);
- }
-
- /* The surface is ready to go */
- surface->refcount = 1;
-#ifdef CHECK_LEAKS
- ++surfaces_allocated;
-#endif
- return(surface);
-}
-/*
- * Create an RGB surface from an existing memory buffer
- */
-SDL_Surface * SDL_CreateRGBSurfaceFrom (void *pixels,
- int width, int height, int depth, int pitch,
- Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
-{
- SDL_Surface *surface;
-
- surface = SDL_CreateRGBSurface(SDL_SWSURFACE, 0, 0, depth,
- Rmask, Gmask, Bmask, Amask);
- if ( surface != NULL ) {
- surface->flags |= SDL_PREALLOC;
- surface->pixels = pixels;
- surface->w = width;
- surface->h = height;
- surface->pitch = pitch;
- SDL_SetClipRect(surface, NULL);
- }
- return(surface);
-}
-/*
- * Set the color key in a blittable surface
- */
-int SDL_SetColorKey (SDL_Surface *surface, Uint32 flag, Uint32 key)
-{
- /* Sanity check the flag as it gets passed in */
- if ( flag & SDL_SRCCOLORKEY ) {
- if ( flag & (SDL_RLEACCEL|SDL_RLEACCELOK) ) {
- flag = (SDL_SRCCOLORKEY | SDL_RLEACCELOK);
- } else {
- flag = SDL_SRCCOLORKEY;
- }
- } else {
- flag = 0;
- }
-
- /* Optimize away operations that don't change anything */
- if ( (flag == (surface->flags & (SDL_SRCCOLORKEY|SDL_RLEACCELOK))) &&
- (key == surface->format->colorkey) ) {
- return(0);
- }
-
- /* UnRLE surfaces before we change the colorkey */
- if ( surface->flags & SDL_RLEACCEL ) {
- SDL_UnRLESurface(surface, 1);
- }
-
- if ( flag ) {
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
-
-
- surface->flags |= SDL_SRCCOLORKEY;
- surface->format->colorkey = key;
- if ( (surface->flags & SDL_HWACCEL) == SDL_HWACCEL ) {
- if ( (video->SetHWColorKey == NULL) ||
- (video->SetHWColorKey(this, surface, key) < 0) ) {
- surface->flags &= ~SDL_HWACCEL;
- }
- }
- if ( flag & SDL_RLEACCELOK ) {
- surface->flags |= SDL_RLEACCELOK;
- } else {
- surface->flags &= ~SDL_RLEACCELOK;
- }
- } else {
- surface->flags &= ~(SDL_SRCCOLORKEY|SDL_RLEACCELOK);
- surface->format->colorkey = 0;
- }
- SDL_InvalidateMap(surface->map);
- return(0);
-}
-/* This function sets the alpha channel of a surface */
-int SDL_SetAlpha (SDL_Surface *surface, Uint32 flag, Uint8 value)
-{
- Uint32 oldflags = surface->flags;
- Uint32 oldalpha = surface->format->alpha;
-
- /* Sanity check the flag as it gets passed in */
- if ( flag & SDL_SRCALPHA ) {
- if ( flag & (SDL_RLEACCEL|SDL_RLEACCELOK) ) {
- flag = (SDL_SRCALPHA | SDL_RLEACCELOK);
- } else {
- flag = SDL_SRCALPHA;
- }
- } else {
- flag = 0;
- }
-
- /* Optimize away operations that don't change anything */
- if ( (flag == (surface->flags & (SDL_SRCALPHA|SDL_RLEACCELOK))) &&
- (!flag || value == oldalpha) ) {
- return(0);
- }
-
- if(!(flag & SDL_RLEACCELOK) && (surface->flags & SDL_RLEACCEL))
- SDL_UnRLESurface(surface, 1);
-
- if ( flag ) {
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
-
- surface->flags |= SDL_SRCALPHA;
- surface->format->alpha = value;
- if ( (surface->flags & SDL_HWACCEL) == SDL_HWACCEL ) {
- if ( (video->SetHWAlpha == NULL) ||
- (video->SetHWAlpha(this, surface, value) < 0) ) {
- surface->flags &= ~SDL_HWACCEL;
- }
- }
- if ( flag & SDL_RLEACCELOK ) {
- surface->flags |= SDL_RLEACCELOK;
- } else {
- surface->flags &= ~SDL_RLEACCELOK;
- }
- } else {
- surface->flags &= ~SDL_SRCALPHA;
- surface->format->alpha = SDL_ALPHA_OPAQUE;
- }
- /*
- * The representation for software surfaces is independent of
- * per-surface alpha, so no need to invalidate the blit mapping
- * if just the alpha value was changed. (If either is 255, we still
- * need to invalidate.)
- */
- if((surface->flags & SDL_HWACCEL) == SDL_HWACCEL
- || oldflags != surface->flags
- || (((oldalpha + 1) ^ (value + 1)) & 0x100))
- SDL_InvalidateMap(surface->map);
- return(0);
-}
-int SDL_SetAlphaChannel(SDL_Surface *surface, Uint8 value)
-{
- int row, col;
- int offset;
- Uint8 *buf;
-
- if ( (surface->format->Amask != 0xFF000000) &&
- (surface->format->Amask != 0x000000FF) ) {
- SDL_SetError("Unsupported surface alpha mask format");
- return -1;
- }
-
-#if SDL_BYTEORDER == SDL_LIL_ENDIAN
- if ( surface->format->Amask == 0xFF000000 ) {
- offset = 3;
- } else {
- offset = 0;
- }
-#else
- if ( surface->format->Amask == 0xFF000000 ) {
- offset = 0;
- } else {
- offset = 3;
- }
-#endif /* Byte ordering */
-
- /* Quickly set the alpha channel of an RGBA or ARGB surface */
- if ( SDL_MUSTLOCK(surface) ) {
- if ( SDL_LockSurface(surface) < 0 ) {
- return -1;
- }
- }
- row = surface->h;
- while (row--) {
- col = surface->w;
- buf = (Uint8 *)surface->pixels + row * surface->pitch + offset;
- while(col--) {
- *buf = value;
- buf += 4;
- }
- }
- if ( SDL_MUSTLOCK(surface) ) {
- SDL_UnlockSurface(surface);
- }
- return 0;
-}
-
-/*
- * A function to calculate the intersection of two rectangles:
- * return true if the rectangles intersect, false otherwise
- */
-static __inline__
-SDL_bool SDL_IntersectRect(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *intersection)
-{
- int Amin, Amax, Bmin, Bmax;
-
- /* Horizontal intersection */
- Amin = A->x;
- Amax = Amin + A->w;
- Bmin = B->x;
- Bmax = Bmin + B->w;
- if(Bmin > Amin)
- Amin = Bmin;
- intersection->x = Amin;
- if(Bmax < Amax)
- Amax = Bmax;
- intersection->w = Amax - Amin > 0 ? Amax - Amin : 0;
-
- /* Vertical intersection */
- Amin = A->y;
- Amax = Amin + A->h;
- Bmin = B->y;
- Bmax = Bmin + B->h;
- if(Bmin > Amin)
- Amin = Bmin;
- intersection->y = Amin;
- if(Bmax < Amax)
- Amax = Bmax;
- intersection->h = Amax - Amin > 0 ? Amax - Amin : 0;
-
- return (intersection->w && intersection->h);
-}
-/*
- * Set the clipping rectangle for a blittable surface
- */
-SDL_bool SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect)
-{
- SDL_Rect full_rect;
-
- /* Don't do anything if there's no surface to act on */
- if ( ! surface ) {
- return SDL_FALSE;
- }
-
- /* Set up the full surface rectangle */
- full_rect.x = 0;
- full_rect.y = 0;
- full_rect.w = surface->w;
- full_rect.h = surface->h;
-
- /* Set the clipping rectangle */
- if ( ! rect ) {
- surface->clip_rect = full_rect;
- return 1;
- }
- return SDL_IntersectRect(rect, &full_rect, &surface->clip_rect);
-}
-void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect)
-{
- if ( surface && rect ) {
- *rect = surface->clip_rect;
- }
-}
-/*
- * Set up a blit between two surfaces -- split into three parts:
- * The upper part, SDL_UpperBlit(), performs clipping and rectangle
- * 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
- * library in the optimimum places. They are exported so that if
- * you know exactly what you are doing, you can optimize your code
- * by calling the one(s) you need.
- */
-int SDL_LowerBlit (SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect)
-{
- SDL_blit do_blit;
- SDL_Rect hw_srcrect;
- SDL_Rect hw_dstrect;
-
- /* Check to make sure the blit mapping is valid */
- if ( (src->map->dst != dst) ||
- (src->map->dst->format_version != src->map->format_version) ) {
- if ( SDL_MapSurface(src, dst) < 0 ) {
- return(-1);
- }
- }
-
- /* Figure out which blitter to use */
- if ( (src->flags & SDL_HWACCEL) == SDL_HWACCEL ) {
- if ( src == SDL_VideoSurface ) {
- hw_srcrect = *srcrect;
- hw_srcrect.x += current_video->offset_x;
- hw_srcrect.y += current_video->offset_y;
- srcrect = &hw_srcrect;
- }
- if ( dst == SDL_VideoSurface ) {
- hw_dstrect = *dstrect;
- hw_dstrect.x += current_video->offset_x;
- hw_dstrect.y += current_video->offset_y;
- dstrect = &hw_dstrect;
- }
- do_blit = src->map->hw_blit;
- } else {
- do_blit = src->map->sw_blit;
- }
- return(do_blit(src, srcrect, dst, dstrect));
-}
-
-
-int SDL_UpperBlit (SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect)
-{
- SDL_Rect fulldst;
- int srcx, srcy, w, h;
-
- /* Make sure the surfaces aren't locked */
- if ( ! src || ! dst ) {
- SDL_SetError("SDL_UpperBlit: passed a NULL surface");
- return(-1);
- }
- if ( src->locked || dst->locked ) {
- SDL_SetError("Surfaces must not be locked during blit");
- return(-1);
- }
-
- /* If the destination rectangle is NULL, use the entire dest surface */
- if ( dstrect == NULL ) {
- fulldst.x = fulldst.y = 0;
- dstrect = &fulldst;
- }
-
- /* clip the source rectangle to the source surface */
- if(srcrect) {
- int maxw, maxh;
-
- srcx = srcrect->x;
- w = srcrect->w;
- if(srcx < 0) {
- w += srcx;
- dstrect->x -= srcx;
- srcx = 0;
- }
- maxw = src->w - srcx;
- if(maxw < w)
- w = maxw;
-
- srcy = srcrect->y;
- h = srcrect->h;
- if(srcy < 0) {
- h += srcy;
- dstrect->y -= srcy;
- srcy = 0;
- }
- maxh = src->h - srcy;
- if(maxh < h)
- h = maxh;
-
- } else {
- srcx = srcy = 0;
- w = src->w;
- h = src->h;
- }
-
- /* clip the destination rectangle against the clip rectangle */
- {
- SDL_Rect *clip = &dst->clip_rect;
- int dx, dy;
-
- dx = clip->x - dstrect->x;
- if(dx > 0) {
- w -= dx;
- dstrect->x += dx;
- srcx += dx;
- }
- dx = dstrect->x + w - clip->x - clip->w;
- if(dx > 0)
- w -= dx;
-
- dy = clip->y - dstrect->y;
- if(dy > 0) {
- h -= dy;
- dstrect->y += dy;
- srcy += dy;
- }
- dy = dstrect->y + h - clip->y - clip->h;
- if(dy > 0)
- h -= dy;
- }
-
- if(w > 0 && h > 0) {
- SDL_Rect sr;
- sr.x = srcx;
- sr.y = srcy;
- sr.w = dstrect->w = w;
- sr.h = dstrect->h = h;
- return SDL_LowerBlit(src, &sr, dst, dstrect);
- }
- dstrect->w = dstrect->h = 0;
- return 0;
-}
-
-static int SDL_FillRect1(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color)
-{
- /* FIXME: We have to worry about packing order.. *sigh* */
- SDL_SetError("1-bpp rect fill not yet implemented");
- return -1;
-}
-
-static int SDL_FillRect4(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color)
-{
- /* FIXME: We have to worry about packing order.. *sigh* */
- SDL_SetError("4-bpp rect fill not yet implemented");
- return -1;
-}
-
-/*
- * This function performs a fast fill of the given rectangle with 'color'
- */
-int SDL_FillRect(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color)
-{
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
- int x, y;
- Uint8 *row;
-
- /* This function doesn't work on surfaces < 8 bpp */
- if ( dst->format->BitsPerPixel < 8 ) {
- switch(dst->format->BitsPerPixel) {
- case 1:
- return SDL_FillRect1(dst, dstrect, color);
- break;
- case 4:
- return SDL_FillRect4(dst, dstrect, color);
- break;
- default:
- SDL_SetError("Fill rect on unsupported surface format");
- return(-1);
- break;
- }
- }
-
- /* If 'dstrect' == NULL, then fill the whole surface */
- if ( dstrect ) {
- /* Perform clipping */
- if ( !SDL_IntersectRect(dstrect, &dst->clip_rect, dstrect) ) {
- return(0);
- }
- } else {
- dstrect = &dst->clip_rect;
- }
-
- /* Check for hardware acceleration */
- if ( ((dst->flags & SDL_HWSURFACE) == SDL_HWSURFACE) &&
- video->info.blit_fill ) {
- SDL_Rect hw_rect;
- if ( dst == SDL_VideoSurface ) {
- hw_rect = *dstrect;
- hw_rect.x += current_video->offset_x;
- hw_rect.y += current_video->offset_y;
- dstrect = &hw_rect;
- }
- return(video->FillHWRect(this, dst, dstrect, color));
- }
-
- /* Perform software fill */
- if ( SDL_LockSurface(dst) != 0 ) {
- return(-1);
- }
- row = (Uint8 *)dst->pixels+dstrect->y*dst->pitch+
- dstrect->x*dst->format->BytesPerPixel;
- if ( dst->format->palette || (color == 0) ) {
- x = dstrect->w*dst->format->BytesPerPixel;
- if ( !color && !((uintptr_t)row&3) && !(x&3) && !(dst->pitch&3) ) {
- int n = x >> 2;
- for ( y=dstrect->h; y; --y ) {
- SDL_memset4(row, 0, n);
- row += dst->pitch;
- }
- } else {
-#ifdef __powerpc__
- /*
- * SDL_memset() on PPC (both glibc and codewarrior) uses
- * the dcbz (Data Cache Block Zero) instruction, which
- * causes an alignment exception if the destination is
- * uncachable, so only use it on software surfaces
- */
- if((dst->flags & SDL_HWSURFACE) == SDL_HWSURFACE) {
- if(dstrect->w >= 8) {
- /*
- * 64-bit stores are probably most
- * efficient to uncached video memory
- */
- double fill;
- SDL_memset(&fill, color, (sizeof fill));
- for(y = dstrect->h; y; y--) {
- Uint8 *d = row;
- unsigned n = x;
- unsigned nn;
- Uint8 c = color;
- double f = fill;
- while((unsigned long)d
- & (sizeof(double) - 1)) {
- *d++ = c;
- n--;
- }
- nn = n / (sizeof(double) * 4);
- while(nn) {
- ((double *)d)[0] = f;
- ((double *)d)[1] = f;
- ((double *)d)[2] = f;
- ((double *)d)[3] = f;
- d += 4*sizeof(double);
- nn--;
- }
- n &= ~(sizeof(double) * 4 - 1);
- nn = n / sizeof(double);
- while(nn) {
- *(double *)d = f;
- d += sizeof(double);
- nn--;
- }
- n &= ~(sizeof(double) - 1);
- while(n) {
- *d++ = c;
- n--;
- }
- row += dst->pitch;
- }
- } else {
- /* narrow boxes */
- for(y = dstrect->h; y; y--) {
- Uint8 *d = row;
- Uint8 c = color;
- int n = x;
- while(n) {
- *d++ = c;
- n--;
- }
- row += dst->pitch;
- }
- }
- } else
-#endif /* __powerpc__ */
- {
- for(y = dstrect->h; y; y--) {
- SDL_memset(row, color, x);
- row += dst->pitch;
- }
- }
- }
- } else {
- switch (dst->format->BytesPerPixel) {
- case 2:
- for ( y=dstrect->h; y; --y ) {
- Uint16 *pixels = (Uint16 *)row;
- Uint16 c = (Uint16)color;
- Uint32 cc = (Uint32)c << 16 | c;
- int n = dstrect->w;
- if((uintptr_t)pixels & 3) {
- *pixels++ = c;
- n--;
- }
- if(n >> 1)
- SDL_memset4(pixels, cc, n >> 1);
- if(n & 1)
- pixels[n - 1] = c;
- row += dst->pitch;
- }
- break;
-
- case 3:
- #if SDL_BYTEORDER == SDL_BIG_ENDIAN
- color <<= 8;
- #endif
- for ( y=dstrect->h; y; --y ) {
- Uint8 *pixels = row;
- for ( x=dstrect->w; x; --x ) {
- SDL_memcpy(pixels, &color, 3);
- pixels += 3;
- }
- row += dst->pitch;
- }
- break;
-
- case 4:
- for(y = dstrect->h; y; --y) {
- SDL_memset4(row, color, dstrect->w);
- row += dst->pitch;
- }
- break;
- }
- }
- SDL_UnlockSurface(dst);
-
- /* We're done! */
- return(0);
-}
-
-/*
- * Lock a surface to directly access the pixels
- */
-int SDL_LockSurface (SDL_Surface *surface)
-{
- if ( ! surface->locked ) {
- /* Perform the lock */
- if ( surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT) ) {
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
- if ( video->LockHWSurface(this, surface) < 0 ) {
- return(-1);
- }
- }
- if ( surface->flags & SDL_RLEACCEL ) {
- SDL_UnRLESurface(surface, 1);
- surface->flags |= SDL_RLEACCEL; /* save accel'd state */
- }
- /* This needs to be done here in case pixels changes value */
- surface->pixels = (Uint8 *)surface->pixels + surface->offset;
- }
-
- /* Increment the surface lock count, for recursive locks */
- ++surface->locked;
-
- /* Ready to go.. */
- return(0);
-}
-/*
- * Unlock a previously locked surface
- */
-void SDL_UnlockSurface (SDL_Surface *surface)
-{
- /* Only perform an unlock if we are locked */
- if ( ! surface->locked || (--surface->locked > 0) ) {
- return;
- }
-
- /* Perform the unlock */
- surface->pixels = (Uint8 *)surface->pixels - surface->offset;
-
- /* Unlock hardware or accelerated surfaces */
- if ( surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT) ) {
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
- video->UnlockHWSurface(this, surface);
- } else {
- /* Update RLE encoded surface with new data */
- if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) {
- surface->flags &= ~SDL_RLEACCEL; /* stop lying */
- SDL_RLESurface(surface);
- }
- }
-}
-
-/*
- * Convert a surface into the specified pixel format.
- */
-SDL_Surface * SDL_ConvertSurface (SDL_Surface *surface,
- SDL_PixelFormat *format, Uint32 flags)
-{
- SDL_Surface *convert;
- Uint32 colorkey = 0;
- Uint8 alpha = 0;
- Uint32 surface_flags;
- SDL_Rect bounds;
-
- /* Check for empty destination palette! (results in empty image) */
- if ( format->palette != NULL ) {
- int i;
- for ( i=0; i<format->palette->ncolors; ++i ) {
- if ( (format->palette->colors[i].r != 0) ||
- (format->palette->colors[i].g != 0) ||
- (format->palette->colors[i].b != 0) )
- break;
- }
- if ( i == format->palette->ncolors ) {
- SDL_SetError("Empty destination palette");
- return(NULL);
- }
- }
-
- /* Only create hw surfaces with alpha channel if hw alpha blits
- are supported */
- if(format->Amask != 0 && (flags & SDL_HWSURFACE)) {
- const SDL_VideoInfo *vi = SDL_GetVideoInfo();
- if(!vi || !vi->blit_hw_A)
- flags &= ~SDL_HWSURFACE;
- }
-
- /* Create a new surface with the desired format */
- convert = SDL_CreateRGBSurface(flags,
- surface->w, surface->h, format->BitsPerPixel,
- format->Rmask, format->Gmask, format->Bmask, format->Amask);
- if ( convert == NULL ) {
- return(NULL);
- }
-
- /* Copy the palette if any */
- if ( format->palette && convert->format->palette ) {
- SDL_memcpy(convert->format->palette->colors,
- format->palette->colors,
- format->palette->ncolors*sizeof(SDL_Color));
- convert->format->palette->ncolors = format->palette->ncolors;
- }
-
- /* Save the original surface color key and alpha */
- surface_flags = surface->flags;
- if ( (surface_flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
- /* Convert colourkeyed surfaces to RGBA if requested */
- if((flags & SDL_SRCCOLORKEY) != SDL_SRCCOLORKEY
- && format->Amask) {
- surface_flags &= ~SDL_SRCCOLORKEY;
- } else {
- colorkey = surface->format->colorkey;
- SDL_SetColorKey(surface, 0, 0);
- }
- }
- if ( (surface_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
- /* Copy over the alpha channel to RGBA if requested */
- if ( format->Amask ) {
- surface->flags &= ~SDL_SRCALPHA;
- } else {
- alpha = surface->format->alpha;
- SDL_SetAlpha(surface, 0, 0);
- }
- }
-
- /* Copy over the image data */
- bounds.x = 0;
- bounds.y = 0;
- bounds.w = surface->w;
- bounds.h = surface->h;
- SDL_LowerBlit(surface, &bounds, convert, &bounds);
-
- /* Clean up the original surface, and update converted surface */
- if ( convert != NULL ) {
- SDL_SetClipRect(convert, &surface->clip_rect);
- }
- if ( (surface_flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
- Uint32 cflags = surface_flags&(SDL_SRCCOLORKEY|SDL_RLEACCELOK);
- if ( convert != NULL ) {
- Uint8 keyR, keyG, keyB;
-
- SDL_GetRGB(colorkey,surface->format,&keyR,&keyG,&keyB);
- SDL_SetColorKey(convert, cflags|(flags&SDL_RLEACCELOK),
- SDL_MapRGB(convert->format, keyR, keyG, keyB));
- }
- SDL_SetColorKey(surface, cflags, colorkey);
- }
- if ( (surface_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
- Uint32 aflags = surface_flags&(SDL_SRCALPHA|SDL_RLEACCELOK);
- if ( convert != NULL ) {
- SDL_SetAlpha(convert, aflags|(flags&SDL_RLEACCELOK),
- alpha);
- }
- if ( format->Amask ) {
- surface->flags |= SDL_SRCALPHA;
- } else {
- SDL_SetAlpha(surface, aflags, alpha);
- }
- }
-
- /* We're ready to go! */
- return(convert);
-}
-
-/*
- * Free a surface created by the above function.
- */
-void SDL_FreeSurface (SDL_Surface *surface)
-{
- /* Free anything that's not NULL, and not the screen surface */
- if ((surface == NULL) ||
- (current_video &&
- ((surface == SDL_ShadowSurface)||(surface == SDL_VideoSurface)))) {
- return;
- }
- if ( --surface->refcount > 0 ) {
- return;
- }
- while ( surface->locked > 0 ) {
- SDL_UnlockSurface(surface);
- }
- if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) {
- SDL_UnRLESurface(surface, 0);
- }
- if ( surface->format ) {
- SDL_FreeFormat(surface->format);
- surface->format = NULL;
- }
- if ( surface->map != NULL ) {
- SDL_FreeBlitMap(surface->map);
- surface->map = NULL;
- }
- if ( surface->hwdata ) {
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
- video->FreeHWSurface(this, surface);
- }
- if ( surface->pixels &&
- ((surface->flags & SDL_PREALLOC) != SDL_PREALLOC) ) {
- SDL_free(surface->pixels);
- }
- SDL_free(surface);
-#ifdef CHECK_LEAKS
- --surfaces_allocated;
-#endif
-}
diff --git a/distrib/sdl-1.2.12/src/video/SDL_sysvideo.h b/distrib/sdl-1.2.12/src/video/SDL_sysvideo.h
deleted file mode 100644
index 0de0b56..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_sysvideo.h
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_sysvideo_h
-#define _SDL_sysvideo_h
-
-#include "SDL_mouse.h"
-#define SDL_PROTOTYPES_ONLY
-#include "SDL_syswm.h"
-#undef SDL_PROTOTYPES_ONLY
-
-/* This file prototypes the video driver implementation.
- This is designed to be easily converted to C++ in the future.
- */
-
-#if SDL_VIDEO_OPENGL
-#include "SDL_opengl.h"
-#endif /* SDL_VIDEO_OPENGL */
-
-/* The SDL video driver */
-typedef struct SDL_VideoDevice SDL_VideoDevice;
-
-/* Define the SDL video driver structure */
-#define _THIS SDL_VideoDevice *_this
-#ifndef _STATUS
-#define _STATUS SDL_status *status
-#endif
-struct SDL_VideoDevice {
- /* * * */
- /* The name of this video driver */
- const char *name;
-
- /* * * */
- /* Initialization/Query functions */
-
- /* Initialize the native video subsystem, filling 'vformat' with the
- "best" display pixel format, returning 0 or -1 if there's an error.
- */
- int (*VideoInit)(_THIS, SDL_PixelFormat *vformat);
-
- /* List the available video modes for the given pixel format, sorted
- from largest to smallest.
- */
- SDL_Rect **(*ListModes)(_THIS, SDL_PixelFormat *format, Uint32 flags);
-
- /* Set the requested video mode, returning a surface which will be
- set to the SDL_VideoSurface. The width and height will already
- be verified by ListModes(), and the video subsystem is free to
- set the mode to a supported bit depth different from the one
- specified -- the desired bpp will be emulated with a shadow
- surface if necessary. If a new mode is returned, this function
- should take care of cleaning up the current mode.
- */
- SDL_Surface *(*SetVideoMode)(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags);
-
- /* Toggle the fullscreen mode */
- int (*ToggleFullScreen)(_THIS, int on);
-
- /* This is called after the video mode has been set, to get the
- initial mouse state. It should queue events as necessary to
- properly represent the current mouse focus and position.
- */
- void (*UpdateMouse)(_THIS);
-
- /* Create a YUV video surface (possibly overlay) of the given
- format. The hardware should be able to perform at least 2x
- scaling on display.
- */
- SDL_Overlay *(*CreateYUVOverlay)(_THIS, int width, int height,
- Uint32 format, SDL_Surface *display);
-
- /* Sets the color entries { firstcolor .. (firstcolor+ncolors-1) }
- of the physical palette to those in 'colors'. If the device is
- using a software palette (SDL_HWPALETTE not set), then the
- changes are reflected in the logical palette of the screen
- as well.
- The return value is 1 if all entries could be set properly
- or 0 otherwise.
- */
- int (*SetColors)(_THIS, int firstcolor, int ncolors,
- SDL_Color *colors);
-
- /* This pointer should exist in the native video subsystem and should
- point to an appropriate update function for the current video mode
- */
- void (*UpdateRects)(_THIS, int numrects, SDL_Rect *rects);
-
- /* Reverse the effects VideoInit() -- called if VideoInit() fails
- or if the application is shutting down the video subsystem.
- */
- void (*VideoQuit)(_THIS);
-
- /* * * */
- /* Hardware acceleration functions */
-
- /* Information about the video hardware */
- SDL_VideoInfo info;
-
- /* The pixel format used when SDL_CreateRGBSurface creates SDL_HWSURFACEs with alpha */
- SDL_PixelFormat* displayformatalphapixel;
-
- /* Allocates a surface in video memory */
- int (*AllocHWSurface)(_THIS, SDL_Surface *surface);
-
- /* Sets the hardware accelerated blit function, if any, based
- on the current flags of the surface (colorkey, alpha, etc.)
- */
- int (*CheckHWBlit)(_THIS, SDL_Surface *src, SDL_Surface *dst);
-
- /* Fills a surface rectangle with the given color */
- int (*FillHWRect)(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color);
-
- /* Sets video mem colorkey and accelerated blit function */
- int (*SetHWColorKey)(_THIS, SDL_Surface *surface, Uint32 key);
-
- /* Sets per surface hardware alpha value */
- int (*SetHWAlpha)(_THIS, SDL_Surface *surface, Uint8 value);
-
- /* Returns a readable/writable surface */
- int (*LockHWSurface)(_THIS, SDL_Surface *surface);
- void (*UnlockHWSurface)(_THIS, SDL_Surface *surface);
-
- /* Performs hardware flipping */
- int (*FlipHWSurface)(_THIS, SDL_Surface *surface);
-
- /* Frees a previously allocated video surface */
- void (*FreeHWSurface)(_THIS, SDL_Surface *surface);
-
- /* * * */
- /* Gamma support */
-
- Uint16 *gamma;
-
- /* Set the gamma correction directly (emulated with gamma ramps) */
- int (*SetGamma)(_THIS, float red, float green, float blue);
-
- /* Get the gamma correction directly (emulated with gamma ramps) */
- int (*GetGamma)(_THIS, float *red, float *green, float *blue);
-
- /* Set the gamma ramp */
- int (*SetGammaRamp)(_THIS, Uint16 *ramp);
-
- /* Get the gamma ramp */
- int (*GetGammaRamp)(_THIS, Uint16 *ramp);
-
- /* * * */
- /* OpenGL support */
-
- /* Sets the dll to use for OpenGL and loads it */
- int (*GL_LoadLibrary)(_THIS, const char *path);
-
- /* Retrieves the address of a function in the gl library */
- void* (*GL_GetProcAddress)(_THIS, const char *proc);
-
- /* Get attribute information from the windowing system. */
- int (*GL_GetAttribute)(_THIS, SDL_GLattr attrib, int* value);
-
- /* Make the context associated with this driver current */
- int (*GL_MakeCurrent)(_THIS);
-
- /* Swap the current buffers in double buffer mode. */
- void (*GL_SwapBuffers)(_THIS);
-
- /* OpenGL functions for SDL_OPENGLBLIT */
-#if SDL_VIDEO_OPENGL
-#if !defined(__WIN32__)
-#define WINAPI
-#endif
-#define SDL_PROC(ret,func,params) ret (WINAPI *func) params;
-#include "SDL_glfuncs.h"
-#undef SDL_PROC
-
- /* Texture id */
- GLuint texture;
-#endif
- int is_32bit;
-
- /* * * */
- /* Window manager functions */
-
- /* Set the title and icon text */
- void (*SetCaption)(_THIS, const char *title, const char *icon);
-
- /* Set the window icon image */
- void (*SetIcon)(_THIS, SDL_Surface *icon, Uint8 *mask);
-
- /* Iconify the window.
- This function returns 1 if there is a window manager and the
- window was actually iconified, it returns 0 otherwise.
- */
- int (*IconifyWindow)(_THIS);
-
- /* Grab or ungrab keyboard and mouse input */
- SDL_GrabMode (*GrabInput)(_THIS, SDL_GrabMode mode);
-
- /* Get some platform dependent window information */
- int (*GetWMInfo)(_THIS, SDL_SysWMinfo *info);
-
- /* set window position */
- void (*SetWindowPos)(_THIS, int x, int y);
-
- /* get window position */
- void (*GetWindowPos)(_THIS, int *px, int *py);
-
- /* determine if the window is fully visible on screen */
- int (*IsWindowVisible)(_THIS, int recenter);
-
- /* get main monitor's resolution */
- int (*GetMonitorDPI)(_THIS, int *xdpi, int *ydpi);
-
- /* get nearest monitor's rectangle */
- int (*GetMonitorRect)(_THIS, SDL_Rect* rect);
-
- /* * * */
- /* Cursor manager functions */
-
- /* Free a window manager cursor
- This function can be NULL if CreateWMCursor is also NULL.
- */
- void (*FreeWMCursor)(_THIS, WMcursor *cursor);
-
- /* If not NULL, create a black/white window manager cursor */
- WMcursor *(*CreateWMCursor)(_THIS,
- Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
-
- /* Show the specified cursor, or hide if cursor is NULL */
- int (*ShowWMCursor)(_THIS, WMcursor *cursor);
-
- /* Warp the window manager cursor to (x,y)
- If NULL, a mouse motion event is posted internally.
- */
- void (*WarpWMCursor)(_THIS, Uint16 x, Uint16 y);
-
- /* If not NULL, this is called when a mouse motion event occurs */
- void (*MoveWMCursor)(_THIS, int x, int y);
-
- /* Determine whether the mouse should be in relative mode or not.
- This function is called when the input grab state or cursor
- visibility state changes.
- If the cursor is not visible, and the input is grabbed, the
- driver can place the mouse in relative mode, which may result
- in higher accuracy sampling of the pointer motion.
- */
- void (*CheckMouseMode)(_THIS);
-
- /* * * */
- /* Event manager functions */
-
- /* Initialize keyboard mapping for this driver */
- void (*InitOSKeymap)(_THIS);
-
- /* Handle any queued OS events */
- void (*PumpEvents)(_THIS);
-
- /* * * */
- /* Data common to all drivers */
- SDL_Surface *screen;
- SDL_Surface *shadow;
- SDL_Surface *visible;
- SDL_Palette *physpal; /* physical palette, if != logical palette */
- SDL_Color *gammacols; /* gamma-corrected colours, or NULL */
- char *wm_title;
- char *wm_icon;
- int offset_x;
- int offset_y;
- SDL_GrabMode input_grab;
-
- /* Driver information flags */
- int handles_any_size; /* Driver handles any size video mode */
-
- /* * * */
- /* Data used by the GL drivers */
- struct {
- int red_size;
- int green_size;
- int blue_size;
- int alpha_size;
- int depth_size;
- int buffer_size;
- int stencil_size;
- int double_buffer;
- int accum_red_size;
- int accum_green_size;
- int accum_blue_size;
- int accum_alpha_size;
- int stereo;
- int multisamplebuffers;
- int multisamplesamples;
- int accelerated;
- int swap_control;
- int driver_loaded;
- char driver_path[256];
- void* dll_handle;
- } gl_config;
-
- /* * * */
- /* Data private to this driver */
- struct SDL_PrivateVideoData *hidden;
- struct SDL_PrivateGLData *gl_data;
-
- /* * * */
- /* The function used to dispose of this structure */
- void (*free)(_THIS);
-};
-#undef _THIS
-
-typedef struct VideoBootStrap {
- const char *name;
- const char *desc;
- int (*available)(void);
- SDL_VideoDevice *(*create)(int devindex);
-} VideoBootStrap;
-
-#if SDL_VIDEO_DRIVER_QUARTZ
-extern VideoBootStrap QZ_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_X11
-extern VideoBootStrap X11_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_DGA
-extern VideoBootStrap DGA_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_NANOX
-extern VideoBootStrap NX_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_IPOD
-extern VideoBootStrap iPod_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_QTOPIA
-extern VideoBootStrap Qtopia_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_WSCONS
-extern VideoBootStrap WSCONS_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_FBCON
-extern VideoBootStrap FBCON_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_DIRECTFB
-extern VideoBootStrap DirectFB_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_PS2GS
-extern VideoBootStrap PS2GS_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_GGI
-extern VideoBootStrap GGI_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_VGL
-extern VideoBootStrap VGL_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_SVGALIB
-extern VideoBootStrap SVGALIB_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_GAPI
-extern VideoBootStrap GAPI_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_WINDIB
-extern VideoBootStrap WINDIB_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_DDRAW
-extern VideoBootStrap DIRECTX_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_BWINDOW
-extern VideoBootStrap BWINDOW_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_TOOLBOX
-extern VideoBootStrap TOOLBOX_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_DRAWSPROCKET
-extern VideoBootStrap DSp_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_PHOTON
-extern VideoBootStrap ph_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_EPOC
-extern VideoBootStrap EPOC_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_XBIOS
-extern VideoBootStrap XBIOS_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_GEM
-extern VideoBootStrap GEM_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_PICOGUI
-extern VideoBootStrap PG_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_DC
-extern VideoBootStrap DC_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_NDS
-extern VideoBootStrap NDS_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_RISCOS
-extern VideoBootStrap RISCOS_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_OS2FS
-extern VideoBootStrap OS2FSLib_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_AALIB
-extern VideoBootStrap AALIB_bootstrap;
-#endif
-#if SDL_VIDEO_DRIVER_DUMMY
-extern VideoBootStrap DUMMY_bootstrap;
-#endif
-
-/* This is the current video device */
-extern SDL_VideoDevice *current_video;
-
-#define SDL_VideoSurface (current_video->screen)
-#define SDL_ShadowSurface (current_video->shadow)
-#define SDL_PublicSurface (current_video->visible)
-
-#endif /* _SDL_sysvideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/SDL_video.c b/distrib/sdl-1.2.12/src/video/SDL_video.c
deleted file mode 100644
index f67bf63..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_video.c
+++ /dev/null
@@ -1,2009 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* The high-level video driver subsystem */
-
-#include "SDL.h"
-#include "SDL_sysvideo.h"
-#include "SDL_blit.h"
-#include "SDL_pixels_c.h"
-#include "SDL_cursor_c.h"
-#include "../events/SDL_sysevents.h"
-#include "../events/SDL_events_c.h"
-
-/* Available video drivers */
-static VideoBootStrap *bootstrap[] = {
-#if SDL_VIDEO_DRIVER_QUARTZ
- &QZ_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_X11
- &X11_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_DGA
- &DGA_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_NANOX
- &NX_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_IPOD
- &iPod_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_QTOPIA
- &Qtopia_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_WSCONS
- &WSCONS_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_FBCON
- &FBCON_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_DIRECTFB
- &DirectFB_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_PS2GS
- &PS2GS_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_GGI
- &GGI_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_VGL
- &VGL_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_SVGALIB
- &SVGALIB_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_GAPI
- &GAPI_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_WINDIB
- &WINDIB_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_DDRAW
- &DIRECTX_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_BWINDOW
- &BWINDOW_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_TOOLBOX
- &TOOLBOX_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_DRAWSPROCKET
- &DSp_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_PHOTON
- &ph_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_EPOC
- &EPOC_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_XBIOS
- &XBIOS_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_GEM
- &GEM_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_PICOGUI
- &PG_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_DC
- &DC_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_NDS
- &NDS_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_RISCOS
- &RISCOS_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_OS2FS
- &OS2FSLib_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_AALIB
- &AALIB_bootstrap,
-#endif
-#if SDL_VIDEO_DRIVER_DUMMY
- &DUMMY_bootstrap,
-#endif
- NULL
-};
-
-SDL_VideoDevice *current_video = NULL;
-
-/* Various local functions */
-int SDL_VideoInit(const char *driver_name, Uint32 flags);
-void SDL_VideoQuit(void);
-void SDL_GL_UpdateRectsLock(SDL_VideoDevice* this, int numrects, SDL_Rect* rects);
-
-static SDL_GrabMode SDL_WM_GrabInputOff(void);
-#if SDL_VIDEO_OPENGL
-static int lock_count = 0;
-#endif
-
-
-/*
- * Initialize the video and event subsystems -- determine native pixel format
- */
-int SDL_VideoInit (const char *driver_name, Uint32 flags)
-{
- SDL_VideoDevice *video;
- int index;
- int i;
- SDL_PixelFormat vformat;
- Uint32 video_flags;
-
- /* Toggle the event thread flags, based on OS requirements */
-#if defined(MUST_THREAD_EVENTS)
- flags |= SDL_INIT_EVENTTHREAD;
-#elif defined(CANT_THREAD_EVENTS)
- if ( (flags & SDL_INIT_EVENTTHREAD) == SDL_INIT_EVENTTHREAD ) {
- SDL_SetError("OS doesn't support threaded events");
- return(-1);
- }
-#endif
-
- /* Check to make sure we don't overwrite 'current_video' */
- if ( current_video != NULL ) {
- SDL_VideoQuit();
- }
-
- /* Select the proper video driver */
- index = 0;
- video = NULL;
- if ( driver_name != NULL ) {
-#if 0 /* This will be replaced with a better driver selection API */
- if ( SDL_strrchr(driver_name, ':') != NULL ) {
- index = atoi(SDL_strrchr(driver_name, ':')+1);
- }
-#endif
- for ( i=0; bootstrap[i]; ++i ) {
- if ( SDL_strcasecmp(bootstrap[i]->name, driver_name) == 0) {
- if ( bootstrap[i]->available() ) {
- video = bootstrap[i]->create(index);
- break;
- }
- }
- }
- } else {
- for ( i=0; bootstrap[i]; ++i ) {
- if ( bootstrap[i]->available() ) {
- video = bootstrap[i]->create(index);
- if ( video != NULL ) {
- break;
- }
- }
- }
- }
- if ( video == NULL ) {
- SDL_SetError("No available video device");
- return(-1);
- }
- current_video = video;
- current_video->name = bootstrap[i]->name;
-
- /* Do some basic variable initialization */
- video->screen = NULL;
- video->shadow = NULL;
- video->visible = NULL;
- video->physpal = NULL;
- video->gammacols = NULL;
- video->gamma = NULL;
- video->wm_title = NULL;
- video->wm_icon = NULL;
- video->offset_x = 0;
- video->offset_y = 0;
- SDL_memset(&video->info, 0, (sizeof video->info));
-
- video->displayformatalphapixel = NULL;
-
- /* Set some very sane GL defaults */
- video->gl_config.driver_loaded = 0;
- video->gl_config.dll_handle = NULL;
- video->gl_config.red_size = 3;
- video->gl_config.green_size = 3;
- video->gl_config.blue_size = 2;
- video->gl_config.alpha_size = 0;
- video->gl_config.buffer_size = 0;
- video->gl_config.depth_size = 16;
- video->gl_config.stencil_size = 0;
- video->gl_config.double_buffer = 1;
- video->gl_config.accum_red_size = 0;
- video->gl_config.accum_green_size = 0;
- video->gl_config.accum_blue_size = 0;
- video->gl_config.accum_alpha_size = 0;
- video->gl_config.stereo = 0;
- video->gl_config.multisamplebuffers = 0;
- video->gl_config.multisamplesamples = 0;
- video->gl_config.accelerated = -1; /* not known, don't set */
- video->gl_config.swap_control = -1; /* not known, don't set */
-
- /* Initialize the video subsystem */
- SDL_memset(&vformat, 0, sizeof(vformat));
- if ( video->VideoInit(video, &vformat) < 0 ) {
- SDL_VideoQuit();
- return(-1);
- }
-
- /* Create a zero sized video surface of the appropriate format */
- video_flags = SDL_SWSURFACE;
- SDL_VideoSurface = SDL_CreateRGBSurface(video_flags, 0, 0,
- vformat.BitsPerPixel,
- vformat.Rmask, vformat.Gmask, vformat.Bmask, 0);
- if ( SDL_VideoSurface == NULL ) {
- SDL_VideoQuit();
- return(-1);
- }
- SDL_PublicSurface = NULL; /* Until SDL_SetVideoMode() */
-
-#if 0 /* Don't change the current palette - may be used by other programs.
- * The application can't do anything with the display surface until
- * a video mode has been set anyway. :)
- */
- /* If we have a palettized surface, create a default palette */
- if ( SDL_VideoSurface->format->palette ) {
- SDL_PixelFormat *vf = SDL_VideoSurface->format;
- SDL_DitherColors(vf->palette->colors, vf->BitsPerPixel);
- video->SetColors(video,
- 0, vf->palette->ncolors, vf->palette->colors);
- }
-#endif
- video->info.vfmt = SDL_VideoSurface->format;
-
- /* Start the event loop */
- if ( SDL_StartEventLoop(flags) < 0 ) {
- SDL_VideoQuit();
- return(-1);
- }
- SDL_CursorInit(flags & SDL_INIT_EVENTTHREAD);
-
- /* We're ready to go! */
- return(0);
-}
-
-char *SDL_VideoDriverName(char *namebuf, int maxlen)
-{
- if ( current_video != NULL ) {
- SDL_strlcpy(namebuf, current_video->name, maxlen);
- return(namebuf);
- }
- return(NULL);
-}
-
-/*
- * Get the current display surface
- */
-SDL_Surface *SDL_GetVideoSurface(void)
-{
- SDL_Surface *visible;
-
- visible = NULL;
- if ( current_video ) {
- visible = current_video->visible;
- }
- return(visible);
-}
-
-/*
- * Get the current information about the video hardware
- */
-const SDL_VideoInfo *SDL_GetVideoInfo(void)
-{
- const SDL_VideoInfo *info;
-
- info = NULL;
- if ( current_video ) {
- info = &current_video->info;
- }
- return(info);
-}
-
-/*
- * Return a pointer to an array of available screen dimensions for the
- * given format, sorted largest to smallest. Returns NULL if there are
- * no dimensions available for a particular format, or (SDL_Rect **)-1
- * if any dimension is okay for the given format. If 'format' is NULL,
- * the mode list will be for the format given by SDL_GetVideoInfo()->vfmt
- */
-SDL_Rect ** SDL_ListModes (SDL_PixelFormat *format, Uint32 flags)
-{
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
- SDL_Rect **modes;
-
- modes = NULL;
- if ( SDL_VideoSurface ) {
- if ( format == NULL ) {
- format = SDL_VideoSurface->format;
- }
- modes = video->ListModes(this, format, flags);
- }
- return(modes);
-}
-
-/*
- * Check to see if a particular video mode is supported.
- * It returns 0 if the requested mode is not supported under any bit depth,
- * or returns the bits-per-pixel of the closest available mode with the
- * given width and height. If this bits-per-pixel is different from the
- * one used when setting the video mode, SDL_SetVideoMode() will succeed,
- * but will emulate the requested bits-per-pixel with a shadow surface.
- */
-static Uint8 SDL_closest_depths[4][8] = {
- /* 8 bit closest depth ordering */
- { 0, 8, 16, 15, 32, 24, 0, 0 },
- /* 15,16 bit closest depth ordering */
- { 0, 16, 15, 32, 24, 8, 0, 0 },
- /* 24 bit closest depth ordering */
- { 0, 24, 32, 16, 15, 8, 0, 0 },
- /* 32 bit closest depth ordering */
- { 0, 32, 16, 15, 24, 8, 0, 0 }
-};
-
-
-#ifdef __MACOS__ /* MPW optimization bug? */
-#define NEGATIVE_ONE 0xFFFFFFFF
-#else
-#define NEGATIVE_ONE -1
-#endif
-
-int SDL_VideoModeOK (int width, int height, int bpp, Uint32 flags)
-{
- int table, b, i;
- int supported;
- SDL_PixelFormat format;
- SDL_Rect **sizes;
-
- /* Currently 1 and 4 bpp are not supported */
- if ( bpp < 8 || bpp > 32 ) {
- return(0);
- }
- if ( (width <= 0) || (height <= 0) ) {
- return(0);
- }
-
- /* Search through the list valid of modes */
- SDL_memset(&format, 0, sizeof(format));
- supported = 0;
- table = ((bpp+7)/8)-1;
- SDL_closest_depths[table][0] = bpp;
- SDL_closest_depths[table][7] = 0;
- for ( b = 0; !supported && SDL_closest_depths[table][b]; ++b ) {
- format.BitsPerPixel = SDL_closest_depths[table][b];
- sizes = SDL_ListModes(&format, flags);
- if ( sizes == (SDL_Rect **)0 ) {
- /* No sizes supported at this bit-depth */
- continue;
- } else
- if (sizes == (SDL_Rect **)NEGATIVE_ONE) {
- /* Any size supported at this bit-depth */
- supported = 1;
- continue;
- } else if (current_video->handles_any_size) {
- /* Driver can center a smaller surface to simulate fullscreen */
- for ( i=0; sizes[i]; ++i ) {
- if ((sizes[i]->w >= width) && (sizes[i]->h >= height)) {
- supported = 1; /* this mode can fit the centered window. */
- break;
- }
- }
- } else
- for ( i=0; sizes[i]; ++i ) {
- if ((sizes[i]->w == width) && (sizes[i]->h == height)) {
- supported = 1;
- break;
- }
- }
- }
- if ( supported ) {
- --b;
- return(SDL_closest_depths[table][b]);
- } else {
- return(0);
- }
-}
-
-/*
- * Get the closest non-emulated video mode to the one requested
- */
-static int SDL_GetVideoMode (int *w, int *h, int *BitsPerPixel, Uint32 flags)
-{
- int table, b, i;
- int supported;
- int native_bpp;
- SDL_PixelFormat format;
- SDL_Rect **sizes;
-
- /* Check parameters */
- if ( *BitsPerPixel < 8 || *BitsPerPixel > 32 ) {
- SDL_SetError("Invalid bits per pixel (range is {8...32})");
- return(0);
- }
- if ((*w <= 0) || (*h <= 0)) {
- SDL_SetError("Invalid width or height");
- return(0);
- }
-
- /* Try the original video mode, get the closest depth */
- native_bpp = SDL_VideoModeOK(*w, *h, *BitsPerPixel, flags);
- if ( native_bpp == *BitsPerPixel ) {
- return(1);
- }
- if ( native_bpp > 0 ) {
- *BitsPerPixel = native_bpp;
- return(1);
- }
-
- /* No exact size match at any depth, look for closest match */
- SDL_memset(&format, 0, sizeof(format));
- supported = 0;
- table = ((*BitsPerPixel+7)/8)-1;
- SDL_closest_depths[table][0] = *BitsPerPixel;
- SDL_closest_depths[table][7] = SDL_VideoSurface->format->BitsPerPixel;
- for ( b = 0; !supported && SDL_closest_depths[table][b]; ++b ) {
- int best;
-
- format.BitsPerPixel = SDL_closest_depths[table][b];
- sizes = SDL_ListModes(&format, flags);
- if ( sizes == (SDL_Rect **)0 ) {
- /* No sizes supported at this bit-depth */
- continue;
- }
- best=0;
- for ( i=0; sizes[i]; ++i ) {
- /* Mode with both dimensions bigger or equal than asked ? */
- if ((sizes[i]->w >= *w) && (sizes[i]->h >= *h)) {
- /* Mode with any dimension smaller or equal than current best ? */
- if ((sizes[i]->w <= sizes[best]->w) || (sizes[i]->h <= sizes[best]->h)) {
- /* Now choose the mode that has less pixels */
- if ((sizes[i]->w * sizes[i]->h) <= (sizes[best]->w * sizes[best]->h)) {
- best=i;
- supported = 1;
- }
- }
- }
- }
- if (supported) {
- *w=sizes[best]->w;
- *h=sizes[best]->h;
- *BitsPerPixel = SDL_closest_depths[table][b];
- }
- }
- if ( ! supported ) {
- SDL_SetError("No video mode large enough for %dx%d", *w, *h);
- }
- return(supported);
-}
-
-/* This should probably go somewhere else -- like SDL_surface.c */
-static void SDL_ClearSurface(SDL_Surface *surface)
-{
- Uint32 black;
-
- black = SDL_MapRGB(surface->format, 0, 0, 0);
- SDL_FillRect(surface, NULL, black);
- if ((surface->flags&SDL_HWSURFACE) && (surface->flags&SDL_DOUBLEBUF)) {
- SDL_Flip(surface);
- SDL_FillRect(surface, NULL, black);
- }
- SDL_Flip(surface);
-}
-
-/*
- * Create a shadow surface suitable for fooling the app. :-)
- */
-static void SDL_CreateShadowSurface(int depth)
-{
- Uint32 Rmask, Gmask, Bmask;
-
- /* Allocate the shadow surface */
- if ( depth == (SDL_VideoSurface->format)->BitsPerPixel ) {
- Rmask = (SDL_VideoSurface->format)->Rmask;
- Gmask = (SDL_VideoSurface->format)->Gmask;
- Bmask = (SDL_VideoSurface->format)->Bmask;
- } else {
- Rmask = Gmask = Bmask = 0;
- }
- SDL_ShadowSurface = SDL_CreateRGBSurface(SDL_SWSURFACE,
- SDL_VideoSurface->w, SDL_VideoSurface->h,
- depth, Rmask, Gmask, Bmask, 0);
- if ( SDL_ShadowSurface == NULL ) {
- return;
- }
-
- /* 8-bit shadow surfaces report that they have exclusive palette */
- if ( SDL_ShadowSurface->format->palette ) {
- SDL_ShadowSurface->flags |= SDL_HWPALETTE;
- if ( depth == (SDL_VideoSurface->format)->BitsPerPixel ) {
- SDL_memcpy(SDL_ShadowSurface->format->palette->colors,
- SDL_VideoSurface->format->palette->colors,
- SDL_VideoSurface->format->palette->ncolors*
- sizeof(SDL_Color));
- } else {
- SDL_DitherColors(
- SDL_ShadowSurface->format->palette->colors, depth);
- }
- }
-
- /* If the video surface is resizable, the shadow should say so */
- if ( (SDL_VideoSurface->flags & SDL_RESIZABLE) == SDL_RESIZABLE ) {
- SDL_ShadowSurface->flags |= SDL_RESIZABLE;
- }
- /* If the video surface has no frame, the shadow should say so */
- if ( (SDL_VideoSurface->flags & SDL_NOFRAME) == SDL_NOFRAME ) {
- SDL_ShadowSurface->flags |= SDL_NOFRAME;
- }
- /* If the video surface is fullscreen, the shadow should say so */
- if ( (SDL_VideoSurface->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
- SDL_ShadowSurface->flags |= SDL_FULLSCREEN;
- }
- /* If the video surface is flippable, the shadow should say so */
- if ( (SDL_VideoSurface->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
- SDL_ShadowSurface->flags |= SDL_DOUBLEBUF;
- }
- return;
-}
-
-#ifdef __QNXNTO__
- #include <sys/neutrino.h>
-#endif /* __QNXNTO__ */
-
-/*
- * Set the requested video mode, allocating a shadow buffer if necessary.
- */
-SDL_Surface * SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags)
-{
- SDL_VideoDevice *video, *this;
- SDL_Surface *prev_mode, *mode;
- int video_w;
- int video_h;
- int video_bpp;
- int is_opengl;
- SDL_GrabMode saved_grab;
-
- /* Start up the video driver, if necessary..
- WARNING: This is the only function protected this way!
- */
- if ( ! current_video ) {
- if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE) < 0 ) {
- return(NULL);
- }
- }
- this = video = current_video;
-
- /* Default to the current width and height */
- if ( width == 0 ) {
- width = video->info.current_w;
- }
- if ( height == 0 ) {
- height = video->info.current_h;
- }
- /* Default to the current video bpp */
- if ( bpp == 0 ) {
- flags |= SDL_ANYFORMAT;
- bpp = SDL_VideoSurface->format->BitsPerPixel;
- }
-
- /* Get a good video mode, the closest one possible */
- video_w = width;
- video_h = height;
- video_bpp = bpp;
- if ( ! SDL_GetVideoMode(&video_w, &video_h, &video_bpp, flags) ) {
- return(NULL);
- }
-
- /* Check the requested flags */
- /* There's no palette in > 8 bits-per-pixel mode */
- if ( video_bpp > 8 ) {
- flags &= ~SDL_HWPALETTE;
- }
-#if 0
- if ( (flags&SDL_FULLSCREEN) != SDL_FULLSCREEN ) {
- /* There's no windowed double-buffering */
- flags &= ~SDL_DOUBLEBUF;
- }
-#endif
- if ( (flags&SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
- /* Use hardware surfaces when double-buffering */
- flags |= SDL_HWSURFACE;
- }
-
- is_opengl = ( ( flags & SDL_OPENGL ) == SDL_OPENGL );
- if ( is_opengl ) {
- /* These flags are for 2D video modes only */
- flags &= ~(SDL_HWSURFACE|SDL_DOUBLEBUF);
- }
-
- /* Reset the keyboard here so event callbacks can run */
- SDL_ResetKeyboard();
- SDL_ResetMouse();
- SDL_cursorstate &= ~CURSOR_USINGSW;
-
- /* Clean up any previous video mode */
- if ( SDL_PublicSurface != NULL ) {
- SDL_PublicSurface = NULL;
- }
- if ( SDL_ShadowSurface != NULL ) {
- SDL_Surface *ready_to_go;
- ready_to_go = SDL_ShadowSurface;
- SDL_ShadowSurface = NULL;
- SDL_FreeSurface(ready_to_go);
- }
- if ( video->physpal ) {
- SDL_free(video->physpal->colors);
- SDL_free(video->physpal);
- video->physpal = NULL;
- }
- if( video->gammacols) {
- SDL_free(video->gammacols);
- video->gammacols = NULL;
- }
-
- /* Save the previous grab state and turn off grab for mode switch */
- saved_grab = SDL_WM_GrabInputOff();
-
- /* Try to set the video mode, along with offset and clipping */
- prev_mode = SDL_VideoSurface;
- SDL_LockCursor();
- SDL_VideoSurface = NULL; /* In case it's freed by driver */
- mode = video->SetVideoMode(this, prev_mode,video_w,video_h,video_bpp,flags);
- if ( mode ) { /* Prevent resize events from mode change */
- /* But not on OS/2 */
-#ifndef __OS2__
- SDL_PrivateResize(mode->w, mode->h);
-#endif
-
- /* Sam - If we asked for OpenGL mode, and didn't get it, fail */
- if ( is_opengl && !(mode->flags & SDL_OPENGL) ) {
- mode = NULL;
- SDL_SetError("OpenGL not available");
- }
- }
- /*
- * rcg11292000
- * If you try to set an SDL_OPENGL surface, and fail to find a
- * matching visual, then the next call to SDL_SetVideoMode()
- * will segfault, since we no longer point to a dummy surface,
- * but rather NULL.
- * Sam 11/29/00
- * WARNING, we need to make sure that the previous mode hasn't
- * already been freed by the video driver. What do we do in
- * that case? Should we call SDL_VideoInit() again?
- */
- SDL_VideoSurface = (mode != NULL) ? mode : prev_mode;
-
- if ( (mode != NULL) && (!is_opengl) ) {
- /* Sanity check */
- if ( (mode->w < width) || (mode->h < height) ) {
- SDL_SetError("Video mode smaller than requested");
- return(NULL);
- }
-
- /* If we have a palettized surface, create a default palette */
- if ( mode->format->palette ) {
- SDL_PixelFormat *vf = mode->format;
- SDL_DitherColors(vf->palette->colors, vf->BitsPerPixel);
- video->SetColors(this, 0, vf->palette->ncolors,
- vf->palette->colors);
- }
-
- /* Clear the surface to black */
- video->offset_x = 0;
- video->offset_y = 0;
- mode->offset = 0;
- SDL_SetClipRect(mode, NULL);
- SDL_ClearSurface(mode);
-
- /* Now adjust the offsets to match the desired mode */
- video->offset_x = (mode->w-width)/2;
- video->offset_y = (mode->h-height)/2;
- mode->offset = video->offset_y*mode->pitch +
- video->offset_x*mode->format->BytesPerPixel;
-#ifdef DEBUG_VIDEO
- fprintf(stderr,
- "Requested mode: %dx%dx%d, obtained mode %dx%dx%d (offset %d)\n",
- width, height, bpp,
- mode->w, mode->h, mode->format->BitsPerPixel, mode->offset);
-#endif
- mode->w = width;
- mode->h = height;
- SDL_SetClipRect(mode, NULL);
- }
- SDL_ResetCursor();
- SDL_UnlockCursor();
-
- /* If we failed setting a video mode, return NULL... (Uh Oh!) */
- if ( mode == NULL ) {
- return(NULL);
- }
-
- /* If there is no window manager, set the SDL_NOFRAME flag */
- if ( ! video->info.wm_available ) {
- mode->flags |= SDL_NOFRAME;
- }
-
- /* Reset the mouse cursor and grab for new video mode */
- SDL_SetCursor(NULL);
- if ( video->UpdateMouse ) {
- video->UpdateMouse(this);
- }
- SDL_WM_GrabInput(saved_grab);
- SDL_GetRelativeMouseState(NULL, NULL); /* Clear first large delta */
-
-#if SDL_VIDEO_OPENGL
- /* Load GL symbols (before MakeCurrent, where we need glGetString). */
- if ( flags & (SDL_OPENGL | SDL_OPENGLBLIT) ) {
-
-#if defined(__QNXNTO__) && (_NTO_VERSION < 630)
-#define __SDL_NOGETPROCADDR__
-#elif defined(__MINT__)
-#define __SDL_NOGETPROCADDR__
-#endif
-#ifdef __SDL_NOGETPROCADDR__
- #define SDL_PROC(ret,func,params) video->func=func;
-#else
- #define SDL_PROC(ret,func,params) \
- do { \
- video->func = SDL_GL_GetProcAddress(#func); \
- if ( ! video->func ) { \
- SDL_SetError("Couldn't load GL function %s: %s\n", #func, SDL_GetError()); \
- return(NULL); \
- } \
- } while ( 0 );
-
-#endif /* __SDL_NOGETPROCADDR__ */
-
-#include "SDL_glfuncs.h"
-#undef SDL_PROC
- }
-#endif /* SDL_VIDEO_OPENGL */
-
- /* If we're running OpenGL, make the context current */
- if ( (video->screen->flags & SDL_OPENGL) &&
- video->GL_MakeCurrent ) {
- if ( video->GL_MakeCurrent(this) < 0 ) {
- return(NULL);
- }
- }
-
- /* Set up a fake SDL surface for OpenGL "blitting" */
- if ( (flags & SDL_OPENGLBLIT) == SDL_OPENGLBLIT ) {
- /* Load GL functions for performing the texture updates */
-#if SDL_VIDEO_OPENGL
-
- /* Create a software surface for blitting */
-#ifdef GL_VERSION_1_2
- /* If the implementation either supports the packed pixels
- extension, or implements the core OpenGL 1.2 API, it will
- support the GL_UNSIGNED_SHORT_5_6_5 texture format.
- */
- if ( (bpp == 16) &&
- (SDL_strstr((const char *)video->glGetString(GL_EXTENSIONS), "GL_EXT_packed_pixels") ||
- (SDL_atof((const char *)video->glGetString(GL_VERSION)) >= 1.2f))
- ) {
- video->is_32bit = 0;
- SDL_VideoSurface = SDL_CreateRGBSurface(
- flags,
- width,
- height,
- 16,
- 31 << 11,
- 63 << 5,
- 31,
- 0
- );
- }
- else
-#endif /* OpenGL 1.2 */
- {
- video->is_32bit = 1;
- SDL_VideoSurface = SDL_CreateRGBSurface(
- flags,
- width,
- height,
- 32,
-#if SDL_BYTEORDER == SDL_LIL_ENDIAN
- 0x000000FF,
- 0x0000FF00,
- 0x00FF0000,
- 0xFF000000
-#else
- 0xFF000000,
- 0x00FF0000,
- 0x0000FF00,
- 0x000000FF
-#endif
- );
- }
- if ( ! SDL_VideoSurface ) {
- return(NULL);
- }
- SDL_VideoSurface->flags = mode->flags | SDL_OPENGLBLIT;
-
- /* Free the original video mode surface (is this safe?) */
- SDL_FreeSurface(mode);
-
- /* Set the surface completely opaque & white by default */
- SDL_memset( SDL_VideoSurface->pixels, 255, SDL_VideoSurface->h * SDL_VideoSurface->pitch );
- video->glGenTextures( 1, &video->texture );
- video->glBindTexture( GL_TEXTURE_2D, video->texture );
- video->glTexImage2D(
- GL_TEXTURE_2D,
- 0,
- video->is_32bit ? GL_RGBA : GL_RGB,
- 256,
- 256,
- 0,
- video->is_32bit ? GL_RGBA : GL_RGB,
-#ifdef GL_VERSION_1_2
- video->is_32bit ? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT_5_6_5,
-#else
- GL_UNSIGNED_BYTE,
-#endif
- NULL);
-
- video->UpdateRects = SDL_GL_UpdateRectsLock;
-#else
- SDL_SetError("Somebody forgot to #define SDL_VIDEO_OPENGL");
- return(NULL);
-#endif
- }
-
- /* Create a shadow surface if necessary */
- /* There are three conditions under which we create a shadow surface:
- 1. We need a particular bits-per-pixel that we didn't get.
- 2. We need a hardware palette and didn't get one.
- 3. We need a software surface and got a hardware surface.
- */
- if ( !(SDL_VideoSurface->flags & SDL_OPENGL) &&
- (
- ( !(flags&SDL_ANYFORMAT) &&
- (SDL_VideoSurface->format->BitsPerPixel != bpp)) ||
- ( (flags&SDL_HWPALETTE) &&
- !(SDL_VideoSurface->flags&SDL_HWPALETTE)) ||
- /* If the surface is in hardware, video writes are visible
- as soon as they are performed, so we need to buffer them
- */
- ( ((flags&SDL_HWSURFACE) == SDL_SWSURFACE) &&
- (SDL_VideoSurface->flags&SDL_HWSURFACE)) ||
- ( (flags&SDL_DOUBLEBUF) &&
- (SDL_VideoSurface->flags&SDL_HWSURFACE) &&
- !(SDL_VideoSurface->flags&SDL_DOUBLEBUF))
- ) ) {
- SDL_CreateShadowSurface(bpp);
- if ( SDL_ShadowSurface == NULL ) {
- SDL_SetError("Couldn't create shadow surface");
- return(NULL);
- }
- SDL_PublicSurface = SDL_ShadowSurface;
- } else {
- SDL_PublicSurface = SDL_VideoSurface;
- }
- video->info.vfmt = SDL_VideoSurface->format;
- video->info.current_w = SDL_VideoSurface->w;
- video->info.current_h = SDL_VideoSurface->h;
-
- /* We're done! */
- return(SDL_PublicSurface);
-}
-
-/*
- * Convert a surface into the video pixel format.
- */
-SDL_Surface * SDL_DisplayFormat (SDL_Surface *surface)
-{
- Uint32 flags;
-
- if ( ! SDL_PublicSurface ) {
- SDL_SetError("No video mode has been set");
- return(NULL);
- }
- /* Set the flags appropriate for copying to display surface */
- if (((SDL_PublicSurface->flags&SDL_HWSURFACE) == SDL_HWSURFACE) && current_video->info.blit_hw)
- flags = SDL_HWSURFACE;
- else
- flags = SDL_SWSURFACE;
-#ifdef AUTORLE_DISPLAYFORMAT
- flags |= (surface->flags & (SDL_SRCCOLORKEY|SDL_SRCALPHA));
- flags |= SDL_RLEACCELOK;
-#else
- flags |= surface->flags & (SDL_SRCCOLORKEY|SDL_SRCALPHA|SDL_RLEACCELOK);
-#endif
- return(SDL_ConvertSurface(surface, SDL_PublicSurface->format, flags));
-}
-
-/*
- * Convert a surface into a format that's suitable for blitting to
- * the screen, but including an alpha channel.
- */
-SDL_Surface *SDL_DisplayFormatAlpha(SDL_Surface *surface)
-{
- SDL_PixelFormat *vf;
- SDL_PixelFormat *format;
- SDL_Surface *converted;
- Uint32 flags;
- /* default to ARGB8888 */
- Uint32 amask = 0xff000000;
- Uint32 rmask = 0x00ff0000;
- Uint32 gmask = 0x0000ff00;
- Uint32 bmask = 0x000000ff;
-
- if ( ! SDL_PublicSurface ) {
- SDL_SetError("No video mode has been set");
- return(NULL);
- }
- vf = SDL_PublicSurface->format;
-
- switch(vf->BytesPerPixel) {
- case 2:
- /* For XGY5[56]5, use, AXGY8888, where {X, Y} = {R, B}.
- For anything else (like ARGB4444) it doesn't matter
- since we have no special code for it anyway */
- if ( (vf->Rmask == 0x1f) &&
- (vf->Bmask == 0xf800 || vf->Bmask == 0x7c00)) {
- rmask = 0xff;
- bmask = 0xff0000;
- }
- break;
-
- case 3:
- case 4:
- /* Keep the video format, as long as the high 8 bits are
- unused or alpha */
- if ( (vf->Rmask == 0xff) && (vf->Bmask == 0xff0000) ) {
- rmask = 0xff;
- bmask = 0xff0000;
- }
- break;
-
- default:
- /* We have no other optimised formats right now. When/if a new
- optimised alpha format is written, add the converter here */
- break;
- }
- format = SDL_AllocFormat(32, rmask, gmask, bmask, amask);
- flags = SDL_PublicSurface->flags & SDL_HWSURFACE;
- flags |= surface->flags & (SDL_SRCALPHA | SDL_RLEACCELOK);
- converted = SDL_ConvertSurface(surface, format, flags);
- SDL_FreeFormat(format);
- return(converted);
-}
-
-/*
- * Update a specific portion of the physical screen
- */
-void SDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h)
-{
- if ( screen ) {
- SDL_Rect rect;
-
- /* Perform some checking */
- if ( w == 0 )
- w = screen->w;
- if ( h == 0 )
- h = screen->h;
- if ( (int)(x+w) > screen->w )
- return;
- if ( (int)(y+h) > screen->h )
- return;
-
- /* Fill the rectangle */
- rect.x = (Sint16)x;
- rect.y = (Sint16)y;
- rect.w = (Uint16)w;
- rect.h = (Uint16)h;
- SDL_UpdateRects(screen, 1, &rect);
- }
-}
-void SDL_UpdateRects (SDL_Surface *screen, int numrects, SDL_Rect *rects)
-{
- int i;
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
-
- if ( (screen->flags & (SDL_OPENGL | SDL_OPENGLBLIT)) == SDL_OPENGL ) {
- SDL_SetError("OpenGL active, use SDL_GL_SwapBuffers()");
- return;
- }
- if ( screen == SDL_ShadowSurface ) {
- /* Blit the shadow surface using saved mapping */
- SDL_Palette *pal = screen->format->palette;
- SDL_Color *saved_colors = NULL;
- if ( pal && !(SDL_VideoSurface->flags & SDL_HWPALETTE) ) {
- /* simulated 8bpp, use correct physical palette */
- saved_colors = pal->colors;
- if ( video->gammacols ) {
- /* gamma-corrected palette */
- pal->colors = video->gammacols;
- } else if ( video->physpal ) {
- /* physical palette different from logical */
- pal->colors = video->physpal->colors;
- }
- }
- if ( SHOULD_DRAWCURSOR(SDL_cursorstate) ) {
- SDL_LockCursor();
- SDL_DrawCursor(SDL_ShadowSurface);
- for ( i=0; i<numrects; ++i ) {
- SDL_LowerBlit(SDL_ShadowSurface, &rects[i],
- SDL_VideoSurface, &rects[i]);
- }
- SDL_EraseCursor(SDL_ShadowSurface);
- SDL_UnlockCursor();
- } else {
- for ( i=0; i<numrects; ++i ) {
- SDL_LowerBlit(SDL_ShadowSurface, &rects[i],
- SDL_VideoSurface, &rects[i]);
- }
- }
- if ( saved_colors ) {
- pal->colors = saved_colors;
- }
-
- /* Fall through to video surface update */
- screen = SDL_VideoSurface;
- }
- if ( screen == SDL_VideoSurface ) {
- /* Update the video surface */
- if ( screen->offset ) {
- for ( i=0; i<numrects; ++i ) {
- rects[i].x += video->offset_x;
- rects[i].y += video->offset_y;
- }
- video->UpdateRects(this, numrects, rects);
- for ( i=0; i<numrects; ++i ) {
- rects[i].x -= video->offset_x;
- rects[i].y -= video->offset_y;
- }
- } else {
- video->UpdateRects(this, numrects, rects);
- }
- }
-}
-
-/*
- * Performs hardware double buffering, if possible, or a full update if not.
- */
-int SDL_Flip(SDL_Surface *screen)
-{
- SDL_VideoDevice *video = current_video;
- /* Copy the shadow surface to the video surface */
- if ( screen == SDL_ShadowSurface ) {
- SDL_Rect rect;
- SDL_Palette *pal = screen->format->palette;
- SDL_Color *saved_colors = NULL;
- if ( pal && !(SDL_VideoSurface->flags & SDL_HWPALETTE) ) {
- /* simulated 8bpp, use correct physical palette */
- saved_colors = pal->colors;
- if ( video->gammacols ) {
- /* gamma-corrected palette */
- pal->colors = video->gammacols;
- } else if ( video->physpal ) {
- /* physical palette different from logical */
- pal->colors = video->physpal->colors;
- }
- }
-
- rect.x = 0;
- rect.y = 0;
- rect.w = screen->w;
- rect.h = screen->h;
- if ( SHOULD_DRAWCURSOR(SDL_cursorstate) ) {
- SDL_LockCursor();
- SDL_DrawCursor(SDL_ShadowSurface);
- SDL_LowerBlit(SDL_ShadowSurface, &rect,
- SDL_VideoSurface, &rect);
- SDL_EraseCursor(SDL_ShadowSurface);
- SDL_UnlockCursor();
- } else {
- SDL_LowerBlit(SDL_ShadowSurface, &rect,
- SDL_VideoSurface, &rect);
- }
- if ( saved_colors ) {
- pal->colors = saved_colors;
- }
-
- /* Fall through to video surface update */
- screen = SDL_VideoSurface;
- }
- if ( (screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
- SDL_VideoDevice *this = current_video;
- return(video->FlipHWSurface(this, SDL_VideoSurface));
- } else {
- SDL_UpdateRect(screen, 0, 0, 0, 0);
- }
- return(0);
-}
-
-static void SetPalette_logical(SDL_Surface *screen, SDL_Color *colors,
- int firstcolor, int ncolors)
-{
- SDL_Palette *pal = screen->format->palette;
- SDL_Palette *vidpal;
-
- if ( colors != (pal->colors + firstcolor) ) {
- SDL_memcpy(pal->colors + firstcolor, colors,
- ncolors * sizeof(*colors));
- }
-
- if ( current_video && SDL_VideoSurface ) {
- vidpal = SDL_VideoSurface->format->palette;
- if ( (screen == SDL_ShadowSurface) && vidpal ) {
- /*
- * This is a shadow surface, and the physical
- * framebuffer is also indexed. Propagate the
- * changes to its logical palette so that
- * updates are always identity blits
- */
- SDL_memcpy(vidpal->colors + firstcolor, colors,
- ncolors * sizeof(*colors));
- }
- }
- SDL_FormatChanged(screen);
-}
-
-static int SetPalette_physical(SDL_Surface *screen,
- SDL_Color *colors, int firstcolor, int ncolors)
-{
- SDL_VideoDevice *video = current_video;
- int gotall = 1;
-
- if ( video->physpal ) {
- /* We need to copy the new colors, since we haven't
- * already done the copy in the logical set above.
- */
- SDL_memcpy(video->physpal->colors + firstcolor,
- colors, ncolors * sizeof(*colors));
- }
- if ( screen == SDL_ShadowSurface ) {
- if ( SDL_VideoSurface->flags & SDL_HWPALETTE ) {
- /*
- * The real screen is also indexed - set its physical
- * palette. The physical palette does not include the
- * gamma modification, we apply it directly instead,
- * but this only happens if we have hardware palette.
- */
- screen = SDL_VideoSurface;
- } else {
- /*
- * The video surface is not indexed - invalidate any
- * active shadow-to-video blit mappings.
- */
- if ( screen->map->dst == SDL_VideoSurface ) {
- SDL_InvalidateMap(screen->map);
- }
- if ( video->gamma ) {
- if( ! video->gammacols ) {
- SDL_Palette *pp = video->physpal;
- if(!pp)
- pp = screen->format->palette;
- video->gammacols = SDL_malloc(pp->ncolors
- * sizeof(SDL_Color));
- SDL_ApplyGamma(video->gamma,
- pp->colors,
- video->gammacols,
- pp->ncolors);
- } else {
- SDL_ApplyGamma(video->gamma, colors,
- video->gammacols
- + firstcolor,
- ncolors);
- }
- }
- SDL_UpdateRect(screen, 0, 0, 0, 0);
- }
- }
-
- if ( screen == SDL_VideoSurface ) {
- SDL_Color gcolors[256];
-
- if ( video->gamma ) {
- SDL_ApplyGamma(video->gamma, colors, gcolors, ncolors);
- colors = gcolors;
- }
- gotall = video->SetColors(video, firstcolor, ncolors, colors);
- if ( ! gotall ) {
- /* The video flags shouldn't have SDL_HWPALETTE, and
- the video driver is responsible for copying back the
- correct colors into the video surface palette.
- */
- ;
- }
- SDL_CursorPaletteChanged();
- }
- return gotall;
-}
-
-/*
- * Set the physical and/or logical colormap of a surface:
- * Only the screen has a physical colormap. It determines what is actually
- * sent to the display.
- * The logical colormap is used to map blits to/from the surface.
- * 'which' is one or both of SDL_LOGPAL, SDL_PHYSPAL
- *
- * Return nonzero if all colours were set as requested, or 0 otherwise.
- */
-int SDL_SetPalette(SDL_Surface *screen, int which,
- SDL_Color *colors, int firstcolor, int ncolors)
-{
- SDL_Palette *pal;
- int gotall;
- int palsize;
-
- if ( !screen ) {
- return 0;
- }
- if ( !current_video || screen != SDL_PublicSurface ) {
- /* only screens have physical palettes */
- which &= ~SDL_PHYSPAL;
- } else if ( (screen->flags & SDL_HWPALETTE) != SDL_HWPALETTE ) {
- /* hardware palettes required for split colormaps */
- which |= SDL_PHYSPAL | SDL_LOGPAL;
- }
-
- /* Verify the parameters */
- pal = screen->format->palette;
- if( !pal ) {
- return 0; /* not a palettized surface */
- }
- gotall = 1;
- palsize = 1 << screen->format->BitsPerPixel;
- if ( ncolors > (palsize - firstcolor) ) {
- ncolors = (palsize - firstcolor);
- gotall = 0;
- }
-
- if ( which & SDL_LOGPAL ) {
- /*
- * Logical palette change: The actual screen isn't affected,
- * but the internal colormap is altered so that the
- * interpretation of the pixel values (for blits etc) is
- * changed.
- */
- SetPalette_logical(screen, colors, firstcolor, ncolors);
- }
- if ( which & SDL_PHYSPAL ) {
- SDL_VideoDevice *video = current_video;
- /*
- * Physical palette change: This doesn't affect the
- * program's idea of what the screen looks like, but changes
- * its actual appearance.
- */
- if ( !video->physpal && !(which & SDL_LOGPAL) ) {
- /* Lazy physical palette allocation */
- int size;
- SDL_Palette *pp = SDL_malloc(sizeof(*pp));
- if ( !pp ) {
- return 0;
- }
- video->physpal = pp;
- pp->ncolors = pal->ncolors;
- size = pp->ncolors * sizeof(SDL_Color);
- pp->colors = SDL_malloc(size);
- if ( !pp->colors ) {
- return 0;
- }
- SDL_memcpy(pp->colors, pal->colors, size);
- }
- if ( ! SetPalette_physical(screen,
- colors, firstcolor, ncolors) ) {
- gotall = 0;
- }
- }
- return gotall;
-}
-
-int SDL_SetColors(SDL_Surface *screen, SDL_Color *colors, int firstcolor,
- int ncolors)
-{
- return SDL_SetPalette(screen, SDL_LOGPAL | SDL_PHYSPAL,
- colors, firstcolor, ncolors);
-}
-
-/*
- * Clean up the video subsystem
- */
-void SDL_VideoQuit (void)
-{
- SDL_Surface *ready_to_go;
-
- if ( current_video ) {
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
-
- /* Halt event processing before doing anything else */
- SDL_StopEventLoop();
-
- /* Clean up allocated window manager items */
- if ( SDL_PublicSurface ) {
- SDL_PublicSurface = NULL;
- }
- SDL_CursorQuit();
-
- /* Just in case... */
- SDL_WM_GrabInputOff();
-
- /* Clean up the system video */
- video->VideoQuit(this);
-
- /* Free any lingering surfaces */
- ready_to_go = SDL_ShadowSurface;
- SDL_ShadowSurface = NULL;
- SDL_FreeSurface(ready_to_go);
- if ( SDL_VideoSurface != NULL ) {
- ready_to_go = SDL_VideoSurface;
- SDL_VideoSurface = NULL;
- SDL_FreeSurface(ready_to_go);
- }
- SDL_PublicSurface = NULL;
-
- /* Clean up miscellaneous memory */
- if ( video->physpal ) {
- SDL_free(video->physpal->colors);
- SDL_free(video->physpal);
- video->physpal = NULL;
- }
- if ( video->gammacols ) {
- SDL_free(video->gammacols);
- video->gammacols = NULL;
- }
- if ( video->gamma ) {
- SDL_free(video->gamma);
- video->gamma = NULL;
- }
- if ( video->wm_title != NULL ) {
- SDL_free(video->wm_title);
- video->wm_title = NULL;
- }
- if ( video->wm_icon != NULL ) {
- SDL_free(video->wm_icon);
- video->wm_icon = NULL;
- }
-
- /* Finish cleaning up video subsystem */
- video->free(this);
- current_video = NULL;
- }
- return;
-}
-
-/* Load the GL driver library */
-int SDL_GL_LoadLibrary(const char *path)
-{
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
- int retval;
-
- retval = -1;
- if ( video == NULL ) {
- SDL_SetError("Video subsystem has not been initialized");
- } else {
- if ( video->GL_LoadLibrary ) {
- retval = video->GL_LoadLibrary(this, path);
- } else {
- SDL_SetError("No dynamic GL support in video driver");
- }
- }
- return(retval);
-}
-
-void *SDL_GL_GetProcAddress(const char* proc)
-{
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
- void *func;
-
- func = NULL;
- if ( video->GL_GetProcAddress ) {
- if ( video->gl_config.driver_loaded ) {
- func = video->GL_GetProcAddress(this, proc);
- } else {
- SDL_SetError("No GL driver has been loaded");
- }
- } else {
- SDL_SetError("No dynamic GL support in video driver");
- }
- return func;
-}
-
-/* Set the specified GL attribute for setting up a GL video mode */
-int SDL_GL_SetAttribute( SDL_GLattr attr, int value )
-{
- int retval;
- SDL_VideoDevice *video = current_video;
-
- retval = 0;
- switch (attr) {
- case SDL_GL_RED_SIZE:
- video->gl_config.red_size = value;
- break;
- case SDL_GL_GREEN_SIZE:
- video->gl_config.green_size = value;
- break;
- case SDL_GL_BLUE_SIZE:
- video->gl_config.blue_size = value;
- break;
- case SDL_GL_ALPHA_SIZE:
- video->gl_config.alpha_size = value;
- break;
- case SDL_GL_DOUBLEBUFFER:
- video->gl_config.double_buffer = value;
- break;
- case SDL_GL_BUFFER_SIZE:
- video->gl_config.buffer_size = value;
- break;
- case SDL_GL_DEPTH_SIZE:
- video->gl_config.depth_size = value;
- break;
- case SDL_GL_STENCIL_SIZE:
- video->gl_config.stencil_size = value;
- break;
- case SDL_GL_ACCUM_RED_SIZE:
- video->gl_config.accum_red_size = value;
- break;
- case SDL_GL_ACCUM_GREEN_SIZE:
- video->gl_config.accum_green_size = value;
- break;
- case SDL_GL_ACCUM_BLUE_SIZE:
- video->gl_config.accum_blue_size = value;
- break;
- case SDL_GL_ACCUM_ALPHA_SIZE:
- video->gl_config.accum_alpha_size = value;
- break;
- case SDL_GL_STEREO:
- video->gl_config.stereo = value;
- break;
- case SDL_GL_MULTISAMPLEBUFFERS:
- video->gl_config.multisamplebuffers = value;
- break;
- case SDL_GL_MULTISAMPLESAMPLES:
- video->gl_config.multisamplesamples = value;
- break;
- case SDL_GL_ACCELERATED_VISUAL:
- video->gl_config.accelerated = value;
- break;
- case SDL_GL_SWAP_CONTROL:
- video->gl_config.swap_control = value;
- break;
- default:
- SDL_SetError("Unknown OpenGL attribute");
- retval = -1;
- break;
- }
- return(retval);
-}
-
-/* Retrieve an attribute value from the windowing system. */
-int SDL_GL_GetAttribute(SDL_GLattr attr, int* value)
-{
- int retval = -1;
- SDL_VideoDevice* video = current_video;
- SDL_VideoDevice* this = current_video;
-
- if ( video->GL_GetAttribute ) {
- retval = this->GL_GetAttribute(this, attr, value);
- } else {
- *value = 0;
- SDL_SetError("GL_GetAttribute not supported");
- }
- return retval;
-}
-
-/* Perform a GL buffer swap on the current GL context */
-void SDL_GL_SwapBuffers(void)
-{
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
-
- if ( video->screen->flags & SDL_OPENGL ) {
- video->GL_SwapBuffers(this);
- } else {
- SDL_SetError("OpenGL video mode has not been set");
- }
-}
-
-/* Update rects with locking */
-void SDL_GL_UpdateRectsLock(SDL_VideoDevice* this, int numrects, SDL_Rect *rects)
-{
- SDL_GL_Lock();
- SDL_GL_UpdateRects(numrects, rects);
- SDL_GL_Unlock();
-}
-
-/* Update rects without state setting and changing (the caller is responsible for it) */
-void SDL_GL_UpdateRects(int numrects, SDL_Rect *rects)
-{
-#if SDL_VIDEO_OPENGL
- SDL_VideoDevice *this = current_video;
- SDL_Rect update, tmp;
- int x, y, i;
-
- for ( i = 0; i < numrects; i++ )
- {
- tmp.y = rects[i].y;
- tmp.h = rects[i].h;
- for ( y = 0; y <= rects[i].h / 256; y++ )
- {
- tmp.x = rects[i].x;
- tmp.w = rects[i].w;
- for ( x = 0; x <= rects[i].w / 256; x++ )
- {
- update.x = tmp.x;
- update.y = tmp.y;
- update.w = tmp.w;
- update.h = tmp.h;
-
- if ( update.w > 256 )
- update.w = 256;
-
- if ( update.h > 256 )
- update.h = 256;
-
- this->glFlush();
- this->glTexSubImage2D(
- GL_TEXTURE_2D,
- 0,
- 0,
- 0,
- update.w,
- update.h,
- this->is_32bit? GL_RGBA : GL_RGB,
-#ifdef GL_VERSION_1_2
- this->is_32bit ? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT_5_6_5,
-#else
- GL_UNSIGNED_BYTE,
-#endif
- (Uint8 *)this->screen->pixels +
- this->screen->format->BytesPerPixel * update.x +
- update.y * this->screen->pitch );
-
- this->glFlush();
- /*
- * Note the parens around the function name:
- * This is because some OpenGL implementations define glTexCoord etc
- * as macros, and we don't want them expanded here.
- */
- this->glBegin(GL_TRIANGLE_STRIP);
- (this->glTexCoord2f)( 0.0, 0.0 );
- (this->glVertex2i)( update.x, update.y );
- (this->glTexCoord2f)( (float)(update.w / 256.0), 0.0 );
- (this->glVertex2i)( update.x + update.w, update.y );
- (this->glTexCoord2f)( 0.0, (float)(update.h / 256.0) );
- (this->glVertex2i)( update.x, update.y + update.h );
- (this->glTexCoord2f)( (float)(update.w / 256.0), (float)(update.h / 256.0) );
- (this->glVertex2i)( update.x + update.w , update.y + update.h );
- this->glEnd();
-
- tmp.x += 256;
- tmp.w -= 256;
- }
- tmp.y += 256;
- tmp.h -= 256;
- }
- }
-#endif
-}
-
-/* Lock == save current state */
-void SDL_GL_Lock()
-{
-#if SDL_VIDEO_OPENGL
- lock_count--;
- if (lock_count==-1)
- {
- SDL_VideoDevice *this = current_video;
-
- this->glPushAttrib( GL_ALL_ATTRIB_BITS ); /* TODO: narrow range of what is saved */
-#ifdef GL_CLIENT_PIXEL_STORE_BIT
- this->glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT );
-#endif
-
- this->glEnable(GL_TEXTURE_2D);
- this->glEnable(GL_BLEND);
- this->glDisable(GL_FOG);
- this->glDisable(GL_ALPHA_TEST);
- this->glDisable(GL_DEPTH_TEST);
- this->glDisable(GL_SCISSOR_TEST);
- this->glDisable(GL_STENCIL_TEST);
- this->glDisable(GL_CULL_FACE);
-
- this->glBindTexture( GL_TEXTURE_2D, this->texture );
- this->glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
- this->glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
- this->glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
- this->glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
- this->glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
-
- this->glPixelStorei( GL_UNPACK_ROW_LENGTH, this->screen->pitch / this->screen->format->BytesPerPixel );
- this->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- (this->glColor4f)(1.0, 1.0, 1.0, 1.0); /* Solaris workaround */
-
- this->glViewport(0, 0, this->screen->w, this->screen->h);
- this->glMatrixMode(GL_PROJECTION);
- this->glPushMatrix();
- this->glLoadIdentity();
-
- this->glOrtho(0.0, (GLdouble) this->screen->w, (GLdouble) this->screen->h, 0.0, 0.0, 1.0);
-
- this->glMatrixMode(GL_MODELVIEW);
- this->glPushMatrix();
- this->glLoadIdentity();
- }
-#endif
-}
-
-/* Unlock == restore saved state */
-void SDL_GL_Unlock()
-{
-#if SDL_VIDEO_OPENGL
- lock_count++;
- if (lock_count==0)
- {
- SDL_VideoDevice *this = current_video;
-
- this->glPopMatrix();
- this->glMatrixMode(GL_PROJECTION);
- this->glPopMatrix();
-
- this->glPopClientAttrib();
- this->glPopAttrib();
- }
-#endif
-}
-
-/*
- * Sets/Gets the title and icon text of the display window, if any.
- */
-void SDL_WM_SetCaption (const char *title, const char *icon)
-{
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
-
- if ( video ) {
- if ( title ) {
- if ( video->wm_title ) {
- SDL_free(video->wm_title);
- }
- video->wm_title = SDL_strdup(title);
- }
- if ( icon ) {
- if ( video->wm_icon ) {
- SDL_free(video->wm_icon);
- }
- video->wm_icon = SDL_strdup(icon);
- }
- if ( (title || icon) && (video->SetCaption != NULL) ) {
- video->SetCaption(this, video->wm_title,video->wm_icon);
- }
- }
-}
-void SDL_WM_GetCaption (char **title, char **icon)
-{
- SDL_VideoDevice *video = current_video;
-
- if ( video ) {
- if ( title ) {
- *title = video->wm_title;
- }
- if ( icon ) {
- *icon = video->wm_icon;
- }
- }
-}
-
-/* Utility function used by SDL_WM_SetIcon();
- * flags & 1 for color key, flags & 2 for alpha channel. */
-static void CreateMaskFromColorKeyOrAlpha(SDL_Surface *icon, Uint8 *mask, int flags)
-{
- int x, y;
- Uint32 colorkey;
-#define SET_MASKBIT(icon, x, y, mask) \
- mask[(y*((icon->w+7)/8))+(x/8)] &= ~(0x01<<(7-(x%8)))
-
- colorkey = icon->format->colorkey;
- switch (icon->format->BytesPerPixel) {
- case 1: { Uint8 *pixels;
- for ( y=0; y<icon->h; ++y ) {
- pixels = (Uint8 *)icon->pixels + y*icon->pitch;
- for ( x=0; x<icon->w; ++x ) {
- if ( *pixels++ == colorkey ) {
- SET_MASKBIT(icon, x, y, mask);
- }
- }
- }
- }
- break;
-
- case 2: { Uint16 *pixels;
- for ( y=0; y<icon->h; ++y ) {
- pixels = (Uint16 *)icon->pixels +
- y*icon->pitch/2;
- for ( x=0; x<icon->w; ++x ) {
- if ( (flags & 1) && *pixels == colorkey ) {
- SET_MASKBIT(icon, x, y, mask);
- } else if((flags & 2) && (*pixels & icon->format->Amask) == 0) {
- SET_MASKBIT(icon, x, y, mask);
- }
- pixels++;
- }
- }
- }
- break;
-
- case 4: { Uint32 *pixels;
- for ( y=0; y<icon->h; ++y ) {
- pixels = (Uint32 *)icon->pixels +
- y*icon->pitch/4;
- for ( x=0; x<icon->w; ++x ) {
- if ( (flags & 1) && *pixels == colorkey ) {
- SET_MASKBIT(icon, x, y, mask);
- } else if((flags & 2) && (*pixels & icon->format->Amask) == 0) {
- SET_MASKBIT(icon, x, y, mask);
- }
- pixels++;
- }
- }
- }
- break;
- }
-}
-
-/*
- * Sets the window manager icon for the display window.
- */
-void SDL_WM_SetIcon (SDL_Surface *icon, Uint8 *mask)
-{
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
-
- if ( icon && video->SetIcon ) {
- /* Generate a mask if necessary, and create the icon! */
- if ( mask == NULL ) {
- int mask_len = icon->h*(icon->w+7)/8;
- int flags = 0;
- mask = (Uint8 *)SDL_malloc(mask_len);
- if ( mask == NULL ) {
- return;
- }
- SDL_memset(mask, ~0, mask_len);
- if ( icon->flags & SDL_SRCCOLORKEY ) flags |= 1;
- if ( icon->flags & SDL_SRCALPHA ) flags |= 2;
- if( flags ) {
- CreateMaskFromColorKeyOrAlpha(icon, mask, flags);
- }
- video->SetIcon(video, icon, mask);
- SDL_free(mask);
- } else {
- video->SetIcon(this, icon, mask);
- }
- }
-}
-
-/*
- * Grab or ungrab the keyboard and mouse input.
- * This function returns the final grab mode after calling the
- * driver dependent function.
- */
-static SDL_GrabMode SDL_WM_GrabInputRaw(SDL_GrabMode mode)
-{
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
-
- /* Only do something if we have support for grabs */
- if ( video->GrabInput == NULL ) {
- return(video->input_grab);
- }
-
- /* If the final grab mode if off, only then do we actually grab */
-#ifdef DEBUG_GRAB
- printf("SDL_WM_GrabInputRaw(%d) ... ", mode);
-#endif
- if ( mode == SDL_GRAB_OFF ) {
- if ( video->input_grab != SDL_GRAB_OFF ) {
- mode = video->GrabInput(this, mode);
- }
- } else {
- if ( video->input_grab == SDL_GRAB_OFF ) {
- mode = video->GrabInput(this, mode);
- }
- }
- if ( mode != video->input_grab ) {
- video->input_grab = mode;
- if ( video->CheckMouseMode ) {
- video->CheckMouseMode(this);
- }
- }
-#ifdef DEBUG_GRAB
- printf("Final mode %d\n", video->input_grab);
-#endif
-
- /* Return the final grab state */
- if ( mode >= SDL_GRAB_FULLSCREEN ) {
- mode -= SDL_GRAB_FULLSCREEN;
- }
- return(mode);
-}
-SDL_GrabMode SDL_WM_GrabInput(SDL_GrabMode mode)
-{
- SDL_VideoDevice *video = current_video;
-
- /* If the video isn't initialized yet, we can't do anything */
- if ( ! video ) {
- return SDL_GRAB_OFF;
- }
-
- /* Return the current mode on query */
- if ( mode == SDL_GRAB_QUERY ) {
- mode = video->input_grab;
- if ( mode >= SDL_GRAB_FULLSCREEN ) {
- mode -= SDL_GRAB_FULLSCREEN;
- }
- return(mode);
- }
-
-#ifdef DEBUG_GRAB
- printf("SDL_WM_GrabInput(%d) ... ", mode);
-#endif
- /* If the video surface is fullscreen, we always grab */
- if ( mode >= SDL_GRAB_FULLSCREEN ) {
- mode -= SDL_GRAB_FULLSCREEN;
- }
- if ( SDL_VideoSurface && (SDL_VideoSurface->flags & SDL_FULLSCREEN) ) {
- mode += SDL_GRAB_FULLSCREEN;
- }
- return(SDL_WM_GrabInputRaw(mode));
-}
-static SDL_GrabMode SDL_WM_GrabInputOff(void)
-{
- SDL_GrabMode mode;
-
- /* First query the current grab state */
- mode = SDL_WM_GrabInput(SDL_GRAB_QUERY);
-
- /* Now explicitly turn off input grab */
- SDL_WM_GrabInputRaw(SDL_GRAB_OFF);
-
- /* Return the old state */
- return(mode);
-}
-
-/*
- * Iconify the window in window managed environments.
- * A successful iconification will result in an SDL_APPACTIVE loss event.
- */
-int SDL_WM_IconifyWindow(void)
-{
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
- int retval;
-
- retval = 0;
- if ( video->IconifyWindow ) {
- retval = video->IconifyWindow(this);
- }
- return(retval);
-}
-
-/*
- * Toggle fullscreen mode
- */
-int SDL_WM_ToggleFullScreen(SDL_Surface *surface)
-{
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
- int toggled;
-
- toggled = 0;
- if ( SDL_PublicSurface && (surface == SDL_PublicSurface) &&
- video->ToggleFullScreen ) {
- if ( surface->flags & SDL_FULLSCREEN ) {
- toggled = video->ToggleFullScreen(this, 0);
- if ( toggled ) {
- SDL_VideoSurface->flags &= ~SDL_FULLSCREEN;
- SDL_PublicSurface->flags &= ~SDL_FULLSCREEN;
- }
- } else {
- toggled = video->ToggleFullScreen(this, 1);
- if ( toggled ) {
- SDL_VideoSurface->flags |= SDL_FULLSCREEN;
- SDL_PublicSurface->flags |= SDL_FULLSCREEN;
- }
- }
- /* Double-check the grab state inside SDL_WM_GrabInput() */
- if ( toggled ) {
- SDL_WM_GrabInput(video->input_grab);
- }
- }
- return(toggled);
-}
-
-/*
- * Set window position
- */
-void SDL_WM_SetPos(int x, int y)
-{
- SDL_VideoDevice* video = current_video;
-
- if (video && video->SetWindowPos)
- video->SetWindowPos(video, x, y);
-}
-
-/*
- * Get window position
- */
-void SDL_WM_GetPos(int *px, int *py)
-{
- SDL_VideoDevice* video = current_video;
-
- if (video && video->GetWindowPos)
- video->GetWindowPos(video, px, py);
- else {
- *px = 100;
- *py = 100;
- }
-}
-
-int SDL_WM_IsFullyVisible( int recenter )
-{
- int result = 1;
-
- SDL_VideoDevice* video = current_video;
-
- if (video && video->IsWindowVisible) {
- result = video->IsWindowVisible(video, recenter);
- }
- return result;
-}
-
-int SDL_WM_GetMonitorDPI( int *xDpi, int *yDpi )
-{
- int result = -1;
- SDL_VideoDevice* video = current_video;
-
- if (video && video->GetMonitorDPI) {
- result = video->GetMonitorDPI(video, xDpi, yDpi);
- }
- return result;
-}
-
-int SDL_WM_GetMonitorRect( SDL_Rect *rect )
-{
- int result = -1;
- SDL_VideoDevice* video = current_video;
-
- if (video && video->GetMonitorRect) {
- result = video->GetMonitorRect(video, rect);
- }
- return result;
-}
-
-/*
- * Get some platform dependent window manager information
- */
-int SDL_GetWMInfo (SDL_SysWMinfo *info)
-{
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
-
- if ( video && video->GetWMInfo ) {
- return(video->GetWMInfo(this, info));
- } else {
- return(0);
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/SDL_yuv.c b/distrib/sdl-1.2.12/src/video/SDL_yuv.c
deleted file mode 100644
index 1136ceb..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_yuv.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This is the implementation of the YUV video surface support */
-
-#include "SDL_video.h"
-#include "SDL_sysvideo.h"
-#include "SDL_yuvfuncs.h"
-#include "SDL_yuv_sw_c.h"
-
-
-SDL_Overlay *SDL_CreateYUVOverlay(int w, int h, Uint32 format,
- SDL_Surface *display)
-{
- SDL_VideoDevice *video = current_video;
- SDL_VideoDevice *this = current_video;
- const char *yuv_hwaccel;
- SDL_Overlay *overlay;
-
- if ( (display->flags & SDL_OPENGL) == SDL_OPENGL ) {
- SDL_SetError("YUV overlays are not supported in OpenGL mode");
- return NULL;
- }
-
- /* Display directly on video surface, if possible */
- if ( SDL_getenv("SDL_VIDEO_YUV_DIRECT") ) {
- if ( (display == SDL_PublicSurface) &&
- ((SDL_VideoSurface->format->BytesPerPixel == 2) ||
- (SDL_VideoSurface->format->BytesPerPixel == 4)) ) {
- display = SDL_VideoSurface;
- }
- }
- overlay = NULL;
- yuv_hwaccel = SDL_getenv("SDL_VIDEO_YUV_HWACCEL");
- if ( ((display == SDL_VideoSurface) && video->CreateYUVOverlay) &&
- (!yuv_hwaccel || (SDL_atoi(yuv_hwaccel) > 0)) ) {
- overlay = video->CreateYUVOverlay(this, w, h, format, display);
- }
- /* If hardware YUV overlay failed ... */
- if ( overlay == NULL ) {
- overlay = SDL_CreateYUV_SW(this, w, h, format, display);
- }
- return overlay;
-}
-
-int SDL_LockYUVOverlay(SDL_Overlay *overlay)
-{
- if ( overlay == NULL ) {
- SDL_SetError("Passed NULL overlay");
- return -1;
- }
- return overlay->hwfuncs->Lock(current_video, overlay);
-}
-
-void SDL_UnlockYUVOverlay(SDL_Overlay *overlay)
-{
- if ( overlay == NULL ) {
- return;
- }
- overlay->hwfuncs->Unlock(current_video, overlay);
-}
-
-int SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect)
-{
- SDL_Rect src, dst;
- int srcx, srcy, srcw, srch;
- int dstx, dsty, dstw, dsth;
-
- if ( overlay == NULL || dstrect == NULL ) {
- SDL_SetError("Passed NULL overlay or dstrect");
- return -1;
- }
-
- /* Clip the rectangle to the screen area */
- srcx = 0;
- srcy = 0;
- srcw = overlay->w;
- srch = overlay->h;
- dstx = dstrect->x;
- dsty = dstrect->y;
- dstw = dstrect->w;
- dsth = dstrect->h;
- if ( dstx < 0 ) {
- srcw += (dstx * overlay->w) / dstrect->w;
- dstw += dstx;
- srcx -= (dstx * overlay->w) / dstrect->w;
- dstx = 0;
- }
- if ( (dstx+dstw) > current_video->screen->w ) {
- int extra = (dstx+dstw - current_video->screen->w);
- srcw -= (extra * overlay->w) / dstrect->w;
- dstw -= extra;
- }
- if ( dsty < 0 ) {
- srch += (dsty * overlay->h) / dstrect->h;
- dsth += dsty;
- srcy -= (dsty * overlay->h) / dstrect->h;
- dsty = 0;
- }
- if ( (dsty+dsth) > current_video->screen->h ) {
- int extra = (dsty+dsth - current_video->screen->h);
- srch -= (extra * overlay->h) / dstrect->h;
- dsth -= extra;
- }
- if ( srcw <= 0 || srch <= 0 ||
- srch <= 0 || dsth <= 0 ) {
- return 0;
- }
- /* Ugh, I can't wait for SDL_Rect to be int values */
- src.x = srcx;
- src.y = srcy;
- src.w = srcw;
- src.h = srch;
- dst.x = dstx;
- dst.y = dsty;
- dst.w = dstw;
- dst.h = dsth;
- return overlay->hwfuncs->Display(current_video, overlay, &src, &dst);
-}
-
-void SDL_FreeYUVOverlay(SDL_Overlay *overlay)
-{
- if ( overlay == NULL ) {
- return;
- }
- if ( overlay->hwfuncs ) {
- overlay->hwfuncs->FreeHW(current_video, overlay);
- }
- SDL_free(overlay);
-}
diff --git a/distrib/sdl-1.2.12/src/video/SDL_yuv_mmx.c b/distrib/sdl-1.2.12/src/video/SDL_yuv_mmx.c
deleted file mode 100644
index 059dd50..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_yuv_mmx.c
+++ /dev/null
@@ -1,428 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
-
-#include "SDL_stdinc.h"
-
-#include "mmx.h"
-
-/* *INDENT-OFF* */
-
-static mmx_t MMX_0080w = { .ud = {0x00800080, 0x00800080} };
-static mmx_t MMX_00FFw = { .ud = {0x00ff00ff, 0x00ff00ff} };
-static mmx_t MMX_FF00w = { .ud = {0xff00ff00, 0xff00ff00} };
-
-static mmx_t MMX_Ycoeff = { .uw = {0x004a, 0x004a, 0x004a, 0x004a} };
-
-static mmx_t MMX_UbluRGB = { .uw = {0x0072, 0x0072, 0x0072, 0x0072} };
-static mmx_t MMX_VredRGB = { .uw = {0x0059, 0x0059, 0x0059, 0x0059} };
-static mmx_t MMX_UgrnRGB = { .uw = {0xffea, 0xffea, 0xffea, 0xffea} };
-static mmx_t MMX_VgrnRGB = { .uw = {0xffd2, 0xffd2, 0xffd2, 0xffd2} };
-
-static mmx_t MMX_Ublu5x5 = { .uw = {0x0081, 0x0081, 0x0081, 0x0081} };
-static mmx_t MMX_Vred5x5 = { .uw = {0x0066, 0x0066, 0x0066, 0x0066} };
-static mmx_t MMX_Ugrn565 = { .uw = {0xffe8, 0xffe8, 0xffe8, 0xffe8} };
-static mmx_t MMX_Vgrn565 = { .uw = {0xffcd, 0xffcd, 0xffcd, 0xffcd} };
-
-static mmx_t MMX_red565 = { .uw = {0xf800, 0xf800, 0xf800, 0xf800} };
-static mmx_t MMX_grn565 = { .uw = {0x07e0, 0x07e0, 0x07e0, 0x07e0} };
-
-/**
- This MMX assembler is my first assembler/MMX program ever.
- Thus it maybe buggy.
- Send patches to:
- mvogt@rhrk.uni-kl.de
-
- After it worked fine I have "obfuscated" the code a bit to have
- more parallism in the MMX units. This means I moved
- initilisation around and delayed other instruction.
- Performance measurement did not show that this brought any advantage
- but in theory it _should_ be faster this way.
-
- The overall performanve gain to the C based dither was 30%-40%.
- The MMX routine calculates 256bit=8RGB values in each cycle
- (4 for row1 & 4 for row2)
-
- The red/green/blue.. coefficents are taken from the mpeg_play
- player. They look nice, but I dont know if you can have
- better values, to avoid integer rounding errors.
-
-
- IMPORTANT:
- ==========
-
- It is a requirement that the cr/cb/lum are 8 byte aligned and
- the out are 16byte aligned or you will/may get segfaults
-
-*/
-
-void ColorRGBDitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod )
-{
- Uint32 *row1;
- Uint32 *row2;
-
- unsigned char* y = lum +cols*rows; // Pointer to the end
- int x = 0;
- row1 = (Uint32 *)out; // 32 bit target
- row2 = (Uint32 *)out+cols+mod; // start of second row
- mod = (mod+cols+mod)*4; // increment for row1 in byte
-
- __asm__ __volatile__ (
- // tap dance to workaround the inability to use %%ebx at will...
- // move one thing to the stack...
- "pushl $0\n" // save a slot on the stack.
- "pushl %%ebx\n" // save %%ebx.
- "movl %0, %%ebx\n" // put the thing in ebx.
- "movl %%ebx,4(%%esp)\n" // put the thing in the stack slot.
- "popl %%ebx\n" // get back %%ebx (the PIC register).
-
- ".align 8\n"
- "1:\n"
-
- // create Cr (result in mm1)
- "pushl %%ebx\n"
- "movl 4(%%esp),%%ebx\n"
- "movd (%%ebx),%%mm1\n" // 0 0 0 0 v3 v2 v1 v0
- "popl %%ebx\n"
- "pxor %%mm7,%%mm7\n" // 00 00 00 00 00 00 00 00
- "movd (%2), %%mm2\n" // 0 0 0 0 l3 l2 l1 l0
- "punpcklbw %%mm7,%%mm1\n" // 0 v3 0 v2 00 v1 00 v0
- "punpckldq %%mm1,%%mm1\n" // 00 v1 00 v0 00 v1 00 v0
- "psubw %9,%%mm1\n" // mm1-128:r1 r1 r0 r0 r1 r1 r0 r0
-
- // create Cr_g (result in mm0)
- "movq %%mm1,%%mm0\n" // r1 r1 r0 r0 r1 r1 r0 r0
- "pmullw %10,%%mm0\n" // red*-46dec=0.7136*64
- "pmullw %11,%%mm1\n" // red*89dec=1.4013*64
- "psraw $6, %%mm0\n" // red=red/64
- "psraw $6, %%mm1\n" // red=red/64
-
- // create L1 L2 (result in mm2,mm4)
- // L2=lum+cols
- "movq (%2,%4),%%mm3\n" // 0 0 0 0 L3 L2 L1 L0
- "punpckldq %%mm3,%%mm2\n" // L3 L2 L1 L0 l3 l2 l1 l0
- "movq %%mm2,%%mm4\n" // L3 L2 L1 L0 l3 l2 l1 l0
- "pand %12,%%mm2\n" // L3 0 L1 0 l3 0 l1 0
- "pand %13,%%mm4\n" // 0 L2 0 L0 0 l2 0 l0
- "psrlw $8,%%mm2\n" // 0 L3 0 L1 0 l3 0 l1
-
- // create R (result in mm6)
- "movq %%mm2,%%mm5\n" // 0 L3 0 L1 0 l3 0 l1
- "movq %%mm4,%%mm6\n" // 0 L2 0 L0 0 l2 0 l0
- "paddsw %%mm1, %%mm5\n" // lum1+red:x R3 x R1 x r3 x r1
- "paddsw %%mm1, %%mm6\n" // lum1+red:x R2 x R0 x r2 x r0
- "packuswb %%mm5,%%mm5\n" // R3 R1 r3 r1 R3 R1 r3 r1
- "packuswb %%mm6,%%mm6\n" // R2 R0 r2 r0 R2 R0 r2 r0
- "pxor %%mm7,%%mm7\n" // 00 00 00 00 00 00 00 00
- "punpcklbw %%mm5,%%mm6\n" // R3 R2 R1 R0 r3 r2 r1 r0
-
- // create Cb (result in mm1)
- "movd (%1), %%mm1\n" // 0 0 0 0 u3 u2 u1 u0
- "punpcklbw %%mm7,%%mm1\n" // 0 u3 0 u2 00 u1 00 u0
- "punpckldq %%mm1,%%mm1\n" // 00 u1 00 u0 00 u1 00 u0
- "psubw %9,%%mm1\n" // mm1-128:u1 u1 u0 u0 u1 u1 u0 u0
- // create Cb_g (result in mm5)
- "movq %%mm1,%%mm5\n" // u1 u1 u0 u0 u1 u1 u0 u0
- "pmullw %14,%%mm5\n" // blue*-109dec=1.7129*64
- "pmullw %15,%%mm1\n" // blue*114dec=1.78125*64
- "psraw $6, %%mm5\n" // blue=red/64
- "psraw $6, %%mm1\n" // blue=blue/64
-
- // create G (result in mm7)
- "movq %%mm2,%%mm3\n" // 0 L3 0 L1 0 l3 0 l1
- "movq %%mm4,%%mm7\n" // 0 L2 0 L0 0 l2 0 l1
- "paddsw %%mm5, %%mm3\n" // lum1+Cb_g:x G3t x G1t x g3t x g1t
- "paddsw %%mm5, %%mm7\n" // lum1+Cb_g:x G2t x G0t x g2t x g0t
- "paddsw %%mm0, %%mm3\n" // lum1+Cr_g:x G3 x G1 x g3 x g1
- "paddsw %%mm0, %%mm7\n" // lum1+blue:x G2 x G0 x g2 x g0
- "packuswb %%mm3,%%mm3\n" // G3 G1 g3 g1 G3 G1 g3 g1
- "packuswb %%mm7,%%mm7\n" // G2 G0 g2 g0 G2 G0 g2 g0
- "punpcklbw %%mm3,%%mm7\n" // G3 G2 G1 G0 g3 g2 g1 g0
-
- // create B (result in mm5)
- "movq %%mm2,%%mm3\n" // 0 L3 0 L1 0 l3 0 l1
- "movq %%mm4,%%mm5\n" // 0 L2 0 L0 0 l2 0 l1
- "paddsw %%mm1, %%mm3\n" // lum1+blue:x B3 x B1 x b3 x b1
- "paddsw %%mm1, %%mm5\n" // lum1+blue:x B2 x B0 x b2 x b0
- "packuswb %%mm3,%%mm3\n" // B3 B1 b3 b1 B3 B1 b3 b1
- "packuswb %%mm5,%%mm5\n" // B2 B0 b2 b0 B2 B0 b2 b0
- "punpcklbw %%mm3,%%mm5\n" // B3 B2 B1 B0 b3 b2 b1 b0
-
- // fill destination row1 (needed are mm6=Rr,mm7=Gg,mm5=Bb)
-
- "pxor %%mm2,%%mm2\n" // 0 0 0 0 0 0 0 0
- "pxor %%mm4,%%mm4\n" // 0 0 0 0 0 0 0 0
- "movq %%mm6,%%mm1\n" // R3 R2 R1 R0 r3 r2 r1 r0
- "movq %%mm5,%%mm3\n" // B3 B2 B1 B0 b3 b2 b1 b0
- // process lower lum
- "punpcklbw %%mm4,%%mm1\n" // 0 r3 0 r2 0 r1 0 r0
- "punpcklbw %%mm4,%%mm3\n" // 0 b3 0 b2 0 b1 0 b0
- "movq %%mm1,%%mm2\n" // 0 r3 0 r2 0 r1 0 r0
- "movq %%mm3,%%mm0\n" // 0 b3 0 b2 0 b1 0 b0
- "punpcklwd %%mm1,%%mm3\n" // 0 r1 0 b1 0 r0 0 b0
- "punpckhwd %%mm2,%%mm0\n" // 0 r3 0 b3 0 r2 0 b2
-
- "pxor %%mm2,%%mm2\n" // 0 0 0 0 0 0 0 0
- "movq %%mm7,%%mm1\n" // G3 G2 G1 G0 g3 g2 g1 g0
- "punpcklbw %%mm1,%%mm2\n" // g3 0 g2 0 g1 0 g0 0
- "punpcklwd %%mm4,%%mm2\n" // 0 0 g1 0 0 0 g0 0
- "por %%mm3, %%mm2\n" // 0 r1 g1 b1 0 r0 g0 b0
- "movq %%mm2,(%3)\n" // wrote out ! row1
-
- "pxor %%mm2,%%mm2\n" // 0 0 0 0 0 0 0 0
- "punpcklbw %%mm1,%%mm4\n" // g3 0 g2 0 g1 0 g0 0
- "punpckhwd %%mm2,%%mm4\n" // 0 0 g3 0 0 0 g2 0
- "por %%mm0, %%mm4\n" // 0 r3 g3 b3 0 r2 g2 b2
- "movq %%mm4,8(%3)\n" // wrote out ! row1
-
- // fill destination row2 (needed are mm6=Rr,mm7=Gg,mm5=Bb)
- // this can be done "destructive"
- "pxor %%mm2,%%mm2\n" // 0 0 0 0 0 0 0 0
- "punpckhbw %%mm2,%%mm6\n" // 0 R3 0 R2 0 R1 0 R0
- "punpckhbw %%mm1,%%mm5\n" // G3 B3 G2 B2 G1 B1 G0 B0
- "movq %%mm5,%%mm1\n" // G3 B3 G2 B2 G1 B1 G0 B0
- "punpcklwd %%mm6,%%mm1\n" // 0 R1 G1 B1 0 R0 G0 B0
- "movq %%mm1,(%5)\n" // wrote out ! row2
- "punpckhwd %%mm6,%%mm5\n" // 0 R3 G3 B3 0 R2 G2 B2
- "movq %%mm5,8(%5)\n" // wrote out ! row2
-
- "addl $4,%2\n" // lum+4
- "leal 16(%3),%3\n" // row1+16
- "leal 16(%5),%5\n" // row2+16
- "addl $2,(%%esp)\n" // cr+2
- "addl $2,%1\n" // cb+2
-
- "addl $4,%6\n" // x+4
- "cmpl %4,%6\n"
-
- "jl 1b\n"
- "addl %4,%2\n" // lum += cols
- "addl %8,%3\n" // row1+= mod
- "addl %8,%5\n" // row2+= mod
- "movl $0,%6\n" // x=0
- "cmpl %7,%2\n"
- "jl 1b\n"
-
- "addl $4,%%esp\n" // get rid of the stack slot we reserved.
- "emms\n" // reset MMX registers.
- :
- : "m" (cr), "r"(cb),"r"(lum),
- "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod),
- "m"(MMX_0080w),"m"(MMX_VgrnRGB),"m"(MMX_VredRGB),
- "m"(MMX_FF00w),"m"(MMX_00FFw),"m"(MMX_UgrnRGB),
- "m"(MMX_UbluRGB)
- );
-}
-
-void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod )
-{
- Uint16 *row1;
- Uint16 *row2;
-
- unsigned char* y = lum +cols*rows; /* Pointer to the end */
- int x = 0;
- row1 = (Uint16 *)out; /* 16 bit target */
- row2 = (Uint16 *)out+cols+mod; /* start of second row */
- mod = (mod+cols+mod)*2; /* increment for row1 in byte */
-
- __asm__ __volatile__(
- // tap dance to workaround the inability to use %%ebx at will...
- // move one thing to the stack...
- "pushl $0\n" // save a slot on the stack.
- "pushl %%ebx\n" // save %%ebx.
- "movl %0, %%ebx\n" // put the thing in ebx.
- "movl %%ebx, 4(%%esp)\n" // put the thing in the stack slot.
- "popl %%ebx\n" // get back %%ebx (the PIC register).
-
- ".align 8\n"
- "1:\n"
- "movd (%1), %%mm0\n" // 4 Cb 0 0 0 0 u3 u2 u1 u0
- "pxor %%mm7, %%mm7\n"
- "pushl %%ebx\n"
- "movl 4(%%esp), %%ebx\n"
- "movd (%%ebx), %%mm1\n" // 4 Cr 0 0 0 0 v3 v2 v1 v0
- "popl %%ebx\n"
-
- "punpcklbw %%mm7, %%mm0\n" // 4 W cb 0 u3 0 u2 0 u1 0 u0
- "punpcklbw %%mm7, %%mm1\n" // 4 W cr 0 v3 0 v2 0 v1 0 v0
- "psubw %9, %%mm0\n"
- "psubw %9, %%mm1\n"
- "movq %%mm0, %%mm2\n" // Cb 0 u3 0 u2 0 u1 0 u0
- "movq %%mm1, %%mm3\n" // Cr
- "pmullw %10, %%mm2\n" // Cb2green 0 R3 0 R2 0 R1 0 R0
- "movq (%2), %%mm6\n" // L1 l7 L6 L5 L4 L3 L2 L1 L0
- "pmullw %11, %%mm0\n" // Cb2blue
- "pand %12, %%mm6\n" // L1 00 L6 00 L4 00 L2 00 L0
- "pmullw %13, %%mm3\n" // Cr2green
- "movq (%2), %%mm7\n" // L2
- "pmullw %14, %%mm1\n" // Cr2red
- "psrlw $8, %%mm7\n" // L2 00 L7 00 L5 00 L3 00 L1
- "pmullw %15, %%mm6\n" // lum1
- "paddw %%mm3, %%mm2\n" // Cb2green + Cr2green == green
- "pmullw %15, %%mm7\n" // lum2
-
- "movq %%mm6, %%mm4\n" // lum1
- "paddw %%mm0, %%mm6\n" // lum1 +blue 00 B6 00 B4 00 B2 00 B0
- "movq %%mm4, %%mm5\n" // lum1
- "paddw %%mm1, %%mm4\n" // lum1 +red 00 R6 00 R4 00 R2 00 R0
- "paddw %%mm2, %%mm5\n" // lum1 +green 00 G6 00 G4 00 G2 00 G0
- "psraw $6, %%mm4\n" // R1 0 .. 64
- "movq %%mm7, %%mm3\n" // lum2 00 L7 00 L5 00 L3 00 L1
- "psraw $6, %%mm5\n" // G1 - .. +
- "paddw %%mm0, %%mm7\n" // Lum2 +blue 00 B7 00 B5 00 B3 00 B1
- "psraw $6, %%mm6\n" // B1 0 .. 64
- "packuswb %%mm4, %%mm4\n" // R1 R1
- "packuswb %%mm5, %%mm5\n" // G1 G1
- "packuswb %%mm6, %%mm6\n" // B1 B1
- "punpcklbw %%mm4, %%mm4\n"
- "punpcklbw %%mm5, %%mm5\n"
-
- "pand %16, %%mm4\n"
- "psllw $3, %%mm5\n" // GREEN 1
- "punpcklbw %%mm6, %%mm6\n"
- "pand %17, %%mm5\n"
- "pand %16, %%mm6\n"
- "por %%mm5, %%mm4\n" //
- "psrlw $11, %%mm6\n" // BLUE 1
- "movq %%mm3, %%mm5\n" // lum2
- "paddw %%mm1, %%mm3\n" // lum2 +red 00 R7 00 R5 00 R3 00 R1
- "paddw %%mm2, %%mm5\n" // lum2 +green 00 G7 00 G5 00 G3 00 G1
- "psraw $6, %%mm3\n" // R2
- "por %%mm6, %%mm4\n" // MM4
- "psraw $6, %%mm5\n" // G2
- "movq (%2, %4), %%mm6\n" // L3 load lum2
- "psraw $6, %%mm7\n"
- "packuswb %%mm3, %%mm3\n"
- "packuswb %%mm5, %%mm5\n"
- "packuswb %%mm7, %%mm7\n"
- "pand %12, %%mm6\n" // L3
- "punpcklbw %%mm3, %%mm3\n"
- "punpcklbw %%mm5, %%mm5\n"
- "pmullw %15, %%mm6\n" // lum3
- "punpcklbw %%mm7, %%mm7\n"
- "psllw $3, %%mm5\n" // GREEN 2
- "pand %16, %%mm7\n"
- "pand %16, %%mm3\n"
- "psrlw $11, %%mm7\n" // BLUE 2
- "pand %17, %%mm5\n"
- "por %%mm7, %%mm3\n"
- "movq (%2,%4), %%mm7\n" // L4 load lum2
- "por %%mm5, %%mm3\n" //
- "psrlw $8, %%mm7\n" // L4
- "movq %%mm4, %%mm5\n"
- "punpcklwd %%mm3, %%mm4\n"
- "pmullw %15, %%mm7\n" // lum4
- "punpckhwd %%mm3, %%mm5\n"
-
- "movq %%mm4, (%3)\n" // write row1
- "movq %%mm5, 8(%3)\n" // write row1
-
- "movq %%mm6, %%mm4\n" // Lum3
- "paddw %%mm0, %%mm6\n" // Lum3 +blue
-
- "movq %%mm4, %%mm5\n" // Lum3
- "paddw %%mm1, %%mm4\n" // Lum3 +red
- "paddw %%mm2, %%mm5\n" // Lum3 +green
- "psraw $6, %%mm4\n"
- "movq %%mm7, %%mm3\n" // Lum4
- "psraw $6, %%mm5\n"
- "paddw %%mm0, %%mm7\n" // Lum4 +blue
- "psraw $6, %%mm6\n" // Lum3 +blue
- "movq %%mm3, %%mm0\n" // Lum4
- "packuswb %%mm4, %%mm4\n"
- "paddw %%mm1, %%mm3\n" // Lum4 +red
- "packuswb %%mm5, %%mm5\n"
- "paddw %%mm2, %%mm0\n" // Lum4 +green
- "packuswb %%mm6, %%mm6\n"
- "punpcklbw %%mm4, %%mm4\n"
- "punpcklbw %%mm5, %%mm5\n"
- "punpcklbw %%mm6, %%mm6\n"
- "psllw $3, %%mm5\n" // GREEN 3
- "pand %16, %%mm4\n"
- "psraw $6, %%mm3\n" // psr 6
- "psraw $6, %%mm0\n"
- "pand %16, %%mm6\n" // BLUE
- "pand %17, %%mm5\n"
- "psrlw $11, %%mm6\n" // BLUE 3
- "por %%mm5, %%mm4\n"
- "psraw $6, %%mm7\n"
- "por %%mm6, %%mm4\n"
- "packuswb %%mm3, %%mm3\n"
- "packuswb %%mm0, %%mm0\n"
- "packuswb %%mm7, %%mm7\n"
- "punpcklbw %%mm3, %%mm3\n"
- "punpcklbw %%mm0, %%mm0\n"
- "punpcklbw %%mm7, %%mm7\n"
- "pand %16, %%mm3\n"
- "pand %16, %%mm7\n" // BLUE
- "psllw $3, %%mm0\n" // GREEN 4
- "psrlw $11, %%mm7\n"
- "pand %17, %%mm0\n"
- "por %%mm7, %%mm3\n"
- "por %%mm0, %%mm3\n"
-
- "movq %%mm4, %%mm5\n"
-
- "punpcklwd %%mm3, %%mm4\n"
- "punpckhwd %%mm3, %%mm5\n"
-
- "movq %%mm4, (%5)\n"
- "movq %%mm5, 8(%5)\n"
-
- "addl $8, %6\n"
- "addl $8, %2\n"
- "addl $4, (%%esp)\n"
- "addl $4, %1\n"
- "cmpl %4, %6\n"
- "leal 16(%3), %3\n"
- "leal 16(%5),%5\n" // row2+16
-
- "jl 1b\n"
- "addl %4, %2\n" // lum += cols
- "addl %8, %3\n" // row1+= mod
- "addl %8, %5\n" // row2+= mod
- "movl $0, %6\n" // x=0
- "cmpl %7, %2\n"
- "jl 1b\n"
- "addl $4, %%esp\n" // get rid of the stack slot we reserved.
- "emms\n"
- :
- : "m" (cr), "r"(cb),"r"(lum),
- "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod),
- "m"(MMX_0080w),"m"(MMX_Ugrn565),"m"(MMX_Ublu5x5),
- "m"(MMX_00FFw),"m"(MMX_Vgrn565),"m"(MMX_Vred5x5),
- "m"(MMX_Ycoeff),"m"(MMX_red565),"m"(MMX_grn565)
- );
-}
-
-/* *INDENT-ON* */
-
-#endif /* GCC3 i386 inline assembly */
-
diff --git a/distrib/sdl-1.2.12/src/video/SDL_yuv_sw.c b/distrib/sdl-1.2.12/src/video/SDL_yuv_sw.c
deleted file mode 100644
index 13c4a92..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_yuv_sw.c
+++ /dev/null
@@ -1,1298 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This is the software implementation of the YUV video overlay support */
-
-/* This code was derived from code carrying the following copyright notices:
-
- * Copyright (c) 1995 The Regents of the University of California.
- * All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose, without fee, and without written agreement is
- * hereby granted, provided that the above copyright notice and the following
- * two paragraphs appear in all copies of this software.
- *
- * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
- * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
- * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
- * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
- * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
- * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-
- * Copyright (c) 1995 Erik Corry
- * All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose, without fee, and without written agreement is
- * hereby granted, provided that the above copyright notice and the following
- * two paragraphs appear in all copies of this software.
- *
- * IN NO EVENT SHALL ERIK CORRY BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
- * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
- * THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF ERIK CORRY HAS BEEN ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ERIK CORRY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
- * BASIS, AND ERIK CORRY HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
- * UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-
- * Portions of this software Copyright (c) 1995 Brown University.
- * All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose, without fee, and without written agreement
- * is hereby granted, provided that the above copyright notice and the
- * following two paragraphs appear in all copies of this software.
- *
- * IN NO EVENT SHALL BROWN UNIVERSITY BE LIABLE TO ANY PARTY FOR
- * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
- * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF BROWN
- * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * BROWN UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
- * BASIS, AND BROWN UNIVERSITY HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
- * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
- */
-
-#include "SDL_video.h"
-#include "SDL_cpuinfo.h"
-#include "SDL_stretch_c.h"
-#include "SDL_yuvfuncs.h"
-#include "SDL_yuv_sw_c.h"
-
-/* The functions used to manipulate software video overlays */
-static struct private_yuvhwfuncs sw_yuvfuncs = {
- SDL_LockYUV_SW,
- SDL_UnlockYUV_SW,
- SDL_DisplayYUV_SW,
- SDL_FreeYUV_SW
-};
-
-/* RGB conversion lookup tables */
-struct private_yuvhwdata {
- SDL_Surface *stretch;
- SDL_Surface *display;
- Uint8 *pixels;
- int *colortab;
- Uint32 *rgb_2_pix;
- void (*Display1X)(int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod );
- void (*Display2X)(int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod );
-
- /* These are just so we don't have to allocate them separately */
- Uint16 pitches[3];
- Uint8 *planes[3];
-};
-
-
-/* The colorspace conversion functions */
-
-#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
-extern void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod );
-extern void ColorRGBDitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod );
-#endif
-
-static void Color16DitherYV12Mod1X( int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod )
-{
- unsigned short* row1;
- unsigned short* row2;
- unsigned char* lum2;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- row1 = (unsigned short*) out;
- row2 = row1 + cols + mod;
- lum2 = lum + cols;
-
- mod += cols + mod;
-
- y = rows / 2;
- while( y-- )
- {
- x = cols_2;
- while( x-- )
- {
- register int L;
-
- cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
- crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
- + colortab[ *cb + 2*256 ];
- cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
- ++cr; ++cb;
-
- L = *lum++;
- *row1++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
-
- L = *lum++;
- *row1++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
-
-
- /* Now, do second row. */
-
- L = *lum2++;
- *row2++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
-
- L = *lum2++;
- *row2++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- }
-
- /*
- * These values are at the start of the next line, (due
- * to the ++'s above),but they need to be at the start
- * of the line after that.
- */
- lum += cols;
- lum2 += cols;
- row1 += mod;
- row2 += mod;
- }
-}
-
-static void Color24DitherYV12Mod1X( int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod )
-{
- unsigned int value;
- unsigned char* row1;
- unsigned char* row2;
- unsigned char* lum2;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- row1 = out;
- row2 = row1 + cols*3 + mod*3;
- lum2 = lum + cols;
-
- mod += cols + mod;
- mod *= 3;
-
- y = rows / 2;
- while( y-- )
- {
- x = cols_2;
- while( x-- )
- {
- register int L;
-
- cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
- crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
- + colortab[ *cb + 2*256 ];
- cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
- ++cr; ++cb;
-
- L = *lum++;
- value = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- *row1++ = (value ) & 0xFF;
- *row1++ = (value >> 8) & 0xFF;
- *row1++ = (value >> 16) & 0xFF;
-
- L = *lum++;
- value = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- *row1++ = (value ) & 0xFF;
- *row1++ = (value >> 8) & 0xFF;
- *row1++ = (value >> 16) & 0xFF;
-
-
- /* Now, do second row. */
-
- L = *lum2++;
- value = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- *row2++ = (value ) & 0xFF;
- *row2++ = (value >> 8) & 0xFF;
- *row2++ = (value >> 16) & 0xFF;
-
- L = *lum2++;
- value = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- *row2++ = (value ) & 0xFF;
- *row2++ = (value >> 8) & 0xFF;
- *row2++ = (value >> 16) & 0xFF;
- }
-
- /*
- * These values are at the start of the next line, (due
- * to the ++'s above),but they need to be at the start
- * of the line after that.
- */
- lum += cols;
- lum2 += cols;
- row1 += mod;
- row2 += mod;
- }
-}
-
-static void Color32DitherYV12Mod1X( int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod )
-{
- unsigned int* row1;
- unsigned int* row2;
- unsigned char* lum2;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- row1 = (unsigned int*) out;
- row2 = row1 + cols + mod;
- lum2 = lum + cols;
-
- mod += cols + mod;
-
- y = rows / 2;
- while( y-- )
- {
- x = cols_2;
- while( x-- )
- {
- register int L;
-
- cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
- crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
- + colortab[ *cb + 2*256 ];
- cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
- ++cr; ++cb;
-
- L = *lum++;
- *row1++ = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
-
- L = *lum++;
- *row1++ = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
-
-
- /* Now, do second row. */
-
- L = *lum2++;
- *row2++ = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
-
- L = *lum2++;
- *row2++ = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- }
-
- /*
- * These values are at the start of the next line, (due
- * to the ++'s above),but they need to be at the start
- * of the line after that.
- */
- lum += cols;
- lum2 += cols;
- row1 += mod;
- row2 += mod;
- }
-}
-
-/*
- * In this function I make use of a nasty trick. The tables have the lower
- * 16 bits replicated in the upper 16. This means I can write ints and get
- * the horisontal doubling for free (almost).
- */
-static void Color16DitherYV12Mod2X( int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod )
-{
- unsigned int* row1 = (unsigned int*) out;
- const int next_row = cols+(mod/2);
- unsigned int* row2 = row1 + 2*next_row;
- unsigned char* lum2;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- lum2 = lum + cols;
-
- mod = (next_row * 3) + (mod/2);
-
- y = rows / 2;
- while( y-- )
- {
- x = cols_2;
- while( x-- )
- {
- register int L;
-
- cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
- crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
- + colortab[ *cb + 2*256 ];
- cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
- ++cr; ++cb;
-
- L = *lum++;
- row1[0] = row1[next_row] = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- row1++;
-
- L = *lum++;
- row1[0] = row1[next_row] = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- row1++;
-
-
- /* Now, do second row. */
-
- L = *lum2++;
- row2[0] = row2[next_row] = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- row2++;
-
- L = *lum2++;
- row2[0] = row2[next_row] = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- row2++;
- }
-
- /*
- * These values are at the start of the next line, (due
- * to the ++'s above),but they need to be at the start
- * of the line after that.
- */
- lum += cols;
- lum2 += cols;
- row1 += mod;
- row2 += mod;
- }
-}
-
-static void Color24DitherYV12Mod2X( int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod )
-{
- unsigned int value;
- unsigned char* row1 = out;
- const int next_row = (cols*2 + mod) * 3;
- unsigned char* row2 = row1 + 2*next_row;
- unsigned char* lum2;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- lum2 = lum + cols;
-
- mod = next_row*3 + mod*3;
-
- y = rows / 2;
- while( y-- )
- {
- x = cols_2;
- while( x-- )
- {
- register int L;
-
- cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
- crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
- + colortab[ *cb + 2*256 ];
- cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
- ++cr; ++cb;
-
- L = *lum++;
- value = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- row1[0+0] = row1[3+0] = row1[next_row+0] = row1[next_row+3+0] =
- (value ) & 0xFF;
- row1[0+1] = row1[3+1] = row1[next_row+1] = row1[next_row+3+1] =
- (value >> 8) & 0xFF;
- row1[0+2] = row1[3+2] = row1[next_row+2] = row1[next_row+3+2] =
- (value >> 16) & 0xFF;
- row1 += 2*3;
-
- L = *lum++;
- value = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- row1[0+0] = row1[3+0] = row1[next_row+0] = row1[next_row+3+0] =
- (value ) & 0xFF;
- row1[0+1] = row1[3+1] = row1[next_row+1] = row1[next_row+3+1] =
- (value >> 8) & 0xFF;
- row1[0+2] = row1[3+2] = row1[next_row+2] = row1[next_row+3+2] =
- (value >> 16) & 0xFF;
- row1 += 2*3;
-
-
- /* Now, do second row. */
-
- L = *lum2++;
- value = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- row2[0+0] = row2[3+0] = row2[next_row+0] = row2[next_row+3+0] =
- (value ) & 0xFF;
- row2[0+1] = row2[3+1] = row2[next_row+1] = row2[next_row+3+1] =
- (value >> 8) & 0xFF;
- row2[0+2] = row2[3+2] = row2[next_row+2] = row2[next_row+3+2] =
- (value >> 16) & 0xFF;
- row2 += 2*3;
-
- L = *lum2++;
- value = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- row2[0+0] = row2[3+0] = row2[next_row+0] = row2[next_row+3+0] =
- (value ) & 0xFF;
- row2[0+1] = row2[3+1] = row2[next_row+1] = row2[next_row+3+1] =
- (value >> 8) & 0xFF;
- row2[0+2] = row2[3+2] = row2[next_row+2] = row2[next_row+3+2] =
- (value >> 16) & 0xFF;
- row2 += 2*3;
- }
-
- /*
- * These values are at the start of the next line, (due
- * to the ++'s above),but they need to be at the start
- * of the line after that.
- */
- lum += cols;
- lum2 += cols;
- row1 += mod;
- row2 += mod;
- }
-}
-
-static void Color32DitherYV12Mod2X( int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod )
-{
- unsigned int* row1 = (unsigned int*) out;
- const int next_row = cols*2+mod;
- unsigned int* row2 = row1 + 2*next_row;
- unsigned char* lum2;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- lum2 = lum + cols;
-
- mod = (next_row * 3) + mod;
-
- y = rows / 2;
- while( y-- )
- {
- x = cols_2;
- while( x-- )
- {
- register int L;
-
- cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
- crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
- + colortab[ *cb + 2*256 ];
- cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
- ++cr; ++cb;
-
- L = *lum++;
- row1[0] = row1[1] = row1[next_row] = row1[next_row+1] =
- (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- row1 += 2;
-
- L = *lum++;
- row1[0] = row1[1] = row1[next_row] = row1[next_row+1] =
- (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- row1 += 2;
-
-
- /* Now, do second row. */
-
- L = *lum2++;
- row2[0] = row2[1] = row2[next_row] = row2[next_row+1] =
- (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- row2 += 2;
-
- L = *lum2++;
- row2[0] = row2[1] = row2[next_row] = row2[next_row+1] =
- (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- row2 += 2;
- }
-
- /*
- * These values are at the start of the next line, (due
- * to the ++'s above),but they need to be at the start
- * of the line after that.
- */
- lum += cols;
- lum2 += cols;
- row1 += mod;
- row2 += mod;
- }
-}
-
-static void Color16DitherYUY2Mod1X( int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod )
-{
- unsigned short* row;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- row = (unsigned short*) out;
-
- y = rows;
- while( y-- )
- {
- x = cols_2;
- while( x-- )
- {
- register int L;
-
- cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
- crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
- + colortab[ *cb + 2*256 ];
- cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
- cr += 4; cb += 4;
-
- L = *lum; lum += 2;
- *row++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
-
- L = *lum; lum += 2;
- *row++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
-
- }
-
- row += mod;
- }
-}
-
-static void Color24DitherYUY2Mod1X( int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod )
-{
- unsigned int value;
- unsigned char* row;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- row = (unsigned char*) out;
- mod *= 3;
- y = rows;
- while( y-- )
- {
- x = cols_2;
- while( x-- )
- {
- register int L;
-
- cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
- crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
- + colortab[ *cb + 2*256 ];
- cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
- cr += 4; cb += 4;
-
- L = *lum; lum += 2;
- value = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- *row++ = (value ) & 0xFF;
- *row++ = (value >> 8) & 0xFF;
- *row++ = (value >> 16) & 0xFF;
-
- L = *lum; lum += 2;
- value = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- *row++ = (value ) & 0xFF;
- *row++ = (value >> 8) & 0xFF;
- *row++ = (value >> 16) & 0xFF;
-
- }
- row += mod;
- }
-}
-
-static void Color32DitherYUY2Mod1X( int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod )
-{
- unsigned int* row;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- row = (unsigned int*) out;
- y = rows;
- while( y-- )
- {
- x = cols_2;
- while( x-- )
- {
- register int L;
-
- cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
- crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
- + colortab[ *cb + 2*256 ];
- cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
- cr += 4; cb += 4;
-
- L = *lum; lum += 2;
- *row++ = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
-
- L = *lum; lum += 2;
- *row++ = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
-
-
- }
- row += mod;
- }
-}
-
-/*
- * In this function I make use of a nasty trick. The tables have the lower
- * 16 bits replicated in the upper 16. This means I can write ints and get
- * the horisontal doubling for free (almost).
- */
-static void Color16DitherYUY2Mod2X( int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod )
-{
- unsigned int* row = (unsigned int*) out;
- const int next_row = cols+(mod/2);
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
-
- y = rows;
- while( y-- )
- {
- x = cols_2;
- while( x-- )
- {
- register int L;
-
- cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
- crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
- + colortab[ *cb + 2*256 ];
- cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
- cr += 4; cb += 4;
-
- L = *lum; lum += 2;
- row[0] = row[next_row] = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- row++;
-
- L = *lum; lum += 2;
- row[0] = row[next_row] = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- row++;
-
- }
- row += next_row;
- }
-}
-
-static void Color24DitherYUY2Mod2X( int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod )
-{
- unsigned int value;
- unsigned char* row = out;
- const int next_row = (cols*2 + mod) * 3;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
- y = rows;
- while( y-- )
- {
- x = cols_2;
- while( x-- )
- {
- register int L;
-
- cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
- crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
- + colortab[ *cb + 2*256 ];
- cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
- cr += 4; cb += 4;
-
- L = *lum; lum += 2;
- value = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- row[0+0] = row[3+0] = row[next_row+0] = row[next_row+3+0] =
- (value ) & 0xFF;
- row[0+1] = row[3+1] = row[next_row+1] = row[next_row+3+1] =
- (value >> 8) & 0xFF;
- row[0+2] = row[3+2] = row[next_row+2] = row[next_row+3+2] =
- (value >> 16) & 0xFF;
- row += 2*3;
-
- L = *lum; lum += 2;
- value = (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- row[0+0] = row[3+0] = row[next_row+0] = row[next_row+3+0] =
- (value ) & 0xFF;
- row[0+1] = row[3+1] = row[next_row+1] = row[next_row+3+1] =
- (value >> 8) & 0xFF;
- row[0+2] = row[3+2] = row[next_row+2] = row[next_row+3+2] =
- (value >> 16) & 0xFF;
- row += 2*3;
-
- }
- row += next_row;
- }
-}
-
-static void Color32DitherYUY2Mod2X( int *colortab, Uint32 *rgb_2_pix,
- unsigned char *lum, unsigned char *cr,
- unsigned char *cb, unsigned char *out,
- int rows, int cols, int mod )
-{
- unsigned int* row = (unsigned int*) out;
- const int next_row = cols*2+mod;
- int x, y;
- int cr_r;
- int crb_g;
- int cb_b;
- int cols_2 = cols / 2;
- mod+=mod;
- y = rows;
- while( y-- )
- {
- x = cols_2;
- while( x-- )
- {
- register int L;
-
- cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
- crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
- + colortab[ *cb + 2*256 ];
- cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
- cr += 4; cb += 4;
-
- L = *lum; lum += 2;
- row[0] = row[1] = row[next_row] = row[next_row+1] =
- (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- row += 2;
-
- L = *lum; lum += 2;
- row[0] = row[1] = row[next_row] = row[next_row+1] =
- (rgb_2_pix[ L + cr_r ] |
- rgb_2_pix[ L + crb_g ] |
- rgb_2_pix[ L + cb_b ]);
- row += 2;
-
-
- }
-
- row += next_row;
- }
-}
-
-/*
- * How many 1 bits are there in the Uint32.
- * Low performance, do not call often.
- */
-static int number_of_bits_set( Uint32 a )
-{
- if(!a) return 0;
- if(a & 1) return 1 + number_of_bits_set(a >> 1);
- return(number_of_bits_set(a >> 1));
-}
-
-/*
- * How many 0 bits are there at least significant end of Uint32.
- * Low performance, do not call often.
- */
-static int free_bits_at_bottom( Uint32 a )
-{
- /* assume char is 8 bits */
- if(!a) return sizeof(Uint32) * 8;
- if(((Sint32)a) & 1l) return 0;
- return 1 + free_bits_at_bottom ( a >> 1);
-}
-
-
-SDL_Overlay *SDL_CreateYUV_SW(_THIS, int width, int height, Uint32 format, SDL_Surface *display)
-{
- SDL_Overlay *overlay;
- struct private_yuvhwdata *swdata;
- int *Cr_r_tab;
- int *Cr_g_tab;
- int *Cb_g_tab;
- int *Cb_b_tab;
- Uint32 *r_2_pix_alloc;
- Uint32 *g_2_pix_alloc;
- Uint32 *b_2_pix_alloc;
- int i;
- int CR, CB;
- Uint32 Rmask, Gmask, Bmask;
-
- /* Only RGB packed pixel conversion supported */
- if ( (display->format->BytesPerPixel != 2) &&
- (display->format->BytesPerPixel != 3) &&
- (display->format->BytesPerPixel != 4) ) {
- SDL_SetError("Can't use YUV data on non 16/24/32 bit surfaces");
- return(NULL);
- }
-
- /* Verify that we support the format */
- switch (format) {
- case SDL_YV12_OVERLAY:
- case SDL_IYUV_OVERLAY:
- case SDL_YUY2_OVERLAY:
- case SDL_UYVY_OVERLAY:
- case SDL_YVYU_OVERLAY:
- break;
- default:
- SDL_SetError("Unsupported YUV format");
- return(NULL);
- }
-
- /* Create the overlay structure */
- overlay = (SDL_Overlay *)SDL_malloc(sizeof *overlay);
- if ( overlay == NULL ) {
- SDL_OutOfMemory();
- return(NULL);
- }
- SDL_memset(overlay, 0, (sizeof *overlay));
-
- /* Fill in the basic members */
- overlay->format = format;
- overlay->w = width;
- overlay->h = height;
-
- /* Set up the YUV surface function structure */
- overlay->hwfuncs = &sw_yuvfuncs;
-
- /* Create the pixel data and lookup tables */
- swdata = (struct private_yuvhwdata *)SDL_malloc(sizeof *swdata);
- overlay->hwdata = swdata;
- if ( swdata == NULL ) {
- SDL_OutOfMemory();
- SDL_FreeYUVOverlay(overlay);
- return(NULL);
- }
- swdata->stretch = NULL;
- swdata->display = display;
- swdata->pixels = (Uint8 *) SDL_malloc(width*height*2);
- swdata->colortab = (int *)SDL_malloc(4*256*sizeof(int));
- Cr_r_tab = &swdata->colortab[0*256];
- Cr_g_tab = &swdata->colortab[1*256];
- Cb_g_tab = &swdata->colortab[2*256];
- Cb_b_tab = &swdata->colortab[3*256];
- swdata->rgb_2_pix = (Uint32 *)SDL_malloc(3*768*sizeof(Uint32));
- r_2_pix_alloc = &swdata->rgb_2_pix[0*768];
- g_2_pix_alloc = &swdata->rgb_2_pix[1*768];
- b_2_pix_alloc = &swdata->rgb_2_pix[2*768];
- if ( ! swdata->pixels || ! swdata->colortab || ! swdata->rgb_2_pix ) {
- SDL_OutOfMemory();
- SDL_FreeYUVOverlay(overlay);
- return(NULL);
- }
-
- /* Generate the tables for the display surface */
- for (i=0; i<256; i++) {
- /* Gamma correction (luminescence table) and chroma correction
- would be done here. See the Berkeley mpeg_play sources.
- */
- CB = CR = (i-128);
- Cr_r_tab[i] = (int) ( (0.419/0.299) * CR);
- Cr_g_tab[i] = (int) (-(0.299/0.419) * CR);
- Cb_g_tab[i] = (int) (-(0.114/0.331) * CB);
- Cb_b_tab[i] = (int) ( (0.587/0.331) * CB);
- }
-
- /*
- * Set up entries 0-255 in rgb-to-pixel value tables.
- */
- Rmask = display->format->Rmask;
- Gmask = display->format->Gmask;
- Bmask = display->format->Bmask;
- for ( i=0; i<256; ++i ) {
- r_2_pix_alloc[i+256] = i >> (8 - number_of_bits_set(Rmask));
- r_2_pix_alloc[i+256] <<= free_bits_at_bottom(Rmask);
- g_2_pix_alloc[i+256] = i >> (8 - number_of_bits_set(Gmask));
- g_2_pix_alloc[i+256] <<= free_bits_at_bottom(Gmask);
- b_2_pix_alloc[i+256] = i >> (8 - number_of_bits_set(Bmask));
- b_2_pix_alloc[i+256] <<= free_bits_at_bottom(Bmask);
- }
-
- /*
- * If we have 16-bit output depth, then we double the value
- * in the top word. This means that we can write out both
- * pixels in the pixel doubling mode with one op. It is
- * harmless in the normal case as storing a 32-bit value
- * through a short pointer will lose the top bits anyway.
- */
- if( display->format->BytesPerPixel == 2 ) {
- for ( i=0; i<256; ++i ) {
- r_2_pix_alloc[i+256] |= (r_2_pix_alloc[i+256]) << 16;
- g_2_pix_alloc[i+256] |= (g_2_pix_alloc[i+256]) << 16;
- b_2_pix_alloc[i+256] |= (b_2_pix_alloc[i+256]) << 16;
- }
- }
-
- /*
- * Spread out the values we have to the rest of the array so that
- * we do not need to check for overflow.
- */
- for ( i=0; i<256; ++i ) {
- r_2_pix_alloc[i] = r_2_pix_alloc[256];
- r_2_pix_alloc[i+512] = r_2_pix_alloc[511];
- g_2_pix_alloc[i] = g_2_pix_alloc[256];
- g_2_pix_alloc[i+512] = g_2_pix_alloc[511];
- b_2_pix_alloc[i] = b_2_pix_alloc[256];
- b_2_pix_alloc[i+512] = b_2_pix_alloc[511];
- }
-
- /* You have chosen wisely... */
- switch (format) {
- case SDL_YV12_OVERLAY:
- case SDL_IYUV_OVERLAY:
- if ( display->format->BytesPerPixel == 2 ) {
-#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
- /* inline assembly functions */
- if ( SDL_HasMMX() && (Rmask == 0xF800) &&
- (Gmask == 0x07E0) &&
- (Bmask == 0x001F) &&
- (width & 15) == 0) {
-/*printf("Using MMX 16-bit 565 dither\n");*/
- swdata->Display1X = Color565DitherYV12MMX1X;
- } else {
-/*printf("Using C 16-bit dither\n");*/
- swdata->Display1X = Color16DitherYV12Mod1X;
- }
-#else
- swdata->Display1X = Color16DitherYV12Mod1X;
-#endif
- swdata->Display2X = Color16DitherYV12Mod2X;
- }
- if ( display->format->BytesPerPixel == 3 ) {
- swdata->Display1X = Color24DitherYV12Mod1X;
- swdata->Display2X = Color24DitherYV12Mod2X;
- }
- if ( display->format->BytesPerPixel == 4 ) {
-#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
- /* inline assembly functions */
- if ( SDL_HasMMX() && (Rmask == 0x00FF0000) &&
- (Gmask == 0x0000FF00) &&
- (Bmask == 0x000000FF) &&
- (width & 15) == 0) {
-/*printf("Using MMX 32-bit dither\n");*/
- swdata->Display1X = ColorRGBDitherYV12MMX1X;
- } else {
-/*printf("Using C 32-bit dither\n");*/
- swdata->Display1X = Color32DitherYV12Mod1X;
- }
-#else
- swdata->Display1X = Color32DitherYV12Mod1X;
-#endif
- swdata->Display2X = Color32DitherYV12Mod2X;
- }
- break;
- case SDL_YUY2_OVERLAY:
- case SDL_UYVY_OVERLAY:
- case SDL_YVYU_OVERLAY:
- if ( display->format->BytesPerPixel == 2 ) {
- swdata->Display1X = Color16DitherYUY2Mod1X;
- swdata->Display2X = Color16DitherYUY2Mod2X;
- }
- if ( display->format->BytesPerPixel == 3 ) {
- swdata->Display1X = Color24DitherYUY2Mod1X;
- swdata->Display2X = Color24DitherYUY2Mod2X;
- }
- if ( display->format->BytesPerPixel == 4 ) {
- swdata->Display1X = Color32DitherYUY2Mod1X;
- swdata->Display2X = Color32DitherYUY2Mod2X;
- }
- break;
- default:
- /* We should never get here (caught above) */
- break;
- }
-
- /* Find the pitch and offset values for the overlay */
- overlay->pitches = swdata->pitches;
- overlay->pixels = swdata->planes;
- switch (format) {
- case SDL_YV12_OVERLAY:
- case SDL_IYUV_OVERLAY:
- overlay->pitches[0] = overlay->w;
- overlay->pitches[1] = overlay->pitches[0] / 2;
- overlay->pitches[2] = overlay->pitches[0] / 2;
- overlay->pixels[0] = swdata->pixels;
- overlay->pixels[1] = overlay->pixels[0] +
- overlay->pitches[0] * overlay->h;
- overlay->pixels[2] = overlay->pixels[1] +
- overlay->pitches[1] * overlay->h / 2;
- overlay->planes = 3;
- break;
- case SDL_YUY2_OVERLAY:
- case SDL_UYVY_OVERLAY:
- case SDL_YVYU_OVERLAY:
- overlay->pitches[0] = overlay->w*2;
- overlay->pixels[0] = swdata->pixels;
- overlay->planes = 1;
- break;
- default:
- /* We should never get here (caught above) */
- break;
- }
-
- /* We're all done.. */
- return(overlay);
-}
-
-int SDL_LockYUV_SW(_THIS, SDL_Overlay *overlay)
-{
- return(0);
-}
-
-void SDL_UnlockYUV_SW(_THIS, SDL_Overlay *overlay)
-{
- return;
-}
-
-int SDL_DisplayYUV_SW(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst)
-{
- struct private_yuvhwdata *swdata;
- int stretch;
- int scale_2x;
- SDL_Surface *display;
- Uint8 *lum, *Cr, *Cb;
- Uint8 *dstp;
- int mod;
-
- swdata = overlay->hwdata;
- stretch = 0;
- scale_2x = 0;
- if ( src->x || src->y || src->w < overlay->w || src->h < overlay->h ) {
- /* The source rectangle has been clipped.
- Using a scratch surface is easier than adding clipped
- source support to all the blitters, plus that would
- slow them down in the general unclipped case.
- */
- stretch = 1;
- } else if ( (src->w != dst->w) || (src->h != dst->h) ) {
- if ( (dst->w == 2*src->w) &&
- (dst->h == 2*src->h) ) {
- scale_2x = 1;
- } else {
- stretch = 1;
- }
- }
- if ( stretch ) {
- if ( ! swdata->stretch ) {
- display = swdata->display;
- swdata->stretch = SDL_CreateRGBSurface(
- SDL_SWSURFACE,
- overlay->w, overlay->h,
- display->format->BitsPerPixel,
- display->format->Rmask,
- display->format->Gmask,
- display->format->Bmask, 0);
- if ( ! swdata->stretch ) {
- return(-1);
- }
- }
- display = swdata->stretch;
- } else {
- display = swdata->display;
- }
- switch (overlay->format) {
- case SDL_YV12_OVERLAY:
- lum = overlay->pixels[0];
- Cr = overlay->pixels[1];
- Cb = overlay->pixels[2];
- break;
- case SDL_IYUV_OVERLAY:
- lum = overlay->pixels[0];
- Cr = overlay->pixels[2];
- Cb = overlay->pixels[1];
- break;
- case SDL_YUY2_OVERLAY:
- lum = overlay->pixels[0];
- Cr = lum + 3;
- Cb = lum + 1;
- break;
- case SDL_UYVY_OVERLAY:
- lum = overlay->pixels[0]+1;
- Cr = lum + 1;
- Cb = lum - 1;
- break;
- case SDL_YVYU_OVERLAY:
- lum = overlay->pixels[0];
- Cr = lum + 1;
- Cb = lum + 3;
- break;
- default:
- SDL_SetError("Unsupported YUV format in blit");
- return(-1);
- }
- if ( SDL_MUSTLOCK(display) ) {
- if ( SDL_LockSurface(display) < 0 ) {
- return(-1);
- }
- }
- if ( stretch ) {
- dstp = (Uint8 *)swdata->stretch->pixels;
- } else {
- dstp = (Uint8 *)display->pixels
- + dst->x * display->format->BytesPerPixel
- + dst->y * display->pitch;
- }
- mod = (display->pitch / display->format->BytesPerPixel);
-
- if ( scale_2x ) {
- mod -= (overlay->w * 2);
- swdata->Display2X(swdata->colortab, swdata->rgb_2_pix,
- lum, Cr, Cb, dstp, overlay->h, overlay->w, mod);
- } else {
- mod -= overlay->w;
- swdata->Display1X(swdata->colortab, swdata->rgb_2_pix,
- lum, Cr, Cb, dstp, overlay->h, overlay->w, mod);
- }
- if ( SDL_MUSTLOCK(display) ) {
- SDL_UnlockSurface(display);
- }
- if ( stretch ) {
- display = swdata->display;
- SDL_SoftStretch(swdata->stretch, src, display, dst);
- }
- SDL_UpdateRects(display, 1, dst);
-
- return(0);
-}
-
-void SDL_FreeYUV_SW(_THIS, SDL_Overlay *overlay)
-{
- struct private_yuvhwdata *swdata;
-
- swdata = overlay->hwdata;
- if ( swdata ) {
- if ( swdata->stretch ) {
- SDL_FreeSurface(swdata->stretch);
- }
- if ( swdata->pixels ) {
- SDL_free(swdata->pixels);
- }
- if ( swdata->colortab ) {
- SDL_free(swdata->colortab);
- }
- if ( swdata->rgb_2_pix ) {
- SDL_free(swdata->rgb_2_pix);
- }
- SDL_free(swdata);
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/SDL_yuv_sw_c.h b/distrib/sdl-1.2.12/src/video/SDL_yuv_sw_c.h
deleted file mode 100644
index 39df51d..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_yuv_sw_c.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-#include "SDL_sysvideo.h"
-
-/* This is the software implementation of the YUV video overlay support */
-
-extern SDL_Overlay *SDL_CreateYUV_SW(_THIS, int width, int height, Uint32 format, SDL_Surface *display);
-
-extern int SDL_LockYUV_SW(_THIS, SDL_Overlay *overlay);
-
-extern void SDL_UnlockYUV_SW(_THIS, SDL_Overlay *overlay);
-
-extern int SDL_DisplayYUV_SW(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst);
-
-extern void SDL_FreeYUV_SW(_THIS, SDL_Overlay *overlay);
diff --git a/distrib/sdl-1.2.12/src/video/SDL_yuvfuncs.h b/distrib/sdl-1.2.12/src/video/SDL_yuvfuncs.h
deleted file mode 100644
index a48af3f..0000000
--- a/distrib/sdl-1.2.12/src/video/SDL_yuvfuncs.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This is the definition of the YUV video surface function structure */
-
-#include "SDL_video.h"
-#include "SDL_sysvideo.h"
-
-#ifndef _THIS
-#define _THIS SDL_VideoDevice *_this
-#endif
-struct private_yuvhwfuncs {
- int (*Lock)(_THIS, SDL_Overlay *overlay);
- void (*Unlock)(_THIS, SDL_Overlay *overlay);
- int (*Display)(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst);
- void (*FreeHW)(_THIS, SDL_Overlay *overlay);
-};
diff --git a/distrib/sdl-1.2.12/src/video/Xext/XME/xme.c b/distrib/sdl-1.2.12/src/video/Xext/XME/xme.c
deleted file mode 100644
index a3674d5..0000000
--- a/distrib/sdl-1.2.12/src/video/Xext/XME/xme.c
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
- * Copyright 1993-2001 by Xi Graphics, Inc.
- * All Rights Reserved.
- *
- * Please see the LICENSE file accompanying this distribution for licensing
- * information.
- *
- * Please send any bug fixes and modifications to src@xig.com.
- *
- * $XiGId: xme.c,v 1.2 2001/11/30 21:56:59 jon Exp $
- *
- */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-
-#include <X11/Xlibint.h>
-#include <X11/Xthreads.h>
-#include <X11/Xmd.h>
-#include <X11/Xproto.h>
-#include "../extensions/Xext.h"
-#include "../extensions/extutil.h"
-
-/*****************************************************************************/
-
-
-#define XIGMISC_PROTOCOL_NAME "XiG-SUNDRY-NONSTANDARD"
-#define XIGMISC_MAJOR_VERSION 2
-#define XIGMISC_MINOR_VERSION 0
-
-#define XiGMiscNumberEvents 0
-
-#define X_XiGMiscQueryVersion 0
-#define X_XiGMiscQueryViews 1
-#define X_XiGMiscQueryResolutions 2
-#define X_XiGMiscChangeResolution 3
-#define X_XiGMiscFullScreen 4
-
-#define sz_xXiGMiscQueryVersionReq 8
-#define sz_xXiGMiscQueryViewsReq 8
-#define sz_xXiGMiscQueryResolutionsReq 8
-#define sz_xXiGMiscChangeResolutionReq 16
-#define sz_xXiGMiscFullScreenReq 16
-
-#define sz_xXiGMiscQueryVersionReply 32
-#define sz_xXiGMiscQueryViewsReply 32
-#define sz_xXiGMiscQueryResolutionsReply 32
-#define sz_xXiGMiscQueryFullScreenReply 32
-
-/*******************************************************************/
-
-typedef struct {
- CARD8 reqType; /* always codes->major_opcode */
- CARD8 xigmiscReqType; /* always X_XiGMiscQueryVersion */
- CARD16 length;
- CARD16 major;
- CARD16 minor;
-} xXiGMiscQueryVersionReq;
-
-typedef struct {
- CARD8 reqType; /* always codes->major_opcode */
- CARD8 xigmiscReqType; /* always X_XiGMiscQueryViews */
- CARD16 length;
- CARD8 screen;
- CARD8 pad0;
- CARD16 pad1;
-} xXiGMiscQueryViewsReq;
-
-typedef struct {
- CARD8 reqType; /* always codes->major_opcode */
- CARD8 xigmiscReqType; /* always X_XiGMiscQueryResolutions */
- CARD16 length;
- CARD8 screen;
- CARD8 view;
- CARD16 pad0;
-} xXiGMiscQueryResolutionsReq;
-
-typedef struct {
- CARD8 reqType; /* always codes->major_opcode */
- CARD8 xigmiscReqType; /* always X_XiGMiscChangeResolution */
- CARD16 length;
- CARD8 screen;
- CARD8 view;
- CARD16 pad0;
- CARD16 width;
- CARD16 height;
- INT32 refresh;
-} xXiGMiscChangeResolutionReq;
-
-typedef struct {
- CARD8 reqType; /* always codes->major_opcode */
- CARD8 xigmiscReqType; /* always X_XiGMiscFullScreen */
- CARD16 length;
- CARD8 screen;
- CARD8 pad0;
- CARD16 pad1;
- CARD32 window;
- CARD32 cmap;
-} xXiGMiscFullScreenReq;
-
-/*******************************************************************/
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 pad0;
- CARD16 sequenceNumber;
- CARD32 length;
- CARD16 major;
- CARD16 minor;
- CARD32 pad1;
- CARD32 pad2;
- CARD32 pad3;
- CARD32 pad4;
- CARD32 pad5;
-} xXiGMiscQueryVersionReply;
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 pad0;
- CARD16 sequenceNumber;
- CARD32 length;
- CARD32 nviews;
- CARD32 pad1;
- CARD32 pad2;
- CARD32 pad3;
- CARD32 pad4;
- CARD32 pad5;
-} xXiGMiscQueryViewsReply;
-
-typedef struct {
- BYTE type; /* X_Reply */
- CARD8 pad0;
- CARD16 sequenceNumber;
- CARD32 length;
- CARD16 active;
- CARD16 nresolutions;
- CARD32 pad1;
- CARD32 pad2;
- CARD32 pad3;
- CARD32 pad4;
- CARD32 pad5;
-} xXiGMiscQueryResolutionsReply;
-
-typedef struct {
- BYTE type; /* X_Reply */
- BOOL success;
- CARD16 sequenceNumber;
- CARD32 length;
- CARD32 pad1;
- CARD32 pad2;
- CARD32 pad3;
- CARD32 pad4;
- CARD32 pad5;
- CARD32 pad6;
-} xXiGMiscFullScreenReply;
-
-/*******************************************************************/
-
-typedef struct {
- INT16 x;
- INT16 y;
- CARD16 w;
- CARD16 h;
-} XiGMiscViewInfo;
-
-typedef struct {
- CARD16 width;
- CARD16 height;
- INT32 refresh;
-} XiGMiscResolutionInfo;
-
-/*****************************************************************************/
-
-static XExtensionInfo *xigmisc_info = NULL;
-static char *xigmisc_extension_name = XIGMISC_PROTOCOL_NAME;
-
-#define XiGMiscCheckExtension(dpy,i,val) \
- XextCheckExtension (dpy, i, xigmisc_extension_name, val)
-#define XiGMiscSimpleCheckExtension(dpy,i) \
- XextSimpleCheckExtension (dpy, i, xigmisc_extension_name)
-
-#if defined(__STDC__) && !defined(UNIXCPP)
-#define XiGMiscGetReq(name,req,info) GetReq (name, req); \
- req->reqType = info->codes->major_opcode; \
- req->xigmiscReqType = X_##name;
-
-#define XiGMiscGetReqExtra(name,n,req,info) GetReqExtra (name, n, req); \
- req->reqType = info->codes->major_opcode; \
- req->xigmicReqType = X_##name;
-#else
-#define XiGMiscGetReq(name,req,info) GetReq (name, req); \
- req->reqType = info->codes->major_opcode; \
- req->xigmiscReqType = X_/**/name;
-#define XiGMiscGetReqExtra(name,n,req,info) GetReqExtra (name, n, req); \
- req->reqType = info->codes->major_opcode; \
- req->xigmiscReqType = X_/**/name;
-#endif
-
-
-
-/*
- * find_display - locate the display info block
- */
-static int XiGMiscCloseDisplay();
-
-static XExtensionHooks xigmisc_extension_hooks = {
- NULL, /* create_gc */
- NULL, /* copy_gc */
- NULL, /* flush_gc */
- NULL, /* free_gc */
- NULL, /* create_font */
- NULL, /* free_font */
- XiGMiscCloseDisplay, /* close_display */
- NULL, /* wire_to_event */
- NULL, /* event_to_wire */
- NULL, /* error */
- NULL, /* error_string */
-};
-
-
-static XEXT_GENERATE_CLOSE_DISPLAY (XiGMiscCloseDisplay, xigmisc_info)
-
-static XEXT_GENERATE_FIND_DISPLAY (XiGMiscFindDisplay, xigmisc_info,
- xigmisc_extension_name,
- &xigmisc_extension_hooks, XiGMiscNumberEvents, NULL)
-
-
-/*****************************************************************************/
-
-Bool XiGMiscQueryVersion(Display *dpy, int *major, int *minor)
-{
- int opcode, event, error;
- xXiGMiscQueryVersionReq *req;
- xXiGMiscQueryVersionReply rep;
- XExtDisplayInfo *info = XiGMiscFindDisplay(dpy);
-
- if (!XQueryExtension(dpy, XIGMISC_PROTOCOL_NAME, &opcode, &event, &error))
- return xFalse;
-
- XiGMiscCheckExtension(dpy, info, xFalse);
-
- LockDisplay (dpy);
- XiGMiscGetReq (XiGMiscQueryVersion, req, info);
-
- req->major = XIGMISC_MAJOR_VERSION;
- req->minor = XIGMISC_MINOR_VERSION;
-
- if (!_XReply (dpy, (xReply *)&rep, 0, xTrue)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return xFalse;
- }
-
- *major = rep.major;
- *minor = rep.minor;
- UnlockDisplay(dpy);
- SyncHandle();
-
- return xTrue;
-}
-
-int XiGMiscQueryViews(Display *dpy, int screen, XiGMiscViewInfo **pviews)
-{
- int n, size;
- XiGMiscViewInfo *views;
- xXiGMiscQueryViewsReq *req;
- xXiGMiscQueryViewsReply rep;
- XExtDisplayInfo *info = XiGMiscFindDisplay(dpy);
- XiGMiscCheckExtension(dpy, info, 0);
-
- LockDisplay (dpy);
- XiGMiscGetReq (XiGMiscQueryViews, req, info);
- req->screen = screen;
-
- if (!_XReply (dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return 0;
- }
-
- n = rep.nviews;
-
- if (n > 0) {
- size = sizeof(XiGMiscViewInfo) * n;
- views = (XiGMiscViewInfo*)Xmalloc(size);
- if (!views) {
- _XEatData(dpy, (unsigned long)size);
- UnlockDisplay(dpy);
- SyncHandle();
- return 0;
- }
-
- _XReadPad(dpy, (void*)views, size);
-
- *pviews = views;
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- return n;
-}
-
-int XiGMiscQueryResolutions(Display *dpy, int screen, int view, int *pactive, XiGMiscResolutionInfo **presolutions)
-{
- int n, size;
- XiGMiscResolutionInfo *resolutions;
- xXiGMiscQueryResolutionsReq *req;
- xXiGMiscQueryResolutionsReply rep;
- XExtDisplayInfo *info = XiGMiscFindDisplay(dpy);
- XiGMiscCheckExtension(dpy, info, 0);
-
- LockDisplay (dpy);
- XiGMiscGetReq (XiGMiscQueryResolutions, req, info);
- req->screen = screen;
- req->view = view;
-
- if (!_XReply (dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return 0;
- }
-
- n = rep.nresolutions;
-
- if (n > 0) {
- size = sizeof(XiGMiscResolutionInfo) * n;
- resolutions = (XiGMiscResolutionInfo*)Xmalloc(size);
- if (!resolutions) {
- _XEatData(dpy, (unsigned long)size);
- UnlockDisplay(dpy);
- SyncHandle();
- return 0;
- }
-
- _XReadPad(dpy, (void*)resolutions, size);
-
- *presolutions = resolutions;
- *pactive = rep.active;
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- return n;
-}
-
-void XiGMiscChangeResolution(Display *dpy, int screen, int view, int width, int height, int refresh)
-{
- xXiGMiscChangeResolutionReq *req;
- XExtDisplayInfo *info = XiGMiscFindDisplay(dpy);
-
- XiGMiscSimpleCheckExtension(dpy, info);
-
- LockDisplay (dpy);
- XiGMiscGetReq (XiGMiscChangeResolution, req, info);
- req->screen = screen;
- req->view = view;
- req->width = width;
- req->height = height;
- req->refresh = refresh;
-
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-
-Bool XiGMiscFullScreen(Display *dpy, int screen, XID window, XID cmap)
-{
- xXiGMiscFullScreenReq *req;
- xXiGMiscFullScreenReply rep;
- XExtDisplayInfo *info = XiGMiscFindDisplay(dpy);
-
- XiGMiscCheckExtension(dpy, info, xFalse);
-
- LockDisplay (dpy);
- XiGMiscGetReq (XiGMiscFullScreen, req, info);
- req->screen = screen;
- req->pad0 = 0;
- req->pad1 = 0;
- req->window = window;
- req->cmap = cmap;
-
- if (!_XReply (dpy, (xReply *)&rep, 0, xTrue)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return xFalse;
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- return (rep.success ? xTrue : xFalse);
-}
-
-
-/* SDL addition from Ryan: free memory used by xme. */
-void XiGMiscDestroy(void)
-{
- if (xigmisc_info) {
- XextDestroyExtension(xigmisc_info);
- xigmisc_info = NULL;
- }
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/Xext/Xinerama/Xinerama.c b/distrib/sdl-1.2.12/src/video/Xext/Xinerama/Xinerama.c
deleted file mode 100644
index 049be45..0000000
--- a/distrib/sdl-1.2.12/src/video/Xext/Xinerama/Xinerama.c
+++ /dev/null
@@ -1,319 +0,0 @@
-/* $Xorg: XPanoramiX.c,v 1.4 2000/08/17 19:45:51 cpqbld Exp $ */
-/*****************************************************************
-Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
-BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of Digital Equipment Corporation
-shall not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from Digital
-Equipment Corporation.
-******************************************************************/
-/* $XFree86: xc/lib/Xinerama/Xinerama.c,v 1.2 2001/07/23 17:20:28 dawes Exp $ */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-
-#include <X11/Xlibint.h>
-#include <X11/Xutil.h>
-#include "../extensions/Xext.h"
-#include "../extensions/extutil.h" /* in ../include */
-#include "../extensions/panoramiXext.h"
-#include "../extensions/panoramiXproto.h" /* in ../include */
-#include "../extensions/Xinerama.h"
-
-static XExtensionInfo _panoramiX_ext_info_data;
-static XExtensionInfo *panoramiX_ext_info = &_panoramiX_ext_info_data;
-static /* const */ char *panoramiX_extension_name = PANORAMIX_PROTOCOL_NAME;
-
-#define PanoramiXCheckExtension(dpy,i,val) \
- XextCheckExtension (dpy, i, panoramiX_extension_name, val)
-#define PanoramiXSimpleCheckExtension(dpy,i) \
- XextSimpleCheckExtension (dpy, i, panoramiX_extension_name)
-
-static int close_display();
-static /* const */ XExtensionHooks panoramiX_extension_hooks = {
- NULL, /* create_gc */
- NULL, /* copy_gc */
- NULL, /* flush_gc */
- NULL, /* free_gc */
- NULL, /* create_font */
- NULL, /* free_font */
- close_display, /* close_display */
- NULL, /* wire_to_event */
- NULL, /* event_to_wire */
- NULL, /* error */
- NULL, /* error_string */
-};
-
-static XEXT_GENERATE_FIND_DISPLAY (find_display, panoramiX_ext_info,
- panoramiX_extension_name,
- &panoramiX_extension_hooks,
- 0, NULL)
-
-static XEXT_GENERATE_CLOSE_DISPLAY (close_display, panoramiX_ext_info)
-
-
-
-/****************************************************************************
- * *
- * PanoramiX public interfaces *
- * *
- ****************************************************************************/
-
-Bool SDL_NAME(XPanoramiXQueryExtension) (
- Display *dpy,
- int *event_basep,
- int *error_basep
-)
-{
- XExtDisplayInfo *info = find_display (dpy);
-
- if (XextHasExtension(info)) {
- *event_basep = info->codes->first_event;
- *error_basep = info->codes->first_error;
- return True;
- } else {
- return False;
- }
-}
-
-
-Status SDL_NAME(XPanoramiXQueryVersion)(
- Display *dpy,
- int *major_versionp,
- int *minor_versionp
-)
-{
- XExtDisplayInfo *info = find_display (dpy);
- xPanoramiXQueryVersionReply rep;
- register xPanoramiXQueryVersionReq *req;
-
- PanoramiXCheckExtension (dpy, info, 0);
-
- LockDisplay (dpy);
- GetReq (PanoramiXQueryVersion, req);
- req->reqType = info->codes->major_opcode;
- req->panoramiXReqType = X_PanoramiXQueryVersion;
- req->clientMajor = PANORAMIX_MAJOR_VERSION;
- req->clientMinor = PANORAMIX_MINOR_VERSION;
- if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
- UnlockDisplay (dpy);
- SyncHandle ();
- return 0;
- }
- *major_versionp = rep.majorVersion;
- *minor_versionp = rep.minorVersion;
- UnlockDisplay (dpy);
- SyncHandle ();
- return 1;
-}
-
-SDL_NAME(XPanoramiXInfo) *SDL_NAME(XPanoramiXAllocInfo)(void)
-{
- return (SDL_NAME(XPanoramiXInfo) *) Xmalloc (sizeof (SDL_NAME(XPanoramiXInfo)));
-}
-
-Status SDL_NAME(XPanoramiXGetState) (
- Display *dpy,
- Drawable drawable,
- SDL_NAME(XPanoramiXInfo) *panoramiX_info
-)
-{
- XExtDisplayInfo *info = find_display (dpy);
- xPanoramiXGetStateReply rep;
- register xPanoramiXGetStateReq *req;
-
- PanoramiXCheckExtension (dpy, info, 0);
-
- LockDisplay (dpy);
- GetReq (PanoramiXGetState, req);
- req->reqType = info->codes->major_opcode;
- req->panoramiXReqType = X_PanoramiXGetState;
- req->window = drawable;
- if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
- UnlockDisplay (dpy);
- SyncHandle ();
- return 0;
- }
- UnlockDisplay (dpy);
- SyncHandle ();
- panoramiX_info->window = rep.window;
- panoramiX_info->State = rep.state;
- return 1;
-}
-
-Status SDL_NAME(XPanoramiXGetScreenCount) (
- Display *dpy,
- Drawable drawable,
- SDL_NAME(XPanoramiXInfo) *panoramiX_info
-)
-{
- XExtDisplayInfo *info = find_display (dpy);
- xPanoramiXGetScreenCountReply rep;
- register xPanoramiXGetScreenCountReq *req;
-
- PanoramiXCheckExtension (dpy, info, 0);
-
- LockDisplay (dpy);
- GetReq (PanoramiXGetScreenCount, req);
- req->reqType = info->codes->major_opcode;
- req->panoramiXReqType = X_PanoramiXGetScreenCount;
- req->window = drawable;
- if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
- UnlockDisplay (dpy);
- SyncHandle ();
- return 0;
- }
- UnlockDisplay (dpy);
- SyncHandle ();
- panoramiX_info->window = rep.window;
- panoramiX_info->ScreenCount = rep.ScreenCount;
- return 1;
-}
-
-Status SDL_NAME(XPanoramiXGetScreenSize) (
- Display *dpy,
- Drawable drawable,
- int screen_num,
- SDL_NAME(XPanoramiXInfo) *panoramiX_info
-)
-{
- XExtDisplayInfo *info = find_display (dpy);
- xPanoramiXGetScreenSizeReply rep;
- register xPanoramiXGetScreenSizeReq *req;
-
- PanoramiXCheckExtension (dpy, info, 0);
-
- LockDisplay (dpy);
- GetReq (PanoramiXGetScreenSize, req);
- req->reqType = info->codes->major_opcode;
- req->panoramiXReqType = X_PanoramiXGetScreenSize;
- req->window = drawable;
- req->screen = screen_num; /* need to define */
- if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
- UnlockDisplay (dpy);
- SyncHandle ();
- return 0;
- }
- UnlockDisplay (dpy);
- SyncHandle ();
- panoramiX_info->window = rep.window;
- panoramiX_info->screen = rep.screen;
- panoramiX_info->width = rep.width;
- panoramiX_info->height = rep.height;
- return 1;
-}
-
-/*******************************************************************\
- Alternate interface to make up for shortcomings in the original,
- namely, the omission of the screen origin. The new interface is
- in the "Xinerama" namespace instead of "PanoramiX".
-\*******************************************************************/
-
-Bool SDL_NAME(XineramaQueryExtension) (
- Display *dpy,
- int *event_base,
- int *error_base
-)
-{
- return SDL_NAME(XPanoramiXQueryExtension)(dpy, event_base, error_base);
-}
-
-Status SDL_NAME(XineramaQueryVersion)(
- Display *dpy,
- int *major,
- int *minor
-)
-{
- return SDL_NAME(XPanoramiXQueryVersion)(dpy, major, minor);
-}
-
-Bool SDL_NAME(XineramaIsActive)(Display *dpy)
-{
- xXineramaIsActiveReply rep;
- xXineramaIsActiveReq *req;
- XExtDisplayInfo *info = find_display (dpy);
-
- if(!XextHasExtension(info))
- return False; /* server doesn't even have the extension */
-
- LockDisplay (dpy);
- GetReq (XineramaIsActive, req);
- req->reqType = info->codes->major_opcode;
- req->panoramiXReqType = X_XineramaIsActive;
- if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
- UnlockDisplay (dpy);
- SyncHandle ();
- return False;
- }
- UnlockDisplay (dpy);
- SyncHandle ();
- return rep.state;
-}
-
-#include <stdio.h>
-
-SDL_NAME(XineramaScreenInfo) *
-SDL_NAME(XineramaQueryScreens)(
- Display *dpy,
- int *number
-)
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXineramaQueryScreensReply rep;
- xXineramaQueryScreensReq *req;
- SDL_NAME(XineramaScreenInfo) *scrnInfo = NULL;
-
- PanoramiXCheckExtension (dpy, info, 0);
-
- LockDisplay (dpy);
- GetReq (XineramaQueryScreens, req);
- req->reqType = info->codes->major_opcode;
- req->panoramiXReqType = X_XineramaQueryScreens;
- if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
- UnlockDisplay (dpy);
- SyncHandle ();
- return NULL;
- }
-
- if(rep.number) {
- if((scrnInfo = Xmalloc(sizeof(SDL_NAME(XineramaScreenInfo)) * rep.number))) {
- xXineramaScreenInfo scratch;
- int i;
-
- for(i = 0; i < rep.number; i++) {
- _XRead(dpy, (char*)(&scratch), sz_XineramaScreenInfo);
- scrnInfo[i].screen_number = i;
- scrnInfo[i].x_org = scratch.x_org;
- scrnInfo[i].y_org = scratch.y_org;
- scrnInfo[i].width = scratch.width;
- scrnInfo[i].height = scratch.height;
- }
-
- *number = rep.number;
- } else
- _XEatData(dpy, rep.length << 2);
- }
-
- UnlockDisplay (dpy);
- SyncHandle ();
- return scrnInfo;
-}
-
-
-
diff --git a/distrib/sdl-1.2.12/src/video/Xext/Xv/Xvlibint.h b/distrib/sdl-1.2.12/src/video/Xext/Xv/Xvlibint.h
deleted file mode 100644
index d0bb708..0000000
--- a/distrib/sdl-1.2.12/src/video/Xext/Xv/Xvlibint.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/***********************************************************
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Digital or MIT not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* $XFree86: xc/lib/Xv/Xvlibint.h,v 1.5 2001/07/25 15:04:53 dawes Exp $ */
-
-#ifndef XVLIBINT_H
-#define XVLIBINT_H
-/*
-** File:
-**
-** Xvlibint.h --- Xv library internal header file
-**
-** Author:
-**
-** David Carver (Digital Workstation Engineering/Project Athena)
-**
-** Revisions:
-**
-** 01.24.91 Carver
-** - version 1.4 upgrade
-**
-*/
-
-#define NEED_REPLIES
-
-#include <X11/Xlibint.h>
-#include "../extensions/Xvproto.h"
-#include "../extensions/Xvlib.h"
-
-#if !defined(UNIXCPP)
-#define XvGetReq(name, req) \
- WORD64ALIGN\
- if ((dpy->bufptr + SIZEOF(xv##name##Req)) > dpy->bufmax)\
- _XFlush(dpy);\
- req = (xv##name##Req *)(dpy->last_req = dpy->bufptr);\
- req->reqType = info->codes->major_opcode;\
- req->xvReqType = xv_##name; \
- req->length = (SIZEOF(xv##name##Req))>>2;\
- dpy->bufptr += SIZEOF(xv##name##Req);\
- dpy->request++
-
-#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */
-#define XvGetReq(name, req) \
- WORD64ALIGN\
- if ((dpy->bufptr + SIZEOF(xv/**/name/**/Req)) > dpy->bufmax)\
- _XFlush(dpy);\
- req = (xv/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\
- req->reqType = info->codes->major_opcode;\
- req->xvReqType = xv_/**/name;\
- req->length = (SIZEOF(xv/**/name/**/Req))>>2;\
- dpy->bufptr += SIZEOF(xv/**/name/**/Req);\
- dpy->request++
-#endif
-
-
-#endif /* XVLIBINT_H */
diff --git a/distrib/sdl-1.2.12/src/video/Xext/Xxf86dga/XF86DGA.c b/distrib/sdl-1.2.12/src/video/Xext/Xxf86dga/XF86DGA.c
deleted file mode 100644
index 346e9e7..0000000
--- a/distrib/sdl-1.2.12/src/video/Xext/Xxf86dga/XF86DGA.c
+++ /dev/null
@@ -1,716 +0,0 @@
-/* $XFree86: xc/lib/Xxf86dga/XF86DGA.c,v 3.19 2001/08/18 02:41:30 dawes Exp $ */
-/*
-
-Copyright (c) 1995 Jon Tombs
-Copyright (c) 1995,1996 The XFree86 Project, Inc
-
-*/
-
-/* THIS IS NOT AN X CONSORTIUM STANDARD */
-
-#ifdef __EMX__ /* needed here to override certain constants in X headers */
-#define INCL_DOS
-#define INCL_DOSIOCTL
-#include <os2.h>
-#endif
-
-#if defined(linux)
-#define HAS_MMAP_ANON
-#include <sys/types.h>
-#include <sys/mman.h>
-/*#include <asm/page.h>*/ /* PAGE_SIZE */
-#define HAS_SC_PAGESIZE /* _SC_PAGESIZE may be an enum for Linux */
-#define HAS_GETPAGESIZE
-#endif /* linux */
-
-#if defined(CSRG_BASED)
-#define HAS_MMAP_ANON
-#define HAS_GETPAGESIZE
-#include <sys/types.h>
-#include <sys/mman.h>
-#endif /* CSRG_BASED */
-
-#if defined(DGUX)
-#define HAS_GETPAGESIZE
-#define MMAP_DEV_ZERO
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <unistd.h>
-#endif /* DGUX */
-
-#if defined(SVR4) && !defined(DGUX)
-#define MMAP_DEV_ZERO
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <unistd.h>
-#endif /* SVR4 && !DGUX */
-
-#if defined(sun) && !defined(SVR4) /* SunOS */
-#define MMAP_DEV_ZERO /* doesn't SunOS have MAP_ANON ?? */
-#define HAS_GETPAGESIZE
-#include <sys/types.h>
-#include <sys/mman.h>
-#endif /* sun && !SVR4 */
-
-#ifdef XNO_SYSCONF
-#undef _SC_PAGESIZE
-#endif
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-
-#include <X11/Xlibint.h>
-#include "../extensions/xf86dga.h"
-#include "../extensions/xf86dgastr.h"
-#include "../extensions/Xext.h"
-#include "../extensions/extutil.h"
-
-extern XExtDisplayInfo* SDL_NAME(xdga_find_display)(Display*);
-extern char *SDL_NAME(xdga_extension_name);
-
-#define XF86DGACheckExtension(dpy,i,val) \
- XextCheckExtension (dpy, i, SDL_NAME(xdga_extension_name), val)
-
-/*****************************************************************************
- * *
- * public XFree86-DGA Extension routines *
- * *
- *****************************************************************************/
-
-Bool SDL_NAME(XF86DGAQueryExtension) (
- Display *dpy,
- int *event_basep,
- int *error_basep
-){
- return SDL_NAME(XDGAQueryExtension)(dpy, event_basep, error_basep);
-}
-
-Bool SDL_NAME(XF86DGAQueryVersion)(
- Display* dpy,
- int* majorVersion,
- int* minorVersion
-){
- return SDL_NAME(XDGAQueryVersion)(dpy, majorVersion, minorVersion);
-}
-
-Bool SDL_NAME(XF86DGAGetVideoLL)(
- Display* dpy,
- int screen,
- int *offset,
- int *width,
- int *bank_size,
- int *ram_size
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXF86DGAGetVideoLLReply rep;
- xXF86DGAGetVideoLLReq *req;
-
- XF86DGACheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DGAGetVideoLL, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XF86DGAGetVideoLL;
- req->screen = screen;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
-
- *offset = /*(char *)*/rep.offset;
- *width = rep.width;
- *bank_size = rep.bank_size;
- *ram_size = rep.ram_size;
-
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-
-Bool SDL_NAME(XF86DGADirectVideoLL)(
- Display* dpy,
- int screen,
- int enable
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXF86DGADirectVideoReq *req;
-
- XF86DGACheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DGADirectVideo, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XF86DGADirectVideo;
- req->screen = screen;
- req->enable = enable;
- UnlockDisplay(dpy);
- SyncHandle();
- XSync(dpy,False);
- return True;
-}
-
-Bool SDL_NAME(XF86DGAGetViewPortSize)(
- Display* dpy,
- int screen,
- int *width,
- int *height
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXF86DGAGetViewPortSizeReply rep;
- xXF86DGAGetViewPortSizeReq *req;
-
- XF86DGACheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DGAGetViewPortSize, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XF86DGAGetViewPortSize;
- req->screen = screen;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
-
- *width = rep.width;
- *height = rep.height;
-
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-
-Bool SDL_NAME(XF86DGASetViewPort)(
- Display* dpy,
- int screen,
- int x,
- int y
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXF86DGASetViewPortReq *req;
-
- XF86DGACheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DGASetViewPort, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XF86DGASetViewPort;
- req->screen = screen;
- req->x = x;
- req->y = y;
- UnlockDisplay(dpy);
- SyncHandle();
- XSync(dpy,False);
- return True;
-}
-
-
-Bool SDL_NAME(XF86DGAGetVidPage)(
- Display* dpy,
- int screen,
- int *vpage
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXF86DGAGetVidPageReply rep;
- xXF86DGAGetVidPageReq *req;
-
- XF86DGACheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DGAGetVidPage, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XF86DGAGetVidPage;
- req->screen = screen;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
-
- *vpage = rep.vpage;
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-
-Bool SDL_NAME(XF86DGASetVidPage)(
- Display* dpy,
- int screen,
- int vpage
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXF86DGASetVidPageReq *req;
-
- XF86DGACheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DGASetVidPage, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XF86DGASetVidPage;
- req->screen = screen;
- req->vpage = vpage;
- UnlockDisplay(dpy);
- SyncHandle();
- XSync(dpy,False);
- return True;
-}
-
-Bool SDL_NAME(XF86DGAInstallColormap)(
- Display* dpy,
- int screen,
- Colormap cmap
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXF86DGAInstallColormapReq *req;
-
- XF86DGACheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DGAInstallColormap, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XF86DGAInstallColormap;
- req->screen = screen;
- req->id = cmap;
- UnlockDisplay(dpy);
- SyncHandle();
- XSync(dpy,False);
- return True;
-}
-
-Bool SDL_NAME(XF86DGAQueryDirectVideo)(
- Display *dpy,
- int screen,
- int *flags
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXF86DGAQueryDirectVideoReply rep;
- xXF86DGAQueryDirectVideoReq *req;
-
- XF86DGACheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DGAQueryDirectVideo, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XF86DGAQueryDirectVideo;
- req->screen = screen;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
- *flags = rep.flags;
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-Bool SDL_NAME(XF86DGAViewPortChanged)(
- Display *dpy,
- int screen,
- int n
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXF86DGAViewPortChangedReply rep;
- xXF86DGAViewPortChangedReq *req;
-
- XF86DGACheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86DGAViewPortChanged, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XF86DGAViewPortChanged;
- req->screen = screen;
- req->n = n;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
- UnlockDisplay(dpy);
- SyncHandle();
- return rep.result;
-}
-
-
-
-/* Helper functions */
-
-#include <X11/Xmd.h>
-#include "../extensions/xf86dga.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <fcntl.h>
-#if defined(ISC)
-# define HAS_SVR3_MMAP
-# include <sys/types.h>
-# include <errno.h>
-
-# include <sys/at_ansi.h>
-# include <sys/kd.h>
-
-# include <sys/sysmacros.h>
-# include <sys/immu.h>
-# include <sys/region.h>
-
-# include <sys/mmap.h>
-#else
-# if !defined(Lynx)
-# if !defined(__EMX__)
-# include <sys/mman.h>
-# endif
-# else
-# include <sys/types.h>
-# include <errno.h>
-# include <smem.h>
-# endif
-#endif
-#include <sys/wait.h>
-#include <signal.h>
-#include <unistd.h>
-
-#if defined(SVR4) && !defined(sun) && !defined(SCO325)
-#define DEV_MEM "/dev/pmem"
-#elif defined(SVR4) && defined(sun)
-#define DEV_MEM "/dev/xsvc"
-#else
-#define DEV_MEM "/dev/mem"
-#endif
-
-typedef struct {
- unsigned long physaddr; /* actual requested physical address */
- unsigned long size; /* actual requested map size */
- unsigned long delta; /* delta to account for page alignment */
- void * vaddr; /* mapped address, without the delta */
- int refcount; /* reference count */
-} MapRec, *MapPtr;
-
-typedef struct {
- Display * display;
- int screen;
- MapPtr map;
-} ScrRec, *ScrPtr;
-
-static int mapFd = -1;
-static int numMaps = 0;
-static int numScrs = 0;
-static MapPtr *mapList = NULL;
-static ScrPtr *scrList = NULL;
-
-static MapPtr
-AddMap(void)
-{
- MapPtr *old;
-
- old = mapList;
- mapList = realloc(mapList, sizeof(MapPtr) * (numMaps + 1));
- if (!mapList) {
- mapList = old;
- return NULL;
- }
- mapList[numMaps] = malloc(sizeof(MapRec));
- if (!mapList[numMaps])
- return NULL;
- return mapList[numMaps++];
-}
-
-static ScrPtr
-AddScr(void)
-{
- ScrPtr *old;
-
- old = scrList;
- scrList = realloc(scrList, sizeof(ScrPtr) * (numScrs + 1));
- if (!scrList) {
- scrList = old;
- return NULL;
- }
- scrList[numScrs] = malloc(sizeof(ScrRec));
- if (!scrList[numScrs])
- return NULL;
- return scrList[numScrs++];
-}
-
-static MapPtr
-FindMap(unsigned long address, unsigned long size)
-{
- int i;
-
- for (i = 0; i < numMaps; i++) {
- if (mapList[i]->physaddr == address &&
- mapList[i]->size == size)
- return mapList[i];
- }
- return NULL;
-}
-
-static ScrPtr
-FindScr(Display *display, int screen)
-{
- int i;
-
- for (i = 0; i < numScrs; i++) {
- if (scrList[i]->display == display &&
- scrList[i]->screen == screen)
- return scrList[i];
- }
- return NULL;
-}
-
-static void *
-MapPhysAddress(unsigned long address, unsigned long size)
-{
- unsigned long offset, delta;
- int pagesize = -1;
- void *vaddr;
- MapPtr mp;
-#if defined(ISC) && defined(HAS_SVR3_MMAP)
- struct kd_memloc mloc;
-#elif defined(__EMX__)
- APIRET rc;
- ULONG action;
- HFILE hfd;
-#endif
-
- if ((mp = FindMap(address, size))) {
- mp->refcount++;
- return (void *)((unsigned long)mp->vaddr + mp->delta);
- }
-
-#if defined(_SC_PAGESIZE) && defined(HAS_SC_PAGESIZE)
- pagesize = sysconf(_SC_PAGESIZE);
-#endif
-#ifdef _SC_PAGE_SIZE
- if (pagesize == -1)
- pagesize = sysconf(_SC_PAGE_SIZE);
-#endif
-#ifdef HAS_GETPAGESIZE
- if (pagesize == -1)
- pagesize = getpagesize();
-#endif
-#ifdef PAGE_SIZE
- if (pagesize == -1)
- pagesize = PAGE_SIZE;
-#endif
- if (pagesize == -1)
- pagesize = 4096;
-
- delta = address % pagesize;
- offset = address - delta;
-
-#if defined(ISC) && defined(HAS_SVR3_MMAP)
- if (mapFd < 0) {
- if ((mapFd = open("/dev/mmap", O_RDWR)) < 0)
- return NULL;
- }
- mloc.vaddr = (char *)0;
- mloc.physaddr = (char *)offset;
- mloc.length = size + delta;
- mloc.ioflg=1;
-
- if ((vaddr = (void *)ioctl(mapFd, MAP, &mloc)) == (void *)-1)
- return NULL;
-#elif defined (__EMX__)
- /*
- * Dragon warning here! /dev/pmap$ is never closed, except on progam exit.
- * Consecutive calling of this routine will make PMAP$ driver run out
- * of memory handles. Some umap/close mechanism should be provided
- */
-
- rc = DosOpen("/dev/pmap$", &hfd, &action, 0, FILE_NORMAL, FILE_OPEN,
- OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE, (PEAOP2)NULL);
- if (rc != 0)
- return NULL;
- {
- struct map_ioctl {
- union {
- ULONG phys;
- void* user;
- } a;
- ULONG size;
- } pmap,dmap;
- ULONG plen,dlen;
-#define XFREE86_PMAP 0x76
-#define PMAP_MAP 0x44
-
- pmap.a.phys = offset;
- pmap.size = size + delta;
- rc = DosDevIOCtl(hfd, XFREE86_PMAP, PMAP_MAP,
- (PULONG)&pmap, sizeof(pmap), &plen,
- (PULONG)&dmap, sizeof(dmap), &dlen);
- if (rc == 0) {
- vaddr = dmap.a.user;
- }
- }
- if (rc != 0)
- return NULL;
-#elif defined (Lynx)
- vaddr = (void *)smem_create("XF86DGA", (char *)offset,
- size + delta, SM_READ|SM_WRITE);
-#else
-#ifndef MAP_FILE
-#define MAP_FILE 0
-#endif
- if (mapFd < 0) {
- if ((mapFd = open(DEV_MEM, O_RDWR)) < 0)
- return NULL;
- }
- vaddr = (void *)mmap(NULL, size + delta, PROT_READ | PROT_WRITE,
- MAP_FILE | MAP_SHARED, mapFd, (off_t)offset);
- if (vaddr == (void *)-1)
- return NULL;
-#endif
-
- if (!vaddr) {
- if (!(mp = AddMap()))
- return NULL;
- mp->physaddr = address;
- mp->size = size;
- mp->delta = delta;
- mp->vaddr = vaddr;
- mp->refcount = 1;
- }
- return (void *)((unsigned long)vaddr + delta);
-}
-
-/*
- * Still need to find a clean way of detecting the death of a DGA app
- * and returning things to normal - Jon
- * This is here to help debugging without rebooting... Also C-A-BS
- * should restore text mode.
- */
-
-int
-SDL_NAME(XF86DGAForkApp)(int screen)
-{
- pid_t pid;
- int status;
- int i;
-
- /* fork the app, parent hangs around to clean up */
- if ((pid = fork()) > 0) {
- ScrPtr sp;
-
- waitpid(pid, &status, 0);
- for (i = 0; i < numScrs; i++) {
- sp = scrList[i];
- SDL_NAME(XF86DGADirectVideoLL)(sp->display, sp->screen, 0);
- XSync(sp->display, False);
- }
- if (WIFEXITED(status))
- _exit(0);
- else
- _exit(-1);
- }
- return pid;
-}
-
-
-Bool
-SDL_NAME(XF86DGADirectVideo)(
- Display *dis,
- int screen,
- int enable
-){
- ScrPtr sp;
- MapPtr mp = NULL;
-
- if ((sp = FindScr(dis, screen)))
- mp = sp->map;
-
- if (enable & XF86DGADirectGraphics) {
-#if !defined(ISC) && !defined(HAS_SVR3_MMAP) && !defined(Lynx) \
- && !defined(__EMX__)
- if (mp && mp->vaddr)
- mprotect(mp->vaddr, mp->size + mp->delta, PROT_READ | PROT_WRITE);
-#endif
- } else {
-#if !defined(ISC) && !defined(HAS_SVR3_MMAP) && !defined(Lynx) \
- && !defined(__EMX__)
- if (mp && mp->vaddr)
- mprotect(mp->vaddr, mp->size + mp->delta, PROT_READ);
-#elif defined(Lynx)
- /* XXX this doesn't allow enable after disable */
- smem_create(NULL, mp->vaddr, mp->size + mp->delta, SM_DETACH);
- smem_remove("XF86DGA");
-#endif
- }
-
- SDL_NAME(XF86DGADirectVideoLL)(dis, screen, enable);
- return 1;
-}
-
-
-static void
-XF86cleanup(int sig)
-{
- ScrPtr sp;
- int i;
- static char beenhere = 0;
-
- if (beenhere)
- _exit(3);
- beenhere = 1;
-
- for (i = 0; i < numScrs; i++) {
- sp = scrList[i];
- SDL_NAME(XF86DGADirectVideo)(sp->display, sp->screen, 0);
- XSync(sp->display, False);
- }
- _exit(3);
-}
-
-Bool
-SDL_NAME(XF86DGAGetVideo)(
- Display *dis,
- int screen,
- char **addr,
- int *width,
- int *bank,
- int *ram
-){
- /*unsigned long*/ int offset;
- static int beenHere = 0;
- ScrPtr sp;
- MapPtr mp;
-
- if (!(sp = FindScr(dis, screen))) {
- if (!(sp = AddScr())) {
- fprintf(stderr, "XF86DGAGetVideo: malloc failure\n");
- exit(-2);
- }
- sp->display = dis;
- sp->screen = screen;
- sp->map = NULL;
- }
-
- SDL_NAME(XF86DGAGetVideoLL)(dis, screen , &offset, width, bank, ram);
-
- *addr = MapPhysAddress(offset, *bank);
- if (*addr == NULL) {
- fprintf(stderr, "XF86DGAGetVideo: failed to map video memory (%s)\n",
- strerror(errno));
- exit(-2);
- }
-
- if ((mp = FindMap(offset, *bank)))
- sp->map = mp;
-
- if (!beenHere) {
- beenHere = 1;
- atexit((void(*)(void))XF86cleanup);
- /* one shot XF86cleanup attempts */
- signal(SIGSEGV, XF86cleanup);
-#ifdef SIGBUS
- signal(SIGBUS, XF86cleanup);
-#endif
- signal(SIGHUP, XF86cleanup);
- signal(SIGFPE, XF86cleanup);
- }
-
- return 1;
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/Xext/Xxf86dga/XF86DGA2.c b/distrib/sdl-1.2.12/src/video/Xext/Xxf86dga/XF86DGA2.c
deleted file mode 100644
index 3acf9f8..0000000
--- a/distrib/sdl-1.2.12/src/video/Xext/Xxf86dga/XF86DGA2.c
+++ /dev/null
@@ -1,988 +0,0 @@
-/* $XFree86: xc/lib/Xxf86dga/XF86DGA2.c,v 1.18 2001/08/17 13:27:51 dawes Exp $ */
-/*
-
-Copyright (c) 1995 Jon Tombs
-Copyright (c) 1995,1996 The XFree86 Project, Inc
-
-*/
-
-/* THIS IS NOT AN X CONSORTIUM STANDARD */
-
-#ifdef __EMX__ /* needed here to override certain constants in X headers */
-#define INCL_DOS
-#define INCL_DOSIOCTL
-#include <os2.h>
-#endif
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-
-#include <X11/Xlibint.h>
-#include "../extensions/xf86dga.h"
-#include "../extensions/xf86dgastr.h"
-#include "../extensions/Xext.h"
-#include "../extensions/extutil.h"
-#include <stdio.h>
-
-#if defined(ENABLE_FBCON) /* Needed for framebuffer console support */
-#include <sys/ioctl.h>
-#include <linux/fb.h>
-#endif
-
-/* If you change this, change the Bases[] array below as well */
-#define MAX_HEADS 16
-
-char *SDL_NAME(xdga_extension_name) = XF86DGANAME;
-
-static XExtensionInfo _xdga_info_data;
-static XExtensionInfo *xdga_info = &_xdga_info_data;
-
-
-Bool SDL_NAME(XDGAMapFramebuffer)(int, char *, unsigned char*, CARD32, CARD32, CARD32);
-void SDL_NAME(XDGAUnmapFramebuffer)(int);
-unsigned char* SDL_NAME(XDGAGetMappedMemory)(int);
-
-#define XDGACheckExtension(dpy,i,val) \
- XextCheckExtension (dpy, i, SDL_NAME(xdga_extension_name), val)
-
-/*****************************************************************************
- * *
- * private utility routines *
- * *
- *****************************************************************************/
-
-static int xdga_close_display(Display *dpy, XExtCodes *codes);
-static Bool xdga_wire_to_event(Display *dpy, XEvent *event, xEvent *wire_ev);
-static Status xdga_event_to_wire(Display *dpy, XEvent *event, xEvent *wire_ev);
-
-static XExtensionHooks xdga_extension_hooks = {
- NULL, /* create_gc */
- NULL, /* copy_gc */
- NULL, /* flush_gc */
- NULL, /* free_gc */
- NULL, /* create_font */
- NULL, /* free_font */
- xdga_close_display, /* close_display */
- xdga_wire_to_event, /* wire_to_event */
- xdga_event_to_wire, /* event_to_wire */
- NULL, /* error */
- NULL, /* error_string */
-};
-
-static XEXT_GENERATE_CLOSE_DISPLAY (xdga_close_display, xdga_info)
-
-
-XEXT_GENERATE_FIND_DISPLAY (SDL_NAME(xdga_find_display), xdga_info,
- "XFree86-DGA",
- &xdga_extension_hooks,
- 0, NULL)
-
-
-static Status
-xdga_event_to_wire(
- Display *dpy,
- XEvent *event,
- xEvent *wire_ev
-){
- return True;
-}
-
-static Bool
-xdga_wire_to_event(
- Display *dpy,
- XEvent *event,
- xEvent *wire_ev
-){
- dgaEvent *wire = (dgaEvent *) wire_ev;
- SDL_NAME(XDGAButtonEvent) *bevent;
- SDL_NAME(XDGAKeyEvent) *kevent;
- SDL_NAME(XDGAMotionEvent) *mevent;
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
-
- XDGACheckExtension (dpy, info, False);
-
- switch((wire->u.u.type & 0x7f) - info->codes->first_event) {
- case MotionNotify:
- mevent = (SDL_NAME(XDGAMotionEvent)*)event;
- mevent->type = wire->u.u.type & 0x7F;
- mevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *)wire);
- mevent->display = dpy;
- mevent->screen = wire->u.event.screen;
- mevent->time = wire->u.event.time;
- mevent->state = wire->u.event.state;
- mevent->dx = wire->u.event.dx;
- mevent->dy = wire->u.event.dy;
- return True;
- case ButtonPress:
- case ButtonRelease:
- bevent = (SDL_NAME(XDGAButtonEvent)*)event;
- bevent->type = wire->u.u.type & 0x7F;
- bevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *)wire);
- bevent->display = dpy;
- bevent->screen = wire->u.event.screen;
- bevent->time = wire->u.event.time;
- bevent->state = wire->u.event.state;
- bevent->button = wire->u.u.detail;
- return True;
- case KeyPress:
- case KeyRelease:
- kevent = (SDL_NAME(XDGAKeyEvent)*)event;
- kevent->type = wire->u.u.type & 0x7F;
- kevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *)wire);
- kevent->display = dpy;
- kevent->screen = wire->u.event.screen;
- kevent->time = wire->u.event.time;
- kevent->state = wire->u.event.state;
- kevent->keycode = wire->u.u.detail;
- return True;
- }
-
- return False;
-}
-
-
-Bool SDL_NAME(XDGAQueryExtension) (
- Display *dpy,
- int *event_basep,
- int *error_basep
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
-
- if (XextHasExtension(info)) {
- *event_basep = info->codes->first_event;
- *error_basep = info->codes->first_error;
- return True;
- } else {
- return False;
- }
-}
-
-
-Bool SDL_NAME(XDGAQueryVersion)(
- Display *dpy,
- int *majorVersion,
- int *minorVersion
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXDGAQueryVersionReply rep;
- xXDGAQueryVersionReq *req;
-
- XDGACheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XDGAQueryVersion, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XDGAQueryVersion;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
- *majorVersion = rep.majorVersion;
- *minorVersion = rep.minorVersion;
- UnlockDisplay(dpy);
- SyncHandle();
- if (*majorVersion >= 2)
- {
- int i, j;
-
- for (i = 0, j = info->codes->first_event;
- i < XF86DGANumberEvents;
- i++, j++)
- {
- XESetWireToEvent(dpy, j, xdga_wire_to_event);
- XESetEventToWire(dpy, j, xdga_event_to_wire);
- }
- SDL_NAME(XDGASetClientVersion)(dpy);
- }
- return True;
-}
-
-Bool SDL_NAME(XDGASetClientVersion)(
- Display *dpy
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXDGASetClientVersionReq *req;
-
- XDGACheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XDGASetClientVersion, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XDGASetClientVersion;
- req->major = XDGA_MAJOR_VERSION;
- req->minor = XDGA_MINOR_VERSION;
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-Bool SDL_NAME(XDGAOpenFramebuffer)(
- Display *dpy,
- int screen
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXDGAOpenFramebufferReply rep;
- xXDGAOpenFramebufferReq *req;
- char *deviceName = NULL;
- Bool ret;
-
- XDGACheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XDGAOpenFramebuffer, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XDGAOpenFramebuffer;
- req->screen = screen;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
-
- if(rep.length) {
- deviceName = Xmalloc(rep.length << 2);
- _XRead(dpy, deviceName, rep.length << 2);
- }
-
- ret = SDL_NAME(XDGAMapFramebuffer)(screen, deviceName,
- (unsigned char*)(long)rep.mem1,
- rep.size, rep.offset, rep.extra);
-
- if(deviceName)
- Xfree(deviceName);
-
- UnlockDisplay(dpy);
- SyncHandle();
- return ret;
-}
-
-void SDL_NAME(XDGACloseFramebuffer)(
- Display *dpy,
- int screen
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXDGACloseFramebufferReq *req;
-
- XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name));
-
- SDL_NAME(XDGAUnmapFramebuffer)(screen);
-
- LockDisplay(dpy);
- GetReq(XDGACloseFramebuffer, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XDGACloseFramebuffer;
- req->screen = screen;
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-
-
-SDL_NAME(XDGAMode)* SDL_NAME(XDGAQueryModes)(
- Display *dpy,
- int screen,
- int *num
-){
- XExtDisplayInfo *dinfo = SDL_NAME(xdga_find_display) (dpy);
- xXDGAQueryModesReply rep;
- xXDGAQueryModesReq *req;
- SDL_NAME(XDGAMode) *modes = NULL;
-
- *num = 0;
-
- XDGACheckExtension (dpy, dinfo, NULL);
-
- LockDisplay(dpy);
- GetReq(XDGAQueryModes, req);
- req->reqType = dinfo->codes->major_opcode;
- req->dgaReqType = X_XDGAQueryModes;
- req->screen = screen;
-
- if (_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- if(rep.length) {
- xXDGAModeInfo info;
- int i, size;
- char *offset;
-
- size = rep.length << 2;
- size -= rep.number * sz_xXDGAModeInfo; /* find text size */
- modes = (SDL_NAME(XDGAMode)*)Xmalloc((rep.number * sizeof(SDL_NAME(XDGAMode))) + size);
- offset = (char*)(&modes[rep.number]); /* start of text */
-
-
- if(modes) {
- for(i = 0; i < rep.number; i++) {
- _XRead(dpy, (char*)(&info), sz_xXDGAModeInfo);
-
- modes[i].num = info.num;
- modes[i].verticalRefresh =
- (float)info.vsync_num / (float)info.vsync_den;
- modes[i].flags = info.flags;
- modes[i].imageWidth = info.image_width;
- modes[i].imageHeight = info.image_height;
- modes[i].pixmapWidth = info.pixmap_width;
- modes[i].pixmapHeight = info.pixmap_height;
- modes[i].bytesPerScanline = info.bytes_per_scanline;
- modes[i].byteOrder = info.byte_order;
- modes[i].depth = info.depth;
- modes[i].bitsPerPixel = info.bpp;
- modes[i].redMask = info.red_mask;
- modes[i].greenMask = info.green_mask;
- modes[i].blueMask = info.blue_mask;
- modes[i].visualClass = info.visual_class;
- modes[i].viewportWidth = info.viewport_width;
- modes[i].viewportHeight = info.viewport_height;
- modes[i].xViewportStep = info.viewport_xstep;
- modes[i].yViewportStep = info.viewport_ystep;
- modes[i].maxViewportX = info.viewport_xmax;
- modes[i].maxViewportY = info.viewport_ymax;
- modes[i].viewportFlags = info.viewport_flags;
- modes[i].reserved1 = info.reserved1;
- modes[i].reserved2 = info.reserved2;
-
- _XRead(dpy, offset, info.name_size);
- modes[i].name = offset;
- offset += info.name_size;
- }
- *num = rep.number;
- } else
- _XEatData(dpy, rep.length << 2);
- }
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- return modes;
-}
-
-
-SDL_NAME(XDGADevice) *
-SDL_NAME(XDGASetMode)(
- Display *dpy,
- int screen,
- int mode
-){
- XExtDisplayInfo *dinfo = SDL_NAME(xdga_find_display) (dpy);
- xXDGASetModeReply rep;
- xXDGASetModeReq *req;
- SDL_NAME(XDGADevice) *dev = NULL;
- Pixmap pid;
-
- XDGACheckExtension (dpy, dinfo, NULL);
-
- LockDisplay(dpy);
- GetReq(XDGASetMode, req);
- req->reqType = dinfo->codes->major_opcode;
- req->dgaReqType = X_XDGASetMode;
- req->screen = screen;
- req->mode = mode;
- req->pid = pid = XAllocID(dpy);
-
- if (_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- if(rep.length) {
- xXDGAModeInfo info;
- int size;
-
- size = rep.length << 2;
- size -= sz_xXDGAModeInfo; /* get text size */
-
- dev = (SDL_NAME(XDGADevice)*)Xmalloc(sizeof(SDL_NAME(XDGADevice)) + size);
-
- if(dev) {
- _XRead(dpy, (char*)(&info), sz_xXDGAModeInfo);
-
- dev->mode.num = info.num;
- dev->mode.verticalRefresh =
- (float)info.vsync_num / (float)info.vsync_den;
- dev->mode.flags = info.flags;
- dev->mode.imageWidth = info.image_width;
- dev->mode.imageHeight = info.image_height;
- dev->mode.pixmapWidth = info.pixmap_width;
- dev->mode.pixmapHeight = info.pixmap_height;
- dev->mode.bytesPerScanline = info.bytes_per_scanline;
- dev->mode.byteOrder = info.byte_order;
- dev->mode.depth = info.depth;
- dev->mode.bitsPerPixel = info.bpp;
- dev->mode.redMask = info.red_mask;
- dev->mode.greenMask = info.green_mask;
- dev->mode.blueMask = info.blue_mask;
- dev->mode.visualClass = info.visual_class;
- dev->mode.viewportWidth = info.viewport_width;
- dev->mode.viewportHeight = info.viewport_height;
- dev->mode.xViewportStep = info.viewport_xstep;
- dev->mode.yViewportStep = info.viewport_ystep;
- dev->mode.maxViewportX = info.viewport_xmax;
- dev->mode.maxViewportY = info.viewport_ymax;
- dev->mode.viewportFlags = info.viewport_flags;
- dev->mode.reserved1 = info.reserved1;
- dev->mode.reserved2 = info.reserved2;
-
- dev->mode.name = (char*)(&dev[1]);
- _XRead(dpy, dev->mode.name, info.name_size);
-
- dev->pixmap = (rep.flags & XDGAPixmap) ? pid : 0;
- dev->data = SDL_NAME(XDGAGetMappedMemory)(screen);
-
- if(dev->data)
- dev->data += rep.offset;
- }
- /* not sure what to do if the allocation fails */
- }
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- return dev;
-}
-
-
-void SDL_NAME(XDGASetViewport)(
- Display *dpy,
- int screen,
- int x,
- int y,
- int flags
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXDGASetViewportReq *req;
-
- XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name));
-
- LockDisplay(dpy);
- GetReq(XDGASetViewport, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XDGASetViewport;
- req->screen = screen;
- req->x = x;
- req->y = y;
- req->flags = flags;
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-
-void SDL_NAME(XDGAInstallColormap)(
- Display *dpy,
- int screen,
- Colormap cmap
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXDGAInstallColormapReq *req;
-
- XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name));
-
- LockDisplay(dpy);
- GetReq(XDGAInstallColormap, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XDGAInstallColormap;
- req->screen = screen;
- req->cmap = cmap;
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-void SDL_NAME(XDGASelectInput)(
- Display *dpy,
- int screen,
- long mask
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXDGASelectInputReq *req;
-
- XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name));
-
- LockDisplay(dpy);
- GetReq(XDGASelectInput, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XDGASelectInput;
- req->screen = screen;
- req->mask = mask;
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-void SDL_NAME(XDGAFillRectangle)(
- Display *dpy,
- int screen,
- int x,
- int y,
- unsigned int width,
- unsigned int height,
- unsigned long color
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXDGAFillRectangleReq *req;
-
- XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name));
-
- LockDisplay(dpy);
- GetReq(XDGAFillRectangle, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XDGAFillRectangle;
- req->screen = screen;
- req->x = x;
- req->y = y;
- req->width = width;
- req->height = height;
- req->color = color;
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-void SDL_NAME(XDGACopyArea)(
- Display *dpy,
- int screen,
- int srcx,
- int srcy,
- unsigned int width,
- unsigned int height,
- int dstx,
- int dsty
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXDGACopyAreaReq *req;
-
- XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name));
-
- LockDisplay(dpy);
- GetReq(XDGACopyArea, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XDGACopyArea;
- req->screen = screen;
- req->srcx = srcx;
- req->srcy = srcy;
- req->width = width;
- req->height = height;
- req->dstx = dstx;
- req->dsty = dsty;
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-void SDL_NAME(XDGACopyTransparentArea)(
- Display *dpy,
- int screen,
- int srcx,
- int srcy,
- unsigned int width,
- unsigned int height,
- int dstx,
- int dsty,
- unsigned long key
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXDGACopyTransparentAreaReq *req;
-
- XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name));
-
- LockDisplay(dpy);
- GetReq(XDGACopyTransparentArea, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XDGACopyTransparentArea;
- req->screen = screen;
- req->srcx = srcx;
- req->srcy = srcy;
- req->width = width;
- req->height = height;
- req->dstx = dstx;
- req->dsty = dsty;
- req->key = key;
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-
-int SDL_NAME(XDGAGetViewportStatus)(
- Display *dpy,
- int screen
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXDGAGetViewportStatusReply rep;
- xXDGAGetViewportStatusReq *req;
- int status = 0;
-
- XDGACheckExtension (dpy, info, 0);
-
- LockDisplay(dpy);
- GetReq(XDGAGetViewportStatus, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XDGAGetViewportStatus;
- req->screen = screen;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse))
- status = rep.status;
- UnlockDisplay(dpy);
- SyncHandle();
- return status;
-}
-
-void SDL_NAME(XDGASync)(
- Display *dpy,
- int screen
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXDGASyncReply rep;
- xXDGASyncReq *req;
-
- XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name));
-
- LockDisplay(dpy);
- GetReq(XDGASync, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XDGASync;
- req->screen = screen;
- _XReply(dpy, (xReply *)&rep, 0, xFalse);
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-
-void SDL_NAME(XDGAChangePixmapMode)(
- Display *dpy,
- int screen,
- int *x,
- int *y,
- int mode
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXDGAChangePixmapModeReq *req;
- xXDGAChangePixmapModeReply rep;
-
- XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name));
-
- LockDisplay(dpy);
- GetReq(XDGAChangePixmapMode, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XDGAChangePixmapMode;
- req->screen = screen;
- req->x = *x;
- req->y = *y;
- req->flags = mode;
- _XReply(dpy, (xReply *)&rep, 0, xFalse);
- *x = rep.x;
- *y = rep.y;
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-Colormap SDL_NAME(XDGACreateColormap)(
- Display *dpy,
- int screen,
- SDL_NAME(XDGADevice) *dev,
- int alloc
-){
- XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
- xXDGACreateColormapReq *req;
- Colormap cid;
-
- XDGACheckExtension (dpy, info, -1);
-
- LockDisplay(dpy);
- GetReq(XDGACreateColormap, req);
- req->reqType = info->codes->major_opcode;
- req->dgaReqType = X_XDGACreateColormap;
- req->screen = screen;
- req->mode = dev->mode.num;
- req->alloc = alloc;
- cid = req->id = XAllocID(dpy);
- UnlockDisplay(dpy);
- SyncHandle();
-
- return cid;
-}
-
-
-void SDL_NAME(XDGAKeyEventToXKeyEvent)(
- SDL_NAME(XDGAKeyEvent)* dk,
- XKeyEvent* xk
-){
- xk->type = dk->type;
- xk->serial = dk->serial;
- xk->send_event = False;
- xk->display = dk->display;
- xk->window = RootWindow(dk->display, dk->screen);
- xk->root = xk->window;
- xk->subwindow = None;
- xk->time = dk->time;
- xk->x = xk->y = xk->x_root = xk->y_root = 0;
- xk->state = dk->state;
- xk->keycode = dk->keycode;
- xk->same_screen = True;
-}
-
-#include <X11/Xmd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <fcntl.h>
-#if defined(ISC)
-# define HAS_SVR3_MMAP
-# include <sys/types.h>
-# include <errno.h>
-
-# include <sys/at_ansi.h>
-# include <sys/kd.h>
-
-# include <sys/sysmacros.h>
-# include <sys/immu.h>
-# include <sys/region.h>
-
-# include <sys/mmap.h>
-#else
-# if !defined(Lynx)
-# if !defined(__EMX__)
-# include <sys/mman.h>
-# endif
-# else
-# include <sys/types.h>
-# include <errno.h>
-# include <smem.h>
-# endif
-#endif
-#include <sys/wait.h>
-#include <signal.h>
-#include <unistd.h>
-
-#if defined(SVR4) && !defined(sun) && !defined(SCO325)
-#define DEV_MEM "/dev/pmem"
-#elif defined(SVR4) && defined(sun)
-#define DEV_MEM "/dev/xsvc"
-#else
-#define DEV_MEM "/dev/mem"
-#endif
-
-
-
-typedef struct _DGAMapRec{
- unsigned char *physical;
- unsigned char *virtual;
- CARD32 size;
- int fd;
- int screen;
- struct _DGAMapRec *next;
-} DGAMapRec, *DGAMapPtr;
-
-static Bool
-DGAMapPhysical(int, char*, unsigned char*, CARD32, CARD32, CARD32, DGAMapPtr);
-static void DGAUnmapPhysical(DGAMapPtr);
-
-static DGAMapPtr _Maps = NULL;
-
-
-unsigned char*
-SDL_NAME(XDGAGetMappedMemory)(int screen)
-{
- DGAMapPtr pMap = _Maps;
- unsigned char *pntr = NULL;
-
- while(pMap != NULL) {
- if(pMap->screen == screen) {
- pntr = pMap->virtual;
- break;
- }
- pMap = pMap->next;
- }
-
- return pntr;
-}
-
-Bool
-SDL_NAME(XDGAMapFramebuffer)(
- int screen,
- char *name, /* optional device name */
- unsigned char* base, /* physical memory */
- CARD32 size, /* size */
- CARD32 offset, /* optional offset */
- CARD32 extra /* optional extra data */
-){
- DGAMapPtr pMap = _Maps;
- Bool result;
-
- /* is it already mapped ? */
- while(pMap != NULL) {
- if(pMap->screen == screen)
- return True;
- pMap = pMap->next;
- }
-
- if(extra & XDGANeedRoot) {
- /* we should probably check if we have root permissions and
- return False here */
-
- }
-
- pMap = (DGAMapPtr)Xmalloc(sizeof(DGAMapRec));
-
- result = DGAMapPhysical(screen, name, base, size, offset, extra, pMap);
-
- if(result) {
- pMap->next = _Maps;
- _Maps = pMap;
- } else
- Xfree(pMap);
-
- return result;
-}
-
-void
-SDL_NAME(XDGAUnmapFramebuffer)(int screen)
-{
- DGAMapPtr pMap = _Maps;
- DGAMapPtr pPrev = NULL;
-
- /* is it already mapped */
- while(pMap != NULL) {
- if(pMap->screen == screen)
- break;
- pPrev = pMap;
- pMap = pMap->next;
- }
-
- if(!pMap)
- return;
-
- DGAUnmapPhysical(pMap);
-
- if(!pPrev)
- _Maps = pMap->next;
- else
- pPrev->next = pMap->next;
-
- Xfree(pMap);
-}
-
-
-static Bool
-DGAMapPhysical(
- int screen,
- char *name, /* optional device name */
- unsigned char* base, /* physical memory */
- CARD32 size, /* size */
- CARD32 offset, /* optional offset */
- CARD32 extra, /* optional extra data */
- DGAMapPtr pMap
-) {
-#if defined(ISC) && defined(HAS_SVR3_MMAP)
- struct kd_memloc mloc;
-#elif defined(__EMX__)
- APIRET rc;
- ULONG action;
- HFILE hfd;
-#endif
-
- base += offset;
-
- pMap->screen = screen;
- pMap->physical = base;
- pMap->size = size;
-
-#if defined(ISC) && defined(HAS_SVR3_MMAP)
- if ((pMap->fd = open("/dev/mmap", O_RDWR)) < 0)
- return False;
- mloc.vaddr = (char *)0;
- mloc.physaddr = (char *)base;
- mloc.length = size;
- mloc.ioflg=1;
-
- if ((pMap->virtual = (void *)ioctl(pMap->fd, MAP, &mloc)) == (void *)-1)
- return False;
-#elif defined (__EMX__)
- /*
- * Dragon warning here! /dev/pmap$ is never closed, except on progam exit.
- * Consecutive calling of this routine will make PMAP$ driver run out
- * of memory handles. Some umap/close mechanism should be provided
- */
-
- rc = DosOpen("/dev/pmap$", &hfd, &action, 0, FILE_NORMAL, FILE_OPEN,
- OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE, (PEAOP2)NULL);
- if (rc != 0)
- return False;
- {
- struct map_ioctl {
- union {
- ULONG phys;
- void* user;
- } a;
- ULONG size;
- } pmap,dmap;
- ULONG plen,dlen;
-#define XFREE86_PMAP 0x76
-#define PMAP_MAP 0x44
-
- pmap.a.phys = base;
- pmap.size = size;
- rc = DosDevIOCtl(hfd, XFREE86_PMAP, PMAP_MAP,
- (PULONG)&pmap, sizeof(pmap), &plen,
- (PULONG)&dmap, sizeof(dmap), &dlen);
- if (rc == 0) {
- pMap->virtual = dmap.a.user;
- }
- }
- if (rc != 0)
- return False;
-#elif defined (Lynx)
- pMap->virtual = smem_create("XF86DGA", (char*)base, size, SM_READ|SM_WRITE);
-#else
-#ifndef MAP_FILE
-#define MAP_FILE 0
-#endif
- if (!name)
- name = DEV_MEM;
- if ((pMap->fd = open(name, O_RDWR)) < 0)
-#if defined(ENABLE_FBCON)
- { /* /dev/fb0 fallback added by Sam Lantinga <hercules@lokigames.com> */
- /* Try to fall back to /dev/fb on Linux - FIXME: verify the device */
- struct fb_fix_screeninfo finfo;
-
- if ((pMap->fd = open("/dev/fb0", O_RDWR)) < 0) {
- return False;
- }
- /* The useable framebuffer console memory may not be the whole
- framebuffer that X has access to. :-(
- */
- if ( ioctl(pMap->fd, FBIOGET_FSCREENINFO, &finfo) < 0 ) {
- close(pMap->fd);
- return False;
- }
- /* Warning: On PPC, the size and virtual need to be offset by:
- (((long)finfo.smem_start) -
- (((long)finfo.smem_start)&~(PAGE_SIZE-1)))
- */
- base = 0;
- size = pMap->size = finfo.smem_len;
- }
-#else
- return False;
-#endif
- pMap->virtual = mmap(NULL, size, PROT_READ | PROT_WRITE,
- MAP_FILE | MAP_SHARED, pMap->fd, (off_t)base);
- if (pMap->virtual == (void *)-1)
- return False;
-#endif
-
-#if !defined(ISC) && !defined(HAS_SVR3_MMAP) && !defined(Lynx) \
- && !defined(__EMX__)
- mprotect(pMap->virtual, size, PROT_READ | PROT_WRITE);
-#endif
-
- return True;
-}
-
-
-
-static void
-DGAUnmapPhysical(DGAMapPtr pMap)
-{
-#if !defined(ISC) && !defined(HAS_SVR3_MMAP) && !defined(Lynx) \
- && !defined(__EMX__)
- mprotect(pMap->virtual,pMap->size, PROT_READ);
-#elif defined(Lynx)
- /* XXX this doesn't allow enable after disable */
- smem_create(NULL, pMap->virtual, pMap->size, SM_DETACH);
- smem_remove("XF86DGA");
-#endif
-
-
- /* We need to unmap and close too !!!!!!!!!!*/
-}
diff --git a/distrib/sdl-1.2.12/src/video/Xext/Xxf86vm/XF86VMode.c b/distrib/sdl-1.2.12/src/video/Xext/Xxf86vm/XF86VMode.c
deleted file mode 100644
index 7901991..0000000
--- a/distrib/sdl-1.2.12/src/video/Xext/Xxf86vm/XF86VMode.c
+++ /dev/null
@@ -1,1223 +0,0 @@
-/* $XConsortium: XF86VMode.c /main/2 1995/11/14 18:17:58 kaleb $ */
-/* $XFree86: xc/lib/Xxf86vm/XF86VMode.c,v 3.32 2001/07/25 15:04:54 dawes Exp $ */
-/*
-
-Copyright (c) 1995 Kaleb S. KEITHLEY
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES
-OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of Kaleb S. KEITHLEY
-shall not be used in advertising or otherwise to promote the sale, use
-or other dealings in this Software without prior written authorization
-from Kaleb S. KEITHLEY.
-
-*/
-/* $XConsortium: XF86VMode.c /main/4 1996/01/16 07:52:25 kaleb CHECKEDOUT $ */
-
-/* THIS IS NOT AN X CONSORTIUM STANDARD */
-
-#define NEED_EVENTS
-#define NEED_REPLIES
-
-#ifndef XBUILD_IN_CLIENT
-#include <X11/Xlibint.h>
-#include "../extensions/xf86vmstr.h"
-#include "../extensions/Xext.h"
-#include "../extensions/extutil.h"
-#else
-#include "lib/X11/Xlibint.h"
-#include "include/extensions/xf86vmstr.h"
-#include "include/extensions/Xext.h"
-#include "include/extensions/extutil.h"
-#endif
-
-#ifdef DEBUG
-#include <stdio.h>
-#endif
-
-#ifndef MODE_BAD
-#define MODE_BAD 255
-#endif
-
-static XExtensionInfo _xf86vidmode_info_data;
-static XExtensionInfo *xf86vidmode_info = &_xf86vidmode_info_data;
-static char *xf86vidmode_extension_name = XF86VIDMODENAME;
-
-#define XF86VidModeCheckExtension(dpy,i,val) \
- XextCheckExtension (dpy, i, xf86vidmode_extension_name, val)
-
-/*****************************************************************************
- * *
- * private utility routines *
- * *
- *****************************************************************************/
-
-static XEXT_CLOSE_DISPLAY_PROTO(close_display);
-static /* const */ XExtensionHooks xf86vidmode_extension_hooks = {
- NULL, /* create_gc */
- NULL, /* copy_gc */
- NULL, /* flush_gc */
- NULL, /* free_gc */
- NULL, /* create_font */
- NULL, /* free_font */
- close_display, /* close_display */
- NULL, /* wire_to_event */
- NULL, /* event_to_wire */
- NULL, /* error */
- NULL, /* error_string */
-};
-
-static XEXT_GENERATE_FIND_DISPLAY (find_display, xf86vidmode_info,
- xf86vidmode_extension_name,
- &xf86vidmode_extension_hooks,
- 0, NULL)
-
-static XEXT_GENERATE_CLOSE_DISPLAY (close_display, xf86vidmode_info)
-
-
-/*****************************************************************************
- * *
- * public XFree86-VidMode Extension routines *
- * *
- *****************************************************************************/
-
-Bool
-SDL_NAME(XF86VidModeQueryExtension) (dpy, event_basep, error_basep)
- Display *dpy;
- int *event_basep, *error_basep;
-{
- XExtDisplayInfo *info = find_display (dpy);
-
- if (XextHasExtension(info)) {
- *event_basep = info->codes->first_event;
- *error_basep = info->codes->first_error;
- return True;
- } else {
- return False;
- }
-}
-
-Bool
-SDL_NAME(XF86VidModeQueryVersion)(dpy, majorVersion, minorVersion)
- Display* dpy;
- int* majorVersion;
- int* minorVersion;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86VidModeQueryVersionReply rep;
- xXF86VidModeQueryVersionReq *req;
-
- XF86VidModeCheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86VidModeQueryVersion, req);
- req->reqType = info->codes->major_opcode;
- req->xf86vidmodeReqType = X_XF86VidModeQueryVersion;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
- *majorVersion = rep.majorVersion;
- *minorVersion = rep.minorVersion;
- UnlockDisplay(dpy);
- SyncHandle();
- if (*majorVersion >= 2)
- SDL_NAME(XF86VidModeSetClientVersion)(dpy);
- return True;
-}
-
-Bool
-SDL_NAME(XF86VidModeSetClientVersion)(Display *dpy)
-{
- XExtDisplayInfo *info = find_display(dpy);
- xXF86VidModeSetClientVersionReq *req;
-
- XF86VidModeCheckExtension(dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86VidModeSetClientVersion, req);
- req->reqType = info->codes->major_opcode;
- req->xf86vidmodeReqType = X_XF86VidModeSetClientVersion;
- req->major = XF86VIDMODE_MAJOR_VERSION;
- req->minor = XF86VIDMODE_MINOR_VERSION;
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-Bool
-SDL_NAME(XF86VidModeSetGamma)(Display *dpy, int screen, SDL_NAME(XF86VidModeGamma) *Gamma)
-{
- XExtDisplayInfo *info = find_display(dpy);
- xXF86VidModeSetGammaReq *req;
-
- XF86VidModeCheckExtension(dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86VidModeSetGamma, req);
- req->reqType = info->codes->major_opcode;
- req->xf86vidmodeReqType = X_XF86VidModeSetGamma;
- req->screen = screen;
- req->red = (CARD32)(Gamma->red * 10000.);
- req->green = (CARD32)(Gamma->green * 10000.);
- req->blue = (CARD32)(Gamma->blue * 10000.);
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-Bool
-SDL_NAME(XF86VidModeGetGamma)(Display *dpy, int screen, SDL_NAME(XF86VidModeGamma) *Gamma)
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86VidModeGetGammaReply rep;
- xXF86VidModeGetGammaReq *req;
-
- XF86VidModeCheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86VidModeGetGamma, req);
- req->reqType = info->codes->major_opcode;
- req->xf86vidmodeReqType = X_XF86VidModeGetGamma;
- req->screen = screen;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
- Gamma->red = ((float)rep.red) / 10000.;
- Gamma->green = ((float)rep.green) / 10000.;
- Gamma->blue = ((float)rep.blue) / 10000.;
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-Bool
-SDL_NAME(XF86VidModeGetModeLine)(dpy, screen, dotclock, modeline)
- Display* dpy;
- int screen;
- int* dotclock;
- SDL_NAME(XF86VidModeModeLine)* modeline;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86VidModeGetModeLineReply rep;
- xXF86OldVidModeGetModeLineReply oldrep;
- xXF86VidModeGetModeLineReq *req;
- int majorVersion, minorVersion;
-
- XF86VidModeCheckExtension (dpy, info, False);
- SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion);
-
- LockDisplay(dpy);
- GetReq(XF86VidModeGetModeLine, req);
- req->reqType = info->codes->major_opcode;
- req->xf86vidmodeReqType = X_XF86VidModeGetModeLine;
- req->screen = screen;
-
- if (majorVersion < 2) {
- if (!_XReply(dpy, (xReply *)&oldrep,
- (SIZEOF(xXF86OldVidModeGetModeLineReply) - SIZEOF(xReply)) >> 2, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
- *dotclock = oldrep.dotclock;
- modeline->hdisplay = oldrep.hdisplay;
- modeline->hsyncstart = oldrep.hsyncstart;
- modeline->hsyncend = oldrep.hsyncend;
- modeline->htotal = oldrep.htotal;
- modeline->hskew = 0;
- modeline->vdisplay = oldrep.vdisplay;
- modeline->vsyncstart = oldrep.vsyncstart;
- modeline->vsyncend = oldrep.vsyncend;
- modeline->vtotal = oldrep.vtotal;
- modeline->flags = oldrep.flags;
- modeline->privsize = oldrep.privsize;
- } else {
- if (!_XReply(dpy, (xReply *)&rep,
- (SIZEOF(xXF86VidModeGetModeLineReply) - SIZEOF(xReply)) >> 2, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
- *dotclock = rep.dotclock;
- modeline->hdisplay = rep.hdisplay;
- modeline->hsyncstart = rep.hsyncstart;
- modeline->hsyncend = rep.hsyncend;
- modeline->htotal = rep.htotal;
- modeline->hskew = rep.hskew;
- modeline->vdisplay = rep.vdisplay;
- modeline->vsyncstart = rep.vsyncstart;
- modeline->vsyncend = rep.vsyncend;
- modeline->vtotal = rep.vtotal;
- modeline->flags = rep.flags;
- modeline->privsize = rep.privsize;
- }
-
- if (modeline->privsize > 0) {
- if (!(modeline->private = Xcalloc(modeline->privsize, sizeof(INT32)))) {
- _XEatData(dpy, (modeline->privsize) * sizeof(INT32));
- Xfree(modeline->private);
- return False;
- }
- _XRead(dpy, (char*)modeline->private, modeline->privsize * sizeof(INT32));
- } else {
- modeline->private = NULL;
- }
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-Bool
-SDL_NAME(XF86VidModeGetAllModeLines)(dpy, screen, modecount, modelinesPtr)
- Display* dpy;
- int screen;
- int* modecount;
- SDL_NAME(XF86VidModeModeInfo) ***modelinesPtr;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86VidModeGetAllModeLinesReply rep;
- xXF86VidModeGetAllModeLinesReq *req;
- SDL_NAME(XF86VidModeModeInfo) *mdinfptr, **modelines;
- xXF86VidModeModeInfo xmdline;
- xXF86OldVidModeModeInfo oldxmdline;
- int i;
- int majorVersion, minorVersion;
- Bool protocolBug = False;
-
- XF86VidModeCheckExtension (dpy, info, False);
-
- /*
- * Note: There was a bug in the protocol implementation in versions
- * 0.x with x < 8 (the .private field wasn't being passed over the wire).
- * Check the server's version, and accept the old format if appropriate.
- */
-
- SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion);
- if (majorVersion == 0 && minorVersion < 8) {
- protocolBug = True;
-#ifdef DEBUG
- fprintf(stderr, "XF86VidModeGetAllModeLines: Warning: Xserver is"
- "running an old version (%d.%d)\n", majorVersion,
- minorVersion);
-#endif
- }
-
- LockDisplay(dpy);
- GetReq(XF86VidModeGetAllModeLines, req);
- req->reqType = info->codes->major_opcode;
- req->xf86vidmodeReqType = X_XF86VidModeGetAllModeLines;
- req->screen = screen;
- if (!_XReply(dpy, (xReply *)&rep,
- (SIZEOF(xXF86VidModeGetAllModeLinesReply) - SIZEOF(xReply)) >> 2, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
-
- *modecount = rep.modecount;
-
- if (!(modelines = (SDL_NAME(XF86VidModeModeInfo) **) Xcalloc(rep.modecount,
- sizeof(SDL_NAME(XF86VidModeModeInfo) *)
- +sizeof(SDL_NAME(XF86VidModeModeInfo))))) {
- if (majorVersion < 2)
- _XEatData(dpy, (rep.modecount) * sizeof(xXF86OldVidModeModeInfo));
- else
- _XEatData(dpy, (rep.modecount) * sizeof(xXF86VidModeModeInfo));
- Xfree(modelines);
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
- mdinfptr = (SDL_NAME(XF86VidModeModeInfo) *) (
- (char *) modelines
- + rep.modecount*sizeof(SDL_NAME(XF86VidModeModeInfo) *)
- );
-
- for (i = 0; i < rep.modecount; i++) {
- modelines[i] = mdinfptr++;
- if (majorVersion < 2) {
- _XRead(dpy, (char*)&oldxmdline, sizeof(xXF86OldVidModeModeInfo));
- modelines[i]->dotclock = oldxmdline.dotclock;
- modelines[i]->hdisplay = oldxmdline.hdisplay;
- modelines[i]->hsyncstart = oldxmdline.hsyncstart;
- modelines[i]->hsyncend = oldxmdline.hsyncend;
- modelines[i]->htotal = oldxmdline.htotal;
- modelines[i]->hskew = 0;
- modelines[i]->vdisplay = oldxmdline.vdisplay;
- modelines[i]->vsyncstart = oldxmdline.vsyncstart;
- modelines[i]->vsyncend = oldxmdline.vsyncend;
- modelines[i]->vtotal = oldxmdline.vtotal;
- modelines[i]->flags = oldxmdline.flags;
- if (protocolBug) {
- modelines[i]->privsize = 0;
- modelines[i]->private = NULL;
- } else {
- modelines[i]->privsize = oldxmdline.privsize;
- if (oldxmdline.privsize > 0) {
- if (!(modelines[i]->private =
- Xcalloc(oldxmdline.privsize, sizeof(INT32)))) {
- _XEatData(dpy, (oldxmdline.privsize) * sizeof(INT32));
- Xfree(modelines[i]->private);
- } else {
- _XRead(dpy, (char*)modelines[i]->private,
- oldxmdline.privsize * sizeof(INT32));
- }
- } else {
- modelines[i]->private = NULL;
- }
- }
- } else {
- _XRead(dpy, (char*)&xmdline, sizeof(xXF86VidModeModeInfo));
- modelines[i]->dotclock = xmdline.dotclock;
- modelines[i]->hdisplay = xmdline.hdisplay;
- modelines[i]->hsyncstart = xmdline.hsyncstart;
- modelines[i]->hsyncend = xmdline.hsyncend;
- modelines[i]->htotal = xmdline.htotal;
- modelines[i]->hskew = xmdline.hskew;
- modelines[i]->vdisplay = xmdline.vdisplay;
- modelines[i]->vsyncstart = xmdline.vsyncstart;
- modelines[i]->vsyncend = xmdline.vsyncend;
- modelines[i]->vtotal = xmdline.vtotal;
- modelines[i]->flags = xmdline.flags;
- if (protocolBug) {
- modelines[i]->privsize = 0;
- modelines[i]->private = NULL;
- } else {
- modelines[i]->privsize = xmdline.privsize;
- if (xmdline.privsize > 0) {
- if (!(modelines[i]->private =
- Xcalloc(xmdline.privsize, sizeof(INT32)))) {
- _XEatData(dpy, (xmdline.privsize) * sizeof(INT32));
- Xfree(modelines[i]->private);
- } else {
- _XRead(dpy, (char*)modelines[i]->private,
- xmdline.privsize * sizeof(INT32));
- }
- } else {
- modelines[i]->private = NULL;
- }
- }
- }
- }
- *modelinesPtr = modelines;
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-/*
- * GetReq replacement for use with VidMode protocols earlier than 2.0
- */
-#if !defined(UNIXCPP) || defined(ANSICPP)
-#define GetOldReq(name, oldname, req) \
- WORD64ALIGN\
- if ((dpy->bufptr + SIZEOF(x##oldname##Req)) > dpy->bufmax)\
- _XFlush(dpy);\
- req = (x##oldname##Req *)(dpy->last_req = dpy->bufptr);\
- req->reqType = X_##name;\
- req->length = (SIZEOF(x##oldname##Req))>>2;\
- dpy->bufptr += SIZEOF(x##oldname##Req);\
- dpy->request++
-
-#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */
-#define GetOldReq(name, oldname, req) \
- WORD64ALIGN\
- if ((dpy->bufptr + SIZEOF(x/**/oldname/**/Req)) > dpy->bufmax)\
- _XFlush(dpy);\
- req = (x/**/oldname/**/Req *)(dpy->last_req = dpy->bufptr);\
- req->reqType = X_/**/name;\
- req->length = (SIZEOF(x/**/oldname/**/Req))>>2;\
- dpy->bufptr += SIZEOF(x/**/oldname/**/Req);\
- dpy->request++
-#endif
-
-Bool
-SDL_NAME(XF86VidModeAddModeLine) (dpy, screen, newmodeline, aftermodeline)
- Display *dpy;
- int screen;
- SDL_NAME(XF86VidModeModeInfo)* newmodeline;
- SDL_NAME(XF86VidModeModeInfo)* aftermodeline;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86VidModeAddModeLineReq *req;
- xXF86OldVidModeAddModeLineReq *oldreq;
- int majorVersion, minorVersion;
-
- XF86VidModeCheckExtension (dpy, info, False);
- SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion);
-
- LockDisplay(dpy);
- if (majorVersion < 2) {
- GetOldReq(XF86VidModeAddModeLine, XF86OldVidModeAddModeLine, oldreq);
- oldreq->reqType = info->codes->major_opcode;
- oldreq->xf86vidmodeReqType = X_XF86VidModeAddModeLine;
- oldreq->screen = screen;
- oldreq->dotclock = newmodeline->dotclock;
- oldreq->hdisplay = newmodeline->hdisplay;
- oldreq->hsyncstart = newmodeline->hsyncstart;
- oldreq->hsyncend = newmodeline->hsyncend;
- oldreq->htotal = newmodeline->htotal;
- oldreq->vdisplay = newmodeline->vdisplay;
- oldreq->vsyncstart = newmodeline->vsyncstart;
- oldreq->vsyncend = newmodeline->vsyncend;
- oldreq->vtotal = newmodeline->vtotal;
- oldreq->flags = newmodeline->flags;
- oldreq->privsize = newmodeline->privsize;
- if (aftermodeline != NULL) {
- oldreq->after_dotclock = aftermodeline->dotclock;
- oldreq->after_hdisplay = aftermodeline->hdisplay;
- oldreq->after_hsyncstart = aftermodeline->hsyncstart;
- oldreq->after_hsyncend = aftermodeline->hsyncend;
- oldreq->after_htotal = aftermodeline->htotal;
- oldreq->after_vdisplay = aftermodeline->vdisplay;
- oldreq->after_vsyncstart = aftermodeline->vsyncstart;
- oldreq->after_vsyncend = aftermodeline->vsyncend;
- oldreq->after_vtotal = aftermodeline->vtotal;
- oldreq->after_flags = aftermodeline->flags;
- } else {
- oldreq->after_dotclock = 0;
- oldreq->after_hdisplay = 0;
- oldreq->after_hsyncstart = 0;
- oldreq->after_hsyncend = 0;
- oldreq->after_htotal = 0;
- oldreq->after_vdisplay = 0;
- oldreq->after_vsyncstart = 0;
- oldreq->after_vsyncend = 0;
- oldreq->after_vtotal = 0;
- oldreq->after_flags = 0;
- }
- if (newmodeline->privsize) {
- oldreq->length += newmodeline->privsize;
- Data32(dpy, (long *) newmodeline->private,
- newmodeline->privsize * sizeof(INT32));
- }
- } else {
- GetReq(XF86VidModeAddModeLine, req);
- req->reqType = info->codes->major_opcode;
- req->xf86vidmodeReqType = X_XF86VidModeAddModeLine;
- req->screen = screen;
- req->dotclock = newmodeline->dotclock;
- req->hdisplay = newmodeline->hdisplay;
- req->hsyncstart = newmodeline->hsyncstart;
- req->hsyncend = newmodeline->hsyncend;
- req->htotal = newmodeline->htotal;
- req->hskew = newmodeline->hskew;
- req->vdisplay = newmodeline->vdisplay;
- req->vsyncstart = newmodeline->vsyncstart;
- req->vsyncend = newmodeline->vsyncend;
- req->vtotal = newmodeline->vtotal;
- req->flags = newmodeline->flags;
- req->privsize = newmodeline->privsize;
- if (aftermodeline != NULL) {
- req->after_dotclock = aftermodeline->dotclock;
- req->after_hdisplay = aftermodeline->hdisplay;
- req->after_hsyncstart = aftermodeline->hsyncstart;
- req->after_hsyncend = aftermodeline->hsyncend;
- req->after_htotal = aftermodeline->htotal;
- req->after_hskew = aftermodeline->hskew;
- req->after_vdisplay = aftermodeline->vdisplay;
- req->after_vsyncstart = aftermodeline->vsyncstart;
- req->after_vsyncend = aftermodeline->vsyncend;
- req->after_vtotal = aftermodeline->vtotal;
- req->after_flags = aftermodeline->flags;
- } else {
- req->after_dotclock = 0;
- req->after_hdisplay = 0;
- req->after_hsyncstart = 0;
- req->after_hsyncend = 0;
- req->after_htotal = 0;
- req->after_hskew = 0;
- req->after_vdisplay = 0;
- req->after_vsyncstart = 0;
- req->after_vsyncend = 0;
- req->after_vtotal = 0;
- req->after_flags = 0;
- }
- if (newmodeline->privsize) {
- req->length += newmodeline->privsize;
- Data32(dpy, (long *) newmodeline->private,
- newmodeline->privsize * sizeof(INT32));
- }
- }
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-Bool
-SDL_NAME(XF86VidModeDeleteModeLine) (dpy, screen, modeline)
- Display *dpy;
- int screen;
- SDL_NAME(XF86VidModeModeInfo)* modeline;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86VidModeDeleteModeLineReq *req;
- xXF86OldVidModeDeleteModeLineReq *oldreq;
- int majorVersion, minorVersion;
-
- XF86VidModeCheckExtension (dpy, info, 0);
- SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion);
-
- LockDisplay(dpy);
- if (majorVersion < 2) {
- GetOldReq(XF86VidModeDeleteModeLine, XF86OldVidModeDeleteModeLine, oldreq);
- oldreq->reqType = info->codes->major_opcode;
- oldreq->xf86vidmodeReqType = X_XF86VidModeDeleteModeLine;
- oldreq->screen = screen;
- oldreq->dotclock = modeline->dotclock;
- oldreq->hdisplay = modeline->hdisplay;
- oldreq->hsyncstart = modeline->hsyncstart;
- oldreq->hsyncend = modeline->hsyncend;
- oldreq->htotal = modeline->htotal;
- oldreq->vdisplay = modeline->vdisplay;
- oldreq->vsyncstart = modeline->vsyncstart;
- oldreq->vsyncend = modeline->vsyncend;
- oldreq->vtotal = modeline->vtotal;
- oldreq->flags = modeline->flags;
- oldreq->privsize = modeline->privsize;
- if (modeline->privsize) {
- oldreq->length += modeline->privsize;
- Data32(dpy, (long *) modeline->private,
- modeline->privsize * sizeof(INT32));
- }
- } else {
- GetReq(XF86VidModeDeleteModeLine, req);
- req->reqType = info->codes->major_opcode;
- req->xf86vidmodeReqType = X_XF86VidModeDeleteModeLine;
- req->screen = screen;
- req->dotclock = modeline->dotclock;
- req->hdisplay = modeline->hdisplay;
- req->hsyncstart = modeline->hsyncstart;
- req->hsyncend = modeline->hsyncend;
- req->htotal = modeline->htotal;
- req->hskew = modeline->hskew;
- req->vdisplay = modeline->vdisplay;
- req->vsyncstart = modeline->vsyncstart;
- req->vsyncend = modeline->vsyncend;
- req->vtotal = modeline->vtotal;
- req->flags = modeline->flags;
- req->privsize = modeline->privsize;
- if (modeline->privsize) {
- req->length += modeline->privsize;
- Data32(dpy, (long *) modeline->private,
- modeline->privsize * sizeof(INT32));
- }
- }
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-Bool
-SDL_NAME(XF86VidModeModModeLine) (dpy, screen, modeline)
- Display *dpy;
- int screen;
- SDL_NAME(XF86VidModeModeLine)* modeline;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86VidModeModModeLineReq *req;
- xXF86OldVidModeModModeLineReq *oldreq;
- int majorVersion, minorVersion;
-
- XF86VidModeCheckExtension (dpy, info, 0);
- SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion);
-
- LockDisplay(dpy);
- if (majorVersion < 2) {
- GetOldReq(XF86VidModeModModeLine, XF86OldVidModeModModeLine, oldreq);
- oldreq->reqType = info->codes->major_opcode;
- oldreq->xf86vidmodeReqType = X_XF86VidModeModModeLine;
- oldreq->screen = screen;
- oldreq->hdisplay = modeline->hdisplay;
- oldreq->hsyncstart = modeline->hsyncstart;
- oldreq->hsyncend = modeline->hsyncend;
- oldreq->htotal = modeline->htotal;
- oldreq->vdisplay = modeline->vdisplay;
- oldreq->vsyncstart = modeline->vsyncstart;
- oldreq->vsyncend = modeline->vsyncend;
- oldreq->vtotal = modeline->vtotal;
- oldreq->flags = modeline->flags;
- oldreq->privsize = modeline->privsize;
- if (modeline->privsize) {
- oldreq->length += modeline->privsize;
- Data32(dpy, (long *) modeline->private,
- modeline->privsize * sizeof(INT32));
- }
- } else {
- GetReq(XF86VidModeModModeLine, req);
- req->reqType = info->codes->major_opcode;
- req->xf86vidmodeReqType = X_XF86VidModeModModeLine;
- req->screen = screen;
- req->hdisplay = modeline->hdisplay;
- req->hsyncstart = modeline->hsyncstart;
- req->hsyncend = modeline->hsyncend;
- req->htotal = modeline->htotal;
- req->hskew = modeline->hskew;
- req->vdisplay = modeline->vdisplay;
- req->vsyncstart = modeline->vsyncstart;
- req->vsyncend = modeline->vsyncend;
- req->vtotal = modeline->vtotal;
- req->flags = modeline->flags;
- req->privsize = modeline->privsize;
- if (modeline->privsize) {
- req->length += modeline->privsize;
- Data32(dpy, (long *) modeline->private,
- modeline->privsize * sizeof(INT32));
- }
- }
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-Status
-SDL_NAME(XF86VidModeValidateModeLine) (dpy, screen, modeline)
- Display *dpy;
- int screen;
- SDL_NAME(XF86VidModeModeInfo)* modeline;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86VidModeValidateModeLineReq *req;
- xXF86OldVidModeValidateModeLineReq *oldreq;
- xXF86VidModeValidateModeLineReply rep;
- int majorVersion, minorVersion;
-
- XF86VidModeCheckExtension (dpy, info, 0);
- SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion);
-
- LockDisplay(dpy);
-
- if (majorVersion < 2) {
- GetOldReq(XF86VidModeValidateModeLine, XF86OldVidModeValidateModeLine, oldreq);
- oldreq->reqType = info->codes->major_opcode;
- oldreq->xf86vidmodeReqType = X_XF86VidModeValidateModeLine;
- oldreq->screen = screen;
- oldreq->dotclock = modeline->dotclock;
- oldreq->hdisplay = modeline->hdisplay;
- oldreq->hsyncstart = modeline->hsyncstart;
- oldreq->hsyncend = modeline->hsyncend;
- oldreq->htotal = modeline->htotal;
- oldreq->vdisplay = modeline->vdisplay;
- oldreq->vsyncstart = modeline->vsyncstart;
- oldreq->vsyncend = modeline->vsyncend;
- oldreq->vtotal = modeline->vtotal;
- oldreq->flags = modeline->flags;
- oldreq->privsize = modeline->privsize;
- if (modeline->privsize) {
- oldreq->length += modeline->privsize;
- Data32(dpy, (long *) modeline->private,
- modeline->privsize * sizeof(INT32));
- }
- } else {
- GetReq(XF86VidModeValidateModeLine, req);
- req->reqType = info->codes->major_opcode;
- req->xf86vidmodeReqType = X_XF86VidModeValidateModeLine;
- req->screen = screen;
- req->dotclock = modeline->dotclock;
- req->hdisplay = modeline->hdisplay;
- req->hsyncstart = modeline->hsyncstart;
- req->hsyncend = modeline->hsyncend;
- req->htotal = modeline->htotal;
- req->hskew = modeline->hskew;
- req->vdisplay = modeline->vdisplay;
- req->vsyncstart = modeline->vsyncstart;
- req->vsyncend = modeline->vsyncend;
- req->vtotal = modeline->vtotal;
- req->flags = modeline->flags;
- req->privsize = modeline->privsize;
- if (modeline->privsize) {
- req->length += modeline->privsize;
- Data32(dpy, (long *) modeline->private,
- modeline->privsize * sizeof(INT32));
- }
- }
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return MODE_BAD;
- }
- UnlockDisplay(dpy);
- SyncHandle();
- return rep.status;
-}
-
-Bool
-SDL_NAME(XF86VidModeSwitchMode)(dpy, screen, zoom)
- Display* dpy;
- int screen;
- int zoom;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86VidModeSwitchModeReq *req;
-
- XF86VidModeCheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86VidModeSwitchMode, req);
- req->reqType = info->codes->major_opcode;
- req->xf86vidmodeReqType = X_XF86VidModeSwitchMode;
- req->screen = screen;
- req->zoom = zoom;
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-Bool
-SDL_NAME(XF86VidModeSwitchToMode)(dpy, screen, modeline)
- Display* dpy;
- int screen;
- SDL_NAME(XF86VidModeModeInfo)* modeline;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86VidModeSwitchToModeReq *req;
- xXF86OldVidModeSwitchToModeReq *oldreq;
- int majorVersion, minorVersion;
- Bool protocolBug = False;
-
- XF86VidModeCheckExtension (dpy, info, False);
-
- /*
- * Note: There was a bug in the protocol implementation in versions
- * 0.x with x < 8 (the .private field wasn't expected to be sent over
- * the wire). Check the server's version, and accept the old format
- * if appropriate.
- */
-
- SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion);
- if (majorVersion == 0 && minorVersion < 8) {
- protocolBug = True;
-#ifdef DEBUG
- fprintf(stderr, "XF86VidModeSwitchToMode: Warning: Xserver is"
- "running an old version (%d.%d)\n", majorVersion,
- minorVersion);
-#endif
- }
-
- LockDisplay(dpy);
- if (majorVersion < 2) {
- GetOldReq(XF86VidModeSwitchToMode, XF86OldVidModeSwitchToMode, oldreq);
- oldreq->reqType = info->codes->major_opcode;
- oldreq->xf86vidmodeReqType = X_XF86VidModeSwitchToMode;
- oldreq->screen = screen;
- oldreq->dotclock = modeline->dotclock;
- oldreq->hdisplay = modeline->hdisplay;
- oldreq->hsyncstart = modeline->hsyncstart;
- oldreq->hsyncend = modeline->hsyncend;
- oldreq->htotal = modeline->htotal;
- oldreq->vdisplay = modeline->vdisplay;
- oldreq->vsyncstart = modeline->vsyncstart;
- oldreq->vsyncend = modeline->vsyncend;
- oldreq->vtotal = modeline->vtotal;
- oldreq->flags = modeline->flags;
- if (protocolBug) {
- oldreq->privsize = 0;
- } else {
- oldreq->privsize = modeline->privsize;
- if (modeline->privsize) {
- oldreq->length += modeline->privsize;
- Data32(dpy, (long *) modeline->private,
- modeline->privsize * sizeof(INT32));
- }
- }
- } else {
- GetReq(XF86VidModeSwitchToMode, req);
- req->reqType = info->codes->major_opcode;
- req->xf86vidmodeReqType = X_XF86VidModeSwitchToMode;
- req->screen = screen;
- req->dotclock = modeline->dotclock;
- req->hdisplay = modeline->hdisplay;
- req->hsyncstart = modeline->hsyncstart;
- req->hsyncend = modeline->hsyncend;
- req->htotal = modeline->htotal;
- req->hskew = modeline->hskew;
- req->vdisplay = modeline->vdisplay;
- req->vsyncstart = modeline->vsyncstart;
- req->vsyncend = modeline->vsyncend;
- req->vtotal = modeline->vtotal;
- req->flags = modeline->flags;
- if (protocolBug) {
- req->privsize = 0;
- } else {
- req->privsize = modeline->privsize;
- if (modeline->privsize) {
- req->length += modeline->privsize;
- Data32(dpy, (long *) modeline->private,
- modeline->privsize * sizeof(INT32));
- }
- }
- }
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-Bool
-SDL_NAME(XF86VidModeLockModeSwitch)(dpy, screen, lock)
- Display* dpy;
- int screen;
- int lock;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86VidModeLockModeSwitchReq *req;
-
- XF86VidModeCheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86VidModeLockModeSwitch, req);
- req->reqType = info->codes->major_opcode;
- req->xf86vidmodeReqType = X_XF86VidModeLockModeSwitch;
- req->screen = screen;
- req->lock = lock;
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-Bool
-SDL_NAME(XF86VidModeGetMonitor)(dpy, screen, monitor)
- Display* dpy;
- int screen;
- SDL_NAME(XF86VidModeMonitor)* monitor;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86VidModeGetMonitorReply rep;
- xXF86VidModeGetMonitorReq *req;
- CARD32 syncrange;
- int i;
-
- XF86VidModeCheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86VidModeGetMonitor, req);
- req->reqType = info->codes->major_opcode;
- req->xf86vidmodeReqType = X_XF86VidModeGetMonitor;
- req->screen = screen;
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
- monitor->nhsync = rep.nhsync;
- monitor->nvsync = rep.nvsync;
-#if 0
- monitor->bandwidth = (float)rep.bandwidth / 1e6;
-#endif
- if (rep.vendorLength) {
- if (!(monitor->vendor = (char *)Xcalloc(rep.vendorLength + 1, 1))) {
- _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
- ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
- } else {
- monitor->vendor = NULL;
- }
- if (rep.modelLength) {
- if (!(monitor->model = Xcalloc(rep.modelLength + 1, 1))) {
- _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
- ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
- if (monitor->vendor)
- Xfree(monitor->vendor);
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
- } else {
- monitor->model = NULL;
- }
- if (!(monitor->hsync = Xcalloc(rep.nhsync, sizeof(SDL_NAME(XF86VidModeSyncRange))))) {
- _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
- ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
-
- if (monitor->vendor)
- Xfree(monitor->vendor);
- if (monitor->model)
- Xfree(monitor->model);
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
- if (!(monitor->vsync = Xcalloc(rep.nvsync, sizeof(SDL_NAME(XF86VidModeSyncRange))))) {
- _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
- ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
- if (monitor->vendor)
- Xfree(monitor->vendor);
- if (monitor->model)
- Xfree(monitor->model);
- Xfree(monitor->hsync);
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
- for (i = 0; i < rep.nhsync; i++) {
- _XRead(dpy, (char *)&syncrange, 4);
- monitor->hsync[i].lo = (float)(syncrange & 0xFFFF) / 100.0;
- monitor->hsync[i].hi = (float)(syncrange >> 16) / 100.0;
- }
- for (i = 0; i < rep.nvsync; i++) {
- _XRead(dpy, (char *)&syncrange, 4);
- monitor->vsync[i].lo = (float)(syncrange & 0xFFFF) / 100.0;
- monitor->vsync[i].hi = (float)(syncrange >> 16) / 100.0;
- }
- if (rep.vendorLength)
- _XReadPad(dpy, monitor->vendor, rep.vendorLength);
- else
- monitor->vendor = "";
- if (rep.modelLength)
- _XReadPad(dpy, monitor->model, rep.modelLength);
- else
- monitor->model = "";
-
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-Bool
-SDL_NAME(XF86VidModeGetViewPort)(dpy, screen, x, y)
- Display* dpy;
- int screen;
- int *x, *y;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86VidModeGetViewPortReply rep;
- xXF86VidModeGetViewPortReq *req;
- int majorVersion, minorVersion;
- Bool protocolBug = False;
-
- XF86VidModeCheckExtension (dpy, info, False);
-
- /*
- * Note: There was a bug in the protocol implementation in versions
- * 0.x with x < 8 (no reply was sent, so the client would hang)
- * Check the server's version, and don't wait for a reply with older
- * versions.
- */
-
- SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion);
- if (majorVersion == 0 && minorVersion < 8) {
- protocolBug = True;
-#ifdef DEBUG
- fprintf(stderr, "XF86VidModeGetViewPort: Warning: Xserver is"
- "running an old version (%d.%d)\n", majorVersion,
- minorVersion);
-#endif
- }
- LockDisplay(dpy);
- GetReq(XF86VidModeGetViewPort, req);
- req->reqType = info->codes->major_opcode;
- req->xf86vidmodeReqType = X_XF86VidModeGetViewPort;
- req->screen = screen;
- if (protocolBug) {
- *x = 0;
- *y = 0;
- } else {
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
- *x = rep.x;
- *y = rep.y;
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-Bool
-SDL_NAME(XF86VidModeSetViewPort)(dpy, screen, x, y)
- Display* dpy;
- int screen;
- int x, y;
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86VidModeSetViewPortReq *req;
-
- XF86VidModeCheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86VidModeSetViewPort, req);
- req->reqType = info->codes->major_opcode;
- req->xf86vidmodeReqType = X_XF86VidModeSetViewPort;
- req->screen = screen;
- req->x = x;
- req->y = y;
-
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-Bool
-SDL_NAME(XF86VidModeGetDotClocks)(dpy, screen,
- flagsPtr, numclocksPtr, maxclocksPtr, clocksPtr)
- Display* dpy;
- int screen;
- int *flagsPtr, *numclocksPtr, *maxclocksPtr, *clocksPtr[];
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86VidModeGetDotClocksReply rep;
- xXF86VidModeGetDotClocksReq *req;
- int i, *dotclocks;
- CARD32 dotclk;
-
- XF86VidModeCheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86VidModeGetDotClocks, req);
- req->reqType = info->codes->major_opcode;
- req->xf86vidmodeReqType = X_XF86VidModeGetDotClocks;
- req->screen = screen;
- if (!_XReply(dpy, (xReply *)&rep,
- (SIZEOF(xXF86VidModeGetDotClocksReply) - SIZEOF(xReply)) >> 2, xFalse))
- {
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
- *numclocksPtr = rep.clocks;
- *maxclocksPtr = rep.maxclocks;
- *flagsPtr = rep.flags;
-
- if (!(dotclocks = (int*) Xcalloc(rep.clocks, sizeof(int)))) {
- _XEatData(dpy, (rep.clocks) * 4);
- Xfree(dotclocks);
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
-
- for (i = 0; i < rep.clocks; i++) {
- _XRead(dpy, (char*)&dotclk, 4);
- dotclocks[i] = dotclk;
- }
- *clocksPtr = dotclocks;
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-Bool
-SDL_NAME(XF86VidModeSetGammaRamp) (
- Display *dpy,
- int screen,
- int size,
- unsigned short *red,
- unsigned short *green,
- unsigned short *blue
-)
-{
- int length = (size + 1) & ~1;
- XExtDisplayInfo *info = find_display (dpy);
- xXF86VidModeSetGammaRampReq *req;
-
- XF86VidModeCheckExtension (dpy, info, False);
- LockDisplay(dpy);
- GetReq(XF86VidModeSetGammaRamp, req);
- req->reqType = info->codes->major_opcode;
- req->xf86vidmodeReqType = X_XF86VidModeSetGammaRamp;
- req->screen = screen;
- req->length += (length >> 1) * 3;
- req->size = size;
- _XSend(dpy, (char*)red, size * 2);
- _XSend(dpy, (char*)green, size * 2);
- _XSend(dpy, (char*)blue, size * 2);
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-
-Bool
-SDL_NAME(XF86VidModeGetGammaRamp) (
- Display *dpy,
- int screen,
- int size,
- unsigned short *red,
- unsigned short *green,
- unsigned short *blue
-)
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86VidModeGetGammaRampReq *req;
- xXF86VidModeGetGammaRampReply rep;
-
- XF86VidModeCheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86VidModeGetGammaRamp, req);
- req->reqType = info->codes->major_opcode;
- req->xf86vidmodeReqType = X_XF86VidModeGetGammaRamp;
- req->screen = screen;
- req->size = size;
- if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
- UnlockDisplay (dpy);
- SyncHandle ();
- return False;
- }
- if(rep.size) {
- _XRead(dpy, (char*)red, rep.size << 1);
- _XRead(dpy, (char*)green, rep.size << 1);
- _XRead(dpy, (char*)blue, rep.size << 1);
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
-Bool SDL_NAME(XF86VidModeGetGammaRampSize)(
- Display *dpy,
- int screen,
- int *size
-)
-{
- XExtDisplayInfo *info = find_display (dpy);
- xXF86VidModeGetGammaRampSizeReq *req;
- xXF86VidModeGetGammaRampSizeReply rep;
-
- *size = 0;
-
- XF86VidModeCheckExtension (dpy, info, False);
-
- LockDisplay(dpy);
- GetReq(XF86VidModeGetGammaRampSize, req);
- req->reqType = info->codes->major_opcode;
- req->xf86vidmodeReqType = X_XF86VidModeGetGammaRampSize;
- req->screen = screen;
- if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
- UnlockDisplay (dpy);
- SyncHandle ();
- return False;
- }
- *size = rep.size;
- UnlockDisplay(dpy);
- SyncHandle();
- return True;
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/aalib/SDL_aaevents.c b/distrib/sdl-1.2.12/src/video/aalib/SDL_aaevents.c
deleted file mode 100644
index 7811f19..0000000
--- a/distrib/sdl-1.2.12/src/video/aalib/SDL_aaevents.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Handle the event stream, converting AA events into SDL events */
-
-#include <stdio.h>
-
-#include <aalib.h>
-
-#include "SDL.h"
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_aavideo.h"
-#include "SDL_aaevents_c.h"
-
-/* The translation tables from a console scancode to a SDL keysym */
-static SDLKey keymap[401];
-
-static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym);
-
-
-void AA_PumpEvents(_THIS)
-{
- int posted = 0;
- int mouse_button, mouse_x, mouse_y;
- int evt;
- SDL_keysym keysym;
-
- static int prev_button = -1, prev_x = -1, prev_y = -1;
-
- if( ! this->screen ) /* Wait till we got the screen initialized */
- return;
-
- do {
- posted = 0;
- /* Gather events */
-
- /* Get mouse status */
- SDL_mutexP(AA_mutex);
- aa_getmouse (AA_context, &mouse_x, &mouse_y, &mouse_button);
- SDL_mutexV(AA_mutex);
- mouse_x = mouse_x * this->screen->w / aa_scrwidth (AA_context);
- mouse_y = mouse_y * this->screen->h / aa_scrheight (AA_context);
-
- /* Compare against previous state and generate events */
- if( prev_button != mouse_button ) {
- if( mouse_button & AA_BUTTON1 ) {
- if ( ! (prev_button & AA_BUTTON1) ) {
- posted += SDL_PrivateMouseButton(SDL_PRESSED, 1, 0, 0);
- }
- } else {
- if ( prev_button & AA_BUTTON1 ) {
- posted += SDL_PrivateMouseButton(SDL_RELEASED, 1, 0, 0);
- }
- }
- if( mouse_button & AA_BUTTON2 ) {
- if ( ! (prev_button & AA_BUTTON2) ) {
- posted += SDL_PrivateMouseButton(SDL_PRESSED, 2, 0, 0);
- }
- } else {
- if ( prev_button & AA_BUTTON2 ) {
- posted += SDL_PrivateMouseButton(SDL_RELEASED, 2, 0, 0);
- }
- }
- if( mouse_button & AA_BUTTON3 ) {
- if ( ! (prev_button & AA_BUTTON3) ) {
- posted += SDL_PrivateMouseButton(SDL_PRESSED, 3, 0, 0);
- }
- } else {
- if ( prev_button & AA_BUTTON3 ) {
- posted += SDL_PrivateMouseButton(SDL_RELEASED, 3, 0, 0);
- }
- }
- }
- if ( prev_x != mouse_x || prev_y != mouse_y ) {
- posted += SDL_PrivateMouseMotion(0, 0, mouse_x, mouse_y);
- }
-
- prev_button = mouse_button;
- prev_x = mouse_x; prev_y = mouse_y;
-
- /* Get keyboard event */
- SDL_mutexP(AA_mutex);
- evt = aa_getevent(AA_context, 0);
- SDL_mutexV(AA_mutex);
- if ( (evt > AA_NONE) && (evt < AA_RELEASE) && (evt != AA_MOUSE) && (evt != AA_RESIZE) ) {
- /* Key pressed */
-/* printf("Key pressed: %d (%c)\n", evt, evt); */
- posted += SDL_PrivateKeyboard(SDL_PRESSED, TranslateKey(evt, &keysym));
- } else if ( evt >= AA_RELEASE ) {
- /* Key released */
- evt &= ~AA_RELEASE;
-/* printf("Key released: %d (%c)\n", evt, evt); */
- posted += SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(evt, &keysym));
- }
- } while ( posted );
-}
-
-void AA_InitOSKeymap(_THIS)
-{
- int i;
- static const char *std_keys = " 01234567890&#'()_-|$*+-=/\\:;.,!?<>{}[]@~%^\x9";
- const char *std;
-
- /* Initialize the AAlib key translation table */
- for ( i=0; i<SDL_arraysize(keymap); ++i )
- keymap[i] = SDLK_UNKNOWN;
-
- /* Alphabet keys */
- for ( i = 0; i<26; ++i ){
- keymap['a' + i] = SDLK_a+i;
- keymap['A' + i] = SDLK_a+i;
- }
- /* Function keys */
- for ( i = 0; i<12; ++i ){
- keymap[334 + i] = SDLK_F1+i;
- }
- /* Keys that have the same symbols and don't have to be translated */
- for( std = std_keys; *std; std ++ ) {
- keymap[*std] = *std;
- }
-
- keymap[13] = SDLK_RETURN;
- keymap[AA_BACKSPACE] = SDLK_BACKSPACE;
-
- keymap[369] = SDLK_LSHIFT;
- keymap[370] = SDLK_RSHIFT;
- keymap[371] = SDLK_LCTRL;
- keymap[372] = SDLK_RCTRL;
- keymap[377] = SDLK_LALT;
- keymap[270] = SDLK_RALT;
- keymap[271] = SDLK_NUMLOCK;
- keymap[373] = SDLK_CAPSLOCK;
- keymap[164] = SDLK_SCROLLOCK;
-
- keymap[243] = SDLK_INSERT;
- keymap[304] = SDLK_DELETE;
- keymap[224] = SDLK_HOME;
- keymap[231] = SDLK_END;
- keymap[229] = SDLK_PAGEUP;
- keymap[230] = SDLK_PAGEDOWN;
-
- keymap[241] = SDLK_PRINT;
- keymap[163] = SDLK_BREAK;
-
- keymap[302] = SDLK_KP0;
- keymap[300] = SDLK_KP1;
- keymap[297] = SDLK_KP2;
- keymap[299] = SDLK_KP3;
- keymap[294] = SDLK_KP4;
- keymap[301] = SDLK_KP5;
- keymap[296] = SDLK_KP6;
- keymap[293] = SDLK_KP7;
- keymap[295] = SDLK_KP8;
- keymap[298] = SDLK_KP9;
-
- keymap[AA_ESC] = SDLK_ESCAPE;
- keymap[AA_UP] = SDLK_UP;
- keymap[AA_DOWN] = SDLK_DOWN;
- keymap[AA_LEFT] = SDLK_LEFT;
- keymap[AA_RIGHT] = SDLK_RIGHT;
-}
-
-static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym)
-{
- /* Sanity check */
- if ( scancode >= SDL_arraysize(keymap) )
- scancode = AA_UNKNOWN;
-
- /* Set the keysym information */
- keysym->scancode = scancode;
- keysym->sym = keymap[scancode];
- keysym->mod = KMOD_NONE;
-
- /* If UNICODE is on, get the UNICODE value for the key */
- keysym->unicode = 0;
- if ( SDL_TranslateUNICODE ) {
- /* Populate the unicode field with the ASCII value */
- keysym->unicode = scancode;
- }
- return(keysym);
-}
diff --git a/distrib/sdl-1.2.12/src/video/aalib/SDL_aaevents_c.h b/distrib/sdl-1.2.12/src/video/aalib/SDL_aaevents_c.h
deleted file mode 100644
index 37a1c2e..0000000
--- a/distrib/sdl-1.2.12/src/video/aalib/SDL_aaevents_c.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_aavideo.h"
-
-/* Variables and functions exported by SDL_sysevents.c to other parts
- of the native video subsystem (SDL_sysvideo.c)
-*/
-extern void AA_initkeymaps(int fd);
-extern void AA_mousecallback(int button, int dx, int dy,
- int u1,int u2,int u3, int u4);
-extern void AA_keyboardcallback(int scancode, int pressed);
-
-extern void AA_InitOSKeymap(_THIS);
-extern void AA_PumpEvents(_THIS);
diff --git a/distrib/sdl-1.2.12/src/video/aalib/SDL_aamouse.c b/distrib/sdl-1.2.12/src/video/aalib/SDL_aamouse.c
deleted file mode 100644
index eed197d..0000000
--- a/distrib/sdl-1.2.12/src/video/aalib/SDL_aamouse.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <stdio.h>
-
-#include "SDL_mouse.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_aamouse_c.h"
-
-
-/* The implementation dependent data for the window manager cursor */
-struct WMcursor {
- int unused;
-};
diff --git a/distrib/sdl-1.2.12/src/video/aalib/SDL_aamouse_c.h b/distrib/sdl-1.2.12/src/video/aalib/SDL_aamouse_c.h
deleted file mode 100644
index 8e06cf2..0000000
--- a/distrib/sdl-1.2.12/src/video/aalib/SDL_aamouse_c.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_aavideo.h"
-
-/* Functions to be exported */
diff --git a/distrib/sdl-1.2.12/src/video/aalib/SDL_aavideo.c b/distrib/sdl-1.2.12/src/video/aalib/SDL_aavideo.c
deleted file mode 100644
index 3ec322e..0000000
--- a/distrib/sdl-1.2.12/src/video/aalib/SDL_aavideo.c
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* AAlib based SDL video driver implementation.
-*/
-
-#include <unistd.h>
-#include <sys/stat.h>
-
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_aavideo.h"
-#include "SDL_aaevents_c.h"
-#include "SDL_aamouse_c.h"
-
-#include <aalib.h>
-
-/* Initialization/Query functions */
-static int AA_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **AA_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *AA_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int AA_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
-static void AA_VideoQuit(_THIS);
-
-/* Hardware surface functions */
-static int AA_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int AA_LockHWSurface(_THIS, SDL_Surface *surface);
-static int AA_FlipHWSurface(_THIS, SDL_Surface *surface);
-static void AA_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static void AA_FreeHWSurface(_THIS, SDL_Surface *surface);
-
-/* Cache the VideoDevice struct */
-static struct SDL_VideoDevice *local_this;
-
-/* AAlib driver bootstrap functions */
-
-static int AA_Available(void)
-{
- return 1; /* Always available ! */
-}
-
-static void AA_DeleteDevice(SDL_VideoDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_VideoDevice *AA_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device ) {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *device->hidden));
- }
- if ( (device == NULL) || (device->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( device ) {
- SDL_free(device);
- }
- return(0);
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
-
- /* Set the function pointers */
- device->VideoInit = AA_VideoInit;
- device->ListModes = AA_ListModes;
- device->SetVideoMode = AA_SetVideoMode;
- device->CreateYUVOverlay = NULL;
- device->SetColors = AA_SetColors;
- device->UpdateRects = NULL;
- device->VideoQuit = AA_VideoQuit;
- device->AllocHWSurface = AA_AllocHWSurface;
- device->CheckHWBlit = NULL;
- device->FillHWRect = NULL;
- device->SetHWColorKey = NULL;
- device->SetHWAlpha = NULL;
- device->LockHWSurface = AA_LockHWSurface;
- device->UnlockHWSurface = AA_UnlockHWSurface;
- device->FlipHWSurface = NULL;
- device->FreeHWSurface = AA_FreeHWSurface;
- device->SetCaption = NULL;
- device->SetIcon = NULL;
- device->IconifyWindow = NULL;
- device->GrabInput = NULL;
- device->GetWMInfo = NULL;
- device->InitOSKeymap = AA_InitOSKeymap;
- device->PumpEvents = AA_PumpEvents;
-
- device->free = AA_DeleteDevice;
-
- return device;
-}
-
-VideoBootStrap AALIB_bootstrap = {
- "aalib", "ASCII Art Library",
- AA_Available, AA_CreateDevice
-};
-
-static void AA_ResizeHandler(aa_context *);
-
-int AA_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- int keyboard;
- int i;
-
- /* Initialize all variables that we clean on shutdown */
- for ( i=0; i<SDL_NUMMODES; ++i ) {
- SDL_modelist[i] = SDL_malloc(sizeof(SDL_Rect));
- SDL_modelist[i]->x = SDL_modelist[i]->y = 0;
- }
- /* Modes sorted largest to smallest */
- SDL_modelist[0]->w = 1024; SDL_modelist[0]->h = 768;
- SDL_modelist[1]->w = 800; SDL_modelist[1]->h = 600;
- SDL_modelist[2]->w = 640; SDL_modelist[2]->h = 480;
- SDL_modelist[3]->w = 320; SDL_modelist[3]->h = 400;
- SDL_modelist[4]->w = 320; SDL_modelist[4]->h = 240;
- SDL_modelist[5]->w = 320; SDL_modelist[5]->h = 200;
- SDL_modelist[6] = NULL;
-
- /* Initialize the library */
-
- AA_mutex = SDL_CreateMutex();
-
- aa_parseoptions (NULL, NULL, NULL, NULL);
-
- AA_context = aa_autoinit(&aa_defparams);
- if ( ! AA_context ) {
- SDL_SetError("Unable to initialize AAlib");
- return(-1);
- }
-
- /* Enable mouse and keyboard support */
-
- if ( ! aa_autoinitkbd (AA_context, AA_SENDRELEASE) ) {
- SDL_SetError("Unable to initialize AAlib keyboard");
- return(-1);
- }
- if ( ! aa_autoinitmouse (AA_context, AA_SENDRELEASE) ) {
- fprintf(stderr,"Warning: Unable to initialize AAlib mouse");
- }
- AA_rparams = aa_getrenderparams();
-
- local_this = this;
-
- aa_resizehandler(AA_context, AA_ResizeHandler);
-
- fprintf(stderr,"Using AAlib driver: %s (%s)\n", AA_context->driver->name, AA_context->driver->shortname);
-
- AA_in_x11 = (SDL_strcmp(AA_context->driver->shortname,"X11") == 0);
- /* Determine the screen depth (use default 8-bit depth) */
- vformat->BitsPerPixel = 8;
- vformat->BytesPerPixel = 1;
-
- /* We're done! */
- return(0);
-}
-
-SDL_Rect **AA_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- if(format->BitsPerPixel != 8)
- return NULL;
-
- if ( flags & SDL_FULLSCREEN ) {
- return SDL_modelist;
- } else {
- return (SDL_Rect **) -1;
- }
-}
-
-/* From aavga.c
- AAlib does not give us the choice of the actual resolution, thus we have to simulate additional
- resolution by scaling down manually each frame
-*/
-static void fastscale (register char *b1, register char *b2, int x1, int x2, int y1, int y2)
-{
- register int ex, spx = 0, ddx, ddx1;
- int ddy1, ddy, spy = 0, ey;
- int x;
- char *bb1 = b1;
- if (!x1 || !x2 || !y1 || !y2)
- return;
- ddx = x1 + x1;
- ddx1 = x2 + x2;
- if (ddx1 < ddx)
- spx = ddx / ddx1, ddx %= ddx1;
- ddy = y1 + y1;
- ddy1 = y2 + y2;
- if (ddy1 < ddy)
- spy = (ddy / ddy1) * x1, ddy %= ddy1;
- ey = -ddy1;
- for (; y2; y2--) {
- ex = -ddx1;
- for (x = x2; x; x--) {
- *b2 = *b1;
- b2++;
- b1 += spx;
- ex += ddx;
- if (ex > 0) {
- b1++;
- ex -= ddx1;
- }
- }
- bb1 += spy;
- ey += ddy;
- if (ey > 0) {
- bb1 += x1;
- ey -= ddy1;
- }
- b1 = bb1;
- }
-}
-
-/* Various screen update functions available */
-static void AA_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
-
-SDL_Surface *AA_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- int mode;
-
- if ( AA_buffer ) {
- SDL_free( AA_buffer );
- }
-
- AA_buffer = SDL_malloc(width * height);
- if ( ! AA_buffer ) {
- SDL_SetError("Couldn't allocate buffer for requested mode");
- return(NULL);
- }
-
-/* printf("Setting mode %dx%d\n", width, height); */
-
- SDL_memset(aa_image(AA_context), 0, aa_imgwidth(AA_context) * aa_imgheight(AA_context));
- SDL_memset(AA_buffer, 0, width * height);
-
- /* Allocate the new pixel format for the screen */
- if ( ! SDL_ReallocFormat(current, 8, 0, 0, 0, 0) ) {
- return(NULL);
- }
-
- /* Set up the new mode framebuffer */
- current->flags = SDL_FULLSCREEN;
- AA_w = current->w = width;
- AA_h = current->h = height;
- current->pitch = current->w;
- current->pixels = AA_buffer;
-
- AA_x_ratio = ((double)aa_imgwidth(AA_context)) / ((double)width);
- AA_y_ratio = ((double)aa_imgheight(AA_context)) / ((double)height);
-
- /* Set the blit function */
- this->UpdateRects = AA_DirectUpdate;
-
- /* We're done */
- return(current);
-}
-
-static void AA_ResizeHandler(aa_context *context)
-{
- aa_resize(context);
- local_this->hidden->x_ratio = ((double)aa_imgwidth(context)) / ((double)local_this->screen->w);
- local_this->hidden->y_ratio = ((double)aa_imgheight(context)) / ((double)local_this->screen->h);
-
- fastscale (local_this->hidden->buffer, aa_image(context), local_this->hidden->w, aa_imgwidth (context), local_this->hidden->h, aa_imgheight (context));
- aa_renderpalette(context, local_this->hidden->palette, local_this->hidden->rparams, 0, 0, aa_scrwidth(context), aa_scrheight(context));
- aa_flush(context);
-}
-
-/* We don't actually allow hardware surfaces other than the main one */
-static int AA_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- return(-1);
-}
-static void AA_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-/* We need to wait for vertical retrace on page flipped displays */
-static int AA_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- /* TODO ? */
- return(0);
-}
-static void AA_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-/* FIXME: How is this done with AAlib? */
-static int AA_FlipHWSurface(_THIS, SDL_Surface *surface)
-{
- SDL_mutexP(AA_mutex);
- aa_flush(AA_context);
- SDL_mutexV(AA_mutex);
- return(0);
-}
-
-static void AA_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- int i;
- SDL_Rect *rect;
-
- fastscale (AA_buffer, aa_image(AA_context), AA_w, aa_imgwidth (AA_context), AA_h, aa_imgheight (AA_context));
-#if 1
- aa_renderpalette(AA_context, AA_palette, AA_rparams, 0, 0, aa_scrwidth(AA_context), aa_scrheight(AA_context));
-#else
- /* Render only the rectangles in the list */
- printf("Update rects : ");
- for ( i=0; i < numrects; ++i ) {
- rect = &rects[i];
- printf("(%d,%d-%d,%d)", rect->x, rect->y, rect->w, rect->h);
- aa_renderpalette(AA_context, AA_palette, AA_rparams, rect->x * AA_x_ratio, rect->y * AA_y_ratio, rect->w * AA_x_ratio, rect->h * AA_y_ratio);
- }
- printf("\n");
-#endif
- SDL_mutexP(AA_mutex);
- aa_flush(AA_context);
- SDL_mutexV(AA_mutex);
- return;
-}
-
-int AA_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- int i;
-
- for ( i=0; i < ncolors; i++ ) {
- aa_setpalette(AA_palette, firstcolor + i,
- colors[i].r>>2,
- colors[i].g>>2,
- colors[i].b>>2);
- }
- return(1);
-}
-
-/* Note: If we are terminated, this could be called in the middle of
- another SDL video routine -- notably UpdateRects.
-*/
-void AA_VideoQuit(_THIS)
-{
- int i;
-
- aa_uninitkbd(AA_context);
- aa_uninitmouse(AA_context);
-
- /* Free video mode lists */
- for ( i=0; i<SDL_NUMMODES; ++i ) {
- if ( SDL_modelist[i] != NULL ) {
- SDL_free(SDL_modelist[i]);
- SDL_modelist[i] = NULL;
- }
- }
-
- aa_close(AA_context);
-
- SDL_DestroyMutex(AA_mutex);
-
- this->screen->pixels = NULL;
-}
diff --git a/distrib/sdl-1.2.12/src/video/aalib/SDL_aavideo.h b/distrib/sdl-1.2.12/src/video/aalib/SDL_aavideo.h
deleted file mode 100644
index cd70c9f..0000000
--- a/distrib/sdl-1.2.12/src/video/aalib/SDL_aavideo.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_aavideo_h
-#define _SDL_aavideo_h
-
-#include "SDL_mouse.h"
-#include "SDL_mutex.h"
-#include "../SDL_sysvideo.h"
-
-#include <aalib.h>
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-#define SDL_NUMMODES 6
-
-/* Private display data */
-struct SDL_PrivateVideoData {
- SDL_Rect *SDL_modelist[SDL_NUMMODES+1];
- aa_context *context;
- aa_palette palette;
- aa_renderparams *rparams;
- double x_ratio, y_ratio;
- int w, h;
- SDL_mutex *mutex;
- int in_x11;
- void *buffer;
-};
-
-/* Old variable names */
-#define SDL_modelist (this->hidden->SDL_modelist)
-#define AA_context (this->hidden->context)
-#define AA_palette (this->hidden->palette)
-#define AA_rparams (this->hidden->rparams)
-#define AA_buffer (this->hidden->buffer)
-
-#define AA_x_ratio (this->hidden->x_ratio)
-#define AA_y_ratio (this->hidden->y_ratio)
-
-#define AA_mutex (this->hidden->mutex)
-#define AA_in_x11 (this->hidden->in_x11)
-#define AA_w (this->hidden->w)
-#define AA_h (this->hidden->h)
-
-#endif /* _SDL_aavideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ataric2p.S b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ataric2p.S
deleted file mode 100644
index 48012b3..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ataric2p.S
+++ /dev/null
@@ -1,447 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/*
- Chunky to planar conversion routine
- 1 byte/pixel -> 4 or 8 bit planes
-
- Patrice Mandin
- Xavier Joubert
- Mikael Kalms
-*/
-
- .globl _SDL_Atari_C2pConvert
- .globl _SDL_Atari_C2pConvert8
- .globl _SDL_Atari_C2pConvert4
- .globl _SDL_Atari_C2pConvert4_pal
-
-/* ------------ Conversion C2P, 8 bits ------------ */
-
- .text
-_SDL_Atari_C2pConvert8:
- movel sp@(4),c2p_source
- movel sp@(8),c2p_dest
- movel sp@(12),c2p_width
- movel sp@(16),c2p_height
- movel sp@(20),c2p_dblligne
- movel sp@(24),c2p_srcpitch
- movel sp@(28),c2p_dstpitch
-
- moveml d2-d7/a2-a6,sp@-
-
- movel c2p_source,c2p_cursrc
- movel c2p_dest,c2p_curdst
- movel #0x0f0f0f0f,d4
- movel #0x00ff00ff,d5
- movel #0x55555555,d6
- movew c2p_height+2,c2p_row
- movew c2p_width+2,d0
- andw #-8,d0
- movew d0,c2p_rowlen
-
-SDL_Atari_C2p8_rowloop:
-
- movel c2p_cursrc,a0
- movel c2p_curdst,a1
-
- movel a0,a2
- addw c2p_rowlen,a2
-
- movel a0@+,d0
- movel a0@+,d1
- movel a0@+,d2
- movel a0@+,d3
-/*
- d0 = a7a6a5a4a3a2a1a0 b7b6b5b4b3b2b1b0 c7c6c5c4c3c2c1c0 d7d6d5d4d3d2d1d0
- d1 = e7e6e5e4e3e2e1e0 f7f6f5f4f3f2f1f0 g7g6g5g4g3g2g1g0 h7h6h5h4h3h2h1h0
- d2 = i7i6i5i4i3i2i1i0 j7j6j5j4j3j2j1j0 k7k6k5k4k3k2k1k0 l7l6l5l4l3l2l1l0
- d3 = m7m6m5m4m3m2m1m0 n7n6n5n4n3n2n1n0 o7o6o5o4o3o2o1o0 p7p6p5p4p3p2p1p0
-*/
- movel d1,d7
- lsrl #4,d7
- eorl d0,d7
- andl d4,d7
- eorl d7,d0
- lsll #4,d7
- eorl d7,d1
-
- movel d3,d7
- lsrl #4,d7
- eorl d2,d7
- andl d4,d7
- eorl d7,d2
- lsll #4,d7
- eorl d7,d3
-
- movel d2,d7
- lsrl #8,d7
- eorl d0,d7
- andl d5,d7
- eorl d7,d0
- lsll #8,d7
- eorl d7,d2
-
- movel d3,d7
- lsrl #8,d7
- eorl d1,d7
- andl d5,d7
- eorl d7,d1
- lsll #8,d7
- eorl d7,d3
-/*
- d0 = a7a6a5a4e7e6e5e4 i7i6i5i4m7m6m5m4 c7c6c5c4g7g6g5g4 k7k6k5k4o7o6o5o4
- d1 = a3a2a1a0e3e2e1e0 i3i2i1i0m3m2m1m0 c3c2c1c0g3g2g1g0 k3k2k1k0o3o2o1o0
- d2 = b7b6b5b4f7f6f5f4 j7j6j5j4n7n6n5n4 d7d6d5d4h7h6h5h4 l7l6l5l4p7p6p5p4
- d3 = b3b2b1b0f3f2f1f0 j3j2j1j0n3n2n1n0 d3d2d1d0h3h2h1h0 l3l2l1l0p3p2p1p0
-*/
- bras SDL_Atari_C2p8_start
-
-SDL_Atari_C2p8_pix16:
-
- movel a0@+,d0
- movel a0@+,d1
- movel a0@+,d2
- movel a0@+,d3
-/*
- d0 = a7a6a5a4a3a2a1a0 b7b6b5b4b3b2b1b0 c7c6c5c4c3c2c1c0 d7d6d5d4d3d2d1d0
- d1 = e7e6e5e4e3e2e1e0 f7f6f5f4f3f2f1f0 g7g6g5g4g3g2g1g0 h7h6h5h4h3h2h1h0
- d2 = i7i6i5i4i3i2i1i0 j7j6j5j4j3j2j1j0 k7k6k5k4k3k2k1k0 l7l6l5l4l3l2l1l0
- d3 = m7m6m5m4m3m2m1m0 n7n6n5n4n3n2n1n0 o7o6o5o4o3o2o1o0 p7p6p5p4p3p2p1p0
-*/
- movel d1,d7
- lsrl #4,d7
- movel a3,a1@+
- eorl d0,d7
- andl d4,d7
- eorl d7,d0
- lsll #4,d7
- eorl d7,d1
-
- movel d3,d7
- lsrl #4,d7
- eorl d2,d7
- andl d4,d7
- eorl d7,d2
- movel a4,a1@+
- lsll #4,d7
- eorl d7,d3
-
- movel d2,d7
- lsrl #8,d7
- eorl d0,d7
- andl d5,d7
- eorl d7,d0
- movel a5,a1@+
- lsll #8,d7
- eorl d7,d2
-
- movel d3,d7
- lsrl #8,d7
- eorl d1,d7
- andl d5,d7
- eorl d7,d1
- movel a6,a1@+
- lsll #8,d7
- eorl d7,d3
-/*
- d0 = a7a6a5a4e7e6e5e4 i7i6i5i4m7m6m5m4 c7c6c5c4g7g6g5g4 k7k6k5k4o7o6o5o4
- d1 = a3a2a1a0e3e2e1e0 i3i2i1i0m3m2m1m0 c3c2c1c0g3g2g1g0 k3k2k1k0o3o2o1o0
- d2 = b7b6b5b4f7f6f5f4 j7j6j5j4n7n6n5n4 d7d6d5d4h7h6h5h4 l7l6l5l4p7p6p5p4
- d3 = b3b2b1b0f3f2f1f0 j3j2j1j0n3n2n1n0 d3d2d1d0h3h2h1h0 l3l2l1l0p3p2p1p0
-*/
-
-SDL_Atari_C2p8_start:
-
- movel d2,d7
- lsrl #1,d7
- eorl d0,d7
- andl d6,d7
- eorl d7,d0
- addl d7,d7
- eorl d7,d2
-
- movel d3,d7
- lsrl #1,d7
- eorl d1,d7
- andl d6,d7
- eorl d7,d1
- addl d7,d7
- eorl d7,d3
-/*
- d0 = a7b7a5b5e7f7e5f5 i7j7i5j5m7n7m5n5 c7d7c5d5g7h7g5h5 k7l7k5l5o7p7o5p5
- d1 = a3b3a1b1e3f3e1f1 i3j3i1j1m3n3m1n1 c3d3c1d1g3h3g1h1 k3l3k1l1o3p3o1p1
- d2 = a6b6a4b4e6f6e4f4 i6j6i4j4m6n6m4n4 c6d6c4d4g6h6g4h4 k6l6k4l4o6p6o4p4
- d3 = a2b2a0b0e2f2e0f0 i2j2i0j0m2n2m0n0 c2d2c0d0g2h2g0h0 k2l2k0l0o2p2o0p0
-*/
- movew d2,d7
- movew d0,d2
- swap d2
- movew d2,d0
- movew d7,d2
-
- movew d3,d7
- movew d1,d3
- swap d3
- movew d3,d1
- movew d7,d3
-/*
- d0 = a7b7a5b5e7f7e5f5 i7j7i5j5m7n7m5n5 a6b6a4b4e6f6e4f4 i6j6i4j4m6n6m4n4
- d1 = a3b3a1b1e3f3e1f1 i3j3i1j1m3n3m1n1 a2b2a0b0e2f2e0f0 i2j2i0j0m2n2m0n0
- d2 = c7d7c5d5g7h7g5h5 k7l7k5l5o7p7o5p5 c6d6c4d4g6h6g4h4 k6l6k4l4o6p6o4p4
- d3 = c3d3c1d1g3h3g1h1 k3l3k1l1o3p3o1p1 c2d2c0d0g2h2g0h0 k2l2k0l0o2p2o0p0
-*/
- movel d2,d7
- lsrl #2,d7
- eorl d0,d7
- andl #0x33333333,d7
- eorl d7,d0
- lsll #2,d7
- eorl d7,d2
-
- movel d3,d7
- lsrl #2,d7
- eorl d1,d7
- andl #0x33333333,d7
- eorl d7,d1
- lsll #2,d7
- eorl d7,d3
-/*
- d0 = a7b7c7d7e7f7g7h7 i7j7k7l7m7n7o7p7 a6b6c6d6e6f6g6h6 i6j6k6l6m6n6o6p6
- d1 = a3b3c3d3e3f3g3h3 i3j3k3l3m3n3o3p3 a2b2c2d2e2f2g2h2 i2j2k2l2m2n2o2p2
- d2 = a5b5c5d5e5f5g5h5 i5j5k5l5m5n5o5p5 a4b4c4d4e4f4g4h4 i4j4k4l4m4n4o4p4
- d3 = a1b1c1d1e1f1g1h1 i1j1k1l1m1n1o1p1 a0b0c0d0e0f0g0h0 i0j0k0l0m0n0o0p0
-*/
- swap d0
- swap d1
- swap d2
- swap d3
-
- movel d0,a6
- movel d2,a5
- movel d1,a4
- movel d3,a3
-
- cmpl a0,a2
- bgt SDL_Atari_C2p8_pix16
-
- movel a3,a1@+
- movel a4,a1@+
- movel a5,a1@+
- movel a6,a1@+
-
- /* Double the line ? */
-
- movel c2p_srcpitch,d0
- movel c2p_dstpitch,d1
-
- tstl c2p_dblligne
- beqs SDL_Atari_C2p8_nodblline
-
- movel c2p_curdst,a0
- movel a0,a1
- addl d1,a1
-
- movew c2p_width+2,d7
- lsrw #4,d7
- subql #1,d7
-SDL_Atari_C2p8_dblloop:
- movel a0@+,a1@+
- movel a0@+,a1@+
- movel a0@+,a1@+
- movel a0@+,a1@+
- dbra d7,SDL_Atari_C2p8_dblloop
-
- addl d1,c2p_curdst
-
-SDL_Atari_C2p8_nodblline:
-
- /* Next line */
-
- addl d0,c2p_cursrc
- addl d1,c2p_curdst
-
- subqw #1,c2p_row
- bne SDL_Atari_C2p8_rowloop
-
- moveml sp@+,d2-d7/a2-a6
- rts
-
-/* ------------ Conversion C2P, 4 bits ------------ */
-
-_SDL_Atari_C2pConvert4:
- movel sp@(4),c2p_source
- movel sp@(8),c2p_dest
- movel sp@(12),c2p_width
- movel sp@(16),c2p_height
- movel sp@(20),c2p_dblligne
- movel sp@(24),c2p_srcpitch
- movel sp@(28),c2p_dstpitch
-
- moveml d2-d7/a2-a6,sp@-
-
- movel c2p_source,a0
- movel c2p_dest,a1
- lea _SDL_Atari_table_c2p,a2
- movel #0x00070001,d3
-#if defined(__M68020__)
- moveq #0,d0
-#endif
-
- movel c2p_height,d7
- subql #1,d7
-c2p4_bcly:
- movel a0,a4 | Save start address of source
- movel a1,a5 | Save start address of dest
-
- | Conversion
-
- movel c2p_width,d6
- lsrw #4,d6
- subql #1,d6
-c2p4_bclx:
- | Octets 0-7
-
- moveq #0,d1
- moveq #7,d5
-c2p4_bcl07:
-#if defined(__M68020__)
- moveb a0@+,d0
- lea a2@(0,d0:w:4),a3
-#else
- moveq #0,d0
- moveb a0@+,d0
- lslw #2,d0
- lea a2@(0,d0:w),a3
-#endif
- lsll #1,d1
- orl a3@,d1
- dbra d5,c2p4_bcl07
-
- movepl d1,a1@(0)
- addw d3,a1
- swap d3
-
- | Octets 8-15
-
- moveq #0,d1
- moveq #7,d5
-c2p4_bcl815:
-#if defined(__M68020__)
- moveb a0@+,d0
- lea a2@(0,d0:w:4),a3
-#else
- moveq #0,d0
- moveb a0@+,d0
- lslw #2,d0
- lea a2@(0,d0:w),a3
-#endif
- lsll #1,d1
- orl a3@,d1
- dbra d5,c2p4_bcl815
-
- movepl d1,a1@(0)
- addw d3,a1
- swap d3
-
- dbra d6,c2p4_bclx
-
- | Double line ?
-
- tstl c2p_dblligne
- beqs c2p4_nodblligne
-
- movel a5,a6 | src line
- movel a5,a1 | dest line
- addl c2p_dstpitch,a1
-
- movel c2p_width,d6
- lsrw #3,d6
- subql #1,d6
-c2p4_copydbl:
- movel a6@+,a1@+
- dbra d6,c2p4_copydbl
-
- addl c2p_dstpitch,a5
-c2p4_nodblligne:
-
- | Next line
-
- movel a4,a0
- addl c2p_srcpitch,a0
- movel a5,a1
- addl c2p_dstpitch,a1
-
- dbra d7,c2p4_bcly
-
- moveml sp@+,d2-d7/a2-a6
- rts
-
-/* ------------ Conversion of a light palette in 4 bits ------------ */
-
-_SDL_Atari_C2pConvert4_pal:
- /* a0 is a 256-word light palette */
- movel sp@(4),a0
-
- moveml d2-d3,sp@-
-
- lea _SDL_Atari_table_c2p,a1
- movew #255,d3
-c2p_pal_initbcl:
- movew a0@+,d0
- lsrw #4,d0
- andw #15,d0
-
- moveq #3,d1
-c2p_pal_initbyte:
- btst d1,d0
- sne d2
- negw d2
- moveb d2,a1@(0,d1:w)
-
- dbra d1,c2p_pal_initbyte
-
- addql #4,a1
- dbra d3,c2p_pal_initbcl
-
- moveml sp@+,d2-d3
-
- rts
-
-/* ------------ Buffers ------------ */
-
- .bss
-
- .even
- .comm _SDL_Atari_C2pConvert,4
- .comm _SDL_Atari_table_c2p,1024
-
- .comm c2p_source,4 /* Source framebuffer */
- .comm c2p_dest,4 /* Destination framebuffer */
- .comm c2p_width,4 /* Width of zone to convert */
- .comm c2p_height,4 /* Height of zone to convert */
- .comm c2p_dblligne,4 /* Double the lines while converting ? */
- .comm c2p_srcpitch,4 /* Source pitch */
- .comm c2p_dstpitch,4 /* Destination pitch */
- .comm c2p_cursrc,4 /* Current source line */
- .comm c2p_curdst,4 /* Current destination line */
- .comm c2p_rowlen,2 /* Line length in bytes */
- .comm c2p_row,2 /* Current line number */
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ataric2p_s.h b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ataric2p_s.h
deleted file mode 100644
index a8f97e2..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ataric2p_s.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _ATARI_C2P_h
-#define _ATARI_C2P_h
-
-#include "SDL_stdinc.h"
-
-/*--- Functions pointers ---*/
-
-/* Convert a chunky screen to bitplane screen */
-
-extern void (*SDL_Atari_C2pConvert)(
- Uint8 *src, /* Source screen (one byte=one pixel) */
- Uint8 *dest, /* Destination (4/8 bits planes) */
- Uint32 width, /* Dimensions of screen to convert */
- Uint32 height,
- Uint32 dblligne, /* Double the lines when converting ? */
- Uint32 srcpitch, /* Length of one source line in bytes */
- Uint32 dstpitch /* Length of one destination line in bytes */
-);
-
-/*--- 8 bits functions ---*/
-
-/* Convert a chunky screen to bitplane screen */
-
-void SDL_Atari_C2pConvert8(
- Uint8 *src, /* Source screen (one byte=one pixel) */
- Uint8 *dest, /* Destination (8 bits planes) */
- Uint32 width, /* Dimensions of screen to convert */
- Uint32 height,
- Uint32 dblligne, /* Double the lines when converting ? */
- Uint32 srcpitch, /* Length of one source line in bytes */
- Uint32 dstpitch /* Length of one destination line in bytes */
-);
-
-/*--- 4 bits functions ---*/
-
-/* Convert a chunky screen to bitplane screen */
-
-void SDL_Atari_C2pConvert4(
- Uint8 *src, /* Source screen (one byte=one pixel) */
- Uint8 *dest, /* Destination (4 bits planes) */
- Uint32 width, /* Dimensions of screen to convert */
- Uint32 height,
- Uint32 dblligne, /* Double the lines when converting ? */
- Uint32 srcpitch, /* Length of one source line in bytes */
- Uint32 dstpitch /* Length of one destination line in bytes */
-);
-
-/* Conversion palette */
-
-void SDL_Atari_C2pConvert4_pal(Uint16 *lightpalette);
-
-#endif /* _ATARI_C2P_h */
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ataridevmouse.c b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ataridevmouse.c
deleted file mode 100644
index b1e7357..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ataridevmouse.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- MiNT /dev/mouse driver
-
- Patrice Mandin
-*/
-
-#include <fcntl.h>
-#include <unistd.h>
-
-#include "../../events/SDL_events_c.h"
-#include "SDL_ataridevmouse_c.h"
-
-/* Defines */
-
-#define DEVICE_NAME "/dev/mouse"
-
-/* Local variables */
-
-static int handle = -1;
-static int mouseb, prev_mouseb;
-
-/* Functions */
-
-int SDL_AtariDevMouse_Open(void)
-{
- int r;
- const char *mousedev;
-
- /*
- TODO: Fix the MiNT device driver, that locks mouse for other
- applications, so this is disabled till fixed
- */
- return 0;
-
- /* First, try SDL_MOUSEDEV device */
- mousedev = SDL_getenv("SDL_MOUSEDEV");
- if (!mousedev) {
- handle = open(mousedev, 0);
- }
-
- /* Failed, try default device */
- if (handle<0) {
- handle = open(DEVICE_NAME, 0);
- }
-
- if (handle<0) {
- handle = -1;
- return 0;
- }
-
- /* Set non blocking mode */
- r = fcntl(handle, F_GETFL, 0);
- if (r<0) {
- close(handle);
- handle = -1;
- return 0;
- }
-
- r |= O_NDELAY;
-
- r = fcntl(handle, F_SETFL, r);
- if (r<0) {
- close(handle);
- handle = -1;
- return 0;
- }
-
- prev_mouseb = 7;
- return 1;
-}
-
-void SDL_AtariDevMouse_Close(void)
-{
- if (handle>0) {
- close(handle);
- handle = -1;
- }
-}
-
-static int atari_GetButton(int button)
-{
- switch(button)
- {
- case 0:
- return SDL_BUTTON_RIGHT;
- case 1:
- return SDL_BUTTON_MIDDLE;
- default:
- break;
- }
-
- return SDL_BUTTON_LEFT;
-}
-
-void SDL_AtariDevMouse_PostMouseEvents(_THIS, SDL_bool buttonEvents)
-{
- unsigned char buffer[3];
- int mousex, mousey;
-
- if (handle<0) {
- return;
- }
-
- mousex = mousey = 0;
- while (read(handle, buffer, sizeof(buffer))==sizeof(buffer)) {
- mouseb = buffer[0] & 7;
- mousex += (char) buffer[1];
- mousey += (char) buffer[2];
-
- /* Mouse button events */
- if (buttonEvents && (mouseb != prev_mouseb)) {
- int i;
-
- for (i=0;i<3;i++) {
- int curbutton, prevbutton;
-
- curbutton = mouseb & (1<<i);
- prevbutton = prev_mouseb & (1<<i);
-
- if (curbutton && !prevbutton) {
- SDL_PrivateMouseButton(SDL_RELEASED, atari_GetButton(i), 0, 0);
- }
- if (!curbutton && prevbutton) {
- SDL_PrivateMouseButton(SDL_PRESSED, atari_GetButton(i), 0, 0);
- }
- }
-
- prev_mouseb = mouseb;
- }
- }
-
- /* Mouse motion event */
- if (mousex || mousey) {
- SDL_PrivateMouseMotion(0, 1, mousex, -mousey);
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ataridevmouse_c.h b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ataridevmouse_c.h
deleted file mode 100644
index a84ab79..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ataridevmouse_c.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- MiNT /dev/mouse driver
-
- Patrice Mandin
-*/
-
-#ifndef _SDL_ATARI_DEVMOUSE_H_
-#define _SDL_ATARI_DEVMOUSE_H_
-
-#include "../SDL_sysvideo.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-extern int SDL_AtariDevMouse_Open(void);
-extern void SDL_AtariDevMouse_Close(void);
-extern void SDL_AtariDevMouse_PostMouseEvents(_THIS, SDL_bool buttonEvents);
-
-#endif /* _SDL_ATARI_DEVMOUSE_H_ */
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarieddi.S b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarieddi.S
deleted file mode 100644
index e47cb6e..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarieddi.S
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/*
- * Read EdDI version
- *
- * Patrice Mandin
- */
-
- .text
-
- .globl _Atari_get_EdDI_version
-
-/*--- Vector installer ---*/
-
-_Atari_get_EdDI_version:
- movel sp@(4),a0 /* Value of EdDI cookie */
-
- /* Call EdDI function #0 */
- clrw d0
- jsr (a0)
-
- rts
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarieddi_s.h b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarieddi_s.h
deleted file mode 100644
index 22031bd..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarieddi_s.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_Atari_eddi_s_h
-#define _SDL_Atari_eddi_s_h
-
-/*--- Defines ---*/
-
-/* EdDI versions */
-
-#define EDDI_10 (0x0100)
-#define EDDI_11 (0x0110)
-
-/* Screen format */
-
-enum {
- VDI_FORMAT_UNKNOWN=-1,
- VDI_FORMAT_INTER=0, /* Interleaved bitplanes */
- VDI_FORMAT_VDI=1, /* VDI independent */
- VDI_FORMAT_PACK=2 /* Packed pixels */
-};
-
-/* CLUT types */
-enum {
- VDI_CLUT_NONE=0, /* Monochrome mode */
- VDI_CLUT_HARDWARE, /* <256 colours mode */
- VDI_CLUT_SOFTWARE /* True colour mode */
-};
-
-/*--- Functions ---*/
-
-unsigned long Atari_get_EdDI_version(void *function_pointer);
-
-#endif /* _SDL_Atari_eddi_s_h */
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarievents.c b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarievents.c
deleted file mode 100644
index 5c1dd4e..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarievents.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * Atari keyboard events manager
- *
- * Patrice Mandin
- *
- * This routines choose what the final event manager will be
- */
-
-#include <mint/cookie.h>
-#include <mint/ostruct.h>
-#include <mint/osbind.h>
-
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_atarikeys.h"
-#include "SDL_atarievents_c.h"
-#include "SDL_biosevents_c.h"
-#include "SDL_gemdosevents_c.h"
-#include "SDL_ikbdevents_c.h"
-
-enum {
- MCH_ST=0,
- MCH_STE,
- MCH_TT,
- MCH_F30,
- MCH_CLONE,
- MCH_ARANYM
-};
-
-#ifndef KT_NOCHANGE
-# define KT_NOCHANGE -1
-#endif
-
-/* The translation tables from a console scancode to a SDL keysym */
-static SDLKey keymap[ATARIBIOS_MAXKEYS];
-static unsigned char *keytab_normal;
-
-void (*Atari_ShutdownEvents)(void);
-
-static void Atari_InitializeEvents(_THIS)
-{
- const char *envr;
- unsigned long cookie_mch;
-
- /* Test if we are on an Atari machine or not */
- if (Getcookie(C__MCH, &cookie_mch) == C_NOTFOUND) {
- cookie_mch = 0;
- }
- cookie_mch >>= 16;
-
- /* Default is Ikbd, the faster except for clones */
- switch(cookie_mch) {
- case MCH_ST:
- case MCH_STE:
- case MCH_TT:
- case MCH_F30:
- case MCH_ARANYM:
- this->InitOSKeymap=AtariIkbd_InitOSKeymap;
- this->PumpEvents=AtariIkbd_PumpEvents;
- Atari_ShutdownEvents=AtariIkbd_ShutdownEvents;
- break;
- default:
- this->InitOSKeymap=AtariGemdos_InitOSKeymap;
- this->PumpEvents=AtariGemdos_PumpEvents;
- Atari_ShutdownEvents=AtariGemdos_ShutdownEvents;
- break;
- }
-
- envr = SDL_getenv("SDL_ATARI_EVENTSDRIVER");
-
- if (!envr) {
- return;
- }
-
- if (SDL_strcmp(envr, "ikbd") == 0) {
- this->InitOSKeymap=AtariIkbd_InitOSKeymap;
- this->PumpEvents=AtariIkbd_PumpEvents;
- Atari_ShutdownEvents=AtariIkbd_ShutdownEvents;
- }
-
- if (SDL_strcmp(envr, "gemdos") == 0) {
- this->InitOSKeymap=AtariGemdos_InitOSKeymap;
- this->PumpEvents=AtariGemdos_PumpEvents;
- Atari_ShutdownEvents=AtariGemdos_ShutdownEvents;
- }
-
- if (SDL_strcmp(envr, "bios") == 0) {
- this->InitOSKeymap=AtariBios_InitOSKeymap;
- this->PumpEvents=AtariBios_PumpEvents;
- Atari_ShutdownEvents=AtariBios_ShutdownEvents;
- }
-}
-
-void Atari_InitOSKeymap(_THIS)
-{
- Atari_InitializeEvents(this);
-
- SDL_Atari_InitInternalKeymap(this);
-
- /* Call choosen routine */
- this->InitOSKeymap(this);
-}
-
-void SDL_Atari_InitInternalKeymap(_THIS)
-{
- int i;
- _KEYTAB *key_tables;
-
- /* Read system tables for scancode -> ascii translation */
- key_tables = (_KEYTAB *) Keytbl(KT_NOCHANGE, KT_NOCHANGE, KT_NOCHANGE);
- keytab_normal = key_tables->unshift;
-
- /* Initialize keymap */
- for ( i=0; i<ATARIBIOS_MAXKEYS; i++ )
- keymap[i] = SDLK_UNKNOWN;
-
- /* Functions keys */
- for ( i = 0; i<10; i++ )
- keymap[SCANCODE_F1 + i] = SDLK_F1+i;
-
- /* Cursor keypad */
- keymap[SCANCODE_HELP] = SDLK_HELP;
- keymap[SCANCODE_UNDO] = SDLK_UNDO;
- keymap[SCANCODE_INSERT] = SDLK_INSERT;
- keymap[SCANCODE_CLRHOME] = SDLK_HOME;
- keymap[SCANCODE_UP] = SDLK_UP;
- keymap[SCANCODE_DOWN] = SDLK_DOWN;
- keymap[SCANCODE_RIGHT] = SDLK_RIGHT;
- keymap[SCANCODE_LEFT] = SDLK_LEFT;
-
- /* Special keys */
- keymap[SCANCODE_ESCAPE] = SDLK_ESCAPE;
- keymap[SCANCODE_BACKSPACE] = SDLK_BACKSPACE;
- keymap[SCANCODE_TAB] = SDLK_TAB;
- keymap[SCANCODE_ENTER] = SDLK_RETURN;
- keymap[SCANCODE_DELETE] = SDLK_DELETE;
- keymap[SCANCODE_LEFTCONTROL] = SDLK_LCTRL;
- keymap[SCANCODE_LEFTSHIFT] = SDLK_LSHIFT;
- keymap[SCANCODE_RIGHTSHIFT] = SDLK_RSHIFT;
- keymap[SCANCODE_LEFTALT] = SDLK_LALT;
- keymap[SCANCODE_CAPSLOCK] = SDLK_CAPSLOCK;
-}
-
-void Atari_PumpEvents(_THIS)
-{
- Atari_InitializeEvents(this);
-
- /* Call choosen routine */
- this->PumpEvents(this);
-}
-
-/* Atari to Unicode charset translation table */
-
-Uint16 SDL_AtariToUnicodeTable[256]={
- /* Standard ASCII characters from 0x00 to 0x7e */
- /* Unicode stuff from 0x7f to 0xff */
-
- 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
- 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
- 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
- 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
- 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
- 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
- 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
- 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
-
- 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
- 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
- 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
- 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
- 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
- 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
- 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
- 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x0394,
-
- 0x00C7,0x00FC,0x00E9,0x00E2,0x00E4,0x00E0,0x00E5,0x00E7,
- 0x00EA,0x00EB,0x00E8,0x00EF,0x00EE,0x00EC,0x00C4,0x00C5,
- 0x00C9,0x00E6,0x00C6,0x00F4,0x00F6,0x00F2,0x00FB,0x00F9,
- 0x00FF,0x00D6,0x00DC,0x00A2,0x00A3,0x00A5,0x00DF,0x0192,
- 0x00E1,0x00ED,0x00F3,0x00FA,0x00F1,0x00D1,0x00AA,0x00BA,
- 0x00BF,0x2310,0x00AC,0x00BD,0x00BC,0x00A1,0x00AB,0x00BB,
- 0x00C3,0x00F5,0x00D8,0x00F8,0x0153,0x0152,0x00C0,0x00C3,
- 0x00D5,0x00A8,0x00B4,0x2020,0x00B6,0x00A9,0x00AE,0x2122,
-
- 0x0133,0x0132,0x05D0,0x05D1,0x05D2,0x05D3,0x05D4,0x05D5,
- 0x05D6,0x05D7,0x05D8,0x05D9,0x05DB,0x05DC,0x05DE,0x05E0,
- 0x05E1,0x05E2,0x05E4,0x05E6,0x05E7,0x05E8,0x05E9,0x05EA,
- 0x05DF,0x05DA,0x05DD,0x05E3,0x05E5,0x00A7,0x2038,0x221E,
- 0x03B1,0x03B2,0x0393,0x03C0,0x03A3,0x03C3,0x00B5,0x03C4,
- 0x03A6,0x0398,0x03A9,0x03B4,0x222E,0x03C6,0x2208,0x2229,
- 0x2261,0x00B1,0x2265,0x2264,0x2320,0x2321,0x00F7,0x2248,
- 0x00B0,0x2022,0x00B7,0x221A,0x207F,0x00B2,0x00B3,0x00AF
-};
-
-SDL_keysym *SDL_Atari_TranslateKey(int scancode, SDL_keysym *keysym,
- SDL_bool pressed)
-{
- int asciicode = 0;
-
- /* Set the keysym information */
- keysym->scancode = scancode;
- keysym->mod = KMOD_NONE;
- keysym->sym = keymap[scancode];
- keysym->unicode = 0;
-
- if (keysym->sym == SDLK_UNKNOWN) {
- keysym->sym = asciicode = keytab_normal[scancode];
- }
-
- if (SDL_TranslateUNICODE && pressed) {
- keysym->unicode = SDL_AtariToUnicodeTable[asciicode];
- }
-
- return(keysym);
-}
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarievents_c.h b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarievents_c.h
deleted file mode 100644
index 36f06ec..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarievents_c.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * Atari keyboard events manager
- *
- * Patrice Mandin
- */
-
-#ifndef _SDL_ATARI_EVENTS_H_
-#define _SDL_ATARI_EVENTS_H_
-
-#include "../SDL_sysvideo.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-#define ATARIBIOS_MAXKEYS 128
-
-/* Special keys state */
-#ifndef K_RSHIFT
-enum {
- K_RSHIFT=0,
- K_LSHIFT,
- K_CTRL,
- K_ALT,
- K_CAPSLOCK,
- K_CLRHOME,
- K_INSERT
-};
-#endif
-
-extern void (*Atari_ShutdownEvents)(void);
-
-extern void Atari_InitOSKeymap(_THIS);
-extern void Atari_PumpEvents(_THIS);
-
-extern void SDL_Atari_InitInternalKeymap(_THIS);
-
-/* Atari to Unicode charset translation table */
-extern Uint16 SDL_AtariToUnicodeTable[256];
-SDL_keysym *SDL_Atari_TranslateKey(int scancode, SDL_keysym *keysym,
- SDL_bool pressed);
-
-#endif /* _SDL_ATARI_EVENTS_H_ */
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarigl.c b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarigl.c
deleted file mode 100644
index 9cc8d22..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarigl.c
+++ /dev/null
@@ -1,1088 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Atari OSMesa.ldg implementation of SDL OpenGL support */
-
-/*--- Includes ---*/
-
-#if SDL_VIDEO_OPENGL
-#include <GL/osmesa.h>
-#endif
-
-#include <mint/osbind.h>
-
-#include "SDL_endian.h"
-#include "SDL_video.h"
-#include "SDL_atarigl_c.h"
-#if SDL_VIDEO_OPENGL_OSMESA_DYNAMIC
-#include "SDL_loadso.h"
-#endif
-
-/*--- Defines ---*/
-
-#define PATH_OSMESA_LDG "osmesa.ldg"
-#define PATH_MESAGL_LDG "mesa_gl.ldg"
-#define PATH_TINYGL_LDG "tiny_gl.ldg"
-
-#define VDI_RGB 0xf
-
-/*--- Functions prototypes ---*/
-
-static void SDL_AtariGL_UnloadLibrary(_THIS);
-
-#if SDL_VIDEO_OPENGL
-static void CopyShadowNull(_THIS, SDL_Surface *surface);
-static void CopyShadowDirect(_THIS, SDL_Surface *surface);
-static void CopyShadowRGBTo555(_THIS, SDL_Surface *surface);
-static void CopyShadowRGBTo565(_THIS, SDL_Surface *surface);
-static void CopyShadowRGBSwap(_THIS, SDL_Surface *surface);
-static void CopyShadowRGBToARGB(_THIS, SDL_Surface *surface);
-static void CopyShadowRGBToABGR(_THIS, SDL_Surface *surface);
-static void CopyShadowRGBToBGRA(_THIS, SDL_Surface *surface);
-static void CopyShadowRGBToRGBA(_THIS, SDL_Surface *surface);
-static void CopyShadow8888To555(_THIS, SDL_Surface *surface);
-static void CopyShadow8888To565(_THIS, SDL_Surface *surface);
-
-static void ConvertNull(_THIS, SDL_Surface *surface);
-static void Convert565To555be(_THIS, SDL_Surface *surface);
-static void Convert565To555le(_THIS, SDL_Surface *surface);
-static void Convert565le(_THIS, SDL_Surface *surface);
-static void ConvertBGRAToABGR(_THIS, SDL_Surface *surface);
-
-static int InitNew(_THIS, SDL_Surface *current);
-static int InitOld(_THIS, SDL_Surface *current);
-#endif
-
-/*--- Public functions ---*/
-
-int SDL_AtariGL_Init(_THIS, SDL_Surface *current)
-{
-#if SDL_VIDEO_OPENGL
- if (gl_oldmesa) {
- gl_active = InitOld(this, current);
- } else {
- gl_active = InitNew(this, current);
- }
-#endif
-
- return (gl_active);
-}
-
-void SDL_AtariGL_Quit(_THIS, SDL_bool unload)
-{
-#if SDL_VIDEO_OPENGL
- if (gl_oldmesa) {
- /* Old mesa implementations */
- if (this->gl_data->OSMesaDestroyLDG) {
- this->gl_data->OSMesaDestroyLDG();
- }
- if (gl_shadow) {
- Mfree(gl_shadow);
- gl_shadow = NULL;
- }
- } else {
- /* New mesa implementation */
- if (gl_ctx) {
- if (this->gl_data->OSMesaDestroyContext) {
- this->gl_data->OSMesaDestroyContext(gl_ctx);
- }
- gl_ctx = NULL;
- }
- }
-
- if (unload) {
- SDL_AtariGL_UnloadLibrary(this);
- }
-
-#endif /* SDL_VIDEO_OPENGL */
- gl_active = 0;
-}
-
-int SDL_AtariGL_LoadLibrary(_THIS, const char *path)
-{
-#if SDL_VIDEO_OPENGL
-
-#if SDL_VIDEO_OPENGL_OSMESA_DYNAMIC
- void *handle;
- SDL_bool cancel_load;
-
- if (gl_active) {
- SDL_SetError("OpenGL context already created");
- return -1;
- }
-
- /* Unload previous driver */
- SDL_AtariGL_UnloadLibrary(this);
-
- /* Load library given by path */
- handle = SDL_LoadObject(path);
- if (handle == NULL) {
- /* Try to load another one */
- path = SDL_getenv("SDL_VIDEO_GL_DRIVER");
- if ( path != NULL ) {
- handle = SDL_LoadObject(path);
- }
-
- /* If it does not work, try some other */
- if (handle == NULL) {
- path = PATH_OSMESA_LDG;
- handle = SDL_LoadObject(path);
- }
-
- if (handle == NULL) {
- path = PATH_MESAGL_LDG;
- handle = SDL_LoadObject(path);
- }
-
- if (handle == NULL) {
- path = PATH_TINYGL_LDG;
- handle = SDL_LoadObject(path);
- }
- }
-
- if (handle == NULL) {
- SDL_SetError("Could not load OpenGL library");
- return -1;
- }
-
- this->gl_data->glGetIntegerv = SDL_LoadFunction(handle, "glGetIntegerv");
- this->gl_data->glFinish = SDL_LoadFunction(handle, "glFinish");
- this->gl_data->glFlush = SDL_LoadFunction(handle, "glFlush");
-
- cancel_load = SDL_FALSE;
- if (this->gl_data->glGetIntegerv == NULL) {
- cancel_load = SDL_TRUE;
- } else {
- /* We need either glFinish (OSMesa) or glFlush (TinyGL) */
- if ((this->gl_data->glFinish == NULL) &&
- (this->gl_data->glFlush == NULL)) {
- cancel_load = SDL_TRUE;
- }
- }
- if (cancel_load) {
- SDL_SetError("Could not retrieve OpenGL functions");
- SDL_UnloadObject(handle);
- /* Restore pointers to static library */
- SDL_AtariGL_InitPointers(this);
- return -1;
- }
-
- /* Load functions pointers (osmesa.ldg) */
- this->gl_data->OSMesaCreateContextExt = SDL_LoadFunction(handle, "OSMesaCreateContextExt");
- this->gl_data->OSMesaDestroyContext = SDL_LoadFunction(handle, "OSMesaDestroyContext");
- this->gl_data->OSMesaMakeCurrent = SDL_LoadFunction(handle, "OSMesaMakeCurrent");
- this->gl_data->OSMesaPixelStore = SDL_LoadFunction(handle, "OSMesaPixelStore");
- this->gl_data->OSMesaGetProcAddress = SDL_LoadFunction(handle, "OSMesaGetProcAddress");
-
- /* Load old functions pointers (mesa_gl.ldg, tiny_gl.ldg) */
- this->gl_data->OSMesaCreateLDG = SDL_LoadFunction(handle, "OSMesaCreateLDG");
- this->gl_data->OSMesaDestroyLDG = SDL_LoadFunction(handle, "OSMesaDestroyLDG");
-
- gl_oldmesa = 0;
-
- if ( (this->gl_data->OSMesaCreateContextExt == NULL) ||
- (this->gl_data->OSMesaDestroyContext == NULL) ||
- (this->gl_data->OSMesaMakeCurrent == NULL) ||
- (this->gl_data->OSMesaPixelStore == NULL) ||
- (this->gl_data->OSMesaGetProcAddress == NULL)) {
- /* Hum, maybe old library ? */
- if ( (this->gl_data->OSMesaCreateLDG == NULL) ||
- (this->gl_data->OSMesaDestroyLDG == NULL)) {
- SDL_SetError("Could not retrieve OSMesa functions");
- SDL_UnloadObject(handle);
- /* Restore pointers to static library */
- SDL_AtariGL_InitPointers(this);
- return -1;
- } else {
- gl_oldmesa = 1;
- }
- }
-
- this->gl_config.dll_handle = handle;
- if ( path ) {
- SDL_strlcpy(this->gl_config.driver_path, path,
- SDL_arraysize(this->gl_config.driver_path));
- } else {
- *this->gl_config.driver_path = '\0';
- }
-
-#endif
- this->gl_config.driver_loaded = 1;
-
- return 0;
-#else
- return -1;
-#endif
-}
-
-void *SDL_AtariGL_GetProcAddress(_THIS, const char *proc)
-{
- void *func = NULL;
-#if SDL_VIDEO_OPENGL
-
- if (this->gl_config.dll_handle) {
- func = SDL_LoadFunction(this->gl_config.dll_handle, (void *)proc);
- } else if (this->gl_data->OSMesaGetProcAddress) {
- func = this->gl_data->OSMesaGetProcAddress(proc);
- }
-
-#endif
- return func;
-}
-
-int SDL_AtariGL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
-{
-#if SDL_VIDEO_OPENGL
- GLenum mesa_attrib;
- SDL_Surface *surface;
-
- if (!gl_active) {
- return -1;
- }
-
- switch(attrib) {
- case SDL_GL_RED_SIZE:
- mesa_attrib = GL_RED_BITS;
- break;
- case SDL_GL_GREEN_SIZE:
- mesa_attrib = GL_GREEN_BITS;
- break;
- case SDL_GL_BLUE_SIZE:
- mesa_attrib = GL_BLUE_BITS;
- break;
- case SDL_GL_ALPHA_SIZE:
- mesa_attrib = GL_ALPHA_BITS;
- break;
- case SDL_GL_DOUBLEBUFFER:
- surface = this->screen;
- *value = ((surface->flags & SDL_DOUBLEBUF)==SDL_DOUBLEBUF);
- return 0;
- case SDL_GL_DEPTH_SIZE:
- mesa_attrib = GL_DEPTH_BITS;
- break;
- case SDL_GL_STENCIL_SIZE:
- mesa_attrib = GL_STENCIL_BITS;
- break;
- case SDL_GL_ACCUM_RED_SIZE:
- mesa_attrib = GL_ACCUM_RED_BITS;
- break;
- case SDL_GL_ACCUM_GREEN_SIZE:
- mesa_attrib = GL_ACCUM_GREEN_BITS;
- break;
- case SDL_GL_ACCUM_BLUE_SIZE:
- mesa_attrib = GL_ACCUM_BLUE_BITS;
- break;
- case SDL_GL_ACCUM_ALPHA_SIZE:
- mesa_attrib = GL_ACCUM_ALPHA_BITS;
- break;
- default :
- return -1;
- }
-
- this->gl_data->glGetIntegerv(mesa_attrib, value);
- return 0;
-#else
- return -1;
-#endif
-}
-
-int SDL_AtariGL_MakeCurrent(_THIS)
-{
-#if SDL_VIDEO_OPENGL
- SDL_Surface *surface;
- GLenum type;
-
- if (gl_oldmesa && gl_active) {
- return 0;
- }
-
- if (this->gl_config.dll_handle) {
- if ((this->gl_data->OSMesaMakeCurrent == NULL) ||
- (this->gl_data->OSMesaPixelStore == NULL)) {
- return -1;
- }
- }
-
- if (!gl_active) {
- SDL_SetError("Invalid OpenGL context");
- return -1;
- }
-
- surface = this->screen;
-
- if ((surface->format->BitsPerPixel == 15) || (surface->format->BitsPerPixel == 16)) {
- type = GL_UNSIGNED_SHORT_5_6_5;
- } else {
- type = GL_UNSIGNED_BYTE;
- }
-
- if (!(this->gl_data->OSMesaMakeCurrent(gl_ctx, surface->pixels, type, surface->w, surface->h))) {
- SDL_SetError("Can not make OpenGL context current");
- return -1;
- }
-
- /* OSMesa draws upside down */
- this->gl_data->OSMesaPixelStore(OSMESA_Y_UP, 0);
-
- return 0;
-#else
- return -1;
-#endif
-}
-
-void SDL_AtariGL_SwapBuffers(_THIS)
-{
-#if SDL_VIDEO_OPENGL
- if (gl_active) {
- if (this->gl_config.dll_handle) {
- if (this->gl_data->glFinish) {
- this->gl_data->glFinish();
- } else if (this->gl_data->glFlush) {
- this->gl_data->glFlush();
- }
- } else {
- this->gl_data->glFinish();
- }
- gl_copyshadow(this, this->screen);
- gl_convert(this, this->screen);
- }
-#endif
-}
-
-void SDL_AtariGL_InitPointers(_THIS)
-{
-#if SDL_VIDEO_OPENGL
- this->gl_data->OSMesaCreateContextExt = OSMesaCreateContextExt;
- this->gl_data->OSMesaDestroyContext = OSMesaDestroyContext;
- this->gl_data->OSMesaMakeCurrent = OSMesaMakeCurrent;
- this->gl_data->OSMesaPixelStore = OSMesaPixelStore;
- this->gl_data->OSMesaGetProcAddress = OSMesaGetProcAddress;
-
- this->gl_data->glGetIntegerv = glGetIntegerv;
- this->gl_data->glFinish = glFinish;
- this->gl_data->glFlush = glFlush;
-
- this->gl_data->OSMesaCreateLDG = NULL;
- this->gl_data->OSMesaDestroyLDG = NULL;
-#endif
-}
-
-/*--- Private functions ---*/
-
-static void SDL_AtariGL_UnloadLibrary(_THIS)
-{
-#if SDL_VIDEO_OPENGL
- if (this->gl_config.dll_handle) {
- SDL_UnloadObject(this->gl_config.dll_handle);
- this->gl_config.dll_handle = NULL;
-
- /* Restore pointers to static library */
- SDL_AtariGL_InitPointers(this);
- }
-#endif
-}
-
-/*--- Creation of an OpenGL context using new/old functions ---*/
-
-#if SDL_VIDEO_OPENGL
-static int InitNew(_THIS, SDL_Surface *current)
-{
- GLenum osmesa_format;
- SDL_PixelFormat *pixel_format;
- Uint32 redmask;
- int recreatecontext;
- GLint newaccumsize;
-
- if (this->gl_config.dll_handle) {
- if (this->gl_data->OSMesaCreateContextExt == NULL) {
- return 0;
- }
- }
-
- /* Init OpenGL context using OSMesa */
- gl_convert = ConvertNull;
- gl_copyshadow = CopyShadowNull;
- gl_upsidedown = SDL_FALSE;
-
- pixel_format = current->format;
- redmask = pixel_format->Rmask;
- switch (pixel_format->BitsPerPixel) {
- case 15:
- /* 1555, big and little endian, unsupported */
- gl_pixelsize = 2;
- osmesa_format = OSMESA_RGB_565;
- if (redmask == 31<<10) {
- gl_convert = Convert565To555be;
- } else {
- gl_convert = Convert565To555le;
- }
- break;
- case 16:
- gl_pixelsize = 2;
- if (redmask == 31<<11) {
- osmesa_format = OSMESA_RGB_565;
- } else {
- /* 565, little endian, unsupported */
- osmesa_format = OSMESA_RGB_565;
- gl_convert = Convert565le;
- }
- break;
- case 24:
- gl_pixelsize = 3;
- if (redmask == 255<<16) {
- osmesa_format = OSMESA_RGB;
- } else {
- osmesa_format = OSMESA_BGR;
- }
- break;
- case 32:
- gl_pixelsize = 4;
- if (redmask == 255<<16) {
- osmesa_format = OSMESA_ARGB;
- } else if (redmask == 255<<8) {
- osmesa_format = OSMESA_BGRA;
- } else if (redmask == 255<<24) {
- osmesa_format = OSMESA_RGBA;
- } else {
- /* ABGR format unsupported */
- osmesa_format = OSMESA_BGRA;
- gl_convert = ConvertBGRAToABGR;
- }
- break;
- default:
- gl_pixelsize = 1;
- osmesa_format = OSMESA_COLOR_INDEX;
- break;
- }
-
- /* Try to keep current context if possible */
- newaccumsize =
- this->gl_config.accum_red_size +
- this->gl_config.accum_green_size +
- this->gl_config.accum_blue_size +
- this->gl_config.accum_alpha_size;
- recreatecontext=1;
- if (gl_ctx &&
- (gl_curformat == osmesa_format) &&
- (gl_curdepth == this->gl_config.depth_size) &&
- (gl_curstencil == this->gl_config.stencil_size) &&
- (gl_curaccum == newaccumsize)) {
- recreatecontext = 0;
- }
- if (recreatecontext) {
- SDL_AtariGL_Quit(this, SDL_FALSE);
-
- gl_ctx = this->gl_data->OSMesaCreateContextExt(
- osmesa_format, this->gl_config.depth_size,
- this->gl_config.stencil_size, newaccumsize, NULL );
-
- if (gl_ctx) {
- gl_curformat = osmesa_format;
- gl_curdepth = this->gl_config.depth_size;
- gl_curstencil = this->gl_config.stencil_size;
- gl_curaccum = newaccumsize;
- } else {
- gl_curformat = 0;
- gl_curdepth = 0;
- gl_curstencil = 0;
- gl_curaccum = 0;
- }
- }
-
- return (gl_ctx != NULL);
-}
-
-
-static int InitOld(_THIS, SDL_Surface *current)
-{
- GLenum osmesa_format;
- SDL_PixelFormat *pixel_format;
- Uint32 redmask;
- int recreatecontext, tinygl_present;
-
- if (this->gl_config.dll_handle) {
- if (this->gl_data->OSMesaCreateLDG == NULL) {
- return 0;
- }
- }
-
- /* TinyGL only supports VDI_RGB (OSMESA_RGB) */
- tinygl_present=0;
- if (this->gl_config.dll_handle) {
- if (this->gl_data->glFinish == NULL) {
- tinygl_present=1;
- }
- }
-
- /* Init OpenGL context using OSMesa */
- gl_convert = ConvertNull;
- gl_copyshadow = CopyShadowNull;
- gl_upsidedown = SDL_FALSE;
-
- pixel_format = current->format;
- redmask = pixel_format->Rmask;
- switch (pixel_format->BitsPerPixel) {
- case 15:
- /* 15 bits unsupported */
- if (tinygl_present) {
- gl_pixelsize = 3;
- osmesa_format = VDI_RGB;
- if (redmask == 31<<10) {
- gl_copyshadow = CopyShadowRGBTo555;
- } else {
- gl_copyshadow = CopyShadowRGBTo565;
- gl_convert = Convert565To555le;
- }
- } else {
- gl_pixelsize = 4;
- gl_upsidedown = SDL_TRUE;
- osmesa_format = OSMESA_ARGB;
- if (redmask == 31<<10) {
- gl_copyshadow = CopyShadow8888To555;
- } else {
- gl_copyshadow = CopyShadow8888To565;
- gl_convert = Convert565To555le;
- }
- }
- break;
- case 16:
- /* 16 bits unsupported */
- if (tinygl_present) {
- gl_pixelsize = 3;
- osmesa_format = VDI_RGB;
- gl_copyshadow = CopyShadowRGBTo565;
- if (redmask != 31<<11) {
- /* 565, little endian, unsupported */
- gl_convert = Convert565le;
- }
- } else {
- gl_pixelsize = 4;
- gl_upsidedown = SDL_TRUE;
- osmesa_format = OSMESA_ARGB;
- gl_copyshadow = CopyShadow8888To565;
- if (redmask != 31<<11) {
- /* 565, little endian, unsupported */
- gl_convert = Convert565le;
- }
- }
- break;
- case 24:
- gl_pixelsize = 3;
- if (tinygl_present) {
- osmesa_format = VDI_RGB;
- gl_copyshadow = CopyShadowDirect;
- if (redmask != 255<<16) {
- gl_copyshadow = CopyShadowRGBSwap;
- }
- } else {
- gl_copyshadow = CopyShadowDirect;
- gl_upsidedown = SDL_TRUE;
- if (redmask == 255<<16) {
- osmesa_format = OSMESA_RGB;
- } else {
- osmesa_format = OSMESA_BGR;
- }
- }
- break;
- case 32:
- if (tinygl_present) {
- gl_pixelsize = 3;
- osmesa_format = VDI_RGB;
- gl_copyshadow = CopyShadowRGBToARGB;
- if (redmask == 255) {
- gl_convert = CopyShadowRGBToABGR;
- } else if (redmask == 255<<8) {
- gl_convert = CopyShadowRGBToBGRA;
- } else if (redmask == 255<<24) {
- gl_convert = CopyShadowRGBToRGBA;
- }
- } else {
- gl_pixelsize = 4;
- gl_upsidedown = SDL_TRUE;
- gl_copyshadow = CopyShadowDirect;
- if (redmask == 255<<16) {
- osmesa_format = OSMESA_ARGB;
- } else if (redmask == 255<<8) {
- osmesa_format = OSMESA_BGRA;
- } else if (redmask == 255<<24) {
- osmesa_format = OSMESA_RGBA;
- } else {
- /* ABGR format unsupported */
- osmesa_format = OSMESA_BGRA;
- gl_convert = ConvertBGRAToABGR;
- }
- }
- break;
- default:
- if (tinygl_present) {
- SDL_AtariGL_Quit(this, SDL_FALSE);
- return 0;
- }
- gl_pixelsize = 1;
- gl_copyshadow = CopyShadowDirect;
- osmesa_format = OSMESA_COLOR_INDEX;
- break;
- }
-
- /* Try to keep current context if possible */
- recreatecontext=1;
- if (gl_shadow &&
- (gl_curformat == osmesa_format) &&
- (gl_curwidth == current->w) &&
- (gl_curheight == current->h)) {
- recreatecontext = 0;
- }
- if (recreatecontext) {
- SDL_AtariGL_Quit(this, SDL_FALSE);
-
- gl_shadow = this->gl_data->OSMesaCreateLDG(
- osmesa_format, GL_UNSIGNED_BYTE, current->w, current->h
- );
-
- if (gl_shadow) {
- gl_curformat = osmesa_format;
- gl_curwidth = current->w;
- gl_curheight = current->h;
- } else {
- gl_curformat = 0;
- gl_curwidth = 0;
- gl_curheight = 0;
- }
- }
-
- return (gl_shadow != NULL);
-}
-
-/*--- Conversions routines from shadow buffer to the screen ---*/
-
-static void CopyShadowNull(_THIS, SDL_Surface *surface)
-{
-}
-
-static void CopyShadowDirect(_THIS, SDL_Surface *surface)
-{
- int y, srcpitch, dstpitch;
- Uint8 *srcline, *dstline;
-
- srcline = gl_shadow;
- srcpitch = surface->w * gl_pixelsize;
- dstline = surface->pixels;
- dstpitch = surface->pitch;
- if (gl_upsidedown) {
- srcline += (surface->h-1)*srcpitch;
- srcpitch = -srcpitch;
- }
-
- for (y=0; y<surface->h; y++) {
- SDL_memcpy(dstline, srcline, srcpitch);
-
- srcline += srcpitch;
- dstline += dstpitch;
- }
-}
-
-static void CopyShadowRGBTo555(_THIS, SDL_Surface *surface)
-{
- int x,y, srcpitch, dstpitch;
- Uint16 *dstline, *dstcol;
- Uint8 *srcline, *srccol;
-
- srcline = (Uint8 *)gl_shadow;
- srcpitch = surface->w * gl_pixelsize;
- dstline = surface->pixels;
- dstpitch = surface->pitch >>1;
- if (gl_upsidedown) {
- srcline += (surface->h-1)*srcpitch;
- srcpitch = -srcpitch;
- }
-
- for (y=0; y<surface->h; y++) {
- srccol = srcline;
- dstcol = dstline;
- for (x=0; x<surface->w; x++) {
- Uint16 dstcolor;
-
- dstcolor = ((*srccol++)<<7) & (31<<10);
- dstcolor |= ((*srccol++)<<2) & (31<<5);
- dstcolor |= ((*srccol++)>>3) & 31;
- *dstcol++ = dstcolor;
- }
-
- srcline += srcpitch;
- dstline += dstpitch;
- }
-}
-
-static void CopyShadowRGBTo565(_THIS, SDL_Surface *surface)
-{
- int x,y, srcpitch, dstpitch;
- Uint16 *dstline, *dstcol;
- Uint8 *srcline, *srccol;
-
- srcline = (Uint8 *)gl_shadow;
- srcpitch = surface->w * gl_pixelsize;
- dstline = surface->pixels;
- dstpitch = surface->pitch >>1;
- if (gl_upsidedown) {
- srcline += (surface->h-1)*srcpitch;
- srcpitch = -srcpitch;
- }
-
- for (y=0; y<surface->h; y++) {
- srccol = srcline;
- dstcol = dstline;
-
- for (x=0; x<surface->w; x++) {
- Uint16 dstcolor;
-
- dstcolor = ((*srccol++)<<8) & (31<<11);
- dstcolor |= ((*srccol++)<<3) & (63<<5);
- dstcolor |= ((*srccol++)>>3) & 31;
- *dstcol++ = dstcolor;
- }
-
- srcline += srcpitch;
- dstline += dstpitch;
- }
-}
-
-static void CopyShadowRGBSwap(_THIS, SDL_Surface *surface)
-{
- int x,y, srcpitch, dstpitch;
- Uint8 *dstline, *dstcol;
- Uint8 *srcline, *srccol;
-
- srcline = (Uint8 *)gl_shadow;
- srcpitch = surface->w * gl_pixelsize;
- dstline = surface->pixels;
- dstpitch = surface->pitch;
- if (gl_upsidedown) {
- srcline += (surface->h-1)*srcpitch;
- srcpitch = -srcpitch;
- }
-
- for (y=0; y<surface->h; y++) {
- srccol = srcline;
- dstcol = dstline;
-
- for (x=0; x<surface->w; x++) {
- *dstcol++ = srccol[2];
- *dstcol++ = srccol[1];
- *dstcol++ = srccol[0];
- srccol += 3;
- }
-
- srcline += srcpitch;
- dstline += dstpitch;
- }
-}
-
-static void CopyShadowRGBToARGB(_THIS, SDL_Surface *surface)
-{
- int x,y, srcpitch, dstpitch;
- Uint32 *dstline, *dstcol;
- Uint8 *srcline, *srccol;
-
- srcline = (Uint8 *)gl_shadow;
- srcpitch = surface->w * gl_pixelsize;
- dstline = surface->pixels;
- dstpitch = surface->pitch >>2;
- if (gl_upsidedown) {
- srcline += (surface->h-1)*srcpitch;
- srcpitch = -srcpitch;
- }
-
- for (y=0; y<surface->h; y++) {
- srccol = srcline;
- dstcol = dstline;
-
- for (x=0; x<surface->w; x++) {
- Uint32 dstcolor;
-
- dstcolor = (*srccol++)<<16;
- dstcolor |= (*srccol++)<<8;
- dstcolor |= *srccol++;
-
- *dstcol++ = dstcolor;
- }
-
- srcline += srcpitch;
- dstline += dstpitch;
- }
-}
-
-static void CopyShadowRGBToABGR(_THIS, SDL_Surface *surface)
-{
- int x,y, srcpitch, dstpitch;
- Uint32 *dstline, *dstcol;
- Uint8 *srcline, *srccol;
-
- srcline = (Uint8 *)gl_shadow;
- srcpitch = surface->w * gl_pixelsize;
- dstline = surface->pixels;
- dstpitch = surface->pitch >>2;
- if (gl_upsidedown) {
- srcline += (surface->h-1)*srcpitch;
- srcpitch = -srcpitch;
- }
-
- for (y=0; y<surface->h; y++) {
- srccol = srcline;
- dstcol = dstline;
-
- for (x=0; x<surface->w; x++) {
- Uint32 dstcolor;
-
- dstcolor = *srccol++;
- dstcolor |= (*srccol++)<<8;
- dstcolor |= (*srccol++)<<16;
-
- *dstcol++ = dstcolor;
- }
-
- srcline += srcpitch;
- dstline += dstpitch;
- }
-}
-
-static void CopyShadowRGBToBGRA(_THIS, SDL_Surface *surface)
-{
- int x,y, srcpitch, dstpitch;
- Uint32 *dstline, *dstcol;
- Uint8 *srcline, *srccol;
-
- srcline = (Uint8 *)gl_shadow;
- srcpitch = surface->w * gl_pixelsize;
- dstline = surface->pixels;
- dstpitch = surface->pitch >>2;
- if (gl_upsidedown) {
- srcline += (surface->h-1)*srcpitch;
- srcpitch = -srcpitch;
- }
-
- for (y=0; y<surface->h; y++) {
- srccol = srcline;
- dstcol = dstline;
-
- for (x=0; x<surface->w; x++) {
- Uint32 dstcolor;
-
- dstcolor = (*srccol++)<<8;
- dstcolor |= (*srccol++)<<16;
- dstcolor |= (*srccol++)<<24;
-
- *dstcol++ = dstcolor;
- }
-
- srcline += srcpitch;
- dstline += dstpitch;
- }
-}
-
-static void CopyShadowRGBToRGBA(_THIS, SDL_Surface *surface)
-{
- int x,y, srcpitch, dstpitch;
- Uint32 *dstline, *dstcol;
- Uint8 *srcline, *srccol;
-
- srcline = (Uint8 *)gl_shadow;
- srcpitch = surface->w * gl_pixelsize;
- dstline = surface->pixels;
- dstpitch = surface->pitch >>2;
- if (gl_upsidedown) {
- srcline += (surface->h-1)*srcpitch;
- srcpitch = -srcpitch;
- }
-
- for (y=0; y<surface->h; y++) {
- srccol = srcline;
- dstcol = dstline;
-
- for (x=0; x<surface->w; x++) {
- Uint32 dstcolor;
-
- dstcolor = (*srccol++)<<24;
- dstcolor |= (*srccol++)<<16;
- dstcolor |= (*srccol++)<<8;
-
- *dstcol++ = dstcolor;
- }
-
- srcline += srcpitch;
- dstline += dstpitch;
- }
-}
-
-static void CopyShadow8888To555(_THIS, SDL_Surface *surface)
-{
- int x,y, srcpitch, dstpitch;
- Uint16 *dstline, *dstcol;
- Uint32 *srcline, *srccol;
-
- srcline = (Uint32 *)gl_shadow;
- srcpitch = (surface->w * gl_pixelsize) >>2;
- dstline = surface->pixels;
- dstpitch = surface->pitch >>1;
- if (gl_upsidedown) {
- srcline += (surface->h-1)*srcpitch;
- srcpitch = -srcpitch;
- }
-
- for (y=0; y<surface->h; y++) {
- srccol = srcline;
- dstcol = dstline;
- for (x=0; x<surface->w; x++) {
- Uint32 srccolor;
- Uint16 dstcolor;
-
- srccolor = *srccol++;
- dstcolor = (srccolor>>9) & (31<<10);
- dstcolor |= (srccolor>>6) & (31<<5);
- dstcolor |= (srccolor>>3) & 31;
- *dstcol++ = dstcolor;
- }
-
- srcline += srcpitch;
- dstline += dstpitch;
- }
-}
-
-static void CopyShadow8888To565(_THIS, SDL_Surface *surface)
-{
- int x,y, srcpitch, dstpitch;
- Uint16 *dstline, *dstcol;
- Uint32 *srcline, *srccol;
-
- srcline = (Uint32 *)gl_shadow;
- srcpitch = (surface->w * gl_pixelsize) >> 2;
- dstline = surface->pixels;
- dstpitch = surface->pitch >>1;
- if (gl_upsidedown) {
- srcline += (surface->h-1)*srcpitch;
- srcpitch = -srcpitch;
- }
-
- for (y=0; y<surface->h; y++) {
- srccol = srcline;
- dstcol = dstline;
-
- for (x=0; x<surface->w; x++) {
- Uint32 srccolor;
- Uint16 dstcolor;
-
- srccolor = *srccol++;
- dstcolor = (srccolor>>8) & (31<<11);
- dstcolor |= (srccolor>>5) & (63<<5);
- dstcolor |= (srccolor>>3) & 31;
- *dstcol++ = dstcolor;
- }
-
- srcline += srcpitch;
- dstline += dstpitch;
- }
-}
-
-/*--- Conversions routines in the screen ---*/
-
-static void ConvertNull(_THIS, SDL_Surface *surface)
-{
-}
-
-static void Convert565To555be(_THIS, SDL_Surface *surface)
-{
- int x,y, pitch;
- unsigned short *line, *pixel;
-
- line = surface->pixels;
- pitch = surface->pitch >> 1;
- for (y=0; y<surface->h; y++) {
- pixel = line;
- for (x=0; x<surface->w; x++) {
- unsigned short color = *pixel;
-
- *pixel++ = (color & 0x1f)|((color>>1) & 0xffe0);
- }
-
- line += pitch;
- }
-}
-
-static void Convert565To555le(_THIS, SDL_Surface *surface)
-{
- int x,y, pitch;
- unsigned short *line, *pixel;
-
- line = surface->pixels;
- pitch = surface->pitch >>1;
- for (y=0; y<surface->h; y++) {
- pixel = line;
- for (x=0; x<surface->w; x++) {
- unsigned short color = *pixel;
-
- color = (color & 0x1f)|((color>>1) & 0xffe0);
- *pixel++ = SDL_Swap16(color);
- }
-
- line += pitch;
- }
-}
-
-static void Convert565le(_THIS, SDL_Surface *surface)
-{
- int x,y, pitch;
- unsigned short *line, *pixel;
-
- line = surface->pixels;
- pitch = surface->pitch >>1;
- for (y=0; y<surface->h; y++) {
- pixel = line;
- for (x=0; x<surface->w; x++) {
- unsigned short color = *pixel;
-
- *pixel++ = SDL_Swap16(color);
- }
-
- line += pitch;
- }
-}
-
-static void ConvertBGRAToABGR(_THIS, SDL_Surface *surface)
-{
- int x,y, pitch;
- unsigned long *line, *pixel;
-
- line = surface->pixels;
- pitch = surface->pitch >>2;
- for (y=0; y<surface->h; y++) {
- pixel = line;
- for (x=0; x<surface->w; x++) {
- unsigned long color = *pixel;
-
- *pixel++ = (color<<24)|(color>>8);
- }
-
- line += pitch;
- }
-}
-
-#endif /* SDL_VIDEO_OPENGL */
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarigl_c.h b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarigl_c.h
deleted file mode 100644
index 4626d44..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarigl_c.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Atari OSMesa.ldg implementation of SDL OpenGL support */
-
-#ifndef _SDL_ATARIGL_H_
-#define _SDL_ATARIGL_H_
-
-#if SDL_VIDEO_OPENGL
-#include <GL/osmesa.h>
-#endif
-
-#include "../SDL_sysvideo.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-struct SDL_PrivateGLData {
-
- int gl_active; /* to stop switching drivers while we have a valid context */
-
- int gl_oldmesa; /* Old OpenGL support ? */
-
- int gl_pixelsize; /* for CopyShadow functions */
-
- SDL_bool gl_upsidedown; /* Some implementations draw upside down */
-
- Uint8 *gl_shadow; /* Shadow buffer for old implementations */
-
- /* for unsupported OSMesa buffer formats */
- void (*ConvertSurface)(_THIS, SDL_Surface *surface);
-
- /* to convert the shadow buffer to the screen format */
- void (*CopyShadow)(_THIS, SDL_Surface *surface);
-
-#if SDL_VIDEO_OPENGL
- OSMesaContext ctx;
-
- /* OpenGL functions */
- void (*glGetIntegerv)( GLenum pname, GLint *value );
- void (*glFinish)(void);
- void (*glFlush)(void);
-
- /* osmesa.ldg */
- OSMesaContext (*OSMesaCreateContextExt)( GLenum format, GLint depthBits, GLint stencilBits, GLint accumBits, OSMesaContext sharelist);
- void (*OSMesaDestroyContext)( OSMesaContext ctx );
- GLboolean (*OSMesaMakeCurrent)( OSMesaContext ctx, void *buffer, GLenum type, GLsizei width, GLsizei height );
- void (*OSMesaPixelStore)( GLint pname, GLint value );
- void * (*OSMesaGetProcAddress)( const char *funcName );
-
- /* mesa_gl.ldg, tiny_gl.ldg */
- void *(*OSMesaCreateLDG)( long format, long type, long width, long height );
- void (*OSMesaDestroyLDG)(void);
-
- /* Info needed to compare existing context with new asked one */
- int width, height;
- GLenum format;
- GLint depth,stencil,accum;
-#endif
-};
-
-/* Variable names */
-#define gl_active (this->gl_data->gl_active)
-#define gl_ctx (this->gl_data->ctx)
-#define gl_oldmesa (this->gl_data->gl_oldmesa)
-#define gl_pixelsize (this->gl_data->gl_pixelsize)
-#define gl_upsidedown (this->gl_data->gl_upsidedown)
-#define gl_shadow (this->gl_data->gl_shadow)
-#define gl_convert (this->gl_data->ConvertSurface)
-#define gl_copyshadow (this->gl_data->CopyShadow)
-#define gl_curformat (this->gl_data->format)
-#define gl_curdepth (this->gl_data->depth)
-#define gl_curstencil (this->gl_data->stencil)
-#define gl_curaccum (this->gl_data->accum)
-#define gl_curwidth (this->gl_data->width)
-#define gl_curheight (this->gl_data->height)
-
-/* OpenGL functions */
-extern int SDL_AtariGL_Init(_THIS, SDL_Surface *current);
-extern void SDL_AtariGL_Quit(_THIS, SDL_bool unload);
-extern void SDL_AtariGL_InitPointers(_THIS);
-
-extern int SDL_AtariGL_LoadLibrary(_THIS, const char *path);
-extern void *SDL_AtariGL_GetProcAddress(_THIS, const char *proc);
-extern int SDL_AtariGL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
-extern int SDL_AtariGL_MakeCurrent(_THIS);
-extern void SDL_AtariGL_SwapBuffers(_THIS);
-
-#endif /* _SDL_ATARIGL_H_ */
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarikeys.h b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarikeys.h
deleted file mode 100644
index f5eee5a..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarikeys.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/*
- * Atari Scancode definitions
- *
- * Patrice Mandin
- */
-
-#ifndef _SDL_ATARIKEYS_H_
-#define _SDL_ATARIKEYS_H_
-
-/* --- Keyboard scancodes --- */
-/* taken from svgalib/vgakeyboard.h */
-
-#define SCANCODE_ESCAPE 0x01
-#define SCANCODE_1 0x02
-#define SCANCODE_2 0x03
-#define SCANCODE_3 0x04
-#define SCANCODE_4 0x05
-#define SCANCODE_5 0x06
-#define SCANCODE_6 0x07
-#define SCANCODE_7 0x08
-#define SCANCODE_8 0x09
-#define SCANCODE_9 0x0a
-#define SCANCODE_0 0x0b
-#define SCANCODE_MINUS 0x0c
-#define SCANCODE_EQUAL 0x0d
-#define SCANCODE_BACKSPACE 0x0e
-
-#define SCANCODE_TAB 0x0f
-#define SCANCODE_Q 0x10
-#define SCANCODE_W 0x11
-#define SCANCODE_E 0x12
-#define SCANCODE_R 0x13
-#define SCANCODE_T 0x14
-#define SCANCODE_Y 0x15
-#define SCANCODE_U 0x16
-#define SCANCODE_I 0x17
-#define SCANCODE_O 0x18
-#define SCANCODE_P 0x19
-#define SCANCODE_BRACKET_LEFT 0x1a
-#define SCANCODE_BRACKET_RIGHT 0x1b
-#define SCANCODE_ENTER 0x1c
-#define SCANCODE_DELETE 0x53
-
-#define SCANCODE_LEFTCONTROL 0x1d
-#define SCANCODE_A 0x1e
-#define SCANCODE_S 0x1f
-#define SCANCODE_D 0x20
-#define SCANCODE_F 0x21
-#define SCANCODE_G 0x22
-#define SCANCODE_H 0x23
-#define SCANCODE_J 0x24
-#define SCANCODE_K 0x25
-#define SCANCODE_L 0x26
-#define SCANCODE_SEMICOLON 0x27
-#define SCANCODE_APOSTROPHE 0x28
-#define SCANCODE_GRAVE 0x29
-
-#define SCANCODE_LEFTSHIFT 0x2a
-#define SCANCODE_BACKSLASH 0x2b
-#define SCANCODE_Z 0x2c
-#define SCANCODE_X 0x2d
-#define SCANCODE_C 0x2e
-#define SCANCODE_V 0x2f
-#define SCANCODE_B 0x30
-#define SCANCODE_N 0x31
-#define SCANCODE_M 0x32
-#define SCANCODE_COMMA 0x33
-#define SCANCODE_PERIOD 0x34
-#define SCANCODE_SLASH 0x35
-#define SCANCODE_RIGHTSHIFT 0x36
-
-#define SCANCODE_LEFTALT 0x38
-#define SCANCODE_SPACE 0x39
-#define SCANCODE_CAPSLOCK 0x3a
-
-/* Functions keys */
-#define SCANCODE_F1 0x3b
-#define SCANCODE_F2 0x3c
-#define SCANCODE_F3 0x3d
-#define SCANCODE_F4 0x3e
-#define SCANCODE_F5 0x3f
-#define SCANCODE_F6 0x40
-#define SCANCODE_F7 0x41
-#define SCANCODE_F8 0x42
-#define SCANCODE_F9 0x43
-#define SCANCODE_F10 0x44
-
-/* Numeric keypad */
-#define SCANCODE_KP0 0x70
-#define SCANCODE_KP1 0x6d
-#define SCANCODE_KP2 0x6e
-#define SCANCODE_KP3 0x6f
-#define SCANCODE_KP4 0x6a
-#define SCANCODE_KP5 0x6b
-#define SCANCODE_KP6 0x6c
-#define SCANCODE_KP7 0x67
-#define SCANCODE_KP8 0x68
-#define SCANCODE_KP9 0x69
-#define SCANCODE_KP_PERIOD 0x71
-#define SCANCODE_KP_DIVIDE 0x65
-#define SCANCODE_KP_MULTIPLY 0x66
-#define SCANCODE_KP_MINUS 0x4a
-#define SCANCODE_KP_PLUS 0x4e
-#define SCANCODE_KP_ENTER 0x72
-#define SCANCODE_KP_LEFTPAREN 0x63
-#define SCANCODE_KP_RIGHTPAREN 0x64
-
-/* Cursor keypad */
-#define SCANCODE_HELP 0x62
-#define SCANCODE_UNDO 0x61
-#define SCANCODE_INSERT 0x52
-#define SCANCODE_CLRHOME 0x47
-#define SCANCODE_UP 0x48
-#define SCANCODE_DOWN 0x50
-#define SCANCODE_RIGHT 0x4d
-#define SCANCODE_LEFT 0x4b
-
-#endif /* _SDL_ATARIKEYS_H_ */
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarimxalloc.c b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarimxalloc.c
deleted file mode 100644
index 0e6b5ae..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarimxalloc.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * Memory allocation
- *
- * Patrice Mandin
- */
-
-#include <mint/osbind.h>
-
-#include "SDL_stdinc.h"
-
-/*--- Variables ---*/
-
-static int atari_mxalloc_avail=-1;
-
-/*--- Functions ---*/
-
-void *Atari_SysMalloc(Uint32 size, Uint16 alloc_type)
-{
- /* Test if Mxalloc() available */
- if (atari_mxalloc_avail<0) {
- atari_mxalloc_avail = ((Sversion()&0xFF)>=0x01) | (Sversion()>=0x1900);
- }
-
- if (atari_mxalloc_avail) {
- return (void *) Mxalloc(size, alloc_type);
- } else { \
- return (void *) Malloc(size);
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarimxalloc_c.h b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarimxalloc_c.h
deleted file mode 100644
index 32e6e1a..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_atarimxalloc_c.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * Memory allocation
- *
- * Patrice Mandin
- */
-
-#ifndef _SDL_ATARI_MXALLOC_H_
-#define _SDL_ATARI_MXALLOC_H_
-
-/*--- Defines ---*/
-
-/* Mxalloc parameters */
-#define MX_STRAM 0
-#define MX_TTRAM 1
-#define MX_PREFSTRAM 2
-#define MX_PREFTTRAM 3
-
-/*--- Functions ---*/
-
-extern void *Atari_SysMalloc(Uint32 size, Uint16 alloc_type);
-
-#endif /* _SDL_ATARI_MXALLOC_H_ */
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_biosevents.c b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_biosevents.c
deleted file mode 100644
index 6fdf1e1..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_biosevents.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * Atari keyboard events manager, using BIOS
- *
- * Patrice Mandin
- */
-
-/* Mint includes */
-#include <mint/osbind.h>
-#include <mint/cookie.h>
-
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_atarikeys.h"
-#include "SDL_atarievents_c.h"
-#include "SDL_xbiosevents_c.h"
-#include "SDL_ataridevmouse_c.h"
-
-static unsigned char bios_currentkeyboard[ATARIBIOS_MAXKEYS];
-static unsigned char bios_previouskeyboard[ATARIBIOS_MAXKEYS];
-static SDL_bool use_dev_mouse = SDL_FALSE;
-
-static void UpdateSpecialKeys(int special_keys_state);
-
-void AtariBios_InitOSKeymap(_THIS)
-{
- int i, vectors_mask;
- unsigned long dummy;
-
- SDL_memset(bios_currentkeyboard, 0, sizeof(bios_currentkeyboard));
- SDL_memset(bios_previouskeyboard, 0, sizeof(bios_previouskeyboard));
-
- use_dev_mouse = (SDL_AtariDevMouse_Open()!=0) ? SDL_TRUE : SDL_FALSE;
-
- vectors_mask = ATARI_XBIOS_JOYSTICKEVENTS; /* XBIOS joystick events */
- if (!use_dev_mouse) {
- vectors_mask |= ATARI_XBIOS_MOUSEEVENTS; /* XBIOS mouse events */
- }
-/* if (Getcookie(C_MiNT, &dummy)==C_FOUND) {
- vectors_mask = 0;
- }*/
-
- SDL_AtariXbios_InstallVectors(vectors_mask);
-}
-
-void AtariBios_PumpEvents(_THIS)
-{
- int i;
- SDL_keysym keysym;
-
- /* Update pressed keys */
- SDL_memset(bios_currentkeyboard, 0, ATARIBIOS_MAXKEYS);
-
- while (Bconstat(_CON)) {
- unsigned long key_pressed;
- key_pressed=Bconin(_CON);
- bios_currentkeyboard[(key_pressed>>16)&(ATARIBIOS_MAXKEYS-1)]=0xFF;
- }
-
- /* Read special keys */
- UpdateSpecialKeys(Kbshift(-1));
-
- /* Now generate events */
- for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
- /* Key pressed ? */
- if (bios_currentkeyboard[i] && !bios_previouskeyboard[i])
- SDL_PrivateKeyboard(SDL_PRESSED,
- SDL_Atari_TranslateKey(i, &keysym, SDL_TRUE));
-
- /* Key unpressed ? */
- if (bios_previouskeyboard[i] && !bios_currentkeyboard[i])
- SDL_PrivateKeyboard(SDL_RELEASED,
- SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE));
- }
-
- if (use_dev_mouse) {
- SDL_AtariDevMouse_PostMouseEvents(this, SDL_TRUE);
- } else {
- SDL_AtariXbios_PostMouseEvents(this, SDL_TRUE);
- }
-
- /* Will be previous table */
- SDL_memcpy(bios_previouskeyboard, bios_currentkeyboard, sizeof(bios_previouskeyboard));
-}
-
-static void UpdateSpecialKeys(int special_keys_state)
-{
-#define UPDATE_SPECIAL_KEYS(numbit,scancode) \
- { \
- if (special_keys_state & (1<<(numbit))) { \
- bios_currentkeyboard[scancode]=0xFF; \
- } \
- }
-
- UPDATE_SPECIAL_KEYS(K_RSHIFT, SCANCODE_RIGHTSHIFT);
- UPDATE_SPECIAL_KEYS(K_LSHIFT, SCANCODE_LEFTSHIFT);
- UPDATE_SPECIAL_KEYS(K_CTRL, SCANCODE_LEFTCONTROL);
- UPDATE_SPECIAL_KEYS(K_ALT, SCANCODE_LEFTALT);
- UPDATE_SPECIAL_KEYS(K_CAPSLOCK, SCANCODE_CAPSLOCK);
-}
-
-void AtariBios_ShutdownEvents(void)
-{
- SDL_AtariXbios_RestoreVectors();
- if (use_dev_mouse) {
- SDL_AtariDevMouse_Close();
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_biosevents_c.h b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_biosevents_c.h
deleted file mode 100644
index e17ecf0..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_biosevents_c.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * Atari keyboard events manager, using BIOS
- *
- * Patrice Mandin
- */
-
-#ifndef _SDL_ATARI_BIOSEVENTS_H_
-#define _SDL_ATARI_BIOSEVENTS_H_
-
-#include "../SDL_sysvideo.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-extern void AtariBios_InitOSKeymap(_THIS);
-extern void AtariBios_PumpEvents(_THIS);
-extern void AtariBios_ShutdownEvents(void);
-
-#endif /* _SDL_ATARI_BIOSEVENTS_H_ */
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_gemdosevents.c b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_gemdosevents.c
deleted file mode 100644
index 598dff7..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_gemdosevents.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * Atari keyboard events manager, using Gemdos
- *
- * Patrice Mandin
- */
-
-/* Mint includes */
-#include <mint/osbind.h>
-#include <mint/cookie.h>
-
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_atarikeys.h"
-#include "SDL_atarievents_c.h"
-#include "SDL_xbiosevents_c.h"
-#include "SDL_ataridevmouse_c.h"
-
-/* To save state of keyboard */
-
-static unsigned char gemdos_currentkeyboard[ATARIBIOS_MAXKEYS];
-static unsigned char gemdos_previouskeyboard[ATARIBIOS_MAXKEYS];
-static SDL_bool use_dev_mouse = SDL_FALSE;
-
-enum {
- DEV_BUSY=0,
- DEV_READY
-};
-
-static void UpdateSpecialKeys(int special_keys_state);
-
-void AtariGemdos_InitOSKeymap(_THIS)
-{
- int i, vectors_mask;
- unsigned long dummy;
-
- SDL_memset(gemdos_currentkeyboard, 0, sizeof(gemdos_currentkeyboard));
- SDL_memset(gemdos_previouskeyboard, 0, sizeof(gemdos_previouskeyboard));
-
- use_dev_mouse = (SDL_AtariDevMouse_Open()!=0) ? SDL_TRUE : SDL_FALSE;
-
- vectors_mask = ATARI_XBIOS_JOYSTICKEVENTS; /* XBIOS joystick events */
- if (!use_dev_mouse) {
- vectors_mask |= ATARI_XBIOS_MOUSEEVENTS; /* XBIOS mouse events */
- }
-/* if (Getcookie(C_MiNT, &dummy)==C_FOUND) {
- vectors_mask = 0;
- }*/
- SDL_AtariXbios_InstallVectors(vectors_mask);
-}
-
-void AtariGemdos_PumpEvents(_THIS)
-{
- int i;
- SDL_keysym keysym;
-
- /* Update pressed keys */
- SDL_memset(gemdos_currentkeyboard, 0, ATARIBIOS_MAXKEYS);
-
- while (Cconis()!=DEV_BUSY) {
- unsigned long key_pressed;
- key_pressed=Cnecin();
- gemdos_currentkeyboard[(key_pressed>>16)&(ATARIBIOS_MAXKEYS-1)]=0xFF;
- }
-
- /* Read special keys */
- UpdateSpecialKeys(Kbshift(-1));
-
- /* Now generate events */
- for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
- /* Key pressed ? */
- if (gemdos_currentkeyboard[i] && !gemdos_previouskeyboard[i])
- SDL_PrivateKeyboard(SDL_PRESSED,
- SDL_Atari_TranslateKey(i, &keysym, SDL_TRUE));
-
- /* Key unpressed ? */
- if (gemdos_previouskeyboard[i] && !gemdos_currentkeyboard[i])
- SDL_PrivateKeyboard(SDL_RELEASED,
- SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE));
- }
-
- if (use_dev_mouse) {
- SDL_AtariDevMouse_PostMouseEvents(this, SDL_TRUE);
- } else {
- SDL_AtariXbios_PostMouseEvents(this, SDL_TRUE);
- }
-
- /* Will be previous table */
- SDL_memcpy(gemdos_previouskeyboard, gemdos_currentkeyboard, sizeof(gemdos_previouskeyboard));
-}
-
-static void UpdateSpecialKeys(int special_keys_state)
-{
-#define UPDATE_SPECIAL_KEYS(numbit,scancode) \
- { \
- if (special_keys_state & (1<<(numbit))) { \
- gemdos_currentkeyboard[scancode]=0xFF; \
- } \
- }
-
- UPDATE_SPECIAL_KEYS(K_RSHIFT, SCANCODE_RIGHTSHIFT);
- UPDATE_SPECIAL_KEYS(K_LSHIFT, SCANCODE_LEFTSHIFT);
- UPDATE_SPECIAL_KEYS(K_CTRL, SCANCODE_LEFTCONTROL);
- UPDATE_SPECIAL_KEYS(K_ALT, SCANCODE_LEFTALT);
- UPDATE_SPECIAL_KEYS(K_CAPSLOCK, SCANCODE_CAPSLOCK);
-}
-
-void AtariGemdos_ShutdownEvents(void)
-{
- SDL_AtariXbios_RestoreVectors();
- if (use_dev_mouse) {
- SDL_AtariDevMouse_Close();
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_gemdosevents_c.h b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_gemdosevents_c.h
deleted file mode 100644
index 815d9d6..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_gemdosevents_c.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * Atari keyboard events manager, using Gemdos
- *
- * Patrice Mandin
- */
-
-#ifndef _SDL_ATARI_GEMDOSEVENTS_H_
-#define _SDL_ATARI_GEMDOSEVENTS_H_
-
-#include "../SDL_sysvideo.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-extern void AtariGemdos_InitOSKeymap(_THIS);
-extern void AtariGemdos_PumpEvents(_THIS);
-extern void AtariGemdos_ShutdownEvents(void);
-
-#endif /* _SDL_ATARI_GEMDOSEVENTS_H_ */
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ikbdevents.c b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ikbdevents.c
deleted file mode 100644
index d3a7660..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ikbdevents.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * Atari keyboard events manager, using hardware IKBD
- *
- * Patrice Mandin
- */
-
-/* Mint includes */
-#include <mint/osbind.h>
-
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_atarikeys.h"
-#include "SDL_atarievents_c.h"
-#include "SDL_ikbdinterrupt_s.h"
-
-#define KEY_PRESSED 0xff
-#define KEY_UNDEFINED 0x80
-#define KEY_RELEASED 0x00
-
-static Uint16 atari_prevmouseb; /* save state of mouse buttons */
-
-void AtariIkbd_InitOSKeymap(_THIS)
-{
- int i;
-
- SDL_memset(SDL_AtariIkbd_keyboard, KEY_UNDEFINED, sizeof(SDL_AtariIkbd_keyboard));
-
- /* Now install our handler */
- SDL_AtariIkbd_mouseb = SDL_AtariIkbd_mousex = SDL_AtariIkbd_mousey = 0;
- atari_prevmouseb = 0;
-
- Supexec(SDL_AtariIkbdInstall);
-}
-
-static int atari_GetButton(int button)
-{
- switch(button)
- {
- case 0:
- return SDL_BUTTON_RIGHT;
- break;
- case 1:
- default:
- return SDL_BUTTON_LEFT;
- break;
- }
-}
-
-void AtariIkbd_PumpEvents(_THIS)
-{
- int i, specialkeys;
- SDL_keysym keysym;
-
- /*--- Send keyboard events ---*/
-
- for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
- /* Key pressed ? */
- if (SDL_AtariIkbd_keyboard[i]==KEY_PRESSED) {
- SDL_PrivateKeyboard(SDL_PRESSED,
- SDL_Atari_TranslateKey(i, &keysym, SDL_TRUE));
- SDL_AtariIkbd_keyboard[i]=KEY_UNDEFINED;
- }
-
- /* Key released ? */
- if (SDL_AtariIkbd_keyboard[i]==KEY_RELEASED) {
- SDL_PrivateKeyboard(SDL_RELEASED,
- SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE));
- SDL_AtariIkbd_keyboard[i]=KEY_UNDEFINED;
- }
- }
-
- /*--- Send mouse events ---*/
-
- /* Mouse motion ? */
- if (SDL_AtariIkbd_mousex || SDL_AtariIkbd_mousey) {
- SDL_PrivateMouseMotion(0, 1, SDL_AtariIkbd_mousex, SDL_AtariIkbd_mousey);
- SDL_AtariIkbd_mousex = SDL_AtariIkbd_mousey = 0;
- }
-
- /* Mouse button ? */
- if (SDL_AtariIkbd_mouseb != atari_prevmouseb) {
- for (i=0;i<2;i++) {
- int curbutton, prevbutton;
-
- curbutton = SDL_AtariIkbd_mouseb & (1<<i);
- prevbutton = atari_prevmouseb & (1<<i);
-
- if (curbutton && !prevbutton) {
- SDL_PrivateMouseButton(SDL_PRESSED, atari_GetButton(i), 0, 0);
- }
- if (!curbutton && prevbutton) {
- SDL_PrivateMouseButton(SDL_RELEASED, atari_GetButton(i), 0, 0);
- }
- }
- atari_prevmouseb = SDL_AtariIkbd_mouseb;
- }
-}
-
-void AtariIkbd_ShutdownEvents(void)
-{
- Supexec(SDL_AtariIkbdUninstall);
-}
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ikbdevents_c.h b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ikbdevents_c.h
deleted file mode 100644
index 48310df..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ikbdevents_c.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * Atari keyboard events manager, using hardware IKBD
- *
- * Patrice Mandin
- */
-
-#ifndef _SDL_ATARI_IKBDEVENTS_H_
-#define _SDL_ATARI_IKBDEVENTS_H_
-
-#include "../SDL_sysvideo.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-extern void AtariIkbd_InitOSKeymap(_THIS);
-extern void AtariIkbd_PumpEvents(_THIS);
-extern void AtariIkbd_ShutdownEvents(void);
-
-#endif /* _SDL_ATARI_IKBDEVENTS_H_ */
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ikbdinterrupt.S b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ikbdinterrupt.S
deleted file mode 100644
index 9cbf593..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ikbdinterrupt.S
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/*
- * IKBD 6301 interrupt routine
- *
- * Patrice Mandin
- */
-
- .text
-
- .globl _SDL_AtariIkbdInstall
- .globl _SDL_AtariIkbdUninstall
-
- .globl _SDL_AtariIkbd_keyboard
- .globl _SDL_AtariIkbd_mouseb
- .globl _SDL_AtariIkbd_mousex
- .globl _SDL_AtariIkbd_mousey
- .globl _SDL_AtariIkbd_joystick
-
- .globl _SDL_AtariIkbd_enabled
-
-/*--- Install our IKBD vector ---*/
-
-_SDL_AtariIkbdInstall:
- moveml d0-d1/a0-a1,sp@-
-
- | Disable interrupts
-
- movew #0x2700,sr
-
- | Save MFP registers used for keyboard
-
- lea 0xfffffa00:w,a0
- btst #6,a0@(0x09)
- sne ikbd_ierb
- btst #6,a0@(0x15)
- sne ikbd_imrb
-
- | Set our routine
-
- movel 0x118:w,old_ikbd
- movel #ikbd,0x118:w
- bset #6,0xfffffa09:w | IERB
- bset #6,0xfffffa15:w | IMRB
-
- | Set mouse relative mode
-
- moveb #8,0xfffffc02:w
-
- | Reenable interrupts
-
- movew #0x2300,sr
-
- | Interrupts done
-
- movew #0xffff,_SDL_AtariIkbd_enabled
-
- moveml sp@+,d0-d1/a0-a1
- rts
-
-/*--- Uninstall our IKBD vector ---*/
-
-_SDL_AtariIkbdUninstall:
- movel a0,sp@-
-
- | Disable interrupts
-
- movew #0x2700,sr
-
- | Restore previous MFP registers
-
- lea 0xfffffa00:w,a0
-
- bclr #6,a0@(0x09)
- tstb ikbd_ierb
- beqs ikbd_restoreierb
- bset #6,a0@(0x09)
-ikbd_restoreierb:
-
- bclr #6,a0@(0x15)
- tstb ikbd_imrb
- beqs ikbd_restoreimrb
- bset #6,a0@(0x15)
-ikbd_restoreimrb:
-
- movel old_ikbd,0x118:w
-
- | Clear keyboard buffer
-
- lea 0xfffffc00:w,a0
-ikbd_videbuffer:
- btst #0,a0@
- beqs ikbd_finbuffer
- tstb a0@(0x02)
- bras ikbd_videbuffer
-ikbd_finbuffer:
-
- | Reenable interrupts
-
- movew #0x2300,sr
-
- movel sp@+,a0
- rts
-
- .bss
-
- .even
- .comm ikbd_ierb,1
- .comm ikbd_imrb,1
-
-/*--- Our custom IKBD vector ---*/
-
- .text
- .even
- .ascii "XBRA"
- .ascii "LSDL"
- .comm old_ikbd,4*1
-ikbd:
- | Check if source is IKBD or MIDI
- btst #0,0xfffffc00.w
- beqs ikbd_oldmidi
-
- moveml d0-d1/a0,sp@-
- moveb 0xfffffc02:w,d0
-
- | Joystick packet ?
-
- cmpb #0xff,d0
- beqs ikbd_yes_joystick
-
- | Mouse packet ?
-
- cmpb #0xf8,d0
- bmis ikbd_no_mouse
- cmpb #0xfc,d0
- bpls ikbd_no_mouse
-
- | Mouse packet, byte #1
-
-ikbd_yes_mouse:
- andw #3,d0
- movew d0,_SDL_AtariIkbd_mouseb
-
- movel #ikbd_mousex,0x118:w
- bras ikbd_endit_stack
-
- | Joystick packet, byte #1
-
-ikbd_yes_joystick:
- movel #ikbd_joystick,0x118:w
- bras ikbd_endit_stack
-
- | Keyboard press/release
-
-ikbd_no_mouse:
- moveb d0,d1
- lea _SDL_AtariIkbd_keyboard,a0
- andw #0x7f,d1
- tas d0
- spl a0@(0,d1:w)
-
- | End of interrupt
-
-ikbd_endit_stack:
- moveml sp@+,d0-d1/a0
-ikbd_endit:
- bclr #6,0xfffffa11:w
- rte
-
- | Call old MIDI interrupt
-
-ikbd_oldmidi:
- movel old_ikbd,sp@-
- rts
-
- | Mouse packet, byte #2
-
-ikbd_mousex:
-
- | Check if source is IKBD or MIDI
- btst #0,0xfffffc00.w
- beqs ikbd_oldmidi
-
- movew d0,sp@-
-
- moveb 0xfffffc02:w,d0
- extw d0
- addw d0,_SDL_AtariIkbd_mousex
-
- movew sp@+,d0
-
- movel #ikbd_mousey,0x118:w
- bras ikbd_endit
-
- | Mouse packet, byte #3
-
-ikbd_mousey:
-
- | Check if source is IKBD or MIDI
- btst #0,0xfffffc00.w
- beqs ikbd_oldmidi
-
- movew d0,sp@-
-
- moveb 0xfffffc02:w,d0
- extw d0
- addw d0,_SDL_AtariIkbd_mousey
-
- movew sp@+,d0
-
- movel #ikbd,0x118:w
- bras ikbd_endit
-
- | Joystick packet, byte #2
-
-ikbd_joystick:
-
- | Check if source is IKBD or MIDI
- btst #0,0xfffffc00.w
- beqs ikbd_oldmidi
-
- moveb 0xfffffc02:w,_SDL_AtariIkbd_joystick+1
-
- movel #ikbd,0x118:w
- bras ikbd_endit
-
- .data
-
- .even
-_SDL_AtariIkbd_enabled:
- .word 0
-
- .bss
-
- .even
- .comm _SDL_AtariIkbd_keyboard,128
- .comm _SDL_AtariIkbd_mousex,2
- .comm _SDL_AtariIkbd_mousey,2
- .comm _SDL_AtariIkbd_mouseb,2
- .comm _SDL_AtariIkbd_joystick,2
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ikbdinterrupt_s.h b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ikbdinterrupt_s.h
deleted file mode 100644
index 78859c6..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_ikbdinterrupt_s.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * Mouse vector
- *
- * Patrice Mandin
- */
-
-#ifndef _SDL_IKBDINTERRUPT_S_H_
-#define _SDL_IKBDINTERRUPT_S_H_
-
-#include <mint/osbind.h>
-
-#include "SDL_stdinc.h"
-
-/* Const */
-
-#define IKBD_JOY_UP (1<<0)
-#define IKBD_JOY_DOWN (1<<1)
-#define IKBD_JOY_LEFT (1<<2)
-#define IKBD_JOY_RIGHT (1<<3)
-#define IKBD_JOY_FIRE (1<<7)
-
-/* Variables */
-
-extern volatile Uint8 SDL_AtariIkbd_keyboard[128]; /* Keyboard table */
-extern volatile Uint16 SDL_AtariIkbd_mouseb; /* Mouse on port 0, buttons */
-extern volatile Sint16 SDL_AtariIkbd_mousex; /* Mouse X relative motion */
-extern volatile Sint16 SDL_AtariIkbd_mousey; /* Mouse Y relative motion */
-extern volatile Uint16 SDL_AtariIkbd_joystick; /* Joystick on port 1 */
-
-/* For joystick driver to know if this is usable */
-extern Uint16 SDL_AtariIkbd_enabled;
-
-/* Functions */
-
-extern void SDL_AtariIkbdInstall(void);
-extern void SDL_AtariIkbdUninstall(void);
-
-#endif /* _SDL_IKBDINTERRUPT_S_H_ */
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_xbiosevents.c b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_xbiosevents.c
deleted file mode 100644
index 5d1fa3c..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_xbiosevents.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * XBIOS mouse & joystick vectors
- *
- * Patrice Mandin
- */
-
-#include <mint/osbind.h>
-
-#include "../../events/SDL_events_c.h"
-#include "SDL_xbiosevents_c.h"
-#include "SDL_xbiosinterrupt_s.h"
-
-/* Variables */
-
-int SDL_AtariXbios_enabled=0;
-
-/* Local variables */
-
-static _KBDVECS *kbdvecs; /* Pointer to access system vectors */
-static Uint16 atari_prevmouseb; /* buttons */
-
-/* Functions */
-
-void SDL_AtariXbios_InstallVectors(int vectors_mask)
-{
- void *oldpile;
-
- /* Clear variables */
- SDL_AtariXbios_mouselock =
- SDL_AtariXbios_mouseb =
- SDL_AtariXbios_mousex =
- SDL_AtariXbios_mousey =
- SDL_AtariXbios_joystick =
- atari_prevmouseb = 0;
-
- if (vectors_mask==0) {
- SDL_AtariXbios_enabled=0;
- return;
- }
-
- /* Read IKBD vectors base */
- kbdvecs=Kbdvbase();
-
- /* Go to supervisor mode */
- oldpile=(void *)Super(0);
-
- /* Install our vectors */
- SDL_AtariXbios_Install(
- kbdvecs,
- (vectors_mask & ATARI_XBIOS_MOUSEEVENTS) ? SDL_AtariXbios_MouseVector : NULL,
- (vectors_mask & ATARI_XBIOS_JOYSTICKEVENTS) ? SDL_AtariXbios_JoystickVector : NULL
- );
-
- /* Back to user mode */
- Super(oldpile);
-
- SDL_AtariXbios_enabled=1;
-}
-
-void SDL_AtariXbios_RestoreVectors(void)
-{
- void *oldpile;
-
- if (SDL_AtariXbios_enabled==0) {
- return;
- }
-
- /* Read IKBD vectors base */
- kbdvecs=Kbdvbase();
-
- /* Go to supervisor mode */
- oldpile=(void *)Super(NULL);
-
- /* Reinstall system vector */
- SDL_AtariXbios_Restore(kbdvecs);
-
- /* Back to user mode */
- Super(oldpile);
-}
-
-static int atari_GetButton(int button)
-{
- switch(button)
- {
- case 0:
- return SDL_BUTTON_RIGHT;
- break;
- case 1:
- default:
- return SDL_BUTTON_LEFT;
- break;
- }
-}
-
-void SDL_AtariXbios_PostMouseEvents(_THIS, SDL_bool buttonEvents)
-{
- if (SDL_AtariXbios_enabled==0) {
- return;
- }
-
- /* Mouse motion ? */
- if (SDL_AtariXbios_mousex || SDL_AtariXbios_mousey) {
- SDL_PrivateMouseMotion(0, 1, SDL_AtariXbios_mousex, SDL_AtariXbios_mousey);
- SDL_AtariXbios_mousex = SDL_AtariXbios_mousey = 0;
- }
-
- /* Mouse button ? */
- if (buttonEvents && (SDL_AtariXbios_mouseb != atari_prevmouseb)) {
- int i;
-
- for (i=0;i<2;i++) {
- int curbutton, prevbutton;
-
- curbutton = SDL_AtariXbios_mouseb & (1<<i);
- prevbutton = atari_prevmouseb & (1<<i);
-
- if (curbutton && !prevbutton) {
- SDL_PrivateMouseButton(SDL_PRESSED, atari_GetButton(i), 0, 0);
- }
- if (!curbutton && prevbutton) {
- SDL_PrivateMouseButton(SDL_RELEASED, atari_GetButton(i), 0, 0);
- }
- }
- atari_prevmouseb = SDL_AtariXbios_mouseb;
- }
-}
-
-void SDL_AtariXbios_LockMousePosition(SDL_bool lockPosition)
-{
- SDL_AtariXbios_mouselock = lockPosition;
-}
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_xbiosevents_c.h b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_xbiosevents_c.h
deleted file mode 100644
index 9f746fb..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_xbiosevents_c.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * Xbios mouse & joystick vectors
- *
- * Patrice Mandin
- */
-
-#ifndef _SDL_ATARI_XBIOSEVENTS_H_
-#define _SDL_ATARI_XBIOSEVENTS_H_
-
-#include "../SDL_sysvideo.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-#define ATARI_XBIOS_MOUSEEVENTS (1<<0)
-#define ATARI_XBIOS_JOYSTICKEVENTS (1<<1)
-
-extern int SDL_AtariXbios_enabled;
-
-extern void SDL_AtariXbios_InstallVectors(int vectors_mask);
-extern void SDL_AtariXbios_RestoreVectors(void);
-extern void SDL_AtariXbios_PostMouseEvents(_THIS, SDL_bool buttonEvents);
-extern void SDL_AtariXbios_LockMousePosition(SDL_bool lockPosition);
-
-#endif /* _SDL_XBIOSEVENTS_H_ */
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_xbiosinterrupt.S b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_xbiosinterrupt.S
deleted file mode 100644
index a76df37..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_xbiosinterrupt.S
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/*
- * XBIOS mouse & joystick vectors
- *
- * Patrice Mandin
- */
-
- .text
-
- .globl _SDL_AtariXbios_Install
- .globl _SDL_AtariXbios_Restore
- .globl _SDL_AtariXbios_MouseVector
- .globl _SDL_AtariXbios_JoystickVector
-
- .globl _SDL_AtariXbios_mouselock
- .globl _SDL_AtariXbios_mouseb
- .globl _SDL_AtariXbios_mousex
- .globl _SDL_AtariXbios_mousey
- .globl _SDL_AtariXbios_joystick
-
-/*--- Vector installer ---*/
-
-_SDL_AtariXbios_Install:
- movel sp@(4),a0
-
- /* Stop interrupts */
-
- movew #0x2700,sr
-
- /* Save old mouse vector, set our routine */
-
- clrl oldmousevector
- movel sp@(8),d0
- beqs no_new_mouse_vector
- movel a0@(16),oldmousevector
- movel d0,a0@(16)
-no_new_mouse_vector:
-
- /* Save old joystick vector, set our routine */
-
- clrl oldjoystickvector
- movel sp@(12),d0
- beqs no_new_joystick_vector
- movel a0@(24),oldjoystickvector
- movel d0,a0@(24)
-no_new_joystick_vector:
-
- /* Restart interrupts */
-
- movew #0x2300,sr
-
- rts
-
-/*--- Vector restorer ---*/
-
-_SDL_AtariXbios_Restore:
- movel sp@(4),a0
-
- /* Stop interrupts */
-
- movew #0x2700,sr
-
- /* Restore mouse vector */
-
- movel oldmousevector,d0
- beqs no_restore_mouse
- movel d0,a0@(16)
-no_restore_mouse:
-
- /* Restore joystick vector */
-
- movel oldjoystickvector,d0
- beqs no_restore_joystick
- movel d0,a0@(24)
-no_restore_joystick:
-
- /* Restart interrupts */
-
- movew #0x2300,sr
-
- rts
-
-/*--- Our mouse vector ---*/
-
- .text
- .even
- .ascii "XBRA"
- .ascii "LSDL"
- .comm oldmousevector,4*1
-_SDL_AtariXbios_MouseVector:
- movel d0,sp@-
-
- /* Mouse buttons */
- moveb (a0),d0
- andw #3,d0
- movew d0,_SDL_AtariXbios_mouseb
-
- /* X movement */
- moveb a0@(1),d0
- extw d0
- addw d0,_SDL_AtariXbios_mousex
-
- /* Y movement */
- moveb a0@(2),d0
- extw d0
- addw d0,_SDL_AtariXbios_mousey
-
- /* Lock mouse position ? */
- tstw _SDL_AtariXbios_mouselock
- beq.s no_mouse_lock
- clrb a0@(1)
- clrb a0@(2)
-no_mouse_lock:
-
- /* Jump through old vector */
- movel sp@+,d0
-
- movel oldmousevector,sp@-
- rts
-
- .data
- .even
- .comm _SDL_AtariXbios_mouselock,2*1
- .comm _SDL_AtariXbios_mousex,2*1
- .comm _SDL_AtariXbios_mousey,2*1
- .comm _SDL_AtariXbios_mouseb,2*1
-
-/*--- Our joystick vector ---*/
-
- .text
- .even
- .ascii "XBRA"
- .ascii "LSDL"
- .comm oldjoystickvector,4*1
-_SDL_AtariXbios_JoystickVector:
- movel d0,sp@-
-
- /* New joystick state */
- moveb a0@(2),d0
- andw #0x8f,d0
- movew d0,_SDL_AtariXbios_joystick
-
- /* Jump through old vector */
- movel sp@+,d0
-
- movel oldjoystickvector,sp@-
- rts
-
- .data
- .even
- .comm _SDL_AtariXbios_joystick,2*1
diff --git a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_xbiosinterrupt_s.h b/distrib/sdl-1.2.12/src/video/ataricommon/SDL_xbiosinterrupt_s.h
deleted file mode 100644
index 429c170..0000000
--- a/distrib/sdl-1.2.12/src/video/ataricommon/SDL_xbiosinterrupt_s.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * Mouse vector
- *
- * Patrice Mandin
- */
-
-#ifndef _SDL_XBIOSINTERRUPT_S_H_
-#define _SDL_XBIOSINTERRUPT_S_H_
-
-#include <mint/osbind.h>
-
-#include "SDL_stdinc.h"
-
-/* Variables */
-
-extern volatile Uint16 SDL_AtariXbios_mouselock; /* mouse lock position */
-extern volatile Uint16 SDL_AtariXbios_mouseb; /* buttons */
-extern volatile Sint16 SDL_AtariXbios_mousex; /* X relative motion */
-extern volatile Sint16 SDL_AtariXbios_mousey; /* Y relative motion */
-extern volatile Uint16 SDL_AtariXbios_joystick; /* Joystick */
-
-/* Functions */
-
-extern void SDL_AtariXbios_Install(_KBDVECS *kbdvecs,void *newmousevector,void *newjoystickvector);
-extern void SDL_AtariXbios_Restore(_KBDVECS *kbdvecs);
-extern void SDL_AtariXbios_MouseVector(void *buf);
-extern void SDL_AtariXbios_JoystickVector(void *buf);
-
-#endif /* _SDL_XBIOSINTERRUPT_S_H_ */
diff --git a/distrib/sdl-1.2.12/src/video/blank_cursor.h b/distrib/sdl-1.2.12/src/video/blank_cursor.h
deleted file mode 100644
index f63fae3..0000000
--- a/distrib/sdl-1.2.12/src/video/blank_cursor.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * A default blank 8x8 cursor */
-
-#define BLANK_CWIDTH 8
-#define BLANK_CHEIGHT 8
-#define BLANK_CHOTX 0
-#define BLANK_CHOTY 0
-
-static unsigned char blank_cdata[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-static unsigned char blank_cmask[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-
diff --git a/distrib/sdl-1.2.12/src/video/bwindow/SDL_BView.h b/distrib/sdl-1.2.12/src/video/bwindow/SDL_BView.h
deleted file mode 100644
index 564d064..0000000
--- a/distrib/sdl-1.2.12/src/video/bwindow/SDL_BView.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_BView_h
-#define _SDL_BView_h
-
-/* This is the event handling and graphics update portion of SDL_BWin */
-
-extern "C" {
-#include "../../events/SDL_events_c.h"
-};
-
-class SDL_BView : public BView
-{
-public:
- SDL_BView(BRect frame) :
- BView(frame, "SDL View", B_FOLLOW_ALL_SIDES,
- (B_WILL_DRAW|B_FRAME_EVENTS)) {
- image = NULL;
- xoff = yoff = 0;
- SetViewColor(0,0,0,0);
- SetHighColor(0,0,0,0);
- }
- virtual ~SDL_BView() {
- SetBitmap(NULL);
- }
- /* Set drawing offsets for fullscreen mode */
- virtual void SetXYOffset(int x, int y) {
- xoff = x;
- yoff = y;
- }
- virtual void GetXYOffset(int &x, int &y) {
- x = xoff;
- y = yoff;
- }
- virtual void GetXYOffset(float &x, float &y) {
- x = (float)xoff;
- y = (float)yoff;
- }
- /* The view changed size. If it means we're in fullscreen, we
- * draw a nice black box in the entire view to get black borders.
- */
- virtual void FrameResized(float width, float height) {
- BRect bounds;
- bounds.top = bounds.left = 0;
- bounds.right = width;
- bounds.bottom = height;
- /* Fill the entire view with black */
- FillRect(bounds, B_SOLID_HIGH);
- /* And if there's an image, redraw it. */
- if( image ) {
- bounds = image->Bounds();
- Draw(bounds);
- }
- }
-
- /* Drawing portion of this complete breakfast. :) */
- virtual void SetBitmap(BBitmap *bitmap) {
- if ( image ) {
- delete image;
- }
- image = bitmap;
- }
- virtual void Draw(BRect updateRect) {
- if ( image ) {
- if(xoff || yoff) {
- BRect dest;
- dest.top = updateRect.top + yoff;
- dest.left = updateRect.left + xoff;
- dest.bottom = updateRect.bottom + yoff;
- dest.right = updateRect.right + xoff;
- DrawBitmap(image, updateRect, dest);
- } else {
- DrawBitmap(image, updateRect, updateRect);
- }
- }
- }
- virtual void DrawAsync(BRect updateRect) {
- if(xoff || yoff) {
- BRect dest;
- dest.top = updateRect.top + yoff;
- dest.left = updateRect.left + xoff;
- dest.bottom = updateRect.bottom + yoff;
- dest.right = updateRect.right + xoff;;
- DrawBitmapAsync(image, updateRect, dest);
- } else {
- DrawBitmapAsync(image, updateRect, updateRect);
- }
- }
-
-private:
- BBitmap *image;
- int xoff, yoff;
-};
-
-#endif /* _SDL_BView_h */
diff --git a/distrib/sdl-1.2.12/src/video/bwindow/SDL_BWin.h b/distrib/sdl-1.2.12/src/video/bwindow/SDL_BWin.h
deleted file mode 100644
index 952d5a2..0000000
--- a/distrib/sdl-1.2.12/src/video/bwindow/SDL_BWin.h
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-#ifndef _SDL_BWin_h
-#define _SDL_BWin_h
-
-#include "SDL_config.h"
-
-#include <stdio.h>
-#include <AppKit.h>
-#include <InterfaceKit.h>
-#include <be/game/DirectWindow.h>
-#if SDL_VIDEO_OPENGL
-#include <be/opengl/GLView.h>
-#endif
-#include <support/UTF8.h>
-
-#include "../../main/beos/SDL_BeApp.h"
-#include "SDL_events.h"
-#include "SDL_BView.h"
-
-extern "C" {
-#include "../../events/SDL_events_c.h"
-
-extern int mouse_relative;
-};
-
-class SDL_BWin : public BDirectWindow
-{
-public:
- SDL_BWin(BRect bounds) :
- BDirectWindow(bounds, "Untitled", B_TITLED_WINDOW, 0) {
- last_buttons = 0;
- the_view = NULL;
-#if SDL_VIDEO_OPENGL
- SDL_GLView = NULL;
-#endif
- SDL_View = NULL;
- Unlock();
- shown = false;
- inhibit_resize = false;
- }
-
- virtual ~SDL_BWin() {
- Lock();
- if ( the_view ) {
-#if SDL_VIDEO_OPENGL
- if ( the_view == SDL_GLView ) {
- SDL_GLView->UnlockGL();
- }
-#endif
- RemoveChild(the_view);
- the_view = NULL;
- }
- Unlock();
-#if SDL_VIDEO_OPENGL
- if ( SDL_GLView ) {
- delete SDL_GLView;
- }
-#endif
- if ( SDL_View ) {
- delete SDL_View;
- }
- }
-
-
- /* Override the Show() method so we can tell when we've been shown */
- virtual void Show(void) {
- BWindow::Show();
- shown = true;
- }
- virtual bool Shown(void) {
- return (shown);
- }
- /* If called, the next resize event will not be forwarded to SDL. */
- virtual void InhibitResize(void) {
- inhibit_resize=true;
- }
- /* Handle resizing of the window */
- virtual void FrameResized(float width, float height) {
- if(inhibit_resize)
- inhibit_resize = false;
- else
- SDL_PrivateResize((int)width, (int)height);
- }
- virtual int CreateView(Uint32 flags, Uint32 gl_flags) {
- int retval;
-
- retval = 0;
- Lock();
- if ( flags & SDL_OPENGL ) {
-#if SDL_VIDEO_OPENGL
- if ( SDL_GLView == NULL ) {
- SDL_GLView = new BGLView(Bounds(), "SDL GLView",
- B_FOLLOW_ALL_SIDES, (B_WILL_DRAW|B_FRAME_EVENTS),
- gl_flags);
- SDL_GLView->EnableDirectMode(true);
- }
- if ( the_view != SDL_GLView ) {
- if ( the_view ) {
- RemoveChild(the_view);
- }
- AddChild(SDL_GLView);
- SDL_GLView->LockGL();
- the_view = SDL_GLView;
- }
-#else
- SDL_SetError("OpenGL support not enabled");
- retval = -1;
-#endif
- } else {
- if ( SDL_View == NULL ) {
- SDL_View = new SDL_BView(Bounds());
- }
- if ( the_view != SDL_View ) {
- if ( the_view ) {
-#if SDL_VIDEO_OPENGL
- if ( the_view == SDL_GLView ) {
- SDL_GLView->UnlockGL();
- }
-#endif
- RemoveChild(the_view);
- }
- AddChild(SDL_View);
- the_view = SDL_View;
- }
- }
- Unlock();
- return(retval);
- }
- virtual void SetBitmap(BBitmap *bitmap) {
- SDL_View->SetBitmap(bitmap);
- }
- virtual void SetXYOffset(int x, int y) {
-#if SDL_VIDEO_OPENGL
- if ( the_view == SDL_GLView ) {
- return;
- }
-#endif
- SDL_View->SetXYOffset(x, y);
- }
- virtual void GetXYOffset(int &x, int &y) {
-#if SDL_VIDEO_OPENGL
- if ( the_view == SDL_GLView ) {
- x = 0;
- y = 0;
- return;
- }
-#endif
- SDL_View->GetXYOffset(x, y);
- }
- virtual void GetXYOffset(float &x, float &y) {
-#if SDL_VIDEO_OPENGL
- if ( the_view == SDL_GLView ) {
- x = 0.0f;
- y = 0.0f;
- return;
- }
-#endif
- SDL_View->GetXYOffset(x, y);
- }
- virtual bool BeginDraw(void) {
- return(Lock());
- }
- virtual void DrawAsync(BRect updateRect) {
- SDL_View->DrawAsync(updateRect);
- }
- virtual void EndDraw(void) {
- SDL_View->Sync();
- Unlock();
- }
-#if SDL_VIDEO_OPENGL
- virtual void SwapBuffers(void) {
- SDL_GLView->UnlockGL();
- SDL_GLView->LockGL();
- SDL_GLView->SwapBuffers();
- }
-#endif
- virtual BView *View(void) {
- return(the_view);
- }
-
- /* Hook functions -- overridden */
- virtual void Minimize(bool minimize) {
- /* This is only called when mimimized, not when restored */
- //SDL_PrivateAppActive(minimize, SDL_APPACTIVE);
- BWindow::Minimize(minimize);
- }
- virtual void WindowActivated(bool active) {
- SDL_PrivateAppActive(active, SDL_APPINPUTFOCUS);
- }
- virtual bool QuitRequested(void) {
- if ( SDL_BeAppActive > 0 ) {
- SDL_PrivateQuit();
- /* We don't ever actually close the window here because
- the application should respond to the quit request,
- or ignore it as desired.
- */
- return(false);
- }
- return(true); /* Close the app window */
- }
- virtual void Quit() {
- if (!IsLocked())
- Lock();
- BDirectWindow::Quit();
- }
-
- virtual int16 Translate2Unicode(const char *buf) {
- int32 state, srclen, dstlen;
- unsigned char destbuf[2];
- Uint16 unicode = 0;
-
- if ((uchar)buf[0] > 127) {
- state = 0;
- srclen = SDL_strlen(buf);
- dstlen = sizeof(destbuf);
- convert_from_utf8(B_UNICODE_CONVERSION, buf, &srclen, (char *)destbuf, &dstlen, &state);
- unicode = destbuf[0];
- unicode <<= 8;
- unicode |= destbuf[1];
- } else
- unicode = buf[0];
-
- /* For some reason function keys map to control characters */
-# define CTRL(X) ((X)-'@')
- switch (unicode) {
- case CTRL('A'):
- case CTRL('B'):
- case CTRL('C'):
- case CTRL('D'):
- case CTRL('E'):
- case CTRL('K'):
- case CTRL('L'):
- case CTRL('P'):
- if ( ! (SDL_GetModState() & KMOD_CTRL) )
- unicode = 0;
- break;
- /* Keyboard input maps newline to carriage return */
- case '\n':
- unicode = '\r';
- break;
- default:
- break;
- }
-
- return unicode;
- }
-
- virtual void DispatchMessage(BMessage *msg, BHandler *target);
-
-private:
-#if SDL_VIDEO_OPENGL
- BGLView *SDL_GLView;
-#endif
- SDL_BView *SDL_View;
- BView *the_view;
- bool shown;
- bool inhibit_resize;
- int32 last_buttons;
-};
-
-#endif /* _SDL_BWin_h */
diff --git a/distrib/sdl-1.2.12/src/video/bwindow/SDL_lowvideo.h b/distrib/sdl-1.2.12/src/video/bwindow/SDL_lowvideo.h
deleted file mode 100644
index 7af004b..0000000
--- a/distrib/sdl-1.2.12/src/video/bwindow/SDL_lowvideo.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_lowvideo_h
-#define _SDL_lowvideo_h
-
-#include "SDL_BWin.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *_this
-
-/* Private display data */
-struct SDL_PrivateVideoData {
- /* The main window */
- SDL_BWin *SDL_Win;
-
- /* The fullscreen mode list */
- display_mode saved_mode;
-#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
- int SDL_nummodes[NUM_MODELISTS];
- SDL_Rect **SDL_modelist[NUM_MODELISTS];
-
- /* A completely clear cursor */
- WMcursor *BlankCursor;
-
- SDL_Overlay *overlay;
-};
-/* Old variable names */
-#define SDL_Win (_this->hidden->SDL_Win)
-#define saved_mode (_this->hidden->saved_mode)
-#define SDL_nummodes (_this->hidden->SDL_nummodes)
-#define SDL_modelist (_this->hidden->SDL_modelist)
-#define SDL_BlankCursor (_this->hidden->BlankCursor)
-#define current_overlay (_this->hidden->overlay)
-
-#endif /* _SDL_lowvideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/bwindow/SDL_sysevents.cc b/distrib/sdl-1.2.12/src/video/bwindow/SDL_sysevents.cc
deleted file mode 100644
index f011c57..0000000
--- a/distrib/sdl-1.2.12/src/video/bwindow/SDL_sysevents.cc
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <support/UTF8.h>
-#include <stdio.h>
-#include <string.h>
-#include "SDL_error.h"
-#include "SDL_events.h"
-#include "SDL_BWin.h"
-#include "SDL_lowvideo.h"
-
-static SDLKey keymap[128];
-int mouse_relative = 0;
-extern "C" {
-
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_sysevents_c.h"
-
-void BE_PumpEvents(_THIS)
-{
-}
-
-void BE_InitOSKeymap(_THIS)
-{
- for ( uint i=0; i<SDL_TABLESIZE(keymap); ++i )
- keymap[i] = SDLK_UNKNOWN;
-
- keymap[0x01] = SDLK_ESCAPE;
- keymap[B_F1_KEY] = SDLK_F1;
- keymap[B_F2_KEY] = SDLK_F2;
- keymap[B_F3_KEY] = SDLK_F3;
- keymap[B_F4_KEY] = SDLK_F4;
- keymap[B_F5_KEY] = SDLK_F5;
- keymap[B_F6_KEY] = SDLK_F6;
- keymap[B_F7_KEY] = SDLK_F7;
- keymap[B_F8_KEY] = SDLK_F8;
- keymap[B_F9_KEY] = SDLK_F9;
- keymap[B_F10_KEY] = SDLK_F10;
- keymap[B_F11_KEY] = SDLK_F11;
- keymap[B_F12_KEY] = SDLK_F12;
- keymap[B_PRINT_KEY] = SDLK_PRINT;
- keymap[B_SCROLL_KEY] = SDLK_SCROLLOCK;
- keymap[B_PAUSE_KEY] = SDLK_PAUSE;
- keymap[0x11] = SDLK_BACKQUOTE;
- keymap[0x12] = SDLK_1;
- keymap[0x13] = SDLK_2;
- keymap[0x14] = SDLK_3;
- keymap[0x15] = SDLK_4;
- keymap[0x16] = SDLK_5;
- keymap[0x17] = SDLK_6;
- keymap[0x18] = SDLK_7;
- keymap[0x19] = SDLK_8;
- keymap[0x1a] = SDLK_9;
- keymap[0x1b] = SDLK_0;
- keymap[0x1c] = SDLK_MINUS;
- keymap[0x1d] = SDLK_EQUALS;
- keymap[0x1e] = SDLK_BACKSPACE;
- keymap[0x1f] = SDLK_INSERT;
- keymap[0x20] = SDLK_HOME;
- keymap[0x21] = SDLK_PAGEUP;
- keymap[0x22] = SDLK_NUMLOCK;
- keymap[0x23] = SDLK_KP_DIVIDE;
- keymap[0x24] = SDLK_KP_MULTIPLY;
- keymap[0x25] = SDLK_KP_MINUS;
- keymap[0x26] = SDLK_TAB;
- keymap[0x27] = SDLK_q;
- keymap[0x28] = SDLK_w;
- keymap[0x29] = SDLK_e;
- keymap[0x2a] = SDLK_r;
- keymap[0x2b] = SDLK_t;
- keymap[0x2c] = SDLK_y;
- keymap[0x2d] = SDLK_u;
- keymap[0x2e] = SDLK_i;
- keymap[0x2f] = SDLK_o;
- keymap[0x30] = SDLK_p;
- keymap[0x31] = SDLK_LEFTBRACKET;
- keymap[0x32] = SDLK_RIGHTBRACKET;
- keymap[0x33] = SDLK_BACKSLASH;
- keymap[0x34] = SDLK_DELETE;
- keymap[0x35] = SDLK_END;
- keymap[0x36] = SDLK_PAGEDOWN;
- keymap[0x37] = SDLK_KP7;
- keymap[0x38] = SDLK_KP8;
- keymap[0x39] = SDLK_KP9;
- keymap[0x3a] = SDLK_KP_PLUS;
- keymap[0x3b] = SDLK_CAPSLOCK;
- keymap[0x3c] = SDLK_a;
- keymap[0x3d] = SDLK_s;
- keymap[0x3e] = SDLK_d;
- keymap[0x3f] = SDLK_f;
- keymap[0x40] = SDLK_g;
- keymap[0x41] = SDLK_h;
- keymap[0x42] = SDLK_j;
- keymap[0x43] = SDLK_k;
- keymap[0x44] = SDLK_l;
- keymap[0x45] = SDLK_SEMICOLON;
- keymap[0x46] = SDLK_QUOTE;
- keymap[0x47] = SDLK_RETURN;
- keymap[0x48] = SDLK_KP4;
- keymap[0x49] = SDLK_KP5;
- keymap[0x4a] = SDLK_KP6;
- keymap[0x4b] = SDLK_LSHIFT;
- keymap[0x4c] = SDLK_z;
- keymap[0x4d] = SDLK_x;
- keymap[0x4e] = SDLK_c;
- keymap[0x4f] = SDLK_v;
- keymap[0x50] = SDLK_b;
- keymap[0x51] = SDLK_n;
- keymap[0x52] = SDLK_m;
- keymap[0x53] = SDLK_COMMA;
- keymap[0x54] = SDLK_PERIOD;
- keymap[0x55] = SDLK_SLASH;
- keymap[0x56] = SDLK_RSHIFT;
- keymap[0x57] = SDLK_UP;
- keymap[0x58] = SDLK_KP1;
- keymap[0x59] = SDLK_KP2;
- keymap[0x5a] = SDLK_KP3;
- keymap[0x5b] = SDLK_KP_ENTER;
- keymap[0x5c] = SDLK_LCTRL;
- keymap[0x5d] = SDLK_LALT;
- keymap[0x5e] = SDLK_SPACE;
- keymap[0x5f] = SDLK_RALT;
- keymap[0x60] = SDLK_RCTRL;
- keymap[0x61] = SDLK_LEFT;
- keymap[0x62] = SDLK_DOWN;
- keymap[0x63] = SDLK_RIGHT;
- keymap[0x64] = SDLK_KP0;
- keymap[0x65] = SDLK_KP_PERIOD;
- keymap[0x66] = SDLK_LMETA;
- keymap[0x67] = SDLK_RMETA;
- keymap[0x68] = SDLK_MENU;
- keymap[0x69] = SDLK_EURO;
- keymap[0x6a] = SDLK_KP_EQUALS;
- keymap[0x6b] = SDLK_POWER;
-}
-
-}; /* Extern C */
-
-void SDL_BWin::DispatchMessage(BMessage *msg, BHandler *target)
-{
- switch (msg->what) {
- case B_MOUSE_MOVED:
- {
- SDL_VideoDevice *view = current_video;
- BPoint where;
- int32 transit;
- if (msg->FindPoint("where", &where) == B_OK && msg->FindInt32("be:transit", &transit) == B_OK) {
- int x, y;
-
- GetXYOffset(x, y);
- x = (int)where.x - x;
- y = (int)where.y - y;
-
- //BeSman: I need another method for cursor catching !!!
- if (view->input_grab != SDL_GRAB_OFF)
- {
- bool clipped = false;
- if ( x < 0 ) {
- x = 0;
- clipped = true;
- } else if ( x >= SDL_VideoSurface->w ) {
- x = (SDL_VideoSurface->w-1);
- clipped = true;
- }
- if ( y < 0 ) {
- y = 0;
- clipped = true;
- } else if ( y >= SDL_VideoSurface->h ) {
- y = (SDL_VideoSurface->h-1);
- clipped = true;
- }
- if ( clipped ) {
- BPoint edge;
- GetXYOffset(edge.x, edge.y);
- edge.x += x;
- edge.y += y;
- ConvertToScreen(&edge);
- set_mouse_position((int)edge.x, (int)edge.y);
- }
- transit = B_INSIDE_VIEW;
- }
- if (transit == B_EXITED_VIEW) {
- if ( SDL_GetAppState() & SDL_APPMOUSEFOCUS ) {
- SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
- be_app->SetCursor(B_HAND_CURSOR);
- }
- } else {
- if ( !(SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
- SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
- SDL_SetCursor(NULL);
- }
-
- if ( mouse_relative ) {
- int half_w = (SDL_VideoSurface->w/2);
- int half_h = (SDL_VideoSurface->h/2);
- x -= half_w;
- y -= half_h;
- if ( x || y ) {
- BPoint center;
- GetXYOffset(center.x, center.y);
- center.x += half_w;
- center.y += half_h;
- ConvertToScreen(&center);
- set_mouse_position((int)center.x, (int)center.y);
- SDL_PrivateMouseMotion(0, 1, x, y);
- }
- } else {
- SDL_PrivateMouseMotion(0, 0, x, y);
- }
- }
- }
- break;
- }
-
- case B_MOUSE_DOWN:
- {
- /* it looks like mouse down is send only for first clicked
- button, each next is not send while last one is holded */
- int32 buttons;
- int sdl_buttons = 0;
- if (msg->FindInt32("buttons", &buttons) == B_OK) {
- /* Add any mouse button events */
- if (buttons & B_PRIMARY_MOUSE_BUTTON) {
- sdl_buttons |= SDL_BUTTON_LEFT;
- }
- if (buttons & B_SECONDARY_MOUSE_BUTTON) {
- sdl_buttons |= SDL_BUTTON_RIGHT;
- }
- if (buttons & B_TERTIARY_MOUSE_BUTTON) {
- sdl_buttons |= SDL_BUTTON_MIDDLE;
- }
- SDL_PrivateMouseButton(SDL_PRESSED, sdl_buttons, 0, 0);
-
- last_buttons = buttons;
- }
- break;
- }
-
- case B_MOUSE_UP:
- {
- /* mouse up doesn't give which button was released,
- only state of buttons (after release, so it's always = 0),
- which is not what we need ;]
- So we need to store button in mouse down, and restore
- in mouse up :(
- mouse up is (similarly to mouse down) send only for
- first button down (ie. it's no send if we click another button
- without releasing previous one first) - but that's probably
- because of how drivers are written?, not BeOS itself. */
- int32 buttons;
- int sdl_buttons = 0;
- if (msg->FindInt32("buttons", &buttons) == B_OK) {
- /* Add any mouse button events */
- if ((buttons ^ B_PRIMARY_MOUSE_BUTTON) & last_buttons) {
- sdl_buttons |= SDL_BUTTON_LEFT;
- }
- if ((buttons ^ B_SECONDARY_MOUSE_BUTTON) & last_buttons) {
- sdl_buttons |= SDL_BUTTON_RIGHT;
- }
- if ((buttons ^ B_TERTIARY_MOUSE_BUTTON) & last_buttons) {
- sdl_buttons |= SDL_BUTTON_MIDDLE;
- }
- SDL_PrivateMouseButton(SDL_RELEASED, sdl_buttons, 0, 0);
-
- last_buttons = buttons;
- }
- break;
- }
-
- case B_MOUSE_WHEEL_CHANGED:
- {
- float x, y;
- x = y = 0;
- if (msg->FindFloat("be:wheel_delta_x", &x) == B_OK && msg->FindFloat("be:wheel_delta_y", &y) == B_OK) {
- if (x < 0 || y < 0) {
- SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELDOWN, 0, 0);
- SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELDOWN, 0, 0);
- } else if (x > 0 || y > 0) {
- SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELUP, 0, 0);
- SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELUP, 0, 0);
- }
- }
- break;
- }
-
- case B_KEY_DOWN:
- case B_UNMAPPED_KEY_DOWN: /* modifier keys are unmapped */
- {
- int32 key;
- int32 modifiers;
- int32 key_repeat;
- /* Workaround for SDL message queue being filled too fast because of BeOS own key-repeat mechanism */
- if (msg->FindInt32("be:key_repeat", &key_repeat) == B_OK && key_repeat > 0)
- break;
-
- if (msg->FindInt32("key", &key) == B_OK && msg->FindInt32("modifiers", &modifiers) == B_OK) {
- SDL_keysym keysym;
- keysym.scancode = key;
- if (key < 128) {
- keysym.sym = keymap[key];
- } else {
- keysym.sym = SDLK_UNKNOWN;
- }
- /* FIX THIS?
- it seems SDL_PrivateKeyboard() changes mod value
- anyway, and doesn't care about what we setup here */
- keysym.mod = KMOD_NONE;
- keysym.unicode = 0;
- if (SDL_TranslateUNICODE) {
- const char *bytes;
- if (msg->FindString("bytes", &bytes) == B_OK) {
- /* FIX THIS?
- this cares only about first "letter",
- so if someone maps some key to print
- "BeOS rulez!" only "B" will be used. */
- keysym.unicode = Translate2Unicode(bytes);
- }
- }
- SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
- }
- break;
- }
-
- case B_KEY_UP:
- case B_UNMAPPED_KEY_UP: /* modifier keys are unmapped */
- {
- int32 key;
- int32 modifiers;
- if (msg->FindInt32("key", &key) == B_OK && msg->FindInt32("modifiers", &modifiers) == B_OK) {
- SDL_keysym keysym;
- keysym.scancode = key;
- if (key < 128) {
- keysym.sym = keymap[key];
- } else {
- keysym.sym = SDLK_UNKNOWN;
- }
- keysym.mod = KMOD_NONE; /* FIX THIS? */
- keysym.unicode = 0;
- if (SDL_TranslateUNICODE) {
- const char *bytes;
- if (msg->FindString("bytes", &bytes) == B_OK) {
- keysym.unicode = Translate2Unicode(bytes);
- }
- }
- SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
- }
- break;
- }
-
- default:
- /* move it after switch{} so it's always handled
- that way we keep BeOS feautures like:
- - CTRL+Q to close window (and other shortcuts)
- - PrintScreen to make screenshot into /boot/home
- - etc.. */
- //BDirectWindow::DispatchMessage(msg, target);
- break;
- }
- BDirectWindow::DispatchMessage(msg, target);
-}
diff --git a/distrib/sdl-1.2.12/src/video/bwindow/SDL_sysevents_c.h b/distrib/sdl-1.2.12/src/video/bwindow/SDL_sysevents_c.h
deleted file mode 100644
index e2ef3f5..0000000
--- a/distrib/sdl-1.2.12/src/video/bwindow/SDL_sysevents_c.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_lowvideo.h"
-
-/* Variables and functions exported by SDL_sysevents.c to other parts
- of the native video subsystem (SDL_sysvideo.c)
-*/
-
-extern void BE_InitOSKeymap(_THIS);
-extern void BE_PumpEvents(_THIS);
diff --git a/distrib/sdl-1.2.12/src/video/bwindow/SDL_sysmouse.cc b/distrib/sdl-1.2.12/src/video/bwindow/SDL_sysmouse.cc
deleted file mode 100644
index 232186d..0000000
--- a/distrib/sdl-1.2.12/src/video/bwindow/SDL_sysmouse.cc
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <AppKit.h>
-#include <GameKit.h>
-
-#include "SDL_BWin.h"
-
-extern "C" {
-#include "../SDL_cursor_c.h"
-#include "SDL_sysmouse_c.h"
-
-/* Convert bits to padded bytes */
-#define PADDED_BITS(bits) ((bits+7)/8)
-
-/* The implementation dependent data for the window manager cursor */
-struct WMcursor {
- char *bits;
-};
-
-/* Can this be done in the BeOS? */
-WMcursor *BE_CreateWMCursor(_THIS,
- Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
-{
- WMcursor *cursor;
- int allowed_x;
- int allowed_y;
- int run, pad, i;
- char *cptr;
-
- allowed_x = 16; /* BeOS limitation */
- allowed_y = 16; /* BeOS limitation */
- if ( (w > allowed_x) || (h > allowed_y) ) {
- SDL_SetError("Only cursors of dimension (%dx%d) are allowed",
- allowed_x, allowed_y);
- return(NULL);
- }
-
- /* Allocate the cursor */
- cursor = (WMcursor *)SDL_malloc(sizeof(WMcursor));
- if ( cursor == NULL ) {
- SDL_OutOfMemory();
- return(NULL);
- }
- cursor->bits = (char *)SDL_malloc(4+2*((allowed_x/8)*allowed_y));
- if ( cursor->bits == NULL ) {
- SDL_free(cursor);
- SDL_OutOfMemory();
- return(NULL);
- }
- cursor->bits[0] = allowed_y; /* Size of the cursor */
- cursor->bits[1] = 1; /* Bit depth of cursor */
- cursor->bits[2] = hot_y;
- cursor->bits[3] = hot_x;
- cptr = &cursor->bits[4];
-
- /* Pad out to the normal cursor size */
- run = PADDED_BITS(w);
- pad = PADDED_BITS(allowed_x)-run;
- for ( i=0; i<h; ++i ) {
- SDL_memcpy(cptr, data, run);
- SDL_memset(cptr+run, 0, pad);
- data += run;
- cptr += (run+pad);
- }
- for ( ; i<allowed_y; ++i ) {
- SDL_memset(cptr, 0, run+pad);
- cptr += (run+pad);
- }
- for ( i=0; i<h; ++i ) {
- /* FIXME: The mask should be OR'd with the data to turn
- inverted color pixels black, since inverted color pixels
- aren't supported under BeOS.
- */
- SDL_memcpy(cptr, mask, run);
- SDL_memset(cptr+run, 0, pad);
- mask += run;
- cptr += (run+pad);
- }
- for ( ; i<allowed_y; ++i ) {
- SDL_memset(cptr, 0, run+pad);
- cptr += (run+pad);
- }
- return(cursor);
-}
-
-int BE_ShowWMCursor(_THIS, WMcursor *cursor)
-{
- if ( be_app->Lock() ) {
- if ( cursor == NULL ) {
- if ( SDL_BlankCursor != NULL ) {
- be_app->SetCursor(SDL_BlankCursor->bits);
- }
- } else {
- be_app->SetCursor(cursor->bits);
- }
- be_app->Unlock();
- }
- return(1);
-}
-
-void BE_FreeWMCursor(_THIS, WMcursor *cursor)
-{
- SDL_free(cursor->bits);
- SDL_free(cursor);
-}
-
-/* Implementation by Christian Bauer <cbauer@student.physik.uni-mainz.de> */
-void BE_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
-{
- BPoint pt;
- SDL_Win->GetXYOffset(pt.x, pt.y);
- pt.x += x;
- pt.y += y;
- SDL_Win->Lock();
- SDL_Win->ConvertToScreen(&pt);
- SDL_Win->Unlock();
- set_mouse_position((int32)pt.x, (int32)pt.y);
-}
-
-/* Check to see if we need to enter or leave mouse relative mode */
-void BE_CheckMouseMode(_THIS)
-{
- /* If the mouse is hidden and input is grabbed, we use relative mode */
- if ( !(SDL_cursorstate & CURSOR_VISIBLE) &&
- (_this->input_grab != SDL_GRAB_OFF) ) {
- mouse_relative = 1;
- } else {
- mouse_relative = 0;
- }
-}
-
-}; /* Extern C */
diff --git a/distrib/sdl-1.2.12/src/video/bwindow/SDL_sysmouse_c.h b/distrib/sdl-1.2.12/src/video/bwindow/SDL_sysmouse_c.h
deleted file mode 100644
index 4f4844e..0000000
--- a/distrib/sdl-1.2.12/src/video/bwindow/SDL_sysmouse_c.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_lowvideo.h"
-
-/* Functions to be exported */
-extern void BE_FreeWMCursor(_THIS, WMcursor *cursor);
-extern WMcursor *BE_CreateWMCursor(_THIS,
- Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
-extern int BE_ShowWMCursor(_THIS, WMcursor *cursor);
-extern void BE_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
-extern void BE_CheckMouseMode(_THIS);
-
diff --git a/distrib/sdl-1.2.12/src/video/bwindow/SDL_sysvideo.cc b/distrib/sdl-1.2.12/src/video/bwindow/SDL_sysvideo.cc
deleted file mode 100644
index 59edec6..0000000
--- a/distrib/sdl-1.2.12/src/video/bwindow/SDL_sysvideo.cc
+++ /dev/null
@@ -1,829 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* BWindow based framebuffer implementation */
-
-#include <unistd.h>
-
-#include "SDL_BWin.h"
-#include "SDL_timer.h"
-
-extern "C" {
-
-#include "../SDL_sysvideo.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_sysevents_c.h"
-#include "SDL_sysmouse_c.h"
-#include "SDL_syswm_c.h"
-#include "SDL_lowvideo.h"
-#include "../SDL_yuvfuncs.h"
-#include "SDL_sysyuv.h"
-#include "../blank_cursor.h"
-
-#define BEOS_HIDDEN_SIZE 32 /* starting hidden window size */
-
-/* Initialization/Query functions */
-static int BE_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **BE_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *BE_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static void BE_UpdateMouse(_THIS);
-static int BE_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
-static void BE_VideoQuit(_THIS);
-
-/* Hardware surface functions */
-static int BE_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int BE_LockHWSurface(_THIS, SDL_Surface *surface);
-static void BE_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static void BE_FreeHWSurface(_THIS, SDL_Surface *surface);
-
-static int BE_ToggleFullScreen(_THIS, int fullscreen);
-static SDL_Overlay *BE_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display);
-
-/* OpenGL functions */
-#if SDL_VIDEO_OPENGL
-static int BE_GL_LoadLibrary(_THIS, const char *path);
-static void* BE_GL_GetProcAddress(_THIS, const char *proc);
-static int BE_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
-static int BE_GL_MakeCurrent(_THIS);
-static void BE_GL_SwapBuffers(_THIS);
-#endif
-
-/* FB driver bootstrap functions */
-
-static int BE_Available(void)
-{
- return(1);
-}
-
-static void BE_DeleteDevice(SDL_VideoDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_VideoDevice *BE_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device ) {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *device->hidden));
- }
- if ( (device == NULL) || (device->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( device ) {
- SDL_free(device);
- }
- return(0);
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
-
- /* Set the function pointers */
- /* Initialization/Query functions */
- device->VideoInit = BE_VideoInit;
- device->ListModes = BE_ListModes;
- device->SetVideoMode = BE_SetVideoMode;
- device->ToggleFullScreen = BE_ToggleFullScreen;
- device->UpdateMouse = BE_UpdateMouse;
- device->CreateYUVOverlay = BE_CreateYUVOverlay;
- device->SetColors = BE_SetColors;
- device->UpdateRects = NULL;
- device->VideoQuit = BE_VideoQuit;
- /* Hardware acceleration functions */
- device->AllocHWSurface = BE_AllocHWSurface;
- device->CheckHWBlit = NULL;
- device->FillHWRect = NULL;
- device->SetHWColorKey = NULL;
- device->SetHWAlpha = NULL;
- device->LockHWSurface = BE_LockHWSurface;
- device->UnlockHWSurface = BE_UnlockHWSurface;
- device->FlipHWSurface = NULL;
- device->FreeHWSurface = BE_FreeHWSurface;
- /* Gamma support */
-#if SDL_VIDEO_OPENGL
- /* OpenGL support */
- device->GL_LoadLibrary = BE_GL_LoadLibrary;
- device->GL_GetProcAddress = BE_GL_GetProcAddress;
- device->GL_GetAttribute = BE_GL_GetAttribute;
- device->GL_MakeCurrent = BE_GL_MakeCurrent;
- device->GL_SwapBuffers = BE_GL_SwapBuffers;
-#endif
- /* Window manager functions */
- device->SetCaption = BE_SetWMCaption;
- device->SetIcon = NULL;
- device->IconifyWindow = BE_IconifyWindow;
- device->GrabInput = BE_GrabInput;
- device->GetWMInfo = BE_GetWMInfo;
- /* Cursor manager functions */
- device->FreeWMCursor = BE_FreeWMCursor;
- device->CreateWMCursor = BE_CreateWMCursor;
- device->ShowWMCursor = BE_ShowWMCursor;
- device->WarpWMCursor = BE_WarpWMCursor;
- device->MoveWMCursor = NULL;
- device->CheckMouseMode = BE_CheckMouseMode;
- /* Event manager functions */
- device->InitOSKeymap = BE_InitOSKeymap;
- device->PumpEvents = BE_PumpEvents;
-
- device->free = BE_DeleteDevice;
-
- /* Set the driver flags */
- device->handles_any_size = 1;
-
- return device;
-}
-
-VideoBootStrap BWINDOW_bootstrap = {
- "bwindow", "BDirectWindow graphics",
- BE_Available, BE_CreateDevice
-};
-
-static inline int ColorSpaceToBitsPerPixel(uint32 colorspace)
-{
- int bitsperpixel;
-
- bitsperpixel = 0;
- switch (colorspace) {
- case B_CMAP8:
- bitsperpixel = 8;
- break;
- case B_RGB15:
- case B_RGBA15:
- case B_RGB15_BIG:
- case B_RGBA15_BIG:
- bitsperpixel = 15;
- break;
- case B_RGB16:
- case B_RGB16_BIG:
- bitsperpixel = 16;
- break;
- case B_RGB32:
- case B_RGBA32:
- case B_RGB32_BIG:
- case B_RGBA32_BIG:
- bitsperpixel = 32;
- break;
- default:
- break;
- }
- return(bitsperpixel);
-}
-
-/* Function to sort the display_list in bscreen */
-static int CompareModes(const void *A, const void *B)
-{
- const display_mode *a = (display_mode *)A;
- const display_mode *b = (display_mode *)B;
-
- if ( a->space == b->space ) {
- return((b->virtual_width*b->virtual_height)-
- (a->virtual_width*a->virtual_height));
- } else {
- return(ColorSpaceToBitsPerPixel(b->space)-
- ColorSpaceToBitsPerPixel(a->space));
- }
-}
-
-/* Yes, this isn't the fastest it could be, but it works nicely */
-static int BE_AddMode(_THIS, int index, unsigned int w, unsigned int h)
-{
- SDL_Rect *mode;
- int i;
- int next_mode;
-
- /* Check to see if we already have this mode */
- if ( SDL_nummodes[index] > 0 ) {
- for ( i=SDL_nummodes[index]-1; i >= 0; --i ) {
- mode = SDL_modelist[index][i];
- if ( (mode->w == w) && (mode->h == h) ) {
-#ifdef BWINDOW_DEBUG
- fprintf(stderr, "We already have mode %dx%d at %d bytes per pixel\n", w, h, index+1);
-#endif
- return(0);
- }
- }
- }
-
- /* Set up the new video mode rectangle */
- mode = (SDL_Rect *)SDL_malloc(sizeof *mode);
- if ( mode == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
- mode->x = 0;
- mode->y = 0;
- mode->w = w;
- mode->h = h;
-#ifdef BWINDOW_DEBUG
- fprintf(stderr, "Adding mode %dx%d at %d bytes per pixel\n", w, h, index+1);
-#endif
-
- /* Allocate the new list of modes, and fill in the new mode */
- next_mode = SDL_nummodes[index];
- SDL_modelist[index] = (SDL_Rect **)
- SDL_realloc(SDL_modelist[index], (1+next_mode+1)*sizeof(SDL_Rect *));
- if ( SDL_modelist[index] == NULL ) {
- SDL_OutOfMemory();
- SDL_nummodes[index] = 0;
- SDL_free(mode);
- return(-1);
- }
- SDL_modelist[index][next_mode] = mode;
- SDL_modelist[index][next_mode+1] = NULL;
- SDL_nummodes[index]++;
-
- return(0);
-}
-
-int BE_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- display_mode *modes;
- uint32 i, nmodes;
- int bpp;
- BRect bounds;
-
- /* Initialize the Be Application for appserver interaction */
- if ( SDL_InitBeApp() < 0 ) {
- return(-1);
- }
-
- /* It is important that this be created after SDL_InitBeApp() */
- BScreen bscreen;
-
- /* Save the current display mode */
- bscreen.GetMode(&saved_mode);
- _this->info.current_w = saved_mode.virtual_width;
- _this->info.current_h = saved_mode.virtual_height;
-
- /* Determine the screen depth */
- vformat->BitsPerPixel = ColorSpaceToBitsPerPixel(bscreen.ColorSpace());
- if ( vformat->BitsPerPixel == 0 ) {
- SDL_SetError("Unknown BScreen colorspace: 0x%x",
- bscreen.ColorSpace());
- return(-1);
- }
-
- /* Get the video modes we can switch to in fullscreen mode */
- bscreen.GetModeList(&modes, &nmodes);
- SDL_qsort(modes, nmodes, sizeof *modes, CompareModes);
- for ( i=0; i<nmodes; ++i ) {
- bpp = ColorSpaceToBitsPerPixel(modes[i].space);
- //if ( bpp != 0 ) { // There are bugs in changing colorspace
- if ( modes[i].space == saved_mode.space ) {
- BE_AddMode(_this, ((bpp+7)/8)-1,
- modes[i].virtual_width,
- modes[i].virtual_height);
- }
- }
-
- /* Create the window and view */
- bounds.top = 0; bounds.left = 0;
- bounds.right = BEOS_HIDDEN_SIZE;
- bounds.bottom = BEOS_HIDDEN_SIZE;
- SDL_Win = new SDL_BWin(bounds);
-
-#if SDL_VIDEO_OPENGL
- /* testgl application doesn't load library, just tries to load symbols */
- /* is it correct? if so we have to load library here */
- BE_GL_LoadLibrary(_this, NULL);
-#endif
-
- /* Create the clear cursor */
- SDL_BlankCursor = BE_CreateWMCursor(_this, blank_cdata, blank_cmask,
- BLANK_CWIDTH, BLANK_CHEIGHT, BLANK_CHOTX, BLANK_CHOTY);
-
- /* Fill in some window manager capabilities */
- _this->info.wm_available = 1;
-
- /* We're done! */
- return(0);
-}
-
-/* We support any dimension at our bit-depth */
-SDL_Rect **BE_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- SDL_Rect **modes;
-
- modes = ((SDL_Rect **)0);
- if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
- modes = SDL_modelist[((format->BitsPerPixel+7)/8)-1];
- } else {
- if ( format->BitsPerPixel ==
- _this->screen->format->BitsPerPixel ) {
- modes = ((SDL_Rect **)-1);
- }
- }
- return(modes);
-}
-
-/* Various screen update functions available */
-static void BE_NormalUpdate(_THIS, int numrects, SDL_Rect *rects);
-
-
-/* Find the closest display mode for fullscreen */
-static bool BE_FindClosestFSMode(_THIS, int width, int height, int bpp,
- display_mode *mode)
-{
- BScreen bscreen;
- uint32 i, nmodes;
- SDL_Rect **modes;
- display_mode *dmodes;
- display_mode current;
- float current_refresh;
- bscreen.GetMode(&current);
- current_refresh = (1000 * current.timing.pixel_clock) /
- (current.timing.h_total * current.timing.v_total);
-
- modes = SDL_modelist[((bpp+7)/8)-1];
- for ( i=0; modes[i] && (modes[i]->w > width) &&
- (modes[i]->h > height); ++i ) {
- /* still looking */
- }
- if ( ! modes[i] || (modes[i]->w < width) || (modes[i]->h < width) ) {
- --i; /* We went too far */
- }
-
- width = modes[i]->w;
- height = modes[i]->h;
-
- bscreen.GetModeList(&dmodes, &nmodes);
- for ( i = 0; i < nmodes; ++i ) {
- if ( (bpp == ColorSpaceToBitsPerPixel(dmodes[i].space)) &&
- (width == dmodes[i].virtual_width) &&
- (height == dmodes[i].virtual_height) ) {
- break;
- }
- }
- if ( i != nmodes ) {
- *mode = dmodes[i];
- if ((mode->virtual_width <= current.virtual_width) &&
- (mode->virtual_height <= current.virtual_height)) {
- float new_refresh = (1000 * mode->timing.pixel_clock) /
- (mode->timing.h_total * mode->timing.v_total);
- if (new_refresh < current_refresh) {
- mode->timing.pixel_clock = (uint32)((mode->timing.h_total * mode->timing.v_total)
- * current_refresh / 1000);
- }
- }
- return true;
- } else {
- return false;
- }
-}
-
-static int BE_SetFullScreen(_THIS, SDL_Surface *screen, int fullscreen)
-{
- int was_fullscreen;
- bool needs_unlock;
- BScreen bscreen;
- BRect bounds;
- display_mode mode;
- int width, height, bpp;
-
- /* Set the fullscreen mode */
- was_fullscreen = SDL_Win->IsFullScreen();
- SDL_Win->SetFullScreen(fullscreen);
- fullscreen = SDL_Win->IsFullScreen();
-
- width = screen->w;
- height = screen->h;
-
- /* Set the appropriate video mode */
- if ( fullscreen ) {
- bpp = screen->format->BitsPerPixel;
- bscreen.GetMode(&mode);
- if ( (bpp != ColorSpaceToBitsPerPixel(mode.space)) ||
- (width != mode.virtual_width) ||
- (height != mode.virtual_height)) {
- if(BE_FindClosestFSMode(_this, width, height, bpp, &mode)) {
- bscreen.SetMode(&mode);
- /* This simply stops the next resize event from being
- * sent to the SDL handler.
- */
- SDL_Win->InhibitResize();
- } else {
- fullscreen = 0;
- SDL_Win->SetFullScreen(fullscreen);
- }
- }
- }
- if ( was_fullscreen && ! fullscreen ) {
- bscreen.SetMode(&saved_mode);
- }
-
- if ( SDL_Win->Lock() ) {
- int cx, cy;
- if ( SDL_Win->Shown() ) {
- needs_unlock = 1;
- SDL_Win->Hide();
- } else {
- needs_unlock = 0;
- }
- /* This resizes the window and view area, but inhibits resizing
- * of the BBitmap due to the InhibitResize call above. Thus the
- * bitmap (pixel data) never changes.
- */
- SDL_Win->ResizeTo(width, height);
- bounds = bscreen.Frame();
- /* Calculate offsets - used either to center window
- * (windowed mode) or to set drawing offsets (fullscreen mode)
- */
- cx = (bounds.IntegerWidth() - width)/2;
- cy = (bounds.IntegerHeight() - height)/2;
-
- if ( fullscreen ) {
- /* Set offset for drawing */
- SDL_Win->SetXYOffset(cx, cy);
- } else {
- SDL_Win->SetXYOffset(0, 0);
- }
- if ( ! needs_unlock || was_fullscreen ) {
- /* Center the window the first time */
- SDL_Win->MoveTo(cx, cy);
- }
- SDL_Win->Show();
-
- /* Unlock the window manually after the first Show() */
- if ( needs_unlock ) {
- SDL_Win->Unlock();
- }
- }
-
- /* Set the fullscreen flag in the screen surface */
- if ( fullscreen ) {
- screen->flags |= SDL_FULLSCREEN;
- } else {
- screen->flags &= ~SDL_FULLSCREEN;
- }
- return(1);
-}
-
-static int BE_ToggleFullScreen(_THIS, int fullscreen)
-{
- return BE_SetFullScreen(_this, _this->screen, fullscreen);
-}
-
-/* FIXME: check return values and cleanup here */
-SDL_Surface *BE_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- BScreen bscreen;
- BBitmap *bbitmap;
- BRect bounds;
- Uint32 gl_flags = 0;
-
- /* Only RGB works on r5 currently */
- gl_flags = BGL_RGB;
- if (_this->gl_config.double_buffer)
- gl_flags |= BGL_DOUBLE;
- else
- gl_flags |= BGL_SINGLE;
- if (_this->gl_config.alpha_size > 0 || bpp == 32)
- gl_flags |= BGL_ALPHA;
- if (_this->gl_config.depth_size > 0)
- gl_flags |= BGL_DEPTH;
- if (_this->gl_config.stencil_size > 0)
- gl_flags |= BGL_STENCIL;
- if (_this->gl_config.accum_red_size > 0
- || _this->gl_config.accum_green_size > 0
- || _this->gl_config.accum_blue_size > 0
- || _this->gl_config.accum_alpha_size > 0)
- gl_flags |= BGL_ACCUM;
-
- /* Create the view for this window, using found flags */
- if ( SDL_Win->CreateView(flags, gl_flags) < 0 ) {
- return(NULL);
- }
-
- current->flags = 0; /* Clear flags */
- current->w = width;
- current->h = height;
- SDL_Win->SetType(B_TITLED_WINDOW);
- if ( flags & SDL_NOFRAME ) {
- current->flags |= SDL_NOFRAME;
- SDL_Win->SetLook(B_NO_BORDER_WINDOW_LOOK);
- } else {
- if ( (flags & SDL_RESIZABLE) && !(flags & SDL_OPENGL) ) {
- current->flags |= SDL_RESIZABLE;
- /* We don't want opaque resizing (TM). :-) */
- SDL_Win->SetFlags(B_OUTLINE_RESIZE);
- } else {
- SDL_Win->SetFlags(B_NOT_RESIZABLE|B_NOT_ZOOMABLE);
- }
- }
-
- if ( flags & SDL_OPENGL ) {
- current->flags |= SDL_OPENGL;
- current->pitch = 0;
- current->pixels = NULL;
- _this->UpdateRects = NULL;
- } else {
- /* Create the BBitmap framebuffer */
- bounds.top = 0; bounds.left = 0;
- bounds.right = width-1;
- bounds.bottom = height-1;
- bbitmap = new BBitmap(bounds, bscreen.ColorSpace());
- if ( ! bbitmap->IsValid() ) {
- SDL_SetError("Couldn't create screen bitmap");
- delete bbitmap;
- return(NULL);
- }
- current->pitch = bbitmap->BytesPerRow();
- current->pixels = (void *)bbitmap->Bits();
- SDL_Win->SetBitmap(bbitmap);
- _this->UpdateRects = BE_NormalUpdate;
- }
-
- /* Set the correct fullscreen mode */
- BE_SetFullScreen(_this, current, flags & SDL_FULLSCREEN ? 1 : 0);
-
- /* We're done */
- return(current);
-}
-
-/* Update the current mouse state and position */
-void BE_UpdateMouse(_THIS)
-{
- BPoint point;
- uint32 buttons;
-
- if ( SDL_Win->Lock() ) {
- /* Get new input state, if still active */
- if ( SDL_Win->IsActive() ) {
- (SDL_Win->View())->GetMouse(&point, &buttons, true);
- } else {
- point.x = -1;
- point.y = -1;
- }
- SDL_Win->Unlock();
-
- if ( (point.x >= 0) && (point.x < SDL_VideoSurface->w) &&
- (point.y >= 0) && (point.y < SDL_VideoSurface->h) ) {
- SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
- SDL_PrivateMouseMotion(0, 0,
- (Sint16)point.x, (Sint16)point.y);
- } else {
- SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
- }
- }
-}
-
-/* We don't actually allow hardware surfaces other than the main one */
-static int BE_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- return(-1);
-}
-static void BE_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-static int BE_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- return(0);
-}
-static void BE_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-static void BE_NormalUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- if ( SDL_Win->BeginDraw() ) {
- int i;
-
- for ( i=0; i<numrects; ++i ) {
- BRect rect;
-
- rect.top = rects[i].y;
- rect.left = rects[i].x;
- rect.bottom = rect.top+rects[i].h-1;
- rect.right = rect.left+rects[i].w-1;
- SDL_Win->DrawAsync(rect);
- }
- SDL_Win->EndDraw();
- }
-}
-
-#if SDL_VIDEO_OPENGL
-/* Passing a NULL path means load pointers from the application */
-int BE_GL_LoadLibrary(_THIS, const char *path)
-{
- if (path == NULL) {
- if (_this->gl_config.dll_handle == NULL) {
- image_info info;
- int32 cookie = 0;
- while (get_next_image_info(0,&cookie,&info) == B_OK) {
- void *location = NULL;
- if (get_image_symbol((image_id)cookie,"glBegin",B_SYMBOL_TYPE_ANY,&location) == B_OK) {
- _this->gl_config.dll_handle = (void*)cookie;
- _this->gl_config.driver_loaded = 1;
- SDL_strlcpy(_this->gl_config.driver_path, "libGL.so", SDL_arraysize(_this->gl_config.driver_path));
- }
- }
- }
- } else {
- /*
- FIXME None of BeOS libGL.so implementations have exported functions
- to load BGLView, which should be reloaded from new lib.
- So for now just "load" linked libGL.so :(
- */
- if (_this->gl_config.dll_handle == NULL) {
- return BE_GL_LoadLibrary(_this, NULL);
- }
-
- /* Unload old first */
- /*if (_this->gl_config.dll_handle != NULL) {*/
- /* Do not try to unload application itself (if LoadLibrary was called before with NULL ;) */
- /* image_info info;
- if (get_image_info((image_id)_this->gl_config.dll_handle, &info) == B_OK) {
- if (info.type != B_APP_IMAGE) {
- unload_add_on((image_id)_this->gl_config.dll_handle);
- }
- }
-
- }
-
- if ((_this->gl_config.dll_handle = (void*)load_add_on(path)) != (void*)B_ERROR) {
- _this->gl_config.driver_loaded = 1;
- SDL_strlcpy(_this->gl_config.driver_path, path, SDL_arraysize(_this->gl_config.driver_path));
- }*/
- }
-
- if (_this->gl_config.dll_handle != NULL) {
- return 0;
- } else {
- _this->gl_config.dll_handle = NULL;
- _this->gl_config.driver_loaded = 0;
- *_this->gl_config.driver_path = '\0';
- return -1;
- }
-}
-
-void* BE_GL_GetProcAddress(_THIS, const char *proc)
-{
- if (_this->gl_config.dll_handle != NULL) {
- void *location = NULL;
- status_t err;
- if ((err = get_image_symbol((image_id)_this->gl_config.dll_handle, proc, B_SYMBOL_TYPE_ANY, &location)) == B_OK) {
- return location;
- } else {
- SDL_SetError("Couldn't find OpenGL symbol");
- return NULL;
- }
- } else {
- SDL_SetError("OpenGL library not loaded");
- return NULL;
- }
-}
-
-int BE_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
-{
- /*
- FIXME? Right now BE_GL_GetAttribute shouldn't be called between glBegin() and glEnd() - it doesn't use "cached" values
- */
- switch (attrib)
- {
- case SDL_GL_RED_SIZE:
- glGetIntegerv(GL_RED_BITS, (GLint*)value);
- break;
- case SDL_GL_GREEN_SIZE:
- glGetIntegerv(GL_GREEN_BITS, (GLint*)value);
- break;
- case SDL_GL_BLUE_SIZE:
- glGetIntegerv(GL_BLUE_BITS, (GLint*)value);
- break;
- case SDL_GL_ALPHA_SIZE:
- glGetIntegerv(GL_ALPHA_BITS, (GLint*)value);
- break;
- case SDL_GL_DOUBLEBUFFER:
- glGetBooleanv(GL_DOUBLEBUFFER, (GLboolean*)value);
- break;
- case SDL_GL_BUFFER_SIZE:
- int v;
- glGetIntegerv(GL_RED_BITS, (GLint*)&v);
- *value = v;
- glGetIntegerv(GL_GREEN_BITS, (GLint*)&v);
- *value += v;
- glGetIntegerv(GL_BLUE_BITS, (GLint*)&v);
- *value += v;
- glGetIntegerv(GL_ALPHA_BITS, (GLint*)&v);
- *value += v;
- break;
- case SDL_GL_DEPTH_SIZE:
- glGetIntegerv(GL_DEPTH_BITS, (GLint*)value); /* Mesa creates 16 only? r5 always 32 */
- break;
- case SDL_GL_STENCIL_SIZE:
- glGetIntegerv(GL_STENCIL_BITS, (GLint*)value);
- break;
- case SDL_GL_ACCUM_RED_SIZE:
- glGetIntegerv(GL_ACCUM_RED_BITS, (GLint*)value);
- break;
- case SDL_GL_ACCUM_GREEN_SIZE:
- glGetIntegerv(GL_ACCUM_GREEN_BITS, (GLint*)value);
- break;
- case SDL_GL_ACCUM_BLUE_SIZE:
- glGetIntegerv(GL_ACCUM_BLUE_BITS, (GLint*)value);
- break;
- case SDL_GL_ACCUM_ALPHA_SIZE:
- glGetIntegerv(GL_ACCUM_ALPHA_BITS, (GLint*)value);
- break;
- case SDL_GL_STEREO:
- case SDL_GL_MULTISAMPLEBUFFERS:
- case SDL_GL_MULTISAMPLESAMPLES:
- default:
- *value=0;
- return(-1);
- }
- return 0;
-}
-
-int BE_GL_MakeCurrent(_THIS)
-{
- /* FIXME: should we glview->unlock and then glview->lock()? */
- return 0;
-}
-
-void BE_GL_SwapBuffers(_THIS)
-{
- SDL_Win->SwapBuffers();
-}
-#endif
-
-/* Is the system palette settable? */
-int BE_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- int i;
- SDL_Palette *palette;
- const color_map *cmap = BScreen().ColorMap();
-
- /* Get the screen colormap */
- palette = _this->screen->format->palette;
- for ( i=0; i<256; ++i ) {
- palette->colors[i].r = cmap->color_list[i].red;
- palette->colors[i].g = cmap->color_list[i].green;
- palette->colors[i].b = cmap->color_list[i].blue;
- }
- return(0);
-}
-
-void BE_VideoQuit(_THIS)
-{
- int i, j;
-
- SDL_Win->Quit();
- SDL_Win = NULL;
-
- if ( SDL_BlankCursor != NULL ) {
- BE_FreeWMCursor(_this, SDL_BlankCursor);
- SDL_BlankCursor = NULL;
- }
- for ( i=0; i<NUM_MODELISTS; ++i ) {
- if ( SDL_modelist[i] ) {
- for ( j=0; SDL_modelist[i][j]; ++j ) {
- SDL_free(SDL_modelist[i][j]);
- }
- SDL_free(SDL_modelist[i]);
- SDL_modelist[i] = NULL;
- }
- }
- /* Restore the original video mode */
- if ( _this->screen ) {
- if ( (_this->screen->flags&SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
- BScreen bscreen;
- bscreen.SetMode(&saved_mode);
- }
- _this->screen->pixels = NULL;
- }
-
-#if SDL_VIDEO_OPENGL
- if (_this->gl_config.dll_handle != NULL)
- unload_add_on((image_id)_this->gl_config.dll_handle);
-#endif
-
- SDL_QuitBeApp();
-}
-
-}; /* Extern C */
diff --git a/distrib/sdl-1.2.12/src/video/bwindow/SDL_syswm.cc b/distrib/sdl-1.2.12/src/video/bwindow/SDL_syswm.cc
deleted file mode 100644
index 1083caf..0000000
--- a/distrib/sdl-1.2.12/src/video/bwindow/SDL_syswm.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_BWin.h"
-
-extern "C" {
-#include "SDL_syswm_c.h"
-#include "SDL_error.h"
-#include "../SDL_cursor_c.h"
-
-void BE_SetWMCaption(_THIS, const char *title, const char *icon)
-{
- SDL_Win->SetTitle(title);
-}
-
-int BE_IconifyWindow(_THIS)
-{
- SDL_Win->Minimize(true);
-}
-
-SDL_GrabMode BE_GrabInput(_THIS, SDL_GrabMode mode)
-{
- if ( mode == SDL_GRAB_OFF ) {
-// be_app->ShowCursor();
- if ( !(SDL_cursorstate & CURSOR_VISIBLE) ) {
- /* BeSman: Jan 2, 2006
- must be leaving relative mode, move mouse from
- center of window to where it belongs ... */
- BPoint pt;
- int x, y;
- SDL_GetMouseState(&x,&y);
- pt.x = x;
- pt.y = y;
- SDL_Win->Lock();
- SDL_Win->ConvertToScreen(&pt);
- SDL_Win->Unlock();
- set_mouse_position((int)pt.x, (int)pt.y);
- }
- } else {
-// be_app->HideCursor();
- if ( !(SDL_cursorstate & CURSOR_VISIBLE) ) {
- /* BeSman: Jan 2, 2006
- must be entering relative mode, get ready by
- moving mouse to center of window ... */
- BPoint pt;
- pt.x = (SDL_VideoSurface->w/2);
- pt.y = (SDL_VideoSurface->h/2);
- SDL_Win->Lock();
- SDL_Win->ConvertToScreen(&pt);
- SDL_Win->Unlock();
- set_mouse_position((int)pt.x, (int)pt.y);
- }
- }
- return(mode);
-}
-
-int BE_GetWMInfo(_THIS, SDL_SysWMinfo *info)
-{
- if (info->version.major <= SDL_MAJOR_VERSION)
- {
- return 1;
- }
- else
- {
- SDL_SetError("Application not compiled with SDL %d.%d\n",
- SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
- return -1;
- }
-}
-
-}; /* Extern C */
diff --git a/distrib/sdl-1.2.12/src/video/bwindow/SDL_syswm_c.h b/distrib/sdl-1.2.12/src/video/bwindow/SDL_syswm_c.h
deleted file mode 100644
index 0d33c5e..0000000
--- a/distrib/sdl-1.2.12/src/video/bwindow/SDL_syswm_c.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_syswm.h"
-#include "SDL_lowvideo.h"
-
-
-/* Functions to be exported */
-extern void BE_SetWMCaption(_THIS, const char *title, const char *icon);
-extern int BE_IconifyWindow(_THIS);
-extern int BE_GetWMInfo(_THIS, SDL_SysWMinfo *info);
-extern SDL_GrabMode BE_GrabInput(_THIS, SDL_GrabMode mode); \ No newline at end of file
diff --git a/distrib/sdl-1.2.12/src/video/bwindow/SDL_sysyuv.cc b/distrib/sdl-1.2.12/src/video/bwindow/SDL_sysyuv.cc
deleted file mode 100644
index 557a120..0000000
--- a/distrib/sdl-1.2.12/src/video/bwindow/SDL_sysyuv.cc
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This is the BeOS version of SDL YUV video overlays */
-
-#include "SDL_video.h"
-#include "SDL_sysyuv.h"
-#include "../SDL_yuvfuncs.h"
-
-extern "C" {
-
-/* The functions used to manipulate software video overlays */
-static struct private_yuvhwfuncs be_yuvfuncs =
-{
- BE_LockYUVOverlay,
- BE_UnlockYUVOverlay,
- BE_DisplayYUVOverlay,
- BE_FreeYUVOverlay
-};
-
-BBitmap * BE_GetOverlayBitmap(BRect bounds, color_space cs) {
- BBitmap *bbitmap;
- bbitmap = new BBitmap(bounds,B_BITMAP_WILL_OVERLAY,cs);
- if (!bbitmap || bbitmap->InitCheck() != B_OK) {
- delete bbitmap;
- return 0;
- }
- overlay_restrictions r;
- bbitmap->GetOverlayRestrictions(&r);
- uint32 width = bounds.IntegerWidth() + 1;
- uint32 height = bounds.IntegerHeight() + 1;
- uint32 width_padding = 0;
- uint32 height_padding = 0;
- if ((r.source.horizontal_alignment != 0) ||
- (r.source.vertical_alignment != 0)) {
- delete bbitmap;
- return 0;
- }
- if (r.source.width_alignment != 0) {
- uint32 aligned_width = r.source.width_alignment + 1;
- if (width % aligned_width > 0) {
- width_padding = aligned_width - width % aligned_width;
- }
- }
- if (r.source.height_alignment != 0) {
- uint32 aligned_height = r.source.height_alignment + 1;
- if (height % aligned_height > 0) {
- fprintf(stderr,"GetOverlayBitmap failed height alignment\n");
- fprintf(stderr,"- height = %lu, aligned_height = %lu\n",height,aligned_height);
- delete bbitmap;
- return 0;
- }
- }
- if ((r.source.min_width > width) ||
- (r.source.min_height > height) ||
- (r.source.max_width < width) ||
- (r.source.max_height < height)) {
- fprintf(stderr,"GetOverlayBitmap failed bounds tests\n");
- delete bbitmap;
- return 0;
- }
- if ((width_padding != 0) || (height_padding != 0)) {
- delete bbitmap;
- bounds.Set(bounds.left,bounds.top,bounds.right+width_padding,bounds.bottom+height_padding);
- bbitmap = new BBitmap(bounds,B_BITMAP_WILL_OVERLAY,cs);
- if (!bbitmap || bbitmap->InitCheck() != B_OK) {
- fprintf(stderr,"GetOverlayBitmap failed late\n");
- delete bbitmap;
- return 0;
- }
- }
- return bbitmap;
-}
-
-// See <GraphicsDefs.h> [btw: Cb=U, Cr=V]
-// See also http://www.fourcc.org/indexyuv.htm
-enum color_space convert_color_space(Uint32 format) {
- switch (format) {
- case SDL_YV12_OVERLAY:
- return B_YUV9;
- case SDL_IYUV_OVERLAY:
- return B_YUV12;
- case SDL_YUY2_OVERLAY:
- return B_YCbCr422;
- case SDL_UYVY_OVERLAY:
- return B_YUV422;
- case SDL_YVYU_OVERLAY: // not supported on beos?
- return B_NO_COLOR_SPACE;
- default:
- return B_NO_COLOR_SPACE;
- }
-}
-
-// See SDL_video.h
-int count_planes(Uint32 format) {
- switch (format) {
- case SDL_YV12_OVERLAY:
- case SDL_IYUV_OVERLAY:
- return 3;
- case SDL_YUY2_OVERLAY:
- case SDL_UYVY_OVERLAY:
- case SDL_YVYU_OVERLAY:
- return 1;
- default:
- return 0;
- }
-}
-
-SDL_Overlay *BE_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display) {
- SDL_Overlay* overlay;
- struct private_yuvhwdata* hwdata;
- BBitmap *bbitmap;
- int planes;
- BRect bounds;
- color_space cs;
-
- /* find the appropriate BeOS colorspace descriptor */
- cs = convert_color_space(format);
- if (cs == B_NO_COLOR_SPACE)
- {
- return NULL;
- }
-
- /* count planes */
- planes = count_planes(format);
- if (planes == 0)
- {
- return NULL;
- }
- /* TODO: figure out planar modes, if anyone cares */
- if (planes == 3)
- {
- return NULL;
- }
-
- /* Create the overlay structure */
- overlay = (SDL_Overlay*)SDL_calloc(1, sizeof(SDL_Overlay));
-
- if (overlay == NULL)
- {
- SDL_OutOfMemory();
- return NULL;
- }
-
- /* Fill in the basic members */
- overlay->format = format;
- overlay->w = width;
- overlay->h = height;
- overlay->hwdata = NULL;
-
- /* Set up the YUV surface function structure */
- overlay->hwfuncs = &be_yuvfuncs;
-
- /* Create the pixel data and lookup tables */
- hwdata = (struct private_yuvhwdata*)SDL_calloc(1, sizeof(struct private_yuvhwdata));
-
- if (hwdata == NULL)
- {
- SDL_OutOfMemory();
- SDL_FreeYUVOverlay(overlay);
- return NULL;
- }
-
- overlay->hwdata = hwdata;
- overlay->hwdata->display = display;
- overlay->hwdata->bview = NULL;
- overlay->hwdata->bbitmap = NULL;
- overlay->hwdata->locked = 0;
-
- /* Create the BBitmap framebuffer */
- bounds.top = 0; bounds.left = 0;
- bounds.right = width-1;
- bounds.bottom = height-1;
-
- BView * bview = new BView(bounds,"overlay",B_FOLLOW_NONE,B_WILL_DRAW);
- if (!bview) {
- SDL_OutOfMemory();
- SDL_FreeYUVOverlay(overlay);
- return NULL;
- }
- overlay->hwdata->bview = bview;
- overlay->hwdata->first_display = true;
- bview->Hide();
-
- bbitmap = BE_GetOverlayBitmap(bounds,cs);
- if (!bbitmap) {
- overlay->hwdata->bbitmap = NULL;
- SDL_FreeYUVOverlay(overlay);
- return NULL;
- }
- overlay->hwdata->bbitmap = bbitmap;
-
- overlay->planes = planes;
- overlay->pitches = (Uint16*)SDL_calloc(overlay->planes, sizeof(Uint16));
- overlay->pixels = (Uint8**)SDL_calloc(overlay->planes, sizeof(Uint8*));
- if (!overlay->pitches || !overlay->pixels)
- {
- SDL_OutOfMemory();
- SDL_FreeYUVOverlay(overlay);
- return(NULL);
- }
-
- overlay->pitches[0] = bbitmap->BytesPerRow();
- overlay->pixels[0] = (Uint8 *)bbitmap->Bits();
- overlay->hw_overlay = 1;
-
- if (SDL_Win->LockWithTimeout(1000000) != B_OK) {
- SDL_FreeYUVOverlay(overlay);
- return(NULL);
- }
- BView * view = SDL_Win->View();
- view->AddChild(bview);
- rgb_color key;
- bview->SetViewOverlay(bbitmap,bounds,bview->Bounds(),&key,B_FOLLOW_ALL,
- B_OVERLAY_FILTER_HORIZONTAL|B_OVERLAY_FILTER_VERTICAL);
- bview->SetViewColor(key);
- bview->Flush();
- SDL_Win->Unlock();
-
- current_overlay=overlay;
-
- return overlay;
-}
-
-int BE_LockYUVOverlay(_THIS, SDL_Overlay* overlay)
-{
- if (overlay == NULL)
- {
- return 0;
- }
-
- overlay->hwdata->locked = 1;
- return 0;
-}
-
-void BE_UnlockYUVOverlay(_THIS, SDL_Overlay* overlay)
-{
- if (overlay == NULL)
- {
- return;
- }
-
- overlay->hwdata->locked = 0;
-}
-
-int BE_DisplayYUVOverlay(_THIS, SDL_Overlay* overlay, SDL_Rect* src, SDL_Rect *dst)
-{
- if ((overlay == NULL) || (overlay->hwdata==NULL)
- || (overlay->hwdata->bview==NULL) || (SDL_Win->View() == NULL))
- {
- return -1;
- }
- if (SDL_Win->LockWithTimeout(50000) != B_OK) {
- return 0;
- }
- BView * bview = overlay->hwdata->bview;
- if (SDL_Win->IsFullScreen()) {
- int left,top;
- SDL_Win->GetXYOffset(left,top);
- bview->MoveTo(left+dst->x,top+dst->y);
- } else {
- bview->MoveTo(dst->x,dst->y);
- }
- bview->ResizeTo(dst->w,dst->h);
- bview->Flush();
- if (overlay->hwdata->first_display) {
- bview->Show();
- overlay->hwdata->first_display = false;
- }
- SDL_Win->Unlock();
-
- return 0;
-}
-
-void BE_FreeYUVOverlay(_THIS, SDL_Overlay *overlay)
-{
- if (overlay == NULL)
- {
- return;
- }
-
- if (overlay->hwdata == NULL)
- {
- return;
- }
-
- current_overlay=NULL;
-
- delete overlay->hwdata->bbitmap;
-
- SDL_free(overlay->hwdata);
-}
-
-}; // extern "C"
diff --git a/distrib/sdl-1.2.12/src/video/bwindow/SDL_sysyuv.h b/distrib/sdl-1.2.12/src/video/bwindow/SDL_sysyuv.h
deleted file mode 100644
index 64859f2..0000000
--- a/distrib/sdl-1.2.12/src/video/bwindow/SDL_sysyuv.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-
-#ifndef __SDL_SYS_YUV_H__
-#define __SDL_SYS_YUV_H__
-
-/* This is the BeOS implementation of YUV video overlays */
-
-#include "SDL_video.h"
-#include "SDL_lowvideo.h"
-
-extern "C" {
-
-struct private_yuvhwdata
-{
-/* FRAMEDATA* CurrentFrameData;
- FRAMEDATA* FrameData0;
- FRAMEDATA* FrameData1;
- PgScalerProps_t props;
- PgScalerCaps_t caps;
- PgVideoChannel_t* channel;
- PhArea_t CurrentViewPort;
- PhPoint_t CurrentWindowPos;
- long format;
- int scaler_on;
- int current;
- long YStride;
- long VStride;
- long UStride;
- int ischromakey;
- long chromakey;
- int forcedredraw;
- unsigned long State;
- long flags;
-*/
- SDL_Surface *display;
- BView *bview;
- bool first_display;
- BBitmap *bbitmap;
- int locked;
-};
-
-extern BBitmap * BE_GetOverlayBitmap(BRect bounds, color_space cs);
-extern SDL_Overlay* BE_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface* display);
-extern int BE_LockYUVOverlay(_THIS, SDL_Overlay* overlay);
-extern void BE_UnlockYUVOverlay(_THIS, SDL_Overlay* overlay);
-extern int BE_DisplayYUVOverlay(_THIS, SDL_Overlay* overlay, SDL_Rect* src, SDL_Rect* dst);
-extern void BE_FreeYUVOverlay(_THIS, SDL_Overlay* overlay);
-
-};
-
-#endif /* __SDL_PH_YUV_H__ */
diff --git a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_amigaevents.c b/distrib/sdl-1.2.12/src/video/cybergfx/SDL_amigaevents.c
deleted file mode 100644
index 333d0fa..0000000
--- a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_amigaevents.c
+++ /dev/null
@@ -1,535 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Handle the event stream, converting Amiga events into SDL events */
-#include "SDL.h"
-
-#include "SDL_syswm.h"
-#include "../SDL_sysvideo.h"
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_cgxvideo.h"
-#include "SDL_cgxmodes_c.h"
-#include "SDL_cgximage_c.h"
-#include "SDL_cgxwm_c.h"
-#include "SDL_amigaevents_c.h"
-
-
-/* The translation tables from an Amiga keysym to a SDL keysym */
-static SDLKey MISC_keymap[256];
-SDL_keysym *amiga_TranslateKey(int code, SDL_keysym *keysym);
-struct IOStdReq *ConReq=NULL;
-struct MsgPort *ConPort=NULL;
-
-/* Note: The X server buffers and accumulates mouse motion events, so
- the motion event generated by the warp may not appear exactly as we
- expect it to. We work around this (and improve performance) by only
- warping the pointer when it reaches the edge, and then wait for it.
-*/
-#define MOUSE_FUDGE_FACTOR 8
-
-#if 0
-
-static inline int amiga_WarpedMotion(_THIS, struct IntuiMessage *m)
-{
- int w, h, i;
- int deltax, deltay;
- int posted;
-
- w = SDL_VideoSurface->w;
- h = SDL_VideoSurface->h;
- deltax = xevent->xmotion.x - mouse_last.x;
- deltay = xevent->xmotion.y - mouse_last.y;
-#ifdef DEBUG_MOTION
- printf("Warped mouse motion: %d,%d\n", deltax, deltay);
-#endif
- mouse_last.x = xevent->xmotion.x;
- mouse_last.y = xevent->xmotion.y;
- posted = SDL_PrivateMouseMotion(0, 1, deltax, deltay);
-
- if ( (xevent->xmotion.x < MOUSE_FUDGE_FACTOR) ||
- (xevent->xmotion.x > (w-MOUSE_FUDGE_FACTOR)) ||
- (xevent->xmotion.y < MOUSE_FUDGE_FACTOR) ||
- (xevent->xmotion.y > (h-MOUSE_FUDGE_FACTOR)) ) {
- /* Get the events that have accumulated */
- while ( XCheckTypedEvent(SDL_Display, MotionNotify, xevent) ) {
- deltax = xevent->xmotion.x - mouse_last.x;
- deltay = xevent->xmotion.y - mouse_last.y;
-#ifdef DEBUG_MOTION
- printf("Extra mouse motion: %d,%d\n", deltax, deltay);
-#endif
- mouse_last.x = xevent->xmotion.x;
- mouse_last.y = xevent->xmotion.y;
- posted += SDL_PrivateMouseMotion(0, 1, deltax, deltay);
- }
- mouse_last.x = w/2;
- mouse_last.y = h/2;
- XWarpPointer(SDL_Display, None, SDL_Window, 0, 0, 0, 0,
- mouse_last.x, mouse_last.y);
- for ( i=0; i<10; ++i ) {
- XMaskEvent(SDL_Display, PointerMotionMask, xevent);
- if ( (xevent->xmotion.x >
- (mouse_last.x-MOUSE_FUDGE_FACTOR)) &&
- (xevent->xmotion.x <
- (mouse_last.x+MOUSE_FUDGE_FACTOR)) &&
- (xevent->xmotion.y >
- (mouse_last.y-MOUSE_FUDGE_FACTOR)) &&
- (xevent->xmotion.y <
- (mouse_last.y+MOUSE_FUDGE_FACTOR)) ) {
- break;
- }
-#ifdef DEBUG_XEVENTS
- printf("Lost mouse motion: %d,%d\n", xevent->xmotion.x, xevent->xmotion.y);
-#endif
- }
-#ifdef DEBUG_XEVENTS
- if ( i == 10 ) {
- printf("Warning: didn't detect mouse warp motion\n");
- }
-#endif
- }
- return(posted);
-}
-
-#endif
-
-static int amiga_GetButton(int code)
-{
- switch(code)
- {
- case IECODE_MBUTTON:
- return SDL_BUTTON_MIDDLE;
- case IECODE_RBUTTON:
- return SDL_BUTTON_RIGHT;
- default:
- return SDL_BUTTON_LEFT;
- }
-}
-
-static int amiga_DispatchEvent(_THIS,struct IntuiMessage *msg)
-{
- int class=msg->Class,code=msg->Code;
- int posted;
-
- posted = 0;
- switch (class) {
- /* Gaining mouse coverage? */
- case IDCMP_ACTIVEWINDOW:
- posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
- break;
-
- /* Losing mouse coverage? */
- case IDCMP_INACTIVEWINDOW:
- posted = SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
- break;
-#if 0
- /* Gaining input focus? */
- case IDCMP_ACTIVEWINDOW:
- posted = SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
-
- /* Queue entry into fullscreen mode */
- switch_waiting = 0x01 | SDL_FULLSCREEN;
- switch_time = SDL_GetTicks() + 1500;
- break;
-
- /* Losing input focus? */
- case IDCMP_INACTIVEWINDOW:
- posted = SDL_PrivateAppActive(0, SDL_APPINPUTFOCUS);
-
- /* Queue leaving fullscreen mode */
- switch_waiting = 0x01;
- switch_time = SDL_GetTicks() + 200;
- break;
-#endif
- /* Mouse motion? */
- case IDCMP_MOUSEMOVE:
- if ( SDL_VideoSurface ) {
- posted = SDL_PrivateMouseMotion(0, 0,
- msg->MouseX-SDL_Window->BorderLeft,
- msg->MouseY-SDL_Window->BorderTop);
- }
- break;
-
- /* Mouse button press? */
- case IDCMP_MOUSEBUTTONS:
-
- if(!(code&IECODE_UP_PREFIX))
- {
- posted = SDL_PrivateMouseButton(SDL_PRESSED,
- amiga_GetButton(code), 0, 0);
- }
- /* Mouse button release? */
- else
- {
- code&=~IECODE_UP_PREFIX;
- posted = SDL_PrivateMouseButton(SDL_RELEASED,
- amiga_GetButton(code), 0, 0);
- }
- break;
-
- case IDCMP_RAWKEY:
-
- /* Key press? */
-
- if( !(code&IECODE_UP_PREFIX) )
- {
- SDL_keysym keysym;
- posted = SDL_PrivateKeyboard(SDL_PRESSED,
- amiga_TranslateKey(code, &keysym));
- }
- else
- {
- /* Key release? */
-
- SDL_keysym keysym;
- code&=~IECODE_UP_PREFIX;
-
- /* Check to see if this is a repeated key */
-/* if ( ! X11_KeyRepeat(SDL_Display, &xevent) ) */
-
- posted = SDL_PrivateKeyboard(SDL_RELEASED,
- amiga_TranslateKey(code, &keysym));
- }
- break;
- /* Have we been iconified? */
-#if 0
- case UnmapNotify: {
-#ifdef DEBUG_XEVENTS
-printf("UnmapNotify!\n");
-#endif
- posted=SDL_PrivateAppActive(0, SDL_APPACTIVE|SDL_APPINPUTFOCUS);
- }
- break;
-
- /* Have we been restored? */
-
- case MapNotify: {
-#ifdef DEBUG_XEVENTS
-printf("MapNotify!\n");
-#endif
-
- posted = SDL_PrivateAppActive(1, SDL_APPACTIVE);
-
- if ( SDL_VideoSurface &&
- (SDL_VideoSurface->flags & SDL_FULLSCREEN) )
- {
- CGX_EnterFullScreen(this);
- } else {
- X11_GrabInputNoLock(this, this->input_grab);
- }
- if ( SDL_VideoSurface ) {
- CGX_RefreshDisplay(this);
- }
- }
- break;
- case Expose:
- if ( SDL_VideoSurface && (xevent.xexpose.count == 0) ) {
- CGX_RefreshDisplay(this);
- }
- break;
-#endif
-
- /* Have we been resized? */
- case IDCMP_NEWSIZE:
- SDL_PrivateResize(SDL_Window->Width-SDL_Window->BorderLeft-SDL_Window->BorderRight,
- SDL_Window->Height-SDL_Window->BorderTop-SDL_Window->BorderBottom);
-
- break;
-
- /* Have we been requested to quit? */
- case IDCMP_CLOSEWINDOW:
- posted = SDL_PrivateQuit();
- break;
-
- /* Do we need to refresh ourselves? */
-
- default: {
- /* Only post the event if we're watching for it */
- if ( SDL_ProcessEvents[SDL_SYSWMEVENT] == SDL_ENABLE ) {
- SDL_SysWMmsg wmmsg;
-
- SDL_VERSION(&wmmsg.version);
-#if 0
- wmmsg.subsystem = SDL_SYSWM_CGX;
- wmmsg.event.xevent = xevent;
-#endif
- posted = SDL_PrivateSysWMEvent(&wmmsg);
- }
- }
- break;
- }
- ReplyMsg((struct Message *)msg);
-
-
- return(posted);
-}
-
-void amiga_PumpEvents(_THIS)
-{
- int pending;
- struct IntuiMessage *m;
-
- /* Keep processing pending events */
- pending = 0;
- while ( m=(struct IntuiMessage *)GetMsg(SDL_Window->UserPort) ) {
- amiga_DispatchEvent(this,m);
- ++pending;
- }
-}
-
-void amiga_InitKeymap(void)
-{
- int i;
-
- /* Map the miscellaneous keys */
- for ( i=0; i<SDL_arraysize(MISC_keymap); ++i )
- MISC_keymap[i] = SDLK_UNKNOWN;
-
- /* These X keysyms have 0xFF as the high byte */
- MISC_keymap[65] = SDLK_BACKSPACE;
- MISC_keymap[66] = SDLK_TAB;
- MISC_keymap[70] = SDLK_CLEAR;
- MISC_keymap[70] = SDLK_DELETE;
- MISC_keymap[68] = SDLK_RETURN;
-// MISC_keymap[XK_Pause&0xFF] = SDLK_PAUSE;
- MISC_keymap[69] = SDLK_ESCAPE;
- MISC_keymap[70] = SDLK_DELETE;
-/*
- SDLK_SPACE = 32,
- SDLK_MINUS = 45,
- SDLK_LESS = 60,
- SDLK_COMMA = 44,
- SDLK_PERIOD = 46,
- SDLK_0 = 48,
- SDLK_1 = 49,
- SDLK_2 = 50,
- SDLK_3 = 51,
- SDLK_4 = 52,
- SDLK_5 = 53,
- SDLK_6 = 54,
- SDLK_7 = 55,
- SDLK_8 = 56,
- SDLK_9 = 57,
- SDLK_BACKQUOTE = 96,
- SDLK_BACKSLASH = 92,
- SDLK_a = 97,
- SDLK_b = 98,
- SDLK_c = 99,
- SDLK_d = 100,
- SDLK_e = 101,
- SDLK_f = 102,
- SDLK_g = 103,
- SDLK_h = 104,
- SDLK_i = 105,
- SDLK_j = 106,
- SDLK_k = 107,
- SDLK_l = 108,
- SDLK_m = 109,
- SDLK_n = 110,
- SDLK_o = 111,
- SDLK_p = 112,
- SDLK_q = 113,
- SDLK_r = 114,
- SDLK_s = 115,
- SDLK_t = 116,
- SDLK_u = 117,
- SDLK_v = 118,
- SDLK_w = 119,
- SDLK_x = 120,
- SDLK_y = 121,
- SDLK_z = 122,
-*/
- MISC_keymap[15] = SDLK_KP0; /* Keypad 0-9 */
- MISC_keymap[29] = SDLK_KP1;
- MISC_keymap[30] = SDLK_KP2;
- MISC_keymap[31] = SDLK_KP3;
- MISC_keymap[45] = SDLK_KP4;
- MISC_keymap[46] = SDLK_KP5;
- MISC_keymap[47] = SDLK_KP6;
- MISC_keymap[61] = SDLK_KP7;
- MISC_keymap[62] = SDLK_KP8;
- MISC_keymap[63] = SDLK_KP9;
- MISC_keymap[60] = SDLK_KP_PERIOD;
- MISC_keymap[92] = SDLK_KP_DIVIDE;
- MISC_keymap[93] = SDLK_KP_MULTIPLY;
- MISC_keymap[74] = SDLK_KP_MINUS;
- MISC_keymap[94] = SDLK_KP_PLUS;
- MISC_keymap[67] = SDLK_KP_ENTER;
-// MISC_keymap[XK_KP_Equal&0xFF] = SDLK_KP_EQUALS;
-
- MISC_keymap[76] = SDLK_UP;
- MISC_keymap[77] = SDLK_DOWN;
- MISC_keymap[78] = SDLK_RIGHT;
- MISC_keymap[79] = SDLK_LEFT;
-/*
- MISC_keymap[XK_Insert&0xFF] = SDLK_INSERT;
- MISC_keymap[XK_Home&0xFF] = SDLK_HOME;
- MISC_keymap[XK_End&0xFF] = SDLK_END;
-*/
-// Mappati sulle parentesi del taastierino
- MISC_keymap[90] = SDLK_PAGEUP;
- MISC_keymap[91] = SDLK_PAGEDOWN;
-
- MISC_keymap[80] = SDLK_F1;
- MISC_keymap[81] = SDLK_F2;
- MISC_keymap[82] = SDLK_F3;
- MISC_keymap[83] = SDLK_F4;
- MISC_keymap[84] = SDLK_F5;
- MISC_keymap[85] = SDLK_F6;
- MISC_keymap[86] = SDLK_F7;
- MISC_keymap[87] = SDLK_F8;
- MISC_keymap[88] = SDLK_F9;
- MISC_keymap[89] = SDLK_F10;
-// MISC_keymap[XK_F11&0xFF] = SDLK_F11;
-// MISC_keymap[XK_F12&0xFF] = SDLK_F12;
-// MISC_keymap[XK_F13&0xFF] = SDLK_F13;
-// MISC_keymap[XK_F14&0xFF] = SDLK_F14;
-// MISC_keymap[XK_F15&0xFF] = SDLK_F15;
-
-// MISC_keymap[XK_Num_Lock&0xFF] = SDLK_NUMLOCK;
- MISC_keymap[98] = SDLK_CAPSLOCK;
-// MISC_keymap[XK_Scroll_Lock&0xFF] = SDLK_SCROLLOCK;
- MISC_keymap[97] = SDLK_RSHIFT;
- MISC_keymap[96] = SDLK_LSHIFT;
- MISC_keymap[99] = SDLK_LCTRL;
- MISC_keymap[99] = SDLK_LCTRL;
- MISC_keymap[101] = SDLK_RALT;
- MISC_keymap[100] = SDLK_LALT;
-// MISC_keymap[XK_Meta_R&0xFF] = SDLK_RMETA;
-// MISC_keymap[XK_Meta_L&0xFF] = SDLK_LMETA;
- MISC_keymap[103] = SDLK_LSUPER; /* Left "Windows" */
- MISC_keymap[102] = SDLK_RSUPER; /* Right "Windows */
-
- MISC_keymap[95] = SDLK_HELP;
-}
-
-SDL_keysym *amiga_TranslateKey(int code, SDL_keysym *keysym)
-{
- #ifdef STORMC4_WOS
- static struct Library *KeymapBase=NULL; /* Linking failed in WOS version if ConsoleDevice was used */
- #else
- static struct Library *ConsoleDevice=NULL;
- #endif
-
- /* Get the raw keyboard scancode */
- keysym->scancode = code;
- keysym->sym = MISC_keymap[code];
-
-#ifdef DEBUG_KEYS
- fprintf(stderr, "Translating key 0x%.4x (%d)\n", xsym, xkey->keycode);
-#endif
- /* Get the translated SDL virtual keysym */
- if ( keysym->sym==SDLK_UNKNOWN )
- {
- #ifdef STORMC4_WOS
- if(!KeymapBase)
- #else
- if(!ConsoleDevice)
- #endif
- {
- #ifdef STORMC4_WOS
- KeymapBase=OpenLibrary("keymap.library", 0L);
- #else
- if(ConPort=CreateMsgPort())
- {
- if(ConReq=CreateIORequest(ConPort,sizeof(struct IOStdReq)))
- {
- if(!OpenDevice("console.device",-1,(struct IORequest *)ConReq,0))
- ConsoleDevice=(struct Library *)ConReq->io_Device;
- else
- {
- DeleteIORequest(ConReq);
- ConReq=NULL;
- }
- }
- else
- {
- DeleteMsgPort(ConPort);
- ConPort=NULL;
- }
- }
- #endif
- }
-
- #ifdef STORMC4_WOS
- if(KeymapBase)
- #else
- if(ConsoleDevice)
- #endif
- {
- struct InputEvent event;
- long actual;
- char buffer[5];
-
- event.ie_Qualifier=0;
- event.ie_Class=IECLASS_RAWKEY;
- event.ie_SubClass=0L;
- event.ie_Code=code;
- event.ie_X=event.ie_Y=0;
- event.ie_EventAddress=NULL;
- event.ie_NextEvent=NULL;
- event.ie_Prev1DownCode=event.ie_Prev1DownQual=event.ie_Prev2DownCode=event.ie_Prev2DownQual=0;
-
- #ifdef STORMC4_WOS
- if( (actual=MapRawKey(&event,buffer,5,NULL))>=0)
- #else
- if( (actual=RawKeyConvert(&event,buffer,5,NULL))>=0)
- #endif
- {
- if(actual>1)
- {
- D(bug("Warning (%ld) character conversion!\n",actual));
- }
- else if(actual==1)
- {
- keysym->sym=*buffer;
- D(bug("Converted rawcode %ld to <%lc>\n",code,*buffer));
-// Bufferizzo x le successive chiamate!
- MISC_keymap[code]=*buffer;
- }
- }
- }
-
- }
- keysym->mod = KMOD_NONE;
-
- /* If UNICODE is on, get the UNICODE value for the key */
- keysym->unicode = 0;
- if ( SDL_TranslateUNICODE ) {
-#if 0
- static XComposeStatus state;
- /* Until we handle the IM protocol, use XLookupString() */
- unsigned char keybuf[32];
- if ( XLookupString(xkey, (char *)keybuf, sizeof(keybuf),
- NULL, &state) ) {
- keysym->unicode = keybuf[0];
- }
-#endif
- }
- return(keysym);
-}
-
-void amiga_InitOSKeymap(_THIS)
-{
- amiga_InitKeymap();
-}
diff --git a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_amigaevents_c.h b/distrib/sdl-1.2.12/src/video/cybergfx/SDL_amigaevents_c.h
deleted file mode 100644
index 11b86b5..0000000
--- a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_amigaevents_c.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_cgxvideo.h"
-
-/* Functions to be exported */
-extern void amiga_InitOSKeymap(_THIS);
-extern void amiga_PumpEvents(_THIS);
-
diff --git a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_amigamouse.c b/distrib/sdl-1.2.12/src/video/cybergfx/SDL_amigamouse.c
deleted file mode 100644
index 64940a8..0000000
--- a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_amigamouse.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_mouse.h"
-#include "../../events/SDL_events_c.h"
-#include "../SDL_cursor_c.h"
-#include "SDL_amigamouse_c.h"
-
-
-/* The implementation dependent data for the window manager cursor */
-
-typedef void * WMCursor;
-
-void amiga_FreeWMCursor(_THIS, WMcursor *cursor)
-{
-}
-
-WMcursor *amiga_CreateWMCursor(_THIS,
- Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
-{
- return (WMcursor *)1; // Amiga has an Hardware cursor, so it's ok to return something unuseful but true
-}
-
-int amiga_ShowWMCursor(_THIS, WMcursor *cursor)
-{
- /* Don't do anything if the display is gone */
- if ( SDL_Display == NULL) {
- return(0);
- }
-
- /* Set the Amiga prefs cursor cursor, or blank if cursor is NULL */
-
- if ( SDL_Window ) {
- SDL_Lock_EventThread();
- if ( cursor == NULL ) {
- if ( SDL_BlankCursor != NULL ) {
-// Hide cursor HERE
- SetPointer(SDL_Window,(UWORD *)SDL_BlankCursor,1,1,0,0);
- }
- } else {
-// Show cursor
- ClearPointer(SDL_Window);
- }
- SDL_Unlock_EventThread();
- }
- return(1);
-}
-
-void amiga_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
-{
-/* FIXME: Not implemented */
-}
-
-/* Check to see if we need to enter or leave mouse relative mode */
-void amiga_CheckMouseMode(_THIS)
-{
-}
diff --git a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_amigamouse_c.h b/distrib/sdl-1.2.12/src/video/cybergfx/SDL_amigamouse_c.h
deleted file mode 100644
index aad19b6..0000000
--- a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_amigamouse_c.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_cgxvideo.h"
-
-/* Functions to be exported */
-extern void amiga_FreeWMCursor(_THIS, WMcursor *cursor);
-extern WMcursor *amiga_CreateWMCursor(_THIS,
- Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
-extern int amiga_ShowWMCursor(_THIS, WMcursor *cursor);
-extern void amiga_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
-extern void amiga_CheckMouseMode(_THIS);
diff --git a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxaccel.c b/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxaccel.c
deleted file mode 100644
index 24605e3..0000000
--- a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxaccel.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_endian.h"
-#include "SDL_video.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_blit.h"
-#include "SDL_cgxvideo.h"
-
-static int CGX_HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect);
-
-// These are needed to avoid register troubles with gcc -O2!
-
-#if defined(__SASC) || defined(__PPC__) || defined(MORPHOS)
-#define BMKBRP(a,b,c,d,e,f,g,h,i,j) BltMaskBitMapRastPort(a,b,c,d,e,f,g,h,i,j)
-#define BBRP(a,b,c,d,e,f,g,h,i) BltBitMapRastPort(a,b,c,d,e,f,g,h,i)
-#define BBB(a,b,c,d,e,f,g,h,i,j,k) BltBitMap(a,b,c,d,e,f,g,h,i,j,k)
-#else
-void BMKBRP(struct BitMap *a,WORD b, WORD c,struct RastPort *d,WORD e,WORD f,WORD g,WORD h,UBYTE i,APTR j)
-{BltMaskBitMapRastPort(a,b,c,d,e,f,g,h,i,j);}
-
-void BBRP(struct BitMap *a,WORD b, WORD c,struct RastPort *d,WORD e,WORD f,WORD g,WORD h,UBYTE i)
-{BltBitMapRastPort(a,b,c,d,e,f,g,h,i);}
-
-void BBB(struct BitMap *a,WORD b, WORD c,struct BitMap *d,WORD e,WORD f,WORD g,WORD h,UBYTE i,UBYTE j,UWORD *k)
-{BltBitMap(a,b,c,d,e,f,g,h,i,j,k);}
-#endif
-
-int CGX_SetHWColorKey(_THIS,SDL_Surface *surface, Uint32 key)
-{
- if(surface->hwdata)
- {
- if(surface->hwdata->mask)
- SDL_free(surface->hwdata->mask);
-
- if(surface->hwdata->mask=SDL_malloc(RASSIZE(surface->w,surface->h)))
- {
- Uint32 pitch,ok=0;
- APTR lock;
-
- SDL_memset(surface->hwdata->mask,255,RASSIZE(surface->w,surface->h));
-
- D(bug("Building colorkey mask: color: %ld, size: %ld x %ld, %ld bytes...Bpp:%ld\n",key,surface->w,surface->h,RASSIZE(surface->w,surface->h),surface->format->BytesPerPixel));
-
- if(lock=LockBitMapTags(surface->hwdata->bmap,LBMI_BASEADDRESS,(ULONG)&surface->pixels,
- LBMI_BYTESPERROW,(ULONG)&pitch,TAG_DONE))
- {
- switch(surface->format->BytesPerPixel)
- {
- case 1:
- {
- unsigned char k=key;
- register int i,j,t;
- register unsigned char *dest=surface->hwdata->mask,*map=surface->pixels;
-
- pitch-=surface->w;
-
- for(i=0;i<surface->h;i++)
- {
- for(t=128,j=0;j<surface->w;j++)
- {
- if(*map==k)
- *dest&=~t;
-
- t>>=1;
-
- if(t==0)
- {
- dest++;
- t=128;
- }
- map++;
- }
- map+=pitch;
- }
- }
- break;
- case 2:
- {
- Uint16 k=key,*mapw;
- register int i,j,t;
- register unsigned char *dest=surface->hwdata->mask,*map=surface->pixels;
-
- for(i=surface->h;i;--i)
- {
- mapw=(Uint16 *)map;
-
- for(t=128,j=surface->w;j;--j)
- {
- if(*mapw==k)
- *dest&=~t;
-
- t>>=1;
-
- if(t==0)
- {
- dest++;
- t=128;
- }
- mapw++;
- }
- map+=pitch;
- }
- }
- break;
- case 4:
- {
- Uint32 *mapl;
- register int i,j,t;
- register unsigned char *dest=surface->hwdata->mask,*map=surface->pixels;
-
- for(i=surface->h;i;--i)
- {
- mapl=(Uint32 *)map;
-
- for(t=128,j=surface->w;j;--j)
- {
- if(*mapl==key)
- *dest&=~t;
-
- t>>=1;
-
- if(t==0)
- {
- dest++;
- t=128;
- }
- mapl++;
- }
- map+=pitch;
- }
-
- }
- break;
- default:
- D(bug("Pixel mode non supported for color key..."));
- SDL_free(surface->hwdata->mask);
- surface->hwdata->mask=NULL;
- ok=-1;
- }
- UnLockBitMap(lock);
- D(bug("...Colorkey built!\n"));
- return ok;
- }
- }
- }
- D(bug("HW colorkey not supported for this depth\n"));
-
- return -1;
-}
-
-int CGX_CheckHWBlit(_THIS,SDL_Surface *src,SDL_Surface *dst)
-{
-// Doesn't support yet alpha blitting
-
- if(src->hwdata&& !(src->flags & (SDL_SRCALPHA)))
- {
- D(bug("CheckHW blit... OK!\n"));
-
- if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
- if ( CGX_SetHWColorKey(this, src, src->format->colorkey) < 0 ) {
- src->flags &= ~SDL_HWACCEL;
- return -1;
- }
- }
-
- src->flags|=SDL_HWACCEL;
- src->map->hw_blit = CGX_HWAccelBlit;
- return 1;
- }
- else
- src->flags &= ~SDL_HWACCEL;
-
- D(bug("CheckHW blit... NO!\n"));
-
- return 0;
-}
-
-static int temprp_init=0;
-static struct RastPort temprp;
-
-static int CGX_HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect)
-{
- struct SDL_VideoDevice *this=src->hwdata->videodata;
-
-// D(bug("Accel blit!\n"));
-
- if(src->flags&SDL_SRCCOLORKEY && src->hwdata->mask)
- {
- if(dst==SDL_VideoSurface)
- {
- BMKBRP(src->hwdata->bmap,srcrect->x,srcrect->y,
- SDL_RastPort,dstrect->x+SDL_Window->BorderLeft,dstrect->y+SDL_Window->BorderTop,
- srcrect->w,srcrect->h,0xc0,src->hwdata->mask);
- }
- else if(dst->hwdata)
- {
- if(!temprp_init)
- {
- InitRastPort(&temprp);
- temprp_init=1;
- }
- temprp.BitMap=(struct BitMap *)dst->hwdata->bmap;
-
- BMKBRP(src->hwdata->bmap,srcrect->x,srcrect->y,
- &temprp,dstrect->x,dstrect->y,
- srcrect->w,srcrect->h,0xc0,src->hwdata->mask);
-
- }
- }
- else if(dst==SDL_VideoSurface)
- {
- BBRP(src->hwdata->bmap,srcrect->x,srcrect->y,SDL_RastPort,dstrect->x+SDL_Window->BorderLeft,dstrect->y+SDL_Window->BorderTop,srcrect->w,srcrect->h,0xc0);
- }
- else if(dst->hwdata)
- BBB(src->hwdata->bmap,srcrect->x,srcrect->y,dst->hwdata->bmap,dstrect->x,dstrect->y,srcrect->w,srcrect->h,0xc0,0xff,NULL);
-
- return 0;
-}
-
-int CGX_FillHWRect(_THIS,SDL_Surface *dst,SDL_Rect *dstrect,Uint32 color)
-{
- if(dst==SDL_VideoSurface)
- {
- FillPixelArray(SDL_RastPort,dstrect->x+SDL_Window->BorderLeft,dstrect->y+SDL_Window->BorderTop,dstrect->w,dstrect->h,color);
- }
- else if(dst->hwdata)
- {
- if(!temprp_init)
- {
- InitRastPort(&temprp);
- temprp_init=1;
- }
-
- temprp.BitMap=(struct BitMap *)dst->hwdata->bmap;
-
- FillPixelArray(&temprp,dstrect->x,dstrect->y,dstrect->w,dstrect->h,color);
- }
- return 0;
-}
diff --git a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxgl.c b/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxgl.c
deleted file mode 100644
index e19614b..0000000
--- a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxgl.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* StormMesa implementation of SDL OpenGL support */
-
-#include "SDL_cgxgl_c.h"
-#include "SDL_cgxvideo.h"
-
-#if SDL_VIDEO_OPENGL
-AmigaMesaContext glcont=NULL;
-#endif
-
-/* Init OpenGL */
-int CGX_GL_Init(_THIS)
-{
-#if SDL_VIDEO_OPENGL
- int i = 0;
- struct TagItem attributes [ 14 ]; /* 14 should be more than enough :) */
- struct Window *win = (struct Window *)SDL_Window;
-
- // default config. Always used...
- attributes[i].ti_Tag = AMA_Window; attributes[i++].ti_Data = (unsigned long)win;
- attributes[i].ti_Tag = AMA_Left; attributes[i++].ti_Data = 0;
- attributes[i].ti_Tag = AMA_Bottom; attributes[i++].ti_Data = 0;
- attributes[i].ti_Tag = AMA_Width; attributes[i++].ti_Data = win->Width-win->BorderLeft-win->BorderRight;
- attributes[i].ti_Tag = AMA_Height; attributes[i++].ti_Data = win->Height-win->BorderBottom-win->BorderTop;
- attributes[i].ti_Tag = AMA_DirectRender; attributes[i++].ti_Data = GL_TRUE;
-
- // double buffer ?
- attributes[i].ti_Tag = AMA_DoubleBuf;
- if ( this->gl_config.double_buffer ) {
- attributes[i++].ti_Data = GL_TRUE;
- }
- else {
- attributes[i++].ti_Data = GL_FALSE;
- }
- // RGB(A) Mode ?
- attributes[i].ti_Tag = AMA_RGBMode;
- if ( this->gl_config.red_size != 0 &&
- this->gl_config.blue_size != 0 &&
- this->gl_config.green_size != 0 ) {
- attributes[i++].ti_Data = GL_TRUE;
- }
- else {
- attributes[i++].ti_Data = GL_FALSE;
- }
- // no depth buffer ?
- if ( this->gl_config.depth_size == 0 ) {
- attributes[i].ti_Tag = AMA_NoDepth;
- attributes[i++].ti_Data = GL_TRUE;
- }
- // no stencil buffer ?
- if ( this->gl_config.stencil_size == 0 ) {
- attributes[i].ti_Tag = AMA_NoStencil;
- attributes[i++].ti_Data = GL_TRUE;
- }
- // no accum buffer ?
- if ( this->gl_config.accum_red_size != 0 &&
- this->gl_config.accum_blue_size != 0 &&
- this->gl_config.accum_green_size != 0 ) {
- attributes[i].ti_Tag = AMA_NoAccum;
- attributes[i++].ti_Data = GL_TRUE;
- }
- // done...
- attributes[i].ti_Tag = TAG_DONE;
-
- glcont = AmigaMesaCreateContext(attributes);
- if ( glcont == NULL ) {
- SDL_SetError("Couldn't create OpenGL context");
- return(-1);
- }
- this->gl_data->gl_active = 1;
- this->gl_config.driver_loaded = 1;
-
- return(0);
-#else
- SDL_SetError("OpenGL support not configured");
- return(-1);
-#endif
-}
-
-/* Quit OpenGL */
-void CGX_GL_Quit(_THIS)
-{
-#if SDL_VIDEO_OPENGL
- if ( glcont != NULL ) {
- AmigaMesaDestroyContext(glcont);
- glcont = NULL;
- this->gl_data->gl_active = 0;
- this->gl_config.driver_loaded = 0;
- }
-#endif
-}
-
-/* Attach context to another window */
-int CGX_GL_Update(_THIS)
-{
-#if SDL_VIDEO_OPENGL
- struct TagItem tags[2];
- struct Window *win = (struct Window*)SDL_Window;
- if(glcont == NULL) {
- return -1; //should never happen
- }
- tags[0].ti_Tag = AMA_Window;
- tags[0].ti_Data = (unsigned long)win;
- tags[1].ti_Tag = TAG_DONE;
- AmigaMesaSetRast(glcont, tags);
-
- return 0;
-#else
- SDL_SetError("OpenGL support not configured");
- return -1;
-#endif
-}
-
-#if SDL_VIDEO_OPENGL
-
-/* Make the current context active */
-int CGX_GL_MakeCurrent(_THIS)
-{
- if(glcont == NULL)
- return -1;
-
- AmigaMesaMakeCurrent(glcont, glcont->buffer);
- return 0;
-}
-
-void CGX_GL_SwapBuffers(_THIS)
-{
- AmigaMesaSwapBuffers(glcont);
-}
-
-int CGX_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value) {
- GLenum mesa_attrib;
-
- switch(attrib) {
- case SDL_GL_RED_SIZE:
- mesa_attrib = GL_RED_BITS;
- break;
- case SDL_GL_GREEN_SIZE:
- mesa_attrib = GL_GREEN_BITS;
- break;
- case SDL_GL_BLUE_SIZE:
- mesa_attrib = GL_BLUE_BITS;
- break;
- case SDL_GL_ALPHA_SIZE:
- mesa_attrib = GL_ALPHA_BITS;
- break;
- case SDL_GL_DOUBLEBUFFER:
- mesa_attrib = GL_DOUBLEBUFFER;
- break;
- case SDL_GL_DEPTH_SIZE:
- mesa_attrib = GL_DEPTH_BITS;
- break;
- case SDL_GL_STENCIL_SIZE:
- mesa_attrib = GL_STENCIL_BITS;
- break;
- case SDL_GL_ACCUM_RED_SIZE:
- mesa_attrib = GL_ACCUM_RED_BITS;
- break;
- case SDL_GL_ACCUM_GREEN_SIZE:
- mesa_attrib = GL_ACCUM_GREEN_BITS;
- break;
- case SDL_GL_ACCUM_BLUE_SIZE:
- mesa_attrib = GL_ACCUM_BLUE_BITS;
- break;
- case SDL_GL_ACCUM_ALPHA_SIZE:
- mesa_attrib = GL_ACCUM_ALPHA_BITS;
- break;
- default :
- return -1;
- }
-
- AmigaMesaGetConfig(glcont->visual, mesa_attrib, value);
- return 0;
-}
-
-void *CGX_GL_GetProcAddress(_THIS, const char *proc) {
- void *func = NULL;
- func = AmiGetGLProc(proc);
- return func;
-}
-
-int CGX_GL_LoadLibrary(_THIS, const char *path) {
- /* Library is always open */
- this->gl_config.driver_loaded = 1;
-
- return 0;
-}
-
-#endif /* SDL_VIDEO_OPENGL */
-
diff --git a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxgl_c.h b/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxgl_c.h
deleted file mode 100644
index 4c04f59..0000000
--- a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxgl_c.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* StormMesa implementation of SDL OpenGL support */
-
-#include "../SDL_sysvideo.h"
-
-#define _THIS SDL_VideoDevice *_this
-
-#if SDL_VIDEO_OPENGL
-#include <GL/Amigamesa.h>
-extern void *AmiGetGLProc(const char *proc);
-#endif /* SDL_VIDEO_OPENGL */
-
-struct SDL_PrivateGLData {
- int gl_active;
-};
-
-/* OpenGL functions */
-extern int CGX_GL_Init(_THIS);
-extern void CGX_GL_Quit(_THIS);
-extern int CGX_GL_Update(_THIS);
-#if SDL_VIDEO_OPENGL
-extern int CGX_GL_MakeCurrent(_THIS);
-extern int CGX_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
-extern void CGX_GL_SwapBuffers(_THIS);
-extern void *CGX_GL_GetProcAddress(_THIS, const char *proc);
-extern int CGX_GL_LoadLibrary(_THIS, const char *path);
-#endif
-
-#undef _THIS
diff --git a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgximage.c b/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgximage.c
deleted file mode 100644
index 3e8938e..0000000
--- a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgximage.c
+++ /dev/null
@@ -1,906 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_endian.h"
-#include "SDL_cgximage_c.h"
-
-#ifdef HAVE_KSTAT
-#include <kstat.h>
-#endif
-
-#ifdef USE_CGX_WRITELUTPIXEL
-#if defined(__SASC) || defined(__PPC__)
- #define WLUT WriteLUTPixelArray
-#else
-void WLUT(APTR a,UWORD b,UWORD c,UWORD d,struct RastPort *e,APTR f,UWORD g,UWORD h,UWORD i,UWORD l,UBYTE m)
-{ WriteLUTPixelArray(a,b,c,d,e,f,g,h,i,l,m); }
-#endif
-
-#endif
-
-/* Various screen update functions available */
-static void CGX_NormalUpdate(_THIS, int numrects, SDL_Rect *rects);
-static void CGX_FakeUpdate(_THIS, int numrects, SDL_Rect *rects);
-
-BOOL SafeDisp=TRUE,SafeChange=TRUE;
-struct MsgPort *safeport=NULL,*dispport=NULL;
-ULONG safe_sigbit,disp_sigbit;
-int use_picasso96=1;
-
-int CGX_SetupImage(_THIS, SDL_Surface *screen)
-{
- SDL_Ximage=NULL;
-
- if(screen->flags&SDL_HWSURFACE) {
- ULONG pitch;
-
- if(!screen->hwdata) {
- if(!(screen->hwdata=SDL_malloc(sizeof(struct private_hwdata))))
- return -1;
-
- D(bug("Creating system accel struct\n"));
- }
- screen->hwdata->lock=NULL;
- screen->hwdata->allocated=0;
- screen->hwdata->mask=NULL;
- screen->hwdata->bmap=SDL_RastPort->BitMap;
- screen->hwdata->videodata=this;
-
- if(!(screen->hwdata->lock=LockBitMapTags(screen->hwdata->bmap,
- LBMI_BASEADDRESS,(ULONG)&screen->pixels,
- LBMI_BYTESPERROW,(ULONG)&pitch,TAG_DONE))) {
- SDL_free(screen->hwdata);
- screen->hwdata=NULL;
- return -1;
- }
- else {
- UnLockBitMap(screen->hwdata->lock);
- screen->hwdata->lock=NULL;
- }
-
- screen->pitch=pitch;
-
- this->UpdateRects = CGX_FakeUpdate;
-
- D(bug("Accel video image configured (%lx, pitch %ld).\n",screen->pixels,screen->pitch));
- return 0;
- }
-
- screen->pixels = SDL_malloc(screen->h*screen->pitch);
-
- if ( screen->pixels == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
-
- SDL_Ximage=screen->pixels;
-
- if ( SDL_Ximage == NULL ) {
- SDL_SetError("Couldn't create XImage");
- return(-1);
- }
-
- this->UpdateRects = CGX_NormalUpdate;
-
- return(0);
-}
-
-void CGX_DestroyImage(_THIS, SDL_Surface *screen)
-{
- if ( SDL_Ximage ) {
- SDL_free(SDL_Ximage);
- SDL_Ximage = NULL;
- }
- if ( screen ) {
- screen->pixels = NULL;
-
- if(screen->hwdata) {
- SDL_free(screen->hwdata);
- screen->hwdata=NULL;
- }
- }
-}
-
-/* This is a hack to see whether this system has more than 1 CPU */
-static int num_CPU(void)
-{
- return 1;
-}
-
-int CGX_ResizeImage(_THIS, SDL_Surface *screen, Uint32 flags)
-{
- int retval;
-
- D(bug("Calling ResizeImage()\n"));
-
- CGX_DestroyImage(this, screen);
-
- if ( flags & SDL_OPENGL ) { /* No image when using GL */
- retval = 0;
- } else {
- retval = CGX_SetupImage(this, screen);
- /* We support asynchronous blitting on the display */
- if ( flags & SDL_ASYNCBLIT ) {
- if ( num_CPU() > 1 ) {
- screen->flags |= SDL_ASYNCBLIT;
- }
- }
- }
- return(retval);
-}
-
-int CGX_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- D(bug("Alloc HW surface...%ld x %ld x %ld!\n",surface->w,surface->h,this->hidden->depth));
-
- if(surface==SDL_VideoSurface)
- {
- D(bug("Allocation skipped, it's system one!\n"));
- return 0;
- }
-
- if(!surface->hwdata)
- {
- if(!(surface->hwdata=SDL_malloc(sizeof(struct private_hwdata))))
- return -1;
- }
-
- surface->hwdata->mask=NULL;
- surface->hwdata->lock=NULL;
- surface->hwdata->videodata=this;
- surface->hwdata->allocated=0;
-
- if(surface->hwdata->bmap=AllocBitMap(surface->w,surface->h,this->hidden->depth,BMF_MINPLANES,SDL_Display->RastPort.BitMap))
- {
- surface->hwdata->allocated=1;
- surface->flags|=SDL_HWSURFACE;
- D(bug("...OK\n"));
- return 0;
- }
- else
- {
- SDL_free(surface->hwdata);
- surface->hwdata=NULL;
- }
-
- return(-1);
-}
-void CGX_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- if(surface && surface!=SDL_VideoSurface && surface->hwdata)
- {
- D(bug("Free hw surface.\n"));
-
- if(surface->hwdata->mask)
- SDL_free(surface->hwdata->mask);
-
- if(surface->hwdata->bmap&&surface->hwdata->allocated)
- FreeBitMap(surface->hwdata->bmap);
-
- SDL_free(surface->hwdata);
- surface->hwdata=NULL;
- surface->pixels=NULL;
- D(bug("end of free hw surface\n"));
- }
- return;
-}
-
-int CGX_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- if (surface->hwdata)
- {
-// D(bug("Locking a bitmap...\n"));
- if(!surface->hwdata->lock)
- {
- Uint32 pitch;
-
- if(!(surface->hwdata->lock=LockBitMapTags(surface->hwdata->bmap,
- LBMI_BASEADDRESS,(ULONG)&surface->pixels,
- LBMI_BYTESPERROW,(ULONG)&pitch,TAG_DONE)))
- return -1;
-
-// surface->pitch e' a 16bit!
-
- surface->pitch=pitch;
-
- if(!currently_fullscreen&&surface==SDL_VideoSurface)
- surface->pixels=((char *)surface->pixels)+(surface->pitch*(SDL_Window->BorderTop+SDL_Window->TopEdge)+
- surface->format->BytesPerPixel*(SDL_Window->BorderLeft+SDL_Window->LeftEdge));
- }
- D(else bug("Already locked!!!\n"));
- }
- return(0);
-}
-
-void CGX_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- if(surface->hwdata && surface->hwdata->lock)
- {
- UnLockBitMap(surface->hwdata->lock);
- surface->hwdata->lock=NULL;
-// surface->pixels=NULL;
- }
-}
-
-int CGX_FlipHWSurface(_THIS, SDL_Surface *surface)
-{
- static int current=0;
-
- if(this->hidden->dbuffer)
- {
- if(!SafeChange)
- {
- Wait(disp_sigbit);
-// Non faccio nulla, vuoto solo la porta
- while(GetMsg(dispport)!=NULL)
- ;
- SafeChange=TRUE;
- }
-
- if(ChangeScreenBuffer(SDL_Display,this->hidden->SB[current^1]))
- {
- surface->hwdata->bmap=SDL_RastPort->BitMap=this->hidden->SB[current]->sb_BitMap;
- SafeChange=FALSE;
- SafeDisp=FALSE;
- current^=1;
- }
-
- if(!SafeDisp)
- {
- Wait(safe_sigbit);
- while(GetMsg(safeport)!=NULL)
- ;
- SafeDisp=TRUE;
- }
-
- }
- return(0);
-}
-
-/* Byte-swap the pixels in the display image */
-static void CGX_SwapAllPixels(SDL_Surface *screen)
-{
- int x, y;
-
- switch (screen->format->BytesPerPixel) {
- case 2: {
- Uint16 *spot;
- for ( y=0; y<screen->h; ++y ) {
- spot = (Uint16 *) ((Uint8 *)screen->pixels +
- y * screen->pitch);
- for ( x=0; x<screen->w; ++x, ++spot ) {
- *spot = SDL_Swap16(*spot);
- }
- }
- }
- break;
-
- case 4: {
- Uint32 *spot;
- for ( y=0; y<screen->h; ++y ) {
- spot = (Uint32 *) ((Uint8 *)screen->pixels +
- y * screen->pitch);
- for ( x=0; x<screen->w; ++x, ++spot ) {
- *spot = SDL_Swap32(*spot);
- }
- }
- }
- break;
-
- default:
- /* should never get here */
- break;
- }
-}
-static void CGX_SwapPixels(SDL_Surface *screen, int numrects, SDL_Rect *rects)
-{
- int i;
- int x, minx, maxx;
- int y, miny, maxy;
-
- switch (screen->format->BytesPerPixel) {
- case 2: {
- Uint16 *spot;
- for ( i=0; i<numrects; ++i ) {
- minx = rects[i].x;
- maxx = rects[i].x+rects[i].w;
- miny = rects[i].y;
- maxy = rects[i].y+rects[i].h;
- for ( y=miny; y<maxy; ++y ) {
- spot = (Uint16 *) ((Uint8 *)screen->pixels +
- y * screen->pitch + minx * 2);
- for ( x=minx; x<maxx; ++x, ++spot ) {
- *spot = SDL_Swap16(*spot);
- }
- }
- }
- }
- break;
-
- case 4: {
- Uint32 *spot;
- for ( i=0; i<numrects; ++i ) {
- minx = rects[i].x;
- maxx = rects[i].x+rects[i].w;
- miny = rects[i].y;
- maxy = rects[i].y+rects[i].h;
- for ( y=miny; y<maxy; ++y ) {
- spot = (Uint32 *) ((Uint8 *)screen->pixels +
- y * screen->pitch + minx * 4);
- for ( x=minx; x<maxx; ++x, ++spot ) {
- *spot = SDL_Swap32(*spot);
- }
- }
- }
- }
- break;
-
- default:
- /* should never get here */
- break;
- }
-}
-
-#ifdef __SASC
-
-#define USE_WPA WritePixelArray
-#else
-
-void USE_WPA(char *a,int b,int c,int d, struct RastPort *e,int f,int g, int h, int i, Uint32 l)
-{
- WritePixelArray(a,b,c,d,e,f,g,h,i,l);
-}
-
-#endif
-
-static void CGX_FakeUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
-}
-
-static void CGX_NormalUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- int i,format,customroutine=0;
-#ifndef USE_CGX_WRITELUTPIXEL
- int bpp;
-#endif
- if(this->hidden->same_format && !use_picasso96)
- {
- format=RECTFMT_RAW;
- }
- else switch(this->screen->format->BytesPerPixel)
- {
- case 4:
- format=RECTFMT_RGBA;
- break;
- case 3:
- format=RECTFMT_RGB;
- break;
- case 2:
- customroutine=1;
- break;
- case 1:
-// D(bug("soft depth: 8 hardbpp: %ld\n",this->hidden->depth));
- if(this->hidden->depth>8)
- {
-#ifndef USE_CGX_WRITELUTPIXEL
- if(this->hidden->depth>32)
- customroutine=4;
- else if(this->hidden->depth>16)
- {
- bpp=this->hidden->BytesPerPixel; // That one is the only one that needs bpp
- customroutine=2; // The slow one!
- }
- else
- customroutine=3;
-#else
-
- customroutine=2;
-#endif
-
-// format=RECTFMT_LUT8; Vecchia funzione x usare la WritePixelArray.
- }
- else
- customroutine=1;
- break;
- default:
- D(bug("Unable to blit this surface!\n"));
- return;
- }
-
- /* Check for endian-swapped X server, swap if necessary (VERY slow!) */
- if ( swap_pixels &&
- ((this->screen->format->BytesPerPixel%2) == 0) ) {
- D(bug("Software Swapping! SLOOOW!\n"));
- CGX_SwapPixels(this->screen, numrects, rects);
- for ( i=0; i<numrects; ++i ) {
- if ( ! rects[i].w ) { /* Clipped? */
- continue;
- }
- USE_WPA(this->screen->pixels,rects[i].x, rects[i].y,this->screen->pitch,
- SDL_RastPort,SDL_Window->BorderLeft+rects[i].x,SDL_Window->BorderTop+rects[i].y,
- rects[i].w,rects[i].h,format);
- }
- CGX_SwapPixels(this->screen, numrects, rects);
- }
- else if (customroutine==2)
- {
-#ifdef USE_CGX_WRITELUTPIXEL
- for ( i=0; i<numrects; ++i ) {
- if ( ! rects[i].w ) { /* Clipped? */
- continue;
- }
-
- WLUT(this->screen->pixels,rects[i].x, rects[i].y,this->screen->pitch,
- SDL_RastPort,SDL_XPixels,SDL_Window->BorderLeft+rects[i].x,SDL_Window->BorderTop+rects[i].y,
- rects[i].w,rects[i].h,CTABFMT_XRGB8);
- }
-#else
- unsigned char *bm_address;
- Uint32 destpitch;
- APTR handle;
-
- if(handle=LockBitMapTags(SDL_RastPort->BitMap,LBMI_BASEADDRESS,&bm_address,
- LBMI_BYTESPERROW,&destpitch,TAG_DONE))
- {
- int srcwidth;
- unsigned char *destbase;
- register int j,k,t;
- register unsigned char *mask,*dst;
- register unsigned char *src,*dest;
-
-// Aggiungo il bordo della finestra se sono fullscreen.
- if(currently_fullscreen)
- destbase=bm_address;
- else
- destbase=bm_address+(SDL_Window->TopEdge+SDL_Window->BorderTop)*destpitch+(SDL_Window->BorderLeft+SDL_Window->LeftEdge)*this->hidden->BytesPerPixel;
-
- for ( i=0; i<numrects; ++i )
- {
- srcwidth=rects[i].w;
-
- if ( !srcwidth ) { /* Clipped? */
- continue;
- }
-
- dest=destbase+rects[i].x*this->hidden->BytesPerPixel;
- dest+=(rects[i].y*destpitch);
- src=((char *)(this->screen->pixels))+rects[i].x;
- src+=(rects[i].y*this->screen->pitch);
-
- for(j=rects[i].h;j;--j)
- {
- dst=dest;
-// SLOW routine, used for 8->24 bit mapping
- for(k=0;k<srcwidth;k++)
- {
- mask=(unsigned char *)(&SDL_XPixels[src[k]]);
- for(t=0;t<bpp;t++)
- {
- dst[t]=mask[t];
- }
- dst+=bpp;
- }
- src+=this->screen->pitch;
- dest+=destpitch;
- }
- }
- UnLockBitMap(handle);
- }
- }
- else if (customroutine==3)
- {
- unsigned char *bm_address;
- Uint32 destpitch;
- APTR handle;
-
- if(handle=LockBitMapTags(SDL_RastPort->BitMap,LBMI_BASEADDRESS,&bm_address,
- LBMI_BYTESPERROW,&destpitch,TAG_DONE))
- {
- int srcwidth;
- unsigned char *destbase;
- register int j,k;
- register unsigned char *src,*dest;
- register Uint16 *destl,*srcl;
-
- if(currently_fullscreen)
- destbase=bm_address;
- else
- destbase=bm_address+(SDL_Window->TopEdge+SDL_Window->BorderTop)*destpitch+(SDL_Window->BorderLeft+SDL_Window->LeftEdge)*this->hidden->BytesPerPixel;
-
- for ( i=0; i<numrects; ++i )
- {
- srcwidth=rects[i].w;
-
- if ( !srcwidth ) { /* Clipped? */
- continue;
- }
-
- dest=destbase+rects[i].x*this->hidden->BytesPerPixel;
- dest+=(rects[i].y*destpitch);
- src=((char *)(this->screen->pixels))+rects[i].x;
- src+=(rects[i].y*this->screen->pitch);
-
-// This is the fast, well not too slow, remapping code for 16bit displays
-
- for(j=rects[i].h;j;--j)
- {
- destl=(Uint16 *)dest;
-
- for(k=0;k<srcwidth;k++)
- {
- srcl=(Uint16 *)&SDL_XPixels[src[k]];
- *destl=*srcl;
- destl++;
- }
- src+=this->screen->pitch;
- dest+=destpitch;
- }
- }
- UnLockBitMap(handle);
- }
- }
- else if (customroutine==4)
- {
- unsigned char *bm_address;
- Uint32 destpitch;
- APTR handle;
-
- if(handle=LockBitMapTags(SDL_RastPort->BitMap,LBMI_BASEADDRESS,&bm_address,
- LBMI_BYTESPERROW,&destpitch,TAG_DONE))
- {
- int srcwidth;
- unsigned char *destbase;
- register int j,k;
- register unsigned char *src,*dest;
- register Uint32 *destl,*srcl;
-
- if(currently_fullscreen)
- destbase=bm_address;
- else
- destbase=bm_address+(SDL_Window->TopEdge+SDL_Window->BorderTop)*destpitch+(SDL_Window->BorderLeft+SDL_Window->LeftEdge)*this->hidden->BytesPerPixel;
-
- for ( i=0; i<numrects; ++i )
- {
- srcwidth=rects[i].w;
-
- if ( !srcwidth ) { /* Clipped? */
- continue;
- }
-
- dest=destbase+rects[i].x*this->hidden->BytesPerPixel;
- dest+=(rects[i].y*destpitch);
- src=((char *)(this->screen->pixels))+rects[i].x;
- src+=(rects[i].y*this->screen->pitch);
-
-// This is the fast, well not too slow, remapping code for 32bit displays
-
- for(j=rects[i].h;j;--j)
- {
- destl=(Uint32 *)dest;
-
- for(k=0;k<srcwidth;k++)
- {
- srcl=(Uint32 *)&SDL_XPixels[src[k]];
- *destl=*srcl;
- destl++;
- }
- src+=this->screen->pitch;
- dest+=destpitch;
- }
- }
- UnLockBitMap(handle);
- }
-#endif
- }
- else if(customroutine)
- {
- unsigned char *bm_address;
- Uint32 destpitch;
- APTR handle;
-
-// D(bug("Using customroutine!\n"));
-
- if(handle=LockBitMapTags(SDL_RastPort->BitMap,LBMI_BASEADDRESS,(ULONG)&bm_address,
- LBMI_BYTESPERROW,(ULONG)&destpitch,TAG_DONE))
- {
- unsigned char *destbase;
- register int j,srcwidth;
- register unsigned char *src,*dest;
-
-// Aggiungo il bordo della finestra se sono fullscreen.
- if(currently_fullscreen)
- destbase=bm_address;
- else
- destbase=bm_address+(SDL_Window->TopEdge+SDL_Window->BorderTop)*destpitch+(SDL_Window->BorderLeft+SDL_Window->LeftEdge)*this->screen->format->BytesPerPixel;
-
- for ( i=0; i<numrects; ++i )
- {
- srcwidth=rects[i].w;
-
- if ( !srcwidth ) { /* Clipped? */
- continue;
- }
-
- dest=destbase+rects[i].x*this->screen->format->BytesPerPixel;
- dest+=(rects[i].y*destpitch);
- src=((char *)(this->screen->pixels))+rects[i].x*this->screen->format->BytesPerPixel;
- src+=(rects[i].y*this->screen->pitch);
-
- srcwidth*=this->screen->format->BytesPerPixel;
-
-// D(bug("Rects: %ld,%ld %ld,%ld Src:%lx Dest:%lx\n",rects[i].x,rects[i].y,rects[i].w,rects[i].h,src,dest));
-
- for(j=rects[i].h;j;--j)
- {
- SDL_memcpy(dest,src,srcwidth);
- src+=this->screen->pitch;
- dest+=destpitch;
- }
- }
- UnLockBitMap(handle);
-// D(bug("Rectblit addr: %lx pitch: %ld rects:%ld srcptr: %lx srcpitch: %ld\n",bm_address,destpitch,numrects,this->screen->pixels,this->screen->pitch));
- }
- }
- else
- {
- for ( i=0; i<numrects; ++i ) {
- if ( ! rects[i].w ) { /* Clipped? */
- continue;
- }
- USE_WPA(this->screen->pixels,rects[i].x, rects[i].y,this->screen->pitch,
- SDL_RastPort,SDL_Window->BorderLeft+rects[i].x,SDL_Window->BorderTop+rects[i].y,
- rects[i].w,rects[i].h,format);
- }
- }
-}
-
-void CGX_RefreshDisplay(_THIS)
-{
- int format,customroutine=0;
-#ifndef USE_CGX_WRITELUTPIXEL
- int bpp;
-#endif
- /* Don't refresh a display that doesn't have an image (like GL) */
- if ( ! SDL_Ximage ) {
- return;
- }
-
- if(this->hidden->same_format && !use_picasso96)
- {
- format=RECTFMT_RAW;
- }
- else switch(this->screen->format->BytesPerPixel)
- {
- case 4:
- format=RECTFMT_RGBA;
- break;
- case 3:
- format=RECTFMT_RGB;
- break;
- case 2:
- customroutine=1;
- break;
- case 1:
-// D(bug("soft depth: 8 hardbpp: %ld\n",this->hidden->depth));
- if(this->hidden->depth>8)
- {
-#ifndef USE_CGX_WRITELUTPIXEL
- if(this->hidden->depth>32)
- customroutine=4;
- else if(this->hidden->depth>16)
- {
- bpp=this->hidden->BytesPerPixel; // That one is the only one that needs bpp
- customroutine=2; // The slow one!
- }
- else
- customroutine=3;
-#else
-
- customroutine=2;
-#endif
-// format=RECTFMT_LUT8;
- }
- else
- customroutine=1;
- break;
-
- }
-
- /* Check for endian-swapped X server, swap if necessary */
- if ( swap_pixels &&
- ((this->screen->format->BytesPerPixel%2) == 0) ) {
- CGX_SwapAllPixels(this->screen);
- USE_WPA(this->screen->pixels,0,0,this->screen->pitch,
- SDL_RastPort,SDL_Window->BorderLeft,SDL_Window->BorderTop,
- this->screen->w,this->screen->h,format);
- CGX_SwapAllPixels(this->screen);
- }
- else if (customroutine==2)
- {
-#ifdef USE_CGX_WRITELUTPIXEL
- WLUT(this->screen->pixels,0,0,this->screen->pitch,
- SDL_RastPort,SDL_XPixels,SDL_Window->BorderLeft,SDL_Window->BorderTop,
- this->screen->w,this->screen->h,CTABFMT_XRGB8);
-#else
- unsigned char *bm_address;
- Uint32 destpitch;
- APTR handle;
-
- if(handle=LockBitMapTags(SDL_RastPort->BitMap,LBMI_BASEADDRESS,(ULONG)&bm_address,
- LBMI_BYTESPERROW,(ULONG)&destpitch,TAG_DONE))
- {
- register int j,k,t;
- register unsigned char *mask,*dst;
- register unsigned char *src,*dest;
-
-// Aggiungo il bordo della finestra se sono fullscreen.
- if(!currently_fullscreen)
- dest=bm_address+(SDL_Window->TopEdge+SDL_Window->BorderTop)*destpitch+(SDL_Window->BorderLeft+SDL_Window->LeftEdge)*this->hidden->BytesPerPixel;
- else
- dest=bm_address;
-
- src=this->screen->pixels;
-
- for(j=this->screen->h;j;--j)
- {
- dst=dest;
-// SLOW routine, used for 8->24 bit mapping
- for(k=0;k<this->screen->w;k++)
- {
- mask=(unsigned char *)(&SDL_XPixels[src[k]]);
- for(t=0;t<bpp;t++)
- {
- dst[t]=mask[t];
- }
- dst+=bpp;
- }
- src+=this->screen->pitch;
- dest+=destpitch;
- }
- UnLockBitMap(handle);
- }
- }
- else if (customroutine==3)
- {
- unsigned char *bm_address;
- Uint32 destpitch;
- APTR handle;
-
- if(handle=LockBitMapTags(SDL_RastPort->BitMap,LBMI_BASEADDRESS,(ULONG)&bm_address,
- LBMI_BYTESPERROW,(ULONG)&destpitch,TAG_DONE))
- {
- register int j,k;
- register unsigned char *src,*dest;
- register Uint16 *destl,*srcl;
-
- if(!currently_fullscreen)
- dest=bm_address+(SDL_Window->TopEdge+SDL_Window->BorderTop)*destpitch+(SDL_Window->BorderLeft+SDL_Window->LeftEdge)*this->hidden->BytesPerPixel;
- else
- dest=bm_address;
-
- src=this->screen->pixels;
-
-// This is the fast, well not too slow, remapping code for 16bit displays
-
- for(j=this->screen->h;j;--j)
- {
- destl=(Uint16 *)dest;
-
- for(k=0;k<this->screen->w;k++)
- {
- srcl=(Uint16 *)&SDL_XPixels[src[k]];
- *destl=*srcl;
- destl++;
- }
- src+=this->screen->pitch;
- dest+=destpitch;
- }
- UnLockBitMap(handle);
- }
- }
- else if (customroutine==4)
- {
- unsigned char *bm_address;
- Uint32 destpitch;
- APTR handle;
-
- if(handle=LockBitMapTags(SDL_RastPort->BitMap,LBMI_BASEADDRESS,(ULONG)&bm_address,
- LBMI_BYTESPERROW,(ULONG)&destpitch,TAG_DONE))
- {
- register int j,k;
- register unsigned char *src,*dest;
- register Uint32 *destl,*srcl;
-
- if(!currently_fullscreen)
- dest=bm_address+(SDL_Window->TopEdge+SDL_Window->BorderTop)*destpitch+(SDL_Window->BorderLeft+SDL_Window->LeftEdge)*this->hidden->BytesPerPixel;
- else
- dest=bm_address;
-
- src=this->screen->pixels;
-
-// This is the fast, well not too slow, remapping code for 32bit displays
-
- for(j=this->screen->h;j;--j)
- {
- destl=(Uint32 *)dest;
-
- for(k=0;k<this->screen->w;k++)
- {
- srcl=(Uint32 *)&SDL_XPixels[src[k]];
- *destl=*srcl;
- destl++;
- }
- src+=this->screen->pitch;
- dest+=destpitch;
- }
- UnLockBitMap(handle);
- }
-#endif
- }
- else if(customroutine)
- {
- unsigned char *bm_address;
- Uint32 destpitch;
- APTR handle;
-
- if(handle=LockBitMapTags(SDL_RastPort->BitMap,
- LBMI_BASEADDRESS,(ULONG)&bm_address,
- LBMI_BYTESPERROW,(ULONG)&destpitch,TAG_DONE))
- {
- register int j;
- register unsigned char *src,*dest;
-
- if(!currently_fullscreen)
- dest=bm_address+(SDL_Window->TopEdge+SDL_Window->BorderTop)*destpitch+(SDL_Window->BorderLeft+SDL_Window->LeftEdge)*this->screen->format->BytesPerPixel;
- else
- dest=bm_address;
-
- src=this->screen->pixels;
-
-// D(bug("addr: %lx pitch: %ld src:%lx srcpitch: %ld\n",dest,destpitch,this->screen->pixels,this->screen->pitch));
-
- if(this->screen->pitch==destpitch)
- {
- SDL_memcpy(dest,src,this->screen->pitch*this->screen->h);
- }
- else
- {
- for(j=this->screen->h;j;--j)
- {
- SDL_memcpy(dest,src,this->screen->pitch);
- src+=this->screen->pitch;
- dest+=destpitch;
- }
- }
-
- UnLockBitMap(handle);
- }
- }
- else
- {
- USE_WPA(this->screen->pixels,0,0,this->screen->pitch,
- SDL_RastPort,SDL_Window->BorderLeft,SDL_Window->BorderTop,
- this->screen->w,this->screen->h,format);
- }
-
-}
diff --git a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgximage_c.h b/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgximage_c.h
deleted file mode 100644
index 30dc7a4..0000000
--- a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgximage_c.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_cgxvideo.h"
-
-extern int CGX_SetupImage(_THIS, SDL_Surface *screen);
-extern void CGX_DestroyImage(_THIS, SDL_Surface *screen);
-extern int CGX_ResizeImage(_THIS, SDL_Surface *screen, Uint32 flags);
-
-extern int CGX_AllocHWSurface(_THIS, SDL_Surface *surface);
-extern void CGX_FreeHWSurface(_THIS, SDL_Surface *surface);
-extern int CGX_LockHWSurface(_THIS, SDL_Surface *surface);
-extern void CGX_UnlockHWSurface(_THIS, SDL_Surface *surface);
-extern int CGX_FlipHWSurface(_THIS, SDL_Surface *surface);
-
-extern void CGX_RefreshDisplay(_THIS);
diff --git a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxmodes.c b/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxmodes.c
deleted file mode 100644
index fdf7dbd..0000000
--- a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxmodes.c
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Utilities for getting and setting the X display mode */
-
-#include "SDL_timer.h"
-#include "SDL_events.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_cgxvideo.h"
-#include "SDL_cgxwm_c.h"
-#include "SDL_cgxmodes_c.h"
-
-#define CGX_DEBUG
-
-static void set_best_resolution(_THIS, int width, int height)
-{
- Uint32 idok;
- int depth=8;
-
- if(SDL_Display)
- depth=GetCyberMapAttr(SDL_Display->RastPort.BitMap,CYBRMATTR_DEPTH);
-
- idok=BestCModeIDTags(CYBRBIDTG_NominalWidth,width,
- CYBRBIDTG_NominalHeight,height,
- CYBRBIDTG_Depth,depth,
- TAG_DONE);
-
- if(idok!=INVALID_ID)
- {
- if(SDL_Display)
- {
- if(currently_fullscreen)
- CloseScreen(SDL_Display);
- else
- UnlockPubScreen(NULL,SDL_Display);
- }
- SDL_Display=GFX_Display=OpenScreenTags(NULL,SA_Width,width,SA_Height,height,
- SA_Depth,depth,SA_DisplayID,idok,
- SA_ShowTitle,FALSE,
- TAG_DONE);
- }
-}
-
-static void get_real_resolution(_THIS, int* w, int* h)
-{
- *w = /*SDL_Display->Width*/ SDL_Window->Width-SDL_Window->BorderLeft-SDL_Window->BorderRight;
- *h = /*SDL_Display->Height*/ SDL_Window->Height-SDL_Window->BorderBottom-SDL_Window->BorderTop;
-}
-
-static void move_cursor_to(_THIS, int x, int y)
-{
-/* XWarpPointer(SDL_Display, None, SDL_Root, 0, 0, 0, 0, x, y); */
-
-/* DA FARE! */
-}
-
-static void add_visual(_THIS, int depth, int class)
-{
- Uint32 tID;
-
- tID=BestCModeIDTags(CYBRBIDTG_Depth,depth,
- CYBRBIDTG_NominalWidth,640,
- CYBRBIDTG_NominalHeight,480,
- TAG_DONE);
-
- if(tID!=INVALID_ID)
- {
- int n = this->hidden->nvisuals;
-
- this->hidden->visuals[n].depth = depth;
- this->hidden->visuals[n].visual = tID;
- this->hidden->visuals[n].bpp = GetCyberIDAttr(CYBRIDATTR_BPPIX,tID);
- this->hidden->nvisuals++;
- }
-}
-
-#define TrueColor 1
-#define PseudoColor 2
-
-int CGX_GetVideoModes(_THIS)
-{
- int i;
- ULONG nextid;
- int nmodes=0;
-
- SDL_modelist=NULL;
-
- nextid=NextDisplayInfo(INVALID_ID);
-
- while(nextid!=INVALID_ID)
- {
- if(IsCyberModeID(nextid))
- {
- DisplayInfoHandle h;
-
- if(h=FindDisplayInfo(nextid))
- {
- struct DimensionInfo info;
-
- if(GetDisplayInfoData(h,(char *)&info,sizeof(struct DimensionInfo),DTAG_DIMS,NULL))
- {
- int ok=0;
-
- for(i=0;i<nmodes;i++)
- {
- if( SDL_modelist[i]->w == (info.Nominal.MaxX+1) &&
- SDL_modelist[i]->h == (info.Nominal.MaxY+1) )
- ok=1;
- }
-
- if(!ok)
- {
- nmodes++;
-
- SDL_modelist = (SDL_Rect **)SDL_realloc(SDL_modelist,(nmodes+1)*sizeof(SDL_Rect *));
- SDL_modelist[nmodes]=NULL;
-
- if ( SDL_modelist )
- {
- SDL_modelist[nmodes-1] = (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
-
- if ( SDL_modelist[nmodes-1] == NULL )
- break;
-
- SDL_modelist[nmodes-1]->x = 0;
- SDL_modelist[nmodes-1]->y = 0;
- SDL_modelist[nmodes-1]->w = info.Nominal.MaxX+1;
- SDL_modelist[nmodes-1]->h = info.Nominal.MaxY+1;
- }
- }
- }
- }
- }
- nextid=NextDisplayInfo(nextid);
- }
-
-
- this->hidden->nvisuals = 0;
- /* Search for the visuals in deepest-first order, so that the first
- will be the richest one */
- add_visual(this, 32, TrueColor);
- add_visual(this, 24, TrueColor);
- add_visual(this, 16, TrueColor);
- add_visual(this, 15, TrueColor);
- add_visual(this, 8, PseudoColor);
-
- if(this->hidden->nvisuals == 0) {
- SDL_SetError("Found no sufficiently capable CGX visuals");
- return -1;
- }
-
- if ( SDL_modelist == NULL ) {
- SDL_modelist = (SDL_Rect **)SDL_malloc((1+1)*sizeof(SDL_Rect *));
- i = 0;
- if ( SDL_modelist ) {
- SDL_modelist[i] = (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
- if ( SDL_modelist[i] ) {
- SDL_modelist[i]->x = 0;
- SDL_modelist[i]->y = 0;
- SDL_modelist[i]->w = SDL_Display->Width;
- SDL_modelist[i]->h = SDL_Display->Height;
- ++i;
- }
- SDL_modelist[i] = NULL;
- }
- }
-
- D( if ( SDL_modelist ) {
- bug("CGX video mode list: (%ld)\n",nmodes);
- for ( i=0; SDL_modelist[i]; ++i ) {
- bug( "\t%ld x %ld\n",
- SDL_modelist[i]->w, SDL_modelist[i]->h);
- }
- }
- );
-
- D( { bug("CGX visuals list: (%ld)\n",this->hidden->nvisuals);
-
- for(i=0;i<this->hidden->nvisuals;i++)
- bug("\t%lx - depth: %ld bpp: %ld\n",this->hidden->visuals[i].visual,this->hidden->visuals[i].depth,this->hidden->visuals[i].bpp);
- }
- );
- return 0;
-}
-
-int CGX_SupportedVisual(_THIS, SDL_PixelFormat *format)
-{
- int i;
- for(i = 0; i < this->hidden->nvisuals; i++)
- {
- if(this->hidden->visuals[i].depth == format->BitsPerPixel) // Era bpp
- return 1;
- }
- return 0;
-}
-
-SDL_Rect **CGX_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- if ( CGX_SupportedVisual(this, format) ) {
- if ( flags & SDL_FULLSCREEN ) {
- return(SDL_modelist);
- } else {
- return((SDL_Rect **)-1);
- }
- } else {
- return((SDL_Rect **)0);
- }
-}
-
-void CGX_FreeVideoModes(_THIS)
-{
- int i;
-
- if ( SDL_modelist ) {
- for ( i=0; SDL_modelist[i]; ++i ) {
- SDL_free(SDL_modelist[i]);
- }
- SDL_free(SDL_modelist);
- SDL_modelist = NULL;
- }
-}
-
-int CGX_ResizeFullScreen(_THIS)
-{
- int x, y;
- int real_w, real_h;
-
- if ( currently_fullscreen ) {
-/* Per ora non faccio nulla qui */
- }
- return(1);
-}
-
-void _QueueEnterFullScreen(_THIS)
-{
-}
-
-int CGX_EnterFullScreen(_THIS)
-{
- int okay;
- Uint32 saved_flags;
-
- okay = 1;
- saved_flags = this->screen->flags;
-
- if ( ! currently_fullscreen )
- {
- int real_w, real_h;
-
- /* Map the fullscreen window to blank the screen */
- get_real_resolution(this, &real_w, &real_h);
-
- CGX_DestroyWindow(this,this->screen);
- set_best_resolution(this, real_w,real_h);
-
- currently_fullscreen = 1;
- this->screen->flags = saved_flags;
-
- CGX_CreateWindow(this,this->screen,real_w,real_h,GetCyberMapAttr(SDL_Display->RastPort.BitMap,CYBRMATTR_DEPTH),this->screen->flags);
-
- /* Set the new resolution */
- okay = CGX_ResizeFullScreen(this);
- if ( ! okay ) {
- CGX_LeaveFullScreen(this);
- }
- /* Set the colormap */
-/*
- if ( SDL_XColorMap ) {
- XInstallColormap(SDL_Display, SDL_XColorMap);
- }
-*/
- }
-// CGX_GrabInputNoLock(this, this->input_grab | SDL_GRAB_FULLSCREEN);
- return(okay);
-}
-
-int CGX_LeaveFullScreen(_THIS)
-{
- if ( currently_fullscreen ) {
- int width,height;
- if ( SDL_Window ) {
- CloseWindow(SDL_Window);
- SDL_Window=NULL;
- }
- CloseScreen(SDL_Display);
-
- GFX_Display=SDL_Display=LockPubScreen(NULL);
-
- currently_fullscreen = 0;
-
- CGX_CreateWindow(this,this->screen,this->screen->w,this->screen->h,GetCyberMapAttr(SDL_Display->RastPort.BitMap,CYBRMATTR_DEPTH),this->screen->flags);
- CGX_ResizeImage(this,this->screen,0L);
- }
-
- return(0);
-}
diff --git a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxmodes_c.h b/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxmodes_c.h
deleted file mode 100644
index 6c6f485..0000000
--- a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxmodes_c.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Utilities for getting and setting the X display mode */
-
-#include "SDL_cgxvideo.h"
-
-/* Define this if you want to grab the keyboard in fullscreen mode.
- If you do not define this, SDL will return from SDL_SetVideoMode()
- immediately, but will not actually go fullscreen until the window
- manager is idle.
-*/
-#define GRAB_FULLSCREEN
-
-extern int CGX_GetVideoModes(_THIS);
-extern SDL_Rect **CGX_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-extern void CGX_FreeVideoModes(_THIS);
-extern int CGX_ResizeFullScreen(_THIS);
-/*
-extern void CGX_WaitMapped(_THIS, Window win);
-extern void CGX_WaitUnmapped(_THIS, Window win);
-extern void CGX_QueueEnterFullScreen(_THIS);
-*/
-extern int CGX_EnterFullScreen(_THIS);
-extern int CGX_LeaveFullScreen(_THIS);
diff --git a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxvideo.c b/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxvideo.c
deleted file mode 100644
index e306746..0000000
--- a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxvideo.c
+++ /dev/null
@@ -1,1375 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * CGX based SDL video driver implementation by Gabriele Greco
- * gabriele.greco@aruba.it
- */
-
-#include "SDL_endian.h"
-#include "SDL_timer.h"
-#include "SDL_thread.h"
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_cgxgl_c.h"
-#include "SDL_cgxvideo.h"
-#include "SDL_cgxwm_c.h"
-#include "SDL_amigamouse_c.h"
-#include "SDL_amigaevents_c.h"
-#include "SDL_cgxmodes_c.h"
-#include "SDL_cgximage_c.h"
-
-/* Initialization/Query functions */
-static int CGX_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Surface *CGX_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int CGX_ToggleFullScreen(_THIS, int on);
-static void CGX_UpdateMouse(_THIS);
-static int CGX_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
-static void CGX_VideoQuit(_THIS);
-
-/* CGX driver bootstrap functions */
-
-struct Library *CyberGfxBase=NULL;
-struct IntuitionBase *IntuitionBase=NULL;
-struct GfxBase *GfxBase=NULL;
-
-int CGX_SetGamma(_THIS, float red, float green, float blue)
-{
- SDL_SetError("Gamma correction not supported");
- return -1;
-}
-
-int CGX_GetGamma(_THIS, float red, float green, float blue)
-{
- SDL_SetError("Gamma correction not supported");
- return -1;
-}
-
-int CGX_SetGammaRamp(_THIS, Uint16 *ramp)
-{
-#if 0
- Int i, ncolors;
- XColor xcmap[256];
-
- /* See if actually setting the gamma is supported */
- if ( SDL_Visual->class != DirectColor ) {
- SDL_SetError("Gamma correction not supported on this visual");
- return(-1);
- }
-
- /* Calculate the appropriate palette for the given gamma ramp */
- ncolors = SDL_Visual->map_entries;
- for ( i=0; i<ncolors; ++i ) {
- Uint8 c = (256 * i / ncolors);
- xcmap[i].pixel = SDL_MapRGB(this->screen->format, c, c, c);
- xcmap[i].red = ramp[0*256+c];
- xcmap[i].green = ramp[1*256+c];
- xcmap[i].blue = ramp[2*256+c];
- xcmap[i].flags = (DoRed|DoGreen|DoBlue);
- }
- XStoreColors(GFX_Display, SDL_XColorMap, xcmap, ncolors);
- XSync(GFX_Display, False);
-
- return(0);
-
-#else
- SDL_SetError("Gamma correction not supported on this visual");
- return(-1);
-
-#endif
-}
-
-static void DestroyScreen(_THIS)
-{
- if(currently_fullscreen)
- {
- if(this->hidden->dbuffer)
- {
- extern struct MsgPort *safeport,*dispport;
-
- this->hidden->dbuffer=0;
-
- if(safeport)
- {
- while(GetMsg(safeport)!=NULL);
- DeleteMsgPort(safeport);
- }
- if(dispport)
- {
- while(GetMsg(dispport)!=NULL);
- DeleteMsgPort(dispport);
- }
-
- this->hidden->SB[0]->sb_DBufInfo->dbi_SafeMessage.mn_ReplyPort=this->hidden->SB[0]->sb_DBufInfo->dbi_DispMessage.mn_ReplyPort=NULL;
- this->hidden->SB[1]->sb_DBufInfo->dbi_SafeMessage.mn_ReplyPort=this->hidden->SB[1]->sb_DBufInfo->dbi_DispMessage.mn_ReplyPort=NULL;
-
- if(this->hidden->SB[1])
- FreeScreenBuffer(SDL_Display,this->hidden->SB[1]);
- if(this->hidden->SB[0])
- FreeScreenBuffer(SDL_Display,this->hidden->SB[0]);
-
-
- this->hidden->SB[0]=this->hidden->SB[1]=NULL;
-
- if(SDL_RastPort && SDL_RastPort != &SDL_Display->RastPort)
- SDL_free(SDL_RastPort);
-
- SDL_RastPort=NULL;
- }
- CloseScreen(GFX_Display);
- currently_fullscreen=0;
- }
- else if(GFX_Display)
- UnlockPubScreen(NULL,GFX_Display);
-
- GFX_Display = NULL;
-}
-
-static int CGX_Available(void)
-{
- struct Library *l;
-
- l = OpenLibrary("cybergraphics.library",0L);
-
- if ( l != NULL ) {
- D(bug("CGX video device AVAILABLE\n"));
- CloseLibrary(l);
- }
- D(else bug("**CGX video device UNAVAILABLE\n"));
-
- return(l != NULL);
-}
-
-static void CGX_DeleteDevice(SDL_VideoDevice *device)
-{
- if ( device ) {
- if ( device->hidden ) {
- SDL_free(device->hidden);
- }
- if ( device->gl_data ) {
- SDL_free(device->gl_data);
- }
- SDL_free(device);
- }
-}
-
-static SDL_VideoDevice *CGX_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device ) {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *device->hidden));
- device->gl_data = (struct SDL_PrivateGLData *)
- SDL_malloc((sizeof *device->gl_data));
- }
- if ( (device == NULL) || (device->hidden == NULL) ||
- (device->gl_data == NULL) ) {
- D(bug("Unable to create video device!\n"));
- SDL_OutOfMemory();
- CGX_DeleteDevice(device);
- return(0);
- }
- SDL_memset(device->hidden, 0, sizeof(*device->hidden));
- SDL_memset(device->gl_data, 0, sizeof(*device->gl_data));
-
- /* Set the driver flags */
- device->handles_any_size = 1;
-
- /* Set the function pointers */
- device->VideoInit = CGX_VideoInit;
- device->ListModes = CGX_ListModes;
- device->SetVideoMode = CGX_SetVideoMode;
- device->ToggleFullScreen = CGX_ToggleFullScreen;
- device->UpdateMouse = CGX_UpdateMouse;
- device->SetColors = CGX_SetColors;
- device->UpdateRects = NULL;
- device->VideoQuit = CGX_VideoQuit;
- device->AllocHWSurface = CGX_AllocHWSurface;
- device->CheckHWBlit = CGX_CheckHWBlit;
- device->FillHWRect = CGX_FillHWRect;
- device->SetHWColorKey = CGX_SetHWColorKey;
- device->SetHWAlpha = NULL;
- device->LockHWSurface = CGX_LockHWSurface;
- device->UnlockHWSurface = CGX_UnlockHWSurface;
- device->FlipHWSurface = CGX_FlipHWSurface;
- device->FreeHWSurface = CGX_FreeHWSurface;
- device->SetGamma = CGX_SetGamma;
- device->GetGamma = CGX_GetGamma;
- device->SetGammaRamp = CGX_SetGammaRamp;
- device->GetGammaRamp = NULL;
-#if SDL_VIDEO_OPENGL
- device->GL_LoadLibrary = CGX_GL_LoadLibrary;
- device->GL_GetProcAddress = CGX_GL_GetProcAddress;
- device->GL_GetAttribute = CGX_GL_GetAttribute;
- device->GL_MakeCurrent = CGX_GL_MakeCurrent;
- device->GL_SwapBuffers = CGX_GL_SwapBuffers;
-#endif
- device->SetIcon = CGX_SetIcon;
- device->SetCaption = CGX_SetCaption;
- device->IconifyWindow = NULL; /* CGX_IconifyWindow; */
- device->GrabInput = NULL /* CGX_GrabInput*/;
- device->GetWMInfo = CGX_GetWMInfo;
- device->FreeWMCursor = amiga_FreeWMCursor;
- device->CreateWMCursor = amiga_CreateWMCursor;
- device->ShowWMCursor = amiga_ShowWMCursor;
- device->WarpWMCursor = amiga_WarpWMCursor;
- device->CheckMouseMode = amiga_CheckMouseMode;
- device->InitOSKeymap = amiga_InitOSKeymap;
- device->PumpEvents = amiga_PumpEvents;
-
- device->free = CGX_DeleteDevice;
-
- return device;
-}
-
-VideoBootStrap CGX_bootstrap = {
- "CGX", "AmigaOS CyberGraphics", CGX_Available, CGX_CreateDevice
-};
-
-Uint32 MakeBitMask(_THIS,int type,int format,int *bpp)
-{
- D(if(type==0)bug("REAL pixel format: "));
-
- if(this->hidden->depth==*bpp)
- {
-
- switch(format)
- {
- case PIXFMT_LUT8:
- D(if(type==0)bug("LUT8\n"));
- return 0;
- case PIXFMT_BGR15:
- case PIXFMT_RGB15PC:
- switch(type)
- {
- case 0:
- D(bug("RGB15PC/BGR15\n"));
- return 31;
- case 1:
- return 992;
- case 2:
- return 31744;
- }
- case PIXFMT_RGB15:
- case PIXFMT_BGR15PC:
- switch(type)
- {
- case 0:
- D(bug("RGB15/BGR15PC\n"));
- return 31744;
- case 1:
- return 992;
- case 2:
- return 31;
- }
- case PIXFMT_BGR16PC:
- case PIXFMT_RGB16:
- switch(type)
- {
- case 0:
- D(bug("RGB16PC\n"));
- return 63488;
- case 1:
- return 2016;
- case 2:
- return 31;
- }
- case PIXFMT_BGR16:
- case PIXFMT_RGB16PC:
- switch(type)
- {
- case 0:
- D(bug("RGB16PC/BGR16\n"));
- return 31;
- case 1:
- return 2016;
- case 2:
- return 63488;
- }
-
- case PIXFMT_RGB24:
- switch(type)
- {
- case 0:
- D(bug("RGB24/BGR24\n"));
- return 0xff0000;
- case 1:
- return 0xff00;
- case 2:
- return 0xff;
- }
- case PIXFMT_BGR24:
- switch(type)
- {
- case 0:
- D(bug("BGR24\n"));
- return 0xff;
- case 1:
- return 0xff00;
- case 2:
- return 0xff0000;
- }
- case PIXFMT_ARGB32:
- switch(type)
- {
- case 0:
- D(bug("ARGB32\n"));
- return 0xff0000;
- case 1:
- return 0xff00;
- case 2:
- return 0xff;
- }
- case PIXFMT_BGRA32:
- switch(type)
- {
- case 0:
- D(bug("BGRA32\n"));
- return 0xff00;
- case 1:
- return 0xff0000;
- case 2:
- return 0xff000000;
- }
- case PIXFMT_RGBA32:
- switch(type)
- {
- case 0:
- D(bug("RGBA32\n"));
- return 0xff000000;
- case 1:
- return 0xff0000;
- case 2:
- return 0xff00;
- }
- default:
- D(bug("Unknown pixel format! Default to 24bit\n"));
- return (Uint32) (255<<(type*8));
- }
- }
- else
- {
- D(if(type==0)bug("DIFFERENT from screen.\nAllocated screen format: "));
-
- switch(*bpp)
- {
- case 32:
- D(if(type==0) bug("RGBA32\n"));
- switch(type)
- {
- case 0:
- return 0xff000000;
- case 1:
- return 0xff0000;
- case 2:
- return 0xff00;
- }
- break;
- case 24:
-use_truecolor:
- switch(type)
- {
- case 0:
- D(bug("RGB24\n"));
- return 0xff0000;
- case 1:
- return 0xff00;
- case 2:
- return 0xff;
- }
- case 16:
- case 15:
- D(if(type==0) bug("Not supported, switching to 24bit!\n"));
- *bpp=24;
- goto use_truecolor;
- break;
- default:
- D(if(type==0)bug("This is a chunky display\n"));
-// For chunky display mask is always 0;
- return 0;
- }
- }
- return 0;
-}
-
-static int CGX_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- int i;
- struct Library *RTGBase;
-
- D(bug("VideoInit... Opening libraries\n"));
-
- if(!IntuitionBase) {
- if( !(IntuitionBase=(struct IntuitionBase *)OpenLibrary("intuition.library",39L))) {
- SDL_SetError("Couldn't open intuition V39+");
- return -1;
- }
- }
-
- if(!GfxBase) {
- if( !(GfxBase=(struct GfxBase *)OpenLibrary("graphics.library",39L))) {
- SDL_SetError("Couldn't open graphics V39+");
- return -1;
- }
- }
-
- if(!CyberGfxBase) {
- if( !(CyberGfxBase=OpenLibrary("cybergraphics.library",40L))) {
- SDL_SetError("Couldn't open cybergraphics.");
- return(-1);
- }
- }
-
- if(RTGBase=OpenLibrary("libs:picasso96/rtg.library",0L)) {
- extern int use_picasso96;
-
- CloseLibrary(RTGBase);
- use_picasso96=1;
- }
-
- D(bug("Library intialized, locking screen...\n"));
-
- SDL_Display = LockPubScreen(NULL);
-
- if ( SDL_Display == NULL ) {
- D(bug("Cannot lock display...\n"));
- SDL_SetError("Couldn't lock the display");
- return(-1);
- }
- this->info.current_w = SDL_Display->Width;
- this->info.current_h = SDL_Display->Height;
-
- D(bug("Checking if we are using a CGX native display...\n"));
-
- if(!IsCyberModeID(GetVPModeID(&SDL_Display->ViewPort)))
- {
- Uint32 okid=BestCModeIDTags(CYBRBIDTG_NominalWidth,SDL_Display->Width,
- CYBRBIDTG_NominalHeight,SDL_Display->Height,
- CYBRBIDTG_Depth,8,
- TAG_DONE);
-
- D(bug("Default visual is not CGX native!\n"));
-
- UnlockPubScreen(NULL,SDL_Display);
-
- GFX_Display=NULL;
-
- if(okid!=INVALID_ID)
- {
- GFX_Display=OpenScreenTags(NULL,
- SA_Width,SDL_Display->Width,
- SA_Height,SDL_Display->Height,
- SA_Depth,8,SA_Quiet,TRUE,
- SA_ShowTitle,FALSE,
- SA_DisplayID,okid,
- TAG_DONE);
- }
-
- if(!GFX_Display)
- {
- SDL_SetError("Unable to open a suited CGX display");
- return -1;
- }
- else SDL_Display=GFX_Display;
-
- }
- else GFX_Display = SDL_Display;
-
-
- /* See whether or not we need to swap pixels */
-
- swap_pixels = 0;
-
-// Non e' detto che sia cosi' pero', alcune schede potrebbero gestire i modi in modo differente
-
- if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) {
- swap_pixels = 1;
- }
-
- D(bug("Before GetVideoModes....\n"));
-
- /* Get the available video modes */
- if(CGX_GetVideoModes(this) < 0)
- return -1;
-
- /* Determine the default screen depth:
- Use the default visual (or at least one with the same depth) */
-
- for(i = 0; i < this->hidden->nvisuals; i++)
- if(this->hidden->visuals[i].depth == GetCyberMapAttr(SDL_Display->RastPort.BitMap,CYBRMATTR_DEPTH))
- break;
- if(i == this->hidden->nvisuals) {
- /* default visual was useless, take the deepest one instead */
- i = 0;
- }
- SDL_Visual = this->hidden->visuals[i].visual;
-
-// SDL_XColorMap = SDL_DisplayColormap;
-
- this->hidden->depth = this->hidden->visuals[i].depth;
- D(bug("Init: Setting screen depth to: %ld\n",this->hidden->depth));
- vformat->BitsPerPixel = this->hidden->visuals[i].depth; /* this->hidden->visuals[i].bpp; */
-
- {
- int form;
- APTR handle;
- struct DisplayInfo info;
-
- if(!(handle=FindDisplayInfo(this->hidden->visuals[i].visual)))
- {
- D(bug("Unable to get visual info...\n"));
- return -1;
- }
-
- if(!GetDisplayInfoData(handle,(char *)&info,sizeof(struct DisplayInfo),DTAG_DISP,NULL)) {
- D(bug("Unable to get visual info data...\n"));
- return -1;
- }
-
- form=GetCyberIDAttr(CYBRIDATTR_PIXFMT,SDL_Visual);
-
-// In this case I use makebitmask in a way that I'm sure I'll get PIXFMT pixel mask
-
- if ( vformat->BitsPerPixel > 8 )
- {
- vformat->Rmask = MakeBitMask(this,0,form,&this->hidden->depth);
- vformat->Gmask = MakeBitMask(this,1,form,&this->hidden->depth);
- vformat->Bmask = MakeBitMask(this,2,form,&this->hidden->depth);
- }
- }
-
- /* See if we have been passed a window to use */
-/* SDL_windowid = SDL_getenv("SDL_WINDOWID"); */
- SDL_windowid=NULL;
-
- /* Create the blank cursor */
- SDL_BlankCursor = AllocMem(16,MEMF_CHIP|MEMF_CLEAR);
-
- /* Fill in some window manager capabilities */
- this->info.wm_available = 1;
- this->info.blit_hw = 1;
- this->info.blit_hw_CC = 1;
- this->info.blit_sw = 1;
- this->info.blit_fill = 1;
- this->info.video_mem=2000000; // Not always true but almost any Amiga card has this memory!
-
- this->hidden->same_format=0;
- SDL_RastPort=&SDL_Display->RastPort;
- /* We're done! */
- D(bug("End of CGX_VideoInit\n"));
-
- return(0);
-}
-
-void CGX_DestroyWindow(_THIS, SDL_Surface *screen)
-{
- D(bug("Destroy Window...\n"));
-
- if ( ! SDL_windowid ) {
- /* Hide the managed window */
- int was_fullscreen=0;
-
- /* Clean up OpenGL */
- if ( screen ) {
- screen->flags &= ~(SDL_OPENGL|SDL_OPENGLBLIT);
- }
-
- if ( screen && (screen->flags & SDL_FULLSCREEN) ) {
- was_fullscreen=1;
- screen->flags &= ~SDL_FULLSCREEN;
-// CGX_LeaveFullScreen(this); tolto x crash
- }
-
- /* Destroy the output window */
- if ( SDL_Window ) {
- CloseWindow(SDL_Window);
- SDL_Window=NULL;
- }
-
- /* Free the colormap entries */
- if ( SDL_XPixels ) {
- int numcolors;
- unsigned long pixel;
-
- if(this->screen->format&&this->hidden->depth==8&&!was_fullscreen)
- {
- numcolors = 1<<this->screen->format->BitsPerPixel;
-
- if(numcolors>256)
- numcolors=256;
-
- if(!was_fullscreen&&this->hidden->depth==8)
- {
- for ( pixel=0; pixel<numcolors; pixel++ )
- {
- if(SDL_XPixels[pixel]>=0)
- ReleasePen(GFX_Display->ViewPort.ColorMap,SDL_XPixels[pixel]);
- }
- }
- }
- SDL_free(SDL_XPixels);
- SDL_XPixels = NULL;
- }
- }
-}
-
-static void CGX_SetSizeHints(_THIS, int w, int h, Uint32 flags)
-{
- if ( flags & SDL_RESIZABLE ) {
- WindowLimits(SDL_Window, 32, 32,4096,4096);
- } else {
- WindowLimits(SDL_Window, w,h,w,h);
- }
- if ( flags & SDL_FULLSCREEN ) {
- flags&=~SDL_RESIZABLE;
- } else if ( SDL_getenv("SDL_VIDEO_CENTERED") ) {
- int display_w, display_h;
-
- display_w = SDL_Display->Width;
- display_h = SDL_Display->Height;
- ChangeWindowBox(SDL_Window,(display_w - w - SDL_Window->BorderLeft-SDL_Window->BorderRight)/2,
- (display_h - h - SDL_Window->BorderTop-SDL_Window->BorderBottom)/2,
- w+SDL_Window->BorderLeft+SDL_Window->BorderRight,
- h+SDL_Window->BorderTop+SDL_Window->BorderBottom);
- }
-}
-
-int CGX_CreateWindow(_THIS, SDL_Surface *screen,
- int w, int h, int bpp, Uint32 flags)
-{
-#if 0
- int i, depth;
- Uint32 vis;
-#endif
- D(bug("CGX_CreateWindow\n"));
-
- /* If a window is already present, destroy it and start fresh */
- if ( SDL_Window ) {
- CGX_DestroyWindow(this, screen);
- }
-
- /* See if we have been given a window id */
- if ( SDL_windowid ) {
- SDL_Window = (struct Window *)atol(SDL_windowid);
- } else {
- SDL_Window = 0;
- }
-
- /* find out which visual we are going to use */
-#if 0
-/* questo l'ho spostato nell'apertura dello schermo, in quanto su Amiga le finestre
- hanno il pixel mode degli schermi.
- */
- /*if ( flags & SDL_OPENGL ) {
- SDL_SetError("OpenGL not supported by the Amiga SDL!");
- return -1;
- }
- else {*/
- for ( i = 0; i < this->hidden->nvisuals; i++ ) {
- if ( this->hidden->visuals[i].depth == bpp ) /* era .depth */
- break;
- }
- if ( i == this->hidden->nvisuals ) {
- SDL_SetError("No matching visual for requested depth");
- return -1; /* should never happen */
- }
- vis = this->hidden->visuals[i].visual;
- depth = this->hidden->visuals[i].depth;
-// }
- SDL_Visual = vis;
- this->hidden->depth = depth;
- D(bug("Setting screen depth to: %ld\n",this->hidden->depth));
-#endif
-
- /* Allocate the new pixel format for this video mode */
- {
- Uint32 form;
- APTR handle;
- struct DisplayInfo info;
-
- if(!(handle=FindDisplayInfo(SDL_Visual)))
- return -1;
-
- if(!GetDisplayInfoData(handle,(char *)&info,sizeof(struct DisplayInfo),DTAG_DISP,NULL))
- return -1;
-
- form=GetCyberIDAttr(CYBRIDATTR_PIXFMT,SDL_Visual);
-
- if(flags&SDL_HWSURFACE)
- {
- if(bpp!=this->hidden->depth)
- {
- bpp=this->hidden->depth;
- D(bug("Accel forces bpp to be equal (%ld)\n",bpp));
- }
- }
-
- D(bug("BEFORE screen allocation: bpp:%ld (real:%ld)\n",bpp,this->hidden->depth));
-
-/* With this call if needed I'll revert the wanted bpp to a bpp best suited for the display, actually occurs
- only with requested format 15/16bit and display format != 15/16bit
- */
-
- if ( ! SDL_ReallocFormat(screen, bpp,
- MakeBitMask(this,0,form,&bpp), MakeBitMask(this,1,form,&bpp), MakeBitMask(this,2,form,&bpp), 0) )
- return -1;
-
- D(bug("AFTER screen allocation: bpp:%ld (real:%ld)\n",bpp,this->hidden->depth));
-
- }
-
- /* Create the appropriate colormap */
-/*
- if ( SDL_XColorMap != SDL_DisplayColormap ) {
- XFreeColormap(SDL_Display, SDL_XColorMap);
- }
-*/
- if ( GetCyberMapAttr(SDL_Display->RastPort.BitMap,CYBRMATTR_PIXFMT)==PIXFMT_LUT8 || bpp==8 ) {
- int ncolors,i;
- D(bug("XPixels palette allocation...\n"));
-
- /* Allocate the pixel flags */
-
- if(bpp==8)
- ncolors=256;
- else
- ncolors = 1 << screen->format->BitsPerPixel;
-
- SDL_XPixels = (Sint32 *)SDL_malloc(ncolors * sizeof(Sint32));
-
- if(SDL_XPixels == NULL) {
- SDL_OutOfMemory();
- return -1;
- }
-
-
- for(i=0;i<ncolors;i++)
- SDL_XPixels[i]=-1;
-
- /* always allocate a private colormap on non-default visuals */
- if(bpp==8)
- flags |= SDL_HWPALETTE;
-
- if ( flags & SDL_HWPALETTE )
- screen->flags |= SDL_HWPALETTE;
- }
-
- /* resize the (possibly new) window manager window */
-
- /* Create (or use) the X11 display window */
-
- if ( !SDL_windowid ) {
- if( flags & SDL_FULLSCREEN )
- {
- SDL_Window = OpenWindowTags(NULL,WA_Width,w,WA_Height,h,
- WA_Flags,WFLG_ACTIVATE|WFLG_RMBTRAP|WFLG_BORDERLESS|WFLG_BACKDROP|WFLG_REPORTMOUSE,
- WA_IDCMP,IDCMP_RAWKEY|IDCMP_MOUSEBUTTONS|IDCMP_MOUSEMOVE,
- WA_CustomScreen,(ULONG)SDL_Display,
- TAG_DONE);
-
- D(bug("Opening backdrop window %ldx%ld on display %lx!\n",w,h,SDL_Display));
- }
- else
- {
- /* Create GimmeZeroZero window when OpenGL is used */
- unsigned long gzz = FALSE;
- if( flags & SDL_OPENGL ) {
- gzz = TRUE;
- }
-
- SDL_Window = OpenWindowTags(NULL,WA_InnerWidth,w,WA_InnerHeight,h,
- WA_Flags,WFLG_REPORTMOUSE|WFLG_ACTIVATE|WFLG_RMBTRAP | ((flags&SDL_NOFRAME) ? 0 : (WFLG_DEPTHGADGET|WFLG_CLOSEGADGET|WFLG_DRAGBAR | ((flags&SDL_RESIZABLE) ? WFLG_SIZEGADGET|WFLG_SIZEBBOTTOM : 0))),
- WA_IDCMP,IDCMP_RAWKEY|IDCMP_CLOSEWINDOW|IDCMP_MOUSEBUTTONS|IDCMP_NEWSIZE|IDCMP_MOUSEMOVE,
- WA_PubScreen,(ULONG)SDL_Display,
- WA_GimmeZeroZero, gzz,
- TAG_DONE);
- D(bug("Opening WB window of size: %ldx%ld!\n",w,h));
- }
-
- if(!SDL_Window)
- return -1;
- }
-
- this->hidden->BytesPerPixel=GetCyberMapAttr(SDL_Window->RPort->BitMap,CYBRMATTR_BPPIX);
-
- if(screen->flags & SDL_DOUBLEBUF)
- {
- if(SDL_RastPort=SDL_malloc(sizeof(struct RastPort)))
- {
- InitRastPort(SDL_RastPort);
- SDL_RastPort->BitMap=this->hidden->SB[1]->sb_BitMap;
- }
- else
- return -1;
- }
- else SDL_RastPort=SDL_Window->RPort;
-
- if(flags&SDL_HWSURFACE)
- screen->flags|=SDL_HWSURFACE;
-
- if( !SDL_windowid ) {
- CGX_SetSizeHints(this, w, h, flags);
- }
-
- /* Set our colormaps when not setting a GL mode */
-/*
- if ( ! (flags & SDL_OPENGL) ) {
- XSetWindowColormap(SDL_Display, SDL_Window, SDL_XColorMap);
- }
-*/
-
- /* Map them both and go fullscreen, if requested */
- if ( ! SDL_windowid ) {
- if ( flags & SDL_FULLSCREEN ) {
- screen->flags |= SDL_FULLSCREEN;
- currently_fullscreen=1;
-// CGX_EnterFullScreen(this); Ci siamo gia'!
- } else {
- screen->flags &= ~SDL_FULLSCREEN;
- }
- }
- screen->w = w;
- screen->h = h;
- screen->pitch = SDL_CalculatePitch(screen);
- CGX_ResizeImage(this, screen, flags);
-
- /* Make OpenGL Context if needed*/
- if(flags & SDL_OPENGL) {
- if(this->gl_data->gl_active == 0) {
- if(CGX_GL_Init(this) < 0)
- return -1;
- else
- screen->flags |= SDL_OPENGL;
- }
- else {
- if(CGX_GL_Update(this) < 0)
- return -1;
- else
- screen->flags |= SDL_OPENGL;
- }
- }
-}
-
-int CGX_ResizeWindow(_THIS,
- SDL_Surface *screen, int w, int h, Uint32 flags)
-{
- D(bug("CGX_ResizeWindow\n"));
-
- if ( ! SDL_windowid ) {
- /* Resize the window manager window */
- CGX_SetSizeHints(this, w, h, flags);
-
- ChangeWindowBox(SDL_Window,SDL_Window->LeftEdge,SDL_Window->TopEdge, w+SDL_Window->BorderLeft+SDL_Window->BorderRight,
- h+SDL_Window->BorderTop+SDL_Window->BorderBottom);
-
- screen->w = w;
- screen->h = h;
- screen->pitch = SDL_CalculatePitch(screen);
- CGX_ResizeImage(this, screen, flags);
- }
- return(0);
-}
-
-static SDL_Surface *CGX_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- Uint32 saved_flags;
- int needcreate=0;
-
- D(bug("CGX_SetVideoMode current:%lx\n",current));
-
- /* Lock the event thread, in multi-threading environments */
- SDL_Lock_EventThread();
-
-// Check if the window needs to be closed or can be resized
-
- if( (flags&SDL_FULLSCREEN) || (current && current->flags&SDL_FULLSCREEN && !(flags&SDL_FULLSCREEN)))
- needcreate=1;
-
-// Check if we need to close an already existing videomode...
-
- if(current && current->flags&SDL_FULLSCREEN && !(flags&SDL_FULLSCREEN)) {
- unsigned long i;
- D(bug("Destroying image, window & screen!\n"));
-
- CGX_DestroyImage(this,current);
- CGX_DestroyWindow(this,current);
- DestroyScreen(this);
- GFX_Display=SDL_Display=LockPubScreen(NULL);
-
- bpp=this->hidden->depth=GetCyberMapAttr(SDL_Display->RastPort.BitMap,CYBRMATTR_DEPTH);
-
- for ( i = 0; i < this->hidden->nvisuals; i++ ) {
- if ( this->hidden->visuals[i].depth == bpp ) /* era .depth */
- break;
- }
- if ( i == this->hidden->nvisuals ) {
- SDL_SetError("No matching visual for requested depth");
- return NULL; /* should never happen */
- }
- SDL_Visual = this->hidden->visuals[i].visual;
-
- D(bug("Setting screen depth to: %ld\n",this->hidden->depth));
-
- }
- /* Check the combination of flags we were passed */
- if ( flags & SDL_FULLSCREEN ) {
- int i;
-
- /* Clear fullscreen flag if not supported */
- if ( SDL_windowid ) {
- flags &= ~SDL_FULLSCREEN;
- }
- else if(current && current->flags&SDL_FULLSCREEN ) {
- if(current->w!=width ||
- current->h!=height ||
- (this->hidden && this->hidden->depth!=bpp))
- {
- D(bug("Deleting previous window...\n"));
- CGX_DestroyImage(this,current);
- CGX_DestroyWindow(this,current);
- DestroyScreen(this);
- goto buildnewscreen;
- }
- }
- else
-buildnewscreen:
- {
- Uint32 okid=BestCModeIDTags(CYBRBIDTG_NominalWidth,width,
- CYBRBIDTG_NominalHeight,height,
- CYBRBIDTG_Depth,bpp,
- TAG_DONE);
-
- GFX_Display=NULL;
-
- D(bug("Opening screen...\n"));
-
- if(okid!=INVALID_ID)
- GFX_Display=OpenScreenTags(NULL,
- SA_Width,width,
- SA_Height,height,
- SA_Quiet,TRUE,SA_ShowTitle,FALSE,
- SA_Depth,bpp,
- SA_DisplayID,okid,
- TAG_DONE);
-
- if(!GFX_Display) {
- GFX_Display=SDL_Display;
- flags &= ~SDL_FULLSCREEN;
- flags &= ~SDL_DOUBLEBUF;
- }
- else {
- UnlockPubScreen(NULL,SDL_Display);
- SDL_Display=GFX_Display;
-
- D(bug("Screen opened.\n"));
-
- if(flags&SDL_DOUBLEBUF) {
- int ok=0;
- D(bug("Start of DBuffering allocations...\n"));
-
- if(this->hidden->SB[0]=AllocScreenBuffer(SDL_Display,NULL,SB_SCREEN_BITMAP)) {
-
- if(this->hidden->SB[1]=AllocScreenBuffer(SDL_Display,NULL,0L)) {
- extern struct MsgPort *safeport,*dispport;
-
- safeport=CreateMsgPort();
- dispport=CreateMsgPort();
-
- if(!safeport || !dispport) {
- if(safeport) {
- DeleteMsgPort(safeport);
- safeport=NULL;
- }
- if(dispport) {
- DeleteMsgPort(dispport);
- dispport=NULL;
- }
- FreeScreenBuffer(SDL_Display,this->hidden->SB[0]);
- FreeScreenBuffer(SDL_Display,this->hidden->SB[1]);
- }
- else {
- extern ULONG safe_sigbit,disp_sigbit;
- int i;
-
- safe_sigbit=1L<< safeport->mp_SigBit;
- disp_sigbit=1L<< dispport->mp_SigBit;
-
- for(i=0;i<2;i++) {
- this->hidden->SB[i]->sb_DBufInfo->dbi_SafeMessage.mn_ReplyPort=safeport;
- this->hidden->SB[i]->sb_DBufInfo->dbi_DispMessage.mn_ReplyPort=dispport;
- }
-
- ok=1;
- D(bug("Dbuffering enabled!\n"));
- this->hidden->dbuffer=1;
- current->flags|=SDL_DOUBLEBUF;
- }
- }
- else {
- FreeScreenBuffer(SDL_Display,this->hidden->SB[1]);
- this->hidden->SB[0]=NULL;
- }
- }
-
- if(!ok)
- flags&=~SDL_DOUBLEBUF;
- }
- }
-
- if(GetCyberMapAttr(SDL_Display->RastPort.BitMap,CYBRMATTR_DEPTH)==bpp)
- this->hidden->same_format=1;
- }
-
- bpp=this->hidden->depth=GetCyberMapAttr(SDL_Display->RastPort.BitMap,CYBRMATTR_DEPTH);
- D(bug("Setting screen depth to: %ld\n",this->hidden->depth));
-
- for ( i = 0; i < this->hidden->nvisuals; i++ )
- if ( this->hidden->visuals[i].depth == bpp ) /* era .depth */
- break;
-
- if ( i == this->hidden->nvisuals ) {
- SDL_SetError("No matching visual for requested depth");
- return NULL; /* should never happen */
- }
- SDL_Visual = this->hidden->visuals[i].visual;
-
- }
-
- /* Set up the X11 window */
- saved_flags = current->flags;
-
- if (SDL_Window && (saved_flags&SDL_OPENGL) == (flags&SDL_OPENGL)
- && bpp == current->format->BitsPerPixel && !needcreate) {
- if (CGX_ResizeWindow(this, current, width, height, flags) < 0) {
- current = NULL;
- goto done;
- }
- } else {
- if (CGX_CreateWindow(this,current,width,height,bpp,flags) < 0) {
- current = NULL;
- goto done;
- }
- }
-
-#if 0
- /* Set up the new mode framebuffer */
- if ( ((current->w != width) || (current->h != height)) ||
- ((saved_flags&SDL_OPENGL) != (flags&SDL_OPENGL)) ) {
- current->w = width;
- current->h = height;
- current->pitch = SDL_CalculatePitch(current);
- CGX_ResizeImage(this, current, flags);
- }
-#endif
-
- current->flags |= (flags&SDL_RESIZABLE); // Resizable only if the user asked it
-
- done:
- /* Release the event thread */
- SDL_Unlock_EventThread();
-
- /* We're done! */
- return(current);
-}
-
-static int CGX_ToggleFullScreen(_THIS, int on)
-{
- Uint32 event_thread;
-
- /* Don't switch if we don't own the window */
- if ( SDL_windowid ) {
- return(0);
- }
-
- /* Don't lock if we are the event thread */
- event_thread = SDL_EventThreadID();
- if ( event_thread && (SDL_ThreadID() == event_thread) ) {
- event_thread = 0;
- }
- if ( event_thread ) {
- SDL_Lock_EventThread();
- }
- if ( on ) {
- this->screen->flags |= SDL_FULLSCREEN;
- CGX_EnterFullScreen(this);
- } else {
- this->screen->flags &= ~SDL_FULLSCREEN;
- CGX_LeaveFullScreen(this);
- }
-
- CGX_RefreshDisplay(this);
- if ( event_thread ) {
- SDL_Unlock_EventThread();
- }
-
- SDL_ResetKeyboard();
-
- return(1);
-}
-
-static void SetSingleColor(Uint32 fmt, unsigned char r, unsigned char g, unsigned char b, unsigned char *c)
-{
- switch(fmt)
- {
- case PIXFMT_BGR15:
- case PIXFMT_RGB15PC:
- {
- Uint16 *t=(Uint16 *)c;
- *t=(r>>3) | ((g>>3)<<5) | ((b>>3)<<10) ;
- }
- break;
- case PIXFMT_RGB15:
- case PIXFMT_BGR15PC:
- {
- Uint16 *t=(Uint16 *)c;
- *t=(b>>3) | ((g>>3)<<5) | ((r>>3)<<10) ;
- }
- break;
- case PIXFMT_BGR16PC:
- case PIXFMT_RGB16:
- {
- Uint16 *t=(Uint16 *)c;
- *t=(b>>3) | ((g>>2)<<5) | ((r>>3)<<11) ;
- }
- break;
- case PIXFMT_BGR16:
- case PIXFMT_RGB16PC:
- {
- Uint16 *t=(Uint16 *)c;
- *t=(r>>3) | ((g>>2)<<5) | ((b>>3)<<11) ;
- }
- break;
- case PIXFMT_RGB24:
- c[0]=r;
- c[1]=g;
- c[2]=b;
- c[3]=0;
- break;
- case PIXFMT_BGR24:
- c[0]=b;
- c[1]=g;
- c[2]=r;
- c[3]=0;
- break;
- case PIXFMT_ARGB32:
- c[0]=0;
- c[1]=r;
- c[2]=g;
- c[3]=b;
- break;
- case PIXFMT_BGRA32:
- c[0]=b;
- c[1]=g;
- c[2]=r;
- c[3]=0;
- break;
- case PIXFMT_RGBA32:
- c[0]=r;
- c[1]=g;
- c[2]=b;
- c[3]=0;
- break;
-
- default:
- D(bug("Error, SetSingleColor with PIXFMT %ld!\n",fmt));
- }
-}
-
-/* Update the current mouse state and position */
-static void CGX_UpdateMouse(_THIS)
-{
- /* Lock the event thread, in multi-threading environments */
- SDL_Lock_EventThread();
-
- if(currently_fullscreen)
- {
- SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
- SDL_PrivateMouseMotion(0, 0, SDL_Display->MouseX, SDL_Display->MouseY);
- }
- else
- {
- if( SDL_Display->MouseX>=(SDL_Window->LeftEdge+SDL_Window->BorderLeft) && SDL_Display->MouseX<(SDL_Window->LeftEdge+SDL_Window->Width-SDL_Window->BorderRight) &&
- SDL_Display->MouseY>=(SDL_Window->TopEdge+SDL_Window->BorderLeft) && SDL_Display->MouseY<(SDL_Window->TopEdge+SDL_Window->Height-SDL_Window->BorderBottom)
- )
- {
- SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
- SDL_PrivateMouseMotion(0, 0, SDL_Display->MouseX-SDL_Window->LeftEdge-SDL_Window->BorderLeft,
- SDL_Display->MouseY-SDL_Window->TopEdge-SDL_Window->BorderTop);
- }
- else
- {
- SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
- }
- }
- SDL_Unlock_EventThread();
-}
-
-static int CGX_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- int i;
-
- /* Check to make sure we have a colormap allocated */
-
- /* It's easy if we have a hidden colormap */
- if ( (this->screen->flags & SDL_HWPALETTE) && currently_fullscreen )
- {
- ULONG xcmap[256*3+2];
-
- xcmap[0]=(ncolors<<16);
- xcmap[0]+=firstcolor;
-
-// D(bug("Setting %ld colors on an HWPALETTE screen\n",ncolors));
-
- for ( i=0; i<ncolors; i++ ) {
- xcmap[i*3+1] = colors[i+firstcolor].r<<24;
- xcmap[i*3+2] = colors[i+firstcolor].g<<24;
- xcmap[i*3+3] = colors[i+firstcolor].b<<24;
- }
- xcmap[ncolors*3+1]=0;
- LoadRGB32(&GFX_Display->ViewPort,xcmap);
- } else {
-// XPixels are not needed on 8bit screen with hwpalette
- unsigned long pixel;
-
- if ( SDL_XPixels == NULL ) {
- D(bug("SetColors without colormap!"));
- return(0);
- }
-
- if(this->hidden->depth==8)
- {
-// In this case I have to unalloc and realloc the full palette
- D(bug("Obtaining %ld colors on the screen\n",ncolors));
-
- /* Free existing allocated colors */
- for ( pixel=0; pixel<this->screen->format->palette->ncolors; ++pixel ) {
- if(SDL_XPixels[pixel]>=0)
- ReleasePen(GFX_Display->ViewPort.ColorMap,SDL_XPixels[pixel]);
- }
-
- /* Try to allocate all the colors */
- for ( i=0; i<this->screen->format->palette->ncolors; ++i ) {
- SDL_XPixels[i]=ObtainBestPenA(GFX_Display->ViewPort.ColorMap,colors[i].r<<24,colors[i].g<<24,colors[i].b<<24,NULL);
- }
- }
- else
- {
-#ifndef USE_CGX_WRITELUTPIXEL
- Uint32 fmt;
- D(bug("Preparing a conversion pixel table...\n"));
-
- fmt=GetCyberMapAttr(SDL_Display->RastPort.BitMap,CYBRMATTR_PIXFMT);
-
- for(i=0;i<ncolors;i++)
- {
- SetSingleColor(fmt,colors[firstcolor+i].r,colors[firstcolor+i].g,colors[firstcolor+i].b,(unsigned char *)&SDL_XPixels[firstcolor+i]);
- }
-#else
-// D(bug("Executing XPixel(%lx) remapping: (from %ld, %ld colors) first: r%ld g%ld b%ld\n",SDL_XPixels,firstcolor,ncolors,colors[firstcolor].r,colors[firstcolor].g,colors[firstcolor].b));
- for(i=0;i<ncolors;i++)
- SDL_XPixels[i+firstcolor]=(colors[firstcolor+i].r<<16)+(colors[firstcolor+i].g<<8)+colors[firstcolor+i].b;
-#endif
- }
- }
-
-// Actually it cannot fail!
-
- return 1;
-}
-
-/* Note: If we are terminated, this could be called in the middle of
- another SDL video routine -- notably UpdateRects.
-*/
-static void CGX_VideoQuit(_THIS)
-{
- /* Shutdown everything that's still up */
- /* The event thread should be done, so we can touch SDL_Display */
- D(bug("CGX_VideoQuit\n"));
-
- if ( SDL_Display != NULL ) {
- /* Clean up OpenGL */
- if(this->gl_data->gl_active == 1) {
- CGX_GL_Quit(this);
- }
- /* Start shutting down the windows */
- D(bug("Destroying image...\n"));
- CGX_DestroyImage(this, this->screen);
- D(bug("Destroying window...\n"));
- CGX_DestroyWindow(this, this->screen);
-// Otherwise SDL_VideoQuit will try to free it!
- SDL_VideoSurface=NULL;
-
- CGX_FreeVideoModes(this);
-
- /* Free that blank cursor */
- if ( SDL_BlankCursor != NULL ) {
- FreeMem(SDL_BlankCursor,16);
- SDL_BlankCursor = NULL;
- }
-
- /* Close the X11 graphics connection */
- this->hidden->same_format=0;
-
- D(bug("Destroying screen...\n"));
-
- if ( GFX_Display != NULL )
- DestroyScreen(this);
-
- /* Close the X11 display connection */
- SDL_Display = NULL;
-
- /* Unload GL library after X11 shuts down */
- }
-
- D(bug("Closing libraries...\n"));
-
- if( CyberGfxBase) {
- CloseLibrary(CyberGfxBase);
- CyberGfxBase=NULL;
- }
-
- if (IntuitionBase) {
- CloseLibrary((struct Library *)IntuitionBase);
- IntuitionBase=NULL;
- }
- if (GfxBase) {
- CloseLibrary((struct Library *)GfxBase);
- GfxBase=NULL;
- }
-
- if ( this->screen && (this->screen->flags & SDL_HWSURFACE) ) {
- /* Direct screen access, no memory buffer */
- this->screen->pixels = NULL;
- }
- D(bug("End of CGX_VideoQuit.\n"));
-
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxvideo.h b/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxvideo.h
deleted file mode 100644
index 9ef76ea..0000000
--- a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxvideo.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_cgxvideo_h
-#define _SDL_cgxvideo_h
-
-
-#include <exec/exec.h>
-#include <cybergraphx/cybergraphics.h>
-#include <graphics/scale.h>
-#include <graphics/gfx.h>
-#include <intuition/intuition.h>
-#if defined(__SASC) || defined(STORMC4_WOS)
-#include <proto/exec.h>
-#include <proto/cybergraphics.h>
-#include <proto/graphics.h>
-#include <proto/intuition.h>
-#include <proto/console.h>
-#else
-#include <inline/exec.h>
-#include <inline/cybergraphics.h>
-#include <inline/graphics.h>
-#include <inline/intuition.h>
-#include <inline/console.h>
-#endif
-
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "mydebug.h"
-
-#define USE_CGX_WRITELUTPIXEL
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-/* Private display data */
-struct SDL_PrivateVideoData {
- struct Screen *Public_Display; /* Used for events and window management */
- struct Screen *GFX_Display; /* Used for graphics and colormap stuff */
- Uint32 SDL_VisualUnused; /* The visual used by our window */
- struct Window *SDL_Window; /* Shared by both displays (no X security?) */
- unsigned char *BlankCursor; /* The invisible cursor */
-
- char *SDL_windowid; /* Flag: true if we have been passed a window */
-
- /* The variables used for displaying graphics */
- Uint8 *Ximage; /* The X image for our window */
- int swap_pixels; /* Flag: true if display is swapped endian */
-
- /* Support for internal mouse warping */
- struct {
- int x;
- int y;
- } mouse_last;
- struct {
- int numerator;
- int denominator;
- int threshold;
- } mouse_accel;
- int mouse_relative;
-
- /* The current list of available video modes */
- SDL_Rect **modelist;
-
- /* available visuals of interest to us, sorted deepest first */
- struct {
- Uint32 visual;
- int depth; /* number of significant bits/pixel */
- int bpp; /* pixel quantum in bits */
- } visuals[5]; /* at most entries for 8, 15, 16, 24 */
- int nvisuals;
-
- Uint32 vis; /* current visual in use */
- int depth; /* current visual depth (not bpp) */
- int BytesPerPixel;
- int currently_fullscreen,same_format,dbuffer;
-
- /* Automatic mode switching support (entering/leaving fullscreen) */
- Uint32 switch_waiting;
- Uint32 switch_time;
-
- /* Prevent too many XSync() calls */
- int blit_queued;
-
- /* Colormap handling */
- LONG Pens;
- Sint32 *XPixels; /* A list of pixels that have been allocated, the size depends on the screen format */
- struct ScreenBuffer *SB[2];
- struct RastPort *RP;
- short *iconcolors; /* List of colors used by the icon */
-};
-
-/* Old variable names */
-#define local_X11 (this->hidden->local_X11)
-#define SDL_Display (this->hidden->Public_Display)
-#define GFX_Display (this->hidden->GFX_Display)
-#define SDL_Screen DefaultScreen(this->hidden->Public_Display)
-
-#define SDL_Visual (this->hidden->vis)
-
-#define SDL_Root RootWindow(SDL_Display, SDL_Screen)
-#define WMwindow (this->hidden->WMwindow)
-#define FSwindow (this->hidden->FSwindow)
-#define SDL_Window (this->hidden->SDL_Window)
-#define WM_DELETE_WINDOW (this->hidden->WM_DELETE_WINDOW)
-#define SDL_BlankCursor (this->hidden->BlankCursor)
-#define SDL_windowid (this->hidden->SDL_windowid)
-#define SDL_Ximage (this->hidden->Ximage)
-#define SDL_GC (this->hidden->gc)
-#define swap_pixels (this->hidden->swap_pixels)
-#define mouse_last (this->hidden->mouse_last)
-#define mouse_accel (this->hidden->mouse_accel)
-#define mouse_relative (this->hidden->mouse_relative)
-#define SDL_modelist (this->hidden->modelist)
-#define SDL_RastPort (this->hidden->RP)
-#define saved_mode (this->hidden->saved_mode)
-#define saved_view (this->hidden->saved_view)
-#define currently_fullscreen (this->hidden->currently_fullscreen)
-#define blit_queued (this->hidden->blit_queued)
-#define SDL_DisplayColormap (this->hidden->GFX_Display->ViewPort.ColorMap)
-#define SDL_XPixels (this->hidden->XPixels)
-#define SDL_iconcolors (this->hidden->iconcolors)
-
-/* Used to get the X cursor from a window-manager specific cursor */
-// extern Cursor SDL_GetWMXCursor(WMcursor *cursor);
-
-extern int CGX_CreateWindow(_THIS, SDL_Surface *screen,
- int w, int h, int bpp, Uint32 flags);
-extern int CGX_ResizeWindow(_THIS,
- SDL_Surface *screen, int w, int h, Uint32 flags);
-
-extern void CGX_DestroyWindow(_THIS, SDL_Surface *screen);
-
-extern struct Library *CyberGfxBase;
-extern struct IntuitionBase *IntuitionBase;
-extern struct GfxBase *GfxBase;
-extern struct ExecBase *SysBase;
-extern struct DosLibrary *DOSBase;
-
-struct private_hwdata
-{
- struct BitMap *bmap;
- APTR lock;
- struct SDL_VideoDevice *videodata;
- APTR mask;
- int allocated;
-};
-
-int CGX_CheckHWBlit(_THIS,SDL_Surface *src,SDL_Surface *dst);
-int CGX_FillHWRect(_THIS,SDL_Surface *dst,SDL_Rect *dstrect,Uint32 color);
-int CGX_SetHWColorKey(_THIS,SDL_Surface *surface, Uint32 key);
-#endif /* _SDL_x11video_h */
diff --git a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxwm.c b/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxwm.c
deleted file mode 100644
index 47a7d60..0000000
--- a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxwm.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_version.h"
-#include "SDL_timer.h"
-#include "SDL_video.h"
-#include "SDL_syswm.h"
-#include "../../events/SDL_events_c.h"
-#include "../SDL_pixels_c.h"
-#include "SDL_cgxmodes_c.h"
-#include "SDL_cgxwm_c.h"
-
-/* This is necessary for working properly with Enlightenment, etc. */
-#define USE_ICON_WINDOW
-
-void CGX_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask)
-{
-/* Not yet implemented */
-}
-
-void CGX_SetCaption(_THIS, const char *title, const char *icon)
-{
- if(SDL_Window)
- SetWindowTitles(SDL_Window,(char *)title,NULL);
-}
-
-/* Iconify the window */
-int CGX_IconifyWindow(_THIS)
-{
-/* Not yet implemented */
- return 0;
-}
-
-int CGX_GetWMInfo(_THIS, SDL_SysWMinfo *info)
-{
- if ( info->version.major <= SDL_MAJOR_VERSION ) {
- return(1);
- } else {
- SDL_SetError("Application not compiled with SDL %d.%d\n",
- SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
- return(-1);
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxwm_c.h b/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxwm_c.h
deleted file mode 100644
index 35d1a61..0000000
--- a/distrib/sdl-1.2.12/src/video/cybergfx/SDL_cgxwm_c.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_cgxvideo.h"
-
-/* Functions to be exported */
-extern void CGX_SetCaption(_THIS, const char *title, const char *icon);
-extern void CGX_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask);
-extern int CGX_IconifyWindow(_THIS);
-extern SDL_GrabMode CGX_GrabInputNoLock(_THIS, SDL_GrabMode mode);
-extern SDL_GrabMode CGX_GrabInput(_THIS, SDL_GrabMode mode);
-extern int CGX_GetWMInfo(_THIS, SDL_SysWMinfo *info);
-
diff --git a/distrib/sdl-1.2.12/src/video/dc/SDL_dcevents.c b/distrib/sdl-1.2.12/src/video/dc/SDL_dcevents.c
deleted file mode 100644
index 1e8e2b5..0000000
--- a/distrib/sdl-1.2.12/src/video/dc/SDL_dcevents.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL.h"
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_dcvideo.h"
-#include "SDL_dcevents_c.h"
-
-#include <dc/maple.h>
-#include <dc/maple/mouse.h>
-#include <dc/maple/keyboard.h>
-
-const static unsigned short sdl_key[]= {
- /*0*/ 0, 0, 0, 0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
- 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
- 'u', 'v', 'w', 'x', 'y', 'z',
- /*1e*/ '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
- /*28*/ SDLK_RETURN, SDLK_ESCAPE, SDLK_BACKSPACE, SDLK_TAB, SDLK_SPACE, SDLK_MINUS, SDLK_PLUS, SDLK_LEFTBRACKET,
- SDLK_RIGHTBRACKET, SDLK_BACKSLASH , 0, SDLK_SEMICOLON, SDLK_QUOTE,
- /*35*/ '~', SDLK_COMMA, SDLK_PERIOD, SDLK_SLASH, SDLK_CAPSLOCK,
- SDLK_F1, SDLK_F2, SDLK_F3, SDLK_F4, SDLK_F5, SDLK_F6, SDLK_F7, SDLK_F8, SDLK_F9, SDLK_F10, SDLK_F11, SDLK_F12,
- /*46*/ SDLK_PRINT, SDLK_SCROLLOCK, SDLK_PAUSE, SDLK_INSERT, SDLK_HOME, SDLK_PAGEUP, SDLK_DELETE, SDLK_END, SDLK_PAGEDOWN, SDLK_RIGHT, SDLK_LEFT, SDLK_DOWN, SDLK_UP,
- /*53*/ SDLK_NUMLOCK, SDLK_KP_DIVIDE, SDLK_KP_MULTIPLY, SDLK_KP_MINUS, SDLK_KP_PLUS, SDLK_KP_ENTER,
- SDLK_KP1, SDLK_KP2, SDLK_KP3, SDLK_KP4, SDLK_KP5, SDLK_KP6,
- /*5f*/ SDLK_KP7, SDLK_KP8, SDLK_KP9, SDLK_KP0, SDLK_KP_PERIOD, 0 /* S3 */
-};
-
-const static unsigned short sdl_shift[] = {
- SDLK_LCTRL,SDLK_LSHIFT,SDLK_LALT,0 /* S1 */,
- SDLK_RCTRL,SDLK_RSHIFT,SDLK_RALT,0 /* S2 */,
-};
-
-#define MOUSE_WHEELUP (1<<4)
-#define MOUSE_WHEELDOWN (1<<5)
-
-static void mouse_update(void)
-{
-const static char sdl_mousebtn[] = {
- MOUSE_LEFTBUTTON,
- MOUSE_RIGHTBUTTON,
- MOUSE_SIDEBUTTON,
- MOUSE_WHEELUP,
- MOUSE_WHEELDOWN
-};
-
- uint8 addr;
- mouse_cond_t cond;
-
- static int prev_buttons;
- int buttons,changed;
- int i;
-
- if ((addr = maple_first_mouse())==0 || mouse_get_cond(addr, &cond)<0) return;
-
- buttons = cond.buttons^0xff;
- if (cond.dz<0) buttons|=MOUSE_WHEELUP;
- if (cond.dz>0) buttons|=MOUSE_WHEELDOWN;
-
- if (cond.dx||cond.dy) SDL_PrivateMouseMotion(0,1,cond.dx,cond.dy);
-
- changed = buttons^prev_buttons;
- for(i=0;i<sizeof(sdl_mousebtn);i++) {
- if (changed & sdl_mousebtn[i]) {
- SDL_PrivateMouseButton((buttons & sdl_mousebtn[i])?SDL_PRESSED:SDL_RELEASED,i,0,0);
- }
- }
- prev_buttons = buttons;
-}
-
-static void keyboard_update(void)
-{
- static kbd_state_t old_state;
- static uint8 old_addr;
-
- kbd_state_t *state;
- uint8 addr;
- int port,unit;
-
- int shiftkeys;
- SDL_keysym keysym;
-
- int i;
-
- addr = maple_first_kb();
-
- if (addr==0) return;
-
- if (addr!=old_addr) {
- old_addr = addr;
- SDL_memset(&old_state,0,sizeof(old_state));
- }
-
- maple_raddr(addr,&port,&unit);
-
- state = maple_dev_state(port,unit);
- if (!state) return;
-
- shiftkeys = state->shift_keys ^ old_state.shift_keys;
- for(i=0;i<sizeof(sdl_shift);i++) {
- if ((shiftkeys>>i)&1) {
- keysym.sym = sdl_shift[i];
- SDL_PrivateKeyboard(((state->shift_keys>>i)&1)?SDL_PRESSED:SDL_RELEASED,&keysym);
- }
- }
-
- for(i=0;i<sizeof(sdl_key);i++) {
- if (state->matrix[i]!=old_state.matrix[i]) {
- int key = sdl_key[i];
- if (key) {
- keysym.sym = key;
- SDL_PrivateKeyboard(state->matrix[i]?SDL_PRESSED:SDL_RELEASED,&keysym);
- }
- }
- }
-
- old_state = *state;
-}
-
-void DC_PumpEvents(_THIS)
-{
- keyboard_update();
- mouse_update();
-}
-
-void DC_InitOSKeymap(_THIS)
-{
- /* do nothing. */
-}
-
-/* end of SDL_dcevents.c ... */
-
diff --git a/distrib/sdl-1.2.12/src/video/dc/SDL_dcevents_c.h b/distrib/sdl-1.2.12/src/video/dc/SDL_dcevents_c.h
deleted file mode 100644
index 57dc6d6..0000000
--- a/distrib/sdl-1.2.12/src/video/dc/SDL_dcevents_c.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_dcvideo.h"
-
-/* Variables and functions exported by SDL_sysevents.c to other parts
- of the native video subsystem (SDL_sysvideo.c)
-*/
-extern void DC_InitOSKeymap(_THIS);
-extern void DC_PumpEvents(_THIS);
-
-/* end of SDL_dcevents_c.h ... */
-
diff --git a/distrib/sdl-1.2.12/src/video/dc/SDL_dcmouse.c b/distrib/sdl-1.2.12/src/video/dc/SDL_dcmouse.c
deleted file mode 100644
index ccb969d..0000000
--- a/distrib/sdl-1.2.12/src/video/dc/SDL_dcmouse.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <stdio.h>
-
-#include "SDL_mouse.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_dcmouse_c.h"
-
-
-/* The implementation dependent data for the window manager cursor */
-struct WMcursor {
- int unused;
-};
diff --git a/distrib/sdl-1.2.12/src/video/dc/SDL_dcmouse_c.h b/distrib/sdl-1.2.12/src/video/dc/SDL_dcmouse_c.h
deleted file mode 100644
index e985c75..0000000
--- a/distrib/sdl-1.2.12/src/video/dc/SDL_dcmouse_c.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_dcvideo.h"
-
-/* Functions to be exported */
diff --git a/distrib/sdl-1.2.12/src/video/dc/SDL_dcvideo.c b/distrib/sdl-1.2.12/src/video/dc/SDL_dcvideo.c
deleted file mode 100644
index 3d884c3..0000000
--- a/distrib/sdl-1.2.12/src/video/dc/SDL_dcvideo.c
+++ /dev/null
@@ -1,445 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_dcvideo.h"
-#include "SDL_dcevents_c.h"
-#include "SDL_dcmouse_c.h"
-
-#include <dc/video.h>
-#include <dc/pvr.h>
-
-
-/* Initialization/Query functions */
-static int DC_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **DC_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *DC_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int DC_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
-static void DC_VideoQuit(_THIS);
-
-/* Hardware surface functions */
-static int DC_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int DC_LockHWSurface(_THIS, SDL_Surface *surface);
-static void DC_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static void DC_FreeHWSurface(_THIS, SDL_Surface *surface);
-static int DC_FlipHWSurface(_THIS, SDL_Surface *surface);
-
-/* etc. */
-static void DC_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
-
-/* OpenGL */
-#if SDL_VIDEO_OPENGL
-static void *DC_GL_GetProcAddress(_THIS, const char *proc);
-static int DC_GL_LoadLibrary(_THIS, const char *path);
-static int DC_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
-static void DC_GL_SwapBuffers(_THIS);
-#endif
-
-/* DC driver bootstrap functions */
-
-static int DC_Available(void)
-{
- return 1;
-}
-
-static void DC_DeleteDevice(SDL_VideoDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_VideoDevice *DC_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device ) {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *device->hidden));
- }
- if ( (device == NULL) || (device->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( device ) {
- SDL_free(device);
- }
- return(0);
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
-
- /* Set the function pointers */
- device->VideoInit = DC_VideoInit;
- device->ListModes = DC_ListModes;
- device->SetVideoMode = DC_SetVideoMode;
- device->CreateYUVOverlay = NULL;
- device->SetColors = DC_SetColors;
- device->UpdateRects = DC_UpdateRects;
- device->VideoQuit = DC_VideoQuit;
- device->AllocHWSurface = DC_AllocHWSurface;
- device->CheckHWBlit = NULL;
- device->FillHWRect = NULL;
- device->SetHWColorKey = NULL;
- device->SetHWAlpha = NULL;
- device->LockHWSurface = DC_LockHWSurface;
- device->UnlockHWSurface = DC_UnlockHWSurface;
- device->FlipHWSurface = DC_FlipHWSurface;
- device->FreeHWSurface = DC_FreeHWSurface;
-#if SDL_VIDEO_OPENGL
- device->GL_LoadLibrary = DC_GL_LoadLibrary;
- device->GL_GetProcAddress = DC_GL_GetProcAddress;
- device->GL_GetAttribute = DC_GL_GetAttribute;
- device->GL_MakeCurrent = NULL;
- device->GL_SwapBuffers = DC_GL_SwapBuffers;
-#endif
- device->SetCaption = NULL;
- device->SetIcon = NULL;
- device->IconifyWindow = NULL;
- device->GrabInput = NULL;
- device->GetWMInfo = NULL;
- device->InitOSKeymap = DC_InitOSKeymap;
- device->PumpEvents = DC_PumpEvents;
-
- device->free = DC_DeleteDevice;
-
- return device;
-}
-
-VideoBootStrap DC_bootstrap = {
- "dcvideo", "Dreamcast Video",
- DC_Available, DC_CreateDevice
-};
-
-
-int DC_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- /* Determine the screen depth (use default 16-bit depth) */
- /* we change this during the SDL_SetVideoMode implementation... */
- vformat->BitsPerPixel = 16;
- vformat->Rmask = 0x0000f800;
- vformat->Gmask = 0x000007e0;
- vformat->Bmask = 0x0000001f;
-
- /* We're done! */
- return(0);
-}
-
-const static SDL_Rect
- RECT_800x600 = {0,0,800,600},
- RECT_640x480 = {0,0,640,480},
- RECT_320x240 = {0,0,320,240};
-const static SDL_Rect *vid_modes[] = {
- &RECT_800x600,
- &RECT_640x480,
- &RECT_320x240,
- NULL
-};
-
-SDL_Rect **DC_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- switch(format->BitsPerPixel) {
- case 15:
- case 16:
- return &vid_modes;
- case 32:
- if (!(flags & SDL_OPENGL))
- return &vid_modes;
- default:
- return NULL;
- }
-// return (SDL_Rect **) -1;
-}
-
-pvr_init_params_t params = {
- /* Enable opaque and translucent polygons with size 16 */
- { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16 },
-
- /* Vertex buffer size */
- 512*1024
-};
-
-#if SDL_VIDEO_OPENGL
-static int pvr_inited;
-#endif
-
-SDL_Surface *DC_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- int disp_mode,pixel_mode,pitch;
- Uint32 Rmask, Gmask, Bmask;
-
- if (width==320 && height==240) disp_mode=DM_320x240;
- else if (width==640 && height==480) disp_mode=DM_640x480;
- else if (width==800 && height==600) disp_mode=DM_800x608;
- else {
- SDL_SetError("Couldn't find requested mode in list");
- return(NULL);
- }
-
- switch(bpp) {
- case 15: pixel_mode = PM_RGB555; pitch = width*2;
- /* 5-5-5 */
- Rmask = 0x00007c00;
- Gmask = 0x000003e0;
- Bmask = 0x0000001f;
- break;
- case 16: pixel_mode = PM_RGB565; pitch = width*2;
- /* 5-6-5 */
- Rmask = 0x0000f800;
- Gmask = 0x000007e0;
- Bmask = 0x0000001f;
- break;
- case 24: bpp = 32;
- case 32: pixel_mode = PM_RGB888; pitch = width*4;
- Rmask = 0x00ff0000;
- Gmask = 0x0000ff00;
- Bmask = 0x000000ff;
-#if SDL_VIDEO_OPENGL
- if (!(flags & SDL_OPENGL))
-#endif
- break;
- default:
- SDL_SetError("Couldn't find requested mode in list");
- return(NULL);
- }
-
-// if ( bpp != current->format->BitsPerPixel ) {
- if ( ! SDL_ReallocFormat(current, bpp, Rmask, Gmask, Bmask, 0) ) {
- return(NULL);
- }
-// }
-
- /* Set up the new mode framebuffer */
- current->flags = (SDL_FULLSCREEN|SDL_HWSURFACE);
- current->w = width;
- current->h = height;
- current->pitch = pitch;
-
-#if SDL_VIDEO_OPENGL
- if (pvr_inited) {
- pvr_inited = 0;
- pvr_shutdown();
- }
-#endif
-
- vid_set_mode(disp_mode,pixel_mode);
-
- current->pixels = vram_s;
-
-#if SDL_VIDEO_OPENGL
- if (flags & SDL_OPENGL) {
- this->gl_config.driver_loaded = 1;
- current->flags = SDL_FULLSCREEN | SDL_OPENGL;
- current->pixels = NULL;
- pvr_inited = 1;
- pvr_init(&params);
- glKosInit();
- glKosBeginFrame();
- } else
-#endif
- if (flags | SDL_DOUBLEBUF) {
- current->flags |= SDL_DOUBLEBUF;
- current->pixels = (void*)((int)current->pixels | 0x400000);
- }
-
- /* We're done */
- return(current);
-}
-
-/* We don't actually allow hardware surfaces other than the main one */
-static int DC_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- return(-1);
-}
-static void DC_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-/* We need to wait for vertical retrace on page flipped displays */
-static int DC_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- return(0);
-}
-
-static void DC_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-static int DC_FlipHWSurface(_THIS, SDL_Surface *surface)
-{
- if (surface->flags & SDL_DOUBLEBUF) {
- vid_set_start((int)surface->pixels & 0xffffff);
- surface->pixels = (void*)((int)surface->pixels ^ 0x400000);
- }
- return(0);
-}
-
-static void DC_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
-{
- /* do nothing. */
-}
-
-static int DC_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- /* do nothing of note. */
- return(1);
-}
-
-/* Note: If we are terminated, this could be called in the middle of
- another SDL video routine -- notably UpdateRects.
-*/
-static void DC_VideoQuit(_THIS)
-{
-#if SDL_VIDEO_OPENGL
- if (pvr_inited) {
- pvr_inited = 0;
- pvr_shutdown();
- }
-#endif
-}
-
-#if SDL_VIDEO_OPENGL
-
-void dmyfunc(void) {}
-
-typedef void (*funcptr)();
-const static struct {
- char *name;
- funcptr addr;
-} glfuncs[] = {
-#define DEF(func) {#func,&func}
- DEF(glBegin),
- DEF(glBindTexture),
- DEF(glBlendFunc),
- DEF(glColor4f),
-// DEF(glCopyImageID),
- DEF(glDisable),
- DEF(glEnable),
- DEF(glEnd),
- DEF(glFlush),
- DEF(glGenTextures),
- DEF(glGetString),
- DEF(glLoadIdentity),
- DEF(glMatrixMode),
- DEF(glOrtho),
- DEF(glPixelStorei),
-// DEF(glPopAttrib),
-// DEF(glPopClientAttrib),
- {"glPopAttrib",&dmyfunc},
- {"glPopClientAttrib",&dmyfunc},
- DEF(glPopMatrix),
-// DEF(glPushAttrib),
-// DEF(glPushClientAttrib),
- {"glPushAttrib",&dmyfunc},
- {"glPushClientAttrib",&dmyfunc},
- DEF(glPushMatrix),
- DEF(glTexCoord2f),
- DEF(glTexEnvf),
- DEF(glTexImage2D),
- DEF(glTexParameteri),
- DEF(glTexSubImage2D),
- DEF(glVertex2i),
- DEF(glViewport),
-#undef DEF
-};
-
-static void *DC_GL_GetProcAddress(_THIS, const char *proc)
-{
- void *ret;
- int i;
-
- ret = glKosGetProcAddress(proc);
- if (ret) return ret;
-
- for(i=0;i<sizeof(glfuncs)/sizeof(glfuncs[0]);i++) {
- if (SDL_strcmp(proc,glfuncs[i].name)==0) return glfuncs[i].addr;
- }
-
- return NULL;
-}
-
-static int DC_GL_LoadLibrary(_THIS, const char *path)
-{
- this->gl_config.driver_loaded = 1;
-
- return 0;
-}
-
-static int DC_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
-{
- GLenum mesa_attrib;
- int val;
-
- switch(attrib) {
- case SDL_GL_RED_SIZE:
- val = 5;
- break;
- case SDL_GL_GREEN_SIZE:
- val = 6;
- break;
- case SDL_GL_BLUE_SIZE:
- val = 5;
- break;
- case SDL_GL_ALPHA_SIZE:
- val = 0;
- break;
- case SDL_GL_DOUBLEBUFFER:
- val = 1;
- break;
- case SDL_GL_DEPTH_SIZE:
- val = 16; /* or 32? */
- break;
- case SDL_GL_STENCIL_SIZE:
- val = 0;
- break;
- case SDL_GL_ACCUM_RED_SIZE:
- val = 0;
- break;
- case SDL_GL_ACCUM_GREEN_SIZE:
- val = 0;
- case SDL_GL_ACCUM_BLUE_SIZE:
- val = 0;
- break;
- case SDL_GL_ACCUM_ALPHA_SIZE:
- val = 0;
- break;
- default :
- return -1;
- }
- *value = val;
- return 0;
-}
-
-static void DC_GL_SwapBuffers(_THIS)
-{
- glKosFinishFrame();
- glKosBeginFrame();
-}
-#endif
diff --git a/distrib/sdl-1.2.12/src/video/dc/SDL_dcvideo.h b/distrib/sdl-1.2.12/src/video/dc/SDL_dcvideo.h
deleted file mode 100644
index 2c7bf25..0000000
--- a/distrib/sdl-1.2.12/src/video/dc/SDL_dcvideo.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_dcvideo_h
-#define _SDL_dcvideo_h
-
-#include "SDL_mouse.h"
-#include "SDL_mutex.h"
-#include "../SDL_sysvideo.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-
-/* Private display data */
-
-struct SDL_PrivateVideoData {
- int w, h;
- void *buffer;
-};
-
-#endif /* _SDL_dcvideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/default_cursor.h b/distrib/sdl-1.2.12/src/video/default_cursor.h
deleted file mode 100644
index 9953e01..0000000
--- a/distrib/sdl-1.2.12/src/video/default_cursor.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Default cursor - it happens to be the Mac cursor, but could be anything */
-
-#define DEFAULT_CWIDTH 16
-#define DEFAULT_CHEIGHT 16
-#define DEFAULT_CHOTX 0
-#define DEFAULT_CHOTY 0
-
-/* Added a real MacOS cursor, at the request of Luc-Olivier de Charrière */
-#define USE_MACOS_CURSOR
-
-#ifdef USE_MACOS_CURSOR
-
-static unsigned char default_cdata[] =
-{
- 0x00,0x00,
- 0x40,0x00,
- 0x60,0x00,
- 0x70,0x00,
- 0x78,0x00,
- 0x7C,0x00,
- 0x7E,0x00,
- 0x7F,0x00,
- 0x7F,0x80,
- 0x7C,0x00,
- 0x6C,0x00,
- 0x46,0x00,
- 0x06,0x00,
- 0x03,0x00,
- 0x03,0x00,
- 0x00,0x00
-};
-static unsigned char default_cmask[] =
-{
- 0xC0,0x00,
- 0xE0,0x00,
- 0xF0,0x00,
- 0xF8,0x00,
- 0xFC,0x00,
- 0xFE,0x00,
- 0xFF,0x00,
- 0xFF,0x80,
- 0xFF,0xC0,
- 0xFF,0xE0,
- 0xFE,0x00,
- 0xEF,0x00,
- 0xCF,0x00,
- 0x87,0x80,
- 0x07,0x80,
- 0x03,0x00
-};
-
-#else
-
-static unsigned char default_cdata[] =
-{
- 0x00,0x00,
- 0x40,0x00,
- 0x60,0x00,
- 0x70,0x00,
- 0x78,0x00,
- 0x7C,0x00,
- 0x7E,0x00,
- 0x7F,0x00,
- 0x7F,0x80,
- 0x7C,0x00,
- 0x6C,0x00,
- 0x46,0x00,
- 0x06,0x00,
- 0x03,0x00,
- 0x03,0x00,
- 0x00,0x00
-};
-static unsigned char default_cmask[] =
-{
- 0x40,0x00,
- 0xE0,0x00,
- 0xF0,0x00,
- 0xF8,0x00,
- 0xFC,0x00,
- 0xFE,0x00,
- 0xFF,0x00,
- 0xFF,0x80,
- 0xFF,0xC0,
- 0xFF,0x80,
- 0xFE,0x00,
- 0xEF,0x00,
- 0x4F,0x00,
- 0x07,0x80,
- 0x07,0x80,
- 0x03,0x00
-};
-
-#endif /* TRUE_MACINTOSH_CURSOR */
diff --git a/distrib/sdl-1.2.12/src/video/dga/SDL_dgaevents.c b/distrib/sdl-1.2.12/src/video/dga/SDL_dgaevents.c
deleted file mode 100644
index 11bd21e..0000000
--- a/distrib/sdl-1.2.12/src/video/dga/SDL_dgaevents.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Handle the event stream, converting DGA events into SDL events */
-
-#include <stdio.h>
-#include <X11/Xlib.h>
-#include "../Xext/extensions/xf86dga.h"
-
-#include "../SDL_sysvideo.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_dgavideo.h"
-#include "SDL_dgaevents_c.h"
-
-/* get function pointers... */
-#include "../x11/SDL_x11dyn.h"
-
-/* Heheh we're using X11 event code */
-extern int X11_Pending(Display *display);
-extern void X11_InitKeymap(void);
-extern SDLKey X11_TranslateKeycode(Display *display, KeyCode kc);
-
-static int DGA_DispatchEvent(_THIS)
-{
- int posted;
- SDL_NAME(XDGAEvent) xevent;
-
- XNextEvent(DGA_Display, (XEvent *)&xevent);
-
- posted = 0;
- xevent.type -= DGA_event_base;
- switch (xevent.type) {
-
- /* Mouse motion? */
- case MotionNotify: {
- if ( SDL_VideoSurface ) {
- posted = SDL_PrivateMouseMotion(0, 1,
- xevent.xmotion.dx, xevent.xmotion.dy);
- }
- }
- break;
-
- /* Mouse button press? */
- case ButtonPress: {
- posted = SDL_PrivateMouseButton(SDL_PRESSED,
- xevent.xbutton.button, 0, 0);
- }
- break;
-
- /* Mouse button release? */
- case ButtonRelease: {
- posted = SDL_PrivateMouseButton(SDL_RELEASED,
- xevent.xbutton.button, 0, 0);
- }
- break;
-
- /* Key press? */
- case KeyPress: {
- SDL_keysym keysym;
- KeyCode keycode;
- XKeyEvent xkey;
-
- SDL_NAME(XDGAKeyEventToXKeyEvent)(&xevent.xkey, &xkey);
- keycode = xkey.keycode;
-#ifdef DEBUG_XEVENTS
-printf("KeyPress (X11 keycode = 0x%X)\n", xkey.keycode);
-#endif
- /* Get the translated SDL virtual keysym */
- keysym.scancode = keycode;
- keysym.sym = X11_TranslateKeycode(DGA_Display, keycode);
- keysym.mod = KMOD_NONE;
- keysym.unicode = 0;
-
- /* Look up the translated value for the key event */
- if ( SDL_TranslateUNICODE ) {
- static XComposeStatus state;
- char keybuf[32];
-
- if ( XLookupString(&xkey, keybuf, sizeof(keybuf), NULL, &state) ) {
- /*
- * FIXME: XLookupString() may yield more than one
- * character, so we need a mechanism to allow for
- * this (perhaps null keypress events with a
- * unicode value)
- */
- keysym.unicode = (Uint8)keybuf[0];
- }
- }
- posted = SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
- }
- break;
-
- /* Key release? */
- case KeyRelease: {
- SDL_keysym keysym;
- KeyCode keycode;
- XKeyEvent xkey;
-
- SDL_NAME(XDGAKeyEventToXKeyEvent)(&xevent.xkey, &xkey);
- keycode = xkey.keycode;
-#ifdef DEBUG_XEVENTS
-printf("KeyRelease (X11 keycode = 0x%X)\n", xkey.keycode);
-#endif
- /* Get the translated SDL virtual keysym */
- keysym.scancode = keycode;
- keysym.sym = X11_TranslateKeycode(DGA_Display, keycode);
- keysym.mod = KMOD_NONE;
- keysym.unicode = 0;
- posted = SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
- }
- break;
- }
- return(posted);
-}
-
-void DGA_PumpEvents(_THIS)
-{
- /* Keep processing pending events */
- LOCK_DISPLAY();
- while ( X11_Pending(DGA_Display) ) {
- DGA_DispatchEvent(this);
- }
- UNLOCK_DISPLAY();
-}
-
-void DGA_InitOSKeymap(_THIS)
-{
- X11_InitKeymap();
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/dga/SDL_dgaevents_c.h b/distrib/sdl-1.2.12/src/video/dga/SDL_dgaevents_c.h
deleted file mode 100644
index 15e47f7..0000000
--- a/distrib/sdl-1.2.12/src/video/dga/SDL_dgaevents_c.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_dgavideo.h"
-
-/* Functions to be exported */
-extern void DGA_PumpEvents(_THIS);
-extern void DGA_InitOSKeymap(_THIS);
diff --git a/distrib/sdl-1.2.12/src/video/dga/SDL_dgamouse.c b/distrib/sdl-1.2.12/src/video/dga/SDL_dgamouse.c
deleted file mode 100644
index fb99563..0000000
--- a/distrib/sdl-1.2.12/src/video/dga/SDL_dgamouse.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <stdio.h>
-
-#include "SDL_mouse.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_dgavideo.h"
-#include "SDL_dgamouse_c.h"
-
-
-/* The implementation dependent data for the window manager cursor */
-struct WMcursor {
- int unused;
-};
diff --git a/distrib/sdl-1.2.12/src/video/dga/SDL_dgamouse_c.h b/distrib/sdl-1.2.12/src/video/dga/SDL_dgamouse_c.h
deleted file mode 100644
index e863f6a..0000000
--- a/distrib/sdl-1.2.12/src/video/dga/SDL_dgamouse_c.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_dgavideo.h"
-
-/* Functions to be exported */
diff --git a/distrib/sdl-1.2.12/src/video/dga/SDL_dgavideo.c b/distrib/sdl-1.2.12/src/video/dga/SDL_dgavideo.c
deleted file mode 100644
index 331fcd2..0000000
--- a/distrib/sdl-1.2.12/src/video/dga/SDL_dgavideo.c
+++ /dev/null
@@ -1,1100 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* DGA 2.0 based SDL video driver implementation.
-*/
-
-#include <stdio.h>
-
-#include <X11/Xlib.h>
-#include "../Xext/extensions/xf86dga.h"
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_dgavideo.h"
-#include "SDL_dgamouse_c.h"
-#include "SDL_dgaevents_c.h"
-
-/* get function pointers... */
-#include "../x11/SDL_x11dyn.h"
-
-/*#define DGA_DEBUG*/
-
-/* Heheh we're using X11 event code */
-extern void X11_SaveScreenSaver(Display *display, int *saved_timeout, BOOL *dpms);
-extern void X11_DisableScreenSaver(Display *display);
-extern void X11_RestoreScreenSaver(Display *display, int saved_timeout, BOOL dpms);
-
-/* Initialization/Query functions */
-static int DGA_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **DGA_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *DGA_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int DGA_SetColors(_THIS, int firstcolor, int ncolors,
- SDL_Color *colors);
-static int DGA_SetGammaRamp(_THIS, Uint16 *ramp);
-static void DGA_VideoQuit(_THIS);
-
-/* Hardware surface functions */
-static int DGA_InitHWSurfaces(_THIS, SDL_Surface *screen, Uint8 *base, int size);
-static void DGA_FreeHWSurfaces(_THIS);
-static int DGA_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int DGA_FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color);
-static int DGA_CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst);
-static int DGA_LockHWSurface(_THIS, SDL_Surface *surface);
-static void DGA_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static void DGA_FreeHWSurface(_THIS, SDL_Surface *surface);
-static int DGA_FlipHWSurface(_THIS, SDL_Surface *surface);
-
-/* DGA driver bootstrap functions */
-
-static int DGA_Available(void)
-{
- const char *display = NULL;
- Display *dpy = NULL;
- int available = 0;
-
- /* The driver is available is available if the display is local
- and the DGA 2.0+ extension is available, and we can map mem.
- */
- if ( SDL_X11_LoadSymbols() ) {
- if ( (SDL_strncmp(XDisplayName(display), ":", 1) == 0) ||
- (SDL_strncmp(XDisplayName(display), "unix:", 5) == 0) ) {
- dpy = XOpenDisplay(display);
- if ( dpy ) {
- int events, errors, major, minor;
-
- if ( SDL_NAME(XDGAQueryExtension)(dpy, &events, &errors) &&
- SDL_NAME(XDGAQueryVersion)(dpy, &major, &minor) ) {
- int screen;
-
- screen = DefaultScreen(dpy);
- if ( (major >= 2) &&
- SDL_NAME(XDGAOpenFramebuffer)(dpy, screen) ) {
- available = 1;
- SDL_NAME(XDGACloseFramebuffer)(dpy, screen);
- }
- }
- XCloseDisplay(dpy);
- }
- }
- SDL_X11_UnloadSymbols();
- }
- return(available);
-}
-
-static void DGA_DeleteDevice(SDL_VideoDevice *device)
-{
- if (device != NULL) {
- SDL_free(device->hidden);
- SDL_free(device);
- SDL_X11_UnloadSymbols();
- }
-}
-
-static SDL_VideoDevice *DGA_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device = NULL;
-
- /* Initialize all variables that we clean on shutdown */
- if (SDL_X11_LoadSymbols()) {
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device ) {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *device->hidden));
- }
- if ( (device == NULL) || (device->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( device ) {
- SDL_free(device);
- }
- SDL_X11_UnloadSymbols();
- return(0);
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
-
- /* Set the function pointers */
- device->VideoInit = DGA_VideoInit;
- device->ListModes = DGA_ListModes;
- device->SetVideoMode = DGA_SetVideoMode;
- device->SetColors = DGA_SetColors;
- device->UpdateRects = NULL;
- device->VideoQuit = DGA_VideoQuit;
- device->AllocHWSurface = DGA_AllocHWSurface;
- device->CheckHWBlit = DGA_CheckHWBlit;
- device->FillHWRect = DGA_FillHWRect;
- device->SetHWColorKey = NULL;
- device->SetHWAlpha = NULL;
- device->LockHWSurface = DGA_LockHWSurface;
- device->UnlockHWSurface = DGA_UnlockHWSurface;
- device->FlipHWSurface = DGA_FlipHWSurface;
- device->FreeHWSurface = DGA_FreeHWSurface;
- device->SetGammaRamp = DGA_SetGammaRamp;
- device->GetGammaRamp = NULL;
- device->SetCaption = NULL;
- device->SetIcon = NULL;
- device->IconifyWindow = NULL;
- device->GrabInput = NULL;
- device->GetWMInfo = NULL;
- device->InitOSKeymap = DGA_InitOSKeymap;
- device->PumpEvents = DGA_PumpEvents;
-
- device->free = DGA_DeleteDevice;
- }
-
- return device;
-}
-
-VideoBootStrap DGA_bootstrap = {
- "dga", "XFree86 DGA 2.0",
- DGA_Available, DGA_CreateDevice
-};
-
-static int DGA_AddMode(_THIS, int bpp, int w, int h)
-{
- SDL_Rect *mode;
- int index;
- int next_mode;
-
- /* Check to see if we already have this mode */
- if ( bpp < 8 ) { /* Not supported */
- return(0);
- }
- index = ((bpp+7)/8)-1;
- if ( SDL_nummodes[index] > 0 ) {
- mode = SDL_modelist[index][SDL_nummodes[index]-1];
- if ( (mode->w == w) && (mode->h == h) ) {
- return(0);
- }
- }
-
- /* Set up the new video mode rectangle */
- mode = (SDL_Rect *)SDL_malloc(sizeof *mode);
- if ( mode == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
- mode->x = 0;
- mode->y = 0;
- mode->w = w;
- mode->h = h;
-
- /* Allocate the new list of modes, and fill in the new mode */
- next_mode = SDL_nummodes[index];
- SDL_modelist[index] = (SDL_Rect **)
- SDL_realloc(SDL_modelist[index], (1+next_mode+1)*sizeof(SDL_Rect *));
- if ( SDL_modelist[index] == NULL ) {
- SDL_OutOfMemory();
- SDL_nummodes[index] = 0;
- SDL_free(mode);
- return(-1);
- }
- SDL_modelist[index][next_mode] = mode;
- SDL_modelist[index][next_mode+1] = NULL;
- SDL_nummodes[index]++;
-
- return(0);
-}
-
-/* This whole function is a hack. :) */
-static Uint32 get_video_size(_THIS)
-{
- /* This is a non-exported function from libXxf86dga.a */
- extern unsigned char *SDL_NAME(XDGAGetMappedMemory)(int screen);
- FILE *proc;
- unsigned long mem;
- unsigned start, stop;
- char line[BUFSIZ];
- Uint32 size;
-
- mem = (unsigned long)SDL_NAME(XDGAGetMappedMemory)(DGA_Screen);
- size = 0;
- proc = fopen("/proc/self/maps", "r");
- if ( proc ) {
- while ( fgets(line, sizeof(line)-1, proc) ) {
- SDL_sscanf(line, "%x-%x", &start, &stop);
- if ( start == mem ) {
- size = (Uint32)((stop-start)/1024);
- break;
- }
- }
- fclose(proc);
- }
- return(size);
-}
-
-#ifdef DGA_DEBUG
-static void PrintMode(SDL_NAME(XDGAMode) *mode)
-{
- printf("Mode: %s (%dx%d) at %d bpp (%f refresh, %d pitch) num: %d\n",
- mode->name,
- mode->viewportWidth, mode->viewportHeight,
- mode->depth == 24 ? mode->bitsPerPixel : mode->depth,
- mode->verticalRefresh, mode->bytesPerScanline, mode->num);
- printf("\tRGB: 0x%8.8x 0x%8.8x 0x%8.8x (%d - %s)\n",
- mode->redMask, mode->greenMask, mode->blueMask,
- mode->visualClass,
- mode->visualClass == TrueColor ? "truecolor" :
- mode->visualClass == DirectColor ? "directcolor" :
- mode->visualClass == PseudoColor ? "pseudocolor" : "unknown");
- printf("\tFlags: ");
- if ( mode->flags & XDGAConcurrentAccess )
- printf(" XDGAConcurrentAccess");
- if ( mode->flags & XDGASolidFillRect )
- printf(" XDGASolidFillRect");
- if ( mode->flags & XDGABlitRect )
- printf(" XDGABlitRect");
- if ( mode->flags & XDGABlitTransRect )
- printf(" XDGABlitTransRect");
- if ( mode->flags & XDGAPixmap )
- printf(" XDGAPixmap");
- if ( mode->flags & XDGAInterlaced )
- printf(" XDGAInterlaced");
- if ( mode->flags & XDGADoublescan )
- printf(" XDGADoublescan");
- if ( mode->viewportFlags & XDGAFlipRetrace )
- printf(" XDGAFlipRetrace");
- if ( mode->viewportFlags & XDGAFlipImmediate )
- printf(" XDGAFlipImmediate");
- printf("\n");
-}
-#endif /* DGA_DEBUG */
-
-static int cmpmodes(const void *va, const void *vb)
-{
- const SDL_NAME(XDGAMode) *a = (const SDL_NAME(XDGAMode) *)va;
- const SDL_NAME(XDGAMode) *b = (const SDL_NAME(XDGAMode) *)vb;
-
- if ( (a->viewportWidth == b->viewportWidth) &&
- (b->viewportHeight == a->viewportHeight) ) {
- /* Prefer 32 bpp over 24 bpp, 16 bpp over 15 bpp */
- int a_bpp = a->depth == 24 ? a->bitsPerPixel : a->depth;
- int b_bpp = b->depth == 24 ? b->bitsPerPixel : b->depth;
- if ( a_bpp != b_bpp ) {
- return b_bpp - a_bpp;
- }
- /* Prefer DirectColor visuals, for gamma support */
- if ( a->visualClass == DirectColor && b->visualClass != DirectColor )
- return -1;
- if ( b->visualClass == DirectColor && a->visualClass != DirectColor )
- return 1;
- /* Maintain server refresh rate sorting */
- return a->num - b->num;
- } else if ( a->viewportWidth == b->viewportWidth ) {
- return b->viewportHeight - a->viewportHeight;
- } else {
- return b->viewportWidth - a->viewportWidth;
- }
-}
-static void UpdateHWInfo(_THIS, SDL_NAME(XDGAMode) *mode)
-{
- this->info.wm_available = 0;
- this->info.hw_available = 1;
- if ( mode->flags & XDGABlitRect ) {
- this->info.blit_hw = 1;
- } else {
- this->info.blit_hw = 0;
- }
- if ( mode->flags & XDGABlitTransRect ) {
- this->info.blit_hw_CC = 1;
- } else {
- this->info.blit_hw_CC = 0;
- }
- if ( mode->flags & XDGASolidFillRect ) {
- this->info.blit_fill = 1;
- } else {
- this->info.blit_fill = 0;
- }
- this->info.video_mem = get_video_size(this);
-}
-
-static int DGA_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- const char *display;
- int event_base, error_base;
- int major_version, minor_version;
- Visual *visual;
- SDL_NAME(XDGAMode) *modes;
- int i, num_modes;
-
- /* Open the X11 display */
- display = NULL; /* Get it from DISPLAY environment variable */
-
- DGA_Display = XOpenDisplay(display);
- if ( DGA_Display == NULL ) {
- SDL_SetError("Couldn't open X11 display");
- return(-1);
- }
-
- /* Check for the DGA extension */
- if ( ! SDL_NAME(XDGAQueryExtension)(DGA_Display, &event_base, &error_base) ||
- ! SDL_NAME(XDGAQueryVersion)(DGA_Display, &major_version, &minor_version) ) {
- SDL_SetError("DGA extension not available");
- XCloseDisplay(DGA_Display);
- return(-1);
- }
- if ( major_version < 2 ) {
- SDL_SetError("DGA driver requires DGA 2.0 or newer");
- XCloseDisplay(DGA_Display);
- return(-1);
- }
- DGA_event_base = event_base;
-
- /* Determine the current screen size */
- this->info.current_w = DisplayWidth(DGA_Display, DGA_Screen);
- this->info.current_h = DisplayHeight(DGA_Display, DGA_Screen);
-
- /* Determine the current screen depth */
- visual = DefaultVisual(DGA_Display, DGA_Screen);
- {
- XPixmapFormatValues *pix_format;
- int i, num_formats;
-
- vformat->BitsPerPixel = DefaultDepth(DGA_Display, DGA_Screen);
- pix_format = XListPixmapFormats(DGA_Display, &num_formats);
- if ( pix_format == NULL ) {
- SDL_SetError("Couldn't determine screen formats");
- XCloseDisplay(DGA_Display);
- return(-1);
- }
- for ( i=0; i<num_formats; ++i ) {
- if ( vformat->BitsPerPixel == pix_format[i].depth )
- break;
- }
- if ( i != num_formats )
- vformat->BitsPerPixel = pix_format[i].bits_per_pixel;
- XFree((char *)pix_format);
- }
- if ( vformat->BitsPerPixel > 8 ) {
- vformat->Rmask = visual->red_mask;
- vformat->Gmask = visual->green_mask;
- vformat->Bmask = visual->blue_mask;
- }
-
- /* Open access to the framebuffer */
- if ( ! SDL_NAME(XDGAOpenFramebuffer)(DGA_Display, DGA_Screen) ) {
- SDL_SetError("Unable to map the video memory");
- XCloseDisplay(DGA_Display);
- return(-1);
- }
-
- /* Save DPMS and screensaver settings */
- X11_SaveScreenSaver(DGA_Display, &screensaver_timeout, &dpms_enabled);
- X11_DisableScreenSaver(DGA_Display);
-
- /* Query for the list of available video modes */
- modes = SDL_NAME(XDGAQueryModes)(DGA_Display, DGA_Screen, &num_modes);
- SDL_qsort(modes, num_modes, sizeof *modes, cmpmodes);
- for ( i=0; i<num_modes; ++i ) {
- if ( ((modes[i].visualClass == PseudoColor) ||
- (modes[i].visualClass == DirectColor) ||
- (modes[i].visualClass == TrueColor)) &&
- !(modes[i].flags & (XDGAInterlaced|XDGADoublescan)) ) {
-#ifdef DGA_DEBUG
- PrintMode(&modes[i]);
-#endif
- DGA_AddMode(this, modes[i].bitsPerPixel,
- modes[i].viewportWidth,
- modes[i].viewportHeight);
- }
- }
- UpdateHWInfo(this, modes);
- XFree(modes);
-
- /* Create the hardware surface lock mutex */
- hw_lock = SDL_CreateMutex();
- if ( hw_lock == NULL ) {
- SDL_SetError("Unable to create lock mutex");
- DGA_VideoQuit(this);
- return(-1);
- }
-
-#ifdef LOCK_DGA_DISPLAY
- /* Create the event lock so we're thread-safe.. :-/ */
- event_lock = SDL_CreateMutex();
-#endif /* LOCK_DGA_DISPLAY */
-
- /* We're done! */
- return(0);
-}
-
-SDL_Rect **DGA_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- return(SDL_modelist[((format->BitsPerPixel+7)/8)-1]);
-}
-
-/* Various screen update functions available */
-static void DGA_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
-
-SDL_Surface *DGA_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- SDL_NAME(XDGAMode) *modes;
- int i, num_modes;
- SDL_NAME(XDGADevice) *mode;
- int screen_len;
- Uint8 *surfaces_mem;
- int surfaces_len;
-
- /* Free any previous colormap */
- if ( DGA_colormap ) {
- XFreeColormap(DGA_Display, DGA_colormap);
- DGA_colormap = 0;
- }
-
- /* Search for a matching video mode */
- modes = SDL_NAME(XDGAQueryModes)(DGA_Display, DGA_Screen, &num_modes);
- SDL_qsort(modes, num_modes, sizeof *modes, cmpmodes);
- for ( i=0; i<num_modes; ++i ) {
- int depth;
-
- depth = modes[i].depth;
- if ( depth == 24 ) { /* Distinguish between 24 and 32 bpp */
- depth = modes[i].bitsPerPixel;
- }
- if ( (depth == bpp) &&
- (modes[i].viewportWidth == width) &&
- (modes[i].viewportHeight == height) &&
- ((modes[i].visualClass == PseudoColor) ||
- (modes[i].visualClass == DirectColor) ||
- (modes[i].visualClass == TrueColor)) &&
- !(modes[i].flags & (XDGAInterlaced|XDGADoublescan)) ) {
- break;
- }
- }
- if ( i == num_modes ) {
- SDL_SetError("No matching video mode found");
- return(NULL);
- }
-#ifdef DGA_DEBUG
- PrintMode(&modes[i]);
-#endif
-
- /* Set the video mode */
- mode = SDL_NAME(XDGASetMode)(DGA_Display, DGA_Screen, modes[i].num);
- XFree(modes);
- if ( mode == NULL ) {
- SDL_SetError("Unable to switch to requested mode");
- return(NULL);
- }
- DGA_visualClass = mode->mode.visualClass;
- memory_base = (Uint8 *)mode->data;
- memory_pitch = mode->mode.bytesPerScanline;
-
- /* Set up the new mode framebuffer */
- current->flags = (SDL_FULLSCREEN|SDL_HWSURFACE);
- current->w = mode->mode.viewportWidth;
- current->h = mode->mode.viewportHeight;
- current->pitch = memory_pitch;
- current->pixels = memory_base;
- if ( ! SDL_ReallocFormat(current, mode->mode.bitsPerPixel,
- mode->mode.redMask,
- mode->mode.greenMask,
- mode->mode.blueMask, 0) ) {
- return(NULL);
- }
- screen_len = current->h*current->pitch;
-
- /* Create a colormap if necessary */
- if ( (DGA_visualClass == PseudoColor) ||
- (DGA_visualClass == DirectColor) ) {
- DGA_colormap = SDL_NAME(XDGACreateColormap)(DGA_Display, DGA_Screen,
- mode, AllocAll);
- if ( DGA_visualClass == PseudoColor ) {
- current->flags |= SDL_HWPALETTE;
- } else {
- /* Initialize the colormap to the identity mapping */
- SDL_GetGammaRamp(0, 0, 0);
- this->screen = current;
- DGA_SetGammaRamp(this, this->gamma);
- this->screen = NULL;
- }
- } else {
- DGA_colormap = SDL_NAME(XDGACreateColormap)(DGA_Display, DGA_Screen,
- mode, AllocNone);
- }
- SDL_NAME(XDGAInstallColormap)(DGA_Display, DGA_Screen, DGA_colormap);
-
- /* Update the hardware capabilities */
- UpdateHWInfo(this, &mode->mode);
-
- /* Set up the information for hardware surfaces */
- surfaces_mem = (Uint8 *)current->pixels + screen_len;
- surfaces_len = (mode->mode.imageHeight*current->pitch - screen_len);
-
- /* Update for double-buffering, if we can */
- SDL_NAME(XDGASetViewport)(DGA_Display, DGA_Screen, 0, 0, XDGAFlipRetrace);
- if ( flags & SDL_DOUBLEBUF ) {
- if ( mode->mode.imageHeight >= (current->h*2) ) {
- current->flags |= SDL_DOUBLEBUF;
- flip_page = 0;
- flip_yoffset[0] = 0;
- flip_yoffset[1] = current->h;
- flip_address[0] = memory_base;
- flip_address[1] = memory_base+screen_len;
- surfaces_mem += screen_len;
- surfaces_len -= screen_len;
- }
- }
-
- /* Allocate memory tracking for hardware surfaces */
- DGA_FreeHWSurfaces(this);
- if ( surfaces_len < 0 ) {
- surfaces_len = 0;
- }
- DGA_InitHWSurfaces(this, current, surfaces_mem, surfaces_len);
-
- /* Expose the back buffer as surface memory */
- if ( current->flags & SDL_DOUBLEBUF ) {
- this->screen = current;
- DGA_FlipHWSurface(this, current);
- this->screen = NULL;
- }
-
- /* Set the update rectangle function */
- this->UpdateRects = DGA_DirectUpdate;
-
- /* Enable mouse and keyboard support */
- { long input_mask;
- input_mask = (KeyPressMask | KeyReleaseMask);
- input_mask |= (ButtonPressMask | ButtonReleaseMask);
- input_mask |= PointerMotionMask;
- SDL_NAME(XDGASelectInput)(DGA_Display, DGA_Screen, input_mask);
- }
-
- /* We're done */
- return(current);
-}
-
-#ifdef DGA_DEBUG
-static void DGA_DumpHWSurfaces(_THIS)
-{
- vidmem_bucket *bucket;
-
- printf("Memory left: %d (%d total)\n", surfaces_memleft, surfaces_memtotal);
- printf("\n");
- printf(" Base Size\n");
- for ( bucket=&surfaces; bucket; bucket=bucket->next ) {
- printf("Bucket: %p, %d (%s)\n", bucket->base, bucket->size, bucket->used ? "used" : "free");
- if ( bucket->prev ) {
- if ( bucket->base != bucket->prev->base+bucket->prev->size ) {
- printf("Warning, corrupt bucket list! (prev)\n");
- }
- } else {
- if ( bucket != &surfaces ) {
- printf("Warning, corrupt bucket list! (!prev)\n");
- }
- }
- if ( bucket->next ) {
- if ( bucket->next->base != bucket->base+bucket->size ) {
- printf("Warning, corrupt bucket list! (next)\n");
- }
- }
- }
- printf("\n");
-}
-#endif
-
-static int DGA_InitHWSurfaces(_THIS, SDL_Surface *screen, Uint8 *base, int size)
-{
- vidmem_bucket *bucket;
-
- surfaces_memtotal = size;
- surfaces_memleft = size;
-
- if ( surfaces_memleft > 0 ) {
- bucket = (vidmem_bucket *)SDL_malloc(sizeof(*bucket));
- if ( bucket == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
- bucket->prev = &surfaces;
- bucket->used = 0;
- bucket->dirty = 0;
- bucket->base = base;
- bucket->size = size;
- bucket->next = NULL;
- } else {
- bucket = NULL;
- }
-
- surfaces.prev = NULL;
- surfaces.used = 1;
- surfaces.dirty = 0;
- surfaces.base = screen->pixels;
- surfaces.size = (unsigned int)((long)base - (long)surfaces.base);
- surfaces.next = bucket;
- screen->hwdata = (struct private_hwdata *)&surfaces;
- return(0);
-}
-static void DGA_FreeHWSurfaces(_THIS)
-{
- vidmem_bucket *bucket, *freeable;
-
- bucket = surfaces.next;
- while ( bucket ) {
- freeable = bucket;
- bucket = bucket->next;
- SDL_free(freeable);
- }
- surfaces.next = NULL;
-}
-
-static __inline__ void DGA_AddBusySurface(SDL_Surface *surface)
-{
- ((vidmem_bucket *)surface->hwdata)->dirty = 1;
-}
-
-static __inline__ int DGA_IsSurfaceBusy(SDL_Surface *surface)
-{
- return ((vidmem_bucket *)surface->hwdata)->dirty;
-}
-
-static __inline__ void DGA_WaitBusySurfaces(_THIS)
-{
- vidmem_bucket *bucket;
-
- /* Wait for graphic operations to complete */
- SDL_NAME(XDGASync)(DGA_Display, DGA_Screen);
-
- /* Clear all surface dirty bits */
- for ( bucket=&surfaces; bucket; bucket=bucket->next ) {
- bucket->dirty = 0;
- }
-}
-
-static int DGA_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- vidmem_bucket *bucket;
- int size;
- int extra;
- int retval = 0;
-
-/* Temporarily, we only allow surfaces the same width as display.
- Some blitters require the pitch between two hardware surfaces
- to be the same. Others have interesting alignment restrictions.
-*/
-if ( surface->pitch > SDL_VideoSurface->pitch ) {
- SDL_SetError("Surface requested wider than screen");
- return(-1);
-}
-surface->pitch = SDL_VideoSurface->pitch;
- size = surface->h * surface->pitch;
-#ifdef DGA_DEBUG
- fprintf(stderr, "Allocating bucket of %d bytes\n", size);
-#endif
- LOCK_DISPLAY();
-
- /* Quick check for available mem */
- if ( size > surfaces_memleft ) {
- SDL_SetError("Not enough video memory");
- retval = -1;
- goto done;
- }
-
- /* Search for an empty bucket big enough */
- for ( bucket=&surfaces; bucket; bucket=bucket->next ) {
- if ( ! bucket->used && (size <= bucket->size) ) {
- break;
- }
- }
- if ( bucket == NULL ) {
- SDL_SetError("Video memory too fragmented");
- retval = -1;
- goto done;
- }
-
- /* Create a new bucket for left-over memory */
- extra = (bucket->size - size);
- if ( extra ) {
- vidmem_bucket *newbucket;
-
-#ifdef DGA_DEBUG
- fprintf(stderr, "Adding new free bucket of %d bytes\n", extra);
-#endif
- newbucket = (vidmem_bucket *)SDL_malloc(sizeof(*newbucket));
- if ( newbucket == NULL ) {
- SDL_OutOfMemory();
- retval = -1;
- goto done;
- }
- newbucket->prev = bucket;
- newbucket->used = 0;
- newbucket->base = bucket->base+size;
- newbucket->size = extra;
- newbucket->next = bucket->next;
- if ( bucket->next ) {
- bucket->next->prev = newbucket;
- }
- bucket->next = newbucket;
- }
-
- /* Set the current bucket values and return it! */
- bucket->used = 1;
- bucket->size = size;
- bucket->dirty = 0;
-#ifdef DGA_DEBUG
- fprintf(stderr, "Allocated %d bytes at %p\n", bucket->size, bucket->base);
-#endif
- surfaces_memleft -= size;
- surface->flags |= SDL_HWSURFACE;
- surface->pixels = bucket->base;
- surface->hwdata = (struct private_hwdata *)bucket;
-done:
- UNLOCK_DISPLAY();
- return(retval);
-}
-static void DGA_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- vidmem_bucket *bucket, *freeable;
-
- /* Wait for any pending operations involving this surface */
- if ( DGA_IsSurfaceBusy(surface) ) {
- LOCK_DISPLAY();
- DGA_WaitBusySurfaces(this);
- UNLOCK_DISPLAY();
- }
-
- /* Look for the bucket in the current list */
- for ( bucket=&surfaces; bucket; bucket=bucket->next ) {
- if ( bucket == (vidmem_bucket *)surface->hwdata ) {
- break;
- }
- }
- if ( bucket && bucket->used ) {
- /* Add the memory back to the total */
-#ifdef DGA_DEBUG
- printf("Freeing bucket of %d bytes\n", bucket->size);
-#endif
- surfaces_memleft += bucket->size;
-
- /* Can we merge the space with surrounding buckets? */
- bucket->used = 0;
- if ( bucket->next && ! bucket->next->used ) {
-#ifdef DGA_DEBUG
- printf("Merging with next bucket, for %d total bytes\n", bucket->size+bucket->next->size);
-#endif
- freeable = bucket->next;
- bucket->size += bucket->next->size;
- bucket->next = bucket->next->next;
- if ( bucket->next ) {
- bucket->next->prev = bucket;
- }
- SDL_free(freeable);
- }
- if ( bucket->prev && ! bucket->prev->used ) {
-#ifdef DGA_DEBUG
- printf("Merging with previous bucket, for %d total bytes\n", bucket->prev->size+bucket->size);
-#endif
- freeable = bucket;
- bucket->prev->size += bucket->size;
- bucket->prev->next = bucket->next;
- if ( bucket->next ) {
- bucket->next->prev = bucket->prev;
- }
- SDL_free(freeable);
- }
- }
- surface->pixels = NULL;
- surface->hwdata = NULL;
-}
-
-static __inline__ void DGA_dst_to_xy(_THIS, SDL_Surface *dst, int *x, int *y)
-{
- *x = (long)((Uint8 *)dst->pixels - memory_base)%memory_pitch;
- *y = (long)((Uint8 *)dst->pixels - memory_base)/memory_pitch;
-}
-
-static int DGA_FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color)
-{
- int x, y;
- unsigned int w, h;
-
- /* Don't fill the visible part of the screen, wait until flipped */
- LOCK_DISPLAY();
- if ( was_flipped && (dst == this->screen) ) {
- while ( SDL_NAME(XDGAGetViewportStatus)(DGA_Display, DGA_Screen) )
- /* Keep waiting for the hardware ... */ ;
- was_flipped = 0;
- }
- DGA_dst_to_xy(this, dst, &x, &y);
- x += rect->x;
- y += rect->y;
- w = rect->w;
- h = rect->h;
-#if 0
- printf("Hardware accelerated rectangle fill: %dx%d at %d,%d\n", w, h, x, y);
-#endif
- SDL_NAME(XDGAFillRectangle)(DGA_Display, DGA_Screen, x, y, w, h, color);
- if ( !(this->screen->flags & SDL_DOUBLEBUF) ) {
- XFlush(DGA_Display);
- }
- DGA_AddBusySurface(dst);
- UNLOCK_DISPLAY();
- return(0);
-}
-
-static int HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect)
-{
- SDL_VideoDevice *this;
- int srcx, srcy;
- int dstx, dsty;
- unsigned int w, h;
-
- this = current_video;
- /* Don't blit to the visible part of the screen, wait until flipped */
- LOCK_DISPLAY();
- if ( was_flipped && (dst == this->screen) ) {
- while ( SDL_NAME(XDGAGetViewportStatus)(DGA_Display, DGA_Screen) )
- /* Keep waiting for the hardware ... */ ;
- was_flipped = 0;
- }
- DGA_dst_to_xy(this, src, &srcx, &srcy);
- srcx += srcrect->x;
- srcy += srcrect->y;
- DGA_dst_to_xy(this, dst, &dstx, &dsty);
- dstx += dstrect->x;
- dsty += dstrect->y;
- w = srcrect->w;
- h = srcrect->h;
-#if 0
- printf("Blitting %dx%d from %d,%d to %d,%d\n", w, h, srcx, srcy, dstx, dsty);
-#endif
- if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
- SDL_NAME(XDGACopyTransparentArea)(DGA_Display, DGA_Screen,
- srcx, srcy, w, h, dstx, dsty, src->format->colorkey);
- } else {
- SDL_NAME(XDGACopyArea)(DGA_Display, DGA_Screen,
- srcx, srcy, w, h, dstx, dsty);
- }
- if ( !(this->screen->flags & SDL_DOUBLEBUF) ) {
- XFlush(DGA_Display);
- }
- DGA_AddBusySurface(src);
- DGA_AddBusySurface(dst);
- UNLOCK_DISPLAY();
- return(0);
-}
-
-static int DGA_CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst)
-{
- int accelerated;
-
- /* Set initial acceleration on */
- src->flags |= SDL_HWACCEL;
-
- /* Set the surface attributes */
- if ( (src->flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
- if ( ! this->info.blit_hw_A ) {
- src->flags &= ~SDL_HWACCEL;
- }
- }
- if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
- if ( ! this->info.blit_hw_CC ) {
- src->flags &= ~SDL_HWACCEL;
- }
- }
-
- /* Check to see if final surface blit is accelerated */
- accelerated = !!(src->flags & SDL_HWACCEL);
- if ( accelerated ) {
- src->map->hw_blit = HWAccelBlit;
- }
- return(accelerated);
-}
-
-static __inline__ void DGA_WaitFlip(_THIS)
-{
- if ( was_flipped ) {
- while ( SDL_NAME(XDGAGetViewportStatus)(DGA_Display, DGA_Screen) )
- /* Keep waiting for the hardware ... */ ;
- was_flipped = 0;
- }
-}
-
-static int DGA_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- if ( surface == this->screen ) {
- SDL_mutexP(hw_lock);
- LOCK_DISPLAY();
- if ( DGA_IsSurfaceBusy(surface) ) {
- DGA_WaitBusySurfaces(this);
- }
- DGA_WaitFlip(this);
- UNLOCK_DISPLAY();
- } else {
- if ( DGA_IsSurfaceBusy(surface) ) {
- LOCK_DISPLAY();
- DGA_WaitBusySurfaces(this);
- UNLOCK_DISPLAY();
- }
- }
- return(0);
-}
-static void DGA_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- if ( surface == this->screen ) {
- SDL_mutexV(hw_lock);
- }
-}
-
-static int DGA_FlipHWSurface(_THIS, SDL_Surface *surface)
-{
- /* Wait for vertical retrace and then flip display */
- LOCK_DISPLAY();
- if ( DGA_IsSurfaceBusy(this->screen) ) {
- DGA_WaitBusySurfaces(this);
- }
- DGA_WaitFlip(this);
- SDL_NAME(XDGASetViewport)(DGA_Display, DGA_Screen,
- 0, flip_yoffset[flip_page], XDGAFlipRetrace);
- XFlush(DGA_Display);
- UNLOCK_DISPLAY();
- was_flipped = 1;
- flip_page = !flip_page;
-
- surface->pixels = flip_address[flip_page];
- return(0);
-}
-
-static void DGA_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- /* The application is already updating the visible video memory */
- return;
-}
-
-static int DGA_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- int i;
- XColor *xcmap;
-
- /* This happens on initialization */
- if ( ! DGA_colormap ) {
- return(0);
- }
- xcmap = SDL_stack_alloc(XColor, ncolors);
- for ( i=0; i<ncolors; ++i ) {
- xcmap[i].pixel = firstcolor + i;
- xcmap[i].red = (colors[i].r<<8)|colors[i].r;
- xcmap[i].green = (colors[i].g<<8)|colors[i].g;
- xcmap[i].blue = (colors[i].b<<8)|colors[i].b;
- xcmap[i].flags = (DoRed|DoGreen|DoBlue);
- }
- LOCK_DISPLAY();
- XStoreColors(DGA_Display, DGA_colormap, xcmap, ncolors);
- XSync(DGA_Display, False);
- UNLOCK_DISPLAY();
- SDL_stack_free(xcmap);
-
- /* That was easy. :) */
- return(1);
-}
-
-int DGA_SetGammaRamp(_THIS, Uint16 *ramp)
-{
- int i, ncolors;
- XColor xcmap[256];
-
- /* See if actually setting the gamma is supported */
- if ( DGA_visualClass != DirectColor ) {
- SDL_SetError("Gamma correction not supported on this visual");
- return(-1);
- }
-
- /* Calculate the appropriate palette for the given gamma ramp */
- if ( this->screen->format->BitsPerPixel <= 16 ) {
- ncolors = 64; /* Is this right? */
- } else {
- ncolors = 256;
- }
- for ( i=0; i<ncolors; ++i ) {
- Uint8 c = (256 * i / ncolors);
- xcmap[i].pixel = SDL_MapRGB(this->screen->format, c, c, c);
- xcmap[i].red = ramp[0*256+c];
- xcmap[i].green = ramp[1*256+c];
- xcmap[i].blue = ramp[2*256+c];
- xcmap[i].flags = (DoRed|DoGreen|DoBlue);
- }
- LOCK_DISPLAY();
- XStoreColors(DGA_Display, DGA_colormap, xcmap, ncolors);
- XSync(DGA_Display, False);
- UNLOCK_DISPLAY();
- return(0);
-}
-
-void DGA_VideoQuit(_THIS)
-{
- int i, j;
-
- if ( DGA_Display ) {
- /* Free colormap, if necessary */
- if ( DGA_colormap ) {
- XFreeColormap(DGA_Display, DGA_colormap);
- DGA_colormap = 0;
- }
-
- /* Unmap memory and reset video mode */
- SDL_NAME(XDGACloseFramebuffer)(DGA_Display, DGA_Screen);
- if ( this->screen ) {
- /* Tell SDL not to free the pixels */
- DGA_FreeHWSurface(this, this->screen);
- }
- SDL_NAME(XDGASetMode)(DGA_Display, DGA_Screen, 0);
-
- /* Clear the lock mutex */
- if ( hw_lock != NULL ) {
- SDL_DestroyMutex(hw_lock);
- hw_lock = NULL;
- }
-#ifdef LOCK_DGA_DISPLAY
- if ( event_lock != NULL ) {
- SDL_DestroyMutex(event_lock);
- event_lock = NULL;
- }
-#endif /* LOCK_DGA_DISPLAY */
-
- /* Clean up defined video modes */
- for ( i=0; i<NUM_MODELISTS; ++i ) {
- if ( SDL_modelist[i] != NULL ) {
- for ( j=0; SDL_modelist[i][j]; ++j ) {
- SDL_free(SDL_modelist[i][j]);
- }
- SDL_free(SDL_modelist[i]);
- SDL_modelist[i] = NULL;
- }
- }
-
- /* Clean up the memory bucket list */
- DGA_FreeHWSurfaces(this);
-
- /* Restore DPMS and screensaver settings */
- X11_RestoreScreenSaver(DGA_Display, screensaver_timeout, dpms_enabled);
-
- /* Close up the display */
- XCloseDisplay(DGA_Display);
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/dga/SDL_dgavideo.h b/distrib/sdl-1.2.12/src/video/dga/SDL_dgavideo.h
deleted file mode 100644
index a0915da..0000000
--- a/distrib/sdl-1.2.12/src/video/dga/SDL_dgavideo.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_dgavideo_h
-#define _SDL_dgavideo_h
-
-#include <X11/Xlib.h>
-#include <X11/Xlibint.h>
-#include <X11/Xproto.h>
-
-#include "SDL_mouse.h"
-#include "SDL_mutex.h"
-#include "../SDL_sysvideo.h"
-
-#if SDL_VIDEO_DRIVER_X11_DPMS
-#include <X11/extensions/dpms.h>
-#endif
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-/* Define this if you need the DGA driver to be thread-safe */
-#define LOCK_DGA_DISPLAY
-#ifdef LOCK_DGA_DISPLAY
-#define LOCK_DISPLAY() SDL_mutexP(event_lock)
-#define UNLOCK_DISPLAY() SDL_mutexV(event_lock)
-#else
-#define LOCK_DISPLAY()
-#define UNLOCK_DISPLAY()
-#endif
-
-
-/* This is the structure we use to keep track of video memory */
-typedef struct vidmem_bucket {
- struct vidmem_bucket *prev;
- int used;
- int dirty;
- Uint8 *base;
- unsigned int size;
- struct vidmem_bucket *next;
-} vidmem_bucket;
-
-/* Private display data */
-struct SDL_PrivateVideoData {
- Display *DGA_Display;
- Colormap DGA_colormap;
- int visualClass;
-
-#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
- int SDL_nummodes[NUM_MODELISTS];
- SDL_Rect **SDL_modelist[NUM_MODELISTS];
-
- /* Information for the video surface */
- Uint8 *memory_base;
- int memory_pitch;
- SDL_mutex *hw_lock;
- int sync_needed;
- int was_flipped;
-
- /* Information for hardware surfaces */
- vidmem_bucket surfaces;
- int surfaces_memtotal;
- int surfaces_memleft;
-
- /* Information for double-buffering */
- int flip_page;
- int flip_yoffset[2];
- Uint8 *flip_address[2];
-
- /* Used to handle DGA events */
- int event_base;
-#ifdef LOCK_DGA_DISPLAY
- SDL_mutex *event_lock;
-#endif
-
- /* Screensaver settings */
- int screensaver_timeout;
- BOOL dpms_enabled;
-};
-/* Old variable names */
-#define DGA_Display (this->hidden->DGA_Display)
-#define DGA_Screen DefaultScreen(DGA_Display)
-#define DGA_colormap (this->hidden->DGA_colormap)
-#define DGA_visualClass (this->hidden->visualClass)
-#define memory_base (this->hidden->memory_base)
-#define memory_pitch (this->hidden->memory_pitch)
-#define flip_page (this->hidden->flip_page)
-#define flip_yoffset (this->hidden->flip_yoffset)
-#define flip_address (this->hidden->flip_address)
-#define sync_needed (this->hidden->sync_needed)
-#define was_flipped (this->hidden->was_flipped)
-#define SDL_nummodes (this->hidden->SDL_nummodes)
-#define SDL_modelist (this->hidden->SDL_modelist)
-#define surfaces (this->hidden->surfaces)
-#define surfaces_memtotal (this->hidden->surfaces_memtotal)
-#define surfaces_memleft (this->hidden->surfaces_memleft)
-#define hw_lock (this->hidden->hw_lock)
-#define DGA_event_base (this->hidden->event_base)
-#define event_lock (this->hidden->event_lock)
-#define screensaver_timeout (this->hidden->screensaver_timeout)
-#define dpms_enabled (this->hidden->dpms_enabled)
-
-#endif /* _SDL_dgavideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_events.c b/distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_events.c
deleted file mode 100644
index 0864d9a..0000000
--- a/distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_events.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Handle the event stream, converting DirectFB input events into SDL events */
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <termios.h>
-
-#include <directfb.h>
-
-#include "SDL.h"
-#include "../SDL_sysvideo.h"
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_DirectFB_video.h"
-#include "SDL_DirectFB_events.h"
-
-/* The translation tables from a DirectFB keycode to a SDL keysym */
-static SDLKey keymap[256];
-static SDL_keysym *DirectFB_TranslateKey (DFBInputEvent *ev, SDL_keysym *keysym);
-static int DirectFB_TranslateButton (DFBInputEvent *ev);
-
-static int posted = 0;
-
-
-void DirectFB_PumpEvents (_THIS)
-{
- DFBInputEvent evt;
-
- while (HIDDEN->eventbuffer->GetEvent (HIDDEN->eventbuffer,
- DFB_EVENT (&evt)) == DFB_OK)
- {
- SDL_keysym keysym;
-
- switch (evt.type)
- {
- case DIET_BUTTONPRESS:
- posted += SDL_PrivateMouseButton(SDL_PRESSED,
- DirectFB_TranslateButton (&evt), 0, 0);
- break;
- case DIET_BUTTONRELEASE:
- posted += SDL_PrivateMouseButton(SDL_RELEASED,
- DirectFB_TranslateButton (&evt), 0, 0);
- break;
- case DIET_KEYPRESS:
- posted += SDL_PrivateKeyboard(SDL_PRESSED, DirectFB_TranslateKey(&evt, &keysym));
- break;
- case DIET_KEYRELEASE:
- posted += SDL_PrivateKeyboard(SDL_RELEASED, DirectFB_TranslateKey(&evt, &keysym));
- break;
- case DIET_AXISMOTION:
- if (evt.flags & DIEF_AXISREL)
- {
- if (evt.axis == DIAI_X)
- posted += SDL_PrivateMouseMotion(0, 1, evt.axisrel, 0);
- else if (evt.axis == DIAI_Y)
- posted += SDL_PrivateMouseMotion(0, 1, 0, evt.axisrel);
- }
- break;
- default:
- ;
- }
- }
-}
-
-void DirectFB_InitOSKeymap (_THIS)
-{
- int i;
-
- /* Initialize the DirectFB key translation table */
- for (i=0; i<SDL_arraysize(keymap); ++i)
- keymap[i] = SDLK_UNKNOWN;
-
- keymap[DIKI_A - DIKI_UNKNOWN] = SDLK_a;
- keymap[DIKI_B - DIKI_UNKNOWN] = SDLK_b;
- keymap[DIKI_C - DIKI_UNKNOWN] = SDLK_c;
- keymap[DIKI_D - DIKI_UNKNOWN] = SDLK_d;
- keymap[DIKI_E - DIKI_UNKNOWN] = SDLK_e;
- keymap[DIKI_F - DIKI_UNKNOWN] = SDLK_f;
- keymap[DIKI_G - DIKI_UNKNOWN] = SDLK_g;
- keymap[DIKI_H - DIKI_UNKNOWN] = SDLK_h;
- keymap[DIKI_I - DIKI_UNKNOWN] = SDLK_i;
- keymap[DIKI_J - DIKI_UNKNOWN] = SDLK_j;
- keymap[DIKI_K - DIKI_UNKNOWN] = SDLK_k;
- keymap[DIKI_L - DIKI_UNKNOWN] = SDLK_l;
- keymap[DIKI_M - DIKI_UNKNOWN] = SDLK_m;
- keymap[DIKI_N - DIKI_UNKNOWN] = SDLK_n;
- keymap[DIKI_O - DIKI_UNKNOWN] = SDLK_o;
- keymap[DIKI_P - DIKI_UNKNOWN] = SDLK_p;
- keymap[DIKI_Q - DIKI_UNKNOWN] = SDLK_q;
- keymap[DIKI_R - DIKI_UNKNOWN] = SDLK_r;
- keymap[DIKI_S - DIKI_UNKNOWN] = SDLK_s;
- keymap[DIKI_T - DIKI_UNKNOWN] = SDLK_t;
- keymap[DIKI_U - DIKI_UNKNOWN] = SDLK_u;
- keymap[DIKI_V - DIKI_UNKNOWN] = SDLK_v;
- keymap[DIKI_W - DIKI_UNKNOWN] = SDLK_w;
- keymap[DIKI_X - DIKI_UNKNOWN] = SDLK_x;
- keymap[DIKI_Y - DIKI_UNKNOWN] = SDLK_y;
- keymap[DIKI_Z - DIKI_UNKNOWN] = SDLK_z;
-
- keymap[DIKI_0 - DIKI_UNKNOWN] = SDLK_0;
- keymap[DIKI_1 - DIKI_UNKNOWN] = SDLK_1;
- keymap[DIKI_2 - DIKI_UNKNOWN] = SDLK_2;
- keymap[DIKI_3 - DIKI_UNKNOWN] = SDLK_3;
- keymap[DIKI_4 - DIKI_UNKNOWN] = SDLK_4;
- keymap[DIKI_5 - DIKI_UNKNOWN] = SDLK_5;
- keymap[DIKI_6 - DIKI_UNKNOWN] = SDLK_6;
- keymap[DIKI_7 - DIKI_UNKNOWN] = SDLK_7;
- keymap[DIKI_8 - DIKI_UNKNOWN] = SDLK_8;
- keymap[DIKI_9 - DIKI_UNKNOWN] = SDLK_9;
-
- keymap[DIKI_F1 - DIKI_UNKNOWN] = SDLK_F1;
- keymap[DIKI_F2 - DIKI_UNKNOWN] = SDLK_F2;
- keymap[DIKI_F3 - DIKI_UNKNOWN] = SDLK_F3;
- keymap[DIKI_F4 - DIKI_UNKNOWN] = SDLK_F4;
- keymap[DIKI_F5 - DIKI_UNKNOWN] = SDLK_F5;
- keymap[DIKI_F6 - DIKI_UNKNOWN] = SDLK_F6;
- keymap[DIKI_F7 - DIKI_UNKNOWN] = SDLK_F7;
- keymap[DIKI_F8 - DIKI_UNKNOWN] = SDLK_F8;
- keymap[DIKI_F9 - DIKI_UNKNOWN] = SDLK_F9;
- keymap[DIKI_F10 - DIKI_UNKNOWN] = SDLK_F10;
- keymap[DIKI_F11 - DIKI_UNKNOWN] = SDLK_F11;
- keymap[DIKI_F12 - DIKI_UNKNOWN] = SDLK_F12;
-
- keymap[DIKI_ESCAPE - DIKI_UNKNOWN] = SDLK_ESCAPE;
- keymap[DIKI_LEFT - DIKI_UNKNOWN] = SDLK_LEFT;
- keymap[DIKI_RIGHT - DIKI_UNKNOWN] = SDLK_RIGHT;
- keymap[DIKI_UP - DIKI_UNKNOWN] = SDLK_UP;
- keymap[DIKI_DOWN - DIKI_UNKNOWN] = SDLK_DOWN;
- keymap[DIKI_CONTROL_L - DIKI_UNKNOWN] = SDLK_LCTRL;
- keymap[DIKI_CONTROL_R - DIKI_UNKNOWN] = SDLK_RCTRL;
- keymap[DIKI_SHIFT_L - DIKI_UNKNOWN] = SDLK_LSHIFT;
- keymap[DIKI_SHIFT_R - DIKI_UNKNOWN] = SDLK_RSHIFT;
- keymap[DIKI_ALT_L - DIKI_UNKNOWN] = SDLK_LALT;
- keymap[DIKI_ALT_R - DIKI_UNKNOWN] = SDLK_RALT;
- keymap[DIKI_TAB - DIKI_UNKNOWN] = SDLK_TAB;
- keymap[DIKI_ENTER - DIKI_UNKNOWN] = SDLK_RETURN;
- keymap[DIKI_SPACE - DIKI_UNKNOWN] = SDLK_SPACE;
- keymap[DIKI_BACKSPACE - DIKI_UNKNOWN] = SDLK_BACKSPACE;
- keymap[DIKI_INSERT - DIKI_UNKNOWN] = SDLK_INSERT;
- keymap[DIKI_DELETE - DIKI_UNKNOWN] = SDLK_DELETE;
- keymap[DIKI_HOME - DIKI_UNKNOWN] = SDLK_HOME;
- keymap[DIKI_END - DIKI_UNKNOWN] = SDLK_END;
- keymap[DIKI_PAGE_UP - DIKI_UNKNOWN] = SDLK_PAGEUP;
- keymap[DIKI_PAGE_DOWN - DIKI_UNKNOWN] = SDLK_PAGEDOWN;
- keymap[DIKI_CAPS_LOCK - DIKI_UNKNOWN] = SDLK_CAPSLOCK;
- keymap[DIKI_NUM_LOCK - DIKI_UNKNOWN] = SDLK_NUMLOCK;
- keymap[DIKI_SCROLL_LOCK - DIKI_UNKNOWN] = SDLK_SCROLLOCK;
- keymap[DIKI_PRINT - DIKI_UNKNOWN] = SDLK_PRINT;
- keymap[DIKI_PAUSE - DIKI_UNKNOWN] = SDLK_PAUSE;
- keymap[DIKI_KP_DIV - DIKI_UNKNOWN] = SDLK_KP_DIVIDE;
- keymap[DIKI_KP_MULT - DIKI_UNKNOWN] = SDLK_KP_MULTIPLY;
- keymap[DIKI_KP_MINUS - DIKI_UNKNOWN] = SDLK_KP_MINUS;
- keymap[DIKI_KP_PLUS - DIKI_UNKNOWN] = SDLK_KP_PLUS;
- keymap[DIKI_KP_ENTER - DIKI_UNKNOWN] = SDLK_KP_ENTER;
-}
-
-
-static SDL_keysym *DirectFB_TranslateKey (DFBInputEvent *ev, SDL_keysym *keysym)
-{
- /* Set the keysym information */
- keysym->scancode = ev->key_id;
- keysym->mod = KMOD_NONE; /* FIXME */
- keysym->unicode = (DFB_KEY_TYPE (ev->key_symbol) == DIKT_UNICODE) ? ev->key_symbol : 0;
-
- if (ev->key_symbol > 0 && ev->key_symbol < 128)
- keysym->sym = ev->key_symbol;
- else
- keysym->sym = keymap[ev->key_id - DIKI_UNKNOWN];
-
- return keysym;
-}
-
-static int DirectFB_TranslateButton (DFBInputEvent *ev)
-{
- switch (ev->button)
- {
- case DIBI_LEFT:
- return 1;
- case DIBI_MIDDLE:
- return 2;
- case DIBI_RIGHT:
- return 3;
- default:
- return 0;
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_events.h b/distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_events.h
deleted file mode 100644
index b4b4370..0000000
--- a/distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_events.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_DirectFB_video.h"
-
-/* Functions to be exported */
-extern void DirectFB_InitOSKeymap(_THIS);
-extern void DirectFB_PumpEvents(_THIS);
-
diff --git a/distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_video.c b/distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_video.c
deleted file mode 100644
index 5b592c1..0000000
--- a/distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_video.c
+++ /dev/null
@@ -1,1171 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- MGA CRTC2 support by Thomas Jarosch - tomj@simonv.com
- CRTC2 support is inspired by mplayer's dfbmga driver
- written by Ville Syrj��<syrjala@sci.fi>
-*/
-#include "SDL_config.h"
-
-/* DirectFB video driver implementation.
-*/
-
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/mman.h>
-
-#include <directfb.h>
-#include <directfb_version.h>
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_DirectFB_video.h"
-#include "SDL_DirectFB_events.h"
-#include "SDL_DirectFB_yuv.h"
-
-/* The implementation dependent data for the window manager cursor */
-struct WMcursor {
- int unused;
-};
-
-
-/* Initialization/Query functions */
-static int DirectFB_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **DirectFB_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *DirectFB_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int DirectFB_SetColors(_THIS, int firstcolor, int ncolors,
- SDL_Color *colors);
-static void DirectFB_VideoQuit(_THIS);
-
-/* Hardware surface functions */
-static int DirectFB_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int DirectFB_FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);
-static int DirectFB_LockHWSurface(_THIS, SDL_Surface *surface);
-static void DirectFB_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static void DirectFB_FreeHWSurface(_THIS, SDL_Surface *surface);
-static int DirectFB_CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst);
-static int DirectFB_HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect);
-static int DirectFB_SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key);
-static int DirectFB_SetHWAlpha(_THIS, SDL_Surface *surface, Uint8 alpha);
-static int DirectFB_FlipHWSurface(_THIS, SDL_Surface *surface);
-static int DirectFB_ShowWMCursor(_THIS, WMcursor *cursor);
-
-/* Various screen update functions available */
-static void DirectFB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
-static void DirectFB_WindowedUpdate(_THIS, int numrects, SDL_Rect *rects);
-
-/* This is the rect EnumModes2 uses */
-struct DirectFBEnumRect {
- SDL_Rect r;
- struct DirectFBEnumRect* next;
-};
-
-static struct DirectFBEnumRect *enumlist = NULL;
-
-
-/* DirectFB driver bootstrap functions */
-
-static int DirectFB_Available(void)
-{
- return 1;
-}
-
-static void DirectFB_DeleteDevice(SDL_VideoDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_VideoDevice *DirectFB_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if (device)
- {
- SDL_memset (device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData *) malloc (sizeof (*device->hidden));
- }
- if (device == NULL || device->hidden == NULL)
- {
- SDL_OutOfMemory();
- if (device)
- {
- free (device);
- }
- return(0);
- }
- SDL_memset (device->hidden, 0, sizeof (*device->hidden));
-
- /* Set the function pointers */
- device->VideoInit = DirectFB_VideoInit;
- device->ListModes = DirectFB_ListModes;
- device->SetVideoMode = DirectFB_SetVideoMode;
- device->SetColors = DirectFB_SetColors;
- device->UpdateRects = NULL;
- device->CreateYUVOverlay = DirectFB_CreateYUVOverlay;
- device->VideoQuit = DirectFB_VideoQuit;
- device->AllocHWSurface = DirectFB_AllocHWSurface;
- device->CheckHWBlit = DirectFB_CheckHWBlit;
- device->FillHWRect = DirectFB_FillHWRect;
- device->SetHWColorKey = DirectFB_SetHWColorKey;
- device->SetHWAlpha = DirectFB_SetHWAlpha;
- device->LockHWSurface = DirectFB_LockHWSurface;
- device->UnlockHWSurface = DirectFB_UnlockHWSurface;
- device->FlipHWSurface = DirectFB_FlipHWSurface;
- device->FreeHWSurface = DirectFB_FreeHWSurface;
- device->ShowWMCursor = DirectFB_ShowWMCursor;
- device->SetCaption = NULL;
- device->SetIcon = NULL;
- device->IconifyWindow = NULL;
- device->GrabInput = NULL;
- device->GetWMInfo = NULL;
- device->InitOSKeymap = DirectFB_InitOSKeymap;
- device->PumpEvents = DirectFB_PumpEvents;
-
- device->free = DirectFB_DeleteDevice;
-
- return device;
-}
-
-VideoBootStrap DirectFB_bootstrap = {
- "directfb", "DirectFB",
- DirectFB_Available, DirectFB_CreateDevice
-};
-
-static DFBSurfacePixelFormat GetFormatForBpp (int bpp, IDirectFBDisplayLayer *layer)
-{
- DFBDisplayLayerConfig dlc;
- int bytes = (bpp + 7) / 8;
-
- layer->GetConfiguration (layer, &dlc);
-
- if (bytes == DFB_BYTES_PER_PIXEL(dlc.pixelformat) && bytes > 1)
- return dlc.pixelformat;
-
- switch (bytes)
- {
- case 1:
- return DSPF_LUT8;
- case 2:
- return DSPF_RGB16;
- case 3:
- return DSPF_RGB24;
- case 4:
- return DSPF_RGB32;
- }
-
- return DSPF_UNKNOWN;
-}
-
-static DFBEnumerationResult EnumModesCallback (int width,
- int height,
- int bpp,
- void *data)
-{
- SDL_VideoDevice *this = (SDL_VideoDevice *)data;
- struct DirectFBEnumRect *enumrect;
-
- HIDDEN->nummodes++;
-
- if (enumlist && enumlist->r.w == width && enumlist->r.h == height)
- return DFENUM_OK;
-
- enumrect = SDL_calloc(1, sizeof(struct DirectFBEnumRect));
- if (!enumrect)
- {
- SDL_OutOfMemory();
- return DFENUM_CANCEL;
- }
-
- enumrect->r.w = (Uint16)width;
- enumrect->r.h = (Uint16)height;
- enumrect->next = enumlist;
-
- enumlist = enumrect;
-
- return DFENUM_OK;
-}
-
-struct private_hwdata {
- IDirectFBSurface *surface;
- IDirectFBPalette *palette;
-};
-
-void SetDirectFBerror (const char *function, DFBResult code)
-{
- const char *error = DirectFBErrorString (code);
-
- if (error)
- SDL_SetError("%s: %s", function, error);
- else
- SDL_SetError("Unknown error code from %s", function);
-}
-
-static DFBSurfacePixelFormat SDLToDFBPixelFormat (SDL_PixelFormat *format)
-{
- if (format->Rmask && format->Gmask && format->Bmask)
- {
- switch (format->BitsPerPixel)
- {
- case 8:
- return DSPF_LUT8;
-
- case 16:
- if (format->Rmask == 0xF800 &&
- format->Gmask == 0x07E0 &&
- format->Bmask == 0x001F)
- return DSPF_RGB16;
- /* fall through */
-
- case 15:
- if (format->Rmask == 0x7C00 &&
- format->Gmask == 0x03E0 &&
- format->Bmask == 0x001F)
- return DSPF_ARGB1555;
- break;
-
- case 24:
- if (format->Rmask == 0xFF0000 &&
- format->Gmask == 0x00FF00 &&
- format->Bmask == 0x0000FF)
- return DSPF_RGB24;
- break;
-
- case 32:
- if (format->Rmask == 0xFF0000 &&
- format->Gmask == 0x00FF00 &&
- format->Bmask == 0x0000FF)
- {
- if (format->Amask == 0xFF000000)
- return DSPF_ARGB;
- else
- return DSPF_RGB32;
- }
- break;
- }
- }
- else
- {
- switch (format->BitsPerPixel)
- {
- case 8:
- return DSPF_LUT8;
- case 15:
- return DSPF_ARGB1555;
- case 16:
- return DSPF_RGB16;
- case 24:
- return DSPF_RGB24;
- case 32:
- return DSPF_RGB32;
- }
- }
-
- return DSPF_UNKNOWN;
-}
-
-static SDL_Palette *AllocatePalette(int size)
-{
- SDL_Palette *palette;
- SDL_Color *colors;
-
- palette = SDL_calloc (1, sizeof(SDL_Palette));
- if (!palette)
- {
- SDL_OutOfMemory();
- return NULL;
- }
-
- colors = SDL_calloc (size, sizeof(SDL_Color));
- if (!colors)
- {
- SDL_OutOfMemory();
- return NULL;
- }
-
- palette->ncolors = size;
- palette->colors = colors;
-
- return palette;
-}
-
-static int DFBToSDLPixelFormat (DFBSurfacePixelFormat pixelformat, SDL_PixelFormat *format)
-{
- format->Amask = format->Rmask = format->Gmask = format->Bmask = 0;
- format->BitsPerPixel = format->BytesPerPixel = 0;
-
- switch (pixelformat)
- {
- case DSPF_A8:
- format->Amask = 0x000000FF;
- break;
-
- case DSPF_ARGB1555:
- format->Rmask = 0x00007C00;
- format->Gmask = 0x000003E0;
- format->Bmask = 0x0000001F;
- break;
-
- case DSPF_RGB16:
- format->Rmask = 0x0000F800;
- format->Gmask = 0x000007E0;
- format->Bmask = 0x0000001F;
- break;
-
- case DSPF_ARGB:
- format->Amask = 0; /* apps don't seem to like that: 0xFF000000; */
- /* fall through */
- case DSPF_RGB24:
- case DSPF_RGB32:
- format->Rmask = 0x00FF0000;
- format->Gmask = 0x0000FF00;
- format->Bmask = 0x000000FF;
- break;
-
- case DSPF_LUT8:
- format->Rmask = 0x000000FF;
- format->Gmask = 0x000000FF;
- format->Bmask = 0x000000FF;
-
- if (!format->palette)
- format->palette = AllocatePalette(256);
- break;
-
- default:
- fprintf (stderr, "SDL_DirectFB: Unsupported pixelformat (0x%08x)!\n", pixelformat);
- return -1;
- }
-
- format->BitsPerPixel = DFB_BYTES_PER_PIXEL(pixelformat) * 8;
- format->BytesPerPixel = DFB_BYTES_PER_PIXEL(pixelformat);
-
- return 0;
-}
-
-
-int DirectFB_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- int i;
- DFBResult ret;
-#if (DIRECTFB_MAJOR_VERSION == 0) && (DIRECTFB_MINOR_VERSION == 9) && (DIRECTFB_MICRO_VERSION < 23)
- DFBCardCapabilities caps;
-#else
- DFBGraphicsDeviceDescription caps;
-#endif
- DFBDisplayLayerConfig dlc;
- struct DirectFBEnumRect *rect;
- IDirectFB *dfb = NULL;
- IDirectFBDisplayLayer *layer = NULL;
- IDirectFBEventBuffer *events = NULL;
-
- HIDDEN->c2layer = NULL, HIDDEN->c2frame = NULL;
- HIDDEN->enable_mga_crtc2 = 0;
- HIDDEN->mga_crtc2_stretch_overscan = 1;
-
- ret = DirectFBInit (NULL, NULL);
- if (ret)
- {
- SetDirectFBerror ("DirectFBInit", ret);
- goto error;
- }
-
- ret = DirectFBCreate (&dfb);
- if (ret)
- {
- SetDirectFBerror ("DirectFBCreate", ret);
- goto error;
- }
-
- ret = dfb->GetDisplayLayer (dfb, DLID_PRIMARY, &layer);
- if (ret)
- {
- SetDirectFBerror ("dfb->GetDisplayLayer", ret);
- goto error;
- }
-
- ret = dfb->CreateInputEventBuffer (dfb, DICAPS_ALL, DFB_FALSE, &events);
- if (ret)
- {
- SetDirectFBerror ("dfb->CreateEventBuffer", ret);
- goto error;
- }
-
- layer->EnableCursor (layer, 1);
-
- /* Query layer configuration to determine the current mode and pixelformat */
- layer->GetConfiguration (layer, &dlc);
-
- /* If current format is not supported use LUT8 as the default */
- if (DFBToSDLPixelFormat (dlc.pixelformat, vformat))
- DFBToSDLPixelFormat (DSPF_LUT8, vformat);
-
- /* Enumerate the available fullscreen modes */
- ret = dfb->EnumVideoModes (dfb, EnumModesCallback, this);
- if (ret)
- {
- SetDirectFBerror ("dfb->EnumVideoModes", ret);
- goto error;
- }
-
- HIDDEN->modelist = SDL_calloc (HIDDEN->nummodes + 1, sizeof(SDL_Rect *));
- if (!HIDDEN->modelist)
- {
- SDL_OutOfMemory();
- goto error;
- }
-
- for (i = 0, rect = enumlist; rect; ++i, rect = rect->next )
- {
- HIDDEN->modelist[i] = &rect->r;
- }
-
- HIDDEN->modelist[i] = NULL;
-
-
- /* Query card capabilities to get the video memory size */
-#if (DIRECTFB_MAJOR_VERSION == 0) && (DIRECTFB_MINOR_VERSION == 9) && (DIRECTFB_MICRO_VERSION < 23)
- dfb->GetCardCapabilities (dfb, &caps);
-#else
- dfb->GetDeviceDescription (dfb, &caps);
-#endif
-
- this->info.wm_available = 1;
- this->info.hw_available = 1;
- this->info.blit_hw = 1;
- this->info.blit_hw_CC = 1;
- this->info.blit_hw_A = 1;
- this->info.blit_fill = 1;
- this->info.video_mem = caps.video_memory / 1024;
- this->info.current_w = dlc.width;
- this->info.current_h = dlc.height;
-
- HIDDEN->initialized = 1;
- HIDDEN->dfb = dfb;
- HIDDEN->layer = layer;
- HIDDEN->eventbuffer = events;
-
- if (SDL_getenv("SDL_DIRECTFB_MGA_CRTC2") != NULL)
- HIDDEN->enable_mga_crtc2 = 1;
-
- if (HIDDEN->enable_mga_crtc2)
- {
- DFBDisplayLayerConfig dlc;
- DFBDisplayLayerConfigFlags failed;
-
- ret = dfb->GetDisplayLayer (dfb, 2, &HIDDEN->c2layer);
- if (ret)
- {
- SetDirectFBerror ("dfb->GetDisplayLayer(CRTC2)", ret);
- goto error;
- }
-
- ret = HIDDEN->layer->SetCooperativeLevel(HIDDEN->layer, DLSCL_EXCLUSIVE);
- if (ret)
- {
- SetDirectFBerror ("layer->SetCooperativeLevel(CRTC2, EXCLUSIVE)", ret);
- goto error;
- }
-
- ret = HIDDEN->c2layer->SetCooperativeLevel(HIDDEN->c2layer, DLSCL_EXCLUSIVE);
- if (ret)
- {
- SetDirectFBerror ("c2layer->SetCooperativeLevel(CRTC2, EXCLUSIVE)", ret);
- goto error;
- }
-
- HIDDEN->c2layer->SetOpacity(HIDDEN->c2layer, 0x0);
-
- /* Init the surface here as it got a fixed size */
- dlc.flags = DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE;
- dlc.buffermode = DLBM_BACKVIDEO;
- dlc.pixelformat = DSPF_RGB32;
-
- ret = HIDDEN->c2layer->TestConfiguration( HIDDEN->c2layer, &dlc, &failed );
- if (ret)
- {
- SetDirectFBerror ("c2layer->TestConfiguration", ret);
- goto error;
- }
-
- ret = HIDDEN->c2layer->SetConfiguration( HIDDEN->c2layer, &dlc );
- if (ret)
- {
- SetDirectFBerror ("c2layer->SetConfiguration", ret);
- goto error;
- }
-
- ret = HIDDEN->c2layer->GetSurface( HIDDEN->c2layer, &HIDDEN->c2frame );
- if (ret)
- {
- SetDirectFBerror ("c2layer->GetSurface", ret);
- goto error;
- }
-
- HIDDEN->c2framesize.x = 0;
- HIDDEN->c2framesize.y = 0;
- HIDDEN->c2frame->GetSize( HIDDEN->c2frame, &HIDDEN->c2framesize.w, &HIDDEN->c2framesize.h);
-
- HIDDEN->c2frame->SetBlittingFlags( HIDDEN->c2frame, DSBLIT_NOFX );
- HIDDEN->c2frame->SetColor( HIDDEN->c2frame, 0, 0, 0, 0xff );
-
- /* Clear CRTC2 */
- HIDDEN->c2frame->Clear(HIDDEN->c2frame, 0, 0, 0, 0xff );
- HIDDEN->c2frame->Flip(HIDDEN->c2frame, NULL, 0 );
- HIDDEN->c2frame->Clear(HIDDEN->c2frame, 0, 0, 0, 0xff );
- HIDDEN->c2frame->Flip(HIDDEN->c2frame, NULL, 0 );
- HIDDEN->c2frame->Clear(HIDDEN->c2frame, 0, 0, 0, 0xff );
-
- HIDDEN->c2layer->SetOpacity(HIDDEN->c2layer, 0xFF );
-
- /* Check if overscan is possibly set */
- if (SDL_getenv("SDL_DIRECTFB_MGA_OVERSCAN") != NULL)
- {
- float overscan = 0;
- if (SDL_sscanf(SDL_getenv("SDL_DIRECTFB_MGA_OVERSCAN"), "%f", &overscan) == 1)
- if (overscan > 0 && overscan < 2)
- HIDDEN->mga_crtc2_stretch_overscan = overscan;
- }
-
- #ifdef DIRECTFB_CRTC2_DEBUG
- printf("CRTC2 overscan: %f\n", HIDDEN->mga_crtc2_stretch_overscan);
- #endif
- }
-
- return 0;
-
- error:
- if (events)
- events->Release (events);
-
- if (HIDDEN->c2frame)
- HIDDEN->c2frame->Release (HIDDEN->c2frame);
-
- if (HIDDEN->c2layer)
- HIDDEN->c2layer->Release (HIDDEN->c2layer);
-
- if (layer)
- layer->Release (layer);
-
- if (dfb)
- dfb->Release (dfb);
-
- return -1;
-}
-
-static SDL_Rect **DirectFB_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- if (flags & SDL_FULLSCREEN)
- return HIDDEN->modelist;
- else
- if (SDLToDFBPixelFormat (format) != DSPF_UNKNOWN)
- return (SDL_Rect**) -1;
-
- return NULL;
-}
-
-static SDL_Surface *DirectFB_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags)
-{
- DFBResult ret;
- DFBSurfaceDescription dsc;
- DFBSurfacePixelFormat pixelformat;
- IDirectFBSurface *surface;
-
- fprintf (stderr, "SDL DirectFB_SetVideoMode: %dx%d@%d, flags: 0x%08x\n",
- width, height, bpp, flags);
-
- flags |= SDL_FULLSCREEN;
-
- /* Release previous primary surface */
- if (current->hwdata && current->hwdata->surface)
- {
- current->hwdata->surface->Release (current->hwdata->surface);
- current->hwdata->surface = NULL;
-
- /* And its palette if present */
- if (current->hwdata->palette)
- {
- current->hwdata->palette->Release (current->hwdata->palette);
- current->hwdata->palette = NULL;
- }
- }
- else if (!current->hwdata)
- {
- /* Allocate the hardware acceleration data */
- current->hwdata = (struct private_hwdata *) SDL_calloc (1, sizeof(*current->hwdata));
- if (!current->hwdata)
- {
- SDL_OutOfMemory();
- return NULL;
- }
- }
-
- /* Set cooperative level depending on flag SDL_FULLSCREEN */
- if (flags & SDL_FULLSCREEN)
- {
- ret = HIDDEN->dfb->SetCooperativeLevel (HIDDEN->dfb, DFSCL_FULLSCREEN);
- if (ret && !HIDDEN->enable_mga_crtc2)
- {
- DirectFBError ("dfb->SetCooperativeLevel", ret);
- flags &= ~SDL_FULLSCREEN;
- }
- }
- else
- HIDDEN->dfb->SetCooperativeLevel (HIDDEN->dfb, DFSCL_NORMAL);
-
- /* Set video mode */
- ret = HIDDEN->dfb->SetVideoMode (HIDDEN->dfb, width, height, bpp);
- if (ret)
- {
- if (flags & SDL_FULLSCREEN)
- {
- flags &= ~SDL_FULLSCREEN;
- HIDDEN->dfb->SetCooperativeLevel (HIDDEN->dfb, DFSCL_NORMAL);
- ret = HIDDEN->dfb->SetVideoMode (HIDDEN->dfb, width, height, bpp);
- }
-
- if (ret)
- {
- SetDirectFBerror ("dfb->SetVideoMode", ret);
- return NULL;
- }
- }
-
- /* Create primary surface */
- dsc.flags = DSDESC_CAPS | DSDESC_PIXELFORMAT;
- dsc.caps = DSCAPS_PRIMARY | ((flags & SDL_DOUBLEBUF) ? DSCAPS_FLIPPING : 0);
- dsc.pixelformat = GetFormatForBpp (bpp, HIDDEN->layer);
-
- ret = HIDDEN->dfb->CreateSurface (HIDDEN->dfb, &dsc, &surface);
- if (ret && (flags & SDL_DOUBLEBUF))
- {
- /* Try without double buffering */
- dsc.caps &= ~DSCAPS_FLIPPING;
- ret = HIDDEN->dfb->CreateSurface (HIDDEN->dfb, &dsc, &surface);
- }
- if (ret)
- {
- SetDirectFBerror ("dfb->CreateSurface", ret);
- return NULL;
- }
-
- current->w = width;
- current->h = height;
- current->flags = SDL_HWSURFACE | SDL_PREALLOC;
-
- if (flags & SDL_FULLSCREEN)
- {
- current->flags |= SDL_FULLSCREEN;
- this->UpdateRects = DirectFB_DirectUpdate;
- }
- else
- this->UpdateRects = DirectFB_WindowedUpdate;
-
- if (dsc.caps & DSCAPS_FLIPPING)
- current->flags |= SDL_DOUBLEBUF;
-
- surface->GetPixelFormat (surface, &pixelformat);
-
- DFBToSDLPixelFormat (pixelformat, current->format);
-
- /* Get the surface palette (if supported) */
- if (DFB_PIXELFORMAT_IS_INDEXED( pixelformat ))
- {
- surface->GetPalette (surface, &current->hwdata->palette);
-
- current->flags |= SDL_HWPALETTE;
- }
-
- current->hwdata->surface = surface;
-
- /* MGA CRTC2 stuff */
- if (HIDDEN->enable_mga_crtc2)
- {
- /* no stretching if c2ssize == c2framesize */
- HIDDEN->c2ssize.x = 0, HIDDEN->c2ssize.y = 0;
- HIDDEN->c2ssize.w = width;
- HIDDEN->c2ssize.h = height;
-
- HIDDEN->c2dsize.x = 0, HIDDEN->c2dsize.y = 0;
- HIDDEN->c2dsize.w = width;
- HIDDEN->c2dsize.h = height;
-
- HIDDEN->mga_crtc2_stretch = 0;
-
- if (SDL_getenv("SDL_DIRECTFB_MGA_STRETCH") != NULL)
- {
- /* Normally assume a picture aspect ratio of 4:3 */
- int zoom_aspect_x = 4, zoom_aspect_y = 3, i, j;
-
- for (i = 1; i < 20; i++)
- {
- for (j = 1; j < 10; j++)
- {
- if ((float)width/(float)i*(float)j == height)
- {
- zoom_aspect_x = i;
- zoom_aspect_y = j;
-
- /* break the loop */
- i = 21;
- break;
- }
- }
- }
-
- #ifdef DIRECTFB_CRTC2_DEBUG
- printf("Source resolution: X: %d, Y: %d, Aspect ratio: %d:%d\n", width, height, zoom_aspect_x, zoom_aspect_y);
- printf("CRTC2 resolution: X: %d, Y: %d\n", HIDDEN->c2framesize.w, HIDDEN->c2framesize.h);
- #endif
-
- /* don't stretch only slightly smaller/larger images */
- if ((float)width < (float)HIDDEN->c2framesize.w*0.95 || (float)height < (float)HIDDEN->c2framesize.h*0.95)
- {
- while ((float)HIDDEN->c2dsize.w < (float)HIDDEN->c2framesize.w*HIDDEN->mga_crtc2_stretch_overscan && (float)HIDDEN->c2dsize.h < (float)HIDDEN->c2framesize.h*HIDDEN->mga_crtc2_stretch_overscan)
- {
- HIDDEN->c2dsize.w+=zoom_aspect_x;
- HIDDEN->c2dsize.h+=zoom_aspect_y;
- }
-
- /* one step down */
- HIDDEN->c2dsize.w-=zoom_aspect_x;
- HIDDEN->c2dsize.h-=zoom_aspect_y;
-
- #ifdef DIRECTFB_CRTC2_DEBUG
- printf("Stretched resolution: X: %d, Y: %d\n", HIDDEN->c2dsize.w, HIDDEN->c2dsize.h);
- #endif
-
- HIDDEN->mga_crtc2_stretch = 1;
- }
- else if ((float)width > (float)HIDDEN->c2framesize.w*0.95 || (float)height > (float)HIDDEN->c2framesize.h*0.95)
- {
- while ((float)HIDDEN->c2dsize.w > (float)HIDDEN->c2framesize.w*HIDDEN->mga_crtc2_stretch_overscan || (float)HIDDEN->c2dsize.h > (float)HIDDEN->c2framesize.h*HIDDEN->mga_crtc2_stretch_overscan)
- {
- HIDDEN->c2dsize.w-=zoom_aspect_x;
- HIDDEN->c2dsize.h-=zoom_aspect_y;
- }
-
- #ifdef DIRECTFB_CRTC2_DEBUG
- printf("Down-Stretched resolution: X: %d, Y: %d\n", HIDDEN->c2dsize.w, HIDDEN->c2dsize.h);
- #endif
-
- HIDDEN->mga_crtc2_stretch = 1;
- } else {
- #ifdef DIRECTFB_CRTC2_DEBUG
- printf("Not stretching image\n");
- #endif
- }
-
- /* Panning */
- if (HIDDEN->c2framesize.w > HIDDEN->c2dsize.w)
- HIDDEN->c2dsize.x = (HIDDEN->c2framesize.w - HIDDEN->c2dsize.w) / 2;
- else
- HIDDEN->c2dsize.x = (HIDDEN->c2dsize.w - HIDDEN->c2framesize.w) / 2;
-
- if (HIDDEN->c2framesize.h > HIDDEN->c2dsize.h)
- HIDDEN->c2dsize.y = (HIDDEN->c2framesize.h - HIDDEN->c2dsize.h) / 2;
- else
- HIDDEN->c2dsize.y = (HIDDEN->c2dsize.h - HIDDEN->c2framesize.h) / 2;
-
- #ifdef DIRECTFB_CRTC2_DEBUG
- printf("CRTC2 position X: %d, Y: %d\n", HIDDEN->c2dsize.x, HIDDEN->c2dsize.y);
- #endif
- }
- }
-
- return current;
-}
-
-static int DirectFB_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- DFBResult ret;
- DFBSurfaceDescription dsc;
-
- /* fprintf(stderr, "SDL: DirectFB_AllocHWSurface (%dx%d@%d, flags: 0x%08x)\n",
- surface->w, surface->h, surface->format->BitsPerPixel, surface->flags);*/
-
- if (surface->w < 8 || surface->h < 8)
- return -1;
-
- /* fill surface description */
- dsc.flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_CAPS;
- dsc.width = surface->w;
- dsc.height = surface->h;
- dsc.caps = (surface->flags & SDL_DOUBLEBUF) ? DSCAPS_FLIPPING : 0;
-
- /* find the right pixelformat */
- dsc.pixelformat = SDLToDFBPixelFormat (surface->format);
- if (dsc.pixelformat == DSPF_UNKNOWN)
- return -1;
-
- /* Allocate the hardware acceleration data */
- surface->hwdata = (struct private_hwdata *) SDL_calloc (1, sizeof(*surface->hwdata));
- if (surface->hwdata == NULL)
- {
- SDL_OutOfMemory();
- return -1;
- }
-
- /* Create the surface */
- ret = HIDDEN->dfb->CreateSurface (HIDDEN->dfb, &dsc, &surface->hwdata->surface);
- if (ret)
- {
- SetDirectFBerror ("dfb->CreateSurface", ret);
- free (surface->hwdata);
- surface->hwdata = NULL;
- return -1;
- }
-
- surface->flags |= SDL_HWSURFACE | SDL_PREALLOC;
-
- return 0;
-}
-
-static void DirectFB_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- if (surface->hwdata && HIDDEN->initialized)
- {
- surface->hwdata->surface->Release (surface->hwdata->surface);
- free (surface->hwdata);
- surface->hwdata = NULL;
- }
-}
-
-static int DirectFB_CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst)
-{
- /* fprintf(stderr, "SDL: DirectFB_CheckHWBlit (src->hwdata: %p, dst->hwdata: %p)\n",
- src->hwdata, dst->hwdata);*/
-
- if (!src->hwdata || !dst->hwdata)
- return 0;
-
- src->flags |= SDL_HWACCEL;
- src->map->hw_blit = DirectFB_HWAccelBlit;
-
- return 1;
-}
-
-static int DirectFB_HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect)
-{
- DFBSurfaceBlittingFlags flags = DSBLIT_NOFX;
-
- DFBRectangle sr = { srcrect->x, srcrect->y, srcrect->w, srcrect->h };
- DFBRectangle dr = { dstrect->x, dstrect->y, dstrect->w, dstrect->h };
-
- IDirectFBSurface *surface = dst->hwdata->surface;
-
- if (src->flags & SDL_SRCCOLORKEY)
- {
- flags |= DSBLIT_SRC_COLORKEY;
- DirectFB_SetHWColorKey (NULL, src, src->format->colorkey);
- }
-
- if (src->flags & SDL_SRCALPHA)
- {
- flags |= DSBLIT_BLEND_COLORALPHA;
- surface->SetColor (surface, 0xff, 0xff, 0xff, src->format->alpha);
- }
-
- surface->SetBlittingFlags (surface, flags);
-
- if (sr.w == dr.w && sr.h == dr.h)
- surface->Blit (surface, src->hwdata->surface, &sr, dr.x, dr.y);
- else
- surface->StretchBlit (surface, src->hwdata->surface, &sr, &dr);
-
- return 0;
-}
-
-static int DirectFB_FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color)
-{
- SDL_PixelFormat *fmt = dst->format;
- IDirectFBSurface *surface = dst->hwdata->surface;
-
- /* ugly */
- surface->SetColor (surface,
- (color & fmt->Rmask) >> (fmt->Rshift - fmt->Rloss),
- (color & fmt->Gmask) >> (fmt->Gshift - fmt->Gloss),
- (color & fmt->Bmask) << (fmt->Bloss - fmt->Bshift), 0xFF);
- surface->FillRectangle (surface, dstrect->x, dstrect->y, dstrect->w, dstrect->h);
-
- return 0;
-}
-
-static int DirectFB_SetHWColorKey(_THIS, SDL_Surface *src, Uint32 key)
-{
- SDL_PixelFormat *fmt = src->format;
- IDirectFBSurface *surface = src->hwdata->surface;
-
- if (fmt->BitsPerPixel == 8)
- surface->SetSrcColorKeyIndex (surface, key);
- else
- /* ugly */
- surface->SetSrcColorKey (surface,
- (key & fmt->Rmask) >> (fmt->Rshift - fmt->Rloss),
- (key & fmt->Gmask) >> (fmt->Gshift - fmt->Gloss),
- (key & fmt->Bmask) << (fmt->Bloss - fmt->Bshift));
-
- return 0;
-}
-
-static int DirectFB_SetHWAlpha(_THIS, SDL_Surface *surface, Uint8 alpha)
-{
- return 0;
-}
-
-static int DirectFB_FlipHWSurface(_THIS, SDL_Surface *surface)
-{
- if (HIDDEN->enable_mga_crtc2)
- {
- int rtn = surface->hwdata->surface->Flip (surface->hwdata->surface, NULL, 0);
- if (HIDDEN->mga_crtc2_stretch)
- HIDDEN->c2frame->StretchBlit(HIDDEN->c2frame, surface->hwdata->surface, &HIDDEN->c2ssize, &HIDDEN->c2dsize);
- else
- HIDDEN->c2frame->Blit(HIDDEN->c2frame, surface->hwdata->surface, NULL, HIDDEN->c2dsize.x, HIDDEN->c2dsize.y);
-
- HIDDEN->c2frame->Flip(HIDDEN->c2frame, NULL, DSFLIP_WAITFORSYNC);
- return rtn;
- }
- else
- return surface->hwdata->surface->Flip (surface->hwdata->surface, NULL, DSFLIP_WAITFORSYNC);
-}
-
-static int DirectFB_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- DFBResult ret;
- void *data;
- int pitch;
-
- ret = surface->hwdata->surface->Lock (surface->hwdata->surface,
- DSLF_WRITE, &data, &pitch);
- if (ret)
- {
- SetDirectFBerror ("surface->Lock", ret);
- return -1;
- }
-
- surface->pixels = data;
- surface->pitch = pitch;
-
- return 0;
-}
-
-static void DirectFB_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- surface->hwdata->surface->Unlock (surface->hwdata->surface);
- surface->pixels = NULL;
-}
-
-static void DirectFB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- if (HIDDEN->enable_mga_crtc2)
- {
- if (HIDDEN->mga_crtc2_stretch)
- HIDDEN->c2frame->StretchBlit(HIDDEN->c2frame, this->screen->hwdata->surface, &HIDDEN->c2ssize, &HIDDEN->c2dsize);
- else
- HIDDEN->c2frame->Blit(HIDDEN->c2frame, this->screen->hwdata->surface, NULL, HIDDEN->c2dsize.x, HIDDEN->c2dsize.y);
-
- HIDDEN->c2frame->Flip(HIDDEN->c2frame, NULL, DSFLIP_WAITFORSYNC);
- }
-}
-
-static void DirectFB_WindowedUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- DFBRegion region;
- int i;
- int region_valid = 0;
- IDirectFBSurface *surface = this->screen->hwdata->surface;
-
- for (i=0; i<numrects; ++i)
- {
- int x2, y2;
-
- if ( ! rects[i].w ) /* Clipped? */
- continue;
-
- x2 = rects[i].x + rects[i].w - 1;
- y2 = rects[i].y + rects[i].h - 1;
-
- if (region_valid)
- {
- if (rects[i].x < region.x1)
- region.x1 = rects[i].x;
-
- if (rects[i].y < region.y1)
- region.y1 = rects[i].y;
-
- if (x2 > region.x2)
- region.x2 = x2;
-
- if (y2 > region.y2)
- region.y2 = y2;
- }
- else
- {
- region.x1 = rects[i].x;
- region.y1 = rects[i].y;
- region.x2 = x2;
- region.y2 = y2;
-
- region_valid = 1;
- }
- }
-
- if (region_valid)
- {
- if (HIDDEN->enable_mga_crtc2)
- {
- if (HIDDEN->mga_crtc2_stretch)
- HIDDEN->c2frame->StretchBlit(HIDDEN->c2frame, surface, &HIDDEN->c2ssize, &HIDDEN->c2dsize);
- else
- HIDDEN->c2frame->Blit(HIDDEN->c2frame, surface, NULL, HIDDEN->c2dsize.x, HIDDEN->c2dsize.y);
-
- HIDDEN->c2frame->Flip(HIDDEN->c2frame, NULL, DSFLIP_WAITFORSYNC);
- }
- else
- surface->Flip (surface, &region, DSFLIP_WAITFORSYNC);
- }
-}
-
-int DirectFB_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- IDirectFBPalette *palette = this->screen->hwdata->palette;
-
- if (!palette)
- return 0;
-
- if (firstcolor > 255)
- return 0;
-
- if (firstcolor + ncolors > 256)
- ncolors = 256 - firstcolor;
-
- if (ncolors > 0)
- {
- int i;
- DFBColor entries[ncolors];
-
- for (i=0; i<ncolors; i++)
- {
- entries[i].a = 0xff;
- entries[i].r = colors[i].r;
- entries[i].g = colors[i].g;
- entries[i].b = colors[i].b;
- }
-
- palette->SetEntries (palette, entries, ncolors, firstcolor);
- }
-
- return 1;
-}
-
-void DirectFB_VideoQuit(_THIS)
-{
- struct DirectFBEnumRect *rect = enumlist;
-
- if (this->screen && this->screen->hwdata)
- {
- IDirectFBSurface *surface = this->screen->hwdata->surface;
- IDirectFBPalette *palette = this->screen->hwdata->palette;
-
- if (palette)
- palette->Release (palette);
-
- if (surface)
- surface->Release (surface);
-
- this->screen->hwdata->surface = NULL;
- this->screen->hwdata->palette = NULL;
- }
-
- if (HIDDEN->c2frame)
- {
- HIDDEN->c2frame->Release (HIDDEN->c2frame);
- HIDDEN->c2frame = NULL;
- }
-
- if (HIDDEN->eventbuffer)
- {
- HIDDEN->eventbuffer->Release (HIDDEN->eventbuffer);
- HIDDEN->eventbuffer = NULL;
- }
-
- if (HIDDEN->c2layer)
- {
- HIDDEN->c2layer->Release (HIDDEN->c2layer);
- HIDDEN->c2layer = NULL;
- }
-
- if (HIDDEN->layer)
- {
- HIDDEN->layer->Release (HIDDEN->layer);
- HIDDEN->layer = NULL;
- }
-
- if (HIDDEN->dfb)
- {
- HIDDEN->dfb->Release (HIDDEN->dfb);
- HIDDEN->dfb = NULL;
- }
-
- /* Free video mode list */
- if (HIDDEN->modelist)
- {
- free (HIDDEN->modelist);
- HIDDEN->modelist = NULL;
- }
-
- /* Free mode enumeration list */
- while (rect)
- {
- struct DirectFBEnumRect *next = rect->next;
- free (rect);
- rect = next;
- }
- enumlist = NULL;
-
- HIDDEN->initialized = 0;
-}
-
-
-int DirectFB_ShowWMCursor(_THIS, WMcursor *cursor)
-{
- /* We can only hide or show the default cursor */
- if ( cursor == NULL )
- {
- HIDDEN->layer->SetCursorOpacity(HIDDEN->layer, 0x00);
- }
- else
- {
- HIDDEN->layer->SetCursorOpacity(HIDDEN->layer, 0xFF);
- }
- return 1;
-}
-
-void DirectFB_FinalQuit(void)
-{
-}
diff --git a/distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_video.h b/distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_video.h
deleted file mode 100644
index fd92b28..0000000
--- a/distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_video.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_DirectFB_video_h
-#define _SDL_DirectFB_video_h
-
-#include <directfb.h>
-
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-
-#define _THIS SDL_VideoDevice *this
-
-/* Private display data */
-
-struct SDL_PrivateVideoData
-{
- int initialized;
-
- IDirectFB *dfb;
- IDirectFBDisplayLayer *layer;
- IDirectFBEventBuffer *eventbuffer;
-
- int nummodes;
- SDL_Rect **modelist;
-
- /* MGA CRTC2 support */
- int enable_mga_crtc2;
- int mga_crtc2_stretch;
- float mga_crtc2_stretch_overscan;
- IDirectFBDisplayLayer *c2layer;
- IDirectFBSurface *c2frame;
- DFBRectangle c2ssize; /* Real screen size */
- DFBRectangle c2dsize; /* Stretched screen size */
- DFBRectangle c2framesize; /* CRTC2 screen size */
-};
-
-#define HIDDEN (this->hidden)
-
-void SetDirectFBerror (const char *function, DFBResult code);
-
-#endif /* _SDL_DirectFB_video_h */
diff --git a/distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_yuv.c b/distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_yuv.c
deleted file mode 100644
index 6366254..0000000
--- a/distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_yuv.c
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This is the DirectFB implementation of YUV video overlays */
-
-#include "SDL_video.h"
-#include "SDL_DirectFB_yuv.h"
-#include "../SDL_yuvfuncs.h"
-
-
-/* The functions used to manipulate software video overlays */
-static struct private_yuvhwfuncs directfb_yuvfuncs = {
- DirectFB_LockYUVOverlay,
- DirectFB_UnlockYUVOverlay,
- DirectFB_DisplayYUVOverlay,
- DirectFB_FreeYUVOverlay
-};
-
-struct private_yuvhwdata {
- DFBDisplayLayerID layer_id;
-
- IDirectFBDisplayLayer *layer;
- IDirectFBSurface *surface;
-
- /* These are just so we don't have to allocate them separately */
- Uint16 pitches[3];
- Uint8 *planes[3];
-};
-
-static DFBEnumerationResult
-enum_layers_callback( DFBDisplayLayerID id,
- DFBDisplayLayerDescription desc,
- void *data )
-{
- struct private_yuvhwdata *hwdata = (struct private_yuvhwdata *) data;
-
- /* we don't want the primary */
- if (id == DLID_PRIMARY)
- return DFENUM_OK;
-
- /* take the one with a surface for video */
- if ((desc.caps & DLCAPS_SURFACE) && (desc.type & DLTF_VIDEO))
- {
- hwdata->layer_id = id;
-
- return DFENUM_CANCEL;
- }
-
- return DFENUM_OK;
-}
-
-
-static DFBResult CreateYUVSurface(_THIS, struct private_yuvhwdata *hwdata,
- int width, int height, Uint32 format)
-{
- DFBResult ret;
- IDirectFB *dfb = HIDDEN->dfb;
- IDirectFBDisplayLayer *layer;
- DFBDisplayLayerConfig conf;
-
- ret = dfb->EnumDisplayLayers (dfb, enum_layers_callback, hwdata);
- if (ret)
- {
- SetDirectFBerror("IDirectFB::EnumDisplayLayers", ret);
- return ret;
- }
-
- if (!hwdata->layer_id)
- return DFB_UNSUPPORTED;
-
- ret = dfb->GetDisplayLayer (dfb, hwdata->layer_id, &layer);
- if (ret)
- {
- SetDirectFBerror("IDirectFB::GetDisplayLayer", ret);
- return ret;
- }
-
- conf.flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT;
- conf.width = width;
- conf.height = height;
-
- switch (format)
- {
- case SDL_YV12_OVERLAY:
- conf.pixelformat = DSPF_YV12;
- break;
- case SDL_IYUV_OVERLAY:
- conf.pixelformat = DSPF_I420;
- break;
- case SDL_YUY2_OVERLAY:
- conf.pixelformat = DSPF_YUY2;
- break;
- case SDL_UYVY_OVERLAY:
- conf.pixelformat = DSPF_UYVY;
- break;
- default:
- fprintf (stderr, "SDL_DirectFB: Unsupported YUV format (0x%08x)!\n", format);
- break;
- }
-
- /* Need to set coop level or newer DirectFB versions will fail here. */
- ret = layer->SetCooperativeLevel (layer, DLSCL_ADMINISTRATIVE);
- if (ret)
- {
- SetDirectFBerror("IDirectFBDisplayLayer::SetCooperativeLevel() failed", ret);
- layer->Release (layer);
- return ret;
- }
-
- ret = layer->SetConfiguration (layer, &conf);
- if (ret)
- {
- SetDirectFBerror("IDirectFBDisplayLayer::SetConfiguration", ret);
- layer->Release (layer);
- return ret;
- }
-
- ret = layer->GetSurface (layer, &hwdata->surface);
- if (ret)
- {
- SetDirectFBerror("IDirectFBDisplayLayer::GetSurface", ret);
- layer->Release (layer);
- return ret;
- }
-
- hwdata->layer = layer;
-
- return DFB_OK;
-}
-
-SDL_Overlay *DirectFB_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display)
-{
- SDL_Overlay *overlay;
- struct private_yuvhwdata *hwdata;
-
- /* Create the overlay structure */
- overlay = SDL_calloc (1, sizeof(SDL_Overlay));
- if (!overlay)
- {
- SDL_OutOfMemory();
- return NULL;
- }
-
- /* Fill in the basic members */
- overlay->format = format;
- overlay->w = width;
- overlay->h = height;
-
- /* Set up the YUV surface function structure */
- overlay->hwfuncs = &directfb_yuvfuncs;
-
- /* Create the pixel data and lookup tables */
- hwdata = SDL_calloc(1, sizeof(struct private_yuvhwdata));
- overlay->hwdata = hwdata;
- if (!hwdata)
- {
- SDL_OutOfMemory();
- SDL_FreeYUVOverlay (overlay);
- return NULL;
- }
-
- if (CreateYUVSurface (this, hwdata, width, height, format))
- {
- SDL_FreeYUVOverlay (overlay);
- return NULL;
- }
-
- overlay->hw_overlay = 1;
-
- /* Set up the plane pointers */
- overlay->pitches = hwdata->pitches;
- overlay->pixels = hwdata->planes;
- switch (format)
- {
- case SDL_YV12_OVERLAY:
- case SDL_IYUV_OVERLAY:
- overlay->planes = 3;
- break;
- default:
- overlay->planes = 1;
- break;
- }
-
- /* We're all done.. */
- return overlay;
-}
-
-int DirectFB_LockYUVOverlay(_THIS, SDL_Overlay *overlay)
-{
- DFBResult ret;
- void *data;
- int pitch;
- IDirectFBSurface *surface = overlay->hwdata->surface;
-
- ret = surface->Lock (surface, DSLF_READ | DSLF_WRITE, &data, &pitch);
- if (ret)
- {
- SetDirectFBerror("IDirectFBSurface::Lock", ret);
- return -1;
- }
-
- /* Find the pitch and offset values for the overlay */
- overlay->pitches[0] = (Uint16) pitch;
- overlay->pixels[0] = (Uint8*) data;
-
- switch (overlay->format)
- {
- case SDL_YV12_OVERLAY:
- case SDL_IYUV_OVERLAY:
- /* Add the two extra planes */
- overlay->pitches[1] = overlay->pitches[0] / 2;
- overlay->pitches[2] = overlay->pitches[0] / 2;
- overlay->pixels[1] = overlay->pixels[0] + overlay->pitches[0] * overlay->h;
- overlay->pixels[2] = overlay->pixels[1] + overlay->pitches[1] * overlay->h / 2;
- break;
- default:
- /* Only one plane, no worries */
- break;
- }
-
- return 0;
-}
-
-void DirectFB_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay)
-{
- IDirectFBSurface *surface = overlay->hwdata->surface;
-
- overlay->pixels[0] = overlay->pixels[1] = overlay->pixels[2] = NULL;
-
- surface->Unlock (surface);
-}
-
-int DirectFB_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst)
-{
- DFBResult ret;
- DFBDisplayLayerConfig conf;
- IDirectFBDisplayLayer *primary = HIDDEN->layer;
- IDirectFBDisplayLayer *layer = overlay->hwdata->layer;
-
- primary->GetConfiguration (primary, &conf);
-
- ret = layer->SetScreenLocation (layer,
- dst->x / (float) conf.width, dst->y / (float) conf.height,
- dst->w / (float) conf.width, dst->h / (float) conf.height );
- if (ret)
- {
- SetDirectFBerror("IDirectFBDisplayLayer::SetScreenLocation", ret);
- return -1;
- }
-
- return 0;
-}
-
-void DirectFB_FreeYUVOverlay(_THIS, SDL_Overlay *overlay)
-{
- struct private_yuvhwdata *hwdata;
-
- hwdata = overlay->hwdata;
- if (hwdata)
- {
- if (hwdata->surface)
- hwdata->surface->Release (hwdata->surface);
-
- if (hwdata->layer)
- hwdata->layer->Release (hwdata->layer);
-
- free (hwdata);
- }
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_yuv.h b/distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_yuv.h
deleted file mode 100644
index 23a42dc..0000000
--- a/distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_yuv.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This is the DirectFB implementation of YUV video overlays */
-
-#include "SDL_video.h"
-#include "SDL_DirectFB_video.h"
-
-extern SDL_Overlay *DirectFB_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display);
-
-extern int DirectFB_LockYUVOverlay(_THIS, SDL_Overlay *overlay);
-
-extern void DirectFB_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay);
-
-extern int DirectFB_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst);
-
-extern void DirectFB_FreeYUVOverlay(_THIS, SDL_Overlay *overlay);
-
diff --git a/distrib/sdl-1.2.12/src/video/dummy/SDL_nullevents.c b/distrib/sdl-1.2.12/src/video/dummy/SDL_nullevents.c
deleted file mode 100644
index 099475f..0000000
--- a/distrib/sdl-1.2.12/src/video/dummy/SDL_nullevents.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Being a null driver, there's no event stream. We just define stubs for
- most of the API. */
-
-#include "SDL.h"
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_nullvideo.h"
-#include "SDL_nullevents_c.h"
-
-void DUMMY_PumpEvents(_THIS)
-{
- /* do nothing. */
-}
-
-void DUMMY_InitOSKeymap(_THIS)
-{
- /* do nothing. */
-}
-
-/* end of SDL_nullevents.c ... */
-
diff --git a/distrib/sdl-1.2.12/src/video/dummy/SDL_nullevents_c.h b/distrib/sdl-1.2.12/src/video/dummy/SDL_nullevents_c.h
deleted file mode 100644
index 674c336..0000000
--- a/distrib/sdl-1.2.12/src/video/dummy/SDL_nullevents_c.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_nullvideo.h"
-
-/* Variables and functions exported by SDL_sysevents.c to other parts
- of the native video subsystem (SDL_sysvideo.c)
-*/
-extern void DUMMY_InitOSKeymap(_THIS);
-extern void DUMMY_PumpEvents(_THIS);
-
-/* end of SDL_nullevents_c.h ... */
-
diff --git a/distrib/sdl-1.2.12/src/video/dummy/SDL_nullmouse.c b/distrib/sdl-1.2.12/src/video/dummy/SDL_nullmouse.c
deleted file mode 100644
index 19b51a7..0000000
--- a/distrib/sdl-1.2.12/src/video/dummy/SDL_nullmouse.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_mouse.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_nullmouse_c.h"
-
-
-/* The implementation dependent data for the window manager cursor */
-struct WMcursor {
- int unused;
-};
diff --git a/distrib/sdl-1.2.12/src/video/dummy/SDL_nullmouse_c.h b/distrib/sdl-1.2.12/src/video/dummy/SDL_nullmouse_c.h
deleted file mode 100644
index 2770e67..0000000
--- a/distrib/sdl-1.2.12/src/video/dummy/SDL_nullmouse_c.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_nullvideo.h"
-
-/* Functions to be exported */
diff --git a/distrib/sdl-1.2.12/src/video/dummy/SDL_nullvideo.c b/distrib/sdl-1.2.12/src/video/dummy/SDL_nullvideo.c
deleted file mode 100644
index fe6fab6..0000000
--- a/distrib/sdl-1.2.12/src/video/dummy/SDL_nullvideo.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Dummy SDL video driver implementation; this is just enough to make an
- * SDL-based application THINK it's got a working video driver, for
- * applications that call SDL_Init(SDL_INIT_VIDEO) when they don't need it,
- * and also for use as a collection of stubs when porting SDL to a new
- * platform for which you haven't yet written a valid video driver.
- *
- * This is also a great way to determine bottlenecks: if you think that SDL
- * is a performance problem for a given platform, enable this driver, and
- * then see if your application runs faster without video overhead.
- *
- * Initial work by Ryan C. Gordon (icculus@icculus.org). A good portion
- * of this was cut-and-pasted from Stephane Peter's work in the AAlib
- * SDL video driver. Renamed to "DUMMY" by Sam Lantinga.
- */
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_nullvideo.h"
-#include "SDL_nullevents_c.h"
-#include "SDL_nullmouse_c.h"
-
-#define DUMMYVID_DRIVER_NAME "dummy"
-
-/* Initialization/Query functions */
-static int DUMMY_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **DUMMY_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *DUMMY_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int DUMMY_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
-static void DUMMY_VideoQuit(_THIS);
-
-/* Hardware surface functions */
-static int DUMMY_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int DUMMY_LockHWSurface(_THIS, SDL_Surface *surface);
-static void DUMMY_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static void DUMMY_FreeHWSurface(_THIS, SDL_Surface *surface);
-
-/* etc. */
-static void DUMMY_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
-
-/* DUMMY driver bootstrap functions */
-
-static int DUMMY_Available(void)
-{
- const char *envr = SDL_getenv("SDL_VIDEODRIVER");
- if ((envr) && (SDL_strcmp(envr, DUMMYVID_DRIVER_NAME) == 0)) {
- return(1);
- }
-
- return(0);
-}
-
-static void DUMMY_DeleteDevice(SDL_VideoDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_VideoDevice *DUMMY_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device ) {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *device->hidden));
- }
- if ( (device == NULL) || (device->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( device ) {
- SDL_free(device);
- }
- return(0);
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
-
- /* Set the function pointers */
- device->VideoInit = DUMMY_VideoInit;
- device->ListModes = DUMMY_ListModes;
- device->SetVideoMode = DUMMY_SetVideoMode;
- device->CreateYUVOverlay = NULL;
- device->SetColors = DUMMY_SetColors;
- device->UpdateRects = DUMMY_UpdateRects;
- device->VideoQuit = DUMMY_VideoQuit;
- device->AllocHWSurface = DUMMY_AllocHWSurface;
- device->CheckHWBlit = NULL;
- device->FillHWRect = NULL;
- device->SetHWColorKey = NULL;
- device->SetHWAlpha = NULL;
- device->LockHWSurface = DUMMY_LockHWSurface;
- device->UnlockHWSurface = DUMMY_UnlockHWSurface;
- device->FlipHWSurface = NULL;
- device->FreeHWSurface = DUMMY_FreeHWSurface;
- device->SetCaption = NULL;
- device->SetIcon = NULL;
- device->IconifyWindow = NULL;
- device->GrabInput = NULL;
- device->GetWMInfo = NULL;
- device->InitOSKeymap = DUMMY_InitOSKeymap;
- device->PumpEvents = DUMMY_PumpEvents;
-
- device->free = DUMMY_DeleteDevice;
-
- return device;
-}
-
-VideoBootStrap DUMMY_bootstrap = {
- DUMMYVID_DRIVER_NAME, "SDL dummy video driver",
- DUMMY_Available, DUMMY_CreateDevice
-};
-
-
-int DUMMY_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- /*
- fprintf(stderr, "WARNING: You are using the SDL dummy video driver!\n");
- */
-
- /* Determine the screen depth (use default 8-bit depth) */
- /* we change this during the SDL_SetVideoMode implementation... */
- vformat->BitsPerPixel = 8;
- vformat->BytesPerPixel = 1;
-
- /* We're done! */
- return(0);
-}
-
-SDL_Rect **DUMMY_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- return (SDL_Rect **) -1;
-}
-
-SDL_Surface *DUMMY_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- if ( this->hidden->buffer ) {
- SDL_free( this->hidden->buffer );
- }
-
- this->hidden->buffer = SDL_malloc(width * height * (bpp / 8));
- if ( ! this->hidden->buffer ) {
- SDL_SetError("Couldn't allocate buffer for requested mode");
- return(NULL);
- }
-
-/* printf("Setting mode %dx%d\n", width, height); */
-
- SDL_memset(this->hidden->buffer, 0, width * height * (bpp / 8));
-
- /* Allocate the new pixel format for the screen */
- if ( ! SDL_ReallocFormat(current, bpp, 0, 0, 0, 0) ) {
- SDL_free(this->hidden->buffer);
- this->hidden->buffer = NULL;
- SDL_SetError("Couldn't allocate new pixel format for requested mode");
- return(NULL);
- }
-
- /* Set up the new mode framebuffer */
- current->flags = flags & SDL_FULLSCREEN;
- this->hidden->w = current->w = width;
- this->hidden->h = current->h = height;
- current->pitch = current->w * (bpp / 8);
- current->pixels = this->hidden->buffer;
-
- /* We're done */
- return(current);
-}
-
-/* We don't actually allow hardware surfaces other than the main one */
-static int DUMMY_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- return(-1);
-}
-static void DUMMY_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-/* We need to wait for vertical retrace on page flipped displays */
-static int DUMMY_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- return(0);
-}
-
-static void DUMMY_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-static void DUMMY_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
-{
- /* do nothing. */
-}
-
-int DUMMY_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- /* do nothing of note. */
- return(1);
-}
-
-/* Note: If we are terminated, this could be called in the middle of
- another SDL video routine -- notably UpdateRects.
-*/
-void DUMMY_VideoQuit(_THIS)
-{
- if (this->screen->pixels != NULL)
- {
- SDL_free(this->screen->pixels);
- this->screen->pixels = NULL;
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/dummy/SDL_nullvideo.h b/distrib/sdl-1.2.12/src/video/dummy/SDL_nullvideo.h
deleted file mode 100644
index a615ff4..0000000
--- a/distrib/sdl-1.2.12/src/video/dummy/SDL_nullvideo.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_nullvideo_h
-#define _SDL_nullvideo_h
-
-#include "../SDL_sysvideo.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-
-/* Private display data */
-
-struct SDL_PrivateVideoData {
- int w, h;
- void *buffer;
-};
-
-#endif /* _SDL_nullvideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/epoc/SDL_epocevents.cpp b/distrib/sdl-1.2.12/src/video/epoc/SDL_epocevents.cpp
deleted file mode 100644
index f0e6945..0000000
--- a/distrib/sdl-1.2.12/src/video/epoc/SDL_epocevents.cpp
+++ /dev/null
@@ -1,419 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- SDL_epocevents.cpp
- Handle the event stream, converting Epoc events into SDL events
-
- Epoc version by Hannu Viitala (hannu.j.viitala@mbnet.fi)
-*/
-
-
-#include <stdio.h>
-#undef NULL
-
-extern "C" {
-#include "SDL_error.h"
-#include "SDL_video.h"
-#include "SDL_keysym.h"
-#include "SDL_keyboard.h"
-#include "SDL_timer.h"
-#include "../../events/SDL_events_c.h"
-}; /* extern "C" */
-
-#include "SDL_epocvideo.h"
-#include "SDL_epocevents_c.h"
-
-#include <hal.h>
-
-extern "C" {
-/* The translation tables from a console scancode to a SDL keysym */
-static SDLKey keymap[MAX_SCANCODE];
-static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym);
-}; /* extern "C" */
-
-TBool isCursorVisible = ETrue;
-
-int EPOC_HandleWsEvent(_THIS, const TWsEvent& aWsEvent)
-{
- int posted = 0;
- SDL_keysym keysym;
-
-
- switch (aWsEvent.Type()) {
-
- case EEventPointer: /* Mouse pointer events */
- {
- const TPointerEvent* pointerEvent = aWsEvent.Pointer();
- TPoint mousePos = pointerEvent->iPosition;
-
- //SDL_TRACE1("SDL: EPOC_HandleWsEvent, pointerEvent->iType=%d", pointerEvent->iType); //!!
-
- if (Private->EPOC_ShrinkedHeight) {
- mousePos.iY <<= 1; /* Scale y coordinate to shrinked screen height */
- }
- posted += SDL_PrivateMouseMotion(0, 0, mousePos.iX, mousePos.iY); /* Absolute position on screen */
- if (pointerEvent->iType==TPointerEvent::EButton1Down) {
- posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_LEFT, 0, 0);
- }
- else if (pointerEvent->iType==TPointerEvent::EButton1Up) {
- posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_LEFT, 0, 0);
- }
- else if (pointerEvent->iType==TPointerEvent::EButton2Down) {
- posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_RIGHT, 0, 0);
- }
- else if (pointerEvent->iType==TPointerEvent::EButton2Up) {
- posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_RIGHT, 0, 0);
- }
- //!!posted += SDL_PrivateKeyboard(SDL_PRESSED, TranslateKey(aWsEvent.Key()->iScanCode, &keysym));
- break;
- }
-
- case EEventKeyDown: /* Key events */
- {
- (void*)TranslateKey(aWsEvent.Key()->iScanCode, &keysym);
-
- /* Special handling */
- switch((int)keysym.sym) {
- case SDLK_CAPSLOCK:
- if (!isCursorVisible) {
- /* Enable virtual cursor */
- HAL::Set(HAL::EMouseState, HAL::EMouseState_Visible);
- }
- else {
- /* Disable virtual cursor */
- HAL::Set(HAL::EMouseState, HAL::EMouseState_Invisible);
- }
- isCursorVisible = !isCursorVisible;
- break;
- }
-
- posted += SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
- break;
- }
-
- case EEventKeyUp: /* Key events */
- {
- posted += SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(aWsEvent.Key()->iScanCode, &keysym));
- break;
- }
-
- case EEventFocusGained: /* SDL window got focus */
- {
- //Private->EPOC_IsWindowFocused = ETrue;
- /* Draw window background and screen buffer */
- RedrawWindowL(_this);
- break;
- }
-
- case EEventFocusLost: /* SDL window lost focus */
- {
- //Private->EPOC_IsWindowFocused = EFalse;
-
- // Wait and eat events until focus is gained again
- /*
- while (ETrue) {
- Private->EPOC_WsSession.EventReady(&Private->EPOC_WsEventStatus);
- User::WaitForRequest(Private->EPOC_WsEventStatus);
- Private->EPOC_WsSession.GetEvent(Private->EPOC_WsEvent);
- TInt eventType = Private->EPOC_WsEvent.Type();
- Private->EPOC_WsEventStatus = KRequestPending;
- //Private->EPOC_WsSession.EventReady(&Private->EPOC_WsEventStatus);
- if (eventType == EEventFocusGained) {
- RedrawWindowL(_this);
- break;
- }
- }
- */
- break;
- }
-
- case EEventModifiersChanged:
- {
- TModifiersChangedEvent* modEvent = aWsEvent.ModifiersChanged();
- TUint modstate = KMOD_NONE;
- if (modEvent->iModifiers == EModifierLeftShift)
- modstate |= KMOD_LSHIFT;
- if (modEvent->iModifiers == EModifierRightShift)
- modstate |= KMOD_RSHIFT;
- if (modEvent->iModifiers == EModifierLeftCtrl)
- modstate |= KMOD_LCTRL;
- if (modEvent->iModifiers == EModifierRightCtrl)
- modstate |= KMOD_RCTRL;
- if (modEvent->iModifiers == EModifierLeftAlt)
- modstate |= KMOD_LALT;
- if (modEvent->iModifiers == EModifierRightAlt)
- modstate |= KMOD_RALT;
- if (modEvent->iModifiers == EModifierLeftFunc)
- modstate |= KMOD_LMETA;
- if (modEvent->iModifiers == EModifierRightFunc)
- modstate |= KMOD_RMETA;
- if (modEvent->iModifiers == EModifierCapsLock)
- modstate |= KMOD_CAPS;
- SDL_SetModState(STATIC_CAST(SDLMod,(modstate | KMOD_LSHIFT)));
- break;
- }
- default:
- break;
- }
-
- return posted;
-}
-
-extern "C" {
-
-void EPOC_PumpEvents(_THIS)
-{
- int posted = 0; // !! Do we need this?
- //Private->EPOC_WsSession.EventReady(&Private->EPOC_WsEventStatus);
- while (Private->EPOC_WsEventStatus != KRequestPending) {
-
- Private->EPOC_WsSession.GetEvent(Private->EPOC_WsEvent);
- posted = EPOC_HandleWsEvent(_this, Private->EPOC_WsEvent);
- Private->EPOC_WsEventStatus = KRequestPending;
- Private->EPOC_WsSession.EventReady(&Private->EPOC_WsEventStatus);
- }
-}
-
-
-void EPOC_InitOSKeymap(_THIS)
-{
- int i;
-
- /* Initialize the key translation table */
- for ( i=0; i<SDL_TABLESIZE(keymap); ++i )
- keymap[i] = SDLK_UNKNOWN;
-
-
- /* Numbers */
- for ( i = 0; i<32; ++i ){
- keymap[' ' + i] = (SDLKey)(SDLK_SPACE+i);
- }
- /* e.g. Alphabet keys */
- for ( i = 0; i<32; ++i ){
- keymap['A' + i] = (SDLKey)(SDLK_a+i);
- }
-
- keymap[EStdKeyBackspace] = SDLK_BACKSPACE;
- keymap[EStdKeyTab] = SDLK_TAB;
- keymap[EStdKeyEnter] = SDLK_RETURN;
- keymap[EStdKeyEscape] = SDLK_ESCAPE;
- keymap[EStdKeySpace] = SDLK_SPACE;
- keymap[EStdKeyPause] = SDLK_PAUSE;
- keymap[EStdKeyHome] = SDLK_HOME;
- keymap[EStdKeyEnd] = SDLK_END;
- keymap[EStdKeyPageUp] = SDLK_PAGEUP;
- keymap[EStdKeyPageDown] = SDLK_PAGEDOWN;
- keymap[EStdKeyDelete] = SDLK_DELETE;
- keymap[EStdKeyUpArrow] = SDLK_UP;
- keymap[EStdKeyDownArrow] = SDLK_DOWN;
- keymap[EStdKeyLeftArrow] = SDLK_LEFT;
- keymap[EStdKeyRightArrow] = SDLK_RIGHT;
- keymap[EStdKeyCapsLock] = SDLK_CAPSLOCK;
- keymap[EStdKeyLeftShift] = SDLK_LSHIFT;
- keymap[EStdKeyRightShift] = SDLK_RSHIFT;
- keymap[EStdKeyLeftAlt] = SDLK_LALT;
- keymap[EStdKeyRightAlt] = SDLK_RALT;
- keymap[EStdKeyLeftCtrl] = SDLK_LCTRL;
- keymap[EStdKeyRightCtrl] = SDLK_RCTRL;
- keymap[EStdKeyLeftFunc] = SDLK_LMETA;
- keymap[EStdKeyRightFunc] = SDLK_RMETA;
- keymap[EStdKeyInsert] = SDLK_INSERT;
- keymap[EStdKeyComma] = SDLK_COMMA;
- keymap[EStdKeyFullStop] = SDLK_PERIOD;
- keymap[EStdKeyForwardSlash] = SDLK_SLASH;
- keymap[EStdKeyBackSlash] = SDLK_BACKSLASH;
- keymap[EStdKeySemiColon] = SDLK_SEMICOLON;
- keymap[EStdKeySingleQuote] = SDLK_QUOTE;
- keymap[EStdKeyHash] = SDLK_HASH;
- keymap[EStdKeySquareBracketLeft] = SDLK_LEFTBRACKET;
- keymap[EStdKeySquareBracketRight] = SDLK_RIGHTBRACKET;
- keymap[EStdKeyMinus] = SDLK_MINUS;
- keymap[EStdKeyEquals] = SDLK_EQUALS;
-
- keymap[EStdKeyF1] = SDLK_F1; /* chr + q */
- keymap[EStdKeyF2] = SDLK_F2; /* chr + w */
- keymap[EStdKeyF3] = SDLK_F3; /* chr + e */
- keymap[EStdKeyF4] = SDLK_F4; /* chr + r */
- keymap[EStdKeyF5] = SDLK_F5; /* chr + t */
- keymap[EStdKeyF6] = SDLK_F6; /* chr + y */
- keymap[EStdKeyF7] = SDLK_F7; /* chr + i */
- keymap[EStdKeyF8] = SDLK_F8; /* chr + o */
-
- keymap[EStdKeyF9] = SDLK_F9; /* chr + a */
- keymap[EStdKeyF10] = SDLK_F10; /* chr + s */
- keymap[EStdKeyF11] = SDLK_F11; /* chr + d */
- keymap[EStdKeyF12] = SDLK_F12; /* chr + f */
-
- /* !!TODO
- EStdKeyNumLock=0x1b,
- EStdKeyScrollLock=0x1c,
-
- EStdKeyNkpForwardSlash=0x84,
- EStdKeyNkpAsterisk=0x85,
- EStdKeyNkpMinus=0x86,
- EStdKeyNkpPlus=0x87,
- EStdKeyNkpEnter=0x88,
- EStdKeyNkp1=0x89,
- EStdKeyNkp2=0x8a,
- EStdKeyNkp3=0x8b,
- EStdKeyNkp4=0x8c,
- EStdKeyNkp5=0x8d,
- EStdKeyNkp6=0x8e,
- EStdKeyNkp7=0x8f,
- EStdKeyNkp8=0x90,
- EStdKeyNkp9=0x91,
- EStdKeyNkp0=0x92,
- EStdKeyNkpFullStop=0x93,
- EStdKeyMenu=0x94,
- EStdKeyBacklightOn=0x95,
- EStdKeyBacklightOff=0x96,
- EStdKeyBacklightToggle=0x97,
- EStdKeyIncContrast=0x98,
- EStdKeyDecContrast=0x99,
- EStdKeySliderDown=0x9a,
- EStdKeySliderUp=0x9b,
- EStdKeyDictaphonePlay=0x9c,
- EStdKeyDictaphoneStop=0x9d,
- EStdKeyDictaphoneRecord=0x9e,
- EStdKeyHelp=0x9f,
- EStdKeyOff=0xa0,
- EStdKeyDial=0xa1,
- EStdKeyIncVolume=0xa2,
- EStdKeyDecVolume=0xa3,
- EStdKeyDevice0=0xa4,
- EStdKeyDevice1=0xa5,
- EStdKeyDevice2=0xa6,
- EStdKeyDevice3=0xa7,
- EStdKeyDevice4=0xa8,
- EStdKeyDevice5=0xa9,
- EStdKeyDevice6=0xaa,
- EStdKeyDevice7=0xab,
- EStdKeyDevice8=0xac,
- EStdKeyDevice9=0xad,
- EStdKeyDeviceA=0xae,
- EStdKeyDeviceB=0xaf,
- EStdKeyDeviceC=0xb0,
- EStdKeyDeviceD=0xb1,
- EStdKeyDeviceE=0xb2,
- EStdKeyDeviceF=0xb3,
- EStdKeyApplication0=0xb4,
- EStdKeyApplication1=0xb5,
- EStdKeyApplication2=0xb6,
- EStdKeyApplication3=0xb7,
- EStdKeyApplication4=0xb8,
- EStdKeyApplication5=0xb9,
- EStdKeyApplication6=0xba,
- EStdKeyApplication7=0xbb,
- EStdKeyApplication8=0xbc,
- EStdKeyApplication9=0xbd,
- EStdKeyApplicationA=0xbe,
- EStdKeyApplicationB=0xbf,
- EStdKeyApplicationC=0xc0,
- EStdKeyApplicationD=0xc1,
- EStdKeyApplicationE=0xc2,
- EStdKeyApplicationF=0xc3,
- EStdKeyYes=0xc4,
- EStdKeyNo=0xc5,
- EStdKeyIncBrightness=0xc6,
- EStdKeyDecBrightness=0xc7,
- EStdKeyCaseOpen=0xc8,
- EStdKeyCaseClose=0xc9
- */
-
-}
-
-
-
-static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym)
-{
- char debug[256];
- //SDL_TRACE1("SDL: TranslateKey, scancode=%d", scancode); //!!
-
- /* Set the keysym information */
-
- keysym->scancode = scancode;
-
- if ((scancode >= MAX_SCANCODE) &&
- ((scancode - ENonCharacterKeyBase + 0x0081) >= MAX_SCANCODE)) {
- SDL_SetError("Too big scancode");
- keysym->scancode = SDLK_UNKNOWN;
- keysym->mod = KMOD_NONE;
- return keysym;
- }
-
- keysym->mod = SDL_GetModState(); //!!Is this right??
-
- /* Handle function keys: F1, F2, F3 ... */
- if (keysym->mod & KMOD_META) {
- if (scancode >= 'A' && scancode < ('A' + 24)) { /* first 32 alphapet keys */
- switch(scancode) {
- case 'Q': scancode = EStdKeyF1; break;
- case 'W': scancode = EStdKeyF2; break;
- case 'E': scancode = EStdKeyF3; break;
- case 'R': scancode = EStdKeyF4; break;
- case 'T': scancode = EStdKeyF5; break;
- case 'Y': scancode = EStdKeyF6; break;
- case 'U': scancode = EStdKeyF7; break;
- case 'I': scancode = EStdKeyF8; break;
- case 'A': scancode = EStdKeyF9; break;
- case 'S': scancode = EStdKeyF10; break;
- case 'D': scancode = EStdKeyF11; break;
- case 'F': scancode = EStdKeyF12; break;
- }
- keysym->sym = keymap[scancode];
- }
- }
-
- if (scancode >= ENonCharacterKeyBase) {
- // Non character keys
- keysym->sym = keymap[scancode -
- ENonCharacterKeyBase + 0x0081]; // !!hard coded
- } else {
- keysym->sym = keymap[scancode];
- }
-
-
- /* If UNICODE is on, get the UNICODE value for the key */
- keysym->unicode = 0;
-
-#if 0 // !!TODO:unicode
-
- if ( SDL_TranslateUNICODE )
- {
- /* Populate the unicode field with the ASCII value */
- keysym->unicode = scancode;
- }
-#endif
-
- //!!
- //sprintf(debug, "SDL: TranslateKey: keysym->scancode=%d, keysym->sym=%d, keysym->mod=%d",
- // keysym->scancode, keysym->sym, keysym->mod);
- //SDL_TRACE(debug); //!!
-
- return(keysym);
-}
-
-}; /* extern "C" */
-
-
diff --git a/distrib/sdl-1.2.12/src/video/epoc/SDL_epocevents_c.h b/distrib/sdl-1.2.12/src/video/epoc/SDL_epocevents_c.h
deleted file mode 100644
index 8455c15..0000000
--- a/distrib/sdl-1.2.12/src/video/epoc/SDL_epocevents_c.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- SDL_epocevents_c.h
- Handle the event stream, converting Epoc events into SDL events
-
- Epoc version by Hannu Viitala (hannu.j.viitala@mbnet.fi)
-*/
-
-
-extern "C" {
-#include "../SDL_sysvideo.h"
-};
-
-#define MAX_SCANCODE 255
-
-/* Variables and functions exported by SDL_sysevents.c to other parts
- of the native video subsystem (SDL_sysvideo.c)
-*/
-
-extern "C" {
-extern void EPOC_InitOSKeymap(_THIS);
-extern void EPOC_PumpEvents(_THIS);
-};
-
diff --git a/distrib/sdl-1.2.12/src/video/epoc/SDL_epocvideo.cpp b/distrib/sdl-1.2.12/src/video/epoc/SDL_epocvideo.cpp
deleted file mode 100644
index 3694f46..0000000
--- a/distrib/sdl-1.2.12/src/video/epoc/SDL_epocvideo.cpp
+++ /dev/null
@@ -1,697 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- SDL_epocvideo.cpp
- Epoc based SDL video driver implementation
-
- Epoc version by Hannu Viitala (hannu.j.viitala@mbnet.fi)
-*/
-
-extern "C" {
-#include "SDL_timer.h"
-#include "SDL_video.h"
-#undef NULL
-#include "../SDL_pixels_c.h"
-};
-
-#include "SDL_epocvideo.h"
-#include "SDL_epocevents_c.h"
-
-#include <hal.h>
-#include <coedef.h>
-
-/* For debugging */
-
-void RDebug_Print_b(char* error_str, void* param)
- {
- TBuf8<128> error8((TUint8*)error_str);
- TBuf<128> error;
- error.Copy(error8);
- if (param) //!! Do not work if the parameter is really 0!!
- RDebug::Print(error, param);
- else
- RDebug::Print(error);
- }
-
-extern "C" void RDebug_Print(char* error_str, void* param)
- {
- RDebug_Print_b(error_str, param);
- }
-
-
-int Debug_AvailMem2()
- {
- //User::CompressAllHeaps();
- TMemoryInfoV1Buf membuf;
- User::LeaveIfError(UserHal::MemoryInfo(membuf));
- TMemoryInfoV1 minfo = membuf();
- return(minfo.iFreeRamInBytes);
- }
-
-extern "C" int Debug_AvailMem()
- {
- return(Debug_AvailMem2());
- }
-
-
-extern "C" {
-
-/* Initialization/Query functions */
-
-static int EPOC_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **EPOC_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *EPOC_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int EPOC_SetColors(_THIS, int firstcolor, int ncolors,
- SDL_Color *colors);
-static void EPOC_VideoQuit(_THIS);
-
-/* Hardware surface functions */
-
-static int EPOC_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int EPOC_LockHWSurface(_THIS, SDL_Surface *surface);
-static int EPOC_FlipHWSurface(_THIS, SDL_Surface *surface);
-static void EPOC_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static void EPOC_FreeHWSurface(_THIS, SDL_Surface *surface);
-static void EPOC_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
-
-static int EPOC_Available(void);
-static SDL_VideoDevice *EPOC_CreateDevice(int devindex);
-
-/* Mouse functions */
-
-static WMcursor *EPOC_CreateWMCursor(_THIS, Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
-static void EPOC_FreeWMCursor(_THIS, WMcursor *cursor);
-static int EPOC_ShowWMCursor(_THIS, WMcursor *cursor);
-
-
-
-/* !! Table for fast conversion from 8 bit to 12 bit */
-static TUint16 EPOC_HWPalette_256_to_4k[256];
-
-VideoBootStrap EPOC_bootstrap = {
- "epoc", "EPOC system",
- EPOC_Available, EPOC_CreateDevice
-};
-
-const TUint32 WindowClientHandle = 9210; //!!
-
-/* Epoc video driver bootstrap functions */
-
-static int EPOC_Available(void)
-{
- return 1; /* Always available */
-}
-
-static void EPOC_DeleteDevice(SDL_VideoDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_VideoDevice *EPOC_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
-
- /* Allocate all variables that we free on delete */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device ) {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *device->hidden));
- }
- if ( (device == NULL) || (device->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( device ) {
- SDL_free(device);
- }
- return(0);
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
-
- /* Set the function pointers */
- device->VideoInit = EPOC_VideoInit;
- device->ListModes = EPOC_ListModes;
- device->SetVideoMode = EPOC_SetVideoMode;
- device->SetColors = EPOC_SetColors;
- device->UpdateRects = NULL;
- device->VideoQuit = EPOC_VideoQuit;
- device->AllocHWSurface = EPOC_AllocHWSurface;
- device->CheckHWBlit = NULL;
- device->FillHWRect = NULL;
- device->SetHWColorKey = NULL;
- device->SetHWAlpha = NULL;
- device->LockHWSurface = EPOC_LockHWSurface;
- device->UnlockHWSurface = EPOC_UnlockHWSurface;
- device->FlipHWSurface = EPOC_FlipHWSurface;
- device->FreeHWSurface = EPOC_FreeHWSurface;
- device->SetIcon = NULL;
- device->SetCaption = NULL;
- device->GetWMInfo = NULL;
- device->FreeWMCursor = EPOC_FreeWMCursor;
- device->CreateWMCursor = EPOC_CreateWMCursor;
- device->ShowWMCursor = EPOC_ShowWMCursor;
- device->WarpWMCursor = NULL;
- device->InitOSKeymap = EPOC_InitOSKeymap;
- device->PumpEvents = EPOC_PumpEvents;
- device->free = EPOC_DeleteDevice;
-
- return device;
-}
-
-
-int GetBpp(TDisplayMode displaymode)
-{
- TInt numColors = TDisplayModeUtils::NumDisplayModeColors(displaymode);
- TInt bitsPerPixel = 1;
- for (TInt32 i = 2; i < numColors; i <<= 1, bitsPerPixel++);
- return bitsPerPixel;
-}
-
-void ConstructWindowL(_THIS)
-{
- TInt error;
-
- error = Private->EPOC_WsSession.Connect();
- User::LeaveIfError(error);
- Private->EPOC_WsScreen=new(ELeave) CWsScreenDevice(Private->EPOC_WsSession);
- User::LeaveIfError(Private->EPOC_WsScreen->Construct());
- User::LeaveIfError(Private->EPOC_WsScreen->CreateContext(Private->EPOC_WindowGc));
-
- Private->EPOC_WsWindowGroup=RWindowGroup(Private->EPOC_WsSession);
- User::LeaveIfError(Private->EPOC_WsWindowGroup.Construct(WindowClientHandle));
- Private->EPOC_WsWindowGroup.SetOrdinalPosition(0);
-
- //!!
- TBuf<32> winGroupName;
- winGroupName.Append(0);
- winGroupName.Append(0);
- winGroupName.Append(0);// uid
- winGroupName.Append(0);
- winGroupName.Append(_L("SDL")); // caption
- winGroupName.Append(0);
- winGroupName.Append(0); //doc name
- Private->EPOC_WsWindowGroup.SetName(winGroupName); //!!
-
- Private->EPOC_WsWindow=RWindow(Private->EPOC_WsSession);
- User::LeaveIfError(Private->EPOC_WsWindow.Construct(Private->EPOC_WsWindowGroup,WindowClientHandle));
- Private->EPOC_WsWindow.SetBackgroundColor(KRgbWhite);
- Private->EPOC_WsWindow.Activate();
- Private->EPOC_WsWindow.SetSize(Private->EPOC_WsScreen->SizeInPixels());
- Private->EPOC_WsWindow.SetVisible(ETrue);
-
- Private->EPOC_WsWindowGroupID = Private->EPOC_WsWindowGroup.Identifier();
- Private->EPOC_IsWindowFocused = EFalse;
-}
-
-
-int EPOC_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- // !!TODO:handle leave functions!
-
- int i;
-
- /* Initialize all variables that we clean on shutdown */
-
- for ( i=0; i<SDL_NUMMODES; ++i ) {
- Private->SDL_modelist[i] = (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
- Private->SDL_modelist[i]->x = Private->SDL_modelist[i]->y = 0;
- }
- /* Modes sorted largest to smallest !!TODO:sorting order??*/
- Private->SDL_modelist[0]->w = 640; Private->SDL_modelist[0]->h = 200;
- Private->SDL_modelist[1]->w = 320; Private->SDL_modelist[1]->h = 200;
- Private->SDL_modelist[2]->w = 640; Private->SDL_modelist[2]->h = 400;
- Private->SDL_modelist[3]->w = 640; Private->SDL_modelist[3]->h = 480;
- Private->SDL_modelist[4] = NULL;
-
- /* Construct Epoc window */
-
- ConstructWindowL(_this);
-
- /* Initialise Epoc frame buffer */
-
- TDisplayMode displayMode = Private->EPOC_WsScreen->DisplayMode();
-
- #ifndef __WINS__
-
- TScreenInfoV01 screenInfo;
- TPckg<TScreenInfoV01> sInfo(screenInfo);
- UserSvr::ScreenInfo(sInfo);
-
- Private->EPOC_ScreenSize = screenInfo.iScreenSize;
- Private->EPOC_DisplayMode = displayMode;
- Private->EPOC_HasFrameBuffer = screenInfo.iScreenAddressValid;
- Private->EPOC_FrameBuffer = Private->EPOC_HasFrameBuffer ? (TUint8*) screenInfo.iScreenAddress : NULL;
- Private->EPOC_BytesPerPixel = ((GetBpp(displayMode)-1) / 8) + 1;
- Private->EPOC_BytesPerScanLine = screenInfo.iScreenSize.iWidth * Private->EPOC_BytesPerPixel;
-
- /* It seems that in SA1100 machines for 8bpp displays there is a 512 palette table at the
- * beginning of the frame buffer. E.g. Series 7 and Netbook.
- * In 12 bpp machines the table has 16 entries.
- */
- if (Private->EPOC_HasFrameBuffer && GetBpp(displayMode) == 8)
- Private->EPOC_FrameBuffer += 512;
- if (Private->EPOC_HasFrameBuffer && GetBpp(displayMode) == 12)
- Private->EPOC_FrameBuffer += 16 * 2;
-
- #else /* defined __WINS__ */
-
- /* Create bitmap, device and context for screen drawing */
- Private->EPOC_ScreenSize = Private->EPOC_WsScreen->SizeInPixels();
-
- Private->EPOC_Bitmap = new (ELeave) CWsBitmap(Private->EPOC_WsSession);
- Private->EPOC_Bitmap->Create(Private->EPOC_ScreenSize, displayMode);
-
- Private->EPOC_DisplayMode = displayMode;
- Private->EPOC_HasFrameBuffer = ETrue;
- Private->EPOC_FrameBuffer = NULL; /* Private->EPOC_Bitmap->DataAddress() can change any time */
- Private->EPOC_BytesPerPixel = ((GetBpp(displayMode)-1) / 8) + 1;
- Private->EPOC_BytesPerScanLine = Private->EPOC_WsScreen->SizeInPixels().iWidth * Private->EPOC_BytesPerPixel;
-
- #endif /* __WINS__ */
-
- _this->info.current_w = Private->EPOC_ScreenSize.iWidth;
- _this->info.current_h = Private->EPOC_ScreenSize.iHeight;
-
- /* The "best" video format should be returned to caller. */
-
- vformat->BitsPerPixel = /*!!GetBpp(displayMode) */ 8;
- vformat->BytesPerPixel = /*!!Private->EPOC_BytesPerPixel*/ 1;
-
- /* Activate events for me */
-
- Private->EPOC_WsEventStatus = KRequestPending;
- Private->EPOC_WsSession.EventReady(&Private->EPOC_WsEventStatus);
- Private->EPOC_RedrawEventStatus = KRequestPending;
- Private->EPOC_WsSession.RedrawReady(&Private->EPOC_RedrawEventStatus);
- Private->EPOC_WsWindow.PointerFilter(EPointerFilterDrag, 0);
-
- Private->EPOC_ScreenOffset = 0;
-
- //!! TODO: error handling
- //if (ret != KErrNone)
- // return(-1);
- //else
- return(0);
-}
-
-
-SDL_Rect **EPOC_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- if (format->BitsPerPixel == 12 || format->BitsPerPixel == 8)
- return Private->SDL_modelist;
- return NULL;
-}
-
-int EPOC_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- for(int i = firstcolor; i < ncolors; i++) {
- // 4k value: 000rgb
- TUint16 color4K = 0;
- color4K |= (colors[i].r & 0x0000f0) << 4;
- color4K |= (colors[i].g & 0x0000f0);
- color4K |= (colors[i].b & 0x0000f0) >> 4;
- EPOC_HWPalette_256_to_4k[i] = color4K;
- }
- return(0);
-}
-
-
-SDL_Surface *EPOC_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- /* Check parameters */
- if (!((width == 640 && height == 200 && bpp == 12) ||
- (width == 640 && height == 400 && bpp == 12) ||
- (width == 640 && height == 480 && bpp == 12) ||
- (width == 320 && height == 200 && bpp == 12) ||
- (width == 640 && height == 200 && bpp == 8) ||
- (width == 640 && height == 400 && bpp == 8) ||
- (width == 640 && height == 480 && bpp == 8) ||
- (width == 320 && height == 200 && bpp == 8))) {
- SDL_SetError("Requested video mode is not supported");
- return NULL;
- }
-
- if (current && current->pixels) {
- SDL_free(current->pixels);
- current->pixels = NULL;
- }
- if ( ! SDL_ReallocFormat(current, bpp, 0, 0, 0, 0) ) {
- return(NULL);
- }
-
- /* Set up the new mode framebuffer */
- if (bpp == 8)
- current->flags = (SDL_FULLSCREEN|SDL_SWSURFACE|SDL_PREALLOC|SDL_HWPALETTE);
- else // 12 bpp
- current->flags = (SDL_FULLSCREEN|SDL_SWSURFACE|SDL_PREALLOC);
- current->w = width;
- current->h = height;
- int numBytesPerPixel = ((bpp-1)>>3) + 1;
- current->pitch = numBytesPerPixel * width; // Number of bytes in scanline
- current->pixels = SDL_malloc(width * height * numBytesPerPixel);
- SDL_memset(current->pixels, 0, width * height * numBytesPerPixel);
-
- /* Set the blit function */
- _this->UpdateRects = EPOC_DirectUpdate;
-
- /* Must buffer height be shrinked to screen by 2 ? */
- if (current->h >= 400)
- Private->EPOC_ShrinkedHeight = ETrue;
-
- /* Centralize game window on device screen */
- Private->EPOC_ScreenOffset = (Private->EPOC_ScreenSize.iWidth - current->w) / 2;
-
- /* We're done */
- return(current);
-}
-
-void RedrawWindowL(_THIS)
-{
- SDL_Rect fullScreen;
- fullScreen.x = 0;
- fullScreen.y = 0;
- fullScreen.w = _this->screen->w;
- fullScreen.h = _this->screen->h;
-
-#ifdef __WINS__
- TBitmapUtil lock(Private->EPOC_Bitmap);
- lock.Begin(TPoint(0,0)); // Lock bitmap heap
- Private->EPOC_WindowGc->Activate(Private->EPOC_WsWindow);
-#endif
-
- if (fullScreen.w < Private->EPOC_ScreenSize.iWidth
- && fullScreen.w < Private->EPOC_ScreenSize.iWidth) {
- /* Draw blue stripes background */
-#ifdef __WINS__
- TUint16* screenBuffer = (TUint16*)Private->EPOC_Bitmap->DataAddress();
-#else
- TUint16* screenBuffer = (TUint16*)Private->EPOC_FrameBuffer;
-#endif
- for (int y=0; y < Private->EPOC_ScreenSize.iHeight; y++) {
- for (int x=0; x < Private->EPOC_ScreenSize.iWidth; x++) {
- TUint16 color = ((x+y)>>1) & 0xf; /* Draw pattern */
- *screenBuffer++ = color;
- }
- }
- }
-
-
- /* Tell the system that something has been drawn */
- TRect rect = TRect(Private->EPOC_WsWindow.Size());
- Private->EPOC_WsWindow.Invalidate(rect);
-
-#ifdef __WINS__
- Private->EPOC_WsWindow.BeginRedraw(rect);
- Private->EPOC_WindowGc->BitBlt(TPoint(), Private->EPOC_Bitmap);
- Private->EPOC_WsWindow.EndRedraw();
- Private->EPOC_WindowGc->Deactivate();
- lock.End(); // Unlock bitmap heap
- Private->EPOC_WsSession.Flush();
-#endif
-
- /* Draw current buffer */
- EPOC_DirectUpdate(_this, 1, &fullScreen);
-}
-
-
-/* We don't actually allow hardware surfaces other than the main one */
-static int EPOC_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- return(-1);
-}
-static void EPOC_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-static int EPOC_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- return(0);
-}
-static void EPOC_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-static int EPOC_FlipHWSurface(_THIS, SDL_Surface *surface)
-{
- return(0);
-}
-
-static void EPOC_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- TInt focusWindowGroupId = Private->EPOC_WsSession.GetFocusWindowGroup();
- if (focusWindowGroupId != Private->EPOC_WsWindowGroupID) {
-
- /* Force focus window to redraw again for cleaning away SDL screen graphics */
-
-
- TInt pos = Private->EPOC_WsWindowGroup.OrdinalPosition();
- Private->EPOC_WsWindowGroup.SetOrdinalPosition(0, KMaxTInt);
- TRect rect = TRect(Private->EPOC_WsWindow.Size());
- Private->EPOC_WsWindow.Invalidate(rect);
- Private->EPOC_WsWindowGroup.SetOrdinalPosition(pos, ECoeWinPriorityNormal);
-
- /* If this is not the topmost window, wait here! Sleep for 1 second to give cpu to
- multitasking and poll for being the topmost window.
- */
- while (Private->EPOC_WsSession.GetFocusWindowGroup() != Private->EPOC_WsWindowGroupID)
- SDL_Delay(1000);
-
- RedrawWindowL(_this);
- }
-
- TInt i;
- TInt sourceNumBytesPerPixel = ((_this->screen->format->BitsPerPixel-1)>>3) + 1;
- TInt targetNumBytesPerPixel = Private->EPOC_BytesPerPixel;
- TInt fixedOffset = Private->EPOC_ScreenOffset;
- TInt screenW = _this->screen->w;
- TInt screenH = _this->screen->h;
- TInt sourceScanlineLength = screenW;
- if (Private->EPOC_ShrinkedHeight) { /* simulate 400 pixel height in 200 pixel screen */
- sourceScanlineLength <<= 1;
- screenH >>= 1;
- }
- TInt targetScanlineLength = Private->EPOC_ScreenSize.iWidth;
-#ifdef __WINS__
- TBitmapUtil lock(Private->EPOC_Bitmap);
- lock.Begin(TPoint(0,0)); // Lock bitmap heap
- Private->EPOC_WindowGc->Activate(Private->EPOC_WsWindow);
- TUint16* screenBuffer = (TUint16*)Private->EPOC_Bitmap->DataAddress();
-#else
- TUint16* screenBuffer = (TUint16*)Private->EPOC_FrameBuffer;
-#endif
-
-
- /* Render the rectangles in the list */
-
- for ( i=0; i < numrects; ++i ) {
- SDL_Rect rect2;
- const SDL_Rect& currentRect = rects[i];
- rect2.x = currentRect.x;
- rect2.y = currentRect.y;
- rect2.w = currentRect.w;
- rect2.h = currentRect.h;
-
- if (rect2.w <= 0 || rect2.h <= 0) /* sanity check */
- continue;
-
- if (Private->EPOC_ShrinkedHeight) { /* simulate 400 pixel height in 200 pixel screen */
- rect2.y >>= 1;
- if (!(rect2.h >>= 1))
- rect2.h = 1; // always at least 1 pixel height!
- }
-
- /* All variables are measured in pixels */
-
- /* Check rects validity, i.e. upper and lower bounds */
- TInt maxX = Min(screenW - 1, rect2.x + rect2.w - 1);
- TInt maxY = Min(screenH - 1, rect2.y + rect2.h - 1);
- if (maxX < 0 || maxY < 0) /* sanity check */
- continue;
- maxY = Min(maxY, 199);
-
- TInt sourceRectWidth = maxX - rect2.x + 1;
- TInt sourceRectWidthInBytes = sourceRectWidth * sourceNumBytesPerPixel;
- TInt sourceRectHeight = maxY - rect2.y + 1;
- TInt sourceStartOffset = rect2.x + rect2.y * sourceScanlineLength;
- TInt targetStartOffset = fixedOffset + rect2.x + rect2.y * targetScanlineLength;
-
- // !! Nokia9210 native mode: 12 bpp --> 12 bpp
- if (_this->screen->format->BitsPerPixel == 12) {
- TUint16* bitmapLine = (TUint16*)_this->screen->pixels + sourceStartOffset;
- TUint16* screenMemory = screenBuffer + targetStartOffset;
- for(TInt y = 0 ; y < sourceRectHeight ; y++) {
- __ASSERT_DEBUG(screenMemory < (screenBuffer
- + Private->EPOC_ScreenSize.iWidth * Private->EPOC_ScreenSize.iHeight),
- User::Panic(_L("SDL"), KErrCorrupt));
- __ASSERT_DEBUG(screenMemory >= screenBuffer,
- User::Panic(_L("SDL"), KErrCorrupt));
- __ASSERT_DEBUG(bitmapLine < ((TUint16*)_this->screen->pixels +
- + (_this->screen->w * _this->screen->h)),
- User::Panic(_L("SDL"), KErrCorrupt));
- __ASSERT_DEBUG(bitmapLine >= (TUint16*)_this->screen->pixels,
- User::Panic(_L("SDL"), KErrCorrupt));
- Mem::Copy(screenMemory, bitmapLine, sourceRectWidthInBytes);
- bitmapLine += sourceScanlineLength;
- screenMemory += targetScanlineLength;
- }
- }
- // !! 256 color paletted mode: 8 bpp --> 12 bpp
- else {
- TUint8* bitmapLine = (TUint8*)_this->screen->pixels + sourceStartOffset;
- TUint16* screenMemory = screenBuffer + targetStartOffset;
- for(TInt y = 0 ; y < sourceRectHeight ; y++) {
- TUint8* bitmapPos = bitmapLine; /* 1 byte per pixel */
- TUint16* screenMemoryLinePos = screenMemory; /* 2 bytes per pixel */
- /* Convert each pixel from 256 palette to 4k color values */
- for(TInt x = 0 ; x < sourceRectWidth ; x++) {
- __ASSERT_DEBUG(screenMemoryLinePos < (screenBuffer
- + (Private->EPOC_ScreenSize.iWidth * Private->EPOC_ScreenSize.iHeight)),
- User::Panic(_L("SDL"), KErrCorrupt));
- __ASSERT_DEBUG(screenMemoryLinePos >= screenBuffer,
- User::Panic(_L("SDL"), KErrCorrupt));
- __ASSERT_DEBUG(bitmapPos < ((TUint8*)_this->screen->pixels +
- + (_this->screen->w * _this->screen->h)),
- User::Panic(_L("SDL"), KErrCorrupt));
- __ASSERT_DEBUG(bitmapPos >= (TUint8*)_this->screen->pixels,
- User::Panic(_L("SDL"), KErrCorrupt));
- *screenMemoryLinePos = EPOC_HWPalette_256_to_4k[*bitmapPos];
- bitmapPos++;
- screenMemoryLinePos++;
- }
- bitmapLine += sourceScanlineLength;
- screenMemory += targetScanlineLength;
- }
- }
-
- }
-
-#ifdef __WINS__
-
- TRect rect = TRect(Private->EPOC_WsWindow.Size());
- Private->EPOC_WsWindow.Invalidate(rect);
- Private->EPOC_WsWindow.BeginRedraw(rect);
- Private->EPOC_WindowGc->BitBlt(TPoint(), Private->EPOC_Bitmap);
- Private->EPOC_WsWindow.EndRedraw();
- Private->EPOC_WindowGc->Deactivate();
- lock.End(); // Unlock bitmap heap
- Private->EPOC_WsSession.Flush();
-
-#endif
-
- /* Update virtual cursor */
- //!!Private->EPOC_WsSession.SetPointerCursorPosition(Private->EPOC_WsSession.PointerCursorPosition());
-
- return;
-}
-
-
-/* Note: If we are terminated, this could be called in the middle of
- another SDL video routine -- notably UpdateRects.
-*/
-void EPOC_VideoQuit(_THIS)
-{
- int i;
-
- /* Free video mode lists */
- for ( i=0; i<SDL_NUMMODES; ++i ) {
- if ( Private->SDL_modelist[i] != NULL ) {
- SDL_free(Private->SDL_modelist[i]);
- Private->SDL_modelist[i] = NULL;
- }
- }
-
- if ( _this->screen && (_this->screen->flags & SDL_HWSURFACE) ) {
- /* Direct screen access, no memory buffer */
- _this->screen->pixels = NULL;
- }
-
- if (_this->screen && _this->screen->pixels) {
- SDL_free(_this->screen->pixels);
- _this->screen->pixels = NULL;
- }
-
- /* Free Epoc resources */
-
- /* Disable events for me */
- if (Private->EPOC_WsEventStatus != KRequestPending)
- Private->EPOC_WsSession.EventReadyCancel();
- if (Private->EPOC_RedrawEventStatus != KRequestPending)
- Private->EPOC_WsSession.RedrawReadyCancel();
-
- #ifdef __WINS__
- delete Private->EPOC_Bitmap;
- Private->EPOC_Bitmap = NULL;
- #endif
-
- if (Private->EPOC_WsWindow.WsHandle())
- Private->EPOC_WsWindow.Close();
-
- if (Private->EPOC_WsWindowGroup.WsHandle())
- Private->EPOC_WsWindowGroup.Close();
-
- delete Private->EPOC_WindowGc;
- Private->EPOC_WindowGc = NULL;
-
- delete Private->EPOC_WsScreen;
- Private->EPOC_WsScreen = NULL;
-
- if (Private->EPOC_WsSession.WsHandle())
- Private->EPOC_WsSession.Close();
-}
-
-
-WMcursor *EPOC_CreateWMCursor(_THIS, Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
-{
- return (WMcursor *) 9210; // it's ok to return something unuseful but true
-}
-
-void EPOC_FreeWMCursor(_THIS, WMcursor *cursor)
-{
- /* Disable virtual cursor */
- HAL::Set(HAL::EMouseState, HAL::EMouseState_Invisible);
- Private->EPOC_WsSession.SetPointerCursorMode(EPointerCursorNone);
-}
-
-int EPOC_ShowWMCursor(_THIS, WMcursor *cursor)
-{
-
- if (cursor == (WMcursor *)9210) {
- /* Enable virtual cursor */
- HAL::Set(HAL::EMouseState, HAL::EMouseState_Visible);
- Private->EPOC_WsSession.SetPointerCursorMode(EPointerCursorNormal);
- }
- else {
- /* Disable virtual cursor */
- HAL::Set(HAL::EMouseState, HAL::EMouseState_Invisible);
- Private->EPOC_WsSession.SetPointerCursorMode(EPointerCursorNone);
- }
-
- return(1);
-}
-
-}; // extern "C"
-
diff --git a/distrib/sdl-1.2.12/src/video/epoc/SDL_epocvideo.h b/distrib/sdl-1.2.12/src/video/epoc/SDL_epocvideo.h
deleted file mode 100644
index efff50a..0000000
--- a/distrib/sdl-1.2.12/src/video/epoc/SDL_epocvideo.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- SDL_epocvideo.h
- Epoc based SDL video driver implementation
-
- Epoc version by Hannu Viitala (hannu.j.viitala@mbnet.fi)
-*/
-
-#ifndef _SDL_epocvideo_h
-#define _SDL_epocvideo_h
-
-extern "C" {
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-};
-
-#include <e32std.h>
-#include <bitdev.h>
-#include <w32std.h>
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *_this
-#define Private _this->hidden
-
-#define SDL_NUMMODES 4
-
-/* Private display data */
-struct SDL_PrivateVideoData {
-
- SDL_Rect *SDL_modelist[SDL_NUMMODES+1];
-
- /* Epoc window server info */
-
- RWsSession EPOC_WsSession;
- RWindowGroup EPOC_WsWindowGroup;
- TInt EPOC_WsWindowGroupID;
- RWindow EPOC_WsWindow;
- CWsScreenDevice* EPOC_WsScreen;
- CWindowGc* EPOC_WindowGc;
- TRequestStatus EPOC_WsEventStatus;
- TRequestStatus EPOC_RedrawEventStatus;
- TWsEvent EPOC_WsEvent;
- TWsRedrawEvent EPOC_RedrawEvent;
- #ifdef __WINS__
- CWsBitmap* EPOC_Bitmap;
- #endif
- TBool EPOC_IsWindowFocused; //!!Not used for anything yet!
-
- /* Screen hardware frame buffer info */
-
- TBool EPOC_HasFrameBuffer;
- TInt EPOC_BytesPerPixel;
- TInt EPOC_BytesPerScanLine;
- TDisplayMode EPOC_DisplayMode;
- TSize EPOC_ScreenSize;
- TUint8* EPOC_FrameBuffer; /* if NULL in HW we can't do direct screen access */
- TInt EPOC_ScreenOffset;
-
- /* Simulate double screen height */
- TBool EPOC_ShrinkedHeight;
-};
-
-extern "C" {
-extern void RedrawWindowL(_THIS);
-};
-
-
-#endif /* _SDL_epocvideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/3dfx_mmio.h b/distrib/sdl-1.2.12/src/video/fbcon/3dfx_mmio.h
deleted file mode 100644
index 5a4acb9..0000000
--- a/distrib/sdl-1.2.12/src/video/fbcon/3dfx_mmio.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* 3Dfx register definitions */
-
-#include "3dfx_regs.h"
-
-/* 3Dfx control macros */
-
-#define tdfx_in8(reg) *(volatile Uint8 *)(mapped_io + (reg))
-#define tdfx_in32(reg) *(volatile Uint32 *)(mapped_io + (reg))
-
-#define tdfx_out8(reg,v) *(volatile Uint8 *)(mapped_io + (reg)) = v;
-#define tdfx_out32(reg,v) *(volatile Uint32 *)(mapped_io + (reg)) = v;
-
-
-/* Wait for fifo space */
-#define tdfx_wait(space) \
-{ \
- while ( (tdfx_in8(TDFX_STATUS) & 0x1F) < space ) \
- ; \
-}
-
-
-/* Wait for idle accelerator */
-#define tdfx_waitidle() \
-{ \
- int i = 0; \
- \
- tdfx_wait(1); \
- tdfx_out32(COMMAND_3D, COMMAND_3D_NOP); \
- do { \
- i = (tdfx_in32(TDFX_STATUS) & STATUS_BUSY) ? 0 : i + 1; \
- } while ( i != 3 ); \
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/3dfx_regs.h b/distrib/sdl-1.2.12/src/video/fbcon/3dfx_regs.h
deleted file mode 100644
index 1180c82..0000000
--- a/distrib/sdl-1.2.12/src/video/fbcon/3dfx_regs.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _3DFX_REGS_H
-#define _3DFX_REGS_H
-
-/* This information comes from the public 3Dfx specs for the Voodoo 3000 */
-
-/* mapped_io register offsets */
-#define TDFX_STATUS 0x00
-
-#define INTCTRL (0x00100000 + 0x04)
-#define CLIP0MIN (0x00100000 + 0x08)
-#define CLIP0MAX (0x00100000 + 0x0c)
-#define DSTBASE (0x00100000 + 0x10)
-#define DSTFORMAT (0x00100000 + 0x14)
-#define SRCCOLORKEYMIN (0x00100000 + 0x18)
-#define SRCCOLORKEYMAX (0x00100000 + 0x1c)
-#define DSTCOLORKEYMIN (0x00100000 + 0x20)
-#define DSTCOLORKEYMAX (0x00100000 + 0x24)
-#define BRESERROR0 (0x00100000 + 0x28)
-#define BRESERROR1 (0x00100000 + 0x2c)
-#define ROP_2D (0x00100000 + 0x30)
-#define SRCBASE (0x00100000 + 0x34)
-#define COMMANDEXTRA_2D (0x00100000 + 0x38)
-#define PATTERN0 (0x00100000 + 0x44)
-#define PATTERN1 (0x00100000 + 0x48)
-#define CLIP1MIN (0x00100000 + 0x4c)
-#define CLIP1MAX (0x00100000 + 0x50)
-#define SRCFORMAT (0x00100000 + 0x54)
-#define SRCSIZE (0x00100000 + 0x58)
-#define SRCXY (0x00100000 + 0x5c)
-#define COLORBACK (0x00100000 + 0x60)
-#define COLORFORE (0x00100000 + 0x64)
-#define DSTSIZE (0x00100000 + 0x68)
-#define DSTXY (0x00100000 + 0x6c)
-#define COMMAND_2D (0x00100000 + 0x70)
-#define LAUNCH_2D (0x00100000 + 0x80)
-#define PATTERNBASE (0x00100000 + 0x100)
-
-#define COMMAND_3D (0x00200000 + 0x120)
-
-/* register bitfields (not all, only as needed) */
-
-#define BIT(x) (1UL << (x))
-
-#define COMMAND_2D_BITBLT 0x01
-#define COMMAND_2D_FILLRECT 0x05
-#define COMMAND_2D_LINE 0x06
-#define COMMAND_2D_POLYGON_FILL 0x08
-#define COMMAND_2D_INITIATE BIT(8)
-#define COMMAND_2D_REVERSELINE BIT(9)
-#define COMMAND_2D_STIPPLELINE BIT(12)
-#define COMMAND_2D_MONOCHROME_PATT BIT(13)
-#define COMMAND_2D_MONOCHROME_TRANSP BIT(16)
-
-#define COMMAND_3D_NOP 0x00
-
-#define STATUS_RETRACE BIT(6)
-#define STATUS_BUSY BIT(9)
-
-#endif /* _3DFX_REGS_H */
-
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fb3dfx.c b/distrib/sdl-1.2.12/src/video/fbcon/SDL_fb3dfx.c
deleted file mode 100644
index 91df7ac..0000000
--- a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fb3dfx.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-#include "../SDL_blit.h"
-#include "SDL_fb3dfx.h"
-#include "3dfx_mmio.h"
-
-
-/* Wait for vertical retrace */
-static void WaitVBL(_THIS)
-{
- /* find start of retrace */
- tdfx_waitidle();
- while( (tdfx_in32(TDFX_STATUS) & STATUS_RETRACE) == STATUS_RETRACE )
- ;
- /* wait until we're past the start */
- while( (tdfx_in32(TDFX_STATUS) & STATUS_RETRACE) == 0 )
- ;
-}
-static void WaitIdle(_THIS)
-{
- tdfx_waitidle();
-}
-
-/* Sets video mem colorkey and accelerated blit function */
-static int SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key)
-{
- return(0);
-}
-
-static int FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color)
-{
- int bpp;
- Uint32 dst_base;
- Uint32 format;
- int dstX, dstY;
-
- /* Don't blit to the display surface when switched away */
- if ( switched_away ) {
- return -2; /* no hardware access */
- }
- if ( dst == this->screen ) {
- SDL_mutexP(hw_lock);
- }
-
- /* Set the destination pixel format */
- dst_base = ((char *)dst->pixels - mapped_mem);
- bpp = dst->format->BitsPerPixel;
- format = dst->pitch | ((bpp+((bpp==8) ? 0 : 8)) << 13);
-
- /* Calculate source and destination base coordinates */
- dstX = rect->x;
- dstY = rect->y;
-
- /* Execute the fill command */
- tdfx_wait(6);
- tdfx_out32(DSTBASE, dst_base);
- tdfx_out32(DSTFORMAT, format);
- tdfx_out32(COLORFORE, color);
- tdfx_out32(COMMAND_2D, COMMAND_2D_FILLRECT);
- tdfx_out32(DSTSIZE, rect->w | (rect->h << 16));
- tdfx_out32(LAUNCH_2D, dstX | (dstY << 16));
-
- FB_AddBusySurface(dst);
-
- if ( dst == this->screen ) {
- SDL_mutexV(hw_lock);
- }
- return(0);
-}
-
-static int HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect)
-{
- SDL_VideoDevice *this = current_video;
- int bpp;
- Uint32 src_format;
- Uint32 dst_format;
- Uint32 src_base;
- Uint32 dst_base;
- int srcX, srcY;
- int dstX, dstY;
- Uint32 blitop;
- Uint32 use_colorkey;
-
- /* Don't blit to the display surface when switched away */
- if ( switched_away ) {
- return -2; /* no hardware access */
- }
- if ( dst == this->screen ) {
- SDL_mutexP(hw_lock);
- }
-
- /* Set the source and destination pixel format */
- src_base = ((char *)src->pixels - mapped_mem);
- bpp = src->format->BitsPerPixel;
- src_format = src->pitch | ((bpp+((bpp==8) ? 0 : 8)) << 13);
- dst_base = ((char *)dst->pixels - mapped_mem);
- bpp = dst->format->BitsPerPixel;
- dst_format = dst->pitch | ((bpp+((bpp==8) ? 0 : 8)) << 13);
-
- srcX = srcrect->x;
- srcY = srcrect->y;
- dstX = dstrect->x;
- dstY = dstrect->y;
-
- /* Assemble the blit operation */
- blitop = COMMAND_2D_BITBLT | (0xCC << 24);
- if ( srcX <= dstX ) {
- blitop |= BIT(14);
- srcX += (dstrect->w - 1);
- dstX += (dstrect->w - 1);
- }
- if ( srcY <= dstY ) {
- blitop |= BIT(15);
- srcY += (dstrect->h - 1);
- dstY += (dstrect->h - 1);
- }
-
- /* Perform the blit! */
- if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
- tdfx_wait(3);
- tdfx_out32(SRCCOLORKEYMIN, src->format->colorkey);
- tdfx_out32(SRCCOLORKEYMAX, src->format->colorkey);
- tdfx_out32(ROP_2D, 0xAA00);
- use_colorkey = 1;
- } else {
- use_colorkey = 0;
- }
- tdfx_wait(9);
- tdfx_out32(SRCBASE, (Uint32)src_base);
- tdfx_out32(SRCFORMAT, src_format);
- tdfx_out32(DSTBASE, (Uint32)dst_base);
- tdfx_out32(DSTFORMAT, src_format);
- tdfx_out32(COMMAND_2D, blitop);
- tdfx_out32(COMMANDEXTRA_2D, use_colorkey);
- tdfx_out32(DSTSIZE, dstrect->w | (dstrect->h << 16));
- tdfx_out32(DSTXY, dstX | (dstY << 16));
- tdfx_out32(LAUNCH_2D, srcX | (srcY << 16));
-
- FB_AddBusySurface(src);
- FB_AddBusySurface(dst);
-
- if ( dst == this->screen ) {
- SDL_mutexV(hw_lock);
- }
- return(0);
-}
-
-static int CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst)
-{
- int accelerated;
-
- /* Set initial acceleration on */
- src->flags |= SDL_HWACCEL;
-
- /* Set the surface attributes */
- if ( (src->flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
- if ( ! this->info.blit_hw_A ) {
- src->flags &= ~SDL_HWACCEL;
- }
- }
- if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
- if ( ! this->info.blit_hw_CC ) {
- src->flags &= ~SDL_HWACCEL;
- }
- }
-
- /* Check to see if final surface blit is accelerated */
- accelerated = !!(src->flags & SDL_HWACCEL);
- if ( accelerated ) {
- src->map->hw_blit = HWAccelBlit;
- }
- return(accelerated);
-}
-
-void FB_3DfxAccel(_THIS, __u32 card)
-{
- /* We have hardware accelerated surface functions */
- this->CheckHWBlit = CheckHWBlit;
- wait_vbl = WaitVBL;
- wait_idle = WaitIdle;
-
- /* Reset the 3Dfx controller */
- tdfx_out32(BRESERROR0, 0);
- tdfx_out32(BRESERROR1, 0);
-
- /* The 3Dfx has an accelerated color fill */
- this->info.blit_fill = 1;
- this->FillHWRect = FillHWRect;
-
- /* The 3Dfx has accelerated normal and colorkey blits */
- this->info.blit_hw = 1;
- this->info.blit_hw_CC = 1;
- this->SetHWColorKey = SetHWColorKey;
-}
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fb3dfx.h b/distrib/sdl-1.2.12/src/video/fbcon/SDL_fb3dfx.h
deleted file mode 100644
index b8b4aac..0000000
--- a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fb3dfx.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* 3Dfx hardware acceleration for the SDL framebuffer console driver */
-
-#include "SDL_fbvideo.h"
-
-/* Set up the driver for 3Dfx acceleration */
-extern void FB_3DfxAccel(_THIS, __u32 card);
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbelo.c b/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbelo.c
deleted file mode 100644
index 1142923..0000000
--- a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbelo.c
+++ /dev/null
@@ -1,442 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <unistd.h>
-#include <sys/time.h>
-#include <ctype.h>
-
-#include "SDL_stdinc.h"
-#include "SDL_fbvideo.h"
-#include "SDL_fbelo.h"
-
-/*
- calibration default values
- values are read from the following environment variables:
-
- SDL_ELO_MIN_X
- SDL_ELO_MAX_X
- SDL_ELO_MIN_Y
- SDL_ELO_MAX_Y
-*/
-
-static int ELO_MIN_X = 400;
-static int ELO_MAX_X = 3670;
-static int ELO_MIN_Y = 500;
-static int ELO_MAX_Y = 3540;
-
-#define ELO_SNAP_SIZE 6
-#define ELO_TOUCH_BYTE 'T'
-#define ELO_ID 'I'
-#define ELO_MODE 'M'
-#define ELO_PARAMETER 'P'
-#define ELO_REPORT 'B'
-#define ELO_ACK 'A'
-
-#define ELO_INIT_CHECKSUM 0xAA
-
-#define ELO_BTN_PRESS 0x01
-#define ELO_STREAM 0x02
-#define ELO_BTN_RELEASE 0x04
-
-#define ELO_TOUCH_MODE 0x01
-#define ELO_STREAM_MODE 0x02
-#define ELO_UNTOUCH_MODE 0x04
-#define ELO_RANGE_CHECK_MODE 0x40
-#define ELO_TRIM_MODE 0x02
-#define ELO_CALIB_MODE 0x04
-#define ELO_SCALING_MODE 0x08
-#define ELO_TRACKING_MODE 0x40
-
-#define ELO_SERIAL_MASK 0xF8
-
-#define ELO_SERIAL_IO '0'
-
-#define ELO_MAX_TRIALS 3
-#define ELO_MAX_WAIT 100000
-#define ELO_UNTOUCH_DELAY 5
-#define ELO_REPORT_DELAY 1
-
-/* eloParsePacket
-*/
-int eloParsePacket(unsigned char* mousebuf, int* dx, int* dy, int* button_state) {
- static int elo_button = 0;
- static int last_x = 0;
- static int last_y = 0;
- int x,y;
-
- /* Check if we have a touch packet */
- if (mousebuf[1] != ELO_TOUCH_BYTE) {
- return 0;
- }
-
- x = ((mousebuf[4] << 8) | mousebuf[3]);
- y = ((mousebuf[6] << 8) | mousebuf[5]);
-
- if((SDL_abs(x - last_x) > ELO_SNAP_SIZE) || (SDL_abs(y - last_y) > ELO_SNAP_SIZE)) {
- *dx = ((mousebuf[4] << 8) | mousebuf[3]);
- *dy = ((mousebuf[6] << 8) | mousebuf[5]);
- }
- else {
- *dx = last_x;
- *dy = last_y;
- }
-
- last_x = *dx;
- last_y = *dy;
-
- if ( (mousebuf[2] & 0x07) == ELO_BTN_PRESS ) {
- elo_button = 1;
- }
- if ( (mousebuf[2] & 0x07) == ELO_BTN_RELEASE ) {
- elo_button = 0;
- }
-
- *button_state = elo_button;
- return 1;
-}
-
-/* Convert the raw coordinates from the ELO controller
- to a screen position.
-*/
-void eloConvertXY(_THIS, int *dx, int *dy) {
- int input_x = *dx;
- int input_y = *dy;
- int width = ELO_MAX_X - ELO_MIN_X;
- int height = ELO_MAX_Y - ELO_MIN_Y;
-
- *dx = ((int)cache_vinfo.xres - ((int)cache_vinfo.xres * (input_x - ELO_MIN_X)) / width);
- *dy = (cache_vinfo.yres * (input_y - ELO_MIN_Y)) / height;
-}
-
-
-/* eloGetPacket
-*/
-int eloGetPacket(unsigned char* buffer, int* buffer_p, int* checksum, int fd) {
- int num_bytes;
- int ok;
-
- if(fd == 0) {
- num_bytes = ELO_PACKET_SIZE;
- }
- else {
- num_bytes = read(fd,
- (char *) (buffer + *buffer_p),
- ELO_PACKET_SIZE - *buffer_p);
- }
-
- if (num_bytes < 0) {
-#ifdef DEBUG_MOUSE
- fprintf(stderr, "System error while reading from Elographics touchscreen.\n");
-#endif
- return 0;
- }
-
- while (num_bytes) {
- if ((*buffer_p == 0) && (buffer[0] != ELO_START_BYTE)) {
- SDL_memcpy(&buffer[0], &buffer[1], num_bytes-1);
- }
- else {
- if (*buffer_p < ELO_PACKET_SIZE-1) {
- *checksum = *checksum + buffer[*buffer_p];
- *checksum = *checksum % 256;
- }
- (*buffer_p)++;
- }
- num_bytes--;
- }
-
- if (*buffer_p == ELO_PACKET_SIZE) {
- ok = (*checksum == buffer[ELO_PACKET_SIZE-1]);
- *checksum = ELO_INIT_CHECKSUM;
- *buffer_p = 0;
-
- if (!ok) {
- return 0;
- }
-
- return 1;
- }
- else {
- return 0;
- }
-}
-
-/* eloSendPacket
-*/
-
-int eloSendPacket(unsigned char* packet, int fd)
-{
- int i, result;
- int sum = ELO_INIT_CHECKSUM;
-
- packet[0] = ELO_START_BYTE;
- for (i = 0; i < ELO_PACKET_SIZE-1; i++) {
- sum += packet[i];
- sum &= 0xFF;
- }
- packet[ELO_PACKET_SIZE-1] = sum;
-
- result = write(fd, packet, ELO_PACKET_SIZE);
-
- if (result != ELO_PACKET_SIZE) {
-#ifdef DEBUG_MOUSE
- printf("System error while sending to Elographics touchscreen.\n");
-#endif
- return 0;
- }
- else {
- return 1;
- }
-}
-
-
-/* eloWaitForInput
- */
-int eloWaitForInput(int fd, int timeout)
-{
- fd_set readfds;
- struct timeval to;
- int r;
-
- FD_ZERO(&readfds);
- FD_SET(fd, &readfds);
- to.tv_sec = 0;
- to.tv_usec = timeout;
-
- r = select(FD_SETSIZE, &readfds, NULL, NULL, &to);
- return r;
-}
-
-/* eloWaitReply
- */
-int eloWaitReply(unsigned char type, unsigned char *reply, int fd) {
- int ok;
- int i, result;
- int reply_p = 0;
- int sum = ELO_INIT_CHECKSUM;
-
- i = ELO_MAX_TRIALS;
- do {
- ok = 0;
-
- result = eloWaitForInput(fd, ELO_MAX_WAIT);
-
- if (result > 0) {
- ok = eloGetPacket(reply, &reply_p, &sum, fd);
-
- if (ok && reply[1] != type && type != ELO_PARAMETER) {
-#ifdef DEBUG_MOUSE
- fprintf(stderr, "Wrong reply received\n");
-#endif
- ok = 0;
- }
- }
- else {
-#ifdef DEBUG_MOUSE
- fprintf(stderr, "No input!\n");
-#endif
- }
-
- if (result == 0) {
- i--;
- }
- } while(!ok && (i>0));
-
- return ok;
-}
-
-
-/* eloWaitAck
- */
-
-int eloWaitAck(int fd) {
- unsigned char packet[ELO_PACKET_SIZE];
- int i, nb_errors;
-
- if (eloWaitReply(ELO_ACK, packet, fd)) {
- for (i = 0, nb_errors = 0; i < 4; i++) {
- if (packet[2 + i] != '0') {
- nb_errors++;
- }
- }
-
- if (nb_errors != 0) {
-#ifdef DEBUG_MOUSE
- fprintf(stderr, "Elographics acknowledge packet reports %d errors\n", nb_errors);
-#endif
- }
- return 1;
- }
- else {
- return 0;
- }
-}
-
-
-/* eloSendQuery --
-*/
-int eloSendQuery(unsigned char *request, unsigned char* reply, int fd) {
- int ok;
-
- if (eloSendPacket(request, fd)) {
- ok = eloWaitReply(toupper(request[1]), reply, fd);
- if (ok) {
- ok = eloWaitAck(fd);
- }
- return ok;
- }
- else {
- return 0;
- }
-}
-
-
-/* eloSendControl
-*/
-int eloSendControl(unsigned char* control, int fd) {
- if (eloSendPacket(control, fd)) {
- return eloWaitAck(fd);
- }
- else {
- return 0;
- }
-}
-
-/* eloInitController
-*/
-int eloInitController(int fd) {
- unsigned char req[ELO_PACKET_SIZE];
- unsigned char reply[ELO_PACKET_SIZE];
- const char *buffer = NULL;
- int result = 0;
-
- struct termios mouse_termios;
-
- /* try to read the calibration values */
- buffer = SDL_getenv("SDL_ELO_MIN_X");
- if(buffer) {
- ELO_MIN_X = SDL_atoi(buffer);
- }
- buffer = SDL_getenv("SDL_ELO_MAX_X");
- if(buffer) {
- ELO_MAX_X = SDL_atoi(buffer);
- }
- buffer = SDL_getenv("SDL_ELO_MIN_Y");
- if(buffer) {
- ELO_MIN_Y = SDL_atoi(buffer);
- }
- buffer = SDL_getenv("SDL_ELO_MAX_Y");
- if(buffer) {
- ELO_MAX_Y = SDL_atoi(buffer);
- }
-
-#ifdef DEBUG_MOUSE
- fprintf( stderr, "ELO calibration values:\nmin_x: %i\nmax_x: %i\nmin_y: %i\nmax_y: %i\n",
- ELO_MIN_X,
- ELO_MAX_X,
- ELO_MIN_Y,
- ELO_MAX_Y);
-#endif
-
- /* set comm params */
- SDL_memset(&mouse_termios, 0, sizeof(mouse_termios));
- mouse_termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
- mouse_termios.c_cc[VMIN] = 1;
- result = tcsetattr(fd, TCSANOW, &mouse_termios);
-
- if (result < 0) {
-#ifdef DEBUG_MOUSE
- fprintf( stderr, "Unable to configure Elographics touchscreen port\n");
-#endif
- return 0;
- }
-
- SDL_memset(req, 0, ELO_PACKET_SIZE);
- req[1] = tolower(ELO_PARAMETER);
- if (!eloSendQuery(req, reply, fd)) {
-#ifdef DEBUG_MOUSE
- fprintf( stderr, "Not at the specified rate or model 2310, will continue\n");
-#endif
- }
-
- SDL_memset(req, 0, ELO_PACKET_SIZE);
- req[1] = tolower(ELO_ID);
- if (eloSendQuery(req, reply, fd)) {
-#ifdef DEBUG_MOUSE
- fprintf(stderr, "Ok, controller configured!\n");
-#endif
- }
- else {
-#ifdef DEBUG_MOUSE
- fprintf( stderr, "Unable to ask Elographics touchscreen identification\n");
-#endif
- return 0;
- }
-
- SDL_memset(req, 0, ELO_PACKET_SIZE);
- req[1] = ELO_MODE;
- req[3] = ELO_TOUCH_MODE | ELO_STREAM_MODE | ELO_UNTOUCH_MODE;
- req[4] = ELO_TRACKING_MODE;
- if (!eloSendControl(req, fd)) {
-#ifdef DEBUG_MOUSE
- fprintf( stderr, "Unable to change Elographics touchscreen operating mode\n");
-#endif
- return 0;
- }
-
- SDL_memset(req, 0, ELO_PACKET_SIZE);
- req[1] = ELO_REPORT;
- req[2] = ELO_UNTOUCH_DELAY;
- req[3] = ELO_REPORT_DELAY;
- if (!eloSendControl(req, fd)) {
-#ifdef DEBUG_MOUSE
- fprintf( stderr, "Unable to change Elographics touchscreen reports timings\n");
-#endif
- return 0;
- }
-
- return 1;
-}
-
-int eloReadPosition(_THIS, int fd, int* x, int* y, int* button_state, int* realx, int* realy) {
- unsigned char buffer[ELO_PACKET_SIZE];
- int pointer = 0;
- int checksum = ELO_INIT_CHECKSUM;
-
- while(pointer < ELO_PACKET_SIZE) {
- if(eloGetPacket(buffer, &pointer, &checksum, fd)) {
- break;
- }
- }
-
- if(!eloParsePacket(buffer, realx, realy, button_state)) {
- return 0;
- }
-
- *x = *realx;
- *y = *realy;
-
- eloConvertXY(this, x, y);
-
- return 1;
-}
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbelo.h b/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbelo.h
deleted file mode 100644
index 0046645..0000000
--- a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbelo.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef SDL_fbelo_h
-#define SDL_fbelo_h
-
-#include "SDL_fbvideo.h"
-
-/* ELO */
-#define ELO_PACKET_SIZE 10
-#define ELO_START_BYTE 'U'
-
-/* eloConvertXY
- Convert the raw coordinates from the ELO controller
- to a screen position.
-*/
-void eloConvertXY(_THIS, int *dx, int *dy);
-
-/* eloInitController(int fd)
- Initialize the ELO serial touchscreen controller
-*/
-int eloInitController(int fd);
-
-/* eloParsePacket
- extract position and button state from a packet
-*/
-int eloParsePacket(unsigned char* mousebuf, int* dx, int* dy, int* button_state);
-
-/* eloReadPosition
- read a packet and get the cursor position
-*/
-
-int eloReadPosition(_THIS, int fd, int* x, int* y, int* button_state, int* realx, int* realy);
-
-#endif /* SDL_fbelo_h */
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbevents.c b/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbevents.c
deleted file mode 100644
index b2e84b3..0000000
--- a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbevents.c
+++ /dev/null
@@ -1,1245 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Handle the event stream, converting console events into SDL events */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <limits.h>
-
-/* For parsing /proc */
-#include <dirent.h>
-#include <ctype.h>
-
-#include <linux/vt.h>
-#include <linux/kd.h>
-#include <linux/keyboard.h>
-
-#include "SDL_timer.h"
-#include "SDL_mutex.h"
-#include "../SDL_sysvideo.h"
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_fbvideo.h"
-#include "SDL_fbevents_c.h"
-#include "SDL_fbkeys.h"
-
-#include "SDL_fbelo.h"
-
-#ifndef GPM_NODE_FIFO
-#define GPM_NODE_FIFO "/dev/gpmdata"
-#endif
-
-/*#define DEBUG_KEYBOARD*/
-/*#define DEBUG_MOUSE*/
-
-/* The translation tables from a console scancode to a SDL keysym */
-#define NUM_VGAKEYMAPS (1<<KG_CAPSSHIFT)
-static Uint16 vga_keymap[NUM_VGAKEYMAPS][NR_KEYS];
-static SDLKey keymap[128];
-static Uint16 keymap_temp[128]; /* only used at startup */
-static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym);
-
-/* Ugh, we have to duplicate the kernel's keysym mapping code...
- Oh, it's not so bad. :-)
-
- FIXME: Add keyboard LED handling code
- */
-static void FB_vgainitkeymaps(int fd)
-{
- struct kbentry entry;
- int map, i;
-
- /* Don't do anything if we are passed a closed keyboard */
- if ( fd < 0 ) {
- return;
- }
-
- /* Load all the keysym mappings */
- for ( map=0; map<NUM_VGAKEYMAPS; ++map ) {
- SDL_memset(vga_keymap[map], 0, NR_KEYS*sizeof(Uint16));
- for ( i=0; i<NR_KEYS; ++i ) {
- entry.kb_table = map;
- entry.kb_index = i;
- if ( ioctl(fd, KDGKBENT, &entry) == 0 ) {
- /* fill keytemp. This replaces SDL_fbkeys.h */
- if ( (map == 0) && (i<128) ) {
- keymap_temp[i] = entry.kb_value;
- }
- /* The "Enter" key is a special case */
- if ( entry.kb_value == K_ENTER ) {
- entry.kb_value = K(KT_ASCII,13);
- }
- /* Handle numpad specially as well */
- if ( KTYP(entry.kb_value) == KT_PAD ) {
- switch ( entry.kb_value ) {
- case K_P0:
- case K_P1:
- case K_P2:
- case K_P3:
- case K_P4:
- case K_P5:
- case K_P6:
- case K_P7:
- case K_P8:
- case K_P9:
- vga_keymap[map][i]=entry.kb_value;
- vga_keymap[map][i]+= '0';
- break;
- case K_PPLUS:
- vga_keymap[map][i]=K(KT_ASCII,'+');
- break;
- case K_PMINUS:
- vga_keymap[map][i]=K(KT_ASCII,'-');
- break;
- case K_PSTAR:
- vga_keymap[map][i]=K(KT_ASCII,'*');
- break;
- case K_PSLASH:
- vga_keymap[map][i]=K(KT_ASCII,'/');
- break;
- case K_PENTER:
- vga_keymap[map][i]=K(KT_ASCII,'\r');
- break;
- case K_PCOMMA:
- vga_keymap[map][i]=K(KT_ASCII,',');
- break;
- case K_PDOT:
- vga_keymap[map][i]=K(KT_ASCII,'.');
- break;
- default:
- break;
- }
- }
- /* Do the normal key translation */
- if ( (KTYP(entry.kb_value) == KT_LATIN) ||
- (KTYP(entry.kb_value) == KT_ASCII) ||
- (KTYP(entry.kb_value) == KT_LETTER) ) {
- vga_keymap[map][i] = entry.kb_value;
- }
- }
- }
- }
-}
-
-int FB_InGraphicsMode(_THIS)
-{
- return((keyboard_fd >= 0) && (saved_kbd_mode >= 0));
-}
-
-int FB_EnterGraphicsMode(_THIS)
-{
- struct termios keyboard_termios;
-
- /* Set medium-raw keyboard mode */
- if ( (keyboard_fd >= 0) && !FB_InGraphicsMode(this) ) {
-
- /* Switch to the correct virtual terminal */
- if ( current_vt > 0 ) {
- struct vt_stat vtstate;
-
- if ( ioctl(keyboard_fd, VT_GETSTATE, &vtstate) == 0 ) {
- saved_vt = vtstate.v_active;
- }
- if ( ioctl(keyboard_fd, VT_ACTIVATE, current_vt) == 0 ) {
- ioctl(keyboard_fd, VT_WAITACTIVE, current_vt);
- }
- }
-
- /* Set the terminal input mode */
- if ( tcgetattr(keyboard_fd, &saved_kbd_termios) < 0 ) {
- SDL_SetError("Unable to get terminal attributes");
- if ( keyboard_fd > 0 ) {
- close(keyboard_fd);
- }
- keyboard_fd = -1;
- return(-1);
- }
- if ( ioctl(keyboard_fd, KDGKBMODE, &saved_kbd_mode) < 0 ) {
- SDL_SetError("Unable to get current keyboard mode");
- if ( keyboard_fd > 0 ) {
- close(keyboard_fd);
- }
- keyboard_fd = -1;
- return(-1);
- }
- keyboard_termios = saved_kbd_termios;
- keyboard_termios.c_lflag &= ~(ICANON | ECHO | ISIG);
- keyboard_termios.c_iflag &= ~(ISTRIP | IGNCR | ICRNL | INLCR | IXOFF | IXON);
- keyboard_termios.c_cc[VMIN] = 0;
- keyboard_termios.c_cc[VTIME] = 0;
- if (tcsetattr(keyboard_fd, TCSAFLUSH, &keyboard_termios) < 0) {
- FB_CloseKeyboard(this);
- SDL_SetError("Unable to set terminal attributes");
- return(-1);
- }
- /* This will fail if we aren't root or this isn't our tty */
- if ( ioctl(keyboard_fd, KDSKBMODE, K_MEDIUMRAW) < 0 ) {
- FB_CloseKeyboard(this);
- SDL_SetError("Unable to set keyboard in raw mode");
- return(-1);
- }
- if ( ioctl(keyboard_fd, KDSETMODE, KD_GRAPHICS) < 0 ) {
- FB_CloseKeyboard(this);
- SDL_SetError("Unable to set keyboard in graphics mode");
- return(-1);
- }
- /* Prevent switching the virtual terminal */
- ioctl(keyboard_fd, VT_LOCKSWITCH, 1);
- }
- return(keyboard_fd);
-}
-
-void FB_LeaveGraphicsMode(_THIS)
-{
- if ( FB_InGraphicsMode(this) ) {
- ioctl(keyboard_fd, KDSETMODE, KD_TEXT);
- ioctl(keyboard_fd, KDSKBMODE, saved_kbd_mode);
- tcsetattr(keyboard_fd, TCSAFLUSH, &saved_kbd_termios);
- saved_kbd_mode = -1;
-
- /* Head back over to the original virtual terminal */
- ioctl(keyboard_fd, VT_UNLOCKSWITCH, 1);
- if ( saved_vt > 0 ) {
- ioctl(keyboard_fd, VT_ACTIVATE, saved_vt);
- }
- }
-}
-
-void FB_CloseKeyboard(_THIS)
-{
- if ( keyboard_fd >= 0 ) {
- FB_LeaveGraphicsMode(this);
- if ( keyboard_fd > 0 ) {
- close(keyboard_fd);
- }
- }
- keyboard_fd = -1;
-}
-
-int FB_OpenKeyboard(_THIS)
-{
- /* Open only if not already opened */
- if ( keyboard_fd < 0 ) {
- static const char * const tty0[] = { "/dev/tty0", "/dev/vc/0", NULL };
- static const char * const vcs[] = { "/dev/vc/%d", "/dev/tty%d", NULL };
- int i, tty0_fd;
-
- /* Try to query for a free virtual terminal */
- tty0_fd = -1;
- for ( i=0; tty0[i] && (tty0_fd < 0); ++i ) {
- tty0_fd = open(tty0[i], O_WRONLY, 0);
- }
- if ( tty0_fd < 0 ) {
- tty0_fd = dup(0); /* Maybe stdin is a VT? */
- }
- ioctl(tty0_fd, VT_OPENQRY, &current_vt);
- close(tty0_fd);
- if ( (geteuid() == 0) && (current_vt > 0) ) {
- for ( i=0; vcs[i] && (keyboard_fd < 0); ++i ) {
- char vtpath[12];
-
- SDL_snprintf(vtpath, SDL_arraysize(vtpath), vcs[i], current_vt);
- keyboard_fd = open(vtpath, O_RDWR, 0);
-#ifdef DEBUG_KEYBOARD
- fprintf(stderr, "vtpath = %s, fd = %d\n",
- vtpath, keyboard_fd);
-#endif /* DEBUG_KEYBOARD */
-
- /* This needs to be our controlling tty
- so that the kernel ioctl() calls work
- */
- if ( keyboard_fd >= 0 ) {
- tty0_fd = open("/dev/tty", O_RDWR, 0);
- if ( tty0_fd >= 0 ) {
- ioctl(tty0_fd, TIOCNOTTY, 0);
- close(tty0_fd);
- }
- }
- }
- }
- if ( keyboard_fd < 0 ) {
- /* Last resort, maybe our tty is a usable VT */
- struct vt_stat vtstate;
-
- keyboard_fd = open("/dev/tty", O_RDWR);
-
- if ( ioctl(keyboard_fd, VT_GETSTATE, &vtstate) == 0 ) {
- current_vt = vtstate.v_active;
- } else {
- current_vt = 0;
- }
- }
-#ifdef DEBUG_KEYBOARD
- fprintf(stderr, "Current VT: %d\n", current_vt);
-#endif
- saved_kbd_mode = -1;
-
- /* Make sure that our input is a console terminal */
- { int dummy;
- if ( ioctl(keyboard_fd, KDGKBMODE, &dummy) < 0 ) {
- close(keyboard_fd);
- keyboard_fd = -1;
- SDL_SetError("Unable to open a console terminal");
- }
- }
-
- /* Set up keymap */
- FB_vgainitkeymaps(keyboard_fd);
- }
- return(keyboard_fd);
-}
-
-static enum {
- MOUSE_NONE = -1,
- MOUSE_MSC, /* Note: GPM uses the MSC protocol */
- MOUSE_PS2,
- MOUSE_IMPS2,
- MOUSE_MS,
- MOUSE_BM,
- MOUSE_ELO,
- MOUSE_TSLIB,
- NUM_MOUSE_DRVS
-} mouse_drv = MOUSE_NONE;
-
-void FB_CloseMouse(_THIS)
-{
-#if SDL_INPUT_TSLIB
- if (ts_dev != NULL) {
- ts_close(ts_dev);
- ts_dev = NULL;
- mouse_fd = -1;
- }
-#endif /* SDL_INPUT_TSLIB */
- if ( mouse_fd > 0 ) {
- close(mouse_fd);
- }
- mouse_fd = -1;
-}
-
-/* Returns processes listed in /proc with the desired name */
-static int find_pid(DIR *proc, const char *wanted_name)
-{
- struct dirent *entry;
- int pid;
-
- /* First scan proc for the gpm process */
- pid = 0;
- while ( (pid == 0) && ((entry=readdir(proc)) != NULL) ) {
- if ( isdigit(entry->d_name[0]) ) {
- FILE *status;
- char path[PATH_MAX];
- char name[PATH_MAX];
-
- SDL_snprintf(path, SDL_arraysize(path), "/proc/%s/status", entry->d_name);
- status=fopen(path, "r");
- if ( status ) {
- name[0] = '\0';
- fscanf(status, "Name: %s", name);
- if ( SDL_strcmp(name, wanted_name) == 0 ) {
- pid = SDL_atoi(entry->d_name);
- }
- fclose(status);
- }
- }
- }
- return pid;
-}
-
-/* Returns true if /dev/gpmdata is being written to by gpm */
-static int gpm_available(char *proto, size_t protolen)
-{
- int available;
- DIR *proc;
- int pid;
- int cmdline, len, arglen;
- char path[PATH_MAX];
- char args[PATH_MAX], *arg;
-
- /* Don't bother looking if the fifo isn't there */
-#ifdef DEBUG_MOUSE
- fprintf(stderr,"testing gpm\n");
-#endif
- if ( access(GPM_NODE_FIFO, F_OK) < 0 ) {
- return(0);
- }
-
- available = 0;
- proc = opendir("/proc");
- if ( proc ) {
- char raw_proto[10] = { '\0' };
- char repeat_proto[10] = { '\0' };
- while ( !available && (pid=find_pid(proc, "gpm")) > 0 ) {
- SDL_snprintf(path, SDL_arraysize(path), "/proc/%d/cmdline", pid);
- cmdline = open(path, O_RDONLY, 0);
- if ( cmdline >= 0 ) {
- len = read(cmdline, args, sizeof(args));
- arg = args;
- while ( len > 0 ) {
- arglen = SDL_strlen(arg)+1;
-#ifdef DEBUG_MOUSE
- fprintf(stderr,"gpm arg %s len %d\n",arg,arglen);
-#endif
- if ( SDL_strcmp(arg, "-t") == 0) {
- /* protocol string, keep it for later */
- char *t, *s;
- t = arg + arglen;
- s = SDL_strchr(t, ' ');
- if (s) *s = 0;
- SDL_strlcpy(raw_proto, t, SDL_arraysize(raw_proto));
- if (s) *s = ' ';
- }
- if ( SDL_strncmp(arg, "-R", 2) == 0 ) {
- char *t, *s;
- available = 1;
- t = arg + 2;
- s = SDL_strchr(t, ' ');
- if (s) *s = 0;
- SDL_strlcpy(repeat_proto, t, SDL_arraysize(repeat_proto));
- if (s) *s = ' ';
- }
- len -= arglen;
- arg += arglen;
- }
- close(cmdline);
- }
- }
- closedir(proc);
-
- if ( available ) {
- if ( SDL_strcmp(repeat_proto, "raw") == 0 ) {
- SDL_strlcpy(proto, raw_proto, protolen);
- } else if ( *repeat_proto ) {
- SDL_strlcpy(proto, repeat_proto, protolen);
- } else {
- SDL_strlcpy(proto, "msc", protolen);
- }
- }
- }
- return available;
-}
-
-
-/* rcg06112001 Set up IMPS/2 mode, if possible. This gives
- * us access to the mousewheel, etc. Returns zero if
- * writes to device failed, but you still need to query the
- * device to see which mode it's actually in.
- */
-static int set_imps2_mode(int fd)
-{
- /* If you wanted to control the mouse mode (and we do :) ) ...
- Set IMPS/2 protocol:
- {0xf3,200,0xf3,100,0xf3,80}
- Reset mouse device:
- {0xFF}
- */
- Uint8 set_imps2[] = {0xf3, 200, 0xf3, 100, 0xf3, 80};
- /*Uint8 reset = 0xff;*/
- fd_set fdset;
- struct timeval tv;
- int retval = 0;
-
- if ( write(fd, &set_imps2, sizeof(set_imps2)) == sizeof(set_imps2) ) {
- /* Don't reset it, that'll clear IMPS/2 mode on some mice
- if (write(fd, &reset, sizeof (reset)) == sizeof (reset) ) {
- retval = 1;
- }
- */
- }
-
- /* Get rid of any chatter from the above */
- FD_ZERO(&fdset);
- FD_SET(fd, &fdset);
- tv.tv_sec = 0;
- tv.tv_usec = 0;
- while ( select(fd+1, &fdset, 0, 0, &tv) > 0 ) {
- char temp[32];
- read(fd, temp, sizeof(temp));
- }
-
- return retval;
-}
-
-
-/* Returns true if the mouse uses the IMPS/2 protocol */
-static int detect_imps2(int fd)
-{
- int imps2;
-
- imps2 = 0;
-
- if ( SDL_getenv("SDL_MOUSEDEV_IMPS2") ) {
- imps2 = 1;
- }
- if ( ! imps2 ) {
- Uint8 query_ps2 = 0xF2;
- fd_set fdset;
- struct timeval tv;
-
- /* Get rid of any mouse motion noise */
- FD_ZERO(&fdset);
- FD_SET(fd, &fdset);
- tv.tv_sec = 0;
- tv.tv_usec = 0;
- while ( select(fd+1, &fdset, 0, 0, &tv) > 0 ) {
- char temp[32];
- read(fd, temp, sizeof(temp));
- }
-
- /* Query for the type of mouse protocol */
- if ( write(fd, &query_ps2, sizeof (query_ps2)) == sizeof (query_ps2)) {
- Uint8 ch = 0;
-
- /* Get the mouse protocol response */
- do {
- FD_ZERO(&fdset);
- FD_SET(fd, &fdset);
- tv.tv_sec = 1;
- tv.tv_usec = 0;
- if ( select(fd+1, &fdset, 0, 0, &tv) < 1 ) {
- break;
- }
- } while ( (read(fd, &ch, sizeof (ch)) == sizeof (ch)) &&
- ((ch == 0xFA) || (ch == 0xAA)) );
-
- /* Experimental values (Logitech wheelmouse) */
-#ifdef DEBUG_MOUSE
-fprintf(stderr, "Last mouse mode: 0x%x\n", ch);
-#endif
- if ( (ch == 3) || (ch == 4) ) {
- imps2 = 1;
- }
- }
- }
- return imps2;
-}
-
-int FB_OpenMouse(_THIS)
-{
- int i;
- const char *mousedev;
- const char *mousedrv;
-
- mousedrv = SDL_getenv("SDL_MOUSEDRV");
- mousedev = SDL_getenv("SDL_MOUSEDEV");
- mouse_fd = -1;
-
-#if SDL_INPUT_TSLIB
- if ( mousedrv && (SDL_strcmp(mousedrv, "TSLIB") == 0) ) {
- if (mousedev == NULL) mousedev = SDL_getenv("TSLIB_TSDEVICE");
- if (mousedev != NULL) {
- ts_dev = ts_open(mousedev, 1);
- if ((ts_dev != NULL) && (ts_config(ts_dev) >= 0)) {
-#ifdef DEBUG_MOUSE
- fprintf(stderr, "Using tslib touchscreen\n");
-#endif
- mouse_drv = MOUSE_TSLIB;
- mouse_fd = ts_fd(ts_dev);
- return mouse_fd;
- }
- }
- mouse_drv = MOUSE_NONE;
- return mouse_fd;
- }
-#endif /* SDL_INPUT_TSLIB */
-
- /* ELO TOUCHSCREEN SUPPORT */
-
- if ( mousedrv && (SDL_strcmp(mousedrv, "ELO") == 0) ) {
- mouse_fd = open(mousedev, O_RDWR);
- if ( mouse_fd >= 0 ) {
- if(eloInitController(mouse_fd)) {
-#ifdef DEBUG_MOUSE
-fprintf(stderr, "Using ELO touchscreen\n");
-#endif
- mouse_drv = MOUSE_ELO;
- }
-
- }
- else if ( mouse_fd < 0 ) {
- mouse_drv = MOUSE_NONE;
- }
-
- return(mouse_fd);
- }
-
- /* STD MICE */
-
- if ( mousedev == NULL ) {
- /* FIXME someday... allow multiple mice in this driver */
- static const char *ps2mice[] = {
- "/dev/input/mice", "/dev/usbmouse", "/dev/psaux", NULL
- };
- /* First try to use GPM in repeater mode */
- if ( mouse_fd < 0 ) {
- char proto[10];
- if ( gpm_available(proto, SDL_arraysize(proto)) ) {
- mouse_fd = open(GPM_NODE_FIFO, O_RDONLY, 0);
- if ( mouse_fd >= 0 ) {
- if ( SDL_strcmp(proto, "msc") == 0 ) {
- mouse_drv = MOUSE_MSC;
- } else if ( SDL_strcmp(proto, "ps2") == 0 ) {
- mouse_drv = MOUSE_PS2;
- } else if ( SDL_strcmp(proto, "imps2") == 0 ) {
- mouse_drv = MOUSE_IMPS2;
- } else if ( SDL_strcmp(proto, "ms") == 0 ||
- SDL_strcmp(proto, "bare") == 0 ) {
- mouse_drv = MOUSE_MS;
- } else if ( SDL_strcmp(proto, "bm") == 0 ) {
- mouse_drv = MOUSE_BM;
- } else {
- /* Unknown protocol... */
-#ifdef DEBUG_MOUSE
- fprintf(stderr, "GPM mouse using unknown protocol = %s\n", proto);
-#endif
- close(mouse_fd);
- mouse_fd = -1;
- }
- }
-#ifdef DEBUG_MOUSE
- if ( mouse_fd >= 0 ) {
- fprintf(stderr, "Using GPM mouse, protocol = %s\n", proto);
- }
-#endif /* DEBUG_MOUSE */
- }
- }
- /* Now try to use a modern PS/2 mouse */
- for ( i=0; (mouse_fd < 0) && ps2mice[i]; ++i ) {
- mouse_fd = open(ps2mice[i], O_RDWR, 0);
- if (mouse_fd < 0) {
- mouse_fd = open(ps2mice[i], O_RDONLY, 0);
- }
- if (mouse_fd >= 0) {
- /* rcg06112001 Attempt to set IMPS/2 mode */
- set_imps2_mode(mouse_fd);
- if (detect_imps2(mouse_fd)) {
-#ifdef DEBUG_MOUSE
-fprintf(stderr, "Using IMPS2 mouse\n");
-#endif
- mouse_drv = MOUSE_IMPS2;
- } else {
-#ifdef DEBUG_MOUSE
-fprintf(stderr, "Using PS2 mouse\n");
-#endif
- mouse_drv = MOUSE_PS2;
- }
- }
- }
- /* Next try to use a PPC ADB port mouse */
- if ( mouse_fd < 0 ) {
- mouse_fd = open("/dev/adbmouse", O_RDONLY, 0);
- if ( mouse_fd >= 0 ) {
-#ifdef DEBUG_MOUSE
-fprintf(stderr, "Using ADB mouse\n");
-#endif
- mouse_drv = MOUSE_BM;
- }
- }
- }
- /* Default to a serial Microsoft mouse */
- if ( mouse_fd < 0 ) {
- if ( mousedev == NULL ) {
- mousedev = "/dev/mouse";
- }
- mouse_fd = open(mousedev, O_RDONLY, 0);
- if ( mouse_fd >= 0 ) {
- struct termios mouse_termios;
-
- /* Set the sampling speed to 1200 baud */
- tcgetattr(mouse_fd, &mouse_termios);
- mouse_termios.c_iflag = IGNBRK | IGNPAR;
- mouse_termios.c_oflag = 0;
- mouse_termios.c_lflag = 0;
- mouse_termios.c_line = 0;
- mouse_termios.c_cc[VTIME] = 0;
- mouse_termios.c_cc[VMIN] = 1;
- mouse_termios.c_cflag = CREAD | CLOCAL | HUPCL;
- mouse_termios.c_cflag |= CS8;
- mouse_termios.c_cflag |= B1200;
- tcsetattr(mouse_fd, TCSAFLUSH, &mouse_termios);
- if ( mousedrv && (SDL_strcmp(mousedrv, "PS2") == 0) ) {
-#ifdef DEBUG_MOUSE
-fprintf(stderr, "Using (user specified) PS2 mouse on %s\n", mousedev);
-#endif
- mouse_drv = MOUSE_PS2;
- } else {
-#ifdef DEBUG_MOUSE
-fprintf(stderr, "Using (default) MS mouse on %s\n", mousedev);
-#endif
- mouse_drv = MOUSE_MS;
- }
- }
- }
- if ( mouse_fd < 0 ) {
- mouse_drv = MOUSE_NONE;
- }
- return(mouse_fd);
-}
-
-static int posted = 0;
-
-void FB_vgamousecallback(int button, int relative, int dx, int dy)
-{
- int button_1, button_3;
- int button_state;
- int state_changed;
- int i;
- Uint8 state;
-
- if ( dx || dy ) {
- posted += SDL_PrivateMouseMotion(0, relative, dx, dy);
- }
-
- /* Swap button 1 and 3 */
- button_1 = (button & 0x04) >> 2;
- button_3 = (button & 0x01) << 2;
- button &= ~0x05;
- button |= (button_1|button_3);
-
- /* See what changed */
- button_state = SDL_GetMouseState(NULL, NULL);
- state_changed = button_state ^ button;
- for ( i=0; i<8; ++i ) {
- if ( state_changed & (1<<i) ) {
- if ( button & (1<<i) ) {
- state = SDL_PRESSED;
- } else {
- state = SDL_RELEASED;
- }
- posted += SDL_PrivateMouseButton(state, i+1, 0, 0);
- }
- }
-}
-
-/* Handle input from tslib */
-#if SDL_INPUT_TSLIB
-static void handle_tslib(_THIS)
-{
- struct ts_sample sample;
- int button;
-
- while (ts_read(ts_dev, &sample, 1) > 0) {
- button = (sample.pressure > 0) ? 1 : 0;
- button <<= 2; /* must report it as button 3 */
- FB_vgamousecallback(button, 0, sample.x, sample.y);
- }
- return;
-}
-#endif /* SDL_INPUT_TSLIB */
-
-/* For now, use MSC, PS/2, and MS protocols
- Driver adapted from the SVGAlib mouse driver code (taken from gpm, etc.)
- */
-static void handle_mouse(_THIS)
-{
- static int start = 0;
- static unsigned char mousebuf[BUFSIZ];
- static int relative = 1;
-
- int i, nread;
- int button = 0;
- int dx = 0, dy = 0;
- int packetsize = 0;
- int realx, realy;
-
- /* Figure out the mouse packet size */
- switch (mouse_drv) {
- case MOUSE_NONE:
- /* Ack! */
- read(mouse_fd, mousebuf, BUFSIZ);
- return;
- case MOUSE_MSC:
- packetsize = 5;
- break;
- case MOUSE_IMPS2:
- packetsize = 4;
- break;
- case MOUSE_PS2:
- case MOUSE_MS:
- case MOUSE_BM:
- packetsize = 3;
- break;
- case MOUSE_ELO:
- /* try to read the next packet */
- if(eloReadPosition(this, mouse_fd, &dx, &dy, &button, &realx, &realy)) {
- button = (button & 0x01) << 2;
- FB_vgamousecallback(button, 0, dx, dy);
- }
- return; /* nothing left to do */
- case MOUSE_TSLIB:
-#if SDL_INPUT_TSLIB
- handle_tslib(this);
-#endif
- return; /* nothing left to do */
- default:
- /* Uh oh.. */
- packetsize = 0;
- break;
- }
-
- /* Special handling for the quite sensitive ELO controller */
- if (mouse_drv == MOUSE_ELO) {
-
- }
-
- /* Read as many packets as possible */
- nread = read(mouse_fd, &mousebuf[start], BUFSIZ-start);
- if ( nread < 0 ) {
- return;
- }
- nread += start;
-#ifdef DEBUG_MOUSE
- fprintf(stderr, "Read %d bytes from mouse, start = %d\n", nread, start);
-#endif
- for ( i=0; i<(nread-(packetsize-1)); i += packetsize ) {
- switch (mouse_drv) {
- case MOUSE_NONE:
- break;
- case MOUSE_MSC:
- /* MSC protocol has 0x80 in high byte */
- if ( (mousebuf[i] & 0xF8) != 0x80 ) {
- /* Go to next byte */
- i -= (packetsize-1);
- continue;
- }
- /* Get current mouse state */
- button = (~mousebuf[i]) & 0x07;
- dx = (signed char)(mousebuf[i+1]) +
- (signed char)(mousebuf[i+3]);
- dy = -((signed char)(mousebuf[i+2]) +
- (signed char)(mousebuf[i+4]));
- break;
- case MOUSE_PS2:
- /* PS/2 protocol has nothing in high byte */
- if ( (mousebuf[i] & 0xC0) != 0 ) {
- /* Go to next byte */
- i -= (packetsize-1);
- continue;
- }
- /* Get current mouse state */
- button = (mousebuf[i] & 0x04) >> 1 | /*Middle*/
- (mousebuf[i] & 0x02) >> 1 | /*Right*/
- (mousebuf[i] & 0x01) << 2; /*Left*/
- dx = (mousebuf[i] & 0x10) ?
- mousebuf[i+1] - 256 : mousebuf[i+1];
- dy = (mousebuf[i] & 0x20) ?
- -(mousebuf[i+2] - 256) : -mousebuf[i+2];
- break;
- case MOUSE_IMPS2:
- /* Get current mouse state */
- button = (mousebuf[i] & 0x04) >> 1 | /*Middle*/
- (mousebuf[i] & 0x02) >> 1 | /*Right*/
- (mousebuf[i] & 0x01) << 2 | /*Left*/
- (mousebuf[i] & 0x40) >> 3 | /* 4 */
- (mousebuf[i] & 0x80) >> 3; /* 5 */
- dx = (mousebuf[i] & 0x10) ?
- mousebuf[i+1] - 256 : mousebuf[i+1];
- dy = (mousebuf[i] & 0x20) ?
- -(mousebuf[i+2] - 256) : -mousebuf[i+2];
- switch (mousebuf[i+3]&0x0F) {
- case 0x0E: /* DX = +1 */
- case 0x02: /* DX = -1 */
- break;
- case 0x0F: /* DY = +1 (map button 4) */
- FB_vgamousecallback(button | (1<<3),
- 1, 0, 0);
- break;
- case 0x01: /* DY = -1 (map button 5) */
- FB_vgamousecallback(button | (1<<4),
- 1, 0, 0);
- break;
- }
- break;
- case MOUSE_MS:
- /* Microsoft protocol has 0x40 in high byte */
- if ( (mousebuf[i] & 0x40) != 0x40 ) {
- /* Go to next byte */
- i -= (packetsize-1);
- continue;
- }
- /* Get current mouse state */
- button = ((mousebuf[i] & 0x20) >> 3) |
- ((mousebuf[i] & 0x10) >> 4);
- dx = (signed char)(((mousebuf[i] & 0x03) << 6) |
- (mousebuf[i + 1] & 0x3F));
- dy = (signed char)(((mousebuf[i] & 0x0C) << 4) |
- (mousebuf[i + 2] & 0x3F));
- break;
- case MOUSE_BM:
- /* BusMouse protocol has 0xF8 in high byte */
- if ( (mousebuf[i] & 0xF8) != 0x80 ) {
- /* Go to next byte */
- i -= (packetsize-1);
- continue;
- }
- /* Get current mouse state */
- button = (~mousebuf[i]) & 0x07;
- dx = (signed char)mousebuf[i+1];
- dy = -(signed char)mousebuf[i+2];
- break;
- default:
- /* Uh oh.. */
- dx = 0;
- dy = 0;
- break;
- }
- FB_vgamousecallback(button, relative, dx, dy);
- }
- if ( i < nread ) {
- SDL_memcpy(mousebuf, &mousebuf[i], (nread-i));
- start = (nread-i);
- } else {
- start = 0;
- }
- return;
-}
-
-/* Handle switching to another VC, returns when our VC is back */
-static void switch_vt_prep(_THIS)
-{
- SDL_Surface *screen = SDL_VideoSurface;
-
- SDL_PrivateAppActive(0, (SDL_APPACTIVE|SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS));
-
- /* Save the contents of the screen, and go to text mode */
- wait_idle(this);
- screen_arealen = ((screen->h + (2*this->offset_y)) * screen->pitch);
- screen_contents = (Uint8 *)SDL_malloc(screen_arealen);
- if ( screen_contents ) {
- SDL_memcpy(screen_contents, screen->pixels, screen_arealen);
- }
- FB_SavePaletteTo(this, 256, screen_palette);
- ioctl(console_fd, FBIOGET_VSCREENINFO, &screen_vinfo);
- ioctl(keyboard_fd, KDSETMODE, KD_TEXT);
- ioctl(keyboard_fd, VT_UNLOCKSWITCH, 1);
-}
-static void switch_vt_done(_THIS)
-{
- SDL_Surface *screen = SDL_VideoSurface;
-
- /* Restore graphics mode and the contents of the screen */
- ioctl(keyboard_fd, VT_LOCKSWITCH, 1);
- ioctl(keyboard_fd, KDSETMODE, KD_GRAPHICS);
- ioctl(console_fd, FBIOPUT_VSCREENINFO, &screen_vinfo);
- FB_RestorePaletteFrom(this, 256, screen_palette);
- if ( screen_contents ) {
- SDL_memcpy(screen->pixels, screen_contents, screen_arealen);
- SDL_free(screen_contents);
- screen_contents = NULL;
- }
-
- /* Get updates to the shadow surface while switched away */
- if ( SDL_ShadowSurface ) {
- SDL_UpdateRect(SDL_ShadowSurface, 0, 0, 0, 0);
- }
-
- SDL_PrivateAppActive(1, (SDL_APPACTIVE|SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS));
-}
-static void switch_vt(_THIS, unsigned short which)
-{
- struct vt_stat vtstate;
-
- /* Figure out whether or not we're switching to a new console */
- if ( (ioctl(keyboard_fd, VT_GETSTATE, &vtstate) < 0) ||
- (which == vtstate.v_active) ) {
- return;
- }
-
- /* New console, switch to it */
- SDL_mutexP(hw_lock);
- switch_vt_prep(this);
- if ( ioctl(keyboard_fd, VT_ACTIVATE, which) == 0 ) {
- ioctl(keyboard_fd, VT_WAITACTIVE, which);
- switched_away = 1;
- } else {
- switch_vt_done(this);
- }
- SDL_mutexV(hw_lock);
-}
-
-static void handle_keyboard(_THIS)
-{
- unsigned char keybuf[BUFSIZ];
- int i, nread;
- int pressed;
- int scancode;
- SDL_keysym keysym;
-
- nread = read(keyboard_fd, keybuf, BUFSIZ);
- for ( i=0; i<nread; ++i ) {
- scancode = keybuf[i] & 0x7F;
- if ( keybuf[i] & 0x80 ) {
- pressed = SDL_RELEASED;
- } else {
- pressed = SDL_PRESSED;
- }
- TranslateKey(scancode, &keysym);
- /* Handle Ctrl-Alt-FN for vt switch */
- switch (keysym.sym) {
- case SDLK_F1:
- case SDLK_F2:
- case SDLK_F3:
- case SDLK_F4:
- case SDLK_F5:
- case SDLK_F6:
- case SDLK_F7:
- case SDLK_F8:
- case SDLK_F9:
- case SDLK_F10:
- case SDLK_F11:
- case SDLK_F12:
- if ( (SDL_GetModState() & KMOD_CTRL) &&
- (SDL_GetModState() & KMOD_ALT) ) {
- if ( pressed ) {
- switch_vt(this, (keysym.sym-SDLK_F1)+1);
- }
- break;
- }
- /* Fall through to normal processing */
- default:
- posted += SDL_PrivateKeyboard(pressed, &keysym);
- break;
- }
- }
-}
-
-void FB_PumpEvents(_THIS)
-{
- fd_set fdset;
- int max_fd;
- static struct timeval zero;
-
- do {
- if ( switched_away ) {
- struct vt_stat vtstate;
-
- SDL_mutexP(hw_lock);
- if ( (ioctl(keyboard_fd, VT_GETSTATE, &vtstate) == 0) &&
- vtstate.v_active == current_vt ) {
- switched_away = 0;
- switch_vt_done(this);
- }
- SDL_mutexV(hw_lock);
- }
-
- posted = 0;
-
- FD_ZERO(&fdset);
- max_fd = 0;
- if ( keyboard_fd >= 0 ) {
- FD_SET(keyboard_fd, &fdset);
- if ( max_fd < keyboard_fd ) {
- max_fd = keyboard_fd;
- }
- }
- if ( mouse_fd >= 0 ) {
- FD_SET(mouse_fd, &fdset);
- if ( max_fd < mouse_fd ) {
- max_fd = mouse_fd;
- }
- }
- if ( select(max_fd+1, &fdset, NULL, NULL, &zero) > 0 ) {
- if ( keyboard_fd >= 0 ) {
- if ( FD_ISSET(keyboard_fd, &fdset) ) {
- handle_keyboard(this);
- }
- }
- if ( mouse_fd >= 0 ) {
- if ( FD_ISSET(mouse_fd, &fdset) ) {
- handle_mouse(this);
- }
- }
- }
- } while ( posted );
-}
-
-void FB_InitOSKeymap(_THIS)
-{
- int i;
-
- /* Initialize the Linux key translation table */
-
- /* First get the ascii keys and others not well handled */
- for (i=0; i<SDL_arraysize(keymap); ++i) {
- switch(i) {
- /* These aren't handled by the x86 kernel keymapping (?) */
- case SCANCODE_PRINTSCREEN:
- keymap[i] = SDLK_PRINT;
- break;
- case SCANCODE_BREAK:
- keymap[i] = SDLK_BREAK;
- break;
- case SCANCODE_BREAK_ALTERNATIVE:
- keymap[i] = SDLK_PAUSE;
- break;
- case SCANCODE_LEFTSHIFT:
- keymap[i] = SDLK_LSHIFT;
- break;
- case SCANCODE_RIGHTSHIFT:
- keymap[i] = SDLK_RSHIFT;
- break;
- case SCANCODE_LEFTCONTROL:
- keymap[i] = SDLK_LCTRL;
- break;
- case SCANCODE_RIGHTCONTROL:
- keymap[i] = SDLK_RCTRL;
- break;
- case SCANCODE_RIGHTWIN:
- keymap[i] = SDLK_RSUPER;
- break;
- case SCANCODE_LEFTWIN:
- keymap[i] = SDLK_LSUPER;
- break;
- case SCANCODE_LEFTALT:
- keymap[i] = SDLK_LALT;
- break;
- case SCANCODE_RIGHTALT:
- keymap[i] = SDLK_RALT;
- break;
- case 127:
- keymap[i] = SDLK_MENU;
- break;
- /* this should take care of all standard ascii keys */
- default:
- keymap[i] = KVAL(vga_keymap[0][i]);
- break;
- }
- }
- for (i=0; i<SDL_arraysize(keymap); ++i) {
- switch(keymap_temp[i]) {
- case K_F1: keymap[i] = SDLK_F1; break;
- case K_F2: keymap[i] = SDLK_F2; break;
- case K_F3: keymap[i] = SDLK_F3; break;
- case K_F4: keymap[i] = SDLK_F4; break;
- case K_F5: keymap[i] = SDLK_F5; break;
- case K_F6: keymap[i] = SDLK_F6; break;
- case K_F7: keymap[i] = SDLK_F7; break;
- case K_F8: keymap[i] = SDLK_F8; break;
- case K_F9: keymap[i] = SDLK_F9; break;
- case K_F10: keymap[i] = SDLK_F10; break;
- case K_F11: keymap[i] = SDLK_F11; break;
- case K_F12: keymap[i] = SDLK_F12; break;
-
- case K_DOWN: keymap[i] = SDLK_DOWN; break;
- case K_LEFT: keymap[i] = SDLK_LEFT; break;
- case K_RIGHT: keymap[i] = SDLK_RIGHT; break;
- case K_UP: keymap[i] = SDLK_UP; break;
-
- case K_P0: keymap[i] = SDLK_KP0; break;
- case K_P1: keymap[i] = SDLK_KP1; break;
- case K_P2: keymap[i] = SDLK_KP2; break;
- case K_P3: keymap[i] = SDLK_KP3; break;
- case K_P4: keymap[i] = SDLK_KP4; break;
- case K_P5: keymap[i] = SDLK_KP5; break;
- case K_P6: keymap[i] = SDLK_KP6; break;
- case K_P7: keymap[i] = SDLK_KP7; break;
- case K_P8: keymap[i] = SDLK_KP8; break;
- case K_P9: keymap[i] = SDLK_KP9; break;
- case K_PPLUS: keymap[i] = SDLK_KP_PLUS; break;
- case K_PMINUS: keymap[i] = SDLK_KP_MINUS; break;
- case K_PSTAR: keymap[i] = SDLK_KP_MULTIPLY; break;
- case K_PSLASH: keymap[i] = SDLK_KP_DIVIDE; break;
- case K_PENTER: keymap[i] = SDLK_KP_ENTER; break;
- case K_PDOT: keymap[i] = SDLK_KP_PERIOD; break;
-
- case K_SHIFT: if ( keymap[i] != SDLK_RSHIFT )
- keymap[i] = SDLK_LSHIFT;
- break;
- case K_SHIFTL: keymap[i] = SDLK_LSHIFT; break;
- case K_SHIFTR: keymap[i] = SDLK_RSHIFT; break;
- case K_CTRL: if ( keymap[i] != SDLK_RCTRL )
- keymap[i] = SDLK_LCTRL;
- break;
- case K_CTRLL: keymap[i] = SDLK_LCTRL; break;
- case K_CTRLR: keymap[i] = SDLK_RCTRL; break;
- case K_ALT: keymap[i] = SDLK_LALT; break;
- case K_ALTGR: keymap[i] = SDLK_RALT; break;
-
- case K_INSERT: keymap[i] = SDLK_INSERT; break;
- case K_REMOVE: keymap[i] = SDLK_DELETE; break;
- case K_PGUP: keymap[i] = SDLK_PAGEUP; break;
- case K_PGDN: keymap[i] = SDLK_PAGEDOWN; break;
- case K_FIND: keymap[i] = SDLK_HOME; break;
- case K_SELECT: keymap[i] = SDLK_END; break;
-
- case K_NUM: keymap[i] = SDLK_NUMLOCK; break;
- case K_CAPS: keymap[i] = SDLK_CAPSLOCK; break;
-
- case K_F13: keymap[i] = SDLK_PRINT; break;
- case K_HOLD: keymap[i] = SDLK_SCROLLOCK; break;
- case K_PAUSE: keymap[i] = SDLK_PAUSE; break;
-
- case 127: keymap[i] = SDLK_BACKSPACE; break;
-
- default: break;
- }
- }
-}
-
-static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym)
-{
- /* Set the keysym information */
- keysym->scancode = scancode;
- keysym->sym = keymap[scancode];
- keysym->mod = KMOD_NONE;
-
- /* If UNICODE is on, get the UNICODE value for the key */
- keysym->unicode = 0;
- if ( SDL_TranslateUNICODE ) {
- int map;
- SDLMod modstate;
-
- modstate = SDL_GetModState();
- map = 0;
- if ( modstate & KMOD_SHIFT ) {
- map |= (1<<KG_SHIFT);
- }
- if ( modstate & KMOD_CTRL ) {
- map |= (1<<KG_CTRL);
- }
- if ( modstate & KMOD_LALT ) {
- map |= (1<<KG_ALT);
- }
- if ( modstate & KMOD_RALT ) {
- map |= (1<<KG_ALTGR);
- }
- if ( KTYP(vga_keymap[map][scancode]) == KT_LETTER ) {
- if ( modstate & KMOD_CAPS ) {
- map ^= (1<<KG_SHIFT);
- }
- }
- if ( KTYP(vga_keymap[map][scancode]) == KT_PAD ) {
- if ( modstate & KMOD_NUM ) {
- keysym->unicode=KVAL(vga_keymap[map][scancode]);
- }
- } else {
- keysym->unicode = KVAL(vga_keymap[map][scancode]);
- }
- }
- return(keysym);
-}
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbevents_c.h b/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbevents_c.h
deleted file mode 100644
index 99166bd..0000000
--- a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbevents_c.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_fbvideo.h"
-
-/* Variables and functions exported by SDL_sysevents.c to other parts
- of the native video subsystem (SDL_sysvideo.c)
-*/
-extern int FB_OpenKeyboard(_THIS);
-extern void FB_CloseKeyboard(_THIS);
-extern int FB_OpenMouse(_THIS);
-extern void FB_CloseMouse(_THIS);
-extern int FB_EnterGraphicsMode(_THIS);
-extern int FB_InGraphicsMode(_THIS);
-extern void FB_LeaveGraphicsMode(_THIS);
-
-extern void FB_InitOSKeymap(_THIS);
-extern void FB_PumpEvents(_THIS);
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbmatrox.c b/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbmatrox.c
deleted file mode 100644
index 177131a..0000000
--- a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbmatrox.c
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-#include "../SDL_blit.h"
-#include "SDL_fbmatrox.h"
-#include "matrox_mmio.h"
-
-
-/* Wait for vertical retrace - taken from the XFree86 Matrox driver */
-static void WaitVBL(_THIS)
-{
- int count;
-
- /* find start of retrace */
- mga_waitidle();
- while ( (mga_in8(0x1FDA) & 0x08) )
- ;
- while ( !(mga_in8(0x1FDA) & 0x08) )
- ;
- /* wait until we're past the start */
- count = mga_in32(0x1E20) + 2;
- while ( mga_in32(0x1E20) < count )
- ;
-}
-static void WaitIdle(_THIS)
-{
- mga_waitidle();
-}
-
-/* Sets video mem colorkey and accelerated blit function */
-static int SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key)
-{
- return(0);
-}
-
-/* Sets per surface hardware alpha value */
-#if 0
-static int SetHWAlpha(_THIS, SDL_Surface *surface, Uint8 value)
-{
- return(0);
-}
-#endif
-
-static int FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color)
-{
- int dstX, dstY;
- Uint32 fxbndry;
- Uint32 ydstlen;
- Uint32 fillop;
-
- /* Don't blit to the display surface when switched away */
- if ( switched_away ) {
- return -2; /* no hardware access */
- }
- if ( dst == this->screen ) {
- SDL_mutexP(hw_lock);
- }
-
- switch (dst->format->BytesPerPixel) {
- case 1:
- color |= (color<<8);
- case 2:
- color |= (color<<16);
- break;
- }
-
- /* Set up the X/Y base coordinates */
- FB_dst_to_xy(this, dst, &dstX, &dstY);
-
- /* Adjust for the current rectangle */
- dstX += rect->x;
- dstY += rect->y;
-
- /* Set up the X boundaries */
- fxbndry = (dstX | ((dstX+rect->w) << 16));
-
- /* Set up the Y boundaries */
- ydstlen = (rect->h | (dstY << 16));
-
- /* Set up for color fill operation */
- fillop = MGADWG_TRAP | MGADWG_SOLID |
- MGADWG_ARZERO | MGADWG_SGNZERO | MGADWG_SHIFTZERO;
-
- /* Execute the operations! */
- mga_wait(5);
- mga_out32(MGAREG_DWGCTL, fillop | MGADWG_REPLACE);
- mga_out32(MGAREG_FCOL, color);
- mga_out32(MGAREG_FXBNDRY, fxbndry);
- mga_out32(MGAREG_YDSTLEN + MGAREG_EXEC, ydstlen);
-
- FB_AddBusySurface(dst);
-
- if ( dst == this->screen ) {
- SDL_mutexV(hw_lock);
- }
- return(0);
-}
-
-static int HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect)
-{
- SDL_VideoDevice *this = current_video;
- int pitch, w, h;
- int srcX, srcY;
- int dstX, dstY;
- Uint32 sign;
- Uint32 start, stop;
- int skip;
- Uint32 blitop;
-
- /* FIXME: For now, only blit to display surface */
- if ( dst->pitch != SDL_VideoSurface->pitch ) {
- return(src->map->sw_blit(src, srcrect, dst, dstrect));
- }
-
- /* Don't blit to the display surface when switched away */
- if ( switched_away ) {
- return -2; /* no hardware access */
- }
- if ( dst == this->screen ) {
- SDL_mutexP(hw_lock);
- }
-
- /* Calculate source and destination base coordinates (in pixels) */
- w = dstrect->w;
- h = dstrect->h;
- FB_dst_to_xy(this, src, &srcX, &srcY);
- FB_dst_to_xy(this, dst, &dstX, &dstY);
-
- /* Adjust for the current blit rectangles */
- srcX += srcrect->x;
- srcY += srcrect->y;
- dstX += dstrect->x;
- dstY += dstrect->y;
- pitch = dst->pitch/dst->format->BytesPerPixel;
-
- /* Set up the blit direction (sign) flags */
- sign = 0;
- if ( srcX < dstX ) {
- sign |= 1;
- }
- if ( srcY < dstY ) {
- sign |= 4;
- srcY += (h - 1);
- dstY += (h - 1);
- }
-
- /* Set up the blit source row start, end, and skip (in pixels) */
- stop = start = (srcY * pitch) + srcX;
- if ( srcX < dstX ) {
- start += (w - 1);
- } else {
- stop += (w - 1);
- }
- if ( srcY < dstY ) {
- skip = -pitch;
- } else {
- skip = pitch;
- }
-
- /* Set up the blit operation */
- if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
- Uint32 colorkey;
-
- blitop = MGADWG_BFCOL | MGADWG_BITBLT |
- MGADWG_SHIFTZERO | MGADWG_RSTR | (0x0C << 16) |
- MGADWG_TRANSC;
-
- colorkey = src->format->colorkey;
- switch (dst->format->BytesPerPixel) {
- case 1:
- colorkey |= (colorkey<<8);
- case 2:
- colorkey |= (colorkey<<16);
- break;
- }
- mga_wait(2);
- mga_out32(MGAREG_FCOL, colorkey);
- mga_out32(MGAREG_BCOL, 0xFFFFFFFF);
- } else {
- blitop = MGADWG_BFCOL | MGADWG_BITBLT |
- MGADWG_SHIFTZERO | MGADWG_RSTR | (0x0C << 16);
- }
- mga_wait(7);
- mga_out32(MGAREG_SGN, sign);
- mga_out32(MGAREG_AR3, start);
- mga_out32(MGAREG_AR0, stop);
- mga_out32(MGAREG_AR5, skip);
- mga_out32(MGAREG_FXBNDRY, (dstX | ((dstX + w-1) << 16)));
- mga_out32(MGAREG_YDSTLEN, (dstY << 16) | h);
- mga_out32(MGAREG_DWGCTL + MGAREG_EXEC, blitop);
-
- FB_AddBusySurface(src);
- FB_AddBusySurface(dst);
-
- if ( dst == this->screen ) {
- SDL_mutexV(hw_lock);
- }
- return(0);
-}
-
-static int CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst)
-{
- int accelerated;
-
- /* Set initial acceleration on */
- src->flags |= SDL_HWACCEL;
-
- /* Set the surface attributes */
- if ( (src->flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
- if ( ! this->info.blit_hw_A ) {
- src->flags &= ~SDL_HWACCEL;
- }
- }
- if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
- if ( ! this->info.blit_hw_CC ) {
- src->flags &= ~SDL_HWACCEL;
- }
- }
-
- /* Check to see if final surface blit is accelerated */
- accelerated = !!(src->flags & SDL_HWACCEL);
- if ( accelerated ) {
- src->map->hw_blit = HWAccelBlit;
- }
- return(accelerated);
-}
-
-void FB_MatroxAccel(_THIS, __u32 card)
-{
- /* We have hardware accelerated surface functions */
- this->CheckHWBlit = CheckHWBlit;
- wait_vbl = WaitVBL;
- wait_idle = WaitIdle;
-
- /* The Matrox has an accelerated color fill */
- this->info.blit_fill = 1;
- this->FillHWRect = FillHWRect;
-
- /* The Matrox has accelerated normal and colorkey blits. */
- this->info.blit_hw = 1;
- /* The Millenium I appears to do the colorkey test a word
- at a time, and the transparency is intverted. (?)
- */
- if ( card != FB_ACCEL_MATROX_MGA2064W ) {
- this->info.blit_hw_CC = 1;
- this->SetHWColorKey = SetHWColorKey;
- }
-
-#if 0 /* Not yet implemented? */
- /* The Matrox G200/G400 has an accelerated alpha blit */
- if ( (card == FB_ACCEL_MATROX_MGAG200)
- || (card == FB_ACCEL_MATROX_MGAG400)
- ) {
- this->info.blit_hw_A = 1;
- this->SetHWAlpha = SetHWAlpha;
- }
-#endif
-}
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbmatrox.h b/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbmatrox.h
deleted file mode 100644
index 1721785..0000000
--- a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbmatrox.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Matrox hardware acceleration for the SDL framebuffer console driver */
-
-#include "SDL_fbvideo.h"
-
-/* Set up the driver for Matrox acceleration */
-extern void FB_MatroxAccel(_THIS, __u32 card);
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbmouse.c b/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbmouse.c
deleted file mode 100644
index d2d30cd..0000000
--- a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbmouse.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_mouse.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_fbvideo.h"
-#include "SDL_fbmouse_c.h"
-
-
-/* The implementation dependent data for the window manager cursor */
-struct WMcursor {
- int unused;
-};
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbmouse_c.h b/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbmouse_c.h
deleted file mode 100644
index 4950f56..0000000
--- a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbmouse_c.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_fbvideo.h"
-
-/* Functions to be exported */
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbriva.c b/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbriva.c
deleted file mode 100644
index 1a712dc..0000000
--- a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbriva.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-#include "../SDL_blit.h"
-#include "SDL_fbriva.h"
-#include "riva_mmio.h"
-#include "riva_regs.h"
-
-
-static int FifoEmptyCount = 0;
-static int FifoFreeCount = 0;
-
-/* Wait for vertical retrace */
-static void WaitVBL(_THIS)
-{
- volatile Uint8 *port = (Uint8 *)(mapped_io + PCIO_OFFSET + 0x3DA);
-
- while ( (*port & 0x08) )
- ;
- while ( !(*port & 0x08) )
- ;
-}
-static void NV3WaitIdle(_THIS)
-{
- RivaRop *Rop = (RivaRop *)(mapped_io + ROP_OFFSET);
- while ( (Rop->FifoFree < FifoEmptyCount) ||
- (*(mapped_io + PGRAPH_OFFSET + 0x000006B0) & 0x01) )
- ;
-}
-static void NV4WaitIdle(_THIS)
-{
- RivaRop *Rop = (RivaRop *)(mapped_io + ROP_OFFSET);
- while ( (Rop->FifoFree < FifoEmptyCount) ||
- (*(mapped_io + PGRAPH_OFFSET + 0x00000700) & 0x01) )
- ;
-}
-
-#if 0 /* Not yet implemented? */
-/* Sets video mem colorkey and accelerated blit function */
-static int SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key)
-{
- return(0);
-}
-
-/* Sets per surface hardware alpha value */
-static int SetHWAlpha(_THIS, SDL_Surface *surface, Uint8 value)
-{
- return(0);
-}
-#endif /* Not yet implemented */
-
-static int FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color)
-{
- int dstX, dstY;
- int dstW, dstH;
- RivaBitmap *Bitmap = (RivaBitmap *)(mapped_io + BITMAP_OFFSET);
-
- /* Don't blit to the display surface when switched away */
- if ( switched_away ) {
- return -2; /* no hardware access */
- }
- if ( dst == this->screen ) {
- SDL_mutexP(hw_lock);
- }
-
- /* Set up the X/Y base coordinates */
- dstW = rect->w;
- dstH = rect->h;
- FB_dst_to_xy(this, dst, &dstX, &dstY);
-
- /* Adjust for the current rectangle */
- dstX += rect->x;
- dstY += rect->y;
-
- RIVA_FIFO_FREE(Bitmap, 1);
- Bitmap->Color1A = color;
-
- RIVA_FIFO_FREE(Bitmap, 2);
- Bitmap->UnclippedRectangle[0].TopLeft = (dstX << 16) | dstY;
- Bitmap->UnclippedRectangle[0].WidthHeight = (dstW << 16) | dstH;
-
- FB_AddBusySurface(dst);
-
- if ( dst == this->screen ) {
- SDL_mutexV(hw_lock);
- }
- return(0);
-}
-
-static int HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect)
-{
- SDL_VideoDevice *this = current_video;
- int srcX, srcY;
- int dstX, dstY;
- int dstW, dstH;
- RivaScreenBlt *Blt = (RivaScreenBlt *)(mapped_io + BLT_OFFSET);
-
- /* FIXME: For now, only blit to display surface */
- if ( dst->pitch != SDL_VideoSurface->pitch ) {
- return(src->map->sw_blit(src, srcrect, dst, dstrect));
- }
-
- /* Don't blit to the display surface when switched away */
- if ( switched_away ) {
- return -2; /* no hardware access */
- }
- if ( dst == this->screen ) {
- SDL_mutexP(hw_lock);
- }
-
- /* Calculate source and destination base coordinates (in pixels) */
- dstW = dstrect->w;
- dstH = dstrect->h;
- FB_dst_to_xy(this, src, &srcX, &srcY);
- FB_dst_to_xy(this, dst, &dstX, &dstY);
-
- /* Adjust for the current blit rectangles */
- srcX += srcrect->x;
- srcY += srcrect->y;
- dstX += dstrect->x;
- dstY += dstrect->y;
-
- RIVA_FIFO_FREE(Blt, 3);
- Blt->TopLeftSrc = (srcY << 16) | srcX;
- Blt->TopLeftDst = (dstY << 16) | dstX;
- Blt->WidthHeight = (dstH << 16) | dstW;
-
- FB_AddBusySurface(src);
- FB_AddBusySurface(dst);
-
- if ( dst == this->screen ) {
- SDL_mutexV(hw_lock);
- }
- return(0);
-}
-
-static int CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst)
-{
- int accelerated;
-
- /* Set initial acceleration on */
- src->flags |= SDL_HWACCEL;
-
- /* Set the surface attributes */
- if ( (src->flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
- if ( ! this->info.blit_hw_A ) {
- src->flags &= ~SDL_HWACCEL;
- }
- }
- if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
- if ( ! this->info.blit_hw_CC ) {
- src->flags &= ~SDL_HWACCEL;
- }
- }
-
- /* Check to see if final surface blit is accelerated */
- accelerated = !!(src->flags & SDL_HWACCEL);
- if ( accelerated ) {
- src->map->hw_blit = HWAccelBlit;
- }
- return(accelerated);
-}
-
-void FB_RivaAccel(_THIS, __u32 card)
-{
- RivaRop *Rop = (RivaRop *)(mapped_io + ROP_OFFSET);
-
- /* We have hardware accelerated surface functions */
- this->CheckHWBlit = CheckHWBlit;
- wait_vbl = WaitVBL;
- switch (card) {
- case FB_ACCEL_NV3:
- wait_idle = NV3WaitIdle;
- break;
- case FB_ACCEL_NV4:
- wait_idle = NV4WaitIdle;
- break;
- default:
- /* Hmm... FIXME */
- break;
- }
- FifoEmptyCount = Rop->FifoFree;
-
- /* The Riva has an accelerated color fill */
- this->info.blit_fill = 1;
- this->FillHWRect = FillHWRect;
-
- /* The Riva has accelerated normal and colorkey blits. */
- this->info.blit_hw = 1;
-#if 0 /* Not yet implemented? */
- this->info.blit_hw_CC = 1;
- this->SetHWColorKey = SetHWColorKey;
-#endif
-
-#if 0 /* Not yet implemented? */
- /* The Riva has an accelerated alpha blit */
- this->info.blit_hw_A = 1;
- this->SetHWAlpha = SetHWAlpha;
-#endif
-}
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbriva.h b/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbriva.h
deleted file mode 100644
index 9ccc470..0000000
--- a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbriva.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Riva hardware acceleration for the SDL framebuffer console driver */
-
-#include "SDL_fbvideo.h"
-
-#ifndef FB_ACCEL_NV3
-#define FB_ACCEL_NV3 27
-#endif
-#ifndef FB_ACCEL_NV4
-#define FB_ACCEL_NV4 28
-#endif
-
-/* Set up the driver for Riva acceleration */
-extern void FB_RivaAccel(_THIS, __u32 card);
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbvideo.c b/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbvideo.c
deleted file mode 100644
index d58d399..0000000
--- a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbvideo.c
+++ /dev/null
@@ -1,1701 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Framebuffer console based SDL video driver implementation.
-*/
-
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-
-#ifndef HAVE_GETPAGESIZE
-#include <asm/page.h> /* For definition of PAGE_SIZE */
-#endif
-
-#include <linux/vt.h>
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_fbvideo.h"
-#include "SDL_fbmouse_c.h"
-#include "SDL_fbevents_c.h"
-#include "SDL_fb3dfx.h"
-#include "SDL_fbmatrox.h"
-#include "SDL_fbriva.h"
-
-/*#define FBCON_DEBUG*/
-
-#if defined(i386) && defined(FB_TYPE_VGA_PLANES)
-#define VGA16_FBCON_SUPPORT
-#include <sys/io.h> /* For ioperm() */
-#ifndef FB_AUX_VGA_PLANES_VGA4
-#define FB_AUX_VGA_PLANES_VGA4 0
-#endif
-/*
-static inline void outb (unsigned char value, unsigned short port)
-{
- __asm__ __volatile__ ("outb %b0,%w1"::"a" (value), "Nd" (port));
-}
-*/
-#endif /* FB_TYPE_VGA_PLANES */
-
-/* A list of video resolutions that we query for (sorted largest to smallest) */
-static const SDL_Rect checkres[] = {
- { 0, 0, 1600, 1200 }, /* 16 bpp: 0x11E, or 286 */
- { 0, 0, 1408, 1056 }, /* 16 bpp: 0x19A, or 410 */
- { 0, 0, 1280, 1024 }, /* 16 bpp: 0x11A, or 282 */
- { 0, 0, 1152, 864 }, /* 16 bpp: 0x192, or 402 */
- { 0, 0, 1024, 768 }, /* 16 bpp: 0x117, or 279 */
- { 0, 0, 960, 720 }, /* 16 bpp: 0x18A, or 394 */
- { 0, 0, 800, 600 }, /* 16 bpp: 0x114, or 276 */
- { 0, 0, 768, 576 }, /* 16 bpp: 0x182, or 386 */
- { 0, 0, 720, 576 }, /* PAL */
- { 0, 0, 720, 480 }, /* NTSC */
- { 0, 0, 640, 480 }, /* 16 bpp: 0x111, or 273 */
- { 0, 0, 640, 400 }, /* 8 bpp: 0x100, or 256 */
- { 0, 0, 512, 384 },
- { 0, 0, 320, 240 },
- { 0, 0, 320, 200 }
-};
-static const struct {
- int xres;
- int yres;
- int pixclock;
- int left;
- int right;
- int upper;
- int lower;
- int hslen;
- int vslen;
- int sync;
- int vmode;
-} vesa_timings[] = {
-#ifdef USE_VESA_TIMINGS /* Only tested on Matrox Millenium I */
- { 640, 400, 39771, 48, 16, 39, 8, 96, 2, 2, 0 }, /* 70 Hz */
- { 640, 480, 39683, 48, 16, 33, 10, 96, 2, 0, 0 }, /* 60 Hz */
- { 768, 576, 26101, 144, 16, 28, 6, 112, 4, 0, 0 }, /* 60 Hz */
- { 800, 600, 24038, 144, 24, 28, 8, 112, 6, 0, 0 }, /* 60 Hz */
- { 960, 720, 17686, 144, 24, 28, 8, 112, 4, 0, 0 }, /* 60 Hz */
- { 1024, 768, 15386, 160, 32, 30, 4, 128, 4, 0, 0 }, /* 60 Hz */
- { 1152, 864, 12286, 192, 32, 30, 4, 128, 4, 0, 0 }, /* 60 Hz */
- { 1280, 1024, 9369, 224, 32, 32, 4, 136, 4, 0, 0 }, /* 60 Hz */
- { 1408, 1056, 8214, 256, 40, 32, 5, 144, 5, 0, 0 }, /* 60 Hz */
- { 1600, 1200,/*?*/0, 272, 48, 32, 5, 152, 5, 0, 0 }, /* 60 Hz */
-#else
- /* You can generate these timings from your XF86Config file using
- the 'modeline2fb' perl script included with the fbset package.
- These timings were generated for Matrox Millenium I, 15" monitor.
- */
- { 320, 200, 79440, 16, 16, 20, 4, 48, 1, 0, 2 }, /* 70 Hz */
- { 320, 240, 63492, 16, 16, 16, 4, 48, 2, 0, 2 }, /* 72 Hz */
- { 512, 384, 49603, 48, 16, 16, 1, 64, 3, 0, 0 }, /* 78 Hz */
- { 640, 400, 31746, 96, 32, 41, 1, 64, 3, 2, 0 }, /* 85 Hz */
- { 640, 480, 31746, 120, 16, 16, 1, 64, 3, 0, 0 }, /* 75 Hz */
- { 768, 576, 26101, 144, 16, 28, 6, 112, 4, 0, 0 }, /* 60 Hz */
- { 800, 600, 20000, 64, 56, 23, 37, 120, 6, 3, 0 }, /* 72 Hz */
- { 960, 720, 17686, 144, 24, 28, 8, 112, 4, 0, 0 }, /* 60 Hz */
- { 1024, 768, 13333, 144, 24, 29, 3, 136, 6, 0, 0 }, /* 70 Hz */
- { 1152, 864, 12286, 192, 32, 30, 4, 128, 4, 0, 0 }, /* 60 Hz */
- { 1280, 1024, 9369, 224, 32, 32, 4, 136, 4, 0, 0 }, /* 60 Hz */
- { 1408, 1056, 8214, 256, 40, 32, 5, 144, 5, 0, 0 }, /* 60 Hz */
- { 1600, 1200,/*?*/0, 272, 48, 32, 5, 152, 5, 0, 0 }, /* 60 Hz */
-#endif
-};
-
-/* Initialization/Query functions */
-static int FB_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **FB_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *FB_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-#ifdef VGA16_FBCON_SUPPORT
-static SDL_Surface *FB_SetVGA16Mode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-#endif
-static int FB_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
-static void FB_VideoQuit(_THIS);
-
-/* Hardware surface functions */
-static int FB_InitHWSurfaces(_THIS, SDL_Surface *screen, char *base, int size);
-static void FB_FreeHWSurfaces(_THIS);
-static int FB_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int FB_LockHWSurface(_THIS, SDL_Surface *surface);
-static void FB_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static void FB_FreeHWSurface(_THIS, SDL_Surface *surface);
-static void FB_WaitVBL(_THIS);
-static void FB_WaitIdle(_THIS);
-static int FB_FlipHWSurface(_THIS, SDL_Surface *surface);
-
-/* Internal palette functions */
-static void FB_SavePalette(_THIS, struct fb_fix_screeninfo *finfo,
- struct fb_var_screeninfo *vinfo);
-static void FB_RestorePalette(_THIS);
-
-static int SDL_getpagesize(void)
-{
-#ifdef HAVE_GETPAGESIZE
- return getpagesize();
-#elif defined(PAGE_SIZE)
- return PAGE_SIZE;
-#else
-#error Can not determine system page size.
- return 4096; /* this is what it USED to be in Linux... */
-#endif
-}
-
-
-/* Small wrapper for mmap() so we can play nicely with no-mmu hosts
- * (non-mmu hosts disallow the MAP_SHARED flag) */
-
-static void *do_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset)
-{
- void *ret;
- ret = mmap(start, length, prot, flags, fd, offset);
- if ( ret == (char *)-1 && (flags & MAP_SHARED) ) {
- ret = mmap(start, length, prot,
- (flags & ~MAP_SHARED) | MAP_PRIVATE, fd, offset);
- }
- return ret;
-}
-
-/* FB driver bootstrap functions */
-
-static int FB_Available(void)
-{
- int console = -1;
- /* Added check for /fb/0 (devfs) */
- /* but - use environment variable first... if it fails, still check defaults */
- int idx = 0;
- const char *SDL_fbdevs[4] = { NULL, "/dev/fb0", "/dev/fb/0", NULL };
-
- SDL_fbdevs[0] = SDL_getenv("SDL_FBDEV");
- if( !SDL_fbdevs[0] )
- idx++;
- for( ; SDL_fbdevs[idx]; idx++ )
- {
- console = open(SDL_fbdevs[idx], O_RDWR, 0);
- if ( console >= 0 ) {
- close(console);
- break;
- }
- }
- return(console >= 0);
-}
-
-static void FB_DeleteDevice(SDL_VideoDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_VideoDevice *FB_CreateDevice(int devindex)
-{
- SDL_VideoDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
- wait_vbl = FB_WaitVBL;
- wait_idle = FB_WaitIdle;
- mouse_fd = -1;
- keyboard_fd = -1;
-
- /* Set the function pointers */
- this->VideoInit = FB_VideoInit;
- this->ListModes = FB_ListModes;
- this->SetVideoMode = FB_SetVideoMode;
- this->SetColors = FB_SetColors;
- this->UpdateRects = NULL;
- this->VideoQuit = FB_VideoQuit;
- this->AllocHWSurface = FB_AllocHWSurface;
- this->CheckHWBlit = NULL;
- this->FillHWRect = NULL;
- this->SetHWColorKey = NULL;
- this->SetHWAlpha = NULL;
- this->LockHWSurface = FB_LockHWSurface;
- this->UnlockHWSurface = FB_UnlockHWSurface;
- this->FlipHWSurface = FB_FlipHWSurface;
- this->FreeHWSurface = FB_FreeHWSurface;
- this->SetCaption = NULL;
- this->SetIcon = NULL;
- this->IconifyWindow = NULL;
- this->GrabInput = NULL;
- this->GetWMInfo = NULL;
- this->InitOSKeymap = FB_InitOSKeymap;
- this->PumpEvents = FB_PumpEvents;
-
- this->free = FB_DeleteDevice;
-
- return this;
-}
-
-VideoBootStrap FBCON_bootstrap = {
- "fbcon", "Linux Framebuffer Console",
- FB_Available, FB_CreateDevice
-};
-
-#define FB_MODES_DB "/etc/fb.modes"
-
-static int read_fbmodes_line(FILE*f, char* line, int length)
-{
- int blank;
- char* c;
- int i;
-
- blank=0;
- /* find a relevant line */
- do
- {
- if (fgets(line,length,f)<=0)
- return 0;
- c=line;
- while(((*c=='\t')||(*c==' '))&&(*c!=0))
- c++;
-
- if ((*c=='\n')||(*c=='#')||(*c==0))
- blank=1;
- else
- blank=0;
- }
- while(blank);
- /* remove whitespace at the begining of the string */
- i=0;
- do
- {
- line[i]=c[i];
- i++;
- }
- while(c[i]!=0);
- return 1;
-}
-
-static int read_fbmodes_mode(FILE *f, struct fb_var_screeninfo *vinfo)
-{
- char line[1024];
- char option[256];
-
- /* Find a "geometry" */
- do {
- if (read_fbmodes_line(f, line, sizeof(line))==0)
- return 0;
- if (SDL_strncmp(line,"geometry",8)==0)
- break;
- }
- while(1);
-
- SDL_sscanf(line, "geometry %d %d %d %d %d", &vinfo->xres, &vinfo->yres,
- &vinfo->xres_virtual, &vinfo->yres_virtual, &vinfo->bits_per_pixel);
- if (read_fbmodes_line(f, line, sizeof(line))==0)
- return 0;
-
- SDL_sscanf(line, "timings %d %d %d %d %d %d %d", &vinfo->pixclock,
- &vinfo->left_margin, &vinfo->right_margin, &vinfo->upper_margin,
- &vinfo->lower_margin, &vinfo->hsync_len, &vinfo->vsync_len);
-
- vinfo->sync=0;
- vinfo->vmode=FB_VMODE_NONINTERLACED;
-
- /* Parse misc options */
- do {
- if (read_fbmodes_line(f, line, sizeof(line))==0)
- return 0;
-
- if (SDL_strncmp(line,"hsync",5)==0) {
- SDL_sscanf(line,"hsync %s",option);
- if (SDL_strncmp(option,"high",4)==0)
- vinfo->sync |= FB_SYNC_HOR_HIGH_ACT;
- }
- else if (SDL_strncmp(line,"vsync",5)==0) {
- SDL_sscanf(line,"vsync %s",option);
- if (SDL_strncmp(option,"high",4)==0)
- vinfo->sync |= FB_SYNC_VERT_HIGH_ACT;
- }
- else if (SDL_strncmp(line,"csync",5)==0) {
- SDL_sscanf(line,"csync %s",option);
- if (SDL_strncmp(option,"high",4)==0)
- vinfo->sync |= FB_SYNC_COMP_HIGH_ACT;
- }
- else if (SDL_strncmp(line,"extsync",5)==0) {
- SDL_sscanf(line,"extsync %s",option);
- if (SDL_strncmp(option,"true",4)==0)
- vinfo->sync |= FB_SYNC_EXT;
- }
- else if (SDL_strncmp(line,"laced",5)==0) {
- SDL_sscanf(line,"laced %s",option);
- if (SDL_strncmp(option,"true",4)==0)
- vinfo->vmode |= FB_VMODE_INTERLACED;
- }
- else if (SDL_strncmp(line,"double",6)==0) {
- SDL_sscanf(line,"double %s",option);
- if (SDL_strncmp(option,"true",4)==0)
- vinfo->vmode |= FB_VMODE_DOUBLE;
- }
- }
- while(SDL_strncmp(line,"endmode",7)!=0);
-
- return 1;
-}
-
-static int FB_CheckMode(_THIS, struct fb_var_screeninfo *vinfo,
- int index, unsigned int *w, unsigned int *h)
-{
- int mode_okay;
-
- mode_okay = 0;
- vinfo->bits_per_pixel = (index+1)*8;
- vinfo->xres = *w;
- vinfo->xres_virtual = *w;
- vinfo->yres = *h;
- vinfo->yres_virtual = *h;
- vinfo->activate = FB_ACTIVATE_TEST;
- if ( ioctl(console_fd, FBIOPUT_VSCREENINFO, vinfo) == 0 ) {
-#ifdef FBCON_DEBUG
- fprintf(stderr, "Checked mode %dx%d at %d bpp, got mode %dx%d at %d bpp\n", *w, *h, (index+1)*8, vinfo->xres, vinfo->yres, vinfo->bits_per_pixel);
-#endif
- if ( (((vinfo->bits_per_pixel+7)/8)-1) == index ) {
- *w = vinfo->xres;
- *h = vinfo->yres;
- mode_okay = 1;
- }
- }
- return mode_okay;
-}
-
-static int FB_AddMode(_THIS, int index, unsigned int w, unsigned int h, int check_timings)
-{
- SDL_Rect *mode;
- int i;
- int next_mode;
-
- /* Check to see if we already have this mode */
- if ( SDL_nummodes[index] > 0 ) {
- mode = SDL_modelist[index][SDL_nummodes[index]-1];
- if ( (mode->w == w) && (mode->h == h) ) {
-#ifdef FBCON_DEBUG
- fprintf(stderr, "We already have mode %dx%d at %d bytes per pixel\n", w, h, index+1);
-#endif
- return(0);
- }
- }
-
- /* Only allow a mode if we have a valid timing for it */
- if ( check_timings ) {
- int found_timing = 0;
- for ( i=0; i<(sizeof(vesa_timings)/sizeof(vesa_timings[0])); ++i ) {
- if ( (w == vesa_timings[i].xres) &&
- (h == vesa_timings[i].yres) && vesa_timings[i].pixclock ) {
- found_timing = 1;
- break;
- }
- }
- if ( !found_timing ) {
-#ifdef FBCON_DEBUG
- fprintf(stderr, "No valid timing line for mode %dx%d\n", w, h);
-#endif
- return(0);
- }
- }
-
- /* Set up the new video mode rectangle */
- mode = (SDL_Rect *)SDL_malloc(sizeof *mode);
- if ( mode == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
- mode->x = 0;
- mode->y = 0;
- mode->w = w;
- mode->h = h;
-#ifdef FBCON_DEBUG
- fprintf(stderr, "Adding mode %dx%d at %d bytes per pixel\n", w, h, index+1);
-#endif
-
- /* Allocate the new list of modes, and fill in the new mode */
- next_mode = SDL_nummodes[index];
- SDL_modelist[index] = (SDL_Rect **)
- SDL_realloc(SDL_modelist[index], (1+next_mode+1)*sizeof(SDL_Rect *));
- if ( SDL_modelist[index] == NULL ) {
- SDL_OutOfMemory();
- SDL_nummodes[index] = 0;
- SDL_free(mode);
- return(-1);
- }
- SDL_modelist[index][next_mode] = mode;
- SDL_modelist[index][next_mode+1] = NULL;
- SDL_nummodes[index]++;
-
- return(0);
-}
-
-static int cmpmodes(const void *va, const void *vb)
-{
- const SDL_Rect *a = *(const SDL_Rect**)va;
- const SDL_Rect *b = *(const SDL_Rect**)vb;
- if ( a->h == b->h )
- return b->w - a->w;
- else
- return b->h - a->h;
-}
-
-static void FB_SortModes(_THIS)
-{
- int i;
- for ( i=0; i<NUM_MODELISTS; ++i ) {
- if ( SDL_nummodes[i] > 0 ) {
- SDL_qsort(SDL_modelist[i], SDL_nummodes[i], sizeof *SDL_modelist[i], cmpmodes);
- }
- }
-}
-
-static int FB_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- const int pagesize = SDL_getpagesize();
- struct fb_fix_screeninfo finfo;
- struct fb_var_screeninfo vinfo;
- int i, j;
- int current_index;
- unsigned int current_w;
- unsigned int current_h;
- const char *SDL_fbdev;
- FILE *modesdb;
-
- /* Initialize the library */
- SDL_fbdev = SDL_getenv("SDL_FBDEV");
- if ( SDL_fbdev == NULL ) {
- SDL_fbdev = "/dev/fb0";
- }
- console_fd = open(SDL_fbdev, O_RDWR, 0);
- if ( console_fd < 0 ) {
- SDL_SetError("Unable to open %s", SDL_fbdev);
- return(-1);
- }
-
-#if !SDL_THREADS_DISABLED
- /* Create the hardware surface lock mutex */
- hw_lock = SDL_CreateMutex();
- if ( hw_lock == NULL ) {
- SDL_SetError("Unable to create lock mutex");
- FB_VideoQuit(this);
- return(-1);
- }
-#endif
-
- /* Get the type of video hardware */
- if ( ioctl(console_fd, FBIOGET_FSCREENINFO, &finfo) < 0 ) {
- SDL_SetError("Couldn't get console hardware info");
- FB_VideoQuit(this);
- return(-1);
- }
- switch (finfo.type) {
- case FB_TYPE_PACKED_PIXELS:
- /* Supported, no worries.. */
- break;
-#ifdef VGA16_FBCON_SUPPORT
- case FB_TYPE_VGA_PLANES:
- /* VGA16 is supported, but that's it */
- if ( finfo.type_aux == FB_AUX_VGA_PLANES_VGA4 ) {
- if ( ioperm(0x3b4, 0x3df - 0x3b4 + 1, 1) < 0 ) {
- SDL_SetError("No I/O port permissions");
- FB_VideoQuit(this);
- return(-1);
- }
- this->SetVideoMode = FB_SetVGA16Mode;
- break;
- }
- /* Fall through to unsupported case */
-#endif /* VGA16_FBCON_SUPPORT */
- default:
- SDL_SetError("Unsupported console hardware");
- FB_VideoQuit(this);
- return(-1);
- }
- switch (finfo.visual) {
- case FB_VISUAL_TRUECOLOR:
- case FB_VISUAL_PSEUDOCOLOR:
- case FB_VISUAL_STATIC_PSEUDOCOLOR:
- case FB_VISUAL_DIRECTCOLOR:
- break;
- default:
- SDL_SetError("Unsupported console hardware");
- FB_VideoQuit(this);
- return(-1);
- }
-
- /* Check if the user wants to disable hardware acceleration */
- { const char *fb_accel;
- fb_accel = SDL_getenv("SDL_FBACCEL");
- if ( fb_accel ) {
- finfo.accel = SDL_atoi(fb_accel);
- }
- }
-
- /* Memory map the device, compensating for buggy PPC mmap() */
- mapped_offset = (((long)finfo.smem_start) -
- (((long)finfo.smem_start)&~(pagesize-1)));
- mapped_memlen = finfo.smem_len+mapped_offset;
- mapped_mem = do_mmap(NULL, mapped_memlen,
- PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0);
- if ( mapped_mem == (char *)-1 ) {
- SDL_SetError("Unable to memory map the video hardware");
- mapped_mem = NULL;
- FB_VideoQuit(this);
- return(-1);
- }
-
- /* Determine the current screen depth */
- if ( ioctl(console_fd, FBIOGET_VSCREENINFO, &vinfo) < 0 ) {
- SDL_SetError("Couldn't get console pixel format");
- FB_VideoQuit(this);
- return(-1);
- }
- vformat->BitsPerPixel = vinfo.bits_per_pixel;
- if ( vformat->BitsPerPixel < 8 ) {
- /* Assuming VGA16, we handle this via a shadow framebuffer */
- vformat->BitsPerPixel = 8;
- }
- for ( i=0; i<vinfo.red.length; ++i ) {
- vformat->Rmask <<= 1;
- vformat->Rmask |= (0x00000001<<vinfo.red.offset);
- }
- for ( i=0; i<vinfo.green.length; ++i ) {
- vformat->Gmask <<= 1;
- vformat->Gmask |= (0x00000001<<vinfo.green.offset);
- }
- for ( i=0; i<vinfo.blue.length; ++i ) {
- vformat->Bmask <<= 1;
- vformat->Bmask |= (0x00000001<<vinfo.blue.offset);
- }
- saved_vinfo = vinfo;
-
- /* Save hardware palette, if needed */
- FB_SavePalette(this, &finfo, &vinfo);
-
- /* If the I/O registers are available, memory map them so we
- can take advantage of any supported hardware acceleration.
- */
- vinfo.accel_flags = 0; /* Temporarily reserve registers */
- ioctl(console_fd, FBIOPUT_VSCREENINFO, &vinfo);
- if ( finfo.accel && finfo.mmio_len ) {
- mapped_iolen = finfo.mmio_len;
- mapped_io = do_mmap(NULL, mapped_iolen, PROT_READ|PROT_WRITE,
- MAP_SHARED, console_fd, mapped_memlen);
- if ( mapped_io == (char *)-1 ) {
- /* Hmm, failed to memory map I/O registers */
- mapped_io = NULL;
- }
- }
-
- /* Query for the list of available video modes */
- current_w = vinfo.xres;
- current_h = vinfo.yres;
- current_index = ((vinfo.bits_per_pixel+7)/8)-1;
- modesdb = fopen(FB_MODES_DB, "r");
- for ( i=0; i<NUM_MODELISTS; ++i ) {
- SDL_nummodes[i] = 0;
- SDL_modelist[i] = NULL;
- }
- if ( SDL_getenv("SDL_FB_BROKEN_MODES") != NULL ) {
- FB_AddMode(this, current_index, current_w, current_h, 0);
- } else if(modesdb) {
- while ( read_fbmodes_mode(modesdb, &vinfo) ) {
- for ( i=0; i<NUM_MODELISTS; ++i ) {
- unsigned int w, h;
-
- /* See if we are querying for the current mode */
- w = vinfo.xres;
- h = vinfo.yres;
- if ( i == current_index ) {
- if ( (current_w > w) || (current_h > h) ) {
- /* Only check once */
- FB_AddMode(this, i, current_w, current_h, 0);
- current_index = -1;
- }
- }
- if ( FB_CheckMode(this, &vinfo, i, &w, &h) ) {
- FB_AddMode(this, i, w, h, 0);
- }
- }
- }
- fclose(modesdb);
- FB_SortModes(this);
- } else {
- for ( i=0; i<NUM_MODELISTS; ++i ) {
- for ( j=0; j<(sizeof(checkres)/sizeof(checkres[0])); ++j ) {
- unsigned int w, h;
-
- /* See if we are querying for the current mode */
- w = checkres[j].w;
- h = checkres[j].h;
- if ( i == current_index ) {
- if ( (current_w > w) || (current_h > h) ) {
- /* Only check once */
- FB_AddMode(this, i, current_w, current_h, 0);
- current_index = -1;
- }
- }
- if ( FB_CheckMode(this, &vinfo, i, &w, &h) ) {
- FB_AddMode(this, i, w, h, 1);
- }
- }
- }
- }
-
- /* Fill in our hardware acceleration capabilities */
- this->info.current_w = current_w;
- this->info.current_h = current_h;
- this->info.wm_available = 0;
- this->info.hw_available = 1;
- this->info.video_mem = finfo.smem_len/1024;
- if ( mapped_io ) {
- switch (finfo.accel) {
- case FB_ACCEL_MATROX_MGA2064W:
- case FB_ACCEL_MATROX_MGA1064SG:
- case FB_ACCEL_MATROX_MGA2164W:
- case FB_ACCEL_MATROX_MGA2164W_AGP:
- case FB_ACCEL_MATROX_MGAG100:
- /*case FB_ACCEL_MATROX_MGAG200: G200 acceleration broken! */
- case FB_ACCEL_MATROX_MGAG400:
-#ifdef FBACCEL_DEBUG
- printf("Matrox hardware accelerator!\n");
-#endif
- FB_MatroxAccel(this, finfo.accel);
- break;
- case FB_ACCEL_3DFX_BANSHEE:
-#ifdef FBACCEL_DEBUG
- printf("3DFX hardware accelerator!\n");
-#endif
- FB_3DfxAccel(this, finfo.accel);
- break;
- case FB_ACCEL_NV3:
- case FB_ACCEL_NV4:
-#ifdef FBACCEL_DEBUG
- printf("NVidia hardware accelerator!\n");
-#endif
- FB_RivaAccel(this, finfo.accel);
- break;
- default:
-#ifdef FBACCEL_DEBUG
- printf("Unknown hardware accelerator.\n");
-#endif
- break;
- }
- }
-
- /* Enable mouse and keyboard support */
- if ( FB_OpenKeyboard(this) < 0 ) {
- FB_VideoQuit(this);
- return(-1);
- }
- if ( FB_OpenMouse(this) < 0 ) {
- const char *sdl_nomouse;
-
- sdl_nomouse = SDL_getenv("SDL_NOMOUSE");
- if ( ! sdl_nomouse ) {
- SDL_SetError("Unable to open mouse");
- FB_VideoQuit(this);
- return(-1);
- }
- }
-
- /* We're done! */
- return(0);
-}
-
-static SDL_Rect **FB_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- return(SDL_modelist[((format->BitsPerPixel+7)/8)-1]);
-}
-
-/* Various screen update functions available */
-static void FB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
-#ifdef VGA16_FBCON_SUPPORT
-static void FB_VGA16Update(_THIS, int numrects, SDL_Rect *rects);
-#endif
-
-#ifdef FBCON_DEBUG
-static void print_vinfo(struct fb_var_screeninfo *vinfo)
-{
- fprintf(stderr, "Printing vinfo:\n");
- fprintf(stderr, "\txres: %d\n", vinfo->xres);
- fprintf(stderr, "\tyres: %d\n", vinfo->yres);
- fprintf(stderr, "\txres_virtual: %d\n", vinfo->xres_virtual);
- fprintf(stderr, "\tyres_virtual: %d\n", vinfo->yres_virtual);
- fprintf(stderr, "\txoffset: %d\n", vinfo->xoffset);
- fprintf(stderr, "\tyoffset: %d\n", vinfo->yoffset);
- fprintf(stderr, "\tbits_per_pixel: %d\n", vinfo->bits_per_pixel);
- fprintf(stderr, "\tgrayscale: %d\n", vinfo->grayscale);
- fprintf(stderr, "\tnonstd: %d\n", vinfo->nonstd);
- fprintf(stderr, "\tactivate: %d\n", vinfo->activate);
- fprintf(stderr, "\theight: %d\n", vinfo->height);
- fprintf(stderr, "\twidth: %d\n", vinfo->width);
- fprintf(stderr, "\taccel_flags: %d\n", vinfo->accel_flags);
- fprintf(stderr, "\tpixclock: %d\n", vinfo->pixclock);
- fprintf(stderr, "\tleft_margin: %d\n", vinfo->left_margin);
- fprintf(stderr, "\tright_margin: %d\n", vinfo->right_margin);
- fprintf(stderr, "\tupper_margin: %d\n", vinfo->upper_margin);
- fprintf(stderr, "\tlower_margin: %d\n", vinfo->lower_margin);
- fprintf(stderr, "\thsync_len: %d\n", vinfo->hsync_len);
- fprintf(stderr, "\tvsync_len: %d\n", vinfo->vsync_len);
- fprintf(stderr, "\tsync: %d\n", vinfo->sync);
- fprintf(stderr, "\tvmode: %d\n", vinfo->vmode);
- fprintf(stderr, "\tred: %d/%d\n", vinfo->red.length, vinfo->red.offset);
- fprintf(stderr, "\tgreen: %d/%d\n", vinfo->green.length, vinfo->green.offset);
- fprintf(stderr, "\tblue: %d/%d\n", vinfo->blue.length, vinfo->blue.offset);
- fprintf(stderr, "\talpha: %d/%d\n", vinfo->transp.length, vinfo->transp.offset);
-}
-static void print_finfo(struct fb_fix_screeninfo *finfo)
-{
- fprintf(stderr, "Printing finfo:\n");
- fprintf(stderr, "\tsmem_start = %p\n", (char *)finfo->smem_start);
- fprintf(stderr, "\tsmem_len = %d\n", finfo->smem_len);
- fprintf(stderr, "\ttype = %d\n", finfo->type);
- fprintf(stderr, "\ttype_aux = %d\n", finfo->type_aux);
- fprintf(stderr, "\tvisual = %d\n", finfo->visual);
- fprintf(stderr, "\txpanstep = %d\n", finfo->xpanstep);
- fprintf(stderr, "\typanstep = %d\n", finfo->ypanstep);
- fprintf(stderr, "\tywrapstep = %d\n", finfo->ywrapstep);
- fprintf(stderr, "\tline_length = %d\n", finfo->line_length);
- fprintf(stderr, "\tmmio_start = %p\n", (char *)finfo->mmio_start);
- fprintf(stderr, "\tmmio_len = %d\n", finfo->mmio_len);
- fprintf(stderr, "\taccel = %d\n", finfo->accel);
-}
-#endif
-
-static int choose_fbmodes_mode(struct fb_var_screeninfo *vinfo)
-{
- int matched;
- FILE *modesdb;
- struct fb_var_screeninfo cinfo;
-
- matched = 0;
- modesdb = fopen(FB_MODES_DB, "r");
- if ( modesdb ) {
- /* Parse the mode definition file */
- while ( read_fbmodes_mode(modesdb, &cinfo) ) {
- if ( (vinfo->xres == cinfo.xres && vinfo->yres == cinfo.yres) &&
- (!matched || (vinfo->bits_per_pixel == cinfo.bits_per_pixel)) ) {
- vinfo->pixclock = cinfo.pixclock;
- vinfo->left_margin = cinfo.left_margin;
- vinfo->right_margin = cinfo.right_margin;
- vinfo->upper_margin = cinfo.upper_margin;
- vinfo->lower_margin = cinfo.lower_margin;
- vinfo->hsync_len = cinfo.hsync_len;
- vinfo->vsync_len = cinfo.vsync_len;
- if ( matched ) {
- break;
- }
- matched = 1;
- }
- }
- fclose(modesdb);
- }
- return(matched);
-}
-
-static int choose_vesa_mode(struct fb_var_screeninfo *vinfo)
-{
- int matched;
- int i;
-
- /* Check for VESA timings */
- matched = 0;
- for ( i=0; i<(sizeof(vesa_timings)/sizeof(vesa_timings[0])); ++i ) {
- if ( (vinfo->xres == vesa_timings[i].xres) &&
- (vinfo->yres == vesa_timings[i].yres) ) {
-#ifdef FBCON_DEBUG
- fprintf(stderr, "Using VESA timings for %dx%d\n",
- vinfo->xres, vinfo->yres);
-#endif
- if ( vesa_timings[i].pixclock ) {
- vinfo->pixclock = vesa_timings[i].pixclock;
- }
- vinfo->left_margin = vesa_timings[i].left;
- vinfo->right_margin = vesa_timings[i].right;
- vinfo->upper_margin = vesa_timings[i].upper;
- vinfo->lower_margin = vesa_timings[i].lower;
- vinfo->hsync_len = vesa_timings[i].hslen;
- vinfo->vsync_len = vesa_timings[i].vslen;
- vinfo->sync = vesa_timings[i].sync;
- vinfo->vmode = vesa_timings[i].vmode;
- matched = 1;
- break;
- }
- }
- return(matched);
-}
-
-#ifdef VGA16_FBCON_SUPPORT
-static SDL_Surface *FB_SetVGA16Mode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- struct fb_fix_screeninfo finfo;
- struct fb_var_screeninfo vinfo;
-
- /* Set the terminal into graphics mode */
- if ( FB_EnterGraphicsMode(this) < 0 ) {
- return(NULL);
- }
-
- /* Restore the original palette */
- FB_RestorePalette(this);
-
- /* Set the video mode and get the final screen format */
- if ( ioctl(console_fd, FBIOGET_VSCREENINFO, &vinfo) < 0 ) {
- SDL_SetError("Couldn't get console screen info");
- return(NULL);
- }
- cache_vinfo = vinfo;
-#ifdef FBCON_DEBUG
- fprintf(stderr, "Printing actual vinfo:\n");
- print_vinfo(&vinfo);
-#endif
- if ( ! SDL_ReallocFormat(current, bpp, 0, 0, 0, 0) ) {
- return(NULL);
- }
- current->format->palette->ncolors = 16;
-
- /* Get the fixed information about the console hardware.
- This is necessary since finfo.line_length changes.
- */
- if ( ioctl(console_fd, FBIOGET_FSCREENINFO, &finfo) < 0 ) {
- SDL_SetError("Couldn't get console hardware info");
- return(NULL);
- }
-#ifdef FBCON_DEBUG
- fprintf(stderr, "Printing actual finfo:\n");
- print_finfo(&finfo);
-#endif
-
- /* Save hardware palette, if needed */
- FB_SavePalette(this, &finfo, &vinfo);
-
- /* Set up the new mode framebuffer */
- current->flags = SDL_FULLSCREEN;
- current->w = vinfo.xres;
- current->h = vinfo.yres;
- current->pitch = current->w;
- current->pixels = SDL_malloc(current->h*current->pitch);
-
- /* Set the update rectangle function */
- this->UpdateRects = FB_VGA16Update;
-
- /* We're done */
- return(current);
-}
-#endif /* VGA16_FBCON_SUPPORT */
-
-static SDL_Surface *FB_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- struct fb_fix_screeninfo finfo;
- struct fb_var_screeninfo vinfo;
- int i;
- Uint32 Rmask;
- Uint32 Gmask;
- Uint32 Bmask;
- char *surfaces_mem;
- int surfaces_len;
-
- /* Set the terminal into graphics mode */
- if ( FB_EnterGraphicsMode(this) < 0 ) {
- return(NULL);
- }
-
- /* Restore the original palette */
- FB_RestorePalette(this);
-
- /* Set the video mode and get the final screen format */
- if ( ioctl(console_fd, FBIOGET_VSCREENINFO, &vinfo) < 0 ) {
- SDL_SetError("Couldn't get console screen info");
- return(NULL);
- }
-#ifdef FBCON_DEBUG
- fprintf(stderr, "Printing original vinfo:\n");
- print_vinfo(&vinfo);
-#endif
- if ( (vinfo.xres != width) || (vinfo.yres != height) ||
- (vinfo.bits_per_pixel != bpp) || (flags & SDL_DOUBLEBUF) ) {
- vinfo.activate = FB_ACTIVATE_NOW;
- vinfo.accel_flags = 0;
- vinfo.bits_per_pixel = bpp;
- vinfo.xres = width;
- vinfo.xres_virtual = width;
- vinfo.yres = height;
- if ( flags & SDL_DOUBLEBUF ) {
- vinfo.yres_virtual = height*2;
- } else {
- vinfo.yres_virtual = height;
- }
- vinfo.xoffset = 0;
- vinfo.yoffset = 0;
- vinfo.red.length = vinfo.red.offset = 0;
- vinfo.green.length = vinfo.green.offset = 0;
- vinfo.blue.length = vinfo.blue.offset = 0;
- vinfo.transp.length = vinfo.transp.offset = 0;
- if ( ! choose_fbmodes_mode(&vinfo) ) {
- choose_vesa_mode(&vinfo);
- }
-#ifdef FBCON_DEBUG
- fprintf(stderr, "Printing wanted vinfo:\n");
- print_vinfo(&vinfo);
-#endif
- if ( ioctl(console_fd, FBIOPUT_VSCREENINFO, &vinfo) < 0 ) {
- vinfo.yres_virtual = height;
- if ( ioctl(console_fd, FBIOPUT_VSCREENINFO, &vinfo) < 0 ) {
- SDL_SetError("Couldn't set console screen info");
- return(NULL);
- }
- }
- } else {
- int maxheight;
-
- /* Figure out how much video memory is available */
- if ( flags & SDL_DOUBLEBUF ) {
- maxheight = height*2;
- } else {
- maxheight = height;
- }
- if ( vinfo.yres_virtual > maxheight ) {
- vinfo.yres_virtual = maxheight;
- }
- }
- cache_vinfo = vinfo;
-#ifdef FBCON_DEBUG
- fprintf(stderr, "Printing actual vinfo:\n");
- print_vinfo(&vinfo);
-#endif
- Rmask = 0;
- for ( i=0; i<vinfo.red.length; ++i ) {
- Rmask <<= 1;
- Rmask |= (0x00000001<<vinfo.red.offset);
- }
- Gmask = 0;
- for ( i=0; i<vinfo.green.length; ++i ) {
- Gmask <<= 1;
- Gmask |= (0x00000001<<vinfo.green.offset);
- }
- Bmask = 0;
- for ( i=0; i<vinfo.blue.length; ++i ) {
- Bmask <<= 1;
- Bmask |= (0x00000001<<vinfo.blue.offset);
- }
- if ( ! SDL_ReallocFormat(current, vinfo.bits_per_pixel,
- Rmask, Gmask, Bmask, 0) ) {
- return(NULL);
- }
-
- /* Get the fixed information about the console hardware.
- This is necessary since finfo.line_length changes.
- */
- if ( ioctl(console_fd, FBIOGET_FSCREENINFO, &finfo) < 0 ) {
- SDL_SetError("Couldn't get console hardware info");
- return(NULL);
- }
-
- /* Save hardware palette, if needed */
- FB_SavePalette(this, &finfo, &vinfo);
-
- /* Set up the new mode framebuffer */
- current->flags = (SDL_FULLSCREEN|SDL_HWSURFACE);
- current->w = vinfo.xres;
- current->h = vinfo.yres;
- current->pitch = finfo.line_length;
- current->pixels = mapped_mem+mapped_offset;
-
- /* Set up the information for hardware surfaces */
- surfaces_mem = (char *)current->pixels +
- vinfo.yres_virtual*current->pitch;
- surfaces_len = (mapped_memlen-(surfaces_mem-mapped_mem));
- FB_FreeHWSurfaces(this);
- FB_InitHWSurfaces(this, current, surfaces_mem, surfaces_len);
-
- /* Let the application know we have a hardware palette */
- switch (finfo.visual) {
- case FB_VISUAL_PSEUDOCOLOR:
- current->flags |= SDL_HWPALETTE;
- break;
- default:
- break;
- }
-
- /* Update for double-buffering, if we can */
- if ( flags & SDL_DOUBLEBUF ) {
- if ( vinfo.yres_virtual == (height*2) ) {
- current->flags |= SDL_DOUBLEBUF;
- flip_page = 0;
- flip_address[0] = (char *)current->pixels;
- flip_address[1] = (char *)current->pixels+
- current->h*current->pitch;
- this->screen = current;
- FB_FlipHWSurface(this, current);
- this->screen = NULL;
- }
- }
-
- /* Set the update rectangle function */
- this->UpdateRects = FB_DirectUpdate;
-
- /* We're done */
- return(current);
-}
-
-#ifdef FBCON_DEBUG
-void FB_DumpHWSurfaces(_THIS)
-{
- vidmem_bucket *bucket;
-
- printf("Memory left: %d (%d total)\n", surfaces_memleft, surfaces_memtotal);
- printf("\n");
- printf(" Base Size\n");
- for ( bucket=&surfaces; bucket; bucket=bucket->next ) {
- printf("Bucket: %p, %d (%s)\n", bucket->base, bucket->size, bucket->used ? "used" : "free");
- if ( bucket->prev ) {
- if ( bucket->base != bucket->prev->base+bucket->prev->size ) {
- printf("Warning, corrupt bucket list! (prev)\n");
- }
- } else {
- if ( bucket != &surfaces ) {
- printf("Warning, corrupt bucket list! (!prev)\n");
- }
- }
- if ( bucket->next ) {
- if ( bucket->next->base != bucket->base+bucket->size ) {
- printf("Warning, corrupt bucket list! (next)\n");
- }
- }
- }
- printf("\n");
-}
-#endif
-
-static int FB_InitHWSurfaces(_THIS, SDL_Surface *screen, char *base, int size)
-{
- vidmem_bucket *bucket;
-
- surfaces_memtotal = size;
- surfaces_memleft = size;
-
- if ( surfaces_memleft > 0 ) {
- bucket = (vidmem_bucket *)SDL_malloc(sizeof(*bucket));
- if ( bucket == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
- bucket->prev = &surfaces;
- bucket->used = 0;
- bucket->dirty = 0;
- bucket->base = base;
- bucket->size = size;
- bucket->next = NULL;
- } else {
- bucket = NULL;
- }
-
- surfaces.prev = NULL;
- surfaces.used = 1;
- surfaces.dirty = 0;
- surfaces.base = screen->pixels;
- surfaces.size = (unsigned int)((long)base - (long)surfaces.base);
- surfaces.next = bucket;
- screen->hwdata = (struct private_hwdata *)&surfaces;
- return(0);
-}
-static void FB_FreeHWSurfaces(_THIS)
-{
- vidmem_bucket *bucket, *freeable;
-
- bucket = surfaces.next;
- while ( bucket ) {
- freeable = bucket;
- bucket = bucket->next;
- SDL_free(freeable);
- }
- surfaces.next = NULL;
-}
-
-static int FB_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- vidmem_bucket *bucket;
- int size;
- int extra;
-
-/* Temporarily, we only allow surfaces the same width as display.
- Some blitters require the pitch between two hardware surfaces
- to be the same. Others have interesting alignment restrictions.
- Until someone who knows these details looks at the code...
-*/
-if ( surface->pitch > SDL_VideoSurface->pitch ) {
- SDL_SetError("Surface requested wider than screen");
- return(-1);
-}
-surface->pitch = SDL_VideoSurface->pitch;
- size = surface->h * surface->pitch;
-#ifdef FBCON_DEBUG
- fprintf(stderr, "Allocating bucket of %d bytes\n", size);
-#endif
-
- /* Quick check for available mem */
- if ( size > surfaces_memleft ) {
- SDL_SetError("Not enough video memory");
- return(-1);
- }
-
- /* Search for an empty bucket big enough */
- for ( bucket=&surfaces; bucket; bucket=bucket->next ) {
- if ( ! bucket->used && (size <= bucket->size) ) {
- break;
- }
- }
- if ( bucket == NULL ) {
- SDL_SetError("Video memory too fragmented");
- return(-1);
- }
-
- /* Create a new bucket for left-over memory */
- extra = (bucket->size - size);
- if ( extra ) {
- vidmem_bucket *newbucket;
-
-#ifdef FBCON_DEBUG
- fprintf(stderr, "Adding new free bucket of %d bytes\n", extra);
-#endif
- newbucket = (vidmem_bucket *)SDL_malloc(sizeof(*newbucket));
- if ( newbucket == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
- newbucket->prev = bucket;
- newbucket->used = 0;
- newbucket->base = bucket->base+size;
- newbucket->size = extra;
- newbucket->next = bucket->next;
- if ( bucket->next ) {
- bucket->next->prev = newbucket;
- }
- bucket->next = newbucket;
- }
-
- /* Set the current bucket values and return it! */
- bucket->used = 1;
- bucket->size = size;
- bucket->dirty = 0;
-#ifdef FBCON_DEBUG
- fprintf(stderr, "Allocated %d bytes at %p\n", bucket->size, bucket->base);
-#endif
- surfaces_memleft -= size;
- surface->flags |= SDL_HWSURFACE;
- surface->pixels = bucket->base;
- surface->hwdata = (struct private_hwdata *)bucket;
- return(0);
-}
-static void FB_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- vidmem_bucket *bucket, *freeable;
-
- /* Look for the bucket in the current list */
- for ( bucket=&surfaces; bucket; bucket=bucket->next ) {
- if ( bucket == (vidmem_bucket *)surface->hwdata ) {
- break;
- }
- }
- if ( bucket && bucket->used ) {
- /* Add the memory back to the total */
-#ifdef DGA_DEBUG
- printf("Freeing bucket of %d bytes\n", bucket->size);
-#endif
- surfaces_memleft += bucket->size;
-
- /* Can we merge the space with surrounding buckets? */
- bucket->used = 0;
- if ( bucket->next && ! bucket->next->used ) {
-#ifdef DGA_DEBUG
- printf("Merging with next bucket, for %d total bytes\n", bucket->size+bucket->next->size);
-#endif
- freeable = bucket->next;
- bucket->size += bucket->next->size;
- bucket->next = bucket->next->next;
- if ( bucket->next ) {
- bucket->next->prev = bucket;
- }
- SDL_free(freeable);
- }
- if ( bucket->prev && ! bucket->prev->used ) {
-#ifdef DGA_DEBUG
- printf("Merging with previous bucket, for %d total bytes\n", bucket->prev->size+bucket->size);
-#endif
- freeable = bucket;
- bucket->prev->size += bucket->size;
- bucket->prev->next = bucket->next;
- if ( bucket->next ) {
- bucket->next->prev = bucket->prev;
- }
- SDL_free(freeable);
- }
- }
- surface->pixels = NULL;
- surface->hwdata = NULL;
-}
-
-static int FB_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- if ( switched_away ) {
- return -2; /* no hardware access */
- }
- if ( surface == this->screen ) {
- SDL_mutexP(hw_lock);
- if ( FB_IsSurfaceBusy(surface) ) {
- FB_WaitBusySurfaces(this);
- }
- } else {
- if ( FB_IsSurfaceBusy(surface) ) {
- FB_WaitBusySurfaces(this);
- }
- }
- return(0);
-}
-static void FB_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- if ( surface == this->screen ) {
- SDL_mutexV(hw_lock);
- }
-}
-
-static void FB_WaitVBL(_THIS)
-{
-#ifdef FBIOWAITRETRACE /* Heheh, this didn't make it into the main kernel */
- ioctl(console_fd, FBIOWAITRETRACE, 0);
-#endif
- return;
-}
-
-static void FB_WaitIdle(_THIS)
-{
- return;
-}
-
-static int FB_FlipHWSurface(_THIS, SDL_Surface *surface)
-{
- if ( switched_away ) {
- return -2; /* no hardware access */
- }
-
- /* Wait for vertical retrace and then flip display */
- cache_vinfo.yoffset = flip_page*surface->h;
- if ( FB_IsSurfaceBusy(this->screen) ) {
- FB_WaitBusySurfaces(this);
- }
- wait_vbl(this);
- if ( ioctl(console_fd, FBIOPAN_DISPLAY, &cache_vinfo) < 0 ) {
- SDL_SetError("ioctl(FBIOPAN_DISPLAY) failed");
- return(-1);
- }
- flip_page = !flip_page;
-
- surface->pixels = flip_address[flip_page];
- return(0);
-}
-
-static void FB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- /* The application is already updating the visible video memory */
- return;
-}
-
-#ifdef VGA16_FBCON_SUPPORT
-/* Code adapted with thanks from the XFree86 VGA16 driver! :) */
-#define writeGr(index, value) \
-outb(index, 0x3CE); \
-outb(value, 0x3CF);
-#define writeSeq(index, value) \
-outb(index, 0x3C4); \
-outb(value, 0x3C5);
-
-static void FB_VGA16Update(_THIS, int numrects, SDL_Rect *rects)
-{
- SDL_Surface *screen;
- int width, height, FBPitch, left, i, j, SRCPitch, phase;
- register Uint32 m;
- Uint8 s1, s2, s3, s4;
- Uint32 *src, *srcPtr;
- Uint8 *dst, *dstPtr;
-
- if ( switched_away ) {
- return; /* no hardware access */
- }
-
- screen = this->screen;
- FBPitch = screen->w >> 3;
- SRCPitch = screen->pitch >> 2;
-
- writeGr(0x03, 0x00);
- writeGr(0x05, 0x00);
- writeGr(0x01, 0x00);
- writeGr(0x08, 0xFF);
-
- while(numrects--) {
- left = rects->x & ~7;
- width = (rects->w + 7) >> 3;
- height = rects->h;
- src = (Uint32*)screen->pixels + (rects->y * SRCPitch) + (left >> 2);
- dst = (Uint8*)mapped_mem + (rects->y * FBPitch) + (left >> 3);
-
- if((phase = (long)dst & 3L)) {
- phase = 4 - phase;
- if(phase > width) phase = width;
- width -= phase;
- }
-
- while(height--) {
- writeSeq(0x02, 1 << 0);
- dstPtr = dst;
- srcPtr = src;
- i = width;
- j = phase;
- while(j--) {
- m = (srcPtr[1] & 0x01010101) | ((srcPtr[0] & 0x01010101) << 4);
- *dstPtr++ = (m >> 24) | (m >> 15) | (m >> 6) | (m << 3);
- srcPtr += 2;
- }
- while(i >= 4) {
- m = (srcPtr[1] & 0x01010101) | ((srcPtr[0] & 0x01010101) << 4);
- s1 = (m >> 24) | (m >> 15) | (m >> 6) | (m << 3);
- m = (srcPtr[3] & 0x01010101) | ((srcPtr[2] & 0x01010101) << 4);
- s2 = (m >> 24) | (m >> 15) | (m >> 6) | (m << 3);
- m = (srcPtr[5] & 0x01010101) | ((srcPtr[4] & 0x01010101) << 4);
- s3 = (m >> 24) | (m >> 15) | (m >> 6) | (m << 3);
- m = (srcPtr[7] & 0x01010101) | ((srcPtr[6] & 0x01010101) << 4);
- s4 = (m >> 24) | (m >> 15) | (m >> 6) | (m << 3);
- *((Uint32*)dstPtr) = s1 | (s2 << 8) | (s3 << 16) | (s4 << 24);
- srcPtr += 8;
- dstPtr += 4;
- i -= 4;
- }
- while(i--) {
- m = (srcPtr[1] & 0x01010101) | ((srcPtr[0] & 0x01010101) << 4);
- *dstPtr++ = (m >> 24) | (m >> 15) | (m >> 6) | (m << 3);
- srcPtr += 2;
- }
-
- writeSeq(0x02, 1 << 1);
- dstPtr = dst;
- srcPtr = src;
- i = width;
- j = phase;
- while(j--) {
- m = (srcPtr[1] & 0x02020202) | ((srcPtr[0] & 0x02020202) << 4);
- *dstPtr++ = (m >> 25) | (m >> 16) | (m >> 7) | (m << 2);
- srcPtr += 2;
- }
- while(i >= 4) {
- m = (srcPtr[1] & 0x02020202) | ((srcPtr[0] & 0x02020202) << 4);
- s1 = (m >> 25) | (m >> 16) | (m >> 7) | (m << 2);
- m = (srcPtr[3] & 0x02020202) | ((srcPtr[2] & 0x02020202) << 4);
- s2 = (m >> 25) | (m >> 16) | (m >> 7) | (m << 2);
- m = (srcPtr[5] & 0x02020202) | ((srcPtr[4] & 0x02020202) << 4);
- s3 = (m >> 25) | (m >> 16) | (m >> 7) | (m << 2);
- m = (srcPtr[7] & 0x02020202) | ((srcPtr[6] & 0x02020202) << 4);
- s4 = (m >> 25) | (m >> 16) | (m >> 7) | (m << 2);
- *((Uint32*)dstPtr) = s1 | (s2 << 8) | (s3 << 16) | (s4 << 24);
- srcPtr += 8;
- dstPtr += 4;
- i -= 4;
- }
- while(i--) {
- m = (srcPtr[1] & 0x02020202) | ((srcPtr[0] & 0x02020202) << 4);
- *dstPtr++ = (m >> 25) | (m >> 16) | (m >> 7) | (m << 2);
- srcPtr += 2;
- }
-
- writeSeq(0x02, 1 << 2);
- dstPtr = dst;
- srcPtr = src;
- i = width;
- j = phase;
- while(j--) {
- m = (srcPtr[1] & 0x04040404) | ((srcPtr[0] & 0x04040404) << 4);
- *dstPtr++ = (m >> 26) | (m >> 17) | (m >> 8) | (m << 1);
- srcPtr += 2;
- }
- while(i >= 4) {
- m = (srcPtr[1] & 0x04040404) | ((srcPtr[0] & 0x04040404) << 4);
- s1 = (m >> 26) | (m >> 17) | (m >> 8) | (m << 1);
- m = (srcPtr[3] & 0x04040404) | ((srcPtr[2] & 0x04040404) << 4);
- s2 = (m >> 26) | (m >> 17) | (m >> 8) | (m << 1);
- m = (srcPtr[5] & 0x04040404) | ((srcPtr[4] & 0x04040404) << 4);
- s3 = (m >> 26) | (m >> 17) | (m >> 8) | (m << 1);
- m = (srcPtr[7] & 0x04040404) | ((srcPtr[6] & 0x04040404) << 4);
- s4 = (m >> 26) | (m >> 17) | (m >> 8) | (m << 1);
- *((Uint32*)dstPtr) = s1 | (s2 << 8) | (s3 << 16) | (s4 << 24);
- srcPtr += 8;
- dstPtr += 4;
- i -= 4;
- }
- while(i--) {
- m = (srcPtr[1] & 0x04040404) | ((srcPtr[0] & 0x04040404) << 4);
- *dstPtr++ = (m >> 26) | (m >> 17) | (m >> 8) | (m << 1);
- srcPtr += 2;
- }
-
- writeSeq(0x02, 1 << 3);
- dstPtr = dst;
- srcPtr = src;
- i = width;
- j = phase;
- while(j--) {
- m = (srcPtr[1] & 0x08080808) | ((srcPtr[0] & 0x08080808) << 4);
- *dstPtr++ = (m >> 27) | (m >> 18) | (m >> 9) | m;
- srcPtr += 2;
- }
- while(i >= 4) {
- m = (srcPtr[1] & 0x08080808) | ((srcPtr[0] & 0x08080808) << 4);
- s1 = (m >> 27) | (m >> 18) | (m >> 9) | m;
- m = (srcPtr[3] & 0x08080808) | ((srcPtr[2] & 0x08080808) << 4);
- s2 = (m >> 27) | (m >> 18) | (m >> 9) | m;
- m = (srcPtr[5] & 0x08080808) | ((srcPtr[4] & 0x08080808) << 4);
- s3 = (m >> 27) | (m >> 18) | (m >> 9) | m;
- m = (srcPtr[7] & 0x08080808) | ((srcPtr[6] & 0x08080808) << 4);
- s4 = (m >> 27) | (m >> 18) | (m >> 9) | m;
- *((Uint32*)dstPtr) = s1 | (s2 << 8) | (s3 << 16) | (s4 << 24);
- srcPtr += 8;
- dstPtr += 4;
- i -= 4;
- }
- while(i--) {
- m = (srcPtr[1] & 0x08080808) | ((srcPtr[0] & 0x08080808) << 4);
- *dstPtr++ = (m >> 27) | (m >> 18) | (m >> 9) | m;
- srcPtr += 2;
- }
-
- dst += FBPitch;
- src += SRCPitch;
- }
- rects++;
- }
-}
-#endif /* VGA16_FBCON_SUPPORT */
-
-void FB_SavePaletteTo(_THIS, int palette_len, __u16 *area)
-{
- struct fb_cmap cmap;
-
- cmap.start = 0;
- cmap.len = palette_len;
- cmap.red = &area[0*palette_len];
- cmap.green = &area[1*palette_len];
- cmap.blue = &area[2*palette_len];
- cmap.transp = NULL;
- ioctl(console_fd, FBIOGETCMAP, &cmap);
-}
-
-void FB_RestorePaletteFrom(_THIS, int palette_len, __u16 *area)
-{
- struct fb_cmap cmap;
-
- cmap.start = 0;
- cmap.len = palette_len;
- cmap.red = &area[0*palette_len];
- cmap.green = &area[1*palette_len];
- cmap.blue = &area[2*palette_len];
- cmap.transp = NULL;
- ioctl(console_fd, FBIOPUTCMAP, &cmap);
-}
-
-static void FB_SavePalette(_THIS, struct fb_fix_screeninfo *finfo,
- struct fb_var_screeninfo *vinfo)
-{
- int i;
-
- /* Save hardware palette, if needed */
- if ( finfo->visual == FB_VISUAL_PSEUDOCOLOR ) {
- saved_cmaplen = 1<<vinfo->bits_per_pixel;
- saved_cmap=(__u16 *)SDL_malloc(3*saved_cmaplen*sizeof(*saved_cmap));
- if ( saved_cmap != NULL ) {
- FB_SavePaletteTo(this, saved_cmaplen, saved_cmap);
- }
- }
-
- /* Added support for FB_VISUAL_DIRECTCOLOR.
- With this mode pixel information is passed through the palette...
- Neat fading and gamma correction effects can be had by simply
- fooling around with the palette instead of changing the pixel
- values themselves... Very neat!
-
- Adam Meyerowitz 1/19/2000
- ameyerow@optonline.com
- */
- if ( finfo->visual == FB_VISUAL_DIRECTCOLOR ) {
- __u16 new_entries[3*256];
-
- /* Save the colormap */
- saved_cmaplen = 256;
- saved_cmap=(__u16 *)SDL_malloc(3*saved_cmaplen*sizeof(*saved_cmap));
- if ( saved_cmap != NULL ) {
- FB_SavePaletteTo(this, saved_cmaplen, saved_cmap);
- }
-
- /* Allocate new identity colormap */
- for ( i=0; i<256; ++i ) {
- new_entries[(0*256)+i] =
- new_entries[(1*256)+i] =
- new_entries[(2*256)+i] = (i<<8)|i;
- }
- FB_RestorePaletteFrom(this, 256, new_entries);
- }
-}
-
-static void FB_RestorePalette(_THIS)
-{
- /* Restore the original palette */
- if ( saved_cmap ) {
- FB_RestorePaletteFrom(this, saved_cmaplen, saved_cmap);
- SDL_free(saved_cmap);
- saved_cmap = NULL;
- }
-}
-
-static int FB_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- int i;
- __u16 r[256];
- __u16 g[256];
- __u16 b[256];
- struct fb_cmap cmap;
-
- /* Set up the colormap */
- for (i = 0; i < ncolors; i++) {
- r[i] = colors[i].r << 8;
- g[i] = colors[i].g << 8;
- b[i] = colors[i].b << 8;
- }
- cmap.start = firstcolor;
- cmap.len = ncolors;
- cmap.red = r;
- cmap.green = g;
- cmap.blue = b;
- cmap.transp = NULL;
-
- if( (ioctl(console_fd, FBIOPUTCMAP, &cmap) < 0) ||
- !(this->screen->flags & SDL_HWPALETTE) ) {
- colors = this->screen->format->palette->colors;
- ncolors = this->screen->format->palette->ncolors;
- cmap.start = 0;
- cmap.len = ncolors;
- SDL_memset(r, 0, sizeof(r));
- SDL_memset(g, 0, sizeof(g));
- SDL_memset(b, 0, sizeof(b));
- if ( ioctl(console_fd, FBIOGETCMAP, &cmap) == 0 ) {
- for ( i=ncolors-1; i>=0; --i ) {
- colors[i].r = (r[i]>>8);
- colors[i].g = (g[i]>>8);
- colors[i].b = (b[i]>>8);
- }
- }
- return(0);
- }
- return(1);
-}
-
-/* Note: If we are terminated, this could be called in the middle of
- another SDL video routine -- notably UpdateRects.
-*/
-static void FB_VideoQuit(_THIS)
-{
- int i, j;
-
- if ( this->screen ) {
- /* Clear screen and tell SDL not to free the pixels */
- if ( this->screen->pixels && FB_InGraphicsMode(this) ) {
-#if defined(__powerpc__) || defined(__ia64__) /* SIGBUS when using SDL_memset() ?? */
- Uint8 *rowp = (Uint8 *)this->screen->pixels;
- int left = this->screen->pitch*this->screen->h;
- while ( left-- ) { *rowp++ = 0; }
-#else
- SDL_memset(this->screen->pixels,0,this->screen->h*this->screen->pitch);
-#endif
- }
- /* This test fails when using the VGA16 shadow memory */
- if ( ((char *)this->screen->pixels >= mapped_mem) &&
- ((char *)this->screen->pixels < (mapped_mem+mapped_memlen)) ) {
- this->screen->pixels = NULL;
- }
- }
-
- /* Clear the lock mutex */
- if ( hw_lock ) {
- SDL_DestroyMutex(hw_lock);
- hw_lock = NULL;
- }
-
- /* Clean up defined video modes */
- for ( i=0; i<NUM_MODELISTS; ++i ) {
- if ( SDL_modelist[i] != NULL ) {
- for ( j=0; SDL_modelist[i][j]; ++j ) {
- SDL_free(SDL_modelist[i][j]);
- }
- SDL_free(SDL_modelist[i]);
- SDL_modelist[i] = NULL;
- }
- }
-
- /* Clean up the memory bucket list */
- FB_FreeHWSurfaces(this);
-
- /* Close console and input file descriptors */
- if ( console_fd > 0 ) {
- /* Unmap the video framebuffer and I/O registers */
- if ( mapped_mem ) {
- munmap(mapped_mem, mapped_memlen);
- mapped_mem = NULL;
- }
- if ( mapped_io ) {
- munmap(mapped_io, mapped_iolen);
- mapped_io = NULL;
- }
-
- /* Restore the original video mode and palette */
- if ( FB_InGraphicsMode(this) ) {
- FB_RestorePalette(this);
- ioctl(console_fd, FBIOPUT_VSCREENINFO, &saved_vinfo);
- }
-
- /* We're all done with the framebuffer */
- close(console_fd);
- console_fd = -1;
- }
- FB_CloseMouse(this);
- FB_CloseKeyboard(this);
-}
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbvideo.h b/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbvideo.h
deleted file mode 100644
index 8a8fa10..0000000
--- a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbvideo.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_fbvideo_h
-#define _SDL_fbvideo_h
-
-#include <sys/types.h>
-#include <termios.h>
-#include <linux/fb.h>
-
-#include "SDL_mouse.h"
-#include "SDL_mutex.h"
-#include "../SDL_sysvideo.h"
-#if SDL_INPUT_TSLIB
-#include "tslib.h"
-#endif
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-
-/* This is the structure we use to keep track of video memory */
-typedef struct vidmem_bucket {
- struct vidmem_bucket *prev;
- int used;
- int dirty;
- char *base;
- unsigned int size;
- struct vidmem_bucket *next;
-} vidmem_bucket;
-
-/* Private display data */
-struct SDL_PrivateVideoData {
- int console_fd;
- struct fb_var_screeninfo cache_vinfo;
- struct fb_var_screeninfo saved_vinfo;
- int saved_cmaplen;
- __u16 *saved_cmap;
-
- int current_vt;
- int saved_vt;
- int keyboard_fd;
- int saved_kbd_mode;
- struct termios saved_kbd_termios;
-
- int mouse_fd;
-#if SDL_INPUT_TSLIB
- struct tsdev *ts_dev;
-#endif
-
- char *mapped_mem;
- int mapped_memlen;
- int mapped_offset;
- char *mapped_io;
- long mapped_iolen;
- int flip_page;
- char *flip_address[2];
-
-#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
- int SDL_nummodes[NUM_MODELISTS];
- SDL_Rect **SDL_modelist[NUM_MODELISTS];
-
- vidmem_bucket surfaces;
- int surfaces_memtotal;
- int surfaces_memleft;
-
- SDL_mutex *hw_lock;
- int switched_away;
- struct fb_var_screeninfo screen_vinfo;
- Uint32 screen_arealen;
- Uint8 *screen_contents;
- __u16 screen_palette[3*256];
-
- void (*wait_vbl)(_THIS);
- void (*wait_idle)(_THIS);
-};
-/* Old variable names */
-#define console_fd (this->hidden->console_fd)
-#define current_vt (this->hidden->current_vt)
-#define saved_vt (this->hidden->saved_vt)
-#define keyboard_fd (this->hidden->keyboard_fd)
-#define saved_kbd_mode (this->hidden->saved_kbd_mode)
-#define saved_kbd_termios (this->hidden->saved_kbd_termios)
-#define mouse_fd (this->hidden->mouse_fd)
-#if SDL_INPUT_TSLIB
-#define ts_dev (this->hidden->ts_dev)
-#endif
-#define cache_vinfo (this->hidden->cache_vinfo)
-#define saved_vinfo (this->hidden->saved_vinfo)
-#define saved_cmaplen (this->hidden->saved_cmaplen)
-#define saved_cmap (this->hidden->saved_cmap)
-#define mapped_mem (this->hidden->mapped_mem)
-#define mapped_memlen (this->hidden->mapped_memlen)
-#define mapped_offset (this->hidden->mapped_offset)
-#define mapped_io (this->hidden->mapped_io)
-#define mapped_iolen (this->hidden->mapped_iolen)
-#define flip_page (this->hidden->flip_page)
-#define flip_address (this->hidden->flip_address)
-#define SDL_nummodes (this->hidden->SDL_nummodes)
-#define SDL_modelist (this->hidden->SDL_modelist)
-#define surfaces (this->hidden->surfaces)
-#define surfaces_memtotal (this->hidden->surfaces_memtotal)
-#define surfaces_memleft (this->hidden->surfaces_memleft)
-#define hw_lock (this->hidden->hw_lock)
-#define switched_away (this->hidden->switched_away)
-#define screen_vinfo (this->hidden->screen_vinfo)
-#define screen_arealen (this->hidden->screen_arealen)
-#define screen_contents (this->hidden->screen_contents)
-#define screen_palette (this->hidden->screen_palette)
-#define wait_vbl (this->hidden->wait_vbl)
-#define wait_idle (this->hidden->wait_idle)
-
-/* Accelerator types that are supported by the driver, but are not
- necessarily in the kernel headers on the system we compile on.
-*/
-#ifndef FB_ACCEL_MATROX_MGAG400
-#define FB_ACCEL_MATROX_MGAG400 26 /* Matrox G400 */
-#endif
-#ifndef FB_ACCEL_3DFX_BANSHEE
-#define FB_ACCEL_3DFX_BANSHEE 31 /* 3Dfx Banshee */
-#endif
-
-/* These functions are defined in SDL_fbvideo.c */
-extern void FB_SavePaletteTo(_THIS, int palette_len, __u16 *area);
-extern void FB_RestorePaletteFrom(_THIS, int palette_len, __u16 *area);
-
-/* These are utility functions for working with video surfaces */
-
-static __inline__ void FB_AddBusySurface(SDL_Surface *surface)
-{
- ((vidmem_bucket *)surface->hwdata)->dirty = 1;
-}
-
-static __inline__ int FB_IsSurfaceBusy(SDL_Surface *surface)
-{
- return ((vidmem_bucket *)surface->hwdata)->dirty;
-}
-
-static __inline__ void FB_WaitBusySurfaces(_THIS)
-{
- vidmem_bucket *bucket;
-
- /* Wait for graphic operations to complete */
- wait_idle(this);
-
- /* Clear all surface dirty bits */
- for ( bucket=&surfaces; bucket; bucket=bucket->next ) {
- bucket->dirty = 0;
- }
-}
-
-static __inline__ void FB_dst_to_xy(_THIS, SDL_Surface *dst, int *x, int *y)
-{
- *x = (long)((char *)dst->pixels - mapped_mem)%this->screen->pitch;
- *y = (long)((char *)dst->pixels - mapped_mem)/this->screen->pitch;
- if ( dst == this->screen ) {
- *x += this->offset_x;
- *y += this->offset_y;
- }
-}
-
-#endif /* _SDL_fbvideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/matrox_mmio.h b/distrib/sdl-1.2.12/src/video/fbcon/matrox_mmio.h
deleted file mode 100644
index 99c7661..0000000
--- a/distrib/sdl-1.2.12/src/video/fbcon/matrox_mmio.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* MGA register definitions */
-
-#include "matrox_regs.h"
-
-/* MGA control macros */
-
-#define mga_in8(reg) *(volatile Uint8 *)(mapped_io + (reg))
-#define mga_in32(reg) *(volatile Uint32 *)(mapped_io + (reg))
-
-#define mga_out8(reg,v) *(volatile Uint8 *)(mapped_io + (reg)) = v;
-#define mga_out32(reg,v) *(volatile Uint32 *)(mapped_io + (reg)) = v;
-
-
-/* Wait for fifo space */
-#define mga_wait(space) \
-{ \
- while ( mga_in8(MGAREG_FIFOSTATUS) < space ) \
- ; \
-}
-
-
-/* Wait for idle accelerator */
-#define mga_waitidle() \
-{ \
- while ( mga_in32(MGAREG_STATUS) & 0x10000 ) \
- ; \
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/out b/distrib/sdl-1.2.12/src/video/fbcon/out
deleted file mode 100644
index 1af0645..0000000
--- a/distrib/sdl-1.2.12/src/video/fbcon/out
+++ /dev/null
@@ -1,29 +0,0 @@
-Index: SDL_fbevents.c
-===================================================================
---- SDL_fbevents.c (revision 2338)
-+++ SDL_fbevents.c (working copy)
-@@ -55,6 +55,7 @@
- #define GPM_NODE_FIFO "/dev/gpmdata"
- #endif
-
-+/*#define DEBUG_KEYBOARD*/
- /*#define DEBUG_MOUSE*/
-
- /* The translation tables from a console scancode to a SDL keysym */
-@@ -281,8 +282,15 @@
- }
- if ( keyboard_fd < 0 ) {
- /* Last resort, maybe our tty is a usable VT */
-- current_vt = 0;
-+ struct vt_stat vtstate;
-+
- keyboard_fd = open("/dev/tty", O_RDWR);
-+
-+ if ( ioctl(keyboard_fd, VT_GETSTATE, &vtstate) == 0 ) {
-+ current_vt = vtstate.v_active;
-+ } else {
-+ current_vt = 0;
-+ }
- }
- #ifdef DEBUG_KEYBOARD
- fprintf(stderr, "Current VT: %d\n", current_vt);
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/riva_regs.h b/distrib/sdl-1.2.12/src/video/fbcon/riva_regs.h
deleted file mode 100644
index 4a21c07..0000000
--- a/distrib/sdl-1.2.12/src/video/fbcon/riva_regs.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _RIVA_REGS_H
-#define _RIVA_REGS_H
-
-/* This information comes from the XFree86 NVidia hardware driver */
-
-/* mapped_io register offsets */
-#define PGRAPH_OFFSET 0x00400000
-#define FIFO_OFFSET 0x00800000
-#define ROP_OFFSET FIFO_OFFSET+0x00000000
-#define CLIP_OFFSET FIFO_OFFSET+0x00002000
-#define PATT_OFFSET FIFO_OFFSET+0x00004000
-#define PIXMAP_OFFSET FIFO_OFFSET+0x00006000
-#define BLT_OFFSET FIFO_OFFSET+0x00008000
-#define BITMAP_OFFSET FIFO_OFFSET+0x0000A000
-#define LINE_OFFSET FIFO_OFFSET+0x0000C000
-#define TRI03_OFFSET FIFO_OFFSET+0x0000E000
-#define PCIO_OFFSET 0x00601000
-
-#endif /* _RIVA_REGS_H */
-
diff --git a/distrib/sdl-1.2.12/src/video/gapi/SDL_gapivideo.c b/distrib/sdl-1.2.12/src/video/gapi/SDL_gapivideo.c
deleted file mode 100644
index 0dfce50..0000000
--- a/distrib/sdl-1.2.12/src/video/gapi/SDL_gapivideo.c
+++ /dev/null
@@ -1,1232 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Pocket PC GAPI SDL video driver implementation;
-Implemented by Dmitry Yakimov - support@activekitten.com
-Inspired by http://arisme.free.fr/ports/SDL.php
-*/
-
-// TODO: copy surface on window when lost focus
-// TODO: test buttons rotation
-// TODO: test on be300 and HPC ( check WinDib fullscreen keys catching )
-// TODO: test on smartphones
-// TODO: windib on SH3 PPC2000 landscape test
-// TODO: optimize 8bpp landscape mode
-
-// there is some problems in runnings apps from a device landscape mode
-// due to WinCE bugs. Some works and some - does not.
-// TODO: finish Axim Dell X30 and user landscape mode, device landscape mode
-// TODO: finish Axim Dell X30 user portrait, device landscape stylus conversion
-// TODO: fix running GAPI apps from landscape mode -
-// wince goes to portrait mode, but does not update video memory
-
-
-#include "SDL.h"
-#include "SDL_error.h"
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-#include "../wincommon/SDL_syswm_c.h"
-#include "../wincommon/SDL_sysmouse_c.h"
-#include "../windib/SDL_dibevents_c.h"
-
-#include "SDL_gapivideo.h"
-
-#define GAPIVID_DRIVER_NAME "gapi"
-
-#if defined(DEBUG) || defined (_DEBUG) || defined(NDEBUG)
-#define REPORT_VIDEO_INFO 1
-#else
-#define REPORT_VIDEO_INFO 0
-#endif
-
-// for testing with GapiEmu
-#define USE_GAPI_EMU 0
-#define EMULATE_AXIM_X30 0
-#define WITHOUT_GAPI 0
-
-#if USE_GAPI_EMU && !REPORT_VIDEO_INFO
-#pragma message("Warning: Using GapiEmu in release build. I assume you'd like to set USE_GAPI_EMU to zero.")
-#endif
-
-// defined and used in SDL_sysevents.c
-extern HINSTANCE aygshell;
-extern void SDL_UnregisterApp();
-extern int DIB_AddMode(_THIS, int bpp, int w, int h);
-
-/* Initialization/Query functions */
-static int GAPI_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **GAPI_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *GAPI_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int GAPI_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
-static void GAPI_VideoQuit(_THIS);
-
-/* Hardware surface functions */
-static int GAPI_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int GAPI_LockHWSurface(_THIS, SDL_Surface *surface);
-static void GAPI_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static void GAPI_FreeHWSurface(_THIS, SDL_Surface *surface);
-
-/* Windows message handling functions, will not be processed */
-static void GAPI_RealizePalette(_THIS);
-static void GAPI_PaletteChanged(_THIS, HWND window);
-static void GAPI_WinPAINT(_THIS, HDC hdc);
-
-/* etc. */
-static void GAPI_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
-
-static HMODULE g_hGapiLib = 0;
-#define LINK(type,name,import) \
- if( g_hGapiLib ) \
- name = (PFN##type)GetProcAddress( g_hGapiLib, _T(import) );
-
-static char g_bRawBufferAvailable = 0;
-
-/* GAPI driver bootstrap functions */
-
-/* hi res definitions */
-typedef struct _RawFrameBufferInfo
-{
- WORD wFormat;
- WORD wBPP;
- VOID *pFramePointer;
- int cxStride;
- int cyStride;
- int cxPixels;
- int cyPixels;
-} RawFrameBufferInfo;
-
-static struct _RawFrameBufferInfo g_RawFrameBufferInfo = {0};
-
-#define GETRAWFRAMEBUFFER 0x00020001
-
-#define FORMAT_565 1
-#define FORMAT_555 2
-#define FORMAT_OTHER 3
-
-/* Dell Axim x30 hangs when we use GAPI from landscape,
- so lets avoid using GxOpenDisplay there via GETGXINFO trick
- It seems that GAPI subsystem use the same ExtEscape code.
-*/
-#define GETGXINFO 0x00020000
-
-typedef struct GXDeviceInfo
-{
-long Version; //00 (should filled with 100 before calling ExtEscape)
-void * pvFrameBuffer; //04
-unsigned long cbStride; //08
-unsigned long cxWidth; //0c
-unsigned long cyHeight; //10
-unsigned long cBPP; //14
-unsigned long ffFormat; //18
-char Unused[0x84-7*4];
-} GXDeviceInfo;
-
-static int GAPI_Available(void)
-{
- // try to use VGA display, even on emulator
- HDC hdc = GetDC(NULL);
- int result = ExtEscape(hdc, GETRAWFRAMEBUFFER, 0, NULL, sizeof(RawFrameBufferInfo), (char *)&g_RawFrameBufferInfo);
- ReleaseDC(NULL, hdc);
- g_bRawBufferAvailable = result > 0;
-
-#if WITHOUT_GAPI
- return g_bRawBufferAvailable;
-#endif
-
-#if USE_GAPI_EMU
- g_hGapiLib = LoadLibrary(_T("GAPI_Emu.dll"));
- if( !g_hGapiLib )
- {
- SDL_SetError("Gapi Emu not found!");
- }
- return g_hGapiLib != 0;
-#endif
-
- // try to find gx.dll
- g_hGapiLib = LoadLibrary(_T("\\Windows\\gx.dll"));
- if( !g_hGapiLib )
- {
- g_hGapiLib = LoadLibrary(_T("gx.dll"));
- if( !g_hGapiLib ) return g_bRawBufferAvailable;
- }
-
- return(1);
-}
-
-static int cmpmodes(const void *va, const void *vb)
-{
- SDL_Rect *a = *(SDL_Rect **)va;
- SDL_Rect *b = *(SDL_Rect **)vb;
- if ( a->w == b->w )
- return b->h - a->h;
- else
- return b->w - a->w;
-}
-
-static int GAPI_AddMode(_THIS, int bpp, int w, int h)
-{
- SDL_Rect *mode;
- int i, index;
- int next_mode;
-
- /* Check to see if we already have this mode */
- if ( bpp < 8 ) { /* Not supported */
- return(0);
- }
- index = ((bpp+7)/8)-1;
- for ( i=0; i<gapi->SDL_nummodes[index]; ++i ) {
- mode = gapi->SDL_modelist[index][i];
- if ( (mode->w == w) && (mode->h == h) ) {
- return(0);
- }
- }
-
- /* Set up the new video mode rectangle */
- mode = (SDL_Rect *)SDL_malloc(sizeof *mode);
- if ( mode == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
- mode->x = 0;
- mode->y = 0;
- mode->w = w;
- mode->h = h;
-
- /* Allocate the new list of modes, and fill in the new mode */
- next_mode = gapi->SDL_nummodes[index];
- gapi->SDL_modelist[index] = (SDL_Rect **)
- SDL_realloc(gapi->SDL_modelist[index], (1+next_mode+1)*sizeof(SDL_Rect *));
- if ( gapi->SDL_modelist[index] == NULL ) {
- SDL_OutOfMemory();
- gapi->SDL_nummodes[index] = 0;
- SDL_free(mode);
- return(-1);
- }
- gapi->SDL_modelist[index][next_mode] = mode;
- gapi->SDL_modelist[index][next_mode+1] = NULL;
- gapi->SDL_nummodes[index]++;
-
- return(0);
-}
-
-static void GAPI_DeleteDevice(SDL_VideoDevice *device)
-{
- if( g_hGapiLib )
- {
- FreeLibrary(g_hGapiLib);
- g_hGapiLib = 0;
- }
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_VideoDevice *GAPI_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
-
- if( !g_hGapiLib && !g_bRawBufferAvailable)
- {
- if( !GAPI_Available() )
- {
- SDL_SetError("GAPI dll is not found and VGA mode is not available!");
- return 0;
- }
- }
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device ) {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *device->hidden));
- }
- if ( (device == NULL) || (device->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( device ) {
- SDL_free(device);
- }
- return(0);
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
-
- /* Set the function pointers */
- device->VideoInit = GAPI_VideoInit;
- device->ListModes = GAPI_ListModes;
- device->SetVideoMode = GAPI_SetVideoMode;
- device->UpdateMouse = WIN_UpdateMouse;
- device->CreateYUVOverlay = NULL;
- device->SetColors = GAPI_SetColors;
- device->UpdateRects = GAPI_UpdateRects;
- device->VideoQuit = GAPI_VideoQuit;
- device->AllocHWSurface = GAPI_AllocHWSurface;
- device->CheckHWBlit = NULL;
- device->FillHWRect = NULL;
- device->SetHWColorKey = NULL;
- device->SetHWAlpha = NULL;
- device->LockHWSurface = GAPI_LockHWSurface;
- device->UnlockHWSurface = GAPI_UnlockHWSurface;
- device->FlipHWSurface = NULL;
- device->FreeHWSurface = GAPI_FreeHWSurface;
- device->SetCaption = WIN_SetWMCaption;
- device->SetIcon = WIN_SetWMIcon;
- device->IconifyWindow = WIN_IconifyWindow;
- device->GrabInput = WIN_GrabInput;
- device->GetWMInfo = WIN_GetWMInfo;
- device->FreeWMCursor = WIN_FreeWMCursor;
- device->CreateWMCursor = WIN_CreateWMCursor;
- device->ShowWMCursor = WIN_ShowWMCursor;
- device->WarpWMCursor = WIN_WarpWMCursor;
- device->CheckMouseMode = WIN_CheckMouseMode;
- device->InitOSKeymap = DIB_InitOSKeymap;
- device->PumpEvents = DIB_PumpEvents;
-
- /* Set up the windows message handling functions */
- WIN_RealizePalette = GAPI_RealizePalette;
- WIN_PaletteChanged = GAPI_PaletteChanged;
- WIN_WinPAINT = GAPI_WinPAINT;
- HandleMessage = DIB_HandleMessage;
-
- device->free = GAPI_DeleteDevice;
-
- /* Load gapi library */
-#define gx device->hidden->gxFunc
-
- LINK( GXOpenDisplay, gx.GXOpenDisplay, "?GXOpenDisplay@@YAHPAUHWND__@@K@Z" )
- LINK( GXCloseDisplay, gx.GXCloseDisplay, "?GXCloseDisplay@@YAHXZ" )
- LINK( GXBeginDraw, gx.GXBeginDraw, "?GXBeginDraw@@YAPAXXZ" )
- LINK( GXEndDraw, gx.GXEndDraw, "?GXEndDraw@@YAHXZ" )
- LINK( GXOpenInput, gx.GXOpenInput, "?GXOpenInput@@YAHXZ" )
- LINK( GXCloseInput, gx.GXCloseInput, "?GXCloseInput@@YAHXZ" )
- LINK( GXGetDisplayProperties, gx.GXGetDisplayProperties,"?GXGetDisplayProperties@@YA?AUGXDisplayProperties@@XZ" )
- LINK( GXGetDefaultKeys, gx.GXGetDefaultKeys, "?GXGetDefaultKeys@@YA?AUGXKeyList@@H@Z" )
- LINK( GXSuspend, gx.GXSuspend, "?GXSuspend@@YAHXZ" )
- LINK( GXResume, gx.GXResume, "?GXResume@@YAHXZ" )
- LINK( GXSetViewport, gx.GXSetViewport, "?GXSetViewport@@YAHKKKK@Z" )
- LINK( GXIsDisplayDRAMBuffer, gx.GXIsDisplayDRAMBuffer, "?GXIsDisplayDRAMBuffer@@YAHXZ" )
-
- /* wrong gapi.dll */
- if( !gx.GXOpenDisplay )
- {
- if( g_hGapiLib )
- {
- FreeLibrary(g_hGapiLib);
- g_hGapiLib = 0;
- }
- }
-
- if( !gx.GXOpenDisplay && !g_bRawBufferAvailable)
- {
- SDL_SetError("Error: damaged or unknown gapi.dll!\n");
- GAPI_DeleteDevice(device);
- return 0;
- }
-
- return device;
-}
-
-VideoBootStrap GAPI_bootstrap = {
- GAPIVID_DRIVER_NAME, "WinCE GAPI video driver",
- GAPI_Available, GAPI_CreateDevice
-};
-
-static void FillStructs(_THIS, BOOL useVga)
-{
-#ifdef _ARM_
- WCHAR oemstr[100];
-#endif
- /* fill a device properties */
-
- if( !useVga )
- {
- this->hidden->gxProperties = this->hidden->gxFunc.GXGetDisplayProperties();
- this->hidden->needUpdate = 1;
- this->hidden->hiresFix = 0;
- this->hidden->useVga = 0;
- this->hidden->useGXOpenDisplay = 1;
-
-#ifdef _ARM_
- /* check some devices and extract addition info */
- SystemParametersInfo( SPI_GETOEMINFO, sizeof( oemstr ), oemstr, 0 );
-
- // buggy iPaq38xx
- if ((oemstr[12] == 'H') && (oemstr[13] == '3') && (oemstr[14] == '8') && (this->hidden->gxProperties.cbxPitch > 0))
- {
- this->hidden->videoMem = (PIXEL*)0xac0755a0;
- this->hidden->gxProperties.cbxPitch = -640;
- this->hidden->gxProperties.cbyPitch = 2;
- this->hidden->needUpdate = 0;
- }
-#if (EMULATE_AXIM_X30 == 0)
- // buggy Dell Axim X30
- if( _tcsncmp(oemstr, L"Dell Axim X30", 13) == 0 )
-#endif
- {
- GXDeviceInfo gxInfo = {0};
- HDC hdc = GetDC(NULL);
- int result;
-
- gxInfo.Version = 100;
- result = ExtEscape(hdc, GETGXINFO, 0, NULL, sizeof(gxInfo), (char *)&gxInfo);
- if( result > 0 )
- {
- this->hidden->useGXOpenDisplay = 0;
- this->hidden->videoMem = gxInfo.pvFrameBuffer;
- this->hidden->needUpdate = 0;
- this->hidden->gxProperties.cbxPitch = 2;
- this->hidden->gxProperties.cbyPitch = 480;
- this->hidden->gxProperties.cxWidth = gxInfo.cxWidth;
- this->hidden->gxProperties.cyHeight = gxInfo.cyHeight;
- this->hidden->gxProperties.ffFormat = gxInfo.ffFormat;
- }
- }
-#endif
- } else
- {
- this->hidden->needUpdate = 0;
- this->hidden->hiresFix = 0;
- this->hidden->gxProperties.cBPP = g_RawFrameBufferInfo.wBPP;
- this->hidden->gxProperties.cbxPitch = g_RawFrameBufferInfo.cxStride;
- this->hidden->gxProperties.cbyPitch = g_RawFrameBufferInfo.cyStride;
- this->hidden->gxProperties.cxWidth = g_RawFrameBufferInfo.cxPixels;
- this->hidden->gxProperties.cyHeight = g_RawFrameBufferInfo.cyPixels;
- this->hidden->videoMem = g_RawFrameBufferInfo.pFramePointer;
- this->hidden->useVga = 1;
-
- switch( g_RawFrameBufferInfo.wFormat )
- {
- case FORMAT_565:
- this->hidden->gxProperties.ffFormat = kfDirect565;
- break;
- case FORMAT_555:
- this->hidden->gxProperties.ffFormat = kfDirect555;
- break;
- default:
- /* unknown pixel format, try define by BPP! */
- switch( g_RawFrameBufferInfo.wBPP )
- {
- case 4:
- case 8:
- this->hidden->gxProperties.ffFormat = kfDirect;
- case 16:
- this->hidden->gxProperties.ffFormat = kfDirect565;
- default:
- this->hidden->gxProperties.ffFormat = kfDirect;
- break;
- }
- }
- }
-
- if( this->hidden->gxProperties.cBPP != 16 )
- {
- this->hidden->gapiOrientation = SDL_ORIENTATION_UP;
- } else
- if( (this->hidden->gxProperties.cbxPitch > 0) && (this->hidden->gxProperties.cbyPitch > 0 ))
- {
- this->hidden->gapiOrientation = SDL_ORIENTATION_UP;
- } else
- if( (this->hidden->gxProperties.cbxPitch > 0) && (this->hidden->gxProperties.cbyPitch < 0 ))
- {
- this->hidden->gapiOrientation = SDL_ORIENTATION_RIGHT; // ipaq 3660
- } else
- if( (this->hidden->gxProperties.cbxPitch < 0) && (this->hidden->gxProperties.cbyPitch > 0 ))
- {
- this->hidden->gapiOrientation = SDL_ORIENTATION_LEFT; // ipaq 3800
- }
-}
-
-static void GAPI_CreatePalette(int ncolors, SDL_Color *colors)
-{
- // Setup a custom color palette
- BYTE buffer[ sizeof(LOGPALETTE) + 255 * sizeof(PALETTEENTRY) ];
- int i;
- LOGPALETTE* pLogical = (LOGPALETTE*)buffer;
- PALETTEENTRY* entries = pLogical->palPalEntry;
- HPALETTE hPalette;
- HDC hdc;
-
- for (i = 0; i < ncolors; ++i)
- {
- // Find intensity by replicating the bit patterns over a byte
- entries[i].peRed = colors[i].r;
- entries[i].peGreen = colors[i].g;
- entries[i].peBlue = colors[i].b;
- entries[i].peFlags = 0;
- }
-
- // Create the GDI palette object
- pLogical->palVersion = 0x0300;
- pLogical->palNumEntries = ncolors;
-
- hPalette = CreatePalette( pLogical );
- ASSERT(hPalette);
-
-
- // Realize the palette
- hdc = GetDC(0);
-
- SelectPalette( hdc, hPalette, FALSE );
- RealizePalette( hdc );
-
- ReleaseDC( 0, hdc );
- DeleteObject( hPalette );
-}
-
-int GAPI_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- int i,bpp;
-
- /* Create the window */
- if ( DIB_CreateWindow(this) < 0 ) {
- return(-1);
- }
-
- if( g_hGapiLib )
- {
- FillStructs(this, 0);
-
- // SDL does not supports 2/4bpp mode, so use 16 bpp
- bpp = gapi->gxProperties.cBPP < 8 ? 16 : gapi->gxProperties.cBPP;
-
- /* set up normal and landscape mode */
- GAPI_AddMode(this, bpp, gapi->gxProperties.cyHeight, gapi->gxProperties.cxWidth);
- GAPI_AddMode(this, bpp, gapi->gxProperties.cxWidth, gapi->gxProperties.cyHeight);
- }
-
- /* add hi-res mode */
- if( g_bRawBufferAvailable &&
- !((gapi->gxProperties.cxWidth == (unsigned)g_RawFrameBufferInfo.cxPixels) && (gapi->gxProperties.cyHeight == (unsigned)g_RawFrameBufferInfo.cyPixels)))
- {
- FillStructs(this, 1);
-
- // SDL does not supports 2/4bpp mode, so use 16 bpp
- bpp = gapi->gxProperties.cBPP < 8 ? 16 : gapi->gxProperties.cBPP;
-
- /* set up normal and landscape mode */
- GAPI_AddMode(this, bpp, gapi->gxProperties.cyHeight, gapi->gxProperties.cxWidth);
- GAPI_AddMode(this, bpp, gapi->gxProperties.cxWidth, gapi->gxProperties.cyHeight);
- }
-
- /* Determine the current screen size */
- this->info.current_w = gapi->gxProperties.cxWidth;
- this->info.current_h = gapi->gxProperties.cyHeight;
-
- /* Sort the mode lists */
- for ( i=0; i<NUM_MODELISTS; ++i ) {
- if ( gapi->SDL_nummodes[i] > 0 ) {
- SDL_qsort(gapi->SDL_modelist[i], gapi->SDL_nummodes[i], sizeof *gapi->SDL_modelist[i], cmpmodes);
- }
- }
-
- vformat->BitsPerPixel = this->hidden->gxProperties.cBPP < 8 ? 16 : (unsigned char)this->hidden->gxProperties.cBPP;
-
- // Get color mask
- if (this->hidden->gxProperties.ffFormat & kfDirect565) {
- vformat->BitsPerPixel = 16;
- vformat->Rmask = 0x0000f800;
- vformat->Gmask = 0x000007e0;
- vformat->Bmask = 0x0000001f;
- this->hidden->videoMode = GAPI_DIRECT_565;
- }
- else
- if (this->hidden->gxProperties.ffFormat & kfDirect555) {
- vformat->BitsPerPixel = 16;
- vformat->Rmask = 0x00007c00;
- vformat->Gmask = 0x000003e0;
- vformat->Bmask = 0x0000001f;
- this->hidden->videoMode = GAPI_DIRECT_555;
- }
- else
- if ((this->hidden->gxProperties.ffFormat & kfDirect) && (this->hidden->gxProperties.cBPP < 8)) {
- // We'll perform the conversion
- vformat->BitsPerPixel = 16;
- vformat->Rmask = 0x0000f800; // 16 bit 565
- vformat->Gmask = 0x000007e0;
- vformat->Bmask = 0x0000001f;
- if (this->hidden->gxProperties.ffFormat & kfDirectInverted)
- this->hidden->invert = (1 << this->hidden->gxProperties.cBPP) - 1;
- this->hidden->colorscale = this->hidden->gxProperties.cBPP < 8 ? 8 - this->hidden->gxProperties.cBPP : 0;
- this->hidden->videoMode = GAPI_MONO;
- }
- else
- if (this->hidden->gxProperties.ffFormat & kfPalette) {
- this->hidden->videoMode = GAPI_PALETTE;
- }
-
- /* We're done! */
- return(0);
-}
-
-SDL_Rect **GAPI_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- return(this->hidden->SDL_modelist[((format->BitsPerPixel+7)/8)-1]);
-// return (SDL_Rect **) -1;
-}
-
-SDL_Surface *GAPI_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- SDL_Surface *video;
- Uint32 Rmask, Gmask, Bmask;
- DWORD style;
- SDL_Rect allScreen;
-
- if( bpp < 4 )
- {
- SDL_SetError("1 bpp and 2 bpp modes is not implemented yet!");
- return 0;
- }
-
- /* Recalculate bitmasks if necessary */
- if (bpp == current->format->BitsPerPixel) {
- video = current;
- }
- else {
- switch(bpp) {
- case 8:
- Rmask = 0;
- Gmask = 0;
- Bmask = 0;
- break;
- case 15:
- case 16:
- /* Default is 565 unless the display is specifically 555 */
- if (this->hidden->gxProperties.ffFormat & kfDirect555) {
- Rmask = 0x00007c00;
- Gmask = 0x000003e0;
- Bmask = 0x0000001f;
- }
- else {
- Rmask = 0x0000f800;
- Gmask = 0x000007e0;
- Bmask = 0x0000001f;
- }
- break;
- case 24:
- case 32:
- Rmask = 0x00ff0000;
- Gmask = 0x0000ff00;
- Bmask = 0x000000ff;
- break;
- default:
- SDL_SetError("Unsupported Bits Per Pixel format requested");
- return NULL;
- }
- video = SDL_CreateRGBSurface(SDL_SWSURFACE,
- 0, 0, bpp, Rmask, Gmask, Bmask, 0);
- if ( video == NULL ) {
- SDL_OutOfMemory();
- return(NULL);
- }
- }
-
- gapi->userOrientation = SDL_ORIENTATION_UP;
- video->flags = SDL_FULLSCREEN; /* Clear flags, GAPI supports fullscreen only */
-
- /* GAPI or VGA? */
- if( g_hGapiLib )
- {
- FillStructs(this, 0);
- if( (((unsigned)width != gapi->gxProperties.cxWidth) || ((unsigned)height != gapi->gxProperties.cyHeight))
- && (((unsigned)width != gapi->gxProperties.cyHeight) || ((unsigned)height != gapi->gxProperties.cxWidth)))
- FillStructs(this, 1); // gapi is found but we use VGA resolution
- } else
- FillStructs(this, 1);
-
- if ( !this->hidden->needUpdate && !this->hidden->videoMem) {
- SDL_SetError("Couldn't get address of video memory, may be unsupported device or bug");
- return(NULL);
- }
-
- /* detect user landscape mode */
- if( (width > height) && (GetSystemMetrics(SM_CXSCREEN) < GetSystemMetrics(SM_CYSCREEN)))
- gapi->userOrientation = SDL_ORIENTATION_RIGHT;
-
- /* shall we apply hires fix? for example when we do not use hires resource */
- gapi->hiresFix = 0;
- if( gapi->userOrientation == SDL_ORIENTATION_RIGHT )
- {
- if( (width > GetSystemMetrics(SM_CYSCREEN)) || (height > GetSystemMetrics(SM_CXSCREEN)))
- gapi->hiresFix = 1;
- } else
- if( (width > GetSystemMetrics(SM_CXSCREEN)) || (height > GetSystemMetrics(SM_CYSCREEN)))
- if( !((width == GetSystemMetrics(SM_CYSCREEN)) && (height == GetSystemMetrics(SM_CXSCREEN)))) // user portrait, device landscape
- gapi->hiresFix = 1;
-
- switch( gapi->userOrientation )
- {
- case SDL_ORIENTATION_UP:
- gapi->startOffset = 0;
- gapi->dstLineStep = gapi->gxProperties.cbyPitch;
- gapi->dstPixelStep = gapi->gxProperties.cbxPitch;
- break;
- case SDL_ORIENTATION_RIGHT:
- switch( gapi->gapiOrientation )
- {
- case SDL_ORIENTATION_UP:
- case SDL_ORIENTATION_RIGHT:
- case SDL_ORIENTATION_LEFT:
- if( (this->hidden->videoMode == GAPI_MONO) )
- gapi->startOffset = -gapi->gxProperties.cbxPitch + 1; // monochrome mode
- else
- gapi->startOffset = gapi->gxProperties.cbyPitch * (gapi->gxProperties.cyHeight - 1);
-
- gapi->dstLineStep = gapi->gxProperties.cbxPitch;
- gapi->dstPixelStep = -gapi->gxProperties.cbyPitch;
- break;
- }
- }
-
- video->w = this->hidden->w = width;
- video->h = this->hidden->h = height;
- video->pitch = SDL_CalculatePitch(video);
-
- /* Small fix for WinCE/Win32 - when activating window
- SDL_VideoSurface is equal to zero, so activating code
- is not called properly for fullscreen windows because
- macros WINDIB_FULLSCREEN uses SDL_VideoSurface
- */
- SDL_VideoSurface = video;
-
- /* GAPI is always fullscreen, title bar is useless */
- style = 0;
-
- if (!SDL_windowid)
- SetWindowLong(SDL_Window, GWL_STYLE, style);
-
- /* Allocate bitmap */
- if(gapiBuffer)
- {
- SDL_free(gapiBuffer);
- gapiBuffer = NULL;
- }
- gapiBuffer = SDL_malloc(video->h * video->pitch);
- video->pixels = gapiBuffer;
-
- if ( ! this->hidden->buffer ) {
- SDL_SetError("Couldn't allocate buffer for requested mode");
- return(NULL);
- }
-
- SDL_memset(gapiBuffer, 255, video->h * video->pitch);
- MoveWindow(SDL_Window, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), FALSE);
- ShowWindow(SDL_Window, SW_SHOW);
- SetForegroundWindow(SDL_Window);
-
- /* JC 14 Mar 2006
- Flush the message loop or this can cause big problems later
- Especially if the user decides to use dialog boxes or assert()!
- */
- WIN_FlushMessageQueue();
-
- /* Open GAPI display */
- if( !gapi->useVga && this->hidden->useGXOpenDisplay )
- if( !gapi->gxFunc.GXOpenDisplay(SDL_Window, GX_FULLSCREEN) )
- {
- SDL_SetError("Couldn't initialize GAPI");
- return(NULL);
- }
-
-#if REPORT_VIDEO_INFO
- printf("Video properties:\n");
- printf("display bpp: %d\n", gapi->gxProperties.cBPP);
- printf("display width: %d\n", gapi->gxProperties.cxWidth);
- printf("display height: %d\n", gapi->gxProperties.cyHeight);
- printf("x pitch: %d\n", gapi->gxProperties.cbxPitch);
- printf("y pitch: %d\n", gapi->gxProperties.cbyPitch);
- printf("gapi flags: 0x%x\n", gapi->gxProperties.ffFormat);
-
- if( !gapi->useVga && this->hidden->useGXOpenDisplay && gapi->needUpdate)
- {
- gapi->videoMem = gapi->gxFunc.GXBeginDraw();
- gapi->gxFunc.GXEndDraw();
- }
-
- printf("video memory: 0x%x\n", gapi->videoMem);
- printf("need update: %d\n", gapi->needUpdate);
- printf("hi-res fix: %d\n", gapi->hiresFix);
- printf("VGA is available on the device: %d\n", g_bRawBufferAvailable);
- printf("use raw framebuffer: %d\n", gapi->useVga);
- printf("video surface bpp: %d\n", video->format->BitsPerPixel);
- printf("video surface width: %d\n", video->w);
- printf("video surface height: %d\n", video->h);
-#endif
-
-
- /* Blank screen */
- allScreen.x = allScreen.y = 0;
- allScreen.w = video->w - 1;
- allScreen.h = video->h - 1;
- GAPI_UpdateRects(this, 1, &allScreen);
-
- /* We're done */
- return(video);
-}
-
-/* We don't actually allow hardware surfaces other than the main one */
-static int GAPI_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- return(-1);
-}
-static void GAPI_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-/* We need to wait for vertical retrace on page flipped displays */
-static int GAPI_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- return(0);
-}
-
-static void GAPI_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-static int updateLine8to8(_THIS, unsigned char *srcPointer, unsigned char *destPointer, int width, int height, int lines)
-{
- if( gapi->dstPixelStep == 1) /* optimized blitting on most devices */
- {
- SDL_memcpy(destPointer, srcPointer, width);
- return 1;
- } else
- {
- // TODO: read 4 pixels, write DWORD
- int step = gapi->dstPixelStep;
- while(width--)
- {
- *destPointer = *srcPointer++;
- destPointer += step;
- }
- }
- return 1;
-}
-
-/* Video memory is very slow so lets optimize as much as possible */
-static int updateLine16to16(_THIS, PIXEL *srcPointer, PIXEL *destPointer, int width, int height, int lines)
-{
- PIXEL *line1, *line2;
- int step = gapi->dstPixelStep / 2;
-
- if( step == 1 ) /* optimized blitting on most devices */
- {
- SDL_memcpy(destPointer, srcPointer, width * sizeof(PIXEL));
- return 1;
- }
- else
- {
- if( (gapi->gapiOrientation != SDL_ORIENTATION_UP) &&
- (gapi->userOrientation == SDL_ORIENTATION_UP )) // iPaq 3660/3800 and user orientation up
- {
- // to prevent data misalignment copy only one line
- if( ((((unsigned)destPointer & 3) != 0) && (gapi->gapiOrientation == SDL_ORIENTATION_LEFT))
- || ((((unsigned)destPointer & 3) == 0) && (gapi->gapiOrientation != SDL_ORIENTATION_LEFT))
- || (lines == 1) )
- {
- while(width--)
- {
- *destPointer = *srcPointer++;
- destPointer += step;
- }
- return 1;
- }
-
- /* read two lines at the same time, write DWORD */
- line1 = srcPointer;
- line2 = srcPointer + SDL_VideoSurface->pitch / 2;
-
- if( gapi->gapiOrientation == SDL_ORIENTATION_LEFT )
- while(width--) // iPaq 3800
- {
- *(DWORD*)destPointer =(*line2++ << 16) | *line1++;
- destPointer += step;
- }
- else
- {
- destPointer += gapi->gxProperties.cbyPitch / 2;
-
- while(width--) // iPaq 3660
- {
- *(DWORD*)destPointer =(*line1++ << 16) | *line2++;
- destPointer += step;
- }
- }
- return 2;
- } else
- {
- // iPaq 3800 and user orientation landscape
- if( gapi->gapiOrientation == SDL_ORIENTATION_LEFT )
- {
- int w1;
-
- // to prevent data misalignment copy only one pixel
- if( (((unsigned)destPointer & 3) == 0) && (width > 0))
- {
- *destPointer-- = *srcPointer++;
- width--;
- }
-
- destPointer--;
-
- w1 = width / 2;
-
- while(w1--)
- {
- DWORD p = *(DWORD*)srcPointer;
- *((DWORD*)destPointer) = (p << 16) | (p >> 16);
- destPointer -= 2;
- srcPointer += 2;
- }
-
- if( width & 1 ) // copy the last pixel
- {
- destPointer++;
- *destPointer = *srcPointer;
- }
-
- return 1;
- }
-
- // modern iPaqs and user orientation landscape
- // read two pixels, write DWORD
-
- line1 = srcPointer;
- line2 = srcPointer + SDL_VideoSurface->pitch / 2;
-
- if( (((unsigned)destPointer & 3) != 0) || (lines == 1) )
- {
- while(width--)
- {
- *destPointer = *srcPointer++;
- destPointer += step;
- }
- return 1;
- }
-
- while(width--)
- {
- *(DWORD*)destPointer =(*line2++ << 16) | *line1++;
- destPointer -= gapi->gxProperties.cbyPitch / 2;
- }
- return 2;
- }
- }
-}
-
-// Color component masks for 565
-#define REDMASK (31<<11)
-#define GREENMASK (63<<5)
-#define BLUEMASK (31)
-
-
-static int updateLine16to4(_THIS, PIXEL *srcPointer, unsigned char *destPointer, int width, int height, int lines, int yNibble, int xNibble)
-{
- PIXEL *line1, *line2;
- int step = gapi->dstPixelStep;
-
- if( gapi->userOrientation == SDL_ORIENTATION_UP )
- {
- if( yNibble ) // copy bottom half of a line
- {
- while(width--)
- {
- PIXEL c1 = *srcPointer++;
- c1 = ((c1 & REDMASK) >> 11) + ((c1 & GREENMASK) >> 5) + (c1 & BLUEMASK);
- *destPointer = (*destPointer & 0x0F) | ((~(c1 >> 3) << 4));
- destPointer += step;
- }
- return 1;
- }
-
- // either 1 pixel picture or tail, anyway this is the last line
- if( lines == 1 )
- {
- while(width--)
- {
- PIXEL c1 = *srcPointer++;
- c1 = ((c1 & REDMASK) >> 11) + ((c1 & GREENMASK) >> 5) + (c1 & BLUEMASK);
- *destPointer = (*destPointer & 0xF0) | ((~(c1 >> 3) & 0xF));
- destPointer += step;
- }
- return 1;
- }
-
- line1 = srcPointer;
- line2 = srcPointer + SDL_VideoSurface->pitch / 2;
-
- while(width--)
- {
- PIXEL c1 = *line1++;
- PIXEL c2 = *line2++;
- c1 = ((c1 & REDMASK) >> 11) + ((c1 & GREENMASK) >> 5) + (c1 & BLUEMASK);
- c2 = ((c2 & REDMASK) >> 11) + ((c2 & GREENMASK) >> 5) + (c2 & BLUEMASK);
- *destPointer = ~((c1 >> 3) + ((c2 >> 3) << 4));
- destPointer += step;
- }
- return 2;
- } else
- {
- int w1;
- w1 = width / 2;
-
- if( xNibble )
- {
- // copy one pixel
- PIXEL c1 = *srcPointer++;
- c1 = ((c1 & REDMASK) >> 11) + ((c1 & GREENMASK) >> 5) + (c1 & BLUEMASK);
- *destPointer = (*destPointer & 0xF0) | ((~(c1 >> 3) & 0xF));
- destPointer++;
- }
-
- while(w1--)
- {
- PIXEL c1 = *srcPointer;
- PIXEL c2 = *(srcPointer + 1);
- c1 = ((c1 & REDMASK) >> 11) + ((c1 & GREENMASK) >> 5) + (c1 & BLUEMASK);
- c2 = ((c2 & REDMASK) >> 11) + ((c2 & GREENMASK) >> 5) + (c2 & BLUEMASK);
- *destPointer++ = ~((c2 >> 3) + ((c1 >> 3) << 4));
- srcPointer += 2;
- }
-
- // copy tail
- if( (width & 1) && !xNibble )
- {
- PIXEL c1 = *srcPointer;
- c1 = ((c1 & REDMASK) >> 11) + ((c1 & GREENMASK) >> 5) + (c1 & BLUEMASK);
- *destPointer = (*destPointer & 0x0F) | ((~(c1 >> 3) << 4));
- }
-
- return 1;
- }
-}
-
-static void GAPI_UpdateRectsMono(_THIS, int numrects, SDL_Rect *rects)
-{
- int i, height;
- int linesProcessed;
- int xNibble, yNibble;
-
- for (i=0; i<numrects; i++)
- {
- unsigned char *destPointer;
- unsigned char *srcPointer;
-
- if( gapi->userOrientation == SDL_ORIENTATION_UP )
- destPointer = (unsigned char*) gapi->videoMem + gapi->startOffset - rects[i].y * gapi->gxProperties.cBPP / 8 + rects[i].x * gapi->dstPixelStep;
- else
- destPointer = (unsigned char*) gapi->videoMem + gapi->startOffset + rects[i].x * gapi->gxProperties.cBPP / 8 + rects[i].y * gapi->dstLineStep;
-
- srcPointer = ((unsigned char*) SDL_VideoSurface->pixels) + rects[i].y * SDL_VideoSurface->pitch + rects[i].x * 2;
- yNibble = rects[i].y & 1; // TODO: only for 4 bpp
- xNibble = rects[i].x & 1;
- height = rects[i].h;
- while (height > 0)
- {
- switch(gapi->gxProperties.cBPP)
- {
- case 2: // TODO
- case 4:
- linesProcessed = updateLine16to4(this, (PIXEL*) srcPointer, destPointer, rects[i].w, rects[i].h, height, yNibble, xNibble);
- yNibble = 0;
- }
- height -= linesProcessed;
- if( gapi->userOrientation == SDL_ORIENTATION_UP )
- destPointer--; // always fill 1 byte
- else destPointer += gapi->dstLineStep;
- srcPointer += SDL_VideoSurface->pitch * linesProcessed; // pitch in bytes
- }
- }
-}
-
-static void GAPI_UpdateRectsColor(_THIS, int numrects, SDL_Rect *rects)
-{
- int i, height;
- int bytesPerPixel = (gapi->gxProperties.cBPP + 1) / 8;
- int linesProcessed;
- for (i=0; i<numrects; i++) {
- unsigned char *destPointer = (unsigned char*) gapi->videoMem + gapi->startOffset + rects[i].y * gapi->dstLineStep + rects[i].x * gapi->dstPixelStep;
- unsigned char *srcPointer = ((unsigned char*) SDL_VideoSurface->pixels) + rects[i].y * SDL_VideoSurface->pitch + rects[i].x * bytesPerPixel;
- height = rects[i].h;
-
-// fprintf(stderr, "Starting rect %dx%d, dst=0x%x, w = %d, h = %d\n", rects[i].w, rects[i].h,destPointer,rects[i].w,rects[i].h);
-// fflush(stderr);
- linesProcessed = height;
-
- while (height > 0) {
- switch(bytesPerPixel)
- {
- case 1:
- linesProcessed = updateLine8to8(this, srcPointer, (unsigned char *) destPointer, rects[i].w, rects[i].h, height);
- break;
- case 2:
-#pragma warning(disable: 4133)
- linesProcessed = updateLine16to16(this, (PIXEL*) srcPointer, destPointer, rects[i].w, rects[i].h, height);
- break;
- }
- height -= linesProcessed;
- destPointer += gapi->dstLineStep * linesProcessed;
- srcPointer += SDL_VideoSurface->pitch * linesProcessed; // pitch in bytes
- }
-// fprintf(stderr, "End of rect\n");
-// fflush(stderr);
- }
-}
-
-
-static void GAPI_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
-{
- // we do not want to corrupt video memory
- if( gapi->suspended ) return;
-
- if( gapi->needUpdate )
- gapi->videoMem = gapi->gxFunc.GXBeginDraw();
-
- if( gapi->gxProperties.cBPP < 8 )
- GAPI_UpdateRectsMono(this, numrects, rects);
- else
- GAPI_UpdateRectsColor(this, numrects, rects);
-
- if( gapi->needUpdate )
- gapi->gxFunc.GXEndDraw();
-}
-
-/* Note: If we are terminated, this could be called in the middle of
- another SDL video routine -- notably UpdateRects.
-*/
-void GAPI_VideoQuit(_THIS)
-{
- int i, j;
- /* Destroy the window and everything associated with it */
- if ( SDL_Window )
- {
- if ((g_hGapiLib != 0) && this && this->hidden && this->hidden->gxFunc.GXCloseDisplay && !this->hidden->useVga)
- this->hidden->gxFunc.GXCloseDisplay();
-
- if (this->screen->pixels != NULL)
- {
- SDL_free(this->screen->pixels);
- this->screen->pixels = NULL;
- }
- if ( screen_icn ) {
- DestroyIcon(screen_icn);
- screen_icn = NULL;
- }
-
- DIB_DestroyWindow(this);
- SDL_UnregisterApp();
-
- SDL_Window = NULL;
-#if defined(_WIN32_WCE)
-
-// Unload wince aygshell library to prevent leak
- if( aygshell )
- {
- FreeLibrary(aygshell);
- aygshell = NULL;
- }
-#endif
-
- /* Free video mode lists */
- for ( i=0; i<NUM_MODELISTS; ++i ) {
- if ( gapi->SDL_modelist[i] != NULL ) {
- for ( j=0; gapi->SDL_modelist[i][j]; ++j )
- SDL_free(gapi->SDL_modelist[i][j]);
- SDL_free(gapi->SDL_modelist[i]);
- gapi->SDL_modelist[i] = NULL;
- }
- }
-
- }
-
-}
-
-static void GAPI_RealizePalette(_THIS)
-{
- OutputDebugString(TEXT("GAPI_RealizePalette NOT IMPLEMENTED !\r\n"));
-}
-
-static void GAPI_PaletteChanged(_THIS, HWND window)
-{
- OutputDebugString(TEXT("GAPI_PaletteChanged NOT IMPLEMENTED !\r\n"));
-}
-
-static void GAPI_WinPAINT(_THIS, HDC hdc)
-{
- // draw current offscreen buffer on hdc
-
- int bpp = 16; // we always use either 8 or 16 bpp internally
- HGDIOBJ prevObject;
- unsigned short *bitmapData;
- HBITMAP hb;
- HDC srcDC;
-
- // Create a DIB
- BYTE buffer[sizeof(BITMAPINFOHEADER) + 3 * sizeof(RGBQUAD)] = {0};
- BITMAPINFO* pBMI = (BITMAPINFO*)buffer;
- BITMAPINFOHEADER* pHeader = &pBMI->bmiHeader;
- DWORD* pColors = (DWORD*)&pBMI->bmiColors;
-
- // CreateDIBSection does not support 332 pixel format on wce
- if( gapi->gxProperties.cBPP == 8 ) return;
-
- // DIB Header
- pHeader->biSize = sizeof(BITMAPINFOHEADER);
- pHeader->biWidth = this->hidden->w;
- pHeader->biHeight = -this->hidden->h;
- pHeader->biPlanes = 1;
- pHeader->biBitCount = bpp;
- pHeader->biCompression = BI_RGB;
- pHeader->biSizeImage = (this->hidden->w * this->hidden->h * bpp) / 8;
-
- // Color masks
- if( bpp == 16 )
- {
- pColors[0] = REDMASK;
- pColors[1] = GREENMASK;
- pColors[2] = BLUEMASK;
- pHeader->biCompression = BI_BITFIELDS;
- }
- // Create the DIB
- hb = CreateDIBSection( 0, pBMI, DIB_RGB_COLORS, (void**)&bitmapData, 0, 0 );
-
- // copy data
- // FIXME: prevent misalignment, but I've never seen non aligned width of screen
- memcpy(bitmapData, this->hidden->buffer, pHeader->biSizeImage);
- srcDC = CreateCompatibleDC(hdc);
- prevObject = SelectObject(srcDC, hb);
-
- BitBlt(hdc, 0, 0, this->hidden->w, this->hidden->h, srcDC, 0, 0, SRCCOPY);
-
- SelectObject(srcDC, prevObject);
- DeleteObject(hb);
- DeleteDC(srcDC);
-}
-
-int GAPI_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- GAPI_CreatePalette(ncolors, colors);
- return 1;
-}
diff --git a/distrib/sdl-1.2.12/src/video/gapi/SDL_gapivideo.h b/distrib/sdl-1.2.12/src/video/gapi/SDL_gapivideo.h
deleted file mode 100644
index 99a1d00..0000000
--- a/distrib/sdl-1.2.12/src/video/gapi/SDL_gapivideo.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_gapivideo_h
-#define _SDL_gapivideo_h
-
-#include "SDL_mouse.h"
-#include "SDL_mutex.h"
-#include "../SDL_sysvideo.h"
-
-/* From gx.h, since it's not really C compliant */
-
-struct GXDisplayProperties {
- DWORD cxWidth;
- DWORD cyHeight; // notice lack of 'th' in the word height.
- long cbxPitch; // number of bytes to move right one x pixel - can be negative.
- long cbyPitch; // number of bytes to move down one y pixel - can be negative.
- long cBPP; // # of bits in each pixel
- DWORD ffFormat; // format flags.
-};
-
-struct GXKeyList {
- short vkUp; // key for up
- POINT ptUp; // x,y position of key/button. Not on screen but in screen coordinates.
- short vkDown;
- POINT ptDown;
- short vkLeft;
- POINT ptLeft;
- short vkRight;
- POINT ptRight;
- short vkA;
- POINT ptA;
- short vkB;
- POINT ptB;
- short vkC;
- POINT ptC;
- short vkStart;
- POINT ptStart;
-};
-
-typedef int (*PFNGXOpenDisplay)(HWND hWnd, DWORD dwFlags);
-typedef int (*PFNGXCloseDisplay)();
-typedef void* (*PFNGXBeginDraw)();
-typedef int (*PFNGXEndDraw)();
-typedef int (*PFNGXOpenInput)();
-typedef int (*PFNGXCloseInput)();
-typedef struct GXDisplayProperties (*PFNGXGetDisplayProperties)();
-typedef struct GXKeyList (*PFNGXGetDefaultKeys)(int iOptions);
-typedef int (*PFNGXSuspend)();
-typedef int (*PFNGXResume)();
-typedef int (*PFNGXSetViewport)( DWORD dwTop, DWORD dwHeight, DWORD dwReserved1, DWORD dwReserved2 );
-typedef BOOL (*PFNGXIsDisplayDRAMBuffer)();
-
-struct GapiFunc
-{
- PFNGXOpenDisplay GXOpenDisplay;
- PFNGXCloseDisplay GXCloseDisplay;
- PFNGXBeginDraw GXBeginDraw;
- PFNGXEndDraw GXEndDraw;
- PFNGXOpenInput GXOpenInput;
- PFNGXCloseInput GXCloseInput;
- PFNGXGetDisplayProperties GXGetDisplayProperties;
- PFNGXGetDefaultKeys GXGetDefaultKeys;
- PFNGXSuspend GXSuspend;
- PFNGXResume GXResume;
- PFNGXSetViewport GXSetViewport;
- PFNGXIsDisplayDRAMBuffer GXIsDisplayDRAMBuffer;
-};
-
-#define kfLandscape 0x8 // Screen is rotated 270 degrees
-#define kfPalette 0x10 // Pixel values are indexes into a palette
-#define kfDirect 0x20 // Pixel values contain actual level information
-#define kfDirect555 0x40 // 5 bits each for red, green and blue values in a pixel.
-#define kfDirect565 0x80 // 5 red bits, 6 green bits and 5 blue bits per pixel
-#define kfDirect888 0x100 // 8 bits each for red, green and blue values in a pixel.
-#define kfDirect444 0x200 // 4 red, 4 green, 4 blue
-#define kfDirectInverted 0x400
-
-#define GX_FULLSCREEN 0x01 // for OpenDisplay()
-#define GX_NORMALKEYS 0x02
-#define GX_LANDSCAPEKEYS 0x03
-
-typedef enum
-{
- SDL_ORIENTATION_UP,
- SDL_ORIENTATION_DOWN,
- SDL_ORIENTATION_LEFT,
- SDL_ORIENTATION_RIGHT
-} SDL_ScreenOrientation;
-
-/* GAPI video mode */
-typedef enum {
- GAPI_NONE = 0,
- GAPI_DIRECT_565,
- GAPI_DIRECT_555,
- GAPI_MONO,
- GAPI_PALETTE
-} GAPIVideoMode;
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-typedef unsigned short PIXEL;
-
-/* Private display data
- begin with DIB private structure to allow DIB events code sharing
-*/
-struct SDL_PrivateVideoData {
- HBITMAP screen_bmp;
- HPALETTE screen_pal;
-
-#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
- int SDL_nummodes[NUM_MODELISTS];
- SDL_Rect **SDL_modelist[NUM_MODELISTS];
- enum SDL_ScreenOrientation userOrientation;
- int invert;
- char hiresFix; // using hires mode without defining hires resource
-// --------------
- int useGXOpenDisplay; /* use GXOpenDispplay */
- int w, h;
- enum SDL_ScreenOrientation gapiOrientation;
-
- void *buffer; // may be 8, 16, 24, 32 bpp
- PIXEL *videoMem;
- BOOL needUpdate;
- struct GXKeyList keyList;
- struct GapiFunc gxFunc;
- struct GXDisplayProperties gxProperties;
- enum GAPIVideoMode videoMode;
- int colorscale;
- int dstLineStep; // in bytes
- int dstPixelStep; // in bytes
- int startOffset; // in bytes
- int useVga;
- int suspended; // do not pu anything into video memory
-};
-
-
-#define gapiBuffer this->hidden->buffer
-#define gapi this->hidden
-
-#endif /* _SDL_gapivideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/gem/SDL_gemevents.c b/distrib/sdl-1.2.12/src/video/gem/SDL_gemevents.c
deleted file mode 100644
index 19c7c74..0000000
--- a/distrib/sdl-1.2.12/src/video/gem/SDL_gemevents.c
+++ /dev/null
@@ -1,370 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * GEM SDL video driver implementation
- * inspired from the Dummy SDL driver
- *
- * Patrice Mandin
- * and work from
- * Olivier Landemarre, Johan Klockars, Xavier Joubert, Claude Attard
- */
-
-#include <gem.h>
-
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_gemvideo.h"
-#include "SDL_gemevents_c.h"
-#include "../ataricommon/SDL_atarikeys.h" /* for keyboard scancodes */
-#include "../ataricommon/SDL_atarievents_c.h"
-#include "../ataricommon/SDL_xbiosevents_c.h"
-#include "../ataricommon/SDL_ataridevmouse_c.h"
-
-/* Variables */
-
-static unsigned char gem_currentkeyboard[ATARIBIOS_MAXKEYS];
-static unsigned char gem_previouskeyboard[ATARIBIOS_MAXKEYS];
-
-/* Functions prototypes */
-
-static int do_messages(_THIS, short *message);
-static void do_keyboard(short kc, short ks);
-static void do_mouse(_THIS, short mx, short my, short mb, short ks);
-
-/* Functions */
-
-void GEM_InitOSKeymap(_THIS)
-{
- SDL_memset(gem_currentkeyboard, 0, sizeof(gem_currentkeyboard));
- SDL_memset(gem_previouskeyboard, 0, sizeof(gem_previouskeyboard));
-
- /* Mouse init */
- GEM_mouse_relative = SDL_FALSE;
-
- SDL_Atari_InitInternalKeymap(this);
-}
-
-void GEM_PumpEvents(_THIS)
-{
- short mousex, mousey, mouseb, dummy;
- short kstate, prevkc, prevks;
- int i;
- SDL_keysym keysym;
-
- SDL_memset(gem_currentkeyboard,0,sizeof(gem_currentkeyboard));
- prevkc = prevks = 0;
-
- for (;;)
- {
- int quit, resultat, event_mask, mouse_event;
- short buffer[8], kc;
- short x2,y2,w2,h2;
-
- quit =
- mouse_event =
- x2=y2=w2=h2 = 0;
-
- event_mask = MU_MESAG|MU_TIMER|MU_KEYBD;
- if (!GEM_fullscreen && (GEM_handle>=0)) {
- wind_get (GEM_handle, WF_WORKXYWH, &x2, &y2, &w2, &h2);
- event_mask |= MU_M1;
- mouse_event = ( (SDL_GetAppState() & SDL_APPMOUSEFOCUS)
- == SDL_APPMOUSEFOCUS) ? MO_LEAVE : MO_ENTER;
- }
-
- resultat = evnt_multi(
- event_mask,
- 0,0,0,
- mouse_event,x2,y2,w2,h2,
- 0,0,0,0,0,
- buffer,
- 10,
- &dummy,&dummy,&dummy,&kstate,&kc,&dummy
- );
-
- /* Message event ? */
- if (resultat & MU_MESAG)
- quit = do_messages(this, buffer);
-
- /* Keyboard event ? */
- if (resultat & MU_KEYBD) {
- if ((prevkc != kc) || (prevks != kstate)) {
- do_keyboard(kc,kstate);
- } else {
- /* Avoid looping, if repeating same key */
- break;
- }
- }
-
- /* Mouse entering/leaving window */
- if (resultat & MU_M1) {
- if (this->input_grab == SDL_GRAB_OFF) {
- /* Switch mouse focus state */
- SDL_PrivateAppActive((mouse_event == MO_ENTER),
- SDL_APPMOUSEFOCUS);
- }
- GEM_CheckMouseMode(this);
- }
-
- /* Timer event ? */
- if ((resultat & MU_TIMER) || quit)
- break;
- }
-
- /* Update mouse */
- graf_mkstate(&mousex, &mousey, &mouseb, &kstate);
- do_mouse(this, mousex, mousey, mouseb, kstate);
-
- /* Now generate keyboard events */
- for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
- /* Key pressed ? */
- if (gem_currentkeyboard[i] && !gem_previouskeyboard[i])
- SDL_PrivateKeyboard(SDL_PRESSED,
- SDL_Atari_TranslateKey(i, &keysym, SDL_TRUE));
-
- /* Key unpressed ? */
- if (gem_previouskeyboard[i] && !gem_currentkeyboard[i])
- SDL_PrivateKeyboard(SDL_RELEASED,
- SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE));
- }
-
- SDL_memcpy(gem_previouskeyboard,gem_currentkeyboard,sizeof(gem_previouskeyboard));
-
- /* Refresh window name ? */
- if (GEM_refresh_name) {
- const char *window_name =
- (SDL_GetAppState() & SDL_APPACTIVE)
- ? GEM_title_name : GEM_icon_name;
- if (window_name) {
- wind_set(GEM_handle,WF_NAME,
- (short)(((unsigned long)window_name)>>16),
- (short)(((unsigned long)window_name) & 0xffff),
- 0,0);
- }
- GEM_refresh_name = SDL_FALSE;
- }
-}
-
-static int do_messages(_THIS, short *message)
-{
- int quit, posted, check_mouse_mode;
- short x2,y2,w2,h2;
-
- quit = check_mouse_mode = 0;
- switch (message[0]) {
- case WM_CLOSED:
- case AP_TERM:
- posted = SDL_PrivateQuit();
- quit=1;
- break;
- case WM_MOVED:
- wind_set(message[3],WF_CURRXYWH,message[4],message[5],message[6],message[7]);
- break;
- case WM_TOPPED:
- wind_set(message[3],WF_TOP,message[4],0,0,0);
- /* Continue with TOP event processing */
- case WM_ONTOP:
- SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
- if (VDI_setpalette) {
- VDI_setpalette(this, VDI_curpalette);
- }
- check_mouse_mode = 1;
- break;
- case WM_REDRAW:
- if (!GEM_lock_redraw) {
- GEM_wind_redraw(this, message[3],&message[4]);
- }
- break;
- case WM_ICONIFY:
- case WM_ALLICONIFY:
- wind_set(message[3],WF_ICONIFY,message[4],message[5],message[6],message[7]);
- /* If we're active, make ourselves inactive */
- if ( SDL_GetAppState() & SDL_APPACTIVE ) {
- /* Send an internal deactivate event */
- SDL_PrivateAppActive(0, SDL_APPACTIVE);
- }
- /* Update window title */
- if (GEM_refresh_name && GEM_icon_name) {
- wind_set(GEM_handle,WF_NAME,(short)(((unsigned long)GEM_icon_name)>>16),(short)(((unsigned long)GEM_icon_name) & 0xffff),0,0);
- GEM_refresh_name = SDL_FALSE;
- }
- check_mouse_mode = 1;
- break;
- case WM_UNICONIFY:
- wind_set(message[3],WF_UNICONIFY,message[4],message[5],message[6],message[7]);
- /* If we're not active, make ourselves active */
- if ( !(SDL_GetAppState() & SDL_APPACTIVE) ) {
- /* Send an internal activate event */
- SDL_PrivateAppActive(1, SDL_APPACTIVE);
- }
- if (GEM_refresh_name && GEM_title_name) {
- wind_set(GEM_handle,WF_NAME,(short)(((unsigned long)GEM_title_name)>>16),(short)(((unsigned long)GEM_title_name) & 0xffff),0,0);
- GEM_refresh_name = SDL_FALSE;
- }
- check_mouse_mode = 1;
- break;
- case WM_SIZED:
- wind_set (message[3], WF_CURRXYWH, message[4], message[5], message[6], message[7]);
- wind_get (message[3], WF_WORKXYWH, &x2, &y2, &w2, &h2);
- GEM_win_fulled = SDL_FALSE; /* Cancel maximized flag */
- GEM_lock_redraw = SDL_TRUE; /* Prevent redraw till buffers resized */
- SDL_PrivateResize(w2, h2);
- break;
- case WM_FULLED:
- {
- short x,y,w,h;
-
- if (GEM_win_fulled) {
- wind_get (message[3], WF_PREVXYWH, &x, &y, &w, &h);
- GEM_win_fulled = SDL_FALSE;
- } else {
- x = GEM_desk_x;
- y = GEM_desk_y;
- w = GEM_desk_w;
- h = GEM_desk_h;
- GEM_win_fulled = SDL_TRUE;
- }
- wind_set (message[3], WF_CURRXYWH, x, y, w, h);
- wind_get (message[3], WF_WORKXYWH, &x2, &y2, &w2, &h2);
- GEM_lock_redraw = SDL_TRUE; /* Prevent redraw till buffers resized */
- SDL_PrivateResize(w2, h2);
- }
- break;
- case WM_BOTTOMED:
- wind_set(message[3],WF_BOTTOM,0,0,0,0);
- /* Continue with BOTTOM event processing */
- case WM_UNTOPPED:
- SDL_PrivateAppActive(0, SDL_APPINPUTFOCUS);
- if (VDI_setpalette) {
- VDI_setpalette(this, VDI_oldpalette);
- }
- check_mouse_mode = 1;
- break;
- }
-
- if (check_mouse_mode) {
- GEM_CheckMouseMode(this);
- }
-
- return quit;
-}
-
-static void do_keyboard(short kc, short ks)
-{
- int scancode;
-
- if (kc) {
- scancode=(kc>>8) & (ATARIBIOS_MAXKEYS-1);
- gem_currentkeyboard[scancode]=0xFF;
- }
-
- /* Read special keys */
- if (ks & K_RSHIFT)
- gem_currentkeyboard[SCANCODE_RIGHTSHIFT]=0xFF;
- if (ks & K_LSHIFT)
- gem_currentkeyboard[SCANCODE_LEFTSHIFT]=0xFF;
- if (ks & K_CTRL)
- gem_currentkeyboard[SCANCODE_LEFTCONTROL]=0xFF;
- if (ks & K_ALT)
- gem_currentkeyboard[SCANCODE_LEFTALT]=0xFF;
-}
-
-static void do_mouse(_THIS, short mx, short my, short mb, short ks)
-{
- static short prevmousex=0, prevmousey=0, prevmouseb=0;
- short x2, y2, w2, h2;
-
- /* Don't return mouse events if out of window */
- if ((SDL_GetAppState() & SDL_APPMOUSEFOCUS)==0) {
- return;
- }
-
- /* Retrieve window coords, and generate mouse events accordingly */
- x2 = y2 = 0;
- w2 = VDI_w;
- h2 = VDI_h;
- if ((!GEM_fullscreen) && (GEM_handle>=0)) {
- wind_get (GEM_handle, WF_WORKXYWH, &x2, &y2, &w2, &h2);
-
- /* Do not generate mouse button event if out of window working area */
- if ((mx<x2) || (mx>=x2+w2) || (my<y2) || (my>=y2+h2)) {
- mb=prevmouseb;
- }
- }
-
- /* Mouse motion ? */
- if (GEM_mouse_relative) {
- if (GEM_usedevmouse) {
- SDL_AtariDevMouse_PostMouseEvents(this, SDL_FALSE);
- } else {
- SDL_AtariXbios_PostMouseEvents(this, SDL_FALSE);
- }
- } else {
- if ((prevmousex!=mx) || (prevmousey!=my)) {
- int posx, posy;
-
- /* Give mouse position relative to window position */
- posx = mx - x2;
- if (posx<0) posx = 0;
- if (posx>w2) posx = w2-1;
- posy = my - y2;
- if (posy<0) posy = 0;
- if (posy>h2) posy = h2-1;
-
- SDL_PrivateMouseMotion(0, 0, posx, posy);
- }
- prevmousex = mx;
- prevmousey = my;
- }
-
- /* Mouse button ? */
- if (prevmouseb!=mb) {
- int i;
-
- for (i=0;i<2;i++) {
- int curbutton, prevbutton;
-
- curbutton = mb & (1<<i);
- prevbutton = prevmouseb & (1<<i);
-
- if (curbutton && !prevbutton) {
- SDL_PrivateMouseButton(SDL_PRESSED, i+1, 0, 0);
- }
- if (!curbutton && prevbutton) {
- SDL_PrivateMouseButton(SDL_RELEASED, i+1, 0, 0);
- }
- }
- prevmouseb = mb;
- }
-
- /* Read special keys */
- if (ks & K_RSHIFT)
- gem_currentkeyboard[SCANCODE_RIGHTSHIFT]=0xFF;
- if (ks & K_LSHIFT)
- gem_currentkeyboard[SCANCODE_LEFTSHIFT]=0xFF;
- if (ks & K_CTRL)
- gem_currentkeyboard[SCANCODE_LEFTCONTROL]=0xFF;
- if (ks & K_ALT)
- gem_currentkeyboard[SCANCODE_LEFTALT]=0xFF;
-}
diff --git a/distrib/sdl-1.2.12/src/video/gem/SDL_gemevents_c.h b/distrib/sdl-1.2.12/src/video/gem/SDL_gemevents_c.h
deleted file mode 100644
index 919f86f..0000000
--- a/distrib/sdl-1.2.12/src/video/gem/SDL_gemevents_c.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_gemvideo.h"
-
-/* Variables and functions exported by SDL_sysevents.c to other parts
- of the native video subsystem (SDL_sysvideo.c) */
-
-extern void GEM_InitOSKeymap(_THIS);
-extern void GEM_PumpEvents(_THIS);
-
-/* end of SDL_gemevents_c.h */
-
diff --git a/distrib/sdl-1.2.12/src/video/gem/SDL_gemmouse.c b/distrib/sdl-1.2.12/src/video/gem/SDL_gemmouse.c
deleted file mode 100644
index 3d0acf8..0000000
--- a/distrib/sdl-1.2.12/src/video/gem/SDL_gemmouse.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * GEM Mouse manager
- *
- * Patrice Mandin
- */
-
-#include <gem.h>
-
-#include "SDL_mouse.h"
-#include "../../events/SDL_events_c.h"
-#include "../SDL_cursor_c.h"
-#include "SDL_gemmouse_c.h"
-#include "SDL_gemvideo.h"
-
-/* Defines */
-
-/*#define DEBUG_VIDEO_GEM 1*/
-
-#define MAXCURWIDTH 16
-#define MAXCURHEIGHT 16
-
-void GEM_FreeWMCursor(_THIS, WMcursor *cursor)
-{
-#ifdef DEBUG_VIDEO_GEM
- printf("sdl:video:gem: free cursor\n");
-#endif
-
- if (cursor == NULL)
- return;
-
- graf_mouse(ARROW, NULL);
-
- if (cursor->mform_p != NULL)
- SDL_free(cursor->mform_p);
-
- SDL_free(cursor);
-}
-
-WMcursor *GEM_CreateWMCursor(_THIS,
- Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
-{
- WMcursor *cursor;
- MFORM *new_mform;
- int i;
-
-#ifdef DEBUG_VIDEO_GEM
- Uint16 *data1, *mask1;
-
- printf("sdl:video:gem: create cursor\n");
-#endif
-
- /* Check the size */
- if ( (w > MAXCURWIDTH) || (h > MAXCURHEIGHT) ) {
- SDL_SetError("Only cursors of dimension (%dx%d) are allowed",
- MAXCURWIDTH, MAXCURHEIGHT);
- return(NULL);
- }
-
- /* Allocate the cursor memory */
- cursor = (WMcursor *)SDL_malloc(sizeof(WMcursor));
- if ( cursor == NULL ) {
- SDL_OutOfMemory();
- return(NULL);
- }
-
- /* Allocate mform */
- new_mform = (MFORM *)SDL_malloc(sizeof(MFORM));
- if (new_mform == NULL) {
- SDL_free(cursor);
- SDL_OutOfMemory();
- return(NULL);
- }
-
- cursor->mform_p = new_mform;
-
- new_mform->mf_xhot = hot_x;
- new_mform->mf_yhot = hot_y;
- new_mform->mf_nplanes = 1;
- new_mform->mf_fg = 0;
- new_mform->mf_bg = 1;
-
- for (i=0;i<MAXCURHEIGHT;i++) {
- new_mform->mf_mask[i]=0;
- new_mform->mf_data[i]=0;
-#ifdef DEBUG_VIDEO_GEM
- data1 = (Uint16 *) &data[i<<1];
- mask1 = (Uint16 *) &mask[i<<1];
- printf("sdl:video:gem: source: line %d: data=0x%04x, mask=0x%04x\n",
- i, data1[i], mask1[i]);
-#endif
- }
-
- if (w<=8) {
- for (i=0;i<h;i++) {
- new_mform->mf_mask[i]= mask[i]<<8;
- new_mform->mf_data[i]= data[i]<<8;
- }
- } else {
- for (i=0;i<h;i++) {
- new_mform->mf_mask[i]= (mask[i<<1]<<8) | mask[(i<<1)+1];
- new_mform->mf_data[i]= (data[i<<1]<<8) | data[(i<<1)+1];
- }
- }
-
-#ifdef DEBUG_VIDEO_GEM
- for (i=0; i<h ;i++) {
- printf("sdl:video:gem: cursor: line %d: data=0x%04x, mask=0x%04x\n",
- i, new_mform->mf_data[i], new_mform->mf_mask[i]);
- }
-
- printf("sdl:video:gem: CreateWMCursor(): done\n");
-#endif
-
- return cursor;
-}
-
-int GEM_ShowWMCursor(_THIS, WMcursor *cursor)
-{
- GEM_cursor = cursor;
-
- GEM_CheckMouseMode(this);
-
-#ifdef DEBUG_VIDEO_GEM
- printf("sdl:video:gem: ShowWMCursor(0x%08x)\n", (long) cursor);
-#endif
-
- return 1;
-}
-
-#if 0
-void GEM_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
-{
- /* This seems to work only on AES 3.4 (Falcon) */
-
- EVNTREC warpevent;
-
- warpevent.ap_event = APPEVNT_MOUSE;
- warpevent.ap_value = (x << 16) | y;
-
- appl_tplay(&warpevent, 1, 1000);
-}
-#endif
-
-void GEM_CheckMouseMode(_THIS)
-{
- const Uint8 full_focus = (SDL_APPACTIVE|SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS);
- int set_system_cursor = 1, show_system_cursor = 1;
-
-#ifdef DEBUG_VIDEO_GEM
- printf("sdl:video:gem: check mouse mode\n");
-#endif
-
- /* If the mouse is hidden and input is grabbed, we use relative mode */
- GEM_mouse_relative = (!(SDL_cursorstate & CURSOR_VISIBLE))
- && (this->input_grab != SDL_GRAB_OFF)
- && (SDL_GetAppState() & SDL_APPACTIVE);
- SDL_AtariXbios_LockMousePosition(GEM_mouse_relative);
-
- if (SDL_cursorstate & CURSOR_VISIBLE) {
- /* Application defined cursor only over the application window */
- if ((SDL_GetAppState() & full_focus) == full_focus) {
- if (GEM_cursor) {
- graf_mouse(USER_DEF, GEM_cursor->mform_p);
- set_system_cursor = 0;
- } else {
- show_system_cursor = 0;
- }
- }
- } else {
- /* Mouse cursor hidden only over the application window */
- if ((SDL_GetAppState() & full_focus) == full_focus) {
- set_system_cursor = 0;
- show_system_cursor = 0;
- }
- }
-
- graf_mouse(show_system_cursor ? M_ON : M_OFF, NULL);
- if (set_system_cursor) {
- graf_mouse(ARROW, NULL);
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/gem/SDL_gemmouse_c.h b/distrib/sdl-1.2.12/src/video/gem/SDL_gemmouse_c.h
deleted file mode 100644
index 88028f4..0000000
--- a/distrib/sdl-1.2.12/src/video/gem/SDL_gemmouse_c.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_gemvideo.h"
-
-/* Functions to be exported */
-extern void GEM_FreeWMCursor(_THIS, WMcursor *cursor);
-extern WMcursor *GEM_CreateWMCursor(_THIS,
- Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
-extern int GEM_ShowWMCursor(_THIS, WMcursor *cursor);
-#if 0
-extern void GEM_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
-#endif
-extern void GEM_CheckMouseMode(_THIS);
diff --git a/distrib/sdl-1.2.12/src/video/gem/SDL_gemvideo.c b/distrib/sdl-1.2.12/src/video/gem/SDL_gemvideo.c
deleted file mode 100644
index 353e027..0000000
--- a/distrib/sdl-1.2.12/src/video/gem/SDL_gemvideo.c
+++ /dev/null
@@ -1,1340 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- GEM video driver
-
- Patrice Mandin
- and work from
- Olivier Landemarre, Johan Klockars, Xavier Joubert, Claude Attard
-*/
-
-/* Mint includes */
-#include <gem.h>
-#include <gemx.h>
-#include <mint/osbind.h>
-#include <mint/cookie.h>
-
-#include "SDL_endian.h"
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-#include "../SDL_cursor_c.h"
-
-#include "../ataricommon/SDL_ataric2p_s.h"
-#include "../ataricommon/SDL_atarieddi_s.h"
-#include "../ataricommon/SDL_atarimxalloc_c.h"
-#include "../ataricommon/SDL_atarigl_c.h"
-
-#include "SDL_gemvideo.h"
-#include "SDL_gemevents_c.h"
-#include "SDL_gemmouse_c.h"
-#include "SDL_gemwm_c.h"
-#include "../ataricommon/SDL_xbiosevents_c.h"
-#include "../ataricommon/SDL_ataridevmouse_c.h"
-
-/* Defines */
-
-/*#define DEBUG_VIDEO_GEM 1*/
-
-#define GEM_VID_DRIVER_NAME "gem"
-
-#undef MIN
-#define MIN(a,b) (((a)<(b)) ? (a) : (b))
-#undef MAX
-#define MAX(a,b) (((a)>(b)) ? (a) : (b))
-
-/* Variables */
-
-static unsigned char vdi_index[256] = {
- 0, 2, 3, 6, 4, 7, 5, 8,
- 9, 10, 11, 14, 12, 15, 13, 255
-};
-
-static const unsigned char empty_name[]="";
-
-/* Initialization/Query functions */
-static int GEM_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **GEM_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *GEM_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int GEM_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
-static void GEM_VideoQuit(_THIS);
-
-/* Hardware surface functions */
-static int GEM_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int GEM_LockHWSurface(_THIS, SDL_Surface *surface);
-static int GEM_FlipHWSurface(_THIS, SDL_Surface *surface);
-static void GEM_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static void GEM_FreeHWSurface(_THIS, SDL_Surface *surface);
-static void GEM_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
-#if 0
-static int GEM_ToggleFullScreen(_THIS, int on);
-#endif
-
-/* Internal functions */
-static void GEM_FreeBuffers(_THIS);
-static void GEM_ClearScreen(_THIS);
-static void GEM_ClearRect(_THIS, short *rect);
-static void GEM_SetNewPalette(_THIS, Uint16 newpal[256][3]);
-static void GEM_LockScreen(_THIS);
-static void GEM_UnlockScreen(_THIS);
-static void refresh_window(_THIS, int winhandle, short *rect);
-
-#if SDL_VIDEO_OPENGL
-/* OpenGL functions */
-static void GEM_GL_SwapBuffers(_THIS);
-#endif
-
-/* GEM driver bootstrap functions */
-
-static int GEM_Available(void)
-{
- /* Test if AES available */
- if (appl_init() == -1)
- return 0;
-
- appl_exit();
- return 1;
-}
-
-static void GEM_DeleteDevice(SDL_VideoDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_VideoDevice *GEM_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
- int vectors_mask;
- unsigned long dummy;
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device ) {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *device->hidden));
- device->gl_data = (struct SDL_PrivateGLData *)
- SDL_malloc((sizeof *device->gl_data));
- }
- if ( (device == NULL) || (device->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( device ) {
- SDL_free(device);
- }
- return(0);
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
- SDL_memset(device->gl_data, 0, sizeof(*device->gl_data));
-
- /* Set the function pointers */
- device->VideoInit = GEM_VideoInit;
- device->ListModes = GEM_ListModes;
- device->SetVideoMode = GEM_SetVideoMode;
- device->SetColors = GEM_SetColors;
- device->UpdateRects = NULL /*GEM_UpdateRects*/;
- device->VideoQuit = GEM_VideoQuit;
- device->AllocHWSurface = GEM_AllocHWSurface;
- device->LockHWSurface = GEM_LockHWSurface;
- device->UnlockHWSurface = GEM_UnlockHWSurface;
- device->FlipHWSurface = GEM_FlipHWSurface;
- device->FreeHWSurface = GEM_FreeHWSurface;
- device->ToggleFullScreen = NULL /*GEM_ToggleFullScreen*/;
-
- /* Window manager */
- device->SetCaption = GEM_SetCaption;
- device->SetIcon = GEM_SetIcon;
- device->IconifyWindow = GEM_IconifyWindow;
- device->GrabInput = GEM_GrabInput;
-
- /* Events */
- device->InitOSKeymap = GEM_InitOSKeymap;
- device->PumpEvents = GEM_PumpEvents;
-
- /* Mouse */
- device->FreeWMCursor = GEM_FreeWMCursor;
- device->CreateWMCursor = GEM_CreateWMCursor;
- device->ShowWMCursor = GEM_ShowWMCursor;
- device->WarpWMCursor = NULL /*GEM_WarpWMCursor*/;
- device->CheckMouseMode = GEM_CheckMouseMode;
-
-#if SDL_VIDEO_OPENGL
- /* OpenGL functions */
- device->GL_LoadLibrary = SDL_AtariGL_LoadLibrary;
- device->GL_GetProcAddress = SDL_AtariGL_GetProcAddress;
- device->GL_GetAttribute = SDL_AtariGL_GetAttribute;
- device->GL_MakeCurrent = SDL_AtariGL_MakeCurrent;
- device->GL_SwapBuffers = GEM_GL_SwapBuffers;
-#endif
-
- device->hidden->use_dev_mouse =
- (SDL_AtariDevMouse_Open()!=0) ? SDL_TRUE : SDL_FALSE;
-
- vectors_mask = ATARI_XBIOS_JOYSTICKEVENTS; /* XBIOS joystick events */
- if (!(device->hidden->use_dev_mouse)) {
- vectors_mask |= ATARI_XBIOS_MOUSEEVENTS; /* XBIOS mouse events */
- }
-/* if (Getcookie(C_MiNT, &dummy)==C_FOUND) {
- vectors_mask = 0;
- }*/
-
- SDL_AtariXbios_InstallVectors(vectors_mask);
-
- device->free = GEM_DeleteDevice;
-
- return device;
-}
-
-VideoBootStrap GEM_bootstrap = {
- GEM_VID_DRIVER_NAME, "Atari GEM video driver",
- GEM_Available, GEM_CreateDevice
-};
-
-static void VDI_ReadExtInfo(_THIS, short *work_out)
-{
- unsigned long EdDI_version;
- unsigned long cookie_EdDI;
- Uint32 num_colours;
- Uint16 clut_type, num_bits;
-
- /* Read EdDI informations */
- if (Getcookie(C_EdDI, &cookie_EdDI) == C_NOTFOUND) {
- return;
- }
-
- EdDI_version = Atari_get_EdDI_version( (void *)cookie_EdDI);
-
- vq_scrninfo(VDI_handle, work_out);
-
- VDI_format = work_out[0];
- clut_type = work_out[1];
- num_bits = work_out[2];
- num_colours = *((Uint32 *) &work_out[3]);
-
- /* With EdDI>=1.1, we can have screen pitch, address and format
- * so we can directly write to screen without using vro_cpyfm
- */
- if (EdDI_version >= EDDI_11) {
- VDI_pitch = work_out[5];
- VDI_screen = (void *) *((unsigned long *) &work_out[6]);
- }
-
- switch(clut_type) {
- case VDI_CLUT_HARDWARE:
- {
- int i;
- Uint16 *tmp_p;
-
- tmp_p = (Uint16 *)&work_out[16];
-
- for (i=0;i<256;i++) {
- vdi_index[*tmp_p++] = i;
- }
- }
- break;
- case VDI_CLUT_SOFTWARE:
- {
- int component; /* red, green, blue, alpha, overlay */
- int num_bit;
- unsigned short *tmp_p;
-
- /* We can build masks with info here */
- tmp_p = (unsigned short *) &work_out[16];
- for (component=0;component<5;component++) {
- for (num_bit=0;num_bit<16;num_bit++) {
- unsigned short valeur;
-
- valeur = *tmp_p++;
-
- if (valeur == 0xffff) {
- continue;
- }
-
- switch(component) {
- case 0:
- VDI_redmask |= 1<< valeur;
- break;
- case 1:
- VDI_greenmask |= 1<< valeur;
- break;
- case 2:
- VDI_bluemask |= 1<< valeur;
- break;
- case 3:
- VDI_alphamask |= 1<< valeur;
- break;
- }
- }
- }
- }
-
- /* Remove lower green bits for Intel endian screen */
- if ((VDI_greenmask == ((7<<13)|3)) || (VDI_greenmask == ((7<<13)|7))) {
- VDI_greenmask &= ~(7<<13);
- }
- break;
- case VDI_CLUT_NONE:
- break;
- }
-}
-
-int GEM_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- int i, menubar_size;
- short work_in[12], work_out[272], dummy;
-
- /* Open AES (Application Environment Services) */
- if (appl_init() == -1) {
- fprintf(stderr,"Can not open AES\n");
- return 1;
- }
-
- /* Read version and features */
- GEM_version = aes_global[0];
- if (GEM_version >= 0x0410) {
- short ap_gout[4], errorcode;
-
- GEM_wfeatures=0;
- errorcode=appl_getinfo(AES_WINDOW, &ap_gout[0], &ap_gout[1], &ap_gout[2], &ap_gout[3]);
-
- if (errorcode==0) {
- GEM_wfeatures=ap_gout[0];
- }
- }
-
- /* Ask VDI physical workstation handle opened by AES */
- VDI_handle = graf_handle(&dummy, &dummy, &dummy, &dummy);
- if (VDI_handle<1) {
- fprintf(stderr,"Wrong VDI handle %d returned by AES\n",VDI_handle);
- return 1;
- }
-
- /* Open virtual VDI workstation */
- work_in[0]=Getrez()+2;
- for(i = 1; i < 10; i++)
- work_in[i] = 1;
- work_in[10] = 2;
-
- v_opnvwk(work_in, &VDI_handle, work_out);
- if (VDI_handle == 0) {
- fprintf(stderr,"Can not open VDI virtual workstation\n");
- return 1;
- }
-
- /* Read fullscreen size */
- VDI_w = work_out[0] + 1;
- VDI_h = work_out[1] + 1;
-
- /* Read desktop size and position */
- if (!wind_get(DESKTOP_HANDLE, WF_WORKXYWH, &GEM_desk_x, &GEM_desk_y, &GEM_desk_w, &GEM_desk_h)) {
- fprintf(stderr,"Can not read desktop properties\n");
- return 1;
- }
-
- /* Read bit depth */
- vq_extnd(VDI_handle, 1, work_out);
- VDI_bpp = work_out[4];
- VDI_oldnumcolors=0;
-
- switch(VDI_bpp) {
- case 8:
- VDI_pixelsize=1;
- break;
- case 15:
- case 16:
- VDI_pixelsize=2;
- break;
- case 24:
- VDI_pixelsize=3;
- break;
- case 32:
- VDI_pixelsize=4;
- break;
- default:
- fprintf(stderr,"%d bits colour depth not supported\n",VDI_bpp);
- return 1;
- }
-
- /* Setup hardware -> VDI palette mapping */
- for(i = 16; i < 255; i++) {
- vdi_index[i] = i;
- }
- vdi_index[255] = 1;
-
- /* Save current palette */
- if (VDI_bpp>8) {
- VDI_oldnumcolors=1<<8;
- } else {
- VDI_oldnumcolors=1<<VDI_bpp;
- }
-
- for(i = 0; i < VDI_oldnumcolors; i++) {
- short rgb[3];
-
- vq_color(VDI_handle, i, 0, rgb);
-
- VDI_oldpalette[i][0] = rgb[0];
- VDI_oldpalette[i][1] = rgb[1];
- VDI_oldpalette[i][2] = rgb[2];
- }
- VDI_setpalette = GEM_SetNewPalette;
- SDL_memcpy(VDI_curpalette,VDI_oldpalette,sizeof(VDI_curpalette));
-
- /* Setup screen info */
- GEM_title_name = empty_name;
- GEM_icon_name = empty_name;
-
- GEM_handle = -1;
- GEM_locked = SDL_FALSE;
- GEM_win_fulled = SDL_FALSE;
- GEM_fullscreen = SDL_FALSE;
- GEM_lock_redraw = SDL_TRUE; /* Prevent redraw till buffers are setup */
-
- VDI_screen = NULL;
- VDI_pitch = VDI_w * VDI_pixelsize;
- VDI_format = ( (VDI_bpp <= 8) ? VDI_FORMAT_INTER : VDI_FORMAT_PACK);
- VDI_redmask = VDI_greenmask = VDI_bluemask = VDI_alphamask = 0;
- VDI_ReadExtInfo(this, work_out);
-
-#ifdef DEBUG_VIDEO_GEM
- printf("sdl:video:gem: screen: address=0x%08x, pitch=%d\n", VDI_screen, VDI_pitch);
- printf("sdl:video:gem: format=%d\n", VDI_format);
- printf("sdl:video:gem: masks: 0x%08x, 0x%08x, 0x%08x, 0x%08x\n",
- VDI_alphamask, VDI_redmask, VDI_greenmask, VDI_bluemask
- );
-#endif
-
- /* Setup destination mfdb */
- VDI_dst_mfdb.fd_addr = NULL;
-
- /* Determine the current screen size */
- this->info.current_w = VDI_w;
- this->info.current_h = VDI_h;
-
- /* Determine the screen depth */
- /* we change this during the SDL_SetVideoMode implementation... */
- vformat->BitsPerPixel = VDI_bpp;
-
- /* Set mouse cursor to arrow */
- graf_mouse(ARROW, NULL);
- GEM_cursor = NULL;
-
- /* Init chunky to planar routine */
- SDL_Atari_C2pConvert = SDL_Atari_C2pConvert8;
-
- /* Setup VDI fill functions */
- vsf_color(VDI_handle,0);
- vsf_interior(VDI_handle,1);
- vsf_perimeter(VDI_handle,0);
-
- /* Menu bar save buffer */
- menubar_size = GEM_desk_w * GEM_desk_y * VDI_pixelsize;
- GEM_menubar=Atari_SysMalloc(menubar_size,MX_PREFTTRAM);
-
- /* Fill video modes list */
- SDL_modelist[0] = SDL_malloc(sizeof(SDL_Rect));
- SDL_modelist[0]->x = 0;
- SDL_modelist[0]->y = 0;
- SDL_modelist[0]->w = VDI_w;
- SDL_modelist[0]->h = VDI_h;
-
- SDL_modelist[1] = NULL;
-
-#if SDL_VIDEO_OPENGL
- SDL_AtariGL_InitPointers(this);
-#endif
-
- this->info.wm_available = 1;
-
- /* We're done! */
- return(0);
-}
-
-SDL_Rect **GEM_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- if (format->BitsPerPixel != VDI_bpp) {
- return ((SDL_Rect **)NULL);
- }
-
- if (flags & SDL_FULLSCREEN) {
- return (SDL_modelist);
- }
-
- return((SDL_Rect **)-1);
-}
-
-static void GEM_FreeBuffers(_THIS)
-{
- /* Release buffer */
- if ( GEM_buffer2 ) {
- Mfree( GEM_buffer2 );
- GEM_buffer2=NULL;
- }
-
- if ( GEM_buffer1 ) {
- Mfree( GEM_buffer1 );
- GEM_buffer1=NULL;
- }
-}
-
-static void GEM_ClearRect(_THIS, short *rect)
-{
- short oldrgb[3], rgb[3]={0,0,0};
-
- vq_color(VDI_handle, vdi_index[0], 0, oldrgb);
- vs_color(VDI_handle, vdi_index[0], rgb);
-
- vsf_color(VDI_handle,0);
- vsf_interior(VDI_handle,1);
- vsf_perimeter(VDI_handle,0);
- v_bar(VDI_handle, rect);
-
- vs_color(VDI_handle, vdi_index[0], oldrgb);
-}
-
-static void GEM_ClearScreen(_THIS)
-{
- short pxy[4];
-
- v_hide_c(VDI_handle);
-
- pxy[0] = pxy[1] = 0;
- pxy[2] = VDI_w - 1;
- pxy[3] = VDI_h - 1;
- GEM_ClearRect(this, pxy);
-
- v_show_c(VDI_handle, 1);
-}
-
-static void GEM_SetNewPalette(_THIS, Uint16 newpal[256][3])
-{
- int i;
- short rgb[3];
-
- if (VDI_oldnumcolors==0)
- return;
-
- for(i = 0; i < VDI_oldnumcolors; i++) {
- rgb[0] = newpal[i][0];
- rgb[1] = newpal[i][1];
- rgb[2] = newpal[i][2];
-
- vs_color(VDI_handle, i, rgb);
- }
-}
-
-static void GEM_LockScreen(_THIS)
-{
- if (!GEM_locked) {
- /* Lock AES */
- wind_update(BEG_UPDATE);
- wind_update(BEG_MCTRL);
- /* Reserve memory space, used to be sure of compatibility */
- form_dial( FMD_START, 0,0,0,0, 0,0,VDI_w,VDI_h);
-
- /* Save menu bar */
- if (GEM_menubar) {
- MFDB mfdb_src;
- short blitcoords[8];
-
- mfdb_src.fd_addr=GEM_menubar;
- mfdb_src.fd_w=GEM_desk_w;
- mfdb_src.fd_h=GEM_desk_y;
- mfdb_src.fd_wdwidth=GEM_desk_w>>4;
- mfdb_src.fd_nplanes=VDI_bpp;
- mfdb_src.fd_stand=
- mfdb_src.fd_r1=
- mfdb_src.fd_r2=
- mfdb_src.fd_r3= 0;
-
- blitcoords[0] = blitcoords[4] = 0;
- blitcoords[1] = blitcoords[5] = 0;
- blitcoords[2] = blitcoords[6] = GEM_desk_w-1;
- blitcoords[3] = blitcoords[7] = GEM_desk_y-1;
-
- vro_cpyfm(VDI_handle, S_ONLY, blitcoords, &VDI_dst_mfdb, &mfdb_src);
- }
-
- GEM_locked=SDL_TRUE;
- }
-}
-
-static void GEM_UnlockScreen(_THIS)
-{
- if (GEM_locked) {
- /* Restore menu bar */
- if (GEM_menubar) {
- MFDB mfdb_src;
- short blitcoords[8];
-
- mfdb_src.fd_addr=GEM_menubar;
- mfdb_src.fd_w=GEM_desk_w;
- mfdb_src.fd_h=GEM_desk_y;
- mfdb_src.fd_wdwidth=GEM_desk_w>>4;
- mfdb_src.fd_nplanes=VDI_bpp;
- mfdb_src.fd_stand=
- mfdb_src.fd_r1=
- mfdb_src.fd_r2=
- mfdb_src.fd_r3= 0;
-
- blitcoords[0] = blitcoords[4] = 0;
- blitcoords[1] = blitcoords[5] = 0;
- blitcoords[2] = blitcoords[6] = GEM_desk_w-1;
- blitcoords[3] = blitcoords[7] = GEM_desk_y-1;
-
- vro_cpyfm(VDI_handle, S_ONLY, blitcoords, &mfdb_src, &VDI_dst_mfdb);
- }
-
- /* Restore screen memory, and send REDRAW to all apps */
- form_dial( FMD_FINISH, 0,0,0,0, 0,0,VDI_w,VDI_h);
- /* Unlock AES */
- wind_update(END_MCTRL);
- wind_update(END_UPDATE);
-
- GEM_locked=SDL_FALSE;
- }
-}
-
-SDL_Surface *GEM_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- Uint32 modeflags, screensize;
- SDL_bool use_shadow1, use_shadow2;
-
- /* width must be multiple of 16, for vro_cpyfm() and c2p_convert() */
- if ((width & 15) != 0) {
- width = (width | 15) +1;
- }
-
- /*--- Verify if asked mode can be used ---*/
- if (VDI_bpp != bpp) {
- SDL_SetError("%d bpp mode not supported", bpp);
- return(NULL);
- }
-
- if (flags & SDL_FULLSCREEN) {
- if ((VDI_w < width) || (VDI_h < height)) {
- SDL_SetError("%dx%d mode is too large", width, height);
- return(NULL);
- }
- }
-
- /*--- Allocate the new pixel format for the screen ---*/
- if ( ! SDL_ReallocFormat(current, VDI_bpp, VDI_redmask, VDI_greenmask, VDI_bluemask, VDI_alphamask) ) {
- SDL_SetError("Couldn't allocate new pixel format for requested mode");
- return(NULL);
- }
-
- screensize = width * height * VDI_pixelsize;
-
-#ifdef DEBUG_VIDEO_GEM
- printf("sdl:video:gem: setvideomode(): %dx%dx%d = %d\n", width, height, bpp, screensize);
-#endif
-
- /*--- Allocate shadow buffers if needed, and conversion operations ---*/
- GEM_FreeBuffers(this);
-
- GEM_bufops=0;
- use_shadow1=use_shadow2=SDL_FALSE;
- if (VDI_screen && (flags & SDL_FULLSCREEN)) {
- if (VDI_format==VDI_FORMAT_INTER) {
- use_shadow1=SDL_TRUE;
- GEM_bufops = B2S_C2P_1TOS;
- }
- } else {
- use_shadow1=SDL_TRUE;
- if (VDI_format==VDI_FORMAT_PACK) {
- GEM_bufops = B2S_VROCPYFM_1TOS;
- } else {
- use_shadow2=SDL_TRUE;
- GEM_bufops = B2S_C2P_1TO2|B2S_VROCPYFM_2TOS;
- }
- }
-
- if (use_shadow1) {
- GEM_buffer1 = Atari_SysMalloc(screensize, MX_PREFTTRAM);
- if (GEM_buffer1==NULL) {
- SDL_SetError("Can not allocate %d KB for frame buffer", screensize>>10);
- return NULL;
- }
- SDL_memset(GEM_buffer1, 0, screensize);
-#ifdef DEBUG_VIDEO_GEM
- printf("sdl:video:gem: setvideomode(): allocated buffer 1\n");
-#endif
- }
-
- if (use_shadow2) {
- GEM_buffer2 = Atari_SysMalloc(screensize, MX_PREFTTRAM);
- if (GEM_buffer2==NULL) {
- SDL_SetError("Can not allocate %d KB for shadow buffer", screensize>>10);
- return NULL;
- }
- SDL_memset(GEM_buffer2, 0, screensize);
-#ifdef DEBUG_VIDEO_GEM
- printf("sdl:video:gem: setvideomode(): allocated buffer 2\n");
-#endif
- }
-
- /*--- Initialize screen ---*/
- modeflags = SDL_PREALLOC;
- if (VDI_bpp == 8) {
- modeflags |= SDL_HWPALETTE;
- }
-
- if (flags & SDL_FULLSCREEN) {
- GEM_LockScreen(this);
-
- GEM_ClearScreen(this);
-
- modeflags |= SDL_FULLSCREEN;
- if (VDI_screen && (VDI_format==VDI_FORMAT_PACK) && !use_shadow1) {
- modeflags |= SDL_HWSURFACE;
- } else {
- modeflags |= SDL_SWSURFACE;
- }
-
- GEM_fullscreen = SDL_TRUE;
- } else {
- int old_win_type;
- short x2,y2,w2,h2;
-
- GEM_UnlockScreen(this);
-
- /* Set window gadgets */
- old_win_type = GEM_win_type;
- if (!(flags & SDL_NOFRAME)) {
- GEM_win_type=NAME|MOVER|CLOSER|SMALLER;
- if (flags & SDL_RESIZABLE) {
- GEM_win_type |= FULLER|SIZER;
- modeflags |= SDL_RESIZABLE;
- }
- } else {
- GEM_win_type=0;
- modeflags |= SDL_NOFRAME;
- }
- modeflags |= SDL_SWSURFACE;
-
- /* Recreate window ? only for different widget or non-created window */
- if ((old_win_type != GEM_win_type) || (GEM_handle < 0)) {
- /* Calculate window size */
- if (!wind_calc(WC_BORDER, GEM_win_type, 0,0,width,height, &x2,&y2,&w2,&h2)) {
- GEM_FreeBuffers(this);
- SDL_SetError("Can not calculate window attributes");
- return NULL;
- }
-
- /* Center window */
- x2 = (GEM_desk_w-w2)>>1;
- y2 = (GEM_desk_h-h2)>>1;
- if (x2<0) {
- x2 = 0;
- }
- if (y2<0) {
- y2 = 0;
- }
- x2 += GEM_desk_x;
- y2 += GEM_desk_y;
-
- /* Destroy existing window */
- if (GEM_handle >= 0) {
- wind_close(GEM_handle);
- wind_delete(GEM_handle);
- }
-
- /* Create window */
- GEM_handle=wind_create(GEM_win_type, x2,y2,w2,h2);
- if (GEM_handle<0) {
- GEM_FreeBuffers(this);
- SDL_SetError("Can not create window");
- return NULL;
- }
-
-#ifdef DEBUG_VIDEO_GEM
- printf("sdl:video:gem: handle=%d\n", GEM_handle);
-#endif
-
- /* Setup window name */
- wind_set(GEM_handle,WF_NAME,(short)(((unsigned long)GEM_title_name)>>16),(short)(((unsigned long)GEM_title_name) & 0xffff),0,0);
- GEM_refresh_name = SDL_FALSE;
-
- /* Open the window */
- wind_open(GEM_handle,x2,y2,w2,h2);
- } else {
- /* Resize window to fit asked video mode */
- wind_get (GEM_handle, WF_WORKXYWH, &x2,&y2,&w2,&h2);
- if (wind_calc(WC_BORDER, GEM_win_type, x2,y2,width,height, &x2,&y2,&w2,&h2)) {
- wind_set (GEM_handle, WF_CURRXYWH, x2,y2,w2,h2);
- }
- }
-
- GEM_fullscreen = SDL_FALSE;
- }
-
- /* Set up the new mode framebuffer */
- current->w = width;
- current->h = height;
- if (use_shadow1) {
- current->pixels = GEM_buffer1;
- current->pitch = width * VDI_pixelsize;
- } else {
- current->pixels = VDI_screen;
- current->pitch = VDI_pitch;
- }
-
-#if SDL_VIDEO_OPENGL
- if (flags & SDL_OPENGL) {
- if (!SDL_AtariGL_Init(this, current)) {
- GEM_FreeBuffers(this);
- SDL_SetError("Can not create OpenGL context");
- return NULL;
- }
-
- modeflags |= SDL_OPENGL;
- }
-#endif
-
- current->flags = modeflags;
-
-#ifdef DEBUG_VIDEO_GEM
- printf("sdl:video:gem: surface: %dx%d\n", current->w, current->h);
-#endif
-
- this->UpdateRects = GEM_UpdateRects;
- GEM_lock_redraw = SDL_FALSE; /* Enable redraw */
-
- /* We're done */
- return(current);
-}
-
-static int GEM_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- return -1;
-}
-
-static void GEM_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-static int GEM_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- return(0);
-}
-
-static void GEM_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-static void GEM_UpdateRectsFullscreen(_THIS, int numrects, SDL_Rect *rects)
-{
- SDL_Surface *surface;
- int i, surf_width;
-
- surface = this->screen;
- /* Need to be a multiple of 16 pixels */
- surf_width=surface->w;
- if ((surf_width & 15) != 0) {
- surf_width = (surf_width | 15) + 1;
- }
-
- if (GEM_bufops & (B2S_C2P_1TO2|B2S_C2P_1TOS)) {
- void *destscr;
- int destpitch;
-
- if (GEM_bufops & B2S_C2P_1TOS) {
- destscr = VDI_screen;
- destpitch = VDI_pitch;
- } else {
- destscr = GEM_buffer2;
- destpitch = surface->pitch;
- }
-
- for (i=0;i<numrects;i++) {
- void *source,*destination;
- int x1,x2;
-
- x1 = rects[i].x & ~15;
- x2 = rects[i].x+rects[i].w;
- if (x2 & 15) {
- x2 = (x2 | 15) +1;
- }
-
- source = surface->pixels;
- source += surface->pitch * rects[i].y;
- source += x1;
-
- destination = destscr;
- destination += destpitch * rects[i].y;
- destination += x1;
-
- SDL_Atari_C2pConvert(
- source, destination,
- x2-x1, rects[i].h,
- SDL_FALSE,
- surface->pitch, destpitch
- );
- }
- }
-
- if (GEM_bufops & (B2S_VROCPYFM_1TOS|B2S_VROCPYFM_2TOS)) {
- MFDB mfdb_src;
- short blitcoords[8];
-
- mfdb_src.fd_addr=surface->pixels;
- mfdb_src.fd_w=surf_width;
- mfdb_src.fd_h=surface->h;
- mfdb_src.fd_wdwidth= (surface->pitch/VDI_pixelsize) >> 4;
- mfdb_src.fd_nplanes=surface->format->BitsPerPixel;
- mfdb_src.fd_stand=
- mfdb_src.fd_r1=
- mfdb_src.fd_r2=
- mfdb_src.fd_r3= 0;
- if (GEM_bufops & B2S_VROCPYFM_2TOS) {
- mfdb_src.fd_addr=GEM_buffer2;
- }
-
- for ( i=0; i<numrects; ++i ) {
- blitcoords[0] = blitcoords[4] = rects[i].x;
- blitcoords[1] = blitcoords[5] = rects[i].y;
- blitcoords[2] = blitcoords[6] = rects[i].x + rects[i].w - 1;
- blitcoords[3] = blitcoords[7] = rects[i].y + rects[i].h - 1;
-
- vro_cpyfm(VDI_handle, S_ONLY, blitcoords, &mfdb_src, &VDI_dst_mfdb);
- }
- }
-}
-
-static void GEM_UpdateRectsWindowed(_THIS, int numrects, SDL_Rect *rects)
-{
- short pxy[4], wind_pxy[4];
- int i;
-
- if (wind_get(GEM_handle, WF_WORKXYWH, &wind_pxy[0], &wind_pxy[1], &wind_pxy[2], &wind_pxy[3])==0) {
- return;
- }
-
- for ( i=0; i<numrects; ++i ) {
- pxy[0] = wind_pxy[0] + rects[i].x;
- pxy[1] = wind_pxy[1] + rects[i].y;
- pxy[2] = rects[i].w;
- pxy[3] = rects[i].h;
-
- GEM_wind_redraw(this, GEM_handle, pxy);
- }
-}
-
-static void GEM_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
-{
- SDL_Surface *surface;
-
- if (GEM_lock_redraw) {
- return;
- }
-
- surface = this->screen;
-
- if (surface->flags & SDL_FULLSCREEN) {
- GEM_UpdateRectsFullscreen(this, numrects, rects);
- } else {
- GEM_UpdateRectsWindowed(this, numrects, rects);
- }
-}
-
-static int GEM_FlipHWSurfaceFullscreen(_THIS, SDL_Surface *surface)
-{
- int surf_width;
-
- /* Need to be a multiple of 16 pixels */
- surf_width=surface->w;
- if ((surf_width & 15) != 0) {
- surf_width = (surf_width | 15) + 1;
- }
-
- if (GEM_bufops & (B2S_C2P_1TO2|B2S_C2P_1TOS)) {
- void *destscr;
- int destpitch;
-
- if (GEM_bufops & B2S_C2P_1TOS) {
- destscr = VDI_screen;
- destpitch = VDI_pitch;
- } else {
- destscr = GEM_buffer2;
- destpitch = surface->pitch;
- }
-
- SDL_Atari_C2pConvert(
- surface->pixels, destscr,
- surf_width, surface->h,
- SDL_FALSE,
- surface->pitch, destpitch
- );
- }
-
- if (GEM_bufops & (B2S_VROCPYFM_1TOS|B2S_VROCPYFM_2TOS)) {
- MFDB mfdb_src;
- short blitcoords[8];
-
- mfdb_src.fd_w=surf_width;
- mfdb_src.fd_h=surface->h;
- mfdb_src.fd_wdwidth=mfdb_src.fd_w >> 4;
- mfdb_src.fd_nplanes=surface->format->BitsPerPixel;
- mfdb_src.fd_stand=
- mfdb_src.fd_r1=
- mfdb_src.fd_r2=
- mfdb_src.fd_r3= 0;
- if (GEM_bufops & B2S_VROCPYFM_1TOS) {
- mfdb_src.fd_addr=surface->pixels;
- } else {
- mfdb_src.fd_addr=GEM_buffer2;
- }
-
- blitcoords[0] = blitcoords[4] = 0;
- blitcoords[1] = blitcoords[5] = 0;
- blitcoords[2] = blitcoords[6] = surface->w - 1;
- blitcoords[3] = blitcoords[7] = surface->h - 1;
-
- vro_cpyfm(VDI_handle, S_ONLY, blitcoords, &mfdb_src, &VDI_dst_mfdb);
- }
-
- return(0);
-}
-
-static int GEM_FlipHWSurfaceWindowed(_THIS, SDL_Surface *surface)
-{
- short pxy[8];
-
- /* Update the whole window */
- wind_get(GEM_handle, WF_WORKXYWH, &pxy[0], &pxy[1], &pxy[2], &pxy[3]);
-
- GEM_wind_redraw(this, GEM_handle, pxy);
-
- return(0);
-}
-
-static int GEM_FlipHWSurface(_THIS, SDL_Surface *surface)
-{
- if (GEM_lock_redraw) {
- return(0);
- }
-
- if (surface->flags & SDL_FULLSCREEN) {
- return GEM_FlipHWSurfaceFullscreen(this, surface);
- } else {
- return GEM_FlipHWSurfaceWindowed(this, surface);
- }
-}
-
-static int GEM_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- int i;
- SDL_Surface *surface;
-
-#ifdef DEBUG_VIDEO_GEM
- printf("sdl:video:gem: setcolors()\n");
-#endif
-
- /* Do not change palette in True Colour */
- surface = this->screen;
- if (surface->format->BitsPerPixel > 8) {
- return 1;
- }
-
- for(i = 0; i < ncolors; i++)
- {
- int r, g, b;
- short rgb[3];
-
- r = colors[i].r;
- g = colors[i].g;
- b = colors[i].b;
-
- rgb[0] = VDI_curpalette[i][0] = (1000 * r) / 255;
- rgb[1] = VDI_curpalette[i][1] =(1000 * g) / 255;
- rgb[2] = VDI_curpalette[i][2] =(1000 * b) / 255;
-
- vs_color(VDI_handle, vdi_index[firstcolor+i], rgb);
- }
-
- return(1);
-}
-
-#if 0
-static int GEM_ToggleFullScreen(_THIS, int on)
-{
- if (on) {
- GEM_LockScreen(this);
- } else {
- GEM_UnlockScreen(this);
- }
-
- return(1);
-}
-#endif
-
-/* Note: If we are terminated, this could be called in the middle of
- another SDL video routine -- notably UpdateRects.
-*/
-void GEM_VideoQuit(_THIS)
-{
- SDL_AtariXbios_RestoreVectors();
- if (GEM_usedevmouse) {
- SDL_AtariDevMouse_Close();
- }
-
- GEM_FreeBuffers(this);
-
-#if SDL_VIDEO_OPENGL
- if (gl_active) {
- SDL_AtariGL_Quit(this, SDL_TRUE);
- }
-#endif
-
- /* Destroy window */
- if (GEM_handle>=0) {
- wind_close(GEM_handle);
- wind_delete(GEM_handle);
- GEM_handle=-1;
- }
-
- GEM_UnlockScreen(this);
- if (GEM_menubar) {
- Mfree(GEM_menubar);
- GEM_menubar=NULL;
- }
-
- appl_exit();
-
- GEM_SetNewPalette(this, VDI_oldpalette);
-
- /* Close VDI workstation */
- if (VDI_handle) {
- v_clsvwk(VDI_handle);
- }
-
- /* Free mode list */
- if (SDL_modelist[0]) {
- SDL_free(SDL_modelist[0]);
- SDL_modelist[0]=NULL;
- }
-
- this->screen->pixels = NULL;
-}
-
-void GEM_wind_redraw(_THIS, int winhandle, short *inside)
-{
- short todo[4];
-
- /* Tell AES we are going to update */
- wind_update(BEG_UPDATE);
-
- v_hide_c(VDI_handle);
-
- /* Browse the rectangle list to redraw */
- if (wind_get(winhandle, WF_FIRSTXYWH, &todo[0], &todo[1], &todo[2], &todo[3])!=0) {
-
- while (todo[2] && todo[3]) {
-
- if (rc_intersect((GRECT *)inside,(GRECT *)todo)) {
- todo[2] += todo[0]-1;
- todo[3] += todo[1]-1;
- refresh_window(this, winhandle, todo);
- }
-
- if (wind_get(winhandle, WF_NEXTXYWH, &todo[0], &todo[1], &todo[2], &todo[3])==0) {
- break;
- }
- }
-
- }
-
- /* Update finished */
- wind_update(END_UPDATE);
-
- v_show_c(VDI_handle,1);
-}
-
-static void refresh_window(_THIS, int winhandle, short *rect)
-{
- MFDB mfdb_src;
- short pxy[8],wind_pxy[8];
- SDL_Surface *surface;
- int iconified;
-
- /* Is window iconified ? */
- iconified = 0;
-/* if (GEM_wfeatures & (1<<WF_ICONIFY))*/ {
- if (wind_get(winhandle, WF_ICONIFY, &wind_pxy[0], &wind_pxy[1], &wind_pxy[2], &wind_pxy[3])!=0) {
- iconified = wind_pxy[0];
- }
- }
-
- if (wind_get(winhandle, WF_WORKXYWH, &wind_pxy[0], &wind_pxy[1], &wind_pxy[2], &wind_pxy[3])==0) {
- return;
- }
-
- if (iconified && GEM_icon) {
- short icon_rect[4], dst_rect[4];
- short iconx,icony;
-
- surface = GEM_icon;
-
- GEM_ClearRect(this, rect);
-
- /* Calculate centered icon(x,y,w,h) relative to window */
- iconx = (wind_pxy[2]-surface->w)>>1;
- icony = (wind_pxy[3]-surface->h)>>1;
-
- icon_rect[0] = iconx;
- icon_rect[1] = icony;
- icon_rect[2] = surface->w;
- icon_rect[3] = surface->h;
-
- /* Calculate redraw rectangle(x,y,w,h) relative to window */
- dst_rect[0] = rect[0]-wind_pxy[0];
- dst_rect[1] = rect[1]-wind_pxy[1];
- dst_rect[2] = rect[2]-rect[0]+1;
- dst_rect[3] = rect[3]-rect[1]+1;
-
- /* Does the icon rectangle must be redrawn ? */
- if (!rc_intersect((GRECT *)icon_rect, (GRECT *)dst_rect)) {
- return;
- }
-
-#if DEBUG_VIDEO_GEM
- printf("sdl:video:gem: clip(0,0,%d,%d) to (%d,%d,%d,%d)\n",
- surface->w-1,surface->h-1, dst_rect[0],dst_rect[1],dst_rect[2],dst_rect[3]);
- printf("sdl:video:gem: icon(%d,%d,%d,%d)\n",
- icon_rect[0], icon_rect[1], icon_rect[2], icon_rect[3]);
- printf("sdl:video:gem: refresh_window(): draw icon\n");
-#endif
-
- /* Calculate icon(x1,y1,x2,y2) relative to screen */
- icon_rect[0] += wind_pxy[0];
- icon_rect[1] += wind_pxy[1];
- icon_rect[2] += icon_rect[0]-1;
- icon_rect[3] += icon_rect[1]-1;
-
- /* Calculate intersection rectangle to redraw */
- pxy[4]=pxy[0]=MAX(icon_rect[0],rect[0]);
- pxy[5]=pxy[1]=MAX(icon_rect[1],rect[1]);
- pxy[6]=pxy[2]=MIN(icon_rect[2],rect[2]);
- pxy[7]=pxy[3]=MIN(icon_rect[3],rect[3]);
-
- /* Calculate icon source image pos relative to window */
- pxy[0] -= wind_pxy[0]+iconx;
- pxy[1] -= wind_pxy[1]+icony;
- pxy[2] -= wind_pxy[0]+iconx;
- pxy[3] -= wind_pxy[1]+icony;
-
- } else {
- surface = this->screen;
-
-#if DEBUG_VIDEO_GEM
- printf("sdl:video:gem: refresh_window(): draw frame buffer\n");
-#endif
-
- /* Redraw all window content */
- pxy[0] = rect[0]-wind_pxy[0];
- pxy[1] = rect[1]-wind_pxy[1];
- pxy[2] = rect[2]-wind_pxy[0];
- pxy[3] = rect[3]-wind_pxy[1];
-
- pxy[4] = rect[0];
- pxy[5] = rect[1];
- pxy[6] = rect[2];
- pxy[7] = rect[3];
- }
-
- if (GEM_bufops & B2S_C2P_1TO2) {
- void *src, *dest;
- int x1,x2;
-
- x1 = (rect[0]-wind_pxy[0]) & ~15;
- x2 = rect[2]-wind_pxy[0];
- if (x2 & 15) {
- x2 = (x2 | 15) +1;
- }
-
- src = surface->pixels;
- src += surface->pitch * (rect[1]-wind_pxy[1]);
- src += x1;
-
- dest = GEM_buffer2;
- dest += surface->pitch * (rect[1]-wind_pxy[1]);
- dest += x1;
-
- SDL_Atari_C2pConvert(
- src, dest,
- x2-x1, rect[3]-rect[1]+1,
- SDL_FALSE,
- surface->pitch, surface->pitch
- );
- }
-
- mfdb_src.fd_addr=surface->pixels;
- {
- int width;
-
- /* Need to be a multiple of 16 pixels */
- width=surface->w;
- if ((width & 15) != 0) {
- width = (width | 15) + 1;
- }
- mfdb_src.fd_w=width;
- }
- mfdb_src.fd_h=surface->h;
- mfdb_src.fd_nplanes=surface->format->BitsPerPixel;
- mfdb_src.fd_wdwidth=mfdb_src.fd_w>>4;
- mfdb_src.fd_stand=
- mfdb_src.fd_r1=
- mfdb_src.fd_r2=
- mfdb_src.fd_r3= 0;
-
- if (GEM_bufops & B2S_VROCPYFM_2TOS) {
- mfdb_src.fd_addr=GEM_buffer2;
- }
-
-#if DEBUG_VIDEO_GEM
- printf("sdl:video:gem: redraw %dx%d: (%d,%d,%d,%d) to (%d,%d,%d,%d)\n",
- surface->w, surface->h,
- pxy[0],pxy[1],pxy[2],pxy[3],
- pxy[4],pxy[5],pxy[6],pxy[7]
- );
-#endif
-
- vro_cpyfm( VDI_handle, S_ONLY, pxy, &mfdb_src, &VDI_dst_mfdb);
-}
-
-#if SDL_VIDEO_OPENGL
-
-static void GEM_GL_SwapBuffers(_THIS)
-{
- SDL_AtariGL_SwapBuffers(this);
- GEM_FlipHWSurface(this, this->screen);
-}
-
-#endif
diff --git a/distrib/sdl-1.2.12/src/video/gem/SDL_gemvideo.h b/distrib/sdl-1.2.12/src/video/gem/SDL_gemvideo.h
deleted file mode 100644
index de96628..0000000
--- a/distrib/sdl-1.2.12/src/video/gem/SDL_gemvideo.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_gemvideo_h
-#define _SDL_gemvideo_h
-
-#include "SDL_mutex.h"
-#include "../SDL_sysvideo.h"
-
-/* The implementation dependent data for the window manager cursor */
-struct WMcursor {
- MFORM *mform_p;
-};
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-/* Functions prototypes */
-void GEM_wind_redraw(_THIS, int winhandle, short *inside);
-
-/* Private display data */
-
-#define B2S_C2P_1TO2 (1<<0) /* C2P convert buffer 1 to buffer 2 */
-#define B2S_C2P_1TOS (1<<1) /* C2P convert buffer 1 to screen */
-#define B2S_VROCPYFM_1TOS (1<<2) /* vro_cpyfm() buffer 1 to screen */
-#define B2S_VROCPYFM_2TOS (1<<3) /* vro_cpyfm() buffer 2 to screen */
-
-#define SDL_NUMMODES 1 /* Fullscreen */
-
-struct SDL_PrivateVideoData {
- Uint16 buf2scr_ops; /* Operations to get buffer to screen */
- void *buffer1; /* Our shadow buffers */
- void *buffer2;
-
- /* VDI infos */
- short vdi_handle; /* VDI handle */
- short full_w, full_h; /* Fullscreen size */
- short bpp; /* Colour depth */
- short pixelsize; /* Bytes per pixel */
- short old_numcolors; /* Number of colors in saved palette */
- Uint16 pitch; /* Line length */
- Uint16 format; /* Screen format */
- void *screen; /* Screen address */
- Uint32 red, green, blue, alpha; /* Screen components */
- Uint32 screensize;
- short blit_coords[8]; /* Coordinates for bitblt */
- MFDB src_mfdb, dst_mfdb; /* VDI MFDB for bitblt */
- Uint16 old_palette[256][3]; /* Saved current palette */
- Uint16 cur_palette[256][3]; /* SDL application palette */
- /* Function to set/restore palette */
- void (*setpalette)(_THIS, Uint16 newpal[256][3]);
-
- /* GEM infos */
- short desk_x, desk_y; /* Desktop properties */
- short desk_w, desk_h;
- short win_handle; /* Our window handle */
- int window_type; /* Window type */
- const char *title_name; /* Window title */
- const char *icon_name; /* Icon title */
- short version; /* AES version */
- short wfeatures; /* AES window features */
- SDL_bool refresh_name; /* Change window title ? */
- SDL_bool window_fulled; /* Window maximized ? */
- SDL_bool mouse_relative; /* Report relative mouse movement */
- SDL_bool locked; /* AES locked for fullscreen ? */
- SDL_bool lock_redraw; /* Prevent redraw till buffers are setup */
- short message[8]; /* To self-send an AES message */
- void *menubar; /* Menu bar save buffer when going fullscreen */
- SDL_bool use_dev_mouse; /* Use /dev/mouse ? */
- WMcursor *cursor; /* To restore cursor when leaving/entering window */
-
- SDL_bool fullscreen; /* Fullscreen or windowed mode ? */
- SDL_Rect *SDL_modelist[SDL_NUMMODES+1]; /* Mode list */
- SDL_Surface *icon; /* The icon */
-};
-
-/* Hidden structure -> variables names */
-#define VDI_handle (this->hidden->vdi_handle)
-#define VDI_w (this->hidden->full_w)
-#define VDI_h (this->hidden->full_h)
-#define VDI_bpp (this->hidden->bpp)
-#define VDI_pixelsize (this->hidden->pixelsize)
-#define VDI_oldnumcolors (this->hidden->old_numcolors)
-#define VDI_oldpalette (this->hidden->old_palette)
-#define VDI_curpalette (this->hidden->cur_palette)
-#define VDI_setpalette (this->hidden->setpalette)
-#define VDI_pitch (this->hidden->pitch)
-#define VDI_format (this->hidden->format)
-#define VDI_screen (this->hidden->screen)
-#define VDI_redmask (this->hidden->red)
-#define VDI_greenmask (this->hidden->green)
-#define VDI_bluemask (this->hidden->blue)
-#define VDI_alphamask (this->hidden->alpha)
-#define VDI_screensize (this->hidden->screensize)
-#define VDI_src_mfdb (this->hidden->src_mfdb)
-#define VDI_dst_mfdb (this->hidden->dst_mfdb)
-#define VDI_blit_coords (this->hidden->blit_coords)
-
-#define GEM_desk_x (this->hidden->desk_x)
-#define GEM_desk_y (this->hidden->desk_y)
-#define GEM_desk_w (this->hidden->desk_w)
-#define GEM_desk_h (this->hidden->desk_h)
-#define GEM_handle (this->hidden->win_handle)
-#define GEM_win_type (this->hidden->window_type)
-#define GEM_title_name (this->hidden->title_name)
-#define GEM_icon_name (this->hidden->icon_name)
-#define GEM_refresh_name (this->hidden->refresh_name)
-#define GEM_version (this->hidden->version)
-#define GEM_wfeatures (this->hidden->wfeatures)
-#define GEM_win_fulled (this->hidden->window_fulled)
-#define GEM_mouse_relative (this->hidden->mouse_relative)
-#define GEM_locked (this->hidden->locked)
-#define GEM_lock_redraw (this->hidden->lock_redraw)
-#define GEM_message (this->hidden->message)
-#define SDL_modelist (this->hidden->SDL_modelist)
-#define GEM_icon (this->hidden->icon)
-#define GEM_fullscreen (this->hidden->fullscreen)
-#define GEM_menubar (this->hidden->menubar)
-#define GEM_usedevmouse (this->hidden->use_dev_mouse)
-#define GEM_cursor (this->hidden->cursor)
-
-#define GEM_buffer1 (this->hidden->buffer1)
-#define GEM_buffer2 (this->hidden->buffer2)
-#define GEM_bufops (this->hidden->buf2scr_ops)
-
-#define VDI_FBMASK(amask, rmask, gmask, bmask) \
- VDI_alphamask = (amask); \
- VDI_redmask = (rmask); \
- VDI_greenmask = (gmask); \
- VDI_bluemask = (bmask);
-
-/*
- Possible buffer to screen operations:
-
- TC: 8 (chunky),15,16,24,32 bpp
- 8I: 8 bpp planes
- FB: screen framebuffer address available
- FS: fullscreen
-
- TC, FB, FS:
- - draw to screen
- 8I, FB, FS:
- - draw to buffer 1
- - C2P from buffer 1 to screen
-
- TC, !FB, FS:
- - draw to buffer 1
- - vro_cpyfm() from buffer 1 to screen
- 8I, !FB, FS:
- - draw to buffer 1
- - C2P from buffer 1 to buffer 2
- - vro_cpyfm() from buffer 2 to screen
-
- TC, FB, !FS:
- - draw to buffer 1
- - vro_cpyfm() from buffer 1 to screen
- 8I, FB, !FS:
- - draw to buffer 1
- - C2P from buffer 1 to buffer 2
- - vro_cpyfm() from buffer 2 to screen
-
- TC, !FB, !FS:
- - draw to buffer 1
- - vro_cpyfm() from buffer 1 to screen
- 8I, !FB, !FS:
- - draw to buffer 1
- - C2P from buffer 1 to buffer 2
- - vro_cpyfm() from buffer 2 to screen
-*/
-
-#endif /* _SDL_gemvideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/gem/SDL_gemwm.c b/distrib/sdl-1.2.12/src/video/gem/SDL_gemwm.c
deleted file mode 100644
index c6b2998..0000000
--- a/distrib/sdl-1.2.12/src/video/gem/SDL_gemwm.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- GEM SDL video driver
- Window manager functions
-
- Patrice Mandin
-*/
-
-/* Mint includes */
-#include <gem.h>
-
-#include "SDL_gemwm_c.h"
-
-/* Defines */
-
-#define ICONWIDTH 64
-#define ICONHEIGHT 64
-
-/* Functions */
-
-void GEM_SetCaption(_THIS, const char *title, const char *icon)
-{
- if (title) {
- GEM_title_name = title;
- GEM_refresh_name = SDL_TRUE;
- }
-
- if (icon) {
- GEM_icon_name = icon;
- GEM_refresh_name = SDL_TRUE;
- }
-}
-
-void GEM_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask)
-{
- SDL_Surface *sicon;
- SDL_Rect bounds;
-
-#if 0
- if ((GEM_wfeatures & (1<<WF_ICONIFY))==0) {
- return;
- }
-#endif
-
- if (icon == NULL) {
- return;
- }
-
- /* Convert icon to the screen format */
- sicon = SDL_CreateRGBSurface(SDL_SWSURFACE, icon->w, icon->h,
- VDI_bpp, VDI_redmask, VDI_greenmask, VDI_bluemask, 0);
- if ( sicon == NULL ) {
- return;
- }
-
- bounds.x = 0;
- bounds.y = 0;
- bounds.w = icon->w;
- bounds.h = icon->h;
- if ( SDL_LowerBlit(icon, &bounds, sicon, &bounds) < 0 ) {
- SDL_FreeSurface(sicon);
- return;
- }
-
- GEM_icon = sicon;
-}
-
-int GEM_IconifyWindow(_THIS)
-{
- if ((GEM_wfeatures & (1<<WF_ICONIFY))==0)
- return 0;
-
- GEM_message[0] = WM_ICONIFY;
- GEM_message[1] = gl_apid;
- GEM_message[2] = 0;
- GEM_message[3] = GEM_handle;
- GEM_message[4] = 0;
- GEM_message[5] = GEM_desk_h-ICONHEIGHT;
- GEM_message[6] = ICONWIDTH;
- GEM_message[7] = ICONHEIGHT;
-
- appl_write(gl_apid, sizeof(GEM_message), GEM_message);
-
- return 1;
-}
-
-SDL_GrabMode GEM_GrabInput(_THIS, SDL_GrabMode mode)
-{
- if (this->screen == NULL) {
- return SDL_GRAB_OFF;
- }
-
- return mode;
-}
diff --git a/distrib/sdl-1.2.12/src/video/gem/SDL_gemwm_c.h b/distrib/sdl-1.2.12/src/video/gem/SDL_gemwm_c.h
deleted file mode 100644
index a2a0b63..0000000
--- a/distrib/sdl-1.2.12/src/video/gem/SDL_gemwm_c.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * GEM SDL video driver implementation
- * Window manager functions
- *
- * Patrice Mandin
- */
-
-#include "SDL_gemvideo.h"
-
-/* Functions prototypes */
-extern void GEM_SetCaption(_THIS, const char *title, const char *icon);
-extern void GEM_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask);
-extern int GEM_IconifyWindow(_THIS);
-extern SDL_GrabMode GEM_GrabInput(_THIS, SDL_GrabMode mode);
diff --git a/distrib/sdl-1.2.12/src/video/ggi/SDL_ggievents.c b/distrib/sdl-1.2.12/src/video/ggi/SDL_ggievents.c
deleted file mode 100644
index d22d676..0000000
--- a/distrib/sdl-1.2.12/src/video/ggi/SDL_ggievents.c
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Handle the event stream, converting GGI events into SDL events */
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <termios.h>
-
-#include <ggi/keyboard.h>
-
-#include "SDL_ggikeys.h"
-
-#include "SDL.h"
-#include "../SDL_sysvideo.h"
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_ggivideo.h"
-#include "SDL_ggievents_c.h"
-
-/* The translation tables from a GGI keycode to a SDL keysym */
-static SDLKey keymap[128];
-static SDL_keysym *GGI_TranslateKey(ggi_event *ev, SDL_keysym *keysym);
-
-static int posted = 0;
-
-void GGI_PumpEvents(_THIS)
-{
- struct timeval *tvp, tv = { 0, 0 };
- ggi_event ev;
-
- tvp = &tv;
-
-/* ggiFlush(VIS); */
-
- while (ggiEventPoll(VIS, emAll, tvp))
-/* while (ggiEventPoll(VIS, (emKeyboard | emPointer | emCommand), tvp)) */
- {
- int queueevent_mouse = 0, queueevent_kbd = 0;
- static int buttons = 0;
- static int mouse_x = 0, mouse_y = 0, mouse_z = 0;
- int x = 0, y = 0, z = 0, rx = 0, ry = 0, rz = 0;
- int pressed_mouse, pressed_kbd;
- SDL_keysym keysym;
-
- posted = 0;
-
- /* FIXME: We do not actually want all events, only
- * mouse and keyboard events. Having to handle all
- * events will slow things down. */
-
- ggiEventRead(VIS, &ev, emAll);
-/* ggiEventRead(VIS, &ev, (emKeyboard | emPointer | emCommand)); */
-
- switch (ev.any.type)
- {
- case evPtrRelative:
- x = ev.pmove.x;
- y = ev.pmove.y;
- z = ev.pmove.wheel;
- posted += SDL_PrivateMouseMotion(0, 1, x, y);
- break;
- case evPtrAbsolute:
- if (mouse_x != ev.pmove.x || mouse_y != ev.pmove.y || mouse_z != ev.pmove.wheel)
- {
- x = ev.pmove.x - mouse_x;
- y = ev.pmove.y - mouse_y;
- z = ev.pmove.wheel - mouse_z;
- mouse_x = ev.pmove.x;
- mouse_y = ev.pmove.y;
- mouse_z = ev.pmove.wheel;
- posted += SDL_PrivateMouseMotion(0, 1, x, y);
- }
- break;
- case evPtrButtonPress:
- posted += SDL_PrivateMouseButton(SDL_PRESSED, ev.pbutton.button, 0, 0);
- break;
- case evPtrButtonRelease:
- posted += SDL_PrivateMouseButton(SDL_RELEASED, ev.pbutton.button, 0, 0);
- break;
- case evKeyPress:
- case evKeyRepeat:
- posted += SDL_PrivateKeyboard(SDL_PRESSED, GGI_TranslateKey(&ev, &keysym));
- break;
- case evKeyRelease:
- posted += SDL_PrivateKeyboard(SDL_RELEASED, GGI_TranslateKey(&ev, &keysym));
- break;
- case evCommand:
- fprintf(stderr, "Command event %x recieved\n", ev.cmd.code);
- break;
- default:
- fprintf(stderr, "Unhandled event type %d\n", ev.any.type);
- break;
- }
- }
-
-}
-
-void GGI_InitOSKeymap(_THIS)
-{
- int i;
-
- /* Initialize the GGI key translation table */
- for ( i=0; i<SDL_arraysize(keymap); ++i )
- keymap[i] = SDLK_UNKNOWN;
-
- keymap[SCANCODE_ESCAPE] = SDLK_ESCAPE;
- keymap[SCANCODE_1] = SDLK_1;
- keymap[SCANCODE_2] = SDLK_2;
- keymap[SCANCODE_3] = SDLK_3;
- keymap[SCANCODE_4] = SDLK_4;
- keymap[SCANCODE_5] = SDLK_5;
- keymap[SCANCODE_6] = SDLK_6;
- keymap[SCANCODE_7] = SDLK_7;
- keymap[SCANCODE_8] = SDLK_8;
- keymap[SCANCODE_9] = SDLK_9;
- keymap[SCANCODE_0] = SDLK_0;
- keymap[SCANCODE_MINUS] = SDLK_MINUS;
- keymap[SCANCODE_EQUAL] = SDLK_EQUALS;
- keymap[SCANCODE_BACKSPACE] = SDLK_BACKSPACE;
- keymap[SCANCODE_TAB] = SDLK_TAB;
- keymap[SCANCODE_Q] = SDLK_q;
- keymap[SCANCODE_W] = SDLK_w;
- keymap[SCANCODE_E] = SDLK_e;
- keymap[SCANCODE_R] = SDLK_r;
- keymap[SCANCODE_T] = SDLK_t;
- keymap[SCANCODE_Y] = SDLK_y;
- keymap[SCANCODE_U] = SDLK_u;
- keymap[SCANCODE_I] = SDLK_i;
- keymap[SCANCODE_O] = SDLK_o;
- keymap[SCANCODE_P] = SDLK_p;
- keymap[SCANCODE_BRACKET_LEFT] = SDLK_LEFTBRACKET;
- keymap[SCANCODE_BRACKET_RIGHT] = SDLK_RIGHTBRACKET;
- keymap[SCANCODE_ENTER] = SDLK_RETURN;
- keymap[SCANCODE_LEFTCONTROL] = SDLK_LCTRL;
- keymap[SCANCODE_A] = SDLK_a;
- keymap[SCANCODE_S] = SDLK_s;
- keymap[SCANCODE_D] = SDLK_d;
- keymap[SCANCODE_F] = SDLK_f;
- keymap[SCANCODE_G] = SDLK_g;
- keymap[SCANCODE_H] = SDLK_h;
- keymap[SCANCODE_J] = SDLK_j;
- keymap[SCANCODE_K] = SDLK_k;
- keymap[SCANCODE_L] = SDLK_l;
- keymap[SCANCODE_SEMICOLON] = SDLK_SEMICOLON;
- keymap[SCANCODE_APOSTROPHE] = SDLK_QUOTE;
- keymap[SCANCODE_GRAVE] = SDLK_BACKQUOTE;
- keymap[SCANCODE_LEFTSHIFT] = SDLK_LSHIFT;
- keymap[SCANCODE_BACKSLASH] = SDLK_BACKSLASH;
- keymap[SCANCODE_Z] = SDLK_z;
- keymap[SCANCODE_X] = SDLK_x;
- keymap[SCANCODE_C] = SDLK_c;
- keymap[SCANCODE_V] = SDLK_v;
- keymap[SCANCODE_B] = SDLK_b;
- keymap[SCANCODE_N] = SDLK_n;
- keymap[SCANCODE_M] = SDLK_m;
- keymap[SCANCODE_COMMA] = SDLK_COMMA;
- keymap[SCANCODE_PERIOD] = SDLK_PERIOD;
- keymap[SCANCODE_SLASH] = SDLK_SLASH;
- keymap[SCANCODE_RIGHTSHIFT] = SDLK_RSHIFT;
- keymap[SCANCODE_KEYPADMULTIPLY] = SDLK_KP_MULTIPLY;
- keymap[SCANCODE_LEFTALT] = SDLK_LALT;
- keymap[SCANCODE_SPACE] = SDLK_SPACE;
- keymap[SCANCODE_CAPSLOCK] = SDLK_CAPSLOCK;
- keymap[SCANCODE_F1] = SDLK_F1;
- keymap[SCANCODE_F2] = SDLK_F2;
- keymap[SCANCODE_F3] = SDLK_F3;
- keymap[SCANCODE_F4] = SDLK_F4;
- keymap[SCANCODE_F5] = SDLK_F5;
- keymap[SCANCODE_F6] = SDLK_F6;
- keymap[SCANCODE_F7] = SDLK_F7;
- keymap[SCANCODE_F8] = SDLK_F8;
- keymap[SCANCODE_F9] = SDLK_F9;
- keymap[SCANCODE_F10] = SDLK_F10;
- keymap[SCANCODE_NUMLOCK] = SDLK_NUMLOCK;
- keymap[SCANCODE_SCROLLLOCK] = SDLK_SCROLLOCK;
- keymap[SCANCODE_KEYPAD7] = SDLK_KP7;
- keymap[SCANCODE_CURSORUPLEFT] = SDLK_KP7;
- keymap[SCANCODE_KEYPAD8] = SDLK_KP8;
- keymap[SCANCODE_CURSORUP] = SDLK_KP8;
- keymap[SCANCODE_KEYPAD9] = SDLK_KP9;
- keymap[SCANCODE_CURSORUPRIGHT] = SDLK_KP9;
- keymap[SCANCODE_KEYPADMINUS] = SDLK_KP_MINUS;
- keymap[SCANCODE_KEYPAD4] = SDLK_KP4;
- keymap[SCANCODE_CURSORLEFT] = SDLK_KP4;
- keymap[SCANCODE_KEYPAD5] = SDLK_KP5;
- keymap[SCANCODE_KEYPAD6] = SDLK_KP6;
- keymap[SCANCODE_CURSORRIGHT] = SDLK_KP6;
- keymap[SCANCODE_KEYPADPLUS] = SDLK_KP_PLUS;
- keymap[SCANCODE_KEYPAD1] = SDLK_KP1;
- keymap[SCANCODE_CURSORDOWNLEFT] = SDLK_KP1;
- keymap[SCANCODE_KEYPAD2] = SDLK_KP2;
- keymap[SCANCODE_CURSORDOWN] = SDLK_KP2;
- keymap[SCANCODE_KEYPAD3] = SDLK_KP3;
- keymap[SCANCODE_CURSORDOWNRIGHT] = SDLK_KP3;
- keymap[SCANCODE_KEYPAD0] = SDLK_KP0;
- keymap[SCANCODE_KEYPADPERIOD] = SDLK_KP_PERIOD;
- keymap[SCANCODE_LESS] = SDLK_LESS;
- keymap[SCANCODE_F11] = SDLK_F11;
- keymap[SCANCODE_F12] = SDLK_F12;
- keymap[SCANCODE_KEYPADENTER] = SDLK_KP_ENTER;
- keymap[SCANCODE_RIGHTCONTROL] = SDLK_RCTRL;
- keymap[SCANCODE_CONTROL] = SDLK_RCTRL;
- keymap[SCANCODE_KEYPADDIVIDE] = SDLK_KP_DIVIDE;
- keymap[SCANCODE_PRINTSCREEN] = SDLK_PRINT;
- keymap[SCANCODE_RIGHTALT] = SDLK_RALT;
- keymap[SCANCODE_BREAK] = SDLK_BREAK;
- keymap[SCANCODE_BREAK_ALTERNATIVE] = SDLK_UNKNOWN;
- keymap[SCANCODE_HOME] = SDLK_HOME;
- keymap[SCANCODE_CURSORBLOCKUP] = SDLK_UP;
- keymap[SCANCODE_PAGEUP] = SDLK_PAGEUP;
- keymap[SCANCODE_CURSORBLOCKLEFT] = SDLK_LEFT;
- keymap[SCANCODE_CURSORBLOCKRIGHT] = SDLK_RIGHT;
- keymap[SCANCODE_END] = SDLK_END;
- keymap[SCANCODE_CURSORBLOCKDOWN] = SDLK_DOWN;
- keymap[SCANCODE_PAGEDOWN] = SDLK_PAGEDOWN;
- keymap[SCANCODE_INSERT] = SDLK_INSERT;
- keymap[SCANCODE_REMOVE] = SDLK_DELETE;
- keymap[119] = SDLK_PAUSE;
- keymap[SCANCODE_RIGHTWIN] = SDLK_RSUPER;
- keymap[SCANCODE_LEFTWIN] = SDLK_LSUPER;
- keymap[127] = SDLK_MENU;
-}
-
-
-
-static SDL_keysym *GGI_TranslateKey(gii_event *ev, SDL_keysym *keysym)
-{
- /* Set the keysym information */
- keysym->scancode = ev->key.button;
- keysym->sym = keymap[ev->key.button];
- keysym->mod = KMOD_NONE;
-
- /* If UNICODE is on, get the UNICODE value for the key */
- keysym->unicode = 0;
- if (SDL_TranslateUNICODE)
- {
- keysym->unicode = GII_UNICODE(ev->key.sym);
- }
-
- return keysym;
-}
diff --git a/distrib/sdl-1.2.12/src/video/ggi/SDL_ggievents_c.h b/distrib/sdl-1.2.12/src/video/ggi/SDL_ggievents_c.h
deleted file mode 100755
index 114b692..0000000
--- a/distrib/sdl-1.2.12/src/video/ggi/SDL_ggievents_c.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_ggivideo.h"
-
-/* Functions to be exported */
-extern void GGI_InitOSKeymap(_THIS);
-extern void GGI_PumpEvents(_THIS);
-
diff --git a/distrib/sdl-1.2.12/src/video/ggi/SDL_ggimouse.c b/distrib/sdl-1.2.12/src/video/ggi/SDL_ggimouse.c
deleted file mode 100644
index f9f1a04..0000000
--- a/distrib/sdl-1.2.12/src/video/ggi/SDL_ggimouse.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_mouse.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_ggimouse_c.h"
-
-
-/* The implementation dependent data for the window manager cursor */
-struct WMcursor {
- int unused;
-};
diff --git a/distrib/sdl-1.2.12/src/video/ggi/SDL_ggimouse_c.h b/distrib/sdl-1.2.12/src/video/ggi/SDL_ggimouse_c.h
deleted file mode 100755
index a679d05..0000000
--- a/distrib/sdl-1.2.12/src/video/ggi/SDL_ggimouse_c.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_ggivideo.h"
-
-/* Functions to be exported */
diff --git a/distrib/sdl-1.2.12/src/video/ggi/SDL_ggivideo.c b/distrib/sdl-1.2.12/src/video/ggi/SDL_ggivideo.c
deleted file mode 100644
index a55154a..0000000
--- a/distrib/sdl-1.2.12/src/video/ggi/SDL_ggivideo.c
+++ /dev/null
@@ -1,378 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* GGI-based SDL video driver implementation.
-*/
-
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/mman.h>
-
-#include <ggi/ggi.h>
-#include <ggi/gii.h>
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_ggivideo.h"
-#include "SDL_ggimouse_c.h"
-#include "SDL_ggievents_c.h"
-
-
-struct private_hwdata
-{
- ggi_visual_t vis;
-};
-
-ggi_visual_t VIS;
-
-/* Initialization/Query functions */
-static int GGI_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **GGI_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *GGI_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int GGI_SetColors(_THIS, int firstcolor, int ncolors,
- SDL_Color *colors);
-static void GGI_VideoQuit(_THIS);
-
-/* Hardware surface functions */
-static int GGI_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int GGI_LockHWSurface(_THIS, SDL_Surface *surface);
-static void GGI_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static void GGI_FreeHWSurface(_THIS, SDL_Surface *surface);
-
-/* GGI driver bootstrap functions */
-
-static int GGI_Available(void)
-{
- ggi_visual_t *vis;
-
- vis = NULL;
- if (ggiInit() == 0) {
- vis = ggiOpen(NULL);
- if (vis != NULL) {
- ggiClose(vis);
- }
- }
- return (vis != NULL);
-}
-
-static void GGI_DeleteDevice(SDL_VideoDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_VideoDevice *GGI_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device ) {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *device->hidden));
- }
- if ( (device == NULL) || (device->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( device ) {
- SDL_free(device);
- }
- return(0);
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
-
- /* Set the function pointers */
- device->VideoInit = GGI_VideoInit;
- device->ListModes = GGI_ListModes;
- device->SetVideoMode = GGI_SetVideoMode;
- device->SetColors = GGI_SetColors;
- device->UpdateRects = NULL;
- device->VideoQuit = GGI_VideoQuit;
- device->AllocHWSurface = GGI_AllocHWSurface;
- device->CheckHWBlit = NULL;
- device->FillHWRect = NULL;
- device->SetHWColorKey = NULL;
- device->SetHWAlpha = NULL;
- device->LockHWSurface = GGI_LockHWSurface;
- device->UnlockHWSurface = GGI_UnlockHWSurface;
- device->FlipHWSurface = NULL;
- device->FreeHWSurface = GGI_FreeHWSurface;
- device->SetCaption = NULL;
- device->SetIcon = NULL;
- device->IconifyWindow = NULL;
- device->GrabInput = NULL;
- device->GetWMInfo = NULL;
- device->InitOSKeymap = GGI_InitOSKeymap;
- device->PumpEvents = GGI_PumpEvents;
-
- device->free = GGI_DeleteDevice;
-
- return device;
-}
-
-VideoBootStrap GGI_bootstrap = {
- "ggi", "General Graphics Interface (GGI)",
- GGI_Available, GGI_CreateDevice
-};
-
-
-static SDL_Rect video_mode;
-static SDL_Rect *SDL_modelist[4] = { NULL, NULL, NULL, NULL };
-
-int GGI_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- ggi_mode mode =
- {
- 1,
- { GGI_AUTO, GGI_AUTO },
- { GGI_AUTO, GGI_AUTO },
- { 0, 0 },
- GT_AUTO,
- { GGI_AUTO, GGI_AUTO }
- };
- struct private_hwdata *priv;
- ggi_color pal[256], map[256];
- const ggi_directbuffer *db;
- int err, num_bufs;
- ggi_pixel white, black;
-
- priv = SDL_malloc(sizeof(struct private_hwdata));
- if (priv == NULL)
- {
- SDL_SetError("Unhandled GGI mode type!\n");
- GGI_VideoQuit(NULL);
- }
-
- if (ggiInit() != 0)
- {
- SDL_SetError("Unable to initialize GGI!\n");
- GGI_VideoQuit(NULL);
- }
-
- VIS = ggiOpen(NULL);
- if (VIS == NULL)
- {
- SDL_SetError("Unable to open default GGI visual!\n");
- ggiExit();
- GGI_VideoQuit(NULL);
- }
-
- ggiSetFlags(VIS, GGIFLAG_ASYNC);
-
- /* Validate mode, autodetecting any GGI_AUTO or GT_AUTO fields */
- ggiCheckMode(VIS, &mode);
-
- /* At this point we should have a valid mode - try to set it */
- err = ggiSetMode(VIS, &mode);
-
- /* If we couldn't set _any_ modes, something is very wrong */
- if (err)
- {
- SDL_SetError("Can't set a mode!\n");
- ggiClose(VIS);
- ggiExit();
- GGI_VideoQuit(NULL);
- }
-
- /* Determine the current screen size */
- this->info.current_w = mode.virt.x;
- this->info.current_h = mode.virt.y;
-
- /* Set a palette for palletized modes */
- if (GT_SCHEME(mode.graphtype) == GT_PALETTE)
- {
- ggiSetColorfulPalette(VIS);
- ggiGetPalette(VIS, 0, 1 << vformat->BitsPerPixel, pal);
- }
-
- /* Now we try to get the DirectBuffer info, which determines whether
- * SDL can access hardware surfaces directly. */
-
- num_bufs = ggiDBGetNumBuffers(VIS);
-
- if (num_bufs > 0)
- {
- db = ggiDBGetBuffer(VIS, 0); /* Only handle one DB for now */
-
- vformat->BitsPerPixel = db->buffer.plb.pixelformat->depth;
-
- vformat->Rmask = db->buffer.plb.pixelformat->red_mask;
- vformat->Gmask = db->buffer.plb.pixelformat->green_mask;
- vformat->Bmask = db->buffer.plb.pixelformat->blue_mask;
-
- /* Fill in our hardware acceleration capabilities */
-
- this->info.wm_available = 0;
- this->info.hw_available = 1;
- this->info.video_mem = db->buffer.plb.stride * mode.virt.y;
- }
-
- video_mode.x = 0;
- video_mode.y = 0;
- video_mode.w = mode.virt.x;
- video_mode.h = mode.virt.y;
- SDL_modelist[((vformat->BitsPerPixel + 7) / 8) - 1] = &video_mode;
-
- /* We're done! */
- return(0);
-}
-
-static SDL_Rect **GGI_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- return(&SDL_modelist[((format->BitsPerPixel + 7) / 8) - 1]);
-}
-
-/* Various screen update functions available */
-static void GGI_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
-
-SDL_Surface *GGI_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags)
-{
- ggi_mode mode =
- {
- 1,
- { GGI_AUTO, GGI_AUTO },
- { GGI_AUTO, GGI_AUTO },
- { 0, 0 },
- GT_AUTO,
- { GGI_AUTO, GGI_AUTO }
- };
- const ggi_directbuffer *db;
- ggi_color pal[256];
- int err;
-
- fprintf(stderr, "GGI_SetVideoMode()\n");
-
- mode.visible.x = mode.virt.x = width;
- mode.visible.y = mode.virt.y = height;
-
- /* Translate requested SDL bit depth into a GGI mode */
- switch (bpp)
- {
- case 1: mode.graphtype = GT_1BIT; break;
- case 2: mode.graphtype = GT_2BIT; break;
- case 4: mode.graphtype = GT_4BIT; break;
- case 8: mode.graphtype = GT_8BIT; break;
- case 15: mode.graphtype = GT_15BIT; break;
- case 16: mode.graphtype = GT_16BIT; break;
- case 24: mode.graphtype = GT_24BIT; break;
- case 32: mode.graphtype = GT_32BIT; break;
- default:
- SDL_SetError("Unknown SDL bit depth, using GT_AUTO....\n");
- mode.graphtype = GT_AUTO;
- }
-
- /* Validate mode, autodetecting any GGI_AUTO or GT_AUTO fields */
- ggiCheckMode(VIS, &mode);
-
- /* At this point we should have a valid mode - try to set it */
- err = ggiSetMode(VIS, &mode);
-
- /* If we couldn't set _any_ modes, something is very wrong */
- if (err)
- {
- SDL_SetError("Can't set a mode!\n");
- ggiClose(VIS);
- ggiExit();
- GGI_VideoQuit(NULL);
- }
-
- /* Set a palette for palletized modes */
- if (GT_SCHEME(mode.graphtype) == GT_PALETTE)
- {
- ggiSetColorfulPalette(VIS);
- ggiGetPalette(VIS, 0, 1 << bpp, pal);
- }
-
- db = ggiDBGetBuffer(VIS, 0);
-
- /* Set up the new mode framebuffer */
- current->flags = (SDL_FULLSCREEN | SDL_HWSURFACE);
- current->w = mode.virt.x;
- current->h = mode.virt.y;
- current->pitch = db->buffer.plb.stride;
- current->pixels = db->read;
-
- /* Set the blit function */
- this->UpdateRects = GGI_DirectUpdate;
-
- /* We're done */
- return(current);
-}
-
-static int GGI_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- return(-1);
-}
-static void GGI_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-static int GGI_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- return(0);
-}
-static void GGI_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-static void GGI_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- int i;
-
-/* ggiFlush(VIS); */
-
- for (i = 0; i < numrects; i++)
- {
- ggiFlushRegion(VIS, rects[i].x, rects[i].y, rects[i].w, rects[i].h);
- }
- return;
-}
-
-int GGI_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- int i;
- ggi_color pal[256];
-
- /* Set up the colormap */
- for (i = 0; i < ncolors; i++)
- {
- pal[i].r = (colors[i].r << 8) | colors[i].r;
- pal[i].g = (colors[i].g << 8) | colors[i].g;
- pal[i].b = (colors[i].b << 8) | colors[i].b;
- }
-
- ggiSetPalette(VIS, firstcolor, ncolors, pal);
-
- return 1;
-}
-
-void GGI_VideoQuit(_THIS)
-{
-}
-void GGI_FinalQuit(void)
-{
-}
diff --git a/distrib/sdl-1.2.12/src/video/ggi/SDL_ggivideo.h b/distrib/sdl-1.2.12/src/video/ggi/SDL_ggivideo.h
deleted file mode 100644
index 9d68704..0000000
--- a/distrib/sdl-1.2.12/src/video/ggi/SDL_ggivideo.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_ggivideo_h
-#define _SDL_ggivideo_h
-
-#include <ggi/ggi.h>
-
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-
-#define _THIS SDL_VideoDevice *this
-
-/* Private display data */
-
-struct SDL_PrivateVideoData
-{
- ggi_visual_t *ggivis;
-};
-
-extern ggi_visual_t VIS; /* FIXME: use the private data struct */
-
-extern int SDL_OpenKeyboard(void);
-extern void SDL_CloseKeyboard(void);
-extern int SDL_OpenMouse(void);
-extern void SDL_CloseMouse(void);
-
-#endif /* _SDL_ggivideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/ipod/SDL_ipodvideo.c b/distrib/sdl-1.2.12/src/video/ipod/SDL_ipodvideo.c
deleted file mode 100644
index cac4766..0000000
--- a/distrib/sdl-1.2.12/src/video/ipod/SDL_ipodvideo.c
+++ /dev/null
@@ -1,733 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <sys/types.h>
-#include <sys/ioctl.h>
-
-#include <unistd.h>
-#include <fcntl.h>
-#include <string.h>
-#include <termios.h>
-#include <ctype.h>
-
-#include <linux/vt.h>
-#include <linux/kd.h>
-#include <linux/keyboard.h>
-#include <linux/fb.h>
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_sysevents.h"
-#include "SDL_ipodvideo.h"
-
-#define _THIS SDL_VideoDevice *this
-
-static int iPod_VideoInit (_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **iPod_ListModes (_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *iPod_SetVideoMode (_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int iPod_SetColors (_THIS, int firstcolor, int ncolors, SDL_Color *colors);
-static void iPod_UpdateRects (_THIS, int nrects, SDL_Rect *rects);
-static void iPod_VideoQuit (_THIS);
-static void iPod_PumpEvents (_THIS);
-
-static long iPod_GetGeneration();
-
-static int initd = 0;
-static int kbfd = -1;
-static int fbfd = -1;
-static int oldvt = -1;
-static int curvt = -1;
-static int old_kbmode = -1;
-static long generation = 0;
-static struct termios old_termios, cur_termios;
-
-FILE *dbgout;
-
-#define LCD_DATA 0x10
-#define LCD_CMD 0x08
-#define IPOD_OLD_LCD_BASE 0xc0001000
-#define IPOD_OLD_LCD_RTC 0xcf001110
-#define IPOD_NEW_LCD_BASE 0x70003000
-#define IPOD_NEW_LCD_RTC 0x60005010
-
-static unsigned long lcd_base, lcd_rtc, lcd_width, lcd_height;
-
-static long iPod_GetGeneration()
-{
- int i;
- char cpuinfo[256];
- char *ptr;
- FILE *file;
-
- if ((file = fopen("/proc/cpuinfo", "r")) != NULL) {
- while (fgets(cpuinfo, sizeof(cpuinfo), file) != NULL)
- if (SDL_strncmp(cpuinfo, "Revision", 8) == 0)
- break;
- fclose(file);
- }
- for (i = 0; !isspace(cpuinfo[i]); i++);
- for (; isspace(cpuinfo[i]); i++);
- ptr = cpuinfo + i + 2;
-
- return SDL_strtol(ptr, NULL, 10);
-}
-
-static int iPod_Available()
-{
- return 1;
-}
-
-static void iPod_DeleteDevice (SDL_VideoDevice *device)
-{
- free (device->hidden);
- free (device);
-}
-
-void iPod_InitOSKeymap (_THIS) {}
-
-static SDL_VideoDevice *iPod_CreateDevice (int devindex)
-{
- SDL_VideoDevice *this;
-
- this = (SDL_VideoDevice *)SDL_malloc (sizeof(SDL_VideoDevice));
- if (this) {
- memset (this, 0, sizeof *this);
- this->hidden = (struct SDL_PrivateVideoData *) SDL_malloc (sizeof(struct SDL_PrivateVideoData));
- }
- if (!this || !this->hidden) {
- SDL_OutOfMemory();
- if (this)
- SDL_free (this);
- return 0;
- }
- memset (this->hidden, 0, sizeof(struct SDL_PrivateVideoData));
-
- generation = iPod_GetGeneration();
-
- this->VideoInit = iPod_VideoInit;
- this->ListModes = iPod_ListModes;
- this->SetVideoMode = iPod_SetVideoMode;
- this->SetColors = iPod_SetColors;
- this->UpdateRects = iPod_UpdateRects;
- this->VideoQuit = iPod_VideoQuit;
- this->AllocHWSurface = 0;
- this->CheckHWBlit = 0;
- this->FillHWRect = 0;
- this->SetHWColorKey = 0;
- this->SetHWAlpha = 0;
- this->LockHWSurface = 0;
- this->UnlockHWSurface = 0;
- this->FlipHWSurface = 0;
- this->FreeHWSurface = 0;
- this->SetCaption = 0;
- this->SetIcon = 0;
- this->IconifyWindow = 0;
- this->GrabInput = 0;
- this->GetWMInfo = 0;
- this->InitOSKeymap = iPod_InitOSKeymap;
- this->PumpEvents = iPod_PumpEvents;
- this->free = iPod_DeleteDevice;
-
- return this;
-}
-
-VideoBootStrap iPod_bootstrap = {
- "ipod", "iPod Framebuffer Driver",
- iPod_Available, iPod_CreateDevice
-};
-
-//--//
-
-static int iPod_VideoInit (_THIS, SDL_PixelFormat *vformat)
-{
- if (!initd) {
- /*** Code adapted/copied from SDL fbcon driver. ***/
-
- static const char * const tty0[] = { "/dev/tty0", "/dev/vc/0", 0 };
- static const char * const vcs[] = { "/dev/vc/%d", "/dev/tty%d", 0 };
- int i, tty0_fd;
-
- dbgout = fdopen (open ("/etc/sdlpod.log", O_WRONLY | O_SYNC | O_APPEND), "a");
- if (dbgout) {
- setbuf (dbgout, 0);
- fprintf (dbgout, "--> Started SDL <--\n");
- }
-
- // Try to query for a free VT
- tty0_fd = -1;
- for ( i=0; tty0[i] && (tty0_fd < 0); ++i ) {
- tty0_fd = open(tty0[i], O_WRONLY, 0);
- }
- if ( tty0_fd < 0 ) {
- tty0_fd = dup(0); /* Maybe stdin is a VT? */
- }
- ioctl(tty0_fd, VT_OPENQRY, &curvt);
- close(tty0_fd);
-
- tty0_fd = open("/dev/tty", O_RDWR, 0);
- if ( tty0_fd >= 0 ) {
- ioctl(tty0_fd, TIOCNOTTY, 0);
- close(tty0_fd);
- }
-
- if ( (geteuid() == 0) && (curvt > 0) ) {
- for ( i=0; vcs[i] && (kbfd < 0); ++i ) {
- char vtpath[12];
-
- SDL_snprintf(vtpath, SDL_arraysize(vtpath), vcs[i], curvt);
- kbfd = open(vtpath, O_RDWR);
- }
- }
- if ( kbfd < 0 ) {
- if (dbgout) fprintf (dbgout, "Couldn't open any VC\n");
- return -1;
- }
- if (dbgout) fprintf (stderr, "Current VT: %d\n", curvt);
-
- if (kbfd >= 0) {
- /* Switch to the correct virtual terminal */
- if ( curvt > 0 ) {
- struct vt_stat vtstate;
-
- if ( ioctl(kbfd, VT_GETSTATE, &vtstate) == 0 ) {
- oldvt = vtstate.v_active;
- }
- if ( ioctl(kbfd, VT_ACTIVATE, curvt) == 0 ) {
- if (dbgout) fprintf (dbgout, "Waiting for switch to this VT... ");
- ioctl(kbfd, VT_WAITACTIVE, curvt);
- if (dbgout) fprintf (dbgout, "done!\n");
- }
- }
-
- // Set terminal input mode
- if (tcgetattr (kbfd, &old_termios) < 0) {
- if (dbgout) fprintf (dbgout, "Can't get termios\n");
- return -1;
- }
- cur_termios = old_termios;
- // cur_termios.c_iflag &= ~(ICRNL | INPCK | ISTRIP | IXON);
- // cur_termios.c_iflag |= (BRKINT);
- // cur_termios.c_lflag &= ~(ICANON | ECHO | ISIG | IEXTEN);
- // cur_termios.c_oflag &= ~(OPOST);
- // cur_termios.c_oflag |= (ONOCR | ONLRET);
- cur_termios.c_lflag &= ~(ICANON | ECHO | ISIG);
- cur_termios.c_iflag &= ~(ISTRIP | IGNCR | ICRNL | INLCR | IXOFF | IXON);
- cur_termios.c_cc[VMIN] = 0;
- cur_termios.c_cc[VTIME] = 0;
-
- if (tcsetattr (kbfd, TCSAFLUSH, &cur_termios) < 0) {
- if (dbgout) fprintf (dbgout, "Can't set termios\n");
- return -1;
- }
- if (ioctl (kbfd, KDSKBMODE, K_MEDIUMRAW) < 0) {
- if (dbgout) fprintf (dbgout, "Can't set medium-raw mode\n");
- return -1;
- }
- if (ioctl (kbfd, KDSETMODE, KD_GRAPHICS) < 0) {
- if (dbgout) fprintf (dbgout, "Can't set graphics\n");
- return -1;
- }
- }
-
- // Open the framebuffer
- if ((fbfd = open ("/dev/fb0", O_RDWR)) < 0) {
- if (dbgout) fprintf (dbgout, "Can't open framebuffer\n");
- return -1;
- } else {
- struct fb_var_screeninfo vinfo;
-
- if (dbgout) fprintf (dbgout, "Generation: %ld\n", generation);
-
- if (generation >= 40000) {
- lcd_base = IPOD_NEW_LCD_BASE;
- } else {
- lcd_base = IPOD_OLD_LCD_BASE;
- }
-
- ioctl (fbfd, FBIOGET_VSCREENINFO, &vinfo);
- close (fbfd);
-
- if (lcd_base == IPOD_OLD_LCD_BASE)
- lcd_rtc = IPOD_OLD_LCD_RTC;
- else if (lcd_base == IPOD_NEW_LCD_BASE)
- lcd_rtc = IPOD_NEW_LCD_RTC;
- else {
- SDL_SetError ("Unknown iPod version");
- return -1;
- }
-
- lcd_width = vinfo.xres;
- lcd_height = vinfo.yres;
-
- if (dbgout) fprintf (dbgout, "LCD is %dx%d\n", lcd_width, lcd_height);
- }
-
- fcntl (kbfd, F_SETFL, O_RDWR | O_NONBLOCK);
-
- /* Determine the current screen size */
- this->info.current_w = lcd_width;
- this->info.current_h = lcd_height;
-
- if ((generation >= 60000) && (generation < 70000)) {
- vformat->BitsPerPixel = 16;
- vformat->Rmask = 0xF800;
- vformat->Gmask = 0x07E0;
- vformat->Bmask = 0x001F;
- } else {
- vformat->BitsPerPixel = 8;
- vformat->Rmask = vformat->Gmask = vformat->Bmask = 0;
- }
-
- initd = 1;
- if (dbgout) fprintf (dbgout, "Initialized.\n\n");
- }
- return 0;
-}
-
-static SDL_Rect **iPod_ListModes (_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- int width, height, fd;
- static SDL_Rect r;
- static SDL_Rect *rs[2] = { &r, 0 };
-
- if ((fd = open ("/dev/fb0", O_RDWR)) < 0) {
- return 0;
- } else {
- struct fb_var_screeninfo vinfo;
-
- ioctl (fbfd, FBIOGET_VSCREENINFO, &vinfo);
- close (fbfd);
-
- width = vinfo.xres;
- height = vinfo.yres;
- }
- r.x = r.y = 0;
- r.w = width;
- r.h = height;
- return rs;
-}
-
-
-static SDL_Surface *iPod_SetVideoMode (_THIS, SDL_Surface *current, int width, int height, int bpp,
- Uint32 flags)
-{
- Uint32 Rmask, Gmask, Bmask;
- if (bpp > 8) {
- Rmask = 0xF800;
- Gmask = 0x07E0;
- Bmask = 0x001F;
- } else {
- Rmask = Gmask = Bmask = 0;
- }
-
- if (this->hidden->buffer) SDL_free (this->hidden->buffer);
- this->hidden->buffer = SDL_malloc (width * height * (bpp / 8));
- if (!this->hidden->buffer) {
- SDL_SetError ("Couldn't allocate buffer for requested mode");
- return 0;
- }
-
- memset (this->hidden->buffer, 0, width * height * (bpp / 8));
-
- if (!SDL_ReallocFormat (current, bpp, Rmask, Gmask, Bmask, 0)) {
- SDL_SetError ("Couldn't allocate new pixel format");
- SDL_free (this->hidden->buffer);
- this->hidden->buffer = 0;
- return 0;
- }
-
- if (bpp <= 8) {
- int i, j;
- for (i = 0; i < 256; i += 4) {
- for (j = 0; j < 4; j++) {
- current->format->palette->colors[i+j].r = 85 * j;
- current->format->palette->colors[i+j].g = 85 * j;
- current->format->palette->colors[i+j].b = 85 * j;
- }
- }
- }
-
- current->flags = flags & SDL_FULLSCREEN;
- this->hidden->w = current->w = width;
- this->hidden->h = current->h = height;
- current->pitch = current->w * (bpp / 8);
- current->pixels = this->hidden->buffer;
-
- return current;
-}
-
-static int iPod_SetColors (_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- if (SDL_VideoSurface && SDL_VideoSurface->format && SDL_VideoSurface->format->palette) {
- int i, j;
- for (i = 0; i < 256; i += 4) {
- for (j = 0; j < 4; j++) {
- SDL_VideoSurface->format->palette->colors[i+j].r = 85 * j;
- SDL_VideoSurface->format->palette->colors[i+j].g = 85 * j;
- SDL_VideoSurface->format->palette->colors[i+j].b = 85 * j;
- }
- }
- }
- return 0;
-}
-
-static void iPod_VideoQuit (_THIS)
-{
- ioctl (kbfd, KDSETMODE, KD_TEXT);
- tcsetattr (kbfd, TCSAFLUSH, &old_termios);
- old_kbmode = -1;
-
- if (oldvt > 0)
- ioctl (kbfd, VT_ACTIVATE, oldvt);
-
- if (kbfd > 0)
- close (kbfd);
-
- if (dbgout) {
- fprintf (dbgout, "<-- Ended SDL -->\n");
- fclose (dbgout);
- }
-
- kbfd = -1;
-}
-
-static char iPod_SC_keymap[] = {
- 0, /* 0 - no key */
- '[' - 0x40, /* ESC (Ctrl+[) */
- '1', '2', '3', '4', '5', '6', '7', '8', '9',
- '-', '=',
- '\b', '\t', /* Backspace, Tab (Ctrl+H,Ctrl+I) */
- 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']',
- '\n', 0, /* Enter, Left CTRL */
- 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '`',
- 0, '\\', /* left shift, backslash */
- 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/',
- 0, '*', 0, ' ', 0, /* right shift, KP mul, left alt, space, capslock */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* F1-10 */
- 0, 0, /* numlock, scrollock */
- '7', '8', '9', '-', '4', '5', '6', '+', '1', '2', '3', '0', '.', /* numeric keypad */
- 0, 0, /* padding */
- 0, 0, 0, /* "less" (?), F11, F12 */
- 0, 0, 0, 0, 0, 0, 0, /* padding */
- '\n', 0, '/', 0, 0, /* KP enter, Rctrl, Ctrl, KP div, PrtSc, RAlt */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, /* Break, Home, Up, PgUp, Left, Right, End, Down, PgDn */
- 0, 0, /* Ins, Del */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* padding */
- 0, 0, /* RWin, LWin */
- 0 /* no key */
-};
-
-
-static void iPod_keyboard()
-{
- unsigned char keybuf[128];
- int i, nread;
- SDL_keysym keysym;
- SDL_Event ev;
-
- keysym.mod = 0;
- keysym.scancode = 0xff;
- memset (&ev, 0, sizeof(SDL_Event));
-
- nread = read (kbfd, keybuf, 128);
- for (i = 0; i < nread; i++) {
- char ascii = iPod_SC_keymap[keybuf[i] & 0x7f];
-
- if (dbgout) fprintf (dbgout, "Key! %02x is %c %s", keybuf[i], ascii, (keybuf[i] & 0x80)? "up" : "down");
-
- keysym.sym = keysym.unicode = ascii;
- ev.type = (keybuf[i] & 0x80)? SDL_KEYUP : SDL_KEYDOWN;
- ev.key.state = 0;
- ev.key.keysym = keysym;
- SDL_PushEvent (&ev);
- }
-}
-
-static void iPod_PumpEvents (_THIS)
-{
- fd_set fdset;
- int max_fd = 0;
- static struct timeval zero;
- int posted;
-
- do {
- posted = 0;
-
- FD_ZERO (&fdset);
- if (kbfd >= 0) {
- FD_SET (kbfd, &fdset);
- max_fd = kbfd;
- }
- if (dbgout) fprintf (dbgout, "Selecting");
- if (select (max_fd + 1, &fdset, 0, 0, &zero) > 0) {
- if (dbgout) fprintf (dbgout, " -> match!\n");
- iPod_keyboard();
- posted++;
- }
- if (dbgout) fprintf (dbgout, "\n");
- } while (posted);
-}
-
-// enough space for 160x128x2
-static char ipod_scr[160 * (128/4)];
-
-#define outl(datum,addr) (*(volatile unsigned long *)(addr) = (datum))
-#define inl(addr) (*(volatile unsigned long *)(addr))
-
-/*** The following LCD code is taken from Linux kernel uclinux-2.4.24-uc0-ipod2,
- file arch/armnommu/mach-ipod/fb.c. A few modifications have been made. ***/
-
-/* get current usec counter */
-static int M_timer_get_current(void)
-{
- return inl(lcd_rtc);
-}
-
-/* check if number of useconds has past */
-static int M_timer_check(int clock_start, int usecs)
-{
- unsigned long clock;
- clock = inl(lcd_rtc);
-
- if ( (clock - clock_start) >= usecs ) {
- return 1;
- } else {
- return 0;
- }
-}
-
-/* wait for LCD with timeout */
-static void M_lcd_wait_write(void)
-{
- if ( (inl(lcd_base) & 0x8000) != 0 ) {
- int start = M_timer_get_current();
-
- do {
- if ( (inl(lcd_base) & (unsigned int)0x8000) == 0 )
- break;
- } while ( M_timer_check(start, 1000) == 0 );
- }
-}
-
-
-/* send LCD data */
-static void M_lcd_send_data(int data_lo, int data_hi)
-{
- M_lcd_wait_write();
-
- outl(data_lo, lcd_base + LCD_DATA);
-
- M_lcd_wait_write();
-
- outl(data_hi, lcd_base + LCD_DATA);
-
-}
-
-/* send LCD command */
-static void
-M_lcd_prepare_cmd(int cmd)
-{
- M_lcd_wait_write();
-
- outl(0x0, lcd_base + LCD_CMD);
-
- M_lcd_wait_write();
-
- outl(cmd, lcd_base + LCD_CMD);
-
-}
-
-/* send LCD command and data */
-static void M_lcd_cmd_and_data(int cmd, int data_lo, int data_hi)
-{
- M_lcd_prepare_cmd(cmd);
-
- M_lcd_send_data(data_lo, data_hi);
-}
-
-// Copied from uW
-static void M_update_display(int sx, int sy, int mx, int my)
-{
- int y;
- unsigned short cursor_pos;
-
- sx >>= 3;
- mx >>= 3;
-
- cursor_pos = sx + (sy << 5);
-
- for ( y = sy; y <= my; y++ ) {
- unsigned char *img_data;
- int x;
-
- /* move the cursor */
- M_lcd_cmd_and_data(0x11, cursor_pos >> 8, cursor_pos & 0xff);
-
- /* setup for printing */
- M_lcd_prepare_cmd(0x12);
-
- img_data = ipod_scr + (sx << 1) + (y * (lcd_width/4));
-
- /* loops up to 160 times */
- for ( x = sx; x <= mx; x++ ) {
- /* display eight pixels */
- M_lcd_send_data(*(img_data + 1), *img_data);
-
- img_data += 2;
- }
-
- /* update cursor pos counter */
- cursor_pos += 0x20;
- }
-}
-
-/* get current usec counter */
-static int C_timer_get_current(void)
-{
- return inl(0x60005010);
-}
-
-/* check if number of useconds has past */
-static int C_timer_check(int clock_start, int usecs)
-{
- unsigned long clock;
- clock = inl(0x60005010);
-
- if ( (clock - clock_start) >= usecs ) {
- return 1;
- } else {
- return 0;
- }
-}
-
-/* wait for LCD with timeout */
-static void C_lcd_wait_write(void)
-{
- if ((inl(0x70008A0C) & 0x80000000) != 0) {
- int start = C_timer_get_current();
-
- do {
- if ((inl(0x70008A0C) & 0x80000000) == 0)
- break;
- } while (C_timer_check(start, 1000) == 0);
- }
-}
-static void C_lcd_cmd_data(int cmd, int data)
-{
- C_lcd_wait_write();
- outl(cmd | 0x80000000, 0x70008A0C);
-
- C_lcd_wait_write();
- outl(data | 0x80000000, 0x70008A0C);
-}
-
-static void C_update_display(int sx, int sy, int mx, int my)
-{
- int height = (my - sy) + 1;
- int width = (mx - sx) + 1;
-
- char *addr = SDL_VideoSurface->pixels;
-
- if (width & 1) width++;
-
- /* start X and Y */
- C_lcd_cmd_data(0x12, (sy & 0xff));
- C_lcd_cmd_data(0x13, (((SDL_VideoSurface->w - 1) - sx) & 0xff));
-
- /* max X and Y */
- C_lcd_cmd_data(0x15, (((sy + height) - 1) & 0xff));
- C_lcd_cmd_data(0x16, (((((SDL_VideoSurface->w - 1) - sx) - width) + 1) & 0xff));
-
- addr += sx + sy * SDL_VideoSurface->pitch;
-
- while (height > 0) {
- int h, x, y, pixels_to_write;
-
- pixels_to_write = (width * height) * 2;
-
- /* calculate how much we can do in one go */
- h = height;
- if (pixels_to_write > 64000) {
- h = (64000/2) / width;
- pixels_to_write = (width * h) * 2;
- }
-
- outl(0x10000080, 0x70008A20);
- outl((pixels_to_write - 1) | 0xC0010000, 0x70008A24);
- outl(0x34000000, 0x70008A20);
-
- /* for each row */
- for (x = 0; x < h; x++)
- {
- /* for each column */
- for (y = 0; y < width; y += 2) {
- unsigned two_pixels;
-
- two_pixels = addr[0] | (addr[1] << 16);
- addr += 2;
-
- while ((inl(0x70008A20) & 0x1000000) == 0);
-
- /* output 2 pixels */
- outl(two_pixels, 0x70008B00);
- }
-
- addr += SDL_VideoSurface->w - width;
- }
-
- while ((inl(0x70008A20) & 0x4000000) == 0);
-
- outl(0x0, 0x70008A24);
-
- height = height - h;
- }
-}
-
-// Should work with photo. However, I don't have one, so I'm not sure.
-static void iPod_UpdateRects (_THIS, int nrects, SDL_Rect *rects)
-{
- if (SDL_VideoSurface->format->BitsPerPixel == 16) {
- C_update_display (0, 0, lcd_width, lcd_height);
- } else {
- int i, y, x;
- for (i = 0; i < nrects; i++) {
- SDL_Rect *r = rects + i;
- if (!r) {
- continue;
- }
-
- for (y = r->y; (y < r->y + r->h) && y < lcd_height; y++) {
- for (x = r->x; (x < r->x + r->w) && x < lcd_width; x++) {
- ipod_scr[y*(lcd_width/4) + x/4] &= ~(3 << (2 * (x%4)));
- ipod_scr[y*(lcd_width/4) + x/4] |=
- (((Uint8*)(SDL_VideoSurface->pixels))[ y*SDL_VideoSurface->pitch + x ] & 3) << (2 * (x%4));
- }
- }
- }
-
- M_update_display (0, 0, lcd_width, lcd_height);
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/ipod/SDL_ipodvideo.h b/distrib/sdl-1.2.12/src/video/ipod/SDL_ipodvideo.h
deleted file mode 100644
index a704f41..0000000
--- a/distrib/sdl-1.2.12/src/video/ipod/SDL_ipodvideo.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* iPod SDL framebuffer driver
- * Joshua Oreman
- * Main header file
- */
-
-#ifndef _SDL_ipodvideo_h
-#define _SDL_ipodvideo_h
-
-struct SDL_PrivateVideoData {
- char *buffer;
- int w, h;
-};
-
-
-#endif
diff --git a/distrib/sdl-1.2.12/src/video/maccommon/SDL_lowvideo.h b/distrib/sdl-1.2.12/src/video/maccommon/SDL_lowvideo.h
deleted file mode 100644
index 1f7316c..0000000
--- a/distrib/sdl-1.2.12/src/video/maccommon/SDL_lowvideo.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_lowvideo_h
-#define _SDL_lowvideo_h
-
-#if defined(__APPLE__) && defined(__MACH__)
-#include <Carbon/Carbon.h>
-#elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335)
-#include <Carbon.h>
-#else
-#include <Quickdraw.h>
-#include <Palettes.h>
-#include <Menus.h>
-#include <DrawSprocket.h>
-#endif
-
-#if SDL_VIDEO_OPENGL
-typedef struct __AGLContextRec *AGLContext;
-#endif
-
-#include "SDL_video.h"
-#include "../SDL_sysvideo.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-#if !TARGET_API_MAC_CARBON /* not available in OS X (or more accurately, Carbon) */
-/* Global QuickDraw data */
-extern QDGlobals *theQD;
-#endif
-
-/* Private display data */
-struct SDL_PrivateVideoData {
- GDevice **SDL_Display;
- WindowRef SDL_Window;
- SDL_Rect **SDL_modelist;
- CTabHandle SDL_CTab;
- PaletteHandle SDL_CPal;
-
-#if TARGET_API_MAC_CARBON
- /* For entering and leaving fullscreen mode */
- Ptr fullscreen_ctx;
-#endif
-
- /* The current window document style */
- int current_style;
-
- /* Information about the last cursor position */
- Point last_where;
-
- /* Information about the last keys down */
- EventModifiers last_mods;
- KeyMap last_keys;
-
- /* A handle to the Apple Menu */
- MenuRef apple_menu;
-
- /* Information used by DrawSprocket driver */
- struct DSpInfo *dspinfo;
-
-#if SDL_VIDEO_OPENGL
- AGLContext appleGLContext;
-
- void *libraryHandle;
-#endif
-};
-/* Old variable names */
-#define SDL_Display (this->hidden->SDL_Display)
-#define SDL_Window (this->hidden->SDL_Window)
-#define SDL_modelist (this->hidden->SDL_modelist)
-#define SDL_CTab (this->hidden->SDL_CTab)
-#define SDL_CPal (this->hidden->SDL_CPal)
-#define fullscreen_ctx (this->hidden->fullscreen_ctx)
-#define current_style (this->hidden->current_style)
-#define last_where (this->hidden->last_where)
-#define last_mods (this->hidden->last_mods)
-#define last_keys (this->hidden->last_keys)
-#define apple_menu (this->hidden->apple_menu)
-#define glContext (this->hidden->appleGLContext)
-
-#endif /* _SDL_lowvideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/maccommon/SDL_macevents.c b/distrib/sdl-1.2.12/src/video/maccommon/SDL_macevents.c
deleted file mode 100644
index e531c6c..0000000
--- a/distrib/sdl-1.2.12/src/video/maccommon/SDL_macevents.c
+++ /dev/null
@@ -1,746 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <stdio.h>
-
-#if defined(__APPLE__) && defined(__MACH__)
-#include <Carbon/Carbon.h>
-#elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335)
-#include <Carbon.h>
-#else
-#include <Script.h>
-#include <LowMem.h>
-#include <Devices.h>
-#include <DiskInit.h>
-#include <ToolUtils.h>
-#endif
-
-#include "SDL_events.h"
-#include "SDL_video.h"
-#include "SDL_syswm.h"
-#include "../../events/SDL_events_c.h"
-#include "../../events/SDL_sysevents.h"
-#include "../SDL_cursor_c.h"
-#include "SDL_macevents_c.h"
-#include "SDL_mackeys.h"
-#include "SDL_macmouse_c.h"
-
-/* Define this to be able to collapse SDL windows.
-#define USE_APPEARANCE_MANAGER
- */
-
-/* Macintosh resource constants */
-#define mApple 128 /* Apple menu resource */
-#define iAbout 1 /* About menu item */
-
-/* Functions to handle the About menu */
-static void Mac_DoAppleMenu(_THIS, long item);
-
-/* The translation table from a macintosh key scancode to a SDL keysym */
-static SDLKey MAC_keymap[256];
-static SDL_keysym *TranslateKey(int scancode, int modifiers,
- SDL_keysym *keysym, int pressed);
-
-/* Handle activation and deactivation -- returns whether an event was posted */
-static int Mac_HandleActivate(int activate)
-{
- if ( activate ) {
- /* Show the current SDL application cursor */
- SDL_SetCursor(NULL);
-
- /* put our mask back case it changed during context switch */
- SetEventMask(everyEvent & ~autoKeyMask);
- } else {
-#if TARGET_API_MAC_CARBON
- { Cursor cursor;
- SetCursor(GetQDGlobalsArrow(&cursor));
- }
-#else
- SetCursor(&theQD->arrow);
-#endif
- if ( ! Mac_cursor_showing ) {
- ShowCursor();
- Mac_cursor_showing = 1;
- }
- }
- return(SDL_PrivateAppActive(activate, SDL_APPINPUTFOCUS));
-}
-
-static void myGlobalToLocal(_THIS, Point *pt)
-{
- if ( SDL_VideoSurface && !(SDL_VideoSurface->flags&SDL_FULLSCREEN) ) {
- GrafPtr saveport;
- GetPort(&saveport);
-#if TARGET_API_MAC_CARBON
- SetPort(GetWindowPort(SDL_Window));
-#else
- SetPort(SDL_Window);
-#endif
- GlobalToLocal(pt);
- SetPort(saveport);
- }
-}
-
-/* The main MacOS event handler */
-static int Mac_HandleEvents(_THIS, int wait4it)
-{
- static int mouse_button = 1;
- int i;
- EventRecord event;
-
-#if TARGET_API_MAC_CARBON
- /* There's no GetOSEvent() in the Carbon API. *sigh* */
-#define cooperative_multitasking 1
-#else
- int cooperative_multitasking;
- /* If we're running fullscreen, we can hog the MacOS events,
- otherwise we had better play nicely with the other apps.
- */
- if ( this->screen && (this->screen->flags & SDL_FULLSCREEN) ) {
- cooperative_multitasking = 0;
- } else {
- cooperative_multitasking = 1;
- }
-#endif
-
- /* If we call WaitNextEvent(), MacOS will check other processes
- * and allow them to run, and perform other high-level processing.
- */
- if ( cooperative_multitasking || wait4it ) {
- UInt32 wait_time;
-
- /* Are we polling or not? */
- if ( wait4it ) {
- wait_time = 2147483647;
- } else {
- wait_time = 0;
- }
- WaitNextEvent(everyEvent, &event, wait_time, nil);
- } else {
-#if ! TARGET_API_MAC_CARBON
- GetOSEvent(everyEvent, &event);
-#endif
- }
-
-#if TARGET_API_MAC_CARBON
- /* for some reason, event.where isn't set ? */
- GetGlobalMouse ( &event.where );
-#endif
-
- /* Check for mouse motion */
- if ( (event.where.h != last_where.h) ||
- (event.where.v != last_where.v) ) {
- Point pt;
- pt = last_where = event.where;
- myGlobalToLocal(this, &pt);
- SDL_PrivateMouseMotion(0, 0, pt.h, pt.v);
- }
-
- /* Check the current state of the keyboard */
- if ( SDL_GetAppState() & SDL_APPINPUTFOCUS ) {
- KeyMap keys;
- const Uint32 *keysptr = (Uint32 *) &keys;
- const Uint32 *last_keysptr = (Uint32 *) &last_keys;
-
- /* Check for special non-event keys */
- if ( event.modifiers != last_mods ) {
- static struct {
- EventModifiers mask;
- SDLKey key;
- } mods[] = {
- { alphaLock, SDLK_CAPSLOCK },
-#if 0 /* These are handled below in the GetKeys() code */
- { cmdKey, SDLK_LMETA },
- { shiftKey, SDLK_LSHIFT },
- { rightShiftKey, SDLK_RSHIFT },
- { optionKey, SDLK_LALT },
- { rightOptionKey, SDLK_RALT },
- { controlKey, SDLK_LCTRL },
- { rightControlKey, SDLK_RCTRL },
-#endif /* 0 */
- { 0, 0 }
- };
- SDL_keysym keysym;
- Uint8 mode;
- EventModifiers mod, mask;
-
-
- /* Set up the keyboard event */
- keysym.scancode = 0;
- keysym.sym = SDLK_UNKNOWN;
- keysym.mod = KMOD_NONE;
- keysym.unicode = 0;
-
- /* See what has changed, and generate events */
- mod = event.modifiers;
- for ( i=0; mods[i].mask; ++i ) {
- mask = mods[i].mask;
- if ( (mod&mask) != (last_mods&mask) ) {
- keysym.sym = mods[i].key;
- if ( (mod&mask) ||
- (mods[i].key == SDLK_CAPSLOCK) ) {
- mode = SDL_PRESSED;
- } else {
- mode = SDL_RELEASED;
- }
- SDL_PrivateKeyboard(mode, &keysym);
- }
- }
-
- /* Save state for next time */
- last_mods = mod;
- }
-
- /* Check for normal event keys, but we have to scan the
- actual keyboard state because on Mac OS X a keydown event
- is immediately followed by a keyup event.
- */
- GetKeys(keys);
- if ( (keysptr[0] != last_keysptr[0]) ||
- (keysptr[1] != last_keysptr[1]) ||
- (keysptr[2] != last_keysptr[2]) ||
- (keysptr[3] != last_keysptr[3]) ) {
- SDL_keysym keysym;
- int old_bit, new_bit;
-
-#ifdef DEBUG_KEYBOARD
- fprintf(sterr, "New keys: 0x%x 0x%x 0x%x 0x%x\n",
- new_keys[0], new_keys[1],
- new_keys[2], new_keys[3]);
-#endif
- for ( i=0; i<128; ++i ) {
- old_bit = (((Uint8 *)last_keys)[i/8]>>(i%8)) & 0x01;
- new_bit = (((Uint8 *)keys)[i/8]>>(i%8)) & 0x01;
- if ( old_bit != new_bit ) {
- /* Post the keyboard event */
-#ifdef DEBUG_KEYBOARD
- fprintf(stderr,"Scancode: 0x%2.2X\n",i);
-#endif
- SDL_PrivateKeyboard(new_bit,
- TranslateKey(i, event.modifiers,
- &keysym, new_bit));
- }
- }
-
- /* Save state for next time */
- last_keys[0] = keys[0];
- last_keys[1] = keys[1];
- last_keys[2] = keys[2];
- last_keys[3] = keys[3];
- }
- }
-
- /* Handle normal events */
- switch (event.what) {
- case mouseDown: {
- WindowRef win;
- short area;
-
- area = FindWindow(event.where, &win);
- /* Support switching between the SIOUX console
- and SDL_Window by clicking in the window.
- */
- if ( win && (win != FrontWindow()) ) {
- SelectWindow(win);
- }
- switch (area) {
- case inMenuBar: /* Only the apple menu exists */
- Mac_DoAppleMenu(this, MenuSelect(event.where));
- HiliteMenu(0);
- break;
- case inDrag:
-#if TARGET_API_MAC_CARBON
- DragWindow(win, event.where, NULL);
-#else
- DragWindow(win, event.where, &theQD->screenBits.bounds);
-#endif
- break;
- case inGoAway:
- if ( TrackGoAway(win, event.where) ) {
- SDL_PrivateQuit();
- }
- break;
- case inContent:
- myGlobalToLocal(this, &event.where);
- /* Treat command-click as right mouse button */
- if ( event.modifiers & optionKey ) {
- mouse_button = 2;
- } else if ( event.modifiers & cmdKey ) {
- mouse_button = 3;
- } else {
- mouse_button = 1;
- }
- SDL_PrivateMouseButton(SDL_PRESSED,
- mouse_button, event.where.h, event.where.v);
- break;
- case inGrow: {
- int newSize;
-
- /* Don't allow resize if video mode isn't resizable */
- if ( ! SDL_PublicSurface ||
- ! (SDL_PublicSurface->flags & SDL_RESIZABLE) ) {
- break;
- }
-#if TARGET_API_MAC_CARBON
- newSize = GrowWindow(win, event.where, NULL);
-#else
- newSize = GrowWindow(win, event.where, &theQD->screenBits.bounds);
-#endif
- if ( newSize ) {
-#if !TARGET_API_MAC_CARBON
- EraseRect ( &theQD->screenBits.bounds );
-#endif
- SizeWindow ( win, LoWord (newSize), HiWord (newSize), 1 );
- SDL_PrivateResize ( LoWord (newSize), HiWord (newSize) );
- }
- } break;
- case inZoomIn:
- case inZoomOut:
- if ( TrackBox (win, event.where, area )) {
- Rect rect;
-#if !TARGET_API_MAC_CARBON
- EraseRect ( &theQD->screenBits.bounds );
-#endif
- ZoomWindow ( win, area, 0);
- if ( area == inZoomIn ) {
- GetWindowUserState(SDL_Window, &rect);
- } else {
- GetWindowStandardState(SDL_Window, &rect);
- }
- SDL_PrivateResize (rect.right-rect.left,
- rect.bottom-rect.top);
- }
- break;
-#if TARGET_API_MAC_CARBON
- case inCollapseBox:
- if ( TrackBox (win, event.where, area )) {
- if ( IsWindowCollapsable(win) ) {
- CollapseWindow (win, !IsWindowCollapsed(win));
- /* There should be something done like in inGrow case, but... */
- }
- }
- break;
-#endif /* TARGET_API_MAC_CARBON */
- case inSysWindow:
-#if TARGET_API_MAC_CARBON
- /* Never happens in Carbon? */
-#else
- SystemClick(&event, win);
-#endif
- break;
- default:
- break;
- }
- }
- break;
- case mouseUp: {
- myGlobalToLocal(this, &event.where);
- /* Release the mouse button we simulated in the last press.
- The drawback of this methos is we cannot press more than
- one button. However, this doesn't matter, since there is
- only a single logical mouse button, even if you have a
- multi-button mouse, this doesn't matter at all.
- */
- SDL_PrivateMouseButton(SDL_RELEASED,
- mouse_button, event.where.h, event.where.v);
- }
- break;
-#if 0 /* Handled above the switch statement */
- case keyDown: {
- SDL_keysym keysym;
-
- SDL_PrivateKeyboard(SDL_PRESSED,
- TranslateKey((event.message&keyCodeMask)>>8
- event.modifiers, &keysym, 1));
- }
- break;
- case keyUp: {
- SDL_keysym keysym;
-
- SDL_PrivateKeyboard(SDL_RELEASED,
- TranslateKey((event.message&keyCodeMask)>>8
- event.modifiers, &keysym, 0));
- }
- break;
-#endif
- case updateEvt: {
- BeginUpdate(SDL_Window);
- #if SDL_VIDEO_OPENGL
- if (SDL_VideoSurface->flags & SDL_OPENGL)
- SDL_GL_SwapBuffers();
- else
- #endif
- if ( (SDL_VideoSurface->flags & SDL_HWSURFACE) ==
- SDL_SWSURFACE ) {
- SDL_UpdateRect(SDL_VideoSurface, 0, 0, 0, 0);
- }
- EndUpdate(SDL_Window);
- }
- /* If this was an update event for the SIOUX console, we return 0
- in order to stop an endless series of updates being triggered.
- */
- if ( (WindowRef) event.message != SDL_Window ) {
- return 0;
- }
- break;
- case activateEvt: {
- Mac_HandleActivate(!!(event.modifiers & activeFlag));
- }
- break;
- case diskEvt: {
-#if TARGET_API_MAC_CARBON
- /* What are we supposed to do? */;
-#else
- if ( ((event.message>>16)&0xFFFF) != noErr ) {
- Point spot;
- SetPt(&spot, 0x0070, 0x0050);
- DIBadMount(spot, event.message);
- }
-#endif
- }
- break;
- case osEvt: {
- switch ((event.message>>24) & 0xFF) {
-#if 0 /* Handled above the switch statement */
- case mouseMovedMessage: {
- myGlobalToLocal(this, &event.where);
- SDL_PrivateMouseMotion(0, 0,
- event.where.h, event.where.v);
- }
- break;
-#endif /* 0 */
- case suspendResumeMessage: {
- Mac_HandleActivate(!!(event.message & resumeFlag));
- }
- break;
- }
- }
- break;
- default: {
- ;
- }
- break;
- }
- return (event.what != nullEvent);
-}
-
-
-void Mac_PumpEvents(_THIS)
-{
- /* Process pending MacOS events */
- while ( Mac_HandleEvents(this, 0) ) {
- /* Loop and check again */;
- }
-}
-
-void Mac_InitOSKeymap(_THIS)
-{
- const void *KCHRPtr;
- UInt32 state;
- UInt32 value;
- int i;
- int world = SDLK_WORLD_0;
-
- /* Map the MAC keysyms */
- for ( i=0; i<SDL_arraysize(MAC_keymap); ++i )
- MAC_keymap[i] = SDLK_UNKNOWN;
-
- /* Defined MAC_* constants */
- MAC_keymap[MK_ESCAPE] = SDLK_ESCAPE;
- MAC_keymap[MK_F1] = SDLK_F1;
- MAC_keymap[MK_F2] = SDLK_F2;
- MAC_keymap[MK_F3] = SDLK_F3;
- MAC_keymap[MK_F4] = SDLK_F4;
- MAC_keymap[MK_F5] = SDLK_F5;
- MAC_keymap[MK_F6] = SDLK_F6;
- MAC_keymap[MK_F7] = SDLK_F7;
- MAC_keymap[MK_F8] = SDLK_F8;
- MAC_keymap[MK_F9] = SDLK_F9;
- MAC_keymap[MK_F10] = SDLK_F10;
- MAC_keymap[MK_F11] = SDLK_F11;
- MAC_keymap[MK_F12] = SDLK_F12;
- MAC_keymap[MK_PRINT] = SDLK_PRINT;
- MAC_keymap[MK_SCROLLOCK] = SDLK_SCROLLOCK;
- MAC_keymap[MK_PAUSE] = SDLK_PAUSE;
- MAC_keymap[MK_POWER] = SDLK_POWER;
- MAC_keymap[MK_BACKQUOTE] = SDLK_BACKQUOTE;
- MAC_keymap[MK_1] = SDLK_1;
- MAC_keymap[MK_2] = SDLK_2;
- MAC_keymap[MK_3] = SDLK_3;
- MAC_keymap[MK_4] = SDLK_4;
- MAC_keymap[MK_5] = SDLK_5;
- MAC_keymap[MK_6] = SDLK_6;
- MAC_keymap[MK_7] = SDLK_7;
- MAC_keymap[MK_8] = SDLK_8;
- MAC_keymap[MK_9] = SDLK_9;
- MAC_keymap[MK_0] = SDLK_0;
- MAC_keymap[MK_MINUS] = SDLK_MINUS;
- MAC_keymap[MK_EQUALS] = SDLK_EQUALS;
- MAC_keymap[MK_BACKSPACE] = SDLK_BACKSPACE;
- MAC_keymap[MK_INSERT] = SDLK_INSERT;
- MAC_keymap[MK_HOME] = SDLK_HOME;
- MAC_keymap[MK_PAGEUP] = SDLK_PAGEUP;
- MAC_keymap[MK_NUMLOCK] = SDLK_NUMLOCK;
- MAC_keymap[MK_KP_EQUALS] = SDLK_KP_EQUALS;
- MAC_keymap[MK_KP_DIVIDE] = SDLK_KP_DIVIDE;
- MAC_keymap[MK_KP_MULTIPLY] = SDLK_KP_MULTIPLY;
- MAC_keymap[MK_TAB] = SDLK_TAB;
- MAC_keymap[MK_q] = SDLK_q;
- MAC_keymap[MK_w] = SDLK_w;
- MAC_keymap[MK_e] = SDLK_e;
- MAC_keymap[MK_r] = SDLK_r;
- MAC_keymap[MK_t] = SDLK_t;
- MAC_keymap[MK_y] = SDLK_y;
- MAC_keymap[MK_u] = SDLK_u;
- MAC_keymap[MK_i] = SDLK_i;
- MAC_keymap[MK_o] = SDLK_o;
- MAC_keymap[MK_p] = SDLK_p;
- MAC_keymap[MK_LEFTBRACKET] = SDLK_LEFTBRACKET;
- MAC_keymap[MK_RIGHTBRACKET] = SDLK_RIGHTBRACKET;
- MAC_keymap[MK_BACKSLASH] = SDLK_BACKSLASH;
- MAC_keymap[MK_DELETE] = SDLK_DELETE;
- MAC_keymap[MK_END] = SDLK_END;
- MAC_keymap[MK_PAGEDOWN] = SDLK_PAGEDOWN;
- MAC_keymap[MK_KP7] = SDLK_KP7;
- MAC_keymap[MK_KP8] = SDLK_KP8;
- MAC_keymap[MK_KP9] = SDLK_KP9;
- MAC_keymap[MK_KP_MINUS] = SDLK_KP_MINUS;
- MAC_keymap[MK_CAPSLOCK] = SDLK_CAPSLOCK;
- MAC_keymap[MK_a] = SDLK_a;
- MAC_keymap[MK_s] = SDLK_s;
- MAC_keymap[MK_d] = SDLK_d;
- MAC_keymap[MK_f] = SDLK_f;
- MAC_keymap[MK_g] = SDLK_g;
- MAC_keymap[MK_h] = SDLK_h;
- MAC_keymap[MK_j] = SDLK_j;
- MAC_keymap[MK_k] = SDLK_k;
- MAC_keymap[MK_l] = SDLK_l;
- MAC_keymap[MK_SEMICOLON] = SDLK_SEMICOLON;
- MAC_keymap[MK_QUOTE] = SDLK_QUOTE;
- MAC_keymap[MK_RETURN] = SDLK_RETURN;
- MAC_keymap[MK_KP4] = SDLK_KP4;
- MAC_keymap[MK_KP5] = SDLK_KP5;
- MAC_keymap[MK_KP6] = SDLK_KP6;
- MAC_keymap[MK_KP_PLUS] = SDLK_KP_PLUS;
- MAC_keymap[MK_LSHIFT] = SDLK_LSHIFT;
- MAC_keymap[MK_z] = SDLK_z;
- MAC_keymap[MK_x] = SDLK_x;
- MAC_keymap[MK_c] = SDLK_c;
- MAC_keymap[MK_v] = SDLK_v;
- MAC_keymap[MK_b] = SDLK_b;
- MAC_keymap[MK_n] = SDLK_n;
- MAC_keymap[MK_m] = SDLK_m;
- MAC_keymap[MK_COMMA] = SDLK_COMMA;
- MAC_keymap[MK_PERIOD] = SDLK_PERIOD;
- MAC_keymap[MK_SLASH] = SDLK_SLASH;
-#if 0 /* These are the same as the left versions - use left by default */
- MAC_keymap[MK_RSHIFT] = SDLK_RSHIFT;
-#endif
- MAC_keymap[MK_UP] = SDLK_UP;
- MAC_keymap[MK_KP1] = SDLK_KP1;
- MAC_keymap[MK_KP2] = SDLK_KP2;
- MAC_keymap[MK_KP3] = SDLK_KP3;
- MAC_keymap[MK_KP_ENTER] = SDLK_KP_ENTER;
- MAC_keymap[MK_LCTRL] = SDLK_LCTRL;
- MAC_keymap[MK_LALT] = SDLK_LALT;
- MAC_keymap[MK_LMETA] = SDLK_LMETA;
- MAC_keymap[MK_SPACE] = SDLK_SPACE;
-#if 0 /* These are the same as the left versions - use left by default */
- MAC_keymap[MK_RMETA] = SDLK_RMETA;
- MAC_keymap[MK_RALT] = SDLK_RALT;
- MAC_keymap[MK_RCTRL] = SDLK_RCTRL;
-#endif
- MAC_keymap[MK_LEFT] = SDLK_LEFT;
- MAC_keymap[MK_DOWN] = SDLK_DOWN;
- MAC_keymap[MK_RIGHT] = SDLK_RIGHT;
- MAC_keymap[MK_KP0] = SDLK_KP0;
- MAC_keymap[MK_KP_PERIOD] = SDLK_KP_PERIOD;
-
-#if defined(__APPLE__) && defined(__MACH__)
- /* Wierd, these keys are on my iBook under Mac OS X
- Note that the left arrow keysym is the same as left ctrl!?
- */
- MAC_keymap[MK_IBOOK_ENTER] = SDLK_KP_ENTER;
- MAC_keymap[MK_IBOOK_RIGHT] = SDLK_RIGHT;
- MAC_keymap[MK_IBOOK_DOWN] = SDLK_DOWN;
- MAC_keymap[MK_IBOOK_UP] = SDLK_UP;
- MAC_keymap[MK_IBOOK_LEFT] = SDLK_LEFT;
-#endif /* Mac OS X */
-
- /* Up there we setup a static scancode->keysym map. However, it will not
- * work very well on international keyboard. Hence we now query MacOS
- * for its own keymap to adjust our own mapping table. However, this is
- * bascially only useful for ascii char keys. This is also the reason
- * why we keep the static table, too.
- */
-
- /* Get a pointer to the systems cached KCHR */
- KCHRPtr = (void *)GetScriptManagerVariable(smKCHRCache);
- if (KCHRPtr)
- {
- /* Loop over all 127 possible scan codes */
- for (i = 0; i < 0x7F; i++)
- {
- /* We pretend a clean start to begin with (i.e. no dead keys active */
- state = 0;
-
- /* Now translate the key code to a key value */
- value = KeyTranslate(KCHRPtr, i, &state) & 0xff;
-
- /* If the state become 0, it was a dead key. We need to translate again,
- passing in the new state, to get the actual key value */
- if (state != 0)
- value = KeyTranslate(KCHRPtr, i, &state) & 0xff;
-
- /* Now we should have an ascii value, or 0. Try to figure out to which SDL symbol it maps */
- if (value >= 128) /* Some non-ASCII char, map it to SDLK_WORLD_* */
- MAC_keymap[i] = world++;
- else if (value >= 32) /* non-control ASCII char */
- MAC_keymap[i] = value;
- }
- }
-
- /* The keypad codes are re-setup here, because the loop above cannot
- * distinguish between a key on the keypad and a regular key. We maybe
- * could get around this problem in another fashion: NSEvent's flags
- * include a "NSNumericPadKeyMask" bit; we could check that and modify
- * the symbol we return on the fly. However, this flag seems to exhibit
- * some weird behaviour related to the num lock key
- */
- MAC_keymap[MK_KP0] = SDLK_KP0;
- MAC_keymap[MK_KP1] = SDLK_KP1;
- MAC_keymap[MK_KP2] = SDLK_KP2;
- MAC_keymap[MK_KP3] = SDLK_KP3;
- MAC_keymap[MK_KP4] = SDLK_KP4;
- MAC_keymap[MK_KP5] = SDLK_KP5;
- MAC_keymap[MK_KP6] = SDLK_KP6;
- MAC_keymap[MK_KP7] = SDLK_KP7;
- MAC_keymap[MK_KP8] = SDLK_KP8;
- MAC_keymap[MK_KP9] = SDLK_KP9;
- MAC_keymap[MK_KP_MINUS] = SDLK_KP_MINUS;
- MAC_keymap[MK_KP_PLUS] = SDLK_KP_PLUS;
- MAC_keymap[MK_KP_PERIOD] = SDLK_KP_PERIOD;
- MAC_keymap[MK_KP_EQUALS] = SDLK_KP_EQUALS;
- MAC_keymap[MK_KP_DIVIDE] = SDLK_KP_DIVIDE;
- MAC_keymap[MK_KP_MULTIPLY] = SDLK_KP_MULTIPLY;
- MAC_keymap[MK_KP_ENTER] = SDLK_KP_ENTER;
-}
-
-static SDL_keysym *TranslateKey(int scancode, int modifiers,
- SDL_keysym *keysym, int pressed)
-{
- /* Set the keysym information */
- keysym->scancode = scancode;
- keysym->sym = MAC_keymap[keysym->scancode];
- keysym->mod = KMOD_NONE;
- keysym->unicode = 0;
- if ( pressed && SDL_TranslateUNICODE ) {
- static unsigned long state = 0;
- static Ptr keymap = nil;
- Ptr new_keymap;
-
- /* Get the current keyboard map resource */
- new_keymap = (Ptr)GetScriptManagerVariable(smKCHRCache);
- if ( new_keymap != keymap ) {
- keymap = new_keymap;
- state = 0;
- }
- keysym->unicode = KeyTranslate(keymap,
- keysym->scancode|modifiers, &state) & 0xFFFF;
- }
- return(keysym);
-}
-
-void Mac_InitEvents(_THIS)
-{
- /* Create apple menu bar */
- apple_menu = GetMenu(mApple);
- if ( apple_menu != nil ) {
- AppendResMenu(apple_menu, 'DRVR');
- InsertMenu(apple_menu, 0);
- }
- DrawMenuBar();
-
- /* Get rid of spurious events at startup */
- FlushEvents(everyEvent, 0);
-
- /* Allow every event but keyrepeat */
- SetEventMask(everyEvent & ~autoKeyMask);
-}
-
-void Mac_QuitEvents(_THIS)
-{
- ClearMenuBar();
- if ( apple_menu != nil ) {
- ReleaseResource((char **)apple_menu);
- }
-
- /* Clean up pending events */
- FlushEvents(everyEvent, 0);
-}
-
-static void Mac_DoAppleMenu(_THIS, long choice)
-{
-#if !TARGET_API_MAC_CARBON /* No Apple menu in OS X */
- short menu, item;
-
- item = (choice&0xFFFF);
- choice >>= 16;
- menu = (choice&0xFFFF);
-
- switch (menu) {
- case mApple: {
- switch (item) {
- case iAbout: {
- /* Run the about box */;
- }
- break;
- default: {
- Str255 name;
-
- GetMenuItemText(apple_menu, item, name);
- OpenDeskAcc(name);
- }
- break;
- }
- }
- break;
- default: {
- /* Ignore other menus */;
- }
- }
-#endif /* !TARGET_API_MAC_CARBON */
-}
-
-#if !TARGET_API_MAC_CARBON
-/* Since we don't initialize QuickDraw, we need to get a pointer to qd */
-struct QDGlobals *theQD = NULL;
-#endif
-
-/* Exported to the macmain code */
-void SDL_InitQuickDraw(struct QDGlobals *the_qd)
-{
-#if !TARGET_API_MAC_CARBON
- theQD = the_qd;
-#endif
-}
diff --git a/distrib/sdl-1.2.12/src/video/maccommon/SDL_macevents_c.h b/distrib/sdl-1.2.12/src/video/maccommon/SDL_macevents_c.h
deleted file mode 100644
index 8ea92ae..0000000
--- a/distrib/sdl-1.2.12/src/video/maccommon/SDL_macevents_c.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "../macrom/SDL_romvideo.h"
-
-/* Functions exported by SDL_macevents.c for the video subsystem
-*/
-extern void Mac_InitEvents(_THIS);
-extern void Mac_QuitEvents(_THIS);
-
-extern void Mac_InitOSKeymap(_THIS);
-extern void Mac_PumpEvents(_THIS);
diff --git a/distrib/sdl-1.2.12/src/video/maccommon/SDL_macgl.c b/distrib/sdl-1.2.12/src/video/maccommon/SDL_macgl.c
deleted file mode 100644
index 76bc529..0000000
--- a/distrib/sdl-1.2.12/src/video/maccommon/SDL_macgl.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* AGL implementation of SDL OpenGL support */
-
-#include "SDL_lowvideo.h"
-#include "SDL_macgl_c.h"
-#include "SDL_loadso.h"
-
-
-/* krat: adding OpenGL support */
-int Mac_GL_Init(_THIS)
-{
-#if SDL_VIDEO_OPENGL
- AGLPixelFormat format;
- int i = 0;
- GLint attributes [ 26 ]; /* 26 is max possible in this setup */
- GLboolean noerr;
-
- /* load the gl driver from a default path */
- if ( ! this->gl_config.driver_loaded ) {
- /* no driver has been loaded, use default (ourselves) */
- if ( Mac_GL_LoadLibrary(this, NULL) < 0 ) {
- return(-1);
- }
- }
-
- attributes[i++] = AGL_RGBA;
- if ( this->gl_config.red_size != 0 &&
- this->gl_config.blue_size != 0 &&
- this->gl_config.green_size != 0 ) {
- attributes[i++] = AGL_RED_SIZE;
- attributes[i++] = this->gl_config.red_size;
- attributes[i++] = AGL_GREEN_SIZE;
- attributes[i++] = this->gl_config.green_size;
- attributes[i++] = AGL_BLUE_SIZE;
- attributes[i++] = this->gl_config.blue_size;
- attributes[i++] = AGL_ALPHA_SIZE;
- attributes[i++] = this->gl_config.alpha_size;
- }
- if ( this->gl_config.double_buffer ) {
- attributes[i++] = AGL_DOUBLEBUFFER;
- }
- if ( this->gl_config.depth_size != 0 ) {
- attributes[i++] = AGL_DEPTH_SIZE;
- attributes[i++] = this->gl_config.depth_size;
- }
- if ( this->gl_config.stencil_size != 0 ) {
- attributes[i++] = AGL_STENCIL_SIZE;
- attributes[i++] = this->gl_config.stencil_size;
- }
- if ( this->gl_config.accum_red_size != 0 &&
- this->gl_config.accum_blue_size != 0 &&
- this->gl_config.accum_green_size != 0 ) {
-
- attributes[i++] = AGL_ACCUM_RED_SIZE;
- attributes[i++] = this->gl_config.accum_red_size;
- attributes[i++] = AGL_ACCUM_GREEN_SIZE;
- attributes[i++] = this->gl_config.accum_green_size;
- attributes[i++] = AGL_ACCUM_BLUE_SIZE;
- attributes[i++] = this->gl_config.accum_blue_size;
- attributes[i++] = AGL_ACCUM_ALPHA_SIZE;
- attributes[i++] = this->gl_config.accum_alpha_size;
- }
- if ( this->gl_config.stereo ) {
- attributes[i++] = AGL_STEREO;
- }
-#if defined(AGL_SAMPLE_BUFFERS_ARB) && defined(AGL_SAMPLES_ARB)
- if ( this->gl_config.multisamplebuffers != 0 ) {
- attributes[i++] = AGL_SAMPLE_BUFFERS_ARB;
- attributes[i++] = this->gl_config.multisamplebuffers;
- }
- if ( this->gl_config.multisamplesamples != 0 ) {
- attributes[i++] = AGL_SAMPLES_ARB;
- attributes[i++] = this->gl_config.multisamplesamples;
- }
-#endif
- if ( this->gl_config.accelerated > 0 ) {
- attributes[i++] = AGL_ACCELERATED;
- attributes[i++] = AGL_NO_RECOVERY;
- }
-
- attributes[i++] = AGL_ALL_RENDERERS;
- attributes[i] = AGL_NONE;
-
- format = aglChoosePixelFormat(NULL, 0, attributes);
- if ( format == NULL ) {
- SDL_SetError("Couldn't match OpenGL desired format");
- return(-1);
- }
-
- glContext = aglCreateContext(format, NULL);
- if ( glContext == NULL ) {
- SDL_SetError("Couldn't create OpenGL context");
- return(-1);
- }
- aglDestroyPixelFormat(format);
-
- #if TARGET_API_MAC_CARBON
- noerr = aglSetDrawable(glContext, GetWindowPort(SDL_Window));
- #else
- noerr = aglSetDrawable(glContext, (AGLDrawable)SDL_Window);
- #endif
-
- if(!noerr) {
- SDL_SetError("Unable to bind GL context to window");
- return(-1);
- }
- return(0);
-#else
- SDL_SetError("OpenGL support not configured");
- return(-1);
-#endif
-}
-
-void Mac_GL_Quit(_THIS)
-{
-#if SDL_VIDEO_OPENGL
- if ( glContext != NULL ) {
- aglSetCurrentContext(NULL);
- aglSetDrawable(glContext, NULL);
- aglDestroyContext(glContext);
- glContext = NULL;
- }
-#endif
-}
-
-#if SDL_VIDEO_OPENGL
-
-/* Make the current context active */
-int Mac_GL_MakeCurrent(_THIS)
-{
- int retval;
-
- retval = 0;
- if( ! aglSetCurrentContext(glContext) ) {
- SDL_SetError("Unable to make GL context current");
- retval = -1;
- }
- return(retval);
-}
-
-void Mac_GL_SwapBuffers(_THIS)
-{
- aglSwapBuffers(glContext);
-}
-
-int Mac_GL_LoadLibrary(_THIS, const char *location)
-{
- if (location == NULL)
-#if __MACH__
- location = "/System/Library/Frameworks/OpenGL.framework/OpenGL";
-#else
- location = "OpenGLLibrary";
-#endif
-
- this->hidden->libraryHandle = SDL_LoadObject(location);
-
- this->gl_config.driver_loaded = 1;
- return (this->hidden->libraryHandle != NULL) ? 0 : -1;
-}
-
-void Mac_GL_UnloadLibrary(_THIS)
-{
- SDL_UnloadObject(this->hidden->libraryHandle);
-
- this->hidden->libraryHandle = NULL;
- this->gl_config.driver_loaded = 0;
-}
-
-void* Mac_GL_GetProcAddress(_THIS, const char *proc)
-{
- return SDL_LoadFunction( this->hidden->libraryHandle, proc );
-}
-
-#endif /* SDL_VIDEO_OPENGL */
-
diff --git a/distrib/sdl-1.2.12/src/video/maccommon/SDL_macgl_c.h b/distrib/sdl-1.2.12/src/video/maccommon/SDL_macgl_c.h
deleted file mode 100644
index df1cbe5..0000000
--- a/distrib/sdl-1.2.12/src/video/maccommon/SDL_macgl_c.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* AGL implementation of SDL OpenGL support */
-
-#include "SDL_config.h"
-
-#if SDL_VIDEO_OPENGL
-#include "SDL_opengl.h"
-#if __MACOSX__
-#include <AGL/agl.h> /* AGL.framework */
-#else
-#include <agl.h>
-#endif
-#endif /* SDL_VIDEO_OPENGL */
-
-/* OpenGL functions */
-extern int Mac_GL_Init(_THIS);
-extern void Mac_GL_Quit(_THIS);
-#if SDL_VIDEO_OPENGL
-extern int Mac_GL_MakeCurrent(_THIS);
-extern int Mac_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
-extern void Mac_GL_SwapBuffers(_THIS);
-extern int Mac_GL_LoadLibrary(_THIS, const char *location);
-extern void Mac_GL_UnloadLibrary(_THIS);
-extern void* Mac_GL_GetProcAddress(_THIS, const char *proc);
-#endif
-
diff --git a/distrib/sdl-1.2.12/src/video/maccommon/SDL_mackeys.h b/distrib/sdl-1.2.12/src/video/maccommon/SDL_mackeys.h
deleted file mode 100644
index df458ca..0000000
--- a/distrib/sdl-1.2.12/src/video/maccommon/SDL_mackeys.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-/* These are the Macintosh key scancode constants -- from Inside Macintosh */
-
-#define MK_ESCAPE 0x35
-#define MK_F1 0x7A
-#define MK_F2 0x78
-#define MK_F3 0x63
-#define MK_F4 0x76
-#define MK_F5 0x60
-#define MK_F6 0x61
-#define MK_F7 0x62
-#define MK_F8 0x64
-#define MK_F9 0x65
-#define MK_F10 0x6D
-#define MK_F11 0x67
-#define MK_F12 0x6F
-#define MK_PRINT 0x69
-#define MK_SCROLLOCK 0x6B
-#define MK_PAUSE 0x71
-#define MK_POWER 0x7F
-#define MK_BACKQUOTE 0x32
-#define MK_1 0x12
-#define MK_2 0x13
-#define MK_3 0x14
-#define MK_4 0x15
-#define MK_5 0x17
-#define MK_6 0x16
-#define MK_7 0x1A
-#define MK_8 0x1C
-#define MK_9 0x19
-#define MK_0 0x1D
-#define MK_MINUS 0x1B
-#define MK_EQUALS 0x18
-#define MK_BACKSPACE 0x33
-#define MK_INSERT 0x72
-#define MK_HOME 0x73
-#define MK_PAGEUP 0x74
-#define MK_NUMLOCK 0x47
-#define MK_KP_EQUALS 0x51
-#define MK_KP_DIVIDE 0x4B
-#define MK_KP_MULTIPLY 0x43
-#define MK_TAB 0x30
-#define MK_q 0x0C
-#define MK_w 0x0D
-#define MK_e 0x0E
-#define MK_r 0x0F
-#define MK_t 0x11
-#define MK_y 0x10
-#define MK_u 0x20
-#define MK_i 0x22
-#define MK_o 0x1F
-#define MK_p 0x23
-#define MK_LEFTBRACKET 0x21
-#define MK_RIGHTBRACKET 0x1E
-#define MK_BACKSLASH 0x2A
-#define MK_DELETE 0x75
-#define MK_END 0x77
-#define MK_PAGEDOWN 0x79
-#define MK_KP7 0x59
-#define MK_KP8 0x5B
-#define MK_KP9 0x5C
-#define MK_KP_MINUS 0x4E
-#define MK_CAPSLOCK 0x39
-#define MK_a 0x00
-#define MK_s 0x01
-#define MK_d 0x02
-#define MK_f 0x03
-#define MK_g 0x05
-#define MK_h 0x04
-#define MK_j 0x26
-#define MK_k 0x28
-#define MK_l 0x25
-#define MK_SEMICOLON 0x29
-#define MK_QUOTE 0x27
-#define MK_RETURN 0x24
-#define MK_KP4 0x56
-#define MK_KP5 0x57
-#define MK_KP6 0x58
-#define MK_KP_PLUS 0x45
-#define MK_LSHIFT 0x38
-#define MK_z 0x06
-#define MK_x 0x07
-#define MK_c 0x08
-#define MK_v 0x09
-#define MK_b 0x0B
-#define MK_n 0x2D
-#define MK_m 0x2E
-#define MK_COMMA 0x2B
-#define MK_PERIOD 0x2F
-#define MK_SLASH 0x2C
-#if 0 /* These are the same as the left versions - use left by default */
-#define MK_RSHIFT 0x38
-#endif
-#define MK_UP 0x7E
-#define MK_KP1 0x53
-#define MK_KP2 0x54
-#define MK_KP3 0x55
-#define MK_KP_ENTER 0x4C
-#define MK_LCTRL 0x3B
-#define MK_LALT 0x3A
-#define MK_LMETA 0x37
-#define MK_SPACE 0x31
-#if 0 /* These are the same as the left versions - use left by default */
-#define MK_RMETA 0x37
-#define MK_RALT 0x3A
-#define MK_RCTRL 0x3B
-#endif
-#define MK_LEFT 0x7B
-#define MK_DOWN 0x7D
-#define MK_RIGHT 0x7C
-#define MK_KP0 0x52
-#define MK_KP_PERIOD 0x41
-
-/* Wierd, these keys are on my iBook under Mac OS X */
-#define MK_IBOOK_ENTER 0x34
-#define MK_IBOOK_LEFT 0x3B
-#define MK_IBOOK_RIGHT 0x3C
-#define MK_IBOOK_DOWN 0x3D
-#define MK_IBOOK_UP 0x3E
diff --git a/distrib/sdl-1.2.12/src/video/maccommon/SDL_macmouse.c b/distrib/sdl-1.2.12/src/video/maccommon/SDL_macmouse.c
deleted file mode 100644
index 85c3a0e..0000000
--- a/distrib/sdl-1.2.12/src/video/maccommon/SDL_macmouse.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#if defined(__APPLE__) && defined(__MACH__)
-#include <Carbon/Carbon.h>
-#elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335)
-#include <Carbon.h>
-#else
-#include <Quickdraw.h>
-#endif
-
-/* Routines that are not supported by the Carbon API... */
-#if !TARGET_API_MAC_CARBON
-#include <CursorDevices.h>
-#endif
-
-#include "SDL_mouse.h"
-#include "SDL_macmouse_c.h"
-
-
-/* The implementation dependent data for the window manager cursor */
-struct WMcursor {
- Cursor curs;
-};
-
-
-void Mac_FreeWMCursor(_THIS, WMcursor *cursor)
-{
- SDL_free(cursor);
-}
-
-WMcursor *Mac_CreateWMCursor(_THIS,
- Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
-{
- WMcursor *cursor;
- int row, bytes;
-
- /* Allocate the cursor memory */
- cursor = (WMcursor *)SDL_malloc(sizeof(WMcursor));
- if ( cursor == NULL ) {
- SDL_OutOfMemory();
- return(NULL);
- }
- SDL_memset(cursor, 0, sizeof(*cursor));
-
- if (w > 16)
- w = 16;
-
- if (h > 16)
- h = 16;
-
- bytes = (w+7)/8;
-
- for ( row=0; row<h; ++row ) {
- SDL_memcpy(&cursor->curs.data[row], data, bytes);
- data += bytes;
- }
- for ( row=0; row<h; ++row ) {
- SDL_memcpy(&cursor->curs.mask[row], mask, bytes);
- mask += bytes;
- }
- cursor->curs.hotSpot.h = hot_x;
- cursor->curs.hotSpot.v = hot_y;
-
- /* That was easy. :) */
- return(cursor);
-}
-
-int Mac_cursor_showing = 1;
-
-int Mac_ShowWMCursor(_THIS, WMcursor *cursor)
-{
- if ( cursor == NULL ) {
- if ( Mac_cursor_showing ) {
- HideCursor();
- Mac_cursor_showing = 0;
- }
- } else {
- SetCursor(&cursor->curs);
- if ( ! Mac_cursor_showing ) {
- ShowCursor();
- Mac_cursor_showing = 1;
- }
- }
- return(1);
-}
-
-void Mac_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
-{
-#if !TARGET_API_MAC_CARBON
- CursorDevice *cursordevice;
-
- cursordevice = nil;
- CursorDeviceNextDevice(&cursordevice);
- if ( cursordevice != nil ) {
- WindowPtr saveport;
- Point where;
-
- GetPort(&saveport);
- SetPort(SDL_Window);
- where.h = x;
- where.v = y;
- LocalToGlobal(&where);
- SetPort(saveport);
- CursorDeviceMoveTo(cursordevice, where.h, where.v);
- }
-#endif /* !TARGET_API_MAC_CARBON */
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/maccommon/SDL_macmouse_c.h b/distrib/sdl-1.2.12/src/video/maccommon/SDL_macmouse_c.h
deleted file mode 100644
index deba592..0000000
--- a/distrib/sdl-1.2.12/src/video/maccommon/SDL_macmouse_c.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "../macrom/SDL_romvideo.h"
-
-/* Functions to be exported */
-extern void Mac_FreeWMCursor(_THIS, WMcursor *cursor);
-extern WMcursor *Mac_CreateWMCursor(_THIS,
- Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
-extern int Mac_ShowWMCursor(_THIS, WMcursor *cursor);
-extern void Mac_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
-
-/* Data to be exported */
-extern int Mac_cursor_showing;
diff --git a/distrib/sdl-1.2.12/src/video/maccommon/SDL_macwm.c b/distrib/sdl-1.2.12/src/video/maccommon/SDL_macwm.c
deleted file mode 100644
index 66828bf..0000000
--- a/distrib/sdl-1.2.12/src/video/maccommon/SDL_macwm.c
+++ /dev/null
@@ -1,442 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#if defined(__APPLE__) && defined(__MACH__)
-#include <Carbon/Carbon.h>
-#elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335)
-#include <Carbon.h>
-#else
-#include <Windows.h>
-#include <Strings.h>
-#endif
-
-#if SDL_MACCLASSIC_GAMMA_SUPPORT
-#include <Devices.h>
-#include <Files.h>
-#include <MacTypes.h>
-#include <QDOffscreen.h>
-#include <Quickdraw.h>
-#include <Video.h>
-#endif
-
-#include "SDL_stdinc.h"
-#include "SDL_macwm_c.h"
-
-void Mac_SetCaption(_THIS, const char *title, const char *icon)
-{
- /* Don't convert C to P string in place, because it may be read-only */
- Str255 ptitle; /* MJS */
- ptitle[0] = strlen (title);
- SDL_memcpy(ptitle+1, title, ptitle[0]); /* MJS */
- if (SDL_Window)
- SetWTitle(SDL_Window, ptitle); /* MJS */
-}
-
-#if SDL_MACCLASSIC_GAMMA_SUPPORT
-/*
- * ADC Gamma Ramp support...
- *
- * Mac Gamma Ramp code was originally from sample code provided by
- * Apple Developer Connection, and not written specifically for SDL:
- * "Contains: Functions to enable Mac OS device gamma adjustments using 3 channel 256 element 8 bit gamma ramps
- * Written by: Geoff Stahl (ggs)
- * Copyright: Copyright (c) 1999 Apple Computer, Inc., All Rights Reserved
- * Disclaimer: You may incorporate this sample code into your applications without
- * restriction, though the sample code has been provided "AS IS" and the
- * responsibility for its operation is 100% yours. However, what you are
- * not permitted to do is to redistribute the source as "DSC Sample Code"
- * after having made changes. If you're going to re-distribute the source,
- * we require that you make it clear in the source that the code was
- * descended from Apple Sample Code, but that you've made changes."
- * (The sample code has been integrated into this file, and thus is modified from the original Apple sources.)
- */
-
-typedef struct recDeviceGamma /* storage for device handle and gamma table */
-{
- GDHandle hGD; /* handle to device */
- GammaTblPtr pDeviceGamma; /* pointer to device gamma table */
-} recDeviceGamma;
-typedef recDeviceGamma * precDeviceGamma;
-
-typedef struct recSystemGamma /* storage for system devices and gamma tables */
-{
- short numDevices; /* number of devices */
- precDeviceGamma * devGamma; /* array of pointers to device gamma records */
-} recSystemGamma;
-typedef recSystemGamma * precSystemGamma;
-
-static Ptr CopyGammaTable (GammaTblPtr pTableGammaIn)
-{
- GammaTblPtr pTableGammaOut = NULL;
- short tableSize, dataWidth;
-
- if (pTableGammaIn) /* if there is a table to copy */
- {
- dataWidth = (pTableGammaIn->gDataWidth + 7) / 8; /* number of bytes per entry */
- tableSize = sizeof (GammaTbl) + pTableGammaIn->gFormulaSize +
- (pTableGammaIn->gChanCnt * pTableGammaIn->gDataCnt * dataWidth);
- pTableGammaOut = (GammaTblPtr) NewPtr (tableSize); /* allocate new table */
- if (pTableGammaOut)
- BlockMove( (Ptr)pTableGammaIn, (Ptr)pTableGammaOut, tableSize); /* move everything */
- }
- return (Ptr)pTableGammaOut; /* return whatever we allocated, could be NULL */
-}
-
-static OSErr GetGammaTable (GDHandle hGD, GammaTblPtr * ppTableGammaOut)
-{
- VDGammaRecord DeviceGammaRec;
- CntrlParam cParam;
- OSErr err;
-
- cParam.ioCompletion = NULL; /* set up control params */
- cParam.ioNamePtr = NULL;
- cParam.ioVRefNum = 0;
- cParam.ioCRefNum = (**hGD).gdRefNum;
- cParam.csCode = cscGetGamma; /* Get Gamma commnd to device */
- *(Ptr *)cParam.csParam = (Ptr) &DeviceGammaRec; /* record for gamma */
-
- err = PBStatusSync( (ParmBlkPtr)&cParam ); /* get gamma */
-
- *ppTableGammaOut = (GammaTblPtr)(DeviceGammaRec.csGTable); /* pull table out of record */
-
- return err;
-}
-
-static Ptr GetDeviceGamma (GDHandle hGD)
-{
- GammaTblPtr pTableGammaDevice = NULL;
- GammaTblPtr pTableGammaReturn = NULL;
- OSErr err;
-
- err = GetGammaTable (hGD, &pTableGammaDevice); /* get a pointer to the devices table */
- if ((noErr == err) && pTableGammaDevice) /* if succesful */
- pTableGammaReturn = (GammaTblPtr) CopyGammaTable (pTableGammaDevice); /* copy to global */
-
- return (Ptr) pTableGammaReturn;
-}
-
-static void DisposeGammaTable (Ptr pGamma)
-{
- if (pGamma)
- DisposePtr((Ptr) pGamma); /* get rid of it */
-}
-
-static void DisposeSystemGammas (Ptr* ppSystemGammas)
-{
- precSystemGamma pSysGammaIn;
- if (ppSystemGammas)
- {
- pSysGammaIn = (precSystemGamma) *ppSystemGammas;
- if (pSysGammaIn)
- {
- short i;
- for (i = 0; i < pSysGammaIn->numDevices; i++) /* for all devices */
- if (pSysGammaIn->devGamma [i]) /* if pointer is valid */
- {
- DisposeGammaTable ((Ptr) pSysGammaIn->devGamma [i]->pDeviceGamma); /* dump gamma table */
- DisposePtr ((Ptr) pSysGammaIn->devGamma [i]); /* dump device info */
- }
- DisposePtr ((Ptr) pSysGammaIn->devGamma); /* dump device pointer array */
- DisposePtr ((Ptr) pSysGammaIn); /* dump system structure */
- *ppSystemGammas = NULL;
- }
- }
-}
-
-static Boolean GetDeviceGammaRampGD (GDHandle hGD, Ptr pRamp)
-{
- GammaTblPtr pTableGammaTemp = NULL;
- long indexChan, indexEntry;
- OSErr err;
-
- if (pRamp) /* ensure pRamp is allocated */
- {
- err = GetGammaTable (hGD, &pTableGammaTemp); /* get a pointer to the current gamma */
- if ((noErr == err) && pTableGammaTemp) /* if successful */
- {
- /* fill ramp */
- unsigned char * pEntry = (unsigned char *) &pTableGammaTemp->gFormulaData + pTableGammaTemp->gFormulaSize; /* base of table */
- short bytesPerEntry = (pTableGammaTemp->gDataWidth + 7) / 8; /* size, in bytes, of the device table entries */
- short shiftRightValue = pTableGammaTemp->gDataWidth - 8; /* number of right shifts device -> ramp */
- short channels = pTableGammaTemp->gChanCnt;
- short entries = pTableGammaTemp->gDataCnt;
- if (3 == channels) /* RGB format */
- { /* note, this will create runs of entries if dest. is bigger (not linear interpolate) */
- for (indexChan = 0; indexChan < channels; indexChan++)
- for (indexEntry = 0; indexEntry < 256; indexEntry++)
- *((unsigned char *) pRamp + (indexChan * 256) + indexEntry) =
- *(pEntry + indexChan * entries * bytesPerEntry + indexEntry * entries * bytesPerEntry / 256) >> shiftRightValue;
- }
- else /* single channel format */
- {
- for (indexChan = 0; indexChan < 768; indexChan += 256) /* repeat for all 3 channels (step by ramp size) */
- for (indexEntry = 0; indexEntry < 256; indexEntry++) /* for all entries set vramp value */
- *((unsigned char *) pRamp + indexChan + indexEntry) =
- *(pEntry + indexEntry * entries * bytesPerEntry / 256) >> shiftRightValue;
- }
- return true;
- }
- }
- return false;
-}
-
-static Ptr GetSystemGammas (void)
-{
- precSystemGamma pSysGammaOut; /* return pointer to system device gamma info */
- short devCount = 0; /* number of devices attached */
- Boolean fail = false;
- GDHandle hGDevice;
-
- pSysGammaOut = (precSystemGamma) NewPtr (sizeof (recSystemGamma)); /* allocate for structure */
-
- hGDevice = GetDeviceList (); /* top of device list */
- do /* iterate */
- {
- devCount++; /* count devices */
- hGDevice = GetNextDevice (hGDevice); /* next device */
- } while (hGDevice);
-
- pSysGammaOut->devGamma = (precDeviceGamma *) NewPtr (sizeof (precDeviceGamma) * devCount); /* allocate for array of pointers to device records */
- if (pSysGammaOut)
- {
- pSysGammaOut->numDevices = devCount; /* stuff count */
-
- devCount = 0; /* reset iteration */
- hGDevice = GetDeviceList ();
- do
- {
- pSysGammaOut->devGamma [devCount] = (precDeviceGamma) NewPtr (sizeof (recDeviceGamma)); /* new device record */
- if (pSysGammaOut->devGamma [devCount]) /* if we actually allocated memory */
- {
- pSysGammaOut->devGamma [devCount]->hGD = hGDevice; /* stuff handle */
- pSysGammaOut->devGamma [devCount]->pDeviceGamma = (GammaTblPtr)GetDeviceGamma (hGDevice); /* copy gamma table */
- }
- else /* otherwise dump record on exit */
- fail = true;
- devCount++; /* next device */
- hGDevice = GetNextDevice (hGDevice);
- } while (hGDevice);
- }
- if (!fail) /* if we did not fail */
- return (Ptr) pSysGammaOut; /* return pointer to structure */
- else
- {
- DisposeSystemGammas ((Ptr *) &pSysGammaOut); /* otherwise dump the current structures (dispose does error checking) */
- return NULL; /* could not complete */
- }
-}
-
-static void RestoreDeviceGamma (GDHandle hGD, Ptr pGammaTable)
-{
- VDSetEntryRecord setEntriesRec;
- VDGammaRecord gameRecRestore;
- CTabHandle hCTabDeviceColors;
- Ptr csPtr;
- OSErr err = noErr;
-
- if (pGammaTable) /* if we have a table to restore */
- {
- gameRecRestore.csGTable = pGammaTable; /* setup restore record */
- csPtr = (Ptr) &gameRecRestore;
- err = Control((**hGD).gdRefNum, cscSetGamma, (Ptr) &csPtr); /* restore gamma */
-
- if ((noErr == err) && (8 == (**(**hGD).gdPMap).pixelSize)) /* if successful and on an 8 bit device */
- {
- hCTabDeviceColors = (**(**hGD).gdPMap).pmTable; /* do SetEntries to force CLUT update */
- setEntriesRec.csTable = (ColorSpec *) &(**hCTabDeviceColors).ctTable;
- setEntriesRec.csStart = 0;
- setEntriesRec.csCount = (**hCTabDeviceColors).ctSize;
- csPtr = (Ptr) &setEntriesRec;
-
- err = Control((**hGD).gdRefNum, cscSetEntries, (Ptr) &csPtr); /* SetEntries in CLUT */
- }
- }
-}
-
-static void RestoreSystemGammas (Ptr pSystemGammas)
-{
- short i;
- precSystemGamma pSysGammaIn = (precSystemGamma) pSystemGammas;
- if (pSysGammaIn)
- for (i = 0; i < pSysGammaIn->numDevices; i++) /* for all devices */
- RestoreDeviceGamma (pSysGammaIn->devGamma [i]->hGD, (Ptr) pSysGammaIn->devGamma [i]->pDeviceGamma); /* restore gamma */
-}
-
-static Ptr CreateEmptyGammaTable (short channels, short entries, short bits)
-{
- GammaTblPtr pTableGammaOut = NULL;
- short tableSize, dataWidth;
-
- dataWidth = (bits + 7) / 8; /* number of bytes per entry */
- tableSize = sizeof (GammaTbl) + (channels * entries * dataWidth);
- pTableGammaOut = (GammaTblPtr) NewPtrClear (tableSize); /* allocate new tabel */
-
- if (pTableGammaOut) /* if we successfully allocated */
- {
- pTableGammaOut->gVersion = 0; /* set parameters based on input */
- pTableGammaOut->gType = 0;
- pTableGammaOut->gFormulaSize = 0;
- pTableGammaOut->gChanCnt = channels;
- pTableGammaOut->gDataCnt = entries;
- pTableGammaOut->gDataWidth = bits;
- }
- return (Ptr)pTableGammaOut; /* return whatever we allocated */
-}
-
-static Boolean SetDeviceGammaRampGD (GDHandle hGD, Ptr pRamp)
-{
- VDSetEntryRecord setEntriesRec;
- VDGammaRecord gameRecRestore;
- GammaTblPtr pTableGammaNew;
- GammaTblPtr pTableGammaCurrent = NULL;
- CTabHandle hCTabDeviceColors;
- Ptr csPtr;
- OSErr err;
- short dataBits, entries, channels = 3; /* force three channels in the gamma table */
-
- if (pRamp) /* ensure pRamp is allocated */
- {
- err= GetGammaTable (hGD, &pTableGammaCurrent); /* get pointer to current table */
- if ((noErr == err) && pTableGammaCurrent)
- {
- dataBits = pTableGammaCurrent->gDataWidth; /* table must have same data width */
- entries = pTableGammaCurrent->gDataCnt; /* table must be same size */
- pTableGammaNew = (GammaTblPtr) CreateEmptyGammaTable (channels, entries, dataBits); /* our new table */
- if (pTableGammaNew) /* if successful fill table */
- {
- unsigned char * pGammaBase = (unsigned char *) &pTableGammaNew->gFormulaData + pTableGammaNew->gFormulaSize; /* base of table */
- if ((256 == entries) && (8 == dataBits)) /* simple case: direct mapping */
- BlockMove ((Ptr)pRamp, (Ptr)pGammaBase, channels * entries); /* move everything */
- else /* tough case handle entry, channel and data size disparities */
- {
- short indexChan, indexEntry;
- short bytesPerEntry = (dataBits + 7) / 8; /* size, in bytes, of the device table entries */
- short shiftRightValue = 8 - dataBits; /* number of right shifts ramp -> device */
- shiftRightValue += ((bytesPerEntry - 1) * 8); /* multibyte entries and the need to map a byte at a time most sig. to least sig. */
- for (indexChan = 0; indexChan < channels; indexChan++) /* for all the channels */
- for (indexEntry = 0; indexEntry < entries; indexEntry++) /* for all the entries */
- {
- short currentShift = shiftRightValue; /* reset current bit shift */
- long temp = *((unsigned char *)pRamp + (indexChan << 8) + (indexEntry << 8) / entries); /* get data from ramp */
- short indexByte;
- for (indexByte = 0; indexByte < bytesPerEntry; indexByte++) /* for all bytes */
- {
- if (currentShift < 0) /* shift data correctly for current byte */
- *(pGammaBase++) = temp << -currentShift;
- else
- *(pGammaBase++) = temp >> currentShift;
- currentShift -= 8; /* increment shift to align to next less sig. byte */
- }
- }
- }
-
- /* set gamma */
- gameRecRestore.csGTable = (Ptr) pTableGammaNew; /* setup restore record */
- csPtr = (Ptr) &gameRecRestore;
- err = Control((**hGD).gdRefNum, cscSetGamma, (Ptr) &csPtr); /* restore gamma (note, display drivers may delay returning from this until VBL) */
-
- if ((8 == (**(**hGD).gdPMap).pixelSize) && (noErr == err)) /* if successful and on an 8 bit device */
- {
- hCTabDeviceColors = (**(**hGD).gdPMap).pmTable; /* do SetEntries to force CLUT update */
- setEntriesRec.csTable = (ColorSpec *) &(**hCTabDeviceColors).ctTable;
- setEntriesRec.csStart = 0;
- setEntriesRec.csCount = (**hCTabDeviceColors).ctSize;
- csPtr = (Ptr) &setEntriesRec;
- err = Control((**hGD).gdRefNum, cscSetEntries, (Ptr) &csPtr); /* SetEntries in CLUT */
- }
- DisposeGammaTable ((Ptr) pTableGammaNew); /* dump table */
- if (noErr == err)
- return true;
- }
- }
- }
- else /* set NULL gamma -> results in linear map */
- {
- gameRecRestore.csGTable = (Ptr) NULL; /* setup restore record */
- csPtr = (Ptr) &gameRecRestore;
- err = Control((**hGD).gdRefNum, cscSetGamma, (Ptr) &csPtr); /* restore gamma */
-
- if ((8 == (**(**hGD).gdPMap).pixelSize) && (noErr == err)) /* if successful and on an 8 bit device */
- {
- hCTabDeviceColors = (**(**hGD).gdPMap).pmTable; /* do SetEntries to force CLUT update */
- setEntriesRec.csTable = (ColorSpec *) &(**hCTabDeviceColors).ctTable;
- setEntriesRec.csStart = 0;
- setEntriesRec.csCount = (**hCTabDeviceColors).ctSize;
- csPtr = (Ptr) &setEntriesRec;
- err = Control((**hGD).gdRefNum, cscSetEntries, (Ptr) &csPtr); /* SetEntries in CLUT */
- }
- if (noErr == err)
- return true;
- }
- return false; /* memory allocation or device control failed if we get here */
-}
-
-/* end of ADC Gamma Ramp support code... */
-
-static Ptr systemGammaPtr;
-
-void Mac_QuitGamma(_THIS)
-{
- if (systemGammaPtr)
- {
- RestoreSystemGammas(systemGammaPtr);
- DisposeSystemGammas(&systemGammaPtr);
- }
-}
-
-static unsigned char shiftedRamp[3 * 256];
-
-int Mac_SetGammaRamp(_THIS, Uint16 *ramp)
-{
- int i;
- if (!systemGammaPtr)
- systemGammaPtr = GetSystemGammas();
- for (i = 0; i < 3 * 256; i++)
- {
- shiftedRamp[i] = ramp[i] >> 8;
- }
-
- if (SetDeviceGammaRampGD(GetMainDevice(), (Ptr) shiftedRamp))
- return 0;
- else
- return -1;
-}
-
-int Mac_GetGammaRamp(_THIS, Uint16 *ramp)
-{
- if (GetDeviceGammaRampGD(GetMainDevice(), (Ptr) shiftedRamp))
- {
- int i;
- for (i = 0; i < 3 * 256; i++)
- {
- ramp[i] = shiftedRamp[i] << 8;
- }
- return 0;
- }
- else
- return -1;
-}
-
-#endif /* SDL_MACCLASSIC_GAMMA_SUPPORT */
-
-
diff --git a/distrib/sdl-1.2.12/src/video/maccommon/SDL_macwm_c.h b/distrib/sdl-1.2.12/src/video/maccommon/SDL_macwm_c.h
deleted file mode 100644
index 5add861..0000000
--- a/distrib/sdl-1.2.12/src/video/maccommon/SDL_macwm_c.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "../macrom/SDL_romvideo.h"
-
-/* Functions to be exported */
-extern void Mac_SetCaption(_THIS, const char *title, const char *icon);
-
-/*
- * There's no Carbonized gamma support in Mac OS X, since PBStatusSync() and
- * Control() aren't supported in OS X's Carbonlib. Use the Quartz driver
- * instead.
- */
-#define SDL_MACCLASSIC_GAMMA_SUPPORT ((defined(__APPLE__) && defined(__MACH__)) == 0)
-
-#if SDL_MACCLASSIC_GAMMA_SUPPORT
-extern void Mac_QuitGamma(_THIS);
-extern int Mac_SetGammaRamp(_THIS, Uint16 *ramp);
-extern int Mac_GetGammaRamp(_THIS, Uint16 *ramp);
-#endif
-
diff --git a/distrib/sdl-1.2.12/src/video/macdsp/SDL_dspvideo.c b/distrib/sdl-1.2.12/src/video/macdsp/SDL_dspvideo.c
deleted file mode 100644
index ed3f8c4..0000000
--- a/distrib/sdl-1.2.12/src/video/macdsp/SDL_dspvideo.c
+++ /dev/null
@@ -1,1422 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- Written by Darrell Walisser <dwaliss1@purdue.edu>
-
- Implementation notes ----------------------------------------------------------------------
-
- A bit on GWorlds in VRAM from technote 1182:
-
- There are two important things to note about GWorld's allocated in
- VRAM. First, the base address retrieved through GetPixBaseAddr or
- read directly from the PixMap structure can become invalid anytime
- memory is allocated in VRAM. This can occur either by explicit
- allocations, such as calls to NewGWorld, or by implicit ones, such as
- those associated with the internal texture allocation of OpenGL. The
- stored pixel images themselves will still be valid but may have been
- moved in VRAM, thus rendering any stored base addresses invalid.
- You should never store an image's base address for longer than is
- necessary and especially never across calls to NewGWorld or
- texture-creation routines.
-
- Secondly, an offscreen pixel image allocated in VRAM can be
- purged at system task time by the display driver. This means any
- time your application yields time such by calling WaitNextEvent or
- SystemTask you can lose your VRAM GWorld contents. While this
- happens infrequently, usually associated with display resolution or
- pixel depth changes you must code for this eventuality. This purge
- can occur whether or not the GWorld is locked or not. A return value
- of false from LockPixels, a NULL return value from GetPixBaseAddr
- or NULL in the baseAddr field of the PixMap mean that the pixel
- image has been purged. To reallocate it you can either call
- UpdateGWorld or Dispose your current GWorld through
- DisposeGWorld and reallocate it via NewGWorld. Either way you must
- then rebuild the pixel image.
-
-------------------------------------------------------------------------------------
-
- Currently, I don't account for (1). In my testing, NewGWorld never invalidated
- other existing GWorlds in VRAM. However, I do have protection for (2).
- Namely, I am using GetOSEvent() instead of WaitNextEvent() so that there are no
- context switches (the app hogs the CPU). Eventually a book-keeping system should
- be coded to take care of (1) and (2).
-
-------------------------------------------------------------------------------------
-
- System requirements (* denotes optional):
-
- 1. DrawSprocket 1.7.3
- 2. *MacOS 9 or later (but *not* Mac OS X) for hardware accelerated blit / fill
- 3. *May also require certain graphics hardware for (2). I trust that all Apple OEM
- hardware will work. Third party accelerators may work if they have QuickDraw
- acceleration in the drivers and the drivers have been updated for OS 9. The current
- Voodoo 3 drivers (1.0b12) do not work.
-
- Coding suggestions:
-
- 1. Use SDL_UpdateRects !
-
- If no QuickDraw acceleration is present, double-buffered surfaces will use a back buffer
- in System memory. I recommend you use SDL_UpdateRects with double-buffered surfaces
- for best performance on these cards, since the overhead is nearly zero for VRAM back buffer.
-
- 2. Load most-resident surfaces first.
-
- If you fill up VRAM or AGP memory, there is no contingency for purging to make room for the next one.
- Therefore, you should load the surfaces you plan to use the most frequently first.
- Sooner or later, I will code LRU replacement to help this.
-
- TODO:
- Some kind of posterized mode for resolutions < 640x480.
- Window support / fullscreen toggle.
- Figure out how much VRAM is available. Put in video->info->video_mem.
- Track VRAM usage.
-
- BUGS:
- I can't create a hardware surface the same size as the screen?! How to fix?
-
-
-
- COMPILE OPTIONS:
-
- DSP_TRY_CC_AND_AA - Define if you want to try HWA color-key and alpha blitters
- HW color-key blitting gives substantial improvements,
- but hw alpha is neck-and-neck with SDL's soft bitter.
-
- DSP_NO_SYNC_VBL - Define for HWA double-buffered surfaces: don't sync
- pseudo-flip to monitor redraw.
-
- DSP_NO_SYNC_OPENGL - Define for OpenGL surfaces: don't sync buffer swap. Synching buffer
- swap may result in reduced performance, but can eliminate some
- tearing artifacts.
- CHANGELOG:
- 09/17/00 Lots of little tweaks. Build modelist in reverse order so largest contexts
- list first. Compared various methods with ROM methods and fixed rez switch
- crashing bug in GL Tron. (Woohoo!)
-*/
-
-#define DSP_TRY_CC_AND_AA
-
-/* #define DSP_NO_SYNC_VBL */
-
-#define DSP_NO_SYNC_OPENGL
-
-
-#if defined(__APPLE__) && defined(__MACH__)
-#include <Carbon/Carbon.h>
-#include <DrawSprocket/DrawSprocket.h>
-#elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335)
-#include <Carbon.h>
-#include <DrawSprocket.h>
-#else
-#include <LowMem.h>
-#include <Gestalt.h>
-#include <Devices.h>
-#include <DiskInit.h>
-#include <QDOffscreen.h>
-#include <DrawSprocket.h>
-#endif
-
-#include "SDL_video.h"
-#include "SDL_syswm.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_blit.h"
-#include "../SDL_pixels_c.h"
-#include "SDL_dspvideo.h"
-#include "../maccommon/SDL_macgl_c.h"
-#include "../maccommon/SDL_macwm_c.h"
-#include "../maccommon/SDL_macmouse_c.h"
-#include "../maccommon/SDL_macevents_c.h"
-
-/* Initialization/Query functions */
-static int DSp_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **DSp_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *DSp_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int DSp_SetColors(_THIS, int firstcolor, int ncolors,
- SDL_Color *colors);
-static int DSp_CreatePalette(_THIS);
-static int DSp_DestroyPalette(_THIS);
-static void DSp_VideoQuit(_THIS);
-
-static int DSp_GetMainDevice (_THIS, GDHandle *device);
-static void DSp_IsHWAvailable (_THIS, SDL_PixelFormat *vformat);
-static void DSp_DSpUpdate(_THIS, int numrects, SDL_Rect *sdl_rects);
-static void DSp_DirectUpdate(_THIS, int numrects, SDL_Rect *sdl_rects);
-
-/* Hardware surface functions */
-static int DSp_SetHWAlpha(_THIS, SDL_Surface *surface, UInt8 alpha);
-static int DSp_SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key);
-static int DSp_NewHWSurface(_THIS, CGrafPtr *port, int depth, int width, int height);
-static int DSp_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int DSp_LockHWSurface(_THIS, SDL_Surface *surface);
-static void DSp_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static void DSp_FreeHWSurface(_THIS, SDL_Surface *surface);
-static int DSp_FlipHWSurface(_THIS, SDL_Surface *surface);
-static int DSp_CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dest);
-static int DSp_HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect);
-static int DSp_FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color);
-
-#if SDL_VIDEO_OPENGL
- static void DSp_GL_SwapBuffers (_THIS);
-#endif
-
-#if ! TARGET_API_MAC_CARBON
-
- #define GetPortPixRowBytes(x) ( (*(x->portPixMap))->rowBytes )
- #define GetGDevPixMap(x) ((**(x)).gdPMap)
- #define GetPortPixMap(x) ((*(x)).portPixMap)
-
- #define GetPixDepth(y) ((**(y)).pixelSize)
- //#define GetPixRowBytes(y) ((**(y)).rowBytes)
- //#define GetPixBaseAddr(y) ((**(y)).baseAddr)
- #define GetPixCTab(y) ((**(y)).pmTable)
- #define GetPortBitMapForCopyBits(x) (&(((GrafPtr)(x))->portBits))
-
-#else
- #define GetPortPixRowBytes(x) (GetPixRowBytes(GetPortPixMap(x)) )
- #define GetGDevPixMap(x) ((**(x)).gdPMap)
-
-#endif
-
-typedef struct private_hwdata {
-
- GWorldPtr offscreen; // offscreen gworld in VRAM or AGP
-
- #ifdef DSP_TRY_CC_AND_AA
- GWorldPtr mask; // transparent mask
- RGBColor alpha; // alpha color
- RGBColor trans; // transparent color
- #endif
-
-} private_hwdata;
-
-typedef private_hwdata private_swdata ; /* have same fields */
-
-/* Macintosh toolbox driver bootstrap functions */
-
-static int DSp_Available(void)
-{
- /* Check for DrawSprocket */
-#if ! TARGET_API_MAC_OSX
- /* This check is only meaningful if you weak-link DrawSprocketLib */
- return ((Ptr)DSpStartup != (Ptr)kUnresolvedCFragSymbolAddress);
-#else
- return 1; // DrawSprocket.framework doesn't have it all, but it's there
-#endif
-}
-
-static void DSp_DeleteDevice(SDL_VideoDevice *device)
-{
- /* -dw- taking no chances with null pointers */
- if (device) {
-
- if (device->hidden) {
-
- if (device->hidden->dspinfo)
- SDL_free(device->hidden->dspinfo);
-
- SDL_free(device->hidden);
- }
- SDL_free(device);
- }
-}
-
-static SDL_VideoDevice *DSp_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device ) {
- SDL_memset(device, 0, sizeof (*device));
- device->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *device->hidden));
- if (device->hidden)
- SDL_memset(device->hidden, 0, sizeof ( *(device->hidden) ) );
- }
- if ( (device == NULL) || (device->hidden == NULL) ) {
- SDL_OutOfMemory();
-
- if ( device ) {
-
- if (device->hidden)
- SDL_free(device->hidden);
-
- SDL_free(device);
- }
-
- return(NULL);
- }
-
- /* Allocate DrawSprocket information */
- device->hidden->dspinfo = (struct DSpInfo *)SDL_malloc(
- (sizeof *device->hidden->dspinfo));
- if ( device->hidden->dspinfo == NULL ) {
- SDL_OutOfMemory();
- SDL_free(device->hidden);
- SDL_free(device);
- return(0);
- }
- SDL_memset(device->hidden->dspinfo, 0, (sizeof *device->hidden->dspinfo));
-
- /* Set the function pointers */
- device->VideoInit = DSp_VideoInit;
- device->ListModes = DSp_ListModes;
- device->SetVideoMode = DSp_SetVideoMode;
- device->SetColors = DSp_SetColors;
- device->UpdateRects = NULL;
- device->VideoQuit = DSp_VideoQuit;
- device->AllocHWSurface = DSp_AllocHWSurface;
- device->CheckHWBlit = NULL;
- device->FillHWRect = NULL;
- device->SetHWColorKey = NULL;
- device->SetHWAlpha = NULL;
- device->LockHWSurface = DSp_LockHWSurface;
- device->UnlockHWSurface = DSp_UnlockHWSurface;
- device->FlipHWSurface = DSp_FlipHWSurface;
- device->FreeHWSurface = DSp_FreeHWSurface;
-#if SDL_MACCLASSIC_GAMMA_SUPPORT
- device->SetGammaRamp = Mac_SetGammaRamp;
- device->GetGammaRamp = Mac_GetGammaRamp;
-#endif
-#if SDL_VIDEO_OPENGL
- device->GL_MakeCurrent = Mac_GL_MakeCurrent;
- device->GL_SwapBuffers = DSp_GL_SwapBuffers;
- device->GL_LoadLibrary = Mac_GL_LoadLibrary;
- device->GL_GetProcAddress = Mac_GL_GetProcAddress;
-#endif
- device->SetCaption = NULL;
- device->SetIcon = NULL;
- device->IconifyWindow = NULL;
- device->GrabInput = NULL;
- device->GetWMInfo = NULL;
- device->FreeWMCursor = Mac_FreeWMCursor;
- device->CreateWMCursor = Mac_CreateWMCursor;
- device->ShowWMCursor = Mac_ShowWMCursor;
- device->WarpWMCursor = Mac_WarpWMCursor;
- device->InitOSKeymap = Mac_InitOSKeymap;
- device->PumpEvents = Mac_PumpEvents;
-
- device->GrabInput = NULL;
- device->CheckMouseMode = NULL;
-
- device->free = DSp_DeleteDevice;
-
- return device;
-}
-
-VideoBootStrap DSp_bootstrap = {
- "DSp", "MacOS DrawSprocket",
- DSp_Available, DSp_CreateDevice
-};
-
-/* Use DSp/Display Manager to build mode list for given screen */
-static SDL_Rect** DSp_BuildModeList (const GDHandle gDevice, int *displayWidth, int *displayHeight)
-{
- DSpContextAttributes attributes;
- DSpContextReference context;
- DisplayIDType displayID;
- SDL_Rect temp_list [16];
- SDL_Rect **mode_list;
- int width, height, i, j;
-
- #if TARGET_API_MAC_OSX
-
- displayID = 0;
-
- #else
- /* Ask Display Manager for integer id of screen device */
- if ( DMGetDisplayIDByGDevice (gDevice, &displayID, SDL_TRUE) != noErr ) {
- return NULL;
- }
- #endif
- /* Get the first possible DSp context on this device */
- if ( DSpGetFirstContext (displayID, &context) != noErr ) {
- return NULL;
- }
-
- if ( DSpContext_GetAttributes (context, &attributes) != noErr )
- return NULL;
-
- *displayWidth = attributes.displayWidth;
- *displayHeight = attributes.displayHeight;
-
- for ( i = 0; i < SDL_arraysize(temp_list); i++ ) {
- width = attributes.displayWidth;
- height = attributes.displayHeight;
-
- temp_list [i].x = 0 | attributes.displayBestDepth;
- temp_list [i].y = 0;
- temp_list [i].w = width;
- temp_list [i].h = height;
-
- /* DSp will report many different contexts with the same width and height. */
- /* They will differ in bit depth and refresh rate. */
- /* We will ignore them until we reach one with a different width/height */
- /* When there are no more contexts to look at, we will quit building the list*/
- while ( width == attributes.displayWidth && height == attributes.displayHeight ) {
-
- OSStatus err = DSpGetNextContext (context, &context);
- if (err != noErr)
- if (err == kDSpContextNotFoundErr)
- goto done;
- else
- return NULL;
-
- if ( DSpContext_GetAttributes (context, &attributes) != noErr )
- return NULL;
-
- temp_list [i].x |= attributes.displayBestDepth;
- }
- }
-done:
- i++; /* i was not incremented before kicking out of the loop */
-
- mode_list = (SDL_Rect**) SDL_malloc (sizeof (SDL_Rect*) * (i+1));
- if (mode_list) {
-
- /* -dw- new stuff: build in reverse order so largest sizes list first */
- for (j = i-1; j >= 0; j--) {
- mode_list [j] = (SDL_Rect*) SDL_malloc (sizeof (SDL_Rect));
- if (mode_list [j])
- SDL_memcpy (mode_list [j], &(temp_list [j]), sizeof (SDL_Rect));
- else {
- SDL_OutOfMemory ();
- return NULL;
- }
- }
- mode_list [i] = NULL; /* append null to the end */
- }
- else {
- SDL_OutOfMemory ();
- return NULL;
- }
-
- return mode_list;
-}
-
-static void DSp_IsHWAvailable (_THIS, SDL_PixelFormat *vformat)
-{
- /*
- VRAM GWorlds are only available on OS 9 or later.
- Even with OS 9, some display drivers won't support it,
- so we create a test GWorld and check for errors.
- */
-
- long versionSystem;
-
- dsp_vram_available = SDL_FALSE;
- dsp_agp_available = SDL_FALSE;
-
- Gestalt ('sysv', &versionSystem);
- if (0x00000860 < (versionSystem & 0x0000FFFF)) {
-
- GWorldPtr offscreen;
- OSStatus err;
- Rect bounds;
-
- SetRect (&bounds, 0, 0, 320, 240);
-
-#if useDistantHdwrMem && useLocalHdwrMem
- err = NewGWorld (&offscreen, vformat->BitsPerPixel, &bounds, NULL, SDL_Display, useDistantHdwrMem | noNewDevice);
- if (err == noErr) {
- dsp_vram_available = SDL_TRUE;
- DisposeGWorld (offscreen);
- }
-
- err = NewGWorld (&offscreen, vformat->BitsPerPixel, &bounds, NULL, SDL_Display, useLocalHdwrMem | noNewDevice);
- if (err == noErr) {
- DisposeGWorld (offscreen);
- dsp_agp_available = SDL_TRUE;
- }
-#endif
- }
-}
-
-static int DSp_GetMainDevice (_THIS, GDHandle *device)
-{
-
-#if TARGET_API_MAC_OSX
- /* DSpUserSelectContext not available on OS X */
- *device = GetMainDevice();
- return 0;
-#else
-
- DSpContextAttributes attrib;
- DSpContextReference context;
- DisplayIDType display_id;
- GDHandle main_device;
- GDHandle device_list;
-
- device_list = GetDeviceList ();
- main_device = GetMainDevice ();
-
- /* Quick check to avoid slower method when only one display exists */
- if ( (**device_list).gdNextGD == NULL ) {
- *device = main_device;
- return 0;
- }
-
- SDL_memset (&attrib, 0, sizeof (DSpContextAttributes));
-
- /* These attributes are hopefully supported on all devices...*/
- attrib.displayWidth = 640;
- attrib.displayHeight = 480;
- attrib.displayBestDepth = 8;
- attrib.backBufferBestDepth = 8;
- attrib.displayDepthMask = kDSpDepthMask_All;
- attrib.backBufferDepthMask = kDSpDepthMask_All;
- attrib.colorNeeds = kDSpColorNeeds_Require;
- attrib.pageCount = 1;
-
- if (noErr != DMGetDisplayIDByGDevice (main_device, &display_id, SDL_FALSE)) {
- SDL_SetError ("Display Manager couldn't associate GDevice with a Display ID");
- return (-1);
- }
-
- /* Put up dialog on main display to select which display to use */
- if (noErr != DSpUserSelectContext (&attrib, display_id, NULL, &context)) {
- SDL_SetError ("DrawSprocket couldn't create a context");
- return (-1);
- }
-
- if (noErr != DSpContext_GetDisplayID (context, &display_id)) {
- SDL_SetError ("DrawSprocket couldn't get display ID");
- return (-1);
- }
-
- if (noErr != DMGetGDeviceByDisplayID (display_id, &main_device, SDL_FALSE)) {
- SDL_SetError ("Display Manager couldn't associate Display ID with GDevice");
- return (-1);
- }
-
- *device = main_device;
- return (0);
-#endif
-}
-
-static int DSp_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- NumVersion dsp_version = { 0x01, 0x00, 0x00, 0x00 };
-
-#if UNIVERSAL_INTERFACES_VERSION > 0x0320
- dsp_version = DSpGetVersion ();
-#endif
-
- if ( (dsp_version.majorRev == 1 && dsp_version.minorAndBugRev < 0x73) ||
- (dsp_version.majorRev < 1) ) {
-
- /* StandardAlert (kAlertStopAlert, "\pError!",
- "\pI need DrawSprocket 1.7.3 or later!\n"
- "You can find a newer version at http://www.apple.com/swupdates.",
- NULL, NULL);
- */
- SDL_SetError ("DrawSprocket version is too old. Need 1.7.3 or later.");
- return (-1);
- }
-
- if ( DSpStartup () != noErr ) {
- SDL_SetError ("DrawSprocket couldn't startup");
- return(-1);
- }
-
- /* Start DSpintosh events */
- Mac_InitEvents(this);
-
- /* Get a handle to the main monitor, or choose one on multiple monitor setups */
- if ( DSp_GetMainDevice(this, &SDL_Display) < 0)
- return (-1);
-
- /* Determine pixel format */
- vformat->BitsPerPixel = GetPixDepth ( (**SDL_Display).gdPMap );
- dsp_old_depth = vformat->BitsPerPixel;
-
- switch (vformat->BitsPerPixel) {
- case 16:
- vformat->Rmask = 0x00007c00;
- vformat->Gmask = 0x000003e0;
- vformat->Bmask = 0x0000001f;
- break;
- default:
- break;
- }
-
- if ( DSp_CreatePalette (this) < 0 ) {
- SDL_SetError ("Could not create palette");
- return (-1);
- }
-
- /* Get a list of available fullscreen modes */
- SDL_modelist = DSp_BuildModeList (SDL_Display,
- &this->info.current_w, &this->info.current_h);
- if (SDL_modelist == NULL) {
- SDL_SetError ("DrawSprocket could not build a mode list");
- return (-1);
- }
-
- /* Check for VRAM and AGP GWorlds for HW Blitting */
- DSp_IsHWAvailable (this, vformat);
-
- this->info.wm_available = 0;
-
- if (dsp_vram_available || dsp_agp_available) {
-
- this->info.hw_available = SDL_TRUE;
-
- this->CheckHWBlit = DSp_CheckHWBlit;
- this->info.blit_hw = SDL_TRUE;
-
- this->FillHWRect = DSp_FillHWRect;
- this->info.blit_fill = SDL_TRUE;
-
- #ifdef DSP_TRY_CC_AND_AA
- this->SetHWColorKey = DSp_SetHWColorKey;
- this->info.blit_hw_CC = SDL_TRUE;
-
- this->SetHWAlpha = DSp_SetHWAlpha;
- this->info.blit_hw_A = SDL_TRUE;
- #endif
-
- }
-
- return(0);
-}
-
-static SDL_Rect **DSp_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- static SDL_Rect *dsp_modes[16];
- int i = 0, j = 0;
-
- if ( format->BitsPerPixel == 0 )
- return ( (SDL_Rect**) NULL );
-
- while (SDL_modelist[i] != NULL) {
-
- if (SDL_modelist[i]->x & format->BitsPerPixel) {
- dsp_modes[j] = SDL_modelist[i];
- j++;
- }
- i++;
- }
-
- dsp_modes[j] = NULL;
-
- return dsp_modes;
-}
-
-/* Various screen update functions available */
-static void DSp_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
-
-#if ! TARGET_API_MAC_OSX
-
-static volatile unsigned int retrace_count = 0; /* -dw- need volatile because it updates asychronously */
-
-Boolean DSp_VBLProc ( DSpContextReference context, void *ref_con )
-{
- retrace_count++;
-
- return 1; /* Darrell, is this right? */
-}
-
-static void DSp_SetHWError (OSStatus err, int is_agp)
-{
- char message[1024];
- const char *fmt, *mem;
-
- if ( is_agp ) {
- mem = "AGP Memory";
- } else {
- mem = "VRAM";
- }
- switch(err) {
- case memFullErr:
- fmt = "Hardware surface possible but not enough %s available";
- break;
- case cDepthErr:
- fmt = "Hardware surface possible but invalid color depth";
- break;
- default:
- fmt = "Hardware surface could not be allocated in %s - unknown error";
- break;
- }
- SDL_snprintf(message, SDL_arraysize(message), fmt, mem);
- SDL_SetError(message);
-}
-#endif // TARGET_API_MAC_OSX
-
-/* put up a dialog to verify display change */
-static int DSp_ConfirmSwitch () {
-
- /* resource id's for dialog */
- const int rDialog = 1002;
- const int bCancel = 1;
- const int bOK = 2;
-
- DialogPtr dialog;
- OSStatus err;
- SInt32 response;
- DialogItemIndex item = 0;
- GrafPtr savePort;
-
- GetPort (&savePort);
-
- dialog = GetNewDialog (rDialog, NULL, (WindowPtr) -1);
- if (dialog == NULL)
- return (0);
-
-#if TARGET_API_MAC_CARBON
- SetPort (GetDialogPort(dialog));
-#else
- SetPort ((WindowPtr) dialog);
-#endif
-
- SetDialogDefaultItem (dialog, bCancel);
- SetDialogCancelItem (dialog, bCancel);
-
- SetEventMask (everyEvent);
- FlushEvents (everyEvent, 0);
-
- /* On MacOS 8.5 or later, we can make the dialog go away after 15 seconds */
- /* This is good since it's possible user can't even see the dialog! */
- /* Requires linking to DialogsLib */
- err = Gestalt(gestaltSystemVersion,&response);
- if (err == noErr && response >= 0x00000850) {
- SetDialogTimeout(dialog, bCancel, 15);
- }
-
- do {
-
- ModalDialog ( NULL, &item );
-
- } while ( item != bCancel && item != bOK && err != noErr);
-
-
- DisposeDialog (dialog);
- SetPort (savePort);
-
- SetEventMask(everyEvent - autoKeyMask);
- FlushEvents(everyEvent, 0);
-
- return (item - 1);
-}
-
-static void DSp_UnsetVideoMode(_THIS, SDL_Surface *current)
-{
-
-
- if ( current->flags & SDL_OPENGL ) {
- Mac_GL_Quit (this);
- }
-
- if (dsp_context != NULL) {
-
- GWorldPtr front;
- DSpContext_GetFrontBuffer (dsp_context, &front);
-
- if (front != dsp_back_buffer)
- DisposeGWorld (dsp_back_buffer);
-
- if (current->hwdata)
- SDL_free(current->hwdata);
-
- DSpContext_SetState (dsp_context, kDSpContextState_Inactive );
- DSpContext_Release (dsp_context);
-
- dsp_context = NULL;
- }
-
- if (SDL_Window != NULL) {
- DisposeWindow (SDL_Window);
- SDL_Window = NULL;
- }
-
- current->pixels = NULL;
- current->flags = 0;
-}
-
-static SDL_Surface *DSp_SetVideoMode(_THIS,
- SDL_Surface *current, int width, int height, int bpp, Uint32 flags)
-{
-
-#if !TARGET_API_MAC_OSX
- DisplayIDType display_id;
- Fixed freq;
-#endif
- DSpContextAttributes attrib;
- OSStatus err;
- UInt32 rmask = 0, gmask = 0, bmask = 0;
-
- int page_count;
- int double_buf;
- int hw_surface;
- int use_dsp_back_buffer;
-
- DSp_UnsetVideoMode (this, current);
-
- if (bpp != dsp_old_depth)
- DSp_DestroyPalette (this);
-
- double_buf = (flags & SDL_DOUBLEBUF) != 0;
- hw_surface = (flags & SDL_HWSURFACE) != 0;
- use_dsp_back_buffer = !dsp_vram_available || !hw_surface ;
-
- current->flags |= SDL_FULLSCREEN;
-
-rebuild:
-
- if ( double_buf && use_dsp_back_buffer ) {
- page_count = 2;
- } else {
- page_count = 1;
- }
-
- SDL_memset (&attrib, 0, sizeof (DSpContextAttributes));
- attrib.displayWidth = width;
- attrib.displayHeight = height;
- attrib.displayBestDepth = bpp;
- attrib.backBufferBestDepth = bpp;
- attrib.displayDepthMask = kDSpDepthMask_All;
- attrib.backBufferDepthMask = kDSpDepthMask_All;
- attrib.colorNeeds = kDSpColorNeeds_Require;
- attrib.colorTable = 0;
- attrib.pageCount = page_count;
- #if TARGET_API_MAC_OSX || UNIVERSAL_INTERFACES_VERSION == 0x0320
-
- if ( DSpFindBestContext (&attrib, &dsp_context) != noErr ) {
- SDL_SetError ("DrawSprocket couldn't find a context");
- return NULL;
- }
-
- #else
- if ( noErr != DMGetDisplayIDByGDevice (SDL_Display, &display_id, SDL_FALSE) ) {
- SDL_SetError ("Display Manager couldn't associate GDevice with display_id");
- return NULL;
- }
- if ( DSpFindBestContextOnDisplayID(&attrib, &dsp_context, display_id) != noErr ) {
- SDL_SetError ("DrawSprocket couldn't find a suitable context on given display");
- return NULL;
- }
-
- #endif
- if ( DSpContext_Reserve (dsp_context, &attrib) != noErr ) {
- SDL_SetError ("DrawSprocket couldn't get the needed resources to build the display");
- return NULL;
- }
-
- if ( (err = DSpContext_SetState (dsp_context, kDSpContextState_Active)) != noErr ) {
-
- if (err == kDSpConfirmSwitchWarning) {
-
- if ( ! DSp_ConfirmSwitch () ) {
-
- DSpContext_Release (dsp_context);
- dsp_context = NULL;
- SDL_SetError ("User cancelled display switch");
- return NULL;
- }
- else
- /* Have to reactivate context. Why? */
- DSpContext_SetState (dsp_context, kDSpContextState_Active);
-
- }
- else {
- SDL_SetError ("DrawSprocket couldn't activate the context");
- return NULL;
- }
- }
-
-
- if (bpp != dsp_old_depth) {
-
- DSp_CreatePalette (this);
-
- /* update format if display depth changed */
- if (bpp == 16) {
-
- rmask = 0x00007c00;
- gmask = 0x000003e0;
- bmask = 0x0000001f;
- }
- if ( ! SDL_ReallocFormat (current, bpp, rmask, gmask, bmask, 0 ) ) {
-
- SDL_SetError ("Could not reallocate video format.");
- return(NULL);
- }
- }
-
- if (!double_buf) {
-
- /* single-buffer context */
- DSpContext_GetFrontBuffer (dsp_context, &dsp_back_buffer);
-
- current->hwdata = (private_hwdata*) SDL_malloc (sizeof (private_hwdata));
- if (current ->hwdata == NULL) {
- SDL_OutOfMemory ();
- return NULL;
- }
- current->hwdata->offscreen = dsp_back_buffer;
- current->flags |= SDL_HWSURFACE;
- this->UpdateRects = DSp_DirectUpdate;
- }
- else if ( use_dsp_back_buffer ) {
-
- DSpContext_GetBackBuffer (dsp_context, kDSpBufferKind_Normal, &dsp_back_buffer);
-
- current->flags |= SDL_DOUBLEBUF | SDL_SWSURFACE; /* only front buffer is in VRAM */
- this->UpdateRects = DSp_DSpUpdate;
- }
- else if ( DSp_NewHWSurface(this, &dsp_back_buffer, bpp, width-1, height-1) == 0 ) {
-
- current->hwdata = (private_hwdata*) SDL_malloc (sizeof (private_hwdata));
- if (current ->hwdata == NULL) {
- SDL_OutOfMemory ();
- return NULL;
- }
-
- SDL_memset (current->hwdata, 0, sizeof (private_hwdata));
- current->hwdata->offscreen = dsp_back_buffer;
- current->flags |= SDL_DOUBLEBUF | SDL_HWSURFACE;
- this->UpdateRects = DSp_DirectUpdate; /* hardware doesn't do update rects, must be page-flipped */
- }
- else {
-
- DSpContext_Release (dsp_context);
- use_dsp_back_buffer = SDL_TRUE;
- goto rebuild;
- }
-
- current->pitch = GetPortPixRowBytes(dsp_back_buffer) & 0x3FFF;
- current->pixels = GetPixBaseAddr(GetPortPixMap(dsp_back_buffer));
-
- current->w = width;
- current->h = height;
-
- #if ! TARGET_API_MAC_OSX
-
- if (use_dsp_back_buffer) {
-
- DSpContext_GetMonitorFrequency (dsp_context, &freq);
- DSpContext_SetMaxFrameRate (dsp_context, freq >> 16);
- }
-
-
- if ( (current->flags & SDL_HWSURFACE) || (current->flags & SDL_OPENGL) )
- DSpContext_SetVBLProc (dsp_context, DSp_VBLProc, NULL);
- #endif
-
- if (bpp == 8)
- current->flags |= SDL_HWPALETTE;
-
- if (flags & SDL_OPENGL) {
-
- Rect rect;
- RGBColor rgb = { 0.0, 0.0, 0.0 };
- GrafPtr save_port;
-
- SetRect (&rect, 0, 0, width, height);
- SDL_Window = NewCWindow(nil, &( (**SDL_Display).gdRect), "\p", SDL_TRUE, plainDBox, (WindowPtr)-1, SDL_FALSE, 0);
-
- if (SDL_Window == NULL) {
-
- SDL_SetError ("DSp_SetVideoMode : OpenGL window could not be created.");
- return NULL;
- }
-
- /* Set window color to black to avoid white flash*/
- GetPort (&save_port);
-#if TARGET_API_MAC_CARBON
- SetPort (GetWindowPort(SDL_Window));
-#else
- SetPort (SDL_Window);
-#endif
- RGBForeColor (&rgb);
- PaintRect (&rect);
- SetPort (save_port);
-
- SetPortWindowPort (SDL_Window);
- SelectWindow (SDL_Window);
-
- if ( Mac_GL_Init (this) < 0 ) {
-
- SDL_SetError ("DSp_SetVideoMode : could not create OpenGL context.");
- return NULL;
- }
-
- current->flags |= SDL_OPENGL;
- }
-
- return current;
-}
-
-#ifdef DSP_TRY_CC_AND_AA
-
-static int DSp_MakeHWMask (_THIS, SDL_Surface *surface)
-{
- GDHandle save_device;
- CGrafPtr save_port;
- GWorldPtr temp;
- RGBColor black = { 0, 0, 0 };
- RGBColor white = { 0xFFFF, 0xFFFF, 0xFFFF };
- Rect rect;
-
- Uint32 depth = GetPixDepth ( GetGDevPixMap (SDL_Display) );
-
- SetRect (&rect, 0, 0, surface->w, surface->h);
-
- if ( noErr != NewGWorld (&(surface->hwdata->mask), depth, &rect, 0, SDL_Display, 0 ) < 0 ) {
-
- SDL_OutOfMemory ();
- return (-1);
- }
-
- if ( noErr != NewGWorld (&temp, depth, &rect, 0 , SDL_Display, 0 ) ) {
-
- SDL_OutOfMemory ();
- return (-1);
- }
-
-
- GetGWorld (&save_port, &save_device);
- SetGWorld (surface->hwdata->mask, SDL_Display);
-
- RGBForeColor (&white);
- PaintRect (&rect);
-
- RGBBackColor (&(surface->hwdata->trans));
-
- CopyBits ( GetPortBitMapForCopyBits(surface->hwdata->offscreen),
- GetPortBitMapForCopyBits(surface->hwdata->mask),
- &rect, &rect, transparent, NULL );
-
- SetGWorld (surface->hwdata->mask, SDL_Display);
- SetGWorld (save_port, save_device);
- return (0);
-}
-
-static int DSp_SetHWAlpha(_THIS, SDL_Surface *surface, UInt8 alpha)
-{
- surface->hwdata->alpha.red = (alpha / 255.0) * 65535;
- surface->hwdata->alpha.blue = (alpha / 255.0) * 65535;
- surface->hwdata->alpha.green = (alpha / 255.0) * 65535;
-
- surface->flags |= SDL_SRCALPHA;
-
- if (surface->flags & SDL_SRCCOLORKEY) {
- return(DSp_MakeHWMask (this, surface));
- }
- return(0);
-}
-
-static int DSp_SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key)
-{
- CGrafPtr save_port;
- GDHandle save_device;
-
- GetGWorld (&save_port, &save_device);
- SetGWorld (surface->hwdata->offscreen, NULL);
-
- Index2Color (key, &(surface->hwdata->trans));
- surface->flags |= SDL_SRCCOLORKEY;
-
- SetGWorld (save_port, save_device);
-
- if ( surface->flags & SDL_SRCALPHA ) {
- return(DSp_MakeHWMask (this, surface));
- }
- return(0);
-}
-
-#endif /* DSP_TRY_CC_AND_AA */
-
-static int DSp_NewHWSurface(_THIS, CGrafPtr *port, int depth, int width, int height) {
-
- OSStatus err;
- Rect bounds;
-
- SetRect (&bounds, 0, 0, width, height);
-
- #if useDistantHdwrMem && useLocalHdwrMem
- if (dsp_vram_available) {
- /* try VRAM */
- err = NewGWorld (port, depth, &bounds, 0 , SDL_Display, useDistantHdwrMem | noNewDevice );
- if (err != noErr)
- DSp_SetHWError (err, SDL_FALSE);
- else
- return (0);
- }
-
- if (dsp_agp_available) {
- /* try AGP */
- err = NewGWorld (port, depth, &bounds, 0 , SDL_Display, useLocalHdwrMem | noNewDevice );
-
- if (err != noErr)
- DSp_SetHWError (err, SDL_TRUE);
- else
- return (0);
- }
-#endif
-
- return (-1);
-}
-
-static int DSp_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- GWorldPtr temp;
-
- if ( DSp_NewHWSurface (this, &temp, surface->format->BitsPerPixel, surface->w, surface->h) < 0 )
- return (-1);
-
- surface->hwdata = (private_hwdata*) SDL_malloc (sizeof (private_hwdata));
- if (surface->hwdata == NULL) {
- SDL_OutOfMemory ();
- return -1;
- }
-
- SDL_memset (surface->hwdata, 0, sizeof(private_hwdata));
- surface->hwdata->offscreen = temp;
- surface->pitch = GetPixRowBytes (GetPortPixMap (temp)) & 0x3FFF;
- surface->pixels = GetPixBaseAddr (GetPortPixMap (temp));
- surface->flags |= SDL_HWSURFACE;
-#ifdef DSP_TRY_CC_AND_AA
- surface->flags |= SDL_HWACCEL;
-#endif
- return 0;
-}
-
-static void DSp_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- if (surface->hwdata->offscreen != NULL)
- DisposeGWorld (surface->hwdata->offscreen);
- SDL_free(surface->hwdata);
-
- surface->pixels = NULL;
-}
-
-static int DSp_CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dest)
-{
- int accelerated;
-
- /* Set initial acceleration on */
- src->flags |= SDL_HWACCEL;
-
- /* Set the surface attributes */
- if ( (src->flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
- if ( ! this->info.blit_hw_A ) {
- src->flags &= ~SDL_HWACCEL;
- }
- }
- if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
- if ( ! this->info.blit_hw_CC ) {
- src->flags &= ~SDL_HWACCEL;
- }
- }
-
- /* Check to see if final surface blit is accelerated */
- accelerated = !!(src->flags & SDL_HWACCEL);
- if ( accelerated ) {
- src->map->hw_blit = DSp_HWAccelBlit;
- }
- return(accelerated);
-}
-
-static int DSp_HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect)
-{
- CGrafPtr save_port;
- GDHandle save_device;
- Rect src_rect, dst_rect;
- RGBColor black = { 0, 0, 0 };
- RGBColor white = { 0xFFFF, 0xFFFF, 0xFFFF };
-
-#ifdef DSP_TRY_CC_AND_AA
- UInt32 mode;
-#endif
-
- SetRect (&src_rect, srcrect->x, srcrect->y, srcrect->x + srcrect->w, srcrect->y + srcrect->h);
- SetRect (&dst_rect, dstrect->x, dstrect->y, dstrect->x + dstrect->w, dstrect->y + dstrect->h);
-
- GetGWorld (&save_port, &save_device);
- SetGWorld (dst->hwdata->offscreen, NULL);
-
- RGBForeColor (&black);
- RGBBackColor (&white);
-
-#ifdef DSP_TRY_CC_AND_AA
-
- if ( (src->flags & SDL_SRCCOLORKEY) &&
- (src->flags & SDL_SRCALPHA) ) {
-
- OpColor (&(src->hwdata->alpha));
-
- CopyDeepMask ( GetPortBitMapForCopyBits(src->hwdata->offscreen),
- GetPortBitMapForCopyBits(src->hwdata->mask),
- GetPortBitMapForCopyBits(dst->hwdata->offscreen),
- &src_rect, &src_rect, &dst_rect,
- blend,
- NULL );
- }
- else {
-
- if ( src->flags & SDL_SRCCOLORKEY) {
- RGBBackColor (&(src->hwdata->trans) );
- mode = transparent;
- }
- else if (src->flags & SDL_SRCALPHA) {
-
- OpColor (&(src->hwdata->alpha));
- mode = blend;
- }
- else {
-
- mode = srcCopy;
- }
-
- CopyBits ( GetPortBitMapForCopyBits(src->hwdata->offscreen),
- GetPortBitMapForCopyBits(dst->hwdata->offscreen),
- &src_rect, &dst_rect, mode, NULL );
- }
-#else
-
- CopyBits ( &(((GrafPtr)(src->hwdata->offscreen))->portBits),
- &(((GrafPtr)(dst->hwdata->offscreen))->portBits),
- &src_rect, &dst_rect, srcCopy, NULL );
-
-#endif /* DSP_TRY_CC_AND_AA */
-
- SetGWorld (save_port, save_device);
-
- return(0);
-}
-
-static int DSp_FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color)
-{
- CGrafPtr save_port;
- GDHandle save_device;
- Rect fill_rect;
- RGBColor rgb;
-
- SetRect (&fill_rect, rect->x, rect->y, rect->x + rect->w, rect->y + rect->h);
-
- GetGWorld (&save_port, &save_device);
- SetGWorld (dst->hwdata->offscreen, NULL);
-
- Index2Color (color, &rgb);
-
- RGBForeColor (&rgb);
- PaintRect (&fill_rect);
-
- SetGWorld (save_port, save_device);
-
- return(0);
-}
-
-static int DSp_FlipHWSurface(_THIS, SDL_Surface *surface)
-{
- if ( (surface->flags & SDL_HWSURFACE) ) {
- CGrafPtr dsp_front_buffer, save_port;
- Rect rect;
-
- #if ! TARGET_API_MAC_OSX
- unsigned int old_count;
- #endif
-
- /* pseudo page flipping for VRAM back buffer*/
- DSpContext_GetFrontBuffer (dsp_context, &dsp_front_buffer);
- SetRect (&rect, 0, 0, surface->w-1, surface->h-1);
-
- GetPort ((GrafPtr *)&save_port);
- SetPort ((GrafPtr)dsp_front_buffer);
-
- /* wait for retrace */
- /* I have tried doing the swap in interrupt routine (VBL Proc) to do */
- /* it asynchronously, but apparently CopyBits isn't interrupt safe */
-
- #if ! TARGET_API_MAC_OSX
- #ifndef DSP_NO_SYNC_VBL
- old_count = retrace_count;
- while (old_count == retrace_count)
- ;
- #endif
- #endif
-
- CopyBits ( GetPortBitMapForCopyBits(dsp_back_buffer),
- GetPortBitMapForCopyBits(dsp_front_buffer),
- &rect, &rect, srcCopy, NULL );
-
- SetPort ((GrafPtr)save_port);
-
- } else {
- /* not really page flipping at all: DSp just blits the dirty rectangles from DSp_UpdateRects */
- Boolean busy_flag;
- DSpContext_SwapBuffers (dsp_context, NULL, &busy_flag); /* this waits for VBL */
- DSpContext_GetBackBuffer (dsp_context, kDSpBufferKind_Normal, &dsp_back_buffer);
- surface->pixels = GetPixBaseAddr( GetPortPixMap(dsp_back_buffer) );
- }
- return(0);
-}
-
-static int DSp_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- if ( LockPixels (GetGWorldPixMap (surface->hwdata->offscreen)) )
- return 0;
- else
- return -1;
-}
-
-static void DSp_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- UnlockPixels (GetGWorldPixMap (surface->hwdata->offscreen));
-}
-
-static void DSp_DirectUpdate(_THIS, int numrects, SDL_Rect *sdl_rects)
-{
- return;
-}
-
-static void DSp_DSpUpdate(_THIS, int numrects, SDL_Rect *sdl_rects)
-{
-#if ! TARGET_API_MAC_OSX /* Unsupported DSp in here */
- int i;
- Rect rect;
-
- for (i = 0; i < numrects; i++) {
-
- rect.top = sdl_rects[i].y;
- rect.left = sdl_rects[i].x;
- rect.bottom = sdl_rects[i].h + sdl_rects[i].y;
- rect.right = sdl_rects[i].w + sdl_rects[i].x;
-
- DSpContext_InvalBackBufferRect (dsp_context, &rect);
- }
-#endif
-}
-
-static int DSp_CreatePalette(_THIS) {
-
-
- /* Create our palette */
- SDL_CTab = (CTabHandle)NewHandle(sizeof(ColorSpec)*256 + 8);
- if ( SDL_CTab == nil ) {
- SDL_OutOfMemory();
- return(-1);
- }
- (**SDL_CTab).ctSeed = GetCTSeed();
- (**SDL_CTab).ctFlags = 0;
- (**SDL_CTab).ctSize = 255;
- CTabChanged(SDL_CTab);
- SDL_CPal = NewPalette(256, SDL_CTab, pmExplicit+pmTolerant, 0);
-
- return 0;
-}
-
-static int DSp_DestroyPalette(_THIS) {
-
- /* Free palette and restore original one */
- if ( SDL_CTab != nil ) {
- DisposeHandle((Handle)SDL_CTab);
- SDL_CTab = nil;
- }
- if ( SDL_CPal != nil ) {
- DisposePalette(SDL_CPal);
- SDL_CPal = nil;
- }
- RestoreDeviceClut(SDL_Display);
-
- return (0);
-}
-
-static int DSp_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- CTabHandle cTab;
-
- int i;
-
- cTab = SDL_CTab;
-
- /* Verify the range of colors */
- if ( (firstcolor+ncolors) > ((**cTab).ctSize+1) ) {
- return(0);
- }
-
- /* Set the screen palette and update the display */
- for(i = 0; i < ncolors; i++) {
- int j = firstcolor + i;
- (**cTab).ctTable[j].value = j;
- (**cTab).ctTable[j].rgb.red = colors[i].r << 8 | colors[i].r;
- (**cTab).ctTable[j].rgb.green = colors[i].g << 8 | colors[i].g;
- (**cTab).ctTable[j].rgb.blue = colors[i].b << 8 | colors[i].b;
- }
-
- SetGDevice(SDL_Display);
- SetEntries(0, (**cTab).ctSize, (ColorSpec *)&(**cTab).ctTable);
-
- return(1);
-}
-
-void DSp_VideoQuit(_THIS)
-{
- int i;
-
- /* Free current video mode */
- DSp_UnsetVideoMode(this, this->screen);
-
- /* Free Palette and restore original */
- DSp_DestroyPalette (this);
-
-#if SDL_MACCLASSIC_GAMMA_SUPPORT
- Mac_QuitGamma(this);
-#endif
-
- /* Free list of video modes */
- if ( SDL_modelist != NULL ) {
- for ( i=0; SDL_modelist[i]; i++ ) {
- SDL_free(SDL_modelist[i]);
- }
- SDL_free(SDL_modelist);
- SDL_modelist = NULL;
- }
-
- /* Unload DrawSprocket */
- DSpShutdown ();
-}
-
-#if SDL_VIDEO_OPENGL
-
-/* swap buffers with v-sync */
-static void DSp_GL_SwapBuffers (_THIS) {
-
- #ifndef DSP_NO_SYNC_OPENGL
-
- unsigned int old_count;
-
- old_count = retrace_count;
- while (old_count == retrace_count)
- ;
- #endif
-
- aglSwapBuffers (glContext);
-}
-
-#endif
diff --git a/distrib/sdl-1.2.12/src/video/macdsp/SDL_dspvideo.h b/distrib/sdl-1.2.12/src/video/macdsp/SDL_dspvideo.h
deleted file mode 100644
index 3b49da6..0000000
--- a/distrib/sdl-1.2.12/src/video/macdsp/SDL_dspvideo.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_dspvideo_h
-#define _SDL_dspvideo_h
-
-#if TARGET_API_MAC_OSX
-# include <DrawSprocket/DrawSprocket.h> /* Drawsprocket.framework */
-#else
-#include <DrawSprocket.h>
-#endif
-
-#include "../maccommon/SDL_lowvideo.h"
-
-/* DrawSprocket specific information */
-struct DSpInfo {
- DSpContextReference dsp_context;
- CGrafPtr dsp_back_buffer;
- int dsp_old_depth;
-
- /* Flags for hw acceleration */
- int dsp_vram_available;
- int dsp_agp_available;
-
-
-};
-/* Old variable names */
-#define dsp_context (this->hidden->dspinfo->dsp_context)
-#define dsp_back_buffer (this->hidden->dspinfo->dsp_back_buffer)
-#define dsp_old_depth (this->hidden->dspinfo->dsp_old_depth)
-#define dsp_vram_available (this->hidden->dspinfo->dsp_vram_available)
-#define dsp_agp_available (this->hidden->dspinfo->dsp_agp_available)
-
-#endif /* _SDL_dspvideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/macrom/SDL_romvideo.c b/distrib/sdl-1.2.12/src/video/macrom/SDL_romvideo.c
deleted file mode 100644
index f0ab8de..0000000
--- a/distrib/sdl-1.2.12/src/video/macrom/SDL_romvideo.c
+++ /dev/null
@@ -1,745 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#if defined(__APPLE__) && defined(__MACH__)
-#include <Carbon/Carbon.h>
-#if USE_QUICKTIME
-#include <QuickTime/Movies.h>
-#endif
-#elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335)
-#include <Carbon.h>
-/* The fullscreen code requires the QuickTime framework, and the window
- is still at the back on Mac OS X, which is where this code is needed.
- */
-#if USE_QUICKTIME
-#include <Movies.h>
-#endif
-#else
-#include <Quickdraw.h>
-#include <LowMem.h>
-#include <Gestalt.h>
-#include <Devices.h>
-#include <DiskInit.h>
-#include <QDOffscreen.h>
-#endif
-
-#include "SDL_video.h"
-#include "SDL_syswm.h"
-#include "../SDL_sysvideo.h"
-#include "SDL_romvideo.h"
-#include "../maccommon/SDL_macgl_c.h"
-#include "../maccommon/SDL_macwm_c.h"
-#include "../maccommon/SDL_macmouse_c.h"
-#include "../maccommon/SDL_macevents_c.h"
-
-/* Initialization/Query functions */
-static int ROM_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **ROM_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *ROM_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int ROM_SetColors(_THIS, int firstcolor, int ncolors,
- SDL_Color *colors);
-static void ROM_VideoQuit(_THIS);
-
-/* Hardware surface functions */
-static int ROM_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int ROM_LockHWSurface(_THIS, SDL_Surface *surface);
-static void ROM_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static void ROM_FreeHWSurface(_THIS, SDL_Surface *surface);
-
-#if !TARGET_API_MAC_CARBON /* This seems not to be available? -sts Aug 2000 */
-/* Saved state for the menu bar */
-static RgnHandle gSaveGrayRgn = nil;
-static short gSaveMenuBar = 0;
-static Boolean gSaveCSVis = true;
-
-#if powerc
-/* Mixed mode glue to activate the 68K emulator and twiddle a register */
-#define ONEWORDSTUB(p1) \
- { 0x41FA, 0x0010, 0x209F, (p1), 0x41FA, \
- 0x0008, 0x2F10, 0x4E75, 0x0000, 0x0000, 0x0000 }
-
-#define TWOWORDSTUB(p1,p2) \
- { 0x41FA, 0x0012, 0x209F, (p1), (p2), 0x41FA, \
- 0x0008, 0x2F10, 0x4E75, 0x0000, 0x0000, 0x0000 }
-
-#define THREEWORDSTUB(p1,p2,p3) \
- { 0x41FA, 0x0014, 0x209F, (p1), (p2), (p3), 0x41FA, \
- 0x0008, 0x2F10, 0x4E75, 0x0000, 0x0000, 0x0000 }
-
-/* ControlStrip inline glue for PowerPC */
-static pascal Boolean SBIsControlStripVisible(void)
-{
- static short procData[] = TWOWORDSTUB(0x7000, 0xAAF2);
- ProcInfoType procInfo = kD0DispatchedPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
- | DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE(kFourByteCode);
-
- return((Boolean) CallUniversalProc((UniversalProcPtr) procData, procInfo, 0x00));
-}
-
-static pascal void SBShowHideControlStrip(Boolean showIt)
-{
- static short procData[] = THREEWORDSTUB(0x303C, 0x0101, 0xAAF2);
- ProcInfoType procInfo = kD0DispatchedPascalStackBased
- | DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE(kFourByteCode)
- | DISPATCHED_STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Boolean)));
-
- CallUniversalProc((UniversalProcPtr) procData, procInfo, 0x01, showIt);
-}
-#endif /* powerc */
-#endif /* !TARGET_API_MAC_CARBON */
-
-/* Macintosh toolbox driver bootstrap functions */
-
-static int ROM_Available(void)
-{
- return(1);
-}
-
-static void ROM_DeleteDevice(SDL_VideoDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_VideoDevice *ROM_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device ) {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *device->hidden));
- }
- if ( (device == NULL) || (device->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( device ) {
- SDL_free(device);
- }
- return(0);
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
-
- /* Set the function pointers */
- device->VideoInit = ROM_VideoInit;
- device->ListModes = ROM_ListModes;
- device->SetVideoMode = ROM_SetVideoMode;
- device->SetColors = ROM_SetColors;
- device->UpdateRects = NULL;
- device->VideoQuit = ROM_VideoQuit;
- device->AllocHWSurface = ROM_AllocHWSurface;
- device->CheckHWBlit = NULL;
- device->FillHWRect = NULL;
- device->SetHWColorKey = NULL;
- device->SetHWAlpha = NULL;
- device->LockHWSurface = ROM_LockHWSurface;
- device->UnlockHWSurface = ROM_UnlockHWSurface;
- device->FlipHWSurface = NULL;
- device->FreeHWSurface = ROM_FreeHWSurface;
-#if SDL_MACCLASSIC_GAMMA_SUPPORT
- device->SetGammaRamp = Mac_SetGammaRamp;
- device->GetGammaRamp = Mac_GetGammaRamp;
-#endif
-#if SDL_VIDEO_OPENGL
- device->GL_MakeCurrent = Mac_GL_MakeCurrent;
- device->GL_SwapBuffers = Mac_GL_SwapBuffers;
- device->GL_LoadLibrary = Mac_GL_LoadLibrary;
- device->GL_GetProcAddress = Mac_GL_GetProcAddress;
-#endif /* Have OpenGL */
- device->SetCaption = Mac_SetCaption;
- device->SetIcon = NULL;
- device->IconifyWindow = NULL;
- device->GrabInput = NULL;
- device->GetWMInfo = NULL;
- device->FreeWMCursor = Mac_FreeWMCursor;
- device->CreateWMCursor = Mac_CreateWMCursor;
- device->ShowWMCursor = Mac_ShowWMCursor;
- device->WarpWMCursor = Mac_WarpWMCursor;
- device->InitOSKeymap = Mac_InitOSKeymap;
- device->PumpEvents = Mac_PumpEvents;
-
- device->free = ROM_DeleteDevice;
-
- return device;
-}
-
-VideoBootStrap TOOLBOX_bootstrap = {
- "toolbox", "MacOS ROM Toolbox",
- ROM_Available, ROM_CreateDevice
-};
-
-
-static int ROM_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- long info;
-
- /* Check out some things about the system */
- Gestalt(gestaltQuickdrawVersion, &info);
- if ( info == gestaltOriginalQD ) {
- SDL_SetError("Color Quickdraw not available");
- return(-1);
- }
-
- /* Start ROMintosh events */
- Mac_InitEvents(this);
-
- /* Get a handle to the main monitor */
- SDL_Display = GetMainDevice();
-
- /* Determine the current screen size */
- this->info.current_w = (**SDL_Display).gdRect.right;
- this->info.current_h = (**SDL_Display).gdRect.bottom;
-
- /* Determine pixel format */
- vformat->BitsPerPixel = (**(**SDL_Display).gdPMap).pixelSize;
- switch (vformat->BitsPerPixel) {
- case 16: /* 5-5-5 RGB */
- vformat->Rmask = 0x00007c00;
- vformat->Gmask = 0x000003e0;
- vformat->Bmask = 0x0000001f;
- break;
- default:
- break;
- }
-
- /* Create our palette */
- SDL_CTab = (CTabHandle)NewHandle(sizeof(ColorSpec)*256 + 8);
- if ( SDL_CTab == nil ) {
- SDL_OutOfMemory();
- return(-1);
- }
- (**SDL_CTab).ctSeed = GetCTSeed();
- (**SDL_CTab).ctFlags = 0;
- (**SDL_CTab).ctSize = 255;
- CTabChanged(SDL_CTab);
- SDL_CPal = NewPalette(256, SDL_CTab, pmExplicit+pmTolerant, 0);
-
- /* Get a list of available fullscreen modes */
- SDL_modelist = (SDL_Rect **)SDL_malloc((1+1)*sizeof(SDL_Rect *));
- if ( SDL_modelist ) {
- SDL_modelist[0] = (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
- if ( SDL_modelist[0] ) {
- SDL_modelist[0]->x = 0;
- SDL_modelist[0]->y = 0;
- SDL_modelist[0]->w = (**SDL_Display).gdRect.right;
- SDL_modelist[0]->h = (**SDL_Display).gdRect.bottom;
- }
- SDL_modelist[1] = NULL;
- }
-
- /* Fill in some window manager capabilities */
- this->info.wm_available = 1;
-
- /* We're done! */
- return(0);
-}
-
-static SDL_Rect **ROM_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- if ( this->screen->format->BitsPerPixel == format->BitsPerPixel ) {
- if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
- return(SDL_modelist);
- } else {
- return((SDL_Rect **)-1);
- }
- } else {
- return((SDL_Rect **)0);
- }
-}
-
-static void ROM_HideMenuBar(_THIS)
-{
-#if !TARGET_API_MAC_CARBON /* This seems not to be available? -sts Aug 2000 */
- RgnHandle drawRgn = nil;
- RgnHandle tempRgn = nil;
- RgnHandle grayRgn = nil;
- WindowPtr window = nil;
- GDHandle gd = nil;
- GrafPtr savePort;
- long response;
- short height;
- EventRecord theEvent;
-
- height = GetMBarHeight();
-
- if ( height > 0 ) {
- tempRgn = NewRgn();
- drawRgn = NewRgn();
- gSaveGrayRgn = NewRgn();
- if ( ! tempRgn || ! drawRgn || ! gSaveGrayRgn ) {
- goto CLEANUP;
- }
- grayRgn = GetGrayRgn(); /* No need to check for this */
-
- GetPort(&savePort);
-
- /* Hide the control strip if it's present, and record its
- previous position into the dirty region for redrawing.
- This isn't necessary, but may help catch stray bits. */
- CopyRgn(grayRgn, tempRgn);
- if (!Gestalt(gestaltControlStripAttr, &response) &&
- (response & (1L << gestaltControlStripExists))) {
- gSaveCSVis = SBIsControlStripVisible();
- if (gSaveCSVis)
- SBShowHideControlStrip(false);
- }
- DiffRgn(grayRgn, tempRgn, drawRgn);
-
- /* Save the gray region once the control strip is hidden*/
- CopyRgn(grayRgn, gSaveGrayRgn);
-
- /* Change the menu height in lowmem */
- gSaveMenuBar = height;
- LMSetMBarHeight(0);
-
- /* Walk the monitor rectangles, and combine any pieces that
- aren't in GrayRgn: menubar, round corners, fake floaters. */
- for(gd = GetDeviceList(); gd; gd = GetNextDevice(gd))
- {
- if (!TestDeviceAttribute(gd, screenDevice)) continue;
- if (!TestDeviceAttribute(gd, screenActive)) continue;
-
- RectRgn(tempRgn, &(*gd)->gdRect); /* Get the whole screen */
- DiffRgn(tempRgn, grayRgn, tempRgn); /* Subtract out GrayRgn */
- UnionRgn(tempRgn, drawRgn, drawRgn);/* Combine all the bits */
- }
-
- /* Add the bits into the GrayRgn */
- UnionRgn(drawRgn, grayRgn, grayRgn);
-
- /* Modify the vis regions of exposed windows */
- window = (FrontWindow()) ? FrontWindow() : (WindowPtr) -1L;
- PaintBehind(window, drawRgn);
- CalcVisBehind(window, drawRgn);
-
- SetPort(savePort);
-
- /* Yield time so that floaters can catch up */
- EventAvail(0, &theEvent);
- EventAvail(0, &theEvent);
- EventAvail(0, &theEvent);
- EventAvail(0, &theEvent);
- }
-
-CLEANUP:
-
- if (tempRgn) DisposeRgn(tempRgn);
- if (drawRgn) DisposeRgn(drawRgn);
-#endif /* !TARGET_API_MAC_CARBON */
-}
-
-static void ROM_ShowMenuBar(_THIS)
-{
-#if !TARGET_API_MAC_CARBON /* This seems not to be available? -sts Aug 2000 */
- RgnHandle drawRgn = nil;
- RgnHandle menuRgn = nil;
- RgnHandle tempRgn = nil;
- RgnHandle grayRgn = nil;
- WindowPtr window = nil;
- GrafPtr wMgrPort;
- GrafPtr savePort;
- Rect menuRect;
- long response;
- short height;
- EventRecord theEvent;
- RGBColor saveRGB;
- RGBColor blackRGB = { 0, 0, 0 };
-
- height = GetMBarHeight();
-
- if ((height <= 0) && (gSaveMenuBar > 0)) {
- drawRgn = NewRgn();
- menuRgn = NewRgn();
- tempRgn = NewRgn();
- if ( ! tempRgn || ! drawRgn || ! gSaveGrayRgn ) {
- goto CLEANUP;
- }
- grayRgn = GetGrayRgn(); /* No need to check for this */
-
- GetPort(&savePort);
- GetWMgrPort(&wMgrPort);
-
- /* Set the height properly */
- LMSetMBarHeight(gSaveMenuBar);
-
- /* Restore the old GrayRgn: rounded corners, etc, but not
- the menubar -- subtract that out first! */
- if (gSaveGrayRgn)
- {
- menuRect = (*GetMainDevice())->gdRect;
- menuRect.bottom = menuRect.top + gSaveMenuBar;
- RectRgn(menuRgn, &menuRect);
-
- DiffRgn(grayRgn, gSaveGrayRgn, drawRgn); /* What do we inval? */
- DiffRgn(drawRgn, menuRgn, drawRgn); /* Clip out the menu */
-
- /* Now redraw the corners and other bits black */
- SetPort(wMgrPort);
- GetClip(tempRgn);
- SetClip(drawRgn);
- GetForeColor(&saveRGB);
- RGBForeColor(&blackRGB);
- PaintRgn(drawRgn);
- RGBForeColor(&saveRGB);
- SetClip(tempRgn);
- SetPort(savePort);
-
- UnionRgn(drawRgn, menuRgn, drawRgn); /* Put back the menu */
-
- /* Now actually restore the GrayRgn */
- CopyRgn(gSaveGrayRgn, grayRgn);
- DisposeRgn(gSaveGrayRgn);
- gSaveGrayRgn = nil;
- }
-
- /* Modify the vis regions of exposed windows and draw menubar */
- window = (FrontWindow()) ? FrontWindow() : (WindowPtr) -1L;
- PaintBehind(window, drawRgn);
- CalcVisBehind(window, drawRgn);
- DrawMenuBar();
-
- SetPort(savePort);
- gSaveMenuBar = 0;
-
- /* Now show the control strip if it's present */
- if (!Gestalt(gestaltControlStripAttr, &response) &&
- (response & (1L << gestaltControlStripExists)))
- {
- if (gSaveCSVis && !SBIsControlStripVisible())
- SBShowHideControlStrip(true);
- gSaveCSVis = true;
- }
-
- /* Yield time so that floaters can catch up */
- EventAvail(0, &theEvent);
- EventAvail(0, &theEvent);
- EventAvail(0, &theEvent);
- EventAvail(0, &theEvent);
- }
-
-CLEANUP:
-
- if (drawRgn) DisposeRgn(drawRgn);
- if (menuRgn) DisposeRgn(menuRgn);
- if (tempRgn) DisposeRgn(tempRgn);
-#endif /* !TARGET_API_MAC_CARBON */
-}
-
-/* Various screen update functions available */
-static void ROM_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
-static void ROM_WindowUpdate(_THIS, int numrects, SDL_Rect *rects);
-
-static void ROM_UnsetVideoMode(_THIS, SDL_Surface *current)
-{
- /* Free the current window, if any */
- if ( SDL_Window != nil ) {
- GWorldPtr memworld;
-
- /* Handle OpenGL support */
- Mac_GL_Quit(this);
-
- memworld = (GWorldPtr)GetWRefCon(SDL_Window);
- if ( memworld != nil ) {
- UnlockPixels(GetGWorldPixMap(memworld));
- DisposeGWorld(memworld);
- }
- if ( (current->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
-#if USE_QUICKTIME
- EndFullScreen(fullscreen_ctx, nil);
- SDL_Window = nil;
-#else
- ROM_ShowMenuBar(this);
-#endif
- }
- }
- current->pixels = NULL;
- current->flags &= ~(SDL_HWSURFACE|SDL_FULLSCREEN);
-}
-
-static SDL_Surface *ROM_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- Rect wrect, orect;
-#if TARGET_API_MAC_CARBON
- Rect tmprect;
-#endif
-
- /* Free any previous video mode */
- ROM_UnsetVideoMode(this, current);
-
- /* Create the ROM window and SDL video surface */
- current->flags = 0; /* Clear flags */
- current->w = width;
- current->h = height;
- SetRect(&wrect, 0, 0, width, height);
- if ( SDL_Window ) {
- /* If we recreate the window, don't move it around */
-#if TARGET_API_MAC_CARBON
- orect = *GetWindowPortBounds(SDL_Window, &tmprect);
-#else
- orect = SDL_Window->portRect;
-#endif
- OffsetRect(&wrect, orect.left, orect.top);
- } else {
- /* Center the window the first time we show it */
- OffsetRect(&wrect,
- (SDL_modelist[0]->w-width)/2, (SDL_modelist[0]->h-height)/2);
- }
-
-#if defined(__MACOSX__) && !USE_QUICKTIME
- /* Hum.. fullscreen mode is broken */
- flags &= ~SDL_FULLSCREEN;
-#endif
- if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
- /* Create the fullscreen window and use screen bits */
- current->flags |= SDL_HWSURFACE|SDL_FULLSCREEN;
- if ( SDL_Window ) {
- DisposeWindow(SDL_Window);
- }
-#if USE_QUICKTIME
- BeginFullScreen(&fullscreen_ctx, nil, 0,0, &SDL_Window, nil, 0);
-#else
- SDL_Window = NewCWindow(nil, &wrect, "\p", true, plainDBox,
- (WindowPtr)-1, false, 0);
- ROM_HideMenuBar(this);
-#endif
- current->pitch = (**(**SDL_Display).gdPMap).rowBytes & 0x3FFF;
- current->pixels = (**(**SDL_Display).gdPMap).baseAddr;
- this->UpdateRects = ROM_DirectUpdate;
- } else {
- GWorldPtr memworld;
- PixMapHandle pixmap;
- int style;
-
- style = noGrowDocProc;
- if ( flags & SDL_NOFRAME ) {
- style = plainDBox;
- current->flags |= SDL_NOFRAME;
- } else
- if ( flags & SDL_RESIZABLE ) {
- style = zoomDocProc;
- current->flags |= SDL_RESIZABLE;
- }
- if ( SDL_Window && (style == current_style) ) {
- /* Resize existing window, if necessary */
- if ( ((orect.right-orect.left) != width) ||
- ((orect.bottom-orect.top) != height) ) {
- SizeWindow(SDL_Window, width, height, false);
- }
- } else {
- /* Recreate the window in the new style */
- if ( SDL_Window ) {
- DisposeWindow(SDL_Window);
- }
- SDL_Window = NewCWindow(nil, &wrect, "\p", true,
- style, (WindowPtr)-1, true, 0);
-
- /* Set the window title, if any */
- { char *title;
- SDL_WM_GetCaption(&title, NULL);
- if ( title ) {
- Mac_SetCaption(this, title, NULL);
- }
- }
- }
- current_style = style;
- SetPalette(SDL_Window, SDL_CPal, false);
- ActivatePalette(SDL_Window);
- if ( NewGWorld(&memworld, 0,
-#if TARGET_API_MAC_CARBON
- GetWindowPortBounds(SDL_Window, &tmprect),
-#else
- &SDL_Window->portRect,
-#endif
- SDL_CTab, nil, 0) != noErr ) {
- SDL_SetError("NewGWorld() failed");
- return(NULL);
- }
- SetWRefCon(SDL_Window, (long)memworld);
- pixmap = GetGWorldPixMap(memworld);
- LockPixels(pixmap);
- current->pitch = (**pixmap).rowBytes & 0x3FFF;
- current->pixels = GetPixBaseAddr(pixmap);
- this->UpdateRects = ROM_WindowUpdate;
- }
- SetPortWindowPort(SDL_Window);
- SelectWindow(SDL_Window);
-
- /* Handle OpenGL support */
- if ( flags & SDL_OPENGL ) {
- if ( Mac_GL_Init(this) == 0 ) {
- current->flags |= SDL_OPENGL;
- } else {
- current = NULL;
- }
- }
-
- if ( (flags & SDL_HWPALETTE) && (flags & SDL_FULLSCREEN) )
- current->flags |= SDL_HWPALETTE;
-
- /* We're live! */
- return(current);
-}
-
-/* We don't actually allow hardware surfaces other than the main one */
-static int ROM_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- return(-1);
-}
-static void ROM_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-static int ROM_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- return(0);
-}
-static void ROM_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-static void ROM_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- /* The application is already updating the visible video memory */
- return;
-}
-
-static void ROM_WindowUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- GWorldPtr memworld;
- GrafPtr saveport;
- CGrafPtr thePort;
- const BitMap *memBits;
- const BitMap *winBits;
- int i;
- Rect update;
-
- /* Copy from the offscreen GWorld to the window port */
- GetPort(&saveport);
- SetPortWindowPort(SDL_Window);
- thePort = GetWindowPort(SDL_Window);
- memworld = (GWorldPtr)GetWRefCon(SDL_Window);
-#if TARGET_API_MAC_CARBON && ACCESSOR_CALLS_ARE_FUNCTIONS
- memBits = GetPortBitMapForCopyBits((CGrafPtr) memworld);
-#else
- memBits = &((GrafPtr)memworld)->portBits;
-#endif
-#if TARGET_API_MAC_CARBON && ACCESSOR_CALLS_ARE_FUNCTIONS
- winBits = GetPortBitMapForCopyBits(thePort);
-#else
- winBits = &SDL_Window->portBits;
-#endif
- for ( i=0; i<numrects; ++i ) {
- update.left = rects[i].x;
- update.right = rects[i].x+rects[i].w;
- update.top = rects[i].y;
- update.bottom = rects[i].y+rects[i].h;
- CopyBits(memBits, winBits,
- &update, &update, srcCopy, nil);
- }
-#if TARGET_API_MAC_CARBON
- if ( QDIsPortBuffered(thePort) ) {
- QDFlushPortBuffer(thePort, NULL);
- }
-#endif
- SetPort(saveport);
-}
-
-static int ROM_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- CTabHandle cTab;
- int i;
-
- /* Get the colortable from the either the display or window */
- if ( (this->screen->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
- cTab = (**(**SDL_Display).gdPMap).pmTable;
- } else {
- cTab = SDL_CTab;
- }
-
- /* Verify the range of colors */
- if ( (firstcolor+ncolors) > ((**cTab).ctSize+1) ) {
- return(0);
- }
-
- /* Set the screen palette and update the display */
- for ( i=0; i< ncolors; ++i ) {
- int j = firstcolor + i;
- (**cTab).ctTable[j].value = j;
- (**cTab).ctTable[j].rgb.red = colors[i].r << 8 | colors[i].r;
- (**cTab).ctTable[j].rgb.green = colors[i].g << 8 | colors[i].g;
- (**cTab).ctTable[j].rgb.blue = colors[i].b << 8 | colors[i].b;
- }
-
-#if 0
- if ( (this->screen->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN )
-#endif
- {
- GDevice **odisplay;
- odisplay = GetGDevice();
- SetGDevice(SDL_Display);
- SetEntries(0, (**cTab).ctSize, (ColorSpec *)&(**cTab).ctTable);
- SetGDevice(odisplay);
- }
- return(1);
-}
-
-void ROM_VideoQuit(_THIS)
-{
- int i;
-
- /* Free current video mode */
- ROM_UnsetVideoMode(this, this->screen);
- if ( SDL_Window ) {
- DisposeWindow(SDL_Window);
- SDL_Window = nil;
- }
-
- /* Free palette and restore original one */
- if ( SDL_CTab != nil ) {
- DisposeHandle((Handle)SDL_CTab);
- SDL_CTab = nil;
- }
- if ( SDL_CPal != nil ) {
- DisposePalette(SDL_CPal);
- SDL_CPal = nil;
- }
- RestoreDeviceClut(GetMainDevice());
-
-#if SDL_MACCLASSIC_GAMMA_SUPPORT
- Mac_QuitGamma(this);
-#endif
-
- /* Free list of video modes */
- if ( SDL_modelist != NULL ) {
- for ( i=0; SDL_modelist[i]; ++i ) {
- SDL_free(SDL_modelist[i]);
- }
- SDL_free(SDL_modelist);
- SDL_modelist = NULL;
- }
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/macrom/SDL_romvideo.h b/distrib/sdl-1.2.12/src/video/macrom/SDL_romvideo.h
deleted file mode 100644
index 96910d4..0000000
--- a/distrib/sdl-1.2.12/src/video/macrom/SDL_romvideo.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_romvideo_h
-#define _SDL_romvideo_h
-
-#include "../maccommon/SDL_lowvideo.h"
-
-#endif /* _SDL_romvideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/math_private.h b/distrib/sdl-1.2.12/src/video/math_private.h
deleted file mode 100644
index c09a846..0000000
--- a/distrib/sdl-1.2.12/src/video/math_private.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
- *
- * Developed at SunPro, a Sun Microsystems, Inc. business.
- * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice
- * is preserved.
- * ====================================================
- */
-
-/*
- * from: @(#)fdlibm.h 5.1 93/09/24
- * $Id: math_private.h 1969 2006-02-24 09:57:14Z slouken $
- */
-
-#ifndef _MATH_PRIVATE_H_
-#define _MATH_PRIVATE_H_
-
-#include "SDL_name.h"
-#include "SDL_endian.h"
-
-#define huge really_big /* huge is a reserved keyword in VC++ 6.0 */
-#define u_int32_t uint32_t
-
-/* The original fdlibm code used statements like:
- n0 = ((*(int*)&one)>>29)^1; * index of high word *
- ix0 = *(n0+(int*)&x); * high word of x *
- ix1 = *((1-n0)+(int*)&x); * low word of x *
- to dig two 32 bit words out of the 64 bit IEEE floating point
- value. That is non-ANSI, and, moreover, the gcc instruction
- scheduler gets it wrong. We instead use the following macros.
- Unlike the original code, we determine the endianness at compile
- time, not at run time; I don't see much benefit to selecting
- endianness at run time. */
-
-/* A union which permits us to convert between a double and two 32 bit
- ints. */
-
-/*
- * Math on arm is special:
- * For FPA, float words are always big-endian.
- * For VFP, floats words follow the memory system mode.
- */
-
-#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) || \
- (!defined(__VFP_FP__) && (defined(__arm__) || defined(__thumb__)))
-
-typedef union
-{
- double value;
- struct
- {
- u_int32_t msw;
- u_int32_t lsw;
- } parts;
-} ieee_double_shape_type;
-
-#else
-
-typedef union
-{
- double value;
- struct
- {
- u_int32_t lsw;
- u_int32_t msw;
- } parts;
-} ieee_double_shape_type;
-
-#endif
-
-/* Get two 32 bit ints from a double. */
-
-#define EXTRACT_WORDS(ix0,ix1,d) \
-do { \
- ieee_double_shape_type ew_u; \
- ew_u.value = (d); \
- (ix0) = ew_u.parts.msw; \
- (ix1) = ew_u.parts.lsw; \
-} while (0)
-
-/* Get the more significant 32 bit int from a double. */
-
-#define GET_HIGH_WORD(i,d) \
-do { \
- ieee_double_shape_type gh_u; \
- gh_u.value = (d); \
- (i) = gh_u.parts.msw; \
-} while (0)
-
-/* Get the less significant 32 bit int from a double. */
-
-#define GET_LOW_WORD(i,d) \
-do { \
- ieee_double_shape_type gl_u; \
- gl_u.value = (d); \
- (i) = gl_u.parts.lsw; \
-} while (0)
-
-/* Set a double from two 32 bit ints. */
-
-#define INSERT_WORDS(d,ix0,ix1) \
-do { \
- ieee_double_shape_type iw_u; \
- iw_u.parts.msw = (ix0); \
- iw_u.parts.lsw = (ix1); \
- (d) = iw_u.value; \
-} while (0)
-
-/* Set the more significant 32 bits of a double from an int. */
-
-#define SET_HIGH_WORD(d,v) \
-do { \
- ieee_double_shape_type sh_u; \
- sh_u.value = (d); \
- sh_u.parts.msw = (v); \
- (d) = sh_u.value; \
-} while (0)
-
-/* Set the less significant 32 bits of a double from an int. */
-
-#define SET_LOW_WORD(d,v) \
-do { \
- ieee_double_shape_type sl_u; \
- sl_u.value = (d); \
- sl_u.parts.lsw = (v); \
- (d) = sl_u.value; \
-} while (0)
-
-/* A union which permits us to convert between a float and a 32 bit
- int. */
-
-typedef union
-{
- float value;
- u_int32_t word;
-} ieee_float_shape_type;
-
-/* Get a 32 bit int from a float. */
-
-#define GET_FLOAT_WORD(i,d) \
-do { \
- ieee_float_shape_type gf_u; \
- gf_u.value = (d); \
- (i) = gf_u.word; \
-} while (0)
-
-/* Set a float from a 32 bit int. */
-
-#define SET_FLOAT_WORD(d,i) \
-do { \
- ieee_float_shape_type sf_u; \
- sf_u.word = (i); \
- (d) = sf_u.value; \
-} while (0)
-
-
-#ifdef __STDC__
-static const double
-#else
-static double
-#endif
-zero = 0.0,
-one = 1.0,
-two = 2.0,
-two53 = 9007199254740992.0, /* 0x43400000, 0x00000000 */
-two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
-twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
-huge = 1.0e+300,
-tiny = 1.0e-300;
-
-#endif /* _MATH_PRIVATE_H_ */
diff --git a/distrib/sdl-1.2.12/src/video/mmx.h b/distrib/sdl-1.2.12/src/video/mmx.h
deleted file mode 100644
index 396c432..0000000
--- a/distrib/sdl-1.2.12/src/video/mmx.h
+++ /dev/null
@@ -1,704 +0,0 @@
-/* mmx.h
-
- MultiMedia eXtensions GCC interface library for IA32.
-
- To use this library, simply include this header file
- and compile with GCC. You MUST have inlining enabled
- in order for mmx_ok() to work; this can be done by
- simply using -O on the GCC command line.
-
- Compiling with -DMMX_TRACE will cause detailed trace
- output to be sent to stderr for each mmx operation.
- This adds lots of code, and obviously slows execution to
- a crawl, but can be very useful for debugging.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
- LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR ANY PARTICULAR PURPOSE.
-
- 1997-99 by H. Dietz and R. Fisher
-
- Notes:
- It appears that the latest gas has the pand problem fixed, therefore
- I'll undefine BROKEN_PAND by default.
-*/
-
-#ifndef _MMX_H
-#define _MMX_H
-
-
-/* Warning: at this writing, the version of GAS packaged
- with most Linux distributions does not handle the
- parallel AND operation mnemonic correctly. If the
- symbol BROKEN_PAND is defined, a slower alternative
- coding will be used. If execution of mmxtest results
- in an illegal instruction fault, define this symbol.
-*/
-#undef BROKEN_PAND
-
-
-/* The type of an value that fits in an MMX register
- (note that long long constant values MUST be suffixed
- by LL and unsigned long long values by ULL, lest
- they be truncated by the compiler)
-*/
-typedef union {
- long long q; /* Quadword (64-bit) value */
- unsigned long long uq; /* Unsigned Quadword */
- int d[2]; /* 2 Doubleword (32-bit) values */
- unsigned int ud[2]; /* 2 Unsigned Doubleword */
- short w[4]; /* 4 Word (16-bit) values */
- unsigned short uw[4]; /* 4 Unsigned Word */
- char b[8]; /* 8 Byte (8-bit) values */
- unsigned char ub[8]; /* 8 Unsigned Byte */
- float s[2]; /* Single-precision (32-bit) value */
-} __attribute__ ((aligned (8))) mmx_t; /* On an 8-byte (64-bit) boundary */
-
-
-#if 0
-/* Function to test if multimedia instructions are supported...
-*/
-inline extern int
-mm_support(void)
-{
- /* Returns 1 if MMX instructions are supported,
- 3 if Cyrix MMX and Extended MMX instructions are supported
- 5 if AMD MMX and 3DNow! instructions are supported
- 0 if hardware does not support any of these
- */
- register int rval = 0;
-
- __asm__ __volatile__ (
- /* See if CPUID instruction is supported ... */
- /* ... Get copies of EFLAGS into eax and ecx */
- "pushf\n\t"
- "popl %%eax\n\t"
- "movl %%eax, %%ecx\n\t"
-
- /* ... Toggle the ID bit in one copy and store */
- /* to the EFLAGS reg */
- "xorl $0x200000, %%eax\n\t"
- "push %%eax\n\t"
- "popf\n\t"
-
- /* ... Get the (hopefully modified) EFLAGS */
- "pushf\n\t"
- "popl %%eax\n\t"
-
- /* ... Compare and test result */
- "xorl %%eax, %%ecx\n\t"
- "testl $0x200000, %%ecx\n\t"
- "jz NotSupported1\n\t" /* CPUID not supported */
-
-
- /* Get standard CPUID information, and
- go to a specific vendor section */
- "movl $0, %%eax\n\t"
- "cpuid\n\t"
-
- /* Check for Intel */
- "cmpl $0x756e6547, %%ebx\n\t"
- "jne TryAMD\n\t"
- "cmpl $0x49656e69, %%edx\n\t"
- "jne TryAMD\n\t"
- "cmpl $0x6c65746e, %%ecx\n"
- "jne TryAMD\n\t"
- "jmp Intel\n\t"
-
- /* Check for AMD */
- "\nTryAMD:\n\t"
- "cmpl $0x68747541, %%ebx\n\t"
- "jne TryCyrix\n\t"
- "cmpl $0x69746e65, %%edx\n\t"
- "jne TryCyrix\n\t"
- "cmpl $0x444d4163, %%ecx\n"
- "jne TryCyrix\n\t"
- "jmp AMD\n\t"
-
- /* Check for Cyrix */
- "\nTryCyrix:\n\t"
- "cmpl $0x69727943, %%ebx\n\t"
- "jne NotSupported2\n\t"
- "cmpl $0x736e4978, %%edx\n\t"
- "jne NotSupported3\n\t"
- "cmpl $0x64616574, %%ecx\n\t"
- "jne NotSupported4\n\t"
- /* Drop through to Cyrix... */
-
-
- /* Cyrix Section */
- /* See if extended CPUID level 80000001 is supported */
- /* The value of CPUID/80000001 for the 6x86MX is undefined
- according to the Cyrix CPU Detection Guide (Preliminary
- Rev. 1.01 table 1), so we'll check the value of eax for
- CPUID/0 to see if standard CPUID level 2 is supported.
- According to the table, the only CPU which supports level
- 2 is also the only one which supports extended CPUID levels.
- */
- "cmpl $0x2, %%eax\n\t"
- "jne MMXtest\n\t" /* Use standard CPUID instead */
-
- /* Extended CPUID supported (in theory), so get extended
- features */
- "movl $0x80000001, %%eax\n\t"
- "cpuid\n\t"
- "testl $0x00800000, %%eax\n\t" /* Test for MMX */
- "jz NotSupported5\n\t" /* MMX not supported */
- "testl $0x01000000, %%eax\n\t" /* Test for Ext'd MMX */
- "jnz EMMXSupported\n\t"
- "movl $1, %0:\n\n\t" /* MMX Supported */
- "jmp Return\n\n"
- "EMMXSupported:\n\t"
- "movl $3, %0:\n\n\t" /* EMMX and MMX Supported */
- "jmp Return\n\t"
-
-
- /* AMD Section */
- "AMD:\n\t"
-
- /* See if extended CPUID is supported */
- "movl $0x80000000, %%eax\n\t"
- "cpuid\n\t"
- "cmpl $0x80000000, %%eax\n\t"
- "jl MMXtest\n\t" /* Use standard CPUID instead */
-
- /* Extended CPUID supported, so get extended features */
- "movl $0x80000001, %%eax\n\t"
- "cpuid\n\t"
- "testl $0x00800000, %%edx\n\t" /* Test for MMX */
- "jz NotSupported6\n\t" /* MMX not supported */
- "testl $0x80000000, %%edx\n\t" /* Test for 3DNow! */
- "jnz ThreeDNowSupported\n\t"
- "movl $1, %0:\n\n\t" /* MMX Supported */
- "jmp Return\n\n"
- "ThreeDNowSupported:\n\t"
- "movl $5, %0:\n\n\t" /* 3DNow! and MMX Supported */
- "jmp Return\n\t"
-
-
- /* Intel Section */
- "Intel:\n\t"
-
- /* Check for MMX */
- "MMXtest:\n\t"
- "movl $1, %%eax\n\t"
- "cpuid\n\t"
- "testl $0x00800000, %%edx\n\t" /* Test for MMX */
- "jz NotSupported7\n\t" /* MMX Not supported */
- "movl $1, %0:\n\n\t" /* MMX Supported */
- "jmp Return\n\t"
-
- /* Nothing supported */
- "\nNotSupported1:\n\t"
- "#movl $101, %0:\n\n\t"
- "\nNotSupported2:\n\t"
- "#movl $102, %0:\n\n\t"
- "\nNotSupported3:\n\t"
- "#movl $103, %0:\n\n\t"
- "\nNotSupported4:\n\t"
- "#movl $104, %0:\n\n\t"
- "\nNotSupported5:\n\t"
- "#movl $105, %0:\n\n\t"
- "\nNotSupported6:\n\t"
- "#movl $106, %0:\n\n\t"
- "\nNotSupported7:\n\t"
- "#movl $107, %0:\n\n\t"
- "movl $0, %0:\n\n\t"
-
- "Return:\n\t"
- : "=a" (rval)
- : /* no input */
- : "eax", "ebx", "ecx", "edx"
- );
-
- /* Return */
- return(rval);
-}
-
-/* Function to test if mmx instructions are supported...
-*/
-inline extern int
-mmx_ok(void)
-{
- /* Returns 1 if MMX instructions are supported, 0 otherwise */
- return ( mm_support() & 0x1 );
-}
-#endif
-
-/* Helper functions for the instruction macros that follow...
- (note that memory-to-register, m2r, instructions are nearly
- as efficient as register-to-register, r2r, instructions;
- however, memory-to-memory instructions are really simulated
- as a convenience, and are only 1/3 as efficient)
-*/
-#ifdef MMX_TRACE
-
-/* Include the stuff for printing a trace to stderr...
-*/
-
-#define mmx_i2r(op, imm, reg) \
- { \
- mmx_t mmx_trace; \
- mmx_trace.uq = (imm); \
- printf(#op "_i2r(" #imm "=0x%08x%08x, ", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- __asm__ __volatile__ ("movq %%" #reg ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- printf(#reg "=0x%08x%08x) => ", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- __asm__ __volatile__ (#op " %0, %%" #reg \
- : /* nothing */ \
- : "X" (imm)); \
- __asm__ __volatile__ ("movq %%" #reg ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- printf(#reg "=0x%08x%08x\n", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- }
-
-#define mmx_m2r(op, mem, reg) \
- { \
- mmx_t mmx_trace; \
- mmx_trace = (mem); \
- printf(#op "_m2r(" #mem "=0x%08x%08x, ", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- __asm__ __volatile__ ("movq %%" #reg ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- printf(#reg "=0x%08x%08x) => ", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- __asm__ __volatile__ (#op " %0, %%" #reg \
- : /* nothing */ \
- : "X" (mem)); \
- __asm__ __volatile__ ("movq %%" #reg ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- printf(#reg "=0x%08x%08x\n", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- }
-
-#define mmx_r2m(op, reg, mem) \
- { \
- mmx_t mmx_trace; \
- __asm__ __volatile__ ("movq %%" #reg ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- printf(#op "_r2m(" #reg "=0x%08x%08x, ", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- mmx_trace = (mem); \
- printf(#mem "=0x%08x%08x) => ", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- __asm__ __volatile__ (#op " %%" #reg ", %0" \
- : "=X" (mem) \
- : /* nothing */ ); \
- mmx_trace = (mem); \
- printf(#mem "=0x%08x%08x\n", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- }
-
-#define mmx_r2r(op, regs, regd) \
- { \
- mmx_t mmx_trace; \
- __asm__ __volatile__ ("movq %%" #regs ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- printf(#op "_r2r(" #regs "=0x%08x%08x, ", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- __asm__ __volatile__ ("movq %%" #regd ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- printf(#regd "=0x%08x%08x) => ", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- __asm__ __volatile__ (#op " %" #regs ", %" #regd); \
- __asm__ __volatile__ ("movq %%" #regd ", %0" \
- : "=X" (mmx_trace) \
- : /* nothing */ ); \
- printf(#regd "=0x%08x%08x\n", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- }
-
-#define mmx_m2m(op, mems, memd) \
- { \
- mmx_t mmx_trace; \
- mmx_trace = (mems); \
- printf(#op "_m2m(" #mems "=0x%08x%08x, ", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- mmx_trace = (memd); \
- printf(#memd "=0x%08x%08x) => ", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- __asm__ __volatile__ ("movq %0, %%mm0\n\t" \
- #op " %1, %%mm0\n\t" \
- "movq %%mm0, %0" \
- : "=X" (memd) \
- : "X" (mems)); \
- mmx_trace = (memd); \
- printf(#memd "=0x%08x%08x\n", \
- mmx_trace.d[1], mmx_trace.d[0]); \
- }
-
-#else
-
-/* These macros are a lot simpler without the tracing...
-*/
-
-#define mmx_i2r(op, imm, reg) \
- __asm__ __volatile__ (#op " %0, %%" #reg \
- : /* nothing */ \
- : "X" (imm) )
-
-#define mmx_m2r(op, mem, reg) \
- __asm__ __volatile__ (#op " %0, %%" #reg \
- : /* nothing */ \
- : "m" (mem))
-
-#define mmx_r2m(op, reg, mem) \
- __asm__ __volatile__ (#op " %%" #reg ", %0" \
- : "=X" (mem) \
- : /* nothing */ )
-
-#define mmx_r2r(op, regs, regd) \
- __asm__ __volatile__ (#op " %" #regs ", %" #regd)
-
-#define mmx_m2m(op, mems, memd) \
- __asm__ __volatile__ ("movq %0, %%mm0\n\t" \
- #op " %1, %%mm0\n\t" \
- "movq %%mm0, %0" \
- : "=X" (memd) \
- : "X" (mems))
-
-#endif
-
-
-/* 1x64 MOVe Quadword
- (this is both a load and a store...
- in fact, it is the only way to store)
-*/
-#define movq_m2r(var, reg) mmx_m2r(movq, var, reg)
-#define movq_r2m(reg, var) mmx_r2m(movq, reg, var)
-#define movq_r2r(regs, regd) mmx_r2r(movq, regs, regd)
-#define movq(vars, vard) \
- __asm__ __volatile__ ("movq %1, %%mm0\n\t" \
- "movq %%mm0, %0" \
- : "=X" (vard) \
- : "X" (vars))
-
-
-/* 1x32 MOVe Doubleword
- (like movq, this is both load and store...
- but is most useful for moving things between
- mmx registers and ordinary registers)
-*/
-#define movd_m2r(var, reg) mmx_m2r(movd, var, reg)
-#define movd_r2m(reg, var) mmx_r2m(movd, reg, var)
-#define movd_r2r(regs, regd) mmx_r2r(movd, regs, regd)
-#define movd(vars, vard) \
- __asm__ __volatile__ ("movd %1, %%mm0\n\t" \
- "movd %%mm0, %0" \
- : "=X" (vard) \
- : "X" (vars))
-
-
-/* 2x32, 4x16, and 8x8 Parallel ADDs
-*/
-#define paddd_m2r(var, reg) mmx_m2r(paddd, var, reg)
-#define paddd_r2r(regs, regd) mmx_r2r(paddd, regs, regd)
-#define paddd(vars, vard) mmx_m2m(paddd, vars, vard)
-
-#define paddw_m2r(var, reg) mmx_m2r(paddw, var, reg)
-#define paddw_r2r(regs, regd) mmx_r2r(paddw, regs, regd)
-#define paddw(vars, vard) mmx_m2m(paddw, vars, vard)
-
-#define paddb_m2r(var, reg) mmx_m2r(paddb, var, reg)
-#define paddb_r2r(regs, regd) mmx_r2r(paddb, regs, regd)
-#define paddb(vars, vard) mmx_m2m(paddb, vars, vard)
-
-
-/* 4x16 and 8x8 Parallel ADDs using Saturation arithmetic
-*/
-#define paddsw_m2r(var, reg) mmx_m2r(paddsw, var, reg)
-#define paddsw_r2r(regs, regd) mmx_r2r(paddsw, regs, regd)
-#define paddsw(vars, vard) mmx_m2m(paddsw, vars, vard)
-
-#define paddsb_m2r(var, reg) mmx_m2r(paddsb, var, reg)
-#define paddsb_r2r(regs, regd) mmx_r2r(paddsb, regs, regd)
-#define paddsb(vars, vard) mmx_m2m(paddsb, vars, vard)
-
-
-/* 4x16 and 8x8 Parallel ADDs using Unsigned Saturation arithmetic
-*/
-#define paddusw_m2r(var, reg) mmx_m2r(paddusw, var, reg)
-#define paddusw_r2r(regs, regd) mmx_r2r(paddusw, regs, regd)
-#define paddusw(vars, vard) mmx_m2m(paddusw, vars, vard)
-
-#define paddusb_m2r(var, reg) mmx_m2r(paddusb, var, reg)
-#define paddusb_r2r(regs, regd) mmx_r2r(paddusb, regs, regd)
-#define paddusb(vars, vard) mmx_m2m(paddusb, vars, vard)
-
-
-/* 2x32, 4x16, and 8x8 Parallel SUBs
-*/
-#define psubd_m2r(var, reg) mmx_m2r(psubd, var, reg)
-#define psubd_r2r(regs, regd) mmx_r2r(psubd, regs, regd)
-#define psubd(vars, vard) mmx_m2m(psubd, vars, vard)
-
-#define psubw_m2r(var, reg) mmx_m2r(psubw, var, reg)
-#define psubw_r2r(regs, regd) mmx_r2r(psubw, regs, regd)
-#define psubw(vars, vard) mmx_m2m(psubw, vars, vard)
-
-#define psubb_m2r(var, reg) mmx_m2r(psubb, var, reg)
-#define psubb_r2r(regs, regd) mmx_r2r(psubb, regs, regd)
-#define psubb(vars, vard) mmx_m2m(psubb, vars, vard)
-
-
-/* 4x16 and 8x8 Parallel SUBs using Saturation arithmetic
-*/
-#define psubsw_m2r(var, reg) mmx_m2r(psubsw, var, reg)
-#define psubsw_r2r(regs, regd) mmx_r2r(psubsw, regs, regd)
-#define psubsw(vars, vard) mmx_m2m(psubsw, vars, vard)
-
-#define psubsb_m2r(var, reg) mmx_m2r(psubsb, var, reg)
-#define psubsb_r2r(regs, regd) mmx_r2r(psubsb, regs, regd)
-#define psubsb(vars, vard) mmx_m2m(psubsb, vars, vard)
-
-
-/* 4x16 and 8x8 Parallel SUBs using Unsigned Saturation arithmetic
-*/
-#define psubusw_m2r(var, reg) mmx_m2r(psubusw, var, reg)
-#define psubusw_r2r(regs, regd) mmx_r2r(psubusw, regs, regd)
-#define psubusw(vars, vard) mmx_m2m(psubusw, vars, vard)
-
-#define psubusb_m2r(var, reg) mmx_m2r(psubusb, var, reg)
-#define psubusb_r2r(regs, regd) mmx_r2r(psubusb, regs, regd)
-#define psubusb(vars, vard) mmx_m2m(psubusb, vars, vard)
-
-
-/* 4x16 Parallel MULs giving Low 4x16 portions of results
-*/
-#define pmullw_m2r(var, reg) mmx_m2r(pmullw, var, reg)
-#define pmullw_r2r(regs, regd) mmx_r2r(pmullw, regs, regd)
-#define pmullw(vars, vard) mmx_m2m(pmullw, vars, vard)
-
-
-/* 4x16 Parallel MULs giving High 4x16 portions of results
-*/
-#define pmulhw_m2r(var, reg) mmx_m2r(pmulhw, var, reg)
-#define pmulhw_r2r(regs, regd) mmx_r2r(pmulhw, regs, regd)
-#define pmulhw(vars, vard) mmx_m2m(pmulhw, vars, vard)
-
-
-/* 4x16->2x32 Parallel Mul-ADD
- (muls like pmullw, then adds adjacent 16-bit fields
- in the multiply result to make the final 2x32 result)
-*/
-#define pmaddwd_m2r(var, reg) mmx_m2r(pmaddwd, var, reg)
-#define pmaddwd_r2r(regs, regd) mmx_r2r(pmaddwd, regs, regd)
-#define pmaddwd(vars, vard) mmx_m2m(pmaddwd, vars, vard)
-
-
-/* 1x64 bitwise AND
-*/
-#ifdef BROKEN_PAND
-#define pand_m2r(var, reg) \
- { \
- mmx_m2r(pandn, (mmx_t) -1LL, reg); \
- mmx_m2r(pandn, var, reg); \
- }
-#define pand_r2r(regs, regd) \
- { \
- mmx_m2r(pandn, (mmx_t) -1LL, regd); \
- mmx_r2r(pandn, regs, regd) \
- }
-#define pand(vars, vard) \
- { \
- movq_m2r(vard, mm0); \
- mmx_m2r(pandn, (mmx_t) -1LL, mm0); \
- mmx_m2r(pandn, vars, mm0); \
- movq_r2m(mm0, vard); \
- }
-#else
-#define pand_m2r(var, reg) mmx_m2r(pand, var, reg)
-#define pand_r2r(regs, regd) mmx_r2r(pand, regs, regd)
-#define pand(vars, vard) mmx_m2m(pand, vars, vard)
-#endif
-
-
-/* 1x64 bitwise AND with Not the destination
-*/
-#define pandn_m2r(var, reg) mmx_m2r(pandn, var, reg)
-#define pandn_r2r(regs, regd) mmx_r2r(pandn, regs, regd)
-#define pandn(vars, vard) mmx_m2m(pandn, vars, vard)
-
-
-/* 1x64 bitwise OR
-*/
-#define por_m2r(var, reg) mmx_m2r(por, var, reg)
-#define por_r2r(regs, regd) mmx_r2r(por, regs, regd)
-#define por(vars, vard) mmx_m2m(por, vars, vard)
-
-
-/* 1x64 bitwise eXclusive OR
-*/
-#define pxor_m2r(var, reg) mmx_m2r(pxor, var, reg)
-#define pxor_r2r(regs, regd) mmx_r2r(pxor, regs, regd)
-#define pxor(vars, vard) mmx_m2m(pxor, vars, vard)
-
-
-/* 2x32, 4x16, and 8x8 Parallel CoMPare for EQuality
- (resulting fields are either 0 or -1)
-*/
-#define pcmpeqd_m2r(var, reg) mmx_m2r(pcmpeqd, var, reg)
-#define pcmpeqd_r2r(regs, regd) mmx_r2r(pcmpeqd, regs, regd)
-#define pcmpeqd(vars, vard) mmx_m2m(pcmpeqd, vars, vard)
-
-#define pcmpeqw_m2r(var, reg) mmx_m2r(pcmpeqw, var, reg)
-#define pcmpeqw_r2r(regs, regd) mmx_r2r(pcmpeqw, regs, regd)
-#define pcmpeqw(vars, vard) mmx_m2m(pcmpeqw, vars, vard)
-
-#define pcmpeqb_m2r(var, reg) mmx_m2r(pcmpeqb, var, reg)
-#define pcmpeqb_r2r(regs, regd) mmx_r2r(pcmpeqb, regs, regd)
-#define pcmpeqb(vars, vard) mmx_m2m(pcmpeqb, vars, vard)
-
-
-/* 2x32, 4x16, and 8x8 Parallel CoMPare for Greater Than
- (resulting fields are either 0 or -1)
-*/
-#define pcmpgtd_m2r(var, reg) mmx_m2r(pcmpgtd, var, reg)
-#define pcmpgtd_r2r(regs, regd) mmx_r2r(pcmpgtd, regs, regd)
-#define pcmpgtd(vars, vard) mmx_m2m(pcmpgtd, vars, vard)
-
-#define pcmpgtw_m2r(var, reg) mmx_m2r(pcmpgtw, var, reg)
-#define pcmpgtw_r2r(regs, regd) mmx_r2r(pcmpgtw, regs, regd)
-#define pcmpgtw(vars, vard) mmx_m2m(pcmpgtw, vars, vard)
-
-#define pcmpgtb_m2r(var, reg) mmx_m2r(pcmpgtb, var, reg)
-#define pcmpgtb_r2r(regs, regd) mmx_r2r(pcmpgtb, regs, regd)
-#define pcmpgtb(vars, vard) mmx_m2m(pcmpgtb, vars, vard)
-
-
-/* 1x64, 2x32, and 4x16 Parallel Shift Left Logical
-*/
-#define psllq_i2r(imm, reg) mmx_i2r(psllq, imm, reg)
-#define psllq_m2r(var, reg) mmx_m2r(psllq, var, reg)
-#define psllq_r2r(regs, regd) mmx_r2r(psllq, regs, regd)
-#define psllq(vars, vard) mmx_m2m(psllq, vars, vard)
-
-#define pslld_i2r(imm, reg) mmx_i2r(pslld, imm, reg)
-#define pslld_m2r(var, reg) mmx_m2r(pslld, var, reg)
-#define pslld_r2r(regs, regd) mmx_r2r(pslld, regs, regd)
-#define pslld(vars, vard) mmx_m2m(pslld, vars, vard)
-
-#define psllw_i2r(imm, reg) mmx_i2r(psllw, imm, reg)
-#define psllw_m2r(var, reg) mmx_m2r(psllw, var, reg)
-#define psllw_r2r(regs, regd) mmx_r2r(psllw, regs, regd)
-#define psllw(vars, vard) mmx_m2m(psllw, vars, vard)
-
-
-/* 1x64, 2x32, and 4x16 Parallel Shift Right Logical
-*/
-#define psrlq_i2r(imm, reg) mmx_i2r(psrlq, imm, reg)
-#define psrlq_m2r(var, reg) mmx_m2r(psrlq, var, reg)
-#define psrlq_r2r(regs, regd) mmx_r2r(psrlq, regs, regd)
-#define psrlq(vars, vard) mmx_m2m(psrlq, vars, vard)
-
-#define psrld_i2r(imm, reg) mmx_i2r(psrld, imm, reg)
-#define psrld_m2r(var, reg) mmx_m2r(psrld, var, reg)
-#define psrld_r2r(regs, regd) mmx_r2r(psrld, regs, regd)
-#define psrld(vars, vard) mmx_m2m(psrld, vars, vard)
-
-#define psrlw_i2r(imm, reg) mmx_i2r(psrlw, imm, reg)
-#define psrlw_m2r(var, reg) mmx_m2r(psrlw, var, reg)
-#define psrlw_r2r(regs, regd) mmx_r2r(psrlw, regs, regd)
-#define psrlw(vars, vard) mmx_m2m(psrlw, vars, vard)
-
-
-/* 2x32 and 4x16 Parallel Shift Right Arithmetic
-*/
-#define psrad_i2r(imm, reg) mmx_i2r(psrad, imm, reg)
-#define psrad_m2r(var, reg) mmx_m2r(psrad, var, reg)
-#define psrad_r2r(regs, regd) mmx_r2r(psrad, regs, regd)
-#define psrad(vars, vard) mmx_m2m(psrad, vars, vard)
-
-#define psraw_i2r(imm, reg) mmx_i2r(psraw, imm, reg)
-#define psraw_m2r(var, reg) mmx_m2r(psraw, var, reg)
-#define psraw_r2r(regs, regd) mmx_r2r(psraw, regs, regd)
-#define psraw(vars, vard) mmx_m2m(psraw, vars, vard)
-
-
-/* 2x32->4x16 and 4x16->8x8 PACK and Signed Saturate
- (packs source and dest fields into dest in that order)
-*/
-#define packssdw_m2r(var, reg) mmx_m2r(packssdw, var, reg)
-#define packssdw_r2r(regs, regd) mmx_r2r(packssdw, regs, regd)
-#define packssdw(vars, vard) mmx_m2m(packssdw, vars, vard)
-
-#define packsswb_m2r(var, reg) mmx_m2r(packsswb, var, reg)
-#define packsswb_r2r(regs, regd) mmx_r2r(packsswb, regs, regd)
-#define packsswb(vars, vard) mmx_m2m(packsswb, vars, vard)
-
-
-/* 4x16->8x8 PACK and Unsigned Saturate
- (packs source and dest fields into dest in that order)
-*/
-#define packuswb_m2r(var, reg) mmx_m2r(packuswb, var, reg)
-#define packuswb_r2r(regs, regd) mmx_r2r(packuswb, regs, regd)
-#define packuswb(vars, vard) mmx_m2m(packuswb, vars, vard)
-
-
-/* 2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK Low
- (interleaves low half of dest with low half of source
- as padding in each result field)
-*/
-#define punpckldq_m2r(var, reg) mmx_m2r(punpckldq, var, reg)
-#define punpckldq_r2r(regs, regd) mmx_r2r(punpckldq, regs, regd)
-#define punpckldq(vars, vard) mmx_m2m(punpckldq, vars, vard)
-
-#define punpcklwd_m2r(var, reg) mmx_m2r(punpcklwd, var, reg)
-#define punpcklwd_r2r(regs, regd) mmx_r2r(punpcklwd, regs, regd)
-#define punpcklwd(vars, vard) mmx_m2m(punpcklwd, vars, vard)
-
-#define punpcklbw_m2r(var, reg) mmx_m2r(punpcklbw, var, reg)
-#define punpcklbw_r2r(regs, regd) mmx_r2r(punpcklbw, regs, regd)
-#define punpcklbw(vars, vard) mmx_m2m(punpcklbw, vars, vard)
-
-
-/* 2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK High
- (interleaves high half of dest with high half of source
- as padding in each result field)
-*/
-#define punpckhdq_m2r(var, reg) mmx_m2r(punpckhdq, var, reg)
-#define punpckhdq_r2r(regs, regd) mmx_r2r(punpckhdq, regs, regd)
-#define punpckhdq(vars, vard) mmx_m2m(punpckhdq, vars, vard)
-
-#define punpckhwd_m2r(var, reg) mmx_m2r(punpckhwd, var, reg)
-#define punpckhwd_r2r(regs, regd) mmx_r2r(punpckhwd, regs, regd)
-#define punpckhwd(vars, vard) mmx_m2m(punpckhwd, vars, vard)
-
-#define punpckhbw_m2r(var, reg) mmx_m2r(punpckhbw, var, reg)
-#define punpckhbw_r2r(regs, regd) mmx_r2r(punpckhbw, regs, regd)
-#define punpckhbw(vars, vard) mmx_m2m(punpckhbw, vars, vard)
-
-
-/* Empty MMx State
- (used to clean-up when going from mmx to float use
- of the registers that are shared by both; note that
- there is no float-to-mmx operation needed, because
- only the float tag word info is corruptible)
-*/
-#ifdef MMX_TRACE
-
-#define emms() \
- { \
- printf("emms()\n"); \
- __asm__ __volatile__ ("emms"); \
- }
-
-#else
-
-#define emms() __asm__ __volatile__ ("emms")
-
-#endif
-
-#endif
-
diff --git a/distrib/sdl-1.2.12/src/video/nanox/SDL_nxevents.c b/distrib/sdl-1.2.12/src/video/nanox/SDL_nxevents.c
deleted file mode 100644
index fb1980d..0000000
--- a/distrib/sdl-1.2.12/src/video/nanox/SDL_nxevents.c
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
- Copyright (C) 2001 Hsieh-Fu Tsai
- Copyright (C) 2002 Greg Haerr <greg@censoft.com>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- Hsieh-Fu Tsai
- clare@setabox.com
-*/
-#include "SDL_config.h"
-
-#include "SDL_keysym.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_nxevents_c.h"
-#include "SDL_nximage_c.h"
-
-// The translation tables from a nanox keysym to a SDL keysym
-static SDLKey NX_NONASCII_keymap [MWKEY_LAST + 1] ;
-
-void NX_InitOSKeymap (_THIS)
-{
- int i ;
-
- Dprintf ("enter NX_InitOSKeymap\n") ;
-
- // Map the nanox scancodes to SDL keysyms
- for (i = 0; i < SDL_arraysize (NX_NONASCII_keymap); ++ i)
- NX_NONASCII_keymap [i] = SDLK_UNKNOWN ;
-
- NX_NONASCII_keymap [MWKEY_LEFT & 0xFF] = SDLK_LEFT ;
- NX_NONASCII_keymap [MWKEY_RIGHT & 0xFF] = SDLK_RIGHT ;
- NX_NONASCII_keymap [MWKEY_UP & 0xFF] = SDLK_UP ;
- NX_NONASCII_keymap [MWKEY_DOWN & 0xFF] = SDLK_DOWN ;
- NX_NONASCII_keymap [MWKEY_INSERT & 0xFF] = SDLK_INSERT ;
- NX_NONASCII_keymap [MWKEY_DELETE & 0xFF] = SDLK_DELETE ;
- NX_NONASCII_keymap [MWKEY_HOME & 0xFF] = SDLK_HOME ;
- NX_NONASCII_keymap [MWKEY_END & 0xFF] = SDLK_END ;
- NX_NONASCII_keymap [MWKEY_PAGEUP & 0xFF] = SDLK_PAGEUP ;
- NX_NONASCII_keymap [MWKEY_PAGEDOWN & 0xFF] = SDLK_PAGEDOWN ;
-
- NX_NONASCII_keymap [MWKEY_KP0 & 0xFF] = SDLK_KP0 ;
- NX_NONASCII_keymap [MWKEY_KP1 & 0xFF] = SDLK_KP1 ;
- NX_NONASCII_keymap [MWKEY_KP2 & 0xFF] = SDLK_KP2 ;
- NX_NONASCII_keymap [MWKEY_KP3 & 0xFF] = SDLK_KP3 ;
- NX_NONASCII_keymap [MWKEY_KP4 & 0xFF] = SDLK_KP4 ;
- NX_NONASCII_keymap [MWKEY_KP5 & 0xFF] = SDLK_KP5 ;
- NX_NONASCII_keymap [MWKEY_KP6 & 0xFF] = SDLK_KP6 ;
- NX_NONASCII_keymap [MWKEY_KP7 & 0xFF] = SDLK_KP7 ;
- NX_NONASCII_keymap [MWKEY_KP8 & 0xFF] = SDLK_KP8 ;
- NX_NONASCII_keymap [MWKEY_KP9 & 0xFF] = SDLK_KP9 ;
- NX_NONASCII_keymap [MWKEY_KP_PERIOD & 0xFF] = SDLK_KP_PERIOD ;
- NX_NONASCII_keymap [MWKEY_KP_DIVIDE & 0xFF] = SDLK_KP_DIVIDE ;
- NX_NONASCII_keymap [MWKEY_KP_MULTIPLY & 0xFF] = SDLK_KP_MULTIPLY ;
- NX_NONASCII_keymap [MWKEY_KP_MINUS & 0xFF] = SDLK_KP_MINUS ;
- NX_NONASCII_keymap [MWKEY_KP_PLUS & 0xFF] = SDLK_KP_PLUS ;
- NX_NONASCII_keymap [MWKEY_KP_ENTER & 0xFF] = SDLK_KP_ENTER ;
- NX_NONASCII_keymap [MWKEY_KP_EQUALS & 0xFF] = SDLK_KP_EQUALS ;
-
- NX_NONASCII_keymap [MWKEY_F1 & 0xFF] = SDLK_F1 ;
- NX_NONASCII_keymap [MWKEY_F2 & 0xFF] = SDLK_F2 ;
- NX_NONASCII_keymap [MWKEY_F3 & 0xFF] = SDLK_F3 ;
- NX_NONASCII_keymap [MWKEY_F4 & 0xFF] = SDLK_F4 ;
- NX_NONASCII_keymap [MWKEY_F5 & 0xFF] = SDLK_F5 ;
- NX_NONASCII_keymap [MWKEY_F6 & 0xFF] = SDLK_F6 ;
- NX_NONASCII_keymap [MWKEY_F7 & 0xFF] = SDLK_F7 ;
- NX_NONASCII_keymap [MWKEY_F8 & 0xFF] = SDLK_F8 ;
- NX_NONASCII_keymap [MWKEY_F9 & 0xFF] = SDLK_F9 ;
- NX_NONASCII_keymap [MWKEY_F10 & 0xFF] = SDLK_F10 ;
- NX_NONASCII_keymap [MWKEY_F11 & 0xFF] = SDLK_F11 ;
- NX_NONASCII_keymap [MWKEY_F12 & 0xFF] = SDLK_F12 ;
-
- NX_NONASCII_keymap [MWKEY_NUMLOCK & 0xFF] = SDLK_NUMLOCK ;
- NX_NONASCII_keymap [MWKEY_CAPSLOCK & 0xFF] = SDLK_CAPSLOCK ;
- NX_NONASCII_keymap [MWKEY_SCROLLOCK & 0xFF] = SDLK_SCROLLOCK ;
- NX_NONASCII_keymap [MWKEY_LSHIFT & 0xFF] = SDLK_LSHIFT ;
- NX_NONASCII_keymap [MWKEY_RSHIFT & 0xFF] = SDLK_RSHIFT ;
- NX_NONASCII_keymap [MWKEY_LCTRL & 0xFF] = SDLK_LCTRL ;
- NX_NONASCII_keymap [MWKEY_RCTRL & 0xFF] = SDLK_RCTRL ;
- NX_NONASCII_keymap [MWKEY_LALT & 0xFF] = SDLK_LALT ;
- NX_NONASCII_keymap [MWKEY_RALT & 0xFF] = SDLK_RALT ;
- NX_NONASCII_keymap [MWKEY_LMETA & 0xFF] = SDLK_LMETA ;
- NX_NONASCII_keymap [MWKEY_RMETA & 0xFF] = SDLK_RMETA ;
- NX_NONASCII_keymap [MWKEY_ALTGR & 0xFF] = SDLK_MODE ;
-
- NX_NONASCII_keymap [MWKEY_PRINT & 0xFF] = SDLK_PRINT ;
- NX_NONASCII_keymap [MWKEY_SYSREQ & 0xFF] = SDLK_SYSREQ ;
- NX_NONASCII_keymap [MWKEY_PAUSE & 0xFF] = SDLK_PAUSE ;
- NX_NONASCII_keymap [MWKEY_BREAK & 0xFF] = SDLK_BREAK ;
- NX_NONASCII_keymap [MWKEY_MENU & 0xFF] = SDLK_MENU ;
-
- Dprintf ("leave NX_InitOSKeymap\n") ;
-}
-
-SDL_keysym * NX_TranslateKey (GR_EVENT_KEYSTROKE * keystroke, SDL_keysym * keysym)
-{
- GR_KEY ch = keystroke -> ch ;
-
- Dprintf ("enter NX_TranslateKey\n") ;
-
- keysym -> scancode = keystroke -> scancode ;
- keysym -> sym = SDLK_UNKNOWN ;
-
- if (ch & MWKEY_NONASCII_MASK) {
- keysym -> sym = NX_NONASCII_keymap [ch & 0xFF] ;
- } else {
- keysym -> sym = ch & 0x7F ;
- }
-
- keysym -> mod = KMOD_NONE ;
-
-#if 1 // Retrieve more mode information
- {
- GR_KEYMOD mod = keystroke -> modifiers ;
-
- if (mod & MWKMOD_LSHIFT)
- keysym -> mod |= KMOD_LSHIFT ;
- if (mod & MWKMOD_RSHIFT)
- keysym -> mod |= KMOD_RSHIFT ;
- if (mod & MWKMOD_LCTRL)
- keysym -> mod |= KMOD_LCTRL ;
- if (mod & MWKMOD_RCTRL)
- keysym -> mod |= KMOD_RCTRL ;
- if (mod & MWKMOD_LALT)
- keysym -> mod |= KMOD_LALT ;
- if (mod & MWKMOD_RALT)
- keysym -> mod |= KMOD_RALT ;
- if (mod & MWKMOD_LMETA)
- keysym -> mod |= KMOD_LMETA ;
- if (mod & MWKMOD_RMETA)
- keysym -> mod |= KMOD_RMETA ;
- if (mod & MWKMOD_NUM)
- keysym -> mod |= KMOD_NUM ;
- if (mod & MWKMOD_CAPS)
- keysym -> mod |= KMOD_CAPS ;
- if (mod & MWKMOD_ALTGR)
- keysym -> mod |= KMOD_MODE ;
- }
-#endif
-
- keysym -> unicode = ch ;
-
- Dprintf ("leave NX_TranslateKey\n") ;
- return keysym ;
-}
-
-static int check_boundary (_THIS, int x, int y)
-{
- if (x < OffsetX || y < OffsetY || x > OffsetX + this -> screen -> w ||
- y > OffsetY + this -> screen -> h)
- return 0 ;
-
- return 1 ;
-}
-
-void NX_PumpEvents (_THIS)
-{
- GR_EVENT event ;
- static GR_BUTTON last_button_down = 0 ;
-
- GrCheckNextEvent (& event) ;
- while (event.type != GR_EVENT_TYPE_NONE) {
-
- // dispatch event
- switch (event.type) {
- case GR_EVENT_TYPE_MOUSE_ENTER :
- {
- Dprintf ("mouse enter\n") ;
- SDL_PrivateAppActive (1, SDL_APPMOUSEFOCUS) ;
- break ;
- }
-
- case GR_EVENT_TYPE_MOUSE_EXIT :
- {
- Dprintf ("mouse exit\n") ;
- SDL_PrivateAppActive (0, SDL_APPMOUSEFOCUS) ;
- break ;
- }
-
- case GR_EVENT_TYPE_FOCUS_IN :
- {
- Dprintf ("focus in\n") ;
- SDL_PrivateAppActive (1, SDL_APPINPUTFOCUS) ;
- break ;
- }
-
- case GR_EVENT_TYPE_FOCUS_OUT :
- {
- Dprintf ("focus out\n") ;
- SDL_PrivateAppActive (0, SDL_APPINPUTFOCUS) ;
- break ;
- }
-
- case GR_EVENT_TYPE_MOUSE_MOTION :
- {
- Dprintf ("mouse motion\n") ;
-
- if (SDL_VideoSurface) {
- if (currently_fullscreen) {
- if (check_boundary (this, event.button.x, event.button.y)) {
- SDL_PrivateMouseMotion (0, 0, event.button.x - OffsetX,
- event.button.y - OffsetY) ;
- }
- } else {
- SDL_PrivateMouseMotion (0, 0, event.button.x, event.button.y) ;
- }
- }
- break ;
- }
-
- case GR_EVENT_TYPE_BUTTON_DOWN :
- {
- int button = event.button.buttons ;
-
- Dprintf ("button down\n") ;
-
- switch (button) {
- case MWBUTTON_L :
- button = 1 ;
- break ;
- case MWBUTTON_M :
- button = 2 ;
- break ;
- case MWBUTTON_R :
- button = 3 ;
- break ;
- default :
- button = 0 ;
- }
- last_button_down = button ;
-
- if (currently_fullscreen) {
- if (check_boundary (this, event.button.x, event.button.y)) {
- SDL_PrivateMouseButton (SDL_PRESSED, button,
- event.button.x - OffsetX, event.button.y - OffsetY) ;
- }
- } else {
- SDL_PrivateMouseButton (SDL_PRESSED, button,
- event.button.x, event.button.y) ;
- }
- break ;
- }
-
- // do not konw which button is released
- case GR_EVENT_TYPE_BUTTON_UP :
- {
- Dprintf ("button up\n") ;
-
- if (currently_fullscreen) {
- if (check_boundary (this, event.button.x, event.button.y)) {
- SDL_PrivateMouseButton (SDL_RELEASED, last_button_down,
- event.button.x - OffsetX, event.button.y - OffsetY) ;
- }
- } else {
- SDL_PrivateMouseButton (SDL_RELEASED, last_button_down,
- event.button.x, event.button.y) ;
- }
- last_button_down = 0 ;
- break ;
- }
-
- case GR_EVENT_TYPE_KEY_DOWN :
- {
- SDL_keysym keysym ;
-
- Dprintf ("key down\n") ;
- SDL_PrivateKeyboard (SDL_PRESSED,
- NX_TranslateKey (& event.keystroke, & keysym)) ;
- break ;
- }
-
- case GR_EVENT_TYPE_KEY_UP :
- {
- SDL_keysym keysym ;
-
- Dprintf ("key up\n") ;
- SDL_PrivateKeyboard (SDL_RELEASED,
- NX_TranslateKey (& event.keystroke, & keysym)) ;
- break ;
- }
-
- case GR_EVENT_TYPE_CLOSE_REQ :
- {
- Dprintf ("close require\n") ;
- SDL_PrivateQuit () ;
- break ;
- }
-
- case GR_EVENT_TYPE_EXPOSURE :
- {
- Dprintf ("event_type_exposure\n") ;
- if (SDL_VideoSurface) {
- NX_RefreshDisplay (this) ;//, & event.exposure) ;
- }
- break ;
- }
-
- case GR_EVENT_TYPE_UPDATE :
- {
- switch (event.update.utype) {
- case GR_UPDATE_MAP :
- {
- Dprintf ("GR_UPDATE_MAP\n") ;
- // If we're not active, make ourselves active
- if (!(SDL_GetAppState () & SDL_APPACTIVE)) {
- // Send an internal activate event
- SDL_PrivateAppActive (1, SDL_APPACTIVE) ;
- }
- if (SDL_VideoSurface) {
- NX_RefreshDisplay (this) ;
- }
- break ;
- }
-
- case GR_UPDATE_UNMAP :
- case GR_UPDATE_UNMAPTEMP :
- {
- Dprintf ("GR_UPDATE_UNMAP or GR_UPDATE_UNMAPTEMP\n") ;
- // If we're active, make ourselves inactive
- if (SDL_GetAppState () & SDL_APPACTIVE) {
- // Send an internal deactivate event
- SDL_PrivateAppActive (0, SDL_APPACTIVE | SDL_APPINPUTFOCUS) ;
- }
- break ;
- }
-
- case GR_UPDATE_SIZE :
- {
- Dprintf ("GR_UPDATE_SIZE\n") ;
- SDL_PrivateResize (event.update.width, event.update.height) ;
- break ;
- }
-
- case GR_UPDATE_MOVE :
- case GR_UPDATE_REPARENT :
- {
- Dprintf ("GR_UPDATE_MOVE or GR_UPDATE_REPARENT\n") ;
-#ifdef ENABLE_NANOX_DIRECT_FB
- if (Clientfb) {
- /* Get current window position and fb pointer*/
- if (currently_fullscreen)
- GrGetWindowFBInfo(FSwindow, &fbinfo);
- else
- GrGetWindowFBInfo(SDL_Window, &fbinfo);
- }
-#endif
- break ;
- }
-
- default :
- Dprintf ("unknown GR_EVENT_TYPE_UPDATE\n") ;
- break ;
- }
- break ;
- }
-
- default :
- {
- Dprintf ("pump event default\n") ;
- }
- }
-
- GrCheckNextEvent (& event) ;
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/nanox/SDL_nxevents_c.h b/distrib/sdl-1.2.12/src/video/nanox/SDL_nxevents_c.h
deleted file mode 100644
index ba12c21..0000000
--- a/distrib/sdl-1.2.12/src/video/nanox/SDL_nxevents_c.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
- Copyright (C) 2001 Hsieh-Fu Tsai
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- Hsieh-Fu Tsai
- clare@setabox.com
-*/
-#include "SDL_config.h"
-
-#include "SDL_nxvideo.h"
-
-// Functions to be exported
-extern void NX_InitOSKeymap (_THIS) ;
-extern void NX_PumpEvents (_THIS) ;
diff --git a/distrib/sdl-1.2.12/src/video/nanox/SDL_nximage.c b/distrib/sdl-1.2.12/src/video/nanox/SDL_nximage.c
deleted file mode 100644
index 6afe3b9..0000000
--- a/distrib/sdl-1.2.12/src/video/nanox/SDL_nximage.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
- Copyright (C) 2001 Hsieh-Fu Tsai
- Copyright (C) 2002 Greg Haerr <greg@censoft.com>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- Hsieh-Fu Tsai
- clare@setabox.com
-*/
-#include "SDL_config.h"
-
-#include "SDL_nximage_c.h"
-
-void NX_NormalUpdate (_THIS, int numrects, SDL_Rect * rects)
-{
- int i, j, xinc, yinc, destinc, rowinc ;
- int x, y, w, h ;
- unsigned char * src = NULL, * dest = NULL ;
-
- Dprintf ("enter NX_NormalUpdate\n") ;
-
- /* These are the values for the incoming image */
- xinc = this -> screen -> format -> BytesPerPixel ;
- yinc = this -> screen -> pitch ;
-
- for (i = 0; i < numrects; ++ i) {
- x = rects [i].x, y = rects [i].y ;
- w = rects [i].w, h = rects [i].h ;
- src = SDL_Image + y * yinc + x * xinc ;
-#ifdef ENABLE_NANOX_DIRECT_FB
- if (Clientfb) {
- if (currently_fullscreen)
- dest = fbinfo.winpixels + (((y+OffsetY) * fbinfo.pitch) +
- ((x+OffsetX) * fbinfo.bytespp));
- else
- dest = fbinfo.winpixels + ((y * fbinfo.pitch) + (x * fbinfo.bytespp));
- destinc = fbinfo.pitch;
- }
- else
-#endif
- {
- dest = Image_buff ;
- destinc = w * xinc ;
- }
- rowinc = w * xinc;
-
- // apply GammaRamp table
- if ((pixel_type == MWPF_TRUECOLOR0888 || pixel_type == MWPF_TRUECOLOR888)
- && GammaRamp_R && GammaRamp_G && GammaRamp_B) {
- Uint8 * ptrsrc ;
- Uint8 * ptrdst ;
- int k ;
-
- for (j = h; j > 0; -- j, src += yinc, dest += destinc) {
- ptrsrc = src ;
- ptrdst = dest ;
- for (k = w; k > 0; -- k) {
- *ptrdst++ = GammaRamp_B [*ptrsrc++] >> 8;
- *ptrdst++ = GammaRamp_G [*ptrsrc++] >> 8;
- *ptrdst++ = GammaRamp_R [*ptrsrc++] >> 8;
- *ptrdst++ = 0;
- ++ptrsrc;
- }
- }
- }
-#if 1 /* This is needed for microwindows 0.90 or older */
- else if (pixel_type == MWPF_TRUECOLOR0888 || pixel_type == MWPF_TRUECOLOR888) {
- Uint8 * ptrsrc ;
- Uint8 * ptrdst ;
- int k ;
-
- for (j = h; j > 0; -- j, src += yinc, dest += destinc) {
- ptrsrc = src ;
- ptrdst = dest ;
- for (k = w; k > 0; -- k) {
- *ptrdst++ = *ptrsrc++;
- *ptrdst++ = *ptrsrc++;
- *ptrdst++ = *ptrsrc++;
- *ptrdst++ = 0;
- ++ptrsrc;
- }
- }
- }
-#endif
- else
- {
- for (j = h; j > 0; -- j, src += yinc, dest += destinc)
- SDL_memcpy (dest, src, rowinc) ;
- }
- if (!Clientfb) {
- if (currently_fullscreen) {
- GrArea (FSwindow, SDL_GC, x + OffsetX, y + OffsetY, w, h, Image_buff,
- pixel_type) ;
- } else {
- GrArea (SDL_Window, SDL_GC, x, y, w, h, Image_buff, pixel_type) ;
- }
- }
- }
- GrFlush();
-
- Dprintf ("leave NX_NormalUpdate\n") ;
-}
-
-int NX_SetupImage (_THIS, SDL_Surface * screen)
-{
- int size = screen -> h * screen -> pitch ;
-
- Dprintf ("enter NX_SetupImage\n") ;
-
- screen -> pixels = (void *) SDL_malloc (size) ;
-
- if (!Clientfb) {
- Image_buff = (unsigned char *) SDL_malloc (size) ;
- if (screen -> pixels == NULL || Image_buff == NULL) {
- SDL_free (screen -> pixels) ;
- SDL_free (Image_buff) ;
- SDL_OutOfMemory () ;
- return -1 ;
- }
- }
-
- SDL_Image = (unsigned char *) screen -> pixels ;
-
- this -> UpdateRects = NX_NormalUpdate ;
-
- Dprintf ("leave NX_SetupImage\n") ;
- return 0 ;
-}
-
-void NX_DestroyImage (_THIS, SDL_Surface * screen)
-{
- Dprintf ("enter NX_DestroyImage\n") ;
-
- if (SDL_Image) SDL_free (SDL_Image) ;
- if (Image_buff) SDL_free (Image_buff) ;
- if (screen) screen -> pixels = NULL ;
-
- Dprintf ("leave NX_DestroyImage\n") ;
-}
-
-int NX_ResizeImage (_THIS, SDL_Surface * screen, Uint32 flags)
-{
- int retval ;
- GR_SCREEN_INFO si ;
-
- Dprintf ("enter NX_ResizeImage\n") ;
-
- NX_DestroyImage (this, screen) ;
- retval = NX_SetupImage (this, screen) ;
-
- GrGetScreenInfo (& si) ;
- OffsetX = (si.cols - screen -> w) / 2 ;
- OffsetY = (si.rows - screen -> h) / 2 ;
-
-#ifdef ENABLE_NANOX_DIRECT_FB
- if (Clientfb) {
- /* Get current window position and fb pointer*/
- if (currently_fullscreen)
- GrGetWindowFBInfo(FSwindow, &fbinfo);
- else
- GrGetWindowFBInfo(SDL_Window, &fbinfo);
- }
-#endif
- Dprintf ("leave NX_ResizeImage\n") ;
- return retval ;
-}
-
-void NX_RefreshDisplay (_THIS)
-{
- Dprintf ("enter NX_RefreshDisplay\n") ;
-
- // Don't refresh a display that doesn't have an image (like GL)
- if (! SDL_Image) {
- return;
- }
-
-#ifdef ENABLE_NANOX_DIRECT_FB
- if (Clientfb) {
- int j;
- char *src, *dest = NULL;
- int xinc, yinc, rowinc;
-
- GrGetWindowFBInfo(SDL_Window, &fbinfo);
-
- xinc = this -> screen -> format -> BytesPerPixel ;
- yinc = this -> screen -> pitch ;
-
- src = SDL_Image;
- if (currently_fullscreen)
- dest = fbinfo.winpixels + ((OffsetY * fbinfo.pitch) +
- (OffsetX * fbinfo.bytespp));
- else
- dest = fbinfo.winpixels;
- rowinc = xinc * this -> screen -> w;
-
- for (j = this -> screen -> h; j > 0; -- j, src += yinc, dest += fbinfo.pitch)
- SDL_memcpy (dest, src, rowinc) ;
- }
- else
-#endif
- {
- if (currently_fullscreen) {
- GrArea (FSwindow, SDL_GC, OffsetX, OffsetY, this -> screen -> w,
- this -> screen -> h, SDL_Image, pixel_type) ;
- } else {
- GrArea (SDL_Window, SDL_GC, 0, 0, this -> screen -> w,
- this -> screen -> h, SDL_Image, pixel_type) ;
- }
- }
- GrFlush();
-
- Dprintf ("leave NX_RefreshDisplay\n") ;
-}
diff --git a/distrib/sdl-1.2.12/src/video/nanox/SDL_nximage_c.h b/distrib/sdl-1.2.12/src/video/nanox/SDL_nximage_c.h
deleted file mode 100644
index 2cdc01f..0000000
--- a/distrib/sdl-1.2.12/src/video/nanox/SDL_nximage_c.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
- Copyright (C) 2001 Hsieh-Fu Tsai
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- Hsieh-Fu Tsai
- clare@setabox.com
-*/
-#include "SDL_config.h"
-
-#include "SDL_nxvideo.h"
-
-extern int NX_SetupImage (_THIS, SDL_Surface * screen) ;
-extern void NX_DestroyImage (_THIS, SDL_Surface * screen) ;
-extern int NX_ResizeImage (_THIS, SDL_Surface * screen, Uint32 flags) ;
-
-extern void NX_NormalUpdate (_THIS, int numrects, SDL_Rect * rects) ;
-extern void NX_RefreshDisplay (_THIS) ;
diff --git a/distrib/sdl-1.2.12/src/video/nanox/SDL_nxmodes.c b/distrib/sdl-1.2.12/src/video/nanox/SDL_nxmodes.c
deleted file mode 100644
index bc597e2..0000000
--- a/distrib/sdl-1.2.12/src/video/nanox/SDL_nxmodes.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
- Copyright (C) 2001 Hsieh-Fu Tsai
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- Hsieh-Fu Tsai
- clare@setabox.com
-*/
-#include "SDL_config.h"
-
-#include "SDL_stdinc.h"
-#include "SDL_nxmodes_c.h"
-
-SDL_Rect ** NX_ListModes (_THIS, SDL_PixelFormat * format, Uint32 flags)
-{
- if (flags & SDL_FULLSCREEN)
- return SDL_modelist ;
-
- if (SDL_Visual.bpp == format -> BitsPerPixel) {
- return ((SDL_Rect **) -1) ;
- } else {
- return ((SDL_Rect **) 0) ;
- }
-}
-
-void NX_FreeVideoModes (_THIS)
-{
- int i ;
-
- if (SDL_modelist) {
- for (i = 0; SDL_modelist [i]; ++ i) {
- SDL_free (SDL_modelist [i]) ;
- }
- SDL_free (SDL_modelist) ;
- SDL_modelist = NULL;
- }
-}
-
-int NX_EnterFullScreen (_THIS)
-{
- if (! currently_fullscreen) {
- GR_SCREEN_INFO si ;
-
- GrGetScreenInfo (& si) ;
- GrResizeWindow (FSwindow, si.cols, si.rows) ;
- GrUnmapWindow (SDL_Window) ;
- GrMapWindow (FSwindow) ;
- GrRaiseWindow (FSwindow) ;
- GrSetFocus (FSwindow) ;
- currently_fullscreen = 1 ;
- }
-
- return 1 ;
-}
-
-int NX_LeaveFullScreen (_THIS)
-{
- if (currently_fullscreen) {
- GrUnmapWindow (FSwindow) ;
- GrMapWindow (SDL_Window) ;
- GrRaiseWindow (SDL_Window) ;
- GrSetFocus (SDL_Window) ;
- currently_fullscreen = 0 ;
- }
-
- return 0 ;
-}
diff --git a/distrib/sdl-1.2.12/src/video/nanox/SDL_nxmodes_c.h b/distrib/sdl-1.2.12/src/video/nanox/SDL_nxmodes_c.h
deleted file mode 100644
index d643ad7..0000000
--- a/distrib/sdl-1.2.12/src/video/nanox/SDL_nxmodes_c.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
- Copyright (C) 2001 Hsieh-Fu Tsai
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- Hsieh-Fu Tsai
- clare@setabox.com
-*/
-#include "SDL_config.h"
-
-#include "SDL_nxvideo.h"
-#include <SDL.h>
-
-extern SDL_Rect ** NX_ListModes (_THIS, SDL_PixelFormat * format, Uint32 flags) ;
-extern void NX_FreeVideoModes (_THIS) ;
-extern int NX_EnterFullScreen (_THIS) ;
-extern int NX_LeaveFullScreen (_THIS) ;
diff --git a/distrib/sdl-1.2.12/src/video/nanox/SDL_nxmouse.c b/distrib/sdl-1.2.12/src/video/nanox/SDL_nxmouse.c
deleted file mode 100644
index 54017b1..0000000
--- a/distrib/sdl-1.2.12/src/video/nanox/SDL_nxmouse.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
- Copyright (C) 2001 Hsieh-Fu Tsai
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- Hsieh-Fu Tsai
- clare@setabox.com
-*/
-#include "SDL_config.h"
-
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_nxmouse_c.h"
-
-// The implementation dependent data for the window manager cursor
-struct WMcursor {
- int unused ;
-} ;
-
-WMcursor * NX_CreateWMCursor (_THIS,
- Uint8 * data, Uint8 * mask, int w, int h, int hot_x, int hot_y)
-{
- WMcursor * cursor ;
-
- Dprintf ("enter NX_CreateWMCursor\n") ;
-
- cursor = (WMcursor *) SDL_malloc (sizeof (WMcursor)) ;
- if (cursor == NULL) {
- SDL_OutOfMemory () ;
- return NULL ;
- }
-
- Dprintf ("leave NX_CreateWMCursor\n") ;
- return cursor ;
-}
-
-void NX_FreeWMCursor (_THIS, WMcursor * cursor)
-{
- Dprintf ("NX_FreeWMCursor\n") ;
- SDL_free (cursor) ;
- return ;
-}
-
-void NX_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
-{
- GR_WINDOW_INFO info ;
-
- Dprintf ("enter NX_WarpWMCursor\n") ;
- SDL_Lock_EventThread () ;
-
- GrGetWindowInfo (SDL_Window, & info) ;
- GrMoveCursor (info.x + x, info.y + y) ;
-
- SDL_Unlock_EventThread () ;
- Dprintf ("leave NX_WarpWMCursor\n") ;
-}
-
-int NX_ShowWMCursor (_THIS, WMcursor * cursor)
-{
- Dprintf ("NX_ShowWMCursor\n") ;
- return 1 ;
-}
diff --git a/distrib/sdl-1.2.12/src/video/nanox/SDL_nxmouse_c.h b/distrib/sdl-1.2.12/src/video/nanox/SDL_nxmouse_c.h
deleted file mode 100644
index 819eedb..0000000
--- a/distrib/sdl-1.2.12/src/video/nanox/SDL_nxmouse_c.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_nxvideo.h"
-
-extern WMcursor * NX_CreateWMCursor (_THIS, Uint8 * data, Uint8 * mask, int w, int h, int hot_x, int hot_y) ;
-void NX_FreeWMCursor (_THIS, WMcursor * cursor) ;
-extern void NX_WarpWMCursor (_THIS, Uint16 x, Uint16 y) ;
-extern int NX_ShowWMCursor (_THIS, WMcursor * cursor) ;
diff --git a/distrib/sdl-1.2.12/src/video/nanox/SDL_nxvideo.c b/distrib/sdl-1.2.12/src/video/nanox/SDL_nxvideo.c
deleted file mode 100644
index 89acb2a..0000000
--- a/distrib/sdl-1.2.12/src/video/nanox/SDL_nxvideo.c
+++ /dev/null
@@ -1,544 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
- Copyright (C) 2001 Hsieh-Fu Tsai
- Copyright (C) 2002 Greg Haerr <greg@censoft.com>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- Hsieh-Fu Tsai
- clare@setabox.com
-*/
-#include "SDL_config.h"
-
-#include "SDL_thread.h"
-#include "SDL_video.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-
-#define MWINCLUDECOLORS
-#include "SDL_nxvideo.h"
-#include "SDL_nxmodes_c.h"
-#include "SDL_nxwm_c.h"
-#include "SDL_nxmouse_c.h"
-#include "SDL_nximage_c.h"
-#include "SDL_nxevents_c.h"
-
-// Initialization/Query functions
-static int NX_VideoInit (_THIS, SDL_PixelFormat * vformat) ;
-static SDL_Surface * NX_SetVideoMode (_THIS, SDL_Surface * current, int width, int height, int bpp, Uint32 flags) ;
-static int NX_SetColors (_THIS, int firstcolor, int ncolors, SDL_Color * colors) ;
-static void NX_VideoQuit (_THIS) ;
-static void NX_DestroyWindow (_THIS, SDL_Surface * screen) ;
-static int NX_ToggleFullScreen (_THIS, int on) ;
-static void NX_UpdateMouse (_THIS) ;
-static int NX_SetGammaRamp (_THIS, Uint16 * ramp) ;
-static int NX_GetGammaRamp (_THIS, Uint16 * ramp) ;
-
-// Microwin driver bootstrap functions
-static int NX_Available ()
-{
- Dprintf ("enter NX_Available\n") ;
-
- if (GrOpen () < 0) return 0 ;
- GrClose () ;
-
- Dprintf ("leave NX_Available\n") ;
- return 1 ;
-}
-
-static void NX_DeleteDevice (SDL_VideoDevice * device)
-{
- Dprintf ("enter NX_DeleteDevice\n") ;
-
- if (device) {
- if (device -> hidden) SDL_free (device -> hidden) ;
- if (device -> gl_data) SDL_free (device -> gl_data) ;
- SDL_free (device) ;
- }
-
- Dprintf ("leave NX_DeleteDevice\n") ;
-}
-
-static SDL_VideoDevice * NX_CreateDevice (int devindex)
-{
- SDL_VideoDevice * device ;
-
- Dprintf ("enter NX_CreateDevice\n") ;
-
- // Initialize all variables that we clean on shutdown
- device = (SDL_VideoDevice *) SDL_malloc (sizeof (SDL_VideoDevice)) ;
- if (device) {
- SDL_memset (device, 0, (sizeof * device)) ;
- device -> hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc ((sizeof * device -> hidden)) ;
- device -> gl_data = NULL ;
- }
- if ((device == NULL) || (device -> hidden == NULL)) {
- SDL_OutOfMemory () ;
- NX_DeleteDevice (device) ;
- return 0 ;
- }
- SDL_memset (device -> hidden, 0, (sizeof * device -> hidden)) ;
-
- // Set the function pointers
- device -> VideoInit = NX_VideoInit ;
- device -> ListModes = NX_ListModes ;
- device -> SetVideoMode = NX_SetVideoMode ;
- device -> ToggleFullScreen = NX_ToggleFullScreen ;
- device -> UpdateMouse = NX_UpdateMouse ;
- device -> CreateYUVOverlay = NULL ;
- device -> SetColors = NX_SetColors ;
- device -> UpdateRects = NULL ;
- device -> VideoQuit = NX_VideoQuit;
- device -> AllocHWSurface = NULL ;
- device -> CheckHWBlit = NULL ;
- device -> FillHWRect = NULL ;
- device -> SetHWColorKey = NULL ;
- device -> SetHWAlpha = NULL ;
- device -> LockHWSurface = NULL ;
- device -> UnlockHWSurface = NULL ;
- device -> FlipHWSurface = NULL ;
- device -> FreeHWSurface = NULL ;
- device -> SetGamma = NULL ;
- device -> GetGamma = NULL ;
- device -> SetGammaRamp = NX_SetGammaRamp ;
- device -> GetGammaRamp = NX_GetGammaRamp ;
-
-#if SDL_VIDEO_OPENGL
- device -> GL_LoadLibrary = NULL ;
- device -> GL_GetProcAddress = NULL ;
- device -> GL_GetAttribute = NULL ;
- device -> GL_MakeCurrent = NULL ;
- device -> GL_SwapBuffers = NULL ;
-#endif
-
- device -> SetIcon = NULL ;
- device -> SetCaption = NX_SetCaption;
- device -> IconifyWindow = NULL ;
- device -> GrabInput = NULL ;
- device -> GetWMInfo = NX_GetWMInfo ;
- device -> FreeWMCursor = NX_FreeWMCursor ;
- device -> CreateWMCursor = NX_CreateWMCursor ;
- device -> ShowWMCursor = NX_ShowWMCursor ;
- device -> WarpWMCursor = NX_WarpWMCursor ;
- device -> CheckMouseMode = NULL ;
- device -> InitOSKeymap = NX_InitOSKeymap ;
- device -> PumpEvents = NX_PumpEvents ;
-
- device -> free = NX_DeleteDevice ;
-
- Dprintf ("leave NX_CreateDevice\n") ;
- return device ;
-}
-
-VideoBootStrap NX_bootstrap = {
- "nanox", "nanox", NX_Available, NX_CreateDevice
-} ;
-
-static void create_aux_windows (_THIS)
-{
- GR_WM_PROPERTIES props ;
-
- Dprintf ("enter create_aux_windows\n") ;
-
- // Don't create any extra windows if we are being managed
- if (SDL_windowid) {
- FSwindow = 0 ;
- return ;
- }
-
- if (FSwindow && FSwindow != GR_ROOT_WINDOW_ID) {
- GrDestroyWindow (FSwindow) ;
- }
-
- FSwindow = GrNewWindow (GR_ROOT_WINDOW_ID, 0, 0, 1, 1, 0, BLACK, BLACK) ;
- props.flags = GR_WM_FLAGS_PROPS ;
- props.props = GR_WM_PROPS_NODECORATE ;
- GrSetWMProperties (FSwindow, & props) ;
-
- GrSelectEvents (FSwindow, (GR_EVENT_MASK_EXPOSURE |
- GR_EVENT_MASK_BUTTON_DOWN | GR_EVENT_MASK_BUTTON_UP |
- GR_EVENT_MASK_FOCUS_IN | GR_EVENT_MASK_FOCUS_OUT |
- GR_EVENT_MASK_KEY_DOWN | GR_EVENT_MASK_KEY_UP |
- GR_EVENT_MASK_MOUSE_ENTER | GR_EVENT_MASK_MOUSE_EXIT |
- GR_EVENT_MASK_MOUSE_MOTION | GR_EVENT_MASK_UPDATE |
- GR_EVENT_MASK_CLOSE_REQ)) ;
-
- Dprintf ("leave create_aux_windows\n") ;
-}
-
-int NX_VideoInit (_THIS, SDL_PixelFormat * vformat)
-{
- GR_SCREEN_INFO si ;
-
- Dprintf ("enter NX_VideoInit\n") ;
-
- if (GrOpen () < 0) {
- SDL_SetError ("GrOpen() fail") ;
- return -1 ;
- }
-
- // use share memory to speed up
-#ifdef NANOX_SHARE_MEMORY
- GrReqShmCmds (0xFFFF);
-#endif
-
- SDL_Window = 0 ;
- FSwindow = 0 ;
-
- GammaRamp_R = NULL ;
- GammaRamp_G = NULL ;
- GammaRamp_B = NULL ;
-
- GrGetScreenInfo (& si) ;
- SDL_Visual.bpp = si.bpp ;
-
- /* Determine the current screen size */
- this->info.current_w = si.cols ;
- this->info.current_h = si.rows ;
-
- // GetVideoMode
- SDL_modelist = (SDL_Rect **) SDL_malloc (sizeof (SDL_Rect *) * 2) ;
- if (SDL_modelist) {
- SDL_modelist [0] = (SDL_Rect *) SDL_malloc (sizeof(SDL_Rect)) ;
- if (SDL_modelist [0]) {
- SDL_modelist [0] -> x = 0 ;
- SDL_modelist [0] -> y = 0 ;
- SDL_modelist [0] -> w = si.cols ;
- SDL_modelist [0] -> h = si.rows ;
- }
- SDL_modelist [1] = NULL ;
- }
-
- pixel_type = si.pixtype;
- SDL_Visual.red_mask = si.rmask;
- SDL_Visual.green_mask = si.gmask;
- SDL_Visual.blue_mask = si.bmask;
-
- vformat -> BitsPerPixel = SDL_Visual.bpp ;
- if (vformat -> BitsPerPixel > 8) {
- vformat -> Rmask = SDL_Visual.red_mask ;
- vformat -> Gmask = SDL_Visual.green_mask ;
- vformat -> Bmask = SDL_Visual.blue_mask ;
- }
-
- // See if we have been passed a window to use
- SDL_windowid = getenv ("SDL_WINDOWID") ;
-
- // Create the fullscreen (and managed windows : no implement)
- create_aux_windows (this) ;
-
- Dprintf ("leave NX_VideoInit\n") ;
- return 0 ;
-}
-
-void NX_VideoQuit (_THIS)
-{
- Dprintf ("enter NX_VideoQuit\n") ;
-
- // Start shutting down the windows
- NX_DestroyImage (this, this -> screen) ;
- NX_DestroyWindow (this, this -> screen) ;
- if (FSwindow && FSwindow != GR_ROOT_WINDOW_ID) {
- GrDestroyWindow (FSwindow) ;
- }
- NX_FreeVideoModes (this) ;
- SDL_free (GammaRamp_R) ;
- SDL_free (GammaRamp_G) ;
- SDL_free (GammaRamp_B) ;
-
-#ifdef ENABLE_NANOX_DIRECT_FB
- if (Clientfb)
- GrCloseClientFramebuffer();
-#endif
- GrClose () ;
-
- Dprintf ("leave NX_VideoQuit\n") ;
-}
-
-static void NX_DestroyWindow (_THIS, SDL_Surface * screen)
-{
- Dprintf ("enter NX_DestroyWindow\n") ;
-
- if (! SDL_windowid) {
- if (screen && (screen -> flags & SDL_FULLSCREEN)) {
- screen -> flags &= ~ SDL_FULLSCREEN ;
- NX_LeaveFullScreen (this) ;
- }
-
- // Destroy the output window
- if (SDL_Window && SDL_Window != GR_ROOT_WINDOW_ID) {
- GrDestroyWindow (SDL_Window) ;
- }
- }
-
- // Free the graphics context
- if (! SDL_GC) {
- GrDestroyGC (SDL_GC) ;
- SDL_GC = 0;
- }
-
- Dprintf ("leave NX_DestroyWindow\n") ;
-}
-
-static int NX_CreateWindow (_THIS, SDL_Surface * screen,
- int w, int h, int bpp, Uint32 flags)
-{
- Dprintf ("enter NX_CreateWindow\n") ;
-
- // If a window is already present, destroy it and start fresh
- if (SDL_Window && SDL_Window != GR_ROOT_WINDOW_ID) {
- NX_DestroyWindow (this, screen) ;
- }
-
- // See if we have been given a window id
- if (SDL_windowid) {
- SDL_Window = SDL_strtol (SDL_windowid, NULL, 0) ;
- } else {
- SDL_Window = 0 ;
- }
-
- if ( ! SDL_ReallocFormat (screen, bpp, SDL_Visual.red_mask,
- SDL_Visual.green_mask, SDL_Visual.blue_mask, 0))
- return -1;
-
- // Create (or use) the nanox display window
- if (! SDL_windowid) {
-
- SDL_Window = GrNewWindow (GR_ROOT_WINDOW_ID, 0, 0, w, h, 0, BLACK, WHITE) ;
-
- GrSelectEvents (SDL_Window, (GR_EVENT_MASK_EXPOSURE |
- GR_EVENT_MASK_BUTTON_DOWN | GR_EVENT_MASK_BUTTON_UP |
- GR_EVENT_MASK_FOCUS_IN | GR_EVENT_MASK_FOCUS_OUT |
- GR_EVENT_MASK_KEY_DOWN | GR_EVENT_MASK_KEY_UP |
- GR_EVENT_MASK_MOUSE_ENTER | GR_EVENT_MASK_MOUSE_EXIT |
- GR_EVENT_MASK_MOUSE_MOTION | GR_EVENT_MASK_UPDATE |
- GR_EVENT_MASK_CLOSE_REQ)) ;
- }
-
- /* Create the graphics context here, once we have a window */
- SDL_GC = GrNewGC () ;
- if (SDL_GC == 0) {
- SDL_SetError("Couldn't create graphics context");
- return(-1);
- }
-
- // Map them both and go fullscreen, if requested
- if (! SDL_windowid) {
- GrMapWindow (SDL_Window) ;
- if (flags & SDL_FULLSCREEN) {
- screen -> flags |= SDL_FULLSCREEN ;
- NX_EnterFullScreen (this) ;
- } else {
- screen -> flags &= ~ SDL_FULLSCREEN ;
- }
- }
-
-#ifdef ENABLE_NANOX_DIRECT_FB
- /* attempt allocating the client side framebuffer */
- Clientfb = GrOpenClientFramebuffer();
- /* NULL return will default to using GrArea()*/
-#endif
-
- Dprintf ("leave NX_CreateWindow\n") ;
- return 0 ;
-}
-
-SDL_Surface * NX_SetVideoMode (_THIS, SDL_Surface * current,
- int width, int height, int bpp, Uint32 flags)
-{
- Dprintf ("enter NX_SetVideoMode\n") ;
-
- // Lock the event thread, in multi-threading environments
- SDL_Lock_EventThread () ;
-
- bpp = SDL_Visual.bpp ;
- if (NX_CreateWindow (this, current, width, height, bpp, flags) < 0) {
- current = NULL;
- goto done;
- }
-
- if (current -> w != width || current -> h != height) {
- current -> w = width ;
- current -> h = height ;
- current -> pitch = SDL_CalculatePitch (current) ;
- NX_ResizeImage (this, current, flags) ;
- }
-
- /* Clear these flags and set them only if they are in the new set. */
- current -> flags &= ~(SDL_RESIZABLE|SDL_NOFRAME);
- current -> flags |= (flags & (SDL_RESIZABLE | SDL_NOFRAME)) ;
-
- done:
- SDL_Unlock_EventThread () ;
-
- Dprintf ("leave NX_SetVideoMode\n") ;
-
- // We're done!
- return current ;
-}
-
-// ncolors <= 256
-int NX_SetColors (_THIS, int firstcolor, int ncolors, SDL_Color * colors)
-{
- int i ;
- GR_PALETTE pal ;
-
- Dprintf ("enter NX_SetColors\n") ;
-
- if (ncolors > 256) return 0 ;
-
- pal.count = ncolors ;
- for (i = 0; i < ncolors; ++ i) {
- pal.palette [i].r = colors [i].r ;
- pal.palette [i].g = colors [i].g ;
- pal.palette [i].b = colors [i].b ;
- }
- GrSetSystemPalette (firstcolor, & pal) ;
-
- Dprintf ("leave NX_SetColors\n") ;
- return 1 ;
-}
-
-static int NX_ToggleFullScreen (_THIS, int on)
-{
- SDL_Rect rect ;
- Uint32 event_thread ;
-
- Dprintf ("enter NX_ToggleFullScreen\n") ;
-
- // Don't switch if we don't own the window
- if (SDL_windowid) return 0 ;
-
- // Don't lock if we are the event thread
- event_thread = SDL_EventThreadID () ;
- if (event_thread && (SDL_ThreadID () == event_thread)) {
- event_thread = 0 ;
- }
- if (event_thread) {
- SDL_Lock_EventThread() ;
- }
-
- if (on) {
- NX_EnterFullScreen (this) ;
- } else {
- this -> screen -> flags &= ~ SDL_FULLSCREEN ;
- NX_LeaveFullScreen (this) ;
- }
-
- rect.x = rect.y = 0 ;
- rect.w = this -> screen -> w, rect.h = this -> screen -> h ;
- NX_NormalUpdate (this, 1, & rect) ;
-
- if (event_thread) {
- SDL_Unlock_EventThread () ;
- }
-
- Dprintf ("leave NX_ToggleFullScreen\n") ;
- return 1 ;
-}
-
-// Update the current mouse state and position
-static void NX_UpdateMouse (_THIS)
-{
- int x, y ;
- GR_WINDOW_INFO info ;
- GR_SCREEN_INFO si ;
-
-
- Dprintf ("enter NX_UpdateMouse\n") ;
-
- // Lock the event thread, in multi-threading environments
- SDL_Lock_EventThread () ;
-
- GrGetScreenInfo (& si) ;
- GrGetWindowInfo (SDL_Window, & info) ;
- x = si.xpos - info.x ;
- y = si.ypos - info.y ;
- if (x >= 0 && x <= info.width && y >= 0 && y <= info.height) {
- SDL_PrivateAppActive (1, SDL_APPMOUSEFOCUS) ;
- SDL_PrivateMouseMotion (0, 0, x, y);
- } else {
- SDL_PrivateAppActive (0, SDL_APPMOUSEFOCUS) ;
- }
-
- SDL_Unlock_EventThread () ;
- Dprintf ("leave NX_UpdateMouse\n") ;
-}
-
-static int NX_SetGammaRamp (_THIS, Uint16 * ramp)
-{
- int i ;
- Uint16 * red, * green, * blue ;
-
- Dprintf ("enter NX_SetGammaRamp\n") ;
-
- if (SDL_Visual.bpp != 32 && SDL_Visual.bpp != 24) return -1 ;
-
- if (! GammaRamp_R) GammaRamp_R = (Uint16 *) SDL_malloc (sizeof (Uint16) * CI_SIZE) ;
- if (! GammaRamp_G) GammaRamp_G = (Uint16 *) SDL_malloc (sizeof (Uint16) * CI_SIZE) ;
- if (! GammaRamp_B) GammaRamp_B = (Uint16 *) SDL_malloc (sizeof (Uint16) * CI_SIZE) ;
- if ((! GammaRamp_R) || (! GammaRamp_G) || (! GammaRamp_B)) {
- SDL_OutOfMemory () ;
- return -1 ;
- }
-
- for (i = 0; i < CI_SIZE; ++ i)
- GammaRamp_R [i] = GammaRamp_G [i] = GammaRamp_B [i] = i ;
-
- red = ramp ;
- green = ramp + CI_SIZE ;
- blue = green + CI_SIZE ;
-
- for (i = 0; i < CI_SIZE; ++ i) {
- GammaRamp_R [i] = red [i] ;
- GammaRamp_G [i] = green [i] ;
- GammaRamp_B [i] = blue [i] ;
- }
- SDL_UpdateRect(this->screen, 0, 0, 0, 0);
-
- Dprintf ("leave NX_SetGammaRamp\n") ;
- return 0 ;
-}
-
-static int NX_GetGammaRamp (_THIS, Uint16 * ramp)
-{
- int i ;
- Uint16 * red, * green, * blue ;
-
- Dprintf ("enter NX_GetGammaRamp\n") ;
-
- if (SDL_Visual.bpp != 32 && SDL_Visual.bpp != 24) return -1 ;
- red = ramp ;
- green = ramp + CI_SIZE ;
- blue = green + CI_SIZE ;
- if (GammaRamp_R && GammaRamp_G && GammaRamp_B) {
- for (i = 0; i < CI_SIZE; ++ i) {
- red [i] = GammaRamp_R [i] ;
- green [i] = GammaRamp_G [i] ;
- blue [i] = GammaRamp_B [i] ;
- }
- } else {
- for (i = 0; i < CI_SIZE; ++ i)
- red [i] = green [i] = blue [i] = i ;
- }
-
- Dprintf ("leave NX_GetGammaRamp\n") ;
- return 0 ;
-}
diff --git a/distrib/sdl-1.2.12/src/video/nanox/SDL_nxvideo.h b/distrib/sdl-1.2.12/src/video/nanox/SDL_nxvideo.h
deleted file mode 100644
index 4e5fa27..0000000
--- a/distrib/sdl-1.2.12/src/video/nanox/SDL_nxvideo.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
- Copyright (C) 2001 Hsieh-Fu Tsai
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- Hsieh-Fu Tsai
- clare@setabox.com
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_nxvideo_h
-#define _SDL_nxvideo_h
-
-#include <microwin/nano-X.h>
-
-#include "../SDL_sysvideo.h"
-
-#ifdef ENABLE_NANOX_DEBUG
-#define Dprintf printf
-#else
-#define Dprintf(ignore...)
-#endif
-
-// Hidden "this" pointer for the video functions
-#define _THIS SDL_VideoDevice * this
-
-// Private display data
-typedef struct NX_SDL_VISUAL {
- int bpp ;
- Uint32 red_mask ;
- Uint32 green_mask ;
- Uint32 blue_mask ;
-} nx_sdl_visual_t ;
-
-struct SDL_PrivateVideoData {
- GR_WINDOW_ID SDL_Window ;
- GR_WINDOW_ID FSwindow ;
- // Flag: true if we have been passed a window
- char * SDL_windowid ;
- GR_GC_ID GC ;
- unsigned char * Image ;
- unsigned char * Image_buff ; /* for GrArea*/
- unsigned char * Clientfb; /* for DirectFB*/
- nx_sdl_visual_t SDL_Visual ;
- // The current list of available video modes
- SDL_Rect ** modelist ;
- int currently_fullscreen ;
- // for fullscreen
- int OffsetX, OffsetY ;
- // for GammaRamp
- Uint16 * GammaRamp_R, * GammaRamp_G, * GammaRamp_B ;
- // for GrArea, r_mask, g_mask, b_mask
- int pixel_type ;
-#ifdef ENABLE_NANOX_DIRECT_FB
- GR_WINDOW_FB_INFO fbinfo;
-#endif
-} ;
-
-#define SDL_Window (this -> hidden -> SDL_Window)
-#define FSwindow (this -> hidden -> FSwindow)
-#define SDL_windowid (this -> hidden -> SDL_windowid)
-#define SDL_GC (this -> hidden -> GC)
-#define SDL_Image (this -> hidden -> Image)
-#define Image_buff (this -> hidden -> Image_buff)
-#define Clientfb (this -> hidden -> Clientfb)
-#define SDL_Visual (this -> hidden -> SDL_Visual)
-#define SDL_modelist (this -> hidden -> modelist)
-#define currently_fullscreen (this -> hidden -> currently_fullscreen)
-#define OffsetX (this -> hidden -> OffsetX)
-#define OffsetY (this -> hidden -> OffsetY)
-#define GammaRamp_R (this -> hidden -> GammaRamp_R)
-#define GammaRamp_G (this -> hidden -> GammaRamp_G)
-#define GammaRamp_B (this -> hidden -> GammaRamp_B)
-#define pixel_type (this -> hidden -> pixel_type)
-#define fbinfo (this -> hidden -> fbinfo)
-
-#define CI_SIZE 256 // color index size
-
-#endif // _SDL_nxvideo_h
diff --git a/distrib/sdl-1.2.12/src/video/nanox/SDL_nxwm.c b/distrib/sdl-1.2.12/src/video/nanox/SDL_nxwm.c
deleted file mode 100644
index d0af3bf..0000000
--- a/distrib/sdl-1.2.12/src/video/nanox/SDL_nxwm.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
- Copyright (C) 2001 Hsieh-Fu Tsai
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- Hsieh-Fu Tsai
- clare@setabox.com
-*/
-#include "SDL_config.h"
-
-#include "SDL_syswm.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_nxwm_c.h"
-
-void NX_SetCaption (_THIS, const char * title, const char * icon)
-{
- Dprintf ("enter NX_SetCaption\n") ;
-
- // Lock the event thread, in multi-threading environments
- SDL_Lock_EventThread () ;
-
- if (SDL_Window)
- GrSetWindowTitle (SDL_Window, title) ;
-
- SDL_Unlock_EventThread () ;
- Dprintf ("leave NX_SetCaption\n") ;
-}
-
-int NX_GetWMInfo (_THIS, SDL_SysWMinfo * info)
-{
- Dprintf ("enter NX_GetWMInfo\n") ;
-
- if (info -> version.major <= SDL_MAJOR_VERSION) {
- info -> window = SDL_Window ;
- return 1 ;
- } else {
- SDL_SetError("Application not compiled with SDL %d.%d\n",
- SDL_MAJOR_VERSION, SDL_MINOR_VERSION) ;
- return -1 ;
- }
-
- Dprintf ("leave NX_GetWMInfo\n") ;
-}
diff --git a/distrib/sdl-1.2.12/src/video/nanox/SDL_nxwm_c.h b/distrib/sdl-1.2.12/src/video/nanox/SDL_nxwm_c.h
deleted file mode 100644
index 459cec8..0000000
--- a/distrib/sdl-1.2.12/src/video/nanox/SDL_nxwm_c.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
- Copyright (C) 2001 Hsieh-Fu Tsai
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- Hsieh-Fu Tsai
- clare@setabox.com
-*/
-#include "SDL_config.h"
-
-#include "SDL_nxvideo.h"
-
-// Functions to be exported
-extern void NX_SetCaption (_THIS, const char * title, const char * icon) ;
-extern int NX_GetWMInfo (_THIS, SDL_SysWMinfo * info) ;
diff --git a/distrib/sdl-1.2.12/src/video/os2fslib/SDL_os2fslib.c b/distrib/sdl-1.2.12/src/video/os2fslib/SDL_os2fslib.c
deleted file mode 100644
index e05540a..0000000
--- a/distrib/sdl-1.2.12/src/video/os2fslib/SDL_os2fslib.c
+++ /dev/null
@@ -1,3018 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#define _ULS_CALLCONV_
-#define CALLCONV _System
-#include <unidef.h> // Unicode API
-#include <uconv.h> // Unicode API (codepage conversion)
-
-#include <process.h>
-#include <time.h>
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_os2fslib.h"
-
-static ULONG ulFCFToUse =
- FCF_TITLEBAR |
- FCF_SYSMENU |
- FCF_MINBUTTON |
- FCF_MAXBUTTON |
- FCF_NOBYTEALIGN |
- FCF_SIZEBORDER |
- FCF_TASKLIST;
-
-static int bMouseCaptured = 0;
-static int bMouseCapturable = 0;
-static HPOINTER hptrGlobalPointer = NULL;
-static HPOINTER hptrCurrentIcon = NULL;
-static int iWindowSizeX = 320;
-static int iWindowSizeY = 200;
-static int bWindowResized = 0;
-
-#pragma pack(1)
-typedef struct BMPINFO
-{
- BITMAPINFO;
- RGB clr;
-} BMPINFO, *PBMPINFO;
-#pragma pack()
-
-
-// Backdoors:
-DECLSPEC void SDLCALL SDL_OS2FSLIB_SetFCFToUse(ULONG ulFCF)
-{
- ulFCFToUse = ulFCF;
-}
-
-// Configuration defines:
-
-// We have to report empty alpha mask, otherwise SDL will select
-// alpha blitters, and this will have unwanted results, as we don't
-// support alpha channel in FSLib yet.
-#define REPORT_EMPTY_ALPHA_MASK
-
-// Experimental: Move every FSLib_BitBlt() call into window message
-// processing function.
-// This may fix dirt left on desktop. Or not.
-//#define BITBLT_IN_WINMESSAGEPROC
-
-// Experimental-2: Use WinLockWindowUpdate() in around bitblts!
-// This is not enabled, because it seems to cause more problems
-// than good.
-//#define USE_WINLOCKWINDOWUPDATE_AROUND_BITBLTS
-
-// Use the following to show resized image instead of black stuff
-// even if the surface is resizable.
-//#define RESIZE_EVEN_IF_RESIZABLE
-
-/* The translation table from a VK keysym to a SDL keysym */
-static SDLKey HWScanKeyMap[256];
-static SDL_keysym *TranslateKey(int vkey, int chcode, int scancode, SDL_keysym *keysym, int iPressed);
-static int iShiftIsPressed;
-
-#ifdef BITBLT_IN_WINMESSAGEPROC
-#define WM_UPDATERECTSREQUEST WM_USER+50
-#endif
-
-#ifdef USE_WINLOCKWINDOWUPDATE_AROUND_BITBLTS
-#define FSLIB_BITBLT(hwnd, buffer, top, left, width, height) \
- { \
- WinLockWindowUpdate(HWND_DESKTOP, HWND_DESKTOP); \
- FSLib_BitBlt(hwnd, buffer, top, left, width, height); \
- WinLockWindowUpdate(HWND_DESKTOP, NULL); \
- }
-#else
-#define FSLIB_BITBLT(hwnd, buffer, top, left, width, height) \
- FSLib_BitBlt(hwnd, buffer, top, left, width, height);
-#endif
-
-/////////////////////////////////////////////////////////////////////
-//
-// SetAccessableWindowPos
-//
-// Same as WinSetWindowPos(), but takes care for the window to be
-// always on the screen, the titlebar will be accessable everytime.
-//
-/////////////////////////////////////////////////////////////////////
-static BOOL SetAccessableWindowPos(HWND hwnd, HWND hwndInsertBehind,
- LONG x, LONG y,
- LONG cx, LONG cy,
- ULONG fl)
-{
- SWP swpDesktop, swp;
- // Get desktop area
- WinQueryWindowPos(HWND_DESKTOP, &swpDesktop);
-
- if ((fl & SWP_MOVE) && (fl & SWP_SIZE))
- {
- // If both moving and sizing, then change size and pos now!!
- if (x+cx>swpDesktop.cx)
- x = swpDesktop.cx - cx;
- if (x<0)
- x = 0;
- if (y<0)
- y = 0;
- if (y+cy>swpDesktop.cy)
- y = swpDesktop.cy - cy;
- return WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl);
- } else
- if (fl & SWP_MOVE)
- {
- // Just moving
- WinQueryWindowPos(hwnd, &swp);
- if (x+swp.cx>swpDesktop.cx)
- x = swpDesktop.cx - swp.cx;
- if (x<0)
- x = 0;
- if (y<0)
- y = 0;
- if (y+swp.cy>swpDesktop.cy)
- y = swpDesktop.cy - swp.cy;
- return WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl);
- } else
- if (fl & SWP_SIZE)
- {
- // Just sizing
- WinQueryWindowPos(hwnd, &swp);
- x = swp.x;
- y = swp.y;
- if (x+cx>swpDesktop.cx)
- x = swpDesktop.cx - cx;
- if (x<0)
- x = 0;
- if (y<0)
- y = 0;
- if (y+cy>swpDesktop.cy)
- y = swpDesktop.cy - cy;
- return WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl | SWP_MOVE);
- } else
- return WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl);
-}
-
-static UniChar NativeCharToUniChar(int chcode)
-{
- UniChar ucResult = (UniChar) chcode;
- int rc;
- UconvObject ucoTemp;
- char achFrom[2];
- char *pchFrom;
- size_t iFromCount;
- UniChar aucTo[10];
- UniChar *pucTo;
- size_t iToCount;
- size_t iNonIdentical;
-
- // Create unicode convert object
- rc = UniCreateUconvObject(L"", &ucoTemp);
- if (rc!=ULS_SUCCESS)
- {
- // Could not create convert object!
- return ucResult;
- }
-
- // Convert language code string to unicode string
- achFrom[0] = (char) chcode;
- achFrom[1] = 0;
- iFromCount = sizeof(char) * 2;
- iToCount = sizeof(UniChar) * 2;
- pucTo = &(aucTo[0]);
- pchFrom = &(achFrom[0]);
-
- rc = UniUconvToUcs(ucoTemp,
- &pchFrom,
- &iFromCount,
- &pucTo,
- &iToCount,
- &iNonIdentical);
-
- if (rc!=ULS_SUCCESS)
- {
- // Could not convert language code to UCS string!
- UniFreeUconvObject(ucoTemp);
- return ucResult;
- }
-
- UniFreeUconvObject(ucoTemp);
-
-#ifdef DEBUG_BUILD
- printf("%02x converted to %02x\n", (int) chcode, (int) (aucTo[0]));
-#endif
-
- return aucTo[0];
-}
-
-/////////////////////////////////////////////////////////////////////
-//
-// TranslateKey
-//
-// This creates SDL Keycodes from VK_ and hardware scan codes
-//
-/////////////////////////////////////////////////////////////////////
-static SDL_keysym *TranslateKey(int vkey, int chcode, int scancode, SDL_keysym *keysym, int iPressed)
-{
- keysym->scancode = (unsigned char) scancode;
- keysym->mod = KMOD_NONE;
- keysym->unicode = 0;
-
- if (iPressed && SDL_TranslateUNICODE)
- {
- if (chcode)
- keysym->unicode = NativeCharToUniChar(chcode);
- else
- keysym->unicode = vkey;
- }
-
- keysym->sym = HWScanKeyMap[scancode];
-
- // Now stuffs based on state of shift key(s)!
- if (vkey == VK_SHIFT)
- {
- iShiftIsPressed = iPressed;
- }
-
- if ((iShiftIsPressed) && (SDL_TranslateUNICODE))
- {
- // Change syms, if Unicode stuff is required
- // I think it's silly, but it's SDL...
- switch (keysym->sym)
- {
- case SDLK_BACKQUOTE:
- keysym->sym = '~';
- break;
- case SDLK_1:
- keysym->sym = SDLK_EXCLAIM;
- break;
- case SDLK_2:
- keysym->sym = SDLK_AT;
- break;
- case SDLK_3:
- keysym->sym = SDLK_HASH;
- break;
- case SDLK_4:
- keysym->sym = SDLK_DOLLAR;
- break;
- case SDLK_5:
- keysym->sym = '%';
- break;
- case SDLK_6:
- keysym->sym = SDLK_CARET;
- break;
- case SDLK_7:
- keysym->sym = SDLK_AMPERSAND;
- break;
- case SDLK_8:
- keysym->sym = SDLK_ASTERISK;
- break;
- case SDLK_9:
- keysym->sym = SDLK_LEFTPAREN;
- break;
- case SDLK_0:
- keysym->sym = SDLK_RIGHTPAREN;
- break;
- case SDLK_MINUS:
- keysym->sym = SDLK_UNDERSCORE;
- break;
- case SDLK_PLUS:
- keysym->sym = SDLK_EQUALS;
- break;
-
- case SDLK_LEFTBRACKET:
- keysym->sym = '{';
- break;
- case SDLK_RIGHTBRACKET:
- keysym->sym = '}';
- break;
-
- case SDLK_SEMICOLON:
- keysym->sym = SDLK_COLON;
- break;
- case SDLK_QUOTE:
- keysym->sym = SDLK_QUOTEDBL;
- break;
- case SDLK_BACKSLASH:
- keysym->sym = '|';
- break;
-
- case SDLK_COMMA:
- keysym->sym = SDLK_LESS;
- break;
- case SDLK_PERIOD:
- keysym->sym = SDLK_GREATER;
- break;
- case SDLK_SLASH:
- keysym->sym = SDLK_QUESTION;
- break;
-
- default:
- break;
- }
- }
- return keysym;
-}
-
-#define CONVERTMOUSEPOSITION() \
- /* We have to inverse the mouse position, because every non-os/2 system */ \
- /* has a coordinate system where the (0;0) is the top-left corner, */ \
- /* while on os/2 it's the bottom left corner! */ \
- if (FSLib_QueryFSMode(hwnd)) \
- { \
- /* We're in FS mode! */ \
- /* In FS mode our window is as big as fullscreen mode, but not necessary as */ \
- /* big as the source buffer (can be bigger) */ \
- /* So, limit mouse pos to source buffer size! */ \
- if (ppts->x<0) ppts->x = 0; \
- if (ppts->y<0) ppts->y = 0; \
- if (ppts->x>=pVideo->hidden->SrcBufferDesc.uiXResolution) ppts->x = pVideo->hidden->SrcBufferDesc.uiXResolution-1; \
- if (ppts->y>=pVideo->hidden->SrcBufferDesc.uiYResolution) ppts->y = pVideo->hidden->SrcBufferDesc.uiYResolution-1; \
- pVideo->hidden->iSkipWMMOUSEMOVE++; /* Don't take next WM_MOUSEMOVE into account! */ \
- ptl.x = ppts->x; ptl.y = ppts->y; \
- WinMapWindowPoints(pVideo->hidden->hwndClient, HWND_DESKTOP, &ptl, 1); \
- WinSetPointerPos(HWND_DESKTOP, ptl.x, ptl.y); \
- /* Then convert OS/2 position to SDL position */ \
- ppts->y = pVideo->hidden->SrcBufferDesc.uiYResolution - ppts->y - 1; \
- } else \
- { \
- SWP swpClient; \
- /* We're in windowed mode! */ \
- WinQueryWindowPos(pVideo->hidden->hwndClient, &swpClient); \
- /* Convert OS/2 mouse position to SDL position, and also scale it! */ \
- (ppts->x) = (ppts->x) * pVideo->hidden->SrcBufferDesc.uiXResolution / swpClient.cx; \
- (ppts->y) = (ppts->y) * pVideo->hidden->SrcBufferDesc.uiYResolution / swpClient.cy; \
- (ppts->y) = pVideo->hidden->SrcBufferDesc.uiYResolution - (ppts->y) - 1; \
- }
-
-
-
-/////////////////////////////////////////////////////////////////////
-//
-// WndProc
-//
-// This is the message processing window procedure for the
-// SDLWindowClass, which is the client window in our application.
-// It handles switching back and away from the app (taking care of
-// going out and back to and from fullscreen mode), sending keystrokes
-// and mouse events to where it has to be sent, etc...
-//
-/////////////////////////////////////////////////////////////////////
-static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
-{
- HPS ps;
- RECTL rcl;
- SDL_VideoDevice *pVideo = NULL;
-
- switch (msg)
- {
- case WM_CHAR: // Keypress notification
-#ifdef DEBUG_BUILD
-// printf("WM_CHAR\n"); fflush(stdout);
-#endif
- pVideo = WinQueryWindowPtr(hwnd, 0);
- if (pVideo)
- {
- /*
- // We skip repeated keys:
- if (CHARMSG(&msg)->cRepeat>1)
- {
-#ifdef DEBUG_BUILD
-// printf("Repeated key (%d), skipping...\n", CHARMSG(&msg)->cRepeat); fflush(stdout);
-#endif
- return (MRESULT) TRUE;
- }
- */
-
- // If it's not repeated, then let's see if its pressed or released!
- if (SHORT1FROMMP(mp1) & KC_KEYUP)
- {
- // A key has been released
- SDL_keysym keysym;
-
-#ifdef DEBUG_BUILD
-// printf("WM_CHAR, keyup, code is [0x%0x]\n", CHAR4FROMMP(mp1)); // HW scan code
-#endif
-
- // One problem is with F1, which gets only the keyup message because
- // it is a system key.
- // So, when we get keyup message, we simulate keydown too!
- // UPDATE:
- // This problem should be solved now, that the accelerator keys are
- // disabled for this window!
- /*
- if (SHORT2FROMMP(mp2)==VK_F1)
- {
- SDL_PrivateKeyboard(SDL_PRESSED, TranslateKey(SHORT2FROMMP(mp2), // VK_ code
- SHORT1FROMMP(mp2), // Character code
- CHAR4FROMMP(mp1), // HW Scan code
- &keysym,0));
- }*/
-
- SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(SHORT2FROMMP(mp2), // VK_ code
- SHORT1FROMMP(mp2), // Character code
- CHAR4FROMMP(mp1), // HW Scan code
- &keysym,0));
-
- } else
- {
- // A key has been pressed
- SDL_keysym keysym;
-
-#ifdef DEBUG_BUILD
-// printf("WM_CHAR, keydown, code is [0x%0x]\n", CHAR4FROMMP(mp1)); // HW scan code
-#endif
- // Check for fastkeys: ALT+HOME to toggle FS mode
- // ALT+END to close app
- if ((SHORT1FROMMP(mp1) & KC_ALT) &&
- (SHORT2FROMMP(mp2) == VK_HOME))
- {
-#ifdef DEBUG_BUILD
- printf(" Pressed ALT+HOME!\n"); fflush(stdout);
-#endif
- // Only switch between fullscreen and back if it's not
- // a resizable mode!
- if (
- (!pVideo->hidden->pSDLSurface) ||
- ((pVideo->hidden->pSDLSurface)
- && ((pVideo->hidden->pSDLSurface->flags & SDL_RESIZABLE)==0)
- )
- )
- FSLib_ToggleFSMode(hwnd, !FSLib_QueryFSMode(hwnd));
-#ifdef DEBUG_BUILD
- else
- printf(" Resizable mode, so discarding ALT+HOME!\n"); fflush(stdout);
-#endif
- } else
- if ((SHORT1FROMMP(mp1) & KC_ALT) &&
- (SHORT2FROMMP(mp2) == VK_END))
- {
-#ifdef DEBUG_BUILD
- printf(" Pressed ALT+END!\n"); fflush(stdout);
-#endif
- // Close window, and get out of loop!
- // Also send event to SDL application, but we won't
- // wait for it to be processed!
- SDL_PrivateQuit();
- WinPostMsg(hwnd, WM_QUIT, 0, 0);
- } else
- {
-
- SDL_PrivateKeyboard(SDL_PRESSED, TranslateKey(SHORT2FROMMP(mp2), // VK_ code
- SHORT1FROMMP(mp2), // Character code
- CHAR4FROMMP(mp1), // HW Scan code
- &keysym,1));
-
- }
- }
- }
- return (MRESULT) TRUE;
-
- case WM_TRANSLATEACCEL:
- {
- PQMSG pqmsg;
- pqmsg = (PQMSG) mp1;
- if (mp1)
- {
- if (pqmsg->msg == WM_CHAR)
- {
- // WM_CHAR message!
- // Let's filter the ALT keypress and all other acceleration keys!
- return (MRESULT) FALSE;
- }
- }
- break; // Default processing (pass to parent until frame control)
- }
-
- case WM_PAINT: // Window redraw!
-#ifdef DEBUG_BUILD
- printf("WM_PAINT (0x%x)\n", hwnd); fflush(stdout);
-#endif
- ps = WinBeginPaint(hwnd,0,&rcl);
- pVideo = FSLib_GetUserParm(hwnd);
- if (pVideo)
- {
- if (!pVideo->hidden->pSDLSurface)
- {
- RECTL rclRect;
- // So, don't blit now!
-#ifdef DEBUG_BUILD
- printf("WM_PAINT : Skipping blit while resizing (Pre!)!\n"); fflush(stdout);
-#endif
- WinQueryWindowRect(hwnd, &rclRect);
- // Fill with black
- WinFillRect(ps, &rclRect, CLR_BLACK);
- } else
- {
- if (DosRequestMutexSem(pVideo->hidden->hmtxUseSrcBuffer, 1000)==NO_ERROR)
- {
- int iTop, iLeft, iWidth, iHeight;
- int iXScaleError, iYScaleError;
- int iXScaleError2, iYScaleError2;
- SWP swp;
-
- // Re-blit the modified area!
- // For this, we have to calculate the points, scaled!
- WinQueryWindowPos(hwnd, &swp);
-#ifdef DEBUG_BUILD
- printf("WM_PAINT : WinSize: %d %d, BufSize: %d %d\n",
- swp.cx,
- swp.cy,
- pVideo->hidden->SrcBufferDesc.uiXResolution,
- pVideo->hidden->SrcBufferDesc.uiYResolution
- );
- fflush(stdout);
-#endif
-
-#ifndef RESIZE_EVEN_IF_RESIZABLE
- // But only blit if the window is not resizable, or if
- // the window is resizable and the source buffer size is the
- // same as the destination buffer size!
- if ((!pVideo->hidden->pSDLSurface) ||
- ((pVideo->hidden->pSDLSurface) &&
- (pVideo->hidden->pSDLSurface->flags & SDL_RESIZABLE) &&
- ((swp.cx != pVideo->hidden->SrcBufferDesc.uiXResolution) ||
- (swp.cy != pVideo->hidden->SrcBufferDesc.uiYResolution)
- ) &&
- (!FSLib_QueryFSMode(hwnd))
- )
- )
- {
- RECTL rclRect;
- // Resizable surface and in resizing!
- // So, don't blit now!
-#ifdef DEBUG_BUILD
- printf("WM_PAINT : Skipping blit while resizing!\n"); fflush(stdout);
-#endif
- WinQueryWindowRect(hwnd, &rclRect);
- // Fill with black
- WinFillRect(ps, &rclRect, CLR_BLACK);
- } else
-#endif
- {
-
- iXScaleError = (pVideo->hidden->SrcBufferDesc.uiXResolution-1) / swp.cx;
- iYScaleError = (pVideo->hidden->SrcBufferDesc.uiYResolution-1) / swp.cy;
- if (iXScaleError<0) iXScaleError = 0;
- if (iYScaleError<0) iYScaleError = 0;
- iXScaleError2 = (swp.cx-1)/(pVideo->hidden->SrcBufferDesc.uiXResolution);
- iYScaleError2 = (swp.cy-1)/(pVideo->hidden->SrcBufferDesc.uiYResolution);
- if (iXScaleError2<0) iXScaleError2 = 0;
- if (iYScaleError2<0) iYScaleError2 = 0;
-
- iTop = (swp.cy - rcl.yTop) * pVideo->hidden->SrcBufferDesc.uiYResolution / swp.cy - iYScaleError;
- iLeft = rcl.xLeft * pVideo->hidden->SrcBufferDesc.uiXResolution / swp.cx - iXScaleError;
- iWidth = ((rcl.xRight-rcl.xLeft) * pVideo->hidden->SrcBufferDesc.uiXResolution + swp.cx-1)
- / swp.cx + 2*iXScaleError;
- iHeight = ((rcl.yTop-rcl.yBottom) * pVideo->hidden->SrcBufferDesc.uiYResolution + swp.cy-1)
- / swp.cy + 2*iYScaleError;
-
- iWidth+=iXScaleError2;
- iHeight+=iYScaleError2;
-
- if (iTop<0) iTop = 0;
- if (iLeft<0) iLeft = 0;
- if (iTop+iHeight>pVideo->hidden->SrcBufferDesc.uiYResolution) iHeight = pVideo->hidden->SrcBufferDesc.uiYResolution-iTop;
- if (iLeft+iWidth>pVideo->hidden->SrcBufferDesc.uiXResolution) iWidth = pVideo->hidden->SrcBufferDesc.uiXResolution-iLeft;
-
-#ifdef DEBUG_BUILD
- printf("WM_PAINT : BitBlt: %d %d -> %d %d (Buf %d x %d)\n",
- iTop, iLeft, iWidth, iHeight,
- pVideo->hidden->SrcBufferDesc.uiXResolution,
- pVideo->hidden->SrcBufferDesc.uiYResolution
- );
- fflush(stdout);
-#endif
-
- FSLIB_BITBLT(hwnd, pVideo->hidden->pchSrcBuffer, iTop, iLeft, iWidth, iHeight);
- }
-
- DosReleaseMutexSem(pVideo->hidden->hmtxUseSrcBuffer);
- }
- }
- }
-#ifdef DEBUG_BUILD
- else
- {
- printf("WM_PAINT : No pVideo!\n"); fflush(stdout);
- }
-#endif
- WinEndPaint(ps);
-#ifdef DEBUG_BUILD
- printf("WM_PAINT : Done.\n");
- fflush(stdout);
-#endif
- return 0;
-
- case WM_SIZE:
- {
-#ifdef DEBUG_BUILD
- printf("WM_SIZE : (%d %d)\n",
- SHORT1FROMMP(mp2), SHORT2FROMMP(mp2)); fflush(stdout);
-#endif
- iWindowSizeX = SHORT1FROMMP(mp2);
- iWindowSizeY = SHORT2FROMMP(mp2);
- bWindowResized = 1;
-
- // Make sure the window will be redrawn
- WinInvalidateRegion(hwnd, NULL, TRUE);
- }
- break;
-
- case WM_FSLIBNOTIFICATION:
-#ifdef DEBUG_BUILD
- printf("WM_FSLIBNOTIFICATION\n"); fflush(stdout);
-#endif
- if ((int)mp1 == FSLN_TOGGLEFSMODE)
- {
- // FS mode changed, reblit image!
- pVideo = FSLib_GetUserParm(hwnd);
- if (pVideo)
- {
- if (!pVideo->hidden->pSDLSurface)
- {
- // Resizable surface and in resizing!
- // So, don't blit now!
-#ifdef DEBUG_BUILD
- printf("WM_FSLIBNOTIFICATION : Can not blit if there is no surface, doing nothing.\n"); fflush(stdout);
-#endif
- } else
- {
- if (DosRequestMutexSem(pVideo->hidden->hmtxUseSrcBuffer, 1000)==NO_ERROR)
- {
- if (pVideo->hidden->pSDLSurface)
- {
-#ifndef RESIZE_EVEN_IF_RESIZABLE
- SWP swp;
-
- // But only blit if the window is not resizable, or if
- // the window is resizable and the source buffer size is the
- // same as the destination buffer size!
- WinQueryWindowPos(hwnd, &swp);
- if ((!pVideo->hidden->pSDLSurface) ||
- (
- (pVideo->hidden->pSDLSurface) &&
- (pVideo->hidden->pSDLSurface->flags & SDL_RESIZABLE) &&
- ((swp.cx != pVideo->hidden->SrcBufferDesc.uiXResolution) ||
- (swp.cy != pVideo->hidden->SrcBufferDesc.uiYResolution)
- ) &&
- (!FSLib_QueryFSMode(hwnd))
- )
- )
- {
- // Resizable surface and in resizing!
- // So, don't blit now!
-#ifdef DEBUG_BUILD
- printf("WM_FSLIBNOTIFICATION : Cannot blit while resizing, doing nothing.\n"); fflush(stdout);
-#endif
- } else
-#endif
- {
-#ifdef DEBUG_BUILD
- printf("WM_FSLIBNOTIFICATION : Blitting!\n"); fflush(stdout);
-#endif
- FSLIB_BITBLT(hwnd, pVideo->hidden->pchSrcBuffer,
- 0, 0,
- pVideo->hidden->SrcBufferDesc.uiXResolution,
- pVideo->hidden->SrcBufferDesc.uiYResolution);
- }
- }
-#ifdef DEBUG_BUILD
- else
- printf("WM_FSLIBNOTIFICATION : No public surface!\n"); fflush(stdout);
-#endif
-
- DosReleaseMutexSem(pVideo->hidden->hmtxUseSrcBuffer);
- }
- }
- }
- }
- return (MPARAM) 1;
-
- case WM_ACTIVATE:
-#ifdef DEBUG_BUILD
- printf("WM_ACTIVATE\n"); fflush(stdout);
-#endif
-
- pVideo = FSLib_GetUserParm(hwnd);
- if (pVideo)
- {
- pVideo->hidden->fInFocus = (int) mp1;
- if (pVideo->hidden->fInFocus)
- {
- // Went into focus
- if ((pVideo->hidden->iMouseVisible) && (!bMouseCaptured))
- WinSetPointer(HWND_DESKTOP, WinQuerySysPointer(HWND_DESKTOP, SPTR_ARROW, FALSE));
- else
- WinSetPointer(HWND_DESKTOP, NULL);
-
- if (bMouseCapturable)
- {
- // Re-capture the mouse, if we captured it before!
- WinSetCapture(HWND_DESKTOP, hwnd);
- bMouseCaptured = 1;
- {
- SWP swpClient;
- POINTL ptl;
- // Center the mouse to the middle of the window!
- WinQueryWindowPos(pVideo->hidden->hwndClient, &swpClient);
- ptl.x = 0; ptl.y = 0;
- WinMapWindowPoints(pVideo->hidden->hwndClient, HWND_DESKTOP, &ptl, 1);
- pVideo->hidden->iSkipWMMOUSEMOVE++; /* Don't take next WM_MOUSEMOVE into account! */
- WinSetPointerPos(HWND_DESKTOP,
- ptl.x + swpClient.cx/2,
- ptl.y + swpClient.cy/2);
- }
- }
- } else
- {
- // Went out of focus
- WinSetPointer(HWND_DESKTOP, WinQuerySysPointer(HWND_DESKTOP, SPTR_ARROW, FALSE));
-
- if (bMouseCaptured)
- {
- // Release the mouse
- WinSetCapture(HWND_DESKTOP, hwnd);
- bMouseCaptured = 0;
- }
- }
- }
-#ifdef DEBUG_BUILD
- printf("WM_ACTIVATE done\n"); fflush(stdout);
-#endif
-
- break;
-
- case WM_BUTTON1DOWN:
-#ifdef DEBUG_BUILD
- printf("WM_BUTTON1DOWN\n"); fflush(stdout);
-#endif
-
- pVideo = FSLib_GetUserParm(hwnd);
- if (pVideo)
- {
- SDL_PrivateMouseButton(SDL_PRESSED,
- SDL_BUTTON_LEFT,
- 0, 0); // Don't report mouse movement!
-
- if (bMouseCapturable)
- {
- // We should capture the mouse!
- if (!bMouseCaptured)
- {
- WinSetCapture(HWND_DESKTOP, hwnd);
- WinSetPointer(HWND_DESKTOP, NULL);
- bMouseCaptured = 1;
- {
- SWP swpClient;
- POINTL ptl;
- // Center the mouse to the middle of the window!
- WinQueryWindowPos(pVideo->hidden->hwndClient, &swpClient);
- ptl.x = 0; ptl.y = 0;
- WinMapWindowPoints(pVideo->hidden->hwndClient, HWND_DESKTOP, &ptl, 1);
- pVideo->hidden->iSkipWMMOUSEMOVE++; /* Don't take next WM_MOUSEMOVE into account! */
- WinSetPointerPos(HWND_DESKTOP,
- ptl.x + swpClient.cx/2,
- ptl.y + swpClient.cy/2);
- }
- }
- }
- }
- break;
- case WM_BUTTON1UP:
-#ifdef DEBUG_BUILD
- printf("WM_BUTTON1UP\n"); fflush(stdout);
-#endif
- SDL_PrivateMouseButton(SDL_RELEASED,
- SDL_BUTTON_LEFT,
- 0, 0); // Don't report mouse movement!
- break;
- case WM_BUTTON2DOWN:
-#ifdef DEBUG_BUILD
- printf("WM_BUTTON2DOWN\n"); fflush(stdout);
-#endif
-
- pVideo = FSLib_GetUserParm(hwnd);
- if (pVideo)
- {
- SDL_PrivateMouseButton(SDL_PRESSED,
- SDL_BUTTON_RIGHT,
- 0, 0); // Don't report mouse movement!
-
- if (bMouseCapturable)
- {
- // We should capture the mouse!
- if (!bMouseCaptured)
- {
- WinSetCapture(HWND_DESKTOP, hwnd);
- WinSetPointer(HWND_DESKTOP, NULL);
- bMouseCaptured = 1;
- {
- SWP swpClient;
- POINTL ptl;
- // Center the mouse to the middle of the window!
- WinQueryWindowPos(pVideo->hidden->hwndClient, &swpClient);
- ptl.x = 0; ptl.y = 0;
- WinMapWindowPoints(pVideo->hidden->hwndClient, HWND_DESKTOP, &ptl, 1);
- pVideo->hidden->iSkipWMMOUSEMOVE++; /* Don't take next WM_MOUSEMOVE into account! */
- WinSetPointerPos(HWND_DESKTOP,
- ptl.x + swpClient.cx/2,
- ptl.y + swpClient.cy/2);
- }
- }
- }
-
- }
- break;
- case WM_BUTTON2UP:
-#ifdef DEBUG_BUILD
- printf("WM_BUTTON2UP\n"); fflush(stdout);
-#endif
- SDL_PrivateMouseButton(SDL_RELEASED,
- SDL_BUTTON_RIGHT,
- 0, 0); // Don't report mouse movement!
- break;
- case WM_BUTTON3DOWN:
-#ifdef DEBUG_BUILD
- printf("WM_BUTTON3DOWN\n"); fflush(stdout);
-#endif
-
- pVideo = FSLib_GetUserParm(hwnd);
- if (pVideo)
- {
- SDL_PrivateMouseButton(SDL_PRESSED,
- SDL_BUTTON_MIDDLE,
- 0, 0); // Don't report mouse movement!
-
- if (bMouseCapturable)
- {
- // We should capture the mouse!
- if (!bMouseCaptured)
- {
- WinSetCapture(HWND_DESKTOP, hwnd);
- WinSetPointer(HWND_DESKTOP, NULL);
- bMouseCaptured = 1;
- {
- SWP swpClient;
- POINTL ptl;
- // Center the mouse to the middle of the window!
- WinQueryWindowPos(pVideo->hidden->hwndClient, &swpClient);
- ptl.x = 0; ptl.y = 0;
- WinMapWindowPoints(pVideo->hidden->hwndClient, HWND_DESKTOP, &ptl, 1);
- pVideo->hidden->iSkipWMMOUSEMOVE++; /* Don't take next WM_MOUSEMOVE into account! */
- WinSetPointerPos(HWND_DESKTOP,
- ptl.x + swpClient.cx/2,
- ptl.y + swpClient.cy/2);
- }
- }
- }
- }
- break;
- case WM_BUTTON3UP:
-#ifdef DEBUG_BUILD
- printf("WM_BUTTON3UP\n"); fflush(stdout);
-#endif
- SDL_PrivateMouseButton(SDL_RELEASED,
- SDL_BUTTON_MIDDLE,
- 0, 0); // Don't report mouse movement!
- break;
- case WM_MOUSEMOVE:
-#ifdef DEBUG_BUILD
-// printf("WM_MOUSEMOVE\n"); fflush(stdout);
-#endif
-
- pVideo = FSLib_GetUserParm(hwnd);
- if (pVideo)
- {
- if (pVideo->hidden->iSkipWMMOUSEMOVE)
- {
- pVideo->hidden->iSkipWMMOUSEMOVE--;
- } else
- {
- POINTS *ppts = (POINTS *) (&mp1);
- POINTL ptl;
-
- if (bMouseCaptured)
- {
- SWP swpClient;
-
- WinQueryWindowPos(pVideo->hidden->hwndClient, &swpClient);
-
- // Send relative mouse position, and re-center the mouse
- // Reposition the mouse to the center of the screen/window
- SDL_PrivateMouseMotion(0, // Buttons not changed
- 1, // Relative position
- ppts->x - (swpClient.cx/2),
- (swpClient.cy/2) - ppts->y);
-
- ptl.x = 0; ptl.y = 0;
- WinMapWindowPoints(pVideo->hidden->hwndClient, HWND_DESKTOP, &ptl, 1);
- pVideo->hidden->iSkipWMMOUSEMOVE++; /* Don't take next WM_MOUSEMOVE into account! */
- // Center the mouse to the middle of the window!
- WinSetPointerPos(HWND_DESKTOP,
- ptl.x + swpClient.cx/2,
- ptl.y + swpClient.cy/2);
- } else
- {
- CONVERTMOUSEPOSITION();
-
- // Send absolute mouse position
- SDL_PrivateMouseMotion(0, // Buttons not changed
- 0, // Absolute position
- ppts->x,
- ppts->y);
- }
- }
- if ((pVideo->hidden->iMouseVisible) && (!bMouseCaptured))
- {
-#ifdef DEBUG_BUILD
-// printf("WM_MOUSEMOVE : ptr = %p\n", hptrGlobalPointer); fflush(stdout);
-#endif
-
- if (hptrGlobalPointer)
- WinSetPointer(HWND_DESKTOP, hptrGlobalPointer);
- else
- WinSetPointer(HWND_DESKTOP, WinQuerySysPointer(HWND_DESKTOP, SPTR_ARROW, FALSE));
- }
- else
- {
- WinSetPointer(HWND_DESKTOP, NULL);
- }
- }
-#ifdef DEBUG_BUILD
-// printf("WM_MOUSEMOVE done\n"); fflush(stdout);
-#endif
-
- return (MRESULT) FALSE;
- case WM_CLOSE: // Window close
-#ifdef DEBUG_BUILD
- printf("WM_CLOSE\n"); fflush(stdout);
-#endif
-
- pVideo = FSLib_GetUserParm(hwnd);
- if (pVideo)
- {
- // Send Quit message to the SDL application!
- SDL_PrivateQuit();
- return 0;
- }
- break;
-
-#ifdef BITBLT_IN_WINMESSAGEPROC
- case WM_UPDATERECTSREQUEST:
- pVideo = FSLib_GetUserParm(hwnd);
- if ((pVideo) && (pVideo->hidden->pSDLSurface))
- {
- if (DosRequestMutexSem(pVideo->hidden->hmtxUseSrcBuffer, SEM_INDEFINITE_WAIT)==NO_ERROR)
- {
- int numrects;
- SDL_Rect *rects;
- int i;
- SWP swp;
-
- numrects = (int) mp1;
- rects = (SDL_Rect *) mp2;
-
- WinQueryWindowPos(hwnd, &swp);
-#ifndef RESIZE_EVEN_IF_RESIZABLE
- if ((!pVideo->hidden->pSDLSurface) ||
- (
- (pVideo->hidden->pSDLSurface) &&
- (pVideo->hidden->pSDLSurface->flags & SDL_RESIZABLE) &&
- ((swp.cx != pVideo->hidden->SrcBufferDesc.uiXResolution) ||
- (swp.cy != pVideo->hidden->SrcBufferDesc.uiYResolution)
- ) &&
- (!FSLib_QueryFSMode(hwnd))
- )
- )
- {
- // Resizable surface and in resizing!
- // So, don't blit now!
-#ifdef DEBUG_BUILD
- printf("[WM_UPDATERECTSREQUEST] : Skipping blit while resizing!\n"); fflush(stdout);
-#endif
- } else
-#endif
- {
-#ifdef DEBUG_BUILD
- printf("[WM_UPDATERECTSREQUEST] : Blitting!\n"); fflush(stdout);
-#endif
-
- // Blit the changed areas
- for (i=0; i<numrects; i++)
- FSLIB_BITBLT(hwnd, pVideo->hidden->pchSrcBuffer,
- rects[i].y, rects[i].x, rects[i].w, rects[i].h);
- }
- DosReleaseMutexSem(pVideo->hidden->hmtxUseSrcBuffer);
- }
- }
- return 0;
-#endif
-
- default:
-#ifdef DEBUG_BUILD
- printf("Unhandled: %x\n", msg); fflush(stdout);
-#endif
-
- break;
- }
- // Run the default window procedure for unhandled stuffs
- return WinDefWindowProc(hwnd, msg, mp1, mp2);
-}
-
-/////////////////////////////////////////////////////////////////////
-//
-// FrameWndProc
-//
-// This is the message processing window procedure for the
-// frame window of SDLWindowClass.
-//
-/////////////////////////////////////////////////////////////////////
-static MRESULT EXPENTRY FrameWndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
-{
- PFNWP pOldFrameProc;
- MRESULT result;
- PTRACKINFO ti;
- int cx, cy, ncx, ncy;
- RECTL rclTemp;
- PSWP pswpTemp;
-
- SDL_VideoDevice *pVideo = NULL;
-
- pVideo = (SDL_VideoDevice *) WinQueryWindowULong(hwnd, QWL_USER);
-
- pOldFrameProc = pVideo->hidden->pfnOldFrameProc;
-
- if ((pVideo->hidden->bProportionalResize) &&
- (msg==WM_ADJUSTWINDOWPOS) &&
- (!FSLib_QueryFSMode(pVideo->hidden->hwndClient))
- )
- {
- pswpTemp = (PSWP) mp1;
-
- /* Resizing? */
- if (pswpTemp->fl & SWP_SIZE)
- {
- /* Calculate client size */
- rclTemp.xLeft = pswpTemp->x;
- rclTemp.xRight = pswpTemp->x + pswpTemp->cx;
- rclTemp.yBottom = pswpTemp->y;
- rclTemp.yTop = pswpTemp->y + pswpTemp->cy;
- WinCalcFrameRect(hwnd, &rclTemp, TRUE);
-
- ncx = cx = rclTemp.xRight - rclTemp.xLeft;
- ncy = cy = rclTemp.yTop - rclTemp.yBottom;
-
- /* Calculate new size to keep it proportional */
-
- if ((pVideo->hidden->ulResizingFlag & TF_LEFT) || (pVideo->hidden->ulResizingFlag & TF_RIGHT))
- {
- /* The window is resized horizontally */
- ncy = pVideo->hidden->SrcBufferDesc.uiYResolution * cx / pVideo->hidden->SrcBufferDesc.uiXResolution;
- } else
- if ((pVideo->hidden->ulResizingFlag & TF_TOP) || (pVideo->hidden->ulResizingFlag & TF_BOTTOM))
- {
- /* The window is resized vertically */
- ncx = pVideo->hidden->SrcBufferDesc.uiXResolution * cy / pVideo->hidden->SrcBufferDesc.uiYResolution;
- }
-
- /* Calculate back frame coordinates */
- rclTemp.xLeft = pswpTemp->x;
- rclTemp.xRight = pswpTemp->x + ncx;
- rclTemp.yBottom = pswpTemp->y;
- rclTemp.yTop = pswpTemp->y + ncy;
- WinCalcFrameRect(hwnd, &rclTemp, FALSE);
-
- /* Store new size/position info */
- pswpTemp->cx = rclTemp.xRight - rclTemp.xLeft;
-
- if (!(pVideo->hidden->ulResizingFlag & TF_TOP))
- {
- pswpTemp->y = pswpTemp->y + pswpTemp->cy - (rclTemp.yTop - rclTemp.yBottom);
- pswpTemp->cy = rclTemp.yTop - rclTemp.yBottom;
- } else
- {
- pswpTemp->cy = rclTemp.yTop - rclTemp.yBottom;
- }
- }
- }
-
- result = (*pOldFrameProc)(hwnd, msg, mp1, mp2);
-
- if ((pVideo->hidden->bProportionalResize) && (msg==WM_QUERYTRACKINFO))
- {
- ti = (PTRACKINFO) mp2;
-
- /* Store the direction of resizing */
- if ((ti->fs & TF_LEFT) || (ti->fs & TF_RIGHT) ||
- (ti->fs & TF_TOP) || (ti->fs & TF_BOTTOM))
- pVideo->hidden->ulResizingFlag = ti->fs;
- }
-
- return result;
-}
-
-/////////////////////////////////////////////////////////////////////
-//
-// PMThreadFunc
-//
-// This function implements the PM-Thread, which initializes the
-// application window itself, the DIVE, and start message processing.
-//
-/////////////////////////////////////////////////////////////////////
-int iNumOfPMThreadInstances = 0; // Global!
-static void PMThreadFunc(void *pParm)
-{
- SDL_VideoDevice *pVideo = pParm;
- HAB hab;
- HMQ hmq;
- QMSG msg;
- ULONG fcf;
-
-#ifdef DEBUG_BUILD
- printf("[PMThreadFunc] : Starting\n"); fflush(stdout);
-#endif
-
- iNumOfPMThreadInstances++;
-
- // Initialize PM, create a message queue.
-
- hab=WinInitialize(0);
- hmq=WinCreateMsgQueue(hab,0);
- if (hmq==0)
- {
-#ifdef DEBUG_BUILD
- printf("[PMThreadFunc] : Could not create message queue!\n");
- printf(" It might be that the application using SDL is not a PM app!\n");
- fflush(stdout);
-#endif
- pVideo->hidden->iPMThreadStatus = 2;
- } else
- {
- int rc;
- RECTL rectl;
-
- fcf = ulFCFToUse; // Get from global setting
-
-#ifdef DEBUG_BUILD
- printf("[PMThreadFunc] : FSLib_CreateWindow()!\n");
- fflush(stdout);
-#endif
-
- rc = FSLib_CreateWindow(HWND_DESKTOP, 0, &fcf,
- "SDL Application",
- NULLHANDLE, 0,
- &(pVideo->hidden->SrcBufferDesc),
- WndProc,
- &(pVideo->hidden->hwndClient),
- &(pVideo->hidden->hwndFrame));
-
-#ifdef DEBUG_BUILD
- printf("[PMThreadFunc] : FSLib_CreateWindow() rc = %d\n", rc);
- fflush(stdout);
-#endif
-
- if (!rc)
- {
-#ifdef DEBUG_BUILD
- printf("[PMThreadFunc] : Could not create FSLib window!\n");
- fflush(stdout);
-#endif
- pVideo->hidden->iPMThreadStatus = 3;
- } else
- {
-#ifdef DEBUG_BUILD
- printf("[PMThreadFunc] : FSLib_AddUserParm()!\n");
- fflush(stdout);
-#endif
-
- // Store pVideo pointer in window data for client window, so
- // it will know the instance to which it belongs to.
- FSLib_AddUserParm(pVideo->hidden->hwndClient, pVideo);
-
- // Now set default image width height and fourcc!
-#ifdef DEBUG_BUILD
- printf("[PMThreadFunc] : SetWindowPos()!\n");
- fflush(stdout);
-#endif
-
- // Set the position and size of the main window,
- // and make it visible!
- // Calculate frame window size from client window size
- rectl.xLeft = 0;
- rectl.yBottom = 0;
- rectl.xRight = pVideo->hidden->SrcBufferDesc.uiXResolution; // Noninclusive
- rectl.yTop = pVideo->hidden->SrcBufferDesc.uiYResolution; // Noninclusive
- WinCalcFrameRect(pVideo->hidden->hwndFrame, &rectl, FALSE);
-
- SetAccessableWindowPos(pVideo->hidden->hwndFrame,
- HWND_TOP,
- (WinQuerySysValue (HWND_DESKTOP, SV_CXSCREEN) - (rectl.xRight-rectl.xLeft)) / 2,
- (WinQuerySysValue (HWND_DESKTOP, SV_CYSCREEN) - (rectl.yTop-rectl.yBottom)) / 2,
- (rectl.xRight-rectl.xLeft),
- (rectl.yTop-rectl.yBottom),
- SWP_SIZE | SWP_ACTIVATE | SWP_SHOW | SWP_MOVE);
-
- // Subclass frame procedure and store old window proc address
- pVideo->hidden->pfnOldFrameProc =
- WinSubclassWindow(pVideo->hidden->hwndFrame, FrameWndProc);
- WinSetWindowULong(pVideo->hidden->hwndFrame, QWL_USER, (ULONG) pVideo);
-
-#ifdef DEBUG_BUILD
- printf("[PMThreadFunc] : Entering message loop\n"); fflush(stdout);
-#endif
- pVideo->hidden->iPMThreadStatus = 1;
-
- while (WinGetMsg(hab, (PQMSG)&msg, 0, 0, 0))
- WinDispatchMsg(hab, (PQMSG) &msg);
-
-#ifdef DEBUG_BUILD
- printf("[PMThreadFunc] : Leaving message loop\n"); fflush(stdout);
-#endif
- // We should release the captured the mouse!
- if (bMouseCaptured)
- {
- WinSetCapture(HWND_DESKTOP, NULLHANDLE);
- bMouseCaptured = 0;
- }
- // Destroy our window
- WinDestroyWindow(pVideo->hidden->hwndFrame); pVideo->hidden->hwndFrame=NULL;
- // Show pointer to make sure it will not be left hidden.
- WinSetPointer(HWND_DESKTOP, WinQuerySysPointer(HWND_DESKTOP, SPTR_ARROW, FALSE));
- WinShowPointer(HWND_DESKTOP, TRUE);
- }
- // Uninitialize PM
- WinDestroyMsgQueue(hmq);
- // All done!
- pVideo->hidden->iPMThreadStatus = 0;
- }
- WinTerminate(hab);
- /* Commented out, should not be needed anymore, because we send it
- from WM_CLOSE.
- // Notify SDL that it should really die now...
- SDL_PrivateQuit(); SDL_PrivateQuit(); SDL_PrivateQuit(); //... :))
- */
-#ifdef DEBUG_BUILD
- printf("[PMThreadFunc] : End, status is %d!\n", pVideo->hidden->iPMThreadStatus); fflush(stdout);
-#endif
-
- iNumOfPMThreadInstances--;
-
- // HACK to prevent zombie and hanging SDL applications, which does not take
- // care of closing the window for some reason:
- // There are some apps which do not process messages, so do a lot of things
- // without noticing that the application should close. To close these,
- // I've thought about the following:
- // If the window is closed (the execution came here), I wait a bit to
- // give time to the app to finish its execution. If it does not, I kill it
- // using DosExit(). Brute force, but should work.
- if (pVideo->hidden->iPMThreadStatus==0)
- {
- DosSleep(5000); // Wait 5 secs
- // If a new PM thread has been spawned (reinitializing video mode), then all right.
- // Otherwise, we have a problem, the app doesn't want to stop. Kill!
- if (iNumOfPMThreadInstances==0)
- {
-#ifdef DEBUG_BUILD
- printf("[PMThreadFunc] : It seems that the application haven't terminated itself\n"); fflush(stdout);
- printf("[PMThreadFunc] : in the last 5 seconds, so we go berserk.\n"); fflush(stdout);
- printf("[PMThreadFunc] : Brute force mode. :) Killing process! Dieeeee...\n"); fflush(stdout);
-#endif
- DosExit(EXIT_PROCESS, -1);
- }
- }
- _endthread();
-}
-
-struct WMcursor
-{
- HBITMAP hbm;
- HPOINTER hptr;
- char *pchData;
-};
-
-/* Free a window manager cursor */
-void os2fslib_FreeWMCursor(_THIS, WMcursor *cursor)
-{
- if (cursor)
- {
- GpiDeleteBitmap(cursor->hbm);
- WinDestroyPointer(cursor->hptr);
- SDL_free(cursor->pchData);
- SDL_free(cursor);
- }
-}
-
-/* Local functions to convert the SDL cursor mask into OS/2 format */
-static void memnot(Uint8 *dst, Uint8 *src, int len)
-{
- while ( len-- > 0 )
- *dst++ = ~*src++;
-}
-static void memxor(Uint8 *dst, Uint8 *src1, Uint8 *src2, int len)
-{
- while ( len-- > 0 )
- *dst++ = (*src1++)^(*src2++);
-}
-
-/* Create a black/white window manager cursor */
-WMcursor *os2fslib_CreateWMCursor_Win(_THIS, Uint8 *data, Uint8 *mask,
- int w, int h, int hot_x, int hot_y)
-{
- HPOINTER hptr;
- HBITMAP hbm;
- BITMAPINFOHEADER bmih;
- BMPINFO bmi;
- HPS hps;
- char *pchTemp;
- char *xptr, *aptr;
- int maxx, maxy;
- int i, run, pad;
- WMcursor *pResult;
-
- maxx = WinQuerySysValue(HWND_DESKTOP, SV_CXPOINTER);
- maxy = WinQuerySysValue(HWND_DESKTOP, SV_CYPOINTER);
-
- // Check for max size!
- if ((w>maxx) || (h>maxy))
- return (WMcursor *) NULL;
-
- pResult = (WMcursor *) SDL_malloc(sizeof(WMcursor));
- if (!pResult) return (WMcursor *) NULL;
-
- pchTemp = (char *) SDL_malloc((maxx + 7)/8 * maxy*2);
- if (!pchTemp)
- {
- SDL_free(pResult);
- return (WMcursor *) NULL;
- }
-
- SDL_memset(pchTemp, 0, (maxx + 7)/8 * maxy*2);
-
- hps = WinGetPS(_this->hidden->hwndClient);
-
- bmi.cbFix = sizeof(BITMAPINFOHEADER);
- bmi.cx = maxx;
- bmi.cy = 2*maxy;
- bmi.cPlanes = 1;
- bmi.cBitCount = 1;
- bmi.argbColor[0].bBlue = 0x00;
- bmi.argbColor[0].bGreen = 0x00;
- bmi.argbColor[0].bRed = 0x00;
- bmi.argbColor[1].bBlue = 0x00;
- bmi.argbColor[1].bGreen = 0x00;
- bmi.argbColor[1].bRed = 0xff;
-
- SDL_memset(&bmih, 0, sizeof(BITMAPINFOHEADER));
- bmih.cbFix = sizeof(BITMAPINFOHEADER);
- bmih.cx = maxx;
- bmih.cy = 2*maxy;
- bmih.cPlanes = 1;
- bmih.cBitCount = 1;
-
- run = (w+7)/8;
- pad = (maxx+7)/8 - run;
-
- for (i=0; i<h; i++)
- {
- xptr = pchTemp + (maxx+7)/8 * (maxy-1-i);
- aptr = pchTemp + (maxx+7)/8 * (maxy+maxy-1-i);
- memxor(xptr, data, mask, run);
- xptr += run;
- data += run;
- memnot(aptr, mask, run);
- mask += run;
- aptr += run;
- SDL_memset(xptr, 0, pad);
- xptr += pad;
- SDL_memset(aptr, ~0, pad);
- aptr += pad;
- }
- pad += run;
- for (i=h ; i<maxy; i++ )
- {
- xptr = pchTemp + (maxx+7)/8 * (maxy-1-i);
- aptr = pchTemp + (maxx+7)/8 * (maxy+maxy-1-i);
-
- SDL_memset(xptr, 0, (maxx+7)/8);
- xptr += (maxx+7)/8;
- SDL_memset(aptr, ~0, (maxx+7)/8);
- aptr += (maxx+7)/8;
- }
-
- hbm = GpiCreateBitmap(hps, (PBITMAPINFOHEADER2)&bmih, CBM_INIT, (PBYTE) pchTemp, (PBITMAPINFO2)&bmi);
- hptr = WinCreatePointer(HWND_DESKTOP, hbm, TRUE, hot_x, maxy - hot_y - 1);
-
-#ifdef DEBUG_BUILD
- printf("HotSpot : %d ; %d\n", hot_x, hot_y);
- printf("HPS returned : %x\n", (ULONG)hps);
- printf("HBITMAP returned : %x\n", (ULONG)hbm);
- printf("HPOINTER returned: %x\n", (ULONG)hptr);
-#endif
-
- WinReleasePS(hps);
-
-#ifdef DEBUG_BUILD
- printf("[CreateWMCursor] : ptr = %p\n", hptr); fflush(stdout);
-#endif
-
- pResult->hptr = hptr;
- pResult->hbm = hbm;
- pResult->pchData = pchTemp;
-
-#ifdef DEBUG_BUILD
- printf("[CreateWMCursor] : ptr = %p return.\n", hptr); fflush(stdout);
-#endif
-
- return (WMcursor *) pResult;
-}
-
-WMcursor *os2fslib_CreateWMCursor_FS(_THIS, Uint8 *data, Uint8 *mask,
- int w, int h, int hot_x, int hot_y)
-{
-#ifdef DEBUG_BUILD
- printf("[CreateWMCursor_FS] : returning pointer NULL\n"); fflush(stdout);
-#endif
-
- // In FS mode we'll use software cursor
- return (WMcursor *) NULL;
-}
-
-/* Show the specified cursor, or hide if cursor is NULL */
-int os2fslib_ShowWMCursor(_THIS, WMcursor *cursor)
-{
-#ifdef DEBUG_BUILD
- printf("[ShowWMCursor] : ptr = %p\n", cursor); fflush(stdout);
-#endif
-
- if (cursor)
- {
- WinSetPointer(HWND_DESKTOP, cursor->hptr);
- hptrGlobalPointer = cursor->hptr;
- _this->hidden->iMouseVisible = 1;
- }
- else
- {
- WinSetPointer(HWND_DESKTOP, FALSE);
- hptrGlobalPointer = NULL;
- _this->hidden->iMouseVisible = 0;
- }
-
-#ifdef DEBUG_BUILD
- printf("[ShowWMCursor] : ptr = %p, DONE\n", cursor); fflush(stdout);
-#endif
-
- return 1;
-}
-
-/* Warp the window manager cursor to (x,y)
- If NULL, a mouse motion event is posted internally.
- */
-void os2fslib_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
-{
- LONG lx, ly;
- SWP swpClient;
- POINTL ptlPoints;
- WinQueryWindowPos(_this->hidden->hwndClient, &swpClient);
- ptlPoints.x = swpClient.x;
- ptlPoints.y = swpClient.y;
- WinMapWindowPoints(_this->hidden->hwndFrame, HWND_DESKTOP, &ptlPoints, 1);
- lx = ptlPoints.x + (x*swpClient.cx) / _this->hidden->SrcBufferDesc.uiXResolution;
- ly = ptlPoints.y + swpClient.cy - ((y*swpClient.cy) / _this->hidden->SrcBufferDesc.uiYResolution) - 1;
-
- SDL_PrivateMouseMotion(0, // Buttons not changed
- 0, // Absolute position
- x,
- y);
-
- WinSetPointerPos(HWND_DESKTOP, lx, ly);
-
-}
-
-/* If not NULL, this is called when a mouse motion event occurs */
-void os2fslib_MoveWMCursor(_THIS, int x, int y)
-{
- /*
- SDL_Rect rect;
-
-#ifdef DEBUG_BUILD
- printf("[MoveWMCursor] : at %d ; %d\n", x, y); fflush(stdout);
-#endif
-
- rect.x = x;
- rect.y = y;
- rect.w = 32;
- rect.h = 32;
- os2fslib_UpdateRects(_this, 1, &rect);
- // TODO!
- */
-}
-
-/* Determine whether the mouse should be in relative mode or not.
- This function is called when the input grab state or cursor
- visibility state changes.
- If the cursor is not visible, and the input is grabbed, the
- driver can place the mouse in relative mode, which may result
- in higher accuracy sampling of the pointer motion.
- */
-void os2fslib_CheckMouseMode(_THIS)
-{
-}
-
-static void os2fslib_PumpEvents(_THIS)
-{
- // Notify SDL that if window has been resized!
- if (
- (_this->hidden->pSDLSurface) &&
- (_this->hidden->pSDLSurface->flags & SDL_RESIZABLE) &&
- (
- (_this->hidden->SrcBufferDesc.uiXResolution!=iWindowSizeX) ||
- (_this->hidden->SrcBufferDesc.uiYResolution!=iWindowSizeY)
- ) &&
- (iWindowSizeX>0) &&
- (iWindowSizeY>0)
- )
- {
- static time_t prev_time;
- time_t curr_time;
-
- curr_time = time(NULL);
- if ((difftime(curr_time, prev_time)>=0.25) ||
- (bWindowResized))
- {
- // Make sure we won't flood the event queue with resize events,
- // only send them at 250 msecs!
- // (or when the window is resized)
-#ifdef DEBUG_BUILD
- printf("[os2fslib_PumpEvents] : Calling PrivateResize (%d %d).\n",
- iWindowSizeX, iWindowSizeY);
- fflush(stdout);
-#endif
- // Tell SDL the new size
- SDL_PrivateResize(iWindowSizeX, iWindowSizeY);
- prev_time = curr_time;
- bWindowResized = 0;
- }
- }
-}
-
-/* We don't actually allow hardware surfaces other than the main one */
-static int os2fslib_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- return(-1);
-}
-static void os2fslib_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-/* We need to wait for vertical retrace on page flipped displays */
-static int os2fslib_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- return(0);
-}
-
-static void os2fslib_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-static int os2fslib_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- printf("[os2fslib_SetColors] : TODO!\n"); fflush(stdout);
- // TODO: Implement paletted modes
- return(1);
-}
-
-static void os2fslib_DestroyIcon(HWND hwndFrame)
-{
- if (hptrCurrentIcon)
- {
- WinDestroyPointer(hptrCurrentIcon);
- hptrCurrentIcon = NULL;
-
- WinSendMsg(hwndFrame,
- WM_SETICON,
- NULL,
- NULL);
- }
-
-}
-
-/* Set the window icon image */
-void os2fslib_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask)
-{
- HWND hwndFrame;
- SDL_Surface *icon_rgb;
- HPOINTER hptrIcon;
- HBITMAP hbm;
- BITMAPINFOHEADER bmih;
- BMPINFO bmi;
- HPS hps;
- char *pchTemp;
- char *pptr, *mptr, *dptr, *dmptr;
- int maxx, maxy, w, h, x, y;
- SDL_Rect bounds;
-
-#ifdef DEBUG_BUILD
- printf("[os2fslib_SetIcon] : Creating and setting new icon\n"); fflush(stdout);
-#endif
-
- hwndFrame = WinQueryWindow(_this->hidden->hwndClient, QW_PARENT);
-
- // Make sure the old icon resource will be free'd!
- os2fslib_DestroyIcon(hwndFrame);
-
- if ((!icon) || (!mask))
- return;
-
- w = icon->w;
- h = icon->h;
-
- maxx = WinQuerySysValue(HWND_DESKTOP, SV_CXICON);
- maxy = WinQuerySysValue(HWND_DESKTOP, SV_CYICON);
-
- // Check for max size!
- if ((w>maxx) || (h>maxy))
- return;
-
- pchTemp = (char *) SDL_malloc(w * h*2 * 4);
- if (!pchTemp)
- return;
-
- SDL_memset(pchTemp, 0, w * h*2 * 4);
-
- // Convert surface to RGB, if it's not RGB yet!
- icon_rgb = SDL_CreateRGBSurface(SDL_SWSURFACE, icon->w, icon->h,
- 32, 0, 0, 0, 0);
- if ( icon_rgb == NULL )
- {
- SDL_free(pchTemp);
- return;
- }
- bounds.x = 0;
- bounds.y = 0;
- bounds.w = icon->w;
- bounds.h = icon->h;
- if ( SDL_LowerBlit(icon, &bounds, icon_rgb, &bounds) < 0 )
- {
- SDL_FreeSurface(icon_rgb);
- SDL_free(pchTemp);
- return;
- }
-
- /* Copy pixels upside-down from RGB surface into BMP, masked with the icon mask */
-
- // Pixels
- pptr = (char *) (icon_rgb->pixels);
- // Mask
- mptr = mask;
-
- for (y=0; y<h; y++)
- {
- unsigned char uchMaskByte;
-
- // Destination
- dptr = pchTemp + w*4 * (h-y-1);
- // Destination mask
- dmptr = pchTemp + w*h*4 + w*4 * (h-y-1);
-
- for (x=0; x<w; x++)
- {
- if (x%8==0)
- {
- uchMaskByte = (unsigned char) (*mptr);
- mptr++;
- } else
- uchMaskByte <<= 1;
-
- if (uchMaskByte & 0x80)
- {
- // Copy RGB
- *dptr++ = *pptr++;
- *dptr++ = *pptr++;
- *dptr++ = *pptr++;
- *dptr++ = *pptr++;
-
- *dmptr++ = 0;
- *dmptr++ = 0;
- *dmptr++ = 0;
- *dmptr++ = 0;
- } else
- {
- // Set pixels to fully transparent
- *dptr++ = 0; pptr++;
- *dptr++ = 0; pptr++;
- *dptr++ = 0; pptr++;
- *dptr++ = 0; pptr++;
-
- *dmptr++ = 255;
- *dmptr++ = 255;
- *dmptr++ = 255;
- *dmptr++ = 255;
- }
- }
- }
-
- // There is no more need for the RGB surface
- SDL_FreeSurface(icon_rgb);
-
- hps = WinGetPS(_this->hidden->hwndClient);
-
- bmi.cbFix = sizeof(BITMAPINFOHEADER);
- bmi.cx = w;
- bmi.cy = 2*h;
- bmi.cPlanes = 1;
- bmi.cBitCount = 32;
-
- SDL_memset(&bmih, 0, sizeof(BITMAPINFOHEADER));
- bmih.cbFix = sizeof(BITMAPINFOHEADER);
- bmih.cx = w;
- bmih.cy = 2*h;
- bmih.cPlanes = 1;
- bmih.cBitCount = 32;
-
- hbm = GpiCreateBitmap(hps, (PBITMAPINFOHEADER2)&bmih, CBM_INIT, (PBYTE) pchTemp, (PBITMAPINFO2)&bmi);
- hptrIcon = WinCreatePointer(HWND_DESKTOP, hbm, FALSE, 0, 0);
-
- WinReleasePS(hps);
-
- // Free pixel array
- SDL_free(pchTemp);
-
- // Change icon in frame window
- WinSendMsg(hwndFrame,
- WM_SETICON,
- (MPARAM) hptrIcon,
- NULL);
-
- /*
- // Change icon in switchlist
- // Seems like it's not needed, the WM_SETICON already does it.
- {
- PID pidFrame;
- HSWITCH hswitchFrame;
- SWCNTRL swctl;
-
- WinQueryWindowProcess(hwndFrame, &pidFrame, NULL);
- hswitchFrame = WinQuerySwitchHandle(hwndFrame, pidFrame);
- WinQuerySwitchEntry(hswitchFrame, &swctl);
-
- swctl.hwndIcon = hptrIcon;
-
- WinChangeSwitchEntry(hswitchFrame, &swctl);
- }
- */
-
- // Store icon handle in global variable
- hptrCurrentIcon = hptrIcon;
-}
-
-// ------------------------ REAL FUNCTIONS -----------------
-
-
-static void os2fslib_SetCursorManagementFunctions(_THIS, int iForWindowedMode)
-{
- if (iForWindowedMode)
- {
- _this->FreeWMCursor = os2fslib_FreeWMCursor;
- _this->CreateWMCursor = os2fslib_CreateWMCursor_Win;
- _this->ShowWMCursor = os2fslib_ShowWMCursor;
- _this->WarpWMCursor = os2fslib_WarpWMCursor;
- _this->MoveWMCursor = os2fslib_MoveWMCursor;
- _this->CheckMouseMode = NULL;//os2fslib_CheckMouseMode;
- } else
- {
- // We'll have software mouse cursor in FS mode!
- _this->FreeWMCursor = os2fslib_FreeWMCursor;
- _this->CreateWMCursor = os2fslib_CreateWMCursor_FS;
- _this->ShowWMCursor = os2fslib_ShowWMCursor;
- _this->WarpWMCursor = os2fslib_WarpWMCursor;
- _this->MoveWMCursor = os2fslib_MoveWMCursor;
- _this->CheckMouseMode = NULL;//os2fslib_CheckMouseMode;
- }
-}
-
-static void os2fslib_InitOSKeymap(_THIS)
-{
- int i;
-
- iShiftIsPressed = 0;
-
- /* Map the VK and CH keysyms */
- for ( i=0; i<=255; ++i )
- HWScanKeyMap[i] = SDLK_UNKNOWN;
-
- // First line of keyboard:
- HWScanKeyMap[0x1] = SDLK_ESCAPE;
- HWScanKeyMap[0x3b] = SDLK_F1;
- HWScanKeyMap[0x3c] = SDLK_F2;
- HWScanKeyMap[0x3d] = SDLK_F3;
- HWScanKeyMap[0x3e] = SDLK_F4;
- HWScanKeyMap[0x3f] = SDLK_F5;
- HWScanKeyMap[0x40] = SDLK_F6;
- HWScanKeyMap[0x41] = SDLK_F7;
- HWScanKeyMap[0x42] = SDLK_F8;
- HWScanKeyMap[0x43] = SDLK_F9;
- HWScanKeyMap[0x44] = SDLK_F10;
- HWScanKeyMap[0x57] = SDLK_F11;
- HWScanKeyMap[0x58] = SDLK_F12;
- HWScanKeyMap[0x5d] = SDLK_PRINT;
- HWScanKeyMap[0x46] = SDLK_SCROLLOCK;
- HWScanKeyMap[0x5f] = SDLK_PAUSE;
-
- // Second line of keyboard:
- HWScanKeyMap[0x29] = SDLK_BACKQUOTE;
- HWScanKeyMap[0x2] = SDLK_1;
- HWScanKeyMap[0x3] = SDLK_2;
- HWScanKeyMap[0x4] = SDLK_3;
- HWScanKeyMap[0x5] = SDLK_4;
- HWScanKeyMap[0x6] = SDLK_5;
- HWScanKeyMap[0x7] = SDLK_6;
- HWScanKeyMap[0x8] = SDLK_7;
- HWScanKeyMap[0x9] = SDLK_8;
- HWScanKeyMap[0xa] = SDLK_9;
- HWScanKeyMap[0xb] = SDLK_0;
- HWScanKeyMap[0xc] = SDLK_MINUS;
- HWScanKeyMap[0xd] = SDLK_EQUALS;
- HWScanKeyMap[0xe] = SDLK_BACKSPACE;
- HWScanKeyMap[0x68] = SDLK_INSERT;
- HWScanKeyMap[0x60] = SDLK_HOME;
- HWScanKeyMap[0x62] = SDLK_PAGEUP;
- HWScanKeyMap[0x45] = SDLK_NUMLOCK;
- HWScanKeyMap[0x5c] = SDLK_KP_DIVIDE;
- HWScanKeyMap[0x37] = SDLK_KP_MULTIPLY;
- HWScanKeyMap[0x4a] = SDLK_KP_MINUS;
-
- // Third line of keyboard:
- HWScanKeyMap[0xf] = SDLK_TAB;
- HWScanKeyMap[0x10] = SDLK_q;
- HWScanKeyMap[0x11] = SDLK_w;
- HWScanKeyMap[0x12] = SDLK_e;
- HWScanKeyMap[0x13] = SDLK_r;
- HWScanKeyMap[0x14] = SDLK_t;
- HWScanKeyMap[0x15] = SDLK_y;
- HWScanKeyMap[0x16] = SDLK_u;
- HWScanKeyMap[0x17] = SDLK_i;
- HWScanKeyMap[0x18] = SDLK_o;
- HWScanKeyMap[0x19] = SDLK_p;
- HWScanKeyMap[0x1a] = SDLK_LEFTBRACKET;
- HWScanKeyMap[0x1b] = SDLK_RIGHTBRACKET;
- HWScanKeyMap[0x1c] = SDLK_RETURN;
- HWScanKeyMap[0x69] = SDLK_DELETE;
- HWScanKeyMap[0x65] = SDLK_END;
- HWScanKeyMap[0x67] = SDLK_PAGEDOWN;
- HWScanKeyMap[0x47] = SDLK_KP7;
- HWScanKeyMap[0x48] = SDLK_KP8;
- HWScanKeyMap[0x49] = SDLK_KP9;
- HWScanKeyMap[0x4e] = SDLK_KP_PLUS;
-
- // Fourth line of keyboard:
- HWScanKeyMap[0x3a] = SDLK_CAPSLOCK;
- HWScanKeyMap[0x1e] = SDLK_a;
- HWScanKeyMap[0x1f] = SDLK_s;
- HWScanKeyMap[0x20] = SDLK_d;
- HWScanKeyMap[0x21] = SDLK_f;
- HWScanKeyMap[0x22] = SDLK_g;
- HWScanKeyMap[0x23] = SDLK_h;
- HWScanKeyMap[0x24] = SDLK_j;
- HWScanKeyMap[0x25] = SDLK_k;
- HWScanKeyMap[0x26] = SDLK_l;
- HWScanKeyMap[0x27] = SDLK_SEMICOLON;
- HWScanKeyMap[0x28] = SDLK_QUOTE;
- HWScanKeyMap[0x2b] = SDLK_BACKSLASH;
- HWScanKeyMap[0x4b] = SDLK_KP4;
- HWScanKeyMap[0x4c] = SDLK_KP5;
- HWScanKeyMap[0x4d] = SDLK_KP6;
-
- // Fifth line of keyboard:
- HWScanKeyMap[0x2a] = SDLK_LSHIFT;
- HWScanKeyMap[0x56] = SDLK_WORLD_1; // Code 161, letter i' on hungarian keyboard
- HWScanKeyMap[0x2c] = SDLK_z;
- HWScanKeyMap[0x2d] = SDLK_x;
- HWScanKeyMap[0x2e] = SDLK_c;
- HWScanKeyMap[0x2f] = SDLK_v;
- HWScanKeyMap[0x30] = SDLK_b;
- HWScanKeyMap[0x31] = SDLK_n;
- HWScanKeyMap[0x32] = SDLK_m;
- HWScanKeyMap[0x33] = SDLK_COMMA;
- HWScanKeyMap[0x34] = SDLK_PERIOD;
- HWScanKeyMap[0x35] = SDLK_SLASH;
- HWScanKeyMap[0x36] = SDLK_RSHIFT;
- HWScanKeyMap[0x61] = SDLK_UP;
- HWScanKeyMap[0x4f] = SDLK_KP1;
- HWScanKeyMap[0x50] = SDLK_KP2;
- HWScanKeyMap[0x51] = SDLK_KP3;
- HWScanKeyMap[0x5a] = SDLK_KP_ENTER;
-
- // Sixth line of keyboard:
- HWScanKeyMap[0x1d] = SDLK_LCTRL;
- HWScanKeyMap[0x7e] = SDLK_LSUPER; // Windows key
- HWScanKeyMap[0x38] = SDLK_LALT;
- HWScanKeyMap[0x39] = SDLK_SPACE;
- HWScanKeyMap[0x5e] = SDLK_RALT;// Actually, altgr on my keyboard...
- HWScanKeyMap[0x7f] = SDLK_RSUPER;
- HWScanKeyMap[0x7c] = SDLK_MENU;
- HWScanKeyMap[0x5b] = SDLK_RCTRL;
- HWScanKeyMap[0x63] = SDLK_LEFT;
- HWScanKeyMap[0x66] = SDLK_DOWN;
- HWScanKeyMap[0x64] = SDLK_RIGHT;
- HWScanKeyMap[0x52] = SDLK_KP0;
- HWScanKeyMap[0x53] = SDLK_KP_PERIOD;
-}
-
-
-/* Iconify the window.
- This function returns 1 if there is a window manager and the
- window was actually iconified, it returns 0 otherwise.
- */
-int os2fslib_IconifyWindow(_THIS)
-{
- HAB hab;
- HMQ hmq;
- ERRORID hmqerror;
-
- // If there is no more window, nothing we can do!
- if (_this->hidden->iPMThreadStatus!=1) return 0;
-
- // Cannot do anything in fullscreen mode!
- if (FSLib_QueryFSMode(_this->hidden->hwndClient))
- return 0;
-
- // Make sure this thread is prepared for using the Presentation Manager!
- hab = WinInitialize(0);
- hmq = WinCreateMsgQueue(hab,0);
- // Remember if there was an error at WinCreateMsgQueue(), because we don't
- // want to destroy somebody else's queue later. :)
- hmqerror = WinGetLastError(hab);
-
- WinSetWindowPos(_this->hidden->hwndFrame, HWND_TOP,
- 0, 0, 0, 0, SWP_MINIMIZE);
-
- // Now destroy the message queue, if we've created it!
- if (ERRORIDERROR(hmqerror)==0)
- WinDestroyMsgQueue(hmq);
-
- return 1;
-}
-
-static SDL_GrabMode os2fslib_GrabInput(_THIS, SDL_GrabMode mode)
-{
- HAB hab;
- HMQ hmq;
- ERRORID hmqerror;
-
-
- // If there is no more window, nothing we can do!
- if (_this->hidden->iPMThreadStatus!=1)
- return SDL_GRAB_OFF;
-
- // Make sure this thread is prepared for using the Presentation Manager!
- hab = WinInitialize(0);
- hmq = WinCreateMsgQueue(hab,0);
- // Remember if there was an error at WinCreateMsgQueue(), because we don't
- // want to destroy somebody else's queue later. :)
- hmqerror = WinGetLastError(hab);
-
-
- if (mode == SDL_GRAB_OFF)
- {
-#ifdef DEBUG_BUILD
- printf("[os2fslib_GrabInput] : Releasing mouse\n"); fflush(stdout);
-#endif
-
- // Release the mouse
- bMouseCapturable = 0;
- if (bMouseCaptured)
- {
- WinSetCapture(HWND_DESKTOP, NULLHANDLE);
- bMouseCaptured = 0;
- }
- } else
- {
-#ifdef DEBUG_BUILD
- printf("[os2fslib_GrabInput] : Capturing mouse\n"); fflush(stdout);
-#endif
-
- // Capture the mouse
- bMouseCapturable = 1;
- if (WinQueryFocus(HWND_DESKTOP) == _this->hidden->hwndClient)
- {
- WinSetCapture(HWND_DESKTOP, _this->hidden->hwndClient);
- bMouseCaptured = 1;
- {
- SWP swpClient;
- POINTL ptl;
- // Center the mouse to the middle of the window!
- WinQueryWindowPos(_this->hidden->hwndClient, &swpClient);
- ptl.x = 0; ptl.y = 0;
- WinMapWindowPoints(_this->hidden->hwndClient, HWND_DESKTOP, &ptl, 1);
- _this->hidden->iSkipWMMOUSEMOVE++; /* Don't take next WM_MOUSEMOVE into account! */
- WinSetPointerPos(HWND_DESKTOP,
- ptl.x + swpClient.cx/2,
- ptl.y + swpClient.cy/2);
- }
- }
- }
-
- // Now destroy the message queue, if we've created it!
- if (ERRORIDERROR(hmqerror)==0)
- WinDestroyMsgQueue(hmq);
-
- return mode;
-}
-
-/* Set the title and icon text */
-static void os2fslib_SetCaption(_THIS, const char *title, const char *icon)
-{
- HAB hab;
- HMQ hmq;
- ERRORID hmqerror;
-
- // If there is no more window, nothing we can do!
- if (_this->hidden->iPMThreadStatus!=1) return;
-
- // Make sure this thread is prepared for using the Presentation Manager!
- hab = WinInitialize(0);
- hmq = WinCreateMsgQueue(hab,0);
- // Remember if there was an error at WinCreateMsgQueue(), because we don't
- // want to destroy somebody else's queue later. :)
- hmqerror = WinGetLastError(hab);
-
- WinSetWindowText(_this->hidden->hwndFrame, (char *) title);
-
- // Now destroy the message queue, if we've created it!
- if (ERRORIDERROR(hmqerror)==0)
- WinDestroyMsgQueue(hmq);
-}
-
-static int os2fslib_ToggleFullScreen(_THIS, int on)
-{
-#ifdef DEBUG_BUILD
- printf("[os2fslib_ToggleFullScreen] : %d\n", on); fflush(stdout);
-#endif
- // If there is no more window, nothing we can do!
- if (_this->hidden->iPMThreadStatus!=1) return 0;
-
- FSLib_ToggleFSMode(_this->hidden->hwndClient, on);
- /* Cursor manager functions to Windowed/FS mode*/
- os2fslib_SetCursorManagementFunctions(_this, !on);
- return 1;
-}
-
-/* This is called after the video mode has been set, to get the
- initial mouse state. It should queue events as necessary to
- properly represent the current mouse focus and position.
- */
-static void os2fslib_UpdateMouse(_THIS)
-{
- POINTL ptl;
- HAB hab;
- HMQ hmq;
- ERRORID hmqerror;
- SWP swpClient;
-
- // If there is no more window, nothing we can do!
- if (_this->hidden->iPMThreadStatus!=1) return;
-
-
- // Make sure this thread is prepared for using the Presentation Manager!
- hab = WinInitialize(0);
- hmq = WinCreateMsgQueue(hab,0);
- // Remember if there was an error at WinCreateMsgQueue(), because we don't
- // want to destroy somebody else's queue later. :)
- hmqerror = WinGetLastError(hab);
-
-
-
- if (_this->hidden->fInFocus)
- {
- // If our app is in focus
- SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
- SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
- SDL_PrivateAppActive(1, SDL_APPACTIVE);
- WinQueryPointerPos(HWND_DESKTOP, &ptl);
- WinMapWindowPoints(HWND_DESKTOP, _this->hidden->hwndClient, &ptl, 1);
- WinQueryWindowPos(_this->hidden->hwndClient, &swpClient);
- // Convert OS/2 mouse position to SDL position, and also scale it!
- ptl.x = ptl.x * _this->hidden->SrcBufferDesc.uiXResolution / swpClient.cx;
- ptl.y = ptl.y * _this->hidden->SrcBufferDesc.uiYResolution / swpClient.cy;
- ptl.y = _this->hidden->SrcBufferDesc.uiYResolution - ptl.y - 1;
- SDL_PrivateMouseMotion(0, 0, (Sint16) (ptl.x), (Sint16) (ptl.y));
- } else
- {
- // If we're not in focus
- SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
- SDL_PrivateAppActive(0, SDL_APPINPUTFOCUS);
- SDL_PrivateAppActive(0, SDL_APPACTIVE);
- SDL_PrivateMouseMotion(0, 0, (Sint16) -1, (Sint16) -1);
- }
-
- // Now destroy the message queue, if we've created it!
- if (ERRORIDERROR(hmqerror)==0)
- WinDestroyMsgQueue(hmq);
-
-}
-
-/* This pointer should exist in the native video subsystem and should
- point to an appropriate update function for the current video mode
- */
-static void os2fslib_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
-{
- // If there is no more window, nothing we can do!
- if (_this->hidden->iPMThreadStatus!=1) return;
-
-#ifdef BITBLT_IN_WINMESSAGEPROC
- WinSendMsg(_this->hidden->hwndClient,
- WM_UPDATERECTSREQUEST,
- (MPARAM) numrects,
- (MPARAM) rects);
-#else
- if (DosRequestMutexSem(_this->hidden->hmtxUseSrcBuffer, SEM_INDEFINITE_WAIT)==NO_ERROR)
- {
- int i;
-
- if (_this->hidden->pSDLSurface)
- {
-#ifndef RESIZE_EVEN_IF_RESIZABLE
- SWP swp;
- // But only blit if the window is not resizable, or if
- // the window is resizable and the source buffer size is the
- // same as the destination buffer size!
- WinQueryWindowPos(_this->hidden->hwndClient, &swp);
- if ((_this->hidden->pSDLSurface) &&
- (_this->hidden->pSDLSurface->flags & SDL_RESIZABLE) &&
- ((swp.cx != _this->hidden->SrcBufferDesc.uiXResolution) ||
- (swp.cy != _this->hidden->SrcBufferDesc.uiYResolution)
- ) &&
- (!FSLib_QueryFSMode(_this->hidden->hwndClient))
- )
- {
- // Resizable surface and in resizing!
- // So, don't blit now!
-#ifdef DEBUG_BUILD
- printf("[UpdateRects] : Skipping blit while resizing!\n"); fflush(stdout);
-#endif
- } else
-#endif
- {
- /*
- // Blit the whole window
- FSLIB_BITBLT(_this->hidden->hwndClient, _this->hidden->pchSrcBuffer,
- 0, 0,
- _this->hidden->SrcBufferDesc.uiXResolution,
- _this->hidden->SrcBufferDesc.uiYResolution);
- */
-#ifdef DEBUG_BUILD
- printf("[os2fslib_UpdateRects] : Blitting!\n"); fflush(stdout);
-#endif
-
- // Blit the changed areas
- for (i=0; i<numrects; i++)
- FSLIB_BITBLT(_this->hidden->hwndClient, _this->hidden->pchSrcBuffer,
- rects[i].y, rects[i].x, rects[i].w, rects[i].h);
- }
- }
-#ifdef DEBUG_BUILD
- else
- printf("[os2fslib_UpdateRects] : No public surface!\n"); fflush(stdout);
-#endif
- DosReleaseMutexSem(_this->hidden->hmtxUseSrcBuffer);
- }
-#ifdef DEBUG_BUILD
- else
- printf("[os2fslib_UpdateRects] : Error in mutex!\n"); fflush(stdout);
-#endif
-#endif
-}
-
-
-/* Reverse the effects VideoInit() -- called if VideoInit() fails
- or if the application is shutting down the video subsystem.
- */
-static void os2fslib_VideoQuit(_THIS)
-{
-#ifdef DEBUG_BUILD
- printf("[os2fslib_VideoQuit]\n"); fflush(stdout);
-#endif
- // Close PM stuff if running!
- if (_this->hidden->iPMThreadStatus == 1)
- {
- int iTimeout;
- WinPostMsg(_this->hidden->hwndFrame, WM_QUIT, (MPARAM) 0, (MPARAM) 0);
- // HACK: We had this line before:
- //DosWaitThread((TID *) &(_this->hidden->tidPMThread), DCWW_WAIT);
- // We don't use it, because the PMThread will never stop, or if it stops,
- // it will kill the whole process as a emergency fallback.
- // So, we only check for the iPMThreadStatus stuff!
-#ifdef DEBUG_BUILD
- printf("[os2fslib_VideoQuit] : Waiting for PM thread to die\n"); fflush(stdout);
-#endif
-
- iTimeout=0;
- while ((_this->hidden->iPMThreadStatus == 1) && (iTimeout<100))
- {
- iTimeout++;
- DosSleep(64);
- }
-
-#ifdef DEBUG_BUILD
- printf("[os2fslib_VideoQuit] : End of wait.\n"); fflush(stdout);
-#endif
-
- if (_this->hidden->iPMThreadStatus == 1)
- {
-#ifdef DEBUG_BUILD
- printf("[os2fslib_VideoQuit] : Killing PM thread!\n"); fflush(stdout);
-#endif
-
- _this->hidden->iPMThreadStatus = 0;
- DosKillThread(_this->hidden->tidPMThread);
-
- if (_this->hidden->hwndFrame)
- {
-#ifdef DEBUG_BUILD
- printf("[os2fslib_VideoQuit] : Destroying PM window!\n"); fflush(stdout);
-#endif
-
- WinDestroyWindow(_this->hidden->hwndFrame); _this->hidden->hwndFrame=NULL;
- }
- }
-
- }
-
- // Free result of an old ListModes() call, because there is
- // no FreeListModes() call in SDL!
- if (_this->hidden->pListModesResult)
- {
- SDL_free(_this->hidden->pListModesResult); _this->hidden->pListModesResult = NULL;
- }
-
- // Free list of available fullscreen modes
- if (_this->hidden->pAvailableFSLibVideoModes)
- {
- FSLib_FreeVideoModeList(_this->hidden->pAvailableFSLibVideoModes);
- _this->hidden->pAvailableFSLibVideoModes = NULL;
- }
-
- // Free application icon if we had one
- if (hptrCurrentIcon)
- {
- WinDestroyPointer(hptrCurrentIcon);
- hptrCurrentIcon = NULL;
- }
-}
-
-/* Set the requested video mode, returning a surface which will be
- set to the SDL_VideoSurface. The width and height will already
- be verified by ListModes(), and the video subsystem is free to
- set the mode to a supported bit depth different from the one
- specified -- the desired bpp will be emulated with a shadow
- surface if necessary. If a new mode is returned, this function
- should take care of cleaning up the current mode.
- */
-static SDL_Surface *os2fslib_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- static int bFirstCall = 1;
- FSLib_VideoMode_p pModeInfo, pModeInfoFound;
- FSLib_VideoMode TempModeInfo;
- HAB hab;
- HMQ hmq;
- ERRORID hmqerror;
- RECTL rectl;
- SDL_Surface *pResult;
-
- // If there is no more window, nothing we can do!
- if (_this->hidden->iPMThreadStatus!=1) return NULL;
-
-#ifdef DEBUG_BUILD
- printf("[os2fslib_SetVideoMode] : Request for %dx%d @ %dBPP, flags=0x%x\n", width, height, bpp, flags); fflush(stdout);
-#endif
-
- // We don't support palette modes!
- if (bpp==8) bpp=32;
-
- // Also, we don't support resizable modes in fullscreen mode.
- if (flags & SDL_RESIZABLE)
- flags &= ~SDL_FULLSCREEN;
-
- // No double buffered mode
- if (flags & SDL_DOUBLEBUF)
- flags &= ~SDL_DOUBLEBUF;
-
- // And, we don't support HWSURFACE yet.
- if (flags & SDL_HWSURFACE)
- {
- flags &= ~SDL_HWSURFACE;
- flags |= SDL_SWSURFACE;
- }
-
-#ifdef DEBUG_BUILD
- printf("[os2fslib_SetVideoMode] : Changed request to %dx%d @ %dBPP, flags=0x%x\n", width, height, bpp, flags); fflush(stdout);
-#endif
-
- // First check if there is such a video mode they want!
- pModeInfoFound = NULL;
-
- // For fullscreen mode we don't support every resolution!
- // So, go through the video modes, and check for such a resolution!
- pModeInfoFound = NULL;
- pModeInfo = _this->hidden->pAvailableFSLibVideoModes;
-
- while (pModeInfo)
- {
- // Check all available fullscreen modes for this resolution
- if ((pModeInfo->uiXResolution == width) &&
- (pModeInfo->uiYResolution == height) &&
- (pModeInfo->uiBPP!=8)) // palettized modes not yet supported
- {
- // If good resolution, try to find the exact BPP, or at least
- // something similar...
- if (!pModeInfoFound)
- pModeInfoFound = pModeInfo;
- else
- if ((pModeInfoFound->uiBPP!=bpp) &&
- (pModeInfoFound->uiBPP<pModeInfo->uiBPP))
- pModeInfoFound = pModeInfo;
- }
- pModeInfo = pModeInfo->pNext;
- }
-
- // If we did not find a good fullscreen mode, then try a similar
- if (!pModeInfoFound)
- {
-#ifdef DEBUG_BUILD
- printf("[os2fslib_SetVideoMode] : Requested video mode not found, looking for a similar one!\n"); fflush(stdout);
-#endif
- // Go through the video modes again, and find a similar resolution!
- pModeInfo = _this->hidden->pAvailableFSLibVideoModes;
- while (pModeInfo)
- {
- // Check all available fullscreen modes for this resolution
- if ((pModeInfo->uiXResolution >= width) &&
- (pModeInfo->uiYResolution >= height) &&
- (pModeInfo->uiBPP == bpp))
- {
- if (!pModeInfoFound)
- pModeInfoFound = pModeInfo;
- else
- if (((pModeInfoFound->uiXResolution-width)*(pModeInfoFound->uiYResolution-height))>
- ((pModeInfo->uiXResolution-width)*(pModeInfo->uiYResolution-height)))
- {
- // Found a mode which is closer than the current one
- pModeInfoFound = pModeInfo;
- }
- }
- pModeInfo = pModeInfo->pNext;
- }
- }
-
- // If we did not find a good fullscreen mode, then return NULL
- if (!pModeInfoFound)
- {
-#ifdef DEBUG_BUILD
- printf("[os2fslib_SetVideoMode] : Requested video mode not found!\n"); fflush(stdout);
-#endif
- return NULL;
- }
-
-#ifdef DEBUG_BUILD
- printf("[os2fslib_SetVideoMode] : Found mode!\n"); fflush(stdout);
-#endif
-
- // We'll possibly adjust the structure, so copy out the values
- // into TempModeInfo!
- SDL_memcpy(&TempModeInfo, pModeInfoFound, sizeof(TempModeInfo));
- pModeInfoFound = &TempModeInfo;
-
- if (flags & SDL_RESIZABLE)
- {
-#ifdef DEBUG_BUILD
- printf("[os2fslib_SetVideoMode] : Requested mode is resizable, changing width/height\n"); fflush(stdout);
-#endif
- // Change width and height to requested one!
- TempModeInfo.uiXResolution = width;
- TempModeInfo.uiYResolution = height;
- TempModeInfo.uiScanLineSize = width * ((TempModeInfo.uiBPP+7)/8);
- }
-
- // We can try create new surface!
-
- // Make sure this thread is prepared for using the Presentation Manager!
- hab = WinInitialize(0);
- hmq = WinCreateMsgQueue(hab,0);
- // Remember if there was an error at WinCreateMsgQueue(), because we don't
- // want to destroy somebody else's queue later. :)
- hmqerror = WinGetLastError(hab);
-
-
-
- if (DosRequestMutexSem(_this->hidden->hmtxUseSrcBuffer, SEM_INDEFINITE_WAIT)==NO_ERROR)
- {
-#ifdef DEBUG_BUILD
- printf("[os2fslib_SetVideoMode] : Creating new SW surface\n"); fflush(stdout);
-#endif
-
- // Create new software surface!
- pResult = SDL_CreateRGBSurface(SDL_SWSURFACE,
- pModeInfoFound->uiXResolution,
- pModeInfoFound->uiYResolution,
- pModeInfoFound->uiBPP,
- ((unsigned int) pModeInfoFound->PixelFormat.ucRedMask) << pModeInfoFound->PixelFormat.ucRedPosition,
- ((unsigned int) pModeInfoFound->PixelFormat.ucGreenMask) << pModeInfoFound->PixelFormat.ucGreenPosition,
- ((unsigned int) pModeInfoFound->PixelFormat.ucBlueMask) << pModeInfoFound->PixelFormat.ucBluePosition,
- ((unsigned int) pModeInfoFound->PixelFormat.ucAlphaMask) << pModeInfoFound->PixelFormat.ucAlphaPosition);
-
- if (pResult == NULL)
- {
- DosReleaseMutexSem(_this->hidden->hmtxUseSrcBuffer);
- SDL_OutOfMemory();
- return NULL;
- }
-
-#ifdef DEBUG_BUILD
- printf("[os2fslib_SetVideoMode] : Adjusting pixel format\n"); fflush(stdout);
-#endif
-
- // Adjust pixel format mask!
- pResult->format->Rmask = ((unsigned int) pModeInfoFound->PixelFormat.ucRedMask) << pModeInfoFound->PixelFormat.ucRedPosition;
- pResult->format->Rshift = pModeInfoFound->PixelFormat.ucRedPosition;
- pResult->format->Rloss = pModeInfoFound->PixelFormat.ucRedAdjust;
- pResult->format->Gmask = ((unsigned int) pModeInfoFound->PixelFormat.ucGreenMask) << pModeInfoFound->PixelFormat.ucGreenPosition;
- pResult->format->Gshift = pModeInfoFound->PixelFormat.ucGreenPosition;
- pResult->format->Gloss = pModeInfoFound->PixelFormat.ucGreenAdjust;
- pResult->format->Bmask = ((unsigned int) pModeInfoFound->PixelFormat.ucBlueMask) << pModeInfoFound->PixelFormat.ucBluePosition;
- pResult->format->Bshift = pModeInfoFound->PixelFormat.ucBluePosition;
- pResult->format->Bloss = pModeInfoFound->PixelFormat.ucBlueAdjust;
- pResult->format->Amask = ((unsigned int) pModeInfoFound->PixelFormat.ucAlphaMask) << pModeInfoFound->PixelFormat.ucAlphaPosition;
- pResult->format->Ashift = pModeInfoFound->PixelFormat.ucAlphaPosition;
- pResult->format->Aloss = pModeInfoFound->PixelFormat.ucAlphaAdjust;
-
-#ifdef REPORT_EMPTY_ALPHA_MASK
- pResult->format->Amask =
- pResult->format->Ashift =
- pResult->format->Aloss = 0;
-#endif
-
- // Adjust surface flags
- pResult->flags |= (flags & SDL_FULLSCREEN);
- pResult->flags |= (flags & SDL_RESIZABLE);
-
- // It might be that the software surface pitch is not the same as
- // the pitch we have, so adjust that!
- pModeInfoFound->uiScanLineSize = pResult->pitch;
-
- // Store new source buffer parameters!
- SDL_memcpy(&(_this->hidden->SrcBufferDesc), pModeInfoFound, sizeof(*pModeInfoFound));
- _this->hidden->pchSrcBuffer = pResult->pixels;
-
-#ifdef DEBUG_BUILD
- printf("[os2fslib_SetVideoMode] : Telling FSLib the stuffs\n"); fflush(stdout);
-#endif
-
- // Tell the FSLib window the new source image format
- FSLib_SetSrcBufferDesc(_this->hidden->hwndClient, &(_this->hidden->SrcBufferDesc));
-
- if (
- ((flags & SDL_RESIZABLE)==0) ||
- (bFirstCall)
- )
- {
- bFirstCall = 0;
-#ifdef DEBUG_BUILD
- printf("[os2fslib_SetVideoMode] : Modifying window size\n"); fflush(stdout);
-#endif
-
- // Calculate frame window size from client window size
- rectl.xLeft = 0;
- rectl.yBottom = 0;
- rectl.xRight = pModeInfoFound->uiXResolution; // Noninclusive
- rectl.yTop = pModeInfoFound->uiYResolution; // Noninclusive
- WinCalcFrameRect(_this->hidden->hwndFrame, &rectl, FALSE);
-
- // Set the new size of the main window
- SetAccessableWindowPos(_this->hidden->hwndFrame,
- HWND_TOP,
- 0, 0,
- (rectl.xRight-rectl.xLeft),
- (rectl.yTop-rectl.yBottom),
- SWP_SIZE | SWP_ACTIVATE | SWP_SHOW);
- }
-
- // Set fullscreen mode flag, and switch to fullscreen if needed!
- if (flags & SDL_FULLSCREEN)
- {
-#ifdef DEBUG_BUILD
- printf("[os2fslib_SetVideoMode] : Also trying to switch to fullscreen\n");
- fflush(stdout);
-#endif
- FSLib_ToggleFSMode(_this->hidden->hwndClient, 1);
- /* Cursor manager functions to FS mode*/
- os2fslib_SetCursorManagementFunctions(_this, 0);
- } else
- {
-#ifdef DEBUG_BUILD
- printf("[os2fslib_SetVideoMode] : Also trying to switch to desktop mode\n");
- fflush(stdout);
-#endif
- FSLib_ToggleFSMode(_this->hidden->hwndClient, 0);
- /* Cursor manager functions to Windowed mode*/
- os2fslib_SetCursorManagementFunctions(_this, 1);
- }
-
- _this->hidden->pSDLSurface = pResult;
-
- DosReleaseMutexSem(_this->hidden->hmtxUseSrcBuffer);
- } else
- {
-#ifdef DEBUG_BUILD
- printf("[os2fslib_SetVideoMode] : Could not get hmtxUseSrcBuffer!\n"); fflush(stdout);
-#endif
-
- pResult = NULL;
- }
-
- // As we have the new surface, we don't need the current one anymore!
- if ((pResult) && (current))
- {
-#ifdef DEBUG_BUILD
- printf("[os2fslib_SetVideoMode] : Freeing old surface\n"); fflush(stdout);
-#endif
- SDL_FreeSurface(current);
- }
-
- // Redraw window
- WinInvalidateRegion(_this->hidden->hwndClient, NULL, TRUE);
-
- // Now destroy the message queue, if we've created it!
- if (ERRORIDERROR(hmqerror)==0)
- {
-#ifdef DEBUG_BUILD
- printf("[os2fslib_SetVideoMode] : Destroying message queue\n"); fflush(stdout);
-#endif
- WinDestroyMsgQueue(hmq);
- }
-
-#ifdef DEBUG_BUILD
- printf("[os2fslib_SetVideoMode] : Done\n"); fflush(stdout);
-#endif
-
- /* We're done */
-
- // Return with the new surface!
- return pResult;
-}
-
-/* List the available video modes for the given pixel format, sorted
- from largest to smallest.
- */
-static SDL_Rect **os2fslib_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
-#ifdef DEBUG_BUILD
- printf("[os2fslib_ListModes] : ListModes of %d Bpp\n", format->BitsPerPixel);
-#endif
- // Destroy result of previous call, if there is any
- if (_this->hidden->pListModesResult)
- {
- SDL_free(_this->hidden->pListModesResult); _this->hidden->pListModesResult = NULL;
- }
-
- // For resizable and windowed mode we support every resolution!
- if ((flags & SDL_RESIZABLE) && ((flags & SDL_FULLSCREEN) == 0))
- return (SDL_Rect **)-1;
-
- // Check if they need fullscreen or non-fullscreen video modes!
- if ((flags & SDL_FULLSCREEN) == 0)
-
- {
- // For windowed mode we support every resolution!
- return (SDL_Rect **)-1;
- } else
- {
- FSLib_VideoMode_p pFSMode;
- // For fullscreen mode we don't support every resolution!
- // Now create a new list
- pFSMode = _this->hidden->pAvailableFSLibVideoModes;
- while (pFSMode)
- {
- if (pFSMode->uiBPP == format->BitsPerPixel)
- {
- SDL_Rect *pRect = (SDL_Rect *) SDL_malloc(sizeof(SDL_Rect));
- if (pRect)
- {
- // Fill description
- pRect->x = 0;
- pRect->y = 0;
- pRect->w = pFSMode->uiXResolution;
- pRect->h = pFSMode->uiYResolution;
-#ifdef DEBUG_BUILD
-// printf("!!! Seems to be good!\n");
-// printf("F: %dx%d\n", pRect->w, pRect->h);
-#endif
- // And insert into list of pRects
- if (!(_this->hidden->pListModesResult))
- {
-#ifdef DEBUG_BUILD
-// printf("!!! Inserting to beginning\n");
-#endif
-
- // We're the first one to be inserted!
- _this->hidden->pListModesResult = (SDL_Rect**) SDL_malloc(2*sizeof(SDL_Rect*));
- if (_this->hidden->pListModesResult)
- {
- _this->hidden->pListModesResult[0] = pRect;
- _this->hidden->pListModesResult[1] = NULL;
- } else
- {
- SDL_free(pRect);
- }
- } else
- {
- // We're not the first ones, so find the place where we
- // have to insert ourselves
- SDL_Rect **pNewList;
- int iPlace, iNumOfSlots, i;
-
-#ifdef DEBUG_BUILD
-// printf("!!! Searching where to insert\n");
-#endif
-
- iPlace = -1; iNumOfSlots = 1; // Count the last NULL too!
- for (i=0; _this->hidden->pListModesResult[i]; i++)
- {
- iNumOfSlots++;
- if (iPlace==-1)
- {
- if ((_this->hidden->pListModesResult[i]->w*_this->hidden->pListModesResult[i]->h)<
- (pRect->w*pRect->h))
- {
- iPlace = i;
- }
- }
- }
- if (iPlace==-1) iPlace = iNumOfSlots-1;
-
-#ifdef DEBUG_BUILD
-// printf("!!! From %d slots, it will be at %d\n", iNumOfSlots, iPlace);
-#endif
-
- pNewList = (SDL_Rect**) SDL_realloc(_this->hidden->pListModesResult, (iNumOfSlots+1)*sizeof(SDL_Rect*));
- if (pNewList)
- {
- for (i=iNumOfSlots;i>iPlace;i--)
- pNewList[i] = pNewList[i-1];
- pNewList[iPlace] = pRect;
- _this->hidden->pListModesResult = pNewList;
- } else
- {
- SDL_free(pRect);
- }
- }
- }
- }
- pFSMode = pFSMode->pNext;
- }
- }
-#ifdef DEBUG_BUILD
-// printf("Returning list\n");
-#endif
- return _this->hidden->pListModesResult;
-}
-
-/* Initialize the native video subsystem, filling 'vformat' with the
- "best" display pixel format, returning 0 or -1 if there's an error.
- */
-static int os2fslib_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- FSLib_VideoMode_p pDesktopMode;
-
-#ifdef DEBUG_BUILD
- printf("[os2fslib_VideoInit] : Enter\n"); fflush(stdout);
-#endif
-
- // Report the best pixel format. For this,
- // we'll use the current desktop format.
- pDesktopMode = FSLib_GetDesktopVideoMode();
- if (!pDesktopMode)
- {
- SDL_SetError("Could not query desktop video mode!");
-#ifdef DEBUG_BUILD
- printf("[os2fslib_VideoInit] : Could not query desktop video mode!\n");
-#endif
- return -1;
- }
-
- /* Determine the current screen size */
- _this->info.current_w = pDesktopMode->uiXResolution;
- _this->info.current_h = pDesktopMode->uiYResolution;
-
- /* Determine the screen depth */
- vformat->BitsPerPixel = pDesktopMode->uiBPP;
- vformat->BytesPerPixel = (vformat->BitsPerPixel+7)/8;
-
- vformat->Rmask = ((unsigned int) pDesktopMode->PixelFormat.ucRedMask) << pDesktopMode->PixelFormat.ucRedPosition;
- vformat->Rshift = pDesktopMode->PixelFormat.ucRedPosition;
- vformat->Rloss = pDesktopMode->PixelFormat.ucRedAdjust;
- vformat->Gmask = ((unsigned int) pDesktopMode->PixelFormat.ucGreenMask) << pDesktopMode->PixelFormat.ucGreenPosition;
- vformat->Gshift = pDesktopMode->PixelFormat.ucGreenPosition;
- vformat->Gloss = pDesktopMode->PixelFormat.ucGreenAdjust;
- vformat->Bmask = ((unsigned int) pDesktopMode->PixelFormat.ucBlueMask) << pDesktopMode->PixelFormat.ucBluePosition;
- vformat->Bshift = pDesktopMode->PixelFormat.ucBluePosition;
- vformat->Bloss = pDesktopMode->PixelFormat.ucBlueAdjust;
- vformat->Amask = ((unsigned int) pDesktopMode->PixelFormat.ucAlphaMask) << pDesktopMode->PixelFormat.ucAlphaPosition;
- vformat->Ashift = pDesktopMode->PixelFormat.ucAlphaPosition;
- vformat->Aloss = pDesktopMode->PixelFormat.ucAlphaAdjust;
-
-#ifdef REPORT_EMPTY_ALPHA_MASK
- vformat->Amask =
- vformat->Ashift =
- vformat->Aloss = 0;
-#endif
-
- // Fill in some window manager capabilities
- _this->info.wm_available = 1;
-
- // Initialize some internal variables
- _this->hidden->pListModesResult = NULL;
- _this->hidden->fInFocus = 0;
- _this->hidden->iSkipWMMOUSEMOVE = 0;
- _this->hidden->iMouseVisible = 1;
-
- if (getenv("SDL_USE_PROPORTIONAL_WINDOW"))
- _this->hidden->bProportionalResize = 1;
- else
- {
- PPIB pib;
- PTIB tib;
- char *pchFileName, *pchTemp;
- char achConfigFile[CCHMAXPATH];
- FILE *hFile;
-
- /* No environment variable to have proportional window.
- * Ok, let's check if this executable is in config file!
- */
- _this->hidden->bProportionalResize = 0;
-
- DosGetInfoBlocks(&tib, &pib);
- pchTemp = pchFileName = pib->pib_pchcmd;
- while (*pchTemp)
- {
- if (*pchTemp=='\\')
- pchFileName = pchTemp+1;
- pchTemp++;
- }
- if (getenv("HOME"))
- {
- sprintf(achConfigFile, "%s\\.sdl.proportionals", getenv("HOME"));
- hFile = fopen(achConfigFile, "rt");
- if (!hFile)
- {
- /* Seems like the file cannot be opened or does not exist.
- * Let's try to create it with defaults!
- */
- hFile = fopen(achConfigFile, "wt");
- if (hFile)
- {
- fprintf(hFile, "; This file is a config file of SDL/2, containing\n");
- fprintf(hFile, "; the list of executables that must have proportional\n");
- fprintf(hFile, "; windows.\n");
- fprintf(hFile, ";\n");
- fprintf(hFile, "; You can add executable filenames into this file,\n");
- fprintf(hFile, "; one under the other. If SDL finds that a given\n");
- fprintf(hFile, "; program is in this list, then that application\n");
- fprintf(hFile, "; will have proportional windows, just like if\n");
- fprintf(hFile, "; the SET SDL_USE_PROPORTIONAL_WINDOW env. variable\n");
- fprintf(hFile, "; would have been set for that process.\n");
- fprintf(hFile, ";\n");
- fprintf(hFile, "\n");
- fprintf(hFile, "dosbox.exe\n");
- fclose(hFile);
- }
-
- hFile = fopen(achConfigFile, "rt");
- }
-
- if (hFile)
- {
- while (fgets(achConfigFile, sizeof(achConfigFile), hFile))
- {
- /* Cut \n from end of string */
-
- while (achConfigFile[strlen(achConfigFile)-1] == '\n')
- achConfigFile[strlen(achConfigFile)-1] = 0;
-
- /* Compare... */
- if (stricmp(achConfigFile, pchFileName)==0)
- {
- /* Found it in config file! */
- _this->hidden->bProportionalResize = 1;
- break;
- }
- }
- fclose(hFile);
- }
- }
- }
-
- DosCreateMutexSem(NULL, &(_this->hidden->hmtxUseSrcBuffer), 0, FALSE);
-
- // Now create our window with a default size
-
- // For this, we select the first available fullscreen mode as
- // current window size!
- SDL_memcpy(&(_this->hidden->SrcBufferDesc), _this->hidden->pAvailableFSLibVideoModes, sizeof(_this->hidden->SrcBufferDesc));
- // Allocate new video buffer!
- _this->hidden->pchSrcBuffer = (char *) SDL_malloc(_this->hidden->pAvailableFSLibVideoModes->uiScanLineSize * _this->hidden->pAvailableFSLibVideoModes->uiYResolution);
- if (!_this->hidden->pchSrcBuffer)
- {
-#ifdef DEBUG_BUILD
- printf("[os2fslib_VideoInit] : Yikes, not enough memory for new video buffer!\n"); fflush(stdout);
-#endif
- SDL_SetError("Not enough memory for new video buffer!\n");
- return -1;
- }
-
- // For this, we need a message processing thread.
- // We'll create a new thread for this, which will do everything
- // what is related to PM
- _this->hidden->iPMThreadStatus = 0;
- _this->hidden->tidPMThread = _beginthread(PMThreadFunc, NULL, 65536, (void *) _this);
- if (_this->hidden->tidPMThread <= 0)
- {
-#ifdef DEBUG_BUILD
- printf("[os2fslib_VideoInit] : Could not create PM thread!\n");
-#endif
- SDL_SetError("Could not create PM thread");
- return -1;
- }
-#ifdef USE_DOSSETPRIORITY
- // Burst the priority of PM Thread!
- DosSetPriority(PRTYS_THREAD, PRTYC_TIMECRITICAL, 0, _this->hidden->tidPMThread);
-#endif
- // Wait for the PM thread to initialize!
- while (_this->hidden->iPMThreadStatus==0)
- DosSleep(32);
- // If the PM thread could not set up everything, then
- // report an error!
- if (_this->hidden->iPMThreadStatus!=1)
- {
-#ifdef DEBUG_BUILD
- printf("[os2fslib_VideoInit] : PMThread reported an error : %d\n", _this->hidden->iPMThreadStatus);
-#endif
- SDL_SetError("Error initializing PM thread");
- return -1;
- }
-
- return 0;
-}
-
-
-static void os2fslib_DeleteDevice(_THIS)
-{
-#ifdef DEBUG_BUILD
- printf("[os2fslib_DeleteDevice]\n"); fflush(stdout);
-#endif
- // Free used memory
- FSLib_FreeVideoModeList(_this->hidden->pAvailableFSLibVideoModes);
- if (_this->hidden->pListModesResult)
- SDL_free(_this->hidden->pListModesResult);
- if (_this->hidden->pchSrcBuffer)
- SDL_free(_this->hidden->pchSrcBuffer);
- DosCloseMutexSem(_this->hidden->hmtxUseSrcBuffer);
- SDL_free(_this->hidden);
- SDL_free(_this);
- FSLib_Uninitialize();
-}
-
-static int os2fslib_Available(void)
-{
-
- // If we can run, it means that we could load FSLib,
- // so we assume that it's available then!
- return 1;
-}
-
-static void os2fslib_MorphToPM()
-{
- PPIB pib;
- PTIB tib;
-
- DosGetInfoBlocks(&tib, &pib);
-
- // Change flag from VIO to PM:
- if (pib->pib_ultype==2) pib->pib_ultype = 3;
-}
-
-static SDL_VideoDevice *os2fslib_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
-
-#ifdef DEBUG_BUILD
- printf("[os2fslib_CreateDevice] : Enter\n"); fflush(stdout);
-#endif
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device )
- {
- SDL_memset(device, 0, (sizeof *device));
- // Also allocate memory for private data
- device->hidden = (struct SDL_PrivateVideoData *) SDL_malloc((sizeof(struct SDL_PrivateVideoData)));
- }
- if ( (device == NULL) || (device->hidden == NULL) )
- {
- SDL_OutOfMemory();
- if ( device )
- SDL_free(device);
- return NULL;
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
-
- /* Set the function pointers */
-#ifdef DEBUG_BUILD
- printf("[os2fslib_CreateDevice] : VideoInit is %p\n", os2fslib_VideoInit); fflush(stdout);
-#endif
-
- /* Initialization/Query functions */
- device->VideoInit = os2fslib_VideoInit;
- device->ListModes = os2fslib_ListModes;
- device->SetVideoMode = os2fslib_SetVideoMode;
- device->ToggleFullScreen = os2fslib_ToggleFullScreen;
- device->UpdateMouse = os2fslib_UpdateMouse;
- device->CreateYUVOverlay = NULL;
- device->SetColors = os2fslib_SetColors;
- device->UpdateRects = os2fslib_UpdateRects;
- device->VideoQuit = os2fslib_VideoQuit;
- /* Hardware acceleration functions */
- device->AllocHWSurface = os2fslib_AllocHWSurface;
- device->CheckHWBlit = NULL;
- device->FillHWRect = NULL;
- device->SetHWColorKey = NULL;
- device->SetHWAlpha = NULL;
- device->LockHWSurface = os2fslib_LockHWSurface;
- device->UnlockHWSurface = os2fslib_UnlockHWSurface;
- device->FlipHWSurface = NULL;
- device->FreeHWSurface = os2fslib_FreeHWSurface;
- /* Window manager functions */
- device->SetCaption = os2fslib_SetCaption;
- device->SetIcon = os2fslib_SetIcon;
- device->IconifyWindow = os2fslib_IconifyWindow;
- device->GrabInput = os2fslib_GrabInput;
- device->GetWMInfo = NULL;
- /* Cursor manager functions to Windowed mode*/
- os2fslib_SetCursorManagementFunctions(device, 1);
- /* Event manager functions */
- device->InitOSKeymap = os2fslib_InitOSKeymap;
- device->PumpEvents = os2fslib_PumpEvents;
- /* The function used to dispose of this structure */
- device->free = os2fslib_DeleteDevice;
-
- // Make sure we'll be able to use Win* API even if the application
- // was linked to be a VIO application!
- os2fslib_MorphToPM();
-
- // Now initialize FSLib, and query available video modes!
- if (!FSLib_Initialize())
- {
- // Could not initialize FSLib!
-#ifdef DEBUG_BUILD
- printf("[os2fslib_CreateDevice] : Could not initialize FSLib!\n");
-#endif
- SDL_SetError("Could not initialize FSLib!");
- SDL_free(device->hidden);
- SDL_free(device);
- return NULL;
- }
- device->hidden->pAvailableFSLibVideoModes =
- FSLib_GetVideoModeList();
-
- return device;
-}
-
-VideoBootStrap OS2FSLib_bootstrap = {
- "os2fslib", "OS/2 Video Output using FSLib",
- os2fslib_Available, os2fslib_CreateDevice
-};
-
diff --git a/distrib/sdl-1.2.12/src/video/os2fslib/SDL_os2fslib.h b/distrib/sdl-1.2.12/src/video/os2fslib/SDL_os2fslib.h
deleted file mode 100644
index 57b40c5..0000000
--- a/distrib/sdl-1.2.12/src/video/os2fslib/SDL_os2fslib.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_os2fslib_h
-#define _SDL_os2fslib_h
-
-
-// OS2 specific includes
-#define INCL_TYPES
-#define INCL_DOS
-#define INCL_DOSERRORS
-#define INCL_DOSPROCESS
-#define INCL_WIN
-#define INCL_GPI
-#include <os2.h>
-
-#include <FSLib.h>
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *_this
-
-/* Private display data */
-struct SDL_PrivateVideoData
-{
- FSLib_VideoMode_p pAvailableFSLibVideoModes;
- SDL_Rect **pListModesResult; // Allocated memory to return list of modes for os2fslib_ListModes() API
-
- FSLib_VideoMode SrcBufferDesc; // Description of current source image buffer
- char *pchSrcBuffer; // The source image buffer itself
- SDL_Surface *pSDLSurface; // The SDL surface describing the buffer
- HMTX hmtxUseSrcBuffer; // Mutex semaphore to manipulate src buffer
- HWND hwndFrame, hwndClient; // Window handle of frame and client
- int iPMThreadStatus; // 0: Not running
- // 1: Running
- // Other: Not running, had an error
- int tidPMThread; // Thread ID of PM Thread
- int fInFocus; // True if we're in focus!
- int iSkipWMMOUSEMOVE; // Number of WM_MOUSEMOVE messages to skip!
- int iMouseVisible; //
-
- PFNWP pfnOldFrameProc; // Old window frame procedure
- int bProportionalResize; // 0: No proportional resizing
- // 1: Do proportional resizing
- ULONG ulResizingFlag; // First resizing flag value
-};
-
-/* OS/2 specific backdoor function to be able to set FrameControlFlags of */
-/* the SDL window before creating it. */
-extern DECLSPEC void SDLCALL SDL_OS2FSLIB_SetFCFToUse(ULONG ulFCF);
-
-#endif /* _SDL_os2fslib_h */
diff --git a/distrib/sdl-1.2.12/src/video/os2fslib/SDL_vkeys.h b/distrib/sdl-1.2.12/src/video/os2fslib/SDL_vkeys.h
deleted file mode 100644
index 0676de9..0000000
--- a/distrib/sdl-1.2.12/src/video/os2fslib/SDL_vkeys.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-#ifndef 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'
-#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
diff --git a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_events.c b/distrib/sdl-1.2.12/src/video/photon/SDL_ph_events.c
deleted file mode 100644
index 47405b7..0000000
--- a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_events.c
+++ /dev/null
@@ -1,624 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Handle the event stream, converting photon events into SDL events */
-
-#include <stdio.h>
-#include <setjmp.h>
-#include <sys/time.h>
-
-#include <Ph.h>
-#include <photon/PkKeyDef.h>
-
-#include "SDL.h"
-#include "SDL_syswm.h"
-#include "../SDL_sysvideo.h"
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_ph_video.h"
-#include "SDL_ph_modes_c.h"
-#include "SDL_ph_image_c.h"
-#include "SDL_ph_events_c.h"
-#include "SDL_phyuv_c.h"
-
-/* The translation tables from a photon keysym to a SDL keysym */
-static SDLKey ODD_keymap[256];
-static SDLKey MISC_keymap[0xFF + 1];
-SDL_keysym *ph_TranslateKey(PhKeyEvent_t *key, SDL_keysym *keysym);
-
-/* Check to see if this is a repeated key.
- (idea shamelessly lifted from GII -- thanks guys! :) */
-static int ph_WarpedMotion(_THIS, PhEvent_t *winEvent)
-{
- PhRect_t *rect = PhGetRects( winEvent );
-
- int centre_x, centre_y;
- int dx, dy;
- short abs_x, abs_y;
- int posted;
-
- centre_x = SDL_VideoSurface->w / 2;
- centre_y = SDL_VideoSurface->h / 2;
-
- dx = rect->ul.x - centre_x;
- dy = rect->ul.y - centre_y;
-
- posted = SDL_PrivateMouseMotion( 0, 1, dx, dy );
-
- /* Move mouse cursor to middle of the window */
- PtGetAbsPosition( window, &abs_x, &abs_y );
- PhMoveCursorAbs(PhInputGroup(NULL), abs_x + centre_x, abs_y + centre_y);
-
- return (posted);
-}
-
-/* Control which motion flags the window has set, a flags value of -1 sets
- * MOTION_BUTTON and MOTION_NOBUTTON */
-
-static void set_motion_sensitivity(_THIS, unsigned int flags)
-{
- int rid;
- int fields = Ph_EV_PTR_MOTION_BUTTON | Ph_EV_PTR_MOTION_NOBUTTON;
- PhRegion_t region;
-
- if( window )
- {
- rid = PtWidgetRid(window);
- if( rid != 0 && PhRegionQuery(rid, &region, NULL, NULL, 0) == 0 )
- {
- region.events_sense=(region.events_sense & ~fields)|(flags & fields);
- PhRegionChange(Ph_REGION_EV_SENSE, 0, &region, NULL, NULL);
- }
- }
-}
-
-/* Convert the photon button state value to an SDL value */
-static Uint8 ph2sdl_mousebutton(unsigned short button_state)
-{
- Uint8 mouse_button = 0;
-
- if (button_state & Ph_BUTTON_SELECT)
- mouse_button |= SDL_BUTTON_LEFT;
- if (button_state & Ph_BUTTON_MENU)
- mouse_button |= SDL_BUTTON_RIGHT;
- if (button_state & Ph_BUTTON_ADJUST)
- mouse_button |= SDL_BUTTON_MIDDLE;
-
- return (mouse_button);
-}
-
-static int ph_DispatchEvent(_THIS)
-{
- int posted;
- PhRect_t* rect;
- PhPointerEvent_t* pointerEvent;
- PhKeyEvent_t* keyEvent;
- PhWindowEvent_t* winEvent;
- int i, buttons;
- SDL_Rect sdlrects[PH_SDL_MAX_RECTS];
-
- posted = 0;
-
- switch (phevent->type)
- {
- case Ph_EV_BOUNDARY:
- {
- if (phevent->subtype == Ph_EV_PTR_ENTER)
- {
- posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
- }
- else if (phevent->subtype ==Ph_EV_PTR_LEAVE)
- {
- posted = SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
- }
- }
- break;
-
- case Ph_EV_PTR_MOTION_BUTTON:
- case Ph_EV_PTR_MOTION_NOBUTTON:
- {
- if (SDL_VideoSurface)
- {
- pointerEvent = PhGetData(phevent);
- rect = PhGetRects(phevent);
-
- if (mouse_relative)
- {
- posted = ph_WarpedMotion(this, phevent);
- }
- else
- {
- posted = SDL_PrivateMouseMotion(0, 0, rect->ul.x, rect->ul.y);
- }
- }
- }
- break;
-
- case Ph_EV_BUT_PRESS:
- {
- pointerEvent = PhGetData(phevent);
- buttons = ph2sdl_mousebutton(pointerEvent->buttons);
- if (buttons != 0)
- {
- posted = SDL_PrivateMouseButton(SDL_PRESSED, buttons, 0, 0);
- }
- }
- break;
-
- case Ph_EV_BUT_RELEASE:
- {
- pointerEvent = PhGetData(phevent);
- buttons = ph2sdl_mousebutton(pointerEvent->buttons);
- if (phevent->subtype == Ph_EV_RELEASE_REAL && buttons != 0)
- {
- posted = SDL_PrivateMouseButton(SDL_RELEASED, buttons, 0, 0);
- }
- else if(phevent->subtype == Ph_EV_RELEASE_PHANTOM)
- {
- /* If the mouse is outside the window,
- * only a phantom release event is sent, so
- * check if the window doesn't have mouse focus.
- * Not perfect, maybe checking the mouse button
- * state for Ph_EV_BOUNDARY events would be
- * better. */
- if ((SDL_GetAppState() & SDL_APPMOUSEFOCUS) == 0)
- {
- posted = SDL_PrivateMouseButton(SDL_RELEASED, buttons, 0, 0);
- }
- }
- }
- break;
-
- case Ph_EV_WM:
- {
- winEvent = PhGetData(phevent);
-
- /* losing focus */
- if ((winEvent->event_f==Ph_WM_FOCUS) && (winEvent->event_state==Ph_WM_EVSTATE_FOCUSLOST))
- {
- set_motion_sensitivity(this, Ph_EV_PTR_MOTION_BUTTON);
- posted = SDL_PrivateAppActive(0, SDL_APPINPUTFOCUS);
- }
- /* gaining focus */
- else if ((winEvent->event_f==Ph_WM_FOCUS) && (winEvent->event_state==Ph_WM_EVSTATE_FOCUS))
- {
- set_motion_sensitivity(this, -1);
- posted = SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
- }
- /* request quit */
- else if (winEvent->event_f==Ph_WM_CLOSE)
- {
- posted = SDL_PrivateQuit();
- }
- /* request hide/unhide */
- else if (winEvent->event_f==Ph_WM_HIDE)
- {
- if (currently_hided)
- {
- /* got unhide window event */
- /* TODO: restore application's palette if in palette mode */
- currently_hided=0;
- }
- else
- {
- /* got hide window event */
- /* TODO: restore original palette if in palette mode */
- currently_hided=1;
- }
- }
- /* request to resize */
- else if (winEvent->event_f==Ph_WM_RESIZE)
- {
- currently_maximized=0;
- #if (_NTO_VERSION < 630)
- SDL_PrivateResize(winEvent->size.w+1, winEvent->size.h+1);
- #else
- /* QNX 6.3.0 have this bug fixed */
- SDL_PrivateResize(winEvent->size.w, winEvent->size.h);
- #endif /* _NTO_VERSION */
- }
- /* request to move */
- else if (winEvent->event_f==Ph_WM_MOVE)
- {
- if (current_overlay!=NULL)
- {
- int lockedstate=current_overlay->hwdata->locked;
- int chromastate=current_overlay->hwdata->ischromakey;
- int error;
- SDL_Rect src, dst;
-
- current_overlay->hwdata->locked=1;
- src.x = 0;
- src.y = 0;
- src.w = current_overlay->w;
- src.y = current_overlay->h;
- dst.x=current_overlay->hwdata->CurrentViewPort.pos.x;
- dst.y=current_overlay->hwdata->CurrentViewPort.pos.y;
- dst.w=current_overlay->hwdata->CurrentViewPort.size.w;
- dst.h=current_overlay->hwdata->CurrentViewPort.size.h;
- current_overlay->hwdata->ischromakey=0;
- error=ph_DisplayYUVOverlay(this, current_overlay, &src, &dst);
- if (!error)
- {
- current_overlay->hwdata->ischromakey=chromastate;
- current_overlay->hwdata->locked=lockedstate;
- }
- }
- }
- /* maximize request */
- else if (winEvent->event_f==Ph_WM_MAX)
- {
- /* window already moved and resized here */
- currently_maximized=1;
- }
- /* restore request */
- else if (winEvent->event_f==Ph_WM_RESTORE)
- {
- /* window already moved and resized here */
- currently_maximized=0;
- }
- }
- break;
-
- /* window has been resized, moved or removed */
- case Ph_EV_EXPOSE:
- {
- if (phevent->num_rects!=0)
- {
- int numrects;
-
- if (SDL_VideoSurface)
- {
- rect = PhGetRects(phevent);
- if (phevent->num_rects>PH_SDL_MAX_RECTS)
- {
- /* sorry, buffers underrun, we'll update only first PH_SDL_MAX_RECTS rects */
- numrects=PH_SDL_MAX_RECTS;
- }
-
- for(i=0; i<phevent->num_rects; i++)
- {
- sdlrects[i].x = rect[i].ul.x;
- sdlrects[i].y = rect[i].ul.y;
- sdlrects[i].w = rect[i].lr.x - rect[i].ul.x + 1;
- sdlrects[i].h = rect[i].lr.y - rect[i].ul.y + 1;
- }
-
- this->UpdateRects(this, phevent->num_rects, sdlrects);
-
- if (current_overlay!=NULL)
- {
- int lockedstate=current_overlay->hwdata->locked;
- int error;
- SDL_Rect src, dst;
-
- current_overlay->hwdata->locked=1;
- src.x = 0;
- src.y = 0;
- src.w = current_overlay->w;
- src.y = current_overlay->h;
- dst.x=current_overlay->hwdata->CurrentViewPort.pos.x;
- dst.y=current_overlay->hwdata->CurrentViewPort.pos.y;
- dst.w=current_overlay->hwdata->CurrentViewPort.size.w;
- dst.h=current_overlay->hwdata->CurrentViewPort.size.h;
- current_overlay->hwdata->forcedredraw=1;
- error=ph_DisplayYUVOverlay(this, current_overlay, &src, &dst);
- if (!error)
- {
- current_overlay->hwdata->forcedredraw=0;
- current_overlay->hwdata->locked=lockedstate;
- }
- }
- }
- }
- }
- break;
-
- case Ph_EV_KEY:
- {
- SDL_keysym keysym;
-
- posted = 0;
-
- keyEvent = PhGetData(phevent);
-
- if (Pk_KF_Key_Down & keyEvent->key_flags)
- {
- /* split the wheel events from real key events */
- if ((keyEvent->key_cap==Pk_Up) && (keyEvent->key_scan==0) && ((keyEvent->key_flags & Pk_KF_Scan_Valid)==Pk_KF_Scan_Valid))
- {
- posted = SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELUP, 0, 0);
- break;
- }
- if ((keyEvent->key_cap==Pk_Down) && (keyEvent->key_scan==0) && ((keyEvent->key_flags & Pk_KF_Scan_Valid)==Pk_KF_Scan_Valid))
- {
- posted = SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELDOWN, 0, 0);
- break;
- }
- posted = SDL_PrivateKeyboard(SDL_PRESSED, ph_TranslateKey(keyEvent, &keysym));
- }
- else /* must be key release */
- {
- /* split the wheel events from real key events */
- if ((keyEvent->key_cap==Pk_Up) && (keyEvent->key_scan==0) && ((keyEvent->key_flags & Pk_KF_Scan_Valid)==Pk_KF_Scan_Valid))
- {
- posted = SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELUP, 0, 0);
- break;
- }
- if ((keyEvent->key_cap==Pk_Down) && (keyEvent->key_scan==0) && ((keyEvent->key_flags & Pk_KF_Scan_Valid)==Pk_KF_Scan_Valid))
- {
- posted = SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELDOWN, 0, 0);
- break;
- }
- posted = SDL_PrivateKeyboard(SDL_RELEASED, ph_TranslateKey( keyEvent, &keysym));
- }
- }
- break;
-
- case Ph_EV_INFO:
- {
- if (phevent->subtype==Ph_OFFSCREEN_INVALID)
- {
- unsigned long* EvInfoData;
-
- EvInfoData=(unsigned long*)PhGetData(phevent);
-
- switch (*EvInfoData)
- {
- case Pg_VIDEO_MODE_SWITCHED:
- {
- }
- break;
- case Pg_ENTERED_DIRECT:
- {
- }
- break;
- case Pg_EXITED_DIRECT:
- {
- }
- break;
- case Pg_DRIVER_STARTED:
- {
- }
- break;
- }
- }
- }
- break;
- }
-
- return(posted);
-}
-
-/* perform a blocking read if no events available */
-int ph_Pending(_THIS)
-{
- /* Flush the display connection and look to see if events are queued */
- PgFlush();
-
- while (1)
- {
- switch(PhEventPeek(phevent, EVENT_SIZE))
- {
- case Ph_EVENT_MSG:
- return 1;
- case -1:
- SDL_SetError("ph_Pending(): PhEventNext failed.\n");
- return 0;
- default:
- return 0;
- }
- }
-
- /* Oh well, nothing is ready .. */
- return(0);
-}
-
-void ph_PumpEvents(_THIS)
-{
- /* Flush the display connection and look to see if events are queued */
- PgFlush();
-
- while (ph_Pending(this))
- {
- PtEventHandler(phevent);
- ph_DispatchEvent(this);
- }
-}
-
-void ph_InitKeymap(void)
-{
- int i;
-
- /* Odd keys used in international keyboards */
- for (i=0; i<SDL_arraysize(ODD_keymap); ++i)
- {
- ODD_keymap[i] = SDLK_UNKNOWN;
- }
-
- /* Map the miscellaneous keys */
- for (i=0; i<SDL_arraysize(MISC_keymap); ++i)
- {
- MISC_keymap[i] = SDLK_UNKNOWN;
- }
-
- MISC_keymap[Pk_BackSpace&0xFF] = SDLK_BACKSPACE;
- MISC_keymap[Pk_Tab&0xFF] = SDLK_TAB;
- MISC_keymap[Pk_Clear&0xFF] = SDLK_CLEAR;
- MISC_keymap[Pk_Return&0xFF] = SDLK_RETURN;
- MISC_keymap[Pk_Pause&0xFF] = SDLK_PAUSE;
- MISC_keymap[Pk_Escape&0xFF] = SDLK_ESCAPE;
- MISC_keymap[Pk_Delete&0xFF] = SDLK_DELETE;
-
- MISC_keymap[Pk_KP_0&0xFF] = SDLK_KP0;
- MISC_keymap[Pk_KP_1&0xFF] = SDLK_KP1;
- MISC_keymap[Pk_KP_2&0xFF] = SDLK_KP2;
- MISC_keymap[Pk_KP_3&0xFF] = SDLK_KP3;
- MISC_keymap[Pk_KP_4&0xFF] = SDLK_KP4;
- MISC_keymap[Pk_KP_5&0xFF] = SDLK_KP5;
- MISC_keymap[Pk_KP_6&0xFF] = SDLK_KP6;
- MISC_keymap[Pk_KP_7&0xFF] = SDLK_KP7;
- MISC_keymap[Pk_KP_8&0xFF] = SDLK_KP8;
- MISC_keymap[Pk_KP_9&0xFF] = SDLK_KP9;
-
- MISC_keymap[Pk_KP_Decimal&0xFF] = SDLK_KP_PERIOD;
- MISC_keymap[Pk_KP_Divide&0xFF] = SDLK_KP_DIVIDE;
- MISC_keymap[Pk_KP_Multiply&0xFF] = SDLK_KP_MULTIPLY;
- MISC_keymap[Pk_KP_Subtract&0xFF] = SDLK_KP_MINUS;
- MISC_keymap[Pk_KP_Add&0xFF] = SDLK_KP_PLUS;
- MISC_keymap[Pk_KP_Enter&0xFF] = SDLK_KP_ENTER;
- MISC_keymap[Pk_KP_Equal&0xFF] = SDLK_KP_EQUALS;
-
- MISC_keymap[Pk_Up&0xFF] = SDLK_UP;
- MISC_keymap[Pk_Down&0xFF] = SDLK_DOWN;
- MISC_keymap[Pk_Right&0xFF] = SDLK_RIGHT;
- MISC_keymap[Pk_Left&0xFF] = SDLK_LEFT;
- MISC_keymap[Pk_Insert&0xFF] = SDLK_INSERT;
- MISC_keymap[Pk_Home&0xFF] = SDLK_HOME;
- MISC_keymap[Pk_End&0xFF] = SDLK_END;
- MISC_keymap[Pk_Pg_Up&0xFF] = SDLK_PAGEUP;
- MISC_keymap[Pk_Pg_Down&0xFF] = SDLK_PAGEDOWN;
-
- MISC_keymap[Pk_F1&0xFF] = SDLK_F1;
- MISC_keymap[Pk_F2&0xFF] = SDLK_F2;
- MISC_keymap[Pk_F3&0xFF] = SDLK_F3;
- MISC_keymap[Pk_F4&0xFF] = SDLK_F4;
- MISC_keymap[Pk_F5&0xFF] = SDLK_F5;
- MISC_keymap[Pk_F6&0xFF] = SDLK_F6;
- MISC_keymap[Pk_F7&0xFF] = SDLK_F7;
- MISC_keymap[Pk_F8&0xFF] = SDLK_F8;
- MISC_keymap[Pk_F9&0xFF] = SDLK_F9;
- MISC_keymap[Pk_F10&0xFF] = SDLK_F10;
- MISC_keymap[Pk_F11&0xFF] = SDLK_F11;
- MISC_keymap[Pk_F12&0xFF] = SDLK_F12;
- MISC_keymap[Pk_F13&0xFF] = SDLK_F13;
- MISC_keymap[Pk_F14&0xFF] = SDLK_F14;
- MISC_keymap[Pk_F15&0xFF] = SDLK_F15;
-
- MISC_keymap[Pk_Num_Lock&0xFF] = SDLK_NUMLOCK;
- MISC_keymap[Pk_Caps_Lock&0xFF] = SDLK_CAPSLOCK;
- MISC_keymap[Pk_Scroll_Lock&0xFF] = SDLK_SCROLLOCK;
- MISC_keymap[Pk_Shift_R&0xFF] = SDLK_RSHIFT;
- MISC_keymap[Pk_Shift_L&0xFF] = SDLK_LSHIFT;
- MISC_keymap[Pk_Control_R&0xFF] = SDLK_RCTRL;
- MISC_keymap[Pk_Control_L&0xFF] = SDLK_LCTRL;
- MISC_keymap[Pk_Alt_R&0xFF] = SDLK_RALT;
- MISC_keymap[Pk_Alt_L&0xFF] = SDLK_LALT;
- MISC_keymap[Pk_Meta_R&0xFF] = SDLK_RMETA;
- MISC_keymap[Pk_Meta_L&0xFF] = SDLK_LMETA;
- MISC_keymap[Pk_Super_L&0xFF] = SDLK_LSUPER;
- MISC_keymap[Pk_Super_R&0xFF] = SDLK_RSUPER;
- MISC_keymap[Pk_Mode_switch&0xFF] = SDLK_MODE; /* "Alt Gr" key */
-
- MISC_keymap[Pk_Help&0xFF] = SDLK_HELP;
- MISC_keymap[Pk_Print&0xFF] = SDLK_PRINT;
- MISC_keymap[Pk_Break&0xFF] = SDLK_BREAK;
- MISC_keymap[Pk_Menu&0xFF] = SDLK_MENU; /* Windows "Menu" key */
-
- MISC_keymap[Pk_Hyper_R&0xFF] = SDLK_RSUPER; /* Right "Windows" */
-
- /* Left "Windows" key, but it can't be catched by application */
- MISC_keymap[Pk_Hyper_L&0xFF] = SDLK_LSUPER;
-}
-
-static unsigned long cap;
-
-SDL_keysym *ph_TranslateKey(PhKeyEvent_t *key, SDL_keysym *keysym)
-{
- /* 'sym' is set to the value of the key with modifiers applied to it.
- This member is valid only if Pk_KF_Sym_Valid is set in the key_flags.
- We will assume it is valid. */
-
- /* FIXME: This needs to check whether the cap & scancode is valid */
-
- cap = key->key_cap;
-
- switch (cap>>8)
- {
- case 0x00: /* Latin 1 */
- case 0x01: /* Latin 2 */
- case 0x02: /* Latin 3 */
- case 0x03: /* Latin 4 */
- case 0x04: /* Katakana */
- case 0x05: /* Arabic */
- case 0x06: /* Cyrillic */
- case 0x07: /* Greek */
- case 0x08: /* Technical */
- case 0x0A: /* Publishing */
- case 0x0C: /* Hebrew */
- case 0x0D: /* Thai */
- keysym->sym = (SDLKey)(cap&0xFF);
- /* Map capital letter syms to lowercase */
- if ((keysym->sym >= 'A')&&(keysym->sym <= 'Z'))
- keysym->sym += ('a'-'A');
- break;
- case 0xF0:
- keysym->sym = MISC_keymap[cap&0xFF];
- break;
- default:
- keysym->sym = SDLK_UNKNOWN;
- break;
- }
-
- keysym->scancode = key->key_scan;
- keysym->unicode = 0;
-
- if (SDL_TranslateUNICODE)
- {
- char utf8[MB_CUR_MAX];
- int utf8len;
- wchar_t unicode;
-
- switch (keysym->scancode)
- {
- /* Esc key */
- case 0x01: keysym->unicode = 27;
- break;
- /* BackSpace key */
- case 0x0E: keysym->unicode = 127;
- break;
- /* Enter key */
- case 0x1C: keysym->unicode = 10;
- break;
- default:
- utf8len = PhKeyToMb(utf8, key);
- if (utf8len > 0)
- {
- utf8len = mbtowc(&unicode, utf8, utf8len);
- if (utf8len > 0)
- {
- keysym->unicode = unicode;
- }
- }
- break;
- }
-
- }
-
- return (keysym);
-}
-
-void ph_InitOSKeymap(_THIS)
-{
- ph_InitKeymap();
-}
diff --git a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_events_c.h b/distrib/sdl-1.2.12/src/video/photon/SDL_ph_events_c.h
deleted file mode 100644
index 04152fe..0000000
--- a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_events_c.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef __SDL_PH_EVENTS_H__
-#define __SDL_PH_EVENTS_H__
-
-#include "SDL_ph_video.h"
-
-#define PH_SDL_MAX_RECTS 256
-#define PH_EVENT_SAFETY_POOL 512
-#define EVENT_SIZE (sizeof(PhEvent_t) + 1000 + PH_EVENT_SAFETY_POOL)
-
-/* Functions to be exported */
-extern void ph_InitOSKeymap(_THIS);
-extern void ph_PumpEvents(_THIS);
-
-#endif /* __SDL_PH_EVENTS_H__ */
diff --git a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_gl.c b/distrib/sdl-1.2.12/src/video/photon/SDL_ph_gl.c
deleted file mode 100644
index 97e16d2..0000000
--- a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_gl.c
+++ /dev/null
@@ -1,406 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <dlfcn.h>
-#include "SDL.h"
-#include "SDL_ph_gl.h"
-
-#if SDL_VIDEO_OPENGL
-
-#if (_NTO_VERSION >= 630)
- /* PhotonGL functions */
- GLPH_DECLARE_FUNCS;
-#endif /* 6.3.0 */
-
-#if (_NTO_VERSION < 630)
-void ph_GL_SwapBuffers(_THIS)
-{
- PgSetRegion(PtWidgetRid(window));
- PdOpenGLContextSwapBuffers(oglctx);
-}
-#else
-void ph_GL_SwapBuffers(_THIS)
-{
- qnxgl_swap_buffers(oglbuffers);
-}
-#endif /* 6.3.0 */
-
-int ph_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
-{
- switch (attrib)
- {
- case SDL_GL_DOUBLEBUFFER:
- *value=this->gl_config.double_buffer;
- break;
- case SDL_GL_STENCIL_SIZE:
- *value=this->gl_config.stencil_size;
- break;
- case SDL_GL_DEPTH_SIZE:
- *value=this->gl_config.depth_size;
- break;
-#if (_NTO_VERSION >= 630)
- case SDL_GL_RED_SIZE:
- *value=this->gl_config.red_size;
- break;
- case SDL_GL_GREEN_SIZE:
- *value=this->gl_config.green_size;
- break;
- case SDL_GL_BLUE_SIZE:
- *value=this->gl_config.blue_size;
- break;
- case SDL_GL_ALPHA_SIZE:
- *value=this->gl_config.alpha_size;
- break;
- case SDL_GL_ACCUM_RED_SIZE:
- *value=this->gl_config.accum_red_size;
- break;
- case SDL_GL_ACCUM_GREEN_SIZE:
- *value=this->gl_config.accum_green_size;
- break;
- case SDL_GL_ACCUM_BLUE_SIZE:
- *value=this->gl_config.accum_blue_size;
- break;
- case SDL_GL_ACCUM_ALPHA_SIZE:
- *value=this->gl_config.accum_alpha_size;
- break;
- case SDL_GL_STEREO:
- *value=this->gl_config.stereo;
- break;
-#endif /* 6.3.0 */
- default:
- *value=0;
- return(-1);
- }
- return 0;
-}
-
-#if (_NTO_VERSION < 630)
-int ph_GL_LoadLibrary(_THIS, const char* path)
-{
- /* if code compiled with SDL_VIDEO_OPENGL, that mean that library already linked */
- this->gl_config.driver_loaded = 1;
-
- return 0;
-}
-#else
-int ph_GL_LoadLibrary(_THIS, const char* path)
-{
- void* handle;
- int dlopen_flags=RTLD_WORLD | RTLD_GROUP;
-
- if (this->gl_config.dll_handle!=NULL)
- {
- return 0;
- }
-
- handle = dlopen(path, dlopen_flags);
-
- if (handle==NULL)
- {
- SDL_SetError("ph_GL_LoadLibrary(): Could not load OpenGL library");
- return -1;
- }
-
- this->gl_config.dll_handle = handle;
- this->gl_config.driver_loaded = 1;
-
- SDL_strlcpy(this->gl_config.driver_path, path, SDL_arraysize(this->gl_config.driver_path));
-
- return 0;
-}
-#endif /* 6.3.0 */
-
-#if (_NTO_VERSION < 630)
-void* ph_GL_GetProcAddress(_THIS, const char* proc)
-{
- return NULL;
-}
-#else
-void* ph_GL_GetProcAddress(_THIS, const char* proc)
-{
- void* function;
-
- if (this->gl_config.dll_handle==NULL)
- {
- ph_GL_LoadLibrary(this, DEFAULT_OPENGL);
- if (this->gl_config.dll_handle==NULL)
- {
- return NULL;
- }
- }
-
- function=qnxgl_get_func(proc, oglctx, 0);
- if (function==NULL)
- {
- function=dlsym(this->gl_config.dll_handle, proc);
- }
-
- return function;
-}
-#endif /* 6.3.0 */
-
-#if (_NTO_VERSION < 630)
-int ph_GL_MakeCurrent(_THIS)
-{
- PgSetRegion(PtWidgetRid(window));
-
- if (oglctx!=NULL)
- {
- PhDCSetCurrent(oglctx);
- }
-
- return 0;
-}
-#else
-int ph_GL_MakeCurrent(_THIS)
-{
- PgSetRegion(PtWidgetRid(window));
-
- if (oglctx!=NULL)
- {
- if (qnxgl_set_current(oglctx) == -1)
- {
- return -1;
- }
- }
-
- return 0;
-}
-#endif /* 6.3.0 */
-
-#if (_NTO_VERSION < 630)
-
-/* This code is actual for the Photon3D Runtime which was available prior to 6.3 only */
-
-int ph_SetupOpenGLContext(_THIS, int width, int height, int bpp, Uint32 flags)
-{
- PhDim_t dim;
- uint64_t OGLAttrib[PH_OGL_MAX_ATTRIBS];
- int exposepost=0;
- int OGLargc;
-
- dim.w=width;
- dim.h=height;
-
- if ((oglctx!=NULL) && (oglflags==flags) && (oglbpp==bpp))
- {
- PdOpenGLContextResize(oglctx, &dim);
- PhDCSetCurrent(oglctx);
- return 0;
- }
- else
- {
- if (oglctx!=NULL)
- {
- PhDCSetCurrent(NULL);
- PhDCRelease(oglctx);
- oglctx=NULL;
- exposepost=1;
- }
- }
-
- OGLargc=0;
- if (this->gl_config.depth_size)
- {
- OGLAttrib[OGLargc++]=PHOGL_ATTRIB_DEPTH_BITS;
- OGLAttrib[OGLargc++]=this->gl_config.depth_size;
- }
- if (this->gl_config.stencil_size)
- {
- OGLAttrib[OGLargc++]=PHOGL_ATTRIB_STENCIL_BITS;
- OGLAttrib[OGLargc++]=this->gl_config.stencil_size;
- }
- OGLAttrib[OGLargc++]=PHOGL_ATTRIB_FORCE_SW;
- if (flags & SDL_FULLSCREEN)
- {
- OGLAttrib[OGLargc++]=PHOGL_ATTRIB_FULLSCREEN;
- OGLAttrib[OGLargc++]=PHOGL_ATTRIB_DIRECT;
- OGLAttrib[OGLargc++]=PHOGL_ATTRIB_FULLSCREEN_BEST;
- OGLAttrib[OGLargc++]=PHOGL_ATTRIB_FULLSCREEN_CENTER;
- }
- OGLAttrib[OGLargc++]=PHOGL_ATTRIB_NONE;
-
- if (this->gl_config.double_buffer)
- {
- oglctx=PdCreateOpenGLContext(2, &dim, 0, OGLAttrib);
- }
- else
- {
- oglctx=PdCreateOpenGLContext(1, &dim, 0, OGLAttrib);
- }
-
- if (oglctx==NULL)
- {
- SDL_SetError("ph_SetupOpenGLContext(): cannot create OpenGL context !\n");
- return -1;
- }
-
- PhDCSetCurrent(oglctx);
-
- PtFlush();
-
- oglflags=flags;
- oglbpp=bpp;
-
- if (exposepost!=0)
- {
- /* OpenGL context has been recreated, so report about this fact */
- SDL_PrivateExpose();
- }
-
- return 0;
-}
-
-#else /* _NTO_VERSION */
-
-/* This code is actual for the built-in PhGL support, which became available since 6.3 */
-
-int ph_SetupOpenGLContext(_THIS, int width, int height, int bpp, Uint32 flags)
-{
- qnxgl_buf_attrib_t qnxgl_attribs[PH_OGL_MAX_ATTRIBS];
- qnxgl_buf_attrib_t* qnxgl_attribs_slide;
- int num_interfaces = 0;
- int num_buffers = 0;
-
- /* Initialize the OpenGL subsystem */
-
- num_interfaces = qnxgl_init(NULL, NULL, 0);
-
- if (num_interfaces < 0)
- {
- SDL_SetError("ph_SetupOpenGLContext(): cannot initialize OpenGL subsystem !\n");
- return -1;
- }
- if (num_interfaces == 0)
- {
- SDL_SetError("ph_SetupOpenGLContext(): there are no available OpenGL renderers was found !\n");
- return -1;
- }
-
- /* Driver is linked */
- this->gl_config.driver_loaded=1;
-
- /* Initialize the OpenGL context attributes */
- qnxgl_attribs_slide=qnxgl_attribs;
-
- /* Depth size */
- if (this->gl_config.depth_size)
- {
- fprintf(stderr, "setted depth size %d\n", this->gl_config.depth_size);
- qnxgl_attribs_slide = qnxgl_attrib_set_depth(qnxgl_attribs_slide, this->gl_config.depth_size);
- }
-
- /* Stencil size */
- if (this->gl_config.stencil_size)
- {
- qnxgl_attribs_slide = qnxgl_attrib_set_stencil(qnxgl_attribs_slide, this->gl_config.stencil_size);
- }
-
- /* The sum of the accum bits of each channel */
- if ((this->gl_config.accum_red_size != 0) && (this->gl_config.accum_blue_size != 0) &&
- (this->gl_config.accum_green_size != 0))
- {
- qnxgl_attribs_slide = qnxgl_attrib_set_accum(qnxgl_attribs_slide,
- this->gl_config.accum_red_size + this->gl_config.accum_blue_size +
- this->gl_config.accum_green_size + this->gl_config.accum_alpha_size);
- }
-
- /* Stereo mode */
- if (this->gl_config.stereo)
- {
- qnxgl_attribs_slide = qnxgl_attrib_set_stereo(qnxgl_attribs_slide);
- }
-
- /* Fullscreen mode */
- if ((flags & SDL_FULLSCREEN) == SDL_FULLSCREEN)
- {
- qnxgl_attribs_slide = qnxgl_attrib_set_hint_fullscreen(qnxgl_attribs_slide);
- }
-
- /* Double buffering mode */
- if (this->gl_config.double_buffer)
- {
- num_buffers=2;
- }
- else
- {
- num_buffers=1;
- }
-
- /* Loading the function pointers so we can use the extensions */
- GLPH_LOAD_FUNCS_GC(oglctx);
-
- /* Set the buffers region to be that of our window's region */
- qnxgl_attribs_slide = glph_attrib_set_region(qnxgl_attribs_slide, PtWidgetRid(window));
-
- /* End of the attributes array */
- qnxgl_attribs_slide = qnxgl_attrib_set_end(qnxgl_attribs_slide);
-
- /* Create the buffers with the specified color model */
- fprintf(stderr, "ARGB: %d, %d, %d, %d\n", this->gl_config.alpha_size, this->gl_config.red_size, this->gl_config.green_size, this->gl_config.blue_size);
- oglbuffers = qnxgl_buffers_create(
- QNXGL_FORMAT_BEST_RGB,
-/* __QNXGL_BUILD_FORMAT(0, __QNXGL_COLOR_MODEL_RGB, this->gl_config.alpha_size,
- this->gl_config.red_size, this->gl_config.green_size, this->gl_config.blue_size), */
- num_buffers, width, height, qnxgl_attribs, -1);
-
-
- if (oglbuffers == NULL)
- {
- SDL_SetError("ph_SetupOpenGLContext(): failed to create OpenGL buffers !\n");
- qnxgl_finish();
- return -1;
- }
-
- /* Create a QNXGL context for the previously created buffer */
- oglctx = qnxgl_context_create(oglbuffers, NULL);
-
- if (oglctx == NULL)
- {
- SDL_SetError("ph_SetupOpenGLContext(): failed to create OpenGL context !\n");
- qnxgl_buffers_destroy(oglbuffers);
- qnxgl_finish();
- return -1;
- }
-
- /* Attempt to make the context current so we can use OpenGL commands */
- if (qnxgl_set_current(oglctx) == -1)
- {
- SDL_SetError("ph_SetupOpenGLContext(): failed to make the OpenGL context current !\n");
- qnxgl_context_destroy(oglctx);
- qnxgl_buffers_destroy(oglbuffers);
- qnxgl_finish();
- return -1;
- }
-
- PtFlush();
-
- oglflags=flags;
- oglbpp=bpp;
-
- return 0;
-}
-
-#endif /* _NTO_VERSION */
-
-#endif /* SDL_VIDEO_OPENGL */
diff --git a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_gl.h b/distrib/sdl-1.2.12/src/video/photon/SDL_ph_gl.h
deleted file mode 100644
index d749bd8..0000000
--- a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_gl.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef __SDL_PH_GL_H__
-#define __SDL_PH_GL_H__
-
-#include "SDL_ph_video.h"
-
-#define DEFAULT_OPENGL "/usr/lib/libGL.so"
-
-#if SDL_VIDEO_OPENGL
- void ph_GL_SwapBuffers(_THIS);
- int ph_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
- int ph_GL_LoadLibrary(_THIS, const char* path);
- void* ph_GL_GetProcAddress(_THIS, const char* proc);
- int ph_GL_MakeCurrent(_THIS);
-
- int ph_SetupOpenGLContext(_THIS, int width, int height, int bpp, Uint32 flags);
-#endif /* SDL_VIDEO_OPENGL */
-
-#endif /* __SDL_PH_GL_H__ */
diff --git a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_image.c b/distrib/sdl-1.2.12/src/video/photon/SDL_ph_image.c
deleted file mode 100644
index 199ad9e..0000000
--- a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_image.c
+++ /dev/null
@@ -1,1059 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <Ph.h>
-#include <photon/Pg.h>
-
-#include "SDL_endian.h"
-#include "SDL_video.h"
-#include "../SDL_pixels_c.h"
-#include "SDL_ph_video.h"
-#include "SDL_ph_image_c.h"
-#include "SDL_ph_modes_c.h"
-#include "SDL_ph_gl.h"
-
-int ph_SetupImage(_THIS, SDL_Surface *screen)
-{
- PgColor_t* palette=NULL;
- int type=0;
- int bpp;
-
- bpp=screen->format->BitsPerPixel;
-
- /* Determine image type */
- switch(bpp)
- {
- case 8:{
- type = Pg_IMAGE_PALETTE_BYTE;
- }
- break;
- case 15:{
- type = Pg_IMAGE_DIRECT_555;
- }
- break;
- case 16:{
- type = Pg_IMAGE_DIRECT_565;
- }
- break;
- case 24:{
- type = Pg_IMAGE_DIRECT_888;
- }
- break;
- case 32:{
- type = Pg_IMAGE_DIRECT_8888;
- }
- break;
- default:{
- SDL_SetError("ph_SetupImage(): unsupported bpp=%d !\n", bpp);
- return -1;
- }
- break;
- }
-
- /* palette emulation code */
- if ((bpp==8) && (desktoppal==SDLPH_PAL_EMULATE))
- {
- /* creating image palette */
- palette=SDL_malloc(_Pg_MAX_PALETTE*sizeof(PgColor_t));
- if (palette==NULL)
- {
- SDL_SetError("ph_SetupImage(): can't allocate memory for palette !\n");
- return -1;
- }
- PgGetPalette(palette);
-
- /* using shared memory for speed (set last param to 1) */
- if ((SDL_Image = PhCreateImage(NULL, screen->w, screen->h, type, palette, _Pg_MAX_PALETTE, 1)) == NULL)
- {
- SDL_SetError("ph_SetupImage(): PhCreateImage() failed for bpp=8 !\n");
- SDL_free(palette);
- return -1;
- }
- }
- else
- {
- /* using shared memory for speed (set last param to 1) */
- if ((SDL_Image = PhCreateImage(NULL, screen->w, screen->h, type, NULL, 0, 1)) == NULL)
- {
- SDL_SetError("ph_SetupImage(): PhCreateImage() failed for bpp=%d !\n", bpp);
- return -1;
- }
- }
-
- screen->pixels = SDL_Image->image;
- screen->pitch = SDL_Image->bpl;
-
- this->UpdateRects = ph_NormalUpdate;
-
- return 0;
-}
-
-int ph_SetupOCImage(_THIS, SDL_Surface *screen)
-{
- int type = 0;
- int bpp;
-
- OCImage.flags = screen->flags;
-
- bpp=screen->format->BitsPerPixel;
-
- /* Determine image type */
- switch(bpp)
- {
- case 8: {
- type = Pg_IMAGE_PALETTE_BYTE;
- }
- break;
- case 15:{
- type = Pg_IMAGE_DIRECT_555;
- }
- break;
- case 16:{
- type = Pg_IMAGE_DIRECT_565;
- }
- break;
- case 24:{
- type = Pg_IMAGE_DIRECT_888;
- }
- break;
- case 32:{
- type = Pg_IMAGE_DIRECT_8888;
- }
- break;
- default:{
- SDL_SetError("ph_SetupOCImage(): unsupported bpp=%d !\n", bpp);
- return -1;
- }
- break;
- }
-
- /* Currently offscreen contexts with the same bit depth as display bpp only can be created */
- OCImage.offscreen_context = PdCreateOffscreenContext(0, screen->w, screen->h, Pg_OSC_MEM_PAGE_ALIGN);
-
- if (OCImage.offscreen_context == NULL)
- {
- SDL_SetError("ph_SetupOCImage(): PdCreateOffscreenContext() function failed !\n");
- return -1;
- }
-
- screen->pitch = OCImage.offscreen_context->pitch;
-
- OCImage.dc_ptr = (unsigned char *)PdGetOffscreenContextPtr(OCImage.offscreen_context);
-
- if (OCImage.dc_ptr == NULL)
- {
- SDL_SetError("ph_SetupOCImage(): PdGetOffscreenContextPtr function failed !\n");
- PhDCRelease(OCImage.offscreen_context);
- return -1;
- }
-
- OCImage.FrameData0 = OCImage.dc_ptr;
- OCImage.CurrentFrameData = OCImage.FrameData0;
- OCImage.current = 0;
-
- PhDCSetCurrent(OCImage.offscreen_context);
-
- screen->pixels = OCImage.CurrentFrameData;
-
- this->UpdateRects = ph_OCUpdate;
-
- return 0;
-}
-
-int ph_SetupFullScreenImage(_THIS, SDL_Surface* screen)
-{
- OCImage.flags = screen->flags;
-
- /* Begin direct and fullscreen mode */
- if (!ph_EnterFullScreen(this, screen, PH_ENTER_DIRECTMODE))
- {
- return -1;
- }
-
- /* store palette for fullscreen */
- if ((screen->format->BitsPerPixel==8) && (desktopbpp!=8))
- {
- PgGetPalette(savedpal);
- PgGetPalette(syspalph);
- }
-
- OCImage.offscreen_context = PdCreateOffscreenContext(0, 0, 0, Pg_OSC_MAIN_DISPLAY | Pg_OSC_MEM_PAGE_ALIGN | Pg_OSC_CRTC_SAFE);
- if (OCImage.offscreen_context == NULL)
- {
- SDL_SetError("ph_SetupFullScreenImage(): PdCreateOffscreenContext() function failed !\n");
- return -1;
- }
-
- if ((screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF)
- {
- OCImage.offscreen_backcontext = PdDupOffscreenContext(OCImage.offscreen_context, Pg_OSC_MEM_PAGE_ALIGN | Pg_OSC_CRTC_SAFE);
- if (OCImage.offscreen_backcontext == NULL)
- {
- SDL_SetError("ph_SetupFullScreenImage(): PdCreateOffscreenContext(back) function failed !\n");
- return -1;
- }
- }
-
- OCImage.FrameData0 = (unsigned char *)PdGetOffscreenContextPtr(OCImage.offscreen_context);
- if (OCImage.FrameData0 == NULL)
- {
- SDL_SetError("ph_SetupFullScreenImage(): PdGetOffscreenContextPtr() function failed !\n");
- ph_DestroyImage(this, screen);
- return -1;
- }
-
- if ((screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF)
- {
- OCImage.FrameData1 = (unsigned char *)PdGetOffscreenContextPtr(OCImage.offscreen_backcontext);
- if (OCImage.FrameData1 == NULL)
- {
- SDL_SetError("ph_SetupFullScreenImage(back): PdGetOffscreenContextPtr() function failed !\n");
- ph_DestroyImage(this, screen);
- return -1;
- }
- }
-
- /* wait for the hardware */
- PgFlush();
- PgWaitHWIdle();
-
- if ((screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF)
- {
- OCImage.current = 0;
- PhDCSetCurrent(OCImage.offscreen_context);
- screen->pitch = OCImage.offscreen_context->pitch;
- screen->pixels = OCImage.FrameData0;
-
- /* emulate 640x400 videomode */
- if (videomode_emulatemode==1)
- {
- int i;
-
- for (i=0; i<40; i++)
- {
- SDL_memset(screen->pixels+screen->pitch*i, 0x00, screen->pitch);
- }
- for (i=440; i<480; i++)
- {
- SDL_memset(screen->pixels+screen->pitch*i, 0x00, screen->pitch);
- }
- screen->pixels+=screen->pitch*40;
- }
- PgSwapDisplay(OCImage.offscreen_backcontext, 0);
- }
- else
- {
- OCImage.current = 0;
- PhDCSetCurrent(OCImage.offscreen_context);
- screen->pitch = OCImage.offscreen_context->pitch;
- screen->pixels = OCImage.FrameData0;
-
- /* emulate 640x400 videomode */
- if (videomode_emulatemode==1)
- {
- int i;
-
- for (i=0; i<40; i++)
- {
- SDL_memset(screen->pixels+screen->pitch*i, 0x00, screen->pitch);
- }
- for (i=440; i<480; i++)
- {
- SDL_memset(screen->pixels+screen->pitch*i, 0x00, screen->pitch);
- }
- screen->pixels+=screen->pitch*40;
- }
- }
-
- this->UpdateRects = ph_OCDCUpdate;
-
- /* wait for the hardware */
- PgFlush();
- PgWaitHWIdle();
-
- return 0;
-}
-
-#if SDL_VIDEO_OPENGL
-
-int ph_SetupOpenGLImage(_THIS, SDL_Surface* screen)
-{
- this->UpdateRects = ph_OpenGLUpdate;
- screen->pixels=NULL;
- screen->pitch=NULL;
-
- #if (_NTO_VERSION >= 630)
- if ((screen->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN)
- {
- if (!ph_EnterFullScreen(this, screen, PH_IGNORE_DIRECTMODE))
- {
- screen->flags &= ~SDL_FULLSCREEN;
- return -1;
- }
- }
- #endif /* 6.3.0 */
-
- if (ph_SetupOpenGLContext(this, screen->w, screen->h, screen->format->BitsPerPixel, screen->flags)!=0)
- {
- screen->flags &= ~SDL_OPENGL;
- return -1;
- }
-
- return 0;
-}
-
-#endif /* SDL_VIDEO_OPENGL */
-
-void ph_DestroyImage(_THIS, SDL_Surface* screen)
-{
-
-#if SDL_VIDEO_OPENGL
- if ((screen->flags & SDL_OPENGL)==SDL_OPENGL)
- {
- if (oglctx)
- {
- #if (_NTO_VERSION < 630)
- PhDCSetCurrent(NULL);
- PhDCRelease(oglctx);
- #else
- qnxgl_context_destroy(oglctx);
- qnxgl_buffers_destroy(oglbuffers);
- qnxgl_finish();
- #endif /* 6.3.0 */
- oglctx=NULL;
- oglbuffers=NULL;
- oglflags=0;
- oglbpp=0;
- }
-
- #if (_NTO_VERSION >= 630)
- if (currently_fullscreen)
- {
- ph_LeaveFullScreen(this);
- }
- #endif /* 6.3.0 */
-
- return;
- }
-#endif /* SDL_VIDEO_OPENGL */
-
- if (currently_fullscreen)
- {
- /* if we right now in 8bpp fullscreen we must release palette */
- if ((screen->format->BitsPerPixel==8) && (desktopbpp!=8))
- {
- PgSetPalette(syspalph, 0, -1, 0, 0, 0);
- PgSetPalette(savedpal, 0, 0, _Pg_MAX_PALETTE, Pg_PALSET_GLOBAL | Pg_PALSET_FORCE_EXPOSE, 0);
- PgFlush();
- }
- ph_LeaveFullScreen(this);
- }
-
- if (OCImage.offscreen_context != NULL)
- {
- PhDCRelease(OCImage.offscreen_context);
- OCImage.offscreen_context = NULL;
- OCImage.FrameData0 = NULL;
- }
- if (OCImage.offscreen_backcontext != NULL)
- {
- PhDCRelease(OCImage.offscreen_backcontext);
- OCImage.offscreen_backcontext = NULL;
- OCImage.FrameData1 = NULL;
- }
- OCImage.CurrentFrameData = NULL;
-
- if (SDL_Image)
- {
- /* if palette allocated, free it */
- if (SDL_Image->palette)
- {
- SDL_free(SDL_Image->palette);
- }
- PgShmemDestroy(SDL_Image->image);
- SDL_free(SDL_Image);
- }
-
- /* Must be zeroed everytime */
- SDL_Image = NULL;
-
- if (screen)
- {
- screen->pixels = NULL;
- }
-}
-
-int ph_UpdateHWInfo(_THIS)
-{
- PgVideoModeInfo_t vmode;
- PgHWCaps_t hwcaps;
-
- /* Update video ram amount */
- if (PgGetGraphicsHWCaps(&hwcaps) < 0)
- {
- SDL_SetError("ph_UpdateHWInfo(): GetGraphicsHWCaps() function failed !\n");
- return -1;
- }
- this->info.video_mem=hwcaps.currently_available_video_ram/1024;
-
- /* obtain current mode capabilities */
- if (PgGetVideoModeInfo(hwcaps.current_video_mode, &vmode) < 0)
- {
- SDL_SetError("ph_UpdateHWInfo(): GetVideoModeInfo() function failed !\n");
- return -1;
- }
-
- if ((vmode.mode_capabilities1 & PgVM_MODE_CAP1_OFFSCREEN) == PgVM_MODE_CAP1_OFFSCREEN)
- {
- /* this is a special test for drivers which tries to lie about offscreen capability */
- if (hwcaps.currently_available_video_ram!=0)
- {
- this->info.hw_available = 1;
- }
- else
- {
- this->info.hw_available = 0;
- }
- }
- else
- {
- this->info.hw_available = 0;
- }
-
- if ((vmode.mode_capabilities2 & PgVM_MODE_CAP2_RECTANGLE) == PgVM_MODE_CAP2_RECTANGLE)
- {
- this->info.blit_fill = 1;
- }
- else
- {
- this->info.blit_fill = 0;
- }
-
- if ((vmode.mode_capabilities2 & PgVM_MODE_CAP2_BITBLT) == PgVM_MODE_CAP2_BITBLT)
- {
- this->info.blit_hw = 1;
- }
- else
- {
- this->info.blit_hw = 0;
- }
-
- if ((vmode.mode_capabilities2 & PgVM_MODE_CAP2_ALPHA_BLEND) == PgVM_MODE_CAP2_ALPHA_BLEND)
- {
- this->info.blit_hw_A = 1;
- }
- else
- {
- this->info.blit_hw_A = 0;
- }
-
- if ((vmode.mode_capabilities2 & PgVM_MODE_CAP2_CHROMA) == PgVM_MODE_CAP2_CHROMA)
- {
- this->info.blit_hw_CC = 1;
- }
- else
- {
- this->info.blit_hw_CC = 0;
- }
-
- return 0;
-}
-
-int ph_SetupUpdateFunction(_THIS, SDL_Surface* screen, Uint32 flags)
-{
- int setupresult=-1;
-
- ph_DestroyImage(this, screen);
-
-#if SDL_VIDEO_OPENGL
- if ((flags & SDL_OPENGL)==SDL_OPENGL)
- {
- setupresult=ph_SetupOpenGLImage(this, screen);
- }
- else
- {
-#endif
- if ((flags & SDL_FULLSCREEN)==SDL_FULLSCREEN)
- {
- setupresult=ph_SetupFullScreenImage(this, screen);
- }
- else
- {
- if ((flags & SDL_HWSURFACE)==SDL_HWSURFACE)
- {
- setupresult=ph_SetupOCImage(this, screen);
- }
- else
- {
- setupresult=ph_SetupImage(this, screen);
- }
- }
-#if SDL_VIDEO_OPENGL
- }
-#endif
- if (setupresult!=-1)
- {
- ph_UpdateHWInfo(this);
- }
-
- return setupresult;
-}
-
-int ph_AllocHWSurface(_THIS, SDL_Surface* surface)
-{
- PgHWCaps_t hwcaps;
-
- if (surface->hwdata!=NULL)
- {
- SDL_SetError("ph_AllocHWSurface(): hwdata already exists!\n");
- return -1;
- }
- surface->hwdata=SDL_malloc(sizeof(struct private_hwdata));
- SDL_memset(surface->hwdata, 0x00, sizeof(struct private_hwdata));
- surface->hwdata->offscreenctx=PdCreateOffscreenContext(0, surface->w, surface->h, Pg_OSC_MEM_PAGE_ALIGN);
- if (surface->hwdata->offscreenctx == NULL)
- {
- SDL_SetError("ph_AllocHWSurface(): PdCreateOffscreenContext() function failed !\n");
- return -1;
- }
- surface->pixels=PdGetOffscreenContextPtr(surface->hwdata->offscreenctx);
- if (surface->pixels==NULL)
- {
- PhDCRelease(surface->hwdata->offscreenctx);
- SDL_SetError("ph_AllocHWSurface(): PdGetOffscreenContextPtr() function failed !\n");
- return -1;
- }
- surface->pitch=surface->hwdata->offscreenctx->pitch;
- surface->flags|=SDL_HWSURFACE;
- surface->flags|=SDL_PREALLOC;
-
-#if 0 /* FIXME */
- /* create simple offscreen lock */
- surface->hwdata->crlockparam.flags=0;
- if (PdCreateOffscreenLock(surface->hwdata->offscreenctx, &surface->hwdata->crlockparam)!=EOK)
- {
- PhDCRelease(surface->hwdata->offscreenctx);
- SDL_SetError("ph_AllocHWSurface(): Can't create offscreen lock !\n");
- return -1;
- }
-#endif /* 0 */
-
- /* Update video ram amount */
- if (PgGetGraphicsHWCaps(&hwcaps) < 0)
- {
- PdDestroyOffscreenLock(surface->hwdata->offscreenctx);
- PhDCRelease(surface->hwdata->offscreenctx);
- SDL_SetError("ph_AllocHWSurface(): GetGraphicsHWCaps() function failed !\n");
- return -1;
- }
- this->info.video_mem=hwcaps.currently_available_video_ram/1024;
-
- return 0;
-}
-
-void ph_FreeHWSurface(_THIS, SDL_Surface* surface)
-{
- PgHWCaps_t hwcaps;
-
- if (surface->hwdata==NULL)
- {
- SDL_SetError("ph_FreeHWSurface(): no hwdata!\n");
- return;
- }
- if (surface->hwdata->offscreenctx == NULL)
- {
- SDL_SetError("ph_FreeHWSurface(): no offscreen context to delete!\n");
- return;
- }
-
-#if 0 /* FIXME */
- /* unlock the offscreen context if it has been locked before destroy it */
- if (PdIsOffscreenLocked(surface->hwdata->offscreenctx)==Pg_OSC_LOCKED)
- {
- PdUnlockOffscreen(surface->hwdata->offscreenctx);
- }
-
- PdDestroyOffscreenLock(surface->hwdata->offscreenctx);
-#endif /* 0 */
-
- PhDCRelease(surface->hwdata->offscreenctx);
-
- SDL_free(surface->hwdata);
- surface->hwdata=NULL;
-
- /* Update video ram amount */
- if (PgGetGraphicsHWCaps(&hwcaps) < 0)
- {
- SDL_SetError("ph_FreeHWSurface(): GetGraphicsHWCaps() function failed !\n");
- return;
- }
- this->info.video_mem=hwcaps.currently_available_video_ram/1024;
-
- return;
-}
-
-int ph_CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst)
-{
- if ((src->hwdata==NULL) && (src != this->screen))
- {
- SDL_SetError("ph_CheckHWBlit(): Source surface haven't hardware specific data.\n");
- src->flags&=~SDL_HWACCEL;
- return -1;
- }
- if ((src->flags & SDL_HWSURFACE) != SDL_HWSURFACE)
- {
- SDL_SetError("ph_CheckHWBlit(): Source surface isn't a hardware surface.\n");
- src->flags&=~SDL_HWACCEL;
- return -1;
- }
-
- if ((src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY)
- {
- if (this->info.blit_hw_CC!=1)
- {
- src->flags&=~SDL_HWACCEL;
- src->map->hw_blit=NULL;
- return -1;
- }
- }
-
- if ((src->flags & SDL_SRCALPHA) == SDL_SRCALPHA)
- {
- if (this->info.blit_hw_A!=1)
- {
- src->flags&=~SDL_HWACCEL;
- src->map->hw_blit=NULL;
- return -1;
- }
- }
-
- src->flags|=SDL_HWACCEL;
- src->map->hw_blit = ph_HWAccelBlit;
-
- return 1;
-}
-
-PgColor_t ph_ExpandColor(_THIS, SDL_Surface* surface, Uint32 color)
-{
- Uint32 truecolor;
-
- /* Photon API accepts true colors only during hw filling operations */
- switch(surface->format->BitsPerPixel)
- {
- case 8:
- {
- if ((surface->format->palette) && (color<=surface->format->palette->ncolors))
- {
- truecolor=PgRGB(surface->format->palette->colors[color].r,
- surface->format->palette->colors[color].g,
- surface->format->palette->colors[color].b);
- }
- else
- {
- SDL_SetError("ph_ExpandColor(): Color out of range for the 8bpp mode !\n");
- return 0xFFFFFFFFUL;
- }
- }
- break;
- case 15:
- {
- truecolor = ((color & 0x00007C00UL) << 9) | /* R */
- ((color & 0x000003E0UL) << 6) | /* G */
- ((color & 0x0000001FUL) << 3) | /* B */
- ((color & 0x00007000UL) << 4) | /* R compensation */
- ((color & 0x00000380UL) << 1) | /* G compensation */
- ((color & 0x0000001CUL) >> 2); /* B compensation */
- }
- break;
- case 16:
- {
- truecolor = ((color & 0x0000F800UL) << 8) | /* R */
- ((color & 0x000007E0UL) << 5) | /* G */
- ((color & 0x0000001FUL) << 3) | /* B */
- ((color & 0x0000E000UL) << 3) | /* R compensation */
- ((color & 0x00000600UL) >> 1) | /* G compensation */
- ((color & 0x0000001CUL) >> 2); /* B compensation */
-
- }
- break;
- case 24:
- {
- truecolor=color & 0x00FFFFFFUL;
- }
- break;
- case 32:
- {
- truecolor=color;
- }
- break;
- default:
- {
- SDL_SetError("ph_ExpandColor(): Unsupported depth for the hardware operations !\n");
- return 0xFFFFFFFFUL;
- }
- }
-
- return truecolor;
-}
-
-int ph_FillHWRect(_THIS, SDL_Surface* surface, SDL_Rect* rect, Uint32 color)
-{
- PgColor_t oldcolor;
- Uint32 truecolor;
- int ydisp=0;
-
- if (this->info.blit_fill!=1)
- {
- return -1;
- }
-
- truecolor=ph_ExpandColor(this, surface, color);
- if (truecolor==0xFFFFFFFFUL)
- {
- return -1;
- }
-
- oldcolor=PgSetFillColor(truecolor);
-
- /* 640x400 videomode emulation */
- if (videomode_emulatemode==1)
- {
- ydisp+=40;
- }
-
- PgDrawIRect(rect->x, rect->y+ydisp, rect->w+rect->x-1, rect->h+rect->y+ydisp-1, Pg_DRAW_FILL);
- PgSetFillColor(oldcolor);
- PgFlush();
- PgWaitHWIdle();
-
- return 0;
-}
-
-int ph_FlipHWSurface(_THIS, SDL_Surface* screen)
-{
- PhArea_t farea;
-
- if ((screen->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN)
- {
- /* flush all drawing ops before blitting */
- PgFlush();
- PgWaitHWIdle();
-
- farea.pos.x=0;
- farea.pos.y=0;
- farea.size.w=screen->w;
- farea.size.h=screen->h;
-
- /* emulate 640x400 videomode */
- if (videomode_emulatemode==1)
- {
- farea.pos.y+=40;
- }
-
- PgContextBlitArea(OCImage.offscreen_context, &farea, OCImage.offscreen_backcontext, &farea);
-
- /* flush the blitting */
- PgFlush();
- PgWaitHWIdle();
- }
- return 0;
-}
-
-int ph_LockHWSurface(_THIS, SDL_Surface* surface)
-{
-
-#if 0 /* FIXME */
- int lockresult;
-
- if (surface->hwdata == NULL)
- {
- return;
- }
-
- surface->hwdata->lockparam.flags=0;
- surface->hwdata->lockparam.time_out=NULL;
- lockresult=PdLockOffscreen(surface->hwdata->offscreenctx, &surface->hwdata->lockparam);
-
- switch (lockresult)
- {
- case EOK:
- break;
- case Pg_OSC_LOCK_DEADLOCK:
- SDL_SetError("ph_LockHWSurface(): Deadlock detected !\n");
- return -1;
- case Pg_OSC_LOCK_INVALID:
- SDL_SetError("ph_LockHWSurface(): Lock invalid !\n");
- return -1;
- default:
- SDL_SetError("ph_LockHWSurface(): Can't lock the surface !\n");
- return -1;
- }
-#endif /* 0 */
-
- return 0;
-}
-
-void ph_UnlockHWSurface(_THIS, SDL_Surface* surface)
-{
-
-#if 0 /* FIXME */
- int unlockresult;
-
- if ((surface == NULL) || (surface->hwdata == NULL))
- {
- return;
- }
-
- if (PdIsOffscreenLocked(surface->hwdata->offscreenctx)==Pg_OSC_LOCKED)
- {
- unlockresult=PdUnlockOffscreen(surface->hwdata->offscreenctx);
- }
-#endif /* 0 */
-
- return;
-}
-
-int ph_HWAccelBlit(SDL_Surface* src, SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect)
-{
- SDL_VideoDevice* this=current_video;
- PhArea_t srcarea;
- PhArea_t dstarea;
- int ydisp=0;
-
- /* 640x400 videomode emulation */
- if (videomode_emulatemode==1)
- {
- ydisp+=40;
- }
-
- srcarea.pos.x=srcrect->x;
- srcarea.pos.y=srcrect->y;
- srcarea.size.w=srcrect->w;
- srcarea.size.h=srcrect->h;
-
- dstarea.pos.x=dstrect->x;
- dstarea.pos.y=dstrect->y;
- dstarea.size.w=dstrect->w;
- dstarea.size.h=dstrect->h;
-
- if (((src == this->screen) || (src->hwdata!=NULL)) && ((dst == this->screen) || (dst->hwdata!=NULL)))
- {
- if ((src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY)
- {
- ph_SetHWColorKey(this, src, src->format->colorkey);
- PgChromaOn();
- }
-
- if ((src->flags & SDL_SRCALPHA) == SDL_SRCALPHA)
- {
- ph_SetHWAlpha(this, src, src->format->alpha);
- PgAlphaOn();
- }
-
- if (dst == this->screen)
- {
- if (src == this->screen)
- {
- /* blitting from main screen to main screen */
- dstarea.pos.y+=ydisp;
- srcarea.pos.y+=ydisp;
- PgContextBlitArea(OCImage.offscreen_context, &srcarea, OCImage.offscreen_context, &dstarea);
- }
- else
- {
- /* blitting from offscreen to main screen */
- dstarea.pos.y+=ydisp;
- PgContextBlitArea(src->hwdata->offscreenctx, &srcarea, OCImage.offscreen_context, &dstarea);
- }
- }
- else
- {
- if (src == this->screen)
- {
- /* blitting from main screen to offscreen */
- srcarea.pos.y+=ydisp;
- PgContextBlitArea(OCImage.offscreen_context, &srcarea, dst->hwdata->offscreenctx, &dstarea);
- }
- else
- {
- /* blitting offscreen to offscreen */
- PgContextBlitArea(src->hwdata->offscreenctx, &srcarea, dst->hwdata->offscreenctx, &dstarea);
- }
- }
-
- if ((src->flags & SDL_SRCALPHA) == SDL_SRCALPHA)
- {
- PgAlphaOff();
- }
-
- if ((src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY)
- {
- PgChromaOff();
- }
- }
- else
- {
- SDL_SetError("ph_HWAccelBlit(): Source or target surface is not a hardware surface !\n");
- return -1;
- }
-
- PgFlush();
- PgWaitHWIdle();
-
- return 0;
-}
-
-int ph_SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key)
-{
- if (this->info.blit_hw_CC!=1)
- {
- return -1;
- }
-
- if (surface->hwdata!=NULL)
- {
- surface->hwdata->colorkey=ph_ExpandColor(this, surface, key);
- if (surface->hwdata->colorkey==0xFFFFFFFFUL)
- {
- return -1;
- }
- }
- PgSetChroma(surface->hwdata->colorkey, Pg_CHROMA_SRC_MATCH | Pg_CHROMA_NODRAW);
-
- return 0;
-}
-
-int ph_SetHWAlpha(_THIS, SDL_Surface* surface, Uint8 alpha)
-{
- if (this->info.blit_hw_A!=1)
- {
- return -1;
- }
-
- PgSetAlphaBlend(NULL, alpha);
-
- return 0;
-}
-
-#if SDL_VIDEO_OPENGL
-void ph_OpenGLUpdate(_THIS, int numrects, SDL_Rect* rects)
-{
- this->GL_SwapBuffers(this);
-
- return;
-}
-#endif /* SDL_VIDEO_OPENGL */
-
-void ph_NormalUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- PhPoint_t ph_pos;
- PhRect_t ph_rect;
- int i;
-
- for (i=0; i<numrects; ++i)
- {
- if (rects[i].w==0) /* Clipped? dunno why but this occurs sometime. */
- {
- continue;
- }
-
- if (rects[i].h==0) /* Clipped? dunno why but this occurs sometime. */
- {
- continue;
- }
-
- ph_pos.x = rects[i].x;
- ph_pos.y = rects[i].y;
- ph_rect.ul.x = rects[i].x;
- ph_rect.ul.y = rects[i].y;
- ph_rect.lr.x = rects[i].x + rects[i].w;
- ph_rect.lr.y = rects[i].y + rects[i].h;
-
- if (PgDrawPhImageRectmx(&ph_pos, SDL_Image, &ph_rect, 0) < 0)
- {
- SDL_SetError("ph_NormalUpdate(): PgDrawPhImageRectmx failed!\n");
- return;
- }
- }
-
- if (PgFlush() < 0)
- {
- SDL_SetError("ph_NormalUpdate(): PgFlush() function failed!\n");
- }
-}
-
-void ph_OCUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- int i;
-
- PhPoint_t zero = {0, 0};
- PhArea_t src_rect;
- PhArea_t dest_rect;
-
- PgSetTranslation(&zero, 0);
- PgSetRegion(PtWidgetRid(window));
- PgSetClipping(0, NULL);
-
- PgFlush();
- PgWaitHWIdle();
-
- for (i=0; i<numrects; ++i)
- {
- if (rects[i].w == 0) /* Clipped? */
- {
- continue;
- }
-
- if (rects[i].h == 0) /* Clipped? */
- {
- continue;
- }
-
- src_rect.pos.x=rects[i].x;
- src_rect.pos.y=rects[i].y;
- dest_rect.pos.x=rects[i].x;
- dest_rect.pos.y=rects[i].y;
-
- src_rect.size.w=rects[i].w;
- src_rect.size.h=rects[i].h;
- dest_rect.size.w=rects[i].w;
- dest_rect.size.h=rects[i].h;
-
- PgContextBlitArea(OCImage.offscreen_context, &src_rect, NULL, &dest_rect);
- }
-
- if (PgFlush() < 0)
- {
- SDL_SetError("ph_OCUpdate(): PgFlush failed.\n");
- }
-}
-
-void ph_OCDCUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- PgWaitHWIdle();
-
- if (PgFlush() < 0)
- {
- SDL_SetError("ph_OCDCUpdate(): PgFlush failed.\n");
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_image_c.h b/distrib/sdl-1.2.12/src/video/photon/SDL_ph_image_c.h
deleted file mode 100644
index 7cb063c..0000000
--- a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_image_c.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef __SDL_PH_IMAGE_H__
-#define __SDL_PH_IMAGE_H__
-
-#include "../../events/SDL_events_c.h"
-#include "SDL_ph_video.h"
-
-struct private_hwdata
-{
- PdOffscreenContext_t* offscreenctx;
- PdOSCCreateLockParams_t crlockparam;
- PdOSCLockParams_t lockparam;
- Uint32 colorkey;
-};
-
-extern int ph_SetupImage(_THIS, SDL_Surface* screen);
-extern void ph_DestroyImage(_THIS, SDL_Surface* screen);
-extern int ph_SetupUpdateFunction(_THIS, SDL_Surface* screen, Uint32 flags);
-
-extern int ph_AllocHWSurface(_THIS, SDL_Surface* surface);
-extern void ph_FreeHWSurface(_THIS, SDL_Surface* surface);
-extern int ph_CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst);
-extern int ph_FillHWRect(_THIS, SDL_Surface* surface, SDL_Rect* rect, Uint32 color);
-extern int ph_LockHWSurface(_THIS, SDL_Surface* surface);
-extern void ph_UnlockHWSurface(_THIS, SDL_Surface* surface);
-extern int ph_FlipHWSurface(_THIS, SDL_Surface* surface);
-extern int ph_SetHWColorKey(_THIS, SDL_Surface* surface, Uint32 key);
-extern int ph_SetHWAlpha(_THIS, SDL_Surface* surface, Uint8 alpha);
-extern int ph_HWAccelBlit(SDL_Surface* src, SDL_Rect *srcrect, SDL_Surface* dst, SDL_Rect* dstrect);
-extern int ph_UpdateHWInfo(_THIS);
-
-extern void ph_NormalUpdate(_THIS, int numrects, SDL_Rect* rects);
-extern void ph_OCUpdate(_THIS, int numrects, SDL_Rect* rects);
-extern void ph_OCDCUpdate(_THIS, int numrects, SDL_Rect* rects);
-extern void ph_OpenGLUpdate(_THIS, int numrects, SDL_Rect* rects);
-
-#endif /* __SDL_PH_IMAGE_H__ */
diff --git a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_modes.c b/distrib/sdl-1.2.12/src/video/photon/SDL_ph_modes.c
deleted file mode 100644
index 2e6f128..0000000
--- a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_modes.c
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_ph_modes_c.h"
-
-static PgVideoModeInfo_t mode_info;
-static PgVideoModes_t mode_list;
-
-/* The current list of available video modes */
-SDL_Rect SDL_modelist[PH_MAX_VIDEOMODES];
-SDL_Rect* SDL_modearray[PH_MAX_VIDEOMODES];
-
-static int compare_modes_by_res(const void* mode1, const void* mode2)
-{
- PgVideoModeInfo_t mode1_info;
- PgVideoModeInfo_t mode2_info;
-
- if (PgGetVideoModeInfo(*(unsigned short*)mode1, &mode1_info) < 0)
- {
- return 0;
- }
-
- if (PgGetVideoModeInfo(*(unsigned short*)mode2, &mode2_info) < 0)
- {
- return 0;
- }
-
- if (mode1_info.width == mode2_info.width)
- {
- return mode2_info.height - mode1_info.height;
- }
- else
- {
- return mode2_info.width - mode1_info.width;
- }
-}
-
-SDL_Rect **ph_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- int i = 0;
- int j = 0;
- SDL_Rect Amodelist[PH_MAX_VIDEOMODES];
-
- for (i=0; i<PH_MAX_VIDEOMODES; i++)
- {
- SDL_modearray[i]=&SDL_modelist[i];
- }
-
- if (PgGetVideoModeList(&mode_list) < 0)
- {
- SDL_SetError("ph_ListModes(): PgGetVideoModeList() function failed !\n");
- return NULL;
- }
-
- mode_info.bits_per_pixel = 0;
-
- for (i=0; i < mode_list.num_modes; i++)
- {
- if (PgGetVideoModeInfo(mode_list.modes[i], &mode_info) < 0)
- {
- SDL_SetError("ph_ListModes(): PgGetVideoModeInfo() function failed on mode: 0x%X.\n", mode_list.modes[i]);
- return NULL;
- }
- if(mode_info.bits_per_pixel == format->BitsPerPixel)
- {
- Amodelist[j].w = mode_info.width;
- Amodelist[j].h = mode_info.height;
- Amodelist[j].x = 0;
- Amodelist[j].y = 0;
- j++;
- }
- }
-
- /* reorder biggest for smallest, assume width dominates */
-
- for(i=0; i<j; i++)
- {
- SDL_modelist[i].w = Amodelist[j - i - 1].w;
- SDL_modelist[i].h = Amodelist[j - i - 1].h;
- SDL_modelist[i].x = Amodelist[j - i - 1].x;
- SDL_modelist[i].y = Amodelist[j - i - 1].y;
- }
- SDL_modearray[j]=NULL;
-
- return SDL_modearray;
-}
-
-void ph_FreeVideoModes(_THIS)
-{
- return;
-}
-
-/* return the mode associated with width, height and bpp */
-/* if there is no mode then zero is returned */
-int ph_GetVideoMode(int width, int height, int bpp)
-{
- int i;
- int modestage=0;
- int closestmode=0;
-
- if (PgGetVideoModeList(&mode_list) < 0)
- {
- return -1;
- }
-
- /* special case for the double-sized 320x200 mode */
- if ((width==640) && (height==400))
- {
- modestage=1;
- }
-
- /* search list for exact match */
- for (i=0; i<mode_list.num_modes; i++)
- {
- if (PgGetVideoModeInfo(mode_list.modes[i], &mode_info) < 0)
- {
- return 0;
- }
-
- if ((mode_info.width == width) && (mode_info.height == height) &&
- (mode_info.bits_per_pixel == bpp))
- {
- return mode_list.modes[i];
- }
- else
- {
- if ((modestage) && (mode_info.width == width) && (mode_info.height == height+80) &&
- (mode_info.bits_per_pixel == bpp))
- {
- modestage=2;
- closestmode=mode_list.modes[i];
- }
- }
- }
-
- /* if we are here, then no 640x400xbpp mode found and we'll emulate it via 640x480xbpp mode */
- if (modestage==2)
- {
- return closestmode;
- }
-
- return (i == mode_list.num_modes) ? 0 : mode_list.modes[i];
-}
-
-/* return the mode associated with width, height and bpp */
-/* if requested bpp is not found the mode with closest bpp is returned */
-int get_mode_any_format(int width, int height, int bpp)
-{
- int i, closest, delta, min_delta;
-
- if (PgGetVideoModeList(&mode_list) < 0)
- {
- return -1;
- }
-
- SDL_qsort(mode_list.modes, mode_list.num_modes, sizeof(unsigned short), compare_modes_by_res);
-
- for(i=0;i<mode_list.num_modes;i++)
- {
- if (PgGetVideoModeInfo(mode_list.modes[i], &mode_info) < 0)
- {
- return 0;
- }
- if ((mode_info.width == width) && (mode_info.height == height))
- {
- break;
- }
- }
-
- if (i<mode_list.num_modes)
- {
- /* get closest bpp */
- closest = i++;
- if (mode_info.bits_per_pixel == bpp)
- {
- return mode_list.modes[closest];
- }
-
- min_delta = abs(mode_info.bits_per_pixel - bpp);
-
- while(1)
- {
- if (PgGetVideoModeInfo(mode_list.modes[i], &mode_info) < 0)
- {
- return 0;
- }
-
- if ((mode_info.width != width) || (mode_info.height != height))
- {
- break;
- }
- else
- {
- if (mode_info.bits_per_pixel == bpp)
- {
- closest = i;
- break;
- }
- else
- {
- delta = abs(mode_info.bits_per_pixel - bpp);
- if (delta < min_delta)
- {
- closest = i;
- min_delta = delta;
- }
- i++;
- }
- }
- }
- return mode_list.modes[closest];
- }
-
- return 0;
-}
-
-int ph_ToggleFullScreen(_THIS, int on)
-{
- return -1;
-}
-
-int ph_EnterFullScreen(_THIS, SDL_Surface* screen, int fmode)
-{
- PgDisplaySettings_t settings;
- int mode;
- char* refreshrate;
- int refreshratenum;
-
- if (!currently_fullscreen)
- {
- /* Get the video mode and set it */
- if (screen->flags & SDL_ANYFORMAT)
- {
- if ((mode = get_mode_any_format(screen->w, screen->h, screen->format->BitsPerPixel)) == 0)
- {
- SDL_SetError("ph_EnterFullScreen(): can't find appropriate video mode !\n");
- return 0;
- }
- }
- else
- {
- if ((mode = ph_GetVideoMode(screen->w, screen->h, screen->format->BitsPerPixel)) == 0)
- {
- SDL_SetError("ph_EnterFullScreen(): can't find appropriate video mode !\n");
- return 0;
- }
- if (PgGetVideoModeInfo(mode, &mode_info) < 0)
- {
- SDL_SetError("ph_EnterFullScreen(): can't get video mode capabilities !\n");
- return 0;
- }
- if (mode_info.height != screen->h)
- {
- if ((mode_info.height==480) && (screen->h==400))
- {
- videomode_emulatemode=1;
- }
- }
- else
- {
- videomode_emulatemode=0;
- }
- }
-
- /* save old video mode caps */
- PgGetVideoMode(&settings);
- old_video_mode=settings.mode;
- old_refresh_rate=settings.refresh;
-
- /* setup new video mode */
- settings.mode = mode;
- settings.refresh = 0;
- settings.flags = 0;
-
- refreshrate=SDL_getenv("SDL_PHOTON_FULLSCREEN_REFRESH");
- if (refreshrate!=NULL)
- {
- if (SDL_sscanf(refreshrate, "%d", &refreshratenum)==1)
- {
- settings.refresh = refreshratenum;
- }
- }
-
- if (PgSetVideoMode(&settings) < 0)
- {
- SDL_SetError("ph_EnterFullScreen(): PgSetVideoMode() call failed !\n");
- return 0;
- }
-
- if (this->screen)
- {
- if ((this->screen->flags & SDL_OPENGL)==SDL_OPENGL)
- {
-#if !SDL_VIDEO_OPENGL || (_NTO_VERSION < 630)
- return 0; /* 6.3.0 */
-#endif
- }
- }
-
- if (fmode==0)
- {
- if (OCImage.direct_context==NULL)
- {
- OCImage.direct_context=(PdDirectContext_t*)PdCreateDirectContext();
- if (!OCImage.direct_context)
- {
- SDL_SetError("ph_EnterFullScreen(): Can't create direct context !\n");
- ph_LeaveFullScreen(this);
- return 0;
- }
- }
- OCImage.oldDC=PdDirectStart(OCImage.direct_context);
- }
-
- currently_fullscreen = 1;
- }
- PgFlush();
-
- return 1;
-}
-
-int ph_LeaveFullScreen(_THIS)
-{
- PgDisplaySettings_t oldmode_settings;
-
- if (currently_fullscreen)
- {
- if ((this->screen) && ((this->screen->flags & SDL_OPENGL)==SDL_OPENGL))
- {
-#if !SDL_VIDEO_OPENGL || (_NTO_VERSION < 630)
- return 0;
-#endif
- }
-
- /* release routines starts here */
- {
- if (OCImage.direct_context)
- {
- PdDirectStop(OCImage.direct_context);
- PdReleaseDirectContext(OCImage.direct_context);
- OCImage.direct_context=NULL;
- }
- if (OCImage.oldDC)
- {
- PhDCSetCurrent(OCImage.oldDC);
- OCImage.oldDC=NULL;
- }
-
- currently_fullscreen=0;
-
- /* Restore old video mode */
- if (old_video_mode != -1)
- {
- oldmode_settings.mode = (unsigned short) old_video_mode;
- oldmode_settings.refresh = (unsigned short) old_refresh_rate;
- oldmode_settings.flags = 0;
-
- if (PgSetVideoMode(&oldmode_settings) < 0)
- {
- SDL_SetError("Ph_LeaveFullScreen(): PgSetVideoMode() function failed !\n");
- return 0;
- }
- }
-
- old_video_mode=-1;
- old_refresh_rate=-1;
- }
- }
- return 1;
-}
diff --git a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_modes_c.h b/distrib/sdl-1.2.12/src/video/photon/SDL_ph_modes_c.h
deleted file mode 100644
index 86e494c..0000000
--- a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_modes_c.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef __SDL_PH_MODES_H__
-#define __SDL_PH_MODES_H__
-
-#include "SDL_ph_video.h"
-
-#define PH_MAX_VIDEOMODES 127
-
-#define PH_ENTER_DIRECTMODE 0
-#define PH_IGNORE_DIRECTMODE 1
-
-extern SDL_Rect **ph_ListModes(_THIS,SDL_PixelFormat *format, Uint32 flags);
-extern void ph_FreeVideoModes(_THIS);
-extern int ph_ResizeFullScreen(_THIS);
-extern int ph_EnterFullScreen(_THIS, SDL_Surface* screen, int fmode);
-extern int ph_LeaveFullScreen(_THIS);
-extern int ph_GetVideoMode(int width, int height, int bpp);
-extern int get_mode_any_format(int width, int height, int bpp);
-extern int ph_ToggleFullScreen(_THIS, int on);
-
-#endif /* __SDL_PH_MODES_H__ */
diff --git a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_mouse.c b/distrib/sdl-1.2.12/src/video/photon/SDL_ph_mouse.c
deleted file mode 100644
index e0868bc..0000000
--- a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_mouse.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_mouse.h"
-#include "../../events/SDL_events_c.h"
-#include "../SDL_cursor_c.h"
-#include "SDL_ph_mouse_c.h"
-
-struct WMcursor
-{
- PhCursorDef_t *ph_cursor ;
-};
-
-void ph_FreeWMCursor(_THIS, WMcursor *cursor)
-{
- if (window != NULL)
- {
- SDL_Lock_EventThread();
-
- if (PtSetResource(window, Pt_ARG_CURSOR_TYPE, Ph_CURSOR_INHERIT, 0) < 0)
- {
- /* TODO: output error msg */
- }
-
- SDL_Unlock_EventThread();
- }
-
- SDL_free(cursor);
-}
-
-WMcursor *ph_CreateWMCursor(_THIS, Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
-{
- WMcursor* cursor;
- int clen, i;
- unsigned char bit, databit, maskbit;
-
- /* Allocate and initialize the cursor memory */
- if ((cursor = (WMcursor*)SDL_malloc(sizeof(WMcursor))) == NULL)
- {
- SDL_OutOfMemory();
- return(NULL);
- }
- SDL_memset(cursor,0,sizeof(WMcursor));
-
- cursor->ph_cursor = (PhCursorDef_t *) SDL_malloc(sizeof(PhCursorDef_t) + 32*4*2);
-
- if (cursor->ph_cursor == NULL)
- {
- SDL_SetError("ph_CreateWMCursor(): cursor malloc failed !\n");
- return NULL;
- }
-
- SDL_memset(cursor->ph_cursor,0,(sizeof(PhCursorDef_t) + 32*4*2));
-
- cursor->ph_cursor->hdr.type =Ph_RDATA_CURSOR;
- cursor->ph_cursor->size1.x = (short)w;
- cursor->ph_cursor->size1.y = (short)h;
- cursor->ph_cursor->offset1.x = (short)hot_x;
- cursor->ph_cursor->offset1.y = (short)hot_y;
- cursor->ph_cursor->bytesperline1 = (char)w/8;
- cursor->ph_cursor->color1 = Pg_WHITE;
- cursor->ph_cursor->size2.x = (short)w;
- cursor->ph_cursor->size2.y = (short)h;
- cursor->ph_cursor->offset2.x = (short)hot_x;
- cursor->ph_cursor->offset2.y = (short)hot_y;
- cursor->ph_cursor->bytesperline2 = (char)w/8;
- cursor->ph_cursor->color2 = Pg_BLACK;
-
- clen = (w/8)*h;
-
- /* Copy the mask and the data to different bitmap planes */
- for (i=0; i<clen; ++i)
- {
- for (bit = 0; bit < 8; bit++)
- {
- databit = data[i] & (1 << bit);
- maskbit = mask[i] & (1 << bit);
-
- cursor->ph_cursor->images[i] |= (databit == 0) ? maskbit : 0;
- /* If the databit != 0, treat it as a black pixel and
- * ignore the maskbit (can't do an inverted color) */
- cursor->ph_cursor->images[i+clen] |= databit;
- }
- }
-
- /* #bytes following the hdr struct */
- cursor->ph_cursor->hdr.len =sizeof(PhCursorDef_t) + clen*2 - sizeof(PhRegionDataHdr_t);
-
- return (cursor);
-}
-
-PhCursorDef_t ph_GetWMPhCursor(WMcursor *cursor)
-{
- return (*cursor->ph_cursor);
-}
-
-int ph_ShowWMCursor(_THIS, WMcursor* cursor)
-{
- PtArg_t args[3];
- int nargs = 0;
-
- /* Don't do anything if the display is gone */
- if (window == NULL)
- {
- return (0);
- }
-
- /* looks like photon can't draw mouse cursor in direct mode */
- if ((this->screen->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN)
- {
- /* disable the fake mouse in the fullscreen OpenGL mode */
- if ((this->screen->flags & SDL_OPENGL) == SDL_OPENGL)
- {
- cursor=NULL;
- }
- else
- {
- return (0);
- }
- }
-
- /* Set the photon cursor, or blank if cursor is NULL */
- if (cursor!=NULL)
- {
- PtSetArg(&args[0], Pt_ARG_CURSOR_TYPE, Ph_CURSOR_BITMAP, 0);
- /* Could set next to any PgColor_t value */
- PtSetArg(&args[1], Pt_ARG_CURSOR_COLOR, Ph_CURSOR_DEFAULT_COLOR , 0);
- PtSetArg(&args[2], Pt_ARG_BITMAP_CURSOR, cursor->ph_cursor, (cursor->ph_cursor->hdr.len + sizeof(PhRegionDataHdr_t)));
- nargs = 3;
- }
- else /* Ph_CURSOR_NONE */
- {
- PtSetArg(&args[0], Pt_ARG_CURSOR_TYPE, Ph_CURSOR_NONE, 0);
- nargs = 1;
- }
-
- SDL_Lock_EventThread();
-
- if (PtSetResources(window, nargs, args) < 0 )
- {
- return (0);
- }
-
- SDL_Unlock_EventThread();
-
- return (1);
-}
-
-
-void ph_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
-{
- short abs_x, abs_y;
-
- SDL_Lock_EventThread();
- PtGetAbsPosition( window, &abs_x, &abs_y );
- PhMoveCursorAbs( PhInputGroup(NULL), x + abs_x, y + abs_y );
- SDL_Unlock_EventThread();
-}
-
-
-void ph_CheckMouseMode(_THIS)
-{
- /* If the mouse is hidden and input is grabbed, we use relative mode */
- if ( !(SDL_cursorstate & CURSOR_VISIBLE) && (this->input_grab != SDL_GRAB_OFF))
- {
- mouse_relative = 1;
- }
- else
- {
- mouse_relative = 0;
- }
-}
-
-
-void ph_UpdateMouse(_THIS)
-{
- PhCursorInfo_t phcursor;
- short abs_x;
- short abs_y;
-
- /* Lock the event thread, in multi-threading environments */
- SDL_Lock_EventThread();
-
- /* synchronizing photon mouse cursor position and SDL mouse position, if cursor appears over window. */
- PtGetAbsPosition(window, &abs_x, &abs_y);
- PhQueryCursor(PhInputGroup(NULL), &phcursor);
- if (((phcursor.pos.x >= abs_x) && (phcursor.pos.x <= abs_x + this->screen->w)) &&
- ((phcursor.pos.y >= abs_y) && (phcursor.pos.y <= abs_y + this->screen->h)))
- {
- SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
- SDL_PrivateMouseMotion(0, 0, phcursor.pos.x-abs_x, phcursor.pos.y-abs_y);
- }
- else
- {
- SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
- }
-
- /* Unlock the event thread, in multi-threading environments */
- SDL_Unlock_EventThread();
-}
diff --git a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_mouse_c.h b/distrib/sdl-1.2.12/src/video/photon/SDL_ph_mouse_c.h
deleted file mode 100644
index e54ff1d..0000000
--- a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_mouse_c.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef __SDL_PH_MOUSE_H__
-#define __SDL_PH_MOUSE_H__
-
-#include "SDL_ph_video.h"
-
-/* Functions to be exported */
-extern void ph_FreeWMCursor(_THIS, WMcursor *cursor);
-extern WMcursor *ph_CreateWMCursor(_THIS,
- Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
-extern PhCursorDef_t ph_GetWMPhCursor(WMcursor *cursor);
-extern int ph_ShowWMCursor(_THIS, WMcursor *cursor);
-extern void ph_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
-extern void ph_CheckMouseMode(_THIS);
-extern void ph_UpdateMouse(_THIS);
-
-#endif /* __SDL_PH_MOUSE_H__ */
diff --git a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_video.c b/distrib/sdl-1.2.12/src/video/photon/SDL_ph_video.c
deleted file mode 100644
index ad6266e..0000000
--- a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_video.c
+++ /dev/null
@@ -1,648 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <unistd.h>
-#include <sys/ioctl.h>
-
-#include "SDL_endian.h"
-#include "SDL_timer.h"
-#include "SDL_thread.h"
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_ph_video.h"
-#include "SDL_ph_modes_c.h"
-#include "SDL_ph_image_c.h"
-#include "SDL_ph_events_c.h"
-#include "SDL_ph_mouse_c.h"
-#include "SDL_ph_wm_c.h"
-#include "SDL_ph_gl.h"
-#include "SDL_phyuv_c.h"
-#include "../blank_cursor.h"
-
-static int ph_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Surface *ph_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int ph_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
-static void ph_VideoQuit(_THIS);
-static void ph_DeleteDevice(SDL_VideoDevice *device);
-
-static int phstatus=-1;
-
-static int ph_Available(void)
-{
- if (phstatus!=0)
- {
- phstatus=PtInit(NULL);
- if (phstatus==0)
- {
- return 1;
- }
- else
- {
- return 0;
- }
- }
- return 1;
-}
-
-static SDL_VideoDevice* ph_CreateDevice(int devindex)
-{
- SDL_VideoDevice* device;
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if (device)
- {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData*)SDL_malloc((sizeof *device->hidden));
- device->gl_data = NULL;
- }
- if ((device == NULL) || (device->hidden == NULL))
- {
- SDL_OutOfMemory();
- ph_DeleteDevice(device);
- return NULL;
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
-
- /* Set the driver flags */
- device->handles_any_size = 1;
-
- /* Set the function pointers */
- device->CreateYUVOverlay = ph_CreateYUVOverlay;
- device->VideoInit = ph_VideoInit;
- device->ListModes = ph_ListModes;
- device->SetVideoMode = ph_SetVideoMode;
- device->ToggleFullScreen = ph_ToggleFullScreen;
- device->UpdateMouse = ph_UpdateMouse;
- device->SetColors = ph_SetColors;
- device->UpdateRects = NULL; /* set up in ph_SetupUpdateFunction */
- device->VideoQuit = ph_VideoQuit;
- device->AllocHWSurface = ph_AllocHWSurface;
- device->CheckHWBlit = ph_CheckHWBlit;
- device->FillHWRect = ph_FillHWRect;
- device->SetHWColorKey = ph_SetHWColorKey;
- device->SetHWAlpha = ph_SetHWAlpha;
- device->LockHWSurface = ph_LockHWSurface;
- device->UnlockHWSurface = ph_UnlockHWSurface;
- device->FlipHWSurface = ph_FlipHWSurface;
- device->FreeHWSurface = ph_FreeHWSurface;
- device->SetCaption = ph_SetCaption;
- device->SetIcon = NULL;
- device->IconifyWindow = ph_IconifyWindow;
- device->GrabInput = ph_GrabInput;
- device->GetWMInfo = ph_GetWMInfo;
- device->FreeWMCursor = ph_FreeWMCursor;
- device->CreateWMCursor = ph_CreateWMCursor;
- device->ShowWMCursor = ph_ShowWMCursor;
- device->WarpWMCursor = ph_WarpWMCursor;
- device->MoveWMCursor = NULL;
- device->CheckMouseMode = ph_CheckMouseMode;
- device->InitOSKeymap = ph_InitOSKeymap;
- device->PumpEvents = ph_PumpEvents;
-
- /* OpenGL support. */
-#if SDL_VIDEO_OPENGL
- device->GL_MakeCurrent = ph_GL_MakeCurrent;
- device->GL_SwapBuffers = ph_GL_SwapBuffers;
- device->GL_GetAttribute = ph_GL_GetAttribute;
- device->GL_LoadLibrary = ph_GL_LoadLibrary;
- device->GL_GetProcAddress = ph_GL_GetProcAddress;
-#endif /* SDL_VIDEO_OPENGL */
-
- device->free = ph_DeleteDevice;
-
- return device;
-}
-
-VideoBootStrap ph_bootstrap = {
- "photon", "QNX Photon video output",
- ph_Available, ph_CreateDevice
-};
-
-static void ph_DeleteDevice(SDL_VideoDevice *device)
-{
- if (device)
- {
- if (device->hidden)
- {
- SDL_free(device->hidden);
- device->hidden = NULL;
- }
- if (device->gl_data)
- {
- SDL_free(device->gl_data);
- device->gl_data = NULL;
- }
- SDL_free(device);
- device = NULL;
- }
-}
-
-static PtWidget_t *ph_CreateWindow(_THIS)
-{
- PtWidget_t *widget;
-
- widget = PtCreateWidget(PtWindow, NULL, 0, NULL);
-
- return widget;
-}
-
-static int ph_SetupWindow(_THIS, int w, int h, int flags)
-{
- PtArg_t args[32];
- PhPoint_t pos = {0, 0};
- PhDim_t* olddim;
- PhDim_t dim = {w, h};
- PhRect_t desktopextent;
- int nargs = 0;
- const char* windowpos;
- const char* iscentered;
- int x, y;
-
- /* check if window size has been changed by Window Manager */
- PtGetResource(window, Pt_ARG_DIM, &olddim, 0);
- if ((olddim->w!=w) || (olddim->h!=h))
- {
- PtSetArg(&args[nargs++], Pt_ARG_DIM, &dim, 0);
- }
-
- if ((flags & SDL_RESIZABLE) == SDL_RESIZABLE)
- {
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_FALSE, Ph_WM_CLOSE);
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_TRUE, Ph_WM_MAX | Ph_WM_RESTORE | Ph_WM_RESIZE);
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_NOTIFY_FLAGS, Pt_TRUE, Ph_WM_RESIZE | Ph_WM_MOVE | Ph_WM_CLOSE | Ph_WM_MAX | Ph_WM_RESTORE);
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_RENDER_FLAGS, Pt_TRUE, Ph_WM_RENDER_RESIZE | Ph_WM_RENDER_MAX | Ph_WM_RENDER_COLLAPSE | Ph_WM_RENDER_RETURN);
- PtSetArg(&args[nargs++], Pt_ARG_RESIZE_FLAGS, Pt_TRUE, Pt_RESIZE_XY_AS_REQUIRED);
- }
- else
- {
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_FALSE, Ph_WM_RESIZE | Ph_WM_MAX | Ph_WM_RESTORE | Ph_WM_CLOSE);
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_NOTIFY_FLAGS, Pt_FALSE, Ph_WM_RESIZE | Ph_WM_MAX | Ph_WM_RESTORE);
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_NOTIFY_FLAGS, Pt_TRUE, Ph_WM_MOVE | Ph_WM_CLOSE);
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_RENDER_FLAGS, Pt_FALSE, Ph_WM_RENDER_RESIZE | Ph_WM_RENDER_MAX | Ph_WM_RENDER_COLLAPSE | Ph_WM_RENDER_RETURN);
- PtSetArg(&args[nargs++], Pt_ARG_RESIZE_FLAGS, Pt_FALSE, Pt_RESIZE_XY_AS_REQUIRED);
- }
-
- if (((flags & SDL_NOFRAME)==SDL_NOFRAME) || ((flags & SDL_FULLSCREEN)==SDL_FULLSCREEN))
- {
- if ((flags & SDL_RESIZABLE) != SDL_RESIZABLE)
- {
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_RENDER_FLAGS, Pt_FALSE, Pt_TRUE);
- }
- else
- {
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_RENDER_FLAGS, Pt_FALSE, Pt_TRUE);
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_RENDER_FLAGS, Pt_TRUE, Ph_WM_RENDER_RESIZE | Ph_WM_RENDER_BORDER);
- }
- }
- else
- {
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_RENDER_FLAGS, Pt_TRUE, Ph_WM_RENDER_BORDER | Ph_WM_RENDER_TITLE |
- Ph_WM_RENDER_CLOSE | Ph_WM_RENDER_MENU | Ph_WM_RENDER_MIN);
- }
-
- if ((flags & SDL_FULLSCREEN) == SDL_FULLSCREEN)
- {
- PtSetArg(&args[nargs++], Pt_ARG_POS, &pos, 0);
- PtSetArg(&args[nargs++], Pt_ARG_BASIC_FLAGS, Pt_TRUE, Pt_BASIC_PREVENT_FILL);
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_TRUE, Ph_WM_FFRONT | Ph_WM_MAX | Ph_WM_TOFRONT | Ph_WM_CONSWITCH);
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_STATE, Pt_TRUE, Ph_WM_STATE_ISFRONT | Ph_WM_STATE_ISFOCUS | Ph_WM_STATE_ISALTKEY);
- }
- else
- {
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_FALSE, Ph_WM_FFRONT | Ph_WM_CONSWITCH);
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_STATE, Pt_FALSE, Ph_WM_STATE_ISFRONT);
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_STATE, Pt_TRUE, Ph_WM_STATE_ISALTKEY);
-
- if ((flags & SDL_HWSURFACE) == SDL_HWSURFACE)
- {
- PtSetArg(&args[nargs++], Pt_ARG_BASIC_FLAGS, Pt_TRUE, Pt_BASIC_PREVENT_FILL);
- }
- else
- {
- PtSetArg(&args[nargs++], Pt_ARG_FILL_COLOR, Pg_BLACK, 0);
- }
- if (!currently_maximized)
- {
- windowpos = SDL_getenv("SDL_VIDEO_WINDOW_POS");
- iscentered = SDL_getenv("SDL_VIDEO_CENTERED");
-
- if ((iscentered) || ((windowpos) && (SDL_strcmp(windowpos, "center")==0)))
- {
- PhWindowQueryVisible(Ph_QUERY_CONSOLE, 0, 0, &desktopextent);
- if (desktop_mode.width>w)
- {
- pos.x = (desktop_mode.width - w)/2;
- }
- if (desktop_mode.height>h)
- {
- pos.y = (desktop_mode.height - h)/2;
- }
-
- pos.x+=desktopextent.ul.x;
- pos.y+=desktopextent.ul.y;
- PtSetArg(&args[nargs++], Pt_ARG_POS, &pos, 0);
- }
- else
- {
- if (windowpos)
- {
- if (SDL_sscanf(windowpos, "%d,%d", &x, &y) == 2)
- {
- if ((x<desktop_mode.width) && (y<desktop_mode.height))
- {
- PhWindowQueryVisible(Ph_QUERY_CONSOLE, 0, 0, &desktopextent);
- pos.x=x+desktopextent.ul.x;
- pos.y=y+desktopextent.ul.y;
- }
- PtSetArg(&args[nargs++], Pt_ARG_POS, &pos, 0);
- }
- }
- }
- }
-
- /* if window is maximized render it as maximized */
- if (currently_maximized)
- {
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_STATE, Pt_TRUE, Ph_WM_STATE_ISMAX);
- }
- else
- {
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_STATE, Pt_FALSE, Ph_WM_STATE_ISMAX);
- }
-
- /* do not grab the keyboard by default */
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_STATE, Pt_FALSE, Ph_WM_STATE_ISALTKEY);
-
- /* bring the focus to the window */
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_STATE, Pt_TRUE, Ph_WM_STATE_ISFOCUS);
-
- /* allow to catch hide event */
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_TRUE, Ph_WM_HIDE);
- PtSetArg(&args[nargs++], Pt_ARG_WINDOW_NOTIFY_FLAGS, Pt_TRUE, Ph_WM_HIDE);
- }
-
- PtSetResources(window, nargs, args);
- PtRealizeWidget(window);
- PtWindowToFront(window);
-
-#if 0 /* FIXME */
- PtGetResource(window, Pt_ARG_POS, &olddim, 0);
- fprintf(stderr, "POSITION: %d, %d\n", olddim->w, olddim->h);
-#endif
-
- return 0;
-}
-
-static const struct ColourMasks* ph_GetColourMasks(int bpp)
-{
- /* The alpha mask doesn't appears to be needed */
- static const struct ColourMasks phColorMasks[5] = {
- /* 8 bit */ {0, 0, 0, 0, 8},
- /* 15 bit ARGB */ {0x7C00, 0x03E0, 0x001F, 0x8000, 15},
- /* 16 bit RGB */ {0xF800, 0x07E0, 0x001F, 0x0000, 16},
- /* 24 bit RGB */ {0xFF0000, 0x00FF00, 0x0000FF, 0x000000, 24},
- /* 32 bit ARGB */ {0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000, 32},
- };
-
- switch (bpp)
- {
- case 8:
- return &phColorMasks[0];
- case 15:
- return &phColorMasks[1];
- case 16:
- return &phColorMasks[2];
- case 24:
- return &phColorMasks[3];
- case 32:
- return &phColorMasks[4];
- }
- return NULL;
-}
-
-static int ph_VideoInit(_THIS, SDL_PixelFormat* vformat)
-{
- PgHWCaps_t hwcaps;
- int i;
-
- window=NULL;
- desktoppal=SDLPH_PAL_NONE;
-
-#if SDL_VIDEO_OPENGL
- oglctx=NULL;
- oglbuffers=NULL;
- oglflags=0;
- oglbpp=0;
-#endif
-
- old_video_mode=-1;
- old_refresh_rate=-1;
-
- if (NULL == (phevent = SDL_malloc(EVENT_SIZE)))
- {
- SDL_OutOfMemory();
- return -1;
- }
- SDL_memset(phevent, 0x00, EVENT_SIZE);
-
- window = ph_CreateWindow(this);
- if (window == NULL)
- {
- SDL_SetError("ph_VideoInit(): Couldn't create video window !\n");
- return -1;
- }
-
- /* Create the blank cursor */
- SDL_BlankCursor = this->CreateWMCursor(this, blank_cdata, blank_cmask,
- (int)BLANK_CWIDTH, (int)BLANK_CHEIGHT,
- (int)BLANK_CHOTX, (int)BLANK_CHOTY);
-
- if (SDL_BlankCursor == NULL)
- {
- return -1;
- }
-
- if (PgGetGraphicsHWCaps(&hwcaps) < 0)
- {
- SDL_SetError("ph_VideoInit(): GetGraphicsHWCaps function failed !\n");
- this->FreeWMCursor(this, SDL_BlankCursor);
- return -1;
- }
-
- if (PgGetVideoModeInfo(hwcaps.current_video_mode, &desktop_mode) < 0)
- {
- SDL_SetError("ph_VideoInit(): PgGetVideoModeInfo function failed !\n");
- this->FreeWMCursor(this, SDL_BlankCursor);
- return -1;
- }
-
- /* Determine the current screen size */
- this->info.current_w = desktop_mode.width;
- this->info.current_h = desktop_mode.height;
-
- /* We need to return BytesPerPixel as it in used by CreateRGBsurface */
- vformat->BitsPerPixel = desktop_mode.bits_per_pixel;
- vformat->BytesPerPixel = desktop_mode.bytes_per_scanline/desktop_mode.width;
- desktopbpp = desktop_mode.bits_per_pixel;
-
- /* save current palette */
- if (desktopbpp==8)
- {
- PgGetPalette(savedpal);
- PgGetPalette(syspalph);
- }
- else
- {
- for(i=0; i<_Pg_MAX_PALETTE; i++)
- {
- savedpal[i]=PgRGB(0, 0, 0);
- syspalph[i]=PgRGB(0, 0, 0);
- }
- }
-
- currently_fullscreen = 0;
- currently_hided = 0;
- currently_maximized = 0;
- current_overlay = NULL;
-
- OCImage.direct_context = NULL;
- OCImage.offscreen_context = NULL;
- OCImage.offscreen_backcontext = NULL;
- OCImage.oldDC = NULL;
- OCImage.CurrentFrameData = NULL;
- OCImage.FrameData0 = NULL;
- OCImage.FrameData1 = NULL;
- videomode_emulatemode = 0;
-
- this->info.wm_available = 1;
-
- ph_UpdateHWInfo(this);
-
- return 0;
-}
-
-static SDL_Surface* ph_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags)
-{
- const struct ColourMasks* mask;
-
- /* Lock the event thread, in multi-threading environments */
- SDL_Lock_EventThread();
-
- current->flags = flags;
-
- /* if we do not have desired fullscreen mode, then fallback into window mode */
- if (((current->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) && (ph_GetVideoMode(width, height, bpp)==0))
- {
- current->flags &= ~SDL_FULLSCREEN;
- current->flags &= ~SDL_NOFRAME;
- current->flags &= ~SDL_RESIZABLE;
- }
-
- ph_SetupWindow(this, width, height, current->flags);
-
- mask = ph_GetColourMasks(bpp);
- if (mask != NULL)
- {
- SDL_ReallocFormat(current, mask->bpp, mask->red, mask->green, mask->blue, 0);
- }
- else
- {
- SDL_SetError("ph_SetVideoMode(): desired bpp is not supported by photon !\n");
- return NULL;
- }
-
- if ((current->flags & SDL_OPENGL)==SDL_OPENGL)
- {
-#if !SDL_VIDEO_OPENGL
- /* if no built-in OpenGL support */
- SDL_SetError("ph_SetVideoMode(): no OpenGL support, you need to recompile SDL.\n");
- current->flags &= ~SDL_OPENGL;
- return NULL;
-#endif /* SDL_VIDEO_OPENGL */
- }
- else
- {
- /* Initialize internal variables */
- if ((current->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN)
- {
- if (bpp==8)
- {
- desktoppal=SDLPH_PAL_SYSTEM;
- }
-
- current->flags &= ~SDL_RESIZABLE; /* no resize for Direct Context */
- current->flags |= SDL_HWSURFACE;
- }
- else
- {
- /* remove this if we'll have support for the non-fullscreen sw/hw+doublebuf one day */
- current->flags &= ~SDL_DOUBLEBUF;
-
- /* Use offscreen memory if SDL_HWSURFACE flag is set */
- if ((current->flags & SDL_HWSURFACE) == SDL_HWSURFACE)
- {
- if (desktopbpp!=bpp)
- {
- current->flags &= ~SDL_HWSURFACE;
- }
- }
-
- /* using palette emulation code in window mode */
- if (bpp==8)
- {
- if (desktopbpp>=15)
- {
- desktoppal = SDLPH_PAL_EMULATE;
- }
- else
- {
- desktoppal = SDLPH_PAL_SYSTEM;
- }
- }
- else
- {
- desktoppal = SDLPH_PAL_NONE;
- }
- }
- }
-
- current->w = width;
- current->h = height;
-
- if (desktoppal==SDLPH_PAL_SYSTEM)
- {
- current->flags|=SDL_HWPALETTE;
- }
-
- /* Must call at least once for setup image planes */
- if (ph_SetupUpdateFunction(this, current, current->flags)==-1)
- {
- /* Error string was filled in the ph_SetupUpdateFunction() */
- return NULL;
- }
-
- /* finish window drawing, if we are not in fullscreen, of course */
- if ((current->flags & SDL_FULLSCREEN) != SDL_FULLSCREEN)
- {
- PtFlush();
- }
- else
- {
- PgFlush();
- }
-
- visualbpp=bpp;
-
- ph_UpdateHWInfo(this);
-
- SDL_Unlock_EventThread();
-
- /* We've done! */
- return (current);
-}
-
-static void ph_VideoQuit(_THIS)
-{
- /* restore palette */
- if (desktopbpp==8)
- {
- PgSetPalette(syspalph, 0, -1, 0, 0, 0);
- PgSetPalette(savedpal, 0, 0, _Pg_MAX_PALETTE, Pg_PALSET_GLOBAL | Pg_PALSET_FORCE_EXPOSE, 0);
- PgFlush();
- }
-
- ph_DestroyImage(this, SDL_VideoSurface);
-
- if (window)
- {
- PtUnrealizeWidget(window);
- PtDestroyWidget(window);
- window=NULL;
- }
-
- if (phevent!=NULL)
- {
- SDL_free(phevent);
- phevent=NULL;
- }
-}
-
-static int ph_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- int i;
- SDL_Rect updaterect;
-
- updaterect.x = updaterect.y = 0;
- updaterect.w = this->screen->w;
- updaterect.h = this->screen->h;
-
- /* palette emulation code, using palette of the PhImage_t struct */
- if (desktoppal==SDLPH_PAL_EMULATE)
- {
- if ((SDL_Image) && (SDL_Image->palette))
- {
- for (i=firstcolor; i<firstcolor+ncolors; i++)
- {
- syspalph[i] = PgRGB(colors[i-firstcolor].r, colors[i-firstcolor].g, colors[i-firstcolor].b);
- SDL_Image->palette[i] = syspalph[i];
- }
-
- /* image needs to be redrawn */
- this->UpdateRects(this, 1, &updaterect);
- }
- }
- else
- {
- if (desktoppal==SDLPH_PAL_SYSTEM)
- {
- for (i=firstcolor; i<firstcolor+ncolors; i++)
- {
- syspalph[i] = PgRGB(colors[i-firstcolor].r, colors[i-firstcolor].g, colors[i-firstcolor].b);
- }
-
- if ((this->screen->flags & SDL_FULLSCREEN) != SDL_FULLSCREEN)
- {
- /* window mode must use soft palette */
- PgSetPalette(&syspalph[firstcolor], 0, firstcolor, ncolors, Pg_PALSET_GLOBAL, 0);
- /* image needs to be redrawn */
- this->UpdateRects(this, 1, &updaterect);
- }
- else
- {
- /* fullscreen mode must use hardware palette */
- PgSetPalette(&syspalph[firstcolor], 0, firstcolor, ncolors, Pg_PALSET_GLOBAL, 0);
- }
- }
- else
- {
- /* SDLPH_PAL_NONE do nothing */
- }
- }
-
- return 1;
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_video.h b/distrib/sdl-1.2.12/src/video/photon/SDL_ph_video.h
deleted file mode 100644
index 0eac5b1..0000000
--- a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_video.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef __SDL_PH_VIDEO_H__
-#define __SDL_PH_VIDEO_H__
-
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-
-#include <sys/neutrino.h>
-
-#include <Ph.h>
-#include <Pt.h>
-#include <photon/Pg.h>
-#include <photon/PdDirect.h>
-
-#if SDL_VIDEO_OPENGL
- #if (_NTO_VERSION < 630)
- #include <photon/PdGL.h>
- #else
- #include <GL/qnxgl.h>
- #include <GL/GLPh.h>
- #endif /* 6.3.0 */
-#endif /* SDL_VIDEO_OPENGL */
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice* this
-
-#define PH_OGL_MAX_ATTRIBS 32
-
-#define SDLPH_PAL_NONE 0x00000000L
-#define SDLPH_PAL_EMULATE 0x00000001L
-#define SDLPH_PAL_SYSTEM 0x00000002L
-
-typedef struct
-{
- unsigned char* Y;
- unsigned char* V;
- unsigned char* U;
-} FRAMEDATA;
-
-/* Mask values for SDL_ReallocFormat() */
-struct ColourMasks
-{
- Uint32 red;
- Uint32 green;
- Uint32 blue;
- Uint32 alpha;
- Uint32 bpp;
-};
-
-/* Private display data */
-struct SDL_PrivateVideoData
-{
- PgDisplaySettings_t mode_settings;
- PtWidget_t *Window; /* used to handle input events */
- PhImage_t *image; /* used to display image */
-#if SDL_VIDEO_OPENGL
- #if (_NTO_VERSION < 630)
- PdOpenGLContext_t* OGLContext; /* OpenGL context */
- void* OGLBuffers; /* OpenGL buffers (unused) */
- #else
- qnxglc_t* OGLContext; /* OpenGL context for the 6.3 */
- qnxgl_bufs_t* OGLBuffers; /* OpenGL buffers for the 6.3 */
- #endif /* 630 */
-
- Uint32 OGLFlags; /* OpenGL flags */
- Uint32 OGLBPP; /* OpenGL bpp */
-#endif /* SDL_VIDEO_OPENGL */
- PgColor_t savedpal[_Pg_MAX_PALETTE];
- PgColor_t syspalph[_Pg_MAX_PALETTE];
-
- struct
- {
- PdDirectContext_t* direct_context;
- PdOffscreenContext_t* offscreen_context;
- PdOffscreenContext_t* offscreen_backcontext;
- PhDrawContext_t* oldDC;
- uint8_t* dc_ptr;
- unsigned char* CurrentFrameData;
- unsigned char* FrameData0;
- unsigned char* FrameData1;
- Uint32 current;
- Uint32 flags;
- } ocimage;
-
- PgHWCaps_t graphics_card_caps; /* Graphics card caps at the moment of start */
- PgVideoModeInfo_t desktop_mode; /* Current desktop video mode information */
- int old_video_mode; /* Stored mode before fullscreen switch */
- int old_refresh_rate; /* Stored refresh rate befor fullscreen switch */
-
- int mouse_relative;
- WMcursor* BlankCursor;
- uint32_t videomode_emulatemode;
-
- Uint32 visualbpp; /* current visual bpp */
- Uint32 desktopbpp; /* bpp of desktop at the moment of start */
- Uint32 desktoppal; /* palette mode emulation or system */
-
- int currently_fullscreen;
- int currently_hided; /* 1 - window hided (minimazed), 0 - normal */
- int currently_maximized; /* 1 - window hided (minimazed), 0 - normal */
-
- PhEvent_t* event;
- SDL_Overlay* overlay;
-};
-
-#define mode_settings (this->hidden->mode_settings)
-#define window (this->hidden->Window)
-#define SDL_Image (this->hidden->image)
-#define OCImage (this->hidden->ocimage)
-#define old_video_mode (this->hidden->old_video_mode)
-#define old_refresh_rate (this->hidden->old_refresh_rate)
-#define graphics_card_caps (this->hidden->graphics_card_caps)
-#define desktopbpp (this->hidden->desktopbpp)
-#define visualbpp (this->hidden->visualbpp)
-#define desktoppal (this->hidden->desktoppal)
-#define savedpal (this->hidden->savedpal)
-#define syspalph (this->hidden->syspalph)
-#define currently_fullscreen (this->hidden->currently_fullscreen)
-#define currently_hided (this->hidden->currently_hided)
-#define currently_maximized (this->hidden->currently_maximized)
-#define phevent (this->hidden->event)
-#define current_overlay (this->hidden->overlay)
-#define desktop_mode (this->hidden->desktop_mode)
-#define mouse_relative (this->hidden->mouse_relative)
-#define SDL_BlankCursor (this->hidden->BlankCursor)
-#define videomode_emulatemode (this->hidden->videomode_emulatemode)
-
-#if SDL_VIDEO_OPENGL
- #define oglctx (this->hidden->OGLContext)
- #define oglbuffers (this->hidden->OGLBuffers)
- #define oglflags (this->hidden->OGLFlags)
- #define oglbpp (this->hidden->OGLBPP)
-#endif /* SDL_VIDEO_OPENGL */
-
-#endif /* __SDL_PH_VIDEO_H__ */
diff --git a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_wm.c b/distrib/sdl-1.2.12/src/video/photon/SDL_ph_wm.c
deleted file mode 100644
index 68dc780..0000000
--- a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_wm.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <Ph.h>
-#include <photon/PpProto.h>
-#include <photon/PhWm.h>
-#include <photon/wmapi.h>
-
-#include "SDL_version.h"
-#include "SDL_timer.h"
-#include "SDL_video.h"
-#include "SDL_syswm.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_ph_modes_c.h"
-#include "SDL_ph_wm_c.h"
-
-void ph_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask)
-{
- return;
-}
-
-/* Set window caption */
-void ph_SetCaption(_THIS, const char *title, const char *icon)
-{
- SDL_Lock_EventThread();
-
- /* sanity check for set caption call before window init */
- if (window!=NULL)
- {
- PtSetResource(window, Pt_ARG_WINDOW_TITLE, title, 0);
- }
-
- SDL_Unlock_EventThread();
-}
-
-/* Iconify current window */
-int ph_IconifyWindow(_THIS)
-{
- PhWindowEvent_t windowevent;
-
- SDL_Lock_EventThread();
-
- SDL_memset(&windowevent, 0, sizeof(windowevent));
- windowevent.event_f = Ph_WM_HIDE;
- windowevent.event_state = Ph_WM_EVSTATE_HIDE;
- windowevent.rid = PtWidgetRid(window);
- PtForwardWindowEvent(&windowevent);
-
- SDL_Unlock_EventThread();
-
- return 0;
-}
-
-SDL_GrabMode ph_GrabInputNoLock(_THIS, SDL_GrabMode mode)
-{
- short abs_x, abs_y;
-
- if( mode == SDL_GRAB_OFF )
- {
- PtSetResource(window, Pt_ARG_WINDOW_STATE, Pt_FALSE, Ph_WM_STATE_ISALTKEY);
- }
- else
- {
- PtSetResource(window, Pt_ARG_WINDOW_STATE, Pt_TRUE, Ph_WM_STATE_ISALTKEY);
-
- PtGetAbsPosition(window, &abs_x, &abs_y);
- PhMoveCursorAbs(PhInputGroup(NULL), abs_x + SDL_VideoSurface->w/2, abs_y + SDL_VideoSurface->h/2);
- }
-
- SDL_Unlock_EventThread();
-
- return(mode);
-}
-
-SDL_GrabMode ph_GrabInput(_THIS, SDL_GrabMode mode)
-{
- SDL_Lock_EventThread();
- mode = ph_GrabInputNoLock(this, mode);
- SDL_Unlock_EventThread();
-
- return(mode);
-}
-
-
-int ph_GetWMInfo(_THIS, SDL_SysWMinfo *info)
-{
- if (info->version.major <= SDL_MAJOR_VERSION)
- {
- return 1;
- }
- else
- {
- SDL_SetError("Application not compiled with SDL %d.%d\n",
- SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
- return -1;
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_wm_c.h b/distrib/sdl-1.2.12/src/video/photon/SDL_ph_wm_c.h
deleted file mode 100644
index 2122d23..0000000
--- a/distrib/sdl-1.2.12/src/video/photon/SDL_ph_wm_c.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef __SDL_PH_WM_H__
-#define __SDL_PH_WM_H__
-
-#include "SDL_ph_video.h"
-
-/* Functions to be exported */
-extern void ph_SetCaption(_THIS, const char *title, const char *icon);
-extern void ph_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask);
-extern int ph_IconifyWindow(_THIS);
-extern SDL_GrabMode ph_GrabInputNoLock(_THIS, SDL_GrabMode mode);
-extern SDL_GrabMode ph_GrabInput(_THIS, SDL_GrabMode mode);
-extern int ph_GetWMInfo(_THIS, SDL_SysWMinfo *info);
-
-#endif /* __SDL_PH_WM_H__ */
diff --git a/distrib/sdl-1.2.12/src/video/photon/SDL_phyuv.c b/distrib/sdl-1.2.12/src/video/photon/SDL_phyuv.c
deleted file mode 100644
index 62ec041..0000000
--- a/distrib/sdl-1.2.12/src/video/photon/SDL_phyuv.c
+++ /dev/null
@@ -1,504 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This is the QNX Realtime Platform version of SDL YUV video overlays */
-
-#include <errno.h>
-
-#include <Ph.h>
-#include <Pt.h>
-
-#include "SDL_video.h"
-#include "SDL_phyuv_c.h"
-#include "../SDL_yuvfuncs.h"
-
-#define OVERLAY_STATE_UNINIT 0
-#define OVERLAY_STATE_ACTIVE 1
-
-/* The functions are used to manipulate software video overlays */
-static struct private_yuvhwfuncs ph_yuvfuncs =
-{
- ph_LockYUVOverlay,
- ph_UnlockYUVOverlay,
- ph_DisplayYUVOverlay,
- ph_FreeYUVOverlay
-};
-
-int grab_ptrs2(PgVideoChannel_t* channel, FRAMEDATA* Frame0, FRAMEDATA* Frame1)
-{
- int planes = 0;
-
- /* Buffers have moved; re-obtain the pointers */
- Frame0->Y = (unsigned char *)PdGetOffscreenContextPtr(channel->yplane1);
- Frame1->Y = (unsigned char *)PdGetOffscreenContextPtr(channel->yplane2);
- Frame0->U = (unsigned char *)PdGetOffscreenContextPtr(channel->vplane1);
- Frame1->U = (unsigned char *)PdGetOffscreenContextPtr(channel->vplane2);
- Frame0->V = (unsigned char *)PdGetOffscreenContextPtr(channel->uplane1);
- Frame1->V = (unsigned char *)PdGetOffscreenContextPtr(channel->uplane2);
-
- if (Frame0->Y)
- planes++;
-
- if (Frame0->U)
- planes++;
-
- if (Frame0->V)
- planes++;
-
- return planes;
-}
-
-SDL_Overlay* ph_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface* display)
-{
- SDL_Overlay* overlay;
- struct private_yuvhwdata* hwdata;
- int vidport;
- int rtncode;
- int planes;
- int i=0;
- PhPoint_t pos;
-
- /* Create the overlay structure */
- overlay = SDL_calloc(1, sizeof(SDL_Overlay));
-
- if (overlay == NULL)
- {
- SDL_OutOfMemory();
- return NULL;
- }
-
- /* Fill in the basic members */
- overlay->format = format;
- overlay->w = width;
- overlay->h = height;
- overlay->hwdata = NULL;
-
- /* Set up the YUV surface function structure */
- overlay->hwfuncs = &ph_yuvfuncs;
-
- /* Create the pixel data and lookup tables */
- hwdata = SDL_calloc(1, sizeof(struct private_yuvhwdata));
-
- if (hwdata == NULL)
- {
- SDL_OutOfMemory();
- SDL_FreeYUVOverlay(overlay);
- return NULL;
- }
-
- overlay->hwdata = hwdata;
-
- PhDCSetCurrent(0);
- if (overlay->hwdata->channel == NULL)
- {
- if ((overlay->hwdata->channel = PgCreateVideoChannel(Pg_VIDEO_CHANNEL_SCALER, 0)) == NULL)
- {
- SDL_SetError("ph_CreateYUVOverlay(): Create channel failed: %s\n", strerror(errno));
- SDL_FreeYUVOverlay(overlay);
- return NULL;
-
- }
- }
-
- overlay->hwdata->forcedredraw=0;
-
- PtGetAbsPosition(window, &pos.x, &pos.y);
- overlay->hwdata->CurrentWindowPos.x = pos.x;
- overlay->hwdata->CurrentWindowPos.y = pos.y;
- overlay->hwdata->CurrentViewPort.pos.x = 0;
- overlay->hwdata->CurrentViewPort.pos.y = 0;
- overlay->hwdata->CurrentViewPort.size.w = width;
- overlay->hwdata->CurrentViewPort.size.h = height;
- overlay->hwdata->State = OVERLAY_STATE_UNINIT;
- overlay->hwdata->FrameData0 = (FRAMEDATA *) SDL_calloc(1, sizeof(FRAMEDATA));
- overlay->hwdata->FrameData1 = (FRAMEDATA *) SDL_calloc(1, sizeof(FRAMEDATA));
-
- vidport = -1;
- i=0;
-
- overlay->hwdata->ischromakey=0;
-
- do {
- SDL_memset(&overlay->hwdata->caps, 0x00, sizeof(PgScalerCaps_t));
- overlay->hwdata->caps.size = sizeof(PgScalerCaps_t);
- rtncode = PgGetScalerCapabilities(overlay->hwdata->channel, i, &overlay->hwdata->caps);
- if (rtncode==0)
- {
- if (overlay->hwdata->caps.format==format)
- {
- if ((overlay->hwdata->caps.flags & Pg_SCALER_CAP_DST_CHROMA_KEY) == Pg_SCALER_CAP_DST_CHROMA_KEY)
- {
- overlay->hwdata->ischromakey=1;
- }
- vidport=1;
- break;
- }
- }
- else
- {
- break;
- }
- i++;
- } while(1);
-
-
- if (vidport == -1)
- {
- SDL_SetError("No available video ports for requested format\n");
- SDL_FreeYUVOverlay(overlay);
- return NULL;
- }
-
- overlay->hwdata->format = format;
- overlay->hwdata->props.format = format;
- overlay->hwdata->props.size = sizeof(PgScalerProps_t);
- overlay->hwdata->props.src_dim.w = width;
- overlay->hwdata->props.src_dim.h = height;
-
- /* overlay->hwdata->chromakey = PgGetOverlayChromaColor(); */
- overlay->hwdata->chromakey = PgRGB(12, 6, 12); /* very dark pink color */
- overlay->hwdata->props.color_key = overlay->hwdata->chromakey;
-
- PhAreaToRect(&overlay->hwdata->CurrentViewPort, &overlay->hwdata->props.viewport);
-
- overlay->hwdata->props.flags = Pg_SCALER_PROP_DOUBLE_BUFFER;
-
- if ((overlay->hwdata->ischromakey)&&(overlay->hwdata->chromakey))
- {
- overlay->hwdata->props.flags |= Pg_SCALER_PROP_CHROMA_ENABLE;
- overlay->hwdata->props.flags |= Pg_SCALER_PROP_CHROMA_SPECIFY_KEY_MASK;
- }
- else
- {
- overlay->hwdata->props.flags &= ~Pg_SCALER_PROP_CHROMA_ENABLE;
- }
-
- rtncode = PgConfigScalerChannel(overlay->hwdata->channel, &overlay->hwdata->props);
-
- switch(rtncode)
- {
- case -1: SDL_SetError("PgConfigScalerChannel failed\n");
- SDL_FreeYUVOverlay(overlay);
- return NULL;
- case 1:
- case 0:
- default:
- break;
- }
-
- planes = grab_ptrs2(overlay->hwdata->channel, overlay->hwdata->FrameData0, overlay->hwdata->FrameData1);
-
- if(overlay->hwdata->channel->yplane1 != NULL)
- overlay->hwdata->YStride = overlay->hwdata->channel->yplane1->pitch;
- if(overlay->hwdata->channel->vplane1 != NULL)
- overlay->hwdata->UStride = overlay->hwdata->channel->vplane1->pitch;
- if(overlay->hwdata->channel->uplane1 != NULL)
- overlay->hwdata->VStride = overlay->hwdata->channel->uplane1->pitch;
-
- /* check for the validness of all planes */
- if ((overlay->hwdata->channel->yplane1 == NULL) &&
- (overlay->hwdata->channel->uplane1 == NULL) &&
- (overlay->hwdata->channel->vplane1 == NULL))
- {
- SDL_FreeYUVOverlay(overlay);
- SDL_SetError("PgConfigScaler() returns all planes equal NULL\n");
- return NULL;
- }
-/*
- overlay->hwdata->current = PgNextVideoFrame(overlay->hwdata->channel);
-
- if (overlay->hwdata->current==0)
- {
- overlay->hwdata->CurrentFrameData = overlay->hwdata->FrameData0;
- }
- else
- {
- overlay->hwdata->CurrentFrameData = overlay->hwdata->FrameData1;
- }
-*/
- overlay->hwdata->CurrentFrameData = overlay->hwdata->FrameData0;
-
-/*
- overlay->hwdata->locked = 1;
-*/
-
- /* Find the pitch and offset values for the overlay */
- overlay->planes = planes;
- overlay->pitches = SDL_calloc(overlay->planes, sizeof(Uint16));
- overlay->pixels = SDL_calloc(overlay->planes, sizeof(Uint8*));
- if (!overlay->pitches || !overlay->pixels)
- {
- SDL_OutOfMemory();
- SDL_FreeYUVOverlay(overlay);
- return(NULL);
- }
-
- if (overlay->planes > 0)
- {
- overlay->pitches[0] = overlay->hwdata->channel->yplane1->pitch;
- overlay->pixels[0] = overlay->hwdata->CurrentFrameData->Y;
- }
- if (overlay->planes > 1)
- {
- overlay->pitches[1] = overlay->hwdata->channel->vplane1->pitch;
- overlay->pixels[1] = overlay->hwdata->CurrentFrameData->U;
- }
- if (overlay->planes > 2)
- {
- overlay->pitches[2] = overlay->hwdata->channel->uplane1->pitch;
- overlay->pixels[2] = overlay->hwdata->CurrentFrameData->V;
- }
-
- overlay->hwdata->State = OVERLAY_STATE_ACTIVE;
- overlay->hwdata->scaler_on = 0;
- overlay->hw_overlay = 1;
-
- current_overlay=overlay;
-
- return overlay;
-}
-
-int ph_LockYUVOverlay(_THIS, SDL_Overlay* overlay)
-{
- if (overlay == NULL)
- {
- return -1;
- }
-
- overlay->hwdata->locked = 1;
-
-/* overlay->hwdata->current = PgNextVideoFrame(overlay->hwdata->channel);
- if (overlay->hwdata->current == -1)
- {
- SDL_SetError("ph_LockYUVOverlay: PgNextFrame() failed, bailing out\n");
- SDL_FreeYUVOverlay(overlay);
- return 0;
- }
-
- if (overlay->hwdata->current == 0)
- {
- overlay->hwdata->CurrentFrameData = overlay->hwdata->FrameData0;
- }
- else
- {
- overlay->hwdata->CurrentFrameData = overlay->hwdata->FrameData1;
- }
-
- if (overlay->planes > 0)
- {
- overlay->pitches[0] = overlay->hwdata->channel->yplane1->pitch;
- overlay->pixels[0] = overlay->hwdata->CurrentFrameData->Y;
- }
- if (overlay->planes > 1)
- {
- overlay->pitches[1] = overlay->hwdata->channel->uplane1->pitch;
- overlay->pixels[1] = overlay->hwdata->CurrentFrameData->U;
- }
- if (overlay->planes > 2)
- {
- overlay->pitches[2] = overlay->hwdata->channel->vplane1->pitch;
- overlay->pixels[2] = overlay->hwdata->CurrentFrameData->V;
- }
-*/
-
- return(0);
-}
-
-void ph_UnlockYUVOverlay(_THIS, SDL_Overlay* overlay)
-{
- if (overlay == NULL)
- {
- return;
- }
-
- overlay->hwdata->locked = 0;
-}
-
-int ph_DisplayYUVOverlay(_THIS, SDL_Overlay* overlay, SDL_Rect* src, SDL_Rect* dst)
-{
- int rtncode;
- PhPoint_t pos;
- SDL_Rect backrect;
- PhRect_t windowextent;
- int winchanged=0;
-
- if ((overlay == NULL) || (overlay->hwdata==NULL))
- {
- return -1;
- }
-
- if (overlay->hwdata->State == OVERLAY_STATE_UNINIT)
- {
- return -1;
- }
-
- PtGetAbsPosition(window, &pos.x, &pos.y);
- if ((pos.x!=overlay->hwdata->CurrentWindowPos.x) ||
- (pos.y!=overlay->hwdata->CurrentWindowPos.y))
- {
- winchanged=1;
- overlay->hwdata->CurrentWindowPos.x=pos.x;
- overlay->hwdata->CurrentWindowPos.y=pos.y;
- }
-
- /* If CurrentViewPort position/size has been changed, then move/resize the viewport */
- if ((overlay->hwdata->CurrentViewPort.pos.x != dst->x) ||
- (overlay->hwdata->CurrentViewPort.pos.y != dst->y) ||
- (overlay->hwdata->CurrentViewPort.size.w != dst->w) ||
- (overlay->hwdata->CurrentViewPort.size.h != dst->h) ||
- (overlay->hwdata->scaler_on==0) || (winchanged==1) ||
- (overlay->hwdata->forcedredraw==1))
- {
-
- if (overlay->hwdata->ischromakey==1)
- {
- /* restore screen behind the overlay/chroma color. */
- backrect.x=overlay->hwdata->CurrentViewPort.pos.x;
- backrect.y=overlay->hwdata->CurrentViewPort.pos.y;
- backrect.w=overlay->hwdata->CurrentViewPort.size.w;
- backrect.h=overlay->hwdata->CurrentViewPort.size.h;
- this->UpdateRects(this, 1, &backrect);
-
- /* Draw the new rectangle of the chroma color at the viewport position */
- PgSetFillColor(overlay->hwdata->chromakey);
- PgDrawIRect(dst->x, dst->y, dst->x+dst->w-1, dst->y+dst->h-1, Pg_DRAW_FILL);
- PgFlush();
- }
-
- overlay->hwdata->props.flags |= Pg_SCALER_PROP_SCALER_ENABLE;
- overlay->hwdata->scaler_on = 1;
-
- PhWindowQueryVisible(Ph_QUERY_CONSOLE, 0, PtWidgetRid(window), &windowextent);
- overlay->hwdata->CurrentViewPort.pos.x = pos.x-windowextent.ul.x+dst->x;
- overlay->hwdata->CurrentViewPort.pos.y = pos.y-windowextent.ul.y+dst->y;
- overlay->hwdata->CurrentViewPort.size.w = dst->w;
- overlay->hwdata->CurrentViewPort.size.h = dst->h;
- PhAreaToRect(&overlay->hwdata->CurrentViewPort, &overlay->hwdata->props.viewport);
- overlay->hwdata->CurrentViewPort.pos.x = dst->x;
- overlay->hwdata->CurrentViewPort.pos.y = dst->y;
-
- rtncode = PgConfigScalerChannel(overlay->hwdata->channel, &(overlay->hwdata->props));
-
- switch(rtncode)
- {
- case -1:
- SDL_SetError("PgConfigScalerChannel() function failed\n");
- SDL_FreeYUVOverlay(overlay);
- return -1;
- case 1:
- grab_ptrs2(overlay->hwdata->channel, overlay->hwdata->FrameData0, overlay->hwdata->FrameData1);
- break;
- case 0:
- default:
- break;
- }
- }
-
-
-/*
- if (overlay->hwdata->locked==0)
- {
- overlay->hwdata->current = PgNextVideoFrame(overlay->hwdata->channel);
- if (overlay->hwdata->current == -1)
- {
- SDL_SetError("ph_LockYUVOverlay: PgNextFrame() failed, bailing out\n");
- SDL_FreeYUVOverlay(overlay);
- return 0;
- }
-
- if (overlay->hwdata->current == 0)
- {
- overlay->hwdata->CurrentFrameData = overlay->hwdata->FrameData0;
- }
- else
- {
- overlay->hwdata->CurrentFrameData = overlay->hwdata->FrameData1;
- }
-
- if (overlay->planes > 0)
- {
- overlay->pitches[0] = overlay->hwdata->channel->yplane1->pitch;
- overlay->pixels[0] = overlay->hwdata->CurrentFrameData->Y;
- }
- if (overlay->planes > 1)
- {
- overlay->pitches[1] = overlay->hwdata->channel->uplane1->pitch;
- overlay->pixels[1] = overlay->hwdata->CurrentFrameData->U;
- }
- if (overlay->planes > 2)
- {
- overlay->pitches[2] = overlay->hwdata->channel->vplane1->pitch;
- overlay->pixels[2] = overlay->hwdata->CurrentFrameData->V;
- }
- }
-*/
-
- return 0;
-}
-
-void ph_FreeYUVOverlay(_THIS, SDL_Overlay *overlay)
-{
- SDL_Rect backrect;
-
- if (overlay == NULL)
- {
- return;
- }
-
- if (overlay->hwdata == NULL)
- {
- return;
- }
-
- current_overlay=NULL;
-
- /* restore screen behind the overlay/chroma color. */
- backrect.x=overlay->hwdata->CurrentViewPort.pos.x;
- backrect.y=overlay->hwdata->CurrentViewPort.pos.y;
- backrect.w=overlay->hwdata->CurrentViewPort.size.w;
- backrect.h=overlay->hwdata->CurrentViewPort.size.h;
- this->UpdateRects(this, 1, &backrect);
-
- /* it is need for some buggy drivers, that can't hide overlay before */
- /* freeing buffer, so we got trash on the srceen */
- overlay->hwdata->props.flags &= ~Pg_SCALER_PROP_SCALER_ENABLE;
- PgConfigScalerChannel(overlay->hwdata->channel, &(overlay->hwdata->props));
-
- overlay->hwdata->scaler_on = 0;
- overlay->hwdata->State = OVERLAY_STATE_UNINIT;
-
- if (overlay->hwdata->channel != NULL)
- {
- PgDestroyVideoChannel(overlay->hwdata->channel);
- overlay->hwdata->channel = NULL;
- return;
- }
-
- overlay->hwdata->CurrentFrameData = NULL;
-
- SDL_free(overlay->hwdata->FrameData0);
- SDL_free(overlay->hwdata->FrameData1);
- overlay->hwdata->FrameData0 = NULL;
- overlay->hwdata->FrameData1 = NULL;
- SDL_free(overlay->hwdata);
-}
diff --git a/distrib/sdl-1.2.12/src/video/photon/SDL_phyuv_c.h b/distrib/sdl-1.2.12/src/video/photon/SDL_phyuv_c.h
deleted file mode 100644
index a004a03..0000000
--- a/distrib/sdl-1.2.12/src/video/photon/SDL_phyuv_c.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef __SDL_PH_YUV_H__
-#define __SDL_PH_YUV_H__
-
-/* This is the photon implementation of YUV video overlays */
-
-#include "SDL_video.h"
-#include "SDL_ph_video.h"
-
-struct private_yuvhwdata
-{
- FRAMEDATA* CurrentFrameData;
- FRAMEDATA* FrameData0;
- FRAMEDATA* FrameData1;
- PgScalerProps_t props;
- PgScalerCaps_t caps;
- PgVideoChannel_t* channel;
- PhArea_t CurrentViewPort;
- PhPoint_t CurrentWindowPos;
- long format;
- int scaler_on;
- int current;
- long YStride;
- long VStride;
- long UStride;
- int ischromakey;
- long chromakey;
- int forcedredraw;
- unsigned long State;
- long flags;
- int locked;
-};
-
-extern SDL_Overlay* ph_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface* display);
-extern int ph_LockYUVOverlay(_THIS, SDL_Overlay* overlay);
-extern void ph_UnlockYUVOverlay(_THIS, SDL_Overlay* overlay);
-extern int ph_DisplayYUVOverlay(_THIS, SDL_Overlay* overlay, SDL_Rect* src, SDL_Rect* dst);
-extern void ph_FreeYUVOverlay(_THIS, SDL_Overlay* overlay);
-
-#endif /* __SDL_PH_YUV_H__ */
diff --git a/distrib/sdl-1.2.12/src/video/picogui/SDL_pgevents.c b/distrib/sdl-1.2.12/src/video/picogui/SDL_pgevents.c
deleted file mode 100644
index 0d6b530..0000000
--- a/distrib/sdl-1.2.12/src/video/picogui/SDL_pgevents.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- Micah Dowty
- micahjd@users.sourceforge.net
-*/
-#include "SDL_config.h"
-
-#include "SDL.h"
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_pgvideo.h"
-#include "SDL_pgevents_c.h"
-
-int PG_HandleClose(struct pgEvent *evt)
-{
- SDL_PrivateQuit();
- return 1; /* Intercept the event's normal quit handling */
-}
-
-int PG_HandleResize(struct pgEvent *evt)
-{
- SDL_PrivateResize(evt->e.size.w, evt->e.size.h);
- return 0;
-}
-
-int PG_HandleKey(struct pgEvent *evt)
-{
- SDL_keysym sym;
- SDL_memset(&sym,0,sizeof(sym));
- sym.sym = evt->e.kbd.key;
- sym.mod = evt->e.kbd.mods;
- SDL_PrivateKeyboard(evt->type == PG_WE_KBD_KEYDOWN, &sym);
- return 0;
-}
-
-int PG_HandleChar(struct pgEvent *evt)
-{
- SDL_keysym sym;
- SDL_memset(&sym,0,sizeof(sym));
- sym.unicode = evt->e.kbd.key;
- sym.mod = evt->e.kbd.mods;
- SDL_PrivateKeyboard(evt->type == PG_WE_KBD_KEYDOWN, &sym);
- return 0;
-}
-
-int PG_HandleMouseButton(struct pgEvent *evt)
-{
- /* We need to focus the canvas when it's clicked */
- if (evt->extra) {
- SDL_VideoDevice *this = (SDL_VideoDevice *) evt->extra;
- pgFocus(this->hidden->wCanvas);
- }
- SDL_PrivateMouseButton(evt->type == PG_WE_PNTR_DOWN, evt->e.pntr.chbtn,
- evt->e.pntr.x, evt->e.pntr.y);
- return 0;
-}
-
-int PG_HandleMouseMotion(struct pgEvent *evt)
-{
- SDL_PrivateMouseMotion(evt->e.pntr.btn,0,evt->e.pntr.x, evt->e.pntr.y);
- return 0;
-}
-
-void PG_PumpEvents(_THIS)
-{
- /* Process all pending events */
- pgEventPoll();
-}
-
-void PG_InitOSKeymap(_THIS)
-{
- /* We need no keymap */
-}
-
-void PG_InitEvents(_THIS)
-{
- /* Turn on all the mouse and keyboard triggers for our canvas, normally less important
- * events like mouse movement are ignored to save bandwidth. */
- pgSetWidget(this->hidden->wCanvas, PG_WP_TRIGGERMASK,
- pgGetWidget(this->hidden->wCanvas, PG_WP_TRIGGERMASK) |
- PG_TRIGGER_UP | PG_TRIGGER_DOWN | PG_TRIGGER_MOVE |
- PG_TRIGGER_KEYUP | PG_TRIGGER_KEYDOWN | PG_TRIGGER_CHAR,0);
-
- /* Start our canvas out focused, so we get keyboard input */
- pgFocus(this->hidden->wCanvas);
-
- /* Set up bindings for all the above event handlers */
- pgBind(this->hidden->wApp, PG_WE_CLOSE, &PG_HandleClose, NULL);
- pgBind(this->hidden->wCanvas, PG_WE_BUILD, &PG_HandleResize, NULL);
- pgBind(this->hidden->wCanvas, PG_WE_KBD_CHAR, &PG_HandleChar, NULL);
- pgBind(this->hidden->wCanvas, PG_WE_KBD_KEYUP, &PG_HandleKey, NULL);
- pgBind(this->hidden->wCanvas, PG_WE_KBD_KEYDOWN, &PG_HandleKey, NULL);
- pgBind(this->hidden->wCanvas, PG_WE_PNTR_MOVE, &PG_HandleMouseMotion, NULL);
- pgBind(this->hidden->wCanvas, PG_WE_PNTR_UP, &PG_HandleMouseButton, NULL);
- pgBind(this->hidden->wCanvas, PG_WE_PNTR_DOWN, &PG_HandleMouseButton, this);
-}
-
-/* end of SDL_pgevents.c ... */
diff --git a/distrib/sdl-1.2.12/src/video/picogui/SDL_pgevents_c.h b/distrib/sdl-1.2.12/src/video/picogui/SDL_pgevents_c.h
deleted file mode 100644
index 2b7124f..0000000
--- a/distrib/sdl-1.2.12/src/video/picogui/SDL_pgevents_c.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- Micah Dowty
- micahjd@users.sourceforge.net
-*/
-#include "SDL_config.h"
-
-#include "SDL_pgvideo.h"
-
-/* Variables and functions exported by SDL_sysevents.c to other parts
- of the native video subsystem (SDL_sysvideo.c)
-*/
-extern void PG_PumpEvents(_THIS);
-extern void PG_InitEvents(_THIS);
-extern void PG_InitOSKeymap(_THIS);
-
-/* end of SDL_pgevents_c.h ... */
-
diff --git a/distrib/sdl-1.2.12/src/video/picogui/SDL_pgvideo.c b/distrib/sdl-1.2.12/src/video/picogui/SDL_pgvideo.c
deleted file mode 100644
index 04464af..0000000
--- a/distrib/sdl-1.2.12/src/video/picogui/SDL_pgvideo.c
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- Micah Dowty
- micahjd@users.sourceforge.net
-*/
-#include "SDL_config.h"
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_pgvideo.h"
-#include "SDL_pgevents_c.h"
-
-#define PGVID_DRIVER_NAME "picogui"
-
-/* Initialization/Query functions */
-static int PG_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **PG_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *PG_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int PG_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
-static void PG_VideoQuit(_THIS);
-
-/* Hardware surface functions */
-static int PG_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int PG_LockHWSurface(_THIS, SDL_Surface *surface);
-static void PG_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static void PG_FreeHWSurface(_THIS, SDL_Surface *surface);
-
-/* etc. */
-static void PG_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
-
-// The implementation dependent data for the window manager cursor
-struct WMcursor {
- /* Our cursor is a PicoGUI theme */
- pghandle theme;
-} ;
-
-/* WM functions */
-void PG_SetCaption(_THIS, const char *title, const char *icon);
-WMcursor * PG_CreateWMCursor (_THIS,Uint8 * data, Uint8 * mask,
- int w, int h, int hot_x, int hot_y);
-void PG_FreeWMCursor (_THIS, WMcursor * cursor);
-void PG_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
-int PG_ShowWMCursor (_THIS, WMcursor * cursor);
-
-/* PicoGUI driver bootstrap functions */
-
-static int PG_Available(void)
-{
- /* FIXME: The current client lib doesn't give a way to see if the picogui
- * server is reachable without causing a fatal error if it isn't.
- * This should be fixed in cli_c2, but until then assume we can
- * connect. Since more common drivers like X11 are probed first anyway,
- * this shouldn't be a huge problem.
- */
- return(1);
-}
-
-static void PG_DeleteDevice(SDL_VideoDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_VideoDevice *PG_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device ) {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *device->hidden));
- }
- if ( (device == NULL) || (device->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( device ) {
- SDL_free(device);
- }
- return(0);
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
-
- /* Set the function pointers */
- device->VideoInit = PG_VideoInit;
- device->ListModes = PG_ListModes;
- device->SetVideoMode = PG_SetVideoMode;
- device->CreateYUVOverlay = NULL;
- device->SetColors = PG_SetColors;
- device->UpdateRects = PG_UpdateRects;
- device->VideoQuit = PG_VideoQuit;
- device->AllocHWSurface = PG_AllocHWSurface;
- device->CheckHWBlit = NULL;
- device->FillHWRect = NULL;
- device->SetHWColorKey = NULL;
- device->SetHWAlpha = NULL;
- device->LockHWSurface = PG_LockHWSurface;
- device->UnlockHWSurface = PG_UnlockHWSurface;
- device->FlipHWSurface = NULL;
- device->FreeHWSurface = PG_FreeHWSurface;
- device->SetCaption = PG_SetCaption;
- device->SetIcon = NULL;
- device->IconifyWindow = NULL;
- device->GrabInput = NULL;
-
- device->PumpEvents = PG_PumpEvents;
- device->InitOSKeymap = PG_InitOSKeymap;
-
- device->ShowWMCursor = PG_ShowWMCursor;
- device->CreateWMCursor = PG_CreateWMCursor;
- device->FreeWMCursor = PG_FreeWMCursor;
- device->WarpWMCursor = PG_WarpWMCursor;
-
- device->free = PG_DeleteDevice;
-
- return device;
-}
-
-VideoBootStrap PG_bootstrap = {
- PGVID_DRIVER_NAME, "PicoGUI SDL driver",
- PG_Available, PG_CreateDevice
-};
-
-
-int PG_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- /* Connect to the PicoGUI server. No way to process command line args yet,
- * but since this is based on SHM it's not important to be able to specify
- * a remote PicoGUI server.
- *
- * FIXME: Another nitpick about the current client lib is there's no
- * clean way to indicate that command line args are not available.
- */
- pgInit(0,(char**)"");
- this->hidden->mi = *pgGetVideoMode();
-
- /* Create a picogui application and canvas. We'll populate the canvas later. */
- this->hidden->wApp = pgRegisterApp(PG_APP_NORMAL,"SDL",0);
- this->hidden->wCanvas = pgNewWidget(PG_WIDGET_CANVAS,0,0);
- pgSetWidget(PGDEFAULT,
- PG_WP_SIDE, PG_S_ALL,
- 0);
-
- PG_InitEvents(this);
-
- /* Determine the current screen size */
- this->info.current_w = this->hidden->mi.lxres;
- this->info.current_h = this->hidden->mi.lyres;
-
- /* Determine the screen depth.
- * We change this during the SDL_SetVideoMode implementation...
- * Round up to the nearest Bytes per pixel
- */
- vformat->BitsPerPixel = this->hidden->mi.bpp;
- vformat->BytesPerPixel = this->hidden->mi.bpp >> 3;
- if (this->hidden->mi.bpp & 7)
- vformat->BytesPerPixel++;
-
- /* We're done! */
- return(0);
-}
-
-SDL_Rect **PG_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- return (SDL_Rect **) -1;
-}
-
-SDL_Surface *PG_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- if ( this->hidden->bitmap ) {
- /* Free old bitmap */
- if (current->pixels) {
- shmdt(current->pixels);
- current->pixels = NULL;
- }
- pgDelete(this->hidden->bitmap);
- }
-
- /* Allocate the new pixel format for the screen */
- if ( ! SDL_ReallocFormat(current, bpp, 0, 0, 0, 0) ) {
- SDL_SetError("Couldn't allocate new pixel format for requested mode");
- return(NULL);
- }
-
- /* Create a new picogui bitmap */
- this->hidden->bitmap = pgCreateBitmap(width,height);
- this->hidden->shm = *pgMakeSHMBitmap(this->hidden->bitmap);
- current->pixels = shmat(shmget(this->hidden->shm.shm_key,
- this->hidden->shm.shm_length,0),NULL,0);
-
- /* Reset the canvas, and draw persistent and incremental grops.
- * Use mapping and offsets to center it.
- */
-
- pgWriteCmd(this->hidden->wCanvas, PGCANVAS_NUKE, 0);
-
- /* 0. Set the source position during incremental rendering
- */
- pgWriteCmd(this->hidden->wCanvas, PGCANVAS_GROP, 5, PG_GROP_SETSRC,0,0,0,0);
- pgWriteCmd(this->hidden->wCanvas, PGCANVAS_GROPFLAGS, 1, PG_GROPF_INCREMENTAL);
-
- /* 1. Incremental bitmap rendering
- */
- pgWriteCmd(this->hidden->wCanvas, PGCANVAS_GROP, 6, PG_GROP_BITMAP,
- 0,0,0,0,this->hidden->bitmap);
- pgWriteCmd(this->hidden->wCanvas, PGCANVAS_GROPFLAGS, 1, PG_GROPF_INCREMENTAL);
-
- /* 2. Normal bitmap rendering
- */
- pgWriteCmd(this->hidden->wCanvas, PGCANVAS_GROP, 6, PG_GROP_BITMAP,
- 0,0,this->hidden->shm.width,this->hidden->shm.height,this->hidden->bitmap);
-
- /* Set up the new mode framebuffer */
- current->flags = 0;
- current->w = this->hidden->shm.width;
- current->h = this->hidden->shm.height;
- current->pitch = this->hidden->shm.pitch;
-
- /* Set up pixel format */
- current->format->BitsPerPixel = this->hidden->shm.bpp;
- current->format->BytesPerPixel = this->hidden->shm.bpp >> 3;
- if (this->hidden->shm.bpp & 7)
- current->format->BytesPerPixel++;
- current->format->palette = NULL;
- current->format->Rmask = this->hidden->shm.red_mask;
- current->format->Gmask = this->hidden->shm.green_mask;
- current->format->Bmask = this->hidden->shm.blue_mask;
- current->format->Amask = this->hidden->shm.alpha_mask;
- current->format->Rshift = this->hidden->shm.red_shift;
- current->format->Gshift = this->hidden->shm.green_shift;
- current->format->Bshift = this->hidden->shm.blue_shift;
- current->format->Ashift = this->hidden->shm.alpha_shift;
- current->format->Rloss = 8 - this->hidden->shm.red_length;
- current->format->Gloss = 8 - this->hidden->shm.green_length;
- current->format->Bloss = 8 - this->hidden->shm.blue_length;
- current->format->Aloss = 8 - this->hidden->shm.alpha_length;
-
- /* Draw the app */
- pgUpdate();
-
- /* We're done */
- return(current);
-}
-
-/* We don't actually allow hardware surfaces other than the main one */
-static int PG_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- return(-1);
-}
-static void PG_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-/* We need to wait for vertical retrace on page flipped displays */
-static int PG_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- return(0);
-}
-
-static void PG_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-static void PG_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
-{
- int i;
-
- for (i = 0; i < numrects; i++) {
- if (rects[i].w <= 0 || rects[i].h <= 0)
- continue;
-
- /* Schedule an incremental update for this rectangle, using
- * the canvas gropnodes we've loaded beforehand.
- */
- pgWriteCmd(this->hidden->wCanvas, PGCANVAS_FINDGROP, 1, 0);
- pgWriteCmd(this->hidden->wCanvas, PGCANVAS_MOVEGROP, 4,
- rects[i].x, rects[i].y,
- rects[i].w, rects[i].h);
- pgWriteCmd(this->hidden->wCanvas, PGCANVAS_FINDGROP, 1, 1);
- pgWriteCmd(this->hidden->wCanvas, PGCANVAS_MOVEGROP, 4,
- rects[i].x, rects[i].y,
- rects[i].w, rects[i].h);
-
- /* Go perform the update */
- pgWriteCmd(this->hidden->wCanvas, PGCANVAS_INCREMENTAL, 0);
- pgSubUpdate(this->hidden->wCanvas);
- }
-}
-
-int PG_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- /* do nothing of note. */
- return(1);
-}
-
-/* Note: If we are terminated, this could be called in the middle of
- another SDL video routine -- notably UpdateRects.
-*/
-void PG_VideoQuit(_THIS)
-{
- if (this->screen->pixels != NULL)
- {
- shmdt(this->screen->pixels);
- this->screen->pixels = NULL;
- pgDelete(this->hidden->bitmap);
- }
- pgDelete(this->hidden->wCanvas);
- pgDelete(this->hidden->wApp);
-}
-
-void PG_SetCaption(_THIS, const char *title, const char *icon)
-{
- if (title != NULL)
- pgReplaceText(this->hidden->wApp, title);
- pgUpdate();
-}
-
-/* FIXME: The cursor stuff isn't implemented yet! */
-
-WMcursor * PG_CreateWMCursor (_THIS,Uint8 * data, Uint8 * mask,
- int w, int h, int hot_x, int hot_y)
-{
- static WMcursor dummy;
- return &dummy;
-}
-
-void PG_FreeWMCursor (_THIS, WMcursor * cursor)
-{
-}
-
-void PG_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
-{
-}
-
-int PG_ShowWMCursor (_THIS, WMcursor * cursor)
-{
- return 1;
-}
diff --git a/distrib/sdl-1.2.12/src/video/picogui/SDL_pgvideo.h b/distrib/sdl-1.2.12/src/video/picogui/SDL_pgvideo.h
deleted file mode 100644
index f3d0e1d..0000000
--- a/distrib/sdl-1.2.12/src/video/picogui/SDL_pgvideo.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-
- Micah Dowty
- micahjd@users.sourceforge.net
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_pgvideo_h
-#define _SDL_pgvideo_h
-
-#include "SDL_mouse.h"
-#include "SDL_mutex.h"
-#include "../SDL_sysvideo.h"
-
-#include <picogui.h>
-#include <sys/shm.h>
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-
-/* Private display data */
-
-struct SDL_PrivateVideoData {
- pghandle wApp, wCanvas; /* PicoGUI widgets */
- pghandle bitmap;
- struct pgshmbitmap shm; /* shared memory info */
- struct pgmodeinfo mi; /* PicoGUI video mode info structure */
-};
-
-#endif /* _SDL_pgvideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsevents.c b/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsevents.c
deleted file mode 100644
index 13f96b5..0000000
--- a/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsevents.c
+++ /dev/null
@@ -1,977 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Handle the event stream, converting console events into SDL events */
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/ioctl.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <limits.h>
-
-/* For parsing /proc */
-#include <dirent.h>
-#include <ctype.h>
-
-#include <linux/vt.h>
-#include <linux/kd.h>
-#include <linux/keyboard.h>
-
-#include "SDL_mutex.h"
-#include "../SDL_sysvideo.h"
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_gsvideo.h"
-#include "SDL_gsevents_c.h"
-#include "SDL_gskeys.h"
-
-#ifndef GPM_NODE_FIFO
-#define GPM_NODE_FIFO "/dev/gpmdata"
-#endif
-
-/* The translation tables from a console scancode to a SDL keysym */
-#define NUM_VGAKEYMAPS (1<<KG_CAPSSHIFT)
-static Uint16 vga_keymap[NUM_VGAKEYMAPS][NR_KEYS];
-static SDLKey keymap[128];
-static Uint16 keymap_temp[128]; /* only used at startup */
-static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym);
-
-/* Ugh, we have to duplicate the kernel's keysym mapping code...
- Oh, it's not so bad. :-)
-
- FIXME: Add keyboard LED handling code
- */
-static void GS_vgainitkeymaps(int fd)
-{
- struct kbentry entry;
- int map, i;
-
- /* Don't do anything if we are passed a closed keyboard */
- if ( fd < 0 ) {
- return;
- }
-
- /* Load all the keysym mappings */
- for ( map=0; map<NUM_VGAKEYMAPS; ++map ) {
- SDL_memset(vga_keymap[map], 0, NR_KEYS*sizeof(Uint16));
- for ( i=0; i<NR_KEYS; ++i ) {
- entry.kb_table = map;
- entry.kb_index = i;
- if ( ioctl(fd, KDGKBENT, &entry) == 0 ) {
- /* fill keytemp. This replaces SDL_fbkeys.h */
- if ( (map == 0) && (i<128) ) {
- keymap_temp[i] = entry.kb_value;
- }
- /* The "Enter" key is a special case */
- if ( entry.kb_value == K_ENTER ) {
- entry.kb_value = K(KT_ASCII,13);
- }
- /* Handle numpad specially as well */
- if ( KTYP(entry.kb_value) == KT_PAD ) {
- switch ( entry.kb_value ) {
- case K_P0:
- case K_P1:
- case K_P2:
- case K_P3:
- case K_P4:
- case K_P5:
- case K_P6:
- case K_P7:
- case K_P8:
- case K_P9:
- vga_keymap[map][i]=entry.kb_value;
- vga_keymap[map][i]+= '0';
- break;
- case K_PPLUS:
- vga_keymap[map][i]=K(KT_ASCII,'+');
- break;
- case K_PMINUS:
- vga_keymap[map][i]=K(KT_ASCII,'-');
- break;
- case K_PSTAR:
- vga_keymap[map][i]=K(KT_ASCII,'*');
- break;
- case K_PSLASH:
- vga_keymap[map][i]=K(KT_ASCII,'/');
- break;
- case K_PENTER:
- vga_keymap[map][i]=K(KT_ASCII,'\r');
- break;
- case K_PCOMMA:
- vga_keymap[map][i]=K(KT_ASCII,',');
- break;
- case K_PDOT:
- vga_keymap[map][i]=K(KT_ASCII,'.');
- break;
- default:
- break;
- }
- }
- /* Do the normal key translation */
- if ( (KTYP(entry.kb_value) == KT_LATIN) ||
- (KTYP(entry.kb_value) == KT_ASCII) ||
- (KTYP(entry.kb_value) == KT_LETTER) ) {
- vga_keymap[map][i] = entry.kb_value;
- }
- }
- }
- }
-}
-
-int GS_InGraphicsMode(_THIS)
-{
- return((keyboard_fd >= 0) && (saved_kbd_mode >= 0));
-}
-
-int GS_EnterGraphicsMode(_THIS)
-{
- struct termios keyboard_termios;
-
- /* Set medium-raw keyboard mode */
- if ( (keyboard_fd >= 0) && !GS_InGraphicsMode(this) ) {
-
- /* Switch to the correct virtual terminal */
- if ( current_vt > 0 ) {
- struct vt_stat vtstate;
-
- if ( ioctl(keyboard_fd, VT_GETSTATE, &vtstate) == 0 ) {
- saved_vt = vtstate.v_active;
- }
- if ( ioctl(keyboard_fd, VT_ACTIVATE, current_vt) == 0 ) {
- ioctl(keyboard_fd, VT_WAITACTIVE, current_vt);
- }
- }
-
- /* Set the terminal input mode */
- if ( tcgetattr(keyboard_fd, &saved_kbd_termios) < 0 ) {
- SDL_SetError("Unable to get terminal attributes");
- if ( keyboard_fd > 0 ) {
- close(keyboard_fd);
- }
- keyboard_fd = -1;
- return(-1);
- }
- if ( ioctl(keyboard_fd, KDGKBMODE, &saved_kbd_mode) < 0 ) {
- SDL_SetError("Unable to get current keyboard mode");
- if ( keyboard_fd > 0 ) {
- close(keyboard_fd);
- }
- keyboard_fd = -1;
- return(-1);
- }
- keyboard_termios = saved_kbd_termios;
- keyboard_termios.c_lflag &= ~(ICANON | ECHO | ISIG);
- keyboard_termios.c_iflag &= ~(ISTRIP | IGNCR | ICRNL | INLCR | IXOFF | IXON);
- keyboard_termios.c_cc[VMIN] = 0;
- keyboard_termios.c_cc[VTIME] = 0;
- if (tcsetattr(keyboard_fd, TCSAFLUSH, &keyboard_termios) < 0) {
- GS_CloseKeyboard(this);
- SDL_SetError("Unable to set terminal attributes");
- return(-1);
- }
- /* This will fail if we aren't root or this isn't our tty */
- if ( ioctl(keyboard_fd, KDSKBMODE, K_MEDIUMRAW) < 0 ) {
- GS_CloseKeyboard(this);
- SDL_SetError("Unable to set keyboard in raw mode");
- return(-1);
- }
- if ( ioctl(keyboard_fd, KDSETMODE, KD_GRAPHICS) < 0 ) {
- GS_CloseKeyboard(this);
- SDL_SetError("Unable to set keyboard in graphics mode");
- return(-1);
- }
- }
- return(keyboard_fd);
-}
-
-void GS_LeaveGraphicsMode(_THIS)
-{
- if ( GS_InGraphicsMode(this) ) {
- ioctl(keyboard_fd, KDSETMODE, KD_TEXT);
- ioctl(keyboard_fd, KDSKBMODE, saved_kbd_mode);
- tcsetattr(keyboard_fd, TCSAFLUSH, &saved_kbd_termios);
- saved_kbd_mode = -1;
-
- /* Head back over to the original virtual terminal */
- if ( saved_vt > 0 ) {
- ioctl(keyboard_fd, VT_ACTIVATE, saved_vt);
- }
- }
-}
-
-void GS_CloseKeyboard(_THIS)
-{
- if ( keyboard_fd >= 0 ) {
- GS_LeaveGraphicsMode(this);
- if ( keyboard_fd > 0 ) {
- close(keyboard_fd);
- }
- }
- keyboard_fd = -1;
-}
-
-int GS_OpenKeyboard(_THIS)
-{
- /* Open only if not already opened */
- if ( keyboard_fd < 0 ) {
- char *tty0[] = { "/dev/tty0", "/dev/vc/0", NULL };
- char *vcs[] = { "/dev/vc/%d", "/dev/tty%d", NULL };
- int i, tty0_fd;
-
- /* Try to query for a free virtual terminal */
- tty0_fd = -1;
- for ( i=0; tty0[i] && (tty0_fd < 0); ++i ) {
- tty0_fd = open(tty0[i], O_WRONLY, 0);
- }
- if ( tty0_fd < 0 ) {
- tty0_fd = dup(0); /* Maybe stdin is a VT? */
- }
- ioctl(tty0_fd, VT_OPENQRY, &current_vt);
- close(tty0_fd);
- if ( (geteuid() == 0) && (current_vt > 0) ) {
- for ( i=0; vcs[i] && (keyboard_fd < 0); ++i ) {
- char vtpath[12];
-
- SDL_snprintf(vtpath, SDL_arraysize(vtpath), vcs[i], current_vt);
- keyboard_fd = open(vtpath, O_RDWR, 0);
-#ifdef DEBUG_KEYBOARD
- fprintf(stderr, "vtpath = %s, fd = %d\n",
- vtpath, keyboard_fd);
-#endif /* DEBUG_KEYBOARD */
-
- /* This needs to be our controlling tty
- so that the kernel ioctl() calls work
- */
- if ( keyboard_fd >= 0 ) {
- tty0_fd = open("/dev/tty", O_RDWR, 0);
- if ( tty0_fd >= 0 ) {
- ioctl(tty0_fd, TIOCNOTTY, 0);
- close(tty0_fd);
- }
- }
- }
- }
- if ( keyboard_fd < 0 ) {
- /* Last resort, maybe our tty is a usable VT */
- current_vt = 0;
- keyboard_fd = open("/dev/tty", O_RDWR);
- }
-#ifdef DEBUG_KEYBOARD
- fprintf(stderr, "Current VT: %d\n", current_vt);
-#endif
- saved_kbd_mode = -1;
-
- /* Make sure that our input is a console terminal */
- { int dummy;
- if ( ioctl(keyboard_fd, KDGKBMODE, &dummy) < 0 ) {
- close(keyboard_fd);
- keyboard_fd = -1;
- SDL_SetError("Unable to open a console terminal");
- }
- }
-
- /* Set up keymap */
- GS_vgainitkeymaps(keyboard_fd);
- }
- return(keyboard_fd);
-}
-
-static enum {
- MOUSE_NONE = -1,
- MOUSE_GPM, /* Note: GPM uses the MSC protocol */
- MOUSE_PS2,
- MOUSE_IMPS2,
- MOUSE_MS,
- MOUSE_BM,
- NUM_MOUSE_DRVS
-} mouse_drv = MOUSE_NONE;
-
-void GS_CloseMouse(_THIS)
-{
- if ( mouse_fd > 0 ) {
- close(mouse_fd);
- }
- mouse_fd = -1;
-}
-
-/* Returns processes listed in /proc with the desired name */
-static int find_pid(DIR *proc, const char *wanted_name)
-{
- struct dirent *entry;
- int pid;
-
- /* First scan proc for the gpm process */
- pid = 0;
- while ( (pid == 0) && ((entry=readdir(proc)) != NULL) ) {
- if ( isdigit(entry->d_name[0]) ) {
- FILE *status;
- char path[PATH_MAX];
- char name[PATH_MAX];
-
- SDL_snprintf(path, SDL_arraysize(path), "/proc/%s/status", entry->d_name);
- status=fopen(path, "r");
- if ( status ) {
- name[0] = '\0';
- fscanf(status, "Name: %s", name);
- if ( SDL_strcmp(name, wanted_name) == 0 ) {
- pid = atoi(entry->d_name);
- }
- fclose(status);
- }
- }
- }
- return pid;
-}
-
-/* Returns true if /dev/gpmdata is being written to by gpm */
-static int gpm_available(void)
-{
- int available;
- DIR *proc;
- int pid;
- int cmdline, len, arglen;
- char path[PATH_MAX];
- char args[PATH_MAX], *arg;
-
- /* Don't bother looking if the fifo isn't there */
- if ( access(GPM_NODE_FIFO, F_OK) < 0 ) {
- return(0);
- }
-
- available = 0;
- proc = opendir("/proc");
- if ( proc ) {
- while ( (pid=find_pid(proc, "gpm")) > 0 ) {
- SDL_snprintf(path, SDL_arraysize(path), "/proc/%d/cmdline", pid);
- cmdline = open(path, O_RDONLY, 0);
- if ( cmdline >= 0 ) {
- len = read(cmdline, args, sizeof(args));
- arg = args;
- while ( len > 0 ) {
- if ( SDL_strcmp(arg, "-R") == 0 ) {
- available = 1;
- }
- arglen = SDL_strlen(arg)+1;
- len -= arglen;
- arg += arglen;
- }
- close(cmdline);
- }
- }
- closedir(proc);
- }
- return available;
-}
-
-
-/* rcg06112001 Set up IMPS/2 mode, if possible. This gives
- * us access to the mousewheel, etc. Returns zero if
- * writes to device failed, but you still need to query the
- * device to see which mode it's actually in.
- */
-static int set_imps2_mode(int fd)
-{
- /* If you wanted to control the mouse mode (and we do :) ) ...
- Set IMPS/2 protocol:
- {0xf3,200,0xf3,100,0xf3,80}
- Reset mouse device:
- {0xFF}
- */
- Uint8 set_imps2[] = {0xf3, 200, 0xf3, 100, 0xf3, 80};
- Uint8 reset = 0xff;
- fd_set fdset;
- struct timeval tv;
- int retval = 0;
-
- if ( write(fd, &set_imps2, sizeof(set_imps2)) == sizeof(set_imps2) ) {
- if (write(fd, &reset, sizeof (reset)) == sizeof (reset) ) {
- retval = 1;
- }
- }
-
- /* Get rid of any chatter from the above */
- FD_ZERO(&fdset);
- FD_SET(fd, &fdset);
- tv.tv_sec = 0;
- tv.tv_usec = 0;
- while ( select(fd+1, &fdset, 0, 0, &tv) > 0 ) {
- char temp[32];
- read(fd, temp, sizeof(temp));
- }
-
- return retval;
-}
-
-
-/* Returns true if the mouse uses the IMPS/2 protocol */
-static int detect_imps2(int fd)
-{
- int imps2;
-
- imps2 = 0;
-
- if ( SDL_getenv("SDL_MOUSEDEV_IMPS2") ) {
- imps2 = 1;
- }
- if ( ! imps2 ) {
- Uint8 query_ps2 = 0xF2;
- fd_set fdset;
- struct timeval tv;
-
- /* Get rid of any mouse motion noise */
- FD_ZERO(&fdset);
- FD_SET(fd, &fdset);
- tv.tv_sec = 0;
- tv.tv_usec = 0;
- while ( select(fd+1, &fdset, 0, 0, &tv) > 0 ) {
- char temp[32];
- read(fd, temp, sizeof(temp));
- }
-
- /* Query for the type of mouse protocol */
- if ( write(fd, &query_ps2, sizeof (query_ps2)) == sizeof (query_ps2)) {
- Uint8 ch = 0;
-
- /* Get the mouse protocol response */
- do {
- FD_ZERO(&fdset);
- FD_SET(fd, &fdset);
- tv.tv_sec = 1;
- tv.tv_usec = 0;
- if ( select(fd+1, &fdset, 0, 0, &tv) < 1 ) {
- break;
- }
- } while ( (read(fd, &ch, sizeof (ch)) == sizeof (ch)) &&
- ((ch == 0xFA) || (ch == 0xAA)) );
-
- /* Experimental values (Logitech wheelmouse) */
-#ifdef DEBUG_MOUSE
-fprintf(stderr, "Last mouse mode: 0x%x\n", ch);
-#endif
- if ( ch == 3 ) {
- imps2 = 1;
- }
- }
- }
- return imps2;
-}
-
-int GS_OpenMouse(_THIS)
-{
- int i;
- const char *mousedev;
- const char *mousedrv;
-
- mousedrv = SDL_getenv("SDL_MOUSEDRV");
- mousedev = SDL_getenv("SDL_MOUSEDEV");
- mouse_fd = -1;
-
- /* STD MICE */
-
- if ( mousedev == NULL ) {
- /* FIXME someday... allow multiple mice in this driver */
- char *ps2mice[] = {
- "/dev/input/mice", "/dev/usbmouse", "/dev/psaux", NULL
- };
- /* First try to use GPM in repeater mode */
- if ( mouse_fd < 0 ) {
- if ( gpm_available() ) {
- mouse_fd = open(GPM_NODE_FIFO, O_RDONLY, 0);
- if ( mouse_fd >= 0 ) {
-#ifdef DEBUG_MOUSE
-fprintf(stderr, "Using GPM mouse\n");
-#endif
- mouse_drv = MOUSE_GPM;
- }
- }
- }
- /* Now try to use a modern PS/2 mouse */
- for ( i=0; (mouse_fd < 0) && ps2mice[i]; ++i ) {
- mouse_fd = open(ps2mice[i], O_RDWR, 0);
- if (mouse_fd < 0) {
- mouse_fd = open(ps2mice[i], O_RDONLY, 0);
- }
- if (mouse_fd >= 0) {
- /* rcg06112001 Attempt to set IMPS/2 mode */
- if ( i == 0 ) {
- set_imps2_mode(mouse_fd);
- }
- if (detect_imps2(mouse_fd)) {
-#ifdef DEBUG_MOUSE
-fprintf(stderr, "Using IMPS2 mouse\n");
-#endif
- mouse_drv = MOUSE_IMPS2;
- } else {
- mouse_drv = MOUSE_PS2;
-#ifdef DEBUG_MOUSE
-fprintf(stderr, "Using PS2 mouse\n");
-#endif
- }
- }
- }
- /* Next try to use a PPC ADB port mouse */
- if ( mouse_fd < 0 ) {
- mouse_fd = open("/dev/adbmouse", O_RDONLY, 0);
- if ( mouse_fd >= 0 ) {
-#ifdef DEBUG_MOUSE
-fprintf(stderr, "Using ADB mouse\n");
-#endif
- mouse_drv = MOUSE_BM;
- }
- }
- }
- /* Default to a serial Microsoft mouse */
- if ( mouse_fd < 0 ) {
- if ( mousedev == NULL ) {
- mousedev = "/dev/mouse";
- }
- mouse_fd = open(mousedev, O_RDONLY, 0);
- if ( mouse_fd >= 0 ) {
- struct termios mouse_termios;
-
- /* Set the sampling speed to 1200 baud */
- tcgetattr(mouse_fd, &mouse_termios);
- mouse_termios.c_iflag = IGNBRK | IGNPAR;
- mouse_termios.c_oflag = 0;
- mouse_termios.c_lflag = 0;
- mouse_termios.c_line = 0;
- mouse_termios.c_cc[VTIME] = 0;
- mouse_termios.c_cc[VMIN] = 1;
- mouse_termios.c_cflag = CREAD | CLOCAL | HUPCL;
- mouse_termios.c_cflag |= CS8;
- mouse_termios.c_cflag |= B1200;
- tcsetattr(mouse_fd, TCSAFLUSH, &mouse_termios);
-#ifdef DEBUG_MOUSE
-fprintf(stderr, "Using Microsoft mouse on %s\n", mousedev);
-#endif
- mouse_drv = MOUSE_MS;
- }
- }
- if ( mouse_fd < 0 ) {
- mouse_drv = MOUSE_NONE;
- }
- return(mouse_fd);
-}
-
-static int posted = 0;
-
-void GS_vgamousecallback(int button, int dx, int dy)
-{
- int button_1, button_3;
- int button_state;
- int state_changed;
- int i;
- Uint8 state;
-
- if ( dx || dy ) {
- posted += SDL_PrivateMouseMotion(0, 1, dx, dy);
- }
-
- /* Swap button 1 and 3 */
- button_1 = (button & 0x04) >> 2;
- button_3 = (button & 0x01) << 2;
- button &= ~0x05;
- button |= (button_1|button_3);
-
- /* See what changed */
- button_state = SDL_GetMouseState(NULL, NULL);
- state_changed = button_state ^ button;
- for ( i=0; i<8; ++i ) {
- if ( state_changed & (1<<i) ) {
- if ( button & (1<<i) ) {
- state = SDL_PRESSED;
- } else {
- state = SDL_RELEASED;
- }
- posted += SDL_PrivateMouseButton(state, i+1, 0, 0);
- }
- }
-}
-
-/* For now, use GPM, PS/2, and MS protocols
- Driver adapted from the SVGAlib mouse driver code (taken from gpm, etc.)
- */
-static void handle_mouse(_THIS)
-{
- static int start = 0;
- static unsigned char mousebuf[BUFSIZ];
- int i, nread;
- int button = 0;
- int dx = 0, dy = 0;
- int packetsize = 0;
-
- /* Figure out the mouse packet size */
- switch (mouse_drv) {
- case MOUSE_NONE:
- /* Ack! */
- read(mouse_fd, mousebuf, BUFSIZ);
- return;
- case MOUSE_GPM:
- packetsize = 5;
- break;
- case MOUSE_IMPS2:
- packetsize = 4;
- break;
- case MOUSE_PS2:
- case MOUSE_MS:
- case MOUSE_BM:
- packetsize = 3;
- break;
- case NUM_MOUSE_DRVS:
- /* Uh oh.. */
- packetsize = 0;
- break;
- }
-
- /* Read as many packets as possible */
- nread = read(mouse_fd, &mousebuf[start], BUFSIZ-start);
- if ( nread < 0 ) {
- return;
- }
- nread += start;
-#ifdef DEBUG_MOUSE
- fprintf(stderr, "Read %d bytes from mouse, start = %d\n", nread, start);
-#endif
- for ( i=0; i<(nread-(packetsize-1)); i += packetsize ) {
- switch (mouse_drv) {
- case MOUSE_NONE:
- break;
- case MOUSE_GPM:
- /* GPM protocol has 0x80 in high byte */
- if ( (mousebuf[i] & 0xF8) != 0x80 ) {
- /* Go to next byte */
- i -= (packetsize-1);
- continue;
- }
- /* Get current mouse state */
- button = (~mousebuf[i]) & 0x07;
- dx = (signed char)(mousebuf[i+1]) +
- (signed char)(mousebuf[i+3]);
- dy = -((signed char)(mousebuf[i+2]) +
- (signed char)(mousebuf[i+4]));
- break;
- case MOUSE_PS2:
- /* PS/2 protocol has nothing in high byte */
- if ( (mousebuf[i] & 0xC0) != 0 ) {
- /* Go to next byte */
- i -= (packetsize-1);
- continue;
- }
- /* Get current mouse state */
- button = (mousebuf[i] & 0x04) >> 1 | /*Middle*/
- (mousebuf[i] & 0x02) >> 1 | /*Right*/
- (mousebuf[i] & 0x01) << 2; /*Left*/
- dx = (mousebuf[i] & 0x10) ?
- mousebuf[i+1] - 256 : mousebuf[i+1];
- dy = (mousebuf[i] & 0x20) ?
- -(mousebuf[i+2] - 256) : -mousebuf[i+2];
- break;
- case MOUSE_IMPS2:
- /* Get current mouse state */
- button = (mousebuf[i] & 0x04) >> 1 | /*Middle*/
- (mousebuf[i] & 0x02) >> 1 | /*Right*/
- (mousebuf[i] & 0x01) << 2 | /*Left*/
- (mousebuf[i] & 0x40) >> 3 | /* 4 */
- (mousebuf[i] & 0x80) >> 3; /* 5 */
- dx = (mousebuf[i] & 0x10) ?
- mousebuf[i+1] - 256 : mousebuf[i+1];
- dy = (mousebuf[i] & 0x20) ?
- -(mousebuf[i+2] - 256) : -mousebuf[i+2];
- switch (mousebuf[i+3]&0x0F) {
- case 0x0E: /* DX = +1 */
- case 0x02: /* DX = -1 */
- break;
- case 0x0F: /* DY = +1 (map button 4) */
- FB_vgamousecallback(button | (1<<3),
- 1, 0, 0);
- break;
- case 0x01: /* DY = -1 (map button 5) */
- FB_vgamousecallback(button | (1<<4),
- 1, 0, 0);
- break;
- }
- break;
- case MOUSE_MS:
- /* Microsoft protocol has 0x40 in high byte */
- if ( (mousebuf[i] & 0x40) != 0x40 ) {
- /* Go to next byte */
- i -= (packetsize-1);
- continue;
- }
- /* Get current mouse state */
- button = ((mousebuf[i] & 0x20) >> 3) |
- ((mousebuf[i] & 0x10) >> 4);
- dx = (signed char)(((mousebuf[i] & 0x03) << 6) |
- (mousebuf[i + 1] & 0x3F));
- dy = (signed char)(((mousebuf[i] & 0x0C) << 4) |
- (mousebuf[i + 2] & 0x3F));
- break;
- case MOUSE_BM:
- /* BusMouse protocol has 0xF8 in high byte */
- if ( (mousebuf[i] & 0xF8) != 0x80 ) {
- /* Go to next byte */
- i -= (packetsize-1);
- continue;
- }
- /* Get current mouse state */
- button = (~mousebuf[i]) & 0x07;
- dx = (signed char)mousebuf[i+1];
- dy = -(signed char)mousebuf[i+2];
- break;
- case NUM_MOUSE_DRVS:
- /* Uh oh.. */
- dx = 0;
- dy = 0;
- break;
- }
- GS_vgamousecallback(button, dx, dy);
- }
- if ( i < nread ) {
- SDL_memcpy(mousebuf, &mousebuf[i], (nread-i));
- start = (nread-i);
- } else {
- start = 0;
- }
- return;
-}
-
-static void handle_keyboard(_THIS)
-{
- unsigned char keybuf[BUFSIZ];
- int i, nread;
- int pressed;
- int scancode;
- SDL_keysym keysym;
-
- nread = read(keyboard_fd, keybuf, BUFSIZ);
- for ( i=0; i<nread; ++i ) {
- scancode = keybuf[i] & 0x7F;
- if ( keybuf[i] & 0x80 ) {
- pressed = SDL_RELEASED;
- } else {
- pressed = SDL_PRESSED;
- }
- TranslateKey(scancode, &keysym);
- posted += SDL_PrivateKeyboard(pressed, &keysym);
- }
-}
-
-void GS_PumpEvents(_THIS)
-{
- fd_set fdset;
- int max_fd;
- static struct timeval zero;
-
- do {
- posted = 0;
-
- FD_ZERO(&fdset);
- max_fd = 0;
- if ( keyboard_fd >= 0 ) {
- FD_SET(keyboard_fd, &fdset);
- if ( max_fd < keyboard_fd ) {
- max_fd = keyboard_fd;
- }
- }
- if ( mouse_fd >= 0 ) {
- FD_SET(mouse_fd, &fdset);
- if ( max_fd < mouse_fd ) {
- max_fd = mouse_fd;
- }
- }
- if ( select(max_fd+1, &fdset, NULL, NULL, &zero) > 0 ) {
- if ( keyboard_fd >= 0 ) {
- if ( FD_ISSET(keyboard_fd, &fdset) ) {
- handle_keyboard(this);
- }
- }
- if ( mouse_fd >= 0 ) {
- if ( FD_ISSET(mouse_fd, &fdset) ) {
- handle_mouse(this);
- }
- }
- }
- } while ( posted );
-}
-
-void GS_InitOSKeymap(_THIS)
-{
- int i;
-
- /* Initialize the Linux key translation table */
-
- /* First get the ascii keys and others not well handled */
- for (i=0; i<SDL_arraysize(keymap); ++i) {
- switch(i) {
- /* These aren't handled by the x86 kernel keymapping (?) */
- case SCANCODE_PRINTSCREEN:
- keymap[i] = SDLK_PRINT;
- break;
- case SCANCODE_BREAK:
- keymap[i] = SDLK_BREAK;
- break;
- case SCANCODE_BREAK_ALTERNATIVE:
- keymap[i] = SDLK_PAUSE;
- break;
- case SCANCODE_LEFTSHIFT:
- keymap[i] = SDLK_LSHIFT;
- break;
- case SCANCODE_RIGHTSHIFT:
- keymap[i] = SDLK_RSHIFT;
- break;
- case SCANCODE_LEFTCONTROL:
- keymap[i] = SDLK_LCTRL;
- break;
- case SCANCODE_RIGHTCONTROL:
- keymap[i] = SDLK_RCTRL;
- break;
- case SCANCODE_RIGHTWIN:
- keymap[i] = SDLK_RSUPER;
- break;
- case SCANCODE_LEFTWIN:
- keymap[i] = SDLK_LSUPER;
- break;
- case 127:
- keymap[i] = SDLK_MENU;
- break;
- /* this should take care of all standard ascii keys */
- default:
- keymap[i] = KVAL(vga_keymap[0][i]);
- break;
- }
- }
- for (i=0; i<SDL_arraysize(keymap); ++i) {
- switch(keymap_temp[i]) {
- case K_F1: keymap[i] = SDLK_F1; break;
- case K_F2: keymap[i] = SDLK_F2; break;
- case K_F3: keymap[i] = SDLK_F3; break;
- case K_F4: keymap[i] = SDLK_F4; break;
- case K_F5: keymap[i] = SDLK_F5; break;
- case K_F6: keymap[i] = SDLK_F6; break;
- case K_F7: keymap[i] = SDLK_F7; break;
- case K_F8: keymap[i] = SDLK_F8; break;
- case K_F9: keymap[i] = SDLK_F9; break;
- case K_F10: keymap[i] = SDLK_F10; break;
- case K_F11: keymap[i] = SDLK_F11; break;
- case K_F12: keymap[i] = SDLK_F12; break;
-
- case K_DOWN: keymap[i] = SDLK_DOWN; break;
- case K_LEFT: keymap[i] = SDLK_LEFT; break;
- case K_RIGHT: keymap[i] = SDLK_RIGHT; break;
- case K_UP: keymap[i] = SDLK_UP; break;
-
- case K_P0: keymap[i] = SDLK_KP0; break;
- case K_P1: keymap[i] = SDLK_KP1; break;
- case K_P2: keymap[i] = SDLK_KP2; break;
- case K_P3: keymap[i] = SDLK_KP3; break;
- case K_P4: keymap[i] = SDLK_KP4; break;
- case K_P5: keymap[i] = SDLK_KP5; break;
- case K_P6: keymap[i] = SDLK_KP6; break;
- case K_P7: keymap[i] = SDLK_KP7; break;
- case K_P8: keymap[i] = SDLK_KP8; break;
- case K_P9: keymap[i] = SDLK_KP9; break;
- case K_PPLUS: keymap[i] = SDLK_KP_PLUS; break;
- case K_PMINUS: keymap[i] = SDLK_KP_MINUS; break;
- case K_PSTAR: keymap[i] = SDLK_KP_MULTIPLY; break;
- case K_PSLASH: keymap[i] = SDLK_KP_DIVIDE; break;
- case K_PENTER: keymap[i] = SDLK_KP_ENTER; break;
- case K_PDOT: keymap[i] = SDLK_KP_PERIOD; break;
-
- case K_SHIFT: if ( keymap[i] != SDLK_RSHIFT )
- keymap[i] = SDLK_LSHIFT;
- break;
- case K_SHIFTL: keymap[i] = SDLK_LSHIFT; break;
- case K_SHIFTR: keymap[i] = SDLK_RSHIFT; break;
- case K_CTRL: if ( keymap[i] != SDLK_RCTRL )
- keymap[i] = SDLK_LCTRL;
- break;
- case K_CTRLL: keymap[i] = SDLK_LCTRL; break;
- case K_CTRLR: keymap[i] = SDLK_RCTRL; break;
- case K_ALT: keymap[i] = SDLK_LALT; break;
- case K_ALTGR: keymap[i] = SDLK_RALT; break;
-
- case K_INSERT: keymap[i] = SDLK_INSERT; break;
- case K_REMOVE: keymap[i] = SDLK_DELETE; break;
- case K_PGUP: keymap[i] = SDLK_PAGEUP; break;
- case K_PGDN: keymap[i] = SDLK_PAGEDOWN; break;
- case K_FIND: keymap[i] = SDLK_HOME; break;
- case K_SELECT: keymap[i] = SDLK_END; break;
-
- case K_NUM: keymap[i] = SDLK_NUMLOCK; break;
- case K_CAPS: keymap[i] = SDLK_CAPSLOCK; break;
-
- case K_F13: keymap[i] = SDLK_PRINT; break;
- case K_HOLD: keymap[i] = SDLK_SCROLLOCK; break;
- case K_PAUSE: keymap[i] = SDLK_PAUSE; break;
-
- case 127: keymap[i] = SDLK_BACKSPACE; break;
-
- default: break;
- }
- }
-}
-
-static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym)
-{
- /* Set the keysym information */
- keysym->scancode = scancode;
- keysym->sym = keymap[scancode];
- keysym->mod = KMOD_NONE;
-
- /* If UNICODE is on, get the UNICODE value for the key */
- keysym->unicode = 0;
- if ( SDL_TranslateUNICODE ) {
- int map;
- SDLMod modstate;
-
- modstate = SDL_GetModState();
- map = 0;
- if ( modstate & KMOD_SHIFT ) {
- map |= (1<<KG_SHIFT);
- }
- if ( modstate & KMOD_CTRL ) {
- map |= (1<<KG_CTRL);
- }
- if ( modstate & KMOD_ALT ) {
- map |= (1<<KG_ALT);
- }
- if ( modstate & KMOD_MODE ) {
- map |= (1<<KG_ALTGR);
- }
- if ( KTYP(vga_keymap[map][scancode]) == KT_LETTER ) {
- if ( modstate & KMOD_CAPS ) {
- map ^= (1<<KG_SHIFT);
- }
- }
- if ( KTYP(vga_keymap[map][scancode]) == KT_PAD ) {
- if ( modstate & KMOD_NUM ) {
- keysym->unicode=KVAL(vga_keymap[map][scancode]);
- }
- } else {
- keysym->unicode = KVAL(vga_keymap[map][scancode]);
- }
- }
- return(keysym);
-}
diff --git a/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsevents_c.h b/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsevents_c.h
deleted file mode 100644
index 515294a..0000000
--- a/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsevents_c.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_gsvideo.h"
-
-/* Variables and functions exported by SDL_sysevents.c to other parts
- of the native video subsystem (SDL_sysvideo.c)
-*/
-extern int GS_OpenKeyboard(_THIS);
-extern void GS_CloseKeyboard(_THIS);
-extern int GS_OpenMouse(_THIS);
-extern void GS_CloseMouse(_THIS);
-extern int GS_EnterGraphicsMode(_THIS);
-extern int GS_InGraphicsMode(_THIS);
-extern void GS_LeaveGraphicsMode(_THIS);
-
-extern void GS_InitOSKeymap(_THIS);
-extern void GS_PumpEvents(_THIS);
diff --git a/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsmouse.c b/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsmouse.c
deleted file mode 100644
index 50da179..0000000
--- a/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsmouse.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <sys/ioctl.h>
-
-#include "SDL_mouse.h"
-#include "../../events/SDL_events_c.h"
-#include "../SDL_cursor_c.h"
-#include "SDL_gsvideo.h"
-#include "SDL_gsmouse_c.h"
-
-
-/* The implementation dependent data for the window manager cursor */
-struct WMcursor {
- int unused;
-};
-
-/* There isn't any implementation dependent data */
-void GS_FreeWMCursor(_THIS, WMcursor *cursor)
-{
- return;
-}
-
-/* There isn't any implementation dependent data */
-WMcursor *GS_CreateWMCursor(_THIS,
- Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
-{
- return((WMcursor *)0x01);
-}
-
-static void GS_MoveCursor(_THIS, SDL_Cursor *cursor, int x, int y)
-{
- SDL_Surface *screen;
- struct ps2_image image;
- SDL_Rect area;
- int mouse_y1, mouse_y2;
- void *saved_pixels;
- int screen_updated;
-
- /* Lock so we don't interrupt an update with mouse motion */
- SDL_LockCursor();
-
- /* Make sure any pending DMA has completed */
- if ( dma_pending ) {
- ioctl(console_fd, PS2IOC_SENDQCT, 1);
- dma_pending = 0;
- }
-
- /* Remove the cursor image from the DMA area */
- screen = this->screen;
- saved_pixels = screen->pixels;
- screen->pixels = mapped_mem + screen->offset;
- screen_updated = 0;
- if ( cursor_drawn ) {
- SDL_EraseCursorNoLock(screen);
- cursor_drawn = 0;
- screen_updated = 1;
- }
-
- /* Save the current mouse area */
- SDL_MouseRect(&area);
- mouse_y1 = area.y;
- mouse_y2 = area.y+area.h;
-
- /* Only draw the new cursor if there was one passed in */
- if ( cursor ) {
- /* Set the new location */
- cursor->area.x = (x - cursor->hot_x);
- cursor->area.y = (y - cursor->hot_y);
-
- /* Draw the cursor at the new location */
- if ( (SDL_cursorstate & CURSOR_VISIBLE) && screen->pixels ) {
- SDL_DrawCursorNoLock(screen);
- cursor_drawn = 1;
- screen_updated = 1;
- }
- }
- screen->pixels = saved_pixels;
-
- /* Update the affected area of the screen */
- if ( screen_updated ) {
- SDL_MouseRect(&area);
- if ( area.y < mouse_y1 ) {
- mouse_y1 = area.y;
- }
- if ( (area.y+area.h) > mouse_y2 ) {
- mouse_y2 = area.y+area.h;
- }
- image = screen_image;
- image.y += screen->offset / screen->pitch + mouse_y1;
- image.h = mouse_y2 - mouse_y1;
- image.ptr = mapped_mem +
- (image.y - screen_image.y) * screen->pitch;
- ioctl(console_fd, PS2IOC_LOADIMAGE, &image);
-
- /* Need to scale offscreen image to TV output */
- if ( image.y > 0 ) {
- scaleimage_nonblock(console_fd,
- tex_tags_mem, scale_tags_mem);
- }
- }
-
- /* We're finished */
- SDL_UnlockCursor();
-}
-
-void GS_MoveWMCursor(_THIS, int x, int y)
-{
- GS_MoveCursor(this, SDL_cursor, x, y);
-}
-
-int GS_ShowWMCursor(_THIS, WMcursor *wmcursor)
-{
- SDL_Cursor *cursor;
- int x, y;
-
- /* Draw the cursor at the appropriate location */
- SDL_GetMouseState(&x, &y);
- if ( wmcursor ) {
- cursor = SDL_cursor;
- } else {
- cursor = NULL;
- }
- GS_MoveCursor(this, cursor, x, y);
- return(1);
-}
diff --git a/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsmouse_c.h b/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsmouse_c.h
deleted file mode 100644
index 72616a4..0000000
--- a/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsmouse_c.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_gsvideo.h"
-
-/* This is the maximum size of the cursor sprite */
-#define CURSOR_W 32
-#define CURSOR_H 32
-#define CURSOR_W_POW 5 /* 32 = 2^5 */
-#define CURSOR_H_POW 5 /* 32 = 2^5 */
-
-/* Functions to be exported */
-extern void GS_FreeWMCursor(_THIS, WMcursor *cursor);
-extern WMcursor *GS_CreateWMCursor(_THIS,
- Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
-extern void GS_MoveWMCursor(_THIS, int x, int y);
-extern int GS_ShowWMCursor(_THIS, WMcursor *cursor);
diff --git a/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsvideo.c b/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsvideo.c
deleted file mode 100644
index 878b32a..0000000
--- a/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsvideo.c
+++ /dev/null
@@ -1,689 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Framebuffer console based SDL video driver implementation.
-*/
-
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-#include "../SDL_cursor_c.h"
-#include "SDL_gsvideo.h"
-#include "SDL_gsmouse_c.h"
-#include "SDL_gsevents_c.h"
-#include "SDL_gsyuv_c.h"
-
-
-/* Initialization/Query functions */
-static int GS_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **GS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *GS_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int GS_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
-static void GS_VideoQuit(_THIS);
-
-/* Hardware surface functions */
-static int GS_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int GS_LockHWSurface(_THIS, SDL_Surface *surface);
-static void GS_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static void GS_FreeHWSurface(_THIS, SDL_Surface *surface);
-
-/* GS driver bootstrap functions */
-
-static int GS_Available(void)
-{
- int console, memory;
-
- console = open(PS2_DEV_GS, O_RDWR, 0);
- if ( console >= 0 ) {
- close(console);
- }
- memory = open(PS2_DEV_MEM, O_RDWR, 0);
- if ( memory >= 0 ) {
- close(memory);
- }
- return((console >= 0) && (memory >= 0));
-}
-
-static void GS_DeleteDevice(SDL_VideoDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_VideoDevice *GS_CreateDevice(int devindex)
-{
- SDL_VideoDevice *this;
-
- /* Initialize all variables that we clean on shutdown */
- this = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( this ) {
- SDL_memset(this, 0, (sizeof *this));
- this->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *this->hidden));
- }
- if ( (this == NULL) || (this->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( this ) {
- SDL_free(this);
- }
- return(0);
- }
- SDL_memset(this->hidden, 0, (sizeof *this->hidden));
- mouse_fd = -1;
- keyboard_fd = -1;
-
- /* Set the function pointers */
- this->VideoInit = GS_VideoInit;
- this->ListModes = GS_ListModes;
- this->SetVideoMode = GS_SetVideoMode;
- this->CreateYUVOverlay = GS_CreateYUVOverlay;
- this->SetColors = GS_SetColors;
- this->UpdateRects = NULL;
- this->VideoQuit = GS_VideoQuit;
- this->AllocHWSurface = GS_AllocHWSurface;
- this->CheckHWBlit = NULL;
- this->FillHWRect = NULL;
- this->SetHWColorKey = NULL;
- this->SetHWAlpha = NULL;
- this->LockHWSurface = GS_LockHWSurface;
- this->UnlockHWSurface = GS_UnlockHWSurface;
- this->FlipHWSurface = NULL;
- this->FreeHWSurface = GS_FreeHWSurface;
- this->SetIcon = NULL;
- this->SetCaption = NULL;
- this->GetWMInfo = NULL;
- this->FreeWMCursor = GS_FreeWMCursor;
- this->CreateWMCursor = GS_CreateWMCursor;
- this->ShowWMCursor = GS_ShowWMCursor;
- this->MoveWMCursor = GS_MoveWMCursor;
- this->InitOSKeymap = GS_InitOSKeymap;
- this->PumpEvents = GS_PumpEvents;
-
- this->free = GS_DeleteDevice;
-
- return this;
-}
-
-VideoBootStrap PS2GS_bootstrap = {
- "ps2gs", "PlayStation 2 Graphics Synthesizer",
- GS_Available, GS_CreateDevice
-};
-
-/* These are the pixel formats for the 32, 24, and 16 bit video modes */
-static struct {
- int bpp;
- Uint32 r;
- Uint32 g;
- Uint32 b;
-} GS_pixelmasks[] = {
- { 32, 0x000000FF, /* RGB little-endian */
- 0x0000FF00,
- 0x00FF0000 },
- { 24, 0x000000FF, /* RGB little-endian */
- 0x0000FF00,
- 0x00FF0000 },
- { 16, 0x0000001f, /* RGB little-endian */
- 0x000003e0,
- 0x00007c00 },
-};
-/* This is a mapping from SDL bytes-per-pixel to GS pixel format */
-static int GS_formatmap[] = {
- -1, /* 0 bpp, not a legal value */
- -1, /* 8 bpp, not supported (yet?) */
- PS2_GS_PSMCT16, /* 16 bpp */
- PS2_GS_PSMCT24, /* 24 bpp */
- PS2_GS_PSMCT32 /* 32 bpp */
-};
-
-static unsigned long long head_tags[] __attribute__((aligned(16))) = {
- 4 | (1LL << 60), /* GIFtag */
- 0x0e, /* A+D */
- 0, /* 2 */
- PS2_GS_BITBLTBUF,
- 0, /* 4 */
- PS2_GS_TRXPOS,
- 0, /* 6 */
- PS2_GS_TRXREG,
- 0, /* 8 */
- PS2_GS_TRXDIR
-};
-
-#define MAXIMG (32767 * 16)
-#define MAXTAGS 8
-
-static inline int loadimage_nonblock(int fd, struct ps2_image *image, int size,
- unsigned long long *hm,
- unsigned long long *im)
-{
- struct ps2_plist plist;
- struct ps2_packet packet[1 + MAXTAGS * 2];
- int isize;
- int pnum, it, eop;
- char *data;
-
- /* initialize the variables */
- data = (char *)image->ptr;
- pnum = it = eop = 0;
- plist.packet = packet;
-
- /* make BITBLT packet */
- packet[pnum].ptr = hm;
- packet[pnum].len = sizeof(head_tags);
- pnum++;
- hm[2] = ((unsigned long long)image->fbp << 32) |
- ((unsigned long long)image->fbw << 48) |
- ((unsigned long long)image->psm << 56);
- hm[4] = ((unsigned long long)image->x << 32) |
- ((unsigned long long)image->y << 48);
- hm[6] = (unsigned long long)image->w |
- ((unsigned long long)image->h << 32);
-
- /* make image mode tags */
- while (!eop) {
- isize = size > MAXIMG ? MAXIMG : size;
- size -= isize;
- eop = (size == 0);
-
- packet[pnum].ptr = &im[it];
- packet[pnum].len = sizeof(unsigned long long) * 2;
- pnum++;
- im[it++] = (isize >> 4) | (eop ? (1 << 15) : 0) | (2LL << 58);
- im[it++] = 0;
-
- packet[pnum].ptr = (void *)data;
- packet[pnum].len = isize;
- pnum++;
- data += isize;
- }
- plist.num = pnum;
-
- return ioctl(fd, PS2IOC_SENDL, &plist);
-}
-
-static unsigned long long tex_tags[] __attribute__((aligned(16))) = {
- 3 | (1LL << 60), /* GIFtag */
- 0x0e, /* A+D */
- 0, /* 2 */
- PS2_GS_TEX0_1,
- (1 << 5) + (1 << 6),
- PS2_GS_TEX1_1,
- 0,
- PS2_GS_TEXFLUSH
-};
-static unsigned long long scale_tags[] __attribute__((aligned(16))) = {
- 5 | (1LL << 60), /* GIFtag */
- 0x0e, /* A+D */
- 6 + (1 << 4) + (1 << 8),
- PS2_GS_PRIM,
- ((unsigned long long)0 * 16) + (((unsigned long long)0 * 16) << 16),
- PS2_GS_UV,
- ((unsigned long long)0 * 16) + (((unsigned long long)0 * 16) << 16),
- PS2_GS_XYZ2,
- 0, /* 8 */
- PS2_GS_UV,
- 0, /* 10 */
- PS2_GS_XYZ2
-};
-
-
-int scaleimage_nonblock(int fd, unsigned long long *tm, unsigned long long *sm)
-{
- struct ps2_plist plist;
- struct ps2_packet packet[2];
-
- /* initialize the variables */
- plist.num = 2;
- plist.packet = packet;
-
- packet[0].ptr = tm;
- packet[0].len = sizeof(tex_tags);
- packet[1].ptr = sm;
- packet[1].len = sizeof(scale_tags);
-
- return ioctl(fd, PS2IOC_SENDL, &plist);
-}
-
-static int power_of_2(int value)
-{
- int shift;
-
- for ( shift = 0; (1<<shift) < value; ++shift ) {
- /* Keep looking */ ;
- }
- return(shift);
-}
-
-static int GS_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- struct ps2_screeninfo vinfo;
-
- /* Initialize the library */
- console_fd = open(PS2_DEV_GS, O_RDWR, 0);
- if ( console_fd < 0 ) {
- SDL_SetError("Unable to open %s", PS2_DEV_GS);
- return(-1);
- }
- memory_fd = open(PS2_DEV_MEM, O_RDWR, 0);
- if ( memory_fd < 0 ) {
- close(console_fd);
- console_fd = -1;
- SDL_SetError("Unable to open %s", PS2_DEV_MEM);
- return(-1);
- }
-
- if ( ioctl(console_fd, PS2IOC_GSCREENINFO, &vinfo) < 0 ) {
- close(memory_fd);
- close(console_fd);
- console_fd = -1;
- SDL_SetError("Couldn't get console pixel format");
- return(-1);
- }
-
- /* Determine the current screen size */
- this->info.current_w = vinfo.w;
- this->info.current_h = vinfo.h;
-
- /* Determine the current screen depth */
- switch (vinfo.psm) {
- /* Supported pixel formats */
- case PS2_GS_PSMCT32:
- case PS2_GS_PSMCT24:
- case PS2_GS_PSMCT16:
- break;
- default:
- GS_VideoQuit(this);
- SDL_SetError("Unknown console pixel format: %d", vinfo.psm);
- return(-1);
- }
- vformat->BitsPerPixel = GS_pixelmasks[vinfo.psm].bpp;
- vformat->Rmask = GS_pixelmasks[vinfo.psm].r;
- vformat->Gmask = GS_pixelmasks[vinfo.psm].g;
- vformat->Bmask = GS_pixelmasks[vinfo.psm].b;
- saved_vinfo = vinfo;
-
- /* Enable mouse and keyboard support */
- if ( GS_OpenKeyboard(this) < 0 ) {
- GS_VideoQuit(this);
- SDL_SetError("Unable to open keyboard");
- return(-1);
- }
- if ( GS_OpenMouse(this) < 0 ) {
- const char *sdl_nomouse;
-
- sdl_nomouse = SDL_getenv("SDL_NOMOUSE");
- if ( ! sdl_nomouse ) {
- GS_VideoQuit(this);
- SDL_SetError("Unable to open mouse");
- return(-1);
- }
- }
-
- /* We're done! */
- return(0);
-}
-
-static SDL_Rect **GS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- static SDL_Rect GS_vesa_mode_list[] = {
- { 0, 0, 1280, 1024 },
- { 0, 0, 1024, 768 },
- { 0, 0, 800, 600 },
- { 0, 0, 640, 480 }
- };
- static SDL_Rect *GS_vesa_modes[] = {
- &GS_vesa_mode_list[0],
- &GS_vesa_mode_list[1],
- &GS_vesa_mode_list[2],
- &GS_vesa_mode_list[3],
- NULL
- };
- static SDL_Rect GS_tvout_stretch;
- static SDL_Rect GS_tvout_mode;
- static SDL_Rect *GS_tvout_modes[3];
- SDL_Rect **modes = NULL;
-
- switch (format->BitsPerPixel) {
- case 16:
- case 24:
- case 32:
- if ( saved_vinfo.mode == PS2_GS_VESA ) {
- modes = GS_vesa_modes;
- } else {
- int i, j = 0;
-
-// FIXME - what's wrong with the stretch code at 16 bpp?
-if ( format->BitsPerPixel != 32 ) break;
- /* Add a mode that we could possibly stretch to */
- for ( i=0; GS_vesa_modes[i]; ++i ) {
- if ( (GS_vesa_modes[i]->w == saved_vinfo.w) &&
- (GS_vesa_modes[i]->h != saved_vinfo.h) ) {
- GS_tvout_stretch.w=GS_vesa_modes[i]->w;
- GS_tvout_stretch.h=GS_vesa_modes[i]->h;
- GS_tvout_modes[j++] = &GS_tvout_stretch;
- break;
- }
- }
- /* Add the current TV video mode */
- GS_tvout_mode.w = saved_vinfo.w;
- GS_tvout_mode.h = saved_vinfo.h;
- GS_tvout_modes[j++] = &GS_tvout_mode;
- GS_tvout_modes[j++] = NULL;
-
- /* Return the created list of modes */
- modes = GS_tvout_modes;
- }
- break;
- default:
- break;
- }
- return(modes);
-}
-
-/* Various screen update functions available */
-static void GS_DMAFullUpdate(_THIS, int numrects, SDL_Rect *rects);
-
-static SDL_Surface *GS_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- struct ps2_screeninfo vinfo;
-
- /* Set the terminal into graphics mode */
- if ( GS_EnterGraphicsMode(this) < 0 ) {
- return(NULL);
- }
-
- /* Set the video mode and get the final screen format */
- if ( ioctl(console_fd, PS2IOC_GSCREENINFO, &vinfo) < 0 ) {
- SDL_SetError("Couldn't get console screen info");
- return(NULL);
- }
- if ( (vinfo.w != width) || (vinfo.h != height) ||
- (GS_pixelmasks[vinfo.psm].bpp != bpp) ) {
- /* If we're not in VESA mode, we have to scale resolution */
- if ( saved_vinfo.mode == PS2_GS_VESA ) {
- switch (width) {
- case 640:
- vinfo.res = PS2_GS_640x480;
- break;
- case 800:
- vinfo.res = PS2_GS_800x600;
- break;
- case 1024:
- vinfo.res = PS2_GS_1024x768;
- break;
- case 1280:
- vinfo.res = PS2_GS_1280x1024;
- break;
- default:
- SDL_SetError("Unsupported resolution: %dx%d\n",
- width, height);
- return(NULL);
- }
- vinfo.res |= (PS2_GS_75Hz << 8);
- vinfo.w = width;
- vinfo.h = height;
- }
- vinfo.fbp = 0;
- vinfo.psm = GS_formatmap[bpp/8];
- if ( vinfo.psm < 0 ) {
- SDL_SetError("Unsupported depth: %d bpp\n", bpp);
- return(NULL);
- }
- if ( ioctl(console_fd, PS2IOC_SSCREENINFO, &vinfo) < 0 ) {
- SDL_SetError("Couldn't set console screen info");
- return(NULL);
- }
-
- /* Unmap the previous DMA buffer */
- if ( mapped_mem ) {
- munmap(mapped_mem, mapped_len);
- mapped_mem = NULL;
- }
- }
- if ( ! SDL_ReallocFormat(current, GS_pixelmasks[vinfo.psm].bpp,
- GS_pixelmasks[vinfo.psm].r,
- GS_pixelmasks[vinfo.psm].g,
- GS_pixelmasks[vinfo.psm].b, 0) ) {
- return(NULL);
- }
-
- /* Set up the new mode framebuffer */
- current->flags = SDL_FULLSCREEN;
- current->w = width;
- current->h = height;
- current->pitch = SDL_CalculatePitch(current);
-
- /* Memory map the DMA area for block memory transfer */
- if ( ! mapped_mem ) {
- pixels_len = height * current->pitch;
- mapped_len = pixels_len +
- /* Screen update DMA command area */
- sizeof(head_tags) + ((2 * MAXTAGS) * 16);
- if ( saved_vinfo.mode != PS2_GS_VESA ) {
- mapped_len += sizeof(tex_tags) + sizeof(scale_tags);
- }
- mapped_mem = mmap(0, mapped_len, PROT_READ|PROT_WRITE,
- MAP_SHARED, memory_fd, 0);
- if ( mapped_mem == MAP_FAILED ) {
- SDL_SetError("Unable to map %d bytes for DMA",
- mapped_len);
- mapped_mem = NULL;
- return(NULL);
- }
-
- /* Set up the entire screen for DMA transfer */
- screen_image.ptr = mapped_mem;
- screen_image.fbp = 0;
- screen_image.fbw = (vinfo.w + 63) / 64;
- screen_image.psm = vinfo.psm;
- screen_image.x = 0;
- if ( vinfo.h == height ) {
- screen_image.y = 0;
- } else {
- /* Put image offscreen and scale to screen height */
- screen_image.y = vinfo.h;
- }
- screen_image.w = current->w;
- screen_image.h = current->h;
-
- /* get screen image data size (qword aligned) */
- screen_image_size = (screen_image.w * screen_image.h);
- switch (screen_image.psm) {
- case PS2_GS_PSMCT32:
- screen_image_size *= 4;
- break;
- case PS2_GS_PSMCT24:
- screen_image_size *= 3;
- break;
- case PS2_GS_PSMCT16:
- screen_image_size *= 2;
- break;
- }
- screen_image_size = (screen_image_size + 15) & ~15;
-
- /* Set up the memory for screen update DMA commands */
- head_tags_mem = (unsigned long long *)
- (mapped_mem + pixels_len);
- image_tags_mem = (unsigned long long *)
- ((caddr_t)head_tags_mem + sizeof(head_tags));
- SDL_memcpy(head_tags_mem, head_tags, sizeof(head_tags));
- if ( saved_vinfo.mode != PS2_GS_VESA ) {
- tex_tags_mem = (unsigned long long *)
- ((caddr_t)image_tags_mem + ((2*MAXTAGS)*16));
- scale_tags_mem = (unsigned long long *)
- ((caddr_t)tex_tags_mem + sizeof(tex_tags));
- SDL_memcpy(tex_tags_mem, tex_tags, sizeof(tex_tags));
- tex_tags_mem[2] =
- (vinfo.h * vinfo.w) / 64 +
- ((unsigned long long)screen_image.fbw << 14) +
- ((unsigned long long)screen_image.psm << 20) +
- ((unsigned long long)power_of_2(screen_image.w) << 26) +
- ((unsigned long long)power_of_2(screen_image.h) << 30) +
- ((unsigned long long)1 << 34) +
- ((unsigned long long)1 << 35);
- SDL_memcpy(scale_tags_mem, scale_tags, sizeof(scale_tags));
- scale_tags_mem[8] =
- ((unsigned long long)screen_image.w * 16) +
- (((unsigned long long)screen_image.h * 16) << 16);
- scale_tags_mem[10] =
- ((unsigned long long)vinfo.w * 16) +
- (((unsigned long long)vinfo.h * 16) << 16);
- }
- }
- current->pixels = NULL;
- if ( SDL_getenv("SDL_FULLSCREEN_UPDATE") ) {
- /* Correct semantics */
- current->flags |= SDL_ASYNCBLIT;
- } else {
- /* We lie here - the screen memory isn't really the visible
- display memory and still requires an update, but this
- has the desired effect for most applications.
- */
- current->flags |= SDL_HWSURFACE;
- }
-
- /* Set the update rectangle function */
- this->UpdateRects = GS_DMAFullUpdate;
-
- /* We're done */
- return(current);
-}
-
-/* We don't support hardware surfaces yet */
-static int GS_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- return(-1);
-}
-static void GS_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-static int GS_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- if ( surface == this->screen ) {
- /* Since mouse motion affects 'pixels', lock it */
- SDL_LockCursor();
-
- /* Make sure any pending DMA has completed */
- if ( dma_pending ) {
- ioctl(console_fd, PS2IOC_SENDQCT, 1);
- dma_pending = 0;
- }
-
- /* If the cursor is drawn on the DMA area, remove it */
- if ( cursor_drawn ) {
- surface->pixels = mapped_mem + surface->offset;
- SDL_EraseCursorNoLock(this->screen);
- cursor_drawn = 0;
- }
-
- /* Set the surface pixels to the base of the DMA area */
- surface->pixels = mapped_mem;
-
- /* We're finished! */
- SDL_UnlockCursor();
- }
- return(0);
-}
-static void GS_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- if ( surface == this->screen ) {
- /* Since mouse motion affects 'pixels', lock it */
- SDL_LockCursor();
- surface->pixels = NULL;
- SDL_UnlockCursor();
- }
-}
-
-static void GS_DMAFullUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- /* Lock so we aren't interrupted by a mouse update */
- SDL_LockCursor();
-
- /* Make sure any pending DMA has completed */
- if ( dma_pending ) {
- ioctl(console_fd, PS2IOC_SENDQCT, 1);
- dma_pending = 0;
- }
-
- /* If the mouse is visible, draw it on the DMA area */
- if ( (SDL_cursorstate & CURSOR_VISIBLE) && !cursor_drawn ) {
- this->screen->pixels = mapped_mem + this->screen->offset;
- SDL_DrawCursorNoLock(this->screen);
- this->screen->pixels = NULL;
- cursor_drawn = 1;
- }
-
- /* Put the image onto the screen */
- loadimage_nonblock(console_fd,
- &screen_image, screen_image_size,
- head_tags_mem, image_tags_mem);
- if ( screen_image.y > 0 ) {
- /* Need to scale offscreen image to TV output */
- ioctl(console_fd, PS2IOC_SENDQCT, 1);
- dma_pending = 0;
- scaleimage_nonblock(console_fd, tex_tags_mem, scale_tags_mem);
- } else {
- dma_pending = 1;
- }
-
- /* We're finished! */
- SDL_UnlockCursor();
-}
-
-static int GS_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- return(0);
-}
-
-static void GS_VideoQuit(_THIS)
-{
- /* Close console and input file descriptors */
- if ( console_fd > 0 ) {
- /* Unmap the video framebuffer */
- if ( mapped_mem ) {
- /* Unmap the video framebuffer */
- munmap(mapped_mem, mapped_len);
- mapped_mem = NULL;
- }
- close(memory_fd);
-
- /* Restore the original video mode */
- if ( GS_InGraphicsMode(this) ) {
- ioctl(console_fd, PS2IOC_SSCREENINFO, &saved_vinfo);
- }
-
- /* We're all done with the graphics device */
- close(console_fd);
- console_fd = -1;
- }
- GS_CloseMouse(this);
- GS_CloseKeyboard(this);
-}
diff --git a/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsvideo.h b/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsvideo.h
deleted file mode 100644
index e811311..0000000
--- a/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsvideo.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_gsvideo_h
-#define _SDL_gsvideo_h
-
-#include <sys/types.h>
-#include <termios.h>
-#include <linux/ps2/dev.h>
-#include <linux/ps2/gs.h>
-
-#include "SDL_mouse.h"
-#include "SDL_mutex.h"
-#include "../SDL_sysvideo.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-
-/* Private display data */
-struct SDL_PrivateVideoData {
- /* Gotta love that simple PS2 graphics interface. :) */
- int console_fd;
- int memory_fd;
- struct ps2_screeninfo saved_vinfo;
-
- /* Ye olde linux keyboard code */
- int current_vt;
- int saved_vt;
- int keyboard_fd;
- int saved_kbd_mode;
- struct termios saved_kbd_termios;
-
- /* Ye olde linux mouse code */
- int mouse_fd;
- int cursor_drawn;
-
- /* The memory mapped DMA area and associated variables */
- caddr_t mapped_mem;
- int pixels_len;
- int mapped_len;
- struct ps2_image screen_image;
- int screen_image_size;
- unsigned long long *head_tags_mem;
- unsigned long long *image_tags_mem;
- unsigned long long *tex_tags_mem;
- unsigned long long *scale_tags_mem;
- int dma_pending;
-};
-/* Old variable names */
-#define console_fd (this->hidden->console_fd)
-#define memory_fd (this->hidden->memory_fd)
-#define saved_vinfo (this->hidden->saved_vinfo)
-#define current_vt (this->hidden->current_vt)
-#define saved_vt (this->hidden->saved_vt)
-#define keyboard_fd (this->hidden->keyboard_fd)
-#define saved_kbd_mode (this->hidden->saved_kbd_mode)
-#define saved_kbd_termios (this->hidden->saved_kbd_termios)
-#define mouse_fd (this->hidden->mouse_fd)
-#define cursor_drawn (this->hidden->cursor_drawn)
-#define mapped_mem (this->hidden->mapped_mem)
-#define pixels_len (this->hidden->pixels_len)
-#define mapped_len (this->hidden->mapped_len)
-#define screen_image (this->hidden->screen_image)
-#define screen_image_size (this->hidden->screen_image_size)
-#define head_tags_mem (this->hidden->head_tags_mem)
-#define image_tags_mem (this->hidden->image_tags_mem)
-#define tex_tags_mem (this->hidden->tex_tags_mem)
-#define scale_tags_mem (this->hidden->scale_tags_mem)
-#define dma_pending (this->hidden->dma_pending)
-
-/* Shared between the mouse and video code for screen update scaling */
-extern int scaleimage_nonblock(int fd,
- unsigned long long *tm, unsigned long long *sm);
-#endif /* _SDL_gsvideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsyuv.c b/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsyuv.c
deleted file mode 100644
index 849633c..0000000
--- a/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsyuv.c
+++ /dev/null
@@ -1,461 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This is the Playstation 2 implementation of YUV video overlays */
-
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <asm/page.h> /* For definition of PAGE_SIZE */
-
-#include "SDL_video.h"
-#include "SDL_gsyuv_c.h"
-#include "../SDL_yuvfuncs.h"
-
-/* The maximum number of 16x16 pixel block converted at once */
-#define MAX_MACROBLOCKS 1024 /* 2^10 macroblocks at once */
-
-/* The functions used to manipulate video overlays */
-static struct private_yuvhwfuncs gs_yuvfuncs = {
- GS_LockYUVOverlay,
- GS_UnlockYUVOverlay,
- GS_DisplayYUVOverlay,
- GS_FreeYUVOverlay
-};
-
-struct private_yuvhwdata {
- int ipu_fd;
- Uint8 *pixels;
- int macroblocks;
- int dma_len;
- caddr_t dma_mem;
- caddr_t ipu_imem;
- caddr_t ipu_omem;
- caddr_t dma_tags;
- unsigned long long *stretch_x1y1;
- unsigned long long *stretch_x2y2;
- struct ps2_plist plist;
-
- /* These are just so we don't have to allocate them separately */
- Uint16 pitches[3];
- Uint8 *planes[3];
-};
-
-static int power_of_2(int value)
-{
- int shift;
-
- for ( shift = 0; (1<<shift) < value; ++shift ) {
- /* Keep looking */ ;
- }
- return(shift);
-}
-
-SDL_Overlay *GS_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display)
-{
- SDL_Overlay *overlay;
- struct private_yuvhwdata *hwdata;
- int map_offset;
- unsigned long long *tags;
- caddr_t base;
- int bpp;
- int fbp, fbw, psm;
- int x, y, w, h;
- int pnum;
- struct ps2_packet *packet;
- struct ps2_packet tex_packet;
-
- /* We can only decode blocks of 16x16 pixels */
- if ( (width & 15) || (height & 15) ) {
- SDL_SetError("Overlay width/height must be multiples of 16");
- return(NULL);
- }
- /* Make sure the image isn't too large for a single DMA transfer */
- if ( ((width/16) * (height/16)) > MAX_MACROBLOCKS ) {
- SDL_SetError("Overlay too large (maximum size: %d pixels)",
- MAX_MACROBLOCKS * 16 * 16);
- return(NULL);
- }
-
- /* Double-check the requested format. For simplicity, we'll only
- support planar YUV formats.
- */
- switch (format) {
- case SDL_YV12_OVERLAY:
- case SDL_IYUV_OVERLAY:
- /* Supported planar YUV format */
- break;
- default:
- SDL_SetError("Unsupported YUV format");
- return(NULL);
- }
-
- /* Create the overlay structure */
- overlay = (SDL_Overlay *)SDL_malloc(sizeof *overlay);
- if ( overlay == NULL ) {
- SDL_OutOfMemory();
- return(NULL);
- }
- SDL_memset(overlay, 0, (sizeof *overlay));
-
- /* Fill in the basic members */
- overlay->format = format;
- overlay->w = width;
- overlay->h = height;
-
- /* Set up the YUV surface function structure */
- overlay->hwfuncs = &gs_yuvfuncs;
- overlay->hw_overlay = 1;
-
- /* Create the pixel data */
- hwdata = (struct private_yuvhwdata *)SDL_malloc(sizeof *hwdata);
- overlay->hwdata = hwdata;
- if ( hwdata == NULL ) {
- SDL_FreeYUVOverlay(overlay);
- SDL_OutOfMemory();
- return(NULL);
- }
- hwdata->ipu_fd = -1;
- hwdata->pixels = (Uint8 *)SDL_malloc(width*height*2);
- if ( hwdata->pixels == NULL ) {
- SDL_FreeYUVOverlay(overlay);
- SDL_OutOfMemory();
- return(NULL);
- }
- hwdata->macroblocks = (width/16) * (height/16);
-
- /* Find the pitch and offset values for the overlay */
- overlay->pitches = hwdata->pitches;
- overlay->pixels = hwdata->planes;
- switch (format) {
- case SDL_YV12_OVERLAY:
- case SDL_IYUV_OVERLAY:
- overlay->pitches[0] = overlay->w;
- overlay->pitches[1] = overlay->pitches[0] / 2;
- overlay->pitches[2] = overlay->pitches[0] / 2;
- overlay->pixels[0] = hwdata->pixels;
- overlay->pixels[1] = overlay->pixels[0] +
- overlay->pitches[0] * overlay->h;
- overlay->pixels[2] = overlay->pixels[1] +
- overlay->pitches[1] * overlay->h / 2;
- overlay->planes = 3;
- break;
- default:
- /* We should never get here (caught above) */
- break;
- }
-
- /* Theoretically we could support several concurrent decode
- streams queueing up on the same file descriptor, but for
- simplicity we'll support only one. Opening the IPU more
- than once will fail with EBUSY.
- */
- hwdata->ipu_fd = open("/dev/ps2ipu", O_RDWR);
- if ( hwdata->ipu_fd < 0 ) {
- SDL_FreeYUVOverlay(overlay);
- SDL_SetError("Playstation 2 IPU busy");
- return(NULL);
- }
-
- /* Allocate a DMA area for pixel conversion */
- bpp = this->screen->format->BytesPerPixel;
- map_offset = (mapped_len + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
- hwdata->dma_len = hwdata->macroblocks * (16 * 16 + 8 * 8 + 8 * 8) +
- width * height * bpp +
- hwdata->macroblocks * (16 * sizeof(long long)) +
- 12 * sizeof(long long);
- hwdata->dma_mem = mmap(0, hwdata->dma_len, PROT_READ|PROT_WRITE,
- MAP_SHARED, memory_fd, map_offset);
- if ( hwdata->dma_mem == MAP_FAILED ) {
- hwdata->ipu_imem = (caddr_t)0;
- SDL_FreeYUVOverlay(overlay);
- SDL_SetError("Unable to map %d bytes for DMA", hwdata->dma_len);
- return(NULL);
- }
- hwdata->ipu_imem = hwdata->dma_mem;
- hwdata->ipu_omem = hwdata->ipu_imem +
- hwdata->macroblocks * (16 * 16 + 8 * 8 + 8 * 8);
- hwdata->dma_tags = hwdata->ipu_omem + width * height * bpp;
-
- /* Allocate memory for the DMA packets */
- hwdata->plist.num = hwdata->macroblocks * 4 + 1;
- hwdata->plist.packet = (struct ps2_packet *)SDL_malloc(
- hwdata->plist.num*sizeof(struct ps2_packet));
- if ( ! hwdata->plist.packet ) {
- SDL_FreeYUVOverlay(overlay);
- SDL_OutOfMemory();
- return(NULL);
- }
- pnum = 0;
- packet = hwdata->plist.packet;
-
- /* Set up the tags to send the image to the screen */
- tags = (unsigned long long *)hwdata->dma_tags;
- base = hwdata->ipu_omem;
- fbp = screen_image.fbp;
- fbw = screen_image.fbw;
- psm = screen_image.psm;
- y = screen_image.y + screen_image.h; /* Offscreen video memory */
- for ( h=height/16; h; --h ) {
- x = 0; /* Visible video memory */
- for ( w=width/16; w; --w ) {
- /* The head tag */
- packet[pnum].ptr = &tags[0];
- packet[pnum].len = 10 * sizeof(*tags);
- ++pnum;
- tags[0] = 4 | (1LL << 60); /* GIFtag */
- tags[1] = 0x0e; /* A+D */
- tags[2] = ((unsigned long long)fbp << 32) |
- ((unsigned long long)fbw << 48) |
- ((unsigned long long)psm << 56);
- tags[3] = PS2_GS_BITBLTBUF;
- tags[4] = ((unsigned long long)x << 32) |
- ((unsigned long long)y << 48);
- tags[5] = PS2_GS_TRXPOS;
- tags[6] = (unsigned long long)16 |
- ((unsigned long long)16 << 32);
- tags[7] = PS2_GS_TRXREG;
- tags[8] = 0;
- tags[9] = PS2_GS_TRXDIR;
- /* Now the actual image data */
- packet[pnum].ptr = &tags[10];
- packet[pnum].len = 2 * sizeof(*tags);
- ++pnum;
- tags[10] = ((16*16*bpp) >> 4) | (2LL << 58);
- tags[11] = 0;
- packet[pnum].ptr = (void *)base;
- packet[pnum].len = 16 * 16 * bpp;
- ++pnum;
- packet[pnum].ptr = &tags[12];
- packet[pnum].len = 2 * sizeof(*tags);
- ++pnum;
- tags[12] = (0 >> 4) | (1 << 15) | (2LL << 58);
- tags[13] = 0;
-
- tags += 16;
- base += 16 * 16 * bpp;
-
- x += 16;
- }
- y += 16;
- }
-
- /* Set up the texture memory area for the video */
- tex_packet.ptr = tags;
- tex_packet.len = 8 * sizeof(*tags);
- tags[0] = 3 | (1LL << 60); /* GIFtag */
- tags[1] = 0x0e; /* A+D */
- tags[2] = ((screen_image.y + screen_image.h) * screen_image.w) / 64 +
- ((unsigned long long)fbw << 14) +
- ((unsigned long long)psm << 20) +
- ((unsigned long long)power_of_2(width) << 26) +
- ((unsigned long long)power_of_2(height) << 30) +
- ((unsigned long long)1 << 34) +
- ((unsigned long long)1 << 35);
- tags[3] = PS2_GS_TEX0_1;
- tags[4] = (1 << 5) + (1 << 6);
- tags[5] = PS2_GS_TEX1_1;
- tags[6] = 0;
- tags[7] = PS2_GS_TEXFLUSH;
- ioctl(console_fd, PS2IOC_SEND, &tex_packet);
-
- /* Set up the tags for scaling the image */
- packet[pnum].ptr = tags;
- packet[pnum].len = 12 * sizeof(*tags);
- ++pnum;
- tags[0] = 5 | (1LL << 60); /* GIFtag */
- tags[1] = 0x0e; /* A+D */
- tags[2] = 6 + (1 << 4) + (1 << 8);
- tags[3] = PS2_GS_PRIM;
- tags[4] = ((unsigned long long)0 * 16) +
- (((unsigned long long)0 * 16) << 16);
- tags[5] = PS2_GS_UV;
- tags[6] = 0; /* X1, Y1 */
- tags[7] = PS2_GS_XYZ2;
- hwdata->stretch_x1y1 = &tags[6];
- tags[8] = ((unsigned long long)overlay->w * 16) +
- (((unsigned long long)overlay->h * 16) << 16);
- tags[9] = PS2_GS_UV;
- tags[10] = 0; /* X2, Y2 */
- tags[11] = PS2_GS_XYZ2;
- hwdata->stretch_x2y2 = &tags[10];
-
- /* We're all done.. */
- return(overlay);
-}
-
-int GS_LockYUVOverlay(_THIS, SDL_Overlay *overlay)
-{
- return(0);
-}
-
-void GS_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay)
-{
- return;
-}
-
-int GS_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst)
-{
- struct private_yuvhwdata *hwdata;
- __u32 cmd;
- struct ps2_packet packet;
- int h, w, i;
- Uint32 *lum, *Cr, *Cb;
- int lum_pitch;
- int crb_pitch;
- Uint32 *lum_src, *Cr_src, *Cb_src;
- Uint32 *srcp, *dstp;
- unsigned int x, y;
- SDL_Surface *screen;
-
- /* Find out where the various portions of the image are */
- hwdata = overlay->hwdata;
- switch (overlay->format) {
- case SDL_YV12_OVERLAY:
- lum = (Uint32 *)overlay->pixels[0];
- Cr = (Uint32 *)overlay->pixels[1];
- Cb = (Uint32 *)overlay->pixels[2];
- break;
- case SDL_IYUV_OVERLAY:
- lum = (Uint32 *)overlay->pixels[0];
- Cr = (Uint32 *)overlay->pixels[2];
- Cb = (Uint32 *)overlay->pixels[1];
- default:
- SDL_SetError("Unsupported YUV format in blit (?)");
- return(-1);
- }
- dstp = (Uint32 *)hwdata->ipu_imem;
- lum_pitch = overlay->w/4;
- crb_pitch = (overlay->w/2)/4;
-
- /* Copy blocks of 16x16 pixels to the DMA area */
- for ( h=overlay->h/16; h; --h ) {
- lum_src = lum;
- Cr_src = Cr;
- Cb_src = Cb;
- for ( w=overlay->w/16; w; --w ) {
- srcp = lum_src;
- for ( i=0; i<16; ++i ) {
- dstp[0] = srcp[0];
- dstp[1] = srcp[1];
- dstp[2] = srcp[2];
- dstp[3] = srcp[3];
- srcp += lum_pitch;
- dstp += 4;
- }
- srcp = Cb_src;
- for ( i=0; i<8; ++i ) {
- dstp[0] = srcp[0];
- dstp[1] = srcp[1];
- srcp += crb_pitch;
- dstp += 2;
- }
- srcp = Cr_src;
- for ( i=0; i<8; ++i ) {
- dstp[0] = srcp[0];
- dstp[1] = srcp[1];
- srcp += crb_pitch;
- dstp += 2;
- }
- lum_src += 16 / 4;
- Cb_src += 8 / 4;
- Cr_src += 8 / 4;
- }
- lum += lum_pitch * 16;
- Cr += crb_pitch * 8;
- Cb += crb_pitch * 8;
- }
-
- /* Send the macroblock data to the IPU */
-#ifdef DEBUG_YUV
- fprintf(stderr, "Sending data to IPU..\n");
-#endif
- packet.ptr = hwdata->ipu_imem;
- packet.len = hwdata->macroblocks * (16 * 16 + 8 * 8 + 8 * 8);
- ioctl(hwdata->ipu_fd, PS2IOC_SENDA, &packet);
-
- /* Trigger the DMA to the IPU for conversion */
-#ifdef DEBUG_YUV
- fprintf(stderr, "Trigging conversion command\n");
-#endif
- cmd = (7 << 28) + hwdata->macroblocks;
- if ( screen_image.psm == PS2_GS_PSMCT16 ) {
- cmd += (1 << 27) + /* Output RGB 555 */
- (1 << 26); /* Dither output */
- }
- ioctl(hwdata->ipu_fd, PS2IOC_SIPUCMD, &cmd);
-
- /* Retrieve the converted image from the IPU */
-#ifdef DEBUG_YUV
- fprintf(stderr, "Retrieving data from IPU..\n");
-#endif
- packet.ptr = hwdata->ipu_omem;
- packet.len = overlay->w * overlay->h *
- this->screen->format->BytesPerPixel;
- ioctl(hwdata->ipu_fd, PS2IOC_RECV, &packet);
-
-#ifdef DEBUG_YUV
- fprintf(stderr, "Copying image to screen..\n");
-#endif
- /* Wait for previous DMA to complete */
- ioctl(console_fd, PS2IOC_SENDQCT, 1);
-
- /* Send the current image to the screen and scale it */
- screen = this->screen;
- x = (unsigned int)dst->x;
- y = (unsigned int)dst->y;
- if ( screen->offset ) {
- x += (screen->offset % screen->pitch) /
- screen->format->BytesPerPixel;
- y += (screen->offset / screen->pitch);
- }
- y += screen_image.y;
- *hwdata->stretch_x1y1 = (x * 16) + ((y * 16) << 16);
- x += (unsigned int)dst->w;
- y += (unsigned int)dst->h;
- *hwdata->stretch_x2y2 = (x * 16) + ((y * 16) << 16);
- return ioctl(console_fd, PS2IOC_SENDL, &hwdata->plist);
-}
-
-void GS_FreeYUVOverlay(_THIS, SDL_Overlay *overlay)
-{
- struct private_yuvhwdata *hwdata;
-
- hwdata = overlay->hwdata;
- if ( hwdata ) {
- if ( hwdata->ipu_fd >= 0 ) {
- close(hwdata->ipu_fd);
- }
- if ( hwdata->dma_mem ) {
- munmap(hwdata->dma_mem, hwdata->dma_len);
- }
- if ( hwdata->plist.packet ) {
- SDL_free(hwdata->plist.packet);
- }
- if ( hwdata->pixels ) {
- SDL_free(hwdata->pixels);
- }
- SDL_free(hwdata);
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsyuv_c.h b/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsyuv_c.h
deleted file mode 100644
index 970e054..0000000
--- a/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gsyuv_c.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This is the Playstation 2 implementation of YUV video overlays */
-
-#include "SDL_video.h"
-#include "SDL_gsvideo.h"
-
-extern SDL_Overlay *GS_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display);
-
-extern int GS_LockYUVOverlay(_THIS, SDL_Overlay *overlay);
-
-extern void GS_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay);
-
-extern int GS_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst);
-
-extern void GS_FreeYUVOverlay(_THIS, SDL_Overlay *overlay);
diff --git a/distrib/sdl-1.2.12/src/video/qtopia/SDL_QPEApp.cc b/distrib/sdl-1.2.12/src/video/qtopia/SDL_QPEApp.cc
deleted file mode 100644
index 9623c57..0000000
--- a/distrib/sdl-1.2.12/src/video/qtopia/SDL_QPEApp.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <qpe/qpeapplication.h>
-#include <qapplication.h>
-#include <qevent.h>
-
-#include "SDL_thread.h"
-#include "SDL_timer.h"
-#include "SDL_error.h"
-
-/* Flag to tell whether or not the Be application is active or not */
-int SDL_QPEAppActive = 0;
-static QPEApplication *app;
-
-int SDL_InitQPEApp() {
- if(SDL_QPEAppActive <= 0) {
- if(!qApp) {
- int argc = 1;
- char *argv[] = { { "SDLApp" } };
- app = new QPEApplication(argc, argv);
- QWidget dummy;
- app->showMainWidget(&dummy);
- } else {
- app = (QPEApplication*)qApp;
- }
- SDL_QPEAppActive++;
- }
- return 0;
-}
-
-/* Quit the QPE Application, if there's nothing left to do */
-void SDL_QuitQPEApp(void)
-{
- /* Decrement the application reference count */
- SDL_QPEAppActive--;
- /* If the reference count reached zero, clean up the app */
- if ( SDL_QPEAppActive == 0 && app) {
- delete app;
- app = 0;
- qApp = 0;
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/qtopia/SDL_QPEApp.h b/distrib/sdl-1.2.12/src/video/qtopia/SDL_QPEApp.h
deleted file mode 100644
index 1011ad9..0000000
--- a/distrib/sdl-1.2.12/src/video/qtopia/SDL_QPEApp.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Handle the QPE application loop */
-
-/* Initialize the QPE Application, if it's not already started */
-extern int SDL_InitQPEApp(void);
-
-/* Quit the QPE Application, if there's nothing left to do */
-extern void SDL_QuitQPEApp(void);
-
-/* Flag to tell whether the app is active or not */
-extern int SDL_QPEAppActive;
diff --git a/distrib/sdl-1.2.12/src/video/qtopia/SDL_QWin.cc b/distrib/sdl-1.2.12/src/video/qtopia/SDL_QWin.cc
deleted file mode 100644
index 5036246..0000000
--- a/distrib/sdl-1.2.12/src/video/qtopia/SDL_QWin.cc
+++ /dev/null
@@ -1,527 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_QWin.h"
-#include <qapplication.h>
-#include <qdirectpainter_qws.h>
-
-screenRotationT screenRotation = SDL_QT_NO_ROTATION;
-
-SDL_QWin::SDL_QWin(const QSize& size)
- : QWidget(0, "SDL_main"), my_painter(0), my_image(0),
- my_inhibit_resize(false), my_mouse_pos(-1,-1), my_flags(0),
- my_has_fullscreen(false), my_locked(0)
-{
- setBackgroundMode(NoBackground);
-}
-
-SDL_QWin::~SDL_QWin() {
- // Nothing to do yet.
- if(my_image) {
- delete my_image;
- }
-}
-
-void SDL_QWin::setImage(QImage *image) {
- if ( my_image ) {
- delete my_image;
- }
- my_image = image;
- // setFixedSize(image->size());
-}
-
-void SDL_QWin::resizeEvent(QResizeEvent *e) {
- if(size() != qApp->desktop()->size()) {
- // Widget is not the correct size, so do the fullscreen magic
- my_has_fullscreen = false;
- enableFullscreen();
- }
- if(my_inhibit_resize) {
- my_inhibit_resize = false;
- } else {
- SDL_PrivateResize(e->size().width(), e->size().height());
- }
-}
-
-void SDL_QWin::focusInEvent(QFocusEvent *) {
- // Always do it here, no matter the size.
- enableFullscreen();
- SDL_PrivateAppActive(true, SDL_APPINPUTFOCUS);
-}
-
-void SDL_QWin::focusOutEvent(QFocusEvent *) {
- my_has_fullscreen = false;
- SDL_PrivateAppActive(false, SDL_APPINPUTFOCUS);
-}
-
-void SDL_QWin::closeEvent(QCloseEvent *e) {
- SDL_PrivateQuit();
- e->ignore();
-}
-
-void SDL_QWin::setMousePos(const QPoint &pos) {
- if(my_image->width() == height()) {
- if (screenRotation == SDL_QT_ROTATION_90)
- my_mouse_pos = QPoint(height()-pos.y(), pos.x());
- else if (screenRotation == SDL_QT_ROTATION_270)
- my_mouse_pos = QPoint(pos.y(), width()-pos.x());
- } else {
- my_mouse_pos = pos;
- }
-}
-
-void SDL_QWin::mouseMoveEvent(QMouseEvent *e) {
- Qt::ButtonState button = e->button();
- int sdlstate = 0;
- if( (button & Qt::LeftButton)) {
- sdlstate |= SDL_BUTTON_LMASK;
- }
- if( (button & Qt::RightButton)) {
- sdlstate |= SDL_BUTTON_RMASK;
- }
- if( (button & Qt::MidButton)) {
- sdlstate |= SDL_BUTTON_MMASK;
- }
- setMousePos(e->pos());
- SDL_PrivateMouseMotion(sdlstate, 0, my_mouse_pos.x(), my_mouse_pos.y());
-}
-
-void SDL_QWin::mousePressEvent(QMouseEvent *e) {
- mouseMoveEvent(e);
- Qt::ButtonState button = e->button();
- SDL_PrivateMouseButton(SDL_PRESSED,
- (button & Qt::LeftButton) ? 1 :
- ((button & Qt::RightButton) ? 2 : 3),
- my_mouse_pos.x(), my_mouse_pos.y());
-}
-
-void SDL_QWin::mouseReleaseEvent(QMouseEvent *e) {
- setMousePos(e->pos());
- Qt::ButtonState button = e->button();
- SDL_PrivateMouseButton(SDL_RELEASED,
- (button & Qt::LeftButton) ? 1 :
- ((button & Qt::RightButton) ? 2 : 3),
- my_mouse_pos.x(), my_mouse_pos.y());
- my_mouse_pos = QPoint(-1, -1);
-}
-
-static inline void
-gs_fastRotateBlit_3 ( unsigned short *fb,
- unsigned short *bits,
- const QRect& rect )
-{
- // FIXME: this only works correctly for 240x320 displays
- int startx, starty;
- int width, height;
-
- startx = rect.left() >> 1;
- starty = rect.top() >> 1;
- width = ((rect.right() - rect.left()) >> 1) + 2;
- height = ((rect.bottom() - rect.top()) >> 1) + 2;
-
- if((startx+width) > 120) {
- width = 120 - startx; // avoid horizontal overflow
- }
- if((starty+height) > 160) {
- height = 160 - starty; // avoid vertical overflow
- }
-
- ulong *sp1, *sp2, *dp1, *dp2;
- ulong stop, sbot, dtop, dbot;
-
- sp1 = (ulong*)bits + startx + starty*240;
- sp2 = sp1 + 120;
- dp1 = (ulong *)fb + (159 - starty) + startx*320;
- dp2 = dp1 + 160;
- int rowadd = (-320*width) - 1;
- int rowadd2 = 240 - width;
- // transfer in cells of 2x2 pixels in words
- for (int y=0; y<height; y++) {
- for (int x=0; x<width; x++) {
- // read source pixels
- stop = *sp1;
- sbot = *sp2;
- // rotate pixels
- dtop = (sbot & 0xffff) + ((stop & 0xffff)<<16);
- dbot = ((sbot & 0xffff0000)>>16) + (stop & 0xffff0000);
- // write to framebuffer
- *dp1 = dtop;
- *dp2 = dbot;
- // update source ptrs
- sp1++; sp2++;
- // update dest ptrs - 2 pix at a time
- dp1 += 320;
- dp2 += 320;
- }
- // adjust src ptrs - skip a row as we work in pairs
- sp1 += rowadd2;
- sp2 += rowadd2;
- // adjust dest ptrs for rotation
- dp1 += rowadd;
- dp2 += rowadd;
- }
-}
-
-static inline void
-gs_fastRotateBlit_1 ( unsigned short *fb,
- unsigned short *bits,
- const QRect& rect ) {
- // FIXME: this only works correctly for 240x320 displays
- int startx, starty;
- int width, height;
-
- startx = rect.left() >> 1;
- starty = rect.top() >> 1;
- width = ((rect.right() - rect.left()) >> 1) + 2;
- height = ((rect.bottom() - rect.top()) >> 1) + 2;
-
- if((startx+width) > 120) {
- width = 120 - startx; // avoid horizontal overflow
- }
- if((starty+height) > 160) {
- height = 160 - starty; // avoid vertical overflow
- }
-
- ulong *sp1, *sp2, *dp1, *dp2;
- ulong stop, sbot, dtop, dbot;
- fb += 320*239; // Move "fb" to top left corner
- sp1 = (ulong*)bits + startx + starty*240;
- sp2 = sp1 + 120;
- dp1 = (ulong*)fb - startx * 320 - starty;
- dp2 = dp1 - 160;
- int rowadd = (320*width) + 1;
- int rowadd2 = 240 - width;
- // transfer in cells of 2x2 pixels in words
- for (int y=0; y<height; y++) {
- for (int x=0; x<width; x++) {
- // read
- stop = *sp1;
- sbot = *sp2;
- // rotate
- dtop = (stop & 0xffff) + ((sbot & 0xffff)<<16);
- dbot = ((stop & 0xffff0000)>>16) + (sbot & 0xffff0000);
- // write
- *dp1 = dtop;
- *dp2 = dbot;
- // update source ptrs
- sp1++; sp2++;
- // update dest ptrs - 2 pix at a time
- dp1 -= 320;
- dp2 -= 320;
- }
- // adjust src ptrs - skip a row as we work in pairs
- sp1 += rowadd2;
- sp2 += rowadd2;
- // adjust dest ptrs for rotation
- dp1 += rowadd;
- dp2 += rowadd;
- }
-}
-
-// desktop, SL-A300 etc
-bool SDL_QWin::repaintRotation0(const QRect& rect) {
- if(my_image->width() == width()) {
- uchar *fb = (uchar*)my_painter->frameBuffer();
- uchar *buf = (uchar*)my_image->bits();
- if(rect == my_image->rect()) {
- SDL_memcpy(fb, buf, width()*height()*2);
- } else {
- int h = rect.height();
- int wd = rect.width()<<1;
- int fblineadd = my_painter->lineStep();
- int buflineadd = my_image->bytesPerLine();
- fb += (rect.left()<<1) + rect.top() * my_painter->lineStep();
- buf += (rect.left()<<1) + rect.top() * my_image->bytesPerLine();
- while(h--) {
- SDL_memcpy(fb, buf, wd);
- fb += fblineadd;
- buf += buflineadd;
- }
- }
- } else {
- return false; // FIXME: Landscape
- }
-#ifdef __i386__
- my_painter->fillRect( rect, QBrush( Qt::NoBrush ) );
-#endif
- return true;
-}
-
-
-// Sharp Zaurus SL-5500 etc
-bool SDL_QWin::repaintRotation3(const QRect& rect) {
- if(my_image->width() == width()) {
- ushort *fb = (ushort*)my_painter->frameBuffer();
- ushort *buf = (ushort*)my_image->bits();
- gs_fastRotateBlit_3(fb, buf, rect);
- } else {
- // landscape mode
- if (screenRotation == SDL_QT_ROTATION_90) {
- uchar *fb = (uchar*)my_painter->frameBuffer();
- uchar *buf = (uchar*)my_image->bits();
- if(rect == my_image->rect()) {
- SDL_memcpy(fb, buf, width()*height()*2);
- } else {
- int h = rect.height();
- int wd = rect.width()<<1;
- int fblineadd = my_painter->lineStep();
- int buflineadd = my_image->bytesPerLine();
- fb += (rect.left()<<1) + rect.top() * my_painter->lineStep();
- buf += (rect.left()<<1) + rect.top() * my_image->bytesPerLine();
- while(h--) {
- SDL_memcpy(fb, buf, wd);
- fb += fblineadd;
- buf += buflineadd;
- }
- }
- } else if (screenRotation == SDL_QT_ROTATION_270) {
- int h = rect.height();
- int wd = rect.width();
- int fblineadd = my_painter->lineStep() - (rect.width() << 1);
- int buflineadd = my_image->bytesPerLine() - (rect.width() << 1);
- int w;
-
- uchar *fb = (uchar*)my_painter->frameBuffer();
- uchar *buf = (uchar*)my_image->bits();
-
- fb += ((my_painter->width() - (rect.top() + rect.height())) *
- my_painter->lineStep()) + ((my_painter->height() - ((rect.left() +
- rect.width()))) << 1);
-
- buf += my_image->bytesPerLine() * (rect.top() + rect.height()) -
- (((my_image->width() - (rect.left() + rect.width())) << 1) + 2);
-
- while(h--) {
- w = wd;
- while(w--) *((unsigned short*)fb)++ = *((unsigned short*)buf)--;
- fb += fblineadd;
- buf -= buflineadd;
- }
- }
- }
- return true;
-}
-
-// ipaq 3800...
-bool SDL_QWin::repaintRotation1(const QRect& rect) {
- if(my_image->width() == width()) {
- ushort *fb = (ushort*)my_painter->frameBuffer();
- ushort *buf = (ushort*)my_image->bits();
- gs_fastRotateBlit_1(fb, buf, rect);
- } else {
- return false; // FIXME: landscape mode
- }
- return true;
-}
-
-void SDL_QWin::repaintRect(const QRect& rect) {
- if(!my_painter || !rect.width() || !rect.height()) {
- return;
- }
-
- if(QPixmap::defaultDepth() == 16) {
- switch(my_painter->transformOrientation()) {
- case 3:
- if(repaintRotation3(rect)) { return; }
- break;
- case 1:
- if(repaintRotation1(rect)) { return; }
- break;
- case 0:
- if(repaintRotation0(rect)) { return; }
- break;
- }
- }
- my_painter->drawImage(rect.topLeft(), *my_image, rect);
-}
-
-// This paints the current buffer to the screen, when desired.
-void SDL_QWin::paintEvent(QPaintEvent *ev) {
- if(my_image) {
- lockScreen(true);
- repaintRect(ev->rect());
- unlockScreen();
- }
-}
-
-/* Function to translate a keyboard transition and queue the key event
- * This should probably be a table although this method isn't exactly
- * slow.
- */
-void SDL_QWin::QueueKey(QKeyEvent *e, int pressed)
-{
- SDL_keysym keysym;
- int scancode = e->key();
- /* Set the keysym information */
- if(scancode >= 'A' && scancode <= 'Z') {
- // Qt sends uppercase, SDL wants lowercase
- keysym.sym = static_cast<SDLKey>(scancode + 32);
- } else if(scancode >= 0x1000) {
- // Special keys
- switch(scancode) {
- case Qt::Key_Escape: scancode = SDLK_ESCAPE; break;
- case Qt::Key_Tab: scancode = SDLK_TAB; break;
- case Qt::Key_Backspace: scancode = SDLK_BACKSPACE; break;
- case Qt::Key_Return: scancode = SDLK_RETURN; break;
- case Qt::Key_Enter: scancode = SDLK_KP_ENTER; break;
- case Qt::Key_Insert: scancode = SDLK_INSERT; break;
- case Qt::Key_Delete: scancode = SDLK_DELETE; break;
- case Qt::Key_Pause: scancode = SDLK_PAUSE; break;
- case Qt::Key_Print: scancode = SDLK_PRINT; break;
- case Qt::Key_SysReq: scancode = SDLK_SYSREQ; break;
- case Qt::Key_Home: scancode = SDLK_HOME; break;
- case Qt::Key_End: scancode = SDLK_END; break;
- // We want the control keys to rotate with the screen
- case Qt::Key_Left:
- if (screenRotation == SDL_QT_ROTATION_90) scancode = SDLK_UP;
- else if (screenRotation == SDL_QT_ROTATION_270) scancode = SDLK_DOWN;
- else scancode = SDLK_LEFT;
- break;
- case Qt::Key_Up:
- if (screenRotation == SDL_QT_ROTATION_90) scancode = SDLK_RIGHT;
- else if (screenRotation == SDL_QT_ROTATION_270) scancode = SDLK_LEFT;
- else scancode = SDLK_UP;
- break;
- case Qt::Key_Right:
- if (screenRotation == SDL_QT_ROTATION_90) scancode = SDLK_DOWN;
- else if (screenRotation == SDL_QT_ROTATION_270) scancode = SDLK_UP;
- else scancode = SDLK_RIGHT;
- break;
- case Qt::Key_Down:
- if (screenRotation == SDL_QT_ROTATION_90) scancode = SDLK_LEFT;
- else if (screenRotation == SDL_QT_ROTATION_270) scancode = SDLK_RIGHT;
- else scancode = SDLK_DOWN;
- break;
- case Qt::Key_Prior: scancode = SDLK_PAGEUP; break;
- case Qt::Key_Next: scancode = SDLK_PAGEDOWN; break;
- case Qt::Key_Shift: scancode = SDLK_LSHIFT; break;
- case Qt::Key_Control: scancode = SDLK_LCTRL; break;
- case Qt::Key_Meta: scancode = SDLK_LMETA; break;
- case Qt::Key_Alt: scancode = SDLK_LALT; break;
- case Qt::Key_CapsLock: scancode = SDLK_CAPSLOCK; break;
- case Qt::Key_NumLock: scancode = SDLK_NUMLOCK; break;
- case Qt::Key_ScrollLock: scancode = SDLK_SCROLLOCK; break;
- case Qt::Key_F1: scancode = SDLK_F1; break;
- case Qt::Key_F2: scancode = SDLK_F2; break;
- case Qt::Key_F3: scancode = SDLK_F3; break;
- case Qt::Key_F4: scancode = SDLK_F4; break;
- case Qt::Key_F5: scancode = SDLK_F5; break;
- case Qt::Key_F6: scancode = SDLK_F6; break;
- case Qt::Key_F7: scancode = SDLK_F7; break;
- case Qt::Key_F8: scancode = SDLK_F8; break;
- case Qt::Key_F9: scancode = SDLK_F9; break;
- case Qt::Key_F10: scancode = SDLK_F10; break;
- case Qt::Key_F11: scancode = SDLK_F11; break;
- case Qt::Key_F12: scancode = SDLK_F12; break;
- case Qt::Key_F13: scancode = SDLK_F13; break;
- case Qt::Key_F14: scancode = SDLK_F14; break;
- case Qt::Key_F15: scancode = SDLK_F15; break;
- case Qt::Key_Super_L: scancode = SDLK_LSUPER; break;
- case Qt::Key_Super_R: scancode = SDLK_RSUPER; break;
- case Qt::Key_Menu: scancode = SDLK_MENU; break;
- case Qt::Key_Help: scancode = SDLK_HELP; break;
-
- case Qt::Key_F33:
- // FIXME: This is a hack to enable the OK key on
- // Zaurii devices. SDLK_RETURN is a suitable key to use
- // since it often is used as such.
- // david@hedbor.org
- scancode = SDLK_RETURN;
- break;
- default:
- scancode = SDLK_UNKNOWN;
- break;
- }
- keysym.sym = static_cast<SDLKey>(scancode);
- } else {
- keysym.sym = static_cast<SDLKey>(scancode);
- }
- keysym.scancode = scancode;
- keysym.mod = KMOD_NONE;
- ButtonState st = e->state();
- if( (st & ShiftButton) ) { keysym.mod = static_cast<SDLMod>(keysym.mod | KMOD_LSHIFT); }
- if( (st & ControlButton) ) { keysym.mod = static_cast<SDLMod>(keysym.mod | KMOD_LCTRL); }
- if( (st & AltButton) ) { keysym.mod = static_cast<SDLMod>(keysym.mod | KMOD_LALT); }
- if ( SDL_TranslateUNICODE ) {
- QChar qchar = e->text()[0];
- keysym.unicode = qchar.unicode();
- } else {
- keysym.unicode = 0;
- }
-
- /* NUMLOCK and CAPSLOCK are implemented as double-presses in reality */
- // if ( (keysym.sym == SDLK_NUMLOCK) || (keysym.sym == SDLK_CAPSLOCK) ) {
- // pressed = 1;
- // }
-
- /* Queue the key event */
- if ( pressed ) {
- SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
- } else {
- SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
- }
-}
-
-void SDL_QWin::setFullscreen(bool fs_on) {
- my_has_fullscreen = false;
- enableFullscreen();
-}
-
-void SDL_QWin::enableFullscreen() {
- // Make sure size is correct
- if(!my_has_fullscreen) {
- setFixedSize(qApp->desktop()->size());
- // This call is needed because showFullScreen won't work
- // correctly if the widget already considers itself to be fullscreen.
- showNormal();
- // This is needed because showNormal() forcefully changes the window
- // style to WSTyle_TopLevel.
- setWFlags(WStyle_Customize | WStyle_NoBorder);
- // Enable fullscreen.
- showFullScreen();
- my_has_fullscreen = true;
- }
-}
-
-bool SDL_QWin::lockScreen(bool force) {
- if(!my_painter) {
- if(force || (isVisible() && isActiveWindow())) {
- my_painter = new QDirectPainter(this);
- } else {
- return false;
- }
- }
- my_locked++; // Increate lock refcount
- return true;
-}
-
-void SDL_QWin::unlockScreen() {
- if(my_locked > 0) {
- my_locked--; // decrease lock refcount;
- }
- if(!my_locked && my_painter) {
- my_painter->end();
- delete my_painter;
- my_painter = 0;
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/qtopia/SDL_QWin.h b/distrib/sdl-1.2.12/src/video/qtopia/SDL_QWin.h
deleted file mode 100644
index 47636df..0000000
--- a/distrib/sdl-1.2.12/src/video/qtopia/SDL_QWin.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_QWin_h
-#define _SDL_QWin_h
-
-#include <stdio.h>
-
-#include <qimage.h>
-#include <qpixmap.h>
-#include <qwidget.h>
-#include <qpainter.h>
-#include <qdirectpainter_qws.h>
-
-#include "SDL_events.h"
-
-extern "C" {
-#include "../../events/SDL_events_c.h"
-};
-
-typedef enum {
- SDL_QT_NO_ROTATION = 0,
- SDL_QT_ROTATION_90,
- SDL_QT_ROTATION_270
-} screenRotationT;
-
-extern screenRotationT screenRotation;
-
-class SDL_QWin : public QWidget
-{
- void QueueKey(QKeyEvent *e, int pressed);
- public:
- SDL_QWin(const QSize& size);
- virtual ~SDL_QWin();
- virtual bool shown(void) {
- return isVisible();
- }
- /* If called, the next resize event will not be forwarded to SDL. */
- virtual void inhibitResize(void) {
- my_inhibit_resize = true;
- }
- void setImage(QImage *image);
- void setOffset(int x, int y) {
- my_offset = QPoint(x, y);
- }
- void GetXYOffset(int &x, int &y) {
- x = my_offset.x();
- y = my_offset.y();
- }
- QImage *image(void) { return my_image; }
-
- void setWFlags(WFlags flags) {
- QWidget::setWFlags(flags);
- my_flags = flags;
- }
- const QPoint& mousePos() const { return my_mouse_pos; }
- void setMousePos(const QPoint& newpos);
- void setFullscreen(bool);
-
- bool lockScreen(bool force=false);
- void unlockScreen();
- void repaintRect(const QRect& rect);
- protected:
- /* Handle resizing of the window */
- virtual void resizeEvent(QResizeEvent *e);
- void focusInEvent(QFocusEvent *);
- void focusOutEvent(QFocusEvent *);
- void closeEvent(QCloseEvent *e);
- void mouseMoveEvent(QMouseEvent *e);
- void mousePressEvent(QMouseEvent *e);
- void mouseReleaseEvent(QMouseEvent *e);
- void paintEvent(QPaintEvent *ev);
- void keyPressEvent(QKeyEvent *e) { QueueKey(e, 1); }
- void keyReleaseEvent(QKeyEvent *e) { QueueKey(e, 0); }
- private:
- bool repaintRotation0(const QRect& rect);
- bool repaintRotation1(const QRect& rect);
- bool repaintRotation3(const QRect& rect);
- void enableFullscreen();
- QDirectPainter *my_painter;
- QImage *my_image;
- bool my_inhibit_resize;
- QPoint my_offset;
- QPoint my_mouse_pos;
- WFlags my_flags;
- WFlags my_has_fullscreen;
- unsigned int my_locked;
-};
-
-#endif /* _SDL_QWin_h */
diff --git a/distrib/sdl-1.2.12/src/video/qtopia/SDL_lowvideo.h b/distrib/sdl-1.2.12/src/video/qtopia/SDL_lowvideo.h
deleted file mode 100644
index c3c09a0..0000000
--- a/distrib/sdl-1.2.12/src/video/qtopia/SDL_lowvideo.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_lowvideo_h
-#define _SDL_lowvideo_h
-
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *_this
-
-/* Private display data */
-struct SDL_PrivateVideoData {
- /* The main window */
- SDL_QWin *SDL_Win;
-
- /* The fullscreen mode list */
-#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
- int SDL_nummodes[NUM_MODELISTS];
- SDL_Rect **SDL_modelist[NUM_MODELISTS];
-
- /* A completely clear cursor */
- WMcursor *BlankCursor;
-
- /* Mouse state variables */
- Uint32 last_buttons;
- QPoint last_point;
-
- /* Keyboard state variables */
- int key_flip;
- //struct key_info keyinfo[2];
-};
-/* Old variable names */
-#define SDL_Win (_this->hidden->SDL_Win)
-#define saved_mode (_this->hidden->saved_mode)
-#define SDL_nummodes (_this->hidden->SDL_nummodes)
-#define SDL_modelist (_this->hidden->SDL_modelist)
-#define SDL_BlankCursor (_this->hidden->BlankCursor)
-#define last_buttons (_this->hidden->last_buttons)
-#define last_point (_this->hidden->last_point)
-#define key_flip (_this->hidden->key_flip)
-#define keyinfo (_this->hidden->keyinfo)
-
-#endif /* _SDL_lowvideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/qtopia/SDL_sysevents.cc b/distrib/sdl-1.2.12/src/video/qtopia/SDL_sysevents.cc
deleted file mode 100644
index 2b81142..0000000
--- a/distrib/sdl-1.2.12/src/video/qtopia/SDL_sysevents.cc
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <qpe/qpeapplication.h>
-
-#include <stdio.h>
-#include <string.h>
-#include "SDL_error.h"
-#include "SDL_events.h"
-#include "SDL_QWin.h"
-#include "SDL_lowvideo.h"
-#include "SDL_timer.h"
-
-extern "C" {
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_sysevents_c.h"
-
- // static SDLKey keymap[128];
-/* This is special because we know it will be run in a loop in a separate
- thread. Normally this function should loop as long as there are input
- states changing, i.e. new events arriving.
-*/
-void QT_PumpEvents(_THIS)
-{
- if(!qApp) {
- return;
- }
- // printf("processing events: %p\n", qApp);
- //qApp->processOneEvent(); // wait for a event
- qApp->processEvents(); // and process all outstanding ones
-#if 0
- BView *view;
- BRect bounds;
- BPoint point;
- uint32 buttons;
- const uint32 button_masks[3] = {
- B_PRIMARY_MOUSE_BUTTON,
- B_TERTIARY_MOUSE_BUTTON,
- B_SECONDARY_MOUSE_BUTTON,
- };
- unsigned int i, j;
-
- /* Check out the mouse buttons and position (slight race condition) */
- if ( SDL_Win->Lock() ) {
- /* Don't do anything if we have no view */
- view = SDL_Win->View();
- if ( ! view ) {
- SDL_Win->Unlock();
- return;
- }
- bounds = view->Bounds();
- /* Get new input state, if still active */
- if ( SDL_Win->IsActive() ) {
- key_flip = !key_flip;
- get_key_info(&keyinfo[key_flip]);
- view->GetMouse(&point, &buttons, true);
- } else {
- key_flip = key_flip;
- point = last_point;
- buttons = last_buttons;
- }
- SDL_Win->Unlock();
- } else {
- return;
- }
-
- /* If our view is active, we'll find key changes here */
- if ( SDL_memcmp(keyinfo[0].key_states, keyinfo[1].key_states, 16) != 0 ) {
- for ( i=0; i<16; ++i ) {
- Uint8 new_state, transition;
-
- new_state = keyinfo[key_flip].key_states[i];
- transition = keyinfo[!key_flip].key_states[i] ^
- keyinfo[ key_flip].key_states[i];
- for ( j=0; j<8; ++j ) {
- if ( transition&0x80 )
- QueueKey(i*8+j, new_state&0x80);
- transition <<= 1;
- new_state <<= 1;
- }
- }
- }
-
- /* We check keyboard, but not mouse if mouse isn't in window */
- if ( ! bounds.Contains(point) ) {
- /* Mouse moved outside our view? */
- if ( SDL_GetAppState() & SDL_APPMOUSEFOCUS ) {
- SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
- be_app->SetCursor(B_HAND_CURSOR);
- }
- return;
- }
- /* Has the mouse moved back into our view? */
- if ( ! (SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
- /* Reset the B_HAND_CURSOR to our own */
- SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
- SDL_SetCursor(NULL);
- }
-
- /* Check for mouse motion */
- if ( point != last_point ) {
- int x, y;
-
- SDL_Win->GetXYOffset(x, y);
- x = (int)point.x - x;
- y = (int)point.y - y;
- SDL_PrivateMouseMotion(0, 0, x, y);
- }
- last_point = point;
-
- /* Add any mouse button events */
- for ( i=0; i<SDL_TABLESIZE(button_masks); ++i ) {
- if ( (buttons ^ last_buttons) & button_masks[i] ) {
- if ( buttons & button_masks[i] ) {
- SDL_PrivateMouseButton(SDL_PRESSED, 1+i, 0, 0);
- } else {
- SDL_PrivateMouseButton(SDL_RELEASED, 1+i, 0, 0);
- }
- }
- }
- last_buttons = buttons;
-#endif
-}
-
-void QT_InitOSKeymap(_THIS)
-{
-#if 0
- unsigned int i;
-
- /* Initialize all the key states as "up" */
- key_flip = 0;
- SDL_memset(keyinfo[key_flip].key_states, 0, 16);
-
- /* Initialize the key translation table */
- for ( i=0; i<SDL_TABLESIZE(keymap); ++i )
- keymap[i] = SDLK_UNKNOWN;
-
- // keymap[0x01] = SDLK_ESCAPE;
- // keymap[B_F1_KEY] = SDLK_F1;
- // keymap[B_F2_KEY] = SDLK_F2;
- // keymap[B_F3_KEY] = SDLK_F3;
- // keymap[B_F4_KEY] = SDLK_F4;
- // keymap[B_F5_KEY] = SDLK_F5;
- // keymap[B_F6_KEY] = SDLK_F6;
- // keymap[B_F7_KEY] = SDLK_F7;
- // keymap[B_F8_KEY] = SDLK_F8;
- // keymap[B_F9_KEY] = SDLK_F9;
- // keymap[B_F10_KEY] = SDLK_F10;
- // keymap[B_F11_KEY] = SDLK_F11;
- // keymap[B_F12_KEY] = SDLK_F12;
- // keymap[B_PRINT_KEY] = SDLK_PRINT;
- //keymap[B_SCROLL_KEY] = SDLK_SCROLLOCK;
- // keymap[B_PAUSE_KEY] = SDLK_PAUSE;
- keymap[0x11] = SDLK_BACKQUOTE;
- keymap[0x12] = SDLK_1;
- keymap[0x13] = SDLK_2;
- keymap[0x14] = SDLK_3;
- keymap[0x15] = SDLK_4;
- keymap[0x16] = SDLK_5;
- keymap[0x17] = SDLK_6;
- keymap[0x18] = SDLK_7;
- keymap[0x19] = SDLK_8;
- keymap[0x1a] = SDLK_9;
- keymap[0x1b] = SDLK_0;
- keymap[0x1c] = SDLK_MINUS;
- keymap[0x1d] = SDLK_EQUALS;
- keymap[0x1e] = SDLK_BACKSPACE;
- keymap[0x1f] = SDLK_INSERT;
- keymap[0x20] = SDLK_HOME;
- keymap[0x21] = SDLK_PAGEUP;
- //keymap[0x22] = SDLK_NUMLOCK;
- keymap[0x23] = SDLK_KP_DIVIDE;
- keymap[0x24] = SDLK_KP_MULTIPLY;
- keymap[0x25] = SDLK_KP_MINUS;
- keymap[0x26] = SDLK_TAB;
- keymap[0x27] = SDLK_q;
- keymap[0x28] = SDLK_w;
- keymap[0x29] = SDLK_e;
- keymap[0x2a] = SDLK_r;
- keymap[0x2b] = SDLK_t;
- keymap[0x2c] = SDLK_y;
- keymap[0x2d] = SDLK_u;
- keymap[0x2e] = SDLK_i;
- keymap[0x2f] = SDLK_o;
- keymap[0x30] = SDLK_p;
- keymap[0x31] = SDLK_LEFTBRACKET;
- keymap[0x32] = SDLK_RIGHTBRACKET;
- keymap[0x33] = SDLK_BACKSLASH;
- keymap[0x34] = SDLK_DELETE;
- keymap[0x35] = SDLK_END;
- keymap[0x36] = SDLK_PAGEDOWN;
- keymap[0x37] = SDLK_KP7;
- keymap[0x38] = SDLK_KP8;
- keymap[0x39] = SDLK_KP9;
- keymap[0x3a] = SDLK_KP_PLUS;
- //keymap[0x3b] = SDLK_CAPSLOCK;
- keymap[0x3c] = SDLK_a;
- keymap[0x3d] = SDLK_s;
- keymap[0x3e] = SDLK_d;
- keymap[0x3f] = SDLK_f;
- keymap[0x40] = SDLK_g;
- keymap[0x41] = SDLK_h;
- keymap[0x42] = SDLK_j;
- keymap[0x43] = SDLK_k;
- keymap[0x44] = SDLK_l;
- keymap[0x45] = SDLK_SEMICOLON;
- keymap[0x46] = SDLK_QUOTE;
- keymap[0x47] = SDLK_RETURN;
- keymap[0x48] = SDLK_KP4;
- keymap[0x49] = SDLK_KP5;
- keymap[0x4a] = SDLK_KP6;
- keymap[0x4b] = SDLK_LSHIFT;
- keymap[0x4c] = SDLK_z;
- keymap[0x4d] = SDLK_x;
- keymap[0x4e] = SDLK_c;
- keymap[0x4f] = SDLK_v;
- keymap[0x50] = SDLK_b;
- keymap[0x51] = SDLK_n;
- keymap[0x52] = SDLK_m;
- keymap[0x53] = SDLK_COMMA;
- keymap[0x54] = SDLK_PERIOD;
- keymap[0x55] = SDLK_SLASH;
- keymap[0x56] = SDLK_RSHIFT;
- keymap[0x57] = SDLK_UP;
- keymap[0x58] = SDLK_KP1;
- keymap[0x59] = SDLK_KP2;
- keymap[0x5a] = SDLK_KP3;
- keymap[0x5b] = SDLK_KP_ENTER;
- //keymap[0x5c] = SDLK_LCTRL;
- //keymap[0x5d] = SDLK_LALT;
- keymap[0x5e] = SDLK_SPACE;
- //keymap[0x5f] = SDLK_RALT;
- //keymap[0x60] = SDLK_RCTRL;
- keymap[0x61] = SDLK_LEFT;
- keymap[0x62] = SDLK_DOWN;
- keymap[0x63] = SDLK_RIGHT;
- keymap[0x64] = SDLK_KP0;
- keymap[0x65] = SDLK_KP_PERIOD;
- //keymap[0x66] = SDLK_LMETA;
- //keymap[0x67] = SDLK_RMETA;
- //keymap[0x68] = SDLK_MENU;
- keymap[0x69] = SDLK_EURO;
- keymap[0x6a] = SDLK_KP_EQUALS;
- keymap[0x6b] = SDLK_POWER;
-#endif
-}
-
-}; /* Extern C */
diff --git a/distrib/sdl-1.2.12/src/video/qtopia/SDL_sysevents_c.h b/distrib/sdl-1.2.12/src/video/qtopia/SDL_sysevents_c.h
deleted file mode 100644
index 44576e4..0000000
--- a/distrib/sdl-1.2.12/src/video/qtopia/SDL_sysevents_c.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_lowvideo.h"
-
-/* Variables and functions exported by SDL_sysevents.c to other parts
- of the native video subsystem (SDL_sysvideo.c)
-*/
-
-extern void QT_InitOSKeymap(_THIS);
-extern void QT_PumpEvents(_THIS);
diff --git a/distrib/sdl-1.2.12/src/video/qtopia/SDL_sysmouse.cc b/distrib/sdl-1.2.12/src/video/qtopia/SDL_sysmouse.cc
deleted file mode 100644
index 537f4d8..0000000
--- a/distrib/sdl-1.2.12/src/video/qtopia/SDL_sysmouse.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_QWin.h"
-
-extern "C" {
-
-#include "SDL_sysmouse_c.h"
-
-/* The implementation dependent data for the window manager cursor */
-struct WMcursor {
- char *bits;
-};
-WMcursor *QT_CreateWMCursor(_THIS,
- Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
-{
- static WMcursor dummy;
- dummy.bits = 0;
- return &dummy;
-}
-
-int QT_ShowWMCursor(_THIS, WMcursor *cursor)
-{
- return 1;
-}
-
-void QT_FreeWMCursor(_THIS, WMcursor *cursor)
-{
-}
-
-void QT_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
-{
- SDL_Win->setMousePos(QPoint(x, y));
-}
-
-}; /* Extern C */
diff --git a/distrib/sdl-1.2.12/src/video/qtopia/SDL_sysmouse_c.h b/distrib/sdl-1.2.12/src/video/qtopia/SDL_sysmouse_c.h
deleted file mode 100644
index 73202fc..0000000
--- a/distrib/sdl-1.2.12/src/video/qtopia/SDL_sysmouse_c.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_lowvideo.h"
-
-/* Functions to be exported */
-extern void QT_FreeWMCursor(_THIS, WMcursor *cursor);
-extern WMcursor *QT_CreateWMCursor(_THIS,
- Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
-extern int QT_ShowWMCursor(_THIS, WMcursor *cursor);
-extern void QT_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
-
diff --git a/distrib/sdl-1.2.12/src/video/qtopia/SDL_sysvideo.cc b/distrib/sdl-1.2.12/src/video/qtopia/SDL_sysvideo.cc
deleted file mode 100644
index 193ade4..0000000
--- a/distrib/sdl-1.2.12/src/video/qtopia/SDL_sysvideo.cc
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Qtopia based framebuffer implementation */
-
-#include <unistd.h>
-
-#include <qapplication.h>
-#include <qpe/qpeapplication.h>
-
-#include "SDL_timer.h"
-
-#include "SDL_QWin.h"
-
-extern "C" {
-
-#include "../SDL_sysvideo.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_sysevents_c.h"
-#include "SDL_sysmouse_c.h"
-#include "SDL_syswm_c.h"
-#include "SDL_lowvideo.h"
-
- //#define QTOPIA_DEBUG
-#define QT_HIDDEN_SIZE 32 /* starting hidden window size */
-
- /* Name of the environment variable used to invert the screen rotation or not:
- Possible values:
- !=0 : Screen is 270° rotated
- 0: Screen is 90° rotated*/
-#define SDL_QT_ROTATION_ENV_NAME "SDL_QT_INVERT_ROTATION"
-
- /* Initialization/Query functions */
- static int QT_VideoInit(_THIS, SDL_PixelFormat *vformat);
- static SDL_Rect **QT_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
- static SDL_Surface *QT_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
- static void QT_UpdateMouse(_THIS);
- static int QT_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
- static void QT_VideoQuit(_THIS);
-
- /* Hardware surface functions */
- static int QT_AllocHWSurface(_THIS, SDL_Surface *surface);
- static int QT_LockHWSurface(_THIS, SDL_Surface *surface);
- static void QT_UnlockHWSurface(_THIS, SDL_Surface *surface);
- static void QT_FreeHWSurface(_THIS, SDL_Surface *surface);
-
- static int QT_ToggleFullScreen(_THIS, int fullscreen);
-
- static int QT_IconifyWindow(_THIS);
- static SDL_GrabMode QT_GrabInput(_THIS, SDL_GrabMode mode);
-
- /* FB driver bootstrap functions */
-
- static int QT_Available(void)
- {
- return(1);
- }
-
- static void QT_DeleteDevice(SDL_VideoDevice *device)
- {
- SDL_free(device->hidden);
- SDL_free(device);
- }
-
- static SDL_VideoDevice *QT_CreateDevice(int devindex)
- {
- SDL_VideoDevice *device;
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device ) {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *device->hidden));
- }
- if ( (device == NULL) || (device->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( device ) {
- SDL_free(device);
- }
- return(0);
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
-
- /* Set the function pointers */
- device->VideoInit = QT_VideoInit;
- device->ListModes = QT_ListModes;
- device->SetVideoMode = QT_SetVideoMode;
- device->UpdateMouse = QT_UpdateMouse;
- device->SetColors = QT_SetColors;
- device->UpdateRects = NULL;
- device->VideoQuit = QT_VideoQuit;
- device->AllocHWSurface = QT_AllocHWSurface;
- device->CheckHWBlit = NULL;
- device->FillHWRect = NULL;
- device->SetHWColorKey = NULL;
- device->SetHWAlpha = NULL;
- device->LockHWSurface = QT_LockHWSurface;
- device->UnlockHWSurface = QT_UnlockHWSurface;
- device->FlipHWSurface = NULL;
- device->FreeHWSurface = QT_FreeHWSurface;
- device->SetIcon = NULL;
- device->SetCaption = QT_SetWMCaption;
- device->IconifyWindow = QT_IconifyWindow;
- device->GrabInput = QT_GrabInput;
- device->GetWMInfo = NULL;
- device->FreeWMCursor = QT_FreeWMCursor;
- device->CreateWMCursor = QT_CreateWMCursor;
- device->ShowWMCursor = QT_ShowWMCursor;
- device->WarpWMCursor = QT_WarpWMCursor;
- device->InitOSKeymap = QT_InitOSKeymap;
- device->PumpEvents = QT_PumpEvents;
-
- device->free = QT_DeleteDevice;
- device->ToggleFullScreen = QT_ToggleFullScreen;
-
- /* Set the driver flags */
- device->handles_any_size = 0;
-
- return device;
- }
-
- VideoBootStrap Qtopia_bootstrap = {
- "qtopia", "Qtopia / QPE graphics",
- QT_Available, QT_CreateDevice
- };
-
- /* Function to sort the display_list */
- static int CompareModes(const void *A, const void *B)
- {
-#if 0
- const display_mode *a = (display_mode *)A;
- const display_mode *b = (display_mode *)B;
-
- if ( a->space == b->space ) {
- return((b->virtual_width*b->virtual_height)-
- (a->virtual_width*a->virtual_height));
- } else {
- return(ColorSpaceToBitsPerPixel(b->space)-
- ColorSpaceToBitsPerPixel(a->space));
- }
-#endif
- return 0;
- }
-
- /* Yes, this isn't the fastest it could be, but it works nicely */
- static int QT_AddMode(_THIS, int index, unsigned int w, unsigned int h)
- {
- SDL_Rect *mode;
- int i;
- int next_mode;
-
- /* Check to see if we already have this mode */
- if ( SDL_nummodes[index] > 0 ) {
- for ( i=SDL_nummodes[index]-1; i >= 0; --i ) {
- mode = SDL_modelist[index][i];
- if ( (mode->w == w) && (mode->h == h) ) {
- return(0);
- }
- }
- }
-
- /* Set up the new video mode rectangle */
- mode = (SDL_Rect *)SDL_malloc(sizeof *mode);
- if ( mode == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
- mode->x = 0;
- mode->y = 0;
- mode->w = w;
- mode->h = h;
-#ifdef QTOPIA_DEBUG
- fprintf(stderr, "Adding mode %dx%d at %d bytes per pixel\n", w, h, index+1);
-#endif
-
- /* Allocate the new list of modes, and fill in the new mode */
- next_mode = SDL_nummodes[index];
- SDL_modelist[index] = (SDL_Rect **)
- SDL_realloc(SDL_modelist[index], (1+next_mode+1)*sizeof(SDL_Rect *));
- if ( SDL_modelist[index] == NULL ) {
- SDL_OutOfMemory();
- SDL_nummodes[index] = 0;
- SDL_free(mode);
- return(-1);
- }
- SDL_modelist[index][next_mode] = mode;
- SDL_modelist[index][next_mode+1] = NULL;
- SDL_nummodes[index]++;
-
- return(0);
- }
-
- int QT_VideoInit(_THIS, SDL_PixelFormat *vformat)
- {
- /* Initialize the QPE Application */
- /* Determine the screen depth */
- vformat->BitsPerPixel = QPixmap::defaultDepth();
-
- // For now we hardcode the current depth because anything else
- // might as well be emulated by SDL rather than by Qtopia.
-
- QSize desktop_size = qApp->desktop()->size();
- QT_AddMode(_this, ((vformat->BitsPerPixel+7)/8)-1,
- desktop_size.width(), desktop_size.height());
- QT_AddMode(_this, ((vformat->BitsPerPixel+7)/8)-1,
- desktop_size.height(), desktop_size.width());
-
- /* Determine the current screen size */
- _this->info.current_w = desktop_size.width();
- _this->info.current_h = desktop_size.height();
-
- /* Create the window / widget */
- SDL_Win = new SDL_QWin(QSize(QT_HIDDEN_SIZE, QT_HIDDEN_SIZE));
- ((QPEApplication*)qApp)->showMainWidget(SDL_Win);
- /* Fill in some window manager capabilities */
- _this->info.wm_available = 0;
-
- /* We're done! */
- return(0);
- }
-
- /* We support any dimension at our bit-depth */
- SDL_Rect **QT_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
- {
- SDL_Rect **modes;
-
- modes = ((SDL_Rect **)0);
- if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
- modes = SDL_modelist[((format->BitsPerPixel+7)/8)-1];
- } else {
- if ( format->BitsPerPixel ==
- _this->screen->format->BitsPerPixel ) {
- modes = ((SDL_Rect **)-1);
- }
- }
- return(modes);
- }
-
- /* Various screen update functions available */
- static void QT_NormalUpdate(_THIS, int numrects, SDL_Rect *rects);
-
-
- static int QT_SetFullScreen(_THIS, SDL_Surface *screen, int fullscreen)
- {
- return -1;
- }
-
- static int QT_ToggleFullScreen(_THIS, int fullscreen)
- {
- return -1;
- }
-
- /* FIXME: check return values and cleanup here */
- SDL_Surface *QT_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
- {
-
- QImage *qimage;
- QSize desktop_size = qApp->desktop()->size();
-
-
- current->flags = 0; //SDL_FULLSCREEN; // We always run fullscreen.
-
- if(width <= desktop_size.width()
- && height <= desktop_size.height()) {
- current->w = desktop_size.width();
- current->h = desktop_size.height();
- } else if(width <= desktop_size.height() && height <= desktop_size.width()) {
- // Landscape mode
- char * envString = SDL_getenv(SDL_QT_ROTATION_ENV_NAME);
- int envValue = envString ? atoi(envString) : 0;
- screenRotation = envValue ? SDL_QT_ROTATION_270 : SDL_QT_ROTATION_90;
- current->h = desktop_size.width();
- current->w = desktop_size.height();
- } else {
- SDL_SetError("Unsupported resolution, %dx%d\n", width, height);
- }
- if ( flags & SDL_OPENGL ) {
- SDL_SetError("OpenGL not supported");
- return(NULL);
- }
- /* Create the QImage framebuffer */
- qimage = new QImage(current->w, current->h, bpp);
- if (qimage->isNull()) {
- SDL_SetError("Couldn't create screen bitmap");
- delete qimage;
- return(NULL);
- }
- current->pitch = qimage->bytesPerLine();
- current->pixels = (void *)qimage->bits();
- SDL_Win->setImage(qimage);
- _this->UpdateRects = QT_NormalUpdate;
- SDL_Win->setFullscreen(true);
- /* We're done */
- return(current);
- }
-
- /* Update the current mouse state and position */
- void QT_UpdateMouse(_THIS)
- {
- QPoint point(-1, -1);
- if ( SDL_Win->isActiveWindow() ) {
- point = SDL_Win->mousePos();
- }
-
- if ( (point.x() >= 0) && (point.x() < SDL_VideoSurface->w) &&
- (point.y() >= 0) && (point.y() < SDL_VideoSurface->h) ) {
- SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
- SDL_PrivateMouseMotion(0, 0,
- (Sint16)point.x(), (Sint16)point.y());
- } else {
- SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
- }
- }
-
- /* We don't actually allow hardware surfaces other than the main one */
- static int QT_AllocHWSurface(_THIS, SDL_Surface *surface)
- {
- return(-1);
- }
- static void QT_FreeHWSurface(_THIS, SDL_Surface *surface)
- {
- return;
- }
- static int QT_LockHWSurface(_THIS, SDL_Surface *surface)
- {
- return(0);
- }
- static void QT_UnlockHWSurface(_THIS, SDL_Surface *surface)
- {
- return;
- }
-
- static void QT_NormalUpdate(_THIS, int numrects, SDL_Rect *rects)
- {
- if(SDL_Win->lockScreen()) {
- for(int i=0; i<numrects; ++i ) {
- QRect rect(rects[i].x, rects[i].y,
- rects[i].w, rects[i].h);
- SDL_Win->repaintRect(rect);
- }
- SDL_Win->unlockScreen();
- }
- }
- /* Is the system palette settable? */
- int QT_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
- {
- return -1;
- }
-
- void QT_VideoQuit(_THIS)
- {
- // This is dumb, but if I free this, the app doesn't exit correctly.
- // Of course, this will leak memory if init video is done more than once.
- // Sucks but such is life.
-
- // -- David Hedbor
- // delete SDL_Win;
- // SDL_Win = 0;
- _this->screen->pixels = NULL;
- QT_GrabInput(_this, SDL_GRAB_OFF);
- }
-
- static int QT_IconifyWindow(_THIS) {
- SDL_Win->hide();
-
- return true;
- }
-
- static SDL_GrabMode QT_GrabInput(_THIS, SDL_GrabMode mode) {
- if(mode == SDL_GRAB_OFF) {
- QPEApplication::grabKeyboard();
- qApp->processEvents();
- QPEApplication::ungrabKeyboard();
- } else {
- QPEApplication::grabKeyboard();
- }
- qApp->processEvents();
- return mode;
- }
-
-}; /* Extern C */
diff --git a/distrib/sdl-1.2.12/src/video/qtopia/SDL_syswm.cc b/distrib/sdl-1.2.12/src/video/qtopia/SDL_syswm.cc
deleted file mode 100644
index 0385dbb..0000000
--- a/distrib/sdl-1.2.12/src/video/qtopia/SDL_syswm.cc
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_QWin.h"
-
-extern "C" {
-
-#include "SDL_syswm_c.h"
-
-void QT_SetWMCaption(_THIS, const char *title, const char *icon)
-{
- SDL_Win->setCaption(title);
-}
-
-}; /* Extern C */
diff --git a/distrib/sdl-1.2.12/src/video/qtopia/SDL_syswm_c.h b/distrib/sdl-1.2.12/src/video/qtopia/SDL_syswm_c.h
deleted file mode 100644
index 031269f..0000000
--- a/distrib/sdl-1.2.12/src/video/qtopia/SDL_syswm_c.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_lowvideo.h"
-
-/* Functions to be exported */
-extern void QT_SetWMCaption(_THIS, const char *title, const char *icon);
-
diff --git a/distrib/sdl-1.2.12/src/video/quartz/CGS.h b/distrib/sdl-1.2.12/src/video/quartz/CGS.h
deleted file mode 100644
index 234ff77..0000000
--- a/distrib/sdl-1.2.12/src/video/quartz/CGS.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2003 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- Obscuring code: maximum number of windows above ours (inclusive)
-
- Note: this doesn't work too well in practice and should be
- phased out when we add OpenGL 2D acceleration. It was never
- enabled in the first place, so this shouldn't be a problem ;-)
-*/
-#define kMaxWindows 256
-
-/* Some of the Core Graphics Server API for obscuring code */
-#define kCGSWindowLevelTop 2147483632
-#define kCGSWindowLevelDockIconDrag 500
-#define kCGSWindowLevelDockMenu 101
-#define kCGSWindowLevelMenuIgnore 21
-#define kCGSWindowLevelMenu 20
-#define kCGSWindowLevelDockLabel 12
-#define kCGSWindowLevelDockIcon 11
-#define kCGSWindowLevelDock 10
-#define kCGSWindowLevelUtility 3
-#define kCGSWindowLevelNormal 0
-
-/*
- For completeness; We never use these window levels, they are always below us
- #define kCGSWindowLevelMBarShadow -20
- #define kCGSWindowLevelDesktopPicture -2147483647
- #define kCGSWindowLevelDesktop -2147483648
-*/
-
-typedef CGError CGSError;
-typedef long CGSWindowCount;
-typedef void * CGSConnectionID;
-typedef int CGSWindowID;
-typedef CGSWindowID* CGSWindowIDList;
-typedef CGWindowLevel CGSWindowLevel;
-typedef NSRect CGSRect;
-
-extern CGSConnectionID _CGSDefaultConnection ();
-
-extern CGSError CGSGetOnScreenWindowList (CGSConnectionID cid,
- CGSConnectionID owner,
- CGSWindowCount listCapacity,
- CGSWindowIDList list,
- CGSWindowCount *listCount);
-
-extern CGSError CGSGetScreenRectForWindow (CGSConnectionID cid,
- CGSWindowID wid,
- CGSRect *rect);
-
-extern CGWindowLevel CGSGetWindowLevel (CGSConnectionID cid,
- CGSWindowID wid,
- CGSWindowLevel *level);
-
-extern CGSError CGSDisplayHWFill (CGDirectDisplayID id, unsigned int x, unsigned int y,
- unsigned int w, unsigned int h, unsigned int color);
-
-extern CGSError CGSDisplayCanHWFill (CGDirectDisplayID id);
-
-extern CGSError CGSGetMouseEnabledFlags (CGSConnectionID cid, CGSWindowID wid, int *flags);
-
-int CGSDisplayHWSync (CGDirectDisplayID id);
-
diff --git a/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzEvents.m b/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzEvents.m
deleted file mode 100644
index 6f7f7cb..0000000
--- a/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzEvents.m
+++ /dev/null
@@ -1,984 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2003 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_QuartzVideo.h"
-#include "SDL_QuartzWM.h"
-
-#include <IOKit/IOMessage.h> /* For wake from sleep detection */
-#include <IOKit/pwr_mgt/IOPMLib.h> /* For wake from sleep detection */
-#include "SDL_QuartzKeys.h"
-
-/*
- * In Panther, this header defines device dependent masks for
- * right side keys. These definitions only exist in Panther, but
- * the header seems to exist at least in Jaguar and probably earlier
- * versions of the OS, so this should't break anything.
- */
-#include <IOKit/hidsystem/IOLLEvent.h>
-/*
- * These are not defined before Panther. To keep the code compiling
- * on systems without these, I will define if they don't exist.
- */
-#ifndef NX_DEVICERCTLKEYMASK
- #define NX_DEVICELCTLKEYMASK 0x00000001
-#endif
-#ifndef NX_DEVICELSHIFTKEYMASK
- #define NX_DEVICELSHIFTKEYMASK 0x00000002
-#endif
-#ifndef NX_DEVICERSHIFTKEYMASK
- #define NX_DEVICERSHIFTKEYMASK 0x00000004
-#endif
-#ifndef NX_DEVICELCMDKEYMASK
- #define NX_DEVICELCMDKEYMASK 0x00000008
-#endif
-#ifndef NX_DEVICERCMDKEYMASK
- #define NX_DEVICERCMDKEYMASK 0x00000010
-#endif
-#ifndef NX_DEVICELALTKEYMASK
- #define NX_DEVICELALTKEYMASK 0x00000020
-#endif
-#ifndef NX_DEVICERALTKEYMASK
- #define NX_DEVICERALTKEYMASK 0x00000040
-#endif
-#ifndef NX_DEVICERCTLKEYMASK
- #define NX_DEVICERCTLKEYMASK 0x00002000
-#endif
-
-void QZ_InitOSKeymap (_THIS) {
- const void *KCHRPtr;
- UInt32 state;
- UInt32 value;
- int i;
- int world = SDLK_WORLD_0;
-
- for ( i=0; i<SDL_TABLESIZE(keymap); ++i )
- keymap[i] = SDLK_UNKNOWN;
-
- /* This keymap is almost exactly the same as the OS 9 one */
- keymap[QZ_ESCAPE] = SDLK_ESCAPE;
- keymap[QZ_F1] = SDLK_F1;
- keymap[QZ_F2] = SDLK_F2;
- keymap[QZ_F3] = SDLK_F3;
- keymap[QZ_F4] = SDLK_F4;
- keymap[QZ_F5] = SDLK_F5;
- keymap[QZ_F6] = SDLK_F6;
- keymap[QZ_F7] = SDLK_F7;
- keymap[QZ_F8] = SDLK_F8;
- keymap[QZ_F9] = SDLK_F9;
- keymap[QZ_F10] = SDLK_F10;
- keymap[QZ_F11] = SDLK_F11;
- keymap[QZ_F12] = SDLK_F12;
- keymap[QZ_F13] = SDLK_F13;
- keymap[QZ_F14] = SDLK_F14;
- keymap[QZ_F15] = SDLK_F15;
-/*
- keymap[QZ_PRINT] = SDLK_PRINT;
- keymap[QZ_SCROLLOCK] = SDLK_SCROLLOCK;
- keymap[QZ_PAUSE] = SDLK_PAUSE;
-*/
- keymap[QZ_POWER] = SDLK_POWER;
- keymap[QZ_BACKQUOTE] = SDLK_BACKQUOTE;
- keymap[QZ_1] = SDLK_1;
- keymap[QZ_2] = SDLK_2;
- keymap[QZ_3] = SDLK_3;
- keymap[QZ_4] = SDLK_4;
- keymap[QZ_5] = SDLK_5;
- keymap[QZ_6] = SDLK_6;
- keymap[QZ_7] = SDLK_7;
- keymap[QZ_8] = SDLK_8;
- keymap[QZ_9] = SDLK_9;
- keymap[QZ_0] = SDLK_0;
- keymap[QZ_MINUS] = SDLK_MINUS;
- keymap[QZ_EQUALS] = SDLK_EQUALS;
- keymap[QZ_BACKSPACE] = SDLK_BACKSPACE;
- keymap[QZ_INSERT] = SDLK_INSERT;
- keymap[QZ_HOME] = SDLK_HOME;
- keymap[QZ_PAGEUP] = SDLK_PAGEUP;
- keymap[QZ_NUMLOCK] = SDLK_NUMLOCK;
- keymap[QZ_KP_EQUALS] = SDLK_KP_EQUALS;
- keymap[QZ_KP_DIVIDE] = SDLK_KP_DIVIDE;
- keymap[QZ_KP_MULTIPLY] = SDLK_KP_MULTIPLY;
- keymap[QZ_TAB] = SDLK_TAB;
- keymap[QZ_q] = SDLK_q;
- keymap[QZ_w] = SDLK_w;
- keymap[QZ_e] = SDLK_e;
- keymap[QZ_r] = SDLK_r;
- keymap[QZ_t] = SDLK_t;
- keymap[QZ_y] = SDLK_y;
- keymap[QZ_u] = SDLK_u;
- keymap[QZ_i] = SDLK_i;
- keymap[QZ_o] = SDLK_o;
- keymap[QZ_p] = SDLK_p;
- keymap[QZ_LEFTBRACKET] = SDLK_LEFTBRACKET;
- keymap[QZ_RIGHTBRACKET] = SDLK_RIGHTBRACKET;
- keymap[QZ_BACKSLASH] = SDLK_BACKSLASH;
- keymap[QZ_DELETE] = SDLK_DELETE;
- keymap[QZ_END] = SDLK_END;
- keymap[QZ_PAGEDOWN] = SDLK_PAGEDOWN;
- keymap[QZ_KP7] = SDLK_KP7;
- keymap[QZ_KP8] = SDLK_KP8;
- keymap[QZ_KP9] = SDLK_KP9;
- keymap[QZ_KP_MINUS] = SDLK_KP_MINUS;
- keymap[QZ_CAPSLOCK] = SDLK_CAPSLOCK;
- keymap[QZ_a] = SDLK_a;
- keymap[QZ_s] = SDLK_s;
- keymap[QZ_d] = SDLK_d;
- keymap[QZ_f] = SDLK_f;
- keymap[QZ_g] = SDLK_g;
- keymap[QZ_h] = SDLK_h;
- keymap[QZ_j] = SDLK_j;
- keymap[QZ_k] = SDLK_k;
- keymap[QZ_l] = SDLK_l;
- keymap[QZ_SEMICOLON] = SDLK_SEMICOLON;
- keymap[QZ_QUOTE] = SDLK_QUOTE;
- keymap[QZ_RETURN] = SDLK_RETURN;
- keymap[QZ_KP4] = SDLK_KP4;
- keymap[QZ_KP5] = SDLK_KP5;
- keymap[QZ_KP6] = SDLK_KP6;
- keymap[QZ_KP_PLUS] = SDLK_KP_PLUS;
- keymap[QZ_LSHIFT] = SDLK_LSHIFT;
- keymap[QZ_RSHIFT] = SDLK_RSHIFT;
- keymap[QZ_z] = SDLK_z;
- keymap[QZ_x] = SDLK_x;
- keymap[QZ_c] = SDLK_c;
- keymap[QZ_v] = SDLK_v;
- keymap[QZ_b] = SDLK_b;
- keymap[QZ_n] = SDLK_n;
- keymap[QZ_m] = SDLK_m;
- keymap[QZ_COMMA] = SDLK_COMMA;
- keymap[QZ_PERIOD] = SDLK_PERIOD;
- keymap[QZ_SLASH] = SDLK_SLASH;
- keymap[QZ_UP] = SDLK_UP;
- keymap[QZ_KP1] = SDLK_KP1;
- keymap[QZ_KP2] = SDLK_KP2;
- keymap[QZ_KP3] = SDLK_KP3;
- keymap[QZ_KP_ENTER] = SDLK_KP_ENTER;
- keymap[QZ_LCTRL] = SDLK_LCTRL;
- keymap[QZ_LALT] = SDLK_LALT;
- keymap[QZ_LMETA] = SDLK_LMETA;
- keymap[QZ_RCTRL] = SDLK_RCTRL;
- keymap[QZ_RALT] = SDLK_RALT;
- keymap[QZ_RMETA] = SDLK_RMETA;
- keymap[QZ_SPACE] = SDLK_SPACE;
- keymap[QZ_LEFT] = SDLK_LEFT;
- keymap[QZ_DOWN] = SDLK_DOWN;
- keymap[QZ_RIGHT] = SDLK_RIGHT;
- keymap[QZ_KP0] = SDLK_KP0;
- keymap[QZ_KP_PERIOD] = SDLK_KP_PERIOD;
- keymap[QZ_IBOOK_ENTER] = SDLK_KP_ENTER;
- keymap[QZ_IBOOK_RIGHT] = SDLK_RIGHT;
- keymap[QZ_IBOOK_DOWN] = SDLK_DOWN;
- keymap[QZ_IBOOK_UP] = SDLK_UP;
- keymap[QZ_IBOOK_LEFT] = SDLK_LEFT;
-
- /*
- Up there we setup a static scancode->keysym map. However, it will not
- work very well on international keyboard. Hence we now query MacOS
- for its own keymap to adjust our own mapping table. However, this is
- basically only useful for ascii char keys. This is also the reason
- why we keep the static table, too.
- */
-
- /* Get a pointer to the systems cached KCHR */
- KCHRPtr = (void *)GetScriptManagerVariable(smKCHRCache);
- if (KCHRPtr)
- {
- /* Loop over all 127 possible scan codes */
- for (i = 0; i < 0x7F; i++)
- {
- /* We pretend a clean start to begin with (i.e. no dead keys active */
- state = 0;
-
- /* Now translate the key code to a key value */
- value = KeyTranslate(KCHRPtr, i, &state) & 0xff;
-
- /* If the state become 0, it was a dead key. We need to translate again,
- passing in the new state, to get the actual key value */
- if (state != 0)
- value = KeyTranslate(KCHRPtr, i, &state) & 0xff;
-
- /* Now we should have an ascii value, or 0. Try to figure out to which SDL symbol it maps */
- if (value >= 128) /* Some non-ASCII char, map it to SDLK_WORLD_* */
- keymap[i] = world++;
- else if (value >= 32) /* non-control ASCII char */
- keymap[i] = value;
- }
- }
-
- /*
- The keypad codes are re-setup here, because the loop above cannot
- distinguish between a key on the keypad and a regular key. We maybe
- could get around this problem in another fashion: NSEvent's flags
- include a "NSNumericPadKeyMask" bit; we could check that and modify
- the symbol we return on the fly. However, this flag seems to exhibit
- some weird behaviour related to the num lock key
- */
- keymap[QZ_KP0] = SDLK_KP0;
- keymap[QZ_KP1] = SDLK_KP1;
- keymap[QZ_KP2] = SDLK_KP2;
- keymap[QZ_KP3] = SDLK_KP3;
- keymap[QZ_KP4] = SDLK_KP4;
- keymap[QZ_KP5] = SDLK_KP5;
- keymap[QZ_KP6] = SDLK_KP6;
- keymap[QZ_KP7] = SDLK_KP7;
- keymap[QZ_KP8] = SDLK_KP8;
- keymap[QZ_KP9] = SDLK_KP9;
- keymap[QZ_KP_MINUS] = SDLK_KP_MINUS;
- keymap[QZ_KP_PLUS] = SDLK_KP_PLUS;
- keymap[QZ_KP_PERIOD] = SDLK_KP_PERIOD;
- keymap[QZ_KP_EQUALS] = SDLK_KP_EQUALS;
- keymap[QZ_KP_DIVIDE] = SDLK_KP_DIVIDE;
- keymap[QZ_KP_MULTIPLY] = SDLK_KP_MULTIPLY;
- keymap[QZ_KP_ENTER] = SDLK_KP_ENTER;
-}
-
-static void QZ_DoKey (_THIS, int state, NSEvent *event) {
-
- NSString *chars;
- unsigned int i, numChars, clearChars = 0;
- SDL_keysym key;
-
- /*
- A key event can contain multiple characters,
- or no characters at all. In most cases, it
- will contain a single character. If it contains
- 0 characters, we'll use 0 as the unicode. If it
- contains multiple characters, we'll use 0 as
- the scancode/keysym.
- */
- if (SDL_TranslateUNICODE && state == SDL_PRESSED) {
- [field_edit interpretKeyEvents:[NSArray arrayWithObject:event]];
- chars = [ event characters ];
- numChars = [ chars length ];
- clearChars = 1;
- } else {
- numChars = 0;
- }
-
- if (numChars == 0) {
-
- key.scancode = [ event keyCode ];
- key.sym = keymap [ key.scancode ];
- key.unicode = 0;
- key.mod = KMOD_NONE;
-
- SDL_PrivateKeyboard (state, &key);
- }
- else if (numChars >= 1) {
-
- key.scancode = [ event keyCode ];
- key.sym = keymap [ key.scancode ];
- key.unicode = [ chars characterAtIndex:0 ];
- key.mod = KMOD_NONE;
-
- SDL_PrivateKeyboard (state, &key);
-
- for (i = 1; i < numChars; i++) {
-
- key.scancode = 0;
- key.sym = 0;
- key.unicode = [ chars characterAtIndex:i];
- key.mod = KMOD_NONE;
-
- SDL_PrivateKeyboard (state, &key);
- }
- }
- if (clearChars) {
- [field_edit setString:@""];
- }
-
- if (SDL_getenv ("SDL_ENABLEAPPEVENTS"))
- [ NSApp sendEvent:event ];
-}
-
-/* This is the original behavior, before support was added for
- * differentiating between left and right versions of the keys.
- */
-static void QZ_DoUnsidedModifiers (_THIS, unsigned int newMods) {
-
- const int mapping[] = { SDLK_CAPSLOCK, SDLK_LSHIFT, SDLK_LCTRL, SDLK_LALT, SDLK_LMETA };
-
- int i;
- int bit;
- SDL_keysym key;
-
- key.scancode = 0;
- key.sym = SDLK_UNKNOWN;
- key.unicode = 0;
- key.mod = KMOD_NONE;
-
- /* Iterate through the bits, testing each against the current modifiers */
- for (i = 0, bit = NSAlphaShiftKeyMask; bit <= NSCommandKeyMask; bit <<= 1, ++i) {
-
- unsigned int currentMask, newMask;
-
- currentMask = current_mods & bit;
- newMask = newMods & bit;
-
- if ( currentMask &&
- currentMask != newMask ) { /* modifier up event */
-
- key.sym = mapping[i];
- /* If this was Caps Lock, we need some additional voodoo to make SDL happy */
- if (bit == NSAlphaShiftKeyMask)
- SDL_PrivateKeyboard (SDL_PRESSED, &key);
- SDL_PrivateKeyboard (SDL_RELEASED, &key);
- }
- else if ( newMask &&
- currentMask != newMask ) { /* modifier down event */
-
- key.sym = mapping[i];
- SDL_PrivateKeyboard (SDL_PRESSED, &key);
- /* If this was Caps Lock, we need some additional voodoo to make SDL happy */
- if (bit == NSAlphaShiftKeyMask)
- SDL_PrivateKeyboard (SDL_RELEASED, &key);
- }
- }
-}
-
-/* This is a helper function for QZ_HandleModifierSide. This
- * function reverts back to behavior before the distinction between
- * sides was made.
- */
-static void QZ_HandleNonDeviceModifier ( _THIS, unsigned int device_independent_mask, unsigned int newMods, unsigned int key_sym) {
- unsigned int currentMask, newMask;
- SDL_keysym key;
-
- key.scancode = 0;
- key.sym = key_sym;
- key.unicode = 0;
- key.mod = KMOD_NONE;
-
- /* Isolate just the bits we care about in the depedent bits so we can
- * figure out what changed
- */
- currentMask = current_mods & device_independent_mask;
- newMask = newMods & device_independent_mask;
-
- if ( currentMask &&
- currentMask != newMask ) { /* modifier up event */
- SDL_PrivateKeyboard (SDL_RELEASED, &key);
- }
- else if ( newMask &&
- currentMask != newMask ) { /* modifier down event */
- SDL_PrivateKeyboard (SDL_PRESSED, &key);
- }
-}
-
-/* This is a helper function for QZ_HandleModifierSide.
- * This function sets the actual SDL_PrivateKeyboard event.
- */
-static void QZ_HandleModifierOneSide ( _THIS, unsigned int newMods,
- unsigned int key_sym,
- unsigned int sided_device_dependent_mask ) {
-
- SDL_keysym key;
- unsigned int current_dep_mask, new_dep_mask;
-
- key.scancode = 0;
- key.sym = key_sym;
- key.unicode = 0;
- key.mod = KMOD_NONE;
-
- /* Isolate just the bits we care about in the depedent bits so we can
- * figure out what changed
- */
- current_dep_mask = current_mods & 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
- * find out which it is.
- */
- if( new_dep_mask &&
- current_dep_mask != new_dep_mask ) {
- /* Modifier down event */
- SDL_PrivateKeyboard (SDL_PRESSED, &key);
- }
- else /* Modifier up event */ {
- SDL_PrivateKeyboard (SDL_RELEASED, &key);
- }
-}
-
-/* This is a helper function for QZ_DoSidedModifiers.
- * This function will figure out if the modifier key is the left or right side,
- * e.g. left-shift vs right-shift.
- */
-static void QZ_HandleModifierSide ( _THIS, int device_independent_mask,
- unsigned int newMods,
- unsigned int left_key_sym,
- unsigned int right_key_sym,
- unsigned int left_device_dependent_mask,
- unsigned int right_device_dependent_mask ) {
- unsigned int device_dependent_mask = 0;
- unsigned int diff_mod = 0;
-
- 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
- * keyboard and revert to the unsided behavior.
- */
- if ( (device_dependent_mask & newMods) == 0 ) {
- /* Revert to the old behavior */
- QZ_HandleNonDeviceModifier ( this, device_independent_mask, newMods, left_key_sym );
- return;
- }
-
- /* XOR the previous state against the new state to see if there's a change */
- diff_mod = (device_dependent_mask & current_mods)
- ^ (device_dependent_mask & newMods);
-
- if ( diff_mod ) {
- /* 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.
- */
- if ( left_device_dependent_mask & diff_mod ) {
- QZ_HandleModifierOneSide ( this, newMods, left_key_sym, left_device_dependent_mask );
- }
- if ( right_device_dependent_mask & diff_mod ) {
- QZ_HandleModifierOneSide ( this, newMods, right_key_sym, right_device_dependent_mask );
- }
- }
-}
-
-/* This is a helper function for QZ_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
- * can't still be down).
- */
-static void QZ_ReleaseModifierSide ( _THIS,
- unsigned int device_independent_mask,
- unsigned int newMods,
- unsigned int left_key_sym,
- unsigned int right_key_sym,
- unsigned int left_device_dependent_mask,
- unsigned int right_device_dependent_mask ) {
- unsigned int device_dependent_mask = 0;
- SDL_keysym key;
-
- key.scancode = 0;
- key.sym = SDLK_UNKNOWN;
- key.unicode = 0;
- key.mod = KMOD_NONE;
-
- 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
- * keyboard and revert to the unsided behavior.
- */
- if ( (device_dependent_mask & current_mods) == 0 ) {
- /* In this case, we can't detect the keyboard, so use the left side
- * to represent both, and release it.
- */
- key.sym = left_key_sym;
- SDL_PrivateKeyboard (SDL_RELEASED, &key);
-
- 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.
- * But I'm being paranoid so I want to handle each separately,
- * so I hope this doesn't cause other problems.
- */
- if ( left_device_dependent_mask & current_mods ) {
- key.sym = left_key_sym;
- SDL_PrivateKeyboard (SDL_RELEASED, &key);
- }
- if ( right_device_dependent_mask & current_mods ) {
- key.sym = right_key_sym;
- SDL_PrivateKeyboard (SDL_RELEASED, &key);
- }
-}
-
-/* This is a helper function for QZ_DoSidedModifiers.
- * This function handles the CapsLock case.
- */
-static void QZ_HandleCapsLock (_THIS, unsigned int newMods) {
- unsigned int currentMask, newMask;
- SDL_keysym key;
-
- key.scancode = 0;
- key.sym = SDLK_CAPSLOCK;
- key.unicode = 0;
- key.mod = KMOD_NONE;
-
- currentMask = current_mods & NSAlphaShiftKeyMask;
- newMask = newMods & NSAlphaShiftKeyMask;
-
- if ( currentMask &&
- currentMask != newMask ) { /* modifier up event */
- /* If this was Caps Lock, we need some additional voodoo to make SDL happy */
- SDL_PrivateKeyboard (SDL_PRESSED, &key);
- SDL_PrivateKeyboard (SDL_RELEASED, &key);
- }
- else if ( newMask &&
- currentMask != newMask ) { /* modifier down event */
- /* If this was Caps Lock, we need some additional voodoo to make SDL happy */
- SDL_PrivateKeyboard (SDL_PRESSED, &key);
- SDL_PrivateKeyboard (SDL_RELEASED, &key);
- }
-}
-
-/* This function will handle the modifier keys and also determine the
- * correct side of the key.
- */
-static void QZ_DoSidedModifiers (_THIS, unsigned int newMods) {
- /* Set up arrays for the key syms for the left and right side. */
- const unsigned int left_mapping[] = { SDLK_LSHIFT, SDLK_LCTRL, SDLK_LALT, SDLK_LMETA };
- const unsigned int right_mapping[] = { SDLK_RSHIFT, SDLK_RCTRL, SDLK_RALT, SDLK_RMETA };
- /* 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 };
-
- unsigned int i;
- unsigned int bit;
-
- /* Handle CAPSLOCK separately because it doesn't have a left/right side */
- QZ_HandleCapsLock ( this, newMods );
-
- /* Iterate through the bits, testing each against the current modifiers */
- for (i = 0, bit = NSShiftKeyMask; bit <= NSCommandKeyMask; bit <<= 1, ++i) {
-
- unsigned int currentMask, newMask;
-
- currentMask = current_mods & 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.
- */
- if ( newMask ) {
- QZ_HandleModifierSide ( this, bit, newMods,
- left_mapping[i],
- right_mapping[i],
- left_device_mapping[i],
- right_device_mapping[i] );
- }
- /* If the state changed from pressed to unpressed, we must examine
- * the device dependent bits to release the correct keys.
- */
- else if ( currentMask &&
- currentMask != newMask ) { /* modifier up event */
- QZ_ReleaseModifierSide ( this, bit, newMods,
- left_mapping[i],
- right_mapping[i],
- left_device_mapping[i],
- right_device_mapping[i] );
- }
- }
-}
-
-/* This function is called to handle the modifiers.
- * It will try to distinguish between the left side and right side
- * of the keyboard for those modifiers that qualify if the
- * operating system version supports it. Otherwise, the code
- * will not try to make the distinction.
- */
-static void QZ_DoModifiers (_THIS, unsigned int newMods) {
-
- if (current_mods == newMods)
- return;
-
- /*
- * Starting with Panther (10.3.0), the ability to distinguish between
- * left side and right side modifiers is available.
- */
- if( system_version >= 0x1030 ) {
- QZ_DoSidedModifiers (this, newMods);
- }
- else {
- QZ_DoUnsidedModifiers (this, newMods);
- }
-
- current_mods = newMods;
-}
-
-static void QZ_GetMouseLocation (_THIS, NSPoint *p) {
- *p = [ NSEvent mouseLocation ]; /* global coordinates */
- if (qz_window)
- QZ_PrivateGlobalToLocal (this, p);
- QZ_PrivateCocoaToSDL (this, p);
-}
-
-void QZ_DoActivate (_THIS) {
-
- SDL_PrivateAppActive (1, SDL_APPINPUTFOCUS | (QZ_IsMouseInWindow (this) ? SDL_APPMOUSEFOCUS : 0));
-
- QZ_UpdateCursor(this);
-
- /* Regrab input, only if it was previously grabbed */
- if ( current_grab_mode == SDL_GRAB_ON ) {
-
- /* Restore cursor location if input was grabbed */
- QZ_PrivateWarpCursor (this, cursor_loc.x, cursor_loc.y);
- QZ_ChangeGrabState (this, QZ_ENABLE_GRAB);
- }
- else {
- /* Update SDL's mouse location */
- NSPoint p;
- QZ_GetMouseLocation (this, &p);
- SDL_PrivateMouseMotion (0, 0, p.x, p.y);
- }
-}
-
-void QZ_DoDeactivate (_THIS) {
-
- SDL_PrivateAppActive (0, SDL_APPINPUTFOCUS | SDL_APPMOUSEFOCUS);
-
- /* Get the current cursor location, for restore on activate */
- QZ_GetMouseLocation (this, &cursor_loc);
-
- /* Reassociate mouse and cursor */
- CGAssociateMouseAndMouseCursorPosition (1);
-
- QZ_UpdateCursor(this);
-}
-
-void QZ_SleepNotificationHandler (void * refcon,
- io_service_t service,
- natural_t messageType,
- void * messageArgument )
-{
- SDL_VideoDevice *this = (SDL_VideoDevice*)refcon;
-
- switch(messageType)
- {
- case kIOMessageSystemWillSleep:
- IOAllowPowerChange(power_connection, (long) messageArgument);
- break;
- case kIOMessageCanSystemSleep:
- IOAllowPowerChange(power_connection, (long) messageArgument);
- break;
- case kIOMessageSystemHasPoweredOn:
- /* awake */
- SDL_PrivateExpose();
- break;
- }
-}
-
-void QZ_RegisterForSleepNotifications (_THIS)
-{
- CFRunLoopSourceRef rls;
- IONotificationPortRef thePortRef;
- io_object_t notifier;
-
- power_connection = IORegisterForSystemPower (this, &thePortRef, QZ_SleepNotificationHandler, &notifier);
-
- if (power_connection == 0)
- NSLog(@"SDL: QZ_SleepNotificationHandler() IORegisterForSystemPower failed.");
-
- rls = IONotificationPortGetRunLoopSource (thePortRef);
- CFRunLoopAddSource (CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode);
- CFRelease (rls);
-}
-
-
-/* Try to map Quartz mouse buttons to SDL's lingo... */
-static int QZ_OtherMouseButtonToSDL(int button)
-{
- switch (button)
- {
- case 0:
- return(SDL_BUTTON_LEFT); /* 1 */
- case 1:
- return(SDL_BUTTON_RIGHT); /* 3 */
- case 2:
- return(SDL_BUTTON_MIDDLE); /* 2 */
- }
-
- /* >= 3: skip 4 & 5, since those are the SDL mousewheel buttons. */
- return(button + 3);
-}
-
-
-void QZ_PumpEvents (_THIS)
-{
- static Uint32 screensaverTicks = 0;
- Uint32 nowTicks;
- CGMouseDelta dx, dy;
-
- NSDate *distantPast;
- NSEvent *event;
- NSRect winRect;
- NSAutoreleasePool *pool;
-
- if (!SDL_VideoSurface)
- return; /* don't do anything if there's no screen surface. */
-
- /* Update activity every five seconds to prevent screensaver. --ryan. */
- if (!allow_screensaver) {
- nowTicks = SDL_GetTicks();
- if ((nowTicks - screensaverTicks) > 5000)
- {
- UpdateSystemActivity(UsrActivity);
- screensaverTicks = nowTicks;
- }
- }
-
- pool = [ [ NSAutoreleasePool alloc ] init ];
- distantPast = [ NSDate distantPast ];
-
- winRect = NSMakeRect (0, 0, SDL_VideoSurface->w, SDL_VideoSurface->h);
-
- /* while grabbed, accumulate all mouse moved events into one SDL mouse event */
- dx = 0;
- dy = 0;
-
- do {
-
- /* Poll for an event. This will not block */
- event = [ NSApp nextEventMatchingMask:NSAnyEventMask
- untilDate:distantPast
- inMode: NSDefaultRunLoopMode dequeue:YES ];
- if (event != nil) {
-
- int button;
- unsigned int type;
- BOOL isInGameWin;
-
- #define DO_MOUSE_DOWN(button) do { \
- if ( SDL_GetAppState() & SDL_APPMOUSEFOCUS ) { \
- SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0); \
- expect_mouse_up |= 1<<button; \
- } \
- [ NSApp sendEvent:event ]; \
- } while(0)
-
- #define DO_MOUSE_UP(button) do { \
- if ( expect_mouse_up & (1<<button) ) { \
- SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0); \
- expect_mouse_up &= ~(1<<button); \
- } \
- [ NSApp sendEvent:event ]; \
- } while(0)
-
- type = [ event type ];
- isInGameWin = QZ_IsMouseInWindow (this);
-
- QZ_DoModifiers(this, [ event modifierFlags ] );
-
- switch (type) {
- case NSLeftMouseDown:
- if ( SDL_getenv("SDL_HAS3BUTTONMOUSE") ) {
- DO_MOUSE_DOWN (SDL_BUTTON_LEFT);
- } else {
- if ( NSCommandKeyMask & current_mods ) {
- last_virtual_button = SDL_BUTTON_RIGHT;
- DO_MOUSE_DOWN (SDL_BUTTON_RIGHT);
- }
- else if ( NSAlternateKeyMask & current_mods ) {
- last_virtual_button = SDL_BUTTON_MIDDLE;
- DO_MOUSE_DOWN (SDL_BUTTON_MIDDLE);
- }
- else {
- DO_MOUSE_DOWN (SDL_BUTTON_LEFT);
- }
- }
- break;
-
- case NSLeftMouseUp:
- if ( last_virtual_button != 0 ) {
- DO_MOUSE_UP (last_virtual_button);
- last_virtual_button = 0;
- }
- else {
- DO_MOUSE_UP (SDL_BUTTON_LEFT);
- }
- break;
-
- case NSOtherMouseDown:
- case NSRightMouseDown:
- button = QZ_OtherMouseButtonToSDL([ event buttonNumber ]);
- DO_MOUSE_DOWN (button);
- break;
-
- case NSOtherMouseUp:
- case NSRightMouseUp:
- button = QZ_OtherMouseButtonToSDL([ event buttonNumber ]);
- DO_MOUSE_UP (button);
- break;
-
- case NSSystemDefined:
- /*
- Future: up to 32 "mouse" buttons can be handled.
- if ([event subtype] == 7) {
- unsigned int buttons;
- buttons = [ event data2 ];
- */
- break;
- case NSLeftMouseDragged:
- case NSRightMouseDragged:
- case NSOtherMouseDragged: /* usually middle mouse dragged */
- case NSMouseMoved:
- if ( grab_state == QZ_INVISIBLE_GRAB ) {
-
- /*
- If input is grabbed+hidden, the cursor doesn't move,
- so we have to call the lowlevel window server
- function. This is less accurate but works OK.
- */
- CGMouseDelta dx1, dy1;
- CGGetLastMouseDelta (&dx1, &dy1);
- dx += dx1;
- dy += dy1;
- }
- else {
-
- /*
- Get the absolute mouse location. This is not the
- mouse location after the currently processed event,
- but the *current* mouse location, i.e. after all
- pending events. This means that if there are
- multiple mouse moved events in the queue, we make
- multiple identical calls to SDL_PrivateMouseMotion(),
- but that's no problem since the latter only
- generates SDL events for nonzero movements. In my
- experience on PBG4/10.4.8, this rarely happens anyway.
- */
- NSPoint p;
- QZ_GetMouseLocation (this, &p);
- SDL_PrivateMouseMotion (0, 0, p.x, p.y);
- }
-
- /*
- Handle grab input+cursor visible by warping the cursor back
- into the game window. This still generates a mouse moved event,
- but not as a result of the warp (so it's in the right direction).
- */
- if ( grab_state == QZ_VISIBLE_GRAB && !isInGameWin ) {
-
- NSPoint p;
- QZ_GetMouseLocation (this, &p);
-
- if ( p.x < 0.0 )
- p.x = 0.0;
-
- if ( p.y < 0.0 )
- p.y = 0.0;
-
- if ( p.x >= winRect.size.width )
- p.x = winRect.size.width-1;
-
- if ( p.y >= winRect.size.height )
- p.y = winRect.size.height-1;
-
- QZ_PrivateWarpCursor (this, p.x, p.y);
- }
- else
- if ( !isInGameWin && (SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
-
- SDL_PrivateAppActive (0, SDL_APPMOUSEFOCUS);
-
- if (grab_state == QZ_INVISIBLE_GRAB)
- /*The cursor has left the window even though it is
- disassociated from the mouse (and therefore
- shouldn't move): this can happen with Wacom
- tablets, and it effectively breaks the grab, since
- mouse down events now go to background
- applications. The only possibility to avoid this
- seems to be talking to the tablet driver
- (AppleEvents) to constrain its mapped area to the
- window, which may not be worth the effort. For
- now, handle the condition more gracefully than
- before by reassociating cursor and mouse until the
- cursor enters the window again, making it obvious
- to the user that the grab is broken.*/
- CGAssociateMouseAndMouseCursorPosition (1);
-
- QZ_UpdateCursor(this);
- }
- else
- if ( isInGameWin && (SDL_GetAppState() & (SDL_APPMOUSEFOCUS | SDL_APPINPUTFOCUS)) == SDL_APPINPUTFOCUS ) {
-
- SDL_PrivateAppActive (1, SDL_APPMOUSEFOCUS);
-
- QZ_UpdateCursor(this);
-
- if (grab_state == QZ_INVISIBLE_GRAB) { /*see comment above*/
- QZ_PrivateWarpCursor (this, SDL_VideoSurface->w / 2, SDL_VideoSurface->h / 2);
- CGAssociateMouseAndMouseCursorPosition (0);
- }
- }
- break;
- case NSScrollWheel:
- if ( isInGameWin ) {
- float dy, dx;
- Uint8 button;
- dy = [ event deltaY ];
- dx = [ event deltaX ];
- if ( dy > 0.0 || dx > 0.0 ) /* Scroll up */
- button = SDL_BUTTON_WHEELUP;
- else /* Scroll down */
- button = SDL_BUTTON_WHEELDOWN;
- /* For now, wheel is sent as a quick down+up */
- SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);
- SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);
- }
- break;
- case NSKeyUp:
- QZ_DoKey (this, SDL_RELEASED, event);
- break;
- case NSKeyDown:
- QZ_DoKey (this, SDL_PRESSED, event);
- break;
- case NSFlagsChanged:
- break;
- case NSAppKitDefined:
- [ NSApp sendEvent:event ];
- if ([ event subtype ] == NSApplicationActivatedEventType && (mode_flags & SDL_FULLSCREEN)) {
- /* the default handling of this event seems to reset any cursor set by [NSCursor set] (used by SDL_SetCursor() in fullscreen mode) to the default system arrow cursor */
- SDL_Cursor *sdlc = SDL_GetCursor();
- if (sdlc != NULL && sdlc->wm_cursor != NULL) {
- [ sdlc->wm_cursor->nscursor set ];
- }
- }
- break;
- /* case NSApplicationDefined: break; */
- /* case NSPeriodic: break; */
- /* case NSCursorUpdate: break; */
- default:
- [ NSApp sendEvent:event ];
- }
- }
- } while (event != nil);
-
- /* handle accumulated mouse moved events */
- if (dx != 0 || dy != 0)
- SDL_PrivateMouseMotion (0, 1, dx, dy);
-
- [ pool release ];
-}
-
-void QZ_UpdateMouse (_THIS)
-{
- NSPoint p;
- QZ_GetMouseLocation (this, &p);
- SDL_PrivateAppActive (QZ_IsMouseInWindow (this), SDL_APPMOUSEFOCUS);
- SDL_PrivateMouseMotion (0, 0, p.x, p.y);
-}
diff --git a/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzGL.m b/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzGL.m
deleted file mode 100644
index ef44745..0000000
--- a/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzGL.m
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2003 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_QuartzVideo.h"
-
-/*
- * GL_ARB_Multisample is supposed to be available in 10.1, according to Apple:
- *
- * http://developer.apple.com/opengl/extensions.html#GL_ARB_multisample
- *
- * ...but it isn't in the system headers, according to Sam:
- *
- * http://www.libsdl.org/pipermail/sdl/2003-December/058335.html
- *
- * These are normally enums and not #defines in the system headers.
- *
- * --ryan.
- */
-#if (MAC_OS_X_VERSION_MAX_ALLOWED < 1020)
-#define NSOpenGLPFASampleBuffers ((NSOpenGLPixelFormatAttribute) 55)
-#define NSOpenGLPFASamples ((NSOpenGLPixelFormatAttribute) 56)
-#endif
-
-
-@implementation NSOpenGLContext (CGLContextAccess)
-- (CGLContextObj) cglContext;
-{
- return _contextAuxiliary;
-}
-@end
-
-/* OpenGL helper functions (used internally) */
-
-int QZ_SetupOpenGL (_THIS, int bpp, Uint32 flags) {
-
- NSOpenGLPixelFormatAttribute attr[32];
- NSOpenGLPixelFormat *fmt;
- int i = 0;
- int colorBits = bpp;
-
- /* if a GL library hasn't been loaded at this point, load the default. */
- if (!this->gl_config.driver_loaded) {
- if (QZ_GL_LoadLibrary(this, NULL) == -1)
- return 0;
- }
-
- if ( flags & SDL_FULLSCREEN ) {
-
- attr[i++] = NSOpenGLPFAFullScreen;
- }
- /* In windowed mode, the OpenGL pixel depth must match device pixel depth */
- else if ( colorBits != device_bpp ) {
-
- colorBits = device_bpp;
- }
-
- attr[i++] = NSOpenGLPFAColorSize;
- attr[i++] = colorBits;
-
- attr[i++] = NSOpenGLPFADepthSize;
- attr[i++] = this->gl_config.depth_size;
-
- if ( this->gl_config.double_buffer ) {
- attr[i++] = NSOpenGLPFADoubleBuffer;
- }
-
- if ( this->gl_config.stereo ) {
- attr[i++] = NSOpenGLPFAStereo;
- }
-
- if ( this->gl_config.stencil_size != 0 ) {
- attr[i++] = NSOpenGLPFAStencilSize;
- attr[i++] = this->gl_config.stencil_size;
- }
-
- if ( (this->gl_config.accum_red_size +
- this->gl_config.accum_green_size +
- this->gl_config.accum_blue_size +
- this->gl_config.accum_alpha_size) > 0 ) {
- attr[i++] = NSOpenGLPFAAccumSize;
- attr[i++] = this->gl_config.accum_red_size + this->gl_config.accum_green_size + this->gl_config.accum_blue_size + this->gl_config.accum_alpha_size;
- }
-
- if ( this->gl_config.multisamplebuffers != 0 ) {
- attr[i++] = NSOpenGLPFASampleBuffers;
- attr[i++] = this->gl_config.multisamplebuffers;
- }
-
- if ( this->gl_config.multisamplesamples != 0 ) {
- attr[i++] = NSOpenGLPFASamples;
- attr[i++] = this->gl_config.multisamplesamples;
- attr[i++] = NSOpenGLPFANoRecovery;
- }
-
- if ( this->gl_config.accelerated > 0 ) {
- attr[i++] = NSOpenGLPFAAccelerated;
- }
-
- attr[i++] = NSOpenGLPFAScreenMask;
- attr[i++] = CGDisplayIDToOpenGLDisplayMask (display_id);
- attr[i] = 0;
-
- fmt = [ [ NSOpenGLPixelFormat alloc ] initWithAttributes:attr ];
- if (fmt == nil) {
- SDL_SetError ("Failed creating OpenGL pixel format");
- return 0;
- }
-
- gl_context = [ [ NSOpenGLContext alloc ] initWithFormat:fmt
- shareContext:nil];
-
- [ fmt release ];
-
- if (gl_context == nil) {
- SDL_SetError ("Failed creating OpenGL context");
- return 0;
- }
-
- /* Synchronize QZ_GL_SwapBuffers() to vertical retrace.
- * (Apple's documentation is not completely clear about what this setting
- * exactly does, IMHO - for a detailed explanation see
- * http://lists.apple.com/archives/mac-opengl/2006/Jan/msg00080.html )
- */
- if ( this->gl_config.swap_control >= 0 ) {
- long value;
- value = this->gl_config.swap_control;
- [ gl_context setValues: &value forParameter: NSOpenGLCPSwapInterval ];
- }
-
- /*
- * 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
-
- {
- long cache_max = 64;
- CGLContextObj ctx = [ gl_context cglContext ];
- 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. */
-
- return 1;
-}
-
-void QZ_TearDownOpenGL (_THIS) {
-
- [ NSOpenGLContext clearCurrentContext ];
- [ gl_context clearDrawable ];
- [ gl_context release ];
-}
-
-
-/* SDL OpenGL functions */
-static const char *DEFAULT_OPENGL_LIB_NAME =
- "/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib";
-
-int QZ_GL_LoadLibrary (_THIS, const char *location) {
- if ( gl_context != NULL ) {
- SDL_SetError("OpenGL context already created");
- return -1;
- }
-
- if (opengl_library != NULL)
- SDL_UnloadObject(opengl_library);
-
- if (location == NULL)
- location = DEFAULT_OPENGL_LIB_NAME;
-
- opengl_library = SDL_LoadObject(location);
- if (opengl_library != NULL) {
- this->gl_config.driver_loaded = 1;
- return 0;
- }
-
- this->gl_config.driver_loaded = 0;
- return -1;
-}
-
-void* QZ_GL_GetProcAddress (_THIS, const char *proc) {
- return SDL_LoadFunction(opengl_library, proc);
-}
-
-int QZ_GL_GetAttribute (_THIS, SDL_GLattr attrib, int* value) {
-
- GLenum attr = 0;
-
- QZ_GL_MakeCurrent (this);
-
- switch (attrib) {
- case SDL_GL_RED_SIZE: attr = GL_RED_BITS; break;
- case SDL_GL_BLUE_SIZE: attr = GL_BLUE_BITS; break;
- case SDL_GL_GREEN_SIZE: attr = GL_GREEN_BITS; break;
- case SDL_GL_ALPHA_SIZE: attr = GL_ALPHA_BITS; break;
- case SDL_GL_DOUBLEBUFFER: attr = GL_DOUBLEBUFFER; break;
- case SDL_GL_DEPTH_SIZE: attr = GL_DEPTH_BITS; break;
- case SDL_GL_STENCIL_SIZE: attr = GL_STENCIL_BITS; break;
- case SDL_GL_ACCUM_RED_SIZE: attr = GL_ACCUM_RED_BITS; break;
- case SDL_GL_ACCUM_GREEN_SIZE: attr = GL_ACCUM_GREEN_BITS; break;
- case SDL_GL_ACCUM_BLUE_SIZE: attr = GL_ACCUM_BLUE_BITS; break;
- case SDL_GL_ACCUM_ALPHA_SIZE: attr = GL_ACCUM_ALPHA_BITS; break;
- case SDL_GL_STEREO: attr = GL_STEREO; break;
- case SDL_GL_MULTISAMPLEBUFFERS: attr = GL_SAMPLE_BUFFERS_ARB; break;
- case SDL_GL_MULTISAMPLESAMPLES: attr = GL_SAMPLES_ARB; break;
- case SDL_GL_BUFFER_SIZE:
- {
- GLint bits = 0;
- GLint component;
-
- /* there doesn't seem to be a single flag in OpenGL for this! */
- glGetIntegerv (GL_RED_BITS, &component); bits += component;
- glGetIntegerv (GL_GREEN_BITS,&component); bits += component;
- glGetIntegerv (GL_BLUE_BITS, &component); bits += component;
- glGetIntegerv (GL_ALPHA_BITS, &component); bits += component;
-
- *value = bits;
- return 0;
- }
- case SDL_GL_ACCELERATED_VISUAL:
- {
- long val;
- /* FIXME: How do we get this information here?
- [fmt getValues: &val forAttribute: NSOpenGLPFAAccelerated attr forVirtualScreen: 0];
- */
- val = (this->gl_config.accelerated != 0);;
- *value = val;
- return 0;
- }
- case SDL_GL_SWAP_CONTROL:
- {
- long val;
- [ gl_context getValues: &val forParameter: NSOpenGLCPSwapInterval ];
- *value = val;
- return 0;
- }
- }
-
- glGetIntegerv (attr, (GLint *)value);
- return 0;
-}
-
-int QZ_GL_MakeCurrent (_THIS) {
- [ gl_context makeCurrentContext ];
- return 0;
-}
-
-void QZ_GL_SwapBuffers (_THIS) {
- [ gl_context flushBuffer ];
-}
diff --git a/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzKeys.h b/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzKeys.h
deleted file mode 100644
index 8b1c13b..0000000
--- a/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzKeys.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2003 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* These are the Macintosh key scancode constants -- from Inside Macintosh */
-
-#define QZ_ESCAPE 0x35
-#define QZ_F1 0x7A
-#define QZ_F2 0x78
-#define QZ_F3 0x63
-#define QZ_F4 0x76
-#define QZ_F5 0x60
-#define QZ_F6 0x61
-#define QZ_F7 0x62
-#define QZ_F8 0x64
-#define QZ_F9 0x65
-#define QZ_F10 0x6D
-#define QZ_F11 0x67
-#define QZ_F12 0x6F
-#define QZ_F13 0x69
-#define QZ_F14 0x6B
-#define QZ_F15 0x71
-/*
-#define QZ_PRINT 0x69
-#define QZ_SCROLLOCK 0x6B
-#define QZ_PAUSE 0x71
-*/
-#define QZ_POWER 0x7F
-#define QZ_BACKQUOTE 0x32
-#define QZ_1 0x12
-#define QZ_2 0x13
-#define QZ_3 0x14
-#define QZ_4 0x15
-#define QZ_5 0x17
-#define QZ_6 0x16
-#define QZ_7 0x1A
-#define QZ_8 0x1C
-#define QZ_9 0x19
-#define QZ_0 0x1D
-#define QZ_MINUS 0x1B
-#define QZ_EQUALS 0x18
-#define QZ_BACKSPACE 0x33
-#define QZ_INSERT 0x72
-#define QZ_HOME 0x73
-#define QZ_PAGEUP 0x74
-#define QZ_NUMLOCK 0x47
-#define QZ_KP_EQUALS 0x51
-#define QZ_KP_DIVIDE 0x4B
-#define QZ_KP_MULTIPLY 0x43
-#define QZ_TAB 0x30
-#define QZ_q 0x0C
-#define QZ_w 0x0D
-#define QZ_e 0x0E
-#define QZ_r 0x0F
-#define QZ_t 0x11
-#define QZ_y 0x10
-#define QZ_u 0x20
-#define QZ_i 0x22
-#define QZ_o 0x1F
-#define QZ_p 0x23
-#define QZ_LEFTBRACKET 0x21
-#define QZ_RIGHTBRACKET 0x1E
-#define QZ_BACKSLASH 0x2A
-#define QZ_DELETE 0x75
-#define QZ_END 0x77
-#define QZ_PAGEDOWN 0x79
-#define QZ_KP7 0x59
-#define QZ_KP8 0x5B
-#define QZ_KP9 0x5C
-#define QZ_KP_MINUS 0x4E
-#define QZ_CAPSLOCK 0x39
-#define QZ_a 0x00
-#define QZ_s 0x01
-#define QZ_d 0x02
-#define QZ_f 0x03
-#define QZ_g 0x05
-#define QZ_h 0x04
-#define QZ_j 0x26
-#define QZ_k 0x28
-#define QZ_l 0x25
-#define QZ_SEMICOLON 0x29
-#define QZ_QUOTE 0x27
-#define QZ_RETURN 0x24
-#define QZ_KP4 0x56
-#define QZ_KP5 0x57
-#define QZ_KP6 0x58
-#define QZ_KP_PLUS 0x45
-#define QZ_LSHIFT 0x38
-#define QZ_z 0x06
-#define QZ_x 0x07
-#define QZ_c 0x08
-#define QZ_v 0x09
-#define QZ_b 0x0B
-#define QZ_n 0x2D
-#define QZ_m 0x2E
-#define QZ_COMMA 0x2B
-#define QZ_PERIOD 0x2F
-#define QZ_SLASH 0x2C
-#if 1 /* Panther now defines right side keys */
-#define QZ_RSHIFT 0x3C
-#endif
-#define QZ_UP 0x7E
-#define QZ_KP1 0x53
-#define QZ_KP2 0x54
-#define QZ_KP3 0x55
-#define QZ_KP_ENTER 0x4C
-#define QZ_LCTRL 0x3B
-#define QZ_LALT 0x3A
-#define QZ_LMETA 0x37
-#define QZ_SPACE 0x31
-#if 1 /* Panther now defines right side keys */
-#define QZ_RMETA 0x36
-#define QZ_RALT 0x3D
-#define QZ_RCTRL 0x3E
-#endif
-#define QZ_LEFT 0x7B
-#define QZ_DOWN 0x7D
-#define QZ_RIGHT 0x7C
-#define QZ_KP0 0x52
-#define QZ_KP_PERIOD 0x41
-
-/* Wierd, these keys are on my iBook under Mac OS X */
-#define QZ_IBOOK_ENTER 0x34
-#define QZ_IBOOK_LEFT 0x3B
-#define QZ_IBOOK_RIGHT 0x3C
-#define QZ_IBOOK_DOWN 0x3D
-#define QZ_IBOOK_UP 0x3E
diff --git a/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzVideo.h b/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzVideo.h
deleted file mode 100644
index 404803d..0000000
--- a/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzVideo.h
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2003 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- @file SDL_QuartzVideo.h
- @author Darrell Walisser, Max Horn, et al.
-
- @abstract SDL video driver for Mac OS X.
-
- @discussion
-
- TODO
- - Hardware Cursor support with NSCursor instead of Carbon
- - Keyboard repeat/mouse speed adjust (if needed)
- - Multiple monitor support (currently only main display)
- - Accelerated blitting support
- - Fix white OpenGL window on minimize (fixed) (update: broken again on 10.2)
- - Find out what events should be sent/ignored if window is minimized
- - Find a way to deal with external resolution/depth switch while app is running
- - Check accuracy of QZ_SetGamma()
- Problems:
- - OGL not working in full screen with software renderer
- - SetColors sets palette correctly but clears framebuffer
- - Crash in CG after several mode switches (I think this has been fixed)
- - Retained windows don't draw their title bar quite right (OS Bug) (not using retained windows)
- - Cursor in 8 bit modes is screwy (might just be Radeon PCI bug) (update: not just Radeon)
- - Warping cursor delays mouse events for a fraction of a second,
- there is a hack around this that helps a bit
-*/
-
-/* Needs to be first, so QuickTime.h doesn't include glext.h (10.4) */
-#include "SDL_opengl.h"
-
-#include <Cocoa/Cocoa.h>
-#include <Carbon/Carbon.h>
-#include <QuickTime/QuickTime.h>
-#include <OpenGL/OpenGL.h> /* For CGL functions and types */
-#include <IOKit/IOKitLib.h> /* For powersave handling */
-#include <pthread.h>
-
-#include "SDL_thread.h"
-#include "SDL_video.h"
-#include "SDL_error.h"
-#include "SDL_timer.h"
-#include "SDL_loadso.h"
-#include "SDL_syswm.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-
-/*
- This is a workaround to directly access NSOpenGLContext's CGL context
- We need this to check for errors NSOpenGLContext doesn't support
-*/
-@interface NSOpenGLContext (CGLContextAccess)
-- (CGLContextObj) cglContext;
-@end
-
-
-/* Main driver structure to store required state information */
-typedef struct SDL_PrivateVideoData {
-
- BOOL allow_screensaver; /* 0 == disable screensaver */
- CGDirectDisplayID display; /* 0 == main display (only support single display) */
- CFDictionaryRef mode; /* current mode of the display */
- CFDictionaryRef save_mode; /* original mode of the display */
- CFArrayRef mode_list; /* list of available fullscreen modes */
- CGDirectPaletteRef palette; /* palette of an 8-bit display */
- NSOpenGLContext *gl_context; /* OpenGL rendering context */
- Uint32 width, height, bpp; /* frequently used data about the display */
- Uint32 flags; /* flags for current mode, for teardown purposes */
- Uint32 video_set; /* boolean; indicates if video was set correctly */
- Uint32 warp_flag; /* boolean; notify to event loop that a warp just occured */
- Uint32 warp_ticks; /* timestamp when the warp occured */
- NSWindow *window; /* Cocoa window to implement the SDL window */
- NSQuickDrawView *view; /* the window's view; draw 2D and OpenGL into this view */
- SDL_Surface *resize_icon; /* icon for the resize badge, we have to draw it by hand */
- SDL_GrabMode current_grab_mode; /* default value is SDL_GRAB_OFF */
- SDL_Rect **client_mode_list; /* resolution list to pass back to client */
- SDLKey keymap[256]; /* Mac OS X to SDL key mapping */
- Uint32 current_mods; /* current keyboard modifiers, to track modifier state */
- NSText *field_edit; /* a field editor for keyboard composition processing */
- Uint32 last_virtual_button;/* last virtual mouse button pressed */
- io_connect_t power_connection; /* used with IOKit to detect wake from sleep */
- Uint8 expect_mouse_up; /* used to determine when to send mouse up events */
- Uint8 grab_state; /* used to manage grab behavior */
- NSPoint cursor_loc; /* saved cursor coords, for activate/deactivate when grabbed */
- BOOL cursor_should_be_visible; /* tells if cursor is supposed to be visible (SDL_ShowCursor) */
- BOOL cursor_visible; /* tells if cursor is *actually* visible or not */
- Uint8* sw_buffers[2]; /* pointers to the two software buffers for double-buffer emulation */
- SDL_Thread *thread; /* thread for async updates to the screen */
- SDL_sem *sem1, *sem2; /* synchronization for async screen updates */
- Uint8 *current_buffer; /* the buffer being copied to the screen */
- BOOL quit_thread; /* used to quit the async blitting thread */
- SInt32 system_version; /* used to dis-/enable workarounds depending on the system version */
-
- ImageDescriptionHandle yuv_idh;
- MatrixRecordPtr yuv_matrix;
- DecompressorComponent yuv_codec;
- ImageSequence yuv_seq;
- PlanarPixmapInfoYUV420 *yuv_pixmap;
- Sint16 yuv_width, yuv_height;
- CGrafPtr yuv_port;
-
- void *opengl_library; /* dynamically loaded OpenGL library. */
-} SDL_PrivateVideoData;
-
-#define _THIS SDL_VideoDevice *this
-#define display_id (this->hidden->display)
-#define mode (this->hidden->mode)
-#define save_mode (this->hidden->save_mode)
-#define allow_screensaver (this->hidden->allow_screensaver)
-#define mode_list (this->hidden->mode_list)
-#define palette (this->hidden->palette)
-#define gl_context (this->hidden->gl_context)
-#define device_width (this->hidden->width)
-#define device_height (this->hidden->height)
-#define device_bpp (this->hidden->bpp)
-#define mode_flags (this->hidden->flags)
-#define qz_window (this->hidden->window)
-#define window_view (this->hidden->view)
-#define video_set (this->hidden->video_set)
-#define warp_ticks (this->hidden->warp_ticks)
-#define warp_flag (this->hidden->warp_flag)
-#define resize_icon (this->hidden->resize_icon)
-#define current_grab_mode (this->hidden->current_grab_mode)
-#define client_mode_list (this->hidden->client_mode_list)
-#define keymap (this->hidden->keymap)
-#define current_mods (this->hidden->current_mods)
-#define field_edit (this->hidden->field_edit)
-#define last_virtual_button (this->hidden->last_virtual_button)
-#define power_connection (this->hidden->power_connection)
-#define expect_mouse_up (this->hidden->expect_mouse_up)
-#define grab_state (this->hidden->grab_state)
-#define cursor_loc (this->hidden->cursor_loc)
-#define cursor_should_be_visible (this->hidden->cursor_should_be_visible)
-#define cursor_visible (this->hidden->cursor_visible)
-#define sw_buffers (this->hidden->sw_buffers)
-#define thread (this->hidden->thread)
-#define sem1 (this->hidden->sem1)
-#define sem2 (this->hidden->sem2)
-#define current_buffer (this->hidden->current_buffer)
-#define quit_thread (this->hidden->quit_thread)
-#define system_version (this->hidden->system_version)
-#define opengl_library (this->hidden->opengl_library)
-
-/* grab states - the input is in one of these states */
-enum {
- QZ_UNGRABBED = 0,
- QZ_VISIBLE_GRAB,
- QZ_INVISIBLE_GRAB
-};
-
-/* grab actions - these can change the grabbed state */
-enum {
- QZ_ENABLE_GRAB = 0,
- QZ_DISABLE_GRAB,
- QZ_HIDECURSOR,
- QZ_SHOWCURSOR
-};
-
-/* Gamma Functions */
-int QZ_SetGamma (_THIS, float red, float green, float blue);
-int QZ_GetGamma (_THIS, float *red, float *green, float *blue);
-int QZ_SetGammaRamp (_THIS, Uint16 *ramp);
-int QZ_GetGammaRamp (_THIS, Uint16 *ramp);
-
-/* OpenGL functions */
-int QZ_SetupOpenGL (_THIS, int bpp, Uint32 flags);
-void QZ_TearDownOpenGL (_THIS);
-void* QZ_GL_GetProcAddress (_THIS, const char *proc);
-int QZ_GL_GetAttribute (_THIS, SDL_GLattr attrib, int* value);
-int QZ_GL_MakeCurrent (_THIS);
-void QZ_GL_SwapBuffers (_THIS);
-int QZ_GL_LoadLibrary (_THIS, const char *location);
-
-/* Cursor and Mouse functions */
-void QZ_FreeWMCursor (_THIS, WMcursor *cursor);
-WMcursor* QZ_CreateWMCursor (_THIS, Uint8 *data, Uint8 *mask,
- int w, int h, int hot_x, int hot_y);
-int QZ_ShowWMCursor (_THIS, WMcursor *cursor);
-void QZ_WarpWMCursor (_THIS, Uint16 x, Uint16 y);
-void QZ_MoveWMCursor (_THIS, int x, int y);
-void QZ_CheckMouseMode (_THIS);
-void QZ_UpdateMouse (_THIS);
-
-/* Event functions */
-void QZ_InitOSKeymap (_THIS);
-void QZ_PumpEvents (_THIS);
-
-/* Window Manager functions */
-void QZ_SetCaption (_THIS, const char *title, const char *icon);
-void QZ_SetIcon (_THIS, SDL_Surface *icon, Uint8 *mask);
-int QZ_IconifyWindow (_THIS);
-void QZ_SetWindowPos (_THIS, int x, int y);
-void QZ_GetWindowPos (_THIS, int *px, int *py);
-int QZ_IsWindowVisible (_THIS, int recenter);
-int QZ_GetMonitorDPI (_THIS, int *xDpi, int *yDpi);
-int QZ_GetMonitorRect (_THIS, SDL_Rect *rect);
-
-SDL_GrabMode QZ_GrabInput (_THIS, SDL_GrabMode grab_mode);
-int QZ_GetWMInfo (_THIS, SDL_SysWMinfo *info);
-
-/* YUV functions */
-SDL_Overlay* QZ_CreateYUVOverlay (_THIS, int width, int height,
- Uint32 format, SDL_Surface *display);
-
-
-/* Private functions (used internally) */
-void QZ_PrivateWarpCursor (_THIS, int x, int y);
-void QZ_ChangeGrabState (_THIS, int action);
-void QZ_RegisterForSleepNotifications (_THIS);
-void QZ_PrivateGlobalToLocal (_THIS, NSPoint *p);
-void QZ_PrivateCocoaToSDL (_THIS, NSPoint *p);
-BOOL QZ_IsMouseInWindow (_THIS);
-void QZ_DoActivate (_THIS);
-void QZ_DoDeactivate (_THIS);
diff --git a/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzVideo.m b/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzVideo.m
deleted file mode 100644
index 5edd60b..0000000
--- a/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzVideo.m
+++ /dev/null
@@ -1,1691 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2003 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_QuartzVideo.h"
-#include "SDL_QuartzWindow.h"
-#include "SDL_QuartzWM.h"
-
-/*
- 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
-
-
-/* Bootstrap functions */
-static int QZ_Available ();
-static SDL_VideoDevice* QZ_CreateDevice (int device_index);
-static void QZ_DeleteDevice (SDL_VideoDevice *device);
-
-/* Initialization, Query, Setup, and Redrawing functions */
-static int QZ_VideoInit (_THIS, SDL_PixelFormat *video_format);
-
-static SDL_Rect** QZ_ListModes (_THIS, SDL_PixelFormat *format,
- Uint32 flags);
-static void QZ_UnsetVideoMode (_THIS, BOOL to_desktop);
-
-static SDL_Surface* QZ_SetVideoMode (_THIS, SDL_Surface *current,
- int width, int height, int bpp,
- Uint32 flags);
-static int QZ_ToggleFullScreen (_THIS, int on);
-static int QZ_SetColors (_THIS, int first_color,
- int num_colors, SDL_Color *colors);
-
-static int QZ_LockDoubleBuffer (_THIS, SDL_Surface *surface);
-static void QZ_UnlockDoubleBuffer (_THIS, SDL_Surface *surface);
-static int QZ_ThreadFlip (_THIS);
-static int QZ_FlipDoubleBuffer (_THIS, SDL_Surface *surface);
-static void QZ_DoubleBufferUpdate (_THIS, int num_rects, SDL_Rect *rects);
-
-static void QZ_DirectUpdate (_THIS, int num_rects, SDL_Rect *rects);
-static int QZ_LockWindow (_THIS, SDL_Surface *surface);
-static void QZ_UnlockWindow (_THIS, SDL_Surface *surface);
-static void QZ_UpdateRects (_THIS, int num_rects, SDL_Rect *rects);
-static void QZ_VideoQuit (_THIS);
-
-/* Hardware surface functions (for fullscreen mode only) */
-#if 0 /* Not used (apparently, it's really slow) */
-static int QZ_FillHWRect (_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color);
-#endif
-static int QZ_LockHWSurface(_THIS, SDL_Surface *surface);
-static void QZ_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static int QZ_AllocHWSurface(_THIS, SDL_Surface *surface);
-static void QZ_FreeHWSurface (_THIS, SDL_Surface *surface);
-/* static int QZ_FlipHWSurface (_THIS, SDL_Surface *surface); */
-
-/* Bootstrap binding, enables entry point into the driver */
-VideoBootStrap QZ_bootstrap = {
- "Quartz", "Mac OS X CoreGraphics", QZ_Available, QZ_CreateDevice
-};
-
-
-/* Bootstrap functions */
-static int QZ_Available () {
- return 1;
-}
-
-static SDL_VideoDevice* QZ_CreateDevice (int device_index) {
-
-#pragma unused (device_index)
-
- SDL_VideoDevice *device;
- SDL_PrivateVideoData *hidden;
-
- device = (SDL_VideoDevice*) SDL_malloc (sizeof (*device) );
- hidden = (SDL_PrivateVideoData*) SDL_malloc (sizeof (*hidden) );
-
- if (device == NULL || hidden == NULL)
- SDL_OutOfMemory ();
-
- SDL_memset (device, 0, sizeof (*device) );
- SDL_memset (hidden, 0, sizeof (*hidden) );
-
- device->hidden = hidden;
-
- device->VideoInit = QZ_VideoInit;
- device->ListModes = QZ_ListModes;
- device->SetVideoMode = QZ_SetVideoMode;
- device->ToggleFullScreen = QZ_ToggleFullScreen;
- device->UpdateMouse = QZ_UpdateMouse;
- device->SetColors = QZ_SetColors;
- /* device->UpdateRects = QZ_UpdateRects; this is determined by SetVideoMode() */
- device->VideoQuit = QZ_VideoQuit;
-
- device->LockHWSurface = QZ_LockHWSurface;
- device->UnlockHWSurface = QZ_UnlockHWSurface;
- device->AllocHWSurface = QZ_AllocHWSurface;
- device->FreeHWSurface = QZ_FreeHWSurface;
- /* device->FlipHWSurface = QZ_FlipHWSurface */;
-
- device->SetGamma = QZ_SetGamma;
- device->GetGamma = QZ_GetGamma;
- device->SetGammaRamp = QZ_SetGammaRamp;
- device->GetGammaRamp = QZ_GetGammaRamp;
-
- device->GL_GetProcAddress = QZ_GL_GetProcAddress;
- device->GL_GetAttribute = QZ_GL_GetAttribute;
- device->GL_MakeCurrent = QZ_GL_MakeCurrent;
- device->GL_SwapBuffers = QZ_GL_SwapBuffers;
- device->GL_LoadLibrary = QZ_GL_LoadLibrary;
-
- device->FreeWMCursor = QZ_FreeWMCursor;
- device->CreateWMCursor = QZ_CreateWMCursor;
- device->ShowWMCursor = QZ_ShowWMCursor;
- device->WarpWMCursor = QZ_WarpWMCursor;
- device->MoveWMCursor = QZ_MoveWMCursor;
- device->CheckMouseMode = QZ_CheckMouseMode;
- device->InitOSKeymap = QZ_InitOSKeymap;
- device->PumpEvents = QZ_PumpEvents;
-
- device->SetCaption = QZ_SetCaption;
- device->SetIcon = QZ_SetIcon;
- device->IconifyWindow = QZ_IconifyWindow;
- device->SetWindowPos = QZ_SetWindowPos;
- device->GetWindowPos = QZ_GetWindowPos;
- device->IsWindowVisible = QZ_IsWindowVisible;
- device->GetMonitorDPI = QZ_GetMonitorDPI;
- device->GetMonitorRect = QZ_GetMonitorRect;
- device->GetWMInfo = QZ_GetWMInfo;
- device->GrabInput = QZ_GrabInput;
-
- device->CreateYUVOverlay = QZ_CreateYUVOverlay;
-
- device->free = QZ_DeleteDevice;
-
- return device;
-}
-
-static void QZ_DeleteDevice (SDL_VideoDevice *device) {
-
- SDL_free (device->hidden);
- SDL_free (device);
-}
-
-static int QZ_VideoInit (_THIS, SDL_PixelFormat *video_format) {
-
- NSRect r = NSMakeRect(0.0, 0.0, 0.0, 0.0);
- const char *env = NULL;
-
- /* Initialize the video settings; this data persists between mode switches */
- display_id = kCGDirectMainDisplay;
- save_mode = CGDisplayCurrentMode (display_id);
- mode_list = CGDisplayAvailableModes (display_id);
- palette = CGPaletteCreateDefaultColorPalette ();
-
- env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
- allow_screensaver = ( env && SDL_atoi(env) ) ? YES : NO;
-
- /* Gather some information that is useful to know about the display */
- CFNumberGetValue (CFDictionaryGetValue (save_mode, kCGDisplayBitsPerPixel),
- kCFNumberSInt32Type, &device_bpp);
-
- CFNumberGetValue (CFDictionaryGetValue (save_mode, kCGDisplayWidth),
- kCFNumberSInt32Type, &device_width);
-
- CFNumberGetValue (CFDictionaryGetValue (save_mode, kCGDisplayHeight),
- kCFNumberSInt32Type, &device_height);
-
- /* Determine the current screen size */
- this->info.current_w = device_width;
- this->info.current_h = device_height;
-
- /* Determine the default screen depth */
- video_format->BitsPerPixel = device_bpp;
-
- /* Set misc globals */
- current_grab_mode = SDL_GRAB_OFF;
- cursor_should_be_visible = YES;
- cursor_visible = YES;
- current_mods = 0;
- field_edit = [[NSTextView alloc] initWithFrame:r];
-
- if ( Gestalt(gestaltSystemVersion, &system_version) != noErr )
- system_version = 0;
-
- /* register for sleep notifications so wake from sleep generates SDL_VIDEOEXPOSE */
- QZ_RegisterForSleepNotifications (this);
-
- /* Fill in some window manager capabilities */
- this->info.wm_available = 1;
-
- return 0;
-}
-
-static SDL_Rect** QZ_ListModes (_THIS, SDL_PixelFormat *format, Uint32 flags) {
-
- CFIndex num_modes;
- CFIndex i;
-
- int list_size = 0;
-
- /* Any windowed mode is acceptable */
- if ( (flags & SDL_FULLSCREEN) == 0 )
- return (SDL_Rect**)-1;
-
- /* Free memory from previous call, if any */
- if ( client_mode_list != NULL ) {
-
- int i;
-
- for (i = 0; client_mode_list[i] != NULL; i++)
- SDL_free (client_mode_list[i]);
-
- SDL_free (client_mode_list);
- client_mode_list = NULL;
- }
-
- num_modes = CFArrayGetCount (mode_list);
-
- /* Build list of modes with the requested bpp */
- for (i = 0; i < num_modes; i++) {
-
- CFDictionaryRef onemode;
- CFNumberRef number;
- int bpp;
-
- onemode = CFArrayGetValueAtIndex (mode_list, i);
- number = CFDictionaryGetValue (onemode, kCGDisplayBitsPerPixel);
- CFNumberGetValue (number, kCFNumberSInt32Type, &bpp);
-
- if (bpp == format->BitsPerPixel) {
-
- int intvalue;
- int hasMode;
- int width, height;
-
- number = CFDictionaryGetValue (onemode, kCGDisplayWidth);
- CFNumberGetValue (number, kCFNumberSInt32Type, &intvalue);
- width = (Uint16) intvalue;
-
- number = CFDictionaryGetValue (onemode, kCGDisplayHeight);
- CFNumberGetValue (number, kCFNumberSInt32Type, &intvalue);
- height = (Uint16) intvalue;
-
- /* Check if mode is already in the list */
- {
- int i;
- hasMode = SDL_FALSE;
- for (i = 0; i < list_size; i++) {
- if (client_mode_list[i]->w == width &&
- client_mode_list[i]->h == height) {
- hasMode = SDL_TRUE;
- break;
- }
- }
- }
-
- /* Grow the list and add mode to the list */
- if ( ! hasMode ) {
-
- SDL_Rect *rect;
-
- list_size++;
-
- if (client_mode_list == NULL)
- client_mode_list = (SDL_Rect**)
- SDL_malloc (sizeof(*client_mode_list) * (list_size+1) );
- else
- client_mode_list = (SDL_Rect**)
- SDL_realloc (client_mode_list, sizeof(*client_mode_list) * (list_size+1));
-
- rect = (SDL_Rect*) SDL_malloc (sizeof(**client_mode_list));
-
- if (client_mode_list == NULL || rect == NULL) {
- SDL_OutOfMemory ();
- return NULL;
- }
-
- rect->x = rect->y = 0;
- rect->w = width;
- rect->h = height;
-
- client_mode_list[list_size-1] = rect;
- client_mode_list[list_size] = NULL;
- }
- }
- }
-
- /* Sort list largest to smallest (by area) */
- {
- int i, j;
- for (i = 0; i < list_size; i++) {
- for (j = 0; j < list_size-1; j++) {
-
- int area1, area2;
- area1 = client_mode_list[j]->w * client_mode_list[j]->h;
- area2 = client_mode_list[j+1]->w * client_mode_list[j+1]->h;
-
- if (area1 < area2) {
- SDL_Rect *tmp = client_mode_list[j];
- client_mode_list[j] = client_mode_list[j+1];
- client_mode_list[j+1] = tmp;
- }
- }
- }
- }
- return client_mode_list;
-}
-
-static SDL_bool QZ_WindowPosition(_THIS, int *x, int *y)
-{
- const char *window = getenv("SDL_VIDEO_WINDOW_POS");
- if ( window ) {
- if ( sscanf(window, "%d,%d", x, y) == 2 ) {
- return SDL_TRUE;
- }
- }
- return SDL_FALSE;
-}
-
-static void QZ_UnsetVideoMode (_THIS, BOOL to_desktop) {
-
- /* Reset values that may change between switches */
- this->info.blit_fill = 0;
- this->FillHWRect = NULL;
- this->UpdateRects = NULL;
- this->LockHWSurface = NULL;
- this->UnlockHWSurface = NULL;
-
- /* Release fullscreen resources */
- if ( mode_flags & SDL_FULLSCREEN ) {
-
- NSRect screen_rect;
-
- /* Release double buffer stuff */
- if ( mode_flags & SDL_DOUBLEBUF) {
- quit_thread = YES;
- SDL_SemPost (sem1);
- SDL_WaitThread (thread, NULL);
- SDL_DestroySemaphore (sem1);
- SDL_DestroySemaphore (sem2);
- SDL_free (sw_buffers[0]);
- }
-
- /* If we still have a valid window, close it. */
- if ( qz_window ) {
- [ qz_window close ];
- [ qz_window release ];
- qz_window = nil;
- window_view = nil;
- }
- /*
- Release the OpenGL context
- Do this first to avoid trash on the display before fade
- */
- if ( mode_flags & SDL_OPENGL ) {
-
- QZ_TearDownOpenGL (this);
- CGLSetFullScreen (NULL);
- }
- if (to_desktop) {
- ShowMenuBar ();
- /* Restore original screen resolution/bpp */
- CGDisplaySwitchToMode (display_id, save_mode);
- CGReleaseAllDisplays ();
- /*
- Reset the main screen's rectangle
- See comment in QZ_SetVideoFullscreen for why we do this
- */
- screen_rect = NSMakeRect(0,0,device_width,device_height);
- [ [ NSScreen mainScreen ] setFrame:screen_rect ];
- }
- }
- /* Release window mode resources */
- else {
-
- [ qz_window close ];
- [ qz_window release ];
- qz_window = nil;
- window_view = nil;
-
- /* Release the OpenGL context */
- if ( mode_flags & SDL_OPENGL )
- QZ_TearDownOpenGL (this);
- }
-
- /* Signal successful teardown */
- video_set = SDL_FALSE;
-}
-
-static SDL_Surface* QZ_SetVideoFullScreen (_THIS, SDL_Surface *current, int width,
- int height, int bpp, Uint32 flags) {
- boolean_t exact_match = 0;
- NSRect screen_rect;
- CGError error;
- NSRect contentRect;
- BOOL isCustom = NO;
- CGDisplayFadeReservationToken fade_token = kCGDisplayFadeReservationInvalidToken;
-
- /* Fade to black to hide resolution-switching flicker (and garbage
- that is displayed by a destroyed OpenGL context, if applicable) */
- if ( CGAcquireDisplayFadeReservation (5, &fade_token) == kCGErrorSuccess ) {
- CGDisplayFade (fade_token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, TRUE);
- }
-
- /* Destroy any previous mode */
- if (video_set == SDL_TRUE)
- QZ_UnsetVideoMode (this, FALSE);
-
- /* See if requested mode exists */
- mode = CGDisplayBestModeForParameters (display_id, bpp, width,
- height, &exact_match);
-
- /* Require an exact match to the requested mode */
- if ( ! exact_match ) {
- SDL_SetError ("Failed to find display resolution: %dx%dx%d", width, height, bpp);
- goto ERR_NO_MATCH;
- }
-
- /* Put up the blanking window (a window above all other windows) */
- if (getenv ("SDL_SINGLEDISPLAY"))
- error = CGDisplayCapture (display_id);
- else
- error = CGCaptureAllDisplays ();
-
- if ( CGDisplayNoErr != error ) {
- SDL_SetError ("Failed capturing display");
- goto ERR_NO_CAPTURE;
- }
-
- /* Do the physical switch */
- if ( CGDisplayNoErr != CGDisplaySwitchToMode (display_id, mode) ) {
- SDL_SetError ("Failed switching display resolution");
- goto ERR_NO_SWITCH;
- }
-
- current->pixels = (Uint32*) CGDisplayBaseAddress (display_id);
- current->pitch = CGDisplayBytesPerRow (display_id);
-
- current->flags = 0;
- current->w = width;
- current->h = height;
- current->flags |= SDL_FULLSCREEN;
- current->flags |= SDL_HWSURFACE;
- current->flags |= SDL_PREALLOC;
-
- this->UpdateRects = QZ_DirectUpdate;
- this->LockHWSurface = QZ_LockHWSurface;
- this->UnlockHWSurface = QZ_UnlockHWSurface;
-
- /* Setup double-buffer emulation */
- if ( flags & SDL_DOUBLEBUF ) {
-
- /*
- Setup a software backing store for reasonable results when
- double buffering is requested (since a single-buffered hardware
- surface looks hideous).
-
- The actual screen blit occurs in a separate thread to allow
- other blitting while waiting on the VBL (and hence results in higher framerates).
- */
- this->LockHWSurface = NULL;
- this->UnlockHWSurface = NULL;
- this->UpdateRects = NULL;
-
- current->flags |= (SDL_HWSURFACE|SDL_DOUBLEBUF);
- this->UpdateRects = QZ_DoubleBufferUpdate;
- this->LockHWSurface = QZ_LockDoubleBuffer;
- this->UnlockHWSurface = QZ_UnlockDoubleBuffer;
- this->FlipHWSurface = QZ_FlipDoubleBuffer;
-
- current->pixels = SDL_malloc (current->pitch * current->h * 2);
- if (current->pixels == NULL) {
- SDL_OutOfMemory ();
- goto ERR_DOUBLEBUF;
- }
-
- sw_buffers[0] = current->pixels;
- sw_buffers[1] = (Uint8*)current->pixels + current->pitch * current->h;
-
- quit_thread = NO;
- sem1 = SDL_CreateSemaphore (0);
- sem2 = SDL_CreateSemaphore (1);
- thread = SDL_CreateThread ((int (*)(void *))QZ_ThreadFlip, this);
- }
-
- if ( CGDisplayCanSetPalette (display_id) )
- current->flags |= SDL_HWPALETTE;
-
- /* The code below checks for any valid custom windows and views. If none are
- available, then we create new ones. Window/View code was added in FULLSCREEN
- so that special events like the changing of the cursor image would be handled
- ( only the front-most and active application can change the cursor appearance
- and with no valid window/view in FULLSCREEN, SDL wouldn't update its cursor. )
- */
- /* Check for user-specified window and view */
- {
- char *windowPtrString = getenv ("SDL_NSWindowPointer");
- char *viewPtrString = getenv ("SDL_NSQuickDrawViewPointer");
-
- contentRect = NSMakeRect (0, 0, width, height);
-
- if (windowPtrString && viewPtrString) {
- /* Release any previous window */
- if ( qz_window ) {
- [ qz_window release ];
- qz_window = nil;
- }
-
- qz_window = (NSWindow*)atoi(windowPtrString);
- window_view = (NSQuickDrawView*)atoi(viewPtrString);
- isCustom = YES;
- /*
- Retain reference to window because we
- might release it in QZ_UnsetVideoMode
- */
- [ qz_window retain ];
- }
- }
- /* Check if we should recreate the window */
- if (qz_window == nil) {
- /* Manually create a window, avoids having a nib file resource */
- qz_window = [ [ SDL_QuartzWindow alloc ]
- initWithContentRect:contentRect
- styleMask:nil
- backing:NSBackingStoreBuffered
- defer:NO ];
-
- if (qz_window != nil) {
- [ qz_window setAcceptsMouseMovedEvents:YES ];
- [ qz_window setViewsNeedDisplay:NO ];
- }
- }
- /* We already have a window, just change its size */
- else {
- if (!isCustom) {
- [ qz_window setContentSize:contentRect.size ];
- current->flags |= (SDL_NOFRAME|SDL_RESIZABLE) & mode_flags;
- [ window_view setFrameSize:contentRect.size ];
- }
- }
-
- /* Setup OpenGL for a fullscreen context */
- if (flags & SDL_OPENGL) {
-
- CGLError err;
- CGLContextObj ctx;
-
- if ( ! QZ_SetupOpenGL (this, bpp, flags) ) {
- goto ERR_NO_GL;
- }
-
- /* Initialize the NSView and add it to our window. The presence of a valid window and
- view allow the cursor to be changed whilst in fullscreen.*/
- window_view = [ [ NSView alloc ] initWithFrame:contentRect ];
- [ [ qz_window contentView ] addSubview:window_view ];
- [ window_view release ];
-
- ctx = [ gl_context cglContext ];
- err = CGLSetFullScreen (ctx);
-
- if (err) {
- SDL_SetError ("Error setting OpenGL fullscreen: %s", CGLErrorString(err));
- goto ERR_NO_GL;
- }
-
- [ gl_context makeCurrentContext];
-
- glClear (GL_COLOR_BUFFER_BIT);
-
- [ gl_context flushBuffer ];
-
- current->flags |= SDL_OPENGL;
- }
-
- /* If we don't hide menu bar, it will get events and interrupt the program */
- HideMenuBar ();
-
- /* Fade in again (asynchronously) */
- if ( fade_token != kCGDisplayFadeReservationInvalidToken ) {
- CGDisplayFade (fade_token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE);
- CGReleaseDisplayFadeReservation(fade_token);
- }
-
- /*
- There is a bug in Cocoa where NSScreen doesn't synchronize
- with CGDirectDisplay, so the main screen's frame is wrong.
- As a result, coordinate translation produces incorrect results.
- We can hack around this bug by setting the screen rect
- ourselves. This hack should be removed if/when the bug is fixed.
- */
- screen_rect = NSMakeRect(0,0,width,height);
- [ [ NSScreen mainScreen ] setFrame:screen_rect ];
-
- /* Save the flags to ensure correct tear-down */
- mode_flags = current->flags;
-
- /* Set app state, hide cursor if necessary, ... */
- QZ_DoActivate(this);
-
- return current;
-
- /* Since the blanking window covers *all* windows (even force quit) correct recovery is crucial */
-ERR_NO_GL:
-ERR_DOUBLEBUF: CGDisplaySwitchToMode (display_id, save_mode);
-ERR_NO_SWITCH: CGReleaseAllDisplays ();
-ERR_NO_CAPTURE:
-ERR_NO_MATCH: if ( fade_token != kCGDisplayFadeReservationInvalidToken ) {
- CGDisplayFade (fade_token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE);
- CGReleaseDisplayFadeReservation (fade_token);
- }
- return NULL;
-}
-
-static SDL_Surface* QZ_SetVideoWindowed (_THIS, SDL_Surface *current, int width,
- int height, int *bpp, Uint32 flags) {
- unsigned int style;
- NSRect contentRect;
- BOOL isCustom = NO;
- int center_window = 1;
- int origin_x, origin_y;
- CGDisplayFadeReservationToken fade_token = kCGDisplayFadeReservationInvalidToken;
-
- current->flags = 0;
- current->w = width;
- current->h = height;
-
- contentRect = NSMakeRect (0, 0, width, height);
-
- /*
- Check if we should completely destroy the previous mode
- - If it is fullscreen
- - If it has different noframe or resizable attribute
- - If it is OpenGL (since gl attributes could be different)
- - If new mode is OpenGL, but previous mode wasn't
- */
- if (video_set == SDL_TRUE) {
- if (mode_flags & SDL_FULLSCREEN) {
- /* Fade to black to hide resolution-switching flicker (and garbage
- that is displayed by a destroyed OpenGL context, if applicable) */
- if (CGAcquireDisplayFadeReservation (5, &fade_token) == kCGErrorSuccess) {
- CGDisplayFade (fade_token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, TRUE);
- }
- QZ_UnsetVideoMode (this, TRUE);
- }
- else if ( ((mode_flags ^ flags) & (SDL_NOFRAME|SDL_RESIZABLE)) ||
- (mode_flags & SDL_OPENGL) ||
- (flags & SDL_OPENGL) ) {
- QZ_UnsetVideoMode (this, TRUE);
- }
- }
-
- /* Check for user-specified window and view */
- {
- char *windowPtrString = getenv ("SDL_NSWindowPointer");
- char *viewPtrString = getenv ("SDL_NSQuickDrawViewPointer");
-
- if (windowPtrString && viewPtrString) {
-
- /* Release any previous window */
- if ( qz_window ) {
- [ qz_window release ];
- qz_window = nil;
- }
-
- qz_window = (NSWindow*)atoi(windowPtrString);
- window_view = (NSQuickDrawView*)atoi(viewPtrString);
- isCustom = YES;
-
- /*
- Retain reference to window because we
- might release it in QZ_UnsetVideoMode
- */
- [ qz_window retain ];
-
- style = [ qz_window styleMask ];
- /* Check resizability */
- if ( style & NSResizableWindowMask )
- current->flags |= SDL_RESIZABLE;
-
- /* Check frame */
- if ( style & NSBorderlessWindowMask )
- current->flags |= SDL_NOFRAME;
- }
- }
-
- /* Check if we should recreate the window */
- if (qz_window == nil) {
-
- /* Set the window style based on input flags */
- if ( flags & SDL_NOFRAME ) {
- style = NSBorderlessWindowMask;
- current->flags |= SDL_NOFRAME;
- } else {
- style = NSTitledWindowMask;
- style |= (NSMiniaturizableWindowMask | NSClosableWindowMask);
- if ( flags & SDL_RESIZABLE ) {
- style |= NSResizableWindowMask;
- current->flags |= SDL_RESIZABLE;
- }
- }
- /* Manually create a window, avoids having a nib file resource */
- qz_window = [ [ SDL_QuartzWindow alloc ]
- initWithContentRect:contentRect
- styleMask:style
- backing:NSBackingStoreBuffered
- defer:NO ];
-
- if (qz_window == nil) {
- SDL_SetError ("Could not create the Cocoa window");
- if (fade_token != kCGDisplayFadeReservationInvalidToken) {
- CGDisplayFade (fade_token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE);
- CGReleaseDisplayFadeReservation (fade_token);
- }
- return NULL;
- }
-
- /*[ qz_window setReleasedWhenClosed:YES ];*/
- QZ_SetCaption(this, this->wm_title, this->wm_icon);
- [ qz_window setAcceptsMouseMovedEvents:YES ];
- [ qz_window setViewsNeedDisplay:NO ];
-
- if ( QZ_WindowPosition(this, &origin_x, &origin_y) ) {
- [ qz_window setFrameTopLeftPoint:NSMakePoint(origin_x,this->info.current_h - origin_y) ];
- } else {
- [ qz_window center ];
- }
- [ qz_window setDelegate:
- [ [ [ SDL_QuartzWindowDelegate alloc ] init ] autorelease ] ];
- [ qz_window setContentView: [ [ [ SDL_QuartzView alloc ] init ] autorelease ] ];
- }
- /* We already have a window, just change its size */
- else {
-
- if (!isCustom) {
- [ qz_window setContentSize:contentRect.size ];
- current->flags |= (SDL_NOFRAME|SDL_RESIZABLE) & mode_flags;
- [ window_view setFrameSize:contentRect.size ];
- }
- }
-
- /* For OpenGL, we bind the context to a subview */
- if ( flags & SDL_OPENGL ) {
-
- if ( ! QZ_SetupOpenGL (this, *bpp, flags) ) {
- if (fade_token != kCGDisplayFadeReservationInvalidToken) {
- CGDisplayFade (fade_token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE);
- CGReleaseDisplayFadeReservation (fade_token);
- }
- return NULL;
- }
-
- window_view = [ [ NSView alloc ] initWithFrame:contentRect ];
- [ window_view setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable ];
- [ [ qz_window contentView ] addSubview:window_view ];
- [ gl_context setView: window_view ];
- [ window_view release ];
- [ gl_context makeCurrentContext];
- [ qz_window makeKeyAndOrderFront:nil ];
- current->flags |= SDL_OPENGL;
- }
- /* For 2D, we set the subview to an NSQuickDrawView */
- else {
- short qdbpp = 0;
- CGrafPtr qdport;
-
- /* Only recreate the view if it doesn't already exist */
- if (window_view == nil) {
-
- window_view = [ [ NSQuickDrawView alloc ] initWithFrame:contentRect ];
- [ window_view setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable ];
- [ [ qz_window contentView ] addSubview:window_view ];
- [ window_view release ];
- [ qz_window makeKeyAndOrderFront:nil ];
- }
-
- qdport = [ window_view qdPort ];
-
- LockPortBits ( qdport );
- current->pixels = GetPixBaseAddr ( GetPortPixMap ( qdport ) );
- current->pitch = GetPixRowBytes ( GetPortPixMap ( qdport ) );
- qdbpp = GetPixDepth ( GetPortPixMap ( qdport ) );
- UnlockPortBits ( qdport );
-
- /* QuickDraw may give a 16-bit shadow surface on 8-bit displays! */
- *bpp = qdbpp;
-
- current->flags |= SDL_SWSURFACE;
- current->flags |= SDL_PREALLOC;
- current->flags |= SDL_ASYNCBLIT;
-
- /*
- current->pixels now points to the window's pixels
- We want it to point to the *view's* pixels
- */
- {
- NSRect winFrame = [ qz_window frame ];
- NSRect viewFrame = [ window_view frame ];
-
- int vOffset = winFrame.size.height - viewFrame.size.height - viewFrame.origin.y;
- int hOffset = viewFrame.origin.x;
-
- current->pixels = (Uint8 *)current->pixels + (vOffset * current->pitch) + hOffset * (qdbpp/8);
- }
- this->UpdateRects = QZ_UpdateRects;
- this->LockHWSurface = QZ_LockWindow;
- this->UnlockHWSurface = QZ_UnlockWindow;
- }
-
- /* Save flags to ensure correct teardown */
- mode_flags = current->flags;
-
- /* Fade in again (asynchronously) if we came from a fullscreen mode and faded to black */
- if (fade_token != kCGDisplayFadeReservationInvalidToken) {
- CGDisplayFade (fade_token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE);
- CGReleaseDisplayFadeReservation (fade_token);
- }
-
- return current;
-}
-
-static SDL_Surface* QZ_SetVideoMode (_THIS, SDL_Surface *current, int width,
- int height, int bpp, Uint32 flags) {
-
- current->flags = 0;
- current->pixels = NULL;
-
- /* Setup full screen video */
- if ( flags & SDL_FULLSCREEN ) {
- current = QZ_SetVideoFullScreen (this, current, width, height, bpp, flags );
- if (current == NULL)
- return NULL;
- }
- /* Setup windowed video */
- else {
- /* Force bpp to the device's bpp */
- bpp = device_bpp;
- current = QZ_SetVideoWindowed (this, current, width, height, &bpp, flags);
- if (current == NULL)
- return NULL;
- }
-
- /* Setup the new pixel format */
- {
- int amask = 0,
- rmask = 0,
- gmask = 0,
- bmask = 0;
-
- switch (bpp) {
- case 16: /* (1)-5-5-5 RGB */
- amask = 0;
- rmask = 0x7C00;
- gmask = 0x03E0;
- bmask = 0x001F;
- break;
- case 24:
- SDL_SetError ("24bpp is not available");
- return NULL;
- case 32: /* (8)-8-8-8 ARGB */
- amask = 0x00000000;
- rmask = 0x00FF0000;
- gmask = 0x0000FF00;
- bmask = 0x000000FF;
- break;
- }
-
- if ( ! SDL_ReallocFormat (current, bpp,
- rmask, gmask, bmask, amask ) ) {
- SDL_SetError ("Couldn't reallocate pixel format");
- return NULL;
- }
- }
-
- /* Signal successful completion (used internally) */
- video_set = SDL_TRUE;
-
- return current;
-}
-
-static int QZ_ToggleFullScreen (_THIS, int on) {
- return 0;
-}
-
-static int QZ_SetColors (_THIS, int first_color, int num_colors,
- SDL_Color *colors) {
-
- CGTableCount index;
- CGDeviceColor color;
-
- for (index = first_color; index < first_color+num_colors; index++) {
-
- /* Clamp colors between 0.0 and 1.0 */
- color.red = colors->r / 255.0;
- color.blue = colors->b / 255.0;
- color.green = colors->g / 255.0;
-
- colors++;
-
- CGPaletteSetColorAtIndex (palette, color, index);
- }
-
- if ( CGDisplayNoErr != CGDisplaySetPalette (display_id, palette) )
- return 0;
-
- return 1;
-}
-
-static int QZ_LockDoubleBuffer (_THIS, SDL_Surface *surface) {
-
- return 1;
-}
-
-static void QZ_UnlockDoubleBuffer (_THIS, SDL_Surface *surface) {
-
-}
-
- /* The VBL delay is based on code by Ian R Ollmann's RezLib <iano@cco.caltech.edu> */
- static AbsoluteTime QZ_SecondsToAbsolute ( double seconds ) {
-
- union
- {
- UInt64 i;
- Nanoseconds ns;
- } temp;
-
- temp.i = seconds * 1000000000.0;
-
- return NanosecondsToAbsolute ( temp.ns );
-}
-
-static int QZ_ThreadFlip (_THIS) {
-
- Uint8 *src, *dst;
- int skip, len, h;
-
- /*
- Give this thread the highest scheduling priority possible,
- in the hopes that it will immediately run after the VBL delay
- */
- {
- pthread_t current_thread;
- int policy;
- struct sched_param param;
-
- current_thread = pthread_self ();
- pthread_getschedparam (current_thread, &policy, &param);
- policy = SCHED_RR;
- param.sched_priority = sched_get_priority_max (policy);
- pthread_setschedparam (current_thread, policy, &param);
- }
-
- while (1) {
-
- SDL_SemWait (sem1);
- if (quit_thread)
- return 0;
-
- /*
- * We have to add SDL_VideoSurface->offset here, since we might be a
- * smaller surface in the center of the framebuffer (you asked for
- * a fullscreen resolution smaller than the hardware could supply
- * so SDL is centering it in a bigger resolution)...
- */
- dst = (Uint8 *)CGDisplayBaseAddress (display_id) + SDL_VideoSurface->offset;
- src = current_buffer + SDL_VideoSurface->offset;
- len = SDL_VideoSurface->w * SDL_VideoSurface->format->BytesPerPixel;
- h = SDL_VideoSurface->h;
- skip = SDL_VideoSurface->pitch;
-
- /* Wait for the VBL to occur (estimated since we don't have a hardware interrupt) */
- {
-
- /* The VBL delay is based on Ian Ollmann's RezLib <iano@cco.caltech.edu> */
- double refreshRate;
- double linesPerSecond;
- double target;
- double position;
- double adjustment;
- AbsoluteTime nextTime;
- CFNumberRef refreshRateCFNumber;
-
- refreshRateCFNumber = CFDictionaryGetValue (mode, kCGDisplayRefreshRate);
- if ( NULL == refreshRateCFNumber ) {
- SDL_SetError ("Mode has no refresh rate");
- goto ERROR;
- }
-
- if ( 0 == CFNumberGetValue (refreshRateCFNumber, kCFNumberDoubleType, &refreshRate) ) {
- SDL_SetError ("Error getting refresh rate");
- goto ERROR;
- }
-
- if ( 0 == refreshRate ) {
-
- SDL_SetError ("Display has no refresh rate, using 60hz");
-
- /* ok, for LCD's we'll emulate a 60hz refresh, which may or may not look right */
- refreshRate = 60.0;
- }
-
- linesPerSecond = refreshRate * h;
- target = h;
-
- /* Figure out the first delay so we start off about right */
- position = CGDisplayBeamPosition (display_id);
- if (position > target)
- position = 0;
-
- adjustment = (target - position) / linesPerSecond;
-
- nextTime = AddAbsoluteToAbsolute (UpTime (), QZ_SecondsToAbsolute (adjustment));
-
- MPDelayUntil (&nextTime);
- }
-
-
- /* On error, skip VBL delay */
- ERROR:
-
- while ( h-- ) {
-
- SDL_memcpy (dst, src, len);
- src += skip;
- dst += skip;
- }
-
- /* signal flip completion */
- SDL_SemPost (sem2);
- }
-
- return 0;
-}
-
-static int QZ_FlipDoubleBuffer (_THIS, SDL_Surface *surface) {
-
- /* wait for previous flip to complete */
- SDL_SemWait (sem2);
-
- current_buffer = surface->pixels;
-
- if (surface->pixels == sw_buffers[0])
- surface->pixels = sw_buffers[1];
- else
- surface->pixels = sw_buffers[0];
-
- /* signal worker thread to do the flip */
- SDL_SemPost (sem1);
-
- return 0;
-}
-
-
-static void QZ_DoubleBufferUpdate (_THIS, int num_rects, SDL_Rect *rects) {
-
- /* perform a flip if someone calls updaterects on a doublebuferred surface */
- this->FlipHWSurface (this, SDL_VideoSurface);
-}
-
-static void QZ_DirectUpdate (_THIS, int num_rects, SDL_Rect *rects) {
-#pragma unused(this,num_rects,rects)
-}
-
-/*
- The obscured code is based on work by Matt Slot fprefect@ambrosiasw.com,
- who supplied sample code for Carbon.
-*/
-
-/*#define TEST_OBSCURED 1*/
-
-#if TEST_OBSCURED
-#include "CGS.h"
-#endif
-
-static int QZ_IsWindowObscured (NSWindow *window) {
-
-
-#if TEST_OBSCURED
-
- /*
- In order to determine if a direct copy to the screen is possible,
- we must figure out if there are any windows covering ours (including shadows).
- This can be done by querying the window server about the on screen
- windows for their screen rectangle and window level.
- The procedure used below is puts accuracy before speed; however, it aims to call
- the window server the fewest number of times possible to keep things reasonable.
- In my testing on a 300mhz G3, this routine typically takes < 2 ms. -DW
-
- Notes:
- -Calls into the Window Server involve IPC which is slow.
- -Getting a rectangle seems slower than getting the window level
- -The window list we get back is in sorted order, top to bottom
- -On average, I suspect, most windows above ours are dock icon windows (hence optimization)
- -Some windows above ours are always there, and cannot move or obscure us (menu bar)
-
- Bugs:
- -no way (yet) to deactivate direct drawing when a window is dragged,
- or suddenly obscured, so drawing continues and can produce garbage
- We need some kind of locking mechanism on window movement to prevent this
-
- -deactivated normal windows use activated normal
- window shadows (slight inaccuraccy)
- */
-
- /* Cache the connection to the window server */
- static CGSConnectionID cgsConnection = (CGSConnectionID) -1;
-
- /* Cache the dock icon windows */
- static CGSWindowID dockIcons[kMaxWindows];
- static int numCachedDockIcons = 0;
-
- CGSWindowID windows[kMaxWindows];
- CGSWindowCount i, count;
- CGSWindowLevel winLevel;
- CGSRect winRect;
-
- CGSRect contentRect;
- int windowNumber;
- int firstDockIcon;
- int dockIconCacheMiss;
- int windowContentOffset;
-
- int obscured = SDL_TRUE;
-
- if ( [ window isVisible ] ) {
-
- /*
- walk the window list looking for windows over top of
- (or casting a shadow on) ours
- */
-
- /*
- Get a connection to the window server
- Should probably be moved out into SetVideoMode() or InitVideo()
- */
- if (cgsConnection == (CGSConnectionID) -1) {
- cgsConnection = (CGSConnectionID) 0;
- cgsConnection = _CGSDefaultConnection ();
- }
-
- if (cgsConnection) {
-
- if ( ! [ window styleMask ] & NSBorderlessWindowMask )
- windowContentOffset = 22;
- else
- windowContentOffset = 0;
-
- windowNumber = [ window windowNumber ];
-
- /* The window list is sorted according to order on the screen */
- count = 0;
- CGSGetOnScreenWindowList (cgsConnection, 0, kMaxWindows, windows, &count);
- CGSGetScreenRectForWindow (cgsConnection, windowNumber, &contentRect);
-
- /* adjust rect for window title bar (if present) */
- contentRect.origin.y += windowContentOffset;
- contentRect.size.height -= windowContentOffset;
-
- firstDockIcon = -1;
- dockIconCacheMiss = SDL_FALSE;
-
- /*
- The first window is always an empty window with level kCGSWindowLevelTop
- so start at index 1
- */
- for (i = 1; i < count; i++) {
-
- /* If we reach our window in the list, it cannot be obscured */
- if (windows[i] == windowNumber) {
-
- obscured = SDL_FALSE;
- break;
- }
- else {
-
- float shadowSide;
- float shadowTop;
- float shadowBottom;
-
- CGSGetWindowLevel (cgsConnection, windows[i], &winLevel);
-
- if (winLevel == kCGSWindowLevelDockIcon) {
-
- int j;
-
- if (firstDockIcon < 0) {
-
- firstDockIcon = i;
-
- if (numCachedDockIcons > 0) {
-
- for (j = 0; j < numCachedDockIcons; j++) {
-
- if (windows[i] == dockIcons[j])
- i++;
- else
- break;
- }
-
- if (j != 0) {
-
- i--;
-
- if (j < numCachedDockIcons) {
-
- dockIconCacheMiss = SDL_TRUE;
- }
- }
-
- }
- }
-
- continue;
- }
- else if (winLevel == kCGSWindowLevelMenuIgnore
- /* winLevel == kCGSWindowLevelTop */) {
-
- continue; /* cannot obscure window */
- }
- else if (winLevel == kCGSWindowLevelDockMenu ||
- winLevel == kCGSWindowLevelMenu) {
-
- shadowSide = 18;
- shadowTop = 4;
- shadowBottom = 22;
- }
- else if (winLevel == kCGSWindowLevelUtility) {
-
- shadowSide = 8;
- shadowTop = 4;
- shadowBottom = 12;
- }
- else if (winLevel == kCGSWindowLevelNormal) {
-
- /*
- These numbers are for foreground windows,
- they are too big (but will work) for background windows
- */
- shadowSide = 20;
- shadowTop = 10;
- shadowBottom = 24;
- }
- else if (winLevel == kCGSWindowLevelDock) {
-
- /* Create dock icon cache */
- if (numCachedDockIcons != (i-firstDockIcon) ||
- dockIconCacheMiss) {
-
- numCachedDockIcons = i - firstDockIcon;
- SDL_memcpy (dockIcons, &(windows[firstDockIcon]),
- numCachedDockIcons * sizeof(*windows));
- }
-
- /* no shadow */
- shadowSide = 0;
- shadowTop = 0;
- shadowBottom = 0;
- }
- else {
-
- /*
- kCGSWindowLevelDockLabel,
- kCGSWindowLevelDock,
- kOther???
- */
-
- /* no shadow */
- shadowSide = 0;
- shadowTop = 0;
- shadowBottom = 0;
- }
-
- CGSGetScreenRectForWindow (cgsConnection, windows[i], &winRect);
-
- winRect.origin.x -= shadowSide;
- winRect.origin.y -= shadowTop;
- winRect.size.width += shadowSide;
- winRect.size.height += shadowBottom;
-
- if (NSIntersectsRect (contentRect, winRect)) {
-
- obscured = SDL_TRUE;
- break;
- }
-
- } /* window was not our window */
-
- } /* iterate over windows */
-
- } /* get cgsConnection */
-
- } /* window is visible */
-
- return obscured;
-#else
- return SDL_TRUE;
-#endif
-}
-
-
-/* Locking functions for the software window buffer */
-static int QZ_LockWindow (_THIS, SDL_Surface *surface) {
-#if 1
- return LockPortBits( [ window_view qdPort ] );
-#else
- CGrafPtr qdport = [ window_view qdPort ];
- int result = LockPortBits ( qdport );
-
- if ( !result ) {
- Uint8* pixels = GetPixBaseAddr ( GetPortPixMap ( qdport ) );
- NSRect viewFrame = [ window_view frame ];
- NSRect winFrame = [ qz_window frame ];
- int vOffset = winFrame.size.height - viewFrame.size.height - viewFrame.origin.y;
- int hOffset = viewFrame.origin.x;
-
- pixels = pixels + (vOffset * surface->pitch) + hOffset *4;
-
- if ( surface->pixels != pixels ) {
- fprintf(stderr,"XXX: surface->pixels is %p, should be %p\n", surface->pixels, pixels);
- }
- } else {
- fprintf(stderr, "XXX: could not lock port %p for surface %p\n", qdport, surface);
- }
- return result;
-#endif
-}
-
-static void QZ_UnlockWindow (_THIS, SDL_Surface *surface) {
-
- UnlockPortBits ( [ window_view qdPort ] );
-}
-
-/* Resize icon, BMP format */
-static const unsigned char QZ_ResizeIcon[] = {
- 0x42,0x4d,0x31,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x00,0x00,0x00,0x28,0x00,
- 0x00,0x00,0x0d,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x01,0x00,0x18,0x00,0x00,0x00,
- 0x00,0x00,0xfb,0x01,0x00,0x00,0x13,0x0b,0x00,0x00,0x13,0x0b,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0b,0xff,0xff,
- 0xff,0xda,0xda,0xda,0x87,0x87,0x87,0xe8,0xe8,0xe8,0xff,0xff,0xff,0xda,0xda,0xda,
- 0x87,0x87,0x87,0xe8,0xe8,0xe8,0xff,0xff,0xff,0xda,0xda,0xda,0x87,0x87,0x87,0xe8,
- 0xe8,0xe8,0xff,0xff,0xff,0x0b,0xff,0xff,0xff,0xff,0xff,0xff,0xda,0xda,0xda,0x87,
- 0x87,0x87,0xe8,0xe8,0xe8,0xff,0xff,0xff,0xda,0xda,0xda,0x87,0x87,0x87,0xe8,0xe8,
- 0xe8,0xff,0xff,0xff,0xda,0xda,0xda,0x87,0x87,0x87,0xff,0xff,0xff,0x0b,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xd5,0xd5,0xd5,0x87,0x87,0x87,0xe8,0xe8,0xe8,
- 0xff,0xff,0xff,0xda,0xda,0xda,0x87,0x87,0x87,0xe8,0xe8,0xe8,0xff,0xff,0xff,0xda,
- 0xda,0xda,0xff,0xff,0xff,0x0b,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xd7,0xd7,0xd7,0x87,0x87,0x87,0xe8,0xe8,0xe8,0xff,0xff,0xff,0xda,0xda,
- 0xda,0x87,0x87,0x87,0xe8,0xe8,0xe8,0xff,0xff,0xff,0xff,0xff,0xff,0x0b,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xd7,0xd7,0xd7,
- 0x87,0x87,0x87,0xe8,0xe8,0xe8,0xff,0xff,0xff,0xda,0xda,0xda,0x87,0x87,0x87,0xe8,
- 0xe8,0xe8,0xff,0xff,0xff,0x0b,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xd7,0xd7,0xd7,0x87,0x87,0x87,0xe8,0xe8,
- 0xe8,0xff,0xff,0xff,0xdc,0xdc,0xdc,0x87,0x87,0x87,0xff,0xff,0xff,0x0b,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xd9,0xd9,0xd9,0x87,0x87,0x87,0xe8,0xe8,0xe8,0xff,0xff,0xff,0xdc,
- 0xdc,0xdc,0xff,0xff,0xff,0x0b,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdb,0xdb,
- 0xdb,0x87,0x87,0x87,0xe8,0xe8,0xe8,0xff,0xff,0xff,0xff,0xff,0xff,0x0b,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdb,0xdb,0xdb,0x87,0x87,0x87,0xe8,
- 0xe8,0xe8,0xff,0xff,0xff,0x0b,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xdc,0xdc,0xdc,0x87,0x87,0x87,0xff,0xff,0xff,0x0b,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdc,
- 0xdc,0xdc,0xff,0xff,0xff,0x0b,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
- 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0b
-};
-
-static void QZ_DrawResizeIcon (_THIS, RgnHandle dirtyRegion) {
-
- /* Check if we should draw the resize icon */
- if (SDL_VideoSurface->flags & SDL_RESIZABLE) {
-
- Rect icon;
- SetRect (&icon, SDL_VideoSurface->w - 13, SDL_VideoSurface->h - 13,
- SDL_VideoSurface->w, SDL_VideoSurface->h);
-
- if (RectInRgn (&icon, dirtyRegion)) {
-
- SDL_Rect icon_rect;
-
- /* Create the icon image */
- if (resize_icon == NULL) {
-
- SDL_RWops *rw;
- SDL_Surface *tmp;
-
- rw = SDL_RWFromConstMem (QZ_ResizeIcon, sizeof(QZ_ResizeIcon));
- tmp = SDL_LoadBMP_RW (rw, SDL_TRUE);
-
- resize_icon = SDL_ConvertSurface (tmp, SDL_VideoSurface->format, SDL_SRCCOLORKEY);
- SDL_SetColorKey (resize_icon, SDL_SRCCOLORKEY, 0xFFFFFF);
-
- SDL_FreeSurface (tmp);
- }
-
- icon_rect.x = SDL_VideoSurface->w - 13;
- icon_rect.y = SDL_VideoSurface->h - 13;
- icon_rect.w = 13;
- icon_rect.h = 13;
-
- SDL_BlitSurface (resize_icon, NULL, SDL_VideoSurface, &icon_rect);
- }
- }
-}
-
-static void QZ_UpdateRects (_THIS, int numRects, SDL_Rect *rects) {
-
- if (SDL_VideoSurface->flags & SDL_OPENGLBLIT) {
- QZ_GL_SwapBuffers (this);
- }
- else if ( [ qz_window isMiniaturized ] ) {
-
- /* Do nothing if miniaturized */
- }
-
- else if ( ! QZ_IsWindowObscured (qz_window) ) {
-
- /* Use direct copy to flush contents to the display */
- CGrafPtr savePort;
- CGrafPtr dstPort, srcPort;
- const BitMap *dstBits, *srcBits;
- Rect dstRect, srcRect;
- Point offset;
- int i;
-
- GetPort (&savePort);
-
- dstPort = CreateNewPortForCGDisplayID ((UInt32)display_id);
- srcPort = [ window_view qdPort ];
-
- offset.h = 0;
- offset.v = 0;
- SetPort (srcPort);
- LocalToGlobal (&offset);
-
- SetPort (dstPort);
-
- LockPortBits (dstPort);
- LockPortBits (srcPort);
-
- dstBits = GetPortBitMapForCopyBits (dstPort);
- srcBits = GetPortBitMapForCopyBits (srcPort);
-
- for (i = 0; i < numRects; i++) {
-
- SetRect (&srcRect, rects[i].x, rects[i].y,
- rects[i].x + rects[i].w,
- rects[i].y + rects[i].h);
-
- SetRect (&dstRect,
- rects[i].x + offset.h,
- rects[i].y + offset.v,
- rects[i].x + rects[i].w + offset.h,
- rects[i].y + rects[i].h + offset.v);
-
- CopyBits (srcBits, dstBits,
- &srcRect, &dstRect, srcCopy, NULL);
-
- }
-
- SetPort (savePort);
- }
- else {
- /* Use QDFlushPortBuffer() to flush content to display */
- int i;
- RgnHandle dirty = NewRgn ();
- RgnHandle temp = NewRgn ();
-
- SetEmptyRgn (dirty);
-
- /* Build the region of dirty rectangles */
- for (i = 0; i < numRects; i++) {
-
- MacSetRectRgn (temp, rects[i].x, rects[i].y,
- rects[i].x + rects[i].w, rects[i].y + rects[i].h);
- MacUnionRgn (dirty, temp, dirty);
- }
-
- QZ_DrawResizeIcon (this, dirty);
-
- /* Flush the dirty region */
- QDFlushPortBuffer ( [ window_view qdPort ], dirty );
- DisposeRgn (dirty);
- DisposeRgn (temp);
- }
-}
-
-static void QZ_VideoQuit (_THIS) {
-
- CGDisplayFadeReservationToken fade_token = kCGDisplayFadeReservationInvalidToken;
-
- /* Restore gamma settings */
- CGDisplayRestoreColorSyncSettings ();
-
- /* Ensure the cursor will be visible and working when we quit */
- CGDisplayShowCursor (display_id);
- CGAssociateMouseAndMouseCursorPosition (1);
-
- if (mode_flags & SDL_FULLSCREEN) {
- /* Fade to black to hide resolution-switching flicker (and garbage
- that is displayed by a destroyed OpenGL context, if applicable) */
- if (CGAcquireDisplayFadeReservation (5, &fade_token) == kCGErrorSuccess) {
- CGDisplayFade (fade_token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, TRUE);
- }
- QZ_UnsetVideoMode (this, TRUE);
- if (fade_token != kCGDisplayFadeReservationInvalidToken) {
- CGDisplayFade (fade_token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE);
- CGReleaseDisplayFadeReservation (fade_token);
- }
- }
- else
- QZ_UnsetVideoMode (this, TRUE);
-
- CGPaletteRelease (palette);
-
- if (opengl_library) {
- SDL_UnloadObject(opengl_library);
- opengl_library = NULL;
- }
- this->gl_config.driver_loaded = 0;
-
- if (field_edit) {
- [field_edit release];
- field_edit = NULL;
- }
-}
-
-#if 0 /* Not used (apparently, it's really slow) */
-static int QZ_FillHWRect (_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color) {
-
- CGSDisplayHWFill (display_id, rect->x, rect->y, rect->w, rect->h, color);
-
- return 0;
-}
-#endif
-
-static int QZ_LockHWSurface(_THIS, SDL_Surface *surface) {
-
- return 1;
-}
-
-static void QZ_UnlockHWSurface(_THIS, SDL_Surface *surface) {
-
-}
-
-static int QZ_AllocHWSurface(_THIS, SDL_Surface *surface) {
- return(-1); /* unallowed (no HWSURFACE support here). */
-}
-
-static void QZ_FreeHWSurface (_THIS, SDL_Surface *surface) {
-}
-
-/*
- int QZ_FlipHWSurface (_THIS, SDL_Surface *surface) {
- return 0;
- }
- */
-
-/* Gamma functions */
-int QZ_SetGamma (_THIS, float red, float green, float blue) {
-
- const CGGammaValue min = 0.0, max = 1.0;
-
- if (red == 0.0)
- red = FLT_MAX;
- else
- red = 1.0 / red;
-
- if (green == 0.0)
- green = FLT_MAX;
- else
- green = 1.0 / green;
-
- if (blue == 0.0)
- blue = FLT_MAX;
- else
- blue = 1.0 / blue;
-
- if ( CGDisplayNoErr == CGSetDisplayTransferByFormula
- (display_id, min, max, red, min, max, green, min, max, blue) ) {
-
- return 0;
- }
- else {
-
- return -1;
- }
-}
-
-int QZ_GetGamma (_THIS, float *red, float *green, float *blue) {
-
- CGGammaValue dummy;
- if ( CGDisplayNoErr == CGGetDisplayTransferByFormula
- (display_id, &dummy, &dummy, red,
- &dummy, &dummy, green, &dummy, &dummy, blue) )
-
- return 0;
- else
- return -1;
-}
-
-int QZ_SetGammaRamp (_THIS, Uint16 *ramp) {
-
- const CGTableCount tableSize = 255;
- CGGammaValue redTable[tableSize];
- CGGammaValue greenTable[tableSize];
- CGGammaValue blueTable[tableSize];
-
- int i;
-
- /* Extract gamma values into separate tables, convert to floats between 0.0 and 1.0 */
- for (i = 0; i < 256; i++)
- redTable[i % 256] = ramp[i] / 65535.0;
-
- for (i=256; i < 512; i++)
- greenTable[i % 256] = ramp[i] / 65535.0;
-
- for (i=512; i < 768; i++)
- blueTable[i % 256] = ramp[i] / 65535.0;
-
- if ( CGDisplayNoErr == CGSetDisplayTransferByTable
- (display_id, tableSize, redTable, greenTable, blueTable) )
- return 0;
- else
- return -1;
-}
-
-int QZ_GetGammaRamp (_THIS, Uint16 *ramp) {
-
- const CGTableCount tableSize = 255;
- CGGammaValue redTable[tableSize];
- CGGammaValue greenTable[tableSize];
- CGGammaValue blueTable[tableSize];
- CGTableCount actual;
- int i;
-
- if ( CGDisplayNoErr != CGGetDisplayTransferByTable
- (display_id, tableSize, redTable, greenTable, blueTable, &actual) ||
- actual != tableSize)
-
- return -1;
-
- /* Pack tables into one array, with values from 0 to 65535 */
- for (i = 0; i < 256; i++)
- ramp[i] = redTable[i % 256] * 65535.0;
-
- for (i=256; i < 512; i++)
- ramp[i] = greenTable[i % 256] * 65535.0;
-
- for (i=512; i < 768; i++)
- ramp[i] = blueTable[i % 256] * 65535.0;
-
- return 0;
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzWM.h b/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzWM.h
deleted file mode 100644
index 755607b..0000000
--- a/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzWM.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2003 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-struct WMcursor {
- NSCursor *nscursor;
-};
-
-void QZ_UpdateCursor(_THIS);
-int QZ_GetWMInfo (_THIS, SDL_SysWMinfo *info);
diff --git a/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzWM.m b/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzWM.m
deleted file mode 100644
index 334234a..0000000
--- a/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzWM.m
+++ /dev/null
@@ -1,574 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2003 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_QuartzVideo.h"
-#include "SDL_QuartzWM.h"
-
-void QZ_FreeWMCursor (_THIS, WMcursor *cursor) {
-
- if ( cursor != NULL ) {
- [ cursor->nscursor release ];
- free (cursor);
- }
-}
-
-WMcursor* QZ_CreateWMCursor (_THIS, Uint8 *data, Uint8 *mask,
- int w, int h, int hot_x, int hot_y) {
- WMcursor *cursor;
- NSBitmapImageRep *imgrep;
- NSImage *img;
- unsigned char *planes[5];
- int i;
- NSAutoreleasePool *pool;
-
- pool = [ [ NSAutoreleasePool alloc ] init ];
-
- /* Allocate the cursor memory */
- cursor = (WMcursor *)SDL_malloc(sizeof(WMcursor));
- if (cursor == NULL) goto outOfMemory;
-
- /* create the image representation and get the pointers to its storage */
- imgrep = [ [ [ NSBitmapImageRep alloc ] initWithBitmapDataPlanes: NULL pixelsWide: w pixelsHigh: h bitsPerSample: 1 samplesPerPixel: 2 hasAlpha: YES isPlanar: YES colorSpaceName: NSDeviceBlackColorSpace bytesPerRow: (w+7)/8 bitsPerPixel: 0 ] autorelease ];
- if (imgrep == nil) goto outOfMemory;
- [ imgrep getBitmapDataPlanes: planes ];
-
- /* copy data and mask, extending the mask to all black pixels because the inversion effect doesn't work with Cocoa's alpha-blended cursors */
- for (i = 0; i < (w+7)/8*h; i++) {
- planes[0][i] = data[i];
- planes[1][i] = mask[i] | data[i];
- }
-
- /* create image and cursor */
- img = [ [ [ NSImage alloc ] initWithSize: NSMakeSize(w, h) ] autorelease ];
- if (img == nil) goto outOfMemory;
- [ img addRepresentation: imgrep ];
- if (system_version < 0x1030) { /* on 10.2, cursors must be 16*16 */
- if (w > 16 || h > 16) { /* too big: scale it down */
- [ img setScalesWhenResized: YES ];
- hot_x = hot_x*16/w;
- hot_y = hot_y*16/h;
- }
- else { /* too small (or just right): extend it (from the bottom left corner, so hot_y must be adjusted) */
- hot_y += 16 - h;
- }
- [ img setSize: NSMakeSize(16, 16) ];
- }
- cursor->nscursor = [ [ NSCursor alloc ] initWithImage: img hotSpot: NSMakePoint(hot_x, hot_y) ];
- if (cursor->nscursor == nil) goto outOfMemory;
-
- [ pool release ];
- return(cursor);
-
-outOfMemory:
- [ pool release ];
- if (cursor != NULL) SDL_free(cursor);
- SDL_OutOfMemory();
- return(NULL);
-}
-
-void QZ_UpdateCursor (_THIS) {
- BOOL state;
-
- if (cursor_should_be_visible || !(SDL_GetAppState() & SDL_APPMOUSEFOCUS)) {
- state = YES;
- } else {
- state = NO;
- }
- if (state != cursor_visible) {
- if (state) {
- [ NSCursor unhide ];
- } else {
- [ NSCursor hide ];
- }
- cursor_visible = state;
- }
-}
-
-BOOL QZ_IsMouseInWindow (_THIS) {
- if (qz_window == nil || (mode_flags & SDL_FULLSCREEN)) return YES; /*fullscreen*/
- else {
- NSPoint p = [ qz_window mouseLocationOutsideOfEventStream ];
- p.y -= 1.0f; /* Apparently y goes from 1 to h, not from 0 to h-1 (i.e. the "location of the mouse" seems to be defined as "the location of the top left corner of the mouse pointer's hot pixel" */
- return NSPointInRect(p, [ window_view frame ]);
- }
-}
-
-int QZ_ShowWMCursor (_THIS, WMcursor *cursor) {
-
- if ( cursor == NULL) {
- if ( cursor_should_be_visible ) {
- cursor_should_be_visible = NO;
- QZ_ChangeGrabState (this, QZ_HIDECURSOR);
- }
- QZ_UpdateCursor(this);
- }
- else {
- if (qz_window ==nil || (mode_flags & SDL_FULLSCREEN)) {
- [ cursor->nscursor set ];
- }
- else {
- [ qz_window invalidateCursorRectsForView: [ qz_window contentView ] ];
- }
- if ( ! cursor_should_be_visible ) {
- cursor_should_be_visible = YES;
- QZ_ChangeGrabState (this, QZ_SHOWCURSOR);
- }
- QZ_UpdateCursor(this);
- }
-
- return 1;
-}
-
-/*
- Coordinate conversion functions, for convenience
- Cocoa sets the origin at the lower left corner of the window/screen
- SDL, CoreGraphics/WindowServer, and QuickDraw use the origin at the upper left corner
- The routines were written so they could be called before SetVideoMode() has finished;
- this might have limited usefulness at the moment, but the extra cost is trivial.
-*/
-
-/* Convert Cocoa screen coordinate to Cocoa window coordinate */
-void QZ_PrivateGlobalToLocal (_THIS, NSPoint *p) {
-
- *p = [ qz_window convertScreenToBase:*p ];
-}
-
-
-/* Convert Cocoa window coordinate to Cocoa screen coordinate */
-void QZ_PrivateLocalToGlobal (_THIS, NSPoint *p) {
-
- *p = [ qz_window convertBaseToScreen:*p ];
-}
-
-/* Convert SDL coordinate to Cocoa coordinate */
-void QZ_PrivateSDLToCocoa (_THIS, NSPoint *p) {
-
- if ( CGDisplayIsCaptured (display_id) ) { /* capture signals fullscreen */
-
- p->y = CGDisplayPixelsHigh (display_id) - p->y;
- }
- else {
-
- *p = [ window_view convertPoint:*p toView: nil ];
-
- /* We need a workaround in OpenGL mode */
- if ( SDL_VideoSurface->flags & SDL_OPENGL ) {
- p->y = [window_view frame].size.height - p->y;
- }
- }
-}
-
-/* Convert Cocoa coordinate to SDL coordinate */
-void QZ_PrivateCocoaToSDL (_THIS, NSPoint *p) {
-
- if ( CGDisplayIsCaptured (display_id) ) { /* capture signals fullscreen */
-
- p->y = CGDisplayPixelsHigh (display_id) - p->y;
- }
- else {
-
- *p = [ window_view convertPoint:*p fromView: nil ];
-
- /* We need a workaround in OpenGL mode */
- if ( SDL_VideoSurface != NULL && (SDL_VideoSurface->flags & SDL_OPENGL) ) {
- p->y = [window_view frame].size.height - p->y;
- }
- }
-}
-
-/* Convert SDL coordinate to window server (CoreGraphics) coordinate */
-CGPoint QZ_PrivateSDLToCG (_THIS, NSPoint *p) {
-
- CGPoint cgp;
-
- if ( ! CGDisplayIsCaptured (display_id) ) { /* not captured => not fullscreen => local coord */
-
- int height;
-
- QZ_PrivateSDLToCocoa (this, p);
- QZ_PrivateLocalToGlobal (this, p);
-
- height = CGDisplayPixelsHigh (display_id);
- p->y = height - p->y;
- }
-
- cgp.x = p->x;
- cgp.y = p->y;
-
- return cgp;
-}
-
-#if 0 /* Dead code */
-/* Convert window server (CoreGraphics) coordinate to SDL coordinate */
-void QZ_PrivateCGToSDL (_THIS, NSPoint *p) {
-
- if ( ! CGDisplayIsCaptured (display_id) ) { /* not captured => not fullscreen => local coord */
-
- int height;
-
- /* Convert CG Global to Cocoa Global */
- height = CGDisplayPixelsHigh (display_id);
- p->y = height - p->y;
-
- QZ_PrivateGlobalToLocal (this, p);
- QZ_PrivateCocoaToSDL (this, p);
- }
-}
-#endif /* Dead code */
-
-void QZ_PrivateWarpCursor (_THIS, int x, int y) {
-
- NSPoint p;
- CGPoint cgp;
-
- p = NSMakePoint (x, y);
- cgp = QZ_PrivateSDLToCG (this, &p);
-
- /* this is the magic call that fixes cursor "freezing" after warp */
- CGSetLocalEventsSuppressionInterval (0.0);
- CGWarpMouseCursorPosition (cgp);
-}
-
-void QZ_WarpWMCursor (_THIS, Uint16 x, Uint16 y) {
-
- /* Only allow warping when in foreground */
- if ( ! [ NSApp isActive ] )
- return;
-
- /* Do the actual warp */
- if (grab_state != QZ_INVISIBLE_GRAB) QZ_PrivateWarpCursor (this, x, y);
-
- /* Generate the mouse moved event */
- SDL_PrivateMouseMotion (0, 0, x, y);
-}
-
-void QZ_MoveWMCursor (_THIS, int x, int y) { }
-void QZ_CheckMouseMode (_THIS) { }
-
-void QZ_SetCaption (_THIS, const char *title, const char *icon) {
-
- if ( qz_window != nil ) {
- NSString *string;
- if ( title != NULL ) {
- string = [ [ NSString alloc ] initWithUTF8String:title ];
- [ qz_window setTitle:string ];
- [ string release ];
- }
- if ( icon != NULL ) {
- string = [ [ NSString alloc ] initWithUTF8String:icon ];
- [ qz_window setMiniwindowTitle:string ];
- [ string release ];
- }
- }
-}
-
-void QZ_SetWindowPos (_THIS, int x, int y)
-{
- if ( qz_window == nil ) {
- //printf( "%s(%d,%d): called for NULL window\n", __FUNCTION__, x, y );
- return;
- }
-
- [ qz_window setFrameTopLeftPoint:NSMakePoint( x, this->hidden->height - y ) ];
- //printf( "%s(%d,%d): done\n", __FUNCTION__, x, y );
-}
-
-void QZ_GetWindowPos(_THIS, int *px, int *py)
-{
- NSPoint pt;
-
- *px = *py = 0;
-
- if ( qz_window == NULL ) {
- //printf( "%s: called on NULL window\n", __FUNCTION__ );
- }
-
- if ( qz_window != nil ) {
- NSRect rect = [ qz_window frame ];
- *px = rect.origin.x;
- *py = this->hidden->height - rect.origin.y - rect.size.height;
- //printf( "%s: returning (%d,%d)\n", __FUNCTION__, *px, *py );
- }
-}
-
-/* determine if the window is fully visible on the current screen configuration */
-int QZ_IsWindowVisible(_THIS, int recenter)
-{
- int result = 0;
-
- //printf( "... enter %s\n", __FUNCTION__ );
-
- if ( qz_window != NULL ) {
- NSRect frame = [ qz_window frame ];
- NSArray* screens = [ NSScreen screens ];
- unsigned int count = [ screens count ];
- unsigned int n;
- //printf( "window frame (%d,%d) (%d,%d)\n", frame.origin.x, frame.origin.y,
- // frame.size.width, frame.size.height );
- for (n = 0; n < count; n++) {
- NSScreen* screen = [ screens objectAtIndex: n ];
- NSRect vis = [ screen visibleFrame ];
-
- //printf( "screen %d/%d frame (%d,%d) (%d,%d)\n", n+1, count,
- // vis.origin.x, vis.origin.y, vis.size.width, vis.size.height );
-
- if (frame.origin.x >= vis.origin.x &&
- frame.origin.x + frame.size.width <= vis.origin.x + vis.size.width &&
- frame.origin.y >= vis.origin.y &&
- frame.origin.y + frame.size.height <= vis.origin.y + vis.size.height )
- {
- result = 1;
- break;
- }
- }
- }
- //printf ( "... exit %s, result = %d\n", __FUNCTION__, result );
- if ( !result && recenter ) {
- [ qz_window center ] ;
- }
- return result;
-}
-
-int QZ_GetMonitorDPI(_THIS, int *xDpi, int *yDpi)
-{
- /* FIXME: how to get this information from Cocoa ? */
- return -1;
-}
-
-int QZ_GetMonitorRect (_THIS, SDL_Rect *rect)
-{
- NSWindow* window = qz_window;
- NSRect frame = [ window frame ];
- int fx1 = frame.origin.x;
- int fy1 = frame.origin.y;
- int fx2 = frame.size.width + fx1;
- int fy2 = frame.size.height + fy1;
- NSArray* screens = [ NSScreen screens ];
- unsigned int count = [ screens count ];
- int bestScreen = -1;
- int bestArea = 0;
-
- unsigned int n;
-
- /* we need to compute which screen has the most window pixels */
- for (n = 0; n < count; n++) {
- NSScreen* screen = [ screens objectAtIndex: n ];
- NSRect vis = [ screen visibleFrame ];
- int vx1 = vis.origin.x;
- int vy1 = vis.origin.y;
- int vx2 = vis.size.width + vx1;
- int vy2 = vis.size.height + vy1;
- int cx1, cx2, cy1, cy2, cArea;
-
- if (fx1 >= vx2 || vx1 >= fx2 || fy1 >= vy2 || vy1 >= fy2)
- continue;
-
- cx1 = (fx1 < vx1) ? vx1 : fx1;
- cx2 = (fx2 > vx2) ? vx2 : fx2;
- cy1 = (fy1 < vy1) ? vy1 : fy1;
- cy2 = (fy2 > vy2) ? vy2 : fy2;
-
- if (cx1 >= cx2 || cy1 >= cy2)
- continue;
-
- cArea = (cx2-cx1)*(cy2-cy1);
-
- if (bestScreen < 0 || cArea > bestArea) {
- bestScreen = n;
- bestArea = cArea;
- }
- }
- if (bestScreen < 0)
- bestScreen = 0;
-
- {
- NSScreen* screen = [ screens objectAtIndex: bestScreen ];
- NSRect vis = [ screen visibleFrame ];
-
- rect->x = vis.origin.x;
- rect->y = vis.origin.y;
- rect->w = vis.size.width;
- rect->h = vis.size.height;
- }
- return 0;
-}
-
-void QZ_SetIcon (_THIS, SDL_Surface *icon, Uint8 *mask)
-{
- NSBitmapImageRep *imgrep;
- NSImage *img;
- SDL_Surface *mergedSurface;
- NSAutoreleasePool *pool;
- Uint8 *pixels;
- SDL_bool iconSrcAlpha;
- Uint8 iconAlphaValue;
- int i, j, maskPitch, index;
-
- pool = [ [ NSAutoreleasePool alloc ] init ];
-
- imgrep = [ [ [ NSBitmapImageRep alloc ] initWithBitmapDataPlanes: NULL pixelsWide: icon->w pixelsHigh: icon->h bitsPerSample: 8 samplesPerPixel: 4 hasAlpha: YES isPlanar: NO colorSpaceName: NSDeviceRGBColorSpace bytesPerRow: 4*icon->w bitsPerPixel: 32 ] autorelease ];
- if (imgrep == nil) goto freePool;
- pixels = [ imgrep bitmapData ];
- SDL_memset(pixels, 0, 4*icon->w*icon->h); /* make the background, which will survive in colorkeyed areas, completely transparent */
-
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-#define BYTEORDER_DEPENDENT_RGBA_MASKS 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF
-#else
-#define BYTEORDER_DEPENDENT_RGBA_MASKS 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000
-#endif
- mergedSurface = SDL_CreateRGBSurfaceFrom(pixels, icon->w, icon->h, 32, 4*icon->w, BYTEORDER_DEPENDENT_RGBA_MASKS);
- if (mergedSurface == NULL) goto freePool;
-
- /* blit, with temporarily cleared SRCALPHA flag because we want to copy, not alpha-blend */
- iconSrcAlpha = ((icon->flags & SDL_SRCALPHA) != 0);
- iconAlphaValue = icon->format->alpha;
- SDL_SetAlpha(icon, 0, 255);
- SDL_BlitSurface(icon, NULL, mergedSurface, NULL);
- if (iconSrcAlpha) SDL_SetAlpha(icon, SDL_SRCALPHA, iconAlphaValue);
-
- SDL_FreeSurface(mergedSurface);
-
- /* apply mask, source alpha, and premultiply color values by alpha */
- maskPitch = (icon->w+7)/8;
- for (i = 0; i < icon->h; i++) {
- for (j = 0; j < icon->w; j++) {
- index = i*4*icon->w + j*4;
- if (!(mask[i*maskPitch + j/8] & (128 >> j%8))) {
- pixels[index + 3] = 0;
- }
- else {
- if (iconSrcAlpha) {
- if (icon->format->Amask == 0) pixels[index + 3] = icon->format->alpha;
- }
- else {
- pixels[index + 3] = 255;
- }
- }
- if (pixels[index + 3] < 255) {
- pixels[index + 0] = (Uint16)pixels[index + 0]*pixels[index + 3]/255;
- pixels[index + 1] = (Uint16)pixels[index + 1]*pixels[index + 3]/255;
- pixels[index + 2] = (Uint16)pixels[index + 2]*pixels[index + 3]/255;
- }
- }
- }
-
- img = [ [ [ NSImage alloc ] initWithSize: NSMakeSize(icon->w, icon->h) ] autorelease ];
- if (img == nil) goto freePool;
- [ img addRepresentation: imgrep ];
- [ NSApp setApplicationIconImage:img ];
-
-freePool:
- [ pool release ];
-}
-
-int QZ_IconifyWindow (_THIS) {
-
- if ( ! [ qz_window isMiniaturized ] ) {
- [ qz_window miniaturize:nil ];
- return 1;
- }
- else {
- SDL_SetError ("window already iconified");
- return 0;
- }
-}
-
-
-int QZ_GetWMInfo (_THIS, SDL_SysWMinfo *info) {
- info->nsWindowPtr = qz_window;
- return 0;
-}
-
-void QZ_ChangeGrabState (_THIS, int action) {
-
- /*
- Figure out what the next state should be based on the action.
- Ignore actions that can't change the current state.
- */
- if ( grab_state == QZ_UNGRABBED ) {
- if ( action == QZ_ENABLE_GRAB ) {
- if ( cursor_should_be_visible )
- grab_state = QZ_VISIBLE_GRAB;
- else
- grab_state = QZ_INVISIBLE_GRAB;
- }
- }
- else if ( grab_state == QZ_VISIBLE_GRAB ) {
- if ( action == QZ_DISABLE_GRAB )
- grab_state = QZ_UNGRABBED;
- else if ( action == QZ_HIDECURSOR )
- grab_state = QZ_INVISIBLE_GRAB;
- }
- else {
- assert( grab_state == QZ_INVISIBLE_GRAB );
-
- if ( action == QZ_DISABLE_GRAB )
- grab_state = QZ_UNGRABBED;
- else if ( action == QZ_SHOWCURSOR )
- grab_state = QZ_VISIBLE_GRAB;
- }
-
- /* now apply the new state */
- if (grab_state == QZ_UNGRABBED) {
-
- CGAssociateMouseAndMouseCursorPosition (1);
- }
- else if (grab_state == QZ_VISIBLE_GRAB) {
-
- CGAssociateMouseAndMouseCursorPosition (1);
- }
- else {
- assert( grab_state == QZ_INVISIBLE_GRAB );
-
- QZ_PrivateWarpCursor (this, SDL_VideoSurface->w / 2, SDL_VideoSurface->h / 2);
- CGAssociateMouseAndMouseCursorPosition (0);
- }
-}
-
-SDL_GrabMode QZ_GrabInput (_THIS, SDL_GrabMode grab_mode) {
-
- int doGrab = grab_mode & SDL_GRAB_ON;
- /*int fullscreen = grab_mode & SDL_GRAB_FULLSCREEN;*/
-
- if ( this->screen == NULL ) {
- SDL_SetError ("QZ_GrabInput: screen is NULL");
- return SDL_GRAB_OFF;
- }
-
- if ( ! video_set ) {
- /*SDL_SetError ("QZ_GrabInput: video is not set, grab will take effect on mode switch"); */
- current_grab_mode = grab_mode;
- return grab_mode; /* Will be set later on mode switch */
- }
-
- if ( grab_mode != SDL_GRAB_QUERY ) {
- if ( doGrab )
- QZ_ChangeGrabState (this, QZ_ENABLE_GRAB);
- else
- QZ_ChangeGrabState (this, QZ_DISABLE_GRAB);
-
- current_grab_mode = doGrab ? SDL_GRAB_ON : SDL_GRAB_OFF;
- }
-
- return current_grab_mode;
-}
diff --git a/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzWindow.h b/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzWindow.h
deleted file mode 100644
index cdfdec4..0000000
--- a/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzWindow.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2003 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Subclass of NSWindow to fix genie effect and support resize events */
-@interface SDL_QuartzWindow : NSWindow
-- (void)miniaturize:(id)sender;
-- (void)display;
-- (void)setFrame:(NSRect)frameRect display:(BOOL)flag;
-- (void)appDidHide:(NSNotification*)note;
-- (void)appWillUnhide:(NSNotification*)note;
-- (void)appDidUnhide:(NSNotification*)note;
-- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag;
-@end
-
-/* Delegate for our NSWindow to send SDLQuit() on close */
-@interface SDL_QuartzWindowDelegate : NSObject
-- (BOOL)windowShouldClose:(id)sender;
-@end
-
-/* Subclass of NSView to set cursor rectangle */
-@interface SDL_QuartzView : NSView
-- (void)resetCursorRects;
-@end
diff --git a/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzWindow.m b/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzWindow.m
deleted file mode 100644
index b56f9a7..0000000
--- a/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzWindow.m
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2003 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_QuartzVideo.h"
-#include "SDL_QuartzWM.h"
-#include "SDL_QuartzWindow.h"
-
-/*
- This function makes the *SDL region* of the window 100% opaque.
- The genie effect uses the alpha component. Otherwise,
- it doesn't seem to matter what value it has.
-*/
-static void QZ_SetPortAlphaOpaque () {
-
- SDL_Surface *surface = current_video->screen;
- int bpp;
-
- bpp = surface->format->BitsPerPixel;
-
- if (bpp == 32) {
-
- Uint32 *pixels = (Uint32*) surface->pixels;
- Uint32 rowPixels = surface->pitch / 4;
- Uint32 i, j;
-
- for (i = 0; i < surface->h; i++)
- for (j = 0; j < surface->w; j++) {
-
- pixels[ (i * rowPixels) + j ] |= 0xFF000000;
- }
- }
-}
-
-@implementation SDL_QuartzWindow
-
-/* we override these methods to fix the miniaturize animation/dock icon bug */
-- (void)miniaturize:(id)sender
-{
- if (SDL_VideoSurface->flags & SDL_OPENGL) {
-
- /*
- Future: Grab framebuffer and put into NSImage
- [ qz_window setMiniwindowImage:image ];
- */
- }
- else {
-
- /* make the alpha channel opaque so anim won't have holes in it */
- QZ_SetPortAlphaOpaque ();
- }
-
- /* window is hidden now */
- SDL_PrivateAppActive (0, SDL_APPACTIVE);
-
- [ super miniaturize:sender ];
-}
-
-- (void)display
-{
- /*
- This method fires just before the window deminaturizes from the Dock.
-
- We'll save the current visible surface, let the window manager redraw any
- UI elements, and restore the SDL surface. This way, no expose event
- is required, and the deminiaturize works perfectly.
- */
- SDL_VideoDevice *this = (SDL_VideoDevice*)current_video;
-
- /* make sure pixels are fully opaque */
- if (! ( SDL_VideoSurface->flags & SDL_OPENGL ) )
- QZ_SetPortAlphaOpaque ();
-
- /* save current visible SDL surface */
- [ self cacheImageInRect:[ window_view frame ] ];
-
- /* let the window manager redraw controls, border, etc */
- [ super display ];
-
- /* restore visible SDL surface */
- [ self restoreCachedImage ];
-
- /* window is visible again */
- SDL_PrivateAppActive (1, SDL_APPACTIVE);
-}
-
-- (void)setFrame:(NSRect)frameRect display:(BOOL)flag
-{
-
- /*
- If the video surface is NULL, this originated from QZ_SetVideoMode,
- so don't send the resize event.
- */
- SDL_VideoDevice *this = (SDL_VideoDevice*)current_video;
-
- if (this && SDL_VideoSurface == NULL) {
-
- [ super setFrame:frameRect display:flag ];
- }
- else if (this && qz_window) {
-
- NSRect newViewFrame;
-
- [ super setFrame:frameRect display:flag ];
-
- newViewFrame = [ window_view frame ];
-
- SDL_PrivateResize (newViewFrame.size.width, newViewFrame.size.height);
-
- /* If not OpenGL, we have to update the pixels and pitch */
- if ( ! ( SDL_VideoSurface->flags & SDL_OPENGL ) ) {
-
- CGrafPtr thePort = [ window_view qdPort ];
- LockPortBits ( thePort );
-
- SDL_VideoSurface->pixels = GetPixBaseAddr ( GetPortPixMap ( thePort ) );
- SDL_VideoSurface->pitch = GetPixRowBytes ( GetPortPixMap ( thePort ) );
-
- /*
- SDL_VideoSurface->pixels now points to the window's pixels
- We want it to point to the *view's* pixels
- */
- {
- int vOffset = [ qz_window frame ].size.height -
- newViewFrame.size.height - newViewFrame.origin.y;
-
- int hOffset = newViewFrame.origin.x;
-
- SDL_VideoSurface->pixels = (Uint8 *)SDL_VideoSurface->pixels + (vOffset * SDL_VideoSurface->pitch) + hOffset * (device_bpp/8);
- }
-
- UnlockPortBits ( thePort );
- }
- }
-}
-
-- (void)appDidHide:(NSNotification*)note
-{
- SDL_PrivateAppActive (0, SDL_APPACTIVE);
-}
-
-- (void)appWillUnhide:(NSNotification*)note
-{
- SDL_VideoDevice *this = (SDL_VideoDevice*)current_video;
-
- if ( this ) {
-
- /* make sure pixels are fully opaque */
- if (! ( SDL_VideoSurface->flags & SDL_OPENGL ) )
- QZ_SetPortAlphaOpaque ();
-
- /* save current visible SDL surface */
- [ self cacheImageInRect:[ window_view frame ] ];
- }
-}
-
-- (void)appDidUnhide:(NSNotification*)note
-{
- /* restore cached image, since it may not be current, post expose event too */
- [ self restoreCachedImage ];
-
- /*SDL_PrivateExpose ();*/
-
- SDL_PrivateAppActive (1, SDL_APPACTIVE);
-}
-
-- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag
-{
- /* Make our window subclass receive these application notifications */
- [ [ NSNotificationCenter defaultCenter ] addObserver:self
- selector:@selector(appDidHide:) name:NSApplicationDidHideNotification object:NSApp ];
-
- [ [ NSNotificationCenter defaultCenter ] addObserver:self
- selector:@selector(appDidUnhide:) name:NSApplicationDidUnhideNotification object:NSApp ];
-
- [ [ NSNotificationCenter defaultCenter ] addObserver:self
- selector:@selector(appWillUnhide:) name:NSApplicationWillUnhideNotification object:NSApp ];
-
- return [ super initWithContentRect:contentRect styleMask:styleMask backing:backingType defer:flag ];
-}
-
-@end
-
-@implementation SDL_QuartzWindowDelegate
-- (BOOL)windowShouldClose:(id)sender
-{
- SDL_PrivateQuit();
- return NO;
-}
-
-- (void)windowDidBecomeKey:(NSNotification *)aNotification
-{
- QZ_DoActivate (current_video);
-}
-
-- (void)windowDidResignKey:(NSNotification *)aNotification
-{
- QZ_DoDeactivate (current_video);
-}
-
-@end
-
-@implementation SDL_QuartzView
-
-- (void)resetCursorRects
-{
- SDL_Cursor *sdlc = SDL_GetCursor();
- if (sdlc != NULL && sdlc->wm_cursor != NULL) {
- [self addCursorRect: [self visibleRect] cursor: sdlc->wm_cursor->nscursor];
- }
-}
-
-@end
diff --git a/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzYUV.m b/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzYUV.m
deleted file mode 100644
index acb3d94..0000000
--- a/distrib/sdl-1.2.12/src/video/quartz/SDL_QuartzYUV.m
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2003 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_QuartzVideo.h"
-#include "SDL_QuartzWindow.h"
-#include "../SDL_yuvfuncs.h"
-
-
-#define yuv_idh (this->hidden->yuv_idh)
-#define yuv_matrix (this->hidden->yuv_matrix)
-#define yuv_codec (this->hidden->yuv_codec)
-#define yuv_seq (this->hidden->yuv_seq)
-#define yuv_pixmap (this->hidden->yuv_pixmap)
-#define yuv_data (this->hidden->yuv_data)
-#define yuv_width (this->hidden->yuv_width)
-#define yuv_height (this->hidden->yuv_height)
-#define yuv_port (this->hidden->yuv_port)
-
-
-static int QZ_LockYUV (_THIS, SDL_Overlay *overlay) {
-
- return 0;
-}
-
-static void QZ_UnlockYUV (_THIS, SDL_Overlay *overlay) {
-
- ;
-}
-
-static int QZ_DisplayYUV (_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst) {
-
- OSErr err;
- CodecFlags flags;
-
- if (dst->x != 0 || dst->y != 0) {
-
- SDL_SetError ("Need a dst at (0,0)");
- return -1;
- }
-
- if (dst->w != yuv_width || dst->h != yuv_height) {
-
- Fixed scale_x, scale_y;
-
- scale_x = FixDiv ( Long2Fix (dst->w), Long2Fix (overlay->w) );
- scale_y = FixDiv ( Long2Fix (dst->h), Long2Fix (overlay->h) );
-
- SetIdentityMatrix (yuv_matrix);
- ScaleMatrix (yuv_matrix, scale_x, scale_y, Long2Fix (0), Long2Fix (0));
-
- SetDSequenceMatrix (yuv_seq, yuv_matrix);
-
- yuv_width = dst->w;
- yuv_height = dst->h;
- }
-
- if( ( err = DecompressSequenceFrameS(
- yuv_seq,
- (void*)yuv_pixmap,
- sizeof (PlanarPixmapInfoYUV420),
- codecFlagUseImageBuffer, &flags, nil ) != noErr ) )
- {
- SDL_SetError ("DecompressSequenceFrameS failed");
- }
-
- return err != noErr;
-}
-
-static void QZ_FreeHWYUV (_THIS, SDL_Overlay *overlay) {
-
- CDSequenceEnd (yuv_seq);
- ExitMovies();
-
- SDL_free (overlay->hwfuncs);
- SDL_free (overlay->pitches);
- SDL_free (overlay->pixels);
-
- if (SDL_VideoSurface->flags & SDL_FULLSCREEN) {
- [ qz_window close ];
- qz_window = nil;
- }
-
- SDL_free (yuv_matrix);
- DisposeHandle ((Handle)yuv_idh);
-}
-
-/* check for 16 byte alignment, bail otherwise */
-#define CHECK_ALIGN(x) do { if ((Uint32)x & 15) { SDL_SetError("Alignment error"); return NULL; } } while(0)
-
-/* align a byte offset, return how much to add to make it a multiple of 16 */
-#define ALIGN(x) ((16 - (x & 15)) & 15)
-
-SDL_Overlay* QZ_CreateYUVOverlay (_THIS, int width, int height,
- Uint32 format, SDL_Surface *display) {
-
- Uint32 codec;
- OSStatus err;
- CGrafPtr port;
- SDL_Overlay *overlay;
-
- if (format == SDL_YV12_OVERLAY ||
- format == SDL_IYUV_OVERLAY) {
-
- codec = kYUV420CodecType;
- }
- else {
- SDL_SetError ("Hardware: unsupported video format");
- return NULL;
- }
-
- yuv_idh = (ImageDescriptionHandle) NewHandleClear (sizeof(ImageDescription));
- if (yuv_idh == NULL) {
- SDL_OutOfMemory();
- return NULL;
- }
-
- yuv_matrix = (MatrixRecordPtr) SDL_malloc (sizeof(MatrixRecord));
- if (yuv_matrix == NULL) {
- SDL_OutOfMemory();
- return NULL;
- }
-
- if ( EnterMovies() != noErr ) {
- SDL_SetError ("Could not init QuickTime for YUV playback");
- return NULL;
- }
-
- err = FindCodec (codec, bestSpeedCodec, nil, &yuv_codec);
- if (err != noErr) {
- SDL_SetError ("Could not find QuickTime codec for format");
- return NULL;
- }
-
- if (SDL_VideoSurface->flags & SDL_FULLSCREEN) {
-
- /*
- Acceleration requires a window to be present.
- A CGrafPtr that points to the screen isn't good enough
- */
- NSRect content = NSMakeRect (0, 0, SDL_VideoSurface->w, SDL_VideoSurface->h);
-
- qz_window = [ [ SDL_QuartzWindow alloc ]
- initWithContentRect:content
- styleMask:NSBorderlessWindowMask
- backing:NSBackingStoreBuffered defer:NO ];
-
- if (qz_window == nil) {
- SDL_SetError ("Could not create the Cocoa window");
- return NULL;
- }
-
- [ qz_window setContentView:[ [ NSQuickDrawView alloc ] init ] ];
- [ qz_window setReleasedWhenClosed:YES ];
- [ qz_window center ];
- [ qz_window setAcceptsMouseMovedEvents:YES ];
- [ qz_window setLevel:CGShieldingWindowLevel() ];
- [ qz_window makeKeyAndOrderFront:nil ];
-
- port = [ [ qz_window contentView ] qdPort ];
- SetPort (port);
-
- /*
- BUG: would like to remove white flash when window kicks in
- {
- Rect r;
- SetRect (&r, 0, 0, SDL_VideoSurface->w, SDL_VideoSurface->h);
- PaintRect (&r);
- QDFlushPortBuffer (port, nil);
- }
- */
- }
- else {
- port = [ window_view qdPort ];
- SetPort (port);
- }
-
- SetIdentityMatrix (yuv_matrix);
-
- HLock ((Handle)yuv_idh);
-
- (**yuv_idh).idSize = sizeof(ImageDescription);
- (**yuv_idh).cType = codec;
- (**yuv_idh).version = 1;
- (**yuv_idh).revisionLevel = 0;
- (**yuv_idh).width = width;
- (**yuv_idh).height = height;
- (**yuv_idh).hRes = Long2Fix(72);
- (**yuv_idh).vRes = Long2Fix(72);
- (**yuv_idh).spatialQuality = codecLosslessQuality;
- (**yuv_idh).frameCount = 1;
- (**yuv_idh).clutID = -1;
- (**yuv_idh).dataSize = 0;
- (**yuv_idh).depth = 24;
-
- HUnlock ((Handle)yuv_idh);
-
- err = DecompressSequenceBeginS (
- &yuv_seq,
- yuv_idh,
- NULL,
- 0,
- port,
- NULL,
- NULL,
- yuv_matrix,
- 0,
- NULL,
- codecFlagUseImageBuffer,
- codecLosslessQuality,
- yuv_codec);
-
- if (err != noErr) {
- SDL_SetError ("Error trying to start YUV codec.");
- return NULL;
- }
-
- overlay = (SDL_Overlay*) SDL_malloc (sizeof(*overlay));
- if (overlay == NULL) {
- SDL_OutOfMemory();
- return NULL;
- }
-
- overlay->format = format;
- overlay->w = width;
- overlay->h = height;
- overlay->planes = 3;
- overlay->hw_overlay = 1;
- {
- int offset;
- Uint8 **pixels;
- Uint16 *pitches;
- int plane2, plane3;
-
- if (format == SDL_IYUV_OVERLAY) {
-
- plane2 = 1; /* Native codec format */
- plane3 = 2;
- }
- else if (format == SDL_YV12_OVERLAY) {
-
- /* switch the U and V planes */
- plane2 = 2; /* U plane maps to plane 3 */
- plane3 = 1; /* V plane maps to plane 2 */
- }
- else {
- SDL_SetError("Unsupported YUV format");
- return NULL;
- }
-
- pixels = (Uint8**) SDL_malloc (sizeof(*pixels) * 3);
- pitches = (Uint16*) SDL_malloc (sizeof(*pitches) * 3);
- if (pixels == NULL || pitches == NULL) {
- SDL_OutOfMemory();
- return NULL;
- }
-
- /* Fix: jc.bertin@free.fr
- PlanarPixmapInfoYUV420 is a big-endian struct */
- yuv_pixmap = (PlanarPixmapInfoYUV420*)
- SDL_malloc (sizeof(PlanarPixmapInfoYUV420) +
- (width * height * 2));
- if (yuv_pixmap == NULL) {
- SDL_OutOfMemory ();
- return NULL;
- }
-
- /* CHECK_ALIGN(yuv_pixmap); */
- offset = sizeof(PlanarPixmapInfoYUV420);
- /* offset += ALIGN(offset); */
- /* CHECK_ALIGN(offset); */
-
- pixels[0] = (Uint8*)yuv_pixmap + offset;
- /* CHECK_ALIGN(pixels[0]); */
-
- pitches[0] = width;
- yuv_pixmap->componentInfoY.offset = EndianS32_NtoB(offset);
- yuv_pixmap->componentInfoY.rowBytes = EndianU32_NtoB(width);
-
- offset += width * height;
- pixels[plane2] = (Uint8*)yuv_pixmap + offset;
- pitches[plane2] = width / 2;
- yuv_pixmap->componentInfoCb.offset = EndianS32_NtoB(offset);
- yuv_pixmap->componentInfoCb.rowBytes = EndianU32_NtoB(width / 2);
-
- offset += (width * height / 4);
- pixels[plane3] = (Uint8*)yuv_pixmap + offset;
- pitches[plane3] = width / 2;
- yuv_pixmap->componentInfoCr.offset = EndianS32_NtoB(offset);
- yuv_pixmap->componentInfoCr.rowBytes = EndianU32_NtoB(width / 2);
-
- overlay->pixels = pixels;
- overlay->pitches = pitches;
- }
-
- overlay->hwfuncs = SDL_malloc (sizeof(*overlay->hwfuncs));
- if (overlay->hwfuncs == NULL) {
- SDL_OutOfMemory();
- return NULL;
- }
-
- overlay->hwfuncs->Lock = QZ_LockYUV;
- overlay->hwfuncs->Unlock = QZ_UnlockYUV;
- overlay->hwfuncs->Display = QZ_DisplayYUV;
- overlay->hwfuncs->FreeHW = QZ_FreeHWYUV;
-
- yuv_width = overlay->w;
- yuv_height = overlay->h;
-
- return overlay;
-}
diff --git a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosASM.S b/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosASM.S
deleted file mode 100644
index 2de0ceb..0000000
--- a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosASM.S
+++ /dev/null
@@ -1,116 +0,0 @@
-;
-; SDL - Simple DirectMedia Layer
-; Copyright (C) 1997-2004 Sam Lantinga
-;
-; This library is free software; you can redistribute it and/or
-; modify it under the terms of the GNU Library General Public
-; License as published by the Free Software Foundation; either
-; version 2 of the License, or (at your option) any later version.
-;
-; This library is distributed in the hope that it will be useful,
-; but WITHOUT ANY WARRANTY; without even the implied warranty of
-; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-; Library General Public License for more details.
-;
-; You should have received a copy of the GNU Library General Public
-; License along with this library; if not, write to the Free
-; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-;
-; Sam Lantinga
-; slouken@libsdl.org
-;
-; Assembler routines for RISC OS display
-;
-
- AREA |C$$CODE|
-
- EXPORT |RISCOS_Put32|
-
-; Display 32bpp to 32bpp, 1:1
-;
-; Code provided by Adrain Lees
-;
-; entry a1 -> destination
-; a2 = dest width in pixels
-; a3 = dest line length in bytes
-; a4 = dest height in scanlines
-; arg5 -> source
-; arg6 = byte offset from end of source line to start of next
-
-Arg5 * 10*4
-Arg6 * Arg5+4
-
-RISCOS_Put32 ROUT
- STMFD sp!,{a2,v1-v6,sl,fp,lr}
- LDR ip,[sp,#Arg5]
- MOV lr,a1
- B ucp64lp
-
-00 ;tail strip of 1-15 pixels
-
- LDR v1,[ip],#4
-01 SUBS a2,a2,#1
- STR v1,[lr],#4
- LDRHI v1,[ip],#4
- BHI %01
- B %02
-
-ucp64end ADDS a2,a2,#16
- BNE %00
-
-02 SUBS a4,a4,#1 ;height--
- LDRHI v1,[sp,#Arg6]
- LDRHI a2,[sp] ;reload width
- BLS %03
-
- ;move to start of next scanline
-
- ADD lr,a1,a3
- ADD a1,a1,a3
- ADD ip,ip,v1
-
-ucp64lp SUBS a2,a2,#16
- BLO ucp64end
-
- PLD [ip,#64]
-
- LDR v1,[ip],#4
- LDR v2,[ip],#4
- LDR v3,[ip],#4
- LDR v4,[ip],#4
- LDR v5,[ip],#4
- LDR v6,[ip],#4
- LDR sl,[ip],#4
- LDR fp,[ip],#4
- STR v1,[lr],#4
- STR v2,[lr],#4
- STR v3,[lr],#4
- STR v4,[lr],#4
- STR v5,[lr],#4
- STR v6,[lr],#4
- STR sl,[lr],#4
- STR fp,[lr],#4
-
- PLD [ip,#64]
-
- LDR v1,[ip],#4
- LDR v2,[ip],#4
- LDR v3,[ip],#4
- LDR v4,[ip],#4
- LDR v5,[ip],#4
- LDR v6,[ip],#4
- LDR sl,[ip],#4
- LDR fp,[ip],#4
- STR v1,[lr],#4
- STR v2,[lr],#4
- STR v3,[lr],#4
- STR v4,[lr],#4
- STR v5,[lr],#4
- STR v6,[lr],#4
- STR sl,[lr],#4
- STR fp,[lr],#4
-
- B ucp64lp
-
-03 LDMFD sp!,{a2,v1-v6,sl,fp,pc}
-
diff --git a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosFullScreenVideo.c b/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosFullScreenVideo.c
deleted file mode 100644
index 3604738..0000000
--- a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosFullScreenVideo.c
+++ /dev/null
@@ -1,777 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- File added by Alan Buckley (alan_baa@hotmail.com) for RISC OS compatability
- 27 March 2003
-
- Implements RISC OS full screen display.
-*/
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_riscostask.h"
-#include "SDL_riscosvideo.h"
-#include "SDL_riscosevents_c.h"
-#include "SDL_riscosmouse_c.h"
-
-#include "kernel.h"
-#include "swis.h"
-#include "unixlib/os.h"
-#include "unixlib/local.h"
-
-/* Private structures */
-typedef struct tagScreenModeBlock
-{
- int flags; // mode selector flags, bit 0 = 1, bit 1-7 format specifier, 8-31 reserved
- int x_pixels;
- int y_pixels;
- int pixel_depth; // 2^pixel_depth = bpp,i.e. 0 = 1, 1 = 2, 4 = 16, 5 = 32
- int frame_rate; // -1 use first match
- int mode_vars[5]; // array of index, value pairs terminated by -1
-} SCREENMODEBLOCK;
-
-
-/* Helper functions */
-void FULLSCREEN_SetDeviceMode(_THIS);
-int FULLSCREEN_SetMode(int width, int height, int bpp);
-void FULLSCREEN_SetupBanks(_THIS);
-
-/* SDL video device functions for fullscreen mode */
-static int FULLSCREEN_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
-static int FULLSCREEN_FlipHWSurface(_THIS, SDL_Surface *surface);
-void FULLSCREEN_SetWMCaption(_THIS, const char *title, const char *icon);
-extern int RISCOS_GetWmInfo(_THIS, SDL_SysWMinfo *info);
-
-/* UpdateRects variants */
-static void FULLSCREEN_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
-static void FULLSCREEN_UpdateRectsMemCpy(_THIS, int numrects, SDL_Rect *rects);
-static void FULLSCREEN_UpdateRects8bpp(_THIS, int numrects, SDL_Rect *rects);
-static void FULLSCREEN_UpdateRects16bpp(_THIS, int numrects, SDL_Rect *rects);
-static void FULLSCREEN_UpdateRects32bpp(_THIS, int numrects, SDL_Rect *rects);
-static void FULLSCREEN_UpdateRectsOS(_THIS, int numrects, SDL_Rect *rects);
-
-/* Local helper functions */
-static int cmpmodes(const void *va, const void *vb);
-static int FULLSCREEN_AddMode(_THIS, int bpp, int w, int h);
-void FULLSCREEN_SetWriteBank(int bank);
-void FULLSCREEN_SetDisplayBank(int bank);
-static void FULLSCREEN_DisableEscape();
-static void FULLSCREEN_EnableEscape();
-void FULLSCREEN_BuildModeList(_THIS);
-
-/* Following variable is set up in riskosTask.c */
-extern int riscos_backbuffer; /* Create a back buffer in system memory for full screen mode */
-
-/* Following is used to create a sprite back buffer */
-extern unsigned char *WIMP_CreateBuffer(int width, int height, int bpp);
-
-/* Fast assembler copy */
-extern void RISCOS_Put32(void *to, int pixels, int pitch, int rows, void *from, int src_skip_bytes);
-
-SDL_Surface *FULLSCREEN_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- _kernel_swi_regs regs;
- Uint32 Rmask = 0;
- Uint32 Gmask = 0;
- Uint32 Bmask = 0;
- int create_back_buffer = riscos_backbuffer;
-
- switch(bpp)
- {
- case 8:
- flags |= SDL_HWPALETTE;
- break;
-
- case 15:
- case 16:
- Bmask = 0x00007c00;
- Gmask = 0x000003e0;
- Rmask = 0x0000001f;
- break;
-
- case 32:
- Bmask = 0x00ff0000;
- Gmask = 0x0000ff00;
- Rmask = 0x000000ff;
- break;
-
- default:
- SDL_SetError("Pixel depth not supported");
- return NULL;
- break;
- }
-
- if (FULLSCREEN_SetMode(width, height, bpp) == 0)
- {
- SDL_SetError("Couldn't set requested mode");
- return (NULL);
- }
-
-/* printf("Setting mode %dx%d\n", width, height); */
-
- /* Allocate the new pixel format for the screen */
- if ( ! SDL_ReallocFormat(current, bpp, Rmask, Gmask, Bmask, 0) ) {
- RISCOS_RestoreWimpMode();
- SDL_SetError("Couldn't allocate new pixel format for requested mode");
- return(NULL);
- }
-
- /* Set up the new mode framebuffer */
- current->w = width;
- this->hidden->height = current->h = height;
-
- regs.r[0] = -1; /* -1 for current screen mode */
-
- /* Get screen width in bytes */
- regs.r[1] = 6; // Screen Width in bytes
- _kernel_swi(OS_ReadModeVariable, &regs, &regs);
-
- current->pitch = regs.r[2];
-
- if (flags & SDL_DOUBLEBUF)
- {
- regs.r[0] = 2; /* Screen area */
- _kernel_swi(OS_ReadDynamicArea, &regs, &regs);
-
- /* Reg 1 has amount of memory currently used for display */
- regs.r[0] = 2; /* Screen area */
- regs.r[1] = (current->pitch * height * 2) - regs.r[1];
- if (_kernel_swi(OS_ChangeDynamicArea, &regs, &regs) != NULL)
- {
- /* Can't allocate enough screen memory for double buffer */
- flags &= ~SDL_DOUBLEBUF;
- }
- }
-
- current->flags = flags | SDL_FULLSCREEN | SDL_HWSURFACE | SDL_PREALLOC;
-
-
- /* Need to set display banks here for double buffering */
- if (flags & SDL_DOUBLEBUF)
- {
- FULLSCREEN_SetWriteBank(0);
- FULLSCREEN_SetDisplayBank(1);
-
- create_back_buffer = 0; /* Don't need a back buffer for a double buffered display */
- }
-
- FULLSCREEN_SetupBanks(this);
-
- if (create_back_buffer)
- {
- /* If not double buffered we may need to create a memory
- ** back buffer to simulate processing on other OSes.
- ** This is turned on by setting the enviromental variable
- ** SDL$<name>$BackBuffer >= 1
- */
- if (riscos_backbuffer == 3)
- this->hidden->bank[0] = WIMP_CreateBuffer(width, height, bpp);
- else
- this->hidden->bank[0] = SDL_malloc(height * current->pitch);
- if (this->hidden->bank[0] == 0)
- {
- RISCOS_RestoreWimpMode();
- SDL_SetError("Couldnt allocate memory for back buffer");
- return (NULL);
- }
- /* Surface updated in programs is now a software surface */
- current->flags &= ~SDL_HWSURFACE;
- }
-
- /* Store address of allocated screen bank to be freed later */
- if (this->hidden->alloc_bank) SDL_free(this->hidden->alloc_bank);
- if (create_back_buffer)
- {
- this->hidden->alloc_bank = this->hidden->bank[0];
- if (riscos_backbuffer == 3)
- {
- this->hidden->bank[0] += 60; /* Start of sprite data */
- if (bpp == 8) this->hidden->bank[0] += 2048; /* 8bpp sprite have palette first */
- }
- } else
- this->hidden->alloc_bank = 0;
-
- // Clear both banks to black
- SDL_memset(this->hidden->bank[0], 0, height * current->pitch);
- SDL_memset(this->hidden->bank[1], 0, height * current->pitch);
-
- this->hidden->current_bank = 0;
- current->pixels = this->hidden->bank[0];
-
- /* Have to set the screen here, so SetDeviceMode will pick it up */
- this->screen = current;
-
- /* Reset device functions for the wimp */
- FULLSCREEN_SetDeviceMode(this);
-
-/* FULLSCREEN_DisableEscape(); */
-
- /* We're done */
- return(current);
-}
-
-/* Reset any device functions that have been changed because we have run in WIMP mode */
-void FULLSCREEN_SetDeviceMode(_THIS)
-{
- /* Update rects is different if we have a backbuffer */
-
- if (riscos_backbuffer && (this->screen->flags & SDL_DOUBLEBUF) == 0)
- {
- switch(riscos_backbuffer)
- {
- case 2: /* ARM code full word copy */
- switch(this->screen->format->BytesPerPixel)
- {
- case 1: /* 8bpp modes */
- this->UpdateRects = FULLSCREEN_UpdateRects8bpp;
- break;
- case 2: /* 15/16bpp modes */
- this->UpdateRects = FULLSCREEN_UpdateRects16bpp;
- break;
- case 4: /* 32 bpp modes */
- this->UpdateRects = FULLSCREEN_UpdateRects32bpp;
- break;
-
- default: /* Just default to the memcpy routine */
- this->UpdateRects = FULLSCREEN_UpdateRectsMemCpy;
- break;
- }
- break;
-
- case 3: /* Use OS sprite plot routine */
- this->UpdateRects = FULLSCREEN_UpdateRectsOS;
- break;
-
- default: /* Old but safe memcpy */
- this->UpdateRects = FULLSCREEN_UpdateRectsMemCpy;
- break;
- }
- } else
- this->UpdateRects = FULLSCREEN_UpdateRects; /* Default do nothing implementation */
-
- this->SetColors = FULLSCREEN_SetColors;
-
- this->FlipHWSurface = FULLSCREEN_FlipHWSurface;
-
- this->SetCaption = FULLSCREEN_SetWMCaption;
- this->SetIcon = NULL;
- this->IconifyWindow = NULL;
-
- this->ShowWMCursor = RISCOS_ShowWMCursor;
- this->WarpWMCursor = FULLSCREEN_WarpWMCursor;
-
- this->PumpEvents = FULLSCREEN_PumpEvents;
-}
-
-/* Query for the list of available video modes */
-void FULLSCREEN_BuildModeList(_THIS)
-{
- _kernel_swi_regs regs;
- char *enumInfo = NULL;
- char *enum_ptr;
- int *blockInfo;
- int j;
- int num_modes;
-
- /* Find out how much space we need */
- regs.r[0] = 2; /* Reason code */
- regs.r[2] = 0; /* Number of modes to skip */
- regs.r[6] = 0; /* pointer to block or 0 for count */
- regs.r[7] = 0; /* Size of block in bytes */
- _kernel_swi(OS_ScreenMode, &regs, &regs);
-
- num_modes = -regs.r[2];
-
- /* Video memory should be in r[5] */
- this->info.video_mem = regs.r[5]/1024;
-
- enumInfo = (unsigned char *)SDL_malloc(-regs.r[7]);
- if (enumInfo == NULL)
- {
- SDL_OutOfMemory();
- return;
- }
- /* Read mode information into block */
- regs.r[2] = 0;
- regs.r[6] = (int)enumInfo;
- regs.r[7] = -regs.r[7];
- _kernel_swi(OS_ScreenMode, &regs, &regs);
-
- enum_ptr = enumInfo;
-
- for (j =0; j < num_modes;j++)
- {
- blockInfo = (int *)enum_ptr;
- if ((blockInfo[1] & 255) == 1) /* We understand this format */
- {
- switch(blockInfo[4])
- {
- case 3: /* 8 bits per pixel */
- FULLSCREEN_AddMode(this, 8, blockInfo[2], blockInfo[3]);
- break;
- case 4: /* 15 bits per pixel */
- FULLSCREEN_AddMode(this, 15, blockInfo[2], blockInfo[3]);
- break;
- case 5: /* 32 bits per pixel */
- FULLSCREEN_AddMode(this, 32, blockInfo[2], blockInfo[3]);
- break;
- }
- }
-
- enum_ptr += blockInfo[0];
- }
-
- SDL_free(enumInfo);
-
- /* Sort the mode lists */
- for ( j=0; j<NUM_MODELISTS; ++j ) {
- if ( SDL_nummodes[j] > 0 ) {
- SDL_qsort(SDL_modelist[j], SDL_nummodes[j], sizeof *SDL_modelist[j], cmpmodes);
- }
- }
-}
-
-static int FULLSCREEN_FlipHWSurface(_THIS, SDL_Surface *surface)
-{
- _kernel_swi_regs regs;
- regs.r[0] = 19;
-
- FULLSCREEN_SetDisplayBank(this->hidden->current_bank);
- this->hidden->current_bank ^= 1;
- FULLSCREEN_SetWriteBank(this->hidden->current_bank);
- surface->pixels = this->hidden->bank[this->hidden->current_bank];
-
- /* Wait for Vsync */
- _kernel_swi(OS_Byte, &regs, &regs);
-
- return(0);
-}
-
-/* Nothing to do if we are writing direct to hardware */
-static void FULLSCREEN_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
-{
-}
-
-/* Safe but slower Memory copy from our allocated back buffer */
-static void FULLSCREEN_UpdateRectsMemCpy(_THIS, int numrects, SDL_Rect *rects)
-{
- int j;
- char *to, *from;
- int pitch = this->screen->pitch;
- int row;
- int xmult = this->screen->format->BytesPerPixel;
- for (j = 0; j < numrects; j++)
- {
- from = this->hidden->bank[0] + rects->x * xmult + rects->y * pitch;
- to = this->hidden->bank[1] + rects->x * xmult + rects->y * pitch;
- for (row = 0; row < rects->h; row++)
- {
- SDL_memcpy(to, from, rects->w * xmult);
- from += pitch;
- to += pitch;
- }
- rects++;
- }
-}
-
-/* Use optimized assembler memory copy. Deliberately copies extra columns if
- necessary to ensure the rectangle is word aligned. */
-static void FULLSCREEN_UpdateRects8bpp(_THIS, int numrects, SDL_Rect *rects)
-{
- int j;
- char *to, *from;
- int pitch = this->screen->pitch;
- int width_bytes;
- int src_skip_bytes;
-
- for (j = 0; j < numrects; j++)
- {
- from = this->hidden->bank[0] + rects->x + rects->y * pitch;
- to = this->hidden->bank[1] + rects->x + rects->y * pitch;
- width_bytes = rects->w;
- if ((int)from & 3)
- {
- int extra = ((int)from & 3);
- from -= extra;
- to -= extra;
- width_bytes += extra;
- }
- if (width_bytes & 3) width_bytes += 4 - (width_bytes & 3);
- src_skip_bytes = pitch - width_bytes;
-
- RISCOS_Put32(to, (width_bytes >> 2), pitch, (int)rects->h, from, src_skip_bytes);
- rects++;
- }
-}
-
-/* Use optimized assembler memory copy. Deliberately copies extra columns if
- necessary to ensure the rectangle is word aligned. */
-static void FULLSCREEN_UpdateRects16bpp(_THIS, int numrects, SDL_Rect *rects)
-{
- int j;
- char *to, *from;
- int pitch = this->screen->pitch;
- int width_bytes;
- int src_skip_bytes;
-
- for (j = 0; j < numrects; j++)
- {
- from = this->hidden->bank[0] + (rects->x << 1) + rects->y * pitch;
- to = this->hidden->bank[1] + (rects->x << 1) + rects->y * pitch;
- width_bytes = (((int)rects->w) << 1);
- if ((int)from & 3)
- {
- from -= 2;
- to -= 2;
- width_bytes += 2;
- }
- if (width_bytes & 3) width_bytes += 2;
- src_skip_bytes = pitch - width_bytes;
-
- RISCOS_Put32(to, (width_bytes >> 2), pitch, (int)rects->h, from, src_skip_bytes);
- rects++;
- }
-}
-
-/* Use optimized assembler memory copy. 32 bpp modes are always word aligned */
-static void FULLSCREEN_UpdateRects32bpp(_THIS, int numrects, SDL_Rect *rects)
-{
- int j;
- char *to, *from;
- int pitch = this->screen->pitch;
- int width;
-
- for (j = 0; j < numrects; j++)
- {
- from = this->hidden->bank[0] + (rects->x << 2) + rects->y * pitch;
- to = this->hidden->bank[1] + (rects->x << 2) + rects->y * pitch;
- width = (int)rects->w ;
-
- RISCOS_Put32(to, width, pitch, (int)rects->h, from, pitch - (width << 2));
- rects++;
- }
-}
-
-/* Use operating system sprite plots. Currently this is much slower than the
- other variants however accelerated sprite plotting can be seen on the horizon
- so this prepares for it. */
-static void FULLSCREEN_UpdateRectsOS(_THIS, int numrects, SDL_Rect *rects)
-{
- _kernel_swi_regs regs;
- _kernel_oserror *err;
- int j;
- int y;
-
- regs.r[0] = 28 + 512;
- regs.r[1] = (unsigned int)this->hidden->alloc_bank;
- regs.r[2] = (unsigned int)this->hidden->alloc_bank+16;
- regs.r[5] = 0;
-
- for (j = 0; j < numrects; j++)
- {
- y = this->screen->h - rects->y; /* top of clipping region */
- _kernel_oswrch(24); /* Set graphics clip region */
- _kernel_oswrch((rects->x << this->hidden->xeig) & 0xFF); /* left */
- _kernel_oswrch(((rects->x << this->hidden->xeig) >> 8) & 0xFF);
- _kernel_oswrch(((y - rects->h) << this->hidden->yeig) & 0xFF); /* bottom */
- _kernel_oswrch((((y - rects->h) << this->hidden->yeig)>> 8) & 0xFF);
- _kernel_oswrch(((rects->x + rects->w - 1) << this->hidden->xeig) & 0xFF); /* right */
- _kernel_oswrch((((rects->x + rects->w - 1)<< this->hidden->xeig) >> 8) & 0xFF);
- _kernel_oswrch(((y-1) << this->hidden->yeig) & 0xFF); /* top */
- _kernel_oswrch((((y-1) << this->hidden->yeig) >> 8) & 0xFF);
-
- regs.r[3] = 0;
- regs.r[4] = 0;
-
- if ((err = _kernel_swi(OS_SpriteOp, &regs, &regs)) != 0)
- {
- printf("OS_SpriteOp failed \n%s\n",err->errmess);
- }
-
- rects++;
-
- /* Reset to full screen clipping */
- _kernel_oswrch(24); /* Set graphics clip region */
- _kernel_oswrch(0); /* left */
- _kernel_oswrch(0);
- _kernel_oswrch(0); /* bottom */
- _kernel_oswrch(0);
- _kernel_oswrch(((this->screen->w-1) << this->hidden->xeig) & 0xFF); /* right */
- _kernel_oswrch((((this->screen->w-1) << this->hidden->xeig) >> 8) & 0xFF);
- _kernel_oswrch(((this->screen->h-1) << this->hidden->yeig) & 0xFF); /* top */
- _kernel_oswrch((((this->screen->h-1) << this->hidden->yeig) >> 8) & 0xFF);
- }
-}
-
-
-int FULLSCREEN_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- _kernel_swi_regs regs;
- int palette[256];
-
- regs.r[0] = -1;
- regs.r[1] = -1;
- regs.r[2] = (int)palette;
- regs.r[3] = 1024;
- regs.r[4] = 0;
- _kernel_swi(ColourTrans_ReadPalette, &regs, &regs);
-
- while(ncolors--)
- {
- palette[firstcolor] = ((colors->b) << 24) | ((colors->g) << 16) | ((colors->r) << 8);
- firstcolor++;
- colors++;
- }
-
- regs.r[0] = -1;
- regs.r[1] = -1;
- regs.r[2] = (int)palette;
- regs.r[3] = 0;
- regs.r[4] = 0;
- _kernel_swi(ColourTrans_WritePalette, &regs, &regs);
-
- return(1);
-}
-
-
-static int cmpmodes(const void *va, const void *vb)
-{
- SDL_Rect *a = *(SDL_Rect **)va;
- SDL_Rect *b = *(SDL_Rect **)vb;
- if(a->w == b->w)
- return b->h - a->h;
- else
- return b->w - a->w;
-}
-
-static int FULLSCREEN_AddMode(_THIS, int bpp, int w, int h)
-{
- SDL_Rect *mode;
- int i, index;
- int next_mode;
-
- /* Check to see if we already have this mode */
- if ( bpp < 8 ) { /* Not supported */
- return(0);
- }
- index = ((bpp+7)/8)-1;
- for ( i=0; i<SDL_nummodes[index]; ++i ) {
- mode = SDL_modelist[index][i];
- if ( (mode->w == w) && (mode->h == h) ) {
- return(0);
- }
- }
-
- /* Set up the new video mode rectangle */
- mode = (SDL_Rect *)SDL_malloc(sizeof *mode);
- if ( mode == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
- mode->x = 0;
- mode->y = 0;
- mode->w = w;
- mode->h = h;
-
- /* Allocate the new list of modes, and fill in the new mode */
- next_mode = SDL_nummodes[index];
- SDL_modelist[index] = (SDL_Rect **)
- SDL_realloc(SDL_modelist[index], (1+next_mode+1)*sizeof(SDL_Rect *));
- if ( SDL_modelist[index] == NULL ) {
- SDL_OutOfMemory();
- SDL_nummodes[index] = 0;
- SDL_free(mode);
- return(-1);
- }
- SDL_modelist[index][next_mode] = mode;
- SDL_modelist[index][next_mode+1] = NULL;
- SDL_nummodes[index]++;
-
- return(0);
-}
-
-void FULLSCREEN_SetWriteBank(int bank)
-{
- _kernel_swi_regs regs;
- regs.r[0] = 112;
- regs.r[1] = bank+1;
- _kernel_swi(OS_Byte, &regs, &regs);
-}
-
-void FULLSCREEN_SetDisplayBank(int bank)
-{
- _kernel_swi_regs regs;
- regs.r[0] = 113;
- regs.r[1] = bank+1;
- _kernel_swi(OS_Byte, &regs, &regs);
-}
-
-
-/** Disable special escape key processing */
-static void FULLSCREEN_DisableEscape()
-{
- _kernel_swi_regs regs;
- regs.r[0] = 229;
- regs.r[1] = 1;
- regs.r[2] = 0;
- _kernel_swi(OS_Byte, &regs, &regs);
-
-}
-
-/** Enable special escape key processing */
-static void FULLSCREEN_EnableEscape()
-{
- _kernel_swi_regs regs;
- regs.r[0] = 229;
- regs.r[1] = 0;
- regs.r[2] = 0;
- _kernel_swi(OS_Byte, &regs, &regs);
-
-}
-
-/** Store caption in case this is called before we create a window */
-void FULLSCREEN_SetWMCaption(_THIS, const char *title, const char *icon)
-{
- SDL_strlcpy(this->hidden->title, title, SDL_arraysize(this->hidden->title));
-}
-
-/* Set screen mode
-*
-* Returns 1 if mode is set ok, otherwise 0
-*/
-
-int FULLSCREEN_SetMode(int width, int height, int bpp)
-{
- SCREENMODEBLOCK smb;
- _kernel_swi_regs regs;
-
- smb.flags = 1;
- smb.x_pixels = width;
- smb.y_pixels = height;
- smb.mode_vars[0] = -1;
-
- switch(bpp)
- {
- case 8:
- smb.pixel_depth = 3;
- /* Note: Need to set ModeFlags to 128 and NColour variables to 255 get full 8 bit palette */
- smb.mode_vars[0] = 0; smb.mode_vars[1] = 128; /* Mode flags */
- smb.mode_vars[2] = 3; smb.mode_vars[3] = 255; /* NColour (number of colours -1) */
- smb.mode_vars[4] = -1; /* End of list */
- break;
-
- case 15:
- case 16:
- smb.pixel_depth = 4;
- break;
-
- case 32:
- smb.pixel_depth = 5;
- break;
-
- default:
- SDL_SetError("Pixel depth not supported");
- return 0;
- break;
- }
-
- smb.frame_rate = -1;
-
- regs.r[0] = 0;
- regs.r[1] = (int)&smb;
-
- if (_kernel_swi(OS_ScreenMode, &regs, &regs) != 0)
- {
- SDL_SetError("Couldn't set requested mode");
- return 0;
- }
-
- /* Turn cursor off*/
- _kernel_oswrch(23);_kernel_oswrch(1);_kernel_oswrch(0);
- _kernel_oswrch(0);_kernel_oswrch(0);_kernel_oswrch(0);
- _kernel_oswrch(0);_kernel_oswrch(0);_kernel_oswrch(0);
- _kernel_oswrch(0);_kernel_oswrch(0);
-
- return 1;
-}
-
-/* Get Start addresses for the screen banks */
-void FULLSCREEN_SetupBanks(_THIS)
-{
- _kernel_swi_regs regs;
- int block[5];
- block[0] = 148; /* Write screen start */
- block[1] = 149; /* Display screen start */
- block[2] = 4; /* X eig factor */
- block[3] = 5; /* Y eig factor */
- block[4] = -1; /* End of list of variables to request */
-
- regs.r[0] = (int)block;
- regs.r[1] = (int)block;
- _kernel_swi(OS_ReadVduVariables, &regs, &regs);
-
- this->hidden->bank[0] = (void *)block[0];
- this->hidden->bank[1] = (void *)block[1];
- this->hidden->xeig = block[2];
- this->hidden->yeig = block[3];
-}
-
-/* Toggle to full screen mode from the WIMP */
-
-int FULLSCREEN_ToggleFromWimp(_THIS)
-{
- int width = this->screen->w;
- int height = this->screen->h;
- int bpp = this->screen->format->BitsPerPixel;
-
- RISCOS_StoreWimpMode();
- if (FULLSCREEN_SetMode(width, height, bpp))
- {
- char *buffer = this->hidden->alloc_bank; /* This is start of sprite data */
- /* Support back buffer mode only */
- if (riscos_backbuffer == 0) riscos_backbuffer = 1;
-
- FULLSCREEN_SetupBanks(this);
-
- this->hidden->bank[0] = buffer + 60; /* Start of sprite data */
- if (bpp == 8) this->hidden->bank[0] += 2048; /* 8bpp sprite have palette first */
-
- this->hidden->current_bank = 0;
- this->screen->pixels = this->hidden->bank[0];
-
- /* Copy back buffer to screen memory */
- SDL_memcpy(this->hidden->bank[1], this->hidden->bank[0], width * height * this->screen->format->BytesPerPixel);
-
- FULLSCREEN_SetDeviceMode(this);
- return 1;
- } else
- RISCOS_RestoreWimpMode();
-
- return 0;
-}
diff --git a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosevents.c b/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosevents.c
deleted file mode 100644
index 83bcd44..0000000
--- a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosevents.c
+++ /dev/null
@@ -1,549 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- File added by Alan Buckley (alan_baa@hotmail.com) for RISC OS compatability
- 27 March 2003
-
- Implements keyboard setup, event pump and keyboard and mouse polling
-*/
-
-
-#include "SDL.h"
-#include "../../timer/SDL_timer_c.h"
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "../SDL_cursor_c.h"
-#include "SDL_riscosvideo.h"
-#include "SDL_riscosevents_c.h"
-
-#include "memory.h"
-#include "stdlib.h"
-#include "ctype.h"
-
-#include "kernel.h"
-#include "swis.h"
-
-/* The translation table from a RISC OS internal key numbers to a SDL keysym */
-static SDLKey RO_keymap[SDLK_LAST];
-
-/* RISC OS Key codes */
-#define ROKEY_SHIFT 0
-#define ROKEY_CTRL 1
-#define ROKEY_ALT 2
-/* Left shift is first key we will check for */
-#define ROKEY_LEFT_SHIFT 3
-
-/* Need to ignore mouse buttons as they are processed separately */
-#define ROKEY_LEFT_MOUSE 9
-#define ROKEY_CENTRE_MOUSE 10
-#define ROKEY_RIGHT_MOUSE 11
-
-/* No key has been pressed return value*/
-#define ROKEY_NONE 255
-
-/* Id of last key in keyboard */
-#define ROKEY_LAST_KEY 124
-
-/* Size of array for all keys */
-#define ROKEYBD_ARRAYSIZE 125
-
-static char RO_pressed[ROKEYBD_ARRAYSIZE];
-
-static SDL_keysym *TranslateKey(int intkey, SDL_keysym *keysym, int pressed);
-
-void RISCOS_PollMouse(_THIS);
-void RISCOS_PollKeyboard();
-
-void RISCOS_PollMouseHelper(_THIS, int fullscreen);
-
-#if SDL_THREADS_DISABLED
-extern void DRenderer_FillBuffers();
-
-/* Timer running function */
-extern void RISCOS_CheckTimer();
-
-#endif
-
-void FULLSCREEN_PumpEvents(_THIS)
-{
- /* Current implementation requires keyboard and mouse polling */
- RISCOS_PollKeyboard();
- RISCOS_PollMouse(this);
-#if SDL_THREADS_DISABLED
-// DRenderer_FillBuffers();
- if (SDL_timer_running) RISCOS_CheckTimer();
-#endif
-}
-
-
-void RISCOS_InitOSKeymap(_THIS)
-{
- int i;
-
- /* Map the VK keysyms */
- for ( i=0; i<SDL_arraysize(RO_keymap); ++i )
- RO_keymap[i] = SDLK_UNKNOWN;
-
- RO_keymap[3] = SDLK_LSHIFT;
- RO_keymap[4] = SDLK_LCTRL;
- RO_keymap[5] = SDLK_LALT;
- RO_keymap[6] = SDLK_RSHIFT;
- RO_keymap[7] = SDLK_RCTRL;
- RO_keymap[8] = SDLK_RALT;
- RO_keymap[16] = SDLK_q;
- RO_keymap[17] = SDLK_3;
- RO_keymap[18] = SDLK_4;
- RO_keymap[19] = SDLK_5;
- RO_keymap[20] = SDLK_F4;
- RO_keymap[21] = SDLK_8;
- RO_keymap[22] = SDLK_F7;
- RO_keymap[23] = SDLK_MINUS,
- RO_keymap[25] = SDLK_LEFT;
- RO_keymap[26] = SDLK_KP6;
- RO_keymap[27] = SDLK_KP7;
- RO_keymap[28] = SDLK_F11;
- RO_keymap[29] = SDLK_F12;
- RO_keymap[30] = SDLK_F10;
- RO_keymap[31] = SDLK_SCROLLOCK;
- RO_keymap[32] = SDLK_PRINT;
- RO_keymap[33] = SDLK_w;
- RO_keymap[34] = SDLK_e;
- RO_keymap[35] = SDLK_t;
- RO_keymap[36] = SDLK_7;
- RO_keymap[37] = SDLK_i;
- RO_keymap[38] = SDLK_9;
- RO_keymap[39] = SDLK_0;
- RO_keymap[41] = SDLK_DOWN;
- RO_keymap[42] = SDLK_KP8;
- RO_keymap[43] = SDLK_KP9;
- RO_keymap[44] = SDLK_BREAK;
- RO_keymap[45] = SDLK_BACKQUOTE;
-/* RO_keymap[46] = SDLK_currency; TODO: Figure out if this has a value */
- RO_keymap[47] = SDLK_BACKSPACE;
- RO_keymap[48] = SDLK_1;
- RO_keymap[49] = SDLK_2;
- RO_keymap[50] = SDLK_d;
- RO_keymap[51] = SDLK_r;
- RO_keymap[52] = SDLK_6;
- RO_keymap[53] = SDLK_u;
- RO_keymap[54] = SDLK_o;
- RO_keymap[55] = SDLK_p;
- RO_keymap[56] = SDLK_LEFTBRACKET;
- RO_keymap[57] = SDLK_UP;
- RO_keymap[58] = SDLK_KP_PLUS;
- RO_keymap[59] = SDLK_KP_MINUS;
- RO_keymap[60] = SDLK_KP_ENTER;
- RO_keymap[61] = SDLK_INSERT;
- RO_keymap[62] = SDLK_HOME;
- RO_keymap[63] = SDLK_PAGEUP;
- RO_keymap[64] = SDLK_CAPSLOCK;
- RO_keymap[65] = SDLK_a;
- RO_keymap[66] = SDLK_x;
- RO_keymap[67] = SDLK_f;
- RO_keymap[68] = SDLK_y;
- RO_keymap[69] = SDLK_j;
- RO_keymap[70] = SDLK_k;
- RO_keymap[72] = SDLK_SEMICOLON;
- RO_keymap[73] = SDLK_RETURN;
- RO_keymap[74] = SDLK_KP_DIVIDE;
- RO_keymap[76] = SDLK_KP_PERIOD;
- RO_keymap[77] = SDLK_NUMLOCK;
- RO_keymap[78] = SDLK_PAGEDOWN;
- RO_keymap[79] = SDLK_QUOTE;
- RO_keymap[81] = SDLK_s;
- RO_keymap[82] = SDLK_c;
- RO_keymap[83] = SDLK_g;
- RO_keymap[84] = SDLK_h;
- RO_keymap[85] = SDLK_n;
- RO_keymap[86] = SDLK_l;
- RO_keymap[87] = SDLK_SEMICOLON;
- RO_keymap[88] = SDLK_RIGHTBRACKET;
- RO_keymap[89] = SDLK_DELETE;
- RO_keymap[90] = SDLK_KP_MINUS;
- RO_keymap[91] = SDLK_KP_MULTIPLY;
- RO_keymap[93] = SDLK_EQUALS;
- RO_keymap[94] = SDLK_BACKSLASH;
- RO_keymap[96] = SDLK_TAB;
- RO_keymap[97] = SDLK_z;
- RO_keymap[98] = SDLK_SPACE;
- RO_keymap[99] = SDLK_v;
- RO_keymap[100] = SDLK_b;
- RO_keymap[101] = SDLK_m;
- RO_keymap[102] = SDLK_COMMA;
- RO_keymap[103] = SDLK_PERIOD;
- RO_keymap[104] = SDLK_SLASH;
- RO_keymap[105] = SDLK_END;
- RO_keymap[106] = SDLK_KP0;
- RO_keymap[107] = SDLK_KP1;
- RO_keymap[108] = SDLK_KP3;
- RO_keymap[112] = SDLK_ESCAPE;
- RO_keymap[113] = SDLK_F1;
- RO_keymap[114] = SDLK_F2;
- RO_keymap[115] = SDLK_F3;
- RO_keymap[116] = SDLK_F5;
- RO_keymap[117] = SDLK_F6;
- RO_keymap[118] = SDLK_F8;
- RO_keymap[119] = SDLK_F9;
- RO_keymap[120] = SDLK_HASH;
- RO_keymap[121] = SDLK_RIGHT;
- RO_keymap[122] = SDLK_KP4;
- RO_keymap[123] = SDLK_KP5;
- RO_keymap[124] = SDLK_KP2;
-
- SDL_memset(RO_pressed, 0, ROKEYBD_ARRAYSIZE);
-}
-
-
-/* Variable for mouse relative processing */
-int mouse_relative = 0;
-
-/* Check to see if we need to enter or leave mouse relative mode */
-
-void RISCOS_CheckMouseMode(_THIS)
-{
- /* If the mouse is hidden and input is grabbed, we use relative mode */
- if ( !(SDL_cursorstate & CURSOR_VISIBLE) &&
- (this->input_grab != SDL_GRAB_OFF) ) {
- mouse_relative = 1;
- } else {
- mouse_relative = 0;
- }
-}
-
-
-void RISCOS_PollMouse(_THIS)
-{
- RISCOS_PollMouseHelper(this, 1);
-}
-
-extern int mouseInWindow;
-
-void WIMP_PollMouse(_THIS)
-{
- /* Only poll when mouse is over the window */
- if (!mouseInWindow) return;
-
- RISCOS_PollMouseHelper(this, 0);
-}
-
-/* Static variables so only changes are reported */
-static Sint16 last_x = -1, last_y = -1;
-static int last_buttons = 0;
-
-/* Share routine between WIMP and FULLSCREEN for polling mouse and
- passing on events */
-void RISCOS_PollMouseHelper(_THIS, int fullscreen)
-{
- _kernel_swi_regs regs;
- static int starting = 1;
-
- if (_kernel_swi(OS_Mouse, &regs, &regs) == NULL)
- {
- Sint16 new_x = regs.r[0]; /* Initialy get as OS units */
- Sint16 new_y = regs.r[1];
-
- /* Discard mouse events until they let go of the mouse after starting */
- if (starting && regs.r[2] != 0)
- return;
- else
- starting = 0;
-
- if (new_x != last_x || new_y != last_y || last_buttons != regs.r[2])
- {
- /* Something changed so generate appropriate events */
- int topLeftX, topLeftY; /* Top left OS units */
- int x, y; /* Mouse position in SDL pixels */
-
- if (fullscreen)
- {
- topLeftX = 0;
- topLeftY = (this->hidden->height << this->hidden->yeig) - 1;
- } else
- {
- int window_state[9];
-
- /* Get current window state */
- window_state[0] = this->hidden->window_handle;
- regs.r[1] = (unsigned int)window_state;
- _kernel_swi(Wimp_GetWindowState, &regs, &regs);
-
- topLeftX = window_state[1];
- topLeftY = window_state[4];
- }
-
- /* Convert co-ordinates to workspace */
- x = new_x - topLeftX;
- y = topLeftY - new_y; /* Y goes from top of window/screen */
-
- /* Convert OS units to pixels */
- x >>= this->hidden->xeig;
- y >>= this->hidden->yeig;
-
- if (last_x != new_x || last_y != new_y)
- {
- if (mouse_relative)
- {
- int centre_x = SDL_VideoSurface->w/2;
- int centre_y = SDL_VideoSurface->h/2;
-
- if (centre_x != x || centre_y != y)
- {
- if (SDL_VideoSurface) SDL_PrivateMouseMotion(0,1,x - centre_x, y - centre_y);
- last_x = topLeftX + (centre_x << this->hidden->xeig);
- last_y = topLeftY - (centre_y << this->hidden->yeig);
-
- /* Re-centre the mouse pointer, so we still get relative
- movement when the mouse is at the edge of the window
- or screen.
- */
- {
- unsigned char block[5];
-
- block[0] = 3; /* OSWORD move pointer sub-reason code */
- block[1] = last_x & 0xFF;
- block[2] = (last_x >> 8) & 0xFF;
- block[3] = last_y & 0xFF;
- block[4] = (last_y >> 8) & 0xFF;
-
- regs.r[0] = 21; /* OSWORD pointer stuff code */
- regs.r[1] = (int)block;
- _kernel_swi(OS_Word, &regs, &regs);
- }
- }
- } else
- {
- last_x = new_x;
- last_y = new_y;
- SDL_PrivateMouseMotion(0,0,x,y);
- }
- }
-
- if (last_buttons != regs.r[2])
- {
- int changed = last_buttons ^ regs.r[2];
- last_buttons = regs.r[2];
- if (changed & 4) SDL_PrivateMouseButton((last_buttons & 4) ? SDL_PRESSED : SDL_RELEASED, SDL_BUTTON_LEFT, 0, 0);
- if (changed & 2) SDL_PrivateMouseButton((last_buttons & 2) ? SDL_PRESSED : SDL_RELEASED, SDL_BUTTON_MIDDLE, 0, 0);
- if (changed & 1) SDL_PrivateMouseButton((last_buttons & 1) ? SDL_PRESSED : SDL_RELEASED, SDL_BUTTON_RIGHT, 0, 0);
- }
- }
- }
-}
-
-void RISCOS_PollKeyboard()
-{
- int which_key = ROKEY_LEFT_SHIFT;
- int j;
- int min_key, max_key;
- SDL_keysym key;
-
- /* Scan the keyboard to see what is pressed */
- while (which_key <= ROKEY_LAST_KEY)
- {
- which_key = (_kernel_osbyte(121, which_key, 0) & 0xFF);
- if (which_key != ROKEY_NONE)
- {
- switch(which_key)
- {
- /* Skip over mouse keys */
- case ROKEY_LEFT_MOUSE:
- case ROKEY_CENTRE_MOUSE:
- case ROKEY_RIGHT_MOUSE:
- which_key = ROKEY_RIGHT_MOUSE;
- break;
-
- /* Ignore keys that cause 2 internal number to be generated */
- case 71: case 24: case 87: case 40:
- break;
-
- /* Ignore break as it can be latched on */
- case 44:
- break;
-
- default:
- RO_pressed[which_key] += 2;
- break;
- }
- which_key++;
- }
- }
-
- /* Generate key released messages */
- min_key = ROKEY_LAST_KEY+1;
- max_key = ROKEY_LEFT_SHIFT;
-
- for (j = ROKEY_LEFT_SHIFT; j <= ROKEY_LAST_KEY; j++)
- {
- if (RO_pressed[j])
- {
- if (RO_pressed[j] == 1)
- {
- RO_pressed[j] = 0;
- SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(j,&key,0));
- } else
- {
- if (j < min_key) min_key = j;
- if (j > max_key) max_key = j;
- }
- }
- }
-
- /* Generate key pressed messages */
- for (j = min_key; j <= max_key; j++)
- {
- if (RO_pressed[j])
- {
- if (RO_pressed[j] == 2)
- {
- SDL_PrivateKeyboard(SDL_PRESSED,TranslateKey(j,&key,1));
- }
- RO_pressed[j] = 1;
- }
- }
-}
-
-static SDL_keysym *TranslateKey(int intkey, SDL_keysym *keysym, int pressed)
-{
- /* Set the keysym information */
- keysym->scancode = (unsigned char) intkey;
- keysym->sym = RO_keymap[intkey];
- keysym->mod = KMOD_NONE;
- keysym->unicode = 0;
- if ( pressed && SDL_TranslateUNICODE )
- {
- int state;
- int ch;
-
- state = (_kernel_osbyte(202, 0, 255) & 0xFF);
-
- /*TODO: Take into account other keyboard layouts */
-
- ch = keysym->sym; /* This should handle most unshifted keys */
-
- if (intkey < 9 || ch == SDLK_UNKNOWN)
- {
- ch = 0;
-
- } else if (state & 64) /* Control on */
- {
- ch = ch & 31;
-
- } else
- {
- int topOfKey = 0;
- if (state & 8) /* Shift on */
- {
- topOfKey = 1;
- }
-
- if ((state & 16) == 0) /* Caps lock is on */
- {
- if (ch >= SDLK_a && ch <= SDLK_z)
- {
- if ((state & 128) == 0) /* Shift Enable off */
- {
- /* All letter become upper case */
- topOfKey = 1;
- } else
- {
- /* Shift+Letters gives lower case */
- topOfKey = 1 - topOfKey;
- }
- }
- }
-
- if (topOfKey)
- {
- /* Key produced with shift held down */
-
- /* Letters just give upper case version */
- if (ch >= SDLK_a && ch <= SDLK_z) ch = toupper(ch);
- else
- {
- switch(ch)
- {
- case SDLK_HASH: ch = '~'; break;
- case SDLK_QUOTE: ch = '@'; break;
- case SDLK_COMMA: ch = '<'; break;
- case SDLK_MINUS: ch = '_'; break;
- case SDLK_PERIOD: ch = '>'; break;
- case SDLK_SLASH: ch = '?'; break;
-
- case SDLK_0: ch = ')'; break;
- case SDLK_1: ch = '!'; break;
- case SDLK_2: ch = '"'; break;
- case SDLK_3: ch = '£'; break;
- case SDLK_4: ch = '$'; break;
- case SDLK_5: ch = '%'; break;
- case SDLK_6: ch = '^'; break;
- case SDLK_7: ch = '&'; break;
- case SDLK_8: ch = '*'; break;
- case SDLK_9: ch = '('; break;
-
- case SDLK_SEMICOLON: ch = ':'; break;
- case SDLK_EQUALS: ch = '+'; break;
- case SDLK_LEFTBRACKET: ch = '{'; break;
- case SDLK_BACKSLASH: ch = '|'; break;
- case SDLK_RIGHTBRACKET: ch = '}'; break;
- case SDLK_BACKQUOTE: ch = '¬'; break;
-
- default:
- ch = 0; /* Map to zero character if we don't understand it */
- break;
- }
- }
-
- } else if (ch > 126)
- {
- /* SDL key code < 126 map directly onto their Unicode equivalents */
- /* Keypad 0 to 9 maps to numeric equivalent */
- if (ch >= SDLK_KP0 && ch <= SDLK_KP9) ch = ch - SDLK_KP0 + '0';
- else
- {
- /* Following switch maps other keys that produce an Ascii value */
- switch(ch)
- {
- case SDLK_KP_PERIOD: ch = '.'; break;
- case SDLK_KP_DIVIDE: ch = '/'; break;
- case SDLK_KP_MULTIPLY: ch = '*'; break;
- case SDLK_KP_MINUS: ch = '-'; break;
- case SDLK_KP_PLUS: ch = '+'; break;
- case SDLK_KP_EQUALS: ch = '='; break;
-
- default:
- /* If we don't know what it is set the Unicode to 0 */
- ch = 0;
- break;
- }
- }
- }
- }
-
- keysym->unicode = ch;
- }
- return(keysym);
-}
-
-/* end of SDL_riscosevents.c ... */
-
diff --git a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosevents_c.h b/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosevents_c.h
deleted file mode 100644
index 87cbf5b..0000000
--- a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosevents_c.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_riscosvideo.h"
-
-/* Variables and functions exported by SDL_sysevents.c to other parts
- of the native video subsystem (SDL_sysvideo.c)
-*/
-extern void RISCOS_InitOSKeymap(_THIS);
-extern void FULLSCREEN_PumpEvents(_THIS);
-extern void WIMP_PumpEvents(_THIS);
-
-/* end of SDL_nullevents_c.h ... */
-
diff --git a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosmouse.c b/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosmouse.c
deleted file mode 100644
index 9f364a3..0000000
--- a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosmouse.c
+++ /dev/null
@@ -1,371 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- File added by Alan Buckley (alan_baa@hotmail.com) for RISC OS compatability
- 27 March 2003
-
- Implements mouse cursor shape definitions and positioning
-*/
-
-#include "SDL_mouse.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_riscosmouse_c.h"
-
-#include "kernel.h"
-#include "swis.h"
-
-static WMcursor *current_cursor = NULL;
-static WMcursor *defined_cursor = NULL;
-
-extern int mouseInWindow;
-
-/* Area to save cursor palette colours changed by SDL.
- Actual values will be read before we change to the SDL cursor */
-static Uint8 wimp_cursor_palette[2][5] = {
- {1, 25, 255, 255, 255},
- {3, 25, 255, 255, 255}
-};
-
-static int cursor_palette_saved = 0;
-
-void WIMP_SaveCursorPalette();
-void WIMP_RestoreWimpCursor();
-void WIMP_SetSDLCursorPalette();
-
-
-void RISCOS_FreeWMCursor(_THIS, WMcursor *cursor)
-{
- SDL_free(cursor->data);
- SDL_free(cursor);
-}
-
-WMcursor *RISCOS_CreateWMCursor(_THIS,
- Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
-{
- WMcursor *cursor;
- Uint8 *cursor_data;
- Uint8 *ptr;
- int i,j,k;
- int data_byte, mask_byte;
-
- /* Check to make sure the cursor size is okay */
- if ( (w > 32) || (h > 32) ) {
- SDL_SetError("Only with width and height <= 32 pixels are allowed");
- return(NULL);
- }
-
- /* Allocate the cursor */
- cursor = (WMcursor *)SDL_malloc(sizeof(*cursor));
- if ( cursor == NULL ) {
- SDL_SetError("Out of memory");
- return(NULL);
- }
-
- /* Note: SDL says width must be a multiple of 8 */
- cursor_data = SDL_malloc(w/4 * h);
- if (cursor_data == NULL)
- {
- SDL_free(cursor);
- SDL_SetError("Out of memory");
- return(NULL);
- }
-
- cursor->w = w;
- cursor->h = h;
- cursor->hot_x = hot_x;
- cursor->hot_y = hot_y;
- cursor->data = cursor_data;
-
-
-/* Data / Mask Resulting pixel on screen
- 0 / 1 White
- 1 / 1 Black
- 0 / 0 Transparent
- 1 / 0 Inverted color if possible, black if not.
-*/
- ptr = cursor_data;
-
- for ( i=0; i<h; ++i )
- {
- for (j = 0; j < w/8; ++j)
- {
- data_byte = *data;
- mask_byte = *mask;
- *ptr++ = 0; /* Sets whole byte transparent */
- *ptr = 0;
- for (k = 0; k < 8; k++)
- {
- (*ptr) <<= 2;
- if (data_byte & 1) *ptr |= 3; /* Black or inverted */
- else if(mask_byte & 1) *ptr |= 1; /* White */
- if ((k&3) == 3) ptr--;
- data_byte >>= 1;
- mask_byte >>= 1;
- }
-
- ptr+=3;
- data++;
- mask++;
- }
- }
-
- return(cursor);
-}
-
-int RISCOS_ShowWMCursor(_THIS, WMcursor *cursor)
-{
- current_cursor = cursor;
-
- if (cursor == NULL)
- {
- _kernel_osbyte(106,0,0);
- defined_cursor = NULL;
- } else
- {
- WMcursor *old_cursor = defined_cursor;
-
- if (cursor != defined_cursor)
- {
- Uint8 cursor_def[10];
-
- cursor_def[0] = 0;
- cursor_def[1] = 2; /* Use shape number 2 */
- cursor_def[2] = cursor->w/4; /* Width in bytes */
- cursor_def[3] = cursor->h; /* Height (h) in pixels */
- cursor_def[4] = cursor->hot_x; /* ActiveX in pixels from left */
- cursor_def[5] = cursor->hot_y; /* ActiveY in pixels from top */
- cursor_def[6] = ((int)(cursor->data) & 0xFF); /* Least significant byte of pointer to data */
- cursor_def[7] = ((int)(cursor->data) >> 8) & 0xFF; /* ... */
- cursor_def[8] = ((int)(cursor->data) >> 16) & 0xFF; /* ... */
- cursor_def[9] = ((int)(cursor->data) >> 24) & 0xFF; /* Most significant byte of pointer to data */
-
- if (_kernel_osword(21, (int *)cursor_def) != 0)
- {
- SDL_SetError("RISCOS couldn't create the cursor to show");
- return(0);
- }
- defined_cursor = cursor;
- }
-
- if (old_cursor == NULL)
- {
- /* First time or reshow in window, so save/setup palette */
- if (!cursor_palette_saved)
- {
- WIMP_SaveCursorPalette();
- }
- WIMP_SetSDLCursorPalette();
- }
-
- _kernel_osbyte(106, 2, 0);
- }
-
- return(1);
-}
-
-void FULLSCREEN_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
-{
- Uint8 move_block[5];
- int eig_block[3];
- _kernel_swi_regs regs;
- int os_x, os_y;
-
- eig_block[0] = 4; /* X eig factor */
- eig_block[1] = 5; /* Y eig factor */
- eig_block[2] = -1; /* End of list of variables to request */
-
- regs.r[0] = (int)eig_block;
- regs.r[1] = (int)eig_block;
- _kernel_swi(OS_ReadVduVariables, &regs, &regs);
-
- os_x = x << eig_block[0];
- os_y = y << eig_block[1];
-
- move_block[0] = 3; /* Move cursor */
- move_block[1] = os_x & 0xFF;
- move_block[2] = (os_x >> 8) & 0xFF;
- move_block[3] = os_y & 0xFF;
- move_block[4] = (os_y >> 8) & 0xFF;
-
- _kernel_osword(21, (int *)move_block);
- SDL_PrivateMouseMotion(0, 0, x, y);
-}
-
-
-/* Reshow cursor when mouse re-enters the window */
-void WIMP_ReshowCursor(_THIS)
-{
- defined_cursor = NULL;
- cursor_palette_saved = 0;
- RISCOS_ShowWMCursor(this, current_cursor);
-}
-
-void WIMP_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
-{
- _kernel_swi_regs regs;
- int window_state[9];
- char block[5];
- int osX, osY;
-
- window_state[0] = this->hidden->window_handle;
- regs.r[1] = (unsigned int)window_state;
- _kernel_swi(Wimp_GetWindowState, &regs, &regs);
-
- osX = (x << this->hidden->xeig) + window_state[1];
- osY = window_state[4] - (y << this->hidden->yeig);
-
- block[0] = 3;
- block[1] = osX & 0xFF;
- block[2] = (osX >> 8) & 0xFF;
- block[3] = osY & 0xFF;
- block[4] = (osY >> 8) & 0xFF;
-
- regs.r[0] = 21;
- regs.r[1] = (int)block;
- _kernel_swi(OS_Word, &regs, &regs);
- SDL_PrivateMouseMotion(0, 0, x, y);
-}
-
-int WIMP_ShowWMCursor(_THIS, WMcursor *cursor)
-{
- if (mouseInWindow) return RISCOS_ShowWMCursor(this, cursor);
- else current_cursor = cursor;
-
- return 1;
-}
-
-SDL_GrabMode RISCOS_GrabInput(_THIS, SDL_GrabMode mode)
-{
- /* In fullscreen mode we don't need to do anything */
- if (mode < SDL_GRAB_FULLSCREEN)
- {
- _kernel_swi_regs regs;
- unsigned char block[9];
- block[0] = 1; /* Define mouse cursor bounding block */
-
- if ( mode == SDL_GRAB_OFF )
- {
- /* Clip to whole screen */
-
- int r = (this->hidden->screen_width << this->hidden->xeig) - 1;
- int t = (this->hidden->screen_height << this->hidden->yeig) - 1;
-
- block[1] = 0; block[2] = 0; /* Left*/
- block[3] = 0; block[4] = 0; /* Bottom */
- block[5] = r & 0xFF; block[6] = (r >> 8) & 0xFF; /* Right */
- block[7] = t & 0xFF; block[8] = (t >> 8) & 0xFF; /* Top */
- } else
- {
- /* Clip to window */
- unsigned char window_state[36];
-
- *((int *)window_state) = this->hidden->window_handle;
- regs.r[1] = (unsigned int)window_state;
- _kernel_swi(Wimp_GetWindowState, &regs, &regs);
-
- block[1] = window_state[4];
- block[2] = window_state[5];
- block[3] = window_state[8];
- block[4] = window_state[9];
- block[5] = window_state[12];
- block[6] = window_state[13];
- block[7] = window_state[16];
- block[8] = window_state[17];
-
- }
-
- regs.r[0] = 21; /* OS word code */
- regs.r[1] = (int)block;
- _kernel_swi(OS_Word, &regs, &regs);
- }
-
- return mode;
-}
-
-/* Save mouse cursor palette to be restore when we are no longer
- defining a cursor */
-
-void WIMP_SaveCursorPalette()
-{
- _kernel_swi_regs regs;
- int colour;
-
- for (colour = 0; colour < 2; colour++)
- {
- regs.r[0] = (int)wimp_cursor_palette[colour][0];
- regs.r[1] = 25;
- /* Read settings with OS_ReadPalette */
- if (_kernel_swi(0x2f, &regs, &regs) == NULL)
- {
- wimp_cursor_palette[colour][2] = (unsigned char)((regs.r[2] >> 8) & 0xFF);
- wimp_cursor_palette[colour][3] = (unsigned char)((regs.r[2] >> 16) & 0xFF);
- wimp_cursor_palette[colour][4] = (unsigned char)((regs.r[2] >> 24) & 0xFF);
- }
- }
-
- cursor_palette_saved = 1;
-}
-
-/* Restore the WIMP's cursor when we leave the SDL window */
-void WIMP_RestoreWimpCursor()
-{
- int colour;
-
- /* Reset to pointer shape 1 */
- _kernel_osbyte(106, 1, 0);
-
- /* Reset pointer colours */
- if (cursor_palette_saved)
- {
- for (colour = 0; colour < 2; colour++)
- {
- _kernel_osword(12, (int *)wimp_cursor_palette[colour]);
- }
- }
- cursor_palette_saved = 0;
-}
-
-/* Set palette used for SDL mouse cursors */
-void WIMP_SetSDLCursorPalette()
-{
- /* First time set up the mouse colours */
- Uint8 block[5];
-
- /* Set up colour 1 as white */
- block[0] = 1; /* Colour to change 1 - 3 */
- block[1] = 25; /* Set pointer colour */
- block[2] = 255; /* red component*/
- block[3] = 255; /* green component */
- block[4] = 255; /* blue component*/
- _kernel_osword(12, (int *)block);
-
- /* Set colour 3 to back */
- block[0] = 3; /* Colour to change 1 - 3 */
- block[1] = 25; /* Set pointer colour*/
- block[2] = 0; /* red component*/
- block[3] = 0; /* green component */
- block[4] = 0; /* blue component*/
- _kernel_osword(12, (int *)block);
-}
diff --git a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosmouse_c.h b/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosmouse_c.h
deleted file mode 100644
index eff31a1..0000000
--- a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosmouse_c.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_riscosvideo.h"
-
-/* The implementation dependent data for the window manager cursor */
-struct WMcursor {
- int w;
- int h;
- int hot_x;
- int hot_y;
- Uint8 *data;
-};
-
-/* Functions to be exported */
-void RISCOS_FreeWMCursor(_THIS, WMcursor *cursor);
-WMcursor *RISCOS_CreateWMCursor(_THIS, Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
-
-int RISCOS_ShowWMCursor(_THIS, WMcursor *cursor);
-void FULLSCREEN_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
-
-int WIMP_ShowWMCursor(_THIS, WMcursor *cursor);
-void WIMP_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
-
diff --git a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscossprite.c b/distrib/sdl-1.2.12/src/video/riscos/SDL_riscossprite.c
deleted file mode 100644
index 0f267ff..0000000
--- a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscossprite.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- File added by Alan Buckley (alan_baa@hotmail.com) for RISC OS compatability
- 27 March 2003
-
- Implements Sprite plotting code for wimp display.window
-*/
-
-#include "kernel.h"
-#include "swis.h"
-
-#include "SDL_stdinc.h"
-#include "SDL_riscosvideo.h"
-
-extern void WIMP_ReadModeInfo(_THIS);
-
-void WIMP_PaletteChanged(_THIS);
-
-
-/* Create sprite buffer for screen */
-
-unsigned char *WIMP_CreateBuffer(int width, int height, int bpp)
-{
- int size;
- char sprite_name[12] = "display";
- unsigned char *buffer;
- _kernel_swi_regs regs;
- int bytesPerPixel;
- int bytesPerRow;
- int offsetToSpriteData = 60;
-
- switch(bpp)
- {
- case 32: bytesPerPixel = 4; break;
- case 16: bytesPerPixel = 2; break;
- case 8:
- bytesPerPixel = 1;
- offsetToSpriteData += 2048; /* Add in size of palette */
- break;
- default:
- return NULL;
- break;
- }
-
- bytesPerRow = bytesPerPixel * width;
-
- if ((bytesPerRow & 3) != 0)
- {
- bytesPerRow += 4 - (bytesPerRow & 3);
- }
- size = bytesPerRow * height;
-
- buffer = SDL_malloc( (size_t) size + offsetToSpriteData );
- if (!buffer) return NULL;
-
- /* Initialise a sprite area */
-
- *(unsigned int *)buffer = size + offsetToSpriteData;
- *(unsigned int *)(buffer + 8) = 16;
-
- regs.r[0] = 256+9;
- regs.r[1] = (unsigned int)buffer;
- _kernel_swi(OS_SpriteOp, &regs, &regs);
-
- regs.r[0] = 256+15;
- regs.r[1] = (unsigned int)buffer;
- regs.r[2] = (unsigned int)&sprite_name;
- regs.r[3] = 0; /* Palette flag: 0 = no palette */
- regs.r[4] = width;
- regs.r[5] = height;
- if (bpp == 8)
- {
- /* Use old style mode number */
- regs.r[6] = 28; /* 8bpp 90x90dpi */
- } else
- {
- regs.r[6] = (((bpp == 16) ? 5 : 6) << 27) /* Type 6 = 32bpp sprite, 5 = 16bpp sprite */
- | (90 << 14) /* Vertical dpi */
- | (90 << 1) /* Horizontal dpi */
- | 1; /* Marker to distinguish between mode selectors and sprite modes */
- }
- if (_kernel_swi(OS_SpriteOp, &regs, &regs) == NULL)
- {
- if (bpp == 8)
- {
- /* Modify sprite to take into account 256 colour palette */
- int *sprite = (int *)(buffer + 16);
- /* Adjust sprite offsets */
- sprite[0] += 2048;
- sprite[8] += 2048;
- sprite[9] += 2048;
- /* Adjust sprite area next free pointer */
- (*(int *)(buffer+12)) += 2048;
-
- /* Don't need to set up palette as SDL sets up the default
- 256 colour palette */
-/* {
- int *pal = sprite + 11;
- unsigned int j;
- unsigned int entry;
- for (j = 0; j < 255; j++)
- {
- entry = (j << 24) | (j << 16) | (j << 8);
- *pal++ = entry;
- *pal++ = entry;
- }
- }
-*/
- }
- } else
- {
- SDL_free(buffer);
- buffer = NULL;
- }
-
- return buffer;
-}
-
-
-/* Setup translation buffers for the sprite plotting */
-
-void WIMP_SetupPlotInfo(_THIS)
-{
- _kernel_swi_regs regs;
- int *sprite = ((int *)this->hidden->bank[1])+4;
-
- regs.r[0] = (unsigned int)this->hidden->bank[1];
- regs.r[1] = (unsigned int)sprite;
- regs.r[2] = -1; /* Current mode */
- regs.r[3] = -1; /* Current palette */
- regs.r[4] = 0; /* Get size of buffer */
- regs.r[5] = 1|2|16; /* R1 - pointer to sprite and can use full palette words */
- regs.r[6] = 0;
- regs.r[7] = 0;
-
- if (this->hidden->pixtrans) SDL_free(this->hidden->pixtrans);
- this->hidden->pixtrans = 0;
-
- /* Get the size required for the buffer */
- _kernel_swi(ColourTrans_GenerateTable, &regs, &regs);
- if (regs.r[4])
- {
- this->hidden->pixtrans = SDL_malloc(regs.r[4]);
-
- regs.r[4] = (unsigned int)this->hidden->pixtrans;
- /* Actually read the buffer */
- _kernel_swi(ColourTrans_GenerateTable, &regs, &regs);
- }
-}
-
-/* Plot the sprite in the given context */
-void WIMP_PlotSprite(_THIS, int x, int y)
-{
- _kernel_swi_regs regs;
- _kernel_oserror *err;
-
- regs.r[0] = 52 + 512;
- regs.r[1] = (unsigned int)this->hidden->bank[1];
- regs.r[2] = (unsigned int)this->hidden->bank[1]+16;
- regs.r[3] = x;
- regs.r[4] = y;
- regs.r[5] = 0|32; /* Overwrite screen and pixtrans contains wide colour entries */
- regs.r[6] = 0; /* No scale factors i.e. 1:1 */
- regs.r[7] = (int)this->hidden->pixtrans;
-
- if ((err = _kernel_swi(OS_SpriteOp, &regs, &regs)) != 0)
- {
- int *p = (int *)this->hidden->pixtrans;
- printf("OS_SpriteOp failed \n%s\n",err->errmess);
- printf("pixtrans %d\n", (int)this->hidden->pixtrans);
- printf("%x %x %x\n", p[0], p[1], p[2]);
- }
-}
-
-
-/* Wimp mode has changes so update colour mapping and pixel sizes
- of windows and the sprites they plot */
-
-void WIMP_ModeChanged(_THIS)
-{
- int oldXeig = this->hidden->xeig;
- int oldYeig = this->hidden->yeig;
-
- WIMP_ReadModeInfo(this);
-
- if (oldXeig == this->hidden->xeig && oldYeig == this->hidden->yeig)
- {
- /* Only need to update the palette */
- WIMP_PaletteChanged(this);
- } else
- {
- _kernel_swi_regs regs;
- int window_state[9];
- int extent[4];
- int currWidth, currHeight;
- int newWidth, newHeight;
-
- /* Need to resize windows and update the palette */
- WIMP_SetupPlotInfo(this);
-
-
- window_state[0] = this->hidden->window_handle;
- regs.r[1] = (unsigned int)window_state;
- _kernel_swi(Wimp_GetWindowState, &regs, &regs);
-
- currWidth = window_state[3] - window_state[1];
- currHeight = window_state[4] - window_state[2];
-
- newWidth = (currWidth >> oldXeig) << this->hidden->xeig;
- newHeight = (currHeight >> oldYeig) << this->hidden->yeig;
- /* Need to avoid extent getting too small for visible part
- of window */
- extent[0] = 0;
- if (currHeight <= newHeight)
- {
- extent[1] = -newHeight;
- } else
- {
- extent[1] = -currHeight;
- }
- if (currWidth <= newWidth)
- {
- extent[2] = newWidth;
- } else
- {
- extent[2] = currWidth;
- }
- extent[3] = 0;
-
- regs.r[0] = this->hidden->window_handle;
- regs.r[1] = (int)extent;
- _kernel_swi(Wimp_SetExtent, &regs, &regs);
-
- /*TODO: May need to set flag to resize window on next open */
- }
-}
-
-/* Palette has changed so update palettes used for windows sprites */
-
-void WIMP_PaletteChanged(_THIS)
-{
- WIMP_SetupPlotInfo(this);
-}
diff --git a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscostask.c b/distrib/sdl-1.2.12/src/video/riscos/SDL_riscostask.c
deleted file mode 100644
index 8d143e7..0000000
--- a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscostask.c
+++ /dev/null
@@ -1,350 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- This file added by Alan Buckley (alan_baa@hotmail.com) to support RISC OS
- 26 March 2003
-
- File includes routines for:
- Setting up as a WIMP Task
- Reading information about the current desktop
- Storing information before a switch to full screen
- Restoring desktop after switching to full screen
-*/
-
-#include "kernel.h"
-#include "swis.h"
-
-#include "SDL_stdinc.h"
-#include "SDL_riscostask.h"
-
-#if !SDL_THREADS_DISABLED
-#include <pthread.h>
-pthread_t main_thread;
-#endif
-
-/* RISC OS variables */
-
-static int task_handle = 0;
-static int wimp_version = 0;
-
-/* RISC OS variables to help compatability with certain programs */
-int riscos_backbuffer = 0; /* Create a back buffer in system memory for full screen mode */
-int riscos_closeaction = 1; /* Close icon action */
-
-static int stored_mode = -1; /* -1 when in desktop, mode number or pointer when full screen */
-
-extern int mouseInWindow; /* Mouse is in WIMP window */
-
-/* Local function */
-
-static int RISCOS_GetTaskName(char *task_name, size_t maxlen);
-
-/* Uncomment next line to copy mode changes/restores to stderr */
-/* #define DUMP_MODE */
-#ifdef DUMP_MODE
-#include "stdio.h"
-static void dump_mode()
-{
- fprintf(stderr, "mode %d\n", stored_mode);
- if (stored_mode < -1 || stored_mode >= 256)
- {
- int blockSize = 0;
- int *storeBlock = (int *)stored_mode;
-
- while(blockSize < 5 || storeBlock[blockSize] != -1)
- {
- fprintf(stderr, " %d\n", storeBlock[blockSize++]);
- }
- }
-}
-#endif
-
-/******************************************************************
-
- Initialise as RISC OS Wimp task
-
-*******************************************************************/
-
-int RISCOS_InitTask()
-{
- char task_name[32];
- _kernel_swi_regs regs;
- int messages[4];
-
- if (RISCOS_GetTaskName(task_name, SDL_arraysize(task_name)) == 0) return 0;
-
- messages[0] = 9; /* Palette changed */
- messages[1] = 0x400c1; /* Mode changed */
- messages[2] = 8; /* Pre quit */
- messages[2] = 0;
-
- regs.r[0] = (unsigned int)360; /* Minimum version 3.6 */
- regs.r[1] = (unsigned int)0x4b534154;
- regs.r[2] = (unsigned int)task_name;
- regs.r[3] = (unsigned int)messages;
-
- if (_kernel_swi(Wimp_Initialise, &regs, &regs) == 0)
- {
- wimp_version = regs.r[0];
- task_handle = regs.r[1];
- return 1;
- }
-
-#if !SDL_THREADS_DISABLED
- main_thread = pthread_self();
-#endif
-
- return 0;
-}
-
-/*********************************************************************
-
- Close down application on exit.
-
-**********************************************************************/
-
-void RISCOS_ExitTask()
-{
- _kernel_swi_regs regs;
-
- if (stored_mode == -1)
- {
- /* Ensure cursor is put back to standard pointer shape if
- we have been running in a window */
- _kernel_osbyte(106,1,0);
- }
-
- /* Ensure we end up back in the wimp */
- RISCOS_RestoreWimpMode();
-
- /* Neatly exit the task */
- regs.r[0] = task_handle;
- regs.r[1] = (unsigned int)0x4b534154;
- _kernel_swi(Wimp_CloseDown, &regs, &regs);
- task_handle = 0;
-}
-
-/**************************************************************************
-
- Get the name of the task for the desktop.
-
- Param: task_name - name of task 32 characters.
-
- Returns: 1 is successful, otherwise 0
-
- Notes: Works by getting using OS_GetEnv to get the command line
- used to run the program and then parsing a name from it
- as follows.
-
- 1. Use name after final period if not !RunImage
- 2. If name is !RunImage then process item before the period
- in front of !RunImage.
- 3. If directory name use that
- 4. if in form <XXX$Dir> use the XXX.
-
- Finally once this value has been retrieved use it unless
- there is a variable set up in the form SDL$<name>$TaskName
- in which case the value of this variable will be used.
-
- Now also gets other RISC OS configuration varibles
- SDL$<name>$BackBuffer - set to 1 to use a system memory backbuffer in fullscreen mode
- so updates wait until a call to SDL_UpdateRects. (default 0)
- This is required for programmes where they have assumed this is
- always the case which is contrary to the documentation.
- SDL$<name>$CloseAction
- 0 Don't show close icon
- 1 Show close icon
-
-***************************************************************************/
-
-int RISCOS_GetTaskName(char *task_name, size_t maxlen)
-{
- _kernel_swi_regs regs;
-
- task_name[0] = 0;
-
- /* Figure out a sensible task name */
- if (_kernel_swi(OS_GetEnv, &regs, &regs) == 0)
- {
- char *command_line = (char *)regs.r[0];
- size_t len = SDL_strlen(command_line)+1;
- char *buffer = SDL_stack_alloc(char, len);
- char *env_var;
- char *p;
-
- SDL_strlcpy(buffer, command_line, len);
- p = SDL_strchr(buffer, ' ');
- if (p) *p = 0;
- p = SDL_strrchr(buffer, '.');
- if (p == 0) p = buffer;
- if (stricmp(p+1,"!RunImage") == 0)
- {
- *p = 0;
- p = SDL_strrchr(buffer, '.');
- if (p == 0) p = buffer;
- }
- if (*p == '.') p++;
- if (*p == '!') p++; /* Skip "!" at beginning of application directories */
-
- if (*p == '<')
- {
- // Probably in the form <appname$Dir>
- char *q = SDL_strchr(p, '$');
- if (q == 0) q = SDL_strchr(p,'>'); /* Use variable name if not */
- if (q) *q = 0;
- p++; /* Move over the < */
- }
-
- if (*p)
- {
- /* Read variables that effect the RISC OS SDL engine for this task */
- len = SDL_strlen(p) + 18; /* 18 is larger than the biggest variable name */
- env_var = SDL_stack_alloc(char, len);
- if (env_var)
- {
- char *env_val;
-
- /* See if a variable of form SDL$<dirname>$TaskName exists */
-
- SDL_strlcpy(env_var, "SDL$", len);
- SDL_strlcat(env_var, p, len);
- SDL_strlcat(env_var, "$TaskName", len);
-
- env_val = SDL_getenv(env_var);
- if (env_val) SDL_strlcpy(task_name, env_val, maxlen);
-
- SDL_strlcpy(env_var, "SDL$", len);
- SDL_strlcat(env_var, p, len);
- SDL_strlcat(env_var, "$BackBuffer", len);
-
- env_val = SDL_getenv(env_var);
- if (env_val) riscos_backbuffer = atoi(env_val);
-
- SDL_strlcpy(env_var, "SDL$", len);
- SDL_strlcat(env_var, p, len);
- SDL_strlcat(env_var, "$CloseAction", len);
-
- env_val = SDL_getenv(env_var);
- if (env_val && SDL_strcmp(env_val,"0") == 0) riscos_closeaction = 0;
-
- SDL_stack_free(env_var);
- }
-
- if (!*task_name) SDL_strlcpy(task_name, p, maxlen);
- }
-
- SDL_stack_free(buffer);
- }
-
- if (task_name[0] == 0) SDL_strlcpy(task_name, "SDL Task", maxlen);
-
- return 1;
-}
-
-/*****************************************************************
-
- Store the current desktop screen mode if we are in the desktop.
-
-******************************************************************/
-
-void RISCOS_StoreWimpMode()
-{
- _kernel_swi_regs regs;
-
- /* Don't store if in full screen mode */
- if (stored_mode != -1) return;
-
- regs.r[0] = 1;
- _kernel_swi(OS_ScreenMode, &regs, &regs);
- if (regs.r[1] >= 0 && regs.r[1] < 256) stored_mode = regs.r[1];
- else
- {
- int blockSize = 0;
- int *retBlock = (int *)regs.r[1];
- int *storeBlock;
- int j;
-
- while(blockSize < 5 || retBlock[blockSize] != -1) blockSize++;
- blockSize++;
- storeBlock = (int *)SDL_malloc(blockSize * sizeof(int));
- retBlock = (int *)regs.r[1];
- for ( j = 0; j < blockSize; j++)
- storeBlock[j] = retBlock[j];
-
- stored_mode = (int)storeBlock;
- }
-#if DUMP_MODE
- fprintf(stderr, "Stored "); dump_mode();
-#endif
-}
-
-/*****************************************************************
-
- Restore desktop screen mode if we are in full screen mode.
-
-*****************************************************************/
-
-void RISCOS_RestoreWimpMode()
-{
- _kernel_swi_regs regs;
-
- /* Only need to restore if we are in full screen mode */
- if (stored_mode == -1) return;
-
-#if DUMP_MODE
- fprintf(stderr, "Restored"); dump_mode();
-#endif
-
- regs.r[0] = stored_mode;
- _kernel_swi(Wimp_SetMode, &regs, &regs);
- if (stored_mode < 0 || stored_mode > 256)
- {
- SDL_free((int *)stored_mode);
- }
- stored_mode = -1;
-
- /* Flush keyboard buffer to dump the keystrokes we've already polled */
- regs.r[0] = 21;
- regs.r[1] = 0; /* Keyboard buffer number */
- _kernel_swi(OS_Byte, &regs, &regs);
-
- mouseInWindow = 0;
-
-}
-
-/*********************************************************************
-
- Get version of Wimp running when task was initialised.
-
-*********************************************************************/
-
-int RISCOS_GetWimpVersion()
-{
- return wimp_version;
-}
-
-int RISCOS_GetTaskHandle()
-{
- return task_handle;
-}
diff --git a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscostask.h b/distrib/sdl-1.2.12/src/video/riscos/SDL_riscostask.h
deleted file mode 100644
index 96db8a2..0000000
--- a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscostask.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- This file added by Alan Buckley (alan_baa@hotmail.com) to support RISC OS
- 26 March 2003
-*/
-
-/* Task initialisation/Clean up */
-
-extern int RISCOS_InitTask();
-extern void RISCOS_ExitTask();
-extern int RISCOS_GetWimpVersion();
-extern int RISCOS_GetTaskHandle();
-
-
-/* Wimp mode saveing/restoring */
-extern void RISCOS_StoreWimpMode();
-extern void RISCOS_RestoreWimpMode();
diff --git a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosvideo.c b/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosvideo.c
deleted file mode 100644
index 6307fea..0000000
--- a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosvideo.c
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- File added by Alan Buckley (alan_baa@hotmail.com) for RISC OS compatability
- 23 March 2003
-
- Implements RISC OS display device management.
- Routines for full screen and wimp modes are split
- into other source files.
-*/
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "SDL_syswm.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_riscostask.h"
-#include "SDL_riscosvideo.h"
-#include "SDL_riscosevents_c.h"
-#include "SDL_riscosmouse_c.h"
-
-#include "kernel.h"
-#include "swis.h"
-
-#define RISCOSVID_DRIVER_NAME "riscos"
-
-/* Initialization/Query functions */
-static int RISCOS_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static void RISCOS_VideoQuit(_THIS);
-
-static SDL_Rect **RISCOS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *RISCOS_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-
-int RISCOS_GetWmInfo(_THIS, SDL_SysWMinfo *info);
-
-int RISCOS_ToggleFullScreen(_THIS, int fullscreen);
-/* Mouse checking */
-void RISCOS_CheckMouseMode(_THIS);
-extern SDL_GrabMode RISCOS_GrabInput(_THIS, SDL_GrabMode mode);
-
-/* Fullscreen mode functions */
-extern SDL_Surface *FULLSCREEN_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-extern void FULLSCREEN_BuildModeList(_THIS);
-extern void FULLSCREEN_SetDeviceMode(_THIS);
-extern int FULLSCREEN_ToggleFromWimp(_THIS);
-
-/* Wimp mode functions */
-extern SDL_Surface *WIMP_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-extern void WIMP_DeleteWindow(_THIS);
-extern int WIMP_ToggleFromFullScreen(_THIS);
-
-/* Hardware surface functions - common to WIMP and FULLSCREEN */
-static int RISCOS_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int RISCOS_LockHWSurface(_THIS, SDL_Surface *surface);
-static void RISCOS_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static void RISCOS_FreeHWSurface(_THIS, SDL_Surface *surface);
-
-/* RISC OS driver bootstrap functions */
-
-static int RISCOS_Available(void)
-{
- return(1);
-}
-
-static void RISCOS_DeleteDevice(SDL_VideoDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_VideoDevice *RISCOS_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device ) {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *device->hidden));
- }
- if ( (device == NULL) || (device->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( device ) {
- SDL_free(device);
- }
- return(0);
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
-
- /* Set the function pointers */
- device->VideoInit = RISCOS_VideoInit;
- device->VideoQuit = RISCOS_VideoQuit;
-
- device->ListModes = RISCOS_ListModes;
- device->SetVideoMode = RISCOS_SetVideoMode;
- device->CreateYUVOverlay = NULL;
- device->AllocHWSurface = RISCOS_AllocHWSurface;
- device->CheckHWBlit = NULL;
- device->FillHWRect = NULL;
- device->SetHWColorKey = NULL;
- device->SetHWAlpha = NULL;
- device->LockHWSurface = RISCOS_LockHWSurface;
- device->UnlockHWSurface = RISCOS_UnlockHWSurface;
- device->FreeHWSurface = RISCOS_FreeHWSurface;
-
- device->FreeWMCursor = RISCOS_FreeWMCursor;
- device->CreateWMCursor = RISCOS_CreateWMCursor;
- device->CheckMouseMode = RISCOS_CheckMouseMode;
- device->GrabInput = RISCOS_GrabInput;
-
- device->InitOSKeymap = RISCOS_InitOSKeymap;
-
- device->GetWMInfo = RISCOS_GetWmInfo;
-
- device->free = RISCOS_DeleteDevice;
-
-/* Can't get Toggle screen to work if program starts up in Full screen mode so
- disable it here and re-enable it when a wimp screen is chosen */
- device->ToggleFullScreen = NULL; /*RISCOS_ToggleFullScreen;*/
-
- /* Set other entries for fullscreen mode */
- FULLSCREEN_SetDeviceMode(device);
-
- /* Mouse pointer needs to use the WIMP ShowCursor version so
- that it doesn't modify the pointer until the SDL Window is
- entered or the application goes full screen */
- device->ShowWMCursor = WIMP_ShowWMCursor;
-
- return device;
-}
-
-VideoBootStrap RISCOS_bootstrap = {
- RISCOSVID_DRIVER_NAME, "RISC OS video driver",
- RISCOS_Available, RISCOS_CreateDevice
-};
-
-
-int RISCOS_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- _kernel_swi_regs regs;
- int vars[4], vals[3];
-
- if (RISCOS_InitTask() == 0)
- {
- SDL_SetError("Unable to start task");
- return 0;
- }
-
- vars[0] = 9; /* Log base 2 bpp */
- vars[1] = 11; /* XWndLimit - num x pixels -1 */
- vars[2] = 12; /* YWndLimit - num y pixels -1 */
- vars[3] = -1; /* Terminate list */
- regs.r[0] = (int)vars;
- regs.r[1] = (int)vals;
-
- _kernel_swi(OS_ReadVduVariables, &regs, &regs);
- vformat->BitsPerPixel = (1 << vals[0]);
-
- /* Determine the current screen size */
- this->info.current_w = vals[1] + 1;
- this->info.current_h = vals[2] + 1;
-
- /* Minimum bpp for SDL is 8 */
- if (vformat->BitsPerPixel < 8) vformat->BitsPerPixel = 8;
-
-
- switch (vformat->BitsPerPixel)
- {
- case 15:
- case 16:
- vformat->Bmask = 0x00007c00;
- vformat->Gmask = 0x000003e0;
- vformat->Rmask = 0x0000001f;
- vformat->BitsPerPixel = 16; /* SDL wants actual number of bits used */
- vformat->BytesPerPixel = 2;
- break;
-
- case 24:
- case 32:
- vformat->Bmask = 0x00ff0000;
- vformat->Gmask = 0x0000ff00;
- vformat->Rmask = 0x000000ff;
- vformat->BytesPerPixel = 4;
- break;
-
- default:
- vformat->Bmask = 0;
- vformat->Gmask = 0;
- vformat->Rmask = 0;
- vformat->BytesPerPixel = 1;
- break;
- }
-
- /* Fill in some window manager capabilities */
- this->info.wm_available = 1;
-
- /* We're done! */
- return(0);
-}
-
-/* Note: If we are terminated, this could be called in the middle of
- another SDL video routine -- notably UpdateRects.
-*/
-void RISCOS_VideoQuit(_THIS)
-{
- RISCOS_ExitTask();
-
- if (this->hidden->alloc_bank) SDL_free(this->hidden->alloc_bank);
- this->hidden->alloc_bank = 0;
-}
-
-
-SDL_Rect **RISCOS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- if (flags & SDL_FULLSCREEN)
- {
- /* Build mode list when first required. */
- if (SDL_nummodes[0] == 0) FULLSCREEN_BuildModeList(this);
-
- return(SDL_modelist[((format->BitsPerPixel+7)/8)-1]);
- } else
- return (SDL_Rect **)-1;
-}
-
-
-/* Set up video mode */
-SDL_Surface *RISCOS_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- if (flags & SDL_FULLSCREEN)
- {
- RISCOS_StoreWimpMode();
- /* Dump wimp window on switch to full screen */
- if (this->hidden->window_handle) WIMP_DeleteWindow(this);
-
- return FULLSCREEN_SetVideoMode(this, current, width, height, bpp, flags);
- } else
- {
- RISCOS_RestoreWimpMode();
- return WIMP_SetVideoMode(this, current, width, height, bpp, flags);
- }
-}
-
-
-/* We don't actually allow hardware surfaces other than the main one */
-static int RISCOS_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- return(-1);
-}
-static void RISCOS_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-/* We need to wait for vertical retrace on page flipped displays */
-static int RISCOS_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- return(0);
-}
-
-static void RISCOS_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-
-int RISCOS_GetWmInfo(_THIS, SDL_SysWMinfo *info)
-{
- SDL_VERSION(&(info->version));
- info->wimpVersion = RISCOS_GetWimpVersion();
- info->taskHandle = RISCOS_GetTaskHandle();
- info->window = this->hidden->window_handle;
-
- return 1;
-}
-/* Toggle full screen mode.
- Returns 1 if successful otherwise 0
-*/
-
-int RISCOS_ToggleFullScreen(_THIS, int fullscreen)
-{
- if (fullscreen)
- {
- return FULLSCREEN_ToggleFromWimp(this);
- } else
- {
- return WIMP_ToggleFromFullScreen(this);
- }
-
- return 0;
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosvideo.h b/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosvideo.h
deleted file mode 100644
index cc3077f..0000000
--- a/distrib/sdl-1.2.12/src/video/riscos/SDL_riscosvideo.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_riscosvideo_h
-#define _SDL_riscosvideo_h
-
-#include "SDL_mouse.h"
-#include "SDL_mutex.h"
-#include "../SDL_sysvideo.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-
-/* Private display data */
-
-struct SDL_PrivateVideoData {
- unsigned char *bank[2];
- int current_bank;
- unsigned char *alloc_bank;
- int height;
- int xeig;
- int yeig;
- int screen_bpp;
- int screen_width;
- int screen_height;
- char *pixtrans;
-
- /* Wimp variables */
- unsigned int window_handle;
- char title[256];
-
-#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
- int SDL_nummodes[NUM_MODELISTS];
- SDL_Rect **SDL_modelist[NUM_MODELISTS];
-};
-
-/* Old variable names */
-#define SDL_nummodes (this->hidden->SDL_nummodes)
-#define SDL_modelist (this->hidden->SDL_modelist)
-
-#endif /* _SDL_risosvideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/riscos/SDL_wimppoll.c b/distrib/sdl-1.2.12/src/video/riscos/SDL_wimppoll.c
deleted file mode 100644
index fcc5fc3..0000000
--- a/distrib/sdl-1.2.12/src/video/riscos/SDL_wimppoll.c
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- File added by Alan Buckley (alan_baa@hotmail.com) for RISC OS compatability
- 27 March 2003
-
- Implements Pumping of events and WIMP polling
-*/
-
-#include "SDL.h"
-#include "SDL_syswm.h"
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_riscosvideo.h"
-#include "SDL_riscosevents_c.h"
-#include "SDL_riscosmouse_c.h"
-#include "../../timer/SDL_timer_c.h"
-
-#include "memory.h"
-#include "stdlib.h"
-#include "ctype.h"
-
-#include "kernel.h"
-#include "swis.h"
-#include "unixlib/os.h"
-
-#if !SDL_THREADS_DISABLED
-#include <pthread.h>
-#endif
-
-/* Local functions */
-void WIMP_Poll(_THIS, int waitTime);
-void WIMP_SetFocus(int win);
-
-/* SDL_riscossprite functions */
-void WIMP_PlotSprite(_THIS, int x, int y);
-void WIMP_ModeChanged(_THIS);
-void WIMP_PaletteChanged(_THIS);
-
-
-extern void WIMP_PollMouse(_THIS);
-extern void RISCOS_PollKeyboard();
-
-#if SDL_THREADS_DISABLED
-/* Timer running function */
-extern void RISCOS_CheckTimer();
-#else
-extern int riscos_using_threads;
-#endif
-
-/* Mouse cursor handling */
-extern void WIMP_ReshowCursor(_THIS);
-extern void WIMP_RestoreWimpCursor();
-
-int hasFocus = 0;
-int mouseInWindow = 0;
-
-/* Flag to ensure window is correct size after a mode change */
-static int resizeOnOpen = 0;
-
-void WIMP_PumpEvents(_THIS)
-{
- WIMP_Poll(this, 0);
- if (hasFocus) RISCOS_PollKeyboard();
- if (mouseInWindow) WIMP_PollMouse(this);
-#if SDL_THREADS_DISABLED
- if (SDL_timer_running) RISCOS_CheckTimer();
-#endif
-}
-
-
-void WIMP_Poll(_THIS, int waitTime)
-{
- _kernel_swi_regs regs;
- int message[64];
- unsigned int code;
- int pollMask = 0;
- int doPoll = 1;
- int sysEvent;
- int sdlWindow = this->hidden->window_handle;
-
- if (this->PumpEvents != WIMP_PumpEvents) return;
-
- if (waitTime > 0)
- {
- _kernel_swi(OS_ReadMonotonicTime, &regs, &regs);
- waitTime += regs.r[0];
- }
-
- while (doPoll)
- {
-#if !SDL_THREADS_DISABLED
- /* Stop thread callbacks while program is paged out */
- if (riscos_using_threads) __pthread_stop_ticker();
-#endif
-
- if (waitTime <= 0)
- {
- regs.r[0] = pollMask; /* Poll Mask */
- /* For no wait time mask out null event so we wait until something happens */
- if (waitTime < 0) regs.r[0] |= 1;
- regs.r[1] = (int)message;
- _kernel_swi(Wimp_Poll, &regs, &regs);
- } else
- {
- regs.r[0] = pollMask;
- regs.r[1] = (int)message;
- regs.r[2] = waitTime;
- _kernel_swi(Wimp_PollIdle, &regs, &regs);
- }
-
- /* Flag to specify if we post a SDL_SysWMEvent */
- sysEvent = 0;
-
- code = (unsigned int)regs.r[0];
-
- switch(code)
- {
- case 0: /* Null Event - drop out for standard processing*/
- doPoll = 0;
- break;
-
- case 1: /* Redraw window */
- _kernel_swi(Wimp_RedrawWindow, &regs,&regs);
- if (message[0] == sdlWindow)
- {
- while (regs.r[0])
- {
- WIMP_PlotSprite(this, message[1], message[2]);
- _kernel_swi(Wimp_GetRectangle, &regs, &regs);
- }
- } else
- {
- /* TODO: Currently we just eat them - we may need to pass them on */
- while (regs.r[0])
- {
- _kernel_swi(Wimp_GetRectangle, &regs, &regs);
- }
- }
- break;
-
- case 2: /* Open window */
- if ( resizeOnOpen && message[0] == sdlWindow)
- {
- /* Ensure window is correct size */
- resizeOnOpen = 0;
- message[3] = message[1] + (this->screen->w << this->hidden->xeig);
- message[4] = message[2] + (this->screen->h << this->hidden->yeig);
- }
- _kernel_swi(Wimp_OpenWindow, &regs, &regs);
- break;
-
- case 3: /* Close window */
- if (message[0] == sdlWindow)
- {
- /* Documentation makes it looks as if the following line is correct:
- ** if (SDL_PrivateQuit() == 1) _kernel_swi(Wimp_CloseWindow, &regs, &regs);
- ** However some programs don't process this message and so sit there invisibly
- ** in the background so I just post the quit message and hope the application
- ** does the correct thing.
- */
- SDL_PrivateQuit();
- } else
- sysEvent = 1;
- doPoll = 0;
- break;
-
- case 4: /* Pointer_Leaving_Window */
- if (message[0] == sdlWindow)
- {
- mouseInWindow = 0;
- //TODO: Lose buttons / dragging
- /* Reset to default pointer */
- WIMP_RestoreWimpCursor();
- SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
- } else
- sysEvent = 1;
- break;
-
- case 5: /* Pointer_Entering_Window */
- if (message[0] == sdlWindow)
- {
- mouseInWindow = 1;
- WIMP_ReshowCursor(this);
- SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
- } else sysEvent = 1;
- break;
-
- case 6: /* Mouse_Click */
- if (hasFocus == 0)
- {
- /* First click gives focus if it's not a menu */
- /* we only count non-menu clicks on a window that has the focus */
- WIMP_SetFocus(message[3]);
- } else
- doPoll = 0; // So PollMouse gets a chance to pick it up
- break;
-
- case 7: /* User_Drag_Box - Used for mouse release */
- //TODO: May need to implement this in the future
- sysEvent = 1;
- break;
-
- case 8: /* Keypressed */
- doPoll = 0; /* PollKeyboard should pick it up */
- if (message[0] != sdlWindow) sysEvent = 1;
- /*TODO: May want to always pass F12 etc to the wimp
- {
- regs.r[0] = message[6];
- _kernel_swi(Wimp_ProcessKey, &regs, &regs);
- }
- */
- break;
-
- case 11: /* Lose Caret */
- hasFocus = 0;
- if (message[0] == sdlWindow) SDL_PrivateAppActive(0, SDL_APPINPUTFOCUS);
- else sysEvent = 1;
- break;
-
- case 12: /* Gain Caret */
- hasFocus = 1;
- if (message[0] == sdlWindow) SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
- else sysEvent = 1;
- break;
-
- case 17:
- case 18:
- sysEvent = 1; /* All messages are passed on */
-
- switch(message[4])
- {
- case 0: /* Quit Event */
- /* No choice - have to quit */
- SDL_Quit();
- exit(0);
- break;
-
- case 8: /* Pre Quit */
- SDL_PrivateQuit();
- break;
-
- case 0x400c1: /* Mode change */
- WIMP_ModeChanged(this);
- resizeOnOpen = 1;
- break;
-
- case 9: /* Palette changed */
- WIMP_PaletteChanged(this);
- break;
- }
- break;
-
- default:
- /* Pass unknown events on */
- sysEvent = 1;
- break;
- }
-
- if (sysEvent)
- {
- SDL_SysWMmsg wmmsg;
-
- SDL_VERSION(&wmmsg.version);
- wmmsg.eventCode = code;
- SDL_memcpy(wmmsg.pollBlock, message, 64 * sizeof(int));
-
- /* Fall out of polling loop if message is successfully posted */
- if (SDL_PrivateSysWMEvent(&wmmsg)) doPoll = 0;
- }
-#if !SDL_THREADS_DISABLED
- if (riscos_using_threads)
- {
- /* Restart ticker here so other thread can not interfere
- with the Redraw processing */
- if (riscos_using_threads) __pthread_start_ticker();
- /* Give other threads a better chance of running */
- pthread_yield();
- }
-#endif
- }
-}
-
-/* Set focus to specified window */
-void WIMP_SetFocus(int win)
-{
- _kernel_swi_regs regs;
-
- regs.r[0] = win;
- regs.r[1] = -1; /* Icon handle */
- regs.r[2] = 0; /* X-offset we just put it at position 0 */
- regs.r[3] = 0; /* Y-offset as above */
- regs.r[4] = 1 << 25; /* Caret is invisible */
- regs.r[5] = 0; /* index into string */
-
- _kernel_swi(Wimp_SetCaretPosition, &regs, &regs);
-}
-
-/** Run background task while in a sleep command */
-void RISCOS_BackgroundTasks(void)
-{
- if (current_video && current_video->hidden->window_handle)
- {
- WIMP_Poll(current_video, 0);
- }
-#if SDL_THREADS_DISABLED
- if (SDL_timer_running) RISCOS_CheckTimer();
-#endif
-}
diff --git a/distrib/sdl-1.2.12/src/video/riscos/SDL_wimpvideo.c b/distrib/sdl-1.2.12/src/video/riscos/SDL_wimpvideo.c
deleted file mode 100644
index 6286844..0000000
--- a/distrib/sdl-1.2.12/src/video/riscos/SDL_wimpvideo.c
+++ /dev/null
@@ -1,501 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- File added by Alan Buckley (alan_baa@hotmail.com) for RISC OS compatability
- 27 March 2003
-
- Implements RISC OS Wimp display.
-*/
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_riscostask.h"
-#include "SDL_riscosvideo.h"
-#include "SDL_riscosevents_c.h"
-#include "SDL_riscosmouse_c.h"
-
-#include "kernel.h"
-#include "swis.h"
-
-/* Initialization/Query functions */
-SDL_Rect **WIMP_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-SDL_Surface *WIMP_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-int WIMP_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
-void WIMP_SetWMCaption(_THIS, const char *title, const char *icon);
-
-
-extern unsigned char *WIMP_CreateBuffer(int width, int height, int bpp);
-extern void WIMP_PumpEvents(_THIS);
-extern void WIMP_PlotSprite(_THIS, int x, int y);
-extern void WIMP_SetupPlotInfo(_THIS);
-extern void WIMP_SetFocus(int win);
-
-/* etc. */
-static void WIMP_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
-
-/* RISC OS Wimp handling helpers */
-void WIMP_ReadModeInfo(_THIS);
-unsigned int WIMP_SetupWindow(_THIS, SDL_Surface *surface);
-void WIMP_SetDeviceMode(_THIS);
-void WIMP_DeleteWindow(_THIS);
-
-/* FULLSCREEN function required for wimp/fullscreen toggling */
-extern int FULLSCREEN_SetMode(int width, int height, int bpp);
-
-/* Currently need to set this up here as it only works if you
- start up in a Wimp mode */
-extern int RISCOS_ToggleFullScreen(_THIS, int fullscreen);
-
-extern int riscos_backbuffer;
-extern int mouseInWindow;
-extern int riscos_closeaction;
-
-/* Following needed to ensure window is shown immediately */
-extern int hasFocus;
-extern void WIMP_Poll(_THIS, int waitTime);
-
-SDL_Surface *WIMP_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- Uint32 Rmask = 0;
- Uint32 Gmask = 0;
- Uint32 Bmask = 0;
- char *buffer = NULL;
- int bytesPerPixel = 1;
-
- /* Don't support double buffering in Wimp mode */
- flags &= ~SDL_DOUBLEBUF;
- flags &= ~SDL_HWSURFACE;
-
- switch(bpp)
- {
- case 8:
- /* Emulated palette using ColourTrans */
- flags |= SDL_HWPALETTE;
- break;
-
- case 15:
- case 16:
- Bmask = 0x00007c00;
- Gmask = 0x000003e0;
- Rmask = 0x0000001f;
- bytesPerPixel = 2;
- break;
-
- case 32:
- Bmask = 0x00ff0000;
- Gmask = 0x0000ff00;
- Rmask = 0x000000ff;
- bytesPerPixel = 4;
- break;
-
- default:
- SDL_SetError("Pixel depth not supported");
- return NULL;
- break;
- }
-
-/* printf("Setting mode %dx%d\n", width, height);*/
-
- /* Allocate the new pixel format for the screen */
- if ( ! SDL_ReallocFormat(current, bpp, Rmask, Gmask, Bmask, 0) ) {
- SDL_SetError("Couldn't allocate new pixel format for requested mode");
- return(NULL);
- }
-
- /* Set up the new mode framebuffer */
- current->w = width;
- this->hidden->height = current->h = height;
-
- if (bpp == 15) bpp = 16;
- buffer = WIMP_CreateBuffer(width, height, bpp);
- if (buffer == NULL)
- {
- SDL_SetError("Couldn't create sprite for video memory");
- return (NULL);
- }
-
- this->hidden->bank[0] = buffer + 60; /* Start of sprite data */
- if (bpp == 8) this->hidden->bank[0] += 2048; /* 8bpp sprite have palette first */
-
- this->hidden->bank[1] = buffer; /* Start of buffer */
-
- /* Remember sprite buffer so it can be freed later */
- if (this->hidden->alloc_bank) SDL_free(this->hidden->alloc_bank);
- this->hidden->alloc_bank = buffer;
-
- current->pitch = width * bytesPerPixel;
- if ((current->pitch & 3))
- {
- /* Sprites are 32bit word aligned */
- current->pitch += (4 - (current->pitch & 3));
- }
-
- current->flags = flags | SDL_PREALLOC;
-
- WIMP_ReadModeInfo(this);
-
- SDL_memset(this->hidden->bank[0], 0, height * current->pitch);
-
- this->hidden->current_bank = 0;
- current->pixels = this->hidden->bank[0];
-
-
- if (WIMP_SetupWindow(this, current) == 0)
- {
- SDL_SetError("Unable to create window to display surface");
- return NULL;
- }
-
- /* Reset device functions for the wimp */
- WIMP_SetDeviceMode(this);
-
- /* Needs to set up plot info after window has been created */
- /* Not sure why, but plots don't work if I do it earlier */
- WIMP_SetupPlotInfo(this);
-
- /* Poll until window is shown */
- {
- /* We wait until it gets the focus, but give up after 5 seconds
- in case the focus is prevented in any way.
- */
- Uint32 now = SDL_GetTicks();
- while (!hasFocus && SDL_GetTicks() - now < 5000)
- {
- WIMP_Poll(this, 0);
- }
- }
-
- /* We're done */
- return(current);
-}
-
-
-void WIMP_ReadModeInfo(_THIS)
-{
- _kernel_swi_regs regs;
- int vars[6];
- int vals[5];
-
- vars[0] = 4; /* XEig */
- vars[1] = 5; /* YEig */
- vars[2] = 9; /* Log base 2 bpp */
- vars[3] = 11; /* Screen Width - 1 */
- vars[4] = 12; /* Screen Depth - 1 */
- vars[5] = -1; /* Terminate list */
-
- regs.r[0] = (int)vars;
- regs.r[1] = (int)vals;
- _kernel_swi(OS_ReadVduVariables, &regs, &regs);
- this->hidden->xeig = vals[0];
- this->hidden->yeig = vals[1];
- this->hidden->screen_bpp = 1 << vals[2];
- this->hidden->screen_width = vals[3] + 1;
- this->hidden->screen_height = vals[4] + 1;
-}
-
-/* Set device function to call the correct versions for running
- in a wimp window */
-
-void WIMP_SetDeviceMode(_THIS)
-{
- if (this->UpdateRects == WIMP_UpdateRects) return; /* Already set up */
-
- this->SetColors = WIMP_SetColors;
- this->UpdateRects = WIMP_UpdateRects;
-
- this->FlipHWSurface = NULL;
-
- this->SetCaption = WIMP_SetWMCaption;
- this->SetIcon = NULL;
- this->IconifyWindow = NULL;
-
- this->ShowWMCursor = WIMP_ShowWMCursor;
- this->WarpWMCursor = WIMP_WarpWMCursor;
-
- this->ToggleFullScreen = RISCOS_ToggleFullScreen;
-
- this->PumpEvents = WIMP_PumpEvents;
-}
-
-/* Setup the Window to display the surface */
-unsigned int WIMP_SetupWindow(_THIS, SDL_Surface *surface)
-{
- _kernel_swi_regs regs;
- int window_data[23];
- int *window_block = window_data+1;
- int x = (this->hidden->screen_width - surface->w) / 2;
- int y = (this->hidden->screen_height - surface->h) / 2;
- int xeig = this->hidden->xeig;
- int yeig = this->hidden->yeig;
-
- mouseInWindow = 0;
-
- /* Always delete the window and recreate on a change */
- if (this->hidden->window_handle) WIMP_DeleteWindow(this);
-
- /* Setup window co-ordinates */
- window_block[0] = x << xeig;
- window_block[1] = y << yeig;
- window_block[2] = window_block[0] + (surface->w << xeig);
- window_block[3] = window_block[1] + (surface->h << yeig);
-
-
- window_block[4] = 0; /* Scroll offsets */
- window_block[5] = 0;
- window_block[6] = -1; /* Open on top of window stack */
-
- window_block[7] = 0x85040042; /* Window flags */
- if (riscos_closeaction != 0) window_block[7] |= 0x2000000;
-
- /* TODO: Take into account surface->flags */
-
- window_block[8] = 0xff070207; /* Window colours */
- window_block[9] = 0x000c0103;
- window_block[10] = 0; /* Work area minimum */
- window_block[11] = -surface->h << yeig;
- window_block[12] = surface->w << xeig; /* Work area maximum */
- window_block[13] = 0;
- window_block[14] = 0x2700013d; /* Title icon flags */
- window_block[15] = 0x00003000; /* Work area flags - Mouse click down reported */
- window_block[16] = 1; /* Sprite area control block pointer */
- window_block[17] = 0x00100010; /* Minimum window size (width & height) (16x16)*/
- window_block[18] = (int)this->hidden->title; /* Title data */
- window_block[19] = -1;
- window_block[20] = 256;
- window_block[21] = 0; /* Number of icons */
-
- regs.r[1] = (unsigned int)(window_block);
-
- /* Create the window */
- if (_kernel_swi(Wimp_CreateWindow, &regs, &regs) == NULL)
- {
- this->hidden->window_handle = window_data[0] = regs.r[0];
-
- /* Show the window on the screen */
- regs.r[1] = (unsigned int)window_data;
- if (_kernel_swi(Wimp_OpenWindow, &regs, &regs) == NULL)
- {
- WIMP_SetFocus(this->hidden->window_handle);
- } else
- {
- WIMP_DeleteWindow(this);
- }
- }
-
- return this->hidden->window_handle;
-}
-
-/* Destroy the Window */
-
-void WIMP_DeleteWindow(_THIS)
-{
- _kernel_swi_regs regs;
- regs.r[1] = (unsigned int)&(this->hidden->window_handle);
- _kernel_swi(Wimp_DeleteWindow, &regs, &regs);
- this->hidden->window_handle = 0;
-}
-
-
-void WIMP_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
-{
- _kernel_swi_regs regs;
- int update_block[12];
- int xeig = this->hidden->xeig;
- int yeig = this->hidden->yeig;
- int j;
- update_block[0] = this->hidden->window_handle;
-
- for (j = 0; j < numrects; j++)
- {
- update_block[1] = rects[j].x << xeig; /* Min X */
- update_block[4] = -(rects[j].y << yeig);
- update_block[3] = update_block[1] + (rects[j].w << xeig);
- update_block[2] = update_block[4] - (rects[j].h << yeig);
-
- regs.r[1] = (int)update_block;
- /* Update window can fail if called before first poll */
- if (_kernel_swi(Wimp_UpdateWindow, &regs, &regs) == 0)
- {
- while (regs.r[0])
- {
- WIMP_PlotSprite(this, update_block[1], update_block[2]);
- _kernel_swi(Wimp_GetRectangle, &regs, &regs);
- }
- }
- }
-}
-
-
-int WIMP_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- unsigned int *pal = (unsigned int *)(this->hidden->bank[1]+60);
- int j;
- SDL_Rect update;
-
- pal += firstcolor*2;
- for (j = 0; j < ncolors; j++)
- {
- *pal = (((unsigned int)colors->r) << 8)
- + (((unsigned int)colors->g) << 16)
- + (((unsigned int)colors->b) << 24);
- pal[1] = *pal;
- pal += 2;
- colors++;
- }
-
- WIMP_SetupPlotInfo(this);
-
- /* Need to refresh the window */
- update.x = 0;
- update.y = 0;
- update.w = SDL_VideoSurface->w;
- update.h = SDL_VideoSurface->h;
- WIMP_UpdateRects(this, 1, &update);
-
- return 1;
-}
-
-void WIMP_SetWMCaption(_THIS, const char *title, const char *icon)
-{
- _kernel_swi_regs regs;
-
- SDL_strlcpy(this->hidden->title, title, SDL_arraysize(this->hidden->title));
-
- if (RISCOS_GetWimpVersion() < 380)
- {
- int block[6];
-
- regs.r[1] = (int)block;
- _kernel_swi(Wimp_GetCaretPosition, &regs, &regs);
- if (block[0] == (int)this->hidden->window_handle)
- {
- regs.r[0] = -1;
- _kernel_swi(Wimp_SetCaretPosition, &regs,&regs);
- } else
- {
- regs.r[0] = this->hidden->window_handle;
- regs.r[1] = -1;
- regs.r[2] = -1;
- regs.r[3] = -1;
- _kernel_swi(Wimp_SetCaretPosition, &regs,&regs);
- }
- regs.r[0] = block[0];
- regs.r[1] = block[1];
- regs.r[2] = block[2];
- regs.r[3] = block[3];
- regs.r[4] = block[4];
- regs.r[5] = block[5];
- _kernel_swi(Wimp_SetCaretPosition, &regs,&regs);
- } else
- {
- regs.r[0] = this->hidden->window_handle;
- regs.r[1] = 0x4b534154; /* "TASK" */
- regs.r[2] = 3; /* Redraw title */
- _kernel_swi(Wimp_ForceRedraw, &regs, &regs);
- }
-}
-
-void WIMP_RefreshDesktop(_THIS)
-{
- int width = this->hidden->screen_width << this->hidden->xeig;
- int height = this->hidden->screen_height << this->hidden->yeig;
- _kernel_swi_regs regs;
- regs.r[0] = -1; /* Whole screen */
- regs.r[1] = 0;
- regs.r[2] = 0;
- regs.r[3] = width;
- regs.r[4] = height;
- _kernel_swi(Wimp_ForceRedraw, &regs, &regs);
-}
-
-/* Toggle to window from full screen */
-int WIMP_ToggleFromFullScreen(_THIS)
-{
- int width = this->screen->w;
- int height = this->screen->h;
- int bpp = this->screen->format->BitsPerPixel;
- char *buffer = NULL;
- char *old_bank[2];
- char *old_alloc_bank;
-
- /* Ensure flags are OK */
- this->screen->flags &= ~(SDL_DOUBLEBUF|SDL_HWSURFACE);
-
- if (this->hidden->bank[0] == this->hidden->alloc_bank || riscos_backbuffer == 0)
- {
- /* Need to create a sprite for the screen and copy the data to it */
- char *data;
- buffer = WIMP_CreateBuffer(width, height, bpp);
- data = buffer + 60; /* Start of sprite data */
- if (bpp == 8) data += 2048; /* 8bpp sprite have palette first */
-
- if (buffer == NULL) return 0;
- SDL_memcpy(data, this->hidden->bank[0], width * height * this->screen->format->BytesPerPixel);
- }
- /* else We've switch to full screen before so we already have a sprite */
-
- old_bank[0] = this->hidden->bank[0];
- old_bank[1] = this->hidden->bank[1];
- old_alloc_bank = this->hidden->alloc_bank;
-
- if (buffer != NULL) this->hidden->alloc_bank = buffer;
-
- this->hidden->bank[1] = this->hidden->alloc_bank;
- this->hidden->bank[0] = this->hidden->bank[1] + 60; /* Start of sprite data */
- if (bpp == 8) this->hidden->bank[0] += 2048; /* 8bpp sprite have palette first */
-
- this->hidden->current_bank = 0;
- this->screen->pixels = this->hidden->bank[0];
-
- RISCOS_RestoreWimpMode();
- WIMP_ReadModeInfo(this);
- if (WIMP_SetupWindow(this, this->screen))
- {
- WIMP_SetDeviceMode(this);
- WIMP_SetupPlotInfo(this);
-
- if (riscos_backbuffer == 0) riscos_backbuffer = 1;
-
- if (buffer && old_alloc_bank) SDL_free(old_alloc_bank);
-
- return 1;
- } else
- {
- /* Drop back to full screen mode on failure */
- this->hidden->bank[0] = old_bank[0];
- this->hidden->bank[1] = old_bank[1];
- this->hidden->alloc_bank = old_alloc_bank;
- if (buffer) SDL_free(buffer);
-
- RISCOS_StoreWimpMode();
- FULLSCREEN_SetMode(width, height, bpp);
- }
-
- return 0;
-}
diff --git a/distrib/sdl-1.2.12/src/video/svga/SDL_svgaevents.c b/distrib/sdl-1.2.12/src/video/svga/SDL_svgaevents.c
deleted file mode 100644
index f344856..0000000
--- a/distrib/sdl-1.2.12/src/video/svga/SDL_svgaevents.c
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Handle the event stream, converting X11 events into SDL events */
-
-#include <vga.h>
-#include <vgamouse.h>
-#include <vgakeyboard.h>
-#if defined(__LINUX__)
-#include <linux/kd.h>
-#include <linux/keyboard.h>
-#elif defined(__FREEBSD__)
-#include <sys/kbio.h>
-#else
-#error You must choose your operating system here
-#endif
-
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_svgavideo.h"
-#include "SDL_svgaevents_c.h"
-
-/* The translation tables from a console scancode to a SDL keysym */
-#if defined(linux)
-#define NUM_VGAKEYMAPS (1<<KG_CAPSSHIFT)
-static Uint16 vga_keymap[NUM_VGAKEYMAPS][NR_KEYS];
-#elif defined(__FREEBSD__)
-/* FIXME: Free the keymap when we shut down the video mode */
-static keymap_t *vga_keymap = NULL;
-#else
-#error You must choose your operating system here
-#endif
-static SDLKey keymap[128];
-static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym);
-
-/* Ugh, we have to duplicate the kernel's keysym mapping code...
- Oh, it's not so bad. :-)
-
- FIXME: Add keyboard LED handling code
- */
-#if defined(linux)
-int SVGA_initkeymaps(int fd)
-{
- struct kbentry entry;
- int map, i;
-
- /* Load all the keysym mappings */
- for ( map=0; map<NUM_VGAKEYMAPS; ++map ) {
- SDL_memset(vga_keymap[map], 0, NR_KEYS*sizeof(Uint16));
- for ( i=0; i<NR_KEYS; ++i ) {
- entry.kb_table = map;
- entry.kb_index = i;
- if ( ioctl(fd, KDGKBENT, &entry) == 0 ) {
- /* The "Enter" key is a special case */
- if ( entry.kb_value == K_ENTER ) {
- entry.kb_value = K(KT_ASCII,13);
- }
- /* Handle numpad specially as well */
- if ( KTYP(entry.kb_value) == KT_PAD ) {
- switch ( entry.kb_value ) {
- case K_P0:
- case K_P1:
- case K_P2:
- case K_P3:
- case K_P4:
- case K_P5:
- case K_P6:
- case K_P7:
- case K_P8:
- case K_P9:
- vga_keymap[map][i]=entry.kb_value;
- vga_keymap[map][i]+= '0';
- break;
- case K_PPLUS:
- vga_keymap[map][i]=K(KT_ASCII,'+');
- break;
- case K_PMINUS:
- vga_keymap[map][i]=K(KT_ASCII,'-');
- break;
- case K_PSTAR:
- vga_keymap[map][i]=K(KT_ASCII,'*');
- break;
- case K_PSLASH:
- vga_keymap[map][i]=K(KT_ASCII,'/');
- break;
- case K_PENTER:
- vga_keymap[map][i]=K(KT_ASCII,'\r');
- break;
- case K_PCOMMA:
- vga_keymap[map][i]=K(KT_ASCII,',');
- break;
- case K_PDOT:
- vga_keymap[map][i]=K(KT_ASCII,'.');
- break;
- default:
- break;
- }
- }
- /* Do the normal key translation */
- if ( (KTYP(entry.kb_value) == KT_LATIN) ||
- (KTYP(entry.kb_value) == KT_ASCII) ||
- (KTYP(entry.kb_value) == KT_LETTER) ) {
- vga_keymap[map][i] = entry.kb_value;
- }
- }
- }
- }
- return(0);
-}
-#elif defined(__FREEBSD__)
-int SVGA_initkeymaps(int fd)
-{
- vga_keymap = SDL_malloc(sizeof(keymap_t));
- if ( ! vga_keymap ) {
- SDL_OutOfMemory();
- return(-1);
- }
- if (ioctl(fd, GIO_KEYMAP, vga_keymap) == -1) {
- SDL_free(vga_keymap);
- vga_keymap = NULL;
- SDL_SetError("Unable to get keyboard map");
- return(-1);
- }
- return(0);
-}
-#else
-#error You must choose your operating system here
-#endif
-
-int posted = 0;
-
-void SVGA_mousecallback(int button, int dx, int dy,
- int u1,int u2,int u3, int u4)
-{
- if ( dx || dy ) {
- posted += SDL_PrivateMouseMotion(0, 1, dx, dy);
- }
- if ( button & MOUSE_LEFTBUTTON ) {
- if ( !(SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(1)) ) {
- posted += SDL_PrivateMouseButton(SDL_PRESSED, 1, 0, 0);
- }
- } else {
- if ( (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(1)) ) {
- posted += SDL_PrivateMouseButton(SDL_RELEASED, 1, 0, 0);
- }
- }
- if ( button & MOUSE_MIDDLEBUTTON ) {
- if ( !(SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(2)) ) {
- posted += SDL_PrivateMouseButton(SDL_PRESSED, 2, 0, 0);
- }
- } else {
- if ( (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(2)) ) {
- posted += SDL_PrivateMouseButton(SDL_RELEASED, 2, 0, 0);
- }
- }
- if ( button & MOUSE_RIGHTBUTTON ) {
- if ( !(SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(3)) ) {
- posted += SDL_PrivateMouseButton(SDL_PRESSED, 3, 0, 0);
- }
- } else {
- if ( (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(3)) ) {
- posted += SDL_PrivateMouseButton(SDL_RELEASED, 3, 0, 0);
- }
- }
-}
-
-void SVGA_keyboardcallback(int scancode, int pressed)
-{
- SDL_keysym keysym;
-
- if ( pressed ) {
- posted += SDL_PrivateKeyboard(SDL_PRESSED,
- TranslateKey(scancode, &keysym));
- } else {
- posted += SDL_PrivateKeyboard(SDL_RELEASED,
- TranslateKey(scancode, &keysym));
- }
-}
-
-void SVGA_PumpEvents(_THIS)
-{
- do {
- posted = 0;
- mouse_update();
- keyboard_update();
- } while ( posted );
-}
-
-void SVGA_InitOSKeymap(_THIS)
-{
- int i;
-
- /* Initialize the BeOS key translation table */
- for ( i=0; i<SDL_arraysize(keymap); ++i )
- keymap[i] = SDLK_UNKNOWN;
-
- keymap[SCANCODE_ESCAPE] = SDLK_ESCAPE;
- keymap[SCANCODE_1] = SDLK_1;
- keymap[SCANCODE_2] = SDLK_2;
- keymap[SCANCODE_3] = SDLK_3;
- keymap[SCANCODE_4] = SDLK_4;
- keymap[SCANCODE_5] = SDLK_5;
- keymap[SCANCODE_6] = SDLK_6;
- keymap[SCANCODE_7] = SDLK_7;
- keymap[SCANCODE_8] = SDLK_8;
- keymap[SCANCODE_9] = SDLK_9;
- keymap[SCANCODE_0] = SDLK_0;
- keymap[SCANCODE_MINUS] = SDLK_MINUS;
- keymap[SCANCODE_EQUAL] = SDLK_EQUALS;
- keymap[SCANCODE_BACKSPACE] = SDLK_BACKSPACE;
- keymap[SCANCODE_TAB] = SDLK_TAB;
- keymap[SCANCODE_Q] = SDLK_q;
- keymap[SCANCODE_W] = SDLK_w;
- keymap[SCANCODE_E] = SDLK_e;
- keymap[SCANCODE_R] = SDLK_r;
- keymap[SCANCODE_T] = SDLK_t;
- keymap[SCANCODE_Y] = SDLK_y;
- keymap[SCANCODE_U] = SDLK_u;
- keymap[SCANCODE_I] = SDLK_i;
- keymap[SCANCODE_O] = SDLK_o;
- keymap[SCANCODE_P] = SDLK_p;
- keymap[SCANCODE_BRACKET_LEFT] = SDLK_LEFTBRACKET;
- keymap[SCANCODE_BRACKET_RIGHT] = SDLK_RIGHTBRACKET;
- keymap[SCANCODE_ENTER] = SDLK_RETURN;
- keymap[SCANCODE_LEFTCONTROL] = SDLK_LCTRL;
- keymap[SCANCODE_A] = SDLK_a;
- keymap[SCANCODE_S] = SDLK_s;
- keymap[SCANCODE_D] = SDLK_d;
- keymap[SCANCODE_F] = SDLK_f;
- keymap[SCANCODE_G] = SDLK_g;
- keymap[SCANCODE_H] = SDLK_h;
- keymap[SCANCODE_J] = SDLK_j;
- keymap[SCANCODE_K] = SDLK_k;
- keymap[SCANCODE_L] = SDLK_l;
- keymap[SCANCODE_SEMICOLON] = SDLK_SEMICOLON;
- keymap[SCANCODE_APOSTROPHE] = SDLK_QUOTE;
- keymap[SCANCODE_GRAVE] = SDLK_BACKQUOTE;
- keymap[SCANCODE_LEFTSHIFT] = SDLK_LSHIFT;
- keymap[SCANCODE_BACKSLASH] = SDLK_BACKSLASH;
- keymap[SCANCODE_Z] = SDLK_z;
- keymap[SCANCODE_X] = SDLK_x;
- keymap[SCANCODE_C] = SDLK_c;
- keymap[SCANCODE_V] = SDLK_v;
- keymap[SCANCODE_B] = SDLK_b;
- keymap[SCANCODE_N] = SDLK_n;
- keymap[SCANCODE_M] = SDLK_m;
- keymap[SCANCODE_COMMA] = SDLK_COMMA;
- keymap[SCANCODE_PERIOD] = SDLK_PERIOD;
- keymap[SCANCODE_SLASH] = SDLK_SLASH;
- keymap[SCANCODE_RIGHTSHIFT] = SDLK_RSHIFT;
- keymap[SCANCODE_KEYPADMULTIPLY] = SDLK_KP_MULTIPLY;
- keymap[SCANCODE_LEFTALT] = SDLK_LALT;
- keymap[SCANCODE_SPACE] = SDLK_SPACE;
- keymap[SCANCODE_CAPSLOCK] = SDLK_CAPSLOCK;
- keymap[SCANCODE_F1] = SDLK_F1;
- keymap[SCANCODE_F2] = SDLK_F2;
- keymap[SCANCODE_F3] = SDLK_F3;
- keymap[SCANCODE_F4] = SDLK_F4;
- keymap[SCANCODE_F5] = SDLK_F5;
- keymap[SCANCODE_F6] = SDLK_F6;
- keymap[SCANCODE_F7] = SDLK_F7;
- keymap[SCANCODE_F8] = SDLK_F8;
- keymap[SCANCODE_F9] = SDLK_F9;
- keymap[SCANCODE_F10] = SDLK_F10;
- keymap[SCANCODE_NUMLOCK] = SDLK_NUMLOCK;
- keymap[SCANCODE_SCROLLLOCK] = SDLK_SCROLLOCK;
- keymap[SCANCODE_KEYPAD7] = SDLK_KP7;
- keymap[SCANCODE_CURSORUPLEFT] = SDLK_KP7;
- keymap[SCANCODE_KEYPAD8] = SDLK_KP8;
- keymap[SCANCODE_CURSORUP] = SDLK_KP8;
- keymap[SCANCODE_KEYPAD9] = SDLK_KP9;
- keymap[SCANCODE_CURSORUPRIGHT] = SDLK_KP9;
- keymap[SCANCODE_KEYPADMINUS] = SDLK_KP_MINUS;
- keymap[SCANCODE_KEYPAD4] = SDLK_KP4;
- keymap[SCANCODE_CURSORLEFT] = SDLK_KP4;
- keymap[SCANCODE_KEYPAD5] = SDLK_KP5;
- keymap[SCANCODE_KEYPAD6] = SDLK_KP6;
- keymap[SCANCODE_CURSORRIGHT] = SDLK_KP6;
- keymap[SCANCODE_KEYPADPLUS] = SDLK_KP_PLUS;
- keymap[SCANCODE_KEYPAD1] = SDLK_KP1;
- keymap[SCANCODE_CURSORDOWNLEFT] = SDLK_KP1;
- keymap[SCANCODE_KEYPAD2] = SDLK_KP2;
- keymap[SCANCODE_CURSORDOWN] = SDLK_KP2;
- keymap[SCANCODE_KEYPAD3] = SDLK_KP3;
- keymap[SCANCODE_CURSORDOWNRIGHT] = SDLK_KP3;
- keymap[SCANCODE_KEYPAD0] = SDLK_KP0;
- keymap[SCANCODE_KEYPADPERIOD] = SDLK_KP_PERIOD;
- keymap[SCANCODE_LESS] = SDLK_LESS;
- keymap[SCANCODE_F11] = SDLK_F11;
- keymap[SCANCODE_F12] = SDLK_F12;
- keymap[SCANCODE_KEYPADENTER] = SDLK_KP_ENTER;
- keymap[SCANCODE_RIGHTCONTROL] = SDLK_RCTRL;
- keymap[SCANCODE_CONTROL] = SDLK_RCTRL;
- keymap[SCANCODE_KEYPADDIVIDE] = SDLK_KP_DIVIDE;
- keymap[SCANCODE_PRINTSCREEN] = SDLK_PRINT;
- keymap[SCANCODE_RIGHTALT] = SDLK_RALT;
- keymap[SCANCODE_BREAK] = SDLK_BREAK;
- keymap[SCANCODE_BREAK_ALTERNATIVE] = SDLK_UNKNOWN;
- keymap[SCANCODE_HOME] = SDLK_HOME;
- keymap[SCANCODE_CURSORBLOCKUP] = SDLK_UP;
- keymap[SCANCODE_PAGEUP] = SDLK_PAGEUP;
- keymap[SCANCODE_CURSORBLOCKLEFT] = SDLK_LEFT;
- keymap[SCANCODE_CURSORBLOCKRIGHT] = SDLK_RIGHT;
- keymap[SCANCODE_END] = SDLK_END;
- keymap[SCANCODE_CURSORBLOCKDOWN] = SDLK_DOWN;
- keymap[SCANCODE_PAGEDOWN] = SDLK_PAGEDOWN;
- keymap[SCANCODE_INSERT] = SDLK_INSERT;
- keymap[SCANCODE_REMOVE] = SDLK_DELETE;
- keymap[119] = SDLK_PAUSE;
- keymap[SCANCODE_RIGHTWIN] = SDLK_RSUPER;
- keymap[SCANCODE_LEFTWIN] = SDLK_LSUPER;
- keymap[127] = SDLK_MENU;
-}
-
-#if defined(linux)
-static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym)
-{
- /* Set the keysym information */
- keysym->scancode = scancode;
- keysym->sym = keymap[scancode];
- keysym->mod = KMOD_NONE;
-
- /* If UNICODE is on, get the UNICODE value for the key */
- keysym->unicode = 0;
- if ( SDL_TranslateUNICODE ) {
- int map;
- SDLMod modstate;
-
- modstate = SDL_GetModState();
- map = 0;
- if ( modstate & KMOD_SHIFT ) {
- map |= (1<<KG_SHIFT);
- }
- if ( modstate & KMOD_CTRL ) {
- map |= (1<<KG_CTRL);
- }
- if ( modstate & KMOD_ALT ) {
- map |= (1<<KG_ALT);
- }
- if ( modstate & KMOD_MODE ) {
- map |= (1<<KG_ALTGR);
- }
- if ( KTYP(vga_keymap[map][scancode]) == KT_LETTER ) {
- if ( modstate & KMOD_CAPS ) {
- map ^= (1<<KG_SHIFT);
- }
- }
- if ( KTYP(vga_keymap[map][scancode]) == KT_PAD ) {
- if ( modstate & KMOD_NUM ) {
- keysym->unicode=KVAL(vga_keymap[map][scancode]);
- }
- } else {
- keysym->unicode = KVAL(vga_keymap[map][scancode]);
- }
- }
- return(keysym);
-}
-#elif defined(__FREEBSD__)
-static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym)
-{
- /* Set the keysym information */
- keysym->scancode = scancode;
- keysym->sym = keymap[scancode];
- keysym->mod = KMOD_NONE;
-
- /* If UNICODE is on, get the UNICODE value for the key */
- keysym->unicode = 0;
- if ( SDL_TranslateUNICODE && vga_keymap ) {
- int map;
- SDLMod modstate;
-
- modstate = SDL_GetModState();
- map = 0;
- if ( modstate & KMOD_SHIFT ) {
- map += 1;
- }
- if ( modstate & KMOD_CTRL ) {
- map += 2;
- }
- if ( modstate & KMOD_ALT ) {
- map += 4;
- }
- if ( !(vga_keymap->key[scancode].spcl & (0x80 >> map)) ) {
- keysym->unicode = vga_keymap->key[scancode].map[map];
- }
-
- }
- return(keysym);
-}
-#else
-#error You must choose your operating system here
-#endif
diff --git a/distrib/sdl-1.2.12/src/video/svga/SDL_svgaevents_c.h b/distrib/sdl-1.2.12/src/video/svga/SDL_svgaevents_c.h
deleted file mode 100644
index 308d9de..0000000
--- a/distrib/sdl-1.2.12/src/video/svga/SDL_svgaevents_c.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_svgavideo.h"
-
-/* Variables and functions exported by SDL_sysevents.c to other parts
- of the native video subsystem (SDL_sysvideo.c)
-*/
-extern int SVGA_initkeymaps(int fd);
-extern void SVGA_mousecallback(int button, int dx, int dy,
- int u1,int u2,int u3, int u4);
-extern void SVGA_keyboardcallback(int scancode, int pressed);
-
-extern void SVGA_InitOSKeymap(_THIS);
-extern void SVGA_PumpEvents(_THIS);
diff --git a/distrib/sdl-1.2.12/src/video/svga/SDL_svgamouse.c b/distrib/sdl-1.2.12/src/video/svga/SDL_svgamouse.c
deleted file mode 100644
index cd1cccc..0000000
--- a/distrib/sdl-1.2.12/src/video/svga/SDL_svgamouse.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_mouse.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_svgavideo.h"
-#include "SDL_svgamouse_c.h"
-
-
-/* The implementation dependent data for the window manager cursor */
-struct WMcursor {
- int unused;
-};
diff --git a/distrib/sdl-1.2.12/src/video/svga/SDL_svgamouse_c.h b/distrib/sdl-1.2.12/src/video/svga/SDL_svgamouse_c.h
deleted file mode 100644
index 623d12c..0000000
--- a/distrib/sdl-1.2.12/src/video/svga/SDL_svgamouse_c.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_svgavideo.h"
-
-/* Functions to be exported */
diff --git a/distrib/sdl-1.2.12/src/video/svga/SDL_svgavideo.c b/distrib/sdl-1.2.12/src/video/svga/SDL_svgavideo.c
deleted file mode 100644
index 53bad95..0000000
--- a/distrib/sdl-1.2.12/src/video/svga/SDL_svgavideo.c
+++ /dev/null
@@ -1,584 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* SVGAlib based SDL video driver implementation.
-*/
-
-#include <unistd.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-
-#if defined(__LINUX__)
-#include <linux/vt.h>
-#elif defined(__FREEBSD__)
-#include <sys/consio.h>
-#else
-#error You must choose your operating system here
-#endif
-#include <vga.h>
-#include <vgamouse.h>
-#include <vgakeyboard.h>
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_svgavideo.h"
-#include "SDL_svgaevents_c.h"
-#include "SDL_svgamouse_c.h"
-
-/* Initialization/Query functions */
-static int SVGA_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **SVGA_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *SVGA_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int SVGA_SetColors(_THIS, int firstcolor, int ncolors,
- SDL_Color *colors);
-static void SVGA_VideoQuit(_THIS);
-
-/* Hardware surface functions */
-static int SVGA_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int SVGA_LockHWSurface(_THIS, SDL_Surface *surface);
-static int SVGA_FlipHWSurface(_THIS, SDL_Surface *surface);
-static void SVGA_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static void SVGA_FreeHWSurface(_THIS, SDL_Surface *surface);
-
-/* SVGAlib driver bootstrap functions */
-
-static int SVGA_Available(void)
-{
- /* Check to see if we are root and stdin is a virtual console */
- int console;
-
- /* SVGALib 1.9.x+ doesn't require root (via /dev/svga) */
- int svgalib2 = -1;
-
- /* See if we are connected to a virtual terminal */
- console = STDIN_FILENO;
-#if 0 /* This is no longer needed, SVGAlib can switch consoles for us */
- if ( console >= 0 ) {
- struct stat sb;
- struct vt_mode dummy;
-
- if ( (fstat(console, &sb) < 0) ||
- (ioctl(console, VT_GETMODE, &dummy) < 0) ) {
- console = -1;
- }
- }
-#endif /* 0 */
-
- /* See if SVGAlib 2.0 is available */
- svgalib2 = open("/dev/svga", O_RDONLY);
- if (svgalib2 != -1) {
- close(svgalib2);
- }
-
- return(((svgalib2 != -1) || (geteuid() == 0)) && (console >= 0));
-}
-
-static void SVGA_DeleteDevice(SDL_VideoDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_VideoDevice *SVGA_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device ) {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *device->hidden));
- }
- if ( (device == NULL) || (device->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( device ) {
- SDL_free(device);
- }
- return(0);
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
-
- /* Set the function pointers */
- device->VideoInit = SVGA_VideoInit;
- device->ListModes = SVGA_ListModes;
- device->SetVideoMode = SVGA_SetVideoMode;
- device->SetColors = SVGA_SetColors;
- device->UpdateRects = NULL;
- device->VideoQuit = SVGA_VideoQuit;
- device->AllocHWSurface = SVGA_AllocHWSurface;
- device->CheckHWBlit = NULL;
- device->FillHWRect = NULL;
- device->SetHWColorKey = NULL;
- device->SetHWAlpha = NULL;
- device->LockHWSurface = SVGA_LockHWSurface;
- device->UnlockHWSurface = SVGA_UnlockHWSurface;
- device->FlipHWSurface = SVGA_FlipHWSurface;
- device->FreeHWSurface = SVGA_FreeHWSurface;
- device->SetCaption = NULL;
- device->SetIcon = NULL;
- device->IconifyWindow = NULL;
- device->GrabInput = NULL;
- device->GetWMInfo = NULL;
- device->InitOSKeymap = SVGA_InitOSKeymap;
- device->PumpEvents = SVGA_PumpEvents;
-
- device->free = SVGA_DeleteDevice;
-
- return device;
-}
-
-VideoBootStrap SVGALIB_bootstrap = {
- "svgalib", "SVGAlib",
- SVGA_Available, SVGA_CreateDevice
-};
-
-static int SVGA_AddMode(_THIS, int mode, int actually_add)
-{
- int i, j;
- vga_modeinfo *modeinfo;
-
- modeinfo = vga_getmodeinfo(mode);
-
- i = modeinfo->bytesperpixel-1;
- if ( i < 0 ) {
- return 0;
- }
- if ( actually_add ) {
- SDL_Rect saved_rect[2];
- int saved_mode[2];
- int b;
-
- /* Add the mode, sorted largest to smallest */
- b = 0;
- j = 0;
- while ( (SDL_modelist[i][j]->w > modeinfo->width) ||
- (SDL_modelist[i][j]->h > modeinfo->height) ) {
- ++j;
- }
- /* Skip modes that are already in our list */
- if ( (SDL_modelist[i][j]->w == modeinfo->width) &&
- (SDL_modelist[i][j]->h == modeinfo->height) ) {
- return(0);
- }
- /* Insert the new mode */
- saved_rect[b] = *SDL_modelist[i][j];
- saved_mode[b] = SDL_vgamode[i][j];
- SDL_modelist[i][j]->w = modeinfo->width;
- SDL_modelist[i][j]->h = modeinfo->height;
- SDL_vgamode[i][j] = mode;
- /* Everybody scoot down! */
- if ( saved_rect[b].w && saved_rect[b].h ) {
- for ( ++j; SDL_modelist[i][j]->w; ++j ) {
- saved_rect[!b] = *SDL_modelist[i][j];
- saved_mode[!b] = SDL_vgamode[i][j];
- *SDL_modelist[i][j] = saved_rect[b];
- SDL_vgamode[i][j] = saved_mode[b];
- b = !b;
- }
- *SDL_modelist[i][j] = saved_rect[b];
- SDL_vgamode[i][j] = saved_mode[b];
- }
- } else {
- ++SDL_nummodes[i];
- }
- return(1);
-}
-
-static void SVGA_UpdateVideoInfo(_THIS)
-{
- vga_modeinfo *modeinfo;
-
- this->info.wm_available = 0;
- this->info.hw_available = (banked ? 0 : 1);
- modeinfo = vga_getmodeinfo(vga_getcurrentmode());
- this->info.video_mem = modeinfo->memory;
- /* FIXME: Add hardware accelerated blit information */
-#ifdef SVGALIB_DEBUG
- printf("Hardware accelerated blit: %savailable\n", modeinfo->haveblit ? "" : "not ");
-#endif
-}
-
-int SVGA_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- int keyboard;
- int i, j;
- int mode, total_modes;
-
- /* Initialize all variables that we clean on shutdown */
- for ( i=0; i<NUM_MODELISTS; ++i ) {
- SDL_nummodes[i] = 0;
- SDL_modelist[i] = NULL;
- SDL_vgamode[i] = NULL;
- }
-
- /* Initialize the library */
- vga_disabledriverreport();
- if ( vga_init() < 0 ) {
- SDL_SetError("Unable to initialize SVGAlib");
- return(-1);
- }
- vga_setmode(TEXT);
-
- /* Enable mouse and keyboard support */
- vga_setmousesupport(1);
- keyboard = keyboard_init_return_fd();
- if ( keyboard < 0 ) {
- SDL_SetError("Unable to initialize keyboard");
- return(-1);
- }
- if ( SVGA_initkeymaps(keyboard) < 0 ) {
- return(-1);
- }
- keyboard_seteventhandler(SVGA_keyboardcallback);
-
- /* Determine the current screen size */
- this->info.current_w = 0;
- this->info.current_h = 0;
-
- /* Determine the screen depth (use default 8-bit depth) */
- vformat->BitsPerPixel = 8;
-
- /* Enumerate the available fullscreen modes */
- total_modes = 0;
- for ( mode=vga_lastmodenumber(); mode; --mode ) {
- if ( vga_hasmode(mode) ) {
- if ( SVGA_AddMode(this, mode, 0) ) {
- ++total_modes;
- }
- }
- }
- if ( SVGA_AddMode(this, G320x200x256, 0) ) ++total_modes;
- if ( total_modes == 0 ) {
- SDL_SetError("No linear video modes available");
- return(-1);
- }
- for ( i=0; i<NUM_MODELISTS; ++i ) {
- SDL_vgamode[i] = (int *)SDL_malloc(SDL_nummodes[i]*sizeof(int));
- if ( SDL_vgamode[i] == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
- SDL_modelist[i] = (SDL_Rect **)
- SDL_malloc((SDL_nummodes[i]+1)*sizeof(SDL_Rect *));
- if ( SDL_modelist[i] == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
- for ( j=0; j<SDL_nummodes[i]; ++j ) {
- SDL_modelist[i][j]=(SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
- if ( SDL_modelist[i][j] == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
- SDL_memset(SDL_modelist[i][j], 0, sizeof(SDL_Rect));
- }
- SDL_modelist[i][j] = NULL;
- }
- for ( mode=vga_lastmodenumber(); mode; --mode ) {
- if ( vga_hasmode(mode) ) {
- SVGA_AddMode(this, mode, 1);
- }
- }
- SVGA_AddMode(this, G320x200x256, 1);
-
- /* Free extra (duplicated) modes */
- for ( i=0; i<NUM_MODELISTS; ++i ) {
- j = 0;
- while ( SDL_modelist[i][j] && SDL_modelist[i][j]->w ) {
- j++;
- }
- while ( SDL_modelist[i][j] ) {
- SDL_free(SDL_modelist[i][j]);
- SDL_modelist[i][j] = NULL;
- j++;
- }
- }
-
- /* Fill in our hardware acceleration capabilities */
- SVGA_UpdateVideoInfo(this);
-
- /* We're done! */
- return(0);
-}
-
-SDL_Rect **SVGA_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- return(SDL_modelist[((format->BitsPerPixel+7)/8)-1]);
-}
-
-/* Various screen update functions available */
-static void SVGA_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
-static void SVGA_BankedUpdate(_THIS, int numrects, SDL_Rect *rects);
-
-SDL_Surface *SVGA_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- int mode;
- int vgamode;
- vga_modeinfo *modeinfo;
- int screenpage_len;
-
- /* Free old pixels if we were in banked mode */
- if ( banked && current->pixels ) {
- free(current->pixels);
- current->pixels = NULL;
- }
-
- /* Try to set the requested linear video mode */
- bpp = (bpp+7)/8-1;
- for ( mode=0; SDL_modelist[bpp][mode]; ++mode ) {
- if ( (SDL_modelist[bpp][mode]->w == width) &&
- (SDL_modelist[bpp][mode]->h == height) ) {
- break;
- }
- }
- if ( SDL_modelist[bpp][mode] == NULL ) {
- SDL_SetError("Couldn't find requested mode in list");
- return(NULL);
- }
- vgamode = SDL_vgamode[bpp][mode];
- vga_setmode(vgamode);
- vga_setpage(0);
-
- if ( (vga_setlinearaddressing() < 0) && (vgamode != G320x200x256) ) {
- banked = 1;
- } else {
- banked = 0;
- }
-
- modeinfo = vga_getmodeinfo(SDL_vgamode[bpp][mode]);
-
- /* Update hardware acceleration info */
- SVGA_UpdateVideoInfo(this);
-
- /* Allocate the new pixel format for the screen */
- bpp = (bpp+1)*8;
- if ( (bpp == 16) && (modeinfo->colors == 32768) ) {
- bpp = 15;
- }
- if ( ! SDL_ReallocFormat(current, bpp, 0, 0, 0, 0) ) {
- return(NULL);
- }
-
- /* Set up the new mode framebuffer */
- current->flags = SDL_FULLSCREEN;
- if ( !banked ) {
- current->flags |= SDL_HWSURFACE;
- }
- if ( bpp == 8 ) {
- /* FIXME: What about DirectColor? */
- current->flags |= SDL_HWPALETTE;
- }
- current->w = width;
- current->h = height;
- current->pitch = modeinfo->linewidth;
- if ( banked ) {
- current->pixels = SDL_malloc(current->h * current->pitch);
- if ( !current->pixels ) {
- SDL_OutOfMemory();
- return(NULL);
- }
- } else {
- current->pixels = vga_getgraphmem();
- }
-
- /* set double-buffering */
- if ( (flags & SDL_DOUBLEBUF) && !banked )
- {
- /* length of one screen page in bytes */
- screenpage_len=current->h*modeinfo->linewidth;
-
- /* if start address should be aligned */
- if ( modeinfo->linewidth_unit )
- {
- if ( screenpage_len % modeinfo->linewidth_unit )
- {
- screenpage_len += modeinfo->linewidth_unit - ( screenpage_len % modeinfo->linewidth_unit );
- }
- }
-
- /* if we heve enough videomemory = ak je dost videopamete */
- if ( modeinfo->memory > ( screenpage_len * 2 / 1024 ) )
- {
- current->flags |= SDL_DOUBLEBUF;
- flip_page = 0;
- flip_offset[0] = 0;
- flip_offset[1] = screenpage_len;
- flip_address[0] = vga_getgraphmem();
- flip_address[1] = flip_address[0]+screenpage_len;
- SVGA_FlipHWSurface(this,current);
- }
- }
-
- /* Set the blit function */
- if ( banked ) {
- this->UpdateRects = SVGA_BankedUpdate;
- } else {
- this->UpdateRects = SVGA_DirectUpdate;
- }
-
- /* Set up the mouse handler again (buggy SVGAlib 1.40) */
- mouse_seteventhandler(SVGA_mousecallback);
-
- /* We're done */
- return(current);
-}
-
-/* We don't actually allow hardware surfaces other than the main one */
-static int SVGA_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- return(-1);
-}
-static void SVGA_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-/* We need to wait for vertical retrace on page flipped displays */
-static int SVGA_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- /* The waiting is done in SVGA_FlipHWSurface() */
- return(0);
-}
-static void SVGA_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-static int SVGA_FlipHWSurface(_THIS, SDL_Surface *surface)
-{
- if ( !banked ) {
- vga_setdisplaystart(flip_offset[flip_page]);
- flip_page=!flip_page;
- surface->pixels=flip_address[flip_page];
- vga_waitretrace();
- }
- return(0);
-}
-
-static void SVGA_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- return;
-}
-
-static void SVGA_BankedUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- int i, j;
- SDL_Rect *rect;
- int page, vp;
- int x, y, w, h;
- unsigned char *src;
- unsigned char *dst;
- int bpp = this->screen->format->BytesPerPixel;
- int pitch = this->screen->pitch;
-
- dst = vga_getgraphmem();
- for ( i=0; i < numrects; ++i ) {
- rect = &rects[i];
- x = rect->x;
- y = rect->y;
- w = rect->w * bpp;
- h = rect->h;
-
- vp = y * pitch + x * bpp;
- src = (unsigned char *)this->screen->pixels + vp;
- page = vp >> 16;
- vp &= 0xffff;
- vga_setpage(page);
- for (j = 0; j < h; j++) {
- if (vp + w > 0x10000) {
- if (vp >= 0x10000) {
- page++;
- vga_setpage(page);
- vp &= 0xffff;
- } else {
- SDL_memcpy(dst + vp, src, 0x10000 - vp);
- page++;
- vga_setpage(page);
- SDL_memcpy(dst, src + 0x10000 - vp,
- (vp + w) & 0xffff);
- vp = (vp + pitch) & 0xffff;
- src += pitch;
- continue;
- }
- }
- SDL_memcpy(dst + vp, src, w);
- src += pitch;
- vp += pitch;
- }
- }
-}
-
-int SVGA_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- int i;
-
- for(i = 0; i < ncolors; i++) {
- vga_setpalette(firstcolor + i,
- colors[i].r>>2,
- colors[i].g>>2,
- colors[i].b>>2);
- }
- return(1);
-}
-
-/* Note: If we are terminated, this could be called in the middle of
- another SDL video routine -- notably UpdateRects.
-*/
-void SVGA_VideoQuit(_THIS)
-{
- int i, j;
-
- /* Reset the console video mode */
- if ( this->screen && (this->screen->w && this->screen->h) ) {
- vga_setmode(TEXT);
- }
- keyboard_close();
-
- /* Free video mode lists */
- for ( i=0; i<NUM_MODELISTS; ++i ) {
- if ( SDL_modelist[i] != NULL ) {
- for ( j=0; SDL_modelist[i][j]; ++j )
- SDL_free(SDL_modelist[i][j]);
- SDL_free(SDL_modelist[i]);
- SDL_modelist[i] = NULL;
- }
- if ( SDL_vgamode[i] != NULL ) {
- SDL_free(SDL_vgamode[i]);
- SDL_vgamode[i] = NULL;
- }
- }
- if ( this->screen ) {
- if ( banked && this->screen->pixels ) {
- SDL_free(this->screen->pixels);
- }
- this->screen->pixels = NULL;
- }
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/svga/SDL_svgavideo.h b/distrib/sdl-1.2.12/src/video/svga/SDL_svgavideo.h
deleted file mode 100644
index 0d5e9ee..0000000
--- a/distrib/sdl-1.2.12/src/video/svga/SDL_svgavideo.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_svgavideo_h
-#define _SDL_svgavideo_h
-
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-/* Private display data */
-struct SDL_PrivateVideoData {
-#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
- int SDL_nummodes[NUM_MODELISTS];
- SDL_Rect **SDL_modelist[NUM_MODELISTS];
- int *SDL_vgamode[NUM_MODELISTS];
-
- /* information for double-buffering */
- int flip_page;
- int flip_offset[2];
- Uint8 *flip_address[2];
-
- /* Set to 1 if we're in banked video mode */
- int banked;
-};
-/* Old variable names */
-#define SDL_nummodes (this->hidden->SDL_nummodes)
-#define SDL_modelist (this->hidden->SDL_modelist)
-#define SDL_vgamode (this->hidden->SDL_vgamode)
-#define flip_page (this->hidden->flip_page)
-#define flip_offset (this->hidden->flip_offset)
-#define flip_address (this->hidden->flip_address)
-#define banked (this->hidden->banked)
-
-#endif /* _SDL_svgavideo_h */
-
diff --git a/distrib/sdl-1.2.12/src/video/vgl/SDL_vglevents.c b/distrib/sdl-1.2.12/src/video/vgl/SDL_vglevents.c
deleted file mode 100644
index 7efbe2a..0000000
--- a/distrib/sdl-1.2.12/src/video/vgl/SDL_vglevents.c
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Handle the event stream, converting X11 events into SDL events */
-
-#include <stdio.h>
-
-#include <sys/fbio.h>
-#include <sys/consio.h>
-#include <sys/kbio.h>
-#include <vgl.h>
-
-#include "SDL.h"
-#include "SDL_thread.h"
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_vglvideo.h"
-#include "SDL_vglevents_c.h"
-
-/* The translation tables from a console scancode to a SDL keysym */
-/* FIXME: Free the keymap when we shut down the video mode */
-static keymap_t *vga_keymap = NULL;
-static SDLKey keymap[128];
-static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym);
-
-static int posted = 0;
-static int oldx = -1;
-static int oldy = -1;
-static struct mouse_info mouseinfo;
-
-/* Ugh, we have to duplicate the kernel's keysym mapping code...
- Oh, it's not so bad. :-)
-
- FIXME: Add keyboard LED handling code
- */
-int VGL_initkeymaps(int fd)
-{
- vga_keymap = SDL_malloc(sizeof(keymap_t));
- if ( ! vga_keymap ) {
- SDL_OutOfMemory();
- return(-1);
- }
- if (ioctl(fd, GIO_KEYMAP, vga_keymap) == -1) {
- SDL_free(vga_keymap);
- vga_keymap = NULL;
- SDL_SetError("Unable to get keyboard map");
- return(-1);
- }
- return(0);
-}
-
-static void handle_keyboard(_THIS)
-{
- SDL_keysym keysym;
- int c, pressed, scancode;
-
- while ((c = VGLKeyboardGetCh()) != 0) {
- scancode = c & 0x7F;
- if (c & 0x80) {
- pressed = SDL_RELEASED;
- } else {
- pressed = SDL_PRESSED;
- }
-
- posted += SDL_PrivateKeyboard(pressed,
- TranslateKey(scancode, &keysym));
- }
-}
-
-int VGL_initmouse(int fd)
-{
- mouseinfo.operation = MOUSE_GETINFO;
- if (ioctl(fd, CONS_MOUSECTL, &mouseinfo) != 0)
- return -1;
-
- return 0;
-}
-
-static void handle_mouse(_THIS)
-{
- char buttons;
- int x, y;
- int button_state, state_changed, state;
- int i;
-
- ioctl(0, CONS_MOUSECTL, &mouseinfo);
- x = mouseinfo.u.data.x;
- y = mouseinfo.u.data.y;
- buttons = mouseinfo.u.data.buttons;
-
- if ((x != oldx) || (y != oldy)) {
- posted += SDL_PrivateMouseMotion(0, 0, x, y);
- oldx = x;
- oldy = y;
- }
-
- /* See what's changed */
- button_state = SDL_GetMouseState(NULL, NULL);
- state_changed = button_state ^ buttons;
- for (i = 0; i < 8; i++) {
- if (state_changed & (1<<i)) {
- if (buttons & (1<<i)) {
- state = SDL_PRESSED;
- } else {
- state = SDL_RELEASED;
- }
- posted += SDL_PrivateMouseButton(state, i + 1, 0, 0);
- }
- }
-}
-
-
-void VGL_PumpEvents(_THIS)
-{
- do {
- posted = 0;
- handle_keyboard(this);
- handle_mouse(this);
- } while (posted != 0);
-}
-
-void VGL_InitOSKeymap(_THIS)
-{
- int i;
-
- /* Initialize the BeOS key translation table */
- for ( i=0; i<SDL_arraysize(keymap); ++i )
- keymap[i] = SDLK_UNKNOWN;
-
- keymap[SCANCODE_ESCAPE] = SDLK_ESCAPE;
- keymap[SCANCODE_1] = SDLK_1;
- keymap[SCANCODE_2] = SDLK_2;
- keymap[SCANCODE_3] = SDLK_3;
- keymap[SCANCODE_4] = SDLK_4;
- keymap[SCANCODE_5] = SDLK_5;
- keymap[SCANCODE_6] = SDLK_6;
- keymap[SCANCODE_7] = SDLK_7;
- keymap[SCANCODE_8] = SDLK_8;
- keymap[SCANCODE_9] = SDLK_9;
- keymap[SCANCODE_0] = SDLK_0;
- keymap[SCANCODE_MINUS] = SDLK_MINUS;
- keymap[SCANCODE_EQUAL] = SDLK_EQUALS;
- keymap[SCANCODE_BACKSPACE] = SDLK_BACKSPACE;
- keymap[SCANCODE_TAB] = SDLK_TAB;
- keymap[SCANCODE_Q] = SDLK_q;
- keymap[SCANCODE_W] = SDLK_w;
- keymap[SCANCODE_E] = SDLK_e;
- keymap[SCANCODE_R] = SDLK_r;
- keymap[SCANCODE_T] = SDLK_t;
- keymap[SCANCODE_Y] = SDLK_y;
- keymap[SCANCODE_U] = SDLK_u;
- keymap[SCANCODE_I] = SDLK_i;
- keymap[SCANCODE_O] = SDLK_o;
- keymap[SCANCODE_P] = SDLK_p;
- keymap[SCANCODE_BRACKET_LEFT] = SDLK_LEFTBRACKET;
- keymap[SCANCODE_BRACKET_RIGHT] = SDLK_RIGHTBRACKET;
- keymap[SCANCODE_ENTER] = SDLK_RETURN;
- keymap[SCANCODE_LEFTCONTROL] = SDLK_LCTRL;
- keymap[SCANCODE_A] = SDLK_a;
- keymap[SCANCODE_S] = SDLK_s;
- keymap[SCANCODE_D] = SDLK_d;
- keymap[SCANCODE_F] = SDLK_f;
- keymap[SCANCODE_G] = SDLK_g;
- keymap[SCANCODE_H] = SDLK_h;
- keymap[SCANCODE_J] = SDLK_j;
- keymap[SCANCODE_K] = SDLK_k;
- keymap[SCANCODE_L] = SDLK_l;
- keymap[SCANCODE_SEMICOLON] = SDLK_SEMICOLON;
- keymap[SCANCODE_APOSTROPHE] = SDLK_QUOTE;
- keymap[SCANCODE_GRAVE] = SDLK_BACKQUOTE;
- keymap[SCANCODE_LEFTSHIFT] = SDLK_LSHIFT;
- keymap[SCANCODE_BACKSLASH] = SDLK_BACKSLASH;
- keymap[SCANCODE_Z] = SDLK_z;
- keymap[SCANCODE_X] = SDLK_x;
- keymap[SCANCODE_C] = SDLK_c;
- keymap[SCANCODE_V] = SDLK_v;
- keymap[SCANCODE_B] = SDLK_b;
- keymap[SCANCODE_N] = SDLK_n;
- keymap[SCANCODE_M] = SDLK_m;
- keymap[SCANCODE_COMMA] = SDLK_COMMA;
- keymap[SCANCODE_PERIOD] = SDLK_PERIOD;
- keymap[SCANCODE_SLASH] = SDLK_SLASH;
- keymap[SCANCODE_RIGHTSHIFT] = SDLK_RSHIFT;
- keymap[SCANCODE_KEYPADMULTIPLY] = SDLK_KP_MULTIPLY;
- keymap[SCANCODE_LEFTALT] = SDLK_LALT;
- keymap[SCANCODE_SPACE] = SDLK_SPACE;
- keymap[SCANCODE_CAPSLOCK] = SDLK_CAPSLOCK;
- keymap[SCANCODE_F1] = SDLK_F1;
- keymap[SCANCODE_F2] = SDLK_F2;
- keymap[SCANCODE_F3] = SDLK_F3;
- keymap[SCANCODE_F4] = SDLK_F4;
- keymap[SCANCODE_F5] = SDLK_F5;
- keymap[SCANCODE_F6] = SDLK_F6;
- keymap[SCANCODE_F7] = SDLK_F7;
- keymap[SCANCODE_F8] = SDLK_F8;
- keymap[SCANCODE_F9] = SDLK_F9;
- keymap[SCANCODE_F10] = SDLK_F10;
- keymap[SCANCODE_NUMLOCK] = SDLK_NUMLOCK;
- keymap[SCANCODE_SCROLLLOCK] = SDLK_SCROLLOCK;
- keymap[SCANCODE_KEYPAD7] = SDLK_KP7;
- keymap[SCANCODE_CURSORUPLEFT] = SDLK_KP7;
- keymap[SCANCODE_KEYPAD8] = SDLK_KP8;
- keymap[SCANCODE_CURSORUP] = SDLK_KP8;
- keymap[SCANCODE_KEYPAD9] = SDLK_KP9;
- keymap[SCANCODE_CURSORUPRIGHT] = SDLK_KP9;
- keymap[SCANCODE_KEYPADMINUS] = SDLK_KP_MINUS;
- keymap[SCANCODE_KEYPAD4] = SDLK_KP4;
- keymap[SCANCODE_CURSORLEFT] = SDLK_KP4;
- keymap[SCANCODE_KEYPAD5] = SDLK_KP5;
- keymap[SCANCODE_KEYPAD6] = SDLK_KP6;
- keymap[SCANCODE_CURSORRIGHT] = SDLK_KP6;
- keymap[SCANCODE_KEYPADPLUS] = SDLK_KP_PLUS;
- keymap[SCANCODE_KEYPAD1] = SDLK_KP1;
- keymap[SCANCODE_CURSORDOWNLEFT] = SDLK_KP1;
- keymap[SCANCODE_KEYPAD2] = SDLK_KP2;
- keymap[SCANCODE_CURSORDOWN] = SDLK_KP2;
- keymap[SCANCODE_KEYPAD3] = SDLK_KP3;
- keymap[SCANCODE_CURSORDOWNRIGHT] = SDLK_KP3;
- keymap[SCANCODE_KEYPAD0] = SDLK_KP0;
- keymap[SCANCODE_KEYPADPERIOD] = SDLK_KP_PERIOD;
- keymap[SCANCODE_LESS] = SDLK_LESS;
- keymap[SCANCODE_F11] = SDLK_F11;
- keymap[SCANCODE_F12] = SDLK_F12;
- keymap[SCANCODE_KEYPADENTER] = SDLK_KP_ENTER;
- keymap[SCANCODE_RIGHTCONTROL] = SDLK_RCTRL;
- keymap[SCANCODE_CONTROL] = SDLK_RCTRL;
- keymap[SCANCODE_KEYPADDIVIDE] = SDLK_KP_DIVIDE;
- keymap[SCANCODE_PRINTSCREEN] = SDLK_PRINT;
- keymap[SCANCODE_RIGHTALT] = SDLK_RALT;
- keymap[SCANCODE_BREAK] = SDLK_BREAK;
- keymap[SCANCODE_BREAK_ALTERNATIVE] = SDLK_UNKNOWN;
- keymap[SCANCODE_HOME] = SDLK_HOME;
- keymap[SCANCODE_CURSORBLOCKUP] = SDLK_UP;
- keymap[SCANCODE_PAGEUP] = SDLK_PAGEUP;
- keymap[SCANCODE_CURSORBLOCKLEFT] = SDLK_LEFT;
- keymap[SCANCODE_CURSORBLOCKRIGHT] = SDLK_RIGHT;
- keymap[SCANCODE_END] = SDLK_END;
- keymap[SCANCODE_CURSORBLOCKDOWN] = SDLK_DOWN;
- keymap[SCANCODE_PAGEDOWN] = SDLK_PAGEDOWN;
- keymap[SCANCODE_INSERT] = SDLK_INSERT;
- keymap[SCANCODE_REMOVE] = SDLK_DELETE;
- keymap[119] = SDLK_PAUSE;
- keymap[SCANCODE_RIGHTWIN] = SDLK_RSUPER;
- keymap[SCANCODE_LEFTWIN] = SDLK_LSUPER;
- keymap[127] = SDLK_MENU;
-}
-
-static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym)
-{
- /* Set the keysym information */
- keysym->scancode = scancode;
- keysym->sym = keymap[scancode];
- keysym->mod = KMOD_NONE;
-
- /* If UNICODE is on, get the UNICODE value for the key */
- keysym->unicode = 0;
- if ( SDL_TranslateUNICODE && vga_keymap ) {
- int map;
- SDLMod modstate;
-
- modstate = SDL_GetModState();
- map = 0;
- if ( modstate & KMOD_SHIFT ) {
- map += 1;
- }
- if ( modstate & KMOD_CTRL ) {
- map += 2;
- }
- if ( modstate & KMOD_ALT ) {
- map += 4;
- }
- if ( !(vga_keymap->key[scancode].spcl & (0x80 >> map)) ) {
- keysym->unicode = vga_keymap->key[scancode].map[map];
- }
-
- }
- return(keysym);
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/vgl/SDL_vglevents_c.h b/distrib/sdl-1.2.12/src/video/vgl/SDL_vglevents_c.h
deleted file mode 100644
index be1c907..0000000
--- a/distrib/sdl-1.2.12/src/video/vgl/SDL_vglevents_c.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_vglvideo.h"
-
-/* Variables and functions exported by SDL_sysevents.c to other parts
- of the native video subsystem (SDL_sysvideo.c)
-*/
-extern int VGL_initkeymaps(int fd);
-extern int VGL_initmouse(int fd);
-extern void VGL_keyboardcallback(int scancode, int pressed);
-
-extern void VGL_InitOSKeymap(_THIS);
-extern void VGL_PumpEvents(_THIS);
-
-/* Mouse buttons */
-#define MOUSE_LEFTBUTTON 0x01
-#define MOUSE_MIDDLEBUTTON 0x02
-#define MOUSE_RIGHTBUTTON 0x04
-
-/* Scancodes */
-#define SCANCODE_ESCAPE 1
-#define SCANCODE_1 2
-#define SCANCODE_2 3
-#define SCANCODE_3 4
-#define SCANCODE_4 5
-#define SCANCODE_5 6
-#define SCANCODE_6 7
-#define SCANCODE_7 8
-#define SCANCODE_8 9
-#define SCANCODE_9 10
-#define SCANCODE_0 11
-#define SCANCODE_MINUS 12
-#define SCANCODE_EQUAL 13
-#define SCANCODE_BACKSPACE 14
-#define SCANCODE_TAB 15
-#define SCANCODE_Q 16
-#define SCANCODE_W 17
-#define SCANCODE_E 18
-#define SCANCODE_R 19
-#define SCANCODE_T 20
-#define SCANCODE_Y 21
-#define SCANCODE_U 22
-#define SCANCODE_I 23
-#define SCANCODE_O 24
-#define SCANCODE_P 25
-#define SCANCODE_BRACKET_LEFT 26
-#define SCANCODE_BRACKET_RIGHT 27
-#define SCANCODE_ENTER 28
-#define SCANCODE_LEFTCONTROL 29
-#define SCANCODE_A 30
-#define SCANCODE_S 31
-#define SCANCODE_D 32
-#define SCANCODE_F 33
-#define SCANCODE_G 34
-#define SCANCODE_H 35
-#define SCANCODE_J 36
-#define SCANCODE_K 37
-#define SCANCODE_L 38
-#define SCANCODE_SEMICOLON 39
-#define SCANCODE_APOSTROPHE 40
-#define SCANCODE_GRAVE 41
-#define SCANCODE_LEFTSHIFT 42
-#define SCANCODE_BACKSLASH 43
-#define SCANCODE_Z 44
-#define SCANCODE_X 45
-#define SCANCODE_C 46
-#define SCANCODE_V 47
-#define SCANCODE_B 48
-#define SCANCODE_N 49
-#define SCANCODE_M 50
-#define SCANCODE_COMMA 51
-#define SCANCODE_PERIOD 52
-#define SCANCODE_SLASH 53
-#define SCANCODE_RIGHTSHIFT 54
-#define SCANCODE_KEYPADMULTIPLY 55
-#define SCANCODE_LEFTALT 56
-#define SCANCODE_SPACE 57
-#define SCANCODE_CAPSLOCK 58
-#define SCANCODE_F1 59
-#define SCANCODE_F2 60
-#define SCANCODE_F3 61
-#define SCANCODE_F4 62
-#define SCANCODE_F5 63
-#define SCANCODE_F6 64
-#define SCANCODE_F7 65
-#define SCANCODE_F8 66
-#define SCANCODE_F9 67
-#define SCANCODE_F10 68
-#define SCANCODE_NUMLOCK 69
-#define SCANCODE_SCROLLLOCK 70
-#define SCANCODE_KEYPAD7 71
-#define SCANCODE_CURSORUPLEFT 71
-#define SCANCODE_KEYPAD8 72
-#define SCANCODE_CURSORUP 72
-#define SCANCODE_KEYPAD9 73
-#define SCANCODE_CURSORUPRIGHT 73
-#define SCANCODE_KEYPADMINUS 74
-#define SCANCODE_KEYPAD4 75
-#define SCANCODE_CURSORLEFT 75
-#define SCANCODE_KEYPAD5 76
-#define SCANCODE_KEYPAD6 77
-#define SCANCODE_CURSORRIGHT 77
-#define SCANCODE_KEYPADPLUS 78
-#define SCANCODE_KEYPAD1 79
-#define SCANCODE_CURSORDOWNLEFT 79
-#define SCANCODE_KEYPAD2 80
-#define SCANCODE_CURSORDOWN 80
-#define SCANCODE_KEYPAD3 81
-#define SCANCODE_CURSORDOWNRIGHT 81
-#define SCANCODE_KEYPAD0 82
-#define SCANCODE_KEYPADPERIOD 83
-#define SCANCODE_LESS 86
-#define SCANCODE_F11 87
-#define SCANCODE_F12 88
-#define SCANCODE_KEYPADENTER 89
-#define SCANCODE_RIGHTCONTROL 90
-#define SCANCODE_CONTROL 107
-#define SCANCODE_KEYPADDIVIDE 91
-#define SCANCODE_PRINTSCREEN 92
-#define SCANCODE_RIGHTALT 93
-#define SCANCODE_BREAK 104 /* Beware: is 119 */
-#define SCANCODE_BREAK_ALTERNATIVE 104 /* on some keyboards! */
-#define SCANCODE_HOME 94
-#define SCANCODE_CURSORBLOCKUP 95 /* Cursor key block */
-#define SCANCODE_PAGEUP 96
-#define SCANCODE_CURSORBLOCKLEFT 97 /* Cursor key block */
-#define SCANCODE_CURSORBLOCKRIGHT 98 /* Cursor key block */
-#define SCANCODE_END 99
-#define SCANCODE_CURSORBLOCKDOWN 100 /* Cursor key block */
-#define SCANCODE_PAGEDOWN 101
-#define SCANCODE_INSERT 102
-#define SCANCODE_REMOVE 103
-#define SCANCODE_RIGHTWIN 106
-#define SCANCODE_LEFTWIN 105
diff --git a/distrib/sdl-1.2.12/src/video/vgl/SDL_vglmouse.c b/distrib/sdl-1.2.12/src/video/vgl/SDL_vglmouse.c
deleted file mode 100644
index ab8edd2..0000000
--- a/distrib/sdl-1.2.12/src/video/vgl/SDL_vglmouse.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_mouse.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_vglvideo.h"
-#include "SDL_vglmouse_c.h"
-
-
-/* The implementation dependent data for the window manager cursor */
-struct WMcursor {
- int unused;
-};
-
-
-void VGL_FreeWMCursor(_THIS, WMcursor *cursor)
-{
- return;
-}
-
-WMcursor *VGL_CreateWMCursor(_THIS,
- Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
-{
- return(NULL);
-}
-
-int VGL_ShowWMCursor(_THIS, WMcursor *cursor)
-{
- return(0);
-}
-
-void VGL_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
-{
- SDL_PrivateMouseMotion(0, 0, x, y);
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/vgl/SDL_vglmouse_c.h b/distrib/sdl-1.2.12/src/video/vgl/SDL_vglmouse_c.h
deleted file mode 100644
index 91e010b..0000000
--- a/distrib/sdl-1.2.12/src/video/vgl/SDL_vglmouse_c.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_vglvideo.h"
-
-/* Functions to be exported */
-extern void VGL_FreeWMCursor(_THIS, WMcursor *cursor);
-extern WMcursor *VGL_CreateWMCursor(_THIS,
- Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
-extern int VGL_ShowWMCursor(_THIS, WMcursor *cursor);
-extern void VGL_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
-
diff --git a/distrib/sdl-1.2.12/src/video/vgl/SDL_vglvideo.c b/distrib/sdl-1.2.12/src/video/vgl/SDL_vglvideo.c
deleted file mode 100644
index db25e51..0000000
--- a/distrib/sdl-1.2.12/src/video/vgl/SDL_vglvideo.c
+++ /dev/null
@@ -1,640 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* libvga based SDL video driver implementation.
-*/
-
-#include <err.h>
-#include <osreldate.h>
-#include <unistd.h>
-#include <sys/stat.h>
-
-#include <sys/fbio.h>
-#include <sys/consio.h>
-#include <sys/kbio.h>
-#include <vgl.h>
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_vglvideo.h"
-#include "SDL_vglevents_c.h"
-#include "SDL_vglmouse_c.h"
-
-
-/* Initialization/Query functions */
-static int VGL_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **VGL_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *VGL_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int VGL_SetColors(_THIS, int firstcolor, int ncolors,
- SDL_Color *colors);
-static void VGL_VideoQuit(_THIS);
-
-/* Hardware surface functions */
-static int VGL_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int VGL_LockHWSurface(_THIS, SDL_Surface *surface);
-static int VGL_FlipHWSurface(_THIS, SDL_Surface *surface);
-static void VGL_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static void VGL_FreeHWSurface(_THIS, SDL_Surface *surface);
-
-/* Misc function */
-static VGLMode ** VGLListModes(int depth, int mem_model);
-static void VGLWaitRetrace(void);
-
-/* VGL driver bootstrap functions */
-
-static int VGL_Available(void)
-{
- /*
- * Check to see if we are root and stdin is a
- * virtual console. Also try to ensure that
- * modes other than 320x200 are available
- */
- int console, hires_available, i;
- VGLMode **modes;
-
- console = STDIN_FILENO;
- if ( console >= 0 ) {
- struct stat sb;
- struct vt_mode dummy;
-
- if ( (fstat(console, &sb) < 0) ||
- (ioctl(console, VT_GETMODE, &dummy) < 0) ) {
- console = -1;
- }
- }
- if (geteuid() != 0 && console == -1)
- return 0;
-
- modes = VGLListModes(8, V_INFO_MM_DIRECT | V_INFO_MM_PACKED);
- hires_available = 0;
- for (i = 0; modes[i] != NULL; i++) {
- if ((modes[i]->ModeInfo.Xsize > 320) &&
- (modes[i]->ModeInfo.Ysize > 200) &&
- ((modes[i]->ModeInfo.Type == VIDBUF8) ||
- (modes[i]->ModeInfo.Type == VIDBUF16) ||
- (modes[i]->ModeInfo.Type == VIDBUF32))) {
- hires_available = 1;
- break;
- }
- }
- return hires_available;
-}
-
-static void VGL_DeleteDevice(SDL_VideoDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_VideoDevice *VGL_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device ) {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *device->hidden));
- }
- if ( (device == NULL) || (device->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( device ) {
- SDL_free(device);
- }
- return(0);
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
-
- /* Set the function pointers */
- device->VideoInit = VGL_VideoInit;
- device->ListModes = VGL_ListModes;
- device->SetVideoMode = VGL_SetVideoMode;
- device->SetColors = VGL_SetColors;
- device->UpdateRects = NULL;
- device->VideoQuit = VGL_VideoQuit;
- device->AllocHWSurface = VGL_AllocHWSurface;
- device->CheckHWBlit = NULL;
- device->FillHWRect = NULL;
- device->SetHWColorKey = NULL;
- device->SetHWAlpha = NULL;
- device->LockHWSurface = VGL_LockHWSurface;
- device->UnlockHWSurface = VGL_UnlockHWSurface;
- device->FlipHWSurface = VGL_FlipHWSurface;
- device->FreeHWSurface = VGL_FreeHWSurface;
- device->SetIcon = NULL;
- device->SetCaption = NULL;
- device->GetWMInfo = NULL;
- device->FreeWMCursor = VGL_FreeWMCursor;
- device->CreateWMCursor = VGL_CreateWMCursor;
- device->ShowWMCursor = VGL_ShowWMCursor;
- device->WarpWMCursor = VGL_WarpWMCursor;
- device->InitOSKeymap = VGL_InitOSKeymap;
- device->PumpEvents = VGL_PumpEvents;
-
- device->free = VGL_DeleteDevice;
-
- return device;
-}
-
-VideoBootStrap VGL_bootstrap = {
- "vgl", "FreeBSD libVGL",
- VGL_Available, VGL_CreateDevice
-};
-
-static int VGL_AddMode(_THIS, VGLMode *inmode)
-{
- SDL_Rect *mode;
-
- int i, index;
- int next_mode;
-
- /* Check to see if we already have this mode */
- if (inmode->Depth < 8) { /* Not supported */
- return 0;
- }
- index = ((inmode->Depth + 7) / 8) - 1;
- for (i=0; i<SDL_nummodes[index]; ++i) {
- mode = SDL_modelist[index][i];
- if ((mode->w == inmode->ModeInfo.Xsize) &&
- (mode->h == inmode->ModeInfo.Ysize))
- return 0;
- }
-
- /* Set up the new video mode rectangle */
- mode = (SDL_Rect *)SDL_malloc(sizeof *mode);
- if (mode == NULL) {
- SDL_OutOfMemory();
- return -1;
- }
- mode->x = 0;
- mode->y = 0;
- mode->w = inmode->ModeInfo.Xsize;
- mode->h = inmode->ModeInfo.Ysize;
-
- /* Allocate the new list of modes, and fill in the new mode */
- next_mode = SDL_nummodes[index];
- SDL_modelist[index] = (SDL_Rect **)
- SDL_realloc(SDL_modelist[index], (1+next_mode+1)*sizeof(SDL_Rect *));
- if (SDL_modelist[index] == NULL) {
- SDL_OutOfMemory();
- SDL_nummodes[index] = 0;
- SDL_free(mode);
- return -1;
- }
- SDL_modelist[index][next_mode] = mode;
- SDL_modelist[index][next_mode+1] = NULL;
- SDL_nummodes[index]++;
-
- return 0;
-}
-
-static void VGL_UpdateVideoInfo(_THIS)
-{
- this->info.wm_available = 0;
- this->info.hw_available = 1;
- this->info.video_mem = 0;
- if (VGLCurMode == NULL) {
- return;
- }
- if (VGLCurMode->ModeInfo.PixelBytes > 0) {
- this->info.video_mem = VGLCurMode->ModeInfo.PixelBytes *
- VGLCurMode->ModeInfo.Xsize *
- VGLCurMode->ModeInfo.Ysize;
- }
-}
-
-int VGL_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- int i;
- int total_modes;
- VGLMode **modes;
-
- /* Initialize all variables that we clean on shutdown */
- for ( i=0; i<NUM_MODELISTS; ++i ) {
- SDL_nummodes[i] = 0;
- SDL_modelist[i] = NULL;
- }
-
- /* Enable mouse and keyboard support */
- if (SDL_getenv("SDL_NO_RAWKBD") == NULL) {
- if (VGLKeyboardInit(VGL_CODEKEYS) != 0) {
- SDL_SetError("Unable to initialize keyboard");
- return -1;
- }
- } else {
- warnx("Requiest to put keyboard into a raw mode ignored");
- }
- if (VGL_initkeymaps(STDIN_FILENO) != 0) {
- SDL_SetError("Unable to initialize keymap");
- return -1;
- }
- if (VGL_initmouse(STDIN_FILENO) != 0) {
- SDL_SetError("Unable to initialize mouse");
- return -1;
- }
-
- /* Determine the current screen size */
- if (VGLCurMode != NULL) {
- this->info.current_w = VGLCurMode->ModeInfo.Xsize;
- this->info.current_h = VGLCurMode->ModeInfo.Ysize;
- }
-
- /* Determine the screen depth */
- if (VGLCurMode != NULL)
- vformat->BitsPerPixel = VGLCurMode->Depth;
- else
- vformat->BitsPerPixel = 16; /* Good default */
-
- /* Query for the list of available video modes */
- total_modes = 0;
- modes = VGLListModes(-1, V_INFO_MM_DIRECT | V_INFO_MM_PACKED);
- for (i = 0; modes[i] != NULL; i++) {
- if ((modes[i]->ModeInfo.Type == VIDBUF8) ||
- (modes[i]->ModeInfo.Type == VIDBUF16) ||
- (modes[i]->ModeInfo.Type == VIDBUF32)) {
- VGL_AddMode(this, modes[i]);
- total_modes++;
- }
- }
- if (total_modes == 0) {
- SDL_SetError("No linear video modes available");
- return -1;
- }
-
- /* Fill in our hardware acceleration capabilities */
- VGL_UpdateVideoInfo(this);
-
- /* Create the hardware surface lock mutex */
- hw_lock = SDL_CreateMutex();
- if (hw_lock == NULL) {
- SDL_SetError("Unable to create lock mutex");
- VGL_VideoQuit(this);
- return -1;
- }
-
- /* We're done! */
- return 0;
-}
-
-SDL_Rect **VGL_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- return SDL_modelist[((format->BitsPerPixel+7)/8)-1];
-}
-
-/* Various screen update functions available */
-static void VGL_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
-static void VGL_BankedUpdate(_THIS, int numrects, SDL_Rect *rects);
-
-SDL_Surface *VGL_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- int mode_found;
- int i;
- VGLMode **modes;
-
- modes = VGLListModes(bpp, V_INFO_MM_DIRECT | V_INFO_MM_PACKED);
- mode_found = 0;
- for (i = 0; modes[i] != NULL; i++) {
- if ((modes[i]->ModeInfo.Xsize == width) &&
- (modes[i]->ModeInfo.Ysize == height) &&
- ((modes[i]->ModeInfo.Type == VIDBUF8) ||
- (modes[i]->ModeInfo.Type == VIDBUF16) ||
- (modes[i]->ModeInfo.Type == VIDBUF32))) {
- mode_found = 1;
- break;
- }
- }
- if (mode_found == 0) {
- SDL_SetError("No matching video mode found");
- return NULL;
- }
-
- /* Shutdown previous videomode (if any) */
- if (VGLCurMode != NULL)
- VGLEnd();
-
- /* Try to set the requested linear video mode */
- if (VGLInit(modes[i]->ModeId) != 0) {
- SDL_SetError("Unable to switch to requested mode");
- return NULL;
- }
-
- VGLCurMode = SDL_realloc(VGLCurMode, sizeof(VGLMode));
- VGLCurMode->ModeInfo = *VGLDisplay;
- VGLCurMode->Depth = modes[i]->Depth;
- VGLCurMode->ModeId = modes[i]->ModeId;
- VGLCurMode->Rmask = modes[i]->Rmask;
- VGLCurMode->Gmask = modes[i]->Gmask;
- VGLCurMode->Bmask = modes[i]->Bmask;
-
- /* Workaround a bug in libvgl */
- if (VGLCurMode->ModeInfo.PixelBytes == 0)
- (VGLCurMode->ModeInfo.PixelBytes = 1);
-
- current->w = VGLCurMode->ModeInfo.Xsize;
- current->h = VGLCurMode->ModeInfo.Ysize;
- current->pixels = VGLCurMode->ModeInfo.Bitmap;
- current->pitch = VGLCurMode->ModeInfo.Xsize *
- VGLCurMode->ModeInfo.PixelBytes;
- current->flags = (SDL_FULLSCREEN | SDL_HWSURFACE);
-
- /* Check if we are in a pseudo-color mode */
- if (VGLCurMode->ModeInfo.Type == VIDBUF8)
- current->flags |= SDL_HWPALETTE;
-
- /* Check if we can do doublebuffering */
- if (flags & SDL_DOUBLEBUF) {
- if (VGLCurMode->ModeInfo.Xsize * 2 <=
- VGLCurMode->ModeInfo.VYsize) {
- current->flags |= SDL_DOUBLEBUF;
- flip_page = 0;
- flip_address[0] = (byte *)current->pixels;
- flip_address[1] = (byte *)current->pixels +
- current->h * current->pitch;
- VGL_FlipHWSurface(this, current);
- }
- }
-
- if (! SDL_ReallocFormat(current, modes[i]->Depth, VGLCurMode->Rmask,
- VGLCurMode->Gmask, VGLCurMode->Bmask, 0)) {
- return NULL;
- }
-
- /* Update hardware acceleration info */
- VGL_UpdateVideoInfo(this);
-
- /* Set the blit function */
- this->UpdateRects = VGL_DirectUpdate;
-
- /* We're done */
- return current;
-}
-
-/* We don't actually allow hardware surfaces other than the main one */
-static int VGL_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- return -1;
-}
-static void VGL_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-/* We need to wait for vertical retrace on page flipped displays */
-static int VGL_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- if (surface == SDL_VideoSurface) {
- SDL_mutexP(hw_lock);
- }
- return 0;
-}
-static void VGL_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- if (surface == SDL_VideoSurface) {
- SDL_mutexV(hw_lock);
- }
-}
-
-static int VGL_FlipHWSurface(_THIS, SDL_Surface *surface)
-{
-// VGLWaitRetrace();
- if (VGLPanScreen(VGLDisplay, 0, flip_page * surface->h) < 0) {
- SDL_SetError("VGLPanSreen() failed");
- return -1;
- }
-
- flip_page = !flip_page;
- surface->pixels = flip_address[flip_page];
-
- return 0;
-}
-
-static void VGL_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- return;
-}
-
-static void VGL_BankedUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- return;
-}
-
-int VGL_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- int i;
-
- for(i = 0; i < ncolors; i++) {
- VGLSetPaletteIndex(firstcolor + i,
- colors[i].r>>2,
- colors[i].g>>2,
- colors[i].b>>2);
- }
- return 1;
-}
-
-/* Note: If we are terminated, this could be called in the middle of
- another SDL video routine -- notably UpdateRects.
-*/
-void VGL_VideoQuit(_THIS)
-{
- int i, j;
-
- /* Return the keyboard to the normal state */
- VGLKeyboardEnd();
-
- /* Reset the console video mode if we actually initialised one */
- if (VGLCurMode != NULL) {
- VGLEnd();
- SDL_free(VGLCurMode);
- VGLCurMode = NULL;
- }
-
- /* Clear the lock mutex */
- if (hw_lock != NULL) {
- SDL_DestroyMutex(hw_lock);
- hw_lock = NULL;
- }
-
- /* Free video mode lists */
- for (i = 0; i < NUM_MODELISTS; i++) {
- if (SDL_modelist[i] != NULL) {
- for (j = 0; SDL_modelist[i][j] != NULL; ++j) {
- SDL_free(SDL_modelist[i][j]);
- }
- SDL_free(SDL_modelist[i]);
- SDL_modelist[i] = NULL;
- }
- }
-
- if ( this->screen && (this->screen->flags & SDL_HWSURFACE) ) {
- /* Direct screen access, not a memory buffer */
- this->screen->pixels = NULL;
- }
-}
-
-#define VGL_RED_INDEX 0
-#define VGL_GREEN_INDEX 1
-#define VGL_BLUE_INDEX 2
-
-static VGLMode **
-VGLListModes(int depth, int mem_model)
-{
- static VGLMode **modes = NULL;
-
- VGLBitmap *vminfop;
- VGLMode **modesp, *modescp;
- video_info_t minfo;
- int adptype, i, modenum;
-
- if (modes == NULL) {
- modes = SDL_malloc(sizeof(VGLMode *) * M_VESA_MODE_MAX);
- bzero(modes, sizeof(VGLMode *) * M_VESA_MODE_MAX);
- }
- modesp = modes;
-
- for (modenum = 0; modenum < M_VESA_MODE_MAX; modenum++) {
- minfo.vi_mode = modenum;
- if (ioctl(0, CONS_MODEINFO, &minfo) || ioctl(0, CONS_CURRENT, &adptype))
- continue;
- if (minfo.vi_mode != modenum)
- continue;
- if ((minfo.vi_flags & V_INFO_GRAPHICS) == 0)
- continue;
- if ((mem_model != -1) && ((minfo.vi_mem_model & mem_model) == 0))
- continue;
- if ((depth > 1) && (minfo.vi_depth != depth))
- continue;
-
- /* reallocf can fail */
- if ((*modesp = reallocf(*modesp, sizeof(VGLMode))) == NULL)
- return NULL;
- modescp = *modesp;
-
- vminfop = &(modescp->ModeInfo);
- bzero(vminfop, sizeof(VGLBitmap));
-
- vminfop->Type = NOBUF;
-
- vminfop->PixelBytes = 1; /* Good default value */
- switch (minfo.vi_mem_model) {
- case V_INFO_MM_PLANAR:
- /* we can handle EGA/VGA planar modes only */
- if (!(minfo.vi_depth != 4 || minfo.vi_planes != 4
- || (adptype != KD_EGA && adptype != KD_VGA)))
- vminfop->Type = VIDBUF4;
- break;
- case V_INFO_MM_PACKED:
- /* we can do only 256 color packed modes */
- if (minfo.vi_depth == 8)
- vminfop->Type = VIDBUF8;
- break;
- case V_INFO_MM_VGAX:
- vminfop->Type = VIDBUF8X;
- break;
-#if defined(__FREEBSD__) && (defined(__DragonFly__) || __FreeBSD_version >= 500000)
- case V_INFO_MM_DIRECT:
- vminfop->PixelBytes = minfo.vi_pixel_size;
- switch (vminfop->PixelBytes) {
- case 2:
- vminfop->Type = VIDBUF16;
- break;
-#if notyet
- case 3:
- vminfop->Type = VIDBUF24;
- break;
-#endif
- case 4:
- vminfop->Type = VIDBUF32;
- break;
- default:
- break;
- }
-#endif
- default:
- break;
- }
- if (vminfop->Type == NOBUF)
- continue;
-
- switch (vminfop->Type) {
- case VIDBUF16:
- case VIDBUF32:
- modescp->Rmask = ((1 << minfo.vi_pixel_fsizes[VGL_RED_INDEX]) - 1) <<
- minfo.vi_pixel_fields[VGL_RED_INDEX];
- modescp->Gmask = ((1 << minfo.vi_pixel_fsizes[VGL_GREEN_INDEX]) - 1) <<
- minfo.vi_pixel_fields[VGL_GREEN_INDEX];
- modescp->Bmask = ((1 << minfo.vi_pixel_fsizes[VGL_BLUE_INDEX]) - 1) <<
- minfo.vi_pixel_fields[VGL_BLUE_INDEX];
- break;
-
- default:
- break;
- }
-
- vminfop->Xsize = minfo.vi_width;
- vminfop->Ysize = minfo.vi_height;
- modescp->Depth = minfo.vi_depth;
-
- /* XXX */
- if (minfo.vi_mode >= M_VESA_BASE)
- modescp->ModeId = _IO('V', minfo.vi_mode - M_VESA_BASE);
- else
- modescp->ModeId = _IO('S', minfo.vi_mode);
-
- /* Sort list */
- for (i = 0; modes + i < modesp ; i++) {
- if (modes[i]->ModeInfo.Xsize * modes[i]->ModeInfo.Ysize >
- vminfop->Xsize * modes[i]->ModeInfo.Ysize)
- continue;
- if ((modes[i]->ModeInfo.Xsize * modes[i]->ModeInfo.Ysize ==
- vminfop->Xsize * vminfop->Ysize) &&
- (modes[i]->Depth >= modescp->Depth))
- continue;
- *modesp = modes[i];
- modes[i] = modescp;
- modescp = *modesp;
- vminfop = &(modescp->ModeInfo);
- }
-
- modesp++;
- }
-
- if (*modesp != NULL) {
- SDL_free(*modesp);
- *modesp = NULL;
- }
-
- return modes;
-}
-
-static void
-VGLWaitRetrace(void)
-{
- while (!(inb(0x3DA) & 8));
- while (inb(0x3DA) & 8);
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/vgl/SDL_vglvideo.h b/distrib/sdl-1.2.12/src/video/vgl/SDL_vglvideo.h
deleted file mode 100644
index ba53803..0000000
--- a/distrib/sdl-1.2.12/src/video/vgl/SDL_vglvideo.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_vglvideo_h
-#define _SDL_vglvideo_h
-
-#include <sys/fbio.h>
-#include <sys/consio.h>
-#include <vgl.h>
-
-#include "SDL_mouse.h"
-#include "SDL_mutex.h"
-#include "../SDL_sysvideo.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-typedef struct {
- int ModeId;
- int Depth;
- int Rmask;
- int Gmask;
- int Bmask;
- VGLBitmap ModeInfo;
-} VGLMode;
-
-/* Private display data */
-struct SDL_PrivateVideoData {
-#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
- int SDL_nummodes[NUM_MODELISTS];
- SDL_Rect **SDL_modelist[NUM_MODELISTS];
- SDL_mutex *hw_lock;
- VGLMode *VGLCurMode;
- int flip_page;
- byte *flip_address[2];
-};
-/* Old variable names */
-#define SDL_nummodes (this->hidden->SDL_nummodes)
-#define SDL_modelist (this->hidden->SDL_modelist)
-#define hw_lock (this->hidden->hw_lock)
-#define VGLCurMode (this->hidden->VGLCurMode)
-#define flip_page (this->hidden->flip_page)
-#define flip_address (this->hidden->flip_address)
-
-#endif /* _SDL_vglvideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/wincommon/SDL_lowvideo.h b/distrib/sdl-1.2.12/src/video/wincommon/SDL_lowvideo.h
deleted file mode 100644
index 96ea145..0000000
--- a/distrib/sdl-1.2.12/src/video/wincommon/SDL_lowvideo.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_lowvideo_h
-#define _SDL_lowvideo_h
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-#ifndef SetClassLongPtr
-#define SetClassLongPtr SetClassLong
-#endif
-#ifndef GetWindowLongPtr
-#define GetWindowLongPtr GetWindowLong
-#endif
-#ifndef SetWindowLongPtr
-#define SetWindowLongPtr SetWindowLong
-#endif
-#ifndef GWLP_WNDPROC
-#define GWLP_WNDPROC GWL_WNDPROC
-#endif
-#ifndef GWLP_HINSTANCE
-#define GWLP_HINSTANCE GWL_HINSTANCE
-#endif
-#ifndef GCLP_HICON
-#define GCLP_HICON GCL_HICON
-#endif
-
-#include "../SDL_sysvideo.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-#define WINDIB_FULLSCREEN() \
-( \
- SDL_VideoSurface && \
- ((SDL_VideoSurface->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) && \
- (((SDL_VideoSurface->flags & SDL_OPENGL ) == SDL_OPENGL ) || \
- ((SDL_strcmp(this->name, "windib") == 0) || \
- (SDL_strcmp(this->name, "gapi") == 0))) \
-)
-#define DDRAW_FULLSCREEN() \
-( \
- SDL_VideoSurface && \
- ((SDL_VideoSurface->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) && \
- ((SDL_VideoSurface->flags & SDL_OPENGL ) != SDL_OPENGL ) && \
- (SDL_strcmp(this->name, "directx") == 0) \
-)
-
-#define DINPUT_FULLSCREEN() DDRAW_FULLSCREEN()
-
-/* The main window -- and a function to set it for the audio */
-#ifdef _WIN32_WCE
-extern LPWSTR SDL_Appname;
-#else
-extern LPSTR SDL_Appname;
-#endif
-extern HINSTANCE SDL_Instance;
-extern HWND SDL_Window;
-extern BOOL SDL_windowid;
-
-/* Variables and functions exported to other parts of the native video
- subsystem (SDL_sysevents.c)
-*/
-extern void WIN_FlushMessageQueue();
-
-/* Called by windows message loop when application is activated */
-extern void (*WIN_Activate)(_THIS, BOOL active, BOOL minimized);
-
-/* Called by windows message loop when system palette is available */
-extern void (*WIN_RealizePalette)(_THIS);
-
-/* Called by windows message loop when the system palette changes */
-extern void (*WIN_PaletteChanged)(_THIS, HWND window);
-
-/* Called by windows message loop when a portion of the screen needs update */
-extern void (*WIN_WinPAINT)(_THIS, HDC hdc);
-
-/* Called by windows message loop when the message isn't handled */
-extern LONG (*HandleMessage)(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-
-/* The window cursor (from SDL_sysmouse.c) */
-extern HCURSOR SDL_hcursor;
-
-/* The bounds of the window in screen coordinates */
-extern RECT SDL_bounds;
-
-/* The position of the window in windowed mode */
-extern int SDL_windowX;
-extern int SDL_windowY;
-
-/* Flag -- SDL is performing a resize, rather than the user */
-extern int SDL_resizing;
-
-/* Flag -- the mouse is in relative motion mode */
-extern int mouse_relative;
-
-/* The GDI fullscreen mode currently active */
-#ifndef NO_CHANGEDISPLAYSETTINGS
-extern DEVMODE SDL_desktop_mode;
-extern DEVMODE SDL_fullscreen_mode;
-#endif
-
-/* The system gamma ramp for GDI modes */
-extern WORD *gamma_saved;
-
-/* This is really from SDL_dx5audio.c */
-extern void DX5_SoundFocus(HWND window);
-
-/* DJM: This is really from SDL_sysevents.c, we need it in
- GDL_CreateWindow as well */
-LRESULT CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-
-/* JFP: Implementation of ToUnicode() that works on 9x/ME/2K/XP */
-typedef int (WINAPI *ToUnicodeFN)(UINT, UINT, PBYTE, LPWSTR, int, UINT);
-
-extern ToUnicodeFN SDL_ToUnicode;
-
-#endif /* SDL_lowvideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/wincommon/SDL_sysevents.c b/distrib/sdl-1.2.12/src/video/wincommon/SDL_sysevents.c
deleted file mode 100644
index ac538d3..0000000
--- a/distrib/sdl-1.2.12/src/video/wincommon/SDL_sysevents.c
+++ /dev/null
@@ -1,924 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-/* Make sure XBUTTON stuff is defined that isn't in older Platform SDKs... */
-#ifndef WM_XBUTTONDOWN
-#define WM_XBUTTONDOWN 0x020B
-#endif
-#ifndef WM_XBUTTONUP
-#define WM_XBUTTONUP 0x020C
-#endif
-#ifndef GET_XBUTTON_WPARAM
-#define GET_XBUTTON_WPARAM(w) (HIWORD(w))
-#endif
-
-#include "SDL_events.h"
-#include "SDL_video.h"
-#include "SDL_syswm.h"
-#include "../SDL_sysvideo.h"
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_lowvideo.h"
-#include "SDL_syswm_c.h"
-#include "SDL_main.h"
-#include "SDL_loadso.h"
-
-#ifdef WMMSG_DEBUG
-#include "wmmsg.h"
-#endif
-
-#ifdef _WIN32_WCE
-#include "../gapi/SDL_gapivideo.h"
-
-#define IsZoomed(HWND) 1
-#define NO_GETKEYBOARDSTATE
-#if _WIN32_WCE < 420
-#define NO_CHANGEDISPLAYSETTINGS
-#endif
-#endif
-
-/* The window we use for everything... */
-#ifdef _WIN32_WCE
-LPWSTR SDL_Appname = NULL;
-#else
-LPSTR SDL_Appname = NULL;
-#endif
-Uint32 SDL_Appstyle = 0;
-HINSTANCE SDL_Instance = NULL;
-HWND SDL_Window = NULL;
-RECT SDL_bounds = {0, 0, 0, 0};
-int SDL_windowX = 0;
-int SDL_windowY = 0;
-int SDL_resizing = 0;
-int mouse_relative = 0;
-int posted = 0;
-#ifndef NO_CHANGEDISPLAYSETTINGS
-DEVMODE SDL_desktop_mode;
-DEVMODE SDL_fullscreen_mode;
-#endif
-WORD *gamma_saved = NULL;
-
-
-/* Functions called by the message processing function */
-LONG (*HandleMessage)(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)=NULL;
-void (*WIN_Activate)(_THIS, BOOL active, BOOL iconic);
-void (*WIN_RealizePalette)(_THIS);
-void (*WIN_PaletteChanged)(_THIS, HWND window);
-void (*WIN_WinPAINT)(_THIS, HDC hdc);
-extern void DIB_SwapGamma(_THIS);
-
-#ifndef NO_GETKEYBOARDSTATE
-/* Variables and support functions for SDL_ToUnicode() */
-static int codepage;
-static int Is9xME();
-static int GetCodePage();
-static int WINAPI ToUnicode9xME(UINT vkey, UINT scancode, BYTE *keystate, LPWSTR wchars, int wsize, UINT flags);
-
-ToUnicodeFN SDL_ToUnicode = ToUnicode9xME;
-#endif /* !NO_GETKEYBOARDSTATE */
-
-
-#if defined(_WIN32_WCE)
-
-// dynamically load aygshell dll because we want SDL to work on HPC and be300
-HINSTANCE aygshell = NULL;
-BOOL (WINAPI *SHFullScreen)(HWND hwndRequester, DWORD dwState) = 0;
-
-#define SHFS_SHOWTASKBAR 0x0001
-#define SHFS_HIDETASKBAR 0x0002
-#define SHFS_SHOWSIPBUTTON 0x0004
-#define SHFS_HIDESIPBUTTON 0x0008
-#define SHFS_SHOWSTARTICON 0x0010
-#define SHFS_HIDESTARTICON 0x0020
-
-static void LoadAygshell(void)
-{
- if( !aygshell )
- aygshell = SDL_LoadObject("aygshell.dll");
- if( (aygshell != 0) && (SHFullScreen == 0) )
- {
- SHFullScreen = (int (WINAPI *)(struct HWND__ *,unsigned long)) SDL_LoadFunction(aygshell, "SHFullScreen");
- }
-}
-
-/* for gapi landscape mode */
-static void GapiTransform(SDL_ScreenOrientation rotate, char hires, Sint16 *x, Sint16 *y) {
- Sint16 rotatedX;
- Sint16 rotatedY;
-
- if (hires) {
- *x = *x * 2;
- *y = *y * 2;
- }
-
- switch(rotate) {
- case SDL_ORIENTATION_UP:
- {
-/* this code needs testing on a real device!
- So it will be enabled later */
-/*
-#ifdef _WIN32_WCE
-#if _WIN32_WCE >= 420
- // test device orientation
- // FIXME: do not check every mouse message
- DEVMODE settings;
- SDL_memset(&settings, 0, sizeof(DEVMODE));
- settings.dmSize = sizeof(DEVMODE);
- settings.dmFields = DM_DISPLAYORIENTATION;
- ChangeDisplaySettingsEx(NULL, &settings, NULL, CDS_TEST, NULL);
- if( settings.dmOrientation == DMDO_90 )
- {
- rotatedX = SDL_VideoSurface->h - *x;
- rotatedY = *y;
- *x = rotatedX;
- *y = rotatedY;
- }
-#endif
-#endif */
- }
- break;
- case SDL_ORIENTATION_RIGHT:
- if (!SDL_VideoSurface)
- break;
- rotatedX = SDL_VideoSurface->w - *y;
- rotatedY = *x;
- *x = rotatedX;
- *y = rotatedY;
- break;
- case SDL_ORIENTATION_LEFT:
- if (!SDL_VideoSurface)
- break;
- rotatedX = *y;
- rotatedY = SDL_VideoSurface->h - *x;
- *x = rotatedX;
- *y = rotatedY;
- break;
- }
-}
-
-#endif
-
-/* JC 14 Mar 2006
- This is used all over the place, in the windib driver and in the dx5 driver
- So we may as well stick it here instead of having multiple copies scattered
- about
-*/
-void WIN_FlushMessageQueue()
-{
- MSG msg;
- while ( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) ) {
- if ( msg.message == WM_QUIT ) break;
- TranslateMessage( &msg );
- DispatchMessage( &msg );
- }
-}
-
-static void SDL_RestoreGameMode(void)
-{
-#ifdef _WIN32_WCE
- SDL_VideoDevice *this = current_video;
- if(SDL_strcmp(this->name, "gapi") == 0)
- {
- if( this->hidden->suspended )
- {
- this->hidden->suspended = 0;
- }
- }
-#else
- ShowWindow(SDL_Window, SW_RESTORE);
-#endif
-
-#ifndef NO_CHANGEDISPLAYSETTINGS
-#ifndef _WIN32_WCE
- ChangeDisplaySettings(&SDL_fullscreen_mode, CDS_FULLSCREEN);
-#endif
-#endif /* NO_CHANGEDISPLAYSETTINGS */
-}
-static void SDL_RestoreDesktopMode(void)
-{
-
-#ifdef _WIN32_WCE
- SDL_VideoDevice *this = current_video;
- if(SDL_strcmp(this->name, "gapi") == 0)
- {
- if( !this->hidden->suspended )
- {
- this->hidden->suspended = 1;
- }
- }
-#else
- /* WinCE does not have a taskbar, so minimizing is not convenient */
- ShowWindow(SDL_Window, SW_MINIMIZE);
-#endif
-
-#ifndef NO_CHANGEDISPLAYSETTINGS
-#ifndef _WIN32_WCE
- ChangeDisplaySettings(NULL, 0);
-#endif
-#endif /* NO_CHANGEDISPLAYSETTINGS */
-}
-
-#ifdef WM_MOUSELEAVE
-/*
- Special code to handle mouse leave events - this sucks...
- http://support.microsoft.com/support/kb/articles/q183/1/07.asp
-
- TrackMouseEvent() is only available on Win98 and WinNT.
- _TrackMouseEvent() is available on Win95, but isn't yet in the mingw32
- development environment, and only works on systems that have had IE 3.0
- or newer installed on them (which is not the case with the base Win95).
- Therefore, we implement our own version of _TrackMouseEvent() which
- uses our own implementation if TrackMouseEvent() is not available.
-*/
-static BOOL (WINAPI *_TrackMouseEvent)(TRACKMOUSEEVENT *ptme) = NULL;
-
-static VOID CALLBACK
-TrackMouseTimerProc(HWND hWnd, UINT uMsg, UINT idEvent, DWORD dwTime)
-{
- RECT rect;
- POINT pt;
-
- GetClientRect(hWnd, &rect);
- MapWindowPoints(hWnd, NULL, (LPPOINT)&rect, 2);
- GetCursorPos(&pt);
- if ( !PtInRect(&rect, pt) || (WindowFromPoint(pt) != hWnd) ) {
- if ( !KillTimer(hWnd, idEvent) ) {
- /* Error killing the timer! */
- }
- PostMessage(hWnd, WM_MOUSELEAVE, 0, 0);
- }
-}
-static BOOL WINAPI WIN_TrackMouseEvent(TRACKMOUSEEVENT *ptme)
-{
- if ( ptme->dwFlags == TME_LEAVE ) {
- return SetTimer(ptme->hwndTrack, ptme->dwFlags, 100,
- (TIMERPROC)TrackMouseTimerProc) != 0;
- }
- return FALSE;
-}
-#endif /* WM_MOUSELEAVE */
-
-/* Function to retrieve the current keyboard modifiers */
-static void WIN_GetKeyboardState(void)
-{
-#ifndef NO_GETKEYBOARDSTATE
- SDLMod state;
- BYTE keyboard[256];
- Uint8 *kstate = SDL_GetKeyState(NULL);
-
- state = KMOD_NONE;
- if ( GetKeyboardState(keyboard) ) {
- if ( keyboard[VK_LSHIFT] & 0x80) {
- state |= KMOD_LSHIFT;
- kstate[SDLK_LSHIFT] = SDL_PRESSED;
- }
- if ( keyboard[VK_RSHIFT] & 0x80) {
- state |= KMOD_RSHIFT;
- kstate[SDLK_RSHIFT] = SDL_PRESSED;
- }
- if ( keyboard[VK_LCONTROL] & 0x80) {
- state |= KMOD_LCTRL;
- kstate[SDLK_LCTRL] = SDL_PRESSED;
- }
- if ( keyboard[VK_RCONTROL] & 0x80) {
- state |= KMOD_RCTRL;
- kstate[SDLK_RCTRL] = SDL_PRESSED;
- }
- if ( keyboard[VK_LMENU] & 0x80) {
- state |= KMOD_LALT;
- kstate[SDLK_LALT] = SDL_PRESSED;
- }
- if ( keyboard[VK_RMENU] & 0x80) {
- state |= KMOD_RALT;
- kstate[SDLK_RALT] = SDL_PRESSED;
- }
- if ( keyboard[VK_NUMLOCK] & 0x01) {
- state |= KMOD_NUM;
- kstate[SDLK_NUMLOCK] = SDL_PRESSED;
- }
- if ( keyboard[VK_CAPITAL] & 0x01) {
- state |= KMOD_CAPS;
- kstate[SDLK_CAPSLOCK] = SDL_PRESSED;
- }
- }
- SDL_SetModState(state);
-#endif /* !NO_GETKEYBOARDSTATE */
-}
-
-/* The main Win32 event handler
-DJM: This is no longer static as (DX5/DIB)_CreateWindow needs it
-*/
-LRESULT CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- SDL_VideoDevice *this = current_video;
- static int mouse_pressed = 0;
- static int in_window = 0;
-#ifdef WMMSG_DEBUG
- fprintf(stderr, "Received windows message: ");
- if ( msg > MAX_WMMSG ) {
- fprintf(stderr, "%d", msg);
- } else {
- fprintf(stderr, "%s", wmtab[msg]);
- }
- fprintf(stderr, " -- 0x%X, 0x%X\n", wParam, lParam);
-#endif
- switch (msg) {
-
- case WM_ACTIVATE: {
- SDL_VideoDevice *this = current_video;
- BOOL active, minimized;
- Uint8 appstate;
-
- minimized = HIWORD(wParam);
- active = (LOWORD(wParam) != WA_INACTIVE) && !minimized;
- if ( active ) {
- /* Gain the following states */
- appstate = SDL_APPACTIVE|SDL_APPINPUTFOCUS;
- if ( this->input_grab != SDL_GRAB_OFF ) {
- WIN_GrabInput(this, SDL_GRAB_ON);
- }
- if ( !(SDL_GetAppState()&SDL_APPINPUTFOCUS) ) {
- if ( ! DDRAW_FULLSCREEN() ) {
- DIB_SwapGamma(this);
- }
- if ( WINDIB_FULLSCREEN() ) {
- SDL_RestoreGameMode();
- }
- }
-#if defined(_WIN32_WCE)
- if ( WINDIB_FULLSCREEN() ) {
- LoadAygshell();
- if( SHFullScreen )
- SHFullScreen(SDL_Window, SHFS_HIDESTARTICON|SHFS_HIDETASKBAR|SHFS_HIDESIPBUTTON);
- else
- ShowWindow(FindWindow(TEXT("HHTaskBar"),NULL),SW_HIDE);
- }
-#endif
- posted = SDL_PrivateAppActive(1, appstate);
- WIN_GetKeyboardState();
- } else {
- /* Lose the following states */
- appstate = SDL_APPINPUTFOCUS;
- if ( minimized ) {
- appstate |= SDL_APPACTIVE;
- }
- if ( this->input_grab != SDL_GRAB_OFF ) {
- WIN_GrabInput(this, SDL_GRAB_OFF);
- }
- if ( SDL_GetAppState() & SDL_APPINPUTFOCUS ) {
- if ( ! DDRAW_FULLSCREEN() ) {
- DIB_SwapGamma(this);
- }
- if ( WINDIB_FULLSCREEN() ) {
- SDL_RestoreDesktopMode();
-#if defined(_WIN32_WCE)
- LoadAygshell();
- if( SHFullScreen )
- SHFullScreen(SDL_Window, SHFS_SHOWSTARTICON|SHFS_SHOWTASKBAR|SHFS_SHOWSIPBUTTON);
- else
- ShowWindow(FindWindow(TEXT("HHTaskBar"),NULL),SW_SHOW);
-#endif
- }
- }
- posted = SDL_PrivateAppActive(0, appstate);
- }
- WIN_Activate(this, active, minimized);
- return(0);
- }
- break;
-
- case WM_MOUSEMOVE: {
-
- /* Mouse is handled by DirectInput when fullscreen */
- if ( SDL_VideoSurface && ! DINPUT_FULLSCREEN() ) {
- Sint16 x, y;
-
- /* mouse has entered the window */
- if ( ! in_window ) {
-#ifdef WM_MOUSELEAVE
- TRACKMOUSEEVENT tme;
-
- tme.cbSize = sizeof(tme);
- tme.dwFlags = TME_LEAVE;
- tme.hwndTrack = SDL_Window;
- _TrackMouseEvent(&tme);
-#endif /* WM_MOUSELEAVE */
- in_window = TRUE;
-
- posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
- }
-
- /* mouse has moved within the window */
- x = LOWORD(lParam);
- y = HIWORD(lParam);
- if ( mouse_relative ) {
- POINT center;
- center.x = (SDL_VideoSurface->w/2);
- center.y = (SDL_VideoSurface->h/2);
- x -= (Sint16)center.x;
- y -= (Sint16)center.y;
- if ( x || y ) {
- ClientToScreen(SDL_Window, &center);
- SetCursorPos(center.x, center.y);
- posted = SDL_PrivateMouseMotion(0, 1, x, y);
- }
- } else {
-#ifdef _WIN32_WCE
- if (SDL_VideoSurface)
- GapiTransform(this->hidden->userOrientation, this->hidden->hiresFix, &x, &y);
-#endif
- posted = SDL_PrivateMouseMotion(0, 0, x, y);
- }
- }
- }
- return(0);
-
-#ifdef WM_MOUSELEAVE
- case WM_MOUSELEAVE: {
-
- /* Mouse is handled by DirectInput when fullscreen */
- if ( SDL_VideoSurface && ! DINPUT_FULLSCREEN() ) {
- /* mouse has left the window */
- /* or */
- /* Elvis has left the building! */
- posted = SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
- }
- in_window = FALSE;
- }
- return(0);
-#endif /* WM_MOUSELEAVE */
-
- case WM_LBUTTONDOWN:
- case WM_LBUTTONUP:
- case WM_MBUTTONDOWN:
- case WM_MBUTTONUP:
- case WM_RBUTTONDOWN:
- case WM_RBUTTONUP:
- case WM_XBUTTONDOWN:
- case WM_XBUTTONUP: {
- /* Mouse is handled by DirectInput when fullscreen */
- if ( SDL_VideoSurface && ! DINPUT_FULLSCREEN() ) {
- WORD xbuttonval = 0;
- Sint16 x, y;
- Uint8 button, state;
-
- /* DJM:
- We want the SDL window to take focus so that
- it acts like a normal windows "component"
- (e.g. gains keyboard focus on a mouse click).
- */
- SetFocus(SDL_Window);
-
- /* Figure out which button to use */
- switch (msg) {
- case WM_LBUTTONDOWN:
- button = SDL_BUTTON_LEFT;
- state = SDL_PRESSED;
- break;
- case WM_LBUTTONUP:
- button = SDL_BUTTON_LEFT;
- state = SDL_RELEASED;
- break;
- case WM_MBUTTONDOWN:
- button = SDL_BUTTON_MIDDLE;
- state = SDL_PRESSED;
- break;
- case WM_MBUTTONUP:
- button = SDL_BUTTON_MIDDLE;
- state = SDL_RELEASED;
- break;
- case WM_RBUTTONDOWN:
- button = SDL_BUTTON_RIGHT;
- state = SDL_PRESSED;
- break;
- case WM_RBUTTONUP:
- button = SDL_BUTTON_RIGHT;
- state = SDL_RELEASED;
- break;
- case WM_XBUTTONDOWN:
- xbuttonval = GET_XBUTTON_WPARAM(wParam);
- button = SDL_BUTTON_WHEELDOWN + xbuttonval;
- state = SDL_PRESSED;
- break;
- case WM_XBUTTONUP:
- xbuttonval = GET_XBUTTON_WPARAM(wParam);
- button = SDL_BUTTON_WHEELDOWN + xbuttonval;
- state = SDL_RELEASED;
- break;
- default:
- /* Eh? Unknown button? */
- return(0);
- }
- if ( state == SDL_PRESSED ) {
- /* Grab mouse so we get up events */
- if ( ++mouse_pressed > 0 ) {
- SetCapture(hwnd);
- }
- } else {
- /* Release mouse after all up events */
- if ( --mouse_pressed <= 0 ) {
- ReleaseCapture();
- mouse_pressed = 0;
- }
- }
- if ( mouse_relative ) {
- /* RJR: March 28, 2000
- report internal mouse position if in relative mode */
- x = 0; y = 0;
- } else {
- x = (Sint16)LOWORD(lParam);
- y = (Sint16)HIWORD(lParam);
-#ifdef _WIN32_WCE
- if (SDL_VideoSurface)
- GapiTransform(this->hidden->userOrientation, this->hidden->hiresFix, &x, &y);
-#endif
- }
- posted = SDL_PrivateMouseButton(
- state, button, x, y);
-
- /*
- * MSDN says:
- * "Unlike the WM_LBUTTONUP, WM_MBUTTONUP, and WM_RBUTTONUP
- * messages, an application should return TRUE from [an
- * XBUTTON message] if it processes it. Doing so will allow
- * software that simulates this message on Microsoft Windows
- * systems earlier than Windows 2000 to determine whether
- * the window procedure processed the message or called
- * DefWindowProc to process it.
- */
- if (xbuttonval > 0)
- return(TRUE);
- }
- }
- return(0);
-
-
-#if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
- case WM_MOUSEWHEEL:
- if ( SDL_VideoSurface && ! DINPUT_FULLSCREEN() ) {
- int move = (short)HIWORD(wParam);
- if ( move ) {
- Uint8 button;
- if ( move > 0 )
- button = SDL_BUTTON_WHEELUP;
- else
- button = SDL_BUTTON_WHEELDOWN;
- posted = SDL_PrivateMouseButton(
- SDL_PRESSED, button, 0, 0);
- posted |= SDL_PrivateMouseButton(
- SDL_RELEASED, button, 0, 0);
- }
- }
- return(0);
-#endif
-
-#ifdef WM_GETMINMAXINFO
- /* This message is sent as a way for us to "check" the values
- * of a position change. If we don't like it, we can adjust
- * the values before they are changed.
- */
- case WM_GETMINMAXINFO: {
- MINMAXINFO *info;
- RECT size;
- int x, y;
- int style;
- int width;
- int height;
-
- /* We don't want to clobber an internal resize */
- if ( SDL_resizing )
- return(0);
-
- /* We allow resizing with the SDL_RESIZABLE flag */
- if ( SDL_PublicSurface &&
- (SDL_PublicSurface->flags & SDL_RESIZABLE) ) {
- return(0);
- }
-
- /* Get the current position of our window */
- GetWindowRect(SDL_Window, &size);
- x = size.left;
- y = size.top;
-
- /* Calculate current width and height of our window */
- size.top = 0;
- size.left = 0;
- if ( SDL_PublicSurface != NULL ) {
- size.bottom = SDL_PublicSurface->h;
- size.right = SDL_PublicSurface->w;
- } else {
- size.bottom = 0;
- size.right = 0;
- }
-
- /* DJM - according to the docs for GetMenu(), the
- return value is undefined if hwnd is a child window.
- Aparently it's too difficult for MS to check
- inside their function, so I have to do it here.
- */
- style = GetWindowLong(hwnd, GWL_STYLE);
- AdjustWindowRect(
- &size,
- style,
- style & WS_CHILDWINDOW ? FALSE
- : GetMenu(hwnd) != NULL);
-
- width = size.right - size.left;
- height = size.bottom - size.top;
-
- /* Fix our size to the current size */
- info = (MINMAXINFO *)lParam;
- info->ptMaxSize.x = width;
- info->ptMaxSize.y = height;
- info->ptMaxPosition.x = x;
- info->ptMaxPosition.y = y;
- info->ptMinTrackSize.x = width;
- info->ptMinTrackSize.y = height;
- info->ptMaxTrackSize.x = width;
- info->ptMaxTrackSize.y = height;
- }
- return(0);
-#endif /* WM_GETMINMAXINFO */
-
- case WM_WINDOWPOSCHANGED: {
- SDL_VideoDevice *this = current_video;
- int w, h;
-
- GetClientRect(SDL_Window, &SDL_bounds);
- ClientToScreen(SDL_Window, (LPPOINT)&SDL_bounds);
- ClientToScreen(SDL_Window, (LPPOINT)&SDL_bounds+1);
- if ( !SDL_resizing && !IsZoomed(SDL_Window) &&
- SDL_PublicSurface &&
- !(SDL_PublicSurface->flags & SDL_FULLSCREEN) ) {
- SDL_windowX = SDL_bounds.left;
- SDL_windowY = SDL_bounds.top;
- }
- w = SDL_bounds.right-SDL_bounds.left;
- h = SDL_bounds.bottom-SDL_bounds.top;
- if ( this->input_grab != SDL_GRAB_OFF ) {
- ClipCursor(&SDL_bounds);
- }
- if ( SDL_PublicSurface &&
- (SDL_PublicSurface->flags & SDL_RESIZABLE) ) {
- SDL_PrivateResize(w, h);
- }
- }
- break;
-
- /* We need to set the cursor */
- case WM_SETCURSOR: {
- Uint16 hittest;
-
- hittest = LOWORD(lParam);
- if ( hittest == HTCLIENT ) {
- SetCursor(SDL_hcursor);
- return(TRUE);
- }
- }
- break;
-
- /* We are about to get palette focus! */
- case WM_QUERYNEWPALETTE: {
- WIN_RealizePalette(current_video);
- return(TRUE);
- }
- break;
-
- /* Another application changed the palette */
- case WM_PALETTECHANGED: {
- WIN_PaletteChanged(current_video, (HWND)wParam);
- }
- break;
-
- /* We were occluded, refresh our display */
- case WM_PAINT: {
- HDC hdc;
- PAINTSTRUCT ps;
-
- hdc = BeginPaint(SDL_Window, &ps);
- if ( current_video->screen &&
- !(current_video->screen->flags & SDL_OPENGL) ) {
- WIN_WinPAINT(current_video, hdc);
- }
- EndPaint(SDL_Window, &ps);
- }
- return(0);
-
- /* DJM: Send an expose event in this case */
- case WM_ERASEBKGND: {
- posted = SDL_PrivateExpose();
- }
- return(0);
-
- case WM_CLOSE: {
- if ( (posted = SDL_PrivateQuit()) )
- PostQuitMessage(0);
- }
- return(0);
-
- case WM_DESTROY: {
- PostQuitMessage(0);
- }
- return(0);
-
-#ifndef NO_GETKEYBOARDSTATE
- case WM_INPUTLANGCHANGE: {
- codepage = GetCodePage();
- }
- return(TRUE);
-#endif
-
- default: {
- /* Special handling by the video driver */
- if (HandleMessage) {
- return(HandleMessage(current_video,
- hwnd, msg, wParam, lParam));
- }
- }
- break;
- }
- return(DefWindowProc(hwnd, msg, wParam, lParam));
-}
-
-/* Allow the application handle to be stored and retrieved later */
-static void *SDL_handle = NULL;
-
-void SDL_SetModuleHandle(void *handle)
-{
- SDL_handle = handle;
-}
-void *SDL_GetModuleHandle(void)
-{
- void *handle;
-
- if ( SDL_handle ) {
- handle = SDL_handle;
- } else {
- handle = GetModuleHandle(NULL);
- }
- return(handle);
-}
-
-/* This allows the SDL_WINDOWID hack */
-BOOL SDL_windowid = FALSE;
-
-static int app_registered = 0;
-
-/* Register the class for this application -- exported for winmain.c */
-int SDL_RegisterApp(char *name, Uint32 style, void *hInst)
-{
- WNDCLASS class;
-#ifdef WM_MOUSELEAVE
- HMODULE handle;
-#endif
-
- /* Only do this once... */
- if ( app_registered ) {
- ++app_registered;
- return(0);
- }
-
-#ifndef CS_BYTEALIGNCLIENT
-#define CS_BYTEALIGNCLIENT 0
-#endif
- if ( ! name && ! SDL_Appname ) {
- name = "SDL_app";
- SDL_Appstyle = CS_BYTEALIGNCLIENT;
- SDL_Instance = hInst ? hInst : SDL_GetModuleHandle();
- }
-
- if ( name ) {
-#ifdef _WIN32_WCE
- /* WinCE uses the UNICODE version */
- SDL_Appname = SDL_iconv_utf8_ucs2(name);
-#else
- SDL_Appname = SDL_iconv_utf8_locale(name);
-#endif /* _WIN32_WCE */
- SDL_Appstyle = style;
- SDL_Instance = hInst ? hInst : SDL_GetModuleHandle();
- }
-
- /* Register the application class */
- class.hCursor = NULL;
- class.hIcon = LoadImage(SDL_Instance, SDL_Appname,
- IMAGE_ICON,
- 0, 0, LR_DEFAULTCOLOR);
- class.lpszMenuName = NULL;
- class.lpszClassName = SDL_Appname;
- class.hbrBackground = NULL;
- class.hInstance = SDL_Instance;
- class.style = SDL_Appstyle;
-#if SDL_VIDEO_OPENGL
- class.style |= CS_OWNDC;
-#endif
- class.lpfnWndProc = WinMessage;
- class.cbWndExtra = 0;
- class.cbClsExtra = 0;
- if ( ! RegisterClass(&class) ) {
- SDL_SetError("Couldn't register application class");
- return(-1);
- }
-
-#ifdef WM_MOUSELEAVE
- /* Get the version of TrackMouseEvent() we use */
- _TrackMouseEvent = NULL;
- handle = GetModuleHandle("USER32.DLL");
- if ( handle ) {
- _TrackMouseEvent = (BOOL (WINAPI *)(TRACKMOUSEEVENT *))GetProcAddress(handle, "TrackMouseEvent");
- }
- if ( _TrackMouseEvent == NULL ) {
- _TrackMouseEvent = WIN_TrackMouseEvent;
- }
-#endif /* WM_MOUSELEAVE */
-
-#ifndef NO_GETKEYBOARDSTATE
- /* Initialise variables for SDL_ToUnicode() */
- codepage = GetCodePage();
- SDL_ToUnicode = Is9xME() ? ToUnicode9xME : ToUnicode;
-#endif
-
- app_registered = 1;
- return(0);
-}
-
-/* Unregisters the windowclass registered in SDL_RegisterApp above. */
-void SDL_UnregisterApp()
-{
- WNDCLASS class;
-
- /* SDL_RegisterApp might not have been called before */
- if ( !app_registered ) {
- return;
- }
- --app_registered;
- if ( app_registered == 0 ) {
- /* Check for any registered window classes. */
- if ( GetClassInfo(SDL_Instance, SDL_Appname, &class) ) {
- UnregisterClass(SDL_Appname, SDL_Instance);
- }
- SDL_free(SDL_Appname);
- SDL_Appname = NULL;
- }
-}
-
-#ifndef NO_GETKEYBOARDSTATE
-/* JFP: Implementation of ToUnicode() that works on 9x/ME/2K/XP */
-
-static int Is9xME()
-{
- OSVERSIONINFO info;
-
- SDL_memset(&info, 0, sizeof(info));
- info.dwOSVersionInfoSize = sizeof(info);
- if (!GetVersionEx(&info)) {
- return 0;
- }
- return (info.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS);
-}
-
-static int GetCodePage()
-{
- char buff[8];
- int lcid = MAKELCID(LOWORD(GetKeyboardLayout(0)), SORT_DEFAULT);
- int cp = GetACP();
-
- if (GetLocaleInfo(lcid, LOCALE_IDEFAULTANSICODEPAGE, buff, sizeof(buff))) {
- cp = SDL_atoi(buff);
- }
- return cp;
-}
-
-static int WINAPI ToUnicode9xME(UINT vkey, UINT scancode, PBYTE keystate, LPWSTR wchars, int wsize, UINT flags)
-{
- BYTE chars[2];
-
- if (ToAsciiEx(vkey, scancode, keystate, (WORD*)chars, 0, GetKeyboardLayout(0)) == 1) {
- return MultiByteToWideChar(codepage, 0, chars, 1, wchars, wsize);
- }
- return 0;
-}
-
-#endif /* !NO_GETKEYBOARDSTATE */
diff --git a/distrib/sdl-1.2.12/src/video/wincommon/SDL_sysmouse.c b/distrib/sdl-1.2.12/src/video/wincommon/SDL_sysmouse.c
deleted file mode 100644
index d1caf2f..0000000
--- a/distrib/sdl-1.2.12/src/video/wincommon/SDL_sysmouse.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-#include "SDL_mouse.h"
-#include "../../events/SDL_events_c.h"
-#include "../SDL_cursor_c.h"
-#include "SDL_sysmouse_c.h"
-#include "SDL_lowvideo.h"
-
-#ifdef _WIN32_WCE
-#define USE_STATIC_CURSOR
-#endif
-
-HCURSOR SDL_hcursor = NULL; /* Exported for SDL_eventloop.c */
-
-/* The implementation dependent data for the window manager cursor */
-/* For some reason when creating a windows cursor, the ands and xors memory
- is not copied, so we need to keep track of it and free it when we are done
- with the cursor. If we free the memory prematurely, the app crashes. :-}
-*/
-struct WMcursor {
- HCURSOR curs;
-#ifndef USE_STATIC_CURSOR
- Uint8 *ands;
- Uint8 *xors;
-#endif
-};
-
-/* Convert bits to padded bytes */
-#define PAD_BITS(bits) ((bits+7)/8)
-
-#ifdef CURSOR_DEBUG
-static void PrintBITMAP(FILE *out, char *bits, int w, int h)
-{
- int i;
- unsigned char ch;
-
- while ( h-- > 0 ) {
- for ( i=0; i<w; ++i ) {
- if ( (i%8) == 0 )
- ch = *bits++;
- if ( ch&0x80 )
- fprintf(out, "X");
- else
- fprintf(out, " ");
- ch <<= 1;
- }
- fprintf(out, "\n");
- }
-}
-#endif
-
-#ifndef USE_STATIC_CURSOR
-/* Local functions to convert the SDL cursor mask into Windows format */
-static void memnot(Uint8 *dst, Uint8 *src, int len)
-{
- while ( len-- > 0 )
- *dst++ = ~*src++;
-}
-static void memxor(Uint8 *dst, Uint8 *src1, Uint8 *src2, int len)
-{
- while ( len-- > 0 )
- *dst++ = (*src1++)^(*src2++);
-}
-#endif /* !USE_STATIC_CURSOR */
-
-void WIN_FreeWMCursor(_THIS, WMcursor *cursor)
-{
-#ifndef USE_STATIC_CURSOR
- if ( cursor->curs == GetCursor() )
- SetCursor(NULL);
- if ( cursor->curs != NULL )
- DestroyCursor(cursor->curs);
- if ( cursor->ands != NULL )
- SDL_free(cursor->ands);
- if ( cursor->xors != NULL )
- SDL_free(cursor->xors);
-#endif /* !USE_STATIC_CURSOR */
- SDL_free(cursor);
-}
-
-WMcursor *WIN_CreateWMCursor(_THIS,
- Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
-{
-#ifdef USE_STATIC_CURSOR
- WMcursor *cursor;
-
- /* Allocate the cursor */
- cursor = (WMcursor *)SDL_malloc(sizeof(*cursor));
- if ( cursor ) {
- cursor->curs = LoadCursor(NULL, IDC_ARROW);
- }
- return(cursor);
-#else
- WMcursor *cursor;
- int allowed_x;
- int allowed_y;
- int run, pad, i;
- Uint8 *aptr, *xptr;
-
- /* Check to make sure the cursor size is okay */
- allowed_x = GetSystemMetrics(SM_CXCURSOR);
- allowed_y = GetSystemMetrics(SM_CYCURSOR);
- if ( (w > allowed_x) || (h > allowed_y) ) {
- SDL_SetError("Only cursors of dimension (%dx%d) are allowed",
- allowed_x, allowed_y);
- return(NULL);
- }
-
- /* Allocate the cursor */
- cursor = (WMcursor *)SDL_malloc(sizeof(*cursor));
- if ( cursor == NULL ) {
- SDL_SetError("Out of memory");
- return(NULL);
- }
- cursor->curs = NULL;
- cursor->ands = NULL;
- cursor->xors = NULL;
-
- /* Pad out to the normal cursor size */
- run = PAD_BITS(w);
- pad = PAD_BITS(allowed_x)-run;
- aptr = cursor->ands = (Uint8 *)SDL_malloc((run+pad)*allowed_y);
- xptr = cursor->xors = (Uint8 *)SDL_malloc((run+pad)*allowed_y);
- if ( (aptr == NULL) || (xptr == NULL) ) {
- WIN_FreeWMCursor(NULL, cursor);
- SDL_OutOfMemory();
- return(NULL);
- }
- for ( i=0; i<h; ++i ) {
- memxor(xptr, data, mask, run);
- xptr += run;
- data += run;
- memnot(aptr, mask, run);
- mask += run;
- aptr += run;
- SDL_memset(xptr, 0, pad);
- xptr += pad;
- SDL_memset(aptr, ~0, pad);
- aptr += pad;
- }
- pad += run;
- for ( ; i<allowed_y; ++i ) {
- SDL_memset(xptr, 0, pad);
- xptr += pad;
- SDL_memset(aptr, ~0, pad);
- aptr += pad;
- }
-
- /* Create the cursor */
- cursor->curs = CreateCursor(
- (HINSTANCE)GetWindowLongPtr(SDL_Window, GWLP_HINSTANCE),
- hot_x, hot_y, allowed_x, allowed_y,
- cursor->ands, cursor->xors);
- if ( cursor->curs == NULL ) {
- WIN_FreeWMCursor(NULL, cursor);
- SDL_SetError("Windows couldn't create the requested cursor");
- return(NULL);
- }
- return(cursor);
-#endif /* USE_STATIC_CURSOR */
-}
-
-int WIN_ShowWMCursor(_THIS, WMcursor *cursor)
-{
- POINT mouse_pos;
-
- /* The fullscreen cursor must be done in software with DirectInput */
- if ( !this->screen || DDRAW_FULLSCREEN() ) {
- return(0);
- }
-
- /* Set the window cursor to our cursor, if applicable */
- if ( cursor != NULL ) {
- SDL_hcursor = cursor->curs;
- } else {
- SDL_hcursor = NULL;
- }
- GetCursorPos(&mouse_pos);
- if ( PtInRect(&SDL_bounds, mouse_pos) ) {
- SetCursor(SDL_hcursor);
- }
- return(1);
-}
-
-void WIN_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
-{
- if ( DDRAW_FULLSCREEN() ) {
- SDL_PrivateMouseMotion(0, 0, x, y);
- } else if ( mouse_relative) {
- /* RJR: March 28, 2000
- leave physical cursor at center of screen if
- mouse hidden and grabbed */
- SDL_PrivateMouseMotion(0, 0, x, y);
- } else {
- POINT pt;
- pt.x = x;
- pt.y = y;
- ClientToScreen(SDL_Window, &pt);
- SetCursorPos(pt.x, pt.y);
- }
-}
-
-/* Update the current mouse state and position */
-void WIN_UpdateMouse(_THIS)
-{
- RECT rect;
- POINT pt;
-
- if ( ! DDRAW_FULLSCREEN() ) {
- GetClientRect(SDL_Window, &rect);
- GetCursorPos(&pt);
- MapWindowPoints(NULL, SDL_Window, &pt, 1);
- if (PtInRect(&rect, pt) && (WindowFromPoint(pt) == SDL_Window)){
- SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
- SDL_PrivateMouseMotion(0,0, (Sint16)pt.x, (Sint16)pt.y);
- } else {
- SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
- }
- }
-}
-
-/* Check to see if we need to enter or leave mouse relative mode */
-void WIN_CheckMouseMode(_THIS)
-{
-#ifndef _WIN32_WCE
- /* If the mouse is hidden and input is grabbed, we use relative mode */
- if ( !(SDL_cursorstate & CURSOR_VISIBLE) &&
- (this->input_grab != SDL_GRAB_OFF) ) {
- mouse_relative = 1;
- } else {
- mouse_relative = 0;
- }
-#else
- mouse_relative = 0;
-#endif
-}
diff --git a/distrib/sdl-1.2.12/src/video/wincommon/SDL_sysmouse_c.h b/distrib/sdl-1.2.12/src/video/wincommon/SDL_sysmouse_c.h
deleted file mode 100644
index 7afeeef..0000000
--- a/distrib/sdl-1.2.12/src/video/wincommon/SDL_sysmouse_c.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_lowvideo.h"
-
-/* Functions to be exported */
-extern void WIN_FreeWMCursor(_THIS, WMcursor *cursor);
-extern WMcursor *WIN_CreateWMCursor(_THIS,
- Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
-extern int WIN_ShowWMCursor(_THIS, WMcursor *cursor);
-extern void WIN_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
-extern void WIN_UpdateMouse(_THIS);
-extern void WIN_CheckMouseMode(_THIS);
diff --git a/distrib/sdl-1.2.12/src/video/wincommon/SDL_syswm.c b/distrib/sdl-1.2.12/src/video/wincommon/SDL_syswm.c
deleted file mode 100644
index 8bd2c18..0000000
--- a/distrib/sdl-1.2.12/src/video/wincommon/SDL_syswm.c
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-#include "SDL_version.h"
-#include "SDL_video.h"
-#include "SDL_loadso.h"
-#include "SDL_syswm.h"
-#include "../SDL_pixels_c.h"
-#include "../SDL_cursor_c.h"
-#include "SDL_syswm_c.h"
-#include "SDL_wingl_c.h"
-
-
-#ifdef _WIN32_WCE
-#define DISABLE_ICON_SUPPORT
-#endif
-
-/* The screen icon -- needs to be freed on SDL_VideoQuit() */
-HICON screen_icn = NULL;
-
-/* Win32 icon mask semantics are different from those of SDL:
- SDL applies the mask to the icon and copies result to desktop.
- Win32 applies the mask to the desktop and XORs the icon on.
- This means that the SDL mask needs to be applied to the icon and
- then inverted and passed to Win32.
-*/
-void WIN_SetWMIcon(_THIS, SDL_Surface *icon, Uint8 *mask)
-{
-#ifdef DISABLE_ICON_SUPPORT
- return;
-#else
- SDL_Palette *pal_256;
- SDL_Surface *icon_256;
- Uint8 *pdata, *pwin32;
- Uint8 *mdata, *mwin32, m = 0;
- int icon_len;
- int icon_plen;
- int icon_mlen;
- int icon_pitch;
- int mask_pitch;
- SDL_Rect bounds;
- int i, skip;
- int row, col;
- struct /* quasi-BMP format */ Win32Icon {
- Uint32 biSize;
- Sint32 biWidth;
- Sint32 biHeight;
- Uint16 biPlanes;
- Uint16 biBitCount;
- Uint32 biCompression;
- Uint32 biSizeImage;
- Sint32 biXPelsPerMeter;
- Sint32 biYPelsPerMeter;
- Uint32 biClrUsed;
- Uint32 biClrImportant;
- struct /* RGBQUAD -- note it's BGR ordered */ {
- Uint8 rgbBlue;
- Uint8 rgbGreen;
- Uint8 rgbRed;
- Uint8 rgbReserved;
- } biColors[256];
- /* Pixels:
- Uint8 pixels[]
- */
- /* Mask:
- Uint8 mask[]
- */
- } *icon_win32;
-
- /* Allocate the win32 bmp icon and set everything to zero */
- icon_pitch = ((icon->w+3)&~3);
- mask_pitch = ((icon->w+7)/8);
- icon_plen = icon->h*icon_pitch;
- icon_mlen = icon->h*mask_pitch;
- icon_len = sizeof(*icon_win32)+icon_plen+icon_mlen;
- icon_win32 = (struct Win32Icon *)SDL_stack_alloc(Uint8, icon_len);
- if ( icon_win32 == NULL ) {
- return;
- }
- SDL_memset(icon_win32, 0, icon_len);
-
- /* Set the basic BMP parameters */
- icon_win32->biSize = sizeof(*icon_win32)-sizeof(icon_win32->biColors);
- icon_win32->biWidth = icon->w;
- icon_win32->biHeight = icon->h*2;
- icon_win32->biPlanes = 1;
- icon_win32->biBitCount = 8;
- icon_win32->biSizeImage = icon_plen+icon_mlen;
-
- /* Allocate a standard 256 color icon surface */
- icon_256 = SDL_CreateRGBSurface(SDL_SWSURFACE, icon->w, icon->h,
- icon_win32->biBitCount, 0, 0, 0, 0);
- if ( icon_256 == NULL ) {
- SDL_stack_free(icon_win32);
- return;
- }
- pal_256 = icon_256->format->palette;
- if (icon->format->palette &&
- (icon->format->BitsPerPixel == icon_256->format->BitsPerPixel)){
- Uint8 black;
- SDL_memcpy(pal_256->colors, icon->format->palette->colors,
- pal_256->ncolors*sizeof(SDL_Color));
- /* Make sure that 0 is black! */
- black = SDL_FindColor(pal_256, 0x00, 0x00, 0x00);
- pal_256->colors[black] = pal_256->colors[0];
- pal_256->colors[0].r = 0x00;
- pal_256->colors[0].g = 0x00;
- pal_256->colors[0].b = 0x00;
- } else {
- SDL_DitherColors(pal_256->colors,
- icon_256->format->BitsPerPixel);
- }
-
- /* Now copy color data to the icon BMP */
- for ( i=0; i<(1<<icon_win32->biBitCount); ++i ) {
- icon_win32->biColors[i].rgbRed = pal_256->colors[i].r;
- icon_win32->biColors[i].rgbGreen = pal_256->colors[i].g;
- icon_win32->biColors[i].rgbBlue = pal_256->colors[i].b;
- }
-
- /* Convert icon to a standard surface format. This may not always
- be necessary, as Windows supports a variety of BMP formats, but
- it greatly simplifies our code.
- */
- bounds.x = 0;
- bounds.y = 0;
- bounds.w = icon->w;
- bounds.h = icon->h;
- if ( SDL_LowerBlit(icon, &bounds, icon_256, &bounds) < 0 ) {
- SDL_stack_free(icon_win32);
- SDL_FreeSurface(icon_256);
- return;
- }
-
- /* Copy pixels upside-down to icon BMP, masked with the icon mask */
- if ( SDL_MUSTLOCK(icon_256) || (icon_256->pitch != icon_pitch) ) {
- SDL_stack_free(icon_win32);
- SDL_FreeSurface(icon_256);
- SDL_SetError("Warning: Unexpected icon_256 characteristics");
- return;
- }
- pdata = (Uint8 *)icon_256->pixels;
- mdata = mask;
- pwin32 = (Uint8 *)icon_win32+sizeof(*icon_win32)+icon_plen-icon_pitch;
- skip = icon_pitch - icon->w;
- for ( row=0; row<icon->h; ++row ) {
- for ( col=0; col<icon->w; ++col ) {
- if ( (col%8) == 0 ) {
- m = *mdata++;
- }
- if ( (m&0x80) != 0x00 ) {
- *pwin32 = *pdata;
- }
- m <<= 1;
- ++pdata;
- ++pwin32;
- }
- pdata += skip;
- pwin32 += skip;
- pwin32 -= 2*icon_pitch;
- }
- SDL_FreeSurface(icon_256);
-
- /* Copy mask inverted and upside-down to icon BMP */
- mdata = mask;
- mwin32 = (Uint8 *)icon_win32
- +sizeof(*icon_win32)+icon_plen+icon_mlen-mask_pitch;
- for ( row=0; row<icon->h; ++row ) {
- for ( col=0; col<mask_pitch; ++col ) {
- *mwin32++ = ~*mdata++;
- }
- mwin32 -= 2*mask_pitch;
- }
-
- /* Finally, create the icon handle and set the window icon */
- screen_icn = CreateIconFromResourceEx((Uint8 *)icon_win32, icon_len,
- TRUE, 0x00030000, icon->w, icon->h, LR_DEFAULTCOLOR);
- if ( screen_icn == NULL ) {
- SDL_SetError("Couldn't create Win32 icon handle");
- } else {
- SetClassLongPtr(SDL_Window, GCLP_HICON, (LONG_PTR)screen_icn);
- }
- SDL_stack_free(icon_win32);
-#endif /* DISABLE_ICON_SUPPORT */
-}
-
-typedef BOOL (WINAPI *PtrSetWindowTextW)(HWND hWnd, LPCWSTR lpString);
-
-void WIN_SetWMCaption(_THIS, const char *title, const char *icon)
-{
-#ifdef _WIN32_WCE
- /* WinCE uses the UNICODE version */
- LPWSTR lpszW = SDL_iconv_utf8_ucs2((char *)title);
- SetWindowText(SDL_Window, lpszW);
- SDL_free(lpszW);
-#else
- /*
- * Try loading SetWindowTextW from kernel32.dll first, and if it exists,
- * pass the UCS-2 string to it. If it doesn't, use
- * WideCharToMultiByte(CP_ACP) and hope that the codepage can support the
- * string data in question. This lets us keep binary compatibility with
- * Win95/98/ME but still use saner Unicode on NT-based Windows.
- */
- static int tried_loading = 0;
- static PtrSetWindowTextW swtw = NULL;
- Uint16 *lpsz = SDL_iconv_utf8_ucs2(title);
- if (!tried_loading) {
- HMODULE dll = LoadLibrary("user32.dll");
- if (dll != NULL) {
- swtw = (PtrSetWindowTextW) GetProcAddress(dll, "SetWindowTextW");
- if (swtw == NULL) {
- FreeLibrary(dll);
- }
- }
- tried_loading = 1;
- }
-
- if (swtw != NULL) {
- swtw(SDL_Window, lpsz);
- } else {
- size_t len = WideCharToMultiByte(CP_ACP, 0, lpsz, -1, NULL, 0, NULL, NULL);
- char *cvt = SDL_malloc(len + 1);
- WideCharToMultiByte(CP_ACP, 0, lpsz, -1, cvt, len, NULL, NULL);
- SetWindowText(SDL_Window, cvt);
- SDL_free(cvt);
- }
- SDL_free(lpsz);
-#endif
-}
-
-int WIN_IconifyWindow(_THIS)
-{
- ShowWindow(SDL_Window, SW_MINIMIZE);
- return(1);
-}
-
-SDL_GrabMode WIN_GrabInput(_THIS, SDL_GrabMode mode)
-{
- if ( mode == SDL_GRAB_OFF ) {
- ClipCursor(NULL);
- if ( !(SDL_cursorstate & CURSOR_VISIBLE) ) {
- /* RJR: March 28, 2000
- must be leaving relative mode, move mouse from
- center of window to where it belongs ... */
- POINT pt;
- int x, y;
- SDL_GetMouseState(&x,&y);
- pt.x = x;
- pt.y = y;
- ClientToScreen(SDL_Window, &pt);
- SetCursorPos(pt.x,pt.y);
- }
-#ifdef _WIN32_WCE
- AllKeys(0);
-#endif
- } else {
- ClipCursor(&SDL_bounds);
- if ( !(SDL_cursorstate & CURSOR_VISIBLE) ) {
- /* RJR: March 28, 2000
- must be entering relative mode, get ready by
- moving mouse to center of window ... */
- POINT pt;
- pt.x = (SDL_VideoSurface->w/2);
- pt.y = (SDL_VideoSurface->h/2);
- ClientToScreen(SDL_Window, &pt);
- SetCursorPos(pt.x, pt.y);
- }
-#ifdef _WIN32_WCE
- AllKeys(1);
-#endif
- }
- return(mode);
-}
-
-/* If 'info' is the right version, this function fills it and returns 1.
- Otherwise, in case of a version mismatch, it returns -1.
-*/
-int WIN_GetWMInfo(_THIS, SDL_SysWMinfo *info)
-{
- if ( info->version.major <= SDL_MAJOR_VERSION ) {
- info->window = SDL_Window;
- if ( SDL_VERSIONNUM(info->version.major,
- info->version.minor,
- info->version.patch) >=
- SDL_VERSIONNUM(1, 2, 5) ) {
-#if SDL_VIDEO_OPENGL
- info->hglrc = GL_hrc;
-#else
- info->hglrc = NULL;
-#endif
- }
- return(1);
- } else {
- SDL_SetError("Application not compiled with SDL %d.%d\n",
- SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
- return(-1);
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/wincommon/SDL_syswm_c.h b/distrib/sdl-1.2.12/src/video/wincommon/SDL_syswm_c.h
deleted file mode 100644
index d245e7f..0000000
--- a/distrib/sdl-1.2.12/src/video/wincommon/SDL_syswm_c.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_lowvideo.h"
-
-/* Data that needs to be freed at SDL_SYS_VideoQuit() */
-extern HICON screen_icn;
-
-/* Functions to be exported */
-extern void WIN_SetWMIcon(_THIS, SDL_Surface *icon, Uint8 *mask);
-extern void WIN_SetWMCaption(_THIS, const char *title, const char *icon);
-extern int WIN_IconifyWindow(_THIS);
-extern SDL_GrabMode WIN_GrabInput(_THIS, SDL_GrabMode mode);
-extern int WIN_GetWMInfo(_THIS, SDL_SysWMinfo *info);
-
diff --git a/distrib/sdl-1.2.12/src/video/wincommon/SDL_wingl.c b/distrib/sdl-1.2.12/src/video/wincommon/SDL_wingl.c
deleted file mode 100644
index e807111..0000000
--- a/distrib/sdl-1.2.12/src/video/wincommon/SDL_wingl.c
+++ /dev/null
@@ -1,647 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* WGL implementation of SDL OpenGL support */
-
-#if SDL_VIDEO_OPENGL
-#include "SDL_opengl.h"
-#endif
-#include "SDL_lowvideo.h"
-#include "SDL_wingl_c.h"
-
-#if SDL_VIDEO_OPENGL
-#define DEFAULT_GL_DRIVER_PATH "OPENGL32.DLL"
-#endif
-
-/* If setting the HDC fails, we may need to recreate the window (MSDN) */
-static int WIN_GL_ResetWindow(_THIS)
-{
- int status = 0;
-
-#ifndef _WIN32_WCE /* FIXME WinCE needs the UNICODE version of CreateWindow() */
- /* This doesn't work with DirectX code (see CVS comments) */
- /* If we were passed a window, then we can't create a new one */
- if ( !SDL_windowid && SDL_strcmp(this->name, "windib") == 0 ) {
- /* Save the existing window attributes */
- LONG style;
- RECT rect = { 0, 0, 0, 0 };
- style = GetWindowLong(SDL_Window, GWL_STYLE);
- GetWindowRect(SDL_Window, &rect);
- DestroyWindow(SDL_Window);
- WIN_FlushMessageQueue();
-
- SDL_resizing = 1;
- SDL_Window = CreateWindow(SDL_Appname, SDL_Appname,
- style,
- rect.left, rect.top,
- (rect.right-rect.left)+1,
- (rect.bottom-rect.top)+1,
- NULL, NULL, SDL_Instance, NULL);
- WIN_FlushMessageQueue();
- SDL_resizing = 0;
-
- if ( SDL_Window ) {
- this->SetCaption(this, this->wm_title, this->wm_icon);
- } else {
- SDL_SetError("Couldn't create window");
- status = -1;
- }
- } else
-#endif /* !_WIN32_WCE */
- {
- SDL_SetError("Unable to reset window for OpenGL context");
- status = -1;
- }
- return(status);
-}
-
-#if SDL_VIDEO_OPENGL
-
-static int ExtensionSupported(const char *extension, const char *extensions)
-{
- const char *start;
- const char *where, *terminator;
-
- /* Extension names should not have spaces. */
- where = SDL_strchr(extension, ' ');
- if ( where || *extension == '\0' )
- return 0;
-
- if ( ! extensions )
- return 0;
-
- /* It takes a bit of care to be fool-proof about parsing the
- * OpenGL extensions string. Don't be fooled by sub-strings,
- * etc. */
-
- start = extensions;
-
- for (;;)
- {
- where = SDL_strstr(start, extension);
- if (!where) break;
-
- terminator = where + SDL_strlen(extension);
- if (where == start || *(where - 1) == ' ')
- if (*terminator == ' ' || *terminator == '\0') return 1;
-
- start = terminator;
- }
-
- return 0;
-}
-
-static int ChoosePixelFormatARB(_THIS, const int *iAttribs, const FLOAT *fAttribs)
-{
- HWND hwnd;
- HDC hdc;
- HGLRC hglrc;
- const char * (WINAPI *wglGetExtensionsStringARB)(HDC) = 0;
- const char *extensions;
- int pformat = 0;
- UINT matches = 0;
-
- hwnd = CreateWindow(SDL_Appname, SDL_Appname, WS_POPUP | WS_DISABLED,
- 0, 0, 10, 10,
- NULL, NULL, SDL_Instance, NULL);
- WIN_FlushMessageQueue();
-
- hdc = GetDC(hwnd);
-
- SetPixelFormat(hdc, ChoosePixelFormat(hdc, &GL_pfd), &GL_pfd);
-
- hglrc = this->gl_data->wglCreateContext(hdc);
- if ( hglrc ) {
- this->gl_data->wglMakeCurrent(hdc, hglrc);
- }
-
- wglGetExtensionsStringARB = (const char * (WINAPI *)(HDC))
- this->gl_data->wglGetProcAddress("wglGetExtensionsStringARB");
-
- if( wglGetExtensionsStringARB ) {
- extensions = wglGetExtensionsStringARB(hdc);
- } else {
- extensions = NULL;
- }
-
- this->gl_data->WGL_ARB_pixel_format = 0;
- if( ExtensionSupported("WGL_ARB_pixel_format", extensions) ) {
- BOOL (WINAPI *wglChoosePixelFormatARB)(HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
- wglChoosePixelFormatARB =
- (BOOL (WINAPI *)(HDC, const int *, const FLOAT *, UINT, int *, UINT *))
- this->gl_data->wglGetProcAddress("wglChoosePixelFormatARB");
- if( wglChoosePixelFormatARB &&
- wglChoosePixelFormatARB(hdc, iAttribs, fAttribs, 1, &pformat, &matches) && pformat ) {
- this->gl_data->WGL_ARB_pixel_format = 1;
- }
- }
-
- if ( hglrc ) {
- this->gl_data->wglMakeCurrent(NULL, NULL);
- this->gl_data->wglDeleteContext(hglrc);
- }
- ReleaseDC(hwnd, hdc);
- DestroyWindow(hwnd);
- WIN_FlushMessageQueue();
-
- return pformat;
-}
-
-#endif /* SDL_VIDEO_OPENGL */
-
-int WIN_GL_SetupWindow(_THIS)
-{
- int retval;
-#if SDL_VIDEO_OPENGL
- int i;
- int iAttribs[64];
- int *iAttr;
- float fAttribs[1] = { 0 };
- const GLubyte *(WINAPI *glGetStringFunc)(GLenum);
- const char *wglext;
-
- /* load the gl driver from a default path */
- if ( ! this->gl_config.driver_loaded ) {
- /* no driver has been loaded, use default (ourselves) */
- if ( WIN_GL_LoadLibrary(this, NULL) < 0 ) {
- return(-1);
- }
- }
-
- /* Set up the pixel format descriptor with our needed format */
- SDL_memset(&GL_pfd, 0, sizeof(GL_pfd));
- GL_pfd.nSize = sizeof(GL_pfd);
- GL_pfd.nVersion = 1;
- GL_pfd.dwFlags = (PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL);
- if ( this->gl_config.double_buffer ) {
- GL_pfd.dwFlags |= PFD_DOUBLEBUFFER;
- }
- if ( this->gl_config.stereo ) {
- GL_pfd.dwFlags |= PFD_STEREO;
- }
- GL_pfd.iPixelType = PFD_TYPE_RGBA;
- GL_pfd.cColorBits = this->gl_config.buffer_size;
- GL_pfd.cRedBits = this->gl_config.red_size;
- GL_pfd.cGreenBits = this->gl_config.green_size;
- GL_pfd.cBlueBits = this->gl_config.blue_size;
- GL_pfd.cAlphaBits = this->gl_config.alpha_size;
- GL_pfd.cAccumRedBits = this->gl_config.accum_red_size;
- GL_pfd.cAccumGreenBits = this->gl_config.accum_green_size;
- GL_pfd.cAccumBlueBits = this->gl_config.accum_blue_size;
- GL_pfd.cAccumAlphaBits = this->gl_config.accum_alpha_size;
- GL_pfd.cAccumBits =
- (GL_pfd.cAccumRedBits + GL_pfd.cAccumGreenBits +
- GL_pfd.cAccumBlueBits + GL_pfd.cAccumAlphaBits);
- GL_pfd.cDepthBits = this->gl_config.depth_size;
- GL_pfd.cStencilBits = this->gl_config.stencil_size;
-
- /* setup WGL_ARB_pixel_format attribs */
- iAttr = &iAttribs[0];
-
- *iAttr++ = WGL_DRAW_TO_WINDOW_ARB;
- *iAttr++ = GL_TRUE;
- *iAttr++ = WGL_ACCELERATION_ARB;
- *iAttr++ = WGL_FULL_ACCELERATION_ARB;
- *iAttr++ = WGL_RED_BITS_ARB;
- *iAttr++ = this->gl_config.red_size;
- *iAttr++ = WGL_GREEN_BITS_ARB;
- *iAttr++ = this->gl_config.green_size;
- *iAttr++ = WGL_BLUE_BITS_ARB;
- *iAttr++ = this->gl_config.blue_size;
-
- if ( this->gl_config.alpha_size ) {
- *iAttr++ = WGL_ALPHA_BITS_ARB;
- *iAttr++ = this->gl_config.alpha_size;
- }
-
- *iAttr++ = WGL_DOUBLE_BUFFER_ARB;
- *iAttr++ = this->gl_config.double_buffer;
-
- *iAttr++ = WGL_DEPTH_BITS_ARB;
- *iAttr++ = this->gl_config.depth_size;
-
- if ( this->gl_config.stencil_size ) {
- *iAttr++ = WGL_STENCIL_BITS_ARB;
- *iAttr++ = this->gl_config.stencil_size;
- }
-
- if ( this->gl_config.accum_red_size ) {
- *iAttr++ = WGL_ACCUM_RED_BITS_ARB;
- *iAttr++ = this->gl_config.accum_red_size;
- }
-
- if ( this->gl_config.accum_green_size ) {
- *iAttr++ = WGL_ACCUM_GREEN_BITS_ARB;
- *iAttr++ = this->gl_config.accum_green_size;
- }
-
- if ( this->gl_config.accum_blue_size ) {
- *iAttr++ = WGL_ACCUM_BLUE_BITS_ARB;
- *iAttr++ = this->gl_config.accum_blue_size;
- }
-
- if ( this->gl_config.accum_alpha_size ) {
- *iAttr++ = WGL_ACCUM_ALPHA_BITS_ARB;
- *iAttr++ = this->gl_config.accum_alpha_size;
- }
-
- if ( this->gl_config.stereo ) {
- *iAttr++ = WGL_STEREO_ARB;
- *iAttr++ = GL_TRUE;
- }
-
- if ( this->gl_config.multisamplebuffers ) {
- *iAttr++ = WGL_SAMPLE_BUFFERS_ARB;
- *iAttr++ = this->gl_config.multisamplebuffers;
- }
-
- if ( this->gl_config.multisamplesamples ) {
- *iAttr++ = WGL_SAMPLES_ARB;
- *iAttr++ = this->gl_config.multisamplesamples;
- }
-
- if ( this->gl_config.accelerated >= 0 ) {
- *iAttr++ = WGL_ACCELERATION_ARB;
- *iAttr++ = (this->gl_config.accelerated ? WGL_GENERIC_ACCELERATION_ARB : WGL_NO_ACCELERATION_ARB);
- }
-
- *iAttr = 0;
-
- for ( i=0; ; ++i ) {
- /* Get the window device context for our OpenGL drawing */
- GL_hdc = GetDC(SDL_Window);
- if ( GL_hdc == NULL ) {
- SDL_SetError("Unable to get DC for SDL_Window");
- return(-1);
- }
-
- /* Choose and set the closest available pixel format */
- pixel_format = ChoosePixelFormatARB(this, iAttribs, fAttribs);
- if ( !pixel_format ) {
- pixel_format = ChoosePixelFormat(GL_hdc, &GL_pfd);
- }
- if ( !pixel_format ) {
- SDL_SetError("No matching GL pixel format available");
- return(-1);
- }
- if ( !SetPixelFormat(GL_hdc, pixel_format, &GL_pfd) ) {
- if ( i == 0 ) {
- /* First time through, try resetting the window */
- if ( WIN_GL_ResetWindow(this) < 0 ) {
- return(-1);
- }
- continue;
- }
- SDL_SetError("Unable to set HDC pixel format");
- return(-1);
- }
- /* We either succeeded or failed by this point */
- break;
- }
- DescribePixelFormat(GL_hdc, pixel_format, sizeof(GL_pfd), &GL_pfd);
-
- GL_hrc = this->gl_data->wglCreateContext(GL_hdc);
- if ( GL_hrc == NULL ) {
- SDL_SetError("Unable to create GL context");
- return(-1);
- }
- if ( WIN_GL_MakeCurrent(this) < 0 ) {
- return(-1);
- }
- gl_active = 1;
-
- /* Get the wglGetPixelFormatAttribivARB pointer for the context */
- if ( this->gl_data->WGL_ARB_pixel_format ) {
- this->gl_data->wglGetPixelFormatAttribivARB =
- (BOOL (WINAPI *)(HDC, int, int, UINT, const int *, int *))
- this->gl_data->wglGetProcAddress("wglGetPixelFormatAttribivARB");
- } else {
- this->gl_data->wglGetPixelFormatAttribivARB = NULL;
- }
-
- /* Vsync control under Windows. Checking glGetString here is
- * somewhat a documented and reliable hack - it was originally
- * as a feature added by mistake, but since so many people rely
- * on it, it will not be removed. strstr should be safe here.*/
- glGetStringFunc = WIN_GL_GetProcAddress(this, "glGetString");
- if ( glGetStringFunc ) {
- wglext = (const char *)glGetStringFunc(GL_EXTENSIONS);
- } else {
- /* Uh oh, something is seriously wrong here... */
- wglext = NULL;
- }
- if ( wglext && SDL_strstr(wglext, "WGL_EXT_swap_control") ) {
- this->gl_data->wglSwapIntervalEXT = WIN_GL_GetProcAddress(this, "wglSwapIntervalEXT");
- this->gl_data->wglGetSwapIntervalEXT = WIN_GL_GetProcAddress(this, "wglGetSwapIntervalEXT");
- } else {
- this->gl_data->wglSwapIntervalEXT = NULL;
- this->gl_data->wglGetSwapIntervalEXT = NULL;
- }
- if ( this->gl_config.swap_control >= 0 ) {
- if ( this->gl_data->wglSwapIntervalEXT ) {
- this->gl_data->wglSwapIntervalEXT(this->gl_config.swap_control);
- }
- }
-#else
- SDL_SetError("WIN driver not configured with OpenGL");
-#endif
- if ( gl_active ) {
- retval = 0;
- } else {
- retval = -1;
- }
- return(retval);
-}
-
-void WIN_GL_ShutDown(_THIS)
-{
-#if SDL_VIDEO_OPENGL
- /* Clean up OpenGL */
- if ( GL_hrc ) {
- this->gl_data->wglMakeCurrent(NULL, NULL);
- this->gl_data->wglDeleteContext(GL_hrc);
- GL_hrc = NULL;
- }
- if ( GL_hdc ) {
- ReleaseDC(SDL_Window, GL_hdc);
- GL_hdc = NULL;
- }
- gl_active = 0;
-
- WIN_GL_UnloadLibrary(this);
-#endif /* SDL_VIDEO_OPENGL */
-}
-
-#if SDL_VIDEO_OPENGL
-
-/* Make the current context active */
-int WIN_GL_MakeCurrent(_THIS)
-{
- int retval;
-
- retval = 0;
- if ( ! this->gl_data->wglMakeCurrent(GL_hdc, GL_hrc) ) {
- SDL_SetError("Unable to make GL context current");
- retval = -1;
- }
- return(retval);
-}
-
-/* Get attribute data from wgl. */
-int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
-{
- int retval;
-
- if (attrib == SDL_GL_SWAP_CONTROL) {
- if ( this->gl_data->wglGetSwapIntervalEXT ) {
- *value = this->gl_data->wglGetSwapIntervalEXT();
- return 0;
- }
- return -1;
- }
-
- if ( this->gl_data->wglGetPixelFormatAttribivARB ) {
- int wgl_attrib;
-
- switch(attrib) {
- case SDL_GL_RED_SIZE:
- wgl_attrib = WGL_RED_BITS_ARB;
- break;
- case SDL_GL_GREEN_SIZE:
- wgl_attrib = WGL_GREEN_BITS_ARB;
- break;
- case SDL_GL_BLUE_SIZE:
- wgl_attrib = WGL_BLUE_BITS_ARB;
- break;
- case SDL_GL_ALPHA_SIZE:
- wgl_attrib = WGL_ALPHA_BITS_ARB;
- break;
- case SDL_GL_DOUBLEBUFFER:
- wgl_attrib = WGL_DOUBLE_BUFFER_ARB;
- break;
- case SDL_GL_BUFFER_SIZE:
- wgl_attrib = WGL_COLOR_BITS_ARB;
- break;
- case SDL_GL_DEPTH_SIZE:
- wgl_attrib = WGL_DEPTH_BITS_ARB;
- break;
- case SDL_GL_STENCIL_SIZE:
- wgl_attrib = WGL_STENCIL_BITS_ARB;
- break;
- case SDL_GL_ACCUM_RED_SIZE:
- wgl_attrib = WGL_ACCUM_RED_BITS_ARB;
- break;
- case SDL_GL_ACCUM_GREEN_SIZE:
- wgl_attrib = WGL_ACCUM_GREEN_BITS_ARB;
- break;
- case SDL_GL_ACCUM_BLUE_SIZE:
- wgl_attrib = WGL_ACCUM_BLUE_BITS_ARB;
- break;
- case SDL_GL_ACCUM_ALPHA_SIZE:
- wgl_attrib = WGL_ACCUM_ALPHA_BITS_ARB;
- break;
- case SDL_GL_STEREO:
- wgl_attrib = WGL_STEREO_ARB;
- break;
- case SDL_GL_MULTISAMPLEBUFFERS:
- wgl_attrib = WGL_SAMPLE_BUFFERS_ARB;
- break;
- case SDL_GL_MULTISAMPLESAMPLES:
- wgl_attrib = WGL_SAMPLES_ARB;
- break;
- case SDL_GL_ACCELERATED_VISUAL:
- wgl_attrib = WGL_ACCELERATION_ARB;
- this->gl_data->wglGetPixelFormatAttribivARB(GL_hdc, pixel_format, 0, 1, &wgl_attrib, value);
- if ( *value == WGL_NO_ACCELERATION_ARB ) {
- *value = SDL_FALSE;
- } else {
- *value = SDL_TRUE;
- }
- return 0;
- default:
- return(-1);
- }
- this->gl_data->wglGetPixelFormatAttribivARB(GL_hdc, pixel_format, 0, 1, &wgl_attrib, value);
-
- return 0;
- }
-
- retval = 0;
- switch ( attrib ) {
- case SDL_GL_RED_SIZE:
- *value = GL_pfd.cRedBits;
- break;
- case SDL_GL_GREEN_SIZE:
- *value = GL_pfd.cGreenBits;
- break;
- case SDL_GL_BLUE_SIZE:
- *value = GL_pfd.cBlueBits;
- break;
- case SDL_GL_ALPHA_SIZE:
- *value = GL_pfd.cAlphaBits;
- break;
- case SDL_GL_DOUBLEBUFFER:
- if ( GL_pfd.dwFlags & PFD_DOUBLEBUFFER ) {
- *value = 1;
- } else {
- *value = 0;
- }
- break;
- case SDL_GL_BUFFER_SIZE:
- *value = GL_pfd.cColorBits;
- break;
- case SDL_GL_DEPTH_SIZE:
- *value = GL_pfd.cDepthBits;
- break;
- case SDL_GL_STENCIL_SIZE:
- *value = GL_pfd.cStencilBits;
- break;
- case SDL_GL_ACCUM_RED_SIZE:
- *value = GL_pfd.cAccumRedBits;
- break;
- case SDL_GL_ACCUM_GREEN_SIZE:
- *value = GL_pfd.cAccumGreenBits;
- break;
- case SDL_GL_ACCUM_BLUE_SIZE:
- *value = GL_pfd.cAccumBlueBits;
- break;
- case SDL_GL_ACCUM_ALPHA_SIZE:
- *value = GL_pfd.cAccumAlphaBits;
- break;
- case SDL_GL_STEREO:
- if ( GL_pfd.dwFlags & PFD_STEREO ) {
- *value = 1;
- } else {
- *value = 0;
- }
- break;
- case SDL_GL_MULTISAMPLEBUFFERS:
- *value = 0;
- break;
- case SDL_GL_MULTISAMPLESAMPLES:
- *value = 1;
- break;
- case SDL_GL_SWAP_CONTROL:
- if ( this->gl_data->wglGetSwapIntervalEXT ) {
- *value = this->gl_data->wglGetSwapIntervalEXT();
- return 0;
- } else {
- return -1;
- }
- break;
- default:
- retval = -1;
- break;
- }
- return retval;
-}
-
-void WIN_GL_SwapBuffers(_THIS)
-{
- SwapBuffers(GL_hdc);
-}
-
-void WIN_GL_UnloadLibrary(_THIS)
-{
- if ( this->gl_config.driver_loaded ) {
- FreeLibrary((HMODULE)this->gl_config.dll_handle);
-
- this->gl_data->wglGetProcAddress = NULL;
- this->gl_data->wglCreateContext = NULL;
- this->gl_data->wglDeleteContext = NULL;
- this->gl_data->wglMakeCurrent = NULL;
- this->gl_data->wglGetPixelFormatAttribivARB = NULL;
- this->gl_data->wglSwapIntervalEXT = NULL;
- this->gl_data->wglGetSwapIntervalEXT = NULL;
-
- this->gl_config.dll_handle = NULL;
- this->gl_config.driver_loaded = 0;
- }
-}
-
-/* Passing a NULL path means load pointers from the application */
-int WIN_GL_LoadLibrary(_THIS, const char* path)
-{
- HMODULE handle;
-
- if ( gl_active ) {
- SDL_SetError("OpenGL context already created");
- return -1;
- }
-
- if ( path == NULL ) {
- path = DEFAULT_GL_DRIVER_PATH;
- }
- handle = LoadLibrary(path);
- if ( handle == NULL ) {
- SDL_SetError("Could not load OpenGL library");
- return -1;
- }
-
- /* Unload the old driver and reset the pointers */
- WIN_GL_UnloadLibrary(this);
-
- /* Load new function pointers */
- SDL_memset(this->gl_data, 0, sizeof(*this->gl_data));
- this->gl_data->wglGetProcAddress = (void * (WINAPI *)(const char *))
- GetProcAddress(handle, "wglGetProcAddress");
- this->gl_data->wglCreateContext = (HGLRC (WINAPI *)(HDC))
- GetProcAddress(handle, "wglCreateContext");
- this->gl_data->wglDeleteContext = (BOOL (WINAPI *)(HGLRC))
- GetProcAddress(handle, "wglDeleteContext");
- this->gl_data->wglMakeCurrent = (BOOL (WINAPI *)(HDC, HGLRC))
- GetProcAddress(handle, "wglMakeCurrent");
- this->gl_data->wglSwapIntervalEXT = (void (WINAPI *)(int))
- GetProcAddress(handle, "wglSwapIntervalEXT");
- this->gl_data->wglGetSwapIntervalEXT = (int (WINAPI *)(void))
- GetProcAddress(handle, "wglGetSwapIntervalEXT");
-
- if ( (this->gl_data->wglGetProcAddress == NULL) ||
- (this->gl_data->wglCreateContext == NULL) ||
- (this->gl_data->wglDeleteContext == NULL) ||
- (this->gl_data->wglMakeCurrent == NULL) ) {
- SDL_SetError("Could not retrieve OpenGL functions");
- FreeLibrary(handle);
- return -1;
- }
-
- this->gl_config.dll_handle = handle;
- SDL_strlcpy(this->gl_config.driver_path, path, SDL_arraysize(this->gl_config.driver_path));
- this->gl_config.driver_loaded = 1;
- return 0;
-}
-
-void *WIN_GL_GetProcAddress(_THIS, const char* proc)
-{
- void *func;
-
- /* This is to pick up extensions */
- func = this->gl_data->wglGetProcAddress(proc);
- if ( ! func ) {
- /* This is probably a normal GL function */
- func = GetProcAddress(this->gl_config.dll_handle, proc);
- }
- return func;
-}
-
-#endif /* SDL_VIDEO_OPENGL */
diff --git a/distrib/sdl-1.2.12/src/video/wincommon/SDL_wingl_c.h b/distrib/sdl-1.2.12/src/video/wincommon/SDL_wingl_c.h
deleted file mode 100644
index e800bec..0000000
--- a/distrib/sdl-1.2.12/src/video/wincommon/SDL_wingl_c.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* WGL implementation of SDL OpenGL support */
-
-#include "../SDL_sysvideo.h"
-
-
-struct SDL_PrivateGLData {
- int gl_active; /* to stop switching drivers while we have a valid context */
-
-#if SDL_VIDEO_OPENGL
- PIXELFORMATDESCRIPTOR GL_pfd;
- HDC GL_hdc;
- HGLRC GL_hrc;
- int pixel_format;
- int WGL_ARB_pixel_format;
-
- void * (WINAPI *wglGetProcAddress)(const char *proc);
-
- HGLRC (WINAPI *wglCreateContext)(HDC hdc);
-
- BOOL (WINAPI *wglDeleteContext)(HGLRC hglrc);
-
- BOOL (WINAPI *wglMakeCurrent)(HDC hdc, HGLRC hglrc);
-
- BOOL (WINAPI *wglGetPixelFormatAttribivARB)(HDC hdc, int iPixelFormat,
- int iLayerPlane,
- UINT nAttributes,
- const int *piAttributes,
- int *piValues);
- void (WINAPI *wglSwapIntervalEXT)(int interval);
- int (WINAPI *wglGetSwapIntervalEXT)(void);
-#endif /* SDL_VIDEO_OPENGL */
-};
-
-/* Old variable names */
-#define gl_active (this->gl_data->gl_active)
-#define GL_pfd (this->gl_data->GL_pfd)
-#define GL_hdc (this->gl_data->GL_hdc)
-#define GL_hrc (this->gl_data->GL_hrc)
-#define pixel_format (this->gl_data->pixel_format)
-
-/* OpenGL functions */
-extern int WIN_GL_SetupWindow(_THIS);
-extern void WIN_GL_ShutDown(_THIS);
-#if SDL_VIDEO_OPENGL
-extern int WIN_GL_MakeCurrent(_THIS);
-extern int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
-extern void WIN_GL_SwapBuffers(_THIS);
-extern void WIN_GL_UnloadLibrary(_THIS);
-extern int WIN_GL_LoadLibrary(_THIS, const char* path);
-extern void *WIN_GL_GetProcAddress(_THIS, const char* proc);
-#endif
-
-#if SDL_VIDEO_OPENGL
-
-#ifndef WGL_ARB_pixel_format
-#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
-#define WGL_DRAW_TO_WINDOW_ARB 0x2001
-#define WGL_DRAW_TO_BITMAP_ARB 0x2002
-#define WGL_ACCELERATION_ARB 0x2003
-#define WGL_NEED_PALETTE_ARB 0x2004
-#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
-#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
-#define WGL_SWAP_METHOD_ARB 0x2007
-#define WGL_NUMBER_OVERLAYS_ARB 0x2008
-#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
-#define WGL_TRANSPARENT_ARB 0x200A
-#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
-#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
-#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
-#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
-#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
-#define WGL_SHARE_DEPTH_ARB 0x200C
-#define WGL_SHARE_STENCIL_ARB 0x200D
-#define WGL_SHARE_ACCUM_ARB 0x200E
-#define WGL_SUPPORT_GDI_ARB 0x200F
-#define WGL_SUPPORT_OPENGL_ARB 0x2010
-#define WGL_DOUBLE_BUFFER_ARB 0x2011
-#define WGL_STEREO_ARB 0x2012
-#define WGL_PIXEL_TYPE_ARB 0x2013
-#define WGL_COLOR_BITS_ARB 0x2014
-#define WGL_RED_BITS_ARB 0x2015
-#define WGL_RED_SHIFT_ARB 0x2016
-#define WGL_GREEN_BITS_ARB 0x2017
-#define WGL_GREEN_SHIFT_ARB 0x2018
-#define WGL_BLUE_BITS_ARB 0x2019
-#define WGL_BLUE_SHIFT_ARB 0x201A
-#define WGL_ALPHA_BITS_ARB 0x201B
-#define WGL_ALPHA_SHIFT_ARB 0x201C
-#define WGL_ACCUM_BITS_ARB 0x201D
-#define WGL_ACCUM_RED_BITS_ARB 0x201E
-#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
-#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
-#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
-#define WGL_DEPTH_BITS_ARB 0x2022
-#define WGL_STENCIL_BITS_ARB 0x2023
-#define WGL_AUX_BUFFERS_ARB 0x2024
-#define WGL_NO_ACCELERATION_ARB 0x2025
-#define WGL_GENERIC_ACCELERATION_ARB 0x2026
-#define WGL_FULL_ACCELERATION_ARB 0x2027
-#define WGL_SWAP_EXCHANGE_ARB 0x2028
-#define WGL_SWAP_COPY_ARB 0x2029
-#define WGL_SWAP_UNDEFINED_ARB 0x202A
-#define WGL_TYPE_RGBA_ARB 0x202B
-#define WGL_TYPE_COLORINDEX_ARB 0x202C
-#endif
-
-#ifndef WGL_ARB_multisample
-#define WGL_SAMPLE_BUFFERS_ARB 0x2041
-#define WGL_SAMPLES_ARB 0x2042
-#endif
-
-#endif
diff --git a/distrib/sdl-1.2.12/src/video/windib/SDL_dibevents.c b/distrib/sdl-1.2.12/src/video/windib/SDL_dibevents.c
deleted file mode 100644
index 254ba80..0000000
--- a/distrib/sdl-1.2.12/src/video/windib/SDL_dibevents.c
+++ /dev/null
@@ -1,591 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-#include "SDL_main.h"
-#include "SDL_events.h"
-#include "SDL_syswm.h"
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "../wincommon/SDL_lowvideo.h"
-#include "SDL_dibvideo.h"
-#include "SDL_vkeys.h"
-
-#ifndef WM_APP
-#define WM_APP 0x8000
-#endif
-
-#ifdef _WIN32_WCE
-#define NO_GETKEYBOARDSTATE
-#endif
-
-/* The translation table from a Microsoft VK keysym to a SDL keysym */
-static SDLKey VK_keymap[SDLK_LAST];
-static SDL_keysym *TranslateKey(WPARAM vkey, UINT scancode, SDL_keysym *keysym, int pressed);
-
-/* Masks for processing the windows KEYDOWN and KEYUP messages */
-#define REPEATED_KEYMASK (1<<30)
-#define EXTENDED_KEYMASK (1<<24)
-
-/* DJM: If the user setup the window for us, we want to save his window proc,
- and give him a chance to handle some messages. */
-#ifdef STRICT
-#define WNDPROCTYPE WNDPROC
-#else
-#define WNDPROCTYPE FARPROC
-#endif
-static WNDPROCTYPE userWindowProc = NULL;
-
-
-#ifdef _WIN32_WCE
-
-WPARAM rotateKey(WPARAM key,SDL_ScreenOrientation direction)
-{
- if (direction != SDL_ORIENTATION_LEFT)
- return key;
-
- switch (key) {
- case 0x26: /* up */
- return 0x27;
- case 0x27: /* right */
- return 0x28;
- case 0x28: /* down */
- return 0x25;
- case 0x25: /* left */
- return 0x26;
- }
-
- return key;
-}
-
-#endif
-
-
-/* The main Win32 event handler */
-LRESULT DIB_HandleMessage(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- extern int posted;
-
- switch (msg) {
- case WM_SYSKEYDOWN:
- case WM_KEYDOWN: {
- SDL_keysym keysym;
-
-#ifdef _WIN32_WCE
- // Drop GAPI artefacts
- if (wParam == 0x84 || wParam == 0x5B)
- return 0;
-
- // Rotate key if necessary
- if (this->hidden->orientation != SDL_ORIENTATION_UP)
- wParam = rotateKey(wParam, this->hidden->orientation);
-#endif
- /* Ignore repeated keys */
- if ( lParam&REPEATED_KEYMASK ) {
- return(0);
- }
- switch (wParam) {
- case VK_CONTROL:
- if ( lParam&EXTENDED_KEYMASK )
- wParam = VK_RCONTROL;
- else
- wParam = VK_LCONTROL;
- break;
- case VK_SHIFT:
- /* EXTENDED trick doesn't work here */
- {
- Uint8 *state = SDL_GetKeyState(NULL);
- if (state[SDLK_LSHIFT] == SDL_RELEASED && (GetKeyState(VK_LSHIFT) & 0x8000)) {
- wParam = VK_LSHIFT;
- } else if (state[SDLK_RSHIFT] == SDL_RELEASED && (GetKeyState(VK_RSHIFT) & 0x8000)) {
- wParam = VK_RSHIFT;
- } else {
- /* Win9x */
- int sc = HIWORD(lParam) & 0xFF;
-
- if (sc == 0x2A)
- wParam = VK_LSHIFT;
- else
- if (sc == 0x36)
- wParam = VK_RSHIFT;
- else
- wParam = VK_LSHIFT;
- }
- }
- break;
- case VK_MENU:
- if ( lParam&EXTENDED_KEYMASK )
- wParam = VK_RMENU;
- else
- wParam = VK_LMENU;
- break;
- }
-#ifdef NO_GETKEYBOARDSTATE
- /* this is the workaround for the missing ToAscii() and ToUnicode() in CE (not necessary at KEYUP!) */
- if ( SDL_TranslateUNICODE ) {
- MSG m;
-
- m.hwnd = hwnd;
- m.message = msg;
- m.wParam = wParam;
- m.lParam = lParam;
- m.time = 0;
- if ( TranslateMessage(&m) && PeekMessage(&m, hwnd, 0, WM_USER, PM_NOREMOVE) && (m.message == WM_CHAR) ) {
- GetMessage(&m, hwnd, 0, WM_USER);
- wParam = m.wParam;
- }
- }
-#endif /* NO_GETKEYBOARDSTATE */
- posted = SDL_PrivateKeyboard(SDL_PRESSED,
- TranslateKey(wParam,HIWORD(lParam),&keysym,1));
- }
- return(0);
-
- case WM_SYSKEYUP:
- case WM_KEYUP: {
- SDL_keysym keysym;
-
-#ifdef _WIN32_WCE
- // Drop GAPI artifacts
- if (wParam == 0x84 || wParam == 0x5B)
- return 0;
-
- // Rotate key if necessary
- if (this->hidden->orientation != SDL_ORIENTATION_UP)
- wParam = rotateKey(wParam, this->hidden->orientation);
-#endif
-
- switch (wParam) {
- case VK_CONTROL:
- if ( lParam&EXTENDED_KEYMASK )
- wParam = VK_RCONTROL;
- else
- wParam = VK_LCONTROL;
- break;
- case VK_SHIFT:
- /* EXTENDED trick doesn't work here */
- {
- Uint8 *state = SDL_GetKeyState(NULL);
- if (state[SDLK_LSHIFT] == SDL_PRESSED && !(GetKeyState(VK_LSHIFT) & 0x8000)) {
- wParam = VK_LSHIFT;
- } else if (state[SDLK_RSHIFT] == SDL_PRESSED && !(GetKeyState(VK_RSHIFT) & 0x8000)) {
- wParam = VK_RSHIFT;
- } else {
- /* Win9x */
- int sc = HIWORD(lParam) & 0xFF;
-
- if (sc == 0x2A)
- wParam = VK_LSHIFT;
- else
- if (sc == 0x36)
- wParam = VK_RSHIFT;
- else
- wParam = VK_LSHIFT;
- }
- }
- break;
- case VK_MENU:
- if ( lParam&EXTENDED_KEYMASK )
- wParam = VK_RMENU;
- else
- wParam = VK_LMENU;
- break;
- }
- /* Windows only reports keyup for print screen */
- if ( wParam == VK_SNAPSHOT && SDL_GetKeyState(NULL)[SDLK_PRINT] == SDL_RELEASED ) {
- posted = SDL_PrivateKeyboard(SDL_PRESSED,
- TranslateKey(wParam,HIWORD(lParam),&keysym,1));
- }
- posted = SDL_PrivateKeyboard(SDL_RELEASED,
- TranslateKey(wParam,HIWORD(lParam),&keysym,0));
- }
- return(0);
-
-#if defined(SC_SCREENSAVE) && defined(SC_MONITORPOWER)
- case WM_SYSCOMMAND: {
- const DWORD val = (DWORD) (wParam & 0xFFF0);
- if ((val == SC_SCREENSAVE) || (val == SC_MONITORPOWER)) {
- if (!this->hidden->allow_screensaver) {
- /* Note that this doesn't stop anything on Vista
- if the screensaver has a password. */
- return(0);
- }
- }
- }
- /* Fall through to default processing */
-#endif /* SC_SCREENSAVE && SC_MONITORPOWER */
-
- default: {
- /* Only post the event if we're watching for it */
- if ( SDL_ProcessEvents[SDL_SYSWMEVENT] == SDL_ENABLE ) {
- SDL_SysWMmsg wmmsg;
-
- SDL_VERSION(&wmmsg.version);
- wmmsg.hwnd = hwnd;
- wmmsg.msg = msg;
- wmmsg.wParam = wParam;
- wmmsg.lParam = lParam;
- posted = SDL_PrivateSysWMEvent(&wmmsg);
-
- /* DJM: If the user isn't watching for private
- messages in her SDL event loop, then pass it
- along to any win32 specific window proc.
- */
- } else if (userWindowProc) {
- return CallWindowProc(userWindowProc, hwnd, msg, wParam, lParam);
- }
- }
- break;
- }
- return(DefWindowProc(hwnd, msg, wParam, lParam));
-}
-
-void DIB_PumpEvents(_THIS)
-{
- MSG msg;
-
- while ( PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) ) {
- if ( GetMessage(&msg, NULL, 0, 0) > 0 ) {
- DispatchMessage(&msg);
- }
- }
-}
-
-static HKL hLayoutUS = NULL;
-
-void DIB_InitOSKeymap(_THIS)
-{
- int i;
-#ifndef _WIN32_WCE
- char current_layout[KL_NAMELENGTH];
-
- GetKeyboardLayoutName(current_layout);
- //printf("Initial Keyboard Layout Name: '%s'\n", current_layout);
-
- hLayoutUS = LoadKeyboardLayout("00000409", KLF_NOTELLSHELL);
-
- if (!hLayoutUS) {
- //printf("Failed to load US keyboard layout. Using current.\n");
- hLayoutUS = GetKeyboardLayout(0);
- }
- LoadKeyboardLayout(current_layout, KLF_ACTIVATE);
-#else
-#if _WIN32_WCE >=420
- TCHAR current_layout[KL_NAMELENGTH];
-
- GetKeyboardLayoutName(current_layout);
- //printf("Initial Keyboard Layout Name: '%s'\n", current_layout);
-
- hLayoutUS = LoadKeyboardLayout(L"00000409", 0);
-
- if (!hLayoutUS) {
- //printf("Failed to load US keyboard layout. Using current.\n");
- hLayoutUS = GetKeyboardLayout(0);
- }
- LoadKeyboardLayout(current_layout, 0);
-#endif // _WIN32_WCE >=420
-#endif
- /* Map the VK keysyms */
- for ( i=0; i<SDL_arraysize(VK_keymap); ++i )
- VK_keymap[i] = SDLK_UNKNOWN;
-
- VK_keymap[VK_BACK] = SDLK_BACKSPACE;
- VK_keymap[VK_TAB] = SDLK_TAB;
- VK_keymap[VK_CLEAR] = SDLK_CLEAR;
- VK_keymap[VK_RETURN] = SDLK_RETURN;
- VK_keymap[VK_PAUSE] = SDLK_PAUSE;
- VK_keymap[VK_ESCAPE] = SDLK_ESCAPE;
- VK_keymap[VK_SPACE] = SDLK_SPACE;
- VK_keymap[VK_APOSTROPHE] = SDLK_QUOTE;
- VK_keymap[VK_COMMA] = SDLK_COMMA;
- VK_keymap[VK_MINUS] = SDLK_MINUS;
- VK_keymap[VK_PERIOD] = SDLK_PERIOD;
- VK_keymap[VK_SLASH] = SDLK_SLASH;
- VK_keymap[VK_0] = SDLK_0;
- VK_keymap[VK_1] = SDLK_1;
- VK_keymap[VK_2] = SDLK_2;
- VK_keymap[VK_3] = SDLK_3;
- VK_keymap[VK_4] = SDLK_4;
- VK_keymap[VK_5] = SDLK_5;
- VK_keymap[VK_6] = SDLK_6;
- VK_keymap[VK_7] = SDLK_7;
- VK_keymap[VK_8] = SDLK_8;
- VK_keymap[VK_9] = SDLK_9;
- VK_keymap[VK_SEMICOLON] = SDLK_SEMICOLON;
- VK_keymap[VK_EQUALS] = SDLK_EQUALS;
- VK_keymap[VK_LBRACKET] = SDLK_LEFTBRACKET;
- VK_keymap[VK_BACKSLASH] = SDLK_BACKSLASH;
- VK_keymap[VK_OEM_102] = SDLK_LESS;
- VK_keymap[VK_RBRACKET] = SDLK_RIGHTBRACKET;
- VK_keymap[VK_GRAVE] = SDLK_BACKQUOTE;
- VK_keymap[VK_BACKTICK] = SDLK_BACKQUOTE;
- VK_keymap[VK_A] = SDLK_a;
- VK_keymap[VK_B] = SDLK_b;
- VK_keymap[VK_C] = SDLK_c;
- VK_keymap[VK_D] = SDLK_d;
- VK_keymap[VK_E] = SDLK_e;
- VK_keymap[VK_F] = SDLK_f;
- VK_keymap[VK_G] = SDLK_g;
- VK_keymap[VK_H] = SDLK_h;
- VK_keymap[VK_I] = SDLK_i;
- VK_keymap[VK_J] = SDLK_j;
- VK_keymap[VK_K] = SDLK_k;
- VK_keymap[VK_L] = SDLK_l;
- VK_keymap[VK_M] = SDLK_m;
- VK_keymap[VK_N] = SDLK_n;
- VK_keymap[VK_O] = SDLK_o;
- VK_keymap[VK_P] = SDLK_p;
- VK_keymap[VK_Q] = SDLK_q;
- VK_keymap[VK_R] = SDLK_r;
- VK_keymap[VK_S] = SDLK_s;
- VK_keymap[VK_T] = SDLK_t;
- VK_keymap[VK_U] = SDLK_u;
- VK_keymap[VK_V] = SDLK_v;
- VK_keymap[VK_W] = SDLK_w;
- VK_keymap[VK_X] = SDLK_x;
- VK_keymap[VK_Y] = SDLK_y;
- VK_keymap[VK_Z] = SDLK_z;
- VK_keymap[VK_DELETE] = SDLK_DELETE;
-
- VK_keymap[VK_NUMPAD0] = SDLK_KP0;
- VK_keymap[VK_NUMPAD1] = SDLK_KP1;
- VK_keymap[VK_NUMPAD2] = SDLK_KP2;
- VK_keymap[VK_NUMPAD3] = SDLK_KP3;
- VK_keymap[VK_NUMPAD4] = SDLK_KP4;
- VK_keymap[VK_NUMPAD5] = SDLK_KP5;
- VK_keymap[VK_NUMPAD6] = SDLK_KP6;
- VK_keymap[VK_NUMPAD7] = SDLK_KP7;
- VK_keymap[VK_NUMPAD8] = SDLK_KP8;
- VK_keymap[VK_NUMPAD9] = SDLK_KP9;
- VK_keymap[VK_DECIMAL] = SDLK_KP_PERIOD;
- VK_keymap[VK_DIVIDE] = SDLK_KP_DIVIDE;
- VK_keymap[VK_MULTIPLY] = SDLK_KP_MULTIPLY;
- VK_keymap[VK_SUBTRACT] = SDLK_KP_MINUS;
- VK_keymap[VK_ADD] = SDLK_KP_PLUS;
-
- VK_keymap[VK_UP] = SDLK_UP;
- VK_keymap[VK_DOWN] = SDLK_DOWN;
- VK_keymap[VK_RIGHT] = SDLK_RIGHT;
- VK_keymap[VK_LEFT] = SDLK_LEFT;
- VK_keymap[VK_INSERT] = SDLK_INSERT;
- VK_keymap[VK_HOME] = SDLK_HOME;
- VK_keymap[VK_END] = SDLK_END;
- VK_keymap[VK_PRIOR] = SDLK_PAGEUP;
- VK_keymap[VK_NEXT] = SDLK_PAGEDOWN;
-
- VK_keymap[VK_F1] = SDLK_F1;
- VK_keymap[VK_F2] = SDLK_F2;
- VK_keymap[VK_F3] = SDLK_F3;
- VK_keymap[VK_F4] = SDLK_F4;
- VK_keymap[VK_F5] = SDLK_F5;
- VK_keymap[VK_F6] = SDLK_F6;
- VK_keymap[VK_F7] = SDLK_F7;
- VK_keymap[VK_F8] = SDLK_F8;
- VK_keymap[VK_F9] = SDLK_F9;
- VK_keymap[VK_F10] = SDLK_F10;
- VK_keymap[VK_F11] = SDLK_F11;
- VK_keymap[VK_F12] = SDLK_F12;
- VK_keymap[VK_F13] = SDLK_F13;
- VK_keymap[VK_F14] = SDLK_F14;
- VK_keymap[VK_F15] = SDLK_F15;
-
- VK_keymap[VK_NUMLOCK] = SDLK_NUMLOCK;
- VK_keymap[VK_CAPITAL] = SDLK_CAPSLOCK;
- VK_keymap[VK_SCROLL] = SDLK_SCROLLOCK;
- VK_keymap[VK_RSHIFT] = SDLK_RSHIFT;
- VK_keymap[VK_LSHIFT] = SDLK_LSHIFT;
- VK_keymap[VK_RCONTROL] = SDLK_RCTRL;
- VK_keymap[VK_LCONTROL] = SDLK_LCTRL;
- VK_keymap[VK_RMENU] = SDLK_RALT;
- VK_keymap[VK_LMENU] = SDLK_LALT;
- VK_keymap[VK_RWIN] = SDLK_RSUPER;
- VK_keymap[VK_LWIN] = SDLK_LSUPER;
-
- VK_keymap[VK_HELP] = SDLK_HELP;
-#ifdef VK_PRINT
- VK_keymap[VK_PRINT] = SDLK_PRINT;
-#endif
- VK_keymap[VK_SNAPSHOT] = SDLK_PRINT;
- VK_keymap[VK_CANCEL] = SDLK_BREAK;
- VK_keymap[VK_APPS] = SDLK_MENU;
-}
-
-#define EXTKEYPAD(keypad) ((scancode & 0x100)?(mvke):(keypad))
-
-static int SDL_MapVirtualKey(int scancode, int vkey)
-{
-#ifndef _WIN32_WCE
- int mvke = MapVirtualKeyEx(scancode & 0xFF, 1, hLayoutUS);
-#else
- int mvke = MapVirtualKey(scancode & 0xFF, 1);
-#endif
-
- switch(vkey) {
- /* These are always correct */
- case VK_DIVIDE:
- case VK_MULTIPLY:
- case VK_SUBTRACT:
- case VK_ADD:
- case VK_LWIN:
- case VK_RWIN:
- case VK_APPS:
- /* These are already handled */
- case VK_LCONTROL:
- case VK_RCONTROL:
- case VK_LSHIFT:
- case VK_RSHIFT:
- case VK_LMENU:
- case VK_RMENU:
- case VK_SNAPSHOT:
- case VK_PAUSE:
- return vkey;
- }
- switch(mvke) {
- /* Distinguish between keypad and extended keys */
- case VK_INSERT: return EXTKEYPAD(VK_NUMPAD0);
- case VK_DELETE: return EXTKEYPAD(VK_DECIMAL);
- case VK_END: return EXTKEYPAD(VK_NUMPAD1);
- case VK_DOWN: return EXTKEYPAD(VK_NUMPAD2);
- case VK_NEXT: return EXTKEYPAD(VK_NUMPAD3);
- case VK_LEFT: return EXTKEYPAD(VK_NUMPAD4);
- case VK_CLEAR: return EXTKEYPAD(VK_NUMPAD5);
- case VK_RIGHT: return EXTKEYPAD(VK_NUMPAD6);
- case VK_HOME: return EXTKEYPAD(VK_NUMPAD7);
- case VK_UP: return EXTKEYPAD(VK_NUMPAD8);
- case VK_PRIOR: return EXTKEYPAD(VK_NUMPAD9);
- }
- return mvke?mvke:vkey;
-}
-
-static SDL_keysym *TranslateKey(WPARAM vkey, UINT scancode, SDL_keysym *keysym, int pressed)
-{
- /* Set the keysym information */
- keysym->scancode = (unsigned char) scancode;
- keysym->mod = KMOD_NONE;
- keysym->unicode = 0;
- if ( pressed && SDL_TranslateUNICODE ) {
-#ifdef NO_GETKEYBOARDSTATE
- /* Uh oh, better hope the vkey is close enough.. */
- keysym->unicode = vkey;
-#else
- BYTE keystate[256];
- Uint16 wchars[2];
-
- GetKeyboardState(keystate);
- if (SDL_ToUnicode((UINT)vkey, scancode, keystate, wchars, sizeof(wchars)/sizeof(wchars[0]), 0) == 1)
- {
- keysym->unicode = wchars[0];
- }
-#endif /* NO_GETKEYBOARDSTATE */
- }
-
- if ((vkey == VK_RETURN) && (scancode & 0x100)) {
- /* No VK_ code for the keypad enter key */
- keysym->sym = SDLK_KP_ENTER;
- }
- else {
- keysym->sym = VK_keymap[SDL_MapVirtualKey(scancode, vkey)];
- }
-
-#if 0
- {
- HKL hLayoutCurrent = GetKeyboardLayout(0);
- int sc = scancode & 0xFF;
-
- printf("SYM:%d, VK:0x%02X, SC:0x%04X, US:(1:0x%02X, 3:0x%02X), "
- "Current:(1:0x%02X, 3:0x%02X)\n",
- keysym->sym, vkey, scancode,
- MapVirtualKeyEx(sc, 1, hLayoutUS),
- MapVirtualKeyEx(sc, 3, hLayoutUS),
- MapVirtualKeyEx(sc, 1, hLayoutCurrent),
- MapVirtualKeyEx(sc, 3, hLayoutCurrent)
- );
- }
-#endif
- return(keysym);
-}
-
-int DIB_CreateWindow(_THIS)
-{
- char *windowid = SDL_getenv("SDL_WINDOWID");
-
- SDL_RegisterApp(NULL, 0, 0);
-
- SDL_windowid = (windowid != NULL);
- if ( SDL_windowid ) {
-#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
- /* wince 2.1 does not have strtol */
- wchar_t *windowid_t = SDL_malloc((SDL_strlen(windowid) + 1) * sizeof(wchar_t));
- MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, windowid, -1, windowid_t, SDL_strlen(windowid) + 1);
- SDL_Window = (HWND)wcstol(windowid_t, NULL, 0);
- SDL_free(windowid_t);
-#else
- SDL_Window = (HWND)SDL_strtoull(windowid, NULL, 0);
-#endif
- if ( SDL_Window == NULL ) {
- SDL_SetError("Couldn't get user specified window");
- return(-1);
- }
-
- /* DJM: we want all event's for the user specified
- window to be handled by SDL.
- */
- userWindowProc = (WNDPROCTYPE)GetWindowLongPtr(SDL_Window, GWLP_WNDPROC);
- SetWindowLongPtr(SDL_Window, GWLP_WNDPROC, (LONG_PTR)WinMessage);
- } else {
- SDL_Window = CreateWindow(SDL_Appname, SDL_Appname,
- (WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX),
- CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, NULL, NULL, SDL_Instance, NULL);
- if ( SDL_Window == NULL ) {
- SDL_SetError("Couldn't create window");
- return(-1);
- }
- ShowWindow(SDL_Window, SW_HIDE);
- }
-
- /* JC 14 Mar 2006
- Flush the message loop or this can cause big problems later
- Especially if the user decides to use dialog boxes or assert()!
- */
- WIN_FlushMessageQueue();
-
- return(0);
-}
-
-void DIB_DestroyWindow(_THIS)
-{
- if ( SDL_windowid ) {
- SetWindowLongPtr(SDL_Window, GWLP_WNDPROC, (LONG_PTR)userWindowProc);
- } else {
- DestroyWindow(SDL_Window);
- }
- SDL_UnregisterApp();
-
- /* JC 14 Mar 2006
- Flush the message loop or this can cause big problems later
- Especially if the user decides to use dialog boxes or assert()!
- */
- WIN_FlushMessageQueue();
-}
diff --git a/distrib/sdl-1.2.12/src/video/windib/SDL_dibevents_c.h b/distrib/sdl-1.2.12/src/video/windib/SDL_dibevents_c.h
deleted file mode 100644
index a5b3a25..0000000
--- a/distrib/sdl-1.2.12/src/video/windib/SDL_dibevents_c.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "../wincommon/SDL_lowvideo.h"
-
-/* Variables and functions exported by SDL_dibevents.c to other parts
- of the native video subsystem (SDL_dibvideo.c)
-*/
-extern LONG
- DIB_HandleMessage(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-extern int DIB_CreateWindow(_THIS);
-extern void DIB_DestroyWindow(_THIS);
-
-extern void DIB_PumpEvents(_THIS);
-extern void DIB_InitOSKeymap(_THIS);
diff --git a/distrib/sdl-1.2.12/src/video/windib/SDL_dibvideo.c b/distrib/sdl-1.2.12/src/video/windib/SDL_dibvideo.c
deleted file mode 100644
index bae7a78..0000000
--- a/distrib/sdl-1.2.12/src/video/windib/SDL_dibvideo.c
+++ /dev/null
@@ -1,1422 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-/* Not yet in the mingw32 cross-compile headers */
-#ifndef CDS_FULLSCREEN
-#define CDS_FULLSCREEN 4
-#endif
-
-#include "SDL_syswm.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_dibvideo.h"
-#include "../wincommon/SDL_syswm_c.h"
-#include "../wincommon/SDL_sysmouse_c.h"
-#include "SDL_dibevents_c.h"
-#include "../wincommon/SDL_wingl_c.h"
-
-#ifdef _WIN32_WCE
-#define NO_GETDIBITS
-#define NO_GAMMA_SUPPORT
- #if _WIN32_WCE < 420
- #define NO_CHANGEDISPLAYSETTINGS
- #else
- #define ChangeDisplaySettings(lpDevMode, dwFlags) ChangeDisplaySettingsEx(NULL, (lpDevMode), 0, (dwFlags), 0)
- #endif
-#endif
-#ifndef WS_MAXIMIZE
-#define WS_MAXIMIZE 0
-#endif
-#ifndef WS_THICKFRAME
-#define WS_THICKFRAME 0
-#endif
-#ifndef SWP_NOCOPYBITS
-#define SWP_NOCOPYBITS 0
-#endif
-#ifndef PC_NOCOLLAPSE
-#define PC_NOCOLLAPSE 0
-#endif
-
-#ifdef _WIN32_WCE
-// defined and used in SDL_sysevents.c
-extern HINSTANCE aygshell;
-#endif
-
-/* Initialization/Query functions */
-static int DIB_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **DIB_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-SDL_Surface *DIB_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int DIB_SetColors(_THIS, int firstcolor, int ncolors,
- SDL_Color *colors);
-static void DIB_CheckGamma(_THIS);
-void DIB_SwapGamma(_THIS);
-void DIB_QuitGamma(_THIS);
-int DIB_SetGammaRamp(_THIS, Uint16 *ramp);
-int DIB_GetGammaRamp(_THIS, Uint16 *ramp);
-static void DIB_VideoQuit(_THIS);
-
-/* Hardware surface functions */
-static int DIB_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int DIB_LockHWSurface(_THIS, SDL_Surface *surface);
-static void DIB_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static void DIB_FreeHWSurface(_THIS, SDL_Surface *surface);
-
-/* Windows message handling functions */
-static void DIB_GrabStaticColors(HWND window);
-static void DIB_ReleaseStaticColors(HWND window);
-static void DIB_Activate(_THIS, BOOL active, BOOL minimized);
-static void DIB_RealizePalette(_THIS);
-static void DIB_PaletteChanged(_THIS, HWND window);
-static void DIB_WinPAINT(_THIS, HDC hdc);
-
-static void DIB_GetWinPos(_THIS, int* px, int *py);
-static void DIB_SetWinPos(_THIS, int x, int y);
-static int DIB_IsWinVisible(_THIS, int recenter);
-static int DIB_GetMonitorDPI(_THIS, int* xDpi, int *yDpi);
-static int DIB_GetMonitorRect(_THIS, SDL_Rect* rect);
-
-/* helper fn */
-static int DIB_SussScreenDepth();
-
-/* DIB driver bootstrap functions */
-
-static int DIB_Available(void)
-{
- return(1);
-}
-
-static void DIB_DeleteDevice(SDL_VideoDevice *device)
-{
- if ( device ) {
- if ( device->hidden ) {
- SDL_free(device->hidden);
- }
- if ( device->gl_data ) {
- SDL_free(device->gl_data);
- }
- SDL_free(device);
- }
-}
-
-static SDL_VideoDevice *DIB_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device ) {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *device->hidden));
- device->gl_data = (struct SDL_PrivateGLData *)
- SDL_malloc((sizeof *device->gl_data));
- }
- if ( (device == NULL) || (device->hidden == NULL) ||
- (device->gl_data == NULL) ) {
- SDL_OutOfMemory();
- DIB_DeleteDevice(device);
- return(NULL);
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
- SDL_memset(device->gl_data, 0, (sizeof *device->gl_data));
-
- /* Set the function pointers */
- device->VideoInit = DIB_VideoInit;
- device->ListModes = DIB_ListModes;
- device->SetVideoMode = DIB_SetVideoMode;
- device->UpdateMouse = WIN_UpdateMouse;
- device->SetColors = DIB_SetColors;
- device->UpdateRects = NULL;
- device->VideoQuit = DIB_VideoQuit;
- device->AllocHWSurface = DIB_AllocHWSurface;
- device->CheckHWBlit = NULL;
- device->FillHWRect = NULL;
- device->SetHWColorKey = NULL;
- device->SetHWAlpha = NULL;
- device->LockHWSurface = DIB_LockHWSurface;
- device->UnlockHWSurface = DIB_UnlockHWSurface;
- device->FlipHWSurface = NULL;
- device->FreeHWSurface = DIB_FreeHWSurface;
- device->SetGammaRamp = DIB_SetGammaRamp;
- device->GetGammaRamp = DIB_GetGammaRamp;
-#if SDL_VIDEO_OPENGL
- device->GL_LoadLibrary = WIN_GL_LoadLibrary;
- device->GL_GetProcAddress = WIN_GL_GetProcAddress;
- device->GL_GetAttribute = WIN_GL_GetAttribute;
- device->GL_MakeCurrent = WIN_GL_MakeCurrent;
- device->GL_SwapBuffers = WIN_GL_SwapBuffers;
-#endif
- device->SetCaption = WIN_SetWMCaption;
- device->SetIcon = WIN_SetWMIcon;
- device->IconifyWindow = WIN_IconifyWindow;
- device->GrabInput = WIN_GrabInput;
- device->GetWMInfo = WIN_GetWMInfo;
- device->FreeWMCursor = WIN_FreeWMCursor;
- device->CreateWMCursor = WIN_CreateWMCursor;
- device->ShowWMCursor = WIN_ShowWMCursor;
- device->WarpWMCursor = WIN_WarpWMCursor;
- device->CheckMouseMode = WIN_CheckMouseMode;
- device->InitOSKeymap = DIB_InitOSKeymap;
- device->PumpEvents = DIB_PumpEvents;
-
- device->GetWindowPos = DIB_GetWinPos;
- device->SetWindowPos = DIB_SetWinPos;
- device->IsWindowVisible = DIB_IsWinVisible;
- device->GetMonitorDPI = DIB_GetMonitorDPI;
- device->GetMonitorRect = DIB_GetMonitorRect;
-
- /* Set up the windows message handling functions */
- WIN_Activate = DIB_Activate;
- WIN_RealizePalette = DIB_RealizePalette;
- WIN_PaletteChanged = DIB_PaletteChanged;
- WIN_WinPAINT = DIB_WinPAINT;
- HandleMessage = DIB_HandleMessage;
-
- device->free = DIB_DeleteDevice;
-
- /* We're finally ready */
- return device;
-}
-
-VideoBootStrap WINDIB_bootstrap = {
- "windib", "Win95/98/NT/2000/CE GDI",
- DIB_Available, DIB_CreateDevice
-};
-
-static int cmpmodes(const void *va, const void *vb)
-{
- SDL_Rect *a = *(SDL_Rect **)va;
- SDL_Rect *b = *(SDL_Rect **)vb;
- if ( a->w == b->w )
- return b->h - a->h;
- else
- return b->w - a->w;
-}
-
-static int DIB_AddMode(_THIS, int bpp, int w, int h)
-{
- SDL_Rect *mode;
- int i, index;
- int next_mode;
-
- /* Check to see if we already have this mode */
- if ( bpp < 8 ) { /* Not supported */
- return(0);
- }
- index = ((bpp+7)/8)-1;
- for ( i=0; i<SDL_nummodes[index]; ++i ) {
- mode = SDL_modelist[index][i];
- if ( (mode->w == w) && (mode->h == h) ) {
- return(0);
- }
- }
-
- /* Set up the new video mode rectangle */
- mode = (SDL_Rect *)SDL_malloc(sizeof *mode);
- if ( mode == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
- mode->x = 0;
- mode->y = 0;
- mode->w = w;
- mode->h = h;
-
- /* Allocate the new list of modes, and fill in the new mode */
- next_mode = SDL_nummodes[index];
- SDL_modelist[index] = (SDL_Rect **)
- SDL_realloc(SDL_modelist[index], (1+next_mode+1)*sizeof(SDL_Rect *));
- if ( SDL_modelist[index] == NULL ) {
- SDL_OutOfMemory();
- SDL_nummodes[index] = 0;
- SDL_free(mode);
- return(-1);
- }
- SDL_modelist[index][next_mode] = mode;
- SDL_modelist[index][next_mode+1] = NULL;
- SDL_nummodes[index]++;
-
- return(0);
-}
-
-static void DIB_CreatePalette(_THIS, int bpp)
-{
-/* RJR: March 28, 2000
- moved palette creation here from "DIB_VideoInit" */
-
- LOGPALETTE *palette;
- HDC hdc;
- int ncolors;
-
- ncolors = (1 << bpp);
- palette = (LOGPALETTE *)SDL_malloc(sizeof(*palette)+
- ncolors*sizeof(PALETTEENTRY));
- palette->palVersion = 0x300;
- palette->palNumEntries = ncolors;
- hdc = GetDC(SDL_Window);
- GetSystemPaletteEntries(hdc, 0, ncolors, palette->palPalEntry);
- ReleaseDC(SDL_Window, hdc);
- screen_pal = CreatePalette(palette);
- screen_logpal = palette;
-}
-
-int DIB_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- const char *env = NULL;
-#ifndef NO_CHANGEDISPLAYSETTINGS
- int i;
- DEVMODE settings;
-#endif
-
- /* Create the window */
- if ( DIB_CreateWindow(this) < 0 ) {
- return(-1);
- }
-
-#if !SDL_AUDIO_DISABLED
- DX5_SoundFocus(SDL_Window);
-#endif
-
- /* Determine the screen depth */
- vformat->BitsPerPixel = DIB_SussScreenDepth();
- switch (vformat->BitsPerPixel) {
- case 15:
- vformat->Rmask = 0x00007c00;
- vformat->Gmask = 0x000003e0;
- vformat->Bmask = 0x0000001f;
- vformat->BitsPerPixel = 16;
- break;
- case 16:
- vformat->Rmask = 0x0000f800;
- vformat->Gmask = 0x000007e0;
- vformat->Bmask = 0x0000001f;
- break;
- case 24:
- case 32:
- /* GDI defined as 8-8-8 */
- vformat->Rmask = 0x00ff0000;
- vformat->Gmask = 0x0000ff00;
- vformat->Bmask = 0x000000ff;
- break;
- default:
- break;
- }
-
- /* See if gamma is supported on this screen */
- DIB_CheckGamma(this);
-
-#ifndef NO_CHANGEDISPLAYSETTINGS
-
- settings.dmSize = sizeof(DEVMODE);
- settings.dmDriverExtra = 0;
-#ifdef _WIN32_WCE
- settings.dmFields = DM_DISPLAYQUERYORIENTATION;
- this->hidden->supportRotation = ChangeDisplaySettingsEx(NULL, &settings, NULL, CDS_TEST, NULL) == DISP_CHANGE_SUCCESSFUL;
-#endif
- /* Query for the desktop resolution */
- EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &SDL_desktop_mode);
- this->info.current_w = SDL_desktop_mode.dmPelsWidth;
- this->info.current_h = SDL_desktop_mode.dmPelsHeight;
-
- /* Query for the list of available video modes */
- for ( i=0; EnumDisplaySettings(NULL, i, &settings); ++i ) {
- DIB_AddMode(this, settings.dmBitsPerPel,
- settings.dmPelsWidth, settings.dmPelsHeight);
-#ifdef _WIN32_WCE
- if( this->hidden->supportRotation )
- DIB_AddMode(this, settings.dmBitsPerPel,
- settings.dmPelsHeight, settings.dmPelsWidth);
-#endif
- }
- /* Sort the mode lists */
- for ( i=0; i<NUM_MODELISTS; ++i ) {
- if ( SDL_nummodes[i] > 0 ) {
- SDL_qsort(SDL_modelist[i], SDL_nummodes[i], sizeof *SDL_modelist[i], cmpmodes);
- }
- }
-#else
- // WinCE and fullscreen mode:
- // We use only vformat->BitsPerPixel that allow SDL to
- // emulate other bpp (8, 32) and use triple buffer,
- // because SDL surface conversion is much faster than the WinCE one.
- // Although it should be tested on devices with graphics accelerator.
-
- DIB_AddMode(this, vformat->BitsPerPixel,
- GetDeviceCaps(GetDC(NULL), HORZRES),
- GetDeviceCaps(GetDC(NULL), VERTRES));
-
-#endif /* !NO_CHANGEDISPLAYSETTINGS */
-
- /* Grab an identity palette if we are in a palettized mode */
- if ( vformat->BitsPerPixel <= 8 ) {
- /* RJR: March 28, 2000
- moved palette creation to "DIB_CreatePalette" */
- DIB_CreatePalette(this, vformat->BitsPerPixel);
- }
-
- /* Fill in some window manager capabilities */
- this->info.wm_available = 1;
-
-#ifdef _WIN32_WCE
- this->hidden->origRotation = -1;
-#endif
-
- /* Allow environment override of screensaver disable. */
- env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
- this->hidden->allow_screensaver = ( (env && SDL_atoi(env)) ? 1 : 0 );
-
- /* We're done! */
- return(0);
-}
-
-/* We support any format at any dimension */
-SDL_Rect **DIB_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
- return(SDL_modelist[((format->BitsPerPixel+7)/8)-1]);
- } else {
- return((SDL_Rect **)-1);
- }
-}
-
-
-/*
- Helper fn to work out which screen depth windows is currently using.
- 15 bit mode is considered 555 format, 16 bit is 565.
- returns 0 for unknown mode.
- (Derived from code in sept 1999 Windows Developer Journal
- http://www.wdj.com/code/archive.html)
-*/
-static int DIB_SussScreenDepth()
-{
-#ifdef NO_GETDIBITS
- int depth;
- HDC hdc;
-
- hdc = GetDC(SDL_Window);
- depth = GetDeviceCaps(hdc, PLANES) * GetDeviceCaps(hdc, BITSPIXEL);
- ReleaseDC(SDL_Window, hdc);
- return(depth);
-#else
- int depth;
- int dib_size;
- LPBITMAPINFOHEADER dib_hdr;
- HDC hdc;
- HBITMAP hbm;
-
- /* Allocate enough space for a DIB header plus palette (for
- * 8-bit modes) or bitfields (for 16- and 32-bit modes)
- */
- dib_size = sizeof(BITMAPINFOHEADER) + 256 * sizeof (RGBQUAD);
- dib_hdr = (LPBITMAPINFOHEADER) SDL_malloc(dib_size);
- SDL_memset(dib_hdr, 0, dib_size);
- dib_hdr->biSize = sizeof(BITMAPINFOHEADER);
-
- /* Get a device-dependent bitmap that's compatible with the
- screen.
- */
- hdc = GetDC(NULL);
- hbm = CreateCompatibleBitmap( hdc, 1, 1 );
-
- /* Convert the DDB to a DIB. We need to call GetDIBits twice:
- * the first call just fills in the BITMAPINFOHEADER; the
- * second fills in the bitfields or palette.
- */
- GetDIBits(hdc, hbm, 0, 1, NULL, (LPBITMAPINFO) dib_hdr, DIB_RGB_COLORS);
- GetDIBits(hdc, hbm, 0, 1, NULL, (LPBITMAPINFO) dib_hdr, DIB_RGB_COLORS);
- DeleteObject(hbm);
- ReleaseDC(NULL, hdc);
-
- depth = 0;
- switch( dib_hdr->biBitCount )
- {
- case 8: depth = 8; break;
- case 24: depth = 24; break;
- case 32: depth = 32; break;
- case 16:
- if( dib_hdr->biCompression == BI_BITFIELDS ) {
- /* check the red mask */
- switch( ((DWORD*)((char*)dib_hdr + dib_hdr->biSize))[0] ) {
- case 0xf800: depth = 16; break; /* 565 */
- case 0x7c00: depth = 15; break; /* 555 */
- }
- }
- }
- SDL_free(dib_hdr);
- return depth;
-#endif /* NO_GETDIBITS */
-}
-
-
-/* Various screen update functions available */
-static void DIB_NormalUpdate(_THIS, int numrects, SDL_Rect *rects);
-
-SDL_Surface *DIB_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- SDL_Surface *video;
- int prev_w, prev_h;
- Uint32 prev_flags;
- DWORD style;
- const DWORD directstyle =
- (WS_POPUP);
- const DWORD windowstyle =
- (WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX);
- const DWORD resizestyle =
- (WS_THICKFRAME|WS_MAXIMIZEBOX);
- int binfo_size;
- BITMAPINFO *binfo;
- HDC hdc;
- RECT bounds;
- int x, y;
- Uint32 Rmask, Gmask, Bmask;
-
- /* Clean up any GL context that may be hanging around */
- if ( current->flags & SDL_OPENGL ) {
- WIN_GL_ShutDown(this);
- }
- SDL_resizing = 1;
-
- /* Recalculate the bitmasks if necessary */
- if ( bpp == current->format->BitsPerPixel ) {
- video = current;
- } else {
- switch (bpp) {
- case 15:
- case 16:
- if ( DIB_SussScreenDepth() == 15 ) {
- /* 5-5-5 */
- Rmask = 0x00007c00;
- Gmask = 0x000003e0;
- Bmask = 0x0000001f;
- } else {
- /* 5-6-5 */
- Rmask = 0x0000f800;
- Gmask = 0x000007e0;
- Bmask = 0x0000001f;
- }
- break;
- case 24:
- case 32:
- /* GDI defined as 8-8-8 */
- Rmask = 0x00ff0000;
- Gmask = 0x0000ff00;
- Bmask = 0x000000ff;
- break;
- default:
- Rmask = 0x00000000;
- Gmask = 0x00000000;
- Bmask = 0x00000000;
- break;
- }
- video = SDL_CreateRGBSurface(SDL_SWSURFACE,
- 0, 0, bpp, Rmask, Gmask, Bmask, 0);
- if ( video == NULL ) {
- SDL_OutOfMemory();
- return(NULL);
- }
- }
-
- /* Fill in part of the video surface */
- prev_flags = video->flags;
- prev_w = video->w;
- prev_h = video->h;
- video->flags = 0; /* Clear flags */
- video->w = width;
- video->h = height;
- video->pitch = SDL_CalculatePitch(video);
-
- /* Small fix for WinCE/Win32 - when activating window
- SDL_VideoSurface is equal to zero, so activating code
- is not called properly for fullscreen windows because
- macros WINDIB_FULLSCREEN uses SDL_VideoSurface
- */
- SDL_VideoSurface = video;
-
-#if defined(_WIN32_WCE)
- if ( flags & SDL_FULLSCREEN )
- video->flags |= SDL_FULLSCREEN;
-#endif
-
-#ifndef NO_CHANGEDISPLAYSETTINGS
- /* Set fullscreen mode if appropriate */
- if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
- DEVMODE settings;
- BOOL changed;
-
- SDL_memset(&settings, 0, sizeof(DEVMODE));
- settings.dmSize = sizeof(DEVMODE);
-
-#ifdef _WIN32_WCE
- // try to rotate screen to fit requested resolution
- if( this->hidden->supportRotation )
- {
- DWORD rotation;
-
- // ask current mode
- settings.dmFields = DM_DISPLAYORIENTATION;
- ChangeDisplaySettingsEx(NULL, &settings, NULL, CDS_TEST, NULL);
- rotation = settings.dmDisplayOrientation;
-
- if( (width > GetDeviceCaps(GetDC(NULL), HORZRES))
- && (height < GetDeviceCaps(GetDC(NULL), VERTRES)))
- {
- switch( rotation )
- {
- case DMDO_0:
- settings.dmDisplayOrientation = DMDO_90;
- break;
- case DMDO_270:
- settings.dmDisplayOrientation = DMDO_180;
- break;
- }
- if( settings.dmDisplayOrientation != rotation )
- {
- // go to landscape
- this->hidden->origRotation = rotation;
- ChangeDisplaySettingsEx(NULL,&settings,NULL,CDS_RESET,NULL);
- }
- }
- if( (width < GetDeviceCaps(GetDC(NULL), HORZRES))
- && (height > GetDeviceCaps(GetDC(NULL), VERTRES)))
- {
- switch( rotation )
- {
- case DMDO_90:
- settings.dmDisplayOrientation = DMDO_0;
- break;
- case DMDO_180:
- settings.dmDisplayOrientation = DMDO_270;
- break;
- }
- if( settings.dmDisplayOrientation != rotation )
- {
- // go to portrait
- this->hidden->origRotation = rotation;
- ChangeDisplaySettingsEx(NULL,&settings,NULL,CDS_RESET,NULL);
- }
- }
-
- }
-#endif
-
-#ifndef _WIN32_WCE
- settings.dmBitsPerPel = video->format->BitsPerPixel;
- settings.dmPelsWidth = width;
- settings.dmPelsHeight = height;
- settings.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL;
- if ( width <= (int)SDL_desktop_mode.dmPelsWidth &&
- height <= (int)SDL_desktop_mode.dmPelsHeight ) {
- settings.dmDisplayFrequency = SDL_desktop_mode.dmDisplayFrequency;
- settings.dmFields |= DM_DISPLAYFREQUENCY;
- }
- changed = (ChangeDisplaySettings(&settings, CDS_FULLSCREEN) == DISP_CHANGE_SUCCESSFUL);
- if ( ! changed && (settings.dmFields & DM_DISPLAYFREQUENCY) ) {
- settings.dmFields &= ~DM_DISPLAYFREQUENCY;
- changed = (ChangeDisplaySettings(&settings, CDS_FULLSCREEN) == DISP_CHANGE_SUCCESSFUL);
- }
-#else
- changed = 1;
-#endif
- if ( changed ) {
- video->flags |= SDL_FULLSCREEN;
- SDL_fullscreen_mode = settings;
- }
-
- }
-#endif /* !NO_CHANGEDISPLAYSETTINGS */
-
- /* Reset the palette and create a new one if necessary */
- if ( grab_palette ) {
- DIB_ReleaseStaticColors(SDL_Window);
- grab_palette = FALSE;
- }
- if ( screen_pal != NULL ) {
- /* RJR: March 28, 2000
- delete identity palette if switching from a palettized mode */
- DeleteObject(screen_pal);
- screen_pal = NULL;
- }
- if ( screen_logpal != NULL ) {
- SDL_free(screen_logpal);
- screen_logpal = NULL;
- }
-
- if ( bpp <= 8 )
- {
- /* RJR: March 28, 2000
- create identity palette switching to a palettized mode */
- DIB_CreatePalette(this, bpp);
- }
-
- style = GetWindowLong(SDL_Window, GWL_STYLE);
- style &= ~(resizestyle|WS_MAXIMIZE);
- if ( (video->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
- style &= ~windowstyle;
- style |= directstyle;
- } else {
-#ifndef NO_CHANGEDISPLAYSETTINGS
- if ( (prev_flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
- ChangeDisplaySettings(NULL, 0);
- }
-#endif
- if ( flags & SDL_NOFRAME ) {
- style &= ~windowstyle;
- style |= directstyle;
- video->flags |= SDL_NOFRAME;
- } else {
- style &= ~directstyle;
- style |= windowstyle;
- if ( flags & SDL_RESIZABLE ) {
- style |= resizestyle;
- video->flags |= SDL_RESIZABLE;
- }
- }
-#if WS_MAXIMIZE
- if (IsZoomed(SDL_Window)) style |= WS_MAXIMIZE;
-#endif
- }
-
- /* DJM: Don't piss of anyone who has setup his own window */
- if ( !SDL_windowid )
- SetWindowLong(SDL_Window, GWL_STYLE, style);
-
- /* Delete the old bitmap if necessary */
- if ( screen_bmp != NULL ) {
- DeleteObject(screen_bmp);
- }
- if ( ! (flags & SDL_OPENGL) ) {
- BOOL is16bitmode = (video->format->BytesPerPixel == 2);
-
- /* Suss out the bitmap info header */
- binfo_size = sizeof(*binfo);
- if( is16bitmode ) {
- /* 16bit modes, palette area used for rgb bitmasks */
- binfo_size += 3*sizeof(DWORD);
- } else if ( video->format->palette ) {
- binfo_size += video->format->palette->ncolors *
- sizeof(RGBQUAD);
- }
- binfo = (BITMAPINFO *)SDL_malloc(binfo_size);
- if ( ! binfo ) {
- if ( video != current ) {
- SDL_FreeSurface(video);
- }
- SDL_OutOfMemory();
- return(NULL);
- }
-
- binfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- binfo->bmiHeader.biWidth = video->w;
- binfo->bmiHeader.biHeight = -video->h; /* -ve for topdown bitmap */
- binfo->bmiHeader.biPlanes = 1;
- binfo->bmiHeader.biSizeImage = video->h * video->pitch;
- binfo->bmiHeader.biXPelsPerMeter = 0;
- binfo->bmiHeader.biYPelsPerMeter = 0;
- binfo->bmiHeader.biClrUsed = 0;
- binfo->bmiHeader.biClrImportant = 0;
- binfo->bmiHeader.biBitCount = video->format->BitsPerPixel;
-
- if ( is16bitmode ) {
- /* BI_BITFIELDS tells CreateDIBSection about the rgb masks in the palette */
- binfo->bmiHeader.biCompression = BI_BITFIELDS;
- ((Uint32*)binfo->bmiColors)[0] = video->format->Rmask;
- ((Uint32*)binfo->bmiColors)[1] = video->format->Gmask;
- ((Uint32*)binfo->bmiColors)[2] = video->format->Bmask;
- } else {
- binfo->bmiHeader.biCompression = BI_RGB; /* BI_BITFIELDS for 565 vs 555 */
- if ( video->format->palette ) {
- SDL_memset(binfo->bmiColors, 0,
- video->format->palette->ncolors*sizeof(RGBQUAD));
- }
- }
-
- /* Create the offscreen bitmap buffer */
- hdc = GetDC(SDL_Window);
- screen_bmp = CreateDIBSection(hdc, binfo, DIB_RGB_COLORS,
- (void **)(&video->pixels), NULL, 0);
- ReleaseDC(SDL_Window, hdc);
- SDL_free(binfo);
- if ( screen_bmp == NULL ) {
- if ( video != current ) {
- SDL_FreeSurface(video);
- }
- SDL_SetError("Couldn't create DIB section");
- return(NULL);
- }
- this->UpdateRects = DIB_NormalUpdate;
-
- /* Set video surface flags */
- if ( screen_pal && (flags & (SDL_FULLSCREEN|SDL_HWPALETTE)) ) {
- grab_palette = TRUE;
- }
- /* BitBlt() maps colors for us */
- video->flags |= SDL_HWPALETTE;
- }
-#ifndef _WIN32_WCE
- /* Resize the window */
- if ( !SDL_windowid && !IsZoomed(SDL_Window) ) {
-#else
- if ( !SDL_windowid ) {
-#endif
- HWND top;
- UINT swp_flags;
- const char *window = NULL;
- const char *center = NULL;
-
- if ( video->w != prev_w || video->h != prev_h ) {
- window = SDL_getenv("SDL_VIDEO_WINDOW_POS");
- center = SDL_getenv("SDL_VIDEO_CENTERED");
- if ( window ) {
- if ( SDL_sscanf(window, "%d,%d", &x, &y) == 2 ) {
- SDL_windowX = x;
- SDL_windowY = y;
- }
- if ( SDL_strcmp(window, "center") == 0 ) {
- center = window;
- }
- }
- }
- swp_flags = (SWP_NOCOPYBITS | SWP_SHOWWINDOW);
-
- bounds.left = SDL_windowX;
- bounds.top = SDL_windowY;
- bounds.right = SDL_windowX+video->w;
- bounds.bottom = SDL_windowY+video->h;
-#ifndef _WIN32_WCE
- AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), (GetMenu(SDL_Window) != NULL), 0);
-#else
- // The bMenu parameter must be FALSE; menu bars are not supported
- AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), 0, 0);
-#endif
- width = bounds.right-bounds.left;
- height = bounds.bottom-bounds.top;
- if ( (flags & SDL_FULLSCREEN) ) {
- x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
- y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
- } else if ( center ) {
- x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
- y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
- } else if ( SDL_windowX || SDL_windowY || window ) {
- x = bounds.left;
- y = bounds.top;
- } else {
- x = y = -1;
- swp_flags |= SWP_NOMOVE;
- }
- if ( flags & SDL_FULLSCREEN ) {
- top = HWND_TOPMOST;
- } else {
- top = HWND_NOTOPMOST;
- }
- SetWindowPos(SDL_Window, top, x, y, width, height, swp_flags);
- if ( !(flags & SDL_FULLSCREEN) ) {
- SDL_windowX = SDL_bounds.left;
- SDL_windowY = SDL_bounds.top;
- }
- SetForegroundWindow(SDL_Window);
- }
- SDL_resizing = 0;
-
- /* Set up for OpenGL */
- if ( flags & SDL_OPENGL ) {
- if ( WIN_GL_SetupWindow(this) < 0 ) {
- return(NULL);
- }
- video->flags |= SDL_OPENGL;
- }
-
- /* JC 14 Mar 2006
- Flush the message loop or this can cause big problems later
- Especially if the user decides to use dialog boxes or assert()!
- */
- WIN_FlushMessageQueue();
-
- /* We're live! */
- return(video);
-}
-
-/* We don't actually allow hardware surfaces in the DIB driver */
-static int DIB_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- return(-1);
-}
-static void DIB_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-static int DIB_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- return(0);
-}
-static void DIB_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-static void DIB_NormalUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- HDC hdc, mdc;
- int i;
-
- hdc = GetDC(SDL_Window);
- if ( screen_pal ) {
- SelectPalette(hdc, screen_pal, FALSE);
- }
- mdc = CreateCompatibleDC(hdc);
- SelectObject(mdc, screen_bmp);
- for ( i=0; i<numrects; ++i ) {
- BitBlt(hdc, rects[i].x, rects[i].y, rects[i].w, rects[i].h,
- mdc, rects[i].x, rects[i].y, SRCCOPY);
- }
- DeleteDC(mdc);
- ReleaseDC(SDL_Window, hdc);
-}
-
-static int FindPaletteIndex(LOGPALETTE *pal, BYTE r, BYTE g, BYTE b)
-{
- PALETTEENTRY *entry;
- int i;
- int nentries = pal->palNumEntries;
-
- for ( i = 0; i < nentries; ++i ) {
- entry = &pal->palPalEntry[i];
- if ( entry->peRed == r && entry->peGreen == g && entry->peBlue == b ) {
- return i;
- }
- }
- return -1;
-}
-
-static BOOL CheckPaletteEntry(LOGPALETTE *pal, int index, BYTE r, BYTE g, BYTE b)
-{
- PALETTEENTRY *entry;
- BOOL moved = 0;
-
- entry = &pal->palPalEntry[index];
- if ( entry->peRed != r || entry->peGreen != g || entry->peBlue != b ) {
- int found = FindPaletteIndex(pal, r, g, b);
- if ( found >= 0 ) {
- pal->palPalEntry[found] = *entry;
- }
- entry->peRed = r;
- entry->peGreen = g;
- entry->peBlue = b;
- moved = 1;
- }
- entry->peFlags = 0;
-
- return moved;
-}
-
-int DIB_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
-#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 400)
- HDC hdc, mdc;
- RGBQUAD *pal;
-#else
- HDC hdc;
-#endif
- int i;
- int moved_entries = 0;
-
- /* Update the display palette */
- hdc = GetDC(SDL_Window);
- if ( screen_pal ) {
- PALETTEENTRY *entry;
-
- for ( i=0; i<ncolors; ++i ) {
- entry = &screen_logpal->palPalEntry[firstcolor+i];
- entry->peRed = colors[i].r;
- entry->peGreen = colors[i].g;
- entry->peBlue = colors[i].b;
- entry->peFlags = PC_NOCOLLAPSE;
- }
-#ifdef SYSPAL_NOSTATIC
- /* Check to make sure black and white are in position */
- if ( GetSystemPaletteUse(hdc) != SYSPAL_NOSTATIC256 ) {
- moved_entries += CheckPaletteEntry(screen_logpal, 0, 0x00, 0x00, 0x00);
- moved_entries += CheckPaletteEntry(screen_logpal, screen_logpal->palNumEntries-1, 0xff, 0xff, 0xff);
- }
- /* FIXME:
- If we don't have full access to the palette, what we
- really want to do is find the 236 most diverse colors
- in the desired palette, set those entries (10-245) and
- then map everything into the new system palette.
- */
-#endif
-
-#ifndef _WIN32_WCE
- /* Copy the entries into the system palette */
- UnrealizeObject(screen_pal);
-#endif
- SetPaletteEntries(screen_pal, 0, screen_logpal->palNumEntries, screen_logpal->palPalEntry);
- SelectPalette(hdc, screen_pal, FALSE);
- RealizePalette(hdc);
- }
-
-#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 400)
- /* Copy palette colors into DIB palette */
- pal = SDL_stack_alloc(RGBQUAD, ncolors);
- for ( i=0; i<ncolors; ++i ) {
- pal[i].rgbRed = colors[i].r;
- pal[i].rgbGreen = colors[i].g;
- pal[i].rgbBlue = colors[i].b;
- pal[i].rgbReserved = 0;
- }
-
- /* Set the DIB palette and update the display */
- mdc = CreateCompatibleDC(hdc);
- SelectObject(mdc, screen_bmp);
- SetDIBColorTable(mdc, firstcolor, ncolors, pal);
- if ( moved_entries || !grab_palette ) {
- BitBlt(hdc, 0, 0, this->screen->w, this->screen->h,
- mdc, 0, 0, SRCCOPY);
- }
- DeleteDC(mdc);
- SDL_stack_free(pal);
-#endif
- ReleaseDC(SDL_Window, hdc);
- return(1);
-}
-
-
-static void DIB_CheckGamma(_THIS)
-{
-#ifndef NO_GAMMA_SUPPORT
- HDC hdc;
- WORD ramp[3*256];
-
- /* If we fail to get gamma, disable gamma control */
- hdc = GetDC(SDL_Window);
- if ( ! GetDeviceGammaRamp(hdc, ramp) ) {
- this->GetGammaRamp = NULL;
- this->SetGammaRamp = NULL;
- }
- ReleaseDC(SDL_Window, hdc);
-#endif /* !NO_GAMMA_SUPPORT */
-}
-void DIB_SwapGamma(_THIS)
-{
-#ifndef NO_GAMMA_SUPPORT
- HDC hdc;
-
- if ( gamma_saved ) {
- hdc = GetDC(SDL_Window);
- if ( SDL_GetAppState() & SDL_APPINPUTFOCUS ) {
- /* About to leave active state, restore gamma */
- SetDeviceGammaRamp(hdc, gamma_saved);
- } else {
- /* About to enter active state, set game gamma */
- GetDeviceGammaRamp(hdc, gamma_saved);
- SetDeviceGammaRamp(hdc, this->gamma);
- }
- ReleaseDC(SDL_Window, hdc);
- }
-#endif /* !NO_GAMMA_SUPPORT */
-}
-void DIB_QuitGamma(_THIS)
-{
-#ifndef NO_GAMMA_SUPPORT
- if ( gamma_saved ) {
- /* Restore the original gamma if necessary */
- if ( SDL_GetAppState() & SDL_APPINPUTFOCUS ) {
- HDC hdc;
-
- hdc = GetDC(SDL_Window);
- SetDeviceGammaRamp(hdc, gamma_saved);
- ReleaseDC(SDL_Window, hdc);
- }
-
- /* Free the saved gamma memory */
- SDL_free(gamma_saved);
- gamma_saved = 0;
- }
-#endif /* !NO_GAMMA_SUPPORT */
-}
-
-int DIB_SetGammaRamp(_THIS, Uint16 *ramp)
-{
-#ifdef NO_GAMMA_SUPPORT
- SDL_SetError("SDL compiled without gamma ramp support");
- return -1;
-#else
- HDC hdc;
- BOOL succeeded;
-
- /* Set the ramp for the display */
- if ( ! gamma_saved ) {
- gamma_saved = (WORD *)SDL_malloc(3*256*sizeof(*gamma_saved));
- if ( ! gamma_saved ) {
- SDL_OutOfMemory();
- return -1;
- }
- hdc = GetDC(SDL_Window);
- GetDeviceGammaRamp(hdc, gamma_saved);
- ReleaseDC(SDL_Window, hdc);
- }
- if ( SDL_GetAppState() & SDL_APPINPUTFOCUS ) {
- hdc = GetDC(SDL_Window);
- succeeded = SetDeviceGammaRamp(hdc, ramp);
- ReleaseDC(SDL_Window, hdc);
- } else {
- succeeded = TRUE;
- }
- return succeeded ? 0 : -1;
-#endif /* !NO_GAMMA_SUPPORT */
-}
-
-int DIB_GetGammaRamp(_THIS, Uint16 *ramp)
-{
-#ifdef NO_GAMMA_SUPPORT
- SDL_SetError("SDL compiled without gamma ramp support");
- return -1;
-#else
- HDC hdc;
- BOOL succeeded;
-
- /* Get the ramp from the display */
- hdc = GetDC(SDL_Window);
- succeeded = GetDeviceGammaRamp(hdc, ramp);
- ReleaseDC(SDL_Window, hdc);
- return succeeded ? 0 : -1;
-#endif /* !NO_GAMMA_SUPPORT */
-}
-
-void DIB_VideoQuit(_THIS)
-{
- int i, j;
-
- /* Destroy the window and everything associated with it */
- if ( SDL_Window ) {
- /* Delete the screen bitmap (also frees screen->pixels) */
- if ( this->screen ) {
- if ( grab_palette ) {
- DIB_ReleaseStaticColors(SDL_Window);
- }
-#ifndef NO_CHANGEDISPLAYSETTINGS
- if ( this->screen->flags & SDL_FULLSCREEN ) {
- ChangeDisplaySettings(NULL, 0);
- ShowWindow(SDL_Window, SW_HIDE);
- }
-#endif
- if ( this->screen->flags & SDL_OPENGL ) {
- WIN_GL_ShutDown(this);
- }
- this->screen->pixels = NULL;
- }
- if ( screen_pal != NULL ) {
- DeleteObject(screen_pal);
- screen_pal = NULL;
- }
- if ( screen_logpal != NULL ) {
- SDL_free(screen_logpal);
- screen_logpal = NULL;
- }
- if ( screen_bmp ) {
- DeleteObject(screen_bmp);
- screen_bmp = NULL;
- }
- if ( screen_icn ) {
- DestroyIcon(screen_icn);
- screen_icn = NULL;
- }
- DIB_QuitGamma(this);
- DIB_DestroyWindow(this);
-
- SDL_Window = NULL;
-
-#if defined(_WIN32_WCE)
-
-// Unload wince aygshell library to prevent leak
- if( aygshell )
- {
- FreeLibrary(aygshell);
- aygshell = NULL;
- }
-#endif
- }
-
- for ( i=0; i < SDL_arraysize(SDL_modelist); ++i ) {
- if ( !SDL_modelist[i] ) {
- continue;
- }
- for ( j=0; SDL_modelist[i][j]; ++j ) {
- SDL_free(SDL_modelist[i][j]);
- }
- SDL_free(SDL_modelist[i]);
- SDL_modelist[i] = NULL;
- SDL_nummodes[i] = 0;
- }
-}
-
-/* Exported for the windows message loop only */
-static void DIB_GrabStaticColors(HWND window)
-{
-#ifdef SYSPAL_NOSTATIC
- HDC hdc;
-
- hdc = GetDC(window);
- SetSystemPaletteUse(hdc, SYSPAL_NOSTATIC256);
- if ( GetSystemPaletteUse(hdc) != SYSPAL_NOSTATIC256 ) {
- SetSystemPaletteUse(hdc, SYSPAL_NOSTATIC);
- }
- ReleaseDC(window, hdc);
-#endif
-}
-static void DIB_ReleaseStaticColors(HWND window)
-{
-#ifdef SYSPAL_NOSTATIC
- HDC hdc;
-
- hdc = GetDC(window);
- SetSystemPaletteUse(hdc, SYSPAL_STATIC);
- ReleaseDC(window, hdc);
-#endif
-}
-static void DIB_Activate(_THIS, BOOL active, BOOL minimized)
-{
- if ( grab_palette ) {
- if ( !active ) {
- DIB_ReleaseStaticColors(SDL_Window);
- DIB_RealizePalette(this);
- } else if ( !minimized ) {
- DIB_GrabStaticColors(SDL_Window);
- DIB_RealizePalette(this);
- }
- }
-}
-static void DIB_RealizePalette(_THIS)
-{
- if ( screen_pal != NULL ) {
- HDC hdc;
-
- hdc = GetDC(SDL_Window);
-#ifndef _WIN32_WCE
- UnrealizeObject(screen_pal);
-#endif
- SelectPalette(hdc, screen_pal, FALSE);
- if ( RealizePalette(hdc) ) {
- InvalidateRect(SDL_Window, NULL, FALSE);
- }
- ReleaseDC(SDL_Window, hdc);
- }
-}
-static void DIB_PaletteChanged(_THIS, HWND window)
-{
- if ( window != SDL_Window ) {
- DIB_RealizePalette(this);
- }
-}
-
-/* Exported for the windows message loop only */
-static void DIB_WinPAINT(_THIS, HDC hdc)
-{
- HDC mdc;
-
- if ( screen_pal ) {
- SelectPalette(hdc, screen_pal, FALSE);
- }
- mdc = CreateCompatibleDC(hdc);
- SelectObject(mdc, screen_bmp);
- BitBlt(hdc, 0, 0, SDL_VideoSurface->w, SDL_VideoSurface->h,
- mdc, 0, 0, SRCCOPY);
- DeleteDC(mdc);
-}
-
-static void DIB_GetWinPos(_THIS, int* px, int *py)
-{
- RECT rect;
- GetWindowRect(SDL_Window, &rect);
- *px = rect.left;
- *py = rect.top;
-}
-
-static void DIB_SetWinPos(_THIS, int x, int y)
-{
- SetWindowPos(SDL_Window, HWND_TOPMOST,
- x, y, 0, 0, SWP_NOSIZE|SWP_NOZORDER);
-}
-
-typedef struct {
- int result;
- int first;
- RECT wrect;
- RECT primary;
-} VisibilityData;
-
-
-BOOL CALLBACK visibility_cb(HMONITOR hMonitor,
- HDC hdcMonitor,
- LPRECT mrect,
- LPARAM dwData)
-{
- VisibilityData* data = (VisibilityData*)dwData;
-
- if ( data->first ) {
- data->first = 0;
- data->primary = mrect[0];
- }
-
- if ( data->wrect.left >= mrect->left &&
- data->wrect.right <= mrect->right &&
- data->wrect.top >= mrect->top &&
- data->wrect.bottom <= mrect->bottom )
- {
- data->result = 1;
- return FALSE;
- }
- return TRUE;
-}
-
-static int DIB_IsWinVisible(_THIS, int recenter)
-{
- VisibilityData data;
- data.result = 0;
- data.first = 1;
-
- GetWindowRect(SDL_Window, &data.wrect);
-
- EnumDisplayMonitors(NULL, NULL, visibility_cb, (LPARAM)&data);
-
- if ( !data.result && recenter ) {
- int new_x = 10;
- int new_y = 10;
-
- if ( !data.first ) {
- int primary_w = data.primary.right - data.primary.left;
- int primary_h = data.primary.bottom - data.primary.top;
-
- new_x = data.primary.left + (primary_w - this->screen->w)/2;
- new_y = data.primary.top + (primary_h - this->screen->h)/2;
- }
- DIB_SetWinPos(this, new_x, new_y);
- }
- return data.result;
-}
-
-static int DIB_GetMonitorDPI(_THIS, int* xDpi, int *yDpi)
-{
- HDC displayDC = CreateDC( "DISPLAY", NULL, NULL, NULL );
- int xdpi, ydpi;
-
- if (displayDC == NULL) {
- return -1;
- }
- xdpi = GetDeviceCaps( displayDC, LOGPIXELSX );
- ydpi = GetDeviceCaps( displayDC, LOGPIXELSY );
-
- DeleteDC(displayDC);
-
- /* sanity checks */
- if (xdpi < 20 || xdpi > 400 || ydpi < 20 || ydpi > 400) {
- return -1;
- }
-
- *xDpi = xdpi;
- *yDpi = ydpi;
- return 0;
-}
-
-
-typedef struct {
- int first;
- RECT wrect;
- long bestArea;
- RECT bestRect;
- RECT primary;
-} ProximityData;
-
-BOOL CALLBACK proximity_cb(HMONITOR hMonitor,
- HDC hdcMonitor,
- LPRECT mrect,
- LPARAM dwData)
-{
- ProximityData* data = (ProximityData*)dwData;
- int x1, y1, x2, y2, area;
-
- x1 = mrect->left;
- x2 = mrect->right;
- y1 = mrect->top;
- y2 = mrect->bottom;
-
- if (data->first) {
- data->primary = mrect[0];
- }
-
- if (x1 < data->wrect.left)
- x1 = data->wrect.left;
- if (x2 > data->wrect.right)
- x2 = data->wrect.right;
- if (y1 < data->wrect.top)
- y1 = data->wrect.top;
- if (y2 > data->wrect.bottom)
- y2 = data->wrect.bottom;
-
- if (x1 >= x2 || y1 >= y2)
- return TRUE;
-
- area = (x2-x1)*(y2-y1);
- if (data->first || area > data->bestArea) {
- data->first = 0;
- data->bestRect = mrect[0];
- data->bestArea = area;
- }
- return TRUE;
-}
-
-static int DIB_GetMonitorRect(_THIS, SDL_Rect* rect)
-{
- ProximityData data;
- RECT* sr;
-
- data.first = 1;
- GetWindowRect(SDL_Window, &data.wrect);
-
- EnumDisplayMonitors(NULL, NULL, proximity_cb, (LPARAM)&data);
-
- if (data.first)
- return -1;
-
- sr = &data.bestRect;
-
- rect->x = sr->left;
- rect->y = sr->top;
- rect->w = sr->right - sr->left;
- rect->h = sr->bottom - sr->top;
-
- return 0;
-}
-
-/* Stub in case DirectX isn't available */
-#if !SDL_AUDIO_DRIVER_DSOUND
-void DX5_SoundFocus(HWND hwnd)
-{
- return;
-}
-#endif
diff --git a/distrib/sdl-1.2.12/src/video/windib/SDL_dibvideo.h b/distrib/sdl-1.2.12/src/video/windib/SDL_dibvideo.h
deleted file mode 100644
index 043c11d..0000000
--- a/distrib/sdl-1.2.12/src/video/windib/SDL_dibvideo.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_dibvideo_h
-#define _SDL_dibvideo_h
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-/* for PDA */
-typedef enum
-{
- SDL_ORIENTATION_UP,
- SDL_ORIENTATION_DOWN,
- SDL_ORIENTATION_LEFT,
- SDL_ORIENTATION_RIGHT
-} SDL_ScreenOrientation;
-
-/* Private display data */
-struct SDL_PrivateVideoData {
- HBITMAP screen_bmp;
- HPALETTE screen_pal;
- LOGPALETTE *screen_logpal;
- BOOL grab_palette;
-
- int allow_screensaver;
-
-#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
- int SDL_nummodes[NUM_MODELISTS];
- SDL_Rect **SDL_modelist[NUM_MODELISTS];
-
- SDL_ScreenOrientation orientation;
-#ifdef _WIN32_WCE
- int invert; /* do to remove, used by GAPI driver! */
- char hiresFix; /* using hires mode without defining hires resource */
- int supportRotation; /* for Pocket PC devices */
- DWORD origRotation; /* for Pocket PC devices */
-#endif
-};
-/* Old variable names */
-#define screen_bmp (this->hidden->screen_bmp)
-#define screen_pal (this->hidden->screen_pal)
-#define screen_logpal (this->hidden->screen_logpal)
-#define grab_palette (this->hidden->grab_palette)
-#define SDL_nummodes (this->hidden->SDL_nummodes)
-#define SDL_modelist (this->hidden->SDL_modelist)
-
-#endif /* _SDL_dibvideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/windib/SDL_vkeys.h b/distrib/sdl-1.2.12/src/video/windib/SDL_vkeys.h
deleted file mode 100644
index 1f673b1..0000000
--- a/distrib/sdl-1.2.12/src/video/windib/SDL_vkeys.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-#ifndef 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'
-#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
diff --git a/distrib/sdl-1.2.12/src/video/windx5/SDL_dx5events.c b/distrib/sdl-1.2.12/src/video/windx5/SDL_dx5events.c
deleted file mode 100644
index 51373d3..0000000
--- a/distrib/sdl-1.2.12/src/video/windx5/SDL_dx5events.c
+++ /dev/null
@@ -1,923 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* CAUTION!!!! If you modify this file, check ../windib/SDL_sysevents.c */
-
-#include "directx.h"
-
-#include "SDL_main.h"
-#include "SDL_events.h"
-#include "SDL_video.h"
-#include "SDL_syswm.h"
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "../wincommon/SDL_lowvideo.h"
-#include "SDL_dx5video.h"
-
-#ifndef WM_APP
-#define WM_APP 0x8000
-#endif
-
-#ifdef _WIN32_WCE
-#define NO_GETKEYBOARDSTATE
-#endif
-
-/* The keyboard and mouse device input */
-#define MAX_INPUTS 16 /* Maximum of 16-1 input devices */
-#define INPUT_QSIZE 512 /* Buffer up to 512 input messages */
-
-static LPDIRECTINPUT dinput = NULL;
-static LPDIRECTINPUTDEVICE2 SDL_DIdev[MAX_INPUTS];
-static HANDLE SDL_DIevt[MAX_INPUTS];
-static void (*SDL_DIfun[MAX_INPUTS])(const int, DIDEVICEOBJECTDATA *);
-static int SDL_DIndev = 0;
-static int mouse_lost;
-static int mouse_pressed;
-static int mouse_buttons_swapped = 0;
-
-/* The translation table from a DirectInput scancode to an SDL keysym */
-static SDLKey DIK_keymap[256];
-static SDL_keysym *TranslateKey(UINT scancode, SDL_keysym *keysym, int pressed);
-
-/* DJM: If the user setup the window for us, we want to save his window proc,
- and give him a chance to handle some messages. */
-#ifdef STRICT
-#define WNDPROCTYPE WNDPROC
-#else
-#define WNDPROCTYPE FARPROC
-#endif
-static WNDPROCTYPE userWindowProc = NULL;
-
-static HWND GetTopLevelParent(HWND hWnd)
-{
- HWND hParentWnd;
- while (1)
- {
- hParentWnd = GetParent(hWnd);
- if (hParentWnd == NULL)
- break;
- hWnd = hParentWnd;
- }
- return hWnd;
-}
-
-/* Convert a DirectInput return code to a text message */
-static void SetDIerror(char *function, int code)
-{
- static char *error;
- static char errbuf[1024];
-
- errbuf[0] = 0;
- switch (code) {
- case DIERR_GENERIC:
- error = "Undefined error!";
- break;
- case DIERR_OLDDIRECTINPUTVERSION:
- error = "Your version of DirectInput needs upgrading";
- break;
- case DIERR_INVALIDPARAM:
- error = "Invalid parameters";
- break;
- case DIERR_OUTOFMEMORY:
- error = "Out of memory";
- break;
- case DIERR_DEVICENOTREG:
- error = "Device not registered";
- break;
- case DIERR_NOINTERFACE:
- error = "Interface not supported";
- break;
- case DIERR_NOTINITIALIZED:
- error = "Device not initialized";
- break;
- default:
- SDL_snprintf(errbuf, SDL_arraysize(errbuf),
- "%s: Unknown DirectInput error: 0x%x",
- function, code);
- break;
- }
- if ( ! errbuf[0] ) {
- SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: %s", function, error);
- }
- SDL_SetError("%s", errbuf);
- return;
-}
-
-/* Initialize DirectInput
- Note: If NONEXCLUSIVE access is requested for the devices, normal
- windows input messages will continue to be generated for that
- input device, in addition to DirectInput messages.
- */
-static void handle_keyboard(const int numevents, DIDEVICEOBJECTDATA *events);
-static void handle_mouse(const int numevents, DIDEVICEOBJECTDATA *events);
-struct {
- char *name;
- REFGUID guid;
- LPCDIDATAFORMAT format;
- DWORD win_level;
- DWORD raw_level;
- void (*fun)(const int numevents, DIDEVICEOBJECTDATA *events);
-} inputs[] = {
- { "keyboard",
- &GUID_SysKeyboard, &c_dfDIKeyboard,
- (DISCL_FOREGROUND|DISCL_NONEXCLUSIVE),
- (DISCL_FOREGROUND|DISCL_NONEXCLUSIVE), handle_keyboard },
- { "mouse",
- &GUID_SysMouse, &c_dfDIMouse,
- (DISCL_FOREGROUND|DISCL_NONEXCLUSIVE),
- (DISCL_FOREGROUND|DISCL_EXCLUSIVE), handle_mouse },
- { NULL, NULL, NULL, 0, 0, NULL }
-};
-
-static int DX5_DInputInit(_THIS)
-{
- int i;
- LPDIRECTINPUTDEVICE device;
- HRESULT result;
- DIPROPDWORD dipdw;
- HWND topwnd;
-
- /* Create the DirectInput object */
- result = DInputCreate(SDL_Instance, DIRECTINPUT_VERSION,
- &dinput, NULL);
- if ( result != DI_OK ) {
- SetDIerror("DirectInputCreate", result);
- return(-1);
- }
-
- /* Create all of our registered input devices */
- SDL_DIndev = 0;
- for ( i=0; inputs[i].name; ++i ) {
- /* Create the DirectInput device */
- result = IDirectInput_CreateDevice(dinput, inputs[i].guid,
- &device, NULL);
- if ( result != DI_OK ) {
- SetDIerror("DirectInput::CreateDevice", result);
- return(-1);
- }
- result = IDirectInputDevice_QueryInterface(device,
- &IID_IDirectInputDevice2, (LPVOID *)&SDL_DIdev[i]);
- IDirectInputDevice_Release(device);
- if ( result != DI_OK ) {
- SetDIerror("DirectInputDevice::QueryInterface", result);
- return(-1);
- }
- topwnd = GetTopLevelParent(SDL_Window);
- result = IDirectInputDevice2_SetCooperativeLevel(SDL_DIdev[i],
- topwnd, inputs[i].win_level);
- if ( result != DI_OK ) {
- SetDIerror("DirectInputDevice::SetCooperativeLevel",
- result);
- return(-1);
- }
- result = IDirectInputDevice2_SetDataFormat(SDL_DIdev[i],
- inputs[i].format);
- if ( result != DI_OK ) {
- SetDIerror("DirectInputDevice::SetDataFormat", result);
- return(-1);
- }
-
- /* Set buffered input -- we aren't polling */
- SDL_memset(&dipdw, 0, sizeof(dipdw));
- dipdw.diph.dwSize = sizeof(dipdw);
- dipdw.diph.dwHeaderSize = sizeof(dipdw.diph);
- dipdw.diph.dwObj = 0;
- dipdw.diph.dwHow = DIPH_DEVICE;
- dipdw.dwData = INPUT_QSIZE;
- result = IDirectInputDevice2_SetProperty(SDL_DIdev[i],
- DIPROP_BUFFERSIZE, &dipdw.diph);
- if ( result != DI_OK ) {
- SetDIerror("DirectInputDevice::SetProperty", result);
- return(-1);
- }
-
- /* Create an event to be signaled when input is ready */
- SDL_DIevt[i] = CreateEvent(NULL, FALSE, FALSE, NULL);
- if ( SDL_DIevt[i] == NULL ) {
- SDL_SetError("Couldn't create DirectInput event");
- return(-1);
- }
- result = IDirectInputDevice2_SetEventNotification(SDL_DIdev[i],
- SDL_DIevt[i]);
- if ( result != DI_OK ) {
- SetDIerror("DirectInputDevice::SetEventNotification",
- result);
- return(-1);
- }
- SDL_DIfun[i] = inputs[i].fun;
-
- /* Acquire the device for input */
- IDirectInputDevice2_Acquire(SDL_DIdev[i]);
-
- /* Increment the number of devices we have */
- ++SDL_DIndev;
- }
- mouse_pressed = 0;
- mouse_buttons_swapped = GetSystemMetrics(SM_SWAPBUTTON);
-
- /* DirectInput is ready! */
- return(0);
-}
-
-/* Clean up DirectInput */
-static void DX5_DInputQuit(_THIS)
-{
- int i;
-
- if ( dinput != NULL ) {
- /* Close and release all DirectInput devices */
- for ( i=0; i<MAX_INPUTS; ++i ) {
- if ( SDL_DIdev[i] != NULL ) {
- IDirectInputDevice2_Unacquire(SDL_DIdev[i]);
- IDirectInputDevice2_SetEventNotification(
- SDL_DIdev[i], NULL);
- if ( SDL_DIevt[i] != NULL ) {
- CloseHandle(SDL_DIevt[i]);
- SDL_DIevt[i] = NULL;
- }
- IDirectInputDevice2_Release(SDL_DIdev[i]);
- SDL_DIdev[i] = NULL;
- }
- }
- /* Release DirectInput */
- IDirectInput_Release(dinput);
- dinput = NULL;
- }
-}
-
-/* Flag to tell SDL whether or not we queued an event */
-static int posted = 0;
-
-/* Input event handler functions */
-static void handle_keyboard(const int numevents, DIDEVICEOBJECTDATA *keybuf)
-{
- int i;
- SDL_keysym keysym;
-
- /* Translate keyboard messages */
- for ( i=0; i<numevents; ++i ) {
- if ( keybuf[i].dwData & 0x80 ) {
- posted = SDL_PrivateKeyboard(SDL_PRESSED,
- TranslateKey(keybuf[i].dwOfs, &keysym, 1));
- } else {
- posted = SDL_PrivateKeyboard(SDL_RELEASED,
- TranslateKey(keybuf[i].dwOfs, &keysym, 0));
- }
- }
-}
-static void handle_mouse(const int numevents, DIDEVICEOBJECTDATA *ptrbuf)
-{
- int i;
- Sint16 xrel, yrel;
- Uint8 state;
- Uint8 button;
- DWORD timestamp = 0;
-
- /* Sanity check. Mailing list reports this being NULL unexpectedly. */
- if (SDL_PublicSurface == NULL) {
- return;
- }
-
- /* If we are in windowed mode, Windows is taking care of the mouse */
- if ( (SDL_PublicSurface->flags & SDL_OPENGL) ||
- !(SDL_PublicSurface->flags & SDL_FULLSCREEN) ) {
- return;
- }
-
- /* If the mouse was lost, regain some sense of mouse state */
- if ( mouse_lost ) {
- POINT mouse_pos;
- Uint8 old_state;
- Uint8 new_state;
-
- /* Set ourselves up with the current cursor position */
- GetCursorPos(&mouse_pos);
- ScreenToClient(SDL_Window, &mouse_pos);
- posted = SDL_PrivateMouseMotion(0, 0,
- (Sint16)mouse_pos.x, (Sint16)mouse_pos.y);
-
- /* Check for mouse button changes */
- old_state = SDL_GetMouseState(NULL, NULL);
- new_state = 0;
- { /* Get the new DirectInput button state for the mouse */
- DIMOUSESTATE distate;
- HRESULT result;
-
- result=IDirectInputDevice2_GetDeviceState(SDL_DIdev[1],
- sizeof(distate), &distate);
- if ( result != DI_OK ) {
- /* Try again next time */
- SetDIerror(
- "IDirectInputDevice2::GetDeviceState", result);
- return;
- }
- for ( i=3; i>=0; --i ) {
- if ( (distate.rgbButtons[i]&0x80) == 0x80 ) {
- new_state |= 0x01;
- }
- new_state <<= 1;
- }
- }
- for ( i=0; i<8; ++i ) {
- if ( (old_state&0x01) != (new_state&0x01) ) {
- button = (Uint8)(i+1);
- /* Button #2 on two button mice is button 3
- (the middle button is button 2)
- */
- if ( button == 2 ) {
- button = 3;
- } else
- if ( button == 3 ) {
- button = 2;
- }
- if ( new_state & 0x01 ) {
- /* Grab mouse so we get mouse-up */
- if ( ++mouse_pressed > 0 ) {
- SetCapture(SDL_Window);
- }
- state = SDL_PRESSED;
- } else {
- /* Release mouse after all mouse-ups */
- if ( --mouse_pressed <= 0 ) {
- ReleaseCapture();
- mouse_pressed = 0;
- }
- state = SDL_RELEASED;
- }
- if ( mouse_buttons_swapped ) {
- if ( button == 1 ) button = 3;
- else
- if ( button == 3 ) button = 1;
- }
- posted = SDL_PrivateMouseButton(state, button,
- 0, 0);
- }
- old_state >>= 1;
- new_state >>= 1;
- }
- mouse_lost = 0;
- return;
- }
-
- /* Translate mouse messages */
- xrel = 0;
- yrel = 0;
- for ( i=0; i<(int)numevents; ++i ) {
- switch (ptrbuf[i].dwOfs) {
- case DIMOFS_X:
- if ( timestamp != ptrbuf[i].dwTimeStamp ) {
- if ( xrel || yrel ) {
- posted = SDL_PrivateMouseMotion(
- 0, 1, xrel, yrel);
- xrel = 0;
- yrel = 0;
- }
- timestamp = ptrbuf[i].dwTimeStamp;
- }
- xrel += (Sint16)ptrbuf[i].dwData;
- break;
- case DIMOFS_Y:
- if ( timestamp != ptrbuf[i].dwTimeStamp ) {
- if ( xrel || yrel ) {
- posted = SDL_PrivateMouseMotion(
- 0, 1, xrel, yrel);
- xrel = 0;
- yrel = 0;
- }
- timestamp = ptrbuf[i].dwTimeStamp;
- }
- yrel += (Sint16)ptrbuf[i].dwData;
- break;
- case DIMOFS_Z:
- if ( xrel || yrel ) {
- posted = SDL_PrivateMouseMotion(
- 0, 1, xrel, yrel);
- xrel = 0;
- yrel = 0;
- }
- timestamp = 0;
- if((int)ptrbuf[i].dwData > 0)
- button = SDL_BUTTON_WHEELUP;
- else
- button = SDL_BUTTON_WHEELDOWN;
- posted = SDL_PrivateMouseButton(
- SDL_PRESSED, button, 0, 0);
- posted |= SDL_PrivateMouseButton(
- SDL_RELEASED, button, 0, 0);
- break;
- case DIMOFS_BUTTON0:
- case DIMOFS_BUTTON1:
- case DIMOFS_BUTTON2:
- case DIMOFS_BUTTON3:
- if ( xrel || yrel ) {
- posted = SDL_PrivateMouseMotion(
- 0, 1, xrel, yrel);
- xrel = 0;
- yrel = 0;
- }
- timestamp = 0;
- button = (Uint8)(ptrbuf[i].dwOfs-DIMOFS_BUTTON0)+1;
- /* Button #2 on two button mice is button 3
- (the middle button is button 2)
- */
- if ( button == 2 ) {
- button = 3;
- } else
- if ( button == 3 ) {
- button = 2;
- }
- if ( ptrbuf[i].dwData & 0x80 ) {
- /* Grab mouse so we get mouse-up */
- if ( ++mouse_pressed > 0 ) {
- SetCapture(SDL_Window);
- }
- state = SDL_PRESSED;
- } else {
- /* Release mouse after all mouse-ups */
- if ( --mouse_pressed <= 0 ) {
- ReleaseCapture();
- mouse_pressed = 0;
- }
- state = SDL_RELEASED;
- }
- if ( mouse_buttons_swapped ) {
- if ( button == 1 ) button = 3;
- else
- if ( button == 3 ) button = 1;
- }
- posted = SDL_PrivateMouseButton(state, button,
- 0, 0);
- break;
- }
- }
- if ( xrel || yrel ) {
- posted = SDL_PrivateMouseMotion( 0, 1, xrel, yrel);
- }
-}
-
-/* The main Win32 event handler */
-LRESULT DX5_HandleMessage(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- switch (msg) {
-#ifdef WM_ACTIVATEAPP
- case WM_ACTIVATEAPP: {
- int i, active;
-
- active = (wParam && (GetForegroundWindow() == hwnd));
- if ( active ) {
- for ( i=0; SDL_DIdev[i]; ++i ) {
- IDirectInputDevice2_Acquire(
- SDL_DIdev[i]);
- }
- } else {
- for ( i=0; SDL_DIdev[i]; ++i ) {
- IDirectInputDevice2_Unacquire(
- SDL_DIdev[i]);
- }
- mouse_lost = 1;
- }
- }
- break;
-#endif /* WM_ACTIVATEAPP */
-
-#ifdef WM_DISPLAYCHANGE
- case WM_DISPLAYCHANGE: {
- WPARAM BitsPerPixel;
- WORD SizeX, SizeY;
-
- /* Ack! The display changed size and/or depth! */
- SizeX = LOWORD(lParam);
- SizeY = HIWORD(lParam);
- BitsPerPixel = wParam;
- /* We cause this message when we go fullscreen */
- }
- break;
-#endif /* WM_DISPLAYCHANGE */
-
- /* The keyboard is handled via DirectInput */
- case WM_SYSKEYUP:
- case WM_SYSKEYDOWN: {
- /* Pass syskey to DefWindwoProc (ALT-F4, etc.) */
- }
- break;
- case WM_KEYUP:
- case WM_KEYDOWN: {
- /* Ignore windows keyboard messages */;
- }
- return(0);
-
-#if defined(SC_SCREENSAVE) || defined(SC_MONITORPOWER)
- /* Don't allow screen savers or monitor power downs.
- This is because they quietly clear DirectX surfaces.
- It would be better to allow the application to
- decide whether or not to blow these off, but the
- semantics of SDL_PrivateSysWMEvent() don't allow
- the application that choice.
- */
- case WM_SYSCOMMAND: {
- if ((wParam&0xFFF0)==SC_SCREENSAVE ||
- (wParam&0xFFF0)==SC_MONITORPOWER)
- return(0);
- }
- /* Fall through to default processing */
-
-#endif /* SC_SCREENSAVE || SC_MONITORPOWER */
-
- default: {
- /* Only post the event if we're watching for it */
- if ( SDL_ProcessEvents[SDL_SYSWMEVENT] == SDL_ENABLE ) {
- SDL_SysWMmsg wmmsg;
-
- SDL_VERSION(&wmmsg.version);
- wmmsg.hwnd = hwnd;
- wmmsg.msg = msg;
- wmmsg.wParam = wParam;
- wmmsg.lParam = lParam;
- posted = SDL_PrivateSysWMEvent(&wmmsg);
-
- /* DJM: If the user isn't watching for private
- messages in her SDL event loop, then pass it
- along to any win32 specific window proc.
- */
- } else if (userWindowProc) {
- return CallWindowProc(userWindowProc, hwnd, msg, wParam, lParam);
- }
- }
- break;
- }
- return(DefWindowProc(hwnd, msg, wParam, lParam));
-}
-
-/* This function checks the windows message queue and DirectInput and returns
- 1 if there was input, 0 if there was no input, or -1 if the application has
- posted a quit message.
-*/
-static int DX5_CheckInput(_THIS, int timeout, BOOL processInput)
-{
- MSG msg;
- int i;
- HRESULT result;
- DWORD event;
-
- /* Check the normal windows queue (highest preference) */
- posted = 0;
- while ( ! posted &&
- PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) ) {
- if ( GetMessage(&msg, NULL, 0, 0) > 0 ) {
- DispatchMessage(&msg);
- } else {
- return(-1);
- }
- }
- if ( posted ) {
- return(1);
- }
-
- /* Pump the DirectInput flow */
- if ( SDL_GetAppState() & SDL_APPINPUTFOCUS ) {
- for ( i=0; i<SDL_DIndev; ++i ) {
- result = IDirectInputDevice2_Poll(SDL_DIdev[i]);
- if ( (result == DIERR_INPUTLOST) ||
- (result == DIERR_NOTACQUIRED) ) {
- if ( SDL_strcmp(inputs[i].name, "mouse") == 0 ) {
- mouse_lost = 1;
- }
- IDirectInputDevice2_Acquire(SDL_DIdev[i]);
- IDirectInputDevice2_Poll(SDL_DIdev[i]);
- }
- }
- }
-
- /* Wait for messages and input events */
- event = MsgWaitForMultipleObjects(SDL_DIndev, SDL_DIevt, FALSE,
- timeout, QS_ALLEVENTS);
- if ((event >= WAIT_OBJECT_0) && (event < (WAIT_OBJECT_0+SDL_DIndev))) {
- DWORD numevents;
- static DIDEVICEOBJECTDATA evtbuf[INPUT_QSIZE];
-
- event -= WAIT_OBJECT_0;
- numevents = INPUT_QSIZE;
- result = IDirectInputDevice2_GetDeviceData(
- SDL_DIdev[event], sizeof(DIDEVICEOBJECTDATA),
- evtbuf, &numevents, 0);
- if ( (result == DIERR_INPUTLOST) ||
- (result == DIERR_NOTACQUIRED) ) {
- if ( SDL_strcmp(inputs[event].name, "mouse") == 0 ) {
- mouse_lost = 1;
- }
- IDirectInputDevice2_Acquire(SDL_DIdev[event]);
- result = IDirectInputDevice2_GetDeviceData(
- SDL_DIdev[event], sizeof(DIDEVICEOBJECTDATA),
- evtbuf, &numevents, 0);
- }
- /* Handle the events */
- if ( result == DI_OK && processInput ) {
- /* Note: This can post multiple events to event queue
- */
- (*SDL_DIfun[event])((int)numevents, evtbuf);
- return(1);
- }
- }
- if ( event != WAIT_TIMEOUT ) {
- /* Maybe there was a windows message? */
- if ( PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) ) {
- if ( GetMessage(&msg, NULL, 0, 0) > 0 ) {
- DispatchMessage(&msg);
- } else {
- return(-1);
- }
- return(1);
- }
- }
- return(0);
-}
-
-/* Change cooperative level based on whether or not we are fullscreen */
-void DX5_DInputReset(_THIS, int fullscreen)
-{
- DWORD level;
- int i;
- HRESULT result;
- HWND topwnd;
-
- for ( i=0; i<MAX_INPUTS; ++i ) {
- if ( SDL_DIdev[i] != NULL ) {
- if ( fullscreen ) {
- level = inputs[i].raw_level;
- } else {
- level = inputs[i].win_level;
- }
- IDirectInputDevice2_Unacquire(SDL_DIdev[i]);
- topwnd = GetTopLevelParent(SDL_Window);
- result = IDirectInputDevice2_SetCooperativeLevel(
- SDL_DIdev[i], topwnd, level);
- IDirectInputDevice2_Acquire(SDL_DIdev[i]);
- if ( result != DI_OK ) {
- SetDIerror(
- "DirectInputDevice::SetCooperativeLevel", result);
- }
- }
- }
- mouse_lost = 1;
-
- /* Flush pending input */
- DX5_CheckInput(this, 0, FALSE);
-}
-
-void DX5_PumpEvents(_THIS)
-{
- /* Wait for messages and DirectInput */
- while ( DX5_CheckInput(this, 0, TRUE) > 0 ) {
- /* Loop and check again */;
- }
-}
-
-void DX5_InitOSKeymap(_THIS)
-{
-#ifndef DIK_PAUSE
-#define DIK_PAUSE 0xC5
-#endif
-#ifndef DIK_OEM_102
-#define DIK_OEM_102 0x56 /* < > | on UK/Germany keyboards */
-#endif
- int i;
-
- /* Map the DIK scancodes to SDL keysyms */
- for ( i=0; i<SDL_arraysize(DIK_keymap); ++i )
- DIK_keymap[i] = 0;
-
- /* Defined DIK_* constants */
- DIK_keymap[DIK_ESCAPE] = SDLK_ESCAPE;
- DIK_keymap[DIK_1] = SDLK_1;
- DIK_keymap[DIK_2] = SDLK_2;
- DIK_keymap[DIK_3] = SDLK_3;
- DIK_keymap[DIK_4] = SDLK_4;
- DIK_keymap[DIK_5] = SDLK_5;
- DIK_keymap[DIK_6] = SDLK_6;
- DIK_keymap[DIK_7] = SDLK_7;
- DIK_keymap[DIK_8] = SDLK_8;
- DIK_keymap[DIK_9] = SDLK_9;
- DIK_keymap[DIK_0] = SDLK_0;
- DIK_keymap[DIK_MINUS] = SDLK_MINUS;
- DIK_keymap[DIK_EQUALS] = SDLK_EQUALS;
- DIK_keymap[DIK_BACK] = SDLK_BACKSPACE;
- DIK_keymap[DIK_TAB] = SDLK_TAB;
- DIK_keymap[DIK_Q] = SDLK_q;
- DIK_keymap[DIK_W] = SDLK_w;
- DIK_keymap[DIK_E] = SDLK_e;
- DIK_keymap[DIK_R] = SDLK_r;
- DIK_keymap[DIK_T] = SDLK_t;
- DIK_keymap[DIK_Y] = SDLK_y;
- DIK_keymap[DIK_U] = SDLK_u;
- DIK_keymap[DIK_I] = SDLK_i;
- DIK_keymap[DIK_O] = SDLK_o;
- DIK_keymap[DIK_P] = SDLK_p;
- DIK_keymap[DIK_LBRACKET] = SDLK_LEFTBRACKET;
- DIK_keymap[DIK_RBRACKET] = SDLK_RIGHTBRACKET;
- DIK_keymap[DIK_RETURN] = SDLK_RETURN;
- DIK_keymap[DIK_LCONTROL] = SDLK_LCTRL;
- DIK_keymap[DIK_A] = SDLK_a;
- DIK_keymap[DIK_S] = SDLK_s;
- DIK_keymap[DIK_D] = SDLK_d;
- DIK_keymap[DIK_F] = SDLK_f;
- DIK_keymap[DIK_G] = SDLK_g;
- DIK_keymap[DIK_H] = SDLK_h;
- DIK_keymap[DIK_J] = SDLK_j;
- DIK_keymap[DIK_K] = SDLK_k;
- DIK_keymap[DIK_L] = SDLK_l;
- DIK_keymap[DIK_SEMICOLON] = SDLK_SEMICOLON;
- DIK_keymap[DIK_APOSTROPHE] = SDLK_QUOTE;
- DIK_keymap[DIK_GRAVE] = SDLK_BACKQUOTE;
- DIK_keymap[DIK_LSHIFT] = SDLK_LSHIFT;
- DIK_keymap[DIK_BACKSLASH] = SDLK_BACKSLASH;
- DIK_keymap[DIK_OEM_102] = SDLK_LESS;
- DIK_keymap[DIK_Z] = SDLK_z;
- DIK_keymap[DIK_X] = SDLK_x;
- DIK_keymap[DIK_C] = SDLK_c;
- DIK_keymap[DIK_V] = SDLK_v;
- DIK_keymap[DIK_B] = SDLK_b;
- DIK_keymap[DIK_N] = SDLK_n;
- DIK_keymap[DIK_M] = SDLK_m;
- DIK_keymap[DIK_COMMA] = SDLK_COMMA;
- DIK_keymap[DIK_PERIOD] = SDLK_PERIOD;
- DIK_keymap[DIK_SLASH] = SDLK_SLASH;
- DIK_keymap[DIK_RSHIFT] = SDLK_RSHIFT;
- DIK_keymap[DIK_MULTIPLY] = SDLK_KP_MULTIPLY;
- DIK_keymap[DIK_LMENU] = SDLK_LALT;
- DIK_keymap[DIK_SPACE] = SDLK_SPACE;
- DIK_keymap[DIK_CAPITAL] = SDLK_CAPSLOCK;
- DIK_keymap[DIK_F1] = SDLK_F1;
- DIK_keymap[DIK_F2] = SDLK_F2;
- DIK_keymap[DIK_F3] = SDLK_F3;
- DIK_keymap[DIK_F4] = SDLK_F4;
- DIK_keymap[DIK_F5] = SDLK_F5;
- DIK_keymap[DIK_F6] = SDLK_F6;
- DIK_keymap[DIK_F7] = SDLK_F7;
- DIK_keymap[DIK_F8] = SDLK_F8;
- DIK_keymap[DIK_F9] = SDLK_F9;
- DIK_keymap[DIK_F10] = SDLK_F10;
- DIK_keymap[DIK_NUMLOCK] = SDLK_NUMLOCK;
- DIK_keymap[DIK_SCROLL] = SDLK_SCROLLOCK;
- DIK_keymap[DIK_NUMPAD7] = SDLK_KP7;
- DIK_keymap[DIK_NUMPAD8] = SDLK_KP8;
- DIK_keymap[DIK_NUMPAD9] = SDLK_KP9;
- DIK_keymap[DIK_SUBTRACT] = SDLK_KP_MINUS;
- DIK_keymap[DIK_NUMPAD4] = SDLK_KP4;
- DIK_keymap[DIK_NUMPAD5] = SDLK_KP5;
- DIK_keymap[DIK_NUMPAD6] = SDLK_KP6;
- DIK_keymap[DIK_ADD] = SDLK_KP_PLUS;
- DIK_keymap[DIK_NUMPAD1] = SDLK_KP1;
- DIK_keymap[DIK_NUMPAD2] = SDLK_KP2;
- DIK_keymap[DIK_NUMPAD3] = SDLK_KP3;
- DIK_keymap[DIK_NUMPAD0] = SDLK_KP0;
- DIK_keymap[DIK_DECIMAL] = SDLK_KP_PERIOD;
- DIK_keymap[DIK_F11] = SDLK_F11;
- DIK_keymap[DIK_F12] = SDLK_F12;
-
- DIK_keymap[DIK_F13] = SDLK_F13;
- DIK_keymap[DIK_F14] = SDLK_F14;
- DIK_keymap[DIK_F15] = SDLK_F15;
-
- DIK_keymap[DIK_NUMPADEQUALS] = SDLK_KP_EQUALS;
- DIK_keymap[DIK_NUMPADENTER] = SDLK_KP_ENTER;
- DIK_keymap[DIK_RCONTROL] = SDLK_RCTRL;
- DIK_keymap[DIK_DIVIDE] = SDLK_KP_DIVIDE;
- DIK_keymap[DIK_SYSRQ] = SDLK_PRINT;
- DIK_keymap[DIK_RMENU] = SDLK_RALT;
- DIK_keymap[DIK_PAUSE] = SDLK_PAUSE;
- DIK_keymap[DIK_HOME] = SDLK_HOME;
- DIK_keymap[DIK_UP] = SDLK_UP;
- DIK_keymap[DIK_PRIOR] = SDLK_PAGEUP;
- DIK_keymap[DIK_LEFT] = SDLK_LEFT;
- DIK_keymap[DIK_RIGHT] = SDLK_RIGHT;
- DIK_keymap[DIK_END] = SDLK_END;
- DIK_keymap[DIK_DOWN] = SDLK_DOWN;
- DIK_keymap[DIK_NEXT] = SDLK_PAGEDOWN;
- DIK_keymap[DIK_INSERT] = SDLK_INSERT;
- DIK_keymap[DIK_DELETE] = SDLK_DELETE;
- DIK_keymap[DIK_LWIN] = SDLK_LMETA;
- DIK_keymap[DIK_RWIN] = SDLK_RMETA;
- DIK_keymap[DIK_APPS] = SDLK_MENU;
-}
-
-static SDL_keysym *TranslateKey(UINT scancode, SDL_keysym *keysym, int pressed)
-{
- /* Set the keysym information */
- keysym->scancode = (unsigned char)scancode;
- keysym->sym = DIK_keymap[scancode];
- keysym->mod = KMOD_NONE;
- keysym->unicode = 0;
- if ( pressed && SDL_TranslateUNICODE ) {
- UINT vkey;
-#ifndef NO_GETKEYBOARDSTATE
- BYTE keystate[256];
- Uint16 wchars[2];
-#endif
-
- vkey = MapVirtualKey(scancode, 1);
-#ifdef NO_GETKEYBOARDSTATE
- /* Uh oh, better hope the vkey is close enough.. */
- keysym->unicode = vkey;
-#else
- GetKeyboardState(keystate);
- if (SDL_ToUnicode(vkey, scancode, keystate, wchars, sizeof(wchars)/sizeof(wchars[0]), 0) == 1)
- {
- keysym->unicode = wchars[0];
- }
-#endif /* NO_GETKEYBOARDSTATE */
- }
- return(keysym);
-}
-
-int DX5_CreateWindow(_THIS)
-{
- char *windowid = SDL_getenv("SDL_WINDOWID");
- int i;
-
- /* Clear out DirectInput variables in case we fail */
- for ( i=0; i<MAX_INPUTS; ++i ) {
- SDL_DIdev[i] = NULL;
- SDL_DIevt[i] = NULL;
- SDL_DIfun[i] = NULL;
- }
-
- SDL_RegisterApp(NULL, 0, 0);
-
- SDL_windowid = (windowid != NULL);
- if ( SDL_windowid ) {
- SDL_Window = (HWND)SDL_strtoull(windowid, NULL, 0);
- if ( SDL_Window == NULL ) {
- SDL_SetError("Couldn't get user specified window");
- return(-1);
- }
-
- /* DJM: we want all event's for the user specified
- window to be handled by SDL.
- */
- userWindowProc = (WNDPROCTYPE)GetWindowLongPtr(SDL_Window, GWLP_WNDPROC);
- SetWindowLongPtr(SDL_Window, GWLP_WNDPROC, (LONG_PTR)WinMessage);
- } else {
- SDL_Window = CreateWindow(SDL_Appname, SDL_Appname,
- (WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX),
- CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, NULL, NULL, SDL_Instance, NULL);
- if ( SDL_Window == NULL ) {
- SDL_SetError("Couldn't create window");
- return(-1);
- }
- ShowWindow(SDL_Window, SW_HIDE);
- }
-
- /* Initialize DirectInput */
- if ( DX5_DInputInit(this) < 0 ) {
- return(-1);
- }
-
- /* JC 14 Mar 2006
- Flush the message loop or this can cause big problems later
- Especially if the user decides to use dialog boxes or assert()!
- */
- WIN_FlushMessageQueue();
-
- /* Ready to roll */
- return(0);
-}
-
-void DX5_DestroyWindow(_THIS)
-{
- /* Close down DirectInput */
- DX5_DInputQuit(this);
-
- /* Destroy our window */
- if ( SDL_windowid ) {
- SetWindowLongPtr(SDL_Window, GWLP_WNDPROC, (LONG_PTR)userWindowProc);
- } else {
- DestroyWindow(SDL_Window);
- }
- SDL_UnregisterApp();
-
- /* JC 14 Mar 2006
- Flush the message loop or this can cause big problems later
- Especially if the user decides to use dialog boxes or assert()!
- */
- WIN_FlushMessageQueue();
-}
diff --git a/distrib/sdl-1.2.12/src/video/windx5/SDL_dx5events_c.h b/distrib/sdl-1.2.12/src/video/windx5/SDL_dx5events_c.h
deleted file mode 100644
index 6575af1..0000000
--- a/distrib/sdl-1.2.12/src/video/windx5/SDL_dx5events_c.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "../wincommon/SDL_lowvideo.h"
-
-/* Variables and functions exported by SDL_dx5events.c to other parts
- of the native video subsystem (SDL_dx5video.c)
-*/
-extern LONG
- DX5_HandleMessage(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-extern int DX5_CreateWindow(_THIS);
-extern void DX5_DestroyWindow(_THIS);
-
-extern void DX5_PumpEvents(_THIS);
-extern void DX5_InitOSKeymap(_THIS);
-extern void DX5_DInputReset(_THIS, int fullscreen);
-
diff --git a/distrib/sdl-1.2.12/src/video/windx5/SDL_dx5video.c b/distrib/sdl-1.2.12/src/video/windx5/SDL_dx5video.c
deleted file mode 100644
index 50b74f6..0000000
--- a/distrib/sdl-1.2.12/src/video/windx5/SDL_dx5video.c
+++ /dev/null
@@ -1,2518 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "directx.h"
-
-/* Not yet in the mingw32 cross-compile headers */
-#ifndef CDS_FULLSCREEN
-#define CDS_FULLSCREEN 4
-#endif
-
-#include "SDL_timer.h"
-#include "SDL_events.h"
-#include "SDL_syswm.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_blit.h"
-#include "../SDL_pixels_c.h"
-#include "SDL_dx5video.h"
-#include "../wincommon/SDL_syswm_c.h"
-#include "../wincommon/SDL_sysmouse_c.h"
-#include "SDL_dx5events_c.h"
-#include "SDL_dx5yuv_c.h"
-#include "../wincommon/SDL_wingl_c.h"
-
-#ifdef _WIN32_WCE
-#define NO_CHANGEDISPLAYSETTINGS
-#endif
-#ifndef WS_MAXIMIZE
-#define WS_MAXIMIZE 0
-#endif
-#ifndef SWP_NOCOPYBITS
-#define SWP_NOCOPYBITS 0
-#endif
-#ifndef PC_NOCOLLAPSE
-#define PC_NOCOLLAPSE 0
-#endif
-
-
-/* DirectX function pointers for video and events */
-HRESULT (WINAPI *DDrawCreate)( GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter );
-HRESULT (WINAPI *DInputCreate)(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUT *ppDI, LPUNKNOWN punkOuter);
-
-/* This is the rect EnumModes2 uses */
-struct DX5EnumRect {
- SDL_Rect r;
- int refreshRate;
- struct DX5EnumRect* next;
-};
-static struct DX5EnumRect *enumlists[NUM_MODELISTS];
-
-/*
- * Experimentally determined values for c_cfDI* constants used in DirectX 5.0
- */
-
-/* Keyboard */
-
-static DIOBJECTDATAFORMAT KBD_fmt[] = {
- { &GUID_Key, 0, 0x8000000C, 0x00000000 },
- { &GUID_Key, 1, 0x8000010C, 0x00000000 },
- { &GUID_Key, 2, 0x8000020C, 0x00000000 },
- { &GUID_Key, 3, 0x8000030C, 0x00000000 },
- { &GUID_Key, 4, 0x8000040C, 0x00000000 },
- { &GUID_Key, 5, 0x8000050C, 0x00000000 },
- { &GUID_Key, 6, 0x8000060C, 0x00000000 },
- { &GUID_Key, 7, 0x8000070C, 0x00000000 },
- { &GUID_Key, 8, 0x8000080C, 0x00000000 },
- { &GUID_Key, 9, 0x8000090C, 0x00000000 },
- { &GUID_Key, 10, 0x80000A0C, 0x00000000 },
- { &GUID_Key, 11, 0x80000B0C, 0x00000000 },
- { &GUID_Key, 12, 0x80000C0C, 0x00000000 },
- { &GUID_Key, 13, 0x80000D0C, 0x00000000 },
- { &GUID_Key, 14, 0x80000E0C, 0x00000000 },
- { &GUID_Key, 15, 0x80000F0C, 0x00000000 },
- { &GUID_Key, 16, 0x8000100C, 0x00000000 },
- { &GUID_Key, 17, 0x8000110C, 0x00000000 },
- { &GUID_Key, 18, 0x8000120C, 0x00000000 },
- { &GUID_Key, 19, 0x8000130C, 0x00000000 },
- { &GUID_Key, 20, 0x8000140C, 0x00000000 },
- { &GUID_Key, 21, 0x8000150C, 0x00000000 },
- { &GUID_Key, 22, 0x8000160C, 0x00000000 },
- { &GUID_Key, 23, 0x8000170C, 0x00000000 },
- { &GUID_Key, 24, 0x8000180C, 0x00000000 },
- { &GUID_Key, 25, 0x8000190C, 0x00000000 },
- { &GUID_Key, 26, 0x80001A0C, 0x00000000 },
- { &GUID_Key, 27, 0x80001B0C, 0x00000000 },
- { &GUID_Key, 28, 0x80001C0C, 0x00000000 },
- { &GUID_Key, 29, 0x80001D0C, 0x00000000 },
- { &GUID_Key, 30, 0x80001E0C, 0x00000000 },
- { &GUID_Key, 31, 0x80001F0C, 0x00000000 },
- { &GUID_Key, 32, 0x8000200C, 0x00000000 },
- { &GUID_Key, 33, 0x8000210C, 0x00000000 },
- { &GUID_Key, 34, 0x8000220C, 0x00000000 },
- { &GUID_Key, 35, 0x8000230C, 0x00000000 },
- { &GUID_Key, 36, 0x8000240C, 0x00000000 },
- { &GUID_Key, 37, 0x8000250C, 0x00000000 },
- { &GUID_Key, 38, 0x8000260C, 0x00000000 },
- { &GUID_Key, 39, 0x8000270C, 0x00000000 },
- { &GUID_Key, 40, 0x8000280C, 0x00000000 },
- { &GUID_Key, 41, 0x8000290C, 0x00000000 },
- { &GUID_Key, 42, 0x80002A0C, 0x00000000 },
- { &GUID_Key, 43, 0x80002B0C, 0x00000000 },
- { &GUID_Key, 44, 0x80002C0C, 0x00000000 },
- { &GUID_Key, 45, 0x80002D0C, 0x00000000 },
- { &GUID_Key, 46, 0x80002E0C, 0x00000000 },
- { &GUID_Key, 47, 0x80002F0C, 0x00000000 },
- { &GUID_Key, 48, 0x8000300C, 0x00000000 },
- { &GUID_Key, 49, 0x8000310C, 0x00000000 },
- { &GUID_Key, 50, 0x8000320C, 0x00000000 },
- { &GUID_Key, 51, 0x8000330C, 0x00000000 },
- { &GUID_Key, 52, 0x8000340C, 0x00000000 },
- { &GUID_Key, 53, 0x8000350C, 0x00000000 },
- { &GUID_Key, 54, 0x8000360C, 0x00000000 },
- { &GUID_Key, 55, 0x8000370C, 0x00000000 },
- { &GUID_Key, 56, 0x8000380C, 0x00000000 },
- { &GUID_Key, 57, 0x8000390C, 0x00000000 },
- { &GUID_Key, 58, 0x80003A0C, 0x00000000 },
- { &GUID_Key, 59, 0x80003B0C, 0x00000000 },
- { &GUID_Key, 60, 0x80003C0C, 0x00000000 },
- { &GUID_Key, 61, 0x80003D0C, 0x00000000 },
- { &GUID_Key, 62, 0x80003E0C, 0x00000000 },
- { &GUID_Key, 63, 0x80003F0C, 0x00000000 },
- { &GUID_Key, 64, 0x8000400C, 0x00000000 },
- { &GUID_Key, 65, 0x8000410C, 0x00000000 },
- { &GUID_Key, 66, 0x8000420C, 0x00000000 },
- { &GUID_Key, 67, 0x8000430C, 0x00000000 },
- { &GUID_Key, 68, 0x8000440C, 0x00000000 },
- { &GUID_Key, 69, 0x8000450C, 0x00000000 },
- { &GUID_Key, 70, 0x8000460C, 0x00000000 },
- { &GUID_Key, 71, 0x8000470C, 0x00000000 },
- { &GUID_Key, 72, 0x8000480C, 0x00000000 },
- { &GUID_Key, 73, 0x8000490C, 0x00000000 },
- { &GUID_Key, 74, 0x80004A0C, 0x00000000 },
- { &GUID_Key, 75, 0x80004B0C, 0x00000000 },
- { &GUID_Key, 76, 0x80004C0C, 0x00000000 },
- { &GUID_Key, 77, 0x80004D0C, 0x00000000 },
- { &GUID_Key, 78, 0x80004E0C, 0x00000000 },
- { &GUID_Key, 79, 0x80004F0C, 0x00000000 },
- { &GUID_Key, 80, 0x8000500C, 0x00000000 },
- { &GUID_Key, 81, 0x8000510C, 0x00000000 },
- { &GUID_Key, 82, 0x8000520C, 0x00000000 },
- { &GUID_Key, 83, 0x8000530C, 0x00000000 },
- { &GUID_Key, 84, 0x8000540C, 0x00000000 },
- { &GUID_Key, 85, 0x8000550C, 0x00000000 },
- { &GUID_Key, 86, 0x8000560C, 0x00000000 },
- { &GUID_Key, 87, 0x8000570C, 0x00000000 },
- { &GUID_Key, 88, 0x8000580C, 0x00000000 },
- { &GUID_Key, 89, 0x8000590C, 0x00000000 },
- { &GUID_Key, 90, 0x80005A0C, 0x00000000 },
- { &GUID_Key, 91, 0x80005B0C, 0x00000000 },
- { &GUID_Key, 92, 0x80005C0C, 0x00000000 },
- { &GUID_Key, 93, 0x80005D0C, 0x00000000 },
- { &GUID_Key, 94, 0x80005E0C, 0x00000000 },
- { &GUID_Key, 95, 0x80005F0C, 0x00000000 },
- { &GUID_Key, 96, 0x8000600C, 0x00000000 },
- { &GUID_Key, 97, 0x8000610C, 0x00000000 },
- { &GUID_Key, 98, 0x8000620C, 0x00000000 },
- { &GUID_Key, 99, 0x8000630C, 0x00000000 },
- { &GUID_Key, 100, 0x8000640C, 0x00000000 },
- { &GUID_Key, 101, 0x8000650C, 0x00000000 },
- { &GUID_Key, 102, 0x8000660C, 0x00000000 },
- { &GUID_Key, 103, 0x8000670C, 0x00000000 },
- { &GUID_Key, 104, 0x8000680C, 0x00000000 },
- { &GUID_Key, 105, 0x8000690C, 0x00000000 },
- { &GUID_Key, 106, 0x80006A0C, 0x00000000 },
- { &GUID_Key, 107, 0x80006B0C, 0x00000000 },
- { &GUID_Key, 108, 0x80006C0C, 0x00000000 },
- { &GUID_Key, 109, 0x80006D0C, 0x00000000 },
- { &GUID_Key, 110, 0x80006E0C, 0x00000000 },
- { &GUID_Key, 111, 0x80006F0C, 0x00000000 },
- { &GUID_Key, 112, 0x8000700C, 0x00000000 },
- { &GUID_Key, 113, 0x8000710C, 0x00000000 },
- { &GUID_Key, 114, 0x8000720C, 0x00000000 },
- { &GUID_Key, 115, 0x8000730C, 0x00000000 },
- { &GUID_Key, 116, 0x8000740C, 0x00000000 },
- { &GUID_Key, 117, 0x8000750C, 0x00000000 },
- { &GUID_Key, 118, 0x8000760C, 0x00000000 },
- { &GUID_Key, 119, 0x8000770C, 0x00000000 },
- { &GUID_Key, 120, 0x8000780C, 0x00000000 },
- { &GUID_Key, 121, 0x8000790C, 0x00000000 },
- { &GUID_Key, 122, 0x80007A0C, 0x00000000 },
- { &GUID_Key, 123, 0x80007B0C, 0x00000000 },
- { &GUID_Key, 124, 0x80007C0C, 0x00000000 },
- { &GUID_Key, 125, 0x80007D0C, 0x00000000 },
- { &GUID_Key, 126, 0x80007E0C, 0x00000000 },
- { &GUID_Key, 127, 0x80007F0C, 0x00000000 },
- { &GUID_Key, 128, 0x8000800C, 0x00000000 },
- { &GUID_Key, 129, 0x8000810C, 0x00000000 },
- { &GUID_Key, 130, 0x8000820C, 0x00000000 },
- { &GUID_Key, 131, 0x8000830C, 0x00000000 },
- { &GUID_Key, 132, 0x8000840C, 0x00000000 },
- { &GUID_Key, 133, 0x8000850C, 0x00000000 },
- { &GUID_Key, 134, 0x8000860C, 0x00000000 },
- { &GUID_Key, 135, 0x8000870C, 0x00000000 },
- { &GUID_Key, 136, 0x8000880C, 0x00000000 },
- { &GUID_Key, 137, 0x8000890C, 0x00000000 },
- { &GUID_Key, 138, 0x80008A0C, 0x00000000 },
- { &GUID_Key, 139, 0x80008B0C, 0x00000000 },
- { &GUID_Key, 140, 0x80008C0C, 0x00000000 },
- { &GUID_Key, 141, 0x80008D0C, 0x00000000 },
- { &GUID_Key, 142, 0x80008E0C, 0x00000000 },
- { &GUID_Key, 143, 0x80008F0C, 0x00000000 },
- { &GUID_Key, 144, 0x8000900C, 0x00000000 },
- { &GUID_Key, 145, 0x8000910C, 0x00000000 },
- { &GUID_Key, 146, 0x8000920C, 0x00000000 },
- { &GUID_Key, 147, 0x8000930C, 0x00000000 },
- { &GUID_Key, 148, 0x8000940C, 0x00000000 },
- { &GUID_Key, 149, 0x8000950C, 0x00000000 },
- { &GUID_Key, 150, 0x8000960C, 0x00000000 },
- { &GUID_Key, 151, 0x8000970C, 0x00000000 },
- { &GUID_Key, 152, 0x8000980C, 0x00000000 },
- { &GUID_Key, 153, 0x8000990C, 0x00000000 },
- { &GUID_Key, 154, 0x80009A0C, 0x00000000 },
- { &GUID_Key, 155, 0x80009B0C, 0x00000000 },
- { &GUID_Key, 156, 0x80009C0C, 0x00000000 },
- { &GUID_Key, 157, 0x80009D0C, 0x00000000 },
- { &GUID_Key, 158, 0x80009E0C, 0x00000000 },
- { &GUID_Key, 159, 0x80009F0C, 0x00000000 },
- { &GUID_Key, 160, 0x8000A00C, 0x00000000 },
- { &GUID_Key, 161, 0x8000A10C, 0x00000000 },
- { &GUID_Key, 162, 0x8000A20C, 0x00000000 },
- { &GUID_Key, 163, 0x8000A30C, 0x00000000 },
- { &GUID_Key, 164, 0x8000A40C, 0x00000000 },
- { &GUID_Key, 165, 0x8000A50C, 0x00000000 },
- { &GUID_Key, 166, 0x8000A60C, 0x00000000 },
- { &GUID_Key, 167, 0x8000A70C, 0x00000000 },
- { &GUID_Key, 168, 0x8000A80C, 0x00000000 },
- { &GUID_Key, 169, 0x8000A90C, 0x00000000 },
- { &GUID_Key, 170, 0x8000AA0C, 0x00000000 },
- { &GUID_Key, 171, 0x8000AB0C, 0x00000000 },
- { &GUID_Key, 172, 0x8000AC0C, 0x00000000 },
- { &GUID_Key, 173, 0x8000AD0C, 0x00000000 },
- { &GUID_Key, 174, 0x8000AE0C, 0x00000000 },
- { &GUID_Key, 175, 0x8000AF0C, 0x00000000 },
- { &GUID_Key, 176, 0x8000B00C, 0x00000000 },
- { &GUID_Key, 177, 0x8000B10C, 0x00000000 },
- { &GUID_Key, 178, 0x8000B20C, 0x00000000 },
- { &GUID_Key, 179, 0x8000B30C, 0x00000000 },
- { &GUID_Key, 180, 0x8000B40C, 0x00000000 },
- { &GUID_Key, 181, 0x8000B50C, 0x00000000 },
- { &GUID_Key, 182, 0x8000B60C, 0x00000000 },
- { &GUID_Key, 183, 0x8000B70C, 0x00000000 },
- { &GUID_Key, 184, 0x8000B80C, 0x00000000 },
- { &GUID_Key, 185, 0x8000B90C, 0x00000000 },
- { &GUID_Key, 186, 0x8000BA0C, 0x00000000 },
- { &GUID_Key, 187, 0x8000BB0C, 0x00000000 },
- { &GUID_Key, 188, 0x8000BC0C, 0x00000000 },
- { &GUID_Key, 189, 0x8000BD0C, 0x00000000 },
- { &GUID_Key, 190, 0x8000BE0C, 0x00000000 },
- { &GUID_Key, 191, 0x8000BF0C, 0x00000000 },
- { &GUID_Key, 192, 0x8000C00C, 0x00000000 },
- { &GUID_Key, 193, 0x8000C10C, 0x00000000 },
- { &GUID_Key, 194, 0x8000C20C, 0x00000000 },
- { &GUID_Key, 195, 0x8000C30C, 0x00000000 },
- { &GUID_Key, 196, 0x8000C40C, 0x00000000 },
- { &GUID_Key, 197, 0x8000C50C, 0x00000000 },
- { &GUID_Key, 198, 0x8000C60C, 0x00000000 },
- { &GUID_Key, 199, 0x8000C70C, 0x00000000 },
- { &GUID_Key, 200, 0x8000C80C, 0x00000000 },
- { &GUID_Key, 201, 0x8000C90C, 0x00000000 },
- { &GUID_Key, 202, 0x8000CA0C, 0x00000000 },
- { &GUID_Key, 203, 0x8000CB0C, 0x00000000 },
- { &GUID_Key, 204, 0x8000CC0C, 0x00000000 },
- { &GUID_Key, 205, 0x8000CD0C, 0x00000000 },
- { &GUID_Key, 206, 0x8000CE0C, 0x00000000 },
- { &GUID_Key, 207, 0x8000CF0C, 0x00000000 },
- { &GUID_Key, 208, 0x8000D00C, 0x00000000 },
- { &GUID_Key, 209, 0x8000D10C, 0x00000000 },
- { &GUID_Key, 210, 0x8000D20C, 0x00000000 },
- { &GUID_Key, 211, 0x8000D30C, 0x00000000 },
- { &GUID_Key, 212, 0x8000D40C, 0x00000000 },
- { &GUID_Key, 213, 0x8000D50C, 0x00000000 },
- { &GUID_Key, 214, 0x8000D60C, 0x00000000 },
- { &GUID_Key, 215, 0x8000D70C, 0x00000000 },
- { &GUID_Key, 216, 0x8000D80C, 0x00000000 },
- { &GUID_Key, 217, 0x8000D90C, 0x00000000 },
- { &GUID_Key, 218, 0x8000DA0C, 0x00000000 },
- { &GUID_Key, 219, 0x8000DB0C, 0x00000000 },
- { &GUID_Key, 220, 0x8000DC0C, 0x00000000 },
- { &GUID_Key, 221, 0x8000DD0C, 0x00000000 },
- { &GUID_Key, 222, 0x8000DE0C, 0x00000000 },
- { &GUID_Key, 223, 0x8000DF0C, 0x00000000 },
- { &GUID_Key, 224, 0x8000E00C, 0x00000000 },
- { &GUID_Key, 225, 0x8000E10C, 0x00000000 },
- { &GUID_Key, 226, 0x8000E20C, 0x00000000 },
- { &GUID_Key, 227, 0x8000E30C, 0x00000000 },
- { &GUID_Key, 228, 0x8000E40C, 0x00000000 },
- { &GUID_Key, 229, 0x8000E50C, 0x00000000 },
- { &GUID_Key, 230, 0x8000E60C, 0x00000000 },
- { &GUID_Key, 231, 0x8000E70C, 0x00000000 },
- { &GUID_Key, 232, 0x8000E80C, 0x00000000 },
- { &GUID_Key, 233, 0x8000E90C, 0x00000000 },
- { &GUID_Key, 234, 0x8000EA0C, 0x00000000 },
- { &GUID_Key, 235, 0x8000EB0C, 0x00000000 },
- { &GUID_Key, 236, 0x8000EC0C, 0x00000000 },
- { &GUID_Key, 237, 0x8000ED0C, 0x00000000 },
- { &GUID_Key, 238, 0x8000EE0C, 0x00000000 },
- { &GUID_Key, 239, 0x8000EF0C, 0x00000000 },
- { &GUID_Key, 240, 0x8000F00C, 0x00000000 },
- { &GUID_Key, 241, 0x8000F10C, 0x00000000 },
- { &GUID_Key, 242, 0x8000F20C, 0x00000000 },
- { &GUID_Key, 243, 0x8000F30C, 0x00000000 },
- { &GUID_Key, 244, 0x8000F40C, 0x00000000 },
- { &GUID_Key, 245, 0x8000F50C, 0x00000000 },
- { &GUID_Key, 246, 0x8000F60C, 0x00000000 },
- { &GUID_Key, 247, 0x8000F70C, 0x00000000 },
- { &GUID_Key, 248, 0x8000F80C, 0x00000000 },
- { &GUID_Key, 249, 0x8000F90C, 0x00000000 },
- { &GUID_Key, 250, 0x8000FA0C, 0x00000000 },
- { &GUID_Key, 251, 0x8000FB0C, 0x00000000 },
- { &GUID_Key, 252, 0x8000FC0C, 0x00000000 },
- { &GUID_Key, 253, 0x8000FD0C, 0x00000000 },
- { &GUID_Key, 254, 0x8000FE0C, 0x00000000 },
- { &GUID_Key, 255, 0x8000FF0C, 0x00000000 },
-};
-
-const DIDATAFORMAT c_dfDIKeyboard = { 24, 16, 0x00000002, 256, 256, KBD_fmt };
-
-
-/* Mouse */
-
-static DIOBJECTDATAFORMAT PTR_fmt[] = {
- { &GUID_XAxis, 0, 0x00FFFF03, 0x00000000 },
- { &GUID_YAxis, 4, 0x00FFFF03, 0x00000000 },
- { &GUID_ZAxis, 8, 0x80FFFF03, 0x00000000 },
- { NULL, 12, 0x00FFFF0C, 0x00000000 },
- { NULL, 13, 0x00FFFF0C, 0x00000000 },
- { NULL, 14, 0x80FFFF0C, 0x00000000 },
- { NULL, 15, 0x80FFFF0C, 0x00000000 },
-};
-
-const DIDATAFORMAT c_dfDIMouse = { 24, 16, 0x00000002, 16, 7, PTR_fmt };
-
-
-/* Joystick */
-
-static DIOBJECTDATAFORMAT JOY_fmt[] = {
- { &GUID_XAxis, 0, 0x80FFFF03, 0x00000100 },
- { &GUID_YAxis, 4, 0x80FFFF03, 0x00000100 },
- { &GUID_ZAxis, 8, 0x80FFFF03, 0x00000100 },
- { &GUID_RxAxis, 12, 0x80FFFF03, 0x00000100 },
- { &GUID_RyAxis, 16, 0x80FFFF03, 0x00000100 },
- { &GUID_RzAxis, 20, 0x80FFFF03, 0x00000100 },
- { &GUID_Slider, 24, 0x80FFFF03, 0x00000100 },
- { &GUID_Slider, 28, 0x80FFFF03, 0x00000100 },
- { &GUID_POV, 32, 0x80FFFF10, 0x00000000 },
- { &GUID_POV, 36, 0x80FFFF10, 0x00000000 },
- { &GUID_POV, 40, 0x80FFFF10, 0x00000000 },
- { &GUID_POV, 44, 0x80FFFF10, 0x00000000 },
- { NULL, 48, 0x80FFFF0C, 0x00000000 },
- { NULL, 49, 0x80FFFF0C, 0x00000000 },
- { NULL, 50, 0x80FFFF0C, 0x00000000 },
- { NULL, 51, 0x80FFFF0C, 0x00000000 },
- { NULL, 52, 0x80FFFF0C, 0x00000000 },
- { NULL, 53, 0x80FFFF0C, 0x00000000 },
- { NULL, 54, 0x80FFFF0C, 0x00000000 },
- { NULL, 55, 0x80FFFF0C, 0x00000000 },
- { NULL, 56, 0x80FFFF0C, 0x00000000 },
- { NULL, 57, 0x80FFFF0C, 0x00000000 },
- { NULL, 58, 0x80FFFF0C, 0x00000000 },
- { NULL, 59, 0x80FFFF0C, 0x00000000 },
- { NULL, 60, 0x80FFFF0C, 0x00000000 },
- { NULL, 61, 0x80FFFF0C, 0x00000000 },
- { NULL, 62, 0x80FFFF0C, 0x00000000 },
- { NULL, 63, 0x80FFFF0C, 0x00000000 },
- { NULL, 64, 0x80FFFF0C, 0x00000000 },
- { NULL, 65, 0x80FFFF0C, 0x00000000 },
- { NULL, 66, 0x80FFFF0C, 0x00000000 },
- { NULL, 67, 0x80FFFF0C, 0x00000000 },
- { NULL, 68, 0x80FFFF0C, 0x00000000 },
- { NULL, 69, 0x80FFFF0C, 0x00000000 },
- { NULL, 70, 0x80FFFF0C, 0x00000000 },
- { NULL, 71, 0x80FFFF0C, 0x00000000 },
- { NULL, 72, 0x80FFFF0C, 0x00000000 },
- { NULL, 73, 0x80FFFF0C, 0x00000000 },
- { NULL, 74, 0x80FFFF0C, 0x00000000 },
- { NULL, 75, 0x80FFFF0C, 0x00000000 },
- { NULL, 76, 0x80FFFF0C, 0x00000000 },
- { NULL, 77, 0x80FFFF0C, 0x00000000 },
- { NULL, 78, 0x80FFFF0C, 0x00000000 },
- { NULL, 79, 0x80FFFF0C, 0x00000000 },
-};
-
-const DIDATAFORMAT c_dfDIJoystick = { 24, 16, 0x00000001, 80, 44, JOY_fmt };
-
-
-/* Initialization/Query functions */
-static int DX5_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **DX5_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int DX5_SetColors(_THIS, int firstcolor, int ncolors,
- SDL_Color *colors);
-static int DX5_SetGammaRamp(_THIS, Uint16 *ramp);
-static int DX5_GetGammaRamp(_THIS, Uint16 *ramp);
-static void DX5_VideoQuit(_THIS);
-
-/* Hardware surface functions */
-static int DX5_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int DX5_CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst);
-static int DX5_FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);
-static int DX5_SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key);
-static int DX5_SetHWAlpha(_THIS, SDL_Surface *surface, Uint8 alpha);
-static int DX5_LockHWSurface(_THIS, SDL_Surface *surface);
-static void DX5_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static int DX5_FlipHWSurface(_THIS, SDL_Surface *surface);
-static void DX5_FreeHWSurface(_THIS, SDL_Surface *surface);
-
-static int DX5_AllocDDSurface(_THIS, SDL_Surface *surface,
- LPDIRECTDRAWSURFACE3 requested, Uint32 flag);
-
-/* Windows message handling functions */
-static void DX5_Activate(_THIS, BOOL active, BOOL minimized);
-static void DX5_RealizePalette(_THIS);
-static void DX5_PaletteChanged(_THIS, HWND window);
-static void DX5_WinPAINT(_THIS, HDC hdc);
-
-/* WinDIB driver functions for manipulating gamma ramps */
-extern int DIB_SetGammaRamp(_THIS, Uint16 *ramp);
-extern int DIB_GetGammaRamp(_THIS, Uint16 *ramp);
-extern void DIB_QuitGamma(_THIS);
-
-/* DX5 driver bootstrap functions */
-
-static int DX5_Available(void)
-{
- HINSTANCE DInputDLL;
- HINSTANCE DDrawDLL;
- int dinput_ok;
- int ddraw_ok;
-
- /* Version check DINPUT.DLL and DDRAW.DLL (Is DirectX okay?) */
- dinput_ok = 0;
- DInputDLL = LoadLibrary(TEXT("DINPUT.DLL"));
- if ( DInputDLL != NULL ) {
- dinput_ok = 1;
- FreeLibrary(DInputDLL);
- }
- ddraw_ok = 0;
- DDrawDLL = LoadLibrary(TEXT("DDRAW.DLL"));
- if ( DDrawDLL != NULL ) {
- HRESULT (WINAPI *DDrawCreate)(GUID *,LPDIRECTDRAW *,IUnknown *);
- LPDIRECTDRAW DDraw;
-
- /* Try to create a valid DirectDraw object */
- DDrawCreate = (void *)GetProcAddress(DDrawDLL, TEXT("DirectDrawCreate"));
- if ( (DDrawCreate != NULL)
- && !FAILED(DDrawCreate(NULL, &DDraw, NULL)) ) {
- if ( !FAILED(IDirectDraw_SetCooperativeLevel(DDraw,
- NULL, DDSCL_NORMAL)) ) {
- DDSURFACEDESC desc;
- LPDIRECTDRAWSURFACE DDrawSurf;
- LPDIRECTDRAWSURFACE3 DDrawSurf3;
-
- /* Try to create a DirectDrawSurface3 object */
- SDL_memset(&desc, 0, sizeof(desc));
- desc.dwSize = sizeof(desc);
- desc.dwFlags = DDSD_CAPS;
- desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE|DDSCAPS_VIDEOMEMORY;
- if ( !FAILED(IDirectDraw_CreateSurface(DDraw, &desc,
- &DDrawSurf, NULL)) ) {
- if ( !FAILED(IDirectDrawSurface_QueryInterface(DDrawSurf,
- &IID_IDirectDrawSurface3, (LPVOID *)&DDrawSurf3)) ) {
- /* Yay! */
- ddraw_ok = 1;
-
- /* Clean up.. */
- IDirectDrawSurface3_Release(DDrawSurf3);
- }
- IDirectDrawSurface_Release(DDrawSurf);
- }
- }
- IDirectDraw_Release(DDraw);
- }
- FreeLibrary(DDrawDLL);
- }
- return(dinput_ok && ddraw_ok);
-}
-
-/* Functions for loading the DirectX functions dynamically */
-static HINSTANCE DDrawDLL = NULL;
-static HINSTANCE DInputDLL = NULL;
-
-static void DX5_Unload(void)
-{
- if ( DDrawDLL != NULL ) {
- FreeLibrary(DDrawDLL);
- DDrawCreate = NULL;
- DDrawDLL = NULL;
- }
- if ( DInputDLL != NULL ) {
- FreeLibrary(DInputDLL);
- DInputCreate = NULL;
- DInputDLL = NULL;
- }
-}
-static int DX5_Load(void)
-{
- int status;
-
- DX5_Unload();
- DDrawDLL = LoadLibrary(TEXT("DDRAW.DLL"));
- if ( DDrawDLL != NULL ) {
- DDrawCreate = (void *)GetProcAddress(DDrawDLL,
- TEXT("DirectDrawCreate"));
- }
- DInputDLL = LoadLibrary(TEXT("DINPUT.DLL"));
- if ( DInputDLL != NULL ) {
- DInputCreate = (void *)GetProcAddress(DInputDLL,
- TEXT("DirectInputCreateA"));
- }
- if ( DDrawDLL && DDrawCreate && DInputDLL && DInputCreate ) {
- status = 0;
- } else {
- DX5_Unload();
- status = -1;
- }
- return status;
-}
-
-static void DX5_DeleteDevice(SDL_VideoDevice *this)
-{
- /* Free DirectDraw object */
- if ( ddraw2 != NULL ) {
- IDirectDraw2_Release(ddraw2);
- }
- DX5_Unload();
- if ( this ) {
- if ( this->hidden ) {
- SDL_free(this->hidden);
- }
- if ( this->gl_data ) {
- SDL_free(this->gl_data);
- }
- SDL_free(this);
- }
-}
-
-static SDL_VideoDevice *DX5_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
-
- /* Load DirectX */
- if ( DX5_Load() < 0 ) {
- return(NULL);
- }
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device ) {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *device->hidden));
- device->gl_data = (struct SDL_PrivateGLData *)
- SDL_malloc((sizeof *device->gl_data));
- }
- if ( (device == NULL) || (device->hidden == NULL) ||
- (device->gl_data == NULL) ) {
- SDL_OutOfMemory();
- DX5_DeleteDevice(device);
- return(NULL);
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
- SDL_memset(device->gl_data, 0, (sizeof *device->gl_data));
-
- /* Set the function pointers */
- device->VideoInit = DX5_VideoInit;
- device->ListModes = DX5_ListModes;
- device->SetVideoMode = DX5_SetVideoMode;
- device->UpdateMouse = WIN_UpdateMouse;
- device->CreateYUVOverlay = DX5_CreateYUVOverlay;
- device->SetColors = DX5_SetColors;
- device->UpdateRects = NULL;
- device->VideoQuit = DX5_VideoQuit;
- device->AllocHWSurface = DX5_AllocHWSurface;
- device->CheckHWBlit = DX5_CheckHWBlit;
- device->FillHWRect = DX5_FillHWRect;
- device->SetHWColorKey = DX5_SetHWColorKey;
- device->SetHWAlpha = DX5_SetHWAlpha;
- device->LockHWSurface = DX5_LockHWSurface;
- device->UnlockHWSurface = DX5_UnlockHWSurface;
- device->FlipHWSurface = DX5_FlipHWSurface;
- device->FreeHWSurface = DX5_FreeHWSurface;
- device->SetGammaRamp = DX5_SetGammaRamp;
- device->GetGammaRamp = DX5_GetGammaRamp;
-#if SDL_VIDEO_OPENGL
- device->GL_LoadLibrary = WIN_GL_LoadLibrary;
- device->GL_GetProcAddress = WIN_GL_GetProcAddress;
- device->GL_GetAttribute = WIN_GL_GetAttribute;
- device->GL_MakeCurrent = WIN_GL_MakeCurrent;
- device->GL_SwapBuffers = WIN_GL_SwapBuffers;
-#endif
- device->SetCaption = WIN_SetWMCaption;
- device->SetIcon = WIN_SetWMIcon;
- device->IconifyWindow = WIN_IconifyWindow;
- device->GrabInput = WIN_GrabInput;
- device->GetWMInfo = WIN_GetWMInfo;
- device->FreeWMCursor = WIN_FreeWMCursor;
- device->CreateWMCursor = WIN_CreateWMCursor;
- device->ShowWMCursor = WIN_ShowWMCursor;
- device->WarpWMCursor = WIN_WarpWMCursor;
- device->CheckMouseMode = WIN_CheckMouseMode;
- device->InitOSKeymap = DX5_InitOSKeymap;
- device->PumpEvents = DX5_PumpEvents;
-
- /* Set up the windows message handling functions */
- WIN_Activate = DX5_Activate;
- WIN_RealizePalette = DX5_RealizePalette;
- WIN_PaletteChanged = DX5_PaletteChanged;
- WIN_WinPAINT = DX5_WinPAINT;
- HandleMessage = DX5_HandleMessage;
-
- device->free = DX5_DeleteDevice;
-
- /* We're finally ready */
- return device;
-}
-
-VideoBootStrap DIRECTX_bootstrap = {
- "directx", "Win95/98/2000 DirectX",
- DX5_Available, DX5_CreateDevice
-};
-
-static int cmpmodes(const void *va, const void *vb)
-{
- SDL_Rect *a = *(SDL_Rect **)va;
- SDL_Rect *b = *(SDL_Rect **)vb;
- if ( a->w == b->w )
- return b->h - a->h;
- else
- return b->w - a->w;
-}
-
-static HRESULT WINAPI EnumModes2(DDSURFACEDESC *desc, VOID *udata)
-{
- SDL_VideoDevice *this = (SDL_VideoDevice *)udata;
- struct DX5EnumRect *enumrect;
-#if defined(NONAMELESSUNION)
- int bpp = desc->ddpfPixelFormat.u1.dwRGBBitCount;
- int refreshRate = desc->u2.dwRefreshRate;
-#else
- int bpp = desc->ddpfPixelFormat.dwRGBBitCount;
- int refreshRate = desc->dwRefreshRate;
-#endif
- int maxRefreshRate;
-
- if ( desc->dwWidth <= SDL_desktop_mode.dmPelsWidth &&
- desc->dwHeight <= SDL_desktop_mode.dmPelsHeight ) {
- maxRefreshRate = SDL_desktop_mode.dmDisplayFrequency;
- } else {
- maxRefreshRate = 85; /* safe value? */
- }
-
- switch (bpp) {
- case 8:
- case 16:
- case 24:
- case 32:
- bpp /= 8; --bpp;
- if ( enumlists[bpp] &&
- enumlists[bpp]->r.w == (Uint16)desc->dwWidth &&
- enumlists[bpp]->r.h == (Uint16)desc->dwHeight ) {
- if ( refreshRate > enumlists[bpp]->refreshRate &&
- refreshRate <= maxRefreshRate ) {
- enumlists[bpp]->refreshRate = refreshRate;
-#ifdef DDRAW_DEBUG
- fprintf(stderr, "New refresh rate for %d bpp: %dx%d at %d Hz\n", (bpp+1)*8, (int)desc->dwWidth, (int)desc->dwHeight, refreshRate);
-#endif
- }
- break;
- }
- ++SDL_nummodes[bpp];
- enumrect = (struct DX5EnumRect*)SDL_malloc(sizeof(struct DX5EnumRect));
- if ( !enumrect ) {
- SDL_OutOfMemory();
- return(DDENUMRET_CANCEL);
- }
- enumrect->refreshRate = refreshRate;
- enumrect->r.x = 0;
- enumrect->r.y = 0;
- enumrect->r.w = (Uint16)desc->dwWidth;
- enumrect->r.h = (Uint16)desc->dwHeight;
- enumrect->next = enumlists[bpp];
- enumlists[bpp] = enumrect;
-#ifdef DDRAW_DEBUG
- fprintf(stderr, "New mode for %d bpp: %dx%d at %d Hz\n", (bpp+1)*8, (int)desc->dwWidth, (int)desc->dwHeight, refreshRate);
-#endif
- break;
- }
-
- return(DDENUMRET_OK);
-}
-
-void SetDDerror(const char *function, int code)
-{
- static char *error;
- static char errbuf[1024];
-
- errbuf[0] = 0;
- switch (code) {
- case DDERR_GENERIC:
- error = "Undefined error!";
- break;
- case DDERR_EXCEPTION:
- error = "Exception encountered";
- break;
- case DDERR_INVALIDOBJECT:
- error = "Invalid object";
- break;
- case DDERR_INVALIDPARAMS:
- error = "Invalid parameters";
- break;
- case DDERR_NOTFOUND:
- error = "Object not found";
- break;
- case DDERR_INVALIDRECT:
- error = "Invalid rectangle";
- break;
- case DDERR_INVALIDCAPS:
- error = "Invalid caps member";
- break;
- case DDERR_INVALIDPIXELFORMAT:
- error = "Invalid pixel format";
- break;
- case DDERR_OUTOFMEMORY:
- error = "Out of memory";
- break;
- case DDERR_OUTOFVIDEOMEMORY:
- error = "Out of video memory";
- break;
- case DDERR_SURFACEBUSY:
- error = "Surface busy";
- break;
- case DDERR_SURFACELOST:
- error = "Surface was lost";
- break;
- case DDERR_WASSTILLDRAWING:
- error = "DirectDraw is still drawing";
- break;
- case DDERR_INVALIDSURFACETYPE:
- error = "Invalid surface type";
- break;
- case DDERR_NOEXCLUSIVEMODE:
- error = "Not in exclusive access mode";
- break;
- case DDERR_NOPALETTEATTACHED:
- error = "No palette attached";
- break;
- case DDERR_NOPALETTEHW:
- error = "No palette hardware";
- break;
- case DDERR_NOT8BITCOLOR:
- error = "Not 8-bit color";
- break;
- case DDERR_EXCLUSIVEMODEALREADYSET:
- error = "Exclusive mode was already set";
- break;
- case DDERR_HWNDALREADYSET:
- error = "Window handle already set";
- break;
- case DDERR_HWNDSUBCLASSED:
- error = "Window handle is subclassed";
- break;
- case DDERR_NOBLTHW:
- error = "No blit hardware";
- break;
- case DDERR_IMPLICITLYCREATED:
- error = "Surface was implicitly created";
- break;
- case DDERR_INCOMPATIBLEPRIMARY:
- error = "Incompatible primary surface";
- break;
- case DDERR_NOCOOPERATIVELEVELSET:
- error = "No cooperative level set";
- break;
- case DDERR_NODIRECTDRAWHW:
- error = "No DirectDraw hardware";
- break;
- case DDERR_NOEMULATION:
- error = "No emulation available";
- break;
- case DDERR_NOFLIPHW:
- error = "No flip hardware";
- break;
- case DDERR_NOTFLIPPABLE:
- error = "Surface not flippable";
- break;
- case DDERR_PRIMARYSURFACEALREADYEXISTS:
- error = "Primary surface already exists";
- break;
- case DDERR_UNSUPPORTEDMODE:
- error = "Unsupported mode";
- break;
- case DDERR_WRONGMODE:
- error = "Surface created in different mode";
- break;
- case DDERR_UNSUPPORTED:
- error = "Operation not supported";
- break;
- case E_NOINTERFACE:
- error = "Interface not present";
- break;
- default:
- SDL_snprintf(errbuf, SDL_arraysize(errbuf),
- "%s: Unknown DirectDraw error: 0x%x",
- function, code);
- break;
- }
- if ( ! errbuf[0] ) {
- SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: %s", function, error);
- }
- SDL_SetError("%s", errbuf);
- return;
-}
-
-
-static int DX5_UpdateVideoInfo(_THIS)
-{
- /* This needs to be DDCAPS_DX5 for the DirectDraw2 interface */
-#if DIRECTDRAW_VERSION <= 0x300
-#error Your version of DirectX must be greater than or equal to 5.0
-#endif
-#ifndef IDirectDrawGammaControl_SetGammaRamp
- /*if gamma is undefined then we really have directx <= 0x500*/
- DDCAPS DDCaps;
-#else
- DDCAPS_DX5 DDCaps;
-#endif
- HRESULT result;
-
- /* Fill in our hardware acceleration capabilities */
- SDL_memset(&DDCaps, 0, sizeof(DDCaps));
- DDCaps.dwSize = sizeof(DDCaps);
- result = IDirectDraw2_GetCaps(ddraw2, (DDCAPS *)&DDCaps, NULL);
- if ( result != DD_OK ) {
- SetDDerror("DirectDraw2::GetCaps", result);
- return(-1);
- }
- this->info.hw_available = 1;
- if ( (DDCaps.dwCaps & DDCAPS_BLT) == DDCAPS_BLT ) {
- this->info.blit_hw = 1;
- }
- if ( ((DDCaps.dwCaps & DDCAPS_COLORKEY) == DDCAPS_COLORKEY) &&
- ((DDCaps.dwCKeyCaps & DDCKEYCAPS_SRCBLT) == DDCKEYCAPS_SRCBLT) ) {
- this->info.blit_hw_CC = 1;
- }
- if ( (DDCaps.dwCaps & DDCAPS_ALPHA) == DDCAPS_ALPHA ) {
- /* This is only for alpha channel, and DirectX 6
- doesn't support 2D alpha blits yet, so set it 0
- */
- this->info.blit_hw_A = 0;
- }
- if ( (DDCaps.dwCaps & DDCAPS_CANBLTSYSMEM) == DDCAPS_CANBLTSYSMEM ) {
- this->info.blit_sw = 1;
- /* This isn't necessarily true, but the HEL will cover us */
- this->info.blit_sw_CC = this->info.blit_hw_CC;
- this->info.blit_sw_A = this->info.blit_hw_A;
- }
- if ( (DDCaps.dwCaps & DDCAPS_BLTCOLORFILL) == DDCAPS_BLTCOLORFILL ) {
- this->info.blit_fill = 1;
- }
-
- /* Find out how much video memory is available */
- { DDSCAPS ddsCaps;
- DWORD total_mem;
- ddsCaps.dwCaps = DDSCAPS_VIDEOMEMORY;
- result = IDirectDraw2_GetAvailableVidMem(ddraw2,
- &ddsCaps, &total_mem, NULL);
- if ( result != DD_OK ) {
- total_mem = DDCaps.dwVidMemTotal;
- }
- this->info.video_mem = total_mem/1024;
- }
- return(0);
-}
-
-int DX5_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- HRESULT result;
- LPDIRECTDRAW ddraw;
- int i, j;
- HDC hdc;
-
- /* Intialize everything */
- ddraw2 = NULL;
- SDL_primary = NULL;
- SDL_clipper = NULL;
- SDL_palette = NULL;
- for ( i=0; i<NUM_MODELISTS; ++i ) {
- SDL_nummodes[i] = 0;
- SDL_modelist[i] = NULL;
- SDL_modeindex[i] = 0;
- }
- colorchange_expected = 0;
-
- /* Create the window */
- if ( DX5_CreateWindow(this) < 0 ) {
- return(-1);
- }
-
-#if !SDL_AUDIO_DISABLED
- DX5_SoundFocus(SDL_Window);
-#endif
-
- /* Create the DirectDraw object */
- result = DDrawCreate(NULL, &ddraw, NULL);
- if ( result != DD_OK ) {
- SetDDerror("DirectDrawCreate", result);
- return(-1);
- }
- result = IDirectDraw_QueryInterface(ddraw, &IID_IDirectDraw2,
- (LPVOID *)&ddraw2);
- IDirectDraw_Release(ddraw);
- if ( result != DD_OK ) {
- SetDDerror("DirectDraw::QueryInterface", result);
- return(-1);
- }
-
- /* Determine the screen depth */
- hdc = GetDC(SDL_Window);
- vformat->BitsPerPixel = GetDeviceCaps(hdc,PLANES) *
- GetDeviceCaps(hdc,BITSPIXEL);
- ReleaseDC(SDL_Window, hdc);
-
-#ifndef NO_CHANGEDISPLAYSETTINGS
- /* Query for the desktop resolution */
- EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &SDL_desktop_mode);
- this->info.current_w = SDL_desktop_mode.dmPelsWidth;
- this->info.current_h = SDL_desktop_mode.dmPelsHeight;
-#endif
-
- /* Enumerate the available fullscreen modes */
- for ( i=0; i<NUM_MODELISTS; ++i )
- enumlists[i] = NULL;
-
- result = IDirectDraw2_EnumDisplayModes(ddraw2,DDEDM_REFRESHRATES,NULL,this,EnumModes2);
- if ( result != DD_OK ) {
- SetDDerror("DirectDraw2::EnumDisplayModes", result);
- return(-1);
- }
- for ( i=0; i<NUM_MODELISTS; ++i ) {
- struct DX5EnumRect *rect;
- SDL_modelist[i] = (SDL_Rect **)
- SDL_malloc((SDL_nummodes[i]+1)*sizeof(SDL_Rect *));
- if ( SDL_modelist[i] == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
- for ( j = 0, rect = enumlists[i]; rect; ++j, rect = rect->next ) {
- SDL_modelist[i][j] = &rect->r;
- }
- SDL_modelist[i][j] = NULL;
-
- if ( SDL_nummodes[i] > 0 ) {
- SDL_qsort(SDL_modelist[i], SDL_nummodes[i], sizeof *SDL_modelist[i], cmpmodes);
- }
- }
-
- /* Fill in some window manager capabilities */
- this->info.wm_available = 1;
-
- /* Fill in the video hardware capabilities */
- DX5_UpdateVideoInfo(this);
-
- return(0);
-}
-
-SDL_Rect **DX5_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- int bpp;
-
- bpp = format->BitsPerPixel;
- if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
- /* FIXME: No support for 1 bpp or 4 bpp formats */
- switch (bpp) { /* Does windows support other BPP? */
- case 8:
- case 16:
- case 24:
- case 32:
- bpp = (bpp/8)-1;
- if ( SDL_nummodes[bpp] > 0 )
- return(SDL_modelist[bpp]);
- /* Fall through */
- default:
- return((SDL_Rect **)0);
- }
- } else {
- if ( this->screen->format->BitsPerPixel == bpp ) {
- return((SDL_Rect **)-1);
- } else {
- return((SDL_Rect **)0);
- }
- }
-}
-
-/* Various screen update functions available */
-static void DX5_WindowUpdate(_THIS, int numrects, SDL_Rect *rects);
-static void DX5_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
-
-SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- SDL_Surface *video;
- int prev_w, prev_h;
- HRESULT result;
- DWORD sharemode;
- DWORD style;
- const DWORD directstyle =
- (WS_POPUP);
- const DWORD windowstyle =
- (WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX);
- const DWORD resizestyle =
- (WS_THICKFRAME|WS_MAXIMIZEBOX);
- DDSURFACEDESC ddsd;
- LPDIRECTDRAWSURFACE dd_surface1;
- LPDIRECTDRAWSURFACE3 dd_surface3;
-
- SDL_resizing = 1;
-#ifdef DDRAW_DEBUG
- fprintf(stderr, "Setting %dx%dx%d video mode\n", width, height, bpp);
-#endif
- /* Clean up any previous DirectDraw surfaces */
- if ( current->hwdata ) {
- this->FreeHWSurface(this, current);
- current->hwdata = NULL;
- }
- if ( SDL_primary != NULL ) {
- IDirectDrawSurface3_Release(SDL_primary);
- SDL_primary = NULL;
- }
-
-#ifndef NO_CHANGEDISPLAYSETTINGS
- /* Unset any previous OpenGL fullscreen mode */
- if ( (current->flags & (SDL_OPENGL|SDL_FULLSCREEN)) ==
- (SDL_OPENGL|SDL_FULLSCREEN) ) {
- ChangeDisplaySettings(NULL, 0);
- }
-#endif
-
- /* Clean up any GL context that may be hanging around */
- if ( current->flags & SDL_OPENGL ) {
- WIN_GL_ShutDown(this);
- }
-
- /* If we are setting a GL mode, use GDI, not DirectX (yuck) */
- if ( flags & SDL_OPENGL ) {
- Uint32 Rmask, Gmask, Bmask;
-
- /* Recalculate the bitmasks if necessary */
- if ( bpp == current->format->BitsPerPixel ) {
- video = current;
- } else {
- switch (bpp) {
- case 15:
- case 16:
- if ( 0 /*DIB_SussScreenDepth() == 15*/ ) {
- /* 5-5-5 */
- Rmask = 0x00007c00;
- Gmask = 0x000003e0;
- Bmask = 0x0000001f;
- } else {
- /* 5-6-5 */
- Rmask = 0x0000f800;
- Gmask = 0x000007e0;
- Bmask = 0x0000001f;
- }
- break;
- case 24:
- case 32:
- /* GDI defined as 8-8-8 */
- Rmask = 0x00ff0000;
- Gmask = 0x0000ff00;
- Bmask = 0x000000ff;
- break;
- default:
- Rmask = 0x00000000;
- Gmask = 0x00000000;
- Bmask = 0x00000000;
- break;
- }
- video = SDL_CreateRGBSurface(SDL_SWSURFACE, 0, 0, bpp,
- Rmask, Gmask, Bmask, 0);
- if ( video == NULL ) {
- SDL_OutOfMemory();
- return(NULL);
- }
- }
-
- /* Fill in part of the video surface */
- prev_w = video->w;
- prev_h = video->h;
- video->flags = 0; /* Clear flags */
- video->w = width;
- video->h = height;
- video->pitch = SDL_CalculatePitch(video);
-
-#ifndef NO_CHANGEDISPLAYSETTINGS
- /* Set fullscreen mode if appropriate.
- Ugh, since our list of valid video modes comes from
- the DirectX driver, we may not actually be able to
- change to the desired resolution here.
- FIXME: Should we do a closest match?
- */
- if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
- DEVMODE settings;
- BOOL changed;
-
- SDL_memset(&settings, 0, sizeof(DEVMODE));
- settings.dmSize = sizeof(DEVMODE);
- settings.dmBitsPerPel = video->format->BitsPerPixel;
- settings.dmPelsWidth = width;
- settings.dmPelsHeight = height;
- settings.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL;
- if ( width <= (int)SDL_desktop_mode.dmPelsWidth &&
- height <= (int)SDL_desktop_mode.dmPelsHeight ) {
- settings.dmDisplayFrequency = SDL_desktop_mode.dmDisplayFrequency;
- settings.dmFields |= DM_DISPLAYFREQUENCY;
- }
- changed = (ChangeDisplaySettings(&settings, CDS_FULLSCREEN) == DISP_CHANGE_SUCCESSFUL);
- if ( ! changed && (settings.dmFields & DM_DISPLAYFREQUENCY) ) {
- settings.dmFields &= ~DM_DISPLAYFREQUENCY;
- changed = (ChangeDisplaySettings(&settings, CDS_FULLSCREEN) == DISP_CHANGE_SUCCESSFUL);
- }
- if ( changed ) {
- video->flags |= SDL_FULLSCREEN;
- SDL_fullscreen_mode = settings;
- }
- }
-#endif /* !NO_CHANGEDISPLAYSETTINGS */
-
- style = GetWindowLong(SDL_Window, GWL_STYLE);
- style &= ~(resizestyle|WS_MAXIMIZE);
- if ( video->flags & SDL_FULLSCREEN ) {
- style &= ~windowstyle;
- style |= directstyle;
- } else {
- if ( flags & SDL_NOFRAME ) {
- style &= ~windowstyle;
- style |= directstyle;
- video->flags |= SDL_NOFRAME;
- } else {
- style &= ~directstyle;
- style |= windowstyle;
- if ( flags & SDL_RESIZABLE ) {
- style |= resizestyle;
- video->flags |= SDL_RESIZABLE;
- }
- }
-#if WS_MAXIMIZE
- if (IsZoomed(SDL_Window)) style |= WS_MAXIMIZE;
-#endif
- }
-
- /* DJM: Don't piss of anyone who has setup his own window */
- if ( !SDL_windowid )
- SetWindowLong(SDL_Window, GWL_STYLE, style);
-
- /* Resize the window (copied from SDL WinDIB driver) */
- if ( !SDL_windowid && !IsZoomed(SDL_Window) ) {
- RECT bounds;
- int x, y;
- HWND top;
- UINT swp_flags;
- const char *window = NULL;
- const char *center = NULL;
-
- if ( video->w != prev_w || video->h != prev_h ) {
- window = SDL_getenv("SDL_VIDEO_WINDOW_POS");
- center = SDL_getenv("SDL_VIDEO_CENTERED");
- if ( window ) {
- if ( SDL_sscanf(window, "%d,%d", &x, &y) == 2 ) {
- SDL_windowX = x;
- SDL_windowY = y;
- }
- if ( SDL_strcmp(window, "center") == 0 ) {
- center = window;
- }
- }
- }
- swp_flags = (SWP_NOCOPYBITS | SWP_SHOWWINDOW);
-
- bounds.left = SDL_windowX;
- bounds.top = SDL_windowY;
- bounds.right = SDL_windowX+video->w;
- bounds.bottom = SDL_windowY+video->h;
- AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), (GetMenu(SDL_Window) != NULL), 0);
- width = bounds.right-bounds.left;
- height = bounds.bottom-bounds.top;
- if ( (flags & SDL_FULLSCREEN) ) {
- x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
- y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
- } else if ( center ) {
- x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
- y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
- } else if ( SDL_windowX || SDL_windowY || window ) {
- x = bounds.left;
- y = bounds.top;
- } else {
- x = y = -1;
- swp_flags |= SWP_NOMOVE;
- }
- if ( flags & SDL_FULLSCREEN ) {
- top = HWND_TOPMOST;
- } else {
- top = HWND_NOTOPMOST;
- }
- SetWindowPos(SDL_Window, top, x, y, width, height, swp_flags);
- if ( !(flags & SDL_FULLSCREEN) ) {
- SDL_windowX = SDL_bounds.left;
- SDL_windowY = SDL_bounds.top;
- }
- SetForegroundWindow(SDL_Window);
- }
- SDL_resizing = 0;
-
- /* Set up for OpenGL */
- if ( WIN_GL_SetupWindow(this) < 0 ) {
- return(NULL);
- }
- video->flags |= SDL_OPENGL;
- return(video);
- }
-
- /* Set the appropriate window style */
- style = GetWindowLong(SDL_Window, GWL_STYLE);
- style &= ~(resizestyle|WS_MAXIMIZE);
- if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
- style &= ~windowstyle;
- style |= directstyle;
- } else {
- if ( flags & SDL_NOFRAME ) {
- style &= ~windowstyle;
- style |= directstyle;
- } else {
- style &= ~directstyle;
- style |= windowstyle;
- if ( flags & SDL_RESIZABLE ) {
- style |= resizestyle;
- }
- }
-#if WS_MAXIMIZE
- if (IsZoomed(SDL_Window)) style |= WS_MAXIMIZE;
-#endif
- }
- /* DJM: Don't piss of anyone who has setup his own window */
- if ( !SDL_windowid )
- SetWindowLong(SDL_Window, GWL_STYLE, style);
-
- /* Set DirectDraw sharing mode.. exclusive when fullscreen */
- if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
- sharemode = DDSCL_FULLSCREEN|DDSCL_EXCLUSIVE|DDSCL_ALLOWREBOOT;
- } else {
- sharemode = DDSCL_NORMAL;
- }
- result = IDirectDraw2_SetCooperativeLevel(ddraw2,SDL_Window,sharemode);
- if ( result != DD_OK ) {
- SetDDerror("DirectDraw2::SetCooperativeLevel", result);
- return(NULL);
- }
-
- /* Set the display mode, if we are in fullscreen mode */
- if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
- RECT bounds;
- struct DX5EnumRect *rect;
- int maxRefreshRate;
-
- /* Cover up desktop during mode change */
- bounds.left = 0;
- bounds.top = 0;
- bounds.right = GetSystemMetrics(SM_CXSCREEN);
- bounds.bottom = GetSystemMetrics(SM_CYSCREEN);
- AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), (GetMenu(SDL_Window) != NULL), 0);
- SetWindowPos(SDL_Window, HWND_TOPMOST,
- bounds.left, bounds.top,
- bounds.right - bounds.left,
- bounds.bottom - bounds.top, SWP_NOCOPYBITS);
- ShowWindow(SDL_Window, SW_SHOW);
- while ( GetForegroundWindow() != SDL_Window ) {
- SetForegroundWindow(SDL_Window);
- SDL_Delay(100);
- }
-
- /* find maximum monitor refresh rate for this resolution */
- /* Dmitry Yakimov ftech@tula.net */
- maxRefreshRate = 0; /* system default */
- for ( rect = enumlists[bpp / 8 - 1]; rect; rect = rect->next ) {
- if ( (width == rect->r.w) && (height == rect->r.h) ) {
- maxRefreshRate = rect->refreshRate;
- break;
- }
- }
-#ifdef DDRAW_DEBUG
- fprintf(stderr, "refresh rate = %d Hz\n", maxRefreshRate);
-#endif
-
- result = IDirectDraw2_SetDisplayMode(ddraw2, width, height, bpp, maxRefreshRate, 0);
- if ( result != DD_OK ) {
- result = IDirectDraw2_SetDisplayMode(ddraw2, width, height, bpp, 0, 0);
- if ( result != DD_OK ) {
- /* We couldn't set fullscreen mode, try window */
- return(DX5_SetVideoMode(this, current, width, height, bpp, flags & ~SDL_FULLSCREEN));
- }
- }
- DX5_DInputReset(this, 1);
- } else {
- DX5_DInputReset(this, 0);
- }
- DX5_UpdateVideoInfo(this);
-
- /* Create a primary DirectDraw surface */
- SDL_memset(&ddsd, 0, sizeof(ddsd));
- ddsd.dwSize = sizeof(ddsd);
- ddsd.dwFlags = DDSD_CAPS;
- ddsd.ddsCaps.dwCaps = (DDSCAPS_PRIMARYSURFACE|DDSCAPS_VIDEOMEMORY);
- if ( (flags & SDL_FULLSCREEN) != SDL_FULLSCREEN ) {
- /* There's no windowed double-buffering */
- flags &= ~SDL_DOUBLEBUF;
- }
- if ( (flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
- ddsd.dwFlags |= DDSD_BACKBUFFERCOUNT;
- ddsd.ddsCaps.dwCaps |= (DDSCAPS_COMPLEX|DDSCAPS_FLIP);
- ddsd.dwBackBufferCount = 1;
- }
- result = IDirectDraw2_CreateSurface(ddraw2, &ddsd, &dd_surface1, NULL);
- if ( (result != DD_OK) && ((flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF) ) {
- ddsd.dwFlags &= ~DDSD_BACKBUFFERCOUNT;
- ddsd.ddsCaps.dwCaps &= ~(DDSCAPS_COMPLEX|DDSCAPS_FLIP);
- ddsd.dwBackBufferCount = 0;
- result = IDirectDraw2_CreateSurface(ddraw2,
- &ddsd, &dd_surface1, NULL);
- }
- if ( result != DD_OK ) {
- SetDDerror("DirectDraw2::CreateSurface(PRIMARY)", result);
- return(NULL);
- }
- result = IDirectDrawSurface_QueryInterface(dd_surface1,
- &IID_IDirectDrawSurface3, (LPVOID *)&SDL_primary);
- if ( result != DD_OK ) {
- SetDDerror("DirectDrawSurface::QueryInterface", result);
- return(NULL);
- }
- IDirectDrawSurface_Release(dd_surface1);
-
- /* Get the format of the primary DirectDraw surface */
- SDL_memset(&ddsd, 0, sizeof(ddsd));
- ddsd.dwSize = sizeof(ddsd);
- ddsd.dwFlags = DDSD_PIXELFORMAT|DDSD_CAPS;
- result = IDirectDrawSurface3_GetSurfaceDesc(SDL_primary, &ddsd);
- if ( result != DD_OK ) {
- SetDDerror("DirectDrawSurface::GetSurfaceDesc", result);
- return(NULL);
- }
- if ( ! (ddsd.ddpfPixelFormat.dwFlags&DDPF_RGB) ) {
- SDL_SetError("Primary DDRAW surface is not RGB format");
- return(NULL);
- }
-
- /* Free old palette and create a new one if we're in 8-bit mode */
- if ( SDL_palette != NULL ) {
- IDirectDrawPalette_Release(SDL_palette);
- SDL_palette = NULL;
- }
-#if defined(NONAMELESSUNION)
- if ( ddsd.ddpfPixelFormat.u1.dwRGBBitCount == 8 ) {
-#else
- if ( ddsd.ddpfPixelFormat.dwRGBBitCount == 8 ) {
-#endif
- int i;
-
- if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
- /* We have access to the entire palette */
- for ( i=0; i<256; ++i ) {
- SDL_colors[i].peFlags =
- (PC_NOCOLLAPSE|PC_RESERVED);
- SDL_colors[i].peRed = 0;
- SDL_colors[i].peGreen = 0;
- SDL_colors[i].peBlue = 0;
- }
- } else {
- /* First 10 colors are reserved by Windows */
- for ( i=0; i<10; ++i ) {
- SDL_colors[i].peFlags = PC_EXPLICIT;
- SDL_colors[i].peRed = i;
- SDL_colors[i].peGreen = 0;
- SDL_colors[i].peBlue = 0;
- }
- for ( i=10; i<(10+236); ++i ) {
- SDL_colors[i].peFlags = PC_NOCOLLAPSE;
- SDL_colors[i].peRed = 0;
- SDL_colors[i].peGreen = 0;
- SDL_colors[i].peBlue = 0;
- }
- /* Last 10 colors are reserved by Windows */
- for ( i=246; i<256; ++i ) {
- SDL_colors[i].peFlags = PC_EXPLICIT;
- SDL_colors[i].peRed = i;
- SDL_colors[i].peGreen = 0;
- SDL_colors[i].peBlue = 0;
- }
- }
- result = IDirectDraw2_CreatePalette(ddraw2,
- (DDPCAPS_8BIT|DDPCAPS_ALLOW256),
- SDL_colors, &SDL_palette, NULL);
- if ( result != DD_OK ) {
- SetDDerror("DirectDraw2::CreatePalette", result);
- return(NULL);
- }
- result = IDirectDrawSurface3_SetPalette(SDL_primary,
- SDL_palette);
- if ( result != DD_OK ) {
- SetDDerror("DirectDrawSurface3::SetPalette", result);
- return(NULL);
- }
- }
-
- /* Create our video surface using the same pixel format */
- video = current;
- if ( (width != video->w) || (height != video->h)
- || (video->format->BitsPerPixel !=
-#if defined(NONAMELESSUNION)
- ddsd.ddpfPixelFormat.u1.dwRGBBitCount) ) {
-#else
- ddsd.ddpfPixelFormat.dwRGBBitCount) ) {
-#endif
- SDL_FreeSurface(video);
- video = SDL_CreateRGBSurface(SDL_SWSURFACE, 0, 0,
-#if defined(NONAMELESSUNION)
- ddsd.ddpfPixelFormat.u1.dwRGBBitCount,
- ddsd.ddpfPixelFormat.u2.dwRBitMask,
- ddsd.ddpfPixelFormat.u3.dwGBitMask,
- ddsd.ddpfPixelFormat.u4.dwBBitMask,
-#else
- ddsd.ddpfPixelFormat.dwRGBBitCount,
- ddsd.ddpfPixelFormat.dwRBitMask,
- ddsd.ddpfPixelFormat.dwGBitMask,
- ddsd.ddpfPixelFormat.dwBBitMask,
-#endif
- 0);
- if ( video == NULL ) {
- SDL_OutOfMemory();
- return(NULL);
- }
- prev_w = video->w;
- prev_h = video->h;
- video->w = width;
- video->h = height;
- video->pitch = 0;
- }
- video->flags = 0; /* Clear flags */
-
- /* If not fullscreen, locking is possible, but it doesn't do what
- the caller really expects -- if the locked surface is written to,
- the appropriate portion of the entire screen is modified, not
- the application window, as we would like.
- Note that it is still possible to write directly to display
- memory, but the application must respect the clip list of
- the surface. There might be some odd timing interactions
- involving clip list updates and background refreshing as
- Windows moves other windows across our window.
- We currently don't support this, even though it might be a
- good idea since BeOS has an implementation of BDirectWindow
- that does the same thing. This would be most useful for
- applications that do complete screen updates every frame.
- -- Fixme?
- */
- if ( (flags & SDL_FULLSCREEN) != SDL_FULLSCREEN ) {
- /* Necessary if we're going from fullscreen to window */
- if ( video->pixels == NULL ) {
- video->pitch = (width*video->format->BytesPerPixel);
- /* Pitch needs to be QWORD (8-byte) aligned */
- video->pitch = (video->pitch + 7) & ~7;
- video->pixels = (void *)SDL_malloc(video->h*video->pitch);
- if ( video->pixels == NULL ) {
- if ( video != current ) {
- SDL_FreeSurface(video);
- }
- SDL_OutOfMemory();
- return(NULL);
- }
- }
- dd_surface3 = NULL;
-#if 0 /* FIXME: enable this when SDL consistently reports lost surfaces */
- if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
- video->flags |= SDL_HWSURFACE;
- } else {
- video->flags |= SDL_SWSURFACE;
- }
-#else
- video->flags |= SDL_SWSURFACE;
-#endif
- if ( (flags & SDL_RESIZABLE) && !(flags & SDL_NOFRAME) ) {
- video->flags |= SDL_RESIZABLE;
- }
- if ( flags & SDL_NOFRAME ) {
- video->flags |= SDL_NOFRAME;
- }
- } else {
- /* Necessary if we're going from window to fullscreen */
- if ( video->pixels != NULL ) {
- SDL_free(video->pixels);
- video->pixels = NULL;
- }
- dd_surface3 = SDL_primary;
- video->flags |= SDL_HWSURFACE;
- }
-
- /* See if the primary surface has double-buffering enabled */
- if ( (ddsd.ddsCaps.dwCaps & DDSCAPS_FLIP) == DDSCAPS_FLIP ) {
- video->flags |= SDL_DOUBLEBUF;
- }
-
- /* Allocate the SDL surface associated with the primary surface */
- if ( DX5_AllocDDSurface(this, video, dd_surface3,
- video->flags&SDL_HWSURFACE) < 0 ) {
- if ( video != current ) {
- SDL_FreeSurface(video);
- }
- return(NULL);
- }
-
- /* Use the appropriate blitting function */
- if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
- video->flags |= SDL_FULLSCREEN;
- if ( video->format->palette != NULL ) {
- video->flags |= SDL_HWPALETTE;
- }
- this->UpdateRects = DX5_DirectUpdate;
- } else {
- this->UpdateRects = DX5_WindowUpdate;
- }
-
- /* Make our window the proper size, set the clipper, then show it */
- if ( (flags & SDL_FULLSCREEN) != SDL_FULLSCREEN ) {
- /* Create and set a clipper on our primary surface */
- if ( SDL_clipper == NULL ) {
- result = IDirectDraw2_CreateClipper(ddraw2,
- 0, &SDL_clipper, NULL);
- if ( result != DD_OK ) {
- if ( video != current ) {
- SDL_FreeSurface(video);
- }
- SetDDerror("DirectDraw2::CreateClipper",result);
- return(NULL);
- }
- }
- result = IDirectDrawClipper_SetHWnd(SDL_clipper, 0, SDL_Window);
- if ( result != DD_OK ) {
- if ( video != current ) {
- SDL_FreeSurface(video);
- }
- SetDDerror("DirectDrawClipper::SetHWnd", result);
- return(NULL);
- }
- result = IDirectDrawSurface3_SetClipper(SDL_primary,
- SDL_clipper);
- if ( result != DD_OK ) {
- if ( video != current ) {
- SDL_FreeSurface(video);
- }
- SetDDerror("DirectDrawSurface3::SetClipper", result);
- return(NULL);
- }
-
- /* Resize the window (copied from SDL WinDIB driver) */
- if ( !SDL_windowid && !IsZoomed(SDL_Window) ) {
- RECT bounds;
- int x, y;
- UINT swp_flags;
- const char *window = NULL;
- const char *center = NULL;
-
- if ( video->w != prev_w || video->h != prev_h ) {
- window = SDL_getenv("SDL_VIDEO_WINDOW_POS");
- center = SDL_getenv("SDL_VIDEO_CENTERED");
- if ( window ) {
- if ( SDL_sscanf(window, "%d,%d", &x, &y) == 2 ) {
- SDL_windowX = x;
- SDL_windowY = y;
- }
- if ( SDL_strcmp(window, "center") == 0 ) {
- center = window;
- }
- }
- }
- swp_flags = SWP_NOCOPYBITS;
-
- bounds.left = SDL_windowX;
- bounds.top = SDL_windowY;
- bounds.right = SDL_windowX+video->w;
- bounds.bottom = SDL_windowY+video->h;
- AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), (GetMenu(SDL_Window) != NULL), 0);
- width = bounds.right-bounds.left;
- height = bounds.bottom-bounds.top;
- if ( center ) {
- x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
- y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
- } else if ( SDL_windowX || SDL_windowY || window ) {
- x = bounds.left;
- y = bounds.top;
- } else {
- x = y = -1;
- swp_flags |= SWP_NOMOVE;
- }
- SetWindowPos(SDL_Window, HWND_NOTOPMOST, x, y, width, height, swp_flags);
- SDL_windowX = SDL_bounds.left;
- SDL_windowY = SDL_bounds.top;
- }
-
- }
- ShowWindow(SDL_Window, SW_SHOW);
- SetForegroundWindow(SDL_Window);
- SDL_resizing = 0;
-
- /* JC 14 Mar 2006
- Flush the message loop or this can cause big problems later
- Especially if the user decides to use dialog boxes or assert()!
- */
- WIN_FlushMessageQueue();
-
- /* We're live! */
- return(video);
-}
-
-struct private_hwdata {
- LPDIRECTDRAWSURFACE3 dd_surface;
- LPDIRECTDRAWSURFACE3 dd_writebuf;
-};
-
-static int DX5_AllocDDSurface(_THIS, SDL_Surface *surface,
- LPDIRECTDRAWSURFACE3 requested, Uint32 flag)
-{
- LPDIRECTDRAWSURFACE dd_surface1;
- LPDIRECTDRAWSURFACE3 dd_surface3;
- DDSURFACEDESC ddsd;
- HRESULT result;
-
- /* Clear the hardware flag, in case we fail */
- surface->flags &= ~flag;
-
- /* Allocate the hardware acceleration data */
- surface->hwdata = (struct private_hwdata *)
- SDL_malloc(sizeof(*surface->hwdata));
- if ( surface->hwdata == NULL ) {
- SDL_OutOfMemory();
- return(-1);
- }
- dd_surface3 = NULL;
-
- /* Set up the surface description */
- SDL_memset(&ddsd, 0, sizeof(ddsd));
- ddsd.dwSize = sizeof(ddsd);
- ddsd.dwFlags = (DDSD_WIDTH|DDSD_HEIGHT|DDSD_CAPS|
- DDSD_PITCH|DDSD_PIXELFORMAT);
- ddsd.dwWidth = surface->w;
- ddsd.dwHeight= surface->h;
-#if defined(NONAMELESSUNION)
- ddsd.u1.lPitch = surface->pitch;
-#else
- ddsd.lPitch = surface->pitch;
-#endif
- if ( (flag & SDL_HWSURFACE) == SDL_HWSURFACE ) {
- ddsd.ddsCaps.dwCaps =
- (DDSCAPS_OFFSCREENPLAIN|DDSCAPS_VIDEOMEMORY);
- } else {
- ddsd.ddsCaps.dwCaps =
- (DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY);
- }
- ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
- ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB;
- if ( surface->format->palette ) {
- ddsd.ddpfPixelFormat.dwFlags |= DDPF_PALETTEINDEXED8;
- }
-#if defined(NONAMELESSUNION)
- ddsd.ddpfPixelFormat.u1.dwRGBBitCount = surface->format->BitsPerPixel;
- ddsd.ddpfPixelFormat.u2.dwRBitMask = surface->format->Rmask;
- ddsd.ddpfPixelFormat.u3.dwGBitMask = surface->format->Gmask;
- ddsd.ddpfPixelFormat.u4.dwBBitMask = surface->format->Bmask;
-#else
- ddsd.ddpfPixelFormat.dwRGBBitCount = surface->format->BitsPerPixel;
- ddsd.ddpfPixelFormat.dwRBitMask = surface->format->Rmask;
- ddsd.ddpfPixelFormat.dwGBitMask = surface->format->Gmask;
- ddsd.ddpfPixelFormat.dwBBitMask = surface->format->Bmask;
-#endif
-
- /* Create the DirectDraw video surface */
- if ( requested != NULL ) {
- dd_surface3 = requested;
- } else {
- result = IDirectDraw2_CreateSurface(ddraw2,
- &ddsd, &dd_surface1, NULL);
- if ( result != DD_OK ) {
- SetDDerror("DirectDraw2::CreateSurface", result);
- goto error_end;
- }
- result = IDirectDrawSurface_QueryInterface(dd_surface1,
- &IID_IDirectDrawSurface3, (LPVOID *)&dd_surface3);
- IDirectDrawSurface_Release(dd_surface1);
- if ( result != DD_OK ) {
- SetDDerror("DirectDrawSurface::QueryInterface", result);
- goto error_end;
- }
- }
-
- if ( (flag & SDL_HWSURFACE) == SDL_HWSURFACE ) {
- /* Check to see whether the surface actually ended up
- in video memory, and fail if not. We expect the
- surfaces we create here to actually be in hardware!
- */
- result = IDirectDrawSurface3_GetCaps(dd_surface3,&ddsd.ddsCaps);
- if ( result != DD_OK ) {
- SetDDerror("DirectDrawSurface3::GetCaps", result);
- goto error_end;
- }
- if ( (ddsd.ddsCaps.dwCaps&DDSCAPS_VIDEOMEMORY) !=
- DDSCAPS_VIDEOMEMORY ) {
- SDL_SetError("No room in video memory");
- goto error_end;
- }
- } else {
- /* Try to hook our surface memory */
- ddsd.dwFlags = DDSD_LPSURFACE;
- ddsd.lpSurface = surface->pixels;
- result = IDirectDrawSurface3_SetSurfaceDesc(dd_surface3,
- &ddsd, 0);
- if ( result != DD_OK ) {
- SetDDerror("DirectDraw2::SetSurfaceDesc", result);
- goto error_end;
- }
-
- }
-
- /* Make sure the surface format was set properly */
- SDL_memset(&ddsd, 0, sizeof(ddsd));
- ddsd.dwSize = sizeof(ddsd);
- result = IDirectDrawSurface3_Lock(dd_surface3, NULL,
- &ddsd, (DDLOCK_NOSYSLOCK|DDLOCK_WAIT), NULL);
- if ( result != DD_OK ) {
- SetDDerror("DirectDrawSurface3::Lock", result);
- goto error_end;
- }
- IDirectDrawSurface3_Unlock(dd_surface3, NULL);
-
- if ( (flag & SDL_HWSURFACE) == SDL_SWSURFACE ) {
- if ( ddsd.lpSurface != surface->pixels ) {
- SDL_SetError("DDraw didn't use SDL surface memory");
- goto error_end;
- }
- if (
-#if defined(NONAMELESSUNION)
- ddsd.u1.lPitch
-#else
- ddsd.lPitch
-#endif
- != (LONG)surface->pitch ) {
- SDL_SetError("DDraw created surface with wrong pitch");
- goto error_end;
- }
- } else {
-#if defined(NONAMELESSUNION)
- surface->pitch = (Uint16)ddsd.u1.lPitch;
-#else
- surface->pitch = (Uint16)ddsd.lPitch;
-#endif
- }
-#if defined(NONAMELESSUNION)
- if ( (ddsd.ddpfPixelFormat.u1.dwRGBBitCount !=
- surface->format->BitsPerPixel) ||
- (ddsd.ddpfPixelFormat.u2.dwRBitMask != surface->format->Rmask) ||
- (ddsd.ddpfPixelFormat.u3.dwGBitMask != surface->format->Gmask) ||
- (ddsd.ddpfPixelFormat.u4.dwBBitMask != surface->format->Bmask) ){
-#else
- if ( (ddsd.ddpfPixelFormat.dwRGBBitCount !=
- surface->format->BitsPerPixel) ||
- (ddsd.ddpfPixelFormat.dwRBitMask != surface->format->Rmask) ||
- (ddsd.ddpfPixelFormat.dwGBitMask != surface->format->Gmask) ||
- (ddsd.ddpfPixelFormat.dwBBitMask != surface->format->Bmask) ){
-#endif
- SDL_SetError("DDraw didn't use SDL surface description");
- goto error_end;
- }
- if ( (ddsd.dwWidth != (DWORD)surface->w) ||
- (ddsd.dwHeight != (DWORD)surface->h) ) {
- SDL_SetError("DDraw created surface with wrong size");
- goto error_end;
- }
-
- /* Set the surface private data */
- surface->flags |= flag;
- surface->hwdata->dd_surface = dd_surface3;
- if ( (surface->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
- LPDIRECTDRAWSURFACE3 dd_writebuf;
-
- ddsd.ddsCaps.dwCaps = DDSCAPS_BACKBUFFER;
- result = IDirectDrawSurface3_GetAttachedSurface(dd_surface3,
- &ddsd.ddsCaps, &dd_writebuf);
- if ( result != DD_OK ) {
- SetDDerror("DirectDrawSurface3::GetAttachedSurface",
- result);
- } else {
- dd_surface3 = dd_writebuf;
- }
- }
- surface->hwdata->dd_writebuf = dd_surface3;
-
- /* We're ready to go! */
- return(0);
-
- /* Okay, so goto's are cheesy, but there are so many possible
- errors in this function, and the cleanup is the same in
- every single case. Is there a better way, other than deeply
- nesting the code?
- */
-error_end:
- if ( (dd_surface3 != NULL) && (dd_surface3 != requested) ) {
- IDirectDrawSurface_Release(dd_surface3);
- }
- SDL_free(surface->hwdata);
- surface->hwdata = NULL;
- return(-1);
-}
-
-static int DX5_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- /* DDraw limitation -- you need to set cooperative level first */
- if ( SDL_primary == NULL ) {
- SDL_SetError("You must set a non-GL video mode first");
- return(-1);
- }
- return(DX5_AllocDDSurface(this, surface, NULL, SDL_HWSURFACE));
-}
-
-#ifdef DDRAW_DEBUG
-void PrintSurface(char *title, LPDIRECTDRAWSURFACE3 surface, Uint32 flags)
-{
- DDSURFACEDESC ddsd;
-
- /* Lock and load! */
- SDL_memset(&ddsd, 0, sizeof(ddsd));
- ddsd.dwSize = sizeof(ddsd);
- if ( IDirectDrawSurface3_Lock(surface, NULL, &ddsd,
- (DDLOCK_NOSYSLOCK|DDLOCK_WAIT), NULL) != DD_OK ) {
- return;
- }
- IDirectDrawSurface3_Unlock(surface, NULL);
-
- fprintf(stderr, "%s:\n", title);
- fprintf(stderr, "\tSize: %dx%d in %s at %ld bpp (pitch = %ld)\n",
- ddsd.dwWidth, ddsd.dwHeight,
- (flags & SDL_HWSURFACE) ? "hardware" : "software",
-#if defined(NONAMELESSUNION)
- ddsd.ddpfPixelFormat.u1.dwRGBBitCount, ddsd.u1.lPitch);
-#else
- ddsd.ddpfPixelFormat.dwRGBBitCount, ddsd.lPitch);
-#endif
- fprintf(stderr, "\tR = 0x%X, G = 0x%X, B = 0x%X\n",
-#if defined(NONAMELESSUNION)
- ddsd.ddpfPixelFormat.u2.dwRBitMask,
- ddsd.ddpfPixelFormat.u3.dwGBitMask,
- ddsd.ddpfPixelFormat.u4.dwBBitMask);
-#else
- ddsd.ddpfPixelFormat.dwRBitMask,
- ddsd.ddpfPixelFormat.dwGBitMask,
- ddsd.ddpfPixelFormat.dwBBitMask);
-#endif
-}
-#endif /* DDRAW_DEBUG */
-
-static int DX5_HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
- SDL_Surface *dst, SDL_Rect *dstrect)
-{
- LPDIRECTDRAWSURFACE3 src_surface;
- LPDIRECTDRAWSURFACE3 dst_surface;
- DWORD flags;
- RECT rect;
- HRESULT result;
-
- /* Set it up.. the desination must have a DDRAW surface */
- src_surface = src->hwdata->dd_writebuf;
- dst_surface = dst->hwdata->dd_writebuf;
- rect.top = (LONG)srcrect->y;
- rect.bottom = (LONG)srcrect->y+srcrect->h;
- rect.left = (LONG)srcrect->x;
- rect.right = (LONG)srcrect->x+srcrect->w;
- if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY )
- flags = DDBLTFAST_SRCCOLORKEY;
- else
- flags = DDBLTFAST_NOCOLORKEY;
- /* FIXME: We can remove this flag for _really_ fast blit queuing,
- but it will affect the return values of locks and flips.
- */
- flags |= DDBLTFAST_WAIT;
-
- /* Do the blit! */
- result = IDirectDrawSurface3_BltFast(dst_surface,
- dstrect->x, dstrect->y, src_surface, &rect, flags);
- if ( result != DD_OK ) {
- if ( result == DDERR_SURFACELOST ) {
- result = IDirectDrawSurface3_Restore(src_surface);
- result = IDirectDrawSurface3_Restore(dst_surface);
- /* The surfaces need to be reloaded with artwork */
- SDL_SetError("Blit surfaces were lost, reload them");
- return(-2);
- }
- SetDDerror("IDirectDrawSurface3::BltFast", result);
-#ifdef DDRAW_DEBUG
- fprintf(stderr, "Original dest rect: %dx%d at %d,%d\n", dstrect->w, dstrect->h, dstrect->x, dstrect->y);
- fprintf(stderr, "HW accelerated %sblit to from 0x%p to 0x%p at (%d,%d)\n",
- (src->flags & SDL_SRCCOLORKEY) ? "colorkey " : "", src, dst,
- dstrect->x, dstrect->y);
- PrintSurface("SRC", src_surface, src->flags);
- PrintSurface("DST", dst_surface, dst->flags);
- fprintf(stderr, "Source rectangle: (%d,%d) - (%d,%d)\n",
- rect.left, rect.top, rect.right, rect.bottom);
-#endif
- /* Unexpected error, fall back to software blit */
- return(src->map->sw_blit(src, srcrect, dst, dstrect));
- }
- return(0);
-}
-
-static int DX5_CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst)
-{
- int accelerated;
-
- /* We need to have a DDraw surface for HW blits */
- if ( (src->flags & SDL_HWSURFACE) == SDL_SWSURFACE ) {
- /* Allocate a DDraw surface for the blit */
- if ( src->hwdata == NULL ) {
- DX5_AllocDDSurface(this, src, NULL, SDL_SWSURFACE);
- }
- }
- if ( src->hwdata == NULL ) {
- return(0);
- }
-
- /* Set initial acceleration on */
- src->flags |= SDL_HWACCEL;
-
- /* Set the surface attributes */
- if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
- if ( DX5_SetHWColorKey(this, src, src->format->colorkey) < 0 ) {
- src->flags &= ~SDL_HWACCEL;
- }
- }
- if ( (src->flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
- if ( DX5_SetHWAlpha(this, src, src->format->alpha) < 0 ) {
- src->flags &= ~SDL_HWACCEL;
- }
- }
-
- /* Check to see if final surface blit is accelerated */
- accelerated = !!(src->flags & SDL_HWACCEL);
- if ( accelerated ) {
-#ifdef DDRAW_DEBUG
- fprintf(stderr, "Setting accelerated blit on 0x%p\n", src);
-#endif
- src->map->hw_blit = DX5_HWAccelBlit;
- }
- return(accelerated);
-}
-
-static int DX5_FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color)
-{
- LPDIRECTDRAWSURFACE3 dst_surface;
- RECT area;
- DDBLTFX bltfx;
- HRESULT result;
-
-#ifdef DDRAW_DEBUG
- fprintf(stderr, "HW accelerated fill at (%d,%d)\n", dstrect->x, dstrect->y);
-#endif
- dst_surface = dst->hwdata->dd_writebuf;
- area.top = (LONG)dstrect->y;
- area.bottom = (LONG)dstrect->y+dstrect->h;
- area.left = (LONG)dstrect->x;
- area.right = (LONG)dstrect->x+dstrect->w;
- bltfx.dwSize = sizeof(bltfx);
-#if defined(NONAMELESSUNION)
- bltfx.u5.dwFillColor = color;
-#else
- bltfx.dwFillColor = color;
-#endif
- result = IDirectDrawSurface3_Blt(dst_surface,
- &area, NULL, NULL, DDBLT_COLORFILL|DDBLT_WAIT, &bltfx);
- if ( result == DDERR_SURFACELOST ) {
- IDirectDrawSurface3_Restore(dst_surface);
- result = IDirectDrawSurface3_Blt(dst_surface,
- &area, NULL, NULL, DDBLT_COLORFILL|DDBLT_WAIT, &bltfx);
- }
- if ( result != DD_OK ) {
- SetDDerror("IDirectDrawSurface3::Blt", result);
- return(-1);
- }
- return(0);
-}
-
-static int DX5_SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key)
-{
- DDCOLORKEY colorkey;
- HRESULT result;
-
- /* Set the surface colorkey */
- colorkey.dwColorSpaceLowValue = key;
- colorkey.dwColorSpaceHighValue = key;
- result = IDirectDrawSurface3_SetColorKey(
- surface->hwdata->dd_surface, DDCKEY_SRCBLT, &colorkey);
- if ( result != DD_OK ) {
- SetDDerror("IDirectDrawSurface3::SetColorKey", result);
- return(-1);
- }
- return(0);
-}
-static int DX5_SetHWAlpha(_THIS, SDL_Surface *surface, Uint8 alpha)
-{
- return(-1);
-}
-
-static int DX5_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- HRESULT result;
- LPDIRECTDRAWSURFACE3 dd_surface;
- DDSURFACEDESC ddsd;
-
- /* Lock and load! */
- dd_surface = surface->hwdata->dd_writebuf;
- SDL_memset(&ddsd, 0, sizeof(ddsd));
- ddsd.dwSize = sizeof(ddsd);
- result = IDirectDrawSurface3_Lock(dd_surface, NULL, &ddsd,
- (DDLOCK_NOSYSLOCK|DDLOCK_WAIT), NULL);
- if ( result == DDERR_SURFACELOST ) {
- result = IDirectDrawSurface3_Restore(
- surface->hwdata->dd_surface);
- result = IDirectDrawSurface3_Lock(dd_surface, NULL, &ddsd,
- (DDLOCK_NOSYSLOCK|DDLOCK_WAIT), NULL);
- }
- if ( result != DD_OK ) {
- SetDDerror("DirectDrawSurface3::Lock", result);
- return(-1);
- }
- /* Pitch might have changed -- recalculate pitch and offset */
-#if defined(NONAMELESSUNION)
- if ( surface->pitch != ddsd.u1.lPitch ) {
- surface->pitch = ddsd.u1.lPitch;
-#else
- if ( surface->pitch != ddsd.lPitch ) {
- surface->pitch = (Uint16)ddsd.lPitch;
-#endif
- surface->offset =
- ((ddsd.dwHeight-surface->h)/2)*surface->pitch +
- ((ddsd.dwWidth-surface->w)/2)*
- surface->format->BytesPerPixel;
- }
- surface->pixels = ddsd.lpSurface;
- return(0);
-}
-
-static void DX5_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- IDirectDrawSurface3_Unlock(surface->hwdata->dd_writebuf, NULL);
- surface->pixels = NULL;
-}
-
-static int DX5_FlipHWSurface(_THIS, SDL_Surface *surface)
-{
- HRESULT result;
- LPDIRECTDRAWSURFACE3 dd_surface;
-
- dd_surface = surface->hwdata->dd_surface;
-
- /* to prevent big slowdown on fast computers, wait here instead of driver ring 0 code */
- /* Dmitry Yakimov (ftech@tula.net) */
- while(IDirectDrawSurface3_GetFlipStatus(dd_surface, DDGBS_ISBLTDONE) == DDERR_WASSTILLDRAWING);
-
- result = IDirectDrawSurface3_Flip(dd_surface, NULL, DDFLIP_WAIT);
- if ( result == DDERR_SURFACELOST ) {
- result = IDirectDrawSurface3_Restore(
- surface->hwdata->dd_surface);
- while(IDirectDrawSurface3_GetFlipStatus(dd_surface, DDGBS_ISBLTDONE) == DDERR_WASSTILLDRAWING);
- result = IDirectDrawSurface3_Flip(dd_surface, NULL, DDFLIP_WAIT);
- }
- if ( result != DD_OK ) {
- SetDDerror("DirectDrawSurface3::Flip", result);
- return(-1);
- }
- return(0);
-}
-
-static void DX5_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- if ( surface->hwdata ) {
- if ( surface->hwdata->dd_surface != SDL_primary ) {
- IDirectDrawSurface3_Release(surface->hwdata->dd_surface);
- }
- SDL_free(surface->hwdata);
- surface->hwdata = NULL;
- }
-}
-
-void DX5_WindowUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- HRESULT result;
- int i;
- RECT src, dst;
-
- for ( i=0; i<numrects; ++i ) {
- src.top = (LONG)rects[i].y;
- src.bottom = (LONG)rects[i].y+rects[i].h;
- src.left = (LONG)rects[i].x;
- src.right = (LONG)rects[i].x+rects[i].w;
- dst.top = SDL_bounds.top+src.top;
- dst.left = SDL_bounds.left+src.left;
- dst.bottom = SDL_bounds.top+src.bottom;
- dst.right = SDL_bounds.left+src.right;
- result = IDirectDrawSurface3_Blt(SDL_primary, &dst,
- this->screen->hwdata->dd_surface, &src,
- DDBLT_WAIT, NULL);
- /* Doh! Check for lost surface and restore it */
- if ( result == DDERR_SURFACELOST ) {
- IDirectDrawSurface3_Restore(SDL_primary);
- IDirectDrawSurface3_Blt(SDL_primary, &dst,
- this->screen->hwdata->dd_surface, &src,
- DDBLT_WAIT, NULL);
- }
- }
-}
-
-void DX5_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
-}
-
-/* Compress a full palette into the limited number of colors given to us
- by windows.
-
- The "best" way to do this is to sort the colors by diversity and place
- the most diverse colors into the limited palette. Unfortunately this
- results in widely varying colors being displayed in the interval during
- which the windows palette has been set, and the mapping of the shadow
- surface to the new palette. This is especially noticeable during fades.
-
- To deal with this problem, we can copy a predetermined portion of the
- full palette, and use that as the limited palette. This allows colors
- to fade smoothly as the remapping is very similar on each palette change.
- Unfortunately, this breaks applications which partition the palette into
- distinct and widely varying areas, expecting all colors to be available.
-
- I'm making them both available, chosen at compile time.
- If you want the chunk-o-palette algorithm, define SIMPLE_COMPRESSION,
- otherwise the sort-by-diversity algorithm will be used.
-*/
-#define SIMPLE_COMPRESSION
-#define CS_CS_DIST(A, B) ({ \
- int r = (A.r - B.r); \
- int g = (A.g - B.g); \
- int b = (A.b - B.b); \
- (r*r + g*g + b*b); \
-})
-static void DX5_CompressPalette(_THIS, SDL_Color *colors, int ncolors, int maxcolors)
-{
-#ifdef SIMPLE_COMPRESSION
- int i, j;
-#else
- static SDL_Color zero = { 0, 0, 0, 0 };
- int i, j;
- int max, dist;
- int prev, next;
- int *pool;
- int *seen, *order;
-#endif
-
- /* Does this happen? */
- if ( maxcolors > ncolors ) {
- maxcolors = ncolors;
- }
-
-#ifdef SIMPLE_COMPRESSION
- /* Just copy the first "maxcolors" colors */
- for ( j=10, i=0; i<maxcolors; ++i, ++j ) {
- SDL_colors[j].peRed = colors[i].r;
- SDL_colors[j].peGreen = colors[i].g;
- SDL_colors[j].peBlue = colors[i].b;
- }
-#else
- /* Allocate memory for the arrays we use */
- pool = SDL_stack_alloc(int, 2*ncolors);
- if ( pool == NULL ) {
- /* No worries, just return */;
- return;
- }
- seen = pool;
- SDL_memset(seen, 0, ncolors*sizeof(int));
- order = pool+ncolors;
-
- /* Start with the brightest color */
- max = 0;
- for ( i=0; i<ncolors; ++i ) {
- dist = CS_CS_DIST(zero, colors[i]);
- if ( dist >= max ) {
- max = dist;
- next = i;
- }
- }
- j = 0;
- order[j++] = next;
- seen[next] = 1;
- prev = next;
-
- /* Keep going through all the colors */
- while ( j < maxcolors ) {
- max = 0;
- for ( i=0; i<ncolors; ++i ) {
- if ( seen[i] ) {
- continue;
- }
- dist = CS_CS_DIST(colors[i], colors[prev]);
- if ( dist >= max ) {
- max = dist;
- next = i;
- }
- }
- order[j++] = next;
- seen[next] = 1;
- prev = next;
- }
-
- /* Compress the colors to the palette */
- for ( j=10, i=0; i<maxcolors; ++i, ++j ) {
- SDL_colors[j].peRed = colors[order[i]].r;
- SDL_colors[j].peGreen = colors[order[i]].g;
- SDL_colors[j].peBlue = colors[order[i]].b;
- }
- SDL_stack_free(pool);
-#endif /* SIMPLE_COMPRESSION */
-}
-
-/* Set the system colormap in both fullscreen and windowed modes */
-int DX5_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- int i;
- int alloct_all;
-
- /* Copy palette colors into display palette */
- alloct_all = 0;
- if ( SDL_palette != NULL ) {
- if ( (this->screen->flags&SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
- /* We can set all entries explicitly */
- for ( i=0; i< ncolors; ++i ) {
- int j = firstcolor + i;
- SDL_colors[j].peRed = colors[i].r;
- SDL_colors[j].peGreen = colors[i].g;
- SDL_colors[j].peBlue = colors[i].b;
- }
- IDirectDrawPalette_SetEntries(SDL_palette, 0,
- firstcolor, ncolors, &SDL_colors[firstcolor]);
- alloct_all = 1;
- } else {
- /* Grab the 236 most diverse colors in the palette */
- DX5_CompressPalette(this, colors, ncolors, 236);
- /* This sends an WM_PALETTECHANGED message to us */
- colorchange_expected = 1;
- IDirectDrawPalette_SetEntries(SDL_palette, 0,
- 0, 256, SDL_colors);
- }
- }
- return(alloct_all);
-}
-
-/* Gamma code is only available on DirectX 7 and newer */
-static int DX5_SetGammaRamp(_THIS, Uint16 *ramp)
-{
-#ifdef IDirectDrawGammaControl_SetGammaRamp
- LPDIRECTDRAWGAMMACONTROL gamma;
- DDGAMMARAMP gamma_ramp;
- HRESULT result;
-#endif
-
- /* In windowed or OpenGL mode, use windib gamma code */
- if ( ! DDRAW_FULLSCREEN() ) {
- return DIB_SetGammaRamp(this, ramp);
- }
-
-#ifndef IDirectDrawGammaControl_SetGammaRamp
- SDL_SetError("SDL compiled without DirectX gamma ramp support");
- return -1;
-#else
- /* Check for a video mode! */
- if ( ! SDL_primary ) {
- SDL_SetError("A video mode must be set for gamma correction");
- return(-1);
- }
-
- /* Get the gamma control object */
- result = IDirectDrawSurface3_QueryInterface(SDL_primary,
- &IID_IDirectDrawGammaControl, (LPVOID *)&gamma);
- if ( result != DD_OK ) {
- SetDDerror("DirectDrawSurface3::QueryInterface(GAMMA)", result);
- return(-1);
- }
-
- /* Set up the gamma ramp */
- SDL_memcpy(gamma_ramp.red, &ramp[0*256], 256*sizeof(*ramp));
- SDL_memcpy(gamma_ramp.green, &ramp[1*256], 256*sizeof(*ramp));
- SDL_memcpy(gamma_ramp.blue, &ramp[2*256], 256*sizeof(*ramp));
- result = IDirectDrawGammaControl_SetGammaRamp(gamma, 0, &gamma_ramp);
- if ( result != DD_OK ) {
- SetDDerror("DirectDrawGammaControl::SetGammaRamp()", result);
- }
-
- /* Release the interface and return */
- IDirectDrawGammaControl_Release(gamma);
- return (result == DD_OK) ? 0 : -1;
-#endif /* !IDirectDrawGammaControl_SetGammaRamp */
-}
-
-static int DX5_GetGammaRamp(_THIS, Uint16 *ramp)
-{
-#ifdef IDirectDrawGammaControl_SetGammaRamp
- LPDIRECTDRAWGAMMACONTROL gamma;
- DDGAMMARAMP gamma_ramp;
- HRESULT result;
-#endif
-
- /* In windowed or OpenGL mode, use windib gamma code */
- if ( ! DDRAW_FULLSCREEN() ) {
- return DIB_GetGammaRamp(this, ramp);
- }
-
-#ifndef IDirectDrawGammaControl_SetGammaRamp
- SDL_SetError("SDL compiled without DirectX gamma ramp support");
- return -1;
-#else
- /* Check for a video mode! */
- if ( ! SDL_primary ) {
- SDL_SetError("A video mode must be set for gamma correction");
- return(-1);
- }
-
- /* Get the gamma control object */
- result = IDirectDrawSurface3_QueryInterface(SDL_primary,
- &IID_IDirectDrawGammaControl, (LPVOID *)&gamma);
- if ( result != DD_OK ) {
- SetDDerror("DirectDrawSurface3::QueryInterface(GAMMA)", result);
- return(-1);
- }
-
- /* Set up the gamma ramp */
- result = IDirectDrawGammaControl_GetGammaRamp(gamma, 0, &gamma_ramp);
- if ( result == DD_OK ) {
- SDL_memcpy(&ramp[0*256], gamma_ramp.red, 256*sizeof(*ramp));
- SDL_memcpy(&ramp[1*256], gamma_ramp.green, 256*sizeof(*ramp));
- SDL_memcpy(&ramp[2*256], gamma_ramp.blue, 256*sizeof(*ramp));
- } else {
- SetDDerror("DirectDrawGammaControl::GetGammaRamp()", result);
- }
-
- /* Release the interface and return */
- IDirectDrawGammaControl_Release(gamma);
- return (result == DD_OK) ? 0 : -1;
-#endif /* !IDirectDrawGammaControl_SetGammaRamp */
-}
-
-void DX5_VideoQuit(_THIS)
-{
- int i, j;
-
- /* If we're fullscreen GL, we need to reset the display */
- if ( this->screen != NULL ) {
-#ifndef NO_CHANGEDISPLAYSETTINGS
- if ( (this->screen->flags & (SDL_OPENGL|SDL_FULLSCREEN)) ==
- (SDL_OPENGL|SDL_FULLSCREEN) ) {
- ChangeDisplaySettings(NULL, 0);
- ShowWindow(SDL_Window, SW_HIDE);
- }
-#endif
- if ( this->screen->flags & SDL_OPENGL ) {
- WIN_GL_ShutDown(this);
- }
- }
-
- /* Free any palettes we used */
- if ( SDL_palette != NULL ) {
- IDirectDrawPalette_Release(SDL_palette);
- SDL_palette = NULL;
- }
-
- /* Allow the primary surface to be freed */
- if ( SDL_primary != NULL ) {
- SDL_primary = NULL;
- }
-
- /* Free video mode lists */
- for ( i=0; i<NUM_MODELISTS; ++i ) {
- if ( SDL_modelist[i] != NULL ) {
- for ( j=0; SDL_modelist[i][j]; ++j )
- SDL_free(SDL_modelist[i][j]);
- SDL_free(SDL_modelist[i]);
- SDL_modelist[i] = NULL;
- }
- }
-
- /* Free the window */
- DIB_QuitGamma(this);
- if ( SDL_Window ) {
- DX5_DestroyWindow(this);
- }
-
- /* Free our window icon */
- if ( screen_icn ) {
- DestroyIcon(screen_icn);
- screen_icn = NULL;
- }
-}
-
-/* Exported for the windows message loop only */
-void DX5_Activate(_THIS, BOOL active, BOOL minimized)
-{
-}
-void DX5_RealizePalette(_THIS)
-{
- if ( SDL_palette ) {
- IDirectDrawSurface3_SetPalette(SDL_primary, SDL_palette);
- }
-}
-static void DX5_Recolor8Bit(_THIS, SDL_Surface *surface, Uint8 *mapping)
-{
- int row, col;
- Uint8 *pixels;
-
- if ( surface->w && surface->h ) {
- if ( (surface->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
- if ( this->LockHWSurface(this, surface) < 0 ) {
- return;
- }
- }
- for ( row=0; row<surface->h; ++row ) {
- pixels = (Uint8 *)surface->pixels+row*surface->pitch;
- for ( col=0; col<surface->w; ++col, ++pixels ) {
- *pixels = mapping[*pixels];
- }
- }
- if ( (surface->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
- this->UnlockHWSurface(this, surface);
- }
- SDL_UpdateRect(surface, 0, 0, 0, 0);
- }
-}
-void DX5_PaletteChanged(_THIS, HWND window)
-{
- SDL_Palette *palette;
- SDL_Color *saved = NULL;
- HDC hdc;
- int i;
- PALETTEENTRY *entries;
-
- /* This is true when the window is closing */
- if ( (SDL_primary == NULL) || (SDL_VideoSurface == NULL) )
- return;
-
- /* We need to get the colors as they were set */
- palette = this->physpal;
- if(!palette)
- palette = SDL_VideoSurface->format->palette;
- if ( palette == NULL ) { /* Sometimes we don't have a palette */
- return;
- }
- entries = SDL_stack_alloc(PALETTEENTRY, palette->ncolors);
- hdc = GetDC(window);
- GetSystemPaletteEntries(hdc, 0, palette->ncolors, entries);
- ReleaseDC(window, hdc);
- if ( ! colorchange_expected ) {
- saved = SDL_stack_alloc(SDL_Color, palette->ncolors);
- SDL_memcpy(saved, palette->colors,
- palette->ncolors*sizeof(SDL_Color));
- }
- for ( i=0; i<palette->ncolors; ++i ) {
- palette->colors[i].r = entries[i].peRed;
- palette->colors[i].g = entries[i].peGreen;
- palette->colors[i].b = entries[i].peBlue;
- }
- SDL_stack_free(entries);
- if ( ! colorchange_expected ) {
- Uint8 mapping[256];
-
- SDL_memset(mapping, 0, sizeof(mapping));
- for ( i=0; i<palette->ncolors; ++i ) {
- mapping[i] = SDL_FindColor(palette,
- saved[i].r, saved[i].g, saved[i].b);
- }
- DX5_Recolor8Bit(this, SDL_VideoSurface, mapping);
- SDL_stack_free(saved);
- }
- colorchange_expected = 0;
-
- /* Notify all mapped surfaces of the change */
- SDL_FormatChanged(SDL_VideoSurface);
-}
-
-/* Exported for the windows message loop only */
-void DX5_WinPAINT(_THIS, HDC hdc)
-{
- SDL_UpdateRect(SDL_PublicSurface, 0, 0, 0, 0);
-}
diff --git a/distrib/sdl-1.2.12/src/video/windx5/SDL_dx5video.h b/distrib/sdl-1.2.12/src/video/windx5/SDL_dx5video.h
deleted file mode 100644
index 35c7369..0000000
--- a/distrib/sdl-1.2.12/src/video/windx5/SDL_dx5video.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_dx5video_h
-#define _SDL_dx5video_h
-
-#include "directx.h"
-
-/* Private display data */
-struct SDL_PrivateVideoData {
- LPDIRECTDRAW2 ddraw2;
- LPDIRECTDRAWSURFACE3 SDL_primary;
- LPDIRECTDRAWCLIPPER SDL_clipper;
- LPDIRECTDRAWPALETTE SDL_palette;
- PALETTEENTRY SDL_colors[256];
- int colorchange_expected;
-
-#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
- int SDL_nummodes[NUM_MODELISTS];
- SDL_Rect **SDL_modelist[NUM_MODELISTS];
- int SDL_modeindex[NUM_MODELISTS];
-};
-/* Old variable names */
-#define ddraw2 (this->hidden->ddraw2)
-#define SDL_primary (this->hidden->SDL_primary)
-#define SDL_clipper (this->hidden->SDL_clipper)
-#define SDL_palette (this->hidden->SDL_palette)
-#define SDL_colors (this->hidden->SDL_colors)
-#define colorchange_expected (this->hidden->colorchange_expected)
-#define SDL_nummodes (this->hidden->SDL_nummodes)
-#define SDL_modelist (this->hidden->SDL_modelist)
-#define SDL_modeindex (this->hidden->SDL_modeindex)
-
-/* DirectX function pointers for video and events */
-extern HRESULT (WINAPI *DDrawCreate)( GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter );
-extern HRESULT (WINAPI *DInputCreate)(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUT *ppDI, LPUNKNOWN punkOuter);
-
-/* DirectDraw error reporting function */
-extern void SetDDerror(const char *function, int code);
-
-#endif /* _SDL_dx5video_h */
diff --git a/distrib/sdl-1.2.12/src/video/windx5/SDL_dx5yuv.c b/distrib/sdl-1.2.12/src/video/windx5/SDL_dx5yuv.c
deleted file mode 100644
index 2457dac..0000000
--- a/distrib/sdl-1.2.12/src/video/windx5/SDL_dx5yuv.c
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This is the DirectDraw implementation of YUV video overlays */
-
-#include "SDL_video.h"
-#include "SDL_dx5yuv_c.h"
-#include "../SDL_yuvfuncs.h"
-
-//#define USE_DIRECTX_OVERLAY
-
-/* The functions used to manipulate software video overlays */
-static struct private_yuvhwfuncs dx5_yuvfuncs = {
- DX5_LockYUVOverlay,
- DX5_UnlockYUVOverlay,
- DX5_DisplayYUVOverlay,
- DX5_FreeYUVOverlay
-};
-
-struct private_yuvhwdata {
- LPDIRECTDRAWSURFACE3 surface;
-
- /* These are just so we don't have to allocate them separately */
- Uint16 pitches[3];
- Uint8 *planes[3];
-};
-
-
-static LPDIRECTDRAWSURFACE3 CreateYUVSurface(_THIS,
- int width, int height, Uint32 format)
-{
- HRESULT result;
- LPDIRECTDRAWSURFACE dd_surface1;
- LPDIRECTDRAWSURFACE3 dd_surface3;
- DDSURFACEDESC ddsd;
-
- /* Set up the surface description */
- SDL_memset(&ddsd, 0, sizeof(ddsd));
- ddsd.dwSize = sizeof(ddsd);
- ddsd.dwFlags = (DDSD_WIDTH|DDSD_HEIGHT|DDSD_CAPS|DDSD_PIXELFORMAT);
- ddsd.dwWidth = width;
- ddsd.dwHeight= height;
-#ifdef USE_DIRECTX_OVERLAY
- ddsd.ddsCaps.dwCaps = (DDSCAPS_OVERLAY|DDSCAPS_VIDEOMEMORY);
-#else
- ddsd.ddsCaps.dwCaps = (DDSCAPS_OFFSCREENPLAIN|DDSCAPS_VIDEOMEMORY);
-#endif
- ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
- ddsd.ddpfPixelFormat.dwFlags = DDPF_FOURCC;
- ddsd.ddpfPixelFormat.dwFourCC = format;
-
- /* Create the DirectDraw video surface */
- result = IDirectDraw2_CreateSurface(ddraw2, &ddsd, &dd_surface1, NULL);
- if ( result != DD_OK ) {
- SetDDerror("DirectDraw2::CreateSurface", result);
- return(NULL);
- }
- result = IDirectDrawSurface_QueryInterface(dd_surface1,
- &IID_IDirectDrawSurface3, (LPVOID *)&dd_surface3);
- IDirectDrawSurface_Release(dd_surface1);
- if ( result != DD_OK ) {
- SetDDerror("DirectDrawSurface::QueryInterface", result);
- return(NULL);
- }
-
- /* Make sure the surface format was set properly */
- SDL_memset(&ddsd, 0, sizeof(ddsd));
- ddsd.dwSize = sizeof(ddsd);
- result = IDirectDrawSurface3_Lock(dd_surface3, NULL,
- &ddsd, DDLOCK_NOSYSLOCK, NULL);
- if ( result != DD_OK ) {
- SetDDerror("DirectDrawSurface3::Lock", result);
- IDirectDrawSurface_Release(dd_surface3);
- return(NULL);
- }
- IDirectDrawSurface3_Unlock(dd_surface3, NULL);
-
- if ( !(ddsd.ddpfPixelFormat.dwFlags & DDPF_FOURCC) ||
- (ddsd.ddpfPixelFormat.dwFourCC != format) ) {
- SDL_SetError("DDraw didn't use requested FourCC format");
- IDirectDrawSurface_Release(dd_surface3);
- return(NULL);
- }
-
- /* We're ready to go! */
- return(dd_surface3);
-}
-
-#ifdef DEBUG_YUV
-static char *PrintFOURCC(Uint32 code)
-{
- static char buf[5];
-
- buf[3] = code >> 24;
- buf[2] = (code >> 16) & 0xFF;
- buf[1] = (code >> 8) & 0xFF;
- buf[0] = (code & 0xFF);
- return(buf);
-}
-#endif
-
-SDL_Overlay *DX5_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display)
-{
- SDL_Overlay *overlay;
- struct private_yuvhwdata *hwdata;
-
-#ifdef DEBUG_YUV
- DWORD numcodes;
- DWORD *codes;
-
- printf("FOURCC format requested: 0x%x\n", PrintFOURCC(format));
- IDirectDraw2_GetFourCCCodes(ddraw2, &numcodes, NULL);
- if ( numcodes ) {
- DWORD i;
- codes = SDL_malloc(numcodes*sizeof(*codes));
- if ( codes ) {
- IDirectDraw2_GetFourCCCodes(ddraw2, &numcodes, codes);
- for ( i=0; i<numcodes; ++i ) {
- fprintf(stderr, "Code %d: 0x%x\n", i, PrintFOURCC(codes[i]));
- }
- SDL_free(codes);
- }
- } else {
- fprintf(stderr, "No FOURCC codes supported\n");
- }
-#endif
-
- /* Create the overlay structure */
- overlay = (SDL_Overlay *)SDL_malloc(sizeof *overlay);
- if ( overlay == NULL ) {
- SDL_OutOfMemory();
- return(NULL);
- }
- SDL_memset(overlay, 0, (sizeof *overlay));
-
- /* Fill in the basic members */
- overlay->format = format;
- overlay->w = width;
- overlay->h = height;
-
- /* Set up the YUV surface function structure */
- overlay->hwfuncs = &dx5_yuvfuncs;
-
- /* Create the pixel data and lookup tables */
- hwdata = (struct private_yuvhwdata *)SDL_malloc(sizeof *hwdata);
- overlay->hwdata = hwdata;
- if ( hwdata == NULL ) {
- SDL_OutOfMemory();
- SDL_FreeYUVOverlay(overlay);
- return(NULL);
- }
- hwdata->surface = CreateYUVSurface(this, width, height, format);
- if ( hwdata->surface == NULL ) {
- SDL_FreeYUVOverlay(overlay);
- return(NULL);
- }
- overlay->hw_overlay = 1;
-
- /* Set up the plane pointers */
- overlay->pitches = hwdata->pitches;
- overlay->pixels = hwdata->planes;
- switch (format) {
- case SDL_YV12_OVERLAY:
- case SDL_IYUV_OVERLAY:
- overlay->planes = 3;
- break;
- default:
- overlay->planes = 1;
- break;
- }
-
- /* We're all done.. */
- return(overlay);
-}
-
-int DX5_LockYUVOverlay(_THIS, SDL_Overlay *overlay)
-{
- HRESULT result;
- LPDIRECTDRAWSURFACE3 surface;
- DDSURFACEDESC ddsd;
-
- surface = overlay->hwdata->surface;
- SDL_memset(&ddsd, 0, sizeof(ddsd));
- ddsd.dwSize = sizeof(ddsd);
- result = IDirectDrawSurface3_Lock(surface, NULL,
- &ddsd, DDLOCK_NOSYSLOCK, NULL);
- if ( result == DDERR_SURFACELOST ) {
- result = IDirectDrawSurface3_Restore(surface);
- result = IDirectDrawSurface3_Lock(surface, NULL, &ddsd,
- (DDLOCK_NOSYSLOCK|DDLOCK_WAIT), NULL);
- }
- if ( result != DD_OK ) {
- SetDDerror("DirectDrawSurface3::Lock", result);
- return(-1);
- }
-
- /* Find the pitch and offset values for the overlay */
-#if defined(NONAMELESSUNION)
- overlay->pitches[0] = (Uint16)ddsd.u1.lPitch;
-#else
- overlay->pitches[0] = (Uint16)ddsd.lPitch;
-#endif
- overlay->pixels[0] = (Uint8 *)ddsd.lpSurface;
- switch (overlay->format) {
- case SDL_YV12_OVERLAY:
- case SDL_IYUV_OVERLAY:
- /* Add the two extra planes */
- overlay->pitches[1] = overlay->pitches[0] / 2;
- overlay->pitches[2] = overlay->pitches[0] / 2;
- overlay->pixels[1] = overlay->pixels[0] +
- overlay->pitches[0] * overlay->h;
- overlay->pixels[2] = overlay->pixels[1] +
- overlay->pitches[1] * overlay->h / 2;
- break;
- default:
- /* Only one plane, no worries */
- break;
- }
- return(0);
-}
-
-void DX5_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay)
-{
- LPDIRECTDRAWSURFACE3 surface;
-
- surface = overlay->hwdata->surface;
- IDirectDrawSurface3_Unlock(surface, NULL);
-}
-
-int DX5_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst)
-{
- HRESULT result;
- LPDIRECTDRAWSURFACE3 surface;
- RECT srcrect, dstrect;
-
- surface = overlay->hwdata->surface;
- srcrect.top = src->y;
- srcrect.bottom = srcrect.top+src->h;
- srcrect.left = src->x;
- srcrect.right = srcrect.left+src->w;
- dstrect.top = SDL_bounds.top+dst->y;
- dstrect.left = SDL_bounds.left+dst->x;
- dstrect.bottom = dstrect.top+dst->h;
- dstrect.right = dstrect.left+dst->w;
-#ifdef USE_DIRECTX_OVERLAY
- result = IDirectDrawSurface3_UpdateOverlay(surface, &srcrect,
- SDL_primary, &dstrect, DDOVER_SHOW, NULL);
- if ( result != DD_OK ) {
- SetDDerror("DirectDrawSurface3::UpdateOverlay", result);
- return(-1);
- }
-#else
- result = IDirectDrawSurface3_Blt(SDL_primary, &dstrect, surface, &srcrect,
- DDBLT_WAIT, NULL);
- if ( result != DD_OK ) {
- SetDDerror("DirectDrawSurface3::Blt", result);
- return(-1);
- }
-#endif
- return(0);
-}
-
-void DX5_FreeYUVOverlay(_THIS, SDL_Overlay *overlay)
-{
- struct private_yuvhwdata *hwdata;
-
- hwdata = overlay->hwdata;
- if ( hwdata ) {
- if ( hwdata->surface ) {
- IDirectDrawSurface_Release(hwdata->surface);
- }
- SDL_free(hwdata);
- }
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/windx5/SDL_dx5yuv_c.h b/distrib/sdl-1.2.12/src/video/windx5/SDL_dx5yuv_c.h
deleted file mode 100644
index c6afb68..0000000
--- a/distrib/sdl-1.2.12/src/video/windx5/SDL_dx5yuv_c.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This is the DirectDraw implementation of YUV video overlays */
-
-#include "SDL_video.h"
-#include "../wincommon/SDL_lowvideo.h"
-#include "SDL_dx5video.h"
-
-extern SDL_Overlay *DX5_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display);
-
-extern int DX5_LockYUVOverlay(_THIS, SDL_Overlay *overlay);
-
-extern void DX5_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay);
-
-extern int DX5_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst);
-
-extern void DX5_FreeYUVOverlay(_THIS, SDL_Overlay *overlay);
diff --git a/distrib/sdl-1.2.12/src/video/windx5/directx.h b/distrib/sdl-1.2.12/src/video/windx5/directx.h
deleted file mode 100644
index d14d6c6..0000000
--- a/distrib/sdl-1.2.12/src/video/windx5/directx.h
+++ /dev/null
@@ -1,84 +0,0 @@
-
-#ifndef _directx_h
-#define _directx_h
-
-/* Include all of the DirectX 5.0 headers and adds any necessary tweaks */
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <mmsystem.h>
-#ifndef WIN32
-#define WIN32
-#endif
-#undef WINNT
-
-/* Far pointers don't exist in 32-bit code */
-#ifndef FAR
-#define FAR
-#endif
-
-/* Error codes not yet included in Win32 API header files */
-#ifndef MAKE_HRESULT
-#define MAKE_HRESULT(sev,fac,code) \
- ((HRESULT)(((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))))
-#endif
-
-#ifndef S_OK
-#define S_OK (HRESULT)0x00000000L
-#endif
-
-#ifndef SUCCEEDED
-#define SUCCEEDED(x) ((HRESULT)(x) >= 0)
-#endif
-#ifndef FAILED
-#define FAILED(x) ((HRESULT)(x)<0)
-#endif
-
-#ifndef E_FAIL
-#define E_FAIL (HRESULT)0x80000008L
-#endif
-#ifndef E_NOINTERFACE
-#define E_NOINTERFACE (HRESULT)0x80004002L
-#endif
-#ifndef E_OUTOFMEMORY
-#define E_OUTOFMEMORY (HRESULT)0x8007000EL
-#endif
-#ifndef E_INVALIDARG
-#define E_INVALIDARG (HRESULT)0x80070057L
-#endif
-#ifndef E_NOTIMPL
-#define E_NOTIMPL (HRESULT)0x80004001L
-#endif
-#ifndef REGDB_E_CLASSNOTREG
-#define REGDB_E_CLASSNOTREG (HRESULT)0x80040154L
-#endif
-
-/* Severity codes */
-#ifndef SEVERITY_ERROR
-#define SEVERITY_ERROR 1
-#endif
-
-/* Error facility codes */
-#ifndef FACILITY_WIN32
-#define FACILITY_WIN32 7
-#endif
-
-#ifndef FIELD_OFFSET
-#define FIELD_OFFSET(type, field) ((LONG)&(((type *)0)->field))
-#endif
-
-/* DirectX headers (if it isn't included, I haven't tested it yet)
- */
-/* We need these defines to mark what version of DirectX API we use */
-#define DIRECTDRAW_VERSION 0x0700
-#define DIRECTSOUND_VERSION 0x0500
-#define DIRECTINPUT_VERSION 0x0500
-
-#ifdef __GNUC__
-#define NONAMELESSUNION
-#endif
-#include <ddraw.h>
-#include <dsound.h>
-#include <dinput.h>
-
-#endif /* _directx_h */
diff --git a/distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsevents.c b/distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsevents.c
deleted file mode 100644
index 8a4d054..0000000
--- a/distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsevents.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <sys/types.h>
-#include <dev/wscons/wsdisplay_usl_io.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <termios.h>
-#include <errno.h>
-#include <string.h>
-
-#include "SDL.h"
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_wsconsvideo.h"
-#include "SDL_wsconsevents_c.h"
-
-static int posted = 0;
-
-int WSCONS_InitKeyboard(_THIS)
-{
- struct termios tty;
-
- if (ioctl(private->fd, WSKBDIO_GTYPE, &private->kbdType) == -1) {
- WSCONS_ReportError("cannot get keyboard type: %s", strerror(errno));
- return -1;
- }
-
- if (tcgetattr(private->fd, &private->saved_tty) == -1) {
- WSCONS_ReportError("cannot get terminal attributes: %s", strerror(errno));
- return -1;
- }
- private->did_save_tty = 1;
- tty = private->saved_tty;
- tty.c_iflag = IGNPAR | IGNBRK;
- tty.c_oflag = 0;
- tty.c_cflag = CREAD | CS8;
- tty.c_lflag = 0;
- tty.c_cc[VTIME] = 0;
- tty.c_cc[VMIN] = 1;
- cfsetispeed(&tty, 9600);
- cfsetospeed(&tty, 9600);
- if (tcsetattr(private->fd, TCSANOW, &tty) < 0) {
- WSCONS_ReportError("cannot set terminal attributes: %s", strerror(errno));
- return -1;
- }
- if (ioctl(private->fd, KDSKBMODE, K_RAW) == -1) {
- WSCONS_ReportError("cannot set raw keyboard mode: %s", strerror(errno));
- return -1;
- }
-
- return 0;
-}
-
-void WSCONS_ReleaseKeyboard(_THIS)
-{
- if (private->fd != -1) {
- if (ioctl(private->fd, KDSKBMODE, K_XLATE) == -1) {
- WSCONS_ReportError("cannot restore keyboard to translated mode: %s",
- strerror(errno));
- }
- if (private->did_save_tty) {
- if (tcsetattr(private->fd, TCSANOW, &private->saved_tty) < 0) {
- WSCONS_ReportError("cannot restore keynoard attributes: %s",
- strerror(errno));
- }
- }
- }
-}
-
-static void updateMouse()
-{
-}
-
-static SDLKey keymap[128];
-
-static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym)
-{
- keysym->scancode = scancode;
- keysym->sym = SDLK_UNKNOWN;
- keysym->mod = KMOD_NONE;
-
- if (scancode < SDL_arraysize(keymap))
- keysym->sym = keymap[scancode];
-
- if (keysym->sym == SDLK_UNKNOWN)
- printf("Unknown mapping for scancode %d\n", scancode);
-
- return keysym;
-}
-
-static void updateKeyboard(_THIS)
-{
- unsigned char buf[100];
- SDL_keysym keysym;
- int n, i;
-
- if ((n = read(private->fd, buf, sizeof(buf))) > 0) {
- for (i = 0; i < n; i++) {
- unsigned char c = buf[i] & 0x7f;
- if (c == 224) // special key prefix -- what should we do with it?
- continue;
- posted += SDL_PrivateKeyboard((buf[i] & 0x80) ? SDL_RELEASED : SDL_PRESSED,
- TranslateKey(c, &keysym));
- }
- }
-}
-
-void WSCONS_PumpEvents(_THIS)
-{
- do {
- posted = 0;
- updateMouse();
- updateKeyboard(this);
- } while (posted);
-}
-
-void WSCONS_InitOSKeymap(_THIS)
-{
- int i;
-
- /* Make sure unknown keys are mapped correctly */
- for (i=0; i < SDL_arraysize(keymap); i++) {
- keymap[i] = SDLK_UNKNOWN;
- }
-
- switch (private->kbdType) {
-#ifdef WSKBD_TYPE_ZAURUS
- case WSKBD_TYPE_ZAURUS:
- /* top row */
- keymap[2] = SDLK_1;
- keymap[3] = SDLK_2;
- keymap[4] = SDLK_3;
- keymap[5] = SDLK_4;
- keymap[6] = SDLK_5;
- keymap[7] = SDLK_6;
- keymap[8] = SDLK_7;
- keymap[9] = SDLK_8;
- keymap[10] = SDLK_9;
- keymap[11] = SDLK_0;
- keymap[14] = SDLK_BACKSPACE;
-
- /* second row */
- keymap[16] = SDLK_q;
- keymap[17] = SDLK_w;
- keymap[18] = SDLK_e;
- keymap[19] = SDLK_r;
- keymap[20] = SDLK_t;
- keymap[21] = SDLK_y;
- keymap[22] = SDLK_u;
- keymap[23] = SDLK_i;
- keymap[24] = SDLK_o;
- keymap[25] = SDLK_p;
-
- /* third row */
- keymap[15] = SDLK_TAB;
- keymap[30] = SDLK_a;
- keymap[31] = SDLK_s;
- keymap[32] = SDLK_d;
- keymap[33] = SDLK_f;
- keymap[34] = SDLK_g;
- keymap[35] = SDLK_h;
- keymap[36] = SDLK_j;
- keymap[37] = SDLK_k;
- keymap[38] = SDLK_l;
-
- /* fourth row */
- keymap[42] = SDLK_LSHIFT;
- keymap[44] = SDLK_z;
- keymap[45] = SDLK_x;
- keymap[46] = SDLK_c;
- keymap[47] = SDLK_v;
- keymap[48] = SDLK_b;
- keymap[49] = SDLK_n;
- keymap[50] = SDLK_m;
- keymap[54] = SDLK_RSHIFT;
- keymap[28] = SDLK_RETURN;
-
- /* fifth row */
- keymap[56] = SDLK_LALT;
- keymap[29] = SDLK_LCTRL;
- /* keymap[56] = ; */
- keymap[0] = SDLK_LSUPER;
- keymap[12] = SDLK_MINUS;
- keymap[57] = SDLK_SPACE;
- keymap[51] = SDLK_COMMA;
- keymap[52] = SDLK_PERIOD;
-
- /* misc */
- keymap[59] = SDLK_F1;
- keymap[60] = SDLK_F2;
- keymap[61] = SDLK_F3;
- keymap[62] = SDLK_F4;
- keymap[63] = SDLK_F5;
- keymap[1] = SDLK_ESCAPE;
- /* keymap[28] = SDLK_KP_ENTER; */
- keymap[72] = SDLK_UP;
- keymap[75] = SDLK_LEFT;
- keymap[77] = SDLK_RIGHT;
- keymap[80] = SDLK_DOWN;
- break;
-#endif /* WSKBD_TYPE_ZAURUS */
-
- default:
- WSCONS_ReportError("Unable to map keys for keyboard type %u",
- private->kbdType);
- break;
- }
-}
-
-/* end of SDL_wsconsevents.c ... */
-
diff --git a/distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsevents_c.h b/distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsevents_c.h
deleted file mode 100644
index 57a1bfe..0000000
--- a/distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsevents_c.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_wsconsvideo.h"
-
-int WSCONS_InitKeyboard(_THIS);
-void WSCONS_ReleaseKeyboard(_THIS);
-
-/* Variables and functions exported by SDL_sysevents.c to other parts
- of the native video subsystem (SDL_sysvideo.c)
-*/
-extern void WSCONS_InitOSKeymap(_THIS);
-extern void WSCONS_PumpEvents(_THIS);
-
-/* end of SDL_wsconsevents_c.h ... */
-
diff --git a/distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsmouse.c b/distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsmouse.c
deleted file mode 100644
index f74c226..0000000
--- a/distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsmouse.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_mouse.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_wsconsmouse_c.h"
-
-
-/* The implementation dependent data for the window manager cursor */
-struct WMcursor {
- int unused;
-};
diff --git a/distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsmouse_c.h b/distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsmouse_c.h
deleted file mode 100644
index 30d0ec2..0000000
--- a/distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsmouse_c.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_wsconsvideo.h"
-
-/* Functions to be exported */
diff --git a/distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsvideo.c b/distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsvideo.c
deleted file mode 100644
index 45f99c1..0000000
--- a/distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsvideo.c
+++ /dev/null
@@ -1,609 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <sys/time.h>
-#include <sys/mman.h>
-#include <sys/ioctl.h>
-#include <dev/wscons/wsdisplay_usl_io.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-
-#include "SDL_wsconsvideo.h"
-#include "SDL_wsconsevents_c.h"
-#include "SDL_wsconsmouse_c.h"
-
-#define WSCONSVID_DRIVER_NAME "wscons"
-enum {
- WSCONS_ROTATE_NONE = 0,
- WSCONS_ROTATE_CCW = 90,
- WSCONS_ROTATE_UD = 180,
- WSCONS_ROTATE_CW = 270
-};
-
-#define min(a,b) ((a)<(b)?(a):(b))
-
-/* Initialization/Query functions */
-static int WSCONS_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **WSCONS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *WSCONS_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int WSCONS_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
-static void WSCONS_VideoQuit(_THIS);
-
-/* Hardware surface functions */
-static int WSCONS_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int WSCONS_LockHWSurface(_THIS, SDL_Surface *surface);
-static void WSCONS_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static void WSCONS_FreeHWSurface(_THIS, SDL_Surface *surface);
-
-/* etc. */
-static WSCONS_bitBlit WSCONS_blit16;
-static WSCONS_bitBlit WSCONS_blit16blocked;
-static void WSCONS_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
-
-void WSCONS_ReportError(char *fmt, ...)
-{
- char message[200];
- va_list vaArgs;
-
- message[199] = '\0';
-
- va_start(vaArgs, fmt);
- vsnprintf(message, 199, fmt, vaArgs);
- va_end(vaArgs);
-
- SDL_SetError(message);
- fprintf(stderr, "WSCONS error: %s\n", message);
-}
-
-/* WSCONS driver bootstrap functions */
-
-static int WSCONS_Available(void)
-{
- return 1;
-}
-
-static void WSCONS_DeleteDevice(SDL_VideoDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_VideoDevice *WSCONS_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if (device == NULL) {
- SDL_OutOfMemory();
- return 0;
- }
- SDL_memset(device, 0, (sizeof *device));
- device->hidden =
- (struct SDL_PrivateVideoData *)SDL_malloc((sizeof *device->hidden));
- if (device->hidden == NULL) {
- SDL_OutOfMemory();
- SDL_free(device);
- return(0);
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
- device->hidden->fd = -1;
-
- /* Set the function pointers */
- device->VideoInit = WSCONS_VideoInit;
- device->ListModes = WSCONS_ListModes;
- device->SetVideoMode = WSCONS_SetVideoMode;
- device->SetColors = WSCONS_SetColors;
- device->UpdateRects = WSCONS_UpdateRects;
- device->VideoQuit = WSCONS_VideoQuit;
- device->AllocHWSurface = WSCONS_AllocHWSurface;
- device->LockHWSurface = WSCONS_LockHWSurface;
- device->UnlockHWSurface = WSCONS_UnlockHWSurface;
- device->FreeHWSurface = WSCONS_FreeHWSurface;
- device->InitOSKeymap = WSCONS_InitOSKeymap;
- device->PumpEvents = WSCONS_PumpEvents;
- device->free = WSCONS_DeleteDevice;
-
- return device;
-}
-
-VideoBootStrap WSCONS_bootstrap = {
- WSCONSVID_DRIVER_NAME,
- "SDL wscons video driver",
- WSCONS_Available,
- WSCONS_CreateDevice
-};
-
-#define WSCONSDEV_FORMAT "/dev/ttyC%01x"
-
-int WSCONS_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- char devnamebuf[30];
- char *devname;
- char *rotation;
- int wstype;
- int wsmode = WSDISPLAYIO_MODE_DUMBFB;
- size_t len, mapsize;
- int pagemask;
- int width, height;
-
- devname = SDL_getenv("SDL_WSCONSDEV");
- if (devname == NULL) {
- int activeVT;
- if (ioctl(STDIN_FILENO, VT_GETACTIVE, &activeVT) == -1) {
- WSCONS_ReportError("Unable to determine active terminal: %s",
- strerror(errno));
- return -1;
- }
- SDL_snprintf(devnamebuf, sizeof(devnamebuf), WSCONSDEV_FORMAT, activeVT - 1);
- devname = devnamebuf;
- }
-
- private->fd = open(devname, O_RDWR | O_NONBLOCK, 0);
- if (private->fd == -1) {
- WSCONS_ReportError("open %s: %s", devname, strerror(errno));
- return -1;
- }
- if (ioctl(private->fd, WSDISPLAYIO_GINFO, &private->info) == -1) {
- WSCONS_ReportError("ioctl WSDISPLAY_GINFO: %s", strerror(errno));
- return -1;
- }
- if (ioctl(private->fd, WSDISPLAYIO_GTYPE, &wstype) == -1) {
- WSCONS_ReportError("ioctl WSDISPLAY_GTYPE: %s", strerror(errno));
- return -1;
- }
- if (ioctl(private->fd, WSDISPLAYIO_LINEBYTES, &private->physlinebytes) == -1) {
- WSCONS_ReportError("ioctl WSDISPLAYIO_LINEBYTES: %s", strerror(errno));
- return -1;
- }
- if (private->info.depth > 8) {
- if (wstype == WSDISPLAY_TYPE_SUN24 ||
- wstype == WSDISPLAY_TYPE_SUNCG12 ||
- wstype == WSDISPLAY_TYPE_SUNCG14 ||
- wstype == WSDISPLAY_TYPE_SUNTCX ||
- wstype == WSDISPLAY_TYPE_SUNFFB) {
- private->redMask = 0x0000ff;
- private->greenMask = 0x00ff00;
- private->blueMask = 0xff0000;
-#ifdef WSDISPLAY_TYPE_PXALCD
- } else if (wstype == WSDISPLAY_TYPE_PXALCD) {
- private->redMask = 0x1f << 11;
- private->greenMask = 0x3f << 5;
- private->blueMask = 0x1f;
-#endif
- } else {
- WSCONS_ReportError("Unknown video hardware");
- return -1;
- }
- } else {
- WSCONS_ReportError("Displays with 8 bpp or less are not supported");
- return -1;
- }
-
- private->rotate = WSCONS_ROTATE_NONE;
- rotation = SDL_getenv("SDL_VIDEO_WSCONS_ROTATION");
- if (rotation != NULL) {
- if (SDL_strlen(rotation) == 0) {
- private->shadowFB = 0;
- private->rotate = WSCONS_ROTATE_NONE;
- printf("Not rotating, no shadow\n");
- } else if (!SDL_strcmp(rotation, "NONE")) {
- private->shadowFB = 1;
- private->rotate = WSCONS_ROTATE_NONE;
- printf("Not rotating, but still using shadow\n");
- } else if (!SDL_strcmp(rotation, "CW")) {
- private->shadowFB = 1;
- private->rotate = WSCONS_ROTATE_CW;
- printf("Rotating screen clockwise\n");
- } else if (!SDL_strcmp(rotation, "CCW")) {
- private->shadowFB = 1;
- private->rotate = WSCONS_ROTATE_CCW;
- printf("Rotating screen counter clockwise\n");
- } else if (!SDL_strcmp(rotation, "UD")) {
- private->shadowFB = 1;
- private->rotate = WSCONS_ROTATE_UD;
- printf("Rotating screen upside down\n");
- } else {
- WSCONS_ReportError("\"%s\" is not a valid value for "
- "SDL_VIDEO_WSCONS_ROTATION", rotation);
- return -1;
- }
- }
-
- switch (private->info.depth) {
- case 1:
- case 4:
- case 8:
- len = private->physlinebytes * private->info.height;
- break;
- case 16:
- if (private->physlinebytes == private->info.width) {
- len = private->info.width * private->info.height * sizeof(short);
- } else {
- len = private->physlinebytes * private->info.height;
- }
- if (private->rotate == WSCONS_ROTATE_NONE ||
- private->rotate == WSCONS_ROTATE_UD) {
- private->blitFunc = WSCONS_blit16;
- } else {
- private->blitFunc = WSCONS_blit16blocked;
- }
- break;
- case 32:
- if (private->physlinebytes == private->info.width) {
- len = private->info.width * private->info.height * sizeof(int);
- } else {
- len = private->physlinebytes * private->info.height;
- }
- break;
- default:
- WSCONS_ReportError("unsupported depth %d", private->info.depth);
- return -1;
- }
-
- if (private->shadowFB && private->blitFunc == NULL) {
- WSCONS_ReportError("Using software buffer, but no blitter function is "
- "available for this %d bpp.", private->info.depth);
- return -1;
- }
-
- if (ioctl(private->fd, WSDISPLAYIO_SMODE, &wsmode) == -1) {
- WSCONS_ReportError("ioctl SMODE");
- return -1;
- }
-
- pagemask = getpagesize() - 1;
- mapsize = ((int)len + pagemask) & ~pagemask;
- private->physmem = (Uint8 *)mmap(NULL, mapsize,
- PROT_READ | PROT_WRITE, MAP_SHARED,
- private->fd, (off_t)0);
- if (private->physmem == (Uint8 *)MAP_FAILED) {
- private->physmem = NULL;
- WSCONS_ReportError("mmap: %s", strerror(errno));
- return -1;
- }
- private->fbmem_len = len;
-
- if (private->rotate == WSCONS_ROTATE_CW ||
- private->rotate == WSCONS_ROTATE_CCW) {
- width = private->info.height;
- height = private->info.width;
- } else {
- width = private->info.width;
- height = private->info.height;
- }
-
- this->info.current_w = width;
- this->info.current_h = height;
-
- if (private->shadowFB) {
- private->shadowmem = (Uint8 *)SDL_malloc(len);
- if (private->shadowmem == NULL) {
- WSCONS_ReportError("No memory for shadow");
- return -1;
- }
- private->fbstart = private->shadowmem;
- private->fblinebytes = width * ((private->info.depth + 7) / 8);
- } else {
- private->fbstart = private->physmem;
- private->fblinebytes = private->physlinebytes;
- }
-
- private->SDL_modelist[0] = (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
- private->SDL_modelist[0]->w = width;
- private->SDL_modelist[0]->h = height;
-
- vformat->BitsPerPixel = private->info.depth;
- vformat->BytesPerPixel = private->info.depth / 8;
-
- if (WSCONS_InitKeyboard(this) == -1) {
- return -1;
- }
-
- return 0;
-}
-
-SDL_Rect **WSCONS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- if (format->BitsPerPixel == private->info.depth) {
- return private->SDL_modelist;
- } else {
- return NULL;
- }
-}
-
-SDL_Surface *WSCONS_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- if (width != private->SDL_modelist[0]->w ||
- height != private->SDL_modelist[0]->h) {
- WSCONS_ReportError("Requested video mode %dx%d not supported.",
- width, height);
- return NULL;
- }
- if (bpp != private->info.depth) {
- WSCONS_ReportError("Requested video depth %d bpp not supported.", bpp);
- return NULL;
- }
-
- if (!SDL_ReallocFormat(current,
- bpp,
- private->redMask,
- private->greenMask,
- private->blueMask,
- 0)) {
- WSCONS_ReportError("Couldn't allocate new pixel format");
- return NULL;
- }
-
- current->flags &= SDL_FULLSCREEN;
- if (private->shadowFB) {
- current->flags |= SDL_SWSURFACE;
- } else {
- current->flags |= SDL_HWSURFACE;
- }
- current->w = width;
- current->h = height;
- current->pitch = private->fblinebytes;
- current->pixels = private->fbstart;
-
- SDL_memset(private->fbstart, 0, private->fbmem_len);
-
- return current;
-}
-
-static int WSCONS_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- return -1;
-}
-static void WSCONS_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
-}
-
-static int WSCONS_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- return 0;
-}
-
-static void WSCONS_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
-}
-
-static void WSCONS_blit16(Uint8 *byte_src_pos,
- int srcRightDelta,
- int srcDownDelta,
- Uint8 *byte_dst_pos,
- int dst_linebytes,
- int width,
- int height)
-{
- int w;
- Uint16 *src_pos = (Uint16 *)byte_src_pos;
- Uint16 *dst_pos = (Uint16 *)byte_dst_pos;
-
- while (height) {
- Uint16 *src = src_pos;
- Uint16 *dst = dst_pos;
- for (w = width; w != 0; w--) {
- *dst = *src;
- src += srcRightDelta;
- dst++;
- }
- dst_pos = (Uint16 *)((Uint8 *)dst_pos + dst_linebytes);
- src_pos += srcDownDelta;
- height--;
- }
-}
-
-#define BLOCKSIZE_W 32
-#define BLOCKSIZE_H 32
-
-static void WSCONS_blit16blocked(Uint8 *byte_src_pos,
- int srcRightDelta,
- int srcDownDelta,
- Uint8 *byte_dst_pos,
- int dst_linebytes,
- int width,
- int height)
-{
- int w;
- Uint16 *src_pos = (Uint16 *)byte_src_pos;
- Uint16 *dst_pos = (Uint16 *)byte_dst_pos;
-
- while (height > 0) {
- Uint16 *src = src_pos;
- Uint16 *dst = dst_pos;
- for (w = width; w > 0; w -= BLOCKSIZE_W) {
- WSCONS_blit16((Uint8 *)src,
- srcRightDelta,
- srcDownDelta,
- (Uint8 *)dst,
- dst_linebytes,
- min(w, BLOCKSIZE_W),
- min(height, BLOCKSIZE_H));
- src += srcRightDelta * BLOCKSIZE_W;
- dst += BLOCKSIZE_W;
- }
- dst_pos = (Uint16 *)((Uint8 *)dst_pos + dst_linebytes * BLOCKSIZE_H);
- src_pos += srcDownDelta * BLOCKSIZE_H;
- height -= BLOCKSIZE_H;
- }
-}
-
-static void WSCONS_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
-{
- int width = private->SDL_modelist[0]->w;
- int height = private->SDL_modelist[0]->h;
- int bytesPerPixel = (private->info.depth + 7) / 8;
- int i;
-
- if (!private->shadowFB) {
- return;
- }
-
- if (private->info.depth != 16) {
- WSCONS_ReportError("Shadow copy only implemented for 16 bpp");
- return;
- }
-
- for (i = 0; i < numrects; i++) {
- int x1, y1, x2, y2;
- int scr_x1, scr_y1, scr_x2, scr_y2;
- int sha_x1, sha_y1;
- int shadowRightDelta; /* Address change when moving right in dest */
- int shadowDownDelta; /* Address change when moving down in dest */
- Uint8 *src_start;
- Uint8 *dst_start;
-
- x1 = rects[i].x;
- y1 = rects[i].y;
- x2 = x1 + rects[i].w;
- y2 = y1 + rects[i].h;
-
- if (x1 < 0) {
- x1 = 0;
- } else if (x1 > width) {
- x1 = width;
- }
- if (x2 < 0) {
- x2 = 0;
- } else if (x2 > width) {
- x2 = width;
- }
- if (y1 < 0) {
- y1 = 0;
- } else if (y1 > height) {
- y1 = height;
- }
- if (y2 < 0) {
- y2 = 0;
- } else if (y2 > height) {
- y2 = height;
- }
- if (x2 <= x1 || y2 <= y1) {
- continue;
- }
-
- switch (private->rotate) {
- case WSCONS_ROTATE_NONE:
- sha_x1 = scr_x1 = x1;
- sha_y1 = scr_y1 = y1;
- scr_x2 = x2;
- scr_y2 = y2;
- shadowRightDelta = 1;
- shadowDownDelta = width;
- break;
- case WSCONS_ROTATE_CCW:
- scr_x1 = y1;
- scr_y1 = width - x2;
- scr_x2 = y2;
- scr_y2 = width - x1;
- sha_x1 = x2 - 1;
- sha_y1 = y1;
- shadowRightDelta = width;
- shadowDownDelta = -1;
- break;
- case WSCONS_ROTATE_UD:
- scr_x1 = width - x2;
- scr_y1 = height - y2;
- scr_x2 = width - x1;
- scr_y2 = height - y1;
- sha_x1 = x2 - 1;
- sha_y1 = y2 - 1;
- shadowRightDelta = -1;
- shadowDownDelta = -width;
- break;
- case WSCONS_ROTATE_CW:
- scr_x1 = height - y2;
- scr_y1 = x1;
- scr_x2 = height - y1;
- scr_y2 = x2;
- sha_x1 = x1;
- sha_y1 = y2 - 1;
- shadowRightDelta = -width;
- shadowDownDelta = 1;
- break;
- default:
- WSCONS_ReportError("Unknown rotation");
- return;
- }
-
- src_start = private->shadowmem + (sha_y1 * width + sha_x1) * bytesPerPixel;
- dst_start = private->physmem + scr_y1 * private->physlinebytes +
- scr_x1 * bytesPerPixel;
-
- private->blitFunc(src_start,
- shadowRightDelta,
- shadowDownDelta,
- dst_start,
- private->physlinebytes,
- scr_x2 - scr_x1,
- scr_y2 - scr_y1);
- }
-}
-
-int WSCONS_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- return 0;
-}
-
-/*
- * Note: If we are terminated, this could be called in the middle of
- * another SDL video routine -- notably UpdateRects.
- */
-void WSCONS_VideoQuit(_THIS)
-{
- int mode = WSDISPLAYIO_MODE_EMUL;
-
- if (private->shadowmem != NULL) {
- SDL_free(private->shadowmem);
- private->shadowmem = NULL;
- }
- private->fbstart = NULL;
- if (this->screen != NULL) {
- this->screen->pixels = NULL;
- }
-
- if (private->SDL_modelist[0] != NULL) {
- SDL_free(private->SDL_modelist[0]);
- private->SDL_modelist[0] = NULL;
- }
-
- if (ioctl(private->fd, WSDISPLAYIO_SMODE, &mode) == -1) {
- WSCONS_ReportError("ioctl SMODE");
- }
-
- WSCONS_ReleaseKeyboard(this);
-
- if (private->fd != -1) {
- close(private->fd);
- private->fd = -1;
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsvideo.h b/distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsvideo.h
deleted file mode 100644
index 112203f..0000000
--- a/distrib/sdl-1.2.12/src/video/wscons/SDL_wsconsvideo.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_wsconsvideo_h
-#define _SDL_wsconsvideo_h
-
-#include <sys/time.h>
-#include <termios.h>
-#include <dev/wscons/wsconsio.h>
-
-#include "SDL_mouse.h"
-#include "SDL_mutex.h"
-#include "../SDL_sysvideo.h"
-
-void WSCONS_ReportError(char *fmt, ...);
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-#define private (this->hidden)
-
-/* Private display data */
-
-typedef void WSCONS_bitBlit(Uint8 *src_pos,
- int srcRightDelta, // pixels, not bytes
- int srcDownDelta, // pixels, not bytes
- Uint8 *dst_pos,
- int dst_linebytes,
- int width,
- int height);
-
-struct SDL_PrivateVideoData {
- int fd; /* file descriptor of open device */
- struct wsdisplay_fbinfo info; /* frame buffer characteristics */
- int physlinebytes; /* number of bytes per row */
- int redMask, greenMask, blueMask;
-
- Uint8 *fbstart; /* These refer to the surface used, */
- int fblinebytes; /* physical frame buffer or shadow. */
-
- size_t fbmem_len;
- Uint8 *physmem;
- Uint8 *shadowmem;
- int rotate;
- int shadowFB; /* Tells whether a shadow is being used. */
-
- WSCONS_bitBlit *blitFunc;
-
- SDL_Rect *SDL_modelist[2];
-
- unsigned int kbdType;
- int did_save_tty;
- struct termios saved_tty;
-};
-
-
-#endif /* _SDL_wsconsvideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11dga.c b/distrib/sdl-1.2.12/src/video/x11/SDL_x11dga.c
deleted file mode 100644
index d68e7d9..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11dga.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This is currently only used to enable DGA mouse.
- There is a completely separate DGA driver that is fullscreen-only.
-*/
-
-#include "SDL_video.h"
-#include "../SDL_cursor_c.h"
-#include "SDL_x11dga_c.h"
-
-/* Global for the error handler */
-int dga_event, dga_error = -1;
-
-void X11_EnableDGAMouse(_THIS)
-{
-#if SDL_VIDEO_DRIVER_X11_DGAMOUSE
- static int use_dgamouse = -1;
-
- /* Check configuration to see if we should use DGA mouse */
- if ( use_dgamouse < 0 ) {
- int dga_major, dga_minor;
- int dga_flags;
- const char *env_use_dgamouse;
-
- use_dgamouse = 1;
- env_use_dgamouse = SDL_getenv("SDL_VIDEO_X11_DGAMOUSE");
- if ( env_use_dgamouse ) {
- use_dgamouse = SDL_atoi(env_use_dgamouse);
- }
- /* Check for buggy X servers */
- if ( use_dgamouse && BUGGY_XFREE86(==, 4000) ) {
- use_dgamouse = 0;
- }
- if ( !use_dgamouse || !local_X11 ||
- !SDL_NAME(XF86DGAQueryExtension)(SDL_Display, &dga_event, &dga_error) ||
- !SDL_NAME(XF86DGAQueryVersion)(SDL_Display, &dga_major, &dga_minor) ||
- !SDL_NAME(XF86DGAQueryDirectVideo)(SDL_Display, SDL_Screen, &dga_flags) ||
- !(dga_flags & XF86DGADirectPresent) ) {
- use_dgamouse = 0;
- }
- }
-
- if ( use_dgamouse && !(using_dga & DGA_MOUSE) ) {
- if ( SDL_NAME(XF86DGADirectVideo)(SDL_Display, SDL_Screen, XF86DGADirectMouse) ) {
- using_dga |= DGA_MOUSE;
- }
- }
-#endif /* SDL_VIDEO_DRIVER_X11_DGAMOUSE */
-}
-
-/* Argh. Glide resets DGA mouse mode when it makes the context current! */
-void X11_CheckDGAMouse(_THIS)
-{
-#if SDL_VIDEO_DRIVER_X11_DGAMOUSE
- if ( using_dga & DGA_MOUSE ) {
- SDL_NAME(XF86DGADirectVideo)(SDL_Display,SDL_Screen,XF86DGADirectMouse);
- }
-#endif
-}
-
-void X11_DisableDGAMouse(_THIS)
-{
-#if SDL_VIDEO_DRIVER_X11_DGAMOUSE
- if ( using_dga & DGA_MOUSE ) {
- SDL_NAME(XF86DGADirectVideo)(SDL_Display, SDL_Screen, 0);
- using_dga &= ~DGA_MOUSE;
- }
-#endif /* SDL_VIDEO_DRIVER_X11_DGAMOUSE */
-}
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11dga_c.h b/distrib/sdl-1.2.12/src/video/x11/SDL_x11dga_c.h
deleted file mode 100644
index 53b46d5..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11dga_c.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_x11video.h"
-
-/* Different DGA access states */
-#define DGA_GRAPHICS 0x01
-#define DGA_KEYBOARD 0x02
-#define DGA_MOUSE 0x04
-
-extern void X11_EnableDGAMouse(_THIS);
-extern void X11_CheckDGAMouse(_THIS);
-extern void X11_DisableDGAMouse(_THIS);
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11dyn.c b/distrib/sdl-1.2.12/src/video/x11/SDL_x11dyn.c
deleted file mode 100644
index 7b99d73..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11dyn.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#define DEBUG_DYNAMIC_X11 0
-
-#include "SDL_x11dyn.h"
-
-#if DEBUG_DYNAMIC_X11
-#include <stdio.h>
-#endif
-
-#ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC
-
-#include "SDL_name.h"
-#include "SDL_loadso.h"
-
-typedef struct
-{
- void *lib;
- const char *libname;
-} x11dynlib;
-
-#ifndef SDL_VIDEO_DRIVER_X11_DYNAMIC
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC NULL
-#endif
-#ifndef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT NULL
-#endif
-#ifndef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER NULL
-#endif
-#ifndef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR NULL
-#endif
-
-static x11dynlib x11libs[] =
-{
- { NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC },
- { NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT },
- { NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER },
- { NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR },
-};
-
-static void X11_GetSym(const char *fnname, int *rc, void **fn)
-{
- int i;
- for (i = 0; i < SDL_TABLESIZE(x11libs); i++) {
- if (x11libs[i].lib != NULL)
- {
- *fn = SDL_LoadFunction(x11libs[i].lib, fnname);
- if (*fn != NULL)
- break;
- }
- }
-
- #if DEBUG_DYNAMIC_X11
- if (*fn != NULL)
- printf("X11: Found '%s' in %s (%p)\n", fnname, x11libs[i].libname, *fn);
- else
- printf("X11: Symbol '%s' NOT FOUND!\n", fnname);
- #endif
-
- if (*fn == NULL)
- *rc = 0; /* kill this module. */
-}
-
-
-/* Define all the function pointers and wrappers... */
-#define SDL_X11_MODULE(modname)
-#define SDL_X11_SYM(rc,fn,params,args,ret) \
- static rc (*p##fn) params = NULL; \
- rc fn params { ret p##fn args ; }
-#include "SDL_x11sym.h"
-#undef SDL_X11_MODULE
-#undef SDL_X11_SYM
-#endif /* SDL_VIDEO_DRIVER_X11_DYNAMIC */
-
-/* Annoying varargs entry point... */
-#ifdef X_HAVE_UTF8_STRING
-XIC (*pXCreateIC)(XIM,...) = NULL;
-char *(*pXGetICValues)(XIC, ...) = NULL;
-#endif
-
-/* These SDL_X11_HAVE_* flags are here whether you have dynamic X11 or not. */
-#define SDL_X11_MODULE(modname) int SDL_X11_HAVE_##modname = 1;
-#define SDL_X11_SYM(rc,fn,params,args,ret)
-#include "SDL_x11sym.h"
-#undef SDL_X11_MODULE
-#undef SDL_X11_SYM
-
-
-static int x11_load_refcount = 0;
-
-void SDL_X11_UnloadSymbols(void)
-{
- #ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC
- /* Don't actually unload if more than one module is using the libs... */
- if (x11_load_refcount > 0) {
- if (--x11_load_refcount == 0) {
- int i;
-
- /* set all the function pointers to NULL. */
- #define SDL_X11_MODULE(modname) SDL_X11_HAVE_##modname = 1;
- #define SDL_X11_SYM(rc,fn,params,args,ret) p##fn = NULL;
- #include "SDL_x11sym.h"
- #undef SDL_X11_MODULE
- #undef SDL_X11_SYM
-
- #ifdef X_HAVE_UTF8_STRING
- pXCreateIC = NULL;
- pXGetICValues = NULL;
- #endif
-
- for (i = 0; i < SDL_TABLESIZE(x11libs); i++) {
- if (x11libs[i].lib != NULL) {
- SDL_UnloadObject(x11libs[i].lib);
- x11libs[i].lib = NULL;
- }
- }
- }
- }
- #endif
-}
-
-/* returns non-zero if all needed symbols were loaded. */
-int SDL_X11_LoadSymbols(void)
-{
- int rc = 1; /* always succeed if not using Dynamic X11 stuff. */
-
- #ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC
- /* deal with multiple modules (dga, x11, etc) needing these symbols... */
- if (x11_load_refcount++ == 0) {
- int i;
- int *thismod = NULL;
- for (i = 0; i < SDL_TABLESIZE(x11libs); i++) {
- if (x11libs[i].libname != NULL) {
- x11libs[i].lib = SDL_LoadObject(x11libs[i].libname);
- }
- }
- #define SDL_X11_MODULE(modname) thismod = &SDL_X11_HAVE_##modname;
- #define SDL_X11_SYM(a,fn,x,y,z) X11_GetSym(#fn,thismod,(void**)&p##fn);
- #include "SDL_x11sym.h"
- #undef SDL_X11_MODULE
- #undef SDL_X11_SYM
-
- #ifdef X_HAVE_UTF8_STRING
- X11_GetSym("XCreateIC",&SDL_X11_HAVE_UTF8,(void **)&pXCreateIC);
- X11_GetSym("XGetICValues",&SDL_X11_HAVE_UTF8,(void **)&pXGetICValues);
- #endif
-
- if (SDL_X11_HAVE_BASEXLIB) { /* all required symbols loaded. */
- SDL_ClearError();
- XInitThreads();
- } else {
- SDL_X11_UnloadSymbols(); /* in case something got loaded... */
- rc = 0;
- }
- }
- #else
- #if DEBUG_DYNAMIC_X11
- printf("X11: No dynamic X11 support in this build of SDL.\n");
- #endif
- #ifdef X_HAVE_UTF8_STRING
- pXCreateIC = XCreateIC;
- pXGetICValues = XGetICValues;
- #endif
- #endif
-
- return rc;
-}
-
-/* end of SDL_x11dyn.c ... */
-
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11dyn.h b/distrib/sdl-1.2.12/src/video/x11/SDL_x11dyn.h
deleted file mode 100644
index 2e7e6ce..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11dyn.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_x11dyn_h
-#define _SDL_x11dyn_h
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/Xatom.h>
-#include <X11/Xlibint.h>
-#include <X11/Xproto.h>
-
-#include "../Xext/extensions/Xext.h"
-#include "../Xext/extensions/extutil.h"
-
-#ifndef NO_SHARED_MEMORY
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <X11/extensions/XShm.h>
-#endif
-
-#if SDL_VIDEO_DRIVER_X11_XRANDR
-#include <X11/extensions/Xrandr.h>
-#endif
-
-/*
- * When using the "dynamic X11" functionality, we duplicate all the Xlib
- * symbols that would be referenced by SDL inside of SDL itself.
- * These duplicated symbols just serve as passthroughs to the functions
- * in Xlib, that was dynamically loaded.
- *
- * This allows us to use Xlib as-is when linking against it directly, but
- * also handles all the strange cases where there was code in the Xlib
- * headers that may or may not exist or vary on a given platform.
- */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* evil function signatures... */
-typedef Bool (*SDL_X11_XESetWireToEventRetType)(Display*,XEvent*,xEvent*);
-typedef int (*SDL_X11_XSynchronizeRetType)(Display*);
-typedef Status (*SDL_X11_XESetEventToWireRetType)(Display*,XEvent*,xEvent*);
-
-int SDL_X11_LoadSymbols(void);
-void SDL_X11_UnloadSymbols(void);
-
-/* That's really annoying...make this a function pointer no matter what. */
-#ifdef X_HAVE_UTF8_STRING
-extern XIC (*pXCreateIC)(XIM,...);
-extern char *(*pXGetICValues)(XIC, ...);
-#endif
-
-/* These SDL_X11_HAVE_* flags are here whether you have dynamic X11 or not. */
-#define SDL_X11_MODULE(modname) extern int SDL_X11_HAVE_##modname;
-#define SDL_X11_SYM(rc,fn,params,args,ret)
-#include "SDL_x11sym.h"
-#undef SDL_X11_MODULE
-#undef SDL_X11_SYM
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !defined _SDL_x11dyn_h */
-
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11events.c b/distrib/sdl-1.2.12/src/video/x11/SDL_x11events.c
deleted file mode 100644
index 4c48a18..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11events.c
+++ /dev/null
@@ -1,1453 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Handle the event stream, converting X11 events into SDL events */
-
-#include <setjmp.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/keysym.h>
-#ifdef __SVR4
-#include <X11/Sunkeysym.h>
-#endif
-#include <sys/types.h>
-#include <sys/time.h>
-#include <unistd.h>
-
-#include "SDL_timer.h"
-#include "SDL_syswm.h"
-#include "../SDL_sysvideo.h"
-#include "../../events/SDL_sysevents.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_x11video.h"
-#include "SDL_x11dga_c.h"
-#include "SDL_x11modes_c.h"
-#include "SDL_x11image_c.h"
-#include "SDL_x11gamma_c.h"
-#include "SDL_x11wm_c.h"
-#include "SDL_x11mouse_c.h"
-#include "SDL_x11events_c.h"
-
-
-/* Define this if you want to debug X11 events */
-/*#define DEBUG_XEVENTS*/
-
-/* The translation tables from an X11 keysym to a SDL keysym */
-static SDLKey ODD_keymap[256];
-static SDLKey MISC_keymap[256];
-SDLKey X11_TranslateKeycode(Display *display, KeyCode kc);
-
-
-#ifdef X_HAVE_UTF8_STRING
-Uint32 Utf8ToUcs4(const Uint8 *utf8)
-{
- Uint32 c;
- int i = 1;
- int noOctets = 0;
- int firstOctetMask = 0;
- unsigned char firstOctet = utf8[0];
- if (firstOctet < 0x80) {
- /*
- Characters in the range:
- 00000000 to 01111111 (ASCII Range)
- are stored in one octet:
- 0xxxxxxx (The same as its ASCII representation)
- The least 6 significant bits of the first octet is the most 6 significant nonzero bits
- of the UCS4 representation.
- */
- noOctets = 1;
- firstOctetMask = 0x7F; /* 0(1111111) - The most significant bit is ignored */
- } else if ((firstOctet & 0xE0) /* get the most 3 significant bits by AND'ing with 11100000 */
- == 0xC0 ) { /* see if those 3 bits are 110. If so, the char is in this range */
- /*
- Characters in the range:
- 00000000 10000000 to 00000111 11111111
- are stored in two octets:
- 110xxxxx 10xxxxxx
- The least 5 significant bits of the first octet is the most 5 significant nonzero bits
- of the UCS4 representation.
- */
- noOctets = 2;
- firstOctetMask = 0x1F; /* 000(11111) - The most 3 significant bits are ignored */
- } else if ((firstOctet & 0xF0) /* get the most 4 significant bits by AND'ing with 11110000 */
- == 0xE0) { /* see if those 4 bits are 1110. If so, the char is in this range */
- /*
- Characters in the range:
- 00001000 00000000 to 11111111 11111111
- are stored in three octets:
- 1110xxxx 10xxxxxx 10xxxxxx
- The least 4 significant bits of the first octet is the most 4 significant nonzero bits
- of the UCS4 representation.
- */
- noOctets = 3;
- firstOctetMask = 0x0F; /* 0000(1111) - The most 4 significant bits are ignored */
- } else if ((firstOctet & 0xF8) /* get the most 5 significant bits by AND'ing with 11111000 */
- == 0xF0) { /* see if those 5 bits are 11110. If so, the char is in this range */
- /*
- Characters in the range:
- 00000001 00000000 00000000 to 00011111 11111111 11111111
- are stored in four octets:
- 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
- The least 3 significant bits of the first octet is the most 3 significant nonzero bits
- of the UCS4 representation.
- */
- noOctets = 4;
- firstOctetMask = 0x07; /* 11110(111) - The most 5 significant bits are ignored */
- } else if ((firstOctet & 0xFC) /* get the most 6 significant bits by AND'ing with 11111100 */
- == 0xF8) { /* see if those 6 bits are 111110. If so, the char is in this range */
- /*
- Characters in the range:
- 00000000 00100000 00000000 00000000 to
- 00000011 11111111 11111111 11111111
- are stored in five octets:
- 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
- The least 2 significant bits of the first octet is the most 2 significant nonzero bits
- of the UCS4 representation.
- */
- noOctets = 5;
- firstOctetMask = 0x03; /* 111110(11) - The most 6 significant bits are ignored */
- } else if ((firstOctet & 0xFE) /* get the most 7 significant bits by AND'ing with 11111110 */
- == 0xFC) { /* see if those 7 bits are 1111110. If so, the char is in this range */
- /*
- Characters in the range:
- 00000100 00000000 00000000 00000000 to
- 01111111 11111111 11111111 11111111
- are stored in six octets:
- 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
- The least significant bit of the first octet is the most significant nonzero bit
- of the UCS4 representation.
- */
- noOctets = 6;
- firstOctetMask = 0x01; /* 1111110(1) - The most 7 significant bits are ignored */
- } else
- return 0; /* The given chunk is not a valid UTF-8 encoded Unicode character */
-
- /*
- The least noOctets significant bits of the first octet is the most 2 significant nonzero bits
- of the UCS4 representation.
- The first 6 bits of the UCS4 representation is the least 8-noOctets-1 significant bits of
- firstOctet if the character is not ASCII. If so, it's the least 7 significant bits of firstOctet.
- This done by AND'ing firstOctet with its mask to trim the bits used for identifying the
- number of continuing octets (if any) and leave only the free bits (the x's)
- Sample:
- 1-octet: 0xxxxxxx & 01111111 = 0xxxxxxx
- 2-octets: 110xxxxx & 00011111 = 000xxxxx
- */
- c = firstOctet & firstOctetMask;
-
- /* Now, start filling c.ucs4 with the bits from the continuing octets from utf8. */
- for (i = 1; i < noOctets; i++) {
- /* A valid continuing octet is of the form 10xxxxxx */
- if ((utf8[i] & 0xC0) /* get the most 2 significant bits by AND'ing with 11000000 */
- != 0x80) /* see if those 2 bits are 10. If not, the is a malformed sequence. */
- /*The given chunk is a partial sequence at the end of a string that could
- begin a valid character */
- return 0;
-
- /* Make room for the next 6-bits */
- c <<= 6;
-
- /*
- Take only the least 6 significance bits of the current octet (utf8[i]) and fill the created room
- of c.ucs4 with them.
- This done by AND'ing utf8[i] with 00111111 and the OR'ing the result with c.ucs4.
- */
- c |= utf8[i] & 0x3F;
- }
- return c;
-}
-
-/* Given a UTF-8 encoded string pointed to by utf8 of length length in
- bytes, returns the corresponding UTF-16 encoded string in the
- buffer pointed to by utf16. The maximum number of UTF-16 encoding
- units (i.e., Unit16s) allowed in the buffer is specified in
- utf16_max_length. The return value is the number of UTF-16
- encoding units placed in the output buffer pointed to by utf16.
-
- In case of an error, -1 is returned, leaving some unusable partial
- results in the output buffer.
-
- The caller must estimate the size of utf16 buffer by itself before
- calling this function. Insufficient output buffer is considered as
- an error, and once an error occured, this function doesn't give any
- clue how large the result will be.
-
- The error cases include following:
-
- - Invalid byte sequences were in the input UTF-8 bytes. The caller
- has no way to know what point in the input buffer was the
- errornous byte.
-
- - The input contained a character (a valid UTF-8 byte sequence)
- whose scalar value exceeded the range that UTF-16 can represent
- (i.e., characters whose Unicode scalar value above 0x110000).
-
- - The output buffer has no enough space to hold entire utf16 data.
-
- Please note:
-
- - '\0'-termination is not assumed both on the input UTF-8 string
- and on the output UTF-16 string; any legal zero byte in the input
- UTF-8 string will be converted to a 16-bit zero in output. As a
- side effect, the last UTF-16 encoding unit stored in the output
- buffer will have a non-zero value if the input UTF-8 was not
- '\0'-terminated.
-
- - UTF-8 aliases are *not* considered as an error. They are
- converted to UTF-16. For example, 0xC0 0xA0, 0xE0 0x80 0xA0,
- and 0xF0 0x80 0x80 0xA0 are all mapped to a single UTF-16
- encoding unit 0x0020.
-
- - Three byte UTF-8 sequences whose value corresponds to a surrogate
- code or other reserved scalar value are not considered as an
- error either. They may cause an invalid UTF-16 data (e.g., those
- containing unpaired surrogates).
-
-*/
-
-static int Utf8ToUtf16(const Uint8 *utf8, const int utf8_length, Uint16 *utf16, const int utf16_max_length) {
-
- /* p moves over the output buffer. max_ptr points to the next to the last slot of the buffer. */
- Uint16 *p = utf16;
- Uint16 const *const max_ptr = utf16 + utf16_max_length;
-
- /* end_of_input points to the last byte of input as opposed to the next to the last byte. */
- Uint8 const *const end_of_input = utf8 + utf8_length - 1;
-
- while (utf8 <= end_of_input) {
- if (p >= max_ptr) {
- /* No more output space. */
- return -1;
- }
- Uint8 const c = *utf8;
- if (c < 0x80) {
- /* One byte ASCII. */
- *p++ = c;
- utf8 += 1;
- } else if (c < 0xC0) {
- /* Follower byte without preceeding leader bytes. */
- return -1;
- } else if (c < 0xE0) {
- /* Two byte sequence. We need one follower byte. */
- if (end_of_input - utf8 < 1 || (((utf8[1] ^ 0x80)) & 0xC0)) {
- return -1;
- }
- *p++ = (Uint16)(0xCF80 + (c << 6) + utf8[1]);
- utf8 += 2;
- } else if (c < 0xF0) {
- /* Three byte sequence. We need two follower byte. */
- if (end_of_input - utf8 < 2 || (((utf8[1] ^ 0x80) | (utf8[2] ^ 0x80)) & 0xC0)) {
- return -1;
- }
- *p++ = (Uint16)(0xDF80 + (c << 12) + (utf8[1] << 6) + utf8[2]);
- utf8 += 3;
- } else if (c < 0xF8) {
- int plane;
- /* Four byte sequence. We need three follower bytes. */
- if (end_of_input - utf8 < 3 || (((utf8[1] ^ 0x80) | (utf8[2] ^0x80) | (utf8[3] ^ 0x80)) & 0xC0)) {
- return -1;
- }
- plane = (-0xC8 + (c << 2) + (utf8[1] >> 4));
- if (plane == 0) {
- /* This four byte sequence is an alias that
- corresponds to a Unicode scalar value in BMP.
- It fits in an UTF-16 encoding unit. */
- *p++ = (Uint16)(0xDF80 + (utf8[1] << 12) + (utf8[2] << 6) + utf8[3]);
- } else if (plane <= 16) {
- /* This is a legal four byte sequence that corresponds to a surrogate pair. */
- if (p + 1 >= max_ptr) {
- /* No enough space on the output buffer for the pair. */
- return -1;
- }
- *p++ = (Uint16)(0xE5B8 + (c << 8) + (utf8[1] << 2) + (utf8[2] >> 4));
- *p++ = (Uint16)(0xDB80 + ((utf8[2] & 0x0F) << 6) + utf8[3]);
- } else {
- /* This four byte sequence is out of UTF-16 code space. */
- return -1;
- }
- utf8 += 4;
- } else {
- /* Longer sequence or unused byte. */
- return -1;
- }
- }
- return p - utf16;
-}
-
-#endif
-
-/* Check to see if this is a repeated key.
- (idea shamelessly lifted from GII -- thanks guys! :)
- */
-static int X11_KeyRepeat(Display *display, XEvent *event)
-{
- XEvent peekevent;
- int repeated;
-
- repeated = 0;
- if ( XPending(display) ) {
- XPeekEvent(display, &peekevent);
- if ( (peekevent.type == KeyPress) &&
- (peekevent.xkey.keycode == event->xkey.keycode) &&
- ((peekevent.xkey.time-event->xkey.time) < 2) ) {
- repeated = 1;
- XNextEvent(display, &peekevent);
- }
- }
- return(repeated);
-}
-
-/* Note: The X server buffers and accumulates mouse motion events, so
- the motion event generated by the warp may not appear exactly as we
- expect it to. We work around this (and improve performance) by only
- warping the pointer when it reaches the edge, and then wait for it.
-*/
-#define MOUSE_FUDGE_FACTOR 8
-
-static __inline__ int X11_WarpedMotion(_THIS, XEvent *xevent)
-{
- int w, h, i;
- int deltax, deltay;
- int posted;
-
- w = SDL_VideoSurface->w;
- h = SDL_VideoSurface->h;
- deltax = xevent->xmotion.x - mouse_last.x;
- deltay = xevent->xmotion.y - mouse_last.y;
-#ifdef DEBUG_MOTION
- printf("Warped mouse motion: %d,%d\n", deltax, deltay);
-#endif
- mouse_last.x = xevent->xmotion.x;
- mouse_last.y = xevent->xmotion.y;
- posted = SDL_PrivateMouseMotion(0, 1, deltax, deltay);
-
- if ( (xevent->xmotion.x < MOUSE_FUDGE_FACTOR) ||
- (xevent->xmotion.x > (w-MOUSE_FUDGE_FACTOR)) ||
- (xevent->xmotion.y < MOUSE_FUDGE_FACTOR) ||
- (xevent->xmotion.y > (h-MOUSE_FUDGE_FACTOR)) ) {
- /* Get the events that have accumulated */
- while ( XCheckTypedEvent(SDL_Display, MotionNotify, xevent) ) {
- deltax = xevent->xmotion.x - mouse_last.x;
- deltay = xevent->xmotion.y - mouse_last.y;
-#ifdef DEBUG_MOTION
- printf("Extra mouse motion: %d,%d\n", deltax, deltay);
-#endif
- mouse_last.x = xevent->xmotion.x;
- mouse_last.y = xevent->xmotion.y;
- posted += SDL_PrivateMouseMotion(0, 1, deltax, deltay);
- }
- mouse_last.x = w/2;
- mouse_last.y = h/2;
- XWarpPointer(SDL_Display, None, SDL_Window, 0, 0, 0, 0,
- mouse_last.x, mouse_last.y);
- for ( i=0; i<10; ++i ) {
- XMaskEvent(SDL_Display, PointerMotionMask, xevent);
- if ( (xevent->xmotion.x >
- (mouse_last.x-MOUSE_FUDGE_FACTOR)) &&
- (xevent->xmotion.x <
- (mouse_last.x+MOUSE_FUDGE_FACTOR)) &&
- (xevent->xmotion.y >
- (mouse_last.y-MOUSE_FUDGE_FACTOR)) &&
- (xevent->xmotion.y <
- (mouse_last.y+MOUSE_FUDGE_FACTOR)) ) {
- break;
- }
-#ifdef DEBUG_XEVENTS
- printf("Lost mouse motion: %d,%d\n", xevent->xmotion.x, xevent->xmotion.y);
-#endif
- }
-#ifdef DEBUG_XEVENTS
- if ( i == 10 ) {
- printf("Warning: didn't detect mouse warp motion\n");
- }
-#endif
- }
- return(posted);
-}
-
-static int X11_DispatchEvent(_THIS)
-{
- int posted;
- XEvent xevent;
-
- SDL_memset(&xevent, '\0', sizeof (XEvent)); /* valgrind fix. --ryan. */
- XNextEvent(SDL_Display, &xevent);
-
- /* Discard KeyRelease and KeyPress events generated by auto-repeat.
- We need to do it before passing event to XFilterEvent. Otherwise,
- KeyRelease aware IMs are confused... */
- if ( xevent.type == KeyRelease
- && X11_KeyRepeat(SDL_Display, &xevent) ) {
- return 0;
- }
-
-#ifdef X_HAVE_UTF8_STRING
- /* If we are translating with IM, we need to pass all events
- to XFilterEvent, and discard those filtered events immediately. */
- if ( SDL_TranslateUNICODE
- && SDL_IM != NULL
- && XFilterEvent(&xevent, None) ) {
- return 0;
- }
-#endif
-
- posted = 0;
- switch (xevent.type) {
-
- /* Gaining mouse coverage? */
- case EnterNotify: {
-#ifdef DEBUG_XEVENTS
-printf("EnterNotify! (%d,%d)\n", xevent.xcrossing.x, xevent.xcrossing.y);
-if ( xevent.xcrossing.mode == NotifyGrab )
-printf("Mode: NotifyGrab\n");
-if ( xevent.xcrossing.mode == NotifyUngrab )
-printf("Mode: NotifyUngrab\n");
-#endif
- if ( (xevent.xcrossing.mode != NotifyGrab) &&
- (xevent.xcrossing.mode != NotifyUngrab) ) {
- if ( this->input_grab == SDL_GRAB_OFF ) {
- posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
- }
- posted = SDL_PrivateMouseMotion(0, 0,
- xevent.xcrossing.x,
- xevent.xcrossing.y);
- }
- }
- break;
-
- /* Losing mouse coverage? */
- case LeaveNotify: {
-#ifdef DEBUG_XEVENTS
-printf("LeaveNotify! (%d,%d)\n", xevent.xcrossing.x, xevent.xcrossing.y);
-if ( xevent.xcrossing.mode == NotifyGrab )
-printf("Mode: NotifyGrab\n");
-if ( xevent.xcrossing.mode == NotifyUngrab )
-printf("Mode: NotifyUngrab\n");
-#endif
- if ( (xevent.xcrossing.mode != NotifyGrab) &&
- (xevent.xcrossing.mode != NotifyUngrab) &&
- (xevent.xcrossing.detail != NotifyInferior) ) {
- if ( this->input_grab == SDL_GRAB_OFF ) {
- posted = SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
- } else {
- posted = SDL_PrivateMouseMotion(0, 0,
- xevent.xcrossing.x,
- xevent.xcrossing.y);
- }
- }
- }
- break;
-
- /* Gaining input focus? */
- case FocusIn: {
-#ifdef DEBUG_XEVENTS
-printf("FocusIn!\n");
-#endif
- posted = SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
-
-#ifdef X_HAVE_UTF8_STRING
- if ( SDL_IC != NULL ) {
- XSetICFocus(SDL_IC);
- }
-#endif
- /* Queue entry into fullscreen mode */
- switch_waiting = 0x01 | SDL_FULLSCREEN;
- switch_time = SDL_GetTicks() + 1500;
- }
- break;
-
- /* Losing input focus? */
- case FocusOut: {
-#ifdef DEBUG_XEVENTS
-printf("FocusOut!\n");
-#endif
- posted = SDL_PrivateAppActive(0, SDL_APPINPUTFOCUS);
-
-#ifdef X_HAVE_UTF8_STRING
- if ( SDL_IC != NULL ) {
- XUnsetICFocus(SDL_IC);
- }
-#endif
- /* Queue leaving fullscreen mode */
- switch_waiting = 0x01;
- switch_time = SDL_GetTicks() + 200;
- }
- break;
-
- /* Some IM requires MappingNotify to be passed to
- XRefreshKeyboardMapping by the app. */
- case MappingNotify: {
- XRefreshKeyboardMapping(&xevent.xmapping);
- }
- break;
-
- /* Generated upon EnterWindow and FocusIn */
- case KeymapNotify: {
-#ifdef DEBUG_XEVENTS
-printf("KeymapNotify!\n");
-#endif
- X11_SetKeyboardState(SDL_Display, xevent.xkeymap.key_vector);
- }
- break;
-
- /* Mouse motion? */
- case MotionNotify: {
- if ( SDL_VideoSurface ) {
- if ( mouse_relative ) {
- if ( using_dga & DGA_MOUSE ) {
-#ifdef DEBUG_MOTION
- printf("DGA motion: %d,%d\n", xevent.xmotion.x_root, xevent.xmotion.y_root);
-#endif
- posted = SDL_PrivateMouseMotion(0, 1,
- xevent.xmotion.x_root,
- xevent.xmotion.y_root);
- } else {
- posted = X11_WarpedMotion(this,&xevent);
- }
- } else {
-#ifdef DEBUG_MOTION
- printf("X11 motion: %d,%d\n", xevent.xmotion.x, xevent.xmotion.y);
-#endif
- posted = SDL_PrivateMouseMotion(0, 0,
- xevent.xmotion.x,
- xevent.xmotion.y);
- }
- }
- }
- break;
-
- /* Mouse button press? */
- case ButtonPress: {
- posted = SDL_PrivateMouseButton(SDL_PRESSED,
- xevent.xbutton.button, 0, 0);
- }
- break;
-
- /* Mouse button release? */
- case ButtonRelease: {
- posted = SDL_PrivateMouseButton(SDL_RELEASED,
- xevent.xbutton.button, 0, 0);
- }
- break;
-
- /* Key press? */
- case KeyPress: {
- SDL_keysym keysym;
- KeyCode keycode = xevent.xkey.keycode;
-
-#ifdef DEBUG_XEVENTS
-printf("KeyPress (X11 keycode = 0x%X)\n", xevent.xkey.keycode);
-#endif
- /* If we're not doing translation, we're done! */
- if ( !SDL_TranslateUNICODE ) {
- /* Get the translated SDL virtual keysym and put it on the queue.*/
- keysym.scancode = keycode;
- keysym.sym = X11_TranslateKeycode(SDL_Display, keycode);
- keysym.mod = KMOD_NONE;
- keysym.unicode = 0;
- posted = SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
- break;
- }
-
- /* Look up the translated value for the key event */
-#ifdef X_HAVE_UTF8_STRING
- if ( SDL_IC != NULL ) {
- Status status;
- KeySym xkeysym;
- int i;
- /* A UTF-8 character can be at most 6 bytes */
- /* ... It's true, but Xutf8LookupString can
- return more than one characters. Moreover,
- the spec. put no upper bound, so we should
- be ready for longer strings. */
- char keybuf[32];
- char *keydata = keybuf;
- int count;
- Uint16 utf16buf[32];
- Uint16 *utf16data = utf16buf;
- int utf16size;
- int utf16length;
-
- count = Xutf8LookupString(SDL_IC, &xevent.xkey, keydata, sizeof(keybuf), &xkeysym, &status);
- if (XBufferOverflow == status) {
- /* The IM has just generated somewhat long
- string. We need a longer buffer in this
- case. */
- keydata = SDL_malloc(count);
- if ( keydata == NULL ) {
- SDL_OutOfMemory();
- break;
- }
- count = Xutf8LookupString(SDL_IC, &xevent.xkey, keydata, count, &xkeysym, &status);
- }
-
- switch (status) {
-
- case XBufferOverflow: {
- /* Oops! We have allocated the bytes as
- requested by Xutf8LookupString, so the
- length of the buffer must be
- sufficient. This case should never
- happen! */
- SDL_SetError("Xutf8LookupString indicated a double buffer overflow!");
- break;
- }
-
- case XLookupChars:
- case XLookupBoth: {
- if (0 == count) {
- break;
- }
-
- /* We got a converted string from IM. Make
- sure to deliver all characters to the
- application as SDL events. Note that
- an SDL event can only carry one UTF-16
- encoding unit, and a surrogate pair is
- delivered as two SDL events. I guess
- this behaviour is probably _imported_
- from Windows or MacOS. To do so, we need
- to convert the UTF-8 data into UTF-16
- data (not UCS4/UTF-32!). We need an
- estimate of the number of UTF-16 encoding
- units here. The worst case is pure ASCII
- string. Assume so. */
- /* In 1.3 SDL may have a text event instead, that
- carries the whole UTF-8 string with it. */
- utf16size = count * sizeof(Uint16);
- if (utf16size > sizeof(utf16buf)) {
- utf16data = (Uint16 *) SDL_malloc(utf16size);
- if (utf16data == NULL) {
- SDL_OutOfMemory();
- break;
- }
- }
- utf16length = Utf8ToUtf16((Uint8 *)keydata, count, utf16data, utf16size);
- if (utf16length < 0) {
- /* The keydata contained an invalid byte
- sequence. It should be a bug of the IM
- or Xlib... */
- SDL_SetError("Oops! Xutf8LookupString returned an invalid UTF-8 sequence!");
- break;
- }
-
- /* Deliver all UTF-16 encoding units. At
- this moment, SDL event queue has a
- fixed size (128 events), and an SDL
- event can hold just one UTF-16 encoding
- unit. So, if we receive more than 128
- UTF-16 encoding units from a commit,
- exceeded characters will be lost. */
- for (i = 0; i < utf16length - 1; i++) {
- keysym.scancode = 0;
- keysym.sym = SDLK_UNKNOWN;
- keysym.mod = KMOD_NONE;
- keysym.unicode = utf16data[i];
- posted = SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
- }
- /* The keysym for the last character carries the
- scancode and symbol that corresponds to the X11
- keycode. */
- if (utf16length > 0) {
- keysym.scancode = keycode;
- keysym.sym = (keycode ? X11_TranslateKeycode(SDL_Display, keycode) : 0);
- keysym.mod = KMOD_NONE;
- keysym.unicode = utf16data[utf16length - 1];
- posted = SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
- }
- break;
- }
-
- case XLookupKeySym: {
- /* I'm not sure whether it is possible that
- a zero keycode makes XLookupKeySym
- status. What I'm sure is that a
- combination of a zero scan code and a non
- zero sym makes SDL_PrivateKeyboard
- strange state... So, just discard it.
- If this doesn't work, I'm receiving bug
- reports, and I can know under what
- condition this case happens. */
- if (keycode) {
- keysym.scancode = keycode;
- keysym.sym = X11_TranslateKeycode(SDL_Display, keycode);
- keysym.mod = KMOD_NONE;
- keysym.unicode = 0;
- posted = SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
- }
- break;
- }
-
- case XLookupNone: {
- /* IM has eaten the event. */
- break;
- }
-
- default:
- /* An unknown status from Xutf8LookupString. */
- SDL_SetError("Oops! Xutf8LookupStringreturned an unknown status");
- }
-
- /* Release dynamic buffers if allocated. */
- if (keydata != NULL && keybuf != keydata) {
- SDL_free(keydata);
- }
- if (utf16data != NULL && utf16buf != utf16data) {
- SDL_free(utf16data);
- }
- }
- else
-#endif
- {
- static XComposeStatus state;
- char keybuf[32];
-
- keysym.scancode = keycode;
- keysym.sym = X11_TranslateKeycode(SDL_Display, keycode);
- keysym.mod = KMOD_NONE;
- keysym.unicode = 0;
- if ( XLookupString(&xevent.xkey,
- keybuf, sizeof(keybuf),
- NULL, &state) ) {
- /*
- * FIXME: XLookupString() may yield more than one
- * character, so we need a mechanism to allow for
- * this (perhaps null keypress events with a
- * unicode value)
- */
- keysym.unicode = (Uint8)keybuf[0];
- }
-
- posted = SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
- }
- }
- break;
-
- /* Key release? */
- case KeyRelease: {
- SDL_keysym keysym;
- KeyCode keycode = xevent.xkey.keycode;
-
- if (keycode == 0) {
- /* There should be no KeyRelease for keycode == 0,
- since it is a notification from IM but a real
- keystroke. */
- /* We need to emit some diagnostic message here. */
- break;
- }
-
-#ifdef DEBUG_XEVENTS
-printf("KeyRelease (X11 keycode = 0x%X)\n", xevent.xkey.keycode);
-#endif
-
- /* Get the translated SDL virtual keysym */
- keysym.scancode = keycode;
- keysym.sym = X11_TranslateKeycode(SDL_Display, keycode);
- keysym.mod = KMOD_NONE;
- keysym.unicode = 0;
-
- posted = SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
- }
- break;
-
- /* Have we been iconified? */
- case UnmapNotify: {
-#ifdef DEBUG_XEVENTS
-printf("UnmapNotify!\n");
-#endif
- /* If we're active, make ourselves inactive */
- if ( SDL_GetAppState() & SDL_APPACTIVE ) {
- /* Swap out the gamma before we go inactive */
- X11_SwapVidModeGamma(this);
-
- /* Send an internal deactivate event */
- posted = SDL_PrivateAppActive(0,
- SDL_APPACTIVE|SDL_APPINPUTFOCUS);
- }
- }
- break;
-
- /* Have we been restored? */
- case MapNotify: {
-#ifdef DEBUG_XEVENTS
-printf("MapNotify!\n");
-#endif
- /* If we're not active, make ourselves active */
- if ( !(SDL_GetAppState() & SDL_APPACTIVE) ) {
- /* Send an internal activate event */
- posted = SDL_PrivateAppActive(1, SDL_APPACTIVE);
-
- /* Now that we're active, swap the gamma back */
- X11_SwapVidModeGamma(this);
- }
-
- if ( SDL_VideoSurface &&
- (SDL_VideoSurface->flags & SDL_FULLSCREEN) ) {
- X11_EnterFullScreen(this);
- } else {
- X11_GrabInputNoLock(this, this->input_grab);
- }
- X11_CheckMouseModeNoLock(this);
-
- if ( SDL_VideoSurface ) {
- X11_RefreshDisplay(this);
- }
- }
- break;
-
- /* Have we been resized or moved? */
- case ConfigureNotify: {
-#ifdef DEBUG_XEVENTS
-printf("ConfigureNotify! (resize: %dx%d)\n", xevent.xconfigure.width, xevent.xconfigure.height);
-#endif
- if ( SDL_VideoSurface ) {
- if ((xevent.xconfigure.width != SDL_VideoSurface->w) ||
- (xevent.xconfigure.height != SDL_VideoSurface->h)) {
- /* FIXME: Find a better fix for the bug with KDE 1.2 */
- if ( ! ((xevent.xconfigure.width == 32) &&
- (xevent.xconfigure.height == 32)) ) {
- SDL_PrivateResize(xevent.xconfigure.width,
- xevent.xconfigure.height);
- }
- } else {
- /* OpenGL windows need to know about the change */
- if ( SDL_VideoSurface->flags & SDL_OPENGL ) {
- SDL_PrivateExpose();
- }
- }
- }
- }
- break;
-
- /* Have we been requested to quit (or another client message?) */
- case ClientMessage: {
- if ( (xevent.xclient.format == 32) &&
- (xevent.xclient.data.l[0] == WM_DELETE_WINDOW) )
- {
- posted = SDL_PrivateQuit();
- } else
- if ( SDL_ProcessEvents[SDL_SYSWMEVENT] == SDL_ENABLE ) {
- SDL_SysWMmsg wmmsg;
-
- SDL_VERSION(&wmmsg.version);
- wmmsg.subsystem = SDL_SYSWM_X11;
- wmmsg.event.xevent = xevent;
- posted = SDL_PrivateSysWMEvent(&wmmsg);
- }
- }
- break;
-
- /* Do we need to refresh ourselves? */
- case Expose: {
-#ifdef DEBUG_XEVENTS
-printf("Expose (count = %d)\n", xevent.xexpose.count);
-#endif
- if ( SDL_VideoSurface && (xevent.xexpose.count == 0) ) {
- X11_RefreshDisplay(this);
- }
- }
- break;
-
- default: {
-#ifdef DEBUG_XEVENTS
-printf("Unhandled event %d\n", xevent.type);
-#endif
- /* Only post the event if we're watching for it */
- if ( SDL_ProcessEvents[SDL_SYSWMEVENT] == SDL_ENABLE ) {
- SDL_SysWMmsg wmmsg;
-
- SDL_VERSION(&wmmsg.version);
- wmmsg.subsystem = SDL_SYSWM_X11;
- wmmsg.event.xevent = xevent;
- posted = SDL_PrivateSysWMEvent(&wmmsg);
- }
- }
- break;
- }
- return(posted);
-}
-
-/* Ack! XPending() actually performs a blocking read if no events available */
-int X11_Pending(Display *display)
-{
- /* Flush the display connection and look to see if events are queued */
- XFlush(display);
- if ( XEventsQueued(display, QueuedAlready) ) {
- return(1);
- }
-
- /* More drastic measures are required -- see if X is ready to talk */
- {
- static struct timeval zero_time; /* static == 0 */
- int x11_fd;
- fd_set fdset;
-
- x11_fd = ConnectionNumber(display);
- FD_ZERO(&fdset);
- FD_SET(x11_fd, &fdset);
- if ( select(x11_fd+1, &fdset, NULL, NULL, &zero_time) == 1 ) {
- return(XPending(display));
- }
- }
-
- /* Oh well, nothing is ready .. */
- return(0);
-}
-
-void X11_PumpEvents(_THIS)
-{
- int pending;
-
- /* Keep processing pending events */
- pending = 0;
- while ( X11_Pending(SDL_Display) ) {
- X11_DispatchEvent(this);
- ++pending;
- }
- if ( switch_waiting ) {
- Uint32 now;
-
- now = SDL_GetTicks();
- if ( pending || !SDL_VideoSurface ) {
- /* Try again later... */
- if ( switch_waiting & SDL_FULLSCREEN ) {
- switch_time = now + 1500;
- } else {
- switch_time = now + 200;
- }
- } else if ( (int)(switch_time-now) <= 0 ) {
- Uint32 go_fullscreen;
-
- go_fullscreen = switch_waiting & SDL_FULLSCREEN;
- switch_waiting = 0;
- if ( SDL_VideoSurface->flags & SDL_FULLSCREEN ) {
- if ( go_fullscreen ) {
- X11_EnterFullScreen(this);
- } else {
- X11_LeaveFullScreen(this);
- }
- }
- /* Handle focus in/out when grabbed */
- if ( go_fullscreen ) {
- X11_GrabInputNoLock(this, this->input_grab);
- } else {
- X11_GrabInputNoLock(this, SDL_GRAB_OFF);
- }
- X11_CheckMouseModeNoLock(this);
- }
- }
-}
-
-void X11_InitKeymap(void)
-{
- int i;
-
- /* Odd keys used in international keyboards */
- for ( i=0; i<SDL_arraysize(ODD_keymap); ++i )
- ODD_keymap[i] = SDLK_UNKNOWN;
-
- /* Some of these might be mappable to an existing SDLK_ code */
- ODD_keymap[XK_dead_grave&0xFF] = SDLK_COMPOSE;
- ODD_keymap[XK_dead_acute&0xFF] = SDLK_COMPOSE;
- ODD_keymap[XK_dead_tilde&0xFF] = SDLK_COMPOSE;
- ODD_keymap[XK_dead_macron&0xFF] = SDLK_COMPOSE;
- ODD_keymap[XK_dead_breve&0xFF] = SDLK_COMPOSE;
- ODD_keymap[XK_dead_abovedot&0xFF] = SDLK_COMPOSE;
- ODD_keymap[XK_dead_diaeresis&0xFF] = SDLK_COMPOSE;
- ODD_keymap[XK_dead_abovering&0xFF] = SDLK_COMPOSE;
- ODD_keymap[XK_dead_doubleacute&0xFF] = SDLK_COMPOSE;
- ODD_keymap[XK_dead_caron&0xFF] = SDLK_COMPOSE;
- ODD_keymap[XK_dead_cedilla&0xFF] = SDLK_COMPOSE;
- ODD_keymap[XK_dead_ogonek&0xFF] = SDLK_COMPOSE;
- ODD_keymap[XK_dead_iota&0xFF] = SDLK_COMPOSE;
- ODD_keymap[XK_dead_voiced_sound&0xFF] = SDLK_COMPOSE;
- ODD_keymap[XK_dead_semivoiced_sound&0xFF] = SDLK_COMPOSE;
- ODD_keymap[XK_dead_belowdot&0xFF] = SDLK_COMPOSE;
-#ifdef XK_dead_hook
- ODD_keymap[XK_dead_hook&0xFF] = SDLK_COMPOSE;
-#endif
-#ifdef XK_dead_horn
- ODD_keymap[XK_dead_horn&0xFF] = SDLK_COMPOSE;
-#endif
-
-#ifdef XK_dead_circumflex
- /* These X keysyms have 0xFE as the high byte */
- ODD_keymap[XK_dead_circumflex&0xFF] = SDLK_CARET;
-#endif
-#ifdef XK_ISO_Level3_Shift
- ODD_keymap[XK_ISO_Level3_Shift&0xFF] = SDLK_MODE; /* "Alt Gr" key */
-#endif
-
- /* Map the miscellaneous keys */
- for ( i=0; i<SDL_arraysize(MISC_keymap); ++i )
- MISC_keymap[i] = SDLK_UNKNOWN;
-
- /* These X keysyms have 0xFF as the high byte */
- MISC_keymap[XK_BackSpace&0xFF] = SDLK_BACKSPACE;
- MISC_keymap[XK_Tab&0xFF] = SDLK_TAB;
- MISC_keymap[XK_Clear&0xFF] = SDLK_CLEAR;
- MISC_keymap[XK_Return&0xFF] = SDLK_RETURN;
- MISC_keymap[XK_Pause&0xFF] = SDLK_PAUSE;
- MISC_keymap[XK_Escape&0xFF] = SDLK_ESCAPE;
- MISC_keymap[XK_Delete&0xFF] = SDLK_DELETE;
-
- MISC_keymap[XK_KP_0&0xFF] = SDLK_KP0; /* Keypad 0-9 */
- MISC_keymap[XK_KP_1&0xFF] = SDLK_KP1;
- MISC_keymap[XK_KP_2&0xFF] = SDLK_KP2;
- MISC_keymap[XK_KP_3&0xFF] = SDLK_KP3;
- MISC_keymap[XK_KP_4&0xFF] = SDLK_KP4;
- MISC_keymap[XK_KP_5&0xFF] = SDLK_KP5;
- MISC_keymap[XK_KP_6&0xFF] = SDLK_KP6;
- MISC_keymap[XK_KP_7&0xFF] = SDLK_KP7;
- MISC_keymap[XK_KP_8&0xFF] = SDLK_KP8;
- MISC_keymap[XK_KP_9&0xFF] = SDLK_KP9;
- MISC_keymap[XK_KP_Insert&0xFF] = SDLK_KP0;
- MISC_keymap[XK_KP_End&0xFF] = SDLK_KP1;
- MISC_keymap[XK_KP_Down&0xFF] = SDLK_KP2;
- MISC_keymap[XK_KP_Page_Down&0xFF] = SDLK_KP3;
- MISC_keymap[XK_KP_Left&0xFF] = SDLK_KP4;
- MISC_keymap[XK_KP_Begin&0xFF] = SDLK_KP5;
- MISC_keymap[XK_KP_Right&0xFF] = SDLK_KP6;
- MISC_keymap[XK_KP_Home&0xFF] = SDLK_KP7;
- MISC_keymap[XK_KP_Up&0xFF] = SDLK_KP8;
- MISC_keymap[XK_KP_Page_Up&0xFF] = SDLK_KP9;
- MISC_keymap[XK_KP_Delete&0xFF] = SDLK_KP_PERIOD;
- MISC_keymap[XK_KP_Decimal&0xFF] = SDLK_KP_PERIOD;
- MISC_keymap[XK_KP_Divide&0xFF] = SDLK_KP_DIVIDE;
- MISC_keymap[XK_KP_Multiply&0xFF] = SDLK_KP_MULTIPLY;
- MISC_keymap[XK_KP_Subtract&0xFF] = SDLK_KP_MINUS;
- MISC_keymap[XK_KP_Add&0xFF] = SDLK_KP_PLUS;
- MISC_keymap[XK_KP_Enter&0xFF] = SDLK_KP_ENTER;
- MISC_keymap[XK_KP_Equal&0xFF] = SDLK_KP_EQUALS;
-
- MISC_keymap[XK_Up&0xFF] = SDLK_UP;
- MISC_keymap[XK_Down&0xFF] = SDLK_DOWN;
- MISC_keymap[XK_Right&0xFF] = SDLK_RIGHT;
- MISC_keymap[XK_Left&0xFF] = SDLK_LEFT;
- MISC_keymap[XK_Insert&0xFF] = SDLK_INSERT;
- MISC_keymap[XK_Home&0xFF] = SDLK_HOME;
- MISC_keymap[XK_End&0xFF] = SDLK_END;
- MISC_keymap[XK_Page_Up&0xFF] = SDLK_PAGEUP;
- MISC_keymap[XK_Page_Down&0xFF] = SDLK_PAGEDOWN;
-
- MISC_keymap[XK_F1&0xFF] = SDLK_F1;
- MISC_keymap[XK_F2&0xFF] = SDLK_F2;
- MISC_keymap[XK_F3&0xFF] = SDLK_F3;
- MISC_keymap[XK_F4&0xFF] = SDLK_F4;
- MISC_keymap[XK_F5&0xFF] = SDLK_F5;
- MISC_keymap[XK_F6&0xFF] = SDLK_F6;
- MISC_keymap[XK_F7&0xFF] = SDLK_F7;
- MISC_keymap[XK_F8&0xFF] = SDLK_F8;
- MISC_keymap[XK_F9&0xFF] = SDLK_F9;
- MISC_keymap[XK_F10&0xFF] = SDLK_F10;
- MISC_keymap[XK_F11&0xFF] = SDLK_F11;
- MISC_keymap[XK_F12&0xFF] = SDLK_F12;
- MISC_keymap[XK_F13&0xFF] = SDLK_F13;
- MISC_keymap[XK_F14&0xFF] = SDLK_F14;
- MISC_keymap[XK_F15&0xFF] = SDLK_F15;
-
- MISC_keymap[XK_Num_Lock&0xFF] = SDLK_NUMLOCK;
- MISC_keymap[XK_Caps_Lock&0xFF] = SDLK_CAPSLOCK;
- MISC_keymap[XK_Scroll_Lock&0xFF] = SDLK_SCROLLOCK;
- MISC_keymap[XK_Shift_R&0xFF] = SDLK_RSHIFT;
- MISC_keymap[XK_Shift_L&0xFF] = SDLK_LSHIFT;
- MISC_keymap[XK_Control_R&0xFF] = SDLK_RCTRL;
- MISC_keymap[XK_Control_L&0xFF] = SDLK_LCTRL;
- MISC_keymap[XK_Alt_R&0xFF] = SDLK_RALT;
- MISC_keymap[XK_Alt_L&0xFF] = SDLK_LALT;
- MISC_keymap[XK_Meta_R&0xFF] = SDLK_RMETA;
- MISC_keymap[XK_Meta_L&0xFF] = SDLK_LMETA;
- MISC_keymap[XK_Super_L&0xFF] = SDLK_LSUPER; /* Left "Windows" */
- MISC_keymap[XK_Super_R&0xFF] = SDLK_RSUPER; /* Right "Windows */
- MISC_keymap[XK_Mode_switch&0xFF] = SDLK_MODE; /* "Alt Gr" key */
- MISC_keymap[XK_Multi_key&0xFF] = SDLK_COMPOSE; /* Multi-key compose */
-
- MISC_keymap[XK_Help&0xFF] = SDLK_HELP;
- MISC_keymap[XK_Print&0xFF] = SDLK_PRINT;
- MISC_keymap[XK_Sys_Req&0xFF] = SDLK_SYSREQ;
- MISC_keymap[XK_Break&0xFF] = SDLK_BREAK;
- MISC_keymap[XK_Menu&0xFF] = SDLK_MENU;
- MISC_keymap[XK_Hyper_R&0xFF] = SDLK_MENU; /* Windows "Menu" key */
-}
-
-/* Get the translated SDL virtual keysym */
-SDLKey X11_TranslateKeycode(Display *display, KeyCode kc)
-{
- KeySym xsym;
- SDLKey key;
-
- xsym = XKeycodeToKeysym(display, kc, 0);
-#ifdef DEBUG_KEYS
- fprintf(stderr, "Translating key code %d -> 0x%.4x\n", kc, xsym);
-#endif
- key = SDLK_UNKNOWN;
- if ( xsym ) {
- switch (xsym>>8) {
- case 0x1005FF:
-#ifdef SunXK_F36
- if ( xsym == SunXK_F36 )
- key = SDLK_F11;
-#endif
-#ifdef SunXK_F37
- if ( xsym == SunXK_F37 )
- key = SDLK_F12;
-#endif
- break;
- case 0x00: /* Latin 1 */
- key = (SDLKey)(xsym & 0xFF);
- break;
- case 0x01: /* Latin 2 */
- case 0x02: /* Latin 3 */
- case 0x03: /* Latin 4 */
- case 0x04: /* Katakana */
- case 0x05: /* Arabic */
- case 0x06: /* Cyrillic */
- case 0x07: /* Greek */
- case 0x08: /* Technical */
- case 0x0A: /* Publishing */
- case 0x0C: /* Hebrew */
- case 0x0D: /* Thai */
- /* These are wrong, but it's better than nothing */
- key = (SDLKey)(xsym & 0xFF);
- break;
- case 0xFE:
- key = ODD_keymap[xsym&0xFF];
- break;
- case 0xFF:
- key = MISC_keymap[xsym&0xFF];
- break;
- default:
- /*
- fprintf(stderr, "X11: Unhandled xsym, sym = 0x%04x\n",
- (unsigned int)xsym);
- */
- break;
- }
- } else {
- /* X11 doesn't know how to translate the key! */
- switch (kc) {
- /* Caution:
- These keycodes are from the Microsoft Keyboard
- */
- case 115:
- key = SDLK_LSUPER;
- break;
- case 116:
- key = SDLK_RSUPER;
- break;
- case 117:
- key = SDLK_MENU;
- break;
- default:
- /*
- * no point in an error message; happens for
- * several keys when we get a keymap notify
- */
- break;
- }
- }
- return key;
-}
-
-/* X11 modifier masks for various keys */
-static unsigned meta_l_mask, meta_r_mask, alt_l_mask, alt_r_mask;
-static unsigned num_mask, mode_switch_mask;
-
-static void get_modifier_masks(Display *display)
-{
- static unsigned got_masks;
- int i, j;
- XModifierKeymap *xmods;
- unsigned n;
-
- if(got_masks)
- return;
-
- xmods = XGetModifierMapping(display);
- n = xmods->max_keypermod;
- for(i = 3; i < 8; i++) {
- for(j = 0; j < n; j++) {
- KeyCode kc = xmods->modifiermap[i * n + j];
- KeySym ks = XKeycodeToKeysym(display, kc, 0);
- unsigned mask = 1 << i;
- switch(ks) {
- case XK_Num_Lock:
- num_mask = mask; break;
- case XK_Alt_L:
- alt_l_mask = mask; break;
- case XK_Alt_R:
- alt_r_mask = mask; break;
- case XK_Meta_L:
- meta_l_mask = mask; break;
- case XK_Meta_R:
- meta_r_mask = mask; break;
- case XK_Mode_switch:
- mode_switch_mask = mask; break;
- }
- }
- }
- XFreeModifiermap(xmods);
- got_masks = 1;
-}
-
-
-/*
- * This function is semi-official; it is not officially exported and should
- * not be considered part of the SDL API, but may be used by client code
- * that *really* needs it (including legacy code).
- * It is slow, though, and should be avoided if possible.
- *
- * Note that it isn't completely accurate either; in particular, multi-key
- * sequences (dead accents, compose key sequences) will not work since the
- * state has been irrevocably lost.
- */
-Uint16 X11_KeyToUnicode(SDLKey keysym, SDLMod modifiers)
-{
- struct SDL_VideoDevice *this = current_video;
- char keybuf[32];
- int i;
- KeySym xsym = 0;
- XKeyEvent xkey;
- Uint16 unicode;
-
- if ( !this || !SDL_Display ) {
- return 0;
- }
-
- SDL_memset(&xkey, 0, sizeof(xkey));
- xkey.display = SDL_Display;
-
- xsym = keysym; /* last resort if not found */
- for (i = 0; i < 256; ++i) {
- if ( MISC_keymap[i] == keysym ) {
- xsym = 0xFF00 | i;
- break;
- } else if ( ODD_keymap[i] == keysym ) {
- xsym = 0xFE00 | i;
- break;
- }
- }
-
- xkey.keycode = XKeysymToKeycode(xkey.display, xsym);
-
- get_modifier_masks(SDL_Display);
- if(modifiers & KMOD_SHIFT)
- xkey.state |= ShiftMask;
- if(modifiers & KMOD_CAPS)
- xkey.state |= LockMask;
- if(modifiers & KMOD_CTRL)
- xkey.state |= ControlMask;
- if(modifiers & KMOD_MODE)
- xkey.state |= mode_switch_mask;
- if(modifiers & KMOD_LALT)
- xkey.state |= alt_l_mask;
- if(modifiers & KMOD_RALT)
- xkey.state |= alt_r_mask;
- if(modifiers & KMOD_LMETA)
- xkey.state |= meta_l_mask;
- if(modifiers & KMOD_RMETA)
- xkey.state |= meta_r_mask;
- if(modifiers & KMOD_NUM)
- xkey.state |= num_mask;
-
- unicode = 0;
- if ( XLookupString(&xkey, keybuf, sizeof(keybuf), NULL, NULL) )
- unicode = (unsigned char)keybuf[0];
- return(unicode);
-}
-
-
-/*
- * Called when focus is regained, to read the keyboard state and generate
- * synthetic keypress/release events.
- * key_vec is a bit vector of keycodes (256 bits)
- */
-void X11_SetKeyboardState(Display *display, const char *key_vec)
-{
- char keys_return[32];
- int i;
- Uint8 *kstate = SDL_GetKeyState(NULL);
- SDLMod modstate;
- Window junk_window;
- int x, y;
- unsigned int mask;
-
- /* The first time the window is mapped, we initialize key state */
- if ( ! key_vec ) {
- XQueryKeymap(display, keys_return);
- key_vec = keys_return;
- }
-
- /* Get the keyboard modifier state */
- modstate = 0;
- get_modifier_masks(display);
- if ( XQueryPointer(display, DefaultRootWindow(display),
- &junk_window, &junk_window, &x, &y, &x, &y, &mask) ) {
- if ( mask & LockMask ) {
- modstate |= KMOD_CAPS;
- }
- if ( mask & mode_switch_mask ) {
- modstate |= KMOD_MODE;
- }
- if ( mask & num_mask ) {
- modstate |= KMOD_NUM;
- }
- }
-
- /* Zero the new keyboard state and generate it */
- SDL_memset(kstate, 0, SDLK_LAST);
- /*
- * An obvious optimisation is to check entire longwords at a time in
- * both loops, but we can't be sure the arrays are aligned so it's not
- * worth the extra complexity
- */
- for ( i = 0; i < 32; i++ ) {
- int j;
- if ( !key_vec[i] )
- continue;
- for ( j = 0; j < 8; j++ ) {
- if ( key_vec[i] & (1 << j) ) {
- SDLKey key;
- KeyCode kc = (i << 3 | j);
- key = X11_TranslateKeycode(display, kc);
- if ( key == SDLK_UNKNOWN ) {
- continue;
- }
- kstate[key] = SDL_PRESSED;
- switch (key) {
- case SDLK_LSHIFT:
- modstate |= KMOD_LSHIFT;
- break;
- case SDLK_RSHIFT:
- modstate |= KMOD_RSHIFT;
- break;
- case SDLK_LCTRL:
- modstate |= KMOD_LCTRL;
- break;
- case SDLK_RCTRL:
- modstate |= KMOD_RCTRL;
- break;
- case SDLK_LALT:
- modstate |= KMOD_LALT;
- break;
- case SDLK_RALT:
- modstate |= KMOD_RALT;
- break;
- case SDLK_LMETA:
- modstate |= KMOD_LMETA;
- break;
- case SDLK_RMETA:
- modstate |= KMOD_RMETA;
- break;
- default:
- break;
- }
- }
- }
- }
-
- /* Hack - set toggle key state */
- if ( modstate & KMOD_CAPS ) {
- kstate[SDLK_CAPSLOCK] = SDL_PRESSED;
- } else {
- kstate[SDLK_CAPSLOCK] = SDL_RELEASED;
- }
- if ( modstate & KMOD_NUM ) {
- kstate[SDLK_NUMLOCK] = SDL_PRESSED;
- } else {
- kstate[SDLK_NUMLOCK] = SDL_RELEASED;
- }
-
- /* Set the final modifier state */
- SDL_SetModState(modstate);
-}
-
-void X11_InitOSKeymap(_THIS)
-{
- X11_InitKeymap();
-}
-
-void X11_SaveScreenSaver(Display *display, int *saved_timeout, BOOL *dpms)
-{
- int timeout, interval, prefer_blank, allow_exp;
- XGetScreenSaver(display, &timeout, &interval, &prefer_blank, &allow_exp);
- *saved_timeout = timeout;
-
-#if SDL_VIDEO_DRIVER_X11_DPMS
- if ( SDL_X11_HAVE_DPMS ) {
- int dummy;
- if ( DPMSQueryExtension(display, &dummy, &dummy) ) {
- CARD16 state;
- DPMSInfo(display, &state, dpms);
- }
- }
-#else
- *dpms = 0;
-#endif /* SDL_VIDEO_DRIVER_X11_DPMS */
-}
-
-void X11_DisableScreenSaver(_THIS, Display *display)
-{
- int timeout, interval, prefer_blank, allow_exp;
-
- if (this->hidden->allow_screensaver) {
- return;
- }
-
- XGetScreenSaver(display, &timeout, &interval, &prefer_blank, &allow_exp);
- timeout = 0;
- XSetScreenSaver(display, timeout, interval, prefer_blank, allow_exp);
-
-#if SDL_VIDEO_DRIVER_X11_DPMS
- if ( SDL_X11_HAVE_DPMS ) {
- int dummy;
- if ( DPMSQueryExtension(display, &dummy, &dummy) ) {
- DPMSDisable(display);
- }
- }
-#endif /* SDL_VIDEO_DRIVER_X11_DPMS */
-}
-
-void X11_RestoreScreenSaver(_THIS, Display *display, int saved_timeout, BOOL dpms)
-{
- int timeout, interval, prefer_blank, allow_exp;
-
- if (this->hidden->allow_screensaver) {
- return;
- }
-
- XGetScreenSaver(display, &timeout, &interval, &prefer_blank, &allow_exp);
- timeout = saved_timeout;
- XSetScreenSaver(display, timeout, interval, prefer_blank, allow_exp);
-
-#if SDL_VIDEO_DRIVER_X11_DPMS
- if ( SDL_X11_HAVE_DPMS ) {
- int dummy;
- if ( DPMSQueryExtension(display, &dummy, &dummy) ) {
- if ( dpms ) {
- DPMSEnable(display);
- }
- }
- }
-#endif /* SDL_VIDEO_DRIVER_X11_DPMS */
-}
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11events_c.h b/distrib/sdl-1.2.12/src/video/x11/SDL_x11events_c.h
deleted file mode 100644
index 18a1708..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11events_c.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_x11video.h"
-
-/* Functions to be exported */
-extern void X11_InitOSKeymap(_THIS);
-extern void X11_PumpEvents(_THIS);
-extern void X11_SetKeyboardState(Display *display, const char *key_vec);
-
-extern void X11_SaveScreenSaver(Display *display, int *saved_timeout, BOOL *dpms);
-extern void X11_DisableScreenSaver(_THIS, Display *display);
-extern void X11_RestoreScreenSaver(_THIS, Display *display, int saved_timeout, BOOL dpms);
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11gamma.c b/distrib/sdl-1.2.12/src/video/x11/SDL_x11gamma.c
deleted file mode 100644
index 4bb998f..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11gamma.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL.h"
-#include "SDL_events.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_x11video.h"
-
-/* From the X server sources... */
-#define MAX_GAMMA 10.0
-#define MIN_GAMMA (1.0/MAX_GAMMA)
-
-static int X11_SetGammaNoLock(_THIS, float red, float green, float blue)
-{
-#if SDL_VIDEO_DRIVER_X11_VIDMODE
- if (use_vidmode >= 200) {
- SDL_NAME(XF86VidModeGamma) gamma;
- Bool succeeded;
-
- /* Clamp the gamma values */
- if ( red < MIN_GAMMA ) {
- gamma.red = MIN_GAMMA;
- } else
- if ( red > MAX_GAMMA ) {
- gamma.red = MAX_GAMMA;
- } else {
- gamma.red = red;
- }
- if ( green < MIN_GAMMA ) {
- gamma.green = MIN_GAMMA;
- } else
- if ( green > MAX_GAMMA ) {
- gamma.green = MAX_GAMMA;
- } else {
- gamma.green = green;
- }
- if ( blue < MIN_GAMMA ) {
- gamma.blue = MIN_GAMMA;
- } else
- if ( blue > MAX_GAMMA ) {
- gamma.blue = MAX_GAMMA;
- } else {
- gamma.blue = blue;
- }
- if ( SDL_GetAppState() & SDL_APPACTIVE ) {
- succeeded = SDL_NAME(XF86VidModeSetGamma)(SDL_Display, SDL_Screen, &gamma);
- XSync(SDL_Display, False);
- } else {
- gamma_saved[0] = gamma.red;
- gamma_saved[1] = gamma.green;
- gamma_saved[2] = gamma.blue;
- succeeded = True;
- }
- if ( succeeded ) {
- ++gamma_changed;
- }
- return succeeded ? 0 : -1;
- }
-#endif
- SDL_SetError("Gamma correction not supported");
- return -1;
-}
-int X11_SetVidModeGamma(_THIS, float red, float green, float blue)
-{
- int result;
-
- SDL_Lock_EventThread();
- result = X11_SetGammaNoLock(this, red, green, blue);
- SDL_Unlock_EventThread();
-
- return(result);
-}
-
-static int X11_GetGammaNoLock(_THIS, float *red, float *green, float *blue)
-{
-#if SDL_VIDEO_DRIVER_X11_VIDMODE
- if (use_vidmode >= 200) {
- SDL_NAME(XF86VidModeGamma) gamma;
- if (SDL_NAME(XF86VidModeGetGamma)(SDL_Display, SDL_Screen, &gamma)) {
- *red = gamma.red;
- *green = gamma.green;
- *blue = gamma.blue;
- return 0;
- }
- return -1;
- }
-#endif
- return -1;
-}
-int X11_GetVidModeGamma(_THIS, float *red, float *green, float *blue)
-{
- int result;
-
- SDL_Lock_EventThread();
- result = X11_GetGammaNoLock(this, red, green, blue);
- SDL_Unlock_EventThread();
-
- return(result);
-}
-
-void X11_SaveVidModeGamma(_THIS)
-{
- /* Try to save the current gamma, otherwise disable gamma control */
- if ( X11_GetGammaNoLock(this,
- &gamma_saved[0], &gamma_saved[1], &gamma_saved[2]) < 0 ) {
- this->SetGamma = 0;
- this->GetGamma = 0;
- }
- gamma_changed = 0;
-}
-void X11_SwapVidModeGamma(_THIS)
-{
- float new_gamma[3];
-
- if ( gamma_changed ) {
- new_gamma[0] = gamma_saved[0];
- new_gamma[1] = gamma_saved[1];
- new_gamma[2] = gamma_saved[2];
- X11_GetGammaNoLock(this, &gamma_saved[0], &gamma_saved[1], &gamma_saved[2]);
- X11_SetGammaNoLock(this, new_gamma[0], new_gamma[1], new_gamma[2]);
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11gamma_c.h b/distrib/sdl-1.2.12/src/video/x11/SDL_x11gamma_c.h
deleted file mode 100644
index 3135e19..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11gamma_c.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_x11gamma_h
-#define _SDL_x11gamma_h
-
-extern int X11_SetVidModeGamma(_THIS, float red, float green, float blue);
-extern int X11_GetVidModeGamma(_THIS, float *red, float *green, float *blue);
-extern void X11_SaveVidModeGamma(_THIS);
-extern void X11_SwapVidModeGamma(_THIS);
-
-#endif
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11gl.c b/distrib/sdl-1.2.12/src/video/x11/SDL_x11gl.c
deleted file mode 100644
index dcf8080..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11gl.c
+++ /dev/null
@@ -1,552 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_x11video.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_x11dga_c.h"
-#include "SDL_x11gl_c.h"
-
-#if defined(__IRIX__)
-/* IRIX doesn't have a GL library versioning system */
-#define DEFAULT_OPENGL "libGL.so"
-#elif defined(__MACOSX__)
-#define DEFAULT_OPENGL "/usr/X11R6/lib/libGL.1.dylib"
-#elif defined(__QNXNTO__)
-#define DEFAULT_OPENGL "libGL.so.3"
-#elif defined(__OpenBSD__)
-#define DEFAULT_OPENGL "libGL.so.4.0"
-#else
-#define DEFAULT_OPENGL "libGL.so.1"
-#endif
-
-#ifndef GLX_ARB_multisample
-#define GLX_ARB_multisample
-#define GLX_SAMPLE_BUFFERS_ARB 100000
-#define GLX_SAMPLES_ARB 100001
-#endif
-
-#ifndef GLX_EXT_visual_rating
-#define GLX_EXT_visual_rating
-#define GLX_VISUAL_CAVEAT_EXT 0x20
-#define GLX_NONE_EXT 0x8000
-#define GLX_SLOW_VISUAL_EXT 0x8001
-#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
-#endif
-
-#if SDL_VIDEO_OPENGL_GLX
-static int glXExtensionSupported(_THIS, const char *extension)
-{
- const char *extensions;
- const char *start;
- const char *where, *terminator;
-
- /* Extension names should not have spaces. */
- where = SDL_strchr(extension, ' ');
- if ( where || *extension == '\0' ) {
- return 0;
- }
-
- extensions = this->gl_data->glXQueryExtensionsString(GFX_Display,SDL_Screen);
- /* It takes a bit of care to be fool-proof about parsing the
- * OpenGL extensions string. Don't be fooled by sub-strings, etc.
- */
-
- start = extensions;
-
- for (;;) {
- where = SDL_strstr(start, extension);
- if (!where) break;
-
- terminator = where + strlen(extension);
- if (where == start || *(where - 1) == ' ')
- if (*terminator == ' ' || *terminator == '\0') return 1;
-
- start = terminator;
- }
- return 0;
-}
-#endif /* SDL_VIDEO_OPENGL_GLX */
-
-XVisualInfo *X11_GL_GetVisual(_THIS)
-{
-#if SDL_VIDEO_OPENGL_GLX
- /* 64 seems nice. */
- int attribs[64];
- int i;
-
- /* load the gl driver from a default path */
- if ( ! this->gl_config.driver_loaded ) {
- /* no driver has been loaded, use default (ourselves) */
- if ( X11_GL_LoadLibrary(this, NULL) < 0 ) {
- return NULL;
- }
- }
-
- /* See if we already have a window which we must use */
- if ( SDL_windowid ) {
- XWindowAttributes a;
- XVisualInfo vi_in;
- int out_count;
-
- XGetWindowAttributes(SDL_Display, SDL_Window, &a);
- vi_in.screen = SDL_Screen;
- vi_in.visualid = XVisualIDFromVisual(a.visual);
- glx_visualinfo = XGetVisualInfo(SDL_Display,
- VisualScreenMask|VisualIDMask, &vi_in, &out_count);
- return glx_visualinfo;
- }
-
- /* Setup our GLX attributes according to the gl_config. */
- i = 0;
- attribs[i++] = GLX_RGBA;
- attribs[i++] = GLX_RED_SIZE;
- attribs[i++] = this->gl_config.red_size;
- attribs[i++] = GLX_GREEN_SIZE;
- attribs[i++] = this->gl_config.green_size;
- attribs[i++] = GLX_BLUE_SIZE;
- attribs[i++] = this->gl_config.blue_size;
-
- if( this->gl_config.alpha_size ) {
- attribs[i++] = GLX_ALPHA_SIZE;
- attribs[i++] = this->gl_config.alpha_size;
- }
-
- if( this->gl_config.buffer_size ) {
- attribs[i++] = GLX_BUFFER_SIZE;
- attribs[i++] = this->gl_config.buffer_size;
- }
-
- if( this->gl_config.double_buffer ) {
- attribs[i++] = GLX_DOUBLEBUFFER;
- }
-
- attribs[i++] = GLX_DEPTH_SIZE;
- attribs[i++] = this->gl_config.depth_size;
-
- if( this->gl_config.stencil_size ) {
- attribs[i++] = GLX_STENCIL_SIZE;
- attribs[i++] = this->gl_config.stencil_size;
- }
-
- if( this->gl_config.accum_red_size ) {
- attribs[i++] = GLX_ACCUM_RED_SIZE;
- attribs[i++] = this->gl_config.accum_red_size;
- }
-
- if( this->gl_config.accum_green_size ) {
- attribs[i++] = GLX_ACCUM_GREEN_SIZE;
- attribs[i++] = this->gl_config.accum_green_size;
- }
-
- if( this->gl_config.accum_blue_size ) {
- attribs[i++] = GLX_ACCUM_BLUE_SIZE;
- attribs[i++] = this->gl_config.accum_blue_size;
- }
-
- if( this->gl_config.accum_alpha_size ) {
- attribs[i++] = GLX_ACCUM_ALPHA_SIZE;
- attribs[i++] = this->gl_config.accum_alpha_size;
- }
-
- if( this->gl_config.stereo ) {
- attribs[i++] = GLX_STEREO;
- }
-
- if( this->gl_config.multisamplebuffers ) {
- attribs[i++] = GLX_SAMPLE_BUFFERS_ARB;
- attribs[i++] = this->gl_config.multisamplebuffers;
- }
-
- if( this->gl_config.multisamplesamples ) {
- attribs[i++] = GLX_SAMPLES_ARB;
- attribs[i++] = this->gl_config.multisamplesamples;
- }
-
- if( this->gl_config.accelerated >= 0 &&
- glXExtensionSupported(this, "GLX_EXT_visual_rating") ) {
- attribs[i++] = GLX_VISUAL_CAVEAT_EXT;
- attribs[i++] = GLX_NONE_EXT;
- }
-
-#ifdef GLX_DIRECT_COLOR /* Try for a DirectColor visual for gamma support */
- if ( !SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ) {
- attribs[i++] = GLX_X_VISUAL_TYPE;
- attribs[i++] = GLX_DIRECT_COLOR;
- }
-#endif
- attribs[i++] = None;
-
- glx_visualinfo = this->gl_data->glXChooseVisual(GFX_Display,
- SDL_Screen, attribs);
-#ifdef GLX_DIRECT_COLOR
- if( !glx_visualinfo && !SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ) { /* No DirectColor visual? Try again.. */
- attribs[i-3] = None;
- glx_visualinfo = this->gl_data->glXChooseVisual(GFX_Display,
- SDL_Screen, attribs);
- }
-#endif
- if( !glx_visualinfo ) {
- SDL_SetError( "Couldn't find matching GLX visual");
- return NULL;
- }
-/*
- printf("Found GLX visual 0x%x\n", glx_visualinfo->visualid);
-*/
- return glx_visualinfo;
-#else
- SDL_SetError("X11 driver not configured with OpenGL");
- return NULL;
-#endif
-}
-
-int X11_GL_CreateWindow(_THIS, int w, int h)
-{
- int retval;
-#if SDL_VIDEO_OPENGL_GLX
- XSetWindowAttributes attributes;
- unsigned long mask;
- unsigned long black;
-
- black = (glx_visualinfo->visual == DefaultVisual(SDL_Display,
- SDL_Screen))
- ? BlackPixel(SDL_Display, SDL_Screen) : 0;
- attributes.background_pixel = black;
- attributes.border_pixel = black;
- attributes.colormap = SDL_XColorMap;
- mask = CWBackPixel | CWBorderPixel | CWColormap;
-
- SDL_Window = XCreateWindow(SDL_Display, WMwindow,
- 0, 0, w, h, 0, glx_visualinfo->depth,
- InputOutput, glx_visualinfo->visual,
- mask, &attributes);
- if ( !SDL_Window ) {
- SDL_SetError("Could not create window");
- return -1;
- }
- retval = 0;
-#else
- SDL_SetError("X11 driver not configured with OpenGL");
- retval = -1;
-#endif
- return(retval);
-}
-
-int X11_GL_CreateContext(_THIS)
-{
- int retval;
-#if SDL_VIDEO_OPENGL_GLX
-
- /* We do this to create a clean separation between X and GLX errors. */
- XSync( SDL_Display, False );
- glx_context = this->gl_data->glXCreateContext(GFX_Display,
- glx_visualinfo, NULL, True);
- XSync( GFX_Display, False );
-
- if ( glx_context == NULL ) {
- SDL_SetError("Could not create GL context");
- return(-1);
- }
- if ( X11_GL_MakeCurrent(this) < 0 ) {
- return(-1);
- }
- gl_active = 1;
-
- if ( !glXExtensionSupported(this, "GLX_SGI_swap_control") ) {
- this->gl_data->glXSwapIntervalSGI = NULL;
- }
- if ( !glXExtensionSupported(this, "GLX_MESA_swap_control") ) {
- this->gl_data->glXSwapIntervalMESA = NULL;
- this->gl_data->glXGetSwapIntervalMESA = NULL;
- }
- if ( this->gl_config.swap_control >= 0 ) {
- if ( this->gl_data->glXSwapIntervalMESA ) {
- this->gl_data->glXSwapIntervalMESA(this->gl_config.swap_control);
- } else if ( this->gl_data->glXSwapIntervalSGI ) {
- this->gl_data->glXSwapIntervalSGI(this->gl_config.swap_control);
- }
- }
-#else
- SDL_SetError("X11 driver not configured with OpenGL");
-#endif
- if ( gl_active ) {
- retval = 0;
- } else {
- retval = -1;
- }
- return(retval);
-}
-
-void X11_GL_Shutdown(_THIS)
-{
-#if SDL_VIDEO_OPENGL_GLX
- /* Clean up OpenGL */
- if( glx_context ) {
- this->gl_data->glXMakeCurrent(GFX_Display, None, NULL);
-
- if (glx_context != NULL)
- this->gl_data->glXDestroyContext(GFX_Display, glx_context);
-
- glx_context = NULL;
- }
- gl_active = 0;
-#endif /* SDL_VIDEO_OPENGL_GLX */
-}
-
-#if SDL_VIDEO_OPENGL_GLX
-
-/* Make the current context active */
-int X11_GL_MakeCurrent(_THIS)
-{
- int retval;
-
- retval = 0;
- if ( ! this->gl_data->glXMakeCurrent(GFX_Display,
- SDL_Window, glx_context) ) {
- SDL_SetError("Unable to make GL context current");
- retval = -1;
- }
- XSync( GFX_Display, False );
-
- /* More Voodoo X server workarounds... Grr... */
- SDL_Lock_EventThread();
- X11_CheckDGAMouse(this);
- SDL_Unlock_EventThread();
-
- return(retval);
-}
-
-/* Get attribute data from glX. */
-int X11_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
-{
- int retval;
- int glx_attrib = None;
-
- switch( attrib ) {
- case SDL_GL_RED_SIZE:
- glx_attrib = GLX_RED_SIZE;
- break;
- case SDL_GL_GREEN_SIZE:
- glx_attrib = GLX_GREEN_SIZE;
- break;
- case SDL_GL_BLUE_SIZE:
- glx_attrib = GLX_BLUE_SIZE;
- break;
- case SDL_GL_ALPHA_SIZE:
- glx_attrib = GLX_ALPHA_SIZE;
- break;
- case SDL_GL_DOUBLEBUFFER:
- glx_attrib = GLX_DOUBLEBUFFER;
- break;
- case SDL_GL_BUFFER_SIZE:
- glx_attrib = GLX_BUFFER_SIZE;
- break;
- case SDL_GL_DEPTH_SIZE:
- glx_attrib = GLX_DEPTH_SIZE;
- break;
- case SDL_GL_STENCIL_SIZE:
- glx_attrib = GLX_STENCIL_SIZE;
- break;
- case SDL_GL_ACCUM_RED_SIZE:
- glx_attrib = GLX_ACCUM_RED_SIZE;
- break;
- case SDL_GL_ACCUM_GREEN_SIZE:
- glx_attrib = GLX_ACCUM_GREEN_SIZE;
- break;
- case SDL_GL_ACCUM_BLUE_SIZE:
- glx_attrib = GLX_ACCUM_BLUE_SIZE;
- break;
- case SDL_GL_ACCUM_ALPHA_SIZE:
- glx_attrib = GLX_ACCUM_ALPHA_SIZE;
- break;
- case SDL_GL_STEREO:
- glx_attrib = GLX_STEREO;
- break;
- case SDL_GL_MULTISAMPLEBUFFERS:
- glx_attrib = GLX_SAMPLE_BUFFERS_ARB;
- break;
- case SDL_GL_MULTISAMPLESAMPLES:
- glx_attrib = GLX_SAMPLES_ARB;
- break;
- case SDL_GL_ACCELERATED_VISUAL:
- if ( glXExtensionSupported(this, "GLX_EXT_visual_rating") ) {
- glx_attrib = GLX_VISUAL_CAVEAT_EXT;
- retval = this->gl_data->glXGetConfig(GFX_Display, glx_visualinfo, glx_attrib, value);
- if ( *value == GLX_SLOW_VISUAL_EXT ) {
- *value = SDL_FALSE;
- } else {
- *value = SDL_TRUE;
- }
- return retval;
- } else {
- return(-1);
- }
- break;
- case SDL_GL_SWAP_CONTROL:
- if ( this->gl_data->glXGetSwapIntervalMESA ) {
- *value = this->gl_data->glXGetSwapIntervalMESA();
- return(0);
- } else {
- return(-1);
- }
- break;
- default:
- return(-1);
- }
-
- retval = this->gl_data->glXGetConfig(GFX_Display, glx_visualinfo, glx_attrib, value);
-
- return retval;
-}
-
-void X11_GL_SwapBuffers(_THIS)
-{
- this->gl_data->glXSwapBuffers(GFX_Display, SDL_Window);
-}
-
-#endif /* SDL_VIDEO_OPENGL_GLX */
-
-#define OPENGL_REQUIRS_DLOPEN
-#if defined(OPENGL_REQUIRS_DLOPEN) && defined(SDL_LOADSO_DLOPEN)
-#include <dlfcn.h>
-#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
-#endif
-
-void X11_GL_UnloadLibrary(_THIS)
-{
-#if SDL_VIDEO_OPENGL_GLX
- if ( this->gl_config.driver_loaded ) {
-
- GL_UnloadObject(this->gl_config.dll_handle);
-
- this->gl_data->glXGetProcAddress = NULL;
- this->gl_data->glXChooseVisual = NULL;
- this->gl_data->glXCreateContext = NULL;
- this->gl_data->glXDestroyContext = NULL;
- this->gl_data->glXMakeCurrent = NULL;
- this->gl_data->glXSwapBuffers = NULL;
- this->gl_data->glXSwapIntervalSGI = NULL;
- this->gl_data->glXSwapIntervalMESA = NULL;
- this->gl_data->glXGetSwapIntervalMESA = NULL;
-
- this->gl_config.dll_handle = NULL;
- this->gl_config.driver_loaded = 0;
- }
-#endif
-}
-
-#if SDL_VIDEO_OPENGL_GLX
-
-/* Passing a NULL path means load pointers from the application */
-int X11_GL_LoadLibrary(_THIS, const char* path)
-{
- void* handle = NULL;
-
- if ( gl_active ) {
- SDL_SetError("OpenGL context already created");
- return -1;
- }
-
- if ( path == NULL ) {
- path = SDL_getenv("SDL_VIDEO_GL_DRIVER");
- if ( path == NULL ) {
- path = DEFAULT_OPENGL;
- }
- }
-
- handle = GL_LoadObject(path);
- if ( handle == NULL ) {
-#if defined(OPENGL_REQUIRS_DLOPEN) && defined(SDL_LOADSO_DLOPEN)
- SDL_SetError("Failed loading %s", path);
-#else
- /* SDL_LoadObject() will call SDL_SetError() for us. */
-#endif
- return -1;
- }
-
- /* Unload the old driver and reset the pointers */
- X11_GL_UnloadLibrary(this);
-
- /* Load new function pointers */
- this->gl_data->glXGetProcAddress =
- (void *(*)(const GLubyte *)) GL_LoadFunction(handle, "glXGetProcAddressARB");
- this->gl_data->glXChooseVisual =
- (XVisualInfo *(*)(Display *, int, int *)) GL_LoadFunction(handle, "glXChooseVisual");
- this->gl_data->glXCreateContext =
- (GLXContext (*)(Display *, XVisualInfo *, GLXContext, int)) GL_LoadFunction(handle, "glXCreateContext");
- this->gl_data->glXDestroyContext =
- (void (*)(Display *, GLXContext)) GL_LoadFunction(handle, "glXDestroyContext");
- this->gl_data->glXMakeCurrent =
- (int (*)(Display *, GLXDrawable, GLXContext)) GL_LoadFunction(handle, "glXMakeCurrent");
- this->gl_data->glXSwapBuffers =
- (void (*)(Display *, GLXDrawable)) GL_LoadFunction(handle, "glXSwapBuffers");
- this->gl_data->glXGetConfig =
- (int (*)(Display *, XVisualInfo *, int, int *)) GL_LoadFunction(handle, "glXGetConfig");
- this->gl_data->glXQueryExtensionsString =
- (const char *(*)(Display *, int)) GL_LoadFunction(handle, "glXQueryExtensionsString");
- this->gl_data->glXSwapIntervalSGI =
- (int (*)(int)) GL_LoadFunction(handle, "glXSwapIntervalSGI");
- this->gl_data->glXSwapIntervalMESA =
- (GLint (*)(unsigned)) GL_LoadFunction(handle, "glXSwapIntervalMESA");
- this->gl_data->glXGetSwapIntervalMESA =
- (GLint (*)(void)) GL_LoadFunction(handle, "glXGetSwapIntervalMESA");
-
- if ( (this->gl_data->glXChooseVisual == NULL) ||
- (this->gl_data->glXCreateContext == NULL) ||
- (this->gl_data->glXDestroyContext == NULL) ||
- (this->gl_data->glXMakeCurrent == NULL) ||
- (this->gl_data->glXSwapBuffers == NULL) ||
- (this->gl_data->glXGetConfig == NULL) ||
- (this->gl_data->glXQueryExtensionsString == NULL)) {
- SDL_SetError("Could not retrieve OpenGL functions");
- return -1;
- }
-
- this->gl_config.dll_handle = handle;
- this->gl_config.driver_loaded = 1;
- if ( path ) {
- SDL_strlcpy(this->gl_config.driver_path, path,
- SDL_arraysize(this->gl_config.driver_path));
- } else {
- *this->gl_config.driver_path = '\0';
- }
- return 0;
-}
-
-void *X11_GL_GetProcAddress(_THIS, const char* proc)
-{
- void* handle;
-
- handle = this->gl_config.dll_handle;
- if ( this->gl_data->glXGetProcAddress ) {
- return this->gl_data->glXGetProcAddress((const GLubyte *)proc);
- }
- return GL_LoadFunction(handle, proc);
-}
-
-#endif /* SDL_VIDEO_OPENGL_GLX */
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11gl_c.h b/distrib/sdl-1.2.12/src/video/x11/SDL_x11gl_c.h
deleted file mode 100644
index 4cca378..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11gl_c.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#if SDL_VIDEO_OPENGL_GLX
-#include <GL/glx.h>
-#include "SDL_loadso.h"
-#endif
-
-#include "../SDL_sysvideo.h"
-
-struct SDL_PrivateGLData {
- int gl_active; /* to stop switching drivers while we have a valid context */
-
-#if SDL_VIDEO_OPENGL_GLX
- GLXContext glx_context; /* Current GL context */
- XVisualInfo* glx_visualinfo; /* XVisualInfo* returned by glXChooseVisual */
-
- void * (*glXGetProcAddress)(const GLubyte *procName);
-
- XVisualInfo* (*glXChooseVisual)
- ( Display* dpy,
- int screen,
- int* attribList );
-
- GLXContext (*glXCreateContext)
- ( Display* dpy,
- XVisualInfo* vis,
- GLXContext shareList,
- Bool direct );
-
- void (*glXDestroyContext)
- ( Display* dpy,
- GLXContext ctx );
-
- Bool (*glXMakeCurrent)
- ( Display* dpy,
- GLXDrawable drawable,
- GLXContext ctx );
-
- void (*glXSwapBuffers)
- ( Display* dpy,
- GLXDrawable drawable );
-
- int (*glXGetConfig)
- ( Display* dpy,
- XVisualInfo* visual_info,
- int attrib,
- int* value );
-
- const char *(*glXQueryExtensionsString)
- ( Display* dpy,
- int screen );
-
- int (*glXSwapIntervalSGI) ( int interval );
- GLint (*glXSwapIntervalMESA) ( unsigned interval );
- GLint (*glXGetSwapIntervalMESA) ( void );
-
-#endif /* SDL_VIDEO_OPENGL_GLX */
-};
-
-/* Old variable names */
-#define gl_active (this->gl_data->gl_active)
-#define glx_context (this->gl_data->glx_context)
-#define glx_visualinfo (this->gl_data->glx_visualinfo)
-
-/* OpenGL functions */
-extern XVisualInfo *X11_GL_GetVisual(_THIS);
-extern int X11_GL_CreateWindow(_THIS, int w, int h);
-extern int X11_GL_CreateContext(_THIS);
-extern void X11_GL_Shutdown(_THIS);
-#if SDL_VIDEO_OPENGL_GLX
-extern int X11_GL_MakeCurrent(_THIS);
-extern int X11_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
-extern void X11_GL_SwapBuffers(_THIS);
-extern int X11_GL_LoadLibrary(_THIS, const char* path);
-extern void *X11_GL_GetProcAddress(_THIS, const char* proc);
-#endif
-extern void X11_GL_UnloadLibrary(_THIS);
-
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11image.c b/distrib/sdl-1.2.12/src/video/x11/SDL_x11image.c
deleted file mode 100644
index a2d011d..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11image.c
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <stdio.h>
-#include <unistd.h>
-
-#include "SDL_endian.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_x11image_c.h"
-
-#ifndef NO_SHARED_MEMORY
-
-/* Shared memory error handler routine */
-static int shm_error;
-static int (*X_handler)(Display *, XErrorEvent *) = NULL;
-static int shm_errhandler(Display *d, XErrorEvent *e)
-{
- if ( e->error_code == BadAccess ) {
- shm_error = True;
- return(0);
- } else
- return(X_handler(d,e));
-}
-
-static void try_mitshm(_THIS, SDL_Surface *screen)
-{
- /* Dynamic X11 may not have SHM entry points on this box. */
- if ((use_mitshm) && (!SDL_X11_HAVE_SHM))
- use_mitshm = 0;
-
- if(!use_mitshm)
- return;
- shminfo.shmid = shmget(IPC_PRIVATE, screen->h*screen->pitch,
- IPC_CREAT | 0777);
- if ( shminfo.shmid >= 0 ) {
- shminfo.shmaddr = (char *)shmat(shminfo.shmid, 0, 0);
- shminfo.readOnly = False;
- if ( shminfo.shmaddr != (char *)-1 ) {
- shm_error = False;
- X_handler = XSetErrorHandler(shm_errhandler);
- XShmAttach(SDL_Display, &shminfo);
- XSync(SDL_Display, True);
- XSetErrorHandler(X_handler);
- if ( shm_error )
- shmdt(shminfo.shmaddr);
- } else {
- shm_error = True;
- }
- shmctl(shminfo.shmid, IPC_RMID, NULL);
- } else {
- shm_error = True;
- }
- if ( shm_error )
- use_mitshm = 0;
- if ( use_mitshm )
- screen->pixels = shminfo.shmaddr;
-}
-#endif /* ! NO_SHARED_MEMORY */
-
-/* Various screen update functions available */
-static void X11_NormalUpdate(_THIS, int numrects, SDL_Rect *rects);
-static void X11_MITSHMUpdate(_THIS, int numrects, SDL_Rect *rects);
-
-int X11_SetupImage(_THIS, SDL_Surface *screen)
-{
-#ifndef NO_SHARED_MEMORY
- try_mitshm(this, screen);
- if(use_mitshm) {
- SDL_Ximage = XShmCreateImage(SDL_Display, SDL_Visual,
- this->hidden->depth, ZPixmap,
- shminfo.shmaddr, &shminfo,
- screen->w, screen->h);
- if(!SDL_Ximage) {
- XShmDetach(SDL_Display, &shminfo);
- XSync(SDL_Display, False);
- shmdt(shminfo.shmaddr);
- screen->pixels = NULL;
- goto error;
- }
- this->UpdateRects = X11_MITSHMUpdate;
- }
- if(!use_mitshm)
-#endif /* not NO_SHARED_MEMORY */
- {
- int bpp;
- screen->pixels = SDL_malloc(screen->h*screen->pitch);
- if ( screen->pixels == NULL ) {
- SDL_OutOfMemory();
- return -1;
- }
- bpp = screen->format->BytesPerPixel;
- SDL_Ximage = XCreateImage(SDL_Display, SDL_Visual,
- this->hidden->depth, ZPixmap, 0,
- (char *)screen->pixels,
- screen->w, screen->h,
- 32, 0);
- if ( SDL_Ximage == NULL )
- goto error;
- /* XPutImage will convert byte sex automatically */
- SDL_Ximage->byte_order = (SDL_BYTEORDER == SDL_BIG_ENDIAN)
- ? MSBFirst : LSBFirst;
- this->UpdateRects = X11_NormalUpdate;
- }
- screen->pitch = SDL_Ximage->bytes_per_line;
- return(0);
-
-error:
- SDL_SetError("Couldn't create XImage");
- return 1;
-}
-
-void X11_DestroyImage(_THIS, SDL_Surface *screen)
-{
- if ( SDL_Ximage ) {
- XDestroyImage(SDL_Ximage);
-#ifndef NO_SHARED_MEMORY
- if ( use_mitshm ) {
- XShmDetach(SDL_Display, &shminfo);
- XSync(SDL_Display, False);
- shmdt(shminfo.shmaddr);
- }
-#endif /* ! NO_SHARED_MEMORY */
- SDL_Ximage = NULL;
- }
- if ( screen ) {
- screen->pixels = NULL;
- }
-}
-
-/* Determine the number of CPUs in the system */
-static int num_CPU(void)
-{
- static int num_cpus = 0;
-
- if(!num_cpus) {
-#if defined(__LINUX__)
- char line[BUFSIZ];
- FILE *pstat = fopen("/proc/stat", "r");
- if ( pstat ) {
- while ( fgets(line, sizeof(line), pstat) ) {
- if (SDL_memcmp(line, "cpu", 3) == 0 && line[3] != ' ') {
- ++num_cpus;
- }
- }
- fclose(pstat);
- }
-#elif defined(__IRIX__)
- num_cpus = sysconf(_SC_NPROC_ONLN);
-#elif defined(_SC_NPROCESSORS_ONLN)
- /* number of processors online (SVR4.0MP compliant machines) */
- num_cpus = sysconf(_SC_NPROCESSORS_ONLN);
-#elif defined(_SC_NPROCESSORS_CONF)
- /* number of processors configured (SVR4.0MP compliant machines) */
- num_cpus = sysconf(_SC_NPROCESSORS_CONF);
-#endif
- if ( num_cpus <= 0 ) {
- num_cpus = 1;
- }
- }
- return num_cpus;
-}
-
-int X11_ResizeImage(_THIS, SDL_Surface *screen, Uint32 flags)
-{
- int retval;
-
- X11_DestroyImage(this, screen);
- if ( flags & SDL_OPENGL ) { /* No image when using GL */
- retval = 0;
- } else {
- retval = X11_SetupImage(this, screen);
- /* We support asynchronous blitting on the display */
- if ( flags & SDL_ASYNCBLIT ) {
- /* This is actually slower on single-CPU systems,
- probably because of CPU contention between the
- X server and the application.
- Note: Is this still true with XFree86 4.0?
- */
- if ( num_CPU() > 1 ) {
- screen->flags |= SDL_ASYNCBLIT;
- }
- }
- }
- return(retval);
-}
-
-/* We don't actually allow hardware surfaces other than the main one */
-int X11_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- return(-1);
-}
-void X11_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-int X11_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- if ( (surface == SDL_VideoSurface) && blit_queued ) {
- XSync(GFX_Display, False);
- blit_queued = 0;
- }
- return(0);
-}
-void X11_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-int X11_FlipHWSurface(_THIS, SDL_Surface *surface)
-{
- return(0);
-}
-
-static void X11_NormalUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
- int i;
-
- for (i = 0; i < numrects; ++i) {
- if ( rects[i].w == 0 || rects[i].h == 0 ) { /* Clipped? */
- continue;
- }
- XPutImage(GFX_Display, SDL_Window, SDL_GC, SDL_Ximage,
- rects[i].x, rects[i].y,
- rects[i].x, rects[i].y, rects[i].w, rects[i].h);
- }
- if ( SDL_VideoSurface->flags & SDL_ASYNCBLIT ) {
- XFlush(GFX_Display);
- blit_queued = 1;
- } else {
- XSync(GFX_Display, False);
- }
-}
-
-static void X11_MITSHMUpdate(_THIS, int numrects, SDL_Rect *rects)
-{
-#ifndef NO_SHARED_MEMORY
- int i;
-
- for ( i=0; i<numrects; ++i ) {
- if ( rects[i].w == 0 || rects[i].h == 0 ) { /* Clipped? */
- continue;
- }
- XShmPutImage(GFX_Display, SDL_Window, SDL_GC, SDL_Ximage,
- rects[i].x, rects[i].y,
- rects[i].x, rects[i].y, rects[i].w, rects[i].h,
- False);
- }
- if ( SDL_VideoSurface->flags & SDL_ASYNCBLIT ) {
- XFlush(GFX_Display);
- blit_queued = 1;
- } else {
- XSync(GFX_Display, False);
- }
-#endif /* ! NO_SHARED_MEMORY */
-}
-
-/* There's a problem with the automatic refreshing of the display.
- Even though the XVideo code uses the GFX_Display to update the
- video memory, it appears that updating the window asynchronously
- from a different thread will cause "blackouts" of the window.
- This is a sort of a hacked workaround for the problem.
-*/
-static int enable_autorefresh = 1;
-
-void X11_DisableAutoRefresh(_THIS)
-{
- --enable_autorefresh;
-}
-
-void X11_EnableAutoRefresh(_THIS)
-{
- ++enable_autorefresh;
-}
-
-void X11_RefreshDisplay(_THIS)
-{
- /* Don't refresh a display that doesn't have an image (like GL)
- Instead, post an expose event so the application can refresh.
- */
- if ( ! SDL_Ximage || (enable_autorefresh <= 0) ) {
- SDL_PrivateExpose();
- return;
- }
-#ifndef NO_SHARED_MEMORY
- if ( this->UpdateRects == X11_MITSHMUpdate ) {
- XShmPutImage(SDL_Display, SDL_Window, SDL_GC, SDL_Ximage,
- 0, 0, 0, 0, this->screen->w, this->screen->h,
- False);
- } else
-#endif /* ! NO_SHARED_MEMORY */
- {
- XPutImage(SDL_Display, SDL_Window, SDL_GC, SDL_Ximage,
- 0, 0, 0, 0, this->screen->w, this->screen->h);
- }
- XSync(SDL_Display, False);
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11image_c.h b/distrib/sdl-1.2.12/src/video/x11/SDL_x11image_c.h
deleted file mode 100644
index 52ff838..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11image_c.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_x11video.h"
-
-extern int X11_SetupImage(_THIS, SDL_Surface *screen);
-extern void X11_DestroyImage(_THIS, SDL_Surface *screen);
-extern int X11_ResizeImage(_THIS, SDL_Surface *screen, Uint32 flags);
-
-extern int X11_AllocHWSurface(_THIS, SDL_Surface *surface);
-extern void X11_FreeHWSurface(_THIS, SDL_Surface *surface);
-extern int X11_LockHWSurface(_THIS, SDL_Surface *surface);
-extern void X11_UnlockHWSurface(_THIS, SDL_Surface *surface);
-extern int X11_FlipHWSurface(_THIS, SDL_Surface *surface);
-
-extern void X11_DisableAutoRefresh(_THIS);
-extern void X11_EnableAutoRefresh(_THIS);
-extern void X11_RefreshDisplay(_THIS);
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11modes.c b/distrib/sdl-1.2.12/src/video/x11/SDL_x11modes.c
deleted file mode 100644
index 2f7367f..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11modes.c
+++ /dev/null
@@ -1,1110 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Utilities for getting and setting the X display mode */
-
-#include <stdio.h>
-
-#include "SDL_timer.h"
-#include "SDL_events.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_x11video.h"
-#include "SDL_x11wm_c.h"
-#include "SDL_x11modes_c.h"
-#include "SDL_x11image_c.h"
-
-/*#define X11MODES_DEBUG*/
-
-#define MAX(a, b) (a > b ? a : b)
-
-#if SDL_VIDEO_DRIVER_X11_XRANDR
-static int cmpmodelist(const void *va, const void *vb)
-{
- const SDL_Rect *a = *(const SDL_Rect **)va;
- const SDL_Rect *b = *(const SDL_Rect **)vb;
- if ( a->w == b->w )
- return b->h - a->h;
- else
- return b->w - a->w;
-}
-#endif
-
-#if SDL_VIDEO_DRIVER_X11_VIDMODE
-Bool SDL_NAME(XF86VidModeGetModeInfo)(Display *dpy, int scr, SDL_NAME(XF86VidModeModeInfo) *info)
-{
- SDL_NAME(XF86VidModeModeLine) *l = (SDL_NAME(XF86VidModeModeLine)*)((char*)info + sizeof info->dotclock);
- return SDL_NAME(XF86VidModeGetModeLine)(dpy, scr, (int*)&info->dotclock, l);
-}
-#endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */
-
-#if SDL_VIDEO_DRIVER_X11_VIDMODE
-static void save_mode(_THIS)
-{
- SDL_memset(&saved_mode, 0, sizeof(saved_mode));
- SDL_NAME(XF86VidModeGetModeInfo)(SDL_Display,SDL_Screen,&saved_mode);
- SDL_NAME(XF86VidModeGetViewPort)(SDL_Display,SDL_Screen,&saved_view.x,&saved_view.y);
-}
-#endif
-
-#if SDL_VIDEO_DRIVER_X11_VIDMODE
-static void restore_mode(_THIS)
-{
- SDL_NAME(XF86VidModeModeLine) mode;
- int unused;
-
- if ( SDL_NAME(XF86VidModeGetModeLine)(SDL_Display, SDL_Screen, &unused, &mode) ) {
- if ( (saved_mode.hdisplay != mode.hdisplay) ||
- (saved_mode.vdisplay != mode.vdisplay) ) {
- SDL_NAME(XF86VidModeSwitchToMode)(SDL_Display, SDL_Screen, &saved_mode);
- }
- }
- if ( (saved_view.x != 0) || (saved_view.y != 0) ) {
- SDL_NAME(XF86VidModeSetViewPort)(SDL_Display, SDL_Screen, saved_view.x, saved_view.y);
- }
-}
-#endif
-
-#if SDL_VIDEO_DRIVER_X11_VIDMODE
-static int cmpmodes(const void *va, const void *vb)
-{
- const SDL_NAME(XF86VidModeModeInfo) *a = *(const SDL_NAME(XF86VidModeModeInfo)**)va;
- const SDL_NAME(XF86VidModeModeInfo) *b = *(const SDL_NAME(XF86VidModeModeInfo)**)vb;
- if ( a->hdisplay == b->hdisplay )
- return b->vdisplay - a->vdisplay;
- else
- return b->hdisplay - a->hdisplay;
-}
-#endif
-
-static void get_real_resolution(_THIS, int* w, int* h);
-
-static void set_best_resolution(_THIS, int width, int height)
-{
-#if SDL_VIDEO_DRIVER_X11_VIDMODE
- if ( use_vidmode ) {
- SDL_NAME(XF86VidModeModeLine) mode;
- SDL_NAME(XF86VidModeModeInfo) **modes;
- int i;
- int nmodes;
- int best = -1;
-
- if ( SDL_NAME(XF86VidModeGetModeLine)(SDL_Display, SDL_Screen, &i, &mode) &&
- SDL_NAME(XF86VidModeGetAllModeLines)(SDL_Display,SDL_Screen,&nmodes,&modes) ) {
- for ( i = 0; i < nmodes ; i++ ) {
- if ( (modes[i]->hdisplay == width) &&
- (modes[i]->vdisplay == height) ) {
- best = i;
- break;
- }
- if ( modes[i]->hdisplay >= width &&
- modes[i]->vdisplay >= height ) {
- if ( best < 0 ||
- (modes[i]->hdisplay < modes[best]->hdisplay &&
- modes[i]->vdisplay <= modes[best]->vdisplay) ||
- (modes[i]->vdisplay < modes[best]->vdisplay &&
- modes[i]->hdisplay <= modes[best]->hdisplay) ) {
- best = i;
- }
- }
- }
- if ( best >= 0 &&
- ((modes[best]->hdisplay != mode.hdisplay) ||
- (modes[best]->vdisplay != mode.vdisplay)) ) {
-#ifdef X11MODES_DEBUG
- printf("Best Mode %d: %d x %d @ %d\n", best,
- modes[best]->hdisplay, modes[best]->vdisplay,
- (modes[best]->htotal && modes[best]->vtotal) ? (1000 * modes[best]->dotclock / (modes[best]->htotal * modes[best]->vtotal)) : 0 );
-#endif
- SDL_NAME(XF86VidModeSwitchToMode)(SDL_Display, SDL_Screen, modes[best]);
- }
- XFree(modes);
- }
- }
-#endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */
-
- /* XiG */
-#if SDL_VIDEO_DRIVER_X11_XME
- if ( use_xme && SDL_modelist ) {
- int i;
-
-#ifdef X11MODES_DEBUG
- fprintf(stderr, "XME: set_best_resolution(): w = %d, h = %d\n",
- width, height);
-#endif
- for ( i=0; SDL_modelist[i]; ++i ) {
- if ( (SDL_modelist[i]->w >= width) &&
- (SDL_modelist[i]->h >= height) ) {
- break;
- }
- }
-
- if ( SDL_modelist[i] ) { /* found one, lets try it */
- int w, h;
-
- /* check current mode so we can avoid uneccessary mode changes */
- get_real_resolution(this, &w, &h);
-
- if ( (SDL_modelist[i]->w != w) || (SDL_modelist[i]->h != h) ) {
-#ifdef X11MODES_DEBUG
- fprintf(stderr, "XME: set_best_resolution: "
- "XiGMiscChangeResolution: %d %d\n",
- SDL_modelist[i]->w, SDL_modelist[i]->h);
-#endif
- XiGMiscChangeResolution(SDL_Display,
- SDL_Screen,
- 0, /* view */
- SDL_modelist[i]->w,
- SDL_modelist[i]->h,
- 0);
- XSync(SDL_Display, False);
- }
- }
- }
-#endif /* SDL_VIDEO_DRIVER_X11_XME */
-
-#if SDL_VIDEO_DRIVER_X11_XRANDR
- if ( use_xrandr && SDL_modelist ) {
-#ifdef X11MODES_DEBUG
- fprintf(stderr, "XRANDR: set_best_resolution(): w = %d, h = %d\n",
- width, height);
-#endif
- int i, nsizes;
- XRRScreenSize *sizes;
-
- /* find the smallest resolution that is at least as big as the user requested */
- sizes = XRRConfigSizes(screen_config, &nsizes);
- for ( i = (nsizes-1); i >= 0; i-- ) {
- if ( (SDL_modelist[i]->w >= width) &&
- (SDL_modelist[i]->h >= height) ) {
- break;
- }
- }
-
- if ( i >= 0 && SDL_modelist[i] ) { /* found one, lets try it */
- int w, h;
-
- /* check current mode so we can avoid uneccessary mode changes */
- get_real_resolution(this, &w, &h);
-
- if ( (SDL_modelist[i]->w != w) || (SDL_modelist[i]->h != h) ) {
- int size_id;
-
-#ifdef X11MODES_DEBUG
- fprintf(stderr, "XRANDR: set_best_resolution: "
- "XXRSetScreenConfig: %d %d\n",
- SDL_modelist[i]->w, SDL_modelist[i]->h);
-#endif
-
- /* find the matching size entry index */
- for ( size_id = 0; size_id < nsizes; ++size_id ) {
- if ( (sizes[size_id].width == SDL_modelist[i]->w) &&
- (sizes[size_id].height == SDL_modelist[i]->h) )
- break;
- }
-
- XRRSetScreenConfig(SDL_Display, screen_config, SDL_Root,
- size_id, saved_rotation, CurrentTime);
- }
- }
- }
-#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */
-}
-
-static void get_real_resolution(_THIS, int* w, int* h)
-{
-#if SDL_VIDEO_DRIVER_X11_XME
- if ( use_xme ) {
- int ractive;
- XiGMiscResolutionInfo *modelist;
-
- XiGMiscQueryResolutions(SDL_Display, SDL_Screen,
- 0, /* view */
- &ractive, &modelist);
- *w = modelist[ractive].width;
- *h = modelist[ractive].height;
-#ifdef X11MODES_DEBUG
- fprintf(stderr, "XME: get_real_resolution: w = %d h = %d\n", *w, *h);
-#endif
- XFree(modelist);
- return;
- }
-#endif /* SDL_VIDEO_DRIVER_X11_XME */
-
-#if SDL_VIDEO_DRIVER_X11_VIDMODE
- if ( use_vidmode ) {
- SDL_NAME(XF86VidModeModeLine) mode;
- int unused;
-
- if ( SDL_NAME(XF86VidModeGetModeLine)(SDL_Display, SDL_Screen, &unused, &mode) ) {
- *w = mode.hdisplay;
- *h = mode.vdisplay;
- return;
- }
- }
-#endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */
-
-#if SDL_VIDEO_DRIVER_X11_XRANDR
- if ( use_xrandr ) {
- int nsizes;
- XRRScreenSize* sizes;
-
- sizes = XRRConfigSizes(screen_config, &nsizes);
- if ( nsizes > 0 ) {
- int cur_size;
- Rotation cur_rotation;
-
- cur_size = XRRConfigCurrentConfiguration(screen_config, &cur_rotation);
- if ( cur_size >= 0 && cur_size < nsizes ) {
- *w = sizes[cur_size].width;
- *h = sizes[cur_size].height;
- }
-#ifdef X11MODES_DEBUG
- fprintf(stderr, "XRANDR: get_real_resolution: w = %d h = %d\n", *w, *h);
-#endif
- return;
- }
- }
-#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */
-
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
- if ( use_xinerama ) {
- *w = xinerama_info.width;
- *h = xinerama_info.height;
- return;
- }
-#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */
-
- *w = DisplayWidth(SDL_Display, SDL_Screen);
- *h = DisplayHeight(SDL_Display, SDL_Screen);
-}
-
-/* Called after mapping a window - waits until the window is mapped */
-void X11_WaitMapped(_THIS, Window win)
-{
- XEvent event;
- do {
- XMaskEvent(SDL_Display, StructureNotifyMask, &event);
- } while ( (event.type != MapNotify) || (event.xmap.event != win) );
-}
-
-/* Called after unmapping a window - waits until the window is unmapped */
-void X11_WaitUnmapped(_THIS, Window win)
-{
- XEvent event;
- do {
- XMaskEvent(SDL_Display, StructureNotifyMask, &event);
- } while ( (event.type != UnmapNotify) || (event.xunmap.event != win) );
-}
-
-static void move_cursor_to(_THIS, int x, int y)
-{
- XWarpPointer(SDL_Display, None, SDL_Root, 0, 0, 0, 0, x, y);
-}
-
-static int add_visual(_THIS, int depth, int class)
-{
- XVisualInfo vi;
- if(XMatchVisualInfo(SDL_Display, SDL_Screen, depth, class, &vi)) {
- int n = this->hidden->nvisuals;
- this->hidden->visuals[n].depth = vi.depth;
- this->hidden->visuals[n].visual = vi.visual;
- this->hidden->nvisuals++;
- }
- return(this->hidden->nvisuals);
-}
-static int add_visual_byid(_THIS, const char *visual_id)
-{
- XVisualInfo *vi, template;
- int nvis;
-
- if ( visual_id ) {
- SDL_memset(&template, 0, (sizeof template));
- template.visualid = SDL_strtol(visual_id, NULL, 0);
- vi = XGetVisualInfo(SDL_Display, VisualIDMask, &template, &nvis);
- if ( vi ) {
- int n = this->hidden->nvisuals;
- this->hidden->visuals[n].depth = vi->depth;
- this->hidden->visuals[n].visual = vi->visual;
- this->hidden->nvisuals++;
- XFree(vi);
- }
- }
- return(this->hidden->nvisuals);
-}
-
-/* Global for the error handler */
-int vm_event, vm_error = -1;
-
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
-static int CheckXinerama(_THIS, int *major, int *minor)
-{
- const char *env;
-
- /* Default the extension not available */
- *major = *minor = 0;
-
- /* Allow environment override */
- env = getenv("SDL_VIDEO_X11_XINERAMA");
- if ( env && !SDL_atoi(env) ) {
- return 0;
- }
-
- /* Query the extension version */
- if ( !SDL_NAME(XineramaQueryExtension)(SDL_Display, major, minor) ||
- !SDL_NAME(XineramaIsActive)(SDL_Display) ) {
- return 0;
- }
- return 1;
-}
-#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */
-
-#if SDL_VIDEO_DRIVER_X11_XRANDR
-static int CheckXRandR(_THIS, int *major, int *minor)
-{
- const char *env;
-
- /* Default the extension not available */
- *major = *minor = 0;
-
- /* Allow environment override */
- env = getenv("SDL_VIDEO_X11_XRANDR");
- if ( env && !SDL_atoi(env) ) {
- return 0;
- }
-
- /* This defaults off now, due to KDE window maximize problems */
- if ( !env ) {
- return 0;
- }
-
- if ( !SDL_X11_HAVE_XRANDR ) {
- return 0;
- }
-
- /* Query the extension version */
- if ( !XRRQueryVersion(SDL_Display, major, minor) ) {
- return 0;
- }
- return 1;
-}
-#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */
-
-#if SDL_VIDEO_DRIVER_X11_VIDMODE
-static int CheckVidMode(_THIS, int *major, int *minor)
-{
- const char *env;
-
- /* Default the extension not available */
- *major = *minor = 0;
-
- /* Allow environment override */
- env = getenv("SDL_VIDEO_X11_VIDMODE");
- if ( env && !SDL_atoi(env) ) {
- return 0;
- }
-
- /* Metro-X 4.3.0 and earlier has a broken implementation of
- XF86VidModeGetAllModeLines() - it hangs the client.
- */
- if ( SDL_strcmp(ServerVendor(SDL_Display), "Metro Link Incorporated") == 0 ) {
- FILE *metro_fp;
-
- metro_fp = fopen("/usr/X11R6/lib/X11/Metro/.version", "r");
- if ( metro_fp != NULL ) {
- int major, minor, patch, version;
- major = 0; minor = 0; patch = 0;
- fscanf(metro_fp, "%d.%d.%d", &major, &minor, &patch);
- fclose(metro_fp);
- version = major*100+minor*10+patch;
- if ( version < 431 ) {
- return 0;
- }
- }
- }
-
- /* Query the extension version */
- vm_error = -1;
- if ( !SDL_NAME(XF86VidModeQueryExtension)(SDL_Display, &vm_event, &vm_error) ||
- !SDL_NAME(XF86VidModeQueryVersion)(SDL_Display, major, minor) ) {
- return 0;
- }
- return 1;
-}
-#endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */
-
-#if SDL_VIDEO_DRIVER_X11_XME
-static int CheckXME(_THIS, int *major, int *minor)
-{
- const char *env;
-
- /* Default the extension not available */
- *major = *minor = 0;
-
- /* Allow environment override */
- env = getenv("SDL_VIDEO_X11_VIDMODE");
- if ( env && !SDL_atoi(env) ) {
- return 0;
- }
-
- /* Query the extension version */
- if ( !XiGMiscQueryVersion(SDL_Display, major, minor) ) {
- return 0;
- }
- return 1;
-}
-#endif /* SDL_VIDEO_DRIVER_X11_XME */
-
-int X11_GetVideoModes(_THIS)
-{
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
- int xinerama_major, xinerama_minor;
-#endif
-#if SDL_VIDEO_DRIVER_X11_XRANDR
- int xrandr_major, xrandr_minor;
- int nsizes;
- XRRScreenSize *sizes;
-#endif
-#if SDL_VIDEO_DRIVER_X11_VIDMODE
- int vm_major, vm_minor;
- int nmodes;
- SDL_NAME(XF86VidModeModeInfo) **modes;
-#endif
-#if SDL_VIDEO_DRIVER_X11_XME
- int xme_major, xme_minor;
- int ractive, nummodes;
- XiGMiscResolutionInfo *modelist;
-#endif
- int i, n;
- int screen_w;
- int screen_h;
-
- use_xinerama = 0;
- use_xrandr = 0;
- use_vidmode = 0;
- use_xme = 0;
- screen_w = DisplayWidth(SDL_Display, SDL_Screen);
- screen_h = DisplayHeight(SDL_Display, SDL_Screen);
-
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
- /* Query Xinerama extention */
- if ( CheckXinerama(this, &xinerama_major, &xinerama_minor) ) {
- /* Find out which screen is the desired one */
- int desired = 0;
- int screens;
- int w, h;
- SDL_NAME(XineramaScreenInfo) *xinerama;
-
- const char *variable = SDL_getenv("SDL_VIDEO_FULLSCREEN_HEAD");
- if ( variable ) {
- desired = SDL_atoi(variable);
- }
-#ifdef X11MODES_DEBUG
- printf("X11 detected Xinerama:\n");
-#endif
- xinerama = SDL_NAME(XineramaQueryScreens)(SDL_Display, &screens);
- for ( i = 0; i < screens; i++ ) {
-#ifdef X11MODES_DEBUG
- printf("xinerama %d: %dx%d+%d+%d\n",
- xinerama[i].screen_number,
- xinerama[i].width, xinerama[i].height,
- xinerama[i].x_org, xinerama[i].y_org);
-#endif
- if ( xinerama[i].screen_number == desired ) {
- use_xinerama = 1;
- xinerama_info = xinerama[i];
- }
- }
- XFree(xinerama);
-
- if ( use_xinerama ) {
- SDL_modelist = (SDL_Rect **)SDL_malloc(3*sizeof(SDL_Rect *));
- if ( !SDL_modelist ) {
- SDL_OutOfMemory();
- return -1;
- }
-
- /* Add the full xinerama mode */
- n = 0;
- w = xinerama_info.width;
- h = xinerama_info.height;
- if ( screen_w > w || screen_h > h) {
- SDL_modelist[n] = (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
- if ( SDL_modelist[n] ) {
- SDL_modelist[n]->x = 0;
- SDL_modelist[n]->y = 0;
- SDL_modelist[n]->w = screen_w;
- SDL_modelist[n]->h = screen_h;
- ++n;
- }
- }
-
- /* Add the head xinerama mode */
- SDL_modelist[n] = (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
- if ( SDL_modelist[n] ) {
- SDL_modelist[n]->x = 0;
- SDL_modelist[n]->y = 0;
- SDL_modelist[n]->w = w;
- SDL_modelist[n]->h = h;
- ++n;
- }
- SDL_modelist[n] = NULL;
- }
- }
-#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */
-
-#if SDL_VIDEO_DRIVER_X11_XRANDR
- /* XRandR */
- /* require at least XRandR v1.0 (arbitrary) */
- if ( CheckXRandR(this, &xrandr_major, &xrandr_minor) && (xrandr_major >= 1) )
- {
-#ifdef X11MODES_DEBUG
- fprintf(stderr, "XRANDR: XRRQueryVersion: V%d.%d\n",
- xrandr_major, xrandr_minor);
-#endif
-
- /* save the screen configuration since we must reference it
- each time we toggle modes.
- */
- screen_config = XRRGetScreenInfo(SDL_Display, SDL_Root);
-
- /* retrieve the list of resolution */
- sizes = XRRConfigSizes(screen_config, &nsizes);
- if (nsizes > 0) {
- if ( SDL_modelist ) {
- for ( i = 0; SDL_modelist[i]; ++i ) {
- SDL_free(SDL_modelist[i]);
- }
- SDL_free(SDL_modelist);
- }
- SDL_modelist = (SDL_Rect **)malloc((nsizes+1)*sizeof(SDL_Rect *));
- if ( !SDL_modelist ) {
- SDL_OutOfMemory();
- return -1;
- }
- for ( i=0; i < nsizes; i++ ) {
- if ((SDL_modelist[i] =
- (SDL_Rect *)malloc(sizeof(SDL_Rect))) == NULL)
- break;
-#ifdef X11MODES_DEBUG
- fprintf(stderr, "XRANDR: mode = %4d, w = %4d, h = %4d\n",
- i, sizes[i].width, sizes[i].height);
-#endif
-
- SDL_modelist[i]->x = 0;
- SDL_modelist[i]->y = 0;
- SDL_modelist[i]->w = sizes[i].width;
- SDL_modelist[i]->h = sizes[i].height;
-
- }
- /* sort the mode list descending as SDL expects */
- SDL_qsort(SDL_modelist, nsizes, sizeof *SDL_modelist, cmpmodelist);
- SDL_modelist[i] = NULL; /* terminator */
-
- use_xrandr = xrandr_major * 100 + xrandr_minor;
- saved_size_id = XRRConfigCurrentConfiguration(screen_config, &saved_rotation);
- }
- }
-#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */
-
-#if SDL_VIDEO_DRIVER_X11_VIDMODE
- /* XVidMode */
- if ( !use_xrandr &&
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
- (!use_xinerama || xinerama_info.screen_number == 0) &&
-#endif
- CheckVidMode(this, &vm_major, &vm_minor) &&
- SDL_NAME(XF86VidModeGetAllModeLines)(SDL_Display, SDL_Screen,&nmodes,&modes) )
- {
-#ifdef X11MODES_DEBUG
- printf("VidMode modes: (unsorted)\n");
- for ( i = 0; i < nmodes; ++i ) {
- printf("Mode %d: %d x %d @ %d\n", i,
- modes[i]->hdisplay, modes[i]->vdisplay,
- (modes[i]->htotal && modes[i]->vtotal) ? (1000 * modes[i]->dotclock / (modes[i]->htotal * modes[i]->vtotal)) : 0 );
- }
-#endif
- if ( SDL_modelist ) {
- for ( i = 0; SDL_modelist[i]; ++i ) {
- SDL_free(SDL_modelist[i]);
- }
- SDL_free(SDL_modelist);
- }
- SDL_modelist = (SDL_Rect **)SDL_malloc((nmodes+2)*sizeof(SDL_Rect *));
- if ( !SDL_modelist ) {
- SDL_OutOfMemory();
- return -1;
- }
- SDL_qsort(modes, nmodes, sizeof *modes, cmpmodes);
- n = 0;
- for ( i=0; i<nmodes; ++i ) {
- int w, h;
-
- /* Eliminate duplicate modes with different refresh rates */
- if ( i > 0 &&
- modes[i]->hdisplay == modes[i-1]->hdisplay &&
- modes[i]->vdisplay == modes[i-1]->vdisplay ) {
- continue;
- }
-
- /* Check to see if we should add the screen size (Xinerama) */
- w = modes[i]->hdisplay;
- h = modes[i]->vdisplay;
- if ( (screen_w * screen_h) >= (w * h) ) {
- if ( (screen_w != w) || (screen_h != h) ) {
- SDL_modelist[n] = (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
- if ( SDL_modelist[n] ) {
- SDL_modelist[n]->x = 0;
- SDL_modelist[n]->y = 0;
- SDL_modelist[n]->w = screen_w;
- SDL_modelist[n]->h = screen_h;
- ++n;
- }
- }
- screen_w = 0;
- screen_h = 0;
- }
-
- /* Add the size from the video mode list */
- SDL_modelist[n] = (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
- if ( SDL_modelist[n] == NULL ) {
- break;
- }
- SDL_modelist[n]->x = 0;
- SDL_modelist[n]->y = 0;
- SDL_modelist[n]->w = w;
- SDL_modelist[n]->h = h;
- ++n;
- }
- SDL_modelist[n] = NULL;
- XFree(modes);
-
- use_vidmode = vm_major * 100 + vm_minor;
- save_mode(this);
- }
-#endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */
-
-#if SDL_VIDEO_DRIVER_X11_XME
- /* XiG */
- modelist = NULL;
- /* first lets make sure we have the extension, and it's at least v2.0 */
- if ( CheckXME(this, &xme_major, &xme_minor) && xme_major >= 2 &&
- (nummodes = XiGMiscQueryResolutions(SDL_Display, SDL_Screen,
- 0, /* view */
- &ractive, &modelist)) > 1 )
- { /* then we actually have some */
- int j;
-
- /* We get the list already sorted in descending order.
- We'll copy it in reverse order so SDL is happy */
-#ifdef X11MODES_DEBUG
- fprintf(stderr, "XME: nummodes = %d, active mode = %d\n",
- nummodes, ractive);
-#endif
- if ( SDL_modelist ) {
- for ( i = 0; SDL_modelist[i]; ++i ) {
- SDL_free(SDL_modelist[i]);
- }
- SDL_free(SDL_modelist);
- }
- SDL_modelist = (SDL_Rect **)SDL_malloc((nummodes+1)*sizeof(SDL_Rect *));
- if ( !SDL_modelist ) {
- SDL_OutOfMemory();
- return -1;
- }
- for ( i=0, j=nummodes-1; j>=0; i++, j-- ) {
- if ((SDL_modelist[i] =
- (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect))) == NULL)
- break;
-#ifdef X11MODES_DEBUG
- fprintf(stderr, "XME: mode = %4d, w = %4d, h = %4d\n",
- i, modelist[i].width, modelist[i].height);
-#endif
-
- SDL_modelist[i]->x = 0;
- SDL_modelist[i]->y = 0;
- SDL_modelist[i]->w = modelist[j].width;
- SDL_modelist[i]->h = modelist[j].height;
-
- }
- SDL_modelist[i] = NULL; /* terminator */
-
- use_xme = xme_major * 100 + xme_minor;
- saved_res = modelist[ractive]; /* save the current resolution */
- }
- if ( modelist ) {
- XFree(modelist);
- }
-#endif /* SDL_VIDEO_DRIVER_X11_XME */
-
- {
- /* It's interesting to note that if we allow 32 bit depths,
- we get a visual with an alpha mask on composite servers.
- static int depth_list[] = { 32, 24, 16, 15, 8 };
- */
- static int depth_list[] = { 24, 16, 15, 8 };
- int j, np;
- int use_directcolor = 1;
- XPixmapFormatValues *pf;
-
- /* Search for the visuals in deepest-first order, so that the first
- will be the richest one */
- if ( SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ) {
- use_directcolor = 0;
- }
- this->hidden->nvisuals = 0;
- if ( ! add_visual_byid(this, SDL_getenv("SDL_VIDEO_X11_VISUALID")) ) {
- for ( i=0; i<SDL_arraysize(depth_list); ++i ) {
- if ( depth_list[i] > 8 ) {
- if ( use_directcolor ) {
- add_visual(this, depth_list[i], DirectColor);
- }
- add_visual(this, depth_list[i], TrueColor);
- } else {
- add_visual(this, depth_list[i], PseudoColor);
- add_visual(this, depth_list[i], StaticColor);
- }
- }
- }
- if ( this->hidden->nvisuals == 0 ) {
- SDL_SetError("Found no sufficiently capable X11 visuals");
- return -1;
- }
-
- /* look up the pixel quantum for each depth */
- pf = XListPixmapFormats(SDL_Display, &np);
- for(i = 0; i < this->hidden->nvisuals; i++) {
- int d = this->hidden->visuals[i].depth;
- for(j = 0; j < np; j++)
- if(pf[j].depth == d)
- break;
- this->hidden->visuals[i].bpp = j < np ? pf[j].bits_per_pixel : d;
- }
-
- XFree(pf);
- }
-
- if ( SDL_modelist == NULL ) {
- SDL_modelist = (SDL_Rect **)SDL_malloc((1+1)*sizeof(SDL_Rect *));
- if ( !SDL_modelist ) {
- SDL_OutOfMemory();
- return -1;
- }
- n = 0;
- SDL_modelist[n] = (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
- if ( SDL_modelist[n] ) {
- SDL_modelist[n]->x = 0;
- SDL_modelist[n]->y = 0;
- SDL_modelist[n]->w = screen_w;
- SDL_modelist[n]->h = screen_h;
- ++n;
- }
- SDL_modelist[n] = NULL;
- }
-
-#ifdef X11MODES_DEBUG
- if ( use_xinerama ) {
- printf("Xinerama is enabled\n");
- }
-
- if ( use_xrandr ) {
- printf("XRandR is enabled\n");
- }
-
- if ( use_vidmode ) {
- printf("VidMode is enabled\n");
- }
-
- if ( use_xme ) {
- printf("Xi Graphics XME fullscreen is enabled\n");
- }
-
- if ( SDL_modelist ) {
- printf("X11 video mode list:\n");
- for ( i=0; SDL_modelist[i]; ++i ) {
- printf("\t%dx%d\n", SDL_modelist[i]->w, SDL_modelist[i]->h);
- }
- }
-#endif /* X11MODES_DEBUG */
-
- return 0;
-}
-
-int X11_SupportedVisual(_THIS, SDL_PixelFormat *format)
-{
- int i;
- for(i = 0; i < this->hidden->nvisuals; i++)
- if(this->hidden->visuals[i].bpp == format->BitsPerPixel)
- return 1;
- return 0;
-}
-
-SDL_Rect **X11_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- if ( X11_SupportedVisual(this, format) ) {
- if ( flags & SDL_FULLSCREEN ) {
- return(SDL_modelist);
- } else {
- return((SDL_Rect **)-1);
- }
- } else {
- return((SDL_Rect **)0);
- }
-}
-
-void X11_FreeVideoModes(_THIS)
-{
- int i;
-
- if ( SDL_modelist ) {
- for ( i=0; SDL_modelist[i]; ++i ) {
- SDL_free(SDL_modelist[i]);
- }
- SDL_free(SDL_modelist);
- SDL_modelist = NULL;
- }
-
-#if SDL_VIDEO_DRIVER_X11_XRANDR
- /* Free the Xrandr screen configuration */
- if ( screen_config ) {
- XRRFreeScreenConfigInfo(screen_config);
- screen_config = NULL;
- }
-#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */
-}
-
-int X11_ResizeFullScreen(_THIS)
-{
- int x = 0, y = 0;
- int real_w, real_h;
- int screen_w;
- int screen_h;
-
- screen_w = DisplayWidth(SDL_Display, SDL_Screen);
- screen_h = DisplayHeight(SDL_Display, SDL_Screen);
-
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
- if ( use_xinerama &&
- window_w <= xinerama_info.width &&
- window_h <= xinerama_info.height ) {
- x = xinerama_info.x_org;
- y = xinerama_info.y_org;
- }
-#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */
-
- if ( currently_fullscreen ) {
- /* Switch resolution and cover it with the FSwindow */
- move_cursor_to(this, x, y);
- set_best_resolution(this, window_w, window_h);
- move_cursor_to(this, x, y);
- get_real_resolution(this, &real_w, &real_h);
- if ( window_w > real_w ) {
- real_w = MAX(real_w, screen_w);
- }
- if ( window_h > real_h ) {
- real_h = MAX(real_h, screen_h);
- }
- XMoveResizeWindow(SDL_Display, FSwindow, x, y, real_w, real_h);
- move_cursor_to(this, real_w/2, real_h/2);
-
- /* Center and reparent the drawing window */
- x = (real_w - window_w)/2;
- y = (real_h - window_h)/2;
- XReparentWindow(SDL_Display, SDL_Window, FSwindow, x, y);
- /* FIXME: move the mouse to the old relative location */
- XSync(SDL_Display, True); /* Flush spurious mode change events */
- }
- return(1);
-}
-
-void X11_QueueEnterFullScreen(_THIS)
-{
- switch_waiting = 0x01 | SDL_FULLSCREEN;
- switch_time = SDL_GetTicks() + 1500;
-#if 0 /* This causes a BadMatch error if the window is iconified (not needed) */
- XSetInputFocus(SDL_Display, WMwindow, RevertToNone, CurrentTime);
-#endif
-}
-
-int X11_EnterFullScreen(_THIS)
-{
- int okay;
-#if 0
- Window tmpwin, *windows;
- int i, nwindows;
-#endif
- int x = 0, y = 0;
- int real_w, real_h;
- int screen_w;
- int screen_h;
-
- okay = 1;
- if ( currently_fullscreen ) {
- return(okay);
- }
-
- /* Ungrab the input so that we can move the mouse around */
- X11_GrabInputNoLock(this, SDL_GRAB_OFF);
-
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
- if ( use_xinerama &&
- window_w <= xinerama_info.width &&
- window_h <= xinerama_info.height ) {
- x = xinerama_info.x_org;
- y = xinerama_info.y_org;
- }
-#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */
-
- /* Map the fullscreen window to blank the screen */
- screen_w = DisplayWidth(SDL_Display, SDL_Screen);
- screen_h = DisplayHeight(SDL_Display, SDL_Screen);
- get_real_resolution(this, &real_w, &real_h);
- if ( window_w > real_w ) {
- real_w = MAX(real_w, screen_w);
- }
- if ( window_h > real_h ) {
- real_h = MAX(real_h, screen_h);
- }
- XMoveResizeWindow(SDL_Display, FSwindow,
- x, y, real_w, real_h);
- XMapRaised(SDL_Display, FSwindow);
- X11_WaitMapped(this, FSwindow);
-
-#if 0 /* This seems to break WindowMaker in focus-follows-mouse mode */
- /* Make sure we got to the top of the window stack */
- if ( XQueryTree(SDL_Display, SDL_Root, &tmpwin, &tmpwin,
- &windows, &nwindows) && windows ) {
- /* If not, try to put us there - if fail... oh well */
- if ( windows[nwindows-1] != FSwindow ) {
- tmpwin = windows[nwindows-1];
- for ( i=0; i<nwindows; ++i ) {
- if ( windows[i] == FSwindow ) {
- SDL_memcpy(&windows[i], &windows[i+1],
- (nwindows-i-1)*sizeof(windows[i]));
- break;
- }
- }
- windows[nwindows-1] = FSwindow;
- XRestackWindows(SDL_Display, windows, nwindows);
- XSync(SDL_Display, False);
- }
- XFree(windows);
- }
-#else
- XRaiseWindow(SDL_Display, FSwindow);
-#endif
-
-#if SDL_VIDEO_DRIVER_X11_VIDMODE
- /* Save the current video mode */
- if ( use_vidmode ) {
- SDL_NAME(XF86VidModeLockModeSwitch)(SDL_Display, SDL_Screen, True);
- }
-#endif
- currently_fullscreen = 1;
-
- /* Set the new resolution */
- okay = X11_ResizeFullScreen(this);
- if ( ! okay ) {
- X11_LeaveFullScreen(this);
- }
- /* Set the colormap */
- if ( SDL_XColorMap ) {
- XInstallColormap(SDL_Display, SDL_XColorMap);
- }
- if ( okay ) {
- X11_GrabInputNoLock(this, this->input_grab | SDL_GRAB_FULLSCREEN);
- }
-
- /* We may need to refresh the screen at this point (no backing store)
- We also don't get an event, which is why we explicitly refresh. */
- if ( this->screen ) {
- if ( this->screen->flags & SDL_OPENGL ) {
- SDL_PrivateExpose();
- } else {
- X11_RefreshDisplay(this);
- }
- }
-
- return(okay);
-}
-
-int X11_LeaveFullScreen(_THIS)
-{
- if ( currently_fullscreen ) {
- XReparentWindow(SDL_Display, SDL_Window, WMwindow, 0, 0);
-#if SDL_VIDEO_DRIVER_X11_VIDMODE
- if ( use_vidmode ) {
- restore_mode(this);
- SDL_NAME(XF86VidModeLockModeSwitch)(SDL_Display, SDL_Screen, False);
- }
-#endif
-
-#if SDL_VIDEO_DRIVER_X11_XME
- if ( use_xme ) {
- int rw, rh;
-
- /* check current mode so we can avoid uneccessary mode changes */
- get_real_resolution(this, &rw, &rh);
-
- if (rw != saved_res.width || rh != saved_res.height) {
- XiGMiscChangeResolution(SDL_Display,
- SDL_Screen,
- 0, /* view */
- saved_res.width,
- saved_res.height,
- 0);
- XSync(SDL_Display, False);
- }
- }
-#endif
-
-#if SDL_VIDEO_DRIVER_X11_XRANDR
- if ( use_xrandr ) {
- XRRSetScreenConfig(SDL_Display, screen_config, SDL_Root,
- saved_size_id, saved_rotation, CurrentTime);
- }
-#endif
-
- XUnmapWindow(SDL_Display, FSwindow);
- X11_WaitUnmapped(this, FSwindow);
- XSync(SDL_Display, True); /* Flush spurious mode change events */
- currently_fullscreen = 0;
- }
- /* If we get popped out of fullscreen mode for some reason, input_grab
- will still have the SDL_GRAB_FULLSCREEN flag set, since this is only
- temporary. In this case, release the grab unless the input has been
- explicitly grabbed.
- */
- X11_GrabInputNoLock(this, this->input_grab & ~SDL_GRAB_FULLSCREEN);
-
- /* We may need to refresh the screen at this point (no backing store)
- We also don't get an event, which is why we explicitly refresh. */
- if ( this->screen ) {
- if ( this->screen->flags & SDL_OPENGL ) {
- SDL_PrivateExpose();
- } else {
- X11_RefreshDisplay(this);
- }
- }
-
- return(0);
-}
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11modes_c.h b/distrib/sdl-1.2.12/src/video/x11/SDL_x11modes_c.h
deleted file mode 100644
index a363738..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11modes_c.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Utilities for getting and setting the X display mode */
-
-#include "SDL_x11video.h"
-
-/* Define this if you want to grab the keyboard in fullscreen mode.
- If you do not define this, SDL will return from SDL_SetVideoMode()
- immediately, but will not actually go fullscreen until the window
- manager is idle.
-*/
-#define GRAB_FULLSCREEN
-
-extern int X11_GetVideoModes(_THIS);
-extern SDL_Rect **X11_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-extern void X11_FreeVideoModes(_THIS);
-extern int X11_ResizeFullScreen(_THIS);
-extern void X11_WaitMapped(_THIS, Window win);
-extern void X11_WaitUnmapped(_THIS, Window win);
-extern void X11_QueueEnterFullScreen(_THIS);
-extern int X11_EnterFullScreen(_THIS);
-extern int X11_LeaveFullScreen(_THIS);
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11mouse.c b/distrib/sdl-1.2.12/src/video/x11/SDL_x11mouse.c
deleted file mode 100644
index 221032b..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11mouse.c
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-
-#include "SDL_mouse.h"
-#include "../../events/SDL_events_c.h"
-#include "../SDL_cursor_c.h"
-#include "SDL_x11dga_c.h"
-#include "SDL_x11mouse_c.h"
-
-
-/* The implementation dependent data for the window manager cursor */
-struct WMcursor {
- Cursor x_cursor;
-};
-
-
-void X11_FreeWMCursor(_THIS, WMcursor *cursor)
-{
- if ( SDL_Display != NULL ) {
- SDL_Lock_EventThread();
- XFreeCursor(SDL_Display, cursor->x_cursor);
- XSync(SDL_Display, False);
- SDL_Unlock_EventThread();
- }
- SDL_free(cursor);
-}
-
-WMcursor *X11_CreateWMCursor(_THIS,
- Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
-{
- WMcursor *cursor;
- XGCValues GCvalues;
- GC GCcursor;
- XImage *data_image, *mask_image;
- Pixmap data_pixmap, mask_pixmap;
- int clen, i;
- char *x_data, *x_mask;
- static XColor black = { 0, 0, 0, 0 };
- static XColor white = { 0xffff, 0xffff, 0xffff, 0xffff };
-
- /* Allocate the cursor memory */
- cursor = (WMcursor *)SDL_malloc(sizeof(WMcursor));
- if ( cursor == NULL ) {
- SDL_OutOfMemory();
- return(NULL);
- }
-
- /* Mix the mask and the data */
- clen = (w/8)*h;
- x_data = (char *)SDL_malloc(clen);
- if ( x_data == NULL ) {
- SDL_free(cursor);
- SDL_OutOfMemory();
- return(NULL);
- }
- x_mask = (char *)SDL_malloc(clen);
- if ( x_mask == NULL ) {
- SDL_free(cursor);
- SDL_free(x_data);
- SDL_OutOfMemory();
- return(NULL);
- }
- for ( i=0; i<clen; ++i ) {
- /* The mask is OR'd with the data to turn inverted color
- pixels black since inverted color cursors aren't supported
- under X11.
- */
- x_mask[i] = data[i] | mask[i];
- x_data[i] = data[i];
- }
-
- /* Prevent the event thread from running while we use the X server */
- SDL_Lock_EventThread();
-
- /* Create the data image */
- data_image = XCreateImage(SDL_Display,
- DefaultVisual(SDL_Display, SDL_Screen),
- 1, XYBitmap, 0, x_data, w, h, 8, w/8);
- data_image->byte_order = MSBFirst;
- data_image->bitmap_bit_order = MSBFirst;
- data_pixmap = XCreatePixmap(SDL_Display, SDL_Root, w, h, 1);
-
- /* Create the data mask */
- mask_image = XCreateImage(SDL_Display,
- DefaultVisual(SDL_Display, SDL_Screen),
- 1, XYBitmap, 0, x_mask, w, h, 8, w/8);
- mask_image->byte_order = MSBFirst;
- mask_image->bitmap_bit_order = MSBFirst;
- mask_pixmap = XCreatePixmap(SDL_Display, SDL_Root, w, h, 1);
-
- /* Create the graphics context */
- GCvalues.function = GXcopy;
- GCvalues.foreground = ~0;
- GCvalues.background = 0;
- GCvalues.plane_mask = AllPlanes;
- GCcursor = XCreateGC(SDL_Display, data_pixmap,
- (GCFunction|GCForeground|GCBackground|GCPlaneMask),
- &GCvalues);
-
- /* Blit the images to the pixmaps */
- XPutImage(SDL_Display, data_pixmap, GCcursor, data_image,
- 0, 0, 0, 0, w, h);
- XPutImage(SDL_Display, mask_pixmap, GCcursor, mask_image,
- 0, 0, 0, 0, w, h);
- XFreeGC(SDL_Display, GCcursor);
- /* These free the x_data and x_mask memory pointers */
- XDestroyImage(data_image);
- XDestroyImage(mask_image);
-
- /* Create the cursor */
- cursor->x_cursor = XCreatePixmapCursor(SDL_Display, data_pixmap,
- mask_pixmap, &black, &white, hot_x, hot_y);
- XFreePixmap(SDL_Display, data_pixmap);
- XFreePixmap(SDL_Display, mask_pixmap);
-
- /* Release the event thread */
- XSync(SDL_Display, False);
- SDL_Unlock_EventThread();
-
- return(cursor);
-}
-
-int X11_ShowWMCursor(_THIS, WMcursor *cursor)
-{
- /* Don't do anything if the display is gone */
- if ( SDL_Display == NULL ) {
- return(0);
- }
-
- /* Set the X11 cursor cursor, or blank if cursor is NULL */
- if ( SDL_Window ) {
- SDL_Lock_EventThread();
- if ( cursor == NULL ) {
- if ( SDL_BlankCursor != NULL ) {
- XDefineCursor(SDL_Display, SDL_Window,
- SDL_BlankCursor->x_cursor);
- }
- } else {
- XDefineCursor(SDL_Display, SDL_Window, cursor->x_cursor);
- }
- XSync(SDL_Display, False);
- SDL_Unlock_EventThread();
- }
- return(1);
-}
-
-void X11_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
-{
- if ( using_dga & DGA_MOUSE ) {
- SDL_PrivateMouseMotion(0, 0, x, y);
- } else if ( mouse_relative) {
- /* RJR: March 28, 2000
- leave physical cursor at center of screen if
- mouse hidden and grabbed */
- SDL_PrivateMouseMotion(0, 0, x, y);
- } else {
- SDL_Lock_EventThread();
- XWarpPointer(SDL_Display, None, SDL_Window, 0, 0, 0, 0, x, y);
- XSync(SDL_Display, False);
- SDL_Unlock_EventThread();
- }
-}
-
-/* Sets the mouse acceleration from a string of the form:
- 2/1/0
- The first number is the numerator, followed by the acceleration
- denumenator and threshold.
-*/
-static void SetMouseAccel(_THIS, const char *accel_param)
-{
- int i;
- size_t len;
- int accel_value[3];
- char *mouse_param, *mouse_param_buf, *pin;
-
- len = SDL_strlen(accel_param)+1;
- mouse_param_buf = SDL_stack_alloc(char, len);
- if ( ! mouse_param_buf ) {
- return;
- }
- SDL_strlcpy(mouse_param_buf, accel_param, len);
- mouse_param = mouse_param_buf;
-
- for ( i=0; (i < 3) && mouse_param; ++i ) {
- pin = SDL_strchr(mouse_param, '/');
- if ( pin ) {
- *pin = '\0';
- }
- accel_value[i] = atoi(mouse_param);
- if ( pin ) {
- mouse_param = pin+1;
- } else {
- mouse_param = NULL;
- }
- }
- if ( i == 3 ) {
- XChangePointerControl(SDL_Display, True, True,
- accel_value[0], accel_value[1], accel_value[2]);
- }
- SDL_stack_free(mouse_param_buf);
-}
-
-/* Check to see if we need to enter or leave mouse relative mode */
-void X11_CheckMouseModeNoLock(_THIS)
-{
- const Uint8 full_focus = (SDL_APPACTIVE|SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS);
- char *env_override;
- int enable_relative = 1;
-
- /* Allow the user to override the relative mouse mode.
- They almost never want to do this, as it seriously affects
- applications that rely on continuous relative mouse motion.
- */
- env_override = SDL_getenv("SDL_MOUSE_RELATIVE");
- if ( env_override ) {
- enable_relative = atoi(env_override);
- }
-
- /* If the mouse is hidden and input is grabbed, we use relative mode */
- if ( enable_relative &&
- !(SDL_cursorstate & CURSOR_VISIBLE) &&
- (this->input_grab != SDL_GRAB_OFF) &&
- (SDL_GetAppState() & full_focus) == full_focus ) {
- if ( ! mouse_relative ) {
- X11_EnableDGAMouse(this);
- if ( ! (using_dga & DGA_MOUSE) ) {
- char *xmouse_accel;
-
- SDL_GetMouseState(&mouse_last.x, &mouse_last.y);
- /* Use as raw mouse mickeys as possible */
- XGetPointerControl(SDL_Display,
- &mouse_accel.numerator,
- &mouse_accel.denominator,
- &mouse_accel.threshold);
- xmouse_accel=SDL_getenv("SDL_VIDEO_X11_MOUSEACCEL");
- if ( xmouse_accel ) {
- SetMouseAccel(this, xmouse_accel);
- }
- }
- mouse_relative = 1;
- }
- } else {
- if ( mouse_relative ) {
- if ( using_dga & DGA_MOUSE ) {
- X11_DisableDGAMouse(this);
- } else {
- XChangePointerControl(SDL_Display, True, True,
- mouse_accel.numerator,
- mouse_accel.denominator,
- mouse_accel.threshold);
- }
- mouse_relative = 0;
- }
- }
-}
-void X11_CheckMouseMode(_THIS)
-{
- SDL_Lock_EventThread();
- X11_CheckMouseModeNoLock(this);
- SDL_Unlock_EventThread();
-}
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11mouse_c.h b/distrib/sdl-1.2.12/src/video/x11/SDL_x11mouse_c.h
deleted file mode 100644
index 84914da..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11mouse_c.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_x11video.h"
-
-/* Functions to be exported */
-extern void X11_FreeWMCursor(_THIS, WMcursor *cursor);
-extern WMcursor *X11_CreateWMCursor(_THIS,
- Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
-extern int X11_ShowWMCursor(_THIS, WMcursor *cursor);
-extern void X11_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
-extern void X11_CheckMouseModeNoLock(_THIS);
-extern void X11_CheckMouseMode(_THIS);
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11sym.h b/distrib/sdl-1.2.12/src/video/x11/SDL_x11sym.h
deleted file mode 100644
index b8d90e4..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11sym.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-
-SDL_X11_MODULE(BASEXLIB)
-SDL_X11_SYM(XClassHint*,XAllocClassHint,(void),(),return)
-SDL_X11_SYM(Status,XAllocColor,(Display* a,Colormap b,XColor* c),(a,b,c),return)
-SDL_X11_SYM(XSizeHints*,XAllocSizeHints,(void),(),return)
-SDL_X11_SYM(XWMHints*,XAllocWMHints,(void),(),return)
-SDL_X11_SYM(int,XChangePointerControl,(Display* a,Bool b,Bool c,int d,int e,int f),(a,b,c,d,e,f),return)
-SDL_X11_SYM(int,XChangeProperty,(Display* a,Window b,Atom c,Atom d,int e,int f,_Xconst unsigned char* g,int h),(a,b,c,d,e,f,g,h),return)
-SDL_X11_SYM(int,XChangeWindowAttributes,(Display* a,Window b,unsigned long c,XSetWindowAttributes* d),(a,b,c,d),return)
-SDL_X11_SYM(Bool,XCheckTypedEvent,(Display* a,int b,XEvent* c),(a,b,c),return)
-SDL_X11_SYM(int,XClearWindow,(Display* a,Window b),(a,b),return)
-SDL_X11_SYM(int,XCloseDisplay,(Display* a),(a),return)
-SDL_X11_SYM(int,XConfigureWindow,(Display* a,Window b,unsigned int c,XWindowChanges* d),(a,b,c,d),return)
-SDL_X11_SYM(Colormap,XCreateColormap,(Display* a,Window b,Visual* c,int d),(a,b,c,d),return)
-SDL_X11_SYM(Cursor,XCreatePixmapCursor,(Display* a,Pixmap b,Pixmap c,XColor* d,XColor* e,unsigned int f,unsigned int g),(a,b,c,d,e,f,g),return)
-SDL_X11_SYM(GC,XCreateGC,(Display* a,Drawable b,unsigned long c,XGCValues* d),(a,b,c,d),return)
-SDL_X11_SYM(XImage*,XCreateImage,(Display* a,Visual* b,unsigned int c,int d,int e,char* f,unsigned int g,unsigned int h,int i,int j),(a,b,c,d,e,f,g,h,i,j),return)
-SDL_X11_SYM(Pixmap,XCreatePixmap,(Display* a,Drawable b,unsigned int c,unsigned int d,unsigned int e),(a,b,c,d,e),return)
-SDL_X11_SYM(Pixmap,XCreatePixmapFromBitmapData,(Display* a,Drawable b,char* c,unsigned int d,unsigned int e,unsigned long f,unsigned long g,unsigned int h),(a,b,c,d,e,f,g,h),return)
-SDL_X11_SYM(Window,XCreateSimpleWindow,(Display* a,Window b,int c,int d,unsigned int e,unsigned int f,unsigned int g,unsigned long h,unsigned long i),(a,b,c,d,e,f,g,h,i),return)
-SDL_X11_SYM(Window,XCreateWindow,(Display* a,Window b,int c,int d,unsigned int e,unsigned int f,unsigned int g,int h,unsigned int i,Visual* j,unsigned long k,XSetWindowAttributes* l),(a,b,c,d,e,f,g,h,i,j,k,l),return)
-SDL_X11_SYM(int,XDefaultScreen,(Display* a),(a),return)
-SDL_X11_SYM(int,XDisplayWidth,(Display* a,int b),(a,b),return)
-SDL_X11_SYM(int,XDisplayWidthMM,(Display* a, int b),(a, b),return)
-SDL_X11_SYM(int,XDisplayHeight,(Display* a,int b),(a,b),return)
-SDL_X11_SYM(int,XDisplayHeightMM,(Display* a, int b),(a, b),return)
-SDL_X11_SYM(int,XDefineCursor,(Display* a,Window b,Cursor c),(a,b,c),return)
-SDL_X11_SYM(int,XDeleteProperty,(Display* a,Window b,Atom c),(a,b,c),return)
-SDL_X11_SYM(int,XDestroyWindow,(Display* a,Window b),(a,b),return)
-SDL_X11_SYM(char*,XDisplayName,(_Xconst char* a),(a),return)
-SDL_X11_SYM(int,XEventsQueued,(Display* a,int b),(a,b),return)
-SDL_X11_SYM(Bool,XFilterEvent,(XEvent *event, Window w),(event,w),return)
-SDL_X11_SYM(int,XFlush,(Display* a),(a),return)
-SDL_X11_SYM(int,XFree,(void*a),(a),return)
-SDL_X11_SYM(int,XFreeColormap,(Display* a,Colormap b),(a,b),return)
-SDL_X11_SYM(int,XFreeColors,(Display* a,Colormap b,unsigned long* c,int d,unsigned long e),(a,b,c,d,e),return)
-SDL_X11_SYM(int,XFreeCursor,(Display* a,Cursor b),(a,b),return)
-SDL_X11_SYM(int,XFreeGC,(Display* a,GC b),(a,b),return)
-SDL_X11_SYM(int,XFreeModifiermap,(XModifierKeymap* a),(a),return)
-SDL_X11_SYM(int,XFreePixmap,(Display* a,Pixmap b),(a,b),return)
-SDL_X11_SYM(int,XGetErrorDatabaseText,(Display* a,_Xconst char* b,_Xconst char* c,_Xconst char* d,char* e,int f),(a,b,c,d,e,f),return)
-SDL_X11_SYM(int,XGetGeometry,(Display* a,Drawable b,Window* c,int* d,int* e,unsigned int* f,unsigned int* g,unsigned int* h,unsigned int* i),(a,b,c,d,e,f,g,h,i),return)
-SDL_X11_SYM(XModifierKeymap*,XGetModifierMapping,(Display* a),(a),return)
-SDL_X11_SYM(int,XGetPointerControl,(Display* a,int* b,int* c,int* d),(a,b,c,d),return)
-SDL_X11_SYM(int,XGetScreenSaver,(Display* a,int* b,int* c,int* d, int* e),(a,b,c,d,e),return)
-SDL_X11_SYM(XVisualInfo*,XGetVisualInfo,(Display* a,long b,XVisualInfo* c,int* d),(a,b,c,d),return)
-SDL_X11_SYM(XWMHints*,XGetWMHints,(Display* a,Window b),(a,b),return)
-SDL_X11_SYM(Status,XGetWindowAttributes,(Display* a,Window b,XWindowAttributes* c),(a,b,c),return)
-SDL_X11_SYM(int,XGrabKeyboard,(Display* a,Window b,Bool c,int d,int e,Time f),(a,b,c,d,e,f),return)
-SDL_X11_SYM(int,XGrabPointer,(Display* a,Window b,Bool c,unsigned int d,int e,int f,Window g,Cursor h,Time i),(a,b,c,d,e,f,g,h,i),return)
-SDL_X11_SYM(Status,XIconifyWindow,(Display* a,Window b,int c),(a,b,c),return)
-SDL_X11_SYM(Status,XInitThreads,(void),(),return)
-SDL_X11_SYM(int,XInstallColormap,(Display* a,Colormap b),(a,b),return)
-SDL_X11_SYM(KeyCode,XKeysymToKeycode,(Display* a,KeySym b),(a,b),return)
-SDL_X11_SYM(Atom,XInternAtom,(Display* a,_Xconst char* b,Bool c),(a,b,c),return)
-SDL_X11_SYM(XPixmapFormatValues*,XListPixmapFormats,(Display* a,int* b),(a,b),return)
-SDL_X11_SYM(int,XLookupString,(XKeyEvent* a,char* b,int c,KeySym* d,XComposeStatus* e),(a,b,c,d,e),return)
-SDL_X11_SYM(int,XMapRaised,(Display* a,Window b),(a,b),return)
-SDL_X11_SYM(int,XMapWindow,(Display* a,Window b),(a,b),return)
-SDL_X11_SYM(int,XMaskEvent,(Display* a,long b,XEvent* c),(a,b,c),return)
-SDL_X11_SYM(Status,XMatchVisualInfo,(Display* a,int b,int c,int d,XVisualInfo* e),(a,b,c,d,e),return)
-SDL_X11_SYM(int,XMissingExtension,(Display* a,_Xconst char* b),(a,b),return)
-SDL_X11_SYM(int,XMoveResizeWindow,(Display* a,Window b,int c,int d,unsigned int e,unsigned int f),(a,b,c,d,e,f),return)
-SDL_X11_SYM(int,XMoveWindow,(Display* a,Window b,int c,int d),(a,b,c,d),return)
-SDL_X11_SYM(int,XNextEvent,(Display* a,XEvent* b),(a,b),return)
-SDL_X11_SYM(Display*,XOpenDisplay,(_Xconst char* a),(a),return)
-SDL_X11_SYM(int,XPeekEvent,(Display* a,XEvent* b),(a,b),return)
-SDL_X11_SYM(int,XPending,(Display* a),(a),return)
-SDL_X11_SYM(int,XPutImage,(Display* a,Drawable b,GC c,XImage* d,int e,int f,int g,int h,unsigned int i,unsigned int j),(a,b,c,d,e,f,g,h,i,j),return)
-SDL_X11_SYM(int,XQueryColors,(Display* a,Colormap b,XColor* c,int d),(a,b,c,d),return)
-SDL_X11_SYM(int,XQueryKeymap,(Display* a,char *b),(a,b),return)
-SDL_X11_SYM(Bool,XQueryPointer,(Display* a,Window b,Window* c,Window* d,int* e,int* f,int* g,int* h,unsigned int* i),(a,b,c,d,e,f,g,h,i),return)
-SDL_X11_SYM(int,XQueryTree,(Display* a,Window b,Window* c,Window* d,Window** e,unsigned int* f),(a,b,c,d,e,f),return)
-SDL_X11_SYM(int,XRaiseWindow,(Display* a,Window b),(a,b),return)
-SDL_X11_SYM(int,XReparentWindow,(Display* a,Window b,Window c,int d,int e),(a,b,c,d,e),return)
-SDL_X11_SYM(int,XResizeWindow,(Display* a,Window b,unsigned int c,unsigned int d),(a,b,c,d),return)
-SDL_X11_SYM(int,XSelectInput,(Display* a,Window b,long c),(a,b,c),return)
-SDL_X11_SYM(Status,XSendEvent,(Display* a,Window b,Bool c,long d,XEvent* e),(a,b,c,d,e),return)
-SDL_X11_SYM(int,XSetClassHint,(Display* a,Window b,XClassHint* c),(a,b,c),return)
-SDL_X11_SYM(XErrorHandler,XSetErrorHandler,(XErrorHandler a),(a),return)
-SDL_X11_SYM(XIOErrorHandler,XSetIOErrorHandler,(XIOErrorHandler a),(a),return)
-SDL_X11_SYM(int,XSetScreenSaver,(Display* a,int b,int c,int d,int e),(a,b,c,d,e),return)
-SDL_X11_SYM(int,XSetTransientForHint,(Display* a,Window b,Window c),(a,b,c),return)
-SDL_X11_SYM(int,XSetWMHints,(Display* a,Window b,XWMHints* c),(a,b,c),return)
-SDL_X11_SYM(void,XSetTextProperty,(Display* a,Window b,XTextProperty* c,Atom d),(a,b,c,d),)
-SDL_X11_SYM(void,XSetWMNormalHints,(Display* a,Window b,XSizeHints* c),(a,b,c),)
-SDL_X11_SYM(Status,XSetWMProtocols,(Display* a,Window b,Atom* c,int d),(a,b,c,d),return)
-SDL_X11_SYM(int,XSetWindowBackground,(Display* a,Window b,unsigned long c),(a,b,c),return)
-SDL_X11_SYM(int,XSetWindowBackgroundPixmap,(Display* a,Window b,Pixmap c),(a,b,c),return)
-SDL_X11_SYM(int,XSetWindowColormap,(Display* a,Window b,Colormap c),(a,b,c),return)
-SDL_X11_SYM(int,XStoreColors,(Display* a,Colormap b,XColor* c,int d),(a,b,c,d),return)
-SDL_X11_SYM(Status,XStringListToTextProperty,(char** a,int b,XTextProperty* c),(a,b,c),return)
-SDL_X11_SYM(int,XSync,(Display* a,Bool b),(a,b),return)
-SDL_X11_SYM(int,XUngrabKeyboard,(Display* a,Time b),(a,b),return)
-SDL_X11_SYM(int,XUngrabPointer,(Display* a,Time 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(VisualID,XVisualIDFromVisual,(Visual* a),(a),return)
-SDL_X11_SYM(XExtDisplayInfo*,XextAddDisplay,(XExtensionInfo* a,Display* b,char* c,XExtensionHooks* d,int e,XPointer f),(a,b,c,d,e,f),return)
-SDL_X11_SYM(XExtensionInfo*,XextCreateExtension,(void),(),return)
-SDL_X11_SYM(void,XextDestroyExtension,(XExtensionInfo* a),(a),)
-SDL_X11_SYM(XExtDisplayInfo*,XextFindDisplay,(XExtensionInfo* a,Display* b),(a,b),return)
-SDL_X11_SYM(int,XextRemoveDisplay,(XExtensionInfo* a,Display* b),(a,b),return)
-SDL_X11_SYM(Bool,XQueryExtension,(Display* a,_Xconst char* b,int* c,int* d,int* e),(a,b,c,d,e),return)
-SDL_X11_SYM(char *,XDisplayString,(Display* a),(a),return)
-SDL_X11_SYM(int,XGetErrorText,(Display* a,int b,char* c,int d),(a,b,c,d),return)
-SDL_X11_SYM(void,_XEatData,(Display* a,unsigned long b),(a,b),)
-SDL_X11_SYM(void,_XFlush,(Display* a),(a),)
-SDL_X11_SYM(void,_XFlushGCCache,(Display* a,GC b),(a,b),)
-SDL_X11_SYM(int,_XRead,(Display* a,char* b,long c),(a,b,c),return)
-SDL_X11_SYM(void,_XReadPad,(Display* a,char* b,long c),(a,b,c),)
-SDL_X11_SYM(void,_XSend,(Display* a,_Xconst char* b,long c),(a,b,c),)
-SDL_X11_SYM(Status,_XReply,(Display* a,xReply* b,int c,Bool d),(a,b,c,d),return)
-SDL_X11_SYM(unsigned long,_XSetLastRequestRead,(Display* a,xGenericReply* b),(a,b),return)
-SDL_X11_SYM(SDL_X11_XSynchronizeRetType,XSynchronize,(Display* a,Bool b),(a,b),return)
-SDL_X11_SYM(int,XTranslateCoordinates,(Display* a,Window b,Window c,int d,int e,int* f,int* g,Window* h),(a,b,c,d,e,f,g,h),return)
-SDL_X11_SYM(SDL_X11_XESetWireToEventRetType,XESetWireToEvent,(Display* a,int b,SDL_X11_XESetWireToEventRetType c),(a,b,c),return)
-SDL_X11_SYM(SDL_X11_XESetEventToWireRetType,XESetEventToWire,(Display* a,int b,SDL_X11_XESetEventToWireRetType c),(a,b,c),return)
-SDL_X11_SYM(XExtensionErrorHandler,XSetExtensionErrorHandler,(XExtensionErrorHandler a),(a),return)
-
-#if NeedWidePrototypes
-SDL_X11_SYM(KeySym,XKeycodeToKeysym,(Display* a,unsigned int b,int c),(a,b,c),return)
-#else
-SDL_X11_SYM(KeySym,XKeycodeToKeysym,(Display* a,KeyCode b,int c),(a,b,c),return)
-#endif
-
-#ifdef X_HAVE_UTF8_STRING
-SDL_X11_MODULE(UTF8)
-SDL_X11_SYM(int,Xutf8TextListToTextProperty,(Display* a,char** b,int c,XICCEncodingStyle d,XTextProperty* e),(a,b,c,d,e),return)
-SDL_X11_SYM(int,Xutf8LookupString,(XIC a,XKeyPressedEvent* b,char* c,int d,KeySym* e,Status* f),(a,b,c,d,e,f),return)
-/*SDL_X11_SYM(XIC,XCreateIC,(XIM, ...),return) !!! ARGH! */
-SDL_X11_SYM(void,XDestroyIC,(XIC a),(a),)
-SDL_X11_SYM(void,XSetICFocus,(XIC a),(a),)
-SDL_X11_SYM(void,XUnsetICFocus,(XIC a),(a),)
-/*SDL_X11_SYM(char*,XGetICValues,(XIC a, ...),return)*/
-SDL_X11_SYM(XIM,XOpenIM,(Display* a,struct _XrmHashBucketRec* b,char* c,char* d),(a,b,c,d),return)
-SDL_X11_SYM(Status,XCloseIM,(XIM a),(a),return)
-SDL_X11_SYM(char*,XSetLocaleModifiers,(_Xconst char* a),(a),return)
-SDL_X11_SYM(int,XRefreshKeyboardMapping,(XMappingEvent* a),(a),return)
-SDL_X11_SYM(Display*,XDisplayOfIM,(XIM a),(a),return)
-#endif
-
-#ifndef NO_SHARED_MEMORY
-SDL_X11_MODULE(SHM)
-SDL_X11_SYM(Status,XShmAttach,(Display* a,XShmSegmentInfo* b),(a,b),return)
-SDL_X11_SYM(Status,XShmDetach,(Display* a,XShmSegmentInfo* b),(a,b),return)
-SDL_X11_SYM(Status,XShmPutImage,(Display* a,Drawable b,GC c,XImage* d,int e,int f,int g,int h,unsigned int i,unsigned int j,Bool k),(a,b,c,d,e,f,g,h,i,j,k),return)
-SDL_X11_SYM(XImage*,XShmCreateImage,(Display* a,Visual* b,unsigned int c,int d,char* e,XShmSegmentInfo* f,unsigned int g,unsigned int h),(a,b,c,d,e,f,g,h),return)
-SDL_X11_SYM(Bool,XShmQueryExtension,(Display* a),(a),return)
-#endif
-
-/*
- * Not required...these only exist in code in headers on some 64-bit platforms,
- * and are removed via macros elsewhere, so it's safe for them to be missing.
- */
-#ifdef LONG64
-SDL_X11_MODULE(IO_32BIT)
-SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
-SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,len),)
-#endif
-
-/*
- * These only show up on some variants of Unix.
- */
-#if defined(__osf__)
-SDL_X11_MODULE(OSF_ENTRY_POINTS)
-SDL_X11_SYM(void,_SmtBufferOverflow,(Display *dpy,register smtDisplayPtr p),(dpy,p),)
-SDL_X11_SYM(void,_SmtIpError,(Display *dpy,register smtDisplayPtr p, int i),(dpy,p,i),)
-SDL_X11_SYM(int,ipAllocateData,(ChannelPtr a, IPCard b, IPDataPtr * c),(a,b,c),return)
-SDL_X11_SYM(int,ipUnallocateAndSendData,(ChannelPtr a, IPCard b),(a,b),return)
-#endif
-
-/* Xrandr support. */
-#if SDL_VIDEO_DRIVER_X11_XRANDR
-SDL_X11_MODULE(XRANDR)
-SDL_X11_SYM(Status,XRRQueryVersion,(Display *dpy,int *major_versionp,int *minor_versionp),(dpy,major_versionp,minor_versionp),return)
-SDL_X11_SYM(XRRScreenConfiguration *,XRRGetScreenInfo,(Display *dpy,Drawable draw),(dpy,draw),return)
-SDL_X11_SYM(SizeID,XRRConfigCurrentConfiguration,(XRRScreenConfiguration *config,Rotation *rotation),(config,rotation),return)
-SDL_X11_SYM(XRRScreenSize *,XRRConfigSizes,(XRRScreenConfiguration *config, int *nsizes),(config,nsizes),return)
-SDL_X11_SYM(Status,XRRSetScreenConfig,(Display *dpy, XRRScreenConfiguration *config, Drawable draw, int size_index, Rotation rotation, Time timestamp),(dpy,config,draw,size_index,rotation,timestamp),return)
-SDL_X11_SYM(void,XRRFreeScreenConfigInfo,(XRRScreenConfiguration *config),(config),)
-#endif
-
-/* DPMS support */
-#if SDL_VIDEO_DRIVER_X11_DPMS
-SDL_X11_MODULE(DPMS)
-SDL_X11_SYM(Status,DPMSQueryExtension,(Display *dpy,int *major_versionp,int *minor_versionp),(dpy,major_versionp,minor_versionp),return)
-SDL_X11_SYM(Status,DPMSInfo,(Display *dpy,CARD16 *state,BOOL *onoff),(dpy,state,onoff),return)
-SDL_X11_SYM(Status,DPMSEnable,(Display *dpy),(dpy),return)
-SDL_X11_SYM(Status,DPMSDisable,(Display *dpy),(dpy),return)
-#endif
-
-/* end of SDL_x11sym.h ... */
-
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11video.c b/distrib/sdl-1.2.12/src/video/x11/SDL_x11video.c
deleted file mode 100644
index aa09064..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11video.c
+++ /dev/null
@@ -1,1558 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* X11 based SDL video driver implementation.
- Note: This implementation does not currently need X11 thread locking,
- since the event thread uses a separate X connection and any
- additional locking necessary is handled internally. However,
- if full locking is neccessary, take a look at XInitThreads().
-*/
-
-#include <unistd.h>
-#include <sys/ioctl.h>
-#ifdef MTRR_SUPPORT
-#include <asm/mtrr.h>
-#include <sys/fcntl.h>
-#endif
-
-#include "SDL_endian.h"
-#include "SDL_timer.h"
-#include "SDL_thread.h"
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_x11video.h"
-#include "SDL_x11wm_c.h"
-#include "SDL_x11mouse_c.h"
-#include "SDL_x11events_c.h"
-#include "SDL_x11modes_c.h"
-#include "SDL_x11image_c.h"
-#include "SDL_x11yuv_c.h"
-#include "SDL_x11gl_c.h"
-#include "SDL_x11gamma_c.h"
-#include "../blank_cursor.h"
-
-#ifdef X_HAVE_UTF8_STRING
-#include <locale.h>
-#endif
-
-/* Initialization/Query functions */
-static int X11_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Surface *X11_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int X11_ToggleFullScreen(_THIS, int on);
-static void X11_UpdateMouse(_THIS);
-static int X11_SetColors(_THIS, int firstcolor, int ncolors,
- SDL_Color *colors);
-static int X11_SetGammaRamp(_THIS, Uint16 *ramp);
-static void X11_VideoQuit(_THIS);
-
-int X11_wmXAdjust;
-int X11_wmYAdjust;
-
-
-/* X11 driver bootstrap functions */
-
-static int X11_Available(void)
-{
- Display *display = NULL;
- if ( SDL_X11_LoadSymbols() ) {
- display = XOpenDisplay(NULL);
- if ( display != NULL ) {
- XCloseDisplay(display);
- }
- SDL_X11_UnloadSymbols();
- }
- return(display != NULL);
-}
-
-static void X11_DeleteDevice(SDL_VideoDevice *device)
-{
- if ( device ) {
- if ( device->hidden ) {
- SDL_free(device->hidden);
- }
- if ( device->gl_data ) {
- SDL_free(device->gl_data);
- }
- SDL_free(device);
- SDL_X11_UnloadSymbols();
- }
-}
-
-static SDL_VideoDevice *X11_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device = NULL;
-
- if ( SDL_X11_LoadSymbols() ) {
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device ) {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *device->hidden));
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
- device->gl_data = (struct SDL_PrivateGLData *)
- SDL_malloc((sizeof *device->gl_data));
- SDL_memset(device->gl_data, 0, (sizeof *device->gl_data));
- }
- if ( (device == NULL) || (device->hidden == NULL) ||
- (device->gl_data == NULL) ) {
- SDL_OutOfMemory();
- X11_DeleteDevice(device); /* calls SDL_X11_UnloadSymbols(). */
- return(0);
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
- SDL_memset(device->gl_data, 0, (sizeof *device->gl_data));
-
- /* Set the driver flags */
- device->handles_any_size = 1;
-
- /* Set the function pointers */
- device->VideoInit = X11_VideoInit;
- device->ListModes = X11_ListModes;
- device->SetVideoMode = X11_SetVideoMode;
- device->ToggleFullScreen = X11_ToggleFullScreen;
- device->UpdateMouse = X11_UpdateMouse;
-#if SDL_VIDEO_DRIVER_X11_XV
- device->CreateYUVOverlay = X11_CreateYUVOverlay;
-#endif
- device->SetColors = X11_SetColors;
- device->UpdateRects = NULL;
- device->VideoQuit = X11_VideoQuit;
- device->AllocHWSurface = X11_AllocHWSurface;
- device->CheckHWBlit = NULL;
- device->FillHWRect = NULL;
- device->SetHWColorKey = NULL;
- device->SetHWAlpha = NULL;
- device->LockHWSurface = X11_LockHWSurface;
- device->UnlockHWSurface = X11_UnlockHWSurface;
- device->FlipHWSurface = X11_FlipHWSurface;
- device->FreeHWSurface = X11_FreeHWSurface;
- device->SetGamma = X11_SetVidModeGamma;
- device->GetGamma = X11_GetVidModeGamma;
- device->SetGammaRamp = X11_SetGammaRamp;
- device->GetGammaRamp = NULL;
-#if SDL_VIDEO_OPENGL_GLX
- device->GL_LoadLibrary = X11_GL_LoadLibrary;
- device->GL_GetProcAddress = X11_GL_GetProcAddress;
- device->GL_GetAttribute = X11_GL_GetAttribute;
- device->GL_MakeCurrent = X11_GL_MakeCurrent;
- device->GL_SwapBuffers = X11_GL_SwapBuffers;
-#endif
- device->SetCaption = X11_SetCaption;
- device->SetIcon = X11_SetIcon;
- device->IconifyWindow = X11_IconifyWindow;
- device->GrabInput = X11_GrabInput;
- device->GetWindowPos = X11_GetWindowPos;
- device->SetWindowPos = X11_SetWindowPos;
- device->IsWindowVisible = X11_IsWindowVisible;
- device->GetMonitorDPI = X11_GetMonitorDPI;
- device->GetMonitorRect = X11_GetMonitorRect;
- device->GetWMInfo = X11_GetWMInfo;
- device->FreeWMCursor = X11_FreeWMCursor;
- device->CreateWMCursor = X11_CreateWMCursor;
- device->ShowWMCursor = X11_ShowWMCursor;
- device->WarpWMCursor = X11_WarpWMCursor;
- device->CheckMouseMode = X11_CheckMouseMode;
- device->InitOSKeymap = X11_InitOSKeymap;
- device->PumpEvents = X11_PumpEvents;
-
- device->free = X11_DeleteDevice;
- }
-
- return device;
-}
-
-VideoBootStrap X11_bootstrap = {
- "x11", "X Window System",
- X11_Available, X11_CreateDevice
-};
-
-/* Normal X11 error handler routine */
-static int (*X_handler)(Display *, XErrorEvent *) = NULL;
-static int x_errhandler(Display *d, XErrorEvent *e)
-{
-#if SDL_VIDEO_DRIVER_X11_VIDMODE
- extern int vm_error;
-#endif
-#if SDL_VIDEO_DRIVER_X11_DGAMOUSE
- extern int dga_error;
-#endif
-
-#if SDL_VIDEO_DRIVER_X11_VIDMODE
- /* VidMode errors are non-fatal. :) */
- /* Are the errors offset by one from the error base?
- e.g. the error base is 143, the code is 148, and the
- actual error is XF86VidModeExtensionDisabled (4) ?
- */
- if ( (vm_error >= 0) &&
- (((e->error_code == BadRequest)&&(e->request_code == vm_error)) ||
- ((e->error_code > vm_error) &&
- (e->error_code <= (vm_error+XF86VidModeNumberErrors)))) ) {
-#ifdef X11_DEBUG
-{ char errmsg[1024];
- XGetErrorText(d, e->error_code, errmsg, sizeof(errmsg));
-printf("VidMode error: %s\n", errmsg);
-}
-#endif
- return(0);
- }
-#endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */
-
-#if SDL_VIDEO_DRIVER_X11_DGAMOUSE
- /* DGA errors can be non-fatal. :) */
- if ( (dga_error >= 0) &&
- ((e->error_code > dga_error) &&
- (e->error_code <= (dga_error+XF86DGANumberErrors))) ) {
-#ifdef X11_DEBUG
-{ char errmsg[1024];
- XGetErrorText(d, e->error_code, errmsg, sizeof(errmsg));
-printf("DGA error: %s\n", errmsg);
-}
-#endif
- return(0);
- }
-#endif /* SDL_VIDEO_DRIVER_X11_DGAMOUSE */
-
- return(X_handler(d,e));
-}
-
-/* X11 I/O error handler routine */
-static int (*XIO_handler)(Display *) = NULL;
-static int xio_errhandler(Display *d)
-{
- /* Ack! Lost X11 connection! */
-
- /* We will crash if we try to clean up our display */
- if ( current_video->hidden->Ximage ) {
- SDL_VideoSurface->pixels = NULL;
- }
- current_video->hidden->X11_Display = NULL;
-
- /* Continue with the standard X11 error handler */
- return(XIO_handler(d));
-}
-
-static int (*Xext_handler)(Display *, _Xconst char *, _Xconst char *) = NULL;
-static int xext_errhandler(Display *d, _Xconst char *ext, _Xconst char *reason)
-{
-#ifdef X11_DEBUG
- printf("Xext error inside SDL (may be harmless):\n");
- printf(" Extension \"%s\" %s on display \"%s\".\n",
- ext, reason, XDisplayString(d));
-#endif
-
- if (SDL_strcmp(reason, "missing") == 0) {
- /*
- * Since the query itself, elsewhere, can handle a missing extension
- * and the default behaviour in Xlib is to write to stderr, which
- * generates unnecessary bug reports, we just ignore these.
- */
- return 0;
- }
-
- /* Everything else goes to the default handler... */
- return Xext_handler(d, ext, reason);
-}
-
-/* Find out what class name we should use */
-static char *get_classname(char *classname, int maxlen)
-{
- char *spot;
-#if defined(__LINUX__) || defined(__FREEBSD__)
- char procfile[1024];
- char linkfile[1024];
- int linksize;
-#endif
-
- /* First allow environment variable override */
- spot = SDL_getenv("SDL_VIDEO_X11_WMCLASS");
- if ( spot ) {
- SDL_strlcpy(classname, spot, maxlen);
- return classname;
- }
-
- /* Next look at the application's executable name */
-#if defined(__LINUX__) || defined(__FREEBSD__)
-#if defined(__LINUX__)
- SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/exe", getpid());
-#elif defined(__FREEBSD__)
- SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/file", getpid());
-#else
-#error Where can we find the executable name?
-#endif
- linksize = readlink(procfile, linkfile, sizeof(linkfile)-1);
- if ( linksize > 0 ) {
- linkfile[linksize] = '\0';
- spot = SDL_strrchr(linkfile, '/');
- if ( spot ) {
- SDL_strlcpy(classname, spot+1, maxlen);
- } else {
- SDL_strlcpy(classname, linkfile, maxlen);
- }
- return classname;
- }
-#endif /* __LINUX__ */
-
- /* Finally use the default we've used forever */
- SDL_strlcpy(classname, "SDL_App", maxlen);
- return classname;
-}
-
-/* Create auxiliary (toplevel) windows with the current visual */
-static void create_aux_windows(_THIS)
-{
- int x = 0, y = 0;
- char classname[1024];
- XSetWindowAttributes xattr;
- XWMHints *hints;
- unsigned long app_event_mask;
- int def_vis = (SDL_Visual == DefaultVisual(SDL_Display, SDL_Screen));
-
- /* Look up some useful Atoms */
- WM_DELETE_WINDOW = XInternAtom(SDL_Display, "WM_DELETE_WINDOW", False);
-
- /* Don't create any extra windows if we are being managed */
- if ( SDL_windowid ) {
- FSwindow = 0;
- WMwindow = SDL_strtol(SDL_windowid, NULL, 0);
- return;
- }
-
- if(FSwindow)
- XDestroyWindow(SDL_Display, FSwindow);
-
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
- if ( use_xinerama ) {
- x = xinerama_info.x_org;
- y = xinerama_info.y_org;
- }
-#endif
- xattr.override_redirect = True;
- xattr.background_pixel = def_vis ? BlackPixel(SDL_Display, SDL_Screen) : 0;
- xattr.border_pixel = 0;
- xattr.colormap = SDL_XColorMap;
-
- FSwindow = XCreateWindow(SDL_Display, SDL_Root,
- x, y, 32, 32, 0,
- this->hidden->depth, InputOutput, SDL_Visual,
- CWOverrideRedirect | CWBackPixel | CWBorderPixel
- | CWColormap,
- &xattr);
-
- XSelectInput(SDL_Display, FSwindow, StructureNotifyMask);
-
- /* Tell KDE to keep the fullscreen window on top */
- {
- XEvent ev;
- long mask;
-
- SDL_memset(&ev, 0, sizeof(ev));
- ev.xclient.type = ClientMessage;
- ev.xclient.window = SDL_Root;
- ev.xclient.message_type = XInternAtom(SDL_Display,
- "KWM_KEEP_ON_TOP", False);
- ev.xclient.format = 32;
- ev.xclient.data.l[0] = FSwindow;
- ev.xclient.data.l[1] = CurrentTime;
- mask = SubstructureRedirectMask;
- XSendEvent(SDL_Display, SDL_Root, False, mask, &ev);
- }
-
- hints = NULL;
- if(WMwindow) {
- /* All window attributes must survive the recreation */
- hints = XGetWMHints(SDL_Display, WMwindow);
- XDestroyWindow(SDL_Display, WMwindow);
- }
-
- /* Create the window for windowed management */
- /* (reusing the xattr structure above) */
- WMwindow = XCreateWindow(SDL_Display, SDL_Root,
- x + X11_wmXAdjust,
- y + X11_wmYAdjust,
- 32, 32, 0,
- this->hidden->depth, InputOutput, SDL_Visual,
- CWBackPixel | CWBorderPixel | CWColormap,
- &xattr);
-
- /* Set the input hints so we get keyboard input */
- if(!hints) {
- hints = XAllocWMHints();
- hints->input = True;
- hints->flags = InputHint;
- }
- XSetWMHints(SDL_Display, WMwindow, hints);
- XFree(hints);
- X11_SetCaptionNoLock(this, this->wm_title, this->wm_icon);
-
- app_event_mask = FocusChangeMask | KeyPressMask | KeyReleaseMask
- | PropertyChangeMask | StructureNotifyMask | KeymapStateMask;
- XSelectInput(SDL_Display, WMwindow, app_event_mask);
-
- /* Set the class hints so we can get an icon (AfterStep) */
- get_classname(classname, sizeof(classname));
- {
- XClassHint *classhints;
- classhints = XAllocClassHint();
- if(classhints != NULL) {
- classhints->res_name = classname;
- classhints->res_class = classname;
- XSetClassHint(SDL_Display, WMwindow, classhints);
- XFree(classhints);
- }
- }
-
- /* Setup the communication with the IM server */
- /* create_aux_windows may be called several times against the same
- Display. We should reuse the SDL_IM if one has been opened for
- the Display, so we should not simply reset SDL_IM here. */
-
- #ifdef X_HAVE_UTF8_STRING
- if (SDL_X11_HAVE_UTF8) {
- /* Discard obsolete resources if any. */
- if (SDL_IM != NULL && SDL_Display != XDisplayOfIM(SDL_IM)) {
- /* Just a double check. I don't think this
- code is ever executed. */
- SDL_SetError("display has changed while an IM is kept");
- if (SDL_IC) {
- XUnsetICFocus(SDL_IC);
- XDestroyIC(SDL_IC);
- SDL_IC = NULL;
- }
- XCloseIM(SDL_IM);
- SDL_IM = NULL;
- }
-
- /* Open an input method. */
- if (SDL_IM == NULL) {
- char *old_locale = NULL, *old_modifiers = NULL;
- const char *p;
- size_t n;
- /* I'm not comfortable to do locale setup
- here. However, we need C library locale
- (and xlib modifiers) to be set based on the
- user's preference to use XIM, and many
- existing game programs doesn't take care of
- users' locale preferences, so someone other
- than the game program should do it.
- Moreover, ones say that some game programs
- heavily rely on the C locale behaviour,
- e.g., strcol()'s, and we can't change the C
- library locale. Given the situation, I
- couldn't find better place to do the
- job... */
-
- /* Save the current (application program's)
- locale settings. */
- p = setlocale(LC_ALL, NULL);
- if ( p ) {
- n = SDL_strlen(p)+1;
- old_locale = SDL_stack_alloc(char, n);
- if ( old_locale ) {
- SDL_strlcpy(old_locale, p, n);
- }
- }
- p = XSetLocaleModifiers(NULL);
- if ( p ) {
- n = SDL_strlen(p)+1;
- old_modifiers = SDL_stack_alloc(char, n);
- if ( old_modifiers ) {
- SDL_strlcpy(old_modifiers, p, n);
- }
- }
-
- /* Fetch the user's preferences and open the
- input method with them. */
- setlocale(LC_ALL, "");
- XSetLocaleModifiers("");
- SDL_IM = XOpenIM(SDL_Display, NULL, classname, classname);
-
- /* Restore the application's locale settings
- so that we don't break the application's
- expected behaviour. */
- if ( old_locale ) {
- /* We need to restore the C library
- locale first, since the
- interpretation of the X modifier
- may depend on it. */
- setlocale(LC_ALL, old_locale);
- SDL_stack_free(old_locale);
- }
- if ( old_modifiers ) {
- XSetLocaleModifiers(old_modifiers);
- SDL_stack_free(old_modifiers);
- }
- }
-
- /* Create a new input context for the new window just created. */
- if (SDL_IM == NULL) {
- SDL_SetError("no input method could be opened");
- } else {
- if (SDL_IC != NULL) {
- /* Discard the old IC before creating new one. */
- XUnsetICFocus(SDL_IC);
- XDestroyIC(SDL_IC);
- }
- /* Theoretically we should check the current IM supports
- PreeditNothing+StatusNothing style (i.e., root window method)
- before creating the IC. However, it is the bottom line method,
- and we supports any other options. If the IM didn't support
- root window method, the following call fails, and SDL falls
- back to pre-XIM keyboard handling. */
- SDL_IC = pXCreateIC(SDL_IM,
- XNClientWindow, WMwindow,
- XNFocusWindow, WMwindow,
- XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
- XNResourceName, classname,
- XNResourceClass, classname,
- NULL);
-
- if (SDL_IC == NULL) {
- SDL_SetError("no input context could be created");
- XCloseIM(SDL_IM);
- SDL_IM = NULL;
- } else {
- /* We need to receive X events that an IM wants and to pass
- them to the IM through XFilterEvent. The set of events may
- vary depending on the IM implementation and the options
- specified through various routes. Although unlikely, the
- xlib specification allows IM to change the event requirement
- with its own circumstances, it is safe to call SelectInput
- whenever we re-create an IC. */
- unsigned long mask = 0;
- char *ret = pXGetICValues(SDL_IC, XNFilterEvents, &mask, NULL);
- if (ret != NULL) {
- XUnsetICFocus(SDL_IC);
- XDestroyIC(SDL_IC);
- SDL_IC = NULL;
- SDL_SetError("no input context could be created");
- XCloseIM(SDL_IM);
- SDL_IM = NULL;
- } else {
- XSelectInput(SDL_Display, WMwindow, app_event_mask | mask);
- XSetICFocus(SDL_IC);
- }
- }
- }
- }
- #endif
-
- /* Allow the window to be deleted by the window manager */
- XSetWMProtocols(SDL_Display, WMwindow, &WM_DELETE_WINDOW, 1);
-}
-
-static int X11_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- const char *env = NULL;
- char *display;
- int i;
-
- /* Open the X11 display */
- display = NULL; /* Get it from DISPLAY environment variable */
-
- if ( (SDL_strncmp(XDisplayName(display), ":", 1) == 0) ||
- (SDL_strncmp(XDisplayName(display), "unix:", 5) == 0) ) {
- local_X11 = 1;
- } else {
- local_X11 = 0;
- }
- SDL_Display = XOpenDisplay(display);
-#if defined(__osf__) && defined(SDL_VIDEO_DRIVER_X11_DYNAMIC)
- /* On Tru64 if linking without -lX11, it fails and you get following message.
- * Xlib: connection to ":0.0" refused by server
- * Xlib: XDM authorization key matches an existing client!
- *
- * It succeeds if retrying 1 second later
- * or if running xhost +localhost on shell.
- *
- */
- if ( SDL_Display == NULL ) {
- SDL_Delay(1000);
- SDL_Display = XOpenDisplay(display);
- }
-#endif
- if ( SDL_Display == NULL ) {
- SDL_SetError("Couldn't open X11 display");
- return(-1);
- }
-#ifdef X11_DEBUG
- XSynchronize(SDL_Display, True);
-#endif
-
- /* Create an alternate X display for graphics updates -- allows us
- to do graphics updates in a separate thread from event handling.
- Thread-safe X11 doesn't seem to exist.
- */
- GFX_Display = XOpenDisplay(display);
- if ( GFX_Display == NULL ) {
- XCloseDisplay(SDL_Display);
- SDL_Display = NULL;
- SDL_SetError("Couldn't open X11 display");
- return(-1);
- }
-
- /* Set the normal X error handler */
- X_handler = XSetErrorHandler(x_errhandler);
-
- /* Set the error handler if we lose the X display */
- XIO_handler = XSetIOErrorHandler(xio_errhandler);
-
- /* Set the X extension error handler */
- Xext_handler = XSetExtensionErrorHandler(xext_errhandler);
-
- /* use default screen (from $DISPLAY) */
- SDL_Screen = DefaultScreen(SDL_Display);
-
-#ifndef NO_SHARED_MEMORY
- /* Check for MIT shared memory extension */
- use_mitshm = 0;
- if ( local_X11 ) {
- use_mitshm = XShmQueryExtension(SDL_Display);
- }
-#endif /* NO_SHARED_MEMORY */
-
- /* Get the available video modes */
- if(X11_GetVideoModes(this) < 0) {
- XCloseDisplay(GFX_Display);
- GFX_Display = NULL;
- XCloseDisplay(SDL_Display);
- SDL_Display = NULL;
- return -1;
- }
-
- /* Determine the current screen size */
- this->info.current_w = DisplayWidth(SDL_Display, SDL_Screen);
- this->info.current_h = DisplayHeight(SDL_Display, SDL_Screen);
-
- /* Determine the default screen depth:
- Use the default visual (or at least one with the same depth) */
- SDL_DisplayColormap = DefaultColormap(SDL_Display, SDL_Screen);
- for(i = 0; i < this->hidden->nvisuals; i++)
- if(this->hidden->visuals[i].depth == DefaultDepth(SDL_Display,
- SDL_Screen))
- break;
- if(i == this->hidden->nvisuals) {
- /* default visual was useless, take the deepest one instead */
- i = 0;
- }
- SDL_Visual = this->hidden->visuals[i].visual;
- if ( SDL_Visual == DefaultVisual(SDL_Display, SDL_Screen) ) {
- SDL_XColorMap = SDL_DisplayColormap;
- } else {
- SDL_XColorMap = XCreateColormap(SDL_Display, SDL_Root,
- SDL_Visual, AllocNone);
- }
- this->hidden->depth = this->hidden->visuals[i].depth;
- vformat->BitsPerPixel = this->hidden->visuals[i].bpp;
- if ( vformat->BitsPerPixel > 8 ) {
- vformat->Rmask = SDL_Visual->red_mask;
- vformat->Gmask = SDL_Visual->green_mask;
- vformat->Bmask = SDL_Visual->blue_mask;
- }
- if ( this->hidden->depth == 32 ) {
- vformat->Amask = (0xFFFFFFFF & ~(vformat->Rmask|vformat->Gmask|vformat->Bmask));
- }
- X11_SaveVidModeGamma(this);
-
- /* Save DPMS and screensaver settings */
- X11_SaveScreenSaver(SDL_Display, &screensaver_timeout, &dpms_enabled);
- X11_DisableScreenSaver(this, SDL_Display);
-
- /* See if we have been passed a window to use */
- SDL_windowid = SDL_getenv("SDL_WINDOWID");
-
- /* Create the fullscreen and managed windows */
- create_aux_windows(this);
-
- /* Create the blank cursor */
- SDL_BlankCursor = this->CreateWMCursor(this, blank_cdata, blank_cmask,
- BLANK_CWIDTH, BLANK_CHEIGHT,
- BLANK_CHOTX, BLANK_CHOTY);
-
- /* Fill in some window manager capabilities */
- this->info.wm_available = 1;
-
- /* Allow environment override of screensaver disable. */
- env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
- this->hidden->allow_screensaver = ( (env && SDL_atoi(env)) ? 1 : 0 );
-
- /* We're done! */
- XFlush(SDL_Display);
- return(0);
-}
-
-static void X11_DestroyWindow(_THIS, SDL_Surface *screen)
-{
- /* Clean up OpenGL */
- if ( screen ) {
- screen->flags &= ~(SDL_OPENGL|SDL_OPENGLBLIT);
- }
- X11_GL_Shutdown(this);
-
- if ( ! SDL_windowid ) {
- /* Hide the managed window */
- if ( WMwindow ) {
- XUnmapWindow(SDL_Display, WMwindow);
- }
- if ( screen && (screen->flags & SDL_FULLSCREEN) ) {
- screen->flags &= ~SDL_FULLSCREEN;
- X11_LeaveFullScreen(this);
- }
-
- /* Destroy the output window */
- if ( SDL_Window ) {
- XDestroyWindow(SDL_Display, SDL_Window);
- }
-
- /* Free the colormap entries */
- if ( SDL_XPixels ) {
- int numcolors;
- unsigned long pixel;
- numcolors = SDL_Visual->map_entries;
- for ( pixel=0; pixel<numcolors; ++pixel ) {
- while ( SDL_XPixels[pixel] > 0 ) {
- XFreeColors(GFX_Display,
- SDL_DisplayColormap,&pixel,1,0);
- --SDL_XPixels[pixel];
- }
- }
- SDL_free(SDL_XPixels);
- SDL_XPixels = NULL;
- }
-
- /* Free the graphics context */
- if ( SDL_GC ) {
- XFreeGC(SDL_Display, SDL_GC);
- SDL_GC = 0;
- }
- }
-}
-
-static SDL_bool X11_WindowPosition(_THIS, int *x, int *y, int w, int h)
-{
- const char *window = SDL_getenv("SDL_VIDEO_WINDOW_POS");
- const char *center = SDL_getenv("SDL_VIDEO_CENTERED");
- if ( window ) {
- if ( SDL_sscanf(window, "%d,%d", x, y) == 2 ) {
- return SDL_TRUE;
- }
- if ( SDL_strcmp(window, "center") == 0 ) {
- center = window;
- }
- }
- if ( center ) {
- *x = (DisplayWidth(SDL_Display, SDL_Screen) - w)/2;
- *y = (DisplayHeight(SDL_Display, SDL_Screen) - h)/2;
- return SDL_TRUE;
- }
- return SDL_FALSE;
-}
-
-static void X11_SetSizeHints(_THIS, int w, int h, Uint32 flags)
-{
- XSizeHints *hints;
-
- hints = XAllocSizeHints();
- if ( hints ) {
- if ( flags & SDL_RESIZABLE ) {
- hints->min_width = 32;
- hints->min_height = 32;
- hints->max_height = 4096;
- hints->max_width = 4096;
- } else {
- hints->min_width = hints->max_width = w;
- hints->min_height = hints->max_height = h;
- }
- hints->flags = PMaxSize | PMinSize;
- if ( flags & SDL_FULLSCREEN ) {
- hints->x = 0;
- hints->y = 0;
- hints->flags |= USPosition;
- } else
- /* Center it, if desired */
- if ( X11_WindowPosition(this, &hints->x, &hints->y, w, h) ) {
- hints->flags |= USPosition;
- XMoveWindow(SDL_Display, WMwindow, hints->x, hints->y);
-
- /* Flush the resize event so we don't catch it later */
- XSync(SDL_Display, True);
- }
- XSetWMNormalHints(SDL_Display, WMwindow, hints);
- XFree(hints);
- }
-
- /* Respect the window caption style */
- if ( flags & SDL_NOFRAME ) {
- SDL_bool set;
- Atom WM_HINTS;
-
- /* We haven't modified the window manager hints yet */
- set = SDL_FALSE;
-
- /* First try to set MWM hints */
- WM_HINTS = XInternAtom(SDL_Display, "_MOTIF_WM_HINTS", True);
- if ( WM_HINTS != None ) {
- /* Hints used by Motif compliant window managers */
- struct {
- unsigned long flags;
- unsigned long functions;
- unsigned long decorations;
- long input_mode;
- unsigned long status;
- } MWMHints = { (1L << 1), 0, 0, 0, 0 };
-
- XChangeProperty(SDL_Display, WMwindow,
- WM_HINTS, WM_HINTS, 32,
- PropModeReplace,
- (unsigned char *)&MWMHints,
- sizeof(MWMHints)/sizeof(long));
- set = SDL_TRUE;
- }
- /* Now try to set KWM hints */
- WM_HINTS = XInternAtom(SDL_Display, "KWM_WIN_DECORATION", True);
- if ( WM_HINTS != None ) {
- long KWMHints = 0;
-
- XChangeProperty(SDL_Display, WMwindow,
- WM_HINTS, WM_HINTS, 32,
- PropModeReplace,
- (unsigned char *)&KWMHints,
- sizeof(KWMHints)/sizeof(long));
- set = SDL_TRUE;
- }
- /* Now try to set GNOME hints */
- WM_HINTS = XInternAtom(SDL_Display, "_WIN_HINTS", True);
- if ( WM_HINTS != None ) {
- long GNOMEHints = 0;
-
- XChangeProperty(SDL_Display, WMwindow,
- WM_HINTS, WM_HINTS, 32,
- PropModeReplace,
- (unsigned char *)&GNOMEHints,
- sizeof(GNOMEHints)/sizeof(long));
- set = SDL_TRUE;
- }
- /* Finally set the transient hints if necessary */
- if ( ! set ) {
- XSetTransientForHint(SDL_Display, WMwindow, SDL_Root);
- }
- } else {
- SDL_bool set;
- Atom WM_HINTS;
-
- /* We haven't modified the window manager hints yet */
- set = SDL_FALSE;
-
- /* First try to unset MWM hints */
- WM_HINTS = XInternAtom(SDL_Display, "_MOTIF_WM_HINTS", True);
- if ( WM_HINTS != None ) {
- XDeleteProperty(SDL_Display, WMwindow, WM_HINTS);
- set = SDL_TRUE;
- }
- /* Now try to unset KWM hints */
- WM_HINTS = XInternAtom(SDL_Display, "KWM_WIN_DECORATION", True);
- if ( WM_HINTS != None ) {
- XDeleteProperty(SDL_Display, WMwindow, WM_HINTS);
- set = SDL_TRUE;
- }
- /* Now try to unset GNOME hints */
- WM_HINTS = XInternAtom(SDL_Display, "_WIN_HINTS", True);
- if ( WM_HINTS != None ) {
- XDeleteProperty(SDL_Display, WMwindow, WM_HINTS);
- set = SDL_TRUE;
- }
- /* Finally unset the transient hints if necessary */
- if ( ! set ) {
- /* NOTE: Does this work? */
- XSetTransientForHint(SDL_Display, WMwindow, None);
- }
- }
-}
-
-static int X11_CreateWindow(_THIS, SDL_Surface *screen,
- int w, int h, int bpp, Uint32 flags)
-{
- int i, depth;
- Visual *vis;
- int vis_change;
- Uint32 Amask;
-
- /* If a window is already present, destroy it and start fresh */
- if ( SDL_Window ) {
- X11_DestroyWindow(this, screen);
- switch_waiting = 0; /* Prevent jump back to now-meaningless state. */
- }
-
- /* See if we have been given a window id */
- if ( SDL_windowid ) {
- SDL_Window = SDL_strtol(SDL_windowid, NULL, 0);
- } else {
- SDL_Window = 0;
- }
-
- /* find out which visual we are going to use */
- if ( flags & SDL_OPENGL ) {
- XVisualInfo *vi;
-
- vi = X11_GL_GetVisual(this);
- if( !vi ) {
- return -1;
- }
- vis = vi->visual;
- depth = vi->depth;
- } else if ( SDL_windowid ) {
- XWindowAttributes a;
-
- XGetWindowAttributes(SDL_Display, SDL_Window, &a);
- vis = a.visual;
- depth = a.depth;
- } else {
- for ( i = 0; i < this->hidden->nvisuals; i++ ) {
- if ( this->hidden->visuals[i].bpp == bpp )
- break;
- }
- if ( i == this->hidden->nvisuals ) {
- SDL_SetError("No matching visual for requested depth");
- return -1; /* should never happen */
- }
- vis = this->hidden->visuals[i].visual;
- depth = this->hidden->visuals[i].depth;
- }
-#ifdef X11_DEBUG
- printf("Choosing %s visual at %d bpp - %d colormap entries\n", vis->class == PseudoColor ? "PseudoColor" : (vis->class == TrueColor ? "TrueColor" : (vis->class == DirectColor ? "DirectColor" : "Unknown")), depth, vis->map_entries);
-#endif
- vis_change = (vis != SDL_Visual);
- SDL_Visual = vis;
- this->hidden->depth = depth;
-
- /* Allocate the new pixel format for this video mode */
- if ( this->hidden->depth == 32 ) {
- Amask = (0xFFFFFFFF & ~(vis->red_mask|vis->green_mask|vis->blue_mask));
- } else {
- Amask = 0;
- }
- if ( ! SDL_ReallocFormat(screen, bpp,
- vis->red_mask, vis->green_mask, vis->blue_mask, Amask) ) {
- return -1;
- }
-
- /* Create the appropriate colormap */
- if ( SDL_XColorMap != SDL_DisplayColormap ) {
- XFreeColormap(SDL_Display, SDL_XColorMap);
- }
- if ( SDL_Visual->class == PseudoColor ) {
- int ncolors;
-
- /* Allocate the pixel flags */
- ncolors = SDL_Visual->map_entries;
- SDL_XPixels = SDL_malloc(ncolors * sizeof(int));
- if(SDL_XPixels == NULL) {
- SDL_OutOfMemory();
- return -1;
- }
- SDL_memset(SDL_XPixels, 0, ncolors * sizeof(*SDL_XPixels));
-
- /* always allocate a private colormap on non-default visuals */
- if ( SDL_Visual != DefaultVisual(SDL_Display, SDL_Screen) ) {
- flags |= SDL_HWPALETTE;
- }
- if ( flags & SDL_HWPALETTE ) {
- screen->flags |= SDL_HWPALETTE;
- SDL_XColorMap = XCreateColormap(SDL_Display, SDL_Root,
- SDL_Visual, AllocAll);
- } else {
- SDL_XColorMap = SDL_DisplayColormap;
- }
- } else if ( SDL_Visual->class == DirectColor ) {
-
- /* Create a colormap which we can manipulate for gamma */
- SDL_XColorMap = XCreateColormap(SDL_Display, SDL_Root,
- SDL_Visual, AllocAll);
- XSync(SDL_Display, False);
-
- /* Initialize the colormap to the identity mapping */
- SDL_GetGammaRamp(0, 0, 0);
- this->screen = screen;
- X11_SetGammaRamp(this, this->gamma);
- this->screen = NULL;
- } else {
- /* Create a read-only colormap for our window */
- SDL_XColorMap = XCreateColormap(SDL_Display, SDL_Root,
- SDL_Visual, AllocNone);
- }
-
- /* Recreate the auxiliary windows, if needed (required for GL) */
- if ( vis_change )
- create_aux_windows(this);
-
- if(screen->flags & SDL_HWPALETTE) {
- /* Since the full-screen window might have got a nonzero background
- colour (0 is white on some displays), we should reset the
- background to 0 here since that is what the user expects
- with a private colormap */
- XSetWindowBackground(SDL_Display, FSwindow, 0);
- XClearWindow(SDL_Display, FSwindow);
- }
-
- /* resize the (possibly new) window manager window */
- if( !SDL_windowid ) {
- X11_SetSizeHints(this, w, h, flags);
- window_w = w;
- window_h = h;
- XResizeWindow(SDL_Display, WMwindow, w, h);
- }
-
- /* Create (or use) the X11 display window */
- if ( !SDL_windowid ) {
- if ( flags & SDL_OPENGL ) {
- if ( X11_GL_CreateWindow(this, w, h) < 0 ) {
- return(-1);
- }
- } else {
- XSetWindowAttributes swa;
-
- swa.background_pixel = 0;
- swa.border_pixel = 0;
- swa.colormap = SDL_XColorMap;
- SDL_Window = XCreateWindow(SDL_Display, WMwindow,
- 0, 0, w, h, 0, depth,
- InputOutput, SDL_Visual,
- CWBackPixel | CWBorderPixel
- | CWColormap, &swa);
- }
- /* Only manage our input if we own the window */
- XSelectInput(SDL_Display, SDL_Window,
- ( EnterWindowMask | LeaveWindowMask
- | ButtonPressMask | ButtonReleaseMask
- | PointerMotionMask | ExposureMask ));
- }
- /* Create the graphics context here, once we have a window */
- if ( flags & SDL_OPENGL ) {
- if ( X11_GL_CreateContext(this) < 0 ) {
- return(-1);
- } else {
- screen->flags |= SDL_OPENGL;
- }
- } else {
- XGCValues gcv;
-
- gcv.graphics_exposures = False;
- SDL_GC = XCreateGC(SDL_Display, SDL_Window,
- GCGraphicsExposures, &gcv);
- if ( ! SDL_GC ) {
- SDL_SetError("Couldn't create graphics context");
- return(-1);
- }
- }
-
- /* Set our colormaps when not setting a GL mode */
- if ( ! (flags & SDL_OPENGL) ) {
- XSetWindowColormap(SDL_Display, SDL_Window, SDL_XColorMap);
- if( !SDL_windowid ) {
- XSetWindowColormap(SDL_Display, FSwindow, SDL_XColorMap);
- XSetWindowColormap(SDL_Display, WMwindow, SDL_XColorMap);
- }
- }
-
-#if 0 /* This is an experiment - are the graphics faster now? - nope. */
- if ( SDL_getenv("SDL_VIDEO_X11_BACKINGSTORE") )
-#endif
- /* Cache the window in the server, when possible */
- {
- Screen *xscreen;
- XSetWindowAttributes a;
-
- xscreen = ScreenOfDisplay(SDL_Display, SDL_Screen);
- a.backing_store = DoesBackingStore(xscreen);
- if ( a.backing_store != NotUseful ) {
- XChangeWindowAttributes(SDL_Display, SDL_Window,
- CWBackingStore, &a);
- }
- }
-
- /* Map them both and go fullscreen, if requested */
- if ( ! SDL_windowid ) {
- XMapWindow(SDL_Display, SDL_Window);
- XMapWindow(SDL_Display, WMwindow);
- X11_WaitMapped(this, WMwindow);
- if ( flags & SDL_FULLSCREEN ) {
- screen->flags |= SDL_FULLSCREEN;
- X11_EnterFullScreen(this);
- } else {
- screen->flags &= ~SDL_FULLSCREEN;
- }
- }
-
- return(0);
-}
-
-static int X11_ResizeWindow(_THIS,
- SDL_Surface *screen, int w, int h, Uint32 flags)
-{
- if ( ! SDL_windowid ) {
- /* Resize the window manager window */
- X11_SetSizeHints(this, w, h, flags);
- window_w = w;
- window_h = h;
- XResizeWindow(SDL_Display, WMwindow, w, h);
-
- /* Resize the fullscreen and display windows */
- if ( flags & SDL_FULLSCREEN ) {
- if ( screen->flags & SDL_FULLSCREEN ) {
- X11_ResizeFullScreen(this);
- } else {
- screen->flags |= SDL_FULLSCREEN;
- X11_EnterFullScreen(this);
- }
- } else {
- if ( screen->flags & SDL_FULLSCREEN ) {
- screen->flags &= ~SDL_FULLSCREEN;
- X11_LeaveFullScreen(this);
- }
- }
- XResizeWindow(SDL_Display, SDL_Window, w, h);
- }
- return(0);
-}
-
-SDL_Surface *X11_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- Uint32 saved_flags;
-
- /* Lock the event thread, in multi-threading environments */
- SDL_Lock_EventThread();
-
- /* Check the combination of flags we were passed */
- if ( flags & SDL_FULLSCREEN ) {
- /* Clear fullscreen flag if not supported */
- if ( SDL_windowid ) {
- flags &= ~SDL_FULLSCREEN;
- }
- }
-
- /* Flush any delayed updates */
- XSync(GFX_Display, False);
-
- /* Set up the X11 window */
- saved_flags = current->flags;
- if ( (SDL_Window) && ((saved_flags&SDL_OPENGL) == (flags&SDL_OPENGL))
- && (bpp == current->format->BitsPerPixel)
- && ((saved_flags&SDL_NOFRAME) == (flags&SDL_NOFRAME)) ) {
- if (X11_ResizeWindow(this, current, width, height, flags) < 0) {
- current = NULL;
- goto done;
- }
- } else {
- if (X11_CreateWindow(this,current,width,height,bpp,flags) < 0) {
- current = NULL;
- goto done;
- }
- }
-
- /* Update the internal keyboard state */
- X11_SetKeyboardState(SDL_Display, NULL);
-
- /* When the window is first mapped, ignore non-modifier keys */
- if ( !current->w && !current->h ) {
- Uint8 *keys = SDL_GetKeyState(NULL);
- int i;
- for ( i = 0; i < SDLK_LAST; ++i ) {
- switch (i) {
- case SDLK_NUMLOCK:
- case SDLK_CAPSLOCK:
- case SDLK_LCTRL:
- case SDLK_RCTRL:
- case SDLK_LSHIFT:
- case SDLK_RSHIFT:
- case SDLK_LALT:
- case SDLK_RALT:
- case SDLK_LMETA:
- case SDLK_RMETA:
- case SDLK_MODE:
- break;
- default:
- keys[i] = SDL_RELEASED;
- break;
- }
- }
- }
-
- /* Set up the new mode framebuffer */
- if ( ((current->w != width) || (current->h != height)) ||
- ((saved_flags&SDL_OPENGL) != (flags&SDL_OPENGL)) ) {
- current->w = width;
- current->h = height;
- current->pitch = SDL_CalculatePitch(current);
- X11_ResizeImage(this, current, flags);
- }
-
- /* Clear these flags and set them only if they are in the new set. */
- current->flags &= ~(SDL_RESIZABLE|SDL_NOFRAME);
- current->flags |= (flags&(SDL_RESIZABLE|SDL_NOFRAME));
-
- done:
- /* Release the event thread */
- XSync(SDL_Display, False);
- SDL_Unlock_EventThread();
-
- /* We're done! */
- return(current);
-}
-
-static int X11_ToggleFullScreen(_THIS, int on)
-{
- Uint32 event_thread;
-
- /* Don't switch if we don't own the window */
- if ( SDL_windowid ) {
- return(0);
- }
-
- /* Don't lock if we are the event thread */
- event_thread = SDL_EventThreadID();
- if ( event_thread && (SDL_ThreadID() == event_thread) ) {
- event_thread = 0;
- }
- if ( event_thread ) {
- SDL_Lock_EventThread();
- }
- if ( on ) {
- this->screen->flags |= SDL_FULLSCREEN;
- X11_EnterFullScreen(this);
- } else {
- this->screen->flags &= ~SDL_FULLSCREEN;
- X11_LeaveFullScreen(this);
- }
- X11_RefreshDisplay(this);
- if ( event_thread ) {
- SDL_Unlock_EventThread();
- }
- SDL_ResetKeyboard();
- return(1);
-}
-
-/* Update the current mouse state and position */
-static void X11_UpdateMouse(_THIS)
-{
- Window u1; int u2;
- Window current_win;
- int x, y;
- unsigned int mask;
-
- /* Lock the event thread, in multi-threading environments */
- SDL_Lock_EventThread();
- if ( XQueryPointer(SDL_Display, SDL_Window, &u1, &current_win,
- &u2, &u2, &x, &y, &mask) ) {
- if ( (x >= 0) && (x < SDL_VideoSurface->w) &&
- (y >= 0) && (y < SDL_VideoSurface->h) ) {
- SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
- SDL_PrivateMouseMotion(0, 0, x, y);
- } else {
- SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
- }
- }
- SDL_Unlock_EventThread();
-}
-
-/* simple colour distance metric. Supposed to be better than a plain
- Euclidian distance anyway. */
-#define COLOUR_FACTOR 3
-#define LIGHT_FACTOR 1
-#define COLOUR_DIST(r1, g1, b1, r2, g2, b2) \
- (COLOUR_FACTOR * (abs(r1 - r2) + abs(g1 - g2) + abs(b1 - b2)) \
- + LIGHT_FACTOR * abs(r1 + g1 + b1 - (r2 + g2 + b2)))
-
-static void allocate_nearest(_THIS, SDL_Color *colors,
- SDL_Color *want, int nwant)
-{
- /*
- * There is no way to know which ones to choose from, so we retrieve
- * the entire colormap and try the nearest possible, until we find one
- * that is shared.
- */
- XColor all[256];
- int i;
- for(i = 0; i < 256; i++)
- all[i].pixel = i;
- /*
- * XQueryColors sets the flags in the XColor struct, so we use
- * that to keep track of which colours are available
- */
- XQueryColors(GFX_Display, SDL_XColorMap, all, 256);
-
- for(i = 0; i < nwant; i++) {
- XColor *c;
- int j;
- int best = 0;
- int mindist = 0x7fffffff;
- int ri = want[i].r;
- int gi = want[i].g;
- int bi = want[i].b;
- for(j = 0; j < 256; j++) {
- int rj, gj, bj, d2;
- if(!all[j].flags)
- continue; /* unavailable colour cell */
- rj = all[j].red >> 8;
- gj = all[j].green >> 8;
- bj = all[j].blue >> 8;
- d2 = COLOUR_DIST(ri, gi, bi, rj, gj, bj);
- if(d2 < mindist) {
- mindist = d2;
- best = j;
- }
- }
- if(SDL_XPixels[best])
- continue; /* already allocated, waste no more time */
- c = all + best;
- if(XAllocColor(GFX_Display, SDL_XColorMap, c)) {
- /* got it */
- colors[c->pixel].r = c->red >> 8;
- colors[c->pixel].g = c->green >> 8;
- colors[c->pixel].b = c->blue >> 8;
- ++SDL_XPixels[c->pixel];
- } else {
- /*
- * The colour couldn't be allocated, probably being
- * owned as a r/w cell by another client. Flag it as
- * unavailable and try again. The termination of the
- * loop is guaranteed since at least black and white
- * are always there.
- */
- c->flags = 0;
- i--;
- }
- }
-}
-
-int X11_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- int nrej = 0;
-
- /* Check to make sure we have a colormap allocated */
- if ( SDL_XPixels == NULL ) {
- return(0);
- }
- if ( (this->screen->flags & SDL_HWPALETTE) == SDL_HWPALETTE ) {
- /* private writable colormap: just set the colours we need */
- XColor *xcmap;
- int i;
- xcmap = SDL_stack_alloc(XColor, ncolors);
- if(xcmap == NULL)
- return 0;
- for ( i=0; i<ncolors; ++i ) {
- xcmap[i].pixel = i + firstcolor;
- xcmap[i].red = (colors[i].r<<8)|colors[i].r;
- xcmap[i].green = (colors[i].g<<8)|colors[i].g;
- xcmap[i].blue = (colors[i].b<<8)|colors[i].b;
- xcmap[i].flags = (DoRed|DoGreen|DoBlue);
- }
- XStoreColors(GFX_Display, SDL_XColorMap, xcmap, ncolors);
- XSync(GFX_Display, False);
- SDL_stack_free(xcmap);
- } else {
- /*
- * Shared colormap: We only allocate read-only cells, which
- * increases the likelyhood of colour sharing with other
- * clients. The pixel values will almost certainly be
- * different from the requested ones, so the user has to
- * walk the colormap and see which index got what colour.
- *
- * We can work directly with the logical palette since it
- * has already been set when we get here.
- */
- SDL_Color *want, *reject;
- unsigned long *freelist;
- int i;
- int nfree = 0;
- int nc = this->screen->format->palette->ncolors;
- colors = this->screen->format->palette->colors;
- freelist = SDL_stack_alloc(unsigned long, nc);
- /* make sure multiple allocations of the same cell are freed */
- for(i = 0; i < ncolors; i++) {
- int pixel = firstcolor + i;
- while(SDL_XPixels[pixel]) {
- freelist[nfree++] = pixel;
- --SDL_XPixels[pixel];
- }
- }
- XFreeColors(GFX_Display, SDL_XColorMap, freelist, nfree, 0);
- SDL_stack_free(freelist);
-
- want = SDL_stack_alloc(SDL_Color, ncolors);
- reject = SDL_stack_alloc(SDL_Color, ncolors);
- SDL_memcpy(want, colors + firstcolor, ncolors * sizeof(SDL_Color));
- /* make sure the user isn't fooled by her own wishes
- (black is safe, always available in the default colormap) */
- SDL_memset(colors + firstcolor, 0, ncolors * sizeof(SDL_Color));
-
- /* now try to allocate the colours */
- for(i = 0; i < ncolors; i++) {
- XColor col;
- col.red = want[i].r << 8;
- col.green = want[i].g << 8;
- col.blue = want[i].b << 8;
- col.flags = DoRed | DoGreen | DoBlue;
- if(XAllocColor(GFX_Display, SDL_XColorMap, &col)) {
- /* We got the colour, or at least the nearest
- the hardware could get. */
- colors[col.pixel].r = col.red >> 8;
- colors[col.pixel].g = col.green >> 8;
- colors[col.pixel].b = col.blue >> 8;
- ++SDL_XPixels[col.pixel];
- } else {
- /*
- * no more free cells, add it to the list
- * of rejected colours
- */
- reject[nrej++] = want[i];
- }
- }
- if(nrej)
- allocate_nearest(this, colors, reject, nrej);
- SDL_stack_free(reject);
- SDL_stack_free(want);
- }
- return nrej == 0;
-}
-
-int X11_SetGammaRamp(_THIS, Uint16 *ramp)
-{
- int i, ncolors;
- XColor xcmap[256];
-
- /* See if actually setting the gamma is supported */
- if ( SDL_Visual->class != DirectColor ) {
- SDL_SetError("Gamma correction not supported on this visual");
- return(-1);
- }
-
- /* Calculate the appropriate palette for the given gamma ramp */
- ncolors = SDL_Visual->map_entries;
- for ( i=0; i<ncolors; ++i ) {
- Uint8 c = (256 * i / ncolors);
- xcmap[i].pixel = SDL_MapRGB(this->screen->format, c, c, c);
- xcmap[i].red = ramp[0*256+c];
- xcmap[i].green = ramp[1*256+c];
- xcmap[i].blue = ramp[2*256+c];
- xcmap[i].flags = (DoRed|DoGreen|DoBlue);
- }
- XStoreColors(GFX_Display, SDL_XColorMap, xcmap, ncolors);
- XSync(GFX_Display, False);
- return(0);
-}
-
-/* Note: If we are terminated, this could be called in the middle of
- another SDL video routine -- notably UpdateRects.
-*/
-void X11_VideoQuit(_THIS)
-{
- /* Shutdown everything that's still up */
- /* The event thread should be done, so we can touch SDL_Display */
- if ( SDL_Display != NULL ) {
- /* Flush any delayed updates */
- XSync(GFX_Display, False);
-
- /* Close the connection with the IM server */
- #ifdef X_HAVE_UTF8_STRING
- if (SDL_IC != NULL) {
- XUnsetICFocus(SDL_IC);
- XDestroyIC(SDL_IC);
- SDL_IC = NULL;
- }
- if (SDL_IM != NULL) {
- XCloseIM(SDL_IM);
- SDL_IM = NULL;
- }
- #endif
-
- /* Start shutting down the windows */
- X11_DestroyImage(this, this->screen);
- X11_DestroyWindow(this, this->screen);
- X11_FreeVideoModes(this);
- if ( SDL_XColorMap != SDL_DisplayColormap ) {
- XFreeColormap(SDL_Display, SDL_XColorMap);
- }
- if ( SDL_iconcolors ) {
- unsigned long pixel;
- Colormap dcmap = DefaultColormap(SDL_Display,
- SDL_Screen);
- for(pixel = 0; pixel < 256; ++pixel) {
- while(SDL_iconcolors[pixel] > 0) {
- XFreeColors(GFX_Display,
- dcmap, &pixel, 1, 0);
- --SDL_iconcolors[pixel];
- }
- }
- SDL_free(SDL_iconcolors);
- SDL_iconcolors = NULL;
- }
-
- /* Restore gamma settings if they've changed */
- if ( SDL_GetAppState() & SDL_APPACTIVE ) {
- X11_SwapVidModeGamma(this);
- }
-
- /* Restore DPMS and screensaver settings */
- X11_RestoreScreenSaver(this, SDL_Display, screensaver_timeout, dpms_enabled);
-
- /* Free that blank cursor */
- if ( SDL_BlankCursor != NULL ) {
- this->FreeWMCursor(this, SDL_BlankCursor);
- SDL_BlankCursor = NULL;
- }
-
- /* Close the X11 graphics connection */
- if ( GFX_Display != NULL ) {
- XCloseDisplay(GFX_Display);
- GFX_Display = NULL;
- }
-
- /* Close the X11 display connection */
- XCloseDisplay(SDL_Display);
- SDL_Display = NULL;
-
- /* Reset the X11 error handlers */
- if ( XIO_handler ) {
- XSetIOErrorHandler(XIO_handler);
- }
- if ( X_handler ) {
- XSetErrorHandler(X_handler);
- }
-
- /* Unload GL library after X11 shuts down */
- X11_GL_UnloadLibrary(this);
- }
- if ( this->screen && (this->screen->flags & SDL_HWSURFACE) ) {
- /* Direct screen access, no memory buffer */
- this->screen->pixels = NULL;
- }
-
-#if SDL_VIDEO_DRIVER_X11_XME
- XiGMiscDestroy();
-#endif
-}
-
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11video.h b/distrib/sdl-1.2.12/src/video/x11/SDL_x11video.h
deleted file mode 100644
index a2b7878..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11video.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_x11video_h
-#define _SDL_x11video_h
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/Xatom.h>
-
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-
-#if SDL_VIDEO_DRIVER_X11_DGAMOUSE
-#include "../Xext/extensions/xf86dga.h"
-#endif
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
-#include "../Xext/extensions/Xinerama.h"
-#endif
-#if SDL_VIDEO_DRIVER_X11_XRANDR
-#include <X11/extensions/Xrandr.h>
-#endif
-#if SDL_VIDEO_DRIVER_X11_VIDMODE
-#include "../Xext/extensions/xf86vmode.h"
-#endif
-#if SDL_VIDEO_DRIVER_X11_XME
-#include "../Xext/extensions/xme.h"
-#endif
-#if SDL_VIDEO_DRIVER_X11_DPMS
-#include <X11/extensions/dpms.h>
-#endif
-
-#include "SDL_x11dyn.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-/* Private display data */
-struct SDL_PrivateVideoData {
- int local_X11; /* Flag: true if local display */
- Display *X11_Display; /* Used for events and window management */
- Display *GFX_Display; /* Used for graphics and colormap stuff */
- Visual *SDL_Visual; /* The visual used by our window */
- Window WMwindow; /* Input window, managed by window manager */
- Window FSwindow; /* Fullscreen window, completely unmanaged */
- Window SDL_Window; /* Shared by both displays (no X security?) */
- Atom WM_DELETE_WINDOW; /* "close-window" protocol atom */
- WMcursor *BlankCursor; /* The invisible cursor */
- XIM X11_IM; /* Used to communicate with the input method (IM) server */
- XIC X11_IC; /* Used for retaining the state, properties, and semantics of communication with the input method (IM) server */
-
- char *SDL_windowid; /* Flag: true if we have been passed a window */
-
- /* Direct Graphics Access extension information */
- int using_dga;
-
-#ifndef NO_SHARED_MEMORY
- /* MIT shared memory extension information */
- int use_mitshm;
- XShmSegmentInfo shminfo;
-#endif
-
- /* The variables used for displaying graphics */
- XImage *Ximage; /* The X image for our window */
- GC gc; /* The graphic context for drawing */
-
- /* The current width and height of the fullscreen mode */
- int window_w;
- int window_h;
-
- /* Support for internal mouse warping */
- struct {
- int x;
- int y;
- } mouse_last;
- struct {
- int numerator;
- int denominator;
- int threshold;
- } mouse_accel;
- int mouse_relative;
-
- /* The current list of available video modes */
- SDL_Rect **modelist;
-
- /* available visuals of interest to us, sorted deepest first */
- struct {
- Visual *visual;
- int depth; /* number of significant bits/pixel */
- int bpp; /* pixel quantum in bits */
- } visuals[2*5]; /* at most 2 entries for 8, 15, 16, 24, 32 */
- int nvisuals;
-
- Visual *vis; /* current visual in use */
- int depth; /* current visual depth (not bpp) */
-
- /* Variables used by the X11 video mode code */
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
- SDL_NAME(XineramaScreenInfo) xinerama_info;
-#endif
-#if SDL_VIDEO_DRIVER_X11_XRANDR
- XRRScreenConfiguration* screen_config;
- int saved_size_id;
- Rotation saved_rotation;
-#endif
-#if SDL_VIDEO_DRIVER_X11_VIDMODE
- SDL_NAME(XF86VidModeModeInfo) saved_mode;
- struct {
- int x, y;
- } saved_view;
-#endif
-#if SDL_VIDEO_DRIVER_X11_XME /* XiG XME fullscreen */
- XiGMiscResolutionInfo saved_res;
-#endif
-
- int use_xinerama;
- int use_xrandr;
- int use_vidmode;
- int use_xme;
- int currently_fullscreen;
-
- int allow_screensaver;
-
- /* Automatic mode switching support (entering/leaving fullscreen) */
- Uint32 switch_waiting;
- Uint32 switch_time;
-
- /* Prevent too many XSync() calls */
- int blit_queued;
-
- /* Colormap handling */
- Colormap DisplayColormap; /* The default display colormap */
- Colormap XColorMap; /* The current window colormap */
- int *XPixels; /* pixels value allocation counts */
- float gamma_saved[3]; /* Saved gamma values for VidMode gamma */
- int gamma_changed; /* flag: has VidMode gamma been modified? */
-
- short *iconcolors; /* List of colors used by the icon */
-
- /* Screensaver settings */
- int screensaver_timeout;
- BOOL dpms_enabled;
-};
-
-extern int X11_wmXAdjust;
-extern int X11_wmYAdjust;
-
-/* Old variable names */
-#define local_X11 (this->hidden->local_X11)
-#define SDL_Display (this->hidden->X11_Display)
-#define GFX_Display (this->hidden->GFX_Display)
-#define SDL_Screen DefaultScreen(this->hidden->X11_Display)
-#define SDL_Visual (this->hidden->vis)
-#define SDL_Root RootWindow(SDL_Display, SDL_Screen)
-#define WMwindow (this->hidden->WMwindow)
-#define FSwindow (this->hidden->FSwindow)
-#define SDL_Window (this->hidden->SDL_Window)
-#define WM_DELETE_WINDOW (this->hidden->WM_DELETE_WINDOW)
-#define SDL_BlankCursor (this->hidden->BlankCursor)
-#define SDL_IM (this->hidden->X11_IM)
-#define SDL_IC (this->hidden->X11_IC)
-#define SDL_windowid (this->hidden->SDL_windowid)
-#define using_dga (this->hidden->using_dga)
-#define use_mitshm (this->hidden->use_mitshm)
-#define shminfo (this->hidden->shminfo)
-#define SDL_Ximage (this->hidden->Ximage)
-#define SDL_GC (this->hidden->gc)
-#define window_w (this->hidden->window_w)
-#define window_h (this->hidden->window_h)
-#define mouse_last (this->hidden->mouse_last)
-#define mouse_accel (this->hidden->mouse_accel)
-#define mouse_relative (this->hidden->mouse_relative)
-#define SDL_modelist (this->hidden->modelist)
-#define xinerama_info (this->hidden->xinerama_info)
-#define saved_mode (this->hidden->saved_mode)
-#define saved_view (this->hidden->saved_view)
-#define saved_res (this->hidden->saved_res)
-#define screen_config (this->hidden->screen_config)
-#define saved_size_id (this->hidden->saved_size_id)
-#define saved_rotation (this->hidden->saved_rotation)
-#define use_xinerama (this->hidden->use_xinerama)
-#define use_vidmode (this->hidden->use_vidmode)
-#define use_xrandr (this->hidden->use_xrandr)
-#define use_xme (this->hidden->use_xme)
-#define currently_fullscreen (this->hidden->currently_fullscreen)
-#define switch_waiting (this->hidden->switch_waiting)
-#define switch_time (this->hidden->switch_time)
-#define blit_queued (this->hidden->blit_queued)
-#define SDL_DisplayColormap (this->hidden->DisplayColormap)
-#define SDL_PrivateColormap (this->hidden->PrivateColormap)
-#define SDL_XColorMap (this->hidden->XColorMap)
-#define SDL_XPixels (this->hidden->XPixels)
-#define gamma_saved (this->hidden->gamma_saved)
-#define gamma_changed (this->hidden->gamma_changed)
-#define SDL_iconcolors (this->hidden->iconcolors)
-#define screensaver_timeout (this->hidden->screensaver_timeout)
-#define dpms_enabled (this->hidden->dpms_enabled)
-/* Some versions of XFree86 have bugs - detect if this is one of them */
-#define BUGGY_XFREE86(condition, buggy_version) \
-((SDL_strcmp(ServerVendor(SDL_Display), "The XFree86 Project, Inc") == 0) && \
- (VendorRelease(SDL_Display) condition buggy_version))
-
-#endif /* _SDL_x11video_h */
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11wm.c b/distrib/sdl-1.2.12/src/video/x11/SDL_x11wm.c
deleted file mode 100644
index 76706b3..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11wm.c
+++ /dev/null
@@ -1,619 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-
-#include "SDL_version.h"
-#include "SDL_timer.h"
-#include "SDL_video.h"
-#include "SDL_syswm.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-#include "SDL_x11modes_c.h"
-#include "SDL_x11wm_c.h"
-
-static Uint8 reverse_byte(Uint8 x)
-{
- x = (x & 0xaa) >> 1 | (x & 0x55) << 1;
- x = (x & 0xcc) >> 2 | (x & 0x33) << 2;
- x = (x & 0xf0) >> 4 | (x & 0x0f) << 4;
- return x;
-}
-
-void X11_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask)
-{
- SDL_Surface *sicon;
- XWMHints *wmhints;
- XImage *icon_image;
- Pixmap icon_pixmap;
- Pixmap mask_pixmap;
- Window icon_window = None;
- GC gc;
- XGCValues GCvalues;
- int i, dbpp;
- SDL_Rect bounds;
- Uint8 *LSBmask;
- Visual *dvis;
- char *p;
- int masksize;
-
- SDL_Lock_EventThread();
-
- /* The icon must use the default visual, depth and colormap of the
- screen, so it might need a conversion */
- dvis = DefaultVisual(SDL_Display, SDL_Screen);
- dbpp = DefaultDepth(SDL_Display, SDL_Screen);
- for(i = 0; i < this->hidden->nvisuals; i++) {
- if(this->hidden->visuals[i].visual == dvis) {
- dbpp = this->hidden->visuals[i].bpp;
- break;
- }
- }
-
- /* The Visual struct is supposed to be opaque but we cheat a little */
- sicon = SDL_CreateRGBSurface(SDL_SWSURFACE, icon->w, icon->h,
- dbpp,
- dvis->red_mask, dvis->green_mask,
- dvis->blue_mask, 0);
- if ( sicon == NULL )
- goto done;
-
- if(dbpp == 8) {
- /* Default visual is 8bit; we need to allocate colours from
- the default colormap */
- SDL_Color want[256], got[256];
- int nwant;
- Colormap dcmap;
- int missing;
- dcmap = DefaultColormap(SDL_Display, SDL_Screen);
- if(icon->format->palette) {
- /* The icon has a palette as well - we just have to
- find those colours */
- nwant = icon->format->palette->ncolors;
- SDL_memcpy(want, icon->format->palette->colors,
- nwant * sizeof want[0]);
- } else {
- /* try the standard 6x6x6 cube for lack of better
- ideas */
- int r, g, b, i;
- for(r = i = 0; r < 256; r += 0x33)
- for(g = 0; g < 256; g += 0x33)
- for(b = 0; b < 256; b += 0x33, i++) {
- want[i].r = r;
- want[i].g = g;
- want[i].b = b;
- }
- nwant = 216;
- }
- if(SDL_iconcolors) {
- /* free already allocated colours first */
- unsigned long freelist[512];
- int nfree = 0;
- for(i = 0; i < 256; i++) {
- while(SDL_iconcolors[i]) {
- freelist[nfree++] = i;
- SDL_iconcolors[i]--;
- }
- }
- XFreeColors(GFX_Display, dcmap, freelist, nfree, 0);
- }
- if(!SDL_iconcolors)
- SDL_iconcolors = SDL_malloc(256 * sizeof *SDL_iconcolors);
- SDL_memset(SDL_iconcolors, 0, 256 * sizeof *SDL_iconcolors);
-
- /* try to allocate the colours */
- SDL_memset(got, 0, sizeof got);
- missing = 0;
- for(i = 0; i < nwant; i++) {
- XColor c;
- c.red = want[i].r << 8;
- c.green = want[i].g << 8;
- c.blue = want[i].b << 8;
- c.flags = DoRed | DoGreen | DoBlue;
- if(XAllocColor(GFX_Display, dcmap, &c)) {
- /* got the colour */
- SDL_iconcolors[c.pixel]++;
- got[c.pixel] = want[i];
- } else {
- missing = 1;
- }
- }
- if(missing) {
- /* Some colours were apparently missing, so we just
- allocate all the rest as well */
- XColor cols[256];
- for(i = 0; i < 256; i++)
- cols[i].pixel = i;
- XQueryColors(GFX_Display, dcmap, cols, 256);
- for(i = 0; i < 256; i++) {
- got[i].r = cols[i].red >> 8;
- got[i].g = cols[i].green >> 8;
- got[i].b = cols[i].blue >> 8;
- if(!SDL_iconcolors[i]) {
- if(XAllocColor(GFX_Display, dcmap,
- cols + i)) {
- SDL_iconcolors[i] = 1;
- } else {
- /* index not available */
- got[i].r = 0;
- got[i].g = 0;
- got[i].b = 0;
- }
- }
- }
- }
-
- SDL_SetColors(sicon, got, 0, 256);
- }
-
- bounds.x = 0;
- bounds.y = 0;
- bounds.w = icon->w;
- bounds.h = icon->h;
- if ( SDL_LowerBlit(icon, &bounds, sicon, &bounds) < 0 )
- goto done;
-
- /* We need the mask as given, except in LSBfirst format instead of
- MSBfirst. Reverse the bits in each byte. */
- masksize = ((sicon->w + 7) >> 3) * sicon->h;
- LSBmask = SDL_malloc(masksize);
- if ( LSBmask == NULL ) {
- goto done;
- }
- SDL_memset(LSBmask, 0, masksize);
- for(i = 0; i < masksize; i++)
- LSBmask[i] = reverse_byte(mask[i]);
- mask_pixmap = XCreatePixmapFromBitmapData(SDL_Display, WMwindow,
- (char *)LSBmask,
- sicon->w, sicon->h,
- 1L, 0L, 1);
-
- /* Transfer the image to an X11 pixmap */
- icon_image = XCreateImage(SDL_Display,
- DefaultVisual(SDL_Display, SDL_Screen),
- DefaultDepth(SDL_Display, SDL_Screen),
- ZPixmap, 0, sicon->pixels,
- sicon->w, sicon->h,
- 32, 0);
- icon_image->byte_order = (SDL_BYTEORDER == SDL_BIG_ENDIAN)
- ? MSBFirst : LSBFirst;
- icon_pixmap = XCreatePixmap(SDL_Display, SDL_Root, sicon->w, sicon->h,
- DefaultDepth(SDL_Display, SDL_Screen));
- gc = XCreateGC(SDL_Display, icon_pixmap, 0, &GCvalues);
- XPutImage(SDL_Display, icon_pixmap, gc, icon_image,
- 0, 0, 0, 0, sicon->w, sicon->h);
- XFreeGC(SDL_Display, gc);
- XDestroyImage(icon_image);
- SDL_free(LSBmask);
- sicon->pixels = NULL;
-
- /* Some buggy window managers (some versions of Enlightenment, it
- seems) need an icon window *and* icon pixmap to work properly, while
- it screws up others. The default is only to use a pixmap. */
- p = SDL_getenv("SDL_VIDEO_X11_ICONWIN");
- if(p && *p) {
- icon_window = XCreateSimpleWindow(SDL_Display, SDL_Root,
- 0, 0, sicon->w, sicon->h, 0,
- CopyFromParent,
- CopyFromParent);
- XSetWindowBackgroundPixmap(SDL_Display, icon_window,
- icon_pixmap);
- XClearWindow(SDL_Display, icon_window);
- }
-
- /* Set the window icon to the icon pixmap (and icon window) */
- wmhints = XAllocWMHints();
- wmhints->flags = (IconPixmapHint | IconMaskHint);
- wmhints->icon_pixmap = icon_pixmap;
- wmhints->icon_mask = mask_pixmap;
- if(icon_window != None) {
- wmhints->flags |= IconWindowHint;
- wmhints->icon_window = icon_window;
- }
- XSetWMHints(SDL_Display, WMwindow, wmhints);
- XFree(wmhints);
- XSync(SDL_Display, False);
-
- done:
- SDL_Unlock_EventThread();
- SDL_FreeSurface(sicon);
-}
-
-void X11_SetCaptionNoLock(_THIS, const char *title, const char *icon)
-{
- XTextProperty titleprop, iconprop;
- Status status;
-
-#ifdef X_HAVE_UTF8_STRING
- Atom _NET_WM_NAME = 0;
- Atom _NET_WM_ICON_NAME = 0;
-
- /* Look up some useful Atoms */
- if (SDL_X11_HAVE_UTF8) {
- _NET_WM_NAME = XInternAtom(SDL_Display, "_NET_WM_NAME", False);
- _NET_WM_ICON_NAME = XInternAtom(SDL_Display, "_NET_WM_ICON_NAME", False);
- }
-#endif
-
- if ( title != NULL ) {
- char *title_locale = SDL_iconv_utf8_locale(title);
- if ( !title_locale ) {
- SDL_OutOfMemory();
- return;
- }
- status = XStringListToTextProperty(&title_locale, 1, &titleprop);
- SDL_free(title_locale);
- if ( status ) {
- XSetTextProperty(SDL_Display, WMwindow, &titleprop, XA_WM_NAME);
- XFree(titleprop.value);
- }
-#ifdef X_HAVE_UTF8_STRING
- if (SDL_X11_HAVE_UTF8) {
- status = Xutf8TextListToTextProperty(SDL_Display,
- (char **)&title, 1, XUTF8StringStyle, &titleprop);
- if ( status == Success ) {
- XSetTextProperty(SDL_Display, WMwindow, &titleprop, _NET_WM_NAME);
- XFree(titleprop.value);
- }
- }
-#endif
- }
- if ( icon != NULL ) {
- char *icon_locale = SDL_iconv_utf8_locale(icon);
- if ( !icon_locale ) {
- SDL_OutOfMemory();
- return;
- }
- status = XStringListToTextProperty(&icon_locale, 1, &iconprop);
- SDL_free(icon_locale);
- if ( status ) {
- XSetTextProperty(SDL_Display, WMwindow, &iconprop, XA_WM_ICON_NAME);
- XFree(iconprop.value);
- }
-#ifdef X_HAVE_UTF8_STRING
- if (SDL_X11_HAVE_UTF8) {
- status = Xutf8TextListToTextProperty(SDL_Display,
- (char **)&icon, 1, XUTF8StringStyle, &iconprop);
- if ( status == Success ) {
- XSetTextProperty(SDL_Display, WMwindow, &iconprop, _NET_WM_ICON_NAME);
- XFree(iconprop.value);
- }
- }
-#endif
- }
- XSync(SDL_Display, False);
-}
-
-void X11_SetCaption(_THIS, const char *title, const char *icon)
-{
- SDL_Lock_EventThread();
- X11_SetCaptionNoLock(this, title, icon);
- SDL_Unlock_EventThread();
-}
-
-/* Iconify the window */
-int X11_IconifyWindow(_THIS)
-{
- int result;
-
- SDL_Lock_EventThread();
- result = XIconifyWindow(SDL_Display, WMwindow, SDL_Screen);
- XSync(SDL_Display, False);
- SDL_Unlock_EventThread();
- return(result);
-}
-
-#if 0
-#define D(...) printf(__VA_ARGS__)
-#define E(...) D(__VA_ARGS__)
-#else
-#define D(...) ((void)0)
-#define E(...) ((void)0)
-#endif
-
-static void set_window_pos_nolock(_THIS, int x, int y)
-{
- int xNew, yNew;
- Window child;
- int xAdjust = X11_wmXAdjust;
- int yAdjust = X11_wmYAdjust;
-
- /* don't do anything in full-screen mode, because the FSwindow is used
- * instead of the WMwindow, which will make the adjustment go wild
- */
- if (this->screen->flags & SDL_FULLSCREEN)
- return;
-
- /* this code is tricky because some window managers, but not all,
- * will translate the final window position by a given offset
- * corresponding to the frame decoration.
- *
- * so we first try to move the window, get the position that the
- * window manager has set, and if they are different, re-position the
- * window again with an adjustment.
- *
- * this causes a slight flicker since the window 'jumps' very
- * quickly from one position to the other.
- */
-
- D("%s: move to [%d,%d] adjusted to [%d,%d]\n", __FUNCTION__,
- x, y, x+xAdjust, y+yAdjust);
- XMoveWindow(SDL_Display, WMwindow, x + xAdjust, y + yAdjust);
- XSync(SDL_Display, True);
- XTranslateCoordinates( SDL_Display, WMwindow, SDL_Root, 0, 0, &xNew, &yNew, &child );
- if (xNew != x || yNew != y) {
- X11_wmXAdjust = xAdjust = x - xNew;
- X11_wmYAdjust = yAdjust = y - yNew;
- D("%s: read pos [%d,%d], recomputing adjust=[%d,%d] moving to [%d,%d]\n",
- __FUNCTION__, xNew, yNew, xAdjust, yAdjust, x+xAdjust, y+yAdjust);
- XMoveWindow(SDL_Display, WMwindow, x + xAdjust, y + yAdjust );
- }
- XSync(SDL_Display, False);
-}
-
-/* Set window position */
-void X11_SetWindowPos(_THIS, int x, int y)
-{
- SDL_Lock_EventThread();
- set_window_pos_nolock(this, x, y);
- SDL_Unlock_EventThread();
-}
-
-/* Get window position */
-void X11_GetWindowPos(_THIS, int *px, int *py)
-{
- /* in full-screen mode, you can't move the window */
- if (this->screen->flags & SDL_FULLSCREEN) {
- *px = *py = 0;
- return;
- }
-
-
- SDL_Lock_EventThread();
- {
- Window child;
-
- XTranslateCoordinates( SDL_Display, WMwindow, SDL_Root, 0, 0, px, py, &child );
- }
- SDL_Unlock_EventThread();
-}
-
-static int
-is_window_visible(_THIS, int screen_x, int screen_y, int screen_w, int screen_h )
-{
- XWindowAttributes attr;
- int x, y;
- Window child;
-
- XGetWindowAttributes( SDL_Display, WMwindow, &attr );
- XTranslateCoordinates( SDL_Display, WMwindow, SDL_Root, 0, 0, &x, &y, &child );
-
- return ( x >= screen_x && x + attr.width <= screen_x + screen_w &&
- y >= screen_y && y + attr.height <= screen_y + screen_h );
-}
-
-int X11_IsWindowVisible(_THIS, int recenter)
-{
- int result = 0;
- XWindowAttributes attr;
- int screen_w, screen_h;
-
- SDL_Lock_EventThread();
- XGetWindowAttributes( SDL_Display, SDL_Root, &attr );
- screen_w = attr.width;
- screen_h = attr.height;
-
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
- if (use_xinerama) {
- SDL_NAME(XineramaScreenInfo) *xinerama;
- int i, screens;
-
- xinerama = SDL_NAME(XineramaQueryScreens)(SDL_Display, &screens);
- for (i = 0; i < screens; i++) {
- if ( is_window_visible( this,
- xinerama[i].x_org, xinerama[i].y_org,
- xinerama[i].width, xinerama[i].height ) )
- {
- result = 1;
- break;
- }
- }
-
- if ( !result && recenter ) {
- set_window_pos_nolock(this,
- xinerama[0].x_org + (xinerama[0].width - this->screen->w)/2,
- xinerama[0].y_org + (xinerama[0].height - this->screen->h)/2 );
- }
- XFree(xinerama);
- goto Exit;
- }
-#endif
- if ( is_window_visible( this, 0, 0, screen_w, screen_h ) ) {
- result = 1;
- }
-
- if ( !result && recenter ) {
- set_window_pos_nolock( this,
- (screen_w - this->screen->w)/2,
- (screen_h - this->screen->h)/2 );
- }
-#ifdef SDL_VIDEO_DRIVER_X11_XINERAMA
-Exit:
-#endif
- SDL_Unlock_EventThread();
- return result;
-}
-
-SDL_GrabMode X11_GrabInputNoLock(_THIS, SDL_GrabMode mode)
-{
- int result;
-
- if ( this->screen == NULL ) {
- return(SDL_GRAB_OFF);
- }
- if ( ! SDL_Window ) {
- return(mode); /* Will be set later on mode switch */
- }
- if ( mode == SDL_GRAB_OFF ) {
- XUngrabPointer(SDL_Display, CurrentTime);
- XUngrabKeyboard(SDL_Display, CurrentTime);
- } else {
- if ( this->screen->flags & SDL_FULLSCREEN ) {
- /* Unbind the mouse from the fullscreen window */
- XUngrabPointer(SDL_Display, CurrentTime);
- }
- /* Try to grab the mouse */
-#if 0 /* We'll wait here until we actually grab, otherwise behavior undefined */
- for ( numtries = 0; numtries < 10; ++numtries ) {
-#else
- for ( ; ; ) {
-#endif
- result = XGrabPointer(SDL_Display, SDL_Window, True, 0,
- GrabModeAsync, GrabModeAsync,
- SDL_Window, None, CurrentTime);
- if ( result == GrabSuccess ) {
- break;
- }
- SDL_Delay(100);
- }
- if ( result != GrabSuccess ) {
- /* Uh, oh, what do we do here? */ ;
- }
- /* Now grab the keyboard */
- XGrabKeyboard(SDL_Display, WMwindow, True,
- GrabModeAsync, GrabModeAsync, CurrentTime);
-
- /* Raise the window if we grab the mouse */
- if ( !(this->screen->flags & SDL_FULLSCREEN) )
- XRaiseWindow(SDL_Display, WMwindow);
-
- /* Make sure we register input focus */
- SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
- /* Since we grabbed the pointer, we have mouse focus, too. */
- SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
- }
- XSync(SDL_Display, False);
-
- return(mode);
-}
-
-SDL_GrabMode X11_GrabInput(_THIS, SDL_GrabMode mode)
-{
- SDL_Lock_EventThread();
- mode = X11_GrabInputNoLock(this, mode);
- SDL_Unlock_EventThread();
-
- return(mode);
-}
-
-#define MM_PER_INCH 25.4
-
-int
-X11_GetMonitorDPI(_THIS, int *px_dpi, int *py_dpi)
-{
- Display* display = SDL_Display;
- int screen = XDefaultScreen(display);
- int xdpi, ydpi;
-
- int width = XDisplayWidth(display, screen);
- int width_mm = XDisplayWidthMM(display, screen);
- int height = XDisplayHeight(display, screen);
- int height_mm = XDisplayHeightMM(display, screen);
-
- if (width_mm <= 0 || height_mm <= 0) {
- return -1;
- }
-
- xdpi = (int)(width * MM_PER_INCH / width_mm + 0.5);
- ydpi = (int)(height * MM_PER_INCH / height_mm + 0.5);
-
- if (xdpi < 20 || xdpi > 400 || ydpi < 20 || ydpi > 400) {
- return -1;
- }
-
- *px_dpi = xdpi;
- *py_dpi = ydpi;
-
- return 0;
-}
-
-int
-X11_GetMonitorRect(_THIS, SDL_Rect *rect)
-{
- Display* display = SDL_Display;
- int screen = XDefaultScreen(display);
-
- rect->x = 0;
- rect->y = 0;
- rect->w = XDisplayWidth(display, screen);
- rect->h = XDisplayHeight(display, screen);
-
- return 0;
-}
-
-/* If 'info' is the right version, this function fills it and returns 1.
- Otherwise, in case of a version mismatch, it returns -1.
-*/
-static void lock_display(void)
-{
- SDL_Lock_EventThread();
-}
-static void unlock_display(void)
-{
- /* Make sure any X11 transactions are completed */
- SDL_VideoDevice *this = current_video;
- XSync(SDL_Display, False);
- SDL_Unlock_EventThread();
-}
-
-#include <stdio.h>
-int X11_GetWMInfo(_THIS, SDL_SysWMinfo *info)
-{
- if ( info->version.major <= SDL_MAJOR_VERSION ) {
- info->subsystem = SDL_SYSWM_X11;
- info->info.x11.display = SDL_Display;
- info->info.x11.window = SDL_Window;
- if ( SDL_VERSIONNUM(info->version.major,
- info->version.minor,
- info->version.patch) >= 1002 ) {
- info->info.x11.fswindow = FSwindow;
- info->info.x11.wmwindow = WMwindow;
- }
-
-
- if ( SDL_VERSIONNUM(info->version.major,
- info->version.minor,
- info->version.patch) >= 1212 ) {
- info->info.x11.gfxdisplay = GFX_Display;
- }
-
- info->info.x11.lock_func = lock_display;
- info->info.x11.unlock_func = unlock_display;
- return(1);
- } else {
- SDL_SetError("Application not compiled with SDL %d.%d\n",
- SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
- return(-1);
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11wm_c.h b/distrib/sdl-1.2.12/src/video/x11/SDL_x11wm_c.h
deleted file mode 100644
index 33c11a3..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11wm_c.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_x11video.h"
-
-/* Functions to be exported */
-extern void X11_SetCaptionNoLock(_THIS, const char *title, const char *icon);
-extern void X11_SetCaption(_THIS, const char *title, const char *icon);
-extern void X11_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask);
-extern int X11_IconifyWindow(_THIS);
-extern SDL_GrabMode X11_GrabInputNoLock(_THIS, SDL_GrabMode mode);
-extern SDL_GrabMode X11_GrabInput(_THIS, SDL_GrabMode mode);
-extern int X11_GetWMInfo(_THIS, SDL_SysWMinfo *info);
-extern void X11_GetWindowPos(_THIS, int *px, int *py);
-extern void X11_SetWindowPos(_THIS, int x, int y);
-extern int X11_IsWindowVisible(_THIS, int recenter);
-extern int X11_GetMonitorDPI(_THIS, int* xdpi, int *ydpi);
-extern int X11_GetMonitorRect(_THIS, SDL_Rect *rect);
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11yuv.c b/distrib/sdl-1.2.12/src/video/x11/SDL_x11yuv.c
deleted file mode 100644
index 63cf10b..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11yuv.c
+++ /dev/null
@@ -1,413 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This is the XFree86 Xv extension implementation of YUV video overlays */
-
-#if SDL_VIDEO_DRIVER_X11_XV
-
-#include <X11/Xlib.h>
-#ifndef NO_SHARED_MEMORY
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <X11/extensions/XShm.h>
-#endif
-#include "../Xext/extensions/Xvlib.h"
-
-#include "SDL_x11yuv_c.h"
-#include "../SDL_yuvfuncs.h"
-
-#define XFREE86_REFRESH_HACK
-#ifdef XFREE86_REFRESH_HACK
-#include "SDL_x11image_c.h"
-#endif
-
-/* Workaround when pitch != width */
-#define PITCH_WORKAROUND
-
-/* Fix for the NVidia GeForce 2 - use the last available adaptor */
-/*#define USE_LAST_ADAPTOR*/ /* Apparently the NVidia drivers are fixed */
-
-/* The functions used to manipulate software video overlays */
-static struct private_yuvhwfuncs x11_yuvfuncs = {
- X11_LockYUVOverlay,
- X11_UnlockYUVOverlay,
- X11_DisplayYUVOverlay,
- X11_FreeYUVOverlay
-};
-
-struct private_yuvhwdata {
- int port;
-#ifndef NO_SHARED_MEMORY
- int yuv_use_mitshm;
- XShmSegmentInfo yuvshm;
-#endif
- SDL_NAME(XvImage) *image;
-};
-
-
-static int (*X_handler)(Display *, XErrorEvent *) = NULL;
-
-#ifndef NO_SHARED_MEMORY
-/* Shared memory error handler routine */
-static int shm_error;
-static int shm_errhandler(Display *d, XErrorEvent *e)
-{
- if ( e->error_code == BadAccess ) {
- shm_error = True;
- return(0);
- } else
- return(X_handler(d,e));
-}
-#endif /* !NO_SHARED_MEMORY */
-
-static int xv_error;
-static int xv_errhandler(Display *d, XErrorEvent *e)
-{
- if ( e->error_code == BadMatch ) {
- xv_error = True;
- return(0);
- } else
- return(X_handler(d,e));
-}
-
-SDL_Overlay *X11_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display)
-{
- SDL_Overlay *overlay;
- struct private_yuvhwdata *hwdata;
- int xv_port;
- unsigned int i, j, k;
- unsigned int adaptors;
- SDL_NAME(XvAdaptorInfo) *ainfo;
- int bpp;
-#ifndef NO_SHARED_MEMORY
- XShmSegmentInfo *yuvshm;
-#endif
-
- /* Look for the XVideo extension with a valid port for this format */
- xv_port = -1;
- if ( (Success == SDL_NAME(XvQueryExtension)(GFX_Display, &j, &j, &j, &j, &j)) &&
- (Success == SDL_NAME(XvQueryAdaptors)(GFX_Display,
- RootWindow(GFX_Display, SDL_Screen),
- &adaptors, &ainfo)) ) {
-#ifdef USE_LAST_ADAPTOR
- for ( i=0; i < adaptors; ++i )
-#else
- for ( i=0; (i < adaptors) && (xv_port == -1); ++i )
-#endif /* USE_LAST_ADAPTOR */
- {
- /* Check to see if the visual can be used */
- if ( BUGGY_XFREE86(<=, 4001) ) {
- int visual_ok = 0;
- for ( j=0; j<ainfo[i].num_formats; ++j ) {
- if ( ainfo[i].formats[j].visual_id ==
- SDL_Visual->visualid ) {
- visual_ok = 1;
- break;
- }
- }
- if ( ! visual_ok ) {
- continue;
- }
- }
- if ( (ainfo[i].type & XvInputMask) &&
- (ainfo[i].type & XvImageMask) ) {
- int num_formats;
- SDL_NAME(XvImageFormatValues) *formats;
- formats = SDL_NAME(XvListImageFormats)(GFX_Display,
- ainfo[i].base_id, &num_formats);
-#ifdef USE_LAST_ADAPTOR
- for ( j=0; j < num_formats; ++j )
-#else
- for ( j=0; (j < num_formats) && (xv_port == -1); ++j )
-#endif /* USE_LAST_ADAPTOR */
- {
- if ( (Uint32)formats[j].id == format ) {
- for ( k=0; k < ainfo[i].num_ports; ++k ) {
- if ( Success == SDL_NAME(XvGrabPort)(GFX_Display, ainfo[i].base_id+k, CurrentTime) ) {
- xv_port = ainfo[i].base_id+k;
- break;
- }
- }
- }
- }
- if ( formats ) {
- XFree(formats);
- }
- }
- }
- SDL_NAME(XvFreeAdaptorInfo)(ainfo);
- }
-
- /* Precalculate the bpp for the pitch workaround below */
- switch (format) {
- /* Add any other cases we need to support... */
- case SDL_YUY2_OVERLAY:
- case SDL_UYVY_OVERLAY:
- case SDL_YVYU_OVERLAY:
- bpp = 2;
- break;
- default:
- bpp = 1;
- break;
- }
-
-#if 0
- /*
- * !!! FIXME:
- * "Here are some diffs for X11 and yuv. Note that the last part 2nd
- * diff should probably be a new call to XvQueryAdaptorFree with ainfo
- * and the number of adaptors, instead of the loop through like I did."
- *
- * ACHTUNG: This is broken! It looks like XvFreeAdaptorInfo does this
- * for you, so we end up with a double-free. I need to look at this
- * more closely... --ryan.
- */
- for ( i=0; i < adaptors; ++i ) {
- if (ainfo[i].name != NULL) Xfree(ainfo[i].name);
- if (ainfo[i].formats != NULL) Xfree(ainfo[i].formats);
- }
- Xfree(ainfo);
-#endif
-
- if ( xv_port == -1 ) {
- SDL_SetError("No available video ports for requested format");
- return(NULL);
- }
-
- /* Enable auto-painting of the overlay colorkey */
- {
- static const char *attr[] = { "XV_AUTOPAINT_COLORKEY", "XV_AUTOPAINT_COLOURKEY" };
- unsigned int i;
-
- SDL_NAME(XvSelectPortNotify)(GFX_Display, xv_port, True);
- X_handler = XSetErrorHandler(xv_errhandler);
- for ( i=0; i < sizeof(attr)/(sizeof attr[0]); ++i ) {
- Atom a;
-
- xv_error = False;
- a = XInternAtom(GFX_Display, attr[i], True);
- if ( a != None ) {
- SDL_NAME(XvSetPortAttribute)(GFX_Display, xv_port, a, 1);
- XSync(GFX_Display, True);
- if ( ! xv_error ) {
- break;
- }
- }
- }
- XSetErrorHandler(X_handler);
- SDL_NAME(XvSelectPortNotify)(GFX_Display, xv_port, False);
- }
-
- /* Create the overlay structure */
- overlay = (SDL_Overlay *)SDL_malloc(sizeof *overlay);
- if ( overlay == NULL ) {
- SDL_NAME(XvUngrabPort)(GFX_Display, xv_port, CurrentTime);
- SDL_OutOfMemory();
- return(NULL);
- }
- SDL_memset(overlay, 0, (sizeof *overlay));
-
- /* Fill in the basic members */
- overlay->format = format;
- overlay->w = width;
- overlay->h = height;
-
- /* Set up the YUV surface function structure */
- overlay->hwfuncs = &x11_yuvfuncs;
- overlay->hw_overlay = 1;
-
- /* Create the pixel data and lookup tables */
- hwdata = (struct private_yuvhwdata *)SDL_malloc(sizeof *hwdata);
- overlay->hwdata = hwdata;
- if ( hwdata == NULL ) {
- SDL_NAME(XvUngrabPort)(GFX_Display, xv_port, CurrentTime);
- SDL_OutOfMemory();
- SDL_FreeYUVOverlay(overlay);
- return(NULL);
- }
- hwdata->port = xv_port;
-#ifndef NO_SHARED_MEMORY
- yuvshm = &hwdata->yuvshm;
- SDL_memset(yuvshm, 0, sizeof(*yuvshm));
- hwdata->image = SDL_NAME(XvShmCreateImage)(GFX_Display, xv_port, format,
- 0, width, height, yuvshm);
-#ifdef PITCH_WORKAROUND
- if ( hwdata->image != NULL && hwdata->image->pitches[0] != (width*bpp) ) {
- /* Ajust overlay width according to pitch */
- XFree(hwdata->image);
- width = hwdata->image->pitches[0] / bpp;
- hwdata->image = SDL_NAME(XvShmCreateImage)(GFX_Display, xv_port, format,
- 0, width, height, yuvshm);
- }
-#endif /* PITCH_WORKAROUND */
- hwdata->yuv_use_mitshm = (hwdata->image != NULL);
- if ( hwdata->yuv_use_mitshm ) {
- yuvshm->shmid = shmget(IPC_PRIVATE, hwdata->image->data_size,
- IPC_CREAT | 0777);
- if ( yuvshm->shmid >= 0 ) {
- yuvshm->shmaddr = (char *)shmat(yuvshm->shmid, 0, 0);
- yuvshm->readOnly = False;
- if ( yuvshm->shmaddr != (char *)-1 ) {
- shm_error = False;
- X_handler = XSetErrorHandler(shm_errhandler);
- XShmAttach(GFX_Display, yuvshm);
- XSync(GFX_Display, True);
- XSetErrorHandler(X_handler);
- if ( shm_error )
- shmdt(yuvshm->shmaddr);
- } else {
- shm_error = True;
- }
- shmctl(yuvshm->shmid, IPC_RMID, NULL);
- } else {
- shm_error = True;
- }
- if ( shm_error ) {
- XFree(hwdata->image);
- hwdata->yuv_use_mitshm = 0;
- } else {
- hwdata->image->data = yuvshm->shmaddr;
- }
- }
- if ( !hwdata->yuv_use_mitshm )
-#endif /* NO_SHARED_MEMORY */
- {
- hwdata->image = SDL_NAME(XvCreateImage)(GFX_Display, xv_port, format,
- 0, width, height);
-
-#ifdef PITCH_WORKAROUND
- if ( hwdata->image != NULL && hwdata->image->pitches[0] != (width*bpp) ) {
- /* Ajust overlay width according to pitch */
- XFree(hwdata->image);
- width = hwdata->image->pitches[0] / bpp;
- hwdata->image = SDL_NAME(XvCreateImage)(GFX_Display, xv_port, format,
- 0, width, height);
- }
-#endif /* PITCH_WORKAROUND */
- if ( hwdata->image == NULL ) {
- SDL_SetError("Couldn't create XVideo image");
- SDL_FreeYUVOverlay(overlay);
- return(NULL);
- }
- hwdata->image->data = SDL_malloc(hwdata->image->data_size);
- if ( hwdata->image->data == NULL ) {
- SDL_OutOfMemory();
- SDL_FreeYUVOverlay(overlay);
- return(NULL);
- }
- }
-
- /* Find the pitch and offset values for the overlay */
- overlay->planes = hwdata->image->num_planes;
- overlay->pitches = (Uint16 *)SDL_malloc(overlay->planes * sizeof(Uint16));
- overlay->pixels = (Uint8 **)SDL_malloc(overlay->planes * sizeof(Uint8 *));
- if ( !overlay->pitches || !overlay->pixels ) {
- SDL_OutOfMemory();
- SDL_FreeYUVOverlay(overlay);
- return(NULL);
- }
- for ( i=0; i<overlay->planes; ++i ) {
- overlay->pitches[i] = hwdata->image->pitches[i];
- overlay->pixels[i] = (Uint8 *)hwdata->image->data +
- hwdata->image->offsets[i];
- }
-
-#ifdef XFREE86_REFRESH_HACK
- /* Work around an XFree86 X server bug (?)
- We can't perform normal updates in windows that have video
- being output to them. See SDL_x11image.c for more details.
- */
- X11_DisableAutoRefresh(this);
-#endif
-
- /* We're all done.. */
- return(overlay);
-}
-
-int X11_LockYUVOverlay(_THIS, SDL_Overlay *overlay)
-{
- return(0);
-}
-
-void X11_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay)
-{
- return;
-}
-
-int X11_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst)
-{
- struct private_yuvhwdata *hwdata;
-
- hwdata = overlay->hwdata;
-
-#ifndef NO_SHARED_MEMORY
- if ( hwdata->yuv_use_mitshm ) {
- SDL_NAME(XvShmPutImage)(GFX_Display, hwdata->port, SDL_Window, SDL_GC,
- hwdata->image,
- src->x, src->y, src->w, src->h,
- dst->x, dst->y, dst->w, dst->h, False);
- }
- else
-#endif
- {
- SDL_NAME(XvPutImage)(GFX_Display, hwdata->port, SDL_Window, SDL_GC,
- hwdata->image,
- src->x, src->y, src->w, src->h,
- dst->x, dst->y, dst->w, dst->h);
- }
- XSync(GFX_Display, False);
- return(0);
-}
-
-void X11_FreeYUVOverlay(_THIS, SDL_Overlay *overlay)
-{
- struct private_yuvhwdata *hwdata;
-
- hwdata = overlay->hwdata;
- if ( hwdata ) {
- SDL_NAME(XvUngrabPort)(GFX_Display, hwdata->port, CurrentTime);
-#ifndef NO_SHARED_MEMORY
- if ( hwdata->yuv_use_mitshm ) {
- XShmDetach(GFX_Display, &hwdata->yuvshm);
- shmdt(hwdata->yuvshm.shmaddr);
- }
-#endif
- if ( hwdata->image ) {
- XFree(hwdata->image);
- }
- SDL_free(hwdata);
- }
- if ( overlay->pitches ) {
- SDL_free(overlay->pitches);
- overlay->pitches = NULL;
- }
- if ( overlay->pixels ) {
- SDL_free(overlay->pixels);
- overlay->pixels = NULL;
- }
-#ifdef XFREE86_REFRESH_HACK
- X11_EnableAutoRefresh(this);
-#endif
-}
-
-#endif /* SDL_VIDEO_DRIVER_X11_XV */
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11yuv_c.h b/distrib/sdl-1.2.12/src/video/x11/SDL_x11yuv_c.h
deleted file mode 100644
index 78f8750..0000000
--- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11yuv_c.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* This is the XFree86 Xv extension implementation of YUV video overlays */
-
-#include "SDL_video.h"
-#include "SDL_x11video.h"
-
-#if SDL_VIDEO_DRIVER_X11_XV
-
-extern SDL_Overlay *X11_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display);
-
-extern int X11_LockYUVOverlay(_THIS, SDL_Overlay *overlay);
-
-extern void X11_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay);
-
-extern int X11_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst);
-
-extern void X11_FreeYUVOverlay(_THIS, SDL_Overlay *overlay);
-
-#endif /* SDL_VIDEO_DRIVER_X11_XV */
diff --git a/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios.c b/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios.c
deleted file mode 100644
index 9cbb4a8..0000000
--- a/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios.c
+++ /dev/null
@@ -1,953 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- * Xbios SDL video driver
- *
- * Patrice Mandin
- */
-
-#include <sys/stat.h>
-#include <unistd.h>
-
-/* Mint includes */
-#include <mint/cookie.h>
-#include <mint/osbind.h>
-#include <mint/falcon.h>
-
-#include "SDL_video.h"
-#include "SDL_mouse.h"
-#include "../SDL_sysvideo.h"
-#include "../SDL_pixels_c.h"
-#include "../../events/SDL_events_c.h"
-
-#include "../ataricommon/SDL_ataric2p_s.h"
-#include "../ataricommon/SDL_atarievents_c.h"
-#include "../ataricommon/SDL_atarimxalloc_c.h"
-#include "../ataricommon/SDL_atarigl_c.h"
-#include "SDL_xbios.h"
-#include "SDL_xbios_blowup.h"
-#include "SDL_xbios_centscreen.h"
-#include "SDL_xbios_sb3.h"
-#include "SDL_xbios_tveille.h"
-
-#define XBIOS_VID_DRIVER_NAME "xbios"
-
-/* Debug print info */
-#if 0
-#define DEBUG_PRINT(what) \
- { \
- printf what; \
- }
-#define DEBUG_VIDEO_XBIOS 1
-#else
-#define DEBUG_PRINT(what)
-#undef DEBUG_VIDEO_XBIOS
-#endif
-
-/* Initialization/Query functions */
-static int XBIOS_VideoInit(_THIS, SDL_PixelFormat *vformat);
-static SDL_Rect **XBIOS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
-static SDL_Surface *XBIOS_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
-static int XBIOS_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
-static void XBIOS_VideoQuit(_THIS);
-
-/* Hardware surface functions */
-static int XBIOS_AllocHWSurface(_THIS, SDL_Surface *surface);
-static int XBIOS_LockHWSurface(_THIS, SDL_Surface *surface);
-static int XBIOS_FlipHWSurface(_THIS, SDL_Surface *surface);
-static void XBIOS_UnlockHWSurface(_THIS, SDL_Surface *surface);
-static void XBIOS_FreeHWSurface(_THIS, SDL_Surface *surface);
-static void XBIOS_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
-
-#if SDL_VIDEO_OPENGL
-/* OpenGL functions */
-static void XBIOS_GL_SwapBuffers(_THIS);
-#endif
-
-/* To setup palette */
-
-static unsigned short TT_palette[256];
-static unsigned long F30_palette[256];
-
-/* Xbios driver bootstrap functions */
-
-static int XBIOS_Available(void)
-{
- unsigned long cookie_vdo, cookie_mil, cookie_hade, cookie_scpn;
-
- /* Milan/Hades Atari clones do not have an Atari video chip */
- if ( (Getcookie(C__MIL, &cookie_mil) == C_FOUND) ||
- (Getcookie(C_hade, &cookie_hade) == C_FOUND) ) {
- return 0;
- }
-
- /* Cookie _VDO present ? if not, assume ST machine */
- if (Getcookie(C__VDO, &cookie_vdo) != C_FOUND) {
- cookie_vdo = VDO_ST << 16;
- }
-
- /* Test if we have a monochrome monitor plugged in */
- switch( cookie_vdo >>16) {
- case VDO_ST:
- case VDO_STE:
- if ( Getrez() == (ST_HIGH>>8) )
- return 0;
- break;
- case VDO_TT:
- if ( (EgetShift() & ES_MODE) == TT_HIGH)
- return 0;
- break;
- case VDO_F30:
- if ( VgetMonitor() == MONITOR_MONO)
- return 0;
- if (Getcookie(C_SCPN, &cookie_scpn) == C_FOUND) {
- if (!SDL_XBIOS_SB3Usable((scpn_cookie_t *)cookie_scpn)) {
- return 0;
- }
- }
- break;
- default:
- return 0;
- }
-
- return 1;
-}
-
-static void XBIOS_DeleteDevice(SDL_VideoDevice *device)
-{
- SDL_free(device->hidden);
- SDL_free(device);
-}
-
-static SDL_VideoDevice *XBIOS_CreateDevice(int devindex)
-{
- SDL_VideoDevice *device;
-
- /* Initialize all variables that we clean on shutdown */
- device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
- if ( device ) {
- SDL_memset(device, 0, (sizeof *device));
- device->hidden = (struct SDL_PrivateVideoData *)
- SDL_malloc((sizeof *device->hidden));
- device->gl_data = (struct SDL_PrivateGLData *)
- SDL_malloc((sizeof *device->gl_data));
- }
- if ( (device == NULL) || (device->hidden == NULL) ) {
- SDL_OutOfMemory();
- if ( device ) {
- SDL_free(device);
- }
- return(0);
- }
- SDL_memset(device->hidden, 0, (sizeof *device->hidden));
- SDL_memset(device->gl_data, 0, sizeof(*device->gl_data));
-
- /* Video functions */
- device->VideoInit = XBIOS_VideoInit;
- device->ListModes = XBIOS_ListModes;
- device->SetVideoMode = XBIOS_SetVideoMode;
- device->SetColors = XBIOS_SetColors;
- device->UpdateRects = NULL;
- device->VideoQuit = XBIOS_VideoQuit;
- device->AllocHWSurface = XBIOS_AllocHWSurface;
- device->LockHWSurface = XBIOS_LockHWSurface;
- device->UnlockHWSurface = XBIOS_UnlockHWSurface;
- device->FlipHWSurface = XBIOS_FlipHWSurface;
- device->FreeHWSurface = XBIOS_FreeHWSurface;
-
-#if SDL_VIDEO_OPENGL
- /* OpenGL functions */
- device->GL_LoadLibrary = SDL_AtariGL_LoadLibrary;
- device->GL_GetProcAddress = SDL_AtariGL_GetProcAddress;
- device->GL_GetAttribute = SDL_AtariGL_GetAttribute;
- device->GL_MakeCurrent = SDL_AtariGL_MakeCurrent;
- device->GL_SwapBuffers = XBIOS_GL_SwapBuffers;
-#endif
-
- /* Events */
- device->InitOSKeymap = Atari_InitOSKeymap;
- device->PumpEvents = Atari_PumpEvents;
-
- device->free = XBIOS_DeleteDevice;
-
- return device;
-}
-
-VideoBootStrap XBIOS_bootstrap = {
- XBIOS_VID_DRIVER_NAME, "Atari Xbios driver",
- XBIOS_Available, XBIOS_CreateDevice
-};
-
-void SDL_XBIOS_AddMode(_THIS, Uint16 modecode, Uint16 width, Uint16 height,
- Uint16 depth, SDL_bool flags)
-{
- int i, curpos;
- xbiosmode_t *current_mode;
-
- /* Check if mode already exists */
- if (XBIOS_modelist) {
- current_mode = XBIOS_modelist;
- for (i=0;i<XBIOS_nummodes; i++, current_mode++) {
- if (current_mode->width != width)
- continue;
- if (current_mode->height != height)
- continue;
- if (current_mode->depth != depth)
- continue;
- return;
- }
- }
-
- ++XBIOS_nummodes;
- XBIOS_modelist = (xbiosmode_t *) SDL_realloc(XBIOS_modelist, XBIOS_nummodes * sizeof(xbiosmode_t));
-
- /* Keep the list sorted: bpp, width, height */
- curpos=0;
-
- for(i=0; i<XBIOS_nummodes-1; i++) {
- if (XBIOS_modelist[i].depth <= depth) {
- if (XBIOS_modelist[i].width < width) {
- break;
- } else if (XBIOS_modelist[i].width == width) {
- if (XBIOS_modelist[i].height <= height) {
- break;
- }
- }
- }
- curpos++;
- }
-
- /* Push remaining modes further */
- for(i=XBIOS_nummodes-1; i>curpos; i--) {
- SDL_memcpy(&XBIOS_modelist[i], &XBIOS_modelist[i-1], sizeof(xbiosmode_t));
- }
-
- XBIOS_modelist[curpos].number = modecode;
- XBIOS_modelist[curpos].width = width;
- XBIOS_modelist[curpos].height = height;
- XBIOS_modelist[curpos].depth = depth;
- XBIOS_modelist[curpos].doubleline = flags;
-}
-
-static int XBIOS_VideoInit(_THIS, SDL_PixelFormat *vformat)
-{
- int i,j8,j16;
- xbiosmode_t *current_mode;
- unsigned long cookie_blow, cookie_scpn, cookie_cnts;
-
- /* Initialize all variables that we clean on shutdown */
- memset (SDL_modelist, 0, sizeof(SDL_modelist));
-
- /* Cookie _VDO present ? if not, assume ST machine */
- if (Getcookie(C__VDO, &XBIOS_cvdo) != C_FOUND) {
- XBIOS_cvdo = VDO_ST << 16;
- }
-
- /* Allocate memory for old palette */
- XBIOS_oldpalette = (void *)SDL_malloc(256*sizeof(long));
- if ( !XBIOS_oldpalette ) {
- SDL_SetError("Unable to allocate memory for old palette\n");
- return(-1);
- }
-
- /* Initialize video mode list */
- /* and save current screen status (palette, screen address, video mode) */
- XBIOS_nummodes = 0;
- XBIOS_modelist = NULL;
- XBIOS_centscreen = SDL_FALSE;
-
- switch (XBIOS_cvdo >>16) {
- case VDO_ST:
- case VDO_STE:
- {
- short *oldpalette;
-
- SDL_XBIOS_AddMode(this, ST_LOW>>8,320,200,4,SDL_FALSE);
-
- XBIOS_oldvbase=Physbase();
- XBIOS_oldvmode=Getrez();
- switch(XBIOS_oldvmode << 8) {
- case ST_LOW:
- XBIOS_oldnumcol=16;
- break;
- case ST_MED:
- XBIOS_oldnumcol=4;
- break;
- case ST_HIGH:
- XBIOS_oldnumcol=2;
- break;
- default:
- XBIOS_oldnumcol=0;
- break;
- }
-
- oldpalette= (short *) XBIOS_oldpalette;
- for (i=0;i<XBIOS_oldnumcol;i++) {
- *oldpalette++=Setcolor(i,-1);
- }
-
- vformat->BitsPerPixel = 8;
- }
- break;
- case VDO_TT:
-
- SDL_XBIOS_AddMode(this, TT_LOW,320,480,8,SDL_FALSE);
- /* Software double-lined mode */
- SDL_XBIOS_AddMode(this, TT_LOW,320,240,8,SDL_TRUE);
-
- XBIOS_oldvbase=Logbase();
- XBIOS_oldvmode=EgetShift();
-
- switch(XBIOS_oldvmode & ES_MODE) {
- case TT_LOW:
- XBIOS_oldnumcol=256;
- break;
- case ST_LOW:
- case TT_MED:
- XBIOS_oldnumcol=16;
- break;
- case ST_MED:
- XBIOS_oldnumcol=4;
- break;
- case ST_HIGH:
- case TT_HIGH:
- XBIOS_oldnumcol=2;
- break;
- default:
- XBIOS_oldnumcol=0;
- break;
- }
- if (XBIOS_oldnumcol) {
- EgetPalette(0, XBIOS_oldnumcol, XBIOS_oldpalette);
- }
-
- vformat->BitsPerPixel = 8;
- break;
- case VDO_F30:
- switch (VgetMonitor())
- {
- case MONITOR_MONO:
- /* Not usable */
- break;
- case MONITOR_RGB:
- case MONITOR_TV:
- SDL_XBIOS_AddMode(this, BPS16|COL80|OVERSCAN|VERTFLAG,768,480,16,SDL_FALSE);
- SDL_XBIOS_AddMode(this, BPS16|COL80|OVERSCAN,768,240,16,SDL_FALSE);
- SDL_XBIOS_AddMode(this, BPS16|COL80|VERTFLAG,640,400,16,SDL_FALSE);
- SDL_XBIOS_AddMode(this, BPS16|COL80,640,200,16,SDL_FALSE);
- SDL_XBIOS_AddMode(this, BPS16|OVERSCAN|VERTFLAG,384,480,16,SDL_FALSE);
- SDL_XBIOS_AddMode(this, BPS16|OVERSCAN,384,240,16,SDL_FALSE);
- SDL_XBIOS_AddMode(this, BPS16|VERTFLAG,320,400,16,SDL_FALSE);
- SDL_XBIOS_AddMode(this, BPS16,320,200,16,SDL_FALSE);
- SDL_XBIOS_AddMode(this, BPS8|COL80|OVERSCAN|VERTFLAG,768,480,8,SDL_FALSE);
- SDL_XBIOS_AddMode(this, BPS8|COL80|OVERSCAN,768,240,8,SDL_FALSE);
- SDL_XBIOS_AddMode(this, BPS8|COL80|VERTFLAG,640,400,8,SDL_FALSE);
- SDL_XBIOS_AddMode(this, BPS8|COL80,640,200,8,SDL_FALSE);
- SDL_XBIOS_AddMode(this, BPS8|OVERSCAN|VERTFLAG,384,480,8,SDL_FALSE);
- SDL_XBIOS_AddMode(this, BPS8|OVERSCAN,384,240,8,SDL_FALSE);
- SDL_XBIOS_AddMode(this, BPS8|VERTFLAG,320,400,8,SDL_FALSE);
- SDL_XBIOS_AddMode(this, BPS8,320,200,8,SDL_FALSE);
- break;
- case MONITOR_VGA:
- SDL_XBIOS_AddMode(this, BPS16,320,480,16,SDL_FALSE);
- SDL_XBIOS_AddMode(this, BPS16|VERTFLAG,320,240,16,SDL_FALSE);
- SDL_XBIOS_AddMode(this, BPS8|COL80,640,480,8,SDL_FALSE);
- SDL_XBIOS_AddMode(this, BPS8|COL80|VERTFLAG,640,240,8,SDL_FALSE);
- SDL_XBIOS_AddMode(this, BPS8,320,480,8,SDL_FALSE);
- SDL_XBIOS_AddMode(this, BPS8|VERTFLAG,320,240,8,SDL_FALSE);
- break;
- }
- XBIOS_oldvbase=Logbase();
- XBIOS_oldvmode=VsetMode(-1);
-
- XBIOS_oldnumcol= 1<< (1 << (XBIOS_oldvmode & NUMCOLS));
- if (XBIOS_oldnumcol > 256) {
- XBIOS_oldnumcol = 0;
- }
- if (XBIOS_oldnumcol) {
- VgetRGB(0, XBIOS_oldnumcol, XBIOS_oldpalette);
- }
-
- vformat->BitsPerPixel = 16;
-
- /* Keep vga/rvb, and pal/ntsc bits */
- current_mode = XBIOS_modelist;
- for (i=0;i<XBIOS_nummodes;i++) {
- Uint16 newvmode;
-
- newvmode = current_mode->number;
- newvmode &= ~(VGA|PAL);
- newvmode |= XBIOS_oldvmode & (VGA|PAL);
- current_mode->number = newvmode;
-
- current_mode++;
- }
-
- /* Initialize BlowUp/SB3/Centscreen stuff if present */
- if (Getcookie(C_BLOW, &cookie_blow) == C_FOUND) {
- SDL_XBIOS_BlowupInit(this, (blow_cookie_t *)cookie_blow);
- } else if (Getcookie(C_SCPN, &cookie_scpn) == C_FOUND) {
- SDL_XBIOS_SB3Init(this, (scpn_cookie_t *)cookie_scpn);
- } else if (Getcookie(C_CNTS, &cookie_cnts) == C_FOUND) {
- XBIOS_oldvmode = SDL_XBIOS_CentscreenInit(this);
- XBIOS_centscreen = SDL_TRUE;
- }
-
- break;
- }
-
- /* Determine the current screen size */
- if ( XBIOS_nummodes > 0 ) {
- /* FIXME: parse video mode list to search for current mode */
- this->info.current_w = XBIOS_modelist[0].width;
- this->info.current_h = XBIOS_modelist[0].height;
- }
-
- current_mode = XBIOS_modelist;
- j8 = j16 = 0;
- for (i=0; i<XBIOS_nummodes; i++, current_mode++) {
- switch (current_mode->depth) {
- case 4:
- case 8:
- SDL_modelist[0][j8] = SDL_malloc(sizeof(SDL_Rect));
- SDL_modelist[0][j8]->x = SDL_modelist[0][j8]->y = 0;
- SDL_modelist[0][j8]->w = current_mode->width;
- SDL_modelist[0][j8]->h = current_mode->height;
- XBIOS_videomodes[0][j8]=current_mode;
- j8++;
- break;
- case 16:
- SDL_modelist[1][j16] = SDL_malloc(sizeof(SDL_Rect));
- SDL_modelist[1][j16]->x = SDL_modelist[1][j16]->y = 0;
- SDL_modelist[1][j16]->w = current_mode->width;
- SDL_modelist[1][j16]->h = current_mode->height;
- XBIOS_videomodes[1][j16]=current_mode;
- j16++;
- break;
- }
- }
- SDL_modelist[0][j8] = NULL;
- SDL_modelist[1][j16] = NULL;
-
- XBIOS_screens[0]=NULL;
- XBIOS_screens[1]=NULL;
- XBIOS_shadowscreen=NULL;
-
- /* Update hardware info */
- this->info.hw_available = 1;
- this->info.video_mem = (Uint32) Atari_SysMalloc(-1L, MX_STRAM);
-
- /* Init chunky to planar routine */
- SDL_Atari_C2pConvert = SDL_Atari_C2pConvert8;
-
-#if SDL_VIDEO_OPENGL
- SDL_AtariGL_InitPointers(this);
-#endif
-
- /* Disable screensavers */
- if (SDL_XBIOS_TveillePresent(this)) {
- SDL_XBIOS_TveilleDisable(this);
- }
-
- /* We're done! */
- return(0);
-}
-
-static SDL_Rect **XBIOS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
-{
- /* 8 bits -> list 0 */
- /* 16 bits -> list 1 */
- if ((format->BitsPerPixel != 8) && (format->BitsPerPixel !=16)) {
- return NULL;
- }
-
- return(SDL_modelist[(format->BitsPerPixel)>>4]);
-}
-
-static void XBIOS_FreeBuffers(_THIS)
-{
- int i;
-
- for (i=0;i<2;i++) {
- if (XBIOS_screensmem[i]!=NULL) {
- Mfree(XBIOS_screensmem[i]);
- XBIOS_screensmem[i]=NULL;
- }
- }
-
- if (XBIOS_shadowscreen!=NULL) {
- Mfree(XBIOS_shadowscreen);
- XBIOS_shadowscreen=NULL;
- }
-}
-
-static SDL_Surface *XBIOS_SetVideoMode(_THIS, SDL_Surface *current,
- int width, int height, int bpp, Uint32 flags)
-{
- int mode, new_depth;
- int i;
- xbiosmode_t *new_video_mode;
- Uint32 new_screen_size;
- Uint32 modeflags;
-
- /* Free current buffers */
- XBIOS_FreeBuffers(this);
-
- /* Limit bpp */
- if (bpp>16) {
- bpp = 16;
- }
- bpp >>= 4;
-
- /* Search if the mode exists (width, height, bpp) */
- for ( mode=0; SDL_modelist[bpp][mode]; ++mode ) {
- if ( (SDL_modelist[bpp][mode]->w == width) &&
- (SDL_modelist[bpp][mode]->h == height) ) {
-
- break;
- }
- }
- if ( SDL_modelist[bpp][mode] == NULL ) {
- SDL_SetError("Couldn't find requested mode in list");
- return(NULL);
- }
-
- modeflags = SDL_FULLSCREEN | SDL_PREALLOC;
-
- /* Allocate needed buffers: simple/double buffer and shadow surface */
- new_video_mode = XBIOS_videomodes[bpp][mode];
- new_depth = new_video_mode->depth;
- if (new_depth == 4) {
- SDL_Atari_C2pConvert = SDL_Atari_C2pConvert4;
- new_depth=8;
- modeflags |= SDL_SWSURFACE|SDL_HWPALETTE;
- } else if (new_depth == 8) {
- SDL_Atari_C2pConvert = SDL_Atari_C2pConvert8;
- modeflags |= SDL_SWSURFACE|SDL_HWPALETTE;
- } else {
- modeflags |= SDL_HWSURFACE;
- }
-
- new_screen_size = width * height * ((new_depth)>>3);
- new_screen_size += 256; /* To align on a 256 byte adress */
-
- if (new_depth == 8) {
- XBIOS_shadowscreen = Atari_SysMalloc(new_screen_size, MX_PREFTTRAM);
-
- if (XBIOS_shadowscreen == NULL) {
- SDL_SetError("Can not allocate %d KB for shadow buffer", new_screen_size>>10);
- return (NULL);
- }
- SDL_memset(XBIOS_shadowscreen, 0, new_screen_size);
- }
-
- /* Output buffer needs to be twice in size for the software double-line mode */
- XBIOS_doubleline = SDL_FALSE;
- if (new_video_mode->doubleline) {
- new_screen_size <<= 1;
- XBIOS_doubleline = SDL_TRUE;
- }
-
- XBIOS_screensmem[0] = Atari_SysMalloc(new_screen_size, MX_STRAM);
-
- if (XBIOS_screensmem[0]==NULL) {
- XBIOS_FreeBuffers(this);
- SDL_SetError("Can not allocate %d KB for frame buffer", new_screen_size>>10);
- return (NULL);
- }
- SDL_memset(XBIOS_screensmem[0], 0, new_screen_size);
-
- XBIOS_screens[0]=(void *) (( (long) XBIOS_screensmem[0]+256) & 0xFFFFFF00UL);
-
-#if SDL_VIDEO_OPENGL
- if (flags & SDL_OPENGL) {
- if (this->gl_config.double_buffer) {
- flags |= SDL_DOUBLEBUF;
- }
- }
-#endif
-
- /* Double buffer ? */
- if (flags & SDL_DOUBLEBUF) {
- XBIOS_screensmem[1] = Atari_SysMalloc(new_screen_size, MX_STRAM);
-
- if (XBIOS_screensmem[1]==NULL) {
- XBIOS_FreeBuffers(this);
- SDL_SetError("Can not allocate %d KB for double buffer", new_screen_size>>10);
- return (NULL);
- }
- SDL_memset(XBIOS_screensmem[1], 0, new_screen_size);
-
- XBIOS_screens[1]=(void *) (( (long) XBIOS_screensmem[1]+256) & 0xFFFFFF00UL);
- modeflags |= SDL_DOUBLEBUF;
- }
-
- /* Allocate the new pixel format for the screen */
- if ( ! SDL_ReallocFormat(current, new_depth, 0, 0, 0, 0) ) {
- XBIOS_FreeBuffers(this);
- SDL_SetError("Couldn't allocate new pixel format for requested mode");
- return(NULL);
- }
-
- current->w = XBIOS_width = width;
- current->h = XBIOS_height = height;
- current->pitch = (width * new_depth)>>3;
-
- /* this is for C2P conversion */
- XBIOS_pitch = (new_video_mode->width * new_video_mode->depth)>>3;
-
- if (new_depth == 8)
- current->pixels = XBIOS_shadowscreen;
- else
- current->pixels = XBIOS_screens[0];
-
- XBIOS_fbnum = 0;
-
-#if SDL_VIDEO_OPENGL
- if (flags & SDL_OPENGL) {
- if (!SDL_AtariGL_Init(this, current)) {
- XBIOS_FreeBuffers(this);
- SDL_SetError("Can not create OpenGL context");
- return NULL;
- }
-
- modeflags |= SDL_OPENGL;
- }
-#endif
-
- current->flags = modeflags;
-
- /* Now set the video mode */
-#ifndef DEBUG_VIDEO_XBIOS
- Setscreen(-1,XBIOS_screens[0],-1);
-#endif
-
- switch(XBIOS_cvdo >> 16) {
- case VDO_ST:
-#ifndef DEBUG_VIDEO_XBIOS
- Setscreen(-1,-1,new_video_mode->number);
-#endif
- /* Reset palette */
- for (i=0;i<16;i++) {
- TT_palette[i]= ((i>>1)<<8) | (((i*8)/17)<<4) | (i>>1);
- }
-#ifndef DEBUG_VIDEO_XBIOS
- Setpalette(TT_palette);
-#endif
- break;
- case VDO_STE:
-#ifndef DEBUG_VIDEO_XBIOS
- Setscreen(-1,-1,new_video_mode->number);
-#endif
- /* Reset palette */
- for (i=0;i<16;i++)
- {
- int c;
-
- c=((i&1)<<3)|((i>>1)&7);
- TT_palette[i]=(c<<8)|(c<<4)|c;
- }
-#ifndef DEBUG_VIDEO_XBIOS
- Setpalette(TT_palette);
-#endif
- break;
- case VDO_TT:
-#ifndef DEBUG_VIDEO_XBIOS
- EsetShift(new_video_mode->number);
-#endif
- break;
- case VDO_F30:
-#ifndef DEBUG_VIDEO_XBIOS
- if (XBIOS_centscreen) {
- SDL_XBIOS_CentscreenSetmode(this, width, height, new_depth);
- } else {
- VsetMode(new_video_mode->number);
- }
-#endif
- /* Set hardware palette to black in True Colour */
- if (new_depth == 16) {
- SDL_memset(F30_palette, 0, sizeof(F30_palette));
- VsetRGB(0,256,F30_palette);
- }
- break;
- }
-
- Vsync();
-
- this->UpdateRects = XBIOS_UpdateRects;
-
- return (current);
-}
-
-/* We don't actually allow hardware surfaces other than the main one */
-static int XBIOS_AllocHWSurface(_THIS, SDL_Surface *surface)
-{
- return(-1);
-}
-
-static void XBIOS_FreeHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-static int XBIOS_LockHWSurface(_THIS, SDL_Surface *surface)
-{
- return(0);
-}
-
-static void XBIOS_UnlockHWSurface(_THIS, SDL_Surface *surface)
-{
- return;
-}
-
-static void XBIOS_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
-{
- SDL_Surface *surface;
-
- surface = this->screen;
-
- if ((surface->format->BitsPerPixel) == 8) {
- int i;
-
- for (i=0;i<numrects;i++) {
- void *source,*destination;
- int x1,x2;
-
- x1 = rects[i].x & ~15;
- x2 = rects[i].x+rects[i].w;
- if (x2 & 15) {
- x2 = (x2 | 15) +1;
- }
-
- source = surface->pixels;
- source += surface->pitch * rects[i].y;
- source += x1;
-
- destination = XBIOS_screens[XBIOS_fbnum];
- destination += XBIOS_pitch * rects[i].y;
- destination += x1;
-
- /* Convert chunky to planar screen */
- SDL_Atari_C2pConvert(
- source,
- destination,
- x2-x1,
- rects[i].h,
- XBIOS_doubleline,
- surface->pitch,
- XBIOS_pitch
- );
- }
- }
-
-#ifndef DEBUG_VIDEO_XBIOS
- Setscreen(-1,XBIOS_screens[XBIOS_fbnum],-1);
-#endif
- Vsync();
-
- if ((surface->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF) {
- XBIOS_fbnum ^= 1;
- if ((surface->format->BitsPerPixel) > 8) {
- surface->pixels=XBIOS_screens[XBIOS_fbnum];
- }
- }
-}
-
-static int XBIOS_FlipHWSurface(_THIS, SDL_Surface *surface)
-{
- if ((surface->format->BitsPerPixel) == 8) {
- void *destscr;
- int destx;
-
- /* Center on destination screen */
- destscr = XBIOS_screens[XBIOS_fbnum];
- destscr += XBIOS_pitch * ((XBIOS_height - surface->h) >> 1);
- destx = (XBIOS_width - surface->w) >> 1;
- destx &= ~15;
- destscr += destx;
-
- /* Convert chunky to planar screen */
- SDL_Atari_C2pConvert(
- surface->pixels,
- destscr,
- surface->w,
- surface->h,
- XBIOS_doubleline,
- surface->pitch,
- XBIOS_pitch
- );
- }
-
-#ifndef DEBUG_VIDEO_XBIOS
- Setscreen(-1,XBIOS_screens[XBIOS_fbnum],-1);
-#endif
- Vsync();
-
- if ((surface->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF) {
- XBIOS_fbnum ^= 1;
- if ((surface->format->BitsPerPixel) > 8) {
- surface->pixels=XBIOS_screens[XBIOS_fbnum];
- }
- }
-
- return(0);
-}
-
-static int XBIOS_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
-{
- int i;
- int r,v,b;
-
- switch( XBIOS_cvdo >> 16) {
- case VDO_ST:
- case VDO_STE:
- for (i=0;i<ncolors;i++)
- {
- r = colors[i].r;
- v = colors[i].g;
- b = colors[i].b;
-
- TT_palette[firstcolor+i]=((r*30)+(v*59)+(b*11))/100;
- }
- SDL_Atari_C2pConvert4_pal(TT_palette); /* convert the lighting */
- break;
- case VDO_TT:
- for(i = 0; i < ncolors; i++)
- {
- r = colors[i].r;
- v = colors[i].g;
- b = colors[i].b;
-
- TT_palette[i]=((r>>4)<<8)|((v>>4)<<4)|(b>>4);
- }
-#ifndef DEBUG_VIDEO_XBIOS
- EsetPalette(firstcolor,ncolors,TT_palette);
-#endif
- break;
- case VDO_F30:
- for(i = 0; i < ncolors; i++)
- {
- r = colors[i].r;
- v = colors[i].g;
- b = colors[i].b;
-
- F30_palette[i]=(r<<16)|(v<<8)|b;
- }
-#ifndef DEBUG_VIDEO_XBIOS
- VsetRGB(firstcolor,ncolors,F30_palette);
-#endif
- break;
- }
-
- return(1);
-}
-
-/* Note: If we are terminated, this could be called in the middle of
- another SDL video routine -- notably UpdateRects.
-*/
-static void XBIOS_VideoQuit(_THIS)
-{
- int i,j;
-
- Atari_ShutdownEvents();
-
- /* Restore video mode and palette */
-#ifndef DEBUG_VIDEO_XBIOS
- switch(XBIOS_cvdo >> 16) {
- case VDO_ST:
- case VDO_STE:
- Setscreen(-1,XBIOS_oldvbase,XBIOS_oldvmode);
- if (XBIOS_oldnumcol) {
- Setpalette(XBIOS_oldpalette);
- }
- break;
- case VDO_TT:
- Setscreen(-1,XBIOS_oldvbase,-1);
- EsetShift(XBIOS_oldvmode);
- if (XBIOS_oldnumcol) {
- EsetPalette(0, XBIOS_oldnumcol, XBIOS_oldpalette);
- }
- break;
- case VDO_F30:
- Setscreen(-1, XBIOS_oldvbase, -1);
- if (XBIOS_centscreen) {
- SDL_XBIOS_CentscreenRestore(this, XBIOS_oldvmode);
- } else {
- VsetMode(XBIOS_oldvmode);
- }
- if (XBIOS_oldnumcol) {
- VsetRGB(0, XBIOS_oldnumcol, XBIOS_oldpalette);
- }
- break;
- }
- Vsync();
-#endif
-
-
-#if SDL_VIDEO_OPENGL
- if (gl_active) {
- SDL_AtariGL_Quit(this, SDL_TRUE);
- }
-#endif
-
- if (XBIOS_oldpalette) {
- SDL_free(XBIOS_oldpalette);
- XBIOS_oldpalette=NULL;
- }
- XBIOS_FreeBuffers(this);
-
- /* Free mode list */
- for (j=0;j<NUM_MODELISTS;j++) {
- for (i=0;i<SDL_NUMMODES;i++) {
- if (SDL_modelist[j][i]!=NULL) {
- SDL_free(SDL_modelist[j][i]);
- SDL_modelist[j][i]=NULL;
- }
- }
- }
-
- if (XBIOS_modelist) {
- SDL_free(XBIOS_modelist);
- XBIOS_nummodes=0;
- XBIOS_modelist=NULL;
- }
-
- this->screen->pixels = NULL;
-
- /* Restore screensavers */
- if (SDL_XBIOS_TveillePresent(this)) {
- SDL_XBIOS_TveilleRestore(this);
- }
-}
-
-#if SDL_VIDEO_OPENGL
-
-static void XBIOS_GL_SwapBuffers(_THIS)
-{
- SDL_AtariGL_SwapBuffers(this);
- XBIOS_FlipHWSurface(this, this->screen);
- SDL_AtariGL_MakeCurrent(this);
-}
-
-#endif
diff --git a/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios.h b/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios.h
deleted file mode 100644
index fce1326..0000000
--- a/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2006 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_xbios_h
-#define _SDL_xbios_h
-
-#include "SDL_stdinc.h"
-#include "../SDL_sysvideo.h"
-
-/* Hidden "this" pointer for the video functions */
-#define _THIS SDL_VideoDevice *this
-
-/* TT video modes: 2
- Falcon RVB: 16 (could be *2 by adding PAL/NTSC modes)
- Falcon VGA: 6
- ST low: 1
-*/
-#define SDL_NUMMODES 16
-
-typedef struct
-{
- Uint16 number; /* Video mode number */
- Uint16 width; /* Size */
- Uint16 height;
- Uint16 depth; /* bits per plane */
- SDL_bool doubleline; /* Double the lines ? */
-} xbiosmode_t;
-
-/* Private display data */
-#define NUM_MODELISTS 2 /* 8 and 16 bits-per-pixel */
-
-struct SDL_PrivateVideoData {
- long cookie_vdo;
- int old_video_mode; /* Old video mode before entering SDL */
- void *old_video_base; /* Old pointer to screen buffer */
- void *old_palette; /* Old palette */
- Uint32 old_num_colors; /* Nb of colors in saved palette */
- int num_modes; /* Number of xbios video modes */
- xbiosmode_t *mode_list; /* List of xbios video modes */
-
- void *screens[2]; /* Pointers to aligned screen buffer */
- void *screensmem[2]; /* Pointers to screen buffer */
- void *shadowscreen; /* Shadow screen for c2p conversion */
- int doubleline; /* Double line mode ? */
- int frame_number; /* Number of frame for double buffer */
- int pitch; /* Destination line width for C2P */
- int width, height; /* Screen size for centered C2P */
-
- SDL_bool centscreen; /* Centscreen extension present ? */
-
- SDL_Rect *SDL_modelist[NUM_MODELISTS][SDL_NUMMODES+1];
- xbiosmode_t *videomodes[NUM_MODELISTS][SDL_NUMMODES+1];
-};
-
-/* _VDO cookie values */
-enum {
- VDO_ST=0,
- VDO_STE,
- VDO_TT,
- VDO_F30
-};
-
-/* Monitor types */
-enum {
- MONITOR_MONO=0,
- MONITOR_TV,
- MONITOR_VGA,
- MONITOR_RGB
-};
-
-/* EgetShift masks */
-#define ES_BANK 0x000f
-#define ES_MODE 0x0700
-#define ES_GRAY 0x1000
-#define ES_SMEAR 0x8000
-
-/* TT shifter modes */
-#define ST_LOW 0x0000
-#define ST_MED 0x0100
-#define ST_HIGH 0x0200
-#define TT_LOW 0x0700
-#define TT_MED 0x0300
-#define TT_HIGH 0x0600
-
-/* Hidden structure -> variables names */
-#define SDL_modelist (this->hidden->SDL_modelist)
-#define XBIOS_mutex (this->hidden->mutex)
-#define XBIOS_cvdo (this->hidden->cookie_vdo)
-#define XBIOS_oldpalette (this->hidden->old_palette)
-#define XBIOS_oldnumcol (this->hidden->old_num_colors)
-#define XBIOS_oldvbase (this->hidden->old_video_base)
-#define XBIOS_oldvmode (this->hidden->old_video_mode)
-#define XBIOS_nummodes (this->hidden->num_modes)
-#define XBIOS_modelist (this->hidden->mode_list)
-#define XBIOS_screens (this->hidden->screens)
-#define XBIOS_screensmem (this->hidden->screensmem)
-#define XBIOS_shadowscreen (this->hidden->shadowscreen)
-#define XBIOS_videomodes (this->hidden->videomodes)
-#define XBIOS_doubleline (this->hidden->doubleline)
-#define XBIOS_fbnum (this->hidden->frame_number)
-#define XBIOS_pitch (this->hidden->pitch)
-#define XBIOS_width (this->hidden->width)
-#define XBIOS_height (this->hidden->height)
-#define XBIOS_centscreen (this->hidden->centscreen)
-
-/*--- Functions prototypes ---*/
-
-void SDL_XBIOS_AddMode(_THIS, Uint16 modecode, Uint16 width, Uint16 height,
- Uint16 depth, SDL_bool flags);
-
-#endif /* _SDL_xbios_h */
diff --git a/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_blowup.c b/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_blowup.c
deleted file mode 100644
index e102a2e..0000000
--- a/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_blowup.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- Blowup extension definitions
-
- Patrice Mandin
-*/
-
-#include <mint/falcon.h>
-
-#include "SDL_xbios.h"
-#include "SDL_xbios_blowup.h"
-
-void SDL_XBIOS_BlowupInit(_THIS, blow_cookie_t *cookie_blow)
-{
- int i, num_mode, bank;
- blow_mode_t *blow_mode;
-
- /* Add bit 15 for old modes */
- for (i=0;i<XBIOS_nummodes;i++) {
- XBIOS_modelist[i].number |= 1<<15;
- }
-
- /* Add Blowup modes for 8 and 16 bpp */
- for (num_mode=3; num_mode<5; num_mode++) {
- bank = cookie_blow->num_mode[num_mode];
- blow_mode = &(cookie_blow->blowup_modes[num_mode+(bank*5)]);
-
- /* Check extended mode enabled */
- if (blow_mode->enabled == 0) {
- /* Check monitor needed for this mode */
- if ((blow_mode->monitor == cookie_blow->montype)
- || ((blow_mode->monitor == MONITOR_TV)
- && (cookie_blow->montype == MONITOR_RGB))
- || ((blow_mode->monitor == MONITOR_RGB)
- && (cookie_blow->montype == MONITOR_TV)))
- {
- /* we can use this extended mode */
- SDL_XBIOS_AddMode(this,
- num_mode == 3 ? BPS8 : BPS16,
- blow_mode->width + 1,
- blow_mode->height + 1,
- num_mode == 3 ? 8 : 16,
- SDL_FALSE
- );
- }
- }
- }
-}
diff --git a/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_blowup.h b/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_blowup.h
deleted file mode 100644
index ae65c09..0000000
--- a/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_blowup.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- Blowup extension definitions
-
- Patrice Mandin
-*/
-
-#ifndef _SDL_xbios_blowup_h
-#define _SDL_xbios_blowup_h
-
-#include "SDL_xbios.h"
-
-/*--- Types ---*/
-
-typedef struct {
- /* 64 bytes */
- unsigned short enabled; /* Extended mode enabled ? 0=yes, <>0=no */
- unsigned short dummy10[6];
- unsigned short registers_0E; /* value for register 0xffff820e */
- unsigned short registers_10; /* value for register 0xffff8210 */
- unsigned short dummy11[23];
-
- /* 64 bytes */
- unsigned short width; /* width-1 */
- unsigned short height; /* height-1 */
- unsigned short dummy20;
- unsigned long screensize; /* screensize in bytes */
- unsigned short dummy21[8];
- unsigned short virtual; /* Virtual screen ? */
- unsigned short virwidth; /* Virtual screen width */
- unsigned short virheight; /* Virtual screen height */
-
- unsigned short dummy22;
- unsigned short monitor; /* Monitor defined for this mode */
- unsigned short extension; /* Extended mode defined ? 0=yes, 1=no */
- unsigned short dummy23[13];
-
- /* 64 bytes */
- unsigned short dummy30;
- unsigned short registers_82[6]; /* values for registers 0xffff8282-8c */
- unsigned short dummy31[9];
-
- unsigned short dummy32;
- unsigned short registers_A2[6]; /* values for registers 0xffff82a2-ac */
- unsigned short dummy33[9];
-
- /* 64 bytes */
- unsigned short registers_C0; /* value for register 0xffff82c0 */
- unsigned short registers_C2; /* value for register 0xffff82c2 */
- unsigned short dummy40[30];
-} __attribute__((packed)) blow_mode_t;
-
-typedef struct {
- blow_mode_t blowup_modes[10];
- unsigned char num_mode[6];
- unsigned long dummy;
- unsigned short montype;
-} __attribute__((packed)) blow_cookie_t;
-
-/*--- Functions prototypes ---*/
-
-void SDL_XBIOS_BlowupInit(_THIS, blow_cookie_t *cookie_blow);
-
-#endif /* _SDL_xbios_blowup_h */
diff --git a/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_centscreen.c b/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_centscreen.c
deleted file mode 100644
index 96e5d7e..0000000
--- a/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_centscreen.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- Centscreen extension definitions
-
- Patrice Mandin
-*/
-
-#include <mint/falcon.h>
-
-#include "SDL_xbios.h"
-#include "SDL_xbios_centscreen.h"
-
-int SDL_XBIOS_CentscreenInit(_THIS)
-{
- centscreen_mode_t curmode, listedmode;
- unsigned long result;
- int cur_handle; /* Current Centscreen mode handle */
-
- /* Reset current mode list */
- if (XBIOS_modelist) {
- SDL_free(XBIOS_modelist);
- XBIOS_nummodes = 0;
- XBIOS_modelist = NULL;
- }
-
- /* Add Centscreen modes */
- Vread(&curmode);
- cur_handle = curmode.handle;
- curmode.mode = curmode.physx = curmode.physy = curmode.plan =
- curmode.logx = curmode.logy = -1;
-
- result = Vfirst(&curmode, &listedmode);
- if (result==0) {
- while (result==0) {
- /* Don't add modes with virtual screen */
- if ((listedmode.mode & CSCREEN_VIRTUAL)==0) {
- /* Don't add modes with bpp<8 */
- if (listedmode.plan>=8) {
- SDL_XBIOS_AddMode(this, listedmode.mode, listedmode.physx,
- listedmode.physy, listedmode.plan, SDL_FALSE
- );
- }
- }
- SDL_memcpy(&curmode, &listedmode, sizeof(centscreen_mode_t));
- curmode.mode = curmode.physx = curmode.physy = curmode.plan =
- curmode.logx = curmode.logy = -1;
- result = Vnext(&curmode, &listedmode);
- }
- } else {
- fprintf(stderr, "No suitable Centscreen modes\n");
- }
-
- return cur_handle;
-}
-
-void SDL_XBIOS_CentscreenSetmode(_THIS, int width, int height, int planes)
-{
- centscreen_mode_t newmode, curmode;
-
- newmode.handle = newmode.mode = newmode.logx = newmode.logy = -1;
- newmode.physx = width;
- newmode.physy = height;
- newmode.plan = planes;
- Vwrite(0, &newmode, &curmode);
-
- /* Disable screensaver */
- Vread(&newmode);
- newmode.mode &= ~(CSCREEN_SAVER|CSCREEN_ENERGYSTAR);
- Vwrite(0, &newmode, &curmode);
-}
-
-void SDL_XBIOS_CentscreenRestore(_THIS, int prev_handle)
-{
- centscreen_mode_t newmode, curmode;
-
- /* Restore old video mode */
- newmode.handle = prev_handle;
- newmode.mode = newmode.physx = newmode.physy = newmode.plan =
- newmode.logx = newmode.logy = -1;
- Vwrite(0, &newmode, &curmode);
-}
diff --git a/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_centscreen.h b/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_centscreen.h
deleted file mode 100644
index 8d23e7e..0000000
--- a/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_centscreen.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- Centscreen extension definitions
-
- Patrice Mandin
-*/
-
-#ifndef _SDL_xbios_centscreen_h
-#define _SDL_xbios_centscreen_h
-
-#include <mint/falcon.h> /* for trap_14_xxx macros */
-
-#include "SDL_xbios.h"
-
-/*--- Defines ---*/
-
-#ifndef C_CNTS
-#define C_CNTS 0x434e5453L
-#endif
-
-#define CSCREEN_ENERGYSTAR (1<<9)
-#define CSCREEN_SAVER (1<<10)
-#define CSCREEN_VIRTUAL (1<<11)
-#define CSCREEN_EXTCLOCK_CT2 (1<<12)
-#define CSCREEN_EXTCLOCK (1<<13)
-#define CSCREEN_STANDARD (1<<14)
-#define CSCREEN_DEFAULT (1<<15)
-
-/*--- Structures ---*/
-
-typedef struct {
- unsigned short handle; /* videomode handle */
- unsigned short mode; /* Falcon videomode code */
- unsigned short physx; /* visible width */
- unsigned short physy; /* visible height */
- unsigned short plan; /* bitplanes */
- unsigned short logx; /* virtual width */
- unsigned short logy; /* virtual height */
- unsigned short eco; /* screen saver delay */
- unsigned short eco2; /* energy star screen saver delay */
- unsigned short wsize; /* screen width (mm) */
- unsigned short hsize; /* screen height (mm) */
- unsigned short dummy[21];
- unsigned char name[32]; /* videomode name */
-} __attribute__((packed)) centscreen_mode_t;
-
-/*--- Functions prototypes ---*/
-
-#define Vread(current_mode) \
- (void)trap_14_wl((short)0x41,(long)(current_mode))
-#define Vwrite(init_vdi, inparam, outparam) \
- (long)trap_14_wwll((short)0x42,(short)(init_vdi),(long)(inparam),(long)(outparam))
-#define Vattrib(inparam, outparam) \
- (void)trap_14_wll((short)0x43,(long)(inparam),(long)(outparam))
-#define Vcreate(inparam, outparam) \
- (void)trap_14_wll((short)0x44,(long)(inparam),(long)(outparam))
-#define Vdelete(handle) \
- (long)trap_14_ww((short)0x45,(short)(handle))
-#define Vfirst(mask,mode) \
- (long)trap_14_wll((short)0x46,(long)(mask),(long)(mode))
-#define Vnext(mask,mode) \
- (long)trap_14_wll((short)0x47,(long)(mask),(long)(mode))
-#define Vvalid(handle) \
- (long)trap_14_ww((short)0x48,(short)(handle))
-#define Vload() \
- (long)trap_14_w((short)0x49)
-#define Vsave() \
- (long)trap_14_w((short)0x4a)
-#define Vopen() \
- (long)trap_14_w((short)0x4b)
-#define Vclose() \
- (long)trap_14_w((short)0x4c)
-#define Vscroll(scrollmode) \
- (long)trap_14_ww((short)0x4d,(short)(scrollmode))
-#define Voffset() \
- (long)trap_14_w((short)0x4e)
-#define Vseek() \
- (long)trap_14_w((short)0x4f)
-#define Vlock(cmd) \
- (long)trap_14_ww((short)0x50,(short)(cmd))
-#define SetMon(montype) \
- (long)trap_14_ww((short)0x51,(short)(montype))
-#define MultiMon(cmd) \
- (long)trap_14_ww((short)0x52,(short)(cmd))
-#define VSizeComp() \
- (long)trap_14_w((short)0x53)
-#define Vsize(mode) \
- (long)trap_14_wl((short)0x54,(long)(mode))
-
-/*--- Functions prototypes ---*/
-
-int SDL_XBIOS_CentscreenInit(_THIS);
-void SDL_XBIOS_CentscreenSetmode(_THIS, int width, int height, int planes);
-void SDL_XBIOS_CentscreenRestore(_THIS, int prev_handle);
-
-#endif /* _SDL_xbios_centscreen_h */
diff --git a/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_sb3.c b/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_sb3.c
deleted file mode 100644
index bcd610a..0000000
--- a/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_sb3.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- ScreenBlaster 3 functions
-
- Patrice Mandin
-*/
-
-/*--- Includes ---*/
-
-#include "SDL_stdinc.h"
-#include "SDL_xbios.h"
-#include "SDL_xbios_sb3.h"
-
-/*--- Defines ---*/
-
-const int SDL_XBIOS_scpn_planes_device[]={
- SCPN_DEV_1BPP,
- SCPN_DEV_4BPP,
- SCPN_DEV_8BPP,
- SCPN_DEV_16BPP,
- SCPN_DEV_2BPP,
- SCPN_DEV_4BPP,
- SCPN_DEV_1BPP
-};
-
-/*--- Functions ---*/
-
-int SDL_XBIOS_SB3Usable(scpn_cookie_t *cookie_scpn)
-{
- scpn_screeninfo_t *scrinfo;
- int bpp;
-
- /* Check if current SB3 mode is usable, i.e. 8 or 16bpp */
- scrinfo = cookie_scpn->screen_info;
- bpp = 1<<(SDL_XBIOS_scpn_planes_device[scrinfo->device]);
-
- if ((bpp==8) || (bpp==16)) {
- return 1;
- }
-
- return 0;
-}
-
-void SDL_XBIOS_SB3Init(_THIS, scpn_cookie_t *cookie_scpn)
-{
- scpn_screeninfo_t *scrinfo;
-
- /* SB3 prevent changing video modes, we can only use current one */
- if (XBIOS_modelist) {
- SDL_free(XBIOS_modelist);
- XBIOS_nummodes = 0;
- XBIOS_modelist = NULL;
- }
-
- scrinfo = cookie_scpn->screen_info;
- scrinfo->h_pos = scrinfo->v_pos = 0;
-
- SDL_XBIOS_AddMode(this,
- -1,
- scrinfo->virtual_width, scrinfo->virtual_height,
- 1<<(SDL_XBIOS_scpn_planes_device[scrinfo->device]),
- SDL_FALSE
- );
-}
diff --git a/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_sb3.h b/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_sb3.h
deleted file mode 100644
index 5179d31..0000000
--- a/distrib/sdl-1.2.12/src/video/xbios/SDL_xbios_sb3.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2004 Sam Lantinga
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Sam Lantinga
- slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/*
- ScreenBlaster 3 definitions
-
- Patrice Mandin
-*/
-
-#ifndef _SDL_xbios_sb3_h_
-#define _SDL_xbios_sb3_h_
-
-/*--- Defines ---*/
-
-#ifndef C_SCPN
-#define C_SCPN 0x5343504EL
-#endif
-
-#define SCPN_DEV_1BPP 0
-#define SCPN_DEV_2BPP 1
-#define SCPN_DEV_4BPP 2
-#define SCPN_DEV_8BPP 3
-#define SCPN_DEV_16BPP 4
-
-extern const int SDL_XBIOS_scpn_planes_device[];
-
-/*--- Types ---*/
-
-typedef struct {
- unsigned short virtual_width; /* Virtual screen width */
- unsigned short virtual_height; /* Virtual screen height */
- unsigned short visible_width; /* Visible width */
- unsigned short visible_height; /* Visible height */
- unsigned short h_pos; /* Horizontal position in virtual screen */
- unsigned short v_pos; /* Vertical position in virtual screen */
- unsigned short dummy;
- unsigned long size; /* Size of screen in bytes */
- unsigned short device; /* Device number to find planes = getRez() */
- /* = Index in scpn_planes_device[] */
-} __attribute__((packed)) scpn_screeninfo_t;
-
-typedef struct {
- unsigned long magic; /* just a BRA assembler jump */
- unsigned short version;
- void *dummy1;
- unsigned short ptsout0_1;
- unsigned short ptsout0_2;
- unsigned short dummy3;
- unsigned char date[8]; /* Date of program build */
- unsigned char asm_string[30]; /* 10 times the 'ASM' string */
- unsigned short dummy4;
- scpn_screeninfo_t *screen_info;
- unsigned short dummy6;
-} __attribute__((packed)) scpn_cookie_t;
-
-/*--- Function prototypes ---*/
-
-int SDL_XBIOS_SB3Usable(scpn_cookie_t *cookie_scpn);
-
-void SDL_XBIOS_SB3Init(_THIS, scpn_cookie_t *cookie_scpn);
-
-#endif /* _SDL_xbios_sb3_h_ */
diff --git a/distrib/sdl-1.2.12/BUGS b/distrib/sdl-1.2.15/BUGS
index 218bf3d..218bf3d 100644
--- a/distrib/sdl-1.2.12/BUGS
+++ b/distrib/sdl-1.2.15/BUGS
diff --git a/distrib/sdl-1.2.15/Borland.html b/distrib/sdl-1.2.15/Borland.html
new file mode 100644
index 0000000..eaf8209
--- /dev/null
+++ b/distrib/sdl-1.2.15/Borland.html
@@ -0,0 +1,139 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <title>Building SDL with Borland's C++ compilers</title>
+
+ <meta name="author"
+ content="David Snopek and updated by Dominique Louis.">
+</head>
+ <body>
+ <xevol @newtonave.net=""> </xevol>
+<h1>Building SDL with Borland's C++ compilers. </h1>
+ <b> by <a href="mailto:xevol@users.sourceforge.net"> David Snopek</a></b>
+ and updated by <b><a href="mailto:Dominique@SavageSoftware.com.au">Dominique
+ Louis</a></b> ( Last updated : 30th June 2003 ).<br>
+ <br>
+ These instructions cover how to compile SDL and its included test
+programs using either Borland <a href="#bcbwin">C++ Builder 5, 6 for Windows</a>,
+ <a href="#k3">C++ Builder for Linux ( AKA Kylix 3 )</a> or the free <a
+ href="#bccc">Borland C++ command-line compiler</a>. <br>
+
+<h3> <b> Extract the files </b> </h3>
+
+<p> Unzip the Borland.zip archive into <b>this</b> directory. Do not unzip
+ it into any other directory because the makefiles ( *.mak ) and project
+ files ( *.bpr ) use relative paths to refer to the SDL sources. This should
+ create a directory named "Borland" inside of the top level SDL source directory.
+ </p>
+
+<h3> <b><a name="bcbwin"></a> Using Borland C++ Builder 5, 6 for Windows </b>
+</h3>
+
+<p> Inside of the "Borland" directory there is a "bcb6" directory that contains
+ a number of Builder project files. Double-click on the "libSDL.bpg" file
+ icon. Once Builder has started click on the "<u>P</u>rojects" menu on
+the menu-bar and go down to "B<u>u</u>ild All Projects" option. <br>
+ This will proceed to build SDL ( with Borland's calling convention ),
+SDLmain, and all the <a href="#tests">test programs</a>. Currently, all
+the <a href="#tests">test programs</a> are dynamically linked to Sam Lantinga's
+SDL.dll.</p>
+
+<p><b>NOTE :</b> Borland's "lib" format and Microsoft's "lib" format are incompatible.
+&nbsp;<br>
+ If you wish to dynamically link to the SDL library supplied by Sam Lantinga
+ in each release, I have created the correct *.libs for SDL 1.2.4 and they
+ exist in the "/lib" directory.<br>
+ If you would like to create the *.lib files yourself, you will need to
+make use of Borland's "implib.exe" utility.<br>
+ </p>
+
+<p><tt>IMPLIB</tt> works like this: </p>
+
+<pre> IMPLIB (destination lib name) (source dll)<br></pre>
+
+<p> For example,</p>
+
+<pre> IMPLIB SDL.lib SDL.dll<br></pre>
+
+<p>This assumes that SDL.dll was compiled with Visual C++ or similar.<br>
+ </p>
+
+<p>To learn more about the difference between Borland's and Microsoft's *.lib
+ format please read the article <a
+ href="http://www.bcbdev.com/articles/vcdll.htm">here</a>.<br>
+ </p>
+
+<p> <b><br>
+ NOTE :</b> The C++ Builder for Windows project format, is not compatible
+ with the Kylix 3 project format, hence the reason why they are in separate
+ directories.</p>
+
+<h3> <b><a name="bccc"></a> Using the free Borland C++ command-line compiler
+ </b> </h3>
+
+<p> The free Borland compiler can be downloaded at no charge from <a
+ href="http://www.borland.com/bcppbuilder/freecompiler/"> the Borland website
+ </a>. Make sure that it is installed and properly configured. </p>
+
+<p> Open an MS-DOS Prompt. Change to the "Borland\freebcc" directory under
+ the SDL source directory. Type "make -f SDL.mak" to build SDL and "make
+ -f SDLmain.mak". There are also makefiles for all of the <a
+ href="#tests">test programs</a>, if you wish to build them. All .exes and
+DLLs are created in the "test" SDL directory. Ify ou would like to create
+the DLL and all the test applications, I have thrown together a basic batchfile
+called "makeall.bat" which should create everything in the right order. </p>
+
+<h3> <b> Output files </b> </h3>
+ No matter which compiler you used, three important files should have
+ been produced:
+<ul>
+ <li> SDL.dll ( Borland format ) </li>
+ <li> SDL.lib&nbsp;( Borland format ) </li>
+ <li> SDLmain.lib&nbsp;( Borland format ) </li>
+
+</ul>
+ Both of the *.lib files will need to be added to all the projects
+that use SDL and SDL.dll must be placed some where the Windows dynamic
+linker can find it (either in your project directory or on the system
+path, C:\WINDOWS\SYSTEM).
+<h3> <b><a name="k3"></a> Using Borland C++ Builder for Linux ( AKA Kylix
+ 3 ) </b> </h3>
+
+<p> Inside of the "Borland" directory there is a "k3" directory that contains
+ a number of Builder project files. Double-click on the "libSDL.bpg" file
+ icon. Once Builder has started click on the "<u>P</u>rojects" menu on
+the menu-bar and go down to "B<u>u</u>ild All Projects" option. This will
+proceed to build all the <a href="#tests">test programs</a>.&nbsp;<br>
+ Linux users do not need *.lib files as the Shared Object is linked right
+ into the project ( very neat actually, Windows should do this sort of thing
+ as it is a lot easier for the developer ). <br>
+ <b>NOTE :</b>&nbsp;The C++ Builder for Windows project format, is not
+ compatible with the Kylix 3 project format, hence the reason why they are
+ in separate directories.</p>
+
+<p> On Mandrake 8.1 the shared objects for SDL are located in the /usr/lib
+ directory as libSDL_*.so and the Mesa OpenGL shared objects are located
+in /usr/X11R6/lib as libGL*.so<br>
+ <br>
+ So if your setup is different you may need to change the project file
+ so that they re-link to the ones on your system.<br>
+ <br>
+ On Mandrake 8.1 the headers files are located at /usr/include/SDL/.
+ So if you you have not installed the development RPMs ( usually named libSDL-devel*
+ ) for SDL ( not included ) you may have to change the include directory
+ within some of the projects.<br>
+ </p>
+
+<h3> Known Problems</h3>
+ The only known problem is that I ( Dominique Louis ), was unable to
+create the projects that rebuilt the SDL shared objects under Linux, due
+to time constraints and my lack of intimate knowledge of Linux.
+<h3><a name="tests"><b> Test programs </b> </a></h3>
+ Some of the test programs require included media files ( *.wav; *.bmp
+etc ). All the test programs are now created in the "test" directory, where
+the media files are ( usually ) so they should be ready to go. <br>
+ <br>
+ <br>
+ <br>
+</body>
+</html>
diff --git a/distrib/sdl-1.2.15/Borland.zip b/distrib/sdl-1.2.15/Borland.zip
new file mode 100644
index 0000000..ed8f45d
--- /dev/null
+++ b/distrib/sdl-1.2.15/Borland.zip
Binary files differ
diff --git a/distrib/sdl-1.2.12/COPYING b/distrib/sdl-1.2.15/COPYING
index 2cba2ac..2cba2ac 100644
--- a/distrib/sdl-1.2.12/COPYING
+++ b/distrib/sdl-1.2.15/COPYING
diff --git a/distrib/sdl-1.2.15/CREDITS b/distrib/sdl-1.2.15/CREDITS
new file mode 100644
index 0000000..efdcfa4
--- /dev/null
+++ b/distrib/sdl-1.2.15/CREDITS
@@ -0,0 +1,94 @@
+
+Simple DirectMedia Layer CREDITS
+Thanks to everyone who made this possible, including:
+
+* Cliff Matthews, for giving me a reason to start this project. :)
+ -- Executor rocks! *grin*
+
+* Scott Call, for making a home for SDL on the 'Net... Thanks! :)
+
+* The Linux Fund, C Magazine, Educational Technology Resources Inc.,
+ Gareth Noyce, Jesse Pavel, Keith Kitchin, Jeremy Horvath, Thomas Nicholson,
+ Hans-Peter Gygax, the Eternal Lands Development Team, Lars Brubaker,
+ and Phoenix Kokido for financial contributions
+
+* Gaëtan de Menten for writing the PHP and SQL behind the SDL website
+
+* Tim Jones for the new look of the SDL website
+
+* Marco Kraus for setting up SDL merchandise
+
+* Martin Donlon for his work on the SDL Documentation Project
+
+* Ryan Gordon for helping everybody out and keeping the dream alive. :)
+
+* IBM R&D Lab for their PS3 SPE video acceleration code
+
+* Mattias Engdegård, for help with the Solaris port and lots of other help
+
+* Max Watson, Matt Slot, and Kyle for help with the MacOS Classic port
+
+* Stan Shebs, for the initial Mac OS X port
+
+* Eric Wing, Max Horn, and Darrell Walisser for unflagging work on the Mac OS X port
+
+* Patrick Trainor, Jim Boucher, and Mike Gorchak for the QNX Neutrino port
+
+* Carsten Griwodz for the AIX port
+
+* Gabriele Greco, for the Amiga port
+
+* Patrice Mandin, for the Atari port
+
+* Hannu Viitala for the EPOC port
+
+* Marcus Mertama for the S60 port.
+
+* Peter Valchev for nagging me about the OpenBSD port until I got it right. :)
+
+* Kent B Mein, for a place to do the IRIX port
+
+* Ash, for a place to do the OSF/1 Alpha port
+
+* David Sowsy, for help with the BeOS port
+
+* Eugenia Loli, for endless work on porting SDL games to BeOS
+
+* Jon Taylor for the GGI front-end
+
+* Paulus Esterhazy, for the Visual C++ testing and libraries
+
+* Brenda Tantzen, for Metrowerks CodeWarrior on MacOS
+
+* Chris Nentwich, for the Hermes assembly blitters
+
+* Michael Vance and Jim Kutter for the X11 OpenGL support
+
+* Stephane Peter, for the AAlib front-end and multi-threaded timer idea.
+
+* Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation
+
+* Peter Wiklund, for the 1998 winning SDL logo,
+ and Arto Hamara, Steven Wong, and Kent Mein for other logo entries.
+
+* Arne Claus, for the 2004 winning SDL logo,
+ and Shandy Brown, Jac, Alex Lyman, Mikkel Gjoel, #Guy, Jonas Hartmann,
+ Daniel Liljeberg, Ronald Sowa, DocD, Pekka Jaervinen, Patrick Avella,
+ Erkki Kontilla, Levon Gavalian, Hal Emerich, David Wiktorsson,
+ S. Schury and F. Hufsky, Ciska de Ruyver, Shredweat, Tyler Montbriand,
+ Martin Andersson, Merlyn Wysard, Fernando Ibanez, David Miller,
+ Andre Bommele, lovesby.com, Francisco Camenforte Torres, and David Igreja
+ for other logo entries.
+
+* Bob Pendleton and David Olofson for being long time contributors to
+ the SDL mailing list.
+
+* Everybody at Loki Software, Inc. for their great contributions!
+
+ And a big hand to everyone else who gave me appreciation, advice,
+ and suggestions, especially the good folks on the SDL mailing list.
+
+THANKS! :)
+
+ -- Sam Lantinga <slouken@libsdl.org>
+
diff --git a/distrib/sdl-1.2.15/CWprojects.sea.bin b/distrib/sdl-1.2.15/CWprojects.sea.bin
new file mode 100644
index 0000000..e8a6fdc
--- /dev/null
+++ b/distrib/sdl-1.2.15/CWprojects.sea.bin
Binary files differ
diff --git a/distrib/sdl-1.2.15/INSTALL b/distrib/sdl-1.2.15/INSTALL
new file mode 100644
index 0000000..1a30fba
--- /dev/null
+++ b/distrib/sdl-1.2.15/INSTALL
@@ -0,0 +1,23 @@
+
+To compile and install SDL:
+
+ 1. Run './configure; make; make install'
+
+ If you are compiling for Windows using gcc, read the FAQ at:
+ http://www.libsdl.org/faq.php?action=listentries&category=4#42
+
+ If you are compiling using Visual C++ on Win32, you should read
+ the file VisualC.html
+
+ 2. Look at the example programs in ./test, and check out the HTML
+ documentation in ./docs to see how to use the SDL library.
+
+ 3. Join the SDL developer mailing list by sending E-mail to
+ sdl-request@libsdl.org
+ and put "subscribe" in the subject of the message.
+
+ Or alternatively you can use the web interface:
+ http://www.libsdl.org/mailing-list.php
+
+That's it!
+Sam Lantinga <slouken@libsdl.org>
diff --git a/distrib/sdl-1.2.15/MPWmake.sea.bin b/distrib/sdl-1.2.15/MPWmake.sea.bin
new file mode 100644
index 0000000..b345e08
--- /dev/null
+++ b/distrib/sdl-1.2.15/MPWmake.sea.bin
Binary files differ
diff --git a/distrib/sdl-1.2.15/Makefile b/distrib/sdl-1.2.15/Makefile
new file mode 100644
index 0000000..477677b
--- /dev/null
+++ b/distrib/sdl-1.2.15/Makefile
@@ -0,0 +1,71 @@
+# Copyright (C) 2012 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# this is a set of definitions that allow the usage of Makefile.android
+# even if we're not using the Android build system.
+#
+
+OBJS_DIR := objs
+CONFIG_MAKE := $(OBJS_DIR)/config.make
+CONFIG_H := $(OBJS_DIR)/config-host.h
+
+ifeq ($(wildcard $(CONFIG_MAKE)),)
+ $(error "The configuration file '$(CONFIG_MAKE)' doesnt' exist, please run the "android-configure.sh" script)
+endif
+
+include $(CONFIG_MAKE)
+
+ifeq ($(strip $(BUILD_SYSTEM)),)
+ $(error "The BUILD_SYSTEM variable was not defined by your configuration sub-makefile. Aborting")
+endif
+
+include $(BUILD_SYSTEM)/definitions.make
+
+VPATH := $(OBJS_DIR)
+VPATH += :$(SRC_PATH)/include
+VPATH += :$(SRC_PATH)
+
+.PHONY: all libraries executables clean clean-config clean-objs-dir \
+ clean-executables clean-libraries
+
+CLEAR_VARS := $(BUILD_SYSTEM)/clear_vars.make
+BUILD_HOST_EXECUTABLE := $(BUILD_SYSTEM)/host_executable.make
+BUILD_HOST_STATIC_LIBRARY := $(BUILD_SYSTEM)/host_static_library.make
+
+DEPENDENCY_DIRS :=
+
+all: libraries executables
+EXECUTABLES :=
+LIBRARIES :=
+
+clean: clean-intermediates
+
+distclean: clean clean-config
+
+# let's roll
+include Makefile.android
+
+libraries: $(LIBRARIES)
+executables: $(EXECUTABLES)
+
+clean-intermediates:
+ rm -rf $(OBJS_DIR)/intermediates $(EXECUTABLES) $(LIBRARIES)
+
+clean-config:
+ rm -f $(CONFIG_MAKE) $(CONFIG_H)
+
+# include dependency information
+DEPENDENCY_DIRS := $(sort $(DEPENDENCY_DIRS))
+-include $(wildcard $(DEPENDENCY_DIRS:%=%/*.d))
diff --git a/distrib/sdl-1.2.12/Makefile.android b/distrib/sdl-1.2.15/Makefile.android
index 2dfa7dd..2dfa7dd 100644
--- a/distrib/sdl-1.2.12/Makefile.android
+++ b/distrib/sdl-1.2.15/Makefile.android
diff --git a/distrib/sdl-1.2.15/Makefile.dc b/distrib/sdl-1.2.15/Makefile.dc
new file mode 100644
index 0000000..58d6e71
--- /dev/null
+++ b/distrib/sdl-1.2.15/Makefile.dc
@@ -0,0 +1,111 @@
+#GL=1
+
+CC = sh-elf-gcc
+AR = sh-elf-ar
+
+ifdef GL
+DEFS += -DSDL_VIDEO_OPENGL=1
+TARGET = libSDL_gl.a
+else
+TARGET = libSDL.a
+endif
+
+CFLAGS=$(KOS_CFLAGS) $(DEFS) -Iinclude
+
+SRCS = \
+ src/audio/dc/SDL_dcaudio.c \
+ src/audio/dc/aica.c \
+ src/audio/dummy/SDL_dummyaudio.c \
+ src/audio/SDL_audio.c \
+ src/audio/SDL_audiocvt.c \
+ src/audio/SDL_audiodev.c \
+ src/audio/SDL_mixer.c \
+ src/audio/SDL_wave.c \
+ src/cdrom/dc/SDL_syscdrom.c \
+ src/cdrom/SDL_cdrom.c \
+ src/events/SDL_active.c \
+ src/events/SDL_events.c \
+ src/events/SDL_expose.c \
+ src/events/SDL_keyboard.c \
+ src/events/SDL_mouse.c \
+ src/events/SDL_quit.c \
+ src/events/SDL_resize.c \
+ src/file/SDL_rwops.c \
+ src/joystick/dc/SDL_sysjoystick.c \
+ src/joystick/SDL_joystick.c \
+ src/loadso/dummy/SDL_sysloadso.c \
+ src/SDL.c \
+ src/SDL_error.c \
+ src/SDL_fatal.c \
+ src/stdlib/SDL_getenv.c \
+ src/stdlib/SDL_iconv.c \
+ src/stdlib/SDL_malloc.c \
+ src/stdlib/SDL_qsort.c \
+ src/stdlib/SDL_stdlib.c \
+ src/stdlib/SDL_string.c \
+ src/thread/dc/SDL_syscond.c \
+ src/thread/dc/SDL_sysmutex.c \
+ src/thread/dc/SDL_syssem.c \
+ src/thread/dc/SDL_systhread.c \
+ src/thread/SDL_thread.c \
+ src/timer/dc/SDL_systimer.c \
+ src/timer/SDL_timer.c \
+ src/video/dc/SDL_dcevents.c \
+ src/video/dc/SDL_dcvideo.c \
+ src/video/dummy/SDL_nullevents.c \
+ src/video/dummy/SDL_nullmouse.c \
+ src/video/dummy/SDL_nullvideo.c \
+ src/video/SDL_blit.c \
+ src/video/SDL_blit_0.c \
+ src/video/SDL_blit_1.c \
+ src/video/SDL_blit_A.c \
+ src/video/SDL_blit_N.c \
+ src/video/SDL_bmp.c \
+ src/video/SDL_cursor.c \
+ src/video/SDL_gamma.c \
+ src/video/SDL_pixels.c \
+ src/video/SDL_RLEaccel.c \
+ src/video/SDL_stretch.c \
+ src/video/SDL_surface.c \
+ src/video/SDL_video.c \
+ src/video/SDL_yuv.c \
+ src/video/SDL_yuv_sw.c \
+
+OBJS = $(SRCS:.c=.o)
+
+TEST = \
+ test/checkkeys.c \
+ test/graywin.c \
+ test/loopwave.c \
+ test/testalpha.c \
+ test/testbitmap.c \
+ test/testcdrom.c \
+ test/testerror.c \
+ test/testgamma.c \
+ test/testgl.c \
+ test/testhread.c \
+ test/testjoystick.c \
+ test/testkeys.c \
+ test/testlock.c \
+ test/testoverlay.c \
+ test/testpalette.c \
+ test/testsem.c \
+ test/testsprite.c \
+ test/testtimer.c \
+ test/testtypes.c \
+ test/testver.c \
+ test/testvidinfo.c \
+ test/testwin.c \
+ test/testwm.c \
+ test/threadwin.c \
+ test/torturethread.c \
+
+$(TARGET): copy_config \
+ $(OBJS)
+ $(AR) rcs $(TARGET) $(OBJS)
+
+copy_config:
+ @cp include/SDL_config.h.default include/SDL_config.h
+
+clean:
+ rm -f include/SDL_config.h $(OBJS)
diff --git a/distrib/sdl-1.2.15/Makefile.ds b/distrib/sdl-1.2.15/Makefile.ds
new file mode 100644
index 0000000..df3d146
--- /dev/null
+++ b/distrib/sdl-1.2.15/Makefile.ds
@@ -0,0 +1,63 @@
+#LibSDL 1.2.12
+#DS porting by Troy Davis(GPF)
+
+
+ifeq ($(strip $(DEVKITPRO)),)
+$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitPro)
+endif
+ifeq ($(strip $(DEVKITARM)),)
+DEVKITARM := $(DEVKITPRO)/devkitARM
+endif
+
+
+SRCS = $(shell echo ./src/*.c ./src/audio/*.c ./src/cdrom/*.c ./src/cpuinfo/*.c ./src/events/*.c ./src/file/*.c ./src/stdlib/*.c ./src/thread/*.c ./src/timer/*.c ./src/video/*.c ./src/joystick/*.c ./src/joystick/nds/*.c ./src/cdrom/dummy/*.c ./src/thread/generic/*.c ./src/timer/nds/*.c ./src/loadso/dummy/*.c ./src/audio/dummy/*.c ./src/audio/nds/*.c ./src/video/dummy/*.c ./src/video/nds/*.c)
+
+OBJS = $(SRCS:.c=.o)
+
+
+SUBDIRS=
+
+CC=arm-eabi-gcc
+CXX=arm-eabi-g++
+LDSHARED=$(CXX)
+AR=arm-eabi-ar rc
+RANLIB=arm-eabi-ranlib
+
+CFLAGS = -mthumb -mthumb-interwork \
+ -march=armv5te -mtune=arm946e-s \
+ -O2 -Wall -Wwrite-strings -Wpointer-arith \
+ -DARM9 -D__NDS__ -I$(DEVKITPRO)/libnds/include -Iinclude
+
+CXXFLAGS += $(CFLAGS)
+
+all: $(DEVKITPRO)/libnds/lib/libSDL.a
+
+
+$(DEVKITPRO)/libnds/lib/libSDL.a: $(OBJS)
+ $(AR) $@ $(OBJS)
+ -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
+
+clean:
+ find . -name "*.o" |xargs rm -f
+ find . -name "*.d" |xargs rm -f
+ -rm -f *.elf
+ -rm -f *.nds
+ -rm -f *.gba
+ -rm -f *.arm9
+ -rm -f *.map
+ -rm -f *.img
+ -rm -Rf *.d
+
+
+subdirs: $(patsubst %, _dir_%, $(SUBDIRS))
+
+$(patsubst %, _dir_%, $(SUBDIRS)):
+ $(MAKE) -C $(patsubst _dir_%, %, $@)
+
+clean_subdirs: $(patsubst %, _clean_dir_%, $(SUBDIRS))
+
+$(patsubst %, _clean_dir_%, $(SUBDIRS)):
+ $(MAKE) -C $(patsubst _clean_dir_%, %, $@) clean
+
+#include $(DEVKITARM)/ds_rules
+
diff --git a/distrib/sdl-1.2.15/Makefile.in b/distrib/sdl-1.2.15/Makefile.in
new file mode 100644
index 0000000..ab51035
--- /dev/null
+++ b/distrib/sdl-1.2.15/Makefile.in
@@ -0,0 +1,178 @@
+# Makefile to build and install the SDL library
+
+top_builddir = .
+srcdir = @srcdir@
+objects = build
+depend = build-deps
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+libdir = @libdir@
+includedir = @includedir@
+datarootdir = @datarootdir@
+datadir = @datadir@
+mandir = @mandir@
+auxdir = @ac_aux_dir@
+distpath = $(srcdir)/..
+distdir = SDL-@SDL_VERSION@
+distfile = $(distdir).tar.gz
+
+@SET_MAKE@
+SHELL = @SHELL@
+CC = @CC@
+INCLUDE = @INCLUDE@
+CFLAGS = @BUILD_CFLAGS@
+EXTRA_CFLAGS = @EXTRA_CFLAGS@
+LDFLAGS = @BUILD_LDFLAGS@
+EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
+LIBTOOL = @LIBTOOL@
+INSTALL = @INSTALL@
+NASM = @NASM@ @NASMFLAGS@
+AR = @AR@
+RANLIB = @RANLIB@
+WINDRES = @WINDRES@
+
+TARGET = libSDL.la
+SOURCES = @SOURCES@
+OBJECTS = @OBJECTS@
+
+SDLMAIN_TARGET = libSDLmain.la
+SDLMAIN_SOURCES = @SDLMAIN_SOURCES@
+SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
+SDLMAIN_LDFLAGS = @SDLMAIN_LDFLAGS@
+
+DIST = acinclude autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS CWprojects.sea.bin docs docs.html include INSTALL Makefile.dc Makefile.minimal Makefile.in MPWmake.sea.bin README* sdl-config.in sdl.m4 sdl.pc.in SDL.qpg.in SDL.spec SDL.spec.in src test TODO VisualCE VisualC.html VisualC Watcom-OS2.zip Watcom-Win32.zip symbian.zip WhatsNew Xcode
+
+HDRS = SDL.h SDL_active.h SDL_audio.h SDL_byteorder.h SDL_cdrom.h SDL_cpuinfo.h SDL_endian.h SDL_error.h SDL_events.h SDL_getenv.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_platform.h SDL_quit.h SDL_rwops.h SDL_stdinc.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_types.h SDL_version.h SDL_video.h begin_code.h close_code.h
+
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+LT_LDFLAGS = -no-undefined -rpath $(DESTDIR)$(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
+
+all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
+
+$(srcdir)/configure: $(srcdir)/configure.in
+ @echo "Warning, configure.in is out of date"
+ #(cd $(srcdir) && sh autogen.sh && sh configure)
+ @sleep 3
+
+Makefile: $(srcdir)/Makefile.in
+ $(SHELL) config.status $@
+
+$(objects):
+ $(SHELL) $(auxdir)/mkinstalldirs $@
+
+.PHONY: all depend install install-bin install-hdrs install-lib install-data install-man uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-man clean distclean dist
+depend:
+ @SOURCES="$(SOURCES) $(SDLMAIN_SOURCES)" INCLUDE="$(INCLUDE)" output="$(depend)" \
+ $(SHELL) $(auxdir)/makedep.sh
+
+include $(depend)
+
+$(objects)/$(TARGET): $(OBJECTS)
+ $(LIBTOOL) --mode=link $(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
+
+$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
+ $(LIBTOOL) --mode=link $(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) $(SDLMAIN_LDFLAGS)
+
+
+install: all install-bin install-hdrs install-lib install-data install-man
+install-bin:
+ $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir)
+ $(INSTALL) -m 755 sdl-config $(DESTDIR)$(bindir)/sdl-config
+install-hdrs:
+ $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL
+ for file in $(HDRS); do \
+ $(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL/$$file; \
+ done
+ $(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL/SDL_config.h
+install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
+ $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)
+ $(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
+ $(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
+install-data:
+ $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal
+ $(INSTALL) -m 644 $(srcdir)/sdl.m4 $(DESTDIR)$(datadir)/aclocal/sdl.m4
+ $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig
+ $(INSTALL) -m 644 sdl.pc $(DESTDIR)$(libdir)/pkgconfig
+install-man:
+ $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(mandir)/man3
+ for src in $(srcdir)/docs/man3/*.3; do \
+ file=`echo $$src | sed -e 's|^.*/||'`; \
+ $(INSTALL) -m 644 $$src $(DESTDIR)$(mandir)/man3/$$file; \
+ done
+
+uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-man
+uninstall-bin:
+ rm -f $(DESTDIR)$(bindir)/sdl-config
+uninstall-hdrs:
+ for file in $(HDRS); do \
+ rm -f $(DESTDIR)$(includedir)/SDL/$$file; \
+ done
+ rm -f $(DESTDIR)$(includedir)/SDL/SDL_config.h
+ -rmdir $(DESTDIR)$(includedir)/SDL
+uninstall-lib:
+ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(TARGET)
+ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
+uninstall-data:
+ rm -f $(DESTDIR)$(datadir)/aclocal/sdl.m4
+ rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl.pc
+uninstall-man:
+ for src in $(srcdir)/docs/man3/*.3; do \
+ file=`echo $$src | sed -e 's|^.*/||'`; \
+ rm -f $(DESTDIR)$(mandir)/man3/$$file; \
+ done
+
+clean:
+ rm -rf $(objects)
+ if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
+
+distclean: clean
+ rm -f Makefile include/SDL_config.h sdl-config
+ rm -f SDL.qpg
+ rm -f config.status config.cache config.log libtool $(depend)
+ rm -rf $(srcdir)/autom4te*
+ rm -rf $(srcdir)/test/autom4te*
+ find $(srcdir) \( \
+ -name '*~' -o \
+ -name '*.bak' -o \
+ -name '*.old' -o \
+ -name '*.rej' -o \
+ -name '*.orig' -o \
+ -name '.#*' \) \
+ -exec rm -f {} \;
+ cp $(srcdir)/include/SDL_config.h.default $(srcdir)/include/SDL_config.h
+ if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
+
+dist $(distfile):
+ $(SHELL) $(auxdir)/mkinstalldirs $(distdir)
+ tar cf - $(DIST) | (cd $(distdir); tar xf -)
+ cp $(distdir)/include/SDL_config.h.default $(distdir)/include/SDL_config.h
+ rm -rf `find $(distdir) -name .svn`
+ rm -rf $(distdir)/test/autom4te*
+ find $(distdir) \( \
+ -name '*~' -o \
+ -name '*.bak' -o \
+ -name '*.old' -o \
+ -name '*.rej' -o \
+ -name '*.orig' -o \
+ -name '.#*' \) \
+ -exec rm -f {} \;
+ if test -f $(distdir)/test/Makefile; then (cd $(distdir)/test && make distclean); fi
+ tar cvf - $(distdir) | gzip --best >$(distfile)
+ rm -rf $(distdir)
+
+rpm: $(distfile)
+ rpmbuild -ta $?
+
+# Create a SVN snapshot that people can run update on
+snapshot:
+ svn co http://svn.libsdl.org/branches/SDL-1.2
+ (cd SDL-1.2 && ./autogen.sh && rm -rf autom4te.cache)
+ cp SDL-1.2/include/SDL_config.h.default SDL-1.2/include/SDL_config.h
+ tar zcf $(HOME)/SDL-1.2.tar.gz SDL-1.2
+ rm -f $(HOME)/SDL-1.2.zip
+ zip -r $(HOME)/SDL-1.2.zip SDL-1.2
+ rm -rf SDL-1.2
diff --git a/distrib/sdl-1.2.15/Makefile.minimal b/distrib/sdl-1.2.15/Makefile.minimal
new file mode 100644
index 0000000..827621c
--- /dev/null
+++ b/distrib/sdl-1.2.15/Makefile.minimal
@@ -0,0 +1,42 @@
+# Makefile to build the SDL library
+
+INCLUDE = -I./include
+CFLAGS = -g -O2 $(INCLUDE)
+AR = ar
+RANLIB = ranlib
+
+CONFIG_H = include/SDL_config.h
+TARGET = libSDL.a
+SOURCES = \
+ src/*.c \
+ src/audio/*.c \
+ src/cdrom/*.c \
+ src/cpuinfo/*.c \
+ src/events/*.c \
+ src/file/*.c \
+ src/joystick/*.c \
+ src/stdlib/*.c \
+ src/thread/*.c \
+ src/timer/*.c \
+ src/video/*.c \
+ src/audio/dummy/*.c \
+ src/video/dummy/*.c \
+ src/joystick/dummy/*.c \
+ src/cdrom/dummy/*.c \
+ src/thread/generic/*.c \
+ src/timer/dummy/*.c \
+ src/loadso/dummy/*.c \
+
+OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
+
+all: $(TARGET)
+
+$(TARGET): $(CONFIG_H) $(OBJECTS)
+ $(AR) crv $@ $^
+ $(RANLIB) $@
+
+$(CONFIG_H):
+ cp $(CONFIG_H).default $(CONFIG_H)
+
+clean:
+ rm -f $(TARGET) $(OBJECTS)
diff --git a/distrib/sdl-1.2.12/README b/distrib/sdl-1.2.15/README
index 7c0dd58..7c0dd58 100644
--- a/distrib/sdl-1.2.12/README
+++ b/distrib/sdl-1.2.15/README
diff --git a/distrib/sdl-1.2.15/README-SDL.txt b/distrib/sdl-1.2.15/README-SDL.txt
new file mode 100644
index 0000000..4d36ca9
--- /dev/null
+++ b/distrib/sdl-1.2.15/README-SDL.txt
@@ -0,0 +1,13 @@
+
+Please distribute this file with the SDL runtime environment:
+
+The Simple DirectMedia Layer (SDL for short) is a cross-platfrom library
+designed to make it easy to write multi-media software, such as games and
+emulators.
+
+The Simple DirectMedia Layer library source code is available from:
+http://www.libsdl.org/
+
+This library is distributed under the terms of the GNU LGPL license:
+http://www.gnu.org/copyleft/lesser.html
+
diff --git a/distrib/sdl-1.2.15/README.ANDROID b/distrib/sdl-1.2.15/README.ANDROID
new file mode 100644
index 0000000..cc4fee2
--- /dev/null
+++ b/distrib/sdl-1.2.15/README.ANDROID
@@ -0,0 +1,9 @@
+This is a modified version of SDL 1.2.15 that is used by the Android QEMU
+emulator. See the git history for modifications relative to upstream.
+
+To build it as a static library on Linux, OS X and Windows:
+
+./android-configure.sh [--prefix=<path>]
+make -j2
+make install
+
diff --git a/distrib/sdl-1.2.15/README.AmigaOS b/distrib/sdl-1.2.15/README.AmigaOS
new file mode 100644
index 0000000..e0d8906
--- /dev/null
+++ b/distrib/sdl-1.2.15/README.AmigaOS
@@ -0,0 +1,12 @@
+The AmigaOS code has been removed from SDL, since it had been broken for a
+ long time and had a few bits of fairly invasive code #ifdef'd into the
+ SDL core.
+
+However, there is an OS4 version of SDL here:
+ http://www.rcdrummond.net/amiga/index.html
+
+And a MorphOS version here:
+ http://www.lehtoranta.net/powersdl/
+
+--ryan.
+
diff --git a/distrib/sdl-1.2.15/README.BeOS b/distrib/sdl-1.2.15/README.BeOS
new file mode 100644
index 0000000..ccdccf5
--- /dev/null
+++ b/distrib/sdl-1.2.15/README.BeOS
@@ -0,0 +1,13 @@
+
+SDL on BeOS R5
+==============
+
+You can build SDL on BeOS like any other GNU style package.
+e.g. ./configure && make && make install
+By default it is installed in /boot/develop/tools/gnupro/{bin,lib,etc.}
+
+Once you install SDL, you need to copy libSDL.so to /boot/home/config/lib,
+so it can be found by the dynamic linker.
+
+Enjoy!
+ Sam Lantinga (slouken@libsdl.org)
diff --git a/distrib/sdl-1.2.15/README.DC b/distrib/sdl-1.2.15/README.DC
new file mode 100644
index 0000000..e2fb1d6
--- /dev/null
+++ b/distrib/sdl-1.2.15/README.DC
@@ -0,0 +1,32 @@
+SDL for Dreamcast (beta2)
+
+ BERO
+ berobero@users.sourceforge.net
+
+ http://www.geocities.co.jp/Playtown/2004/
+
+this work with kos-newlib
+http://sourceforge.net/projects/dcquake/
+
+compile
+- source environ.sh (from the KOS distribution)
+- make -f Makefile.dc
+
+compile with gl support
+- install latest libgl from http://sourceforge.net/projects/dcquake/
+- uncomment GL=1 in Makefile.dc
+- make -f Makefile.dc clean
+- make -f Makefile.dc
+
+install
+- copy include/*.h and libSDL.a or libSDL_gl.a for your enviroment
+
+changelog:
+
+beta2
+- OpenGL support
+- Hardware page flip support
+
+beta
+- thread, timer don't tested so much.
+- not support OpenGL
diff --git a/distrib/sdl-1.2.15/README.HG b/distrib/sdl-1.2.15/README.HG
new file mode 100644
index 0000000..ecbee0d
--- /dev/null
+++ b/distrib/sdl-1.2.15/README.HG
@@ -0,0 +1,23 @@
+
+The latest development version of SDL is available via Mercurial.
+Mercurial allows you to get up-to-the-minute fixes and enhancements;
+as a developer works on a source tree, you can use "hg" to mirror that
+source tree instead of waiting for an official release. Please look
+at the Mercurial website ( http://mercurial.selenic.com/ ) for more
+information on using hg, where you can also download software for
+Mac OS X, Windows, and Unix systems.
+
+ hg clone -u SDL-1.2 http://hg.libsdl.org/SDL
+
+If you are building SDL with an IDE, you will need to copy the file
+include/SDL_config.h.default to include/SDL_config.h before building.
+
+If you are building SDL via configure, you will need to run autogen.sh
+before running configure.
+
+There is a web interface to the subversion repository at:
+ http://hg.libsdl.org/SDL/
+
+There is an RSS feed available at that URL, for those that want to
+track commits in real time.
+
diff --git a/distrib/sdl-1.2.15/README.MacOS b/distrib/sdl-1.2.15/README.MacOS
new file mode 100644
index 0000000..acfd935
--- /dev/null
+++ b/distrib/sdl-1.2.15/README.MacOS
@@ -0,0 +1,63 @@
+
+==============================================================================
+Using the Simple DirectMedia Layer with MacOS 7,8,9 on PPC
+==============================================================================
+
+These instructions are for people using the Apple MPW environment:
+http://developer.apple.com/tools/mpw-tools/
+
+CodeWarrior projects are available in the CWprojects directory.
+
+==============================================================================
+I. Building the Simple DirectMedia Layer libraries:
+ (This step isn't necessary if you have the SDL binary distribution)
+
+ First, unpack the MPWmake.sea.hqx archive and move SDL.make into the
+ SDL directory.
+
+ Start MPW
+
+ Set the current directory within MPW to the SDL toplevel directory.
+
+ Build "SDL" (Type Command-B and enter "SDL" in the dialog)
+
+ If everything compiles successfully, you now have the PPC libraries
+ "SDL" and "SDLmain.o" in the 'lib' subdirectory.
+
+==============================================================================
+II. Building the Simple DirectMedia Layer test programs:
+
+ First, unpack the MPWmake.sea.hqx archive, move the new rsrc directory to
+ the main SDL directory, and move the makefiles in the new test subdirectory
+ to the SDL 'test' subdirectory.
+
+ Start MPW
+
+ Set the current directory within MPW to the SDL 'test' subdirectory.
+
+ Build the programs that have an associated MPW makefile (file ending
+ with .make), including "testwin", "testalpha", and "graywin".
+
+ Copy the SDL library file into the test directory, and run!
+
+==============================================================================
+III. Building the Simple DirectMedia Layer demo programs:
+
+ Copy one of the test program Makefiles to the demo directory
+ and modify it to match the sources in the demo.
+
+==============================================================================
+IV. Enjoy! :)
+
+ If you have a project you'd like me to know about, or want to ask questions,
+ go ahead and join the SDL developer's mailing list by sending e-mail to:
+
+ sdl-request@libsdl.org
+
+ and put "subscribe" into the subject of the message. Or alternatively you
+ can use the web interface:
+
+ http://www.libsdl.org/mailman/listinfo/sdl
+
+==============================================================================
+
diff --git a/distrib/sdl-1.2.15/README.MacOSX b/distrib/sdl-1.2.15/README.MacOSX
new file mode 100644
index 0000000..2ea9f68
--- /dev/null
+++ b/distrib/sdl-1.2.15/README.MacOSX
@@ -0,0 +1,179 @@
+==============================================================================
+Using the Simple DirectMedia Layer with Mac OS X
+==============================================================================
+
+These instructions are for people using Apple's Mac OS X (pronounced
+"ten").
+
+From the developer's point of view, OS X is a sort of hybrid Mac and
+Unix system, and you have the option of using either traditional
+command line tools or Apple's IDE Xcode.
+
+To build SDL using the command line, use the standard configure and make
+process:
+
+ ./configure
+ make
+ sudo make install
+
+You can also build SDL as a Universal library (a single binary for both
+PowerPC and Intel architectures), on Mac OS X 10.4 and newer, by using
+the fatbuild.sh script in build-scripts:
+ sh build-scripts/fatbuild.sh
+ sudo build-scripts/fatbuild.sh install
+This script builds SDL with 10.2 ABI compatibility on PowerPC and 10.4
+ABI compatibility on Intel architectures. For best compatibility you
+should compile your application the same way. A script which wraps
+gcc to make this easy is provided in test/gcc-fat.sh
+
+To use the library once it's built, you essential have two possibilities:
+use the traditional autoconf/automake/make method, or use Xcode.
+
+==============================================================================
+Using the Simple DirectMedia Layer with a traditional Makefile
+==============================================================================
+
+An existing autoconf/automake build system for your SDL app has good chances
+to work almost unchanged on OS X. However, to produce a "real" Mac OS X binary
+that you can distribute to users, you need to put the generated binary into a
+so called "bundle", which basically is a fancy folder with a name like
+"MyCoolGame.app".
+
+To get this build automatically, add something like the following rule to
+your Makefile.am:
+
+bundle_contents = APP_NAME.app/Contents
+APP_NAME_bundle: EXE_NAME
+ mkdir -p $(bundle_contents)/MacOS
+ mkdir -p $(bundle_contents)/Resources
+ echo "APPL????" > $(bundle_contents)/PkgInfo
+ $(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/
+
+You should replace EXE_NAME with the name of the executable. APP_NAME is what
+will be visible to the user in the Finder. Usually it will be the same
+as EXE_NAME but capitalized. E.g. if EXE_NAME is "testgame" then APP_NAME
+usually is "TestGame". You might also want to use @PACKAGE@ to use the package
+name as specified in your configure.in file.
+
+If your project builds more than one application, you will have to do a bit
+more. For each of your target applications, you need a seperate rule.
+
+If you want the created bundles to be installed, you may want to add this
+rule to your Makefile.am:
+
+install-exec-hook: APP_NAME_bundle
+ rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app
+ mkdir -p $(DESTDIR)$(prefix)/Applications/
+ cp -r $< /$(DESTDIR)$(prefix)Applications/
+
+This rule takes the Bundle created by the rule from step 3 and installs them
+into $(DESTDIR)$(prefix)/Applications/.
+
+Again, if you want to install multiple applications, you will have to augment
+the make rule accordingly.
+
+
+But beware! That is only part of the story! With the above, you end up with
+a bare bone .app bundle, which is double clickable from the Finder. But
+there are some more things you should do before shipping yor product...
+
+1) The bundle right now probably is dynamically linked against SDL. That
+ means that when you copy it to another computer, *it will not run*,
+ unless you also install SDL on that other computer. A good solution
+ for this dilemma is to static link against SDL. On OS X, you can
+ achieve that by linkinag against the libraries listed by
+ sdl-config --static-libs
+ instead of those listed by
+ sdl-config --libs
+ Depending on how exactly SDL is integrated into your build systems, the
+ way to achieve that varies, so I won't describe it here in detail
+2) Add an 'Info.plist' to your application. That is a special XML file which
+ contains some meta-information about your application (like some copyright
+ information, the version of your app, the name of an optional icon file,
+ and other things). Part of that information is displayed by the Finder
+ when you click on the .app, or if you look at the "Get Info" window.
+ More information about Info.plist files can be found on Apple's homepage.
+
+
+As a final remark, let me add that I use some of the techniques (and some
+variations of them) in Exult and ScummVM; both are available in source on
+the net, so feel free to take a peek at them for inspiration!
+
+
+==============================================================================
+Using the Simple DirectMedia Layer with Xcode
+==============================================================================
+
+These instructions are for using Apple's Xcode IDE to build SDL applications.
+
+- First steps
+
+The Xcode project files are in the "Xcode" directory.
+
+- Building the Framework
+
+The SDL Library is packaged as a framework bundle, an organized
+relocatable folder heirarchy of executible code, interface headers,
+and additional resources. For practical purposes, you can think of a
+framework as a more user and system-friendly shared library, whose library
+file behaves more or less like a standard UNIX shared library.
+
+To build the framework, simply open the framework project and build it.
+By default, the framework bundle "SDL.framework" is installed in
+/Library/Frameworks. Therefore, the testers and project stationary expect
+it to be located there. However, it will function the same in any of the
+following locations:
+
+ ~/Library/Frameworks
+ /Local/Library/Frameworks
+ /System/Library/Frameworks
+
+- Build Options
+ There are two "Build Styles" (See the "Targets" tab) for SDL.
+ "Deployment" should be used if you aren't tweaking the SDL library.
+ "Development" should be used to debug SDL apps or the library itself.
+
+- Building the Testers
+ Open the SDLTest project and build away!
+
+- Using the Project Stationary
+ Copy the stationary to the indicated folders to access it from
+ the "New Project" and "Add target" menus. What could be easier?
+
+- Setting up a new project by hand
+ Some of you won't want to use the Stationary so I'll give some tips:
+ * Create a new "Cocoa Application"
+ * Add src/main/macosx/SDLMain.m , .h and .nib to your project
+ * Remove "main.c" from your project
+ * Remove "MainMenu.nib" from your project
+ * Add "$(HOME)/Library/Frameworks/SDL.framework/Headers" to include path
+ * Add "$(HOME)/Library/Frameworks" to the frameworks search path
+ * Add "-framework SDL -framework Foundation -framework AppKit" to "OTHER_LDFLAGS"
+ * Set the "Main Nib File" under "Application Settings" to "SDLMain.nib"
+ * Add your files
+ * Clean and build
+
+- Building from command line
+ Use pbxbuild in the same directory as your .pbproj file
+
+- Running your app
+ You can send command line args to your app by either invoking it from
+ the command line (in *.app/Contents/MacOS) or by entering them in the
+ "Executibles" panel of the target settings.
+
+- Implementation Notes
+ Some things that may be of interest about how it all works...
+ * Working directory
+ As defined in the SDL_main.m file, the working directory of your SDL app
+ is by default set to its parent. You may wish to change this to better
+ suit your needs.
+ * You have a Cocoa App!
+ Your SDL app is essentially a Cocoa application. When your app
+ starts up and the libraries finish loading, a Cocoa procedure is called,
+ which sets up the working directory and calls your main() method.
+ You are free to modify your Cocoa app with generally no consequence
+ to SDL. You cannot, however, easily change the SDL window itself.
+ Functionality may be added in the future to help this.
+
+
+Known bugs are listed in the file "BUGS"
diff --git a/distrib/sdl-1.2.15/README.MiNT b/distrib/sdl-1.2.15/README.MiNT
new file mode 100644
index 0000000..eabe3eb
--- /dev/null
+++ b/distrib/sdl-1.2.15/README.MiNT
@@ -0,0 +1,250 @@
+==============================================================================
+Using the Simple DirectMedia Layer on Atari
+==============================================================================
+
+
+ If you want to build SDL from sources to create SDL programs on Atari:
+ see sections I - II.
+
+ If you want to create SDL programs on Atari using SDL binary build,
+ download it from my web site (URL at end of this file).
+
+ If you want to configure a program using SDL on Atari,
+ see sections IV - VI.
+
+
+==============================================================================
+I. Building the Simple DirectMedia Layer libraries:
+ (This step isn't necessary if you have the SDL binary distribution)
+
+ Do the classic configure, with --disable-shared --enable-static and:
+
+ Tos version (should run everywhere):
+ --disable-threads
+ Tos does not support threads.
+
+ MiNT version (maybe Magic, only for multitasking OS):
+ --disable-pthreads --enable-pth
+ Mint and Magic may supports threads, so audio can be used with current
+ devices, like Sun audio, or disk-writing support. Like Tos, interrupt
+ audio without threads is more suited for Atari machines.
+
+ Then you can make ; make install it.
+
+==============================================================================
+II. Building the Simple DirectMedia Layer test programs:
+
+ Do the classic configure, then make.
+
+ Run them !
+
+==============================================================================
+III. Enjoy! :)
+
+ If you have a project you'd like me to know about, or want to ask questions,
+ go ahead and join the SDL developer's mailing list by sending e-mail to:
+
+ sdl-request@libsdl.org
+
+ and put "subscribe" into the subject of the message. Or alternatively you
+ can use the web interface:
+
+ http://www.libsdl.org/mailman/listinfo/sdl
+
+==============================================================================
+IV. What is supported:
+
+Keyboard (GEMDOS, BIOS, GEM, Ikbd)
+Mouse (XBIOS, GEM, Ikbd, /dev/mouse (non working atm, disabled))
+Video (XBIOS (Fullscreen), GEM (Windowed and Fullscreen))
+Timer (VBL vector, GNU pth library)
+Joysticks and joypads (Ikbd, Hardware)
+Audio (Hardware, XBIOS, GSXB, MCSN, STFA, /dev/audio if threads enabled)
+Threads (Multitasking OS only via GNU pth library)
+Shared object loader (using LDG library from http://ldg.atari.org/)
+Audio CD (MetaDOS)
+OpenGL (using Mesa offscreen rendering driver)
+
+- Dependent driver combinations:
+Video Kbd Mouse Timer Joysticks
+xbios ikbd ikbd vbl(2) ikbd
+xbios gemdos xbios vbl(2) xbios
+xbios bios xbios vbl(2) xbios
+gem gem gem(1) vbl(2) xbios
+
+Audio O/S Misc
+dma8 All Uses MFP Timer A interrupt
+xbios TOS Uses MFP Timer A interrupt
+xbios MiNT Uses MFP Timer A interrupt
+xbios Magic Uses MFP Timer A interrupt
+stfa All Uses MFP interrupt
+mcsn TOS Uses MFP Timer A interrupt
+mcsn MiNT Uses MiNT thread
+mcsn Magic Disabled
+gsxb All Uses GSXB callback
+
+Joypad driver always uses hardware access.
+OpenGL driver always uses OSMesa.
+
+(1) GEM does not report relative mouse motion, so xbios mouse driver is used
+to report this type event.
+A preliminary driver for /dev/mouse device driver is present, but is disabled
+till it can be used with other applications simultaneously.
+
+(2) If you build SDL with threads using the GNU pth library, timers are
+supported via the pth library.
+
+==============================================================================
+V. Environment variables:
+
+SDL_VIDEODRIVER:
+ Set to 'xbios' to force xbios video driver
+ Set to 'gem' to force gem video driver
+
+SDL_VIDEO_GL_DRIVER:
+ Set to filename to load as OpenGL library, if you use SDL_GL_LoadLibrary()
+
+SDL_AUDIODRIVER:
+ Set to 'mint_gsxb' to force Atari GSXB audio driver
+ Set to 'mint_mcsn' to force Atari MCSN audio driver
+ Set to 'mint_stfa' to force Atari STFA audio driver
+ Set to 'mint_xbios' to force Atari Xbios audio driver
+ Set to 'mint_dma8' to force Atari 8 bits DMA audio driver
+ Set to 'audio' to force Sun /dev/audio audio driver
+ Set to 'disk' to force disk-writing audio driver
+
+SDL_ATARI_EVENTSDRIVER
+ Set to 'ikbd' to force IKBD 6301 keyboard driver
+ Set to 'gemdos' to force gemdos keyboard driver
+ Set to 'bios' to force bios keyboard driver
+
+SDL_JOYSTICK_ATARI:
+ Use any of these strings in the environment variable to enable or
+ disable a joystick:
+
+ 'ikbd-joy1-[on|off]' for IKBD joystick on port 1 (hardware access)
+ 'xbios-joy1-[on|off]' for IKBD joystick on port 1 (xbios access)
+ 'porta-pad-[on|off]' for joypad and/or teamtap on port A
+ 'porta-joy0-[on|off]' for joystick 0 on port A
+ 'porta-joy1-[on|off]' for joystick 1 on port A
+ 'porta-lp-[on|off]' for lightpen on port A
+ 'porta-anpad-[on|off]' for analog paddle on port A
+ 'portb-pad-[on|off]' for joypad and/or teamtap on port B
+ 'portb-joy0-[on|off]' for joystick 0 on port B
+ 'portb-joy1-[on|off]' for joystick 1 on port B
+ 'portb-anpad-[on|off]' for analog paddle on port B
+
+ Default configuration is:
+ 'ikbd-joy1-on' (if IKBD events driver enabled)
+ 'xbios-joy1-on' (if gemdos/bios/gem events driver enabled)
+ 'porta-pad-on portb-pad-on' (if available on the machine)
+
+ port[a|b]-[pad|joy?|lp|anpad]-* strings are mutually exclusives.
+ On such a port, you can only use a joypad OR 1 or 2 joysticks OR
+ a lightpen OR an analog paddle. You must disable joypad before
+ setting another controller.
+
+ The second joystick port on IKBD is used by the mouse, so not usable.
+ Another problem with the IKBD: mouse buttons and joystick fire buttons
+ are wired together at the hardware level, it means:
+ port 0 port 0 port 1
+ mouse left button = joystick fire 0 = joystick fire 1
+ mouse right button = joystick fire 1 = joystick fire 0
+
+ Descriptions of joysticks/joypads:
+ - Joypads: 1 hat, 17 buttons (Atari Jaguar console-like).
+ - Joysticks: 1 hat, 1 button.
+ - Lightpen, analog paddles: 2 axis, 2 buttons. The 2 buttons are those
+ affected to 1 button joysticks on the same port.
+
+==============================================================================
+VI. More informations about drivers:
+
+OpenGL:
+ The default is to use the Mesa offscreen driver (osmesa.ldg). If you want
+ to use an older OpenGL implementation, like mesa_gl.ldg or tiny_gl.ldg,
+ your program must use SDL_GL_LoadLibrary() to do so, and retrieve the
+ needed function pointers with SDL_LoadFunction(). In all cases, the OpenGL
+ context is taken care of by SDL itself, you just have to use gl* functions.
+
+ However, there is one OpenGL call that has a different prototype in the old
+ implementations: glOrtho(). In the old implementations, it has 6 float as
+ parameters, in the standard one, it has 6 double parameters. If you want
+ to compile testdyngl, or any other SDL program that loads its OpenGL
+ library, you must change the glOrtho() prototype used in this program. In
+ osmesa.ldg, you can retrieve a glOrtho() with double parameters, by
+ searching for the function "glOrtho6d".
+
+Xbios video:
+ Video chip is detected using the _VDO cookie.
+ Screen enhancers are not supported, but could be if you know how to
+ use them.
+
+ ST, STE, Mega ST, Mega STE:
+ 320x200x4 bits, shades of grey, available only for the purpose
+ of testing SDL.
+ TT:
+ 320x480x8 and 320x240x8 (software double-lined mode).
+ Falcon:
+ All modes supported by the current monitor (RVB or VGA).
+ BlowUp and Centscreen extended modes, ScreenBlaster 3 current mode.
+ Milan:
+ Experimental support
+ Clones and any machine with monochrome monitor:
+ Not supported.
+
+Gem video:
+ Automatically used if xbios not available.
+
+ All machines:
+ Only the current resolution, if 8 bits or higher depth.
+
+IKBD keyboard, mouse and joystick driver:
+ Available if _MCH cookie is ST, Mega ST, STE, Mega STE, TT or Falcon.
+
+ Hades has an IKBD, but xbios is not available for video, so IKBD
+ driver is disabled.
+
+Gemdos and bios keyboard driver:
+ Available on all machines.
+
+Mouse and joystick xbios driver:
+ Available on all machines (I think).
+
+Joypad driver:
+ Available if _MCH cookie is STE or Falcon. Supports teamtap.
+
+PTH timer driver:
+ Available with multitasking OS.
+
+VBL timer driver:
+ Available on all machines (I think).
+
+Audio drivers:
+ Cookies _SND, MCSN, STFA and GSXB used to detect supported audio
+ capabilities.
+
+ STE, Mega STE, TT:
+ 8 bits DMA (hardware access)
+ STFA, MCSN or GSXB driver if installed
+ Falcon:
+ 8 bits DMA (hardware access)
+ Xbios functions
+ STFA, MCSN or GSXB driver if installed
+ Other machines:
+ STFA, MCSN or GSXB driver if installed
+
+ STFA driver:
+ http://removers.free.fr/softs/stfa.html
+ GSXB driver:
+ http://assemsoft.atari.org/gsxb/
+ MacSound driver:
+ http://jf.omnis.ch/software/tos/
+ MagicSound driver (MCSN,GSXB compatible):
+ http://perso.wanadoo.fr/didierm/
+ X-Sound driver (GSXB compatible):
+ http://www.uni-ulm.de/~s_thuth/atari/xsound_e.html
+
+--
+Patrice Mandin <patmandin@gmail.com>
+http://pmandin.atari.org/
diff --git a/distrib/sdl-1.2.15/README.NDS b/distrib/sdl-1.2.15/README.NDS
new file mode 100644
index 0000000..e96a9ee
--- /dev/null
+++ b/distrib/sdl-1.2.15/README.NDS
@@ -0,0 +1,22 @@
+The SDL port to the Nintendo DS
+
+This port uses the devKitPro toolchain, available from:
+http://www.devkitpro.org
+
+Precompiled tools for cross-compiling on Linux are available from:
+http://www.libsdl.org/extras/nds/devkitPro-20070503-linux.tar.gz
+
+todo:
+add ds console specific features/optimizations
+mouse/keyboard support
+dual screen support
+
+build with:
+cp include/SDL_config_nds.h include/SDL_config.h
+make -f Makefile.ds
+
+included is an arm9/arm7 template to allow for sound streaming support.
+
+Enjoy, fix the source and share :)
+Troy Davis(GPF)
+http://gpf.dcemu.co.uk/
diff --git a/distrib/sdl-1.2.15/README.NanoX b/distrib/sdl-1.2.15/README.NanoX
new file mode 100644
index 0000000..8418ff3
--- /dev/null
+++ b/distrib/sdl-1.2.15/README.NanoX
@@ -0,0 +1,97 @@
+ =================================================================
+ Patch version 0.9 of SDL(Simple DirectMedia Layer) for Nano-X API
+ =================================================================
+
+ Authors: Hsieh-Fu Tsai, clare@setabox.com
+ Greg Haerr, greg@censoft.com
+
+ This patch is against SDL version 1.2.4.
+ It enhances previous patch 0.8 by providing direct framebuffer
+ access as well as dynamic hardware pixel type support, not
+ requiring a compile-time option setting for different framebuffer
+ modes.
+ Tested against Microwindows version 0.89pre9.
+
+ Older Microwindows versions
+ ===========================
+ If running on a version older than Microwindows 0.89pre9,
+ the following items might need to be patched in Microwindows.
+
+ 1. Patch src/nanox/client.c::GrClose()
+ It fixes the client side GrClose(). In the original version,
+ GrOpen() can only be called once. When the GrOpen() is called at
+ the second time, the program will terminate. In order to prevent
+ this situation, we need to insert "nxSocket = -1" after
+ "close(nxSocket)" in GrClose(). If you do not have this problem,
+ you may skip this step.
+
+ 2. Patch src/nanox/clientfb.c to return absolute x,y coordinates
+ when using GrGetWindowFBInfo(). Copy the version 0.89pre9
+ of src/nanox/clientfb.c to your system, or configure
+ using --disable-nanox-direct-fb.
+
+ =============
+ Quick Install
+ =============
+
+ 1. ./configure --disable-video-x11 --disable-video-fbcon \
+ --enable-video-nanox \
+ --with-nanox-pixel-type=[rgb/0888/888/565/555/332/pal]
+ 2. make clean
+ 3. make
+ 4. make install (as root)
+
+ ============
+ Nitty-gritty
+ ============
+
+ --enable-nanox-direct-fb Use direct framebuffer access
+ --enable-nanox-debug Show debug messages
+ --enable-nanox-share-memory Use shared-memory to speed up
+
+ When running multi-threaded applications using SDL, such
+ as SMPEG, set THREADSAFE=Y in Microwindows' config file,
+ to enable GrXXX() system call critical section support.
+
+ =============================================
+ Some programs can be used to test this patch.
+ =============================================
+
+ 1. http://www.cs.berkeley.edu/~weimer/atris (a tetris-like game)
+ 2. http://www.libsdl.org/projects/newvox/
+ 3. http://www.libsdl.org/projects/xflame/
+ 4. http://www.libsdl.org/projects/optimum/
+ 5. http://www.gnugeneration.com/software/loop/
+ 6: http://www.lokigames.com/development/smpeg.php3 (SMPEG version 0.4.4)
+
+ =========
+ Todo List
+ =========
+
+ 1. Create hardware surface
+ 2. Create YUVOverlay on hardware
+ 3. Use OpenGL
+ 4. Gamma correction
+ 5. Hide/Change mouse pointer
+ 6. Better window movement control with direct fb access
+ 7. Palette handling in 8bpp could be improved
+
+ =====================
+ Supporting Institutes
+ =====================
+
+ Many thanks to go to Setabox Co., Ltd. and CML (Communication and
+ Multimedia Laboratory, http://www.cmlab.csie.ntu.edu.tw/) in the
+ Department of Computer Science and Information Engineering of
+ National Taiwan University for supporting this porting project.
+
+ Century Embedded Technologies (http://embedded.censoft.com)
+ for this patch.
+
+ ===================
+ Contact Information
+ ===================
+
+ Welcome to give me any suggestion and to report bugs.
+ My e-mail address : clare@setabox.com or niky@cmlab.csie.ntu.edu.tw
+ or greg@censoft.com
diff --git a/distrib/sdl-1.2.15/README.OS2 b/distrib/sdl-1.2.15/README.OS2
new file mode 100644
index 0000000..424b373
--- /dev/null
+++ b/distrib/sdl-1.2.15/README.OS2
@@ -0,0 +1,281 @@
+
+===========
+SDL on OS/2
+===========
+
+Last updated on May. 17, 2006.
+
+
+1. How to compile?
+------------------
+
+To compile this, you'll need the followings installed:
+- The OS/2 Developer's Toolkit
+- The OpenWatcom compiler
+ (http://www.openwatcom.org)
+
+First of all, you have to unzip the Watcom-OS2.zip file. This will result in a
+file called "makefile" and a file called "setvars.cmd" in this folder (and some
+more files...).
+
+Please edit the second, fourth and fifth lines of setvars.cmd file
+to set the folders where the toolkit, the OW compiler and the FSLib are.
+You won't need NASM yet (The Netwide Assembler), you can leave that line.
+Run setvars.cmd, and you should get a shell in which you can
+compile SDL.
+
+Check the "makefile" file. There is a line in there which determines if the
+resulting SDL.DLL will be a 'debug' or a 'release' build. The 'debug' version
+is full of printf()'s, so if something goes wrong, its output can help a lot
+for debugging.
+
+Then run "wmake".
+This should create the SDL12.DLL and the corresponding SDL12.LIB file here.
+
+To test applications, it's a good idea to use the 'debug' build of SDL, and
+redirect the standard output and standard error output to files, to see what
+happens internally in SDL.
+(like: testsprite >stdout.txt 2>stderr.txt)
+
+To rebuild SDL, use the following commands in this folder:
+wmake clean
+wmake
+
+
+
+2. How to compile the testapps?
+-------------------------------
+
+Once you have SDL12.DLL compiled, navigate into the 'test' folder, copy in
+there the newly built SDL12.DLL, and copy in there FSLib.DLL.
+
+Then run "wmake" in there to compile some of the testapps.
+
+
+
+3. What is missing?
+-------------------
+
+The following things are missing from this SDL implementation:
+- MMX, SSE and 3DNOW! optimized video blitters?
+- HW Video surfaces
+- OpenGL support
+
+
+
+4. Special Keys / Full-Screen support
+-------------------------------------
+
+There are two special hot-keys implemented:
+- Alt+Home switches between fullscreen and windowed mode
+- Alt+End simulates closing the window (can be used as a Panic key)
+Only the LEFT Alt key will work.
+
+
+
+5. Joysticks on SDL/2
+---------------------
+
+The Joystick detection only works for standard joysticks (2 buttons, 2 axes
+and the like). Therefore, if you use a non-standard joystick, you should
+specify its features in the SDL_OS2_JOYSTICK environment variable in a batch
+file or CONFIG.SYS, so SDL applications can provide full capability to your
+device. The syntax is:
+
+SET SDL_OS2_JOYSTICK=[JOYSTICK_NAME] [AXES] [BUTTONS] [HATS] [BALLS]
+
+So, it you have a Gravis GamePad with 4 axes, 2 buttons, 2 hats and 0 balls,
+the line should be:
+
+SET SDL_OS2_JOYSTICK=Gravis_GamePad 4 2 2 0
+
+If you want to add spaces in your joystick name, just surround it with
+quotes or double-quotes:
+
+SET SDL_OS2_JOYSTICK='Gravis GamePad' 4 2 2 0
+
+or
+
+SET SDL_OS2_JOYSTICK="Gravis GamePad" 4 2 2 0
+
+ Notive However that Balls and Hats are not supported under OS/2, and the
+value will be ignored... but it is wise to define these correctly because
+in the future those can be supported.
+ Also the number of buttons is limited to 2 when using two joysticks,
+4 when using one joystick with 4 axes, 6 when using a joystick with 3 axes
+and 8 when using a joystick with 2 axes. Notice however these are limitations
+of the Joystick Port hardware, not OS/2.
+
+
+
+6. Proportional windows
+-----------------------
+
+For some SDL applications it can be handy to have proportional windows, so
+the windows will keep their aspect ratio when resized.
+This can be achieved in two ways:
+
+- Before starting the given SDL application, set the
+ SDL_USE_PROPORTIONAL_WINDOW environment variable to something, e.g.:
+
+ SET SDL_USE_PROPORTIONAL_WINDOW=1
+ dosbox.exe
+
+- If you have a HOME environment variable set, then SDL will look for a file
+ in there called ".sdl.proportionals". If that file contains the name of the
+ currently running SDL executable, then that process will have proportional
+ windows automatically.
+
+ Please note that this file is created automatically with default values
+ at the first run.
+
+
+
+7. Audio in SDL applications
+----------------------------
+
+Audio effects are one of the most important features in games. Creating audio
+effects in sync with the game and without hickups and pauses in the audio are
+very important things.
+
+However there are multithreaded SDL applications that have tight loops as their
+main logic loop. This kills performance in OS/2, and takes too much CPU from
+other threads in the same process, for example from the thread to create the
+sound effects.
+
+For this reason, the OS/2 port of SDL can be instructed to run the audio thread
+in high priority, which makes sure that there will be enough time for the
+processing of the audio data.
+
+At default, SDL/2 runs the audio thread at ForegroundServer+0 priority. Well
+written and well behaving SDL applications should work well in this mode.
+For other applications, you can tell SDL/2 to run the audio thread at
+TimeCritical priority by setting an env.variable before starting the SDL app:
+
+ SET SDL_USE_TIMECRITICAL_AUDIO=1
+
+Please note that this is a bit risky, because if the SDL application runs a
+tight infinite loop in this thread, this will make the whole system
+unresponsive, so use it with care, and only for applications that need it!
+
+
+
+8. Next steps...
+----------------
+
+Things to do:
+- Implement missing stuffs (look for 'TODO' string in source code!)
+- Finish video driver (the 'wincommon' can be a good example for missing
+ things like application icon and so on...)
+- Enable MMX/SSE/SSE2 acceleration functions
+- Rewrite CDROM support using DOS Ioctl for better support.
+
+
+
+9. Contacts
+-----------
+
+ You can contact the developers for bugs:
+
+ Area Developer email
+ General (Audio/Video/System) Doodle doodle@scenergy.dfmk.hu
+ CDROM and Joystick Caetano daniel@caetano.eng.br
+
+ Notice however that SDL/2 is 'in development' stage so ... if you want to help,
+please, be our guest and contact us!
+
+
+
+10. Changelog of the OS/2 port
+------------------------------
+
+Version 1.2.10 - 2006-05-17 - Doodle
+ - Small modifications for v1.2.10 release
+ - Changed DLL name to include version info (currently SDL12.dll)
+
+Version 1.2 - 2006-05-01 - Doodle
+ - Modified makefile system to have only one makefile
+ - Included FSLib headers, DLL and LIB file
+
+Version 1.2 - 2006-02-26 - Doodle
+ - Updated the official SDL version with the OS/2 specific changes.
+ - Added support for real unicode keycode conversion.
+
+Version 1.2.7 - 2006-01-20 - Doodle
+ - Added support for selectively using timecritical priority for
+ audio threads by SDL_USE_TIMECRITICAL_AUDIO environment variable.
+ (e.g.:
+ SET SDL_USE_TIMECRITICAL_AUDIO=1
+ dosbox.exe
+ )
+
+Version 1.2.7 - 2005-12-22 - Doodle
+ - Added support for proportional SDL windows.
+ There are two ways to have proportional (aspect-keeping) windows for
+ a given SDL application: Either set the SDL_USE_PROPORTIONAL_WINDOW
+ environment variable to something before starting the application
+ (e.g.:
+ SET SDL_USE_PROPORTIONAL_WINDOW=1
+ dosbox.exe
+ )
+ or, if you have the HOME environment variable set, then SDL12.DLL will
+ create a file in that directory called .sdl.proportionals, and you can
+ put there the name of executable files that will be automatically made
+ proportional.
+
+Version 1.2.7 - 2005-10-14 - Doodle
+ - Enabled Exception handler code in FSLib to be able to restore original
+ desktop video mode in case the application crashes.
+ - Added the missing FSLib_Uninitialize() call into SDL.
+ (The lack of it did not cause problems, but it's cleaner this way.)
+ - Fixed a mouse problem in Fullscreen mode where any mouse click
+ re-centered the mouse.
+
+Version 1.2.7 - 2005-10-09 - Doodle
+ - Implemented window icon support
+
+Version 1.2.7 - 2005-10-03 - Doodle
+ - Reworked semaphore support again
+ - Tuned thread priorities
+
+Version 1.2.7 - 2005-10-02 - Doodle
+ - Added support for custom mouse pointers
+ - Fixed WM_CLOSE processing: give a chance to SDL app to ask user...
+ - Added support for MMX-accelerated audio mixers
+ - Other small fixes
+
+Version 1.2.7 - 2005-09-12 - Doodle
+ - Small fixes for DosBox incorporated into public release
+ - Fixed semaphore support (SDL_syssem.c)
+ - Fixed FSLib to have good clipping in scaled window mode,
+ and to prevent occasional desktop freezes.
+
+Version 1.2.7 - 2004-09-08a - Caetano
+ - Improved joystick support (general verifications about hardware).
+ - Added support up to 8 buttons in 2 axes joysticks and 6 buttons in 3 axes joysticks.
+ - Added support to environment variable SDL_OS2_JOYSTICK to specify a joystick.
+ - Improved Joystick test to handle every type of joystick and display only relevant information.
+ - Merged with Doodle 2004-09-08
+ - Little tid up in README.OS2
+ - Added explanation about SDL_OS2_JOYSTICK environment variable on README.OS2
+
+Version 1.2.7 - 2004-09-07 - Caetano
+ - Merged with changes in headers for GCC compiling.
+ - Added Joystick support using basic IBM GAME$ support, allowing it to work with all joystick drivers since OS/2 2.1.
+ - Improved joystick detection (hacked!). OS/2 do not allow real joystick detection, so...
+ - Modified makefile in test to compile "testjoystick". Anyway, it's useless, since it seems to cause a lot of trouble in OS/2 (because os video routines, not Joystick support).
+ - Created separated Joystick test program to test only joystick functions.
+ - Improved joystick auto-centering.
+ - Improved the coordinate correction routine to use two scale factors for each axis.
+
+Version 1.2.7 - 2004-07-05 - Caetano
+ - Corrected the time returned by status in CDROM support (it was incorrect)
+ - Added the testcdrom.c and corrected the linking directive (it was causing an error)
+
+Version 1.2.7 - 2004-07-02a - Caetano
+ - Corrected a little problem in a comment at SDL-1.2.7\test\torturethread.c, line 18 (missing */, nested comment)
+ - Added CDROM support to tree (SDL-1.2.7\src\cdrom\os2\SDL_syscdrom.c)
+ - Modified makefile (SDL-1.2.7\src\makefiles.wat and SDL-1.2.7\watcom.mif) to build with CDROM support
+ - Added the "extra" SDL_types.h forgotten in 2004-07-02 version.
+
+<End-Of-File>
diff --git a/distrib/sdl-1.2.15/README.PS3 b/distrib/sdl-1.2.15/README.PS3
new file mode 100644
index 0000000..c66467d
--- /dev/null
+++ b/distrib/sdl-1.2.15/README.PS3
@@ -0,0 +1,29 @@
+
+SDL on Sony Playstation3
+------------------------
+
+Installation:
+ First, you have to install the Cell SDK
+ - Download the Cell SDK installer RPM and ISO images to
+ a temporary directory such as /tmp/cellsdk.
+ - Mount the image: mount -o loop CellSDK-Devel-Fedora_3.1.0.0.0.iso /tmp/cellsdk
+ - Install the SDK installer: rpm -ivh cell-install-3.1.0-0.0.noarch.rpm
+ - Install the SDK: cd /opt/cell && ./cellsdk --iso /tmp/cellsdkiso install
+
+ You need to install the SPU-libs before installing SDL
+ - Go to SDL-1.2/src/video/ps3/spulibs/
+ - Run make && make install
+
+ Finally, install SDL
+ - Go to SDL-1.2/ and build SDL like any other GNU style package.
+ e.g.
+ - Build the configure-script with ./autogen.sh
+ - Configure SDL for your needs: ./configure --enable-video-ps3 ...
+ - Build and install it: make && make install
+
+
+Todo:
+ - mouse/keyboard/controller support
+
+Have fun!
+ Dirk Herrendoerfer <d.herrendoerfer [at] de [dot ibm [dot] com>
diff --git a/distrib/sdl-1.2.15/README.PicoGUI b/distrib/sdl-1.2.15/README.PicoGUI
new file mode 100644
index 0000000..cdb6bed
--- /dev/null
+++ b/distrib/sdl-1.2.15/README.PicoGUI
@@ -0,0 +1,50 @@
+ ========================
+ Using SDL with PicoGUI
+ ========================
+
+- Originally contributed by Micah Dowty <micahjd@users.sourceforge.net>
+
+PicoGUI is a scalable GUI system with a unique architecture, primarily focused
+on scalability to various embedded systems. You can find more information
+including a FAQ at http://picogui.org
+
+To use the patch:
+
+ 1. When compiling, add the "--enable-video-picogui" switch to ./configure
+
+ 2. When running your program, ensure that the picogui driver for SDL
+ is in use by setting the SDL_VIDEODRIVER environment variable
+ to "picogui".
+
+ 3. The program must also be linked to the C client library for PicoGUI
+ (libpgui.so). If the program is being compiled with a patched SDL
+ installed this should be done automatically. If you want to use an
+ existing binary with PicoGUI, you can set the LD_PRELOAD environment
+ variable to the path of your libpgui.so file.
+
+Capabilities:
+
+ So far only basic functionality is provided on true color (linear16/24/32)
+ devices. Accessing a memory mapped bitmap, updating the display, and handling
+ mouse/keyboard input. This functionality has been tested with several
+ applications, including mplayer, Xine, sldroids, and Abuse.
+
+TODO list:
+
+ - YUV overlays will be helpful for watching video on set top boxes or other
+ embedded devices that have some graphics acceleration hardware
+
+ - Account for rotated bitmap storage in pgserver
+
+ - Support for hiding or changing the cursor
+
+ - The display should be centered when the SDL application is smaller
+ than the PicoGUI panel
+
+ - Fullscreen or any other special modes
+
+ - Support for indexed and grayscale modes
+
+ - Probably much more...
+
+--- The End ---
diff --git a/distrib/sdl-1.2.15/README.Porting b/distrib/sdl-1.2.15/README.Porting
new file mode 100644
index 0000000..df61993
--- /dev/null
+++ b/distrib/sdl-1.2.15/README.Porting
@@ -0,0 +1,56 @@
+
+* Porting To A New Platform
+
+ The first thing you have to do when porting to a new platform, is look at
+include/SDL_platform.h and create an entry there for your operating system.
+The standard format is __PLATFORM__, where PLATFORM is the name of the OS.
+Ideally SDL_platform.h will be able to auto-detect the system it's building
+on based on C preprocessor symbols.
+
+There are two basic ways of building SDL at the moment:
+
+1. The "UNIX" way: ./configure; make; make install
+
+ If you have a GNUish system, then you might try this. Edit configure.in,
+ take a look at the large section labelled:
+ "Set up the configuration based on the target platform!"
+ Add a section for your platform, and then re-run autogen.sh and build!
+
+2. Using an IDE:
+
+ If you're using an IDE or other non-configure build system, you'll probably
+ want to create a custom SDL_config.h for your platform. Edit SDL_config.h,
+ add a section for your platform, and create a custom SDL_config_{platform}.h,
+ based on SDL_config.h.minimal and SDL_config.h.in
+
+ Add the top level include directory to the header search path, and then add
+ the following sources to the project:
+ src/*.c
+ src/audio/*.c
+ src/cdrom/*.c
+ src/cpuinfo/*.c
+ src/events/*.c
+ src/file/*.c
+ src/joystick/*.c
+ src/stdlib/*.c
+ src/thread/*.c
+ src/timer/*.c
+ src/video/*.c
+ src/audio/disk/*.c
+ src/video/dummy/*.c
+ src/joystick/dummy/*.c
+ src/cdrom/dummy/*.c
+ src/thread/generic/*.c
+ src/timer/dummy/*.c
+ src/loadso/dummy/*.c
+
+
+Once you have a working library without any drivers, you can go back to each
+of the major subsystems and start implementing drivers for your platform.
+
+If you have any questions, don't hesitate to ask on the SDL mailing list:
+ http://www.libsdl.org/mailing-list.php
+
+Enjoy!
+ Sam Lantinga (slouken@libsdl.org)
+
diff --git a/distrib/sdl-1.2.15/README.QNX b/distrib/sdl-1.2.15/README.QNX
new file mode 100644
index 0000000..995afbe
--- /dev/null
+++ b/distrib/sdl-1.2.15/README.QNX
@@ -0,0 +1,155 @@
+README.QNX by Mike Gorchak <mike@malva.ua>, <lestat@i.com.ua>
+Last changed at 24 Apr 2004.
+
+======================================================================
+Table of Contents:
+
+1. OpenGL.
+2. Wheel and multi-button mouses.
+3. CDROM handling issues.
+4. Hardware video overlays.
+5. Shared library building.
+6. Some building issues.
+7. Environment variables.
+
+======================================================================
+1. OpenGL:
+
+ OpenGL works well and is stable, but fullscreen mode has not been
+heavily tested yet.
+ If you have QNX RtP version 6.1.0 or above you must download the
+Photon3D runtime from http://developers.qnx.com or install it from the
+public repository or from the public CD, available with QNX. OS versi-
+ons below 6.1.0 are not supported.
+ When creating an OpenGL context, software renderer mode is artifi-
+cially selected (QSSL made acceleration only for Voodoo boards in
+fullscreen mode, sorry but I don't have this board to test OpenGL -
+maybe it works or maybe not :)). If you want acceleration - you can
+remove one line in the source code: find the file SDL_ph_image.c and
+remove the following
+
+ OGLAttrib[OGLargc++]=PHOGL_ATTRIB_FORCE_SW;
+
+line in the ph_SetupOpenGLContext() function or change the argument to
+PHOGL_ATTRIB_FORCE_HW or PHOGL_ATTRIB_FAVOR_HW.
+
+======================================================================
+2. Wheel and multi-button mouses:
+
+ Photon emits keyboard events (key up and down) when the mouse
+wheel is moved. The key_scan field appears valid, and it contains zero.
+That is a basic method of detecting mouse wheel events under Photon.
+It looks like a hack, but it works for me :) on various PC configura-
+tions.
+
+I've tested it on:
+
+1. Genius Optical NetScroll/+ PS/2 (1 wheel)
+2. A4Tech Optical GreatEye WheelMouse PS/2, model: WOP-35. (2 wheels
+ + 2 additional buttons). The wheel for vertical scrolling works as
+ usual, but the second wheel for horizontal scrolling emits two se-
+ quential events up or down, so it can provide faster scrolling than
+ the first wheel. Additional buttons don't emit any events, but it
+ looks like they're handled by photon in an unusual way - like click
+ to front, but works not with any window, looks like a fun bug-o-fe-
+ ature :).
+
+======================================================================
+3. CDROM handling issues:
+
+ Access to CDROM can only be provided with 'root' privileges. I
+can't do anything about that, /dev/cd0 has brw------- permissions and
+root:root rights.
+
+======================================================================
+4. Hardware video overlays:
+
+ Overlays can flicker during window movement, resizing, etc. It
+happens because the photon driver updates the real window contents be-
+hind the overlay, then draws the temporary chroma key color over the
+window contents. It can be done without using the chroma key but that
+causes the overlay to always be on top. So flickering during window
+movement is preferred instead.
+ Double buffering code is temporarily disabled in the photon driver
+code, because on my GF2-MX it can accidentally cause a buffer switch,
+which causes the old frame to show. S3 Savage4 has the same problem,
+but ATI Rage 128 doesn't. I think it can be fixed later. Current code
+works very well, so maybe double buffering is not needed right now.
+ Something strange happens when you try to move the window with the
+overlay beyond the left border of the screen. The overlay tries to
+stay at position x=0, but when attempting to move it a bit more it
+jumps to position x=-60 (on GF2-MX, on ATI Rage128 this value a bit
+smaller). It's really strange, looks like the overlay doesn't like
+negative coordinates.
+
+=======================================================================
+5. Shared library building:
+
+ A shared library can be built, but before running the autogen.sh
+script you must manually delete the libtool.m4 stuff from the acinclu-
+de.m4 file (it comes after the ESD detection code up to the end of the
+file), because the libtool stuff in the acinclude.m4 file was very old
+in SDL distribution before the version 1.2.7 and doesn't knew anything
+about QNX. SDL 1.2.7 distribution contains the new libtool.m4 script,
+but anyway it is broken :), Just remove it, then run "libtoolize
+--force --copy", delete the file aclocal.m4 if it is exists and after
+that run the autogen.sh script. SDL 1.2.8 contains fixed libtool.m4,
+ltmain.sh and config.sub files, so you can just run the autogen.sh
+script.
+
+======================================================================
+6. Some building issues:
+
+ Feel free to not use the --disable-shared configure option if you'
+ve read the above comment about 'Shared library building'. Otherwise
+this option is strongly recommended, as without it the sdl-config
+script will be broken.
+
+ Run the configure script without x11 support, e.g.:
+
+ a) for OpenGL support:
+ ./configure --prefix=/usr \
+ --disable-video-x11 \
+ --disable-shared
+
+ b) without OpenGL support:
+ ./configure --prefix=/usr \
+ --disable-video-x11 \
+ --disable-shared \
+ --disable-video-opengl
+
+ And of course dont forget to specify --disable-debug, which is on
+by default, to disable debug and enable the expensive optimizations.
+
+ In the test directory also run the ./configure script without
+x11 support, e.g.:
+
+ ./configure --with-sdl-prefix=/usr \
+ --with-sdl-exec-prefix=/usr \
+ --prefix=/usr --without-x
+
+======================================================================
+7. Environment variables:
+
+ Please note that the photon driver is sensible to the following
+environmental variables:
+
+ * SDL_PHOTON_FULLSCREEN_REFRESH - this environment variable controls
+the refresh rate in all fullscreen modes. Be carefull !!! Photon
+drivers usually do not checking the maximum refresh rate, which video
+adapter or monitor supports.
+
+ * SDL_VIDEO_WINDOW_POS - can be set in the "X,Y" format. If X and Y
+coordinates are bigger than the current desktop resolution, then win-
+dow positioning across virtual consoles is activated. If X and Y are
+smaller than the desktop resolution then window positioning in the
+current console is activated. The word "center" can be used instead of
+coordinates, it produces the same behavior as SDL_VIDEO_CENTERED
+environmental variable.
+
+ * SDL_VIDEO_CENTERED - if this environmental variable exists then the
+window centering is perfomed in the current virtual console.
+
+Notes: The SDL_VIDEO_CENTERED enviromental variable has greater pri-
+ority than the SDL_VIDEO_WINDOW_POS in case if both variables are sup-
+plied to the application.
diff --git a/distrib/sdl-1.2.15/README.Qtopia b/distrib/sdl-1.2.15/README.Qtopia
new file mode 100644
index 0000000..01627d1
--- /dev/null
+++ b/distrib/sdl-1.2.15/README.Qtopia
@@ -0,0 +1,84 @@
+
+==============================================================================
+Using the Simple DirectMedia Layer with Qtopia/OPIE
+==============================================================================
+
+==============================================================================
+I. Setting up the Qtopia development environment.
+
+ This document will not explain how to setup the Qtopia development
+ environment. That is outside the scope of the document. You can read
+ more on this subject in this excellent howto:
+
+ http://www.zauruszone.com/howtos/linux_compiler_setup_howto.html
+
+==============================================================================
+II. Building the Simple DirectMedia Layer libraries using the arm
+ cross-compiler
+
+ This is somewhat tricky since the name of the compiler binaries
+ differ from the standard. Also you should disable features not
+ needed. The command below works for me. Note that it's all one
+ line. You can also set the NM, LD etc environment variables
+ separately.
+
+ NM=arm-linux-nm LD=arm-linux-ld CC=arm-linux-gcc CXX=arm-linux-g++ RANLIB=arm-linux-ranlib AR=arm-linux-ar ./configure --enable-video-qtopia --disable-video-dummy --disable-video-fbcon --disable-video-dga --disable-arts --disable-esd --disable-alsa --disable-cdrom --disable-video-x11 --disable-nasm --prefix=/opt/Qtopia/sharp/ arm-unknown-linux-gnu
+
+ One thing to note is that the above configure will include joystick
+ support, even though you can't have joysticks on the Zaurus. The
+ reason for this is to avoid link / compile / runtime errors with
+ applications that have joystick support.
+
+==============================================================================
+III. Building the Simple DirectMedia Layer test programs:
+
+ After installing, making sure the correct sdl-config is in your
+ path, run configure like this:
+
+ NM=arm-linux-nm LD=arm-linux-ld CC=arm-linux-gcc CXX=arm-linux-g++ AR=arm-linux-ar ./configure arm-unknown-linux-gnu
+
+==============================================================================
+IV. Application porting notes
+
+ One thing I have noticed is that applications sometimes don't exit
+ correctly. Their icon remains in the taskbar and they tend to
+ relaunch themselves automatically. I believe this problem doesn't
+ occur if you exit your application using the exit() method. However,
+ if you end main() with 'return 0;' or so, this seems to happen.
+
+ Also note that when running in landscape mode - i.e requesting a
+ window that is HEIGHT pixels wide and WIDTH pixels high, where WIDTH
+ and HEIGHT normally is 240 and 320 - the image is blitted so that
+ the hardware buttons are on the left side of the display. This might
+ not always be desirable but such is the code today.
+
+
+==============================================================================
+V. Enjoy! :)
+
+ If you have a project you'd like me to know about, or want to ask questions,
+ go ahead and join the SDL developer's mailing list by sending e-mail to:
+
+ sdl-request@libsdl.org
+
+ and put "subscribe" into the subject of the message. Or alternatively you
+ can use the web interface:
+
+ http://www.libsdl.org/mailman/listinfo/sdl
+
+==============================================================================
+VI. What is supported:
+
+Keyboard (Sharp Zaurus)
+Hardware buttons
+Stylus input (mouse)
+Video. Allows fullscreen both in portrait mode (up to WIDTHxHEIGHT
+size window) and in landscape mode (up to HEIGHTxWIDTH).
+
+All other SDL functionality works like a normal Linux system (threads,
+audio etc).
+
+--
+David Hedbor <david@hedbor.org>
+http://david.hedbor.org/ http://eongames.com/
+
diff --git a/distrib/sdl-1.2.15/README.RISCOS b/distrib/sdl-1.2.15/README.RISCOS
new file mode 100644
index 0000000..1ab8598
--- /dev/null
+++ b/distrib/sdl-1.2.15/README.RISCOS
@@ -0,0 +1,130 @@
+Readme for RISC OS port of SDL
+==============================
+
+This document last updated on 2nd Februrary 2006
+
+This is a RISC OS port of the Simple Direct Media Layer (SDL) by Alan Buckley with contributions from Peter Naulls.
+
+Details of the SDL can be found at http://www.libsdl.org.
+
+The source code including the RISC OS version can be obtained from:
+
+http://www.libsdl.org.
+
+Pre built libraries and many games and applications compiled for RISC OS using this library can be downloaded from The Unix Porting Project at http://www.riscos.info/unix/.
+
+This is released under the LGPL see the file COPYING for details.
+
+
+Compiling applications under RISC OS
+====================================
+
+Add -ISDL: for the C compiler flags if you include the files in the SDL directory. e.g. #include "SDL/SDL.h"
+Add -ISDL:SDL for the C compiler flags if you include the files directly. e.g. #include "SDL/SDL.h"
+
+Add -LSDL: -lSDL to the link stage of compilation.
+
+For example, to compile the testbitmap.c sample you could use:
+
+gcc -ISDL:SDL -LSDL: -lSDL testbitmap.c -otestbitmap
+
+
+RISC OS port of SDL runtime information
+=======================================
+
+Runtime requirements
+--------------------
+
+This library currently needs a minimum of RISC OS 3.6. The source code for the library (and a lot of the programs built with it) also need long file names.
+
+To use the audio you also need 16 bit sound and to have installed the DigitalRender module by Andreas Dehmel version 0.51 available from his
+web site: http://home.t-online.de/~zarquon
+This is loaded when needed by UnixLib.
+
+Note: As most programs ported from other OSes use high resolution graphics and a memory back buffer a machine with a StrongARM processor and 1 or 2MB of VRAM (or a better machine) is recomended.
+
+
+RISC OS runtime parameters
+--------------------------
+
+Several environmental variables have been defined to make porting programs easier (i.e. By setting these variable you do not need to have source code differences between OSes).
+
+They are all defined on an application basis.
+
+The <appname> used below is found as follows:
+1. Use the name of the program unless it is !RunImage
+2. Check the folder specification for the folder !RunImage is run from. If it is a folder name use that name, otherwise if it is an environmental variable of the form <XXX$Dir> use the value of XXX.
+
+The variables are:
+
+SDL$<appname>$TaskName
+
+The name of the task for RISC OS. If omitted then <appname> is used for the task name,
+
+SDL$<appname>$BackBuffer
+
+Set to 1 to use a system memory back buffer for the screen in full screen mode. Some programs on other systems assume their is always a back buffer even though the SDL specification specifies this is not the case. The current RISC OS implementation uses direct writes to the screen if a hardware fullscreen is requested.
+
+Set to 2 to use an ARM code full word copy. This is faster than the standard back buffer, but uses aligned words only so it is possible (but unlikely) for it to corrupt the screen for 8bpp and 16bpp modes.
+
+Set to 3 to use a RISC OS sprite as the back buffer. This is usually the slowest for most SDL applications, however it may be useful in the future as Sprite acceleration is added to various hardware that runs RISC OS.
+
+SDL$<appname>$CloseAction - set the action for the close icon. Again as programs don't match the specification you can set this to 0 to remove the close icon from the main window for applications where this does not affect the program.
+
+
+RISC OS SDL port API notes
+==========================
+
+Current level of implementation
+-------------------------------
+
+The following list is an overview of how much of the SDL is implemented. The areas match the main areas of the SDL.
+
+video - Mostly done. Doesn't cover gamma, YUV-overlay or OpenGL.
+Window Manager - Mostly done. SetIcon/IconifyWindow not implemented.
+Events - Mostly done. Resize and some joystick events missing.
+Joystick - Currently assumes a single joystick with 4 buttons.
+Audio - Done
+CDROM - Not implemented.
+Threads - Done
+Timers - Done
+
+Thread support can be removed by defining DISABLE_THREADS and recompiling the library.
+
+SDL API notes
+-------------
+
+This section contains additional notes on some specific commands.
+
+SDL_SetVideoMode
+ On RISC OS a fullscreen mode directly accesses the screen. This can be modified by the environmental variable (SDL$<appname>$BackBuffer) or by using the SDL_SWSURFACE flag to write to an offscreen buffer that is updated using SDL_UpdateRects.
+ Open GL is not supported so SDL_OPENGL and SDL_OPENGLBLIT flags fail.
+ SDL_RESIZEABLE and SDL_NOFRAME flags are not supported.
+
+SDL_SetColors
+ In a wimp mode the screen colours are not changed for a hardware palette instead the RISC OS sprite colour mapping is used to get the best matching colours.
+
+SDL_CreateCursor
+ Inverted colour is not supported.
+
+SDL_WM_ToggleFullScreen
+ Currently this won't work if the application starts up in Fullscreen mode.
+ Toggling to fullscreen will only work if the monitor is set up to support the exact screen size requested.
+
+SDL_EnableUNICODE
+ Unicode translation used here is only really accurate for 7 bit characters.
+
+SDL_NumJoysticks/JoystickName etc.
+ Hardcoded to expect only 1 joystick with 4 buttons if the Joystick module is loaded.
+
+SDL_GetTicks
+ Timer used has only a centisecond accuracy. This applies to other time related functions.
+
+SDL_Delay
+ Modified to poll keyboard/mouse during the delay on the event thread.
+
+
+Notes on current implementation
+-------------------------------
+
+Keyboard and mouse are polled so if too long a time is spent between a call to SDL_PumpEvents, functions that use it, or SDL_Delay events can be missed.
diff --git a/distrib/sdl-1.2.15/README.Symbian b/distrib/sdl-1.2.15/README.Symbian
new file mode 100644
index 0000000..32d925a
--- /dev/null
+++ b/distrib/sdl-1.2.15/README.Symbian
@@ -0,0 +1,23 @@
+==============================================================================
+Using the Simple DirectMedia Layer with S60 3.x / Symbian 9.x
+==============================================================================
+
+These instuctions are for people developing for S60 3.x. S60 3.x
+uses Symbian OS so you need S60 SDK.
+
+extract "symbian.zip" into this folder.
+
+go to symbian folder
+
+bldmake bldfiles
+abld build
+
+That produces WINSCW and ARMV5 versions of sdl.dll runtime library
+and sdl.lib for development.
+The sdlexe.dll/sdlexe.lib and sdlmain.lib are for easy SDL S60
+integration, please see http://www.mbnet.fi/~mertama/sdl.html
+for further info.
+
+
+
+
diff --git a/distrib/sdl-1.2.15/README.Watcom b/distrib/sdl-1.2.15/README.Watcom
new file mode 100644
index 0000000..8ed391f
--- /dev/null
+++ b/distrib/sdl-1.2.15/README.Watcom
@@ -0,0 +1,133 @@
+
+Using SDL under Windows with the OpenWatcom compiler
+====================================================
+
+Prerequisites
+-------------
+
+I have done the port under Windows XP Home with SP2 installed. Windows
+2000 should also be working. I'm not so sure about ancient Windows NT,
+since only DirectX 3 is available there. Building should be possible,
+but running the compiled applications will probalbly fail with
+SDL_VIDEODRIVER=directx. The windib driver should work, though.
+
+To compile and use the SDL with Open Watcom you will need the following:
+- Open Watcom compiler. I used version 1.5. The environment variables
+ PATH, WATCOM and INCLUDE need to be set appropriately - please consult
+ the OpenWatcom documentation and instructions given during the
+ installation of the compiler.
+ My setup looks like this in owvars.bat:
+ set WATCOM=C:\watcom
+ set INCLUDE=%WATCOM%\h;%WATCOM%\h\nt
+ set PATH=%PATH%;%WATCOM%\binnt;%WATCOM%\binw
+- A fairly recent DirectX SDK. The original unmodified DX8 SDK works, as
+ well as the minimal DirectX 7 SDK from the Allegro download site
+ (<http://alleg.sourceforge.net/files/dx70_min.zip>).
+- The SDL sources from Subversion
+- The file Watcom-Win32.zip (now available in Subversion)
+
+
+Building the Library
+--------------------
+
+1) In the SDL base directory extract the archive Watcom-Win32.zip. This
+ creates a subdirectory named 'watcom'.
+2) The makefile expects the environment variable DXDIR to be set to the
+ base directory of a DirectX SDK. I have tried a stock DX8 SDK from
+ Microsoft as well as the minimal DirectX 7 SDK from the Allegro
+ download site.
+ You can also edit the makefile directly and hard code your path to
+ the SDK on your system.
+ I have this in my setup:
+ set DXDIR=D:\devel\DX8_SDK
+3) Enter the watcom directory and run
+ wmake sdl
+4) All tests from the test directory are working and can be built by
+ running
+ wmake tests
+
+Notes:
+
+ The makefile offers some options to tweak the way the library is built.
+ You have at your disposal the option to build a static (default)
+ library, or a DLL (with tgt=dll). You can also choose whether to build
+ a Release (default) or a Debug version (with build=debug) of the tests
+ and library. Please consult the usage comment at the top of the
+ makefile for usage instructions.
+
+ If you specify a test target (i.e. 'wmake tests' for all tests, or
+ selected targets like 'wmake testgl testvidinfo testoverlay2'), the
+ tests are always freshly compiled and linked. This is done to
+ minimise hassle when switching between library versions (static vs.
+ DLL), because they require subtly different options.
+ Also, the test executables are put directly into the test directory,
+ so they can find their data files. The clean target of the makefile
+ removes the test executables and the SDL.dll file from the test
+ directory.
+
+ To use the library in your own projects with Open Watcom, you can use
+ the way the tests are built as base of your own build environment.
+
+ The library can also be built with the stack calling convention of the
+ compiler (-6s instead of -6r).
+
+
+Test applications
+-----------------
+
+I've tried to make all tests work. The following table gives an overview
+of the current status.
+
+ Testname Status
+~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+checkkeys +
+graywin +
+loopwave +
+testalpha +
+testbitmap +
+testdyngl +
+testerror +
+testfile +
+testgamma +
+testgl +
+testhread +
+testiconv - (all failed)
+testkeys +
+testlock +
+testoverlay + (needs 'set SDL_VIDEODRIVER=directx')
+testoverlay2 + (needs 'set SDL_VIDEODRIVER=directx')
+testpalette +
+testplatform +
+testsem +
+testsprite +
+testtimer +
+testver +
+testvidinfo +
+testwin ? (fading doesn't seem right)
+testwm +
+torturethread +
+testcdrom +
+testjoystick not tested
+threadwin +
+testcursor +
+
+
+TODO
+----
+
+There is room for further improvement:
+- Test joystick functionality.
+- Investigate fading issue in 'testwin' test.
+- Fix the UTF-8 support.
+- Adapt the makefile/object file list to support more target systems
+- Use "#pragma aux" syntax for the CPU info functions.
+
+
+Questions and Comments
+----------------------
+
+Please direct any questions or comments to me: <mailto:macpete@gmx.de>
+
+ Happy Coding!
+
+ Marc Peter
diff --git a/distrib/sdl-1.2.15/README.WinCE b/distrib/sdl-1.2.15/README.WinCE
new file mode 100644
index 0000000..b78d24c
--- /dev/null
+++ b/distrib/sdl-1.2.15/README.WinCE
@@ -0,0 +1,55 @@
+
+Project files for embedded Visual C++ 3.0, 4.0 and
+Visual Studio 2005 can be found in the VisualCE directory.
+
+SDL supports GAPI and WinDib output for Windows CE.
+
+GAPI driver supports:
+
+- all possible WinCE devices (Pocket PC, Smartphones, HPC)
+ with different orientations of video memory and resolutions.
+- 4, 8 and 16 bpp devices
+- special handling of 8bpp on 8bpp devices
+- VGA mode, you can even switch between VGA and GAPI in runtime
+ (between 240x320 and 480x640 for example). On VGA devices you can
+ use either GAPI or VGA.
+- Landscape mode and automatic rotation of buttons and stylus coordinates.
+ To enable landscape mode make width of video screen bigger than height.
+ For example:
+ SDL_SetVideoMode(320,240,16,SDL_FULLSCREEN)
+- WM2005
+- SDL_ListModes
+
+NOTE:
+There are several SDL features not available in the WinCE port of SDL.
+
+- DirectX is not yet available
+- Semaphores are not available
+- Joystick support is not available
+- CD-ROM control is not available
+
+In addition, there are several features that run in "degraded" mode:
+
+Preprocessor Symbol Effect
+=================== =================================
+
+SDL_systimer.c:
+USE_GETTICKCOUNT Less accurate values for SDL time functions
+USE_SETTIMER Use only a single marginally accurate timer
+
+SDL_syswm.c:
+DISABLE_ICON_SUPPORT Can't set the runtime window icon
+
+SDL_sysmouse.c:
+USE_STATIC_CURSOR Only the arrow cursor is available
+
+SDL_sysevents.c:
+NO_GETKEYBOARDSTATE Can't get modifier state on keyboard focus
+
+SDL_dibevents.c:
+NO_GETKEYBOARDSTATE Very limited keycode translation
+
+SDL_dibvideo.c:
+NO_GETDIBITS Can't distinguish between 15 bpp and 16 bpp
+NO_CHANGEDISPLAYSETTINGS No fullscreen support
+NO_GAMMA_SUPPORT Gamma correction not available
diff --git a/distrib/sdl-1.2.15/README.wscons b/distrib/sdl-1.2.15/README.wscons
new file mode 100644
index 0000000..349c89c
--- /dev/null
+++ b/distrib/sdl-1.2.15/README.wscons
@@ -0,0 +1,107 @@
+==============================================================================
+Using the Simple DirectMedia Layer with OpenBSD/wscons
+==============================================================================
+
+The wscons SDL driver can be used to run SDL programs on OpenBSD
+without running X. So far, the driver only runs on the Sharp Zaurus,
+but the driver is written to be easily extended for other machines.
+The main missing pieces are blitting routines for anything but 16 bit
+displays, and keycode maps for other keyboards. Also, there is no
+support for hardware palettes.
+
+There is currently no mouse support.
+
+To compile SDL with support for wscons, use the
+"--enable-video-wscons" option when running configure. I used the
+following command line:
+
+./configure --disable-oss --disable-ltdl --enable-pthread-sem \
+ --disable-esd --disable-arts --disable-video-aalib \
+ --enable-openbsdaudio --enable-video-wscons \
+ --prefix=/usr/local --sysconfdir=/etc
+
+
+Setting the console device to use
+=================================
+
+When starting an SDL program on a wscons console, the driver uses the
+current virtual terminal (usually /dev/ttyC0). To force the driver to
+use a specific terminal device, set the environment variable
+SDL_WSCONSDEV:
+
+bash$ SDL_WSCONSDEV=/dev/ttyC1 ./some-sdl-program
+
+This is especially useful when starting an SDL program from a remote
+login prompt (which is great for development). If you do this, and
+want to use keyboard input, you should avoid having some other program
+reading from the used virtual console (i.e., do not have a getty
+running).
+
+
+Rotating the display
+====================
+
+The display can be rotated by the wscons SDL driver. This is useful
+for the Sharp Zaurus, since the display hardware is wired so that it
+is correctly rotated only when the display is folded into "PDA mode."
+When using the Zaurus in "normal," or "keyboard" mode, the hardware
+screen is rotated 90 degrees anti-clockwise.
+
+To let the wscons SDL driver rotate the screen, set the environment
+variable SDL_VIDEO_WSCONS_ROTATION to "CW", "CCW", or "UD", for
+clockwise, counter clockwise, and upside-down rotation respectively.
+"CW" makes the screen appear correct on a Sharp Zaurus SL-C3100.
+
+When using rotation in the driver, a "shadow" frame buffer is used to
+hold the intermediary display, before blitting it to the actual
+hardware frame buffer. This slows down performance a bit.
+
+For completeness, the rotation "NONE" can be specified to use a shadow
+frame buffer without actually rotating. Unsetting
+SDL_VIDEO_WSCONS_ROTATION, or setting it to '' turns off the shadow
+frame buffer for maximum performance.
+
+
+Running MAME
+============
+
+Since my main motivation for writing the driver was playing MAME on
+the Zaurus, I'll give a few hints:
+
+XMame compiles just fine under OpenBSD.
+
+I'm not sure this is strictly necessary, but set
+
+MY_CPU = arm
+
+in makefile.unix, and
+
+CFLAGS.arm = -DLSB_FIRST -DALIGN_INTS -DALIGN_SHORTS
+
+in src/unix/unix.max
+
+to be sure.
+
+The latest XMame (0.101 at this writing) is a very large program.
+Either tinker with the make files to compile a version without support
+for all drivers, or, get an older version of XMame. My recommendation
+would be 0.37b16.
+
+When running MAME, DO NOT SET SDL_VIDEO_WSCONS_ROTATION! Performace
+is MUCH better without this, and it is COMPLETELY UNNECESSARY, since
+MAME can rotate the picture itself while drawing, and does so MUCH
+FASTER.
+
+Use the Xmame command line option "-ror" to rotate the picture to the
+right.
+
+
+Acknowledgments
+===============
+
+I studied the wsfb driver for XFree86/Xorg quite a bit before writing
+this, so there ought to be some similarities.
+
+
+--
+Staffan Ulfberg <staffan@ulfberg.se>
diff --git a/distrib/sdl-1.2.15/SDL.qpg.in b/distrib/sdl-1.2.15/SDL.qpg.in
new file mode 100644
index 0000000..821faa3
--- /dev/null
+++ b/distrib/sdl-1.2.15/SDL.qpg.in
@@ -0,0 +1,141 @@
+<QPG:Generation>
+ <QPG:Options>
+ <QPG:User unattended="yes" verbosity="0" listfiles="yes"/>
+ <QPG:Defaults type="qnx_package"/>
+ <QPG:Source></QPG:Source>
+ <QPG:Release date="today" number="+"/>
+ <QPG:Build></QPG:Build>
+ <QPG:FileSorting strip="yes"/>
+ <QPG:Package targets="standart"/>
+ <QPG:Repository generate="yes"/>
+ <QPG:FinalDir></QPG:FinalDir>
+ <QPG:Cleanup></QPG:Cleanup>
+ </QPG:Options>
+
+ <QPG:Responsible>
+ <QPG:Company>QNX.ORG.RU Community</QPG:Company>
+ <QPG:Department></QPG:Department>
+ <QPG:Group></QPG:Group>
+ <QPG:Team>QNX.ORG.RU Team</QPG:Team>
+ <QPG:Employee>Mike Gorchak</QPG:Employee>
+ <QPG:EmailAddress>mike@malva.ua</QPG:EmailAddress>
+ </QPG:Responsible>
+
+ <QPG:Values>
+ <QPG:Files>
+ <QPG:Add file="./COPYING" install="LicenseUrl/" handling="repdata"/>
+ <QPG:Add permissions="0755" file="./src/.libs/libSDL-@SDL_MAJOR_VERSION@.@SDL_MINOR_VERSION@.so.@LT_AGE@" install="/usr/lib/"/>
+ <QPG:Add filetype="symlink" file="libSDL.so" install="/usr/lib/" linkto="libSDL-@SDL_MAJOR_VERSION@.@SDL_MINOR_VERSION@.so.@LT_AGE@"/>
+ <QPG:Add permissions="0644" file="./src/.libs/libSDL.a" install="/usr/lib/"/>
+ <QPG:Add permissions="0644" file="./src/.libs/libSDL.lai" install="/usr/lib/libSDL.la"/>
+ <QPG:Add permissions="0644" file="./src/.libs/libSDLmain.a" install="/usr/lib/"/>
+ <QPG:Add permissions="0644" file="./src/.libs/libSDLmain.lai" install="/usr/lib/libSDLmain.lai"/>
+ <QPG:Add permissions="0644" file="./include/*.h" install="/usr/include/SDL/"/>
+ <QPG:Add permissions="0755" file="./sdl-config" install="/usr/bin/"/>
+ <QPG:Add permissions="0644" file="./BUGS" install="/usr/share/doc/SDL12/"/>
+ <QPG:Add permissions="0644" file="./COPYING" install="/usr/share/doc/SDL12/"/>
+ <QPG:Add permissions="0644" file="./CREDITS" install="/usr/share/doc/SDL12/"/>
+ <QPG:Add permissions="0644" file="./INSTALL" install="/usr/share/doc/SDL12/"/>
+ <QPG:Add permissions="0644" file="./README" install="/usr/share/doc/SDL12/"/>
+ <QPG:Add permissions="0644" file="./README-SDL.txt" install="/usr/share/doc/SDL12/"/>
+ <QPG:Add permissions="0644" file="./README.CVS" install="/usr/share/doc/SDL12/"/>
+ <QPG:Add permissions="0644" file="./README.QNX" install="/usr/share/doc/SDL12/"/>
+ <QPG:Add permissions="0644" file="./TODO" install="/usr/share/doc/SDL12/"/>
+ <QPG:Add permissions="0644" file="./WhatsNew" install="/usr/share/doc/SDL12/"/>
+ <QPG:Add permissions="0644" file="./docs.html" install="/usr/share/doc/SDL12/Changes.html"/>
+ <QPG:Add permissions="0644" file="./docs/index.html" install="/usr/share/doc/SDL12/docs/"/>
+ <QPG:Add permissions="0644" file="./docs/html/*.html" install="/usr/share/doc/SDL12/docs/html/"/>
+ <QPG:Add permissions="0644" file="./docs/man3/*.3" install="/usr/share/man/man3/"/>
+ <QPG:Add permissions="0644" file="./sdl.m4" install="/usr/share/aclocal/"/>
+ </QPG:Files>
+ <QPG:PackageFilter>
+ <QPM:PackageManifest>
+
+ <QPM:PackageDescription>
+ <QPM:PackageType>Library</QPM:PackageType>
+ <QPM:PackageName>SDL</QPM:PackageName>
+ <QPM:PackageReleaseNumber>1</QPM:PackageReleaseNumber>
+ <QPM:PackageRepository>http://qnx.org.ru/repository</QPM:PackageRepository>
+ <QPM:FileVersion>2.6</QPM:FileVersion>
+ </QPM:PackageDescription>
+
+ <QPM:ProductDescription>
+ <QPM:ProductName>Simple DirectMedia Layer (SDL)</QPM:ProductName>
+ <QPM:ProductIdentifier>SDL</QPM:ProductIdentifier>
+ <QPM:ProductEmail>slouken@libsdl.org</QPM:ProductEmail>
+ <QPM:VendorName>Public</QPM:VendorName>
+ <QPM:VendorInstallName>public</QPM:VendorInstallName>
+ <QPM:VendorURL>http://www.libsdl.org</QPM:VendorURL>
+ <QPM:VendorEmbedURL/>
+ <QPM:VendorEmail>slouken@libsdl.org</QPM:VendorEmail>
+ <QPM:AuthorName>Sam Lantinga</QPM:AuthorName>
+ <QPM:AuthorURL>http://www.libsdl.org</QPM:AuthorURL>
+ <QPM:AuthorEmbedURL/>
+ <QPM:AuthorEmail>slouken@libsdl.org</QPM:AuthorEmail>
+ <QPM:ProductIconSmall/>
+ <QPM:ProductIconLarge/>
+ <QPM:ProductDescriptionShort>This is the Simple DirectMedia Layer (SDL), a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms.</QPM:ProductDescriptionShort>
+ <QPM:ProductDescriptionLong>This is the Simple DirectMedia Layer (SDL), a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms. This is the libraries, include files and other resources you can use to develop and run SDL applications.</QPM:ProductDescriptionLong>
+ <QPM:ProductDescriptionURL>http://www.libsdl.org</QPM:ProductDescriptionURL>
+ <QPM:ProductDescriptionEmbedURL/>
+ </QPM:ProductDescription>
+
+ <QPM:ReleaseDescription>
+ <QPM:ReleaseVersion>@VERSION@</QPM:ReleaseVersion>
+ <QPM:ReleaseUrgency>Medium</QPM:ReleaseUrgency>
+ <QPM:ReleaseStability>Stable</QPM:ReleaseStability>
+ <QPM:ReleaseNoteMinor/>
+ <QPM:ReleaseNoteMajor/>
+ <QPM:ReleaseBuild>1</QPM:ReleaseBuild>
+ <QPM:CountryExclude/>
+ <QPM:ReleaseCopyright>GNU Lesser General Public License</QPM:ReleaseCopyright>
+ </QPM:ReleaseDescription>
+
+ <QPM:ContentDescription>
+ <QPM:ContentTopic xmlmultiple="true">Software Development/Libraries and Extensions/C Libraries</QPM:ContentTopic>
+ <QPM:ContentKeyword>SDL,audio,graphics,demos,games,emulators,direct,media,layer</QPM:ContentKeyword>
+ <QPM:TargetOS>qnx6</QPM:TargetOS>
+ <QPM:HostOS>none</QPM:HostOS>
+ <QPM:DisplayEnvironment xmlmultiple="true">Photon</QPM:DisplayEnvironment>
+ <QPM:DisplayEnvironment xmlmultiple="true">Console</QPM:DisplayEnvironment>
+ <QPM:TargetAudience xmlmultiple="true">Developer</QPM:TargetAudience>
+ <QPM:TargetAudience xmlmultiple="true">User</QPM:TargetAudience>
+ </QPM:ContentDescription>
+ <QPM:LicenseUrl>repdata://LicenseUrl/COPYING</QPM:LicenseUrl>
+ </QPM:PackageManifest>
+ </QPG:PackageFilter>
+
+ <QPG:PackageFilter proc="none" target="none">
+ <QPM:PackageManifest>
+ <QPM:ProductInstallationDependencies>
+ <QPM:ProductRequirements></QPM:ProductRequirements>
+ </QPM:ProductInstallationDependencies>
+ </QPM:PackageManifest>
+ </QPG:PackageFilter>
+
+ <QPG:PackageFilter proc="x86" target="none">
+ <QPM:PackageManifest>
+ <QPM:ProductInstallationDependencies>
+ <QPM:ProductRequirements></QPM:ProductRequirements>
+ </QPM:ProductInstallationDependencies>
+ </QPM:PackageManifest>
+ </QPG:PackageFilter>
+
+ <QPG:PackageFilter proc="none" target="x86">
+ <QPM:PackageManifest>
+ <QPM:ProductInstallationDependencies>
+ <QPM:ProductRequirements></QPM:ProductRequirements>
+ </QPM:ProductInstallationDependencies>
+ </QPM:PackageManifest>
+ </QPG:PackageFilter>
+
+ <QPG:PackageFilter proc="x86" target="x86">
+ <QPM:PackageManifest>
+ <QPM:ProductInstallationDependencies>
+ <QPM:ProductRequirements></QPM:ProductRequirements>
+ </QPM:ProductInstallationDependencies>
+ </QPM:PackageManifest>
+ </QPG:PackageFilter>
+
+ </QPG:Values>
+</QPG:Generation>
diff --git a/distrib/sdl-1.2.15/SDL.spec.in b/distrib/sdl-1.2.15/SDL.spec.in
new file mode 100644
index 0000000..dbda112
--- /dev/null
+++ b/distrib/sdl-1.2.15/SDL.spec.in
@@ -0,0 +1,113 @@
+Summary: Simple DirectMedia Layer
+Name: SDL
+Version: @SDL_VERSION@
+Release: 1
+Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz
+URL: http://www.libsdl.org/
+License: LGPL
+Group: System Environment/Libraries
+BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
+Prefix: %{_prefix}
+%ifos linux
+Provides: libSDL-1.2.so.0
+%endif
+
+%define __defattr %defattr(-,root,root)
+%define __soext so
+
+%description
+This is the Simple DirectMedia Layer, a generic API that provides low
+level access to audio, keyboard, mouse, and display framebuffer across
+multiple platforms.
+
+%package devel
+Summary: Libraries, includes and more to develop SDL applications.
+Group: Development/Libraries
+Requires: %{name} = %{version}
+
+%description devel
+This is the Simple DirectMedia Layer, a generic API that provides low
+level access to audio, keyboard, mouse, and display framebuffer across
+multiple platforms.
+
+This is the libraries, include files and other resources you can use
+to develop SDL applications.
+
+
+%prep
+%setup -q
+
+%build
+%ifos linux
+CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --disable-video-aalib --disable-video-directfb --disable-video-ggi --disable-video-svga
+%else
+%configure
+%endif
+make
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%ifos linux
+make install prefix=$RPM_BUILD_ROOT%{prefix} \
+ bindir=$RPM_BUILD_ROOT%{_bindir} \
+ libdir=$RPM_BUILD_ROOT%{_libdir} \
+ includedir=$RPM_BUILD_ROOT%{_includedir} \
+ datadir=$RPM_BUILD_ROOT%{_datadir} \
+ mandir=$RPM_BUILD_ROOT%{_mandir}
+ln -s libSDL-1.2.so.0 $RPM_BUILD_ROOT%{_libdir}/libSDL-1.1.so.0
+%else
+%makeinstall
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%{__defattr}
+%doc README-SDL.txt COPYING CREDITS BUGS
+%{_libdir}/lib*.%{__soext}.*
+
+%files devel
+%{__defattr}
+%doc README README-SDL.txt COPYING CREDITS BUGS WhatsNew docs.html
+%doc docs/index.html docs/html
+%{_bindir}/*-config
+%{_libdir}/lib*.a
+%{_libdir}/lib*.la
+%{_libdir}/lib*.%{__soext}
+%dir %{_includedir}/SDL
+%{_includedir}/SDL/*.h
+%{_libdir}/pkgconfig/sdl.pc
+%{_datadir}/aclocal/*
+%{_mandir}/man3/*
+
+%changelog
+* Tue May 16 2006 Sam Lantinga <slouken@libsdl.org>
+- Removed support for Darwin, due to build problems on ps2linux
+
+* Mon Jan 03 2004 Anders Bjorklund <afb@algonet.se>
+- Added support for Darwin, updated spec file
+
+* Wed Jan 19 2000 Sam Lantinga <slouken@libsdl.org>
+- Re-integrated spec file into SDL distribution
+- 'name' and 'version' come from configure
+- Some of the documentation is devel specific
+- Removed SMP support from %build - it doesn't work with libtool anyway
+
+* Tue Jan 18 2000 Hakan Tandogan <hakan@iconsult.com>
+- Hacked Mandrake sdl spec to build 1.1
+
+* Sun Dec 19 1999 John Buswell <johnb@mandrakesoft.com>
+- Build Release
+
+* Sat Dec 18 1999 John Buswell <johnb@mandrakesoft.com>
+- Add symlink for libSDL-1.0.so.0 required by sdlbomber
+- Added docs
+
+* Thu Dec 09 1999 Lenny Cartier <lenny@mandrakesoft.com>
+- v 1.0.0
+
+* Mon Nov 1 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
+- First spec file for Mandrake distribution.
+
+# end of file
diff --git a/distrib/sdl-1.2.15/TODO b/distrib/sdl-1.2.15/TODO
new file mode 100644
index 0000000..65bb01c
--- /dev/null
+++ b/distrib/sdl-1.2.15/TODO
@@ -0,0 +1,25 @@
+
+Wish list for the 1.3 development branch:
+http://bugzilla.libsdl.org/
+
+ * Add mousewheel events (new unified event architecture?)
+ * DirectInput joystick support needs to be implemented
+ * Be able to enumerate and select available audio and video drivers
+ * Fullscreen video mode support for Mac OS X
+ * Explicit vertical retrace wait (maybe separate from SDL_Flip?)
+ * Shaped windows, windows without borders
+ * Multiple windows, multiple display support
+ * SDL_INIT_EVENTTHREAD on Windows and MacOS?
+ * Add a timestamp to events
+ * Add audio input API
+ * Add hardware accelerated scaled blit
+ * Add hardware accelerated alpha blits
+ * Redesign blitting architecture to allow blit plugins
+
+In the jump from 1.2 to 1.3, we should change the SDL_Rect members to
+int and evaluate all the rest of the datatypes. This is the only place
+we should do it though, since the 1.2 series should not break binary
+compatibility in this way.
+
+Requests:
+ * PCM and CDROM volume control (deprecated, but possible)
diff --git a/distrib/sdl-1.2.15/VisualC.html b/distrib/sdl-1.2.15/VisualC.html
new file mode 100644
index 0000000..2923495
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC.html
@@ -0,0 +1,159 @@
+<HTML>
+ <HEAD>
+ <TITLE>Using SDL with Microsoft Visual C++</TITLE>
+ </HEAD>
+ <BODY>
+ <H1>
+ Using SDL with Microsoft Visual C++ 5,6&nbsp;and 7
+ </H1>
+ <H3>
+ by <A HREF="mailto:snowlion@sprynet.com">Lion Kimbro </A>and additions by <A HREF="mailto:james@conceptofzero.net">
+ James Turk</A>
+ </H3>
+ <p>
+ You can either use the precompiled libraries from <A HREF="http://www.libsdl.org/download.php">
+ the SDL Download web site </A>, or you can build SDL yourself.
+ </p>
+ <H3>
+ Building SDL
+ </H3>
+ <P>
+ Go into the VisualC
+ directory that is created, and double-click on the VC++ file "<CODE>SDL.dsw</CODE>"<STRONG><FONT color="#009900">
+ ("<CODE>SDL.sln</CODE>").</FONT></STRONG> This should open up the IDE.
+ </P>
+ <P>
+ 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.
+ </P>
+ <P>
+ Build the <CODE>.dll</CODE> and <CODE>.lib</CODE> files.
+ </P>
+ <P>
+ 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".
+ </P>
+ <P>
+ 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.
+ </P>
+ <P>
+ 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 <A HREF="http://www.microsoft.com">Microsoft </A>.
+ </P>
+ <P>
+ Later, we will refer to the following .lib and .dll files that have just been
+ generated:
+ </P>
+ <ul>
+ <li> SDL.dll</li>
+ <li> SDL.lib</li>
+ <li> SDLmain.lib</li>
+ </ul>
+ <P>
+ 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.)
+ </P>
+ <H3>
+ Creating a Project with SDL
+ </H3>
+ <P>
+ Create a project as a Win32 Application.
+ </P>
+ <P>
+ Create a C++ file for your project.
+ </P>
+ <P>
+ Set the C runtime to "Multi-threaded DLL" in the menu: <CODE>Project|Settings|C/C++
+ tab|Code Generation|Runtime Library </CODE>.
+ </P>
+ <P>
+ Add the SDL <CODE>include</CODE> directory to your list of includes in the
+ menu: <CODE>Project|Settings|C/C++ tab|Preprocessor|Additional include directories </CODE>
+ .
+ <br>
+ <STRONG><FONT color="#009900">VC7 Specific: Instead of doing this I find it easier to
+ 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).&nbsp;Proceed to&nbsp;change the
+ dropbox selection to "Library Files" and add [SDLROOT]\lib.</FONT></STRONG>
+ </P>
+ <P>
+ The "include directory" I am referring to is the <CODE>include</CODE> folder
+ within the main SDL directory (the one that this HTML file located within).
+ </P>
+ <P>
+ Now we're going to use the files that we had created earlier in the Build SDL
+ step.
+ </P>
+ <P>
+ Copy the following files into your Project directory:
+ </P>
+ <ul>
+ <li> SDL.dll</li>
+ </ul>
+ <P>
+ Add the following files to your project (It is not necessary to copy them to
+ your project directory):
+ </P>
+ <ul>
+ <li> SDL.lib </li>
+ <li> SDLmain.lib</li>
+ </ul>
+ <P>
+ (To add them to your project, right click on your project, and select "Add
+ files to project")
+ </P>
+ <P><STRONG><FONT color="#009900">Instead of adding the files to your project it is more
+ 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.&nbsp; Note: This must be done&nbsp;for&nbsp;each&nbsp;build
+ configuration (eg. Release,Debug).</FONT></STRONG></P>
+ <H3>
+ SDL 101, First Day of Class
+ </H3>
+ <P>
+ Now create the basic body of your project. The body of your program should take
+ the following form: <CODE>
+ <PRE>
+#include "SDL.h"
+
+int main( int argc, char* argv[] )
+{
+ // Body of the program goes here.
+ return 0;
+}
+</PRE>
+ </CODE>
+ <P></P>
+ <H3>
+ That's it!
+ </H3>
+ <P>
+ I hope that this document has helped you get through the most difficult part of
+ using the SDL: installing it. Suggestions for improvements to this document
+ should be sent to the writers of this document.
+ </P>
+ <P>
+ Thanks to Paulus Esterhazy (pesterhazy@gmx.net), for the work on VC++ port.
+ </P>
+ <P>
+ This document was originally called "VisualC.txt", and was written by <A HREF="mailto:slouken@libsdl.org">
+ Sam Lantinga</A>.
+ </P>
+ <P>
+ Later, it was converted to HTML and expanded into the document that you see
+ today by <A HREF="mailto:snowlion@sprynet.com">Lion Kimbro</A>.
+ </P>
+ <P>Minor Fixes and Visual C++ 7 Information (In Green) was added by <A HREF="mailto:james@conceptofzero.net">James Turk</A>
+ </P>
+ </BODY>
+</HTML>
diff --git a/distrib/sdl-1.2.15/VisualC/SDL.dsw b/distrib/sdl-1.2.15/VisualC/SDL.dsw
new file mode 100644
index 0000000..63128a8
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/SDL.dsw
@@ -0,0 +1,41 @@
+Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "SDL"=.\SDL\SDL.DSP - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "SDLmain"=.\SDLmain\SDLmain.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/distrib/sdl-1.2.15/VisualC/SDL.sln b/distrib/sdl-1.2.15/VisualC/SDL.sln
new file mode 100644
index 0000000..0d5edbc
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/SDL.sln
@@ -0,0 +1,45 @@
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL", "SDL\SDL.vcproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDLmain", "SDLmain\SDLmain.vcproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ Release_NoSTDIO|Win32 = Release_NoSTDIO|Win32
+ Release_NoSTDIO|x64 = Release_NoSTDIO|x64
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.ActiveCfg = Debug|Win32
+ {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Win32.Build.0 = Debug|Win32
+ {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64
+ {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64
+ {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_NoSTDIO|Win32.ActiveCfg = Release|Win32
+ {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_NoSTDIO|Win32.Build.0 = Release|Win32
+ {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_NoSTDIO|x64.ActiveCfg = Release|x64
+ {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release_NoSTDIO|x64.Build.0 = Release|x64
+ {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.ActiveCfg = Release|Win32
+ {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Win32.Build.0 = Release|Win32
+ {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64
+ {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64
+ {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Win32.Build.0 = Debug|Win32
+ {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.ActiveCfg = Debug|x64
+ {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.Build.0 = Debug|x64
+ {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_NoSTDIO|Win32.ActiveCfg = Release_NoSTDIO|Win32
+ {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_NoSTDIO|Win32.Build.0 = Release_NoSTDIO|Win32
+ {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_NoSTDIO|x64.ActiveCfg = Release_NoSTDIO|x64
+ {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release_NoSTDIO|x64.Build.0 = Release_NoSTDIO|x64
+ {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.ActiveCfg = Release|Win32
+ {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Win32.Build.0 = Release|Win32
+ {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.ActiveCfg = Release|x64
+ {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/distrib/sdl-1.2.15/VisualC/SDL/SDL.dsp b/distrib/sdl-1.2.15/VisualC/SDL/SDL.dsp
new file mode 100644
index 0000000..83838fe
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/SDL/SDL.dsp
@@ -0,0 +1,546 @@
+# Microsoft Developer Studio Project File - Name="SDL" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=SDL - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "SDL.MAK".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "SDL.MAK" CFG="SDL - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "SDL - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "SDL - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /D "NDEBUG" /D "_WINDOWS" /D _WIN32_WINNT=0x0400 /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 winmm.lib dxguid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /machine:I386
+
+!ELSEIF "$(CFG)" == "SDL - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\include" /D "_DEBUG" /D "_WINDOWS" /D _WIN32_WINNT=0x0400 /YX /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 winmm.lib dxguid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "SDL - Win32 Release"
+# Name "SDL - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\src\video\blank_cursor.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\default_cursor.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\windx5\Directx.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\SDL.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\events\SDL_active.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_audio.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_audio_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_audiocvt.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_audiomem.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_blit.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_blit.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_blit_0.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_blit_1.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_blit_A.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_blit_A.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_blit_N.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_bmp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\cdrom\SDL_cdrom.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\cpuinfo\SDL_cpuinfo.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_cursor.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_cursor_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\windib\SDL_dibaudio.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\windib\SDL_dibaudio.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\windib\SDL_dibevents.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\windib\SDL_dibevents_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\windib\SDL_dibvideo.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\windib\SDL_dibvideo.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\disk\SDL_diskaudio.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\disk\SDL_diskaudio.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\dummy\SDL_dummyaudio.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\dummy\SDL_dummyaudio.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\windx5\SDL_dx5audio.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\windx5\SDL_dx5audio.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\windx5\SDL_dx5events.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\windx5\SDL_dx5events_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\windx5\SDL_dx5video.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\windx5\SDL_dx5video.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\windx5\SDL_dx5yuv.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\windx5\SDL_dx5yuv_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\SDL_error.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\SDL_error_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\events\SDL_events.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\events\SDL_events_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\events\SDL_expose.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\SDL_fatal.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\SDL_fatal.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_gamma.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\stdlib\SDL_getenv.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\stdlib\SDL_iconv.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\joystick\SDL_joystick.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\joystick\SDL_joystick_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\events\SDL_keyboard.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_leaks.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\wincommon\SDL_lowvideo.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\stdlib\SDL_malloc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_mixer.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_mixer_MMX_VC.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\joystick\win32\SDL_mmjoystick.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\events\SDL_mouse.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\dummy\SDL_nullevents.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\dummy\SDL_nullevents_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\dummy\SDL_nullmouse.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\dummy\SDL_nullmouse_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\dummy\SDL_nullvideo.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\dummy\SDL_nullvideo.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_pixels.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_pixels_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\stdlib\SDL_qsort.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\events\SDL_quit.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\events\SDL_resize.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_RLEaccel.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_RLEaccel_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\file\SDL_rwops.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_stretch.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_stretch_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\stdlib\SDL_stdlib.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\stdlib\SDL_string.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_surface.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_sysaudio.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\cdrom\win32\SDL_syscdrom.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\cdrom\SDL_syscdrom.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\generic\SDL_syscond.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\wincommon\SDL_sysevents.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\events\SDL_sysevents.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\joystick\SDL_sysjoystick.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\loadso\win32\SDL_sysloadso.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\wincommon\SDL_sysmouse.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\wincommon\SDL_sysmouse_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\win32\SDL_sysmutex.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\win32\SDL_syssem.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\win32\SDL_systhread.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\SDL_systhread.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\win32\SDL_systhread_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\timer\win32\SDL_systimer.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\timer\SDL_systimer.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_sysvideo.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\wincommon\SDL_syswm.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\wincommon\SDL_syswm_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\SDL_thread.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\SDL_thread_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\timer\SDL_timer.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\timer\SDL_timer_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_video.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\windib\SDL_vkeys.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_wave.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_wave.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\wincommon\SDL_wingl.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\wincommon\SDL_wingl_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_yuv.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_yuv_sw.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_yuv_sw_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_yuvfuncs.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Version.rc
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\wincommon\Wmmsg.h
+# End Source File
+# End Target
+# End Project
diff --git a/distrib/sdl-1.2.15/VisualC/SDL/SDL.vcproj b/distrib/sdl-1.2.15/VisualC/SDL/SDL.vcproj
new file mode 100644
index 0000000..1dffaea
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/SDL/SDL.vcproj
@@ -0,0 +1,828 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="SDL"
+ ProjectGUID="{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
+ RootNamespace="SDL"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/SDL.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\include&quot;"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0400"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Debug/SDL.pch"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="winmm.lib dxguid.lib"
+ OutputFile=".\Debug/SDL.dll"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/SDL.pdb"
+ SubSystem="2"
+ CLRUnmanagedCodeCheck="false"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\Debug/SDL.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\include&quot;"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0400"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Debug/SDL.pch"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib dxguid.lib"
+ OutputFile=".\Debug/SDL.dll"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/SDL.pdb"
+ SubSystem="2"
+ TargetMachine="17"
+ CLRUnmanagedCodeCheck="false"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/SDL.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ EnableIntrinsicFunctions="false"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\include&quot;"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0400"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Release/SDL.pch"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="false"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="winmm.lib dxguid.lib"
+ OutputFile=".\Release/SDL.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ IgnoreAllDefaultLibraries="false"
+ ProgramDatabaseFile=".\Release/SDL.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\Release/SDL.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ EnableIntrinsicFunctions="false"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\include&quot;"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0400"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Release/SDL.pch"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="false"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib dxguid.lib"
+ OutputFile=".\Release/SDL.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ IgnoreAllDefaultLibraries="false"
+ ProgramDatabaseFile=".\Release/SDL.pdb"
+ SubSystem="2"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\..\src\SDL.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\events\SDL_active.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_audio.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_audio_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_audiocvt.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_audiomem.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_blit.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_blit.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_blit_0.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_blit_1.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_blit_A.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_blit_A.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_blit_N.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_bmp.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\cdrom\SDL_cdrom.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\cpuinfo\SDL_cpuinfo.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_cursor.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_cursor_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\windib\SDL_dibaudio.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\windib\SDL_dibaudio.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\windib\SDL_dibevents.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\windib\SDL_dibevents_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\windib\SDL_dibvideo.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\windib\SDL_dibvideo.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\disk\SDL_diskaudio.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\disk\SDL_diskaudio.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\dummy\SDL_dummyaudio.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\dummy\SDL_dummyaudio.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\windx5\SDL_dx5audio.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\windx5\SDL_dx5audio.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\Windx5\SDL_dx5events.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\Windx5\SDL_dx5events_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\Windx5\SDL_dx5video.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\Windx5\SDL_dx5video.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\windx5\SDL_dx5yuv.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\windx5\SDL_dx5yuv_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\SDL_error.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\SDL_error_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\events\SDL_events.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\events\SDL_events_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\events\SDL_expose.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\SDL_fatal.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\SDL_fatal.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_gamma.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\stdlib\SDL_getenv.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\stdlib\SDL_iconv.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\joystick\SDL_joystick.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\joystick\SDL_joystick_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\events\SDL_keyboard.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_leaks.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\wincommon\SDL_lowvideo.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\stdlib\SDL_malloc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_mixer.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_mixer_MMX_VC.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\joystick\win32\SDL_mmjoystick.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\events\SDL_mouse.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\dummy\SDL_nullevents.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\dummy\SDL_nullevents_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\dummy\SDL_nullmouse.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\dummy\SDL_nullmouse_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\dummy\SDL_nullvideo.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\dummy\SDL_nullvideo.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_pixels.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_pixels_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\stdlib\SDL_qsort.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\events\SDL_quit.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\events\SDL_resize.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_RLEaccel.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_RLEaccel_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\file\SDL_rwops.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\stdlib\SDL_stdlib.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_stretch.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_stretch_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\stdlib\SDL_string.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_surface.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_sysaudio.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\cdrom\win32\SDL_syscdrom.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\cdrom\SDL_syscdrom.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\thread\generic\SDL_syscond.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\wincommon\SDL_sysevents.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\events\SDL_sysevents.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\joystick\SDL_sysjoystick.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\loadso\win32\SDL_sysloadso.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\wincommon\SDL_sysmouse.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\wincommon\SDL_sysmouse_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\thread\win32\SDL_sysmutex.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\thread\win32\SDL_syssem.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\thread\win32\SDL_systhread.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\thread\SDL_systhread.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\thread\win32\SDL_systhread_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\timer\win32\SDL_systimer.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\timer\SDL_systimer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_sysvideo.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\wincommon\SDL_syswm.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\wincommon\SDL_syswm_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\thread\SDL_thread.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\thread\SDL_thread_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\timer\SDL_timer.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\timer\SDL_timer_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_video.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\windib\SDL_vkeys.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_wave.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_wave.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\wincommon\SDL_wingl.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\wincommon\SDL_wingl_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_yuv.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_yuv_sw.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_yuv_sw_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_yuvfuncs.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\wincommon\Wmmsg.h"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/distrib/sdl-1.2.15/VisualC/SDL/Version.rc b/distrib/sdl-1.2.15/VisualC/SDL/Version.rc
new file mode 100644
index 0000000..3147730
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/SDL/Version.rc
@@ -0,0 +1,105 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "winresrc.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,2,15,0
+ PRODUCTVERSION 1,2,15,0
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", "\0"
+ VALUE "FileDescription", "SDL\0"
+ VALUE "FileVersion", "1, 2, 15, 0\0"
+ VALUE "InternalName", "SDL\0"
+ VALUE "LegalCopyright", "Copyright © 2012 Sam Lantinga\0"
+ VALUE "OriginalFilename", "SDL.dll\0"
+ VALUE "ProductName", "Simple DirectMedia Layer\0"
+ VALUE "ProductVersion", "1, 2, 15, 0\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+#endif // !_MAC
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/distrib/sdl-1.2.15/VisualC/SDL/resource.h b/distrib/sdl-1.2.15/VisualC/SDL/resource.h
new file mode 100644
index 0000000..cbfd81d
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/SDL/resource.h
@@ -0,0 +1,15 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by Version.rc
+//
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 101
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1000
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/distrib/sdl-1.2.15/VisualC/SDLmain/SDLmain.dsp b/distrib/sdl-1.2.15/VisualC/SDLmain/SDLmain.dsp
new file mode 100644
index 0000000..eafa40a
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/SDLmain/SDLmain.dsp
@@ -0,0 +1,106 @@
+# Microsoft Developer Studio Project File - Name="SDLmain" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=SDLmain - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "SDLmain.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "SDLmain.mak" CFG="SDLmain - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "SDLmain - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "SDLmain - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "SDLmain - Win32 Release_NoSTDIO" (based on\
+ "Win32 (x86) Static Library")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+
+!IF "$(CFG)" == "SDLmain - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "..\..\include\SDL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /Z7 /Od /I "..\..\include" /I "..\..\include\SDL" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 Release_NoSTDIO"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "SDLmain_"
+# PROP BASE Intermediate_Dir "SDLmain_"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_NOSTDIO"
+# PROP Intermediate_Dir "Release_NOSTDIO"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "..\..\include\SDL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /I "..\..\include\SDL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "NO_STDIO_REDIRECT" /YX /FD /c
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ENDIF
+
+# Begin Target
+
+# Name "SDLmain - Win32 Release"
+# Name "SDLmain - Win32 Debug"
+# Name "SDLmain - Win32 Release_NoSTDIO"
+# Begin Source File
+
+SOURCE=..\..\Src\Main\Win32\SDL_win32_main.c
+# End Source File
+# End Target
+# End Project
diff --git a/distrib/sdl-1.2.15/VisualC/SDLmain/SDLmain.vcproj b/distrib/sdl-1.2.15/VisualC/SDLmain/SDLmain.vcproj
new file mode 100644
index 0000000..95b0afc
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/SDLmain/SDLmain.vcproj
@@ -0,0 +1,422 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="SDLmain"
+ ProjectGUID="{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32,NDEBUG,_WINDOWS"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Release/SDLmain.pch"
+ WarningLevel="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32,NDEBUG,_WINDOWS"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Release/SDLmain.pch"
+ WarningLevel="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release_NoSTDIO|Win32"
+ OutputDirectory=".\Release_NOSTDIO"
+ IntermediateDirectory=".\Release_NOSTDIO"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32,NDEBUG,_WINDOWS,NO_STDIO_REDIRECT"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Release_NOSTDIO/SDLmain.pch"
+ WarningLevel="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release_NoSTDIO|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32,NDEBUG,_WINDOWS,NO_STDIO_REDIRECT"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Release_NOSTDIO/SDLmain.pch"
+ WarningLevel="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32,_DEBUG,_WINDOWS"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Debug/SDLmain.pch"
+ WarningLevel="3"
+ DebugInformationFormat="1"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\include,..\..\include\SDL"
+ PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32,_DEBUG,_WINDOWS"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Debug/SDLmain.pch"
+ WarningLevel="3"
+ DebugInformationFormat="1"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\..\Src\Main\Win32\SDL_win32_main.c"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/distrib/sdl-1.2.15/VisualC/tests/graywin/graywin.dsp b/distrib/sdl-1.2.15/VisualC/tests/graywin/graywin.dsp
new file mode 100644
index 0000000..3af83af
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/graywin/graywin.dsp
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="graywin" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=graywin - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "graywin.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "graywin.mak" CFG="graywin - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "graywin - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "graywin - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "graywin - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+
+!ELSEIF "$(CFG)" == "graywin - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "graywin - Win32 Release"
+# Name "graywin - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\..\test\graywin.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Sdl\Debug\SDL.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\SDLmain\Debug\SDLmain.lib
+# End Source File
+# End Target
+# End Project
diff --git a/distrib/sdl-1.2.15/VisualC/tests/graywin/graywin.vcproj b/distrib/sdl-1.2.15/VisualC/tests/graywin/graywin.vcproj
new file mode 100644
index 0000000..675dfed
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/graywin/graywin.vcproj
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="graywin"
+ ProjectGUID="{0BCCA0BF-073E-439E-BCE0-C9353C177487}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/graywin.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Debug/graywin.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ OutputFile=".\Debug/graywin.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/graywin.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/graywin.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Release/graywin.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ OutputFile=".\Release/graywin.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\Release/graywin.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\..\..\test\graywin.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\Sdl\Debug\SDL.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/distrib/sdl-1.2.15/VisualC/tests/loopwave/loopwave.dsp b/distrib/sdl-1.2.15/VisualC/tests/loopwave/loopwave.dsp
new file mode 100644
index 0000000..d0f82e4
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/loopwave/loopwave.dsp
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="loopwave" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=loopwave - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "loopwave.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "loopwave.mak" CFG="loopwave - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "loopwave - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "loopwave - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "loopwave - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+
+!ELSEIF "$(CFG)" == "loopwave - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "loopwave - Win32 Release"
+# Name "loopwave - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\..\Test\Loopwave.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Sdl\Debug\SDL.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\SDLmain\Debug\SDLmain.lib
+# End Source File
+# End Target
+# End Project
diff --git a/distrib/sdl-1.2.15/VisualC/tests/loopwave/loopwave.vcproj b/distrib/sdl-1.2.15/VisualC/tests/loopwave/loopwave.vcproj
new file mode 100644
index 0000000..5fc5d9c
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/loopwave/loopwave.vcproj
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="loopwave"
+ ProjectGUID="{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/loopwave.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Release/loopwave.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ OutputFile=".\Release/loopwave.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\Release/loopwave.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/loopwave.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Debug/loopwave.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ OutputFile=".\Debug/loopwave.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/loopwave.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\..\..\Test\Loopwave.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\Sdl\Debug\SDL.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/distrib/sdl-1.2.15/VisualC/tests/testalpha/testalpha.dsp b/distrib/sdl-1.2.15/VisualC/tests/testalpha/testalpha.dsp
new file mode 100644
index 0000000..286dd77
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/testalpha/testalpha.dsp
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="testalpha" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=testalpha - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "testalpha.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "testalpha.mak" CFG="testalpha - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "testalpha - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "testalpha - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "testalpha - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+
+!ELSEIF "$(CFG)" == "testalpha - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "testalpha - Win32 Release"
+# Name "testalpha - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\Sdl\Debug\SDL.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\SDLmain\Debug\SDLmain.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Test\testalpha.c
+# End Source File
+# End Target
+# End Project
diff --git a/distrib/sdl-1.2.15/VisualC/tests/testalpha/testalpha.vcproj b/distrib/sdl-1.2.15/VisualC/tests/testalpha/testalpha.vcproj
new file mode 100644
index 0000000..d8258a4
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/testalpha/testalpha.vcproj
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="testalpha"
+ ProjectGUID="{7814D54B-65D3-4677-AD77-E0B980B4FA2D}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/testalpha.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Debug/testalpha.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ OutputFile=".\Debug/testalpha.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/testalpha.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/testalpha.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Release/testalpha.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ OutputFile=".\Release/testalpha.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\Release/testalpha.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\..\Sdl\Debug\SDL.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\Test\testalpha.c"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/distrib/sdl-1.2.15/VisualC/tests/testfile/testfile.dsp b/distrib/sdl-1.2.15/VisualC/tests/testfile/testfile.dsp
new file mode 100644
index 0000000..16bb157
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/testfile/testfile.dsp
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="testfile" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=testfile - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "testfile.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "testfile.mak" CFG="testfile - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "testfile - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "testfile - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "testfile - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+
+!ELSEIF "$(CFG)" == "testfile - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "testfile - Win32 Release"
+# Name "testfile - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\Sdl\Debug\SDL.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\SDLmain\Debug\SDLmain.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Test\testfile.c
+# End Source File
+# End Target
+# End Project
diff --git a/distrib/sdl-1.2.15/VisualC/tests/testfile/testfile.vcproj b/distrib/sdl-1.2.15/VisualC/tests/testfile/testfile.vcproj
new file mode 100644
index 0000000..08b23dc
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/testfile/testfile.vcproj
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="testfile"
+ ProjectGUID="{CAE4F1D0-314F-4B10-805B-0EFD670133A0}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/testfile.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Debug/testfile.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ OutputFile=".\Debug/testfile.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/testfile.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/testfile.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Release/testfile.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ OutputFile=".\Release/testfile.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\Release/testfile.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\..\Sdl\Debug\SDL.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\Test\testfile.c"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/distrib/sdl-1.2.15/VisualC/tests/testgamma/testgamma.dsp b/distrib/sdl-1.2.15/VisualC/tests/testgamma/testgamma.dsp
new file mode 100644
index 0000000..ed3536f
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/testgamma/testgamma.dsp
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="testgamma" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=testgamma - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "testgamma.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "testgamma.mak" CFG="testgamma - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "testgamma - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "testgamma - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "testgamma - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+
+!ELSEIF "$(CFG)" == "testgamma - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "testgamma - Win32 Release"
+# Name "testgamma - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\Sdl\Debug\SDL.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\SDLmain\Debug\SDLmain.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\test\testgamma.c
+# End Source File
+# End Target
+# End Project
diff --git a/distrib/sdl-1.2.15/VisualC/tests/testgamma/testgamma.vcproj b/distrib/sdl-1.2.15/VisualC/tests/testgamma/testgamma.vcproj
new file mode 100644
index 0000000..485d21f
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/testgamma/testgamma.vcproj
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="testgamma"
+ ProjectGUID="{D974A0DF-3E2E-445C-A2EB-E899E9B582CB}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/testgamma.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Debug/testgamma.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ OutputFile=".\Debug/testgamma.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/testgamma.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/testgamma.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Release/testgamma.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ OutputFile=".\Release/testgamma.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\Release/testgamma.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\..\Sdl\Debug\SDL.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\test\testgamma.c"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/distrib/sdl-1.2.15/VisualC/tests/testgl/testgl.dsp b/distrib/sdl-1.2.15/VisualC/tests/testgl/testgl.dsp
new file mode 100644
index 0000000..9b8ad4f
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/testgl/testgl.dsp
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="testgl" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=testgl - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "testgl.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "testgl.mak" CFG="testgl - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "testgl - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "testgl - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "testgl - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_OPENGL" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib opengl32.lib /nologo /subsystem:windows /machine:I386
+
+!ELSEIF "$(CFG)" == "testgl - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_OPENGL" /YX /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib opengl32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "testgl - Win32 Release"
+# Name "testgl - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\Sdl\Debug\SDL.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\SDLmain\Debug\SDLmain.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\test\testgl.c
+# End Source File
+# End Target
+# End Project
diff --git a/distrib/sdl-1.2.15/VisualC/tests/testgl/testgl.vcproj b/distrib/sdl-1.2.15/VisualC/tests/testgl/testgl.vcproj
new file mode 100644
index 0000000..9354497
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/testgl/testgl.vcproj
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="testgl"
+ ProjectGUID="{272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/testgl.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="_DEBUG,WIN32,_WINDOWS,HAVE_OPENGL"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Debug/testgl.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="opengl32.lib"
+ OutputFile=".\Debug/testgl.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/testgl.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/testgl.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="NDEBUG,WIN32,_WINDOWS,HAVE_OPENGL"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Release/testgl.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="opengl32.lib"
+ OutputFile=".\Release/testgl.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\Release/testgl.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\..\Sdl\Debug\SDL.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\test\testgl.c"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/distrib/sdl-1.2.15/VisualC/tests/testjoystick/testjoystick.dsp b/distrib/sdl-1.2.15/VisualC/tests/testjoystick/testjoystick.dsp
new file mode 100644
index 0000000..53705aa
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/testjoystick/testjoystick.dsp
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="testjoystick" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=testjoystick - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "testjoystick.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "testjoystick.mak" CFG="testjoystick - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "testjoystick - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "testjoystick - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "testjoystick - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+
+!ELSEIF "$(CFG)" == "testjoystick - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "testjoystick - Win32 Release"
+# Name "testjoystick - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\Sdl\Debug\SDL.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\SDLmain\Debug\SDLmain.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\test\testjoystick.c
+# End Source File
+# End Target
+# End Project
diff --git a/distrib/sdl-1.2.15/VisualC/tests/testjoystick/testjoystick.vcproj b/distrib/sdl-1.2.15/VisualC/tests/testjoystick/testjoystick.vcproj
new file mode 100644
index 0000000..b470b90
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/testjoystick/testjoystick.vcproj
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="testjoystick"
+ ProjectGUID="{55812185-D13C-4022-9C81-32E0F4A08304}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/testjoystick.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Release/testjoystick.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ OutputFile=".\Release/testjoystick.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\Release/testjoystick.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/testjoystick.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Debug/testjoystick.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ OutputFile=".\Debug/testjoystick.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/testjoystick.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\..\Sdl\Debug\SDL.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\test\testjoystick.c"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/distrib/sdl-1.2.15/VisualC/tests/testpalette/testpalette.dsp b/distrib/sdl-1.2.15/VisualC/tests/testpalette/testpalette.dsp
new file mode 100644
index 0000000..9f9a1cf
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/testpalette/testpalette.dsp
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="testpalette" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=testpalette - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "testpalette.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "testpalette.mak" CFG="testpalette - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "testpalette - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "testpalette - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "testpalette - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+
+!ELSEIF "$(CFG)" == "testpalette - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "testpalette - Win32 Release"
+# Name "testpalette - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\Sdl\Debug\SDL.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\SDLmain\Debug\SDLmain.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\test\testpalette.c
+# End Source File
+# End Target
+# End Project
diff --git a/distrib/sdl-1.2.15/VisualC/tests/testpalette/testpalette.vcproj b/distrib/sdl-1.2.15/VisualC/tests/testpalette/testpalette.vcproj
new file mode 100644
index 0000000..01e1160
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/testpalette/testpalette.vcproj
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="testpalette"
+ ProjectGUID="{493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/testpalette.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Release/testpalette.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ OutputFile=".\Release/testpalette.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\Release/testpalette.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/testpalette.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Debug/testpalette.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ OutputFile=".\Debug/testpalette.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/testpalette.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\..\Sdl\Debug\SDL.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\test\testpalette.c"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/distrib/sdl-1.2.15/VisualC/tests/testplatform/testplatform.dsp b/distrib/sdl-1.2.15/VisualC/tests/testplatform/testplatform.dsp
new file mode 100644
index 0000000..e57b6a7
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/testplatform/testplatform.dsp
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="testplatform" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=testplatform - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "testplatform.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "testplatform.mak" CFG="testplatform - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "testplatform - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "testplatform - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "testplatform - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+
+!ELSEIF "$(CFG)" == "testplatform - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "testplatform - Win32 Release"
+# Name "testplatform - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\Sdl\Debug\SDL.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\SDLmain\Debug\SDLmain.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Test\testplatform.c
+# End Source File
+# End Target
+# End Project
diff --git a/distrib/sdl-1.2.15/VisualC/tests/testplatform/testplatform.vcproj b/distrib/sdl-1.2.15/VisualC/tests/testplatform/testplatform.vcproj
new file mode 100644
index 0000000..50f0c34
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/testplatform/testplatform.vcproj
@@ -0,0 +1,239 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="testplatform"
+ ProjectGUID="{26932B24-EFC6-4E3A-B277-ED653DA37968}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/testplatform.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ PrecompiledHeaderFile=".\Debug/testplatform.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\Debug/testplatform.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/testplatform.pdb"
+ SubSystem="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\Debug/testplatform.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/testplatform.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile=".\Release/testplatform.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile=".\Release/testplatform.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\Release/testplatform.pdb"
+ SubSystem="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\Release/testplatform.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\..\Sdl\Debug\SDL.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\Test\testplatform.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/distrib/sdl-1.2.15/VisualC/tests/tests.dsw b/distrib/sdl-1.2.15/VisualC/tests/tests.dsw
new file mode 100644
index 0000000..aade10a
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/tests.dsw
@@ -0,0 +1,161 @@
+Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "graywin"=".\graywin\graywin.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "loopwave"=".\loopwave\loopwave.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "testalpha"=".\testalpha\testalpha.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "testfile"=".\testfile\testfile.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "testgamma"=".\testgamma\testgamma.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "testgl"=".\testgl\testgl.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "testjoystick"=".\testjoystick\testjoystick.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "testpalette"=".\testpalette\testpalette.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "testplatform"=".\testplatform\testplatform.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "testvidinfo"=".\testvidinfo\testvidinfo.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "testwin"=".\testwin\testwin.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "testwm"=".\testwm\testwm.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/distrib/sdl-1.2.15/VisualC/tests/tests.sln b/distrib/sdl-1.2.15/VisualC/tests/tests.sln
new file mode 100644
index 0000000..70c44fa
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/tests.sln
@@ -0,0 +1,85 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "graywin", "graywin\graywin.vcproj", "{0BCCA0BF-073E-439E-BCE0-C9353C177487}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopwave", "loopwave\loopwave.vcproj", "{AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testalpha", "testalpha\testalpha.vcproj", "{7814D54B-65D3-4677-AD77-E0B980B4FA2D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamma", "testgamma\testgamma.vcproj", "{D974A0DF-3E2E-445C-A2EB-E899E9B582CB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgl", "testgl\testgl.vcproj", "{272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testjoystick", "testjoystick\testjoystick.vcproj", "{55812185-D13C-4022-9C81-32E0F4A08304}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpalette", "testpalette\testpalette.vcproj", "{493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testvidinfo", "testvidinfo\testvidinfo.vcproj", "{575FD095-EDAB-4BD4-B733-CD4A874F6FB0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testwin", "testwin\testwin.vcproj", "{0FFD1A21-11DB-492C-A989-E4F195B0C441}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testwm", "testwm\testwm.vcproj", "{6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testplatform", "testplatform\testplatform.vcproj", "{26932B24-EFC6-4E3A-B277-ED653DA37968}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testfile", "testfile\testfile.vcproj", "{CAE4F1D0-314F-4B10-805B-0EFD670133A0}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {0BCCA0BF-073E-439E-BCE0-C9353C177487}.Debug|Win32.ActiveCfg = Debug|Win32
+ {0BCCA0BF-073E-439E-BCE0-C9353C177487}.Debug|Win32.Build.0 = Debug|Win32
+ {0BCCA0BF-073E-439E-BCE0-C9353C177487}.Release|Win32.ActiveCfg = Release|Win32
+ {0BCCA0BF-073E-439E-BCE0-C9353C177487}.Release|Win32.Build.0 = Release|Win32
+ {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.ActiveCfg = Debug|Win32
+ {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Debug|Win32.Build.0 = Debug|Win32
+ {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.ActiveCfg = Release|Win32
+ {AAAD1CB5-7ADA-47AE-85A0-08A6EC48FAFB}.Release|Win32.Build.0 = Release|Win32
+ {7814D54B-65D3-4677-AD77-E0B980B4FA2D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {7814D54B-65D3-4677-AD77-E0B980B4FA2D}.Debug|Win32.Build.0 = Debug|Win32
+ {7814D54B-65D3-4677-AD77-E0B980B4FA2D}.Release|Win32.ActiveCfg = Release|Win32
+ {7814D54B-65D3-4677-AD77-E0B980B4FA2D}.Release|Win32.Build.0 = Release|Win32
+ {D974A0DF-3E2E-445C-A2EB-E899E9B582CB}.Debug|Win32.ActiveCfg = Debug|Win32
+ {D974A0DF-3E2E-445C-A2EB-E899E9B582CB}.Debug|Win32.Build.0 = Debug|Win32
+ {D974A0DF-3E2E-445C-A2EB-E899E9B582CB}.Release|Win32.ActiveCfg = Release|Win32
+ {D974A0DF-3E2E-445C-A2EB-E899E9B582CB}.Release|Win32.Build.0 = Release|Win32
+ {272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}.Debug|Win32.Build.0 = Debug|Win32
+ {272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}.Release|Win32.ActiveCfg = Release|Win32
+ {272D976B-A1DF-4DEB-BD7F-5C0D330E0C7D}.Release|Win32.Build.0 = Release|Win32
+ {55812185-D13C-4022-9C81-32E0F4A08304}.Debug|Win32.ActiveCfg = Debug|Win32
+ {55812185-D13C-4022-9C81-32E0F4A08304}.Debug|Win32.Build.0 = Debug|Win32
+ {55812185-D13C-4022-9C81-32E0F4A08304}.Release|Win32.ActiveCfg = Release|Win32
+ {55812185-D13C-4022-9C81-32E0F4A08304}.Release|Win32.Build.0 = Release|Win32
+ {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Debug|Win32.ActiveCfg = Debug|Win32
+ {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Debug|Win32.Build.0 = Debug|Win32
+ {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Release|Win32.ActiveCfg = Release|Win32
+ {493A8F38-5DA5-4E2D-B5E9-9E69EE4ED1DC}.Release|Win32.Build.0 = Release|Win32
+ {575FD095-EDAB-4BD4-B733-CD4A874F6FB0}.Debug|Win32.ActiveCfg = Debug|Win32
+ {575FD095-EDAB-4BD4-B733-CD4A874F6FB0}.Debug|Win32.Build.0 = Debug|Win32
+ {575FD095-EDAB-4BD4-B733-CD4A874F6FB0}.Release|Win32.ActiveCfg = Release|Win32
+ {575FD095-EDAB-4BD4-B733-CD4A874F6FB0}.Release|Win32.Build.0 = Release|Win32
+ {0FFD1A21-11DB-492C-A989-E4F195B0C441}.Debug|Win32.ActiveCfg = Debug|Win32
+ {0FFD1A21-11DB-492C-A989-E4F195B0C441}.Debug|Win32.Build.0 = Debug|Win32
+ {0FFD1A21-11DB-492C-A989-E4F195B0C441}.Release|Win32.ActiveCfg = Release|Win32
+ {0FFD1A21-11DB-492C-A989-E4F195B0C441}.Release|Win32.Build.0 = Release|Win32
+ {6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Debug|Win32.ActiveCfg = Debug|Win32
+ {6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Debug|Win32.Build.0 = Debug|Win32
+ {6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Release|Win32.ActiveCfg = Release|Win32
+ {6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}.Release|Win32.Build.0 = Release|Win32
+ {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.ActiveCfg = Debug|Win32
+ {26932B24-EFC6-4E3A-B277-ED653DA37968}.Debug|Win32.Build.0 = Debug|Win32
+ {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.ActiveCfg = Release|Win32
+ {26932B24-EFC6-4E3A-B277-ED653DA37968}.Release|Win32.Build.0 = Release|Win32
+ {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.ActiveCfg = Debug|Win32
+ {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Debug|Win32.Build.0 = Debug|Win32
+ {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.ActiveCfg = Release|Win32
+ {CAE4F1D0-314F-4B10-805B-0EFD670133A0}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/distrib/sdl-1.2.15/VisualC/tests/testvidinfo/testvidinfo.dsp b/distrib/sdl-1.2.15/VisualC/tests/testvidinfo/testvidinfo.dsp
new file mode 100644
index 0000000..28da662
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/testvidinfo/testvidinfo.dsp
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="testvidinfo" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=testvidinfo - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "testvidinfo.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "testvidinfo.mak" CFG="testvidinfo - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "testvidinfo - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "testvidinfo - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "testvidinfo - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+
+!ELSEIF "$(CFG)" == "testvidinfo - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "testvidinfo - Win32 Release"
+# Name "testvidinfo - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\Sdl\Debug\SDL.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\SDLmain\Debug\SDLmain.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Test\testvidinfo.c
+# End Source File
+# End Target
+# End Project
diff --git a/distrib/sdl-1.2.15/VisualC/tests/testvidinfo/testvidinfo.vcproj b/distrib/sdl-1.2.15/VisualC/tests/testvidinfo/testvidinfo.vcproj
new file mode 100644
index 0000000..b0612a3
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/testvidinfo/testvidinfo.vcproj
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="testvidinfo"
+ ProjectGUID="{575FD095-EDAB-4BD4-B733-CD4A874F6FB0}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/testvidinfo.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Release/testvidinfo.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ OutputFile=".\Release/testvidinfo.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\Release/testvidinfo.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/testvidinfo.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Debug/testvidinfo.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ OutputFile=".\Debug/testvidinfo.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/testvidinfo.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\..\Sdl\Debug\SDL.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\Test\testvidinfo.c"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/distrib/sdl-1.2.15/VisualC/tests/testwin/testwin.dsp b/distrib/sdl-1.2.15/VisualC/tests/testwin/testwin.dsp
new file mode 100644
index 0000000..2fe5e89
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/testwin/testwin.dsp
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="testwin" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=testwin - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "testwin.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "testwin.mak" CFG="testwin - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "testwin - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "testwin - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "testwin - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+
+!ELSEIF "$(CFG)" == "testwin - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "testwin - Win32 Release"
+# Name "testwin - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\Sdl\Debug\SDL.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\SDLmain\Debug\SDLmain.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Test\Testwin.c
+# End Source File
+# End Target
+# End Project
diff --git a/distrib/sdl-1.2.15/VisualC/tests/testwin/testwin.vcproj b/distrib/sdl-1.2.15/VisualC/tests/testwin/testwin.vcproj
new file mode 100644
index 0000000..225cda0
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/testwin/testwin.vcproj
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="testwin"
+ ProjectGUID="{0FFD1A21-11DB-492C-A989-E4F195B0C441}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/testwin.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Debug/testwin.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ OutputFile=".\Debug/testwin.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/testwin.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/testwin.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Release/testwin.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ OutputFile=".\Release/testwin.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\Release/testwin.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\..\Sdl\Debug\SDL.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\Test\Testwin.c"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/distrib/sdl-1.2.15/VisualC/tests/testwm/testwm.dsp b/distrib/sdl-1.2.15/VisualC/tests/testwm/testwm.dsp
new file mode 100644
index 0000000..fa76ae4
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/testwm/testwm.dsp
@@ -0,0 +1,102 @@
+# Microsoft Developer Studio Project File - Name="testwm" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=testwm - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "testwm.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "testwm.mak" CFG="testwm - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "testwm - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "testwm - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "testwm - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
+
+!ELSEIF "$(CFG)" == "testwm - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "testwm - Win32 Release"
+# Name "testwm - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\Sdl\Debug\SDL.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\SDLmain\Debug\SDLmain.lib
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\test\testwm.c
+# End Source File
+# End Target
+# End Project
diff --git a/distrib/sdl-1.2.15/VisualC/tests/testwm/testwm.vcproj b/distrib/sdl-1.2.15/VisualC/tests/testwm/testwm.vcproj
new file mode 100644
index 0000000..d7f99e0
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualC/tests/testwm/testwm.vcproj
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="testwm"
+ ProjectGUID="{6AF0724B-BAC1-4C9D-AFBF-F63B4A2FB8FB}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/testwm.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Debug/testwm.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ OutputFile=".\Debug/testwm.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/testwm.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/testwm.tlb"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\..\include"
+ PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=".\Release/testwm.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ OutputFile=".\Release/testwm.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\Release/testwm.pdb"
+ SubSystem="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\..\Sdl\Debug\SDL.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\SDLmain\Debug\SDLmain.lib"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\test\testwm.c"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/distrib/sdl-1.2.15/VisualCE/SDL.sln b/distrib/sdl-1.2.15/VisualCE/SDL.sln
new file mode 100644
index 0000000..7d46d45
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualCE/SDL.sln
@@ -0,0 +1,149 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL", "SDL\SDL.vcproj", "{C598024D-8030-4F9C-AB76-69BF4CA0645F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDLmain", "SDLmain\SDLmain.vcproj", "{5AC88B84-5EAA-4C1E-948D-332DA34227F6}"
+ ProjectSection(ProjectDependencies) = postProject
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F} = {C598024D-8030-4F9C-AB76-69BF4CA0645F}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testalpha", "testalpha\testalpha.vcproj", "{DF401CB3-6F70-4485-996B-B7C357CF7EE7}"
+ ProjectSection(ProjectDependencies) = postProject
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F} = {C598024D-8030-4F9C-AB76-69BF4CA0645F}
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6} = {5AC88B84-5EAA-4C1E-948D-332DA34227F6}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testwin", "testwin\testwin.vcproj", "{DC516978-88CB-4F9A-A39A-C351C258613B}"
+ ProjectSection(ProjectDependencies) = postProject
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F} = {C598024D-8030-4F9C-AB76-69BF4CA0645F}
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6} = {5AC88B84-5EAA-4C1E-948D-332DA34227F6}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loopwave", "loopwave\loopwave.vcproj", "{6F642636-CB11-4DC7-855E-27FE1744003A}"
+ ProjectSection(ProjectDependencies) = postProject
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F} = {C598024D-8030-4F9C-AB76-69BF4CA0645F}
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6} = {5AC88B84-5EAA-4C1E-948D-332DA34227F6}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testtimer", "testtimer\testtimer.vcproj", "{D482D7EE-6FF0-4254-9027-C59F8F03AB1F}"
+ ProjectSection(ProjectDependencies) = postProject
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F} = {C598024D-8030-4F9C-AB76-69BF4CA0645F}
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6} = {5AC88B84-5EAA-4C1E-948D-332DA34227F6}
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Pocket PC 2003 (ARMV4) = Debug|Pocket PC 2003 (ARMV4)
+ Debug|Smartphone 2003 (ARMV4) = Debug|Smartphone 2003 (ARMV4)
+ Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ Release|Pocket PC 2003 (ARMV4) = Release|Pocket PC 2003 (ARMV4)
+ Release|Smartphone 2003 (ARMV4) = Release|Smartphone 2003 (ARMV4)
+ Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4)
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4)
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4)
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Debug|Smartphone 2003 (ARMV4).ActiveCfg = Debug|Smartphone 2003 (ARMV4)
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Debug|Smartphone 2003 (ARMV4).Build.0 = Debug|Smartphone 2003 (ARMV4)
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Debug|Smartphone 2003 (ARMV4).Deploy.0 = Debug|Smartphone 2003 (ARMV4)
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4)
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4)
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4)
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Release|Smartphone 2003 (ARMV4).ActiveCfg = Release|Smartphone 2003 (ARMV4)
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Release|Smartphone 2003 (ARMV4).Build.0 = Release|Smartphone 2003 (ARMV4)
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Release|Smartphone 2003 (ARMV4).Deploy.0 = Release|Smartphone 2003 (ARMV4)
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {C598024D-8030-4F9C-AB76-69BF4CA0645F}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4)
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4)
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4)
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Debug|Smartphone 2003 (ARMV4).ActiveCfg = Debug|Smartphone 2003 (ARMV4)
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Debug|Smartphone 2003 (ARMV4).Build.0 = Debug|Smartphone 2003 (ARMV4)
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Debug|Smartphone 2003 (ARMV4).Deploy.0 = Debug|Smartphone 2003 (ARMV4)
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4)
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4)
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4)
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Release|Smartphone 2003 (ARMV4).ActiveCfg = Release|Smartphone 2003 (ARMV4)
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Release|Smartphone 2003 (ARMV4).Build.0 = Release|Smartphone 2003 (ARMV4)
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Release|Smartphone 2003 (ARMV4).Deploy.0 = Release|Smartphone 2003 (ARMV4)
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {5AC88B84-5EAA-4C1E-948D-332DA34227F6}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4)
+ {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4)
+ {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4)
+ {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Debug|Smartphone 2003 (ARMV4).ActiveCfg = Debug|Smartphone 2003 (ARMV4)
+ {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Debug|Smartphone 2003 (ARMV4).Build.0 = Debug|Smartphone 2003 (ARMV4)
+ {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Debug|Smartphone 2003 (ARMV4).Deploy.0 = Debug|Smartphone 2003 (ARMV4)
+ {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4)
+ {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4)
+ {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4)
+ {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Release|Smartphone 2003 (ARMV4).ActiveCfg = Release|Smartphone 2003 (ARMV4)
+ {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Release|Smartphone 2003 (ARMV4).Build.0 = Release|Smartphone 2003 (ARMV4)
+ {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Release|Smartphone 2003 (ARMV4).Deploy.0 = Release|Smartphone 2003 (ARMV4)
+ {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {DF401CB3-6F70-4485-996B-B7C357CF7EE7}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {DC516978-88CB-4F9A-A39A-C351C258613B}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4)
+ {DC516978-88CB-4F9A-A39A-C351C258613B}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4)
+ {DC516978-88CB-4F9A-A39A-C351C258613B}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4)
+ {DC516978-88CB-4F9A-A39A-C351C258613B}.Debug|Smartphone 2003 (ARMV4).ActiveCfg = Debug|Smartphone 2003 (ARMV4)
+ {DC516978-88CB-4F9A-A39A-C351C258613B}.Debug|Smartphone 2003 (ARMV4).Build.0 = Debug|Smartphone 2003 (ARMV4)
+ {DC516978-88CB-4F9A-A39A-C351C258613B}.Debug|Smartphone 2003 (ARMV4).Deploy.0 = Debug|Smartphone 2003 (ARMV4)
+ {DC516978-88CB-4F9A-A39A-C351C258613B}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {DC516978-88CB-4F9A-A39A-C351C258613B}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {DC516978-88CB-4F9A-A39A-C351C258613B}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {DC516978-88CB-4F9A-A39A-C351C258613B}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4)
+ {DC516978-88CB-4F9A-A39A-C351C258613B}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4)
+ {DC516978-88CB-4F9A-A39A-C351C258613B}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4)
+ {DC516978-88CB-4F9A-A39A-C351C258613B}.Release|Smartphone 2003 (ARMV4).ActiveCfg = Release|Smartphone 2003 (ARMV4)
+ {DC516978-88CB-4F9A-A39A-C351C258613B}.Release|Smartphone 2003 (ARMV4).Build.0 = Release|Smartphone 2003 (ARMV4)
+ {DC516978-88CB-4F9A-A39A-C351C258613B}.Release|Smartphone 2003 (ARMV4).Deploy.0 = Release|Smartphone 2003 (ARMV4)
+ {DC516978-88CB-4F9A-A39A-C351C258613B}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {DC516978-88CB-4F9A-A39A-C351C258613B}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {DC516978-88CB-4F9A-A39A-C351C258613B}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {6F642636-CB11-4DC7-855E-27FE1744003A}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4)
+ {6F642636-CB11-4DC7-855E-27FE1744003A}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4)
+ {6F642636-CB11-4DC7-855E-27FE1744003A}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4)
+ {6F642636-CB11-4DC7-855E-27FE1744003A}.Debug|Smartphone 2003 (ARMV4).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {6F642636-CB11-4DC7-855E-27FE1744003A}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {6F642636-CB11-4DC7-855E-27FE1744003A}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {6F642636-CB11-4DC7-855E-27FE1744003A}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {6F642636-CB11-4DC7-855E-27FE1744003A}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4)
+ {6F642636-CB11-4DC7-855E-27FE1744003A}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4)
+ {6F642636-CB11-4DC7-855E-27FE1744003A}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4)
+ {6F642636-CB11-4DC7-855E-27FE1744003A}.Release|Smartphone 2003 (ARMV4).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {6F642636-CB11-4DC7-855E-27FE1744003A}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {6F642636-CB11-4DC7-855E-27FE1744003A}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {6F642636-CB11-4DC7-855E-27FE1744003A}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4)
+ {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4)
+ {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4)
+ {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Debug|Smartphone 2003 (ARMV4).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4)
+ {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4)
+ {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4)
+ {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Release|Smartphone 2003 (ARMV4).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {D482D7EE-6FF0-4254-9027-C59F8F03AB1F}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/distrib/sdl-1.2.15/VisualCE/SDL.vcw b/distrib/sdl-1.2.15/VisualCE/SDL.vcw
new file mode 100644
index 0000000..db10093
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualCE/SDL.vcw
@@ -0,0 +1,116 @@
+Microsoft eMbedded Visual Tools Workspace File, Format Version 3.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "loopwave"=.\loopwave\loopwave.vcp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name SDL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name SDLmain
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "SDL"=.\SDL\SDL.VCP - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "SDLmain"=.\SDLmain\SDLmain.vcp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name SDL
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "testtimer"=.\testtimer\testtimer.vcp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name SDL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name SDLmain
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "testalpha"=.\testalpha\testalpha.vcp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name SDL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name SDLmain
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "testwin"=.\testwin\testwin.vcp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name SDL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name SDLmain
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/distrib/sdl-1.2.15/VisualCE/SDL/SDL.vcp b/distrib/sdl-1.2.15/VisualCE/SDL/SDL.vcp
new file mode 100644
index 0000000..833cae4
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualCE/SDL/SDL.vcp
@@ -0,0 +1,42066 @@
+# Microsoft eMbedded Visual Tools Project File - Name="SDL" - Package Owner=<4>
+# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (WCE MIPSIV) Dynamic-Link Library" 0x9602
+# TARGTYPE "Win32 (WCE ARMV4T) Dynamic-Link Library" 0xa402
+# TARGTYPE "Win32 (WCE MIPSIV_FP) Dynamic-Link Library" 0x9202
+# TARGTYPE "Win32 (WCE SH3) Dynamic-Link Library" 0x8102
+# TARGTYPE "Win32 (WCE MIPSII_FP) Dynamic-Link Library" 0xa202
+# TARGTYPE "Win32 (WCE x86) Dynamic-Link Library" 0x8302
+# TARGTYPE "Win32 (WCE ARM) Dynamic-Link Library" 0x8502
+# TARGTYPE "Win32 (WCE emulator) Dynamic-Link Library" 0xa602
+# TARGTYPE "Win32 (WCE SH4) Dynamic-Link Library" 0x8602
+# TARGTYPE "Win32 (WCE ARMV4) Dynamic-Link Library" 0xa302
+# TARGTYPE "Win32 (WCE MIPS) Dynamic-Link Library" 0x8202
+# TARGTYPE "Win32 (WCE MIPS16) Dynamic-Link Library" 0x8902
+# TARGTYPE "Win32 (WCE ARMV4I) Dynamic-Link Library" 0xa502
+# TARGTYPE "Win32 (WCE MIPSII) Dynamic-Link Library" 0xa102
+
+CFG=SDL - Win32 (WCE MIPSII_FP) Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "SDL.VCN".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "SDL.VCN" CFG="SDL - Win32 (WCE MIPSII_FP) Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "SDL - Win32 (WCE MIPSII_FP) Release" (based on "Win32 (WCE MIPSII_FP) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE MIPSII_FP) Debug" (based on "Win32 (WCE MIPSII_FP) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE MIPSII) Release" (based on "Win32 (WCE MIPSII) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE MIPSII) Debug" (based on "Win32 (WCE MIPSII) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE SH4) Release" (based on "Win32 (WCE SH4) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE SH4) Debug" (based on "Win32 (WCE SH4) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE SH3) Debug" (based on "Win32 (WCE SH3) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE MIPSIV) Release" (based on "Win32 (WCE MIPSIV) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE MIPSIV) Debug" (based on "Win32 (WCE MIPSIV) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE emulator) Release" (based on "Win32 (WCE emulator) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE emulator) Debug" (based on "Win32 (WCE emulator) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE ARMV4I) Release" (based on "Win32 (WCE ARMV4I) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE ARMV4I) Debug" (based on "Win32 (WCE ARMV4I) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE MIPSIV_FP) Release" (based on "Win32 (WCE MIPSIV_FP) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE MIPSIV_FP) Debug" (based on "Win32 (WCE MIPSIV_FP) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE ARMV4) Release" (based on "Win32 (WCE ARMV4) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE ARMV4) Debug" (based on "Win32 (WCE ARMV4) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE MIPS16) Release" (based on "Win32 (WCE MIPS16) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE MIPS16) Debug" (based on "Win32 (WCE MIPS16) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE ARMV4T) Release" (based on "Win32 (WCE ARMV4T) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE ARMV4T) Debug" (based on "Win32 (WCE ARMV4T) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE x86) Release" (based on "Win32 (WCE x86) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE x86) Debug" (based on "Win32 (WCE x86) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE MIPS) Debug" (based on "Win32 (WCE MIPS) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE MIPS) Release" (based on "Win32 (WCE MIPS) Dynamic-Link Library")
+!MESSAGE "SDL - Win32 (WCE SH3) Release" (based on "Win32 (WCE SH3) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+# PROP ATL_Project 2
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "MIPSII_FPRel"
+# PROP BASE Intermediate_Dir "MIPSII_FPRel"
+# PROP BASE CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "MIPSII_FPRel"
+# PROP Intermediate_Dir "MIPSII_FPRel"
+# PROP CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "SDL_EXPORTS" /YX /QMmips2 /QMFPE- /O2 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D "NDEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QMmips2 /QMFPE- /M$(CECrtMT) /c
+# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /d "MIPSII_FP" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /d "MIPSII_FP" /r
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "MIPSII_FPDbg"
+# PROP BASE Intermediate_Dir "MIPSII_FPDbg"
+# PROP BASE CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "MIPSII_FPDbg"
+# PROP Intermediate_Dir "MIPSII_FPDbg"
+# PROP CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /YX /QMmips2 /QMFPE- /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QMmips2 /QMFPE- /M$(CECrtMTDebug) /c
+# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /d "MIPSII_FP" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /d "MIPSII_FP" /r
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "MIPSIIRel"
+# PROP BASE Intermediate_Dir "MIPSIIRel"
+# PROP BASE CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "MIPSIIRel"
+# PROP Intermediate_Dir "MIPSIIRel"
+# PROP CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "SDL_EXPORTS" /YX /QMmips2 /QMFPE /O2 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "NDEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QMmips2 /QMFPE /M$(CECrtMT) /c
+# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /r
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "MIPSIIDbg"
+# PROP BASE Intermediate_Dir "MIPSIIDbg"
+# PROP BASE CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "MIPSIIDbg"
+# PROP Intermediate_Dir "MIPSIIDbg"
+# PROP CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /YX /QMmips2 /QMFPE /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QMmips2 /QMFPE /M$(CECrtMTDebug) /c
+# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /r
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "SH4Rel"
+# PROP BASE Intermediate_Dir "SH4Rel"
+# PROP BASE CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "SH4Rel"
+# PROP Intermediate_Dir "SH4Rel"
+# PROP CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "SHx" /d "SH4" /d "_SH4_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "SHx" /d "SH4" /d "_SH4_" /r
+CPP=shcl.exe
+# ADD BASE CPP /nologo /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "SDL_EXPORTS" /YX /Qsh4 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /O2 /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "SHx" /D "SH4" /D "_SH4_" /D "NDEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /Oxt /Qsh4 /M$(CECrtMT) /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH4
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH4
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "SH4Dbg"
+# PROP BASE Intermediate_Dir "SH4Dbg"
+# PROP BASE CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "SH4Dbg"
+# PROP Intermediate_Dir "SH4Dbg"
+# PROP CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "SHx" /d "SH4" /d "_SH4_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "SHx" /d "SH4" /d "_SH4_" /r
+CPP=shcl.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /YX /Qsh4 /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "DEBUG" /D "SHx" /D "SH4" /D "_SH4_" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /Qsh4 /M$(CECrtMTDebug) /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH4
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH4
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "SH3Dbg"
+# PROP BASE Intermediate_Dir "SH3Dbg"
+# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "SH3Dbg"
+# PROP Intermediate_Dir "SH3Dbg"
+# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r
+CPP=shcl.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /YX /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /I "../../src/video/windib" /I "../../src/video/gapi" /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /M$(CECrtMTDebug) /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "MIPSIVRel"
+# PROP BASE Intermediate_Dir "MIPSIVRel"
+# PROP BASE CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "MIPSIVRel"
+# PROP Intermediate_Dir "MIPSIVRel"
+# PROP CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPSFPU
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPSFPU
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "SDL_EXPORTS" /YX /QMmips4 /QMn32 /QMFPE /O2 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "NDEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QMmips4 /QMn32 /QMFPE /M$(CECrtMT) /c
+# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "MIPSIVDbg"
+# PROP BASE Intermediate_Dir "MIPSIVDbg"
+# PROP BASE CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "MIPSIVDbg"
+# PROP Intermediate_Dir "MIPSIVDbg"
+# PROP CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPSFPU
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPSFPU
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /YX /QMmips4 /QMn32 /QMFPE /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QMmips4 /QMn32 /QMFPE /M$(CECrtMTDebug) /c
+# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "emulatorRel"
+# PROP BASE Intermediate_Dir "emulatorRel"
+# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "emulatorRel"
+# PROP Intermediate_Dir "emulatorRel"
+# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "SDL_EXPORTS" /YX /Gs8192 /GF /O2 /c
+# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "_i386_" /D "_X86_" /D "x86" /D "NDEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /Gs8192 /GF /c
+# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "emulatorDbg"
+# PROP BASE Intermediate_Dir "emulatorDbg"
+# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "emulatorDbg"
+# PROP Intermediate_Dir "emulatorDbg"
+# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "SDL_EXPORTS" /YX /Gs8192 /GF /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /I "../../src/video/windib" /I "../../src/video/gapi" /D "DEBUG" /D "_i386_" /D "_X86_" /D "x86" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /Gs8192 /GF /c
+# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ARMV4IRel"
+# PROP BASE Intermediate_Dir "ARMV4IRel"
+# PROP BASE CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ARMV4IRel"
+# PROP Intermediate_Dir "ARMV4IRel"
+# PROP CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:THUMB
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:THUMB
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "ARMV4I" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "SDL_EXPORTS" /YX /QRarch4T /QRinterwork-return /O2 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "ARM" /D "_ARM_" /D "ARMV4I" /D "NDEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QRarch4T /QRinterwork-return /M$(CECrtMT) /c
+# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "THUMB" /d "_THUMB_" /d "ARM" /d "_ARM_" /d "ARMV4I" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "THUMB" /d "_THUMB_" /d "ARM" /d "_ARM_" /d "ARMV4I" /r
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "ARMV4IDbg"
+# PROP BASE Intermediate_Dir "ARMV4IDbg"
+# PROP BASE CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "ARMV4IDbg"
+# PROP Intermediate_Dir "ARMV4IDbg"
+# PROP CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:THUMB
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:THUMB
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "ARMV4I" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /YX /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4I" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c
+# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "THUMB" /d "_THUMB_" /d "ARM" /d "_ARM_" /d "ARMV4I" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "THUMB" /d "_THUMB_" /d "ARM" /d "_ARM_" /d "ARMV4I" /r
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "MIPSIV_FPRel"
+# PROP BASE Intermediate_Dir "MIPSIV_FPRel"
+# PROP BASE CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "MIPSIV_FPRel"
+# PROP Intermediate_Dir "MIPSIV_FPRel"
+# PROP CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPSFPU
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPSFPU
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "SDL_EXPORTS" /YX /QMmips4 /QMn32 /QMFPE- /O2 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D "NDEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QMmips4 /QMn32 /QMFPE- /M$(CECrtMT) /c
+# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "MIPSIV_FPDbg"
+# PROP BASE Intermediate_Dir "MIPSIV_FPDbg"
+# PROP BASE CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "MIPSIV_FPDbg"
+# PROP Intermediate_Dir "MIPSIV_FPDbg"
+# PROP CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPSFPU
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPSFPU
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /YX /QMmips4 /QMn32 /QMFPE- /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QMmips4 /QMn32 /QMFPE- /M$(CECrtMTDebug) /c
+# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ARMV4Rel"
+# PROP BASE Intermediate_Dir "ARMV4Rel"
+# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ARMV4Rel"
+# PROP Intermediate_Dir "ARMV4Rel"
+# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "SDL_EXPORTS" /YX /O2 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /I "../../src/video/windib" /I "../../src/video/gapi" /D "ARM" /D "_ARM_" /D "ARMV4" /D "NDEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /M$(CECrtMT) /c
+# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "ARMV4Dbg"
+# PROP BASE Intermediate_Dir "ARMV4Dbg"
+# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "ARMV4Dbg"
+# PROP Intermediate_Dir "ARMV4Dbg"
+# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /YX /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /I "../../src/video/windib" /I "../../src/video/gapi" /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /M$(CECrtMTDebug) /c
+# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "MIPS16Rel"
+# PROP BASE Intermediate_Dir "MIPS16Rel"
+# PROP BASE CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "MIPS16Rel"
+# PROP Intermediate_Dir "MIPS16Rel"
+# PROP CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "MIPS16SUPPORT" /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /d "MIPS16" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "MIPS16SUPPORT" /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /d "MIPS16" /r
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_MIPS16_" /D "MIPS16SUPPORT" /D "SDL_EXPORTS" /YX /QMmips16 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D "NDEBUG" /D "_MIPS16_" /D "MIPS16SUPPORT" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /Oxt /QMmips16 /M$(CECrtMT) /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS16 /ALIGN:4096
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS16 /ALIGN:4096
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "MIPS16Dbg"
+# PROP BASE Intermediate_Dir "MIPS16Dbg"
+# PROP BASE CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "MIPS16Dbg"
+# PROP Intermediate_Dir "MIPS16Dbg"
+# PROP CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "MIPS16SUPPORT" /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /d "MIPS16" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "MIPS16SUPPORT" /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /d "R4000" /d "MIPSII" /d "MIPS16" /r
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_MIPS16_" /D "MIPS16SUPPORT" /D "SDL_EXPORTS" /YX /QMmips16 /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D "_MIPS16_" /D "MIPS16SUPPORT" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QMmips16 /M$(CECrtMTDebug) /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS16 /ALIGN:4096
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS16 /ALIGN:4096
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ARMV4TRel"
+# PROP BASE Intermediate_Dir "ARMV4TRel"
+# PROP BASE CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ARMV4TRel"
+# PROP Intermediate_Dir "ARMV4TRel"
+# PROP CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:THUMB
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:THUMB
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+CPP=clthumb.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "SDL_EXPORTS" /YX /QRarch4T /QRinterwork-return /O2 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "ARM" /D "_ARM_" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D "NDEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QRarch4T /QRinterwork-return /M$(CECrtMT) /c
+# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "THUMB" /d "_THUMB_" /d "ARM" /d "_ARM_" /d "ARMV4T" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "THUMB" /d "_THUMB_" /d "ARM" /d "_ARM_" /d "ARMV4T" /r
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "ARMV4TDbg"
+# PROP BASE Intermediate_Dir "ARMV4TDbg"
+# PROP BASE CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "ARMV4TDbg"
+# PROP Intermediate_Dir "ARMV4TDbg"
+# PROP CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:THUMB
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:THUMB
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+CPP=clthumb.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /YX /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "DEBUG" /D "ARM" /D "_ARM_" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c
+# SUBTRACT CPP /YX
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "THUMB" /d "_THUMB_" /d "ARM" /d "_ARM_" /d "ARMV4T" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "THUMB" /d "_THUMB_" /d "ARM" /d "_ARM_" /d "ARMV4T" /r
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "X86Rel"
+# PROP BASE Intermediate_Dir "X86Rel"
+# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "X86Rel"
+# PROP Intermediate_Dir "X86Rel"
+# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "SDL_EXPORTS" /YX /Gs8192 /GF /c
+# ADD CPP /nologo /W3 /O2 /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "_i386_" /D "_X86_" /D "x86" /D "NDEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /Gs8192 /Oxt /GF /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "X86Dbg"
+# PROP BASE Intermediate_Dir "X86Dbg"
+# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "X86Dbg"
+# PROP Intermediate_Dir "X86Dbg"
+# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "SDL_EXPORTS" /YX /Gs8192 /GF /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /D "DEBUG" /D "_i386_" /D "_X86_" /D "x86" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "SDL_EXPORTS" /Gs8192 /GF /c
+# SUBTRACT CPP /YX
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "ARMDbg"
+# PROP BASE Intermediate_Dir "ARMDbg"
+# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "ARMDbg"
+# PROP Intermediate_Dir "ARMDbg"
+# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /I "../../src/video/windib" /I "../../src/video/gapi" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ARMRel"
+# PROP BASE Intermediate_Dir "ARMRel"
+# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ARMRel"
+# PROP Intermediate_Dir "ARMRel"
+# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /O2 /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /I "../../src/video/windib" /I "../../src/video/gapi" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "MIPSDbg"
+# PROP BASE Intermediate_Dir "MIPSDbg"
+# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "MIPSDbg"
+# PROP Intermediate_Dir "MIPSDbg"
+# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /I "../../src/video/windib" /I "../../src/video/gapi" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "MIPSRel"
+# PROP BASE Intermediate_Dir "MIPSRel"
+# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "MIPSRel"
+# PROP Intermediate_Dir "MIPSRel"
+# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /O2 /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /I "../../src/video/windib" /I "../../src/video/gapi" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "SH3Rel"
+# PROP BASE Intermediate_Dir "SH3Rel"
+# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "SH3Rel"
+# PROP Intermediate_Dir "SH3Rel"
+# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r
+CPP=shcl.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /O2 /Ob2 /I "../../include" /I "../../src" /I "../../src/video" /I "../../src/thread" /I "../../src/thread/generic" /I "../../src/audio" /I "../../src/cdrom" /I "../../src/timer" /I "../../src/joystick" /I "../../src/events" /I "../../src/video/wincommon" /I "../../src/video/windib" /I "../../src/video/gapi" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00100000" /stack:0x10000,0x1000 /entry:"_DllMainCRTStartup" /dll /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3
+
+!ENDIF
+
+# Begin Target
+
+# Name "SDL - Win32 (WCE MIPSII_FP) Release"
+# Name "SDL - Win32 (WCE MIPSII_FP) Debug"
+# Name "SDL - Win32 (WCE MIPSII) Release"
+# Name "SDL - Win32 (WCE MIPSII) Debug"
+# Name "SDL - Win32 (WCE SH4) Release"
+# Name "SDL - Win32 (WCE SH4) Debug"
+# Name "SDL - Win32 (WCE SH3) Debug"
+# Name "SDL - Win32 (WCE MIPSIV) Release"
+# Name "SDL - Win32 (WCE MIPSIV) Debug"
+# Name "SDL - Win32 (WCE emulator) Release"
+# Name "SDL - Win32 (WCE emulator) Debug"
+# Name "SDL - Win32 (WCE ARMV4I) Release"
+# Name "SDL - Win32 (WCE ARMV4I) Debug"
+# Name "SDL - Win32 (WCE MIPSIV_FP) Release"
+# Name "SDL - Win32 (WCE MIPSIV_FP) Debug"
+# Name "SDL - Win32 (WCE ARMV4) Release"
+# Name "SDL - Win32 (WCE ARMV4) Debug"
+# Name "SDL - Win32 (WCE MIPS16) Release"
+# Name "SDL - Win32 (WCE MIPS16) Debug"
+# Name "SDL - Win32 (WCE ARMV4T) Release"
+# Name "SDL - Win32 (WCE ARMV4T) Debug"
+# Name "SDL - Win32 (WCE x86) Release"
+# Name "SDL - Win32 (WCE x86) Debug"
+# Name "SDL - Win32 (WCE ARM) Debug"
+# Name "SDL - Win32 (WCE ARM) Release"
+# Name "SDL - Win32 (WCE MIPS) Debug"
+# Name "SDL - Win32 (WCE MIPS) Release"
+# Name "SDL - Win32 (WCE SH3) Release"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\src\SDL.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_C=\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ "..\include\SDL_endian.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_C=\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ "..\include\SDL_endian.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_C=\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ "..\include\SDL_endian.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_C=\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ "..\include\SDL_endian.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_C=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_C=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_C=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_C=\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ "..\include\SDL_endian.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_C=\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ "..\include\SDL_endian.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_C=\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ "..\include\SDL_endian.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_C=\
+ "..\..\include\SDL.h"\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_C=\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ "..\include\SDL_endian.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_C=\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ "..\include\SDL_endian.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_C=\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ "..\include\SDL_endian.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_C=\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ "..\include\SDL_endian.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_C=\
+ "..\..\include\SDL.h"\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_C=\
+ "..\..\include\SDL.h"\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_C=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_C=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_C=\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ "..\include\SDL_endian.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_C=\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ "..\include\SDL_endian.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_C=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_C=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_C=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_C=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_C=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_getenv.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_C=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+NODEP_CPP_SDL_C=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_getenv.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_C=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\SDL_fatal.h"\
+ "..\..\src\video\SDL_leaks.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\events\SDL_active.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_A=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_A=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_A=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_A=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_A=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_A=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_A=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_audio.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_AU=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ "..\include\SDL_thread.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_AU=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ "..\include\SDL_thread.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_AU=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ "..\include\SDL_thread.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_AU=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ "..\include\SDL_thread.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_AU=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_AU=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_AU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_AU=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ "..\include\SDL_thread.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_AU=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ "..\include\SDL_thread.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_AU=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ "..\include\SDL_thread.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_AU=\
+ "..\..\include\SDL.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_AU=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ "..\include\SDL_thread.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_AU=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ "..\include\SDL_thread.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_AU=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ "..\include\SDL_thread.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_AU=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ "..\include\SDL_thread.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_AU=\
+ "..\..\include\SDL.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_AU=\
+ "..\..\include\SDL.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_AU=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_AU=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_AU=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ "..\include\SDL_thread.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_AU=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ "..\include\SDL_thread.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_AU=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_AU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_AU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_AU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_AU=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_getenv.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_AU=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_AU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_getenv.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_AU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_audiocvt.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_AUD=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_AUD=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_AUD=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_AUD=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_AUD=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_AUD=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_AUD=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+NODEP_CPP_SDL_AUD=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_AUD=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_AUD=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_AUD=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_AUD=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+NODEP_CPP_SDL_AUD=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+NODEP_CPP_SDL_AUD=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_AUD=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_AUD=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+
+NODEP_CPP_SDL_AUD=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+
+NODEP_CPP_SDL_AUD=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+
+NODEP_CPP_SDL_AUD=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_AUD=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_audiodev.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+NODEP_CPP_SDL_AUDI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+NODEP_CPP_SDL_AUDI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+NODEP_CPP_SDL_AUDI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+NODEP_CPP_SDL_AUDI=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_AUDI=\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_blit.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_B=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_B=\
+ "..\..\src\video\SDL_memops.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_blit_0.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+NODEP_CPP_SDL_BL=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+NODEP_CPP_SDL_BL=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+NODEP_CPP_SDL_BL=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+NODEP_CPP_SDL_BL=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_BL=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_BL=\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_BL=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_BL=\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_BL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+NODEP_CPP_SDL_BL=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+NODEP_CPP_SDL_BL=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+NODEP_CPP_SDL_BL=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+NODEP_CPP_SDL_BL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+NODEP_CPP_SDL_BL=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+NODEP_CPP_SDL_BL=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+NODEP_CPP_SDL_BL=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+NODEP_CPP_SDL_BL=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+NODEP_CPP_SDL_BL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+NODEP_CPP_SDL_BL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_BL=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_BL=\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_BL=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_BL=\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+NODEP_CPP_SDL_BL=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+NODEP_CPP_SDL_BL=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_BL=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_BL=\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_BL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_BL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_BL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_BL=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_BL=\
+ "..\..\include\SDL_endian.h"\
+
+NODEP_CPP_SDL_BL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_BL=\
+ "..\..\include\SDL_endian.h"\
+
+NODEP_CPP_SDL_BL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_BL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_blit_1.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_BLI=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_BLI=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_BLI=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_BLI=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_BLI=\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_BLI=\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_BLI=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_BLI=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_BLI=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_BLI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_BLI=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_BLI=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_BLI=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_BLI=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_BLI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_BLI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_BLI=\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_BLI=\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_BLI=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_BLI=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_BLI=\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_BLI=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_BLI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_BLI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_BLI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_blit_A.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\src\video\mmx.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\src\video\mmx.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\src\video\mmx.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\src\video\mmx.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\src\video\mmx.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\src\video\mmx.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\src\video\mmx.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\src\video\mmx.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\src\video\mmx.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\src\video\mmx.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\src\video\mmx.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\src\video\mmx.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\src\video\mmx.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\src\video\mmx.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\src\video\mmx.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\src\video\mmx.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\mmx.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\mmx.h"\
+
+NODEP_CPP_SDL_BLIT=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_BLIT=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_blit_N.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_BLIT_=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_BLIT_=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_BLIT_=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_BLIT_=\
+ "..\..\src\hermes\HeadMMX.h"\
+ "..\..\src\hermes\HeadX86.h"\
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_BLIT_=\
+ "..\..\src\hermes\HeadMMX.h"\
+ "..\..\src\hermes\HeadX86.h"\
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_BLIT_=\
+ "..\..\src\hermes\HeadMMX.h"\
+ "..\..\src\hermes\HeadX86.h"\
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_BLIT_=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_BLIT_=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_BLIT_=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_BLIT_=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\hermes\HeadMMX.h"\
+ "..\..\src\hermes\HeadX86.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_BLIT_=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\hermes\HeadMMX.h"\
+ "..\..\src\hermes\HeadX86.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_BLIT_=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\hermes\HeadMMX.h"\
+ "..\..\src\hermes\HeadX86.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_BLIT_=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_BLIT_=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_BLIT_=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_BLIT_=\
+ "..\..\src\video\HeadMMX.h"\
+ "..\..\src\video\HeadX86.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_bmp.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+NODEP_CPP_SDL_BM=\
+ "..\include\SDL_endian.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+NODEP_CPP_SDL_BM=\
+ "..\include\SDL_endian.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+NODEP_CPP_SDL_BM=\
+ "..\include\SDL_endian.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+NODEP_CPP_SDL_BM=\
+ "..\include\SDL_endian.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_BM=\
+ "..\..\include\SDL_endian.h"\
+
+NODEP_CPP_SDL_BM=\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_BM=\
+ "..\..\include\SDL_endian.h"\
+
+NODEP_CPP_SDL_BM=\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_BM=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+NODEP_CPP_SDL_BM=\
+ "..\include\SDL_endian.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+NODEP_CPP_SDL_BM=\
+ "..\include\SDL_endian.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+NODEP_CPP_SDL_BM=\
+ "..\include\SDL_endian.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+NODEP_CPP_SDL_BM=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+NODEP_CPP_SDL_BM=\
+ "..\include\SDL_endian.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+NODEP_CPP_SDL_BM=\
+ "..\include\SDL_endian.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+NODEP_CPP_SDL_BM=\
+ "..\include\SDL_endian.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+NODEP_CPP_SDL_BM=\
+ "..\include\SDL_endian.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+NODEP_CPP_SDL_BM=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+NODEP_CPP_SDL_BM=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_BM=\
+ "..\..\include\SDL_endian.h"\
+
+NODEP_CPP_SDL_BM=\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_BM=\
+ "..\..\include\SDL_endian.h"\
+
+NODEP_CPP_SDL_BM=\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+NODEP_CPP_SDL_BM=\
+ "..\include\SDL_endian.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+NODEP_CPP_SDL_BM=\
+ "..\include\SDL_endian.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_BM=\
+ "..\..\include\SDL_endian.h"\
+
+NODEP_CPP_SDL_BM=\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_BM=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_BM=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_BM=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+
+NODEP_CPP_SDL_BM=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_BM=\
+ "..\..\include\SDL_endian.h"\
+
+NODEP_CPP_SDL_BM=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_BM=\
+ "..\..\include\SDL_endian.h"\
+
+NODEP_CPP_SDL_BM=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_BM=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\cpuinfo\SDL_cpuinfo.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+NODEP_CPP_SDL_CP=\
+ "..\include\SDL_cpuinfo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+NODEP_CPP_SDL_CP=\
+ "..\include\SDL_cpuinfo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+NODEP_CPP_SDL_CP=\
+ "..\include\SDL_cpuinfo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+NODEP_CPP_SDL_CP=\
+ "..\include\SDL_cpuinfo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_CP=\
+ "..\..\include\SDL_cpuinfo.h"\
+
+NODEP_CPP_SDL_CP=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_CP=\
+ "..\..\include\SDL_cpuinfo.h"\
+
+NODEP_CPP_SDL_CP=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_CP=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+NODEP_CPP_SDL_CP=\
+ "..\include\SDL_cpuinfo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+NODEP_CPP_SDL_CP=\
+ "..\include\SDL_cpuinfo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+NODEP_CPP_SDL_CP=\
+ "..\include\SDL_cpuinfo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_CP=\
+ "..\..\include\SDL.h"\
+
+NODEP_CPP_SDL_CP=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+NODEP_CPP_SDL_CP=\
+ "..\include\SDL_cpuinfo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+NODEP_CPP_SDL_CP=\
+ "..\include\SDL_cpuinfo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+NODEP_CPP_SDL_CP=\
+ "..\include\SDL_cpuinfo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+NODEP_CPP_SDL_CP=\
+ "..\include\SDL_cpuinfo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_CP=\
+ "..\..\include\SDL.h"\
+
+NODEP_CPP_SDL_CP=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_CP=\
+ "..\..\include\SDL.h"\
+
+NODEP_CPP_SDL_CP=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_CP=\
+ "..\..\include\SDL_cpuinfo.h"\
+
+NODEP_CPP_SDL_CP=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_CP=\
+ "..\..\include\SDL_cpuinfo.h"\
+
+NODEP_CPP_SDL_CP=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+NODEP_CPP_SDL_CP=\
+ "..\include\SDL_cpuinfo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+NODEP_CPP_SDL_CP=\
+ "..\include\SDL_cpuinfo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_CP=\
+ "..\..\include\SDL_cpuinfo.h"\
+
+NODEP_CPP_SDL_CP=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_CP=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_CP=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_CP=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+
+NODEP_CPP_SDL_CP=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_CP=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+
+NODEP_CPP_SDL_CP=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_getenv.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_CP=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+
+NODEP_CPP_SDL_CP=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_getenv.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_CP=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_cursor.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_CU=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_CU=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_CU=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_CU=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_CU=\
+ ".\DL_active.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_CU=\
+ ".\DL_active.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_CU=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_CU=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_CU=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_CU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_CU=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_CU=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_CU=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_CU=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_CU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_CU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_CU=\
+ ".\DL_active.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_CU=\
+ ".\DL_active.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_CU=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_CU=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_CU=\
+ ".\DL_active.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_CU=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_CU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_CU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_CU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\default_cursor.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\windib\SDL_dibaudio.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_D=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_D=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_D=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_D=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_D=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_D=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_D=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_D=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_D=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_D=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_D=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_D=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_D=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_D=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_D=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_D=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_D=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_D=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_D=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_D=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_D=\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_D=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_D=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_D=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_D=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_D=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_D=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_D=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+ "..\..\src\audio\windib\SDL_dibaudio.h"\
+
+NODEP_CPP_SDL_D=\
+ "..\..\src\audio\windib\win_ce_semaphore.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\windib\SDL_dibevents.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+NODEP_CPP_SDL_DI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_DI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+ "..\..\src\video\windib\SDL_vkeys.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\windib\SDL_dibvideo.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_getenv.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+NODEP_CPP_SDL_DIB=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_getenv.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_DIB=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+ "..\..\src\video\windib\SDL_dibvideo.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\disk\SDL_diskaudio.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_DIS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\disk\SDL_diskaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_DIS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\disk\SDL_diskaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_DIS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\disk\SDL_diskaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_DIS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\disk\SDL_diskaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_DIS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\disk\SDL_diskaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_DIS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\disk\SDL_diskaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_DIS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\disk\SDL_diskaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_DIS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\disk\SDL_diskaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_DIS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\disk\SDL_diskaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_DIS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\disk\SDL_diskaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_DIS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\disk\SDL_diskaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_DIS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\disk\SDL_diskaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\dummy\SDL_dummyaudio.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_DU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\dummy\SDL_dummyaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_DU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\dummy\SDL_dummyaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_DU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\dummy\SDL_dummyaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_DU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\dummy\SDL_dummyaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_DU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\dummy\SDL_dummyaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_DU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\dummy\SDL_dummyaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_DU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\dummy\SDL_dummyaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_DU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\dummy\SDL_dummyaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_DU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\dummy\SDL_dummyaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_DU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\dummy\SDL_dummyaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_DU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\dummy\SDL_dummyaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_DU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\dummy\SDL_dummyaudio.h"\
+ "..\..\src\audio\SDL_audio_c.h"\
+ "..\..\src\audio\SDL_audiodev_c.h"\
+ "..\..\src\audio\SDL_audiomem.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\SDL_error.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+NODEP_CPP_SDL_E=\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+NODEP_CPP_SDL_E=\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+NODEP_CPP_SDL_E=\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+NODEP_CPP_SDL_E=\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_E=\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+
+NODEP_CPP_SDL_E=\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_E=\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+
+NODEP_CPP_SDL_E=\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_E=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+NODEP_CPP_SDL_E=\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+NODEP_CPP_SDL_E=\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+NODEP_CPP_SDL_E=\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+NODEP_CPP_SDL_E=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\src\SDL_error_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+NODEP_CPP_SDL_E=\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+NODEP_CPP_SDL_E=\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+NODEP_CPP_SDL_E=\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+NODEP_CPP_SDL_E=\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+NODEP_CPP_SDL_E=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\src\SDL_error_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+NODEP_CPP_SDL_E=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\src\SDL_error_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_E=\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+
+NODEP_CPP_SDL_E=\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_E=\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+
+NODEP_CPP_SDL_E=\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+NODEP_CPP_SDL_E=\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+NODEP_CPP_SDL_E=\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_E=\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+
+NODEP_CPP_SDL_E=\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_E=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\src\SDL_error_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_E=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\src\SDL_error_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_E=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\src\SDL_error_c.h"\
+
+NODEP_CPP_SDL_E=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_E=\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+
+NODEP_CPP_SDL_E=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_getenv.h"\
+ "..\include\SDL_types.h"\
+ "..\src\thread\SDL_thread_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_E=\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+
+NODEP_CPP_SDL_E=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_getenv.h"\
+ "..\include\SDL_types.h"\
+ "..\src\thread\SDL_thread_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_E=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\events\SDL_events.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_EV=\
+ "..\include\SDL_thread.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_EV=\
+ "..\include\SDL_thread.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_EV=\
+ "..\include\SDL_thread.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_EV=\
+ "..\include\SDL_thread.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_EV=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_EV=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_EV=\
+ "..\include\SDL_thread.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_EV=\
+ "..\include\SDL_thread.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_EV=\
+ "..\include\SDL_thread.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_EV=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_EV=\
+ "..\include\SDL_thread.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_EV=\
+ "..\include\SDL_thread.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_EV=\
+ "..\include\SDL_thread.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_EV=\
+ "..\include\SDL_thread.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_EV=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_EV=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_EV=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_EV=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_EV=\
+ "..\include\SDL_thread.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_EV=\
+ "..\include\SDL_thread.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_EV=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_EV=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_EV=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_getenv.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_EV=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_getenv.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_EV=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\events\SDL_expose.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_EX=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_EX=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_EX=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_EX=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_EX=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_EX=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_EX=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\SDL_fatal.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_F=\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_F=\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_F=\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_F=\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_F=\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_F=\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_F=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\SDL_fatal.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_F=\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_F=\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_F=\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_F=\
+ "..\..\include\SDL.h"\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_F=\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_F=\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_F=\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_F=\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_F=\
+ "..\..\include\SDL.h"\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_F=\
+ "..\..\include\SDL.h"\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_F=\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_F=\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_F=\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_F=\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_F=\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_F=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\SDL_fatal.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_F=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\SDL_fatal.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_F=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_F=\
+ "..\..\include\SDL.h"\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_getenv.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_F=\
+ "..\..\include\SDL.h"\
+ "..\..\src\SDL_fatal.h"\
+
+NODEP_CPP_SDL_F=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_getenv.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_F=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\SDL_fatal.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_gamma.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_G=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_G=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_G=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_G=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_G=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_G=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_G=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_G=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_G=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_name.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\e_log.h"\
+ "..\..\src\video\e_pow.h"\
+ "..\..\src\video\e_sqrt.h"\
+ "..\..\src\video\math_private.h"\
+
+NODEP_CPP_SDL_G=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_G=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_G=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_G=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_G=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_name.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\e_log.h"\
+ "..\..\src\video\e_pow.h"\
+ "..\..\src\video\e_sqrt.h"\
+ "..\..\src\video\math_private.h"\
+
+NODEP_CPP_SDL_G=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_name.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\e_log.h"\
+ "..\..\src\video\e_pow.h"\
+ "..\..\src\video\e_sqrt.h"\
+ "..\..\src\video\math_private.h"\
+
+NODEP_CPP_SDL_G=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_G=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_G=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_G=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_syswm.h"\
+
+NODEP_CPP_SDL_G=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_G=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_name.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\e_log.h"\
+ "..\..\src\video\e_pow.h"\
+ "..\..\src\video\e_sqrt.h"\
+ "..\..\src\video\math_private.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_name.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\e_log.h"\
+ "..\..\src\video\e_pow.h"\
+ "..\..\src\video\e_sqrt.h"\
+ "..\..\src\video\math_private.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_name.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\e_log.h"\
+ "..\..\src\video\e_pow.h"\
+ "..\..\src\video\e_sqrt.h"\
+ "..\..\src\video\math_private.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_G=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_G=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_G=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_G=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\gapi\SDL_gapivideo.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_GA=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\gapi\sdl_gapivideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_GA=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\gapi\sdl_gapivideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_GA=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\gapi\sdl_gapivideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_GA=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\gapi\sdl_gapivideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_GA=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\gapi\sdl_gapivideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_GA=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\gapi\sdl_gapivideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_GA=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\gapi\sdl_gapivideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_GA=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\gapi\sdl_gapivideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_GA=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\gapi\sdl_gapivideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_GA=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\gapi\sdl_gapivideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_GA=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\gapi\sdl_gapivideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_GA=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\gapi\sdl_gapivideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\windib\SDL_dibevents_c.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\stdlib\SDL_getenv.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+NODEP_CPP_SDL_GE=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+NODEP_CPP_SDL_GE=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+NODEP_CPP_SDL_GE=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+NODEP_CPP_SDL_GE=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_GE=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_GE=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_GE=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_GE=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_GE=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_GE=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+NODEP_CPP_SDL_GE=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+NODEP_CPP_SDL_GE=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+NODEP_CPP_SDL_GE=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+NODEP_CPP_SDL_GE=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+NODEP_CPP_SDL_GE=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+NODEP_CPP_SDL_GE=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+NODEP_CPP_SDL_GE=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+NODEP_CPP_SDL_GE=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+NODEP_CPP_SDL_GE=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+NODEP_CPP_SDL_GE=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_GE=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_GE=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_GE=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_GE=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+NODEP_CPP_SDL_GE=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+NODEP_CPP_SDL_GE=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_GE=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_GE=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_GE=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_GE=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_GE=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_GE=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_GE=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_GE=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_GE=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_GE=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_GE=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_GE=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\stdlib\SDL_iconv.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_I=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_I=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_I=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_I=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_I=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_I=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_I=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_I=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_I=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_I=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_I=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_I=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\joystick\SDL_joystick.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_J=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_J=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_J=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_J=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_J=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_J=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_J=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_J=\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_J=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_J=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_J=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_J=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_J=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_J=\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_J=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_J=\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_J=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_J=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_J=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_J=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_J=\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_J=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_J=\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_J=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_J=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\events\SDL_keyboard.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+
+NODEP_CPP_SDL_K=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+
+NODEP_CPP_SDL_K=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+
+NODEP_CPP_SDL_K=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+
+NODEP_CPP_SDL_K=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_K=\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_K=\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+
+NODEP_CPP_SDL_K=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+
+NODEP_CPP_SDL_K=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+
+NODEP_CPP_SDL_K=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+
+NODEP_CPP_SDL_K=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+
+NODEP_CPP_SDL_K=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+
+NODEP_CPP_SDL_K=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+
+NODEP_CPP_SDL_K=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+
+NODEP_CPP_SDL_K=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+
+NODEP_CPP_SDL_K=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+
+NODEP_CPP_SDL_K=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_K=\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_K=\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+
+NODEP_CPP_SDL_K=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+
+NODEP_CPP_SDL_K=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_K=\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_K=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_K=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_K=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_K=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\stdlib\SDL_malloc.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_M=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_M=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_M=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_M=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_M=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_M=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_M=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_M=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_M=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\..\..\..\usr\include\pthread.h"\
+ "..\include\SDL_config_wince.h"\
+ ".\onfig\_epilog.h"\
+ ".\onfig\_msvc_warnings_off.h"\
+ ".\onfig\_prolog.h"\
+ ".\onfig\stl_apcc.h"\
+ ".\onfig\stl_apple.h"\
+ ".\onfig\stl_as400.h"\
+ ".\onfig\stl_bc.h"\
+ ".\onfig\stl_como.h"\
+ ".\onfig\stl_confix.h"\
+ ".\onfig\stl_dec.h"\
+ ".\onfig\stl_dec_vms.h"\
+ ".\onfig\stl_fujitsu.h"\
+ ".\onfig\stl_gcc.h"\
+ ".\onfig\stl_hpacc.h"\
+ ".\onfig\stl_ibm.h"\
+ ".\onfig\stl_intel.h"\
+ ".\onfig\stl_kai.h"\
+ ".\onfig\stl_msvc.h"\
+ ".\onfig\stl_mwerks.h"\
+ ".\onfig\stl_mycomp.h"\
+ ".\onfig\stl_sco.h"\
+ ".\onfig\stl_select_lib.h"\
+ ".\onfig\stl_sgi.h"\
+ ".\onfig\stl_solaris.h"\
+ ".\onfig\stl_sunpro.h"\
+ ".\onfig\stl_symantec.h"\
+ ".\onfig\stl_watcom.h"\
+ ".\onfig\stl_wince.h"\
+ ".\onfig\stlcomp.h"\
+ ".\onfig\vc_select_lib.h"\
+ ".\thread.h"\
+ ".\tl\_abbrevs.h"\
+ ".\tl\_config.h"\
+ ".\tl\_config_compat.h"\
+ ".\tl\_config_compat_post.h"\
+ ".\tl\_epilog.h"\
+ ".\tl\_prolog.h"\
+ ".\tl\_site_config.h"\
+ ".\tl_user_config.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_M=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\..\..\..\usr\include\pthread.h"\
+ "..\include\SDL_config_wince.h"\
+ ".\onfig\_epilog.h"\
+ ".\onfig\_msvc_warnings_off.h"\
+ ".\onfig\_prolog.h"\
+ ".\onfig\stl_apcc.h"\
+ ".\onfig\stl_apple.h"\
+ ".\onfig\stl_as400.h"\
+ ".\onfig\stl_bc.h"\
+ ".\onfig\stl_como.h"\
+ ".\onfig\stl_confix.h"\
+ ".\onfig\stl_dec.h"\
+ ".\onfig\stl_dec_vms.h"\
+ ".\onfig\stl_fujitsu.h"\
+ ".\onfig\stl_gcc.h"\
+ ".\onfig\stl_hpacc.h"\
+ ".\onfig\stl_ibm.h"\
+ ".\onfig\stl_intel.h"\
+ ".\onfig\stl_kai.h"\
+ ".\onfig\stl_msvc.h"\
+ ".\onfig\stl_mwerks.h"\
+ ".\onfig\stl_mycomp.h"\
+ ".\onfig\stl_sco.h"\
+ ".\onfig\stl_select_lib.h"\
+ ".\onfig\stl_sgi.h"\
+ ".\onfig\stl_solaris.h"\
+ ".\onfig\stl_sunpro.h"\
+ ".\onfig\stl_symantec.h"\
+ ".\onfig\stl_watcom.h"\
+ ".\onfig\stl_wince.h"\
+ ".\onfig\stlcomp.h"\
+ ".\onfig\vc_select_lib.h"\
+ ".\thread.h"\
+ ".\tl\_abbrevs.h"\
+ ".\tl\_config.h"\
+ ".\tl\_config_compat.h"\
+ ".\tl\_config_compat_post.h"\
+ ".\tl\_epilog.h"\
+ ".\tl\_prolog.h"\
+ ".\tl\_site_config.h"\
+ ".\tl_user_config.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_M=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\..\..\..\usr\include\pthread.h"\
+ "..\include\SDL_config_wince.h"\
+ ".\onfig\_epilog.h"\
+ ".\onfig\_msvc_warnings_off.h"\
+ ".\onfig\_prolog.h"\
+ ".\onfig\stl_apcc.h"\
+ ".\onfig\stl_apple.h"\
+ ".\onfig\stl_as400.h"\
+ ".\onfig\stl_bc.h"\
+ ".\onfig\stl_como.h"\
+ ".\onfig\stl_confix.h"\
+ ".\onfig\stl_dec.h"\
+ ".\onfig\stl_dec_vms.h"\
+ ".\onfig\stl_fujitsu.h"\
+ ".\onfig\stl_gcc.h"\
+ ".\onfig\stl_hpacc.h"\
+ ".\onfig\stl_ibm.h"\
+ ".\onfig\stl_intel.h"\
+ ".\onfig\stl_kai.h"\
+ ".\onfig\stl_msvc.h"\
+ ".\onfig\stl_mwerks.h"\
+ ".\onfig\stl_mycomp.h"\
+ ".\onfig\stl_sco.h"\
+ ".\onfig\stl_select_lib.h"\
+ ".\onfig\stl_sgi.h"\
+ ".\onfig\stl_solaris.h"\
+ ".\onfig\stl_sunpro.h"\
+ ".\onfig\stl_symantec.h"\
+ ".\onfig\stl_watcom.h"\
+ ".\onfig\stl_wince.h"\
+ ".\onfig\stlcomp.h"\
+ ".\onfig\vc_select_lib.h"\
+ ".\thread.h"\
+ ".\tl\_abbrevs.h"\
+ ".\tl\_config.h"\
+ ".\tl\_config_compat.h"\
+ ".\tl\_config_compat_post.h"\
+ ".\tl\_epilog.h"\
+ ".\tl\_prolog.h"\
+ ".\tl\_site_config.h"\
+ ".\tl_user_config.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_M=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_M=\
+ "..\..\..\..\usr\include\malloc.h"\
+ "..\include\SDL_config_wince.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_mixer.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_MI=\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_MI=\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_MI=\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_MI=\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_MI=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_MI=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_MI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_MI=\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_MI=\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_MI=\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_MI=\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_MI=\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_MI=\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_MI=\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_MI=\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_MI=\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_MI=\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_MI=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_MI=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_MI=\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_MI=\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_thread.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_MI=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_MI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_MI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_MI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_MI=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_MI=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+NODEP_CPP_SDL_MI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_MI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\audio\SDL_mixer_m68k.h"\
+ "..\..\src\audio\SDL_mixer_MMX.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+ "..\..\src\audio\SDL_sysaudio.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_mixer_MMX_VC.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_MIX=\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\src\audio\SDL_mixer_MMX_VC.h"\
+
+NODEP_CPP_SDL_MIX=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\events\SDL_mouse.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+
+NODEP_CPP_SDL_MO=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+
+NODEP_CPP_SDL_MO=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+
+NODEP_CPP_SDL_MO=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+
+NODEP_CPP_SDL_MO=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_MO=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_MO=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+
+NODEP_CPP_SDL_MO=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+
+NODEP_CPP_SDL_MO=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+
+NODEP_CPP_SDL_MO=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+
+NODEP_CPP_SDL_MO=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+
+NODEP_CPP_SDL_MO=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+
+NODEP_CPP_SDL_MO=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+
+NODEP_CPP_SDL_MO=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+
+NODEP_CPP_SDL_MO=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+
+NODEP_CPP_SDL_MO=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+
+NODEP_CPP_SDL_MO=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_MO=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_MO=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+
+NODEP_CPP_SDL_MO=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+
+NODEP_CPP_SDL_MO=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_MO=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_MO=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_MO=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_MO=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_MO=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\dummy\SDL_nullevents.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_N=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_N=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_N=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_N=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_N=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_N=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_N=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_N=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_N=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_N=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_N=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_N=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\dummy\SDL_nullmouse.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_NU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_NU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_NU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_NU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_NU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_NU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_NU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_NU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_NU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_NU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_NU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_NU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\dummy\SDL_nullvideo.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_NUL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_NUL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_NUL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_NUL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_NUL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_NUL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_NUL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_NUL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_NUL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_NUL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_NUL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_NUL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\dummy\SDL_nullevents_c.h"\
+ "..\..\src\video\dummy\SDL_nullmouse_c.h"\
+ "..\..\src\video\dummy\SDL_nullvideo.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_pixels.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_P=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_P=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_P=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_P=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_P=\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_P=\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_P=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_P=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_P=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_P=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_P=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_P=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_P=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_P=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_P=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_P=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_P=\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_P=\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_P=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_P=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_P=\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_P=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_P=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_P=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_P=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\stdlib\SDL_qsort.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+NODEP_CPP_SDL_Q=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+NODEP_CPP_SDL_Q=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+NODEP_CPP_SDL_Q=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+NODEP_CPP_SDL_Q=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_Q=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_Q=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_Q=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_Q=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_Q=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_Q=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+NODEP_CPP_SDL_Q=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+NODEP_CPP_SDL_Q=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+NODEP_CPP_SDL_Q=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+NODEP_CPP_SDL_Q=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+NODEP_CPP_SDL_Q=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+NODEP_CPP_SDL_Q=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+NODEP_CPP_SDL_Q=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+NODEP_CPP_SDL_Q=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+NODEP_CPP_SDL_Q=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+NODEP_CPP_SDL_Q=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_Q=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_Q=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_Q=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_Q=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+NODEP_CPP_SDL_Q=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+NODEP_CPP_SDL_Q=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_Q=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_Q=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_Q=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_Q=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_Q=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_Q=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_Q=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_Q=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_Q=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_Q=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_Q=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_Q=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\events\SDL_quit.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_QU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_QU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_QU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_QU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_QU=\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_QU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_QU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\events\SDL_resize.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_R=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_R=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_R=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_R=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_R=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_R=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_R=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_R=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_R=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_R=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_R=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_R=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_R=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_R=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_R=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_R=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_R=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_R=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_R=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+
+NODEP_CPP_SDL_R=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_R=\
+ ".\DL_active.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_R=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_R=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_R=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_R=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_RLEaccel.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_RL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\mmx.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_RL=\
+ "..\..\src\video\SDL_memops.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\file\SDL_rwops.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_RW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_RW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_RW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_RW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_RW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_RW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_RW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+NODEP_CPP_SDL_RW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_RW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_RW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_RW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_RW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+NODEP_CPP_SDL_RW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+NODEP_CPP_SDL_RW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_RW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_RW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_rwops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_RW=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_RW=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_RW=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_RW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_stretch.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+NODEP_CPP_SDL_S=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+NODEP_CPP_SDL_S=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+NODEP_CPP_SDL_S=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+NODEP_CPP_SDL_S=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_S=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_S=\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_S=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_S=\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_S=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+NODEP_CPP_SDL_S=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+NODEP_CPP_SDL_S=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+NODEP_CPP_SDL_S=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+NODEP_CPP_SDL_S=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+NODEP_CPP_SDL_S=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+NODEP_CPP_SDL_S=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+NODEP_CPP_SDL_S=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+NODEP_CPP_SDL_S=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+NODEP_CPP_SDL_S=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+NODEP_CPP_SDL_S=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_S=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_S=\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_S=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_S=\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+NODEP_CPP_SDL_S=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+NODEP_CPP_SDL_S=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_S=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_S=\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_S=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_S=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_S=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+NODEP_CPP_SDL_S=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_S=\
+ "..\..\include\SDL_endian.h"\
+
+NODEP_CPP_SDL_S=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_S=\
+ "..\..\include\SDL_endian.h"\
+
+NODEP_CPP_SDL_S=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_S=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\stdlib\SDL_string.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+NODEP_CPP_SDL_ST=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+NODEP_CPP_SDL_ST=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+NODEP_CPP_SDL_ST=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+NODEP_CPP_SDL_ST=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_ST=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_ST=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_ST=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_ST=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_ST=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_ST=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+NODEP_CPP_SDL_ST=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+NODEP_CPP_SDL_ST=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+NODEP_CPP_SDL_ST=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+NODEP_CPP_SDL_ST=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+NODEP_CPP_SDL_ST=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+NODEP_CPP_SDL_ST=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+NODEP_CPP_SDL_ST=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+NODEP_CPP_SDL_ST=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+NODEP_CPP_SDL_ST=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+NODEP_CPP_SDL_ST=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_ST=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_ST=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_ST=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_ST=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+NODEP_CPP_SDL_ST=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+NODEP_CPP_SDL_ST=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_ST=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_ST=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_ST=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_ST=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_ST=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_ST=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_ST=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_ST=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_ST=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_ST=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_ST=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_ST=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_surface.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_SU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_leaks.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_RLEaccel_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_SU=\
+ "..\..\src\video\SDL_memops.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\cdrom\dummy\SDL_syscdrom.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ ".\DL_cdrom.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ ".\DL_cdrom.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ ".\DL_cdrom.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ ".\DL_cdrom.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ ".\DL_cdrom.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ ".\DL_cdrom.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_SY=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ ".\DL_cdrom.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ ".\DL_cdrom.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ ".\DL_cdrom.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ ".\DL_cdrom.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ ".\DL_cdrom.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ ".\DL_cdrom.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ ".\DL_cdrom.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ ".\DL_cdrom.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ ".\DL_cdrom.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ ".\DL_cdrom.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ ".\DL_cdrom.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ ".\DL_cdrom.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_SY=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_SY=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_SY=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_SY=\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+NODEP_CPP_SDL_SY=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_SY=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\cdrom\SDL_syscdrom.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\generic\SDL_syscond.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+NODEP_CPP_SDL_SYS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+NODEP_CPP_SDL_SYS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+NODEP_CPP_SDL_SYS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+NODEP_CPP_SDL_SYS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_SYS=\
+ "..\..\include\SDL_thread.h"\
+
+NODEP_CPP_SDL_SYS=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_SYS=\
+ "..\..\include\SDL_thread.h"\
+
+NODEP_CPP_SDL_SYS=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_SYS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+NODEP_CPP_SDL_SYS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+NODEP_CPP_SDL_SYS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+NODEP_CPP_SDL_SYS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+NODEP_CPP_SDL_SYS=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+NODEP_CPP_SDL_SYS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+NODEP_CPP_SDL_SYS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+NODEP_CPP_SDL_SYS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+NODEP_CPP_SDL_SYS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+NODEP_CPP_SDL_SYS=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+NODEP_CPP_SDL_SYS=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_SYS=\
+ "..\..\include\SDL_thread.h"\
+
+NODEP_CPP_SDL_SYS=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_SYS=\
+ "..\..\include\SDL_thread.h"\
+
+NODEP_CPP_SDL_SYS=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+NODEP_CPP_SDL_SYS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+NODEP_CPP_SDL_SYS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_SYS=\
+ "..\..\include\SDL_thread.h"\
+
+NODEP_CPP_SDL_SYS=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_SYS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_SYS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_SYS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+
+NODEP_CPP_SDL_SYS=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_SYS=\
+ "..\..\include\SDL_thread.h"\
+
+NODEP_CPP_SDL_SYS=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_SYS=\
+ "..\..\include\SDL_thread.h"\
+
+NODEP_CPP_SDL_SYS=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_SYS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\wincommon\SDL_sysevents.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ "..\..\src\video\wincommon\SDL_gapivideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\gapi\sdl_gapivideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\gapi\sdl_gapivideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\gapi\sdl_gapivideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\gapi\sdl_gapivideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\gapi\sdl_gapivideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\gapi\sdl_gapivideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ "..\..\src\video\wincommon\SDL_gapivideo.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_getenv.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\gapi\sdl_gapivideo.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+NODEP_CPP_SDL_SYSE=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_getenv.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_SYSE=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\gapi\sdl_gapivideo.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\wmmsg.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\joystick\dummy\SDL_sysjoystick.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ ".\DL_error.h"\
+ ".\DL_joystick.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ ".\DL_error.h"\
+ ".\DL_joystick.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ ".\DL_error.h"\
+ ".\DL_joystick.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ ".\DL_error.h"\
+ ".\DL_joystick.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ ".\DL_error.h"\
+ ".\DL_joystick.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ ".\DL_error.h"\
+ ".\DL_joystick.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ ".\DL_error.h"\
+ ".\DL_joystick.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ ".\DL_error.h"\
+ ".\DL_joystick.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ ".\DL_error.h"\
+ ".\DL_joystick.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ ".\DL_error.h"\
+ ".\DL_joystick.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ ".\DL_error.h"\
+ ".\DL_joystick.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ ".\DL_error.h"\
+ ".\DL_joystick.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ ".\DL_error.h"\
+ ".\DL_joystick.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ ".\DL_error.h"\
+ ".\DL_joystick.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ ".\DL_error.h"\
+ ".\DL_joystick.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ ".\DL_error.h"\
+ ".\DL_joystick.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ ".\DL_error.h"\
+ ".\DL_joystick.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ ".\DL_error.h"\
+ ".\DL_joystick.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+NODEP_CPP_SDL_SYSJ=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_SYSJ=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\joystick\SDL_joystick_c.h"\
+ "..\..\src\joystick\SDL_sysjoystick.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\loadso\win32\SDL_sysloadso.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_SYSL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_SYSL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_SYSL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_SYSL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_SYSL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_SYSL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_SYSL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_SYSL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_SYSL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_SYSL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_SYSL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_SYSL=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_SYSL=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\wincommon\SDL_sysmouse.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ ".\DL_active.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+NODEP_CPP_SDL_SYSM=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_SYSM=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_sysmouse_c.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\win32\SDL_sysmutex.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_SYSMU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_SYSMU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_SYSMU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_SYSMU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_SYSMU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_SYSMU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_SYSMU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+NODEP_CPP_SDL_SYSMU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_SYSMU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_SYSMU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_SYSMU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_SYSMU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+NODEP_CPP_SDL_SYSMU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+NODEP_CPP_SDL_SYSMU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_SYSMU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_SDL_SYSMU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_SYSMU=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_SYSMU=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_SYSMU=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_SYSMU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_types.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\win32\SDL_syssem.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ "..\include\SDL_thread.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+NODEP_CPP_SDL_SYSS=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_SYSS=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\win32\SDL_systhread.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_SYST=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ "..\src\thread\win32\SDL_systhread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_SYST=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ "..\src\thread\win32\SDL_systhread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_SYST=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ "..\src\thread\win32\SDL_systhread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_SYST=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ "..\src\thread\win32\SDL_systhread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+ "..\..\src\thread\win32\SDL_systhread_c.h"\
+
+NODEP_CPP_SDL_SYST=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+ "..\..\src\thread\win32\SDL_systhread_c.h"\
+
+NODEP_CPP_SDL_SYST=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+ "..\..\src\thread\win32\SDL_systhread_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_SYST=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ "..\src\thread\win32\SDL_systhread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_SYST=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ "..\src\thread\win32\SDL_systhread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_SYST=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ "..\src\thread\win32\SDL_systhread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+
+NODEP_CPP_SDL_SYST=\
+ "..\..\src\thread\amigaos\mydebug.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\amigaos\SDL_systhread_c.h"\
+ "..\src\thread\beos\SDL_systhread_c.h"\
+ "..\src\thread\dc\SDL_systhread_c.h"\
+ "..\src\thread\epoc\SDL_systhread_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\irix\SDL_systhread_c.h"\
+ "..\src\thread\os2\SDL_systhread_c.h"\
+ "..\src\thread\pth\SDL_systhread_c.h"\
+ "..\src\thread\pthread\SDL_systhread_c.h"\
+ "..\src\thread\win32\SDL_systhread_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_SYST=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ "..\src\thread\win32\SDL_systhread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_SYST=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ "..\src\thread\win32\SDL_systhread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_SYST=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ "..\src\thread\win32\SDL_systhread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_SYST=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ "..\src\thread\win32\SDL_systhread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+
+NODEP_CPP_SDL_SYST=\
+ "..\..\src\thread\amigaos\mydebug.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\amigaos\SDL_systhread_c.h"\
+ "..\src\thread\beos\SDL_systhread_c.h"\
+ "..\src\thread\dc\SDL_systhread_c.h"\
+ "..\src\thread\epoc\SDL_systhread_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\irix\SDL_systhread_c.h"\
+ "..\src\thread\os2\SDL_systhread_c.h"\
+ "..\src\thread\pth\SDL_systhread_c.h"\
+ "..\src\thread\pthread\SDL_systhread_c.h"\
+ "..\src\thread\win32\SDL_systhread_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+
+NODEP_CPP_SDL_SYST=\
+ "..\..\src\thread\amigaos\mydebug.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\amigaos\SDL_systhread_c.h"\
+ "..\src\thread\beos\SDL_systhread_c.h"\
+ "..\src\thread\dc\SDL_systhread_c.h"\
+ "..\src\thread\epoc\SDL_systhread_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\irix\SDL_systhread_c.h"\
+ "..\src\thread\os2\SDL_systhread_c.h"\
+ "..\src\thread\pth\SDL_systhread_c.h"\
+ "..\src\thread\pthread\SDL_systhread_c.h"\
+ "..\src\thread\win32\SDL_systhread_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+ "..\..\src\thread\win32\SDL_systhread_c.h"\
+
+NODEP_CPP_SDL_SYST=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+ "..\..\src\thread\win32\SDL_systhread_c.h"\
+
+NODEP_CPP_SDL_SYST=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_SYST=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ "..\src\thread\win32\SDL_systhread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_SYST=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ "..\src\thread\win32\SDL_systhread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+ "..\..\src\thread\win32\SDL_systhread_c.h"\
+
+NODEP_CPP_SDL_SYST=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\amigaos\SDL_systhread_c.h"\
+ "..\..\src\thread\beos\SDL_systhread_c.h"\
+ "..\..\src\thread\dc\SDL_systhread_c.h"\
+ "..\..\src\thread\epoc\SDL_systhread_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\irix\SDL_systhread_c.h"\
+ "..\..\src\thread\os2\SDL_systhread_c.h"\
+ "..\..\src\thread\pth\SDL_systhread_c.h"\
+ "..\..\src\thread\pthread\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+ "..\..\src\thread\win32\SDL_systhread_c.h"\
+
+NODEP_CPP_SDL_SYST=\
+ "..\..\src\thread\amigaos\mydebug.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\amigaos\SDL_systhread_c.h"\
+ "..\..\src\thread\beos\SDL_systhread_c.h"\
+ "..\..\src\thread\dc\SDL_systhread_c.h"\
+ "..\..\src\thread\epoc\SDL_systhread_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\irix\SDL_systhread_c.h"\
+ "..\..\src\thread\os2\SDL_systhread_c.h"\
+ "..\..\src\thread\pth\SDL_systhread_c.h"\
+ "..\..\src\thread\pthread\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+ "..\..\src\thread\win32\SDL_systhread_c.h"\
+
+NODEP_CPP_SDL_SYST=\
+ "..\..\src\thread\amigaos\mydebug.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\amigaos\SDL_systhread_c.h"\
+ "..\..\src\thread\beos\SDL_systhread_c.h"\
+ "..\..\src\thread\dc\SDL_systhread_c.h"\
+ "..\..\src\thread\epoc\SDL_systhread_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\irix\SDL_systhread_c.h"\
+ "..\..\src\thread\os2\SDL_systhread_c.h"\
+ "..\..\src\thread\pth\SDL_systhread_c.h"\
+ "..\..\src\thread\pthread\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+ "..\..\src\thread\win32\SDL_systhread_c.h"\
+
+NODEP_CPP_SDL_SYST=\
+ "..\..\..\..\usr\include\pthread.h"\
+ "..\..\src\thread\amigaos\mydebug.h"\
+ "..\include\SDL_config_wince.h"\
+ ".\onfig\_epilog.h"\
+ ".\onfig\_msvc_warnings_off.h"\
+ ".\onfig\_prolog.h"\
+ ".\onfig\stl_apcc.h"\
+ ".\onfig\stl_apple.h"\
+ ".\onfig\stl_as400.h"\
+ ".\onfig\stl_bc.h"\
+ ".\onfig\stl_como.h"\
+ ".\onfig\stl_confix.h"\
+ ".\onfig\stl_dec.h"\
+ ".\onfig\stl_dec_vms.h"\
+ ".\onfig\stl_fujitsu.h"\
+ ".\onfig\stl_gcc.h"\
+ ".\onfig\stl_hpacc.h"\
+ ".\onfig\stl_ibm.h"\
+ ".\onfig\stl_intel.h"\
+ ".\onfig\stl_kai.h"\
+ ".\onfig\stl_msvc.h"\
+ ".\onfig\stl_mwerks.h"\
+ ".\onfig\stl_mycomp.h"\
+ ".\onfig\stl_sco.h"\
+ ".\onfig\stl_select_lib.h"\
+ ".\onfig\stl_sgi.h"\
+ ".\onfig\stl_solaris.h"\
+ ".\onfig\stl_sunpro.h"\
+ ".\onfig\stl_symantec.h"\
+ ".\onfig\stl_watcom.h"\
+ ".\onfig\stl_wince.h"\
+ ".\onfig\stlcomp.h"\
+ ".\onfig\vc_select_lib.h"\
+ ".\thread.h"\
+ ".\tl\_abbrevs.h"\
+ ".\tl\_config.h"\
+ ".\tl\_config_compat.h"\
+ ".\tl\_config_compat_post.h"\
+ ".\tl\_epilog.h"\
+ ".\tl\_prolog.h"\
+ ".\tl\_site_config.h"\
+ ".\tl_user_config.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\win32\SDL_systhread_c.h"\
+
+NODEP_CPP_SDL_SYST=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_types.h"\
+ "..\src\thread\SDL_thread_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\win32\SDL_systhread_c.h"\
+
+NODEP_CPP_SDL_SYST=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_types.h"\
+ "..\src\thread\SDL_thread_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_SYST=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+ "..\..\src\thread\win32\SDL_systhread_c.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\timer\wince\SDL_systimer.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_SYSTI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_SYSTI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_SYSTI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_SYSTI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_SYSTI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_SYSTI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_SYSTI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_SYSTI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_SYSTI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_SYSTI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_SYSTI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_SYSTI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_SYSTI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_SYSTI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_SYSTI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_SYSTI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_SYSTI=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_SYSTI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_SYSTI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_SYSTI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\wincommon\SDL_syswm.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_SYSW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_SYSW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_syswm_c.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\SDL_thread.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_T=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_T=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_T=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_T=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_T=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_T=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_T=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_T=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_T=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+
+NODEP_CPP_SDL_T=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_T=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+
+NODEP_CPP_SDL_T=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_T=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_T=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_T=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_T=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_T=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_T=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_T=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_T=\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+
+NODEP_CPP_SDL_T=\
+ "..\..\src\thread\amigaos\mydebug.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\amigaos\SDL_systhread_c.h"\
+ "..\src\thread\beos\SDL_systhread_c.h"\
+ "..\src\thread\dc\SDL_systhread_c.h"\
+ "..\src\thread\epoc\SDL_systhread_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\irix\SDL_systhread_c.h"\
+ "..\src\thread\os2\SDL_systhread_c.h"\
+ "..\src\thread\pth\SDL_systhread_c.h"\
+ "..\src\thread\pthread\SDL_systhread_c.h"\
+ "..\src\thread\win32\SDL_systhread_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_T=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_T=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_T=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_T=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_T=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_T=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_T=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_T=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_T=\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+
+NODEP_CPP_SDL_T=\
+ "..\..\src\thread\amigaos\mydebug.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\amigaos\SDL_systhread_c.h"\
+ "..\src\thread\beos\SDL_systhread_c.h"\
+ "..\src\thread\dc\SDL_systhread_c.h"\
+ "..\src\thread\epoc\SDL_systhread_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\irix\SDL_systhread_c.h"\
+ "..\src\thread\os2\SDL_systhread_c.h"\
+ "..\src\thread\pth\SDL_systhread_c.h"\
+ "..\src\thread\pthread\SDL_systhread_c.h"\
+ "..\src\thread\win32\SDL_systhread_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_T=\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+
+NODEP_CPP_SDL_T=\
+ "..\..\src\thread\amigaos\mydebug.h"\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\amigaos\SDL_systhread_c.h"\
+ "..\src\thread\beos\SDL_systhread_c.h"\
+ "..\src\thread\dc\SDL_systhread_c.h"\
+ "..\src\thread\epoc\SDL_systhread_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\irix\SDL_systhread_c.h"\
+ "..\src\thread\os2\SDL_systhread_c.h"\
+ "..\src\thread\pth\SDL_systhread_c.h"\
+ "..\src\thread\pthread\SDL_systhread_c.h"\
+ "..\src\thread\win32\SDL_systhread_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_T=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+
+NODEP_CPP_SDL_T=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_T=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+
+NODEP_CPP_SDL_T=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_T=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_T=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_T=\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_T=\
+ "..\include\SDL_thread.h"\
+ "..\src\SDL_error_c.h"\
+ "..\src\thread\generic\SDL_systhread_c.h"\
+ "..\src\thread\SDL_thread_c.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_T=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+
+NODEP_CPP_SDL_T=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_T=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\amigaos\SDL_systhread_c.h"\
+ "..\..\src\thread\beos\SDL_systhread_c.h"\
+ "..\..\src\thread\dc\SDL_systhread_c.h"\
+ "..\..\src\thread\epoc\SDL_systhread_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\irix\SDL_systhread_c.h"\
+ "..\..\src\thread\os2\SDL_systhread_c.h"\
+ "..\..\src\thread\pth\SDL_systhread_c.h"\
+ "..\..\src\thread\pthread\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+ "..\..\src\thread\win32\SDL_systhread_c.h"\
+
+NODEP_CPP_SDL_T=\
+ "..\..\src\thread\amigaos\mydebug.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_T=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\amigaos\SDL_systhread_c.h"\
+ "..\..\src\thread\beos\SDL_systhread_c.h"\
+ "..\..\src\thread\dc\SDL_systhread_c.h"\
+ "..\..\src\thread\epoc\SDL_systhread_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\irix\SDL_systhread_c.h"\
+ "..\..\src\thread\os2\SDL_systhread_c.h"\
+ "..\..\src\thread\pth\SDL_systhread_c.h"\
+ "..\..\src\thread\pthread\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+ "..\..\src\thread\win32\SDL_systhread_c.h"\
+
+NODEP_CPP_SDL_T=\
+ "..\..\src\thread\amigaos\mydebug.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_T=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\amigaos\SDL_systhread_c.h"\
+ "..\..\src\thread\beos\SDL_systhread_c.h"\
+ "..\..\src\thread\dc\SDL_systhread_c.h"\
+ "..\..\src\thread\epoc\SDL_systhread_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\irix\SDL_systhread_c.h"\
+ "..\..\src\thread\os2\SDL_systhread_c.h"\
+ "..\..\src\thread\pth\SDL_systhread_c.h"\
+ "..\..\src\thread\pthread\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+ "..\..\src\thread\win32\SDL_systhread_c.h"\
+
+NODEP_CPP_SDL_T=\
+ "..\..\..\..\usr\include\pthread.h"\
+ "..\..\src\thread\amigaos\mydebug.h"\
+ "..\include\SDL_config_wince.h"\
+ ".\onfig\_epilog.h"\
+ ".\onfig\_msvc_warnings_off.h"\
+ ".\onfig\_prolog.h"\
+ ".\onfig\stl_apcc.h"\
+ ".\onfig\stl_apple.h"\
+ ".\onfig\stl_as400.h"\
+ ".\onfig\stl_bc.h"\
+ ".\onfig\stl_como.h"\
+ ".\onfig\stl_confix.h"\
+ ".\onfig\stl_dec.h"\
+ ".\onfig\stl_dec_vms.h"\
+ ".\onfig\stl_fujitsu.h"\
+ ".\onfig\stl_gcc.h"\
+ ".\onfig\stl_hpacc.h"\
+ ".\onfig\stl_ibm.h"\
+ ".\onfig\stl_intel.h"\
+ ".\onfig\stl_kai.h"\
+ ".\onfig\stl_msvc.h"\
+ ".\onfig\stl_mwerks.h"\
+ ".\onfig\stl_mycomp.h"\
+ ".\onfig\stl_sco.h"\
+ ".\onfig\stl_select_lib.h"\
+ ".\onfig\stl_sgi.h"\
+ ".\onfig\stl_solaris.h"\
+ ".\onfig\stl_sunpro.h"\
+ ".\onfig\stl_symantec.h"\
+ ".\onfig\stl_watcom.h"\
+ ".\onfig\stl_wince.h"\
+ ".\onfig\stlcomp.h"\
+ ".\onfig\vc_select_lib.h"\
+ ".\thread.h"\
+ ".\tl\_abbrevs.h"\
+ ".\tl\_config.h"\
+ ".\tl\_config_compat.h"\
+ ".\tl\_config_compat_post.h"\
+ ".\tl\_epilog.h"\
+ ".\tl\_prolog.h"\
+ ".\tl\_site_config.h"\
+ ".\tl_user_config.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_T=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_T=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_types.h"\
+ "..\src\thread\SDL_thread_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_T=\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+
+NODEP_CPP_SDL_T=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_types.h"\
+ "..\src\thread\SDL_thread_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_T=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\SDL_error_c.h"\
+ "..\..\src\thread\generic\SDL_systhread_c.h"\
+ "..\..\src\thread\SDL_systhread.h"\
+ "..\..\src\thread\SDL_thread_c.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\timer\SDL_timer.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_TI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_timer.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mutex.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_TI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_TI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_TI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_TI=\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+NODEP_CPP_SDL_TI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_TI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\timer\SDL_systimer.h"\
+ "..\..\src\timer\SDL_timer_c.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_video.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_V=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_V=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_V=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_V=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_V=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_V=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_V=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_V=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_V=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_V=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_V=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_V=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_V=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_V=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_V=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_V=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_V=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_V=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_V=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+
+NODEP_CPP_SDL_V=\
+ "..\include\SDL_endian.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_V=\
+ ".\DL.h"\
+ ".\DL_active.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_cdrom.h"\
+ ".\DL_error.h"\
+ ".\DL_events.h"\
+ ".\DL_getenv.h"\
+ ".\DL_joystick.h"\
+ ".\DL_keyboard.h"\
+ ".\DL_keysym.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_quit.h"\
+ ".\DL_rwops.h"\
+ ".\DL_timer.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_V=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_V=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_getenv.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+NODEP_CPP_SDL_V=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_getenv.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_blit.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_V=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\events\SDL_events_c.h"\
+ "..\..\src\events\SDL_sysevents.h"\
+ "..\..\src\video\SDL_blit.h"\
+ "..\..\src\video\SDL_cursor_c.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_pixels_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_wave.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ "..\include\SDL_endian.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ "..\include\SDL_endian.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ "..\include\SDL_endian.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ "..\include\SDL_endian.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\audio\SDL_wave.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ "..\include\SDL_endian.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ "..\include\SDL_endian.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ "..\include\SDL_endian.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ "..\include\SDL_endian.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ "..\include\SDL_endian.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ "..\include\SDL_endian.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ "..\include\SDL_endian.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ "..\include\SDL_endian.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ "..\include\SDL_endian.h"\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ ".\DL_audio.h"\
+ ".\DL_byteorder.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_wave.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_wave.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL_endian.h"\
+ "..\..\src\audio\SDL_wave.h"\
+
+NODEP_CPP_SDL_W=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_byteorder.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\src\audio\SDL_wave.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\wincommon\SDL_wingl.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+NODEP_CPP_SDL_WI=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\wincommon\SDL_lowvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_WI=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\wincommon\SDL_lowvideo.h"\
+ "..\..\src\video\wincommon\SDL_wingl_c.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_yuv.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ ".\DL_error.h"\
+ ".\DL_getenv.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_getenv.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_Y=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_getenv.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_Y=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_yuv_mmx.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+NODEP_CPP_SDL_YU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+NODEP_CPP_SDL_YU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+NODEP_CPP_SDL_YU=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\SDL_types.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_YU=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_YU=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_stdinc.h"\
+
+NODEP_CPP_SDL_YU=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_YU=\
+ "..\..\include\SDL_types.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_yuv_sw.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ "..\include\SDL_cpuinfo.h"\
+ "..\src\video\SDL_glfuncs.h"\
+ "..\src\video\SDL_sysvideo.h"\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ ".\DL_error.h"\
+ ".\DL_main.h"\
+ ".\DL_mouse.h"\
+ ".\DL_mutex.h"\
+ ".\DL_rwops.h"\
+ ".\DL_types.h"\
+ ".\DL_version.h"\
+ ".\DL_video.h"\
+ ".\egin_code.h"\
+ ".\lose_code.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_opengl.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ "..\include\SDL_config_wince.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+NODEP_CPP_SDL_YUV=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_types.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+ "..\src\video\SDL_glfuncs.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_YUV=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+ "..\..\src\video\SDL_glfuncs.h"\
+ "..\..\src\video\SDL_stretch_c.h"\
+ "..\..\src\video\SDL_sysvideo.h"\
+ "..\..\src\video\SDL_yuv_sw_c.h"\
+ "..\..\src\video\SDL_yuvfuncs.h"\
+
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\win32\win_ce_semaphore.c
+
+!IF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Release"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH4) Debug"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Debug"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Release"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE emulator) Debug"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Release"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE x86) Debug"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Debug"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE ARM) Release"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE MIPS) Release"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ELSEIF "$(CFG)" == "SDL - Win32 (WCE SH3) Release"
+
+DEP_CPP_WIN_C=\
+ "..\..\src\thread\win32\win_ce_semaphore.h"\
+
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\include\begin_code.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\blank_cursor.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\close_code.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\default_cursor.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\hermes\HeadMMX.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\hermes\HeadX86.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\mmx.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_active.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_audio.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_audio_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_audiodev_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_audiomem.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_blit.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_byteorder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_cdrom.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_copying.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_cpuinfo.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_cursor_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\windib\SDL_dibaudio.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\windib\SDL_dibevents_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\windib\SDL_dibvideo.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\disk\SDL_diskaudio.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\dummy\SDL_dummyaudio.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_endian.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_error.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\SDL_error_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_events.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\events\SDL_events_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\SDL_fatal.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\gapi\sdl_gapivideo.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_getenv.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_glfuncs.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_joystick.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\joystick\SDL_joystick_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_keyboard.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_keysym.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_leaks.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_loadso.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\wincommon\SDL_lowvideo.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_main.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_memops.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_mixer_m68k.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_mixer_MMX.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_mixer_MMX_VC.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_mouse.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_mutex.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_name.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\dummy\SDL_nullevents_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\dummy\SDL_nullmouse_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\dummy\SDL_nullvideo.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_opengl.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_pixels_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_quit.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_RLEaccel_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_rwops.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_stretch_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_sysaudio.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\cdrom\SDL_syscdrom.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\generic\SDL_syscond_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\events\SDL_sysevents.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\joystick\SDL_sysjoystick.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\wincommon\SDL_sysmouse_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\generic\SDL_sysmutex_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\generic\SDL_syssem_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\SDL_systhread.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\generic\SDL_systhread_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\win32\SDL_systhread_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\timer\SDL_systimer.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_sysvideo.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_syswm.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\wincommon\SDL_syswm_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_thread.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\SDL_thread_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_timer.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\timer\SDL_timer_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_types.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_version.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\SDL_video.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\windib\SDL_vkeys.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\audio\SDL_wave.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\wincommon\SDL_wingl_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_yuv_sw_c.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\SDL_yuvfuncs.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\thread\win32\win_ce_semaphore.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\src\video\wincommon\wmmsg.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/distrib/sdl-1.2.15/VisualCE/SDL/SDL.vcproj b/distrib/sdl-1.2.15/VisualCE/SDL/SDL.vcproj
new file mode 100644
index 0000000..370458f
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualCE/SDL/SDL.vcproj
@@ -0,0 +1,3967 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8,00"
+ Name="SDL"
+ ProjectGUID="{C598024D-8030-4F9C-AB76-69BF4CA0645F}"
+ RootNamespace="SDL"
+ >
+ <Platforms>
+ <Platform
+ Name="Smartphone 2003 (ARMV4)"
+ />
+ <Platform
+ Name="Pocket PC 2003 (ARMV4)"
+ />
+ <Platform
+ Name="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/SDL.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../include,../../src,../../src/video,../../src/thread,../../src/thread/generic,../../src/audio,../../src/cdrom,../../src/timer,../../src/joystick,../../src/events,../../src/video/wincommon,../../src/video/windib,../../src/video/gapi"
+ PreprocessorDefinitions="DEBUG;ARM;_ARM_;ARMV4;_WIN32_WCE=$(CEVER);$(CePlatform);UNDER_CE=$(CEVER);UNICODE;SDL_EXPORTS"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/SDL.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalOptions="/r "
+ PreprocessorDefinitions="UNDER_CE=$(CEVER),_WIN32_WCE=$(CEVER),DEBUG,UNICODE,_UNICODE,$(CePlatform),ARM,_ARM_,ARMV4"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/ALIGN:4096 /subsystem:$(CESubsystem) /MACHINE:ARM "
+ AdditionalDependencies="commctrl.lib coredll.lib secchk.lib ccrtrtti.lib"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/SDL.dll"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="$(CENoDefaultLib)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/SDL.pdb"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ EntryPointSymbol="_DllMainCRTStartup"
+ BaseAddress="0x00100000"
+ ImportLibrary="$(PlatformName)\$(ConfigurationName)/SDL.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/SDL.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/SDL.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../include,../../src,../../src/video,../../src/thread,../../src/thread/generic,../../src/audio,../../src/cdrom,../../src/timer,../../src/joystick,../../src/events,../../src/video/wincommon,../../src/video/windib,../../src/video/gapi"
+ PreprocessorDefinitions="DEBUG;ARM;_ARM_;ARMV4;_WIN32_WCE=$(CEVER);$(CePlatform);UNDER_CE=$(CEVER);UNICODE;SDL_EXPORTS"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/SDL.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalOptions="/r "
+ PreprocessorDefinitions="UNDER_CE=$(CEVER),_WIN32_WCE=$(CEVER),DEBUG,UNICODE,_UNICODE,$(CePlatform),ARM,_ARM_,ARMV4"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/ALIGN:4096 /subsystem:$(CESubsystem) /MACHINE:ARM "
+ AdditionalDependencies="commctrl.lib coredll.lib secchk.lib ccrtrtti.lib"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/SDL.dll"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="$(CENoDefaultLib)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/SDL.pdb"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ EntryPointSymbol="_DllMainCRTStartup"
+ BaseAddress="0x00100000"
+ ImportLibrary="$(PlatformName)\$(ConfigurationName)/SDL.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/SDL.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory="%CSIDL_WINDOWS%"
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/SDL.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../include;../../src;../../src/video;../../src/thread;../../src/thread/generic;../../src/audio;../../src/cdrom;../../src/timer;../../src/joystick;../../src/events;../../src/video/wincommon;../../src/video/gapi;../../src/video/windib"
+ PreprocessorDefinitions="DEBUG;ARM;_ARM_;THUMB;_THUMB_;ARMV4T;_WIN32_WCE=$(CEVER);$(CePlatform);UNDER_CE=$(CEVER);UNICODE;SDL_EXPORTS"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/SDL.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalOptions="/r "
+ PreprocessorDefinitions="UNDER_CE=$(CEVER),_WIN32_WCE=$(CEVER),UNICODE,_UNICODE,DEBUG,$(CePlatform),THUMB,_THUMB_,ARM,_ARM_,ARMV4T"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/subsystem:$(CESubsystem) /MACHINE:THUMB "
+ AdditionalDependencies="commctrl.lib coredll.lib"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/SDL.dll"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="$(CENoDefaultLib)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/SDL.pdb"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ EntryPointSymbol="_DllMainCRTStartup"
+ BaseAddress="0x00100000"
+ ImportLibrary="$(PlatformName)\$(ConfigurationName)/SDL.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/SDL.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory="%CSIDL_WINDOWS%"
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/SDL.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="4"
+ InlineFunctionExpansion="2"
+ AdditionalIncludeDirectories="../../include,../../src,../../src/video,../../src/thread,../../src/thread/generic,../../src/audio,../../src/cdrom,../../src/timer,../../src/joystick,../../src/events,../../src/video/wincommon"
+ PreprocessorDefinitions="ARM;_ARM_;ARMV4;NDEBUG;_WIN32_WCE=$(CEVER);$(CePlatform);UNDER_CE=$(CEVER);UNICODE;SDL_EXPORTS"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/SDL.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalOptions="/r "
+ PreprocessorDefinitions="UNDER_CE=$(CEVER),_WIN32_WCE=$(CEVER),NDEBUG,UNICODE,_UNICODE,$(CePlatform),ARM,_ARM_,ARMV4"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/ALIGN:4096 /subsystem:$(CESubsystem) /MACHINE:ARM "
+ AdditionalDependencies="commctrl.lib coredll.lib secchk.lib ccrtrtti.lib"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/SDL.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="$(CENoDefaultLib)"
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/SDL.pdb"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ EntryPointSymbol="_DllMainCRTStartup"
+ BaseAddress="0x00100000"
+ ImportLibrary="$(PlatformName)\$(ConfigurationName)/SDL.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/SDL.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/SDL.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ InlineFunctionExpansion="2"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="1"
+ AdditionalIncludeDirectories="../../include,../../src,../../src/video,../../src/thread,../../src/thread/generic,../../src/audio,../../src/cdrom,../../src/timer,../../src/joystick,../../src/events,../../src/video/wincommon,../../src/video/windib,../../src/video/gapi"
+ PreprocessorDefinitions="ARM;_ARM_;ARMV4;NDEBUG;_WIN32_WCE=$(CEVER);$(CePlatform);UNDER_CE=$(CEVER);UNICODE;SDL_EXPORTS"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/SDL.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalOptions="/r "
+ PreprocessorDefinitions="UNDER_CE=$(CEVER),_WIN32_WCE=$(CEVER),NDEBUG,UNICODE,_UNICODE,$(CePlatform),ARM,_ARM_,ARMV4"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/ALIGN:4096 /subsystem:$(CESubsystem) /MACHINE:ARM "
+ AdditionalDependencies="commctrl.lib coredll.lib secchk.lib ccrtrtti.lib"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/SDL.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="$(CENoDefaultLib)"
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/SDL.pdb"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ EntryPointSymbol="_DllMainCRTStartup"
+ BaseAddress="0x00100000"
+ ImportLibrary="$(PlatformName)\$(ConfigurationName)/SDL.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/SDL.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory="%CSIDL_WINDOWS%"
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/SDL.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ InlineFunctionExpansion="2"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="1"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="../../include;../../src;../../src/video;../../src/thread;../../src/thread/generic;../../src/audio;../../src/cdrom;../../src/timer;../../src/joystick;../../src/events;../../src/video/wincommon;../../src/video/gapi;../../src/video/windib"
+ PreprocessorDefinitions="DEBUG;ARM;_ARM_;THUMB;_THUMB_;ARMV4T;_WIN32_WCE=$(CEVER);$(CePlatform);UNDER_CE=$(CEVER);UNICODE;SDL_EXPORTS"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/SDL.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalOptions="/r "
+ PreprocessorDefinitions="UNDER_CE=$(CEVER),_WIN32_WCE=$(CEVER),UNICODE,_UNICODE,NDEBUG,$(CePlatform),THUMB,_THUMB_,ARM,_ARM_,ARMV4T"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/subsystem:$(CESubsystem) /MACHINE:THUMB "
+ AdditionalDependencies="commctrl.lib coredll.lib"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/SDL.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="$(CENoDefaultLib)"
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/SDL.pdb"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ LinkTimeCodeGeneration="1"
+ EntryPointSymbol="_DllMainCRTStartup"
+ BaseAddress="0x00100000"
+ ImportLibrary="$(PlatformName)\$(ConfigurationName)/SDL.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/SDL.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory="%CSIDL_WINDOWS%"
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\src\SDL.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\events\SDL_active.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_audio.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_audiocvt.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_audiodev.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_blit.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_blit_0.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_blit_1.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_blit_A.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_blit_N.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_bmp.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\cpuinfo\SDL_cpuinfo.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_cursor.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\audio\windib\SDL_dibaudio.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\video\windib\SDL_dibevents.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\video\windib\SDL_dibvideo.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\audio\disk\SDL_diskaudio.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\dummy\SDL_dummyaudio.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\SDL_error.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\events\SDL_events.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\events\SDL_expose.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\SDL_fatal.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_gamma.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\video\gapi\sdl_gapivideo.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\stdlib\SDL_getenv.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\stdlib\SDL_iconv.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\joystick\SDL_joystick.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\events\SDL_keyboard.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\stdlib\SDL_malloc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_mixer.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_mixer_MMX_VC.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\events\SDL_mouse.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\video\dummy\SDL_nullevents.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\dummy\SDL_nullmouse.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\dummy\SDL_nullvideo.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_pixels.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\stdlib\SDL_qsort.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\events\SDL_quit.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\events\SDL_resize.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_RLEaccel.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\file\SDL_rwops.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_stretch.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\stdlib\SDL_string.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_surface.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\cdrom\dummy\SDL_syscdrom.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\thread\generic\SDL_syscond.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\video\wincommon\SDL_sysevents.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\joystick\dummy\SDL_sysjoystick.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\loadso\win32\SDL_sysloadso.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\wincommon\SDL_sysmouse.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\thread\win32\SDL_sysmutex.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\thread\win32\SDL_syssem.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\thread\win32\SDL_systhread.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\timer\wince\SDL_systimer.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\wincommon\SDL_syswm.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\thread\SDL_thread.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\timer\SDL_timer.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_video.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_wave.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\video\wincommon\SDL_wingl.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_yuv.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_yuv_mmx.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_yuv_sw.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\thread\win32\win_ce_semaphore.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\include\begin_code.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\blank_cursor.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\close_code.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\default_cursor.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\hermes\HeadMMX.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\hermes\HeadX86.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\mmx.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_active.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_audio.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_audio_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_audiodev_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_audiomem.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_blit.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_byteorder.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_cdrom.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_config.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_config_wince.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_copying.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_cpuinfo.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_cursor_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\windib\SDL_dibaudio.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\windib\SDL_dibevents_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\windib\SDL_dibvideo.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\disk\SDL_diskaudio.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\dummy\SDL_dummyaudio.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_endian.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_error.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\SDL_error_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_events.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\events\SDL_events_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\SDL_fatal.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\gapi\sdl_gapivideo.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_getenv.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_glfuncs.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_joystick.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\joystick\SDL_joystick_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_keyboard.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_keysym.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_leaks.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_loadso.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\wincommon\SDL_lowvideo.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_main.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_memops.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_mixer_MMX.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_mixer_MMX_VC.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_mouse.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_mutex.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_name.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\dummy\SDL_nullevents_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\dummy\SDL_nullmouse_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\dummy\SDL_nullvideo.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_opengl.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_pixels_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_platform.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_quit.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_RLEaccel_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_rwops.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_stretch_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_sysaudio.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\cdrom\SDL_syscdrom.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\thread\generic\SDL_syscond_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\events\SDL_sysevents.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\joystick\SDL_sysjoystick.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\wincommon\SDL_sysmouse_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\thread\generic\SDL_sysmutex_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\thread\generic\SDL_syssem_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\thread\SDL_systhread.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\thread\generic\SDL_systhread_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\thread\win32\SDL_systhread_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\timer\SDL_systimer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_sysvideo.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_syswm.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\wincommon\SDL_syswm_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_thread.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\thread\SDL_thread_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_timer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\timer\SDL_timer_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_types.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_version.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\include\SDL_video.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\windib\SDL_vkeys.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\audio\SDL_wave.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\wincommon\SDL_wingl_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_yuv_sw_c.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\SDL_yuvfuncs.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\thread\win32\win_ce_semaphore.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\video\wincommon\wmmsg.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/distrib/sdl-1.2.15/VisualCE/SDLMain/SDLmain.vcp b/distrib/sdl-1.2.15/VisualCE/SDLMain/SDLmain.vcp
new file mode 100644
index 0000000..e6de778
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualCE/SDLMain/SDLmain.vcp
@@ -0,0 +1,1653 @@
+# Microsoft eMbedded Visual Tools Project File - Name="SDLmain" - Package Owner=<4>
+# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (WCE x86) Static Library" 0x8304
+# TARGTYPE "Win32 (WCE MIPS) Static Library" 0x8204
+# TARGTYPE "Win32 (WCE MIPS16) Static Library" 0x8904
+# TARGTYPE "Win32 (WCE SH4) Static Library" 0x8604
+# TARGTYPE "Win32 (WCE MIPSII) Static Library" 0xa104
+# TARGTYPE "Win32 (WCE MIPSIV_FP) Static Library" 0x9204
+# TARGTYPE "Win32 (WCE ARM) Static Library" 0x8504
+# TARGTYPE "Win32 (WCE SH3) Static Library" 0x8104
+# TARGTYPE "Win32 (WCE ARMV4) Static Library" 0xa304
+# TARGTYPE "Win32 (WCE ARMV4I) Static Library" 0xa504
+# TARGTYPE "Win32 (WCE emulator) Static Library" 0xa604
+# TARGTYPE "Win32 (WCE MIPSII_FP) Static Library" 0xa204
+# TARGTYPE "Win32 (WCE ARMV4T) Static Library" 0xa404
+# TARGTYPE "Win32 (WCE MIPSIV) Static Library" 0x9604
+
+CFG=SDLmain - Win32 (WCE MIPSII_FP) Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "SDLmain.vcn".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "SDLmain.vcn" CFG="SDLmain - Win32 (WCE MIPSII_FP) Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "SDLmain - Win32 (WCE MIPSII_FP) Release" (based on "Win32 (WCE MIPSII_FP) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE MIPSII_FP) Debug" (based on "Win32 (WCE MIPSII_FP) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE MIPSII) Release" (based on "Win32 (WCE MIPSII) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE MIPSII) Debug" (based on "Win32 (WCE MIPSII) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE SH4) Release" (based on "Win32 (WCE SH4) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE SH4) Debug" (based on "Win32 (WCE SH4) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE SH3) Release" (based on "Win32 (WCE SH3) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE SH3) Debug" (based on "Win32 (WCE SH3) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE MIPSIV) Release" (based on "Win32 (WCE MIPSIV) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE MIPSIV) Debug" (based on "Win32 (WCE MIPSIV) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE emulator) Release" (based on "Win32 (WCE emulator) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE emulator) Debug" (based on "Win32 (WCE emulator) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE ARMV4I) Release" (based on "Win32 (WCE ARMV4I) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE ARMV4I) Debug" (based on "Win32 (WCE ARMV4I) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE MIPSIV_FP) Release" (based on "Win32 (WCE MIPSIV_FP) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE MIPSIV_FP) Debug" (based on "Win32 (WCE MIPSIV_FP) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE ARMV4) Release" (based on "Win32 (WCE ARMV4) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE ARMV4) Debug" (based on "Win32 (WCE ARMV4) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE MIPS16) Release" (based on "Win32 (WCE MIPS16) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE MIPS16) Debug" (based on "Win32 (WCE MIPS16) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE ARMV4T) Release" (based on "Win32 (WCE ARMV4T) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE ARMV4T) Debug" (based on "Win32 (WCE ARMV4T) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE x86) Release" (based on "Win32 (WCE x86) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE x86) Debug" (based on "Win32 (WCE x86) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE MIPS) Debug" (based on "Win32 (WCE MIPS) Static Library")
+!MESSAGE "SDLmain - Win32 (WCE MIPS) Release" (based on "Win32 (WCE MIPS) Static Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+# PROP ATL_Project 2
+
+!IF "$(CFG)" == "SDLmain - Win32 (WCE MIPSII_FP) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "MIPSII_FPRel"
+# PROP BASE Intermediate_Dir "MIPSII_FPRel"
+# PROP BASE CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "MIPSII_FPRel"
+# PROP Intermediate_Dir "MIPSII_FPRel"
+# PROP CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips2 /QMFPE- /O2 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /QMmips2 /QMFPE- /M$(CECrtMT) /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSII_FP) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "MIPSII_FPDbg"
+# PROP BASE Intermediate_Dir "MIPSII_FPDbg"
+# PROP BASE CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "MIPSII_FPDbg"
+# PROP Intermediate_Dir "MIPSII_FPDbg"
+# PROP CPU_ID "{D8AC856C-B213-4895-9E83-9EC51A55201E}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips2 /QMFPE- /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPSII_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /QMmips2 /QMFPE- /M$(CECrtMTDebug) /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSII) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "MIPSIIRel"
+# PROP BASE Intermediate_Dir "MIPSIIRel"
+# PROP BASE CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "MIPSIIRel"
+# PROP Intermediate_Dir "MIPSIIRel"
+# PROP CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips2 /QMFPE /O2 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /QMmips2 /QMFPE /M$(CECrtMT) /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSII) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "MIPSIIDbg"
+# PROP BASE Intermediate_Dir "MIPSIIDbg"
+# PROP BASE CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "MIPSIIDbg"
+# PROP Intermediate_Dir "MIPSIIDbg"
+# PROP CPU_ID "{689DDC64-9D9D-11D5-96F8-00207802C01C}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips2 /QMFPE /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /QMmips2 /QMFPE /M$(CECrtMTDebug) /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE SH4) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "SH4Rel"
+# PROP BASE Intermediate_Dir "SH4Rel"
+# PROP BASE CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "SH4Rel"
+# PROP Intermediate_Dir "SH4Rel"
+# PROP CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=shcl.exe
+# ADD BASE CPP /nologo /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /Qsh4 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /O2 /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /Oxt /Qsh4 /M$(CECrtMT) /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE SH4) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "SH4Dbg"
+# PROP BASE Intermediate_Dir "SH4Dbg"
+# PROP BASE CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "SH4Dbg"
+# PROP Intermediate_Dir "SH4Dbg"
+# PROP CPU_ID "{D6519021-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=shcl.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /Qsh4 /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH4" /D "_SH4_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /Qsh4 /M$(CECrtMTDebug) /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE SH3) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "SH3Rel"
+# PROP BASE Intermediate_Dir "SH3Rel"
+# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "SH3Rel"
+# PROP Intermediate_Dir "SH3Rel"
+# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=shcl.exe
+# ADD BASE CPP /nologo /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /O2 /Ob1 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /Oxt /M$(CECrtMT) /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE SH3) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "SH3Dbg"
+# PROP BASE Intermediate_Dir "SH3Dbg"
+# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "SH3Dbg"
+# PROP Intermediate_Dir "SH3Dbg"
+# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=shcl.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /M$(CECrtMTDebug) /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSIV) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "MIPSIVRel"
+# PROP BASE Intermediate_Dir "MIPSIVRel"
+# PROP BASE CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "MIPSIVRel"
+# PROP Intermediate_Dir "MIPSIVRel"
+# PROP CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE /O2 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /QMmips4 /QMn32 /QMFPE /M$(CECrtMT) /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSIV) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "MIPSIVDbg"
+# PROP BASE Intermediate_Dir "MIPSIVDbg"
+# PROP BASE CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "MIPSIVDbg"
+# PROP Intermediate_Dir "MIPSIVDbg"
+# PROP CPU_ID "{0B2FE524-26C5-4194-8CEF-B1582DEB5A98}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /QMmips4 /QMn32 /QMFPE /M$(CECrtMTDebug) /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE emulator) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "emulatorRel"
+# PROP BASE Intermediate_Dir "emulatorRel"
+# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "emulatorRel"
+# PROP Intermediate_Dir "emulatorRel"
+# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Gs8192 /GF /O2 /c
+# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /Gs8192 /GF /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE emulator) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "emulatorDbg"
+# PROP BASE Intermediate_Dir "emulatorDbg"
+# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "emulatorDbg"
+# PROP Intermediate_Dir "emulatorDbg"
+# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gs8192 /GF /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /Gs8192 /GF /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4I) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ARMV4IRel"
+# PROP BASE Intermediate_Dir "ARMV4IRel"
+# PROP BASE CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ARMV4IRel"
+# PROP Intermediate_Dir "ARMV4IRel"
+# PROP CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "ARMV4I" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QRarch4T /QRinterwork-return /O2 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "ARMV4I" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /QRarch4T /QRinterwork-return /M$(CECrtMT) /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4I) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "ARMV4IDbg"
+# PROP BASE Intermediate_Dir "ARMV4IDbg"
+# PROP BASE CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "ARMV4IDbg"
+# PROP Intermediate_Dir "ARMV4IDbg"
+# PROP CPU_ID "{DC70F430-E78B-494F-A9D5-62ADC56443B8}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "ARMV4I" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "ARMV4I" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSIV_FP) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "MIPSIV_FPRel"
+# PROP BASE Intermediate_Dir "MIPSIV_FPRel"
+# PROP BASE CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "MIPSIV_FPRel"
+# PROP Intermediate_Dir "MIPSIV_FPRel"
+# PROP CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE- /O2 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /QMmips4 /QMn32 /QMFPE- /M$(CECrtMT) /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSIV_FP) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "MIPSIV_FPDbg"
+# PROP BASE Intermediate_Dir "MIPSIV_FPDbg"
+# PROP BASE CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "MIPSIV_FPDbg"
+# PROP Intermediate_Dir "MIPSIV_FPDbg"
+# PROP CPU_ID "{046A430D-7770-48AB-89B5-24C2D300B03F}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QMmips4 /QMn32 /QMFPE- /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "_MIPS64" /D "R4000" /D "MIPSIV" /D "MIPSIV_FP" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /QMmips4 /QMn32 /QMFPE- /M$(CECrtMTDebug) /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ARMV4Rel"
+# PROP BASE Intermediate_Dir "ARMV4Rel"
+# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ARMV4Rel"
+# PROP Intermediate_Dir "ARMV4Rel"
+# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /O2 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /M$(CECrtMT) /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "ARMV4Dbg"
+# PROP BASE Intermediate_Dir "ARMV4Dbg"
+# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "ARMV4Dbg"
+# PROP Intermediate_Dir "ARMV4Dbg"
+# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /M$(CECrtMTDebug) /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPS16) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "MIPS16Rel"
+# PROP BASE Intermediate_Dir "MIPS16Rel"
+# PROP BASE CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "MIPS16Rel"
+# PROP Intermediate_Dir "MIPS16Rel"
+# PROP CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_MIPS16_" /D "MIPS16SUPPORT" /D "_LIB" /YX /QMmips16 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /O2 /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_MIPS16_" /D "MIPS16SUPPORT" /D "_LIB" /Oxt /QMmips16 /M$(CECrtMT) /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPS16) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "MIPS16Dbg"
+# PROP BASE Intermediate_Dir "MIPS16Dbg"
+# PROP BASE CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "MIPS16Dbg"
+# PROP Intermediate_Dir "MIPS16Dbg"
+# PROP CPU_ID "{D6519013-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_MIPS16_" /D "MIPS16SUPPORT" /D "_LIB" /YX /QMmips16 /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D "R4000" /D "MIPSII" /D "MIPS16" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_MIPS16_" /D "MIPS16SUPPORT" /D "_LIB" /QMmips16 /M$(CECrtMTDebug) /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4T) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ARMV4TRel"
+# PROP BASE Intermediate_Dir "ARMV4TRel"
+# PROP BASE CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ARMV4TRel"
+# PROP Intermediate_Dir "ARMV4TRel"
+# PROP CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=clthumb.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /YX /QRarch4T /QRinterwork-return /O2 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /Oxt /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /D "_LIB" /QRarch4T /QRinterwork-return /M$(CECrtMT) /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4T) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "ARMV4TDbg"
+# PROP BASE Intermediate_Dir "ARMV4TDbg"
+# PROP BASE CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "ARMV4TDbg"
+# PROP Intermediate_Dir "ARMV4TDbg"
+# PROP CPU_ID "{F52316A9-3B7C-4FE7-A67F-68350B41240D}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=clthumb.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /YX /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "ARM" /D "_ARM_" /D "$(CePlatform)" /D "THUMB" /D "_THUMB_" /D "ARMV4T" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_LIB" /QRarch4T /QRinterwork-return /M$(CECrtMTDebug) /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE x86) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "X86Rel"
+# PROP BASE Intermediate_Dir "X86Rel"
+# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "X86Rel"
+# PROP Intermediate_Dir "X86Rel"
+# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /YX /Gs8192 /GF /c
+# ADD CPP /nologo /W3 /O2 /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /D "_LIB" /Gs8192 /Oxt /GF /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE x86) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "X86Dbg"
+# PROP BASE Intermediate_Dir "X86Dbg"
+# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "X86Dbg"
+# PROP Intermediate_Dir "X86Dbg"
+# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /YX /Gs8192 /GF /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "_LIB" /Gs8192 /GF /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARM) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "ARMDbg"
+# PROP BASE Intermediate_Dir "ARMDbg"
+# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "ARMDbg"
+# PROP Intermediate_Dir "ARMDbg"
+# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /Gs8192 /GF /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /Gs8192 /GF /c
+# SUBTRACT CPP /YX
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARM) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ARMRel"
+# PROP BASE Intermediate_Dir "ARMRel"
+# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ARMRel"
+# PROP Intermediate_Dir "ARMRel"
+# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /YX /Oxs /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /O2 /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "NDEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /YX /Oxs /M$(CECrtMT) /c
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPS) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "MIPSDbg"
+# PROP BASE Intermediate_Dir "MIPSDbg"
+# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "MIPSDbg"
+# PROP Intermediate_Dir "MIPSDbg"
+# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPS) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "MIPSRel"
+# PROP BASE Intermediate_Dir "MIPSRel"
+# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "MIPSRel"
+# PROP Intermediate_Dir "MIPSRel"
+# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /O2 /Ob2 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+
+!ENDIF
+
+# Begin Target
+
+# Name "SDLmain - Win32 (WCE MIPSII_FP) Release"
+# Name "SDLmain - Win32 (WCE MIPSII_FP) Debug"
+# Name "SDLmain - Win32 (WCE MIPSII) Release"
+# Name "SDLmain - Win32 (WCE MIPSII) Debug"
+# Name "SDLmain - Win32 (WCE SH4) Release"
+# Name "SDLmain - Win32 (WCE SH4) Debug"
+# Name "SDLmain - Win32 (WCE SH3) Release"
+# Name "SDLmain - Win32 (WCE SH3) Debug"
+# Name "SDLmain - Win32 (WCE MIPSIV) Release"
+# Name "SDLmain - Win32 (WCE MIPSIV) Debug"
+# Name "SDLmain - Win32 (WCE emulator) Release"
+# Name "SDLmain - Win32 (WCE emulator) Debug"
+# Name "SDLmain - Win32 (WCE ARMV4I) Release"
+# Name "SDLmain - Win32 (WCE ARMV4I) Debug"
+# Name "SDLmain - Win32 (WCE MIPSIV_FP) Release"
+# Name "SDLmain - Win32 (WCE MIPSIV_FP) Debug"
+# Name "SDLmain - Win32 (WCE ARMV4) Release"
+# Name "SDLmain - Win32 (WCE ARMV4) Debug"
+# Name "SDLmain - Win32 (WCE MIPS16) Release"
+# Name "SDLmain - Win32 (WCE MIPS16) Debug"
+# Name "SDLmain - Win32 (WCE ARMV4T) Release"
+# Name "SDLmain - Win32 (WCE ARMV4T) Debug"
+# Name "SDLmain - Win32 (WCE x86) Release"
+# Name "SDLmain - Win32 (WCE x86) Debug"
+# Name "SDLmain - Win32 (WCE ARM) Debug"
+# Name "SDLmain - Win32 (WCE ARM) Release"
+# Name "SDLmain - Win32 (WCE MIPS) Debug"
+# Name "SDLmain - Win32 (WCE MIPS) Release"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\src\main\win32\SDL_win32_main.c
+
+!IF "$(CFG)" == "SDLmain - Win32 (WCE MIPSII_FP) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSII_FP) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSII) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSII) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE SH4) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE SH4) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE SH3) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE SH3) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSIV) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSIV) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE emulator) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE emulator) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSIV_FP) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPSIV_FP) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPS16) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPS16) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE x86) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE x86) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARM) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_config.h"\
+ {$(INCLUDE)}"..\..\include\SDL_config_amiga.h"\
+ {$(INCLUDE)}"..\..\include\SDL_config_dreamcast.h"\
+ {$(INCLUDE)}"..\..\include\SDL_config_macos.h"\
+ {$(INCLUDE)}"..\..\include\SDL_config_macosx.h"\
+ {$(INCLUDE)}"..\..\include\SDL_config_os2.h"\
+ {$(INCLUDE)}"..\..\include\SDL_config_win32.h"\
+ {$(INCLUDE)}"..\..\include\SDL_config_wince.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cpuinfo.h"\
+ {$(INCLUDE)}"..\..\include\SDL_endian.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_loadso.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_platform.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_stdinc.h"\
+ {$(INCLUDE)}"..\..\include\SDL_thread.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE ARM) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_config.h"\
+ {$(INCLUDE)}"..\..\include\SDL_config_amiga.h"\
+ {$(INCLUDE)}"..\..\include\SDL_config_dreamcast.h"\
+ {$(INCLUDE)}"..\..\include\SDL_config_macos.h"\
+ {$(INCLUDE)}"..\..\include\SDL_config_macosx.h"\
+ {$(INCLUDE)}"..\..\include\SDL_config_os2.h"\
+ {$(INCLUDE)}"..\..\include\SDL_config_win32.h"\
+ {$(INCLUDE)}"..\..\include\SDL_config_wince.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cpuinfo.h"\
+ {$(INCLUDE)}"..\..\include\SDL_endian.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_loadso.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_platform.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_stdinc.h"\
+ {$(INCLUDE)}"..\..\include\SDL_thread.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "SDLmain - Win32 (WCE MIPS) Release"
+
+DEP_CPP_SDL_W=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+ {$(INCLUDE)}"..\..\include\begin_code.h"\
+ {$(INCLUDE)}"..\..\include\close_code.h"\
+ {$(INCLUDE)}"..\..\include\SDL_active.h"\
+ {$(INCLUDE)}"..\..\include\SDL_audio.h"\
+ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
+ {$(INCLUDE)}"..\..\include\SDL_error.h"\
+ {$(INCLUDE)}"..\..\include\SDL_events.h"\
+ {$(INCLUDE)}"..\..\include\SDL_joystick.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keyboard.h"\
+ {$(INCLUDE)}"..\..\include\SDL_keysym.h"\
+ {$(INCLUDE)}"..\..\include\SDL_main.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mouse.h"\
+ {$(INCLUDE)}"..\..\include\SDL_mutex.h"\
+ {$(INCLUDE)}"..\..\include\SDL_quit.h"\
+ {$(INCLUDE)}"..\..\include\SDL_rwops.h"\
+ {$(INCLUDE)}"..\..\include\SDL_timer.h"\
+ {$(INCLUDE)}"..\..\include\SDL_version.h"\
+ {$(INCLUDE)}"..\..\include\SDL_video.h"\
+
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\include\SDL_main.h
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/distrib/sdl-1.2.15/VisualCE/SDLMain/SDLmain.vcproj b/distrib/sdl-1.2.15/VisualCE/SDLMain/SDLmain.vcproj
new file mode 100644
index 0000000..8681cd4
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualCE/SDLMain/SDLmain.vcproj
@@ -0,0 +1,603 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8,00"
+ Name="SDLmain"
+ ProjectGUID="{5AC88B84-5EAA-4C1E-948D-332DA34227F6}"
+ RootNamespace="SDLmain"
+ >
+ <Platforms>
+ <Platform
+ Name="Smartphone 2003 (ARMV4)"
+ />
+ <Platform
+ Name="Pocket PC 2003 (ARMV4)"
+ />
+ <Platform
+ Name="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/SDLmain.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../include"
+ PreprocessorDefinitions="DEBUG;_WIN32_WCE=$(CEVER);$(CePlatform);ARM;_ARM_;ARMV4;UNDER_CE=$(CEVER);UNICODE;_LIB"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/SDLmain.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ Culture="1049"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(PlatformName)\$(ConfigurationName)\SDLmain.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/SDLmain.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/SDLmain.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../include"
+ PreprocessorDefinitions="DEBUG;_WIN32_WCE=$(CEVER);$(CePlatform);ARM;_ARM_;ARMV4;UNDER_CE=$(CEVER);UNICODE;_LIB"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/SDLmain.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ Culture="1049"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(PlatformName)\$(ConfigurationName)\SDLmain.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/SDLmain.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/SDLmain.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../include"
+ PreprocessorDefinitions="DEBUG;_WIN32_WCE=$(CEVER);ARM;_ARM_;$(CePlatform);THUMB;_THUMB_;ARMV4T;UNDER_CE=$(CEVER);UNICODE;_LIB"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/SDLmain.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ Culture="1049"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(PlatformName)\$(ConfigurationName)\SDLmain.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/SDLmain.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/SDLmain.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="4"
+ InlineFunctionExpansion="2"
+ AdditionalIncludeDirectories="../../include"
+ PreprocessorDefinitions="_WIN32_WCE=$(CEVER);$(CePlatform);NDEBUG;ARM;_ARM_;ARMV4;UNDER_CE=$(CEVER);UNICODE;_LIB"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/SDLmain.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ Culture="1049"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(PlatformName)\$(ConfigurationName)\SDLmain.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/SDLmain.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/SDLmain.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="4"
+ InlineFunctionExpansion="2"
+ AdditionalIncludeDirectories="../../include"
+ PreprocessorDefinitions="_WIN32_WCE=$(CEVER);$(CePlatform);NDEBUG;ARM;_ARM_;ARMV4;UNDER_CE=$(CEVER);UNICODE;_LIB"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/SDLmain.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ Culture="1049"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(PlatformName)\$(ConfigurationName)\SDLmain.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/SDLmain.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/SDLmain.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ InlineFunctionExpansion="2"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="1"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="../../include"
+ PreprocessorDefinitions="_WIN32_WCE=$(CEVER);ARM;_ARM_;$(CePlatform);THUMB;_THUMB_;ARMV4T;UNDER_CE=$(CEVER);UNICODE;NDEBUG;_LIB"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/SDLmain.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ Culture="1049"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(PlatformName)\$(ConfigurationName)\SDLmain.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/SDLmain.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\src\main\win32\SDL_win32_main.c"
+ >
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="..\..\include\SDL_main.h"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/distrib/sdl-1.2.15/VisualCE/loopwave/loopwave.vcp b/distrib/sdl-1.2.15/VisualCE/loopwave/loopwave.vcp
new file mode 100644
index 0000000..f886a6b
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualCE/loopwave/loopwave.vcp
@@ -0,0 +1,562 @@
+# Microsoft eMbedded Visual Tools Project File - Name="loopwave" - Package Owner=<4>
+# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (WCE x86) Application" 0x8301
+# TARGTYPE "Win32 (WCE ARM) Application" 0x8501
+# TARGTYPE "Win32 (WCE ARMV4) Application" 0xa301
+# TARGTYPE "Win32 (WCE x86em) Application" 0x7f01
+# TARGTYPE "Win32 (WCE emulator) Application" 0xa601
+
+CFG=loopwave - Win32 (WCE emulator) Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "loopwave.vcn".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "loopwave.vcn" CFG="loopwave - Win32 (WCE emulator) Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "loopwave - Win32 (WCE emulator) Release" (based on "Win32 (WCE emulator) Application")
+!MESSAGE "loopwave - Win32 (WCE emulator) Debug" (based on "Win32 (WCE emulator) Application")
+!MESSAGE "loopwave - Win32 (WCE ARMV4) Release" (based on "Win32 (WCE ARMV4) Application")
+!MESSAGE "loopwave - Win32 (WCE ARMV4) Debug" (based on "Win32 (WCE ARMV4) Application")
+!MESSAGE "loopwave - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Application")
+!MESSAGE "loopwave - Win32 (WCE x86em) Release" (based on "Win32 (WCE x86em) Application")
+!MESSAGE "loopwave - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Application")
+!MESSAGE "loopwave - Win32 (WCE x86) Release" (based on "Win32 (WCE x86) Application")
+!MESSAGE "loopwave - Win32 (WCE x86) Debug" (based on "Win32 (WCE x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+# PROP ATL_Project 2
+
+!IF "$(CFG)" == "loopwave - Win32 (WCE emulator) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "emulatorRel"
+# PROP BASE Intermediate_Dir "emulatorRel"
+# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "emulatorRel"
+# PROP Intermediate_Dir "emulatorRel"
+# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /O2 /c
+# ADD CPP /nologo /W3 /I "..\..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /O2 /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+
+!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE emulator) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "emulatorDbg"
+# PROP BASE Intermediate_Dir "emulatorDbg"
+# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "emulatorDbg"
+# PROP Intermediate_Dir "emulatorDbg"
+# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d "$(CePlatform)" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "_X86_" /d "x86" /d "_i386_" /r
+# ADD RSC /l 0x409 /d "$(CePlatform)" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "_X86_" /d "x86" /d "_i386_" /r
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c
+# ADD CPP /nologo /W3 /Zi /Od /I "..\..\include" /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+
+!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE ARMV4) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ARMV4Rel"
+# PROP BASE Intermediate_Dir "ARMV4Rel"
+# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ARMV4Rel"
+# PROP Intermediate_Dir "ARMV4Rel"
+# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /O2 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /I "..\..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /O2 /M$(CECrtMT) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+
+!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE ARMV4) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "ARMV4Dbg"
+# PROP BASE Intermediate_Dir "ARMV4Dbg"
+# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "ARMV4Dbg"
+# PROP Intermediate_Dir "ARMV4Dbg"
+# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "..\..\include" /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+
+!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE ARM) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ARMRel"
+# PROP BASE Intermediate_Dir "ARMRel"
+# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ARMRel"
+# PROP Intermediate_Dir "ARMRel"
+# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /O2 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+
+!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE x86em) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "X86EMRel"
+# PROP BASE Intermediate_Dir "X86EMRel"
+# PROP BASE CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "X86EMRel"
+# PROP Intermediate_Dir "X86EMRel"
+# PROP CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gz /Oxs /c
+# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gz /Oxs /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /stack:0x10000,0x1000 /subsystem:windows /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /stack:0x10000,0x1000 /subsystem:windows /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86
+
+!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE ARM) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "ARMDbg"
+# PROP BASE Intermediate_Dir "ARMDbg"
+# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "ARMDbg"
+# PROP Intermediate_Dir "ARMDbg"
+# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+
+!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE x86) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "X86Rel"
+# PROP BASE Intermediate_Dir "X86Rel"
+# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "X86Rel"
+# PROP Intermediate_Dir "X86Rel"
+# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /GX- /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /Oxs /c
+# ADD CPP /nologo /W3 /GX- /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /Oxs /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+
+!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE x86) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "X86Dbg"
+# PROP BASE Intermediate_Dir "X86Dbg"
+# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "X86Dbg"
+# PROP Intermediate_Dir "X86Dbg"
+# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c
+# ADD CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+
+!ENDIF
+
+# Begin Target
+
+# Name "loopwave - Win32 (WCE emulator) Release"
+# Name "loopwave - Win32 (WCE emulator) Debug"
+# Name "loopwave - Win32 (WCE ARMV4) Release"
+# Name "loopwave - Win32 (WCE ARMV4) Debug"
+# Name "loopwave - Win32 (WCE ARM) Release"
+# Name "loopwave - Win32 (WCE x86em) Release"
+# Name "loopwave - Win32 (WCE ARM) Debug"
+# Name "loopwave - Win32 (WCE x86) Release"
+# Name "loopwave - Win32 (WCE x86) Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\test\loopwave.c
+
+!IF "$(CFG)" == "loopwave - Win32 (WCE emulator) Release"
+
+DEP_CPP_LOOPW=\
+ "..\..\include\SDL.h"\
+
+NODEP_CPP_LOOPW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE emulator) Debug"
+
+DEP_CPP_LOOPW=\
+ "..\..\include\SDL.h"\
+
+NODEP_CPP_LOOPW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_LOOPW=\
+ "..\..\include\SDL.h"\
+
+NODEP_CPP_LOOPW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_LOOPW=\
+ "..\..\include\SDL.h"\
+
+NODEP_CPP_LOOPW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE ARM) Release"
+
+NODEP_CPP_LOOPW=\
+ "..\..\test\SDL.h"\
+ "..\..\test\SDL_audio.h"\
+ "..\..\test\SDL_config.h"\
+
+
+!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE x86em) Release"
+
+NODEP_CPP_LOOPW=\
+ "..\..\test\SDL.h"\
+ "..\..\test\SDL_audio.h"\
+ "..\..\test\SDL_config.h"\
+
+
+!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE ARM) Debug"
+
+NODEP_CPP_LOOPW=\
+ "..\..\test\SDL.h"\
+ "..\..\test\SDL_audio.h"\
+ "..\..\test\SDL_config.h"\
+
+
+!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE x86) Release"
+
+NODEP_CPP_LOOPW=\
+ "..\..\test\SDL.h"\
+ "..\..\test\SDL_audio.h"\
+ "..\..\test\SDL_config.h"\
+
+
+!ELSEIF "$(CFG)" == "loopwave - Win32 (WCE x86) Debug"
+
+NODEP_CPP_LOOPW=\
+ "..\..\test\SDL.h"\
+ "..\..\test\SDL_audio.h"\
+ "..\..\test\SDL_config.h"\
+
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/distrib/sdl-1.2.15/VisualCE/loopwave/loopwave.vcproj b/distrib/sdl-1.2.15/VisualCE/loopwave/loopwave.vcproj
new file mode 100644
index 0000000..b02636d
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualCE/loopwave/loopwave.vcproj
@@ -0,0 +1,374 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8,00"
+ Name="loopwave"
+ ProjectGUID="{6F642636-CB11-4DC7-855E-27FE1744003A}"
+ RootNamespace="loopwave"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Pocket PC 2003 (ARMV4)"
+ />
+ <Platform
+ Name="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,4.20 /machine:ARM /ARMPADCODE"
+ AdditionalDependencies="secchk.lib ccrtrtti.lib"
+ OutputFile="$(OutDir)/loopwave.exe"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/loopwave.pdb"
+ SubSystem="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles="sample.wav|$(SolutionDir)\..\test|\|0"
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\nclude"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.01"
+ OutputFile="$(OutDir)/loopwave.exe"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/loopwave.pdb"
+ SubSystem="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_WINDOWS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,4.20 /machine:ARM /ARMPADCODE"
+ AdditionalDependencies="secchk.lib ccrtrtti.lib"
+ OutputFile="$(OutDir)/loopwave.exe"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/loopwave.pdb"
+ SubSystem="0"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles="sample.wav|$(SolutionDir)\..\test|\|0"
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_WINDOWS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.01"
+ OutputFile="$(OutDir)/loopwave.exe"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/loopwave.pdb"
+ SubSystem="0"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\test\loopwave.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/distrib/sdl-1.2.15/VisualCE/testalpha/testalpha.vcp b/distrib/sdl-1.2.15/VisualCE/testalpha/testalpha.vcp
new file mode 100644
index 0000000..93b49c9
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualCE/testalpha/testalpha.vcp
@@ -0,0 +1,698 @@
+# Microsoft eMbedded Visual Tools Project File - Name="testalpha" - Package Owner=<4>
+# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (WCE x86) Application" 0x8301
+# TARGTYPE "Win32 (WCE ARM) Application" 0x8501
+# TARGTYPE "Win32 (WCE ARMV4) Application" 0xa301
+# TARGTYPE "Win32 (WCE SH3) Application" 0x8101
+# TARGTYPE "Win32 (WCE MIPS) Application" 0x8201
+# TARGTYPE "Win32 (WCE emulator) Application" 0xa601
+
+CFG=testalpha - Win32 (WCE emulator) Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "testalpha.vcn".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "testalpha.vcn" CFG="testalpha - Win32 (WCE emulator) Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "testalpha - Win32 (WCE emulator) Release" (based on "Win32 (WCE emulator) Application")
+!MESSAGE "testalpha - Win32 (WCE emulator) Debug" (based on "Win32 (WCE emulator) Application")
+!MESSAGE "testalpha - Win32 (WCE ARMV4) Release" (based on "Win32 (WCE ARMV4) Application")
+!MESSAGE "testalpha - Win32 (WCE ARMV4) Debug" (based on "Win32 (WCE ARMV4) Application")
+!MESSAGE "testalpha - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Application")
+!MESSAGE "testalpha - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Application")
+!MESSAGE "testalpha - Win32 (WCE MIPS) Debug" (based on "Win32 (WCE MIPS) Application")
+!MESSAGE "testalpha - Win32 (WCE SH3) Debug" (based on "Win32 (WCE SH3) Application")
+!MESSAGE "testalpha - Win32 (WCE x86) Release" (based on "Win32 (WCE x86) Application")
+!MESSAGE "testalpha - Win32 (WCE x86) Debug" (based on "Win32 (WCE x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+# PROP ATL_Project 2
+
+!IF "$(CFG)" == "testalpha - Win32 (WCE emulator) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "emulatorRel"
+# PROP BASE Intermediate_Dir "emulatorRel"
+# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "emulatorRel"
+# PROP Intermediate_Dir "emulatorRel"
+# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /O2 /c
+# ADD CPP /nologo /W3 /I "..\..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /O2 /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+
+!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE emulator) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "emulatorDbg"
+# PROP BASE Intermediate_Dir "emulatorDbg"
+# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "emulatorDbg"
+# PROP Intermediate_Dir "emulatorDbg"
+# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d "$(CePlatform)" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "_X86_" /d "x86" /d "_i386_" /r
+# ADD RSC /l 0x409 /d "$(CePlatform)" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "_X86_" /d "x86" /d "_i386_" /r
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c
+# ADD CPP /nologo /W3 /Zi /Od /I "..\..\include" /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+
+!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE ARMV4) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ARMV4Rel"
+# PROP BASE Intermediate_Dir "ARMV4Rel"
+# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ARMV4Rel"
+# PROP Intermediate_Dir "ARMV4Rel"
+# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /O2 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /I "..\..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /O2 /M$(CECrtMT) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+
+!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE ARMV4) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "ARMV4Dbg"
+# PROP BASE Intermediate_Dir "ARMV4Dbg"
+# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "ARMV4Dbg"
+# PROP Intermediate_Dir "ARMV4Dbg"
+# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "..\..\include" /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+
+!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE ARM) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "ARMDbg"
+# PROP BASE Intermediate_Dir "ARMDbg"
+# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "ARMDbg"
+# PROP Intermediate_Dir "ARMDbg"
+# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+
+!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE ARM) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ARMRel"
+# PROP BASE Intermediate_Dir "ARMRel"
+# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ARMRel"
+# PROP Intermediate_Dir "ARMRel"
+# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+
+!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE MIPS) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "MIPSDbg"
+# PROP BASE Intermediate_Dir "MIPSDbg"
+# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "MIPSDbg"
+# PROP Intermediate_Dir "MIPSDbg"
+# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS
+
+!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE SH3) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "SH3Dbg"
+# PROP BASE Intermediate_Dir "SH3Dbg"
+# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "SH3Dbg"
+# PROP Intermediate_Dir "SH3Dbg"
+# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r
+CPP=shcl.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3
+
+!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE x86) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "X86Rel"
+# PROP BASE Intermediate_Dir "X86Rel"
+# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "X86Rel"
+# PROP Intermediate_Dir "X86Rel"
+# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /GX- /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /Oxs /c
+# ADD CPP /nologo /W3 /GX- /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /Oxs /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+
+!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE x86) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "X86Dbg"
+# PROP BASE Intermediate_Dir "X86Dbg"
+# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "X86Dbg"
+# PROP Intermediate_Dir "X86Dbg"
+# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c
+# ADD CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+
+!ENDIF
+
+# Begin Target
+
+# Name "testalpha - Win32 (WCE emulator) Release"
+# Name "testalpha - Win32 (WCE emulator) Debug"
+# Name "testalpha - Win32 (WCE ARMV4) Release"
+# Name "testalpha - Win32 (WCE ARMV4) Debug"
+# Name "testalpha - Win32 (WCE ARM) Debug"
+# Name "testalpha - Win32 (WCE ARM) Release"
+# Name "testalpha - Win32 (WCE MIPS) Debug"
+# Name "testalpha - Win32 (WCE SH3) Debug"
+# Name "testalpha - Win32 (WCE x86) Release"
+# Name "testalpha - Win32 (WCE x86) Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\test\testalpha.c
+
+!IF "$(CFG)" == "testalpha - Win32 (WCE emulator) Release"
+
+DEP_CPP_TESTA=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE emulator) Debug"
+
+DEP_CPP_TESTA=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_TESTA=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_TESTA=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_syswm.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE ARM) Debug"
+
+DEP_CPP_TESTA=\
+ "..\..\include\SDL.h"\
+
+NODEP_CPP_TESTA=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE ARM) Release"
+
+DEP_CPP_TESTA=\
+ "..\..\include\SDL.h"\
+
+NODEP_CPP_TESTA=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_TESTA=\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_types.h"\
+
+NODEP_CPP_TESTA=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE SH3) Debug"
+
+DEP_CPP_TESTA=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE x86) Release"
+
+NODEP_CPP_TESTA=\
+ "..\..\test\SDL.h"\
+
+
+!ELSEIF "$(CFG)" == "testalpha - Win32 (WCE x86) Debug"
+
+NODEP_CPP_TESTA=\
+ "..\..\test\SDL.h"\
+
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/distrib/sdl-1.2.15/VisualCE/testalpha/testalpha.vcproj b/distrib/sdl-1.2.15/VisualCE/testalpha/testalpha.vcproj
new file mode 100644
index 0000000..c0012ac
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualCE/testalpha/testalpha.vcproj
@@ -0,0 +1,710 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8,00"
+ Name="testalpha"
+ ProjectGUID="{DF401CB3-6F70-4485-996B-B7C357CF7EE7}"
+ RootNamespace="testalpha"
+ >
+ <Platforms>
+ <Platform
+ Name="Smartphone 2003 (ARMV4)"
+ />
+ <Platform
+ Name="Pocket PC 2003 (ARMV4)"
+ />
+ <Platform
+ Name="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/testalpha.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="_WIN32_WCE=$(CEVER);$(CePlatform);ARM;_ARM_;ARMV4;UNDER_CE=$(CEVER);UNICODE;NDEBUG"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/testalpha.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalOptions="/r "
+ PreprocessorDefinitions="UNDER_CE=$(CEVER),_WIN32_WCE=$(CEVER),NDEBUG,UNICODE,_UNICODE,$(CePlatform),ARM,_ARM_,ARMV4"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/ALIGN:4096 /subsystem:$(CESubsystem) /MACHINE:ARM "
+ AdditionalDependencies="commctrl.lib coredll.lib aygshell.lib secchk.lib ccrtrtti.lib"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testalpha.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="$(CENoDefaultLib)"
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/testalpha.pdb"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ EntryPointSymbol="WinMainCRTStartup"
+ BaseAddress="0x00010000"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testalpha.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/testalpha.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="_WIN32_WCE=$(CEVER);$(CePlatform);ARM;_ARM_;ARMV4;UNDER_CE=$(CEVER);UNICODE;NDEBUG"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/testalpha.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalOptions="/r "
+ PreprocessorDefinitions="UNDER_CE=$(CEVER),_WIN32_WCE=$(CEVER),NDEBUG,UNICODE,_UNICODE,$(CePlatform),ARM,_ARM_,ARMV4"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/ALIGN:4096 /subsystem:$(CESubsystem) /MACHINE:ARM "
+ AdditionalDependencies="commctrl.lib coredll.lib aygshell.lib secchk.lib ccrtrtti.lib"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testalpha.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="$(CENoDefaultLib)"
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/testalpha.pdb"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ EntryPointSymbol="WinMainCRTStartup"
+ BaseAddress="0x00010000"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testalpha.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles="icon.bmp|$(SolutionDir)\..\test|\|0"
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/testalpha.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ InlineFunctionExpansion="2"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="1"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="_WIN32_WCE=$(CEVER);$(CePlatform);ARM;_ARM_;ARMV4;UNDER_CE=$(CEVER);UNICODE;NDEBUG"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/testalpha.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalOptions="/r "
+ PreprocessorDefinitions="UNDER_CE=$(CEVER),_WIN32_WCE=$(CEVER),NDEBUG,UNICODE,_UNICODE,$(CePlatform),ARM,_ARM_,ARMV4"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/ALIGN:4096 /subsystem:$(CESubsystem) "
+ AdditionalDependencies="commctrl.lib coredll.lib aygshell.lib"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testalpha.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="$(CENoDefaultLib)"
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/testalpha.pdb"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ LinkTimeCodeGeneration="1"
+ EntryPointSymbol="WinMainCRTStartup"
+ BaseAddress="0x00010000"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testalpha.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles="icon.bmp|$(SolutionDir)\..\test|\|0;sail.bmp|$(SolutionDir)\..\test|\|0;sample.bmp|$(SolutionDir)\..\test|\|0"
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/testalpha.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="DEBUG;ARM;_ARM_;ARMV4;UNDER_CE=$(CEVER);_WIN32_WCE=$(CEVER);$(CePlatform);UNICODE"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/testalpha.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalOptions="/r "
+ PreprocessorDefinitions="UNDER_CE=$(CEVER),_WIN32_WCE=$(CEVER),DEBUG,UNICODE,_UNICODE,$(CePlatform),ARM,_ARM_,ARMV4"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/ALIGN:4096 /subsystem:$(CESubsystem) /MACHINE:ARM "
+ AdditionalDependencies="commctrl.lib coredll.lib aygshell.lib secchk.lib ccrtrtti.lib"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testalpha.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="$(CENoDefaultLib)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/testalpha.pdb"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ EntryPointSymbol="WinMainCRTStartup"
+ BaseAddress="0x00010000"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testalpha.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/testalpha.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="DEBUG;ARM;_ARM_;ARMV4;UNDER_CE=$(CEVER);_WIN32_WCE=$(CEVER);$(CePlatform);UNICODE"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/testalpha.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalOptions="/r "
+ PreprocessorDefinitions="UNDER_CE=$(CEVER),_WIN32_WCE=$(CEVER),DEBUG,UNICODE,_UNICODE,$(CePlatform),ARM,_ARM_,ARMV4"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/ALIGN:4096 /subsystem:$(CESubsystem) /MACHINE:ARM "
+ AdditionalDependencies="commctrl.lib coredll.lib aygshell.lib secchk.lib ccrtrtti.lib"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testalpha.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="$(CENoDefaultLib)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/testalpha.pdb"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ EntryPointSymbol="WinMainCRTStartup"
+ BaseAddress="0x00010000"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testalpha.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles="icon.bmp|$(SolutionDir)\..\test|\|0"
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/testalpha.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="DEBUG;ARM;_ARM_;ARMV4;UNDER_CE=$(CEVER);_WIN32_WCE=$(CEVER);$(CePlatform);UNICODE"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/testalpha.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalOptions="/r "
+ PreprocessorDefinitions="UNDER_CE=$(CEVER),_WIN32_WCE=$(CEVER),DEBUG,UNICODE,_UNICODE,$(CePlatform),ARM,_ARM_,ARMV4"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/ALIGN:4096 /subsystem:$(CESubsystem) "
+ AdditionalDependencies="commctrl.lib coredll.lib aygshell.lib"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testalpha.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="$(CENoDefaultLib)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/testalpha.pdb"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ EntryPointSymbol="WinMainCRTStartup"
+ BaseAddress="0x00010000"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testalpha.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles="icon.bmp|$(SolutionDir)\..\test|\|0;sail.bmp|$(SolutionDir)\..\test|\|0;sample.bmp|$(SolutionDir)\..\test|\|0"
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\test\testalpha.c"
+ >
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/distrib/sdl-1.2.15/VisualCE/testtimer/testtimer.vcp b/distrib/sdl-1.2.15/VisualCE/testtimer/testtimer.vcp
new file mode 100644
index 0000000..1fc5e8e
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualCE/testtimer/testtimer.vcp
@@ -0,0 +1,874 @@
+# Microsoft eMbedded Visual Tools Project File - Name="testtimer" - Package Owner=<4>
+# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (WCE x86) Application" 0x8301
+# TARGTYPE "Win32 (WCE ARMV4) Application" 0xa301
+# TARGTYPE "Win32 (WCE ARM) Application" 0x8501
+# TARGTYPE "Win32 (WCE x86em) Application" 0x7f01
+# TARGTYPE "Win32 (WCE SH3) Application" 0x8101
+# TARGTYPE "Win32 (WCE MIPS) Application" 0x8201
+# TARGTYPE "Win32 (WCE emulator) Application" 0xa601
+
+CFG=testtimer - Win32 (WCE MIPS) Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "testtimer.vcn".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "testtimer.vcn" CFG="testtimer - Win32 (WCE MIPS) Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "testtimer - Win32 (WCE MIPS) Release" (based on "Win32 (WCE MIPS) Application")
+!MESSAGE "testtimer - Win32 (WCE MIPS) Debug" (based on "Win32 (WCE MIPS) Application")
+!MESSAGE "testtimer - Win32 (WCE SH3) Release" (based on "Win32 (WCE SH3) Application")
+!MESSAGE "testtimer - Win32 (WCE SH3) Debug" (based on "Win32 (WCE SH3) Application")
+!MESSAGE "testtimer - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Application")
+!MESSAGE "testtimer - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Application")
+!MESSAGE "testtimer - Win32 (WCE x86em) Release" (based on "Win32 (WCE x86em) Application")
+!MESSAGE "testtimer - Win32 (WCE x86em) Debug" (based on "Win32 (WCE x86em) Application")
+!MESSAGE "testtimer - Win32 (WCE ARMV4) Debug" (based on "Win32 (WCE ARMV4) Application")
+!MESSAGE "testtimer - Win32 (WCE ARMV4) Release" (based on "Win32 (WCE ARMV4) Application")
+!MESSAGE "testtimer - Win32 (WCE x86) Release" (based on "Win32 (WCE x86) Application")
+!MESSAGE "testtimer - Win32 (WCE x86) Debug" (based on "Win32 (WCE x86) Application")
+!MESSAGE "testtimer - Win32 (WCE emulator) Release" (based on "Win32 (WCE emulator) Application")
+!MESSAGE "testtimer - Win32 (WCE emulator) Debug" (based on "Win32 (WCE emulator) Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+# PROP ATL_Project 2
+
+!IF "$(CFG)" == "testtimer - Win32 (WCE MIPS) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "MIPSRel"
+# PROP BASE Intermediate_Dir "MIPSRel"
+# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "MIPSRel"
+# PROP Intermediate_Dir "MIPSRel"
+# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /I "..\..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE MIPS) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "MIPSDbg"
+# PROP BASE Intermediate_Dir "MIPSDbg"
+# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "MIPSDbg"
+# PROP Intermediate_Dir "MIPSDbg"
+# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "..\..\include" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE SH3) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "SH3Rel"
+# PROP BASE Intermediate_Dir "SH3Rel"
+# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "SH3Rel"
+# PROP Intermediate_Dir "SH3Rel"
+# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r
+CPP=shcl.exe
+# ADD BASE CPP /nologo /W3 /Oxs /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /Oxs /I "..\..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /M$(CECrtMT) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE SH3) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "SH3Dbg"
+# PROP BASE Intermediate_Dir "SH3Dbg"
+# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "SH3Dbg"
+# PROP Intermediate_Dir "SH3Dbg"
+# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r
+CPP=shcl.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "..\..\include" /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE ARM) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ARMRel"
+# PROP BASE Intermediate_Dir "ARMRel"
+# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ARMRel"
+# PROP Intermediate_Dir "ARMRel"
+# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /I "..\..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE ARM) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "ARMDbg"
+# PROP BASE Intermediate_Dir "ARMDbg"
+# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "ARMDbg"
+# PROP Intermediate_Dir "ARMDbg"
+# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "..\..\include" /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE x86em) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "X86EMRel"
+# PROP BASE Intermediate_Dir "X86EMRel"
+# PROP BASE CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "X86EMRel"
+# PROP Intermediate_Dir "X86EMRel"
+# PROP CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /stack:0x10000,0x1000 /subsystem:windows /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /stack:0x10000,0x1000 /subsystem:windows /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gz /Oxs /c
+# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "i486" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gz /Oxs /c
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE x86em) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "X86EMDbg"
+# PROP BASE Intermediate_Dir "X86EMDbg"
+# PROP BASE CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "X86EMDbg"
+# PROP Intermediate_Dir "X86EMDbg"
+# PROP CPU_ID "{D6518FF4-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /stack:0x10000,0x1000 /subsystem:windows /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /stack:0x10000,0x1000 /subsystem:windows /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /windowsce:emulation /MACHINE:IX86
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "i486" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gz /c
+# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "i486" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "WIN32" /D "STRICT" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gz /c
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "i486" /r
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE ARMV4) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "ARMV4Dbg"
+# PROP BASE Intermediate_Dir "ARMV4Dbg"
+# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "ARMV4Dbg"
+# PROP Intermediate_Dir "ARMV4Dbg"
+# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "..\..\include" /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE ARMV4) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ARMV4Rel"
+# PROP BASE Intermediate_Dir "ARMV4Rel"
+# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ARMV4Rel"
+# PROP Intermediate_Dir "ARMV4Rel"
+# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /O2 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /I "..\..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /O2 /M$(CECrtMT) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE x86) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "X86Rel"
+# PROP BASE Intermediate_Dir "X86Rel"
+# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "X86Rel"
+# PROP Intermediate_Dir "X86Rel"
+# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /Oxs /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /c
+# ADD CPP /nologo /W3 /Oxs /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE x86) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "X86Dbg"
+# PROP BASE Intermediate_Dir "X86Dbg"
+# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "X86Dbg"
+# PROP Intermediate_Dir "X86Dbg"
+# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c
+# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE emulator) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "emulatorRel"
+# PROP BASE Intermediate_Dir "emulatorRel"
+# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "emulatorRel"
+# PROP Intermediate_Dir "emulatorRel"
+# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /O2 /c
+# ADD CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /O2 /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE emulator) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "emulatorDbg"
+# PROP BASE Intermediate_Dir "emulatorDbg"
+# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "emulatorDbg"
+# PROP Intermediate_Dir "emulatorDbg"
+# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d "$(CePlatform)" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "_X86_" /d "x86" /d "_i386_" /r
+# ADD RSC /l 0x409 /d "$(CePlatform)" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "_X86_" /d "x86" /d "_i386_" /r
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c
+# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+
+!ENDIF
+
+# Begin Target
+
+# Name "testtimer - Win32 (WCE MIPS) Release"
+# Name "testtimer - Win32 (WCE MIPS) Debug"
+# Name "testtimer - Win32 (WCE SH3) Release"
+# Name "testtimer - Win32 (WCE SH3) Debug"
+# Name "testtimer - Win32 (WCE ARM) Release"
+# Name "testtimer - Win32 (WCE ARM) Debug"
+# Name "testtimer - Win32 (WCE x86em) Release"
+# Name "testtimer - Win32 (WCE x86em) Debug"
+# Name "testtimer - Win32 (WCE ARMV4) Debug"
+# Name "testtimer - Win32 (WCE ARMV4) Release"
+# Name "testtimer - Win32 (WCE x86) Release"
+# Name "testtimer - Win32 (WCE x86) Debug"
+# Name "testtimer - Win32 (WCE emulator) Release"
+# Name "testtimer - Win32 (WCE emulator) Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\test\testtimer.c
+
+!IF "$(CFG)" == "testtimer - Win32 (WCE MIPS) Release"
+
+DEP_CPP_TESTT=\
+ "..\..\include\SDL.h"\
+
+NODEP_CPP_TESTT=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE MIPS) Debug"
+
+DEP_CPP_TESTT=\
+ "..\..\include\SDL.h"\
+
+NODEP_CPP_TESTT=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE SH3) Release"
+
+DEP_CPP_TESTT=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE SH3) Debug"
+
+DEP_CPP_TESTT=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE ARM) Release"
+
+DEP_CPP_TESTT=\
+ "..\..\include\SDL.h"\
+
+NODEP_CPP_TESTT=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE ARM) Debug"
+
+DEP_CPP_TESTT=\
+ "..\..\include\SDL.h"\
+
+NODEP_CPP_TESTT=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE x86em) Release"
+
+NODEP_CPP_TESTT=\
+ "..\..\test\SDL.h"\
+
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE x86em) Debug"
+
+NODEP_CPP_TESTT=\
+ "..\..\test\SDL.h"\
+
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_TESTT=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_TESTT=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE x86) Release"
+
+NODEP_CPP_TESTT=\
+ "..\..\test\SDL.h"\
+
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE x86) Debug"
+
+NODEP_CPP_TESTT=\
+ "..\..\test\SDL.h"\
+
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE emulator) Release"
+
+NODEP_CPP_TESTT=\
+ "..\..\test\SDL.h"\
+
+
+!ELSEIF "$(CFG)" == "testtimer - Win32 (WCE emulator) Debug"
+
+NODEP_CPP_TESTT=\
+ "..\..\test\SDL.h"\
+
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/distrib/sdl-1.2.15/VisualCE/testtimer/testtimer.vcproj b/distrib/sdl-1.2.15/VisualCE/testtimer/testtimer.vcproj
new file mode 100644
index 0000000..c992d5b
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualCE/testtimer/testtimer.vcproj
@@ -0,0 +1,372 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8,00"
+ Name="testtimer"
+ ProjectGUID="{D482D7EE-6FF0-4254-9027-C59F8F03AB1F}"
+ RootNamespace="testtimer"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Pocket PC 2003 (ARMV4)"
+ />
+ <Platform
+ Name="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,4.20 /machine:ARM /ARMPADCODE"
+ AdditionalDependencies="secchk.lib ccrtrtti.lib"
+ OutputFile="$(OutDir)/testtimer.exe"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/testtimer.pdb"
+ SubSystem="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.01"
+ OutputFile="$(OutDir)/testtimer.exe"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/testtimer.pdb"
+ SubSystem="0"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_WINDOWS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,4.20 /machine:ARM /ARMPADCODE"
+ AdditionalDependencies="secchk.lib ccrtrtti.lib"
+ OutputFile="$(OutDir)/testtimer.exe"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/testtimer.pdb"
+ SubSystem="0"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_WINDOWS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.01"
+ OutputFile="$(OutDir)/testtimer.exe"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/testtimer.pdb"
+ SubSystem="0"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\test\testtimer.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/distrib/sdl-1.2.15/VisualCE/testwin/testwin.vcp b/distrib/sdl-1.2.15/VisualCE/testwin/testwin.vcp
new file mode 100644
index 0000000..32c5f57
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualCE/testwin/testwin.vcp
@@ -0,0 +1,672 @@
+# Microsoft eMbedded Visual Tools Project File - Name="testwin" - Package Owner=<4>
+# Microsoft eMbedded Visual Tools Generated Build File, Format Version 6.02
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (WCE x86) Application" 0x8301
+# TARGTYPE "Win32 (WCE ARM) Application" 0x8501
+# TARGTYPE "Win32 (WCE ARMV4) Application" 0xa301
+# TARGTYPE "Win32 (WCE SH3) Application" 0x8101
+# TARGTYPE "Win32 (WCE MIPS) Application" 0x8201
+# TARGTYPE "Win32 (WCE emulator) Application" 0xa601
+
+CFG=testwin - Win32 (WCE emulator) Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "testwin.vcn".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "testwin.vcn" CFG="testwin - Win32 (WCE emulator) Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "testwin - Win32 (WCE emulator) Release" (based on "Win32 (WCE emulator) Application")
+!MESSAGE "testwin - Win32 (WCE emulator) Debug" (based on "Win32 (WCE emulator) Application")
+!MESSAGE "testwin - Win32 (WCE ARMV4) Release" (based on "Win32 (WCE ARMV4) Application")
+!MESSAGE "testwin - Win32 (WCE ARMV4) Debug" (based on "Win32 (WCE ARMV4) Application")
+!MESSAGE "testwin - Win32 (WCE ARM) Debug" (based on "Win32 (WCE ARM) Application")
+!MESSAGE "testwin - Win32 (WCE ARM) Release" (based on "Win32 (WCE ARM) Application")
+!MESSAGE "testwin - Win32 (WCE SH3) Debug" (based on "Win32 (WCE SH3) Application")
+!MESSAGE "testwin - Win32 (WCE MIPS) Debug" (based on "Win32 (WCE MIPS) Application")
+!MESSAGE "testwin - Win32 (WCE x86) Release" (based on "Win32 (WCE x86) Application")
+!MESSAGE "testwin - Win32 (WCE x86) Debug" (based on "Win32 (WCE x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+# PROP ATL_Project 2
+
+!IF "$(CFG)" == "testwin - Win32 (WCE emulator) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "emulatorRel"
+# PROP BASE Intermediate_Dir "emulatorRel"
+# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "emulatorRel"
+# PROP Intermediate_Dir "emulatorRel"
+# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /O2 /c
+# ADD CPP /nologo /W3 /I "..\..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /O2 /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+
+!ELSEIF "$(CFG)" == "testwin - Win32 (WCE emulator) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "emulatorDbg"
+# PROP BASE Intermediate_Dir "emulatorDbg"
+# PROP BASE CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "emulatorDbg"
+# PROP Intermediate_Dir "emulatorDbg"
+# PROP CPU_ID "{32E52003-403E-442D-BE48-DE10F8C6131D}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d "$(CePlatform)" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "_X86_" /d "x86" /d "_i386_" /r
+# ADD RSC /l 0x409 /d "$(CePlatform)" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "_X86_" /d "x86" /d "_i386_" /r
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c
+# ADD CPP /nologo /W3 /Zi /Od /I "..\..\include" /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /GF /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+
+!ELSEIF "$(CFG)" == "testwin - Win32 (WCE ARMV4) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ARMV4Rel"
+# PROP BASE Intermediate_Dir "ARMV4Rel"
+# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ARMV4Rel"
+# PROP Intermediate_Dir "ARMV4Rel"
+# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "NDEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /O2 /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /I "..\..\include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /O2 /M$(CECrtMT) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+
+!ELSEIF "$(CFG)" == "testwin - Win32 (WCE ARMV4) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "ARMV4Dbg"
+# PROP BASE Intermediate_Dir "ARMV4Dbg"
+# PROP BASE CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "ARMV4Dbg"
+# PROP Intermediate_Dir "ARMV4Dbg"
+# PROP CPU_ID "{ECBEA43D-CD7B-4852-AD55-D4227B5D624B}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "DEBUG" /d "UNICODE" /d "_UNICODE" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /d "ARMV4" /r
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "..\..\include" /D "DEBUG" /D "ARM" /D "_ARM_" /D "ARMV4" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# ADD LINK32 commctrl.lib coredll.lib aygshell.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+
+!ELSEIF "$(CFG)" == "testwin - Win32 (WCE ARM) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "ARMDbg"
+# PROP BASE Intermediate_Dir "ARMDbg"
+# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "ARMDbg"
+# PROP Intermediate_Dir "ARMDbg"
+# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+
+!ELSEIF "$(CFG)" == "testwin - Win32 (WCE ARM) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ARMRel"
+# PROP BASE Intermediate_Dir "ARMRel"
+# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ARMRel"
+# PROP Intermediate_Dir "ARMRel"
+# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "ARM" /d "_ARM_" /r
+CPP=clarm.exe
+# ADD BASE CPP /nologo /W3 /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c
+# ADD CPP /nologo /W3 /I "../../include" /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "ARM" /D "_ARM_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "NDEBUG" /YX /Oxs /M$(CECrtMT) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+
+!ELSEIF "$(CFG)" == "testwin - Win32 (WCE SH3) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "SH3Dbg"
+# PROP BASE Intermediate_Dir "SH3Dbg"
+# PROP BASE CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "SH3Dbg"
+# PROP Intermediate_Dir "SH3Dbg"
+# PROP CPU_ID "{D6519020-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "SHx" /d "SH3" /d "_SH3_" /r
+CPP=shcl.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /I "../../include" /D "DEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:SH3
+
+!ELSEIF "$(CFG)" == "testwin - Win32 (WCE MIPS) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "MIPSDbg"
+# PROP BASE Intermediate_Dir "MIPSDbg"
+# PROP BASE CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "MIPSDbg"
+# PROP Intermediate_Dir "MIPSDbg"
+# PROP CPU_ID "{D6519010-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "MIPS" /d "_MIPS_" /r
+CPP=clmips.exe
+# ADD BASE CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /Zi /Od /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "UNICODE" /D "_UNICODE" /YX /M$(CECrtMTDebug) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"$(CENoDefaultLib)" /subsystem:$(CESubsystem) /MACHINE:MIPS
+
+!ELSEIF "$(CFG)" == "testwin - Win32 (WCE x86) Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "X86Rel"
+# PROP BASE Intermediate_Dir "X86Rel"
+# PROP BASE CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "X86Rel"
+# PROP Intermediate_Dir "X86Rel"
+# PROP CPU_ID "{D6518FF3-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "NDEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /GX- /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /Oxs /c
+# ADD CPP /nologo /W3 /GX- /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "_i386_" /D UNDER_CE=$(CEVersion) /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /D "NDEBUG" /YX /Gs8192 /GF /Oxs /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+# ADD LINK32 commctrl.lib coredll.lib $(CEx86Corelibc) /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /MACHINE:IX86
+
+!ELSEIF "$(CFG)" == "testwin - Win32 (WCE x86) Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "X86Dbg"
+# PROP BASE Intermediate_Dir "X86Dbg"
+# PROP BASE CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP BASE Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "X86Dbg"
+# PROP Intermediate_Dir "X86Dbg"
+# PROP CPU_ID "{D6518FFC-710F-11D3-99F2-00105A0DF099}"
+# PROP Platform_ID "{8A9A2F80-6887-11D3-842E-005004848CBA}"
+# PROP Target_Dir ""
+RSC=rc.exe
+# ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+# ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "DEBUG" /d "$(CePlatform)" /d "_X86_" /d "x86" /d "_i386_" /r
+CPP=cl.exe
+# ADD BASE CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /M$(CECrtMTDebug) /c
+# ADD CPP /nologo /W3 /GX- /Zi /Od /D "DEBUG" /D "_i386_" /D UNDER_CE=$(CEVersion) /D _WIN32_WCE=$(CEVersion) /D "$(CePlatform)" /D "i_386_" /D "UNICODE" /D "_UNICODE" /D "_X86_" /D "x86" /YX /Gs8192 /M$(CECrtMTDebug) /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# SUBTRACT BASE LINK32 /incremental:no
+# ADD LINK32 commctrl.lib coredll.lib /nologo /base:"0x00010000" /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /debug /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:$(CENoDefaultLib) /subsystem:$(CESubsystem) /align:"4096" /MACHINE:ARM
+# SUBTRACT LINK32 /incremental:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "testwin - Win32 (WCE emulator) Release"
+# Name "testwin - Win32 (WCE emulator) Debug"
+# Name "testwin - Win32 (WCE ARMV4) Release"
+# Name "testwin - Win32 (WCE ARMV4) Debug"
+# Name "testwin - Win32 (WCE ARM) Debug"
+# Name "testwin - Win32 (WCE ARM) Release"
+# Name "testwin - Win32 (WCE SH3) Debug"
+# Name "testwin - Win32 (WCE MIPS) Debug"
+# Name "testwin - Win32 (WCE x86) Release"
+# Name "testwin - Win32 (WCE x86) Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\test\testwin.c
+
+!IF "$(CFG)" == "testwin - Win32 (WCE emulator) Release"
+
+DEP_CPP_TESTW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testwin - Win32 (WCE emulator) Debug"
+
+DEP_CPP_TESTW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testwin - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_TESTW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testwin - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_TESTW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_config.h"\
+ "..\..\include\SDL_config_amiga.h"\
+ "..\..\include\SDL_config_dreamcast.h"\
+ "..\..\include\SDL_config_macos.h"\
+ "..\..\include\SDL_config_macosx.h"\
+ "..\..\include\SDL_config_os2.h"\
+ "..\..\include\SDL_config_win32.h"\
+ "..\..\include\SDL_cpuinfo.h"\
+ "..\..\include\SDL_endian.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_loadso.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_platform.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_stdinc.h"\
+ "..\..\include\SDL_thread.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testwin - Win32 (WCE ARM) Debug"
+
+DEP_CPP_TESTW=\
+ "..\..\include\SDL.h"\
+
+NODEP_CPP_TESTW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testwin - Win32 (WCE ARM) Release"
+
+DEP_CPP_TESTW=\
+ "..\..\include\SDL.h"\
+
+NODEP_CPP_TESTW=\
+ "..\include\begin_code.h"\
+ "..\include\close_code.h"\
+ "..\include\SDL_active.h"\
+ "..\include\SDL_audio.h"\
+ "..\include\SDL_cdrom.h"\
+ "..\include\SDL_config.h"\
+ "..\include\SDL_config_amiga.h"\
+ "..\include\SDL_config_dreamcast.h"\
+ "..\include\SDL_config_macos.h"\
+ "..\include\SDL_config_macosx.h"\
+ "..\include\SDL_config_os2.h"\
+ "..\include\SDL_config_win32.h"\
+ "..\include\SDL_config_wince.h"\
+ "..\include\SDL_cpuinfo.h"\
+ "..\include\SDL_endian.h"\
+ "..\include\SDL_error.h"\
+ "..\include\SDL_events.h"\
+ "..\include\SDL_joystick.h"\
+ "..\include\SDL_keyboard.h"\
+ "..\include\SDL_keysym.h"\
+ "..\include\SDL_loadso.h"\
+ "..\include\SDL_main.h"\
+ "..\include\SDL_mouse.h"\
+ "..\include\SDL_mutex.h"\
+ "..\include\SDL_platform.h"\
+ "..\include\SDL_quit.h"\
+ "..\include\SDL_rwops.h"\
+ "..\include\SDL_stdinc.h"\
+ "..\include\SDL_thread.h"\
+ "..\include\SDL_timer.h"\
+ "..\include\SDL_version.h"\
+ "..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testwin - Win32 (WCE SH3) Debug"
+
+DEP_CPP_TESTW=\
+ "..\..\include\begin_code.h"\
+ "..\..\include\close_code.h"\
+ "..\..\include\SDL.h"\
+ "..\..\include\SDL_active.h"\
+ "..\..\include\SDL_audio.h"\
+ "..\..\include\SDL_byteorder.h"\
+ "..\..\include\SDL_cdrom.h"\
+ "..\..\include\SDL_error.h"\
+ "..\..\include\SDL_events.h"\
+ "..\..\include\SDL_getenv.h"\
+ "..\..\include\SDL_joystick.h"\
+ "..\..\include\SDL_keyboard.h"\
+ "..\..\include\SDL_keysym.h"\
+ "..\..\include\SDL_main.h"\
+ "..\..\include\SDL_mouse.h"\
+ "..\..\include\SDL_mutex.h"\
+ "..\..\include\SDL_quit.h"\
+ "..\..\include\SDL_rwops.h"\
+ "..\..\include\SDL_timer.h"\
+ "..\..\include\SDL_types.h"\
+ "..\..\include\SDL_version.h"\
+ "..\..\include\SDL_video.h"\
+
+
+!ELSEIF "$(CFG)" == "testwin - Win32 (WCE MIPS) Debug"
+
+NODEP_CPP_TESTW=\
+ "..\..\test\SDL.h"\
+
+
+!ELSEIF "$(CFG)" == "testwin - Win32 (WCE x86) Release"
+
+NODEP_CPP_TESTW=\
+ "..\..\test\SDL.h"\
+
+
+!ELSEIF "$(CFG)" == "testwin - Win32 (WCE x86) Debug"
+
+NODEP_CPP_TESTW=\
+ "..\..\test\SDL.h"\
+
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/distrib/sdl-1.2.15/VisualCE/testwin/testwin.vcproj b/distrib/sdl-1.2.15/VisualCE/testwin/testwin.vcproj
new file mode 100644
index 0000000..f64303d
--- /dev/null
+++ b/distrib/sdl-1.2.15/VisualCE/testwin/testwin.vcproj
@@ -0,0 +1,702 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8,00"
+ Name="testwin"
+ ProjectGUID="{DC516978-88CB-4F9A-A39A-C351C258613B}"
+ RootNamespace="testwin"
+ >
+ <Platforms>
+ <Platform
+ Name="Smartphone 2003 (ARMV4)"
+ />
+ <Platform
+ Name="Pocket PC 2003 (ARMV4)"
+ />
+ <Platform
+ Name="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/testwin.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ PreprocessorDefinitions="_WIN32_WCE=$(CEVER);$(CePlatform);ARM;_ARM_;ARMV4;UNDER_CE=$(CEVER);UNICODE;NDEBUG"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/testwin.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalOptions="/r "
+ PreprocessorDefinitions="UNDER_CE=$(CEVER),_WIN32_WCE=$(CEVER),NDEBUG,UNICODE,_UNICODE,$(CePlatform),ARM,_ARM_,ARMV4"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/ALIGN:4096 /subsystem:$(CESubsystem) /MACHINE:ARM "
+ AdditionalDependencies="commctrl.lib coredll.lib aygshell.lib secchk.lib ccrtrtti.lib"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testwin.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="$(CENoDefaultLib)"
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/testwin.pdb"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ EntryPointSymbol="WinMainCRTStartup"
+ BaseAddress="0x00010000"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testwin.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/testwin.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="_WIN32_WCE=$(CEVER);$(CePlatform);ARM;_ARM_;ARMV4;UNDER_CE=$(CEVER);UNICODE;NDEBUG"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/testwin.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalOptions="/r "
+ PreprocessorDefinitions="UNDER_CE=$(CEVER),_WIN32_WCE=$(CEVER),NDEBUG,UNICODE,_UNICODE,$(CePlatform),ARM,_ARM_,ARMV4"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/ALIGN:4096 /subsystem:$(CESubsystem) /MACHINE:ARM "
+ AdditionalDependencies="commctrl.lib coredll.lib aygshell.lib secchk.lib ccrtrtti.lib"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testwin.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="$(CENoDefaultLib)"
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/testwin.pdb"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ EntryPointSymbol="WinMainCRTStartup"
+ BaseAddress="0x00010000"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testwin.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles="sample.bmp|$(SolutionDir)\..\test|\|0"
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/testwin.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="_WIN32_WCE=$(CEVER);$(CePlatform);ARM;_ARM_;ARMV4;UNDER_CE=$(CEVER);UNICODE;NDEBUG"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/testwin.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalOptions="/r "
+ PreprocessorDefinitions="UNDER_CE=$(CEVER),_WIN32_WCE=$(CEVER),NDEBUG,UNICODE,_UNICODE,$(CePlatform),ARM,_ARM_,ARMV4"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/ALIGN:4096 /subsystem:$(CESubsystem) "
+ AdditionalDependencies="commctrl.lib coredll.lib aygshell.lib"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testwin.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="$(CENoDefaultLib)"
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/testwin.pdb"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ EntryPointSymbol="WinMainCRTStartup"
+ BaseAddress="0x00010000"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testwin.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/testwin.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="DEBUG;ARM;_ARM_;ARMV4;UNDER_CE=$(CEVER);_WIN32_WCE=$(CEVER);$(CePlatform);UNICODE"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/testwin.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalOptions="/r "
+ PreprocessorDefinitions="UNDER_CE=$(CEVER),_WIN32_WCE=$(CEVER),DEBUG,UNICODE,_UNICODE,$(CePlatform),ARM,_ARM_,ARMV4"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/ALIGN:4096 /subsystem:$(CESubsystem) /MACHINE:ARM "
+ AdditionalDependencies="commctrl.lib coredll.lib aygshell.lib secchk.lib ccrtrtti.lib"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testwin.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="$(CENoDefaultLib)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/testwin.pdb"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ EntryPointSymbol="WinMainCRTStartup"
+ BaseAddress="0x00010000"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testwin.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/testwin.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="DEBUG;ARM;_ARM_;ARMV4;UNDER_CE=$(CEVER);_WIN32_WCE=$(CEVER);$(CePlatform);UNICODE"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/testwin.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalOptions="/r "
+ PreprocessorDefinitions="UNDER_CE=$(CEVER),_WIN32_WCE=$(CEVER),DEBUG,UNICODE,_UNICODE,$(CePlatform),ARM,_ARM_,ARMV4"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/ALIGN:4096 /subsystem:$(CESubsystem) /MACHINE:ARM "
+ AdditionalDependencies="commctrl.lib coredll.lib aygshell.lib secchk.lib ccrtrtti.lib"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testwin.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="$(CENoDefaultLib)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/testwin.pdb"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ EntryPointSymbol="WinMainCRTStartup"
+ BaseAddress="0x00010000"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testwin.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles="sample.bmp|$(SolutionDir)\..\test|\|0"
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName="$(PlatformName)\$(ConfigurationName)/testwin.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\include"
+ PreprocessorDefinitions="DEBUG;ARM;_ARM_;ARMV4;UNDER_CE=$(CEVER);_WIN32_WCE=$(CEVER);$(CePlatform);UNICODE"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/testwin.pch"
+ AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
+ ObjectFile="$(PlatformName)\$(ConfigurationName)/"
+ ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalOptions="/r "
+ PreprocessorDefinitions="UNDER_CE=$(CEVER),_WIN32_WCE=$(CEVER),DEBUG,UNICODE,_UNICODE,$(CePlatform),ARM,_ARM_,ARMV4"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/ALIGN:4096 /subsystem:$(CESubsystem) "
+ AdditionalDependencies="commctrl.lib coredll.lib aygshell.lib"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testwin.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="$(CENoDefaultLib)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/testwin.pdb"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ EntryPointSymbol="WinMainCRTStartup"
+ BaseAddress="0x00010000"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile="$(PlatformName)\$(ConfigurationName)/testwin.bsc"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="..\..\test\testwin.c"
+ >
+ <FileConfiguration
+ Name="Release|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Smartphone 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Pocket PC 2003 (ARMV4)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="0"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/distrib/sdl-1.2.15/Watcom-OS2.zip b/distrib/sdl-1.2.15/Watcom-OS2.zip
new file mode 100644
index 0000000..b3d1a67
--- /dev/null
+++ b/distrib/sdl-1.2.15/Watcom-OS2.zip
Binary files differ
diff --git a/distrib/sdl-1.2.15/Watcom-Win32.zip b/distrib/sdl-1.2.15/Watcom-Win32.zip
new file mode 100644
index 0000000..c60af6d
--- /dev/null
+++ b/distrib/sdl-1.2.15/Watcom-Win32.zip
Binary files differ
diff --git a/distrib/sdl-1.2.15/WhatsNew b/distrib/sdl-1.2.15/WhatsNew
new file mode 100644
index 0000000..927fdd2
--- /dev/null
+++ b/distrib/sdl-1.2.15/WhatsNew
@@ -0,0 +1,727 @@
+
+This is a list of API changes in SDL's version history.
+
+Version 1.0:
+
+1.2.14:
+ Added cast macros for correct usage with C++:
+ SDL_reinterpret_cast(type, expression)
+ SDL_static_cast(type, expression)
+
+ Added SDL_VIDEO_FULLSCREEN_DISPLAY as a preferred synonym for
+ SDL_VIDEO_FULLSCREEN_HEAD on X11.
+
+ Added SDL_DISABLE_LOCK_KEYS environment variable to enable normal
+ up/down events for Caps-Lock and Num-Lock keys.
+
+1.2.13:
+ Added SDL_BUTTON_X1 and SDL_BUTTON_X2 constants.
+
+1.2.12:
+ Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling
+ of the screensaver on Mac OS X and X11.
+
+1.2.10:
+ If SDL_OpenAudio() is passed zero for the desired format
+ fields, the following environment variables will be used
+ to fill them in:
+ SDL_AUDIO_FREQUENCY
+ SDL_AUDIO_FORMAT
+ SDL_AUDIO_CHANNELS
+ SDL_AUDIO_SAMPLES
+ If an environment variable is not specified, it will be set
+ to a reasonable default value.
+
+ Added support for the SDL_VIDEO_FULLSCREEN_HEAD environment
+ variable, currently supported on X11 Xinerama configurations.
+
+ Added SDL_GL_SWAP_CONTROL to wait for vsync in OpenGL applications.
+
+ Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration.
+
+ Added current_w and current_h to the SDL_VideoInfo structure,
+ which is set to the desktop resolution during video intialization,
+ and then set to the current resolution when a video mode is set.
+
+ SDL_SetVideoMode() now accepts 0 for width or height and will use
+ the current video mode (or the desktop mode if no mode has been set.)
+
+ Added SDL_GetKeyRepeat()
+
+ Added SDL_config.h, with defaults for various build environments.
+
+1.2.7:
+ Added CPU feature detection functions to SDL_cpuinfo.h:
+ SDL_HasRDTSC(), SDL_HasMMX(), SDL_Has3DNow(), SDL_HasSSE(),
+ SDL_HasAltiVec()
+ Added function to create RWops from const memory: SDL_RWFromConstMem()
+
+1.2.6:
+ Added SDL_LoadObject(), SDL_LoadFunction(), and SDL_UnloadObject()
+
+ Added SDL_GL_MULTISAMPLEBUFFERS and SDL_GL_MULTISAMPLESAMPLES for FSAA
+
+1.2.5:
+ Added SDL_BUTTON_WHEELUP (4) and SDL_BUTTON_WHEELDOWN (5)
+
+ Added SDL_GL_STEREO for stereoscopic OpenGL contexts
+
+1.2.0:
+ Added SDL_VIDEOEXPOSE event to signal that the screen needs to
+ be redrawn. This is currently only delivered to OpenGL windows
+ on X11, though it may be delivered in the future when the video
+ memory is lost under DirectX.
+
+1.1.8:
+ You can pass SDL_NOFRAME to SDL_VideoMode() to create a window
+ that has no title bar or frame decoration. Fullscreen video
+ modes automatically have this flag set.
+
+ Added a function to query the clipping rectangle for a surface:
+ void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect)
+
+ Added a function to query the current event filter:
+ SDL_EventFilter SDL_GetEventFilter(void)
+
+ If you pass -1 to SDL_ShowCursor(), it won't change the current
+ cursor visibility state, but will still return it.
+
+ SDL_LockSurface() and SDL_UnlockSurface() are recursive, meaning
+ you can nest them as deep as you want, as long as each lock call
+ has a matching unlock call. The surface remains locked until the
+ last matching unlock call.
+
+ Note that you may not blit to or from a locked surface.
+
+1.1.7:
+ The SDL_SetGammaRamp() and SDL_GetGammaRamp() functions now take
+ arrays of Uint16 values instead of Uint8 values. For the most part,
+ you can just take your old values and shift them up 8 bits to get
+ new correct values for your gamma ramps.
+
+ You can pass SDL_RLEACCEL in flags passed to SDL_ConvertSurface()
+ and SDL will try to RLE accelerate colorkey and alpha blits in the
+ resulting surface.
+
+1.1.6:
+ Added a function to return the thread ID of a specific thread:
+ Uint32 SDL_GetThreadID(SDL_Thread *thread)
+ If 'thread' is NULL, this function returns the id for this thread.
+
+1.1.5:
+ The YUV overlay structure has been changed to use an array of
+ pitches and pixels representing the planes of a YUV image, to
+ better enable hardware acceleration. The YV12 and IYUV formats
+ each have three planes, corresponding to the Y, U, and V portions
+ of the image, while packed pixel YUV formats just have one plane.
+
+ For palettized mode (8bpp), the screen colormap is now split in
+ a physical and a logical palette. The physical palette determines
+ what colours the screen pixels will get when displayed, and the
+ logical palette controls the mapping from blits to/from the screen.
+ A new function, SDL_SetPalette() has been added to change
+ logical and physical palettes separately. SDL_SetColors() works
+ just as before, and is equivalent to calling SDL_SetPalette() with
+ a flag argument of (SDL_LOGPAL|SDL_PHYSPAL).
+
+ SDL_BlitSurface() no longer modifies the source rectangle, only the
+ destination rectangle. The width/height members of the destination
+ rectangle are ignored, only the position is used.
+
+ The old source clipping function SDL_SetClipping() has been replaced
+ with a more useful function to set the destination clipping rectangle:
+ SDL_bool SDL_SetClipRect(SDL_Surface *surface, SDL_Rect *rect)
+
+ Added a function to see what subsystems have been initialized:
+ Uint32 SDL_WasInit(Uint32 flags)
+
+ The Big Alpha Flip: SDL now treats alpha as opacity like everybody
+ else, and not as transparency:
+
+ A new cpp symbol: SDL_ALPHA_OPAQUE is defined as 255
+ A new cpp symbol: SDL_ALPHA_TRANSPARENT is defined as 0
+ Values between 0 and 255 vary from fully transparent to fully opaque.
+
+ New functions:
+ SDL_DisplayFormatAlpha()
+ Returns a surface converted to a format with alpha-channel
+ that can be blit efficiently to the screen. (In other words,
+ like SDL_DisplayFormat() but the resulting surface has
+ an alpha channel.) This is useful for surfaces with alpha.
+ SDL_MapRGBA()
+ Works as SDL_MapRGB() but takes an additional alpha parameter.
+ SDL_GetRGBA()
+ Works as SDL_GetRGB() but also returns the alpha value
+ (SDL_ALPHA_OPAQUE for formats without an alpha channel)
+
+ Both SDL_GetRGB() and SDL_GetRGBA() now always return values in
+ the [0..255] interval. Previously, SDL_GetRGB() would return
+ (0xf8, 0xfc, 0xf8) for a completely white pixel in RGB565 format.
+ (N.B.: This is broken for bit fields < 3 bits.)
+
+ SDL_MapRGB() returns pixels in which the alpha channel is set opaque.
+
+ SDL_SetAlpha() can now be used for both setting the per-surface
+ alpha, using the new way of thinking of alpha, and also to enable
+ and disable per-pixel alpha blending for surfaces with an alpha
+ channel:
+ To disable alpha blending:
+ SDL_SetAlpha(surface, 0, 0);
+ To re-enable alpha blending:
+ SDL_SetAlpha(surface, SDL_SRCALPHA, 0);
+ Surfaces with an alpha channel have blending enabled by default.
+
+ SDL_SetAlpha() now accepts SDL_RLEACCEL as a flag, which requests
+ RLE acceleration of blits, just as like with SDL_SetColorKey().
+ This flag can be set for both surfaces with an alpha channel
+ and surfaces with an alpha value set by SDL_SetAlpha().
+ As always, RLE surfaces must be locked before pixel access is
+ allowed, and unlocked before any other SDL operations are done
+ on it.
+
+ The blit semantics for surfaces with and without alpha and colorkey
+ have now been defined:
+
+ RGBA->RGB:
+ SDL_SRCALPHA set:
+ alpha-blend (using alpha-channel).
+ SDL_SRCCOLORKEY ignored.
+ SDL_SRCALPHA not set:
+ copy RGB.
+ if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ RGB values of the source colour key, ignoring alpha in the
+ comparison.
+
+ RGB->RGBA:
+ SDL_SRCALPHA set:
+ alpha-blend (using the source per-surface alpha value);
+ set destination alpha to opaque.
+ SDL_SRCALPHA not set:
+ copy RGB, set destination alpha to opaque.
+ both:
+ if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ source colour key.
+
+ RGBA->RGBA:
+ SDL_SRCALPHA set:
+ alpha-blend (using the source alpha channel) the RGB values;
+ leave destination alpha untouched. [Note: is this correct?]
+ SDL_SRCCOLORKEY ignored.
+ SDL_SRCALPHA not set:
+ copy all of RGBA to the destination.
+ if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ RGB values of the source colour key, ignoring alpha in the
+ comparison.
+
+ RGB->RGB:
+ SDL_SRCALPHA set:
+ alpha-blend (using the source per-surface alpha value).
+ SDL_SRCALPHA not set:
+ copy RGB.
+ both:
+ if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ source colour key.
+
+ As a special case, blits from surfaces with per-surface alpha
+ value of 128 (50% transparency) are optimised and much faster
+ than other alpha values. This does not apply to surfaces with
+ alpha channels (per-pixel alpha).
+
+ New functions for manipulating the gamma of the display have
+ been added:
+ int SDL_SetGamma(float red, float green, float blue);
+ int SDL_SetGammaRamp(Uint8 *red, Uint8 *green, Uint8 *blue);
+ int SDL_GetGammaRamp(Uint8 *red, Uint8 *green, Uint8 *blue);
+ Gamma ramps are tables with 256 entries which map the screen color
+ components into actually displayed colors. For an example of
+ implementing gamma correction and gamma fades, see test/testgamma.c
+ Gamma control is not supported on all hardware.
+
+1.1.4:
+ The size of the SDL_CDtrack structure changed from 8 to 12 bytes
+ as the size of the length member was extended to 32 bits.
+
+ You can now use SDL for 2D blitting with a GL mode by passing the
+ SDL_OPENGLBLIT flag to SDL_SetVideoMode(). You can specify 16 or
+ 32 bpp, and the data in the framebuffer is put into the GL scene
+ when you call SDL_UpdateRects(), and the scene will be visible
+ when you call SDL_GL_SwapBuffers().
+
+ Run the "testgl" test program with the -logo command line option
+ to see an example of this blending of 2D and 3D in SDL.
+
+1.1.3:
+ Added SDL_FreeRW() to the API, to complement SDL_AllocRW()
+
+ Added resizable window support - just add SDL_RESIZABLE to the
+ SDL_SetVideoMode() flags, and then wait for SDL_VIDEORESIZE events.
+ See SDL_events.h for details on the new SDL_ResizeEvent structure.
+
+ Added condition variable support, based on mutexes and semaphores.
+ SDL_CreateCond()
+ SDL_DestroyCond()
+ SDL_CondSignal()
+ SDL_CondBroadcast()
+ SDL_CondWait()
+ SDL_CondTimedWait()
+ The new function prototypes are in SDL_mutex.h
+
+ Added counting semaphore support, based on the mutex primitive.
+ SDL_CreateSemaphore()
+ SDL_DestroySemaphore()
+ SDL_SemWait()
+ SDL_SemTryWait()
+ SDL_SemWaitTimeout()
+ SDL_SemPost()
+ SDL_SemValue()
+ The new function prototypes are in SDL_mutex.h
+
+ Added support for asynchronous blitting. To take advantage of this,
+ you must set the SDL_ASYNCBLIT flag when setting the video mode and
+ creating surfaces that you want accelerated in this way. You must
+ lock surfaces that have this flag set, and the lock will block until
+ any queued blits have completed.
+
+ Added YUV video overlay support.
+ The supported YUV formats are: YV12, IYUV, YUY2, UYVY, and YVYU.
+ This function creates an overlay surface:
+ SDL_CreateYUVOverlay()
+ You must lock and unlock the overlay to get access to the data:
+ SDL_LockYUVOverlay() SDL_UnlockYUVOverlay()
+ You can then display the overlay:
+ SDL_DisplayYUVOverlay()
+ You must free the overlay when you are done using it:
+ SDL_FreeYUVOverlay()
+ See SDL_video.h for the full function prototypes.
+
+ The joystick hat position constants have been changed:
+ Old constant New constant
+ ------------ ------------
+ 0 SDL_HAT_CENTERED
+ 1 SDL_HAT_UP
+ 2 SDL_HAT_RIGHTUP
+ 3 SDL_HAT_RIGHT
+ 4 SDL_HAT_RIGHTDOWN
+ 5 SDL_HAT_DOWN
+ 6 SDL_HAT_LEFTDOWN
+ 7 SDL_HAT_LEFT
+ 8 SDL_HAT_LEFTUP
+ The new constants are bitmasks, so you can check for the
+ individual axes like this:
+ if ( hat_position & SDL_HAT_UP ) {
+ }
+ and you'll catch left-up, up, and right-up.
+
+1.1.2:
+ Added multiple timer support:
+ SDL_AddTimer() and SDL_RemoveTimer()
+
+ SDL_WM_SetIcon() now respects the icon colorkey if mask is NULL.
+
+1.1.0:
+ Added initial OpenGL support.
+ First set GL attributes (such as RGB depth, alpha depth, etc.)
+ SDL_GL_SetAttribute()
+ Then call SDL_SetVideoMode() with the SDL_OPENGL flag.
+ Perform all of your normal GL drawing.
+ Finally swap the buffers with the new SDL function:
+ SDL_GL_SwapBuffers()
+ See the new 'testgl' test program for an example of using GL with SDL.
+
+ You can load GL extension functions by using the function:
+ SDL_GL_LoadProcAddress()
+
+ Added functions to initialize and cleanup specific SDL subsystems:
+ SDL_InitSubSystem() and SDL_QuitSubSystem()
+
+ Added user-defined event type:
+ typedef struct {
+ Uint8 type;
+ int code;
+ void *data1;
+ void *data2;
+ } SDL_UserEvent;
+ This structure is in the "user" member of an SDL_Event.
+
+ Added a function to push events into the event queue:
+ SDL_PushEvent()
+
+ Example of using the new SDL user-defined events:
+ {
+ SDL_Event event;
+
+ event.type = SDL_USEREVENT;
+ event.user.code = my_event_code;
+ event.user.data1 = significant_data;
+ event.user.data2 = 0;
+ SDL_PushEvent(&event);
+ }
+
+ Added a function to get mouse deltas since last query:
+ SDL_GetRelativeMouseState()
+
+ Added a boolean datatype to SDL_types.h:
+ SDL_bool = { SDL_TRUE, SDL_FALSE }
+
+ Added a function to get the current audio status:
+ SDL_GetAudioState();
+ It returns one of:
+ SDL_AUDIO_STOPPED,
+ SDL_AUDIO_PLAYING,
+ SDL_AUDIO_PAUSED
+
+ Added an AAlib driver (ASCII Art) - by Stephane Peter.
+
+1.0.6:
+ The input grab state is reset after each call to SDL_SetVideoMode().
+ The input is grabbed by default in fullscreen mode, and ungrabbed in
+ windowed mode. If you want to set input grab to a particular value,
+ you should set it after each call to SDL_SetVideoMode().
+
+1.0.5:
+ Exposed SDL_AudioInit(), SDL_VideoInit()
+ Added SDL_AudioDriverName() and SDL_VideoDriverName()
+
+ Added new window manager function:
+ SDL_WM_ToggleFullScreen()
+ This is currently implemented only on Linux
+
+ The ALT-ENTER code has been removed - it's not appropriate for a
+ lib to bind keys when they aren't even emergency escape sequences.
+
+ ALT-ENTER functionality can be implemented with the following code:
+
+ int Handle_AltEnter(const SDL_Event *event)
+ {
+ if ( event->type == SDL_KEYDOWN ) {
+ if ( (event->key.keysym.sym == SDLK_RETURN) &&
+ (event->key.keysym.mod & KMOD_ALT) ) {
+ SDL_WM_ToggleFullScreen(SDL_GetVideoSurface());
+ return(0);
+ }
+ }
+ return(1);
+ }
+ SDL_SetEventFilter(Handle_AltEnter);
+
+1.0.3:
+ Under X11, if you grab the input and hide the mouse cursor,
+ the mouse will go into a "relative motion" mode where you
+ will always get relative motion events no matter how far in
+ each direction you move the mouse - relative motion is not
+ bounded by the edges of the window (though the absolute values
+ of the mouse positions are clamped by the size of the window).
+ The SVGAlib, framebuffer console, and DirectInput drivers all
+ have this behavior naturally, and the GDI and BWindow drivers
+ never go into "relative motion" mode.
+
+1.0.2:
+ Added a function to enable keyboard repeat:
+ SDL_EnableKeyRepeat()
+
+ Added a function to grab the mouse and keyboard input
+ SDL_WM_GrabInput()
+
+ Added a function to iconify the window.
+ SDL_WM_IconifyWindow()
+ If this function succeeds, the application will receive an event
+ signaling SDL_APPACTIVE event
+
+1.0.1:
+ Added constants to SDL_audio.h for 16-bit native byte ordering:
+ AUDIO_U16SYS, AUDIO_S16SYS
+
+1.0.0:
+ New public release
+
+Version 0.11:
+
+0.11.5:
+ A new function SDL_GetVideoSurface() has been added, and returns
+ a pointer to the current display surface.
+
+ SDL_AllocSurface() has been renamed SDL_CreateRGBSurface(), and
+ a new function SDL_CreateRGBSurfaceFrom() has been added to allow
+ creating an SDL surface from an existing pixel data buffer.
+
+ Added SDL_GetRGB() to the headers and documentation.
+
+0.11.4:
+ SDL_SetLibraryPath() is no longer meaningful, and has been removed.
+
+0.11.3:
+ A new flag for SDL_Init(), SDL_INIT_NOPARACHUTE, prevents SDL from
+ installing fatal signal handlers on operating systems that support
+ them.
+
+Version 0.9:
+
+0.9.15:
+ SDL_CreateColorCursor() has been removed. Color cursors should
+ be implemented as sprites, blitted by the application when the
+ cursor moves. To get smooth color cursor updates when the app
+ is busy, pass the SDL_INIT_EVENTTHREAD flag to SDL_Init(). This
+ allows you to handle the mouse motion in another thread from an
+ event filter function, but is currently only supported by Linux
+ and BeOS. Note that you'll have to protect the display surface
+ from multi-threaded access by using mutexes if you do this.
+
+ Thread-safe surface support has been removed from SDL.
+ This makes blitting somewhat faster, by removing SDL_MiddleBlit().
+ Code that used SDL_MiddleBlit() should use SDL_LowerBlit() instead.
+ You can make your surfaces thread-safe by allocating your own
+ mutex and making lock/unlock calls around accesses to your surface.
+
+0.9.14:
+ SDL_GetMouseState() now takes pointers to int rather than Uint16.
+
+ If you set the SDL_WINDOWID environment variable under UNIX X11,
+ SDL will use that as the main window instead of creating it's own.
+ This is an unsupported extension to SDL, and not portable at all.
+
+0.9.13:
+ Added a function SDL_SetLibraryPath() which can be used to specify
+ the directory containing the SDL dynamic libraries. This is useful
+ for commercial applications which ship with particular versions
+ of the libraries, and for security on multi-user systems.
+ If this function is not used, the default system directories are
+ searched using the native dynamic object loading mechanism.
+
+ In order to support C linkage under Visual C++, you must declare
+ main() without any return type:
+ main(int argc, char *argv[]) {
+ /* Do the program... */
+ return(0);
+ }
+ C++ programs should also return a value if compiled under VC++.
+
+ The blit_endian member of the SDL_VideoInfo struct has been removed.
+
+ SDL_SymToASCII() has been replaced with SDL_GetKeyName(), so there
+ is now no longer any function to translate a keysym to a character.
+
+ The SDL_keysym structure has been extended with a 'scancode' and
+ 'unicode' member. The 'scancode' is a hardware specific scancode
+ for the key that was pressed, and may be 0. The 'unicode' member
+ is a 16-bit UNICODE translation of the key that was pressed along
+ with any modifiers or compose keys that have been pressed.
+ If no UNICODE translation exists for the key, 'unicode' will be 0.
+
+ Added a function SDL_EnableUNICODE() to enable/disable UNICODE
+ translation of character keypresses. Translation defaults off.
+
+ To convert existing code to use the new API, change code which
+ uses SDL_SymToASCII() to get the keyname to use SDL_GetKeyName(),
+ and change code which uses it to get the ASCII value of a sym to
+ use the 'unicode' member of the event keysym.
+
+0.9.12:
+ There is partial support for 64-bit datatypes. I don't recommend
+ you use this if you have a choice, because 64-bit datatypes are not
+ supported on many platforms. On platforms for which it is supported,
+ the SDL_HAS_64BIT_TYPE C preprocessor define will be enabled, and
+ you can use the Uint64 and Sint64 datatypes.
+
+ Added functions to SDL_endian.h to support 64-bit datatypes:
+ SDL_SwapLE64(), SDL_SwapBE64(),
+ SDL_ReadLE64(), SDL_ReadBE64(), SDL_WriteLE64(), SDL_WriteBE64()
+
+ A new member "len_ratio" has been added to the SDL_AudioCVT structure,
+ and allows you to determine either the original buffer length or the
+ converted buffer length, given the other.
+
+ A new function SDL_FreeWAV() has been added to the API to free data
+ allocated by SDL_LoadWAV_RW(). This is necessary under Win32 since
+ the gcc compiled DLL uses a different heap than VC++ compiled apps.
+
+ SDL now has initial support for international keyboards using the
+ Latin character set.
+ If a particular mapping is desired, you can set the DEFAULT_KEYBOARD
+ compile-time variable, or you can set the environment variable
+ "SDL_KEYBOARD" to a string identifying the keyboard mapping you desire.
+ The valid values for these variables can be found in SDL_keyboard.c
+
+ Full support for German and French keyboards under X11 is implemented.
+
+0.9.11:
+ The THREADED_EVENTS compile-time define has been replaced with the
+ SDL_INIT_EVENTTHREAD flag. If this flag is passed to SDL_Init(),
+ SDL will create a separate thread to perform input event handling.
+ If this flag is passed to SDL_Init(), and the OS doesn't support
+ event handling in a separate thread, SDL_Init() will fail.
+ Be sure to add calls to SDL_Delay() in your main thread to allow
+ the OS to schedule your event thread, or it may starve, leading
+ to slow event delivery and/or dropped events.
+ Currently MacOS and Win32 do not support this flag, while BeOS
+ and Linux do support it. I recommend that your application only
+ use this flag if absolutely necessary.
+
+ The SDL thread function passed to SDL_CreateThread() now returns a
+ status. This status can be retrieved by passing a non-NULL pointer
+ as the 'status' argument to SDL_WaitThread().
+
+ The volume parameter to SDL_MixAudio() has been increased in range
+ from (0-8) to (0-128)
+
+ SDL now has a data source abstraction which can encompass a file,
+ an area of memory, or any custom object you can envision. It uses
+ these abstractions, SDL_RWops, in the endian read/write functions,
+ and the built-in WAV and BMP file loaders. This means you can load
+ WAV chunks from memory mapped files, compressed archives, network
+ pipes, or anything else that has a data read abstraction.
+
+ There are three built-in data source abstractions:
+ SDL_RWFromFile(), SDL_RWFromFP(), SDL_RWFromMem()
+ along with a generic data source allocation function:
+ SDL_AllocRW()
+ These data sources can be used like stdio file pointers with the
+ following convenience functions:
+ SDL_RWseek(), SDL_RWread(), SDL_RWwrite(), SDL_RWclose()
+ These functions are defined in the new header file "SDL_rwops.h"
+
+ The endian swapping functions have been turned into macros for speed
+ and SDL_CalculateEndian() has been removed. SDL_endian.h now defines
+ SDL_BYTEORDER as either SDL_BIG_ENDIAN or SDL_LIL_ENDIAN depending on
+ the endianness of the host system.
+
+ The endian read/write functions now take an SDL_RWops pointer
+ instead of a stdio FILE pointer, to support the new data source
+ abstraction.
+
+ The SDL_*LoadWAV() functions have been replaced with a single
+ SDL_LoadWAV_RW() function that takes a SDL_RWops pointer as it's
+ first parameter, and a flag whether or not to automatically
+ free it as the second parameter. SDL_LoadWAV() is a macro for
+ backward compatibility and convenience:
+ SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...);
+
+ The SDL_*LoadBMP()/SDL_*SaveBMP() functions have each been replaced
+ with a single function that takes a SDL_RWops pointer as it's
+ first parameter, and a flag whether or not to automatically
+ free it as the second parameter. SDL_LoadBMP() and SDL_SaveBMP()
+ are macros for backward compatibility and convenience:
+ SDL_LoadBMP_RW(SDL_RWFromFile("sample.bmp", "rb"), 1, ...);
+ SDL_SaveBMP_RW(SDL_RWFromFile("sample.bmp", "wb"), 1, ...);
+ Note that these functions use SDL_RWseek() extensively, and should
+ not be used on pipes or other non-seekable data sources.
+
+0.9.10:
+ The Linux SDL_SysWMInfo and SDL_SysWMMsg structures have been
+ extended to support multiple types of display drivers, as well as
+ safe access to the X11 display when THREADED_EVENTS is enabled.
+ The new structures are documented in the SDL_syswm.h header file.
+
+ Thanks to John Elliott <jce@seasip.demon.co.uk>, the UK keyboard
+ should now work properly, as well as the "Windows" keys on US
+ keyboards.
+
+ The Linux CD-ROM code now reads the CD-ROM devices from /etc/fstab
+ instead of trying to open each block device on the system.
+ The CD must be listed in /etc/fstab as using the iso9660 filesystem.
+
+ On Linux, if you define THREADED_EVENTS at compile time, a separate
+ thread will be spawned to gather X events asynchronously from the
+ graphics updates. This hasn't been extensively tested, but it does
+ provide a means of handling keyboard and mouse input in a separate
+ thread from the graphics thread. (This is now enabled by default.)
+
+ A special access function SDL_PeepEvents() allows you to manipulate
+ the event queue in a thread-safe manner, including peeking at events,
+ removing events of a specified type, and adding new events of arbitrary
+ type to the queue (use the new 'user' member of the SDL_Event type).
+
+ If you use SDL_PeepEvents() to gather events, then the main graphics
+ thread needs to call SDL_PumpEvents() periodically to drive the event
+ loop and generate input events. This is not necessary if SDL has been
+ compiled with THREADED_EVENTS defined, but doesn't hurt.
+
+ A new function SDL_ThreadID() returns the identifier associated with
+ the current thread.
+
+0.9.9:
+ The AUDIO_STEREO format flag has been replaced with a new 'channels'
+ member of the SDL_AudioSpec structure. The channels are 1 for mono
+ audio, and 2 for stereo audio. In the future more channels may be
+ supported for 3D surround sound.
+
+ The SDL_MixAudio() function now takes an additional volume parameter,
+ which should be set to SDL_MIX_MAXVOLUME for compatibility with the
+ original function.
+
+ The CD-ROM functions which take a 'cdrom' parameter can now be
+ passed NULL, and will act on the last successfully opened CD-ROM.
+
+0.9.8:
+ No changes, bugfixes only.
+
+0.9.7:
+ No changes, bugfixes only.
+
+0.9.6:
+ Added a fast rectangle fill function: SDL_FillRect()
+
+ Addition of a useful function for getting info on the video hardware:
+ const SDL_VideoInfo *SDL_GetVideoInfo(void)
+ This function replaces SDL_GetDisplayFormat().
+
+ Initial support for double-buffering:
+ Use the SDL_DOUBLEBUF flag in SDL_SetVideoMode()
+ Update the screen with a new function: SDL_Flip()
+
+ SDL_AllocSurface() takes two new flags:
+ SDL_SRCCOLORKEY means that the surface will be used for colorkey blits
+ and if the hardware supports hardware acceleration of colorkey blits
+ between two surfaces in video memory, to place the surface in video
+ memory if possible, otherwise it will be placed in system memory.
+ SDL_SRCALPHA means that the surface will be used for alpha blits and
+ if the hardware supports hardware acceleration of alpha blits between
+ two surfaces in video memory, to place the surface in video memory
+ if possible, otherwise it will be placed in system memory.
+ SDL_HWSURFACE now means that the surface will be created with the
+ same format as the display surface, since having surfaces in video
+ memory is only useful for fast blitting to the screen, and you can't
+ blit surfaces with different surface formats in video memory.
+
+0.9.5:
+ You can now pass a NULL mask to SDL_WM_SetIcon(), and it will assume
+ that the icon consists of the entire image.
+
+ SDL_LowerBlit() is back -- but don't use it on the display surface.
+ It is exactly the same as SDL_MiddleBlit(), but doesn't check for
+ thread safety.
+
+ Added SDL_FPLoadBMP(), SDL_FPSaveBMP(), SDL_FPLoadWAV(), which take
+ a FILE pointer instead of a file name.
+
+ Added CD-ROM audio control API:
+ SDL_CDNumDrives()
+ SDL_CDName()
+ SDL_CDOpen()
+ SDL_CDStatus()
+ SDL_CDPlayTracks()
+ SDL_CDPlay()
+ SDL_CDPause()
+ SDL_CDResume()
+ SDL_CDStop()
+ SDL_CDEject()
+ SDL_CDClose()
+
+0.9.4:
+ No changes, bugfixes only.
+
+0.9.3:
+ Mouse motion event now includes relative motion information:
+ Sint16 event->motion.xrel, Sint16 event->motion.yrel
+
+ X11 keyrepeat handling can be disabled by defining IGNORE_X_KEYREPEAT
+ (Add -DIGNORE_X_KEYREPEAT to CFLAGS line in obj/x11Makefile)
+
+0.9.2:
+ No changes, bugfixes only.
+
+0.9.1:
+ Removed SDL_MapSurface() and SDL_UnmapSurface() -- surfaces are now
+ automatically mapped on blit.
+
+0.8.0:
+ SDL stable release
diff --git a/distrib/sdl-1.2.15/Xcode/SDL/Info-Framework.plist b/distrib/sdl-1.2.15/Xcode/SDL/Info-Framework.plist
new file mode 100644
index 0000000..bdcbf6e
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDL/Info-Framework.plist
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>SDL</string>
+ <key>CFBundleGetInfoString</key>
+ <string>http://www.libsdl.org</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>SDL</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>Simple DirectMedia Layer</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.2.14</string>
+ <key>CFBundleSignature</key>
+ <string>SDLX</string>
+ <key>CFBundleVersion</key>
+ <string>1.2.14</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/distrib/sdl-1.2.15/Xcode/SDL/SDL.xcodeproj/project.pbxproj
new file mode 100755
index 0000000..1dbe888
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDL/SDL.xcodeproj/project.pbxproj
@@ -0,0 +1,1961 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXAggregateTarget section */
+ 0032354F1070931700C76517 /* Generate Doxygen DocSet */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = 003235571070933500C76517 /* Build configuration list for PBXAggregateTarget "Generate Doxygen DocSet" */;
+ buildPhases = (
+ 0032354E1070931700C76517 /* ShellScript */,
+ );
+ dependencies = (
+ );
+ name = "Generate Doxygen DocSet";
+ productName = "Generate Doxygen DocSet";
+ };
+/* End PBXAggregateTarget section */
+
+/* Begin PBXBuildFile section */
+ 0014B7EF09C0D8D2003A99D5 /* SDL_dgaevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B7E909C0D8D2003A99D5 /* SDL_dgaevents.c */; };
+ 0014B7F109C0D8D2003A99D5 /* SDL_dgamouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B7EB09C0D8D2003A99D5 /* SDL_dgamouse.c */; };
+ 0014B7F209C0D8D2003A99D5 /* SDL_dgavideo.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B7EC09C0D8D2003A99D5 /* SDL_dgavideo.c */; };
+ 0014B7F409C0D8D2003A99D5 /* SDL_dgaevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B7E809C0D8D2003A99D5 /* SDL_dgaevents_c.h */; };
+ 0014B7F509C0D8D2003A99D5 /* SDL_dgaevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B7E909C0D8D2003A99D5 /* SDL_dgaevents.c */; };
+ 0014B7F609C0D8D2003A99D5 /* SDL_dgamouse_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B7EA09C0D8D2003A99D5 /* SDL_dgamouse_c.h */; };
+ 0014B7F709C0D8D2003A99D5 /* SDL_dgamouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B7EB09C0D8D2003A99D5 /* SDL_dgamouse.c */; };
+ 0014B7F809C0D8D2003A99D5 /* SDL_dgavideo.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B7EC09C0D8D2003A99D5 /* SDL_dgavideo.c */; };
+ 0014B7F909C0D8D2003A99D5 /* SDL_dgavideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B7ED09C0D8D2003A99D5 /* SDL_dgavideo.h */; };
+ 0014B84F09C0D977003A99D5 /* SDL_x11dga.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B83809C0D977003A99D5 /* SDL_x11dga.c */; };
+ 0014B85009C0D977003A99D5 /* SDL_x11dyn.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B83909C0D977003A99D5 /* SDL_x11dyn.c */; };
+ 0014B85309C0D977003A99D5 /* SDL_x11events.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B83C09C0D977003A99D5 /* SDL_x11events.c */; };
+ 0014B85509C0D977003A99D5 /* SDL_x11gamma.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B83E09C0D977003A99D5 /* SDL_x11gamma.c */; };
+ 0014B85709C0D977003A99D5 /* SDL_x11gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84009C0D977003A99D5 /* SDL_x11gl.c */; };
+ 0014B85909C0D977003A99D5 /* SDL_x11image.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84209C0D977003A99D5 /* SDL_x11image.c */; };
+ 0014B85B09C0D977003A99D5 /* SDL_x11modes.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84409C0D977003A99D5 /* SDL_x11modes.c */; };
+ 0014B85D09C0D977003A99D5 /* SDL_x11mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84609C0D977003A99D5 /* SDL_x11mouse.c */; };
+ 0014B85F09C0D977003A99D5 /* SDL_x11video.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84809C0D977003A99D5 /* SDL_x11video.c */; };
+ 0014B86209C0D977003A99D5 /* SDL_x11wm.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84B09C0D977003A99D5 /* SDL_x11wm.c */; };
+ 0014B86409C0D977003A99D5 /* SDL_x11yuv.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84D09C0D977003A99D5 /* SDL_x11yuv.c */; };
+ 0014B86509C0D977003A99D5 /* SDL_x11dga_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B83709C0D977003A99D5 /* SDL_x11dga_c.h */; };
+ 0014B86609C0D977003A99D5 /* SDL_x11dga.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B83809C0D977003A99D5 /* SDL_x11dga.c */; };
+ 0014B86709C0D977003A99D5 /* SDL_x11dyn.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B83909C0D977003A99D5 /* SDL_x11dyn.c */; };
+ 0014B86809C0D977003A99D5 /* SDL_x11dyn.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B83A09C0D977003A99D5 /* SDL_x11dyn.h */; };
+ 0014B86909C0D977003A99D5 /* SDL_x11events_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B83B09C0D977003A99D5 /* SDL_x11events_c.h */; };
+ 0014B86A09C0D977003A99D5 /* SDL_x11events.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B83C09C0D977003A99D5 /* SDL_x11events.c */; };
+ 0014B86B09C0D977003A99D5 /* SDL_x11gamma_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B83D09C0D977003A99D5 /* SDL_x11gamma_c.h */; };
+ 0014B86C09C0D977003A99D5 /* SDL_x11gamma.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B83E09C0D977003A99D5 /* SDL_x11gamma.c */; };
+ 0014B86D09C0D977003A99D5 /* SDL_x11gl_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B83F09C0D977003A99D5 /* SDL_x11gl_c.h */; };
+ 0014B86E09C0D977003A99D5 /* SDL_x11gl.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84009C0D977003A99D5 /* SDL_x11gl.c */; };
+ 0014B86F09C0D977003A99D5 /* SDL_x11image_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B84109C0D977003A99D5 /* SDL_x11image_c.h */; };
+ 0014B87009C0D977003A99D5 /* SDL_x11image.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84209C0D977003A99D5 /* SDL_x11image.c */; };
+ 0014B87109C0D977003A99D5 /* SDL_x11modes_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B84309C0D977003A99D5 /* SDL_x11modes_c.h */; };
+ 0014B87209C0D977003A99D5 /* SDL_x11modes.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84409C0D977003A99D5 /* SDL_x11modes.c */; };
+ 0014B87309C0D977003A99D5 /* SDL_x11mouse_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B84509C0D977003A99D5 /* SDL_x11mouse_c.h */; };
+ 0014B87409C0D977003A99D5 /* SDL_x11mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84609C0D977003A99D5 /* SDL_x11mouse.c */; };
+ 0014B87509C0D977003A99D5 /* SDL_x11sym.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B84709C0D977003A99D5 /* SDL_x11sym.h */; };
+ 0014B87609C0D977003A99D5 /* SDL_x11video.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84809C0D977003A99D5 /* SDL_x11video.c */; };
+ 0014B87709C0D977003A99D5 /* SDL_x11video.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B84909C0D977003A99D5 /* SDL_x11video.h */; };
+ 0014B87809C0D977003A99D5 /* SDL_x11wm_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B84A09C0D977003A99D5 /* SDL_x11wm_c.h */; };
+ 0014B87909C0D977003A99D5 /* SDL_x11wm.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84B09C0D977003A99D5 /* SDL_x11wm.c */; };
+ 0014B87A09C0D977003A99D5 /* SDL_x11yuv_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B84C09C0D977003A99D5 /* SDL_x11yuv_c.h */; };
+ 0014B87B09C0D977003A99D5 /* SDL_x11yuv.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B84D09C0D977003A99D5 /* SDL_x11yuv.c */; };
+ 0014B89209C0DA94003A99D5 /* XF86DGA.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B89009C0DA94003A99D5 /* XF86DGA.c */; };
+ 0014B89309C0DA94003A99D5 /* XF86DGA2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B89109C0DA94003A99D5 /* XF86DGA2.c */; };
+ 0014B89409C0DA94003A99D5 /* XF86DGA.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B89009C0DA94003A99D5 /* XF86DGA.c */; };
+ 0014B89509C0DA94003A99D5 /* XF86DGA2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B89109C0DA94003A99D5 /* XF86DGA2.c */; };
+ 0014B89709C0DAA1003A99D5 /* XF86VMode.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B89609C0DAA1003A99D5 /* XF86VMode.c */; };
+ 0014B89809C0DAA1003A99D5 /* XF86VMode.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B89609C0DAA1003A99D5 /* XF86VMode.c */; };
+ 0014B89B09C0DAAE003A99D5 /* Xv.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B89909C0DAAE003A99D5 /* Xv.c */; };
+ 0014B89D09C0DAAE003A99D5 /* Xv.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B89909C0DAAE003A99D5 /* Xv.c */; };
+ 0014B89E09C0DAAE003A99D5 /* Xvlibint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0014B89A09C0DAAE003A99D5 /* Xvlibint.h */; };
+ 0014B8A009C0DAB9003A99D5 /* Xinerama.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B89F09C0DAB9003A99D5 /* Xinerama.c */; };
+ 0014B8A109C0DAB9003A99D5 /* Xinerama.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B89F09C0DAB9003A99D5 /* Xinerama.c */; };
+ 0014B8A309C0DAC4003A99D5 /* xme.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B8A209C0DAC4003A99D5 /* xme.c */; };
+ 0014B8A409C0DAC4003A99D5 /* xme.c in Sources */ = {isa = PBXBuildFile; fileRef = 0014B8A209C0DAC4003A99D5 /* xme.c */; };
+ 00162D4409BD1FA90037C8D0 /* SDL_config_dreamcast.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3209BD1FA90037C8D0 /* SDL_config_dreamcast.h */; };
+ 00162D4509BD1FA90037C8D0 /* SDL_config_macos.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3309BD1FA90037C8D0 /* SDL_config_macos.h */; };
+ 00162D4609BD1FA90037C8D0 /* SDL_config_macosx.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3409BD1FA90037C8D0 /* SDL_config_macosx.h */; };
+ 00162D4709BD1FA90037C8D0 /* SDL_config_os2.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3509BD1FA90037C8D0 /* SDL_config_os2.h */; };
+ 00162D4809BD1FA90037C8D0 /* SDL_config_win32.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3609BD1FA90037C8D0 /* SDL_config_win32.h */; };
+ 00162D4909BD1FA90037C8D0 /* SDL_config.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3709BD1FA90037C8D0 /* SDL_config.h */; };
+ 00162D4A09BD1FA90037C8D0 /* SDL_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3809BD1FA90037C8D0 /* SDL_platform.h */; };
+ 00162D4B09BD1FA90037C8D0 /* SDL_stdinc.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3909BD1FA90037C8D0 /* SDL_stdinc.h */; };
+ 00162D5309BD20DA0037C8D0 /* SDL_syscond.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D4D09BD20DA0037C8D0 /* SDL_syscond.c */; };
+ 00162D5409BD20DA0037C8D0 /* SDL_sysmutex.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D4E09BD20DA0037C8D0 /* SDL_sysmutex.c */; };
+ 00162D5609BD20DA0037C8D0 /* SDL_syssem.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D5009BD20DA0037C8D0 /* SDL_syssem.c */; };
+ 00162D5709BD20DA0037C8D0 /* SDL_systhread.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D5109BD20DA0037C8D0 /* SDL_systhread.c */; };
+ 00162D5909BD20DA0037C8D0 /* SDL_syscond.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D4D09BD20DA0037C8D0 /* SDL_syscond.c */; };
+ 00162D5A09BD20DA0037C8D0 /* SDL_sysmutex.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D4E09BD20DA0037C8D0 /* SDL_sysmutex.c */; };
+ 00162D5B09BD20DA0037C8D0 /* SDL_sysmutex_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D4F09BD20DA0037C8D0 /* SDL_sysmutex_c.h */; };
+ 00162D5C09BD20DA0037C8D0 /* SDL_syssem.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D5009BD20DA0037C8D0 /* SDL_syssem.c */; };
+ 00162D5D09BD20DA0037C8D0 /* SDL_systhread.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D5109BD20DA0037C8D0 /* SDL_systhread.c */; };
+ 00162D5E09BD20DA0037C8D0 /* SDL_systhread_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D5209BD20DA0037C8D0 /* SDL_systhread_c.h */; };
+ 00162D6109BD21010037C8D0 /* SDL_systimer.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6009BD21010037C8D0 /* SDL_systimer.c */; };
+ 00162D6209BD21010037C8D0 /* SDL_systimer.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6009BD21010037C8D0 /* SDL_systimer.c */; };
+ 00162D6B09BD214F0037C8D0 /* SDL_getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6509BD214F0037C8D0 /* SDL_getenv.c */; };
+ 00162D6C09BD214F0037C8D0 /* SDL_malloc.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6609BD214F0037C8D0 /* SDL_malloc.c */; };
+ 00162D6D09BD214F0037C8D0 /* SDL_qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6709BD214F0037C8D0 /* SDL_qsort.c */; };
+ 00162D6E09BD214F0037C8D0 /* SDL_stdlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6809BD214F0037C8D0 /* SDL_stdlib.c */; };
+ 00162D6F09BD214F0037C8D0 /* SDL_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6909BD214F0037C8D0 /* SDL_string.c */; };
+ 00162D7009BD214F0037C8D0 /* SDL_getenv.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6509BD214F0037C8D0 /* SDL_getenv.c */; };
+ 00162D7109BD214F0037C8D0 /* SDL_malloc.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6609BD214F0037C8D0 /* SDL_malloc.c */; };
+ 00162D7209BD214F0037C8D0 /* SDL_qsort.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6709BD214F0037C8D0 /* SDL_qsort.c */; };
+ 00162D7309BD214F0037C8D0 /* SDL_stdlib.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6809BD214F0037C8D0 /* SDL_stdlib.c */; };
+ 00162D7409BD214F0037C8D0 /* SDL_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162D6909BD214F0037C8D0 /* SDL_string.c */; };
+ 00162DA409BD222F0037C8D0 /* SDL_config_dreamcast.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3209BD1FA90037C8D0 /* SDL_config_dreamcast.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DA509BD222F0037C8D0 /* SDL_config_macos.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3309BD1FA90037C8D0 /* SDL_config_macos.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DA609BD222F0037C8D0 /* SDL_config_macosx.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3409BD1FA90037C8D0 /* SDL_config_macosx.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DA709BD222F0037C8D0 /* SDL_config_os2.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3509BD1FA90037C8D0 /* SDL_config_os2.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DA809BD222F0037C8D0 /* SDL_config_win32.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3609BD1FA90037C8D0 /* SDL_config_win32.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DA909BD222F0037C8D0 /* SDL_config.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3709BD1FA90037C8D0 /* SDL_config.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DAA09BD222F0037C8D0 /* SDL_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3809BD1FA90037C8D0 /* SDL_platform.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DAB09BD222F0037C8D0 /* SDL_stdinc.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162D3909BD1FA90037C8D0 /* SDL_stdinc.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DAC09BD222F0037C8D0 /* begin_code.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5E501191D2B7F000001 /* begin_code.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DAD09BD222F0037C8D0 /* close_code.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5E601191D2B7F000001 /* close_code.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DAE09BD222F0037C8D0 /* SDL_active.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5E701191D2B7F000001 /* SDL_active.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DAF09BD222F0037C8D0 /* SDL_audio.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5E801191D2B7F000001 /* SDL_audio.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DB009BD222F0037C8D0 /* SDL_byteorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5E901191D2B7F000001 /* SDL_byteorder.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DB109BD222F0037C8D0 /* SDL_cdrom.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5EA01191D2B7F000001 /* SDL_cdrom.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DB209BD222F0037C8D0 /* SDL_copying.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5EB01191D2B7F000001 /* SDL_copying.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DB309BD222F0037C8D0 /* SDL_cpuinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CF8DC405C444E400E5DC7F /* SDL_cpuinfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DB409BD222F0037C8D0 /* SDL_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5EC01191D2B7F000001 /* SDL_endian.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DB509BD222F0037C8D0 /* SDL_error.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5ED01191D2B7F000001 /* SDL_error.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DB609BD222F0037C8D0 /* SDL_events.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5EE01191D2B7F000001 /* SDL_events.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DB709BD222F0037C8D0 /* SDL_getenv.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5EF01191D2B7F000001 /* SDL_getenv.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DB809BD222F0037C8D0 /* SDL_joystick.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5F001191D2B7F000001 /* SDL_joystick.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DB909BD222F0037C8D0 /* SDL_keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5F101191D2B7F000001 /* SDL_keyboard.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DBA09BD222F0037C8D0 /* SDL_keysym.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5F201191D2B7F000001 /* SDL_keysym.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DBB09BD222F0037C8D0 /* SDL_loadso.h in Headers */ = {isa = PBXBuildFile; fileRef = B29A290D04E5B28700A80002 /* SDL_loadso.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DBC09BD222F0037C8D0 /* SDL_main.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5F301191D2B7F000001 /* SDL_main.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DBD09BD222F0037C8D0 /* SDL_mouse.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5F401191D2B7F000001 /* SDL_mouse.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DBE09BD222F0037C8D0 /* SDL_mutex.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5F501191D2B7F000001 /* SDL_mutex.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DBF09BD222F0037C8D0 /* SDL_name.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CF8DC705C4450500E5DC7F /* SDL_name.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DC009BD222F0037C8D0 /* SDL_opengl.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5F601191D2B7F000001 /* SDL_opengl.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DC109BD222F0037C8D0 /* SDL_quit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5F701191D2B7F000001 /* SDL_quit.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DC209BD222F0037C8D0 /* SDL_rwops.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5F801191D2B7F000001 /* SDL_rwops.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DC309BD222F0037C8D0 /* SDL_syswm.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5F901191D2B7F000001 /* SDL_syswm.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DC409BD222F0037C8D0 /* SDL_thread.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5FA01191D2B7F000001 /* SDL_thread.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DC509BD222F0037C8D0 /* SDL_timer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5FB01191D2B7F000001 /* SDL_timer.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DC609BD222F0037C8D0 /* SDL_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5FC01191D2B7F000001 /* SDL_types.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DC709BD222F0037C8D0 /* SDL_version.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5FD01191D2B7F000001 /* SDL_version.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DC809BD222F0037C8D0 /* SDL_video.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5FE01191D2B7F000001 /* SDL_video.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162DC909BD222F0037C8D0 /* SDL.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C5AF5FF01191D2B7F000001 /* SDL.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 00162E6809BD27300037C8D0 /* SDL_mixer_MMX.c in Sources */ = {isa = PBXBuildFile; fileRef = 00B7E61F097F2D9E00826121 /* SDL_mixer_MMX.c */; };
+ 00162E6A09BD27360037C8D0 /* SDL_mixer_MMX.c in Sources */ = {isa = PBXBuildFile; fileRef = 00B7E61F097F2D9E00826121 /* SDL_mixer_MMX.c */; };
+ 00162E6B09BD27370037C8D0 /* SDL_mixer_MMX.h in Headers */ = {isa = PBXBuildFile; fileRef = 00B7E620097F2D9E00826121 /* SDL_mixer_MMX.h */; };
+ 00162F3B09BE27FB0037C8D0 /* SDL_nullevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162F3409BE27FB0037C8D0 /* SDL_nullevents.c */; };
+ 00162F3D09BE27FB0037C8D0 /* SDL_nullmouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162F3609BE27FB0037C8D0 /* SDL_nullmouse.c */; };
+ 00162F3F09BE27FB0037C8D0 /* SDL_nullvideo.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162F3809BE27FB0037C8D0 /* SDL_nullvideo.c */; };
+ 00162F4109BE27FB0037C8D0 /* SDL_nullevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162F3409BE27FB0037C8D0 /* SDL_nullevents.c */; };
+ 00162F4209BE27FB0037C8D0 /* SDL_nullevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162F3509BE27FB0037C8D0 /* SDL_nullevents_c.h */; };
+ 00162F4309BE27FB0037C8D0 /* SDL_nullmouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162F3609BE27FB0037C8D0 /* SDL_nullmouse.c */; };
+ 00162F4409BE27FB0037C8D0 /* SDL_nullmouse_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162F3709BE27FB0037C8D0 /* SDL_nullmouse_c.h */; };
+ 00162F4509BE27FB0037C8D0 /* SDL_nullvideo.c in Sources */ = {isa = PBXBuildFile; fileRef = 00162F3809BE27FB0037C8D0 /* SDL_nullvideo.c */; };
+ 00162F4609BE27FB0037C8D0 /* SDL_nullvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = 00162F3909BE27FB0037C8D0 /* SDL_nullvideo.h */; };
+ 002F328609CA049100EBEB88 /* SDL_iconv.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F328509CA049100EBEB88 /* SDL_iconv.c */; };
+ 002F328709CA049100EBEB88 /* SDL_iconv.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F328509CA049100EBEB88 /* SDL_iconv.c */; };
+ 002F32D709CA0BE700EBEB88 /* SDL_diskaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F32D409CA0BE700EBEB88 /* SDL_diskaudio.c */; };
+ 002F32D909CA0BE700EBEB88 /* SDL_diskaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F32D409CA0BE700EBEB88 /* SDL_diskaudio.c */; };
+ 002F32DA09CA0BE700EBEB88 /* SDL_diskaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 002F32D509CA0BE700EBEB88 /* SDL_diskaudio.h */; };
+ 002F32E509CA0BF600EBEB88 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F32E209CA0BF600EBEB88 /* SDL_dummyaudio.c */; };
+ 002F32E709CA0BF600EBEB88 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F32E209CA0BF600EBEB88 /* SDL_dummyaudio.c */; };
+ 002F32E809CA0BF600EBEB88 /* SDL_dummyaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 002F32E309CA0BF600EBEB88 /* SDL_dummyaudio.h */; };
+ 004C2C8B0975E13300E9D430 /* AudioFilePlayer.c in Sources */ = {isa = PBXBuildFile; fileRef = 004C2C860975E13300E9D430 /* AudioFilePlayer.c */; };
+ 004C2C8C0975E13300E9D430 /* AudioFileReaderThread.c in Sources */ = {isa = PBXBuildFile; fileRef = 004C2C870975E13300E9D430 /* AudioFileReaderThread.c */; };
+ 004C2C8D0975E13300E9D430 /* CDPlayer.c in Sources */ = {isa = PBXBuildFile; fileRef = 004C2C880975E13300E9D430 /* CDPlayer.c */; };
+ 004C2C8E0975E13300E9D430 /* SDLOSXCAGuard.c in Sources */ = {isa = PBXBuildFile; fileRef = 004C2C890975E13300E9D430 /* SDLOSXCAGuard.c */; };
+ 004C2C900975E13300E9D430 /* AudioFilePlayer.c in Sources */ = {isa = PBXBuildFile; fileRef = 004C2C860975E13300E9D430 /* AudioFilePlayer.c */; };
+ 004C2C910975E13300E9D430 /* AudioFileReaderThread.c in Sources */ = {isa = PBXBuildFile; fileRef = 004C2C870975E13300E9D430 /* AudioFileReaderThread.c */; };
+ 004C2C920975E13300E9D430 /* CDPlayer.c in Sources */ = {isa = PBXBuildFile; fileRef = 004C2C880975E13300E9D430 /* CDPlayer.c */; };
+ 004C2C930975E13300E9D430 /* SDLOSXCAGuard.c in Sources */ = {isa = PBXBuildFile; fileRef = 004C2C890975E13300E9D430 /* SDLOSXCAGuard.c */; };
+ 004C2C940975E13300E9D430 /* SDLOSXCAGuard.h in Headers */ = {isa = PBXBuildFile; fileRef = 004C2C8A0975E13300E9D430 /* SDLOSXCAGuard.h */; };
+ 007317A20858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179B0858DECD00B2BC32 /* AudioToolbox.framework */; };
+ 007317A30858DECD00B2BC32 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179C0858DECD00B2BC32 /* AudioUnit.framework */; };
+ 007317A40858DECD00B2BC32 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179D0858DECD00B2BC32 /* Cocoa.framework */; };
+ 007317A50858DECD00B2BC32 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179E0858DECD00B2BC32 /* CoreAudio.framework */; };
+ 007317A60858DECD00B2BC32 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179F0858DECD00B2BC32 /* IOKit.framework */; };
+ 007317A70858DECD00B2BC32 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317A00858DECD00B2BC32 /* OpenGL.framework */; };
+ 007317A90858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179B0858DECD00B2BC32 /* AudioToolbox.framework */; };
+ 007317AA0858DECD00B2BC32 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179C0858DECD00B2BC32 /* AudioUnit.framework */; };
+ 007317AB0858DECD00B2BC32 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179D0858DECD00B2BC32 /* Cocoa.framework */; };
+ 007317AC0858DECD00B2BC32 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179E0858DECD00B2BC32 /* CoreAudio.framework */; };
+ 007317AD0858DECD00B2BC32 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179F0858DECD00B2BC32 /* IOKit.framework */; };
+ 007317AE0858DECD00B2BC32 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317A00858DECD00B2BC32 /* OpenGL.framework */; };
+ 007317AF0858DECD00B2BC32 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317A10858DECD00B2BC32 /* QuickTime.framework */; };
+ 007317B00858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179B0858DECD00B2BC32 /* AudioToolbox.framework */; };
+ 007317B10858DECD00B2BC32 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179C0858DECD00B2BC32 /* AudioUnit.framework */; };
+ 007317B20858DECD00B2BC32 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179D0858DECD00B2BC32 /* Cocoa.framework */; };
+ 007317B30858DECD00B2BC32 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179E0858DECD00B2BC32 /* CoreAudio.framework */; };
+ 007317B40858DECD00B2BC32 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179F0858DECD00B2BC32 /* IOKit.framework */; };
+ 007317B50858DECD00B2BC32 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317A00858DECD00B2BC32 /* OpenGL.framework */; };
+ 007317B60858DECD00B2BC32 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317A10858DECD00B2BC32 /* QuickTime.framework */; };
+ 007317C30858E15000B2BC32 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317C10858E15000B2BC32 /* Carbon.framework */; };
+ 007317C40858E15000B2BC32 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317C10858E15000B2BC32 /* Carbon.framework */; };
+ 00D0D02310675823004B05EF /* SDL_QuartzWM.h in Headers */ = {isa = PBXBuildFile; fileRef = 00D0D02210675823004B05EF /* SDL_QuartzWM.h */; };
+ 00D0D08410675DD9004B05EF /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00D0D08310675DD9004B05EF /* CoreFoundation.framework */; };
+ 00D0D0D810675E46004B05EF /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317C10858E15000B2BC32 /* Carbon.framework */; };
+ 00EAE6FC0C4D3F84009A420A /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 00B7E625097F2DD100826121 /* SDL_yuv_mmx.c */; };
+ 00EAE6FD0C4D3F88009A420A /* SDL_yuv_mmx.c in Sources */ = {isa = PBXBuildFile; fileRef = 00B7E625097F2DD100826121 /* SDL_yuv_mmx.c */; };
+ 046B91EC0A11B53500FB151C /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = 046B91E90A11B53500FB151C /* SDL_sysloadso.c */; };
+ 046B91ED0A11B53500FB151C /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = 046B91E90A11B53500FB151C /* SDL_sysloadso.c */; };
+ 046B92130A11B8AD00FB151C /* SDL_dlcompat.c in Sources */ = {isa = PBXBuildFile; fileRef = 046B92100A11B8AD00FB151C /* SDL_dlcompat.c */; };
+ 046B92140A11B8AD00FB151C /* SDL_dlcompat.c in Sources */ = {isa = PBXBuildFile; fileRef = 046B92100A11B8AD00FB151C /* SDL_dlcompat.c */; };
+ BECDF62B0761BA81005FE872 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF2F0086C3A07F000001 /* SDLMain.nib */; };
+ BECDF62E0761BA81005FE872 /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538330006D78D67F000001 /* SDL_audio.c */; };
+ BECDF62F0761BA81005FE872 /* SDL_audiocvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538331006D78D67F000001 /* SDL_audiocvt.c */; };
+ BECDF6300761BA81005FE872 /* SDL_audiodev.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538332006D78D67F000001 /* SDL_audiodev.c */; };
+ BECDF6320761BA81005FE872 /* SDL_mixer.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538334006D78D67F000001 /* SDL_mixer.c */; };
+ BECDF6330761BA81005FE872 /* SDL_wave.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538335006D78D67F000001 /* SDL_wave.c */; };
+ BECDF6350761BA81005FE872 /* SDL_active.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538368006D79147F000001 /* SDL_active.c */; };
+ BECDF6360761BA81005FE872 /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538369006D79147F000001 /* SDL_events.c */; };
+ BECDF6370761BA81005FE872 /* SDL_expose.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153836A006D79147F000001 /* SDL_expose.c */; };
+ BECDF6380761BA81005FE872 /* SDL_keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153836B006D79147F000001 /* SDL_keyboard.c */; };
+ BECDF6390761BA81005FE872 /* SDL_mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153836C006D79147F000001 /* SDL_mouse.c */; };
+ BECDF63A0761BA81005FE872 /* SDL_quit.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153836D006D79147F000001 /* SDL_quit.c */; };
+ BECDF63B0761BA81005FE872 /* SDL_resize.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153836E006D79147F000001 /* SDL_resize.c */; };
+ BECDF63C0761BA81005FE872 /* SDL_rwops.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538377006D79307F000001 /* SDL_rwops.c */; };
+ BECDF63E0761BA81005FE872 /* SDL_timer.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383A0006D79BC7F000001 /* SDL_timer.c */; };
+ BECDF63F0761BA81005FE872 /* SDL_blit.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383D8006D7A567F000001 /* SDL_blit.c */; };
+ BECDF6400761BA81005FE872 /* SDL_blit_0.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383DA006D7A567F000001 /* SDL_blit_0.c */; };
+ BECDF6410761BA81005FE872 /* SDL_blit_1.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383DB006D7A567F000001 /* SDL_blit_1.c */; };
+ BECDF6420761BA81005FE872 /* SDL_blit_A.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383DC006D7A567F000001 /* SDL_blit_A.c */; };
+ BECDF6430761BA81005FE872 /* SDL_blit_N.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383DE006D7A567F000001 /* SDL_blit_N.c */; };
+ BECDF6440761BA81005FE872 /* SDL_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383DF006D7A567F000001 /* SDL_bmp.c */; };
+ BECDF6450761BA81005FE872 /* SDL_cursor.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383E0006D7A567F000001 /* SDL_cursor.c */; };
+ BECDF6460761BA81005FE872 /* SDL_gamma.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383E2006D7A567F000001 /* SDL_gamma.c */; };
+ BECDF6470761BA81005FE872 /* SDL_pixels.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383E6006D7A567F000001 /* SDL_pixels.c */; };
+ BECDF6480761BA81005FE872 /* SDL_RLEaccel.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383E8006D7A567F000001 /* SDL_RLEaccel.c */; };
+ BECDF6490761BA81005FE872 /* SDL_surface.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383EC006D7A567F000001 /* SDL_surface.c */; };
+ BECDF64A0761BA81005FE872 /* SDL_video.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383EE006D7A567F000001 /* SDL_video.c */; };
+ BECDF64B0761BA81005FE872 /* SDL_yuv.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383EF006D7A567F000001 /* SDL_yuv.c */; };
+ BECDF64C0761BA81005FE872 /* SDL_yuv_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383F1006D7A567F000001 /* SDL_yuv_sw.c */; };
+ BECDF64D0761BA81005FE872 /* SDL_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538438006D7D947F000001 /* SDL_error.c */; };
+ BECDF64E0761BA81005FE872 /* SDL_fatal.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538439006D7D947F000001 /* SDL_fatal.c */; };
+ BECDF6500761BA81005FE872 /* SDL.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153843C006D7D947F000001 /* SDL.c */; };
+ BECDF6510761BA81005FE872 /* SDL_thread.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538445006D7EC67F000001 /* SDL_thread.c */; };
+ BECDF6520761BA81005FE872 /* SDL_cdrom.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4895006D86FF7F000001 /* SDL_cdrom.c */; };
+ BECDF6530761BA81005FE872 /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E489D006D88D97F000001 /* SDL_joystick.c */; };
+ BECDF6580761BA81005FE872 /* SDL_stretch.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383EA006D7A567F000001 /* SDL_stretch.c */; };
+ BECDF6590761BA81005FE872 /* SDL_sysjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = F51789D101769A2401D3D55B /* SDL_sysjoystick.c */; };
+ BECDF65B0761BA81005FE872 /* SDL_QuartzEvents.m in Sources */ = {isa = PBXBuildFile; fileRef = B24DA4D705A88AD0006B9F1C /* SDL_QuartzEvents.m */; };
+ BECDF65C0761BA81005FE872 /* SDL_QuartzGL.m in Sources */ = {isa = PBXBuildFile; fileRef = B24DA4D805A88AD0006B9F1C /* SDL_QuartzGL.m */; };
+ BECDF65D0761BA81005FE872 /* SDL_QuartzVideo.m in Sources */ = {isa = PBXBuildFile; fileRef = B24DA4DB05A88AD0006B9F1C /* SDL_QuartzVideo.m */; };
+ BECDF65E0761BA81005FE872 /* SDL_QuartzWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = B24DA4DD05A88AD0006B9F1C /* SDL_QuartzWindow.m */; };
+ BECDF65F0761BA81005FE872 /* SDL_QuartzWM.m in Sources */ = {isa = PBXBuildFile; fileRef = B24DA4DE05A88AD0006B9F1C /* SDL_QuartzWM.m */; };
+ BECDF6610761BA81005FE872 /* SDL_cpuinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = B24DA50405A88D52006B9F1C /* SDL_cpuinfo.c */; };
+ BECDF6620761BA81005FE872 /* SDL_syscdrom.c in Sources */ = {isa = PBXBuildFile; fileRef = B2A23A7B04157C5700A80002 /* SDL_syscdrom.c */; };
+ BECDF6670761BA81005FE872 /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = BECDF5D50761B759005FE872 /* SDL_coreaudio.c */; };
+ BECDF6720761BA81005FE872 /* CGS.h in Headers */ = {isa = PBXBuildFile; fileRef = B24DA4D605A88AD0006B9F1C /* CGS.h */; };
+ BECDF6730761BA81005FE872 /* SDL_QuartzKeys.h in Headers */ = {isa = PBXBuildFile; fileRef = B24DA4D905A88AD0006B9F1C /* SDL_QuartzKeys.h */; };
+ BECDF6740761BA81005FE872 /* SDL_QuartzVideo.h in Headers */ = {isa = PBXBuildFile; fileRef = B24DA4DA05A88AD0006B9F1C /* SDL_QuartzVideo.h */; };
+ BECDF6750761BA81005FE872 /* SDL_QuartzWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = B24DA4DC05A88AD0006B9F1C /* SDL_QuartzWindow.h */; };
+ BECDF6760761BA81005FE872 /* SDL_cpuinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CF8DC405C444E400E5DC7F /* SDL_cpuinfo.h */; };
+ BECDF6770761BA81005FE872 /* SDL_name.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CF8DC705C4450500E5DC7F /* SDL_name.h */; };
+ BECDF6780761BA81005FE872 /* SDL_coreaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = BECDF5D60761B759005FE872 /* SDL_coreaudio.h */; };
+ BECDF67A0761BA81005FE872 /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538330006D78D67F000001 /* SDL_audio.c */; };
+ BECDF67B0761BA81005FE872 /* SDL_audiocvt.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538331006D78D67F000001 /* SDL_audiocvt.c */; };
+ BECDF67D0761BA81005FE872 /* SDL_audiodev.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538332006D78D67F000001 /* SDL_audiodev.c */; };
+ BECDF67E0761BA81005FE872 /* SDL_mixer.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538334006D78D67F000001 /* SDL_mixer.c */; };
+ BECDF67F0761BA81005FE872 /* SDL_wave.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538335006D78D67F000001 /* SDL_wave.c */; };
+ BECDF6810761BA81005FE872 /* SDL_cdrom.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4895006D86FF7F000001 /* SDL_cdrom.c */; };
+ BECDF6830761BA81005FE872 /* SDL_active.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538368006D79147F000001 /* SDL_active.c */; };
+ BECDF6840761BA81005FE872 /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538369006D79147F000001 /* SDL_events.c */; };
+ BECDF6850761BA81005FE872 /* SDL_expose.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153836A006D79147F000001 /* SDL_expose.c */; };
+ BECDF6860761BA81005FE872 /* SDL_keyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153836B006D79147F000001 /* SDL_keyboard.c */; };
+ BECDF6870761BA81005FE872 /* SDL_mouse.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153836C006D79147F000001 /* SDL_mouse.c */; };
+ BECDF6880761BA81005FE872 /* SDL_quit.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153836D006D79147F000001 /* SDL_quit.c */; };
+ BECDF6890761BA81005FE872 /* SDL_resize.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153836E006D79147F000001 /* SDL_resize.c */; };
+ BECDF68A0761BA81005FE872 /* SDL_rwops.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538377006D79307F000001 /* SDL_rwops.c */; };
+ BECDF68B0761BA81005FE872 /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E489D006D88D97F000001 /* SDL_joystick.c */; };
+ BECDF68C0761BA81005FE872 /* SDL_thread.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538445006D7EC67F000001 /* SDL_thread.c */; };
+ BECDF6920761BA81005FE872 /* SDL_timer.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383A0006D79BC7F000001 /* SDL_timer.c */; };
+ BECDF6930761BA81005FE872 /* SDL_blit.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383D8006D7A567F000001 /* SDL_blit.c */; };
+ BECDF6940761BA81005FE872 /* SDL_blit_0.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383DA006D7A567F000001 /* SDL_blit_0.c */; };
+ BECDF6950761BA81005FE872 /* SDL_blit_1.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383DB006D7A567F000001 /* SDL_blit_1.c */; };
+ BECDF6960761BA81005FE872 /* SDL_blit_A.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383DC006D7A567F000001 /* SDL_blit_A.c */; };
+ BECDF6970761BA81005FE872 /* SDL_blit_N.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383DE006D7A567F000001 /* SDL_blit_N.c */; };
+ BECDF6980761BA81005FE872 /* SDL_bmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383DF006D7A567F000001 /* SDL_bmp.c */; };
+ BECDF6990761BA81005FE872 /* SDL_cursor.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383E0006D7A567F000001 /* SDL_cursor.c */; };
+ BECDF69A0761BA81005FE872 /* SDL_gamma.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383E2006D7A567F000001 /* SDL_gamma.c */; };
+ BECDF69B0761BA81005FE872 /* SDL_pixels.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383E6006D7A567F000001 /* SDL_pixels.c */; };
+ BECDF69C0761BA81005FE872 /* SDL_RLEaccel.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383E8006D7A567F000001 /* SDL_RLEaccel.c */; };
+ BECDF69D0761BA81005FE872 /* SDL_stretch.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383EA006D7A567F000001 /* SDL_stretch.c */; };
+ BECDF69E0761BA81005FE872 /* SDL_surface.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383EC006D7A567F000001 /* SDL_surface.c */; };
+ BECDF69F0761BA81005FE872 /* SDL_video.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383EE006D7A567F000001 /* SDL_video.c */; };
+ BECDF6A00761BA81005FE872 /* SDL_yuv.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383EF006D7A567F000001 /* SDL_yuv.c */; };
+ BECDF6A10761BA81005FE872 /* SDL_yuv_sw.c in Sources */ = {isa = PBXBuildFile; fileRef = 015383F1006D7A567F000001 /* SDL_yuv_sw.c */; };
+ BECDF6A20761BA81005FE872 /* SDL_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538438006D7D947F000001 /* SDL_error.c */; };
+ BECDF6A30761BA81005FE872 /* SDL_fatal.c in Sources */ = {isa = PBXBuildFile; fileRef = 01538439006D7D947F000001 /* SDL_fatal.c */; };
+ BECDF6A50761BA81005FE872 /* SDL.c in Sources */ = {isa = PBXBuildFile; fileRef = 0153843C006D7D947F000001 /* SDL.c */; };
+ BECDF6A60761BA81005FE872 /* SDL_sysjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = F51789D101769A2401D3D55B /* SDL_sysjoystick.c */; };
+ BECDF6A80761BA81005FE872 /* SDL_syscdrom.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4894006D86FF7F000001 /* SDL_syscdrom.c */; };
+ BECDF6A90761BA81005FE872 /* SDL_QuartzEvents.m in Sources */ = {isa = PBXBuildFile; fileRef = B24DA4D705A88AD0006B9F1C /* SDL_QuartzEvents.m */; };
+ BECDF6AA0761BA81005FE872 /* SDL_QuartzGL.m in Sources */ = {isa = PBXBuildFile; fileRef = B24DA4D805A88AD0006B9F1C /* SDL_QuartzGL.m */; };
+ BECDF6AB0761BA81005FE872 /* SDL_QuartzVideo.m in Sources */ = {isa = PBXBuildFile; fileRef = B24DA4DB05A88AD0006B9F1C /* SDL_QuartzVideo.m */; };
+ BECDF6AC0761BA81005FE872 /* SDL_QuartzWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = B24DA4DD05A88AD0006B9F1C /* SDL_QuartzWindow.m */; };
+ BECDF6AD0761BA81005FE872 /* SDL_QuartzWM.m in Sources */ = {isa = PBXBuildFile; fileRef = B24DA4DE05A88AD0006B9F1C /* SDL_QuartzWM.m */; };
+ BECDF6AF0761BA81005FE872 /* SDL_cpuinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = B24DA50405A88D52006B9F1C /* SDL_cpuinfo.c */; };
+ BECDF6B00761BA81005FE872 /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = BECDF5D50761B759005FE872 /* SDL_coreaudio.c */; };
+ BECDF6B70761BA81005FE872 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EECDF2E0086C3A07F000001 /* SDLMain.m */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 00830FFF1072D94A00A531F1 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 0032354F1070931700C76517;
+ remoteInfo = "Generate Doxygen DocSet";
+ };
+ BECDF6C50761BA81005FE872 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BECDF5FE0761BA81005FE872;
+ remoteInfo = "Framework (Upgraded)";
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+ 0014B7E809C0D8D2003A99D5 /* SDL_dgaevents_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_dgaevents_c.h; sourceTree = "<group>"; };
+ 0014B7E909C0D8D2003A99D5 /* SDL_dgaevents.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_dgaevents.c; sourceTree = "<group>"; };
+ 0014B7EA09C0D8D2003A99D5 /* SDL_dgamouse_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_dgamouse_c.h; sourceTree = "<group>"; };
+ 0014B7EB09C0D8D2003A99D5 /* SDL_dgamouse.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_dgamouse.c; sourceTree = "<group>"; };
+ 0014B7EC09C0D8D2003A99D5 /* SDL_dgavideo.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_dgavideo.c; sourceTree = "<group>"; };
+ 0014B7ED09C0D8D2003A99D5 /* SDL_dgavideo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_dgavideo.h; sourceTree = "<group>"; };
+ 0014B83709C0D977003A99D5 /* SDL_x11dga_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11dga_c.h; sourceTree = "<group>"; };
+ 0014B83809C0D977003A99D5 /* SDL_x11dga.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11dga.c; sourceTree = "<group>"; };
+ 0014B83909C0D977003A99D5 /* SDL_x11dyn.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11dyn.c; sourceTree = "<group>"; };
+ 0014B83A09C0D977003A99D5 /* SDL_x11dyn.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11dyn.h; sourceTree = "<group>"; };
+ 0014B83B09C0D977003A99D5 /* SDL_x11events_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11events_c.h; sourceTree = "<group>"; };
+ 0014B83C09C0D977003A99D5 /* SDL_x11events.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11events.c; sourceTree = "<group>"; };
+ 0014B83D09C0D977003A99D5 /* SDL_x11gamma_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11gamma_c.h; sourceTree = "<group>"; };
+ 0014B83E09C0D977003A99D5 /* SDL_x11gamma.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11gamma.c; sourceTree = "<group>"; };
+ 0014B83F09C0D977003A99D5 /* SDL_x11gl_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11gl_c.h; sourceTree = "<group>"; };
+ 0014B84009C0D977003A99D5 /* SDL_x11gl.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11gl.c; sourceTree = "<group>"; };
+ 0014B84109C0D977003A99D5 /* SDL_x11image_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11image_c.h; sourceTree = "<group>"; };
+ 0014B84209C0D977003A99D5 /* SDL_x11image.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11image.c; sourceTree = "<group>"; };
+ 0014B84309C0D977003A99D5 /* SDL_x11modes_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11modes_c.h; sourceTree = "<group>"; };
+ 0014B84409C0D977003A99D5 /* SDL_x11modes.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11modes.c; sourceTree = "<group>"; };
+ 0014B84509C0D977003A99D5 /* SDL_x11mouse_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11mouse_c.h; sourceTree = "<group>"; };
+ 0014B84609C0D977003A99D5 /* SDL_x11mouse.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11mouse.c; sourceTree = "<group>"; };
+ 0014B84709C0D977003A99D5 /* SDL_x11sym.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11sym.h; sourceTree = "<group>"; };
+ 0014B84809C0D977003A99D5 /* SDL_x11video.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11video.c; sourceTree = "<group>"; };
+ 0014B84909C0D977003A99D5 /* SDL_x11video.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11video.h; sourceTree = "<group>"; };
+ 0014B84A09C0D977003A99D5 /* SDL_x11wm_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11wm_c.h; sourceTree = "<group>"; };
+ 0014B84B09C0D977003A99D5 /* SDL_x11wm.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11wm.c; sourceTree = "<group>"; };
+ 0014B84C09C0D977003A99D5 /* SDL_x11yuv_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_x11yuv_c.h; sourceTree = "<group>"; };
+ 0014B84D09C0D977003A99D5 /* SDL_x11yuv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_x11yuv.c; sourceTree = "<group>"; };
+ 0014B89009C0DA94003A99D5 /* XF86DGA.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = XF86DGA.c; sourceTree = "<group>"; };
+ 0014B89109C0DA94003A99D5 /* XF86DGA2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = XF86DGA2.c; sourceTree = "<group>"; };
+ 0014B89609C0DAA1003A99D5 /* XF86VMode.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = XF86VMode.c; sourceTree = "<group>"; };
+ 0014B89909C0DAAE003A99D5 /* Xv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = Xv.c; sourceTree = "<group>"; };
+ 0014B89A09C0DAAE003A99D5 /* Xvlibint.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Xvlibint.h; sourceTree = "<group>"; };
+ 0014B89F09C0DAB9003A99D5 /* Xinerama.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = Xinerama.c; sourceTree = "<group>"; };
+ 0014B8A209C0DAC4003A99D5 /* xme.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = xme.c; sourceTree = "<group>"; };
+ 00162D3209BD1FA90037C8D0 /* SDL_config_dreamcast.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_config_dreamcast.h; path = ../../include/SDL_config_dreamcast.h; sourceTree = SOURCE_ROOT; };
+ 00162D3309BD1FA90037C8D0 /* SDL_config_macos.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_config_macos.h; path = ../../include/SDL_config_macos.h; sourceTree = SOURCE_ROOT; };
+ 00162D3409BD1FA90037C8D0 /* SDL_config_macosx.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_config_macosx.h; path = ../../include/SDL_config_macosx.h; sourceTree = SOURCE_ROOT; };
+ 00162D3509BD1FA90037C8D0 /* SDL_config_os2.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_config_os2.h; path = ../../include/SDL_config_os2.h; sourceTree = SOURCE_ROOT; };
+ 00162D3609BD1FA90037C8D0 /* SDL_config_win32.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_config_win32.h; path = ../../include/SDL_config_win32.h; sourceTree = SOURCE_ROOT; };
+ 00162D3709BD1FA90037C8D0 /* SDL_config.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_config.h; path = ../../include/SDL_config.h; sourceTree = SOURCE_ROOT; };
+ 00162D3809BD1FA90037C8D0 /* SDL_platform.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_platform.h; path = ../../include/SDL_platform.h; sourceTree = SOURCE_ROOT; };
+ 00162D3909BD1FA90037C8D0 /* SDL_stdinc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_stdinc.h; path = ../../include/SDL_stdinc.h; sourceTree = SOURCE_ROOT; };
+ 00162D4D09BD20DA0037C8D0 /* SDL_syscond.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_syscond.c; sourceTree = "<group>"; };
+ 00162D4E09BD20DA0037C8D0 /* SDL_sysmutex.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_sysmutex.c; sourceTree = "<group>"; };
+ 00162D4F09BD20DA0037C8D0 /* SDL_sysmutex_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_sysmutex_c.h; sourceTree = "<group>"; };
+ 00162D5009BD20DA0037C8D0 /* SDL_syssem.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_syssem.c; sourceTree = "<group>"; };
+ 00162D5109BD20DA0037C8D0 /* SDL_systhread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_systhread.c; sourceTree = "<group>"; };
+ 00162D5209BD20DA0037C8D0 /* SDL_systhread_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_systhread_c.h; sourceTree = "<group>"; };
+ 00162D6009BD21010037C8D0 /* SDL_systimer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_systimer.c; sourceTree = "<group>"; };
+ 00162D6509BD214F0037C8D0 /* SDL_getenv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_getenv.c; sourceTree = "<group>"; };
+ 00162D6609BD214F0037C8D0 /* SDL_malloc.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_malloc.c; sourceTree = "<group>"; };
+ 00162D6709BD214F0037C8D0 /* SDL_qsort.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_qsort.c; sourceTree = "<group>"; };
+ 00162D6809BD214F0037C8D0 /* SDL_stdlib.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_stdlib.c; sourceTree = "<group>"; };
+ 00162D6909BD214F0037C8D0 /* SDL_string.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_string.c; sourceTree = "<group>"; };
+ 00162F3409BE27FB0037C8D0 /* SDL_nullevents.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_nullevents.c; sourceTree = "<group>"; };
+ 00162F3509BE27FB0037C8D0 /* SDL_nullevents_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_nullevents_c.h; sourceTree = "<group>"; };
+ 00162F3609BE27FB0037C8D0 /* SDL_nullmouse.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_nullmouse.c; sourceTree = "<group>"; };
+ 00162F3709BE27FB0037C8D0 /* SDL_nullmouse_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_nullmouse_c.h; sourceTree = "<group>"; };
+ 00162F3809BE27FB0037C8D0 /* SDL_nullvideo.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_nullvideo.c; sourceTree = "<group>"; };
+ 00162F3909BE27FB0037C8D0 /* SDL_nullvideo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_nullvideo.h; sourceTree = "<group>"; };
+ 002F328509CA049100EBEB88 /* SDL_iconv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_iconv.c; sourceTree = "<group>"; };
+ 002F32D409CA0BE700EBEB88 /* SDL_diskaudio.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_diskaudio.c; sourceTree = "<group>"; };
+ 002F32D509CA0BE700EBEB88 /* SDL_diskaudio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_diskaudio.h; sourceTree = "<group>"; };
+ 002F32E209CA0BF600EBEB88 /* SDL_dummyaudio.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_dummyaudio.c; sourceTree = "<group>"; };
+ 002F32E309CA0BF600EBEB88 /* SDL_dummyaudio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_dummyaudio.h; sourceTree = "<group>"; };
+ 004C2C860975E13300E9D430 /* AudioFilePlayer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = AudioFilePlayer.c; sourceTree = "<group>"; };
+ 004C2C870975E13300E9D430 /* AudioFileReaderThread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = AudioFileReaderThread.c; sourceTree = "<group>"; };
+ 004C2C880975E13300E9D430 /* CDPlayer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = CDPlayer.c; sourceTree = "<group>"; };
+ 004C2C890975E13300E9D430 /* SDLOSXCAGuard.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDLOSXCAGuard.c; sourceTree = "<group>"; };
+ 004C2C8A0975E13300E9D430 /* SDLOSXCAGuard.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLOSXCAGuard.h; sourceTree = "<group>"; };
+ 0073179B0858DECD00B2BC32 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = "<absolute>"; };
+ 0073179C0858DECD00B2BC32 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = "<absolute>"; };
+ 0073179D0858DECD00B2BC32 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ 0073179E0858DECD00B2BC32 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = "<absolute>"; };
+ 0073179F0858DECD00B2BC32 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
+ 007317A00858DECD00B2BC32 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
+ 007317A10858DECD00B2BC32 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = "<absolute>"; };
+ 007317C10858E15000B2BC32 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
+ 00794D3F09D0C461003FC8A1 /* License.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = License.rtf; sourceTree = "<group>"; };
+ 00AE6E1E08B958CC00255E2F /* ReadMeDevLite.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = ReadMeDevLite.txt; sourceTree = "<group>"; };
+ 00B7E61F097F2D9E00826121 /* SDL_mixer_MMX.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_mixer_MMX.c; sourceTree = "<group>"; };
+ 00B7E620097F2D9E00826121 /* SDL_mixer_MMX.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_mixer_MMX.h; sourceTree = "<group>"; };
+ 00B7E625097F2DD100826121 /* SDL_yuv_mmx.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_mmx.c; sourceTree = "<group>"; };
+ 00D0D02210675823004B05EF /* SDL_QuartzWM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_QuartzWM.h; sourceTree = "<group>"; };
+ 00D0D08310675DD9004B05EF /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
+ 00F5D79E0990CA0D0051C449 /* UniversalBinaryNotes.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = UniversalBinaryNotes.rtf; sourceTree = "<group>"; };
+ 01538330006D78D67F000001 /* SDL_audio.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_audio.c; sourceTree = "<group>"; };
+ 01538331006D78D67F000001 /* SDL_audiocvt.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_audiocvt.c; sourceTree = "<group>"; };
+ 01538332006D78D67F000001 /* SDL_audiodev.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_audiodev.c; sourceTree = "<group>"; };
+ 01538334006D78D67F000001 /* SDL_mixer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_mixer.c; sourceTree = "<group>"; };
+ 01538335006D78D67F000001 /* SDL_wave.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_wave.c; sourceTree = "<group>"; };
+ 01538368006D79147F000001 /* SDL_active.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_active.c; sourceTree = "<group>"; };
+ 01538369006D79147F000001 /* SDL_events.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_events.c; sourceTree = "<group>"; };
+ 0153836A006D79147F000001 /* SDL_expose.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_expose.c; sourceTree = "<group>"; };
+ 0153836B006D79147F000001 /* SDL_keyboard.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_keyboard.c; sourceTree = "<group>"; };
+ 0153836C006D79147F000001 /* SDL_mouse.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_mouse.c; sourceTree = "<group>"; };
+ 0153836D006D79147F000001 /* SDL_quit.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_quit.c; sourceTree = "<group>"; };
+ 0153836E006D79147F000001 /* SDL_resize.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_resize.c; sourceTree = "<group>"; };
+ 01538377006D79307F000001 /* SDL_rwops.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_rwops.c; sourceTree = "<group>"; };
+ 015383A0006D79BC7F000001 /* SDL_timer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_timer.c; sourceTree = "<group>"; };
+ 015383C5006D7A567F000001 /* SDL_macevents.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_macevents.c; sourceTree = "<group>"; };
+ 015383C7006D7A567F000001 /* SDL_macgl.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_macgl.c; sourceTree = "<group>"; };
+ 015383CA006D7A567F000001 /* SDL_macmouse.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_macmouse.c; sourceTree = "<group>"; };
+ 015383CC006D7A567F000001 /* SDL_macwm.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_macwm.c; sourceTree = "<group>"; };
+ 015383D1006D7A567F000001 /* SDL_dspvideo.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_dspvideo.c; sourceTree = "<group>"; };
+ 015383D2006D7A567F000001 /* SDL_dspvideo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_dspvideo.h; sourceTree = "<group>"; };
+ 015383D6006D7A567F000001 /* SDL_romvideo.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_romvideo.c; sourceTree = "<group>"; };
+ 015383D8006D7A567F000001 /* SDL_blit.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_blit.c; sourceTree = "<group>"; };
+ 015383DA006D7A567F000001 /* SDL_blit_0.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_blit_0.c; sourceTree = "<group>"; };
+ 015383DB006D7A567F000001 /* SDL_blit_1.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_blit_1.c; sourceTree = "<group>"; };
+ 015383DC006D7A567F000001 /* SDL_blit_A.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_blit_A.c; sourceTree = "<group>"; };
+ 015383DE006D7A567F000001 /* SDL_blit_N.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_blit_N.c; sourceTree = "<group>"; };
+ 015383DF006D7A567F000001 /* SDL_bmp.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_bmp.c; sourceTree = "<group>"; };
+ 015383E0006D7A567F000001 /* SDL_cursor.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_cursor.c; sourceTree = "<group>"; };
+ 015383E2006D7A567F000001 /* SDL_gamma.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_gamma.c; sourceTree = "<group>"; };
+ 015383E6006D7A567F000001 /* SDL_pixels.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_pixels.c; sourceTree = "<group>"; };
+ 015383E8006D7A567F000001 /* SDL_RLEaccel.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_RLEaccel.c; sourceTree = "<group>"; };
+ 015383EA006D7A567F000001 /* SDL_stretch.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_stretch.c; sourceTree = "<group>"; };
+ 015383EC006D7A567F000001 /* SDL_surface.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_surface.c; sourceTree = "<group>"; };
+ 015383EE006D7A567F000001 /* SDL_video.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_video.c; sourceTree = "<group>"; };
+ 015383EF006D7A567F000001 /* SDL_yuv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_yuv.c; sourceTree = "<group>"; };
+ 015383F1006D7A567F000001 /* SDL_yuv_sw.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_sw.c; sourceTree = "<group>"; };
+ 01538438006D7D947F000001 /* SDL_error.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = SDL_error.c; path = ../../src/SDL_error.c; sourceTree = SOURCE_ROOT; };
+ 01538439006D7D947F000001 /* SDL_fatal.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = SDL_fatal.c; path = ../../src/SDL_fatal.c; sourceTree = SOURCE_ROOT; };
+ 0153843C006D7D947F000001 /* SDL.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = SDL.c; path = ../../src/SDL.c; sourceTree = SOURCE_ROOT; };
+ 01538445006D7EC67F000001 /* SDL_thread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = SDL_thread.c; path = ../../src/thread/SDL_thread.c; sourceTree = SOURCE_ROOT; };
+ 046B91E90A11B53500FB151C /* SDL_sysloadso.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_sysloadso.c; sourceTree = "<group>"; };
+ 046B92100A11B8AD00FB151C /* SDL_dlcompat.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_dlcompat.c; sourceTree = "<group>"; };
+ 083E4894006D86FF7F000001 /* SDL_syscdrom.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_syscdrom.c; sourceTree = "<group>"; };
+ 083E4895006D86FF7F000001 /* SDL_cdrom.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_cdrom.c; sourceTree = "<group>"; };
+ 083E489D006D88D97F000001 /* SDL_joystick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_joystick.c; sourceTree = "<group>"; };
+ 0C5AF5E501191D2B7F000001 /* begin_code.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = begin_code.h; path = ../../include/begin_code.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5E601191D2B7F000001 /* close_code.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = close_code.h; path = ../../include/close_code.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5E701191D2B7F000001 /* SDL_active.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_active.h; path = ../../include/SDL_active.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5E801191D2B7F000001 /* SDL_audio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_audio.h; path = ../../include/SDL_audio.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5E901191D2B7F000001 /* SDL_byteorder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_byteorder.h; path = ../../include/SDL_byteorder.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5EA01191D2B7F000001 /* SDL_cdrom.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_cdrom.h; path = ../../include/SDL_cdrom.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5EB01191D2B7F000001 /* SDL_copying.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_copying.h; path = ../../include/SDL_copying.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5EC01191D2B7F000001 /* SDL_endian.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_endian.h; path = ../../include/SDL_endian.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5ED01191D2B7F000001 /* SDL_error.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_error.h; path = ../../include/SDL_error.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5EE01191D2B7F000001 /* SDL_events.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_events.h; path = ../../include/SDL_events.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5EF01191D2B7F000001 /* SDL_getenv.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_getenv.h; path = ../../include/SDL_getenv.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5F001191D2B7F000001 /* SDL_joystick.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_joystick.h; path = ../../include/SDL_joystick.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5F101191D2B7F000001 /* SDL_keyboard.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_keyboard.h; path = ../../include/SDL_keyboard.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5F201191D2B7F000001 /* SDL_keysym.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_keysym.h; path = ../../include/SDL_keysym.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5F301191D2B7F000001 /* SDL_main.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_main.h; path = ../../include/SDL_main.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5F401191D2B7F000001 /* SDL_mouse.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_mouse.h; path = ../../include/SDL_mouse.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5F501191D2B7F000001 /* SDL_mutex.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_mutex.h; path = ../../include/SDL_mutex.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5F601191D2B7F000001 /* SDL_opengl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_opengl.h; path = ../../include/SDL_opengl.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5F701191D2B7F000001 /* SDL_quit.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_quit.h; path = ../../include/SDL_quit.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5F801191D2B7F000001 /* SDL_rwops.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_rwops.h; path = ../../include/SDL_rwops.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5F901191D2B7F000001 /* SDL_syswm.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_syswm.h; path = ../../include/SDL_syswm.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5FA01191D2B7F000001 /* SDL_thread.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_thread.h; path = ../../include/SDL_thread.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5FB01191D2B7F000001 /* SDL_timer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_timer.h; path = ../../include/SDL_timer.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5FC01191D2B7F000001 /* SDL_types.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_types.h; path = ../../include/SDL_types.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5FD01191D2B7F000001 /* SDL_version.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_version.h; path = ../../include/SDL_version.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5FE01191D2B7F000001 /* SDL_video.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_video.h; path = ../../include/SDL_video.h; sourceTree = SOURCE_ROOT; };
+ 0C5AF5FF01191D2B7F000001 /* SDL.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL.h; path = ../../include/SDL.h; sourceTree = SOURCE_ROOT; };
+ 2EECDF2D0086C3A07F000001 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDLMain.h; path = ../../src/main/macosx/SDLMain.h; sourceTree = SOURCE_ROOT; };
+ 2EECDF2E0086C3A07F000001 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = SDLMain.m; path = ../../src/main/macosx/SDLMain.m; sourceTree = SOURCE_ROOT; };
+ 2EECDF2F0086C3A07F000001 /* SDLMain.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = SDLMain.nib; path = ../../src/main/macosx/SDLMain.nib; sourceTree = SOURCE_ROOT; };
+ B24DA4D605A88AD0006B9F1C /* CGS.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CGS.h; sourceTree = "<group>"; };
+ B24DA4D705A88AD0006B9F1C /* SDL_QuartzEvents.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDL_QuartzEvents.m; sourceTree = "<group>"; };
+ B24DA4D805A88AD0006B9F1C /* SDL_QuartzGL.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDL_QuartzGL.m; sourceTree = "<group>"; };
+ B24DA4D905A88AD0006B9F1C /* SDL_QuartzKeys.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_QuartzKeys.h; sourceTree = "<group>"; };
+ B24DA4DA05A88AD0006B9F1C /* SDL_QuartzVideo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_QuartzVideo.h; sourceTree = "<group>"; };
+ B24DA4DB05A88AD0006B9F1C /* SDL_QuartzVideo.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDL_QuartzVideo.m; sourceTree = "<group>"; };
+ B24DA4DC05A88AD0006B9F1C /* SDL_QuartzWindow.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_QuartzWindow.h; sourceTree = "<group>"; };
+ B24DA4DD05A88AD0006B9F1C /* SDL_QuartzWindow.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDL_QuartzWindow.m; sourceTree = "<group>"; };
+ B24DA4DE05A88AD0006B9F1C /* SDL_QuartzWM.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDL_QuartzWM.m; sourceTree = "<group>"; };
+ B24DA50405A88D52006B9F1C /* SDL_cpuinfo.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_cpuinfo.c; sourceTree = "<group>"; };
+ B29A290D04E5B28700A80002 /* SDL_loadso.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_loadso.h; path = ../../include/SDL_loadso.h; sourceTree = "<group>"; };
+ B2A23A450415799100A80002 /* AudioFilePlayer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AudioFilePlayer.h; sourceTree = "<group>"; };
+ B2A23A7A04157C5700A80002 /* SDL_syscdrom_c.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_syscdrom_c.h; sourceTree = "<group>"; };
+ B2A23A7B04157C5700A80002 /* SDL_syscdrom.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_syscdrom.c; sourceTree = "<group>"; };
+ B2A23A8104157D5D00A80002 /* CDPlayer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CDPlayer.h; sourceTree = "<group>"; };
+ B2CF8DC405C444E400E5DC7F /* SDL_cpuinfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_cpuinfo.h; path = ../../include/SDL_cpuinfo.h; sourceTree = SOURCE_ROOT; };
+ B2CF8DC705C4450500E5DC7F /* SDL_name.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_name.h; path = ../../include/SDL_name.h; sourceTree = SOURCE_ROOT; };
+ BECDF5D50761B759005FE872 /* SDL_coreaudio.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_coreaudio.c; sourceTree = "<group>"; };
+ BECDF5D60761B759005FE872 /* SDL_coreaudio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_coreaudio.h; sourceTree = "<group>"; };
+ BECDF66B0761BA81005FE872 /* Info-Framework.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-Framework.plist"; sourceTree = "<group>"; };
+ BECDF66C0761BA81005FE872 /* SDL.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDL.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ BECDF6B30761BA81005FE872 /* libSDL.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDL.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ BECDF6BA0761BA81005FE872 /* libSDLmain.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSDLmain.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ BECDF6BE0761BA81005FE872 /* Standard DMG */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "Standard DMG"; sourceTree = BUILT_PRODUCTS_DIR; };
+ BECDF6C30761BA81005FE872 /* Developer Extras Package */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "Developer Extras Package"; sourceTree = BUILT_PRODUCTS_DIR; };
+ F51789D101769A2401D3D55B /* SDL_sysjoystick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_sysjoystick.c; sourceTree = "<group>"; };
+ F59C70FF00D5CB5801000001 /* ReadMe.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = ReadMe.txt; sourceTree = "<group>"; };
+ F59C710000D5CB5801000001 /* Welcome.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Welcome.txt; sourceTree = "<group>"; };
+ F59C710300D5CB5801000001 /* ReadMe.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = ReadMe.txt; sourceTree = "<group>"; };
+ F59C710500D5CB5801000001 /* SDL-devel.info */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "SDL-devel.info"; sourceTree = "<group>"; };
+ F59C710600D5CB5801000001 /* SDL.info */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SDL.info; sourceTree = "<group>"; };
+ F59C710C00D5D15801000001 /* install.sh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = install.sh; sourceTree = "<group>"; };
+ 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; };
+ 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 */
+ BECDF6680761BA81005FE872 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 007317A20858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */,
+ 007317A30858DECD00B2BC32 /* AudioUnit.framework in Frameworks */,
+ 007317A40858DECD00B2BC32 /* Cocoa.framework in Frameworks */,
+ 007317A50858DECD00B2BC32 /* CoreAudio.framework in Frameworks */,
+ 007317A60858DECD00B2BC32 /* IOKit.framework in Frameworks */,
+ 007317A70858DECD00B2BC32 /* OpenGL.framework in Frameworks */,
+ 00D0D08410675DD9004B05EF /* CoreFoundation.framework in Frameworks */,
+ 00D0D0D810675E46004B05EF /* Carbon.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BECDF6B10761BA81005FE872 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 007317A90858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */,
+ 007317AA0858DECD00B2BC32 /* AudioUnit.framework in Frameworks */,
+ 007317AB0858DECD00B2BC32 /* Cocoa.framework in Frameworks */,
+ 007317AC0858DECD00B2BC32 /* CoreAudio.framework in Frameworks */,
+ 007317AD0858DECD00B2BC32 /* IOKit.framework in Frameworks */,
+ 007317AE0858DECD00B2BC32 /* OpenGL.framework in Frameworks */,
+ 007317AF0858DECD00B2BC32 /* QuickTime.framework in Frameworks */,
+ 007317C30858E15000B2BC32 /* Carbon.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BECDF6B80761BA81005FE872 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 007317B00858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */,
+ 007317B10858DECD00B2BC32 /* AudioUnit.framework in Frameworks */,
+ 007317B20858DECD00B2BC32 /* Cocoa.framework in Frameworks */,
+ 007317B30858DECD00B2BC32 /* CoreAudio.framework in Frameworks */,
+ 007317B40858DECD00B2BC32 /* IOKit.framework in Frameworks */,
+ 007317B50858DECD00B2BC32 /* OpenGL.framework in Frameworks */,
+ 007317B60858DECD00B2BC32 /* QuickTime.framework in Frameworks */,
+ 007317C40858E15000B2BC32 /* Carbon.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 0014B7D809C0D808003A99D5 /* dga */ = {
+ isa = PBXGroup;
+ children = (
+ 0014B7E809C0D8D2003A99D5 /* SDL_dgaevents_c.h */,
+ 0014B7E909C0D8D2003A99D5 /* SDL_dgaevents.c */,
+ 0014B7EA09C0D8D2003A99D5 /* SDL_dgamouse_c.h */,
+ 0014B7EB09C0D8D2003A99D5 /* SDL_dgamouse.c */,
+ 0014B7EC09C0D8D2003A99D5 /* SDL_dgavideo.c */,
+ 0014B7ED09C0D8D2003A99D5 /* SDL_dgavideo.h */,
+ );
+ path = dga;
+ sourceTree = "<group>";
+ };
+ 0014B83109C0D91E003A99D5 /* x11 */ = {
+ isa = PBXGroup;
+ children = (
+ 0014B83709C0D977003A99D5 /* SDL_x11dga_c.h */,
+ 0014B83809C0D977003A99D5 /* SDL_x11dga.c */,
+ 0014B83909C0D977003A99D5 /* SDL_x11dyn.c */,
+ 0014B83A09C0D977003A99D5 /* SDL_x11dyn.h */,
+ 0014B83B09C0D977003A99D5 /* SDL_x11events_c.h */,
+ 0014B83C09C0D977003A99D5 /* SDL_x11events.c */,
+ 0014B83D09C0D977003A99D5 /* SDL_x11gamma_c.h */,
+ 0014B83E09C0D977003A99D5 /* SDL_x11gamma.c */,
+ 0014B83F09C0D977003A99D5 /* SDL_x11gl_c.h */,
+ 0014B84009C0D977003A99D5 /* SDL_x11gl.c */,
+ 0014B84109C0D977003A99D5 /* SDL_x11image_c.h */,
+ 0014B84209C0D977003A99D5 /* SDL_x11image.c */,
+ 0014B84309C0D977003A99D5 /* SDL_x11modes_c.h */,
+ 0014B84409C0D977003A99D5 /* SDL_x11modes.c */,
+ 0014B84509C0D977003A99D5 /* SDL_x11mouse_c.h */,
+ 0014B84609C0D977003A99D5 /* SDL_x11mouse.c */,
+ 0014B84709C0D977003A99D5 /* SDL_x11sym.h */,
+ 0014B84809C0D977003A99D5 /* SDL_x11video.c */,
+ 0014B84909C0D977003A99D5 /* SDL_x11video.h */,
+ 0014B84A09C0D977003A99D5 /* SDL_x11wm_c.h */,
+ 0014B84B09C0D977003A99D5 /* SDL_x11wm.c */,
+ 0014B84C09C0D977003A99D5 /* SDL_x11yuv_c.h */,
+ 0014B84D09C0D977003A99D5 /* SDL_x11yuv.c */,
+ );
+ path = x11;
+ sourceTree = "<group>";
+ };
+ 0014B87D09C0D98A003A99D5 /* Xext */ = {
+ isa = PBXGroup;
+ children = (
+ 0014B87E09C0D9BD003A99D5 /* Xxf86dga */,
+ 0014B87F09C0D9D1003A99D5 /* Xxf86vm */,
+ 0014B88309C0DA1A003A99D5 /* Xv */,
+ 0014B88209C0DA0F003A99D5 /* Xinerama */,
+ 0014B88109C0DA04003A99D5 /* XME */,
+ );
+ path = Xext;
+ sourceTree = "<group>";
+ };
+ 0014B87E09C0D9BD003A99D5 /* Xxf86dga */ = {
+ isa = PBXGroup;
+ children = (
+ 0014B89009C0DA94003A99D5 /* XF86DGA.c */,
+ 0014B89109C0DA94003A99D5 /* XF86DGA2.c */,
+ );
+ path = Xxf86dga;
+ sourceTree = "<group>";
+ };
+ 0014B87F09C0D9D1003A99D5 /* Xxf86vm */ = {
+ isa = PBXGroup;
+ children = (
+ 0014B89609C0DAA1003A99D5 /* XF86VMode.c */,
+ );
+ path = Xxf86vm;
+ sourceTree = "<group>";
+ };
+ 0014B88109C0DA04003A99D5 /* XME */ = {
+ isa = PBXGroup;
+ children = (
+ 0014B8A209C0DAC4003A99D5 /* xme.c */,
+ );
+ path = XME;
+ sourceTree = "<group>";
+ };
+ 0014B88209C0DA0F003A99D5 /* Xinerama */ = {
+ isa = PBXGroup;
+ children = (
+ 0014B89F09C0DAB9003A99D5 /* Xinerama.c */,
+ );
+ path = Xinerama;
+ sourceTree = "<group>";
+ };
+ 0014B88309C0DA1A003A99D5 /* Xv */ = {
+ isa = PBXGroup;
+ children = (
+ 0014B89909C0DAAE003A99D5 /* Xv.c */,
+ 0014B89A09C0DAAE003A99D5 /* Xvlibint.h */,
+ );
+ path = Xv;
+ sourceTree = "<group>";
+ };
+ 00162D4C09BD20DA0037C8D0 /* pthread */ = {
+ isa = PBXGroup;
+ children = (
+ 00162D4D09BD20DA0037C8D0 /* SDL_syscond.c */,
+ 00162D4E09BD20DA0037C8D0 /* SDL_sysmutex.c */,
+ 00162D4F09BD20DA0037C8D0 /* SDL_sysmutex_c.h */,
+ 00162D5009BD20DA0037C8D0 /* SDL_syssem.c */,
+ 00162D5109BD20DA0037C8D0 /* SDL_systhread.c */,
+ 00162D5209BD20DA0037C8D0 /* SDL_systhread_c.h */,
+ );
+ path = pthread;
+ sourceTree = "<group>";
+ };
+ 00162D5F09BD21010037C8D0 /* unix */ = {
+ isa = PBXGroup;
+ children = (
+ 00162D6009BD21010037C8D0 /* SDL_systimer.c */,
+ );
+ path = unix;
+ sourceTree = "<group>";
+ };
+ 00162D6309BD214E0037C8D0 /* stdlib */ = {
+ isa = PBXGroup;
+ children = (
+ 00162D6509BD214F0037C8D0 /* SDL_getenv.c */,
+ 002F328509CA049100EBEB88 /* SDL_iconv.c */,
+ 00162D6609BD214F0037C8D0 /* SDL_malloc.c */,
+ 00162D6709BD214F0037C8D0 /* SDL_qsort.c */,
+ 00162D6809BD214F0037C8D0 /* SDL_stdlib.c */,
+ 00162D6909BD214F0037C8D0 /* SDL_string.c */,
+ );
+ name = stdlib;
+ path = ../../src/stdlib;
+ sourceTree = SOURCE_ROOT;
+ };
+ 00162D7509BD217B0037C8D0 /* loadso */ = {
+ isa = PBXGroup;
+ children = (
+ 046B91E80A11B53500FB151C /* dlopen */,
+ 00D55F250A11163D0030ED2A /* macosx */,
+ );
+ name = loadso;
+ path = ../../src/loadso;
+ sourceTree = SOURCE_ROOT;
+ };
+ 00162F3209BE27FB0037C8D0 /* dummy */ = {
+ isa = PBXGroup;
+ children = (
+ 00162F3409BE27FB0037C8D0 /* SDL_nullevents.c */,
+ 00162F3509BE27FB0037C8D0 /* SDL_nullevents_c.h */,
+ 00162F3609BE27FB0037C8D0 /* SDL_nullmouse.c */,
+ 00162F3709BE27FB0037C8D0 /* SDL_nullmouse_c.h */,
+ 00162F3809BE27FB0037C8D0 /* SDL_nullvideo.c */,
+ 00162F3909BE27FB0037C8D0 /* SDL_nullvideo.h */,
+ );
+ path = dummy;
+ sourceTree = "<group>";
+ };
+ 002F32D209CA0BE700EBEB88 /* disk */ = {
+ isa = PBXGroup;
+ children = (
+ 002F32D409CA0BE700EBEB88 /* SDL_diskaudio.c */,
+ 002F32D509CA0BE700EBEB88 /* SDL_diskaudio.h */,
+ );
+ path = disk;
+ sourceTree = "<group>";
+ };
+ 002F32E009CA0BF600EBEB88 /* dummy */ = {
+ isa = PBXGroup;
+ children = (
+ 002F32E209CA0BF600EBEB88 /* SDL_dummyaudio.c */,
+ 002F32E309CA0BF600EBEB88 /* SDL_dummyaudio.h */,
+ );
+ path = dummy;
+ sourceTree = "<group>";
+ };
+ 00D55F250A11163D0030ED2A /* macosx */ = {
+ isa = PBXGroup;
+ children = (
+ 046B92100A11B8AD00FB151C /* SDL_dlcompat.c */,
+ );
+ path = macosx;
+ sourceTree = "<group>";
+ };
+ 0153832C006D78D67F000001 /* audio */ = {
+ isa = PBXGroup;
+ children = (
+ BECDF5D20761B759005FE872 /* macosx */,
+ 002F32D209CA0BE700EBEB88 /* disk */,
+ 002F32E009CA0BF600EBEB88 /* dummy */,
+ 01538330006D78D67F000001 /* SDL_audio.c */,
+ 01538331006D78D67F000001 /* SDL_audiocvt.c */,
+ 01538332006D78D67F000001 /* SDL_audiodev.c */,
+ 01538334006D78D67F000001 /* SDL_mixer.c */,
+ 00B7E61F097F2D9E00826121 /* SDL_mixer_MMX.c */,
+ 00B7E620097F2D9E00826121 /* SDL_mixer_MMX.h */,
+ 01538335006D78D67F000001 /* SDL_wave.c */,
+ );
+ name = audio;
+ path = ../../src/audio;
+ sourceTree = SOURCE_ROOT;
+ };
+ 01538367006D79147F000001 /* events */ = {
+ isa = PBXGroup;
+ children = (
+ 01538368006D79147F000001 /* SDL_active.c */,
+ 01538369006D79147F000001 /* SDL_events.c */,
+ 0153836A006D79147F000001 /* SDL_expose.c */,
+ 0153836B006D79147F000001 /* SDL_keyboard.c */,
+ 0153836C006D79147F000001 /* SDL_mouse.c */,
+ 0153836D006D79147F000001 /* SDL_quit.c */,
+ 0153836E006D79147F000001 /* SDL_resize.c */,
+ );
+ name = events;
+ path = ../../src/events;
+ sourceTree = SOURCE_ROOT;
+ };
+ 01538376006D79307F000001 /* file */ = {
+ isa = PBXGroup;
+ children = (
+ 01538377006D79307F000001 /* SDL_rwops.c */,
+ );
+ name = file;
+ path = ../../src/file;
+ sourceTree = SOURCE_ROOT;
+ };
+ 01538379006D79737F000001 /* thread */ = {
+ isa = PBXGroup;
+ children = (
+ 00162D4C09BD20DA0037C8D0 /* pthread */,
+ 01538445006D7EC67F000001 /* SDL_thread.c */,
+ );
+ name = thread;
+ path = ../../src/thread;
+ sourceTree = SOURCE_ROOT;
+ };
+ 01538391006D79BC7F000001 /* timer */ = {
+ isa = PBXGroup;
+ children = (
+ 00162D5F09BD21010037C8D0 /* unix */,
+ 015383A0006D79BC7F000001 /* SDL_timer.c */,
+ );
+ name = timer;
+ path = ../../src/timer;
+ sourceTree = SOURCE_ROOT;
+ };
+ 015383BE006D7A567F000001 /* video */ = {
+ isa = PBXGroup;
+ children = (
+ 0FCDF5B50083FCE77F000001 /* quartz */,
+ 015383C1006D7A567F000001 /* maccommon */,
+ 015383CE006D7A567F000001 /* macdsp */,
+ 015383D3006D7A567F000001 /* macrom */,
+ 00162F3209BE27FB0037C8D0 /* dummy */,
+ 0014B83109C0D91E003A99D5 /* x11 */,
+ 0014B7D809C0D808003A99D5 /* dga */,
+ 0014B87D09C0D98A003A99D5 /* Xext */,
+ 015383D8006D7A567F000001 /* SDL_blit.c */,
+ 015383DA006D7A567F000001 /* SDL_blit_0.c */,
+ 015383DB006D7A567F000001 /* SDL_blit_1.c */,
+ 015383DC006D7A567F000001 /* SDL_blit_A.c */,
+ 015383DE006D7A567F000001 /* SDL_blit_N.c */,
+ 015383DF006D7A567F000001 /* SDL_bmp.c */,
+ 015383E0006D7A567F000001 /* SDL_cursor.c */,
+ 015383E2006D7A567F000001 /* SDL_gamma.c */,
+ 015383E6006D7A567F000001 /* SDL_pixels.c */,
+ 015383E8006D7A567F000001 /* SDL_RLEaccel.c */,
+ 015383EA006D7A567F000001 /* SDL_stretch.c */,
+ 015383EC006D7A567F000001 /* SDL_surface.c */,
+ 015383EE006D7A567F000001 /* SDL_video.c */,
+ 015383EF006D7A567F000001 /* SDL_yuv.c */,
+ 00B7E625097F2DD100826121 /* SDL_yuv_mmx.c */,
+ 015383F1006D7A567F000001 /* SDL_yuv_sw.c */,
+ );
+ name = video;
+ path = ../../src/video;
+ sourceTree = SOURCE_ROOT;
+ };
+ 015383C1006D7A567F000001 /* maccommon */ = {
+ isa = PBXGroup;
+ children = (
+ 015383C5006D7A567F000001 /* SDL_macevents.c */,
+ 015383C7006D7A567F000001 /* SDL_macgl.c */,
+ 015383CA006D7A567F000001 /* SDL_macmouse.c */,
+ 015383CC006D7A567F000001 /* SDL_macwm.c */,
+ );
+ path = maccommon;
+ sourceTree = "<group>";
+ };
+ 015383CE006D7A567F000001 /* macdsp */ = {
+ isa = PBXGroup;
+ children = (
+ 015383D1006D7A567F000001 /* SDL_dspvideo.c */,
+ 015383D2006D7A567F000001 /* SDL_dspvideo.h */,
+ );
+ path = macdsp;
+ sourceTree = "<group>";
+ };
+ 015383D3006D7A567F000001 /* macrom */ = {
+ isa = PBXGroup;
+ children = (
+ 015383D6006D7A567F000001 /* SDL_romvideo.c */,
+ );
+ path = macrom;
+ sourceTree = "<group>";
+ };
+ 0153844A006D81B07F000001 /* Public Headers */ = {
+ isa = PBXGroup;
+ children = (
+ 00162D3209BD1FA90037C8D0 /* SDL_config_dreamcast.h */,
+ 00162D3309BD1FA90037C8D0 /* SDL_config_macos.h */,
+ 00162D3409BD1FA90037C8D0 /* SDL_config_macosx.h */,
+ 00162D3509BD1FA90037C8D0 /* SDL_config_os2.h */,
+ 00162D3609BD1FA90037C8D0 /* SDL_config_win32.h */,
+ 00162D3709BD1FA90037C8D0 /* SDL_config.h */,
+ 00162D3809BD1FA90037C8D0 /* SDL_platform.h */,
+ 00162D3909BD1FA90037C8D0 /* SDL_stdinc.h */,
+ 0C5AF5E501191D2B7F000001 /* begin_code.h */,
+ 0C5AF5E601191D2B7F000001 /* close_code.h */,
+ 0C5AF5E701191D2B7F000001 /* SDL_active.h */,
+ 0C5AF5E801191D2B7F000001 /* SDL_audio.h */,
+ 0C5AF5E901191D2B7F000001 /* SDL_byteorder.h */,
+ 0C5AF5EA01191D2B7F000001 /* SDL_cdrom.h */,
+ 0C5AF5EB01191D2B7F000001 /* SDL_copying.h */,
+ B2CF8DC405C444E400E5DC7F /* SDL_cpuinfo.h */,
+ 0C5AF5EC01191D2B7F000001 /* SDL_endian.h */,
+ 0C5AF5ED01191D2B7F000001 /* SDL_error.h */,
+ 0C5AF5EE01191D2B7F000001 /* SDL_events.h */,
+ 0C5AF5EF01191D2B7F000001 /* SDL_getenv.h */,
+ 0C5AF5F001191D2B7F000001 /* SDL_joystick.h */,
+ 0C5AF5F101191D2B7F000001 /* SDL_keyboard.h */,
+ 0C5AF5F201191D2B7F000001 /* SDL_keysym.h */,
+ B29A290D04E5B28700A80002 /* SDL_loadso.h */,
+ 0C5AF5F301191D2B7F000001 /* SDL_main.h */,
+ 0C5AF5F401191D2B7F000001 /* SDL_mouse.h */,
+ 0C5AF5F501191D2B7F000001 /* SDL_mutex.h */,
+ B2CF8DC705C4450500E5DC7F /* SDL_name.h */,
+ 0C5AF5F601191D2B7F000001 /* SDL_opengl.h */,
+ 0C5AF5F701191D2B7F000001 /* SDL_quit.h */,
+ 0C5AF5F801191D2B7F000001 /* SDL_rwops.h */,
+ 0C5AF5F901191D2B7F000001 /* SDL_syswm.h */,
+ 0C5AF5FA01191D2B7F000001 /* SDL_thread.h */,
+ 0C5AF5FB01191D2B7F000001 /* SDL_timer.h */,
+ 0C5AF5FC01191D2B7F000001 /* SDL_types.h */,
+ 0C5AF5FD01191D2B7F000001 /* SDL_version.h */,
+ 0C5AF5FE01191D2B7F000001 /* SDL_video.h */,
+ 0C5AF5FF01191D2B7F000001 /* SDL.h */,
+ );
+ name = "Public Headers";
+ sourceTree = "<group>";
+ };
+ 034768DDFF38A45A11DB9C8B /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 089C1665FE841158C02AAC07 /* Resources */,
+ BECDF66C0761BA81005FE872 /* SDL.framework */,
+ BECDF6B30761BA81005FE872 /* libSDL.a */,
+ BECDF6BA0761BA81005FE872 /* libSDLmain.a */,
+ BECDF6BE0761BA81005FE872 /* Standard DMG */,
+ BECDF6C30761BA81005FE872 /* Developer Extras Package */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 046B91E80A11B53500FB151C /* dlopen */ = {
+ isa = PBXGroup;
+ children = (
+ 046B91E90A11B53500FB151C /* SDL_sysloadso.c */,
+ );
+ path = dlopen;
+ sourceTree = "<group>";
+ };
+ 083E4892006D86FF7F000001 /* cdrom */ = {
+ isa = PBXGroup;
+ children = (
+ B2A23A420415799100A80002 /* macosx */,
+ 083E4893006D86FF7F000001 /* dummy */,
+ 083E4895006D86FF7F000001 /* SDL_cdrom.c */,
+ );
+ name = cdrom;
+ path = ../../src/cdrom;
+ sourceTree = SOURCE_ROOT;
+ };
+ 083E4893006D86FF7F000001 /* dummy */ = {
+ isa = PBXGroup;
+ children = (
+ 083E4894006D86FF7F000001 /* SDL_syscdrom.c */,
+ );
+ path = dummy;
+ sourceTree = "<group>";
+ };
+ 083E489A006D88D97F000001 /* joystick */ = {
+ isa = PBXGroup;
+ children = (
+ F51789D001769A2401D3D55B /* darwin */,
+ 083E489D006D88D97F000001 /* SDL_joystick.c */,
+ );
+ name = joystick;
+ path = ../../src/joystick;
+ sourceTree = SOURCE_ROOT;
+ };
+ 0867D691FE84028FC02AAC07 /* SDLFramework */ = {
+ isa = PBXGroup;
+ children = (
+ F5A2EF3900C6A39A01000001 /* BUGS */,
+ F5A2EF3A00C6A3C201000001 /* README.MacOSX */,
+ F59C70FC00D5CB5801000001 /* pkg-support */,
+ F5B2A58400C5D39001000001 /* Main */,
+ 0153844A006D81B07F000001 /* Public Headers */,
+ 08FB77ACFE841707C02AAC07 /* Library Source */,
+ 034768DDFF38A45A11DB9C8B /* Products */,
+ BECDF66B0761BA81005FE872 /* Info-Framework.plist */,
+ BEC562FE0761C0E800A33029 /* Linked Frameworks */,
+ );
+ comments = "To build Universal Binaries, we have experimented with a variety of different options.\nThe complication is that we must retain compatibility with at least 10.2. \nThe Universal Binary defaults only work for > 10.3.9\n\nSo far, we have found:\ngcc 4.0.0 with Xcode 2.1 always links against libgcc_s. gcc 4.0.1 from Xcode 2.2 fixes this problem.\n\nBut gcc 4.0 will not work with < 10.3.9 because we continue to get an undefined symbol to _fprintf$LDBL128.\nSo we must use gcc 3.3 on PPC to accomplish 10.2 support. (But 4.0 is required for i386.)\n\nSetting the deployment target to 10.4 will disable prebinding, so for PPC, we set it less than 10.4 to preserve prebinding for legacy support.\n\nSetting the PPC SDKROOT to /Developers/SDKs/MacOSX10.2.8.sdk will link to 63.0.0 libSystem.B.dylib. Leaving it at current or 10.4u links to 88.1.2. However, as long as we are using gcc 3.3, it doesn't seem to matter as testing has demonstrated both will run. We have decided not to invoke the 10.2.8 SDK because it is not a default installed component with Xcode which will probably cause most people problems. However, rather than deleting the SDKROOT_ppc entry entirely, we have mapped it to 10.4u in case we decide we need to change this setting.\n\nTo use Altivec or SSE, we needed architecture specific flags:\nOTHER_CFLAGS_ppc\nOTHER_CFLAGS_i386\nOTHER_CFLAGS=$(OTHER_CFLAGS_($CURRENT_ARCH))\n\nThe general OTHER_CFLAGS needed to be manually mapped to architecture specific options because Xcode didn't do this automatically for us.\n\n\n";
+ name = SDLFramework;
+ sourceTree = "<group>";
+ };
+ 089C1665FE841158C02AAC07 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 08FB77ACFE841707C02AAC07 /* Library Source */ = {
+ isa = PBXGroup;
+ children = (
+ 0153832C006D78D67F000001 /* audio */,
+ 083E4892006D86FF7F000001 /* cdrom */,
+ B24DA50105A88D52006B9F1C /* cpuinfo */,
+ 01538367006D79147F000001 /* events */,
+ 01538376006D79307F000001 /* file */,
+ 083E489A006D88D97F000001 /* joystick */,
+ 00162D7509BD217B0037C8D0 /* loadso */,
+ 00162D6309BD214E0037C8D0 /* stdlib */,
+ 01538379006D79737F000001 /* thread */,
+ 01538391006D79BC7F000001 /* timer */,
+ 015383BE006D7A567F000001 /* video */,
+ 01538438006D7D947F000001 /* SDL_error.c */,
+ 01538439006D7D947F000001 /* SDL_fatal.c */,
+ 0153843C006D7D947F000001 /* SDL.c */,
+ );
+ name = "Library Source";
+ sourceTree = "<group>";
+ };
+ 0FCDF5B50083FCE77F000001 /* quartz */ = {
+ isa = PBXGroup;
+ children = (
+ 00D0D02210675823004B05EF /* SDL_QuartzWM.h */,
+ B24DA4D605A88AD0006B9F1C /* CGS.h */,
+ B24DA4D705A88AD0006B9F1C /* SDL_QuartzEvents.m */,
+ B24DA4D805A88AD0006B9F1C /* SDL_QuartzGL.m */,
+ B24DA4D905A88AD0006B9F1C /* SDL_QuartzKeys.h */,
+ B24DA4DA05A88AD0006B9F1C /* SDL_QuartzVideo.h */,
+ B24DA4DB05A88AD0006B9F1C /* SDL_QuartzVideo.m */,
+ B24DA4DC05A88AD0006B9F1C /* SDL_QuartzWindow.h */,
+ B24DA4DD05A88AD0006B9F1C /* SDL_QuartzWindow.m */,
+ B24DA4DE05A88AD0006B9F1C /* SDL_QuartzWM.m */,
+ );
+ name = quartz;
+ path = ../../src/video/quartz;
+ sourceTree = SOURCE_ROOT;
+ };
+ B24DA50105A88D52006B9F1C /* cpuinfo */ = {
+ isa = PBXGroup;
+ children = (
+ B24DA50405A88D52006B9F1C /* SDL_cpuinfo.c */,
+ );
+ name = cpuinfo;
+ path = ../../src/cpuinfo;
+ sourceTree = "<group>";
+ };
+ B2A23A420415799100A80002 /* macosx */ = {
+ isa = PBXGroup;
+ children = (
+ 004C2C860975E13300E9D430 /* AudioFilePlayer.c */,
+ B2A23A450415799100A80002 /* AudioFilePlayer.h */,
+ 004C2C870975E13300E9D430 /* AudioFileReaderThread.c */,
+ 004C2C880975E13300E9D430 /* CDPlayer.c */,
+ B2A23A8104157D5D00A80002 /* CDPlayer.h */,
+ 004C2C890975E13300E9D430 /* SDLOSXCAGuard.c */,
+ 004C2C8A0975E13300E9D430 /* SDLOSXCAGuard.h */,
+ B2A23A7B04157C5700A80002 /* SDL_syscdrom.c */,
+ B2A23A7A04157C5700A80002 /* SDL_syscdrom_c.h */,
+ );
+ path = macosx;
+ sourceTree = "<group>";
+ };
+ BEC562FE0761C0E800A33029 /* Linked Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 00D0D08310675DD9004B05EF /* CoreFoundation.framework */,
+ 007317C10858E15000B2BC32 /* Carbon.framework */,
+ 0073179B0858DECD00B2BC32 /* AudioToolbox.framework */,
+ 0073179C0858DECD00B2BC32 /* AudioUnit.framework */,
+ 0073179D0858DECD00B2BC32 /* Cocoa.framework */,
+ 0073179E0858DECD00B2BC32 /* CoreAudio.framework */,
+ 0073179F0858DECD00B2BC32 /* IOKit.framework */,
+ 007317A00858DECD00B2BC32 /* OpenGL.framework */,
+ 007317A10858DECD00B2BC32 /* QuickTime.framework */,
+ );
+ name = "Linked Frameworks";
+ sourceTree = "<group>";
+ };
+ BECDF5D20761B759005FE872 /* macosx */ = {
+ isa = PBXGroup;
+ children = (
+ BECDF5D50761B759005FE872 /* SDL_coreaudio.c */,
+ BECDF5D60761B759005FE872 /* SDL_coreaudio.h */,
+ );
+ name = macosx;
+ path = ../../src/audio/macosx;
+ sourceTree = SOURCE_ROOT;
+ };
+ F51789D001769A2401D3D55B /* darwin */ = {
+ isa = PBXGroup;
+ children = (
+ F51789D101769A2401D3D55B /* SDL_sysjoystick.c */,
+ );
+ name = darwin;
+ path = ../../src/joystick/darwin;
+ sourceTree = SOURCE_ROOT;
+ };
+ F59C70FC00D5CB5801000001 /* pkg-support */ = {
+ isa = PBXGroup;
+ children = (
+ F59C70FE00D5CB5801000001 /* devel-resources */,
+ F59C710100D5CB5801000001 /* resources */,
+ F5F81AD400D706B101000001 /* Readme SDL Developer.txt */,
+ F59C710500D5CB5801000001 /* SDL-devel.info */,
+ F59C710600D5CB5801000001 /* SDL.info */,
+ );
+ path = "pkg-support";
+ sourceTree = SOURCE_ROOT;
+ };
+ F59C70FE00D5CB5801000001 /* devel-resources */ = {
+ isa = PBXGroup;
+ children = (
+ F59C710C00D5D15801000001 /* install.sh */,
+ F59C70FF00D5CB5801000001 /* ReadMe.txt */,
+ F59C710000D5CB5801000001 /* Welcome.txt */,
+ );
+ path = "devel-resources";
+ sourceTree = "<group>";
+ };
+ F59C710100D5CB5801000001 /* resources */ = {
+ isa = PBXGroup;
+ children = (
+ 00794D3F09D0C461003FC8A1 /* License.rtf */,
+ 00F5D79E0990CA0D0051C449 /* UniversalBinaryNotes.rtf */,
+ 00AE6E1E08B958CC00255E2F /* ReadMeDevLite.txt */,
+ F59C710300D5CB5801000001 /* ReadMe.txt */,
+ );
+ path = resources;
+ sourceTree = "<group>";
+ };
+ F5B2A58400C5D39001000001 /* Main */ = {
+ isa = PBXGroup;
+ children = (
+ 2EECDF2D0086C3A07F000001 /* SDLMain.h */,
+ 2EECDF2E0086C3A07F000001 /* SDLMain.m */,
+ 2EECDF2F0086C3A07F000001 /* SDLMain.nib */,
+ );
+ name = Main;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ BECDF5FF0761BA81005FE872 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 00162DA409BD222F0037C8D0 /* SDL_config_dreamcast.h in Headers */,
+ 00162DA509BD222F0037C8D0 /* SDL_config_macos.h in Headers */,
+ 00162DA609BD222F0037C8D0 /* SDL_config_macosx.h in Headers */,
+ 00162DA709BD222F0037C8D0 /* SDL_config_os2.h in Headers */,
+ 00162DA809BD222F0037C8D0 /* SDL_config_win32.h in Headers */,
+ 00162DA909BD222F0037C8D0 /* SDL_config.h in Headers */,
+ 00162DAA09BD222F0037C8D0 /* SDL_platform.h in Headers */,
+ 00162DAB09BD222F0037C8D0 /* SDL_stdinc.h in Headers */,
+ 00162DAC09BD222F0037C8D0 /* begin_code.h in Headers */,
+ 00162DAD09BD222F0037C8D0 /* close_code.h in Headers */,
+ 00162DAE09BD222F0037C8D0 /* SDL_active.h in Headers */,
+ 00162DAF09BD222F0037C8D0 /* SDL_audio.h in Headers */,
+ 00162DB009BD222F0037C8D0 /* SDL_byteorder.h in Headers */,
+ 00162DB109BD222F0037C8D0 /* SDL_cdrom.h in Headers */,
+ 00162DB209BD222F0037C8D0 /* SDL_copying.h in Headers */,
+ 00162DB309BD222F0037C8D0 /* SDL_cpuinfo.h in Headers */,
+ 00162DB409BD222F0037C8D0 /* SDL_endian.h in Headers */,
+ 00162DB509BD222F0037C8D0 /* SDL_error.h in Headers */,
+ 00162DB609BD222F0037C8D0 /* SDL_events.h in Headers */,
+ 00162DB709BD222F0037C8D0 /* SDL_getenv.h in Headers */,
+ 00162DB809BD222F0037C8D0 /* SDL_joystick.h in Headers */,
+ 00162DB909BD222F0037C8D0 /* SDL_keyboard.h in Headers */,
+ 00162DBA09BD222F0037C8D0 /* SDL_keysym.h in Headers */,
+ 00162DBB09BD222F0037C8D0 /* SDL_loadso.h in Headers */,
+ 00162DBC09BD222F0037C8D0 /* SDL_main.h in Headers */,
+ 00162DBD09BD222F0037C8D0 /* SDL_mouse.h in Headers */,
+ 00162DBE09BD222F0037C8D0 /* SDL_mutex.h in Headers */,
+ 00162DBF09BD222F0037C8D0 /* SDL_name.h in Headers */,
+ 00162DC009BD222F0037C8D0 /* SDL_opengl.h in Headers */,
+ 00162DC109BD222F0037C8D0 /* SDL_quit.h in Headers */,
+ 00162DC209BD222F0037C8D0 /* SDL_rwops.h in Headers */,
+ 00162DC309BD222F0037C8D0 /* SDL_syswm.h in Headers */,
+ 00162DC409BD222F0037C8D0 /* SDL_thread.h in Headers */,
+ 00162DC509BD222F0037C8D0 /* SDL_timer.h in Headers */,
+ 00162DC609BD222F0037C8D0 /* SDL_types.h in Headers */,
+ 00162DC709BD222F0037C8D0 /* SDL_version.h in Headers */,
+ 00162DC809BD222F0037C8D0 /* SDL_video.h in Headers */,
+ 00162DC909BD222F0037C8D0 /* SDL.h in Headers */,
+ 00D0D02310675823004B05EF /* SDL_QuartzWM.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BECDF66E0761BA81005FE872 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BECDF6720761BA81005FE872 /* CGS.h in Headers */,
+ BECDF6730761BA81005FE872 /* SDL_QuartzKeys.h in Headers */,
+ BECDF6740761BA81005FE872 /* SDL_QuartzVideo.h in Headers */,
+ BECDF6750761BA81005FE872 /* SDL_QuartzWindow.h in Headers */,
+ BECDF6760761BA81005FE872 /* SDL_cpuinfo.h in Headers */,
+ BECDF6770761BA81005FE872 /* SDL_name.h in Headers */,
+ BECDF6780761BA81005FE872 /* SDL_coreaudio.h in Headers */,
+ 004C2C940975E13300E9D430 /* SDLOSXCAGuard.h in Headers */,
+ 00162D4409BD1FA90037C8D0 /* SDL_config_dreamcast.h in Headers */,
+ 00162D4509BD1FA90037C8D0 /* SDL_config_macos.h in Headers */,
+ 00162D4609BD1FA90037C8D0 /* SDL_config_macosx.h in Headers */,
+ 00162D4709BD1FA90037C8D0 /* SDL_config_os2.h in Headers */,
+ 00162D4809BD1FA90037C8D0 /* SDL_config_win32.h in Headers */,
+ 00162D4909BD1FA90037C8D0 /* SDL_config.h in Headers */,
+ 00162D4A09BD1FA90037C8D0 /* SDL_platform.h in Headers */,
+ 00162D4B09BD1FA90037C8D0 /* SDL_stdinc.h in Headers */,
+ 00162D5B09BD20DA0037C8D0 /* SDL_sysmutex_c.h in Headers */,
+ 00162D5E09BD20DA0037C8D0 /* SDL_systhread_c.h in Headers */,
+ 00162E6B09BD27370037C8D0 /* SDL_mixer_MMX.h in Headers */,
+ 00162F4209BE27FB0037C8D0 /* SDL_nullevents_c.h in Headers */,
+ 00162F4409BE27FB0037C8D0 /* SDL_nullmouse_c.h in Headers */,
+ 00162F4609BE27FB0037C8D0 /* SDL_nullvideo.h in Headers */,
+ 0014B7F409C0D8D2003A99D5 /* SDL_dgaevents_c.h in Headers */,
+ 0014B7F609C0D8D2003A99D5 /* SDL_dgamouse_c.h in Headers */,
+ 0014B7F909C0D8D2003A99D5 /* SDL_dgavideo.h in Headers */,
+ 0014B86509C0D977003A99D5 /* SDL_x11dga_c.h in Headers */,
+ 0014B86809C0D977003A99D5 /* SDL_x11dyn.h in Headers */,
+ 0014B86909C0D977003A99D5 /* SDL_x11events_c.h in Headers */,
+ 0014B86B09C0D977003A99D5 /* SDL_x11gamma_c.h in Headers */,
+ 0014B86D09C0D977003A99D5 /* SDL_x11gl_c.h in Headers */,
+ 0014B86F09C0D977003A99D5 /* SDL_x11image_c.h in Headers */,
+ 0014B87109C0D977003A99D5 /* SDL_x11modes_c.h in Headers */,
+ 0014B87309C0D977003A99D5 /* SDL_x11mouse_c.h in Headers */,
+ 0014B87509C0D977003A99D5 /* SDL_x11sym.h in Headers */,
+ 0014B87709C0D977003A99D5 /* SDL_x11video.h in Headers */,
+ 0014B87809C0D977003A99D5 /* SDL_x11wm_c.h in Headers */,
+ 0014B87A09C0D977003A99D5 /* SDL_x11yuv_c.h in Headers */,
+ 0014B89E09C0DAAE003A99D5 /* Xvlibint.h in Headers */,
+ 002F32DA09CA0BE700EBEB88 /* SDL_diskaudio.h in Headers */,
+ 002F32E809CA0BF600EBEB88 /* SDL_dummyaudio.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BECDF6B50761BA81005FE872 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ BECDF5FE0761BA81005FE872 /* Framework */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 0073177A0858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Framework" */;
+ buildPhases = (
+ 00D55F050A11143E0030ED2A /* Run Script to Create SDL_config.h */,
+ BECDF5FF0761BA81005FE872 /* Headers */,
+ BECDF62A0761BA81005FE872 /* Resources */,
+ BECDF62C0761BA81005FE872 /* Sources */,
+ BECDF6680761BA81005FE872 /* Frameworks */,
+ BECDF6690761BA81005FE872 /* Rez */,
+ );
+ buildRules = (
+ );
+ comments = "We recommend installing to /Library/Frameworks\nAn alternative is $(HOME)/Library/Frameworks for per-user if permissions are an issue.\n\nAdd the framework to the Groups & Files panel (under Linked Frameworks is a good place) and enable the check box for the targets that need to link to it. You can also manually add \"-framework SDL\" to your linker flags if you don't like the check box system.\n\nAdd /Library/Frameworks/SDL.framework/Headers to your header search path\nAdd /Library/Frameworks to your library search path\n(Adjust the two above if installed in $(HOME)/Library/Frameworks. You can also list both paths if you want robustness.)\n\nWe used to use an exports file. It was becoming a maintenance issue we kept neglecting, so we have removed it. If you need it back, set the \"Exported Symbols File\" option to:\n../../src/main/macosx/exports/SDL.x\n(You may need to regenerate the exports list. There is a Makefile in that directory that you can run from the command line to rebuild it.)\nLong term, we want to utilize gcc 4.0's new visibility feature (analogous to declspec on Windows). Other platforms would benefit from this change too. The downside is that we still use gcc 3.3 for the PowerPC build here so only our x86 builds will cull the symbols if we go down this route (and don't use the exports file).\n\n";
+ dependencies = (
+ );
+ name = Framework;
+ productInstallPath = "@executable_path/../Frameworks";
+ productName = SDL;
+ productReference = BECDF66C0761BA81005FE872 /* SDL.framework */;
+ productType = "com.apple.product-type.framework";
+ };
+ BECDF66D0761BA81005FE872 /* Static Library */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 0073177E0858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Static Library" */;
+ buildPhases = (
+ 00D55F080A11147F0030ED2A /* Run Script to Create SDL_config.h */,
+ BECDF66E0761BA81005FE872 /* Headers */,
+ BECDF6790761BA81005FE872 /* Sources */,
+ BECDF6B10761BA81005FE872 /* Frameworks */,
+ BECDF6B20761BA81005FE872 /* Rez */,
+ );
+ buildRules = (
+ );
+ comments = "This produces libsdl.a, which is the static build of SDL. You will have to link to the Cocoa and OpenGL frameworks in your application.";
+ dependencies = (
+ );
+ name = "Static Library";
+ productInstallPath = /usr/local/lib;
+ productName = "Static Library";
+ productReference = BECDF6B30761BA81005FE872 /* libSDL.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ BECDF6B40761BA81005FE872 /* Main Library */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 007317820858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Main Library" */;
+ buildPhases = (
+ BECDF6B50761BA81005FE872 /* Headers */,
+ BECDF6B60761BA81005FE872 /* Sources */,
+ BECDF6B80761BA81005FE872 /* Frameworks */,
+ BECDF6B90761BA81005FE872 /* Rez */,
+ );
+ buildRules = (
+ );
+ comments = "This produces libSDLmain.a, which contains only SDL_main.m, the hook to get the app running correctly before your SDL code executes.";
+ dependencies = (
+ );
+ name = "Main Library";
+ productInstallPath = /usr/local/lib;
+ productName = libSDLmain.a;
+ productReference = BECDF6BA0761BA81005FE872 /* libSDLmain.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ BECDF6BB0761BA81005FE872 /* Standard DMG */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 007317860858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Standard DMG" */;
+ buildPhases = (
+ BECDF6BD0761BA81005FE872 /* ShellScript */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BECDF6C60761BA81005FE872 /* PBXTargetDependency */,
+ );
+ name = "Standard DMG";
+ productInstallPath = /usr/local/bin;
+ productName = "Standard Package";
+ productReference = BECDF6BE0761BA81005FE872 /* Standard DMG */;
+ productType = "com.apple.product-type.tool";
+ };
+ BECDF6C00761BA81005FE872 /* Developer Extras Package */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 0073178A0858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Developer Extras Package" */;
+ buildPhases = (
+ BECDF6C20761BA81005FE872 /* ShellScript */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 008310001072D94A00A531F1 /* PBXTargetDependency */,
+ );
+ name = "Developer Extras Package";
+ productInstallPath = /usr/local/bin;
+ productName = "Devel Package";
+ productReference = BECDF6C30761BA81005FE872 /* Developer Extras Package */;
+ productType = "com.apple.product-type.tool";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 0867D690FE84028FC02AAC07 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0420;
+ };
+ buildConfigurationList = 0073178E0858DB0500B2BC32 /* Build configuration list for PBXProject "SDL" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
+ mainGroup = 0867D691FE84028FC02AAC07 /* SDLFramework */;
+ productRefGroup = 034768DDFF38A45A11DB9C8B /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ BECDF5FE0761BA81005FE872 /* Framework */,
+ BECDF66D0761BA81005FE872 /* Static Library */,
+ BECDF6B40761BA81005FE872 /* Main Library */,
+ BECDF6BB0761BA81005FE872 /* Standard DMG */,
+ BECDF6C00761BA81005FE872 /* Developer Extras Package */,
+ 0032354F1070931700C76517 /* Generate Doxygen DocSet */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ BECDF62A0761BA81005FE872 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BECDF62B0761BA81005FE872 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXRezBuildPhase section */
+ BECDF6690761BA81005FE872 /* Rez */ = {
+ isa = PBXRezBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BECDF6B20761BA81005FE872 /* Rez */ = {
+ isa = PBXRezBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BECDF6B90761BA81005FE872 /* Rez */ = {
+ isa = PBXRezBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXRezBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ 0032354E1070931700C76517 /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 12;
+ files = (
+ );
+ inputPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "# DOXYGEN_EXE is defined in the Enclosing Target's Build Tab\n# DOXYGEN_EXE=/Applications/Doxygen.app/Contents/Resources/doxygen\n#echo DOXYGEN_EXE dir is $DOXYGEN_EXE\n\nDOC_DIR=$SRCROOT/../XcodeDocSet\n#echo Doc dir is $DOC_DIR\ncd $DOC_DIR\n$DOXYGEN_EXE $DOC_DIR/Doxyfile\ncd html\nmake\nif [ -d $SRCROOT/../XcodeDocSet/org.libsdl.sdl.docset ] ; then\n\t# remove previous docset\n\trm -rf $SRCROOT/../XcodeDocSet/org.libsdl.sdl.docset\nfi\nmv org.libsdl.sdl.docset ..\ncd ..\nrm -rf html\nexit 0";
+ };
+ 00D55F050A11143E0030ED2A /* Run Script to Create SDL_config.h */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Run Script to Create SDL_config.h";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "# Make sure that include/SDL_config.h is a symlink to SDL_config.h.default.\n# If it exists and is not a symlink, it was probably generated by configure and\n# we move it aside.\nif [ ! -L ../../include/SDL_config.h ]; then\n if [ -e ../../include/SDL_config.h ]; then\n mv ../../include/SDL_config.h ../../include/SDL_config.h.generated\n fi\n ln -s SDL_config.h.default ../../include/SDL_config.h\nfi\n";
+ };
+ 00D55F080A11147F0030ED2A /* Run Script to Create SDL_config.h */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Run Script to Create SDL_config.h";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "# Make sure that include/SDL_config.h is a symlink to SDL_config.h.default.\n# If it exists and is not a symlink, it was probably generated by configure and\n# we move it aside.\nif [ ! -L ../../include/SDL_config.h ]; then\n if [ -e ../../include/SDL_config.h ]; then\n mv ../../include/SDL_config.h ../../include/SDL_config.h.generated\n fi\n ln -s SDL_config.h.default ../../include/SDL_config.h\nfi\n";
+ };
+ BECDF6BD0761BA81005FE872 /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 12;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "# clean up the framework, remove headers, extra files\nmkdir -p build/dmg-tmp\nmkdir -p build/dmg-tmp/devel-lite\n/Developer/Tools/CpMac -r $TARGET_BUILD_DIR/SDL.framework build/dmg-tmp/\n\n# strip moved to Xcode native mechanism\n# strip -x build/dmg-tmp/SDL.framework/SDL\n\ncp pkg-support/resources/License.rtf build/dmg-tmp\ncp pkg-support/resources/ReadMe.txt build/dmg-tmp\ncp pkg-support/resources/ReadMeDevLite.txt build/dmg-tmp/devel-lite\ncp pkg-support/resources/UniversalBinaryNotes.rtf build/dmg-tmp\n\ncp ../../src/main/macosx/SDLMain.h build/dmg-tmp/devel-lite\ncp ../../src/main/macosx/SDLMain.m build/dmg-tmp/devel-lite\n\n# remove the .DS_Store files if any (we may want to provide one in the future for fancy .dmgs)\nfind build/dmg-tmp -name .DS_Store -exec rm -f \"{}\" \\;\nfind -d build/dmg-tmp -type d -name .svn -exec rm -rf \"{}\" \\;\n\n# for fancy .dmg\nmkdir -p build/dmg-tmp/.logo\ncp pkg-support/resources/SDL_DS_Store build/dmg-tmp/.DS_Store\ncp pkg-support/sdl_logo.pdf build/dmg-tmp/.logo\n\n# create the dmg\nhdiutil create -ov -fs HFS+ -volname SDL -srcfolder build/dmg-tmp build/SDL.dmg\n\n# clean up\nrm -rf build/dmg-tmp\n\n# compress it???\n#(cd build; gnutar -zcvf SDL.dmg.tar.gz SDL.dmg)";
+ };
+ BECDF6C20761BA81005FE872 /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ comments = "The old .pkg generator script:\n\n# make a copy of the framework to work with\nmkdir -p build/pkg-tmp\n\n## We're changing this to follow OS X conventions, where the headers and\n## framework are bundled together. Thus this development package won't \n## actually contain any direct framework elements.\n#/Developer/Tools/CpMac -r build/SDL.framework build/pkg-tmp/\n\n# copy in some files they might want around...\ncp ../../docs.html build/pkg-tmp\ncp -r ../../docs build/pkg-tmp\n#cp -r ../../src/main/macosx build/pkg-tmp/\n#rm -rf build/pkg-tmp/main/exports\ncp -r \"../Project Stationary\" build/pkg-tmp/\ncp \"pkg-support/Readme SDL Developer.txt\" build/pkg-tmp/\n#cp \"../uninstall.csh\" build/pkg-tmp/\n\n## We shouldn't have any framework stuff to deal with now\n# clean up the framework, remove extra files\n# rm -rf build/pkg-tmp/SDL.framework/Resources/pbdevelopment.plist\n\n# remove the .DS_Store file to keep tool from crapping out\nfind pkg-support -name \".DS_Store\" -exec rm -rf \"{}\" \";\" \n\n# create the .pkg\n../package build/pkg-tmp pkg-support/SDL-devel.info -d build -r pkg-support/devel-resources \n#\"/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker\" -build -p build/ -f build/pkg-tmp -r pkg-support/devel-resources -i Info.plist -d Description.plist\n\n# create install scripts\nDIR=build/SDL-devel.pkg/\ncp $DIR/install.sh $DIR/SDL-devel.post_install\nmv $DIR/install.sh $DIR/SDL-devel.post_upgrade\n\n# add execute flag to scripts\nchmod 755 $DIR/SDL-devel.post_install $DIR/SDL-devel.post_upgrade\n\n# remove temporary files\n#rm -rf build/pkg-tmp\n\n# compress\n(cd build; gnutar -zcvf SDL-devel.pkg.tar.gz SDL-devel.pkg)";
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "# make a directory to hold the stuff we're going to package up\nmkdir -p build/devel-extras-tmp\nmkdir -p build/devel-extras-tmp/Documentation\nmkdir -p build/devel-extras-tmp/Documentation/docs/XcodeDocSet\nmkdir -p build/devel-extras-tmp/XcodeTemplates\nmkdir -p build/devel-extras-tmp/SDLMain\nmkdir -p build/devel-extras-tmp/SDLMain/NIBless\nmkdir -p build/devel-extras-tmp/SDLMain/CocoaMenus\n\n# copy the docs\ncp ../../docs.html build/devel-extras-tmp/Documentation\ncp -r ../../docs build/devel-extras-tmp/Documentation\n\n# Copy Doxyfile for DocSet\ncp $SRCROOT/../XcodeDocSet/Doxyfile build/devel-extras-tmp/Documentation/docs/XcodeDocSet\n\n# Copy DocSet (if it exists)\nif [ -d $SRCROOT/../XcodeDocSet/org.libsdl.sdl.docset ] ; then\n#\techo Found docset directory\n\tmv $SRCROOT/../XcodeDocSet/org.libsdl.sdl.docset build/devel-extras-tmp/Documentation/docs/XcodeDocSet/\nelse\n\techo Warning: Could not find DocSet and will be omitted from package\nfi\n\n# copy the Xcode Project user templates\ncp -r \"../TemplatesForXcodeTiger\" build/devel-extras-tmp/XcodeTemplates\ncp -r \"../TemplatesForXcodeLeopard\" build/devel-extras-tmp/XcodeTemplates\ncp -r \"../TemplatesForXcodeSnowLeopard\" build/devel-extras-tmp/XcodeTemplates\n\ncp \"pkg-support/Readme SDL Developer.txt\" build/devel-extras-tmp\n\n# readme file\n#cp pkg-support/resources/ReadMe.txt build/devel-extras-tmp\n\n#cp pkg-support/resources/UniversalBinaryNotes.rtf build/devel-extras-tmp\n\n# Copy the devel-lite stuff just in case the user didn't notice it in the main package\n# I should copy all the different SDLMain versions (and nibs) instead.\n# I'm assuming the default is the same as the SDL App and SDL/OpenGL templates\n\ncp pkg-support/resources/ReadMeDevLite.txt build/devel-extras-tmp/SDLMain/NIBless\ncp ../../src/main/macosx/SDLMain.h build/devel-extras-tmp/SDLMain/NIBless\ncp ../../src/main/macosx/SDLMain.m build/devel-extras-tmp/SDLMain/NIBless\n\n# Nib stuff from SDL-Cocoa App\n/Developer/Tools/CpMac -r \"../TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLMain.h\" build/devel-extras-tmp/SDLMain/CocoaMenus\n/Developer/Tools/CpMac -r \"../TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLMain.m\" build/devel-extras-tmp/SDLMain/CocoaMenus\n/Developer/Tools/CpMac -r \"../TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib\" build/devel-extras-tmp/SDLMain/CocoaMenus\n\n# Copy precompiled libSDLmain.a's here??? We have potentially 3 different ones?\n# /Developer/Tools/CpMac -r $TARGET_BUILD_DIR/libSDLmain.a build/devel-extras-tmp/SDLMain/NIBless\n#\n#\n\n# Copy sdl-config's for those who've been wanting one? Will need to document that it may\n# require manual changes if you don't install the framework to /Library/Frameworks\n# <<sdl-config here>>\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";
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ BECDF62C0761BA81005FE872 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BECDF62E0761BA81005FE872 /* SDL_audio.c in Sources */,
+ BECDF62F0761BA81005FE872 /* SDL_audiocvt.c in Sources */,
+ BECDF6300761BA81005FE872 /* SDL_audiodev.c in Sources */,
+ BECDF6320761BA81005FE872 /* SDL_mixer.c in Sources */,
+ BECDF6330761BA81005FE872 /* SDL_wave.c in Sources */,
+ BECDF6350761BA81005FE872 /* SDL_active.c in Sources */,
+ BECDF6360761BA81005FE872 /* SDL_events.c in Sources */,
+ BECDF6370761BA81005FE872 /* SDL_expose.c in Sources */,
+ BECDF6380761BA81005FE872 /* SDL_keyboard.c in Sources */,
+ BECDF6390761BA81005FE872 /* SDL_mouse.c in Sources */,
+ BECDF63A0761BA81005FE872 /* SDL_quit.c in Sources */,
+ BECDF63B0761BA81005FE872 /* SDL_resize.c in Sources */,
+ BECDF63C0761BA81005FE872 /* SDL_rwops.c in Sources */,
+ BECDF63E0761BA81005FE872 /* SDL_timer.c in Sources */,
+ BECDF63F0761BA81005FE872 /* SDL_blit.c in Sources */,
+ BECDF6400761BA81005FE872 /* SDL_blit_0.c in Sources */,
+ BECDF6410761BA81005FE872 /* SDL_blit_1.c in Sources */,
+ BECDF6420761BA81005FE872 /* SDL_blit_A.c in Sources */,
+ BECDF6430761BA81005FE872 /* SDL_blit_N.c in Sources */,
+ BECDF6440761BA81005FE872 /* SDL_bmp.c in Sources */,
+ BECDF6450761BA81005FE872 /* SDL_cursor.c in Sources */,
+ BECDF6460761BA81005FE872 /* SDL_gamma.c in Sources */,
+ BECDF6470761BA81005FE872 /* SDL_pixels.c in Sources */,
+ BECDF6480761BA81005FE872 /* SDL_RLEaccel.c in Sources */,
+ BECDF6490761BA81005FE872 /* SDL_surface.c in Sources */,
+ BECDF64A0761BA81005FE872 /* SDL_video.c in Sources */,
+ BECDF64B0761BA81005FE872 /* SDL_yuv.c in Sources */,
+ BECDF64C0761BA81005FE872 /* SDL_yuv_sw.c in Sources */,
+ BECDF64D0761BA81005FE872 /* SDL_error.c in Sources */,
+ BECDF64E0761BA81005FE872 /* SDL_fatal.c in Sources */,
+ BECDF6500761BA81005FE872 /* SDL.c in Sources */,
+ BECDF6510761BA81005FE872 /* SDL_thread.c in Sources */,
+ BECDF6520761BA81005FE872 /* SDL_cdrom.c in Sources */,
+ BECDF6530761BA81005FE872 /* SDL_joystick.c in Sources */,
+ BECDF6580761BA81005FE872 /* SDL_stretch.c in Sources */,
+ BECDF6590761BA81005FE872 /* SDL_sysjoystick.c in Sources */,
+ BECDF65B0761BA81005FE872 /* SDL_QuartzEvents.m in Sources */,
+ BECDF65C0761BA81005FE872 /* SDL_QuartzGL.m in Sources */,
+ BECDF65D0761BA81005FE872 /* SDL_QuartzVideo.m in Sources */,
+ BECDF65E0761BA81005FE872 /* SDL_QuartzWindow.m in Sources */,
+ BECDF65F0761BA81005FE872 /* SDL_QuartzWM.m in Sources */,
+ BECDF6610761BA81005FE872 /* SDL_cpuinfo.c in Sources */,
+ BECDF6620761BA81005FE872 /* SDL_syscdrom.c in Sources */,
+ BECDF6670761BA81005FE872 /* SDL_coreaudio.c in Sources */,
+ 004C2C8B0975E13300E9D430 /* AudioFilePlayer.c in Sources */,
+ 004C2C8C0975E13300E9D430 /* AudioFileReaderThread.c in Sources */,
+ 004C2C8D0975E13300E9D430 /* CDPlayer.c in Sources */,
+ 004C2C8E0975E13300E9D430 /* SDLOSXCAGuard.c in Sources */,
+ 00162D5309BD20DA0037C8D0 /* SDL_syscond.c in Sources */,
+ 00162D5409BD20DA0037C8D0 /* SDL_sysmutex.c in Sources */,
+ 00162D5609BD20DA0037C8D0 /* SDL_syssem.c in Sources */,
+ 00162D5709BD20DA0037C8D0 /* SDL_systhread.c in Sources */,
+ 00162D6109BD21010037C8D0 /* SDL_systimer.c in Sources */,
+ 00162D6B09BD214F0037C8D0 /* SDL_getenv.c in Sources */,
+ 00162D6C09BD214F0037C8D0 /* SDL_malloc.c in Sources */,
+ 00162D6D09BD214F0037C8D0 /* SDL_qsort.c in Sources */,
+ 00162D6E09BD214F0037C8D0 /* SDL_stdlib.c in Sources */,
+ 00162D6F09BD214F0037C8D0 /* SDL_string.c in Sources */,
+ 00162E6809BD27300037C8D0 /* SDL_mixer_MMX.c in Sources */,
+ 00162F3B09BE27FB0037C8D0 /* SDL_nullevents.c in Sources */,
+ 00162F3D09BE27FB0037C8D0 /* SDL_nullmouse.c in Sources */,
+ 00162F3F09BE27FB0037C8D0 /* SDL_nullvideo.c in Sources */,
+ 0014B7EF09C0D8D2003A99D5 /* SDL_dgaevents.c in Sources */,
+ 0014B7F109C0D8D2003A99D5 /* SDL_dgamouse.c in Sources */,
+ 0014B7F209C0D8D2003A99D5 /* SDL_dgavideo.c in Sources */,
+ 0014B84F09C0D977003A99D5 /* SDL_x11dga.c in Sources */,
+ 0014B85009C0D977003A99D5 /* SDL_x11dyn.c in Sources */,
+ 0014B85309C0D977003A99D5 /* SDL_x11events.c in Sources */,
+ 0014B85509C0D977003A99D5 /* SDL_x11gamma.c in Sources */,
+ 0014B85709C0D977003A99D5 /* SDL_x11gl.c in Sources */,
+ 0014B85909C0D977003A99D5 /* SDL_x11image.c in Sources */,
+ 0014B85B09C0D977003A99D5 /* SDL_x11modes.c in Sources */,
+ 0014B85D09C0D977003A99D5 /* SDL_x11mouse.c in Sources */,
+ 0014B85F09C0D977003A99D5 /* SDL_x11video.c in Sources */,
+ 0014B86209C0D977003A99D5 /* SDL_x11wm.c in Sources */,
+ 0014B86409C0D977003A99D5 /* SDL_x11yuv.c in Sources */,
+ 0014B89209C0DA94003A99D5 /* XF86DGA.c in Sources */,
+ 0014B89309C0DA94003A99D5 /* XF86DGA2.c in Sources */,
+ 0014B89709C0DAA1003A99D5 /* XF86VMode.c in Sources */,
+ 0014B89B09C0DAAE003A99D5 /* Xv.c in Sources */,
+ 0014B8A009C0DAB9003A99D5 /* Xinerama.c in Sources */,
+ 0014B8A309C0DAC4003A99D5 /* xme.c in Sources */,
+ 002F328609CA049100EBEB88 /* SDL_iconv.c in Sources */,
+ 002F32D709CA0BE700EBEB88 /* SDL_diskaudio.c in Sources */,
+ 002F32E509CA0BF600EBEB88 /* SDL_dummyaudio.c in Sources */,
+ 046B91EC0A11B53500FB151C /* SDL_sysloadso.c in Sources */,
+ 046B92130A11B8AD00FB151C /* SDL_dlcompat.c in Sources */,
+ 00EAE6FC0C4D3F84009A420A /* SDL_yuv_mmx.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BECDF6790761BA81005FE872 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BECDF67A0761BA81005FE872 /* SDL_audio.c in Sources */,
+ BECDF67B0761BA81005FE872 /* SDL_audiocvt.c in Sources */,
+ BECDF67D0761BA81005FE872 /* SDL_audiodev.c in Sources */,
+ BECDF67E0761BA81005FE872 /* SDL_mixer.c in Sources */,
+ BECDF67F0761BA81005FE872 /* SDL_wave.c in Sources */,
+ BECDF6810761BA81005FE872 /* SDL_cdrom.c in Sources */,
+ BECDF6830761BA81005FE872 /* SDL_active.c in Sources */,
+ BECDF6840761BA81005FE872 /* SDL_events.c in Sources */,
+ BECDF6850761BA81005FE872 /* SDL_expose.c in Sources */,
+ BECDF6860761BA81005FE872 /* SDL_keyboard.c in Sources */,
+ BECDF6870761BA81005FE872 /* SDL_mouse.c in Sources */,
+ BECDF6880761BA81005FE872 /* SDL_quit.c in Sources */,
+ BECDF6890761BA81005FE872 /* SDL_resize.c in Sources */,
+ BECDF68A0761BA81005FE872 /* SDL_rwops.c in Sources */,
+ BECDF68B0761BA81005FE872 /* SDL_joystick.c in Sources */,
+ BECDF68C0761BA81005FE872 /* SDL_thread.c in Sources */,
+ BECDF6920761BA81005FE872 /* SDL_timer.c in Sources */,
+ BECDF6930761BA81005FE872 /* SDL_blit.c in Sources */,
+ BECDF6940761BA81005FE872 /* SDL_blit_0.c in Sources */,
+ BECDF6950761BA81005FE872 /* SDL_blit_1.c in Sources */,
+ BECDF6960761BA81005FE872 /* SDL_blit_A.c in Sources */,
+ BECDF6970761BA81005FE872 /* SDL_blit_N.c in Sources */,
+ BECDF6980761BA81005FE872 /* SDL_bmp.c in Sources */,
+ BECDF6990761BA81005FE872 /* SDL_cursor.c in Sources */,
+ BECDF69A0761BA81005FE872 /* SDL_gamma.c in Sources */,
+ BECDF69B0761BA81005FE872 /* SDL_pixels.c in Sources */,
+ BECDF69C0761BA81005FE872 /* SDL_RLEaccel.c in Sources */,
+ BECDF69D0761BA81005FE872 /* SDL_stretch.c in Sources */,
+ BECDF69E0761BA81005FE872 /* SDL_surface.c in Sources */,
+ BECDF69F0761BA81005FE872 /* SDL_video.c in Sources */,
+ BECDF6A00761BA81005FE872 /* SDL_yuv.c in Sources */,
+ BECDF6A10761BA81005FE872 /* SDL_yuv_sw.c in Sources */,
+ BECDF6A20761BA81005FE872 /* SDL_error.c in Sources */,
+ BECDF6A30761BA81005FE872 /* SDL_fatal.c in Sources */,
+ BECDF6A50761BA81005FE872 /* SDL.c in Sources */,
+ BECDF6A60761BA81005FE872 /* SDL_sysjoystick.c in Sources */,
+ BECDF6A80761BA81005FE872 /* SDL_syscdrom.c in Sources */,
+ BECDF6A90761BA81005FE872 /* SDL_QuartzEvents.m in Sources */,
+ BECDF6AA0761BA81005FE872 /* SDL_QuartzGL.m in Sources */,
+ BECDF6AB0761BA81005FE872 /* SDL_QuartzVideo.m in Sources */,
+ BECDF6AC0761BA81005FE872 /* SDL_QuartzWindow.m in Sources */,
+ BECDF6AD0761BA81005FE872 /* SDL_QuartzWM.m in Sources */,
+ BECDF6AF0761BA81005FE872 /* SDL_cpuinfo.c in Sources */,
+ BECDF6B00761BA81005FE872 /* SDL_coreaudio.c in Sources */,
+ 004C2C900975E13300E9D430 /* AudioFilePlayer.c in Sources */,
+ 004C2C910975E13300E9D430 /* AudioFileReaderThread.c in Sources */,
+ 004C2C920975E13300E9D430 /* CDPlayer.c in Sources */,
+ 004C2C930975E13300E9D430 /* SDLOSXCAGuard.c in Sources */,
+ 00162D5909BD20DA0037C8D0 /* SDL_syscond.c in Sources */,
+ 00162D5A09BD20DA0037C8D0 /* SDL_sysmutex.c in Sources */,
+ 00162D5C09BD20DA0037C8D0 /* SDL_syssem.c in Sources */,
+ 00162D5D09BD20DA0037C8D0 /* SDL_systhread.c in Sources */,
+ 00162D6209BD21010037C8D0 /* SDL_systimer.c in Sources */,
+ 00162D7009BD214F0037C8D0 /* SDL_getenv.c in Sources */,
+ 00162D7109BD214F0037C8D0 /* SDL_malloc.c in Sources */,
+ 00162D7209BD214F0037C8D0 /* SDL_qsort.c in Sources */,
+ 00162D7309BD214F0037C8D0 /* SDL_stdlib.c in Sources */,
+ 00162D7409BD214F0037C8D0 /* SDL_string.c in Sources */,
+ 00162E6A09BD27360037C8D0 /* SDL_mixer_MMX.c in Sources */,
+ 00162F4109BE27FB0037C8D0 /* SDL_nullevents.c in Sources */,
+ 00162F4309BE27FB0037C8D0 /* SDL_nullmouse.c in Sources */,
+ 00162F4509BE27FB0037C8D0 /* SDL_nullvideo.c in Sources */,
+ 0014B7F509C0D8D2003A99D5 /* SDL_dgaevents.c in Sources */,
+ 0014B7F709C0D8D2003A99D5 /* SDL_dgamouse.c in Sources */,
+ 0014B7F809C0D8D2003A99D5 /* SDL_dgavideo.c in Sources */,
+ 0014B86609C0D977003A99D5 /* SDL_x11dga.c in Sources */,
+ 0014B86709C0D977003A99D5 /* SDL_x11dyn.c in Sources */,
+ 0014B86A09C0D977003A99D5 /* SDL_x11events.c in Sources */,
+ 0014B86C09C0D977003A99D5 /* SDL_x11gamma.c in Sources */,
+ 0014B86E09C0D977003A99D5 /* SDL_x11gl.c in Sources */,
+ 0014B87009C0D977003A99D5 /* SDL_x11image.c in Sources */,
+ 0014B87209C0D977003A99D5 /* SDL_x11modes.c in Sources */,
+ 0014B87409C0D977003A99D5 /* SDL_x11mouse.c in Sources */,
+ 0014B87609C0D977003A99D5 /* SDL_x11video.c in Sources */,
+ 0014B87909C0D977003A99D5 /* SDL_x11wm.c in Sources */,
+ 0014B87B09C0D977003A99D5 /* SDL_x11yuv.c in Sources */,
+ 0014B89409C0DA94003A99D5 /* XF86DGA.c in Sources */,
+ 0014B89509C0DA94003A99D5 /* XF86DGA2.c in Sources */,
+ 0014B89809C0DAA1003A99D5 /* XF86VMode.c in Sources */,
+ 0014B89D09C0DAAE003A99D5 /* Xv.c in Sources */,
+ 0014B8A109C0DAB9003A99D5 /* Xinerama.c in Sources */,
+ 0014B8A409C0DAC4003A99D5 /* xme.c in Sources */,
+ 002F328709CA049100EBEB88 /* SDL_iconv.c in Sources */,
+ 002F32D909CA0BE700EBEB88 /* SDL_diskaudio.c in Sources */,
+ 002F32E709CA0BF600EBEB88 /* SDL_dummyaudio.c in Sources */,
+ 046B91ED0A11B53500FB151C /* SDL_sysloadso.c in Sources */,
+ 046B92140A11B8AD00FB151C /* SDL_dlcompat.c in Sources */,
+ 00EAE6FD0C4D3F88009A420A /* SDL_yuv_mmx.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BECDF6B60761BA81005FE872 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BECDF6B70761BA81005FE872 /* SDLMain.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 008310001072D94A00A531F1 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 0032354F1070931700C76517 /* Generate Doxygen DocSet */;
+ targetProxy = 00830FFF1072D94A00A531F1 /* PBXContainerItemProxy */;
+ };
+ BECDF6C60761BA81005FE872 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BECDF5FE0761BA81005FE872 /* Framework */;
+ targetProxy = BECDF6C50761BA81005FE872 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin XCBuildConfiguration section */
+ 003235521070931700C76517 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ DOXYGEN_EXE = /Applications/Doxygen.app/Contents/Resources/doxygen;
+ PRODUCT_NAME = "Generate Doxygen DocSet";
+ };
+ name = Debug;
+ };
+ 003235531070931700C76517 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ DOXYGEN_EXE = /Applications/Doxygen.app/Contents/Resources/doxygen;
+ PRODUCT_NAME = "Generate Doxygen DocSet";
+ };
+ name = Release;
+ };
+ 00CFA621106A567900758660 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ DEPLOYMENT_POSTPROCESSING = YES;
+ GCC_ALTIVEC_EXTENSIONS = YES;
+ GCC_AUTO_VECTORIZATION = YES;
+ GCC_ENABLE_CPP_EXCEPTIONS = NO;
+ GCC_ENABLE_CPP_RTTI = NO;
+ GCC_ENABLE_SSE3_EXTENSIONS = YES;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+ GCC_OPTIMIZATION_LEVEL = s;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ SDKROOT = macosx;
+ SEPARATE_STRIP = YES;
+ STRIP_STYLE = "non-global";
+ WARNING_CFLAGS = "";
+ };
+ name = Release;
+ };
+ 00CFA622106A567900758660 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 12.4;
+ FRAMEWORK_VERSION = A;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_1)",
+ "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_2)",
+ "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_3)",
+ "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_4)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = YES;
+ HEADER_SEARCH_PATHS = /usr/X11R6/include;
+ INFOPLIST_FILE = "Info-Framework.plist";
+ INSTALL_PATH = "@rpath";
+ OTHER_CFLAGS = "$(OTHER_CFLAGS_$(CURRENT_ARCH))";
+ OTHER_CFLAGS_i386 = "";
+ OTHER_CFLAGS_ppc = "";
+ OTHER_LDFLAGS_ppc = "-prebind -seg1addr 0x30000000";
+ PRODUCT_NAME = SDL;
+ WRAPPER_EXTENSION = framework;
+ };
+ name = Release;
+ };
+ 00CFA623106A567900758660 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ "SDL_VIDEO_DRIVER_DGA=1",
+ "SDL_VIDEO_DRIVER_X11=1",
+ "SDL_VIDEO_DRIVER_X11_DGAMOUSE=1",
+ "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_1)",
+ "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_2)",
+ "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_3)",
+ "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_4)",
+ "SDL_VIDEO_DRIVER_X11_VIDMODE=1",
+ "SDL_VIDEO_DRIVER_X11_XINERAMA=1",
+ "SDL_VIDEO_DRIVER_X11_XME=1",
+ "SDL_VIDEO_DRIVER_X11_XRANDR=1",
+ "SDL_VIDEO_DRIVER_X11_XV=1",
+ );
+ GCC_PREPROCESSOR_DEFINITIONS_QUOTED_1 = "SDL_VIDEO_DRIVER_X11_DYNAMIC=\\\"/usr/X11R6/lib/libX11.6.dylib\\\"";
+ GCC_PREPROCESSOR_DEFINITIONS_QUOTED_2 = "SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT=\\\"/usr/X11R6/lib/libXext.6.dylib\\\"";
+ GCC_PREPROCESSOR_DEFINITIONS_QUOTED_3 = "SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR=\\\"/usr/X11R6/lib/libXrandr.2.dylib\\\"";
+ GCC_PREPROCESSOR_DEFINITIONS_QUOTED_4 = "SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER=\\\"/usr/X11R6/lib/libXrender.1.dylib\\\"";
+ HEADER_SEARCH_PATHS = /usr/X11R6/include;
+ OTHER_CFLAGS = "$(OTHER_CFLAGS_$(CURRENT_ARCH))";
+ OTHER_CFLAGS_i386 = "";
+ OTHER_CFLAGS_ppc = "";
+ PRODUCT_NAME = SDL;
+ };
+ name = Release;
+ };
+ 00CFA624106A567900758660 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = SDLmain;
+ };
+ name = Release;
+ };
+ 00CFA625106A567900758660 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = "Standard DMG";
+ };
+ name = Release;
+ };
+ 00CFA626106A567900758660 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = "Developer Extras Package";
+ };
+ name = Release;
+ };
+ 00CFA627106A568900758660 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ GCC_ALTIVEC_EXTENSIONS = YES;
+ GCC_AUTO_VECTORIZATION = YES;
+ GCC_ENABLE_CPP_EXCEPTIONS = NO;
+ GCC_ENABLE_CPP_RTTI = NO;
+ GCC_ENABLE_SSE3_EXTENSIONS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ MACOSX_DEPLOYMENT_TARGET = 10.5;
+ SDKROOT = macosx;
+ WARNING_CFLAGS = "";
+ };
+ name = Debug;
+ };
+ 00CFA628106A568900758660 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 12.4;
+ FRAMEWORK_VERSION = A;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_1)",
+ "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_2)",
+ "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_3)",
+ "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_4)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = YES;
+ HEADER_SEARCH_PATHS = /usr/X11R6/include;
+ INFOPLIST_FILE = "Info-Framework.plist";
+ INSTALL_PATH = "@rpath";
+ OTHER_CFLAGS = "$(OTHER_CFLAGS_$(CURRENT_ARCH))";
+ OTHER_CFLAGS_i386 = "";
+ OTHER_CFLAGS_ppc = "";
+ PRODUCT_NAME = SDL;
+ WRAPPER_EXTENSION = framework;
+ };
+ name = Debug;
+ };
+ 00CFA629106A568900758660 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ "SDL_VIDEO_DRIVER_DGA=1",
+ "SDL_VIDEO_DRIVER_X11=1",
+ "SDL_VIDEO_DRIVER_X11_DGAMOUSE=1",
+ "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_1)",
+ "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_2)",
+ "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_3)",
+ "$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_4)",
+ "SDL_VIDEO_DRIVER_X11_VIDMODE=1",
+ "SDL_VIDEO_DRIVER_X11_XINERAMA=1",
+ "SDL_VIDEO_DRIVER_X11_XME=1",
+ "SDL_VIDEO_DRIVER_X11_XRANDR=1",
+ "SDL_VIDEO_DRIVER_X11_XV=1",
+ );
+ GCC_PREPROCESSOR_DEFINITIONS_QUOTED_1 = "SDL_VIDEO_DRIVER_X11_DYNAMIC=\\\"/usr/X11R6/lib/libX11.6.dylib\\\"";
+ GCC_PREPROCESSOR_DEFINITIONS_QUOTED_2 = "SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT=\\\"/usr/X11R6/lib/libXext.6.dylib\\\"";
+ GCC_PREPROCESSOR_DEFINITIONS_QUOTED_3 = "SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR=\\\"/usr/X11R6/lib/libXrandr.2.dylib\\\"";
+ GCC_PREPROCESSOR_DEFINITIONS_QUOTED_4 = "SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER=\\\"/usr/X11R6/lib/libXrender.1.dylib\\\"";
+ HEADER_SEARCH_PATHS = /usr/X11R6/include;
+ OTHER_CFLAGS = "$(OTHER_CFLAGS_$(CURRENT_ARCH))";
+ OTHER_CFLAGS_i386 = "";
+ OTHER_CFLAGS_ppc = "";
+ PRODUCT_NAME = SDL;
+ };
+ name = Debug;
+ };
+ 00CFA62A106A568900758660 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = SDLmain;
+ };
+ name = Debug;
+ };
+ 00CFA62B106A568900758660 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = "Standard DMG";
+ };
+ name = Debug;
+ };
+ 00CFA62C106A568900758660 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PRODUCT_NAME = "Developer Extras Package";
+ };
+ name = Debug;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 003235571070933500C76517 /* Build configuration list for PBXAggregateTarget "Generate Doxygen DocSet" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 003235521070931700C76517 /* Debug */,
+ 003235531070931700C76517 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Debug;
+ };
+ 0073177A0858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Framework" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 00CFA628106A568900758660 /* Debug */,
+ 00CFA622106A567900758660 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Debug;
+ };
+ 0073177E0858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Static Library" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 00CFA629106A568900758660 /* Debug */,
+ 00CFA623106A567900758660 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Debug;
+ };
+ 007317820858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Main Library" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 00CFA62A106A568900758660 /* Debug */,
+ 00CFA624106A567900758660 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Debug;
+ };
+ 007317860858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Standard DMG" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 00CFA62B106A568900758660 /* Debug */,
+ 00CFA625106A567900758660 /* Release */,
+ );
+ 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 = (
+ 00CFA627106A568900758660 /* Debug */,
+ 00CFA621106A567900758660 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Debug;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
+}
diff --git a/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/Readme SDL Developer.txt b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/Readme SDL Developer.txt
new file mode 100755
index 0000000..aa32284
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/Readme SDL Developer.txt
@@ -0,0 +1,282 @@
+SDL Mac OS X Developer Notes:
+ This is an optional developer package to provide extras that an
+ SDL developer might benefit from.
+
+ Make sure you have already installed the SDL.framework
+ from the SDL.dmg.
+
+ For more complete documentation, please see READMEs included
+ with the SDL source code. Also, don't forget about the API
+ documentation (also included with this package).
+
+
+This package contains:
+- SDL API Documentation
+- A variety of SDLMain and .Nib files to choose from
+- Xcode project templates
+
+
+SDL API Documentation:
+ We include both the HTML documentation and the man files.
+ And new to 1.2.14, we introduce an Xocde DocSet which
+ is generated via Doxygen. These require Xcode 3.0 or greater.
+
+ You will need to drill down into the XcodeDocSet directory
+ from the Documentation folder and find the
+ org.libsdl.sdl.docset bundle. We recommend you copy this to:
+
+ /Library/Developer/Shared/Documentation/DocSets
+
+ Again, this follows all the standard Xcode patterns
+ described with the project templates (below). You may need
+ to create the directories if they don't already exist.
+ You may install it on a per-user basis.
+ And you may target specific versions of Xcode
+ in lieu of using the "Shared" directory.
+
+ To use, it is quite simple. Just bring up the Xcode
+ Documentation Browser window (can be activated through
+ the Xcode Help Menu) and start searching for something.
+
+ If nothing is found on a legitimate search, verify that
+ the SDL documentation is enabled by opening up the DocSet
+ popup box below the toolbar in Snow Leopard.
+ (In Leopard, the DocSets appear in the left-side panel.)
+
+ Another handy trick is to use the mouse and Option-Double-Click
+ on a function or keyword to bring up documentation on the
+ selected item. Prior to Xcode 3.2 (Snow Leopard), this would
+ jump you to the entry in the Xcode Documentation Browser.
+
+ However, in Xcode 3.2 (Snow Leopard), this behavior has been
+ altered and you are now given a hovering connected popup box
+ on the selected item (called Quick Help). Unfortunately, the
+ Doxygen generated DocSet doesn't currently provide Quick Help
+ information. You can either follow a link to the main
+ Documentation Browser from the Quick Help, or alternatively,
+ you can bypass Quick Help by using Command-Option-Double-Click
+ instead of Option-Double-Click. (Please file feedback with both
+ Doxygen and Apple to improve Quick Help integration.)
+
+
+ For those that want to tweak the documentation output,
+ you can find my Doxyfile in the XcodeDocSet directory in
+ the Xcode directory of the SDL source code base (and in this package).
+
+ One of the most significant options is "Separate Member Pages"
+ which I disable. When disabled, the documentation is about 6MB.
+ When enabled, the documentation is closer to 1.6GB (yes gigabytes).
+ Obviously, distribution will be really hard with sizes that huge
+ so I disable the option.
+
+ I also disabled Dot because there didn't seem to be
+ much benefit of generating graphs for public C functions.
+
+ One thing I would like to see is a CSS file that makes the
+ Doxygen DocSet look more like the native Apple documentation
+ style. Style sheets are outside my expertise so I am asking for
+ contributions on this one. Meanwhile, I also request you send
+ feedback to Doxygen and Apple about this issue too.
+
+
+ Finally for convenience, I have added a new shell script target
+ to the Xcode project that builds SDL that refers to my Doxyfile
+ and generate the DocSet we distribute.
+
+
+SDLMain:
+ We include several different variations of SDLMain and the
+ .Nibs. (Each of these are demonstrated by the different PB/Xcode
+ project templates.) You get to pick which one you want to use,
+ or you can write your own to meet your own specific needs. We do
+ not currently provide a libSDLMain.a. You can build it yourself
+ once you decide which one you want to use though it is easier and
+ recommended in the SDL FAQ that you just copy the SDLMain.h and
+ SDLMain.m directly into your project. If you are puzzled by this,
+ we strongly recommend you look at the different PB/Xcode project
+ templates to understand their uses and differences. (See Project
+ Template info below.) Note that the "Nibless" version is the same
+ version of SDLMain we include the the devel-lite section of the
+ main SDL.dmg.
+
+
+Xocde Project Templates:
+ For convenience, we provide Project Templates for Xcode.
+ Using Xcode is *not* a requirement for using
+ the SDL.framework. However, for newbies, we do recommend trying
+ out the Xcode templates first (and work your way back to raw gcc
+ if you desire), as the Xcode templates try to setup everything
+ for you in a working state. This avoids the need to ask those
+ many reoccuring questions that appear on the mailing list
+ or the SDL FAQ.
+
+
+ We have provided 3 different kinds of SDL templates for Xcode and have
+ a different set of templates for each version of Xcode (which generally
+ correspond with a particular Mac OS X version).
+ The installion directory depends on which version of Xcode you have.
+ (Note: These directories may not already exist on your system so you must create them yourself.)
+
+ For Leopard and Snow Leopard (Xcode 2.5, 3+), we recommend you install to:
+ /Library/Application Support/Developer/Shared/Xcode/Project Templates/Application
+
+ For Xcode 1.0 to 2.4,
+ /Library/Application Support/Apple/Developer Tools/Project Templates/Appllcation
+
+
+ Also note you may place it in per-user locations, e.g.
+ ~/Library/Application Support/Developer/Shared/Xcode/Project Templates/Application
+
+
+ And for advanced users who have multiple versions of Xcode installed on a single system,
+ you may put each set in a directory with the Xcode version number instead of using "Shared", e.g.
+ /Library/Application Support/Developer/2.5/Xcode/Project Templates/Application
+ /Library/Application Support/Developer/3.1/Xcode/Project Templates/Application
+ /Library/Application Support/Developer/3.2/Xcode/Project Templates/Application
+
+
+ Copy each of the SDL/Xcode template directories into the correct location (e.g. "SDL OpenGL Application").
+ Do not copy our enclosing folder into the location (e.g. TemplatesForXcodeSnowLeopard).
+ So for example, in:
+ /Library/Application Support/Developer/Shared/Xcode/Project Templates/Application
+ you should have the 3 folders:
+ SDL Application
+ SDL Cocoa Application
+ SDL OpenGL Application
+
+
+ After doing this, when doing a File->New Project, you will see the
+ projects under the Application category.
+ (Newer versions of Xcode have a separate section for User Templates and it will
+ appear in the Application category of the User Templates section.)
+
+
+
+ How to create a new SDL project:
+
+ 1. Open Xcode
+ 2. Select File->New Project
+ 3. Select SDL Application
+ 4. Name, Save, and Finish
+ 5. Add your sources.
+ *6. That's it!
+
+ * If you installed the SDL.framework to $(HOME)/Library/Frameworks
+ instead of /Library/Frameworks, you will need to update the
+ location of the SDL.framework in the "Groups & Files" browser.
+
+
+ The project templates we provide are:
+ - SDL Application
+ This is the barebones, most basic version. There is no
+ customized .Nib file. While still utilizing Cocoa under
+ the hood, this version may be best suited for fullscreen
+ applications.
+
+ - SDL Cocoa Application
+ This demonstrates the integration of using native
+ Cocoa Menus with an SDL Application. For applications
+ designed to run in Windowed mode, Mac users may appreciate
+ having access to standard menus for things
+ like Preferences and Quiting (among other things).
+
+ - SDL OpenGL Application
+ This reuses the same SDLMain from the "SDL Application"
+ temmplate, but also demonstrates how to
+ bring OpenGL into the mix.
+
+
+Special Notes:
+Only the 10.6 Snow Leopard templates (and later) will include 64-bit in the Universal Binary as
+prior versions of OS X lacked the API support SDL requires for 64-bit to work correctly.
+To prevent 64-bit SDL executables from being launched on 10.5 Leopard, a special key has been set
+in the Info.plist in our Snow Leopard SDL/Xcode templates.
+
+
+Xcode Tips and Tricks:
+
+- Building from command line
+ Use the command line tool: xcodebuild (see man page)
+
+- Running your app
+ You can send command line args to your app by either
+ invoking it from the command line (in *.app/Contents/MacOS)
+ or by entering them in the "Executables" panel of the target
+ settings.
+
+- Working directory
+ As defined in the SDLMain.m file, the working directory of
+ your SDL app is by default set to its parent. You may wish to
+ change this to better suit your needs.
+
+
+
+Additional References:
+
+ - Screencast tutorials for getting started with OpenSceneGraph/Mac OS X are
+ available at:
+ http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/MacOSXTips
+ Though these are OpenSceneGraph centric, the same exact concepts apply to
+ SDL, thus the videos are recommended for everybody getting started with
+ developing on Mac OS X. (You can skim over the PlugIns stuff since SDL
+ doesn't have any PlugIns to worry about.)
+
+
+Partial History:
+2009-09-21 - CustomView template project was removed because it was broken by
+ the removal of legacy Quicktime support while moving to 64-bit.
+ ProjectBuilder templates were removed.
+ Tiger, Leopard, and Snow Leopard Xcode templates were introduced instead of
+ using a single common template due to the differences between the 3.
+ (Tiger used a chevron marker for substitution while Leopard/Snow Leopard use ___
+ and we need the 10.6 SDK for 64-bit.)
+
+2007-12-30 - Updated documentation to reflect new template paths in Leopard
+ Xcode. Added reference to OSG screencasts.
+
+2006-03-17 - Changed the package format from a .pkg based
+ installer to a .dmg to avoid requiring administrator/root
+ to access contents, for better transparency, and to allow
+ users to more easily control which components
+ they actually want to install.
+ Introduced and updated documentation.
+ Created brand new Xcode project templates for Xcode 2.1
+ based on the old Project Builder templates as they
+ required Xcode users to "Upgrade to Native Target". The new
+ templates try to leveage more default options and leverage
+ more Xcode conventions. The major change that may introduce
+ some breakage is that I now link to the SDL framework
+ via the "Group & Files" browser instead of using build
+ options. The downside to this is that if the user
+ installs the SDL.framework to a place other than
+ /Library/Frameworks (e.g. $(HOME)/Library/Frameworks),
+ the framework will not be found to link to and the user
+ has to manually fix this. But the upshot is (in addition to
+ being visually displayed in the forefront) is that it is
+ really easy to copy (embed) the framework automatically
+ into the .app bundle on build. So I have added this
+ feature, which makes the application potentially
+ drag-and-droppable ready. The Project Builder templates
+ are mostly unchanged due to the fact that I don't have
+ Project Builder. I did rename a file extension to .pbxproj
+ for the SDL Custom Cocoa Application template because
+ the .pbx extension would not load in my version of Xcode.
+ For both Project Builder and Xcode templates, I resync'd
+ the SDLMain.* files for the SDL App and OpenGL App
+ templates. I think people forget that we have 2 other
+ SDLMain's (and .Nib's) and somebody needs to go
+ through them and merge the new changes into those.
+ I also wrote a fix for the SDL Custom Cocoa App
+ template in MyController.m. The sprite loading code
+ needed to be able to find the icon.bmp in the .app
+ bundle's Resources folder. This change was needed to get
+ the app to run out of the box. This might change is untested
+ with Project Builder though and might break it.
+ There also seemed to be some corruption in the .nib itself.
+ Merely opening it and saving (allowing IB to correct the
+ .nib) seemed to correct things.
+ (Eric Wing)
+
+
+
+
diff --git a/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/SDL-devel.info b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/SDL-devel.info
new file mode 100755
index 0000000..698f1d6
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/SDL-devel.info
@@ -0,0 +1,15 @@
+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/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/SDL.info b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/SDL.info
new file mode 100755
index 0000000..ca37a7f
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/SDL.info
@@ -0,0 +1,15 @@
+Title SDL 1.2.8
+Version 1
+Description SDL Library for Mac OS X (http://www.libsdl.org)
+DefaultLocation /Library/Frameworks
+Diskname (null)
+DeleteWarning
+NeedsAuthorization NO
+DisableStop NO
+UseUserMask NO
+Application NO
+Relocatable YES
+Required NO
+InstallOnly NO
+RequiresReboot NO
+InstallFat NO
diff --git a/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/devel-resources/ReadMe.txt b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/devel-resources/ReadMe.txt
new file mode 100755
index 0000000..f4fe361
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/devel-resources/ReadMe.txt
@@ -0,0 +1,5 @@
+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/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/devel-resources/Welcome.txt b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/devel-resources/Welcome.txt
new file mode 100755
index 0000000..9b0d286
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/devel-resources/Welcome.txt
@@ -0,0 +1,5 @@
+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/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/devel-resources/install.sh b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/devel-resources/install.sh
new file mode 100755
index 0000000..e7a4ded
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/devel-resources/install.sh
@@ -0,0 +1,76 @@
+#!/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/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/resources/License.rtf b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/resources/License.rtf
new file mode 100755
index 0000000..706980d
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/resources/License.rtf
@@ -0,0 +1,283 @@
+{\rtf1\mac\ansicpg10000\cocoartf102
+{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique;
+}
+{\colortbl;\red255\green255\blue255;\red64\green64\blue64;}
+\paperw11900\paperh16840\margl1440\margr1440\vieww9080\viewh13160\viewkind0
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\qc
+
+\f0\b\fs36 \cf0 GNU LESSER GENERAL PUBLIC LICENSE
+\fs24 \
+Version 2.1, February 1999
+\f1\b0 \
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural
+\cf0 \
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\qc
+
+\f2\i \cf0 Copyright (C) 1991, 1999 Free Software Foundation, Inc.\
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\
+ Everyone is permitted to copy and distribute verbatim copies\
+ of this license document, but changing it is not allowed.\
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural
+
+\f1\i0 \cf0 \
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural
+\cf2 [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.]\cf0 \
+\
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\qc
+
+\f0\b \cf0 Preamble
+\f1\b0 \
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural
+\cf0 \
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.\
+\
+This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.\
+\
+When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.\
+\
+To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.\
+\
+For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.\
+\
+We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.\
+\
+To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others.\
+\
+Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.\
+\
+Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We this license for certain libraries in order to permit linking those libraries into non-free programs.\
+\
+When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.\
+\
+We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.\
+\
+For example, on rare occasions, there may be a special need to encourage widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.\
+\
+Another cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.\
+\
+Although the Lesser General Public License is Less protective of the users' freedom, it does insure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.\
+\
+The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.\
+\
+\
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\qc
+
+\f0\b \cf0 GNU LESSER GENERAL PUBLIC LICENSE\
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural
+
+\f1\b0 \cf0 \
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural
+
+\f0\b \cf0 0.
+\f1\b0 This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".\
+\
+A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.\
+\
+The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)\
+\
+"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.\
+\
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.\
+ \
+
+\f0\b 1.
+\f1\b0 You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.\
+\
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.\
+\
+
+\f0\b 2.
+\f1\b0 You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:\
+\
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\li240\ql\qnatural
+
+\f0\b \cf0 a)
+\f1\b0 The modified work must itself be a software library.\
+\
+
+\f0\b b)
+\f1\b0 You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.\
+\
+
+\f0\b c)
+\f1\b0 You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.\
+\
+
+\f0\b d)
+\f1\b0 If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.\
+\
+(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)\
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural
+\cf0 \
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.\
+\
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.\
+\
+In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.\
+\
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural
+
+\f0\b \cf0 3.
+\f1\b0 You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.\
+\
+Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.\
+\
+This option is useful when you wish to copy part of the code of the Library into a program that is not a library.\
+\
+
+\f0\b 4.
+\f1\b0 You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.\
+\
+If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.\
+\
+
+\f0\b 5.
+\f1\b0 A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.\
+\
+However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.\
+\
+When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.\
+\
+If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)\
+\
+Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.\
+\
+
+\f0\b 6.
+\f1\b0 As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.\
+\
+You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:\
+\
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\li240\ql\qnatural
+
+\f0\b \cf0 a)
+\f1\b0 Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)\
+\
+
+\f0\b b)
+\f1\b0 Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.\
+\
+
+\f0\b c)
+\f1\b0 Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.\
+\
+
+\f0\b d)
+\f1\b0 If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.\
+\
+
+\f0\b e)
+\f1\b0 Verify that the user has already received a copy of these materials or that you have already sent this user a copy.\
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural
+\cf0 \
+For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.\
+\
+It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.\
+\
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural
+
+\f0\b \cf0 7.
+\f1\b0 You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:\
+\
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\li240\ql\qnatural
+
+\f0\b \cf0 a)
+\f1\b0 Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.\
+\
+
+\f0\b b)
+\f1\b0 Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.\
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural
+\cf0 \
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural
+
+\f0\b \cf0 8.
+\f1\b0 You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.\
+\
+
+\f0\b 9.
+\f1\b0 You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.\
+\
+
+\f0\b 10.
+\f1\b0 Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.\
+\
+
+\f0\b 11.
+\f1\b0 If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.\
+\
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.\
+\
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.\
+\
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.\
+\
+
+\f0\b 12.
+\f1\b0 If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.\
+\
+
+\f0\b 13.
+\f1\b0 The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\
+\
+Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.\
+\
+
+\f0\b 14.
+\f1\b0 If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.\
+\
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\qc
+
+\f0\b \cf0 NO WARRANTY
+\f1\b0 \
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural
+\cf0 \
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural
+
+\f0\b \cf0 15.
+\f1\b0 BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\
+\
+
+\f0\b 16.
+\f1\b0 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\
+\
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\qc
+
+\f0\b \cf0 END OF TERMS AND CONDITIONS
+\f1\b0 \
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural
+\cf0 \
+\
+How to Apply These Terms to Your New Libraries\
+\
+If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).\
+\
+To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.\
+\
+\pard\tx220\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\li240\ql\qnatural
+\cf0 <one line to give the library's name and a brief idea of what it does.>\
+Copyright (C) <year> <name of author>\
+\
+This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\
+\
+This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.\
+\
+You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural
+\cf0 \
+Also add information on how to contact you by electronic and paper mail.\
+\
+You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names:\
+\
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\li240\ql\qnatural
+\cf0 Yoyodyne, Inc., hereby disclaims all copyright interest in the library\
+`Frob' (a library for tweaking knobs) written by James Random Hacker.\
+\
+<signature of Ty Coon>, 1 April 1990\
+Ty Coon, President of Vice\
+\pard\tx565\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural
+\cf0 \
+That's all there is to it!\
+\
+} \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/resources/ReadMe.txt b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/resources/ReadMe.txt
new file mode 100755
index 0000000..0731150
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/resources/ReadMe.txt
@@ -0,0 +1,171 @@
+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
+
+
+This packages contains the SDL.framework for OS X.
+Conforming with Apple guidelines, this framework
+contains both the SDL runtime component and development header files.
+
+
+To Install:
+Copy the SDL.framework to /Library/Frameworks
+
+You may alternatively install it in <Your home directory>/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:
+
+ - 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 of PB/Xcode projects:
+2009-09-21 - Added 64-bit for Snow Leopard. 10.4 is the new minimum requirement.
+ Removed 'no X11' targets as
+ new codebase will assume you have them. Also removed specific #defines
+ for X11, but needed to add search path to /usr/X11R6/include
+
+2007-12-31 - Enabled strip -x in the Xcode settings and removed it
+ from the Build DMG script.
+ Added a per-arch setting for the Deployment targets for OTHER_LDFLAGS_ppc
+ to re-enable prebinding.
+ Need to remember to copy these changes to the SDL satellite projects.
+
+2007-12-30 - Updated documentation to reflect new installation paths for
+ Xcode project templates under Leopard (Xcode 2.5/3.0).
+
+????-??-?? - Added extra targets for building formal releases against the
+ 10.2 SDK so we don't have to keep modifying the settings.
+
+????-??-?? - Added fancy DMG (background logo) support with automation.
+
+2006-05-09 - Added shell script phase to deal with new SDL_config.h
+ behavior. Encountered what seems to be an Xcode bug with
+ multiple files of the same name, even when conditional compiling
+ is controlled by custom #defines (SDL_sysloadso.c). Multiple or
+ undefined symbols are the result of this.
+ Recommended that macosx/SDL_sysloadso.c be modified to directly
+ include the dlopen version of the file via #ifdef's so only
+ one version needs to exist. Filed a formal bug report with Apple
+ about this (4542369).
+
+2006-03-22 - gcc 4 visibility features have been added to the code base so I
+ enabled the switch in Xcode to take advantage of it. Be aware that only
+ our x86 builds will be exposed to this feature as we still build ppc
+ with gcc 3.3.
+
+ Christian Walther has sent me some great feedback on things that are
+ broken, so I have made some of these fixes. Among the issues are
+ compatibility and current library versions are not set to 1 (breaks
+ backwards compatibility), documentation errors, resource copying
+ location problems for the SDLTest apps, missing HAVE_OPENGL and
+ OpenGL.framework linking in testgl.
+ (Eric Wing)
+
+2006-03-17 - Because the X11 headers are not installed by default with Xcode,
+ we decided to offer two variants of the same targets (one with X11 stuff
+ and one without). By default, since the X11 stuff does not necessarily
+ conflict with the native stuff, we build the libraries with the X11 stuff
+ so advanced developers can access it by default. However, in the case
+ that a developer did not install X11 (or just doesn't want the extra bloat),
+ the user may directly select those targets and build those instead.
+
+ Once again, we are attempting to remove the exported symbols file. If
+ I recall correctly, the clashing symbol problems we got were related
+ to the CD-ROM code which was formerly in C++. Now that the C++ code
+ has been purged, we are speculating that we might be able to remove
+ the exports file safely. The long term solution is to utilize gcc 4's
+ visibility features.
+
+ For the developer extras package, I changed the package format
+ from a .pkg based installer to a .dmg to avoid requiring
+ administrator/root to access contents, for better
+ transparency, and to allow users to more easily control which components
+ they actually want to install.
+ I also made changes and updates to the PB/Xcode project templates (see Developer ReadMe).
+ (Eric Wing)
+
+2006-03-07 - The entire code base has been reorganized and platform specific
+ defines have been pushed into header files (SDL_config_*.h). This means
+ that defines that previously had to be defined in the Xcode projects can
+ be removed (which I have started doing). Furthermore, it appears that the
+ MMX/SSE code has been rewritten and refactored so it now compiles without
+ nasm and without making us do strange things to support OS X. However, this
+ Xcode project still employs architecture specific build options in order to
+ achieve the mandated 10.2 compatibility. As a result of the code base changes,
+ there are new public headers. But also as a result of these changes, there are
+ also new headers that qualify as "PrivateHeaders". Private Headers are headers
+ that must be exported because a public header includes them, but users shouldn't
+ directly invoke these. SDL_config_macosx.h and SDL_config_dreamcast.h are
+ examples of this. We have considered marking these headers as Private, but it
+ requires that the public headers invoke them via framework conventions, i.e.
+ #include <FrameworkName/Header.h>
+ e.g.
+ #include <SDL/SDL_config_macosx.h>
+ and not
+ #include "SDL_config_macosx.h"
+ However this imposes the restriction that non-framework distributions must
+ place their headers in a directory called SDL/ (and not SDL11/ like FreeBSD).
+ Currently, I do not believe this would pose a problem for any of the current
+ distributions (Fink, DarwinPorts). Or alternatively, users could be
+ expected/forced to also include the header path:
+ -I/Library/Frameworks/SDL.framework/PrivateHeaders,
+ but most people would probably not read the documentation on this.
+ But currently, we have decided to be conservative and have opted not to
+ use the PrivateHeaders feature.
+ (Eric Wing)
+
+2006-01-31 - Updates to build Universal Binaries while retaining 10.2 compatibility.
+ We were unable to get MMX/SSE support enabled. It is believed that a rewrite of
+ the assembly code will be necessary to make it position independent and not
+ require nasm. Altivec has finally been enabled for PPC. (Eric Wing)
+
+2005-09-?? - Had to add back the exports file because it was causing build problems
+ for some cases. (Eric Wing)
+
+2005-08-21 - First entry in history. Updated for SDL 1.2.9 and Xcode 2.1. Getting
+ ready for Universal Binaries. Removed the .pkg system for .dmg for due to problems
+ with broken packages in the past several SDL point releases. Removed usage of SDL
+ exports file because it has become another point of failure. Introduced new documentation
+ about SDLMain and how to compile in an devel-lite section of the SDL.dmg. (Eric Wing)
+
+Before history:
+SDL 1.2.6? to 1.2.8
+Started updating Project Builder projects to Xcode for Panther and Tiger. Also removed
+the system that split the single framework into separate runtime and headers frameworks.
+This is against Apple conventions and causes problems on multiuser systems.
+We now distribute a single framework.
+The .pkg system has repeatedly been broken with every new release of OS X.
+With 1.2.8, started migrating stuff to .dmg based system to simplify distribution process.
+Tried updating the exports file and Perl script generation system for changing syntax. (Eric Wing)
+
+Pre-SDL 1.2.6
+Created Project Builder projects for SDL and .pkg based distribution system. (Darrell Walisser)
+
+
+
+
+
+
+
+
diff --git a/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/resources/ReadMeDevLite.txt b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/resources/ReadMeDevLite.txt
new file mode 100644
index 0000000..d2cd793
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/resources/ReadMeDevLite.txt
@@ -0,0 +1,12 @@
+This directory is for developers. This directory contains some basic essentials you will need for developing SDL based applications on OS X. The SDL-devel package contains all of this stuff plus more, so you can ignore this if you install the SDL-devel.pkg. The SDL-devel package contains Xcode templates, SDL documentation, and different variations of SDLmain and NIB files for SDL.
+
+To compile an SDL based application on OS X, SDLMain.m must be compiled into your program. (See the SDL FAQ). The SDL-devel.pkg includes Xcode templates which already do this for you. But for those who may not want to install the dev package, an SDLMain is provided here as a convenience. Be aware that there are different variations of SDLMain.m depending on what class of SDL application you make and they are intended to work with NIB files. Only one SDLMain variant is provided here and without any NIB files. You should look to the SDL-devel package for the others. We currently do not provide a SDLMain.a file, partly to call to attention that there are different variations of SDLmain.
+
+To build from the command line, your gcc line will look something like this:
+
+gcc -I/Library/Frameworks/SDL.framework/Headers MyProgram.c SDLmain.m -framework SDL -framework Cocoa
+
+An SDL/OpenGL based application might look like:
+
+gcc -I/Library/Frameworks/SDL.framework/Headers -I/System/Library/Frameworks/OpenGL.framework/Headers MyProgram.c SDLmain.m -framework SDL -framework Cocoa -framework OpenGL
+
diff --git a/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/resources/SDL_DS_Store b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/resources/SDL_DS_Store
new file mode 100644
index 0000000..f15a5e7
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/resources/SDL_DS_Store
Binary files differ
diff --git a/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/resources/UniversalBinaryNotes.rtf b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/resources/UniversalBinaryNotes.rtf
new file mode 100644
index 0000000..5585ecb
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/resources/UniversalBinaryNotes.rtf
@@ -0,0 +1,150 @@
+{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf110
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 LucidaGrande;\f2\fmodern\fcharset0 Courier-Oblique;
+}
+{\colortbl;\red255\green255\blue255;}
+{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}}
+{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}}
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
+
+\f0\b\fs24 \cf0 64-bit Universal Binary Notes:\
+
+\b0 \
+SDL 1.2.14 is our first release with Snow Leopard on the market. In order to make SDL compile and run in 64-bit, we had to remove code that depended on deprecated Mac APIs and move over to more modern Mac APIs.\
+\
+In addition, Apple has stopped shipping gcc 3.3 and the 10.3 SDK.\
+\
+Because of all these combined factors, we have made the decision to make Mac OS X 10.4 the new minimum requirement for SDL.\
+\
+Our official SDL.framework is compiled as a 3-way Universal Binary (64-bit Intel, 32-bit Intel, 32-bit PowerPC.)\
+\
+Certain APIs that SDL relies on were not made 64-bit ready by Apple until 10.6. This means even though 10.5 had preliminary 64-bit support, SDL will not compile or run correctly in 64-bit mode on 10.5. So there are two fallout items from this.\
+\
+First, you can only compile 64-bit code on Snow Leopard or greater (which removes the possibility of 64-bit PowerPC). \
+\
+Second, this presents a corner-case where if you have a 64-bit Intel executable in your Universal binary and try to run on 10.5 on an 64-bit Intel Mac, it will launch and crash. To force 10.5 to use the 32-bit version instead of the 64-bit, you should set the LaunchServices key, LSMinimumSystemVersionByArchitecture, in your application's Info.plist. Our SDL/Xcode templates for Snow Leopard already set this up for you.\
+\
+\
+One additional fallout item is we had to remove the SDL Custom Cocoa Xcode template project. It depended on NSQuickTimeView which was deprecated and removed from the SDL codebase. It may still be possible to recreate the behavior that this template demonstrated, but we would need a volunteer to investigate this.\
+\
+\
+\
+In addition, the SDL satellite projects were affected by the 64-bit transition.\
+\
+- SDL_mixer depended on legacy Quicktime for midi playback support. We had to disable midi. (Recall that we also disabled MP3 support awhile back because we never got SMPEG working during the Tiger/Intel transition.) To fix this, we would need a native Core Audio backend for SDL_mixer.\
+\
+- Since we have changed the baseline to 10.4, we took this opportunity to switch SDL_image over to a new native ImageIO based backend. This makes the binary about 10x smaller, greatly simplifies our maintenance requirements and build process as we no longer have to maintain build systems for 3rd party dependencies, and gives us access to more image formats.\
+\
+- The static library target for SDL_ttf no longer works because we no longer have access to a libfreetype.a. We have been relying on Apple's supplied libfreetype.a, but they stopped shipping a static version starting in 10.5 which means we have no static 64-bit version. But since 10.4 is our new baseline, all these systems should have libfreetype.dylib installed, so it shouldn't be much of a problem to use SDL_ttf as a dynamic library which dynamically links to libfreetype.\
+\
+\
+-Eric Wing 2009-09-23\
+
+\b \
+\
+\
+\
+Universal Binary Notes: (historical, somewhat obsolete)\
+
+\b0 \
+Below is an overview of what we had to do to build Universal Binaries for SDL (and satellites). The document is provided to help others understand what the heck we had to do to get this to work so they know (and don't break) any settings we have set to accomplish this. It also describes areas of problems for those who might attempt to fix them after us.\
+\
+\
+It turns out that developing a Universal Binary for SDL was a painful process, but not for the typical reasons affecting most other developers. SDL is already platform clean and has an Xcode project which are usually the two biggest obstacles. (The only real code bug we had to fix was in SDL_mixer, but that was due to a Quicktime issue so we can blame the Quicktime authors.)\
+\
+But developing a Universal Binary was painful to us for several reasons:\
+\
+\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\ql\qnatural\pardirnatural
+\ls1\ilvl0\cf0 {\listtext \'95 }SDL must retain compatibility with 10.2 (Jaguar)\
+\
+{\listtext \'95 }SDL has processor specific optimizations (Altivec, MMX/SSE)\
+\
+{\listtext \'95 }The SDL satellites (SDL_mixer, SDL_image, SDL_ttf) have 3rd party dependencies which we currently statically link against. All of these dependencies needed to be updated/recompiled with the same above constraints.\
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
+\cf0 \
+For retaining compatibility with 10.2, we have experimentally determined that there is no reliable way to use gcc 4.0.x to compile a binary that works under Jaguar. With the gcc 4.0 that shipped in Xcode 2.1, libgcc_s was automatically linked against. This library does not exist on systems prior to 10.3.9. After filing a bug report, Apple removed this automatic linking in gcc 4.0.1 which shipped with Xcode 2.2, but we discovered that we suffered from undefined symbols to things in the printf family library. (They seem to be new symbols related to printing long doubles, etc.)\
+\
+So to accomplish our compatibility goals, we had to find and exploit some lesser known features of Xcode that allow us to specify architecture specific build flags found here:\
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
+{\field{\*\fldinst{HYPERLINK "http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeUserGuide/Contents/Resources/en.lproj/05_07_bs_building_product/chapter_33_section_6.html#//apple_ref/doc/uid/TP40002693-SW3"}}{\fldrslt \cf0 http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeUserGuide/Contents/Resources/en.lproj/05_07_bs_building_product/chapter_33_section_6.html#//apple_ref/doc/uid/TP40002693-SW3}}\
+\
+The first and most important of these is the
+\f1 GCC_VERSION flag which lets us set gcc 3.3 for PowerPC and gcc 4.0 for Intel.\
+\
+But we also needed to verify other options such as the deployment target and SDK. Experimentally, we found that the Deployment target did very little for us except retain prebinding. Setting it to anything less than 10.4 allows for prebinding to remain active.\
+\
+For the SDK's, we found that Apple does link against different versions of system components. But experimentally, we discovered we could still link to the 10.4u SDK and things would still work on Jaguar. Ideally we should probably link to the 10.2.8 SDK for PowerPC. But in reality, most people don't install the 10.2.8 SDK on their system (it is not a default component) so we didn't want to confuse people as setting this would likely cause people's compile to fail the first time they try and they would have to understand the reason for this. We did leave the architecture specific SDKROOT option set explicitly to make it easy to change in case we need to.\
+\
+For the Altivec and MMX/SSE options, we had to use architecture specific build flags. Furthermore, to use SSE, we also had to include the assembly code. This caused us problems because there is no easy way to tell Xcode to use files only for a specific architecture. So the PowerPC side got confused on the .asm files and would fail to compile. \
+\
+Pushing forward, we ignored PPC for the moment to see if we could at least build an optimized x86 build and then use lipo manually to merge the results. We encountered additional problems. First the alignment needed to be changed for reasons outside my knowledge base. We changed all instances of .align 16 to .align 8. This seemed to fix the compile problems. But at the linking stage, we got errors such as:\
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li640\fi-640\ql\qnatural\pardirnatural
+
+\f2\i\fs22 \cf0 ld: /Users/ewing/DEVELOPMENT/CODETEST/UniversalBinarySDL/SDL12/Xcode/SDL/build/SDL.build/Deployment/Framework.build/Objects-normal/i386/SDL_yuv_mmx.o has local relocation entries in non-writable section (__TEXT,__text)\
+/usr/bin/libtool: internal link edit command failed\
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
+
+\f1\i0\fs24 \cf0 \
+Our belief is that the assembly code is not position independent and thus will not work for us. We double checked for any OS X gcc flags that control position independence, but everything seemed to be in order. As such, we cannot compile MMX/SSE optimizations until they are rewritten, preferably without the nasm requirement to accommodate the dual PPC/x86 Xcode limitations.\
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
+\cf0 \
+So for now, we have unchecked (checkbox) the assembly specific files in the Xcode project and have removed the -DUSE_ASMBLIT flag from OTHER_CFLAGS_i386. To reactivate this stuff, you will need to recheck the boxes and re-add the flag.\
+\
+The files are\
+SDL_mixer_MMX.c/h\
+The files under hermes\
+and SDL_yuv_mmx.c\
+\
+\
+\
+For the SDL satellites, it was more of the same. The painful part was that the 3rd library dependencies needed to be rebuilt. (Some of our libraries were out of date, so this was an opportunity to update them.) But this meant changing those build systems as well. \
+\
+These are the versions I used:\
+libpng-1.2.8\
+libjpeg-6b\
+libogg-1.1.3\
+libvorbis-1.1.2\
+smpeg cvs\
+\
+We found that Apple already had a libfreetype in the 10.4u SDK so we just used that one which seemed to work. (For the record, the question did come up of why we statically link against this when it seems to be a standard component on Panther and Tiger. We double checked, and it did not seem to be in Jaguar. So that's why.)\
+\
+The old libpng turned out to be from the 1.0.x branch so we needed to replace all the headers we had as well. Updating to the 1.2.x branch didn't seem to cause any problems we could detect.\
+\
+libpng and libjpeg lack an Xcode project so we mucked with their build system to produce Universal Binaries. But since we needed PPC to be compiled with 3.3 and Intel to be compiled with 4.0, it ended up that we built multiple times changing the compiler, and then using lipo to strip and combine the binaries.\
+\
+libogg/libvorbis did contain Xcode projects, but didn't build static libraries so we had to add that. We also discovered that not building with gcc 3.3 caused us addition missing symbol runtime problems with float versions of math functions (sinf, sqrtf, etc).\
+\
+It seems that once upon a time, the SDL_mixer framework supported MP3's via SMPEG, but this disappeared at some point. I don't know why or how this happened. But I also don't know how SMPEG was ever used with the framework as there was no preexisting infrastructure as with the other libraries. So I have attempted to correct this oversight, however, the SMPEG framework itself has MMX code which has also turned out to be problematic. I am getting compiler errors of "
+\f2\i\fs22 Unknown pseudo-op:"
+\f1\i0\fs24 for
+\f2\i\fs22 .type
+\f1\i0\fs24 and
+\f2\i\fs22 .size.
+\f1\i0\fs24 \
+So SMPEG is currently compiled without MMX optimizations.\
+\
+\
+\
+\
+Addendum: \
+2006-03-06:\
+The main SDL code base (not the satellites) have undergone an overhaul. The required platform specific defines have been moved out of the build system into platform specific header files (SDL_config_*.h). This allows us to simplify the Xcode projects somewhat, but we still must maintain the architecture specific build options to invoke gcc 3.3 to maintain our mandated 10.2 compatibilty requirement.\
+\
+Also it appears that the MMX/SSE code has been rewritten as well so that the obstacles we faced in compiling in these optimizations are no longer problems. The binaries we produce should now contain the processor specific optimizations. (Remember this note only applies to SDL and not the satellites, such as SMPEG.)\
+\
+\
+\
+Contributers:\
+Eric Wing (Xcode projects, 3rd party dependencies, documentation)\
+Christian Walther (10.2.8 and 10.3.9 testing/verification)\
+Ryan Gordon (converted C++ code in SDL/OSX code base to pure C)\
+Martin Storsj\'f6 (libgcc_s testing/verification)\
+Stephane Marchesin (MMX/SSE code expert)\
+\
+\
+\
+\
+\
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
+
+\f0 \cf0 \
+} \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/sdl_logo.pdf b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/sdl_logo.pdf
new file mode 100644
index 0000000..a172f97
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDL/pkg-support/sdl_logo.pdf
Binary files differ
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-checkkeys__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-checkkeys__Upgraded_.plist
new file mode 100644
index 0000000..69321e3
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-checkkeys__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>checkkeys</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-graywin__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-graywin__Upgraded_.plist
new file mode 100644
index 0000000..0a9c04b
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-graywin__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>graywin</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-loopwave__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-loopwave__Upgraded_.plist
new file mode 100644
index 0000000..5f66864
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-loopwave__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>loopwave</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-test.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-test.plist
new file mode 100644
index 0000000..60d5db5
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-test.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testalpha</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testalpha__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testalpha__Upgraded_.plist
new file mode 100644
index 0000000..60d5db5
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testalpha__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testalpha</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testbitmap__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testbitmap__Upgraded_.plist
new file mode 100644
index 0000000..87ec271
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testbitmap__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testbitmap</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testblitspeed.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testblitspeed.plist
new file mode 100644
index 0000000..c7fbcfe
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testblitspeed.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testblitspeed</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testcdrom__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testcdrom__Upgraded_.plist
new file mode 100644
index 0000000..dde6614
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testcdrom__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testcdrom</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testdyngl.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testdyngl.plist
new file mode 100644
index 0000000..1874119
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testdyngl.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testdyngl</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testerror__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testerror__Upgraded_.plist
new file mode 100644
index 0000000..11cc0fd
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testerror__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testerror</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testfile.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testfile.plist
new file mode 100644
index 0000000..6488b54
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testfile.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testfile</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testgamma__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testgamma__Upgraded_.plist
new file mode 100644
index 0000000..6a6b5af
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testgamma__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testgamma</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testgl__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testgl__Upgraded_.plist
new file mode 100644
index 0000000..eecc9cc
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testgl__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testgl</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testiconv.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testiconv.plist
new file mode 100644
index 0000000..0ff003f
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testiconv.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testiconv</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testjoystick__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testjoystick__Upgraded_.plist
new file mode 100644
index 0000000..ef2e274
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testjoystick__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testjoystick</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testkeys__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testkeys__Upgraded_.plist
new file mode 100644
index 0000000..03eba70
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testkeys__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testkeys</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testlock__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testlock__Upgraded_.plist
new file mode 100644
index 0000000..50b71f2
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testlock__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testlock</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testoverlay2.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testoverlay2.plist
new file mode 100644
index 0000000..664e0ce
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testoverlay2.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testoverlay2</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testoverlay__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testoverlay__Upgraded_.plist
new file mode 100644
index 0000000..a7a8a77
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testoverlay__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string></string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testpalette__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testpalette__Upgraded_.plist
new file mode 100644
index 0000000..a08947e
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testpalette__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testpalette</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testplatform.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testplatform.plist
new file mode 100644
index 0000000..9b60de2
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testplatform.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testplatform</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testsem__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testsem__Upgraded_.plist
new file mode 100644
index 0000000..69235fe
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testsem__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testsem</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testsprite__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testsprite__Upgraded_.plist
new file mode 100644
index 0000000..91739c1
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testsprite__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testsprite</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testthread__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testthread__Upgraded_.plist
new file mode 100644
index 0000000..30147f0
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testthread__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testthread</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testtimer__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testtimer__Upgraded_.plist
new file mode 100644
index 0000000..a143244
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testtimer__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testtimer</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testtypes__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testtypes__Upgraded_.plist
new file mode 100644
index 0000000..f16490c
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testtypes__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testtypes</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testversion__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testversion__Upgraded_.plist
new file mode 100644
index 0000000..ba635f7
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testversion__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testversion</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testvidinfo__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testvidinfo__Upgraded_.plist
new file mode 100644
index 0000000..35f13b4
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testvidinfo__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testvidinfo</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testwin__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testwin__Upgraded_.plist
new file mode 100644
index 0000000..f0e91c6
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testwin__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testwin</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testwm__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testwm__Upgraded_.plist
new file mode 100644
index 0000000..9979ee4
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-testwm__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>testwm</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-threadwin__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-threadwin__Upgraded_.plist
new file mode 100644
index 0000000..721763d
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-threadwin__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>threadwin</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/Info-torturethread__Upgraded_.plist b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-torturethread__Upgraded_.plist
new file mode 100644
index 0000000..3433469
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/Info-torturethread__Upgraded_.plist
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>torturethread</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain.nib</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj b/distrib/sdl-1.2.15/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj
new file mode 100755
index 0000000..938d60f
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj
@@ -0,0 +1,4514 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 42;
+ objects = {
+
+/* Begin PBXAggregateTarget section */
+ BEC566920761D90300A33029 /* All */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = 001B599808BDB826006539E9 /* Build configuration list for PBXAggregateTarget "All" */;
+ buildPhases = (
+ );
+ dependencies = (
+ 003FA6A809400236000C53B3 /* PBXTargetDependency */,
+ BEC568010761D90600A33029 /* PBXTargetDependency */,
+ BEC568030761D90600A33029 /* PBXTargetDependency */,
+ BEC568050761D90600A33029 /* PBXTargetDependency */,
+ BEC568070761D90600A33029 /* PBXTargetDependency */,
+ BEC568090761D90600A33029 /* PBXTargetDependency */,
+ 002F347909CA215600EBEB88 /* PBXTargetDependency */,
+ BEC5680B0761D90600A33029 /* PBXTargetDependency */,
+ 002F347B09CA215600EBEB88 /* PBXTargetDependency */,
+ BEC5680D0761D90600A33029 /* PBXTargetDependency */,
+ 002F347D09CA215600EBEB88 /* PBXTargetDependency */,
+ BEC5680F0761D90600A33029 /* PBXTargetDependency */,
+ BEC568110761D90600A33029 /* PBXTargetDependency */,
+ 002F347F09CA215600EBEB88 /* PBXTargetDependency */,
+ BEC568150761D90600A33029 /* PBXTargetDependency */,
+ BEC568170761D90600A33029 /* PBXTargetDependency */,
+ BEC568190761D90600A33029 /* PBXTargetDependency */,
+ 002F348109CA215600EBEB88 /* PBXTargetDependency */,
+ 002F348309CA215600EBEB88 /* PBXTargetDependency */,
+ BEC5681B0761D90600A33029 /* PBXTargetDependency */,
+ 002F348509CA215600EBEB88 /* PBXTargetDependency */,
+ BEC5681D0761D90600A33029 /* PBXTargetDependency */,
+ BEC5681F0761D90600A33029 /* PBXTargetDependency */,
+ BEC568130761D90600A33029 /* PBXTargetDependency */,
+ BEC568210761D90600A33029 /* PBXTargetDependency */,
+ BEC568250761D90600A33029 /* PBXTargetDependency */,
+ BEC568270761D90600A33029 /* PBXTargetDependency */,
+ BEC568290761D90600A33029 /* PBXTargetDependency */,
+ BEC5682B0761D90600A33029 /* PBXTargetDependency */,
+ BEC5682D0761D90600A33029 /* PBXTargetDependency */,
+ BEC5682F0761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = All;
+ productName = "Build All";
+ };
+/* End PBXAggregateTarget section */
+
+/* Begin PBXBuildFile section */
+ 002F337509CA14F900EBEB88 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ 002F337909CA14F900EBEB88 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ 002F337A09CA14F900EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 002F338B09CA16BF00EBEB88 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ 002F338F09CA16BF00EBEB88 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ 002F339009CA16BF00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 002F339B09CA17BC00EBEB88 /* testblitspeed.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F339A09CA17BC00EBEB88 /* testblitspeed.c */; };
+ 002F33A809CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33A909CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33AA09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33AB09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33AC09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33AD09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33AE09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33AF09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33B009CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33B109CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33B209CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33B309CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33B409CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33B509CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33B609CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33B709CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33B809CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33B909CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33BA09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33BB09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33BC09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33BD09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33BE09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33BF09CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33C009CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33C109CA188600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33CF09CA19A600EBEB88 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ 002F33D209CA19A600EBEB88 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ 002F33D309CA19A600EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 002F33D409CA19A600EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F33E309CA1A0B00EBEB88 /* testdyngl.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F33E209CA1A0B00EBEB88 /* testdyngl.c */; };
+ 002F340609CA1BFF00EBEB88 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ 002F340909CA1BFF00EBEB88 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ 002F340A09CA1BFF00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 002F340B09CA1BFF00EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F341809CA1C5B00EBEB88 /* testfile.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F341709CA1C5B00EBEB88 /* testfile.c */; };
+ 002F342509CA1F0300EBEB88 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ 002F342809CA1F0300EBEB88 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ 002F342909CA1F0300EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 002F342A09CA1F0300EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F343709CA1F6F00EBEB88 /* testiconv.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F343609CA1F6F00EBEB88 /* testiconv.c */; };
+ 002F344109CA1FB300EBEB88 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ 002F344409CA1FB300EBEB88 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ 002F344509CA1FB300EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 002F344609CA1FB300EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F345409CA202000EBEB88 /* testoverlay2.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F345209CA201C00EBEB88 /* testoverlay2.c */; };
+ 002F345E09CA204F00EBEB88 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ 002F346109CA204F00EBEB88 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ 002F346209CA204F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 002F346309CA204F00EBEB88 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F33A709CA188600EBEB88 /* Cocoa.framework */; };
+ 002F347009CA20A600EBEB88 /* testplatform.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F346F09CA20A600EBEB88 /* testplatform.c */; };
+ 003FA64D093FFDB3000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA64E093FFDB5000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA64F093FFDB7000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA650093FFDBA000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA651093FFDBC000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA652093FFDBE000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA653093FFDC1000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA654093FFDC3000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA655093FFDC6000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA656093FFDC8000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA657093FFDCA000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA658093FFDCC000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA659093FFDCF000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA65A093FFDD1000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA65B093FFDD3000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA65C093FFDD5000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA65D093FFDD7000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA65E093FFDDA000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA660093FFDDF000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA661093FFDE1000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA662093FFDE3000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA663093FFDE6000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA664093FFDE8000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 003FA665093FFDEA000C53B3 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 003FA643093FFD41000C53B3 /* SDL.framework */; };
+ 00794DD909D1F894003FC8A1 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00794DD809D1F894003FC8A1 /* OpenGL.framework */; };
+ 00794E6609D20865003FC8A1 /* sample.wav in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6209D20839003FC8A1 /* sample.wav */; };
+ 00794EA209D2344B003FC8A1 /* icon.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5D09D20839003FC8A1 /* icon.bmp */; };
+ 00794EB709D235F5003FC8A1 /* sample.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6109D20839003FC8A1 /* sample.bmp */; };
+ 00794EE709D236ED003FC8A1 /* sample.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6109D20839003FC8A1 /* sample.bmp */; };
+ 00794EF009D23739003FC8A1 /* utf8.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6309D20839003FC8A1 /* utf8.txt */; };
+ 00794EF709D237DE003FC8A1 /* moose.dat in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5E09D20839003FC8A1 /* moose.dat */; };
+ 00794EFE09D2382B003FC8A1 /* sail.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6009D20839003FC8A1 /* sail.bmp */; };
+ 00794F0409D23869003FC8A1 /* icon.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5D09D20839003FC8A1 /* icon.bmp */; };
+ 00794F0B09D238F4003FC8A1 /* sample.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6109D20839003FC8A1 /* sample.bmp */; };
+ 00794F1109D2392B003FC8A1 /* icon.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5D09D20839003FC8A1 /* icon.bmp */; };
+ 00794F8709D2413B003FC8A1 /* sample.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E6109D20839003FC8A1 /* sample.bmp */; };
+ BEC566AF0761D90300A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC566B10761D90300A33029 /* checkkeys.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D10FFB30A2C7F000001 /* checkkeys.c */; };
+ BEC566BC0761D90300A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC566BE0761D90300A33029 /* graywin.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D1BFFB30C237F000001 /* graywin.c */; };
+ BEC566C90761D90300A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC566CB0761D90300A33029 /* loopwave.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4872006D84C97F000001 /* loopwave.c */; };
+ BEC566D70761D90300A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC566D90761D90300A33029 /* testalpha.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4874006D84F77F000001 /* testalpha.c */; };
+ BEC566E50761D90300A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC566E70761D90300A33029 /* testbitmap.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D25FFB30D1A7F000001 /* testbitmap.c */; };
+ BEC566F20761D90300A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC566F40761D90300A33029 /* testcdrom.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4876006D85297F000001 /* testcdrom.c */; };
+ BEC566FF0761D90300A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC567010761D90300A33029 /* testerror.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4878006D85357F000001 /* testerror.c */; };
+ BEC5670C0761D90400A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC5670E0761D90400A33029 /* testgamma.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E487A006D85477F000001 /* testgamma.c */; };
+ BEC5671A0761D90400A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC5671C0761D90400A33029 /* testgl.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D4EFFB311087F000001 /* testgl.c */; };
+ BEC567270761D90400A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC567290761D90400A33029 /* testhread.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D58FFB311A97F000001 /* testhread.c */; };
+ BEC567340761D90400A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC567360761D90400A33029 /* testjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D62FFB312AA7F000001 /* testjoystick.c */; };
+ BEC567410761D90400A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC567430761D90400A33029 /* testkeys.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D6CFFB313437F000001 /* testkeys.c */; };
+ BEC5674E0761D90400A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC567500761D90400A33029 /* testlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 092D6D75FFB313BB7F000001 /* testlock.c */; };
+ BEC5675D0761D90400A33029 /* testoverlay.c in Sources */ = {isa = PBXBuildFile; fileRef = F57DC39802A6E6A201D28762 /* testoverlay.c */; };
+ BEC567680761D90400A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC5676A0761D90400A33029 /* testpalette.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E487C006D856B7F000001 /* testpalette.c */; };
+ BEC567760761D90500A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC567780761D90500A33029 /* testsem.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E487E006D86A17F000001 /* testsem.c */; };
+ BEC567830761D90500A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC567850761D90500A33029 /* testsprite.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E487F006D86A17F000001 /* testsprite.c */; };
+ BEC567910761D90500A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC567930761D90500A33029 /* testtimer.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4880006D86A17F000001 /* testtimer.c */; };
+ BEC567AB0761D90500A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC567AD0761D90500A33029 /* testver.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4882006D86A17F000001 /* testver.c */; };
+ BEC567B80761D90500A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC567BA0761D90500A33029 /* testvidinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4883006D86A17F000001 /* testvidinfo.c */; };
+ BEC567C50761D90500A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC567C70761D90500A33029 /* testwin.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4884006D86A17F000001 /* testwin.c */; };
+ BEC567D30761D90500A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC567D50761D90500A33029 /* testwm.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4885006D86A17F000001 /* testwm.c */; };
+ BEC567E10761D90600A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC567E30761D90600A33029 /* threadwin.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4886006D86A17F000001 /* threadwin.c */; };
+ BEC567EE0761D90600A33029 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */; };
+ BEC567F00761D90600A33029 /* torturethread.c in Sources */ = {isa = PBXBuildFile; fileRef = 083E4887006D86A17F000001 /* torturethread.c */; };
+ BEC567F90761D90600A33029 /* SDLMain.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EECDF3B0086C5EA7F000001 /* SDLMain.h */; };
+ BEC567FA0761D90600A33029 /* libsdlmain_prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = B207FF2404E1B19600A80002 /* libsdlmain_prefix.h */; };
+ BEC567FC0761D90600A33029 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EECDF3C0086C5EA7F000001 /* SDLMain.m */; };
+ BEC568620761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC568630761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC568640761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC568650761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC568660761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC568670761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC568680761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC568690761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC5686A0761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC5686B0761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC5686C0761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC5686D0761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC5686E0761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC5686F0761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC568700761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC568710761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC568720761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC568730761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC568750761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC568760761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC568770761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC568780761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC568790761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+ BEC5687A0761D90600A33029 /* libsdlmain.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC567FF0761D90600A33029 /* libsdlmain.a */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 002F337209CA14F900EBEB88 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ 002F338809CA16BF00EBEB88 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ 002F33CC09CA19A600EBEB88 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ 002F340309CA1BFF00EBEB88 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ 002F342209CA1F0300EBEB88 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ 002F343E09CA1FB300EBEB88 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ 002F345B09CA204F00EBEB88 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ 002F347809CA215600EBEB88 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 002F338609CA16BF00EBEB88;
+ remoteInfo = testblitspeed;
+ };
+ 002F347A09CA215600EBEB88 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 002F33CA09CA19A600EBEB88;
+ remoteInfo = testdyngl;
+ };
+ 002F347C09CA215600EBEB88 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 002F340109CA1BFF00EBEB88;
+ remoteInfo = testfile;
+ };
+ 002F347E09CA215600EBEB88 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 002F342009CA1F0300EBEB88;
+ remoteInfo = testiconv;
+ };
+ 002F348009CA215600EBEB88 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567570761D90400A33029;
+ remoteInfo = "testoverlay (Upgraded)";
+ };
+ 002F348209CA215600EBEB88 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 002F343C09CA1FB300EBEB88;
+ remoteInfo = testoverlay2;
+ };
+ 002F348409CA215600EBEB88 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 002F345909CA204F00EBEB88;
+ remoteInfo = testplatform;
+ };
+ 003FA642093FFD41000C53B3 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = BECDF66C0761BA81005FE872;
+ remoteInfo = Framework;
+ };
+ 003FA644093FFD41000C53B3 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = BECDF6B30761BA81005FE872;
+ remoteInfo = "Static Library";
+ };
+ 003FA646093FFD41000C53B3 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = BECDF6BA0761BA81005FE872;
+ remoteInfo = "Main Library";
+ };
+ 003FA648093FFD41000C53B3 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = BECDF6BE0761BA81005FE872;
+ remoteInfo = "Standard DMG";
+ };
+ 003FA64A093FFD41000C53B3 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */;
+ proxyType = 2;
+ remoteGlobalIDString = BECDF6C30761BA81005FE872;
+ remoteInfo = "Devel Extras Package";
+ };
+ 003FA6A709400236000C53B3 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = BECDF5FE0761BA81005FE872;
+ remoteInfo = Framework;
+ };
+ BEC568000761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC566AB0761D90300A33029;
+ remoteInfo = "checkkeys (Upgraded)";
+ };
+ BEC568020761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC566B80761D90300A33029;
+ remoteInfo = "graywin (Upgraded)";
+ };
+ BEC568040761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC566C50761D90300A33029;
+ remoteInfo = "loopwave (Upgraded)";
+ };
+ BEC568060761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC566D30761D90300A33029;
+ remoteInfo = "testalpha (Upgraded)";
+ };
+ BEC568080761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC566E10761D90300A33029;
+ remoteInfo = "testbitmap (Upgraded)";
+ };
+ BEC5680A0761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC566EE0761D90300A33029;
+ remoteInfo = "testcdrom (Upgraded)";
+ };
+ BEC5680C0761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC566FB0761D90300A33029;
+ remoteInfo = "testerror (Upgraded)";
+ };
+ BEC5680E0761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567080761D90400A33029;
+ remoteInfo = "testgamma (Upgraded)";
+ };
+ BEC568100761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567160761D90400A33029;
+ remoteInfo = "testgl (Upgraded)";
+ };
+ BEC568120761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567230761D90400A33029;
+ remoteInfo = "testthread (Upgraded)";
+ };
+ BEC568140761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567300761D90400A33029;
+ remoteInfo = "testjoystick (Upgraded)";
+ };
+ BEC568160761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC5673D0761D90400A33029;
+ remoteInfo = "testkeys (Upgraded)";
+ };
+ BEC568180761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC5674A0761D90400A33029;
+ remoteInfo = "testlock (Upgraded)";
+ };
+ BEC5681A0761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567640761D90400A33029;
+ remoteInfo = "testpalette (Upgraded)";
+ };
+ BEC5681C0761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567720761D90500A33029;
+ remoteInfo = "testsem (Upgraded)";
+ };
+ BEC5681E0761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC5677F0761D90500A33029;
+ remoteInfo = "testsprite (Upgraded)";
+ };
+ BEC568200761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC5678D0761D90500A33029;
+ remoteInfo = "testtimer (Upgraded)";
+ };
+ BEC568240761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567A70761D90500A33029;
+ remoteInfo = "testversion (Upgraded)";
+ };
+ BEC568260761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567B40761D90500A33029;
+ remoteInfo = "testvidinfo (Upgraded)";
+ };
+ BEC568280761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567C10761D90500A33029;
+ remoteInfo = "testwin (Upgraded)";
+ };
+ BEC5682A0761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567CF0761D90500A33029;
+ remoteInfo = "testwm (Upgraded)";
+ };
+ BEC5682C0761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567DD0761D90600A33029;
+ remoteInfo = "threadwin (Upgraded)";
+ };
+ BEC5682E0761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567EA0761D90600A33029;
+ remoteInfo = "torturethread (Upgraded)";
+ };
+ BEC568300761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC568320761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC568340761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC568360761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC568380761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC5683A0761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC5683C0761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC5683E0761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC568400761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC568420761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC568440761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC568460761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC568480761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC5684A0761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC5684C0761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC5684E0761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC568500761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC568520761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC568560761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC568580761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC5685A0761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC5685C0761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC5685E0761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+ BEC568600761D90600A33029 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BEC567F70761D90600A33029;
+ remoteInfo = "libsdlmain.a (Upgraded)";
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 00794E6409D2084F003FC8A1 /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 16;
+ files = (
+ 00794E6609D20865003FC8A1 /* sample.wav in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 00794EA009D2343A003FC8A1 /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 16;
+ files = (
+ 00794EA209D2344B003FC8A1 /* icon.bmp in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 00794EA909D234E8003FC8A1 /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 16;
+ files = (
+ 00794EB709D235F5003FC8A1 /* sample.bmp in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 00794EE509D236E4003FC8A1 /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 16;
+ files = (
+ 00794EE709D236ED003FC8A1 /* sample.bmp in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 00794EEC09D2371F003FC8A1 /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 16;
+ files = (
+ 00794EF009D23739003FC8A1 /* utf8.txt in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 00794EF409D237C7003FC8A1 /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 16;
+ files = (
+ 00794EF709D237DE003FC8A1 /* moose.dat in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 00794EFC09D2381C003FC8A1 /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 16;
+ files = (
+ 00794EFE09D2382B003FC8A1 /* sail.bmp in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 00794F0209D2385F003FC8A1 /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 16;
+ files = (
+ 00794F0409D23869003FC8A1 /* icon.bmp in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 00794F0909D238E3003FC8A1 /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 16;
+ files = (
+ 00794F0B09D238F4003FC8A1 /* sample.bmp in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 00794F0F09D23923003FC8A1 /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 16;
+ files = (
+ 00794F1109D2392B003FC8A1 /* icon.bmp in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 00794F6109D24125003FC8A1 /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 16;
+ files = (
+ 00794F8709D2413B003FC8A1 /* sample.bmp in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 002F338109CA14F900EBEB88 /* test.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = test.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 002F339709CA16BF00EBEB88 /* testblitspeed.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testblitspeed.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 002F339A09CA17BC00EBEB88 /* testblitspeed.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testblitspeed.c; path = ../../test/testblitspeed.c; sourceTree = SOURCE_ROOT; };
+ 002F33A709CA188600EBEB88 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ 002F33DB09CA19A600EBEB88 /* testdyngl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testdyngl.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 002F33E209CA1A0B00EBEB88 /* testdyngl.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testdyngl.c; path = ../../test/testdyngl.c; sourceTree = SOURCE_ROOT; };
+ 002F341209CA1BFF00EBEB88 /* testfile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testfile.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 002F341709CA1C5B00EBEB88 /* testfile.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testfile.c; path = ../../test/testfile.c; sourceTree = SOURCE_ROOT; };
+ 002F343109CA1F0300EBEB88 /* testiconv.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testiconv.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 002F343609CA1F6F00EBEB88 /* testiconv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testiconv.c; path = ../../test/testiconv.c; sourceTree = SOURCE_ROOT; };
+ 002F344D09CA1FB300EBEB88 /* testoverlay2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testoverlay2.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 002F345209CA201C00EBEB88 /* testoverlay2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testoverlay2.c; path = ../../test/testoverlay2.c; sourceTree = SOURCE_ROOT; };
+ 002F346A09CA204F00EBEB88 /* testplatform.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testplatform.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 002F346F09CA20A600EBEB88 /* testplatform.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testplatform.c; path = ../../test/testplatform.c; sourceTree = SOURCE_ROOT; };
+ 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL.xcodeproj; path = ../SDL/SDL.xcodeproj; sourceTree = SOURCE_ROOT; };
+ 00794DD809D1F894003FC8A1 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
+ 00794E5D09D20839003FC8A1 /* icon.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = icon.bmp; path = ../../test/icon.bmp; sourceTree = SOURCE_ROOT; };
+ 00794E5E09D20839003FC8A1 /* moose.dat */ = {isa = PBXFileReference; lastKnownFileType = file; name = moose.dat; path = ../../test/moose.dat; sourceTree = SOURCE_ROOT; };
+ 00794E5F09D20839003FC8A1 /* picture.xbm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = picture.xbm; path = ../../test/picture.xbm; sourceTree = SOURCE_ROOT; };
+ 00794E6009D20839003FC8A1 /* sail.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = sail.bmp; path = ../../test/sail.bmp; sourceTree = SOURCE_ROOT; };
+ 00794E6109D20839003FC8A1 /* sample.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = sample.bmp; path = ../../test/sample.bmp; sourceTree = SOURCE_ROOT; };
+ 00794E6209D20839003FC8A1 /* sample.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = sample.wav; path = ../../test/sample.wav; sourceTree = SOURCE_ROOT; };
+ 00794E6309D20839003FC8A1 /* utf8.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = utf8.txt; path = ../../test/utf8.txt; sourceTree = SOURCE_ROOT; };
+ 083E4872006D84C97F000001 /* loopwave.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = loopwave.c; path = ../../test/loopwave.c; sourceTree = SOURCE_ROOT; };
+ 083E4874006D84F77F000001 /* testalpha.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testalpha.c; path = ../../test/testalpha.c; sourceTree = SOURCE_ROOT; };
+ 083E4876006D85297F000001 /* testcdrom.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testcdrom.c; path = ../../test/testcdrom.c; sourceTree = SOURCE_ROOT; };
+ 083E4878006D85357F000001 /* testerror.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testerror.c; path = ../../test/testerror.c; sourceTree = SOURCE_ROOT; };
+ 083E487A006D85477F000001 /* testgamma.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testgamma.c; path = ../../test/testgamma.c; sourceTree = SOURCE_ROOT; };
+ 083E487C006D856B7F000001 /* testpalette.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testpalette.c; path = ../../test/testpalette.c; sourceTree = SOURCE_ROOT; };
+ 083E487E006D86A17F000001 /* testsem.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testsem.c; path = ../../test/testsem.c; sourceTree = SOURCE_ROOT; };
+ 083E487F006D86A17F000001 /* testsprite.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testsprite.c; path = ../../test/testsprite.c; sourceTree = SOURCE_ROOT; };
+ 083E4880006D86A17F000001 /* testtimer.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testtimer.c; path = ../../test/testtimer.c; sourceTree = SOURCE_ROOT; };
+ 083E4882006D86A17F000001 /* testver.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testver.c; path = ../../test/testver.c; sourceTree = SOURCE_ROOT; };
+ 083E4883006D86A17F000001 /* testvidinfo.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testvidinfo.c; path = ../../test/testvidinfo.c; sourceTree = SOURCE_ROOT; };
+ 083E4884006D86A17F000001 /* testwin.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testwin.c; path = ../../test/testwin.c; sourceTree = SOURCE_ROOT; };
+ 083E4885006D86A17F000001 /* testwm.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testwm.c; path = ../../test/testwm.c; sourceTree = SOURCE_ROOT; };
+ 083E4886006D86A17F000001 /* threadwin.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = threadwin.c; path = ../../test/threadwin.c; sourceTree = SOURCE_ROOT; };
+ 083E4887006D86A17F000001 /* torturethread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = torturethread.c; path = ../../test/torturethread.c; sourceTree = SOURCE_ROOT; };
+ 092D6D10FFB30A2C7F000001 /* checkkeys.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = checkkeys.c; path = ../../test/checkkeys.c; sourceTree = SOURCE_ROOT; };
+ 092D6D1BFFB30C237F000001 /* graywin.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = graywin.c; path = ../../test/graywin.c; sourceTree = SOURCE_ROOT; };
+ 092D6D25FFB30D1A7F000001 /* testbitmap.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testbitmap.c; path = ../../test/testbitmap.c; sourceTree = SOURCE_ROOT; };
+ 092D6D4EFFB311087F000001 /* testgl.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testgl.c; path = ../../test/testgl.c; sourceTree = SOURCE_ROOT; };
+ 092D6D58FFB311A97F000001 /* testhread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testhread.c; path = ../../test/testhread.c; sourceTree = SOURCE_ROOT; };
+ 092D6D62FFB312AA7F000001 /* testjoystick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testjoystick.c; path = ../../test/testjoystick.c; sourceTree = SOURCE_ROOT; };
+ 092D6D6CFFB313437F000001 /* testkeys.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testkeys.c; path = ../../test/testkeys.c; sourceTree = SOURCE_ROOT; };
+ 092D6D75FFB313BB7F000001 /* testlock.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testlock.c; path = ../../test/testlock.c; sourceTree = SOURCE_ROOT; };
+ 2EECDF3B0086C5EA7F000001 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDLMain.h; path = ../../src/main/macosx/SDLMain.h; sourceTree = SOURCE_ROOT; };
+ 2EECDF3C0086C5EA7F000001 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = SDLMain.m; path = ../../src/main/macosx/SDLMain.m; sourceTree = SOURCE_ROOT; };
+ 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = SDLMain.nib; path = ../../src/main/macosx/SDLMain.nib; sourceTree = SOURCE_ROOT; };
+ B207FF2404E1B19600A80002 /* libsdlmain_prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libsdlmain_prefix.h; sourceTree = "<group>"; };
+ BEC566B60761D90300A33029 /* checkkeys.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = checkkeys.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC566C30761D90300A33029 /* graywin.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = graywin.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC566D10761D90300A33029 /* loopwave.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = loopwave.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC566DF0761D90300A33029 /* testalpha.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testalpha.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC566EC0761D90300A33029 /* testbitmap.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testbitmap.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC566F90761D90300A33029 /* testcdrom.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testcdrom.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC567060761D90400A33029 /* testerror.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testerror.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC567140761D90400A33029 /* testgamma.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testgamma.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC567210761D90400A33029 /* testgl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testgl.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC5672E0761D90400A33029 /* testthread.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testthread.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC5673B0761D90400A33029 /* testjoystick.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testjoystick.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC567480761D90400A33029 /* testkeys.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testkeys.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC567550761D90400A33029 /* testlock.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testlock.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC567620761D90400A33029 /* testoverlay.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testoverlay.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC567700761D90500A33029 /* testpalette.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testpalette.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC5677D0761D90500A33029 /* testsem.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testsem.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC5678B0761D90500A33029 /* testsprite.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testsprite.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC567980761D90500A33029 /* testtimer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testtimer.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC567B20761D90500A33029 /* testversion.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testversion.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC567BF0761D90500A33029 /* testvidinfo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testvidinfo.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC567CD0761D90500A33029 /* testwin.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testwin.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC567DB0761D90600A33029 /* testwm.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testwm.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC567E80761D90600A33029 /* threadwin.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = threadwin.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC567F50761D90600A33029 /* torturethread.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = torturethread.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BEC567FF0761D90600A33029 /* libsdlmain.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libsdlmain.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ F57DC39802A6E6A201D28762 /* testoverlay.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = testoverlay.c; path = ../../test/testoverlay.c; sourceTree = SOURCE_ROOT; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 002F337809CA14F900EBEB88 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F337909CA14F900EBEB88 /* libsdlmain.a in Frameworks */,
+ 002F337A09CA14F900EBEB88 /* SDL.framework in Frameworks */,
+ 002F33A909CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F338E09CA16BF00EBEB88 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F338F09CA16BF00EBEB88 /* libsdlmain.a in Frameworks */,
+ 002F339009CA16BF00EBEB88 /* SDL.framework in Frameworks */,
+ 002F33A809CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F33D109CA19A600EBEB88 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F33D209CA19A600EBEB88 /* libsdlmain.a in Frameworks */,
+ 002F33D309CA19A600EBEB88 /* SDL.framework in Frameworks */,
+ 002F33D409CA19A600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F340809CA1BFF00EBEB88 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F340909CA1BFF00EBEB88 /* libsdlmain.a in Frameworks */,
+ 002F340A09CA1BFF00EBEB88 /* SDL.framework in Frameworks */,
+ 002F340B09CA1BFF00EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F342709CA1F0300EBEB88 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F342809CA1F0300EBEB88 /* libsdlmain.a in Frameworks */,
+ 002F342909CA1F0300EBEB88 /* SDL.framework in Frameworks */,
+ 002F342A09CA1F0300EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F344309CA1FB300EBEB88 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F344409CA1FB300EBEB88 /* libsdlmain.a in Frameworks */,
+ 002F344509CA1FB300EBEB88 /* SDL.framework in Frameworks */,
+ 002F344609CA1FB300EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F346009CA204F00EBEB88 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F346109CA204F00EBEB88 /* libsdlmain.a in Frameworks */,
+ 002F346209CA204F00EBEB88 /* SDL.framework in Frameworks */,
+ 002F346309CA204F00EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566B20761D90300A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC568620761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA64D093FFDB3000C53B3 /* SDL.framework in Frameworks */,
+ 002F33C109CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566BF0761D90300A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC568630761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA64E093FFDB5000C53B3 /* SDL.framework in Frameworks */,
+ 002F33C009CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566CC0761D90300A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC568640761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA64F093FFDB7000C53B3 /* SDL.framework in Frameworks */,
+ 002F33BF09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566DA0761D90300A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC568650761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA650093FFDBA000C53B3 /* SDL.framework in Frameworks */,
+ 002F33BE09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566E80761D90300A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC568660761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA651093FFDBC000C53B3 /* SDL.framework in Frameworks */,
+ 002F33BD09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566F50761D90300A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC568670761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA652093FFDBE000C53B3 /* SDL.framework in Frameworks */,
+ 002F33BB09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567020761D90300A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC568680761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA653093FFDC1000C53B3 /* SDL.framework in Frameworks */,
+ 002F33BC09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC5670F0761D90400A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC568690761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA654093FFDC3000C53B3 /* SDL.framework in Frameworks */,
+ 002F33BA09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC5671D0761D90400A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC5686A0761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA655093FFDC6000C53B3 /* SDL.framework in Frameworks */,
+ 002F33B909CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ 00794DD909D1F894003FC8A1 /* OpenGL.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC5672A0761D90400A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC5686B0761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA656093FFDC8000C53B3 /* SDL.framework in Frameworks */,
+ 002F33B809CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567370761D90400A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC5686C0761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA657093FFDCA000C53B3 /* SDL.framework in Frameworks */,
+ 002F33B709CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567440761D90400A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC5686D0761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA658093FFDCC000C53B3 /* SDL.framework in Frameworks */,
+ 002F33B509CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567510761D90400A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC5686E0761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA659093FFDCF000C53B3 /* SDL.framework in Frameworks */,
+ 002F33B609CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC5675E0761D90400A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC5686F0761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA65A093FFDD1000C53B3 /* SDL.framework in Frameworks */,
+ 002F33B409CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC5676B0761D90400A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC568700761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA65B093FFDD3000C53B3 /* SDL.framework in Frameworks */,
+ 002F33B309CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567790761D90500A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC568710761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA65C093FFDD5000C53B3 /* SDL.framework in Frameworks */,
+ 002F33B209CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567860761D90500A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC568720761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA65D093FFDD7000C53B3 /* SDL.framework in Frameworks */,
+ 002F33B109CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567940761D90500A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC568730761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA65E093FFDDA000C53B3 /* SDL.framework in Frameworks */,
+ 002F33B009CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567AE0761D90500A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC568750761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA660093FFDDF000C53B3 /* SDL.framework in Frameworks */,
+ 002F33AF09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567BB0761D90500A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC568760761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA661093FFDE1000C53B3 /* SDL.framework in Frameworks */,
+ 002F33AE09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567C80761D90500A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC568770761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA662093FFDE3000C53B3 /* SDL.framework in Frameworks */,
+ 002F33AD09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567D60761D90500A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC568780761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA663093FFDE6000C53B3 /* SDL.framework in Frameworks */,
+ 002F33AC09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567E40761D90600A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC568790761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA665093FFDEA000C53B3 /* SDL.framework in Frameworks */,
+ 002F33AB09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567F10761D90600A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC5687A0761D90600A33029 /* libsdlmain.a in Frameworks */,
+ 003FA664093FFDE8000C53B3 /* SDL.framework in Frameworks */,
+ 002F33AA09CA188600EBEB88 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567FD0761D90600A33029 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 002F33A209CA183B00EBEB88 /* Linked Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 00794DD809D1F894003FC8A1 /* OpenGL.framework */,
+ 002F33A709CA188600EBEB88 /* Cocoa.framework */,
+ );
+ name = "Linked Frameworks";
+ sourceTree = "<group>";
+ };
+ 003FA63B093FFD41000C53B3 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 003FA643093FFD41000C53B3 /* SDL.framework */,
+ 003FA645093FFD41000C53B3 /* libSDL.a */,
+ 003FA647093FFD41000C53B3 /* libSDLmain.a */,
+ 003FA649093FFD41000C53B3 /* Standard DMG */,
+ 003FA64B093FFD41000C53B3 /* Developer Extras Package */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 00794E4609D207B4003FC8A1 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 00794E5D09D20839003FC8A1 /* icon.bmp */,
+ 00794E5E09D20839003FC8A1 /* moose.dat */,
+ 00794E5F09D20839003FC8A1 /* picture.xbm */,
+ 00794E6009D20839003FC8A1 /* sail.bmp */,
+ 00794E6109D20839003FC8A1 /* sample.bmp */,
+ 00794E6209D20839003FC8A1 /* sample.wav */,
+ 00794E6309D20839003FC8A1 /* utf8.txt */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 08FB7794FE84155DC02AAC07 /* SDLTest */ = {
+ isa = PBXGroup;
+ children = (
+ 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */,
+ 08FB7795FE84155DC02AAC07 /* Source */,
+ 2EECDF3B0086C5EA7F000001 /* SDLMain.h */,
+ 2EECDF3C0086C5EA7F000001 /* SDLMain.m */,
+ B207FF2404E1B19600A80002 /* libsdlmain_prefix.h */,
+ 2EECDF3D0086C5EA7F000001 /* SDLMain.nib */,
+ 002F33A209CA183B00EBEB88 /* Linked Frameworks */,
+ 00794E4609D207B4003FC8A1 /* Resources */,
+ 1AB674ADFE9D54B511CA2CBB /* Products */,
+ );
+ comments = "I made these tests link against our \"default\" framework which includes X11 stuff. If you didn't install the X11 headers with Xcode, you might have problems building the SDL.framework (which is a dependency). You can swap the dependencies around to get around this, or you can modify the default SDL.framework target to not include X11 stuff. (Go into its target build options and remove all the Preprocessor macros.)\n\n\n\nWe are sort of in a half-way state at the moment. Going \"all-the-way\" means we copy the SDL.framework inside the app bundle so we can run the test without the step of the user \"installing\" the framework. But there is an oversight/bug in Xcode that doesn't correctly find the location of the framework when in an embedded/nested Xcode project. We could probably try to hack this with a shell script that checks multiple directories for existence, but this is messier and more work than I prefer, so I rather just wait for Apple to fix this. In the meantime...\n\nThe \"All\" target will build the SDL framework from the Xcode project. The other targets do not have this dependency set (for flexibility reasons in case we make changes). If you have not built the framework, you will probably be unable to link. You will either need to build the framework, or you need to add \"-framework SDL\" to the link options and make sure you have the SDL.framework installed somewhere where it can be seen (like /Library/Frameworks...I think we already set this one up.) \n\nTo run though, you should have a copy of the SDL.framework in /Library/Frameworks or ~/Library/Frameworks.\n\n\n\n\ntestgl and testdyngl need -DHAVE_OPENGL\ntestgl needs to link against OpenGL.framework\n\n";
+ name = SDLTest;
+ sourceTree = "<group>";
+ };
+ 08FB7795FE84155DC02AAC07 /* Source */ = {
+ isa = PBXGroup;
+ children = (
+ 092D6D10FFB30A2C7F000001 /* checkkeys.c */,
+ 092D6D1BFFB30C237F000001 /* graywin.c */,
+ 083E4872006D84C97F000001 /* loopwave.c */,
+ 083E4874006D84F77F000001 /* testalpha.c */,
+ 092D6D25FFB30D1A7F000001 /* testbitmap.c */,
+ 002F339A09CA17BC00EBEB88 /* testblitspeed.c */,
+ 083E4876006D85297F000001 /* testcdrom.c */,
+ 002F33E209CA1A0B00EBEB88 /* testdyngl.c */,
+ 083E4878006D85357F000001 /* testerror.c */,
+ 002F343609CA1F6F00EBEB88 /* testiconv.c */,
+ 002F341709CA1C5B00EBEB88 /* testfile.c */,
+ 083E487A006D85477F000001 /* testgamma.c */,
+ 092D6D4EFFB311087F000001 /* testgl.c */,
+ 092D6D58FFB311A97F000001 /* testhread.c */,
+ 092D6D62FFB312AA7F000001 /* testjoystick.c */,
+ 092D6D6CFFB313437F000001 /* testkeys.c */,
+ 092D6D75FFB313BB7F000001 /* testlock.c */,
+ F57DC39802A6E6A201D28762 /* testoverlay.c */,
+ 002F345209CA201C00EBEB88 /* testoverlay2.c */,
+ 083E487C006D856B7F000001 /* testpalette.c */,
+ 002F346F09CA20A600EBEB88 /* testplatform.c */,
+ 083E487E006D86A17F000001 /* testsem.c */,
+ 083E487F006D86A17F000001 /* testsprite.c */,
+ 083E4880006D86A17F000001 /* testtimer.c */,
+ 083E4882006D86A17F000001 /* testver.c */,
+ 083E4883006D86A17F000001 /* testvidinfo.c */,
+ 083E4884006D86A17F000001 /* testwin.c */,
+ 083E4885006D86A17F000001 /* testwm.c */,
+ 083E4886006D86A17F000001 /* threadwin.c */,
+ 083E4887006D86A17F000001 /* torturethread.c */,
+ );
+ name = Source;
+ sourceTree = "<group>";
+ };
+ 1AB674ADFE9D54B511CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ BEC566B60761D90300A33029 /* checkkeys.app */,
+ BEC566C30761D90300A33029 /* graywin.app */,
+ BEC566D10761D90300A33029 /* loopwave.app */,
+ BEC566DF0761D90300A33029 /* testalpha.app */,
+ BEC566EC0761D90300A33029 /* testbitmap.app */,
+ BEC566F90761D90300A33029 /* testcdrom.app */,
+ BEC567060761D90400A33029 /* testerror.app */,
+ BEC567140761D90400A33029 /* testgamma.app */,
+ BEC567210761D90400A33029 /* testgl.app */,
+ BEC5672E0761D90400A33029 /* testthread.app */,
+ BEC5673B0761D90400A33029 /* testjoystick.app */,
+ BEC567480761D90400A33029 /* testkeys.app */,
+ BEC567550761D90400A33029 /* testlock.app */,
+ BEC567620761D90400A33029 /* testoverlay.app */,
+ BEC567700761D90500A33029 /* testpalette.app */,
+ BEC5677D0761D90500A33029 /* testsem.app */,
+ BEC5678B0761D90500A33029 /* testsprite.app */,
+ BEC567980761D90500A33029 /* testtimer.app */,
+ BEC567B20761D90500A33029 /* testversion.app */,
+ BEC567BF0761D90500A33029 /* testvidinfo.app */,
+ BEC567CD0761D90500A33029 /* testwin.app */,
+ BEC567DB0761D90600A33029 /* testwm.app */,
+ BEC567E80761D90600A33029 /* threadwin.app */,
+ BEC567F50761D90600A33029 /* torturethread.app */,
+ BEC567FF0761D90600A33029 /* libsdlmain.a */,
+ 002F338109CA14F900EBEB88 /* test.app */,
+ 002F339709CA16BF00EBEB88 /* testblitspeed.app */,
+ 002F33DB09CA19A600EBEB88 /* testdyngl.app */,
+ 002F341209CA1BFF00EBEB88 /* testfile.app */,
+ 002F343109CA1F0300EBEB88 /* testiconv.app */,
+ 002F344D09CA1FB300EBEB88 /* testoverlay2.app */,
+ 002F346A09CA204F00EBEB88 /* testplatform.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ 002F337309CA14F900EBEB88 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F338909CA16BF00EBEB88 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F33CD09CA19A600EBEB88 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F340409CA1BFF00EBEB88 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F342309CA1F0300EBEB88 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F343F09CA1FB300EBEB88 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F345C09CA204F00EBEB88 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566AD0761D90300A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566BA0761D90300A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566C70761D90300A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566D50761D90300A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566E30761D90300A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566F00761D90300A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566FD0761D90300A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC5670A0761D90400A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567180761D90400A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567250761D90400A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567320761D90400A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC5673F0761D90400A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC5674C0761D90400A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567590761D90400A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567660761D90400A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567740761D90500A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567810761D90500A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC5678F0761D90500A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567A90761D90500A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567B60761D90500A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567C30761D90500A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567D10761D90500A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567DF0761D90600A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567EC0761D90600A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567F80761D90600A33029 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567F90761D90600A33029 /* SDLMain.h in Headers */,
+ BEC567FA0761D90600A33029 /* libsdlmain_prefix.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ 002F337009CA14F900EBEB88 /* test */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 002F337D09CA14F900EBEB88 /* Build configuration list for PBXNativeTarget "test" */;
+ buildPhases = (
+ 002F337309CA14F900EBEB88 /* Headers */,
+ 002F337409CA14F900EBEB88 /* Resources */,
+ 002F337609CA14F900EBEB88 /* Sources */,
+ 002F337809CA14F900EBEB88 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 002F337109CA14F900EBEB88 /* PBXTargetDependency */,
+ );
+ name = test;
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testalpha;
+ productReference = 002F338109CA14F900EBEB88 /* test.app */;
+ productType = "com.apple.product-type.application";
+ };
+ 002F338609CA16BF00EBEB88 /* testblitspeed */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 002F339309CA16BF00EBEB88 /* Build configuration list for PBXNativeTarget "testblitspeed" */;
+ buildPhases = (
+ 002F338909CA16BF00EBEB88 /* Headers */,
+ 002F338A09CA16BF00EBEB88 /* Resources */,
+ 002F338C09CA16BF00EBEB88 /* Sources */,
+ 002F338E09CA16BF00EBEB88 /* Frameworks */,
+ 00794EA909D234E8003FC8A1 /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 002F338709CA16BF00EBEB88 /* PBXTargetDependency */,
+ );
+ name = testblitspeed;
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testalpha;
+ productReference = 002F339709CA16BF00EBEB88 /* testblitspeed.app */;
+ productType = "com.apple.product-type.application";
+ };
+ 002F33CA09CA19A600EBEB88 /* testdyngl */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 002F33D709CA19A600EBEB88 /* Build configuration list for PBXNativeTarget "testdyngl" */;
+ buildPhases = (
+ 002F33CD09CA19A600EBEB88 /* Headers */,
+ 002F33CE09CA19A600EBEB88 /* Resources */,
+ 002F33D009CA19A600EBEB88 /* Sources */,
+ 002F33D109CA19A600EBEB88 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 002F33CB09CA19A600EBEB88 /* PBXTargetDependency */,
+ );
+ name = testdyngl;
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testalpha;
+ productReference = 002F33DB09CA19A600EBEB88 /* testdyngl.app */;
+ productType = "com.apple.product-type.application";
+ };
+ 002F340109CA1BFF00EBEB88 /* testfile */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 002F340E09CA1BFF00EBEB88 /* Build configuration list for PBXNativeTarget "testfile" */;
+ buildPhases = (
+ 002F340409CA1BFF00EBEB88 /* Headers */,
+ 002F340509CA1BFF00EBEB88 /* Resources */,
+ 002F340709CA1BFF00EBEB88 /* Sources */,
+ 002F340809CA1BFF00EBEB88 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 002F340209CA1BFF00EBEB88 /* PBXTargetDependency */,
+ );
+ name = testfile;
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testalpha;
+ productReference = 002F341209CA1BFF00EBEB88 /* testfile.app */;
+ productType = "com.apple.product-type.application";
+ };
+ 002F342009CA1F0300EBEB88 /* testiconv */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 002F342D09CA1F0300EBEB88 /* Build configuration list for PBXNativeTarget "testiconv" */;
+ buildPhases = (
+ 002F342309CA1F0300EBEB88 /* Headers */,
+ 002F342409CA1F0300EBEB88 /* Resources */,
+ 002F342609CA1F0300EBEB88 /* Sources */,
+ 002F342709CA1F0300EBEB88 /* Frameworks */,
+ 00794EEC09D2371F003FC8A1 /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 002F342109CA1F0300EBEB88 /* PBXTargetDependency */,
+ );
+ name = testiconv;
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testalpha;
+ productReference = 002F343109CA1F0300EBEB88 /* testiconv.app */;
+ productType = "com.apple.product-type.application";
+ };
+ 002F343C09CA1FB300EBEB88 /* testoverlay2 */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 002F344909CA1FB300EBEB88 /* Build configuration list for PBXNativeTarget "testoverlay2" */;
+ buildPhases = (
+ 002F343F09CA1FB300EBEB88 /* Headers */,
+ 002F344009CA1FB300EBEB88 /* Resources */,
+ 002F344209CA1FB300EBEB88 /* Sources */,
+ 002F344309CA1FB300EBEB88 /* Frameworks */,
+ 00794EF409D237C7003FC8A1 /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 002F343D09CA1FB300EBEB88 /* PBXTargetDependency */,
+ );
+ name = testoverlay2;
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testalpha;
+ productReference = 002F344D09CA1FB300EBEB88 /* testoverlay2.app */;
+ productType = "com.apple.product-type.application";
+ };
+ 002F345909CA204F00EBEB88 /* testplatform */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 002F346609CA204F00EBEB88 /* Build configuration list for PBXNativeTarget "testplatform" */;
+ buildPhases = (
+ 002F345C09CA204F00EBEB88 /* Headers */,
+ 002F345D09CA204F00EBEB88 /* Resources */,
+ 002F345F09CA204F00EBEB88 /* Sources */,
+ 002F346009CA204F00EBEB88 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 002F345A09CA204F00EBEB88 /* PBXTargetDependency */,
+ );
+ name = testplatform;
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testalpha;
+ productReference = 002F346A09CA204F00EBEB88 /* testplatform.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC566AB0761D90300A33029 /* checkkeys (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B593808BDB826006539E9 /* Build configuration list for PBXNativeTarget "checkkeys (Upgraded)" */;
+ buildPhases = (
+ BEC566AD0761D90300A33029 /* Headers */,
+ BEC566AE0761D90300A33029 /* Resources */,
+ BEC566B00761D90300A33029 /* Sources */,
+ BEC566B20761D90300A33029 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC568310761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "checkkeys (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = checkkeys;
+ productReference = BEC566B60761D90300A33029 /* checkkeys.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC566B80761D90300A33029 /* graywin (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B593C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "graywin (Upgraded)" */;
+ buildPhases = (
+ BEC566BA0761D90300A33029 /* Headers */,
+ BEC566BB0761D90300A33029 /* Resources */,
+ BEC566BD0761D90300A33029 /* Sources */,
+ BEC566BF0761D90300A33029 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC568330761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "graywin (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = graywin;
+ productReference = BEC566C30761D90300A33029 /* graywin.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC566C50761D90300A33029 /* loopwave (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B594008BDB826006539E9 /* Build configuration list for PBXNativeTarget "loopwave (Upgraded)" */;
+ buildPhases = (
+ BEC566C70761D90300A33029 /* Headers */,
+ BEC566C80761D90300A33029 /* Resources */,
+ BEC566CA0761D90300A33029 /* Sources */,
+ BEC566CC0761D90300A33029 /* Frameworks */,
+ 00794E6409D2084F003FC8A1 /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC568350761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "loopwave (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = loopwave;
+ productReference = BEC566D10761D90300A33029 /* loopwave.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC566D30761D90300A33029 /* testalpha (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B594408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testalpha (Upgraded)" */;
+ buildPhases = (
+ BEC566D50761D90300A33029 /* Headers */,
+ BEC566D60761D90300A33029 /* Resources */,
+ BEC566D80761D90300A33029 /* Sources */,
+ BEC566DA0761D90300A33029 /* Frameworks */,
+ 00794EA009D2343A003FC8A1 /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC568370761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "testalpha (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testalpha;
+ productReference = BEC566DF0761D90300A33029 /* testalpha.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC566E10761D90300A33029 /* testbitmap (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B594808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testbitmap (Upgraded)" */;
+ buildPhases = (
+ BEC566E30761D90300A33029 /* Headers */,
+ BEC566E40761D90300A33029 /* Resources */,
+ BEC566E60761D90300A33029 /* Sources */,
+ BEC566E80761D90300A33029 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC568390761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "testbitmap (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testbitmap;
+ productReference = BEC566EC0761D90300A33029 /* testbitmap.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC566EE0761D90300A33029 /* testcdrom (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B594C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testcdrom (Upgraded)" */;
+ buildPhases = (
+ BEC566F00761D90300A33029 /* Headers */,
+ BEC566F10761D90300A33029 /* Resources */,
+ BEC566F30761D90300A33029 /* Sources */,
+ BEC566F50761D90300A33029 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC5683B0761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "testcdrom (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testcdrom;
+ productReference = BEC566F90761D90300A33029 /* testcdrom.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC566FB0761D90300A33029 /* testerror (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B595008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testerror (Upgraded)" */;
+ buildPhases = (
+ BEC566FD0761D90300A33029 /* Headers */,
+ BEC566FE0761D90300A33029 /* Resources */,
+ BEC567000761D90300A33029 /* Sources */,
+ BEC567020761D90300A33029 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC5683D0761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "testerror (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testerror;
+ productReference = BEC567060761D90400A33029 /* testerror.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC567080761D90400A33029 /* testgamma (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B595408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testgamma (Upgraded)" */;
+ buildPhases = (
+ BEC5670A0761D90400A33029 /* Headers */,
+ BEC5670B0761D90400A33029 /* Resources */,
+ BEC5670D0761D90400A33029 /* Sources */,
+ BEC5670F0761D90400A33029 /* Frameworks */,
+ 00794EE509D236E4003FC8A1 /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC5683F0761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "testgamma (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testgamma;
+ productReference = BEC567140761D90400A33029 /* testgamma.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC567160761D90400A33029 /* testgl (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B595808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testgl (Upgraded)" */;
+ buildPhases = (
+ BEC567180761D90400A33029 /* Headers */,
+ BEC567190761D90400A33029 /* Resources */,
+ BEC5671B0761D90400A33029 /* Sources */,
+ BEC5671D0761D90400A33029 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC568410761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "testgl (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testgl;
+ productReference = BEC567210761D90400A33029 /* testgl.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC567230761D90400A33029 /* testthread (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B595C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testthread (Upgraded)" */;
+ buildPhases = (
+ BEC567250761D90400A33029 /* Headers */,
+ BEC567260761D90400A33029 /* Resources */,
+ BEC567280761D90400A33029 /* Sources */,
+ BEC5672A0761D90400A33029 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC568430761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "testthread (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testthread;
+ productReference = BEC5672E0761D90400A33029 /* testthread.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC567300761D90400A33029 /* testjoystick (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B596008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testjoystick (Upgraded)" */;
+ buildPhases = (
+ BEC567320761D90400A33029 /* Headers */,
+ BEC567330761D90400A33029 /* Resources */,
+ BEC567350761D90400A33029 /* Sources */,
+ BEC567370761D90400A33029 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC568450761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "testjoystick (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testjoystick;
+ productReference = BEC5673B0761D90400A33029 /* testjoystick.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC5673D0761D90400A33029 /* testkeys (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B596408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testkeys (Upgraded)" */;
+ buildPhases = (
+ BEC5673F0761D90400A33029 /* Headers */,
+ BEC567400761D90400A33029 /* Resources */,
+ BEC567420761D90400A33029 /* Sources */,
+ BEC567440761D90400A33029 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC568470761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "testkeys (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testkeys;
+ productReference = BEC567480761D90400A33029 /* testkeys.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC5674A0761D90400A33029 /* testlock (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B596808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testlock (Upgraded)" */;
+ buildPhases = (
+ BEC5674C0761D90400A33029 /* Headers */,
+ BEC5674D0761D90400A33029 /* Resources */,
+ BEC5674F0761D90400A33029 /* Sources */,
+ BEC567510761D90400A33029 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC568490761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "testlock (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testlock;
+ productReference = BEC567550761D90400A33029 /* testlock.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC567570761D90400A33029 /* testoverlay (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B599C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testoverlay (Upgraded)" */;
+ buildPhases = (
+ BEC567590761D90400A33029 /* Headers */,
+ BEC5675A0761D90400A33029 /* Resources */,
+ BEC5675C0761D90400A33029 /* Sources */,
+ BEC5675E0761D90400A33029 /* Frameworks */,
+ 00794F6109D24125003FC8A1 /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC5684B0761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "testoverlay (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testoverlay;
+ productReference = BEC567620761D90400A33029 /* testoverlay.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC567640761D90400A33029 /* testpalette (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B596C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testpalette (Upgraded)" */;
+ buildPhases = (
+ BEC567660761D90400A33029 /* Headers */,
+ BEC567670761D90400A33029 /* Resources */,
+ BEC567690761D90400A33029 /* Sources */,
+ BEC5676B0761D90400A33029 /* Frameworks */,
+ 00794EFC09D2381C003FC8A1 /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC5684D0761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "testpalette (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testpalette;
+ productReference = BEC567700761D90500A33029 /* testpalette.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC567720761D90500A33029 /* testsem (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B597008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testsem (Upgraded)" */;
+ buildPhases = (
+ BEC567740761D90500A33029 /* Headers */,
+ BEC567750761D90500A33029 /* Resources */,
+ BEC567770761D90500A33029 /* Sources */,
+ BEC567790761D90500A33029 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC5684F0761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "testsem (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testsem;
+ productReference = BEC5677D0761D90500A33029 /* testsem.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC5677F0761D90500A33029 /* testsprite (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B597408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testsprite (Upgraded)" */;
+ buildPhases = (
+ BEC567810761D90500A33029 /* Headers */,
+ BEC567820761D90500A33029 /* Resources */,
+ BEC567840761D90500A33029 /* Sources */,
+ BEC567860761D90500A33029 /* Frameworks */,
+ 00794F0209D2385F003FC8A1 /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC568510761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "testsprite (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testsprite;
+ productReference = BEC5678B0761D90500A33029 /* testsprite.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC5678D0761D90500A33029 /* testtimer (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B597808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testtimer (Upgraded)" */;
+ buildPhases = (
+ BEC5678F0761D90500A33029 /* Headers */,
+ BEC567900761D90500A33029 /* Resources */,
+ BEC567920761D90500A33029 /* Sources */,
+ BEC567940761D90500A33029 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC568530761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "testtimer (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testtimer;
+ productReference = BEC567980761D90500A33029 /* testtimer.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC567A70761D90500A33029 /* testversion (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B598008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testversion (Upgraded)" */;
+ buildPhases = (
+ BEC567A90761D90500A33029 /* Headers */,
+ BEC567AA0761D90500A33029 /* Resources */,
+ BEC567AC0761D90500A33029 /* Sources */,
+ BEC567AE0761D90500A33029 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC568570761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "testversion (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testversion;
+ productReference = BEC567B20761D90500A33029 /* testversion.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC567B40761D90500A33029 /* testvidinfo (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B598408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testvidinfo (Upgraded)" */;
+ buildPhases = (
+ BEC567B60761D90500A33029 /* Headers */,
+ BEC567B70761D90500A33029 /* Resources */,
+ BEC567B90761D90500A33029 /* Sources */,
+ BEC567BB0761D90500A33029 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC568590761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "testvidinfo (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testvidinfo;
+ productReference = BEC567BF0761D90500A33029 /* testvidinfo.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC567C10761D90500A33029 /* testwin (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B598808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testwin (Upgraded)" */;
+ buildPhases = (
+ BEC567C30761D90500A33029 /* Headers */,
+ BEC567C40761D90500A33029 /* Resources */,
+ BEC567C60761D90500A33029 /* Sources */,
+ BEC567C80761D90500A33029 /* Frameworks */,
+ 00794F0909D238E3003FC8A1 /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC5685B0761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "testwin (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testwin;
+ productReference = BEC567CD0761D90500A33029 /* testwin.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC567CF0761D90500A33029 /* testwm (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B598C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testwm (Upgraded)" */;
+ buildPhases = (
+ BEC567D10761D90500A33029 /* Headers */,
+ BEC567D20761D90500A33029 /* Resources */,
+ BEC567D40761D90500A33029 /* Sources */,
+ BEC567D60761D90500A33029 /* Frameworks */,
+ 00794F0F09D23923003FC8A1 /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC5685D0761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "testwm (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = testwm;
+ productReference = BEC567DB0761D90600A33029 /* testwm.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC567DD0761D90600A33029 /* threadwin (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B599008BDB826006539E9 /* Build configuration list for PBXNativeTarget "threadwin (Upgraded)" */;
+ buildPhases = (
+ BEC567DF0761D90600A33029 /* Headers */,
+ BEC567E00761D90600A33029 /* Resources */,
+ BEC567E20761D90600A33029 /* Sources */,
+ BEC567E40761D90600A33029 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC5685F0761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "threadwin (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = threadwin;
+ productReference = BEC567E80761D90600A33029 /* threadwin.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC567EA0761D90600A33029 /* torturethread (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B599408BDB826006539E9 /* Build configuration list for PBXNativeTarget "torturethread (Upgraded)" */;
+ buildPhases = (
+ BEC567EC0761D90600A33029 /* Headers */,
+ BEC567ED0761D90600A33029 /* Resources */,
+ BEC567EF0761D90600A33029 /* Sources */,
+ BEC567F10761D90600A33029 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BEC568610761D90600A33029 /* PBXTargetDependency */,
+ );
+ name = "torturethread (Upgraded)";
+ productInstallPath = "$(USER_APPS_DIR)";
+ productName = tortureThread;
+ productReference = BEC567F50761D90600A33029 /* torturethread.app */;
+ productType = "com.apple.product-type.application";
+ };
+ BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 001B593408BDB826006539E9 /* Build configuration list for PBXNativeTarget "libsdlmain.a (Upgraded)" */;
+ buildPhases = (
+ BEC567F80761D90600A33029 /* Headers */,
+ BEC567FB0761D90600A33029 /* Sources */,
+ BEC567FD0761D90600A33029 /* Frameworks */,
+ BEC567FE0761D90600A33029 /* Rez */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "libsdlmain.a (Upgraded)";
+ productInstallPath = /usr/local/lib;
+ productName = libsdlmain.a;
+ productReference = BEC567FF0761D90600A33029 /* libsdlmain.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 08FB7793FE84155DC02AAC07 /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = 001B5A0C08BDB826006539E9 /* Build configuration list for PBXProject "SDLTest" */;
+ compatibilityVersion = "Xcode 2.4";
+ developmentRegion = English;
+ hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
+ mainGroup = 08FB7794FE84155DC02AAC07 /* SDLTest */;
+ projectDirPath = "";
+ projectReferences = (
+ {
+ ProductGroup = 003FA63B093FFD41000C53B3 /* Products */;
+ ProjectRef = 003FA63A093FFD41000C53B3 /* SDL.xcodeproj */;
+ },
+ );
+ projectRoot = "";
+ targets = (
+ BEC566920761D90300A33029 /* All */,
+ BEC566AB0761D90300A33029 /* checkkeys (Upgraded) */,
+ BEC566B80761D90300A33029 /* graywin (Upgraded) */,
+ BEC566C50761D90300A33029 /* loopwave (Upgraded) */,
+ BEC566D30761D90300A33029 /* testalpha (Upgraded) */,
+ BEC566E10761D90300A33029 /* testbitmap (Upgraded) */,
+ 002F338609CA16BF00EBEB88 /* testblitspeed */,
+ BEC566EE0761D90300A33029 /* testcdrom (Upgraded) */,
+ 002F33CA09CA19A600EBEB88 /* testdyngl */,
+ BEC566FB0761D90300A33029 /* testerror (Upgraded) */,
+ 002F340109CA1BFF00EBEB88 /* testfile */,
+ BEC567080761D90400A33029 /* testgamma (Upgraded) */,
+ BEC567160761D90400A33029 /* testgl (Upgraded) */,
+ 002F342009CA1F0300EBEB88 /* testiconv */,
+ BEC567300761D90400A33029 /* testjoystick (Upgraded) */,
+ BEC5673D0761D90400A33029 /* testkeys (Upgraded) */,
+ BEC5674A0761D90400A33029 /* testlock (Upgraded) */,
+ BEC567570761D90400A33029 /* testoverlay (Upgraded) */,
+ 002F343C09CA1FB300EBEB88 /* testoverlay2 */,
+ BEC567640761D90400A33029 /* testpalette (Upgraded) */,
+ 002F345909CA204F00EBEB88 /* testplatform */,
+ BEC567720761D90500A33029 /* testsem (Upgraded) */,
+ BEC5677F0761D90500A33029 /* testsprite (Upgraded) */,
+ BEC567230761D90400A33029 /* testthread (Upgraded) */,
+ BEC5678D0761D90500A33029 /* testtimer (Upgraded) */,
+ BEC567A70761D90500A33029 /* testversion (Upgraded) */,
+ BEC567B40761D90500A33029 /* testvidinfo (Upgraded) */,
+ BEC567C10761D90500A33029 /* testwin (Upgraded) */,
+ BEC567CF0761D90500A33029 /* testwm (Upgraded) */,
+ BEC567DD0761D90600A33029 /* threadwin (Upgraded) */,
+ BEC567EA0761D90600A33029 /* torturethread (Upgraded) */,
+ BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */,
+ 002F337009CA14F900EBEB88 /* test */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXReferenceProxy section */
+ 003FA643093FFD41000C53B3 /* SDL.framework */ = {
+ isa = PBXReferenceProxy;
+ fileType = wrapper.framework;
+ path = SDL.framework;
+ remoteRef = 003FA642093FFD41000C53B3 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ 003FA645093FFD41000C53B3 /* libSDL.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = libSDL.a;
+ remoteRef = 003FA644093FFD41000C53B3 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ 003FA647093FFD41000C53B3 /* libSDLmain.a */ = {
+ isa = PBXReferenceProxy;
+ fileType = archive.ar;
+ path = libSDLmain.a;
+ remoteRef = 003FA646093FFD41000C53B3 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ 003FA649093FFD41000C53B3 /* Standard DMG */ = {
+ isa = PBXReferenceProxy;
+ fileType = "compiled.mach-o.executable";
+ path = "Standard DMG";
+ remoteRef = 003FA648093FFD41000C53B3 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ 003FA64B093FFD41000C53B3 /* Developer Extras Package */ = {
+ isa = PBXReferenceProxy;
+ fileType = "compiled.mach-o.executable";
+ path = "Developer Extras Package";
+ remoteRef = 003FA64A093FFD41000C53B3 /* PBXContainerItemProxy */;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+/* End PBXReferenceProxy section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 002F337409CA14F900EBEB88 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F337509CA14F900EBEB88 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F338A09CA16BF00EBEB88 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F338B09CA16BF00EBEB88 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F33CE09CA19A600EBEB88 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F33CF09CA19A600EBEB88 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F340509CA1BFF00EBEB88 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F340609CA1BFF00EBEB88 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F342409CA1F0300EBEB88 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F342509CA1F0300EBEB88 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F344009CA1FB300EBEB88 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F344109CA1FB300EBEB88 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F345D09CA204F00EBEB88 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F345E09CA204F00EBEB88 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566AE0761D90300A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC566AF0761D90300A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566BB0761D90300A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC566BC0761D90300A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566C80761D90300A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC566C90761D90300A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566D60761D90300A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC566D70761D90300A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566E40761D90300A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC566E50761D90300A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566F10761D90300A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC566F20761D90300A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566FE0761D90300A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC566FF0761D90300A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC5670B0761D90400A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC5670C0761D90400A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567190761D90400A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC5671A0761D90400A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567260761D90400A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567270761D90400A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567330761D90400A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567340761D90400A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567400761D90400A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567410761D90400A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC5674D0761D90400A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC5674E0761D90400A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC5675A0761D90400A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567670761D90400A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567680761D90400A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567750761D90500A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567760761D90500A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567820761D90500A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567830761D90500A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567900761D90500A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567910761D90500A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567AA0761D90500A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567AB0761D90500A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567B70761D90500A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567B80761D90500A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567C40761D90500A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567C50761D90500A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567D20761D90500A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567D30761D90500A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567E00761D90600A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567E10761D90600A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567ED0761D90600A33029 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567EE0761D90600A33029 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXRezBuildPhase section */
+ BEC567FE0761D90600A33029 /* Rez */ = {
+ isa = PBXRezBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXRezBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 002F337609CA14F900EBEB88 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F338C09CA16BF00EBEB88 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F339B09CA17BC00EBEB88 /* testblitspeed.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F33D009CA19A600EBEB88 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F33E309CA1A0B00EBEB88 /* testdyngl.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F340709CA1BFF00EBEB88 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F341809CA1C5B00EBEB88 /* testfile.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F342609CA1F0300EBEB88 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F343709CA1F6F00EBEB88 /* testiconv.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F344209CA1FB300EBEB88 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F345409CA202000EBEB88 /* testoverlay2.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 002F345F09CA204F00EBEB88 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F347009CA20A600EBEB88 /* testplatform.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566B00761D90300A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC566B10761D90300A33029 /* checkkeys.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566BD0761D90300A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC566BE0761D90300A33029 /* graywin.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566CA0761D90300A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC566CB0761D90300A33029 /* loopwave.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566D80761D90300A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC566D90761D90300A33029 /* testalpha.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566E60761D90300A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC566E70761D90300A33029 /* testbitmap.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC566F30761D90300A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC566F40761D90300A33029 /* testcdrom.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567000761D90300A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567010761D90300A33029 /* testerror.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC5670D0761D90400A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC5670E0761D90400A33029 /* testgamma.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC5671B0761D90400A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC5671C0761D90400A33029 /* testgl.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567280761D90400A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567290761D90400A33029 /* testhread.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567350761D90400A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567360761D90400A33029 /* testjoystick.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567420761D90400A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567430761D90400A33029 /* testkeys.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC5674F0761D90400A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567500761D90400A33029 /* testlock.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC5675C0761D90400A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC5675D0761D90400A33029 /* testoverlay.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567690761D90400A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC5676A0761D90400A33029 /* testpalette.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567770761D90500A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567780761D90500A33029 /* testsem.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567840761D90500A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567850761D90500A33029 /* testsprite.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567920761D90500A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567930761D90500A33029 /* testtimer.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567AC0761D90500A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567AD0761D90500A33029 /* testver.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567B90761D90500A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567BA0761D90500A33029 /* testvidinfo.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567C60761D90500A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567C70761D90500A33029 /* testwin.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567D40761D90500A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567D50761D90500A33029 /* testwm.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567E20761D90600A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567E30761D90600A33029 /* threadwin.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567EF0761D90600A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567F00761D90600A33029 /* torturethread.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BEC567FB0761D90600A33029 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BEC567FC0761D90600A33029 /* SDLMain.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 002F337109CA14F900EBEB88 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = 002F337209CA14F900EBEB88 /* PBXContainerItemProxy */;
+ };
+ 002F338709CA16BF00EBEB88 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = 002F338809CA16BF00EBEB88 /* PBXContainerItemProxy */;
+ };
+ 002F33CB09CA19A600EBEB88 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = 002F33CC09CA19A600EBEB88 /* PBXContainerItemProxy */;
+ };
+ 002F340209CA1BFF00EBEB88 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = 002F340309CA1BFF00EBEB88 /* PBXContainerItemProxy */;
+ };
+ 002F342109CA1F0300EBEB88 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = 002F342209CA1F0300EBEB88 /* PBXContainerItemProxy */;
+ };
+ 002F343D09CA1FB300EBEB88 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = 002F343E09CA1FB300EBEB88 /* PBXContainerItemProxy */;
+ };
+ 002F345A09CA204F00EBEB88 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = 002F345B09CA204F00EBEB88 /* PBXContainerItemProxy */;
+ };
+ 002F347909CA215600EBEB88 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 002F338609CA16BF00EBEB88 /* testblitspeed */;
+ targetProxy = 002F347809CA215600EBEB88 /* PBXContainerItemProxy */;
+ };
+ 002F347B09CA215600EBEB88 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 002F33CA09CA19A600EBEB88 /* testdyngl */;
+ targetProxy = 002F347A09CA215600EBEB88 /* PBXContainerItemProxy */;
+ };
+ 002F347D09CA215600EBEB88 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 002F340109CA1BFF00EBEB88 /* testfile */;
+ targetProxy = 002F347C09CA215600EBEB88 /* PBXContainerItemProxy */;
+ };
+ 002F347F09CA215600EBEB88 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 002F342009CA1F0300EBEB88 /* testiconv */;
+ targetProxy = 002F347E09CA215600EBEB88 /* PBXContainerItemProxy */;
+ };
+ 002F348109CA215600EBEB88 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567570761D90400A33029 /* testoverlay (Upgraded) */;
+ targetProxy = 002F348009CA215600EBEB88 /* PBXContainerItemProxy */;
+ };
+ 002F348309CA215600EBEB88 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 002F343C09CA1FB300EBEB88 /* testoverlay2 */;
+ targetProxy = 002F348209CA215600EBEB88 /* PBXContainerItemProxy */;
+ };
+ 002F348509CA215600EBEB88 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 002F345909CA204F00EBEB88 /* testplatform */;
+ targetProxy = 002F348409CA215600EBEB88 /* PBXContainerItemProxy */;
+ };
+ 003FA6A809400236000C53B3 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = Framework;
+ targetProxy = 003FA6A709400236000C53B3 /* PBXContainerItemProxy */;
+ };
+ BEC568010761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC566AB0761D90300A33029 /* checkkeys (Upgraded) */;
+ targetProxy = BEC568000761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568030761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC566B80761D90300A33029 /* graywin (Upgraded) */;
+ targetProxy = BEC568020761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568050761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC566C50761D90300A33029 /* loopwave (Upgraded) */;
+ targetProxy = BEC568040761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568070761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC566D30761D90300A33029 /* testalpha (Upgraded) */;
+ targetProxy = BEC568060761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568090761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC566E10761D90300A33029 /* testbitmap (Upgraded) */;
+ targetProxy = BEC568080761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC5680B0761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC566EE0761D90300A33029 /* testcdrom (Upgraded) */;
+ targetProxy = BEC5680A0761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC5680D0761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC566FB0761D90300A33029 /* testerror (Upgraded) */;
+ targetProxy = BEC5680C0761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC5680F0761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567080761D90400A33029 /* testgamma (Upgraded) */;
+ targetProxy = BEC5680E0761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568110761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567160761D90400A33029 /* testgl (Upgraded) */;
+ targetProxy = BEC568100761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568130761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567230761D90400A33029 /* testthread (Upgraded) */;
+ targetProxy = BEC568120761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568150761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567300761D90400A33029 /* testjoystick (Upgraded) */;
+ targetProxy = BEC568140761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568170761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC5673D0761D90400A33029 /* testkeys (Upgraded) */;
+ targetProxy = BEC568160761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568190761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC5674A0761D90400A33029 /* testlock (Upgraded) */;
+ targetProxy = BEC568180761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC5681B0761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567640761D90400A33029 /* testpalette (Upgraded) */;
+ targetProxy = BEC5681A0761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC5681D0761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567720761D90500A33029 /* testsem (Upgraded) */;
+ targetProxy = BEC5681C0761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC5681F0761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC5677F0761D90500A33029 /* testsprite (Upgraded) */;
+ targetProxy = BEC5681E0761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568210761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC5678D0761D90500A33029 /* testtimer (Upgraded) */;
+ targetProxy = BEC568200761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568250761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567A70761D90500A33029 /* testversion (Upgraded) */;
+ targetProxy = BEC568240761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568270761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567B40761D90500A33029 /* testvidinfo (Upgraded) */;
+ targetProxy = BEC568260761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568290761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567C10761D90500A33029 /* testwin (Upgraded) */;
+ targetProxy = BEC568280761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC5682B0761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567CF0761D90500A33029 /* testwm (Upgraded) */;
+ targetProxy = BEC5682A0761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC5682D0761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567DD0761D90600A33029 /* threadwin (Upgraded) */;
+ targetProxy = BEC5682C0761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC5682F0761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567EA0761D90600A33029 /* torturethread (Upgraded) */;
+ targetProxy = BEC5682E0761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568310761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC568300761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568330761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC568320761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568350761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC568340761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568370761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC568360761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568390761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC568380761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC5683B0761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC5683A0761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC5683D0761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC5683C0761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC5683F0761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC5683E0761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568410761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC568400761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568430761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC568420761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568450761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC568440761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568470761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC568460761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568490761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC568480761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC5684B0761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC5684A0761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC5684D0761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC5684C0761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC5684F0761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC5684E0761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568510761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC568500761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568530761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC568520761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568570761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC568560761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568590761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC568580761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC5685B0761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC5685A0761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC5685D0761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC5685C0761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC5685F0761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC5685E0761D90600A33029 /* PBXContainerItemProxy */;
+ };
+ BEC568610761D90600A33029 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BEC567F70761D90600A33029 /* libsdlmain.a (Upgraded) */;
+ targetProxy = BEC568600761D90600A33029 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin XCBuildConfiguration section */
+ 001B593508BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PREFIX_HEADER = libsdlmain_prefix.h;
+ PRODUCT_NAME = sdlmain;
+ };
+ name = Deployment;
+ };
+ 001B593608BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PREFIX_HEADER = libsdlmain_prefix.h;
+ PRODUCT_NAME = sdlmain;
+ };
+ name = Development;
+ };
+ 001B593708BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PREFIX_HEADER = libsdlmain_prefix.h;
+ PRODUCT_NAME = sdlmain;
+ };
+ name = Default;
+ };
+ 001B593908BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-checkkeys__Upgraded_.plist";
+ PRODUCT_NAME = checkkeys;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B593A08BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-checkkeys__Upgraded_.plist";
+ PRODUCT_NAME = checkkeys;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B593B08BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-checkkeys__Upgraded_.plist";
+ PRODUCT_NAME = checkkeys;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B593D08BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-graywin__Upgraded_.plist";
+ PRODUCT_NAME = graywin;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B593E08BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-graywin__Upgraded_.plist";
+ PRODUCT_NAME = graywin;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B593F08BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-graywin__Upgraded_.plist";
+ PRODUCT_NAME = graywin;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B594108BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-loopwave__Upgraded_.plist";
+ PRODUCT_NAME = loopwave;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B594208BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-loopwave__Upgraded_.plist";
+ PRODUCT_NAME = loopwave;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B594308BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-loopwave__Upgraded_.plist";
+ PRODUCT_NAME = loopwave;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B594508BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testalpha__Upgraded_.plist";
+ PRODUCT_NAME = testalpha;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B594608BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testalpha__Upgraded_.plist";
+ PRODUCT_NAME = testalpha;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B594708BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testalpha__Upgraded_.plist";
+ PRODUCT_NAME = testalpha;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B594908BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testbitmap__Upgraded_.plist";
+ PRODUCT_NAME = testbitmap;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B594A08BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testbitmap__Upgraded_.plist";
+ PRODUCT_NAME = testbitmap;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B594B08BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testbitmap__Upgraded_.plist";
+ PRODUCT_NAME = testbitmap;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B594D08BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testcdrom__Upgraded_.plist";
+ PRODUCT_NAME = testcdrom;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B594E08BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testcdrom__Upgraded_.plist";
+ PRODUCT_NAME = testcdrom;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B594F08BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testcdrom__Upgraded_.plist";
+ PRODUCT_NAME = testcdrom;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B595108BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testerror__Upgraded_.plist";
+ PRODUCT_NAME = testerror;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B595208BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testerror__Upgraded_.plist";
+ PRODUCT_NAME = testerror;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B595308BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testerror__Upgraded_.plist";
+ PRODUCT_NAME = testerror;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B595508BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testgamma__Upgraded_.plist";
+ PRODUCT_NAME = testgamma;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B595608BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testgamma__Upgraded_.plist";
+ PRODUCT_NAME = testgamma;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B595708BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testgamma__Upgraded_.plist";
+ PRODUCT_NAME = testgamma;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B595908BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PREPROCESSOR_DEFINITIONS = HAVE_OPENGL;
+ INFOPLIST_FILE = "Info-testgl__Upgraded_.plist";
+ PRODUCT_NAME = testgl;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B595A08BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PREPROCESSOR_DEFINITIONS = HAVE_OPENGL;
+ INFOPLIST_FILE = "Info-testgl__Upgraded_.plist";
+ PRODUCT_NAME = testgl;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B595B08BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PREPROCESSOR_DEFINITIONS = HAVE_OPENGL;
+ INFOPLIST_FILE = "Info-testgl__Upgraded_.plist";
+ PRODUCT_NAME = testgl;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B595D08BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testthread__Upgraded_.plist";
+ PRODUCT_NAME = testthread;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B595E08BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testthread__Upgraded_.plist";
+ PRODUCT_NAME = testthread;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B595F08BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testthread__Upgraded_.plist";
+ PRODUCT_NAME = testthread;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B596108BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testjoystick__Upgraded_.plist";
+ PRODUCT_NAME = testjoystick;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B596208BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testjoystick__Upgraded_.plist";
+ PRODUCT_NAME = testjoystick;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B596308BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testjoystick__Upgraded_.plist";
+ PRODUCT_NAME = testjoystick;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B596508BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testkeys__Upgraded_.plist";
+ PRODUCT_NAME = testkeys;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B596608BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testkeys__Upgraded_.plist";
+ PRODUCT_NAME = testkeys;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B596708BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testkeys__Upgraded_.plist";
+ PRODUCT_NAME = testkeys;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B596908BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testlock__Upgraded_.plist";
+ PRODUCT_NAME = testlock;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B596A08BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testlock__Upgraded_.plist";
+ PRODUCT_NAME = testlock;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B596B08BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testlock__Upgraded_.plist";
+ PRODUCT_NAME = testlock;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B596D08BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testpalette__Upgraded_.plist";
+ PRODUCT_NAME = testpalette;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B596E08BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testpalette__Upgraded_.plist";
+ PRODUCT_NAME = testpalette;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B596F08BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testpalette__Upgraded_.plist";
+ PRODUCT_NAME = testpalette;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B597108BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testsem__Upgraded_.plist";
+ PRODUCT_NAME = testsem;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B597208BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testsem__Upgraded_.plist";
+ PRODUCT_NAME = testsem;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B597308BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testsem__Upgraded_.plist";
+ PRODUCT_NAME = testsem;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B597508BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testsprite__Upgraded_.plist";
+ PRODUCT_NAME = testsprite;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B597608BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testsprite__Upgraded_.plist";
+ PRODUCT_NAME = testsprite;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B597708BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testsprite__Upgraded_.plist";
+ PRODUCT_NAME = testsprite;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B597908BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testtimer__Upgraded_.plist";
+ PRODUCT_NAME = testtimer;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B597A08BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testtimer__Upgraded_.plist";
+ PRODUCT_NAME = testtimer;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B597B08BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testtimer__Upgraded_.plist";
+ PRODUCT_NAME = testtimer;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B598108BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testversion__Upgraded_.plist";
+ PRODUCT_NAME = testversion;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B598208BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testversion__Upgraded_.plist";
+ PRODUCT_NAME = testversion;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B598308BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testversion__Upgraded_.plist";
+ PRODUCT_NAME = testversion;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B598508BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testvidinfo__Upgraded_.plist";
+ PRODUCT_NAME = testvidinfo;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B598608BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testvidinfo__Upgraded_.plist";
+ PRODUCT_NAME = testvidinfo;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B598708BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testvidinfo__Upgraded_.plist";
+ PRODUCT_NAME = testvidinfo;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B598908BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testwin__Upgraded_.plist";
+ PRODUCT_NAME = testwin;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B598A08BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testwin__Upgraded_.plist";
+ PRODUCT_NAME = testwin;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B598B08BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testwin__Upgraded_.plist";
+ PRODUCT_NAME = testwin;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B598D08BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testwm__Upgraded_.plist";
+ PRODUCT_NAME = testwm;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B598E08BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testwm__Upgraded_.plist";
+ PRODUCT_NAME = testwm;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B598F08BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testwm__Upgraded_.plist";
+ PRODUCT_NAME = testwm;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B599108BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-threadwin__Upgraded_.plist";
+ PRODUCT_NAME = threadwin;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B599208BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-threadwin__Upgraded_.plist";
+ PRODUCT_NAME = threadwin;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B599308BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-threadwin__Upgraded_.plist";
+ PRODUCT_NAME = threadwin;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B599508BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-torturethread__Upgraded_.plist";
+ PRODUCT_NAME = torturethread;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B599608BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-torturethread__Upgraded_.plist";
+ PRODUCT_NAME = torturethread;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B599708BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-torturethread__Upgraded_.plist";
+ PRODUCT_NAME = torturethread;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B599908BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ DEBUGGING_SYMBOLS = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_OPTIMIZATION_LEVEL = 3;
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = "Build All";
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = (
+ "-Wmost",
+ "-Wno-four-char-constants",
+ "-Wno-unknown-pragmas",
+ );
+ ZERO_LINK = NO;
+ };
+ name = Deployment;
+ };
+ 001B599A08BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = "Build All";
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = (
+ "-Wmost",
+ "-Wno-four-char-constants",
+ "-Wno-unknown-pragmas",
+ );
+ ZERO_LINK = YES;
+ };
+ name = Development;
+ };
+ 001B599B08BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = "Build All";
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = (
+ "-Wmost",
+ "-Wno-four-char-constants",
+ "-Wno-unknown-pragmas",
+ );
+ };
+ name = Default;
+ };
+ 001B599D08BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testoverlay__Upgraded_.plist";
+ PRODUCT_NAME = testoverlay;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 001B599E08BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testoverlay__Upgraded_.plist";
+ PRODUCT_NAME = testoverlay;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 001B599F08BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testoverlay__Upgraded_.plist";
+ PRODUCT_NAME = testoverlay;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 001B5A0D08BDB826006539E9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
+ CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(SRCROOT)/../SDL/build/$(CONFIGURATION)",
+ "$(HOME)/Library/Frameworks",
+ /Library/Frameworks,
+ );
+ GCC_VERSION_i386 = 4.0;
+ GCC_VERSION_ppc = 4.0;
+ GCC_VERSION_x86_64 = 4.2;
+ HEADER_SEARCH_PATHS = (
+ ../../include,
+ "$(HOME)/Library/Frameworks/SDL.framework/Headers",
+ /Library/Frameworks/SDL.framework/Headers,
+ );
+ MACOSX_DEPLOYMENT_TARGET_i386 = 10.4;
+ MACOSX_DEPLOYMENT_TARGET_ppc = 10.4;
+ MACOSX_DEPLOYMENT_TARGET_x86_64 = 10.6;
+ WARNING_CFLAGS = "-Wmost";
+ ZERO_LINK = NO;
+ };
+ name = Deployment;
+ };
+ 001B5A0E08BDB826006539E9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
+ CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(SRCROOT)/../SDL/build/$(CONFIGURATION)",
+ "$(HOME)/Library/Frameworks",
+ /Library/Frameworks,
+ );
+ GCC_VERSION_i386 = 4.0;
+ GCC_VERSION_ppc = 4.0;
+ GCC_VERSION_x86_64 = 4.2;
+ HEADER_SEARCH_PATHS = (
+ ../../include,
+ "$(HOME)/Library/Frameworks/SDL.framework/Headers",
+ /Library/Frameworks/SDL.framework/Headers,
+ );
+ MACOSX_DEPLOYMENT_TARGET_i386 = 10.4;
+ MACOSX_DEPLOYMENT_TARGET_ppc = 10.4;
+ MACOSX_DEPLOYMENT_TARGET_x86_64 = 10.6;
+ WARNING_CFLAGS = "-Wmost";
+ ZERO_LINK = NO;
+ };
+ name = Development;
+ };
+ 001B5A0F08BDB826006539E9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
+ CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(SRCROOT)/../SDL/build/$(CONFIGURATION)",
+ "$(HOME)/Library/Frameworks",
+ /Library/Frameworks,
+ );
+ GCC_VERSION_i386 = 4.0;
+ GCC_VERSION_ppc = 4.0;
+ GCC_VERSION_x86_64 = 4.2;
+ HEADER_SEARCH_PATHS = (
+ ../../include,
+ "$(HOME)/Library/Frameworks/SDL.framework/Headers",
+ /Library/Frameworks/SDL.framework/Headers,
+ );
+ MACOSX_DEPLOYMENT_TARGET_i386 = 10.4;
+ MACOSX_DEPLOYMENT_TARGET_ppc = 10.4;
+ MACOSX_DEPLOYMENT_TARGET_x86_64 = 10.6;
+ WARNING_CFLAGS = "-Wmost";
+ ZERO_LINK = NO;
+ };
+ name = Default;
+ };
+ 002F337E09CA14F900EBEB88 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-test.plist";
+ PRODUCT_NAME = test;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 002F337F09CA14F900EBEB88 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-test.plist";
+ PRODUCT_NAME = test;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 002F338009CA14F900EBEB88 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-test.plist";
+ PRODUCT_NAME = test;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 002F339409CA16BF00EBEB88 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testblitspeed.plist";
+ PRODUCT_NAME = testblitspeed;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 002F339509CA16BF00EBEB88 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testblitspeed.plist";
+ PRODUCT_NAME = testblitspeed;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 002F339609CA16BF00EBEB88 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testblitspeed.plist";
+ PRODUCT_NAME = testblitspeed;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 002F33D809CA19A600EBEB88 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ HAVE_OPENGL,
+ );
+ INFOPLIST_FILE = "Info-testdyngl.plist";
+ PRODUCT_NAME = testdyngl;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 002F33D909CA19A600EBEB88 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ HAVE_OPENGL,
+ );
+ INFOPLIST_FILE = "Info-testdyngl.plist";
+ PRODUCT_NAME = testdyngl;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 002F33DA09CA19A600EBEB88 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "$(GCC_PREPROCESSOR_DEFINITIONS)",
+ HAVE_OPENGL,
+ );
+ INFOPLIST_FILE = "Info-testdyngl.plist";
+ PRODUCT_NAME = testdyngl;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 002F340F09CA1BFF00EBEB88 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testfile.plist";
+ PRODUCT_NAME = testfile;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 002F341009CA1BFF00EBEB88 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testfile.plist";
+ PRODUCT_NAME = testfile;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 002F341109CA1BFF00EBEB88 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testfile.plist";
+ PRODUCT_NAME = testfile;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 002F342E09CA1F0300EBEB88 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testiconv.plist";
+ PRODUCT_NAME = testiconv;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 002F342F09CA1F0300EBEB88 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testiconv.plist";
+ PRODUCT_NAME = testiconv;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 002F343009CA1F0300EBEB88 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testiconv.plist";
+ PRODUCT_NAME = testiconv;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 002F344A09CA1FB300EBEB88 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testoverlay2.plist";
+ PRODUCT_NAME = testoverlay2;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 002F344B09CA1FB300EBEB88 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testoverlay2.plist";
+ PRODUCT_NAME = testoverlay2;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 002F344C09CA1FB300EBEB88 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testoverlay2.plist";
+ PRODUCT_NAME = testoverlay2;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+ 002F346709CA204F00EBEB88 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testplatform.plist";
+ PRODUCT_NAME = testplatform;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Deployment;
+ };
+ 002F346809CA204F00EBEB88 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testplatform.plist";
+ PRODUCT_NAME = testplatform;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Development;
+ };
+ 002F346909CA204F00EBEB88 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ INFOPLIST_FILE = "Info-testplatform.plist";
+ PRODUCT_NAME = testplatform;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Default;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 001B593408BDB826006539E9 /* Build configuration list for PBXNativeTarget "libsdlmain.a (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B593508BDB826006539E9 /* Deployment */,
+ 001B593608BDB826006539E9 /* Development */,
+ 001B593708BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B593808BDB826006539E9 /* Build configuration list for PBXNativeTarget "checkkeys (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B593908BDB826006539E9 /* Deployment */,
+ 001B593A08BDB826006539E9 /* Development */,
+ 001B593B08BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B593C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "graywin (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B593D08BDB826006539E9 /* Deployment */,
+ 001B593E08BDB826006539E9 /* Development */,
+ 001B593F08BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B594008BDB826006539E9 /* Build configuration list for PBXNativeTarget "loopwave (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B594108BDB826006539E9 /* Deployment */,
+ 001B594208BDB826006539E9 /* Development */,
+ 001B594308BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B594408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testalpha (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B594508BDB826006539E9 /* Deployment */,
+ 001B594608BDB826006539E9 /* Development */,
+ 001B594708BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B594808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testbitmap (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B594908BDB826006539E9 /* Deployment */,
+ 001B594A08BDB826006539E9 /* Development */,
+ 001B594B08BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B594C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testcdrom (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B594D08BDB826006539E9 /* Deployment */,
+ 001B594E08BDB826006539E9 /* Development */,
+ 001B594F08BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B595008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testerror (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B595108BDB826006539E9 /* Deployment */,
+ 001B595208BDB826006539E9 /* Development */,
+ 001B595308BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B595408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testgamma (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B595508BDB826006539E9 /* Deployment */,
+ 001B595608BDB826006539E9 /* Development */,
+ 001B595708BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B595808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testgl (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B595908BDB826006539E9 /* Deployment */,
+ 001B595A08BDB826006539E9 /* Development */,
+ 001B595B08BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B595C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testthread (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B595D08BDB826006539E9 /* Deployment */,
+ 001B595E08BDB826006539E9 /* Development */,
+ 001B595F08BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B596008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testjoystick (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B596108BDB826006539E9 /* Deployment */,
+ 001B596208BDB826006539E9 /* Development */,
+ 001B596308BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B596408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testkeys (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B596508BDB826006539E9 /* Deployment */,
+ 001B596608BDB826006539E9 /* Development */,
+ 001B596708BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B596808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testlock (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B596908BDB826006539E9 /* Deployment */,
+ 001B596A08BDB826006539E9 /* Development */,
+ 001B596B08BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B596C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testpalette (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B596D08BDB826006539E9 /* Deployment */,
+ 001B596E08BDB826006539E9 /* Development */,
+ 001B596F08BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B597008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testsem (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B597108BDB826006539E9 /* Deployment */,
+ 001B597208BDB826006539E9 /* Development */,
+ 001B597308BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B597408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testsprite (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B597508BDB826006539E9 /* Deployment */,
+ 001B597608BDB826006539E9 /* Development */,
+ 001B597708BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B597808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testtimer (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B597908BDB826006539E9 /* Deployment */,
+ 001B597A08BDB826006539E9 /* Development */,
+ 001B597B08BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B598008BDB826006539E9 /* Build configuration list for PBXNativeTarget "testversion (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B598108BDB826006539E9 /* Deployment */,
+ 001B598208BDB826006539E9 /* Development */,
+ 001B598308BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B598408BDB826006539E9 /* Build configuration list for PBXNativeTarget "testvidinfo (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B598508BDB826006539E9 /* Deployment */,
+ 001B598608BDB826006539E9 /* Development */,
+ 001B598708BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B598808BDB826006539E9 /* Build configuration list for PBXNativeTarget "testwin (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B598908BDB826006539E9 /* Deployment */,
+ 001B598A08BDB826006539E9 /* Development */,
+ 001B598B08BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B598C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testwm (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B598D08BDB826006539E9 /* Deployment */,
+ 001B598E08BDB826006539E9 /* Development */,
+ 001B598F08BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B599008BDB826006539E9 /* Build configuration list for PBXNativeTarget "threadwin (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B599108BDB826006539E9 /* Deployment */,
+ 001B599208BDB826006539E9 /* Development */,
+ 001B599308BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B599408BDB826006539E9 /* Build configuration list for PBXNativeTarget "torturethread (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B599508BDB826006539E9 /* Deployment */,
+ 001B599608BDB826006539E9 /* Development */,
+ 001B599708BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B599808BDB826006539E9 /* Build configuration list for PBXAggregateTarget "All" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B599908BDB826006539E9 /* Deployment */,
+ 001B599A08BDB826006539E9 /* Development */,
+ 001B599B08BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B599C08BDB826006539E9 /* Build configuration list for PBXNativeTarget "testoverlay (Upgraded)" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B599D08BDB826006539E9 /* Deployment */,
+ 001B599E08BDB826006539E9 /* Development */,
+ 001B599F08BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 001B5A0C08BDB826006539E9 /* Build configuration list for PBXProject "SDLTest" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 001B5A0D08BDB826006539E9 /* Deployment */,
+ 001B5A0E08BDB826006539E9 /* Development */,
+ 001B5A0F08BDB826006539E9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 002F337D09CA14F900EBEB88 /* Build configuration list for PBXNativeTarget "test" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 002F337E09CA14F900EBEB88 /* Deployment */,
+ 002F337F09CA14F900EBEB88 /* Development */,
+ 002F338009CA14F900EBEB88 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 002F339309CA16BF00EBEB88 /* Build configuration list for PBXNativeTarget "testblitspeed" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 002F339409CA16BF00EBEB88 /* Deployment */,
+ 002F339509CA16BF00EBEB88 /* Development */,
+ 002F339609CA16BF00EBEB88 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 002F33D709CA19A600EBEB88 /* Build configuration list for PBXNativeTarget "testdyngl" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 002F33D809CA19A600EBEB88 /* Deployment */,
+ 002F33D909CA19A600EBEB88 /* Development */,
+ 002F33DA09CA19A600EBEB88 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 002F340E09CA1BFF00EBEB88 /* Build configuration list for PBXNativeTarget "testfile" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 002F340F09CA1BFF00EBEB88 /* Deployment */,
+ 002F341009CA1BFF00EBEB88 /* Development */,
+ 002F341109CA1BFF00EBEB88 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 002F342D09CA1F0300EBEB88 /* Build configuration list for PBXNativeTarget "testiconv" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 002F342E09CA1F0300EBEB88 /* Deployment */,
+ 002F342F09CA1F0300EBEB88 /* Development */,
+ 002F343009CA1F0300EBEB88 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 002F344909CA1FB300EBEB88 /* Build configuration list for PBXNativeTarget "testoverlay2" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 002F344A09CA1FB300EBEB88 /* Deployment */,
+ 002F344B09CA1FB300EBEB88 /* Development */,
+ 002F344C09CA1FB300EBEB88 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 002F346609CA204F00EBEB88 /* Build configuration list for PBXNativeTarget "testplatform" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 002F346709CA204F00EBEB88 /* Deployment */,
+ 002F346809CA204F00EBEB88 /* Development */,
+ 002F346909CA204F00EBEB88 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
+}
diff --git a/distrib/sdl-1.2.15/Xcode/SDLTest/libsdlmain_prefix.h b/distrib/sdl-1.2.15/Xcode/SDLTest/libsdlmain_prefix.h
new file mode 100644
index 0000000..ed41c97
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/SDLTest/libsdlmain_prefix.h
@@ -0,0 +1,13 @@
+/*
+ * libsdlmain_prefix.h
+ * SDLTest
+ *
+ * Created by Darrell Walisser on Wed Aug 06 2003.
+ * Copyright (c) 2003 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+#include <Cocoa/Cocoa.h>
+#include <Carbon/Carbon.h>
+#include "SDL.h"
+#include "SDLMain.h" \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/English.lproj/InfoPlist.strings b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/English.lproj/InfoPlist.strings
new file mode 100644
index 0000000..6e721b0
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/English.lproj/InfoPlist.strings
Binary files differ
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/Info.plist b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/Info.plist
new file mode 100644
index 0000000..e433204
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/Info.plist
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.___PROJECTNAMEASXML___</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+ <key>LSMinimumSystemVersionByArchitecture</key>
+ <dict>
+ <key>x86_64</key>
+ <string>10.6.0</string>
+ <key>i386</key>
+ <string>10.4.0</string>
+ <key>ppc</key>
+ <string>10.4.0</string>
+ </dict>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/SDLMain.h b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/SDLMain.h
new file mode 100644
index 0000000..c56d90c
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/SDLMain.h
@@ -0,0 +1,16 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#ifndef _SDLMain_h_
+#define _SDLMain_h_
+
+#import <Cocoa/Cocoa.h>
+
+@interface SDLMain : NSObject
+@end
+
+#endif /* _SDLMain_h_ */
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/SDLMain.m b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/SDLMain.m
new file mode 100644
index 0000000..b065a20
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/SDLMain.m
@@ -0,0 +1,383 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#include "SDL.h"
+#include "SDLMain.h"
+#include <sys/param.h> /* for MAXPATHLEN */
+#include <unistd.h>
+
+/* For some reaon, Apple removed setAppleMenu from the headers in 10.4,
+ but the method still is there and works. To avoid warnings, we declare
+ it ourselves here. */
+@interface NSApplication(SDL_Missing_Methods)
+- (void)setAppleMenu:(NSMenu *)menu;
+@end
+
+/* Use this flag to determine whether we use SDLMain.nib or not */
+#define SDL_USE_NIB_FILE 0
+
+/* Use this flag to determine whether we use CPS (docking) or not */
+#define SDL_USE_CPS 1
+#ifdef SDL_USE_CPS
+/* Portions of CPS.h */
+typedef struct CPSProcessSerNum
+{
+ UInt32 lo;
+ UInt32 hi;
+} CPSProcessSerNum;
+
+extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
+extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
+extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
+
+#endif /* SDL_USE_CPS */
+
+static int gArgc;
+static char **gArgv;
+static BOOL gFinderLaunch;
+static BOOL gCalledAppMainline = FALSE;
+
+static NSString *getApplicationName(void)
+{
+ const NSDictionary *dict;
+ NSString *appName = 0;
+
+ /* Determine the application name */
+ dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
+ if (dict)
+ appName = [dict objectForKey: @"CFBundleName"];
+
+ if (![appName length])
+ appName = [[NSProcessInfo processInfo] processName];
+
+ return appName;
+}
+
+#if SDL_USE_NIB_FILE
+/* A helper category for NSString */
+@interface NSString (ReplaceSubString)
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
+@end
+#endif
+
+@interface SDLApplication : NSApplication
+@end
+
+@implementation SDLApplication
+/* Invoked from the Quit menu item */
+- (void)terminate:(id)sender
+{
+ /* Post a SDL_QUIT event */
+ SDL_Event event;
+ event.type = SDL_QUIT;
+ SDL_PushEvent(&event);
+}
+@end
+
+/* The main class of the application, the application's delegate */
+@implementation SDLMain
+
+/* Set the working directory to the .app's parent directory */
+- (void) setupWorkingDirectory:(BOOL)shouldChdir
+{
+ if (shouldChdir)
+ {
+ char parentdir[MAXPATHLEN];
+ CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
+ CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
+ if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) {
+ chdir(parentdir); /* chdir to the binary app's parent */
+ }
+ CFRelease(url);
+ CFRelease(url2);
+ }
+}
+
+#if SDL_USE_NIB_FILE
+
+/* Fix menu to contain the real app name instead of "SDL App" */
+- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
+{
+ NSRange aRange;
+ NSEnumerator *enumerator;
+ NSMenuItem *menuItem;
+
+ aRange = [[aMenu title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
+
+ enumerator = [[aMenu itemArray] objectEnumerator];
+ while ((menuItem = [enumerator nextObject]))
+ {
+ aRange = [[menuItem title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
+ if ([menuItem hasSubmenu])
+ [self fixMenu:[menuItem submenu] withAppName:appName];
+ }
+ [ aMenu sizeToFit ];
+}
+
+#else
+
+static void setApplicationMenu(void)
+{
+ /* warning: this code is very odd */
+ NSMenu *appleMenu;
+ NSMenuItem *menuItem;
+ NSString *title;
+ NSString *appName;
+
+ appName = getApplicationName();
+ appleMenu = [[NSMenu alloc] initWithTitle:@""];
+
+ /* Add menu items */
+ title = [@"About " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
+
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ title = [@"Hide " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
+
+ menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
+ [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
+
+ [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
+
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ title = [@"Quit " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
+
+
+ /* Put menu into the menubar */
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
+ [menuItem setSubmenu:appleMenu];
+ [[NSApp mainMenu] addItem:menuItem];
+
+ /* Tell the application object that this is now the application menu */
+ [NSApp setAppleMenu:appleMenu];
+
+ /* Finally give up our references to the objects */
+ [appleMenu release];
+ [menuItem release];
+}
+
+/* Create a window menu */
+static void setupWindowMenu(void)
+{
+ NSMenu *windowMenu;
+ NSMenuItem *windowMenuItem;
+ NSMenuItem *menuItem;
+
+ windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
+
+ /* "Minimize" item */
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
+ [windowMenu addItem:menuItem];
+ [menuItem release];
+
+ /* Put menu into the menubar */
+ windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
+ [windowMenuItem setSubmenu:windowMenu];
+ [[NSApp mainMenu] addItem:windowMenuItem];
+
+ /* Tell the application object that this is now the window menu */
+ [NSApp setWindowsMenu:windowMenu];
+
+ /* Finally give up our references to the objects */
+ [windowMenu release];
+ [windowMenuItem release];
+}
+
+/* Replacement for NSApplicationMain */
+static void CustomApplicationMain (int argc, char **argv)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ SDLMain *sdlMain;
+
+ /* Ensure the application object is initialised */
+ [SDLApplication sharedApplication];
+
+#ifdef SDL_USE_CPS
+ {
+ CPSProcessSerNum PSN;
+ /* Tell the dock about us */
+ if (!CPSGetCurrentProcess(&PSN))
+ if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
+ if (!CPSSetFrontProcess(&PSN))
+ [SDLApplication sharedApplication];
+ }
+#endif /* SDL_USE_CPS */
+
+ /* Set up the menubar */
+ [NSApp setMainMenu:[[NSMenu alloc] init]];
+ setApplicationMenu();
+ setupWindowMenu();
+
+ /* Create SDLMain and make it the app delegate */
+ sdlMain = [[SDLMain alloc] init];
+ [NSApp setDelegate:sdlMain];
+
+ /* Start the main event loop */
+ [NSApp run];
+
+ [sdlMain release];
+ [pool release];
+}
+
+#endif
+
+
+/*
+ * Catch document open requests...this lets us notice files when the app
+ * was launched by double-clicking a document, or when a document was
+ * dragged/dropped on the app's icon. You need to have a
+ * CFBundleDocumentsType section in your Info.plist to get this message,
+ * apparently.
+ *
+ * Files are added to gArgv, so to the app, they'll look like command line
+ * arguments. Previously, apps launched from the finder had nothing but
+ * an argv[0].
+ *
+ * This message may be received multiple times to open several docs on launch.
+ *
+ * This message is ignored once the app's mainline has been called.
+ */
+- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
+{
+ const char *temparg;
+ size_t arglen;
+ char *arg;
+ char **newargv;
+
+ if (!gFinderLaunch) /* MacOS is passing command line args. */
+ return FALSE;
+
+ if (gCalledAppMainline) /* app has started, ignore this document. */
+ return FALSE;
+
+ temparg = [filename UTF8String];
+ arglen = SDL_strlen(temparg) + 1;
+ arg = (char *) SDL_malloc(arglen);
+ if (arg == NULL)
+ return FALSE;
+
+ newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
+ if (newargv == NULL)
+ {
+ SDL_free(arg);
+ return FALSE;
+ }
+ gArgv = newargv;
+
+ SDL_strlcpy(arg, temparg, arglen);
+ gArgv[gArgc++] = arg;
+ gArgv[gArgc] = NULL;
+ return TRUE;
+}
+
+
+/* Called when the internal event loop has just started running */
+- (void) applicationDidFinishLaunching: (NSNotification *) note
+{
+ int status;
+
+ /* Set the working directory to the .app's parent directory */
+ [self setupWorkingDirectory:gFinderLaunch];
+
+#if SDL_USE_NIB_FILE
+ /* Set the main menu to contain the real app name instead of "SDL App" */
+ [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
+#endif
+
+ /* Hand off to main application code */
+ gCalledAppMainline = TRUE;
+ status = SDL_main (gArgc, gArgv);
+
+ /* We're done, thank you for playing */
+ exit(status);
+}
+@end
+
+
+@implementation NSString (ReplaceSubString)
+
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
+{
+ unsigned int bufferSize;
+ unsigned int selfLen = [self length];
+ unsigned int aStringLen = [aString length];
+ unichar *buffer;
+ NSRange localRange;
+ NSString *result;
+
+ bufferSize = selfLen + aStringLen - aRange.length;
+ buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar));
+
+ /* Get first part into buffer */
+ localRange.location = 0;
+ localRange.length = aRange.location;
+ [self getCharacters:buffer range:localRange];
+
+ /* Get middle part into buffer */
+ localRange.location = 0;
+ localRange.length = aStringLen;
+ [aString getCharacters:(buffer+aRange.location) range:localRange];
+
+ /* Get last part into buffer */
+ localRange.location = aRange.location + aRange.length;
+ localRange.length = selfLen - localRange.location;
+ [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];
+
+ /* Build output string */
+ result = [NSString stringWithCharacters:buffer length:bufferSize];
+
+ NSDeallocateMemoryPages(buffer, bufferSize);
+
+ return result;
+}
+
+@end
+
+
+
+#ifdef main
+# undef main
+#endif
+
+
+/* Main entry point to executable - should *not* be SDL_main! */
+int main (int argc, char **argv)
+{
+ /* Copy the arguments into a global variable */
+ /* This is passed if we are launched by double-clicking */
+ if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
+ gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
+ gArgv[0] = argv[0];
+ gArgv[1] = NULL;
+ gArgc = 1;
+ gFinderLaunch = YES;
+ } else {
+ int i;
+ gArgc = argc;
+ gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
+ for (i = 0; i <= argc; i++)
+ gArgv[i] = argv[i];
+ gFinderLaunch = NO;
+ }
+
+#if SDL_USE_NIB_FILE
+ [SDLApplication poseAsClass:[NSApplication class]];
+ NSApplicationMain (argc, argv);
+#else
+ CustomApplicationMain (argc, argv);
+#endif
+ return 0;
+}
+
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch
new file mode 100644
index 0000000..0009507
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch
@@ -0,0 +1,9 @@
+//
+// Prefix header for all source files of the 'ÇPROJECTNAMEÈ' target in the 'ÇPROJECTNAMEÈ' project
+//
+
+#include "SDL.h"
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns
new file mode 100644
index 0000000..ae0b02b
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns
Binary files differ
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
new file mode 100644
index 0000000..d9ca454
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
@@ -0,0 +1,12 @@
+{
+ 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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/project.pbxproj b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..0cff0a3
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/___PROJECTNAME___.xcodeproj/project.pbxproj
@@ -0,0 +1,308 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 42;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; };
+ 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; };
+ 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; };
+ 002F3A3F09D088BA00EBEB88 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A3E09D088BA00EBEB88 /* main.c */; };
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */,
+ );
+ name = "Copy Frameworks into .app bundle";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = "<absolute>"; };
+ 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; };
+ 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; };
+ 002F3A3E09D088BA00EBEB88 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = SOURCE_ROOT; };
+ 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+ 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "___PROJECTNAME____Prefix.pch"; sourceTree = "<group>"; };
+ 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
+ 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "___PROJECTNAME___.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8D11072E0486CEB800E47090 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */,
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 080E96DDFE201D6D7F000001 /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ 002F3A2B09D0888800EBEB88 /* SDLMain.h */,
+ 002F3A2C09D0888800EBEB88 /* SDLMain.m */,
+ );
+ name = Classes;
+ sourceTree = "<group>";
+ };
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 002F39F909D0881F00EBEB88 /* SDL.framework */,
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
+ );
+ name = "Linked Frameworks";
+ sourceTree = "<group>";
+ };
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */,
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 19C28FACFE9D520D11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */ = {
+ isa = PBXGroup;
+ children = (
+ 080E96DDFE201D6D7F000001 /* Classes */,
+ 29B97315FDCFA39411CA2CEA /* Other Sources */,
+ 29B97317FDCFA39411CA2CEA /* Resources */,
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
+ 19C28FACFE9D520D11CA2CBB /* Products */,
+ );
+ name = "___PROJECTNAMEASXML___";
+ sourceTree = "<group>";
+ };
+ 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */,
+ 002F3A3E09D088BA00EBEB88 /* main.c */,
+ );
+ name = "Other Sources";
+ sourceTree = "<group>";
+ };
+ 29B97317FDCFA39411CA2CEA /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 8D1107310486CEB800E47090 /* Info.plist */,
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */;
+ buildPhases = (
+ 8D1107290486CEB800E47090 /* Resources */,
+ 8D11072C0486CEB800E47090 /* Sources */,
+ 8D11072E0486CEB800E47090 /* Frameworks */,
+ 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "___PROJECTNAME___";
+ productInstallPath = "$(HOME)/Applications";
+ productName = "___PROJECTNAME___";
+ productReference = 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 29B97313FDCFA39411CA2CEA /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */;
+ compatibilityVersion = "Xcode 2.4";
+ hasScannedForEncodings = 1;
+ mainGroup = 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 8D1107290486CEB800E47090 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8D11072C0486CEB800E47090 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */,
+ 002F3A3F09D088BA00EBEB88 /* main.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 089C165DFE840E0CC02AAC07 /* English */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ C01FCF4B08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(HOME)/Applications";
+ PRODUCT_NAME = "___PROJECTNAME___";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ C01FCF4C08A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+ GCC_MODEL_TUNING = G5;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(HOME)/Applications";
+ PRODUCT_NAME = "___PROJECTNAME___";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+ C01FCF4F08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks",
+ /Library/Frameworks,
+ "$(FRAMEWORK_SEARCH_PATHS)",
+ );
+ GCC_VERSION = 4.0;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks/SDL.framework/Headers",
+ /Library/Frameworks/SDL.framework/Headers,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ PREBINDING = NO;
+ SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+ };
+ name = Debug;
+ };
+ C01FCF5008A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks",
+ /Library/Frameworks,
+ "$(FRAMEWORK_SEARCH_PATHS)",
+ );
+ GCC_VERSION = 4.0;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks/SDL.framework/Headers",
+ /Library/Frameworks/SDL.framework/Headers,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ PREBINDING = NO;
+ SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4B08A954540054247B /* Debug */,
+ C01FCF4C08A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4F08A954540054247B /* Debug */,
+ C01FCF5008A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
+}
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/main.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/main.c
new file mode 100644
index 0000000..7115de9
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Application/main.c
@@ -0,0 +1,65 @@
+
+/* 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/InfoPlist.strings b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/InfoPlist.strings
new file mode 100644
index 0000000..6e721b0
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/InfoPlist.strings
Binary files differ
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/classes.nib b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/classes.nib
new file mode 100644
index 0000000..799eaad
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/classes.nib
@@ -0,0 +1,19 @@
+{
+ 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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/info.nib b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/info.nib
new file mode 100644
index 0000000..1d6fb7e
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/info.nib
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>IBDocumentLocation</key>
+ <string>62 117 356 240 0 0 1152 848 </string>
+ <key>IBEditorPositions</key>
+ <dict>
+ <key>29</key>
+ <string>62 362 195 44 0 0 1152 848 </string>
+ </dict>
+ <key>IBFramework Version</key>
+ <string>291.0</string>
+ <key>IBOpenObjects</key>
+ <array>
+ <integer>29</integer>
+ </array>
+ <key>IBSystem Version</key>
+ <string>6L60</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/objects.nib b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/objects.nib
new file mode 100644
index 0000000..6378015
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/objects.nib
Binary files differ
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/Info.plist b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/Info.plist
new file mode 100644
index 0000000..40a970f
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/Info.plist
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.___PROJECTNAMEASXML___</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+ <key>LSMinimumSystemVersionByArchitecture</key>
+ <dict>
+ <key>x86_64</key>
+ <string>10.6.0</string>
+ <key>i386</key>
+ <string>10.4.0</string>
+ <key>ppc</key>
+ <string>10.4.0</string>
+ </dict>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/SDLMain.h b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/SDLMain.h
new file mode 100644
index 0000000..c56d90c
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/SDLMain.h
@@ -0,0 +1,16 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#ifndef _SDLMain_h_
+#define _SDLMain_h_
+
+#import <Cocoa/Cocoa.h>
+
+@interface SDLMain : NSObject
+@end
+
+#endif /* _SDLMain_h_ */
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/SDLMain.m b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/SDLMain.m
new file mode 100644
index 0000000..b065a20
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/SDLMain.m
@@ -0,0 +1,383 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#include "SDL.h"
+#include "SDLMain.h"
+#include <sys/param.h> /* for MAXPATHLEN */
+#include <unistd.h>
+
+/* For some reaon, Apple removed setAppleMenu from the headers in 10.4,
+ but the method still is there and works. To avoid warnings, we declare
+ it ourselves here. */
+@interface NSApplication(SDL_Missing_Methods)
+- (void)setAppleMenu:(NSMenu *)menu;
+@end
+
+/* Use this flag to determine whether we use SDLMain.nib or not */
+#define SDL_USE_NIB_FILE 0
+
+/* Use this flag to determine whether we use CPS (docking) or not */
+#define SDL_USE_CPS 1
+#ifdef SDL_USE_CPS
+/* Portions of CPS.h */
+typedef struct CPSProcessSerNum
+{
+ UInt32 lo;
+ UInt32 hi;
+} CPSProcessSerNum;
+
+extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
+extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
+extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
+
+#endif /* SDL_USE_CPS */
+
+static int gArgc;
+static char **gArgv;
+static BOOL gFinderLaunch;
+static BOOL gCalledAppMainline = FALSE;
+
+static NSString *getApplicationName(void)
+{
+ const NSDictionary *dict;
+ NSString *appName = 0;
+
+ /* Determine the application name */
+ dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
+ if (dict)
+ appName = [dict objectForKey: @"CFBundleName"];
+
+ if (![appName length])
+ appName = [[NSProcessInfo processInfo] processName];
+
+ return appName;
+}
+
+#if SDL_USE_NIB_FILE
+/* A helper category for NSString */
+@interface NSString (ReplaceSubString)
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
+@end
+#endif
+
+@interface SDLApplication : NSApplication
+@end
+
+@implementation SDLApplication
+/* Invoked from the Quit menu item */
+- (void)terminate:(id)sender
+{
+ /* Post a SDL_QUIT event */
+ SDL_Event event;
+ event.type = SDL_QUIT;
+ SDL_PushEvent(&event);
+}
+@end
+
+/* The main class of the application, the application's delegate */
+@implementation SDLMain
+
+/* Set the working directory to the .app's parent directory */
+- (void) setupWorkingDirectory:(BOOL)shouldChdir
+{
+ if (shouldChdir)
+ {
+ char parentdir[MAXPATHLEN];
+ CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
+ CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
+ if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) {
+ chdir(parentdir); /* chdir to the binary app's parent */
+ }
+ CFRelease(url);
+ CFRelease(url2);
+ }
+}
+
+#if SDL_USE_NIB_FILE
+
+/* Fix menu to contain the real app name instead of "SDL App" */
+- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
+{
+ NSRange aRange;
+ NSEnumerator *enumerator;
+ NSMenuItem *menuItem;
+
+ aRange = [[aMenu title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
+
+ enumerator = [[aMenu itemArray] objectEnumerator];
+ while ((menuItem = [enumerator nextObject]))
+ {
+ aRange = [[menuItem title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
+ if ([menuItem hasSubmenu])
+ [self fixMenu:[menuItem submenu] withAppName:appName];
+ }
+ [ aMenu sizeToFit ];
+}
+
+#else
+
+static void setApplicationMenu(void)
+{
+ /* warning: this code is very odd */
+ NSMenu *appleMenu;
+ NSMenuItem *menuItem;
+ NSString *title;
+ NSString *appName;
+
+ appName = getApplicationName();
+ appleMenu = [[NSMenu alloc] initWithTitle:@""];
+
+ /* Add menu items */
+ title = [@"About " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
+
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ title = [@"Hide " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
+
+ menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
+ [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
+
+ [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
+
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ title = [@"Quit " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
+
+
+ /* Put menu into the menubar */
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
+ [menuItem setSubmenu:appleMenu];
+ [[NSApp mainMenu] addItem:menuItem];
+
+ /* Tell the application object that this is now the application menu */
+ [NSApp setAppleMenu:appleMenu];
+
+ /* Finally give up our references to the objects */
+ [appleMenu release];
+ [menuItem release];
+}
+
+/* Create a window menu */
+static void setupWindowMenu(void)
+{
+ NSMenu *windowMenu;
+ NSMenuItem *windowMenuItem;
+ NSMenuItem *menuItem;
+
+ windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
+
+ /* "Minimize" item */
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
+ [windowMenu addItem:menuItem];
+ [menuItem release];
+
+ /* Put menu into the menubar */
+ windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
+ [windowMenuItem setSubmenu:windowMenu];
+ [[NSApp mainMenu] addItem:windowMenuItem];
+
+ /* Tell the application object that this is now the window menu */
+ [NSApp setWindowsMenu:windowMenu];
+
+ /* Finally give up our references to the objects */
+ [windowMenu release];
+ [windowMenuItem release];
+}
+
+/* Replacement for NSApplicationMain */
+static void CustomApplicationMain (int argc, char **argv)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ SDLMain *sdlMain;
+
+ /* Ensure the application object is initialised */
+ [SDLApplication sharedApplication];
+
+#ifdef SDL_USE_CPS
+ {
+ CPSProcessSerNum PSN;
+ /* Tell the dock about us */
+ if (!CPSGetCurrentProcess(&PSN))
+ if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
+ if (!CPSSetFrontProcess(&PSN))
+ [SDLApplication sharedApplication];
+ }
+#endif /* SDL_USE_CPS */
+
+ /* Set up the menubar */
+ [NSApp setMainMenu:[[NSMenu alloc] init]];
+ setApplicationMenu();
+ setupWindowMenu();
+
+ /* Create SDLMain and make it the app delegate */
+ sdlMain = [[SDLMain alloc] init];
+ [NSApp setDelegate:sdlMain];
+
+ /* Start the main event loop */
+ [NSApp run];
+
+ [sdlMain release];
+ [pool release];
+}
+
+#endif
+
+
+/*
+ * Catch document open requests...this lets us notice files when the app
+ * was launched by double-clicking a document, or when a document was
+ * dragged/dropped on the app's icon. You need to have a
+ * CFBundleDocumentsType section in your Info.plist to get this message,
+ * apparently.
+ *
+ * Files are added to gArgv, so to the app, they'll look like command line
+ * arguments. Previously, apps launched from the finder had nothing but
+ * an argv[0].
+ *
+ * This message may be received multiple times to open several docs on launch.
+ *
+ * This message is ignored once the app's mainline has been called.
+ */
+- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
+{
+ const char *temparg;
+ size_t arglen;
+ char *arg;
+ char **newargv;
+
+ if (!gFinderLaunch) /* MacOS is passing command line args. */
+ return FALSE;
+
+ if (gCalledAppMainline) /* app has started, ignore this document. */
+ return FALSE;
+
+ temparg = [filename UTF8String];
+ arglen = SDL_strlen(temparg) + 1;
+ arg = (char *) SDL_malloc(arglen);
+ if (arg == NULL)
+ return FALSE;
+
+ newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
+ if (newargv == NULL)
+ {
+ SDL_free(arg);
+ return FALSE;
+ }
+ gArgv = newargv;
+
+ SDL_strlcpy(arg, temparg, arglen);
+ gArgv[gArgc++] = arg;
+ gArgv[gArgc] = NULL;
+ return TRUE;
+}
+
+
+/* Called when the internal event loop has just started running */
+- (void) applicationDidFinishLaunching: (NSNotification *) note
+{
+ int status;
+
+ /* Set the working directory to the .app's parent directory */
+ [self setupWorkingDirectory:gFinderLaunch];
+
+#if SDL_USE_NIB_FILE
+ /* Set the main menu to contain the real app name instead of "SDL App" */
+ [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
+#endif
+
+ /* Hand off to main application code */
+ gCalledAppMainline = TRUE;
+ status = SDL_main (gArgc, gArgv);
+
+ /* We're done, thank you for playing */
+ exit(status);
+}
+@end
+
+
+@implementation NSString (ReplaceSubString)
+
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
+{
+ unsigned int bufferSize;
+ unsigned int selfLen = [self length];
+ unsigned int aStringLen = [aString length];
+ unichar *buffer;
+ NSRange localRange;
+ NSString *result;
+
+ bufferSize = selfLen + aStringLen - aRange.length;
+ buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar));
+
+ /* Get first part into buffer */
+ localRange.location = 0;
+ localRange.length = aRange.location;
+ [self getCharacters:buffer range:localRange];
+
+ /* Get middle part into buffer */
+ localRange.location = 0;
+ localRange.length = aStringLen;
+ [aString getCharacters:(buffer+aRange.location) range:localRange];
+
+ /* Get last part into buffer */
+ localRange.location = aRange.location + aRange.length;
+ localRange.length = selfLen - localRange.location;
+ [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];
+
+ /* Build output string */
+ result = [NSString stringWithCharacters:buffer length:bufferSize];
+
+ NSDeallocateMemoryPages(buffer, bufferSize);
+
+ return result;
+}
+
+@end
+
+
+
+#ifdef main
+# undef main
+#endif
+
+
+/* Main entry point to executable - should *not* be SDL_main! */
+int main (int argc, char **argv)
+{
+ /* Copy the arguments into a global variable */
+ /* This is passed if we are launched by double-clicking */
+ if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
+ gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
+ gArgv[0] = argv[0];
+ gArgv[1] = NULL;
+ gArgc = 1;
+ gFinderLaunch = YES;
+ } else {
+ int i;
+ gArgc = argc;
+ gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
+ for (i = 0; i <= argc; i++)
+ gArgv[i] = argv[i];
+ gFinderLaunch = NO;
+ }
+
+#if SDL_USE_NIB_FILE
+ [SDLApplication poseAsClass:[NSApplication class]];
+ NSApplicationMain (argc, argv);
+#else
+ CustomApplicationMain (argc, argv);
+#endif
+ return 0;
+}
+
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch
new file mode 100644
index 0000000..0009507
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch
@@ -0,0 +1,9 @@
+//
+// Prefix header for all source files of the 'ÇPROJECTNAMEÈ' target in the 'ÇPROJECTNAMEÈ' project
+//
+
+#include "SDL.h"
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns
new file mode 100644
index 0000000..ae0b02b
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns
Binary files differ
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
new file mode 100644
index 0000000..1dcbea2
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
@@ -0,0 +1,12 @@
+{
+ 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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/project.pbxproj b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..c61e527
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/project.pbxproj
@@ -0,0 +1,320 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 42;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; };
+ 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; };
+ 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; };
+ 002F3A3F09D088BA00EBEB88 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A3E09D088BA00EBEB88 /* main.c */; };
+ 002F3AF109D08F1000EBEB88 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 002F3AEF09D08F1000EBEB88 /* SDLMain.nib */; };
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */,
+ );
+ name = "Copy Frameworks into .app bundle";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = "<absolute>"; };
+ 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; };
+ 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; };
+ 002F3A3E09D088BA00EBEB88 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = SOURCE_ROOT; };
+ 002F3AF009D08F1000EBEB88 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/SDLMain.nib; sourceTree = "<group>"; };
+ 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+ 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "___PROJECTNAME____Prefix.pch"; sourceTree = "<group>"; };
+ 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
+ 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "___PROJECTNAME___.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8D11072E0486CEB800E47090 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */,
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 080E96DDFE201D6D7F000001 /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ 002F3A2B09D0888800EBEB88 /* SDLMain.h */,
+ 002F3A2C09D0888800EBEB88 /* SDLMain.m */,
+ );
+ name = Classes;
+ sourceTree = "<group>";
+ };
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 002F39F909D0881F00EBEB88 /* SDL.framework */,
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
+ );
+ name = "Linked Frameworks";
+ sourceTree = "<group>";
+ };
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */,
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 19C28FACFE9D520D11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */ = {
+ isa = PBXGroup;
+ children = (
+ 080E96DDFE201D6D7F000001 /* Classes */,
+ 29B97315FDCFA39411CA2CEA /* Other Sources */,
+ 29B97317FDCFA39411CA2CEA /* Resources */,
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
+ 19C28FACFE9D520D11CA2CBB /* Products */,
+ );
+ name = "___PROJECTNAMEASXML___";
+ sourceTree = "<group>";
+ };
+ 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */,
+ 002F3A3E09D088BA00EBEB88 /* main.c */,
+ );
+ name = "Other Sources";
+ sourceTree = "<group>";
+ };
+ 29B97317FDCFA39411CA2CEA /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 8D1107310486CEB800E47090 /* Info.plist */,
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
+ 002F3AEF09D08F1000EBEB88 /* SDLMain.nib */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */;
+ buildPhases = (
+ 8D1107290486CEB800E47090 /* Resources */,
+ 8D11072C0486CEB800E47090 /* Sources */,
+ 8D11072E0486CEB800E47090 /* Frameworks */,
+ 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "___PROJECTNAME___";
+ productInstallPath = "$(HOME)/Applications";
+ productName = "___PROJECTNAME___";
+ productReference = 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 29B97313FDCFA39411CA2CEA /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */;
+ compatibilityVersion = "Xcode 2.4";
+ hasScannedForEncodings = 1;
+ mainGroup = 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 8D1107290486CEB800E47090 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
+ 002F3AF109D08F1000EBEB88 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8D11072C0486CEB800E47090 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */,
+ 002F3A3F09D088BA00EBEB88 /* main.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 002F3AEF09D08F1000EBEB88 /* SDLMain.nib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 002F3AF009D08F1000EBEB88 /* English */,
+ );
+ name = SDLMain.nib;
+ sourceTree = "<group>";
+ };
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 089C165DFE840E0CC02AAC07 /* English */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ C01FCF4B08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(HOME)/Applications";
+ PRODUCT_NAME = "___PROJECTNAME___";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ C01FCF4C08A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+ GCC_MODEL_TUNING = G5;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(HOME)/Applications";
+ PRODUCT_NAME = "___PROJECTNAME___";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+ C01FCF4F08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks",
+ /Library/Frameworks,
+ "$(FRAMEWORK_SEARCH_PATHS)",
+ );
+ GCC_VERSION = 4.0;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks/SDL.framework/Headers",
+ /Library/Frameworks/SDL.framework/Headers,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ PREBINDING = NO;
+ SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+ };
+ name = Debug;
+ };
+ C01FCF5008A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks",
+ /Library/Frameworks,
+ "$(FRAMEWORK_SEARCH_PATHS)",
+ );
+ GCC_VERSION = 4.0;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks/SDL.framework/Headers",
+ /Library/Frameworks/SDL.framework/Headers,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ PREBINDING = NO;
+ SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4B08A954540054247B /* Debug */,
+ C01FCF4C08A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4F08A954540054247B /* Debug */,
+ C01FCF5008A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
+}
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/main.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/main.c
new file mode 100644
index 0000000..7115de9
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL Cocoa Application/main.c
@@ -0,0 +1,65 @@
+
+/* 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/English.lproj/InfoPlist.strings b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/English.lproj/InfoPlist.strings
new file mode 100644
index 0000000..6e721b0
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/English.lproj/InfoPlist.strings
Binary files differ
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/Info.plist b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/Info.plist
new file mode 100644
index 0000000..a2e9429
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/Info.plist
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.___PROJECTNAMEASXML___</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+ <key>LSMinimumSystemVersionByArchitecture</key>
+ <dict>
+ <key>x86_64</key>
+ <string>10.6.0</string>
+ <key>i386</key>
+ <string>10.4.0</string>
+ <key>ppc</key>
+ <string>10.4.0</string>
+ </dict>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/SDLMain.h b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/SDLMain.h
new file mode 100644
index 0000000..c56d90c
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/SDLMain.h
@@ -0,0 +1,16 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#ifndef _SDLMain_h_
+#define _SDLMain_h_
+
+#import <Cocoa/Cocoa.h>
+
+@interface SDLMain : NSObject
+@end
+
+#endif /* _SDLMain_h_ */
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/SDLMain.m b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/SDLMain.m
new file mode 100644
index 0000000..b065a20
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/SDLMain.m
@@ -0,0 +1,383 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#include "SDL.h"
+#include "SDLMain.h"
+#include <sys/param.h> /* for MAXPATHLEN */
+#include <unistd.h>
+
+/* For some reaon, Apple removed setAppleMenu from the headers in 10.4,
+ but the method still is there and works. To avoid warnings, we declare
+ it ourselves here. */
+@interface NSApplication(SDL_Missing_Methods)
+- (void)setAppleMenu:(NSMenu *)menu;
+@end
+
+/* Use this flag to determine whether we use SDLMain.nib or not */
+#define SDL_USE_NIB_FILE 0
+
+/* Use this flag to determine whether we use CPS (docking) or not */
+#define SDL_USE_CPS 1
+#ifdef SDL_USE_CPS
+/* Portions of CPS.h */
+typedef struct CPSProcessSerNum
+{
+ UInt32 lo;
+ UInt32 hi;
+} CPSProcessSerNum;
+
+extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
+extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
+extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
+
+#endif /* SDL_USE_CPS */
+
+static int gArgc;
+static char **gArgv;
+static BOOL gFinderLaunch;
+static BOOL gCalledAppMainline = FALSE;
+
+static NSString *getApplicationName(void)
+{
+ const NSDictionary *dict;
+ NSString *appName = 0;
+
+ /* Determine the application name */
+ dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
+ if (dict)
+ appName = [dict objectForKey: @"CFBundleName"];
+
+ if (![appName length])
+ appName = [[NSProcessInfo processInfo] processName];
+
+ return appName;
+}
+
+#if SDL_USE_NIB_FILE
+/* A helper category for NSString */
+@interface NSString (ReplaceSubString)
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
+@end
+#endif
+
+@interface SDLApplication : NSApplication
+@end
+
+@implementation SDLApplication
+/* Invoked from the Quit menu item */
+- (void)terminate:(id)sender
+{
+ /* Post a SDL_QUIT event */
+ SDL_Event event;
+ event.type = SDL_QUIT;
+ SDL_PushEvent(&event);
+}
+@end
+
+/* The main class of the application, the application's delegate */
+@implementation SDLMain
+
+/* Set the working directory to the .app's parent directory */
+- (void) setupWorkingDirectory:(BOOL)shouldChdir
+{
+ if (shouldChdir)
+ {
+ char parentdir[MAXPATHLEN];
+ CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
+ CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
+ if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) {
+ chdir(parentdir); /* chdir to the binary app's parent */
+ }
+ CFRelease(url);
+ CFRelease(url2);
+ }
+}
+
+#if SDL_USE_NIB_FILE
+
+/* Fix menu to contain the real app name instead of "SDL App" */
+- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
+{
+ NSRange aRange;
+ NSEnumerator *enumerator;
+ NSMenuItem *menuItem;
+
+ aRange = [[aMenu title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
+
+ enumerator = [[aMenu itemArray] objectEnumerator];
+ while ((menuItem = [enumerator nextObject]))
+ {
+ aRange = [[menuItem title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
+ if ([menuItem hasSubmenu])
+ [self fixMenu:[menuItem submenu] withAppName:appName];
+ }
+ [ aMenu sizeToFit ];
+}
+
+#else
+
+static void setApplicationMenu(void)
+{
+ /* warning: this code is very odd */
+ NSMenu *appleMenu;
+ NSMenuItem *menuItem;
+ NSString *title;
+ NSString *appName;
+
+ appName = getApplicationName();
+ appleMenu = [[NSMenu alloc] initWithTitle:@""];
+
+ /* Add menu items */
+ title = [@"About " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
+
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ title = [@"Hide " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
+
+ menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
+ [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
+
+ [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
+
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ title = [@"Quit " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
+
+
+ /* Put menu into the menubar */
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
+ [menuItem setSubmenu:appleMenu];
+ [[NSApp mainMenu] addItem:menuItem];
+
+ /* Tell the application object that this is now the application menu */
+ [NSApp setAppleMenu:appleMenu];
+
+ /* Finally give up our references to the objects */
+ [appleMenu release];
+ [menuItem release];
+}
+
+/* Create a window menu */
+static void setupWindowMenu(void)
+{
+ NSMenu *windowMenu;
+ NSMenuItem *windowMenuItem;
+ NSMenuItem *menuItem;
+
+ windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
+
+ /* "Minimize" item */
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
+ [windowMenu addItem:menuItem];
+ [menuItem release];
+
+ /* Put menu into the menubar */
+ windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
+ [windowMenuItem setSubmenu:windowMenu];
+ [[NSApp mainMenu] addItem:windowMenuItem];
+
+ /* Tell the application object that this is now the window menu */
+ [NSApp setWindowsMenu:windowMenu];
+
+ /* Finally give up our references to the objects */
+ [windowMenu release];
+ [windowMenuItem release];
+}
+
+/* Replacement for NSApplicationMain */
+static void CustomApplicationMain (int argc, char **argv)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ SDLMain *sdlMain;
+
+ /* Ensure the application object is initialised */
+ [SDLApplication sharedApplication];
+
+#ifdef SDL_USE_CPS
+ {
+ CPSProcessSerNum PSN;
+ /* Tell the dock about us */
+ if (!CPSGetCurrentProcess(&PSN))
+ if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
+ if (!CPSSetFrontProcess(&PSN))
+ [SDLApplication sharedApplication];
+ }
+#endif /* SDL_USE_CPS */
+
+ /* Set up the menubar */
+ [NSApp setMainMenu:[[NSMenu alloc] init]];
+ setApplicationMenu();
+ setupWindowMenu();
+
+ /* Create SDLMain and make it the app delegate */
+ sdlMain = [[SDLMain alloc] init];
+ [NSApp setDelegate:sdlMain];
+
+ /* Start the main event loop */
+ [NSApp run];
+
+ [sdlMain release];
+ [pool release];
+}
+
+#endif
+
+
+/*
+ * Catch document open requests...this lets us notice files when the app
+ * was launched by double-clicking a document, or when a document was
+ * dragged/dropped on the app's icon. You need to have a
+ * CFBundleDocumentsType section in your Info.plist to get this message,
+ * apparently.
+ *
+ * Files are added to gArgv, so to the app, they'll look like command line
+ * arguments. Previously, apps launched from the finder had nothing but
+ * an argv[0].
+ *
+ * This message may be received multiple times to open several docs on launch.
+ *
+ * This message is ignored once the app's mainline has been called.
+ */
+- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
+{
+ const char *temparg;
+ size_t arglen;
+ char *arg;
+ char **newargv;
+
+ if (!gFinderLaunch) /* MacOS is passing command line args. */
+ return FALSE;
+
+ if (gCalledAppMainline) /* app has started, ignore this document. */
+ return FALSE;
+
+ temparg = [filename UTF8String];
+ arglen = SDL_strlen(temparg) + 1;
+ arg = (char *) SDL_malloc(arglen);
+ if (arg == NULL)
+ return FALSE;
+
+ newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
+ if (newargv == NULL)
+ {
+ SDL_free(arg);
+ return FALSE;
+ }
+ gArgv = newargv;
+
+ SDL_strlcpy(arg, temparg, arglen);
+ gArgv[gArgc++] = arg;
+ gArgv[gArgc] = NULL;
+ return TRUE;
+}
+
+
+/* Called when the internal event loop has just started running */
+- (void) applicationDidFinishLaunching: (NSNotification *) note
+{
+ int status;
+
+ /* Set the working directory to the .app's parent directory */
+ [self setupWorkingDirectory:gFinderLaunch];
+
+#if SDL_USE_NIB_FILE
+ /* Set the main menu to contain the real app name instead of "SDL App" */
+ [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
+#endif
+
+ /* Hand off to main application code */
+ gCalledAppMainline = TRUE;
+ status = SDL_main (gArgc, gArgv);
+
+ /* We're done, thank you for playing */
+ exit(status);
+}
+@end
+
+
+@implementation NSString (ReplaceSubString)
+
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
+{
+ unsigned int bufferSize;
+ unsigned int selfLen = [self length];
+ unsigned int aStringLen = [aString length];
+ unichar *buffer;
+ NSRange localRange;
+ NSString *result;
+
+ bufferSize = selfLen + aStringLen - aRange.length;
+ buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar));
+
+ /* Get first part into buffer */
+ localRange.location = 0;
+ localRange.length = aRange.location;
+ [self getCharacters:buffer range:localRange];
+
+ /* Get middle part into buffer */
+ localRange.location = 0;
+ localRange.length = aStringLen;
+ [aString getCharacters:(buffer+aRange.location) range:localRange];
+
+ /* Get last part into buffer */
+ localRange.location = aRange.location + aRange.length;
+ localRange.length = selfLen - localRange.location;
+ [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];
+
+ /* Build output string */
+ result = [NSString stringWithCharacters:buffer length:bufferSize];
+
+ NSDeallocateMemoryPages(buffer, bufferSize);
+
+ return result;
+}
+
+@end
+
+
+
+#ifdef main
+# undef main
+#endif
+
+
+/* Main entry point to executable - should *not* be SDL_main! */
+int main (int argc, char **argv)
+{
+ /* Copy the arguments into a global variable */
+ /* This is passed if we are launched by double-clicking */
+ if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
+ gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
+ gArgv[0] = argv[0];
+ gArgv[1] = NULL;
+ gArgc = 1;
+ gFinderLaunch = YES;
+ } else {
+ int i;
+ gArgc = argc;
+ gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
+ for (i = 0; i <= argc; i++)
+ gArgv[i] = argv[i];
+ gFinderLaunch = NO;
+ }
+
+#if SDL_USE_NIB_FILE
+ [SDLApplication poseAsClass:[NSApplication class]];
+ NSApplicationMain (argc, argv);
+#else
+ CustomApplicationMain (argc, argv);
+#endif
+ return 0;
+}
+
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch
new file mode 100644
index 0000000..0009507
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch
@@ -0,0 +1,9 @@
+//
+// Prefix header for all source files of the 'ÇPROJECTNAMEÈ' target in the 'ÇPROJECTNAMEÈ' project
+//
+
+#include "SDL.h"
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns
new file mode 100644
index 0000000..ae0b02b
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns
Binary files differ
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
new file mode 100644
index 0000000..ba87745
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
@@ -0,0 +1,12 @@
+{
+ 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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/project.pbxproj b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..529d444
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/project.pbxproj
@@ -0,0 +1,350 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 42;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; };
+ 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; };
+ 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; };
+ 002F3A3F09D088BA00EBEB88 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A3E09D088BA00EBEB88 /* main.c */; };
+ 002F3BFA09D0938900EBEB88 /* atlantis.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF409D0938900EBEB88 /* atlantis.c */; };
+ 002F3BFC09D0938900EBEB88 /* dolphin.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF609D0938900EBEB88 /* dolphin.c */; };
+ 002F3BFD09D0938900EBEB88 /* shark.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF709D0938900EBEB88 /* shark.c */; };
+ 002F3BFE09D0938900EBEB88 /* swim.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF809D0938900EBEB88 /* swim.c */; };
+ 002F3BFF09D0938900EBEB88 /* whale.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF909D0938900EBEB88 /* whale.c */; };
+ 002F3C0109D093BD00EBEB88 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F3C0009D093BD00EBEB88 /* OpenGL.framework */; };
+ 002F3C6109D0951E00EBEB88 /* GLUT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F3C6009D0951E00EBEB88 /* GLUT.framework */; };
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */,
+ );
+ name = "Copy Frameworks into .app bundle";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = "<absolute>"; };
+ 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; };
+ 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; };
+ 002F3A3E09D088BA00EBEB88 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = SOURCE_ROOT; };
+ 002F3BF409D0938900EBEB88 /* atlantis.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = atlantis.c; path = atlantis/atlantis.c; sourceTree = SOURCE_ROOT; };
+ 002F3BF509D0938900EBEB88 /* atlantis.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = atlantis.h; path = atlantis/atlantis.h; sourceTree = SOURCE_ROOT; };
+ 002F3BF609D0938900EBEB88 /* dolphin.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = dolphin.c; path = atlantis/dolphin.c; sourceTree = SOURCE_ROOT; };
+ 002F3BF709D0938900EBEB88 /* shark.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = shark.c; path = atlantis/shark.c; sourceTree = SOURCE_ROOT; };
+ 002F3BF809D0938900EBEB88 /* swim.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = swim.c; path = atlantis/swim.c; sourceTree = SOURCE_ROOT; };
+ 002F3BF909D0938900EBEB88 /* whale.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = whale.c; path = atlantis/whale.c; sourceTree = SOURCE_ROOT; };
+ 002F3C0009D093BD00EBEB88 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
+ 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 = "<group>"; };
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+ 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "___PROJECTNAME____Prefix.pch"; sourceTree = "<group>"; };
+ 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
+ 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 = "<group>";
+ };
+ 080E96DDFE201D6D7F000001 /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ 002F3A2B09D0888800EBEB88 /* SDLMain.h */,
+ 002F3A2C09D0888800EBEB88 /* SDLMain.m */,
+ );
+ name = Classes;
+ sourceTree = "<group>";
+ };
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 002F39F909D0881F00EBEB88 /* SDL.framework */,
+ 002F3C6009D0951E00EBEB88 /* GLUT.framework */,
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
+ 002F3C0009D093BD00EBEB88 /* OpenGL.framework */,
+ );
+ name = "Linked Frameworks";
+ sourceTree = "<group>";
+ };
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */,
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 19C28FACFE9D520D11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */ = {
+ isa = PBXGroup;
+ children = (
+ 080E96DDFE201D6D7F000001 /* Classes */,
+ 29B97315FDCFA39411CA2CEA /* Other Sources */,
+ 29B97317FDCFA39411CA2CEA /* Resources */,
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
+ 19C28FACFE9D520D11CA2CBB /* Products */,
+ );
+ name = "___PROJECTNAMEASXML___";
+ sourceTree = "<group>";
+ };
+ 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 002F3BF309D0937800EBEB88 /* atlantis */,
+ 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */,
+ 002F3A3E09D088BA00EBEB88 /* main.c */,
+ );
+ name = "Other Sources";
+ sourceTree = "<group>";
+ };
+ 29B97317FDCFA39411CA2CEA /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 8D1107310486CEB800E47090 /* Info.plist */,
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */;
+ buildPhases = (
+ 8D1107290486CEB800E47090 /* Resources */,
+ 8D11072C0486CEB800E47090 /* Sources */,
+ 8D11072E0486CEB800E47090 /* Frameworks */,
+ 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "___PROJECTNAME___";
+ productInstallPath = "$(HOME)/Applications";
+ productName = "___PROJECTNAME___";
+ productReference = 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 29B97313FDCFA39411CA2CEA /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */;
+ compatibilityVersion = "Xcode 2.4";
+ hasScannedForEncodings = 1;
+ mainGroup = 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 8D1107290486CEB800E47090 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8D11072C0486CEB800E47090 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */,
+ 002F3A3F09D088BA00EBEB88 /* main.c in Sources */,
+ 002F3BFA09D0938900EBEB88 /* atlantis.c in Sources */,
+ 002F3BFC09D0938900EBEB88 /* dolphin.c in Sources */,
+ 002F3BFD09D0938900EBEB88 /* shark.c in Sources */,
+ 002F3BFE09D0938900EBEB88 /* swim.c in Sources */,
+ 002F3BFF09D0938900EBEB88 /* whale.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 089C165DFE840E0CC02AAC07 /* English */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ C01FCF4B08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(HOME)/Applications";
+ PRODUCT_NAME = "___PROJECTNAME___";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ C01FCF4C08A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = (
+ ppc,
+ i386,
+ );
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+ GCC_MODEL_TUNING = G5;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(HOME)/Applications";
+ PRODUCT_NAME = "___PROJECTNAME___";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+ C01FCF4F08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks",
+ /Library/Frameworks,
+ "$(FRAMEWORK_SEARCH_PATHS)",
+ );
+ GCC_VERSION = 4.0;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks/SDL.framework/Headers",
+ /Library/Frameworks/SDL.framework/Headers,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ PREBINDING = NO;
+ SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+ };
+ name = Debug;
+ };
+ C01FCF5008A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks",
+ /Library/Frameworks,
+ "$(FRAMEWORK_SEARCH_PATHS)",
+ );
+ GCC_VERSION = 4.0;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks/SDL.framework/Headers",
+ /Library/Frameworks/SDL.framework/Headers,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ PREBINDING = NO;
+ SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4B08A954540054247B /* Debug */,
+ C01FCF4C08A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4F08A954540054247B /* Debug */,
+ C01FCF5008A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
+}
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/atlantis.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/atlantis.c
new file mode 100644
index 0000000..4efdf6c
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/atlantis.c
@@ -0,0 +1,459 @@
+
+/* 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <sys/time.h>
+#include <GLUT/glut.h>
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/atlantis.h b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/atlantis.h
new file mode 100644
index 0000000..6ccf2d5
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/atlantis.h
@@ -0,0 +1,65 @@
+/**
+ * (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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/dolphin.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/dolphin.c
new file mode 100644
index 0000000..9fba3ba
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/dolphin.c
@@ -0,0 +1,1934 @@
+/**
+ * (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 <math.h>
+#include <GLUT/glut.h>
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/shark.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/shark.c
new file mode 100644
index 0000000..9c847db
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/shark.c
@@ -0,0 +1,1308 @@
+/**
+ * (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 <GLUT/glut.h>
+#include <math.h>
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/swim.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/swim.c
new file mode 100644
index 0000000..cac7b60
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/swim.c
@@ -0,0 +1,188 @@
+/**
+ * (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 <math.h>
+#include <stdlib.h> /* For rand(). */
+#include <GLUT/glut.h>
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/whale.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/whale.c
new file mode 100644
index 0000000..828640a
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/atlantis/whale.c
@@ -0,0 +1,1798 @@
+/**
+ * (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 <GLUT/glut.h>
+#include <math.h>
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/main.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/main.c
new file mode 100644
index 0000000..b7794b3
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeLeopard/SDL OpenGL Application/main.c
@@ -0,0 +1,179 @@
+
+/* 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/English.lproj/InfoPlist.strings b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/English.lproj/InfoPlist.strings
new file mode 100644
index 0000000..6e721b0
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/English.lproj/InfoPlist.strings
Binary files differ
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/Info.plist b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/Info.plist
new file mode 100644
index 0000000..e433204
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/Info.plist
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.___PROJECTNAMEASXML___</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+ <key>LSMinimumSystemVersionByArchitecture</key>
+ <dict>
+ <key>x86_64</key>
+ <string>10.6.0</string>
+ <key>i386</key>
+ <string>10.4.0</string>
+ <key>ppc</key>
+ <string>10.4.0</string>
+ </dict>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/SDLMain.h b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/SDLMain.h
new file mode 100644
index 0000000..c56d90c
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/SDLMain.h
@@ -0,0 +1,16 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#ifndef _SDLMain_h_
+#define _SDLMain_h_
+
+#import <Cocoa/Cocoa.h>
+
+@interface SDLMain : NSObject
+@end
+
+#endif /* _SDLMain_h_ */
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/SDLMain.m b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/SDLMain.m
new file mode 100644
index 0000000..b065a20
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/SDLMain.m
@@ -0,0 +1,383 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#include "SDL.h"
+#include "SDLMain.h"
+#include <sys/param.h> /* for MAXPATHLEN */
+#include <unistd.h>
+
+/* For some reaon, Apple removed setAppleMenu from the headers in 10.4,
+ but the method still is there and works. To avoid warnings, we declare
+ it ourselves here. */
+@interface NSApplication(SDL_Missing_Methods)
+- (void)setAppleMenu:(NSMenu *)menu;
+@end
+
+/* Use this flag to determine whether we use SDLMain.nib or not */
+#define SDL_USE_NIB_FILE 0
+
+/* Use this flag to determine whether we use CPS (docking) or not */
+#define SDL_USE_CPS 1
+#ifdef SDL_USE_CPS
+/* Portions of CPS.h */
+typedef struct CPSProcessSerNum
+{
+ UInt32 lo;
+ UInt32 hi;
+} CPSProcessSerNum;
+
+extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
+extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
+extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
+
+#endif /* SDL_USE_CPS */
+
+static int gArgc;
+static char **gArgv;
+static BOOL gFinderLaunch;
+static BOOL gCalledAppMainline = FALSE;
+
+static NSString *getApplicationName(void)
+{
+ const NSDictionary *dict;
+ NSString *appName = 0;
+
+ /* Determine the application name */
+ dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
+ if (dict)
+ appName = [dict objectForKey: @"CFBundleName"];
+
+ if (![appName length])
+ appName = [[NSProcessInfo processInfo] processName];
+
+ return appName;
+}
+
+#if SDL_USE_NIB_FILE
+/* A helper category for NSString */
+@interface NSString (ReplaceSubString)
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
+@end
+#endif
+
+@interface SDLApplication : NSApplication
+@end
+
+@implementation SDLApplication
+/* Invoked from the Quit menu item */
+- (void)terminate:(id)sender
+{
+ /* Post a SDL_QUIT event */
+ SDL_Event event;
+ event.type = SDL_QUIT;
+ SDL_PushEvent(&event);
+}
+@end
+
+/* The main class of the application, the application's delegate */
+@implementation SDLMain
+
+/* Set the working directory to the .app's parent directory */
+- (void) setupWorkingDirectory:(BOOL)shouldChdir
+{
+ if (shouldChdir)
+ {
+ char parentdir[MAXPATHLEN];
+ CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
+ CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
+ if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) {
+ chdir(parentdir); /* chdir to the binary app's parent */
+ }
+ CFRelease(url);
+ CFRelease(url2);
+ }
+}
+
+#if SDL_USE_NIB_FILE
+
+/* Fix menu to contain the real app name instead of "SDL App" */
+- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
+{
+ NSRange aRange;
+ NSEnumerator *enumerator;
+ NSMenuItem *menuItem;
+
+ aRange = [[aMenu title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
+
+ enumerator = [[aMenu itemArray] objectEnumerator];
+ while ((menuItem = [enumerator nextObject]))
+ {
+ aRange = [[menuItem title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
+ if ([menuItem hasSubmenu])
+ [self fixMenu:[menuItem submenu] withAppName:appName];
+ }
+ [ aMenu sizeToFit ];
+}
+
+#else
+
+static void setApplicationMenu(void)
+{
+ /* warning: this code is very odd */
+ NSMenu *appleMenu;
+ NSMenuItem *menuItem;
+ NSString *title;
+ NSString *appName;
+
+ appName = getApplicationName();
+ appleMenu = [[NSMenu alloc] initWithTitle:@""];
+
+ /* Add menu items */
+ title = [@"About " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
+
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ title = [@"Hide " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
+
+ menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
+ [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
+
+ [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
+
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ title = [@"Quit " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
+
+
+ /* Put menu into the menubar */
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
+ [menuItem setSubmenu:appleMenu];
+ [[NSApp mainMenu] addItem:menuItem];
+
+ /* Tell the application object that this is now the application menu */
+ [NSApp setAppleMenu:appleMenu];
+
+ /* Finally give up our references to the objects */
+ [appleMenu release];
+ [menuItem release];
+}
+
+/* Create a window menu */
+static void setupWindowMenu(void)
+{
+ NSMenu *windowMenu;
+ NSMenuItem *windowMenuItem;
+ NSMenuItem *menuItem;
+
+ windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
+
+ /* "Minimize" item */
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
+ [windowMenu addItem:menuItem];
+ [menuItem release];
+
+ /* Put menu into the menubar */
+ windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
+ [windowMenuItem setSubmenu:windowMenu];
+ [[NSApp mainMenu] addItem:windowMenuItem];
+
+ /* Tell the application object that this is now the window menu */
+ [NSApp setWindowsMenu:windowMenu];
+
+ /* Finally give up our references to the objects */
+ [windowMenu release];
+ [windowMenuItem release];
+}
+
+/* Replacement for NSApplicationMain */
+static void CustomApplicationMain (int argc, char **argv)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ SDLMain *sdlMain;
+
+ /* Ensure the application object is initialised */
+ [SDLApplication sharedApplication];
+
+#ifdef SDL_USE_CPS
+ {
+ CPSProcessSerNum PSN;
+ /* Tell the dock about us */
+ if (!CPSGetCurrentProcess(&PSN))
+ if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
+ if (!CPSSetFrontProcess(&PSN))
+ [SDLApplication sharedApplication];
+ }
+#endif /* SDL_USE_CPS */
+
+ /* Set up the menubar */
+ [NSApp setMainMenu:[[NSMenu alloc] init]];
+ setApplicationMenu();
+ setupWindowMenu();
+
+ /* Create SDLMain and make it the app delegate */
+ sdlMain = [[SDLMain alloc] init];
+ [NSApp setDelegate:sdlMain];
+
+ /* Start the main event loop */
+ [NSApp run];
+
+ [sdlMain release];
+ [pool release];
+}
+
+#endif
+
+
+/*
+ * Catch document open requests...this lets us notice files when the app
+ * was launched by double-clicking a document, or when a document was
+ * dragged/dropped on the app's icon. You need to have a
+ * CFBundleDocumentsType section in your Info.plist to get this message,
+ * apparently.
+ *
+ * Files are added to gArgv, so to the app, they'll look like command line
+ * arguments. Previously, apps launched from the finder had nothing but
+ * an argv[0].
+ *
+ * This message may be received multiple times to open several docs on launch.
+ *
+ * This message is ignored once the app's mainline has been called.
+ */
+- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
+{
+ const char *temparg;
+ size_t arglen;
+ char *arg;
+ char **newargv;
+
+ if (!gFinderLaunch) /* MacOS is passing command line args. */
+ return FALSE;
+
+ if (gCalledAppMainline) /* app has started, ignore this document. */
+ return FALSE;
+
+ temparg = [filename UTF8String];
+ arglen = SDL_strlen(temparg) + 1;
+ arg = (char *) SDL_malloc(arglen);
+ if (arg == NULL)
+ return FALSE;
+
+ newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
+ if (newargv == NULL)
+ {
+ SDL_free(arg);
+ return FALSE;
+ }
+ gArgv = newargv;
+
+ SDL_strlcpy(arg, temparg, arglen);
+ gArgv[gArgc++] = arg;
+ gArgv[gArgc] = NULL;
+ return TRUE;
+}
+
+
+/* Called when the internal event loop has just started running */
+- (void) applicationDidFinishLaunching: (NSNotification *) note
+{
+ int status;
+
+ /* Set the working directory to the .app's parent directory */
+ [self setupWorkingDirectory:gFinderLaunch];
+
+#if SDL_USE_NIB_FILE
+ /* Set the main menu to contain the real app name instead of "SDL App" */
+ [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
+#endif
+
+ /* Hand off to main application code */
+ gCalledAppMainline = TRUE;
+ status = SDL_main (gArgc, gArgv);
+
+ /* We're done, thank you for playing */
+ exit(status);
+}
+@end
+
+
+@implementation NSString (ReplaceSubString)
+
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
+{
+ unsigned int bufferSize;
+ unsigned int selfLen = [self length];
+ unsigned int aStringLen = [aString length];
+ unichar *buffer;
+ NSRange localRange;
+ NSString *result;
+
+ bufferSize = selfLen + aStringLen - aRange.length;
+ buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar));
+
+ /* Get first part into buffer */
+ localRange.location = 0;
+ localRange.length = aRange.location;
+ [self getCharacters:buffer range:localRange];
+
+ /* Get middle part into buffer */
+ localRange.location = 0;
+ localRange.length = aStringLen;
+ [aString getCharacters:(buffer+aRange.location) range:localRange];
+
+ /* Get last part into buffer */
+ localRange.location = aRange.location + aRange.length;
+ localRange.length = selfLen - localRange.location;
+ [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];
+
+ /* Build output string */
+ result = [NSString stringWithCharacters:buffer length:bufferSize];
+
+ NSDeallocateMemoryPages(buffer, bufferSize);
+
+ return result;
+}
+
+@end
+
+
+
+#ifdef main
+# undef main
+#endif
+
+
+/* Main entry point to executable - should *not* be SDL_main! */
+int main (int argc, char **argv)
+{
+ /* Copy the arguments into a global variable */
+ /* This is passed if we are launched by double-clicking */
+ if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
+ gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
+ gArgv[0] = argv[0];
+ gArgv[1] = NULL;
+ gArgc = 1;
+ gFinderLaunch = YES;
+ } else {
+ int i;
+ gArgc = argc;
+ gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
+ for (i = 0; i <= argc; i++)
+ gArgv[i] = argv[i];
+ gFinderLaunch = NO;
+ }
+
+#if SDL_USE_NIB_FILE
+ [SDLApplication poseAsClass:[NSApplication class]];
+ NSApplicationMain (argc, argv);
+#else
+ CustomApplicationMain (argc, argv);
+#endif
+ return 0;
+}
+
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch
new file mode 100644
index 0000000..0009507
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch
@@ -0,0 +1,9 @@
+//
+// Prefix header for all source files of the 'ÇPROJECTNAMEÈ' target in the 'ÇPROJECTNAMEÈ' project
+//
+
+#include "SDL.h"
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns
new file mode 100644
index 0000000..ae0b02b
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns
Binary files differ
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
new file mode 100644
index 0000000..d9ca454
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
@@ -0,0 +1,12 @@
+{
+ 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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/project.pbxproj b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..d6553a7
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/___PROJECTNAME___.xcodeproj/project.pbxproj
@@ -0,0 +1,310 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; };
+ 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; };
+ 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; };
+ 002F3A3F09D088BA00EBEB88 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A3E09D088BA00EBEB88 /* main.c */; };
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */,
+ );
+ name = "Copy Frameworks into .app bundle";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = "<absolute>"; };
+ 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; };
+ 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; };
+ 002F3A3E09D088BA00EBEB88 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = SOURCE_ROOT; };
+ 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+ 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "___PROJECTNAME____Prefix.pch"; sourceTree = "<group>"; };
+ 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
+ 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "___PROJECTNAME___.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8D11072E0486CEB800E47090 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */,
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 080E96DDFE201D6D7F000001 /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ 002F3A2B09D0888800EBEB88 /* SDLMain.h */,
+ 002F3A2C09D0888800EBEB88 /* SDLMain.m */,
+ );
+ name = Classes;
+ sourceTree = "<group>";
+ };
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 002F39F909D0881F00EBEB88 /* SDL.framework */,
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
+ );
+ name = "Linked Frameworks";
+ sourceTree = "<group>";
+ };
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */,
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 19C28FACFE9D520D11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */ = {
+ isa = PBXGroup;
+ children = (
+ 080E96DDFE201D6D7F000001 /* Classes */,
+ 29B97315FDCFA39411CA2CEA /* Other Sources */,
+ 29B97317FDCFA39411CA2CEA /* Resources */,
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
+ 19C28FACFE9D520D11CA2CBB /* Products */,
+ );
+ name = "___PROJECTNAMEASXML___";
+ sourceTree = "<group>";
+ };
+ 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */,
+ 002F3A3E09D088BA00EBEB88 /* main.c */,
+ );
+ name = "Other Sources";
+ sourceTree = "<group>";
+ };
+ 29B97317FDCFA39411CA2CEA /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 8D1107310486CEB800E47090 /* Info.plist */,
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */;
+ buildPhases = (
+ 8D1107290486CEB800E47090 /* Resources */,
+ 8D11072C0486CEB800E47090 /* Sources */,
+ 8D11072E0486CEB800E47090 /* Frameworks */,
+ 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "___PROJECTNAME___";
+ productInstallPath = "$(HOME)/Applications";
+ productName = "___PROJECTNAME___";
+ productReference = 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 29B97313FDCFA39411CA2CEA /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */;
+ compatibilityVersion = "Xcode 3.2";
+ hasScannedForEncodings = 1;
+ mainGroup = 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 8D1107290486CEB800E47090 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8D11072C0486CEB800E47090 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */,
+ 002F3A3F09D088BA00EBEB88 /* main.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 089C165DFE840E0CC02AAC07 /* English */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ C01FCF4B08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(HOME)/Applications";
+ PRODUCT_NAME = "___PROJECTNAME___";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ C01FCF4C08A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+ GCC_MODEL_TUNING = G5;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(HOME)/Applications";
+ PRODUCT_NAME = "___PROJECTNAME___";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+ C01FCF4F08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks",
+ /Library/Frameworks,
+ "$(FRAMEWORK_SEARCH_PATHS)",
+ );
+ GCC_VERSION = 4.0;
+ "GCC_VERSION[arch=x86_64]" = 4.2;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks/SDL.framework/Headers",
+ /Library/Frameworks/SDL.framework/Headers,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ PREBINDING = NO;
+ SDKROOT = macosx10.4;
+ "SDKROOT[arch=x86_64]" = macosx10.6;
+ };
+ name = Debug;
+ };
+ C01FCF5008A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks",
+ /Library/Frameworks,
+ "$(FRAMEWORK_SEARCH_PATHS)",
+ );
+ GCC_VERSION = 4.0;
+ "GCC_VERSION[arch=x86_64]" = 4.2;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks/SDL.framework/Headers",
+ /Library/Frameworks/SDL.framework/Headers,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ PREBINDING = NO;
+ SDKROOT = macosx10.4;
+ "SDKROOT[arch=x86_64]" = macosx10.6;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4B08A954540054247B /* Debug */,
+ C01FCF4C08A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4F08A954540054247B /* Debug */,
+ C01FCF5008A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
+}
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/main.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/main.c
new file mode 100644
index 0000000..7115de9
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Application/main.c
@@ -0,0 +1,65 @@
+
+/* 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/InfoPlist.strings b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/InfoPlist.strings
new file mode 100644
index 0000000..6e721b0
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/InfoPlist.strings
Binary files differ
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/classes.nib b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/classes.nib
new file mode 100644
index 0000000..799eaad
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/classes.nib
@@ -0,0 +1,19 @@
+{
+ 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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/info.nib b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/info.nib
new file mode 100644
index 0000000..1d6fb7e
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/info.nib
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>IBDocumentLocation</key>
+ <string>62 117 356 240 0 0 1152 848 </string>
+ <key>IBEditorPositions</key>
+ <dict>
+ <key>29</key>
+ <string>62 362 195 44 0 0 1152 848 </string>
+ </dict>
+ <key>IBFramework Version</key>
+ <string>291.0</string>
+ <key>IBOpenObjects</key>
+ <array>
+ <integer>29</integer>
+ </array>
+ <key>IBSystem Version</key>
+ <string>6L60</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/objects.nib b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/objects.nib
new file mode 100644
index 0000000..6378015
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/English.lproj/SDLMain.nib/objects.nib
Binary files differ
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/Info.plist b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/Info.plist
new file mode 100644
index 0000000..40a970f
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/Info.plist
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.___PROJECTNAMEASXML___</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+ <key>LSMinimumSystemVersionByArchitecture</key>
+ <dict>
+ <key>x86_64</key>
+ <string>10.6.0</string>
+ <key>i386</key>
+ <string>10.4.0</string>
+ <key>ppc</key>
+ <string>10.4.0</string>
+ </dict>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLMain.h b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLMain.h
new file mode 100644
index 0000000..c56d90c
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLMain.h
@@ -0,0 +1,16 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#ifndef _SDLMain_h_
+#define _SDLMain_h_
+
+#import <Cocoa/Cocoa.h>
+
+@interface SDLMain : NSObject
+@end
+
+#endif /* _SDLMain_h_ */
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLMain.m b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLMain.m
new file mode 100644
index 0000000..b065a20
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/SDLMain.m
@@ -0,0 +1,383 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#include "SDL.h"
+#include "SDLMain.h"
+#include <sys/param.h> /* for MAXPATHLEN */
+#include <unistd.h>
+
+/* For some reaon, Apple removed setAppleMenu from the headers in 10.4,
+ but the method still is there and works. To avoid warnings, we declare
+ it ourselves here. */
+@interface NSApplication(SDL_Missing_Methods)
+- (void)setAppleMenu:(NSMenu *)menu;
+@end
+
+/* Use this flag to determine whether we use SDLMain.nib or not */
+#define SDL_USE_NIB_FILE 0
+
+/* Use this flag to determine whether we use CPS (docking) or not */
+#define SDL_USE_CPS 1
+#ifdef SDL_USE_CPS
+/* Portions of CPS.h */
+typedef struct CPSProcessSerNum
+{
+ UInt32 lo;
+ UInt32 hi;
+} CPSProcessSerNum;
+
+extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
+extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
+extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
+
+#endif /* SDL_USE_CPS */
+
+static int gArgc;
+static char **gArgv;
+static BOOL gFinderLaunch;
+static BOOL gCalledAppMainline = FALSE;
+
+static NSString *getApplicationName(void)
+{
+ const NSDictionary *dict;
+ NSString *appName = 0;
+
+ /* Determine the application name */
+ dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
+ if (dict)
+ appName = [dict objectForKey: @"CFBundleName"];
+
+ if (![appName length])
+ appName = [[NSProcessInfo processInfo] processName];
+
+ return appName;
+}
+
+#if SDL_USE_NIB_FILE
+/* A helper category for NSString */
+@interface NSString (ReplaceSubString)
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
+@end
+#endif
+
+@interface SDLApplication : NSApplication
+@end
+
+@implementation SDLApplication
+/* Invoked from the Quit menu item */
+- (void)terminate:(id)sender
+{
+ /* Post a SDL_QUIT event */
+ SDL_Event event;
+ event.type = SDL_QUIT;
+ SDL_PushEvent(&event);
+}
+@end
+
+/* The main class of the application, the application's delegate */
+@implementation SDLMain
+
+/* Set the working directory to the .app's parent directory */
+- (void) setupWorkingDirectory:(BOOL)shouldChdir
+{
+ if (shouldChdir)
+ {
+ char parentdir[MAXPATHLEN];
+ CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
+ CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
+ if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) {
+ chdir(parentdir); /* chdir to the binary app's parent */
+ }
+ CFRelease(url);
+ CFRelease(url2);
+ }
+}
+
+#if SDL_USE_NIB_FILE
+
+/* Fix menu to contain the real app name instead of "SDL App" */
+- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
+{
+ NSRange aRange;
+ NSEnumerator *enumerator;
+ NSMenuItem *menuItem;
+
+ aRange = [[aMenu title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
+
+ enumerator = [[aMenu itemArray] objectEnumerator];
+ while ((menuItem = [enumerator nextObject]))
+ {
+ aRange = [[menuItem title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
+ if ([menuItem hasSubmenu])
+ [self fixMenu:[menuItem submenu] withAppName:appName];
+ }
+ [ aMenu sizeToFit ];
+}
+
+#else
+
+static void setApplicationMenu(void)
+{
+ /* warning: this code is very odd */
+ NSMenu *appleMenu;
+ NSMenuItem *menuItem;
+ NSString *title;
+ NSString *appName;
+
+ appName = getApplicationName();
+ appleMenu = [[NSMenu alloc] initWithTitle:@""];
+
+ /* Add menu items */
+ title = [@"About " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
+
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ title = [@"Hide " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
+
+ menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
+ [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
+
+ [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
+
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ title = [@"Quit " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
+
+
+ /* Put menu into the menubar */
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
+ [menuItem setSubmenu:appleMenu];
+ [[NSApp mainMenu] addItem:menuItem];
+
+ /* Tell the application object that this is now the application menu */
+ [NSApp setAppleMenu:appleMenu];
+
+ /* Finally give up our references to the objects */
+ [appleMenu release];
+ [menuItem release];
+}
+
+/* Create a window menu */
+static void setupWindowMenu(void)
+{
+ NSMenu *windowMenu;
+ NSMenuItem *windowMenuItem;
+ NSMenuItem *menuItem;
+
+ windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
+
+ /* "Minimize" item */
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
+ [windowMenu addItem:menuItem];
+ [menuItem release];
+
+ /* Put menu into the menubar */
+ windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
+ [windowMenuItem setSubmenu:windowMenu];
+ [[NSApp mainMenu] addItem:windowMenuItem];
+
+ /* Tell the application object that this is now the window menu */
+ [NSApp setWindowsMenu:windowMenu];
+
+ /* Finally give up our references to the objects */
+ [windowMenu release];
+ [windowMenuItem release];
+}
+
+/* Replacement for NSApplicationMain */
+static void CustomApplicationMain (int argc, char **argv)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ SDLMain *sdlMain;
+
+ /* Ensure the application object is initialised */
+ [SDLApplication sharedApplication];
+
+#ifdef SDL_USE_CPS
+ {
+ CPSProcessSerNum PSN;
+ /* Tell the dock about us */
+ if (!CPSGetCurrentProcess(&PSN))
+ if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
+ if (!CPSSetFrontProcess(&PSN))
+ [SDLApplication sharedApplication];
+ }
+#endif /* SDL_USE_CPS */
+
+ /* Set up the menubar */
+ [NSApp setMainMenu:[[NSMenu alloc] init]];
+ setApplicationMenu();
+ setupWindowMenu();
+
+ /* Create SDLMain and make it the app delegate */
+ sdlMain = [[SDLMain alloc] init];
+ [NSApp setDelegate:sdlMain];
+
+ /* Start the main event loop */
+ [NSApp run];
+
+ [sdlMain release];
+ [pool release];
+}
+
+#endif
+
+
+/*
+ * Catch document open requests...this lets us notice files when the app
+ * was launched by double-clicking a document, or when a document was
+ * dragged/dropped on the app's icon. You need to have a
+ * CFBundleDocumentsType section in your Info.plist to get this message,
+ * apparently.
+ *
+ * Files are added to gArgv, so to the app, they'll look like command line
+ * arguments. Previously, apps launched from the finder had nothing but
+ * an argv[0].
+ *
+ * This message may be received multiple times to open several docs on launch.
+ *
+ * This message is ignored once the app's mainline has been called.
+ */
+- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
+{
+ const char *temparg;
+ size_t arglen;
+ char *arg;
+ char **newargv;
+
+ if (!gFinderLaunch) /* MacOS is passing command line args. */
+ return FALSE;
+
+ if (gCalledAppMainline) /* app has started, ignore this document. */
+ return FALSE;
+
+ temparg = [filename UTF8String];
+ arglen = SDL_strlen(temparg) + 1;
+ arg = (char *) SDL_malloc(arglen);
+ if (arg == NULL)
+ return FALSE;
+
+ newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
+ if (newargv == NULL)
+ {
+ SDL_free(arg);
+ return FALSE;
+ }
+ gArgv = newargv;
+
+ SDL_strlcpy(arg, temparg, arglen);
+ gArgv[gArgc++] = arg;
+ gArgv[gArgc] = NULL;
+ return TRUE;
+}
+
+
+/* Called when the internal event loop has just started running */
+- (void) applicationDidFinishLaunching: (NSNotification *) note
+{
+ int status;
+
+ /* Set the working directory to the .app's parent directory */
+ [self setupWorkingDirectory:gFinderLaunch];
+
+#if SDL_USE_NIB_FILE
+ /* Set the main menu to contain the real app name instead of "SDL App" */
+ [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
+#endif
+
+ /* Hand off to main application code */
+ gCalledAppMainline = TRUE;
+ status = SDL_main (gArgc, gArgv);
+
+ /* We're done, thank you for playing */
+ exit(status);
+}
+@end
+
+
+@implementation NSString (ReplaceSubString)
+
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
+{
+ unsigned int bufferSize;
+ unsigned int selfLen = [self length];
+ unsigned int aStringLen = [aString length];
+ unichar *buffer;
+ NSRange localRange;
+ NSString *result;
+
+ bufferSize = selfLen + aStringLen - aRange.length;
+ buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar));
+
+ /* Get first part into buffer */
+ localRange.location = 0;
+ localRange.length = aRange.location;
+ [self getCharacters:buffer range:localRange];
+
+ /* Get middle part into buffer */
+ localRange.location = 0;
+ localRange.length = aStringLen;
+ [aString getCharacters:(buffer+aRange.location) range:localRange];
+
+ /* Get last part into buffer */
+ localRange.location = aRange.location + aRange.length;
+ localRange.length = selfLen - localRange.location;
+ [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];
+
+ /* Build output string */
+ result = [NSString stringWithCharacters:buffer length:bufferSize];
+
+ NSDeallocateMemoryPages(buffer, bufferSize);
+
+ return result;
+}
+
+@end
+
+
+
+#ifdef main
+# undef main
+#endif
+
+
+/* Main entry point to executable - should *not* be SDL_main! */
+int main (int argc, char **argv)
+{
+ /* Copy the arguments into a global variable */
+ /* This is passed if we are launched by double-clicking */
+ if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
+ gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
+ gArgv[0] = argv[0];
+ gArgv[1] = NULL;
+ gArgc = 1;
+ gFinderLaunch = YES;
+ } else {
+ int i;
+ gArgc = argc;
+ gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
+ for (i = 0; i <= argc; i++)
+ gArgv[i] = argv[i];
+ gFinderLaunch = NO;
+ }
+
+#if SDL_USE_NIB_FILE
+ [SDLApplication poseAsClass:[NSApplication class]];
+ NSApplicationMain (argc, argv);
+#else
+ CustomApplicationMain (argc, argv);
+#endif
+ return 0;
+}
+
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch
new file mode 100644
index 0000000..0009507
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch
@@ -0,0 +1,9 @@
+//
+// Prefix header for all source files of the 'ÇPROJECTNAMEÈ' target in the 'ÇPROJECTNAMEÈ' project
+//
+
+#include "SDL.h"
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns
new file mode 100644
index 0000000..ae0b02b
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns
Binary files differ
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
new file mode 100644
index 0000000..1dcbea2
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
@@ -0,0 +1,12 @@
+{
+ 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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/project.pbxproj b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..9d9a924
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/___PROJECTNAME___.xcodeproj/project.pbxproj
@@ -0,0 +1,322 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; };
+ 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; };
+ 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; };
+ 002F3A3F09D088BA00EBEB88 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A3E09D088BA00EBEB88 /* main.c */; };
+ 002F3AF109D08F1000EBEB88 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 002F3AEF09D08F1000EBEB88 /* SDLMain.nib */; };
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */,
+ );
+ name = "Copy Frameworks into .app bundle";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = "<absolute>"; };
+ 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; };
+ 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; };
+ 002F3A3E09D088BA00EBEB88 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = SOURCE_ROOT; };
+ 002F3AF009D08F1000EBEB88 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/SDLMain.nib; sourceTree = "<group>"; };
+ 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+ 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "___PROJECTNAME____Prefix.pch"; sourceTree = "<group>"; };
+ 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
+ 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "___PROJECTNAME___.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8D11072E0486CEB800E47090 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */,
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 080E96DDFE201D6D7F000001 /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ 002F3A2B09D0888800EBEB88 /* SDLMain.h */,
+ 002F3A2C09D0888800EBEB88 /* SDLMain.m */,
+ );
+ name = Classes;
+ sourceTree = "<group>";
+ };
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 002F39F909D0881F00EBEB88 /* SDL.framework */,
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
+ );
+ name = "Linked Frameworks";
+ sourceTree = "<group>";
+ };
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */,
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 19C28FACFE9D520D11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */ = {
+ isa = PBXGroup;
+ children = (
+ 080E96DDFE201D6D7F000001 /* Classes */,
+ 29B97315FDCFA39411CA2CEA /* Other Sources */,
+ 29B97317FDCFA39411CA2CEA /* Resources */,
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
+ 19C28FACFE9D520D11CA2CBB /* Products */,
+ );
+ name = "___PROJECTNAMEASXML___";
+ sourceTree = "<group>";
+ };
+ 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */,
+ 002F3A3E09D088BA00EBEB88 /* main.c */,
+ );
+ name = "Other Sources";
+ sourceTree = "<group>";
+ };
+ 29B97317FDCFA39411CA2CEA /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 8D1107310486CEB800E47090 /* Info.plist */,
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
+ 002F3AEF09D08F1000EBEB88 /* SDLMain.nib */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */;
+ buildPhases = (
+ 8D1107290486CEB800E47090 /* Resources */,
+ 8D11072C0486CEB800E47090 /* Sources */,
+ 8D11072E0486CEB800E47090 /* Frameworks */,
+ 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "___PROJECTNAME___";
+ productInstallPath = "$(HOME)/Applications";
+ productName = "___PROJECTNAME___";
+ productReference = 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 29B97313FDCFA39411CA2CEA /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */;
+ compatibilityVersion = "Xcode 3.2";
+ hasScannedForEncodings = 1;
+ mainGroup = 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 8D1107290486CEB800E47090 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
+ 002F3AF109D08F1000EBEB88 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8D11072C0486CEB800E47090 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */,
+ 002F3A3F09D088BA00EBEB88 /* main.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 002F3AEF09D08F1000EBEB88 /* SDLMain.nib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 002F3AF009D08F1000EBEB88 /* English */,
+ );
+ name = SDLMain.nib;
+ sourceTree = "<group>";
+ };
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 089C165DFE840E0CC02AAC07 /* English */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ C01FCF4B08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(HOME)/Applications";
+ PRODUCT_NAME = "___PROJECTNAME___";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ C01FCF4C08A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+ GCC_MODEL_TUNING = G5;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(HOME)/Applications";
+ PRODUCT_NAME = "___PROJECTNAME___";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+ C01FCF4F08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks",
+ /Library/Frameworks,
+ "$(FRAMEWORK_SEARCH_PATHS)",
+ );
+ GCC_VERSION = 4.0;
+ "GCC_VERSION[arch=x86_64]" = 4.2;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks/SDL.framework/Headers",
+ /Library/Frameworks/SDL.framework/Headers,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ PREBINDING = NO;
+ SDKROOT = macosx10.4;
+ "SDKROOT[arch=x86_64]" = macosx10.6;
+ };
+ name = Debug;
+ };
+ C01FCF5008A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks",
+ /Library/Frameworks,
+ "$(FRAMEWORK_SEARCH_PATHS)",
+ );
+ GCC_VERSION = 4.0;
+ "GCC_VERSION[arch=x86_64]" = 4.2;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks/SDL.framework/Headers",
+ /Library/Frameworks/SDL.framework/Headers,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ PREBINDING = NO;
+ SDKROOT = macosx10.4;
+ "SDKROOT[arch=x86_64]" = macosx10.6;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4B08A954540054247B /* Debug */,
+ C01FCF4C08A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4F08A954540054247B /* Debug */,
+ C01FCF5008A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
+}
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/main.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/main.c
new file mode 100644
index 0000000..7115de9
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL Cocoa Application/main.c
@@ -0,0 +1,65 @@
+
+/* 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/English.lproj/InfoPlist.strings b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/English.lproj/InfoPlist.strings
new file mode 100644
index 0000000..6e721b0
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/English.lproj/InfoPlist.strings
Binary files differ
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/Info.plist b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/Info.plist
new file mode 100644
index 0000000..a2e9429
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/Info.plist
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.___PROJECTNAMEASXML___</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+ <key>LSMinimumSystemVersionByArchitecture</key>
+ <dict>
+ <key>x86_64</key>
+ <string>10.6.0</string>
+ <key>i386</key>
+ <string>10.4.0</string>
+ <key>ppc</key>
+ <string>10.4.0</string>
+ </dict>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/SDLMain.h b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/SDLMain.h
new file mode 100644
index 0000000..c56d90c
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/SDLMain.h
@@ -0,0 +1,16 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#ifndef _SDLMain_h_
+#define _SDLMain_h_
+
+#import <Cocoa/Cocoa.h>
+
+@interface SDLMain : NSObject
+@end
+
+#endif /* _SDLMain_h_ */
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/SDLMain.m b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/SDLMain.m
new file mode 100644
index 0000000..b065a20
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/SDLMain.m
@@ -0,0 +1,383 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#include "SDL.h"
+#include "SDLMain.h"
+#include <sys/param.h> /* for MAXPATHLEN */
+#include <unistd.h>
+
+/* For some reaon, Apple removed setAppleMenu from the headers in 10.4,
+ but the method still is there and works. To avoid warnings, we declare
+ it ourselves here. */
+@interface NSApplication(SDL_Missing_Methods)
+- (void)setAppleMenu:(NSMenu *)menu;
+@end
+
+/* Use this flag to determine whether we use SDLMain.nib or not */
+#define SDL_USE_NIB_FILE 0
+
+/* Use this flag to determine whether we use CPS (docking) or not */
+#define SDL_USE_CPS 1
+#ifdef SDL_USE_CPS
+/* Portions of CPS.h */
+typedef struct CPSProcessSerNum
+{
+ UInt32 lo;
+ UInt32 hi;
+} CPSProcessSerNum;
+
+extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
+extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
+extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
+
+#endif /* SDL_USE_CPS */
+
+static int gArgc;
+static char **gArgv;
+static BOOL gFinderLaunch;
+static BOOL gCalledAppMainline = FALSE;
+
+static NSString *getApplicationName(void)
+{
+ const NSDictionary *dict;
+ NSString *appName = 0;
+
+ /* Determine the application name */
+ dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
+ if (dict)
+ appName = [dict objectForKey: @"CFBundleName"];
+
+ if (![appName length])
+ appName = [[NSProcessInfo processInfo] processName];
+
+ return appName;
+}
+
+#if SDL_USE_NIB_FILE
+/* A helper category for NSString */
+@interface NSString (ReplaceSubString)
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
+@end
+#endif
+
+@interface SDLApplication : NSApplication
+@end
+
+@implementation SDLApplication
+/* Invoked from the Quit menu item */
+- (void)terminate:(id)sender
+{
+ /* Post a SDL_QUIT event */
+ SDL_Event event;
+ event.type = SDL_QUIT;
+ SDL_PushEvent(&event);
+}
+@end
+
+/* The main class of the application, the application's delegate */
+@implementation SDLMain
+
+/* Set the working directory to the .app's parent directory */
+- (void) setupWorkingDirectory:(BOOL)shouldChdir
+{
+ if (shouldChdir)
+ {
+ char parentdir[MAXPATHLEN];
+ CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
+ CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
+ if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) {
+ chdir(parentdir); /* chdir to the binary app's parent */
+ }
+ CFRelease(url);
+ CFRelease(url2);
+ }
+}
+
+#if SDL_USE_NIB_FILE
+
+/* Fix menu to contain the real app name instead of "SDL App" */
+- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
+{
+ NSRange aRange;
+ NSEnumerator *enumerator;
+ NSMenuItem *menuItem;
+
+ aRange = [[aMenu title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
+
+ enumerator = [[aMenu itemArray] objectEnumerator];
+ while ((menuItem = [enumerator nextObject]))
+ {
+ aRange = [[menuItem title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
+ if ([menuItem hasSubmenu])
+ [self fixMenu:[menuItem submenu] withAppName:appName];
+ }
+ [ aMenu sizeToFit ];
+}
+
+#else
+
+static void setApplicationMenu(void)
+{
+ /* warning: this code is very odd */
+ NSMenu *appleMenu;
+ NSMenuItem *menuItem;
+ NSString *title;
+ NSString *appName;
+
+ appName = getApplicationName();
+ appleMenu = [[NSMenu alloc] initWithTitle:@""];
+
+ /* Add menu items */
+ title = [@"About " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
+
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ title = [@"Hide " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
+
+ menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
+ [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
+
+ [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
+
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ title = [@"Quit " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
+
+
+ /* Put menu into the menubar */
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
+ [menuItem setSubmenu:appleMenu];
+ [[NSApp mainMenu] addItem:menuItem];
+
+ /* Tell the application object that this is now the application menu */
+ [NSApp setAppleMenu:appleMenu];
+
+ /* Finally give up our references to the objects */
+ [appleMenu release];
+ [menuItem release];
+}
+
+/* Create a window menu */
+static void setupWindowMenu(void)
+{
+ NSMenu *windowMenu;
+ NSMenuItem *windowMenuItem;
+ NSMenuItem *menuItem;
+
+ windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
+
+ /* "Minimize" item */
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
+ [windowMenu addItem:menuItem];
+ [menuItem release];
+
+ /* Put menu into the menubar */
+ windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
+ [windowMenuItem setSubmenu:windowMenu];
+ [[NSApp mainMenu] addItem:windowMenuItem];
+
+ /* Tell the application object that this is now the window menu */
+ [NSApp setWindowsMenu:windowMenu];
+
+ /* Finally give up our references to the objects */
+ [windowMenu release];
+ [windowMenuItem release];
+}
+
+/* Replacement for NSApplicationMain */
+static void CustomApplicationMain (int argc, char **argv)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ SDLMain *sdlMain;
+
+ /* Ensure the application object is initialised */
+ [SDLApplication sharedApplication];
+
+#ifdef SDL_USE_CPS
+ {
+ CPSProcessSerNum PSN;
+ /* Tell the dock about us */
+ if (!CPSGetCurrentProcess(&PSN))
+ if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
+ if (!CPSSetFrontProcess(&PSN))
+ [SDLApplication sharedApplication];
+ }
+#endif /* SDL_USE_CPS */
+
+ /* Set up the menubar */
+ [NSApp setMainMenu:[[NSMenu alloc] init]];
+ setApplicationMenu();
+ setupWindowMenu();
+
+ /* Create SDLMain and make it the app delegate */
+ sdlMain = [[SDLMain alloc] init];
+ [NSApp setDelegate:sdlMain];
+
+ /* Start the main event loop */
+ [NSApp run];
+
+ [sdlMain release];
+ [pool release];
+}
+
+#endif
+
+
+/*
+ * Catch document open requests...this lets us notice files when the app
+ * was launched by double-clicking a document, or when a document was
+ * dragged/dropped on the app's icon. You need to have a
+ * CFBundleDocumentsType section in your Info.plist to get this message,
+ * apparently.
+ *
+ * Files are added to gArgv, so to the app, they'll look like command line
+ * arguments. Previously, apps launched from the finder had nothing but
+ * an argv[0].
+ *
+ * This message may be received multiple times to open several docs on launch.
+ *
+ * This message is ignored once the app's mainline has been called.
+ */
+- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
+{
+ const char *temparg;
+ size_t arglen;
+ char *arg;
+ char **newargv;
+
+ if (!gFinderLaunch) /* MacOS is passing command line args. */
+ return FALSE;
+
+ if (gCalledAppMainline) /* app has started, ignore this document. */
+ return FALSE;
+
+ temparg = [filename UTF8String];
+ arglen = SDL_strlen(temparg) + 1;
+ arg = (char *) SDL_malloc(arglen);
+ if (arg == NULL)
+ return FALSE;
+
+ newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
+ if (newargv == NULL)
+ {
+ SDL_free(arg);
+ return FALSE;
+ }
+ gArgv = newargv;
+
+ SDL_strlcpy(arg, temparg, arglen);
+ gArgv[gArgc++] = arg;
+ gArgv[gArgc] = NULL;
+ return TRUE;
+}
+
+
+/* Called when the internal event loop has just started running */
+- (void) applicationDidFinishLaunching: (NSNotification *) note
+{
+ int status;
+
+ /* Set the working directory to the .app's parent directory */
+ [self setupWorkingDirectory:gFinderLaunch];
+
+#if SDL_USE_NIB_FILE
+ /* Set the main menu to contain the real app name instead of "SDL App" */
+ [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
+#endif
+
+ /* Hand off to main application code */
+ gCalledAppMainline = TRUE;
+ status = SDL_main (gArgc, gArgv);
+
+ /* We're done, thank you for playing */
+ exit(status);
+}
+@end
+
+
+@implementation NSString (ReplaceSubString)
+
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
+{
+ unsigned int bufferSize;
+ unsigned int selfLen = [self length];
+ unsigned int aStringLen = [aString length];
+ unichar *buffer;
+ NSRange localRange;
+ NSString *result;
+
+ bufferSize = selfLen + aStringLen - aRange.length;
+ buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar));
+
+ /* Get first part into buffer */
+ localRange.location = 0;
+ localRange.length = aRange.location;
+ [self getCharacters:buffer range:localRange];
+
+ /* Get middle part into buffer */
+ localRange.location = 0;
+ localRange.length = aStringLen;
+ [aString getCharacters:(buffer+aRange.location) range:localRange];
+
+ /* Get last part into buffer */
+ localRange.location = aRange.location + aRange.length;
+ localRange.length = selfLen - localRange.location;
+ [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];
+
+ /* Build output string */
+ result = [NSString stringWithCharacters:buffer length:bufferSize];
+
+ NSDeallocateMemoryPages(buffer, bufferSize);
+
+ return result;
+}
+
+@end
+
+
+
+#ifdef main
+# undef main
+#endif
+
+
+/* Main entry point to executable - should *not* be SDL_main! */
+int main (int argc, char **argv)
+{
+ /* Copy the arguments into a global variable */
+ /* This is passed if we are launched by double-clicking */
+ if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
+ gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
+ gArgv[0] = argv[0];
+ gArgv[1] = NULL;
+ gArgc = 1;
+ gFinderLaunch = YES;
+ } else {
+ int i;
+ gArgc = argc;
+ gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
+ for (i = 0; i <= argc; i++)
+ gArgv[i] = argv[i];
+ gFinderLaunch = NO;
+ }
+
+#if SDL_USE_NIB_FILE
+ [SDLApplication poseAsClass:[NSApplication class]];
+ NSApplicationMain (argc, argv);
+#else
+ CustomApplicationMain (argc, argv);
+#endif
+ return 0;
+}
+
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch
new file mode 100644
index 0000000..0009507
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAMEASIDENTIFIER____Prefix.pch
@@ -0,0 +1,9 @@
+//
+// Prefix header for all source files of the 'ÇPROJECTNAMEÈ' target in the 'ÇPROJECTNAMEÈ' project
+//
+
+#include "SDL.h"
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns
new file mode 100644
index 0000000..ae0b02b
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns
Binary files differ
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
new file mode 100644
index 0000000..ba87745
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
@@ -0,0 +1,12 @@
+{
+ 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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/project.pbxproj b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..5683273
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/___PROJECTNAME___.xcodeproj/project.pbxproj
@@ -0,0 +1,352 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; };
+ 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; };
+ 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; };
+ 002F3A3F09D088BA00EBEB88 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A3E09D088BA00EBEB88 /* main.c */; };
+ 002F3BFA09D0938900EBEB88 /* atlantis.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF409D0938900EBEB88 /* atlantis.c */; };
+ 002F3BFC09D0938900EBEB88 /* dolphin.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF609D0938900EBEB88 /* dolphin.c */; };
+ 002F3BFD09D0938900EBEB88 /* shark.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF709D0938900EBEB88 /* shark.c */; };
+ 002F3BFE09D0938900EBEB88 /* swim.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF809D0938900EBEB88 /* swim.c */; };
+ 002F3BFF09D0938900EBEB88 /* whale.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF909D0938900EBEB88 /* whale.c */; };
+ 002F3C0109D093BD00EBEB88 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F3C0009D093BD00EBEB88 /* OpenGL.framework */; };
+ 002F3C6109D0951E00EBEB88 /* GLUT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F3C6009D0951E00EBEB88 /* GLUT.framework */; };
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */,
+ );
+ name = "Copy Frameworks into .app bundle";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = "<absolute>"; };
+ 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; };
+ 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; };
+ 002F3A3E09D088BA00EBEB88 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = SOURCE_ROOT; };
+ 002F3BF409D0938900EBEB88 /* atlantis.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = atlantis.c; path = atlantis/atlantis.c; sourceTree = SOURCE_ROOT; };
+ 002F3BF509D0938900EBEB88 /* atlantis.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = atlantis.h; path = atlantis/atlantis.h; sourceTree = SOURCE_ROOT; };
+ 002F3BF609D0938900EBEB88 /* dolphin.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = dolphin.c; path = atlantis/dolphin.c; sourceTree = SOURCE_ROOT; };
+ 002F3BF709D0938900EBEB88 /* shark.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = shark.c; path = atlantis/shark.c; sourceTree = SOURCE_ROOT; };
+ 002F3BF809D0938900EBEB88 /* swim.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = swim.c; path = atlantis/swim.c; sourceTree = SOURCE_ROOT; };
+ 002F3BF909D0938900EBEB88 /* whale.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = whale.c; path = atlantis/whale.c; sourceTree = SOURCE_ROOT; };
+ 002F3C0009D093BD00EBEB88 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
+ 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 = "<group>"; };
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+ 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "___PROJECTNAME____Prefix.pch"; sourceTree = "<group>"; };
+ 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
+ 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 = "<group>";
+ };
+ 080E96DDFE201D6D7F000001 /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ 002F3A2B09D0888800EBEB88 /* SDLMain.h */,
+ 002F3A2C09D0888800EBEB88 /* SDLMain.m */,
+ );
+ name = Classes;
+ sourceTree = "<group>";
+ };
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 002F39F909D0881F00EBEB88 /* SDL.framework */,
+ 002F3C6009D0951E00EBEB88 /* GLUT.framework */,
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
+ 002F3C0009D093BD00EBEB88 /* OpenGL.framework */,
+ );
+ name = "Linked Frameworks";
+ sourceTree = "<group>";
+ };
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */,
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 19C28FACFE9D520D11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */ = {
+ isa = PBXGroup;
+ children = (
+ 080E96DDFE201D6D7F000001 /* Classes */,
+ 29B97315FDCFA39411CA2CEA /* Other Sources */,
+ 29B97317FDCFA39411CA2CEA /* Resources */,
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
+ 19C28FACFE9D520D11CA2CBB /* Products */,
+ );
+ name = "___PROJECTNAMEASXML___";
+ sourceTree = "<group>";
+ };
+ 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 002F3BF309D0937800EBEB88 /* atlantis */,
+ 32CA4F630368D1EE00C91783 /* ___PROJECTNAME____Prefix.pch */,
+ 002F3A3E09D088BA00EBEB88 /* main.c */,
+ );
+ name = "Other Sources";
+ sourceTree = "<group>";
+ };
+ 29B97317FDCFA39411CA2CEA /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 8D1107310486CEB800E47090 /* Info.plist */,
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */;
+ buildPhases = (
+ 8D1107290486CEB800E47090 /* Resources */,
+ 8D11072C0486CEB800E47090 /* Sources */,
+ 8D11072E0486CEB800E47090 /* Frameworks */,
+ 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "___PROJECTNAME___";
+ productInstallPath = "$(HOME)/Applications";
+ productName = "___PROJECTNAME___";
+ productReference = 8D1107320486CEB800E47090 /* ___PROJECTNAME___.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 29B97313FDCFA39411CA2CEA /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */;
+ compatibilityVersion = "Xcode 3.2";
+ hasScannedForEncodings = 1;
+ mainGroup = 29B97314FDCFA39411CA2CEA /* ___PROJECTNAMEASXML___ */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8D1107260486CEB800E47090 /* ___PROJECTNAME___ */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 8D1107290486CEB800E47090 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8D11072C0486CEB800E47090 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */,
+ 002F3A3F09D088BA00EBEB88 /* main.c in Sources */,
+ 002F3BFA09D0938900EBEB88 /* atlantis.c in Sources */,
+ 002F3BFC09D0938900EBEB88 /* dolphin.c in Sources */,
+ 002F3BFD09D0938900EBEB88 /* shark.c in Sources */,
+ 002F3BFE09D0938900EBEB88 /* swim.c in Sources */,
+ 002F3BFF09D0938900EBEB88 /* whale.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 089C165DFE840E0CC02AAC07 /* English */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ C01FCF4B08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(HOME)/Applications";
+ PRODUCT_NAME = "___PROJECTNAME___";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ C01FCF4C08A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = (
+ ppc,
+ i386,
+ );
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+ GCC_MODEL_TUNING = G5;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "___PROJECTNAMEASIDENTIFIER____Prefix.pch";
+ INFOPLIST_FILE = Info.plist;
+ INSTALL_PATH = "$(HOME)/Applications";
+ PRODUCT_NAME = "___PROJECTNAME___";
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+ C01FCF4F08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks",
+ /Library/Frameworks,
+ "$(FRAMEWORK_SEARCH_PATHS)",
+ );
+ GCC_VERSION = 4.0;
+ "GCC_VERSION[arch=x86_64]" = 4.2;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks/SDL.framework/Headers",
+ /Library/Frameworks/SDL.framework/Headers,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ PREBINDING = NO;
+ SDKROOT = macosx10.4;
+ "SDKROOT[arch=x86_64]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
+ };
+ name = Debug;
+ };
+ C01FCF5008A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks",
+ /Library/Frameworks,
+ "$(FRAMEWORK_SEARCH_PATHS)",
+ );
+ GCC_VERSION = 4.0;
+ "GCC_VERSION[arch=x86_64]" = 4.2;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ "$(HOME)/Library/Frameworks/SDL.framework/Headers",
+ /Library/Frameworks/SDL.framework/Headers,
+ "$(HEADER_SEARCH_PATHS)",
+ );
+ PREBINDING = NO;
+ SDKROOT = macosx10.4;
+ "SDKROOT[arch=x86_64]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "___PROJECTNAME___" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4B08A954540054247B /* Debug */,
+ C01FCF4C08A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ C01FCF4E08A954540054247B /* Build configuration list for PBXProject "___PROJECTNAME___" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4F08A954540054247B /* Debug */,
+ C01FCF5008A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
+}
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/atlantis.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/atlantis.c
new file mode 100644
index 0000000..4efdf6c
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/atlantis.c
@@ -0,0 +1,459 @@
+
+/* 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <sys/time.h>
+#include <GLUT/glut.h>
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/atlantis.h b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/atlantis.h
new file mode 100644
index 0000000..6ccf2d5
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/atlantis.h
@@ -0,0 +1,65 @@
+/**
+ * (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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/dolphin.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/dolphin.c
new file mode 100644
index 0000000..9fba3ba
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/dolphin.c
@@ -0,0 +1,1934 @@
+/**
+ * (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 <math.h>
+#include <GLUT/glut.h>
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/shark.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/shark.c
new file mode 100644
index 0000000..9c847db
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/shark.c
@@ -0,0 +1,1308 @@
+/**
+ * (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 <GLUT/glut.h>
+#include <math.h>
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/swim.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/swim.c
new file mode 100644
index 0000000..cac7b60
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/swim.c
@@ -0,0 +1,188 @@
+/**
+ * (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 <math.h>
+#include <stdlib.h> /* For rand(). */
+#include <GLUT/glut.h>
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/whale.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/whale.c
new file mode 100644
index 0000000..828640a
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/atlantis/whale.c
@@ -0,0 +1,1798 @@
+/**
+ * (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 <GLUT/glut.h>
+#include <math.h>
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/main.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/main.c
new file mode 100644
index 0000000..b7794b3
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeSnowLeopard/SDL OpenGL Application/main.c
@@ -0,0 +1,179 @@
+
+/* 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/English.lproj/InfoPlist.strings b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/English.lproj/InfoPlist.strings
new file mode 100755
index 0000000..e612457
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/English.lproj/InfoPlist.strings
Binary files differ
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/Info.plist b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/Info.plist
new file mode 100644
index 0000000..c678d11
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/Info.plist
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.«PROJECTNAMEASXML»</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp.xcodeproj/TemplateInfo.plist b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp.xcodeproj/TemplateInfo.plist
new file mode 100644
index 0000000..d9ca454
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp.xcodeproj/TemplateInfo.plist
@@ -0,0 +1,12 @@
+{
+ 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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp.xcodeproj/project.pbxproj b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..ccac459
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp.xcodeproj/project.pbxproj
@@ -0,0 +1,324 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 42;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; };
+ 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; };
+ 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; };
+ 002F3A3F09D088BA00EBEB88 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A3E09D088BA00EBEB88 /* main.c */; };
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXBuildStyle section */
+ 4A9504CCFFE6A4B311CA0CBA /* Debug */ = {
+ isa = PBXBuildStyle;
+ buildSettings = {
+ };
+ name = Debug;
+ };
+ 4A9504CDFFE6A4B311CA0CBA /* Release */ = {
+ isa = PBXBuildStyle;
+ buildSettings = {
+ };
+ name = Release;
+ };
+/* End PBXBuildStyle section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */,
+ );
+ name = "Copy Frameworks into .app bundle";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = "<absolute>"; };
+ 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; };
+ 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; };
+ 002F3A3E09D088BA00EBEB88 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = SOURCE_ROOT; };
+ 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+ 32CA4F630368D1EE00C91783 /* «PROJECTNAME»_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file; path = "«PROJECTNAME»_Prefix.pch"; sourceTree = "<group>"; };
+ 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
+ 8D1107320486CEB800E47090 /* «PROJECTNAME».app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "«PROJECTNAME».app"; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8D11072E0486CEB800E47090 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */,
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 080E96DDFE201D6D7F000001 /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ 002F3A2B09D0888800EBEB88 /* SDLMain.h */,
+ 002F3A2C09D0888800EBEB88 /* SDLMain.m */,
+ );
+ name = Classes;
+ sourceTree = "<group>";
+ };
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 002F39F909D0881F00EBEB88 /* SDL.framework */,
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
+ );
+ name = "Linked Frameworks";
+ sourceTree = "<group>";
+ };
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */,
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 19C28FACFE9D520D11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8D1107320486CEB800E47090 /* «PROJECTNAME».app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 29B97314FDCFA39411CA2CEA /* «PROJECTNAMEASXML» */ = {
+ isa = PBXGroup;
+ children = (
+ 080E96DDFE201D6D7F000001 /* Classes */,
+ 29B97315FDCFA39411CA2CEA /* Other Sources */,
+ 29B97317FDCFA39411CA2CEA /* Resources */,
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
+ 19C28FACFE9D520D11CA2CBB /* Products */,
+ );
+ name = "«PROJECTNAMEASXML»";
+ sourceTree = "<group>";
+ };
+ 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 32CA4F630368D1EE00C91783 /* «PROJECTNAME»_Prefix.pch */,
+ 002F3A3E09D088BA00EBEB88 /* main.c */,
+ );
+ name = "Other Sources";
+ sourceTree = "<group>";
+ };
+ 29B97317FDCFA39411CA2CEA /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 8D1107310486CEB800E47090 /* Info.plist */,
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8D1107260486CEB800E47090 /* «PROJECTNAME» */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "«PROJECTNAME»" */;
+ buildPhases = (
+ 8D1107290486CEB800E47090 /* Resources */,
+ 8D11072C0486CEB800E47090 /* Sources */,
+ 8D11072E0486CEB800E47090 /* Frameworks */,
+ 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */,
+ );
+ buildRules = (
+ );
+ buildSettings = {
+ };
+ dependencies = (
+ );
+ name = "«PROJECTNAME»";
+ productInstallPath = "$(HOME)/Applications";
+ productName = "«PROJECTNAME»";
+ productReference = 8D1107320486CEB800E47090 /* «PROJECTNAME».app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 29B97313FDCFA39411CA2CEA /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SDLApp" */;
+ buildSettings = {
+ };
+ buildStyles = (
+ 4A9504CCFFE6A4B311CA0CBA /* Debug */,
+ 4A9504CDFFE6A4B311CA0CBA /* Release */,
+ );
+ hasScannedForEncodings = 1;
+ mainGroup = 29B97314FDCFA39411CA2CEA /* «PROJECTNAMEASXML» */;
+ projectDirPath = "";
+ targets = (
+ 8D1107260486CEB800E47090 /* «PROJECTNAME» */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 8D1107290486CEB800E47090 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8D11072C0486CEB800E47090 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */,
+ 002F3A3F09D088BA00EBEB88 /* main.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 089C165DFE840E0CC02AAC07 /* English */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+/* 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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp_Prefix.pch b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp_Prefix.pch
new file mode 100644
index 0000000..0009507
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/SDLApp_Prefix.pch
@@ -0,0 +1,9 @@
+//
+// Prefix header for all source files of the 'ÇPROJECTNAMEÈ' target in the 'ÇPROJECTNAMEÈ' project
+//
+
+#include "SDL.h"
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/SDLMain.h b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/SDLMain.h
new file mode 100644
index 0000000..c56d90c
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/SDLMain.h
@@ -0,0 +1,16 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#ifndef _SDLMain_h_
+#define _SDLMain_h_
+
+#import <Cocoa/Cocoa.h>
+
+@interface SDLMain : NSObject
+@end
+
+#endif /* _SDLMain_h_ */
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/SDLMain.m b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/SDLMain.m
new file mode 100644
index 0000000..b065a20
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/SDLMain.m
@@ -0,0 +1,383 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#include "SDL.h"
+#include "SDLMain.h"
+#include <sys/param.h> /* for MAXPATHLEN */
+#include <unistd.h>
+
+/* For some reaon, Apple removed setAppleMenu from the headers in 10.4,
+ but the method still is there and works. To avoid warnings, we declare
+ it ourselves here. */
+@interface NSApplication(SDL_Missing_Methods)
+- (void)setAppleMenu:(NSMenu *)menu;
+@end
+
+/* Use this flag to determine whether we use SDLMain.nib or not */
+#define SDL_USE_NIB_FILE 0
+
+/* Use this flag to determine whether we use CPS (docking) or not */
+#define SDL_USE_CPS 1
+#ifdef SDL_USE_CPS
+/* Portions of CPS.h */
+typedef struct CPSProcessSerNum
+{
+ UInt32 lo;
+ UInt32 hi;
+} CPSProcessSerNum;
+
+extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
+extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
+extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
+
+#endif /* SDL_USE_CPS */
+
+static int gArgc;
+static char **gArgv;
+static BOOL gFinderLaunch;
+static BOOL gCalledAppMainline = FALSE;
+
+static NSString *getApplicationName(void)
+{
+ const NSDictionary *dict;
+ NSString *appName = 0;
+
+ /* Determine the application name */
+ dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
+ if (dict)
+ appName = [dict objectForKey: @"CFBundleName"];
+
+ if (![appName length])
+ appName = [[NSProcessInfo processInfo] processName];
+
+ return appName;
+}
+
+#if SDL_USE_NIB_FILE
+/* A helper category for NSString */
+@interface NSString (ReplaceSubString)
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
+@end
+#endif
+
+@interface SDLApplication : NSApplication
+@end
+
+@implementation SDLApplication
+/* Invoked from the Quit menu item */
+- (void)terminate:(id)sender
+{
+ /* Post a SDL_QUIT event */
+ SDL_Event event;
+ event.type = SDL_QUIT;
+ SDL_PushEvent(&event);
+}
+@end
+
+/* The main class of the application, the application's delegate */
+@implementation SDLMain
+
+/* Set the working directory to the .app's parent directory */
+- (void) setupWorkingDirectory:(BOOL)shouldChdir
+{
+ if (shouldChdir)
+ {
+ char parentdir[MAXPATHLEN];
+ CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
+ CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
+ if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) {
+ chdir(parentdir); /* chdir to the binary app's parent */
+ }
+ CFRelease(url);
+ CFRelease(url2);
+ }
+}
+
+#if SDL_USE_NIB_FILE
+
+/* Fix menu to contain the real app name instead of "SDL App" */
+- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
+{
+ NSRange aRange;
+ NSEnumerator *enumerator;
+ NSMenuItem *menuItem;
+
+ aRange = [[aMenu title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
+
+ enumerator = [[aMenu itemArray] objectEnumerator];
+ while ((menuItem = [enumerator nextObject]))
+ {
+ aRange = [[menuItem title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
+ if ([menuItem hasSubmenu])
+ [self fixMenu:[menuItem submenu] withAppName:appName];
+ }
+ [ aMenu sizeToFit ];
+}
+
+#else
+
+static void setApplicationMenu(void)
+{
+ /* warning: this code is very odd */
+ NSMenu *appleMenu;
+ NSMenuItem *menuItem;
+ NSString *title;
+ NSString *appName;
+
+ appName = getApplicationName();
+ appleMenu = [[NSMenu alloc] initWithTitle:@""];
+
+ /* Add menu items */
+ title = [@"About " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
+
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ title = [@"Hide " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
+
+ menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
+ [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
+
+ [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
+
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ title = [@"Quit " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
+
+
+ /* Put menu into the menubar */
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
+ [menuItem setSubmenu:appleMenu];
+ [[NSApp mainMenu] addItem:menuItem];
+
+ /* Tell the application object that this is now the application menu */
+ [NSApp setAppleMenu:appleMenu];
+
+ /* Finally give up our references to the objects */
+ [appleMenu release];
+ [menuItem release];
+}
+
+/* Create a window menu */
+static void setupWindowMenu(void)
+{
+ NSMenu *windowMenu;
+ NSMenuItem *windowMenuItem;
+ NSMenuItem *menuItem;
+
+ windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
+
+ /* "Minimize" item */
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
+ [windowMenu addItem:menuItem];
+ [menuItem release];
+
+ /* Put menu into the menubar */
+ windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
+ [windowMenuItem setSubmenu:windowMenu];
+ [[NSApp mainMenu] addItem:windowMenuItem];
+
+ /* Tell the application object that this is now the window menu */
+ [NSApp setWindowsMenu:windowMenu];
+
+ /* Finally give up our references to the objects */
+ [windowMenu release];
+ [windowMenuItem release];
+}
+
+/* Replacement for NSApplicationMain */
+static void CustomApplicationMain (int argc, char **argv)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ SDLMain *sdlMain;
+
+ /* Ensure the application object is initialised */
+ [SDLApplication sharedApplication];
+
+#ifdef SDL_USE_CPS
+ {
+ CPSProcessSerNum PSN;
+ /* Tell the dock about us */
+ if (!CPSGetCurrentProcess(&PSN))
+ if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
+ if (!CPSSetFrontProcess(&PSN))
+ [SDLApplication sharedApplication];
+ }
+#endif /* SDL_USE_CPS */
+
+ /* Set up the menubar */
+ [NSApp setMainMenu:[[NSMenu alloc] init]];
+ setApplicationMenu();
+ setupWindowMenu();
+
+ /* Create SDLMain and make it the app delegate */
+ sdlMain = [[SDLMain alloc] init];
+ [NSApp setDelegate:sdlMain];
+
+ /* Start the main event loop */
+ [NSApp run];
+
+ [sdlMain release];
+ [pool release];
+}
+
+#endif
+
+
+/*
+ * Catch document open requests...this lets us notice files when the app
+ * was launched by double-clicking a document, or when a document was
+ * dragged/dropped on the app's icon. You need to have a
+ * CFBundleDocumentsType section in your Info.plist to get this message,
+ * apparently.
+ *
+ * Files are added to gArgv, so to the app, they'll look like command line
+ * arguments. Previously, apps launched from the finder had nothing but
+ * an argv[0].
+ *
+ * This message may be received multiple times to open several docs on launch.
+ *
+ * This message is ignored once the app's mainline has been called.
+ */
+- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
+{
+ const char *temparg;
+ size_t arglen;
+ char *arg;
+ char **newargv;
+
+ if (!gFinderLaunch) /* MacOS is passing command line args. */
+ return FALSE;
+
+ if (gCalledAppMainline) /* app has started, ignore this document. */
+ return FALSE;
+
+ temparg = [filename UTF8String];
+ arglen = SDL_strlen(temparg) + 1;
+ arg = (char *) SDL_malloc(arglen);
+ if (arg == NULL)
+ return FALSE;
+
+ newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
+ if (newargv == NULL)
+ {
+ SDL_free(arg);
+ return FALSE;
+ }
+ gArgv = newargv;
+
+ SDL_strlcpy(arg, temparg, arglen);
+ gArgv[gArgc++] = arg;
+ gArgv[gArgc] = NULL;
+ return TRUE;
+}
+
+
+/* Called when the internal event loop has just started running */
+- (void) applicationDidFinishLaunching: (NSNotification *) note
+{
+ int status;
+
+ /* Set the working directory to the .app's parent directory */
+ [self setupWorkingDirectory:gFinderLaunch];
+
+#if SDL_USE_NIB_FILE
+ /* Set the main menu to contain the real app name instead of "SDL App" */
+ [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
+#endif
+
+ /* Hand off to main application code */
+ gCalledAppMainline = TRUE;
+ status = SDL_main (gArgc, gArgv);
+
+ /* We're done, thank you for playing */
+ exit(status);
+}
+@end
+
+
+@implementation NSString (ReplaceSubString)
+
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
+{
+ unsigned int bufferSize;
+ unsigned int selfLen = [self length];
+ unsigned int aStringLen = [aString length];
+ unichar *buffer;
+ NSRange localRange;
+ NSString *result;
+
+ bufferSize = selfLen + aStringLen - aRange.length;
+ buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar));
+
+ /* Get first part into buffer */
+ localRange.location = 0;
+ localRange.length = aRange.location;
+ [self getCharacters:buffer range:localRange];
+
+ /* Get middle part into buffer */
+ localRange.location = 0;
+ localRange.length = aStringLen;
+ [aString getCharacters:(buffer+aRange.location) range:localRange];
+
+ /* Get last part into buffer */
+ localRange.location = aRange.location + aRange.length;
+ localRange.length = selfLen - localRange.location;
+ [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];
+
+ /* Build output string */
+ result = [NSString stringWithCharacters:buffer length:bufferSize];
+
+ NSDeallocateMemoryPages(buffer, bufferSize);
+
+ return result;
+}
+
+@end
+
+
+
+#ifdef main
+# undef main
+#endif
+
+
+/* Main entry point to executable - should *not* be SDL_main! */
+int main (int argc, char **argv)
+{
+ /* Copy the arguments into a global variable */
+ /* This is passed if we are launched by double-clicking */
+ if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
+ gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
+ gArgv[0] = argv[0];
+ gArgv[1] = NULL;
+ gArgc = 1;
+ gFinderLaunch = YES;
+ } else {
+ int i;
+ gArgc = argc;
+ gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
+ for (i = 0; i <= argc; i++)
+ gArgv[i] = argv[i];
+ gFinderLaunch = NO;
+ }
+
+#if SDL_USE_NIB_FILE
+ [SDLApplication poseAsClass:[NSApplication class]];
+ NSApplicationMain (argc, argv);
+#else
+ CustomApplicationMain (argc, argv);
+#endif
+ return 0;
+}
+
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/main.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/main.c
new file mode 100644
index 0000000..7115de9
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Application/main.c
@@ -0,0 +1,65 @@
+
+/* 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/InfoPlist.strings b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/InfoPlist.strings
new file mode 100755
index 0000000..e612457
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/InfoPlist.strings
Binary files differ
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/SDLMain.nib/classes.nib b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/SDLMain.nib/classes.nib
new file mode 100644
index 0000000..799eaad
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/SDLMain.nib/classes.nib
@@ -0,0 +1,19 @@
+{
+ 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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/SDLMain.nib/info.nib b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/SDLMain.nib/info.nib
new file mode 100644
index 0000000..1d6fb7e
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/SDLMain.nib/info.nib
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>IBDocumentLocation</key>
+ <string>62 117 356 240 0 0 1152 848 </string>
+ <key>IBEditorPositions</key>
+ <dict>
+ <key>29</key>
+ <string>62 362 195 44 0 0 1152 848 </string>
+ </dict>
+ <key>IBFramework Version</key>
+ <string>291.0</string>
+ <key>IBOpenObjects</key>
+ <array>
+ <integer>29</integer>
+ </array>
+ <key>IBSystem Version</key>
+ <string>6L60</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/SDLMain.nib/objects.nib b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/SDLMain.nib/objects.nib
new file mode 100644
index 0000000..6378015
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/English.lproj/SDLMain.nib/objects.nib
Binary files differ
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/Info.plist b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/Info.plist
new file mode 100644
index 0000000..c678d11
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/Info.plist
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.«PROJECTNAMEASXML»</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLApp_Prefix.pch b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLApp_Prefix.pch
new file mode 100644
index 0000000..0009507
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLApp_Prefix.pch
@@ -0,0 +1,9 @@
+//
+// Prefix header for all source files of the 'ÇPROJECTNAMEÈ' target in the 'ÇPROJECTNAMEÈ' project
+//
+
+#include "SDL.h"
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLCocoaApp.xcodeproj/TemplateInfo.plist b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLCocoaApp.xcodeproj/TemplateInfo.plist
new file mode 100644
index 0000000..1dcbea2
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLCocoaApp.xcodeproj/TemplateInfo.plist
@@ -0,0 +1,12 @@
+{
+ 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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLCocoaApp.xcodeproj/project.pbxproj b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLCocoaApp.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..5859662
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLCocoaApp.xcodeproj/project.pbxproj
@@ -0,0 +1,336 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 42;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; };
+ 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; };
+ 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; };
+ 002F3A3F09D088BA00EBEB88 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A3E09D088BA00EBEB88 /* main.c */; };
+ 002F3AF109D08F1000EBEB88 /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = 002F3AEF09D08F1000EBEB88 /* SDLMain.nib */; };
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXBuildStyle section */
+ 4A9504CCFFE6A4B311CA0CBA /* Debug */ = {
+ isa = PBXBuildStyle;
+ buildSettings = {
+ };
+ name = Debug;
+ };
+ 4A9504CDFFE6A4B311CA0CBA /* Release */ = {
+ isa = PBXBuildStyle;
+ buildSettings = {
+ };
+ name = Release;
+ };
+/* End PBXBuildStyle section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */,
+ );
+ name = "Copy Frameworks into .app bundle";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = "<absolute>"; };
+ 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; };
+ 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; };
+ 002F3A3E09D088BA00EBEB88 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = SOURCE_ROOT; };
+ 002F3AF009D08F1000EBEB88 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/SDLMain.nib; sourceTree = "<group>"; };
+ 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+ 32CA4F630368D1EE00C91783 /* «PROJECTNAME»_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file; path = "«PROJECTNAME»_Prefix.pch"; sourceTree = "<group>"; };
+ 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
+ 8D1107320486CEB800E47090 /* «PROJECTNAME».app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "«PROJECTNAME».app"; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8D11072E0486CEB800E47090 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */,
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 080E96DDFE201D6D7F000001 /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ 002F3A2B09D0888800EBEB88 /* SDLMain.h */,
+ 002F3A2C09D0888800EBEB88 /* SDLMain.m */,
+ );
+ name = Classes;
+ sourceTree = "<group>";
+ };
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 002F39F909D0881F00EBEB88 /* SDL.framework */,
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
+ );
+ name = "Linked Frameworks";
+ sourceTree = "<group>";
+ };
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */,
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 19C28FACFE9D520D11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8D1107320486CEB800E47090 /* «PROJECTNAME».app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 29B97314FDCFA39411CA2CEA /* «PROJECTNAMEASXML» */ = {
+ isa = PBXGroup;
+ children = (
+ 080E96DDFE201D6D7F000001 /* Classes */,
+ 29B97315FDCFA39411CA2CEA /* Other Sources */,
+ 29B97317FDCFA39411CA2CEA /* Resources */,
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
+ 19C28FACFE9D520D11CA2CBB /* Products */,
+ );
+ name = "«PROJECTNAMEASXML»";
+ sourceTree = "<group>";
+ };
+ 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 32CA4F630368D1EE00C91783 /* «PROJECTNAME»_Prefix.pch */,
+ 002F3A3E09D088BA00EBEB88 /* main.c */,
+ );
+ name = "Other Sources";
+ sourceTree = "<group>";
+ };
+ 29B97317FDCFA39411CA2CEA /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 8D1107310486CEB800E47090 /* Info.plist */,
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
+ 002F3AEF09D08F1000EBEB88 /* SDLMain.nib */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8D1107260486CEB800E47090 /* «PROJECTNAME» */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "«PROJECTNAME»" */;
+ buildPhases = (
+ 8D1107290486CEB800E47090 /* Resources */,
+ 8D11072C0486CEB800E47090 /* Sources */,
+ 8D11072E0486CEB800E47090 /* Frameworks */,
+ 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */,
+ );
+ buildRules = (
+ );
+ buildSettings = {
+ };
+ dependencies = (
+ );
+ name = "«PROJECTNAME»";
+ productInstallPath = "$(HOME)/Applications";
+ productName = "«PROJECTNAME»";
+ productReference = 8D1107320486CEB800E47090 /* «PROJECTNAME».app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 29B97313FDCFA39411CA2CEA /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SDLCocoaApp" */;
+ buildSettings = {
+ };
+ buildStyles = (
+ 4A9504CCFFE6A4B311CA0CBA /* Debug */,
+ 4A9504CDFFE6A4B311CA0CBA /* Release */,
+ );
+ hasScannedForEncodings = 1;
+ mainGroup = 29B97314FDCFA39411CA2CEA /* «PROJECTNAMEASXML» */;
+ projectDirPath = "";
+ targets = (
+ 8D1107260486CEB800E47090 /* «PROJECTNAME» */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 8D1107290486CEB800E47090 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
+ 002F3AF109D08F1000EBEB88 /* SDLMain.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8D11072C0486CEB800E47090 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */,
+ 002F3A3F09D088BA00EBEB88 /* main.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 002F3AEF09D08F1000EBEB88 /* SDLMain.nib */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 002F3AF009D08F1000EBEB88 /* English */,
+ );
+ name = SDLMain.nib;
+ sourceTree = "<group>";
+ };
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 089C165DFE840E0CC02AAC07 /* English */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+/* 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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLMain.h b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLMain.h
new file mode 100644
index 0000000..c56d90c
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLMain.h
@@ -0,0 +1,16 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#ifndef _SDLMain_h_
+#define _SDLMain_h_
+
+#import <Cocoa/Cocoa.h>
+
+@interface SDLMain : NSObject
+@end
+
+#endif /* _SDLMain_h_ */
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLMain.m b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLMain.m
new file mode 100644
index 0000000..b065a20
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/SDLMain.m
@@ -0,0 +1,383 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#include "SDL.h"
+#include "SDLMain.h"
+#include <sys/param.h> /* for MAXPATHLEN */
+#include <unistd.h>
+
+/* For some reaon, Apple removed setAppleMenu from the headers in 10.4,
+ but the method still is there and works. To avoid warnings, we declare
+ it ourselves here. */
+@interface NSApplication(SDL_Missing_Methods)
+- (void)setAppleMenu:(NSMenu *)menu;
+@end
+
+/* Use this flag to determine whether we use SDLMain.nib or not */
+#define SDL_USE_NIB_FILE 0
+
+/* Use this flag to determine whether we use CPS (docking) or not */
+#define SDL_USE_CPS 1
+#ifdef SDL_USE_CPS
+/* Portions of CPS.h */
+typedef struct CPSProcessSerNum
+{
+ UInt32 lo;
+ UInt32 hi;
+} CPSProcessSerNum;
+
+extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
+extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
+extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
+
+#endif /* SDL_USE_CPS */
+
+static int gArgc;
+static char **gArgv;
+static BOOL gFinderLaunch;
+static BOOL gCalledAppMainline = FALSE;
+
+static NSString *getApplicationName(void)
+{
+ const NSDictionary *dict;
+ NSString *appName = 0;
+
+ /* Determine the application name */
+ dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
+ if (dict)
+ appName = [dict objectForKey: @"CFBundleName"];
+
+ if (![appName length])
+ appName = [[NSProcessInfo processInfo] processName];
+
+ return appName;
+}
+
+#if SDL_USE_NIB_FILE
+/* A helper category for NSString */
+@interface NSString (ReplaceSubString)
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
+@end
+#endif
+
+@interface SDLApplication : NSApplication
+@end
+
+@implementation SDLApplication
+/* Invoked from the Quit menu item */
+- (void)terminate:(id)sender
+{
+ /* Post a SDL_QUIT event */
+ SDL_Event event;
+ event.type = SDL_QUIT;
+ SDL_PushEvent(&event);
+}
+@end
+
+/* The main class of the application, the application's delegate */
+@implementation SDLMain
+
+/* Set the working directory to the .app's parent directory */
+- (void) setupWorkingDirectory:(BOOL)shouldChdir
+{
+ if (shouldChdir)
+ {
+ char parentdir[MAXPATHLEN];
+ CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
+ CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
+ if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) {
+ chdir(parentdir); /* chdir to the binary app's parent */
+ }
+ CFRelease(url);
+ CFRelease(url2);
+ }
+}
+
+#if SDL_USE_NIB_FILE
+
+/* Fix menu to contain the real app name instead of "SDL App" */
+- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
+{
+ NSRange aRange;
+ NSEnumerator *enumerator;
+ NSMenuItem *menuItem;
+
+ aRange = [[aMenu title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
+
+ enumerator = [[aMenu itemArray] objectEnumerator];
+ while ((menuItem = [enumerator nextObject]))
+ {
+ aRange = [[menuItem title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
+ if ([menuItem hasSubmenu])
+ [self fixMenu:[menuItem submenu] withAppName:appName];
+ }
+ [ aMenu sizeToFit ];
+}
+
+#else
+
+static void setApplicationMenu(void)
+{
+ /* warning: this code is very odd */
+ NSMenu *appleMenu;
+ NSMenuItem *menuItem;
+ NSString *title;
+ NSString *appName;
+
+ appName = getApplicationName();
+ appleMenu = [[NSMenu alloc] initWithTitle:@""];
+
+ /* Add menu items */
+ title = [@"About " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
+
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ title = [@"Hide " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
+
+ menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
+ [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
+
+ [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
+
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ title = [@"Quit " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
+
+
+ /* Put menu into the menubar */
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
+ [menuItem setSubmenu:appleMenu];
+ [[NSApp mainMenu] addItem:menuItem];
+
+ /* Tell the application object that this is now the application menu */
+ [NSApp setAppleMenu:appleMenu];
+
+ /* Finally give up our references to the objects */
+ [appleMenu release];
+ [menuItem release];
+}
+
+/* Create a window menu */
+static void setupWindowMenu(void)
+{
+ NSMenu *windowMenu;
+ NSMenuItem *windowMenuItem;
+ NSMenuItem *menuItem;
+
+ windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
+
+ /* "Minimize" item */
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
+ [windowMenu addItem:menuItem];
+ [menuItem release];
+
+ /* Put menu into the menubar */
+ windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
+ [windowMenuItem setSubmenu:windowMenu];
+ [[NSApp mainMenu] addItem:windowMenuItem];
+
+ /* Tell the application object that this is now the window menu */
+ [NSApp setWindowsMenu:windowMenu];
+
+ /* Finally give up our references to the objects */
+ [windowMenu release];
+ [windowMenuItem release];
+}
+
+/* Replacement for NSApplicationMain */
+static void CustomApplicationMain (int argc, char **argv)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ SDLMain *sdlMain;
+
+ /* Ensure the application object is initialised */
+ [SDLApplication sharedApplication];
+
+#ifdef SDL_USE_CPS
+ {
+ CPSProcessSerNum PSN;
+ /* Tell the dock about us */
+ if (!CPSGetCurrentProcess(&PSN))
+ if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
+ if (!CPSSetFrontProcess(&PSN))
+ [SDLApplication sharedApplication];
+ }
+#endif /* SDL_USE_CPS */
+
+ /* Set up the menubar */
+ [NSApp setMainMenu:[[NSMenu alloc] init]];
+ setApplicationMenu();
+ setupWindowMenu();
+
+ /* Create SDLMain and make it the app delegate */
+ sdlMain = [[SDLMain alloc] init];
+ [NSApp setDelegate:sdlMain];
+
+ /* Start the main event loop */
+ [NSApp run];
+
+ [sdlMain release];
+ [pool release];
+}
+
+#endif
+
+
+/*
+ * Catch document open requests...this lets us notice files when the app
+ * was launched by double-clicking a document, or when a document was
+ * dragged/dropped on the app's icon. You need to have a
+ * CFBundleDocumentsType section in your Info.plist to get this message,
+ * apparently.
+ *
+ * Files are added to gArgv, so to the app, they'll look like command line
+ * arguments. Previously, apps launched from the finder had nothing but
+ * an argv[0].
+ *
+ * This message may be received multiple times to open several docs on launch.
+ *
+ * This message is ignored once the app's mainline has been called.
+ */
+- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
+{
+ const char *temparg;
+ size_t arglen;
+ char *arg;
+ char **newargv;
+
+ if (!gFinderLaunch) /* MacOS is passing command line args. */
+ return FALSE;
+
+ if (gCalledAppMainline) /* app has started, ignore this document. */
+ return FALSE;
+
+ temparg = [filename UTF8String];
+ arglen = SDL_strlen(temparg) + 1;
+ arg = (char *) SDL_malloc(arglen);
+ if (arg == NULL)
+ return FALSE;
+
+ newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
+ if (newargv == NULL)
+ {
+ SDL_free(arg);
+ return FALSE;
+ }
+ gArgv = newargv;
+
+ SDL_strlcpy(arg, temparg, arglen);
+ gArgv[gArgc++] = arg;
+ gArgv[gArgc] = NULL;
+ return TRUE;
+}
+
+
+/* Called when the internal event loop has just started running */
+- (void) applicationDidFinishLaunching: (NSNotification *) note
+{
+ int status;
+
+ /* Set the working directory to the .app's parent directory */
+ [self setupWorkingDirectory:gFinderLaunch];
+
+#if SDL_USE_NIB_FILE
+ /* Set the main menu to contain the real app name instead of "SDL App" */
+ [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
+#endif
+
+ /* Hand off to main application code */
+ gCalledAppMainline = TRUE;
+ status = SDL_main (gArgc, gArgv);
+
+ /* We're done, thank you for playing */
+ exit(status);
+}
+@end
+
+
+@implementation NSString (ReplaceSubString)
+
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
+{
+ unsigned int bufferSize;
+ unsigned int selfLen = [self length];
+ unsigned int aStringLen = [aString length];
+ unichar *buffer;
+ NSRange localRange;
+ NSString *result;
+
+ bufferSize = selfLen + aStringLen - aRange.length;
+ buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar));
+
+ /* Get first part into buffer */
+ localRange.location = 0;
+ localRange.length = aRange.location;
+ [self getCharacters:buffer range:localRange];
+
+ /* Get middle part into buffer */
+ localRange.location = 0;
+ localRange.length = aStringLen;
+ [aString getCharacters:(buffer+aRange.location) range:localRange];
+
+ /* Get last part into buffer */
+ localRange.location = aRange.location + aRange.length;
+ localRange.length = selfLen - localRange.location;
+ [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];
+
+ /* Build output string */
+ result = [NSString stringWithCharacters:buffer length:bufferSize];
+
+ NSDeallocateMemoryPages(buffer, bufferSize);
+
+ return result;
+}
+
+@end
+
+
+
+#ifdef main
+# undef main
+#endif
+
+
+/* Main entry point to executable - should *not* be SDL_main! */
+int main (int argc, char **argv)
+{
+ /* Copy the arguments into a global variable */
+ /* This is passed if we are launched by double-clicking */
+ if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
+ gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
+ gArgv[0] = argv[0];
+ gArgv[1] = NULL;
+ gArgc = 1;
+ gFinderLaunch = YES;
+ } else {
+ int i;
+ gArgc = argc;
+ gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
+ for (i = 0; i <= argc; i++)
+ gArgv[i] = argv[i];
+ gFinderLaunch = NO;
+ }
+
+#if SDL_USE_NIB_FILE
+ [SDLApplication poseAsClass:[NSApplication class]];
+ NSApplicationMain (argc, argv);
+#else
+ CustomApplicationMain (argc, argv);
+#endif
+ return 0;
+}
+
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/main.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/main.c
new file mode 100644
index 0000000..7115de9
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL Cocoa Application/main.c
@@ -0,0 +1,65 @@
+
+/* 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/English.lproj/InfoPlist.strings b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/English.lproj/InfoPlist.strings
new file mode 100755
index 0000000..e612457
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/English.lproj/InfoPlist.strings
Binary files differ
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/Info.plist b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/Info.plist
new file mode 100644
index 0000000..c678d11
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/Info.plist
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.«PROJECTNAMEASXML»</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>NSMainNibFile</key>
+ <string>SDLMain</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLApp_Prefix.pch b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLApp_Prefix.pch
new file mode 100644
index 0000000..0009507
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLApp_Prefix.pch
@@ -0,0 +1,9 @@
+//
+// Prefix header for all source files of the 'ÇPROJECTNAMEÈ' target in the 'ÇPROJECTNAMEÈ' project
+//
+
+#include "SDL.h"
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLMain.h b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLMain.h
new file mode 100644
index 0000000..c56d90c
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLMain.h
@@ -0,0 +1,16 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#ifndef _SDLMain_h_
+#define _SDLMain_h_
+
+#import <Cocoa/Cocoa.h>
+
+@interface SDLMain : NSObject
+@end
+
+#endif /* _SDLMain_h_ */
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLMain.m b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLMain.m
new file mode 100644
index 0000000..b065a20
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLMain.m
@@ -0,0 +1,383 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#include "SDL.h"
+#include "SDLMain.h"
+#include <sys/param.h> /* for MAXPATHLEN */
+#include <unistd.h>
+
+/* For some reaon, Apple removed setAppleMenu from the headers in 10.4,
+ but the method still is there and works. To avoid warnings, we declare
+ it ourselves here. */
+@interface NSApplication(SDL_Missing_Methods)
+- (void)setAppleMenu:(NSMenu *)menu;
+@end
+
+/* Use this flag to determine whether we use SDLMain.nib or not */
+#define SDL_USE_NIB_FILE 0
+
+/* Use this flag to determine whether we use CPS (docking) or not */
+#define SDL_USE_CPS 1
+#ifdef SDL_USE_CPS
+/* Portions of CPS.h */
+typedef struct CPSProcessSerNum
+{
+ UInt32 lo;
+ UInt32 hi;
+} CPSProcessSerNum;
+
+extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
+extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
+extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
+
+#endif /* SDL_USE_CPS */
+
+static int gArgc;
+static char **gArgv;
+static BOOL gFinderLaunch;
+static BOOL gCalledAppMainline = FALSE;
+
+static NSString *getApplicationName(void)
+{
+ const NSDictionary *dict;
+ NSString *appName = 0;
+
+ /* Determine the application name */
+ dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
+ if (dict)
+ appName = [dict objectForKey: @"CFBundleName"];
+
+ if (![appName length])
+ appName = [[NSProcessInfo processInfo] processName];
+
+ return appName;
+}
+
+#if SDL_USE_NIB_FILE
+/* A helper category for NSString */
+@interface NSString (ReplaceSubString)
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
+@end
+#endif
+
+@interface SDLApplication : NSApplication
+@end
+
+@implementation SDLApplication
+/* Invoked from the Quit menu item */
+- (void)terminate:(id)sender
+{
+ /* Post a SDL_QUIT event */
+ SDL_Event event;
+ event.type = SDL_QUIT;
+ SDL_PushEvent(&event);
+}
+@end
+
+/* The main class of the application, the application's delegate */
+@implementation SDLMain
+
+/* Set the working directory to the .app's parent directory */
+- (void) setupWorkingDirectory:(BOOL)shouldChdir
+{
+ if (shouldChdir)
+ {
+ char parentdir[MAXPATHLEN];
+ CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
+ CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
+ if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) {
+ chdir(parentdir); /* chdir to the binary app's parent */
+ }
+ CFRelease(url);
+ CFRelease(url2);
+ }
+}
+
+#if SDL_USE_NIB_FILE
+
+/* Fix menu to contain the real app name instead of "SDL App" */
+- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
+{
+ NSRange aRange;
+ NSEnumerator *enumerator;
+ NSMenuItem *menuItem;
+
+ aRange = [[aMenu title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
+
+ enumerator = [[aMenu itemArray] objectEnumerator];
+ while ((menuItem = [enumerator nextObject]))
+ {
+ aRange = [[menuItem title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
+ if ([menuItem hasSubmenu])
+ [self fixMenu:[menuItem submenu] withAppName:appName];
+ }
+ [ aMenu sizeToFit ];
+}
+
+#else
+
+static void setApplicationMenu(void)
+{
+ /* warning: this code is very odd */
+ NSMenu *appleMenu;
+ NSMenuItem *menuItem;
+ NSString *title;
+ NSString *appName;
+
+ appName = getApplicationName();
+ appleMenu = [[NSMenu alloc] initWithTitle:@""];
+
+ /* Add menu items */
+ title = [@"About " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
+
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ title = [@"Hide " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
+
+ menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
+ [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
+
+ [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
+
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ title = [@"Quit " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
+
+
+ /* Put menu into the menubar */
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
+ [menuItem setSubmenu:appleMenu];
+ [[NSApp mainMenu] addItem:menuItem];
+
+ /* Tell the application object that this is now the application menu */
+ [NSApp setAppleMenu:appleMenu];
+
+ /* Finally give up our references to the objects */
+ [appleMenu release];
+ [menuItem release];
+}
+
+/* Create a window menu */
+static void setupWindowMenu(void)
+{
+ NSMenu *windowMenu;
+ NSMenuItem *windowMenuItem;
+ NSMenuItem *menuItem;
+
+ windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
+
+ /* "Minimize" item */
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
+ [windowMenu addItem:menuItem];
+ [menuItem release];
+
+ /* Put menu into the menubar */
+ windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
+ [windowMenuItem setSubmenu:windowMenu];
+ [[NSApp mainMenu] addItem:windowMenuItem];
+
+ /* Tell the application object that this is now the window menu */
+ [NSApp setWindowsMenu:windowMenu];
+
+ /* Finally give up our references to the objects */
+ [windowMenu release];
+ [windowMenuItem release];
+}
+
+/* Replacement for NSApplicationMain */
+static void CustomApplicationMain (int argc, char **argv)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ SDLMain *sdlMain;
+
+ /* Ensure the application object is initialised */
+ [SDLApplication sharedApplication];
+
+#ifdef SDL_USE_CPS
+ {
+ CPSProcessSerNum PSN;
+ /* Tell the dock about us */
+ if (!CPSGetCurrentProcess(&PSN))
+ if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
+ if (!CPSSetFrontProcess(&PSN))
+ [SDLApplication sharedApplication];
+ }
+#endif /* SDL_USE_CPS */
+
+ /* Set up the menubar */
+ [NSApp setMainMenu:[[NSMenu alloc] init]];
+ setApplicationMenu();
+ setupWindowMenu();
+
+ /* Create SDLMain and make it the app delegate */
+ sdlMain = [[SDLMain alloc] init];
+ [NSApp setDelegate:sdlMain];
+
+ /* Start the main event loop */
+ [NSApp run];
+
+ [sdlMain release];
+ [pool release];
+}
+
+#endif
+
+
+/*
+ * Catch document open requests...this lets us notice files when the app
+ * was launched by double-clicking a document, or when a document was
+ * dragged/dropped on the app's icon. You need to have a
+ * CFBundleDocumentsType section in your Info.plist to get this message,
+ * apparently.
+ *
+ * Files are added to gArgv, so to the app, they'll look like command line
+ * arguments. Previously, apps launched from the finder had nothing but
+ * an argv[0].
+ *
+ * This message may be received multiple times to open several docs on launch.
+ *
+ * This message is ignored once the app's mainline has been called.
+ */
+- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
+{
+ const char *temparg;
+ size_t arglen;
+ char *arg;
+ char **newargv;
+
+ if (!gFinderLaunch) /* MacOS is passing command line args. */
+ return FALSE;
+
+ if (gCalledAppMainline) /* app has started, ignore this document. */
+ return FALSE;
+
+ temparg = [filename UTF8String];
+ arglen = SDL_strlen(temparg) + 1;
+ arg = (char *) SDL_malloc(arglen);
+ if (arg == NULL)
+ return FALSE;
+
+ newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
+ if (newargv == NULL)
+ {
+ SDL_free(arg);
+ return FALSE;
+ }
+ gArgv = newargv;
+
+ SDL_strlcpy(arg, temparg, arglen);
+ gArgv[gArgc++] = arg;
+ gArgv[gArgc] = NULL;
+ return TRUE;
+}
+
+
+/* Called when the internal event loop has just started running */
+- (void) applicationDidFinishLaunching: (NSNotification *) note
+{
+ int status;
+
+ /* Set the working directory to the .app's parent directory */
+ [self setupWorkingDirectory:gFinderLaunch];
+
+#if SDL_USE_NIB_FILE
+ /* Set the main menu to contain the real app name instead of "SDL App" */
+ [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
+#endif
+
+ /* Hand off to main application code */
+ gCalledAppMainline = TRUE;
+ status = SDL_main (gArgc, gArgv);
+
+ /* We're done, thank you for playing */
+ exit(status);
+}
+@end
+
+
+@implementation NSString (ReplaceSubString)
+
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
+{
+ unsigned int bufferSize;
+ unsigned int selfLen = [self length];
+ unsigned int aStringLen = [aString length];
+ unichar *buffer;
+ NSRange localRange;
+ NSString *result;
+
+ bufferSize = selfLen + aStringLen - aRange.length;
+ buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar));
+
+ /* Get first part into buffer */
+ localRange.location = 0;
+ localRange.length = aRange.location;
+ [self getCharacters:buffer range:localRange];
+
+ /* Get middle part into buffer */
+ localRange.location = 0;
+ localRange.length = aStringLen;
+ [aString getCharacters:(buffer+aRange.location) range:localRange];
+
+ /* Get last part into buffer */
+ localRange.location = aRange.location + aRange.length;
+ localRange.length = selfLen - localRange.location;
+ [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];
+
+ /* Build output string */
+ result = [NSString stringWithCharacters:buffer length:bufferSize];
+
+ NSDeallocateMemoryPages(buffer, bufferSize);
+
+ return result;
+}
+
+@end
+
+
+
+#ifdef main
+# undef main
+#endif
+
+
+/* Main entry point to executable - should *not* be SDL_main! */
+int main (int argc, char **argv)
+{
+ /* Copy the arguments into a global variable */
+ /* This is passed if we are launched by double-clicking */
+ if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
+ gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
+ gArgv[0] = argv[0];
+ gArgv[1] = NULL;
+ gArgc = 1;
+ gFinderLaunch = YES;
+ } else {
+ int i;
+ gArgc = argc;
+ gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
+ for (i = 0; i <= argc; i++)
+ gArgv[i] = argv[i];
+ gFinderLaunch = NO;
+ }
+
+#if SDL_USE_NIB_FILE
+ [SDLApplication poseAsClass:[NSApplication class]];
+ NSApplicationMain (argc, argv);
+#else
+ CustomApplicationMain (argc, argv);
+#endif
+ return 0;
+}
+
diff --git a/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLOpenGLApp.xcodeproj/TemplateInfo.plist b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLOpenGLApp.xcodeproj/TemplateInfo.plist
new file mode 100644
index 0000000..ba87745
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLOpenGLApp.xcodeproj/TemplateInfo.plist
@@ -0,0 +1,12 @@
+{
+ 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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLOpenGLApp.xcodeproj/project.pbxproj b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLOpenGLApp.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..6995ccb
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/SDLOpenGLApp.xcodeproj/project.pbxproj
@@ -0,0 +1,362 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 42;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 002F39FA09D0881F00EBEB88 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; };
+ 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */ = {isa = PBXBuildFile; fileRef = 002F39F909D0881F00EBEB88 /* SDL.framework */; };
+ 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A2C09D0888800EBEB88 /* SDLMain.m */; };
+ 002F3A3F09D088BA00EBEB88 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3A3E09D088BA00EBEB88 /* main.c */; };
+ 002F3BFA09D0938900EBEB88 /* atlantis.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF409D0938900EBEB88 /* atlantis.c */; };
+ 002F3BFC09D0938900EBEB88 /* dolphin.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF609D0938900EBEB88 /* dolphin.c */; };
+ 002F3BFD09D0938900EBEB88 /* shark.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF709D0938900EBEB88 /* shark.c */; };
+ 002F3BFE09D0938900EBEB88 /* swim.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF809D0938900EBEB88 /* swim.c */; };
+ 002F3BFF09D0938900EBEB88 /* whale.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F3BF909D0938900EBEB88 /* whale.c */; };
+ 002F3C0109D093BD00EBEB88 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F3C0009D093BD00EBEB88 /* OpenGL.framework */; };
+ 002F3C6109D0951E00EBEB88 /* GLUT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 002F3C6009D0951E00EBEB88 /* GLUT.framework */; };
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXBuildStyle section */
+ 4A9504CCFFE6A4B311CA0CBA /* Debug */ = {
+ isa = PBXBuildStyle;
+ buildSettings = {
+ };
+ name = Debug;
+ };
+ 4A9504CDFFE6A4B311CA0CBA /* Release */ = {
+ isa = PBXBuildStyle;
+ buildSettings = {
+ };
+ name = Release;
+ };
+/* End PBXBuildStyle section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ 002F3A0009D0884600EBEB88 /* SDL.framework in Copy Frameworks into .app bundle */,
+ );
+ name = "Copy Frameworks into .app bundle";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 002F39F909D0881F00EBEB88 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = "<absolute>"; };
+ 002F3A2B09D0888800EBEB88 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; };
+ 002F3A2C09D0888800EBEB88 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; };
+ 002F3A3E09D088BA00EBEB88 /* main.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = SOURCE_ROOT; };
+ 002F3BF409D0938900EBEB88 /* atlantis.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = atlantis.c; path = atlantis/atlantis.c; sourceTree = SOURCE_ROOT; };
+ 002F3BF509D0938900EBEB88 /* atlantis.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = atlantis.h; path = atlantis/atlantis.h; sourceTree = SOURCE_ROOT; };
+ 002F3BF609D0938900EBEB88 /* dolphin.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = dolphin.c; path = atlantis/dolphin.c; sourceTree = SOURCE_ROOT; };
+ 002F3BF709D0938900EBEB88 /* shark.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = shark.c; path = atlantis/shark.c; sourceTree = SOURCE_ROOT; };
+ 002F3BF809D0938900EBEB88 /* swim.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = swim.c; path = atlantis/swim.c; sourceTree = SOURCE_ROOT; };
+ 002F3BF909D0938900EBEB88 /* whale.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = whale.c; path = atlantis/whale.c; sourceTree = SOURCE_ROOT; };
+ 002F3C0009D093BD00EBEB88 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
+ 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 = "<group>"; };
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+ 32CA4F630368D1EE00C91783 /* «PROJECTNAME»_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file; path = "«PROJECTNAME»_Prefix.pch"; sourceTree = "<group>"; };
+ 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
+ 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 = "<group>";
+ };
+ 080E96DDFE201D6D7F000001 /* Classes */ = {
+ isa = PBXGroup;
+ children = (
+ 002F3A2B09D0888800EBEB88 /* SDLMain.h */,
+ 002F3A2C09D0888800EBEB88 /* SDLMain.m */,
+ );
+ name = Classes;
+ sourceTree = "<group>";
+ };
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 002F39F909D0881F00EBEB88 /* SDL.framework */,
+ 002F3C6009D0951E00EBEB88 /* GLUT.framework */,
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
+ 002F3C0009D093BD00EBEB88 /* OpenGL.framework */,
+ );
+ name = "Linked Frameworks";
+ sourceTree = "<group>";
+ };
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */,
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 19C28FACFE9D520D11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8D1107320486CEB800E47090 /* «PROJECTNAME».app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 29B97314FDCFA39411CA2CEA /* «PROJECTNAMEASXML» */ = {
+ isa = PBXGroup;
+ children = (
+ 080E96DDFE201D6D7F000001 /* Classes */,
+ 29B97315FDCFA39411CA2CEA /* Other Sources */,
+ 29B97317FDCFA39411CA2CEA /* Resources */,
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
+ 19C28FACFE9D520D11CA2CBB /* Products */,
+ );
+ name = "«PROJECTNAMEASXML»";
+ sourceTree = "<group>";
+ };
+ 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
+ isa = PBXGroup;
+ children = (
+ 002F3BF309D0937800EBEB88 /* atlantis */,
+ 32CA4F630368D1EE00C91783 /* «PROJECTNAME»_Prefix.pch */,
+ 002F3A3E09D088BA00EBEB88 /* main.c */,
+ );
+ name = "Other Sources";
+ sourceTree = "<group>";
+ };
+ 29B97317FDCFA39411CA2CEA /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 8D1107310486CEB800E47090 /* Info.plist */,
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8D1107260486CEB800E47090 /* «PROJECTNAME» */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "«PROJECTNAME»" */;
+ buildPhases = (
+ 8D1107290486CEB800E47090 /* Resources */,
+ 8D11072C0486CEB800E47090 /* Sources */,
+ 8D11072E0486CEB800E47090 /* Frameworks */,
+ 002F39FD09D0883400EBEB88 /* Copy Frameworks into .app bundle */,
+ );
+ buildRules = (
+ );
+ buildSettings = {
+ };
+ dependencies = (
+ );
+ name = "«PROJECTNAME»";
+ productInstallPath = "$(HOME)/Applications";
+ productName = "«PROJECTNAME»";
+ productReference = 8D1107320486CEB800E47090 /* «PROJECTNAME».app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 29B97313FDCFA39411CA2CEA /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SDLOpenGLApp" */;
+ buildSettings = {
+ };
+ buildStyles = (
+ 4A9504CCFFE6A4B311CA0CBA /* Debug */,
+ 4A9504CDFFE6A4B311CA0CBA /* Release */,
+ );
+ hasScannedForEncodings = 1;
+ mainGroup = 29B97314FDCFA39411CA2CEA /* «PROJECTNAMEASXML» */;
+ projectDirPath = "";
+ targets = (
+ 8D1107260486CEB800E47090 /* «PROJECTNAME» */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 8D1107290486CEB800E47090 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8D11072C0486CEB800E47090 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 002F3A2E09D0888800EBEB88 /* SDLMain.m in Sources */,
+ 002F3A3F09D088BA00EBEB88 /* main.c in Sources */,
+ 002F3BFA09D0938900EBEB88 /* atlantis.c in Sources */,
+ 002F3BFC09D0938900EBEB88 /* dolphin.c in Sources */,
+ 002F3BFD09D0938900EBEB88 /* shark.c in Sources */,
+ 002F3BFE09D0938900EBEB88 /* swim.c in Sources */,
+ 002F3BFF09D0938900EBEB88 /* whale.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 089C165DFE840E0CC02AAC07 /* English */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+/* 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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/atlantis.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/atlantis.c
new file mode 100644
index 0000000..4efdf6c
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/atlantis.c
@@ -0,0 +1,459 @@
+
+/* 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <sys/time.h>
+#include <GLUT/glut.h>
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/atlantis.h b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/atlantis.h
new file mode 100644
index 0000000..6ccf2d5
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/atlantis.h
@@ -0,0 +1,65 @@
+/**
+ * (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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/dolphin.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/dolphin.c
new file mode 100644
index 0000000..9fba3ba
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/dolphin.c
@@ -0,0 +1,1934 @@
+/**
+ * (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 <math.h>
+#include <GLUT/glut.h>
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/shark.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/shark.c
new file mode 100644
index 0000000..9c847db
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/shark.c
@@ -0,0 +1,1308 @@
+/**
+ * (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 <GLUT/glut.h>
+#include <math.h>
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/swim.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/swim.c
new file mode 100644
index 0000000..cac7b60
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/swim.c
@@ -0,0 +1,188 @@
+/**
+ * (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 <math.h>
+#include <stdlib.h> /* For rand(). */
+#include <GLUT/glut.h>
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/whale.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/whale.c
new file mode 100644
index 0000000..828640a
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/atlantis/whale.c
@@ -0,0 +1,1798 @@
+/**
+ * (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 <GLUT/glut.h>
+#include <math.h>
+#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/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/main.c b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/main.c
new file mode 100644
index 0000000..b7794b3
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/TemplatesForXcodeTiger/SDL OpenGL Application/main.c
@@ -0,0 +1,179 @@
+
+/* 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#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/distrib/sdl-1.2.15/Xcode/XcodeDocSet/Doxyfile b/distrib/sdl-1.2.15/Xcode/XcodeDocSet/Doxyfile
new file mode 100644
index 0000000..34e1228
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/XcodeDocSet/Doxyfile
@@ -0,0 +1,1558 @@
+# Doxyfile 1.6.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 = SDL
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 1.2.14
+
+# 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 =
+
+# 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, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE = English
+
+# If the 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 = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+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 = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. 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 = YES
+
+# 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
+
+# Doxygen selects the parser to use depending on the extension of the files it parses.
+# With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this tag.
+# The format is ext=language, where ext is a file extension, and language is one of
+# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
+# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat
+# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran),
+# use: inc=Fortran f=C. Note that for custom extensions you also need to set
+# FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING =
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = 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 = YES
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = 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 = NO
+
+# 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 = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = YES
+
+# 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 = NO
+
+# 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_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = 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 = NO
+
+# 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 <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> 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 = YES
+
+# 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 = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# 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 = ../../include
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.c \
+ *.cc \
+ *.cxx \
+ *.cpp \
+ *.c++ \
+ *.d \
+ *.java \
+ *.ii \
+ *.ixx \
+ *.ipp \
+ *.i++ \
+ *.inl \
+ *.h \
+ *.hh \
+ *.hxx \
+ *.hpp \
+ *.h++ \
+ *.idl \
+ *.odl \
+ *.cs \
+ *.php \
+ *.php3 \
+ *.inc \
+ *.m \
+ *.mm \
+ *.dox \
+ *.py \
+ *.f90 \
+ *.f \
+ *.vhd \
+ *.vhdl
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = NO
+
+# 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 <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> 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 = NO
+
+# 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 = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# 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 = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# 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 = YES
+
+# 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 for SDL"
+
+# 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.sdl
+
+# 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 = SDL.chm
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION = "C:/Program Files/HTML Help Workshop/hhc.exe"
+
+# 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 = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+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
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE =
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add.
+# For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 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 YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW = NO
+
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list.
+
+USE_INLINE_TREES = NO
+
+# 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
+
+# When the SEARCHENGINE tag is enable doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP)
+# there is already a search function so this one should typically
+# be disabled.
+
+SEARCHENGINE = NO
+
+#---------------------------------------------------------------------------
+# 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
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is 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 = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# 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 = NO
+
+# 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 = DECLSPEC \
+ SDLCALL
+
+# 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 = NO
+
+# 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 = /Applications/Graphviz.app/Contents/MacOS
+
+# 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 = 67
+
+# 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 = 2
+
+# 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
diff --git a/distrib/sdl-1.2.15/Xcode/mkxcode.csh b/distrib/sdl-1.2.15/Xcode/mkxcode.csh
new file mode 100755
index 0000000..caf6481
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/mkxcode.csh
@@ -0,0 +1,20 @@
+#!/bin/csh
+
+###
+## This script creates "Xcode.tar.gz" in the parent directory
+###
+
+# remove build products
+rm -rf SDL/build
+rm -rf SDLTest/build
+
+# remove Finder info files
+find . -name ".DS_Store" -exec rm "{}" ";"
+
+# remove user project prefs
+find . -name "*.pbxuser*" -exec rm "{}" ";"
+find . -name "*.mode*" -exec rm "{}" ";"
+find . -name "*.perspective*" -exec rm "{}" ";"
+
+# create the archive
+(cd .. && gnutar -zcvf Xcode.tar.gz Xcode)
diff --git a/distrib/sdl-1.2.15/Xcode/package b/distrib/sdl-1.2.15/Xcode/package
new file mode 100755
index 0000000..6e6b570
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/package
@@ -0,0 +1,272 @@
+#! /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/distrib/sdl-1.2.15/Xcode/stationary.csh b/distrib/sdl-1.2.15/Xcode/stationary.csh
new file mode 100755
index 0000000..ba5a385
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/stationary.csh
@@ -0,0 +1,25 @@
+#!/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/distrib/sdl-1.2.15/Xcode/uninstall.csh b/distrib/sdl-1.2.15/Xcode/uninstall.csh
new file mode 100755
index 0000000..aab8d79
--- /dev/null
+++ b/distrib/sdl-1.2.15/Xcode/uninstall.csh
@@ -0,0 +1,32 @@
+#!/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/distrib/sdl-1.2.15/acinclude/alsa.m4 b/distrib/sdl-1.2.15/acinclude/alsa.m4
new file mode 100644
index 0000000..d818e70
--- /dev/null
+++ b/distrib/sdl-1.2.15/acinclude/alsa.m4
@@ -0,0 +1,145 @@
+##############################################################################
+dnl Configure Paths for Alsa
+dnl Some modifications by Richard Boulton <richard-alsa@tartarus.org>
+dnl Christopher Lansdown <lansdoct@cs.alfred.edu>
+dnl Jaroslav Kysela <perex@suse.cz>
+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 <alsa/asoundlib.h>
+], [
+/* 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)
+])
diff --git a/distrib/sdl-1.2.15/acinclude/esd.m4 b/distrib/sdl-1.2.15/acinclude/esd.m4
new file mode 100644
index 0000000..58d64a9
--- /dev/null
+++ b/distrib/sdl-1.2.15/acinclude/esd.m4
@@ -0,0 +1,168 @@
+##############################################################################
+#
+# --- 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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <esd.h>
+
+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, &micro) != 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 <stdio.h>
+#include <esd.h>
+], [ 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
+])
diff --git a/distrib/sdl-1.2.15/acinclude/libtool.m4 b/distrib/sdl-1.2.15/acinclude/libtool.m4
new file mode 100644
index 0000000..b64223e
--- /dev/null
+++ b/distrib/sdl-1.2.15/acinclude/libtool.m4
@@ -0,0 +1,7370 @@
+##############################################################################
+# Based on libtool-2.2.6a
+# 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:
+#
+# <var>='`$ECHO "X$<var>" | $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 <bug-libtool@gnu.org>."
+
+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;
+ ;;
+
+ beos*)
+ # On BeOS, this test takes a really really long time.
+ # So we just punt and use a minimum line length of 8192.
+ 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 <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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<name>.so
+ # instead of lib<name>.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}'
+ soname_spec='`echo ${libname} | sed -e 's/^lib//'`${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}'
+ soname_spec='`echo ${libname} | $SED -e 's/^lib//'`${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ 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 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_DECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[[45]]*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ 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)?|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
+ ;;
+
+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 <jrb3@best.com> 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 <jrb3@best.com> 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/distrib/sdl-1.2.15/acinclude/ltdl.m4 b/distrib/sdl-1.2.15/acinclude/ltdl.m4
new file mode 100644
index 0000000..e2b7129
--- /dev/null
+++ b/distrib/sdl-1.2.15/acinclude/ltdl.m4
@@ -0,0 +1,806 @@
+##############################################################################
+# ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*-
+#
+# Copyright (C) 1999-2006, 2007, 2008 Free Software Foundation, Inc.
+# Written by Thomas Tanner, 1999
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 17 LTDL_INIT
+
+# LT_CONFIG_LTDL_DIR(DIRECTORY, [LTDL-MODE])
+# ------------------------------------------
+# DIRECTORY contains the libltdl sources. It is okay to call this
+# function multiple times, as long as the same DIRECTORY is always given.
+AC_DEFUN([LT_CONFIG_LTDL_DIR],
+[AC_BEFORE([$0], [LTDL_INIT])
+_$0($*)
+])# LT_CONFIG_LTDL_DIR
+
+# We break this out into a separate macro, so that we can call it safely
+# internally without being caught accidentally by the sed scan in libtoolize.
+m4_defun([_LT_CONFIG_LTDL_DIR],
+[dnl remove trailing slashes
+m4_pushdef([_ARG_DIR], m4_bpatsubst([$1], [/*$]))
+m4_case(_LTDL_DIR,
+ [], [dnl only set lt_ltdl_dir if _ARG_DIR is not simply `.'
+ m4_if(_ARG_DIR, [.],
+ [],
+ [m4_define([_LTDL_DIR], _ARG_DIR)
+ _LT_SHELL_INIT([lt_ltdl_dir=']_ARG_DIR['])])],
+ [m4_if(_ARG_DIR, _LTDL_DIR,
+ [],
+ [m4_fatal([multiple libltdl directories: `]_LTDL_DIR[', `]_ARG_DIR['])])])
+m4_popdef([_ARG_DIR])
+])# _LT_CONFIG_LTDL_DIR
+
+# Initialise:
+m4_define([_LTDL_DIR], [])
+
+
+# _LT_BUILD_PREFIX
+# ----------------
+# If Autoconf is new enough, expand to `${top_build_prefix}', otherwise
+# to `${top_builddir}/'.
+m4_define([_LT_BUILD_PREFIX],
+[m4_ifdef([AC_AUTOCONF_VERSION],
+ [m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.62]),
+ [-1], [m4_ifdef([_AC_HAVE_TOP_BUILD_PREFIX],
+ [${top_build_prefix}],
+ [${top_builddir}/])],
+ [${top_build_prefix}])],
+ [${top_builddir}/])[]dnl
+])
+
+
+# LTDL_CONVENIENCE
+# ----------------
+# sets LIBLTDL to the link flags for the libltdl convenience library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-convenience to the configure arguments. Note that
+# AC_CONFIG_SUBDIRS is not called here. LIBLTDL will be prefixed with
+# '${top_build_prefix}' if available, otherwise with '${top_builddir}/',
+# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
+# quotes!). If your package is not flat and you're not using automake,
+# define top_build_prefix, top_builddir, and top_srcdir appropriately
+# in your Makefiles.
+AC_DEFUN([LTDL_CONVENIENCE],
+[AC_BEFORE([$0], [LTDL_INIT])dnl
+dnl Although the argument is deprecated and no longer documented,
+dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one
+dnl here make sure it is the same as any other declaration of libltdl's
+dnl location! This also ensures lt_ltdl_dir is set when configure.ac is
+dnl not yet using an explicit LT_CONFIG_LTDL_DIR.
+m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl
+_$0()
+])# LTDL_CONVENIENCE
+
+# AC_LIBLTDL_CONVENIENCE accepted a directory argument in older libtools,
+# now we have LT_CONFIG_LTDL_DIR:
+AU_DEFUN([AC_LIBLTDL_CONVENIENCE],
+[_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])])
+_LTDL_CONVENIENCE])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [])
+
+
+# _LTDL_CONVENIENCE
+# -----------------
+# Code shared by LTDL_CONVENIENCE and LTDL_INIT([convenience]).
+m4_defun([_LTDL_CONVENIENCE],
+[case $enable_ltdl_convenience in
+ no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+ "") enable_ltdl_convenience=yes
+ ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+esac
+LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la"
+LTDLDEPS=$LIBLTDL
+LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}"
+
+AC_SUBST([LIBLTDL])
+AC_SUBST([LTDLDEPS])
+AC_SUBST([LTDLINCL])
+
+# For backwards non-gettext consistent compatibility...
+INCLTDL="$LTDLINCL"
+AC_SUBST([INCLTDL])
+])# _LTDL_CONVENIENCE
+
+
+# LTDL_INSTALLABLE
+# ----------------
+# sets LIBLTDL to the link flags for the libltdl installable library
+# and LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-install to the configure arguments. Note that
+# AC_CONFIG_SUBDIRS is not called from here. If an installed libltdl
+# is not found, LIBLTDL will be prefixed with '${top_build_prefix}' if
+# available, otherwise with '${top_builddir}/', and LTDLINCL will be
+# prefixed with '${top_srcdir}/' (note the single quotes!). If your
+# package is not flat and you're not using automake, define top_build_prefix,
+# top_builddir, and top_srcdir appropriately in your Makefiles.
+# In the future, this macro may have to be called after LT_INIT.
+AC_DEFUN([LTDL_INSTALLABLE],
+[AC_BEFORE([$0], [LTDL_INIT])dnl
+dnl Although the argument is deprecated and no longer documented,
+dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one
+dnl here make sure it is the same as any other declaration of libltdl's
+dnl location! This also ensures lt_ltdl_dir is set when configure.ac is
+dnl not yet using an explicit LT_CONFIG_LTDL_DIR.
+m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl
+_$0()
+])# LTDL_INSTALLABLE
+
+# AC_LIBLTDL_INSTALLABLE accepted a directory argument in older libtools,
+# now we have LT_CONFIG_LTDL_DIR:
+AU_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])])
+_LTDL_INSTALLABLE])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [])
+
+
+# _LTDL_INSTALLABLE
+# -----------------
+# Code shared by LTDL_INSTALLABLE and LTDL_INIT([installable]).
+m4_defun([_LTDL_INSTALLABLE],
+[if test -f $prefix/lib/libltdl.la; then
+ lt_save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="-L$prefix/lib $LDFLAGS"
+ AC_CHECK_LIB([ltdl], [lt_dlinit], [lt_lib_ltdl=yes])
+ LDFLAGS="$lt_save_LDFLAGS"
+ if test x"${lt_lib_ltdl-no}" = xyes; then
+ if test x"$enable_ltdl_install" != xyes; then
+ # Don't overwrite $prefix/lib/libltdl.la without --enable-ltdl-install
+ AC_MSG_WARN([not overwriting libltdl at $prefix, force with `--enable-ltdl-install'])
+ enable_ltdl_install=no
+ fi
+ elif test x"$enable_ltdl_install" = xno; then
+ AC_MSG_WARN([libltdl not installed, but installation disabled])
+ fi
+fi
+
+# If configure.ac declared an installable ltdl, and the user didn't override
+# with --disable-ltdl-install, we will install the shipped libltdl.
+case $enable_ltdl_install in
+ no) ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+ LIBLTDL="-lltdl"
+ LTDLDEPS=
+ LTDLINCL=
+ ;;
+ *) enable_ltdl_install=yes
+ ac_configure_args="$ac_configure_args --enable-ltdl-install"
+ LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdl.la"
+ LTDLDEPS=$LIBLTDL
+ LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}"
+ ;;
+esac
+
+AC_SUBST([LIBLTDL])
+AC_SUBST([LTDLDEPS])
+AC_SUBST([LTDLINCL])
+
+# For backwards non-gettext consistent compatibility...
+INCLTDL="$LTDLINCL"
+AC_SUBST([INCLTDL])
+])# LTDL_INSTALLABLE
+
+
+# _LTDL_MODE_DISPATCH
+# -------------------
+m4_define([_LTDL_MODE_DISPATCH],
+[dnl If _LTDL_DIR is `.', then we are configuring libltdl itself:
+m4_if(_LTDL_DIR, [],
+ [],
+ dnl if _LTDL_MODE was not set already, the default value is `subproject':
+ [m4_case(m4_default(_LTDL_MODE, [subproject]),
+ [subproject], [AC_CONFIG_SUBDIRS(_LTDL_DIR)
+ _LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"])],
+ [nonrecursive], [_LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"; lt_libobj_prefix="$lt_ltdl_dir/"])],
+ [recursive], [],
+ [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])dnl
+dnl Be careful not to expand twice:
+m4_define([$0], [])
+])# _LTDL_MODE_DISPATCH
+
+
+# _LT_LIBOBJ(MODULE_NAME)
+# -----------------------
+# Like AC_LIBOBJ, except that MODULE_NAME goes into _LT_LIBOBJS instead
+# of into LIBOBJS.
+AC_DEFUN([_LT_LIBOBJ], [
+ m4_pattern_allow([^_LT_LIBOBJS$])
+ _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext"
+])# _LT_LIBOBJS
+
+
+# LTDL_INIT([OPTIONS])
+# --------------------
+# Clients of libltdl can use this macro to allow the installer to
+# choose between a shipped copy of the ltdl sources or a preinstalled
+# version of the library. If the shipped ltdl sources are not in a
+# subdirectory named libltdl, the directory name must be given by
+# LT_CONFIG_LTDL_DIR.
+AC_DEFUN([LTDL_INIT],
+[dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+dnl We need to keep our own list of libobjs separate from our parent project,
+dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while
+dnl we look for our own LIBOBJs.
+m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ]))
+m4_pushdef([AC_LIBSOURCES])
+
+dnl If not otherwise defined, default to the 1.5.x compatible subproject mode:
+m4_if(_LTDL_MODE, [],
+ [m4_define([_LTDL_MODE], m4_default([$2], [subproject]))
+ m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])],
+ [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])
+
+AC_ARG_WITH([included_ltdl],
+ [AS_HELP_STRING([--with-included-ltdl],
+ [use the GNU ltdl sources included here])])
+
+if test "x$with_included_ltdl" != xyes; then
+ # We are not being forced to use the included libltdl sources, so
+ # decide whether there is a useful installed version we can use.
+ AC_CHECK_HEADER([ltdl.h],
+ [AC_CHECK_DECL([lt_dlinterface_register],
+ [AC_CHECK_LIB([ltdl], [lt_dladvise_preload],
+ [with_included_ltdl=no],
+ [with_included_ltdl=yes])],
+ [with_included_ltdl=yes],
+ [AC_INCLUDES_DEFAULT
+ #include <ltdl.h>])],
+ [with_included_ltdl=yes],
+ [AC_INCLUDES_DEFAULT]
+ )
+fi
+
+dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE
+dnl was called yet, then for old times' sake, we assume libltdl is in an
+dnl eponymous directory:
+AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])])
+
+AC_ARG_WITH([ltdl_include],
+ [AS_HELP_STRING([--with-ltdl-include=DIR],
+ [use the ltdl headers installed in DIR])])
+
+if test -n "$with_ltdl_include"; then
+ if test -f "$with_ltdl_include/ltdl.h"; then :
+ else
+ AC_MSG_ERROR([invalid ltdl include directory: `$with_ltdl_include'])
+ fi
+else
+ with_ltdl_include=no
+fi
+
+AC_ARG_WITH([ltdl_lib],
+ [AS_HELP_STRING([--with-ltdl-lib=DIR],
+ [use the libltdl.la installed in DIR])])
+
+if test -n "$with_ltdl_lib"; then
+ if test -f "$with_ltdl_lib/libltdl.la"; then :
+ else
+ AC_MSG_ERROR([invalid ltdl library directory: `$with_ltdl_lib'])
+ fi
+else
+ with_ltdl_lib=no
+fi
+
+case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in
+ ,yes,no,no,)
+ m4_case(m4_default(_LTDL_TYPE, [convenience]),
+ [convenience], [_LTDL_CONVENIENCE],
+ [installable], [_LTDL_INSTALLABLE],
+ [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)])
+ ;;
+ ,no,no,no,)
+ # If the included ltdl is not to be used, then use the
+ # preinstalled libltdl we found.
+ AC_DEFINE([HAVE_LTDL], [1],
+ [Define this if a modern libltdl is already installed])
+ LIBLTDL=-lltdl
+ LTDLDEPS=
+ LTDLINCL=
+ ;;
+ ,no*,no,*)
+ AC_MSG_ERROR([`--with-ltdl-include' and `--with-ltdl-lib' options must be used together])
+ ;;
+ *) with_included_ltdl=no
+ LIBLTDL="-L$with_ltdl_lib -lltdl"
+ LTDLDEPS=
+ LTDLINCL="-I$with_ltdl_include"
+ ;;
+esac
+INCLTDL="$LTDLINCL"
+
+# Report our decision...
+AC_MSG_CHECKING([where to find libltdl headers])
+AC_MSG_RESULT([$LTDLINCL])
+AC_MSG_CHECKING([where to find libltdl library])
+AC_MSG_RESULT([$LIBLTDL])
+
+_LTDL_SETUP
+
+dnl restore autoconf definition.
+m4_popdef([AC_LIBOBJ])
+m4_popdef([AC_LIBSOURCES])
+
+AC_CONFIG_COMMANDS_PRE([
+ _ltdl_libobjs=
+ _ltdl_ltlibobjs=
+ if test -n "$_LT_LIBOBJS"; then
+ # Remove the extension.
+ _lt_sed_drop_objext='s/\.o$//;s/\.obj$//'
+ for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do
+ _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext"
+ _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo"
+ done
+ fi
+ AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs])
+ AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs])
+])
+
+# Only expand once:
+m4_define([LTDL_INIT])
+])# LTDL_INIT
+
+# Old names:
+AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)])
+AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)])
+AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIB_LTDL], [])
+dnl AC_DEFUN([AC_WITH_LTDL], [])
+dnl AC_DEFUN([LT_WITH_LTDL], [])
+
+
+# _LTDL_SETUP
+# -----------
+# Perform all the checks necessary for compilation of the ltdl objects
+# -- including compiler checks and header checks. This is a public
+# interface mainly for the benefit of libltdl's own configure.ac, most
+# other users should call LTDL_INIT instead.
+AC_DEFUN([_LTDL_SETUP],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_SYS_MODULE_EXT])dnl
+AC_REQUIRE([LT_SYS_MODULE_PATH])dnl
+AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl
+AC_REQUIRE([LT_LIB_DLLOAD])dnl
+AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl
+AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl
+AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl
+AC_REQUIRE([gl_FUNC_ARGZ])dnl
+
+m4_require([_LT_CHECK_OBJDIR])dnl
+m4_require([_LT_HEADER_DLFCN])dnl
+m4_require([_LT_CHECK_DLPREOPEN])dnl
+m4_require([_LT_DECL_SED])dnl
+
+dnl Don't require this, or it will be expanded earlier than the code
+dnl that sets the variables it relies on:
+_LT_ENABLE_INSTALL
+
+dnl _LTDL_MODE specific code must be called at least once:
+_LTDL_MODE_DISPATCH
+
+# In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS
+# the user used. This is so that ltdl.h can pick up the parent projects
+# config.h file, The first file in AC_CONFIG_HEADERS must contain the
+# definitions required by ltdl.c.
+# FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility).
+AC_CONFIG_COMMANDS_PRE([dnl
+m4_pattern_allow([^LT_CONFIG_H$])dnl
+m4_ifset([AH_HEADER],
+ [LT_CONFIG_H=AH_HEADER],
+ [m4_ifset([AC_LIST_HEADERS],
+ [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's,^[[ ]]*,,;s,[[ :]].*$,,'`],
+ [])])])
+AC_SUBST([LT_CONFIG_H])
+
+AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h],
+ [], [], [AC_INCLUDES_DEFAULT])
+
+AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])])
+AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])])
+
+AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension])
+
+name=ltdl
+LTDLOPEN=`eval "\\$ECHO \"$libname_spec\""`
+AC_SUBST([LTDLOPEN])
+])# _LTDL_SETUP
+
+
+# _LT_ENABLE_INSTALL
+# ------------------
+m4_define([_LT_ENABLE_INSTALL],
+[AC_ARG_ENABLE([ltdl-install],
+ [AS_HELP_STRING([--enable-ltdl-install], [install libltdl])])
+
+case ,${enable_ltdl_install},${enable_ltdl_convenience} in
+ *yes*) ;;
+ *) enable_ltdl_convenience=yes ;;
+esac
+
+m4_ifdef([AM_CONDITIONAL],
+[AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
+ AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)])
+])# _LT_ENABLE_INSTALL
+
+
+# LT_SYS_DLOPEN_DEPLIBS
+# ---------------------
+AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
+ [lt_cv_sys_dlopen_deplibs],
+ [# PORTME does your system automatically load deplibs for dlopen?
+ # or its logical equivalent (e.g. shl_load for HP-UX < 11)
+ # For now, we just catch OSes we know something about -- in the
+ # future, we'll try test this programmatically.
+ lt_cv_sys_dlopen_deplibs=unknown
+ case $host_os in
+ aix3*|aix4.1.*|aix4.2.*)
+ # Unknown whether this is true for these versions of AIX, but
+ # we want this `case' here to explicitly catch those versions.
+ lt_cv_sys_dlopen_deplibs=unknown
+ ;;
+ aix[[4-9]]*)
+ lt_cv_sys_dlopen_deplibs=yes
+ ;;
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ lt_cv_sys_dlopen_deplibs=no
+ ;;
+ esac
+ ;;
+ darwin*)
+ # Assuming the user has installed a libdl from somewhere, this is true
+ # If you are looking for one http://www.opendarwin.org/projects/dlcompat
+ lt_cv_sys_dlopen_deplibs=yes
+ ;;
+ freebsd* | dragonfly*)
+ lt_cv_sys_dlopen_deplibs=yes
+ ;;
+ gnu* | linux* | k*bsd*-gnu)
+ # GNU and its variants, using gnu ld.so (Glibc)
+ lt_cv_sys_dlopen_deplibs=yes
+ ;;
+ hpux10*|hpux11*)
+ lt_cv_sys_dlopen_deplibs=yes
+ ;;
+ interix*)
+ lt_cv_sys_dlopen_deplibs=yes
+ ;;
+ irix[[12345]]*|irix6.[[01]]*)
+ # Catch all versions of IRIX before 6.2, and indicate that we don't
+ # know how it worked for any of those versions.
+ lt_cv_sys_dlopen_deplibs=unknown
+ ;;
+ irix*)
+ # The case above catches anything before 6.2, and it's known that
+ # at 6.2 and later dlopen does load deplibs.
+ lt_cv_sys_dlopen_deplibs=yes
+ ;;
+ netbsd*)
+ lt_cv_sys_dlopen_deplibs=yes
+ ;;
+ openbsd*)
+ lt_cv_sys_dlopen_deplibs=yes
+ ;;
+ osf[[1234]]*)
+ # dlopen did load deplibs (at least at 4.x), but until the 5.x series,
+ # it did *not* use an RPATH in a shared library to find objects the
+ # library depends on, so we explicitly say `no'.
+ lt_cv_sys_dlopen_deplibs=no
+ ;;
+ osf5.0|osf5.0a|osf5.1)
+ # dlopen *does* load deplibs and with the right loader patch applied
+ # it even uses RPATH in a shared library to search for shared objects
+ # that the library depends on, but there's no easy way to know if that
+ # patch is installed. Since this is the case, all we can really
+ # say is unknown -- it depends on the patch being installed. If
+ # it is, this changes to `yes'. Without it, it would be `no'.
+ lt_cv_sys_dlopen_deplibs=unknown
+ ;;
+ osf*)
+ # the two cases above should catch all versions of osf <= 5.1. Read
+ # the comments above for what we know about them.
+ # At > 5.1, deplibs are loaded *and* any RPATH in a shared library
+ # is used to find them so we can finally say `yes'.
+ lt_cv_sys_dlopen_deplibs=yes
+ ;;
+ qnx*)
+ lt_cv_sys_dlopen_deplibs=yes
+ ;;
+ solaris*)
+ lt_cv_sys_dlopen_deplibs=yes
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ esac
+ ])
+if test "$lt_cv_sys_dlopen_deplibs" != yes; then
+ AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1],
+ [Define if the OS needs help to load dependent libraries for dlopen().])
+fi
+])# LT_SYS_DLOPEN_DEPLIBS
+
+# Old name:
+AU_ALIAS([AC_LTDL_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [])
+
+
+# LT_SYS_MODULE_EXT
+# -----------------
+AC_DEFUN([LT_SYS_MODULE_EXT],
+[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
+AC_CACHE_CHECK([which extension is used for runtime loadable modules],
+ [libltdl_cv_shlibext],
+[
+module=yes
+eval libltdl_cv_shlibext=$shrext_cmds
+ ])
+if test -n "$libltdl_cv_shlibext"; then
+ m4_pattern_allow([LT_MODULE_EXT])dnl
+ AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"],
+ [Define to the extension used for runtime loadable modules, say, ".so".])
+fi
+])# LT_SYS_MODULE_EXT
+
+# Old name:
+AU_ALIAS([AC_LTDL_SHLIBEXT], [LT_SYS_MODULE_EXT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LTDL_SHLIBEXT], [])
+
+
+# LT_SYS_MODULE_PATH
+# ------------------
+AC_DEFUN([LT_SYS_MODULE_PATH],
+[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
+AC_CACHE_CHECK([which variable specifies run-time module search path],
+ [lt_cv_module_path_var], [lt_cv_module_path_var="$shlibpath_var"])
+if test -n "$lt_cv_module_path_var"; then
+ m4_pattern_allow([LT_MODULE_PATH_VAR])dnl
+ AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"],
+ [Define to the name of the environment variable that determines the run-time module search path.])
+fi
+])# LT_SYS_MODULE_PATH
+
+# Old name:
+AU_ALIAS([AC_LTDL_SHLIBPATH], [LT_SYS_MODULE_PATH])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LTDL_SHLIBPATH], [])
+
+
+# LT_SYS_DLSEARCH_PATH
+# --------------------
+AC_DEFUN([LT_SYS_DLSEARCH_PATH],
+[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
+AC_CACHE_CHECK([for the default library search path],
+ [lt_cv_sys_dlsearch_path],
+ [lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec"])
+if test -n "$lt_cv_sys_dlsearch_path"; then
+ sys_dlsearch_path=
+ for dir in $lt_cv_sys_dlsearch_path; do
+ if test -z "$sys_dlsearch_path"; then
+ sys_dlsearch_path="$dir"
+ else
+ sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir"
+ fi
+ done
+ m4_pattern_allow([LT_DLSEARCH_PATH])dnl
+ AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"],
+ [Define to the system default library search path.])
+fi
+])# LT_SYS_DLSEARCH_PATH
+
+# Old name:
+AU_ALIAS([AC_LTDL_SYSSEARCHPATH], [LT_SYS_DLSEARCH_PATH])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LTDL_SYSSEARCHPATH], [])
+
+
+# _LT_CHECK_DLPREOPEN
+# -------------------
+m4_defun([_LT_CHECK_DLPREOPEN],
+[m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
+ [libltdl_cv_preloaded_symbols],
+ [if test -n "$lt_cv_sys_global_symbol_pipe"; then
+ libltdl_cv_preloaded_symbols=yes
+ else
+ libltdl_cv_preloaded_symbols=no
+ fi
+ ])
+if test x"$libltdl_cv_preloaded_symbols" = xyes; then
+ AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1],
+ [Define if libtool can extract symbol lists from object files.])
+fi
+])# _LT_CHECK_DLPREOPEN
+
+
+# LT_LIB_DLLOAD
+# -------------
+AC_DEFUN([LT_LIB_DLLOAD],
+[m4_pattern_allow([^LT_DLLOADERS$])
+LT_DLLOADERS=
+AC_SUBST([LT_DLLOADERS])
+
+AC_LANG_PUSH([C])
+
+LIBADD_DLOPEN=
+AC_SEARCH_LIBS([dlopen], [dl],
+ [AC_DEFINE([HAVE_LIBDL], [1],
+ [Define if you have the libdl library or equivalent.])
+ if test "$ac_cv_search_dlopen" != "none required" ; then
+ LIBADD_DLOPEN="-ldl"
+ fi
+ libltdl_cv_lib_dl_dlopen="yes"
+ LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H
+# include <dlfcn.h>
+#endif
+ ]], [[dlopen(0, 0);]])],
+ [AC_DEFINE([HAVE_LIBDL], [1],
+ [Define if you have the libdl library or equivalent.])
+ libltdl_cv_func_dlopen="yes"
+ LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [AC_DEFINE([HAVE_LIBDL], [1],
+ [Define if you have the libdl library or equivalent.])
+ LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes"
+ LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])])
+if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes
+then
+ lt_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBADD_DLOPEN"
+ AC_CHECK_FUNCS([dlerror])
+ LIBS="$lt_save_LIBS"
+fi
+AC_SUBST([LIBADD_DLOPEN])
+
+LIBADD_SHL_LOAD=
+AC_CHECK_FUNC([shl_load],
+ [AC_DEFINE([HAVE_SHL_LOAD], [1],
+ [Define if you have the shl_load function.])
+ LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [AC_DEFINE([HAVE_SHL_LOAD], [1],
+ [Define if you have the shl_load function.])
+ LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"
+ LIBADD_SHL_LOAD="-ldld"])])
+AC_SUBST([LIBADD_SHL_LOAD])
+
+case $host_os in
+darwin[[1567]].*)
+# We only want this for pre-Mac OS X 10.4.
+ AC_CHECK_FUNC([_dyld_func_lookup],
+ [AC_DEFINE([HAVE_DYLD], [1],
+ [Define if you have the _dyld_func_lookup function.])
+ LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"])
+ ;;
+beos*)
+ LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la"
+ ;;
+cygwin* | mingw* | os2* | pw32*)
+ AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include <sys/cygwin.h>]])
+ LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la"
+ ;;
+esac
+
+AC_CHECK_LIB([dld], [dld_link],
+ [AC_DEFINE([HAVE_DLD], [1],
+ [Define if you have the GNU dld library.])
+ LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"])
+AC_SUBST([LIBADD_DLD_LINK])
+
+m4_pattern_allow([^LT_DLPREOPEN$])
+LT_DLPREOPEN=
+if test -n "$LT_DLLOADERS"
+then
+ for lt_loader in $LT_DLLOADERS; do
+ LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader "
+ done
+ AC_DEFINE([HAVE_LIBDLLOADER], [1],
+ [Define if libdlloader will be built on this platform])
+fi
+AC_SUBST([LT_DLPREOPEN])
+
+dnl This isn't used anymore, but set it for backwards compatibility
+LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD"
+AC_SUBST([LIBADD_DL])
+
+AC_LANG_POP
+])# LT_LIB_DLLOAD
+
+# Old name:
+AU_ALIAS([AC_LTDL_DLLIB], [LT_LIB_DLLOAD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LTDL_DLLIB], [])
+
+
+# LT_SYS_SYMBOL_USCORE
+# --------------------
+# does the compiler prefix global symbols with an underscore?
+AC_DEFUN([LT_SYS_SYMBOL_USCORE],
+[m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+AC_CACHE_CHECK([for _ prefix in compiled symbols],
+ [lt_cv_sys_symbol_underscore],
+ [lt_cv_sys_symbol_underscore=no
+ cat > conftest.$ac_ext <<_LT_EOF
+void nm_test_func(){}
+int main(){nm_test_func;return 0;}
+_LT_EOF
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ ac_nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
+ # See whether the symbols have a leading underscore.
+ if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
+ lt_cv_sys_symbol_underscore=yes
+ else
+ if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
+ :
+ else
+ echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ fi
+ else
+ echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.c >&AS_MESSAGE_LOG_FD
+ fi
+ rm -rf conftest*
+ ])
+ sys_symbol_underscore=$lt_cv_sys_symbol_underscore
+ AC_SUBST([sys_symbol_underscore])
+])# LT_SYS_SYMBOL_USCORE
+
+# Old name:
+AU_ALIAS([AC_LTDL_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LTDL_SYMBOL_USCORE], [])
+
+
+# LT_FUNC_DLSYM_USCORE
+# --------------------
+AC_DEFUN([LT_FUNC_DLSYM_USCORE],
+[AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl
+if test x"$lt_cv_sys_symbol_underscore" = xyes; then
+ if test x"$libltdl_cv_func_dlopen" = xyes ||
+ test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then
+ AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
+ [libltdl_cv_need_uscore],
+ [libltdl_cv_need_uscore=unknown
+ save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBADD_DLOPEN"
+ _LT_TRY_DLOPEN_SELF(
+ [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes],
+ [], [libltdl_cv_need_uscore=cross])
+ LIBS="$save_LIBS"
+ ])
+ fi
+fi
+
+if test x"$libltdl_cv_need_uscore" = xyes; then
+ AC_DEFINE([NEED_USCORE], [1],
+ [Define if dlsym() requires a leading underscore in symbol names.])
+fi
+])# LT_FUNC_DLSYM_USCORE
+
+# Old name:
+AU_ALIAS([AC_LTDL_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], [])
+
diff --git a/distrib/sdl-1.2.15/acinclude/ltoptions.m4 b/distrib/sdl-1.2.15/acinclude/ltoptions.m4
new file mode 100644
index 0000000..d4df679
--- /dev/null
+++ b/distrib/sdl-1.2.15/acinclude/ltoptions.m4
@@ -0,0 +1,370 @@
+##############################################################################
+# 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/distrib/sdl-1.2.15/acinclude/ltsugar.m4 b/distrib/sdl-1.2.15/acinclude/ltsugar.m4
new file mode 100644
index 0000000..02a939d
--- /dev/null
+++ b/distrib/sdl-1.2.15/acinclude/ltsugar.m4
@@ -0,0 +1,125 @@
+##############################################################################
+# 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/distrib/sdl-1.2.15/acinclude/ltversion.m4 b/distrib/sdl-1.2.15/acinclude/ltversion.m4
new file mode 100644
index 0000000..83a83f2
--- /dev/null
+++ b/distrib/sdl-1.2.15/acinclude/ltversion.m4
@@ -0,0 +1,25 @@
+##############################################################################
+# 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 3012 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.2.6])
+m4_define([LT_PACKAGE_REVISION], [1.3012])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.2.6'
+macro_revision='1.3012'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
+
diff --git a/distrib/sdl-1.2.15/acinclude/lt~obsolete.m4 b/distrib/sdl-1.2.15/acinclude/lt~obsolete.m4
new file mode 100644
index 0000000..3b2acd4
--- /dev/null
+++ b/distrib/sdl-1.2.15/acinclude/lt~obsolete.m4
@@ -0,0 +1,93 @@
+##############################################################################
+# 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/distrib/sdl-1.2.15/android-configure.sh b/distrib/sdl-1.2.15/android-configure.sh
new file mode 100755
index 0000000..94ef732
--- /dev/null
+++ b/distrib/sdl-1.2.15/android-configure.sh
@@ -0,0 +1,553 @@
+#/bin/sh
+#
+# this script is used to rebuild SDL from sources in the current
+# directory. It depends on the Android emulator build scripts
+# that should normally be located in ../emulator/android/build
+# but you can also use ANDROID_QEMU_PATH in your environment
+# to point to the top of the Android emulator sources
+#
+#
+
+# first, let's see which system we're running this on
+cd `dirname $0`
+
+# try to find the Android build directory automatically
+if [ -z "$ANDROID_QEMU_PATH" ] ; then
+ if [ -f ../../android/build/common.sh ] ; then
+ ANDROID_QEMU_PATH=../..
+ else
+ echo "You must define ANDROID_QEMU_PATH in your environment to point"
+ echo "to the directory containing the Android emulator's sources."
+ exit 1
+ fi
+fi
+
+if [ ! -d $ANDROID_QEMU_PATH ] ; then
+ echo "Your ANDROID_QEMU_PATH does not point to a valid directory."
+ exit 1
+fi
+
+if [ ! -f $ANDROID_QEMU_PATH/android/build/common.sh ] ; then
+ echo "Your ANDROID_QEMU_PATH does not point to a directory that"
+ echo "contains the Android emulator build scripts."
+ exit 1
+fi
+
+# source common functions definitions
+. $ANDROID_QEMU_PATH/android/build/common.sh
+
+# Parse options
+OPTION_TRY_64=no
+OPTION_HELP=no
+OPTION_TARGETS=
+OPTION_FORCE_AUTODETECT=no
+OPTION_NO_TIGER=no
+
+if [ -z "$CC" ] ; then
+ CC=gcc
+fi
+
+for opt do
+ optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
+ case "$opt" in
+ --help|-h|-\?) OPTION_HELP=yes
+ ;;
+ --verbose)
+ if [ "$VERBOSE" = "yes" ] ; then
+ VERBOSE2=yes
+ else
+ VERBOSE=yes
+ fi
+ ;;
+ --cc=*) CC="$optarg" ; HOSTCC=$CC
+ ;;
+ --try-64) OPTION_TRY_64=yes
+ ;;
+ --prefix=*) OPTION_TARGETS="$OPTION_TARGETS $optarg"
+ ;;
+ --force-autodetect) OPTION_FORCE_AUTODETECT=yes
+ ;;
+ --no-tiger) OPTION_NO_TIGER=yes
+ ;;
+ *)
+ echo "unknown option '$opt', use --help"
+ exit 1
+ esac
+done
+
+# Print the help message
+#
+if [ "$OPTION_HELP" = "yes" ] ; then
+ cat << EOF
+
+Usage: rebuild.sh [options]
+Options: [defaults in brackets after descriptions]
+EOF
+ echo "Standard options:"
+ echo " --help print this message"
+ echo " --cc=PATH specify C compiler [$CC]"
+ echo " --try-64 try to build a 64-bit executable (may crash)"
+ echo " --verbose verbose configuration"
+ echo " --force-autodetect force feature auto-detection"
+ echo " --no-tiger do not generate Tiger-compatible binaries (OS X only)"
+ echo ""
+ exit 1
+fi
+
+# we only support generating 32-bit binaris on 64-bit systems.
+# And we may need to add a -Wa,--32 to CFLAGS to let the assembler
+# generate 32-bit binaries on Linux x86_64.
+#
+if [ "$OPTION_TRY_64" != "yes" ] ; then
+ force_32bit_binaries
+fi
+
+# default target
+if [ -z "$OPTION_TARGETS" ] ; then
+ OPTION_TARGETS=out/$OS
+fi
+
+# we can build SDL with Cygwin, so enable it
+enable_cygwin
+
+setup_toolchain
+
+###
+### Special compiler and linker flags
+###
+
+case "$OS" in
+ linux-*)
+ BUILD_CFLAGS="-D_GNU_SOURCE=1 -fvisibility=hidden -DXTHREADS -D_REENTRANT"
+ # prevent -fstack-protector or the generated binaries will not link
+ BUILD_CFLAGS="$BUILD_CFLAGS -fno-stack-protector"
+ ;;
+ darwin-*)
+ BUILD_CFLAGS="-D_GNU_SOURCE=1 -fvisibility=hidden -DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -D_THREAD_SAFE -force_cpusubtype_ALL -fpascal-strings"
+ # detect the 10.4 SDK and use it automatically
+ TIGER_SDK=/Developer/SDKs/MacOSX10.4u.sdk
+ if [ ! -d $TIGER_SDK -a $OPTION_NO_TIGER = no ] ; then
+ echo "Please install the 10.4 SDK at $TIGER_SDK to generate Tiger-compatible binaries."
+ echo "If you don't want compatibility, use --no-tiger option instead."
+ exit 1
+ fi
+ if [ -d $TIGER_SDK ] ; then
+ TIGER_OPTS="-isysroot $TIGER_SDK -mmacosx-version-min=10.4"
+ BUILD_CFLAGS="$BUILD_CFLAGS $TIGER_OPTS"
+ BUILD_LDFLAGS="$BUILD_LDFLAGS $TIGER_OPTS -Wl,-syslibroot,$(TIGER_SDK)"
+ echo "Using OS X 10.4 SDK to generate Tiger-compatible binaries."
+ else
+ echo "Warning: the generated binaries will not be compatible with Tiger."
+ fi
+ ;;
+ windows)
+ BUILD_CFLAGS="-D_GNU_SOURCE=1"
+ ;;
+ *)
+ BUILD_CFLAGS=
+esac
+
+# BUILD_CFLAGS are used to build SDL, but SDL_CFLAGS are used
+# when clients want to use its facilities
+#
+case "$HOST_OS" in
+ linux)
+ SDL_CFLAGS="-D_GNU_SOURCE=1 -D_REENTRANT"
+ SDL_STATIC_LIBS="-lm -ldl -lpthread -lrt"
+ ;;
+ darwin)
+ SDL_CFLAGS="-D_GNU_SOURCE=1 -D_THREAD_SAFE"
+ SDL_STATIC_LIBS="-Wl,-framework,OpenGL -Wl,-framework,Cocoa -Wl,-framework,QuickTime -Wl,-framework,ApplicationServices -Wl,-framework,Carbon -Wl,-framework,IOKit"
+ ;;
+ windows)
+ SDL_CFLAGS="-D_GNU_SOURCE=1 -Dmain=SDL_main"
+ SDL_STATIC_LIBS="-luser32 -lgdi32 -lwinmm"
+ ;;
+ *)
+ SDL_CFLAGS=
+ SDL_STATIC_LIBS=
+esac
+
+DOLLAR="$"
+SDL_STATIC_LIBS="$DOLLAR{libdir}/libSDLmain.a $DOLLAR{libdir}/libSDL.a $SDL_STATIC_LIBS"
+
+###
+### Features probes
+###
+
+CONFIG_LIBC=yes
+
+###
+### Configuration files generation
+###
+
+# create the objs directory that is going to contain all generated files
+# including the configuration ones
+#
+mkdir -p objs
+
+config_add ()
+{
+ echo "$1" >> $config_h
+}
+
+# used to add a macro define/undef line to the configuration
+# $1: macro name
+# $2: 1, 0, yes or no
+# $3: optional log prefix
+config_add_macro ()
+{
+ local logname
+ logname="${3:-CfgMacro }"
+ case "$2" in
+ 0|no|false)
+ config_add "/* #undef $1 */"
+ log "$logname: $1=0"
+ ;;
+ 1|yes|true)
+ config_add "#define $1 1"
+ log "$logname: $1=1"
+ ;;
+ esac
+}
+
+# used to add host-os-specific driver macros to the config file
+# $1 : driver prefix, e.g. DRIVERS_VIDEO
+# $2 : macro prefix
+# this will look for DRIVERS_VIDEO_${HOST_OS}, and, if it is not
+# defined in DRIVERS_VIDEO_default
+#
+# then this will call 'config_add ${2}_${driver}' for each driver listed
+#
+config_add_driver_macros ()
+{
+ local driver_list="`var_value ${1}_${HOST_OS}`"
+ local driver_name
+ if [ -z "$driver_list" ] ; then
+ driver_list="`var_value ${1}_default`"
+ fi
+ for driver_name in $driver_list; do
+ config_add_macro "${2}_${driver_name}" yes
+ done
+}
+
+config_h=objs/SDL_config.h
+
+# a function used to check the availability of a given Standard C header
+# $1 : header name, without the .h suffix nor enclosing brackets (e.g. 'memory' for <memory.h>)
+# this will update the configuration with a relevant line
+sdl_check_header ()
+{
+ local result
+ local header
+ local macro
+ header="<$1.h>"
+ macro=`to_uppercase $1`
+ macro=`echo $macro | tr '/' '_'`
+ feature_check_header result "$header"
+ config_add_macro HAVE_${macro}_H $result "StdCHeader "
+}
+
+# call sdl_check_header with a list of header names
+sdl_check_headers ()
+{
+ for hh in $*; do
+ sdl_check_header "$hh"
+ done
+}
+
+# a function used to check that a given function is available in the C library
+# this will update the configuration with a relevant line
+# $1: function name
+# $2: optional, libraries to link against
+#
+sdl_check_func ()
+{
+ local result
+ local funcname
+ local macro
+ funcname="$1"
+ macro=`to_uppercase $1`
+ rm -f $TMPC
+ cat > $TMPC <<EOF
+#undef $funcname
+#define $funcname _innocuous_$funcname
+#include <assert.h>
+#undef $funcname
+
+typedef void (*func_t)(void);
+extern void $funcname(void);
+func_t _dummy = $funcname;
+int main(void)
+{
+ return _dummy == $funcname;
+}
+EOF
+ EXTRA_LDFLAGS="$2"
+ feature_check_link result
+ config_add_macro HAVE_${macro} $result "StdCFunc "
+}
+
+# call sdl_check_func with a list of functions
+sdl_check_funcs ()
+{
+ for ff in $*; do
+ sdl_check_func "$ff"
+ done
+}
+
+# check endianess of the host platform
+sdl_check_endianess ()
+{
+ cat > $TMPC <<EOF
+ int main(void)
+ {
+ union {
+ unsigned short v;
+ unsigned char b[2];
+ } u;
+
+ u.v = 0x1234;
+ return (u.b[0] == 0x12);
+ }
+EOF
+ feature_run_exec test_e
+ if [ "$test_e" = "1" ] ; then
+ eval $1=4321
+ else
+ eval $1=1234
+ fi
+}
+
+
+generate_SDL_config_h ()
+{
+ echo "/* This file was autogenerated by '$PROGNAME' - do not edit */" > $config_h
+
+ config_add "#ifndef _SDL_config_h"
+ config_add "#define _SDL_config_h"
+ config_add ""
+ config_add "#include \"SDL_platform.h\""
+ config_add ""
+
+ # true for all architectures these days
+ config_add_macro SDL_HAS_64BIT_TYPE 1
+
+ sdl_check_endianess ENDIANESS
+ config_add "#define SDL_BYTEORDER $ENDIANESS"
+ config_add ""
+
+ config_add_macro HAVE_LIBC $CONFIG_LIBC
+
+ config_add "#if HAVE_LIBC"
+ config_add ""
+ config_add "/* Useful headers */"
+
+ sdl_check_headers alloca sys/types stdio
+
+ # just like configure - force it to 1
+ config_add "#define STDC_HEADERS 1"
+
+ sdl_check_headers stdlib stdarg malloc memory string strings inttypes stdint ctype math iconv signal altivec
+
+ config_add "/* C library functions */"
+
+ sdl_check_funcs malloc calloc realloc free alloc
+
+ config_add "#ifndef _WIN32 /* Don't use on Windows */"
+
+ sdl_check_funcs getenv putenv unsetenv
+
+ config_add "#endif"
+ sdl_check_funcs qsort abs bcopy memset memcpy memmove memcmp strlen strlcpy strlcat
+ sdl_check_funcs strdup _strrev _strupr _strlwr index rindex strchr strrchr itoa _ltoa
+ sdl_check_funcs _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull
+ sdl_check_funcs strtod atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp
+ sdl_check_funcs vsnprintf iconv sigaction setjmp nanosleep
+
+ sdl_check_func clock_gettime -lrt
+ sdl_check_func dlvsym -ldl
+
+ sdl_check_funcs getpagesize
+
+ config_add "#else"
+ config_add "/* We may need some replacement for stdarg.h here */"
+ config_add "#include <stdarg.h>"
+ config_add "#endif /* HAVE_LIBC */"
+ config_add ""
+
+ config_add "/* Allow disabling of core subsystems */"
+
+ config_add_macro SDL_AUDIO_DISABLED yes
+ config_add_macro SDL_CDROM_DISABLED yes
+ config_add_macro SDL_CPUINFO_DISABLED no
+ config_add_macro SDL_EVENTS_DISABLED no
+ config_add_macro SDL_FILE_DISABLED yes
+ config_add_macro SDL_JOYSTICK_DISABLED yes
+ config_add_macro SDL_LOADSO_DISABLED no
+ config_add_macro SDL_THREADS_DISABLED no
+ config_add_macro SDL_TIMERS_DISABLED no
+ config_add_macro SDL_VIDEO_DISABLED no
+
+ config_add ""
+ config_add "/* Enable various shared object loading systems */"
+
+ config_add_driver_macros DRIVERS_LOADSO SDL_LOADSO
+
+ config_add ""
+ config_add "/* Enable various threading systems */"
+
+ config_add_driver_macros DRIVERS_THREAD SDL_THREAD
+
+ config_add ""
+ config_add "/* Enable various timer systems */"
+
+ config_add_driver_macros DRIVERS_TIMER SDL_TIMER
+
+ config_add ""
+ config_add "/* Enable various video drivers */"
+
+ config_add_driver_macros DRIVERS_VIDEO SDL_VIDEO_DRIVER
+
+ config_add_driver_macros DRIVERS_MAIN SDL_MAIN
+
+ # the following defines are good enough for all recent Unix distributions
+ config_add "#define SDL_VIDEO_DRIVER_X11_DYNAMIC \"libX11.so.6\""
+ config_add "#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT \"libXext.so.6\""
+ config_add "#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR \"libXrandr.so.2\""
+ config_add "#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER \"libXrender.so.1\""
+
+ # todo: OpenGL support ?
+ # todo: Assembly routines support ?
+
+ config_add "#endif /* _SDL_config_h */"
+}
+
+### Build the config sub-makefile
+###
+
+make_add ()
+{
+ echo "$1" >> $config_mk
+}
+
+make_add_driver_macros ()
+{
+ local driver_list="`var_value ${1}_${HOST_OS}`"
+ local driver_name
+ if [ -z "$driver_list" ] ; then
+ driver_list="`var_value ${1}_default`"
+ fi
+ for driver_name in $driver_list; do
+ make_add "SDL_$2_${driver_name} := yes"
+ done
+}
+
+generate_sdl_config_mk ()
+{
+ CFLAGS="$CFLAGS $BUILD_CFLAGS"
+ LDFLAGS="$LDFLAGS $BUILD_LDFLAGS"
+ create_config_mk
+
+ make_add ""
+ PWD=`pwd`
+ make_add "SRC_PATH=$PWD"
+ make_add "BUILD_SYSTEM=$ANDROID_QEMU_PATH/android/build"
+
+ make_add "SDL_CONFIG_LIBC := $CONFIG_LIBC"
+ make_add "SDL_CONFIG_CPUINFO := yes"
+
+ make_add_driver_macros DRIVERS_LOADSO CONFIG_LOADSO
+ make_add_driver_macros DRIVERS_THREAD CONFIG_THREAD
+ make_add_driver_macros DRIVERS_TIMER CONFIG_TIMER
+ make_add_driver_macros DRIVERS_VIDEO CONFIG_VIDEO
+
+ make_add_driver_macros DRIVERS_MAIN CONFIG_MAIN
+
+ make_add "INSTALL_TARGETS := $OPTION_TARGETS"
+}
+
+### Build the final sdl-config script from the template
+###
+
+generate_sdl_config ()
+{
+ # build a sed script that will replace all @VARIABLES@ in the template
+ # with appropriate values
+ rm -f $TMPC
+
+ # replace @exec_prefix@ with "{prefix}", and @libdir@ with "{libdir}"
+ cat > $TMPC <<EOF
+s!@exec_prefix@!\$\{prefix\}!g
+s!@libdir@!\$\{exec_prefix\}/libs!g
+s!@includedir@!\$\{prefix\}/include!g
+EOF
+
+ # we want to enable static linking, do @ENABLE_STATIC_FALSE@ and @ENABLE_STATIC_TRUE@
+ cat >> $TMPC <<EOF
+s!@ENABLE_STATIC_FALSE@!\#!g
+s!@ENABLE_STATIC_TRUE@!!g
+s!@ENABLE_SHARED_TRUE@!\#!g
+s!@ENABLE_SHARED_FALSE@!!g
+EOF
+
+ # set the version to 1.2.15
+ cat >> $TMPC <<EOF
+s!@SDL_VERSION@!1.2.15!g
+EOF
+
+ #
+ cat >> $TMPC <<EOF
+s!@SDL_CFLAGS@!$SDL_CFLAGS!g
+s!@SDL_STATIC_LIBS@!$SDL_STATIC_LIBS!g
+EOF
+
+ cat sdl-config.in | sed -f $TMPC > objs/sdl-config
+ chmod +x objs/sdl-config
+}
+
+# copy a configuration file or perform auto-detection if one is not available
+# or the --force-autodetect option was used
+# $1: basename of config file
+# $2: command to run to perform auto-detection/generation
+#
+copy_or_autodetect ()
+{
+ if [ "$OPTION_FORCE_AUTODETECT" != "yes" -a -f android/build/$OS/$1 ] ; then
+ log "Setup : Copying $1 from android/build/$OS"
+ cp -f android/build/$OS/$1 objs/$1
+ else
+ log "Setup : Auto-generating $1"
+ eval $2
+ fi
+}
+
+generate_all ()
+{
+ copy_or_autodetect SDL_config.h generate_SDL_config_h
+ generate_sdl_config_mk
+ copy_or_autodetect sdl-config generate_sdl_config
+}
+
+DRIVERS_LOADSO_default=DLOPEN
+DRIVERS_LOADSO_darwin=DLCOMPAT
+DRIVERS_LOADSO_windows=WIN32
+
+# TODO: determine if PTHREAD_RECURSIVE or PTHREAD_RECURSIVE_NP is valid for the platform
+DRIVERS_THREAD_default="PTHREAD PTHREAD_RECURSIVE_MUTEX"
+DRIVERS_THREAD_linux="PTHREAD PTHREAD_RECURSIVE_MUTEX_NP"
+DRIVERS_THREAD_windows=WIN32
+
+DRIVERS_TIMER_default=UNIX
+DRIVERS_TIMER_windows=WIN32
+
+# TODO: actually compute this properly for X11 and dynamic loading !!
+DRIVERS_VIDEO_default="X11 X11_DPMS X11_XINERAMA X11_XME"
+DRIVERS_VIDEO_darwin="QUARTZ"
+DRIVERS_VIDEO_windows="WINDIB"
+
+DRIVERS_MAIN_default=DUMMY
+DRIVERS_MAIN_darwin=MACOSX
+DRIVERS_MAIN_windows=WIN32
+
+generate_all
diff --git a/distrib/sdl-1.2.15/autogen.sh b/distrib/sdl-1.2.15/autogen.sh
new file mode 100755
index 0000000..649d7b3
--- /dev/null
+++ b/distrib/sdl-1.2.15/autogen.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+echo "Generating build information using autoconf"
+echo "This may take a while ..."
+
+# Regenerate configuration files
+cat acinclude/* >aclocal.m4
+found=false
+for autoconf in autoconf autoconf259 autoconf-2.59
+do if which $autoconf >/dev/null 2>&1; then $autoconf && found=true; break; fi
+done
+if test x$found = xfalse; then
+ echo "Couldn't find autoconf, aborting"
+ exit 1
+fi
+(cd test; sh autogen.sh)
+
+# Run configure for this platform
+echo "Now you are ready to run ./configure"
diff --git a/distrib/sdl-1.2.15/build-scripts/config.guess b/distrib/sdl-1.2.15/build-scripts/config.guess
new file mode 100755
index 0000000..e792aac
--- /dev/null
+++ b/distrib/sdl-1.2.15/build-scripts/config.guess
@@ -0,0 +1,1494 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+# Free Software Foundation, Inc.
+
+timestamp='2009-09-18'
+
+# 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 <config-patches@gnu.org> 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 <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+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: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 <stdio.h> /* 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 <sys/systemcfg.h>
+
+ 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 <stdlib.h>
+ #include <unistd.h>
+
+ 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 <unistd.h>
+ 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*:[3456]*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ EM64T | authenticamd | genuineintel)
+ 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:*:*)
+ echo ${UNAME_MACHINE}-pc-linux-gnu
+ 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 | sed -n '
+ /^CPU/{
+ s: ::g
+ p
+ }'`"
+ 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' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/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 <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # 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 <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#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 <sys/param.h>
+ 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 <sys/param.h>
+# 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 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> 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/distrib/sdl-1.2.15/build-scripts/config.sub b/distrib/sdl-1.2.15/build-scripts/config.sub
new file mode 100755
index 0000000..5ecc18b
--- /dev/null
+++ b/distrib/sdl-1.2.15/build-scripts/config.sub
@@ -0,0 +1,1700 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+# Free Software Foundation, Inc.
+
+timestamp='2009-10-07'
+
+# 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 <config-patches@gnu.org>. 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 <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+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 \
+ | 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-* \
+ | tron-* \
+ | 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
+ ;;
+ 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.
+ -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* | -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
+ ;;
+ -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/distrib/sdl-1.2.15/build-scripts/fatbuild.sh b/distrib/sdl-1.2.15/build-scripts/fatbuild.sh
new file mode 100755
index 0000000..8b99c1d
--- /dev/null
+++ b/distrib/sdl-1.2.15/build-scripts/fatbuild.sh
@@ -0,0 +1,310 @@
+#!/bin/sh
+#
+# Build a fat binary on Mac OS X, thanks Ryan!
+
+# Number of CPUs (for make -j)
+NCPU=`sysctl -n hw.ncpu`
+if test x$NJOB = x; then
+ NJOB=$NCPU
+fi
+
+# SDK path
+if test x$SDK_PATH = x; then
+ SDK_PATH=/Developer/SDKs
+fi
+
+# Generic, cross-platform CFLAGS you always want go here.
+CFLAGS="-O3 -g -pipe"
+
+# We dynamically load X11, so using the system X11 headers is fine.
+BASE_CONFIG_FLAGS="--build=`uname -p`-apple-darwin \
+--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib"
+
+# PowerPC 32-bit compiler flags
+CONFIG_PPC="--host=powerpc-apple-darwin"
+CC_PPC="gcc-4.0"
+CXX_PPC="g++-4.0"
+BUILD_FLAGS_PPC="-arch ppc -mmacosx-version-min=10.4"
+
+# Intel 32-bit compiler flags
+CONFIG_X86="--host=i386-apple-darwin"
+CC_X86="gcc"
+CXX_X86="g++"
+BUILD_FLAGS_X86="-arch i386 -mmacosx-version-min=10.4"
+
+# Intel 64-bit compiler flags
+CONFIG_X64="--host=x86_64-apple-darwin"
+CC_X64="gcc"
+CXX_X64="g++"
+BUILD_FLAGS_X64="-arch x86_64 -mmacosx-version-min=10.6"
+
+#
+# Find the configure script
+#
+srcdir=`dirname $0`/..
+auxdir=$srcdir/build-scripts
+cd $srcdir
+
+allow_ppc="yes"
+which gcc-4.0 >/dev/null 2>/dev/null
+if [ "x$?" = "x1" ]; then
+ #echo "WARNING: Can't find gcc-4.0, which means you don't have Xcode 3."
+ #echo "WARNING: Therefore, we can't do PowerPC support."
+ allow_ppc="no"
+fi
+
+#
+# Figure out which phase to build:
+# all,
+# configure, configure-ppc, configure-x86, configure-x64
+# make, make-ppc, make-x86, make-x64, merge
+# install
+# clean
+if test x"$1" = x; then
+ phase=all
+else
+ phase="$1"
+fi
+case $phase in
+ all)
+ configure_ppc="$allow_ppc"
+ configure_x86="yes"
+ configure_x64="yes"
+ make_ppc="$allow_ppc"
+ make_x86="yes"
+ make_x64="yes"
+ merge="yes"
+ ;;
+ configure)
+ configure_ppc="$allow_ppc"
+ configure_x86="yes"
+ configure_x64="yes"
+ ;;
+ configure-ppc)
+ configure_ppc="$allow_ppc"
+ ;;
+ configure-x86)
+ configure_x86="yes"
+ ;;
+ configure-x64)
+ configure_x64="yes"
+ ;;
+ make)
+ make_ppc="$allow_ppc"
+ make_x86="yes"
+ make_x64="yes"
+ merge="yes"
+ ;;
+ make-ppc)
+ make_ppc="$allow_ppc"
+ ;;
+ make-x86)
+ make_x86="yes"
+ ;;
+ make-x64)
+ make_x64="yes"
+ ;;
+ merge)
+ merge="yes"
+ ;;
+ install)
+ install_bin="yes"
+ install_hdrs="yes"
+ install_lib="yes"
+ install_data="yes"
+ install_man="yes"
+ ;;
+ install-bin)
+ install_bin="yes"
+ ;;
+ install-hdrs)
+ install_hdrs="yes"
+ ;;
+ install-lib)
+ install_lib="yes"
+ ;;
+ install-data)
+ install_data="yes"
+ ;;
+ install-man)
+ install_man="yes"
+ ;;
+ clean)
+ clean_ppc="yes"
+ clean_x86="yes"
+ clean_x64="yes"
+ ;;
+ clean-ppc)
+ clean_ppc="yes"
+ ;;
+ clean-x86)
+ clean_x86="yes"
+ ;;
+ clean-x64)
+ clean_x64="yes"
+ ;;
+ *)
+ echo "Usage: $0 [all|configure[-ppc|-x86|-x64]|make[-ppc|-x86|-x64]|merge|install|clean[-ppc|-x86|-x64]]"
+ exit 1
+ ;;
+esac
+case `uname -p` in
+ *86)
+ native_path=x86
+ ;;
+ *powerpc)
+ native_path=ppc
+ ;;
+ x86_64)
+ native_path=x64
+ ;;
+ *)
+ echo "Couldn't figure out native architecture path"
+ exit 1
+ ;;
+esac
+
+#
+# Create the build directories
+#
+for dir in build build/ppc build/x86 build/x64; do
+ if test -d $dir; then
+ :
+ else
+ mkdir $dir || exit 1
+ fi
+done
+
+
+#
+# Build the PowerPC 32-bit binary
+#
+if test x$configure_ppc = xyes; then
+ (cd build/ppc && \
+ sh ../../configure $BASE_CONFIG_FLAGS $CONFIG_PPC CC="$CC_PPC" CXX="$CXX_PPC" CFLAGS="$CFLAGS $BUILD_FLAGS_PPC $CFLAGS_PPC" LDFLAGS="$BUILD_FLAGS_PPC $LFLAGS_PPC") || exit 2
+fi
+if test x$make_ppc = xyes; then
+ (cd build/ppc && make -j$NJOB) || exit 3
+fi
+#
+# Build the Intel 32-bit binary
+#
+if test x$configure_x86 = xyes; then
+ (cd build/x86 && \
+ sh ../../configure $BASE_CONFIG_FLAGS $CONFIG_X86 CC="$CC_X86" CXX="$CXX_X86" CFLAGS="$CFLAGS $BUILD_FLAGS_X86 $CFLAGS_X86" LDFLAGS="$BUILD_FLAGS_X86 $LFLAGS_X86") || exit 2
+fi
+if test x$make_x86 = xyes; then
+ (cd build/x86 && make -j$NJOB) || exit 3
+fi
+
+#
+# Build the Intel 64-bit binary
+#
+if test x$configure_x64 = xyes; then
+ (cd build/x64 && \
+ sh ../../configure $BASE_CONFIG_FLAGS $CONFIG_X64 CC="$CC_X64" CXX="$CXX_X64" CFLAGS="$CFLAGS $BUILD_FLAGS_X64 $CFLAGS_X64" LDFLAGS="$BUILD_FLAGS_X64 $LFLAGS_X64") || exit 2
+fi
+if test x$make_x64 = xyes; then
+ (cd build/x64 && make -j$NJOB) || exit 3
+fi
+
+#
+# Combine into fat binary
+#
+if test x$merge = xyes; then
+ output=.libs
+ sh $auxdir/mkinstalldirs build/$output
+ cd build
+ target=`find . -mindepth 4 -maxdepth 4 -type f -name '*.dylib' | head -1 | sed 's|.*/||'`
+ (lipo -create -o $output/$target `find . -mindepth 4 -maxdepth 4 -type f -name "*.dylib"` &&
+ ln -sf $target $output/libSDL.dylib &&
+ lipo -create -o $output/libSDL.a */build/.libs/libSDL.a &&
+ cp $native_path/build/.libs/libSDL.la $output &&
+ cp $native_path/build/.libs/libSDL.lai $output &&
+ cp $native_path/build/libSDL.la . &&
+ lipo -create -o $output/libSDLmain.a */build/.libs/libSDLmain.a &&
+ cp $native_path/build/.libs/libSDLmain.la $output &&
+ cp $native_path/build/.libs/libSDLmain.lai $output &&
+ cp $native_path/build/libSDLmain.la . &&
+ echo "Build complete!" &&
+ echo "Files can be found in the build directory.") || exit 4
+ cd ..
+fi
+
+#
+# Install
+#
+do_install()
+{
+ echo $*
+ $* || exit 5
+}
+if test x$prefix = x; then
+ prefix=/usr/local
+fi
+if test x$exec_prefix = x; then
+ exec_prefix=$prefix
+fi
+if test x$bindir = x; then
+ bindir=$exec_prefix/bin
+fi
+if test x$libdir = x; then
+ libdir=$exec_prefix/lib
+fi
+if test x$includedir = x; then
+ includedir=$prefix/include
+fi
+if test x$datadir = x; then
+ datadir=$prefix/share
+fi
+if test x$mandir = x; then
+ mandir=$prefix/man
+fi
+if test x$install_bin = xyes; then
+ do_install sh $auxdir/mkinstalldirs $bindir
+ do_install /usr/bin/install -c -m 755 build/$native_path/sdl-config $bindir/sdl-config
+fi
+if test x$install_hdrs = xyes; then
+ do_install sh $auxdir/mkinstalldirs $includedir/SDL
+ for src in $srcdir/include/*.h; do \
+ file=`echo $src | sed -e 's|^.*/||'`; \
+ do_install /usr/bin/install -c -m 644 $src $includedir/SDL/$file; \
+ done
+ do_install /usr/bin/install -c -m 644 $srcdir/include/SDL_config_macosx.h $includedir/SDL/SDL_config.h
+fi
+if test x$install_lib = xyes; then
+ do_install sh $auxdir/mkinstalldirs $libdir
+ do_install sh build/$native_path/libtool --mode=install /usr/bin/install -c build/libSDL.la $libdir/libSDL.la
+ do_install sh build/$native_path/libtool --mode=install /usr/bin/install -c build/libSDLmain.la $libdir/libSDLmain.la
+fi
+if test x$install_data = xyes; then
+ do_install sh $auxdir/mkinstalldirs $datadir/aclocal
+ do_install /usr/bin/install -c -m 644 $srcdir/sdl.m4 $datadir/aclocal/sdl.m4
+ do_install sh $auxdir/mkinstalldirs $libdir/pkgconfig
+ do_install /usr/bin/install -m 644 build/$native_path/sdl.pc $libdir/pkgconfig/sdl.pc
+fi
+if test x$install_man = xyes; then
+ do_install sh $auxdir/mkinstalldirs $mandir/man3
+ for src in $srcdir/docs/man3/*.3; do \
+ file=`echo $src | sed -e 's|^.*/||'`; \
+ do_install /usr/bin/install -c -m 644 $src $mandir/man3/$file; \
+ done
+fi
+
+#
+# Clean up
+#
+do_clean()
+{
+ echo $*
+ $* || exit 6
+}
+if test x$clean_ppc = xyes; then
+ do_clean rm -r build/ppc
+fi
+if test x$clean_x86 = xyes; then
+ do_clean rm -r build/x86
+fi
+if test x$clean_x64 = xyes; then
+ do_clean rm -r build/x64
+fi
diff --git a/distrib/sdl-1.2.15/build-scripts/install-sh b/distrib/sdl-1.2.15/build-scripts/install-sh
new file mode 100755
index 0000000..1a83534
--- /dev/null
+++ b/distrib/sdl-1.2.15/build-scripts/install-sh
@@ -0,0 +1,323 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2005-02-02.21
+
+# 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. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+chmodcmd="$chmodprog 0755"
+chowncmd=
+chgrpcmd=
+stripcmd=
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=
+dst=
+dir_arg=
+dstarg=
+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:
+-c (ignored)
+-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.
+--help display this help and exit.
+--version display version info and exit.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test -n "$1"; do
+ case $1 in
+ -c) shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd=$stripprog
+ shift
+ continue;;
+
+ -t) dstarg=$2
+ shift
+ shift
+ continue;;
+
+ -T) no_target_directory=true
+ shift
+ continue;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ *) # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ test -n "$dir_arg$dstarg" && break
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dstarg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dstarg"
+ shift # fnord
+ fi
+ shift # arg
+ dstarg=$arg
+ done
+ break;;
+ esac
+done
+
+if test -z "$1"; 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
+
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src ;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ src=
+
+ if test -d "$dst"; then
+ mkdircmd=:
+ chmodcmd=
+ else
+ mkdircmd=$mkdirprog
+ fi
+ 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 "$dstarg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dstarg
+ # 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: $dstarg: Is a directory" >&2
+ exit 1
+ fi
+ dst=$dst/`basename "$src"`
+ fi
+ fi
+
+ # This sed command emulates the dirname command.
+ dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
+
+ # Make sure that the destination directory exists.
+
+ # Skip lots of stat calls in the usual case.
+ if test ! -d "$dstdir"; then
+ defaultIFS='
+ '
+ IFS="${IFS-$defaultIFS}"
+
+ oIFS=$IFS
+ # Some sh's can't handle IFS=/ for some reason.
+ IFS='%'
+ set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+ shift
+ IFS=$oIFS
+
+ pathcomp=
+
+ while test $# -ne 0 ; do
+ pathcomp=$pathcomp$1
+ shift
+ if test ! -d "$pathcomp"; then
+ $mkdirprog "$pathcomp"
+ # mkdir can fail with a `File exist' error in case several
+ # install-sh are creating the directory concurrently. This
+ # is OK.
+ test -d "$pathcomp" || exit
+ fi
+ pathcomp=$pathcomp/
+ done
+ fi
+
+ if test -n "$dir_arg"; then
+ $doit $mkdircmd "$dst" \
+ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
+
+ else
+ dstfile=`basename "$dst"`
+
+ # 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
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Copy the file name to the temp name.
+ $doit $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 "$dsttmp"; } &&
+
+ # Now rename the file to the real destination.
+ { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 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.
+ {
+ if test -f "$dstdir/$dstfile"; then
+ $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+ || {
+ echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+ (exit 1); exit 1
+ }
+ else
+ :
+ fi
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+ }
+ }
+ fi || { (exit 1); exit 1; }
+done
+
+# The final little trick to "correctly" pass the exit status to the exit trap.
+{
+ (exit 0); 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-end: "$"
+# End:
diff --git a/distrib/sdl-1.2.15/build-scripts/ltmain.sh b/distrib/sdl-1.2.15/build-scripts/ltmain.sh
new file mode 100644
index 0000000..5e04f08
--- /dev/null
+++ b/distrib/sdl-1.2.15/build-scripts/ltmain.sh
@@ -0,0 +1,8407 @@
+# Generated from ltmain.m4sh.
+
+# ltmain.sh (GNU libtool) 2.2.6
+# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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.6
+# automake: $automake_version
+# autoconf: $autoconf_version
+#
+# Report bugs to <bug-libtool@gnu.org>.
+
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=2.2.6
+TIMESTAMP=""
+package_revision=1.3012
+
+# 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="/usr/bin/grep -E"}
+: ${FGREP="/usr/bin/grep -F"}
+: ${GREP="/usr/bin/grep"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SED="/opt/local/bin/gsed"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# 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 <<EOF
+$*
+EOF
+ exit $EXIT_SUCCESS
+fi
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+# $mode is unset
+nonopt=
+execute_dlfiles=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+opt_dry_run=false
+opt_duplicate_deps=false
+opt_silent=false
+opt_debug=:
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end. This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+ func_error ${1+"$@"}
+ func_error "See the $PACKAGE documentation for more information."
+ func_fatal_error "Fatal configuration error."
+}
+
+
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+ re_begincf='^# ### BEGIN LIBTOOL'
+ re_endcf='^# ### END LIBTOOL'
+
+ # Default configuration.
+ $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+ done
+
+ exit $?
+}
+
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+ $ECHO "host: $host"
+ if test "$build_libtool_libs" = yes; then
+ $ECHO "enable shared libraries"
+ else
+ $ECHO "disable shared libraries"
+ fi
+ if test "$build_old_libs" = yes; then
+ $ECHO "enable static libraries"
+ else
+ $ECHO "disable static libraries"
+ fi
+
+ exit $?
+}
+
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+ # Global variable:
+ tagname="$1"
+
+ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+ sed_extractcf="/$re_begincf/,/$re_endcf/p"
+
+ # Validate tagname.
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ func_fatal_error "invalid tag name: $tagname"
+ ;;
+ esac
+
+ # Don't test for the "default" C tag, as we know it's
+ # there but not specially marked.
+ case $tagname in
+ CC) ;;
+ *)
+ if $GREP "$re_begincf" "$progpath" >/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 <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+ $MV "${write_libobj}T" "${write_libobj}"
+ }
+}
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+ $opt_debug
+ # Get the compilation command and the source file.
+ base_compile=
+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
+ suppress_opt=yes
+ suppress_output=
+ arg_mode=normal
+ libobj=
+ later=
+ pie_flag=
+
+ for arg
+ do
+ case $arg_mode in
+ arg )
+ # do not "continue". Instead, add this to base_compile
+ lastarg="$arg"
+ arg_mode=normal
+ ;;
+
+ target )
+ libobj="$arg"
+ arg_mode=normal
+ continue
+ ;;
+
+ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+ test -n "$libobj" && \
+ func_fatal_error "you cannot specify \`-o' more than once"
+ arg_mode=target
+ continue
+ ;;
+
+ -pie | -fpie | -fPIE)
+ pie_flag="$pie_flag $arg"
+ continue
+ ;;
+
+ -shared | -static | -prefer-pic | -prefer-non-pic)
+ later="$later $arg"
+ continue
+ ;;
+
+ -no-suppress)
+ suppress_opt=no
+ continue
+ ;;
+
+ -Xcompiler)
+ arg_mode=arg # the next one goes into the "base_compile" arg list
+ continue # The current "srcfile" will either be retained or
+ ;; # replaced later. I would guess that would be a bug.
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ lastarg=
+ save_ifs="$IFS"; IFS=','
+ for arg in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$arg"
+ lastarg="$lastarg $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$lastarg"
+ lastarg=$func_stripname_result
+
+ # Add the arguments to base_compile.
+ base_compile="$base_compile $lastarg"
+ continue
+ ;;
+
+ *)
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg="$srcfile"
+ srcfile="$arg"
+ ;;
+ esac # case $arg
+ ;;
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ func_quote_for_eval "$lastarg"
+ base_compile="$base_compile $func_quote_for_eval_result"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ func_fatal_error "you must specify an argument for -Xcompile"
+ ;;
+ target)
+ func_fatal_error "you must specify a target with \`-o'"
+ ;;
+ *)
+ # Get the name of the library object.
+ test -z "$libobj" && {
+ func_basename "$srcfile"
+ libobj="$func_basename_result"
+ }
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ case $libobj in
+ *.[cCFSifmso] | \
+ *.ada | *.adb | *.ads | *.asm | \
+ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+ *.[fF][09]? | *.for | *.java | *.obj | *.sx)
+ func_xform "$libobj"
+ libobj=$func_xform_result
+ ;;
+ esac
+
+ case $libobj in
+ *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+ *)
+ func_fatal_error "cannot determine name of library object from \`$libobj'"
+ ;;
+ esac
+
+ func_infer_tag $base_compile
+
+ for arg in $later; do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ continue
+ ;;
+
+ -static)
+ build_libtool_libs=no
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+ esac
+ done
+
+ func_quote_for_eval "$libobj"
+ test "X$libobj" != "X$func_quote_for_eval_result" \
+ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
+ && 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 >/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 (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/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 <<EOF
+
+/* $cwrappersource - temporary wrapper executable 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 executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+
+ Currently, it simply execs the wrapper *script* "$SHELL $output",
+ but could eventually absorb all of the scripts functionality and
+ exec $objdir/$outputname directly.
+*/
+EOF
+ cat <<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+# define setmode _setmode
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+# include <io.h>
+# 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 <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+#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 <<EOF
+
+static const char *script_text_part2 =
+EOF
+ func_emit_wrapper_part2 yes |
+ $SED -e 's/\([\\"]\)/\\\1/g' \
+ -e 's/^/ "/' -e 's/$/\\n"/'
+ echo ";"
+
+ cat <<EOF
+const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ func_to_host_pathlist "$temp_rpath"
+ cat <<EOF
+const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
+EOF
+ else
+ cat <<"EOF"
+const char * LIB_PATH_VALUE = "";
+EOF
+ fi
+
+ if test -n "$dllsearchpath"; then
+ func_to_host_pathlist "$dllsearchpath:"
+ cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
+EOF
+ else
+ cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE = "";
+EOF
+ fi
+
+ if test "$fast_install" = yes; then
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+ else
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+ fi
+
+
+ cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX "--lt-"
+#define LTWRAPPER_OPTION_PREFIX_LENGTH 5
+
+static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH;
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+
+static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
+
+static const size_t env_set_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
+static const char *env_set_opt = LTWRAPPER_OPTION_PREFIX "env-set";
+ /* argument is putenv-style "foo=bar", value of foo is set to bar */
+
+static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
+static const char *env_prepend_opt = LTWRAPPER_OPTION_PREFIX "env-prepend";
+ /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
+
+static const size_t env_append_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
+static const char *env_append_opt = LTWRAPPER_OPTION_PREFIX "env-append";
+ /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
+
+#undef main
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int newargc;
+ char *tmp_pathspec;
+ char *actual_cwrapper_path;
+ char *actual_cwrapper_name;
+ char *target_name;
+ char *lt_argv_zero;
+ intptr_t rval = 127;
+
+ int i;
+
+ program_name = (char *) xstrdup (base_name (argv[0]));
+ LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0]));
+ LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
+
+ /* very simple arg parsing; don't want to rely on getopt */
+ for (i = 1; i < argc; i++)
+ {
+ if (strcmp (argv[i], dumpscript_opt) == 0)
+ {
+EOF
+ case "$host" in
+ *mingw* | *cygwin* )
+ # make stdout use "unix" line endings
+ echo " setmode(1,_O_BINARY);"
+ ;;
+ esac
+
+ cat <<"EOF"
+ printf ("%s", script_text_part1);
+ printf ("%s", script_text_part2);
+ return 0;
+ }
+ }
+
+ newargz = XMALLOC (char *, argc + 1);
+ tmp_pathspec = find_executable (argv[0]);
+ if (tmp_pathspec == NULL)
+ lt_fatal ("Couldn't find %s", argv[0]);
+ LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
+ tmp_pathspec));
+
+ actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+ LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
+ actual_cwrapper_path));
+ XFREE (tmp_pathspec);
+
+ actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
+ strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+ /* wrapper name transforms */
+ strendzap (actual_cwrapper_name, ".exe");
+ tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+ XFREE (actual_cwrapper_name);
+ actual_cwrapper_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ /* target_name transforms -- use actual target program name; might have lt- prefix */
+ target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+ strendzap (target_name, ".exe");
+ tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+ XFREE (target_name);
+ target_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
+ target_name));
+EOF
+
+ cat <<EOF
+ newargz[0] =
+ XMALLOC (char, (strlen (actual_cwrapper_path) +
+ strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+ strcpy (newargz[0], actual_cwrapper_path);
+ strcat (newargz[0], "$objdir");
+ strcat (newargz[0], "/");
+EOF
+
+ cat <<"EOF"
+ /* stop here, and copy so we don't have to do this twice */
+ tmp_pathspec = xstrdup (newargz[0]);
+
+ /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+ strcat (newargz[0], actual_cwrapper_name);
+
+ /* DO want the lt- prefix here if it exists, so use target_name */
+ lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+ XFREE (tmp_pathspec);
+ tmp_pathspec = NULL;
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ {
+ char* p;
+ while ((p = strchr (newargz[0], '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ }
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+ XFREE (target_name);
+ XFREE (actual_cwrapper_path);
+ XFREE (actual_cwrapper_name);
+
+ lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+ lt_setenv ("DUALCASE", "1"); /* for MSK sh */
+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+ lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+
+ newargc=0;
+ for (i = 1; i < argc; i++)
+ {
+ if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
+ {
+ if (argv[i][env_set_opt_len] == '=')
+ {
+ const char *p = argv[i] + env_set_opt_len + 1;
+ lt_opt_process_env_set (p);
+ }
+ else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
+ {
+ lt_opt_process_env_set (argv[++i]); /* don't copy */
+ }
+ else
+ lt_fatal ("%s missing required argument", env_set_opt);
+ continue;
+ }
+ if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
+ {
+ if (argv[i][env_prepend_opt_len] == '=')
+ {
+ const char *p = argv[i] + env_prepend_opt_len + 1;
+ lt_opt_process_env_prepend (p);
+ }
+ else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
+ {
+ lt_opt_process_env_prepend (argv[++i]); /* don't copy */
+ }
+ else
+ lt_fatal ("%s missing required argument", env_prepend_opt);
+ continue;
+ }
+ if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
+ {
+ if (argv[i][env_append_opt_len] == '=')
+ {
+ const char *p = argv[i] + env_append_opt_len + 1;
+ lt_opt_process_env_append (p);
+ }
+ else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
+ {
+ lt_opt_process_env_append (argv[++i]); /* don't copy */
+ }
+ else
+ lt_fatal ("%s missing required argument", env_append_opt);
+ continue;
+ }
+ if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
+ {
+ /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+ namespace, but it is not one of the ones we know about and
+ have already dealt with, above (inluding dump-script), then
+ report an error. Otherwise, targets might begin to believe
+ they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+ namespace. The first time any user complains about this, we'll
+ need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+ or a configure.ac-settable value.
+ */
+ lt_fatal ("Unrecognized option in %s namespace: '%s'",
+ ltwrapper_option_prefix, argv[i]);
+ }
+ /* otherwise ... */
+ newargz[++newargc] = xstrdup (argv[i]);
+ }
+ newargz[++newargc] = NULL;
+
+ LTWRAPPER_DEBUGPRINTF (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
+ for (i = 0; i < newargc; i++)
+ {
+ LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
+ }
+
+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 : "<NULL>"),
+ (value ? value : "<NULL>")));
+ {
+#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 : "<NULL>"),
+ (value ? value : "<NULL>")));
+
+ 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 : "<NULL>"),
+ (value ? value : "<NULL>")));
+
+ 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 <<EOF
+ int main() { return 0; }
+EOF
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which I believe you do not have"
+ $ECHO "*** because a test_compile did reveal that the linker did not use it for"
+ $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ fi
+ ;;
+ *)
+ newdeplibs="$newdeplibs $i"
+ ;;
+ esac
+ done
+ else
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+ ldd_output=`ldd conftest`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which you do not appear to have"
+ $ECHO "*** because a test_compile did reveal that the linker did not use this one"
+ $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ fi
+ else
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
+ $ECHO "*** make it link in! You will probably need to install it or some"
+ $ECHO "*** library that it depends on before this library will be fully"
+ $ECHO "*** functional. Installing it before continuing would be even better."
+ fi
+ ;;
+ *)
+ newdeplibs="$newdeplibs $i"
+ ;;
+ esac
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method; shift
+ file_magic_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
+ # 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/distrib/sdl-1.2.15/build-scripts/makedep.sh b/distrib/sdl-1.2.15/build-scripts/makedep.sh
new file mode 100755
index 0000000..3b3863b
--- /dev/null
+++ b/distrib/sdl-1.2.15/build-scripts/makedep.sh
@@ -0,0 +1,93 @@
+#!/bin/sh
+#
+# Generate dependencies from a list of source files
+
+# Check to make sure our environment variables are set
+if test x"$INCLUDE" = x -o x"$SOURCES" = x -o x"$output" = x; then
+ echo "SOURCES, INCLUDE, and output needs to be set"
+ exit 1
+fi
+cache_prefix=".#$$"
+
+generate_var()
+{
+ echo $1 | sed -e 's|^.*/||' -e 's|\.|_|g'
+}
+
+search_deps()
+{
+ base=`echo $1 | sed 's|/[^/]*$||'`
+ grep '#include "' <$1 | sed -e 's|.*"\([^"]*\)".*|\1|' | \
+ while read file
+ do cache=${cache_prefix}_`generate_var $file`
+ if test -f $cache; then
+ : # We already ahve this cached
+ else
+ : >$cache
+ for path in $base `echo $INCLUDE | sed 's|-I||g'`
+ do dep="$path/$file"
+ if test -f "$dep"; then
+ echo " $dep \\" >>$cache
+ search_deps $dep >>$cache
+ break
+ fi
+ done
+ fi
+ cat $cache
+ done
+}
+
+:>${output}.new
+for src in $SOURCES
+do echo "Generating dependencies for $src"
+ ext=`echo $src | sed 's|.*\.\(.*\)|\1|'`
+ obj=`echo $src | sed "s|^.*/\([^ ]*\)\..*|\1.lo|g"`
+ echo "\$(objects)/$obj: $src \\" >>${output}.new
+
+ # No search to be done with Windows resource files
+ if test x"$ext" != x"rc"; then
+ search_deps $src | sort | uniq >>${output}.new
+ fi
+ case $ext in
+ c) cat >>${output}.new <<__EOF__
+
+ \$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@
+
+__EOF__
+ ;;
+ cc) cat >>${output}.new <<__EOF__
+
+ \$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@
+
+__EOF__
+ ;;
+ m) cat >>${output}.new <<__EOF__
+
+ \$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@
+
+__EOF__
+ ;;
+ asm) cat >>${output}.new <<__EOF__
+
+ \$(LIBTOOL) --tag=CC --mode=compile \$(auxdir)/strip_fPIC.sh \$(NASM) -I\$(srcdir)/src/hermes/ $src -o \$@
+
+__EOF__
+ ;;
+ S) cat >>${output}.new <<__EOF__
+
+ \$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@
+
+__EOF__
+ ;;
+ rc) cat >>${output}.new <<__EOF__
+
+ \$(LIBTOOL) --tag=RC --mode=compile \$(WINDRES) $src -o \$@
+
+__EOF__
+ ;;
+ *) echo "Unknown file extension: $ext";;
+ esac
+ echo "" >>${output}.new
+done
+mv ${output}.new ${output}
+rm -f ${cache_prefix}*
diff --git a/distrib/sdl-1.2.15/build-scripts/mkinstalldirs b/distrib/sdl-1.2.15/build-scripts/mkinstalldirs
new file mode 100755
index 0000000..8ab885e
--- /dev/null
+++ b/distrib/sdl-1.2.15/build-scripts/mkinstalldirs
@@ -0,0 +1,99 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+errstatus=0
+dirmode=""
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
+
+# process command line arguments
+while test $# -gt 0 ; do
+ case "${1}" in
+ -h | --help | --h* ) # -h for help
+ echo "${usage}" 1>&2; exit 0 ;;
+ -m ) # -m PERM arg
+ shift
+ test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
+ dirmode="${1}"
+ shift ;;
+ -- ) shift; break ;; # stop option processing
+ -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option
+ * ) break ;; # first non-opt arg
+ esac
+done
+
+for file
+do
+ if test -d "$file"; then
+ shift
+ else
+ break
+ fi
+done
+
+case $# in
+0) exit 0 ;;
+esac
+
+case $dirmode in
+'')
+ if mkdir -p -- . 2>/dev/null; then
+ echo "mkdir -p -- $*"
+ exec mkdir -p -- "$@"
+ fi ;;
+*)
+ if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
+ echo "mkdir -m $dirmode -p -- $*"
+ exec mkdir -m "$dirmode" -p -- "$@"
+ fi ;;
+esac
+
+for file
+do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d
+ do
+ pathcomp="$pathcomp$d"
+ case "$pathcomp" in
+ -* ) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ else
+ if test ! -z "$dirmode"; then
+ echo "chmod $dirmode $pathcomp"
+
+ lasterr=""
+ chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+ if test ! -z "$lasterr"; then
+ errstatus=$lasterr
+ fi
+ fi
+ fi
+ fi
+
+ pathcomp="$pathcomp/"
+ done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 3
+# End:
+# mkinstalldirs ends here
diff --git a/distrib/sdl-1.2.15/build-scripts/strip_fPIC.sh b/distrib/sdl-1.2.15/build-scripts/strip_fPIC.sh
new file mode 100755
index 0000000..45d34ba
--- /dev/null
+++ b/distrib/sdl-1.2.15/build-scripts/strip_fPIC.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+# libtool assumes that the compiler can handle the -fPIC flag
+# This isn't always true (for example, nasm can't handle it)
+command=""
+while [ $# -gt 0 ]; do
+ case "$1" in
+ -fPIC)
+ # Ignore -fPIC option
+ ;;
+ -fno-common)
+ # Ignore -fPIC and -DPIC options
+ ;;
+ *)
+ command="$command $1"
+ ;;
+ esac
+ shift
+done
+echo $command
+exec $command
diff --git a/distrib/sdl-1.2.15/configure.in b/distrib/sdl-1.2.15/configure.in
new file mode 100644
index 0000000..08c8e1e
--- /dev/null
+++ b/distrib/sdl-1.2.15/configure.in
@@ -0,0 +1,2965 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(README)
+AC_CONFIG_HEADER(include/SDL_config.h)
+AC_GNU_SOURCE
+AC_CONFIG_AUX_DIRS($srcdir/build-scripts)
+
+dnl Set various version strings - taken gratefully from the GTk sources
+#
+# Making releases:
+# Edit include/SDL/SDL_version.h and change the version, then:
+# SDL_MICRO_VERSION += 1;
+# SDL_INTERFACE_AGE += 1;
+# SDL_BINARY_AGE += 1;
+# if any functions have been added, set SDL_INTERFACE_AGE to 0.
+# if backwards compatibility has been broken,
+# set SDL_BINARY_AGE and SDL_INTERFACE_AGE to 0.
+#
+SDL_MAJOR_VERSION=1
+SDL_MINOR_VERSION=2
+SDL_MICRO_VERSION=15
+SDL_INTERFACE_AGE=4
+SDL_BINARY_AGE=15
+SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
+
+AC_SUBST(SDL_MAJOR_VERSION)
+AC_SUBST(SDL_MINOR_VERSION)
+AC_SUBST(SDL_MICRO_VERSION)
+AC_SUBST(SDL_INTERFACE_AGE)
+AC_SUBST(SDL_BINARY_AGE)
+AC_SUBST(SDL_VERSION)
+
+# libtool versioning
+LT_INIT([win32-dll])
+
+LT_RELEASE=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION
+LT_CURRENT=`expr $SDL_MICRO_VERSION - $SDL_INTERFACE_AGE`
+LT_REVISION=$SDL_INTERFACE_AGE
+LT_AGE=`expr $SDL_BINARY_AGE - $SDL_INTERFACE_AGE`
+m4_pattern_allow([^LT_])
+
+AC_SUBST(LT_RELEASE)
+AC_SUBST(LT_CURRENT)
+AC_SUBST(LT_REVISION)
+AC_SUBST(LT_AGE)
+
+dnl Detect the canonical build and host environments
+AC_CONFIG_AUX_DIR([build-scripts])
+dnl AC_CANONICAL_HOST
+AC_C_BIGENDIAN
+if test x$ac_cv_c_bigendian = xyes; then
+ AC_DEFINE(SDL_BYTEORDER, 4321)
+else
+ AC_DEFINE(SDL_BYTEORDER, 1234)
+fi
+
+dnl Check for tools
+AC_PROG_LIBTOOL
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_CHECK_TOOL(WINDRES, [windres], [:])
+
+dnl Set up the compiler and linker flags
+INCLUDE="-I$srcdir/include"
+if test x$srcdir != x.; then
+ # Remove SDL_config.h from the source directory, since it's the
+ # default one, and we want to include the one that we generate.
+ if test -f $srcdir/include/SDL_config.h; then
+ rm $srcdir/include/SDL_config.h
+ fi
+ INCLUDE="-Iinclude $INCLUDE"
+fi
+case "$host" in
+ *-*-cygwin*)
+ # We build SDL on cygwin without the UNIX emulation layer
+ BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin"
+ BASE_LDFLAGS="-mno-cygwin"
+ ;;
+ *)
+ BASE_CFLAGS="-D_GNU_SOURCE=1"
+ BASE_LDFLAGS=""
+ ;;
+esac
+BUILD_CFLAGS="$CFLAGS $CPPFLAGS"
+EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS"
+BUILD_LDFLAGS="$LDFLAGS"
+EXTRA_LDFLAGS="$BASE_LDFLAGS"
+## These are common directories to find software packages
+#for path in /usr/freeware /usr/pkg /usr/X11R6 /usr/local; do
+# if test -d $path/include; then
+# EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include"
+# fi
+# if test -d $path/lib; then
+# EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib"
+# fi
+#done
+SDL_CFLAGS="$BASE_CFLAGS"
+SDL_LIBS="-lSDL $BASE_LDFLAGS"
+CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS"
+CFLAGS="$CFLAGS $EXTRA_CFLAGS"
+LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
+
+dnl set this to use on systems that use lib64 instead of lib
+base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`
+
+dnl Function to find a library in the compiler search path
+find_lib()
+{
+ gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
+ gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
+ env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`]
+ if test "$cross_compiling" = yes; then
+ host_lib_path=""
+ else
+ host_lib_path="/usr/$base_libdir /usr/local/$base_libdir"
+ fi
+ for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do
+ lib=[`ls -- $path/$1 2>/dev/null | sort | sed 's/.*\/\(.*\)/\1/; q'`]
+ if test x$lib != x; then
+ echo $lib
+ return
+ fi
+ done
+}
+
+dnl Check for compiler characteristics
+AC_C_CONST
+AC_C_INLINE
+AC_C_VOLATILE
+
+dnl See whether we are allowed to use the system C library
+AC_ARG_ENABLE(libc,
+AC_HELP_STRING([--enable-libc], [Use the system C library [[default=yes]]]),
+ , enable_libc=yes)
+if test x$enable_libc = xyes; then
+ AC_DEFINE(HAVE_LIBC)
+
+ dnl Check for C library headers
+ AC_HEADER_STDC
+ AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h stddef.h stdarg.h malloc.h memory.h string.h strings.h inttypes.h stdint.h ctype.h math.h iconv.h signal.h)
+
+ dnl Check for typedefs, structures, etc.
+ AC_TYPE_SIZE_T
+ if test x$ac_cv_header_inttypes_h = xyes -o x$ac_cv_header_stdint_h = xyes; then
+ AC_CHECK_TYPE(int64_t)
+ if test x$ac_cv_type_int64_t = xyes; then
+ AC_DEFINE(SDL_HAS_64BIT_TYPE)
+ fi
+ have_inttypes=yes
+ fi
+
+ dnl Checks for library functions.
+ case "$host" in
+ *-*-cygwin* | *-*-mingw32*)
+ ;;
+ *)
+ AC_FUNC_ALLOCA
+ ;;
+ esac
+
+ AC_FUNC_MEMCMP
+ if test x$ac_cv_func_memcmp_working = xyes; then
+ AC_DEFINE(HAVE_MEMCMP)
+ fi
+ AC_FUNC_STRTOD
+ if test x$ac_cv_func_strtod = xyes; then
+ AC_DEFINE(HAVE_STRTOD)
+ fi
+ AC_CHECK_FUNC(mprotect,
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <sys/mman.h>
+ ],[
+ ],[
+ AC_DEFINE(HAVE_MPROTECT)
+ ]),
+ )
+ AC_CHECK_FUNCS(malloc calloc realloc free getenv putenv unsetenv qsort abs bcopy memset memcpy memmove strlen strlcpy strlcat strdup _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp sscanf snprintf vsnprintf iconv sigaction setjmp nanosleep)
+
+ AC_CHECK_LIB(iconv, libiconv_open, [EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
+ AC_CHECK_LIB(m, pow, [EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
+
+ AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE(HAVE_SA_SIGACTION)], ,[#include <signal.h>])
+fi
+
+if test x$have_inttypes != xyes; then
+ AC_CHECK_SIZEOF(char, 1)
+ AC_CHECK_SIZEOF(short, 2)
+ AC_CHECK_SIZEOF(int, 4)
+ AC_CHECK_SIZEOF(long, 4)
+ AC_CHECK_SIZEOF(long long, 8)
+ if test x$ac_cv_sizeof_char = x1; then
+ AC_DEFINE(int8_t, signed char)
+ AC_DEFINE(uint8_t, unsigned char)
+ fi
+ if test x$ac_cv_sizeof_short = x2; then
+ AC_DEFINE(int16_t, signed short)
+ AC_DEFINE(uint16_t, unsigned short)
+ else
+ if test x$ac_cv_sizeof_int = x2; then
+ AC_DEFINE(int16_t, signed int)
+ AC_DEFINE(uint16_t, unsigned int)
+ fi
+ fi
+ if test x$ac_cv_sizeof_int = x4; then
+ AC_DEFINE(int32_t, signed int)
+ AC_DEFINE(uint32_t, unsigned int)
+ else
+ if test x$ac_cv_sizeof_long = x4; then
+ AC_DEFINE(int32_t, signed long)
+ AC_DEFINE(uint32_t, unsigned long)
+ fi
+ fi
+ if test x$ac_cv_sizeof_long = x8; then
+ AC_DEFINE(int64_t, signed long)
+ AC_DEFINE(uint64_t, unsigned long)
+ AC_DEFINE(SDL_HAS_64BIT_TYPE)
+ else
+ if test x$ac_cv_sizeof_long_long = x8; then
+ AC_DEFINE(int64_t, signed long long)
+ AC_DEFINE(uint64_t, unsigned long long)
+ AC_DEFINE(SDL_HAS_64BIT_TYPE)
+ fi
+ fi
+ AC_DEFINE(size_t, unsigned int)
+ AC_DEFINE(uintptr_t, unsigned long)
+fi
+
+# Standard C sources
+SOURCES="$SOURCES $srcdir/src/*.c"
+SOURCES="$SOURCES $srcdir/src/audio/*.c"
+SOURCES="$SOURCES $srcdir/src/cdrom/*.c"
+SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
+SOURCES="$SOURCES $srcdir/src/events/*.c"
+SOURCES="$SOURCES $srcdir/src/file/*.c"
+SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
+SOURCES="$SOURCES $srcdir/src/thread/*.c"
+SOURCES="$SOURCES $srcdir/src/timer/*.c"
+SOURCES="$SOURCES $srcdir/src/video/*.c"
+
+dnl Enable/disable various subsystems of the SDL library
+
+AC_ARG_ENABLE(audio,
+AC_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]),
+ , enable_audio=yes)
+if test x$enable_audio != xyes; then
+ AC_DEFINE(SDL_AUDIO_DISABLED)
+fi
+AC_ARG_ENABLE(video,
+AC_HELP_STRING([--enable-video], [Enable the video subsystem [[default=yes]]]),
+ , enable_video=yes)
+if test x$enable_video != xyes; then
+ AC_DEFINE(SDL_VIDEO_DISABLED)
+fi
+AC_ARG_ENABLE(events,
+AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
+ , enable_events=yes)
+if test x$enable_events != xyes; then
+ AC_DEFINE(SDL_EVENTS_DISABLED)
+fi
+AC_ARG_ENABLE(joystick,
+AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]),
+ , enable_joystick=yes)
+if test x$enable_joystick != xyes; then
+ AC_DEFINE(SDL_JOYSTICK_DISABLED)
+else
+ SOURCES="$SOURCES $srcdir/src/joystick/*.c"
+fi
+AC_ARG_ENABLE(cdrom,
+AC_HELP_STRING([--enable-cdrom], [Enable the cdrom subsystem [[default=yes]]]),
+ , enable_cdrom=yes)
+if test x$enable_cdrom != xyes; then
+ AC_DEFINE(SDL_CDROM_DISABLED)
+fi
+AC_ARG_ENABLE(threads,
+AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]),
+ , enable_threads=yes)
+if test x$enable_threads != xyes; then
+ AC_DEFINE(SDL_THREADS_DISABLED)
+fi
+AC_ARG_ENABLE(timers,
+AC_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]),
+ , enable_timers=yes)
+if test x$enable_timers != xyes; then
+ AC_DEFINE(SDL_TIMERS_DISABLED)
+fi
+AC_ARG_ENABLE(file,
+AC_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]),
+ , enable_file=yes)
+if test x$enable_file != xyes; then
+ AC_DEFINE(SDL_FILE_DISABLED)
+fi
+AC_ARG_ENABLE(loadso,
+AC_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [[default=yes]]]),
+ , enable_loadso=yes)
+if test x$enable_loadso != xyes; then
+ AC_DEFINE(SDL_LOADSO_DISABLED)
+fi
+AC_ARG_ENABLE(cpuinfo,
+AC_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [[default=yes]]]),
+ , enable_cpuinfo=yes)
+if test x$enable_cpuinfo != xyes; then
+ AC_DEFINE(SDL_CPUINFO_DISABLED)
+fi
+AC_ARG_ENABLE(assembly,
+AC_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]),
+ , enable_assembly=yes)
+if test x$enable_assembly = xyes; then
+ AC_DEFINE(SDL_ASSEMBLY_ROUTINES)
+fi
+
+dnl See if the OSS audio interface is supported
+CheckOSS()
+{
+ AC_ARG_ENABLE(oss,
+AC_HELP_STRING([--enable-oss], [support the OSS audio API [[default=yes]]]),
+ , enable_oss=yes)
+ if test x$enable_audio = xyes -a x$enable_oss = xyes; then
+ AC_MSG_CHECKING(for OSS audio support)
+ have_oss=no
+ if test x$have_oss != xyes; then
+ AC_TRY_COMPILE([
+ #include <sys/soundcard.h>
+ ],[
+ int arg = SNDCTL_DSP_SETFRAGMENT;
+ ],[
+ have_oss=yes
+ ])
+ fi
+ if test x$have_oss != xyes; then
+ AC_TRY_COMPILE([
+ #include <soundcard.h>
+ ],[
+ int arg = SNDCTL_DSP_SETFRAGMENT;
+ ],[
+ have_oss=yes
+ AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H)
+ ])
+ fi
+ AC_MSG_RESULT($have_oss)
+ if test x$have_oss = xyes; then
+ AC_DEFINE(SDL_AUDIO_DRIVER_OSS)
+ SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
+ SOURCES="$SOURCES $srcdir/src/audio/dma/*.c"
+ have_audio=yes
+
+ # We may need to link with ossaudio emulation library
+ case "$host" in
+ *-*-openbsd*|*-*-netbsd*)
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lossaudio";;
+ esac
+ fi
+ fi
+}
+
+dnl See if the ALSA audio interface is supported
+CheckALSA()
+{
+ AC_ARG_ENABLE(alsa,
+AC_HELP_STRING([--enable-alsa], [support the ALSA audio API [[default=yes]]]),
+ , enable_alsa=yes)
+ if test x$enable_audio = xyes -a x$enable_alsa = xyes; then
+ AM_PATH_ALSA(0.9.0, have_alsa=yes, have_alsa=no)
+ # Restore all flags from before the ALSA detection runs
+ CFLAGS="$alsa_save_CFLAGS"
+ LDFLAGS="$alsa_save_LDFLAGS"
+ LIBS="$alsa_save_LIBS"
+ if test x$have_alsa = xyes; then
+ AC_ARG_ENABLE(alsa-shared,
+AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[default=yes]]]),
+ , enable_alsa_shared=yes)
+ alsa_lib=[`find_lib "libasound.so.*" "$ALSA_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
+
+ AC_DEFINE(SDL_AUDIO_DRIVER_ALSA)
+ SOURCES="$SOURCES $srcdir/src/audio/alsa/*.c"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $ALSA_CFLAGS"
+ if test x$have_loadso != xyes && \
+ test x$enable_alsa_shared = xyes; then
+ AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ALSA loading])
+ fi
+ if test x$have_loadso = xyes && \
+ test x$enable_alsa_shared = xyes && test x$alsa_lib != x; then
+ echo "-- dynamic libasound -> $alsa_lib"
+ AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ALSA_DYNAMIC, "$alsa_lib")
+ else
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ALSA_LIBS"
+ fi
+ have_audio=yes
+ fi
+ fi
+}
+
+dnl Check whether we want to use IRIX 6.5+ native audio or not
+CheckDMEDIA()
+{
+ if test x$enable_audio = xyes; then
+ AC_MSG_CHECKING(for dmedia audio support)
+ have_dmedia=no
+ AC_TRY_COMPILE([
+ #include <dmedia/audio.h>
+ ],[
+ ALport audio_port;
+ ],[
+ have_dmedia=yes
+ ])
+ AC_MSG_RESULT($have_dmedia)
+ # Set up files for the audio library
+ if test x$have_dmedia = xyes; then
+ AC_DEFINE(SDL_AUDIO_DRIVER_DMEDIA)
+ SOURCES="$SOURCES $srcdir/src/audio/dmedia/*.c"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laudio"
+ have_audio=yes
+ fi
+ fi
+}
+
+dnl Check whether we want to use Tru64 UNIX native audio or not
+CheckMME()
+{
+ dnl Make sure we are running on an Tru64 UNIX
+ case $ARCH in
+ osf)
+ ;;
+ *)
+ return
+ ;;
+ esac
+ if test x$enable_audio = xyes; then
+ AC_MSG_CHECKING(for MME audio support)
+ MME_CFLAGS="-I/usr/include/mme"
+ MME_LIBS="-lmme"
+ have_mme=no
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $MME_CFLAGS"
+ AC_TRY_COMPILE([
+ #include <mme_api.h>
+ ],[
+ HWAVEOUT sound;
+ ],[
+ have_mme=yes
+ ])
+ CFLAGS="$save_CFLAGS"
+ AC_MSG_RESULT($have_mme)
+ # Set up files for the audio library
+ if test x$have_mme = xyes; then
+ AC_DEFINE(SDL_AUDIO_DRIVER_MMEAUDIO)
+ SOURCES="$SOURCES $srcdir/src/audio/mme/*.c"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $MME_CFLAGS"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MME_LIBS"
+ have_audio=yes
+ fi
+ fi
+}
+
+dnl Find the ESD includes and libraries
+CheckESD()
+{
+ AC_ARG_ENABLE(esd,
+AC_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [[default=yes]]]),
+ , enable_esd=yes)
+ if test x$enable_audio = xyes -a x$enable_esd = xyes; then
+ AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
+ if test x$have_esd = xyes; then
+ AC_ARG_ENABLE(esd-shared,
+AC_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[default=yes]]]),
+ , enable_esd_shared=yes)
+ esd_lib=[`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
+
+ AC_DEFINE(SDL_AUDIO_DRIVER_ESD)
+ SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
+ if test x$have_loadso != xyes && \
+ test x$enable_esd_shared = xyes; then
+ AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading])
+ fi
+ if test x$have_loadso = xyes && \
+ test x$enable_esd_shared = xyes && test x$esd_lib != x; then
+ echo "-- dynamic libesd -> $esd_lib"
+ AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib")
+ else
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
+ fi
+ have_audio=yes
+ fi
+ fi
+}
+
+dnl Find PulseAudio
+CheckPulseAudio()
+{
+ AC_ARG_ENABLE(pulseaudio,
+AC_HELP_STRING([--enable-pulseaudio], [use PulseAudio [[default=yes]]]),
+ , enable_pulseaudio=yes)
+ if test x$enable_audio = xyes -a x$enable_pulseaudio = xyes; then
+ audio_pulse=no
+
+ PULSE_REQUIRED_VERSION=0.9
+
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+ AC_MSG_CHECKING(for PulseAudio $PULSE_REQUIRED_VERSION support)
+ if test x$PKG_CONFIG != xno; then
+ if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $PULSE_REQUIRED_VERSION libpulse-simple; then
+ PULSE_CFLAGS=`$PKG_CONFIG --cflags libpulse-simple`
+ PULSE_LIBS=`$PKG_CONFIG --libs libpulse-simple`
+ audio_pulse=yes
+ fi
+ fi
+ AC_MSG_RESULT($audio_pulse)
+
+ if test x$audio_pulse = xyes; then
+ AC_ARG_ENABLE(pulseaudio-shared,
+AC_HELP_STRING([--enable-pulseaudio-shared], [dynamically load PulseAudio support [[default=yes]]]),
+ , enable_pulseaudio_shared=yes)
+ pulse_lib=[`find_lib "libpulse-simple.so.*" "$PULSE_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
+
+ AC_DEFINE(SDL_AUDIO_DRIVER_PULSE)
+ SOURCES="$SOURCES $srcdir/src/audio/pulse/*.c"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $PULSE_CFLAGS"
+ if test x$have_loadso != xyes && \
+ test x$enable_pulseaudio_shared = xyes; then
+ AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic PulseAudio loading])
+ fi
+ if test x$have_loadso = xyes && \
+ test x$enable_pulseaudio_shared = xyes && test x$pulse_lib != x; then
+ echo "-- dynamic libpulse-simple -> $pulse_lib"
+ AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSE_DYNAMIC, "$pulse_lib")
+ else
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSE_LIBS"
+ fi
+ have_audio=yes
+ fi
+ fi
+}
+
+CheckARTSC()
+{
+ AC_ARG_ENABLE(arts,
+AC_HELP_STRING([--enable-arts], [support the Analog Real Time Synthesizer [[default=yes]]]),
+ , enable_arts=yes)
+ if test x$enable_audio = xyes -a x$enable_arts = xyes; then
+ AC_PATH_PROG(ARTSCONFIG, artsc-config)
+ if test x$ARTSCONFIG = x -o x$ARTSCONFIG = x'"$ARTSCONFIG"'; then
+ : # arts isn't installed
+ else
+ ARTS_CFLAGS=`$ARTSCONFIG --cflags`
+ ARTS_LIBS=`$ARTSCONFIG --libs`
+ AC_MSG_CHECKING(for aRts development environment)
+ audio_arts=no
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $ARTS_CFLAGS"
+ AC_TRY_COMPILE([
+ #include <artsc.h>
+ ],[
+ arts_stream_t stream;
+ ],[
+ audio_arts=yes
+ ])
+ CFLAGS="$save_CFLAGS"
+ AC_MSG_RESULT($audio_arts)
+ if test x$audio_arts = xyes; then
+ AC_ARG_ENABLE(arts-shared,
+AC_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [[default=yes]]]),
+ , enable_arts_shared=yes)
+ arts_lib=[`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
+
+ AC_DEFINE(SDL_AUDIO_DRIVER_ARTS)
+ SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS"
+ if test x$have_loadso != xyes && \
+ test x$enable_arts_shared = xyes; then
+ AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ARTS loading])
+ fi
+ if test x$have_loadso = xyes && \
+ test x$enable_arts_shared = xyes && test x$arts_lib != x; then
+ echo "-- dynamic libartsc -> $arts_lib"
+ AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib")
+ else
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS"
+ fi
+ have_audio=yes
+ fi
+ fi
+ fi
+}
+
+dnl See if the NAS audio interface is supported
+CheckNAS()
+{
+ AC_ARG_ENABLE(nas,
+AC_HELP_STRING([--enable-nas], [support the NAS audio API [[default=yes]]]),
+ , enable_nas=yes)
+ if test x$enable_audio = xyes -a x$enable_nas = xyes; then
+ AC_CHECK_HEADER(audio/audiolib.h, have_nas_hdr=yes)
+ AC_CHECK_LIB(audio, AuOpenServer, have_nas_lib=yes)
+
+ AC_MSG_CHECKING(for NAS audio support)
+ have_nas=no
+
+ if test x$have_nas_hdr = xyes -a x$have_nas_lib = xyes; then
+ have_nas=yes
+ NAS_LIBS="-laudio"
+
+ elif test -r /usr/X11R6/include/audio/audiolib.h; then
+ have_nas=yes
+ NAS_CFLAGS="-I/usr/X11R6/include/"
+ NAS_LIBS="-L/usr/X11R6/lib -laudio -lXt"
+
+ dnl On IRIX, the NAS includes are in a different directory,
+ dnl and libnas must be explicitly linked in
+
+ elif test -r /usr/freeware/include/nas/audiolib.h; then
+ have_nas=yes
+ NAS_LIBS="-lnas -lXt"
+ fi
+
+ AC_MSG_RESULT($have_nas)
+
+ if test x$have_nas = xyes; then
+ AC_ARG_ENABLE(nas-shared,
+AC_HELP_STRING([--enable-nas-shared], [dynamically load NAS audio support [[default=yes]]]),
+ , enable_nas_shared=yes)
+ nas_lib=[`find_lib "libaudio.so.*" "$NAS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
+
+ if test x$have_loadso != xyes && \
+ test x$enable_nas_shared = xyes; then
+ AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic NAS loading])
+ fi
+ if test x$have_loadso = xyes && \
+ test x$enable_nas_shared = xyes && test x$nas_lib != x; then
+ echo "-- dynamic libaudio -> $nas_lib"
+ AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_NAS_DYNAMIC, "$nas_lib")
+ else
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
+ fi
+
+ AC_DEFINE(SDL_AUDIO_DRIVER_NAS)
+ SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
+ have_audio=yes
+ fi
+ fi
+}
+
+dnl rcg07142001 See if the user wants the disk writer audio driver...
+CheckDiskAudio()
+{
+ AC_ARG_ENABLE(diskaudio,
+AC_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [[default=yes]]]),
+ , enable_diskaudio=yes)
+ if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
+ AC_DEFINE(SDL_AUDIO_DRIVER_DISK)
+ SOURCES="$SOURCES $srcdir/src/audio/disk/*.c"
+ fi
+}
+
+dnl rcg03142006 See if the user wants the dummy audio driver...
+CheckDummyAudio()
+{
+ AC_ARG_ENABLE(dummyaudio,
+AC_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=yes]]]),
+ , enable_dummyaudio=yes)
+ if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then
+ AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY)
+ SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
+ fi
+}
+
+dnl Set up the Atari Audio driver
+CheckAtariAudio()
+{
+ AC_ARG_ENABLE(mintaudio,
+AC_HELP_STRING([--enable-mintaudio], [support Atari audio driver [[default=yes]]]),
+ , enable_mintaudio=yes)
+ if test x$enable_audio = xyes -a x$enable_mintaudio = xyes; then
+ mintaudio=no
+ AC_CHECK_HEADER(mint/falcon.h, have_mint_falcon_hdr=yes)
+ if test x$have_mint_falcon_hdr = xyes; then
+ mintaudio=yes
+ AC_DEFINE(SDL_AUDIO_DRIVER_MINT)
+ SOURCES="$SOURCES $srcdir/src/audio/mint/*.c"
+ SOURCES="$SOURCES $srcdir/src/audio/mint/*.S"
+ have_audio=yes
+ fi
+ fi
+}
+
+dnl See if we can use x86 assembly blitters
+# NASM is available from: http://nasm.sourceforge.net
+CheckNASM()
+{
+ dnl Make sure we are running on an x86 platform
+ case $host in
+ i?86*)
+ ;;
+ *)
+ # Nope, bail early.
+ return
+ ;;
+ esac
+
+ dnl Mac OS X might report itself as "i386" but generate x86_64 code.
+ dnl So see what size we think a pointer is, and bail if not 32-bit.
+ AC_CHECK_SIZEOF([void *], 4)
+ if test x$ac_cv_sizeof_void_p != x4; then
+ return
+ fi
+
+ dnl Check for NASM (for assembly blit routines)
+ AC_ARG_ENABLE(nasm,
+AC_HELP_STRING([--enable-nasm], [use nasm assembly blitters on x86 [[default=yes]]]),
+ , enable_nasm=yes)
+ if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_nasm = xyes; then
+ CompileNASM()
+ {
+ # Usage: CompileNASM <filename>
+ AC_MSG_CHECKING(to see if $NASM supports $1)
+ if $NASM $NASMFLAGS $1 -o $1.o >&AS_MESSAGE_LOG_FD 2>&1; then
+ CompileNASM_ret="yes"
+ else
+ CompileNASM_ret="no"
+ fi
+ rm -f $1 $1.o
+ AC_MSG_RESULT($CompileNASM_ret)
+ test "$CompileNASM_ret" = "yes"
+ }
+
+ if test x"$NASMFLAGS" = x; then
+ case $ARCH in
+ win32)
+ NASMFLAGS="-f win32"
+ ;;
+ macosx)
+ NASMFLAGS="-f macho"
+ ;;
+ *)
+ NASMFLAGS="-f elf32"
+ ;;
+ esac
+ fi
+
+ AC_PATH_PROG(NASM, nasm)
+ echo "%ifidn __OUTPUT_FORMAT__,elf32" > unquoted-sections
+ echo "section .note.GNU-stack noalloc noexec nowrite progbits" >> unquoted-sections
+ echo "%endif" >> unquoted-sections
+ CompileNASM unquoted-sections || NASM=""
+
+ if test "x$NASM" != x -a "x$NASM" != x'"$NASM"'; then
+ AC_DEFINE(SDL_HERMES_BLITTERS)
+ SOURCES="$SOURCES $srcdir/src/hermes/*.asm"
+ NASMFLAGS="$NASMFLAGS -I $srcdir/src/hermes/"
+
+ dnl See if hidden visibility is supported
+ echo "GLOBAL _bar:function hidden" > symbol-visibility
+ echo "_bar:" >> symbol-visibility
+ CompileNASM symbol-visibility && NASMFLAGS="$NASMFLAGS -DHIDDEN_VISIBILITY"
+
+ AC_SUBST(NASM)
+ AC_SUBST(NASMFLAGS)
+
+ case "$host" in
+ # this line is needed for QNX, because it's not defined the __ELF__
+ *-*-qnx*)
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -D__ELF__";;
+ *-*-solaris*)
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -D__ELF__";;
+ esac
+ fi
+ fi
+}
+
+dnl Check for altivec instruction support using gas syntax
+CheckAltivec()
+{
+ AC_ARG_ENABLE(altivec,
+AC_HELP_STRING([--enable-altivec], [use altivec assembly blitters on PPC [[default=yes]]]),
+ , enable_altivec=yes)
+ if test x$enable_video = xyes -a x$enable_assembly = xyes -a x$enable_altivec = xyes; then
+ save_CFLAGS="$CFLAGS"
+ have_gcc_altivec=no
+ have_altivec_h_hdr=no
+ altivec_CFLAGS="-maltivec"
+ CFLAGS="$save_CFLAGS $altivec_CFLAGS"
+
+ AC_MSG_CHECKING(for Altivec with GCC altivec.h and -maltivec option)
+ AC_TRY_COMPILE([
+ #include <altivec.h>
+ vector unsigned int vzero() {
+ return vec_splat_u32(0);
+ }
+ ],[
+ ],[
+ have_gcc_altivec=yes
+ have_altivec_h_hdr=yes
+ ])
+ AC_MSG_RESULT($have_gcc_altivec)
+
+ if test x$have_gcc_altivec = xno; then
+ AC_MSG_CHECKING(for Altivec with GCC -maltivec option)
+ AC_TRY_COMPILE([
+ vector unsigned int vzero() {
+ return vec_splat_u32(0);
+ }
+ ],[
+ ],[
+ have_gcc_altivec=yes
+ ])
+ AC_MSG_RESULT($have_gcc_altivec)
+ fi
+
+ if test x$have_gcc_altivec = xno; then
+ AC_MSG_CHECKING(for Altivec with GCC altivec.h and -faltivec option)
+ altivec_CFLAGS="-faltivec"
+ CFLAGS="$save_CFLAGS $altivec_CFLAGS"
+ AC_TRY_COMPILE([
+ #include <altivec.h>
+ vector unsigned int vzero() {
+ return vec_splat_u32(0);
+ }
+ ],[
+ ],[
+ have_gcc_altivec=yes
+ have_altivec_h_hdr=yes
+ ])
+ AC_MSG_RESULT($have_gcc_altivec)
+ fi
+
+ if test x$have_gcc_altivec = xno; then
+ AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
+ AC_TRY_COMPILE([
+ vector unsigned int vzero() {
+ return vec_splat_u32(0);
+ }
+ ],[
+ ],[
+ have_gcc_altivec=yes
+ ])
+ AC_MSG_RESULT($have_gcc_altivec)
+ fi
+ CFLAGS="$save_CFLAGS"
+
+ if test x$have_gcc_altivec = xyes; then
+ AC_DEFINE(SDL_ALTIVEC_BLITTERS)
+ if test x$have_altivec_h_hdr = xyes; then
+ AC_DEFINE(HAVE_ALTIVEC_H)
+ fi
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
+ fi
+ fi
+}
+
+dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
+dnl Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
+CheckVisibilityHidden()
+{
+ AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
+ have_gcc_fvisibility=no
+
+ visibility_CFLAGS="-fvisibility=hidden"
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror"
+ AC_TRY_COMPILE([
+ #if !defined(__GNUC__) || __GNUC__ < 4
+ #error SDL only uses visibility attributes in GCC 4 or newer
+ #endif
+ ],[
+ ],[
+ have_gcc_fvisibility=yes
+ ])
+ AC_MSG_RESULT($have_gcc_fvisibility)
+ CFLAGS="$save_CFLAGS"
+
+ if test x$have_gcc_fvisibility = xyes; then
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $visibility_CFLAGS"
+ fi
+}
+
+dnl See if GCC's -Wall is supported.
+CheckWarnAll()
+{
+ AC_MSG_CHECKING(for GCC -Wall option)
+ have_gcc_Wall=no
+
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$save_CFLAGS -Wall"
+ AC_TRY_COMPILE([
+ int x = 0;
+ ],[
+ ],[
+ have_gcc_Wall=yes
+ ])
+ AC_MSG_RESULT($have_gcc_Wall)
+ CFLAGS="$save_CFLAGS"
+
+ if test x$have_gcc_Wall = xyes; then
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
+
+ dnl Haiku headers use multicharacter constants all over the place. Ignore these warnings when using -Wall.
+ AC_MSG_CHECKING(for necessary GCC -Wno-multichar option)
+ need_gcc_Wno_multichar=no
+ case "$host" in
+ *-*-beos* | *-*-haiku*)
+ need_gcc_Wno_multichar=yes
+ ;;
+ esac
+ AC_MSG_RESULT($need_gcc_Wno_multichar)
+ if test x$need_gcc_Wno_multichar = xyes; then
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-multichar"
+ fi
+ fi
+}
+
+
+dnl Do the iPod thing
+CheckIPod()
+{
+ AC_ARG_ENABLE(ipod,
+AC_HELP_STRING([--enable-ipod], [configure SDL to work with iPodLinux [[default=no]]]),
+ , enable_ipod=no)
+
+ if test x$enable_ipod = xyes; then
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -DIPOD"
+ AC_DEFINE(SDL_VIDEO_DRIVER_IPOD)
+ SOURCES="$SOURCES $srcdir/src/video/ipod/*.c"
+ fi
+}
+
+dnl Find the nanox include and library directories
+CheckNANOX()
+{
+ AC_ARG_ENABLE(video-nanox,
+ AC_HELP_STRING([--enable-video-nanox], [use nanox video driver [[default=no]]]),
+ , enable_video_nanox=no)
+
+ if test x$enable_video = xyes -a x$enable_video_nanox = xyes; then
+ AC_ARG_ENABLE(nanox-debug,
+ AC_HELP_STRING([--enable-nanox-debug], [print debug messages [[default=no]]]),
+ , enable_nanox_debug=no)
+ if test x$enable_nanox_debug = xyes; then
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DEBUG"
+ fi
+
+ AC_ARG_ENABLE(nanox-share-memory,
+ AC_HELP_STRING([--enable-nanox-share-memory], [use share memory [[default=no]]]),
+ , enable_nanox_share_memory=no)
+ if test x$enable_nanox_share_memory = xyes; then
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -DNANOX_SHARE_MEMORY"
+ fi
+
+ AC_ARG_ENABLE(nanox_direct_fb,
+ AC_HELP_STRING([--enable-nanox-direct-fb], [use direct framebuffer access [[default=no]]]),
+ , enable_nanox_direct_fb=no)
+ if test x$enable_nanox_direct_fb = xyes; then
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DIRECT_FB"
+ fi
+
+ AC_DEFINE(SDL_VIDEO_DRIVER_NANOX)
+ SOURCES="$SOURCES $srcdir/src/video/nanox/*.c"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lnano-X"
+ have_video=yes
+ fi
+}
+
+dnl Find the X11 include and library directories
+CheckX11()
+{
+ AC_ARG_ENABLE(video-x11,
+AC_HELP_STRING([--enable-video-x11], [use X11 video driver [[default=yes]]]),
+ , enable_video_x11=yes)
+ if test x$enable_video = xyes -a x$enable_video_x11 = xyes; then
+ case "$host" in
+ *-*-darwin*)
+ # This isn't necessary for X11, but fixes GLX detection
+ if test "x$x_includes" = xNONE && test "x$x_libraries" = xNONE; then
+ x_includes="/usr/X11R6/include"
+ x_libraries="/usr/X11R6/lib"
+ fi
+ ;;
+ esac
+ AC_PATH_X
+ AC_PATH_XTRA
+ if test x$have_x = xyes; then
+ # Only allow dynamically loaded X11 if the X11 function pointers
+ # will not end up in the global namespace, which causes problems
+ # with other libraries calling X11 functions.
+ x11_symbols_private=$have_gcc_fvisibility
+
+ AC_ARG_ENABLE(x11-shared,
+AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=maybe]]]),
+ , enable_x11_shared=maybe)
+
+ case "$host" in
+ *-*-darwin*) # Latest Mac OS X actually ships with Xrandr/Xrender libs...
+ x11_symbols_private=yes
+ x11_lib='/usr/X11R6/lib/libX11.6.dylib'
+ x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
+ xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
+ xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
+ ;;
+ *-*-osf*)
+ x11_lib='libX11.so'
+ x11ext_lib='libXext.so'
+ ;;
+ *-*-irix*) # IRIX 6.5 requires that we use /usr/lib32
+ x11_lib='libX11.so'
+ x11ext_lib='libXext.so'
+ ;;
+ *)
+ x11_lib=[`find_lib "libX11.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
+ x11ext_lib=[`find_lib "libXext.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
+ xrender_lib=[`find_lib "libXrender.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
+ xrandr_lib=[`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
+ ;;
+ esac
+
+ X_CFLAGS="$X_CFLAGS -DXTHREADS"
+ if test x$ac_cv_func_shmat != xyes; then
+ X_CFLAGS="$X_CFLAGS -DNO_SHARED_MEMORY"
+ fi
+ CFLAGS="$CFLAGS $X_CFLAGS"
+ LDFLAGS="$LDFLAGS $X_LIBS"
+
+ AC_DEFINE(SDL_VIDEO_DRIVER_X11)
+ SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
+
+ if test x$enable_x11_shared = xmaybe; then
+ enable_x11_shared=$x11_symbols_private
+ fi
+ if test x$have_loadso != xyes && \
+ test x$enable_x11_shared = xyes; then
+ AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading])
+ enable_x11_shared=no
+ fi
+ if test x$x11_symbols_private != xyes && \
+ test x$enable_x11_shared = xyes; then
+ AC_MSG_WARN([You must have gcc4 (-fvisibility=hidden) for dynamic X11 loading])
+ enable_x11_shared=no
+ fi
+
+ if test x$have_loadso = xyes && \
+ test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
+ echo "-- dynamic libX11 -> $x11_lib"
+ echo "-- dynamic libX11ext -> $x11ext_lib"
+ AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib")
+ AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib")
+ else
+ enable_x11_shared=no
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
+ fi
+ have_video=yes
+
+ AC_ARG_ENABLE(dga,
+AC_HELP_STRING([--enable-dga], [allow use of X11 DGA code [[default=yes]]]),
+ , enable_dga=yes)
+ if test x$enable_dga = xyes; then
+ SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86dga/*.c"
+ fi
+ AC_ARG_ENABLE(video-dga,
+AC_HELP_STRING([--enable-video-dga], [use DGA 2.0 video driver [[default=yes]]]),
+ , enable_video_dga=yes)
+ if test x$enable_dga = xyes -a x$enable_video_dga = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_DGA)
+ SOURCES="$SOURCES $srcdir/src/video/dga/*.c"
+ fi
+ AC_ARG_ENABLE(video-x11-dgamouse,
+AC_HELP_STRING([--enable-video-x11-dgamouse], [use X11 DGA for mouse events [[default=yes]]]),
+ , enable_video_x11_dgamouse=yes)
+ if test x$enable_dga = xyes -a x$enable_video_x11_dgamouse = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_X11_DGAMOUSE)
+ fi
+ AC_ARG_ENABLE(video-x11-vm,
+AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]),
+ , enable_video_x11_vm=yes)
+ if test x$enable_video_x11_vm = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_X11_VIDMODE)
+ SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86vm/*.c"
+ fi
+ AC_ARG_ENABLE(video-x11-xv,
+AC_HELP_STRING([--enable-video-x11-xv], [use X11 XvImage extension for video [[default=yes]]]),
+ , enable_video_x11_xv=yes)
+ if test x$enable_video_x11_xv = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_X11_XV)
+ SOURCES="$SOURCES $srcdir/src/video/Xext/Xv/*.c"
+ fi
+ AC_ARG_ENABLE(video-x11-xinerama,
+AC_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]),
+ , enable_video_x11_xinerama=yes)
+ if test x$enable_video_x11_xinerama = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA)
+ SOURCES="$SOURCES $srcdir/src/video/Xext/Xinerama/*.c"
+ fi
+ AC_ARG_ENABLE(video-x11-xme,
+AC_HELP_STRING([--enable-video-x11-xme], [enable Xi Graphics XME for fullscreen [[default=yes]]]),
+ , enable_video_x11_xme=yes)
+ if test x$enable_video_x11_xme = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_X11_XME)
+ SOURCES="$SOURCES $srcdir/src/video/Xext/XME/*.c"
+ fi
+ AC_ARG_ENABLE(video-x11-xrandr,
+AC_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for fullscreen [[default=yes]]]),
+ , enable_video_x11_xrandr=yes)
+ if test x$enable_video_x11_xrandr = xyes; then
+ definitely_enable_video_x11_xrandr=no
+ AC_CHECK_HEADER(X11/extensions/Xrandr.h,
+ have_xrandr_h_hdr=yes,
+ have_xrandr_h_hdr=no,
+ [#include <X11/Xlib.h>
+ ])
+ if test x$have_xrandr_h_hdr = xyes; then
+ if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then
+ echo "-- dynamic libXrender -> $xrender_lib"
+ echo "-- dynamic libXrandr -> $xrandr_lib"
+ AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER, "$xrender_lib")
+ AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib")
+ definitely_enable_video_x11_xrandr=yes
+ else
+ AC_CHECK_LIB(Xrender, XRenderQueryExtension, have_xrender_lib=yes)
+ AC_CHECK_LIB(Xrandr, XRRQueryExtension, have_xrandr_lib=yes)
+ if test x$have_xrender_lib = xyes && test x$have_xrandr_lib = xyes ; then
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr -lXrender"
+ definitely_enable_video_x11_xrandr=yes
+ fi
+ fi
+ fi
+ fi
+ if test x$definitely_enable_video_x11_xrandr = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR)
+ fi
+ fi
+ fi
+}
+
+dnl Check for QNX photon video driver
+CheckPHOTON()
+{
+ AC_ARG_ENABLE(video-photon,
+AC_HELP_STRING([--enable-video-photon], [use QNX Photon video driver [[default=yes]]]),
+ , enable_video_photon=yes)
+ if test x$enable_video = xyes -a x$enable_video_photon = xyes; then
+ AC_MSG_CHECKING(for QNX Photon support)
+ video_photon=no
+ AC_TRY_COMPILE([
+ #include <Ph.h>
+ #include <Pt.h>
+ #include <photon/Pg.h>
+ #include <photon/PdDirect.h>
+ ],[
+ PgDisplaySettings_t *visual;
+ ],[
+ video_photon=yes
+ ])
+ AC_MSG_RESULT($video_photon)
+ if test x$video_photon = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_PHOTON)
+ SOURCES="$SOURCES $srcdir/src/video/photon/*.c"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lph"
+ have_video=yes
+
+ CheckOpenGLQNX
+ fi
+ fi
+}
+
+dnl Set up the BWindow video driver if enabled
+CheckBWINDOW()
+{
+ if test x$enable_video = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_BWINDOW)
+ SOURCES="$SOURCES $srcdir/src/video/bwindow/*.cc"
+ have_video=yes
+ fi
+}
+
+dnl Set up the Carbon/QuickDraw video driver for Mac OS X (but not Darwin)
+CheckCARBON()
+{
+ AC_ARG_ENABLE(video-carbon,
+AC_HELP_STRING([--enable-video-carbon], [use Carbon/QuickDraw video driver [[default=no]]]),
+ , enable_video_carbon=no)
+ if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
+ AC_MSG_CHECKING(for Carbon framework)
+ have_carbon=no
+ AC_TRY_COMPILE([
+ #include <Carbon/Carbon.h>
+ ],[
+ ],[
+ have_carbon=yes
+ ])
+ AC_MSG_RESULT($have_carbon)
+ if test x$have_carbon = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_TOOLBOX)
+ SOURCES="$SOURCES $srcdir/src/video/maccommon/*.c"
+ SOURCES="$SOURCES $srcdir/src/video/macrom/*.c"
+ have_video=yes
+ fi
+ fi
+}
+
+dnl Set up the Cocoa/Quartz video driver for Mac OS X (but not Darwin)
+CheckCOCOA()
+{
+ AC_ARG_ENABLE(video-cocoa,
+AC_HELP_STRING([--enable-video-cocoa], [use Cocoa/Quartz video driver [[default=yes]]]),
+ , enable_video_cocoa=yes)
+ if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
+ save_CFLAGS="$CFLAGS"
+ dnl work around that we don't have Objective-C support in autoconf
+ CFLAGS="$CFLAGS -x objective-c"
+ AC_MSG_CHECKING(for Cocoa framework)
+ have_cocoa=no
+ AC_TRY_COMPILE([
+ #import <Cocoa/Cocoa.h>
+ ],[
+ ],[
+ have_cocoa=yes
+ ])
+ AC_MSG_RESULT($have_cocoa)
+ CFLAGS="$save_CFLAGS"
+ if test x$have_cocoa = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_QUARTZ)
+ SOURCES="$SOURCES $srcdir/src/video/quartz/*.m"
+ have_video=yes
+ fi
+ fi
+}
+
+dnl Find the framebuffer console includes
+CheckFBCON()
+{
+ AC_ARG_ENABLE(video-fbcon,
+AC_HELP_STRING([--enable-video-fbcon], [use framebuffer console video driver [[default=yes]]]),
+ , enable_video_fbcon=yes)
+ if test x$enable_video = xyes -a x$enable_video_fbcon = xyes; then
+ AC_MSG_CHECKING(for framebuffer console support)
+ video_fbcon=no
+ AC_TRY_COMPILE([
+ #include <linux/fb.h>
+ #include <linux/kd.h>
+ #include <linux/keyboard.h>
+ ],[
+ ],[
+ video_fbcon=yes
+ ])
+ AC_MSG_RESULT($video_fbcon)
+ if test x$video_fbcon = xyes; then
+ AC_CHECK_FUNCS(getpagesize)
+ AC_DEFINE(SDL_VIDEO_DRIVER_FBCON)
+ SOURCES="$SOURCES $srcdir/src/video/fbcon/*.c"
+ have_video=yes
+ fi
+ fi
+}
+
+dnl Find DirectFB
+CheckDirectFB()
+{
+ AC_ARG_ENABLE(video-directfb,
+AC_HELP_STRING([--enable-video-directfb], [use DirectFB video driver [[default=yes]]]),
+ , enable_video_directfb=yes)
+ if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
+ video_directfb=no
+
+ DIRECTFB_REQUIRED_VERSION=0.9.15
+
+ AC_PATH_PROG(DIRECTFBCONFIG, directfb-config, no)
+ if test x$DIRECTFBCONFIG = xno; then
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+ if test x$PKG_CONFIG != xno; then
+ if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb; then
+ DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
+ DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
+ video_directfb=yes
+ fi
+ fi
+ else
+ set -- `echo $DIRECTFB_REQUIRED_VERSION | sed 's/\./ /g'`
+ NEED_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
+ set -- `directfb-config --version | sed 's/\./ /g'`
+ HAVE_VERSION=`expr $1 \* 10000 + $2 \* 100 + $3`
+ if test $HAVE_VERSION -ge $NEED_VERSION; then
+ DIRECTFB_CFLAGS=`$DIRECTFBCONFIG --cflags`
+ DIRECTFB_LIBS=`$DIRECTFBCONFIG --libs`
+ video_directfb=yes
+ fi
+ fi
+ if test x$video_directfb = xyes; then
+ # SuSE 11.1 installs directfb-config without directfb-devel
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $DIRECTFB_CFLAGS"
+ AC_CHECK_HEADER(directfb.h, have_directfb_hdr=yes, have_directfb_hdr=no)
+ CFLAGS="$save_CFLAGS"
+ video_directfb=$have_directfb_hdr
+ fi
+ AC_MSG_CHECKING(for DirectFB $DIRECTFB_REQUIRED_VERSION support)
+ AC_MSG_RESULT($video_directfb)
+
+ if test x$video_directfb = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB)
+ SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
+ have_video=yes
+ fi
+ fi
+}
+
+dnl See if we're running on PlayStation 2 hardware
+CheckPS2GS()
+{
+ AC_ARG_ENABLE(video-ps2gs,
+AC_HELP_STRING([--enable-video-ps2gs], [use PlayStation 2 GS video driver [[default=yes]]]),
+ , enable_video_ps2gs=yes)
+ if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then
+ AC_MSG_CHECKING(for PlayStation 2 GS support)
+ video_ps2gs=no
+ AC_TRY_COMPILE([
+ #include <linux/ps2/dev.h>
+ #include <linux/ps2/gs.h>
+ ],[
+ ],[
+ video_ps2gs=yes
+ ])
+ AC_MSG_RESULT($video_ps2gs)
+ if test x$video_ps2gs = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_PS2GS)
+ SOURCES="$SOURCES $srcdir/src/video/ps2gs/*.c"
+ have_video=yes
+ fi
+ fi
+}
+
+dnl See if we're running on PlayStation 3 Cell hardware
+CheckPS3()
+{
+ AC_ARG_ENABLE(video-ps3,
+ AC_HELP_STRING([--enable-video-ps3], [use PlayStation 3 Cell driver [[default=yes]]]),
+ , enable_video_ps3=yes)
+ if test x$enable_video = xyes -a x$enable_video_ps3 = xyes; then
+ AC_MSG_CHECKING(for PlayStation 3 Cell support)
+ video_ps3=no
+ AC_TRY_COMPILE([
+ #include <linux/fb.h>
+ #include <asm/ps3fb.h>
+ #include <libspe2.h>
+ ],[
+ ],[
+ video_ps3=yes
+ ])
+ AC_MSG_RESULT($video_ps3)
+ if test x$video_ps3 = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_PS3)
+ SOURCES="$SOURCES $srcdir/src/video/ps3/*.c"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -I/opt/cell/sdk/usr/include"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lbilin_scaler_spu -lfb_writer_spu -lyuv2rgb_spu -L/opt/cell/sdk/usr/lib -lspe2"
+ have_video=yes
+ fi
+ fi
+}
+
+dnl Find the GGI includes
+CheckGGI()
+{
+ AC_ARG_ENABLE(video-ggi,
+AC_HELP_STRING([--enable-video-ggi], [use GGI video driver [[default=no]]]),
+ , enable_video_ggi=no)
+ if test x$enable_video = xyes -a x$enable_video_ggi = xyes; then
+ AC_MSG_CHECKING(for GGI support)
+ video_ggi=no
+ AC_TRY_COMPILE([
+ #include <ggi/ggi.h>
+ #include <ggi/gii.h>
+ ],[
+ ],[
+ video_ggi=yes
+ ])
+ AC_MSG_RESULT($video_ggi)
+ if test x$video_ggi = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_GGI)
+ SOURCES="$SOURCES $srcdir/src/video/ggi/*.c"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lggi -lgii -lgg"
+ have_video=yes
+ fi
+ fi
+}
+
+dnl Find the SVGAlib includes and libraries
+CheckSVGA()
+{
+ AC_ARG_ENABLE(video-svga,
+AC_HELP_STRING([--enable-video-svga], [use SVGAlib video driver [[default=yes]]]),
+ , enable_video_svga=yes)
+ if test x$enable_video = xyes -a x$enable_video_svga = xyes; then
+ AC_MSG_CHECKING(for SVGAlib (1.4.0+) support)
+ video_svga=no
+ AC_TRY_COMPILE([
+ #include <vga.h>
+ #include <vgamouse.h>
+ #include <vgakeyboard.h>
+ ],[
+ if ( SCANCODE_RIGHTWIN && SCANCODE_LEFTWIN ) {
+ exit(0);
+ }
+ ],[
+ video_svga=yes
+ ])
+ AC_MSG_RESULT($video_svga)
+ if test x$video_svga = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_SVGALIB)
+ SOURCES="$SOURCES $srcdir/src/video/svga/*.c"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvga"
+ have_video=yes
+ fi
+ fi
+}
+
+dnl Find the VGL includes and libraries
+CheckVGL()
+{
+ AC_ARG_ENABLE(video-vgl,
+AC_HELP_STRING([--enable-video-vgl], [use VGL video driver [[default=yes]]]),
+ , enable_video_vgl=yes)
+ if test x$enable_video = xyes -a x$enable_video_vgl = xyes; then
+ AC_MSG_CHECKING(for libVGL support)
+ video_vgl=no
+ AC_TRY_COMPILE([
+ #include <sys/fbio.h>
+ #include <sys/consio.h>
+ #include <sys/kbio.h>
+ #include <vgl.h>
+ ],[
+ VGLBitmap bitmap;
+ bitmap.Type = VIDBUF32;
+ bitmap.PixelBytes = 4;
+ exit(bitmap.Bitmap);
+ ],[
+ video_vgl=yes
+ ])
+ AC_MSG_RESULT($video_vgl)
+ if test x$video_vgl = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_VGL)
+ SOURCES="$SOURCES $srcdir/src/video/vgl/*.c"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvgl"
+ have_video=yes
+ fi
+ fi
+}
+
+dnl Set up the wscons video driver if enabled
+CheckWscons()
+{
+ AC_ARG_ENABLE(video-wscons,
+AC_HELP_STRING([--enable-video-wscons], [use wscons video driver [[default=yes]]]),
+ , enable_video_wscons=yes)
+ if test x$enable_video = xyes -a x$enable_video_wscons = xyes; then
+ AC_MSG_CHECKING(for wscons support)
+ video_wscons=no
+ AC_TRY_COMPILE([
+ #include <sys/time.h>
+ #include <dev/wscons/wsconsio.h>
+ #include <dev/wscons/wsdisplay_usl_io.h>
+ ],[
+ int wsmode = WSDISPLAYIO_MODE_DUMBFB;
+ ],[
+ video_wscons=yes
+ ])
+ AC_MSG_RESULT($video_wscons)
+ if test x$video_wscons = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_WSCONS)
+ SOURCES="$SOURCES $srcdir/src/video/wscons/*.c"
+ have_video=yes
+ fi
+ fi
+}
+
+
+dnl Find the AAlib includes
+CheckAAlib()
+{
+ AC_ARG_ENABLE(video-aalib,
+AC_HELP_STRING([--enable-video-aalib], [use AAlib video driver [[default=no]]]),
+ , enable_video_aalib=no)
+ if test x$enable_video = xyes -a x$enable_video_aalib = xyes; then
+ AC_MSG_CHECKING(for AAlib support)
+ video_aalib=no
+ AC_TRY_COMPILE([
+ #include <aalib.h>
+ ],[
+ ],[
+ video_aalib=yes
+ ])
+ AC_MSG_RESULT($video_aalib)
+ if test x$video_aalib = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_AALIB)
+ SOURCES="$SOURCES $srcdir/src/video/aalib/*.c"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laa"
+ have_video=yes
+ fi
+ fi
+}
+
+dnl Find the libcaca includes
+CheckCaca()
+{
+ AC_ARG_ENABLE(video-caca,
+AC_HELP_STRING([--enable-video-caca], [use libcaca video driver [[default=no]]]),
+ , enable_video_caca=no)
+ if test x$enable_video = xyes -a x$enable_video_caca = xyes; then
+ video_caca=no
+ AC_PATH_PROG(CACACONFIG, caca-config, no)
+ if test x$CACACONFIG != xno; then
+ AC_MSG_CHECKING(for libcaca support)
+ CACA_CFLAGS=`$CACACONFIG --cflags`
+ CACA_LDFLAGS=`$CACACONFIG --libs`
+ save_CFLAGS="$CFLAGS"
+ AC_TRY_COMPILE([
+ #include <caca.h>
+ ],[
+ ],[
+ video_caca=yes
+ ])
+ CFLAGS="$save_CFLAGS"
+ AC_MSG_RESULT($video_caca)
+ if test x$video_caca = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_CACA)
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $CACA_CFLAGS"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $CACA_LDFLAGS"
+ SOURCES="$SOURCES $srcdir/src/video/caca/*.c"
+ fi
+ fi
+ fi
+}
+
+dnl Set up the QTopia video driver if enabled
+CheckQtopia()
+{
+ AC_ARG_ENABLE(video-qtopia,
+AC_HELP_STRING([--enable-video-qtopia], [use Qtopia video driver [[default=no]]]),
+ , enable_video_qtopia=no)
+ if test x$enable_video = xyes -a x$enable_video_qtopia = xyes; then
+ AC_MSG_CHECKING(for Qtopia support)
+ video_qtopia=no
+ QTOPIA_FLAGS="-DQT_QWS_EBX -DQT_QWS_CUSTOM -DQWS -I${QPEDIR}/include -I${QTDIR}/include/ -DNO_DEBUG -fno-rtti -fno-exceptions"
+ AC_LANG_CPLUSPLUS
+ OLD_CXX="$CXXFLAGS"
+ CXXFLAGS="$QTOPIA_FLAGS"
+ AC_TRY_COMPILE([
+ #include <qpe/qpeapplication.h>
+ ],[
+ ],[
+ video_qtopia=yes
+ ])
+ CXXFLAGS="$OLD_CXX"
+ AC_MSG_RESULT($video_qtopia)
+ if test x$video_qtopia = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_QTOPIA)
+ SOURCES="$SOURCES $srcdir/src/video/qtopia/*.cc"
+ SDLMAIN_SOURCES="$srcdir/src/main/qtopia/*.cc"
+ SDLMAIN_LDFLAGS="-static"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $QTOPIA_FLAGS"
+ SDL_CFLAGS="$SDL_CFLAGS -DQWS -Dmain=SDL_main"
+ SDL_LIBS="-lSDLmain $SDL_LIBS -L${QPEDIR}/lib -L${QTDIR}/lib/ -lqpe -lqte"
+ have_video=yes
+ fi
+ AC_LANG_C
+ fi
+}
+
+dnl Set up the PicoGUI video driver if enabled
+CheckPicoGUI()
+{
+ AC_ARG_ENABLE(video-picogui,
+AC_HELP_STRING([--enable-video-picogui], [use PicoGUI video driver [[default=no]]]),
+ , enable_video_picogui=no)
+ if test x$enable_video = xyes -a x$enable_video_picogui = xyes; then
+ AC_MSG_CHECKING(for PicoGUI support)
+ video_picogui=no
+ AC_TRY_COMPILE([
+ #include <picogui.h>
+ ],[
+ ],[
+ video_picogui=yes
+ ])
+ AC_MSG_RESULT($video_picogui)
+ if test x$video_picogui = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_PICOGUI)
+ SOURCES="$SOURCES $srcdir/src/video/picogui/*.c"
+ SDL_LIBS="$SDL_LIBS -lpgui"
+ have_video=yes
+ fi
+ fi
+}
+
+dnl Set up the Atari Bios keyboard driver
+CheckAtariBiosEvent()
+{
+ SOURCES="$SOURCES $srcdir/src/video/ataricommon/*.c"
+ SOURCES="$SOURCES $srcdir/src/video/ataricommon/*.S"
+}
+
+dnl Set up the Atari Xbios driver
+CheckAtariXbiosVideo()
+{
+ AC_ARG_ENABLE(xbios,
+AC_HELP_STRING([--enable-video-xbios], [use Atari Xbios video driver [[default=yes]]]),
+ , enable_video_xbios=yes)
+ video_xbios=no
+ if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then
+ video_xbios=yes
+ AC_DEFINE(SDL_VIDEO_DRIVER_XBIOS)
+ SOURCES="$SOURCES $srcdir/src/video/xbios/*.c"
+ have_video=yes
+ fi
+}
+
+dnl Set up the Atari Gem driver
+CheckAtariGemVideo()
+{
+ AC_ARG_ENABLE(gem,
+AC_HELP_STRING([--enable-video-gem], [use Atari Gem video driver [[default=yes]]]),
+ , enable_video_gem=yes)
+ if test x$enable_video = xyes -a x$enable_video_gem = xyes; then
+ video_gem=no
+ AC_CHECK_HEADER(gem.h, have_gem_hdr=yes)
+ AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes)
+ if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then
+ video_gem=yes
+ AC_DEFINE(SDL_VIDEO_DRIVER_GEM)
+ SOURCES="$SOURCES $srcdir/src/video/gem/*.c"
+ SDL_LIBS="$SDL_LIBS -lgem"
+ have_video=yes
+ fi
+ fi
+}
+
+dnl rcg04172001 Set up the Null video driver.
+CheckDummyVideo()
+{
+ AC_ARG_ENABLE(video-dummy,
+AC_HELP_STRING([--enable-video-dummy], [use dummy video driver [[default=yes]]]),
+ , enable_video_dummy=yes)
+ if test x$enable_video_dummy = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY)
+ SOURCES="$SOURCES $srcdir/src/video/dummy/*.c"
+ have_video=yes
+ fi
+}
+
+dnl Check to see if OpenGL support is desired
+AC_ARG_ENABLE(video-opengl,
+AC_HELP_STRING([--enable-video-opengl], [include OpenGL context creation [[default=yes]]]),
+ , enable_video_opengl=yes)
+
+dnl Find OpenGL
+CheckOpenGLX11()
+{
+ if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
+ AC_MSG_CHECKING(for OpenGL (GLX) support)
+ video_opengl=no
+ AC_TRY_COMPILE([
+ #include <GL/gl.h>
+ #include <GL/glx.h>
+ #include <GL/glu.h>
+ ],[
+ ],[
+ video_opengl=yes
+ ])
+ AC_MSG_RESULT($video_opengl)
+ if test x$video_opengl = xyes; then
+ AC_DEFINE(SDL_VIDEO_OPENGL)
+ AC_DEFINE(SDL_VIDEO_OPENGL_GLX)
+ fi
+ fi
+}
+
+dnl Find QNX RtP OpenGL
+CheckOpenGLQNX()
+{
+ if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
+ AC_MSG_CHECKING(for OpenGL (Photon) support)
+ video_opengl=no
+ AC_TRY_COMPILE([
+ #include <GL/gl.h>
+ ],[
+ ],[
+ video_opengl=yes
+ ])
+ AC_MSG_RESULT($video_opengl)
+ if test x$video_opengl = xyes; then
+ AC_DEFINE(SDL_VIDEO_OPENGL)
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
+ fi
+ fi
+}
+
+dnl Check for Win32 OpenGL
+CheckWIN32GL()
+{
+ if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
+ AC_DEFINE(SDL_VIDEO_OPENGL)
+ AC_DEFINE(SDL_VIDEO_OPENGL_WGL)
+ fi
+}
+
+dnl Check for BeOS OpenGL
+CheckBeGL()
+{
+ if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
+ AC_DEFINE(SDL_VIDEO_OPENGL)
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
+ fi
+}
+
+dnl Check for MacOS OpenGL
+CheckMacGL()
+{
+ if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
+ AC_DEFINE(SDL_VIDEO_OPENGL)
+ case "$host" in
+ *-*-darwin*)
+ if test x$enable_video_cocoa = xyes; then
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,OpenGL"
+ fi
+ if test x$enable_video_carbon = xyes; then
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AGL"
+ fi
+ esac
+ fi
+}
+
+dnl Check for Mesa offscreen rendering
+CheckAtariOSMesa()
+{
+ if test "x$enable_video" = "xyes" -a "x$enable_video_opengl" = "xyes"; then
+ AC_CHECK_HEADER(GL/osmesa.h, have_osmesa_hdr=yes)
+ AC_CHECK_LIB(OSMesa, OSMesaCreateContext, have_osmesa_lib=yes, have_osmesa_lib=no, -lm)
+
+ # Static linking to -lOSMesa
+ AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
+ if test "x$OSMESA_CONFIG" = "xno" -o "x$enable_atari_ldg" = "xno"; then
+ # -lOSMesa is really the static library
+ if test "x$have_osmesa_hdr" = "xyes" -a "x$have_osmesa_lib" = "xyes"; then
+ OSMESA_LIBS="-lOSMesa"
+ fi
+ else
+ # -lOSMesa is a loader for OSMesa.ldg
+ OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
+ OSMESA_LIBS=`$OSMESA_CONFIG --libs`
+ fi
+ AC_DEFINE(SDL_VIDEO_OPENGL)
+ AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA)
+ SDL_CFLAGS="$SDL_CFLAGS $OSMESA_CFLAGS"
+ SDL_LIBS="$SDL_LIBS $OSMESA_LIBS"
+
+ AC_ARG_ENABLE(osmesa-shared,
+AC_HELP_STRING([--enable-osmesa-shared], [dynamically load OSMesa OpenGL support [[default=yes]]]),
+ , enable_osmesa_shared=yes)
+ if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then
+ # Dynamic linking
+ if test "x$have_osmesa_hdr" = "xyes"; then
+ AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA_DYNAMIC)
+ fi
+ fi
+ fi
+}
+
+AC_ARG_ENABLE(screensaver,
+AC_HELP_STRING([--enable-screensaver], [enable screensaver by default while any SDL application is running [[default=no]]]),
+ , enable_screensaver=no)
+if test x$enable_screensaver = xno; then
+ AC_DEFINE(SDL_VIDEO_DISABLE_SCREENSAVER)
+fi
+
+dnl See if we can use the new unified event interface in Linux 2.4
+CheckInputEvents()
+{
+ dnl Check for Linux 2.4 unified input event interface support
+ AC_ARG_ENABLE(input-events,
+AC_HELP_STRING([--enable-input-events], [use Linux 2.4 unified input interface [[default=yes]]]),
+ , enable_input_events=yes)
+ if test x$enable_input_events = xyes; then
+ AC_MSG_CHECKING(for Linux 2.4 unified input interface)
+ use_input_events=no
+ AC_TRY_COMPILE([
+ #include <linux/input.h>
+ ],[
+ #ifndef EVIOCGNAME
+ #error EVIOCGNAME() ioctl not available
+ #endif
+ ],[
+ use_input_events=yes
+ ])
+ AC_MSG_RESULT($use_input_events)
+ if test x$use_input_events = xyes; then
+ AC_DEFINE(SDL_INPUT_LINUXEV)
+ fi
+ fi
+}
+
+dnl See if we can use the Touchscreen input library
+CheckTslib()
+{
+ AC_ARG_ENABLE(input-tslib,
+AC_HELP_STRING([--enable-input-tslib], [use the Touchscreen library for input [[default=yes]]]),
+ , enable_input_tslib=yes)
+ if test x$enable_input_tslib = xyes; then
+ AC_MSG_CHECKING(for Touchscreen library support)
+ enable_input_tslib=no
+ AC_TRY_COMPILE([
+ #include "tslib.h"
+ ],[
+ ],[
+ enable_input_tslib=yes
+ ])
+ AC_MSG_RESULT($enable_input_tslib)
+ if test x$enable_input_tslib = xyes; then
+ AC_DEFINE(SDL_INPUT_TSLIB)
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts"
+ fi
+ fi
+}
+
+dnl See if we can use GNU pth library for threads
+CheckPTH()
+{
+ dnl Check for pth support
+ AC_ARG_ENABLE(pth,
+AC_HELP_STRING([--enable-pth], [use GNU pth library for multi-threading [[default=yes]]]),
+ , enable_pth=yes)
+ if test x$enable_threads = xyes -a x$enable_pth = xyes; then
+ AC_PATH_PROG(PTH_CONFIG, pth-config, no)
+ if test "$PTH_CONFIG" = "no"; then
+ use_pth=no
+ else
+ use_pth=yes
+ fi
+ AC_MSG_CHECKING(pth)
+ AC_MSG_RESULT($use_pth)
+ if test "x$use_pth" = xyes; then
+ AC_DEFINE(SDL_THREAD_PTH)
+ SOURCES="$SOURCES $srcdir/src/thread/pth/*.c"
+ SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
+ SDL_CFLAGS="$SDL_CFLAGS `$PTH_CONFIG --cflags`"
+ SDL_LIBS="$SDL_LIBS `$PTH_CONFIG --libs --all`"
+ have_threads=yes
+ fi
+ fi
+}
+
+dnl See what type of thread model to use on Linux and Solaris
+CheckPTHREAD()
+{
+ dnl Check for pthread support
+ AC_ARG_ENABLE(pthreads,
+AC_HELP_STRING([--enable-pthreads], [use POSIX threads for multi-threading [[default=yes]]]),
+ , enable_pthreads=yes)
+ dnl This is used on Linux for glibc binary compatibility (Doh!)
+ AC_ARG_ENABLE(pthread-sem,
+AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]),
+ , enable_pthread_sem=yes)
+ case "$host" in
+ *-*-linux*|*-*-uclinux*)
+ pthread_cflags="-D_REENTRANT"
+ pthread_lib="-lpthread"
+ ;;
+ *-*-bsdi*)
+ pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
+ pthread_lib=""
+ ;;
+ *-*-darwin*)
+ pthread_cflags="-D_THREAD_SAFE"
+# causes Carbon.p complaints?
+# pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
+ ;;
+ *-*-freebsd*|*-*-dragonfly*)
+ pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
+ pthread_lib="-pthread"
+ ;;
+ *-*-netbsd*)
+ pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
+ pthread_lib="-lpthread"
+ ;;
+ *-*-openbsd*)
+ pthread_cflags="-D_REENTRANT"
+ pthread_lib="-pthread"
+ ;;
+ *-*-solaris*)
+ pthread_cflags="-D_REENTRANT"
+ pthread_lib="-lpthread -lposix4"
+ ;;
+ *-*-sysv5*)
+ pthread_cflags="-D_REENTRANT -Kthread"
+ pthread_lib=""
+ ;;
+ *-*-irix*)
+ pthread_cflags="-D_SGI_MP_SOURCE"
+ pthread_lib="-lpthread"
+ ;;
+ *-*-aix*)
+ pthread_cflags="-D_REENTRANT -mthreads"
+ pthread_lib="-lpthread"
+ ;;
+ *-*-hpux11*)
+ pthread_cflags="-D_REENTRANT"
+ pthread_lib="-L/usr/lib -lpthread"
+ ;;
+ *-*-qnx*)
+ pthread_cflags=""
+ pthread_lib=""
+ ;;
+ *-*-osf*)
+ pthread_cflags="-D_REENTRANT"
+ if test x$ac_cv_prog_gcc = xyes; then
+ pthread_lib="-lpthread -lrt"
+ else
+ pthread_lib="-lpthread -lexc -lrt"
+ fi
+ ;;
+ *)
+ pthread_cflags="-D_REENTRANT"
+ pthread_lib="-lpthread"
+ ;;
+ esac
+ if test x$enable_threads = xyes -a x$enable_pthreads = xyes -a x$enable_ipod != xyes; then
+ # Save the original compiler flags and libraries
+ ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
+ # Add the pthread compiler flags and libraries
+ CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
+ # Check to see if we have pthread support on this system
+ AC_MSG_CHECKING(for pthreads)
+ use_pthreads=no
+ AC_TRY_LINK([
+ #include <pthread.h>
+ ],[
+ pthread_attr_t type;
+ pthread_attr_init(&type);
+ ],[
+ use_pthreads=yes
+ ])
+ AC_MSG_RESULT($use_pthreads)
+ # Restore the compiler flags and libraries
+ CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
+
+ # Do futher testing if we have pthread support...
+ if test x$use_pthreads = xyes; then
+ AC_DEFINE(SDL_THREAD_PTHREAD)
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib"
+ SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
+ SDL_LIBS="$SDL_LIBS $pthread_lib"
+
+ # Save the original compiler flags and libraries
+ ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"
+ # Add the pthread compiler flags and libraries
+ CFLAGS="$CFLAGS $pthread_cflags"; LIBS="$LIBS $pthread_lib"
+
+ # Check to see if recursive mutexes are available
+ AC_MSG_CHECKING(for recursive mutexes)
+ has_recursive_mutexes=no
+ if test x$has_recursive_mutexes = xno; then
+ AC_TRY_COMPILE([
+ #include <pthread.h>
+ ],[
+ pthread_mutexattr_t attr;
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+ ],[
+ has_recursive_mutexes=yes
+ AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX)
+ ])
+ fi
+ if test x$has_recursive_mutexes = xno; then
+ AC_TRY_COMPILE([
+ #include <pthread.h>
+ ],[
+ pthread_mutexattr_t attr;
+ pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
+ ],[
+ has_recursive_mutexes=yes
+ AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP)
+ ])
+ fi
+ AC_MSG_RESULT($has_recursive_mutexes)
+
+ # Check to see if pthread semaphore support is missing
+ if test x$enable_pthread_sem = xyes; then
+ AC_MSG_CHECKING(for pthread semaphores)
+ have_pthread_sem=no
+ AC_TRY_COMPILE([
+ #include <pthread.h>
+ #include <semaphore.h>
+ ],[
+ ],[
+ have_pthread_sem=yes
+ ])
+ AC_MSG_RESULT($have_pthread_sem)
+ fi
+ if test x$have_pthread_sem = xyes; then
+ AC_MSG_CHECKING(for sem_timedwait)
+ have_sem_timedwait=no
+ AC_TRY_LINK([
+ #include <pthread.h>
+ #include <semaphore.h>
+ ],[
+ sem_timedwait(NULL, NULL);
+ ],[
+ have_sem_timedwait=yes
+ AC_DEFINE(HAVE_SEM_TIMEDWAIT)
+ ])
+ AC_MSG_RESULT($have_sem_timedwait)
+ fi
+
+ # Restore the compiler flags and libraries
+ CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"
+
+ # Basic thread creation functions
+ SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_systhread.c"
+
+ # Semaphores
+ # We can fake these with mutexes and condition variables if necessary
+ if test x$have_pthread_sem = xyes; then
+ SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syssem.c"
+ else
+ SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
+ fi
+
+ # Mutexes
+ # We can fake these with semaphores if necessary
+ SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_sysmutex.c"
+
+ # Condition variables
+ # We can fake these with semaphores and mutexes if necessary
+ SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c"
+
+ have_threads=yes
+ else
+ CheckPTH
+ fi
+ fi
+}
+
+dnl Determine whether the compiler can produce Win32 executables
+CheckWIN32()
+{
+ AC_MSG_CHECKING(Win32 compiler)
+ have_win32_gcc=no
+ AC_TRY_COMPILE([
+ #include <windows.h>
+ ],[
+ ],[
+ have_win32_gcc=yes
+ ])
+ AC_MSG_RESULT($have_win32_gcc)
+ if test x$have_win32_gcc != xyes; then
+ AC_MSG_ERROR([
+*** Your compiler ($CC) does not produce Win32 executables!
+ ])
+ fi
+
+ dnl See if the user wants to redirect standard output to files
+ AC_ARG_ENABLE(stdio-redirect,
+AC_HELP_STRING([--enable-stdio-redirect], [Redirect STDIO to files on Win32 [[default=yes]]]),
+ , enable_stdio_redirect=yes)
+ if test x$enable_stdio_redirect != xyes; then
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -DNO_STDIO_REDIRECT"
+ fi
+
+ if test x$enable_video = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_WINDIB)
+ SOURCES="$SOURCES $srcdir/src/video/wincommon/*.c"
+ SOURCES="$SOURCES $srcdir/src/video/windib/*.c"
+ have_video=yes
+ fi
+}
+
+dnl Find the DirectX includes and libraries
+CheckDIRECTX()
+{
+ AC_ARG_ENABLE(directx,
+AC_HELP_STRING([--enable-directx], [use DirectX for Win32 audio/video [[default=yes]]]),
+ , enable_directx=yes)
+ if test x$enable_directx = xyes; then
+ have_directx=no
+ AC_CHECK_HEADER(ddraw.h, have_ddraw=yes)
+ AC_CHECK_HEADER(dsound.h, have_dsound=yes)
+ AC_CHECK_HEADER(dinput.h, use_dinput=yes)
+ if test x$have_ddraw = xyes -a x$have_dsound = xyes -a x$use_dinput = xyes; then
+ have_directx=yes
+ fi
+ if test x$enable_video = xyes -a x$have_directx = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_DDRAW)
+ SOURCES="$SOURCES $srcdir/src/video/windx5/*.c"
+ have_video=yes
+ fi
+ fi
+}
+
+dnl Check for the dlfcn.h interface for dynamically loading objects
+CheckDLOPEN()
+{
+ AC_ARG_ENABLE(sdl-dlopen,
+AC_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [[default=yes]]]),
+ , enable_sdl_dlopen=yes)
+ if test x$enable_sdl_dlopen = xyes; then
+ AC_MSG_CHECKING(for dlopen)
+ have_dlopen=no
+ AC_TRY_COMPILE([
+ #include <dlfcn.h>
+ ],[
+ #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
+ ],[
+ have_dlopen=yes
+ ])
+ AC_MSG_RESULT($have_dlopen)
+
+ if test x$have_dlopen = xyes; then
+ AC_CHECK_LIB(c, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS",
+ AC_CHECK_LIB(dl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl",
+ AC_CHECK_LIB(ltdl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl")))
+ AC_DEFINE(SDL_LOADSO_DLOPEN)
+ SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
+ have_loadso=yes
+ fi
+ fi
+}
+
+dnl Set up the Atari LDG (shared object loader)
+CheckAtariLdg()
+{
+ AC_ARG_ENABLE(atari-ldg,
+AC_HELP_STRING([--enable-atari-ldg], [use Atari LDG for shared object loading [[default=yes]]]),
+ , enable_atari_ldg=yes)
+ if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then
+ AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes)
+ AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem)
+ if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
+ AC_DEFINE(SDL_LOADSO_LDG)
+ SOURCES="$SOURCES $srcdir/src/loadso/mint/*.c"
+ SDL_LIBS="$SDL_LIBS -lldg -lgem"
+ have_loadso=yes
+ fi
+ fi
+}
+
+dnl Check for the usbhid(3) library on *BSD
+CheckUSBHID()
+{
+ if test x$enable_joystick = xyes; then
+ AC_CHECK_LIB(usbhid, hid_init, have_libusbhid=yes)
+ if test x$have_libusbhid = xyes; then
+ AC_CHECK_HEADER(usbhid.h, [USB_CFLAGS="-DHAVE_USBHID_H"])
+ AC_CHECK_HEADER(libusbhid.h, [USB_CFLAGS="-DHAVE_LIBUSBHID_H"])
+ USB_LIBS="$USB_LIBS -lusbhid"
+ else
+ AC_CHECK_HEADER(usb.h, [USB_CFLAGS="-DHAVE_USB_H"])
+ AC_CHECK_HEADER(libusb.h, [USB_CFLAGS="-DHAVE_LIBUSB_H"])
+ AC_CHECK_LIB(usb, hid_init, [USB_LIBS="$USB_LIBS -lusb"])
+ fi
+
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $USB_CFLAGS"
+
+ AC_MSG_CHECKING(for usbhid)
+ have_usbhid=no
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #if defined(HAVE_USB_H)
+ #include <usb.h>
+ #endif
+ #ifdef __DragonFly__
+ # include <bus/usb/usb.h>
+ # include <bus/usb/usbhid.h>
+ #else
+ # include <dev/usb/usb.h>
+ # include <dev/usb/usbhid.h>
+ #endif
+ #if defined(HAVE_USBHID_H)
+ #include <usbhid.h>
+ #elif defined(HAVE_LIBUSB_H)
+ #include <libusb.h>
+ #elif defined(HAVE_LIBUSBHID_H)
+ #include <libusbhid.h>
+ #endif
+ ],[
+ struct report_desc *repdesc;
+ struct usb_ctl_report *repbuf;
+ hid_kind_t hidkind;
+ ],[
+ have_usbhid=yes
+ ])
+ AC_MSG_RESULT($have_usbhid)
+
+ if test x$have_usbhid = xyes; then
+ AC_MSG_CHECKING(for ucr_data member of usb_ctl_report)
+ have_usbhid_ucr_data=no
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #if defined(HAVE_USB_H)
+ #include <usb.h>
+ #endif
+ #ifdef __DragonFly__
+ # include <bus/usb/usb.h>
+ # include <bus/usb/usbhid.h>
+ #else
+ # include <dev/usb/usb.h>
+ # include <dev/usb/usbhid.h>
+ #endif
+ #if defined(HAVE_USBHID_H)
+ #include <usbhid.h>
+ #elif defined(HAVE_LIBUSB_H)
+ #include <libusb.h>
+ #elif defined(HAVE_LIBUSBHID_H)
+ #include <libusbhid.h>
+ #endif
+ ],[
+ struct usb_ctl_report buf;
+ if (buf.ucr_data) { }
+ ],[
+ have_usbhid_ucr_data=yes
+ ])
+ if test x$have_usbhid_ucr_data = xyes; then
+ USB_CFLAGS="$USB_CFLAGS -DUSBHID_UCR_DATA"
+ fi
+ AC_MSG_RESULT($have_usbhid_ucr_data)
+
+ AC_MSG_CHECKING(for new usbhid API)
+ have_usbhid_new=no
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #if defined(HAVE_USB_H)
+ #include <usb.h>
+ #endif
+ #ifdef __DragonFly__
+ #include <bus/usb/usb.h>
+ #include <bus/usb/usbhid.h>
+ #else
+ #include <dev/usb/usb.h>
+ #include <dev/usb/usbhid.h>
+ #endif
+ #if defined(HAVE_USBHID_H)
+ #include <usbhid.h>
+ #elif defined(HAVE_LIBUSB_H)
+ #include <libusb.h>
+ #elif defined(HAVE_LIBUSBHID_H)
+ #include <libusbhid.h>
+ #endif
+ ],[
+ report_desc_t d;
+ hid_start_parse(d, 1, 1);
+ ],[
+ have_usbhid_new=yes
+ ])
+ if test x$have_usbhid_new = xyes; then
+ USB_CFLAGS="$USB_CFLAGS -DUSBHID_NEW"
+ fi
+ AC_MSG_RESULT($have_usbhid_new)
+
+ AC_MSG_CHECKING(for struct joystick in machine/joystick.h)
+ have_machine_joystick=no
+ AC_TRY_COMPILE([
+ #include <machine/joystick.h>
+ ],[
+ struct joystick t;
+ ],[
+ have_machine_joystick=yes
+ ])
+ if test x$have_machine_joystick = xyes; then
+ AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H)
+ fi
+ AC_MSG_RESULT($have_machine_joystick)
+
+ AC_DEFINE(SDL_JOYSTICK_USBHID)
+ SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
+ have_joystick=yes
+ fi
+ CFLAGS="$save_CFLAGS"
+ fi
+}
+
+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)
+ if test x$enable_clock_gettime = xyes; then
+ AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
+ if test x$have_clock_gettime = xyes; then
+ AC_DEFINE(HAVE_CLOCK_GETTIME)
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
+ fi
+ fi
+}
+
+dnl Check for a valid linux/version.h
+CheckLinuxVersion()
+{
+ AC_CHECK_HEADER(linux/version.h, have_linux_version_h=yes)
+ if test x$have_linux_version_h = xyes; then
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_LINUX_VERSION_H"
+ fi
+}
+
+dnl Check if we want to use RPATH
+CheckRPATH()
+{
+ AC_ARG_ENABLE(rpath,
+AC_HELP_STRING([--enable-rpath], [use an rpath when linking SDL [[default=yes]]]),
+ , enable_rpath=yes)
+}
+
+dnl Set up the configuration based on the host platform!
+case "$host" in
+ arm-*-elf*) # FIXME: Can we get more specific for iPodLinux?
+ ARCH=linux
+ CheckDummyVideo
+ CheckIPod
+ # Set up files for the timer library
+ if test x$enable_timers = xyes; then
+ AC_DEFINE(SDL_TIMER_UNIX)
+ SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
+ have_timers=yes
+ fi
+ ;;
+ *-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*)
+ case "$host" in
+ *-*-linux*) ARCH=linux ;;
+ *-*-uclinux*) ARCH=linux ;;
+ *-*-kfreebsd*-gnu) ARCH=kfreebsd-gnu ;;
+ *-*-knetbsd*-gnu) ARCH=knetbsd-gnu ;;
+ *-*-kopenbsd*-gnu) ARCH=kopenbsd-gnu ;;
+ *-*-gnu*) ARCH=gnu ;; # must be last of the gnu variants
+ *-*-bsdi*) ARCH=bsdi ;;
+ *-*-freebsd*) ARCH=freebsd ;;
+ *-*-dragonfly*) ARCH=freebsd ;;
+ *-*-netbsd*) ARCH=netbsd ;;
+ *-*-openbsd*) ARCH=openbsd ;;
+ *-*-sysv5*) ARCH=sysv5 ;;
+ *-*-solaris*) ARCH=solaris ;;
+ *-*-hpux*) ARCH=hpux ;;
+ *-*-irix*) ARCH=irix ;;
+ *-*-aix*) ARCH=aix ;;
+ *-*-osf*) ARCH=osf ;;
+ esac
+ CheckVisibilityHidden
+ CheckDummyVideo
+ CheckDiskAudio
+ CheckDummyAudio
+ CheckDLOPEN
+ CheckNASM
+ CheckAltivec
+ CheckOSS
+ CheckDMEDIA
+ CheckMME
+ CheckALSA
+ CheckARTSC
+ CheckESD
+ CheckPulseAudio
+ CheckNAS
+ CheckX11
+ CheckNANOX
+ CheckFBCON
+ CheckDirectFB
+ CheckPS2GS
+ CheckPS3
+ CheckGGI
+ CheckSVGA
+ CheckVGL
+ CheckWscons
+ CheckAAlib
+ CheckCaca
+ CheckQtopia
+ CheckPicoGUI
+ CheckOpenGLX11
+ CheckInputEvents
+ CheckTslib
+ CheckUSBHID
+ CheckPTHREAD
+ CheckClockGettime
+ CheckLinuxVersion
+ CheckRPATH
+ # Set up files for the audio library
+ if test x$enable_audio = xyes; then
+ case $ARCH in
+ sysv5|solaris|hpux)
+ AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
+ SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
+ have_audio=yes
+ ;;
+ netbsd|openbsd)
+ AC_DEFINE(SDL_AUDIO_DRIVER_BSD)
+ SOURCES="$SOURCES $srcdir/src/audio/bsd/*.c"
+ have_audio=yes
+ ;;
+ aix)
+ AC_DEFINE(SDL_AUDIO_DRIVER_PAUD)
+ SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
+ have_audio=yes
+ ;;
+ esac
+ fi
+ # Set up files for the joystick library
+ if test x$enable_joystick = xyes; then
+ case $ARCH in
+ linux)
+ AC_DEFINE(SDL_JOYSTICK_LINUX)
+ SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
+ have_joystick=yes
+ ;;
+ esac
+ fi
+ # Set up files for the cdrom library
+ if test x$enable_cdrom = xyes; then
+ case $ARCH in
+ linux|solaris)
+ AC_DEFINE(SDL_CDROM_LINUX)
+ SOURCES="$SOURCES $srcdir/src/cdrom/linux/*.c"
+ have_cdrom=yes
+ ;;
+ *freebsd*)
+ AC_DEFINE(SDL_CDROM_FREEBSD)
+ SOURCES="$SOURCES $srcdir/src/cdrom/freebsd/*.c"
+ have_cdrom=yes
+ ;;
+ *openbsd*|*netbsd*)
+ AC_DEFINE(SDL_CDROM_OPENBSD)
+ SOURCES="$SOURCES $srcdir/src/cdrom/openbsd/*.c"
+ have_cdrom=yes
+ ;;
+ bsdi)
+ AC_DEFINE(SDL_CDROM_BSDI)
+ SOURCES="$SOURCES $srcdir/src/cdrom/bsdi/*.c"
+ have_cdrom=yes
+ ;;
+ aix)
+ AC_DEFINE(SDL_CDROM_AIX)
+ SOURCES="$SOURCES $srcdir/src/cdrom/aix/*.c"
+ have_cdrom=yes
+ ;;
+ osf)
+ AC_DEFINE(SDL_CDROM_OSF)
+ SOURCES="$SOURCES $srcdir/src/cdrom/osf/*.c"
+ have_cdrom=yes
+ ;;
+ esac
+ fi
+ # Set up files for the thread library
+ if test x$enable_threads = xyes -a x$use_pthreads != xyes -a x$use_pth != xyes -a x$ARCH = xirix; then
+ AC_DEFINE(SDL_THREAD_SPROC)
+ SOURCES="$SOURCES $srcdir/src/thread/irix/*.c"
+ SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
+ SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
+ have_threads=yes
+ fi
+ # Set up files for the timer library
+ if test x$enable_timers = xyes; then
+ AC_DEFINE(SDL_TIMER_UNIX)
+ SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
+ have_timers=yes
+ fi
+ ;;
+ *-*-qnx*)
+ ARCH=qnx
+ CheckDummyVideo
+ CheckDiskAudio
+ CheckDummyAudio
+ # CheckNASM
+ CheckDLOPEN
+ CheckNAS
+ CheckPHOTON
+ CheckX11
+ CheckOpenGLX11
+ CheckPTHREAD
+ # Set up files for the audio library
+ if test x$enable_audio = xyes; then
+ AC_DEFINE(SDL_AUDIO_DRIVER_QNXNTO)
+ SOURCES="$SOURCES $srcdir/src/audio/nto/*.c"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lasound"
+ have_audio=yes
+ fi
+ # Set up files for the cdrom library
+ if test x$enable_cdrom = xyes; then
+ AC_DEFINE(SDL_CDROM_QNX)
+ SOURCES="$SOURCES $srcdir/src/cdrom/qnx/*.c"
+ have_cdrom=yes
+ fi
+ # Set up files for the timer library
+ if test x$enable_timers = xyes; then
+ AC_DEFINE(SDL_TIMER_UNIX)
+ SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
+ have_timers=yes
+ fi
+ ;;
+ *-*-cygwin* | *-*-mingw32*)
+ ARCH=win32
+ if test "$build" != "$host"; then # cross-compiling
+ # Default cross-compile location
+ ac_default_prefix=/usr/local/cross-tools/i386-mingw32
+ else
+ # Look for the location of the tools and install there
+ if test "$BUILD_PREFIX" != ""; then
+ ac_default_prefix=$BUILD_PREFIX
+ fi
+ fi
+ CheckDummyVideo
+ CheckDiskAudio
+ CheckDummyAudio
+ CheckWIN32
+ CheckWIN32GL
+ CheckDIRECTX
+ CheckNASM
+ # Set up files for the audio library
+ if test x$enable_audio = xyes; then
+ AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT)
+ SOURCES="$SOURCES $srcdir/src/audio/windib/*.c"
+ if test x$have_directx = xyes; then
+ AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND)
+ SOURCES="$SOURCES $srcdir/src/audio/windx5/*.c"
+ fi
+ have_audio=yes
+ fi
+ # Set up files for the joystick library
+ if test x$enable_joystick = xyes; then
+ AC_DEFINE(SDL_JOYSTICK_WINMM)
+ SOURCES="$SOURCES $srcdir/src/joystick/win32/*.c"
+ have_joystick=yes
+ fi
+ # Set up files for the cdrom library
+ if test x$enable_cdrom = xyes; then
+ AC_DEFINE(SDL_CDROM_WIN32)
+ SOURCES="$SOURCES $srcdir/src/cdrom/win32/*.c"
+ have_cdrom=yes
+ fi
+ # Set up files for the thread library
+ if test x$enable_threads = xyes; then
+ AC_DEFINE(SDL_THREAD_WIN32)
+ SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_sysmutex.c"
+ SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_syssem.c"
+ SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_systhread.c"
+ SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
+ have_threads=yes
+ fi
+ # Set up files for the timer library
+ if test x$enable_timers = xyes; then
+ AC_DEFINE(SDL_TIMER_WIN32)
+ SOURCES="$SOURCES $srcdir/src/timer/win32/*.c"
+ have_timers=yes
+ fi
+ # Set up files for the shared object loading library
+ if test x$enable_loadso = xyes; then
+ AC_DEFINE(SDL_LOADSO_WIN32)
+ SOURCES="$SOURCES $srcdir/src/loadso/win32/*.c"
+ have_loadso=yes
+ fi
+ # Set up the system libraries we need
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm"
+ if test x$have_directx = xyes; then
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldxguid"
+ fi
+ # The Win32 platform requires special setup
+ SOURCES="$SOURCES $srcdir/src/main/win32/*.rc"
+ SDLMAIN_SOURCES="$srcdir/src/main/win32/*.c"
+ SDLMAIN_LDFLAGS="-static"
+ SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
+ SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
+ ;;
+ *-wince*)
+ ARCH=win32
+ CheckDummyVideo
+ CheckDiskAudio
+ CheckDummyAudio
+ CheckWIN32
+ CheckNASM
+ SOURCES="$SOURCES $srcdir/src/video/gapi/*.c"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -D_WIN32_WCE=0x420"
+ if test x$enable_audio = xyes; then
+ AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT)
+ SOURCES="$SOURCES $srcdir/src/audio/windib/*.c"
+ have_audio=yes
+ fi
+ # Set up files for the thread library
+ if test x$enable_threads = xyes; then
+ AC_DEFINE(SDL_THREAD_WIN32)
+ SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_sysmutex.c"
+ SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_syssem.c"
+ SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_systhread.c"
+ SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
+ have_threads=yes
+ fi
+ # Set up files for the timer library
+ if test x$enable_timers = xyes; then
+ AC_DEFINE(SDL_TIMER_WINCE)
+ SOURCES="$SOURCES $srcdir/src/timer/wince/*.c"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lcoredll -lmmtimer"
+ have_timers=yes
+ fi
+ # Set up files for the shared object loading library
+ if test x$enable_loadso = xyes; then
+ AC_DEFINE(SDL_LOADSO_WIN32)
+ SOURCES="$SOURCES $srcdir/src/loadso/win32/*.c"
+ have_loadso=yes
+ fi
+ # Set up the system libraries we need
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lcoredll -lcommctrl"
+ # The Win32 platform requires special setup
+ SDLMAIN_SOURCES="$srcdir/src/main/win32/*.c"
+ SDLMAIN_LDFLAGS="-static"
+ SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main -D_WIN32_WCE=0x420"
+ SDL_LIBS="-lSDLmain $SDL_LIBS"
+ ;;
+ *-*-beos* | *-*-haiku*)
+ ARCH=beos
+ ac_default_prefix=/boot/develop/tools/gnupro
+ CheckDummyVideo
+ CheckDiskAudio
+ CheckDummyAudio
+ CheckNASM
+ CheckBWINDOW
+ CheckBeGL
+ # Set up files for the audio library
+ if test x$enable_audio = xyes; then
+ AC_DEFINE(SDL_AUDIO_DRIVER_BAUDIO)
+ SOURCES="$SOURCES $srcdir/src/audio/baudio/*.cc"
+ have_audio=yes
+ fi
+ # Set up files for the joystick library
+ if test x$enable_joystick = xyes; then
+ AC_DEFINE(SDL_JOYSTICK_BEOS)
+ SOURCES="$SOURCES $srcdir/src/joystick/beos/*.cc"
+ have_joystick=yes
+ fi
+ # Set up files for the cdrom library
+ if test x$enable_cdrom = xyes; then
+ AC_DEFINE(SDL_CDROM_BEOS)
+ SOURCES="$SOURCES $srcdir/src/cdrom/beos/*.cc"
+ have_cdrom=yes
+ fi
+ # Set up files for the thread library
+ if test x$enable_threads = xyes; then
+ AC_DEFINE(SDL_THREAD_BEOS)
+ SOURCES="$SOURCES $srcdir/src/thread/beos/*.c"
+ SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
+ SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
+ have_threads=yes
+ fi
+ # Set up files for the timer library
+ if test x$enable_timers = xyes; then
+ AC_DEFINE(SDL_TIMER_BEOS)
+ SOURCES="$SOURCES $srcdir/src/timer/beos/*.c"
+ have_timers=yes
+ fi
+ # Set up files for the shared object loading library
+ if test x$enable_loadso = xyes; then
+ case "$host" in
+ *-*-beos*)
+ AC_DEFINE(SDL_LOADSO_BEOS)
+ SOURCES="$SOURCES $srcdir/src/loadso/beos/*.c"
+ ;;
+ *-*-haiku*)
+ AC_DEFINE(SDL_LOADSO_DLOPEN)
+ SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
+ ;;
+ esac
+ have_loadso=yes
+ fi
+ # The BeOS platform requires special setup.
+ SOURCES="$srcdir/src/main/beos/*.cc $SOURCES"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lroot -lbe -lmedia -lgame -ldevice -ltextencoding"
+ ;;
+ *-*-darwin* )
+ # This could be either full "Mac OS X", or plain "Darwin" which is
+ # just the OS X kernel sans upper layers like Carbon and Cocoa.
+ # Next line is broken, and a few files below require Mac OS X (full)
+ ARCH=macosx
+
+ # Mac OS X builds with both the Carbon and OSX APIs at the moment
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_CARBON"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -DTARGET_API_MAC_OSX"
+
+ # HACK: Reset EXTRA_LDFLAGS; the only thing it contains at this point
+ # is -lm which is not needed under Mac OS X. But for some reasons it
+ # also tends to contain spurious -L switches, which we don't want to
+ # use here or in sdl-config. Hence we reset it.
+ EXTRA_LDFLAGS=""
+
+ CheckVisibilityHidden
+ CheckDummyVideo
+ CheckDiskAudio
+ CheckDummyAudio
+ CheckDLOPEN
+ CheckNASM
+
+ # Set up files for the shared object loading library
+ # (this needs to be done before the dynamic X11 check)
+ if test x$enable_loadso = xyes -a x$have_dlopen != xyes; then
+ AC_DEFINE(SDL_LOADSO_DLCOMPAT)
+ SOURCES="$SOURCES $srcdir/src/loadso/macosx/*.c"
+ have_loadso=yes
+ fi
+
+ CheckCOCOA
+ CheckCARBON
+ CheckX11
+ CheckMacGL
+ CheckOpenGLX11
+ CheckPTHREAD
+ CheckAltivec
+
+ # Need this or things might misbuild on a G3.
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -force_cpusubtype_ALL"
+
+ # Set up files for the audio library
+ if test x$enable_audio = xyes; then
+ AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO)
+ SOURCES="$SOURCES $srcdir/src/audio/macosx/*.c"
+ have_audio=yes
+ fi
+ # Set up files for the joystick library
+ if test x$enable_joystick = xyes; then
+ AC_DEFINE(SDL_JOYSTICK_IOKIT)
+ SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
+ have_joystick=yes
+ need_iokit_framework=yes
+ fi
+ # Set up files for the cdrom library
+ if test x$enable_cdrom = xyes; then
+ AC_DEFINE(SDL_CDROM_MACOSX)
+ SOURCES="$SOURCES $srcdir/src/cdrom/macosx/*.c"
+ have_cdrom=yes
+ fi
+ # Set up files for the timer library
+ if test x$enable_timers = xyes; then
+ AC_DEFINE(SDL_TIMER_UNIX)
+ SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
+ have_timers=yes
+ fi
+ # The Mac OS X platform requires special setup.
+ SDLMAIN_SOURCES="$srcdir/src/main/macosx/*.m"
+ SDLMAIN_LDFLAGS="-static"
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"
+ SDL_LIBS="-lSDLmain $SDL_LIBS"
+ if test x$enable_video_cocoa = xyes; then
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Cocoa"
+ need_iokit_framework=yes
+ fi
+ if test x$enable_video_carbon = xyes -o x$enable_video_cocoa = xyes; then
+ # The Cocoa backend still needs Carbon
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,ApplicationServices"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,Carbon"
+ fi
+ # If either the audio or CD driver is used, add the AudioUnit framework
+ if test x$enable_audio = xyes -o x$enable_cdrom = xyes; then
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit"
+ fi
+ # Some subsystems reference IOKit...
+ if test x$need_iokit_framework = xyes; then
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,IOKit"
+ fi
+ ;;
+ *-*-mint*)
+ ARCH=mint
+ CheckDummyVideo
+ CheckDiskAudio
+ CheckDummyAudio
+ CheckAtariBiosEvent
+ CheckAtariXbiosVideo
+ CheckAtariGemVideo
+ CheckAtariAudio
+ CheckAtariLdg
+ CheckAtariOSMesa
+ CheckPTH
+ # Set up files for the audio library
+ if test x$enable_threads = xyes -a x$enable_pth = xyes; then
+ if test x$enable_audio = xyes; then
+ AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
+ SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
+ have_audio=yes
+ fi
+ fi
+ # Set up files for the joystick library
+ if test x$enable_joystick = xyes; then
+ AC_DEFINE(SDL_JOYSTICK_MINT)
+ SOURCES="$SOURCES $srcdir/src/joystick/mint/*.c"
+ have_joystick=yes
+ fi
+ # Set up files for the cdrom library
+ if test x$enable_cdrom = xyes; then
+ AC_DEFINE(SDL_CDROM_MINT)
+ SOURCES="$SOURCES $srcdir/src/cdrom/mint/*.c"
+ have_cdrom=yes
+ fi
+ # Set up files for the timer library
+ if test x$enable_timers = xyes; then
+ if test x$enable_threads = xyes -a x$enable_pth = xyes; then
+ AC_DEFINE(SDL_TIMER_UNIX)
+ SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
+ else
+ AC_DEFINE(SDL_TIMER_MINT)
+ SOURCES="$SOURCES $srcdir/src/timer/mint/*.c"
+ SOURCES="$SOURCES $srcdir/src/timer/mint/*.S"
+ fi
+ have_timers=yes
+ fi
+ ;;
+ *-riscos)
+ ARCH=riscos
+ CheckOSS
+ CheckPTHREAD
+ # Set up files for the video library
+ if test x$enable_video = xyes; then
+ AC_DEFINE(SDL_VIDEO_DRIVER_RISCOS)
+ SOURCES="$SOURCES $srcdir/src/video/riscos/*.c"
+ SOURCES="$SOURCES $srcdir/src/video/riscos/*.S"
+ have_video=yes
+ fi
+ # Set up files for the joystick library
+ if test x$enable_joystick = xyes; then
+ AC_DEFINE(SDL_JOYSTICK_RISCOS)
+ SOURCES="$SOURCES $srcdir/src/joystick/riscos/*.c"
+ have_joystick=yes
+ fi
+ # Set up files for the timer library
+ if test x$enable_timers = xyes; then
+ AC_DEFINE(SDL_TIMER_RISCOS)
+ SOURCES="$SOURCES $srcdir/src/timer/riscos/*.c"
+ have_timers=yes
+ fi
+ # The RISC OS platform requires special setup.
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ljpeg -ltiff -lpng -lz"
+ ;;
+ *)
+ AC_MSG_ERROR([
+*** Unsupported host: Please add to configure.in
+ ])
+ ;;
+esac
+
+dnl Do this on all platforms, after everything else.
+CheckWarnAll
+
+# Verify that we have all the platform specific files we need
+
+if test x$enable_joystick = xyes; then
+ if test x$have_joystick != xyes; then
+ # Wants joystick subsystem, but doesn't have a platform-specific backend...
+ AC_DEFINE(SDL_JOYSTICK_DUMMY)
+ SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
+ fi
+fi
+if test x$have_cdrom != xyes; then
+ if test x$enable_cdrom = xyes; then
+ AC_DEFINE(SDL_CDROM_DISABLED)
+ fi
+ SOURCES="$SOURCES $srcdir/src/cdrom/dummy/*.c"
+fi
+if test x$have_threads != xyes; then
+ if test x$enable_threads = xyes; then
+ AC_DEFINE(SDL_THREADS_DISABLED)
+ fi
+ SOURCES="$SOURCES $srcdir/src/thread/generic/*.c"
+fi
+if test x$have_timers != xyes; then
+ if test x$enable_timers = xyes; then
+ AC_DEFINE(SDL_TIMERS_DISABLED)
+ fi
+ SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c"
+fi
+if test x$have_loadso != xyes; then
+ if test x$enable_loadso = xyes; then
+ AC_DEFINE(SDL_LOADSO_DISABLED)
+ fi
+ SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c"
+fi
+if test x$SDLMAIN_SOURCES = x; then
+ SDLMAIN_SOURCES="$srcdir/src/main/dummy/*.c"
+ SDLMAIN_LDFLAGS="-static"
+fi
+
+OBJECTS=`echo $SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.asm,$(objects)/\1.lo,g'`
+OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.lo,g'`
+OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.lo,g'`
+OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
+OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.S,$(objects)/\1.lo,g'`
+OBJECTS=`echo $OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.lo,g'`
+
+SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES | sed 's,[[^ ]]*/\([[^ ]]*\)\.cc,$(objects)/\1.lo,g'`
+SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.m,$(objects)/\1.lo,g'`
+SDLMAIN_OBJECTS=`echo $SDLMAIN_OBJECTS | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
+
+# Set runtime shared library paths as needed
+
+if test "x$enable_rpath" = "xyes"; then
+ if test $ARCH = bsdi -o $ARCH = freebsd -o $ARCH = irix -o $ARCH = linux -o $ARCH = netbsd; then
+ SDL_RLD_FLAGS="-Wl,-rpath,\${libdir}"
+ fi
+ if test $ARCH = solaris; then
+ SDL_RLD_FLAGS="-R\${libdir}"
+ fi
+else
+ SDL_RLD_FLAGS=""
+fi
+
+case "$ARCH" in
+ macosx)
+ if test x$enable_video = xyes -a x$enable_video_cocoa = xyes; then
+ SDL_LIBS="$SDL_LIBS -Wl,-framework,Cocoa"
+ fi
+ if test x$enable_video = xyes -a x$enable_video_carbon = xyes; then
+ SDL_LIBS="$SDL_LIBS -Wl,-framework,Carbon"
+ fi
+ # Evil hack to allow static linking on Mac OS X
+ SDL_STATIC_LIBS="\${libdir}/libSDLmain.a \${libdir}/libSDL.a $EXTRA_LDFLAGS"
+ ;;
+ *)
+ SDL_STATIC_LIBS="$SDL_LIBS $EXTRA_LDFLAGS"
+ ;;
+esac
+
+dnl Expand the cflags and libraries needed by apps using SDL
+AC_SUBST(SDL_CFLAGS)
+AC_SUBST(SDL_LIBS)
+AC_SUBST(SDL_STATIC_LIBS)
+AC_SUBST(SDL_RLD_FLAGS)
+if test x$enable_shared = xyes; then
+ ENABLE_SHARED_TRUE=
+ ENABLE_SHARED_FALSE="#"
+else
+ ENABLE_SHARED_TRUE="#"
+ ENABLE_SHARED_FALSE=
+fi
+if test x$enable_static = xyes; then
+ ENABLE_STATIC_TRUE=
+ ENABLE_STATIC_FALSE="#"
+else
+ ENABLE_STATIC_TRUE="#"
+ ENABLE_STATIC_FALSE=
+fi
+AC_SUBST(ENABLE_SHARED_TRUE)
+AC_SUBST(ENABLE_SHARED_FALSE)
+AC_SUBST(ENABLE_STATIC_TRUE)
+AC_SUBST(ENABLE_STATIC_FALSE)
+
+dnl Expand the sources and objects needed to build the library
+AC_SUBST(ac_aux_dir)
+AC_SUBST(INCLUDE)
+AC_SUBST(SOURCES)
+AC_SUBST(OBJECTS)
+AC_SUBST(SDLMAIN_SOURCES)
+AC_SUBST(SDLMAIN_OBJECTS)
+AC_SUBST(SDLMAIN_LDFLAGS)
+AC_SUBST(BUILD_CFLAGS)
+AC_SUBST(EXTRA_CFLAGS)
+AC_SUBST(BUILD_LDFLAGS)
+AC_SUBST(EXTRA_LDFLAGS)
+AC_SUBST(WINDRES)
+
+AC_OUTPUT([
+ Makefile sdl-config SDL.spec SDL.qpg sdl.pc
+], [
+ : >build-deps
+ if test x"$MAKE" = x; then MAKE=make; fi; $MAKE depend
+])
diff --git a/distrib/sdl-1.2.15/docs.html b/distrib/sdl-1.2.15/docs.html
new file mode 100644
index 0000000..7916dfa
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs.html
@@ -0,0 +1,698 @@
+<HTML>
+<HEAD><TITLE>SDL Stable Release</TITLE></HEAD>
+<BODY BGCOLOR="#FFEBCD" TEXT="#000000">
+
+<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
+<P>
+This source is stable, and is fully tested on all supported platforms.<br>
+Please send bug reports or questions to the SDL mailing list:<br>
+<a href="http://www.libsdl.org/mailing-list.php"
+ >http://www.libsdl.org/mailing-list.php</a><br>
+The latest stable release may be found on the
+ <a href="http://www.libsdl.org/">SDL website</A>.
+</P>
+
+<H2> <A HREF="docs/index.html">API Documentation</A> </H2>
+
+<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
+
+<H2> SDL 1.2.15 Release Notes </H2>
+<P>
+SDL 1.2.15 is a minor bug fix release.
+</P>
+
+<H3> General Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ Fixed assembly register clobbering in CPU info routines
+</P>
+<P>
+ Fixed memory stomp when using stretch blit on large images
+</P>
+<P>
+ Fixed pixel corruption with overlapping blits
+</P>
+<P>
+ SDL_JOYSTICK_DEVICE can be a colon separated list of joystick devices
+</P>
+<P>
+ Disabled MMX blitters since they don't compile on modern compilers
+</P>
+</BLOCKQUOTE>
+
+<H3> Unix Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ Fixed crash in joystick code on newer Linux kernels
+</P>
+<P>
+ Fixed channel swizzling for ALSA target with 6-channel output
+</P>
+<P>
+ Use the OpenGL GLX_EXT_swap_control extension if available
+</P>
+<P>
+ XRandR support is disabled by default because it causes desktop reconfiguring. It can be enabled with the SDL_VIDEO_X11_XRANDR=1 environment variable, or by applying this patch: <a href="http://hg.libsdl.org/SDL/raw-rev/8ec3036098df">http://hg.libsdl.org/SDL/raw-rev/8ec3036098df</a>
+</P>
+</BLOCKQUOTE>
+
+<H3> Windows Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ Fixed SDL_GL_ACCELERATED_VISUAL handling
+</P>
+<P>
+ Fixed application state handling with ALT-Tab
+</P>
+<P>
+ Fixed occasional crash handling WM_ACTIVATEAPP in Direct X code
+</P>
+<P>
+ Fixed UTF-8 decoding of Russian characters
+</P>
+</BLOCKQUOTE>
+
+<H3> Mac OS X Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ Fixed building and running on Mac OS X 10.7 (Lion)
+</P>
+</BLOCKQUOTE>
+
+<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
+
+<H2> SDL 1.2.14 Release Notes </H2>
+<P>
+SDL 1.2.14 is a significant bug fix release and a recommended update.
+</P>
+
+<H3> General Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ Fixed flicker when resizing the SDL window
+</P>
+<P>
+ Fixed crash in SDL_SetGammaRamp()
+</P>
+<P>
+ Fixed freeze in SDL_memset() with 0 length when assembly code is disabled.
+</P>
+<P>
+ Added SDL_DISABLE_LOCK_KEYS environment variable to enable normal up/down events for Caps-Lock and Num-Lock keys.
+</P>
+<P>
+ Fixed audio quality problem when converting between 22050 Hz and 44100 Hz.
+</P>
+<P>
+ Fixed a threading crash when a few threads are rapidly created and complete.
+</P>
+<P>
+ Increased accuracy of alpha blending routines.
+</P>
+<P>
+ Fixed crash loading BMP files saved with the scanlines inverted.
+</P>
+<P>
+ Fixed mouse coordinate clamping if SDL_SetVideoMode() isn't called in response to SDL_VIDEORESIZE event.
+</P>
+<P>
+ Added doxygen documentation for the SDL API headers.
+</P>
+</BLOCKQUOTE>
+
+<H3> Unix Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ Fixed potential memory corruption due to assembly bug with SDL_revcpy()
+</P>
+<P>
+ Fixed crashes trying to detect SSE features on x86_64 architecture.
+</P>
+<P>
+ Fixed assembly for GCC optimized 50% alpha blending blits.
+</P>
+<P>
+ Added configure option --enable-screensaver, to allow enabling the screensaver by default.
+</P>
+<P>
+ Use XResetScreenSaver() instead of disabling screensaver entirely.
+</P>
+<P>
+ Removed the maximum window size limitation on X11.
+</P>
+<P>
+ Fixed SDL_GL_SWAP_CONTROL on X11.
+</P>
+<P>
+ Fixed setting the X11 window input hint.
+</P>
+<P>
+ Fixed distorted X11 window icon for some visuals.
+</P>
+<P>
+ Fixed detecting X11 libraries for dynamic loading on 64-bit Linux.
+</P>
+<P>
+ SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL) returns the correct value with GLX_SGI_swap_control.
+</P>
+<P>
+ Added SDL_VIDEO_FULLSCREEN_DISPLAY as a preferred synonym for SDL_VIDEO_FULLSCREEN_HEAD on X11.
+</P>
+<P>
+ The SDL_VIDEO_FULLSCREEN_DISPLAY environment variable can be set to 0 to place fullscreen SDL windows on the first Xinerama screen.
+</P>
+<P>
+ Added the SDL_VIDEO_FBCON_ROTATION environment variable to control output orientation on the framebuffer console.
+ <BR>
+ Valid values are:
+ <UL>
+ <LI>not set - Not rotating, no shadow.
+ <LI>"NONE" - Not rotating, but still using shadow.
+ <LI>"CW" - Rotating screen clockwise.
+ <LI>"UD" - Rotating screen upside down.
+ <LI>"CCW" - Rotating screen counter clockwise.
+ </UL>
+</P>
+<P>
+ Fixed DirectFB detection on some Linux distributions.
+</P>
+<P>
+ Added code to use the PS3 SPE processors for YUV conversion on Linux.
+</P>
+<P>
+ Updated ALSA support to the latest stable API
+</P>
+<P>
+ ALSA is now preferred over OSS audio. (SDL_AUDIODRIVER=dsp will restore the previous behavior.)
+</P>
+<P>
+ Improved support for PulseAudio
+</P>
+<P>
+ The Network Audio System support is now dynamically loaded at runtime.
+</P>
+<P>
+ Fixed crash with the MP-8866 Dual USB Joypad on newer Linux kernels.
+</P>
+<P>
+ Fixed crash in SDL_Quit() when a joystick has been unplugged.
+</P>
+</BLOCKQUOTE>
+
+<H3> Windows Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ Verified 100% compatibility with Windows 7.
+</P>
+<P>
+ Prevent loss of OpenGL context when setting the video mode in response to a window resize event.
+</P>
+<P>
+ Fixed video initialization with SDL_WINDOWID on Windows XP.
+</P>
+<P>
+ Improved mouse input responsiveness for first-person-shooter games.
+</P>
+<P>
+ IME messages are now generated for localized input.
+</P>
+<P>
+ SDL_RWFromFile() takes a UTF-8 filename when opening a file.
+</P>
+<P>
+ The SDL_STDIO_REDIRECT environment variable can be used to override whether SDL redirects stdio to stdout.txt and stderr.txt.
+</P>
+<P>
+ Fixed dynamic object loading on Windows CE.
+</P>
+</BLOCKQUOTE>
+
+<H3> Mac OS X Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ SDL now builds on Mac OS X 10.6 (Snow Leopard).
+ <BR>
+ Eric Wing posted a good rundown on the numerous changes here: <A HREF="http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html">http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html</A>
+</P>
+<P>
+ The X11 video driver is built by default.
+</P>
+<P>
+ Fixed SDL_VIDEO_WINDOW_POS environment variable for Quartz target.
+</P>
+<P>
+ Fixed setting the starting working directory in release builds.
+</P>
+</BLOCKQUOTE>
+
+<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
+
+<H2> SDL 1.2.13 Release Notes </H2>
+<P>
+SDL 1.2.13 is a minor bug fix release.
+</P>
+
+<H3> General Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ Fixed link error when building with Intel Compiler 10.
+</P>
+<P>
+ Removed stray C++ comment from public headers.
+</P>
+</BLOCKQUOTE>
+
+<H3> Unix Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ Fixed crash in SDL_SoftStretch() on secure operating systems.
+</P>
+<P>
+ Fixed undefined symbol on X11 implementations without UTF-8 support.
+</P>
+<P>
+ Worked around BadAlloc error when using XVideo on the XFree86 Intel Integrated Graphics driver.
+</P>
+<P>
+ Scan for all joysticks on Linux instead of stopping at one that was removed.
+</P>
+<P>
+ Fixed use of sdl-config arguments in sdl.m4
+</P>
+</BLOCKQUOTE>
+
+<H3> Windows Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ Fixed crash when a video driver reports higher than 32 bpp video modes.
+</P>
+<P>
+ Fixed restoring the desktop after setting a 24-bit OpenGL video mode.
+</P>
+<P>
+ Fixed window titles on Windows 95/98/ME.
+</P>
+<P>
+ Added SDL_BUTTON_X1 and SDL_BUTTON_X2 constants for extended mouse buttons.
+</P>
+<P>
+ Added support for quoted command line arguments.
+</P>
+</BLOCKQUOTE>
+
+<H3> Mac OS X Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ SDL now builds on Mac OS X 10.5 (Leopard).
+</P>
+<P>
+ Fixed high frequency crash involving text input.
+</P>
+<P>
+ Fixed beeping when the escape key is pressed and UNICODE translation is enabled.
+</P>
+<P>
+ Improved trackpad scrolling support.
+</P>
+<P>
+ Fixed joystick hat reporting for certain joysticks.
+</P>
+</BLOCKQUOTE>
+
+<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
+
+<H2> SDL 1.2.12 Release Notes </H2>
+<P>
+SDL 1.2.12 is a minor bug fix release.
+</P>
+
+<H3> General Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ Added support for the PulseAudio sound server: http://www.pulseaudio.org/
+</P>
+<P>
+ Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling of the screensaver on Mac OS X, Windows, and X11.
+</P>
+<P>
+ Fixed buffer overrun crash when resampling audio rates.
+</P>
+<P>
+ Fixed audio bug where converting to mono was doubling the volume.
+</P>
+<P>
+ Fixed off-by-one error in the C implementation of SDL_revcpy()
+</P>
+<P>
+ Fixed compiling with Sun Studio.
+</P>
+<P>
+ Support for AmigaOS has been removed from the main SDL code.
+</P>
+<P>
+ Support for Nokia 9210 "EPOC" driver has been removed from the main SDL code.
+</P>
+<P>
+ Unofficial support for the S60/SymbianOS platform has been added.
+</P>
+<P>
+ Unofficial support for the Nintendo DS platform has been added.
+</P>
+<P>
+ Reenabled MMX assembly for YUV overlay processing (GNU C Compiler only).
+</P>
+</BLOCKQUOTE>
+
+<H3> Unix Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ Fixed detection of X11 DGA mouse support.
+</P>
+<P>
+ Improved XIM support for asian character sets.
+</P>
+<P>
+ The GFX_Display has been added to the X11 window information in SDL_syswm.h.
+</P>
+<P>
+ Fixed PAGE_SIZE compile error in the fbcon video driver on newer Linux kernels.
+</P>
+<P>
+ Fixed hang or crash at startup if aRts can't access the hardware.
+</P>
+<P>
+ Fixed relative mouse mode when the cursor starts outside the X11 window.
+</P>
+<P>
+ Fixed accidental free of stack memory in X11 mouse acceleration code.
+</P>
+<P>
+ Closed minor memory leak in XME code.
+</P>
+<P>
+ Fixed TEXTRELs in the library to resolve some PIC issues.
+</P>
+</BLOCKQUOTE>
+
+<H3> Windows Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ The GDI video driver makes better use of the palette in 8-bit modes.
+</P>
+<P>
+ The windib driver now supports more mouse buttons with WM_XBUTTON events.
+</P>
+<P>
+ On Windows, SDL_SetVideoMode() will re-create the window instead of failing if the multisample settings are changed.
+</P>
+<P>
+ Added support for UTF-8 window titles on Windows.
+</P>
+<P>
+ Fixed joystick detection on Windows.
+</P>
+<P>
+ Improved performance with Win32 file I/O.
+</P>
+<P>
+ Fixed HBITMAP leak in GAPI driver.
+</P>
+</BLOCKQUOTE>
+
+<H3> Mac OS X Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ Added support for multi-axis controllers like 3Dconnxion's SpaceNavigator on Mac OS X.
+</P>
+<P>
+ Fixed YUV overlay crash inside Quicktime on Intel Mac OS X.
+</P>
+<P>
+ Fixed blitting alignment in Altivec alpha blit functions.
+</P>
+<P>
+ Keys F13, F14, and F15 are now usable on Apple keyboards under Mac OS X.
+</P>
+<P>
+ Fixed joystick calibration code on Mac OS X.
+</P>
+<P>
+ Fixed mouse jitter when multiple motion events are queued up in Mac OS X.
+</P>
+<P>
+ Fixed changing the cursor in fullscreen mode on Mac OS X.
+</P>
+</BLOCKQUOTE>
+
+<H3> Mac OS Classic Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ Added support for gamma ramps to both toolbox and DrawSprocket video drivers.
+</P>
+</BLOCKQUOTE>
+
+<H3> BeOS Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ Implemented mouse grabbing and mouse relative mode on BeOS.
+</P>
+</BLOCKQUOTE>
+
+<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
+
+<H2> SDL 1.2.11 Release Notes </H2>
+<P>
+SDL 1.2.11 is a minor bug fix release.
+</P>
+
+<H3> Unix Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ Dynamic X11 loading is only enabled with gcc 4 supporting -fvisibility=hidden. This fixes crashes related to symbol collisions, and allows building on Solaris and IRIX.
+</P>
+<P>
+ Fixed building SDL with Xinerama disabled.
+</P>
+<P>
+ Fixed DRI OpenGL library loading, using RTLD_GLOBAL in dlopen().
+</P>
+<P>
+ Added pkgconfig configuration support.
+</P>
+</BLOCKQUOTE>
+
+<H3> Windows Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ Setting SDL_GL_SWAP_CONTROL now works with Windows OpenGL.
+</P>
+<P>
+ The Win32 window positioning code works properly for windows with menus.
+</P>
+<P>
+ DirectSound audio quality has been improved on certain sound cards.
+</P>
+<P>
+ Fixed 5.1 audio channel ordering on Windows and Mac OS X.
+</P>
+<P>
+ Plugged a couple of minor memory leaks in the windib video driver.
+</P>
+<P>
+ Fixed type collision with stdint.h when building with gcc on Win32.
+</P>
+<P>
+ Fixed building with the Digital Mars Compiler on Win32.
+</P>
+</BLOCKQUOTE>
+
+<H3> Mac OS X Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ The Quartz video driver supports 32x32 cursors on Mac OS X 10.3 and above.
+</P>
+</BLOCKQUOTE>
+
+<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
+
+<H2> SDL 1.2.10 Release Notes </H2>
+<P>
+SDL 1.2.10 is a major release, featuring a revamp of the build system and many API improvements and bug fixes.
+</P>
+<H3> API enhancements </H3>
+<UL>
+<LI>
+ If SDL_OpenAudio() is passed zero for the desired format
+ fields, the following environment variables will be used
+ to fill them in:
+<pre><code>
+ SDL_AUDIO_FREQUENCY
+ SDL_AUDIO_FORMAT
+ SDL_AUDIO_CHANNELS
+ SDL_AUDIO_SAMPLES
+</code></pre>
+ If an environment variable is not specified, it will be set
+ to a reasonable default value.
+<LI>
+ SDL_SetVideoMode() now accepts 0 for width or height and will use
+ the current video mode (or the desktop mode if no mode has been set.)
+<LI>
+ Added current_w and current_h to the SDL_VideoInfo structure,
+ which is set to the desktop resolution during video intialization,
+ and then set to the current resolution when a video mode is set.
+<LI>
+ SDL_GL_LoadLibrary() will load the system default OpenGL library
+ if it is passed NULL as a parameter.
+<LI>
+ Added SDL_GL_SWAP_CONTROL to wait for vsync in OpenGL applications.
+<LI>
+ Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration.
+<LI>
+ SDL_WM_SetCaption() now officially takes UTF-8 title and icon strings, and displays international characters on supported platforms.
+<LI>
+ Added SDL_GetKeyRepeat() to query the key repeat settings.
+<LI>
+ Added the "dummy" audio driver, which can be used to emulate audio
+ output without a sound card.
+<LI>
+ Added SDL_config.h, with defaults for various build environments.
+</UL>
+
+<H3> General Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ The SDL website now has an <A HREF="http://www.libsdl.org/rss/rss.xml">RSS feed</A>!
+<P>
+ The SDL development source code is now managed with <A HREF="http://www.libsdl.org/svn.php">Subversion</A>.
+<P>
+ SDL now uses the Bugzilla <A HREF="http://bugzilla.libsdl.org/">bug tracking system</A>, hosted by icculus.org.
+<P>
+ SDL is licensed under version 2.1 of the GNU Lesser General Public License.
+<P>
+ The entire build system has been revamped to make it much more portable, including versions of C library functions to make it possible to run SDL on a minimal embedded environment. See README.Porting in the SDL source distribution for information on how to port SDL to a new platform.
+<P>
+ SDL_opengl.h has been updated with the latest glext.h from <A HREF="http://oss.sgi.com/projects/ogl-sample/registry/">http://oss.sgi.com/projects/ogl-sample/registry/</A>
+<P>
+ Alex Volkov contributed highly optimized RGB <-> RGBA blitters.
+</BLOCKQUOTE>
+
+<H3> Unix Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ The X11 libraries are dynamically loaded at runtime by default. This allows the distributed version of SDL to run on systems without X11 libraries installed.
+<P>
+ The XiG XME extension code is now included in the X11 video driver by default.
+<P>
+ XRandR support for video mode switching has been added to the X11 driver, but is disabled because of undesired interactions with window managers. You can enable this by setting the environment variable SDL_VIDEO_X11_XRANDR to 1.
+<P>
+ Xinerama multi-head displays are properly handled now, and the SDL_VIDEO_FULLSCREEN_HEAD environment variable can be used to select the screen used for fullscreen video modes. Note that changing the video modes only works on screen 0.
+<P>
+ XVidMode video modes are now sorted so they maintain the refresh rates specified in the X11 configuration file.
+<P>
+ SDL windows are no longer transparent in X11 compositing systems like XGL.
+<P>
+ The mouse is properly released by the X11 video driver if the fullscreen window loses focus.
+<P>
+ The X11 input driver now uses XIM to handle international input.
+<P>
+ The screensaver and DPMS monitor blanking are disabled while SDL games are running under the X11 and DGA video drivers. This behavior will be formalized and selectable in SDL 1.3.
+<P>
+ Fixed a bug preventing stereo OpenGL contexts from being selected on the X11 driver.
+<P>
+ The DGA video driver now waits for pending blits involving surfaces before they are freed. This prevents display oddities when using SDL_DisplayFormat() to convert many images.
+<P>
+ The framebuffer console video driver now has a parser for /etc/fb.modes for improved video mode handling.
+<P>
+ The framebuffer console video driver now allows asynchronous VT switching, and restores the full contents of the screen when switched back.
+<P>
+ The framebuffer console now uses CTRL-ALT-FN to switch virtual terminals, to avoid collisions with application key bindings.
+<P>
+ The framebuffer console input driver correctly sets IMPS/2 mode for wheel mice. It also properly detects when gpm is in IMPS/2 protocol mode, or passing raw protocol from an IMPS/2 mouse.
+<P>
+ The SVGAlib video driver now has support for banked (non-linear) video modes.
+<P>
+ A video driver for OpenBSD on the Sharp Zaurus has been contributed by Staffan Ulfberg. See the file README.wscons in the SDL source distribution for details.
+<P>
+ Many patches have been incorporated from *BSD ports.
+</BLOCKQUOTE>
+
+<H3> Windows Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ The "windib" video driver is the default now, to prevent problems with certain laptops, 64-bit Windows, and Windows Vista. The DirectX driver is still available, and can be selected by setting the environment variable SDL_VIDEODRIVER to "directx".
+<P>
+ SDL has been ported to 64-bit Windows.
+<P>
+ Dmitry Yakimov contributed a GAPI video driver for Windows CE.
+<P>
+ The default fullscreen refresh rate has been increased to match the desktop refresh rate, when using equivalent resolutions. A full API for querying and selecting refresh rates is planned for SDL 1.3.
+<P>
+ Dialog boxes are now shown when SDL is in windowed OpenGL mode.
+<P>
+ The SDL window is recreated when necessary to maintain OpenGL context attributes, when switching between windowed and fullscreen modes.
+<P>
+ An SDL_VIDEORESIZE event is properly sent when the SDL window is maximized and restored.
+<P>
+ Window positions are retained when switching between fullscreen and windowed modes.
+<P>
+ ToUnicode() is used, when available, for improved handling of international keyboard input.
+<P>
+ The PrtScrn is now treated normally with both key down and key up events.
+<P>
+ Pressing ALT-F4 now delivers an SDL_QUIT event to SDL applications.
+<P>
+ Joystick names are now correct for joysticks which have been unplugged and then plugged back in since booting.
+<P>
+ An MCI error when playing the last track on a CD-ROM has been fixed.
+<P>
+ OpenWatcom projects for building SDL have been provided by Marc Peter.
+</BLOCKQUOTE>
+
+<H3> Mac OS X Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ SDL now supports building Universal binaries, both through Xcode projects and when using configure/make. See README.MacOSX in the SDL source archive for details.
+<P>
+ The X11 video driver with GLX support can be built on Mac OS X, if the X11 development SDK is installed.
+<P>
+ Transitions between fullscreen resolutions and windowed mode now use a much faster asynchronous fade to hide desktop flicker.
+<P>
+ Icons set with SDL_WM_SetIcon() now have the proper colors on Intel Macs.
+</BLOCKQUOTE>
+
+<H3> OS/2 Notes </H3>
+
+<BLOCKQUOTE>
+<P>
+ Projects for building SDL on OS/2 with OpenWatcom have been contributed by Doodle. See the file README.OS2 in the SDL source distribution for details.
+</BLOCKQUOTE>
+
+<IMG SRC="docs/images/rainbow.gif" ALT="[separator]" WIDTH="100%">
+
+</BODY>
+</HTML>
diff --git a/distrib/sdl-1.2.15/docs/html/audio.html b/distrib/sdl-1.2.15/docs/html/audio.html
new file mode 100644
index 0000000..94075e2
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/audio.html
@@ -0,0 +1,242 @@
+<HTML
+><HEAD
+><TITLE
+>Audio</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Reference"
+HREF="reference.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_JoystickClose"
+HREF="sdljoystickclose.html"><LINK
+REL="NEXT"
+TITLE="SDL_AudioSpec"
+HREF="sdlaudiospec.html"><META
+NAME="KEYWORD"
+CONTENT="audio"><META
+NAME="KEYWORD"
+CONTENT="function"></HEAD
+><BODY
+CLASS="CHAPTER"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdljoystickclose.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlaudiospec.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="CHAPTER"
+><H1
+><A
+NAME="AUDIO"
+></A
+>Chapter 10. Audio</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="sdlaudiospec.html"
+>SDL_AudioSpec</A
+>&nbsp;--&nbsp;Audio Specification Structure</DT
+><DT
+><A
+HREF="sdlopenaudio.html"
+>SDL_OpenAudio</A
+>&nbsp;--&nbsp;Opens the audio device with the desired parameters.</DT
+><DT
+><A
+HREF="sdlpauseaudio.html"
+>SDL_PauseAudio</A
+>&nbsp;--&nbsp;Pauses and unpauses the audio callback processing</DT
+><DT
+><A
+HREF="sdlgetaudiostatus.html"
+>SDL_GetAudioStatus</A
+>&nbsp;--&nbsp;Get the current audio state</DT
+><DT
+><A
+HREF="sdlloadwav.html"
+>SDL_LoadWAV</A
+>&nbsp;--&nbsp;Load a WAVE file</DT
+><DT
+><A
+HREF="sdlfreewav.html"
+>SDL_FreeWAV</A
+>&nbsp;--&nbsp;Frees previously opened WAV data</DT
+><DT
+><A
+HREF="sdlaudiocvt.html"
+>SDL_AudioCVT</A
+>&nbsp;--&nbsp;Audio Conversion Structure</DT
+><DT
+><A
+HREF="sdlbuildaudiocvt.html"
+>SDL_BuildAudioCVT</A
+>&nbsp;--&nbsp;Initializes a SDL_AudioCVT structure for conversion</DT
+><DT
+><A
+HREF="sdlconvertaudio.html"
+>SDL_ConvertAudio</A
+>&nbsp;--&nbsp;Convert audio data to a desired audio format.</DT
+><DT
+><A
+HREF="sdlmixaudio.html"
+>SDL_MixAudio</A
+>&nbsp;--&nbsp;Mix audio data</DT
+><DT
+><A
+HREF="sdllockaudio.html"
+>SDL_LockAudio</A
+>&nbsp;--&nbsp;Lock out the callback function</DT
+><DT
+><A
+HREF="sdlunlockaudio.html"
+>SDL_UnlockAudio</A
+>&nbsp;--&nbsp;Unlock the callback function</DT
+><DT
+><A
+HREF="sdlcloseaudio.html"
+>SDL_CloseAudio</A
+>&nbsp;--&nbsp;Shuts down audio processing and closes the audio device.</DT
+></DL
+></DIV
+><P
+>Sound on the computer is translated from waves that you hear into a series of
+values, or samples, each representing the amplitude of the wave. When these
+samples are sent in a stream to a sound card, an approximation of the original
+wave can be recreated. The more bits used to represent the amplitude, and the
+greater frequency these samples are gathered, the closer the approximated
+sound is to the original, and the better the quality of sound.</P
+><P
+>This library supports both 8 and 16 bit signed and unsigned sound samples,
+at frequencies ranging from 11025 Hz to 44100 Hz, depending on the
+underlying hardware. If the hardware doesn't support the desired audio
+format or frequency, it can be emulated if desired (See
+<A
+HREF="sdlopenaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_OpenAudio()</TT
+></A
+>)</P
+><P
+>A commonly supported audio format is 16 bits per sample at 22050 Hz.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdljoystickclose.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlaudiospec.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_JoystickClose</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="reference.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_AudioSpec</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/cdrom.html b/distrib/sdl-1.2.15/docs/html/cdrom.html
new file mode 100644
index 0000000..bdd6bfd
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/cdrom.html
@@ -0,0 +1,260 @@
+<HTML
+><HEAD
+><TITLE
+>CD-ROM</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Reference"
+HREF="reference.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CloseAudio"
+HREF="sdlcloseaudio.html"><LINK
+REL="NEXT"
+TITLE="SDL_CDNumDrives"
+HREF="sdlcdnumdrives.html"><META
+NAME="KEYWORD"
+CONTENT="cdrom"><META
+NAME="KEYWORD"
+CONTENT="function"></HEAD
+><BODY
+CLASS="CHAPTER"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcloseaudio.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcdnumdrives.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="CHAPTER"
+><H1
+><A
+NAME="CDROM"
+></A
+>Chapter 11. CD-ROM</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="sdlcdnumdrives.html"
+>SDL_CDNumDrives</A
+>&nbsp;--&nbsp;Returns the number of CD-ROM drives on the system.</DT
+><DT
+><A
+HREF="sdlcdname.html"
+>SDL_CDName</A
+>&nbsp;--&nbsp;Returns a human-readable, system-dependent identifier for the CD-ROM.</DT
+><DT
+><A
+HREF="sdlcdopen.html"
+>SDL_CDOpen</A
+>&nbsp;--&nbsp;Opens a CD-ROM drive for access.</DT
+><DT
+><A
+HREF="sdlcdstatus.html"
+>SDL_CDStatus</A
+>&nbsp;--&nbsp;Returns the current status of the given drive.</DT
+><DT
+><A
+HREF="sdlcdplay.html"
+>SDL_CDPlay</A
+>&nbsp;--&nbsp;Play a CD</DT
+><DT
+><A
+HREF="sdlcdplaytracks.html"
+>SDL_CDPlayTracks</A
+>&nbsp;--&nbsp;Play the given CD track(s)</DT
+><DT
+><A
+HREF="sdlcdpause.html"
+>SDL_CDPause</A
+>&nbsp;--&nbsp;Pauses a CDROM</DT
+><DT
+><A
+HREF="sdlcdresume.html"
+>SDL_CDResume</A
+>&nbsp;--&nbsp;Resumes a CDROM</DT
+><DT
+><A
+HREF="sdlcdstop.html"
+>SDL_CDStop</A
+>&nbsp;--&nbsp;Stops a CDROM</DT
+><DT
+><A
+HREF="sdlcdeject.html"
+>SDL_CDEject</A
+>&nbsp;--&nbsp;Ejects a CDROM</DT
+><DT
+><A
+HREF="sdlcdclose.html"
+>SDL_CDClose</A
+>&nbsp;--&nbsp;Closes a SDL_CD handle</DT
+><DT
+><A
+HREF="sdlcd.html"
+>SDL_CD</A
+>&nbsp;--&nbsp;CDROM Drive Information</DT
+><DT
+><A
+HREF="sdlcdtrack.html"
+>SDL_CDtrack</A
+>&nbsp;--&nbsp;CD Track Information Structure</DT
+></DL
+></DIV
+><P
+>SDL supports audio control of up to 32 local CD-ROM drives at once.</P
+><P
+>You use this API to perform all the basic functions of a CD player,
+including listing the tracks, playing, stopping, and ejecting the CD-ROM.
+(Currently, multi-changer CD drives are not supported.)</P
+><P
+>Before you call any of the SDL CD-ROM functions, you must first call
+"<TT
+CLASS="FUNCTION"
+>SDL_Init(SDL_INIT_CDROM)</TT
+>", which scans the system for
+CD-ROM drives, and sets the program up for audio control. Check the
+return code, which should be <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+>, to see if there
+were any errors in starting up.</P
+><P
+>After you have initialized the library, you can find out how many drives
+are available using the <TT
+CLASS="FUNCTION"
+>SDL_CDNumDrives()</TT
+> function.
+The first drive listed is the system default CD-ROM drive. After you have
+chosen a drive, and have opened it with <TT
+CLASS="FUNCTION"
+>SDL_CDOpen()</TT
+>,
+you can check the status and start playing if there's a CD in the drive.</P
+><P
+>A CD-ROM is organized into one or more tracks, each consisting of a certain
+number of "frames". Each frame is ~2K in size, and at normal playing speed,
+a CD plays 75 frames per second. SDL works with the number of frames on a
+CD, but this can easily be converted to the more familiar minutes/seconds
+format by using the <TT
+CLASS="FUNCTION"
+>FRAMES_TO_MSF()</TT
+> macro.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcloseaudio.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcdnumdrives.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CloseAudio</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="reference.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CDNumDrives</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/event.html b/distrib/sdl-1.2.15/docs/html/event.html
new file mode 100644
index 0000000..f2bddb2
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/event.html
@@ -0,0 +1,216 @@
+<HTML
+><HEAD
+><TITLE
+>Events</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Reference"
+HREF="reference.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_WM_GrabInput"
+HREF="sdlwmgrabinput.html"><LINK
+REL="NEXT"
+TITLE="SDL Event Structures."
+HREF="eventstructures.html"><META
+NAME="KEYWORD"
+CONTENT="events"><META
+NAME="KEYWORD"
+CONTENT="function"></HEAD
+><BODY
+CLASS="CHAPTER"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlwmgrabinput.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="eventstructures.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="CHAPTER"
+><H1
+><A
+NAME="EVENT"
+></A
+>Chapter 8. Events</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="event.html#AEN3691"
+>Introduction</A
+></DT
+><DT
+><A
+HREF="eventstructures.html"
+>SDL Event Structures.</A
+></DT
+><DT
+><A
+HREF="eventfunctions.html"
+>Event Functions.</A
+></DT
+></DL
+></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="AEN3691"
+></A
+>Introduction</H1
+><P
+>Event handling allows your application to receive input from the user. Event handling is initalised (along with video) with a call to:
+<PRE
+CLASS="PROGRAMLISTING"
+>SDL_Init(SDL_INIT_VIDEO);</PRE
+>
+Internally, SDL stores all the events waiting to be handled in an event queue. Using functions like <A
+HREF="sdlpollevent.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PollEvent</TT
+></A
+> and <A
+HREF="sdlpeepevents.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PeepEvents</TT
+></A
+> you can observe and handle waiting input events.</P
+><P
+>The key to event handling in SDL is the <A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+> union. The event queue itself is composed of a series of <SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+> unions, one for each waiting event. <SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+> unions are read from the queue with the <TT
+CLASS="FUNCTION"
+>SDL_PollEvent</TT
+> function and it is then up to the application to process the information stored with them.</P
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlwmgrabinput.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="eventstructures.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_WM_GrabInput</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="reference.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL Event Structures.</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/eventfunctions.html b/distrib/sdl-1.2.15/docs/html/eventfunctions.html
new file mode 100644
index 0000000..f68a29a
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/eventfunctions.html
@@ -0,0 +1,481 @@
+<HTML
+><HEAD
+><TITLE
+>Event Functions.</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Events"
+HREF="event.html"><LINK
+REL="PREVIOUS"
+TITLE="SDLKey"
+HREF="sdlkey.html"><LINK
+REL="NEXT"
+TITLE="SDL_PumpEvents"
+HREF="sdlpumpevents.html"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlkey.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 8. Events</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlpumpevents.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="EVENTFUNCTIONS"
+></A
+>Event Functions.</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="sdlpumpevents.html"
+>SDL_PumpEvents</A
+>&nbsp;--&nbsp;Pumps the event loop, gathering events from the input devices.</DT
+><DT
+><A
+HREF="sdlpeepevents.html"
+>SDL_PeepEvents</A
+>&nbsp;--&nbsp;Checks the event queue for messages and optionally returns them.</DT
+><DT
+><A
+HREF="sdlpollevent.html"
+>SDL_PollEvent</A
+>&nbsp;--&nbsp;Polls for currently pending events.</DT
+><DT
+><A
+HREF="sdlwaitevent.html"
+>SDL_WaitEvent</A
+>&nbsp;--&nbsp;Waits indefinitely for the next available event.</DT
+><DT
+><A
+HREF="sdlpushevent.html"
+>SDL_PushEvent</A
+>&nbsp;--&nbsp;Pushes an event onto the event queue</DT
+><DT
+><A
+HREF="sdlseteventfilter.html"
+>SDL_SetEventFilter</A
+>&nbsp;--&nbsp;Sets up a filter to process all events before they are posted
+to the event queue.</DT
+><DT
+><A
+HREF="sdlgeteventfilter.html"
+>SDL_GetEventFilter</A
+>&nbsp;--&nbsp;Retrieves a pointer to he event filter</DT
+><DT
+><A
+HREF="sdleventstate.html"
+>SDL_EventState</A
+>&nbsp;--&nbsp;This function allows you to set the state of processing certain events.</DT
+><DT
+><A
+HREF="sdlgetkeystate.html"
+>SDL_GetKeyState</A
+>&nbsp;--&nbsp;Get a snapshot of the current keyboard state</DT
+><DT
+><A
+HREF="sdlgetmodstate.html"
+>SDL_GetModState</A
+>&nbsp;--&nbsp;Get the state of modifier keys.</DT
+><DT
+><A
+HREF="sdlsetmodstate.html"
+>SDL_SetModState</A
+>&nbsp;--&nbsp;Set the current key modifier state</DT
+><DT
+><A
+HREF="sdlgetkeyname.html"
+>SDL_GetKeyName</A
+>&nbsp;--&nbsp;Get the name of an SDL virtual keysym</DT
+><DT
+><A
+HREF="sdlenableunicode.html"
+>SDL_EnableUNICODE</A
+>&nbsp;--&nbsp;Enable UNICODE translation</DT
+><DT
+><A
+HREF="sdlenablekeyrepeat.html"
+>SDL_EnableKeyRepeat</A
+>&nbsp;--&nbsp;Set keyboard repeat rate.</DT
+><DT
+><A
+HREF="sdlgetmousestate.html"
+>SDL_GetMouseState</A
+>&nbsp;--&nbsp;Retrieve the current state of the mouse</DT
+><DT
+><A
+HREF="sdlgetrelativemousestate.html"
+>SDL_GetRelativeMouseState</A
+>&nbsp;--&nbsp;Retrieve the current state of the mouse</DT
+><DT
+><A
+HREF="sdlgetappstate.html"
+>SDL_GetAppState</A
+>&nbsp;--&nbsp;Get the state of the application</DT
+><DT
+><A
+HREF="sdljoystickeventstate.html"
+>SDL_JoystickEventState</A
+>&nbsp;--&nbsp;Enable/disable joystick event polling</DT
+></DL
+></DIV
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN5312"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlpumpevents.html"
+>SDL_PumpEvents</A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Pumps the event loop, gathering events from the input devices</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlpeepevents.html"
+>SDL_PeepEvents</A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Checks the event queue for messages and optionally returns them</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlpollevent.html"
+>SDL_PollEvent</A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Polls for currently pending events</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlwaitevent.html"
+>SDL_WaitEvent</A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Waits indefinitely for the next available event</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlpushevent.html"
+>SDL_PushEvent</A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Pushes an event onto the event queue</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlseteventfilter.html"
+>SDL_SetEventFilter</A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Sets up a filter to process all events</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdleventstate.html"
+>SDL_EventState</A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Allows you to set the state of processing certain events</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlgetkeystate.html"
+>SDL_GetKeyState</A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Get a snapshot of the current keyboard state</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlgetmodstate.html"
+>SDL_GetModState</A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Get the state of modifier keys</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlsetmodstate.html"
+>SDL_SetModState</A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Set the state of modifier keys</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlgetkeyname.html"
+>SDL_GetKeyName</A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Get the name of an SDL virtual keysym</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlenableunicode.html"
+>SDL_EnableUNICODE</A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Enable UNICODE translation</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlenablekeyrepeat.html"
+>SDL_EnableKeyRepeat</A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Set keyboard repeat rate</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlgetmousestate.html"
+>SDL_GetMouseState</A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Retrieve the current state of the mouse</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlgetrelativemousestate.html"
+>SDL_GetRelativeMouseState</A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Retrieve the current state of the mouse</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlgetappstate.html"
+>SDL_GetAppState</A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Get the state of the application</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdljoystickeventstate.html"
+>SDL_JoystickEventState</A
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Enable/disable joystick event polling</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlkey.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlpumpevents.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDLKey</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="event.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_PumpEvents</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/eventstructures.html b/distrib/sdl-1.2.15/docs/html/eventstructures.html
new file mode 100644
index 0000000..c959296
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/eventstructures.html
@@ -0,0 +1,233 @@
+<HTML
+><HEAD
+><TITLE
+>SDL Event Structures.</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Events"
+HREF="event.html"><LINK
+REL="PREVIOUS"
+TITLE="Events"
+HREF="event.html"><LINK
+REL="NEXT"
+TITLE="SDL_Event"
+HREF="sdlevent.html"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="event.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 8. Events</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="EVENTSTRUCTURES"
+></A
+>SDL Event Structures.</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="sdlevent.html"
+>SDL_Event</A
+>&nbsp;--&nbsp;General event structure</DT
+><DT
+><A
+HREF="sdlactiveevent.html"
+>SDL_ActiveEvent</A
+>&nbsp;--&nbsp;Application visibility event structure</DT
+><DT
+><A
+HREF="sdlkeyboardevent.html"
+>SDL_KeyboardEvent</A
+>&nbsp;--&nbsp;Keyboard event structure</DT
+><DT
+><A
+HREF="sdlmousemotionevent.html"
+>SDL_MouseMotionEvent</A
+>&nbsp;--&nbsp;Mouse motion event structure</DT
+><DT
+><A
+HREF="sdlmousebuttonevent.html"
+>SDL_MouseButtonEvent</A
+>&nbsp;--&nbsp;Mouse button event structure</DT
+><DT
+><A
+HREF="sdljoyaxisevent.html"
+>SDL_JoyAxisEvent</A
+>&nbsp;--&nbsp;Joystick axis motion event structure</DT
+><DT
+><A
+HREF="sdljoybuttonevent.html"
+>SDL_JoyButtonEvent</A
+>&nbsp;--&nbsp;Joystick button event structure</DT
+><DT
+><A
+HREF="sdljoyhatevent.html"
+>SDL_JoyHatEvent</A
+>&nbsp;--&nbsp;Joystick hat position change event structure</DT
+><DT
+><A
+HREF="sdljoyballevent.html"
+>SDL_JoyBallEvent</A
+>&nbsp;--&nbsp;Joystick trackball motion event structure</DT
+><DT
+><A
+HREF="sdlresizeevent.html"
+>SDL_ResizeEvent</A
+>&nbsp;--&nbsp;Window resize event structure</DT
+><DT
+><A
+HREF="sdlexposeevent.html"
+>SDL_ExposeEvent</A
+>&nbsp;--&nbsp;Quit requested event</DT
+><DT
+><A
+HREF="sdlsyswmevent.html"
+>SDL_SysWMEvent</A
+>&nbsp;--&nbsp;Platform-dependent window manager event.</DT
+><DT
+><A
+HREF="sdluserevent.html"
+>SDL_UserEvent</A
+>&nbsp;--&nbsp;A user-defined event type</DT
+><DT
+><A
+HREF="sdlquitevent.html"
+>SDL_QuitEvent</A
+>&nbsp;--&nbsp;Quit requested event</DT
+><DT
+><A
+HREF="sdlkeysym.html"
+>SDL_keysym</A
+>&nbsp;--&nbsp;Keysym structure</DT
+><DT
+><A
+HREF="sdlkey.html"
+>SDLKey</A
+>&nbsp;--&nbsp;Keysym definitions.</DT
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="event.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Events</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="event.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_Event</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/general.html b/distrib/sdl-1.2.15/docs/html/general.html
new file mode 100644
index 0000000..0beb591
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/general.html
@@ -0,0 +1,225 @@
+<HTML
+><HEAD
+><TITLE
+>General</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Reference"
+HREF="reference.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL Reference"
+HREF="reference.html"><LINK
+REL="NEXT"
+TITLE="SDL_Init"
+HREF="sdlinit.html"><META
+NAME="KEYWORD"
+CONTENT="general"><META
+NAME="KEYWORD"
+CONTENT="function"></HEAD
+><BODY
+CLASS="CHAPTER"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="reference.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlinit.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="CHAPTER"
+><H1
+><A
+NAME="GENERAL"
+></A
+>Chapter 5. General</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="sdlinit.html"
+>SDL_Init</A
+>&nbsp;--&nbsp;Initializes SDL</DT
+><DT
+><A
+HREF="sdlinitsubsystem.html"
+>SDL_InitSubSystem</A
+>&nbsp;--&nbsp;Initialize subsystems</DT
+><DT
+><A
+HREF="sdlquitsubsystem.html"
+>SDL_QuitSubSystem</A
+>&nbsp;--&nbsp;Shut down a subsystem</DT
+><DT
+><A
+HREF="sdlquit.html"
+>SDL_Quit</A
+>&nbsp;--&nbsp;Shut down SDL</DT
+><DT
+><A
+HREF="sdlwasinit.html"
+>SDL_WasInit</A
+>&nbsp;--&nbsp;Check which subsystems are initialized</DT
+><DT
+><A
+HREF="sdlgeterror.html"
+>SDL_GetError</A
+>&nbsp;--&nbsp;Get SDL error string</DT
+><DT
+><A
+HREF="sdlenvvars.html"
+>SDL_envvars</A
+>&nbsp;--&nbsp;SDL environment variables</DT
+></DL
+></DIV
+><P
+>Before SDL can be used in a program it must be initialized with <A
+HREF="sdlinit.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+></A
+>. <TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+> initializes all the subsystems that the user requests (video, audio, joystick, timers and/or cdrom). Once SDL is initialized with <TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+> subsystems can be shut down and initialized as needed using <A
+HREF="sdlinitsubsystem.html"
+><TT
+CLASS="FUNCTION"
+>SDL_InitSubSystem</TT
+></A
+> and <A
+HREF="sdlquitsubsystem.html"
+><TT
+CLASS="FUNCTION"
+>SDL_QuitSubSystem</TT
+></A
+>.</P
+><P
+>SDL must also be shut down before the program exits to make sure it cleans up correctly. Calling <A
+HREF="sdlquit.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Quit</TT
+></A
+> shuts down all subsystems and frees any resources allocated to SDL.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="reference.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlinit.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL Reference</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="reference.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_Init</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/guide.html b/distrib/sdl-1.2.15/docs/html/guide.html
new file mode 100644
index 0000000..2c1297e
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/guide.html
@@ -0,0 +1,174 @@
+<HTML
+><HEAD
+><TITLE
+>SDL Guide</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="NEXT"
+TITLE="Preface"
+HREF="guidepreface.html"></HEAD
+><BODY
+CLASS="PART"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="index.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="guidepreface.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="PART"
+><A
+NAME="GUIDE"
+></A
+><DIV
+CLASS="TITLEPAGE"
+><H1
+CLASS="TITLE"
+>I. SDL Guide</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="guidepreface.html"
+>Preface</A
+></DT
+><DT
+>1. <A
+HREF="guidethebasics.html"
+>The Basics</A
+></DT
+><DT
+>2. <A
+HREF="guidevideo.html"
+>Graphics and Video</A
+></DT
+><DT
+>3. <A
+HREF="guideinput.html"
+>Input handling</A
+></DT
+><DT
+>4. <A
+HREF="guideexamples.html"
+>Examples</A
+></DT
+></DL
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="guidepreface.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL Library Documentation</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Preface</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/guideaboutsdldoc.html b/distrib/sdl-1.2.15/docs/html/guideaboutsdldoc.html
new file mode 100644
index 0000000..cdb0d78
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/guideaboutsdldoc.html
@@ -0,0 +1,148 @@
+<HTML
+><HEAD
+><TITLE
+>About SDLdoc</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Preface"
+HREF="guidepreface.html"><LINK
+REL="PREVIOUS"
+TITLE="Preface"
+HREF="guidepreface.html"><LINK
+REL="NEXT"
+TITLE="Credits"
+HREF="guidecredits.html"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="guidepreface.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Preface</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="guidecredits.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="GUIDEABOUTSDLDOC"
+></A
+>About SDLdoc</H1
+><P
+>SDLdoc (The SDL Documentation Project) was formed to completely rewrite the SDL documentation and to keep it continually up to date. The team consists completely of volunteers ranging from people working with SDL in their spare time to people who use SDL in their everyday working lives.</P
+><P
+>The latest version of this documentation can always be found here: http://sdldoc.csn.ul.ie Downloadable PS, man pages and html tarballs are available at http://sdldoc.csn.ul.ie/pub/</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="guidepreface.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="guidecredits.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Preface</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="guidepreface.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Credits</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/guideaudioexamples.html b/distrib/sdl-1.2.15/docs/html/guideaudioexamples.html
new file mode 100644
index 0000000..afb7522
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/guideaudioexamples.html
@@ -0,0 +1,228 @@
+<HTML
+><HEAD
+><TITLE
+>Audio Examples</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Examples"
+HREF="guideexamples.html"><LINK
+REL="PREVIOUS"
+TITLE="Event Examples"
+HREF="guideeventexamples.html"><LINK
+REL="NEXT"
+TITLE="CDROM Examples"
+HREF="guidecdromexamples.html"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="guideeventexamples.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 4. Examples</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="guidecdromexamples.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="GUIDEAUDIOEXAMPLES"
+></A
+>Audio Examples</H1
+><P
+></P
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN382"
+></A
+>Opening the audio device</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+> SDL_AudioSpec wanted;
+ extern void fill_audio(void *udata, Uint8 *stream, int len);
+
+ /* Set the audio format */
+ wanted.freq = 22050;
+ wanted.format = AUDIO_S16;
+ wanted.channels = 2; /* 1 = mono, 2 = stereo */
+ wanted.samples = 1024; /* Good low-latency value for callback */
+ wanted.callback = fill_audio;
+ wanted.userdata = NULL;
+
+ /* Open the audio device, forcing the desired format */
+ if ( SDL_OpenAudio(&#38;wanted, NULL) &#60; 0 ) {
+ fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
+ return(-1);
+ }
+ return(0);</PRE
+></P
+></DIV
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN386"
+></A
+>Playing audio</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+> static Uint8 *audio_chunk;
+ static Uint32 audio_len;
+ static Uint8 *audio_pos;
+
+ /* The audio function callback takes the following parameters:
+ stream: A pointer to the audio buffer to be filled
+ len: The length (in bytes) of the audio buffer
+ */
+ void fill_audio(void *udata, Uint8 *stream, int len)
+ {
+ /* Only play if we have data left */
+ if ( audio_len == 0 )
+ return;
+
+ /* Mix as much data as possible */
+ len = ( len &#62; audio_len ? audio_len : len );
+ SDL_MixAudio(stream, audio_pos, len, SDL_MIX_MAXVOLUME);
+ audio_pos += len;
+ audio_len -= len;
+ }
+
+ /* Load the audio data ... */
+
+ ;;;;;
+
+ audio_pos = audio_chunk;
+
+ /* Let the callback function play the audio chunk */
+ SDL_PauseAudio(0);
+
+ /* Do some processing */
+
+ ;;;;;
+
+ /* Wait for sound to complete */
+ while ( audio_len &#62; 0 ) {
+ SDL_Delay(100); /* Sleep 1/10 second */
+ }
+ SDL_CloseAudio();</PRE
+></P
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="guideeventexamples.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="guidecdromexamples.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Event Examples</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="guideexamples.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>CDROM Examples</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/guidebasicsinit.html b/distrib/sdl-1.2.15/docs/html/guidebasicsinit.html
new file mode 100644
index 0000000..faafdbd
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/guidebasicsinit.html
@@ -0,0 +1,240 @@
+<HTML
+><HEAD
+><TITLE
+>Initializing SDL</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="The Basics"
+HREF="guidethebasics.html"><LINK
+REL="PREVIOUS"
+TITLE="The Basics"
+HREF="guidethebasics.html"><LINK
+REL="NEXT"
+TITLE="Graphics and Video"
+HREF="guidevideo.html"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="guidethebasics.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 1. The Basics</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="guidevideo.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="GUIDEBASICSINIT"
+></A
+>Initializing SDL</H1
+><P
+>SDL is composed of eight subsystems - Audio, CDROM, Event Handling, File I/O, Joystick Handling, Threading, Timers and Video. Before you can use any of these subsystems they must be initialized by calling <A
+HREF="sdlinit.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+></A
+> (or <A
+HREF="sdlinitsubsystem.html"
+><TT
+CLASS="FUNCTION"
+>SDL_InitSubSystem</TT
+></A
+>). <TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+> must be called before any other SDL function. It automatically initializes the Event Handling, File I/O and Threading subsystems and it takes a parameter specifying which other subsystems to initialize. So, to initialize the default subsystems and the Video subsystems you would call:
+<PRE
+CLASS="PROGRAMLISTING"
+> SDL_Init ( SDL_INIT_VIDEO );</PRE
+>
+To initialize the default subsystems, the Video subsystem and the Timers subsystem you would call:
+<PRE
+CLASS="PROGRAMLISTING"
+> SDL_Init ( SDL_INIT_VIDEO | SDL_INIT_TIMER );</PRE
+></P
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+> is complemented by <A
+HREF="sdlquit.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Quit</TT
+></A
+> (and <A
+HREF="sdlquitsubsystem.html"
+><TT
+CLASS="FUNCTION"
+>SDL_QuitSubSystem</TT
+></A
+>). <TT
+CLASS="FUNCTION"
+>SDL_Quit</TT
+> shuts down all subsystems, including the default ones. It should always be called before a SDL application exits.</P
+><P
+>With <TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+> and <TT
+CLASS="FUNCTION"
+>SDL_Quit</TT
+> firmly embedded in your programmers toolkit you can write your first and most basic SDL application. However, we must be prepare to handle errors. Many SDL functions return a value and indicates whether the function has succeeded or failed, <TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+>, for instance, returns -1 if it could not initialize a subsystem. SDL provides a useful facility that allows you to determine exactly what the problem was, every time an error occurs within SDL an error message is stored which can be retrieved using <TT
+CLASS="FUNCTION"
+>SDL_GetError</TT
+>. Use this often, you can never know too much about an error.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN60"
+></A
+><P
+><B
+>Example 1-1. Initializing SDL</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+>#include "SDL.h" /* All SDL App's need this */
+#include &#60;stdio.h&#62;
+
+int main(int argc, char *argv[]) {
+
+ printf("Initializing SDL.\n");
+
+ /* Initialize defaults, Video and Audio */
+ if((SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO)==-1)) {
+ printf("Could not initialize SDL: %s.\n", SDL_GetError());
+ exit(-1);
+ }
+
+ printf("SDL initialized.\n");
+
+ printf("Quiting SDL.\n");
+
+ /* Shutdown all subsystems */
+ SDL_Quit();
+
+ printf("Quiting....\n");
+
+ exit(0);
+}&#13;</PRE
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="guidethebasics.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="guidevideo.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>The Basics</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="guidethebasics.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Graphics and Video</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/guidecdromexamples.html b/distrib/sdl-1.2.15/docs/html/guidecdromexamples.html
new file mode 100644
index 0000000..2bc5a16
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/guidecdromexamples.html
@@ -0,0 +1,275 @@
+<HTML
+><HEAD
+><TITLE
+>CDROM Examples</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Examples"
+HREF="guideexamples.html"><LINK
+REL="PREVIOUS"
+TITLE="Audio Examples"
+HREF="guideaudioexamples.html"><LINK
+REL="NEXT"
+TITLE="Time Examples"
+HREF="guidetimeexamples.html"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="guideaudioexamples.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 4. Examples</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="guidetimeexamples.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="GUIDECDROMEXAMPLES"
+></A
+>CDROM Examples</H1
+><P
+></P
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN393"
+></A
+>Listing CD-ROM drives</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+> #include "SDL.h"
+
+ /* Initialize SDL first */
+ if ( SDL_Init(SDL_INIT_CDROM) &#60; 0 ) {
+ fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
+ exit(1);
+ }
+ atexit(SDL_Quit);
+
+ /* Find out how many CD-ROM drives are connected to the system */
+ printf("Drives available: %d\n", SDL_CDNumDrives());
+ for ( i=0; i&#60;SDL_CDNumDrives(); ++i ) {
+ printf("Drive %d: \"%s\"\n", i, SDL_CDName(i));
+ }</PRE
+></P
+></DIV
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN397"
+></A
+>Opening the default drive</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+> SDL_CD *cdrom;
+ CDstatus status;
+ char *status_str;
+
+ cdrom = SDL_CDOpen(0);
+ if ( cdrom == NULL ) {
+ fprintf(stderr, "Couldn't open default CD-ROM drive: %s\n",
+ SDL_GetError());
+ exit(2);
+ }
+
+ status = SDL_CDStatus(cdrom);
+ switch (status) {
+ case CD_TRAYEMPTY:
+ status_str = "tray empty";
+ break;
+ case CD_STOPPED:
+ status_str = "stopped";
+ break;
+ case CD_PLAYING:
+ status_str = "playing";
+ break;
+ case CD_PAUSED:
+ status_str = "paused";
+ break;
+ case CD_ERROR:
+ status_str = "error state";
+ break;
+ }
+ printf("Drive status: %s\n", status_str);
+ if ( status &#62;= CD_PLAYING ) {
+ int m, s, f;
+ FRAMES_TO_MSF(cdrom-&#62;cur_frame, &#38;m, &#38;s, &#38;f);
+ printf("Currently playing track %d, %d:%2.2d\n",
+ cdrom-&#62;track[cdrom-&#62;cur_track].id, m, s);
+ }</PRE
+></P
+></DIV
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN401"
+></A
+>Listing the tracks on a CD</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+> SDL_CD *cdrom; /* Assuming this has already been set.. */
+ int i;
+ int m, s, f;
+
+ SDL_CDStatus(cdrom);
+ printf("Drive tracks: %d\n", cdrom-&#62;numtracks);
+ for ( i=0; i&#60;cdrom-&#62;numtracks; ++i ) {
+ FRAMES_TO_MSF(cdrom-&#62;track[i].length, &#38;m, &#38;s, &#38;f);
+ if ( f &#62; 0 )
+ ++s;
+ printf("\tTrack (index %d) %d: %d:%2.2d\n", i,
+ cdrom-&#62;track[i].id, m, s);
+ }</PRE
+></P
+></DIV
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN405"
+></A
+>Play an entire CD</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+> SDL_CD *cdrom; /* Assuming this has already been set.. */
+
+ // Play entire CD:
+ if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
+ SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
+
+ // Play last track:
+ if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
+ SDL_CDPlayTracks(cdrom, cdrom-&#62;numtracks-1, 0, 0, 0);
+ }
+
+ // Play first and second track and 10 seconds of third track:
+ if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
+ SDL_CDPlayTracks(cdrom, 0, 0, 2, CD_FPS * 10);</PRE
+></P
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="guideaudioexamples.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="guidetimeexamples.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Audio Examples</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="guideexamples.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Time Examples</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/guidecredits.html b/distrib/sdl-1.2.15/docs/html/guidecredits.html
new file mode 100644
index 0000000..b66b28f
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/guidecredits.html
@@ -0,0 +1,195 @@
+<HTML
+><HEAD
+><TITLE
+>Credits</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Preface"
+HREF="guidepreface.html"><LINK
+REL="PREVIOUS"
+TITLE="About SDLdoc"
+HREF="guideaboutsdldoc.html"><LINK
+REL="NEXT"
+TITLE="The Basics"
+HREF="guidethebasics.html"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="guideaboutsdldoc.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Preface</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="guidethebasics.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="GUIDECREDITS"
+></A
+>Credits</H1
+><P
+><P
+></P
+><TABLE
+BORDER="0"
+><TBODY
+><TR
+><TD
+>Sam Lantinga, slouken@libsdl.org</TD
+></TR
+><TR
+><TD
+>Martin Donlon, akawaka@skynet.ie</TD
+></TR
+><TR
+><TD
+>Mattias Engdegård</TD
+></TR
+><TR
+><TD
+>Julian Peterson</TD
+></TR
+><TR
+><TD
+>Ken Jordan</TD
+></TR
+><TR
+><TD
+>Maxim Sobolev</TD
+></TR
+><TR
+><TD
+>Wesley Poole</TD
+></TR
+><TR
+><TD
+>Michael Vance</TD
+></TR
+><TR
+><TD
+>Andreas Umbach</TD
+></TR
+><TR
+><TD
+>Andreas Hofmeister</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="guideaboutsdldoc.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="guidethebasics.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>About SDLdoc</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="guidepreface.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>The Basics</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/guideeventexamples.html b/distrib/sdl-1.2.15/docs/html/guideeventexamples.html
new file mode 100644
index 0000000..3001369
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/guideeventexamples.html
@@ -0,0 +1,247 @@
+<HTML
+><HEAD
+><TITLE
+>Event Examples</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Examples"
+HREF="guideexamples.html"><LINK
+REL="PREVIOUS"
+TITLE="Examples"
+HREF="guideexamples.html"><LINK
+REL="NEXT"
+TITLE="Audio Examples"
+HREF="guideaudioexamples.html"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="guideexamples.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 4. Examples</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="guideaudioexamples.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="GUIDEEVENTEXAMPLES"
+></A
+>Event Examples</H1
+><P
+></P
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN375"
+></A
+>Filtering and Handling Events</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>#include &#60;stdio.h&#62;
+#include &#60;stdlib.h&#62;
+
+#include "SDL.h"
+
+/* This function may run in a separate event thread */
+int FilterEvents(const SDL_Event *event) {
+ static int boycott = 1;
+
+ /* This quit event signals the closing of the window */
+ if ( (event-&#62;type == SDL_QUIT) &#38;&#38; boycott ) {
+ printf("Quit event filtered out -- try again.\n");
+ boycott = 0;
+ return(0);
+ }
+ if ( event-&#62;type == SDL_MOUSEMOTION ) {
+ printf("Mouse moved to (%d,%d)\n",
+ event-&#62;motion.x, event-&#62;motion.y);
+ return(0); /* Drop it, we've handled it */
+ }
+ return(1);
+}
+
+int main(int argc, char *argv[])
+{
+ SDL_Event event;
+
+ /* Initialize the SDL library (starts the event loop) */
+ if ( SDL_Init(SDL_INIT_VIDEO) &#60; 0 ) {
+ fprintf(stderr,
+ "Couldn't initialize SDL: %s\n", SDL_GetError());
+ exit(1);
+ }
+
+ /* Clean up on exit, exit on window close and interrupt */
+ atexit(SDL_Quit);
+
+ /* Ignore key events */
+ SDL_EventState(SDL_KEYDOWN, SDL_IGNORE);
+ SDL_EventState(SDL_KEYUP, SDL_IGNORE);
+
+ /* Filter quit and mouse motion events */
+ SDL_SetEventFilter(FilterEvents);
+
+ /* The mouse isn't much use unless we have a display for reference */
+ if ( SDL_SetVideoMode(640, 480, 8, 0) == NULL ) {
+ fprintf(stderr, "Couldn't set 640x480x8 video mode: %s\n",
+ SDL_GetError());
+ exit(1);
+ }
+
+ /* Loop waiting for ESC+Mouse_Button */
+ while ( SDL_WaitEvent(&#38;event) &#62;= 0 ) {
+ switch (event.type) {
+ case SDL_ACTIVEEVENT: {
+ if ( event.active.state &#38; SDL_APPACTIVE ) {
+ if ( event.active.gain ) {
+ printf("App activated\n");
+ } else {
+ printf("App iconified\n");
+ }
+ }
+ }
+ break;
+
+ case SDL_MOUSEBUTTONDOWN: {
+ Uint8 *keys;
+
+ keys = SDL_GetKeyState(NULL);
+ if ( keys[SDLK_ESCAPE] == SDL_PRESSED ) {
+ printf("Bye bye...\n");
+ exit(0);
+ }
+ printf("Mouse button pressed\n");
+ }
+ break;
+
+ case SDL_QUIT: {
+ printf("Quit requested, quitting.\n");
+ exit(0);
+ }
+ break;
+ }
+ }
+ /* This should never happen */
+ printf("SDL_WaitEvent error: %s\n", SDL_GetError());
+ exit(1);
+}</PRE
+></P
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="guideexamples.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="guideaudioexamples.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Examples</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="guideexamples.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Audio Examples</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/guideexamples.html b/distrib/sdl-1.2.15/docs/html/guideexamples.html
new file mode 100644
index 0000000..5b9a847
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/guideexamples.html
@@ -0,0 +1,188 @@
+<HTML
+><HEAD
+><TITLE
+>Examples</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Guide"
+HREF="guide.html"><LINK
+REL="PREVIOUS"
+TITLE="Handling the Keyboard"
+HREF="guideinputkeyboard.html"><LINK
+REL="NEXT"
+TITLE="Event Examples"
+HREF="guideeventexamples.html"></HEAD
+><BODY
+CLASS="CHAPTER"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="guideinputkeyboard.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="guideeventexamples.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="CHAPTER"
+><H1
+><A
+NAME="GUIDEEXAMPLES"
+></A
+>Chapter 4. Examples</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="guideexamples.html#AEN369"
+>Introduction</A
+></DT
+><DT
+><A
+HREF="guideeventexamples.html"
+>Event Examples</A
+></DT
+><DT
+><A
+HREF="guideaudioexamples.html"
+>Audio Examples</A
+></DT
+><DT
+><A
+HREF="guidecdromexamples.html"
+>CDROM Examples</A
+></DT
+><DT
+><A
+HREF="guidetimeexamples.html"
+>Time Examples</A
+></DT
+></DL
+></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="AEN369"
+></A
+>Introduction</H1
+><P
+>For the moment these examples are taken directly from the old SDL documentation. By the 1.2 release these examples should hopefully deal with most common SDL programming problems.</P
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="guideinputkeyboard.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="guideeventexamples.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Handling the Keyboard</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="guide.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Event Examples</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/guideinput.html b/distrib/sdl-1.2.15/docs/html/guideinput.html
new file mode 100644
index 0000000..9b9bbe1
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/guideinput.html
@@ -0,0 +1,739 @@
+<HTML
+><HEAD
+><TITLE
+>Input handling</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Guide"
+HREF="guide.html"><LINK
+REL="PREVIOUS"
+TITLE="Using OpenGL With SDL"
+HREF="guidevideoopengl.html"><LINK
+REL="NEXT"
+TITLE="Handling the Keyboard"
+HREF="guideinputkeyboard.html"></HEAD
+><BODY
+CLASS="CHAPTER"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="guidevideoopengl.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="guideinputkeyboard.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="CHAPTER"
+><H1
+><A
+NAME="GUIDEINPUT"
+></A
+>Chapter 3. Input handling</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="guideinput.html#GUIDEINPUTJOYSTICK"
+>Handling Joysticks</A
+></DT
+><DT
+><A
+HREF="guideinputkeyboard.html"
+>Handling the Keyboard</A
+></DT
+></DL
+></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="GUIDEINPUTJOYSTICK"
+></A
+>Handling Joysticks</H1
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN135"
+></A
+>Initialization</H2
+><P
+>The first step in using a joystick in a SDL program is to initialize the Joystick subsystems of SDL. This done by passing the <TT
+CLASS="LITERAL"
+>SDL_INIT_JOYSTICK</TT
+> flag to <A
+HREF="sdlinit.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+></A
+>. The joystick flag will usually be used in conjunction with other flags (like the video flag) because the joystick is usually used to control something.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN141"
+></A
+><P
+><B
+>Example 3-1. Initializing SDL with Joystick Support</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+> if (SDL_Init( SDL_INIT_VIDEO | SDL_INIT_JOYSTICK ) &#60; 0)
+ {
+ fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
+ exit(1);
+ }</PRE
+></DIV
+><P
+>This will attempt to start SDL with both the video and the joystick subsystems activated.</P
+></DIV
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN145"
+></A
+>Querying</H2
+><P
+>If we have reached this point then we can safely assume that the SDL library has been initialized and that the Joystick subsystem is active. We can now call some video and/or sound functions to get things going before we need the joystick. Eventually we have to make sure that there is actually a joystick to work with. It's wise to always check even if you know a joystick will be present on the system because it can also help detect when the joystick is unplugged. The function used to check for joysticks is <A
+HREF="sdlnumjoysticks.html"
+><TT
+CLASS="FUNCTION"
+>SDL_NumJoysticks</TT
+></A
+>.</P
+><P
+>This function simply returns the number of joysticks available on the system. If it is at least one then we are in good shape. The next step is to determine which joystick the user wants to use. If the number of joysticks available is only one then it is safe to assume that one joystick is the one the user wants to use. SDL has a function to get the name of the joysticks as assigned by the operations system and that function is <A
+HREF="sdljoystickname.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickName</TT
+></A
+>. The joystick is specified by an index where 0 is the first joystick and the last joystick is the number returned by <TT
+CLASS="FUNCTION"
+>SDL_NumJoysticks</TT
+> - 1. In the demonstration a list of all available joysticks is printed to stdout.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN154"
+></A
+><P
+><B
+>Example 3-2. Querying the Number of Available Joysticks</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+> printf("%i joysticks were found.\n\n", SDL_NumJoysticks() );
+ printf("The names of the joysticks are:\n");
+
+ for( i=0; i &#60; SDL_NumJoysticks(); i++ )
+ {
+ printf(" %s\n", SDL_JoystickName(i));
+ }</PRE
+></DIV
+></DIV
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN157"
+></A
+>Opening a Joystick and Receiving Joystick Events</H2
+><P
+>SDL's event driven architecture makes working with joysticks a snap. Joysticks can trigger 4 different types of events:
+<P
+></P
+><TABLE
+BORDER="0"
+><TBODY
+><TR
+><TD
+><A
+HREF="sdljoyaxisevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_JoyAxisEvent</SPAN
+></A
+></TD
+><TD
+>Occurs when an axis changes</TD
+></TR
+><TR
+><TD
+><A
+HREF="sdljoyballevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_JoyBallEvent</SPAN
+></A
+></TD
+><TD
+>Occurs when a joystick trackball's position changes</TD
+></TR
+><TR
+><TD
+><A
+HREF="sdljoyhatevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_JoyHatEvent</SPAN
+></A
+></TD
+><TD
+>Occurs when a hat's position changes</TD
+></TR
+><TR
+><TD
+><A
+HREF="sdljoybuttonevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_JoyButtonEvent</SPAN
+></A
+></TD
+><TD
+>Occurs when a button is pressed or released</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></P
+><P
+>Events are received from all joysticks opened. The first thing that needs to be done in order to receive joystick events is to call <A
+HREF="sdljoystickeventstate.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickEventState</TT
+></A
+> with the <TT
+CLASS="LITERAL"
+>SDL_ENABLE</TT
+> flag. Next you must open the joysticks that you want to receive events from. This is done with the <A
+HREF="sdljoystickopen.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickOpen</TT
+></A
+> function. For the example we are only interested in events from the first joystick on the system, regardless of what it may be. To receive events from it we would do this:</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN183"
+></A
+><P
+><B
+>Example 3-3. Opening a Joystick</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+> SDL_Joystick *joystick;
+
+ SDL_JoystickEventState(SDL_ENABLE);
+ joystick = SDL_JoystickOpen(0);</PRE
+></DIV
+><P
+>If we wanted to receive events for other joysticks we would open them with calls to <TT
+CLASS="FUNCTION"
+>SDL_JoystickOpen</TT
+> just like we opened joystick 0, except we would store the <SPAN
+CLASS="STRUCTNAME"
+>SDL_Joystick</SPAN
+> structure they return in a different pointer. We only need the joystick pointer when we are querying the joysticks or when we are closing the joystick.</P
+><P
+>Up to this point all the code we have is used just to initialize the joysticks in order to read values at run time. All we need now is an event loop, which is something that all SDL programs should have anyway to receive the systems quit events. We must now add code to check the event loop for at least some of the above mentioned events. Let's assume our event loop looks like this:
+<PRE
+CLASS="PROGRAMLISTING"
+> SDL_Event event;
+ /* Other initializtion code goes here */
+
+ /* Start main game loop here */
+
+ while(SDL_PollEvent(&#38;event))
+ {
+ switch(event.type)
+ {
+ case SDL_KEYDOWN:
+ /* handle keyboard stuff here */
+ break;
+
+ case SDL_QUIT:
+ /* Set whatever flags are necessary to */
+ /* end the main game loop here */
+ break;
+ }
+ }
+
+ /* End loop here */</PRE
+>
+To handle Joystick events we merely add cases for them, first we'll add axis handling code. Axis checks can get kinda of tricky because alot of the joystick events received are junk. Joystick axis have a tendency to vary just a little between polling due to the way they are designed. To compensate for this you have to set a threshold for changes and ignore the events that have'nt exceeded the threshold. 10% is usually a good threshold value. This sounds a lot more complicated than it is. Here is the Axis event handler:</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN191"
+></A
+><P
+><B
+>Example 3-4. Joystick Axis Events</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+> case SDL_JOYAXISMOTION: /* Handle Joystick Motion */
+ if ( ( event.jaxis.value &#60; -3200 ) || (event.jaxis.value &#62; 3200 ) )
+ {
+ /* code goes here */
+ }
+ break;</PRE
+></DIV
+><P
+>Another trick with axis events is that up-down and left-right movement are two different sets of axes. The most important axis is axis 0 (left-right) and axis 1 (up-down). To handle them seperatly in the code we do the following:</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN195"
+></A
+><P
+><B
+>Example 3-5. More Joystick Axis Events</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+> case SDL_JOYAXISMOTION: /* Handle Joystick Motion */
+ if ( ( event.jaxis.value &#60; -3200 ) || (event.jaxis.value &#62; 3200 ) )
+ {
+ if( event.jaxis.axis == 0)
+ {
+ /* Left-right movement code goes here */
+ }
+
+ if( event.jaxis.axis == 1)
+ {
+ /* Up-Down movement code goes here */
+ }
+ }
+ break;</PRE
+></DIV
+><P
+>Ideally the code here should use <TT
+CLASS="STRUCTFIELD"
+><I
+>event.jaxis.value</I
+></TT
+> to scale something. For example lets assume you are using the joystick to control the movement of a spaceship. If the user is using an analog joystick and they push the stick a little bit they expect to move less than if they pushed it a lot. Designing your code for this situation is preferred because it makes the experience for users of analog controls better and remains the same for users of digital controls.</P
+><P
+>If your joystick has any additional axis then they may be used for other sticks or throttle controls and those axis return values too just with different <TT
+CLASS="STRUCTFIELD"
+><I
+>event.jaxis.axis</I
+></TT
+> values.</P
+><P
+>Button handling is simple compared to the axis checking.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN203"
+></A
+><P
+><B
+>Example 3-6. Joystick Button Events</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+> case SDL_JOYBUTTONDOWN: /* Handle Joystick Button Presses */
+ if ( event.jbutton.button == 0 )
+ {
+ /* code goes here */
+ }
+ break;</PRE
+></DIV
+><P
+>Button checks are simpler than axis checks because a button can only be pressed or not pressed. The <TT
+CLASS="LITERAL"
+>SDL_JOYBUTTONDOWN</TT
+> event is triggered when a button is pressed and the <TT
+CLASS="LITERAL"
+>SDL_JOYBUTTONUP</TT
+> event is fired when a button is released. We do have to know what button was pressed though, that is done by reading the <TT
+CLASS="STRUCTFIELD"
+><I
+>event.jbutton.button</I
+></TT
+> field.</P
+><P
+>Lastly when we are through using our joysticks we should close them with a call to <A
+HREF="sdljoystickclose.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickClose</TT
+></A
+>. To close our opened joystick 0 we would do this at the end of our program:
+<PRE
+CLASS="PROGRAMLISTING"
+> SDL_JoystickClose(joystick);</PRE
+></P
+></DIV
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN214"
+></A
+>Advanced Joystick Functions</H2
+><P
+>That takes care of the controls that you can count on being on every joystick under the sun, but there are a few extra things that SDL can support. Joyballs are next on our list, they are alot like axis with a few minor differences. Joyballs store relative changes unlike the the absolute postion stored in a axis event. Also one trackball event contains both the change in x and they change in y. Our case for it is as follows:</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN217"
+></A
+><P
+><B
+>Example 3-7. Joystick Ball Events</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+> case SDL_JOYBALLMOTION: /* Handle Joyball Motion */
+ if( event.jball.ball == 0 )
+ {
+ /* ball handling */
+ }
+ break;</PRE
+></DIV
+><P
+>The above checks the first joyball on the joystick. The change in position will be stored in <TT
+CLASS="STRUCTFIELD"
+><I
+>event.jball.xrel</I
+></TT
+> and <TT
+CLASS="STRUCTFIELD"
+><I
+>event.jball.yrel</I
+></TT
+>.</P
+><P
+>Finally we have the hat event. Hats report only the direction they are pushed in. We check hat's position with the bitmasks:
+
+<P
+></P
+><TABLE
+BORDER="0"
+><TBODY
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_CENTERED</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_UP</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_RIGHT</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_DOWN</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_LEFT</TT
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+>
+
+Also there are some predefined combinations of the above:
+<P
+></P
+><TABLE
+BORDER="0"
+><TBODY
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_RIGHTUP</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_RIGHTDOWN</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_LEFTUP</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_LEFTDOWN</TT
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+>
+
+Our case for the hat may resemble the following:</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN244"
+></A
+><P
+><B
+>Example 3-8. Joystick Hat Events</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+> case SDL_JOYHATMOTION: /* Handle Hat Motion */
+ if ( event.jhat.value &#38; SDL_HAT_UP )
+ {
+ /* Do up stuff here */
+ }
+
+ if ( event.jhat.value &#38; SDL_HAT_LEFT )
+ {
+ /* Do left stuff here */
+ }
+
+ if ( event.jhat.value &#38; SDL_HAT_RIGHTDOWN )
+ {
+ /* Do right and down together stuff here */
+ }
+ break;</PRE
+></DIV
+><P
+>In addition to the queries for number of joysticks on the system and their names there are additional functions to query the capabilities of attached joysticks:
+<P
+></P
+><TABLE
+BORDER="0"
+><TBODY
+><TR
+><TD
+><A
+HREF="sdljoysticknumaxes.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickNumAxes</TT
+></A
+></TD
+><TD
+>Returns the number of joysitck axes</TD
+></TR
+><TR
+><TD
+><A
+HREF="sdljoysticknumbuttons.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickNumButtons</TT
+></A
+></TD
+><TD
+>Returns the number of joysitck buttons</TD
+></TR
+><TR
+><TD
+><A
+HREF="sdljoysticknumballs.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickNumBalls</TT
+></A
+></TD
+><TD
+>Returns the number of joysitck balls</TD
+></TR
+><TR
+><TD
+><A
+HREF="sdljoysticknumhats.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickNumHats</TT
+></A
+></TD
+><TD
+>Returns the number of joysitck hats</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+>
+
+To use these functions we just have to pass in the joystick structure we got when we opened the joystick. For Example:</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN265"
+></A
+><P
+><B
+>Example 3-9. Querying Joystick Characteristics</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+> int number_of_buttons;
+ SDL_Joystick *joystick;
+
+ joystick = SDL_JoystickOpen(0);
+ number_of_buttons = SDL_JoystickNumButtons(joystick);</PRE
+></DIV
+><P
+>This block of code would get the number of buttons on the first joystick in the system. </P
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="guidevideoopengl.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="guideinputkeyboard.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Using OpenGL With SDL</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="guide.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Handling the Keyboard</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/guideinputkeyboard.html b/distrib/sdl-1.2.15/docs/html/guideinputkeyboard.html
new file mode 100644
index 0000000..787036c
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/guideinputkeyboard.html
@@ -0,0 +1,746 @@
+<HTML
+><HEAD
+><TITLE
+>Handling the Keyboard</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Input handling"
+HREF="guideinput.html"><LINK
+REL="PREVIOUS"
+TITLE="Input handling"
+HREF="guideinput.html"><LINK
+REL="NEXT"
+TITLE="Examples"
+HREF="guideexamples.html"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="guideinput.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 3. Input handling</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="guideexamples.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="GUIDEINPUTKEYBOARD"
+></A
+>Handling the Keyboard</H1
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN271"
+></A
+>Keyboard Related Structures</H2
+><P
+>It should make it a lot easier to understand this tutorial is you are familiar with the data types involved in keyboard access, so I'll explain them first.</P
+><DIV
+CLASS="SECT3"
+><H3
+CLASS="SECT3"
+><A
+NAME="AEN274"
+></A
+>SDLKey</H3
+><P
+><SPAN
+CLASS="STRUCTNAME"
+>SDLKey</SPAN
+> is an enumerated type defined in SDL/include/SDL_keysym.h and detailed <A
+HREF="sdlkey.html"
+>here</A
+>. Each <SPAN
+CLASS="STRUCTNAME"
+>SDLKey</SPAN
+> symbol represents a key, <TT
+CLASS="LITERAL"
+>SDLK_a</TT
+> corresponds to the 'a' key on a keyboard, <TT
+CLASS="LITERAL"
+>SDLK_SPACE</TT
+> corresponds to the space bar, and so on.</P
+></DIV
+><DIV
+CLASS="SECT3"
+><H3
+CLASS="SECT3"
+><A
+NAME="AEN282"
+></A
+>SDLMod</H3
+><P
+>SDLMod is an enumerated type, similar to <SPAN
+CLASS="STRUCTNAME"
+>SDLKey</SPAN
+>, however it enumerates keyboard modifiers (Control, Alt, Shift). The full list of modifier symbols is <A
+HREF="sdlkey.html#SDLMOD"
+>here</A
+>. <SPAN
+CLASS="STRUCTNAME"
+>SDLMod</SPAN
+> values can be AND'd together to represent several modifiers.</P
+></DIV
+><DIV
+CLASS="SECT3"
+><H3
+CLASS="SECT3"
+><A
+NAME="AEN288"
+></A
+>SDL_keysym</H3
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ Uint8 scancode;
+ SDLKey sym;
+ SDLMod mod;
+ Uint16 unicode;
+} SDL_keysym;</PRE
+><P
+>The <SPAN
+CLASS="STRUCTNAME"
+>SDL_keysym</SPAN
+> structure describes a key press or a key release. The <TT
+CLASS="STRUCTFIELD"
+><I
+>scancode</I
+></TT
+> field is hardware specific and should be ignored unless you know what your doing. The <TT
+CLASS="STRUCTFIELD"
+><I
+>sym</I
+></TT
+> field is the <SPAN
+CLASS="STRUCTNAME"
+>SDLKey</SPAN
+> value of the key being pressed or released. The <TT
+CLASS="STRUCTFIELD"
+><I
+>mod</I
+></TT
+> field describes the state of the keyboard modifiers at the time the key press or release occurred. So a value of <TT
+CLASS="LITERAL"
+>KMOD_NUM | KMOD_CAPS | KMOD_LSHIFT</TT
+> would mean that Numlock, Capslock and the left shift key were all press (or enabled in the case of the lock keys). Finally, the <TT
+CLASS="STRUCTFIELD"
+><I
+>unicode</I
+></TT
+> field stores the 16-bit unicode value of the key.</P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>It should be noted and understood that this field is only valid when the <SPAN
+CLASS="STRUCTNAME"
+>SDL_keysym</SPAN
+> is describing a key press, not a key release. Unicode values only make sense on a key press because the unicode value describes an international character and only key presses produce characters. More information on Unicode can be found at <A
+HREF="http://www.unicode.org"
+TARGET="_top"
+>www.unicode.org</A
+></P
+></BLOCKQUOTE
+></DIV
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>Unicode translation must be enabled using the <A
+HREF="sdlenableunicode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_EnableUNICODE</TT
+></A
+> function.</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="SECT3"
+><H3
+CLASS="SECT3"
+><A
+NAME="AEN307"
+></A
+>SDL_KeyboardEvent</H3
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ Uint8 type;
+ Uint8 state;
+ SDL_keysym keysym;
+} SDL_KeyboardEvent;</PRE
+><P
+>The <SPAN
+CLASS="STRUCTNAME"
+>SDL_KeyboardEvent</SPAN
+> describes a keyboard event (obviously). The <TT
+CLASS="STRUCTFIELD"
+><I
+>key</I
+></TT
+> member of the <A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+> union is a <SPAN
+CLASS="STRUCTNAME"
+>SDL_KeyboardEvent</SPAN
+> structure. The <TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+> field specifies whether the event is a key release (<TT
+CLASS="LITERAL"
+>SDL_KEYUP</TT
+>) or a key press (<TT
+CLASS="LITERAL"
+>SDL_KEYDOWN</TT
+>) event. The <TT
+CLASS="STRUCTFIELD"
+><I
+>state</I
+></TT
+> is largely redundant, it reports the same information as the <TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+> field but uses different values (<TT
+CLASS="LITERAL"
+>SDL_RELEASED</TT
+> and <TT
+CLASS="LITERAL"
+>SDL_PRESSED</TT
+>). The <TT
+CLASS="STRUCTFIELD"
+><I
+>keysym</I
+></TT
+> contains information of the key press or release that this event represents (see above).</P
+></DIV
+></DIV
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN324"
+></A
+>Reading Keyboard Events</H2
+><P
+>Reading keybaord events from the event queue is quite simple (the event queue and using it is described <A
+HREF="sdlevent.html"
+>here</A
+>). We read events using <A
+HREF="sdlpollevent.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PollEvent</TT
+></A
+> in a <TT
+CLASS="LITERAL"
+>while()</TT
+> loop and check for <TT
+CLASS="LITERAL"
+>SDL_KEYUP</TT
+> and <TT
+CLASS="LITERAL"
+>SDL_KEYDOWN</TT
+> events using a <TT
+CLASS="LITERAL"
+>switch</TT
+> statement, like so:</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN334"
+></A
+><P
+><B
+>Example 3-10. Reading Keyboard Events</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+> SDL_Event event;
+ .
+ .
+ /* Poll for events. SDL_PollEvent() returns 0 when there are no */
+ /* more events on the event queue, our while loop will exit when */
+ /* that occurs. */
+ while( SDL_PollEvent( &#38;event ) ){
+ /* We are only worried about SDL_KEYDOWN and SDL_KEYUP events */
+ switch( event.type ){
+ case SDL_KEYDOWN:
+ printf( "Key press detected\n" );
+ break;
+
+ case SDL_KEYUP:
+ printf( "Key release detected\n" );
+ break;
+
+ default:
+ break;
+ }
+ }
+ .
+ .</PRE
+></DIV
+><P
+>This is a very basic example. No information about the key press or release is interpreted. We will explore the other extreme out our first full example below - reporting all available information about a keyboard event.</P
+></DIV
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN338"
+></A
+>A More Detailed Look</H2
+><P
+>Before we can read events SDL must be initialised with <A
+HREF="sdlinit.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+></A
+> and a video mode must be set using <A
+HREF="sdlsetvideomode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+></A
+>. There are, however, two other functions we must use to obtain all the information required. We must enable unicode translation by calling <TT
+CLASS="FUNCTION"
+>SDL_EnableUNICODE(1)</TT
+> and we must convert <SPAN
+CLASS="STRUCTNAME"
+>SDLKey</SPAN
+> values into something printable, using <A
+HREF="sdlgetkeyname.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetKeyName</TT
+></A
+></P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>It is useful to note that unicode values &#60; 0x80 translate directly a characters ASCII value. THis is used in the example below</P
+></BLOCKQUOTE
+></DIV
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN351"
+></A
+><P
+><B
+>Example 3-11. Interpreting Key Event Information</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+>&#13; #include "SDL.h"
+
+ /* Function Prototypes */
+ void PrintKeyInfo( SDL_KeyboardEvent *key );
+ void PrintModifiers( SDLMod mod );
+
+ /* main */
+ int main( int argc, char *argv[] ){
+
+ SDL_Event event;
+ int quit = 0;
+
+ /* Initialise SDL */
+ if( SDL_Init( SDL_INIT_VIDEO ) &#60; 0){
+ fprintf( stderr, "Could not initialise SDL: %s\n", SDL_GetError() );
+ exit( -1 );
+ }
+
+ /* Set a video mode */
+ if( !SDL_SetVideoMode( 320, 200, 0, 0 ) ){
+ fprintf( stderr, "Could not set video mode: %s\n", SDL_GetError() );
+ SDL_Quit();
+ exit( -1 );
+ }
+
+ /* Enable Unicode translation */
+ SDL_EnableUNICODE( 1 );
+
+ /* Loop until an SDL_QUIT event is found */
+ while( !quit ){
+
+ /* Poll for events */
+ while( SDL_PollEvent( &#38;event ) ){
+
+ switch( event.type ){
+ /* Keyboard event */
+ /* Pass the event data onto PrintKeyInfo() */
+ case SDL_KEYDOWN:
+ case SDL_KEYUP:
+ PrintKeyInfo( &#38;event.key );
+ break;
+
+ /* SDL_QUIT event (window close) */
+ case SDL_QUIT:
+ quit = 1;
+ break;
+
+ default:
+ break;
+ }
+
+ }
+
+ }
+
+ /* Clean up */
+ SDL_Quit();
+ exit( 0 );
+ }
+
+ /* Print all information about a key event */
+ void PrintKeyInfo( SDL_KeyboardEvent *key ){
+ /* Is it a release or a press? */
+ if( key-&#62;type == SDL_KEYUP )
+ printf( "Release:- " );
+ else
+ printf( "Press:- " );
+
+ /* Print the hardware scancode first */
+ printf( "Scancode: 0x%02X", key-&#62;keysym.scancode );
+ /* Print the name of the key */
+ printf( ", Name: %s", SDL_GetKeyName( key-&#62;keysym.sym ) );
+ /* We want to print the unicode info, but we need to make */
+ /* sure its a press event first (remember, release events */
+ /* don't have unicode info */
+ if( key-&#62;type == SDL_KEYDOWN ){
+ /* If the Unicode value is less than 0x80 then the */
+ /* unicode value can be used to get a printable */
+ /* representation of the key, using (char)unicode. */
+ printf(", Unicode: " );
+ if( key-&#62;keysym.unicode &#60; 0x80 &#38;&#38; key-&#62;keysym.unicode &#62; 0 ){
+ printf( "%c (0x%04X)", (char)key-&#62;keysym.unicode,
+ key-&#62;keysym.unicode );
+ }
+ else{
+ printf( "? (0x%04X)", key-&#62;keysym.unicode );
+ }
+ }
+ printf( "\n" );
+ /* Print modifier info */
+ PrintModifiers( key-&#62;keysym.mod );
+ }
+
+ /* Print modifier info */
+ void PrintModifiers( SDLMod mod ){
+ printf( "Modifers: " );
+
+ /* If there are none then say so and return */
+ if( mod == KMOD_NONE ){
+ printf( "None\n" );
+ return;
+ }
+
+ /* Check for the presence of each SDLMod value */
+ /* This looks messy, but there really isn't */
+ /* a clearer way. */
+ if( mod &#38; KMOD_NUM ) printf( "NUMLOCK " );
+ if( mod &#38; KMOD_CAPS ) printf( "CAPSLOCK " );
+ if( mod &#38; KMOD_LCTRL ) printf( "LCTRL " );
+ if( mod &#38; KMOD_RCTRL ) printf( "RCTRL " );
+ if( mod &#38; KMOD_RSHIFT ) printf( "RSHIFT " );
+ if( mod &#38; KMOD_LSHIFT ) printf( "LSHIFT " );
+ if( mod &#38; KMOD_RALT ) printf( "RALT " );
+ if( mod &#38; KMOD_LALT ) printf( "LALT " );
+ if( mod &#38; KMOD_CTRL ) printf( "CTRL " );
+ if( mod &#38; KMOD_SHIFT ) printf( "SHIFT " );
+ if( mod &#38; KMOD_ALT ) printf( "ALT " );
+ printf( "\n" );
+ }</PRE
+></DIV
+></DIV
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN354"
+></A
+>Game-type Input</H2
+><P
+>I have found that people using keyboard events for games and other interactive applications don't always understand one fundemental point.</P
+><A
+NAME="AEN357"
+></A
+><BLOCKQUOTE
+CLASS="BLOCKQUOTE"
+><P
+>Keyboard events <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>only</I
+></SPAN
+> take place when a keys state changes from being unpressed to pressed, and vice versa.</P
+></BLOCKQUOTE
+><P
+>Imagine you have an image of an alien that you wish to move around using the cursor keys: when you pressed the left arrow key you want him to slide over to the left, and when you press the down key you want him to slide down the screen. Examine the following code; it highlights an error that many people have made.
+<PRE
+CLASS="PROGRAMLISTING"
+> /* Alien screen coordinates */
+ int alien_x=0, alien_y=0;
+ .
+ .
+ /* Initialise SDL and video modes and all that */
+ .
+ /* Main game loop */
+ /* Check for events */
+ while( SDL_PollEvent( &#38;event ) ){
+ switch( event.type ){
+ /* Look for a keypress */
+ case SDL_KEYDOWN:
+ /* Check the SDLKey values and move change the coords */
+ switch( event.key.keysym.sym ){
+ case SDLK_LEFT:
+ alien_x -= 1;
+ break;
+ case SDLK_RIGHT:
+ alien_x += 1;
+ break;
+ case SDLK_UP:
+ alien_y -= 1;
+ break;
+ case SDLK_DOWN:
+ alien_y += 1;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+ .
+ .</PRE
+>
+At first glance you may think this is a perfectly reasonable piece of code for the task, but it isn't. Like I said keyboard events only occur when a key changes state, so the user would have to press and release the left cursor key 100 times to move the alien 100 pixels to the left.</P
+><P
+>To get around this problem we must not use the events to change the position of the alien, we use the events to set flags which are then used in a seperate section of code to move the alien. Something like this:</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN363"
+></A
+><P
+><B
+>Example 3-12. Proper Game Movement</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+> /* Alien screen coordinates */
+ int alien_x=0, alien_y=0;
+ int alien_xvel=0, alien_yvel=0;
+ .
+ .
+ /* Initialise SDL and video modes and all that */
+ .
+ /* Main game loop */
+ /* Check for events */
+ while( SDL_PollEvent( &#38;event ) ){
+ switch( event.type ){
+ /* Look for a keypress */
+ case SDL_KEYDOWN:
+ /* Check the SDLKey values and move change the coords */
+ switch( event.key.keysym.sym ){
+ case SDLK_LEFT:
+ alien_xvel = -1;
+ break;
+ case SDLK_RIGHT:
+ alien_xvel = 1;
+ break;
+ case SDLK_UP:
+ alien_yvel = -1;
+ break;
+ case SDLK_DOWN:
+ alien_yvel = 1;
+ break;
+ default:
+ break;
+ }
+ break;
+ /* We must also use the SDL_KEYUP events to zero the x */
+ /* and y velocity variables. But we must also be */
+ /* careful not to zero the velocities when we shouldn't*/
+ case SDL_KEYUP:
+ switch( event.key.keysym.sym ){
+ case SDLK_LEFT:
+ /* We check to make sure the alien is moving */
+ /* to the left. If it is then we zero the */
+ /* velocity. If the alien is moving to the */
+ /* right then the right key is still press */
+ /* so we don't tocuh the velocity */
+ if( alien_xvel &#60; 0 )
+ alien_xvel = 0;
+ break;
+ case SDLK_RIGHT:
+ if( alien_xvel &#62; 0 )
+ alien_xvel = 0;
+ break;
+ case SDLK_UP:
+ if( alien_yvel &#60; 0 )
+ alien_yvel = 0;
+ break;
+ case SDLK_DOWN:
+ if( alien_yvel &#62; 0 )
+ alien_yvel = 0;
+ break;
+ default:
+ break;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+ .
+ .
+ /* Update the alien position */
+ alien_x += alien_xvel;
+ alien_y += alien_yvel;</PRE
+></DIV
+><P
+>As can be seen, we use two extra variables, alien_xvel and alien_yvel, which represent the motion of the ship, it is these variables that we update when we detect keypresses and releases.</P
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="guideinput.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="guideexamples.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Input handling</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="guideinput.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Examples</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/guidepreface.html b/distrib/sdl-1.2.15/docs/html/guidepreface.html
new file mode 100644
index 0000000..9986fc6
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/guidepreface.html
@@ -0,0 +1,178 @@
+<HTML
+><HEAD
+><TITLE
+>Preface</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Guide"
+HREF="guide.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL Guide"
+HREF="guide.html"><LINK
+REL="NEXT"
+TITLE="About SDLdoc"
+HREF="guideaboutsdldoc.html"></HEAD
+><BODY
+CLASS="PREFACE"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="guide.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="guideaboutsdldoc.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="PREFACE"
+><H1
+><A
+NAME="GUIDEPREFACE"
+></A
+>Preface</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="guidepreface.html#GUIDEABOUTSDL"
+>About SDL</A
+></DT
+><DT
+><A
+HREF="guideaboutsdldoc.html"
+>About SDLdoc</A
+></DT
+><DT
+><A
+HREF="guidecredits.html"
+>Credits</A
+></DT
+></DL
+></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="GUIDEABOUTSDL"
+></A
+>About SDL</H1
+><P
+>The SDL library is designed to make it easy to write games that run on Linux, *BSD, MacOS, Win32 and BeOS using the various native high-performance media interfaces, (for video, audio, etc) and presenting a single source-code level API to your application. SDL is a fairly low level API, but using it, completely portable applications can be written with a great deal of flexibility.</P
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="guide.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="guideaboutsdldoc.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL Guide</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="guide.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>About SDLdoc</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/guidethebasics.html b/distrib/sdl-1.2.15/docs/html/guidethebasics.html
new file mode 100644
index 0000000..4f32363
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/guidethebasics.html
@@ -0,0 +1,173 @@
+<HTML
+><HEAD
+><TITLE
+>The Basics</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Guide"
+HREF="guide.html"><LINK
+REL="PREVIOUS"
+TITLE="Credits"
+HREF="guidecredits.html"><LINK
+REL="NEXT"
+TITLE="Initializing SDL"
+HREF="guidebasicsinit.html"></HEAD
+><BODY
+CLASS="CHAPTER"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="guidecredits.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="guidebasicsinit.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="CHAPTER"
+><H1
+><A
+NAME="GUIDETHEBASICS"
+></A
+>Chapter 1. The Basics</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="guidethebasics.html#GUIDEINTRODUCTION"
+>Introduction</A
+></DT
+><DT
+><A
+HREF="guidebasicsinit.html"
+>Initializing SDL</A
+></DT
+></DL
+></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="GUIDEINTRODUCTION"
+></A
+>Introduction</H1
+><P
+>The SDL Guide section is pretty incomplete. If you feel you have anything to add mail akawaka@skynet.ie or visit http://akawaka.csn.ul.ie/tne/.</P
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="guidecredits.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="guidebasicsinit.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Credits</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="guide.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Initializing SDL</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/guidetimeexamples.html b/distrib/sdl-1.2.15/docs/html/guidetimeexamples.html
new file mode 100644
index 0000000..42b5019
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/guidetimeexamples.html
@@ -0,0 +1,183 @@
+<HTML
+><HEAD
+><TITLE
+>Time Examples</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Examples"
+HREF="guideexamples.html"><LINK
+REL="PREVIOUS"
+TITLE="CDROM Examples"
+HREF="guidecdromexamples.html"><LINK
+REL="NEXT"
+TITLE="SDL Reference"
+HREF="reference.html"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="guidecdromexamples.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 4. Examples</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="reference.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="GUIDETIMEEXAMPLES"
+></A
+>Time Examples</H1
+><P
+></P
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN412"
+></A
+>Time based game loop</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>#define TICK_INTERVAL 30
+
+static Uint32 next_time;
+
+Uint32 time_left(void)
+{
+ Uint32 now;
+
+ now = SDL_GetTicks();
+ if(next_time &#60;= now)
+ return 0;
+ else
+ return next_time - now;
+}
+
+
+/* main game loop */
+
+ next_time = SDL_GetTicks() + TICK_INTERVAL;
+ while ( game_running ) {
+ update_game_state();
+ SDL_Delay(time_left());
+ next_time += TICK_INTERVAL;
+ }&#13;</PRE
+></P
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="guidecdromexamples.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="reference.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>CDROM Examples</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="guideexamples.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL Reference</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/guidevideo.html b/distrib/sdl-1.2.15/docs/html/guidevideo.html
new file mode 100644
index 0000000..85da77d
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/guidevideo.html
@@ -0,0 +1,463 @@
+<HTML
+><HEAD
+><TITLE
+>Graphics and Video</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Guide"
+HREF="guide.html"><LINK
+REL="PREVIOUS"
+TITLE="Initializing SDL"
+HREF="guidebasicsinit.html"><LINK
+REL="NEXT"
+TITLE="Using OpenGL With SDL"
+HREF="guidevideoopengl.html"></HEAD
+><BODY
+CLASS="CHAPTER"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="guidebasicsinit.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="guidevideoopengl.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="CHAPTER"
+><H1
+><A
+NAME="GUIDEVIDEO"
+></A
+>Chapter 2. Graphics and Video</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="guidevideo.html#GUIDEVIDEOINTRO"
+>Introduction to SDL Video</A
+></DT
+><DT
+><A
+HREF="guidevideoopengl.html"
+>Using OpenGL With SDL</A
+></DT
+></DL
+></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="GUIDEVIDEOINTRO"
+></A
+>Introduction to SDL Video</H1
+><P
+>Video is probably the most common thing that SDL is used for, and
+so it has the most complete subsystem. Here are a few
+examples to demonstrate the basics.</P
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN68"
+></A
+>Initializing the Video Display</H2
+><P
+>This is what almost all SDL programs have to do in one way or
+another.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN71"
+></A
+><P
+><B
+>Example 2-1. Initializing the Video Display</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+> SDL_Surface *screen;
+
+ /* Initialize the SDL library */
+ if( SDL_Init(SDL_INIT_VIDEO) &#60; 0 ) {
+ fprintf(stderr,
+ "Couldn't initialize SDL: %s\n", SDL_GetError());
+ exit(1);
+ }
+
+ /* Clean up on exit */
+ atexit(SDL_Quit);
+
+ /*
+ * Initialize the display in a 640x480 8-bit palettized mode,
+ * requesting a software surface
+ */
+ screen = SDL_SetVideoMode(640, 480, 8, SDL_SWSURFACE);
+ if ( screen == NULL ) {
+ fprintf(stderr, "Couldn't set 640x480x8 video mode: %s\n",
+ SDL_GetError());
+ exit(1);
+ }</PRE
+></DIV
+></DIV
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN74"
+></A
+>Initializing the Best Video Mode</H2
+><P
+>If you have a preference for a certain pixel depth but will accept any
+other, use SDL_SetVideoMode with SDL_ANYFORMAT as below. You can also
+use SDL_VideoModeOK() to find the native video mode that is closest to
+the mode you request.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN77"
+></A
+><P
+><B
+>Example 2-2. Initializing the Best Video Mode</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+> /* Have a preference for 8-bit, but accept any depth */
+ screen = SDL_SetVideoMode(640, 480, 8, SDL_SWSURFACE|SDL_ANYFORMAT);
+ if ( screen == NULL ) {
+ fprintf(stderr, "Couldn't set 640x480x8 video mode: %s\n",
+ SDL_GetError());
+ exit(1);
+ }
+ printf("Set 640x480 at %d bits-per-pixel mode\n",
+ screen-&#62;format-&#62;BitsPerPixel);</PRE
+></DIV
+></DIV
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN80"
+></A
+>Loading and Displaying a BMP File</H2
+><P
+>The following function loads and displays a BMP file given as
+argument, once SDL is initialised and a video mode has been set.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN83"
+></A
+><P
+><B
+>Example 2-3. Loading and Displaying a BMP File</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+>void display_bmp(char *file_name)
+{
+ SDL_Surface *image;
+
+ /* Load the BMP file into a surface */
+ image = SDL_LoadBMP(file_name);
+ if (image == NULL) {
+ fprintf(stderr, "Couldn't load %s: %s\n", file_name, SDL_GetError());
+ return;
+ }
+
+ /*
+ * Palettized screen modes will have a default palette (a standard
+ * 8*8*4 colour cube), but if the image is palettized as well we can
+ * use that palette for a nicer colour matching
+ */
+ if (image-&#62;format-&#62;palette &#38;&#38; screen-&#62;format-&#62;palette) {
+ SDL_SetColors(screen, image-&#62;format-&#62;palette-&#62;colors, 0,
+ image-&#62;format-&#62;palette-&#62;ncolors);
+ }
+
+ /* Blit onto the screen surface */
+ if(SDL_BlitSurface(image, NULL, screen, NULL) &#60; 0)
+ fprintf(stderr, "BlitSurface error: %s\n", SDL_GetError());
+
+ SDL_UpdateRect(screen, 0, 0, image-&#62;w, image-&#62;h);
+
+ /* Free the allocated BMP surface */
+ SDL_FreeSurface(image);
+}</PRE
+></DIV
+></DIV
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN86"
+></A
+>Drawing Directly to the Display</H2
+><P
+>The following two functions can be used to get and set single
+pixels of a surface. They are carefully written to work with any depth
+currently supported by SDL. Remember to lock the surface before
+calling them, and to unlock it before calling any other SDL
+functions.</P
+><P
+>To convert between pixel values and their red, green, blue
+components, use SDL_GetRGB() and SDL_MapRGB().</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN90"
+></A
+><P
+><B
+>Example 2-4. getpixel()</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+>/*
+ * Return the pixel value at (x, y)
+ * NOTE: The surface must be locked before calling this!
+ */
+Uint32 getpixel(SDL_Surface *surface, int x, int y)
+{
+ int bpp = surface-&#62;format-&#62;BytesPerPixel;
+ /* Here p is the address to the pixel we want to retrieve */
+ Uint8 *p = (Uint8 *)surface-&#62;pixels + y * surface-&#62;pitch + x * bpp;
+
+ switch(bpp) {
+ case 1:
+ return *p;
+
+ case 2:
+ return *(Uint16 *)p;
+
+ case 3:
+ if(SDL_BYTEORDER == SDL_BIG_ENDIAN)
+ return p[0] &#60;&#60; 16 | p[1] &#60;&#60; 8 | p[2];
+ else
+ return p[0] | p[1] &#60;&#60; 8 | p[2] &#60;&#60; 16;
+
+ case 4:
+ return *(Uint32 *)p;
+
+ default:
+ return 0; /* shouldn't happen, but avoids warnings */
+ }
+}</PRE
+></DIV
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN93"
+></A
+><P
+><B
+>Example 2-5. putpixel()</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+>/*
+ * Set the pixel at (x, y) to the given value
+ * NOTE: The surface must be locked before calling this!
+ */
+void putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel)
+{
+ int bpp = surface-&#62;format-&#62;BytesPerPixel;
+ /* Here p is the address to the pixel we want to set */
+ Uint8 *p = (Uint8 *)surface-&#62;pixels + y * surface-&#62;pitch + x * bpp;
+
+ switch(bpp) {
+ case 1:
+ *p = pixel;
+ break;
+
+ case 2:
+ *(Uint16 *)p = pixel;
+ break;
+
+ case 3:
+ if(SDL_BYTEORDER == SDL_BIG_ENDIAN) {
+ p[0] = (pixel &#62;&#62; 16) &#38; 0xff;
+ p[1] = (pixel &#62;&#62; 8) &#38; 0xff;
+ p[2] = pixel &#38; 0xff;
+ } else {
+ p[0] = pixel &#38; 0xff;
+ p[1] = (pixel &#62;&#62; 8) &#38; 0xff;
+ p[2] = (pixel &#62;&#62; 16) &#38; 0xff;
+ }
+ break;
+
+ case 4:
+ *(Uint32 *)p = pixel;
+ break;
+ }
+}</PRE
+></DIV
+><P
+>The following code uses the putpixel() function above to set a
+yellow pixel in the middle of the screen.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN97"
+></A
+><P
+><B
+>Example 2-6. Using putpixel()</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+>&#13; /* Code to set a yellow pixel at the center of the screen */
+
+ int x, y;
+ Uint32 yellow;
+
+ /* Map the color yellow to this display (R=0xff, G=0xFF, B=0x00)
+ Note: If the display is palettized, you must set the palette first.
+ */
+ yellow = SDL_MapRGB(screen-&#62;format, 0xff, 0xff, 0x00);
+
+ x = screen-&#62;w / 2;
+ y = screen-&#62;h / 2;
+
+ /* Lock the screen for direct access to the pixels */
+ if ( SDL_MUSTLOCK(screen) ) {
+ if ( SDL_LockSurface(screen) &#60; 0 ) {
+ fprintf(stderr, "Can't lock screen: %s\n", SDL_GetError());
+ return;
+ }
+ }
+
+ putpixel(screen, x, y, yellow);
+
+ if ( SDL_MUSTLOCK(screen) ) {
+ SDL_UnlockSurface(screen);
+ }
+ /* Update just the part of the display that we've changed */
+ SDL_UpdateRect(screen, x, y, 1, 1);
+
+ return;&#13;</PRE
+></DIV
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="guidebasicsinit.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="guidevideoopengl.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Initializing SDL</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="guide.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Using OpenGL With SDL</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/guidevideoopengl.html b/distrib/sdl-1.2.15/docs/html/guidevideoopengl.html
new file mode 100644
index 0000000..0abd567
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/guidevideoopengl.html
@@ -0,0 +1,730 @@
+<HTML
+><HEAD
+><TITLE
+>Using OpenGL With SDL</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Graphics and Video"
+HREF="guidevideo.html"><LINK
+REL="PREVIOUS"
+TITLE="Graphics and Video"
+HREF="guidevideo.html"><LINK
+REL="NEXT"
+TITLE="Input handling"
+HREF="guideinput.html"></HEAD
+><BODY
+CLASS="SECT1"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="guidevideo.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+>Chapter 2. Graphics and Video</TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="guideinput.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="SECT1"
+><H1
+CLASS="SECT1"
+><A
+NAME="GUIDEVIDEOOPENGL"
+></A
+>Using OpenGL With SDL</H1
+><P
+>SDL has the ability to create and use OpenGL contexts on several platforms(Linux/X11, Win32, BeOS, MacOS Classic/Toolbox, Mac OS X, FreeBSD/X11 and Solaris/X11). This allows you to use SDL's audio, event handling, threads and times in your OpenGL applications (a function often performed by GLUT).</P
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN103"
+></A
+>Initialisation</H2
+><P
+>Initialising SDL to use OpenGL is not very different to initialising SDL normally. There are three differences; you must pass <TT
+CLASS="LITERAL"
+>SDL_OPENGL</TT
+> to <A
+HREF="sdlsetvideomode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+></A
+>, you must specify several GL attributes (depth buffer size, framebuffer sizes) using <A
+HREF="sdlglsetattribute.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GL_SetAttribute</TT
+></A
+> and finally, if you wish to use double buffering you must specify it as a GL attribute, <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>not</I
+></SPAN
+> by passing the <TT
+CLASS="LITERAL"
+>SDL_DOUBLEBUF</TT
+> flag to <TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+>.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN114"
+></A
+><P
+><B
+>Example 2-7. Initializing SDL with OpenGL</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+> /* Information about the current video settings. */
+ const SDL_VideoInfo* info = NULL;
+ /* Dimensions of our window. */
+ int width = 0;
+ int height = 0;
+ /* Color depth in bits of our window. */
+ int bpp = 0;
+ /* Flags we will pass into SDL_SetVideoMode. */
+ int flags = 0;
+
+ /* First, initialize SDL's video subsystem. */
+ if( SDL_Init( SDL_INIT_VIDEO ) &#60; 0 ) {
+ /* Failed, exit. */
+ fprintf( stderr, "Video initialization failed: %s\n",
+ SDL_GetError( ) );
+ quit_tutorial( 1 );
+ }
+
+ /* Let's get some video information. */
+ info = SDL_GetVideoInfo( );
+
+ if( !info ) {
+ /* This should probably never happen. */
+ fprintf( stderr, "Video query failed: %s\n",
+ SDL_GetError( ) );
+ quit_tutorial( 1 );
+ }
+
+ /*
+ * Set our width/height to 640/480 (you would
+ * of course let the user decide this in a normal
+ * app). We get the bpp we will request from
+ * the display. On X11, VidMode can't change
+ * resolution, so this is probably being overly
+ * safe. Under Win32, ChangeDisplaySettings
+ * can change the bpp.
+ */
+ width = 640;
+ height = 480;
+ bpp = info-&#62;vfmt-&#62;BitsPerPixel;
+
+ /*
+ * Now, we want to setup our requested
+ * window attributes for our OpenGL window.
+ * We want *at least* 5 bits of red, green
+ * and blue. We also want at least a 16-bit
+ * depth buffer.
+ *
+ * The last thing we do is request a double
+ * buffered window. '1' turns on double
+ * buffering, '0' turns it off.
+ *
+ * Note that we do not use SDL_DOUBLEBUF in
+ * the flags to SDL_SetVideoMode. That does
+ * not affect the GL attribute state, only
+ * the standard 2D blitting setup.
+ */
+ SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
+ SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
+ SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
+ SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
+ SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
+
+ /*
+ * We want to request that SDL provide us
+ * with an OpenGL window, in a fullscreen
+ * video mode.
+ *
+ * EXERCISE:
+ * Make starting windowed an option, and
+ * handle the resize events properly with
+ * glViewport.
+ */
+ flags = SDL_OPENGL | SDL_FULLSCREEN;
+
+ /*
+ * Set the video mode
+ */
+ if( SDL_SetVideoMode( width, height, bpp, flags ) == 0 ) {
+ /*
+ * This could happen for a variety of reasons,
+ * including DISPLAY not being set, the specified
+ * resolution not being available, etc.
+ */
+ fprintf( stderr, "Video mode set failed: %s\n",
+ SDL_GetError( ) );
+ quit_tutorial( 1 );
+ }</PRE
+></DIV
+></DIV
+><DIV
+CLASS="SECT2"
+><H2
+CLASS="SECT2"
+><A
+NAME="AEN117"
+></A
+>Drawing</H2
+><P
+>Apart from initialisation, using OpenGL within SDL is the same as using OpenGL
+with any other API, e.g. GLUT. You still use all the same function calls and
+data types. However if you are using a double-buffered display, then you must
+use
+<A
+HREF="sdlglswapbuffers.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GL_SwapBuffers()</TT
+></A
+>
+to swap the buffers and update the display. To request double-buffering
+with OpenGL, use
+<A
+HREF="sdlglsetattribute.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GL_SetAttribute</TT
+></A
+>
+with <TT
+CLASS="LITERAL"
+>SDL_GL_DOUBLEBUFFER</TT
+>, and use
+<A
+HREF="sdlglgetattribute.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GL_GetAttribute</TT
+></A
+>
+to see if you actually got it.</P
+><P
+>A full example code listing is now presented below.</P
+><DIV
+CLASS="EXAMPLE"
+><A
+NAME="AEN128"
+></A
+><P
+><B
+>Example 2-8. SDL and OpenGL</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+>/*
+ * SDL OpenGL Tutorial.
+ * (c) Michael Vance, 2000
+ * briareos@lokigames.com
+ *
+ * Distributed under terms of the LGPL.
+ */
+
+#include &#60;SDL/SDL.h&#62;
+#include &#60;GL/gl.h&#62;
+#include &#60;GL/glu.h&#62;
+
+#include &#60;stdio.h&#62;
+#include &#60;stdlib.h&#62;
+
+static GLboolean should_rotate = GL_TRUE;
+
+static void quit_tutorial( int code )
+{
+ /*
+ * Quit SDL so we can release the fullscreen
+ * mode and restore the previous video settings,
+ * etc.
+ */
+ SDL_Quit( );
+
+ /* Exit program. */
+ exit( code );
+}
+
+static void handle_key_down( SDL_keysym* keysym )
+{
+
+ /*
+ * We're only interested if 'Esc' has
+ * been presssed.
+ *
+ * EXERCISE:
+ * Handle the arrow keys and have that change the
+ * viewing position/angle.
+ */
+ switch( keysym-&#62;sym ) {
+ case SDLK_ESCAPE:
+ quit_tutorial( 0 );
+ break;
+ case SDLK_SPACE:
+ should_rotate = !should_rotate;
+ break;
+ default:
+ break;
+ }
+
+}
+
+static void process_events( void )
+{
+ /* Our SDL event placeholder. */
+ SDL_Event event;
+
+ /* Grab all the events off the queue. */
+ while( SDL_PollEvent( &#38;event ) ) {
+
+ switch( event.type ) {
+ case SDL_KEYDOWN:
+ /* Handle key presses. */
+ handle_key_down( &#38;event.key.keysym );
+ break;
+ case SDL_QUIT:
+ /* Handle quit requests (like Ctrl-c). */
+ quit_tutorial( 0 );
+ break;
+ }
+
+ }
+
+}
+
+static void draw_screen( void )
+{
+ /* Our angle of rotation. */
+ static float angle = 0.0f;
+
+ /*
+ * EXERCISE:
+ * Replace this awful mess with vertex
+ * arrays and a call to glDrawElements.
+ *
+ * EXERCISE:
+ * After completing the above, change
+ * it to use compiled vertex arrays.
+ *
+ * EXERCISE:
+ * Verify my windings are correct here ;).
+ */
+ static GLfloat v0[] = { -1.0f, -1.0f, 1.0f };
+ static GLfloat v1[] = { 1.0f, -1.0f, 1.0f };
+ static GLfloat v2[] = { 1.0f, 1.0f, 1.0f };
+ static GLfloat v3[] = { -1.0f, 1.0f, 1.0f };
+ static GLfloat v4[] = { -1.0f, -1.0f, -1.0f };
+ static GLfloat v5[] = { 1.0f, -1.0f, -1.0f };
+ static GLfloat v6[] = { 1.0f, 1.0f, -1.0f };
+ static GLfloat v7[] = { -1.0f, 1.0f, -1.0f };
+ static GLubyte red[] = { 255, 0, 0, 255 };
+ static GLubyte green[] = { 0, 255, 0, 255 };
+ static GLubyte blue[] = { 0, 0, 255, 255 };
+ static GLubyte white[] = { 255, 255, 255, 255 };
+ static GLubyte yellow[] = { 0, 255, 255, 255 };
+ static GLubyte black[] = { 0, 0, 0, 255 };
+ static GLubyte orange[] = { 255, 255, 0, 255 };
+ static GLubyte purple[] = { 255, 0, 255, 0 };
+
+ /* Clear the color and depth buffers. */
+ glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+
+ /* We don't want to modify the projection matrix. */
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity( );
+
+ /* Move down the z-axis. */
+ glTranslatef( 0.0, 0.0, -5.0 );
+
+ /* Rotate. */
+ glRotatef( angle, 0.0, 1.0, 0.0 );
+
+ if( should_rotate ) {
+
+ if( ++angle &#62; 360.0f ) {
+ angle = 0.0f;
+ }
+
+ }
+
+ /* Send our triangle data to the pipeline. */
+ glBegin( GL_TRIANGLES );
+
+ glColor4ubv( red );
+ glVertex3fv( v0 );
+ glColor4ubv( green );
+ glVertex3fv( v1 );
+ glColor4ubv( blue );
+ glVertex3fv( v2 );
+
+ glColor4ubv( red );
+ glVertex3fv( v0 );
+ glColor4ubv( blue );
+ glVertex3fv( v2 );
+ glColor4ubv( white );
+ glVertex3fv( v3 );
+
+ glColor4ubv( green );
+ glVertex3fv( v1 );
+ glColor4ubv( black );
+ glVertex3fv( v5 );
+ glColor4ubv( orange );
+ glVertex3fv( v6 );
+
+ glColor4ubv( green );
+ glVertex3fv( v1 );
+ glColor4ubv( orange );
+ glVertex3fv( v6 );
+ glColor4ubv( blue );
+ glVertex3fv( v2 );
+
+ glColor4ubv( black );
+ glVertex3fv( v5 );
+ glColor4ubv( yellow );
+ glVertex3fv( v4 );
+ glColor4ubv( purple );
+ glVertex3fv( v7 );
+
+ glColor4ubv( black );
+ glVertex3fv( v5 );
+ glColor4ubv( purple );
+ glVertex3fv( v7 );
+ glColor4ubv( orange );
+ glVertex3fv( v6 );
+
+ glColor4ubv( yellow );
+ glVertex3fv( v4 );
+ glColor4ubv( red );
+ glVertex3fv( v0 );
+ glColor4ubv( white );
+ glVertex3fv( v3 );
+
+ glColor4ubv( yellow );
+ glVertex3fv( v4 );
+ glColor4ubv( white );
+ glVertex3fv( v3 );
+ glColor4ubv( purple );
+ glVertex3fv( v7 );
+
+ glColor4ubv( white );
+ glVertex3fv( v3 );
+ glColor4ubv( blue );
+ glVertex3fv( v2 );
+ glColor4ubv( orange );
+ glVertex3fv( v6 );
+
+ glColor4ubv( white );
+ glVertex3fv( v3 );
+ glColor4ubv( orange );
+ glVertex3fv( v6 );
+ glColor4ubv( purple );
+ glVertex3fv( v7 );
+
+ glColor4ubv( green );
+ glVertex3fv( v1 );
+ glColor4ubv( red );
+ glVertex3fv( v0 );
+ glColor4ubv( yellow );
+ glVertex3fv( v4 );
+
+ glColor4ubv( green );
+ glVertex3fv( v1 );
+ glColor4ubv( yellow );
+ glVertex3fv( v4 );
+ glColor4ubv( black );
+ glVertex3fv( v5 );
+
+ glEnd( );
+
+ /*
+ * EXERCISE:
+ * Draw text telling the user that 'Spc'
+ * pauses the rotation and 'Esc' quits.
+ * Do it using vetors and textured quads.
+ */
+
+ /*
+ * Swap the buffers. This this tells the driver to
+ * render the next frame from the contents of the
+ * back-buffer, and to set all rendering operations
+ * to occur on what was the front-buffer.
+ *
+ * Double buffering prevents nasty visual tearing
+ * from the application drawing on areas of the
+ * screen that are being updated at the same time.
+ */
+ SDL_GL_SwapBuffers( );
+}
+
+static void setup_opengl( int width, int height )
+{
+ float ratio = (float) width / (float) height;
+
+ /* Our shading model--Gouraud (smooth). */
+ glShadeModel( GL_SMOOTH );
+
+ /* Culling. */
+ glCullFace( GL_BACK );
+ glFrontFace( GL_CCW );
+ glEnable( GL_CULL_FACE );
+
+ /* Set the clear color. */
+ glClearColor( 0, 0, 0, 0 );
+
+ /* Setup our viewport. */
+ glViewport( 0, 0, width, height );
+
+ /*
+ * Change to the projection matrix and set
+ * our viewing volume.
+ */
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity( );
+ /*
+ * EXERCISE:
+ * Replace this with a call to glFrustum.
+ */
+ gluPerspective( 60.0, ratio, 1.0, 1024.0 );
+}
+
+int main( int argc, char* argv[] )
+{
+ /* Information about the current video settings. */
+ const SDL_VideoInfo* info = NULL;
+ /* Dimensions of our window. */
+ int width = 0;
+ int height = 0;
+ /* Color depth in bits of our window. */
+ int bpp = 0;
+ /* Flags we will pass into SDL_SetVideoMode. */
+ int flags = 0;
+
+ /* First, initialize SDL's video subsystem. */
+ if( SDL_Init( SDL_INIT_VIDEO ) &#60; 0 ) {
+ /* Failed, exit. */
+ fprintf( stderr, "Video initialization failed: %s\n",
+ SDL_GetError( ) );
+ quit_tutorial( 1 );
+ }
+
+ /* Let's get some video information. */
+ info = SDL_GetVideoInfo( );
+
+ if( !info ) {
+ /* This should probably never happen. */
+ fprintf( stderr, "Video query failed: %s\n",
+ SDL_GetError( ) );
+ quit_tutorial( 1 );
+ }
+
+ /*
+ * Set our width/height to 640/480 (you would
+ * of course let the user decide this in a normal
+ * app). We get the bpp we will request from
+ * the display. On X11, VidMode can't change
+ * resolution, so this is probably being overly
+ * safe. Under Win32, ChangeDisplaySettings
+ * can change the bpp.
+ */
+ width = 640;
+ height = 480;
+ bpp = info-&#62;vfmt-&#62;BitsPerPixel;
+
+ /*
+ * Now, we want to setup our requested
+ * window attributes for our OpenGL window.
+ * We want *at least* 5 bits of red, green
+ * and blue. We also want at least a 16-bit
+ * depth buffer.
+ *
+ * The last thing we do is request a double
+ * buffered window. '1' turns on double
+ * buffering, '0' turns it off.
+ *
+ * Note that we do not use SDL_DOUBLEBUF in
+ * the flags to SDL_SetVideoMode. That does
+ * not affect the GL attribute state, only
+ * the standard 2D blitting setup.
+ */
+ SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
+ SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
+ SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
+ SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
+ SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
+
+ /*
+ * We want to request that SDL provide us
+ * with an OpenGL window, in a fullscreen
+ * video mode.
+ *
+ * EXERCISE:
+ * Make starting windowed an option, and
+ * handle the resize events properly with
+ * glViewport.
+ */
+ flags = SDL_OPENGL | SDL_FULLSCREEN;
+
+ /*
+ * Set the video mode
+ */
+ if( SDL_SetVideoMode( width, height, bpp, flags ) == 0 ) {
+ /*
+ * This could happen for a variety of reasons,
+ * including DISPLAY not being set, the specified
+ * resolution not being available, etc.
+ */
+ fprintf( stderr, "Video mode set failed: %s\n",
+ SDL_GetError( ) );
+ quit_tutorial( 1 );
+ }
+
+ /*
+ * At this point, we should have a properly setup
+ * double-buffered window for use with OpenGL.
+ */
+ setup_opengl( width, height );
+
+ /*
+ * Now we want to begin our normal app process--
+ * an event loop with a lot of redrawing.
+ */
+ while( 1 ) {
+ /* Process incoming events. */
+ process_events( );
+ /* Draw the screen. */
+ draw_screen( );
+ }
+
+ /*
+ * EXERCISE:
+ * Record timings using SDL_GetTicks() and
+ * and print out frames per second at program
+ * end.
+ */
+
+ /* Never reached. */
+ return 0;
+}</PRE
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="guidevideo.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="guideinput.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Graphics and Video</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="guidevideo.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Input handling</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/index.html b/distrib/sdl-1.2.15/docs/html/index.html
new file mode 100644
index 0000000..f86ff19
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/index.html
@@ -0,0 +1,1156 @@
+<HTML
+><HEAD
+><TITLE
+></TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="NEXT"
+TITLE="SDL Guide"
+HREF="guide.html"></HEAD
+><BODY
+CLASS="BOOK"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="BOOK"
+><A
+NAME="AEN1"
+></A
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+>I. <A
+HREF="guide.html"
+>SDL Guide</A
+></DT
+><DD
+><DL
+><DT
+><A
+HREF="guidepreface.html"
+>Preface</A
+></DT
+><DD
+><DL
+><DT
+><A
+HREF="guidepreface.html#GUIDEABOUTSDL"
+>About SDL</A
+></DT
+><DT
+><A
+HREF="guideaboutsdldoc.html"
+>About SDLdoc</A
+></DT
+><DT
+><A
+HREF="guidecredits.html"
+>Credits</A
+></DT
+></DL
+></DD
+><DT
+>1. <A
+HREF="guidethebasics.html"
+>The Basics</A
+></DT
+><DD
+><DL
+><DT
+><A
+HREF="guidethebasics.html#GUIDEINTRODUCTION"
+>Introduction</A
+></DT
+><DT
+><A
+HREF="guidebasicsinit.html"
+>Initializing SDL</A
+></DT
+></DL
+></DD
+><DT
+>2. <A
+HREF="guidevideo.html"
+>Graphics and Video</A
+></DT
+><DD
+><DL
+><DT
+><A
+HREF="guidevideo.html#GUIDEVIDEOINTRO"
+>Introduction to SDL Video</A
+></DT
+><DT
+><A
+HREF="guidevideoopengl.html"
+>Using OpenGL With SDL</A
+></DT
+></DL
+></DD
+><DT
+>3. <A
+HREF="guideinput.html"
+>Input handling</A
+></DT
+><DD
+><DL
+><DT
+><A
+HREF="guideinput.html#GUIDEINPUTJOYSTICK"
+>Handling Joysticks</A
+></DT
+><DT
+><A
+HREF="guideinputkeyboard.html"
+>Handling the Keyboard</A
+></DT
+></DL
+></DD
+><DT
+>4. <A
+HREF="guideexamples.html"
+>Examples</A
+></DT
+><DD
+><DL
+><DT
+><A
+HREF="guideexamples.html#AEN369"
+>Introduction</A
+></DT
+><DT
+><A
+HREF="guideeventexamples.html"
+>Event Examples</A
+></DT
+><DT
+><A
+HREF="guideaudioexamples.html"
+>Audio Examples</A
+></DT
+><DT
+><A
+HREF="guidecdromexamples.html"
+>CDROM Examples</A
+></DT
+><DT
+><A
+HREF="guidetimeexamples.html"
+>Time Examples</A
+></DT
+></DL
+></DD
+></DL
+></DD
+><DT
+>II. <A
+HREF="reference.html"
+>SDL Reference</A
+></DT
+><DD
+><DL
+><DT
+>5. <A
+HREF="general.html"
+>General</A
+></DT
+><DD
+><DL
+><DT
+><A
+HREF="sdlinit.html"
+>SDL_Init</A
+>&nbsp;--&nbsp;Initializes SDL</DT
+><DT
+><A
+HREF="sdlinitsubsystem.html"
+>SDL_InitSubSystem</A
+>&nbsp;--&nbsp;Initialize subsystems</DT
+><DT
+><A
+HREF="sdlquitsubsystem.html"
+>SDL_QuitSubSystem</A
+>&nbsp;--&nbsp;Shut down a subsystem</DT
+><DT
+><A
+HREF="sdlquit.html"
+>SDL_Quit</A
+>&nbsp;--&nbsp;Shut down SDL</DT
+><DT
+><A
+HREF="sdlwasinit.html"
+>SDL_WasInit</A
+>&nbsp;--&nbsp;Check which subsystems are initialized</DT
+><DT
+><A
+HREF="sdlgeterror.html"
+>SDL_GetError</A
+>&nbsp;--&nbsp;Get SDL error string</DT
+><DT
+><A
+HREF="sdlenvvars.html"
+>SDL_envvars</A
+>&nbsp;--&nbsp;SDL environment variables</DT
+></DL
+></DD
+><DT
+>6. <A
+HREF="video.html"
+>Video</A
+></DT
+><DD
+><DL
+><DT
+><A
+HREF="sdlgetvideosurface.html"
+>SDL_GetVideoSurface</A
+>&nbsp;--&nbsp;returns a pointer to the current display surface</DT
+><DT
+><A
+HREF="sdlgetvideoinfo.html"
+>SDL_GetVideoInfo</A
+>&nbsp;--&nbsp;returns a pointer to information about the video hardware</DT
+><DT
+><A
+HREF="sdlvideodrivername.html"
+>SDL_VideoDriverName</A
+>&nbsp;--&nbsp;Obtain the name of the video driver</DT
+><DT
+><A
+HREF="sdllistmodes.html"
+>SDL_ListModes</A
+>&nbsp;--&nbsp;Returns a pointer to an array of available screen dimensions for
+the given format and video flags</DT
+><DT
+><A
+HREF="sdlvideomodeok.html"
+>SDL_VideoModeOK</A
+>&nbsp;--&nbsp;Check to see if a particular video mode is supported.</DT
+><DT
+><A
+HREF="sdlsetvideomode.html"
+>SDL_SetVideoMode</A
+>&nbsp;--&nbsp;Set up a video mode with the specified width, height and bits-per-pixel.</DT
+><DT
+><A
+HREF="sdlupdaterect.html"
+>SDL_UpdateRect</A
+>&nbsp;--&nbsp;Makes sure the given area is updated on the given screen.</DT
+><DT
+><A
+HREF="sdlupdaterects.html"
+>SDL_UpdateRects</A
+>&nbsp;--&nbsp;Makes sure the given list of rectangles is updated on the given screen.</DT
+><DT
+><A
+HREF="sdlflip.html"
+>SDL_Flip</A
+>&nbsp;--&nbsp;Swaps screen buffers</DT
+><DT
+><A
+HREF="sdlsetcolors.html"
+>SDL_SetColors</A
+>&nbsp;--&nbsp;Sets a portion of the colormap for the given 8-bit surface.</DT
+><DT
+><A
+HREF="sdlsetpalette.html"
+>SDL_SetPalette</A
+>&nbsp;--&nbsp;Sets the colors in the palette of an 8-bit surface.</DT
+><DT
+><A
+HREF="sdlsetgamma.html"
+>SDL_SetGamma</A
+>&nbsp;--&nbsp;Sets the color gamma function for the display</DT
+><DT
+><A
+HREF="sdlgetgammaramp.html"
+>SDL_GetGammaRamp</A
+>&nbsp;--&nbsp;Gets the color gamma lookup tables for the display</DT
+><DT
+><A
+HREF="sdlsetgammaramp.html"
+>SDL_SetGammaRamp</A
+>&nbsp;--&nbsp;Sets the color gamma lookup tables for the display</DT
+><DT
+><A
+HREF="sdlmaprgb.html"
+>SDL_MapRGB</A
+>&nbsp;--&nbsp;Map a RGB color value to a pixel format.</DT
+><DT
+><A
+HREF="sdlmaprgba.html"
+>SDL_MapRGBA</A
+>&nbsp;--&nbsp;Map a RGBA color value to a pixel format.</DT
+><DT
+><A
+HREF="sdlgetrgb.html"
+>SDL_GetRGB</A
+>&nbsp;--&nbsp;Get RGB values from a pixel in the specified pixel format.</DT
+><DT
+><A
+HREF="sdlgetrgba.html"
+>SDL_GetRGBA</A
+>&nbsp;--&nbsp;Get RGBA values from a pixel in the specified pixel format.</DT
+><DT
+><A
+HREF="sdlcreatergbsurface.html"
+>SDL_CreateRGBSurface</A
+>&nbsp;--&nbsp;Create an empty SDL_Surface</DT
+><DT
+><A
+HREF="sdlcreatergbsurfacefrom.html"
+>SDL_CreateRGBSurfaceFrom</A
+>&nbsp;--&nbsp;Create an SDL_Surface from pixel data</DT
+><DT
+><A
+HREF="sdlfreesurface.html"
+>SDL_FreeSurface</A
+>&nbsp;--&nbsp;Frees (deletes) a SDL_Surface</DT
+><DT
+><A
+HREF="sdllocksurface.html"
+>SDL_LockSurface</A
+>&nbsp;--&nbsp;Lock a surface for directly access.</DT
+><DT
+><A
+HREF="sdlunlocksurface.html"
+>SDL_UnlockSurface</A
+>&nbsp;--&nbsp;Unlocks a previously locked surface.</DT
+><DT
+><A
+HREF="sdlloadbmp.html"
+>SDL_LoadBMP</A
+>&nbsp;--&nbsp;Load a Windows BMP file into an SDL_Surface.</DT
+><DT
+><A
+HREF="sdlsavebmp.html"
+>SDL_SaveBMP</A
+>&nbsp;--&nbsp;Save an SDL_Surface as a Windows BMP file.</DT
+><DT
+><A
+HREF="sdlsetcolorkey.html"
+>SDL_SetColorKey</A
+>&nbsp;--&nbsp;Sets the color key (transparent pixel) in a blittable surface and
+RLE acceleration.</DT
+><DT
+><A
+HREF="sdlsetalpha.html"
+>SDL_SetAlpha</A
+>&nbsp;--&nbsp;Adjust the alpha properties of a surface</DT
+><DT
+><A
+HREF="sdlsetcliprect.html"
+>SDL_SetClipRect</A
+>&nbsp;--&nbsp;Sets the clipping rectangle for a surface.</DT
+><DT
+><A
+HREF="sdlgetcliprect.html"
+>SDL_GetClipRect</A
+>&nbsp;--&nbsp;Gets the clipping rectangle for a surface.</DT
+><DT
+><A
+HREF="sdlconvertsurface.html"
+>SDL_ConvertSurface</A
+>&nbsp;--&nbsp;Converts a surface to the same format as another surface.</DT
+><DT
+><A
+HREF="sdlblitsurface.html"
+>SDL_BlitSurface</A
+>&nbsp;--&nbsp;This performs a fast blit from the source surface to the destination surface.</DT
+><DT
+><A
+HREF="sdlfillrect.html"
+>SDL_FillRect</A
+>&nbsp;--&nbsp;This function performs a fast fill of the given rectangle with some color</DT
+><DT
+><A
+HREF="sdldisplayformat.html"
+>SDL_DisplayFormat</A
+>&nbsp;--&nbsp;Convert a surface to the display format</DT
+><DT
+><A
+HREF="sdldisplayformatalpha.html"
+>SDL_DisplayFormatAlpha</A
+>&nbsp;--&nbsp;Convert a surface to the display format</DT
+><DT
+><A
+HREF="sdlwarpmouse.html"
+>SDL_WarpMouse</A
+>&nbsp;--&nbsp;Set the position of the mouse cursor.</DT
+><DT
+><A
+HREF="sdlcreatecursor.html"
+>SDL_CreateCursor</A
+>&nbsp;--&nbsp;Creates a new mouse cursor.</DT
+><DT
+><A
+HREF="sdlfreecursor.html"
+>SDL_FreeCursor</A
+>&nbsp;--&nbsp;Frees a cursor created with SDL_CreateCursor.</DT
+><DT
+><A
+HREF="sdlsetcursor.html"
+>SDL_SetCursor</A
+>&nbsp;--&nbsp;Set the currently active mouse cursor.</DT
+><DT
+><A
+HREF="sdlgetcursor.html"
+>SDL_GetCursor</A
+>&nbsp;--&nbsp;Get the currently active mouse cursor.</DT
+><DT
+><A
+HREF="sdlshowcursor.html"
+>SDL_ShowCursor</A
+>&nbsp;--&nbsp;Toggle whether or not the cursor is shown on the screen.</DT
+><DT
+><A
+HREF="sdlglloadlibrary.html"
+>SDL_GL_LoadLibrary</A
+>&nbsp;--&nbsp;Specify an OpenGL library</DT
+><DT
+><A
+HREF="sdlglgetprocaddress.html"
+>SDL_GL_GetProcAddress</A
+>&nbsp;--&nbsp;Get the address of a GL function</DT
+><DT
+><A
+HREF="sdlglgetattribute.html"
+>SDL_GL_GetAttribute</A
+>&nbsp;--&nbsp;Get the value of a special SDL/OpenGL attribute</DT
+><DT
+><A
+HREF="sdlglsetattribute.html"
+>SDL_GL_SetAttribute</A
+>&nbsp;--&nbsp;Set a special SDL/OpenGL attribute</DT
+><DT
+><A
+HREF="sdlglswapbuffers.html"
+>SDL_GL_SwapBuffers</A
+>&nbsp;--&nbsp;Swap OpenGL framebuffers/Update Display</DT
+><DT
+><A
+HREF="sdlcreateyuvoverlay.html"
+>SDL_CreateYUVOverlay</A
+>&nbsp;--&nbsp;Create a YUV video overlay</DT
+><DT
+><A
+HREF="sdllockyuvoverlay.html"
+>SDL_LockYUVOverlay</A
+>&nbsp;--&nbsp;Lock an overlay</DT
+><DT
+><A
+HREF="sdlunlockyuvoverlay.html"
+>SDL_UnlockYUVOverlay</A
+>&nbsp;--&nbsp;Unlock an overlay</DT
+><DT
+><A
+HREF="sdldisplayyuvoverlay.html"
+>SDL_DisplayYUVOverlay</A
+>&nbsp;--&nbsp;Blit the overlay to the display</DT
+><DT
+><A
+HREF="sdlfreeyuvoverlay.html"
+>SDL_FreeYUVOverlay</A
+>&nbsp;--&nbsp;Free a YUV video overlay</DT
+><DT
+><A
+HREF="sdlglattr.html"
+>SDL_GLattr</A
+>&nbsp;--&nbsp;SDL GL Attributes</DT
+><DT
+><A
+HREF="sdlrect.html"
+>SDL_Rect</A
+>&nbsp;--&nbsp;Defines a rectangular area</DT
+><DT
+><A
+HREF="sdlcolor.html"
+>SDL_Color</A
+>&nbsp;--&nbsp;Format independent color description</DT
+><DT
+><A
+HREF="sdlpalette.html"
+>SDL_Palette</A
+>&nbsp;--&nbsp;Color palette for 8-bit pixel formats</DT
+><DT
+><A
+HREF="sdlpixelformat.html"
+>SDL_PixelFormat</A
+>&nbsp;--&nbsp;Stores surface format information</DT
+><DT
+><A
+HREF="sdlsurface.html"
+>SDL_Surface</A
+>&nbsp;--&nbsp;Graphical Surface Structure</DT
+><DT
+><A
+HREF="sdlvideoinfo.html"
+>SDL_VideoInfo</A
+>&nbsp;--&nbsp;Video Target information</DT
+><DT
+><A
+HREF="sdloverlay.html"
+>SDL_Overlay</A
+>&nbsp;--&nbsp;YUV video overlay</DT
+></DL
+></DD
+><DT
+>7. <A
+HREF="wm.html"
+>Window Management</A
+></DT
+><DD
+><DL
+><DT
+><A
+HREF="sdlwmsetcaption.html"
+>SDL_WM_SetCaption</A
+>&nbsp;--&nbsp;Sets the window tile and icon name.</DT
+><DT
+><A
+HREF="sdlwmgetcaption.html"
+>SDL_WM_GetCaption</A
+>&nbsp;--&nbsp;Gets the window title and icon name.</DT
+><DT
+><A
+HREF="sdlwmseticon.html"
+>SDL_WM_SetIcon</A
+>&nbsp;--&nbsp;Sets the icon for the display window.</DT
+><DT
+><A
+HREF="sdlwmiconifywindow.html"
+>SDL_WM_IconifyWindow</A
+>&nbsp;--&nbsp;Iconify/Minimise the window</DT
+><DT
+><A
+HREF="sdlwmtogglefullscreen.html"
+>SDL_WM_ToggleFullScreen</A
+>&nbsp;--&nbsp;Toggles fullscreen mode</DT
+><DT
+><A
+HREF="sdlwmgrabinput.html"
+>SDL_WM_GrabInput</A
+>&nbsp;--&nbsp;Grabs mouse and keyboard input.</DT
+></DL
+></DD
+><DT
+>8. <A
+HREF="event.html"
+>Events</A
+></DT
+><DD
+><DL
+><DT
+><A
+HREF="event.html#AEN3691"
+>Introduction</A
+></DT
+><DT
+><A
+HREF="eventstructures.html"
+>SDL Event Structures.</A
+></DT
+><DT
+><A
+HREF="eventfunctions.html"
+>Event Functions.</A
+></DT
+></DL
+></DD
+><DT
+>9. <A
+HREF="joystick.html"
+>Joystick</A
+></DT
+><DD
+><DL
+><DT
+><A
+HREF="sdlnumjoysticks.html"
+>SDL_NumJoysticks</A
+>&nbsp;--&nbsp;Count available joysticks.</DT
+><DT
+><A
+HREF="sdljoystickname.html"
+>SDL_JoystickName</A
+>&nbsp;--&nbsp;Get joystick name.</DT
+><DT
+><A
+HREF="sdljoystickopen.html"
+>SDL_JoystickOpen</A
+>&nbsp;--&nbsp;Opens a joystick for use.</DT
+><DT
+><A
+HREF="sdljoystickopened.html"
+>SDL_JoystickOpened</A
+>&nbsp;--&nbsp;Determine if a joystick has been opened</DT
+><DT
+><A
+HREF="sdljoystickindex.html"
+>SDL_JoystickIndex</A
+>&nbsp;--&nbsp;Get the index of an SDL_Joystick.</DT
+><DT
+><A
+HREF="sdljoysticknumaxes.html"
+>SDL_JoystickNumAxes</A
+>&nbsp;--&nbsp;Get the number of joystick axes</DT
+><DT
+><A
+HREF="sdljoysticknumballs.html"
+>SDL_JoystickNumBalls</A
+>&nbsp;--&nbsp;Get the number of joystick trackballs</DT
+><DT
+><A
+HREF="sdljoysticknumhats.html"
+>SDL_JoystickNumHats</A
+>&nbsp;--&nbsp;Get the number of joystick hats</DT
+><DT
+><A
+HREF="sdljoysticknumbuttons.html"
+>SDL_JoystickNumButtons</A
+>&nbsp;--&nbsp;Get the number of joysitck buttons</DT
+><DT
+><A
+HREF="sdljoystickupdate.html"
+>SDL_JoystickUpdate</A
+>&nbsp;--&nbsp;Updates the state of all joysticks</DT
+><DT
+><A
+HREF="sdljoystickgetaxis.html"
+>SDL_JoystickGetAxis</A
+>&nbsp;--&nbsp;Get the current state of an axis</DT
+><DT
+><A
+HREF="sdljoystickgethat.html"
+>SDL_JoystickGetHat</A
+>&nbsp;--&nbsp;Get the current state of a joystick hat</DT
+><DT
+><A
+HREF="sdljoystickgetbutton.html"
+>SDL_JoystickGetButton</A
+>&nbsp;--&nbsp;Get the current state of a given button on a given joystick</DT
+><DT
+><A
+HREF="sdljoystickgetball.html"
+>SDL_JoystickGetBall</A
+>&nbsp;--&nbsp;Get relative trackball motion</DT
+><DT
+><A
+HREF="sdljoystickclose.html"
+>SDL_JoystickClose</A
+>&nbsp;--&nbsp;Closes a previously opened joystick</DT
+></DL
+></DD
+><DT
+>10. <A
+HREF="audio.html"
+>Audio</A
+></DT
+><DD
+><DL
+><DT
+><A
+HREF="sdlaudiospec.html"
+>SDL_AudioSpec</A
+>&nbsp;--&nbsp;Audio Specification Structure</DT
+><DT
+><A
+HREF="sdlopenaudio.html"
+>SDL_OpenAudio</A
+>&nbsp;--&nbsp;Opens the audio device with the desired parameters.</DT
+><DT
+><A
+HREF="sdlpauseaudio.html"
+>SDL_PauseAudio</A
+>&nbsp;--&nbsp;Pauses and unpauses the audio callback processing</DT
+><DT
+><A
+HREF="sdlgetaudiostatus.html"
+>SDL_GetAudioStatus</A
+>&nbsp;--&nbsp;Get the current audio state</DT
+><DT
+><A
+HREF="sdlloadwav.html"
+>SDL_LoadWAV</A
+>&nbsp;--&nbsp;Load a WAVE file</DT
+><DT
+><A
+HREF="sdlfreewav.html"
+>SDL_FreeWAV</A
+>&nbsp;--&nbsp;Frees previously opened WAV data</DT
+><DT
+><A
+HREF="sdlaudiocvt.html"
+>SDL_AudioCVT</A
+>&nbsp;--&nbsp;Audio Conversion Structure</DT
+><DT
+><A
+HREF="sdlbuildaudiocvt.html"
+>SDL_BuildAudioCVT</A
+>&nbsp;--&nbsp;Initializes a SDL_AudioCVT structure for conversion</DT
+><DT
+><A
+HREF="sdlconvertaudio.html"
+>SDL_ConvertAudio</A
+>&nbsp;--&nbsp;Convert audio data to a desired audio format.</DT
+><DT
+><A
+HREF="sdlmixaudio.html"
+>SDL_MixAudio</A
+>&nbsp;--&nbsp;Mix audio data</DT
+><DT
+><A
+HREF="sdllockaudio.html"
+>SDL_LockAudio</A
+>&nbsp;--&nbsp;Lock out the callback function</DT
+><DT
+><A
+HREF="sdlunlockaudio.html"
+>SDL_UnlockAudio</A
+>&nbsp;--&nbsp;Unlock the callback function</DT
+><DT
+><A
+HREF="sdlcloseaudio.html"
+>SDL_CloseAudio</A
+>&nbsp;--&nbsp;Shuts down audio processing and closes the audio device.</DT
+></DL
+></DD
+><DT
+>11. <A
+HREF="cdrom.html"
+>CD-ROM</A
+></DT
+><DD
+><DL
+><DT
+><A
+HREF="sdlcdnumdrives.html"
+>SDL_CDNumDrives</A
+>&nbsp;--&nbsp;Returns the number of CD-ROM drives on the system.</DT
+><DT
+><A
+HREF="sdlcdname.html"
+>SDL_CDName</A
+>&nbsp;--&nbsp;Returns a human-readable, system-dependent identifier for the CD-ROM.</DT
+><DT
+><A
+HREF="sdlcdopen.html"
+>SDL_CDOpen</A
+>&nbsp;--&nbsp;Opens a CD-ROM drive for access.</DT
+><DT
+><A
+HREF="sdlcdstatus.html"
+>SDL_CDStatus</A
+>&nbsp;--&nbsp;Returns the current status of the given drive.</DT
+><DT
+><A
+HREF="sdlcdplay.html"
+>SDL_CDPlay</A
+>&nbsp;--&nbsp;Play a CD</DT
+><DT
+><A
+HREF="sdlcdplaytracks.html"
+>SDL_CDPlayTracks</A
+>&nbsp;--&nbsp;Play the given CD track(s)</DT
+><DT
+><A
+HREF="sdlcdpause.html"
+>SDL_CDPause</A
+>&nbsp;--&nbsp;Pauses a CDROM</DT
+><DT
+><A
+HREF="sdlcdresume.html"
+>SDL_CDResume</A
+>&nbsp;--&nbsp;Resumes a CDROM</DT
+><DT
+><A
+HREF="sdlcdstop.html"
+>SDL_CDStop</A
+>&nbsp;--&nbsp;Stops a CDROM</DT
+><DT
+><A
+HREF="sdlcdeject.html"
+>SDL_CDEject</A
+>&nbsp;--&nbsp;Ejects a CDROM</DT
+><DT
+><A
+HREF="sdlcdclose.html"
+>SDL_CDClose</A
+>&nbsp;--&nbsp;Closes a SDL_CD handle</DT
+><DT
+><A
+HREF="sdlcd.html"
+>SDL_CD</A
+>&nbsp;--&nbsp;CDROM Drive Information</DT
+><DT
+><A
+HREF="sdlcdtrack.html"
+>SDL_CDtrack</A
+>&nbsp;--&nbsp;CD Track Information Structure</DT
+></DL
+></DD
+><DT
+>12. <A
+HREF="thread.html"
+>Multi-threaded Programming</A
+></DT
+><DD
+><DL
+><DT
+><A
+HREF="sdlcreatethread.html"
+>SDL_CreateThread</A
+>&nbsp;--&nbsp;Creates a new thread of execution that shares its parent's properties.</DT
+><DT
+><A
+HREF="sdlthreadid.html"
+>SDL_ThreadID</A
+>&nbsp;--&nbsp;Get the 32-bit thread identifier for the current thread.</DT
+><DT
+><A
+HREF="sdlgetthreadid.html"
+>SDL_GetThreadID</A
+>&nbsp;--&nbsp;Get the SDL thread ID of a SDL_Thread</DT
+><DT
+><A
+HREF="sdlwaitthread.html"
+>SDL_WaitThread</A
+>&nbsp;--&nbsp;Wait for a thread to finish.</DT
+><DT
+><A
+HREF="sdlkillthread.html"
+>SDL_KillThread</A
+>&nbsp;--&nbsp;Gracelessly terminates the thread.</DT
+><DT
+><A
+HREF="sdlcreatemutex.html"
+>SDL_CreateMutex</A
+>&nbsp;--&nbsp;Create a mutex</DT
+><DT
+><A
+HREF="sdldestroymutex.html"
+>SDL_DestroyMutex</A
+>&nbsp;--&nbsp;Destroy a mutex</DT
+><DT
+><A
+HREF="sdlmutexp.html"
+>SDL_mutexP</A
+>&nbsp;--&nbsp;Lock a mutex</DT
+><DT
+><A
+HREF="sdlmutexv.html"
+>SDL_mutexV</A
+>&nbsp;--&nbsp;Unlock a mutex</DT
+><DT
+><A
+HREF="sdlcreatesemaphore.html"
+>SDL_CreateSemaphore</A
+>&nbsp;--&nbsp;Creates a new semaphore and assigns an initial value to it.</DT
+><DT
+><A
+HREF="sdldestroysemaphore.html"
+>SDL_DestroySemaphore</A
+>&nbsp;--&nbsp;Destroys a semaphore that was created by <A
+HREF="sdlcreatesemaphore.html"
+>SDL_CreateSemaphore</A
+>.</DT
+><DT
+><A
+HREF="sdlsemwait.html"
+>SDL_SemWait</A
+>&nbsp;--&nbsp;Lock a semaphore and suspend the thread if the semaphore value is zero.</DT
+><DT
+><A
+HREF="sdlsemtrywait.html"
+>SDL_SemTryWait</A
+>&nbsp;--&nbsp;Attempt to lock a semaphore but don't suspend the thread.</DT
+><DT
+><A
+HREF="sdlsemwaittimeout.html"
+>SDL_SemWaitTimeout</A
+>&nbsp;--&nbsp;Lock a semaphore, but only wait up to a specified maximum time.</DT
+><DT
+><A
+HREF="sdlsempost.html"
+>SDL_SemPost</A
+>&nbsp;--&nbsp;Unlock a semaphore.</DT
+><DT
+><A
+HREF="sdlsemvalue.html"
+>SDL_SemValue</A
+>&nbsp;--&nbsp;Return the current value of a semaphore.</DT
+><DT
+><A
+HREF="sdlcreatecond.html"
+>SDL_CreateCond</A
+>&nbsp;--&nbsp;Create a condition variable</DT
+><DT
+><A
+HREF="sdldestroycond.html"
+>SDL_DestroyCond</A
+>&nbsp;--&nbsp;Destroy a condition variable</DT
+><DT
+><A
+HREF="sdlcondsignal.html"
+>SDL_CondSignal</A
+>&nbsp;--&nbsp;Restart a thread wait on a condition variable</DT
+><DT
+><A
+HREF="sdlcondbroadcast.html"
+>SDL_CondBroadcast</A
+>&nbsp;--&nbsp;Restart all threads waiting on a condition variable</DT
+><DT
+><A
+HREF="sdlcondwait.html"
+>SDL_CondWait</A
+>&nbsp;--&nbsp;Wait on a condition variable</DT
+><DT
+><A
+HREF="sdlcondwaittimeout.html"
+>SDL_CondWaitTimeout</A
+>&nbsp;--&nbsp;Wait on a condition variable, with timeout</DT
+></DL
+></DD
+><DT
+>13. <A
+HREF="time.html"
+>Time</A
+></DT
+><DD
+><DL
+><DT
+><A
+HREF="sdlgetticks.html"
+>SDL_GetTicks</A
+>&nbsp;--&nbsp;Get the number of milliseconds since the SDL library initialization.</DT
+><DT
+><A
+HREF="sdldelay.html"
+>SDL_Delay</A
+>&nbsp;--&nbsp;Wait a specified number of milliseconds before returning.</DT
+><DT
+><A
+HREF="sdladdtimer.html"
+>SDL_AddTimer</A
+>&nbsp;--&nbsp;Add a timer which will call a callback after the specified number of milliseconds has
+elapsed.</DT
+><DT
+><A
+HREF="sdlremovetimer.html"
+>SDL_RemoveTimer</A
+>&nbsp;--&nbsp;Remove a timer which was added with
+<A
+HREF="sdladdtimer.html"
+>SDL_AddTimer</A
+>.</DT
+><DT
+><A
+HREF="sdlsettimer.html"
+>SDL_SetTimer</A
+>&nbsp;--&nbsp;Set a callback to run after the specified number of milliseconds has
+elapsed.</DT
+></DL
+></DD
+></DL
+></DD
+></DL
+></DIV
+><DIV
+CLASS="LOT"
+><DL
+CLASS="LOT"
+><DT
+><B
+>List of Tables</B
+></DT
+><DT
+>8-1. <A
+HREF="sdlkey.html#AEN4720"
+>SDL Keysym definitions</A
+></DT
+><DT
+>8-2. <A
+HREF="sdlkey.html#SDLMOD"
+>SDL modifier definitions</A
+></DT
+></DL
+></DIV
+><DIV
+CLASS="LOT"
+><DL
+CLASS="LOT"
+><DT
+><B
+>List of Examples</B
+></DT
+><DT
+>1-1. <A
+HREF="guidebasicsinit.html#AEN60"
+>Initializing SDL</A
+></DT
+><DT
+>2-1. <A
+HREF="guidevideo.html#AEN71"
+>Initializing the Video Display</A
+></DT
+><DT
+>2-2. <A
+HREF="guidevideo.html#AEN77"
+>Initializing the Best Video Mode</A
+></DT
+><DT
+>2-3. <A
+HREF="guidevideo.html#AEN83"
+>Loading and Displaying a BMP File</A
+></DT
+><DT
+>2-4. <A
+HREF="guidevideo.html#AEN90"
+>getpixel()</A
+></DT
+><DT
+>2-5. <A
+HREF="guidevideo.html#AEN93"
+>putpixel()</A
+></DT
+><DT
+>2-6. <A
+HREF="guidevideo.html#AEN97"
+>Using putpixel()</A
+></DT
+><DT
+>2-7. <A
+HREF="guidevideoopengl.html#AEN114"
+>Initializing SDL with OpenGL</A
+></DT
+><DT
+>2-8. <A
+HREF="guidevideoopengl.html#AEN128"
+>SDL and OpenGL</A
+></DT
+><DT
+>3-1. <A
+HREF="guideinput.html#AEN141"
+>Initializing SDL with Joystick Support</A
+></DT
+><DT
+>3-2. <A
+HREF="guideinput.html#AEN154"
+>Querying the Number of Available Joysticks</A
+></DT
+><DT
+>3-3. <A
+HREF="guideinput.html#AEN183"
+>Opening a Joystick</A
+></DT
+><DT
+>3-4. <A
+HREF="guideinput.html#AEN191"
+>Joystick Axis Events</A
+></DT
+><DT
+>3-5. <A
+HREF="guideinput.html#AEN195"
+>More Joystick Axis Events</A
+></DT
+><DT
+>3-6. <A
+HREF="guideinput.html#AEN203"
+>Joystick Button Events</A
+></DT
+><DT
+>3-7. <A
+HREF="guideinput.html#AEN217"
+>Joystick Ball Events</A
+></DT
+><DT
+>3-8. <A
+HREF="guideinput.html#AEN244"
+>Joystick Hat Events</A
+></DT
+><DT
+>3-9. <A
+HREF="guideinput.html#AEN265"
+>Querying Joystick Characteristics</A
+></DT
+><DT
+>3-10. <A
+HREF="guideinputkeyboard.html#AEN334"
+>Reading Keyboard Events</A
+></DT
+><DT
+>3-11. <A
+HREF="guideinputkeyboard.html#AEN351"
+>Interpreting Key Event Information</A
+></DT
+><DT
+>3-12. <A
+HREF="guideinputkeyboard.html#AEN363"
+>Proper Game Movement</A
+></DT
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="guide.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL Guide</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/joystick.html b/distrib/sdl-1.2.15/docs/html/joystick.html
new file mode 100644
index 0000000..05da008
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/joystick.html
@@ -0,0 +1,296 @@
+<HTML
+><HEAD
+><TITLE
+>Joystick</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Reference"
+HREF="reference.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_JoystickEventState"
+HREF="sdljoystickeventstate.html"><LINK
+REL="NEXT"
+TITLE="SDL_NumJoysticks"
+HREF="sdlnumjoysticks.html"><META
+NAME="KEYWORD"
+CONTENT="joystick"><META
+NAME="KEYWORD"
+CONTENT="function"></HEAD
+><BODY
+CLASS="CHAPTER"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdljoystickeventstate.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlnumjoysticks.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="CHAPTER"
+><H1
+><A
+NAME="JOYSTICK"
+></A
+>Chapter 9. Joystick</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="sdlnumjoysticks.html"
+>SDL_NumJoysticks</A
+>&nbsp;--&nbsp;Count available joysticks.</DT
+><DT
+><A
+HREF="sdljoystickname.html"
+>SDL_JoystickName</A
+>&nbsp;--&nbsp;Get joystick name.</DT
+><DT
+><A
+HREF="sdljoystickopen.html"
+>SDL_JoystickOpen</A
+>&nbsp;--&nbsp;Opens a joystick for use.</DT
+><DT
+><A
+HREF="sdljoystickopened.html"
+>SDL_JoystickOpened</A
+>&nbsp;--&nbsp;Determine if a joystick has been opened</DT
+><DT
+><A
+HREF="sdljoystickindex.html"
+>SDL_JoystickIndex</A
+>&nbsp;--&nbsp;Get the index of an SDL_Joystick.</DT
+><DT
+><A
+HREF="sdljoysticknumaxes.html"
+>SDL_JoystickNumAxes</A
+>&nbsp;--&nbsp;Get the number of joystick axes</DT
+><DT
+><A
+HREF="sdljoysticknumballs.html"
+>SDL_JoystickNumBalls</A
+>&nbsp;--&nbsp;Get the number of joystick trackballs</DT
+><DT
+><A
+HREF="sdljoysticknumhats.html"
+>SDL_JoystickNumHats</A
+>&nbsp;--&nbsp;Get the number of joystick hats</DT
+><DT
+><A
+HREF="sdljoysticknumbuttons.html"
+>SDL_JoystickNumButtons</A
+>&nbsp;--&nbsp;Get the number of joysitck buttons</DT
+><DT
+><A
+HREF="sdljoystickupdate.html"
+>SDL_JoystickUpdate</A
+>&nbsp;--&nbsp;Updates the state of all joysticks</DT
+><DT
+><A
+HREF="sdljoystickgetaxis.html"
+>SDL_JoystickGetAxis</A
+>&nbsp;--&nbsp;Get the current state of an axis</DT
+><DT
+><A
+HREF="sdljoystickgethat.html"
+>SDL_JoystickGetHat</A
+>&nbsp;--&nbsp;Get the current state of a joystick hat</DT
+><DT
+><A
+HREF="sdljoystickgetbutton.html"
+>SDL_JoystickGetButton</A
+>&nbsp;--&nbsp;Get the current state of a given button on a given joystick</DT
+><DT
+><A
+HREF="sdljoystickgetball.html"
+>SDL_JoystickGetBall</A
+>&nbsp;--&nbsp;Get relative trackball motion</DT
+><DT
+><A
+HREF="sdljoystickclose.html"
+>SDL_JoystickClose</A
+>&nbsp;--&nbsp;Closes a previously opened joystick</DT
+></DL
+></DIV
+><P
+>Joysticks, and other similar input devices, have a very strong role in game playing and SDL provides comprehensive support for them. Axes, Buttons, POV Hats and trackballs are all supported.</P
+><P
+>Joystick support is initialized by passed the <TT
+CLASS="LITERAL"
+>SDL_INIT_JOYSTICK</TT
+> flag to <A
+HREF="sdlinit.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+></A
+>. Once initilized joysticks must be opened using <A
+HREF="sdljoystickopen.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickOpen</TT
+></A
+>.</P
+><P
+>While using the functions describe in this secton may seem like the best way to access and read from joysticks, in most cases they aren't. Ideally joysticks should be read using the <A
+HREF="event.html"
+>event</A
+> system. To enable this, you must set the joystick event processing state with <A
+HREF="sdljoystickeventstate.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickEventState</TT
+></A
+>. Joysticks must be <A
+HREF="sdljoystickopen.html"
+>opened</A
+> before they can be used of course.</P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>If you are <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>not</I
+></SPAN
+> handling the joystick via the event queue then you must explicitly request a joystick update by calling <A
+HREF="sdljoystickupdate.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickUpdate</TT
+></A
+>.</P
+></BLOCKQUOTE
+></DIV
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>Force Feedback is not yet supported. Sam (slouken@libsdl.org) is soliciting suggestions from people with force-feedback experience on the best way to design the API.</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdljoystickeventstate.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlnumjoysticks.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_JoystickEventState</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="reference.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_NumJoysticks</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/reference.html b/distrib/sdl-1.2.15/docs/html/reference.html
new file mode 100644
index 0000000..e7707a7
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/reference.html
@@ -0,0 +1,194 @@
+<HTML
+><HEAD
+><TITLE
+>SDL Reference</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="PREVIOUS"
+TITLE="Time Examples"
+HREF="guidetimeexamples.html"><LINK
+REL="NEXT"
+TITLE="General"
+HREF="general.html"></HEAD
+><BODY
+CLASS="PART"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="guidetimeexamples.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="general.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="PART"
+><A
+NAME="REFERENCE"
+></A
+><DIV
+CLASS="TITLEPAGE"
+><H1
+CLASS="TITLE"
+>II. SDL Reference</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+>5. <A
+HREF="general.html"
+>General</A
+></DT
+><DT
+>6. <A
+HREF="video.html"
+>Video</A
+></DT
+><DT
+>7. <A
+HREF="wm.html"
+>Window Management</A
+></DT
+><DT
+>8. <A
+HREF="event.html"
+>Events</A
+></DT
+><DT
+>9. <A
+HREF="joystick.html"
+>Joystick</A
+></DT
+><DT
+>10. <A
+HREF="audio.html"
+>Audio</A
+></DT
+><DT
+>11. <A
+HREF="cdrom.html"
+>CD-ROM</A
+></DT
+><DT
+>12. <A
+HREF="thread.html"
+>Multi-threaded Programming</A
+></DT
+><DT
+>13. <A
+HREF="time.html"
+>Time</A
+></DT
+></DL
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="guidetimeexamples.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="general.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Time Examples</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>General</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlactiveevent.html b/distrib/sdl-1.2.15/docs/html/sdlactiveevent.html
new file mode 100644
index 0000000..d3f2821
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlactiveevent.html
@@ -0,0 +1,335 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_ActiveEvent</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Event Structures."
+HREF="eventstructures.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_Event"
+HREF="sdlevent.html"><LINK
+REL="NEXT"
+TITLE="SDL_KeyboardEvent"
+HREF="sdlkeyboardevent.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlkeyboardevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLACTIVEEVENT"
+></A
+>SDL_ActiveEvent</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN3955"
+></A
+><H2
+>Name</H2
+>SDL_ActiveEvent&nbsp;--&nbsp;Application visibility event structure</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3958"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ Uint8 type;
+ Uint8 gain;
+ Uint8 state;
+} SDL_ActiveEvent;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3961"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN3963"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_ACTIVEEVENT.</TT
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>gain</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>0 if the event is a loss or 1 if it is a gain.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>state</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_APPMOUSEFOCUS</TT
+> if mouse focus was gained or lost, <TT
+CLASS="LITERAL"
+>SDL_APPINPUTFOCUS</TT
+> if input focus was gained or lost, or <TT
+CLASS="LITERAL"
+>SDL_APPACTIVE</TT
+> if the application was iconified (<TT
+CLASS="STRUCTFIELD"
+><I
+>gain</I
+></TT
+>=0) or restored(<TT
+CLASS="STRUCTFIELD"
+><I
+>gain</I
+></TT
+>=1).</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3984"
+></A
+><H2
+>Description</H2
+><P
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_ActiveEvent</SPAN
+> is a member of the <A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+> union and is used when an event of type <TT
+CLASS="LITERAL"
+>SDL_ACTIVEEVENT</TT
+> is reported.</P
+><P
+>When the mouse leaves or enters the window area a <TT
+CLASS="LITERAL"
+>SDL_APPMOUSEFOCUS</TT
+> type activation event occurs, if the mouse entered the window then <TT
+CLASS="STRUCTFIELD"
+><I
+>gain</I
+></TT
+> will be 1, otherwise <TT
+CLASS="STRUCTFIELD"
+><I
+>gain</I
+></TT
+> will be 0. A <TT
+CLASS="LITERAL"
+>SDL_APPINPUTFOCUS</TT
+> type activation event occurs when the application loses or gains keyboard focus. This usually occurs when another application is made active. Finally, a <TT
+CLASS="LITERAL"
+>SDL_APPACTIVE</TT
+> type event occurs when the application is either minimised/iconified (<TT
+CLASS="STRUCTFIELD"
+><I
+>gain</I
+></TT
+>=0) or restored.</P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>This event does not occur when an application window is first created.</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4000"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+>,
+<A
+HREF="sdlgetappstate.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetAppState</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlkeyboardevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_Event</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventstructures.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_KeyboardEvent</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdladdtimer.html b/distrib/sdl-1.2.15/docs/html/sdladdtimer.html
new file mode 100644
index 0000000..81c49e5
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdladdtimer.html
@@ -0,0 +1,296 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_AddTimer</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Time"
+HREF="time.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_Delay"
+HREF="sdldelay.html"><LINK
+REL="NEXT"
+TITLE="SDL_RemoveTimer"
+HREF="sdlremovetimer.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdldelay.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlremovetimer.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLADDTIMER"
+></A
+>SDL_AddTimer</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8482"
+></A
+><H2
+>Name</H2
+>SDL_AddTimer&nbsp;--&nbsp;Add a timer which will call a callback after the specified number of milliseconds has
+elapsed.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8485"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN8486"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_TimerID <B
+CLASS="FSFUNC"
+>SDL_AddTimer</B
+></CODE
+>(Uint32 interval, SDL_NewTimerCallback callback, void *param);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SDLNEWTIMERCALLBACK"
+></A
+><H2
+>Callback</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>/* type definition for the "new" timer callback function */
+typedef Uint32 (*SDL_NewTimerCallback)(Uint32 interval, void *param);</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8495"
+></A
+><H2
+>Description</H2
+><P
+>Adds a callback function to be run after the specified number of
+milliseconds has elapsed. The callback function is passed the current
+timer interval and the user supplied parameter from the
+<TT
+CLASS="FUNCTION"
+>SDL_AddTimer</TT
+> call and returns the next timer
+interval. If the returned value from the callback is the same as the one
+passed in, the periodic alarm continues, otherwise a new alarm is
+scheduled.</P
+><P
+>To cancel a currently running timer call
+<A
+HREF="sdlremovetimer.html"
+>SDL_RemoveTimer</A
+> with the
+timer ID returned from
+<TT
+CLASS="FUNCTION"
+>SDL_AddTimer</TT
+>.</P
+><P
+>The timer callback function may run in a different thread than your
+main program, and so shouldn't call any functions from within itself.
+You may always call <A
+HREF="sdlpushevent.html"
+>SDL_PushEvent</A
+>, however.</P
+><P
+>The granularity of the timer is platform-dependent, but you should count
+on it being at least 10 ms as this is the most common number.
+This means that if
+you request a 16 ms timer, your callback will run approximately 20 ms
+later on an unloaded system. If you wanted to set a flag signaling
+a frame update at 30 frames per second (every 33 ms), you might set a
+timer for 30 ms (see example below).
+
+If you use this function, you need to pass <TT
+CLASS="LITERAL"
+>SDL_INIT_TIMER</TT
+>
+to <A
+HREF="sdlinit.html"
+>SDL_Init</A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8507"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns an ID value for the added timer or
+<SPAN
+CLASS="RETURNVALUE"
+>NULL</SPAN
+> if there was an error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8511"
+></A
+><H2
+>Examples</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>my_timer_id = SDL_AddTimer((33/10)*10, my_callbackfunc, my_callback_param);</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8515"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlremovetimer.html"
+><TT
+CLASS="FUNCTION"
+>SDL_RemoveTimer</TT
+></A
+>,
+<A
+HREF="sdlpushevent.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PushEvent</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdldelay.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlremovetimer.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_Delay</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="time.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_RemoveTimer</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlaudiocvt.html b/distrib/sdl-1.2.15/docs/html/sdlaudiocvt.html
new file mode 100644
index 0000000..ff39209
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlaudiocvt.html
@@ -0,0 +1,556 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_AudioCVT</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Audio"
+HREF="audio.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_FreeWAV"
+HREF="sdlfreewav.html"><LINK
+REL="NEXT"
+TITLE="SDL_BuildAudioCVT"
+HREF="sdlbuildaudiocvt.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlfreewav.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlbuildaudiocvt.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLAUDIOCVT"
+></A
+>SDL_AudioCVT</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6884"
+></A
+><H2
+>Name</H2
+>SDL_AudioCVT&nbsp;--&nbsp;Audio Conversion Structure</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6887"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ int needed;
+ Uint16 src_format;
+ Uint16 dest_format;
+ double rate_incr;
+ Uint8 *buf;
+ int len;
+ int len_cvt;
+ int len_mult;
+ double len_ratio;
+ void (*filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
+ int filter_index;
+} SDL_AudioCVT;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6890"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN6892"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>needed</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Set to one if the conversion is possible</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>src_format</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Audio format of the source</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>dest_format</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Audio format of the destination</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>rate_incr</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Rate conversion increment</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>buf</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Audio buffer</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>len</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Length of the original audio buffer in bytes</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>len_cvt</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Length of converted audio buffer in bytes (calculated)</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>len_mult</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>buf</I
+></TT
+> must be <TT
+CLASS="STRUCTFIELD"
+><I
+>len</I
+></TT
+>*<TT
+CLASS="STRUCTFIELD"
+><I
+>len_mult</I
+></TT
+> bytes in size(calculated)</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>len_ratio</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Final audio size is <TT
+CLASS="STRUCTFIELD"
+><I
+>len</I
+></TT
+>*<TT
+CLASS="STRUCTFIELD"
+><I
+>len_ratio</I
+></TT
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>filters[10](..)</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Pointers to functions needed for this conversion</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>filter_index</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Current conversion function</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6944"
+></A
+><H2
+>Description</H2
+><P
+>The <SPAN
+CLASS="STRUCTNAME"
+>SDL_AudioCVT</SPAN
+> is used to convert audio data between different formats. A <SPAN
+CLASS="STRUCTNAME"
+>SDL_AudioCVT</SPAN
+> structure is created with the <A
+HREF="sdlbuildaudiocvt.html"
+><TT
+CLASS="FUNCTION"
+>SDL_BuildAudioCVT</TT
+></A
+> function, while the actual conversion is done by the <A
+HREF="sdlconvertaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_ConvertAudio</TT
+></A
+> function.</P
+><P
+>Many of the fields in the <SPAN
+CLASS="STRUCTNAME"
+>SDL_AudioCVT</SPAN
+> structure should be considered private and their function will not be discussed here.</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="TYPE"
+>Uint8 *</SPAN
+><TT
+CLASS="STRUCTFIELD"
+><I
+>buf</I
+></TT
+></DT
+><DD
+><P
+>This points to the audio data that will be used in the conversion. It is both the source and the destination, which means the converted audio data overwrites the original data. It also means that the converted data may be larger than the original data (if you were converting from 8-bit to 16-bit, for instance), so you must ensure <TT
+CLASS="STRUCTFIELD"
+><I
+>buf</I
+></TT
+> is large enough. See below.</P
+></DD
+><DT
+><SPAN
+CLASS="TYPE"
+>int</SPAN
+> <TT
+CLASS="STRUCTFIELD"
+><I
+>len</I
+></TT
+></DT
+><DD
+><P
+>This is the length of the original audio data in bytes.</P
+></DD
+><DT
+><SPAN
+CLASS="TYPE"
+>int</SPAN
+> <TT
+CLASS="STRUCTFIELD"
+><I
+>len_mult</I
+></TT
+></DT
+><DD
+><P
+>As explained above, the audio buffer needs to be big enough to store the converted data, which may be bigger than the original audio data. The length of <TT
+CLASS="STRUCTFIELD"
+><I
+>buf</I
+></TT
+> should be <TT
+CLASS="STRUCTFIELD"
+><I
+>len</I
+></TT
+>*<TT
+CLASS="STRUCTFIELD"
+><I
+>len_mult</I
+></TT
+>.</P
+></DD
+><DT
+><SPAN
+CLASS="TYPE"
+>double</SPAN
+> <TT
+CLASS="STRUCTFIELD"
+><I
+>len_ratio</I
+></TT
+></DT
+><DD
+><P
+>When you have finished converting your audio data, you need to know how much of your audio buffer is valid. <TT
+CLASS="STRUCTFIELD"
+><I
+>len</I
+></TT
+>*<TT
+CLASS="STRUCTFIELD"
+><I
+>len_ratio</I
+></TT
+> is the size of the converted audio data in bytes. This is very similar to <TT
+CLASS="STRUCTFIELD"
+><I
+>len_mult</I
+></TT
+>, however when the convert audio data is shorter than the original <TT
+CLASS="STRUCTFIELD"
+><I
+>len_mult</I
+></TT
+> would be 1. <TT
+CLASS="STRUCTFIELD"
+><I
+>len_ratio</I
+></TT
+>, on the other hand, would be a fractional number between 0 and 1.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6989"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlbuildaudiocvt.html"
+><TT
+CLASS="FUNCTION"
+>SDL_BuildAudioCVT</TT
+></A
+>,
+<A
+HREF="sdlconvertaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_ConvertAudio</TT
+></A
+>,
+<A
+HREF="sdlaudiospec.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_AudioSpec</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlfreewav.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlbuildaudiocvt.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_FreeWAV</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="audio.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_BuildAudioCVT</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlaudiospec.html b/distrib/sdl-1.2.15/docs/html/sdlaudiospec.html
new file mode 100644
index 0000000..fc6fa75
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlaudiospec.html
@@ -0,0 +1,589 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_AudioSpec</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Audio"
+HREF="audio.html"><LINK
+REL="PREVIOUS"
+TITLE="Audio"
+HREF="audio.html"><LINK
+REL="NEXT"
+TITLE="SDL_OpenAudio"
+HREF="sdlopenaudio.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="audio.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlopenaudio.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLAUDIOSPEC"
+></A
+>SDL_AudioSpec</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6507"
+></A
+><H2
+>Name</H2
+>SDL_AudioSpec&nbsp;--&nbsp;Audio Specification Structure</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6510"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ int freq;
+ Uint16 format;
+ Uint8 channels;
+ Uint8 silence;
+ Uint16 samples;
+ Uint32 size;
+ void (*callback)(void *userdata, Uint8 *stream, int len);
+ void *userdata;
+} SDL_AudioSpec;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6513"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN6515"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>freq</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Audio frequency in samples per second</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>format</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Audio data format</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>channels</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Number of channels: 1 mono, 2 stereo</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>silence</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Audio buffer silence value (calculated)</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>samples</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Audio buffer size in samples</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>size</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Audio buffer size in bytes (calculated)</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>callback(..)</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Callback function for filling the audio buffer</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>userdata</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Pointer the user data which is passed to the callback function</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6550"
+></A
+><H2
+>Description</H2
+><P
+>The <SPAN
+CLASS="STRUCTNAME"
+>SDL_AudioSpec</SPAN
+> structure is used to describe the format of some audio data. This structure is used by <A
+HREF="sdlopenaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_OpenAudio</TT
+></A
+> and <A
+HREF="sdlloadwav.html"
+><TT
+CLASS="FUNCTION"
+>SDL_LoadWAV</TT
+></A
+>. While all fields are used by <TT
+CLASS="FUNCTION"
+>SDL_OpenAudio</TT
+> only <TT
+CLASS="STRUCTFIELD"
+><I
+>freq</I
+></TT
+>, <TT
+CLASS="STRUCTFIELD"
+><I
+>format</I
+></TT
+>, <TT
+CLASS="STRUCTFIELD"
+><I
+>samples</I
+></TT
+> and <TT
+CLASS="STRUCTFIELD"
+><I
+>channels</I
+></TT
+> are used by <TT
+CLASS="FUNCTION"
+>SDL_LoadWAV</TT
+>. We will detail these common members here.</P
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN6564"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>freq</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>The number of samples sent to the sound device every second. Common values are 11025, 22050 and 44100. The higher the better.</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>format</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>Specifies the size and type of each sample element
+<P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><TT
+CLASS="LITERAL"
+>AUDIO_U8</TT
+></DT
+><DD
+><P
+>Unsigned 8-bit samples</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>AUDIO_S8</TT
+></DT
+><DD
+><P
+>Signed 8-bit samples</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>AUDIO_U16</TT
+> or <TT
+CLASS="LITERAL"
+>AUDIO_U16LSB</TT
+></DT
+><DD
+><P
+>Unsigned 16-bit little-endian samples</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>AUDIO_S16</TT
+> or <TT
+CLASS="LITERAL"
+>AUDIO_S16LSB</TT
+></DT
+><DD
+><P
+>Signed 16-bit little-endian samples</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>AUDIO_U16MSB</TT
+></DT
+><DD
+><P
+>Unsigned 16-bit big-endian samples</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>AUDIO_S16MSB</TT
+></DT
+><DD
+><P
+>Signed 16-bit big-endian samples</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>AUDIO_U16SYS</TT
+></DT
+><DD
+><P
+>Either <TT
+CLASS="LITERAL"
+>AUDIO_U16LSB</TT
+> or <TT
+CLASS="LITERAL"
+>AUDIO_U16MSB</TT
+> depending on you systems endianness</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>AUDIO_S16SYS</TT
+></DT
+><DD
+><P
+>Either <TT
+CLASS="LITERAL"
+>AUDIO_S16LSB</TT
+> or <TT
+CLASS="LITERAL"
+>AUDIO_S16MSB</TT
+> depending on you systems endianness</P
+></DD
+></DL
+></DIV
+></P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>channels</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>The number of seperate sound channels. 1 is mono (single channel), 2 is stereo (dual channel).</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>samples</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>When used with <A
+HREF="sdlopenaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_OpenAudio</TT
+></A
+> this refers to the size of the audio buffer in samples. A sample a chunk of audio data of the size specified in <TT
+CLASS="PARAMETER"
+><I
+>format</I
+></TT
+> mulitplied by the number of channels. When the <SPAN
+CLASS="STRUCTNAME"
+>SDL_AudioSpec</SPAN
+> is used with <A
+HREF="sdlloadwav.html"
+><TT
+CLASS="FUNCTION"
+>SDL_LoadWAV</TT
+></A
+> <TT
+CLASS="STRUCTFIELD"
+><I
+>samples</I
+></TT
+> is set to 4096.</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6639"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlopenaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_OpenAudio</TT
+></A
+>,
+<A
+HREF="sdlloadwav.html"
+><TT
+CLASS="FUNCTION"
+>SDL_LoadWAV</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="audio.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlopenaudio.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Audio</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="audio.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_OpenAudio</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlblitsurface.html b/distrib/sdl-1.2.15/docs/html/sdlblitsurface.html
new file mode 100644
index 0000000..3123ff5
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlblitsurface.html
@@ -0,0 +1,339 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_BlitSurface</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_ConvertSurface"
+HREF="sdlconvertsurface.html"><LINK
+REL="NEXT"
+TITLE="SDL_FillRect"
+HREF="sdlfillrect.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlconvertsurface.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlfillrect.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLBLITSURFACE"
+></A
+>SDL_BlitSurface</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2299"
+></A
+><H2
+>Name</H2
+>SDL_BlitSurface&nbsp;--&nbsp;This performs a fast blit from the source surface to the destination surface.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2302"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2303"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_BlitSurface</B
+></CODE
+>(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2309"
+></A
+><H2
+>Description</H2
+><P
+>This performs a fast blit from the source surface to the destination surface.</P
+><P
+>The width and height in <TT
+CLASS="PARAMETER"
+><I
+>srcrect</I
+></TT
+> determine the
+size of the copied rectangle. Only the position is used in the
+<TT
+CLASS="PARAMETER"
+><I
+>dstrect</I
+></TT
+> (the width and height are ignored).</P
+><P
+>If <TT
+CLASS="PARAMETER"
+><I
+>srcrect</I
+></TT
+> is <TT
+CLASS="LITERAL"
+>NULL</TT
+>, the
+entire surface is copied. If <TT
+CLASS="PARAMETER"
+><I
+>dstrect</I
+></TT
+> is
+<TT
+CLASS="LITERAL"
+>NULL</TT
+>, then the destination position (upper left
+corner) is (0, 0).</P
+><P
+>The final blit rectangle is saved in
+<TT
+CLASS="PARAMETER"
+><I
+>dstrect</I
+></TT
+> after all clipping is performed
+(<TT
+CLASS="PARAMETER"
+><I
+>srcrect</I
+></TT
+> is not modified).</P
+><P
+>The blit function should not be called on a locked surface.</P
+><P
+>The results of blitting operations vary greatly depending on whether <TT
+CLASS="LITERAL"
+>SDL_SRCAPLHA</TT
+> is set or not. See <A
+HREF="sdlsetalpha.html"
+>SDL_SetAlpha</A
+> for an explaination of how this affects your results. Colorkeying and alpha attributes also interact with surface blitting, as the following pseudo-code should hopefully explain.
+<PRE
+CLASS="PROGRAMLISTING"
+>if (source surface has SDL_SRCALPHA set) {
+ if (source surface has alpha channel (that is, format-&#62;Amask != 0))
+ blit using per-pixel alpha, ignoring any colour key
+ else {
+ if (source surface has SDL_SRCCOLORKEY set)
+ blit using the colour key AND the per-surface alpha value
+ else
+ blit using the per-surface alpha value
+ }
+} else {
+ if (source surface has SDL_SRCCOLORKEY set)
+ blit using the colour key
+ else
+ ordinary opaque rectangular blit
+}</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2328"
+></A
+><H2
+>Return Value</H2
+><P
+>If the blit is successful, it returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+>,
+otherwise it returns <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+>.</P
+><P
+>If either of the surfaces were in video memory, and the blit returns
+<SPAN
+CLASS="RETURNVALUE"
+>-2</SPAN
+>, the video memory was lost, so it should be
+reloaded with artwork and re-blitted:
+<PRE
+CLASS="PROGRAMLISTING"
+> while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
+ while ( SDL_LockSurface(image)) &#60; 0 )
+ SDL_Delay(10);
+ -- Write image pixels to image-&#62;pixels --
+ SDL_UnlockSurface(image);
+ }</PRE
+>
+This happens under DirectX 5.0 when the system switches away from your
+fullscreen application. Locking the surface will also fail until you
+have access to the video memory again.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2336"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdllocksurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_LockSurface</TT
+></A
+>,
+<A
+HREF="sdlfillrect.html"
+><TT
+CLASS="FUNCTION"
+>SDL_FillRect</TT
+></A
+>,
+<A
+HREF="sdlsurface.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+></A
+>,
+<A
+HREF="sdlrect.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Rect</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlconvertsurface.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlfillrect.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_ConvertSurface</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_FillRect</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlbuildaudiocvt.html b/distrib/sdl-1.2.15/docs/html/sdlbuildaudiocvt.html
new file mode 100644
index 0000000..2e8420e
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlbuildaudiocvt.html
@@ -0,0 +1,291 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_BuildAudioCVT</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Audio"
+HREF="audio.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_AudioCVT"
+HREF="sdlaudiocvt.html"><LINK
+REL="NEXT"
+TITLE="SDL_ConvertAudio"
+HREF="sdlconvertaudio.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlaudiocvt.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlconvertaudio.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLBUILDAUDIOCVT"
+></A
+>SDL_BuildAudioCVT</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7002"
+></A
+><H2
+>Name</H2
+>SDL_BuildAudioCVT&nbsp;--&nbsp;Initializes a SDL_AudioCVT structure for conversion</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7005"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7006"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_BuildAudioCVT</B
+></CODE
+>(SDL_AudioCVT *cvt, Uint16 src_format, Uint8 src_channels, int src_rate, Uint16 dst_format, Uint8 dst_channels, int dst_rate);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7012"
+></A
+><H2
+>Description</H2
+><P
+>Before an <A
+HREF="sdlaudiocvt.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_AudioCVT</SPAN
+></A
+> structure can be used to convert audio data it must be initialized with source and destination information. </P
+><P
+><TT
+CLASS="PARAMETER"
+><I
+>src_format</I
+></TT
+> and <TT
+CLASS="PARAMETER"
+><I
+>dst_format</I
+></TT
+> are the source and destination format of the conversion. (For information on audio formats see <A
+HREF="sdlaudiospec.html"
+><SPAN
+CLASS="STRUCTNAME"
+> SDL_AudioSpec</SPAN
+></A
+>). <TT
+CLASS="PARAMETER"
+><I
+>src_channels</I
+></TT
+> and <TT
+CLASS="PARAMETER"
+><I
+>dst_channels</I
+></TT
+> are the number of channels in the source and destination formats. Finally, <TT
+CLASS="PARAMETER"
+><I
+>src_rate</I
+></TT
+> and <TT
+CLASS="PARAMETER"
+><I
+>dst_rate</I
+></TT
+> are the frequency or samples-per-second of the source and destination formats. Once again, see <A
+HREF="sdlaudiospec.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_AudioSpec</SPAN
+></A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7028"
+></A
+><H2
+>Return Values</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> if the filter could not be built or 1 if it could.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7032"
+></A
+><H2
+>Examples</H2
+><P
+>See <A
+HREF="sdlconvertaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_ConvertAudio</TT
+></A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7037"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlconvertaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_ConvertAudio</TT
+></A
+>,
+<A
+HREF="sdlaudiocvt.html"
+><TT
+CLASS="FUNCTION"
+>SDL_AudioCVT</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlaudiocvt.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlconvertaudio.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_AudioCVT</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="audio.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_ConvertAudio</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcd.html b/distrib/sdl-1.2.15/docs/html/sdlcd.html
new file mode 100644
index 0000000..6f8a7cd
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcd.html
@@ -0,0 +1,359 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CD</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="CD-ROM"
+HREF="cdrom.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CDClose"
+HREF="sdlcdclose.html"><LINK
+REL="NEXT"
+TITLE="SDL_CDtrack"
+HREF="sdlcdtrack.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcdclose.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcdtrack.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCD"
+></A
+>SDL_CD</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7566"
+></A
+><H2
+>Name</H2
+>SDL_CD&nbsp;--&nbsp;CDROM Drive Information</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7569"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ int id;
+ CDstatus status;
+ int numtracks;
+ int cur_track;
+ int cur_frame;
+ SDL_CDtrack track[SDL_MAX_TRACKS+1];
+} SDL_CD;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7572"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN7574"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>id</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Private drive identifier</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>status</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Drive <A
+HREF="sdlcdstatus.html"
+>status</A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>numtracks</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Number of tracks on the CD</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>cur_track</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Current track</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>cur_frame</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Current frame offset within the track</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>track</I
+></TT
+>[SDL_MAX_TRACKS+1]</TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Array of track descriptions. (see <A
+HREF="sdlcdtrack.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_CDtrack</SPAN
+></A
+>)</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7604"
+></A
+><H2
+>Description</H2
+><P
+>An <SPAN
+CLASS="STRUCTNAME"
+>SDL_CD</SPAN
+> structure is returned by <A
+HREF="sdlcdopen.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CDOpen</TT
+></A
+>. It represents an opened CDROM device and stores information on the layout of the tracks on the disc.</P
+><P
+>A frame is the base data unit of a CD. <TT
+CLASS="LITERAL"
+>CD_FPS</TT
+> frames is equal to 1 second of music. SDL provides two macros for converting between time and frames: <TT
+CLASS="LITERAL"
+>FRAMES_TO_MSF(f, M,S,F)</TT
+> and <TT
+CLASS="LITERAL"
+>MSF_TO_FRAMES</TT
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7614"
+></A
+><H2
+>Examples</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>int min, sec, frame;
+int frame_offset;
+
+FRAMES_TO_MSF(cdrom-&#62;cur_frame, &#38;min, &#38;sec, &#38;frame);
+printf("Current Position: %d minutes, %d seconds, %d frames\n", min, sec, frame);
+
+frame_offset=MSF_TO_FRAMES(min, sec, frame);</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7617"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcdopen.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CDOpen</TT
+></A
+>,
+<A
+HREF="sdlcdtrack.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_CDtrack</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcdclose.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcdtrack.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CDClose</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="cdrom.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CDtrack</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcdclose.html b/distrib/sdl-1.2.15/docs/html/sdlcdclose.html
new file mode 100644
index 0000000..2a984a8
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcdclose.html
@@ -0,0 +1,217 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CDClose</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="CD-ROM"
+HREF="cdrom.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CDEject"
+HREF="sdlcdeject.html"><LINK
+REL="NEXT"
+TITLE="SDL_CD"
+HREF="sdlcd.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcdeject.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcd.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCDCLOSE"
+></A
+>SDL_CDClose</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7541"
+></A
+><H2
+>Name</H2
+>SDL_CDClose&nbsp;--&nbsp;Closes a SDL_CD handle</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7544"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7545"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_CDClose</B
+></CODE
+>(SDL_CD *cdrom);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7551"
+></A
+><H2
+>Description</H2
+><P
+>Closes the given <TT
+CLASS="PARAMETER"
+><I
+>cdrom</I
+></TT
+> handle.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7555"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcdopen.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CDOpen</TT
+></A
+>,
+<A
+HREF="sdlcd.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_CD</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcdeject.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcd.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CDEject</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="cdrom.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CD</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcdeject.html b/distrib/sdl-1.2.15/docs/html/sdlcdeject.html
new file mode 100644
index 0000000..03a3b78
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcdeject.html
@@ -0,0 +1,226 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CDEject</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="CD-ROM"
+HREF="cdrom.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CDStop"
+HREF="sdlcdstop.html"><LINK
+REL="NEXT"
+TITLE="SDL_CDClose"
+HREF="sdlcdclose.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcdstop.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcdclose.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCDEJECT"
+></A
+>SDL_CDEject</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7513"
+></A
+><H2
+>Name</H2
+>SDL_CDEject&nbsp;--&nbsp;Ejects a CDROM</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7516"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7517"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_CDEject</B
+></CODE
+>(SDL_CD *cdrom);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7523"
+></A
+><H2
+>Description</H2
+><P
+>Ejects the given <TT
+CLASS="PARAMETER"
+><I
+>cdrom</I
+></TT
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7527"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> on success, or <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> on an error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7532"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcd.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_CD</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcdstop.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcdclose.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CDStop</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="cdrom.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CDClose</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcdname.html b/distrib/sdl-1.2.15/docs/html/sdlcdname.html
new file mode 100644
index 0000000..55a18e2
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcdname.html
@@ -0,0 +1,239 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CDName</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="CD-ROM"
+HREF="cdrom.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CDNumDrives"
+HREF="sdlcdnumdrives.html"><LINK
+REL="NEXT"
+TITLE="SDL_CDOpen"
+HREF="sdlcdopen.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcdnumdrives.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcdopen.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCDNAME"
+></A
+>SDL_CDName</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7240"
+></A
+><H2
+>Name</H2
+>SDL_CDName&nbsp;--&nbsp;Returns a human-readable, system-dependent identifier for the CD-ROM.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7243"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7244"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>const char *<B
+CLASS="FSFUNC"
+>SDL_CDName</B
+></CODE
+>(int drive);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7250"
+></A
+><H2
+>Description</H2
+><P
+>Returns a human-readable, system-dependent identifier for the CD-ROM. <TT
+CLASS="PARAMETER"
+><I
+>drive</I
+></TT
+> is the index of the drive. Drive indices start to 0 and end at <TT
+CLASS="FUNCTION"
+>SDL_CDNumDrives()</TT
+>-1.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7255"
+></A
+><H2
+>Examples</H2
+><P
+><P
+></P
+><UL
+><LI
+><P
+>"/dev/cdrom"</P
+></LI
+><LI
+><P
+>"E:"</P
+></LI
+><LI
+><P
+>"/dev/disk/ide/1/master"</P
+></LI
+></UL
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7265"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcdnumdrives.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CDNumDrives</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcdnumdrives.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcdopen.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CDNumDrives</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="cdrom.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CDOpen</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcdnumdrives.html b/distrib/sdl-1.2.15/docs/html/sdlcdnumdrives.html
new file mode 100644
index 0000000..9816a73
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcdnumdrives.html
@@ -0,0 +1,205 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CDNumDrives</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="CD-ROM"
+HREF="cdrom.html"><LINK
+REL="PREVIOUS"
+TITLE="CD-ROM"
+HREF="cdrom.html"><LINK
+REL="NEXT"
+TITLE="SDL_CDName"
+HREF="sdlcdname.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="cdrom.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcdname.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCDNUMDRIVES"
+></A
+>SDL_CDNumDrives</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7218"
+></A
+><H2
+>Name</H2
+>SDL_CDNumDrives&nbsp;--&nbsp;Returns the number of CD-ROM drives on the system.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7221"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7222"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_CDNumDrives</B
+></CODE
+>(void);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7228"
+></A
+><H2
+>Description</H2
+><P
+>Returns the number of CD-ROM drives on the system.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7231"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcdopen.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CDOpen</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="cdrom.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcdname.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>CD-ROM</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="cdrom.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CDName</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcdopen.html b/distrib/sdl-1.2.15/docs/html/sdlcdopen.html
new file mode 100644
index 0000000..09a6bd9
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcdopen.html
@@ -0,0 +1,275 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CDOpen</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="CD-ROM"
+HREF="cdrom.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CDName"
+HREF="sdlcdname.html"><LINK
+REL="NEXT"
+TITLE="SDL_CDStatus"
+HREF="sdlcdstatus.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcdname.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcdstatus.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCDOPEN"
+></A
+>SDL_CDOpen</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7274"
+></A
+><H2
+>Name</H2
+>SDL_CDOpen&nbsp;--&nbsp;Opens a CD-ROM drive for access.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7277"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7278"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_CD *<B
+CLASS="FSFUNC"
+>SDL_CDOpen</B
+></CODE
+>(int drive);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7284"
+></A
+><H2
+>Description</H2
+><P
+>Opens a CD-ROM drive for access. It returns a <A
+HREF="sdlcd.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_CD</SPAN
+></A
+> structure on success, or <TT
+CLASS="LITERAL"
+>NULL</TT
+> if the drive was invalid or busy. This newly opened CD-ROM becomes the default CD used when other CD functions are passed a <TT
+CLASS="LITERAL"
+>NULL</TT
+> CD-ROM handle. </P
+><P
+>Drives are numbered starting with 0.
+Drive 0 is the system default CD-ROM.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7292"
+></A
+><H2
+>Examples</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>SDL_CD *cdrom;
+int cur_track;
+int min, sec, frame;
+SDL_Init(SDL_INIT_CDROM);
+atexit(SDL_Quit);
+
+/* Check for CD drives */
+if(!SDL_CDNumDrives()){
+ /* None found */
+ fprintf(stderr, "No CDROM devices available\n");
+ exit(-1);
+}
+
+/* Open the default drive */
+cdrom=SDL_CDOpen(0);
+
+/* Did if open? Check if cdrom is NULL */
+if(!cdrom){
+ fprintf(stderr, "Couldn't open drive: %s\n", SDL_GetError());
+ exit(-1);
+}
+
+/* Print Volume info */
+printf("Name: %s\n", SDL_CDName(0));
+printf("Tracks: %d\n", cdrom-&#62;numtracks);
+for(cur_track=0;cur_track &#60; cdrom-&#62;numtracks; cur_track++){
+ FRAMES_TO_MSF(cdrom-&#62;track[cur_track].length, &#38;min, &#38;sec, &#38;frame);
+ printf("\tTrack %d: Length %d:%d\n", cur_track, min, sec);
+}
+
+SDL_CDClose(cdrom);</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7295"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcd.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_CD</SPAN
+></A
+>,
+<A
+HREF="sdlcdtrack.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_CDtrack</SPAN
+></A
+>,
+<A
+HREF="sdlcdclose.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CDClose</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcdname.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcdstatus.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CDName</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="cdrom.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CDStatus</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcdpause.html b/distrib/sdl-1.2.15/docs/html/sdlcdpause.html
new file mode 100644
index 0000000..4def8e3
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcdpause.html
@@ -0,0 +1,233 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CDPause</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="CD-ROM"
+HREF="cdrom.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CDPlayTracks"
+HREF="sdlcdplaytracks.html"><LINK
+REL="NEXT"
+TITLE="SDL_CDResume"
+HREF="sdlcdresume.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcdplaytracks.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcdresume.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCDPAUSE"
+></A
+>SDL_CDPause</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7425"
+></A
+><H2
+>Name</H2
+>SDL_CDPause&nbsp;--&nbsp;Pauses a CDROM</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7428"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7429"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_CDPause</B
+></CODE
+>(SDL_CD *cdrom);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7435"
+></A
+><H2
+>Description</H2
+><P
+>Pauses play on the given <TT
+CLASS="PARAMETER"
+><I
+>cdrom</I
+></TT
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7439"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> on success, or <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> on an error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7444"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcdplay.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CDPlay</TT
+></A
+>,
+<A
+HREF="sdlcdresume.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CDResume</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcdplaytracks.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcdresume.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CDPlayTracks</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="cdrom.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CDResume</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcdplay.html b/distrib/sdl-1.2.15/docs/html/sdlcdplay.html
new file mode 100644
index 0000000..dc6489c
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcdplay.html
@@ -0,0 +1,243 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CDPlay</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="CD-ROM"
+HREF="cdrom.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CDStatus"
+HREF="sdlcdstatus.html"><LINK
+REL="NEXT"
+TITLE="SDL_CDPlayTracks"
+HREF="sdlcdplaytracks.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcdstatus.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcdplaytracks.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCDPLAY"
+></A
+>SDL_CDPlay</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7343"
+></A
+><H2
+>Name</H2
+>SDL_CDPlay&nbsp;--&nbsp;Play a CD</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7346"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7347"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_CDPlay</B
+></CODE
+>(SDL_CD *cdrom, int start, int length);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7353"
+></A
+><H2
+>Description</H2
+><P
+>Plays the given <TT
+CLASS="PARAMETER"
+><I
+>cdrom</I
+></TT
+>, starting a frame <TT
+CLASS="PARAMETER"
+><I
+>start</I
+></TT
+> for <TT
+CLASS="PARAMETER"
+><I
+>length</I
+></TT
+> frames.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7359"
+></A
+><H2
+>Return Values</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> on success, or <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> on an error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7364"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcdplaytracks.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CDPlayTracks</TT
+></A
+>,
+<A
+HREF="sdlcdstop.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CDStop</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcdstatus.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcdplaytracks.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CDStatus</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="cdrom.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CDPlayTracks</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcdplaytracks.html b/distrib/sdl-1.2.15/docs/html/sdlcdplaytracks.html
new file mode 100644
index 0000000..7546181
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcdplaytracks.html
@@ -0,0 +1,325 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CDPlayTracks</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="CD-ROM"
+HREF="cdrom.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CDPlay"
+HREF="sdlcdplay.html"><LINK
+REL="NEXT"
+TITLE="SDL_CDPause"
+HREF="sdlcdpause.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcdplay.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcdpause.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCDPLAYTRACKS"
+></A
+>SDL_CDPlayTracks</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7375"
+></A
+><H2
+>Name</H2
+>SDL_CDPlayTracks&nbsp;--&nbsp;Play the given CD track(s)</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7378"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7379"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_CDPlayTracks</B
+></CODE
+>(SDL_CD *cdrom, int start_track, int start_frame, int ntracks, int nframes));</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7385"
+></A
+><H2
+>Description</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_CDPlayTracks</TT
+> plays the given CD starting at track
+<TT
+CLASS="PARAMETER"
+><I
+>start_track</I
+></TT
+>, for <TT
+CLASS="PARAMETER"
+><I
+>ntracks</I
+></TT
+> tracks. </P
+><P
+><TT
+CLASS="PARAMETER"
+><I
+>start_frame</I
+></TT
+> is the frame offset, from the beginning of the <TT
+CLASS="PARAMETER"
+><I
+>start_track</I
+></TT
+>, at which to start. <TT
+CLASS="PARAMETER"
+><I
+>nframes</I
+></TT
+> is the frame offset, from the beginning of the last track (<TT
+CLASS="PARAMETER"
+><I
+>start_track</I
+></TT
+>+<TT
+CLASS="PARAMETER"
+><I
+>ntracks</I
+></TT
+>), at which to end playing.</P
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_CDPlayTracks</TT
+> should only be called after calling
+<A
+HREF="sdlcdstatus.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CDStatus</TT
+></A
+>
+to get track information about the CD.</P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>Data tracks are ignored.</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7403"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+>, or <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+>
+if there was an error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7408"
+></A
+><H2
+>Examples</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>/* assuming cdrom is a previously opened device */
+/* Play the entire CD */
+if(CD_INDRIVE(SDL_CDStatus(cdrom)))
+ SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
+
+/* Play the first track */
+if(CD_INDRIVE(SDL_CDStatus(cdrom)))
+ SDL_CDPlayTracks(cdrom, 0, 0, 1, 0);
+
+/* Play first 15 seconds of the 2nd track */
+if(CD_INDRIVE(SDL_CDStatus(cdrom)))
+ SDL_CDPlayTracks(cdrom, 1, 0, 0, CD_FPS*15);</PRE
+>
+&#13;</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7412"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcdplay.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CDPlay</TT
+></A
+>,
+<A
+HREF="sdlcdstatus.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CDStatus</TT
+></A
+>,
+<A
+HREF="sdlcd.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CD</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcdplay.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcdpause.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CDPlay</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="cdrom.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CDPause</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcdresume.html b/distrib/sdl-1.2.15/docs/html/sdlcdresume.html
new file mode 100644
index 0000000..4a25ab6
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcdresume.html
@@ -0,0 +1,233 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CDResume</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="CD-ROM"
+HREF="cdrom.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CDPause"
+HREF="sdlcdpause.html"><LINK
+REL="NEXT"
+TITLE="SDL_CDStop"
+HREF="sdlcdstop.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcdpause.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcdstop.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCDRESUME"
+></A
+>SDL_CDResume</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7455"
+></A
+><H2
+>Name</H2
+>SDL_CDResume&nbsp;--&nbsp;Resumes a CDROM</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7458"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7459"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_CDResume</B
+></CODE
+>(SDL_CD *cdrom);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7465"
+></A
+><H2
+>Description</H2
+><P
+>Resumes play on the given <TT
+CLASS="PARAMETER"
+><I
+>cdrom</I
+></TT
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7469"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> on success, or <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> on an error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7474"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcdplay.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CDPlay</TT
+></A
+>,
+<A
+HREF="sdlcdpause.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CDPause</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcdpause.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcdstop.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CDPause</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="cdrom.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CDStop</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcdstatus.html b/distrib/sdl-1.2.15/docs/html/sdlcdstatus.html
new file mode 100644
index 0000000..3ebf965
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcdstatus.html
@@ -0,0 +1,273 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CDStatus</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="CD-ROM"
+HREF="cdrom.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CDOpen"
+HREF="sdlcdopen.html"><LINK
+REL="NEXT"
+TITLE="SDL_CDPlay"
+HREF="sdlcdplay.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcdopen.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcdplay.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCDSTATUS"
+></A
+>SDL_CDStatus</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7308"
+></A
+><H2
+>Name</H2
+>SDL_CDStatus&nbsp;--&nbsp;Returns the current status of the given drive.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7311"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7312"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>CDstatus <B
+CLASS="FSFUNC"
+>SDL_CDStatus</B
+></CODE
+>(SDL_CD *cdrom);</CODE
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>/* Given a status, returns true if there's a disk in the drive */
+#define CD_INDRIVE(status) ((int)status &#62; 0)</PRE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7319"
+></A
+><H2
+>Description</H2
+><P
+>This function returns the current status of the given drive. Status is described like so:
+<PRE
+CLASS="PROGRAMLISTING"
+>typedef enum {
+ CD_TRAYEMPTY,
+ CD_STOPPED,
+ CD_PLAYING,
+ CD_PAUSED,
+ CD_ERROR = -1
+} CDstatus;</PRE
+></P
+><P
+>If the drive has a CD in it, the table of contents of the CD and current
+play position of the CD will be stored in the SDL_CD structure.</P
+><P
+>The macro <TT
+CLASS="LITERAL"
+>CD_INDRIVE</TT
+> is provided for convenience,
+and given a status returns true if there's a disk in the drive.</P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+><TT
+CLASS="FUNCTION"
+>SDL_CDStatus</TT
+> also updates the <A
+HREF="sdlcd.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_CD</SPAN
+></A
+> structure passed to it.</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7331"
+></A
+><H2
+>Example</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>int playTrack(int track)
+{
+ int playing = 0;
+
+ if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
+ /* clamp to the actual number of tracks on the CD */
+ if (track &#62;= cdrom-&#62;numtracks) {
+ track = cdrom-&#62;numtracks-1;
+ }
+
+ if ( SDL_CDPlayTracks(cdrom, track, 0, 1, 0) == 0 ) {
+ playing = 1;
+ }
+ }
+ return playing;
+}</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7334"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcd.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CD</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcdopen.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcdplay.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CDOpen</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="cdrom.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CDPlay</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcdstop.html b/distrib/sdl-1.2.15/docs/html/sdlcdstop.html
new file mode 100644
index 0000000..68f8d81
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcdstop.html
@@ -0,0 +1,226 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CDStop</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="CD-ROM"
+HREF="cdrom.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CDResume"
+HREF="sdlcdresume.html"><LINK
+REL="NEXT"
+TITLE="SDL_CDEject"
+HREF="sdlcdeject.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcdresume.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcdeject.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCDSTOP"
+></A
+>SDL_CDStop</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7485"
+></A
+><H2
+>Name</H2
+>SDL_CDStop&nbsp;--&nbsp;Stops a CDROM</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7488"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7489"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_CDStop</B
+></CODE
+>(SDL_CD *cdrom);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7495"
+></A
+><H2
+>Description</H2
+><P
+>Stops play on the given <TT
+CLASS="PARAMETER"
+><I
+>cdrom</I
+></TT
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7499"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> on success, or <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> on an error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7504"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcdplay.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CDPlay</TT
+></A
+>,</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcdresume.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcdeject.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CDResume</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="cdrom.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CDEject</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcdtrack.html b/distrib/sdl-1.2.15/docs/html/sdlcdtrack.html
new file mode 100644
index 0000000..bbb04bb
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcdtrack.html
@@ -0,0 +1,313 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CDtrack</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="CD-ROM"
+HREF="cdrom.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CD"
+HREF="sdlcd.html"><LINK
+REL="NEXT"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcd.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="thread.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCDTRACK"
+></A
+>SDL_CDtrack</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7628"
+></A
+><H2
+>Name</H2
+>SDL_CDtrack&nbsp;--&nbsp;CD Track Information Structure</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7631"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ Uint8 id;
+ Uint8 type;
+ Uint32 length;
+ Uint32 offset;
+} SDL_CDtrack;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7634"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN7636"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>id</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Track number (0-99)</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_AUDIO_TRACK</TT
+> or <TT
+CLASS="LITERAL"
+>SDL_DATA_TRACK</TT
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>length</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Length, in frames, of this track</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>offset</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Frame offset to the beginning of this track</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7657"
+></A
+><H2
+>Description</H2
+><P
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_CDtrack</SPAN
+> stores data on each track on a CD, its fields should be pretty self explainatory. It is a member a the <A
+HREF="sdlcd.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_CD</SPAN
+></A
+> structure.</P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>Frames can be converted to standard timings. There are <TT
+CLASS="LITERAL"
+>CD_FPS</TT
+> frames per second, so <SPAN
+CLASS="STRUCTNAME"
+>SDL_CDtrack</SPAN
+>.<TT
+CLASS="STRUCTFIELD"
+><I
+>length</I
+></TT
+>/<TT
+CLASS="LITERAL"
+>CD_FPS</TT
+>=length_in_seconds.</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7669"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcd.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_CD</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcd.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CD</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="cdrom.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Multi-threaded Programming</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcloseaudio.html b/distrib/sdl-1.2.15/docs/html/sdlcloseaudio.html
new file mode 100644
index 0000000..599f058
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcloseaudio.html
@@ -0,0 +1,205 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CloseAudio</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Audio"
+HREF="audio.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_UnlockAudio"
+HREF="sdlunlockaudio.html"><LINK
+REL="NEXT"
+TITLE="CD-ROM"
+HREF="cdrom.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlunlockaudio.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="cdrom.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCLOSEAUDIO"
+></A
+>SDL_CloseAudio</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7180"
+></A
+><H2
+>Name</H2
+>SDL_CloseAudio&nbsp;--&nbsp;Shuts down audio processing and closes the audio device.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7183"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7184"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_CloseAudio</B
+></CODE
+>(void);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7190"
+></A
+><H2
+>Description</H2
+><P
+>This function shuts down audio processing and closes the audio device.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7193"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlopenaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_OpenAudio</TT
+></A
+> </P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlunlockaudio.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="cdrom.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_UnlockAudio</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="audio.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>CD-ROM</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcolor.html b/distrib/sdl-1.2.15/docs/html/sdlcolor.html
new file mode 100644
index 0000000..c8b7d44
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcolor.html
@@ -0,0 +1,300 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_Color</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_Rect"
+HREF="sdlrect.html"><LINK
+REL="NEXT"
+TITLE="SDL_Palette"
+HREF="sdlpalette.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlrect.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlpalette.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCOLOR"
+></A
+>SDL_Color</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN3082"
+></A
+><H2
+>Name</H2
+>SDL_Color&nbsp;--&nbsp;Format independent color description</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3085"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 unused;
+} SDL_Color;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3088"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN3090"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>r</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Red intensity</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>g</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Green intensity</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>b</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Blue intensity</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>unused</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Unused</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3109"
+></A
+><H2
+>Description</H2
+><P
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Color</SPAN
+> describes a color in a format independent way. You can convert a <SPAN
+CLASS="STRUCTNAME"
+>SDL_Color</SPAN
+> to a pixel value for a certain pixel format using <A
+HREF="sdlmaprgb.html"
+><TT
+CLASS="FUNCTION"
+>SDL_MapRGB</TT
+></A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3116"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlpixelformat.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_PixelFormat</SPAN
+></A
+>,
+<A
+HREF="sdlsetcolors.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetColors</TT
+></A
+>,
+<A
+HREF="sdlpalette.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Palette</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlrect.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlpalette.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_Rect</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_Palette</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcondbroadcast.html b/distrib/sdl-1.2.15/docs/html/sdlcondbroadcast.html
new file mode 100644
index 0000000..9b0fc83
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcondbroadcast.html
@@ -0,0 +1,224 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CondBroadcast</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CondSignal"
+HREF="sdlcondsignal.html"><LINK
+REL="NEXT"
+TITLE="SDL_CondWait"
+HREF="sdlcondwait.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcondsignal.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcondwait.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCONDBROADCAST"
+></A
+>SDL_CondBroadcast</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8337"
+></A
+><H2
+>Name</H2
+>SDL_CondBroadcast&nbsp;--&nbsp;Restart all threads waiting on a condition variable</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8340"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN8341"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_CondBroadcast</B
+></CODE
+>(SDL_cond *cond);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8347"
+></A
+><H2
+>Description</H2
+><P
+>Restarts all threads that are waiting on the condition variable, <TT
+CLASS="PARAMETER"
+><I
+>cond</I
+></TT
+>. Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> on success, or <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> on an error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8353"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcondsignal.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CondSignal</TT
+></A
+>,
+<A
+HREF="sdlcondwait.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CondWait</TT
+></A
+>&#13;</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcondsignal.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcondwait.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CondSignal</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CondWait</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcondsignal.html b/distrib/sdl-1.2.15/docs/html/sdlcondsignal.html
new file mode 100644
index 0000000..24e9175
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcondsignal.html
@@ -0,0 +1,224 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CondSignal</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_DestroyCond"
+HREF="sdldestroycond.html"><LINK
+REL="NEXT"
+TITLE="SDL_CondBroadcast"
+HREF="sdlcondbroadcast.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdldestroycond.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcondbroadcast.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCONDSIGNAL"
+></A
+>SDL_CondSignal</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8310"
+></A
+><H2
+>Name</H2
+>SDL_CondSignal&nbsp;--&nbsp;Restart a thread wait on a condition variable</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8313"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN8314"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_CondSignal</B
+></CODE
+>(SDL_cond *cond);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8320"
+></A
+><H2
+>Description</H2
+><P
+>Restart one of the threads that are waiting on the condition variable, <TT
+CLASS="PARAMETER"
+><I
+>cond</I
+></TT
+>. Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> on success of <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> on an error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8326"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcondwait.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CondWait</TT
+></A
+>,
+<A
+HREF="sdlcondbroadcast.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CondBroadcast</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdldestroycond.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcondbroadcast.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_DestroyCond</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CondBroadcast</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcondwait.html b/distrib/sdl-1.2.15/docs/html/sdlcondwait.html
new file mode 100644
index 0000000..8f15452
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcondwait.html
@@ -0,0 +1,231 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CondWait</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CondBroadcast"
+HREF="sdlcondbroadcast.html"><LINK
+REL="NEXT"
+TITLE="SDL_CondWaitTimeout"
+HREF="sdlcondwaittimeout.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcondbroadcast.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcondwaittimeout.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCONDWAIT"
+></A
+>SDL_CondWait</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8364"
+></A
+><H2
+>Name</H2
+>SDL_CondWait&nbsp;--&nbsp;Wait on a condition variable</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8367"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN8368"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_CondWait</B
+></CODE
+>(SDL_cond *cond, SDL_mutex *mut);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8374"
+></A
+><H2
+>Description</H2
+><P
+>Wait on the condition variable <TT
+CLASS="PARAMETER"
+><I
+>cond</I
+></TT
+> and unlock the provided mutex. The mutex must the locked before entering this function. Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> when it is signalled, or <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> on an error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8380"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcondwaittimeout.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CondWaitTimeout</TT
+></A
+>,
+<A
+HREF="sdlcondsignal.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CondSignal</TT
+></A
+>,
+<A
+HREF="sdlmutexp.html"
+><TT
+CLASS="FUNCTION"
+>SDL_mutexP</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcondbroadcast.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcondwaittimeout.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CondBroadcast</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CondWaitTimeout</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcondwaittimeout.html b/distrib/sdl-1.2.15/docs/html/sdlcondwaittimeout.html
new file mode 100644
index 0000000..deed50b
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcondwaittimeout.html
@@ -0,0 +1,230 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CondWaitTimeout</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CondWait"
+HREF="sdlcondwait.html"><LINK
+REL="NEXT"
+TITLE="Time"
+HREF="time.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcondwait.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="time.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCONDWAITTIMEOUT"
+></A
+>SDL_CondWaitTimeout</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8393"
+></A
+><H2
+>Name</H2
+>SDL_CondWaitTimeout&nbsp;--&nbsp;Wait on a condition variable, with timeout</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8396"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN8397"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_CondWaitTimeout</B
+></CODE
+>(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8403"
+></A
+><H2
+>Description</H2
+><P
+>Wait on the condition variable <TT
+CLASS="PARAMETER"
+><I
+>cond</I
+></TT
+> for, at most, <TT
+CLASS="PARAMETER"
+><I
+>ms</I
+></TT
+> milliseconds. <TT
+CLASS="PARAMETER"
+><I
+>mut</I
+></TT
+> is unlocked so it must be locked when the function is called. Returns <TT
+CLASS="LITERAL"
+>SDL_MUTEX_TIMEDOUT</TT
+> if the condition is not signalled in the allotted time, <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> if it was signalled or <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> on an error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8412"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcondwait.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CondWait</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcondwait.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="time.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CondWait</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Time</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlconvertaudio.html b/distrib/sdl-1.2.15/docs/html/sdlconvertaudio.html
new file mode 100644
index 0000000..52f1229
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlconvertaudio.html
@@ -0,0 +1,407 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_ConvertAudio</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Audio"
+HREF="audio.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_BuildAudioCVT"
+HREF="sdlbuildaudiocvt.html"><LINK
+REL="NEXT"
+TITLE="SDL_MixAudio"
+HREF="sdlmixaudio.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlbuildaudiocvt.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlmixaudio.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCONVERTAUDIO"
+></A
+>SDL_ConvertAudio</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7048"
+></A
+><H2
+>Name</H2
+>SDL_ConvertAudio&nbsp;--&nbsp;Convert audio data to a desired audio format.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7051"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7052"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_ConvertAudio</B
+></CODE
+>(SDL_AudioCVT *cvt);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7058"
+></A
+><H2
+>Description</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_ConvertAudio</TT
+> takes one parameter, <TT
+CLASS="PARAMETER"
+><I
+>cvt</I
+></TT
+>, which was previously initilized. Initilizing a <A
+HREF="sdlaudiocvt.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_AudioCVT</SPAN
+></A
+> is a two step process. First of all, the structure must be passed to <A
+HREF="sdlbuildaudiocvt.html"
+><TT
+CLASS="FUNCTION"
+>SDL_BuildAudioCVT</TT
+></A
+> along with source and destination format parameters. Secondly, the <SPAN
+CLASS="STRUCTNAME"
+>cvt</SPAN
+>-&#62;<TT
+CLASS="STRUCTFIELD"
+><I
+>buf</I
+></TT
+> and <SPAN
+CLASS="STRUCTNAME"
+>cvt</SPAN
+>-&#62;<TT
+CLASS="STRUCTFIELD"
+><I
+>len</I
+></TT
+> fields must be setup. <SPAN
+CLASS="STRUCTNAME"
+>cvt</SPAN
+>-&#62;<TT
+CLASS="STRUCTFIELD"
+><I
+>buf</I
+></TT
+> should point to the audio data and <SPAN
+CLASS="STRUCTNAME"
+>cvt</SPAN
+>-&#62;<TT
+CLASS="STRUCTFIELD"
+><I
+>len</I
+></TT
+> should be set to the length of the audio data in bytes. Remember, the length of the buffer pointed to by <TT
+CLASS="STRUCTFIELD"
+><I
+>buf</I
+></TT
+> show be <TT
+CLASS="STRUCTFIELD"
+><I
+>len</I
+></TT
+>*<TT
+CLASS="STRUCTFIELD"
+><I
+>len_mult</I
+></TT
+> bytes in length.</P
+><P
+>Once the <SPAN
+CLASS="STRUCTNAME"
+>SDL_AudioCVT</SPAN
+>structure is initilized then we can pass it to <TT
+CLASS="FUNCTION"
+>SDL_ConvertAudio</TT
+>, which will convert the audio data pointer to by <SPAN
+CLASS="STRUCTNAME"
+>cvt</SPAN
+>-&#62;<TT
+CLASS="STRUCTFIELD"
+><I
+>buf</I
+></TT
+>. If <TT
+CLASS="FUNCTION"
+>SDL_ConvertAudio</TT
+> returned <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> then the conversion was completed successfully, otherwise <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> is returned.</P
+><P
+>If the conversion completed successfully then the converted audio data can be read from <SPAN
+CLASS="STRUCTNAME"
+>cvt</SPAN
+>-&#62;<TT
+CLASS="STRUCTFIELD"
+><I
+>buf</I
+></TT
+>. The amount of valid, converted, audio data in the buffer is equal to <SPAN
+CLASS="STRUCTNAME"
+>cvt</SPAN
+>-&#62;<TT
+CLASS="STRUCTFIELD"
+><I
+>len</I
+></TT
+>*<TT
+CLASS="STRUCTFIELD"
+><I
+>cvt</I
+></TT
+>-&#62;<SPAN
+CLASS="STRUCTNAME"
+>len_ratio</SPAN
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7093"
+></A
+><H2
+>Examples</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>/* Converting some WAV data to hardware format */
+void my_audio_callback(void *userdata, Uint8 *stream, int len);
+
+SDL_AudioSpec *desired, *obtained;
+SDL_AudioSpec wav_spec;
+SDL_AudioCVT wav_cvt;
+Uint32 wav_len;
+Uint8 *wav_buf;
+int ret;
+
+/* Allocated audio specs */
+desired = malloc(sizeof(SDL_AudioSpec));
+obtained = malloc(sizeof(SDL_AudioSpec));
+
+/* Set desired format */
+desired-&#62;freq=22050;
+desired-&#62;format=AUDIO_S16LSB;
+desired-&#62;samples=8192;
+desired-&#62;callback=my_audio_callback;
+desired-&#62;userdata=NULL;
+
+/* Open the audio device */
+if ( SDL_OpenAudio(desired, obtained) &#60; 0 ){
+ fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
+ exit(-1);
+}
+
+free(desired);
+
+/* Load the test.wav */
+if( SDL_LoadWAV("test.wav", &#38;wav_spec, &#38;wav_buf, &#38;wav_len) == NULL ){
+ fprintf(stderr, "Could not open test.wav: %s\n", SDL_GetError());
+ SDL_CloseAudio();
+ free(obtained);
+ exit(-1);
+}
+
+/* Build AudioCVT */
+ret = SDL_BuildAudioCVT(&#38;wav_cvt,
+ wav_spec.format, wav_spec.channels, wav_spec.freq,
+ obtained-&#62;format, obtained-&#62;channels, obtained-&#62;freq);
+
+/* Check that the convert was built */
+if(ret==-1){
+ fprintf(stderr, "Couldn't build converter!\n");
+ SDL_CloseAudio();
+ free(obtained);
+ SDL_FreeWAV(wav_buf);
+}
+
+/* Setup for conversion */
+wav_cvt.buf = malloc(wav_len * wav_cvt.len_mult);
+wav_cvt.len = wav_len;
+memcpy(wav_cvt.buf, wav_buf, wav_len);
+
+/* We can delete to original WAV data now */
+SDL_FreeWAV(wav_buf);
+
+/* And now we're ready to convert */
+SDL_ConvertAudio(&#38;wav_cvt);
+
+/* do whatever */
+.
+.
+.
+.
+&#13;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7096"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlbuildaudiocvt.html"
+><TT
+CLASS="FUNCTION"
+>SDL_BuildAudioCVT</TT
+></A
+>,
+<A
+HREF="sdlaudiocvt.html"
+><TT
+CLASS="FUNCTION"
+>SDL_AudioCVT</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlbuildaudiocvt.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlmixaudio.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_BuildAudioCVT</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="audio.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_MixAudio</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlconvertsurface.html b/distrib/sdl-1.2.15/docs/html/sdlconvertsurface.html
new file mode 100644
index 0000000..cc21f78
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlconvertsurface.html
@@ -0,0 +1,271 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_ConvertSurface</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GetClipRect"
+HREF="sdlgetcliprect.html"><LINK
+REL="NEXT"
+TITLE="SDL_BlitSurface"
+HREF="sdlblitsurface.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlgetcliprect.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlblitsurface.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCONVERTSURFACE"
+></A
+>SDL_ConvertSurface</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2258"
+></A
+><H2
+>Name</H2
+>SDL_ConvertSurface&nbsp;--&nbsp;Converts a surface to the same format as another surface.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2261"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2262"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL/SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_Surface *<B
+CLASS="FSFUNC"
+>SDL_ConvertSurface</B
+></CODE
+>(SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2268"
+></A
+><H2
+>Description</H2
+><P
+>Creates a new surface of the specified format, and then copies and maps
+the given surface to it. If this function fails, it returns
+<TT
+CLASS="LITERAL"
+>NULL</TT
+>.</P
+><P
+>The <TT
+CLASS="PARAMETER"
+><I
+>flags</I
+></TT
+> parameter is passed to
+<A
+HREF="sdlcreatergbsurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateRGBSurface</TT
+></A
+>
+and has those semantics.</P
+><P
+>This function is used internally by
+<A
+HREF="sdldisplayformat.html"
+><TT
+CLASS="FUNCTION"
+>SDL_DisplayFormat</TT
+></A
+>.</P
+><P
+>This function can only be called after SDL_Init.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2280"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns either a pointer to the new surface, or
+<TT
+CLASS="LITERAL"
+>NULL</TT
+> on error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2284"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcreatergbsurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateRGBSurface</TT
+></A
+>,
+<A
+HREF="sdldisplayformat.html"
+><TT
+CLASS="FUNCTION"
+>SDL_DisplayFormat</TT
+></A
+>,
+<A
+HREF="sdlpixelformat.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_PixelFormat</SPAN
+></A
+>,
+<A
+HREF="sdlsurface.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlgetcliprect.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlblitsurface.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GetClipRect</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_BlitSurface</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcreatecond.html b/distrib/sdl-1.2.15/docs/html/sdlcreatecond.html
new file mode 100644
index 0000000..02fcdb2
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcreatecond.html
@@ -0,0 +1,240 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CreateCond</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_SemValue"
+HREF="sdlsemvalue.html"><LINK
+REL="NEXT"
+TITLE="SDL_DestroyCond"
+HREF="sdldestroycond.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlsemvalue.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdldestroycond.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCREATECOND"
+></A
+>SDL_CreateCond</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8259"
+></A
+><H2
+>Name</H2
+>SDL_CreateCond&nbsp;--&nbsp;Create a condition variable</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8262"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN8263"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_cond *<B
+CLASS="FSFUNC"
+>SDL_CreateCond</B
+></CODE
+>(void);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8269"
+></A
+><H2
+>Description</H2
+><P
+>Creates a condition variable.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8272"
+></A
+><H2
+>Examples</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>SDL_cond *cond;
+
+cond=SDL_CreateCond();
+.
+.
+/* Do stuff */
+
+.
+.
+SDL_DestroyCond(cond);</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8275"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdldestroycond.html"
+><TT
+CLASS="FUNCTION"
+>SDL_DestroyCond</TT
+></A
+>,
+<A
+HREF="sdlcondwait.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CondWait</TT
+></A
+>,
+<A
+HREF="sdlcondsignal.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CondSignal</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlsemvalue.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdldestroycond.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_SemValue</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_DestroyCond</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcreatecursor.html b/distrib/sdl-1.2.15/docs/html/sdlcreatecursor.html
new file mode 100644
index 0000000..a444165
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcreatecursor.html
@@ -0,0 +1,398 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CreateCursor</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_WarpMouse"
+HREF="sdlwarpmouse.html"><LINK
+REL="NEXT"
+TITLE="SDL_FreeCursor"
+HREF="sdlfreecursor.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlwarpmouse.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlfreecursor.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCREATECURSOR"
+></A
+>SDL_CreateCursor</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2487"
+></A
+><H2
+>Name</H2
+>SDL_CreateCursor&nbsp;--&nbsp;Creates a new mouse cursor.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2490"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2491"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_Cursor *<B
+CLASS="FSFUNC"
+>SDL_CreateCursor</B
+></CODE
+>(Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2497"
+></A
+><H2
+>Description</H2
+><P
+>Create a cursor using the specified <TT
+CLASS="PARAMETER"
+><I
+>data</I
+></TT
+> and <TT
+CLASS="PARAMETER"
+><I
+>mask</I
+></TT
+> (in MSB format).
+The cursor width must be a multiple of 8 bits.</P
+><P
+>The cursor is created in black and white according to the following:
+<DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN2503"
+></A
+><P
+></P
+><TABLE
+BORDER="1"
+CLASS="CALSTABLE"
+><THEAD
+><TR
+><TH
+ALIGN="LEFT"
+VALIGN="TOP"
+>Data / Mask</TH
+><TH
+ALIGN="LEFT"
+VALIGN="TOP"
+>Resulting pixel on screen</TH
+></TR
+></THEAD
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>0 / 1</TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>White</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>1 / 1</TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Black</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>0 / 0</TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Transparent</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>1 / 0</TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Inverted color if possible, black if not.</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></P
+><P
+>Cursors created with this function must be freed with
+<A
+HREF="sdlfreecursor.html"
+>SDL_FreeCursor</A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2524"
+></A
+><H2
+>Example</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>/* Stolen from the mailing list */
+/* Creates a new mouse cursor from an XPM */
+
+
+/* XPM */
+static const char *arrow[] = {
+ /* width height num_colors chars_per_pixel */
+ " 32 32 3 1",
+ /* colors */
+ "X c #000000",
+ ". c #ffffff",
+ " c None",
+ /* pixels */
+ "X ",
+ "XX ",
+ "X.X ",
+ "X..X ",
+ "X...X ",
+ "X....X ",
+ "X.....X ",
+ "X......X ",
+ "X.......X ",
+ "X........X ",
+ "X.....XXXXX ",
+ "X..X..X ",
+ "X.X X..X ",
+ "XX X..X ",
+ "X X..X ",
+ " X..X ",
+ " X..X ",
+ " X..X ",
+ " XX ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ "0,0"
+};
+
+static SDL_Cursor *init_system_cursor(const char *image[])
+{
+ int i, row, col;
+ Uint8 data[4*32];
+ Uint8 mask[4*32];
+ int hot_x, hot_y;
+
+ i = -1;
+ for ( row=0; row&#60;32; ++row ) {
+ for ( col=0; col&#60;32; ++col ) {
+ if ( col % 8 ) {
+ data[i] &#60;&#60;= 1;
+ mask[i] &#60;&#60;= 1;
+ } else {
+ ++i;
+ data[i] = mask[i] = 0;
+ }
+ switch (image[4+row][col]) {
+ case 'X':
+ data[i] |= 0x01;
+ mask[i] |= 0x01;
+ break;
+ case '.':
+ mask[i] |= 0x01;
+ break;
+ case ' ':
+ break;
+ }
+ }
+ }
+ sscanf(image[4+row], "%d,%d", &#38;hot_x, &#38;hot_y);
+ return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y);
+}</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2527"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlfreecursor.html"
+><TT
+CLASS="FUNCTION"
+>SDL_FreeCursor</TT
+></A
+>,
+<A
+HREF="sdlsetcursor.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetCursor</TT
+></A
+>,
+<A
+HREF="sdlshowcursor.html"
+><TT
+CLASS="FUNCTION"
+>SDL_ShowCursor</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlwarpmouse.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlfreecursor.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_WarpMouse</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_FreeCursor</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcreatemutex.html b/distrib/sdl-1.2.15/docs/html/sdlcreatemutex.html
new file mode 100644
index 0000000..53ed48b
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcreatemutex.html
@@ -0,0 +1,249 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CreateMutex</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_KillThread"
+HREF="sdlkillthread.html"><LINK
+REL="NEXT"
+TITLE="SDL_DestroyMutex"
+HREF="sdldestroymutex.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlkillthread.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdldestroymutex.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCREATEMUTEX"
+></A
+>SDL_CreateMutex</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7820"
+></A
+><H2
+>Name</H2
+>SDL_CreateMutex&nbsp;--&nbsp;Create a mutex</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7823"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7824"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_mutex *<B
+CLASS="FSFUNC"
+>SDL_CreateMutex</B
+></CODE
+>(void);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7830"
+></A
+><H2
+>Description</H2
+><P
+>Create a new, unlocked mutex.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7833"
+></A
+><H2
+>Examples</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>SDL_mutex *mut;
+
+mut=SDL_CreateMutex();
+.
+.
+if(SDL_mutexP(mut)==-1){
+ fprintf(stderr, "Couldn't lock mutex\n");
+ exit(-1);
+}
+.
+/* Do stuff while mutex is locked */
+.
+.
+if(SDL_mutexV(mut)==-1){
+ fprintf(stderr, "Couldn't unlock mutex\n");
+ exit(-1);
+}
+
+SDL_DestroyMutex(mut);&#13;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7836"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlmutexp.html"
+><TT
+CLASS="FUNCTION"
+>SDL_mutexP</TT
+></A
+>,
+<A
+HREF="sdlmutexv.html"
+><TT
+CLASS="FUNCTION"
+>SDL_mutexV</TT
+></A
+>,
+<A
+HREF="sdldestroymutex.html"
+><TT
+CLASS="FUNCTION"
+>SDL_DestroyMutex</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlkillthread.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdldestroymutex.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_KillThread</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_DestroyMutex</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcreatergbsurface.html b/distrib/sdl-1.2.15/docs/html/sdlcreatergbsurface.html
new file mode 100644
index 0000000..736ec8f
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcreatergbsurface.html
@@ -0,0 +1,458 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CreateRGBSurface</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GetRGBA"
+HREF="sdlgetrgba.html"><LINK
+REL="NEXT"
+TITLE="SDL_CreateRGBSurfaceFrom"
+HREF="sdlcreatergbsurfacefrom.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlgetrgba.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcreatergbsurfacefrom.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCREATERGBSURFACE"
+></A
+>SDL_CreateRGBSurface</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1773"
+></A
+><H2
+>Name</H2
+>SDL_CreateRGBSurface&nbsp;--&nbsp;Create an empty SDL_Surface</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1776"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1777"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_Surface *<B
+CLASS="FSFUNC"
+>SDL_CreateRGBSurface</B
+></CODE
+>(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1783"
+></A
+><H2
+>Description</H2
+><P
+>Allocate an empty surface (must be called after <A
+HREF="sdlsetvideomode.html"
+>SDL_SetVideoMode</A
+>)</P
+><P
+>If <TT
+CLASS="PARAMETER"
+><I
+>depth</I
+></TT
+> is 8 bits an empty palette is allocated for the surface, otherwise a 'packed-pixel' <A
+HREF="sdlpixelformat.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_PixelFormat</SPAN
+></A
+> is created using the <TT
+CLASS="PARAMETER"
+><I
+>[RGBA]mask</I
+></TT
+>'s provided (see <A
+HREF="sdlpixelformat.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_PixelFormat</SPAN
+></A
+>). The <TT
+CLASS="PARAMETER"
+><I
+>flags</I
+></TT
+> specifies the type of surface that should be created, it is an OR'd combination of the following possible values.</P
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN1795"
+></A
+><P
+></P
+><TABLE
+BORDER="1"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_SWSURFACE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDL will create the surface in system memory. This improves the performance of pixel level access, however you may not be able to take advantage of some types of hardware blitting.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_HWSURFACE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDL will attempt to create the surface in video memory. This will allow SDL to take advantage of Video-&#62;Video blits (which are often accelerated).</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_SRCCOLORKEY</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>This flag turns on colourkeying for blits from this surface. If
+<TT
+CLASS="LITERAL"
+>SDL_HWSURFACE</TT
+> is also specified and colourkeyed blits
+are hardware-accelerated, then SDL will attempt to place the surface in
+video memory.
+Use <A
+HREF="sdlsetcolorkey.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetColorKey</TT
+></A
+>
+to set or clear this flag after surface creation.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_SRCALPHA</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>This flag turns on alpha-blending for blits from this surface. If
+<TT
+CLASS="LITERAL"
+>SDL_HWSURFACE</TT
+> is also specified and alpha-blending blits
+are hardware-accelerated, then the surface will be placed in video memory if
+possible.
+Use <A
+HREF="sdlsetalpha.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetAlpha</TT
+></A
+> to
+set or clear this flag after surface creation.</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>If an alpha-channel is specified (that is, if <TT
+CLASS="PARAMETER"
+><I
+>Amask</I
+></TT
+> is
+nonzero), then the <TT
+CLASS="LITERAL"
+>SDL_SRCALPHA</TT
+> flag is automatically
+set. You may remove this flag by calling
+<A
+HREF="sdlsetalpha.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetAlpha</TT
+></A
+>
+after surface creation.</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1826"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns the created surface, or <SPAN
+CLASS="RETURNVALUE"
+>NULL</SPAN
+> upon error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1830"
+></A
+><H2
+>Example</H2
+><PRE
+CLASS="PROGRAMLISTING"
+> /* Create a 32-bit surface with the bytes of each pixel in R,G,B,A order,
+ as expected by OpenGL for textures */
+ SDL_Surface *surface;
+ Uint32 rmask, gmask, bmask, amask;
+
+ /* SDL interprets each pixel as a 32-bit number, so our masks must depend
+ on the endianness (byte order) of the machine */
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+ rmask = 0xff000000;
+ gmask = 0x00ff0000;
+ bmask = 0x0000ff00;
+ amask = 0x000000ff;
+#else
+ rmask = 0x000000ff;
+ gmask = 0x0000ff00;
+ bmask = 0x00ff0000;
+ amask = 0xff000000;
+#endif
+
+ surface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32,
+ rmask, gmask, bmask, amask);
+ if(surface == NULL) {
+ fprintf(stderr, "CreateRGBSurface failed: %s\n", SDL_GetError());
+ exit(1);
+ }</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1833"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcreatergbsurfacefrom.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateRGBSurfaceFrom</TT
+></A
+>,
+<A
+HREF="sdlfreesurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_FreeSurface</TT
+></A
+>,
+<A
+HREF="sdlsetvideomode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+></A
+>,
+<A
+HREF="sdllocksurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_LockSurface</TT
+></A
+>,
+<A
+HREF="sdlpixelformat.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_PixelFormat</SPAN
+></A
+>,
+<A
+HREF="sdlsurface.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+></A
+>
+<A
+HREF="sdlsetalpha.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetAlpha</TT
+></A
+>
+<A
+HREF="sdlsetcolorkey.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetColorKey</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlgetrgba.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcreatergbsurfacefrom.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GetRGBA</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CreateRGBSurfaceFrom</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcreatergbsurfacefrom.html b/distrib/sdl-1.2.15/docs/html/sdlcreatergbsurfacefrom.html
new file mode 100644
index 0000000..6acfdcc
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcreatergbsurfacefrom.html
@@ -0,0 +1,256 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CreateRGBSurfaceFrom</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CreateRGBSurface"
+HREF="sdlcreatergbsurface.html"><LINK
+REL="NEXT"
+TITLE="SDL_FreeSurface"
+HREF="sdlfreesurface.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcreatergbsurface.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlfreesurface.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCREATERGBSURFACEFROM"
+></A
+>SDL_CreateRGBSurfaceFrom</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1856"
+></A
+><H2
+>Name</H2
+>SDL_CreateRGBSurfaceFrom&nbsp;--&nbsp;Create an SDL_Surface from pixel data</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1859"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1860"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_Surface *<B
+CLASS="FSFUNC"
+>SDL_CreateRGBSurfaceFrom</B
+></CODE
+>(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1866"
+></A
+><H2
+>Description</H2
+><P
+>Creates an SDL_Surface from the provided pixel data.</P
+><P
+>The data stored in <TT
+CLASS="PARAMETER"
+><I
+>pixels</I
+></TT
+> is assumed to be of the <TT
+CLASS="PARAMETER"
+><I
+>depth</I
+></TT
+> specified in the parameter list. The pixel data is not copied into the <SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+> structure so it should not be freed until the surface has been freed with a called to <A
+HREF="sdlfreesurface.html"
+>SDL_FreeSurface</A
+>. <TT
+CLASS="PARAMETER"
+><I
+>pitch</I
+></TT
+> is the length of each scanline in bytes. </P
+><P
+>See <A
+HREF="sdlcreatergbsurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateRGBSurface</TT
+></A
+> for a more detailed description of the other parameters.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1878"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns the created surface, or <SPAN
+CLASS="RETURNVALUE"
+>NULL</SPAN
+> upon error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1882"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcreatergbsurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateRGBSurface</TT
+></A
+>,
+<A
+HREF="sdlfreesurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_FreeSurface</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcreatergbsurface.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlfreesurface.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CreateRGBSurface</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_FreeSurface</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcreatesemaphore.html b/distrib/sdl-1.2.15/docs/html/sdlcreatesemaphore.html
new file mode 100644
index 0000000..43dcbf5
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcreatesemaphore.html
@@ -0,0 +1,303 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CreateSemaphore</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_mutexV"
+HREF="sdlmutexv.html"><LINK
+REL="NEXT"
+TITLE="SDL_DestroySemaphore"
+HREF="sdldestroysemaphore.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlmutexv.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdldestroysemaphore.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCREATESEMAPHORE"
+></A
+>SDL_CreateSemaphore</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7936"
+></A
+><H2
+>Name</H2
+>SDL_CreateSemaphore&nbsp;--&nbsp;Creates a new semaphore and assigns an initial value to it.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7939"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7940"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_sem *<B
+CLASS="FSFUNC"
+>SDL_CreateSemaphore</B
+></CODE
+>(Uint32 initial_value);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7946"
+></A
+><H2
+>Description</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_CreateSemaphore()</TT
+> creates a new semaphore and
+initializes it with the value <TT
+CLASS="PARAMETER"
+><I
+>initial_value</I
+></TT
+>.
+Each locking operation on the semaphore by
+<A
+HREF="sdlsemwait.html"
+>SDL_SemWait</A
+>,
+<A
+HREF="sdlsemtrywait.html"
+>SDL_SemTryWait</A
+> or
+<A
+HREF="sdlsemwaittimeout.html"
+>SDL_SemWaitTimeout</A
+>
+will atomically decrement the semaphore value. The locking operation will be blocked
+if the semaphore value is not positive (greater than zero). Each unlock operation by
+<A
+HREF="sdlsempost.html"
+>SDL_SemPost</A
+>
+will atomically increment the semaphore value.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7955"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns a pointer to an initialized semaphore or
+<SPAN
+CLASS="RETURNVALUE"
+>NULL</SPAN
+> if there was an error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7959"
+></A
+><H2
+>Examples</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>SDL_sem *my_sem;
+
+my_sem = SDL_CreateSemaphore(INITIAL_SEM_VALUE);
+
+if (my_sem == NULL) {
+ return CREATE_SEM_FAILED;
+}</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7963"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdldestroysemaphore.html"
+><TT
+CLASS="FUNCTION"
+>SDL_DestroySemaphore</TT
+></A
+>,
+<A
+HREF="sdlsemwait.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemWait</TT
+></A
+>,
+<A
+HREF="sdlsemtrywait.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemTryWait</TT
+></A
+>,
+<A
+HREF="sdlsemwaittimeout.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemWaitTimeout</TT
+></A
+>,
+<A
+HREF="sdlsempost.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemPost</TT
+></A
+>,
+<A
+HREF="sdlsemvalue.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemValue</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlmutexv.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdldestroysemaphore.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_mutexV</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_DestroySemaphore</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcreatethread.html b/distrib/sdl-1.2.15/docs/html/sdlcreatethread.html
new file mode 100644
index 0000000..ca3c2d9
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcreatethread.html
@@ -0,0 +1,223 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CreateThread</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="NEXT"
+TITLE="SDL_ThreadID"
+HREF="sdlthreadid.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="thread.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlthreadid.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCREATETHREAD"
+></A
+>SDL_CreateThread</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7701"
+></A
+><H2
+>Name</H2
+>SDL_CreateThread&nbsp;--&nbsp;Creates a new thread of execution that shares its parent's properties.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7704"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7705"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_Thread *<B
+CLASS="FSFUNC"
+>SDL_CreateThread</B
+></CODE
+>(int (*fn)(void *), void *data);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7711"
+></A
+><H2
+>Description</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_CreateThread</TT
+> creates a new thread of execution
+that shares all of its parent's global memory, signal handlers,
+file descriptors, etc, and runs the function <TT
+CLASS="PARAMETER"
+><I
+>fn</I
+></TT
+>
+passed the void pointer <TT
+CLASS="PARAMETER"
+><I
+>data</I
+></TT
+>
+The thread quits when this function returns.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7717"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlkillthread.html"
+><TT
+CLASS="FUNCTION"
+>SDL_KillThread</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlthreadid.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Multi-threaded Programming</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_ThreadID</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlcreateyuvoverlay.html b/distrib/sdl-1.2.15/docs/html/sdlcreateyuvoverlay.html
new file mode 100644
index 0000000..c24ef6e
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlcreateyuvoverlay.html
@@ -0,0 +1,256 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_CreateYUVOverlay</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GL_SwapBuffers"
+HREF="sdlglswapbuffers.html"><LINK
+REL="NEXT"
+TITLE="SDL_LockYUVOverlay"
+HREF="sdllockyuvoverlay.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlglswapbuffers.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdllockyuvoverlay.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLCREATEYUVOVERLAY"
+></A
+>SDL_CreateYUVOverlay</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2808"
+></A
+><H2
+>Name</H2
+>SDL_CreateYUVOverlay&nbsp;--&nbsp;Create a YUV video overlay</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2811"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2812"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_Overlay *<B
+CLASS="FSFUNC"
+>SDL_CreateYUVOverlay</B
+></CODE
+>(int width, int height, Uint32 format, SDL_Surface *display);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2818"
+></A
+><H2
+>Description</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_CreateYUVOverlay</TT
+> creates a YUV overlay of the specified <TT
+CLASS="PARAMETER"
+><I
+>width</I
+></TT
+>, <TT
+CLASS="PARAMETER"
+><I
+>height</I
+></TT
+> and <TT
+CLASS="PARAMETER"
+><I
+>format</I
+></TT
+> (see <A
+HREF="sdloverlay.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Overlay</SPAN
+></A
+> for a list of available formats), for the provided <TT
+CLASS="PARAMETER"
+><I
+>display</I
+></TT
+>. A <A
+HREF="sdloverlay.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Overlay</SPAN
+></A
+> structure is returned.</P
+><P
+>The term 'overlay' is a misnomer since, unless the overlay is created in hardware, the contents for the display surface underneath the area where the overlay is shown will be overwritten when the overlay is displayed.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2831"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdloverlay.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Overlay</SPAN
+></A
+>,
+<A
+HREF="sdldisplayyuvoverlay.html"
+><TT
+CLASS="FUNCTION"
+>SDL_DisplayYUVOverlay</TT
+></A
+>,
+<A
+HREF="sdlfreeyuvoverlay.html"
+><TT
+CLASS="FUNCTION"
+>SDL_FreeYUVOverlay</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlglswapbuffers.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdllockyuvoverlay.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GL_SwapBuffers</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_LockYUVOverlay</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdldelay.html b/distrib/sdl-1.2.15/docs/html/sdldelay.html
new file mode 100644
index 0000000..a5417fa
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdldelay.html
@@ -0,0 +1,231 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_Delay</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Time"
+HREF="time.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GetTicks"
+HREF="sdlgetticks.html"><LINK
+REL="NEXT"
+TITLE="SDL_AddTimer"
+HREF="sdladdtimer.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlgetticks.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdladdtimer.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLDELAY"
+></A
+>SDL_Delay</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8455"
+></A
+><H2
+>Name</H2
+>SDL_Delay&nbsp;--&nbsp;Wait a specified number of milliseconds before returning.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8458"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN8459"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_Delay</B
+></CODE
+>(Uint32 ms);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8465"
+></A
+><H2
+>Description</H2
+><P
+>Wait a specified number of milliseconds before returning. <TT
+CLASS="FUNCTION"
+>SDL_Delay</TT
+> will wait at <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>least</I
+></SPAN
+> the specified time, but possible longer due to OS scheduling.</P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>Count on a delay granularity of <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>at least</I
+></SPAN
+> 10 ms.
+Some platforms have shorter clock ticks but this is the most common.</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8473"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdladdtimer.html"
+><TT
+CLASS="FUNCTION"
+>SDL_AddTimer</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlgetticks.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdladdtimer.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GetTicks</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="time.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_AddTimer</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdldestroycond.html b/distrib/sdl-1.2.15/docs/html/sdldestroycond.html
new file mode 100644
index 0000000..ac08042
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdldestroycond.html
@@ -0,0 +1,206 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_DestroyCond</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CreateCond"
+HREF="sdlcreatecond.html"><LINK
+REL="NEXT"
+TITLE="SDL_CondSignal"
+HREF="sdlcondsignal.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcreatecond.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcondsignal.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLDESTROYCOND"
+></A
+>SDL_DestroyCond</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8288"
+></A
+><H2
+>Name</H2
+>SDL_DestroyCond&nbsp;--&nbsp;Destroy a condition variable</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8291"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN8292"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_DestroyCond</B
+></CODE
+>(SDL_cond *cond);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8298"
+></A
+><H2
+>Description</H2
+><P
+>Destroys a condition variable.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8301"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcreatecond.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateCond</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcreatecond.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcondsignal.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CreateCond</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CondSignal</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdldestroymutex.html b/distrib/sdl-1.2.15/docs/html/sdldestroymutex.html
new file mode 100644
index 0000000..949bfc5
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdldestroymutex.html
@@ -0,0 +1,209 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_DestroyMutex</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CreateMutex"
+HREF="sdlcreatemutex.html"><LINK
+REL="NEXT"
+TITLE="SDL_mutexP"
+HREF="sdlmutexp.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcreatemutex.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlmutexp.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLDESTROYMUTEX"
+></A
+>SDL_DestroyMutex</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7849"
+></A
+><H2
+>Name</H2
+>SDL_DestroyMutex&nbsp;--&nbsp;Destroy a mutex</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7852"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7853"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_DestroyMutex</B
+></CODE
+>(SDL_mutex *mutex);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7859"
+></A
+><H2
+>Description</H2
+><P
+>Destroy a previously <A
+HREF="sdlcreatemutex.html"
+>created</A
+> mutex.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7863"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcreatemutex.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateMutex</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcreatemutex.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlmutexp.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CreateMutex</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_mutexP</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdldestroysemaphore.html b/distrib/sdl-1.2.15/docs/html/sdldestroysemaphore.html
new file mode 100644
index 0000000..d32bdfa
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdldestroysemaphore.html
@@ -0,0 +1,278 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_DestroySemaphore</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CreateSemaphore"
+HREF="sdlcreatesemaphore.html"><LINK
+REL="NEXT"
+TITLE="SDL_SemWait"
+HREF="sdlsemwait.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcreatesemaphore.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlsemwait.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLDESTROYSEMAPHORE"
+></A
+>SDL_DestroySemaphore</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7982"
+></A
+><H2
+>Name</H2
+>SDL_DestroySemaphore&nbsp;--&nbsp;Destroys a semaphore that was created by <A
+HREF="sdlcreatesemaphore.html"
+>SDL_CreateSemaphore</A
+>.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7986"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7987"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_DestroySemaphore</B
+></CODE
+>(SDL_sem *sem);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7993"
+></A
+><H2
+>Description</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_DestroySemaphore</TT
+> destroys the semaphore pointed to
+by <TT
+CLASS="PARAMETER"
+><I
+>sem</I
+></TT
+> that was created by
+<A
+HREF="sdlcreatesemaphore.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateSemaphore</TT
+></A
+>.
+It is not safe to destroy a semaphore if there are threads currently blocked
+waiting on it.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8000"
+></A
+><H2
+>Examples</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>if (my_sem != NULL) {
+ SDL_DestroySemaphore(my_sem);
+ my_sem = NULL;
+}</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8004"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcreatesemaphore.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateSemaphore</TT
+></A
+>,
+<A
+HREF="sdlsemwait.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemWait</TT
+></A
+>,
+<A
+HREF="sdlsemtrywait.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemTryWait</TT
+></A
+>,
+<A
+HREF="sdlsemwaittimeout.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemWaitTimeout</TT
+></A
+>,
+<A
+HREF="sdlsempost.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemPost</TT
+></A
+>,
+<A
+HREF="sdlsemvalue.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemValue</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcreatesemaphore.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlsemwait.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CreateSemaphore</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_SemWait</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdldisplayformat.html b/distrib/sdl-1.2.15/docs/html/sdldisplayformat.html
new file mode 100644
index 0000000..c91adfe
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdldisplayformat.html
@@ -0,0 +1,262 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_DisplayFormat</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_FillRect"
+HREF="sdlfillrect.html"><LINK
+REL="NEXT"
+TITLE="SDL_DisplayFormatAlpha"
+HREF="sdldisplayformatalpha.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlfillrect.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdldisplayformatalpha.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLDISPLAYFORMAT"
+></A
+>SDL_DisplayFormat</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2394"
+></A
+><H2
+>Name</H2
+>SDL_DisplayFormat&nbsp;--&nbsp;Convert a surface to the display format</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2397"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2398"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_Surface *<B
+CLASS="FSFUNC"
+>SDL_DisplayFormat</B
+></CODE
+>(SDL_Surface *surface);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2404"
+></A
+><H2
+>Description</H2
+><P
+>This function takes a surface and copies it to a new surface of the
+pixel format and colors of the video framebuffer, suitable for fast
+blitting onto the display surface. It calls
+<A
+HREF="sdlconvertsurface.html"
+>SDL_ConvertSurface</A
+></P
+><P
+>If you want to take advantage of hardware colorkey or alpha blit
+acceleration, you should set the colorkey and alpha value before
+calling this function.</P
+><P
+>If you want an alpha channel, see <A
+HREF="sdldisplayformatalpha.html"
+>SDL_DisplayFormatAlpha</A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2411"
+></A
+><H2
+>Return Value</H2
+><P
+>If the conversion fails or runs out of memory, it returns
+<SPAN
+CLASS="RETURNVALUE"
+>NULL</SPAN
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2415"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlconvertsurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_ConvertSurface</TT
+></A
+>,
+<A
+HREF="sdldisplayformatalpha.html"
+><TT
+CLASS="FUNCTION"
+>SDL_DisplayFormatAlpha</TT
+></A
+>
+<A
+HREF="sdlsetalpha.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetAlpha</TT
+></A
+>,
+<A
+HREF="sdlsetcolorkey.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetColorKey</TT
+></A
+>,
+<A
+HREF="sdlsurface.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlfillrect.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdldisplayformatalpha.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_FillRect</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_DisplayFormatAlpha</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdldisplayformatalpha.html b/distrib/sdl-1.2.15/docs/html/sdldisplayformatalpha.html
new file mode 100644
index 0000000..6e88604
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdldisplayformatalpha.html
@@ -0,0 +1,250 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_DisplayFormatAlpha</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_DisplayFormat"
+HREF="sdldisplayformat.html"><LINK
+REL="NEXT"
+TITLE="SDL_WarpMouse"
+HREF="sdlwarpmouse.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdldisplayformat.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlwarpmouse.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLDISPLAYFORMATALPHA"
+></A
+>SDL_DisplayFormatAlpha</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2432"
+></A
+><H2
+>Name</H2
+>SDL_DisplayFormatAlpha&nbsp;--&nbsp;Convert a surface to the display format</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2435"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2436"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_Surface *<B
+CLASS="FSFUNC"
+>SDL_DisplayFormatAlpha</B
+></CODE
+>(SDL_Surface *surface);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2442"
+></A
+><H2
+>Description</H2
+><P
+>This function takes a surface and copies it to a new surface of the
+pixel format and colors of the video framebuffer plus an alpha channel,
+suitable for fast blitting onto the display surface. It calls
+<A
+HREF="sdlconvertsurface.html"
+>SDL_ConvertSurface</A
+></P
+><P
+>If you want to take advantage of hardware colorkey or alpha blit
+acceleration, you should set the colorkey and alpha value before
+calling this function.</P
+><P
+>This function can be used to convert a colourkey to an alpha channel,
+if the <TT
+CLASS="LITERAL"
+>SDL_SRCCOLORKEY</TT
+> flag is set on the surface.
+The generated surface will then be transparent (alpha=0) where the
+pixels match the colourkey, and opaque (alpha=255) elsewhere.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2449"
+></A
+><H2
+>Return Value</H2
+><P
+>If the conversion fails or runs out of memory, it returns
+<SPAN
+CLASS="RETURNVALUE"
+>NULL</SPAN
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2453"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlconvertsurface.html"
+>SDL_ConvertSurface</A
+>,
+<A
+HREF="sdlsetalpha.html"
+>SDL_SetAlpha</A
+>,
+<A
+HREF="sdlsetcolorkey.html"
+>SDL_SetColorKey</A
+>,
+<A
+HREF="sdldisplayformat.html"
+>SDL_DisplayFormat</A
+>,
+<A
+HREF="sdlsurface.html"
+>SDL_Surface</A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdldisplayformat.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlwarpmouse.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_DisplayFormat</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_WarpMouse</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdldisplayyuvoverlay.html b/distrib/sdl-1.2.15/docs/html/sdldisplayyuvoverlay.html
new file mode 100644
index 0000000..456c998
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdldisplayyuvoverlay.html
@@ -0,0 +1,246 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_DisplayYUVOverlay</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_UnlockYUVOverlay"
+HREF="sdlunlockyuvoverlay.html"><LINK
+REL="NEXT"
+TITLE="SDL_FreeYUVOverlay"
+HREF="sdlfreeyuvoverlay.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlunlockyuvoverlay.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlfreeyuvoverlay.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLDISPLAYYUVOVERLAY"
+></A
+>SDL_DisplayYUVOverlay</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2908"
+></A
+><H2
+>Name</H2
+>SDL_DisplayYUVOverlay&nbsp;--&nbsp;Blit the overlay to the display</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2911"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2912"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_DisplayYUVOverlay</B
+></CODE
+>(SDL_Overlay *overlay, SDL_Rect *dstrect);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2918"
+></A
+><H2
+>Description</H2
+><P
+>Blit the <TT
+CLASS="PARAMETER"
+><I
+>overlay</I
+></TT
+> to the surface specified when it was <A
+HREF="sdlcreateyuvoverlay.html"
+>created</A
+>. The <A
+HREF="sdlrect.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Rect</SPAN
+></A
+> structure, <TT
+CLASS="PARAMETER"
+><I
+>dstrect</I
+></TT
+>, specifies the position and size of the destination. If the <TT
+CLASS="PARAMETER"
+><I
+>dstrect</I
+></TT
+> is a larger or smaller than the overlay then the overlay will be scaled, this is optimized for 2x scaling.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2927"
+></A
+><H2
+>Return Values</H2
+><P
+>Returns 0 on success</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2930"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdloverlay.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Overlay</SPAN
+></A
+>,
+<A
+HREF="sdlcreateyuvoverlay.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateYUVOverlay</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlunlockyuvoverlay.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlfreeyuvoverlay.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_UnlockYUVOverlay</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_FreeYUVOverlay</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlenablekeyrepeat.html b/distrib/sdl-1.2.15/docs/html/sdlenablekeyrepeat.html
new file mode 100644
index 0000000..878feb1
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlenablekeyrepeat.html
@@ -0,0 +1,238 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_EnableKeyRepeat</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Event Functions."
+HREF="eventfunctions.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_EnableUNICODE"
+HREF="sdlenableunicode.html"><LINK
+REL="NEXT"
+TITLE="SDL_GetMouseState"
+HREF="sdlgetmousestate.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlenableunicode.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlgetmousestate.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLENABLEKEYREPEAT"
+></A
+>SDL_EnableKeyRepeat</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5839"
+></A
+><H2
+>Name</H2
+>SDL_EnableKeyRepeat&nbsp;--&nbsp;Set keyboard repeat rate.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN5842"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN5843"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_EnableKeyRepeat</B
+></CODE
+>(int delay, int interval);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5849"
+></A
+><H2
+>Description</H2
+><P
+>Enables or disables the keyboard repeat rate. <TT
+CLASS="PARAMETER"
+><I
+>delay</I
+></TT
+> specifies how long the key must be pressed before it begins repeating, it then repeats at the speed specified by <TT
+CLASS="PARAMETER"
+><I
+>interval</I
+></TT
+>. Both <TT
+CLASS="PARAMETER"
+><I
+>delay</I
+></TT
+> and <TT
+CLASS="PARAMETER"
+><I
+>interval</I
+></TT
+> are expressed in milliseconds.</P
+><P
+>Setting <TT
+CLASS="PARAMETER"
+><I
+>delay</I
+></TT
+> to 0 disables key repeating completely. Good default values are <TT
+CLASS="LITERAL"
+>SDL_DEFAULT_REPEAT_DELAY</TT
+> and <SPAN
+CLASS="SYMBOL"
+>SDL_DEFAULT_REPEAT_INTERVAL</SPAN
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5860"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> on success and <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> on failure.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlenableunicode.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlgetmousestate.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_EnableUNICODE</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GetMouseState</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlenableunicode.html b/distrib/sdl-1.2.15/docs/html/sdlenableunicode.html
new file mode 100644
index 0000000..855debb
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlenableunicode.html
@@ -0,0 +1,252 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_EnableUNICODE</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Event Functions."
+HREF="eventfunctions.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GetKeyName"
+HREF="sdlgetkeyname.html"><LINK
+REL="NEXT"
+TITLE="SDL_EnableKeyRepeat"
+HREF="sdlenablekeyrepeat.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlgetkeyname.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlenablekeyrepeat.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLENABLEUNICODE"
+></A
+>SDL_EnableUNICODE</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5805"
+></A
+><H2
+>Name</H2
+>SDL_EnableUNICODE&nbsp;--&nbsp;Enable UNICODE translation</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN5808"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN5809"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_EnableUNICODE</B
+></CODE
+>(int enable);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5815"
+></A
+><H2
+>Description</H2
+><P
+>Enables/Disables Unicode keyboard translation.</P
+><P
+>To obtain the character codes corresponding to received keyboard events,
+Unicode translation must first be turned on using this function. The
+translation incurs a slight overhead for each keyboard event and is therefore
+disabled by default. For each subsequently received key down event, the
+<TT
+CLASS="STRUCTFIELD"
+><I
+>unicode</I
+></TT
+> member of the
+<A
+HREF="sdlkeysym.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_keysym</SPAN
+></A
+> structure
+will then contain the corresponding character code, or zero for keysyms that do
+not correspond to any character code.</P
+><P
+>A value of 1 for <TT
+CLASS="PARAMETER"
+><I
+>enable</I
+></TT
+> enables Unicode translation;
+0 disables it, and -1 leaves it unchanged (useful for querying the current
+translation mode).</P
+><P
+>Note that only key press events will be translated, not release events.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5825"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns the previous translation mode (<SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> or <SPAN
+CLASS="RETURNVALUE"
+>1</SPAN
+>).</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5830"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlkeysym.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_keysym</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlgetkeyname.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlenablekeyrepeat.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GetKeyName</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_EnableKeyRepeat</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlenvvars.html b/distrib/sdl-1.2.15/docs/html/sdlenvvars.html
new file mode 100644
index 0000000..8999ed1
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlenvvars.html
@@ -0,0 +1,1227 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_envvars</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="General"
+HREF="general.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GetError"
+HREF="sdlgeterror.html"><LINK
+REL="NEXT"
+TITLE="Video"
+HREF="video.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlgeterror.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="video.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLENVVARS"
+></A
+>SDL_envvars</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN675"
+></A
+><H2
+>Name</H2
+>SDL_envvars&nbsp;--&nbsp;SDL environment variables</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN678"
+></A
+><H2
+>Description</H2
+><P
+>Not a function, set using setenv()</P
+><P
+>Several environment variables are available to modify the
+behaviour of SDL. Using these variables isn't recommened and the names
+and presence of these variables aren't guaranteed from one release to
+the next. However, they can be very useful for debugging
+purposes.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN682"
+></A
+><H2
+>Video</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_FBACCEL</TT
+></DT
+><DD
+><P
+>If set to 0, disable hardware acceleration in the linux fbcon driver.</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_FBDEV</TT
+></DT
+><DD
+><P
+>Frame buffer device to use in the linux fbcon driver, instead of /dev/fb0</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_FULLSCREEN_UPDATE</TT
+></DT
+><DD
+><P
+>In the ps2gs driver, sets the <TT
+CLASS="LITERAL"
+>SDL_ASYNCBLIT</TT
+> flag on the
+display surface.</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_VIDEODRIVER</TT
+></DT
+><DD
+><P
+>Selectes the video driver for SDL to use. Possible values, in the
+order they are tried if this variable is not set:</P
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN706"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>x11</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+></P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>dga</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(the XFree86 DGA2)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>nanox</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(Linux)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>fbcon</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(Linux)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>directfb</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(Linux)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>ps2gs</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(Playstation 2)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>ggi</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+></P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>vgl</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(BSD)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>svgalib</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(Linux)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>aalib</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+></P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>directx</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(Win32)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>windib</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(Win32)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>bwindow</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(BeOS)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>toolbox</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(MacOS Classic)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>DSp</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(MacOS Classic)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>Quartz</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(Mac OS X)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>CGX</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(Amiga)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>photon</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(QNX)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>dummy</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+></P
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_VIDEO_CENTERED</TT
+></DT
+><DD
+><P
+>If set, tries to center the SDL window when running in X11 windowed
+mode, or using the CyberGrafix driver.</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_VIDEO_GL_DRIVER</TT
+></DT
+><DD
+><P
+>The openGL driver (shared library) to use for X11. Default is libGL.so.1</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_VIDEO_X11_DGAMOUSE</TT
+></DT
+><DD
+><P
+>With XFree86, enables use of DGA mouse if set.</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_VIDEO_X11_MOUSEACCEL</TT
+></DT
+><DD
+><P
+>For X11, sets the mouse acceleration. The value should be a string
+on the form:</P
+><P
+>"<TT
+CLASS="PARAMETER"
+><I
+>n</I
+></TT
+>/<TT
+CLASS="PARAMETER"
+><I
+>d</I
+></TT
+>/<TT
+CLASS="PARAMETER"
+><I
+>t</I
+></TT
+>"</P
+><P
+>where <TT
+CLASS="PARAMETER"
+><I
+>n</I
+></TT
+> and <TT
+CLASS="PARAMETER"
+><I
+>d</I
+></TT
+> are the
+acceleration numerator/denumerators (so mouse movement is accelerated by
+<TT
+CLASS="PARAMETER"
+><I
+>n</I
+></TT
+>/<TT
+CLASS="PARAMETER"
+><I
+>d</I
+></TT
+>), and
+<TT
+CLASS="PARAMETER"
+><I
+>t</I
+></TT
+> is the threshold above which acceleration applies
+(counted as number of pixels the mouse moves at once).</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_VIDEO_X11_NODIRECTCOLOR</TT
+></DT
+><DD
+><P
+>If set, don't attempt to use DirectColor visuals even if they are
+present. (SDL will use them otherwise for gamma correction).
+This is needed with older X servers when using the XVideo extension.</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_VIDEO_X11_VISUALID</TT
+></DT
+><DD
+><P
+>ID of an X11 visual to use, overriding SDL's default visual selection
+algorithm. It can be in decimal or in hex (prefixed by 0x).</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_VIDEO_YUV_DIRECT</TT
+></DT
+><DD
+><P
+>If set, display YUV overlay directly on the video surface if possible,
+instead of on the surface passed to
+<A
+HREF="sdlcreateyuvoverlay.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateYUVOverlay</TT
+></A
+>.</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_VIDEO_YUV_HWACCEL</TT
+></DT
+><DD
+><P
+>If not set or set to a nonzero value, SDL will attempt to use
+hardware YUV acceleration for video playback.</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_WINDOWID</TT
+></DT
+><DD
+><P
+>For X11 or Win32, contains the ID number of the window to be used by
+SDL instead of creating its own window. Either in decimal or
+in hex (prefixed by 0x).</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN866"
+></A
+><H2
+>Events/Input</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_MOUSE_RELATIVE</TT
+></DT
+><DD
+><P
+>If set to 0, do not use mouse relative mode in X11. The default is
+to use it if the mouse is hidden and input is grabbed.</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_MOUSEDEV</TT
+></DT
+><DD
+><P
+>The mouse device to use for the linux fbcon driver. If not set,
+SDL first tries to use GPM in repeater mode, then various other
+devices (/dev/pcaux, /dev/adbmouse, /dev/mouse etc).</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_MOUSEDEV_IMPS2</TT
+></DT
+><DD
+><P
+>If set, SDL will not try to auto-detect the IMPS/2 protocol of
+a PS/2 mouse but use it right away. For the fbcon and ps2gs drivers.</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_MOUSEDRV</TT
+></DT
+><DD
+><P
+>For the linux fbcon driver: if set to ELO, use the ELO touchscreen
+controller as a pointer device</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_NO_RAWKBD</TT
+></DT
+><DD
+><P
+>For the libvga driver: If set, do not attempt to put the keyboard in raw mode.</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_NOMOUSE</TT
+></DT
+><DD
+><P
+>If set, the linux fbcon driver will not use a mouse at all.</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_NO_LOCK_KEYS</TT
+></DT
+><DD
+><P
+>Disable CAPS-LOCK and NUM-LOCK suppression of down+up key events,
+suitable for games where the player needs these keys to do more than just toggle.
+A value of 1 will effect both CAPS-LOCK and NUM-LOCK.
+A value of 2 will effect only CAPS-LOCK.
+A value of 3 will effect only NUM-LOCK.
+All other values have no effect.
+</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN899"
+></A
+><H2
+>Audio</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><TT
+CLASS="LITERAL"
+>AUDIODEV</TT
+></DT
+><DD
+><P
+>The audio device to use, if <TT
+CLASS="LITERAL"
+>SDL_PATH_DSP</TT
+> isn't set.</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_AUDIODRIVER</TT
+></DT
+><DD
+><P
+>Selects the audio driver for SDL to use. Possible values, in the
+order they are tried if this variable is not set:</P
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN913"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>openbsd</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(OpenBSD)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>dsp</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(OSS /dev/dsp: Linux, Solaris, BSD etc)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>alsa</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(Linux)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>pulse</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(PulseAudio daemon)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>audio</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(Unix style /dev/audio: SunOS, Solaris etc)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>AL</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(Irix)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>artsc</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(ARTS audio daemon)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>esd</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(esound audio daemon)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>nas</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(NAS audio daemon)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>dma</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(OSS /dev/dsp, using DMA)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>dsound</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(Win32 DirectX)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>waveout</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(Win32 WaveOut)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>baudio</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(BeOS)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>sndmgr</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(MacOS SoundManager)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>paud</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(AIX)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>AHI</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(Amiga)</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>disk</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>(all; output to file)</P
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_DISKAUDIOFILE</TT
+></DT
+><DD
+><P
+>The name of the output file for the "disk" audio driver. If not
+set, the name <TT
+CLASS="LITERAL"
+>sdlaudio.raw</TT
+> is used.</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_DISKAUDIODELAY</TT
+></DT
+><DD
+><P
+>For the "disk" audio driver, how long to wait (in ms) before writing
+a full sound buffer. The default is 150 ms.</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_DSP_NOSELECT</TT
+></DT
+><DD
+><P
+>For some audio drivers (alsa, paud, dma and dsp), don't use select()
+but a timed method instead. May cure some audio problems, or cause
+others.</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_PATH_DSP</TT
+></DT
+><DD
+><P
+>The audio device to use. If not set, SDL tries AUDIODEV and then
+a platform-dependent default value (/dev/audio on Solaris,
+/dev/dsp on Linux etc).</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1017"
+></A
+><H2
+>CD-ROM</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_CDROM</TT
+></DT
+><DD
+><P
+>A colon-separated list of CD-ROM devices to use, in addition to
+the standard devices (typically /dev/cdrom, platform-dependent).</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1025"
+></A
+><H2
+>Debugging</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_DEBUG</TT
+></DT
+><DD
+><P
+>If set, causes every call to <TT
+CLASS="FUNCTION"
+>SDL_SetError</TT
+> (that
+is, every time SDL signals an error) to also print an error message on
+stderr.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1034"
+></A
+><H2
+>Joystick</H2
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_JOYSTICK_DEVICE</TT
+></DT
+><DD
+><P
+>Joystick device to use in the linux joystick driver, in addition
+to the usual: /dev/js*, /dev/input/event*, /dev/input/js*</P
+></DD
+><DT
+><TT
+CLASS="LITERAL"
+>SDL_LINUX_JOYSTICK</TT
+></DT
+><DD
+><P
+>Special joystick configuration string for linux. The format is</P
+><P
+>"<TT
+CLASS="PARAMETER"
+><I
+>name</I
+></TT
+> <TT
+CLASS="PARAMETER"
+><I
+>numaxes</I
+></TT
+> <TT
+CLASS="PARAMETER"
+><I
+>numhats</I
+></TT
+> <TT
+CLASS="PARAMETER"
+><I
+>numballs</I
+></TT
+>"</P
+><P
+>where <TT
+CLASS="PARAMETER"
+><I
+>name</I
+></TT
+> is the name string of the joystick
+(possibly in single quotes), and the rest are the number of axes, hats
+and balls respectively.</P
+></DD
+></DL
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlgeterror.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GetError</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="general.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Video</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
diff --git a/distrib/sdl-1.2.15/docs/html/sdlevent.html b/distrib/sdl-1.2.15/docs/html/sdlevent.html
new file mode 100644
index 0000000..dfd21b7
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlevent.html
@@ -0,0 +1,994 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_Event</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Event Structures."
+HREF="eventstructures.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL Event Structures."
+HREF="eventstructures.html"><LINK
+REL="NEXT"
+TITLE="SDL_ActiveEvent"
+HREF="sdlactiveevent.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="eventstructures.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlactiveevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLEVENT"
+></A
+>SDL_Event</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN3711"
+></A
+><H2
+>Name</H2
+>SDL_Event&nbsp;--&nbsp;General event structure</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3714"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef union{
+ Uint8 type;
+ SDL_ActiveEvent active;
+ SDL_KeyboardEvent key;
+ SDL_MouseMotionEvent motion;
+ SDL_MouseButtonEvent button;
+ SDL_JoyAxisEvent jaxis;
+ SDL_JoyBallEvent jball;
+ SDL_JoyHatEvent jhat;
+ SDL_JoyButtonEvent jbutton;
+ SDL_ResizeEvent resize;
+ SDL_ExposeEvent expose;
+ SDL_QuitEvent quit;
+ SDL_UserEvent user;
+ SDL_SysWMEvent syswm;
+} SDL_Event;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3717"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN3719"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>The type of event</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>active</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlactiveevent.html"
+>Activation event</A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>key</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlkeyboardevent.html"
+>Keyboard event</A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>motion</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlmousemotionevent.html"
+>Mouse motion event</A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>button</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlmousebuttonevent.html"
+>Mouse button event</A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>jaxis</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdljoyaxisevent.html"
+>Joystick axis motion event</A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>jball</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdljoyballevent.html"
+>Joystick trackball motion event</A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>jhat</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdljoyhatevent.html"
+>Joystick hat motion event</A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>jbutton</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdljoybuttonevent.html"
+>Joystick button event</A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>resize</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlresizeevent.html"
+>Application window resize event</A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>expose</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlexposeevent.html"
+>Application window expose event</A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>quit</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlquitevent.html"
+>Application quit request event</A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>user</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdluserevent.html"
+>User defined event</A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>syswm</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlsyswmevent.html"
+>Undefined window manager event</A
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3791"
+></A
+><H2
+>Description</H2
+><P
+>The <SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+> union is the core to all event handling is SDL, its probably the most important structure after <SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+>. <SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+> is a union of all event structures used in SDL, using it is a simple matter of knowing which union member relates to which event <TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+>.</P
+><P
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN3799"
+></A
+><P
+></P
+><TABLE
+BORDER="1"
+CLASS="CALSTABLE"
+><THEAD
+><TR
+><TH
+ALIGN="LEFT"
+VALIGN="TOP"
+>Event <TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+></TH
+><TH
+ALIGN="LEFT"
+VALIGN="TOP"
+>Event Structure</TH
+></TR
+></THEAD
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="MIDDLE"
+><TT
+CLASS="LITERAL"
+>SDL_ACTIVEEVENT</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="MIDDLE"
+><A
+HREF="sdlactiveevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_ActiveEvent</SPAN
+></A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_KEYDOWN/UP</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlkeyboardevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_KeyboardEvent</SPAN
+></A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_MOUSEMOTION</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlmousemotionevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_MouseMotionEvent</SPAN
+></A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_MOUSEBUTTONDOWN/UP</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlmousebuttonevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_MouseButtonEvent</SPAN
+></A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_JOYAXISMOTION</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdljoyaxisevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_JoyAxisEvent</SPAN
+></A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_JOYBALLMOTION</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdljoyballevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_JoyBallEvent</SPAN
+></A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_JOYHATMOTION</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdljoyhatevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_JoyHatEvent</SPAN
+></A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_JOYBUTTONDOWN/UP</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdljoybuttonevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_JoyButtonEvent</SPAN
+></A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_QUIT</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlquitevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_QuitEvent</SPAN
+></A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_SYSWMEVENT</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlsyswmevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_SysWMEvent</SPAN
+></A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_VIDEORESIZE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlresizeevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_ResizeEvent</SPAN
+></A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_VIDEOEXPOSE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlexposeevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_ExposeEvent</SPAN
+></A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_USEREVENT</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdluserevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_UserEvent</SPAN
+></A
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3885"
+></A
+><H2
+>Use</H2
+><P
+>The <SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+> structure has two uses</P
+><P
+></P
+><UL
+COMPACT="COMPACT"
+><LI
+><P
+>Reading events on the event queue</P
+></LI
+><LI
+><P
+>Placing events on the event queue</P
+></LI
+></UL
+><P
+>Reading events from the event queue is done with either <A
+HREF="sdlpollevent.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PollEvent</TT
+></A
+> or <A
+HREF="sdlpeepevents.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PeepEvents</TT
+></A
+>. We'll use <TT
+CLASS="FUNCTION"
+>SDL_PollEvent</TT
+> and step through an example.</P
+><P
+>First off, we create an empty <SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+> structure.
+<PRE
+CLASS="PROGRAMLISTING"
+>SDL_Event test_event;</PRE
+>
+<TT
+CLASS="FUNCTION"
+>SDL_PollEvent</TT
+> removes the next event from the event queue, if there are no events on the queue it returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> otherwise it returns <SPAN
+CLASS="RETURNVALUE"
+>1</SPAN
+>. We use a <TT
+CLASS="FUNCTION"
+>while</TT
+> loop to process each event in turn.
+<PRE
+CLASS="PROGRAMLISTING"
+>while(SDL_PollEvent(&#38;test_event)) {</PRE
+>
+The <TT
+CLASS="FUNCTION"
+>SDL_PollEvent</TT
+> function take a pointer to an <SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+> structure that is to be filled with event information. We know that if <TT
+CLASS="FUNCTION"
+>SDL_PollEvent</TT
+> removes an event from the queue then the event information will be placed in our <SPAN
+CLASS="STRUCTNAME"
+>test_event</SPAN
+> structure, but we also know that the <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>type</I
+></SPAN
+> of event will be placed in the <TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+> member of <SPAN
+CLASS="STRUCTNAME"
+>test_event</SPAN
+>. So to handle each event <TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+> seperately we use a <TT
+CLASS="FUNCTION"
+>switch</TT
+> statement.
+<PRE
+CLASS="PROGRAMLISTING"
+> switch(test_event.type) {</PRE
+>
+We need to know what kind of events we're looking for <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>and</I
+></SPAN
+> the event <TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+>'s of those events. So lets assume we want to detect where the user is moving the mouse pointer within our application. We look through our event types and notice that <TT
+CLASS="LITERAL"
+>SDL_MOUSEMOTION</TT
+> is, more than likely, the event we're looking for. A little <A
+HREF="sdlmousemotionevent.html"
+>more</A
+> research tells use that <TT
+CLASS="LITERAL"
+>SDL_MOUSEMOTION</TT
+> events are handled within the <A
+HREF="sdlmousemotionevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_MouseMotionEvent</SPAN
+></A
+> structure which is the <TT
+CLASS="STRUCTFIELD"
+><I
+>motion</I
+></TT
+> member of <SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+>. We can check for the <TT
+CLASS="LITERAL"
+>SDL_MOUSEMOTION</TT
+> event <TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+> within our <TT
+CLASS="FUNCTION"
+>switch</TT
+> statement like so:
+<PRE
+CLASS="PROGRAMLISTING"
+> case SDL_MOUSEMOTION:</PRE
+>
+All we need do now is read the information out of the <TT
+CLASS="STRUCTFIELD"
+><I
+>motion</I
+></TT
+> member of <SPAN
+CLASS="STRUCTNAME"
+>test_event</SPAN
+>.
+<PRE
+CLASS="PROGRAMLISTING"
+> printf("We got a motion event.\n");
+ printf("Current mouse position is: (%d, %d)\n", test_event.motion.x, test_event.motion.y);
+ break;
+ default:
+ printf("Unhandled Event!\n");
+ break;
+ }
+}
+printf("Event queue empty.\n");</PRE
+></P
+><P
+>It is also possible to push events onto the event queue and so use it as a two-way communication path. Both <A
+HREF="sdlpushevent.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PushEvent</TT
+></A
+> and <A
+HREF="sdlpeepevents.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PeepEvents</TT
+></A
+> allow you to place events onto the event queue. This is usually used to place a <TT
+CLASS="LITERAL"
+>SDL_USEREVENT</TT
+> on the event queue, however you could use it to post fake input events if you wished. Creating your own events is a simple matter of choosing the event type you want, setting the <TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+> member and filling the appropriate member structure with information.
+<PRE
+CLASS="PROGRAMLISTING"
+>SDL_Event user_event;
+
+user_event.type=SDL_USEREVENT;
+user_event.user.code=2;
+user_event.user.data1=NULL;
+user_event.user.data2=NULL;
+SDL_PushEvent(&#38;user_event);</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3942"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlpollevent.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PollEvent</TT
+></A
+>,
+<A
+HREF="sdlpushevent.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PushEvent</TT
+></A
+>,
+<A
+HREF="sdlpeepevents.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PeepEvents</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="eventstructures.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlactiveevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL Event Structures.</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventstructures.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_ActiveEvent</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
diff --git a/distrib/sdl-1.2.15/docs/html/sdleventstate.html b/distrib/sdl-1.2.15/docs/html/sdleventstate.html
new file mode 100644
index 0000000..b9a2448
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdleventstate.html
@@ -0,0 +1,276 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_EventState</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Event Functions."
+HREF="eventfunctions.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GetEventFilter"
+HREF="sdlgeteventfilter.html"><LINK
+REL="NEXT"
+TITLE="SDL_GetKeyState"
+HREF="sdlgetkeystate.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlgeteventfilter.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlgetkeystate.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLEVENTSTATE"
+></A
+>SDL_EventState</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5646"
+></A
+><H2
+>Name</H2
+>SDL_EventState&nbsp;--&nbsp;This function allows you to set the state of processing certain events.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN5649"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN5650"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>Uint8 <B
+CLASS="FSFUNC"
+>SDL_EventState</B
+></CODE
+>(Uint8 type, int state);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5656"
+></A
+><H2
+>Description</H2
+><P
+>This function allows you to set the state of processing certain event <TT
+CLASS="PARAMETER"
+><I
+>type</I
+></TT
+>'s.</P
+><P
+>If <TT
+CLASS="PARAMETER"
+><I
+>state</I
+></TT
+> is set to <TT
+CLASS="LITERAL"
+>SDL_IGNORE</TT
+>,
+that event <TT
+CLASS="PARAMETER"
+><I
+>type</I
+></TT
+> will be automatically dropped from the event queue and will
+not be filtered.</P
+><P
+>If <TT
+CLASS="PARAMETER"
+><I
+>state</I
+></TT
+> is set to <TT
+CLASS="LITERAL"
+>SDL_ENABLE</TT
+>,
+that event <TT
+CLASS="PARAMETER"
+><I
+>type</I
+></TT
+> will be processed normally.</P
+><P
+>If <TT
+CLASS="PARAMETER"
+><I
+>state</I
+></TT
+> is set to <TT
+CLASS="LITERAL"
+>SDL_QUERY</TT
+>,
+<TT
+CLASS="FUNCTION"
+>SDL_EventState</TT
+> will return the current processing
+state of the specified event <TT
+CLASS="PARAMETER"
+><I
+>type</I
+></TT
+>.</P
+><P
+>A list of event <TT
+CLASS="PARAMETER"
+><I
+>type</I
+></TT
+>'s can be found in the <A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+> section.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5677"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlgeteventfilter.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlgetkeystate.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GetEventFilter</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GetKeyState</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlexposeevent.html b/distrib/sdl-1.2.15/docs/html/sdlexposeevent.html
new file mode 100644
index 0000000..82c2a3e
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlexposeevent.html
@@ -0,0 +1,252 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_ExposeEvent</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Event Structures."
+HREF="eventstructures.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_ResizeEvent"
+HREF="sdlresizeevent.html"><LINK
+REL="NEXT"
+TITLE="SDL_SysWMEvent"
+HREF="sdlsyswmevent.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlresizeevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlsyswmevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLEXPOSEEVENT"
+></A
+>SDL_ExposeEvent</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4503"
+></A
+><H2
+>Name</H2
+>SDL_ExposeEvent&nbsp;--&nbsp;Quit requested event</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4506"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ Uint8 type
+} SDL_ExposeEvent;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4509"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN4511"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_VIDEOEXPOSE</TT
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4519"
+></A
+><H2
+>Description</H2
+><P
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_ExposeEvent</SPAN
+> is a member of the <A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+> union and is used whan an event of type <TT
+CLASS="LITERAL"
+>SDL_VIDEOEXPOSE</TT
+> is reported.</P
+><P
+>A VIDEOEXPOSE event is triggered when the screen has been modified
+outside of the application, usually by the window manager and needs to
+be redrawn.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4527"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+>,
+<A
+HREF="sdlseteventfilter.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetEventFilter</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlresizeevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlsyswmevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_ResizeEvent</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventstructures.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_SysWMEvent</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
diff --git a/distrib/sdl-1.2.15/docs/html/sdlfillrect.html b/distrib/sdl-1.2.15/docs/html/sdlfillrect.html
new file mode 100644
index 0000000..4ace062
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlfillrect.html
@@ -0,0 +1,291 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_FillRect</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_BlitSurface"
+HREF="sdlblitsurface.html"><LINK
+REL="NEXT"
+TITLE="SDL_DisplayFormat"
+HREF="sdldisplayformat.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlblitsurface.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdldisplayformat.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLFILLRECT"
+></A
+>SDL_FillRect</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2351"
+></A
+><H2
+>Name</H2
+>SDL_FillRect&nbsp;--&nbsp;This function performs a fast fill of the given rectangle with some color</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2354"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2355"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_FillRect</B
+></CODE
+>(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2361"
+></A
+><H2
+>Description</H2
+><P
+>This function performs a fast fill of the given rectangle with
+<TT
+CLASS="PARAMETER"
+><I
+>color</I
+></TT
+>. If <TT
+CLASS="PARAMETER"
+><I
+>dstrect</I
+></TT
+>
+is <TT
+CLASS="LITERAL"
+>NULL</TT
+>, the whole surface will be filled with
+<TT
+CLASS="PARAMETER"
+><I
+>color</I
+></TT
+>.</P
+><P
+>The color should be a pixel of the format used by the surface, and
+can be generated by the
+<A
+HREF="sdlmaprgb.html"
+>SDL_MapRGB</A
+> or <A
+HREF="sdlmaprgba.html"
+>SDL_MapRGBA</A
+>
+functions. If the color value contains an alpha value then the
+destination is simply "filled" with that alpha information, no blending
+takes place.</P
+><P
+>If there is a clip rectangle set on the destination (set via
+<A
+HREF="sdlsetcliprect.html"
+>SDL_SetClipRect</A
+>) then this
+function will clip based on the intersection of the clip rectangle and
+the <TT
+CLASS="PARAMETER"
+><I
+>dstrect</I
+></TT
+> rectangle and the dstrect rectangle
+will be modified to represent the area actually filled.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2374"
+></A
+><H2
+>Return Value</H2
+><P
+>This function returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> on success, or
+<SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> on error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2379"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlmaprgb.html"
+><TT
+CLASS="FUNCTION"
+>SDL_MapRGB</TT
+></A
+>,
+<A
+HREF="sdlmaprgb.html"
+><TT
+CLASS="FUNCTION"
+>SDL_MapRGBA</TT
+></A
+>,
+<A
+HREF="sdlblitsurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_BlitSurface</TT
+></A
+>,
+<A
+HREF="sdlrect.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Rect</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlblitsurface.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdldisplayformat.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_BlitSurface</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_DisplayFormat</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlflip.html b/distrib/sdl-1.2.15/docs/html/sdlflip.html
new file mode 100644
index 0000000..b480f99
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlflip.html
@@ -0,0 +1,259 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_Flip</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_UpdateRects"
+HREF="sdlupdaterects.html"><LINK
+REL="NEXT"
+TITLE="SDL_SetColors"
+HREF="sdlsetcolors.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlupdaterects.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlsetcolors.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLFLIP"
+></A
+>SDL_Flip</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1426"
+></A
+><H2
+>Name</H2
+>SDL_Flip&nbsp;--&nbsp;Swaps screen buffers</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1429"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1430"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_Flip</B
+></CODE
+>(SDL_Surface *screen);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1436"
+></A
+><H2
+>Description</H2
+><P
+>On hardware that supports double-buffering, this function sets up a flip
+and returns. The hardware will wait for vertical retrace, and then swap
+video buffers before the next video surface blit or lock will return.
+On hardware that doesn't support double-buffering, this is equivalent
+to calling <A
+HREF="sdlupdaterect.html"
+>SDL_UpdateRect</A
+><TT
+CLASS="PARAMETER"
+><I
+>(screen, 0, 0, 0, 0)</I
+></TT
+></P
+><P
+>The <TT
+CLASS="LITERAL"
+>SDL_DOUBLEBUF</TT
+> flag must have been passed to
+<A
+HREF="sdlsetvideomode.html"
+>SDL_SetVideoMode</A
+>,
+ when
+setting the video mode for this function to perform hardware flipping.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1444"
+></A
+><H2
+>Return Value</H2
+><P
+>This function returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> if successful, or
+<SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> if there was an error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1449"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlsetvideomode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+></A
+>,
+<A
+HREF="sdlupdaterect.html"
+><TT
+CLASS="FUNCTION"
+>SDL_UpdateRect</TT
+></A
+>,
+<A
+HREF="sdlsurface.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlupdaterects.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlsetcolors.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_UpdateRects</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_SetColors</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlfreecursor.html b/distrib/sdl-1.2.15/docs/html/sdlfreecursor.html
new file mode 100644
index 0000000..01a4f7c
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlfreecursor.html
@@ -0,0 +1,209 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_FreeCursor</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CreateCursor"
+HREF="sdlcreatecursor.html"><LINK
+REL="NEXT"
+TITLE="SDL_SetCursor"
+HREF="sdlsetcursor.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcreatecursor.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlsetcursor.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLFREECURSOR"
+></A
+>SDL_FreeCursor</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2540"
+></A
+><H2
+>Name</H2
+>SDL_FreeCursor&nbsp;--&nbsp;Frees a cursor created with SDL_CreateCursor.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2543"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2544"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_FreeCursor</B
+></CODE
+>(SDL_Cursor *cursor);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2550"
+></A
+><H2
+>Description</H2
+><P
+>Frees a <SPAN
+CLASS="STRUCTNAME"
+>SDL_Cursor</SPAN
+> that was created using
+<A
+HREF="sdlcreatecursor.html"
+>SDL_CreateCursor</A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2555"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcreatecursor.html"
+>SDL_CreateCursor</A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcreatecursor.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlsetcursor.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CreateCursor</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_SetCursor</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlfreesurface.html b/distrib/sdl-1.2.15/docs/html/sdlfreesurface.html
new file mode 100644
index 0000000..84b6048
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlfreesurface.html
@@ -0,0 +1,219 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_FreeSurface</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CreateRGBSurfaceFrom"
+HREF="sdlcreatergbsurfacefrom.html"><LINK
+REL="NEXT"
+TITLE="SDL_LockSurface"
+HREF="sdllocksurface.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcreatergbsurfacefrom.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdllocksurface.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLFREESURFACE"
+></A
+>SDL_FreeSurface</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1893"
+></A
+><H2
+>Name</H2
+>SDL_FreeSurface&nbsp;--&nbsp;Frees (deletes) a SDL_Surface</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1896"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1897"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_FreeSurface</B
+></CODE
+>(SDL_Surface *surface);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1903"
+></A
+><H2
+>Description</H2
+><P
+>Frees the resources used by a previously created <SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+>. If the surface was created using
+<A
+HREF="sdlcreatergbsurfacefrom.html"
+>SDL_CreateRGBSurfaceFrom</A
+> then the pixel data is not freed.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1908"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcreatergbsurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateRGBSurface</TT
+></A
+>
+<A
+HREF="sdlcreatergbsurfacefrom.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateRGBSurfaceFrom</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcreatergbsurfacefrom.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdllocksurface.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CreateRGBSurfaceFrom</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_LockSurface</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlfreewav.html b/distrib/sdl-1.2.15/docs/html/sdlfreewav.html
new file mode 100644
index 0000000..24242c4
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlfreewav.html
@@ -0,0 +1,222 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_FreeWAV</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Audio"
+HREF="audio.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_LoadWAV"
+HREF="sdlloadwav.html"><LINK
+REL="NEXT"
+TITLE="SDL_AudioCVT"
+HREF="sdlaudiocvt.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlloadwav.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlaudiocvt.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLFREEWAV"
+></A
+>SDL_FreeWAV</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6857"
+></A
+><H2
+>Name</H2
+>SDL_FreeWAV&nbsp;--&nbsp;Frees previously opened WAV data</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN6860"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN6861"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_FreeWAV</B
+></CODE
+>(Uint8 *audio_buf);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6867"
+></A
+><H2
+>Description</H2
+><P
+>After a WAVE file has been opened with <A
+HREF="sdlloadwav.html"
+><TT
+CLASS="FUNCTION"
+>SDL_LoadWAV</TT
+></A
+> its data can eventually be freed with <TT
+CLASS="FUNCTION"
+>SDL_FreeWAV</TT
+>. <TT
+CLASS="PARAMETER"
+><I
+>audio_buf</I
+></TT
+> is a pointer to the buffer created by <TT
+CLASS="FUNCTION"
+>SDL_LoadWAV</TT
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6875"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlloadwav.html"
+><TT
+CLASS="FUNCTION"
+>SDL_LoadWAV</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlloadwav.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlaudiocvt.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_LoadWAV</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="audio.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_AudioCVT</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlfreeyuvoverlay.html b/distrib/sdl-1.2.15/docs/html/sdlfreeyuvoverlay.html
new file mode 100644
index 0000000..e82340d
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlfreeyuvoverlay.html
@@ -0,0 +1,233 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_FreeYUVOverlay</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_DisplayYUVOverlay"
+HREF="sdldisplayyuvoverlay.html"><LINK
+REL="NEXT"
+TITLE="SDL_GLattr"
+HREF="sdlglattr.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdldisplayyuvoverlay.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlglattr.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLFREEYUVOVERLAY"
+></A
+>SDL_FreeYUVOverlay</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2941"
+></A
+><H2
+>Name</H2
+>SDL_FreeYUVOverlay&nbsp;--&nbsp;Free a YUV video overlay</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2944"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2945"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_FreeYUVOverlay</B
+></CODE
+>(SDL_Overlay *overlay);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2951"
+></A
+><H2
+>Description</H2
+><P
+>Frees and <A
+HREF="sdloverlay.html"
+><TT
+CLASS="PARAMETER"
+><I
+>overlay</I
+></TT
+></A
+> created by <A
+HREF="sdlcreateyuvoverlay.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateYUVOverlay</TT
+></A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2958"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdloverlay.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Overlay</SPAN
+></A
+>,
+<A
+HREF="sdldisplayyuvoverlay.html"
+><TT
+CLASS="FUNCTION"
+>SDL_DisplayYUVOverlay</TT
+></A
+>,
+<A
+HREF="sdlcreateyuvoverlay.html"
+><TT
+CLASS="FUNCTION"
+>SDL_FreeYUVOverlay</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdldisplayyuvoverlay.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlglattr.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_DisplayYUVOverlay</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GLattr</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlgetappstate.html b/distrib/sdl-1.2.15/docs/html/sdlgetappstate.html
new file mode 100644
index 0000000..d09e2e0
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlgetappstate.html
@@ -0,0 +1,263 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GetAppState</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Event Functions."
+HREF="eventfunctions.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GetRelativeMouseState"
+HREF="sdlgetrelativemousestate.html"><LINK
+REL="NEXT"
+TITLE="SDL_JoystickEventState"
+HREF="sdljoystickeventstate.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlgetrelativemousestate.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdljoystickeventstate.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGETAPPSTATE"
+></A
+>SDL_GetAppState</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5931"
+></A
+><H2
+>Name</H2
+><TT
+CLASS="FUNCTION"
+>SDL_GetAppState</TT
+>&nbsp;--&nbsp;Get the state of the application</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN5935"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN5936"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>Uint8 <B
+CLASS="FSFUNC"
+>SDL_GetAppState</B
+></CODE
+>(void);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5942"
+></A
+><H2
+>Description</H2
+><P
+>This function returns the current state of the application. The value returned is a bitwise combination of:</P
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN5945"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_APPMOUSEFOCUS</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>The application has mouse focus.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_APPINPUTFOCUS</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>The application has keyboard focus</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_APPACTIVE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>The application is visible</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5960"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlactiveevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_ActiveEvent</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlgetrelativemousestate.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdljoystickeventstate.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GetRelativeMouseState</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_JoystickEventState</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlgetaudiostatus.html b/distrib/sdl-1.2.15/docs/html/sdlgetaudiostatus.html
new file mode 100644
index 0000000..3fc3a09
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlgetaudiostatus.html
@@ -0,0 +1,221 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GetAudioStatus</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Audio"
+HREF="audio.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_PauseAudio"
+HREF="sdlpauseaudio.html"><LINK
+REL="NEXT"
+TITLE="SDL_LoadWAV"
+HREF="sdlloadwav.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlpauseaudio.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlloadwav.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGETAUDIOSTATUS"
+></A
+>SDL_GetAudioStatus</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6790"
+></A
+><H2
+>Name</H2
+>SDL_GetAudioStatus&nbsp;--&nbsp;Get the current audio state</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN6793"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN6794"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_audiostatus<B
+CLASS="FSFUNC"
+>SDL_GetAudioStatus</B
+></CODE
+>(void);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6800"
+></A
+><H2
+>Description</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef enum{
+ SDL_AUDIO_STOPPED,
+ SDL_AUDIO_PAUSED,
+ SDL_AUDIO_PLAYING
+} SDL_audiostatus;</PRE
+><P
+>Returns either <TT
+CLASS="LITERAL"
+>SDL_AUDIO_STOPPED</TT
+>, <TT
+CLASS="LITERAL"
+>SDL_AUDIO_PAUSED</TT
+> or <TT
+CLASS="LITERAL"
+>SDL_AUDIO_PLAYING</TT
+> depending on the current audio state.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6807"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlpauseaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PauseAudio</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlpauseaudio.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlloadwav.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_PauseAudio</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="audio.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_LoadWAV</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlgetcliprect.html b/distrib/sdl-1.2.15/docs/html/sdlgetcliprect.html
new file mode 100644
index 0000000..f00ac77
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlgetcliprect.html
@@ -0,0 +1,229 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GetClipRect</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_SetClipRect"
+HREF="sdlsetcliprect.html"><LINK
+REL="NEXT"
+TITLE="SDL_ConvertSurface"
+HREF="sdlconvertsurface.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlsetcliprect.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlconvertsurface.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGETCLIPRECT"
+></A
+>SDL_GetClipRect</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2230"
+></A
+><H2
+>Name</H2
+>SDL_GetClipRect&nbsp;--&nbsp;Gets the clipping rectangle for a surface.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2233"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2234"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_GetClipRect</B
+></CODE
+>(SDL_Surface *surface, SDL_Rect *rect);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2240"
+></A
+><H2
+>Description</H2
+><P
+>Gets the clipping rectangle for a surface. When this surface is the
+destination of a blit, only the area within the clip rectangle is
+drawn into.</P
+><P
+>The rectangle pointed to by <TT
+CLASS="PARAMETER"
+><I
+>rect</I
+></TT
+> will be
+filled with the clipping rectangle of the surface.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2245"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlsetcliprect.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetClipRect</TT
+></A
+>,
+<A
+HREF="sdlblitsurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_BlitSurface</TT
+></A
+>,
+<A
+HREF="sdlsurface.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlsetcliprect.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlconvertsurface.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_SetClipRect</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_ConvertSurface</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlgetcursor.html b/distrib/sdl-1.2.15/docs/html/sdlgetcursor.html
new file mode 100644
index 0000000..72ecbc7
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlgetcursor.html
@@ -0,0 +1,219 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GetCursor</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_SetCursor"
+HREF="sdlsetcursor.html"><LINK
+REL="NEXT"
+TITLE="SDL_ShowCursor"
+HREF="sdlshowcursor.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlsetcursor.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlshowcursor.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGETCURSOR"
+></A
+>SDL_GetCursor</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2589"
+></A
+><H2
+>Name</H2
+>SDL_GetCursor&nbsp;--&nbsp;Get the currently active mouse cursor.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2592"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2593"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_Cursor *<B
+CLASS="FSFUNC"
+>SDL_GetCursor</B
+></CODE
+>(void);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2599"
+></A
+><H2
+>Description</H2
+><P
+>Returns the currently active mouse cursor.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2602"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlsetcursor.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetCursor</TT
+></A
+>,
+<A
+HREF="sdlcreatecursor.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateCursor</TT
+></A
+>,
+<A
+HREF="sdlshowcursor.html"
+><TT
+CLASS="FUNCTION"
+>SDL_ShowCursor</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlsetcursor.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlshowcursor.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_SetCursor</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_ShowCursor</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlgeterror.html b/distrib/sdl-1.2.15/docs/html/sdlgeterror.html
new file mode 100644
index 0000000..cdf5792
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlgeterror.html
@@ -0,0 +1,205 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GetError</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="General"
+HREF="general.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_WasInit"
+HREF="sdlwasinit.html"><LINK
+REL="NEXT"
+TITLE="SDL_envvars"
+HREF="sdlenvvars.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlwasinit.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlenvvars.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGETERROR"
+></A
+>SDL_GetError</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN653"
+></A
+><H2
+>Name</H2
+>SDL_GetError&nbsp;--&nbsp;Get SDL error string</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN656"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN657"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL/SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>char *<B
+CLASS="FSFUNC"
+>SDL_GetError</B
+></CODE
+>(void);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN663"
+></A
+><H2
+>Description</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_GetError</TT
+> returns a NULL terminated string containing information about the last internal SDL error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN667"
+></A
+><H2
+>Return Value</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_GetError</TT
+> returns a string containing the last error.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlwasinit.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlenvvars.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_WasInit</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="general.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_envvars</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlgeteventfilter.html b/distrib/sdl-1.2.15/docs/html/sdlgeteventfilter.html
new file mode 100644
index 0000000..d254d34
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlgeteventfilter.html
@@ -0,0 +1,235 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GetEventFilter</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Event Functions."
+HREF="eventfunctions.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_SetEventFilter"
+HREF="sdlseteventfilter.html"><LINK
+REL="NEXT"
+TITLE="SDL_EventState"
+HREF="sdleventstate.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlseteventfilter.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdleventstate.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGETEVENTFILTER"
+></A
+>SDL_GetEventFilter</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5615"
+></A
+><H2
+>Name</H2
+>SDL_GetEventFilter&nbsp;--&nbsp;Retrieves a pointer to he event filter</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN5618"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN5619"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_EventFilter <B
+CLASS="FSFUNC"
+>SDL_GetEventFilter</B
+></CODE
+>(void);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5625"
+></A
+><H2
+>Description</H2
+><P
+>This function retrieces a pointer to the event filter that was previously set using <A
+HREF="sdlseteventfilter.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetEventFilter</TT
+></A
+>. An SDL_EventFilter function is defined as:
+<PRE
+CLASS="PROGRAMLISTING"
+>typedef int (*SDL_EventFilter)(const SDL_Event *event);</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5631"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns a pointer to the event filter or <TT
+CLASS="LITERAL"
+>NULL</TT
+> if no filter has been set.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5635"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+>,
+<A
+HREF="sdlseteventfilter.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetEventFilter</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlseteventfilter.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdleventstate.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_SetEventFilter</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_EventState</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlgetgammaramp.html b/distrib/sdl-1.2.15/docs/html/sdlgetgammaramp.html
new file mode 100644
index 0000000..bfcc03c
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlgetgammaramp.html
@@ -0,0 +1,219 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GetGammaRamp</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_SetGamma"
+HREF="sdlsetgamma.html"><LINK
+REL="NEXT"
+TITLE="SDL_SetGammaRamp"
+HREF="sdlsetgammaramp.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlsetgamma.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlsetgammaramp.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGETGAMMARAMP"
+></A
+>SDL_GetGammaRamp</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1598"
+></A
+><H2
+>Name</H2
+>SDL_GetGammaRamp&nbsp;--&nbsp;Gets the color gamma lookup tables for the display</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1601"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1602"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_GetGammaRamp</B
+></CODE
+>(Uint16 *redtable, Uint16 *greentable, Uint16 *bluetable);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1608"
+></A
+><H2
+>Description</H2
+><P
+>Gets the gamma translation lookup tables currently used by the display.
+Each table is an array of 256 Uint16 values.</P
+><P
+>Not all display hardware is able to change gamma.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1612"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns -1 on error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1615"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlsetgamma.html"
+>SDL_SetGamma</A
+>
+<A
+HREF="sdlsetgammaramp.html"
+>SDL_SetGammaRamp</A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlsetgamma.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlsetgammaramp.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_SetGamma</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_SetGammaRamp</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlgetkeyname.html b/distrib/sdl-1.2.15/docs/html/sdlgetkeyname.html
new file mode 100644
index 0000000..6c51c94
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlgetkeyname.html
@@ -0,0 +1,216 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GetKeyName</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Event Functions."
+HREF="eventfunctions.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_SetModState"
+HREF="sdlsetmodstate.html"><LINK
+REL="NEXT"
+TITLE="SDL_EnableUNICODE"
+HREF="sdlenableunicode.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlsetmodstate.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlenableunicode.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGETKEYNAME"
+></A
+>SDL_GetKeyName</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5780"
+></A
+><H2
+>Name</H2
+>SDL_GetKeyName&nbsp;--&nbsp;Get the name of an SDL virtual keysym</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN5783"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN5784"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>char *<B
+CLASS="FSFUNC"
+>SDL_GetKeyName</B
+></CODE
+>(SDLKey key);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5790"
+></A
+><H2
+>Description</H2
+><P
+>Returns the SDL-defined name of the <A
+HREF="sdlkey.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDLKey</SPAN
+></A
+> <TT
+CLASS="PARAMETER"
+><I
+>key</I
+></TT
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5796"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlkey.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDLKey</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlsetmodstate.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlenableunicode.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_SetModState</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_EnableUNICODE</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlgetkeystate.html b/distrib/sdl-1.2.15/docs/html/sdlgetkeystate.html
new file mode 100644
index 0000000..1c16f2e
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlgetkeystate.html
@@ -0,0 +1,253 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GetKeyState</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Event Functions."
+HREF="eventfunctions.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_EventState"
+HREF="sdleventstate.html"><LINK
+REL="NEXT"
+TITLE="SDL_GetModState"
+HREF="sdlgetmodstate.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdleventstate.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlgetmodstate.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGETKEYSTATE"
+></A
+>SDL_GetKeyState</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5686"
+></A
+><H2
+>Name</H2
+>SDL_GetKeyState&nbsp;--&nbsp;Get a snapshot of the current keyboard state</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN5689"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN5690"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>Uint8 *<B
+CLASS="FSFUNC"
+>SDL_GetKeyState</B
+></CODE
+>(int *numkeys);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5696"
+></A
+><H2
+>Description</H2
+><P
+>Gets a snapshot of the current keyboard state. The current state is return as a pointer to an array, the size of this array is stored in <TT
+CLASS="PARAMETER"
+><I
+>numkeys</I
+></TT
+>. The array is indexed by the <A
+HREF="sdlkey.html"
+><TT
+CLASS="LITERAL"
+>SDLK_*</TT
+></A
+> symbols. A value of 1 means the key is pressed and a value of 0 means its not. The pointer returned is a pointer to an internal SDL array and should not be freed by the caller.</P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>Use <A
+HREF="sdlpumpevents.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PumpEvents</TT
+></A
+> to update the state array.</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5706"
+></A
+><H2
+>Example</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>Uint8 *keystate = SDL_GetKeyState(NULL);
+if ( keystate[SDLK_RETURN] ) printf("Return Key Pressed.\n");</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5710"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlkey.html"
+><TT
+CLASS="LITERAL"
+>SDL Key Symbols</TT
+></A
+>,
+<A
+HREF="sdlpumpevents.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PumpEvents</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdleventstate.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlgetmodstate.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_EventState</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GetModState</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlgetmodstate.html b/distrib/sdl-1.2.15/docs/html/sdlgetmodstate.html
new file mode 100644
index 0000000..64d2f35
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlgetmodstate.html
@@ -0,0 +1,257 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GetModState</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Event Functions."
+HREF="eventfunctions.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GetKeyState"
+HREF="sdlgetkeystate.html"><LINK
+REL="NEXT"
+TITLE="SDL_SetModState"
+HREF="sdlsetmodstate.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlgetkeystate.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlsetmodstate.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGETMODSTATE"
+></A
+>SDL_GetModState</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5721"
+></A
+><H2
+>Name</H2
+>SDL_GetModState&nbsp;--&nbsp;Get the state of modifier keys.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN5724"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN5725"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDLMod <B
+CLASS="FSFUNC"
+>SDL_GetModState</B
+></CODE
+>(void);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5731"
+></A
+><H2
+>Description</H2
+><P
+>Returns the current state of the modifier keys (CTRL, ALT, etc.).</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5734"
+></A
+><H2
+>Return Value</H2
+><P
+>The return value can be an OR'd combination of the SDLMod enum.</P
+><P
+><A
+NAME="AEN5738"
+></A
+><BLOCKQUOTE
+CLASS="BLOCKQUOTE"
+><P
+><B
+>SDLMod</B
+></P
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef enum {
+ KMOD_NONE = 0x0000,
+ KMOD_LSHIFT= 0x0001,
+ KMOD_RSHIFT= 0x0002,
+ KMOD_LCTRL = 0x0040,
+ KMOD_RCTRL = 0x0080,
+ KMOD_LALT = 0x0100,
+ KMOD_RALT = 0x0200,
+ KMOD_LMETA = 0x0400,
+ KMOD_RMETA = 0x0800,
+ KMOD_NUM = 0x1000,
+ KMOD_CAPS = 0x2000,
+ KMOD_MODE = 0x4000,
+} SDLMod;</PRE
+></BLOCKQUOTE
+>
+SDL also defines the following symbols for convenience:
+<A
+NAME="AEN5741"
+></A
+><BLOCKQUOTE
+CLASS="BLOCKQUOTE"
+><PRE
+CLASS="PROGRAMLISTING"
+>#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
+#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
+#define KMOD_ALT (KMOD_LALT|KMOD_RALT)
+#define KMOD_META (KMOD_LMETA|KMOD_RMETA)</PRE
+></BLOCKQUOTE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5743"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlgetkeystate.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetKeyState</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlgetkeystate.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlsetmodstate.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GetKeyState</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_SetModState</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlgetmousestate.html b/distrib/sdl-1.2.15/docs/html/sdlgetmousestate.html
new file mode 100644
index 0000000..d96a55b
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlgetmousestate.html
@@ -0,0 +1,253 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GetMouseState</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Event Functions."
+HREF="eventfunctions.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_EnableKeyRepeat"
+HREF="sdlenablekeyrepeat.html"><LINK
+REL="NEXT"
+TITLE="SDL_GetRelativeMouseState"
+HREF="sdlgetrelativemousestate.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlenablekeyrepeat.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlgetrelativemousestate.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGETMOUSESTATE"
+></A
+>SDL_GetMouseState</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5869"
+></A
+><H2
+>Name</H2
+>SDL_GetMouseState&nbsp;--&nbsp;Retrieve the current state of the mouse</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN5872"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN5873"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>Uint8 <B
+CLASS="FSFUNC"
+>SDL_GetMouseState</B
+></CODE
+>(int *x, int *y);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5879"
+></A
+><H2
+>Description</H2
+><P
+>The current button state is returned as a button bitmask, which can
+be tested using the <TT
+CLASS="LITERAL"
+>SDL_BUTTON(X)</TT
+> macros, and <TT
+CLASS="PARAMETER"
+><I
+>x</I
+></TT
+> and <TT
+CLASS="PARAMETER"
+><I
+>y</I
+></TT
+> are set to the
+current mouse cursor position. You can pass <TT
+CLASS="LITERAL"
+>NULL</TT
+> for either <TT
+CLASS="PARAMETER"
+><I
+>x</I
+></TT
+> or <TT
+CLASS="PARAMETER"
+><I
+>y</I
+></TT
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5888"
+></A
+><H2
+>Example</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>SDL_PumpEvents();
+if(SDL_GetMouseState(NULL, NULL)&#38;SDL_BUTTON(1))
+ printf("Mouse Button 1(left) is pressed.\n");</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5891"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlgetrelativemousestate.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetRelativeMouseState</TT
+></A
+>,
+<A
+HREF="sdlpumpevents.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PumpEvents</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlenablekeyrepeat.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlgetrelativemousestate.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_EnableKeyRepeat</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GetRelativeMouseState</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlgetrelativemousestate.html b/distrib/sdl-1.2.15/docs/html/sdlgetrelativemousestate.html
new file mode 100644
index 0000000..52a5106
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlgetrelativemousestate.html
@@ -0,0 +1,235 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GetRelativeMouseState</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Event Functions."
+HREF="eventfunctions.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GetMouseState"
+HREF="sdlgetmousestate.html"><LINK
+REL="NEXT"
+TITLE="SDL_GetAppState"
+HREF="sdlgetappstate.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlgetmousestate.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlgetappstate.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGETRELATIVEMOUSESTATE"
+></A
+>SDL_GetRelativeMouseState</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5902"
+></A
+><H2
+>Name</H2
+>SDL_GetRelativeMouseState&nbsp;--&nbsp;Retrieve the current state of the mouse</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN5905"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN5906"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>Uint8 <B
+CLASS="FSFUNC"
+>SDL_GetRelativeMouseState</B
+></CODE
+>(int *x, int *y);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5912"
+></A
+><H2
+>Description</H2
+><P
+>The current button state is returned as a button bitmask, which can
+be tested using the <TT
+CLASS="LITERAL"
+>SDL_BUTTON(X)</TT
+> macros, and <TT
+CLASS="PARAMETER"
+><I
+>x</I
+></TT
+> and <TT
+CLASS="PARAMETER"
+><I
+>y</I
+></TT
+> are set to the change in the mouse position since the last call to <TT
+CLASS="FUNCTION"
+>SDL_GetRelativeMouseState</TT
+> or since event initialization. You can pass <TT
+CLASS="LITERAL"
+>NULL</TT
+> for either <TT
+CLASS="PARAMETER"
+><I
+>x</I
+></TT
+> or <TT
+CLASS="PARAMETER"
+><I
+>y</I
+></TT
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5922"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlgetmousestate.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetMouseState</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlgetmousestate.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlgetappstate.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GetMouseState</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GetAppState</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlgetrgb.html b/distrib/sdl-1.2.15/docs/html/sdlgetrgb.html
new file mode 100644
index 0000000..47774dc
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlgetrgb.html
@@ -0,0 +1,231 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GetRGB</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_MapRGBA"
+HREF="sdlmaprgba.html"><LINK
+REL="NEXT"
+TITLE="SDL_GetRGBA"
+HREF="sdlgetrgba.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlmaprgba.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlgetrgba.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGETRGB"
+></A
+>SDL_GetRGB</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1718"
+></A
+><H2
+>Name</H2
+>SDL_GetRGB&nbsp;--&nbsp;Get RGB values from a pixel in the specified pixel format.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1721"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1722"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_GetRGB</B
+></CODE
+>(Uint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1728"
+></A
+><H2
+>Description</H2
+><P
+>Get RGB component values from a pixel stored in the specified pixel format.</P
+><P
+>This function uses the entire 8-bit [0..255] range when converting color
+components from pixel formats with less than 8-bits per RGB component
+(e.g., a completely white pixel in 16-bit RGB565 format would return
+[0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1732"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlgetrgba.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetRGBA</TT
+></A
+>,
+<A
+HREF="sdlmaprgb.html"
+><TT
+CLASS="FUNCTION"
+>SDL_MapRGB</TT
+></A
+>,
+<A
+HREF="sdlmaprgba.html"
+><TT
+CLASS="FUNCTION"
+>SDL_MapRGBA</TT
+></A
+>,
+<A
+HREF="sdlpixelformat.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_PixelFormat</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlmaprgba.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlgetrgba.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_MapRGBA</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GetRGBA</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlgetrgba.html b/distrib/sdl-1.2.15/docs/html/sdlgetrgba.html
new file mode 100644
index 0000000..a9e1093
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlgetrgba.html
@@ -0,0 +1,222 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GetRGBA</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GetRGB"
+HREF="sdlgetrgb.html"><LINK
+REL="NEXT"
+TITLE="SDL_CreateRGBSurface"
+HREF="sdlcreatergbsurface.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlgetrgb.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcreatergbsurface.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGETRGBA"
+></A
+>SDL_GetRGBA</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1747"
+></A
+><H2
+>Name</H2
+>SDL_GetRGBA&nbsp;--&nbsp;Get RGBA values from a pixel in the specified pixel format.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1750"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1751"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_GetRGBA</B
+></CODE
+>(Uint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1757"
+></A
+><H2
+>Description</H2
+><P
+>Get RGBA component values from a pixel stored in the specified pixel format.</P
+><P
+>This function uses the entire 8-bit [0..255] range when converting color
+components from pixel formats with less than 8-bits per RGB component
+(e.g., a completely white pixel in 16-bit RGB565 format would return
+[0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).</P
+><P
+>If the surface has no alpha component, the alpha will be returned as 0xff
+(100% opaque).</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1762"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlgetrgb.html"
+>SDL_GetRGB</A
+>,
+<A
+HREF="sdlmaprgb.html"
+>SDL_MapRGB</A
+>,
+<A
+HREF="sdlmaprgba.html"
+>SDL_MapRGBA</A
+>,
+<A
+HREF="sdlpixelformat.html"
+>SDL_PixelFormat</A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlgetrgb.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcreatergbsurface.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GetRGB</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CreateRGBSurface</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlgetthreadid.html b/distrib/sdl-1.2.15/docs/html/sdlgetthreadid.html
new file mode 100644
index 0000000..4bc59cb
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlgetthreadid.html
@@ -0,0 +1,209 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GetThreadID</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_ThreadID"
+HREF="sdlthreadid.html"><LINK
+REL="NEXT"
+TITLE="SDL_WaitThread"
+HREF="sdlwaitthread.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlthreadid.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlwaitthread.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGETTHREADID"
+></A
+>SDL_GetThreadID</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7743"
+></A
+><H2
+>Name</H2
+>SDL_GetThreadID&nbsp;--&nbsp;Get the SDL thread ID of a SDL_Thread</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7746"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7747"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>Uint32 <B
+CLASS="FSFUNC"
+>SDL_GetThreadID</B
+></CODE
+>(SDL_Thread *thread);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7753"
+></A
+><H2
+>Description</H2
+><P
+>Returns the ID of a <SPAN
+CLASS="STRUCTNAME"
+>SDL_Thread</SPAN
+> created by <A
+HREF="sdlcreatethread.html"
+>SDL_CreateThread</A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7758"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcreatethread.html"
+>SDL_CreateThread</A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlthreadid.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlwaitthread.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_ThreadID</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_WaitThread</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlgetticks.html b/distrib/sdl-1.2.15/docs/html/sdlgetticks.html
new file mode 100644
index 0000000..0911aae
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlgetticks.html
@@ -0,0 +1,206 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GetTicks</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Time"
+HREF="time.html"><LINK
+REL="PREVIOUS"
+TITLE="Time"
+HREF="time.html"><LINK
+REL="NEXT"
+TITLE="SDL_Delay"
+HREF="sdldelay.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="time.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdldelay.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGETTICKS"
+></A
+>SDL_GetTicks</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8433"
+></A
+><H2
+>Name</H2
+>SDL_GetTicks&nbsp;--&nbsp;Get the number of milliseconds since the SDL library initialization.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8436"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN8437"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>Uint32 <B
+CLASS="FSFUNC"
+>SDL_GetTicks</B
+></CODE
+>(void);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8443"
+></A
+><H2
+>Description</H2
+><P
+>Get the number of milliseconds since the SDL library initialization.
+Note that this value wraps if the program runs for more than ~49 days.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8446"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdldelay.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Delay</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="time.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdldelay.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Time</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="time.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_Delay</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlgetvideoinfo.html b/distrib/sdl-1.2.15/docs/html/sdlgetvideoinfo.html
new file mode 100644
index 0000000..25c4b45
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlgetvideoinfo.html
@@ -0,0 +1,226 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GetVideoInfo</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GetVideoSurface"
+HREF="sdlgetvideosurface.html"><LINK
+REL="NEXT"
+TITLE="SDL_VideoDriverName"
+HREF="sdlvideodrivername.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlgetvideosurface.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlvideodrivername.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGETVIDEOINFO"
+></A
+>SDL_GetVideoInfo</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1100"
+></A
+><H2
+>Name</H2
+>SDL_GetVideoInfo&nbsp;--&nbsp;returns a pointer to information about the video hardware</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1103"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1104"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_VideoInfo *<B
+CLASS="FSFUNC"
+>SDL_GetVideoInfo</B
+></CODE
+>(void);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1110"
+></A
+><H2
+>Description</H2
+><P
+>This function returns a read-only pointer to <A
+HREF="sdlvideoinfo.html"
+>information</A
+> about the video
+hardware. If this is called before <A
+HREF="sdlsetvideomode.html"
+>SDL_SetVideoMode</A
+>, the
+<TT
+CLASS="STRUCTFIELD"
+><I
+>vfmt</I
+></TT
+> member of the returned structure will contain the
+pixel format of the "best" video mode.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1116"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlsetvideomode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+></A
+>,
+<A
+HREF="sdlvideoinfo.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_VideoInfo</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlgetvideosurface.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlvideodrivername.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GetVideoSurface</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_VideoDriverName</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlgetvideosurface.html b/distrib/sdl-1.2.15/docs/html/sdlgetvideosurface.html
new file mode 100644
index 0000000..905b1f6
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlgetvideosurface.html
@@ -0,0 +1,208 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GetVideoSurface</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="NEXT"
+TITLE="SDL_GetVideoInfo"
+HREF="sdlgetvideoinfo.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="video.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlgetvideoinfo.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGETVIDEOSURFACE"
+></A
+>SDL_GetVideoSurface</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1078"
+></A
+><H2
+>Name</H2
+>SDL_GetVideoSurface&nbsp;--&nbsp;returns a pointer to the current display surface</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1081"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1082"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_Surface *<B
+CLASS="FSFUNC"
+>SDL_GetVideoSurface</B
+></CODE
+>(void);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1088"
+></A
+><H2
+>Description</H2
+><P
+>This function returns a pointer to the current display surface.
+If SDL is doing format conversion on the display surface, this
+function returns the publicly visible surface, not the real video
+surface.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1091"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlsurface.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlgetvideoinfo.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Video</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GetVideoInfo</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlglattr.html b/distrib/sdl-1.2.15/docs/html/sdlglattr.html
new file mode 100644
index 0000000..0ae0127
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlglattr.html
@@ -0,0 +1,379 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GLattr</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_FreeYUVOverlay"
+HREF="sdlfreeyuvoverlay.html"><LINK
+REL="NEXT"
+TITLE="SDL_Rect"
+HREF="sdlrect.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlfreeyuvoverlay.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlrect.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGLATTR"
+></A
+>SDL_GLattr</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2971"
+></A
+><H2
+>Name</H2
+>SDL_GLattr&nbsp;--&nbsp;SDL GL Attributes</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2974"
+></A
+><H2
+>Attributes</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN2976"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_GL_RED_SIZE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Size of the framebuffer red component, in bits</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_GL_GREEN_SIZE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Size of the framebuffer green component, in bits</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_GL_BLUE_SIZE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Size of the framebuffer blue component, in bits</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_GL_ALPHA_SIZE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Size of the framebuffer alpha component, in bits</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_GL_DOUBLEBUFFER</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>0 or 1, enable or disable double buffering</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_GL_BUFFER_SIZE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Size of the framebuffer, in bits</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_GL_DEPTH_SIZE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Size of the depth buffer, in bits</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_GL_STENCIL_SIZE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Size of the stencil buffer, in bits</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_GL_ACCUM_RED_SIZE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Size of the accumulation buffer red component, in bits</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_GL_ACCUM_GREEN_SIZE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Size of the accumulation buffer green component, in bits</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_GL_ACCUM_BLUE_SIZE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Size of the accumulation buffer blue component, in bits</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_GL_ACCUM_ALPHA_SIZE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Size of the accumulation buffer alpha component, in bits</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3027"
+></A
+><H2
+>Description</H2
+><P
+>While you can set most OpenGL attributes normally, the attributes list above must be known <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>before</I
+></SPAN
+> SDL sets the video mode. These attributes a set and read with <A
+HREF="sdlglsetattribute.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GL_SetAttribute</TT
+></A
+> and <A
+HREF="sdlglgetattribute.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GL_GetAttribute</TT
+></A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3035"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlglsetattribute.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GL_SetAttribute</TT
+></A
+>,
+<A
+HREF="sdlglgetattribute.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GL_GetAttribute</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlfreeyuvoverlay.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlrect.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_FreeYUVOverlay</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_Rect</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlglgetattribute.html b/distrib/sdl-1.2.15/docs/html/sdlglgetattribute.html
new file mode 100644
index 0000000..26c8913
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlglgetattribute.html
@@ -0,0 +1,247 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GL_GetAttribute</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GL_GetProcAddress"
+HREF="sdlglgetprocaddress.html"><LINK
+REL="NEXT"
+TITLE="SDL_GL_SetAttribute"
+HREF="sdlglsetattribute.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlglgetprocaddress.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlglsetattribute.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGLGETATTRIBUTE"
+></A
+>SDL_GL_GetAttribute</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2708"
+></A
+><H2
+>Name</H2
+>SDL_GL_GetAttribute&nbsp;--&nbsp;Get the value of a special SDL/OpenGL attribute</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2711"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2712"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_GL_GetAttribute</B
+></CODE
+>(SDLGLattr attr, int *value);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2718"
+></A
+><H2
+>Description</H2
+><P
+>Places the value of the SDL/OpenGL <A
+HREF="sdlglattr.html"
+>attribute</A
+> <TT
+CLASS="PARAMETER"
+><I
+>attr</I
+></TT
+> into <TT
+CLASS="PARAMETER"
+><I
+>value</I
+></TT
+>. This is useful after a call to <A
+HREF="sdlsetvideomode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+></A
+> to check whether your attributes have been <A
+HREF="sdlglsetattribute.html"
+>set</A
+> as you expected.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2727"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> on success, or <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> on an error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2732"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlglsetattribute.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GL_SetAttribute</TT
+></A
+>,
+<A
+HREF="sdlglattr.html"
+>GL Attributes</A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlglgetprocaddress.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlglsetattribute.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GL_GetProcAddress</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GL_SetAttribute</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlglgetprocaddress.html b/distrib/sdl-1.2.15/docs/html/sdlglgetprocaddress.html
new file mode 100644
index 0000000..a6cf6e4
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlglgetprocaddress.html
@@ -0,0 +1,262 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GL_GetProcAddress</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GL_LoadLibrary"
+HREF="sdlglloadlibrary.html"><LINK
+REL="NEXT"
+TITLE="SDL_GL_GetAttribute"
+HREF="sdlglgetattribute.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlglloadlibrary.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlglgetattribute.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGLGETPROCADDRESS"
+></A
+>SDL_GL_GetProcAddress</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2678"
+></A
+><H2
+>Name</H2
+>SDL_GL_GetProcAddress&nbsp;--&nbsp;Get the address of a GL function</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2681"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2682"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void *<B
+CLASS="FSFUNC"
+>SDL_GL_GetProcAddress</B
+></CODE
+>(const char* proc);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2688"
+></A
+><H2
+>Description</H2
+><P
+>Returns the address of the GL function <TT
+CLASS="PARAMETER"
+><I
+>proc</I
+></TT
+>, or <SPAN
+CLASS="RETURNVALUE"
+>NULL</SPAN
+> if the function is not found. If the GL library is loaded at runtime, with <A
+HREF="sdlglloadlibrary.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GL_LoadLibrary</TT
+></A
+>, then <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>all</I
+></SPAN
+> GL functions must be retrieved this way. Usually this is used to retrieve function pointers to OpenGL extensions.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2696"
+></A
+><H2
+>Example</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef void (*GL_ActiveTextureARB_Func)(unsigned int);
+GL_ActiveTextureARB_Func glActiveTextureARB_ptr = 0;
+int has_multitexture=1;
+.
+.
+.
+/* Get function pointer */
+glActiveTextureARB_ptr=(GL_ActiveTextureARB_Func) SDL_GL_GetProcAddress("glActiveTextureARB");
+
+/* Check for a valid function ptr */
+if(!glActiveTextureARB_ptr){
+ fprintf(stderr, "Multitexture Extensions not present.\n");
+ has_multitexture=0;
+}
+.
+.
+.
+.
+if(has_multitexture){
+ glActiveTextureARB_ptr(GL_TEXTURE0_ARB);
+ .
+ .
+}
+else{
+ .
+ .
+}</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2699"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlglloadlibrary.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GL_LoadLibrary</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlglloadlibrary.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlglgetattribute.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GL_LoadLibrary</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GL_GetAttribute</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlglloadlibrary.html b/distrib/sdl-1.2.15/docs/html/sdlglloadlibrary.html
new file mode 100644
index 0000000..d3c4c6d
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlglloadlibrary.html
@@ -0,0 +1,231 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GL_LoadLibrary</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_ShowCursor"
+HREF="sdlshowcursor.html"><LINK
+REL="NEXT"
+TITLE="SDL_GL_GetProcAddress"
+HREF="sdlglgetprocaddress.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlshowcursor.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlglgetprocaddress.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGLLOADLIBRARY"
+></A
+>SDL_GL_LoadLibrary</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2648"
+></A
+><H2
+>Name</H2
+>SDL_GL_LoadLibrary&nbsp;--&nbsp;Specify an OpenGL library</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2651"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2652"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_GL_LoadLibrary</B
+></CODE
+>(const char *path);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2658"
+></A
+><H2
+>Description</H2
+><P
+>If you wish, you may load the OpenGL library at runtime, this must be done before <A
+HREF="sdlsetvideomode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+></A
+> is called. The <TT
+CLASS="PARAMETER"
+><I
+>path</I
+></TT
+> of the GL library is passed to <TT
+CLASS="FUNCTION"
+>SDL_GL_LoadLibrary</TT
+> and it returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> on success, or <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> on an error. You must then use <A
+HREF="sdlglgetprocaddress.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GL_GetProcAddress</TT
+></A
+> to retrieve function pointers to GL functions.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2669"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlglgetprocaddress.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GL_GetProcAddress</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlshowcursor.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlglgetprocaddress.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_ShowCursor</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GL_GetProcAddress</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlglsetattribute.html b/distrib/sdl-1.2.15/docs/html/sdlglsetattribute.html
new file mode 100644
index 0000000..ffb1204
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlglsetattribute.html
@@ -0,0 +1,286 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GL_SetAttribute</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GL_GetAttribute"
+HREF="sdlglgetattribute.html"><LINK
+REL="NEXT"
+TITLE="SDL_GL_SwapBuffers"
+HREF="sdlglswapbuffers.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlglgetattribute.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlglswapbuffers.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGLSETATTRIBUTE"
+></A
+>SDL_GL_SetAttribute</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2742"
+></A
+><H2
+>Name</H2
+>SDL_GL_SetAttribute&nbsp;--&nbsp;Set a special SDL/OpenGL attribute</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2745"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2746"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_GL_SetAttribute</B
+></CODE
+>(SDL_GLattr attr, int value);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2752"
+></A
+><H2
+>Description</H2
+><P
+>Sets the OpenGL <A
+HREF="sdlglattr.html"
+>attribute</A
+> <TT
+CLASS="PARAMETER"
+><I
+>attr</I
+></TT
+> to <TT
+CLASS="PARAMETER"
+><I
+>value</I
+></TT
+>. The attributes you set don't take effect until after a call to <A
+HREF="sdlsetvideomode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+></A
+>. You should use <A
+HREF="sdlglgetattribute.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GL_GetAttribute</TT
+></A
+> to check the values after a <TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+> call.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2763"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> on success, or <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> on error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2768"
+></A
+><H2
+>Example</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
+SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
+SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
+SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
+SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
+if ( (screen=SDL_SetVideoMode( 640, 480, 16, SDL_OPENGL )) == NULL ) {
+ fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError());
+ SDL_Quit();
+ return;
+}</PRE
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>The <TT
+CLASS="LITERAL"
+>SDL_DOUBLEBUF</TT
+> flag is not required to enable double buffering when setting an OpenGL video mode. Double buffering is enabled or disabled using the SDL_GL_DOUBLEBUFFER attribute.</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2774"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlglgetattribute.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GL_GetAttribute</TT
+></A
+>,
+<A
+HREF="sdlglattr.html"
+>GL Attributes</A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlglgetattribute.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlglswapbuffers.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GL_GetAttribute</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GL_SwapBuffers</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlglswapbuffers.html b/distrib/sdl-1.2.15/docs/html/sdlglswapbuffers.html
new file mode 100644
index 0000000..fa38341
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlglswapbuffers.html
@@ -0,0 +1,212 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_GL_SwapBuffers</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GL_SetAttribute"
+HREF="sdlglsetattribute.html"><LINK
+REL="NEXT"
+TITLE="SDL_CreateYUVOverlay"
+HREF="sdlcreateyuvoverlay.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlglsetattribute.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcreateyuvoverlay.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLGLSWAPBUFFERS"
+></A
+>SDL_GL_SwapBuffers</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2784"
+></A
+><H2
+>Name</H2
+>SDL_GL_SwapBuffers&nbsp;--&nbsp;Swap OpenGL framebuffers/Update Display</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2787"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2788"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_GL_SwapBuffers</B
+></CODE
+>(void );</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2794"
+></A
+><H2
+>Description</H2
+><P
+>Swap the OpenGL buffers, if double-buffering is supported.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2797"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlsetvideomode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+></A
+>,
+<A
+HREF="sdlglsetattribute.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GL_SetAttribute</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlglsetattribute.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcreateyuvoverlay.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GL_SetAttribute</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CreateYUVOverlay</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlinit.html b/distrib/sdl-1.2.15/docs/html/sdlinit.html
new file mode 100644
index 0000000..11f27b8
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlinit.html
@@ -0,0 +1,368 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_Init</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="General"
+HREF="general.html"><LINK
+REL="PREVIOUS"
+TITLE="General"
+HREF="general.html"><LINK
+REL="NEXT"
+TITLE="SDL_InitSubSystem"
+HREF="sdlinitsubsystem.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="general.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlinitsubsystem.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLINIT"
+></A
+>SDL_Init</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN440"
+></A
+><H2
+>Name</H2
+>SDL_Init&nbsp;--&nbsp;Initializes SDL</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN443"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN444"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_Init</B
+></CODE
+>(Uint32 flags);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN450"
+></A
+><H2
+>Description</H2
+><P
+>Initializes SDL. This should be called before all other SDL functions. The <TT
+CLASS="PARAMETER"
+><I
+>flags</I
+></TT
+> parameter specifies what part(s) of SDL to initialize.</P
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN454"
+></A
+><P
+></P
+><TABLE
+BORDER="1"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_INIT_TIMER</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Initializes the <A
+HREF="time.html"
+>timer</A
+> subsystem.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_INIT_AUDIO</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Initializes the <A
+HREF="audio.html"
+>audio</A
+> subsystem.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_INIT_VIDEO</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Initializes the <A
+HREF="video.html"
+>video</A
+> subsystem.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_INIT_CDROM</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Initializes the <A
+HREF="cdrom.html"
+>cdrom</A
+> subsystem.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_INIT_JOYSTICK</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Initializes the <A
+HREF="joystick.html"
+>joystick</A
+> subsystem.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_INIT_EVERYTHING</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Initialize all of the above.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_INIT_NOPARACHUTE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Prevents SDL from catching fatal signals.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_INIT_EVENTTHREAD</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN494"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> on an error or <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> on success.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN499"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlquit.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Quit</TT
+></A
+>,
+<A
+HREF="sdlinitsubsystem.html"
+><TT
+CLASS="FUNCTION"
+>SDL_InitSubSystem</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="general.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlinitsubsystem.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>General</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="general.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_InitSubSystem</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlinitsubsystem.html b/distrib/sdl-1.2.15/docs/html/sdlinitsubsystem.html
new file mode 100644
index 0000000..917fd10
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlinitsubsystem.html
@@ -0,0 +1,283 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_InitSubSystem</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="General"
+HREF="general.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_Init"
+HREF="sdlinit.html"><LINK
+REL="NEXT"
+TITLE="SDL_QuitSubSystem"
+HREF="sdlquitsubsystem.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlinit.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlquitsubsystem.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLINITSUBSYSTEM"
+></A
+>SDL_InitSubSystem</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN510"
+></A
+><H2
+>Name</H2
+>SDL_InitSubSystem&nbsp;--&nbsp;Initialize subsystems</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN513"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN514"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_InitSubSystem</B
+></CODE
+>(Uint32 flags);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN520"
+></A
+><H2
+>Description</H2
+><P
+>After SDL has been initialized with <A
+HREF="sdlinit.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+></A
+> you may initialize uninitialized subsystems with <TT
+CLASS="FUNCTION"
+>SDL_InitSubSystem</TT
+>. The <TT
+CLASS="PARAMETER"
+><I
+>flags</I
+></TT
+> parameter is the same as that used in <A
+HREF="sdlinit.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+></A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN529"
+></A
+><H2
+>Examples</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>/* Seperating Joystick and Video initialization. */
+SDL_Init(SDL_INIT_VIDEO);
+.
+.
+SDL_SetVideoMode(640, 480, 16, SDL_DOUBLEBUF|SDL_FULLSCREEN);
+.
+/* Do Some Video stuff */
+.
+.
+/* Initialize the joystick subsystem */
+SDL_InitSubSystem(SDL_INIT_JOYSTICK);
+
+/* Do some stuff with video and joystick */
+.
+.
+.
+/* Shut them both down */
+SDL_Quit();</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN532"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> on an error or <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> on success.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN537"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlinit.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+></A
+>,
+<A
+HREF="sdlquit.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Quit</TT
+></A
+>,
+<A
+HREF="sdlquitsubsystem.html"
+><TT
+CLASS="FUNCTION"
+>SDL_QuitSubSystem</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlinit.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlquitsubsystem.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_Init</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="general.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_QuitSubSystem</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdljoyaxisevent.html b/distrib/sdl-1.2.15/docs/html/sdljoyaxisevent.html
new file mode 100644
index 0000000..9f01669
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdljoyaxisevent.html
@@ -0,0 +1,330 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_JoyAxisEvent</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Event Structures."
+HREF="eventstructures.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_MouseButtonEvent"
+HREF="sdlmousebuttonevent.html"><LINK
+REL="NEXT"
+TITLE="SDL_JoyButtonEvent"
+HREF="sdljoybuttonevent.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlmousebuttonevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdljoybuttonevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLJOYAXISEVENT"
+></A
+>SDL_JoyAxisEvent</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4203"
+></A
+><H2
+>Name</H2
+>SDL_JoyAxisEvent&nbsp;--&nbsp;Joystick axis motion event structure</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4206"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ Uint8 type;
+ Uint8 which;
+ Uint8 axis;
+ Sint16 value;
+} SDL_JoyAxisEvent;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4209"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN4211"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_JOYAXISMOTION</TT
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>which</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Joystick device index</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>axis</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Joystick axis index</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>value</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Axis value (range: -32768 to 32767)</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4231"
+></A
+><H2
+>Description</H2
+><P
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_JoyAxisEvent</SPAN
+> is a member of the <A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+> union and is used when an event of type <TT
+CLASS="LITERAL"
+>SDL_JOYAXISMOTION</TT
+> is reported.</P
+><P
+>A <TT
+CLASS="LITERAL"
+>SDL_JOYAXISMOTION</TT
+> event occurs when ever a user moves an axis on the joystick. The field <TT
+CLASS="STRUCTFIELD"
+><I
+>which</I
+></TT
+> is the index of the joystick that reported the event and <TT
+CLASS="STRUCTFIELD"
+><I
+>axis</I
+></TT
+> is the index of the axis (for a more detailed explaination see the <A
+HREF="joystick.html"
+>Joystick section</A
+>). <TT
+CLASS="STRUCTFIELD"
+><I
+>value</I
+></TT
+> is the current position of the axis.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4244"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+>,
+<A
+HREF="joystick.html"
+>Joystick Functions</A
+>,
+<A
+HREF="sdljoystickeventstate.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickEventState</TT
+></A
+>,
+<A
+HREF="sdljoystickgetaxis.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickGetAxis</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlmousebuttonevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdljoybuttonevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_MouseButtonEvent</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventstructures.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_JoyButtonEvent</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdljoyballevent.html b/distrib/sdl-1.2.15/docs/html/sdljoyballevent.html
new file mode 100644
index 0000000..4ab96fe
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdljoyballevent.html
@@ -0,0 +1,340 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_JoyBallEvent</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Event Structures."
+HREF="eventstructures.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_JoyHatEvent"
+HREF="sdljoyhatevent.html"><LINK
+REL="NEXT"
+TITLE="SDL_ResizeEvent"
+HREF="sdlresizeevent.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdljoyhatevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlresizeevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLJOYBALLEVENT"
+></A
+>SDL_JoyBallEvent</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4396"
+></A
+><H2
+>Name</H2
+>SDL_JoyBallEvent&nbsp;--&nbsp;Joystick trackball motion event structure</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4399"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ Uint8 type;
+ Uint8 which;
+ Uint8 ball;
+ Sint16 xrel, yrel;
+} SDL_JoyBallEvent;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4402"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN4404"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_JOYBALLMOTION</TT
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>which</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Joystick device index</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>ball</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Joystick trackball index</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>xrel</I
+></TT
+>, <TT
+CLASS="STRUCTFIELD"
+><I
+>yrel</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>The relative motion in the X/Y direction</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4425"
+></A
+><H2
+>Description</H2
+><P
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_JoyBallEvent</SPAN
+> is a member of the <A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+> union and is used when an event of type <TT
+CLASS="LITERAL"
+>SDL_JOYBALLMOTION</TT
+> is reported.</P
+><P
+>A <TT
+CLASS="LITERAL"
+>SDL_JOYBALLMOTION</TT
+> event occurs when a user moves a trackball on the joystick. The field <TT
+CLASS="STRUCTFIELD"
+><I
+>which</I
+></TT
+> is the index of the joystick that reported the event and <TT
+CLASS="STRUCTFIELD"
+><I
+>ball</I
+></TT
+> is the index of the trackball (for a more detailed explaination see the <A
+HREF="joystick.html"
+>Joystick section</A
+>). Trackballs only return relative motion, this is the change in position on the ball since it was last polled (last cycle of the event loop) and it is stored in <TT
+CLASS="STRUCTFIELD"
+><I
+>xrel</I
+></TT
+> and <TT
+CLASS="STRUCTFIELD"
+><I
+>yrel</I
+></TT
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4439"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+>,
+<A
+HREF="joystick.html"
+>Joystick Functions</A
+>,
+<A
+HREF="sdljoystickeventstate.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickEventState</TT
+></A
+>,
+<A
+HREF="sdljoystickgetball.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickGetBall</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdljoyhatevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlresizeevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_JoyHatEvent</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventstructures.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_ResizeEvent</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdljoybuttonevent.html b/distrib/sdl-1.2.15/docs/html/sdljoybuttonevent.html
new file mode 100644
index 0000000..d1d9c1e
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdljoybuttonevent.html
@@ -0,0 +1,351 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_JoyButtonEvent</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Event Structures."
+HREF="eventstructures.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_JoyAxisEvent"
+HREF="sdljoyaxisevent.html"><LINK
+REL="NEXT"
+TITLE="SDL_JoyHatEvent"
+HREF="sdljoyhatevent.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdljoyaxisevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdljoyhatevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLJOYBUTTONEVENT"
+></A
+>SDL_JoyButtonEvent</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4258"
+></A
+><H2
+>Name</H2
+>SDL_JoyButtonEvent&nbsp;--&nbsp;Joystick button event structure</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4261"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ Uint8 type;
+ Uint8 which;
+ Uint8 button;
+ Uint8 state;
+} SDL_JoyButtonEvent;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4264"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN4266"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_JOYBUTTONDOWN</TT
+> or <TT
+CLASS="LITERAL"
+>SDL_JOYBUTTONUP</TT
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>which</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Joystick device index</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>button</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Joystick button index</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>state</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_PRESSED</TT
+> or <TT
+CLASS="LITERAL"
+>SDL_RELEASED</TT
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4289"
+></A
+><H2
+>Description</H2
+><P
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_JoyButtonEvent</SPAN
+> is a member of the <A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+> union and is used when an event of type <TT
+CLASS="LITERAL"
+>SDL_JOYBUTTONDOWN</TT
+> or <TT
+CLASS="LITERAL"
+>SDL_JOYBUTTONUP</TT
+> is reported.</P
+><P
+>A <TT
+CLASS="LITERAL"
+>SDL_JOYBUTTONDOWN</TT
+> or <TT
+CLASS="LITERAL"
+>SDL_JOYBUTTONUP</TT
+> event occurs when ever a user presses or releases a button on a joystick. The field <TT
+CLASS="STRUCTFIELD"
+><I
+>which</I
+></TT
+> is the index of the joystick that reported the event and <TT
+CLASS="STRUCTFIELD"
+><I
+>button</I
+></TT
+> is the index of the button (for a more detailed explaination see the <A
+HREF="joystick.html"
+>Joystick section</A
+>). <TT
+CLASS="STRUCTFIELD"
+><I
+>state</I
+></TT
+> is the current state or the button which is either <TT
+CLASS="LITERAL"
+>SDL_PRESSED</TT
+> or <TT
+CLASS="LITERAL"
+>SDL_RELEASED</TT
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4306"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+>,
+<A
+HREF="joystick.html"
+>Joystick Functions</A
+>,
+<A
+HREF="sdljoystickeventstate.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickEventState</TT
+></A
+>,
+<A
+HREF="sdljoystickgetbutton.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickGetButton</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdljoyaxisevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdljoyhatevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_JoyAxisEvent</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventstructures.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_JoyHatEvent</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdljoyhatevent.html b/distrib/sdl-1.2.15/docs/html/sdljoyhatevent.html
new file mode 100644
index 0000000..5e115be
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdljoyhatevent.html
@@ -0,0 +1,413 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_JoyHatEvent</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Event Structures."
+HREF="eventstructures.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_JoyButtonEvent"
+HREF="sdljoybuttonevent.html"><LINK
+REL="NEXT"
+TITLE="SDL_JoyBallEvent"
+HREF="sdljoyballevent.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdljoybuttonevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdljoyballevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLJOYHATEVENT"
+></A
+>SDL_JoyHatEvent</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4320"
+></A
+><H2
+>Name</H2
+>SDL_JoyHatEvent&nbsp;--&nbsp;Joystick hat position change event structure</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4323"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ Uint8 type;
+ Uint8 which;
+ Uint8 hat;
+ Uint8 value;
+} SDL_JoyHatEvent;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4326"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN4328"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_JOY</TT
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>which</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Joystick device index</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>hat</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Joystick hat index</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>value</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Hat position</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4348"
+></A
+><H2
+>Description</H2
+><P
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_JoyHatEvent</SPAN
+> is a member of the <A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+> union and is used when an event of type <TT
+CLASS="LITERAL"
+>SDL_JOYHATMOTION</TT
+> is reported.</P
+><P
+>A <TT
+CLASS="LITERAL"
+>SDL_JOYHATMOTION</TT
+> event occurs when ever a user moves a hat on the joystick. The field <TT
+CLASS="STRUCTFIELD"
+><I
+>which</I
+></TT
+> is the index of the joystick that reported the event and <TT
+CLASS="STRUCTFIELD"
+><I
+>hat</I
+></TT
+> is the index of the hat (for a more detailed exlaination see the <A
+HREF="joystick.html"
+>Joystick section</A
+>). <TT
+CLASS="STRUCTFIELD"
+><I
+>value</I
+></TT
+> is the current position of the hat. It is a logically OR'd combination of the following values (whose meanings should be pretty obvious:) :</P
+><P
+></P
+><TABLE
+BORDER="0"
+><TBODY
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_CENTERED</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_UP</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_RIGHT</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_DOWN</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_LEFT</TT
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+><P
+>The following defines are also provided:</P
+><P
+></P
+><TABLE
+BORDER="0"
+><TBODY
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_RIGHTUP</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_RIGHTDOWN</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_LEFTUP</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_LEFTDOWN</TT
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4382"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+>,
+<A
+HREF="joystick.html"
+>Joystick Functions</A
+>,
+<A
+HREF="sdljoystickeventstate.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickEventState</TT
+></A
+>,
+<A
+HREF="sdljoystickgetball.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickGetHat</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdljoybuttonevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdljoyballevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_JoyButtonEvent</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventstructures.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_JoyBallEvent</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdljoystickclose.html b/distrib/sdl-1.2.15/docs/html/sdljoystickclose.html
new file mode 100644
index 0000000..efb44e0
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdljoystickclose.html
@@ -0,0 +1,223 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_JoystickClose</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Joystick"
+HREF="joystick.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_JoystickGetBall"
+HREF="sdljoystickgetball.html"><LINK
+REL="NEXT"
+TITLE="Audio"
+HREF="audio.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdljoystickgetball.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="audio.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLJOYSTICKCLOSE"
+></A
+>SDL_JoystickClose</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6469"
+></A
+><H2
+>Name</H2
+>SDL_JoystickClose&nbsp;--&nbsp;Closes a previously opened joystick</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN6472"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN6473"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_JoystickClose</B
+></CODE
+>(SDL_Joystick *joystick);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6479"
+></A
+><H2
+>Description</H2
+><P
+>Close a <TT
+CLASS="PARAMETER"
+><I
+>joystick</I
+></TT
+> that was previously opened with <A
+HREF="sdljoystickopen.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickOpen</TT
+></A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6485"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdljoystickopen.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickOpen</TT
+></A
+>,
+<A
+HREF="sdljoystickopened.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickOpened</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdljoystickgetball.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="audio.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_JoystickGetBall</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="joystick.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Audio</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdljoystickeventstate.html b/distrib/sdl-1.2.15/docs/html/sdljoystickeventstate.html
new file mode 100644
index 0000000..11b148a
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdljoystickeventstate.html
@@ -0,0 +1,290 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_JoystickEventState</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Event Functions."
+HREF="eventfunctions.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GetAppState"
+HREF="sdlgetappstate.html"><LINK
+REL="NEXT"
+TITLE="Joystick"
+HREF="joystick.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlgetappstate.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="joystick.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLJOYSTICKEVENTSTATE"
+></A
+>SDL_JoystickEventState</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5969"
+></A
+><H2
+>Name</H2
+>SDL_JoystickEventState&nbsp;--&nbsp;Enable/disable joystick event polling</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN5972"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN5973"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_JoystickEventState</B
+></CODE
+>(int state);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5979"
+></A
+><H2
+>Description</H2
+><P
+>This function is used to enable or disable joystick event processing. With joystick event processing disabled you will have to update joystick states with <A
+HREF="sdljoystickupdate.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickUpdate</TT
+></A
+> and read the joystick information manually. <TT
+CLASS="PARAMETER"
+><I
+>state</I
+></TT
+> is either <TT
+CLASS="LITERAL"
+>SDL_QUERY</TT
+>, <TT
+CLASS="LITERAL"
+>SDL_ENABLE</TT
+> or <TT
+CLASS="LITERAL"
+>SDL_IGNORE</TT
+>.</P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>Joystick event handling is prefered</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5990"
+></A
+><H2
+>Return Value</H2
+><P
+>If <TT
+CLASS="PARAMETER"
+><I
+>state</I
+></TT
+> is <TT
+CLASS="LITERAL"
+>SDL_QUERY</TT
+> then the current state is returned, otherwise the new processing <TT
+CLASS="PARAMETER"
+><I
+>state</I
+></TT
+> is returned.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5996"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="joystick.html"
+>SDL Joystick Functions</A
+>,
+<A
+HREF="sdljoystickupdate.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickUpdate</TT
+></A
+>,
+<A
+HREF="sdljoyaxisevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_JoyAxisEvent</SPAN
+></A
+>,
+<A
+HREF="sdljoyballevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_JoyBallEvent</SPAN
+></A
+>,
+<A
+HREF="sdljoybuttonevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_JoyButtonEvent</SPAN
+></A
+>,
+<A
+HREF="sdljoyhatevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_JoyHatEvent</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlgetappstate.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="joystick.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GetAppState</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Joystick</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdljoystickgetaxis.html b/distrib/sdl-1.2.15/docs/html/sdljoystickgetaxis.html
new file mode 100644
index 0000000..40a17b4
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdljoystickgetaxis.html
@@ -0,0 +1,271 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_JoystickGetAxis</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Joystick"
+HREF="joystick.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_JoystickUpdate"
+HREF="sdljoystickupdate.html"><LINK
+REL="NEXT"
+TITLE="SDL_JoystickGetHat"
+HREF="sdljoystickgethat.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdljoystickupdate.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdljoystickgethat.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLJOYSTICKGETAXIS"
+></A
+>SDL_JoystickGetAxis</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6320"
+></A
+><H2
+>Name</H2
+>SDL_JoystickGetAxis&nbsp;--&nbsp;Get the current state of an axis</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN6323"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN6324"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>Sint16 <B
+CLASS="FSFUNC"
+>SDL_JoystickGetAxis</B
+></CODE
+>(SDL_Joystick *joystick, int axis);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6330"
+></A
+><H2
+>Description</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickGetAxis</TT
+> returns the current state of the given <TT
+CLASS="PARAMETER"
+><I
+>axis</I
+></TT
+> on the given <TT
+CLASS="PARAMETER"
+><I
+>joystick</I
+></TT
+>.</P
+><P
+>On most modern joysticks the X axis is usually represented by <TT
+CLASS="PARAMETER"
+><I
+>axis</I
+></TT
+> 0 and the Y axis by <TT
+CLASS="PARAMETER"
+><I
+>axis</I
+></TT
+> 1. The value returned by <TT
+CLASS="FUNCTION"
+>SDL_JoystickGetAxis</TT
+> is a signed integer (-32768 to 32768) representing the current position of the <TT
+CLASS="PARAMETER"
+><I
+>axis</I
+></TT
+>, it maybe necessary to impose certain tolerances on these values to account for jitter. It is worth noting that some joysticks use axes 2 and 3 for extra buttons.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6341"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns a 16-bit signed integer representing the current position of the <TT
+CLASS="PARAMETER"
+><I
+>axis</I
+></TT
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6345"
+></A
+><H2
+>Examples</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>Sint16 x_move, y_move;
+SDL_Joystick *joy1;
+.
+.
+x_move=SDL_JoystickGetAxis(joy1, 0);
+y_move=SDL_JoystickGetAxis(joy1, 1);</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6349"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdljoysticknumaxes.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickNumAxes</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdljoystickupdate.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdljoystickgethat.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_JoystickUpdate</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="joystick.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_JoystickGetHat</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdljoystickgetball.html b/distrib/sdl-1.2.15/docs/html/sdljoystickgetball.html
new file mode 100644
index 0000000..0da252a
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdljoystickgetball.html
@@ -0,0 +1,262 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_JoystickGetBall</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Joystick"
+HREF="joystick.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_JoystickGetButton"
+HREF="sdljoystickgetbutton.html"><LINK
+REL="NEXT"
+TITLE="SDL_JoystickClose"
+HREF="sdljoystickclose.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdljoystickgetbutton.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdljoystickclose.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLJOYSTICKGETBALL"
+></A
+>SDL_JoystickGetBall</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6433"
+></A
+><H2
+>Name</H2
+>SDL_JoystickGetBall&nbsp;--&nbsp;Get relative trackball motion</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN6436"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN6437"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_JoystickGetBall</B
+></CODE
+>(SDL_Joystick *joystick, int ball, int *dx, int *dy);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6443"
+></A
+><H2
+>Description</H2
+><P
+>Get the <TT
+CLASS="PARAMETER"
+><I
+>ball</I
+></TT
+> axis change.</P
+><P
+>Trackballs can only return relative motion since the last call to <TT
+CLASS="FUNCTION"
+>SDL_JoystickGetBall</TT
+>, these motion deltas a placed into <TT
+CLASS="PARAMETER"
+><I
+>dx</I
+></TT
+> and <TT
+CLASS="PARAMETER"
+><I
+>dy</I
+></TT
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6451"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> on success or <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> on failure</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6456"
+></A
+><H2
+>Examples</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>int delta_x, delta_y;
+SDL_Joystick *joy;
+.
+.
+.
+SDL_JoystickUpdate();
+if(SDL_JoystickGetBall(joy, 0, &#38;delta_x, &#38;delta_y)==-1)
+ printf("TrackBall Read Error!\n");
+printf("Trackball Delta- X:%d, Y:%d\n", delta_x, delta_y);</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6460"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdljoysticknumballs.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickNumBalls</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdljoystickgetbutton.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdljoystickclose.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_JoystickGetButton</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="joystick.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_JoystickClose</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdljoystickgetbutton.html b/distrib/sdl-1.2.15/docs/html/sdljoystickgetbutton.html
new file mode 100644
index 0000000..680e356
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdljoystickgetbutton.html
@@ -0,0 +1,231 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_JoystickGetButton</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Joystick"
+HREF="joystick.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_JoystickGetHat"
+HREF="sdljoystickgethat.html"><LINK
+REL="NEXT"
+TITLE="SDL_JoystickGetBall"
+HREF="sdljoystickgetball.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdljoystickgethat.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdljoystickgetball.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLJOYSTICKGETBUTTON"
+></A
+>SDL_JoystickGetButton</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6404"
+></A
+><H2
+>Name</H2
+>SDL_JoystickGetButton&nbsp;--&nbsp;Get the current state of a given button on a given joystick</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN6407"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN6408"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>Uint8 <B
+CLASS="FSFUNC"
+>SDL_JoystickGetButton</B
+></CODE
+>(SDL_Joystick *joystick, int button);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6414"
+></A
+><H2
+>Description</H2
+><P
+>SDL_JoystickGetButton returns the current state of the given <TT
+CLASS="PARAMETER"
+><I
+>button</I
+></TT
+> on the given <TT
+CLASS="PARAMETER"
+><I
+>joystick</I
+></TT
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6419"
+></A
+><H2
+>Return Value</H2
+><P
+><SPAN
+CLASS="RETURNVALUE"
+>1</SPAN
+> if the button is pressed. Otherwise, <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6424"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdljoysticknumbuttons.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickNumButtons</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdljoystickgethat.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdljoystickgetball.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_JoystickGetHat</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="joystick.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_JoystickGetBall</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdljoystickgethat.html b/distrib/sdl-1.2.15/docs/html/sdljoystickgethat.html
new file mode 100644
index 0000000..c638abb
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdljoystickgethat.html
@@ -0,0 +1,297 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_JoystickGetHat</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Joystick"
+HREF="joystick.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_JoystickGetAxis"
+HREF="sdljoystickgetaxis.html"><LINK
+REL="NEXT"
+TITLE="SDL_JoystickGetButton"
+HREF="sdljoystickgetbutton.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdljoystickgetaxis.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdljoystickgetbutton.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLJOYSTICKGETHAT"
+></A
+>SDL_JoystickGetHat</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6358"
+></A
+><H2
+>Name</H2
+>SDL_JoystickGetHat&nbsp;--&nbsp;Get the current state of a joystick hat</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN6361"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN6362"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>Uint8 <B
+CLASS="FSFUNC"
+>SDL_JoystickGetHat</B
+></CODE
+>(SDL_Joystick *joystick, int hat);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6368"
+></A
+><H2
+>Description</H2
+><P
+>SDL_JoystickGetHat returns the current state of the given <TT
+CLASS="PARAMETER"
+><I
+>hat</I
+></TT
+> on the given <TT
+CLASS="PARAMETER"
+><I
+>joystick</I
+></TT
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6373"
+></A
+><H2
+>Return Value</H2
+><P
+>The current state is returned as a Uint8 which is defined as an OR'd combination of one or more of the following</P
+><P
+></P
+><TABLE
+BORDER="0"
+><TBODY
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_CENTERED</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_UP</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_RIGHT</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_DOWN</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_LEFT</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_RIGHTUP</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_RIGHTDOWN</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_LEFTUP</TT
+></TD
+></TR
+><TR
+><TD
+><TT
+CLASS="LITERAL"
+>SDL_HAT_LEFTDOWN</TT
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6395"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdljoysticknumhats.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickNumHats</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdljoystickgetaxis.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdljoystickgetbutton.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_JoystickGetAxis</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="joystick.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_JoystickGetButton</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdljoystickindex.html b/distrib/sdl-1.2.15/docs/html/sdljoystickindex.html
new file mode 100644
index 0000000..868a75a
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdljoystickindex.html
@@ -0,0 +1,218 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_JoystickIndex</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Joystick"
+HREF="joystick.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_JoystickOpened"
+HREF="sdljoystickopened.html"><LINK
+REL="NEXT"
+TITLE="SDL_JoystickNumAxes"
+HREF="sdljoysticknumaxes.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdljoystickopened.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdljoysticknumaxes.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLJOYSTICKINDEX"
+></A
+>SDL_JoystickIndex</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6158"
+></A
+><H2
+>Name</H2
+>SDL_JoystickIndex&nbsp;--&nbsp;Get the index of an SDL_Joystick.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN6161"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN6162"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_JoystickIndex</B
+></CODE
+>(SDL_Joystick *joystick);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6168"
+></A
+><H2
+>Description</H2
+><P
+>Returns the index of a given <SPAN
+CLASS="STRUCTNAME"
+>SDL_Joystick</SPAN
+> structure.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6172"
+></A
+><H2
+>Return Value</H2
+><P
+>Index number of the joystick.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6175"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdljoystickopen.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickOpen</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdljoystickopened.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdljoysticknumaxes.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_JoystickOpened</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="joystick.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_JoystickNumAxes</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdljoystickname.html b/distrib/sdl-1.2.15/docs/html/sdljoystickname.html
new file mode 100644
index 0000000..0add817
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdljoystickname.html
@@ -0,0 +1,238 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_JoystickName</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Joystick"
+HREF="joystick.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_NumJoysticks"
+HREF="sdlnumjoysticks.html"><LINK
+REL="NEXT"
+TITLE="SDL_JoystickOpen"
+HREF="sdljoystickopen.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlnumjoysticks.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdljoystickopen.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLJOYSTICKNAME"
+></A
+>SDL_JoystickName</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6066"
+></A
+><H2
+>Name</H2
+>SDL_JoystickName&nbsp;--&nbsp;Get joystick name.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN6069"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN6070"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>const char *<B
+CLASS="FSFUNC"
+>SDL_JoystickName</B
+></CODE
+>(int index);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6076"
+></A
+><H2
+>Description</H2
+><P
+>Get the implementation dependent name of joystick. The <TT
+CLASS="PARAMETER"
+><I
+>index</I
+></TT
+> parameter refers to the N'th joystick on the system.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6080"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns a char pointer to the joystick name.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6083"
+></A
+><H2
+>Examples</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>/* Print the names of all attached joysticks */
+int num_joy, i;
+num_joy=SDL_NumJoysticks();
+printf("%d joysticks found\n", num_joy);
+for(i=0;i&#60;num_joy;i++)
+ printf("%s\n", SDL_JoystickName(i));</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6087"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdljoystickopen.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickOpen</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlnumjoysticks.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdljoystickopen.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_NumJoysticks</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="joystick.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_JoystickOpen</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdljoysticknumaxes.html b/distrib/sdl-1.2.15/docs/html/sdljoysticknumaxes.html
new file mode 100644
index 0000000..53b67f5
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdljoysticknumaxes.html
@@ -0,0 +1,225 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_JoystickNumAxes</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Joystick"
+HREF="joystick.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_JoystickIndex"
+HREF="sdljoystickindex.html"><LINK
+REL="NEXT"
+TITLE="SDL_JoystickNumBalls"
+HREF="sdljoysticknumballs.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdljoystickindex.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdljoysticknumballs.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLJOYSTICKNUMAXES"
+></A
+>SDL_JoystickNumAxes</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6184"
+></A
+><H2
+>Name</H2
+>SDL_JoystickNumAxes&nbsp;--&nbsp;Get the number of joystick axes</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN6187"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN6188"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_JoystickNumAxes</B
+></CODE
+>(SDL_Joystick *joystick);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6194"
+></A
+><H2
+>Description</H2
+><P
+>Return the number of axes available from a previously opened <SPAN
+CLASS="STRUCTNAME"
+>SDL_Joystick</SPAN
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6198"
+></A
+><H2
+>Return Value</H2
+><P
+>Number of axes.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6201"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdljoystickgetaxis.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickGetAxis</TT
+></A
+>,
+<A
+HREF="sdljoystickopen.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickOpen</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdljoystickindex.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdljoysticknumballs.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_JoystickIndex</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="joystick.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_JoystickNumBalls</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdljoysticknumballs.html b/distrib/sdl-1.2.15/docs/html/sdljoysticknumballs.html
new file mode 100644
index 0000000..0a8405d
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdljoysticknumballs.html
@@ -0,0 +1,225 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_JoystickNumBalls</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Joystick"
+HREF="joystick.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_JoystickNumAxes"
+HREF="sdljoysticknumaxes.html"><LINK
+REL="NEXT"
+TITLE="SDL_JoystickNumHats"
+HREF="sdljoysticknumhats.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdljoysticknumaxes.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdljoysticknumhats.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLJOYSTICKNUMBALLS"
+></A
+>SDL_JoystickNumBalls</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6212"
+></A
+><H2
+>Name</H2
+>SDL_JoystickNumBalls&nbsp;--&nbsp;Get the number of joystick trackballs</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN6215"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN6216"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_JoystickNumBalls</B
+></CODE
+>(SDL_Joystick *joystick);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6222"
+></A
+><H2
+>Description</H2
+><P
+>Return the number of trackballs available from a previously opened <SPAN
+CLASS="STRUCTNAME"
+>SDL_Joystick</SPAN
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6226"
+></A
+><H2
+>Return Value</H2
+><P
+>Number of trackballs.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6229"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdljoystickgetball.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickGetBall</TT
+></A
+>,
+<A
+HREF="sdljoystickopen.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickOpen</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdljoysticknumaxes.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdljoysticknumhats.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_JoystickNumAxes</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="joystick.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_JoystickNumHats</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdljoysticknumbuttons.html b/distrib/sdl-1.2.15/docs/html/sdljoysticknumbuttons.html
new file mode 100644
index 0000000..625b893
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdljoysticknumbuttons.html
@@ -0,0 +1,225 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_JoystickNumButtons</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Joystick"
+HREF="joystick.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_JoystickNumHats"
+HREF="sdljoysticknumhats.html"><LINK
+REL="NEXT"
+TITLE="SDL_JoystickUpdate"
+HREF="sdljoystickupdate.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdljoysticknumhats.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdljoystickupdate.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLJOYSTICKNUMBUTTONS"
+></A
+>SDL_JoystickNumButtons</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6268"
+></A
+><H2
+>Name</H2
+>SDL_JoystickNumButtons&nbsp;--&nbsp;Get the number of joysitck buttons</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN6271"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN6272"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_JoystickNumButtons</B
+></CODE
+>(SDL_Joystick *joystick);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6278"
+></A
+><H2
+>Description</H2
+><P
+>Return the number of buttons available from a previously opened <SPAN
+CLASS="STRUCTNAME"
+>SDL_Joystick</SPAN
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6282"
+></A
+><H2
+>Return Value</H2
+><P
+>Number of buttons.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6285"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdljoystickgetbutton.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickGetButton</TT
+></A
+>,
+<A
+HREF="sdljoystickopen.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickOpen</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdljoysticknumhats.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdljoystickupdate.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_JoystickNumHats</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="joystick.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_JoystickUpdate</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdljoysticknumhats.html b/distrib/sdl-1.2.15/docs/html/sdljoysticknumhats.html
new file mode 100644
index 0000000..ed53235
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdljoysticknumhats.html
@@ -0,0 +1,225 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_JoystickNumHats</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Joystick"
+HREF="joystick.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_JoystickNumBalls"
+HREF="sdljoysticknumballs.html"><LINK
+REL="NEXT"
+TITLE="SDL_JoystickNumButtons"
+HREF="sdljoysticknumbuttons.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdljoysticknumballs.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdljoysticknumbuttons.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLJOYSTICKNUMHATS"
+></A
+>SDL_JoystickNumHats</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6240"
+></A
+><H2
+>Name</H2
+>SDL_JoystickNumHats&nbsp;--&nbsp;Get the number of joystick hats</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN6243"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN6244"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_JoystickNumHats</B
+></CODE
+>(SDL_Joystick *joystick);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6250"
+></A
+><H2
+>Description</H2
+><P
+>Return the number of hats available from a previously opened <SPAN
+CLASS="STRUCTNAME"
+>SDL_Joystick</SPAN
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6254"
+></A
+><H2
+>Return Value</H2
+><P
+>Number of hats.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6257"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdljoystickgethat.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickGetHat</TT
+></A
+>,
+<A
+HREF="sdljoystickopen.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickOpen</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdljoysticknumballs.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdljoysticknumbuttons.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_JoystickNumBalls</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="joystick.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_JoystickNumButtons</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdljoystickopen.html b/distrib/sdl-1.2.15/docs/html/sdljoystickopen.html
new file mode 100644
index 0000000..e608c43
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdljoystickopen.html
@@ -0,0 +1,259 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_JoystickOpen</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Joystick"
+HREF="joystick.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_JoystickName"
+HREF="sdljoystickname.html"><LINK
+REL="NEXT"
+TITLE="SDL_JoystickOpened"
+HREF="sdljoystickopened.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdljoystickname.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdljoystickopened.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLJOYSTICKOPEN"
+></A
+>SDL_JoystickOpen</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6096"
+></A
+><H2
+>Name</H2
+>SDL_JoystickOpen&nbsp;--&nbsp;Opens a joystick for use.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN6099"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN6100"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_Joystick *<B
+CLASS="FSFUNC"
+>SDL_JoystickOpen</B
+></CODE
+>(int index);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6106"
+></A
+><H2
+>Description</H2
+><P
+>Opens a joystick for use within SDL. The <TT
+CLASS="PARAMETER"
+><I
+>index</I
+></TT
+> refers to the N'th joystick in the system. A joystick must be opened before it game be used.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6110"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns a <SPAN
+CLASS="STRUCTNAME"
+>SDL_Joystick</SPAN
+> structure on success. <SPAN
+CLASS="RETURNVALUE"
+>NULL</SPAN
+> on failure.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6115"
+></A
+><H2
+>Examples</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>SDL_Joystick *joy;
+// Check for joystick
+if(SDL_NumJoysticks()&#62;0){
+ // Open joystick
+ joy=SDL_JoystickOpen(0);
+
+ if(joy)
+ {
+ printf("Opened Joystick 0\n");
+ printf("Name: %s\n", SDL_JoystickName(0));
+ printf("Number of Axes: %d\n", SDL_JoystickNumAxes(joy));
+ printf("Number of Buttons: %d\n", SDL_JoystickNumButtons(joy));
+ printf("Number of Balls: %d\n", SDL_JoystickNumBalls(joy));
+ }
+ else
+ printf("Couldn't open Joystick 0\n");
+
+ // Close if opened
+ if(SDL_JoystickOpened(0))
+ SDL_JoystickClose(joy);
+}</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6119"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdljoystickclose.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickClose</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdljoystickname.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdljoystickopened.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_JoystickName</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="joystick.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_JoystickOpened</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdljoystickopened.html b/distrib/sdl-1.2.15/docs/html/sdljoystickopened.html
new file mode 100644
index 0000000..5275a09
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdljoystickopened.html
@@ -0,0 +1,233 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_JoystickOpened</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Joystick"
+HREF="joystick.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_JoystickOpen"
+HREF="sdljoystickopen.html"><LINK
+REL="NEXT"
+TITLE="SDL_JoystickIndex"
+HREF="sdljoystickindex.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdljoystickopen.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdljoystickindex.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLJOYSTICKOPENED"
+></A
+>SDL_JoystickOpened</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6128"
+></A
+><H2
+>Name</H2
+>SDL_JoystickOpened&nbsp;--&nbsp;Determine if a joystick has been opened</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN6131"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN6132"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_JoystickOpened</B
+></CODE
+>(int index);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6138"
+></A
+><H2
+>Description</H2
+><P
+>Determines whether a joystick has already been opened within the application. <TT
+CLASS="PARAMETER"
+><I
+>index</I
+></TT
+> refers to the N'th joystick on the system.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6142"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>1</SPAN
+> if the joystick has been opened, or <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> if it has not.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6147"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdljoystickopen.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickOpen</TT
+></A
+>,
+<A
+HREF="sdljoystickclose.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickClose</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdljoystickopen.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdljoystickindex.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_JoystickOpen</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="joystick.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_JoystickIndex</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdljoystickupdate.html b/distrib/sdl-1.2.15/docs/html/sdljoystickupdate.html
new file mode 100644
index 0000000..0cb37dc
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdljoystickupdate.html
@@ -0,0 +1,211 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_JoystickUpdate</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Joystick"
+HREF="joystick.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_JoystickNumButtons"
+HREF="sdljoysticknumbuttons.html"><LINK
+REL="NEXT"
+TITLE="SDL_JoystickGetAxis"
+HREF="sdljoystickgetaxis.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdljoysticknumbuttons.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdljoystickgetaxis.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLJOYSTICKUPDATE"
+></A
+>SDL_JoystickUpdate</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6296"
+></A
+><H2
+>Name</H2
+>SDL_JoystickUpdate&nbsp;--&nbsp;Updates the state of all joysticks</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN6299"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN6300"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_JoystickUpdate</B
+></CODE
+>(void);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6306"
+></A
+><H2
+>Description</H2
+><P
+>Updates the state(position, buttons, etc.) of all open joysticks. If joystick events have been enabled with <A
+HREF="sdljoystickeventstate.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickEventState</TT
+></A
+> then this is called automatically in the event loop.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6311"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdljoystickeventstate.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickEventState</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdljoysticknumbuttons.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdljoystickgetaxis.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_JoystickNumButtons</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="joystick.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_JoystickGetAxis</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlkey.html b/distrib/sdl-1.2.15/docs/html/sdlkey.html
new file mode 100644
index 0000000..6591884
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlkey.html
@@ -0,0 +1,2630 @@
+<HTML
+><HEAD
+><TITLE
+>SDLKey</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Event Structures."
+HREF="eventstructures.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_keysym"
+HREF="sdlkeysym.html"><LINK
+REL="NEXT"
+TITLE="Event Functions."
+HREF="eventfunctions.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlkeysym.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLKEY"
+></A
+>SDLKey</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4714"
+></A
+><H2
+>Name</H2
+>SDLKey&nbsp;--&nbsp;Keysym definitions.</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4717"
+></A
+><H2
+>Description</H2
+><P
+>&#13;<DIV
+CLASS="TABLE"
+><A
+NAME="AEN4720"
+></A
+><P
+><B
+>Table 8-1. SDL Keysym definitions</B
+></P
+><TABLE
+BORDER="1"
+CLASS="CALSTABLE"
+><THEAD
+><TR
+><TH
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLKey</TH
+><TH
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>ASCII value</TH
+><TH
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>Common name</TH
+></TR
+></THEAD
+><TBODY
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_BACKSPACE</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'\b'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>backspace</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_TAB</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'\t'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>tab</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_CLEAR</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>clear</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_RETURN</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'\r'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>return</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_PAUSE</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>pause</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_ESCAPE</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'^['</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>escape</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_SPACE</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>' '</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>space</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_EXCLAIM</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'!'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>exclaim</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_QUOTEDBL</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'"'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>quotedbl</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_HASH</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'#'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>hash</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_DOLLAR</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'$'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>dollar</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_AMPERSAND</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'&#38;'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>ampersand</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_QUOTE</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'''</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>quote</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_LEFTPAREN</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'('</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>left parenthesis</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_RIGHTPAREN</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>')'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>right parenthesis</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_ASTERISK</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'*'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>asterisk</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_PLUS</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'+'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>plus sign</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_COMMA</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>','</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>comma</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_MINUS</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'-'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>minus sign</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_PERIOD</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'.'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>period</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_SLASH</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'/'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>forward slash</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_0</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'0'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>0</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_1</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'1'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>1</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_2</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'2'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>2</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_3</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'3'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>3</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_4</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'4'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>4</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_5</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'5'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>5</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_6</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'6'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>6</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_7</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'7'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>7</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_8</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'8'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>8</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_9</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'9'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>9</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_COLON</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>':'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>colon</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_SEMICOLON</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>';'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>semicolon</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_LESS</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'&lt;'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>less-than sign</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_EQUALS</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'='</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>equals sign</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_GREATER</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'&gt;'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>greater-than sign</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_QUESTION</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'?'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>question mark</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_AT</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'@'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>at</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_LEFTBRACKET</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'['</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>left bracket</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_BACKSLASH</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'\'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>backslash</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_RIGHTBRACKET</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>']'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>right bracket</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_CARET</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'^'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>caret</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_UNDERSCORE</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'_'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>underscore</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_BACKQUOTE</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'`'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>grave</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_a</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'a'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>a</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_b</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'b'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>b</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_c</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'c'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>c</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_d</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'d'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>d</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_e</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'e'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>e</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_f</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'f'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>f</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_g</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'g'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>g</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_h</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'h'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>h</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_i</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'i'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>i</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_j</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'j'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>j</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_k</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'k'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>k</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_l</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'l'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>l</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_m</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'m'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>m</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_n</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'n'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>n</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_o</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'o'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>o</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_p</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'p'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>p</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_q</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'q'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>q</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_r</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'r'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>r</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_s</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'s'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>s</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_t</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'t'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>t</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_u</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'u'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>u</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_v</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'v'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>v</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_w</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'w'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>w</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_x</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'x'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>x</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_y</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'y'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>y</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_z</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'z'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>z</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_DELETE</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'^?'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>delete</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_KP0</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>keypad 0</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_KP1</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>keypad 1</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_KP2</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>keypad 2</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_KP3</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>keypad 3</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_KP4</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>keypad 4</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_KP5</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>keypad 5</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_KP6</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>keypad 6</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_KP7</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>keypad 7</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_KP8</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>keypad 8</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_KP9</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>keypad 9</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_KP_PERIOD</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'.'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>keypad period</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_KP_DIVIDE</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'/'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>keypad divide</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_KP_MULTIPLY</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'*'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>keypad multiply</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_KP_MINUS</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'-'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>keypad minus</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_KP_PLUS</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'+'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>keypad plus</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_KP_ENTER</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'\r'</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>keypad enter</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_KP_EQUALS</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>'='</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>keypad equals</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_UP</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>up arrow</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_DOWN</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>down arrow</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_RIGHT</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>right arrow</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_LEFT</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>left arrow</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_INSERT</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>insert</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_HOME</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>home</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_END</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>end</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_PAGEUP</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>page up</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_PAGEDOWN</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>page down</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_F1</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>F1</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_F2</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>F2</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_F3</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>F3</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_F4</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>F4</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_F5</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>F5</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_F6</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>F6</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_F7</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>F7</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_F8</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>F8</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_F9</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>F9</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_F10</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>F10</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_F11</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>F11</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_F12</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>F12</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_F13</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>F13</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_F14</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>F14</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_F15</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>F15</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_NUMLOCK</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>numlock</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_CAPSLOCK</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>capslock</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_SCROLLOCK</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>scrollock</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_RSHIFT</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>right shift</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_LSHIFT</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>left shift</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_RCTRL</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>right ctrl</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_LCTRL</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>left ctrl</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_RALT</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>right alt</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_LALT</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>left alt</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_RMETA</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>right meta</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_LMETA</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>left meta</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_LSUPER</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>left windows key</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_RSUPER</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>right windows key</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_MODE</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>mode shift</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_HELP</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>help</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_PRINT</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>print-screen</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_SYSREQ</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SysRq</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_BREAK</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>break</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_MENU</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>menu</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_POWER</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>power</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDLK_EURO</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>&nbsp;</TD
+><TD
+WIDTH="33%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>euro</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+>
+
+<DIV
+CLASS="TABLE"
+><A
+NAME="SDLMOD"
+></A
+><P
+><B
+>Table 8-2. SDL modifier definitions</B
+></P
+><TABLE
+BORDER="1"
+CLASS="CALSTABLE"
+><THEAD
+><TR
+><TH
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDL Modifier</TH
+><TH
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>Meaning</TH
+></TR
+></THEAD
+><TBODY
+><TR
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>KMOD_NONE</TD
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>No modifiers applicable</TD
+></TR
+><TR
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>KMOD_NUM</TD
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>Numlock is down</TD
+></TR
+><TR
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>KMOD_CAPS</TD
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>Capslock is down</TD
+></TR
+><TR
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>KMOD_LCTRL</TD
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>Left Control is down</TD
+></TR
+><TR
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>KMOD_RCTRL</TD
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>Right Control is down</TD
+></TR
+><TR
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>KMOD_RSHIFT</TD
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>Right Shift is down</TD
+></TR
+><TR
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>KMOD_LSHIFT</TD
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>Left Shift is down</TD
+></TR
+><TR
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>KMOD_RALT</TD
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>Right Alt is down</TD
+></TR
+><TR
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>KMOD_LALT</TD
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>Left Alt is down</TD
+></TR
+><TR
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>KMOD_CTRL</TD
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>A Control key is down</TD
+></TR
+><TR
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>KMOD_SHIFT</TD
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>A Shift key is down</TD
+></TR
+><TR
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>KMOD_ALT</TD
+><TD
+WIDTH="50%"
+ALIGN="LEFT"
+VALIGN="TOP"
+>An Alt key is down</TD
+></TR
+></TBODY
+></TABLE
+></DIV
+>&#13;</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlkeysym.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_keysym</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventstructures.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Event Functions.</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlkeyboardevent.html b/distrib/sdl-1.2.15/docs/html/sdlkeyboardevent.html
new file mode 100644
index 0000000..1a6962c
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlkeyboardevent.html
@@ -0,0 +1,375 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_KeyboardEvent</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Event Structures."
+HREF="eventstructures.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_ActiveEvent"
+HREF="sdlactiveevent.html"><LINK
+REL="NEXT"
+TITLE="SDL_MouseMotionEvent"
+HREF="sdlmousemotionevent.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlactiveevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlmousemotionevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLKEYBOARDEVENT"
+></A
+>SDL_KeyboardEvent</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4011"
+></A
+><H2
+>Name</H2
+>SDL_KeyboardEvent&nbsp;--&nbsp;Keyboard event structure</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4014"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ Uint8 type;
+ Uint8 state;
+ SDL_keysym keysym;
+} SDL_KeyboardEvent;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4017"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN4019"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_KEYDOWN</TT
+> or <TT
+CLASS="LITERAL"
+>SDL_KEYUP</TT
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>state</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_PRESSED</TT
+> or <TT
+CLASS="LITERAL"
+>SDL_RELEASED</TT
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>keysym</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Contains key press information</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4038"
+></A
+><H2
+>Description</H2
+><P
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_KeyboardEvent</SPAN
+> is a member of the <A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+> union and is used when an event of type <TT
+CLASS="LITERAL"
+>SDL_KEYDOWN</TT
+> or <TT
+CLASS="LITERAL"
+>SDL_KEYUP</TT
+> is reported.</P
+><P
+>The <TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+> and <TT
+CLASS="STRUCTFIELD"
+><I
+>state</I
+></TT
+> actually report the same information, they just use different values to do it! A keyboard event occurs when a key is released (<TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+>=<TT
+CLASS="LITERAL"
+>SDK_KEYUP</TT
+> or <TT
+CLASS="STRUCTFIELD"
+><I
+>state</I
+></TT
+>=<TT
+CLASS="LITERAL"
+>SDL_RELEASED</TT
+>) and when a key is pressed (<TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+>=<TT
+CLASS="LITERAL"
+>SDL_KEYDOWN</TT
+> or <TT
+CLASS="STRUCTFIELD"
+><I
+>state</I
+></TT
+>=<TT
+CLASS="LITERAL"
+>SDL_PRESSED</TT
+>). The information on what key was pressed or released is in the <A
+HREF="sdlkeysym.html"
+><SPAN
+CLASS="STRUCTNAME"
+>keysym</SPAN
+></A
+> structure.</P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>Repeating <TT
+CLASS="LITERAL"
+>SDL_KEYDOWN</TT
+> events will occur if key repeat is enabled (see <A
+HREF="sdlenablekeyrepeat.html"
+><TT
+CLASS="FUNCTION"
+>SDL_EnableKeyRepeat</TT
+></A
+>).</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4064"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+>,
+<A
+HREF="sdlkeysym.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_keysym</SPAN
+></A
+>,
+<A
+HREF="sdlenablekeyrepeat.html"
+><TT
+CLASS="FUNCTION"
+>SDL_EnableKeyRepeat</TT
+></A
+>,
+<A
+HREF="sdlenableunicode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_EnableUNICODE</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlactiveevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlmousemotionevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_ActiveEvent</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventstructures.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_MouseMotionEvent</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlkeysym.html b/distrib/sdl-1.2.15/docs/html/sdlkeysym.html
new file mode 100644
index 0000000..7a22f79
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlkeysym.html
@@ -0,0 +1,355 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_keysym</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Event Structures."
+HREF="eventstructures.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_QuitEvent"
+HREF="sdlquitevent.html"><LINK
+REL="NEXT"
+TITLE="SDLKey"
+HREF="sdlkey.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlquitevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlkey.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLKEYSYM"
+></A
+>SDL_keysym</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4659"
+></A
+><H2
+>Name</H2
+>SDL_keysym&nbsp;--&nbsp;Keysym structure</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4662"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ Uint8 scancode;
+ SDLKey sym;
+ SDLMod mod;
+ Uint16 unicode;
+} SDL_keysym;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4665"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN4667"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>scancode</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Hardware specific scancode</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>sym</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDL virtual keysym</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>mod</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Current key modifiers</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>unicode</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Translated character</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4686"
+></A
+><H2
+>Description</H2
+><P
+>The <SPAN
+CLASS="STRUCTNAME"
+>SDL_keysym</SPAN
+> structure is used by reporting key presses and releases since it is a part of the <A
+HREF="sdlkeyboardevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_KeyboardEvent</SPAN
+></A
+>.</P
+><P
+>The <TT
+CLASS="STRUCTFIELD"
+><I
+>scancode</I
+></TT
+> field should generally be left alone, it is the hardware dependent scancode returned by the keyboard. The <TT
+CLASS="STRUCTFIELD"
+><I
+>sym</I
+></TT
+> field is extremely useful. It is the SDL-defined value of the key (see <A
+HREF="sdlkey.html"
+>SDL Key Syms</A
+>. This field is very useful when you are checking for certain key presses, like so:
+<PRE
+CLASS="PROGRAMLISTING"
+>.
+.
+while(SDL_PollEvent(&#38;event)){
+ switch(event.type){
+ case SDL_KEYDOWN:
+ if(event.key.keysym.sym==SDLK_LEFT)
+ move_left();
+ break;
+ .
+ .
+ .
+ }
+}
+.
+.</PRE
+>
+<TT
+CLASS="STRUCTFIELD"
+><I
+>mod</I
+></TT
+> stores the current state of the keyboard modifiers as explained in <A
+HREF="sdlgetmodstate.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetModState</TT
+></A
+>. The <TT
+CLASS="STRUCTFIELD"
+><I
+>unicode</I
+></TT
+> is only used when UNICODE translation is enabled with <A
+HREF="sdlenableunicode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_EnableUNICODE</TT
+></A
+>. If <TT
+CLASS="STRUCTFIELD"
+><I
+>unicode</I
+></TT
+> is non-zero then this a the UNICODE character corresponding to the keypress. If the high 9 bits of the character are 0, then this maps to the equivalent ASCII character:
+<PRE
+CLASS="PROGRAMLISTING"
+>char ch;
+if ( (keysym.unicode &#38; 0xFF80) == 0 ) {
+ ch = keysym.unicode &#38; 0x7F;
+}
+else {
+ printf("An International Character.\n");
+}</PRE
+>
+UNICODE translation does have a slight overhead so don't enable it unless its needed.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4705"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlkey.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDLKey</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlquitevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlkey.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_QuitEvent</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventstructures.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDLKey</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlkillthread.html b/distrib/sdl-1.2.15/docs/html/sdlkillthread.html
new file mode 100644
index 0000000..2ce7b9b
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlkillthread.html
@@ -0,0 +1,223 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_KillThread</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_WaitThread"
+HREF="sdlwaitthread.html"><LINK
+REL="NEXT"
+TITLE="SDL_CreateMutex"
+HREF="sdlcreatemutex.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlwaitthread.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcreatemutex.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLKILLTHREAD"
+></A
+>SDL_KillThread</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7794"
+></A
+><H2
+>Name</H2
+>SDL_KillThread&nbsp;--&nbsp;Gracelessly terminates the thread.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7797"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7798"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_KillThread</B
+></CODE
+>(SDL_Thread *thread);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7804"
+></A
+><H2
+>Description</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_KillThread</TT
+> gracelessly terminates the thread
+associated with <TT
+CLASS="PARAMETER"
+><I
+>thread</I
+></TT
+>. If possible, you should
+use some other form of IPC to signal the thread to quit.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7809"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcreatethread.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateThread</TT
+></A
+>,
+<A
+HREF="sdlwaitthread.html"
+><TT
+CLASS="FUNCTION"
+>SDL_WaitThread</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlwaitthread.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcreatemutex.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_WaitThread</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CreateMutex</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdllistmodes.html b/distrib/sdl-1.2.15/docs/html/sdllistmodes.html
new file mode 100644
index 0000000..ee7bc0e
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdllistmodes.html
@@ -0,0 +1,310 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_ListModes</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_VideoDriverName"
+HREF="sdlvideodrivername.html"><LINK
+REL="NEXT"
+TITLE="SDL_VideoModeOK"
+HREF="sdlvideomodeok.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlvideodrivername.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlvideomodeok.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLLISTMODES"
+></A
+>SDL_ListModes</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1159"
+></A
+><H2
+>Name</H2
+>SDL_ListModes&nbsp;--&nbsp;Returns a pointer to an array of available screen dimensions for
+the given format and video flags</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1162"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1163"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_Rect **<B
+CLASS="FSFUNC"
+>SDL_ListModes</B
+></CODE
+>(SDL_PixelFormat *format, Uint32 flags);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1169"
+></A
+><H2
+>Description</H2
+><P
+>Return a pointer to an array of available screen dimensions for the given
+format and video flags, sorted largest to smallest. Returns
+<TT
+CLASS="LITERAL"
+>NULL</TT
+> if there are no dimensions available for a particular
+format, or <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> if any dimension is okay for
+the given format.</P
+><P
+>If <TT
+CLASS="PARAMETER"
+><I
+>format</I
+></TT
+> is <TT
+CLASS="LITERAL"
+>NULL</TT
+>, the mode list
+will be for the format returned by <A
+HREF="sdlgetvideoinfo.html"
+>SDL_GetVideoInfo()</A
+>-&#62;<TT
+CLASS="STRUCTFIELD"
+><I
+>vfmt</I
+></TT
+>. The <TT
+CLASS="PARAMETER"
+><I
+>flag</I
+></TT
+> parameter is an OR'd combination of <A
+HREF="sdlsurface.html"
+>surface</A
+> flags. The flags are the same as those used <A
+HREF="sdlsetvideomode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+></A
+> and they play a strong role in deciding what modes are valid. For instance, if you pass <TT
+CLASS="LITERAL"
+>SDL_HWSURFACE</TT
+> as a flag only modes that support hardware video surfaces will be returned.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1184"
+></A
+><H2
+>Example</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>SDL_Rect **modes;
+int i;
+.
+.
+.
+
+/* Get available fullscreen/hardware modes */
+modes=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE);
+
+/* Check is there are any modes available */
+if(modes == (SDL_Rect **)0){
+ printf("No modes available!\n");
+ exit(-1);
+}
+
+/* Check if our resolution is restricted */
+if(modes == (SDL_Rect **)-1){
+ printf("All resolutions available.\n");
+}
+else{
+ /* Print valid modes */
+ printf("Available Modes\n");
+ for(i=0;modes[i];++i)
+ printf(" %d x %d\n", modes[i]-&#62;w, modes[i]-&#62;h);
+}
+.
+.</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1187"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlsetvideomode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+></A
+>,
+<A
+HREF="sdlgetvideoinfo.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetVideoInfo</TT
+></A
+>,
+<A
+HREF="sdlrect.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Rect</SPAN
+></A
+>,
+<A
+HREF="sdlpixelformat.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_PixelFormat</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlvideodrivername.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlvideomodeok.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_VideoDriverName</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_VideoModeOK</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlloadbmp.html b/distrib/sdl-1.2.15/docs/html/sdlloadbmp.html
new file mode 100644
index 0000000..41556e3
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlloadbmp.html
@@ -0,0 +1,219 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_LoadBMP</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_UnlockSurface"
+HREF="sdlunlocksurface.html"><LINK
+REL="NEXT"
+TITLE="SDL_SaveBMP"
+HREF="sdlsavebmp.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlunlocksurface.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlsavebmp.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLLOADBMP"
+></A
+>SDL_LoadBMP</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1989"
+></A
+><H2
+>Name</H2
+>SDL_LoadBMP&nbsp;--&nbsp;Load a Windows BMP file into an SDL_Surface.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1992"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1993"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_Surface *<B
+CLASS="FSFUNC"
+>SDL_LoadBMP</B
+></CODE
+>(const char *file);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1999"
+></A
+><H2
+>Description</H2
+><P
+>Loads a surface from a named Windows BMP file.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2002"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns the new surface, or <TT
+CLASS="LITERAL"
+>NULL</TT
+>
+if there was an error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2006"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlsavebmp.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SaveBMP</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlunlocksurface.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlsavebmp.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_UnlockSurface</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_SaveBMP</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlloadwav.html b/distrib/sdl-1.2.15/docs/html/sdlloadwav.html
new file mode 100644
index 0000000..8abb73e
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlloadwav.html
@@ -0,0 +1,296 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_LoadWAV</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Audio"
+HREF="audio.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GetAudioStatus"
+HREF="sdlgetaudiostatus.html"><LINK
+REL="NEXT"
+TITLE="SDL_FreeWAV"
+HREF="sdlfreewav.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlgetaudiostatus.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlfreewav.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLLOADWAV"
+></A
+>SDL_LoadWAV</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6816"
+></A
+><H2
+>Name</H2
+>SDL_LoadWAV&nbsp;--&nbsp;Load a WAVE file</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN6819"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN6820"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_AudioSpec *<B
+CLASS="FSFUNC"
+>SDL_LoadWAV</B
+></CODE
+>(const char *file, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6826"
+></A
+><H2
+>Description</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_LoadWAV</TT
+>
+This function loads a WAVE <TT
+CLASS="PARAMETER"
+><I
+>file</I
+></TT
+> into memory.</P
+><P
+>If this function succeeds, it returns the given
+<A
+HREF="sdlaudiospec.html"
+><TT
+CLASS="FUNCTION"
+>SDL_AudioSpec</TT
+></A
+>,
+filled with the audio data format of the wave data, and sets
+<TT
+CLASS="PARAMETER"
+><I
+>audio_buf</I
+></TT
+> to a <TT
+CLASS="FUNCTION"
+>malloc</TT
+>'d
+buffer containing the audio data, and sets <TT
+CLASS="PARAMETER"
+><I
+>audio_len</I
+></TT
+>
+to the length of that audio buffer, in bytes. You need to free the audio
+buffer with <A
+HREF="sdlfreewav.html"
+><TT
+CLASS="FUNCTION"
+>SDL_FreeWAV</TT
+></A
+> when you are
+done with it.</P
+><P
+>This function returns <TT
+CLASS="LITERAL"
+>NULL</TT
+> and sets the SDL
+error message if the wave file cannot be opened, uses an unknown data format,
+or is corrupt. Currently raw, MS-ADPCM and IMA-ADPCM WAVE files are supported.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6841"
+></A
+><H2
+>Example</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>SDL_AudioSpec wav_spec;
+Uint32 wav_length;
+Uint8 *wav_buffer;
+
+/* Load the WAV */
+if( SDL_LoadWAV("test.wav", &#38;wav_spec, &#38;wav_buffer, &#38;wav_length) == NULL ){
+ fprintf(stderr, "Could not open test.wav: %s\n", SDL_GetError());
+ exit(-1);
+}
+.
+.
+.
+/* Do stuff with the WAV */
+.
+.
+/* Free It */
+SDL_FreeWAV(wav_buffer);</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6844"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlaudiospec.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_AudioSpec</SPAN
+></A
+>,
+<A
+HREF="sdlopenaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_OpenAudio</TT
+></A
+>,
+<A
+HREF="sdlfreewav.html"
+><TT
+CLASS="FUNCTION"
+>SDL_FreeWAV</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlgetaudiostatus.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlfreewav.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GetAudioStatus</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="audio.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_FreeWAV</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdllockaudio.html b/distrib/sdl-1.2.15/docs/html/sdllockaudio.html
new file mode 100644
index 0000000..0e6fc29
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdllockaudio.html
@@ -0,0 +1,208 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_LockAudio</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Audio"
+HREF="audio.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_MixAudio"
+HREF="sdlmixaudio.html"><LINK
+REL="NEXT"
+TITLE="SDL_UnlockAudio"
+HREF="sdlunlockaudio.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlmixaudio.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlunlockaudio.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLLOCKAUDIO"
+></A
+>SDL_LockAudio</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7134"
+></A
+><H2
+>Name</H2
+>SDL_LockAudio&nbsp;--&nbsp;Lock out the callback function</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7137"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7138"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_LockAudio</B
+></CODE
+>(void);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7144"
+></A
+><H2
+>Description</H2
+><P
+>The lock manipulated by these functions protects the callback function.
+During a LockAudio period, you can be guaranteed that the
+callback function is not running. Do not call these from the callback
+function or you will cause deadlock.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7147"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlopenaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_OpenAudio</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlmixaudio.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlunlockaudio.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_MixAudio</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="audio.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_UnlockAudio</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdllocksurface.html b/distrib/sdl-1.2.15/docs/html/sdllocksurface.html
new file mode 100644
index 0000000..40c8959
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdllocksurface.html
@@ -0,0 +1,306 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_LockSurface</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_FreeSurface"
+HREF="sdlfreesurface.html"><LINK
+REL="NEXT"
+TITLE="SDL_UnlockSurface"
+HREF="sdlunlocksurface.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlfreesurface.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlunlocksurface.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLLOCKSURFACE"
+></A
+>SDL_LockSurface</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1919"
+></A
+><H2
+>Name</H2
+>SDL_LockSurface&nbsp;--&nbsp;Lock a surface for directly access.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1922"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1923"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_LockSurface</B
+></CODE
+>(SDL_Surface *surface);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1929"
+></A
+><H2
+>Description</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_LockSurface</TT
+> sets up a surface for directly
+accessing the pixels. Between calls to <TT
+CLASS="FUNCTION"
+>SDL_LockSurface</TT
+>
+and <TT
+CLASS="FUNCTION"
+>SDL_UnlockSurface</TT
+>, you can write to and read from
+<TT
+CLASS="PARAMETER"
+><I
+>surface-&#62;<TT
+CLASS="STRUCTFIELD"
+><I
+>pixels</I
+></TT
+></I
+></TT
+>, using the pixel format stored in
+<TT
+CLASS="PARAMETER"
+><I
+>surface-&#62;<TT
+CLASS="STRUCTFIELD"
+><I
+>format</I
+></TT
+></I
+></TT
+>. Once you are done accessing the
+surface, you should use <TT
+CLASS="FUNCTION"
+>SDL_UnlockSurface</TT
+> to release it.</P
+><P
+>Not all surfaces require locking.
+If <TT
+CLASS="LITERAL"
+>SDL_MUSTLOCK</TT
+>(<TT
+CLASS="PARAMETER"
+><I
+>surface</I
+></TT
+>)
+evaluates to <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+>, then you can read and write to the
+surface at any time, and the pixel format of the surface will not change. </P
+><P
+>No operating system or library calls should be made between lock/unlock
+pairs, as critical system locks may be held during this time.</P
+><P
+>It should be noted, that since SDL 1.1.8 surface locks are recursive. This means that you can lock a surface multiple times, but each lock must have a match unlock.
+<PRE
+CLASS="PROGRAMLISTING"
+> .
+ .
+ SDL_LockSurface( surface );
+ .
+ /* Surface is locked */
+ /* Direct pixel access on surface here */
+ .
+ SDL_LockSurface( surface );
+ .
+ /* More direct pixel access on surface */
+ .
+ SDL_UnlockSurface( surface );
+ /* Surface is still locked */
+ /* Note: Is versions &#60; 1.1.8, the surface would have been */
+ /* no longer locked at this stage */
+ .
+ SDL_UnlockSurface( surface );
+ /* Surface is now unlocked */
+ .
+ .</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1947"
+></A
+><H2
+>Return Value</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_LockSurface</TT
+> returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+>,
+or <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> if the surface couldn't be locked.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1953"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlunlocksurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_UnlockSurface</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlfreesurface.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlunlocksurface.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_FreeSurface</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_UnlockSurface</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdllockyuvoverlay.html b/distrib/sdl-1.2.15/docs/html/sdllockyuvoverlay.html
new file mode 100644
index 0000000..74e6ce6
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdllockyuvoverlay.html
@@ -0,0 +1,252 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_LockYUVOverlay</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CreateYUVOverlay"
+HREF="sdlcreateyuvoverlay.html"><LINK
+REL="NEXT"
+TITLE="SDL_UnlockYUVOverlay"
+HREF="sdlunlockyuvoverlay.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcreateyuvoverlay.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlunlockyuvoverlay.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLLOCKYUVOVERLAY"
+></A
+>SDL_LockYUVOverlay</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2844"
+></A
+><H2
+>Name</H2
+>SDL_LockYUVOverlay&nbsp;--&nbsp;Lock an overlay</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2847"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2848"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_LockYUVOverlay</B
+></CODE
+>(SDL_Overlay *overlay);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2854"
+></A
+><H2
+>Description</H2
+><P
+>Much the same as <A
+HREF="sdllocksurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_LockSurface</TT
+></A
+>, <TT
+CLASS="FUNCTION"
+>SDL_LockYUVOverlay</TT
+> locks the <A
+HREF="sdloverlay.html"
+><TT
+CLASS="PARAMETER"
+><I
+>overlay</I
+></TT
+></A
+> for direct access to pixel data.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2862"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> on success, or <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> on an error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2867"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlunlockyuvoverlay.html"
+><TT
+CLASS="FUNCTION"
+>SDL_UnlockYUVOverlay</TT
+></A
+>,
+<A
+HREF="sdlcreateyuvoverlay.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateYUVOverlay</TT
+></A
+>,
+<A
+HREF="sdloverlay.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Overlay</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcreateyuvoverlay.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlunlockyuvoverlay.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CreateYUVOverlay</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_UnlockYUVOverlay</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlmaprgb.html b/distrib/sdl-1.2.15/docs/html/sdlmaprgb.html
new file mode 100644
index 0000000..5086d0c
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlmaprgb.html
@@ -0,0 +1,254 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_MapRGB</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_SetGammaRamp"
+HREF="sdlsetgammaramp.html"><LINK
+REL="NEXT"
+TITLE="SDL_MapRGBA"
+HREF="sdlmaprgba.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlsetgammaramp.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlmaprgba.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLMAPRGB"
+></A
+>SDL_MapRGB</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1652"
+></A
+><H2
+>Name</H2
+>SDL_MapRGB&nbsp;--&nbsp;Map a RGB color value to a pixel format.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1655"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1656"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>Uint32 <B
+CLASS="FSFUNC"
+>SDL_MapRGB</B
+></CODE
+>(SDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1662"
+></A
+><H2
+>Description</H2
+><P
+>Maps the RGB color value to the specified pixel format and returns the
+pixel value as a 32-bit int.</P
+><P
+>If the format has a palette (8-bit) the index of the closest matching
+color in the palette will be returned.</P
+><P
+>If the specified pixel format has an alpha component it will be returned
+as all 1 bits (fully opaque).</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1667"
+></A
+><H2
+>Return Value</H2
+><P
+>A pixel value best approximating the given RGB color value for a given
+pixel format. If the pixel format bpp (color depth) is less than 32-bpp
+then the unused upper bits of the return value can safely be ignored
+(e.g., with a 16-bpp format the return value can be assigned to a
+<SPAN
+CLASS="TYPE"
+>Uint16</SPAN
+>, and similarly a <SPAN
+CLASS="TYPE"
+>Uint8</SPAN
+> for an 8-bpp
+format).</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1672"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlgetrgb.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetRGB</TT
+></A
+>,
+<A
+HREF="sdlgetrgba.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetRGBA</TT
+></A
+>,
+<A
+HREF="sdlmaprgba.html"
+><TT
+CLASS="FUNCTION"
+>SDL_MapRGBA</TT
+></A
+>,
+<A
+HREF="sdlpixelformat.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_PixelFormat</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlsetgammaramp.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlmaprgba.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_SetGammaRamp</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_MapRGBA</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlmaprgba.html b/distrib/sdl-1.2.15/docs/html/sdlmaprgba.html
new file mode 100644
index 0000000..e6bff27
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlmaprgba.html
@@ -0,0 +1,242 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_MapRGBA</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_MapRGB"
+HREF="sdlmaprgb.html"><LINK
+REL="NEXT"
+TITLE="SDL_GetRGB"
+HREF="sdlgetrgb.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlmaprgb.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlgetrgb.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLMAPRGBA"
+></A
+>SDL_MapRGBA</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1687"
+></A
+><H2
+>Name</H2
+>SDL_MapRGBA&nbsp;--&nbsp;Map a RGBA color value to a pixel format.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1690"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1691"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>Uint32 <B
+CLASS="FSFUNC"
+>SDL_MapRGBA</B
+></CODE
+>(SDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b, Uint8 a);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1697"
+></A
+><H2
+>Description</H2
+><P
+>Maps the RGBA color value to the specified pixel format and returns the
+pixel value as a 32-bit int.</P
+><P
+>If the format has a palette (8-bit) the index of the closest matching
+color in the palette will be returned.</P
+><P
+>If the specified pixel format has no alpha component the alpha value
+will be ignored (as it will be in formats with a palette).</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1702"
+></A
+><H2
+>Return Value</H2
+><P
+>A pixel value best approximating the given RGBA color value for a given
+pixel format. If the pixel format bpp (color depth) is less than 32-bpp
+then the unused upper bits of the return value can safely be ignored
+(e.g., with a 16-bpp format the return value can be assigned to a
+<SPAN
+CLASS="TYPE"
+>Uint16</SPAN
+>, and similarly a <SPAN
+CLASS="TYPE"
+>Uint8</SPAN
+> for an 8-bpp
+format).</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1707"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlgetrgb.html"
+>SDL_GetRGB</A
+>,
+<A
+HREF="sdlgetrgba.html"
+>SDL_GetRGBA</A
+>,
+<A
+HREF="sdlmaprgb.html"
+>SDL_MapRGB</A
+>,
+<A
+HREF="sdlpixelformat.html"
+>SDL_PixelFormat</A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlmaprgb.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlgetrgb.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_MapRGB</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GetRGB</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlmixaudio.html b/distrib/sdl-1.2.15/docs/html/sdlmixaudio.html
new file mode 100644
index 0000000..6cbf0f0
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlmixaudio.html
@@ -0,0 +1,237 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_MixAudio</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Audio"
+HREF="audio.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_ConvertAudio"
+HREF="sdlconvertaudio.html"><LINK
+REL="NEXT"
+TITLE="SDL_LockAudio"
+HREF="sdllockaudio.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlconvertaudio.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdllockaudio.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLMIXAUDIO"
+></A
+>SDL_MixAudio</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7107"
+></A
+><H2
+>Name</H2
+>SDL_MixAudio&nbsp;--&nbsp;Mix audio data</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7110"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7111"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_MixAudio</B
+></CODE
+>(Uint8 *dst, Uint8 *src, Uint32 len, int volume);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7117"
+></A
+><H2
+>Description</H2
+><P
+>This function takes two audio buffers of <TT
+CLASS="PARAMETER"
+><I
+>len</I
+></TT
+> bytes each
+of the playing audio format and mixes them, performing addition, volume
+adjustment, and overflow clipping. The <TT
+CLASS="PARAMETER"
+><I
+>volume</I
+></TT
+> ranges
+from 0 to <TT
+CLASS="LITERAL"
+>SDL_MIX_MAXVOLUME</TT
+> and should be set to the maximum
+value for full audio volume. Note this does not change hardware volume. This is
+provided for convenience -- you can mix your own audio data.</P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>Do not use this function for mixing together more than two streams of sample
+data. The output from repeated application of this function may be distorted
+by clipping, because there is no accumulator with greater range than the
+input (not to mention this being an inefficient way of doing it).
+Use mixing functions from SDL_mixer, OpenAL, or write your own mixer instead.</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7125"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlopenaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_OpenAudio</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlconvertaudio.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdllockaudio.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_ConvertAudio</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="audio.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_LockAudio</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlmousebuttonevent.html b/distrib/sdl-1.2.15/docs/html/sdlmousebuttonevent.html
new file mode 100644
index 0000000..b0b40df
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlmousebuttonevent.html
@@ -0,0 +1,346 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_MouseButtonEvent</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Event Structures."
+HREF="eventstructures.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_MouseMotionEvent"
+HREF="sdlmousemotionevent.html"><LINK
+REL="NEXT"
+TITLE="SDL_JoyAxisEvent"
+HREF="sdljoyaxisevent.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlmousemotionevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdljoyaxisevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLMOUSEBUTTONEVENT"
+></A
+>SDL_MouseButtonEvent</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4144"
+></A
+><H2
+>Name</H2
+>SDL_MouseButtonEvent&nbsp;--&nbsp;Mouse button event structure</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4147"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ Uint8 type;
+ Uint8 button;
+ Uint8 state;
+ Uint16 x, y;
+} SDL_MouseButtonEvent;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4150"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN4152"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_MOUSEBUTTONDOWN</TT
+> or <TT
+CLASS="LITERAL"
+>SDL_MOUSEBUTTONUP</TT
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>button</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>The mouse button index (SDL_BUTTON_LEFT, SDL_BUTTON_MIDDLE, SDL_BUTTON_RIGHT)</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>state</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_PRESSED</TT
+> or <TT
+CLASS="LITERAL"
+>SDL_RELEASED</TT
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>x</I
+></TT
+>, <TT
+CLASS="STRUCTFIELD"
+><I
+>y</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>The X/Y coordinates of the mouse at press/release time</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4176"
+></A
+><H2
+>Description</H2
+><P
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_MouseButtonEvent</SPAN
+> is a member of the <A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+> union and is used when an event of type <TT
+CLASS="LITERAL"
+>SDL_MOUSEBUTTONDOWN</TT
+> or <TT
+CLASS="LITERAL"
+>SDL_MOUSEBUTTONUP</TT
+> is reported.</P
+><P
+>When a mouse button press or release is detected then number of the button pressed (from 1 to 255, with 1 usually being the left button and 2 the right) is placed into <TT
+CLASS="STRUCTFIELD"
+><I
+>button</I
+></TT
+>, the position of the mouse when this event occured is stored in the <TT
+CLASS="STRUCTFIELD"
+><I
+>x</I
+></TT
+> and the <TT
+CLASS="STRUCTFIELD"
+><I
+>y</I
+></TT
+> fields. Like <A
+HREF="sdlkeyboardevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_KeyboardEvent</SPAN
+></A
+>, information on whether the event was a press or a release event is stored in both the <TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+> and <TT
+CLASS="STRUCTFIELD"
+><I
+>state</I
+></TT
+> fields, but this should be obvious.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4192"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+>,
+<A
+HREF="sdlmousemotionevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_MouseMotionEvent</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlmousemotionevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdljoyaxisevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_MouseMotionEvent</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventstructures.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_JoyAxisEvent</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlmousemotionevent.html b/distrib/sdl-1.2.15/docs/html/sdlmousemotionevent.html
new file mode 100644
index 0000000..3cc7cb5
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlmousemotionevent.html
@@ -0,0 +1,365 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_MouseMotionEvent</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Event Structures."
+HREF="eventstructures.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_KeyboardEvent"
+HREF="sdlkeyboardevent.html"><LINK
+REL="NEXT"
+TITLE="SDL_MouseButtonEvent"
+HREF="sdlmousebuttonevent.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlkeyboardevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlmousebuttonevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLMOUSEMOTIONEVENT"
+></A
+>SDL_MouseMotionEvent</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4079"
+></A
+><H2
+>Name</H2
+>SDL_MouseMotionEvent&nbsp;--&nbsp;Mouse motion event structure</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4082"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ Uint8 type;
+ Uint8 state;
+ Uint16 x, y;
+ Sint16 xrel, yrel;
+} SDL_MouseMotionEvent;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4085"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN4087"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_MOUSEMOTION</TT
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>state</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>The current button state</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>x</I
+></TT
+>, <TT
+CLASS="STRUCTFIELD"
+><I
+>y</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>The X/Y coordinates of the mouse</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>xrel</I
+></TT
+>, <TT
+CLASS="STRUCTFIELD"
+><I
+>yrel</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Relative motion in the X/Y direction</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4109"
+></A
+><H2
+>Description</H2
+><P
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_MouseMotionEvent</SPAN
+> is a member of the <A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+> union and is used when an event of type <TT
+CLASS="LITERAL"
+>SDL_MOUSEMOTION</TT
+> is reported.</P
+><P
+>Simply put, a <TT
+CLASS="LITERAL"
+>SDL_MOUSEMOTION</TT
+> type event occurs when a user moves the mouse within the application window or when <A
+HREF="sdlwarpmouse.html"
+><TT
+CLASS="FUNCTION"
+>SDL_WarpMouse</TT
+></A
+> is called. Both the absolute (<TT
+CLASS="STRUCTFIELD"
+><I
+>x</I
+></TT
+> and <TT
+CLASS="STRUCTFIELD"
+><I
+>y</I
+></TT
+>) and relative (<TT
+CLASS="STRUCTFIELD"
+><I
+>xrel</I
+></TT
+> and <TT
+CLASS="STRUCTFIELD"
+><I
+>yrel</I
+></TT
+>) coordinates are reported along with the current button states (<TT
+CLASS="STRUCTFIELD"
+><I
+>state</I
+></TT
+>). The button state can be interpreted using the <TT
+CLASS="LITERAL"
+>SDL_BUTTON</TT
+> macro (see <A
+HREF="sdlgetmousestate.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetMouseState</TT
+></A
+>).</P
+><P
+>If the cursor is hidden (<A
+HREF="sdlshowcursor.html"
+><TT
+CLASS="FUNCTION"
+>SDL_ShowCursor</TT
+>(0)</A
+>) and the input is grabbed (<A
+HREF="sdlwmgrabinput.html"
+><TT
+CLASS="FUNCTION"
+>SDL_WM_GrabInput</TT
+>(SDL_GRAB_ON)</A
+>), then the mouse will give relative motion events even when the cursor reaches the edge fo the screen. This is currently only implemented on Windows and Linux/Unix-a-likes.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4133"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+>,
+<A
+HREF="sdlmousebuttonevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_MouseButtonEvent</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlkeyboardevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlmousebuttonevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_KeyboardEvent</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventstructures.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_MouseButtonEvent</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlmutexp.html b/distrib/sdl-1.2.15/docs/html/sdlmutexp.html
new file mode 100644
index 0000000..fc32ca5
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlmutexp.html
@@ -0,0 +1,241 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_mutexP</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_DestroyMutex"
+HREF="sdldestroymutex.html"><LINK
+REL="NEXT"
+TITLE="SDL_mutexV"
+HREF="sdlmutexv.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdldestroymutex.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlmutexv.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLMUTEXP"
+></A
+>SDL_mutexP</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7872"
+></A
+><H2
+>Name</H2
+>SDL_mutexP&nbsp;--&nbsp;Lock a mutex</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7875"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7876"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_mutexP</B
+></CODE
+>(SDL_mutex *mutex);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7882"
+></A
+><H2
+>Description</H2
+><P
+>Locks the <TT
+CLASS="PARAMETER"
+><I
+>mutex</I
+></TT
+>, which was previously created with <A
+HREF="sdlcreatemutex.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateMutex</TT
+></A
+>. If the mutex is already locked then <TT
+CLASS="FUNCTION"
+>SDL_mutexP</TT
+> will not return until it is <A
+HREF="sdlmutexv.html"
+>unlocked</A
+>. Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> on success, or <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> on an error.</P
+><P
+>SDL also defines a macro <TT
+CLASS="LITERAL"
+>#define SDL_LockMutex(m) SDL_mutexP(m)</TT
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7894"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcreatemutex.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateMutex</TT
+></A
+>,
+<A
+HREF="sdlmutexv.html"
+><TT
+CLASS="FUNCTION"
+>SDL_mutexV</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdldestroymutex.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlmutexv.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_DestroyMutex</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_mutexV</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlmutexv.html b/distrib/sdl-1.2.15/docs/html/sdlmutexv.html
new file mode 100644
index 0000000..06a68bd
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlmutexv.html
@@ -0,0 +1,235 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_mutexV</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_mutexP"
+HREF="sdlmutexp.html"><LINK
+REL="NEXT"
+TITLE="SDL_CreateSemaphore"
+HREF="sdlcreatesemaphore.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlmutexp.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcreatesemaphore.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLMUTEXV"
+></A
+>SDL_mutexV</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7905"
+></A
+><H2
+>Name</H2
+>SDL_mutexV&nbsp;--&nbsp;Unlock a mutex</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7908"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7909"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_mutexV</B
+></CODE
+>(SDL_mutex *mutex);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7915"
+></A
+><H2
+>Description</H2
+><P
+>Unlocks the <TT
+CLASS="PARAMETER"
+><I
+>mutex</I
+></TT
+>, which was previously created with <A
+HREF="sdlcreatemutex.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateMutex</TT
+></A
+>. Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> on success, or <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> on an error.</P
+><P
+>SDL also defines a macro <TT
+CLASS="LITERAL"
+>#define SDL_UnlockMutex(m) SDL_mutexV(m)</TT
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7925"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcreatemutex.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateMutex</TT
+></A
+>,
+<A
+HREF="sdlmutexp.html"
+><TT
+CLASS="FUNCTION"
+>SDL_mutexP</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlmutexp.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcreatesemaphore.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_mutexP</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CreateSemaphore</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlnumjoysticks.html b/distrib/sdl-1.2.15/docs/html/sdlnumjoysticks.html
new file mode 100644
index 0000000..68e3e3a
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlnumjoysticks.html
@@ -0,0 +1,222 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_NumJoysticks</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Joystick"
+HREF="joystick.html"><LINK
+REL="PREVIOUS"
+TITLE="Joystick"
+HREF="joystick.html"><LINK
+REL="NEXT"
+TITLE="SDL_JoystickName"
+HREF="sdljoystickname.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="joystick.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdljoystickname.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLNUMJOYSTICKS"
+></A
+>SDL_NumJoysticks</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6039"
+></A
+><H2
+>Name</H2
+>SDL_NumJoysticks&nbsp;--&nbsp;Count available joysticks.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN6042"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN6043"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_NumJoysticks</B
+></CODE
+>(void);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6049"
+></A
+><H2
+>Description</H2
+><P
+>Counts the number of joysticks attached to the system.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6052"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns the number of attached joysticks</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6055"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdljoystickname.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickName</TT
+></A
+>,
+<A
+HREF="sdljoystickopen.html"
+><TT
+CLASS="FUNCTION"
+>SDL_JoystickOpen</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="joystick.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdljoystickname.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Joystick</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="joystick.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_JoystickName</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlopenaudio.html b/distrib/sdl-1.2.15/docs/html/sdlopenaudio.html
new file mode 100644
index 0000000..bcfed54
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlopenaudio.html
@@ -0,0 +1,578 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_OpenAudio</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Audio"
+HREF="audio.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_AudioSpec"
+HREF="sdlaudiospec.html"><LINK
+REL="NEXT"
+TITLE="SDL_PauseAudio"
+HREF="sdlpauseaudio.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlaudiospec.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlpauseaudio.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLOPENAUDIO"
+></A
+>SDL_OpenAudio</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6650"
+></A
+><H2
+>Name</H2
+>SDL_OpenAudio&nbsp;--&nbsp;Opens the audio device with the desired parameters.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN6653"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN6654"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_OpenAudio</B
+></CODE
+>(SDL_AudioSpec *desired, SDL_AudioSpec *obtained);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6660"
+></A
+><H2
+>Description</H2
+><P
+>This function opens the audio device with the <TT
+CLASS="PARAMETER"
+><I
+>desired</I
+></TT
+> parameters, and
+returns 0 if successful, placing the actual hardware parameters in the
+structure pointed to by <TT
+CLASS="PARAMETER"
+><I
+>obtained</I
+></TT
+>. If <TT
+CLASS="PARAMETER"
+><I
+>obtained</I
+></TT
+> is NULL, the audio
+data passed to the callback function will be guaranteed to be in the
+requested format, and will be automatically converted to the hardware
+audio format if necessary. This function returns -1 if it failed
+to open the audio device, or couldn't set up the audio thread.</P
+><P
+>To open the audio device a <TT
+CLASS="PARAMETER"
+><I
+>desired</I
+></TT
+> <A
+HREF="sdlaudiospec.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_AudioSpec</SPAN
+></A
+> must be created.
+<PRE
+CLASS="PROGRAMLISTING"
+>SDL_AudioSpec *desired;
+.
+.
+desired = malloc(sizeof(SDL_AudioSpec));</PRE
+>
+You must then fill this structure with your desired audio specifications.</P
+><P
+></P
+><DIV
+CLASS="VARIABLELIST"
+><DL
+><DT
+><SPAN
+CLASS="STRUCTNAME"
+>desired</SPAN
+>-&#62;<TT
+CLASS="STRUCTFIELD"
+><I
+>freq</I
+></TT
+></DT
+><DD
+><P
+>The desired audio frequency in samples-per-second.</P
+></DD
+><DT
+><SPAN
+CLASS="STRUCTNAME"
+>desired</SPAN
+>-&#62;<TT
+CLASS="STRUCTFIELD"
+><I
+>format</I
+></TT
+></DT
+><DD
+><P
+>The desired audio format (see <A
+HREF="sdlaudiospec.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_AudioSpec</SPAN
+></A
+>)</P
+></DD
+><DT
+><SPAN
+CLASS="STRUCTNAME"
+>desired</SPAN
+>-&#62;<TT
+CLASS="STRUCTFIELD"
+><I
+>samples</I
+></TT
+></DT
+><DD
+><P
+>The desired size of the audio buffer in samples. This number should be a power of two, and may be adjusted by the audio driver to a value more suitable for the hardware. Good values seem to range between 512 and 8192 inclusive, depending on the application and CPU speed. Smaller values yield faster response time, but can lead to underflow if the application is doing heavy processing and cannot fill the audio buffer in time. A stereo sample consists of both right and left channels in LR ordering. Note that the number of samples is directly related to time by the following formula: ms = (samples*1000)/freq</P
+></DD
+><DT
+><SPAN
+CLASS="STRUCTNAME"
+>desired</SPAN
+>-&#62;<TT
+CLASS="STRUCTFIELD"
+><I
+>callback</I
+></TT
+></DT
+><DD
+><P
+>This should be set to a function that will be called when the audio device is ready for more data. It is passed a pointer to the audio buffer, and the length in bytes of the audio buffer. This function usually runs in a separate thread, and so you should protect data structures that it accesses by calling <A
+HREF="sdllockaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_LockAudio</TT
+></A
+> and <A
+HREF="sdlunlockaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_UnlockAudio</TT
+></A
+> in your code. The callback prototype is:
+<PRE
+CLASS="PROGRAMLISTING"
+>void callback(void *userdata, Uint8 *stream, int len);</PRE
+>
+<TT
+CLASS="PARAMETER"
+><I
+>userdata</I
+></TT
+> is the pointer stored in <TT
+CLASS="STRUCTFIELD"
+><I
+>userdata</I
+></TT
+> field of the <SPAN
+CLASS="STRUCTNAME"
+>SDL_AudioSpec</SPAN
+>. <TT
+CLASS="PARAMETER"
+><I
+>stream</I
+></TT
+> is a pointer to the audio buffer you want to fill with information and <TT
+CLASS="PARAMETER"
+><I
+>len</I
+></TT
+> is the length of the audio buffer in bytes.</P
+></DD
+><DT
+><SPAN
+CLASS="STRUCTNAME"
+>desired</SPAN
+>-&#62;<TT
+CLASS="STRUCTFIELD"
+><I
+>userdata</I
+></TT
+></DT
+><DD
+><P
+>This pointer is passed as the first parameter to the <TT
+CLASS="FUNCTION"
+>callback</TT
+> function.</P
+></DD
+></DL
+></DIV
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_OpenAudio</TT
+> reads these fields from the <TT
+CLASS="PARAMETER"
+><I
+>desired</I
+></TT
+> <SPAN
+CLASS="STRUCTNAME"
+>SDL_AudioSpec</SPAN
+> structure pass to the function and attempts to find an audio configuration matching your <TT
+CLASS="PARAMETER"
+><I
+>desired</I
+></TT
+>. As mentioned above, if the <TT
+CLASS="PARAMETER"
+><I
+>obtained</I
+></TT
+> parameter is <TT
+CLASS="LITERAL"
+>NULL</TT
+> then SDL with convert from your <TT
+CLASS="PARAMETER"
+><I
+>desired</I
+></TT
+> audio settings to the hardware settings as it plays.</P
+><P
+>If <TT
+CLASS="PARAMETER"
+><I
+>obtained</I
+></TT
+> is <TT
+CLASS="LITERAL"
+>NULL</TT
+> then the <TT
+CLASS="PARAMETER"
+><I
+>desired</I
+></TT
+> <SPAN
+CLASS="STRUCTNAME"
+>SDL_AudioSpec</SPAN
+> is your working specification, otherwise the <TT
+CLASS="PARAMETER"
+><I
+>obtained</I
+></TT
+> <SPAN
+CLASS="STRUCTNAME"
+>SDL_AudioSpec</SPAN
+> becomes the working specification and the <TT
+CLASS="PARAMETER"
+><I
+>desirec</I
+></TT
+> specification can be deleted. The data in the working specification is used when building <SPAN
+CLASS="STRUCTNAME"
+>SDL_AudioCVT</SPAN
+>'s for converting loaded data to the hardware format.</P
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_OpenAudio</TT
+> calculates the <TT
+CLASS="STRUCTFIELD"
+><I
+>size</I
+></TT
+> and <TT
+CLASS="STRUCTFIELD"
+><I
+>silence</I
+></TT
+> fields for both the <TT
+CLASS="PARAMETER"
+><I
+>desired</I
+></TT
+> and <TT
+CLASS="PARAMETER"
+><I
+>obtained</I
+></TT
+> specifications. The <TT
+CLASS="STRUCTFIELD"
+><I
+>size</I
+></TT
+> field stores the total size of the audio buffer in bytes, while the <TT
+CLASS="STRUCTFIELD"
+><I
+>silence</I
+></TT
+> stores the value used to represent silence in the audio buffer</P
+><P
+>The audio device starts out playing <TT
+CLASS="STRUCTFIELD"
+><I
+>silence</I
+></TT
+> when it's opened, and should be enabled for playing by calling <A
+HREF="sdlpauseaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PauseAudio</TT
+>(<TT
+CLASS="PARAMETER"
+><I
+>0</I
+></TT
+>)</A
+> when you are ready for your audio <TT
+CLASS="STRUCTFIELD"
+><I
+>callback</I
+></TT
+> function to be called. Since the audio driver may modify the requested <TT
+CLASS="STRUCTFIELD"
+><I
+>size</I
+></TT
+> of the audio buffer, you should allocate any local mixing buffers after you open the audio device.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6747"
+></A
+><H2
+>Examples</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>/* Prototype of our callback function */
+void my_audio_callback(void *userdata, Uint8 *stream, int len);
+
+/* Open the audio device */
+SDL_AudioSpec *desired, *obtained;
+SDL_AudioSpec *hardware_spec;
+
+/* Allocate a desired SDL_AudioSpec */
+desired = malloc(sizeof(SDL_AudioSpec));
+
+/* Allocate space for the obtained SDL_AudioSpec */
+obtained = malloc(sizeof(SDL_AudioSpec));
+
+/* 22050Hz - FM Radio quality */
+desired-&#62;freq=22050;
+
+/* 16-bit signed audio */
+desired-&#62;format=AUDIO_S16LSB;
+
+/* Mono */
+desired-&#62;channels=0;
+
+/* Large audio buffer reduces risk of dropouts but increases response time */
+desired-&#62;samples=8192;
+
+/* Our callback function */
+desired-&#62;callback=my_audio_callback;
+
+desired-&#62;userdata=NULL;
+
+/* Open the audio device */
+if ( SDL_OpenAudio(desired, obtained) &#60; 0 ){
+ fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
+ exit(-1);
+}
+/* desired spec is no longer needed */
+free(desired);
+hardware_spec=obtained;
+.
+.
+/* Prepare callback for playing */
+.
+.
+.
+/* Start playing */
+SDL_PauseAudio(0);</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6750"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlaudiospec.html"
+><TT
+CLASS="FUNCTION"
+>SDL_AudioSpec</TT
+></A
+>,
+<A
+HREF="sdllockaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_LockAudio</TT
+></A
+>,
+<A
+HREF="sdlunlockaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_UnlockAudio</TT
+></A
+>,
+<A
+HREF="sdlpauseaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PauseAudio</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlaudiospec.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlpauseaudio.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_AudioSpec</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="audio.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_PauseAudio</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdloverlay.html b/distrib/sdl-1.2.15/docs/html/sdloverlay.html
new file mode 100644
index 0000000..422919e
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdloverlay.html
@@ -0,0 +1,362 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_Overlay</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_VideoInfo"
+HREF="sdlvideoinfo.html"><LINK
+REL="NEXT"
+TITLE="Window Management"
+HREF="wm.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlvideoinfo.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="wm.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLOVERLAY"
+></A
+>SDL_Overlay</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN3464"
+></A
+><H2
+>Name</H2
+>SDL_Overlay&nbsp;--&nbsp;YUV video overlay</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3467"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ Uint32 format;
+ int w, h;
+ int planes;
+ Uint16 *pitches;
+ Uint8 **pixels;
+ Uint32 hw_overlay:1;
+} SDL_Overlay;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3470"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN3472"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>format</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Overlay format (see below)</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>w, h</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Width and height of overlay</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>planes</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Number of planes in the overlay. Usually either 1 or 3</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>pitches</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>An array of pitches, one for each plane. Pitch is the length of a row in bytes.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>pixels</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>An array of pointers to teh data of each plane. The overlay should be locked before these pointers are used.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>hw_overlay</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>This will be set to 1 if the overlay is hardware accelerated.</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3499"
+></A
+><H2
+>Description</H2
+><P
+>A <SPAN
+CLASS="STRUCTNAME"
+>SDL_Overlay</SPAN
+> is similar to a <A
+HREF="sdlsurface.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+></A
+> except it stores a YUV overlay. All the fields are read only, except for <TT
+CLASS="STRUCTFIELD"
+><I
+>pixels</I
+></TT
+> which should be <A
+HREF="sdllockyuvoverlay.html"
+>locked</A
+> before use. The <TT
+CLASS="STRUCTFIELD"
+><I
+>format</I
+></TT
+> field stores the format of the overlay which is one of the following:
+<PRE
+CLASS="PROGRAMLISTING"
+>#define SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U */
+#define SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V */
+#define SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 */
+#define SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 */
+#define SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 */</PRE
+>
+More information on YUV formats can be found at <A
+HREF="http://www.webartz.com/fourcc/indexyuv.htm"
+TARGET="_top"
+>http://www.webartz.com/fourcc/indexyuv.htm</A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3510"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcreateyuvoverlay.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateYUVOverlay</TT
+></A
+>,
+<A
+HREF="sdllockyuvoverlay.html"
+><TT
+CLASS="FUNCTION"
+>SDL_LockYUVOverlay</TT
+></A
+>,
+<A
+HREF="sdlunlockyuvoverlay.html"
+><TT
+CLASS="FUNCTION"
+>SDL_UnlockYUVOverlay</TT
+></A
+>,
+<A
+HREF="sdlfreeyuvoverlay.html"
+><TT
+CLASS="FUNCTION"
+>SDL_FreeYUVOverlay</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlvideoinfo.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="wm.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_VideoInfo</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Window Management</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlpalette.html b/distrib/sdl-1.2.15/docs/html/sdlpalette.html
new file mode 100644
index 0000000..6498ac4
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlpalette.html
@@ -0,0 +1,301 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_Palette</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_Color"
+HREF="sdlcolor.html"><LINK
+REL="NEXT"
+TITLE="SDL_PixelFormat"
+HREF="sdlpixelformat.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcolor.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlpixelformat.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLPALETTE"
+></A
+>SDL_Palette</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN3129"
+></A
+><H2
+>Name</H2
+>SDL_Palette&nbsp;--&nbsp;Color palette for 8-bit pixel formats</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3132"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ int ncolors;
+ SDL_Color *colors;
+} SDL_Palette;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3135"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN3137"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>ncolors</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Number of colors used in this palette</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>colors</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Pointer to <A
+HREF="sdlcolor.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Color</SPAN
+></A
+> structures that make up the palette.</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3150"
+></A
+><H2
+>Description</H2
+><P
+>Each pixel in an 8-bit surface is an index into the <TT
+CLASS="STRUCTFIELD"
+><I
+>colors</I
+></TT
+> field of the <SPAN
+CLASS="STRUCTNAME"
+>SDL_Palette</SPAN
+> structure store in <A
+HREF="sdlpixelformat.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_PixelFormat</SPAN
+></A
+>. A <SPAN
+CLASS="STRUCTNAME"
+>SDL_Palette</SPAN
+> should never need to be created manually. It is automatically created when SDL allocates a <SPAN
+CLASS="STRUCTNAME"
+>SDL_PixelFormat</SPAN
+> for a surface. The colors values of a <A
+HREF="sdlsurface.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+></A
+>s palette can be set with the <A
+HREF="sdlsetcolors.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetColors</TT
+></A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3163"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcolor.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Color</SPAN
+></A
+>,
+<A
+HREF="sdlsurface.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+></A
+>,
+<A
+HREF="sdlsetcolors.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetColors</TT
+></A
+>
+<A
+HREF="sdlsetpalette.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetPalette</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcolor.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlpixelformat.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_Color</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_PixelFormat</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlpauseaudio.html b/distrib/sdl-1.2.15/docs/html/sdlpauseaudio.html
new file mode 100644
index 0000000..39d5a0f
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlpauseaudio.html
@@ -0,0 +1,221 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_PauseAudio</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Audio"
+HREF="audio.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_OpenAudio"
+HREF="sdlopenaudio.html"><LINK
+REL="NEXT"
+TITLE="SDL_GetAudioStatus"
+HREF="sdlgetaudiostatus.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlopenaudio.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlgetaudiostatus.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLPAUSEAUDIO"
+></A
+>SDL_PauseAudio</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6765"
+></A
+><H2
+>Name</H2
+>SDL_PauseAudio&nbsp;--&nbsp;Pauses and unpauses the audio callback processing</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN6768"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN6769"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_PauseAudio</B
+></CODE
+>(int pause_on);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6775"
+></A
+><H2
+>Description</H2
+><P
+>This function pauses and unpauses the audio callback processing.
+It should be called with <TT
+CLASS="PARAMETER"
+><I
+>pause_on</I
+></TT
+>=0 after opening the audio
+device to start playing sound. This is so you can safely initialize
+data for your callback function after opening the audio device.
+Silence will be written to the audio device during the pause.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN6779"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlgetaudiostatus.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetAudioStatus</TT
+></A
+>,
+<A
+HREF="sdlopenaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_OpenAudio</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlopenaudio.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlgetaudiostatus.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_OpenAudio</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="audio.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GetAudioStatus</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlpeepevents.html b/distrib/sdl-1.2.15/docs/html/sdlpeepevents.html
new file mode 100644
index 0000000..d5a0ff6
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlpeepevents.html
@@ -0,0 +1,321 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_PeepEvents</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Event Functions."
+HREF="eventfunctions.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_PumpEvents"
+HREF="sdlpumpevents.html"><LINK
+REL="NEXT"
+TITLE="SDL_PollEvent"
+HREF="sdlpollevent.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlpumpevents.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlpollevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLPEEPEVENTS"
+></A
+>SDL_PeepEvents</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5421"
+></A
+><H2
+>Name</H2
+>SDL_PeepEvents&nbsp;--&nbsp;Checks the event queue for messages and optionally returns them.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN5424"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN5425"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_PeepEvents</B
+></CODE
+>(SDL_Event *events, int numevents, SDL_eventaction action, Uint32 mask);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5431"
+></A
+><H2
+>Description</H2
+><P
+>Checks the event queue for messages and optionally returns them.</P
+><P
+>If <TT
+CLASS="PARAMETER"
+><I
+>action</I
+></TT
+> is <TT
+CLASS="LITERAL"
+>SDL_ADDEVENT</TT
+>, up to
+<TT
+CLASS="PARAMETER"
+><I
+>numevents</I
+></TT
+> events will be added to the back of the event
+ queue.</P
+><P
+>If <TT
+CLASS="PARAMETER"
+><I
+>action</I
+></TT
+> is <TT
+CLASS="LITERAL"
+>SDL_PEEKEVENT</TT
+>, up to
+<TT
+CLASS="PARAMETER"
+><I
+>numevents</I
+></TT
+> events at the front of the event queue,
+matching <A
+HREF="sdlevent.html"
+><TT
+CLASS="PARAMETER"
+><I
+>mask</I
+></TT
+></A
+>,
+will be returned and will not be removed from the queue.</P
+><P
+>If <TT
+CLASS="PARAMETER"
+><I
+>action</I
+></TT
+> is <TT
+CLASS="LITERAL"
+>SDL_GETEVENT</TT
+>, up to
+<TT
+CLASS="PARAMETER"
+><I
+>numevents</I
+></TT
+> events at the front of the event queue,
+matching <A
+HREF="sdlevent.html"
+><TT
+CLASS="PARAMETER"
+><I
+>mask</I
+></TT
+></A
+>,
+will be returned and will be removed from the queue.</P
+><P
+>The <TT
+CLASS="PARAMETER"
+><I
+>mask</I
+></TT
+> parameter is an bitwise OR of
+<TT
+CLASS="LITERAL"
+>SDL_EVENTMASK</TT
+>(<TT
+CLASS="PARAMETER"
+><I
+>event_type</I
+></TT
+>), for all
+event types you are interested in.</P
+><P
+>This function is thread-safe.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5455"
+></A
+><H2
+>Return Value</H2
+><P
+>This function returns the number of events actually stored, or
+<SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> if there was an error. </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5459"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+>,
+<A
+HREF="sdlpollevent.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PollEvent</TT
+></A
+>,
+<A
+HREF="sdlpushevent.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PushEvent</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlpumpevents.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlpollevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_PumpEvents</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_PollEvent</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlpixelformat.html b/distrib/sdl-1.2.15/docs/html/sdlpixelformat.html
new file mode 100644
index 0000000..000ddc0
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlpixelformat.html
@@ -0,0 +1,528 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_PixelFormat</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_Palette"
+HREF="sdlpalette.html"><LINK
+REL="NEXT"
+TITLE="SDL_Surface"
+HREF="sdlsurface.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlpalette.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlsurface.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLPIXELFORMAT"
+></A
+>SDL_PixelFormat</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN3178"
+></A
+><H2
+>Name</H2
+>SDL_PixelFormat&nbsp;--&nbsp;Stores surface format information</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3181"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct SDL_PixelFormat {
+ SDL_Palette *palette;
+ Uint8 BitsPerPixel;
+ Uint8 BytesPerPixel;
+ Uint8 Rloss, Gloss, Bloss, Aloss;
+ Uint8 Rshift, Gshift, Bshift, Ashift;
+ Uint32 Rmask, Gmask, Bmask, Amask;
+ Uint32 colorkey;
+ Uint8 alpha;
+} SDL_PixelFormat;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3184"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN3186"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>palette</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Pointer to the <A
+HREF="sdlpalette.html"
+>palette</A
+>, or <TT
+CLASS="LITERAL"
+>NULL</TT
+> if the <TT
+CLASS="STRUCTFIELD"
+><I
+>BitsPerPixel</I
+></TT
+>&#62;8</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>BitsPerPixel</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>The number of bits used to represent each pixel in a surface. Usually 8, 16, 24 or 32.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>BytesPerPixel</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>The number of bytes used to represent each pixel in a surface. Usually one to four.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>[RGBA]mask</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Binary mask used to retrieve individual color values</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>[RGBA]loss</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Precision loss of each color component (2<SUP
+>[RGBA]loss</SUP
+>)</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>[RGBA]shift</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Binary left shift of each color component in the pixel value</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>colorkey</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Pixel value of transparent pixels</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>alpha</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Overall surface alpha value</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3225"
+></A
+><H2
+>Description</H2
+><P
+>A <SPAN
+CLASS="STRUCTNAME"
+>SDL_PixelFormat</SPAN
+> describes the format of the pixel data stored at the <TT
+CLASS="STRUCTFIELD"
+><I
+>pixels</I
+></TT
+> field of a <A
+HREF="sdlsurface.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+></A
+>. Every surface stores a <SPAN
+CLASS="STRUCTNAME"
+>SDL_PixelFormat</SPAN
+> in the <TT
+CLASS="STRUCTFIELD"
+><I
+>format</I
+></TT
+> field.</P
+><P
+>If you wish to do pixel level modifications on a surface, then understanding how SDL stores its color information is essential.</P
+><P
+>8-bit pixel formats are the easiest to understand. Since its an 8-bit format, we have 8 <TT
+CLASS="STRUCTFIELD"
+><I
+>BitsPerPixel</I
+></TT
+> and 1 <TT
+CLASS="STRUCTFIELD"
+><I
+>BytesPerPixel</I
+></TT
+>. Since <TT
+CLASS="STRUCTFIELD"
+><I
+>BytesPerPixel</I
+></TT
+> is 1, all pixels are represented by a Uint8 which contains an index into <TT
+CLASS="STRUCTFIELD"
+><I
+>palette</I
+></TT
+>-&#62;<TT
+CLASS="STRUCTFIELD"
+><I
+>colors</I
+></TT
+>. So, to determine the color of a pixel in a 8-bit surface: we read the color index from <SPAN
+CLASS="STRUCTNAME"
+>surface</SPAN
+>-&#62;<TT
+CLASS="STRUCTFIELD"
+><I
+>pixels</I
+></TT
+> and we use that index to read the <A
+HREF="sdlcolor.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Color</SPAN
+></A
+> structure from <SPAN
+CLASS="STRUCTNAME"
+>surface</SPAN
+>-&#62;<TT
+CLASS="STRUCTFIELD"
+><I
+>format</I
+></TT
+>-&#62;<TT
+CLASS="STRUCTFIELD"
+><I
+>palette</I
+></TT
+>-&#62;<TT
+CLASS="STRUCTFIELD"
+><I
+>colors</I
+></TT
+>. Like so:
+<PRE
+CLASS="PROGRAMLISTING"
+>SDL_Surface *surface;
+SDL_PixelFormat *fmt;
+SDL_Color *color;
+Uint8 index;
+
+.
+.
+
+/* Create surface */
+.
+.
+fmt=surface-&#62;format;
+
+/* Check the bitdepth of the surface */
+if(fmt-&#62;BitsPerPixel!=8){
+ fprintf(stderr, "Not an 8-bit surface.\n");
+ return(-1);
+}
+
+/* Lock the surface */
+SDL_LockSurface(surface);
+
+/* Get the topleft pixel */
+index=*(Uint8 *)surface-&#62;pixels;
+color=fmt-&#62;palette-&#62;colors[index];
+
+/* Unlock the surface */
+SDL_UnlockSurface(surface);
+printf("Pixel Color-&#62; Red: %d, Green: %d, Blue: %d. Index: %d\n",
+ color-&#62;r, color-&#62;g, color-&#62;b, index);
+.
+.</PRE
+></P
+><P
+>Pixel formats above 8-bit are an entirely different experience. They are
+considered to be "TrueColor" formats and the color information is stored in the
+pixels themselves, not in a palette. The mask, shift and loss fields tell us
+how the color information is encoded. The mask fields allow us to isolate each
+color component, the shift fields tell us the number of bits to the right of
+each component in the pixel value and the loss fields tell us the number of
+bits lost from each component when packing 8-bit color component in a pixel.
+<PRE
+CLASS="PROGRAMLISTING"
+>/* Extracting color components from a 32-bit color value */
+SDL_PixelFormat *fmt;
+SDL_Surface *surface;
+Uint32 temp, pixel;
+Uint8 red, green, blue, alpha;
+.
+.
+.
+fmt=surface-&#62;format;
+SDL_LockSurface(surface);
+pixel=*((Uint32*)surface-&#62;pixels);
+SDL_UnlockSurface(surface);
+
+/* Get Red component */
+temp=pixel&#38;fmt-&#62;Rmask; /* Isolate red component */
+temp=temp&#62;&#62;fmt-&#62;Rshift;/* Shift it down to 8-bit */
+temp=temp&#60;&#60;fmt-&#62;Rloss; /* Expand to a full 8-bit number */
+red=(Uint8)temp;
+
+/* Get Green component */
+temp=pixel&#38;fmt-&#62;Gmask; /* Isolate green component */
+temp=temp&#62;&#62;fmt-&#62;Gshift;/* Shift it down to 8-bit */
+temp=temp&#60;&#60;fmt-&#62;Gloss; /* Expand to a full 8-bit number */
+green=(Uint8)temp;
+
+/* Get Blue component */
+temp=pixel&#38;fmt-&#62;Bmask; /* Isolate blue component */
+temp=temp&#62;&#62;fmt-&#62;Bshift;/* Shift it down to 8-bit */
+temp=temp&#60;&#60;fmt-&#62;Bloss; /* Expand to a full 8-bit number */
+blue=(Uint8)temp;
+
+/* Get Alpha component */
+temp=pixel&#38;fmt-&#62;Amask; /* Isolate alpha component */
+temp=temp&#62;&#62;fmt-&#62;Ashift;/* Shift it down to 8-bit */
+temp=temp&#60;&#60;fmt-&#62;Aloss; /* Expand to a full 8-bit number */
+alpha=(Uint8)temp;
+
+printf("Pixel Color -&#62; R: %d, G: %d, B: %d, A: %d\n", red, green, blue, alpha);
+.
+.
+.</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3252"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlsurface.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+></A
+>,
+<A
+HREF="sdlmaprgb.html"
+><TT
+CLASS="FUNCTION"
+>SDL_MapRGB</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlpalette.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlsurface.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_Palette</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_Surface</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
diff --git a/distrib/sdl-1.2.15/docs/html/sdlpollevent.html b/distrib/sdl-1.2.15/docs/html/sdlpollevent.html
new file mode 100644
index 0000000..f97c22d
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlpollevent.html
@@ -0,0 +1,269 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_PollEvent</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Event Functions."
+HREF="eventfunctions.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_PeepEvents"
+HREF="sdlpeepevents.html"><LINK
+REL="NEXT"
+TITLE="SDL_WaitEvent"
+HREF="sdlwaitevent.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlpeepevents.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlwaitevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLPOLLEVENT"
+></A
+>SDL_PollEvent</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5472"
+></A
+><H2
+>Name</H2
+>SDL_PollEvent&nbsp;--&nbsp;Polls for currently pending events.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN5475"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN5476"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_PollEvent</B
+></CODE
+>(SDL_Event *event);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5482"
+></A
+><H2
+>Description</H2
+><P
+>Polls for currently pending events, and returns <SPAN
+CLASS="RETURNVALUE"
+>1</SPAN
+>
+if there are any pending events, or <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> if there
+are none available. </P
+><P
+>If <TT
+CLASS="PARAMETER"
+><I
+>event</I
+></TT
+> is not <TT
+CLASS="LITERAL"
+>NULL</TT
+>, the next
+event is removed from the queue and stored in that area.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5490"
+></A
+><H2
+>Examples</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>SDL_Event event; /* Event structure */
+
+.
+.
+.
+/* Check for events */
+while(SDL_PollEvent(&#38;event)){ /* Loop until there are no events left on the queue */
+ switch(event.type){ /* Process the appropiate event type */
+ case SDL_KEYDOWN: /* Handle a KEYDOWN event */
+ printf("Oh! Key press\n");
+ break;
+ case SDL_MOUSEMOTION:
+ .
+ .
+ .
+ default: /* Report an unhandled event */
+ printf("I don't know what this event is!\n");
+ }
+}</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5494"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+>,
+<A
+HREF="sdlwaitevent.html"
+><TT
+CLASS="FUNCTION"
+>SDL_WaitEvent</TT
+></A
+>,
+<A
+HREF="sdlpeepevents.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PeepEvents</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlpeepevents.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlwaitevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_PeepEvents</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_WaitEvent</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlpumpevents.html b/distrib/sdl-1.2.15/docs/html/sdlpumpevents.html
new file mode 100644
index 0000000..a7e528f
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlpumpevents.html
@@ -0,0 +1,244 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_PumpEvents</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Event Functions."
+HREF="eventfunctions.html"><LINK
+REL="PREVIOUS"
+TITLE="Event Functions."
+HREF="eventfunctions.html"><LINK
+REL="NEXT"
+TITLE="SDL_PeepEvents"
+HREF="sdlpeepevents.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlpeepevents.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLPUMPEVENTS"
+></A
+>SDL_PumpEvents</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5387"
+></A
+><H2
+>Name</H2
+>SDL_PumpEvents&nbsp;--&nbsp;Pumps the event loop, gathering events from the input devices.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN5390"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN5391"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_PumpEvents</B
+></CODE
+>(void);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5397"
+></A
+><H2
+>Description</H2
+><P
+>Pumps the event loop, gathering events from the input devices.</P
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_PumpEvents</TT
+> gathers all the pending input information from devices and places it on the event queue. Without calls to <TT
+CLASS="FUNCTION"
+>SDL_PumpEvents</TT
+> no events would ever be placed on the queue. Often calls the need for <TT
+CLASS="FUNCTION"
+>SDL_PumpEvents</TT
+> is hidden from the user since <A
+HREF="sdlpollevent.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PollEvent</TT
+></A
+> and <A
+HREF="sdlwaitevent.html"
+><TT
+CLASS="FUNCTION"
+>SDL_WaitEvent</TT
+></A
+> implicitly call <TT
+CLASS="FUNCTION"
+>SDL_PumpEvents</TT
+>. However, if you are not polling or waiting for events (e.g. you are filtering them), then you must call <TT
+CLASS="FUNCTION"
+>SDL_PumpEvents</TT
+> to force an event queue update.</P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>You can only call this function in the thread that set the video mode.</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5412"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlpollevent.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PollEvent</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlpeepevents.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Event Functions.</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_PeepEvents</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlpushevent.html b/distrib/sdl-1.2.15/docs/html/sdlpushevent.html
new file mode 100644
index 0000000..6905385
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlpushevent.html
@@ -0,0 +1,266 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_PushEvent</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Event Functions."
+HREF="eventfunctions.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_WaitEvent"
+HREF="sdlwaitevent.html"><LINK
+REL="NEXT"
+TITLE="SDL_SetEventFilter"
+HREF="sdlseteventfilter.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlwaitevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlseteventfilter.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLPUSHEVENT"
+></A
+>SDL_PushEvent</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5536"
+></A
+><H2
+>Name</H2
+>SDL_PushEvent&nbsp;--&nbsp;Pushes an event onto the event queue</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN5539"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN5540"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_PushEvent</B
+></CODE
+>(SDL_Event *event);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5546"
+></A
+><H2
+>Description</H2
+><P
+>The event queue can actually be used as a two way communication channel. Not only can events be read from the queue, but the user can also push their own events onto it. <TT
+CLASS="PARAMETER"
+><I
+>event</I
+></TT
+> is a pointer to the event structure you wish to push onto the queue.</P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>Pushing device input events onto the queue doesn't modify the state of the device within SDL.</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5552"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> on success or <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> if the event couldn't be pushed.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5557"
+></A
+><H2
+>Examples</H2
+><P
+>See <A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5562"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlpollevent.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PollEvent</TT
+></A
+>,
+<A
+HREF="sdlpeepevents.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PeepEvents</TT
+></A
+>,
+<A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlwaitevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlseteventfilter.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_WaitEvent</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_SetEventFilter</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlquit.html b/distrib/sdl-1.2.15/docs/html/sdlquit.html
new file mode 100644
index 0000000..1f31c82
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlquit.html
@@ -0,0 +1,244 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_Quit</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="General"
+HREF="general.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_QuitSubSystem"
+HREF="sdlquitsubsystem.html"><LINK
+REL="NEXT"
+TITLE="SDL_WasInit"
+HREF="sdlwasinit.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlquitsubsystem.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlwasinit.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLQUIT"
+></A
+>SDL_Quit</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN585"
+></A
+><H2
+>Name</H2
+>SDL_Quit&nbsp;--&nbsp;Shut down SDL</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN588"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN589"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_Quit</B
+></CODE
+>(void);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN595"
+></A
+><H2
+>Description</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_Quit</TT
+> shuts down all SDL subsystems and frees the resources allocated to them. This should always be called before you exit. For the sake of simplicity you can set <TT
+CLASS="FUNCTION"
+>SDL_Quit</TT
+> as your <TT
+CLASS="FUNCTION"
+>atexit</TT
+> call, like:
+<PRE
+CLASS="PROGRAMLISTING"
+>SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO);
+atexit(SDL_Quit);
+.
+.</PRE
+></P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>While using <TT
+CLASS="FUNCTION"
+>atexit</TT
+> maybe be fine for small programs, more advanced users should shut down SDL in their own cleanup code. Plus, using <TT
+CLASS="FUNCTION"
+>atexit</TT
+> in a library is a sure way to crash dynamically loaded code</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN606"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlquitsubsystem.html"
+><TT
+CLASS="FUNCTION"
+>SDL_QuitSubsystem</TT
+></A
+>,
+<A
+HREF="sdlinit.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlquitsubsystem.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlwasinit.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_QuitSubSystem</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="general.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_WasInit</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlquitevent.html b/distrib/sdl-1.2.15/docs/html/sdlquitevent.html
new file mode 100644
index 0000000..d575f38
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlquitevent.html
@@ -0,0 +1,263 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_QuitEvent</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Event Structures."
+HREF="eventstructures.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_UserEvent"
+HREF="sdluserevent.html"><LINK
+REL="NEXT"
+TITLE="SDL_keysym"
+HREF="sdlkeysym.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdluserevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlkeysym.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLQUITEVENT"
+></A
+>SDL_QuitEvent</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4621"
+></A
+><H2
+>Name</H2
+>SDL_QuitEvent&nbsp;--&nbsp;Quit requested event</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4624"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ Uint8 type
+} SDL_QuitEvent;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4627"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN4629"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_QUIT</TT
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4637"
+></A
+><H2
+>Description</H2
+><P
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_QuitEvent</SPAN
+> is a member of the <A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+> union and is used whan an event of type <TT
+CLASS="LITERAL"
+>SDL_QUIT</TT
+> is reported.</P
+><P
+>As can be seen, the SDL_QuitEvent structure serves no useful purpose. The event itself, on the other hand, is very important. If you filter out or ignore a quit event then it is impossible for the user to close the window. On the other hand, if you do accept a quit event then the application window will be closed, and screen updates will still report success event though the application will no longer be visible.</P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>The macro <TT
+CLASS="FUNCTION"
+>SDL_QuitRequested</TT
+> will return non-zero if a quit event is pending</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4648"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+>,
+<A
+HREF="sdlseteventfilter.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetEventFilter</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdluserevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlkeysym.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_UserEvent</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventstructures.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_keysym</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlquitsubsystem.html b/distrib/sdl-1.2.15/docs/html/sdlquitsubsystem.html
new file mode 100644
index 0000000..877e3ce
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlquitsubsystem.html
@@ -0,0 +1,248 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_QuitSubSystem</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="General"
+HREF="general.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_InitSubSystem"
+HREF="sdlinitsubsystem.html"><LINK
+REL="NEXT"
+TITLE="SDL_Quit"
+HREF="sdlquit.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlinitsubsystem.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlquit.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLQUITSUBSYSTEM"
+></A
+>SDL_QuitSubSystem</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN550"
+></A
+><H2
+>Name</H2
+>SDL_QuitSubSystem&nbsp;--&nbsp;Shut down a subsystem</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN553"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN554"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_QuitSubSystem</B
+></CODE
+>(Uint32 flags);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN560"
+></A
+><H2
+>Description</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_QuitSubSystem</TT
+> allows you to shut down a subsystem that has been previously initialized by <A
+HREF="sdlinit.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+></A
+> or <A
+HREF="sdlinitsubsystem.html"
+><TT
+CLASS="FUNCTION"
+>SDL_InitSubSystem</TT
+></A
+>. The <TT
+CLASS="PARAMETER"
+><I
+>flags</I
+></TT
+> tells <TT
+CLASS="FUNCTION"
+>SDL_QuitSubSystem</TT
+> which subsystems to shut down, it uses the same values that are passed to <A
+HREF="sdlinit.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+></A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN572"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlquit.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Quit</TT
+></A
+>,
+<A
+HREF="sdlinit.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+></A
+>,
+<A
+HREF="sdlinitsubsystem.html"
+><TT
+CLASS="FUNCTION"
+>SDL_InitSubSystem</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlinitsubsystem.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlquit.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_InitSubSystem</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="general.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_Quit</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlrect.html b/distrib/sdl-1.2.15/docs/html/sdlrect.html
new file mode 100644
index 0000000..ba4a80b
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlrect.html
@@ -0,0 +1,258 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_Rect</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GLattr"
+HREF="sdlglattr.html"><LINK
+REL="NEXT"
+TITLE="SDL_Color"
+HREF="sdlcolor.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlglattr.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcolor.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLRECT"
+></A
+>SDL_Rect</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN3046"
+></A
+><H2
+>Name</H2
+>SDL_Rect&nbsp;--&nbsp;Defines a rectangular area</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3049"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ Sint16 x, y;
+ Uint16 w, h;
+} SDL_Rect;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3052"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN3054"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>x, y</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Position of the upper-left corner of the rectangle</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>w, h</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>The width and height of the rectangle</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3065"
+></A
+><H2
+>Description</H2
+><P
+>A <SPAN
+CLASS="STRUCTNAME"
+>SDL_Rect</SPAN
+> defines a rectangular area of pixels. It is used by <A
+HREF="sdlblitsurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_BlitSurface</TT
+></A
+> to define blitting regions and by several other video functions.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3071"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlblitsurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_BlitSurface</TT
+></A
+>,
+<A
+HREF="sdlupdaterect.html"
+><TT
+CLASS="FUNCTION"
+>SDL_UpdateRect</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlglattr.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcolor.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GLattr</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_Color</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlremovetimer.html b/distrib/sdl-1.2.15/docs/html/sdlremovetimer.html
new file mode 100644
index 0000000..26a3d11
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlremovetimer.html
@@ -0,0 +1,236 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_RemoveTimer</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Time"
+HREF="time.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_AddTimer"
+HREF="sdladdtimer.html"><LINK
+REL="NEXT"
+TITLE="SDL_SetTimer"
+HREF="sdlsettimer.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdladdtimer.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlsettimer.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLREMOVETIMER"
+></A
+>SDL_RemoveTimer</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8526"
+></A
+><H2
+>Name</H2
+>SDL_RemoveTimer&nbsp;--&nbsp;Remove a timer which was added with
+<A
+HREF="sdladdtimer.html"
+>SDL_AddTimer</A
+>.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8530"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN8531"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_bool <B
+CLASS="FSFUNC"
+>SDL_RemoveTimer</B
+></CODE
+>(SDL_TimerID id);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8537"
+></A
+><H2
+>Description</H2
+><P
+>Removes a timer callback previously added with
+<A
+HREF="sdladdtimer.html"
+>SDL_AddTimer</A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8541"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns a boolean value indicating success.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8544"
+></A
+><H2
+>Examples</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>SDL_RemoveTimer(my_timer_id);</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8548"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdladdtimer.html"
+><TT
+CLASS="FUNCTION"
+>SDL_AddTimer</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdladdtimer.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlsettimer.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_AddTimer</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="time.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_SetTimer</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlresizeevent.html b/distrib/sdl-1.2.15/docs/html/sdlresizeevent.html
new file mode 100644
index 0000000..1d446a5
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlresizeevent.html
@@ -0,0 +1,307 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_ResizeEvent</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Event Structures."
+HREF="eventstructures.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_JoyBallEvent"
+HREF="sdljoyballevent.html"><LINK
+REL="NEXT"
+TITLE="SDL_ExposeEvent"
+HREF="sdlexposeevent.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdljoyballevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlexposeevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLRESIZEEVENT"
+></A
+>SDL_ResizeEvent</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4453"
+></A
+><H2
+>Name</H2
+>SDL_ResizeEvent&nbsp;--&nbsp;Window resize event structure</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4456"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ Uint8 type;
+ int w, h;
+} SDL_ResizeEvent;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4459"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN4461"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_VIDEORESIZE</TT
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>w</I
+></TT
+>, <TT
+CLASS="STRUCTFIELD"
+><I
+>h</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>New width and height of the window</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4474"
+></A
+><H2
+>Description</H2
+><P
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_ResizeEvent</SPAN
+> is a member of the <A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+> union and is used when an event of type <TT
+CLASS="LITERAL"
+>SDL_VIDEORESIZE</TT
+> is reported.</P
+><P
+>When <TT
+CLASS="LITERAL"
+>SDL_RESIZABLE</TT
+> is passed as a <TT
+CLASS="PARAMETER"
+><I
+>flag</I
+></TT
+> to <A
+HREF="sdlsetvideomode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+></A
+> the user is allowed to resize the applications window. When the window is resized an <TT
+CLASS="LITERAL"
+>SDL_VIDEORESIZE</TT
+> is report, with the new window width and height values stored in <TT
+CLASS="STRUCTFIELD"
+><I
+>w</I
+></TT
+> and <TT
+CLASS="STRUCTFIELD"
+><I
+>h</I
+></TT
+>, respectively. When an <TT
+CLASS="LITERAL"
+>SDL_VIDEORESIZE</TT
+> is recieved the window should be resized to the new dimensions using <A
+HREF="sdlsetvideomode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+></A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4492"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+>,
+<A
+HREF="sdlsetvideomode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdljoyballevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlexposeevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_JoyBallEvent</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventstructures.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_ExposeEvent</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlsavebmp.html b/distrib/sdl-1.2.15/docs/html/sdlsavebmp.html
new file mode 100644
index 0000000..4c318ed
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlsavebmp.html
@@ -0,0 +1,236 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_SaveBMP</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_LoadBMP"
+HREF="sdlloadbmp.html"><LINK
+REL="NEXT"
+TITLE="SDL_SetColorKey"
+HREF="sdlsetcolorkey.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlloadbmp.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlsetcolorkey.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLSAVEBMP"
+></A
+>SDL_SaveBMP</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2015"
+></A
+><H2
+>Name</H2
+>SDL_SaveBMP&nbsp;--&nbsp;Save an SDL_Surface as a Windows BMP file.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2018"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2019"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_SaveBMP</B
+></CODE
+>(SDL_Surface *surface, const char *file);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2025"
+></A
+><H2
+>Description</H2
+><P
+>Saves the <SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+> <TT
+CLASS="PARAMETER"
+><I
+>surface</I
+></TT
+> as a Windows BMP file named <TT
+CLASS="PARAMETER"
+><I
+>file</I
+></TT
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2031"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> if successful or
+<SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+>
+if there was an error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2036"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlloadbmp.html"
+><TT
+CLASS="FUNCTION"
+>SDL_LoadBMP</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlloadbmp.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlsetcolorkey.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_LoadBMP</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_SetColorKey</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlsempost.html b/distrib/sdl-1.2.15/docs/html/sdlsempost.html
new file mode 100644
index 0000000..18fb01a
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlsempost.html
@@ -0,0 +1,299 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_SemPost</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_SemWaitTimeout"
+HREF="sdlsemwaittimeout.html"><LINK
+REL="NEXT"
+TITLE="SDL_SemValue"
+HREF="sdlsemvalue.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlsemwaittimeout.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlsemvalue.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLSEMPOST"
+></A
+>SDL_SemPost</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8170"
+></A
+><H2
+>Name</H2
+>SDL_SemPost&nbsp;--&nbsp;Unlock a semaphore.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8173"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN8174"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_SemPost</B
+></CODE
+>(SDL_sem *sem);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8180"
+></A
+><H2
+>Description</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_SemPost</TT
+> unlocks the semaphore pointed to by
+<TT
+CLASS="PARAMETER"
+><I
+>sem</I
+></TT
+> and atomically increments the semaphores value.
+Threads that were blocking on the semaphore may be scheduled after this call
+succeeds.</P
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_SemPost</TT
+> should be called after a semaphore is locked by a successful call to
+<A
+HREF="sdlsemwait.html"
+>SDL_SemWait</A
+>,
+<A
+HREF="sdlsemtrywait.html"
+>SDL_SemTryWait</A
+> or
+<A
+HREF="sdlsemwaittimeout.html"
+>SDL_SemWaitTimeout</A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8190"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> if successful or
+<SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> if there was an error (leaving the semaphore unchanged).</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8195"
+></A
+><H2
+>Examples</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>SDL_SemPost(my_sem);</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8199"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcreatesemaphore.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateSemaphore</TT
+></A
+>,
+<A
+HREF="sdldestroysemaphore.html"
+><TT
+CLASS="FUNCTION"
+>SDL_DestroySemaphore</TT
+></A
+>,
+<A
+HREF="sdlsemwait.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemWait</TT
+></A
+>,
+<A
+HREF="sdlsemtrywait.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemTryWait</TT
+></A
+>,
+<A
+HREF="sdlsemwaittimeout.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemWaitTimeout</TT
+></A
+>,
+<A
+HREF="sdlsemvalue.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemValue</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlsemwaittimeout.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlsemvalue.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_SemWaitTimeout</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_SemValue</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlsemtrywait.html b/distrib/sdl-1.2.15/docs/html/sdlsemtrywait.html
new file mode 100644
index 0000000..86f47a1
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlsemtrywait.html
@@ -0,0 +1,319 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_SemTryWait</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_SemWait"
+HREF="sdlsemwait.html"><LINK
+REL="NEXT"
+TITLE="SDL_SemWaitTimeout"
+HREF="sdlsemwaittimeout.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlsemwait.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlsemwaittimeout.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLSEMTRYWAIT"
+></A
+>SDL_SemTryWait</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8069"
+></A
+><H2
+>Name</H2
+>SDL_SemTryWait&nbsp;--&nbsp;Attempt to lock a semaphore but don't suspend the thread.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8072"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN8073"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_SemTryWait</B
+></CODE
+>(SDL_sem *sem);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8079"
+></A
+><H2
+>Description</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_SemTryWait</TT
+> is a non-blocking varient of
+<A
+HREF="sdlsemwait.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemWait</TT
+></A
+>. If the value of the semaphore
+pointed to by <TT
+CLASS="PARAMETER"
+><I
+>sem</I
+></TT
+> is positive it will atomically
+decrement the semaphore value and return 0, otherwise it will return
+<SPAN
+CLASS="RETURNVALUE"
+>SDL_MUTEX_TIMEDOUT</SPAN
+> instead of suspending the thread.</P
+><P
+>After <TT
+CLASS="FUNCTION"
+>SDL_SemTryWait</TT
+> is successful, the semaphore
+can be released and its count atomically incremented by a successful call to
+<A
+HREF="sdlsempost.html"
+>SDL_SemPost</A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8090"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> if the semaphore was successfully locked or
+either <SPAN
+CLASS="RETURNVALUE"
+>SDL_MUTEX_TIMEDOUT</SPAN
+> or <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+>
+if the thread would have suspended or there was an error, respectivly.</P
+><P
+>If the semaphore was not successfully locked, the semaphore will be unchanged.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8097"
+></A
+><H2
+>Examples</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>res = SDL_SemTryWait(my_sem);
+
+if (res == SDL_MUTEX_TIMEDOUT) {
+ return TRY_AGAIN;
+}
+if (res == -1) {
+ return WAIT_ERROR;
+}
+
+...
+
+SDL_SemPost(my_sem);</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8101"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcreatesemaphore.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateSemaphore</TT
+></A
+>,
+<A
+HREF="sdldestroysemaphore.html"
+><TT
+CLASS="FUNCTION"
+>SDL_DestroySemaphore</TT
+></A
+>,
+<A
+HREF="sdlsemwait.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemWait</TT
+></A
+>,
+<A
+HREF="sdlsemwaittimeout.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemWaitTimeout</TT
+></A
+>,
+<A
+HREF="sdlsempost.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemPost</TT
+></A
+>,
+<A
+HREF="sdlsemvalue.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemValue</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlsemwait.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlsemwaittimeout.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_SemWait</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_SemWaitTimeout</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlsemvalue.html b/distrib/sdl-1.2.15/docs/html/sdlsemvalue.html
new file mode 100644
index 0000000..7867369
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlsemvalue.html
@@ -0,0 +1,273 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_SemValue</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_SemPost"
+HREF="sdlsempost.html"><LINK
+REL="NEXT"
+TITLE="SDL_CreateCond"
+HREF="sdlcreatecond.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlsempost.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcreatecond.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLSEMVALUE"
+></A
+>SDL_SemValue</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8218"
+></A
+><H2
+>Name</H2
+>SDL_SemValue&nbsp;--&nbsp;Return the current value of a semaphore.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8221"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN8222"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL/SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>Uint32 <B
+CLASS="FSFUNC"
+>SDL_SemValue</B
+></CODE
+>(SDL_sem *sem);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8228"
+></A
+><H2
+>Description</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_SemValue()</TT
+> returns the current semaphore value from
+the semaphore pointed to by <TT
+CLASS="PARAMETER"
+><I
+>sem</I
+></TT
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8233"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns current value of the semaphore.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8236"
+></A
+><H2
+>Examples</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+> sem_value = SDL_SemValue(my_sem);</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8240"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcreatesemaphore.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateSemaphore</TT
+></A
+>,
+<A
+HREF="sdldestroysemaphore.html"
+><TT
+CLASS="FUNCTION"
+>SDL_DestroySemaphore</TT
+></A
+>,
+<A
+HREF="sdlsemwait.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemWait</TT
+></A
+>,
+<A
+HREF="sdlsemtrywait.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemTryWait</TT
+></A
+>,
+<A
+HREF="sdlsemwaittimeout.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemWaitTimeout</TT
+></A
+>,
+<A
+HREF="sdlsempost.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemPost</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlsempost.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcreatecond.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_SemPost</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CreateCond</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlsemwait.html b/distrib/sdl-1.2.15/docs/html/sdlsemwait.html
new file mode 100644
index 0000000..5e98d55
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlsemwait.html
@@ -0,0 +1,298 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_SemWait</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_DestroySemaphore"
+HREF="sdldestroysemaphore.html"><LINK
+REL="NEXT"
+TITLE="SDL_SemTryWait"
+HREF="sdlsemtrywait.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdldestroysemaphore.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlsemtrywait.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLSEMWAIT"
+></A
+>SDL_SemWait</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8023"
+></A
+><H2
+>Name</H2
+>SDL_SemWait&nbsp;--&nbsp;Lock a semaphore and suspend the thread if the semaphore value is zero.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8026"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN8027"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_SemWait</B
+></CODE
+>(SDL_sem *sem);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8033"
+></A
+><H2
+>Description</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_SemWait()</TT
+> suspends the calling thread until either
+the semaphore pointed to by <TT
+CLASS="PARAMETER"
+><I
+>sem</I
+></TT
+> has a positive value,
+the call is interrupted by a signal or error. If the call is successful it
+will atomically decrement the semaphore value.</P
+><P
+>After <TT
+CLASS="FUNCTION"
+>SDL_SemWait()</TT
+> is successful, the semaphore
+can be released and its count atomically incremented by a successful call to
+<A
+HREF="sdlsempost.html"
+>SDL_SemPost</A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8041"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> if successful or
+<SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> if there was an error (leaving the semaphore unchanged).</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8046"
+></A
+><H2
+>Examples</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>if (SDL_SemWait(my_sem) == -1) {
+ return WAIT_FAILED;
+}
+
+...
+
+SDL_SemPost(my_sem);</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8050"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcreatesemaphore.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateSemaphore</TT
+></A
+>,
+<A
+HREF="sdldestroysemaphore.html"
+><TT
+CLASS="FUNCTION"
+>SDL_DestroySemaphore</TT
+></A
+>,
+<A
+HREF="sdlsemtrywait.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemTryWait</TT
+></A
+>,
+<A
+HREF="sdlsemwaittimeout.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemWaitTimeout</TT
+></A
+>,
+<A
+HREF="sdlsempost.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemPost</TT
+></A
+>,
+<A
+HREF="sdlsemvalue.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemValue</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdldestroysemaphore.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlsemtrywait.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_DestroySemaphore</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_SemTryWait</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlsemwaittimeout.html b/distrib/sdl-1.2.15/docs/html/sdlsemwaittimeout.html
new file mode 100644
index 0000000..788f5b7
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlsemwaittimeout.html
@@ -0,0 +1,322 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_SemWaitTimeout</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_SemTryWait"
+HREF="sdlsemtrywait.html"><LINK
+REL="NEXT"
+TITLE="SDL_SemPost"
+HREF="sdlsempost.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlsemtrywait.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlsempost.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLSEMWAITTIMEOUT"
+></A
+>SDL_SemWaitTimeout</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8120"
+></A
+><H2
+>Name</H2
+>SDL_SemWaitTimeout&nbsp;--&nbsp;Lock a semaphore, but only wait up to a specified maximum time.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8123"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN8124"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_SemWaitTimeout</B
+></CODE
+>(SDL_sem *sem, Uint32 timeout);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8130"
+></A
+><H2
+>Description</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_SemWaitTimeout()</TT
+> is a varient of
+<A
+HREF="sdlsemwait.html"
+>SDL_SemWait</A
+>
+with a maximum timeout value.
+If the value of the semaphore pointed to by <TT
+CLASS="PARAMETER"
+><I
+>sem</I
+></TT
+> is
+positive (greater than zero) it will atomically decrement the semaphore value
+and return 0, otherwise it will wait up to <TT
+CLASS="PARAMETER"
+><I
+>timeout</I
+></TT
+>
+milliseconds trying to lock the semaphore. This function is to be avoided if
+possible since on some platforms it is implemented by polling the semaphore
+every millisecond in a busy loop.</P
+><P
+>After <TT
+CLASS="FUNCTION"
+>SDL_SemWaitTimeout()</TT
+> is successful, the semaphore
+can be released and its count atomically incremented by a successful call to
+<A
+HREF="sdlsempost.html"
+>SDL_SemPost</A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8140"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> if the semaphore was successfully locked or
+either <SPAN
+CLASS="RETURNVALUE"
+>SDL_MUTEX_TIMEDOUT</SPAN
+> or <SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+>
+if the timeout period was exceeded or there was an error, respectivly.</P
+><P
+>If the semaphore was not successfully locked, the semaphore will be unchanged.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8147"
+></A
+><H2
+>Examples</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>res = SDL_SemWaitTimeout(my_sem, WAIT_TIMEOUT_MILLISEC);
+
+if (res == SDL_MUTEX_TIMEDOUT) {
+ return TRY_AGAIN;
+}
+if (res == -1) {
+ return WAIT_ERROR;
+}
+
+...
+
+SDL_SemPost(my_sem);</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8151"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcreatesemaphore.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateSemaphore</TT
+></A
+>,
+<A
+HREF="sdldestroysemaphore.html"
+><TT
+CLASS="FUNCTION"
+>SDL_DestroySemaphore</TT
+></A
+>,
+<A
+HREF="sdlsemwait.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemWait</TT
+></A
+>,
+<A
+HREF="sdlsemtrywait.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemTryWait</TT
+></A
+>,
+<A
+HREF="sdlsempost.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemPost</TT
+></A
+>,
+<A
+HREF="sdlsemvalue.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SemValue</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlsemtrywait.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlsempost.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_SemTryWait</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_SemPost</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlsetalpha.html b/distrib/sdl-1.2.15/docs/html/sdlsetalpha.html
new file mode 100644
index 0000000..fc84498
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlsetalpha.html
@@ -0,0 +1,500 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_SetAlpha</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_SetColorKey"
+HREF="sdlsetcolorkey.html"><LINK
+REL="NEXT"
+TITLE="SDL_SetClipRect"
+HREF="sdlsetcliprect.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlsetcolorkey.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlsetcliprect.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLSETALPHA"
+></A
+>SDL_SetAlpha</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2096"
+></A
+><H2
+>Name</H2
+>SDL_SetAlpha&nbsp;--&nbsp;Adjust the alpha properties of a surface</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2099"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2100"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_SetAlpha</B
+></CODE
+>(SDL_Surface *surface, Uint32 flag, Uint8 alpha);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2106"
+></A
+><H2
+>Description</H2
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>This function and the semantics of SDL alpha blending have changed since version 1.1.4. Up until version 1.1.5, an alpha value of 0 was considered opaque and a value of 255 was considered transparent. This has now been inverted: 0 (<TT
+CLASS="LITERAL"
+>SDL_ALPHA_TRANSPARENT</TT
+>) is now considered transparent and 255 (<TT
+CLASS="LITERAL"
+>SDL_ALPHA_OPAQUE</TT
+>) is now considered opaque.</P
+></BLOCKQUOTE
+></DIV
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_SetAlpha</TT
+> is used for setting the per-surface alpha
+value and/or enabling and disabling alpha blending.</P
+><P
+>The<TT
+CLASS="PARAMETER"
+><I
+>surface</I
+></TT
+> parameter specifies which surface whose alpha
+attributes you wish to adjust. <TT
+CLASS="PARAMETER"
+><I
+>flags</I
+></TT
+> is used to specify
+whether alpha blending should be used (<TT
+CLASS="LITERAL"
+>SDL_SRCALPHA</TT
+>) and
+whether the surface should use RLE acceleration for blitting
+(<TT
+CLASS="LITERAL"
+>SDL_RLEACCEL</TT
+>). <TT
+CLASS="PARAMETER"
+><I
+>flags</I
+></TT
+> can be an OR'd
+combination of these two options, one of these options or 0. If
+<TT
+CLASS="LITERAL"
+>SDL_SRCALPHA</TT
+> is not passed as a flag then all alpha
+information is ignored when blitting the surface. The
+<TT
+CLASS="PARAMETER"
+><I
+>alpha</I
+></TT
+> parameter is the per-surface alpha value; a
+surface need not have an alpha channel to use per-surface alpha and blitting
+can still be accelerated with <TT
+CLASS="LITERAL"
+>SDL_RLEACCEL</TT
+>.</P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>The per-surface alpha value of 128 is considered a special case and
+is optimised, so it's much faster than other per-surface values.</P
+></BLOCKQUOTE
+></DIV
+><P
+>Alpha effects surface blitting in the following ways:</P
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN2126"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>RGBA-&#62;RGB with <TT
+CLASS="LITERAL"
+>SDL_SRCALPHA</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>The source is alpha-blended with the destination, using the alpha channel. <TT
+CLASS="LITERAL"
+>SDL_SRCCOLORKEY</TT
+> and the per-surface alpha are ignored.</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>RGBA-&#62;RGB without <TT
+CLASS="LITERAL"
+>SDL_SRCALPHA</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>The RGB data is copied from the source. The source alpha channel and the per-surface alpha value are ignored.</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>RGB-&#62;RGBA with <TT
+CLASS="LITERAL"
+>SDL_SRCALPHA</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>The source is alpha-blended with the destination using the per-surface alpha
+value. If <TT
+CLASS="LITERAL"
+>SDL_SRCCOLORKEY</TT
+> is set, only the pixels not
+matching the colorkey value are copied. The alpha channel of the copied pixels
+is set to opaque.</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>RGB-&#62;RGBA without <TT
+CLASS="LITERAL"
+>SDL_SRCALPHA</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>The RGB data is copied from the source and the alpha value of the copied pixels
+is set to opaque. If <TT
+CLASS="LITERAL"
+>SDL_SRCCOLORKEY</TT
+> is set, only the pixels
+not matching the colorkey value are copied. </P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>RGBA-&#62;RGBA with <TT
+CLASS="LITERAL"
+>SDL_SRCALPHA</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>The source is alpha-blended with the destination using the source alpha
+channel. The alpha channel in the destination surface is left untouched.
+<TT
+CLASS="LITERAL"
+>SDL_SRCCOLORKEY</TT
+> is ignored.</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>RGBA-&#62;RGBA without <TT
+CLASS="LITERAL"
+>SDL_SRCALPHA</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>The RGBA data is copied to the destination surface. If <TT
+CLASS="LITERAL"
+>SDL_SRCCOLORKEY</TT
+> is set, only the pixels not matching the colorkey value are copied.</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>RGB-&#62;RGB with <TT
+CLASS="LITERAL"
+>SDL_SRCALPHA</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>The source is alpha-blended with the destination using the per-surface alpha value. If <TT
+CLASS="LITERAL"
+>SDL_SRCCOLORKEY</TT
+> is set, only the pixels not matching the colorkey value are copied.</P
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>RGB-&#62;RGB without <TT
+CLASS="LITERAL"
+>SDL_SRCALPHA</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><P
+>The RGB data is copied from the source. If <TT
+CLASS="LITERAL"
+>SDL_SRCCOLORKEY</TT
+> is set, only the pixels not matching the colorkey value are copied.</P
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+> Note that RGBA-&#62;RGBA blits (with SDL_SRCALPHA set) keep the alpha
+of the destination surface. This means that you cannot compose two arbitrary
+RGBA surfaces this way and get the result you would expect from "overlaying"
+them; the destination alpha will work as a mask.</P
+><P
+>Also note that per-pixel and per-surface alpha cannot be combined;
+the per-pixel alpha is always used if available</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2179"
+></A
+><H2
+>Return Value</H2
+><P
+>This function returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+>, or
+<SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> if there was an error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2184"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlmaprgba.html"
+><TT
+CLASS="FUNCTION"
+>SDL_MapRGBA</TT
+></A
+>,
+<A
+HREF="sdlgetrgba.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetRGBA</TT
+></A
+>,
+<A
+HREF="sdldisplayformatalpha.html"
+><TT
+CLASS="FUNCTION"
+>SDL_DisplayFormatAlpha</TT
+></A
+>,
+<A
+HREF="sdlblitsurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_BlitSurface</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlsetcolorkey.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlsetcliprect.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_SetColorKey</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_SetClipRect</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlsetcliprect.html b/distrib/sdl-1.2.15/docs/html/sdlsetcliprect.html
new file mode 100644
index 0000000..03898d5
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlsetcliprect.html
@@ -0,0 +1,241 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_SetClipRect</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_SetAlpha"
+HREF="sdlsetalpha.html"><LINK
+REL="NEXT"
+TITLE="SDL_GetClipRect"
+HREF="sdlgetcliprect.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlsetalpha.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlgetcliprect.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLSETCLIPRECT"
+></A
+>SDL_SetClipRect</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2199"
+></A
+><H2
+>Name</H2
+>SDL_SetClipRect&nbsp;--&nbsp;Sets the clipping rectangle for a surface.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2202"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2203"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_SetClipRect</B
+></CODE
+>(SDL_Surface *surface, SDL_Rect *rect);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2209"
+></A
+><H2
+>Description</H2
+><P
+>Sets the clipping rectangle for a surface. When this surface is the
+destination of a blit, only the area within the clip rectangle will be
+drawn into.</P
+><P
+>The rectangle pointed to by <TT
+CLASS="PARAMETER"
+><I
+>rect</I
+></TT
+> will be
+clipped to the edges of the surface so that the clip rectangle for a
+surface can never fall outside the edges of the surface.</P
+><P
+>If <TT
+CLASS="PARAMETER"
+><I
+>rect</I
+></TT
+> is <TT
+CLASS="LITERAL"
+>NULL</TT
+> the clipping
+rectangle will be set to the full size of the surface.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2217"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlgetcliprect.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetClipRect</TT
+></A
+>,
+<A
+HREF="sdlblitsurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_BlitSurface</TT
+></A
+>,
+<A
+HREF="sdlsurface.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlsetalpha.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlgetcliprect.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_SetAlpha</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GetClipRect</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlsetcolorkey.html b/distrib/sdl-1.2.15/docs/html/sdlsetcolorkey.html
new file mode 100644
index 0000000..0cb6695
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlsetcolorkey.html
@@ -0,0 +1,321 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_SetColorKey</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_SaveBMP"
+HREF="sdlsavebmp.html"><LINK
+REL="NEXT"
+TITLE="SDL_SetAlpha"
+HREF="sdlsetalpha.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlsavebmp.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlsetalpha.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLSETCOLORKEY"
+></A
+>SDL_SetColorKey</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2045"
+></A
+><H2
+>Name</H2
+>SDL_SetColorKey&nbsp;--&nbsp;Sets the color key (transparent pixel) in a blittable surface and
+RLE acceleration.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2048"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2049"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_SetColorKey</B
+></CODE
+>(SDL_Surface *surface, Uint32 flag, Uint32 key);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2055"
+></A
+><H2
+>Description</H2
+><P
+> Sets the color key (transparent pixel) in a blittable surface and enables or
+ disables RLE blit acceleration.</P
+><P
+>RLE acceleration can substantially speed up blitting of images with large
+horizontal runs of transparent pixels (i.e., pixels that match the
+<TT
+CLASS="PARAMETER"
+><I
+>key</I
+></TT
+> value). The <TT
+CLASS="PARAMETER"
+><I
+>key</I
+></TT
+> must be of the same pixel format as the <TT
+CLASS="PARAMETER"
+><I
+>surface</I
+></TT
+>, <A
+HREF="sdlmaprgb.html"
+><TT
+CLASS="FUNCTION"
+>SDL_MapRGB</TT
+></A
+> is often useful for obtaining an acceptable value.</P
+><P
+>If <TT
+CLASS="PARAMETER"
+><I
+>flag</I
+></TT
+> is <TT
+CLASS="LITERAL"
+>SDL_SRCCOLORKEY</TT
+> then
+<TT
+CLASS="PARAMETER"
+><I
+>key</I
+></TT
+> is the transparent pixel value in the source image of a
+blit.</P
+><P
+>If <TT
+CLASS="PARAMETER"
+><I
+>flag</I
+></TT
+> is OR'd with
+<TT
+CLASS="LITERAL"
+>SDL_RLEACCEL</TT
+> then the surface will be draw using RLE
+acceleration when drawn with
+<A
+HREF="sdlblitsurface.html"
+>SDL_BlitSurface</A
+>. The surface will
+actually be encoded for RLE acceleration the first time
+<A
+HREF="sdlblitsurface.html"
+>SDL_BlitSurface</A
+> or
+<A
+HREF="sdldisplayformat.html"
+>SDL_DisplayFormat</A
+> is called on the
+surface.</P
+><P
+>If <TT
+CLASS="PARAMETER"
+><I
+>flag</I
+></TT
+> is 0, this function clears
+any current color key.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2076"
+></A
+><H2
+>Return Value</H2
+><P
+>This function returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+>, or
+<SPAN
+CLASS="RETURNVALUE"
+>-1</SPAN
+> if there was an error.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2081"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlblitsurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_BlitSurface</TT
+></A
+>,
+<A
+HREF="sdldisplayformat.html"
+><TT
+CLASS="FUNCTION"
+>SDL_DisplayFormat</TT
+></A
+>,
+<A
+HREF="sdlmaprgb.html"
+><TT
+CLASS="FUNCTION"
+>SDL_MapRGB</TT
+></A
+>,
+<A
+HREF="sdlsetalpha.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetAlpha</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlsavebmp.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlsetalpha.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_SaveBMP</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_SetAlpha</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlsetcolors.html b/distrib/sdl-1.2.15/docs/html/sdlsetcolors.html
new file mode 100644
index 0000000..5695645
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlsetcolors.html
@@ -0,0 +1,358 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_SetColors</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_Flip"
+HREF="sdlflip.html"><LINK
+REL="NEXT"
+TITLE="SDL_SetPalette"
+HREF="sdlsetpalette.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlflip.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlsetpalette.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLSETCOLORS"
+></A
+>SDL_SetColors</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1462"
+></A
+><H2
+>Name</H2
+>SDL_SetColors&nbsp;--&nbsp;Sets a portion of the colormap for the given 8-bit surface.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1465"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1466"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_SetColors</B
+></CODE
+>(SDL_Surface *surface, SDL_Color *colors, int firstcolor, int ncolors);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1472"
+></A
+><H2
+>Description</H2
+><P
+>Sets a portion of the colormap for the given 8-bit surface.</P
+><P
+>When <TT
+CLASS="PARAMETER"
+><I
+>surface</I
+></TT
+> is the surface associated with the current
+display, the display colormap will be updated with the requested colors. If
+<TT
+CLASS="LITERAL"
+>SDL_HWPALETTE</TT
+> was set in <A
+HREF="sdlsetvideomode.html"
+>SDL_SetVideoMode</A
+> flags,
+<TT
+CLASS="FUNCTION"
+>SDL_SetColors</TT
+> will always return <SPAN
+CLASS="RETURNVALUE"
+>1</SPAN
+>,
+and the palette is guaranteed to be set the way you desire, even if the window
+colormap has to be warped or run under emulation.</P
+><P
+>The color components of a
+<A
+HREF="sdlcolor.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Color</SPAN
+></A
+>
+structure are 8-bits in size, giving you a total of 256<SUP
+>3</SUP
+>
+=16777216 colors.</P
+><P
+>Palettized (8-bit) screen surfaces with the <TT
+CLASS="LITERAL"
+>SDL_HWPALETTE</TT
+>
+flag have two palettes, a logical palette that is used for mapping blits
+to/from the surface and a physical palette (that determines how the
+hardware will map the colors to the display). <TT
+CLASS="FUNCTION"
+>SDL_SetColors</TT
+>
+modifies both palettes (if present), and is equivalent to calling
+<A
+HREF="sdlsetpalette.html"
+>SDL_SetPalette</A
+> with the
+<TT
+CLASS="PARAMETER"
+><I
+>flags</I
+></TT
+> set to
+<TT
+CLASS="LITERAL"
+>(SDL_LOGPAL | SDL_PHYSPAL)</TT
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1491"
+></A
+><H2
+>Return Value</H2
+><P
+>If <TT
+CLASS="PARAMETER"
+><I
+>surface</I
+></TT
+> is not a palettized surface, this function
+does nothing, returning <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+>. If all of the colors were set
+as passed to <TT
+CLASS="FUNCTION"
+>SDL_SetColors</TT
+>, it will return
+<SPAN
+CLASS="RETURNVALUE"
+>1</SPAN
+>. If not all the color entries were set exactly as
+given, it will return <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+>, and you should look at the
+surface palette to determine the actual color palette.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1499"
+></A
+><H2
+>Example</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>/* Create a display surface with a grayscale palette */
+SDL_Surface *screen;
+SDL_Color colors[256];
+int i;
+.
+.
+.
+/* Fill colors with color information */
+for(i=0;i&#60;256;i++){
+ colors[i].r=i;
+ colors[i].g=i;
+ colors[i].b=i;
+}
+
+/* Create display */
+screen=SDL_SetVideoMode(640, 480, 8, SDL_HWPALETTE);
+if(!screen){
+ printf("Couldn't set video mode: %s\n", SDL_GetError());
+ exit(-1);
+}
+
+/* Set palette */
+SDL_SetColors(screen, colors, 0, 256);
+.
+.
+.
+.</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1502"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcolor.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Color</SPAN
+></A
+>
+<A
+HREF="sdlsurface.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+></A
+>,
+<A
+HREF="sdlsetpalette.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetPalette</TT
+></A
+>,
+<A
+HREF="sdlsetvideomode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlflip.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlsetpalette.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_Flip</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_SetPalette</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlsetcursor.html b/distrib/sdl-1.2.15/docs/html/sdlsetcursor.html
new file mode 100644
index 0000000..9c5443e
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlsetcursor.html
@@ -0,0 +1,222 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_SetCursor</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_FreeCursor"
+HREF="sdlfreecursor.html"><LINK
+REL="NEXT"
+TITLE="SDL_GetCursor"
+HREF="sdlgetcursor.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlfreecursor.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlgetcursor.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLSETCURSOR"
+></A
+>SDL_SetCursor</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2563"
+></A
+><H2
+>Name</H2
+>SDL_SetCursor&nbsp;--&nbsp;Set the currently active mouse cursor.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2566"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2567"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_SetCursor</B
+></CODE
+>(SDL_Cursor *cursor);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2573"
+></A
+><H2
+>Description</H2
+><P
+>Sets the currently active cursor to
+the specified one.
+If the cursor is currently visible, the change will be immediately
+represented on the display.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2576"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlgetcursor.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetCursor</TT
+></A
+>,
+<A
+HREF="sdlcreatecursor.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateCursor</TT
+></A
+>,
+<A
+HREF="sdlshowcursor.html"
+><TT
+CLASS="FUNCTION"
+>SDL_ShowCursor</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlfreecursor.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlgetcursor.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_FreeCursor</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GetCursor</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
diff --git a/distrib/sdl-1.2.15/docs/html/sdlseteventfilter.html b/distrib/sdl-1.2.15/docs/html/sdlseteventfilter.html
new file mode 100644
index 0000000..0808bab
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlseteventfilter.html
@@ -0,0 +1,284 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_SetEventFilter</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Event Functions."
+HREF="eventfunctions.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_PushEvent"
+HREF="sdlpushevent.html"><LINK
+REL="NEXT"
+TITLE="SDL_GetEventFilter"
+HREF="sdlgeteventfilter.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlpushevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlgeteventfilter.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLSETEVENTFILTER"
+></A
+>SDL_SetEventFilter</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5575"
+></A
+><H2
+>Name</H2
+>SDL_SetEventFilter&nbsp;--&nbsp;Sets up a filter to process all events before they are posted
+to the event queue.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN5578"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN5579"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_SetEventFilter</B
+></CODE
+>(SDL_EventFilter filter);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5585"
+></A
+><H2
+>Description</H2
+><P
+>This function sets up a filter to process all events before they are posted
+to the event queue. This is a very powerful and flexible feature. The filter
+is prototyped as:
+<PRE
+CLASS="PROGRAMLISTING"
+>typedef int (*SDL_EventFilter)(const SDL_Event *event);</PRE
+>
+If the filter returns <SPAN
+CLASS="RETURNVALUE"
+>1</SPAN
+>, then the event will be
+added to the internal queue. If it returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+>,
+then the event will be dropped from the queue. This allows selective
+filtering of dynamically.</P
+><P
+>There is one caveat when dealing with the <TT
+CLASS="LITERAL"
+>SDL_QUITEVENT</TT
+> event type. The
+event filter is only called when the window manager desires to close the
+application window. If the event filter returns 1, then the window will
+be closed, otherwise the window will remain open if possible.
+If the quit event is generated by an interrupt signal, it will bypass the
+internal queue and be delivered to the application at the next event poll.</P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>Events pushed onto the queue with <A
+HREF="sdlpushevent.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PushEvent</TT
+></A
+> or <A
+HREF="sdlpeepevents.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PeepEvents</TT
+></A
+> do not get passed through the event filter.</P
+></BLOCKQUOTE
+></DIV
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+><SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>Be Careful!</I
+></SPAN
+> The event filter function may run in a different thread so be careful what you do within it.</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5602"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+>,
+<A
+HREF="sdlgeteventfilter.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetEventFilter</TT
+></A
+>,
+<A
+HREF="sdlpushevent.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PushEvent</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlpushevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlgeteventfilter.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_PushEvent</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GetEventFilter</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlsetgamma.html b/distrib/sdl-1.2.15/docs/html/sdlsetgamma.html
new file mode 100644
index 0000000..6443a96
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlsetgamma.html
@@ -0,0 +1,231 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_SetGamma</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_SetPalette"
+HREF="sdlsetpalette.html"><LINK
+REL="NEXT"
+TITLE="SDL_GetGammaRamp"
+HREF="sdlgetgammaramp.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlsetpalette.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlgetgammaramp.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLSETGAMMA"
+></A
+>SDL_SetGamma</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1569"
+></A
+><H2
+>Name</H2
+>SDL_SetGamma&nbsp;--&nbsp;Sets the color gamma function for the display</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1572"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1573"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_SetGamma</B
+></CODE
+>(float redgamma, float greengamma, float bluegamma);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1579"
+></A
+><H2
+>Description</H2
+><P
+>Sets the "gamma function" for the display of each color component. Gamma
+controls the brightness/contrast of colors displayed on the screen.
+A gamma value of <TT
+CLASS="CONSTANT"
+>1.0</TT
+> is identity (i.e., no adjustment
+is made).</P
+><P
+>This function adjusts the gamma based on the "gamma function" parameter,
+you can directly specify lookup tables for gamma adjustment with
+<A
+HREF="sdlsetgammaramp.html"
+>SDL_SetGammaRamp</A
+>.</P
+><P
+>Not all display hardware is able to change gamma.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1586"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns -1 on error (or if gamma adjustment is not supported).</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1589"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlgetgammaramp.html"
+>SDL_GetGammaRamp</A
+>
+<A
+HREF="sdlsetgammaramp.html"
+>SDL_SetGammaRamp</A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlsetpalette.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlgetgammaramp.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_SetPalette</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GetGammaRamp</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlsetgammaramp.html b/distrib/sdl-1.2.15/docs/html/sdlsetgammaramp.html
new file mode 100644
index 0000000..79599c8
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlsetgammaramp.html
@@ -0,0 +1,230 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_SetGammaRamp</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GetGammaRamp"
+HREF="sdlgetgammaramp.html"><LINK
+REL="NEXT"
+TITLE="SDL_MapRGB"
+HREF="sdlmaprgb.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlgetgammaramp.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlmaprgb.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLSETGAMMARAMP"
+></A
+>SDL_SetGammaRamp</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1624"
+></A
+><H2
+>Name</H2
+>SDL_SetGammaRamp&nbsp;--&nbsp;Sets the color gamma lookup tables for the display</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1627"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1628"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_SetGammaRamp</B
+></CODE
+>(Uint16 *redtable, Uint16 *greentable, Uint16 *bluetable);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1634"
+></A
+><H2
+>Description</H2
+><P
+>Sets the gamma lookup tables for the display for each color component.
+Each table is an array of 256 Uint16 values, representing a mapping
+between the input and output for that channel. The input is the index
+into the array, and the output is the 16-bit gamma value at that index,
+scaled to the output color precision. You may pass NULL to any of the
+channels to leave them unchanged.</P
+><P
+>This function adjusts the gamma based on lookup tables, you can also
+have the gamma calculated based on a "gamma function" parameter with
+<A
+HREF="sdlsetgamma.html"
+>SDL_SetGamma</A
+>.</P
+><P
+>Not all display hardware is able to change gamma.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1640"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns -1 on error (or if gamma adjustment is not supported).</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1643"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlsetgamma.html"
+>SDL_SetGamma</A
+>
+<A
+HREF="sdlgetgammaramp.html"
+>SDL_GetGammaRamp</A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlgetgammaramp.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlmaprgb.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GetGammaRamp</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_MapRGB</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlsetmodstate.html b/distrib/sdl-1.2.15/docs/html/sdlsetmodstate.html
new file mode 100644
index 0000000..ee69a3f
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlsetmodstate.html
@@ -0,0 +1,237 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_SetModState</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Event Functions."
+HREF="eventfunctions.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GetModState"
+HREF="sdlgetmodstate.html"><LINK
+REL="NEXT"
+TITLE="SDL_GetKeyName"
+HREF="sdlgetkeyname.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlgetmodstate.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlgetkeyname.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLSETMODSTATE"
+></A
+>SDL_SetModState</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5752"
+></A
+><H2
+>Name</H2
+>SDL_SetModState&nbsp;--&nbsp;Set the current key modifier state</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN5755"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN5756"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_SetModState</B
+></CODE
+>(SDLMod modstate);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5762"
+></A
+><H2
+>Description</H2
+><P
+>The inverse of <A
+HREF="sdlgetmodstate.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetModState</TT
+></A
+>, <TT
+CLASS="FUNCTION"
+>SDL_SetModState</TT
+> allows you to impose modifier key states on your application.</P
+><P
+>Simply pass your desired modifier states into <TT
+CLASS="PARAMETER"
+><I
+>modstate</I
+></TT
+>. This value my be a logical OR'd combination of the following:</P
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef enum {
+ KMOD_NONE = 0x0000,
+ KMOD_LSHIFT= 0x0001,
+ KMOD_RSHIFT= 0x0002,
+ KMOD_LCTRL = 0x0040,
+ KMOD_RCTRL = 0x0080,
+ KMOD_LALT = 0x0100,
+ KMOD_RALT = 0x0200,
+ KMOD_LMETA = 0x0400,
+ KMOD_RMETA = 0x0800,
+ KMOD_NUM = 0x1000,
+ KMOD_CAPS = 0x2000,
+ KMOD_MODE = 0x4000,
+} SDLMod;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5771"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlgetmodstate.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetModState</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlgetmodstate.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlgetkeyname.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GetModState</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GetKeyName</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlsetpalette.html b/distrib/sdl-1.2.15/docs/html/sdlsetpalette.html
new file mode 100644
index 0000000..1622f15
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlsetpalette.html
@@ -0,0 +1,352 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_SetPalette</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_SetColors"
+HREF="sdlsetcolors.html"><LINK
+REL="NEXT"
+TITLE="SDL_SetGamma"
+HREF="sdlsetgamma.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlsetcolors.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlsetgamma.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLSETPALETTE"
+></A
+>SDL_SetPalette</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1517"
+></A
+><H2
+>Name</H2
+>SDL_SetPalette&nbsp;--&nbsp;Sets the colors in the palette of an 8-bit surface.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1520"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1521"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_SetPalette</B
+></CODE
+>(SDL_Surface *surface, int flags, SDL_Color *colors, int firstcolor, int ncolors);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1527"
+></A
+><H2
+>Description</H2
+><P
+>Sets a portion of the palette for the given 8-bit surface.</P
+><P
+>Palettized (8-bit) screen surfaces with the
+<TT
+CLASS="LITERAL"
+>SDL_HWPALETTE</TT
+> flag have two palettes, a logical
+palette that is used for mapping blits to/from the surface and a
+physical palette (that determines how the hardware will map the colors
+to the display). <A
+HREF="sdlblitsurface.html"
+>SDL_BlitSurface</A
+>
+always uses the logical palette when blitting surfaces (if it has to
+convert between surface pixel formats). Because of this, it is often
+useful to modify only one or the other palette to achieve various
+special color effects (e.g., screen fading, color flashes, screen dimming).</P
+><P
+>This function can modify either the logical or physical palette by
+specifing <TT
+CLASS="LITERAL"
+>SDL_LOGPAL</TT
+> or
+<TT
+CLASS="LITERAL"
+>SDL_PHYSPAL</TT
+>the in the <TT
+CLASS="PARAMETER"
+><I
+>flags</I
+></TT
+>
+parameter.</P
+><P
+>When <TT
+CLASS="PARAMETER"
+><I
+>surface</I
+></TT
+> is the surface associated with the current
+display, the display colormap will be updated with the requested colors. If
+<TT
+CLASS="LITERAL"
+>SDL_HWPALETTE</TT
+> was set in <A
+HREF="sdlsetvideomode.html"
+>SDL_SetVideoMode</A
+> flags,
+<TT
+CLASS="FUNCTION"
+>SDL_SetPalette</TT
+> will always return <SPAN
+CLASS="RETURNVALUE"
+>1</SPAN
+>,
+and the palette is guaranteed to be set the way you desire, even if the window
+colormap has to be warped or run under emulation.</P
+><P
+>The color components of a
+<A
+HREF="sdlcolor.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Color</SPAN
+></A
+> structure
+are 8-bits in size, giving you a total of
+256<SUP
+>3</SUP
+>=16777216 colors.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1547"
+></A
+><H2
+>Return Value</H2
+><P
+>If <TT
+CLASS="PARAMETER"
+><I
+>surface</I
+></TT
+> is not a palettized surface, this function
+does nothing, returning <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+>. If all of the colors were set
+as passed to <TT
+CLASS="FUNCTION"
+>SDL_SetPalette</TT
+>, it will return
+<SPAN
+CLASS="RETURNVALUE"
+>1</SPAN
+>. If not all the color entries were set exactly as
+given, it will return <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+>, and you should look at the
+surface palette to determine the actual color palette.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1555"
+></A
+><H2
+>Example</H2
+><PRE
+CLASS="PROGRAMLISTING"
+> /* Create a display surface with a grayscale palette */
+ SDL_Surface *screen;
+ SDL_Color colors[256];
+ int i;
+ .
+ .
+ .
+ /* Fill colors with color information */
+ for(i=0;i&#60;256;i++){
+ colors[i].r=i;
+ colors[i].g=i;
+ colors[i].b=i;
+ }
+
+ /* Create display */
+ screen=SDL_SetVideoMode(640, 480, 8, SDL_HWPALETTE);
+ if(!screen){
+ printf("Couldn't set video mode: %s\n", SDL_GetError());
+ exit(-1);
+ }
+
+ /* Set palette */
+ SDL_SetPalette(screen, SDL_LOGPAL|SDL_PHYSPAL, colors, 0, 256);
+ .
+ .
+ .
+ .</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1558"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlsetcolors.html"
+>SDL_SetColors</A
+>,
+<A
+HREF="sdlsetvideomode.html"
+>SDL_SetVideoMode</A
+>,
+<A
+HREF="sdlsurface.html"
+>SDL_Surface</A
+>,
+<A
+HREF="sdlcolor.html"
+>SDL_Color</A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlsetcolors.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlsetgamma.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_SetColors</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_SetGamma</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlsettimer.html b/distrib/sdl-1.2.15/docs/html/sdlsettimer.html
new file mode 100644
index 0000000..40b737c
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlsettimer.html
@@ -0,0 +1,267 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_SetTimer</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Time"
+HREF="time.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_RemoveTimer"
+HREF="sdlremovetimer.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlremovetimer.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+>&nbsp;</TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLSETTIMER"
+></A
+>SDL_SetTimer</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN8557"
+></A
+><H2
+>Name</H2
+>SDL_SetTimer&nbsp;--&nbsp;Set a callback to run after the specified number of milliseconds has
+elapsed.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN8560"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN8561"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_SetTimer</B
+></CODE
+>(Uint32 interval, SDL_TimerCallback callback);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="SDLTIMERCALLBACK"
+></A
+><H2
+>Callback</H2
+><P
+>/* Function prototype for the timer callback function */
+typedef Uint32 (*SDL_TimerCallback)(Uint32 interval);</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8570"
+></A
+><H2
+>Description</H2
+><P
+>Set a callback to run after the specified number of milliseconds has
+elapsed. The callback function is passed the current timer interval
+and returns the next timer interval. If the returned value is the
+same as the one passed in, the periodic alarm continues, otherwise a
+new alarm is scheduled.</P
+><P
+>To cancel a currently running timer, call
+<TT
+CLASS="FUNCTION"
+>SDL_SetTimer(0, NULL);</TT
+></P
+><P
+>The timer callback function may run in a different thread than your
+main constant, and so shouldn't call any functions from within itself.</P
+><P
+>The maximum resolution of this timer is 10 ms, which means that if
+you request a 16 ms timer, your callback will run approximately 20 ms
+later on an unloaded system. If you wanted to set a flag signaling
+a frame update at 30 frames per second (every 33 ms), you might set a
+timer for 30 ms (see example below).</P
+><P
+>If you use this function, you need to pass <TT
+CLASS="LITERAL"
+>SDL_INIT_TIMER</TT
+>
+to <TT
+CLASS="FUNCTION"
+>SDL_Init()</TT
+>.</P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>This function is kept for compatibility but has been superseded
+by the new timer functions
+<A
+HREF="sdladdtimer.html"
+>SDL_AddTimer</A
+> and
+<A
+HREF="sdlremovetimer.html"
+>SDL_RemoveTimer</A
+> which support
+multiple timers.</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8584"
+></A
+><H2
+>Examples</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>SDL_SetTimer((33/10)*10, my_callback);</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN8588"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdladdtimer.html"
+><TT
+CLASS="FUNCTION"
+>SDL_AddTimer</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlremovetimer.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>&nbsp;</TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_RemoveTimer</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="time.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>&nbsp;</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlsetvideomode.html b/distrib/sdl-1.2.15/docs/html/sdlsetvideomode.html
new file mode 100644
index 0000000..8b309b0
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlsetvideomode.html
@@ -0,0 +1,558 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_SetVideoMode</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_VideoModeOK"
+HREF="sdlvideomodeok.html"><LINK
+REL="NEXT"
+TITLE="SDL_UpdateRect"
+HREF="sdlupdaterect.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlvideomodeok.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlupdaterect.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLSETVIDEOMODE"
+></A
+>SDL_SetVideoMode</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1239"
+></A
+><H2
+>Name</H2
+>SDL_SetVideoMode&nbsp;--&nbsp;Set up a video mode with the specified width, height and bits-per-pixel.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1242"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1243"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_Surface *<B
+CLASS="FSFUNC"
+>SDL_SetVideoMode</B
+></CODE
+>(int width, int height, int bpp, Uint32 flags);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1249"
+></A
+><H2
+>Description</H2
+><P
+>Set up a video mode with the specified width, height and bits-per-pixel.</P
+><P
+>If <TT
+CLASS="PARAMETER"
+><I
+>bpp</I
+></TT
+> is 0, it is treated as the
+current display bits per pixel.</P
+><P
+>The <TT
+CLASS="PARAMETER"
+><I
+>flags</I
+></TT
+> parameter is the same as the <TT
+CLASS="STRUCTFIELD"
+><I
+>flags</I
+></TT
+> field of the <A
+HREF="sdlsurface.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+></A
+> structure. OR'd combinations of the following values are valid.</P
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN1259"
+></A
+><P
+></P
+><TABLE
+BORDER="1"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_SWSURFACE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Create the video surface in system memory</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_HWSURFACE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Create the video surface in video memory</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_ASYNCBLIT</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Enables the use of asynchronous updates of the display surface. This will
+usually slow down blitting on single CPU machines, but may provide a speed
+increase on SMP systems.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_ANYFORMAT</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Normally, if a video surface of the requested bits-per-pixel (<TT
+CLASS="PARAMETER"
+><I
+>bpp</I
+></TT
+>) is not available, SDL will emulate one with a shadow surface. Passing <TT
+CLASS="LITERAL"
+>SDL_ANYFORMAT</TT
+> prevents this and causes SDL to use the video surface, regardless of its pixel depth.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_HWPALETTE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Give SDL exclusive palette access. Without this flag you may not always get the the colors you request with <A
+HREF="sdlsetcolors.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetColors</TT
+></A
+> or <A
+HREF="sdlsetpalette.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetPalette</TT
+></A
+>.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_DOUBLEBUF</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Enable hardware double buffering; only valid with SDL_HWSURFACE. Calling
+<A
+HREF="sdlflip.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Flip</TT
+></A
+> will flip the
+buffers and update the screen. All drawing will take place on the surface
+that is not displayed at the moment. If double buffering could not be enabled
+then <TT
+CLASS="FUNCTION"
+>SDL_Flip</TT
+> will just perform a
+<A
+HREF="sdlupdaterect.html"
+><TT
+CLASS="FUNCTION"
+>SDL_UpdateRect</TT
+></A
+>
+on the entire screen.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_FULLSCREEN</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>SDL will attempt to use a fullscreen mode. If a hardware resolution change is
+not possible (for whatever reason), the next higher resolution will be used and
+the display window centered on a black background.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_OPENGL</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Create an OpenGL rendering context. You should have previously set OpenGL video attributes with <A
+HREF="sdlglsetattribute.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GL_SetAttribute</TT
+></A
+>.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_OPENGLBLIT</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Create an OpenGL rendering context, like above, but allow normal blitting
+operations. The screen (2D) surface may have an alpha channel, and
+<A
+HREF="sdlupdaterects.html"
+><TT
+CLASS="FUNCTION"
+>SDL_UpdateRects</TT
+></A
+>
+must be used for updating changes to the screen surface. NOTE: This option
+is kept for compatibility only, and is <SPAN
+CLASS="emphasis"
+><I
+CLASS="EMPHASIS"
+>not</I
+></SPAN
+> recommended for
+new code.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_RESIZABLE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Create a resizable window. When the window is resized by the user a <A
+HREF="sdlresizeevent.html"
+><TT
+CLASS="LITERAL"
+>SDL_VIDEORESIZE</TT
+></A
+> event is generated and <TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+> can be called again with the new size.</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_NOFRAME</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>If possible, <TT
+CLASS="LITERAL"
+>SDL_NOFRAME</TT
+> causes SDL to create a window with no title bar or frame decoration. Fullscreen modes automatically have this flag set.</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>Whatever <TT
+CLASS="PARAMETER"
+><I
+>flags</I
+></TT
+> <TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+> could satisfy are set in the <TT
+CLASS="STRUCTFIELD"
+><I
+>flags</I
+></TT
+> member of the returned surface.</P
+></BLOCKQUOTE
+></DIV
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>The <TT
+CLASS="PARAMETER"
+><I
+>bpp</I
+></TT
+> parameter is the number of bits per pixel,
+so a <TT
+CLASS="PARAMETER"
+><I
+>bpp</I
+></TT
+> of 24 uses the packed representation of
+3 bytes/pixel. For the more common 4 bytes/pixel mode, use a
+<TT
+CLASS="PARAMETER"
+><I
+>bpp</I
+></TT
+> of 32. Somewhat oddly, both 15 and 16 will
+request a 2 bytes/pixel mode, but different pixel formats.</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1336"
+></A
+><H2
+>Return Value</H2
+><P
+>The framebuffer surface, or <SPAN
+CLASS="RETURNVALUE"
+>NULL</SPAN
+> if it fails.
+The surface returned is freed by SDL_Quit() and should nt be freed by
+the caller.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1340"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdllocksurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_LockSurface</TT
+></A
+>,
+<A
+HREF="sdlsetcolors.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetColors</TT
+></A
+>,
+<A
+HREF="sdlflip.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Flip</TT
+></A
+>,
+<A
+HREF="sdlsurface.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlvideomodeok.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlupdaterect.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_VideoModeOK</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_UpdateRect</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlshowcursor.html b/distrib/sdl-1.2.15/docs/html/sdlshowcursor.html
new file mode 100644
index 0000000..5a8f19d
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlshowcursor.html
@@ -0,0 +1,239 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_ShowCursor</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GetCursor"
+HREF="sdlgetcursor.html"><LINK
+REL="NEXT"
+TITLE="SDL_GL_LoadLibrary"
+HREF="sdlglloadlibrary.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlgetcursor.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlglloadlibrary.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLSHOWCURSOR"
+></A
+>SDL_ShowCursor</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2615"
+></A
+><H2
+>Name</H2
+>SDL_ShowCursor&nbsp;--&nbsp;Toggle whether or not the cursor is shown on the screen.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2618"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2619"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_ShowCursor</B
+></CODE
+>(int toggle);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2625"
+></A
+><H2
+>Description</H2
+><P
+>Toggle whether or not the cursor is shown on the screen. Passing <TT
+CLASS="LITERAL"
+>SDL_ENABLE</TT
+> displays the cursor and passing <TT
+CLASS="LITERAL"
+>SDL_DISABLE</TT
+> hides it. The current state of the mouse cursor can be queried by passing <TT
+CLASS="LITERAL"
+>SDL_QUERY</TT
+>, either <TT
+CLASS="LITERAL"
+>SDL_DISABLE</TT
+> or <TT
+CLASS="LITERAL"
+>SDL_ENABLE</TT
+> will be returned.</P
+><P
+>The cursor starts off displayed, but can be turned off.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2634"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns the current state of the cursor.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2637"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcreatecursor.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateCursor</TT
+></A
+>,
+<A
+HREF="sdlsetcursor.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetCursor</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlgetcursor.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlglloadlibrary.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GetCursor</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GL_LoadLibrary</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlsurface.html b/distrib/sdl-1.2.15/docs/html/sdlsurface.html
new file mode 100644
index 0000000..fda55f1
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlsurface.html
@@ -0,0 +1,597 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_Surface</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_PixelFormat"
+HREF="sdlpixelformat.html"><LINK
+REL="NEXT"
+TITLE="SDL_VideoInfo"
+HREF="sdlvideoinfo.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlpixelformat.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlvideoinfo.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLSURFACE"
+></A
+>SDL_Surface</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN3263"
+></A
+><H2
+>Name</H2
+>SDL_Surface&nbsp;--&nbsp;Graphical Surface Structure</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3266"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct SDL_Surface {
+ Uint32 flags; /* Read-only */
+ SDL_PixelFormat *format; /* Read-only */
+ int w, h; /* Read-only */
+ Uint16 pitch; /* Read-only */
+ void *pixels; /* Read-write */
+
+ /* clipping information */
+ SDL_Rect clip_rect; /* Read-only */
+
+ /* Reference count -- used when freeing surface */
+ int refcount; /* Read-mostly */
+
+ /* This structure also contains private fields not shown here */
+} SDL_Surface;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3269"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN3271"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>flags</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Surface flags</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>format</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Pixel <A
+HREF="sdlpixelformat.html"
+>format</A
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>w, h</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Width and height of the surface</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>pitch</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Length of a surface scanline in bytes</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>pixels</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Pointer to the actual pixel data</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>clip_rect</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>surface clip <A
+HREF="sdlrect.html"
+>rectangle</A
+></TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3300"
+></A
+><H2
+>Description</H2
+><P
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+>'s represent areas of "graphical"
+memory, memory that can be drawn to. The video framebuffer is returned
+as a <SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+> by
+<A
+HREF="sdlsetvideomode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+></A
+>
+and <A
+HREF="sdlgetvideosurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetVideoSurface</TT
+></A
+>.
+Most of the fields should be pretty obvious.
+<TT
+CLASS="STRUCTFIELD"
+><I
+>w</I
+></TT
+> and <TT
+CLASS="STRUCTFIELD"
+><I
+>h</I
+></TT
+> are the
+width and height of the surface in pixels.
+<TT
+CLASS="STRUCTFIELD"
+><I
+>pixels</I
+></TT
+> is a pointer to the actual pixel data,
+the surface should be <A
+HREF="sdllocksurface.html"
+>locked</A
+>
+before accessing this field. The <TT
+CLASS="STRUCTFIELD"
+><I
+>clip_rect</I
+></TT
+> field
+is the clipping rectangle as set by
+<A
+HREF="sdlsetcliprect.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetClipRect</TT
+></A
+>.</P
+><P
+>The following are supported in the
+<TT
+CLASS="STRUCTFIELD"
+><I
+>flags</I
+></TT
+> field.</P
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN3318"
+></A
+><P
+></P
+><TABLE
+BORDER="1"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_SWSURFACE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Surface is stored in system memory</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_HWSURFACE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Surface is stored in video memory</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_ASYNCBLIT</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Surface uses asynchronous blits if possible</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_ANYFORMAT</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Allows any pixel-format (Display surface)</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_HWPALETTE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Surface has exclusive palette</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_DOUBLEBUF</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Surface is double buffered (Display surface)</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_FULLSCREEN</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Surface is full screen (Display Surface)</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_OPENGL</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Surface has an OpenGL context (Display Surface)</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_OPENGLBLIT</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Surface supports OpenGL blitting (Display Surface)</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_RESIZABLE</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Surface is resizable (Display Surface)</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_HWACCEL</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Surface blit uses hardware acceleration</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_SRCCOLORKEY</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Surface use colorkey blitting</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_RLEACCEL</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Colorkey blitting is accelerated with RLE</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_SRCALPHA</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Surface blit uses alpha blending</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_PREALLOC</TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Surface uses preallocated memory</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3381"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlpixelformat.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_PixelFormat</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlpixelformat.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlvideoinfo.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_PixelFormat</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_VideoInfo</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlsyswmevent.html b/distrib/sdl-1.2.15/docs/html/sdlsyswmevent.html
new file mode 100644
index 0000000..fd7180e
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlsyswmevent.html
@@ -0,0 +1,233 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_SysWMEvent</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Event Structures."
+HREF="eventstructures.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_ExposeEvent"
+HREF="sdlexposeevent.html"><LINK
+REL="NEXT"
+TITLE="SDL_UserEvent"
+HREF="sdluserevent.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlexposeevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdluserevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLSYSWMEVENT"
+></A
+>SDL_SysWMEvent</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4538"
+></A
+><H2
+>Name</H2
+>SDL_SysWMEvent&nbsp;--&nbsp;Platform-dependent window manager event.</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4541"
+></A
+><H2
+>Description</H2
+><P
+>The system window manager event contains a pointer to system-specific
+information about unknown window manager events. If you enable this event
+using
+<A
+HREF="sdleventstate.html"
+><TT
+CLASS="FUNCTION"
+>SDL_EventState()</TT
+></A
+>,
+it will be generated whenever unhandled events are received from the window
+manager. This can be used, for example, to implement cut-and-paste in your
+application.
+
+<PRE
+CLASS="PROGRAMLISTING"
+>typedef struct {
+ Uint8 type; /* Always SDL_SYSWMEVENT */
+ SDL_SysWMmsg *msg;
+ } SDL_SysWMEvent;</PRE
+>
+
+If you want to obtain system-specific information about the window manager,
+you can fill the version member of a <SPAN
+CLASS="STRUCTNAME"
+>SDL_SysWMinfo</SPAN
+>
+structure (details can be found in <TT
+CLASS="FILENAME"
+>SDL_syswm.h</TT
+>, which must be included) using the <TT
+CLASS="FUNCTION"
+>SDL_VERSION()</TT
+> macro found in
+<TT
+CLASS="FILENAME"
+>SDL_version.h</TT
+>, and pass it to the
+function:
+<DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN4551"
+></A
+><P
+></P
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_GetWMInfo</B
+></CODE
+>(SDL_SysWMinfo *info);</CODE
+></P
+><P
+></P
+></DIV
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4556"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdleventstate.html"
+><TT
+CLASS="FUNCTION"
+>SDL_EventState</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlexposeevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdluserevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_ExposeEvent</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventstructures.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_UserEvent</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlthreadid.html b/distrib/sdl-1.2.15/docs/html/sdlthreadid.html
new file mode 100644
index 0000000..e0bde2e
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlthreadid.html
@@ -0,0 +1,190 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_ThreadID</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CreateThread"
+HREF="sdlcreatethread.html"><LINK
+REL="NEXT"
+TITLE="SDL_GetThreadID"
+HREF="sdlgetthreadid.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcreatethread.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlgetthreadid.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLTHREADID"
+></A
+>SDL_ThreadID</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7726"
+></A
+><H2
+>Name</H2
+>SDL_ThreadID&nbsp;--&nbsp;Get the 32-bit thread identifier for the current thread.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7729"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7730"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>Uint32 <B
+CLASS="FSFUNC"
+>SDL_ThreadID</B
+></CODE
+>(void);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7736"
+></A
+><H2
+>Description</H2
+><P
+>Get the 32-bit thread identifier for the current thread.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcreatethread.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlgetthreadid.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CreateThread</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GetThreadID</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlunlockaudio.html b/distrib/sdl-1.2.15/docs/html/sdlunlockaudio.html
new file mode 100644
index 0000000..0019bd6
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlunlockaudio.html
@@ -0,0 +1,211 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_UnlockAudio</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Audio"
+HREF="audio.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_LockAudio"
+HREF="sdllockaudio.html"><LINK
+REL="NEXT"
+TITLE="SDL_CloseAudio"
+HREF="sdlcloseaudio.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdllockaudio.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcloseaudio.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLUNLOCKAUDIO"
+></A
+>SDL_UnlockAudio</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7156"
+></A
+><H2
+>Name</H2
+>SDL_UnlockAudio&nbsp;--&nbsp;Unlock the callback function</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7159"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7160"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_UnlockAudio</B
+></CODE
+>(void);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7166"
+></A
+><H2
+>Description</H2
+><P
+>Unlocks a previous <A
+HREF="sdllockaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_LockAudio</TT
+></A
+> call.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7171"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlopenaudio.html"
+><TT
+CLASS="FUNCTION"
+>SDL_OpenAudio</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdllockaudio.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcloseaudio.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_LockAudio</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="audio.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CloseAudio</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlunlocksurface.html b/distrib/sdl-1.2.15/docs/html/sdlunlocksurface.html
new file mode 100644
index 0000000..13ba5fc
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlunlocksurface.html
@@ -0,0 +1,219 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_UnlockSurface</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_LockSurface"
+HREF="sdllocksurface.html"><LINK
+REL="NEXT"
+TITLE="SDL_LoadBMP"
+HREF="sdlloadbmp.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdllocksurface.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlloadbmp.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLUNLOCKSURFACE"
+></A
+>SDL_UnlockSurface</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1962"
+></A
+><H2
+>Name</H2
+>SDL_UnlockSurface&nbsp;--&nbsp;Unlocks a previously locked surface.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1965"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1966"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_UnlockSurface</B
+></CODE
+>(SDL_Surface *surface);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1972"
+></A
+><H2
+>Description</H2
+><P
+>Surfaces that were previously locked using <TT
+CLASS="FUNCTION"
+>SDL_LockSurface</TT
+> must be unlocked with <TT
+CLASS="FUNCTION"
+>SDL_UnlockSurface</TT
+>. Surfaces should be unlocked as soon as possible.</P
+><P
+>It should be noted that since 1.1.8, surface locks are recursive. See <A
+HREF="sdllocksurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_LockSurface</TT
+></A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1980"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdllocksurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_LockSurface</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdllocksurface.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlloadbmp.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_LockSurface</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_LoadBMP</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlunlockyuvoverlay.html b/distrib/sdl-1.2.15/docs/html/sdlunlockyuvoverlay.html
new file mode 100644
index 0000000..936ed9e
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlunlockyuvoverlay.html
@@ -0,0 +1,225 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_UnlockYUVOverlay</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_LockYUVOverlay"
+HREF="sdllockyuvoverlay.html"><LINK
+REL="NEXT"
+TITLE="SDL_DisplayYUVOverlay"
+HREF="sdldisplayyuvoverlay.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdllockyuvoverlay.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdldisplayyuvoverlay.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLUNLOCKYUVOVERLAY"
+></A
+>SDL_UnlockYUVOverlay</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2880"
+></A
+><H2
+>Name</H2
+>SDL_UnlockYUVOverlay&nbsp;--&nbsp;Unlock an overlay</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2883"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2884"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_UnlockYUVOverlay</B
+></CODE
+>(SDL_Overlay *overlay);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2890"
+></A
+><H2
+>Description</H2
+><P
+>The opposite to <A
+HREF="sdllockyuvoverlay.html"
+><TT
+CLASS="FUNCTION"
+>SDL_LockYUVOverlay</TT
+></A
+>. Unlocks a previously locked overlay. An overlay must be unlocked before it can be displayed.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2895"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdllockyuvoverlay.html"
+><TT
+CLASS="FUNCTION"
+>SDL_UnlockYUVOverlay</TT
+></A
+>,
+<A
+HREF="sdlcreateyuvoverlay.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateYUVOverlay</TT
+></A
+>,
+<A
+HREF="sdloverlay.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Overlay</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdllockyuvoverlay.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdldisplayyuvoverlay.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_LockYUVOverlay</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_DisplayYUVOverlay</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlupdaterect.html b/distrib/sdl-1.2.15/docs/html/sdlupdaterect.html
new file mode 100644
index 0000000..f54d9f5
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlupdaterect.html
@@ -0,0 +1,266 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_UpdateRect</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_SetVideoMode"
+HREF="sdlsetvideomode.html"><LINK
+REL="NEXT"
+TITLE="SDL_UpdateRects"
+HREF="sdlupdaterects.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlsetvideomode.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlupdaterects.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLUPDATERECT"
+></A
+>SDL_UpdateRect</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1355"
+></A
+><H2
+>Name</H2
+>SDL_UpdateRect&nbsp;--&nbsp;Makes sure the given area is updated on the given screen.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1358"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1359"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_UpdateRect</B
+></CODE
+>(SDL_Surface *screen, Sint32 x, Sint32 y, Sint32 w, Sint32 h);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1365"
+></A
+><H2
+>Description</H2
+><P
+>Makes sure the given area is updated on the given screen. The rectangle must
+be confined within the screen boundaries (no clipping is done).</P
+><P
+>If '<TT
+CLASS="PARAMETER"
+><I
+>x</I
+></TT
+>', '<TT
+CLASS="PARAMETER"
+><I
+>y</I
+></TT
+>', '<TT
+CLASS="PARAMETER"
+><I
+>w</I
+></TT
+>'
+and '<TT
+CLASS="PARAMETER"
+><I
+>h</I
+></TT
+>' are all 0,
+<TT
+CLASS="FUNCTION"
+>SDL_UpdateRect</TT
+> will update the
+entire screen.</P
+><P
+>This function should not be called while '<TT
+CLASS="PARAMETER"
+><I
+>screen</I
+></TT
+>' is
+<A
+HREF="sdllocksurface.html"
+>locked</A
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1377"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlupdaterects.html"
+><TT
+CLASS="FUNCTION"
+>SDL_UpdateRects</TT
+></A
+>,
+<A
+HREF="sdlrect.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Rect</SPAN
+></A
+>,
+<A
+HREF="sdlsurface.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+></A
+>,
+<A
+HREF="sdllocksurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_LockSurface</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlsetvideomode.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlupdaterects.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_SetVideoMode</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_UpdateRects</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlupdaterects.html b/distrib/sdl-1.2.15/docs/html/sdlupdaterects.html
new file mode 100644
index 0000000..0553a7a
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlupdaterects.html
@@ -0,0 +1,255 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_UpdateRects</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_UpdateRect"
+HREF="sdlupdaterect.html"><LINK
+REL="NEXT"
+TITLE="SDL_Flip"
+HREF="sdlflip.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlupdaterect.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlflip.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLUPDATERECTS"
+></A
+>SDL_UpdateRects</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1392"
+></A
+><H2
+>Name</H2
+>SDL_UpdateRects&nbsp;--&nbsp;Makes sure the given list of rectangles is updated on the given screen.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1395"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1396"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_UpdateRects</B
+></CODE
+>(SDL_Surface *screen, int numrects, SDL_Rect *rects);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1402"
+></A
+><H2
+>Description</H2
+><P
+>Makes sure the given list of rectangles is updated on the given screen.
+The rectangles must all be confined within the screen boundaries (no
+clipping is done).</P
+><P
+>This function should not be called while <TT
+CLASS="PARAMETER"
+><I
+>screen</I
+></TT
+> is
+<A
+HREF="sdllocksurface.html"
+>locked</A
+>.</P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>It is adviced to call this function only once per frame, since each
+call has some processing overhead. This is no restriction since you
+can pass any number of rectangles each time.</P
+><P
+>The rectangles are not automatically merged or checked for overlap. In
+general, the programmer can use his knowledge about his particular
+rectangles to merge them in an efficient way, to avoid overdraw.</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1411"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlupdaterect.html"
+><TT
+CLASS="FUNCTION"
+>SDL_UpdateRect</TT
+></A
+>,
+<A
+HREF="sdlrect.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Rect</SPAN
+></A
+>,
+<A
+HREF="sdlsurface.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Surface</SPAN
+></A
+>,
+<A
+HREF="sdllocksurface.html"
+><TT
+CLASS="FUNCTION"
+>SDL_LockSurface</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlupdaterect.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlflip.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_UpdateRect</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_Flip</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdluserevent.html b/distrib/sdl-1.2.15/docs/html/sdluserevent.html
new file mode 100644
index 0000000..178769c
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdluserevent.html
@@ -0,0 +1,337 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_UserEvent</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Event Structures."
+HREF="eventstructures.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_SysWMEvent"
+HREF="sdlsyswmevent.html"><LINK
+REL="NEXT"
+TITLE="SDL_QuitEvent"
+HREF="sdlquitevent.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlsyswmevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlquitevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLUSEREVENT"
+></A
+>SDL_UserEvent</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN4565"
+></A
+><H2
+>Name</H2
+>SDL_UserEvent&nbsp;--&nbsp;A user-defined event type</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4568"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ Uint8 type;
+ int code;
+ void *data1;
+ void *data2;
+} SDL_UserEvent;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4571"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN4573"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="LITERAL"
+>SDL_USEREVENT</TT
+> through to <TT
+CLASS="LITERAL"
+>SDL_NUMEVENTS-1</TT
+></TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>code</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>User defined event code</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>data1</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>User defined data pointer</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>data2</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>User defined data pointer</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4594"
+></A
+><H2
+>Description</H2
+><P
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_UserEvent</SPAN
+> is in the <TT
+CLASS="STRUCTFIELD"
+><I
+>user</I
+></TT
+> member of the structure <A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+>. This event is unique, it is never created by SDL but only by the user. The event can be pushed onto the event queue using <A
+HREF="sdlpushevent.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PushEvent</TT
+></A
+>. The contents of the structure members or completely up to the programmer, the only requirement is that <TT
+CLASS="STRUCTFIELD"
+><I
+>type</I
+></TT
+> is a value from <TT
+CLASS="LITERAL"
+>SDL_USEREVENT</TT
+> to <TT
+CLASS="LITERAL"
+>SDL_NUMEVENTS-1</TT
+> (inclusive).</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4606"
+></A
+><H2
+>Examples</H2
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>SDL_Event event;
+
+event.type = SDL_USEREVENT;
+event.user.code = my_event_code;
+event.user.data1 = significant_data;
+event.user.data2 = 0;
+SDL_PushEvent(&#38;event);</PRE
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN4610"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+>,
+<A
+HREF="sdlpushevent.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PushEvent</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlsyswmevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlquitevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_SysWMEvent</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventstructures.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_QuitEvent</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlvideodrivername.html b/distrib/sdl-1.2.15/docs/html/sdlvideodrivername.html
new file mode 100644
index 0000000..1419656
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlvideodrivername.html
@@ -0,0 +1,243 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_VideoDriverName</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GetVideoInfo"
+HREF="sdlgetvideoinfo.html"><LINK
+REL="NEXT"
+TITLE="SDL_ListModes"
+HREF="sdllistmodes.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlgetvideoinfo.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdllistmodes.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLVIDEODRIVERNAME"
+></A
+>SDL_VideoDriverName</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1127"
+></A
+><H2
+>Name</H2
+>SDL_VideoDriverName&nbsp;--&nbsp;Obtain the name of the video driver</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1130"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1131"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>char *<B
+CLASS="FSFUNC"
+>SDL_VideoDriverName</B
+></CODE
+>(char *namebuf, int maxlen);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1137"
+></A
+><H2
+>Description</H2
+><P
+>The buffer pointed to by <TT
+CLASS="PARAMETER"
+><I
+>namebuf</I
+></TT
+> is filled up to a maximum of <TT
+CLASS="PARAMETER"
+><I
+>maxlen</I
+></TT
+> characters (include the NULL terminator) with the name of the initialised video driver. The driver name is a simple one word identifier like "x11" or "windib".</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1142"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns <TT
+CLASS="LITERAL"
+>NULL</TT
+> if video has not been initialised with <TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+> or a pointer to <TT
+CLASS="PARAMETER"
+><I
+>namebuf</I
+></TT
+> otherwise.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1148"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlinit.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+></A
+>
+<A
+HREF="sdlinitsubsystem.html"
+><TT
+CLASS="FUNCTION"
+>SDL_InitSubSystem</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlgetvideoinfo.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdllistmodes.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GetVideoInfo</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_ListModes</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlvideoinfo.html b/distrib/sdl-1.2.15/docs/html/sdlvideoinfo.html
new file mode 100644
index 0000000..3a0da31
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlvideoinfo.html
@@ -0,0 +1,408 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_VideoInfo</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_Surface"
+HREF="sdlsurface.html"><LINK
+REL="NEXT"
+TITLE="SDL_Overlay"
+HREF="sdloverlay.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlsurface.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdloverlay.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLVIDEOINFO"
+></A
+>SDL_VideoInfo</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN3390"
+></A
+><H2
+>Name</H2
+>SDL_VideoInfo&nbsp;--&nbsp;Video Target information</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3393"
+></A
+><H2
+>Structure Definition</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef struct{
+ Uint32 hw_available:1;
+ Uint32 wm_available:1;
+ Uint32 blit_hw:1;
+ Uint32 blit_hw_CC:1;
+ Uint32 blit_hw_A:1;
+ Uint32 blit_sw:1;
+ Uint32 blit_sw_CC:1;
+ Uint32 blit_sw_A:1;
+ Uint32 blit_fill;
+ Uint32 video_mem;
+ SDL_PixelFormat *vfmt;
+} SDL_VideoInfo;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3396"
+></A
+><H2
+>Structure Data</H2
+><DIV
+CLASS="INFORMALTABLE"
+><A
+NAME="AEN3398"
+></A
+><P
+></P
+><TABLE
+BORDER="0"
+CLASS="CALSTABLE"
+><TBODY
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>hw_available</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Is it possible to create hardware surfaces?</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>wm_available</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Is there a window manager available</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>blit_hw</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Are hardware to hardware blits accelerated?</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>blit_hw_CC</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Are hardware to hardware colorkey blits accelerated?</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>blit_hw_A</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Are hardware to hardware alpha blits accelerated?</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>blit_sw</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Are software to hardware blits accelerated?</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>blit_sw_CC</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Are software to hardware colorkey blits accelerated?</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>blit_sw_A</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Are software to hardware alpha blits accelerated?</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>blit_fill</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Are color fills accelerated?</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>video_mem</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+>Total amount of video memory in Kilobytes</TD
+></TR
+><TR
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><TT
+CLASS="STRUCTFIELD"
+><I
+>vfmt</I
+></TT
+></TD
+><TD
+ALIGN="LEFT"
+VALIGN="TOP"
+><A
+HREF="sdlpixelformat.html"
+>Pixel format</A
+> of the video device</TD
+></TR
+></TBODY
+></TABLE
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3446"
+></A
+><H2
+>Description</H2
+><P
+>This (read-only) structure is returned by <A
+HREF="sdlgetvideoinfo.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetVideoInfo</TT
+></A
+>. It contains information on either the 'best' available mode (if called before <A
+HREF="sdlsetvideomode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+></A
+>) or the current video mode.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3453"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlpixelformat.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_PixelFormat</SPAN
+></A
+>,
+<A
+HREF="sdlgetvideoinfo.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetVideoInfo</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlsurface.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdloverlay.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_Surface</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_Overlay</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlvideomodeok.html b/distrib/sdl-1.2.15/docs/html/sdlvideomodeok.html
new file mode 100644
index 0000000..5d2d6c4
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlvideomodeok.html
@@ -0,0 +1,270 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_VideoModeOK</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_ListModes"
+HREF="sdllistmodes.html"><LINK
+REL="NEXT"
+TITLE="SDL_SetVideoMode"
+HREF="sdlsetvideomode.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdllistmodes.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlsetvideomode.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLVIDEOMODEOK"
+></A
+>SDL_VideoModeOK</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN1202"
+></A
+><H2
+>Name</H2
+>SDL_VideoModeOK&nbsp;--&nbsp;Check to see if a particular video mode is supported.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN1205"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN1206"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_VideoModeOK</B
+></CODE
+>(int width, int height, int bpp, Uint32 flags);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1212"
+></A
+><H2
+>Description</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_VideoModeOK</TT
+> returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+>
+if the requested mode is not supported under any bit depth, or returns the
+bits-per-pixel of the closest available mode with the given width, height and requested <A
+HREF="sdlsurface.html"
+>surface</A
+> flags (see <A
+HREF="sdlsetvideomode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+></A
+>).</P
+><P
+>The bits-per-pixel value returned is only a suggested mode. You can usually request and bpp you want when <A
+HREF="sdlsetvideomode.html"
+>setting</A
+> the video mode and SDL will emulate that color depth with a shadow video surface.</P
+><P
+>The arguments to <TT
+CLASS="FUNCTION"
+>SDL_VideoModeOK</TT
+> are the same ones you
+would pass to <A
+HREF="sdlsetvideomode.html"
+>SDL_SetVideoMode</A
+></P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1225"
+></A
+><H2
+>Example</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>SDL_Surface *screen;
+Uint32 bpp;
+.
+.
+.
+printf("Checking mode 640x480@16bpp.\n");
+bpp=SDL_VideoModeOK(640, 480, 16, SDL_HWSURFACE);
+
+if(!bpp){
+ printf("Mode not available.\n");
+ exit(-1);
+}
+
+printf("SDL Recommends 640x480@%dbpp.\n", bpp);
+screen=SDL_SetVideoMode(640, 480, bpp, SDL_HWSURFACE);
+.
+.</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN1228"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlsetvideomode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+></A
+>,
+<A
+HREF="sdlgetvideoinfo.html"
+><TT
+CLASS="FUNCTION"
+>SDL_GetVideoInfo</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdllistmodes.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlsetvideomode.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_ListModes</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_SetVideoMode</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlwaitevent.html b/distrib/sdl-1.2.15/docs/html/sdlwaitevent.html
new file mode 100644
index 0000000..b473d3b
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlwaitevent.html
@@ -0,0 +1,231 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_WaitEvent</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Event Functions."
+HREF="eventfunctions.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_PollEvent"
+HREF="sdlpollevent.html"><LINK
+REL="NEXT"
+TITLE="SDL_PushEvent"
+HREF="sdlpushevent.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlpollevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlpushevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLWAITEVENT"
+></A
+>SDL_WaitEvent</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN5507"
+></A
+><H2
+>Name</H2
+>SDL_WaitEvent&nbsp;--&nbsp;Waits indefinitely for the next available event.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN5510"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN5511"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_WaitEvent</B
+></CODE
+>(SDL_Event *event);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5517"
+></A
+><H2
+>Description</H2
+><P
+>Waits indefinitely for the next available event, returning
+<SPAN
+CLASS="RETURNVALUE"
+>1</SPAN
+>, or <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> if there was
+an error while waiting for events. </P
+><P
+>If <TT
+CLASS="PARAMETER"
+><I
+>event</I
+></TT
+> is not <TT
+CLASS="LITERAL"
+>NULL</TT
+>, the next
+event is removed from the queue and stored in that area.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN5525"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_Event</SPAN
+></A
+>,
+<A
+HREF="sdlpollevent.html"
+><TT
+CLASS="FUNCTION"
+>SDL_PollEvent</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlpollevent.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlpushevent.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_PollEvent</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="eventfunctions.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_PushEvent</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlwaitthread.html b/distrib/sdl-1.2.15/docs/html/sdlwaitthread.html
new file mode 100644
index 0000000..2becfbc
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlwaitthread.html
@@ -0,0 +1,231 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_WaitThread</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Multi-threaded Programming"
+HREF="thread.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_GetThreadID"
+HREF="sdlgetthreadid.html"><LINK
+REL="NEXT"
+TITLE="SDL_KillThread"
+HREF="sdlkillthread.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlgetthreadid.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlkillthread.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLWAITTHREAD"
+></A
+>SDL_WaitThread</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN7766"
+></A
+><H2
+>Name</H2
+>SDL_WaitThread&nbsp;--&nbsp;Wait for a thread to finish.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN7769"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN7770"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"
+#include "SDL_thread.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_WaitThread</B
+></CODE
+>(SDL_Thread *thread, int *status);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7776"
+></A
+><H2
+>Description</H2
+><P
+>Wait for a thread to finish (timeouts are not supported).</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7779"
+></A
+><H2
+>Return Value</H2
+><P
+>The return code for the thread function is placed in the area pointed to by
+<TT
+CLASS="PARAMETER"
+><I
+>status</I
+></TT
+>, if <TT
+CLASS="PARAMETER"
+><I
+>status</I
+></TT
+> is not
+<SPAN
+CLASS="RETURNVALUE"
+>NULL</SPAN
+>.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN7785"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlcreatethread.html"
+><TT
+CLASS="FUNCTION"
+>SDL_CreateThread</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlgetthreadid.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlkillthread.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_GetThreadID</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="thread.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_KillThread</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlwarpmouse.html b/distrib/sdl-1.2.15/docs/html/sdlwarpmouse.html
new file mode 100644
index 0000000..e7b2d8d
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlwarpmouse.html
@@ -0,0 +1,205 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_WarpMouse</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Video"
+HREF="video.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_DisplayFormatAlpha"
+HREF="sdldisplayformatalpha.html"><LINK
+REL="NEXT"
+TITLE="SDL_CreateCursor"
+HREF="sdlcreatecursor.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdldisplayformatalpha.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcreatecursor.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLWARPMOUSE"
+></A
+>SDL_WarpMouse</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN2465"
+></A
+><H2
+>Name</H2
+>SDL_WarpMouse&nbsp;--&nbsp;Set the position of the mouse cursor.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN2468"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN2469"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_WarpMouse</B
+></CODE
+>(Uint16 x, Uint16 y);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2475"
+></A
+><H2
+>Description</H2
+><P
+>Set the position of the mouse cursor (generates a mouse motion event).</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN2478"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlmousemotionevent.html"
+><SPAN
+CLASS="STRUCTNAME"
+>SDL_MouseMotionEvent</SPAN
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdldisplayformatalpha.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcreatecursor.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_DisplayFormatAlpha</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="video.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CreateCursor</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlwasinit.html b/distrib/sdl-1.2.15/docs/html/sdlwasinit.html
new file mode 100644
index 0000000..b4effeb
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlwasinit.html
@@ -0,0 +1,284 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_WasInit</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="General"
+HREF="general.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_Quit"
+HREF="sdlquit.html"><LINK
+REL="NEXT"
+TITLE="SDL_GetError"
+HREF="sdlgeterror.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlquit.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlgeterror.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLWASINIT"
+></A
+>SDL_WasInit</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN617"
+></A
+><H2
+>Name</H2
+>SDL_WasInit&nbsp;--&nbsp;Check which subsystems are initialized</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN620"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN621"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>Uint32 <B
+CLASS="FSFUNC"
+>SDL_WasInit</B
+></CODE
+>(Uint32 flags);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN627"
+></A
+><H2
+>Description</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_WasInit</TT
+> allows you to see which SDL subsytems have been <A
+HREF="sdlinit.html"
+>initialized</A
+>. <TT
+CLASS="PARAMETER"
+><I
+>flags</I
+></TT
+> is a bitwise OR'd combination of the subsystems you wish to check (see <A
+HREF="sdlinit.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+></A
+> for a list of subsystem flags).</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN635"
+></A
+><H2
+>Return Value</H2
+><P
+><TT
+CLASS="FUNCTION"
+>SDL_WasInit</TT
+> returns a bitwised OR'd combination of the initialized subsystems.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN639"
+></A
+><H2
+>Examples</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>&#13;/* Here are several ways you can use SDL_WasInit() */
+
+/* Get init data on all the subsystems */
+Uint32 subsystem_init;
+
+subsystem_init=SDL_WasInit(SDL_INIT_EVERYTHING);
+
+if(subsystem_init&#38;SDL_INIT_VIDEO)
+ printf("Video is initialized.\n");
+else
+ printf("Video is not initialized.\n");
+
+
+
+/* Just check for one specfic subsystem */
+
+if(SDL_WasInit(SDL_INIT_VIDEO)!=0)
+ printf("Video is initialized.\n");
+else
+ printf("Video is not initialized.\n");
+
+
+
+
+/* Check for two subsystems */
+
+Uint32 subsystem_mask=SDL_INIT_VIDEO|SDL_INIT_AUDIO;
+
+if(SDL_WasInit(subsystem_mask)==subsystem_mask)
+ printf("Video and Audio initialized.\n");
+else
+ printf("Video and Audio not initialized.\n");&#13;</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN642"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlinit.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Init</TT
+></A
+>,
+<A
+HREF="sdlinitsubsystem.html"
+><TT
+CLASS="FUNCTION"
+>SDL_Subsystem</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlquit.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlgeterror.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_Quit</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="general.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GetError</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlwmgetcaption.html b/distrib/sdl-1.2.15/docs/html/sdlwmgetcaption.html
new file mode 100644
index 0000000..829c68a
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlwmgetcaption.html
@@ -0,0 +1,222 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_WM_GetCaption</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Window Management"
+HREF="wm.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_WM_SetCaption"
+HREF="sdlwmsetcaption.html"><LINK
+REL="NEXT"
+TITLE="SDL_WM_SetIcon"
+HREF="sdlwmseticon.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlwmsetcaption.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlwmseticon.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLWMGETCAPTION"
+></A
+>SDL_WM_GetCaption</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN3556"
+></A
+><H2
+>Name</H2
+>SDL_WM_GetCaption&nbsp;--&nbsp;Gets the window title and icon name.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN3559"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN3560"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_WM_GetCaption</B
+></CODE
+>(char **title, char **icon);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3566"
+></A
+><H2
+>Description</H2
+><P
+>Set pointers to the window <TT
+CLASS="PARAMETER"
+><I
+>title</I
+></TT
+> and <TT
+CLASS="PARAMETER"
+><I
+>icon</I
+></TT
+> name.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3571"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlwmsetcaption.html"
+><TT
+CLASS="FUNCTION"
+>SDL_WM_SetCaption</TT
+></A
+>,
+<A
+HREF="sdlwmseticon.html"
+><TT
+CLASS="FUNCTION"
+>SDL_WM_SetIcon</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlwmsetcaption.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlwmseticon.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_WM_SetCaption</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="wm.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_WM_SetIcon</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlwmgrabinput.html b/distrib/sdl-1.2.15/docs/html/sdlwmgrabinput.html
new file mode 100644
index 0000000..740dcd6
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlwmgrabinput.html
@@ -0,0 +1,224 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_WM_GrabInput</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Window Management"
+HREF="wm.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_WM_ToggleFullScreen"
+HREF="sdlwmtogglefullscreen.html"><LINK
+REL="NEXT"
+TITLE="Events"
+HREF="event.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlwmtogglefullscreen.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="event.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLWMGRABINPUT"
+></A
+>SDL_WM_GrabInput</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN3663"
+></A
+><H2
+>Name</H2
+>SDL_WM_GrabInput&nbsp;--&nbsp;Grabs mouse and keyboard input.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN3666"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN3667"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>SDL_GrabMode <B
+CLASS="FSFUNC"
+>SDL_WM_GrabInput</B
+></CODE
+>(SDL_GrabMode mode);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3673"
+></A
+><H2
+>Description</H2
+><P
+>Grabbing means that the mouse is confined to the application window,
+and nearly all keyboard input is passed directly to the application,
+and not interpreted by a window manager, if any.</P
+><P
+>When <TT
+CLASS="PARAMETER"
+><I
+>mode</I
+></TT
+> is <TT
+CLASS="LITERAL"
+>SDL_GRAB_QUERY</TT
+> the grab mode is not changed, but the current grab mode is returned.</P
+><P
+><PRE
+CLASS="PROGRAMLISTING"
+>typedef enum {
+ SDL_GRAB_QUERY,
+ SDL_GRAB_OFF,
+ SDL_GRAB_ON
+} SDL_GrabMode;</PRE
+>
+ </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3681"
+></A
+><H2
+>Return Value</H2
+><P
+>The current/new <SPAN
+CLASS="STRUCTNAME"
+>SDL_GrabMode</SPAN
+>.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlwmtogglefullscreen.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="event.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_WM_ToggleFullScreen</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="wm.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>Events</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlwmiconifywindow.html b/distrib/sdl-1.2.15/docs/html/sdlwmiconifywindow.html
new file mode 100644
index 0000000..1113656
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlwmiconifywindow.html
@@ -0,0 +1,211 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_WM_IconifyWindow</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Window Management"
+HREF="wm.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_WM_SetIcon"
+HREF="sdlwmseticon.html"><LINK
+REL="NEXT"
+TITLE="SDL_WM_ToggleFullScreen"
+HREF="sdlwmtogglefullscreen.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlwmseticon.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlwmtogglefullscreen.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLWMICONIFYWINDOW"
+></A
+>SDL_WM_IconifyWindow</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN3617"
+></A
+><H2
+>Name</H2
+>SDL_WM_IconifyWindow&nbsp;--&nbsp;Iconify/Minimise the window</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN3620"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN3621"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_WM_IconifyWindow</B
+></CODE
+>(void);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3627"
+></A
+><H2
+>Description</H2
+><P
+>If the application is running in a window managed environment SDL attempts to iconify/minimise it. If <TT
+CLASS="FUNCTION"
+>SDL_WM_IconifyWindow</TT
+> is successful, the application will receive a <A
+HREF="sdlactiveevent.html"
+><TT
+CLASS="LITERAL"
+>SDL_APPACTIVE</TT
+></A
+> loss event.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3633"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns non-zero on success or <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> if iconification is not support or was refused by the window manager.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlwmseticon.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlwmtogglefullscreen.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_WM_SetIcon</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="wm.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_WM_ToggleFullScreen</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlwmsetcaption.html b/distrib/sdl-1.2.15/docs/html/sdlwmsetcaption.html
new file mode 100644
index 0000000..bc47c27
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlwmsetcaption.html
@@ -0,0 +1,212 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_WM_SetCaption</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Window Management"
+HREF="wm.html"><LINK
+REL="PREVIOUS"
+TITLE="Window Management"
+HREF="wm.html"><LINK
+REL="NEXT"
+TITLE="SDL_WM_GetCaption"
+HREF="sdlwmgetcaption.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="wm.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlwmgetcaption.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLWMSETCAPTION"
+></A
+>SDL_WM_SetCaption</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN3532"
+></A
+><H2
+>Name</H2
+>SDL_WM_SetCaption&nbsp;--&nbsp;Sets the window tile and icon name.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN3535"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN3536"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_WM_SetCaption</B
+></CODE
+>(const char *title, const char *icon);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3542"
+></A
+><H2
+>Description</H2
+><P
+>Sets the title-bar and icon name of the display window.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3545"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlwmgetcaption.html"
+><TT
+CLASS="FUNCTION"
+>SDL_WM_GetCaption</TT
+></A
+>,
+<A
+HREF="sdlwmseticon.html"
+><TT
+CLASS="FUNCTION"
+>SDL_WM_SetIcon</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="wm.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlwmgetcaption.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>Window Management</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="wm.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_WM_GetCaption</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlwmseticon.html b/distrib/sdl-1.2.15/docs/html/sdlwmseticon.html
new file mode 100644
index 0000000..12eb207
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlwmseticon.html
@@ -0,0 +1,260 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_WM_SetIcon</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Window Management"
+HREF="wm.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_WM_GetCaption"
+HREF="sdlwmgetcaption.html"><LINK
+REL="NEXT"
+TITLE="SDL_WM_IconifyWindow"
+HREF="sdlwmiconifywindow.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlwmgetcaption.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlwmiconifywindow.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLWMSETICON"
+></A
+>SDL_WM_SetIcon</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN3582"
+></A
+><H2
+>Name</H2
+>SDL_WM_SetIcon&nbsp;--&nbsp;Sets the icon for the display window.</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN3585"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN3586"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void <B
+CLASS="FSFUNC"
+>SDL_WM_SetIcon</B
+></CODE
+>(SDL_Surface *icon, Uint8 *mask);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3592"
+></A
+><H2
+>Description</H2
+><P
+>Sets the icon for the display window. Win32 icons must be 32x32.</P
+><P
+>This function must be called before the first call to
+<A
+HREF="sdlsetvideomode.html"
+>SDL_SetVideoMode</A
+>.</P
+><P
+>The <TT
+CLASS="PARAMETER"
+><I
+>mask</I
+></TT
+> is a bitmask that describes the shape of the
+icon. If <TT
+CLASS="PARAMETER"
+><I
+>mask</I
+></TT
+> is NULL, then the shape is determined by
+the colorkey of <TT
+CLASS="PARAMETER"
+><I
+>icon</I
+></TT
+>, if any, or makes the icon
+rectangular (no transparency) otherwise.</P
+><P
+>If <TT
+CLASS="PARAMETER"
+><I
+>mask</I
+></TT
+> is non-NULL, it points to a bitmap with bits set
+where the corresponding pixel should be visible. The format of the bitmap is as
+follows: Scanlines come in the usual top-down order. Each scanline consists of
+(width / 8) bytes, rounded up. The most significant bit of each byte represents
+the leftmost pixel.</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3603"
+></A
+><H2
+>Example</H2
+><PRE
+CLASS="PROGRAMLISTING"
+>SDL_WM_SetIcon(SDL_LoadBMP("icon.bmp"), NULL);</PRE
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3606"
+></A
+><H2
+>See Also</H2
+><P
+><A
+HREF="sdlsetvideomode.html"
+><TT
+CLASS="FUNCTION"
+>SDL_SetVideoMode</TT
+></A
+>,
+<A
+HREF="sdlwmsetcaption.html"
+><TT
+CLASS="FUNCTION"
+>SDL_WM_SetCaption</TT
+></A
+></P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlwmgetcaption.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlwmiconifywindow.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_WM_GetCaption</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="wm.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_WM_IconifyWindow</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/sdlwmtogglefullscreen.html b/distrib/sdl-1.2.15/docs/html/sdlwmtogglefullscreen.html
new file mode 100644
index 0000000..b7973de
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/sdlwmtogglefullscreen.html
@@ -0,0 +1,205 @@
+<HTML
+><HEAD
+><TITLE
+>SDL_WM_ToggleFullScreen</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="Window Management"
+HREF="wm.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_WM_IconifyWindow"
+HREF="sdlwmiconifywindow.html"><LINK
+REL="NEXT"
+TITLE="SDL_WM_GrabInput"
+HREF="sdlwmgrabinput.html"></HEAD
+><BODY
+CLASS="REFENTRY"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlwmiconifywindow.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlwmgrabinput.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="SDLWMTOGGLEFULLSCREEN"
+></A
+>SDL_WM_ToggleFullScreen</H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN3641"
+></A
+><H2
+>Name</H2
+>SDL_WM_ToggleFullScreen&nbsp;--&nbsp;Toggles fullscreen mode</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN3644"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN3645"
+></A
+><P
+></P
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include "SDL.h"</PRE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>int <B
+CLASS="FSFUNC"
+>SDL_WM_ToggleFullScreen</B
+></CODE
+>(SDL_Surface *surface);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3651"
+></A
+><H2
+>Description</H2
+><P
+>Toggles the application between windowed and fullscreen mode, if supported. (X11 is the only target currently supported, BeOS support is experimental).</P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN3654"
+></A
+><H2
+>Return Value</H2
+><P
+>Returns <SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+> on failure or <SPAN
+CLASS="RETURNVALUE"
+>1</SPAN
+> on success.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlwmiconifywindow.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlwmgrabinput.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_WM_IconifyWindow</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="wm.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_WM_GrabInput</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/thread.html b/distrib/sdl-1.2.15/docs/html/thread.html
new file mode 100644
index 0000000..8ef2c92
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/thread.html
@@ -0,0 +1,313 @@
+<HTML
+><HEAD
+><TITLE
+>Multi-threaded Programming</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Reference"
+HREF="reference.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CDtrack"
+HREF="sdlcdtrack.html"><LINK
+REL="NEXT"
+TITLE="SDL_CreateThread"
+HREF="sdlcreatethread.html"><META
+NAME="KEYWORD"
+CONTENT="threads"><META
+NAME="KEYWORD"
+CONTENT="function"></HEAD
+><BODY
+CLASS="CHAPTER"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcdtrack.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlcreatethread.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="CHAPTER"
+><H1
+><A
+NAME="THREAD"
+></A
+>Chapter 12. Multi-threaded Programming</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="sdlcreatethread.html"
+>SDL_CreateThread</A
+>&nbsp;--&nbsp;Creates a new thread of execution that shares its parent's properties.</DT
+><DT
+><A
+HREF="sdlthreadid.html"
+>SDL_ThreadID</A
+>&nbsp;--&nbsp;Get the 32-bit thread identifier for the current thread.</DT
+><DT
+><A
+HREF="sdlgetthreadid.html"
+>SDL_GetThreadID</A
+>&nbsp;--&nbsp;Get the SDL thread ID of a SDL_Thread</DT
+><DT
+><A
+HREF="sdlwaitthread.html"
+>SDL_WaitThread</A
+>&nbsp;--&nbsp;Wait for a thread to finish.</DT
+><DT
+><A
+HREF="sdlkillthread.html"
+>SDL_KillThread</A
+>&nbsp;--&nbsp;Gracelessly terminates the thread.</DT
+><DT
+><A
+HREF="sdlcreatemutex.html"
+>SDL_CreateMutex</A
+>&nbsp;--&nbsp;Create a mutex</DT
+><DT
+><A
+HREF="sdldestroymutex.html"
+>SDL_DestroyMutex</A
+>&nbsp;--&nbsp;Destroy a mutex</DT
+><DT
+><A
+HREF="sdlmutexp.html"
+>SDL_mutexP</A
+>&nbsp;--&nbsp;Lock a mutex</DT
+><DT
+><A
+HREF="sdlmutexv.html"
+>SDL_mutexV</A
+>&nbsp;--&nbsp;Unlock a mutex</DT
+><DT
+><A
+HREF="sdlcreatesemaphore.html"
+>SDL_CreateSemaphore</A
+>&nbsp;--&nbsp;Creates a new semaphore and assigns an initial value to it.</DT
+><DT
+><A
+HREF="sdldestroysemaphore.html"
+>SDL_DestroySemaphore</A
+>&nbsp;--&nbsp;Destroys a semaphore that was created by <A
+HREF="sdlcreatesemaphore.html"
+>SDL_CreateSemaphore</A
+>.</DT
+><DT
+><A
+HREF="sdlsemwait.html"
+>SDL_SemWait</A
+>&nbsp;--&nbsp;Lock a semaphore and suspend the thread if the semaphore value is zero.</DT
+><DT
+><A
+HREF="sdlsemtrywait.html"
+>SDL_SemTryWait</A
+>&nbsp;--&nbsp;Attempt to lock a semaphore but don't suspend the thread.</DT
+><DT
+><A
+HREF="sdlsemwaittimeout.html"
+>SDL_SemWaitTimeout</A
+>&nbsp;--&nbsp;Lock a semaphore, but only wait up to a specified maximum time.</DT
+><DT
+><A
+HREF="sdlsempost.html"
+>SDL_SemPost</A
+>&nbsp;--&nbsp;Unlock a semaphore.</DT
+><DT
+><A
+HREF="sdlsemvalue.html"
+>SDL_SemValue</A
+>&nbsp;--&nbsp;Return the current value of a semaphore.</DT
+><DT
+><A
+HREF="sdlcreatecond.html"
+>SDL_CreateCond</A
+>&nbsp;--&nbsp;Create a condition variable</DT
+><DT
+><A
+HREF="sdldestroycond.html"
+>SDL_DestroyCond</A
+>&nbsp;--&nbsp;Destroy a condition variable</DT
+><DT
+><A
+HREF="sdlcondsignal.html"
+>SDL_CondSignal</A
+>&nbsp;--&nbsp;Restart a thread wait on a condition variable</DT
+><DT
+><A
+HREF="sdlcondbroadcast.html"
+>SDL_CondBroadcast</A
+>&nbsp;--&nbsp;Restart all threads waiting on a condition variable</DT
+><DT
+><A
+HREF="sdlcondwait.html"
+>SDL_CondWait</A
+>&nbsp;--&nbsp;Wait on a condition variable</DT
+><DT
+><A
+HREF="sdlcondwaittimeout.html"
+>SDL_CondWaitTimeout</A
+>&nbsp;--&nbsp;Wait on a condition variable, with timeout</DT
+></DL
+></DIV
+><P
+>SDL provides functions for creating threads, mutexes, semphores and condition variables.</P
+><P
+>In general, you must be very aware of concurrency and data integrity issues
+when writing multi-threaded programs. Some good guidelines include:
+<P
+></P
+><UL
+><LI
+><P
+>Don't call SDL video/event functions from separate threads</P
+></LI
+><LI
+><P
+>Don't use any library functions in separate threads</P
+></LI
+><LI
+><P
+>Don't perform any memory management in separate threads</P
+></LI
+><LI
+><P
+>Lock global variables which may be accessed by multiple threads</P
+></LI
+><LI
+><P
+>Never terminate threads, always set a flag and wait for them to quit</P
+></LI
+><LI
+><P
+>Think very carefully about all possible ways your code may interact</P
+></LI
+></UL
+></P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>SDL's threading is not implemented on MacOS, due to the lack of preemptive thread support on that OS (Mac OS X doesn't suffer from this problem)</P
+></BLOCKQUOTE
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcdtrack.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlcreatethread.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CDtrack</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="reference.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_CreateThread</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/time.html b/distrib/sdl-1.2.15/docs/html/time.html
new file mode 100644
index 0000000..854b7cb
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/time.html
@@ -0,0 +1,206 @@
+<HTML
+><HEAD
+><TITLE
+>Time</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Reference"
+HREF="reference.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_CondWaitTimeout"
+HREF="sdlcondwaittimeout.html"><LINK
+REL="NEXT"
+TITLE="SDL_GetTicks"
+HREF="sdlgetticks.html"><META
+NAME="KEYWORD"
+CONTENT="time"><META
+NAME="KEYWORD"
+CONTENT="function"></HEAD
+><BODY
+CLASS="CHAPTER"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlcondwaittimeout.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlgetticks.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="CHAPTER"
+><H1
+><A
+NAME="TIME"
+></A
+>Chapter 13. Time</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="sdlgetticks.html"
+>SDL_GetTicks</A
+>&nbsp;--&nbsp;Get the number of milliseconds since the SDL library initialization.</DT
+><DT
+><A
+HREF="sdldelay.html"
+>SDL_Delay</A
+>&nbsp;--&nbsp;Wait a specified number of milliseconds before returning.</DT
+><DT
+><A
+HREF="sdladdtimer.html"
+>SDL_AddTimer</A
+>&nbsp;--&nbsp;Add a timer which will call a callback after the specified number of milliseconds has
+elapsed.</DT
+><DT
+><A
+HREF="sdlremovetimer.html"
+>SDL_RemoveTimer</A
+>&nbsp;--&nbsp;Remove a timer which was added with
+<A
+HREF="sdladdtimer.html"
+>SDL_AddTimer</A
+>.</DT
+><DT
+><A
+HREF="sdlsettimer.html"
+>SDL_SetTimer</A
+>&nbsp;--&nbsp;Set a callback to run after the specified number of milliseconds has
+elapsed.</DT
+></DL
+></DIV
+><P
+>SDL provides several cross-platform functions for dealing with time.
+It provides a way to get the current time, a way to wait a little while,
+and a simple timer mechanism. These functions give you two ways of moving an
+object every x milliseconds:
+
+<P
+></P
+><UL
+><LI
+><P
+>Use a timer callback function. This may have the bad effect that it runs in a seperate thread or uses alarm signals, but it's easier to implement.</P
+></LI
+><LI
+><P
+>Or you can get the number of milliseconds passed, and move the object if, for example, 30 ms passed.</P
+></LI
+></UL
+>&#13;</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlcondwaittimeout.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlgetticks.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_CondWaitTimeout</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="reference.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GetTicks</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/video.html b/distrib/sdl-1.2.15/docs/html/video.html
new file mode 100644
index 0000000..9b1434e
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/video.html
@@ -0,0 +1,507 @@
+<HTML
+><HEAD
+><TITLE
+>Video</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Reference"
+HREF="reference.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_envvars"
+HREF="sdlenvvars.html"><LINK
+REL="NEXT"
+TITLE="SDL_GetVideoSurface"
+HREF="sdlgetvideosurface.html"><META
+NAME="KEYWORD"
+CONTENT="video"><META
+NAME="KEYWORD"
+CONTENT="function"></HEAD
+><BODY
+CLASS="CHAPTER"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdlenvvars.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlgetvideosurface.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="CHAPTER"
+><H1
+><A
+NAME="VIDEO"
+></A
+>Chapter 6. Video</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="sdlgetvideosurface.html"
+>SDL_GetVideoSurface</A
+>&nbsp;--&nbsp;returns a pointer to the current display surface</DT
+><DT
+><A
+HREF="sdlgetvideoinfo.html"
+>SDL_GetVideoInfo</A
+>&nbsp;--&nbsp;returns a pointer to information about the video hardware</DT
+><DT
+><A
+HREF="sdlvideodrivername.html"
+>SDL_VideoDriverName</A
+>&nbsp;--&nbsp;Obtain the name of the video driver</DT
+><DT
+><A
+HREF="sdllistmodes.html"
+>SDL_ListModes</A
+>&nbsp;--&nbsp;Returns a pointer to an array of available screen dimensions for
+the given format and video flags</DT
+><DT
+><A
+HREF="sdlvideomodeok.html"
+>SDL_VideoModeOK</A
+>&nbsp;--&nbsp;Check to see if a particular video mode is supported.</DT
+><DT
+><A
+HREF="sdlsetvideomode.html"
+>SDL_SetVideoMode</A
+>&nbsp;--&nbsp;Set up a video mode with the specified width, height and bits-per-pixel.</DT
+><DT
+><A
+HREF="sdlupdaterect.html"
+>SDL_UpdateRect</A
+>&nbsp;--&nbsp;Makes sure the given area is updated on the given screen.</DT
+><DT
+><A
+HREF="sdlupdaterects.html"
+>SDL_UpdateRects</A
+>&nbsp;--&nbsp;Makes sure the given list of rectangles is updated on the given screen.</DT
+><DT
+><A
+HREF="sdlflip.html"
+>SDL_Flip</A
+>&nbsp;--&nbsp;Swaps screen buffers</DT
+><DT
+><A
+HREF="sdlsetcolors.html"
+>SDL_SetColors</A
+>&nbsp;--&nbsp;Sets a portion of the colormap for the given 8-bit surface.</DT
+><DT
+><A
+HREF="sdlsetpalette.html"
+>SDL_SetPalette</A
+>&nbsp;--&nbsp;Sets the colors in the palette of an 8-bit surface.</DT
+><DT
+><A
+HREF="sdlsetgamma.html"
+>SDL_SetGamma</A
+>&nbsp;--&nbsp;Sets the color gamma function for the display</DT
+><DT
+><A
+HREF="sdlgetgammaramp.html"
+>SDL_GetGammaRamp</A
+>&nbsp;--&nbsp;Gets the color gamma lookup tables for the display</DT
+><DT
+><A
+HREF="sdlsetgammaramp.html"
+>SDL_SetGammaRamp</A
+>&nbsp;--&nbsp;Sets the color gamma lookup tables for the display</DT
+><DT
+><A
+HREF="sdlmaprgb.html"
+>SDL_MapRGB</A
+>&nbsp;--&nbsp;Map a RGB color value to a pixel format.</DT
+><DT
+><A
+HREF="sdlmaprgba.html"
+>SDL_MapRGBA</A
+>&nbsp;--&nbsp;Map a RGBA color value to a pixel format.</DT
+><DT
+><A
+HREF="sdlgetrgb.html"
+>SDL_GetRGB</A
+>&nbsp;--&nbsp;Get RGB values from a pixel in the specified pixel format.</DT
+><DT
+><A
+HREF="sdlgetrgba.html"
+>SDL_GetRGBA</A
+>&nbsp;--&nbsp;Get RGBA values from a pixel in the specified pixel format.</DT
+><DT
+><A
+HREF="sdlcreatergbsurface.html"
+>SDL_CreateRGBSurface</A
+>&nbsp;--&nbsp;Create an empty SDL_Surface</DT
+><DT
+><A
+HREF="sdlcreatergbsurfacefrom.html"
+>SDL_CreateRGBSurfaceFrom</A
+>&nbsp;--&nbsp;Create an SDL_Surface from pixel data</DT
+><DT
+><A
+HREF="sdlfreesurface.html"
+>SDL_FreeSurface</A
+>&nbsp;--&nbsp;Frees (deletes) a SDL_Surface</DT
+><DT
+><A
+HREF="sdllocksurface.html"
+>SDL_LockSurface</A
+>&nbsp;--&nbsp;Lock a surface for directly access.</DT
+><DT
+><A
+HREF="sdlunlocksurface.html"
+>SDL_UnlockSurface</A
+>&nbsp;--&nbsp;Unlocks a previously locked surface.</DT
+><DT
+><A
+HREF="sdlloadbmp.html"
+>SDL_LoadBMP</A
+>&nbsp;--&nbsp;Load a Windows BMP file into an SDL_Surface.</DT
+><DT
+><A
+HREF="sdlsavebmp.html"
+>SDL_SaveBMP</A
+>&nbsp;--&nbsp;Save an SDL_Surface as a Windows BMP file.</DT
+><DT
+><A
+HREF="sdlsetcolorkey.html"
+>SDL_SetColorKey</A
+>&nbsp;--&nbsp;Sets the color key (transparent pixel) in a blittable surface and
+RLE acceleration.</DT
+><DT
+><A
+HREF="sdlsetalpha.html"
+>SDL_SetAlpha</A
+>&nbsp;--&nbsp;Adjust the alpha properties of a surface</DT
+><DT
+><A
+HREF="sdlsetcliprect.html"
+>SDL_SetClipRect</A
+>&nbsp;--&nbsp;Sets the clipping rectangle for a surface.</DT
+><DT
+><A
+HREF="sdlgetcliprect.html"
+>SDL_GetClipRect</A
+>&nbsp;--&nbsp;Gets the clipping rectangle for a surface.</DT
+><DT
+><A
+HREF="sdlconvertsurface.html"
+>SDL_ConvertSurface</A
+>&nbsp;--&nbsp;Converts a surface to the same format as another surface.</DT
+><DT
+><A
+HREF="sdlblitsurface.html"
+>SDL_BlitSurface</A
+>&nbsp;--&nbsp;This performs a fast blit from the source surface to the destination surface.</DT
+><DT
+><A
+HREF="sdlfillrect.html"
+>SDL_FillRect</A
+>&nbsp;--&nbsp;This function performs a fast fill of the given rectangle with some color</DT
+><DT
+><A
+HREF="sdldisplayformat.html"
+>SDL_DisplayFormat</A
+>&nbsp;--&nbsp;Convert a surface to the display format</DT
+><DT
+><A
+HREF="sdldisplayformatalpha.html"
+>SDL_DisplayFormatAlpha</A
+>&nbsp;--&nbsp;Convert a surface to the display format</DT
+><DT
+><A
+HREF="sdlwarpmouse.html"
+>SDL_WarpMouse</A
+>&nbsp;--&nbsp;Set the position of the mouse cursor.</DT
+><DT
+><A
+HREF="sdlcreatecursor.html"
+>SDL_CreateCursor</A
+>&nbsp;--&nbsp;Creates a new mouse cursor.</DT
+><DT
+><A
+HREF="sdlfreecursor.html"
+>SDL_FreeCursor</A
+>&nbsp;--&nbsp;Frees a cursor created with SDL_CreateCursor.</DT
+><DT
+><A
+HREF="sdlsetcursor.html"
+>SDL_SetCursor</A
+>&nbsp;--&nbsp;Set the currently active mouse cursor.</DT
+><DT
+><A
+HREF="sdlgetcursor.html"
+>SDL_GetCursor</A
+>&nbsp;--&nbsp;Get the currently active mouse cursor.</DT
+><DT
+><A
+HREF="sdlshowcursor.html"
+>SDL_ShowCursor</A
+>&nbsp;--&nbsp;Toggle whether or not the cursor is shown on the screen.</DT
+><DT
+><A
+HREF="sdlglloadlibrary.html"
+>SDL_GL_LoadLibrary</A
+>&nbsp;--&nbsp;Specify an OpenGL library</DT
+><DT
+><A
+HREF="sdlglgetprocaddress.html"
+>SDL_GL_GetProcAddress</A
+>&nbsp;--&nbsp;Get the address of a GL function</DT
+><DT
+><A
+HREF="sdlglgetattribute.html"
+>SDL_GL_GetAttribute</A
+>&nbsp;--&nbsp;Get the value of a special SDL/OpenGL attribute</DT
+><DT
+><A
+HREF="sdlglsetattribute.html"
+>SDL_GL_SetAttribute</A
+>&nbsp;--&nbsp;Set a special SDL/OpenGL attribute</DT
+><DT
+><A
+HREF="sdlglswapbuffers.html"
+>SDL_GL_SwapBuffers</A
+>&nbsp;--&nbsp;Swap OpenGL framebuffers/Update Display</DT
+><DT
+><A
+HREF="sdlcreateyuvoverlay.html"
+>SDL_CreateYUVOverlay</A
+>&nbsp;--&nbsp;Create a YUV video overlay</DT
+><DT
+><A
+HREF="sdllockyuvoverlay.html"
+>SDL_LockYUVOverlay</A
+>&nbsp;--&nbsp;Lock an overlay</DT
+><DT
+><A
+HREF="sdlunlockyuvoverlay.html"
+>SDL_UnlockYUVOverlay</A
+>&nbsp;--&nbsp;Unlock an overlay</DT
+><DT
+><A
+HREF="sdldisplayyuvoverlay.html"
+>SDL_DisplayYUVOverlay</A
+>&nbsp;--&nbsp;Blit the overlay to the display</DT
+><DT
+><A
+HREF="sdlfreeyuvoverlay.html"
+>SDL_FreeYUVOverlay</A
+>&nbsp;--&nbsp;Free a YUV video overlay</DT
+><DT
+><A
+HREF="sdlglattr.html"
+>SDL_GLattr</A
+>&nbsp;--&nbsp;SDL GL Attributes</DT
+><DT
+><A
+HREF="sdlrect.html"
+>SDL_Rect</A
+>&nbsp;--&nbsp;Defines a rectangular area</DT
+><DT
+><A
+HREF="sdlcolor.html"
+>SDL_Color</A
+>&nbsp;--&nbsp;Format independent color description</DT
+><DT
+><A
+HREF="sdlpalette.html"
+>SDL_Palette</A
+>&nbsp;--&nbsp;Color palette for 8-bit pixel formats</DT
+><DT
+><A
+HREF="sdlpixelformat.html"
+>SDL_PixelFormat</A
+>&nbsp;--&nbsp;Stores surface format information</DT
+><DT
+><A
+HREF="sdlsurface.html"
+>SDL_Surface</A
+>&nbsp;--&nbsp;Graphical Surface Structure</DT
+><DT
+><A
+HREF="sdlvideoinfo.html"
+>SDL_VideoInfo</A
+>&nbsp;--&nbsp;Video Target information</DT
+><DT
+><A
+HREF="sdloverlay.html"
+>SDL_Overlay</A
+>&nbsp;--&nbsp;YUV video overlay</DT
+></DL
+></DIV
+><P
+>SDL presents a very simple interface to the display framebuffer. The
+framebuffer is represented as an offscreen surface to which you can write
+directly. If you want the screen to show what you have written, call the <A
+HREF="sdlupdaterects.html"
+>update</A
+> function which will
+guarantee that the desired portion of the screen is updated.</P
+><P
+>Before you call any of the SDL video functions, you must first call
+<SPAN
+CLASS="TOKEN"
+>SDL_Init(SDL_INIT_VIDEO)</SPAN
+>, which initializes the video
+and events in the SDL library. Check the return code, which should be
+<SPAN
+CLASS="RETURNVALUE"
+>0</SPAN
+>, to see if there were any errors in starting up.</P
+><P
+>If you use both sound and video in your application, you need to call
+<SPAN
+CLASS="TOKEN"
+>SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO)</SPAN
+> before opening the
+sound device, otherwise under Win32 DirectX, you won't be able to set
+full-screen display modes.</P
+><P
+>After you have initialized the library, you can start up the video display in a
+number of ways. The easiest way is to pick a common screen resolution and
+depth and just initialize the video, checking for errors. You will probably
+get what you want, but SDL may be emulating your requested mode and converting
+the display on update. The best way is to
+<A
+HREF="sdlgetvideoinfo.html"
+>query</A
+>, for the best
+video mode closest to the desired one, and then
+<A
+HREF="sdldisplayformat.html"
+>convert</A
+>
+your images to that pixel format.</P
+><P
+>SDL currently supports any bit depth &gt;= 8 bits per pixel. 8 bpp formats are
+considered 8-bit palettized modes, while 12, 15, 16, 24, and 32 bits per pixel
+are considered "packed pixel" modes, meaning each pixel contains the RGB color
+components packed in the bits of the pixel.</P
+><P
+>After you have initialized your video mode, you can take the surface that was
+returned, and write to it like any other framebuffer, calling the update
+routine as you go.</P
+><P
+>When you have finished your video access and are ready to quit your
+application, you should call "<SPAN
+CLASS="TOKEN"
+>SDL_Quit()</SPAN
+>" to shutdown the
+video and events.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdlenvvars.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlgetvideosurface.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_envvars</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="reference.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_GetVideoSurface</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/html/wm.html b/distrib/sdl-1.2.15/docs/html/wm.html
new file mode 100644
index 0000000..f53a349
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/html/wm.html
@@ -0,0 +1,188 @@
+<HTML
+><HEAD
+><TITLE
+>Window Management</TITLE
+><META
+NAME="GENERATOR"
+CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
+"><LINK
+REL="HOME"
+TITLE="SDL Library Documentation"
+HREF="index.html"><LINK
+REL="UP"
+TITLE="SDL Reference"
+HREF="reference.html"><LINK
+REL="PREVIOUS"
+TITLE="SDL_Overlay"
+HREF="sdloverlay.html"><LINK
+REL="NEXT"
+TITLE="SDL_WM_SetCaption"
+HREF="sdlwmsetcaption.html"><META
+NAME="KEYWORD"
+CONTENT="wm"><META
+NAME="KEYWORD"
+CONTENT="function"></HEAD
+><BODY
+CLASS="CHAPTER"
+BGCOLOR="#FFF8DC"
+TEXT="#000000"
+LINK="#0000ee"
+VLINK="#551a8b"
+ALINK="#ff0000"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
+SUMMARY="Header navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TH
+COLSPAN="3"
+ALIGN="center"
+>SDL Library Documentation</TH
+></TR
+><TR
+><TD
+WIDTH="10%"
+ALIGN="left"
+VALIGN="bottom"
+><A
+HREF="sdloverlay.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="80%"
+ALIGN="center"
+VALIGN="bottom"
+></TD
+><TD
+WIDTH="10%"
+ALIGN="right"
+VALIGN="bottom"
+><A
+HREF="sdlwmsetcaption.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
+ALIGN="LEFT"
+WIDTH="100%"></DIV
+><DIV
+CLASS="CHAPTER"
+><H1
+><A
+NAME="WM"
+></A
+>Chapter 7. Window Management</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="sdlwmsetcaption.html"
+>SDL_WM_SetCaption</A
+>&nbsp;--&nbsp;Sets the window tile and icon name.</DT
+><DT
+><A
+HREF="sdlwmgetcaption.html"
+>SDL_WM_GetCaption</A
+>&nbsp;--&nbsp;Gets the window title and icon name.</DT
+><DT
+><A
+HREF="sdlwmseticon.html"
+>SDL_WM_SetIcon</A
+>&nbsp;--&nbsp;Sets the icon for the display window.</DT
+><DT
+><A
+HREF="sdlwmiconifywindow.html"
+>SDL_WM_IconifyWindow</A
+>&nbsp;--&nbsp;Iconify/Minimise the window</DT
+><DT
+><A
+HREF="sdlwmtogglefullscreen.html"
+>SDL_WM_ToggleFullScreen</A
+>&nbsp;--&nbsp;Toggles fullscreen mode</DT
+><DT
+><A
+HREF="sdlwmgrabinput.html"
+>SDL_WM_GrabInput</A
+>&nbsp;--&nbsp;Grabs mouse and keyboard input.</DT
+></DL
+></DIV
+><P
+>SDL provides a small set of window management functions which allow applications to change their title and toggle from windowed mode to fullscreen (if available)</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
+ALIGN="LEFT"
+WIDTH="100%"><TABLE
+SUMMARY="Footer navigation table"
+WIDTH="100%"
+BORDER="0"
+CELLPADDING="0"
+CELLSPACING="0"
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+><A
+HREF="sdloverlay.html"
+ACCESSKEY="P"
+>Prev</A
+></TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="index.html"
+ACCESSKEY="H"
+>Home</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+><A
+HREF="sdlwmsetcaption.html"
+ACCESSKEY="N"
+>Next</A
+></TD
+></TR
+><TR
+><TD
+WIDTH="33%"
+ALIGN="left"
+VALIGN="top"
+>SDL_Overlay</TD
+><TD
+WIDTH="34%"
+ALIGN="center"
+VALIGN="top"
+><A
+HREF="reference.html"
+ACCESSKEY="U"
+>Up</A
+></TD
+><TD
+WIDTH="33%"
+ALIGN="right"
+VALIGN="top"
+>SDL_WM_SetCaption</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+> \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/docs/images/rainbow.gif b/distrib/sdl-1.2.15/docs/images/rainbow.gif
new file mode 100644
index 0000000..07eb184
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/images/rainbow.gif
Binary files differ
diff --git a/distrib/sdl-1.2.15/docs/index.html b/distrib/sdl-1.2.15/docs/index.html
new file mode 100644
index 0000000..7d57253
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/index.html
@@ -0,0 +1,55 @@
+<!DOCTYPE HTML PUBLIC "-//Norman Walsh//DTD DocBook HTML 1.0//EN">
+<HTML>
+<HEAD><TITLE>Simple DirectMedia Layer Introduction</TITLE></HEAD>
+<BODY BGCOLOR="#FFF8DC" TEXT="#000000" LINK="#0000ee" VLINK="#551a8b" ALINK="#ff0000">
+<DIV CLASS="NAVHEADER">
+<HR ALIGN="LEFT" WIDTH="100%">
+</DIV>
+<DIV CLASS="PREFACE">
+<H2><A NAME="AEN8">Simple DirectMedia Layer Introduction</A></H2>
+<P>
+This library is designed to make it easy to write games that run on many
+different platforms using the various native high-performance media interfaces,
+(for video, audio, etc) and presenting a single source-code level API to
+your application. This is a fairly low level API, but using this, completely
+portable applications can be written with a great deal of flexibility.
+</P><P>
+An introduction to SDL can be found online at:
+<A HREF="http://www.libsdl.org/intro.php" TARGET="_top">
+ http://www.libsdl.org/intro.php</A>
+</P><P>
+Tutorials on a variety of topics can be found online at:
+<A HREF="http://www.libsdl.org/tutorials.php" TARGET="_top">
+ http://www.libsdl.org/tutorials.php</A>
+</P><P>
+Documentation in Wiki form can be found online at:
+<A HREF="http://www.libsdl.org/cgi/docwiki.cgi/" TARGET="_top">
+ http://www.libsdl.org/cgi/docwiki.cgi/</A>
+</P><P>
+Enjoy!
+</P><P>
+&nbsp;&nbsp;&nbsp; Sam Lantinga
+<TT CLASS="EMAIL">&#60;<A HREF="mailto:slouken@libsdl.org"><A HREF="mailto:slouken@libsdl.org" TARGET="_top" >slouken@libsdl.org</A></A>&#62;</TT>
+</P> <P>
+<br><br><HR>
+<H1>Table of Contents</H1>
+<UL>
+<LI><A HREF="html/index.html">Full Table of Contents</A></LI>
+<LI><A HREF="html/guide.html">The SDL Guide</A></LI>
+<LI><A HREF="html/reference.html">The SDL Reference</A></LI>
+<UL>
+<LI><A HREF="html/general.html">Initialization</A></LI>
+<LI><A HREF="html/video.html">Video</A></LI>
+<LI><A HREF="html/wm.html">Window Manager</A></LI>
+<LI><A HREF="html/event.html">Event Handling</A></LI>
+<LI><A HREF="html/joystick.html">Joystick</A></LI>
+<LI><A HREF="html/audio.html">Audio</A></LI>
+<LI><A HREF="html/cdrom.html">CDROM</A></LI>
+<LI><A HREF="html/thread.html">Threads</A></LI>
+<LI><A HREF="html/time.html">Timers</A></LI>
+</UL>
+</UL>
+</DIV
+></BODY
+></HTML
+>
diff --git a/distrib/sdl-1.2.15/docs/man3/SDLKey.3 b/distrib/sdl-1.2.15/docs/man3/SDLKey.3
new file mode 100644
index 0000000..dc74dfa
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDLKey.3
@@ -0,0 +1,161 @@
+.TH "SDLKey" "3" "Wed 11 Oct 2000, 22:28" "SDL" "SDL API Reference"
+.SH "NAME"
+SDLKey \- SDL Keysym Definitions
+.SH "SDL Keysym definitions"
+.PP
+\fBSDLKey ASCII value Common Name\fR
+.nf
+\f(CWSDLK_BACKSPACE '\\b' backspace
+SDLK_TAB '\\t' tab
+SDLK_CLEAR clear
+SDLK_RETURN '\\r' return
+SDLK_PAUSE pause
+SDLK_ESCAPE '^[' escape
+SDLK_SPACE ' ' space
+SDLK_EXCLAIM '!' exclaim
+SDLK_QUOTEDBL '"' quotedbl
+SDLK_HASH '#' hash
+SDLK_DOLLAR '$' dollar
+SDLK_AMPERSAND '&' ampersand
+SDLK_QUOTE ''' quote
+SDLK_LEFTPAREN '(' left parenthesis
+SDLK_RIGHTPAREN ')' right parenthesis
+SDLK_ASTERISK '*' asterisk
+SDLK_PLUS '+' plus sign
+SDLK_COMMA ',' comma
+SDLK_MINUS '-' minus sign
+SDLK_PERIOD '.' period
+SDLK_SLASH '/' forward slash
+SDLK_0 '0' 0
+SDLK_1 '1' 1
+SDLK_2 '2' 2
+SDLK_3 '3' 3
+SDLK_4 '4' 4
+SDLK_5 '5' 5
+SDLK_6 '6' 6
+SDLK_7 '7' 7
+SDLK_8 '8' 8
+SDLK_9 '9' 9
+SDLK_COLON ':' colon
+SDLK_SEMICOLON ';' semicolon
+SDLK_LESS '<' less-than sign
+SDLK_EQUALS '=' equals sign
+SDLK_GREATER '>' greater-than sign
+SDLK_QUESTION '?' question mark
+SDLK_AT '@' at
+SDLK_LEFTBRACKET '[' left bracket
+SDLK_BACKSLASH '\\' backslash
+SDLK_RIGHTBRACKET ']' right bracket
+SDLK_CARET '^' caret
+SDLK_UNDERSCORE '_' underscore
+SDLK_BACKQUOTE '`' grave
+SDLK_a 'a' a
+SDLK_b 'b' b
+SDLK_c 'c' c
+SDLK_d 'd' d
+SDLK_e 'e' e
+SDLK_f 'f' f
+SDLK_g 'g' g
+SDLK_h 'h' h
+SDLK_i 'i' i
+SDLK_j 'j' j
+SDLK_k 'k' k
+SDLK_l 'l' l
+SDLK_m 'm' m
+SDLK_n 'n' n
+SDLK_o 'o' o
+SDLK_p 'p' p
+SDLK_q 'q' q
+SDLK_r 'r' r
+SDLK_s 's' s
+SDLK_t 't' t
+SDLK_u 'u' u
+SDLK_v 'v' v
+SDLK_w 'w' w
+SDLK_x 'x' x
+SDLK_y 'y' y
+SDLK_z 'z' z
+SDLK_DELETE '^?' delete
+SDLK_KP0 keypad 0
+SDLK_KP1 keypad 1
+SDLK_KP2 keypad 2
+SDLK_KP3 keypad 3
+SDLK_KP4 keypad 4
+SDLK_KP5 keypad 5
+SDLK_KP6 keypad 6
+SDLK_KP7 keypad 7
+SDLK_KP8 keypad 8
+SDLK_KP9 keypad 9
+SDLK_KP_PERIOD '.' keypad period
+SDLK_KP_DIVIDE '/' keypad divide
+SDLK_KP_MULTIPLY '*' keypad multiply
+SDLK_KP_MINUS '-' keypad minus
+SDLK_KP_PLUS '+' keypad plus
+SDLK_KP_ENTER '\\r' keypad enter
+SDLK_KP_EQUALS '=' keypad equals
+SDLK_UP up arrow
+SDLK_DOWN down arrow
+SDLK_RIGHT right arrow
+SDLK_LEFT left arrow
+SDLK_INSERT insert
+SDLK_HOME home
+SDLK_END end
+SDLK_PAGEUP page up
+SDLK_PAGEDOWN page down
+SDLK_F1 F1
+SDLK_F2 F2
+SDLK_F3 F3
+SDLK_F4 F4
+SDLK_F5 F5
+SDLK_F6 F6
+SDLK_F7 F7
+SDLK_F8 F8
+SDLK_F9 F9
+SDLK_F10 F10
+SDLK_F11 F11
+SDLK_F12 F12
+SDLK_F13 F13
+SDLK_F14 F14
+SDLK_F15 F15
+SDLK_NUMLOCK numlock
+SDLK_CAPSLOCK capslock
+SDLK_SCROLLOCK scrollock
+SDLK_RSHIFT right shift
+SDLK_LSHIFT left shift
+SDLK_RCTRL right ctrl
+SDLK_LCTRL left ctrl
+SDLK_RALT right alt
+SDLK_LALT left alt
+SDLK_RMETA right meta
+SDLK_LMETA left meta
+SDLK_LSUPER left windows key
+SDLK_RSUPER right windows key
+SDLK_MODE mode shift
+SDLK_HELP help
+SDLK_PRINT print-screen
+SDLK_SYSREQ SysRq
+SDLK_BREAK break
+SDLK_MENU menu
+SDLK_POWER power
+SDLK_EURO euro\fR
+.fi
+
+
+.SH "SDL modifier definitions"
+.PP
+\fBSDL Modifier Meaning\fR
+.nf
+\f(CWKMOD_NONE No modifiers applicable
+KMOD_NUM Numlock is down
+KMOD_CAPS Capslock is down
+KMOD_LCTRL Left Control is down
+KMOD_RCTRL Right Control is down
+KMOD_RSHIFT Right Shift is down
+KMOD_LSHIFT Left Shift is down
+KMOD_RALT Right Alt is down
+KMOD_LALT Left Alt is down
+KMOD_CTRL A Control key is down
+KMOD_SHIFT A Shift key is down
+KMOD_ALT An Alt key is down\fR
+.fi
+
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_ActiveEvent.3 b/distrib/sdl-1.2.15/docs/man3/SDL_ActiveEvent.3
new file mode 100644
index 0000000..068e7c0
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_ActiveEvent.3
@@ -0,0 +1,38 @@
+.TH "SDL_ActiveEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_ActiveEvent \- Application visibility event structure
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ Uint8 type;
+ Uint8 gain;
+ Uint8 state;
+} SDL_ActiveEvent;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBtype\fR
+\fBSDL_ACTIVEEVENT\&.\fP
+.TP 20
+\fBgain\fR
+0 if the event is a loss or 1 if it is a gain\&.
+.TP 20
+\fBstate\fR
+\fBSDL_APPMOUSEFOCUS\fP if mouse focus was gained or lost, \fBSDL_APPINPUTFOCUS\fP if input focus was gained or lost, or \fBSDL_APPACTIVE\fP if the application was iconified (\fBgain\fR=0) or restored(\fBgain\fR=1)\&.
+.SH "DESCRIPTION"
+.PP
+\fBSDL_ActiveEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_ACTIVEEVENT\fP is reported\&.
+.PP
+When the mouse leaves or enters the window area a \fBSDL_APPMOUSEFOCUS\fP type activation event occurs, if the mouse entered the window then \fBgain\fR will be 1, otherwise \fBgain\fR will be 0\&. A \fBSDL_APPINPUTFOCUS\fP type activation event occurs when the application loses or gains keyboard focus\&. This usually occurs when another application is made active\&. Finally, a \fBSDL_APPACTIVE\fP type event occurs when the application is either minimised/iconified (\fBgain\fR=0) or restored\&.
+.PP
+.RS
+\fBNote:
+.PP
+This event does not occur when an application window is first created\&.
+.RE
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Event\fR\fR, \fI\fBSDL_GetAppState\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_AddTimer.3 b/distrib/sdl-1.2.15/docs/man3/SDL_AddTimer.3
new file mode 100644
index 0000000..bc494ed
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_AddTimer.3
@@ -0,0 +1,38 @@
+.TH "SDL_AddTimer" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_AddTimer \- Add a timer which will call a callback after the specified number of milliseconds has elapsed\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSDL_TimerID \fBSDL_AddTimer\fP\fR(\fBUint32 interval, SDL_NewTimerCallback callback, void *param\fR);
+.SH "CALLBACK"
+.PP
+.nf
+\f(CW/* type definition for the "new" timer callback function */
+typedef Uint32 (*SDL_NewTimerCallback)(Uint32 interval, void *param);\fR
+.fi
+.PP
+.SH "DESCRIPTION"
+.PP
+Adds a callback function to be run after the specified number of milliseconds has elapsed\&. The callback function is passed the current timer interval and the user supplied parameter from the \fBSDL_AddTimer\fP call and returns the next timer interval\&. If the returned value from the callback is the same as the one passed in, the periodic alarm continues, otherwise a new alarm is scheduled\&.
+.PP
+To cancel a currently running timer call \fISDL_RemoveTimer\fR with the timer ID returned from \fBSDL_AddTimer\fP\&.
+.PP
+The timer callback function may run in a different thread than your main program, and so shouldn\&'t call any functions from within itself\&. You may always call \fISDL_PushEvent\fR, however\&.
+.PP
+The granularity of the timer is platform-dependent, but you should count on it being at least 10 ms as this is the most common number\&. This means that if you request a 16 ms timer, your callback will run approximately 20 ms later on an unloaded system\&. If you wanted to set a flag signaling a frame update at 30 frames per second (every 33 ms), you might set a timer for 30 ms (see example below)\&. If you use this function, you need to pass \fBSDL_INIT_TIMER\fP to \fISDL_Init\fR\&.
+.SH "RETURN VALUE"
+.PP
+Returns an ID value for the added timer or \fBNULL\fR if there was an error\&.
+.SH "EXAMPLES"
+.PP
+.PP
+.nf
+\f(CWmy_timer_id = SDL_AddTimer((33/10)*10, my_callbackfunc, my_callback_param);\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_RemoveTimer\fP\fR, \fI\fBSDL_PushEvent\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_AudioCVT.3 b/distrib/sdl-1.2.15/docs/man3/SDL_AudioCVT.3
new file mode 100644
index 0000000..f5e3489
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_AudioCVT.3
@@ -0,0 +1,68 @@
+.TH "SDL_AudioCVT" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_AudioCVT \- Audio Conversion Structure
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ int needed;
+ Uint16 src_format;
+ Uint16 dest_format;
+ double rate_incr;
+ Uint8 *buf;
+ int len;
+ int len_cvt;
+ int len_mult;
+ double len_ratio;
+ void (*filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
+ int filter_index;
+} SDL_AudioCVT;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBneeded\fR
+Set to one if the conversion is possible
+.TP 20
+\fBsrc_format\fR
+Audio format of the source
+.TP 20
+\fBdest_format\fR
+Audio format of the destination
+.TP 20
+\fBrate_incr\fR
+Rate conversion increment
+.TP 20
+\fBbuf\fR
+Audio buffer
+.TP 20
+\fBlen\fR
+Length of the original audio buffer in bytes
+.TP 20
+\fBlen_cvt\fR
+Length of converted audio buffer in bytes (calculated)
+.TP 20
+\fBlen_mult\fR
+\fBbuf\fR must be \fBlen\fR*\fBlen_mult\fR bytes in size(calculated)
+.TP 20
+\fBlen_ratio\fR
+Final audio size is \fBlen\fR*\fBlen_ratio\fR
+.TP 20
+\fBfilters[10](\&.\&.)\fR
+Pointers to functions needed for this conversion
+.TP 20
+\fBfilter_index\fR
+Current conversion function
+.SH "DESCRIPTION"
+.PP
+The \fBSDL_AudioCVT\fR is used to convert audio data between different formats\&. A \fBSDL_AudioCVT\fR structure is created with the \fI\fBSDL_BuildAudioCVT\fP\fR function, while the actual conversion is done by the \fI\fBSDL_ConvertAudio\fP\fR function\&.
+.PP
+Many of the fields in the \fBSDL_AudioCVT\fR structure should be considered private and their function will not be discussed here\&.
+.IP "\fBUint8 *\fP\fBbuf\fR" 10This points to the audio data that will be used in the conversion\&. It is both the source and the destination, which means the converted audio data overwrites the original data\&. It also means that the converted data may be larger than the original data (if you were converting from 8-bit to 16-bit, for instance), so you must ensure \fBbuf\fR is large enough\&. See below\&.
+.IP "\fBint\fP \fBlen\fR" 10This is the length of the original audio data in bytes\&.
+.IP "\fBint\fP \fBlen_mult\fR" 10As explained above, the audio buffer needs to be big enough to store the converted data, which may be bigger than the original audio data\&. The length of \fBbuf\fR should be \fBlen\fR*\fBlen_mult\fR\&.
+.IP "\fBdouble\fP \fBlen_ratio\fR" 10When you have finished converting your audio data, you need to know how much of your audio buffer is valid\&. \fBlen\fR*\fBlen_ratio\fR is the size of the converted audio data in bytes\&. This is very similar to \fBlen_mult\fR, however when the convert audio data is shorter than the original \fBlen_mult\fR would be 1\&. \fBlen_ratio\fR, on the other hand, would be a fractional number between 0 and 1\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_BuildAudioCVT\fP\fR, \fI\fBSDL_ConvertAudio\fP\fR, \fI\fBSDL_AudioSpec\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_AudioSpec.3 b/distrib/sdl-1.2.15/docs/man3/SDL_AudioSpec.3
new file mode 100644
index 0000000..c70ffd1
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_AudioSpec.3
@@ -0,0 +1,70 @@
+.TH "SDL_AudioSpec" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_AudioSpec \- Audio Specification Structure
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ int freq;
+ Uint16 format;
+ Uint8 channels;
+ Uint8 silence;
+ Uint16 samples;
+ Uint32 size;
+ void (*callback)(void *userdata, Uint8 *stream, int len);
+ void *userdata;
+} SDL_AudioSpec;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBfreq\fR
+Audio frequency in samples per second
+.TP 20
+\fBformat\fR
+Audio data format
+.TP 20
+\fBchannels\fR
+Number of channels: 1 mono, 2 stereo
+.TP 20
+\fBsilence\fR
+Audio buffer silence value (calculated)
+.TP 20
+\fBsamples\fR
+Audio buffer size in samples
+.TP 20
+\fBsize\fR
+Audio buffer size in bytes (calculated)
+.TP 20
+\fBcallback(\&.\&.)\fR
+Callback function for filling the audio buffer
+.TP 20
+\fBuserdata\fR
+Pointer the user data which is passed to the callback function
+.SH "DESCRIPTION"
+.PP
+The \fBSDL_AudioSpec\fR structure is used to describe the format of some audio data\&. This structure is used by \fI\fBSDL_OpenAudio\fP\fR and \fI\fBSDL_LoadWAV\fP\fR\&. While all fields are used by \fBSDL_OpenAudio\fP only \fBfreq\fR, \fBformat\fR, \fBsamples\fR and \fBchannels\fR are used by \fBSDL_LoadWAV\fP\&. We will detail these common members here\&.
+.TP 20
+\fBfreq\fR
+The number of samples sent to the sound device every second\&. Common values are 11025, 22050 and 44100\&. The higher the better\&.
+.TP 20
+\fBformat\fR
+Specifies the size and type of each sample element
+.IP "\fBAUDIO_U8\fP" 10Unsigned 8-bit samples
+.IP "\fBAUDIO_S8\fP" 10Signed 8-bit samples
+.IP "\fBAUDIO_U16\fP or \fBAUDIO_U16LSB\fP" 10Unsigned 16-bit little-endian samples
+.IP "\fBAUDIO_S16\fP or \fBAUDIO_S16LSB\fP" 10Signed 16-bit little-endian samples
+.IP "\fBAUDIO_U16MSB\fP" 10Unsigned 16-bit big-endian samples
+.IP "\fBAUDIO_S16MSB\fP" 10Signed 16-bit big-endian samples
+.IP "\fBAUDIO_U16SYS\fP" 10Either \fBAUDIO_U16LSB\fP or \fBAUDIO_U16MSB\fP depending on you systems endianness
+.IP "\fBAUDIO_S16SYS\fP" 10Either \fBAUDIO_S16LSB\fP or \fBAUDIO_S16MSB\fP depending on you systems endianness
+.TP 20
+\fBchannels\fR
+The number of seperate sound channels\&. 1 is mono (single channel), 2 is stereo (dual channel)\&.
+.TP 20
+\fBsamples\fR
+When used with \fI\fBSDL_OpenAudio\fP\fR this refers to the size of the audio buffer in samples\&. A sample a chunk of audio data of the size specified in \fBformat\fR mulitplied by the number of channels\&. When the \fBSDL_AudioSpec\fR is used with \fI\fBSDL_LoadWAV\fP\fR \fBsamples\fR is set to 4096\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_OpenAudio\fP\fR, \fI\fBSDL_LoadWAV\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_BlitSurface.3 b/distrib/sdl-1.2.15/docs/man3/SDL_BlitSurface.3
new file mode 100644
index 0000000..5f62ffb
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_BlitSurface.3
@@ -0,0 +1,60 @@
+.TH "SDL_BlitSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_BlitSurface \- This performs a fast blit from the source surface to the destination surface\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_BlitSurface\fP\fR(\fBSDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect\fR);
+.SH "DESCRIPTION"
+.PP
+This performs a fast blit from the source surface to the destination surface\&.
+.PP
+Only the position is used in the \fBdstrect\fR (the width and height are ignored)\&.
+.PP
+If either \fBsrcrect\fR or \fBdstrect\fR are \fBNULL\fP, the entire surface (\fBsrc\fR or \fBdst\fR) is copied\&.
+.PP
+The final blit rectangle is saved in \fBdstrect\fR after all clipping is performed (\fBsrcrect\fR is not modified)\&.
+.PP
+The blit function should not be called on a locked surface\&.
+.PP
+The results of blitting operations vary greatly depending on whether \fBSDL_SRCAPLHA\fP is set or not\&. See \fISDL_SetAlpha\fR for an explaination of how this affects your results\&. Colorkeying and alpha attributes also interact with surface blitting, as the following pseudo-code should hopefully explain\&.
+.PP
+.nf
+\f(CWif (source surface has SDL_SRCALPHA set) {
+ if (source surface has alpha channel (that is, format->Amask != 0))
+ blit using per-pixel alpha, ignoring any colour key
+ else {
+ if (source surface has SDL_SRCCOLORKEY set)
+ blit using the colour key AND the per-surface alpha value
+ else
+ blit using the per-surface alpha value
+ }
+} else {
+ if (source surface has SDL_SRCCOLORKEY set)
+ blit using the colour key
+ else
+ ordinary opaque rectangular blit
+}\fR
+.fi
+.PP
+.SH "RETURN VALUE"
+.PP
+If the blit is successful, it returns \fB0\fR, otherwise it returns \fB-1\fR\&.
+.PP
+If either of the surfaces were in video memory, and the blit returns \fB-2\fR, the video memory was lost, so it should be reloaded with artwork and re-blitted:
+.PP
+.nf
+\f(CW while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
+ while ( SDL_LockSurface(image)) < 0 )
+ Sleep(10);
+ -- Write image pixels to image->pixels --
+ SDL_UnlockSurface(image);
+ }\fR
+.fi
+.PP
+ This happens under DirectX 5\&.0 when the system switches away from your fullscreen application\&. Locking the surface will also fail until you have access to the video memory again\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_LockSurface\fP\fR, \fI\fBSDL_FillRect\fP\fR, \fI\fBSDL_Surface\fR\fR, \fI\fBSDL_Rect\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_BuildAudioCVT.3 b/distrib/sdl-1.2.15/docs/man3/SDL_BuildAudioCVT.3
new file mode 100644
index 0000000..dfca664
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_BuildAudioCVT.3
@@ -0,0 +1,23 @@
+.TH "SDL_BuildAudioCVT" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_BuildAudioCVT \- Initializes a SDL_AudioCVT structure for conversion
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_BuildAudioCVT\fP\fR(\fBSDL_AudioCVT *cvt, Uint16 src_format, Uint8 src_channels, int src_rate, Uint16 dst_format, Uint8 dst_channels, int dst_rate\fR);
+.SH "DESCRIPTION"
+.PP
+Before an \fI\fBSDL_AudioCVT\fR\fR structure can be used to convert audio data it must be initialized with source and destination information\&.
+.PP
+\fBsrc_format\fR and \fBdst_format\fR are the source and destination format of the conversion\&. (For information on audio formats see \fI\fB SDL_AudioSpec\fR\fR)\&. \fBsrc_channels\fR and \fBdst_channels\fR are the number of channels in the source and destination formats\&. Finally, \fBsrc_rate\fR and \fBdst_rate\fR are the frequency or samples-per-second of the source and destination formats\&. Once again, see \fI\fBSDL_AudioSpec\fR\fR\&.
+.SH "RETURN VALUES"
+.PP
+Returns \fB-1\fR if the filter could not be built or 1 if it could\&.
+.SH "EXAMPLES"
+.PP
+See \fI\fBSDL_ConvertAudio\fP\fR\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_ConvertAudio\fP\fR, \fI\fBSDL_AudioCVT\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CD.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CD.3
new file mode 100644
index 0000000..ea21818
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CD.3
@@ -0,0 +1,57 @@
+.TH "SDL_CD" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CD \- CDROM Drive Information
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ int id;
+ CDstatus status;
+ int numtracks;
+ int cur_track;
+ int cur_frame;
+ SDL_CDtrack track[SDL_MAX_TRACKS+1];
+} SDL_CD;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBid\fR
+Private drive identifier
+.TP 20
+\fBstatus\fR
+Drive \fIstatus\fR
+.TP 20
+\fBnumtracks\fR
+Number of tracks on the CD
+.TP 20
+\fBcur_track\fR
+Current track
+.TP 20
+\fBcur_frame\fR
+Current frame offset within the track
+.TP 20
+\fBtrack\fR[SDL_MAX_TRACKS+1]
+Array of track descriptions\&. (see \fI\fBSDL_CDtrack\fR\fR)
+.SH "DESCRIPTION"
+.PP
+An \fBSDL_CD\fR structure is returned by \fI\fBSDL_CDOpen\fP\fR\&. It represents an opened CDROM device and stores information on the layout of the tracks on the disc\&.
+.PP
+A frame is the base data unit of a CD\&. \fBCD_FPS\fP frames is equal to 1 second of music\&. SDL provides two macros for converting between time and frames: \fBFRAMES_TO_MSF(f, M,S,F)\fP and \fBMSF_TO_FRAMES\fP\&.
+.SH "EXAMPLES"
+.PP
+.nf
+\f(CWint min, sec, frame;
+int frame_offset;
+
+FRAMES_TO_MSF(cdrom->cur_frame, &min, &sec, &frame);
+printf("Current Position: %d minutes, %d seconds, %d frames
+", min, sec, frame);
+
+frame_offset=MSF_TO_FRAMES(min, sec, frame);\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CDOpen\fP\fR, \fI\fBSDL_CDtrack\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CDClose.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CDClose.3
new file mode 100644
index 0000000..9dd29fb
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CDClose.3
@@ -0,0 +1,15 @@
+.TH "SDL_CDClose" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CDClose \- Closes a SDL_CD handle
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_CDClose\fP\fR(\fBSDL_CD *cdrom\fR);
+.SH "DESCRIPTION"
+.PP
+Closes the given \fBcdrom\fR handle\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CDOpen\fP\fR, \fI\fBSDL_CD\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CDEject.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CDEject.3
new file mode 100644
index 0000000..2f2983d
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CDEject.3
@@ -0,0 +1,18 @@
+.TH "SDL_CDEject" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CDEject \- Ejects a CDROM
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_CDEject\fP\fR(\fBSDL_CD *cdrom\fR);
+.SH "DESCRIPTION"
+.PP
+Ejects the given \fBcdrom\fR\&.
+.SH "RETURN VALUE"
+.PP
+Returns \fB0\fR on success, or \fB-1\fR on an error\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CD\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CDName.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CDName.3
new file mode 100644
index 0000000..c6f6298
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CDName.3
@@ -0,0 +1,23 @@
+.TH "SDL_CDName" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CDName \- Returns a human-readable, system-dependent identifier for the CD-ROM\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBconst char *\fBSDL_CDName\fP\fR(\fBint drive\fR);
+.SH "DESCRIPTION"
+.PP
+Returns a human-readable, system-dependent identifier for the CD-ROM\&. \fBdrive\fR is the index of the drive\&. Drive indices start to 0 and end at \fBSDL_CDNumDrives()\fP-1\&.
+.SH "EXAMPLES"
+.PP
+.IP " \(bu" 6
+"/dev/cdrom"
+.IP " \(bu" 6
+"E:"
+.IP " \(bu" 6
+"/dev/disk/ide/1/master"
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CDNumDrives\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CDNumDrives.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CDNumDrives.3
new file mode 100644
index 0000000..ad62b68
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CDNumDrives.3
@@ -0,0 +1,15 @@
+.TH "SDL_CDNumDrives" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CDNumDrives \- Returns the number of CD-ROM drives on the system\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_CDNumDrives\fP\fR(\fBvoid\fR)
+.SH "DESCRIPTION"
+.PP
+Returns the number of CD-ROM drives on the system\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CDOpen\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CDOpen.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CDOpen.3
new file mode 100644
index 0000000..dbf23fc
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CDOpen.3
@@ -0,0 +1,58 @@
+.TH "SDL_CDOpen" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CDOpen \- Opens a CD-ROM drive for access\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSDL_CD *\fBSDL_CDOpen\fP\fR(\fBint drive\fR);
+.SH "DESCRIPTION"
+.PP
+Opens a CD-ROM drive for access\&. It returns a \fI\fBSDL_CD\fR\fR structure on success, or \fBNULL\fP if the drive was invalid or busy\&. This newly opened CD-ROM becomes the default CD used when other CD functions are passed a \fBNULL\fP CD-ROM handle\&.
+.PP
+Drives are numbered starting with 0\&. Drive 0 is the system default CD-ROM\&.
+.SH "EXAMPLES"
+.PP
+.nf
+\f(CWSDL_CD *cdrom;
+int cur_track;
+int min, sec, frame;
+SDL_Init(SDL_INIT_CDROM);
+atexit(SDL_Quit);
+
+/* Check for CD drives */
+if(!SDL_CDNumDrives()){
+ /* None found */
+ fprintf(stderr, "No CDROM devices available
+");
+ exit(-1);
+}
+
+/* Open the default drive */
+cdrom=SDL_CDOpen(0);
+
+/* Did if open? Check if cdrom is NULL */
+if(!cdrom){
+ fprintf(stderr, "Couldn\&'t open drive: %s
+", SDL_GetError());
+ exit(-1);
+}
+
+/* Print Volume info */
+printf("Name: %s
+", SDL_CDName(0));
+printf("Tracks: %d
+", cdrom->numtracks);
+for(cur_track=0;cur_track < cdrom->numtracks; cur_track++){
+ FRAMES_TO_MSF(cdrom->track[cur_track]\&.length, &min, &sec, &frame);
+ printf(" Track %d: Length %d:%d
+", cur_track, min, sec);
+}
+
+SDL_CDClose(cdrom);\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CD\fR\fR, \fI\fBSDL_CDtrack\fR\fR, \fI\fBSDL_CDClose\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CDPause.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CDPause.3
new file mode 100644
index 0000000..bca06c0
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CDPause.3
@@ -0,0 +1,18 @@
+.TH "SDL_CDPause" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CDPause \- Pauses a CDROM
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_CDPause\fP\fR(\fBSDL_CD *cdrom\fR);
+.SH "DESCRIPTION"
+.PP
+Pauses play on the given \fBcdrom\fR\&.
+.SH "RETURN VALUE"
+.PP
+Returns \fB0\fR on success, or \fB-1\fR on an error\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CDPlay\fP\fR, \fI\fBSDL_CDResume\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CDPlay.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CDPlay.3
new file mode 100644
index 0000000..39c25ec
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CDPlay.3
@@ -0,0 +1,18 @@
+.TH "SDL_CDPlay" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CDPlay \- Play a CD
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_CDPlay\fP\fR(\fBSDL_CD *cdrom, int start, int length\fR);
+.SH "DESCRIPTION"
+.PP
+Plays the given \fBcdrom\fR, starting a frame \fBstart\fR for \fBlength\fR frames\&.
+.SH "RETURN VALUES"
+.PP
+Returns \fB0\fR on success, or \fB-1\fR on an error\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CDPlayTracks\fP\fR, \fI\fBSDL_CDStop\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CDPlayTracks.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CDPlayTracks.3
new file mode 100644
index 0000000..5a403b3
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CDPlayTracks.3
@@ -0,0 +1,47 @@
+.TH "SDL_CDPlayTracks" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CDPlayTracks \- Play the given CD track(s)
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_CDPlayTracks\fP\fR(\fBSDL_CD *cdrom, int start_track, int start_frame, int ntracks, int nframes)\fR);
+.SH "DESCRIPTION"
+.PP
+\fBSDL_CDPlayTracks\fP plays the given CD starting at track \fBstart_track\fR, for \fBntracks\fR tracks\&.
+.PP
+\fBstart_frame\fR is the frame offset, from the beginning of the \fBstart_track\fR, at which to start\&. \fBnframes\fR is the frame offset, from the beginning of the last track (\fBstart_track\fR+\fBntracks\fR), at which to end playing\&.
+.PP
+\fBSDL_CDPlayTracks\fP should only be called after calling \fI\fBSDL_CDStatus\fP\fR to get track information about the CD\&.
+.PP
+.RS
+\fBNote:
+.PP
+Data tracks are ignored\&.
+.RE
+.SH "RETURN VALUE"
+.PP
+Returns \fB0\fR, or \fB-1\fR if there was an error\&.
+.SH "EXAMPLES"
+.PP
+.PP
+.nf
+\f(CW/* assuming cdrom is a previously opened device */
+/* Play the entire CD */
+if(CD_INDRIVE(SDL_CDStatus(cdrom)))
+ SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
+
+/* Play the first track */
+if(CD_INDRIVE(SDL_CDStatus(cdrom)))
+ SDL_CDPlayTracks(cdrom, 0, 0, 1, 0);
+
+/* Play first 15 seconds of the 2nd track */
+if(CD_INDRIVE(SDL_CDStatus(cdrom)))
+ SDL_CDPlayTracks(cdrom, 1, 0, 0, CD_FPS*15);\fR
+.fi
+.PP
+
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CDPlay\fP\fR, \fI\fBSDL_CDStatus\fP\fR, \fI\fBSDL_CD\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CDResume.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CDResume.3
new file mode 100644
index 0000000..86f6c2d
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CDResume.3
@@ -0,0 +1,18 @@
+.TH "SDL_CDResume" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CDResume \- Resumes a CDROM
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_CDResume\fP\fR(\fBSDL_CD *cdrom\fR);
+.SH "DESCRIPTION"
+.PP
+Resumes play on the given \fBcdrom\fR\&.
+.SH "RETURN VALUE"
+.PP
+Returns \fB0\fR on success, or \fB-1\fR on an error\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CDPlay\fP\fR, \fI\fBSDL_CDPause\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CDStatus.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CDStatus.3
new file mode 100644
index 0000000..77eed72
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CDStatus.3
@@ -0,0 +1,59 @@
+.TH "SDL_CDStatus" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CDStatus \- Returns the current status of the given drive\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBCDstatus \fBSDL_CDStatus\fP\fR(\fBSDL_CD *cdrom\fR);
+\fB/* Given a status, returns true if there\&'s a disk in the drive */
+#define CD_INDRIVE(status) ((int)status > 0)
+.SH "DESCRIPTION"
+.PP
+This function returns the current status of the given drive\&. Status is described like so:
+.PP
+.nf
+\f(CWtypedef enum {
+ CD_TRAYEMPTY,
+ CD_STOPPED,
+ CD_PLAYING,
+ CD_PAUSED,
+ CD_ERROR = -1
+} CDstatus;\fR
+.fi
+.PP
+.PP
+If the drive has a CD in it, the table of contents of the CD and current play position of the CD will be stored in the SDL_CD structure\&.
+.PP
+The macro \fBCD_INDRIVE\fP is provided for convenience, and given a status returns true if there\&'s a disk in the drive\&.
+.PP
+.RS
+\fBNote:
+.PP
+\fBSDL_CDStatus\fP also updates the \fI\fBSDL_CD\fR\fR structure passed to it\&.
+.RE
+.SH "EXAMPLE"
+.PP
+.nf
+\f(CWint playTrack(int track)
+{
+ int playing = 0;
+
+ if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
+ /* clamp to the actual number of tracks on the CD */
+ if (track >= cdrom->numtracks) {
+ track = cdrom->numtracks-1;
+ }
+
+ if ( SDL_CDPlayTracks(cdrom, track, 0, 1, 0) == 0 ) {
+ playing = 1;
+ }
+ }
+ return playing;
+}\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CD\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CDStop.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CDStop.3
new file mode 100644
index 0000000..61e2b23
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CDStop.3
@@ -0,0 +1,18 @@
+.TH "SDL_CDStop" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CDStop \- Stops a CDROM
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_CDStop\fP\fR(\fBSDL_CD *cdrom\fR);
+.SH "DESCRIPTION"
+.PP
+Stops play on the given \fBcdrom\fR\&.
+.SH "RETURN VALUE"
+.PP
+Returns \fB0\fR on success, or \fB-1\fR on an error\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CDPlay\fP\fR,
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CDtrack.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CDtrack.3
new file mode 100644
index 0000000..fdac6ee
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CDtrack.3
@@ -0,0 +1,40 @@
+.TH "SDL_CDtrack" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CDtrack \- CD Track Information Structure
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ Uint8 id;
+ Uint8 type;
+ Uint32 length;
+ Uint32 offset;
+} SDL_CDtrack;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBid\fR
+Track number (0-99)
+.TP 20
+\fBtype\fR
+\fBSDL_AUDIO_TRACK\fP or \fBSDL_DATA_TRACK\fP
+.TP 20
+\fBlength\fR
+Length, in frames, of this track
+.TP 20
+\fBoffset\fR
+Frame offset to the beginning of this track
+.SH "DESCRIPTION"
+.PP
+\fBSDL_CDtrack\fR stores data on each track on a CD, its fields should be pretty self explainatory\&. It is a member a the \fI\fBSDL_CD\fR\fR structure\&.
+.PP
+.RS
+\fBNote:
+.PP
+Frames can be converted to standard timings\&. There are \fBCD_FPS\fP frames per second, so \fBSDL_CDtrack\fR\&.\fBlength\fR/\fBCD_FPS\fP=length_in_seconds\&.
+.RE
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CD\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CloseAudio.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CloseAudio.3
new file mode 100644
index 0000000..85ff1a4
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CloseAudio.3
@@ -0,0 +1,15 @@
+.TH "SDL_CloseAudio" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CloseAudio \- Shuts down audio processing and closes the audio device\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_CloseAudio\fP\fR(\fBvoid\fR)
+.SH "DESCRIPTION"
+.PP
+This function shuts down audio processing and closes the audio device\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_OpenAudio\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_Color.3 b/distrib/sdl-1.2.15/docs/man3/SDL_Color.3
new file mode 100644
index 0000000..e96ee8a
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_Color.3
@@ -0,0 +1,34 @@
+.TH "SDL_Color" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_Color \- Format independent color description
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 unused;
+} SDL_Color;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBr\fR
+Red intensity
+.TP 20
+\fBg\fR
+Green intensity
+.TP 20
+\fBb\fR
+Blue intensity
+.TP 20
+\fBunused\fR
+Unused
+.SH "DESCRIPTION"
+.PP
+\fBSDL_Color\fR describes a color in a format independent way\&. You can convert a \fBSDL_Color\fR to a pixel value for a certain pixel format using \fI\fBSDL_MapRGB\fP\fR\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_PixelFormat\fR\fR, \fI\fBSDL_SetColors\fP\fR, \fI\fBSDL_Palette\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CondBroadcast.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CondBroadcast.3
new file mode 100644
index 0000000..efc50b9
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CondBroadcast.3
@@ -0,0 +1,16 @@
+.TH "SDL_CondBroadcast" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CondBroadcast \- Restart all threads waiting on a condition variable
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL_thread\&.h"
+.sp
+\fBint \fBSDL_CondBroadcast\fP\fR(\fBSDL_cond *cond\fR);
+.SH "DESCRIPTION"
+.PP
+Restarts all threads that are waiting on the condition variable, \fBcond\fR\&. Returns \fB0\fR on success, or \fB-1\fR on an error\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CondSignal\fP\fR, \fI\fBSDL_CondWait\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CondSignal.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CondSignal.3
new file mode 100644
index 0000000..b09c875
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CondSignal.3
@@ -0,0 +1,16 @@
+.TH "SDL_CondSignal" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CondSignal \- Restart a thread wait on a condition variable
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL_thread\&.h"
+.sp
+\fBint \fBSDL_CondSignal\fP\fR(\fBSDL_cond *cond\fR);
+.SH "DESCRIPTION"
+.PP
+Restart one of the threads that are waiting on the condition variable, \fBcond\fR\&. Returns \fB0\fR on success of \fB-1\fR on an error\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CondWait\fP\fR, \fI\fBSDL_CondBroadcast\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CondWait.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CondWait.3
new file mode 100644
index 0000000..642f512
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CondWait.3
@@ -0,0 +1,16 @@
+.TH "SDL_CondWait" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CondWait \- Wait on a condition variable
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL_thread\&.h"
+.sp
+\fBint \fBSDL_CondWait\fP\fR(\fBSDL_cond *cond, SDL_mutex *mut\fR);
+.SH "DESCRIPTION"
+.PP
+Wait on the condition variable \fBcond\fR and unlock the provided mutex\&. The mutex must the locked before entering this function\&. Returns \fB0\fR when it is signalled, or \fB-1\fR on an error\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CondWaitTimeout\fP\fR, \fI\fBSDL_CondSignal\fP\fR, \fI\fBSDL_mutexP\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CondWaitTimeout.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CondWaitTimeout.3
new file mode 100644
index 0000000..7b3424d
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CondWaitTimeout.3
@@ -0,0 +1,16 @@
+.TH "SDL_CondWaitTimeout" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CondWaitTimeout \- Wait on a condition variable, with timeout
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL_thread\&.h"
+.sp
+\fBint \fBSDL_CondWaitTimeout\fP\fR(\fBSDL_cond *cond, SDL_mutex *mutex, Uint32 ms\fR);
+.SH "DESCRIPTION"
+.PP
+Wait on the condition variable \fBcond\fR for, at most, \fBms\fR milliseconds\&. \fBmut\fR is unlocked so it must be locked when the function is called\&. Returns \fBSDL_MUTEX_TIMEDOUT\fP if the condition is not signalled in the allotted time, \fB0\fR if it was signalled or \fB-1\fR on an error\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CondWait\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_ConvertAudio.3 b/distrib/sdl-1.2.15/docs/man3/SDL_ConvertAudio.3
new file mode 100644
index 0000000..73ef974
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_ConvertAudio.3
@@ -0,0 +1,95 @@
+.TH "SDL_ConvertAudio" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_ConvertAudio \- Convert audio data to a desired audio format\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_ConvertAudio\fP\fR(\fBSDL_AudioCVT *cvt\fR);
+.SH "DESCRIPTION"
+.PP
+\fBSDL_ConvertAudio\fP takes one parameter, \fBcvt\fR, which was previously initilized\&. Initilizing a \fI\fBSDL_AudioCVT\fR\fR is a two step process\&. First of all, the structure must be passed to \fI\fBSDL_BuildAudioCVT\fP\fR along with source and destination format parameters\&. Secondly, the \fBcvt\fR->\fBbuf\fR and \fBcvt\fR->\fBlen\fR fields must be setup\&. \fBcvt\fR->\fBbuf\fR should point to the audio data and \fBcvt\fR->\fBlen\fR should be set to the length of the audio data in bytes\&. Remember, the length of the buffer pointed to by \fBbuf\fR show be \fBlen\fR*\fBlen_mult\fR bytes in length\&.
+.PP
+Once the \fBSDL_AudioCVT\fRstructure is initilized then we can pass it to \fBSDL_ConvertAudio\fP, which will convert the audio data pointer to by \fBcvt\fR->\fBbuf\fR\&. If \fBSDL_ConvertAudio\fP returned \fB0\fR then the conversion was completed successfully, otherwise \fB-1\fR is returned\&.
+.PP
+If the conversion completed successfully then the converted audio data can be read from \fBcvt\fR->\fBbuf\fR\&. The amount of valid, converted, audio data in the buffer is equal to \fBcvt\fR->\fBlen\fR*\fBcvt\fR->\fBlen_ratio\fR\&.
+.SH "EXAMPLES"
+.PP
+.nf
+\f(CW/* Converting some WAV data to hardware format */
+void my_audio_callback(void *userdata, Uint8 *stream, int len);
+
+SDL_AudioSpec *desired, *obtained;
+SDL_AudioSpec wav_spec;
+SDL_AudioCVT wav_cvt;
+Uint32 wav_len;
+Uint8 *wav_buf;
+int ret;
+
+/* Allocated audio specs */
+desired=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec));
+obtained=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec));
+
+/* Set desired format */
+desired->freq=22050;
+desired->format=AUDIO_S16LSB;
+desired->samples=8192;
+desired->callback=my_audio_callback;
+desired->userdata=NULL;
+
+/* Open the audio device */
+if ( SDL_OpenAudio(desired, obtained) < 0 ){
+ fprintf(stderr, "Couldn\&'t open audio: %s
+", SDL_GetError());
+ exit(-1);
+}
+
+free(desired);
+
+/* Load the test\&.wav */
+if( SDL_LoadWAV("test\&.wav", &wav_spec, &wav_buf, &wav_len) == NULL ){
+ fprintf(stderr, "Could not open test\&.wav: %s
+", SDL_GetError());
+ SDL_CloseAudio();
+ free(obtained);
+ exit(-1);
+}
+
+/* Build AudioCVT */
+ret = SDL_BuildAudioCVT(&wav_cvt,
+ wav_spec\&.format, wav_spec\&.channels, wav_spec\&.freq,
+ obtained->format, obtained->channels, obtained->freq);
+
+/* Check that the convert was built */
+if(ret==-1){
+ fprintf(stderr, "Couldn\&'t build converter!
+");
+ SDL_CloseAudio();
+ free(obtained);
+ SDL_FreeWAV(wav_buf);
+}
+
+/* Setup for conversion */
+wav_cvt\&.buf=(Uint8 *)malloc(wav_len*wav_cvt\&.len_mult);
+wav_cvt\&.len=wav_len;
+memcpy(wav_cvt\&.buf, wav_buf, wav_len);
+
+/* We can delete to original WAV data now */
+SDL_FreeWAV(wav_buf);
+
+/* And now we\&'re ready to convert */
+SDL_ConvertAudio(&wav_cvt);
+
+/* do whatever */
+\&.
+\&.
+\&.
+\&.
+
+\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_BuildAudioCVT\fP\fR, \fI\fBSDL_AudioCVT\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_ConvertSurface.3 b/distrib/sdl-1.2.15/docs/man3/SDL_ConvertSurface.3
new file mode 100644
index 0000000..cb24e34
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_ConvertSurface.3
@@ -0,0 +1,24 @@
+.TH "SDL_ConvertSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_ConvertSurface \- Converts a surface to the same format as another surface\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL/SDL\&.h"
+.sp
+\fBSDL_Surface *\fBSDL_ConvertSurface\fP\fR(\fBSDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags\fR);
+.SH "DESCRIPTION"
+.PP
+Creates a new surface of the specified format, and then copies and maps the given surface to it\&. If this function fails, it returns \fBNULL\fP\&.
+.PP
+The \fBflags\fR parameter is passed to \fI\fBSDL_CreateRGBSurface\fP\fR and has those semantics\&.
+.PP
+This function is used internally by \fI\fBSDL_DisplayFormat\fP\fR\&.
+.PP
+This function can only be called after SDL_Init\&.
+.SH "RETURN VALUE"
+.PP
+Returns either a pointer to the new surface, or \fBNULL\fP on error\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CreateRGBSurface\fP\fR, \fI\fBSDL_DisplayFormat\fP\fR, \fI\fBSDL_PixelFormat\fR\fR, \fI\fBSDL_Surface\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CreateCond.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CreateCond.3
new file mode 100644
index 0000000..e8c2896
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CreateCond.3
@@ -0,0 +1,31 @@
+.TH "SDL_CreateCond" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CreateCond \- Create a condition variable
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL_thread\&.h"
+.sp
+\fBSDL_cond *\fBSDL_CreateCond\fP\fR(\fBvoid\fR);
+.SH "DESCRIPTION"
+.PP
+Creates a condition variable\&.
+.SH "EXAMPLES"
+.PP
+.nf
+\f(CWSDL_cond *cond;
+
+cond=SDL_CreateCond();
+\&.
+\&.
+/* Do stuff */
+
+\&.
+\&.
+SDL_DestroyCond(cond);\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_DestroyCond\fP\fR, \fI\fBSDL_CondWait\fP\fR, \fI\fBSDL_CondSignal\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CreateCursor.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CreateCursor.3
new file mode 100644
index 0000000..ef205c3
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CreateCursor.3
@@ -0,0 +1,120 @@
+.TH "SDL_CreateCursor" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CreateCursor \- Creates a new mouse cursor\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSDL_Cursor *\fBSDL_CreateCursor\fP\fR(\fBUint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y\fR);
+.SH "DESCRIPTION"
+.PP
+Create a cursor using the specified \fBdata\fR and \fBmask\fR (in MSB format)\&. The cursor width must be a multiple of 8 bits\&.
+.PP
+The cursor is created in black and white according to the following:
+.TP 20
+\fBData / Mask\fR
+\fBResulting pixel on screen\fR
+.TP 20
+0 / 1
+White
+.TP 20
+1 / 1
+Black
+.TP 20
+0 / 0
+Transparent
+.TP 20
+1 / 0
+Inverted color if possible, black if not\&.
+.PP
+Cursors created with this function must be freed with \fISDL_FreeCursor\fR\&.
+.SH "EXAMPLE"
+.PP
+.nf
+\f(CW/* Stolen from the mailing list */
+/* Creates a new mouse cursor from an XPM */
+
+
+/* XPM */
+static const char *arrow[] = {
+ /* width height num_colors chars_per_pixel */
+ " 32 32 3 1",
+ /* colors */
+ "X c #000000",
+ "\&. c #ffffff",
+ " c None",
+ /* pixels */
+ "X ",
+ "XX ",
+ "X\&.X ",
+ "X\&.\&.X ",
+ "X\&.\&.\&.X ",
+ "X\&.\&.\&.\&.X ",
+ "X\&.\&.\&.\&.\&.X ",
+ "X\&.\&.\&.\&.\&.\&.X ",
+ "X\&.\&.\&.\&.\&.\&.\&.X ",
+ "X\&.\&.\&.\&.\&.\&.\&.\&.X ",
+ "X\&.\&.\&.\&.\&.XXXXX ",
+ "X\&.\&.X\&.\&.X ",
+ "X\&.X X\&.\&.X ",
+ "XX X\&.\&.X ",
+ "X X\&.\&.X ",
+ " X\&.\&.X ",
+ " X\&.\&.X ",
+ " X\&.\&.X ",
+ " XX ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ "0,0"
+};
+
+static SDL_Cursor *init_system_cursor(const char *image[])
+{
+ int i, row, col;
+ Uint8 data[4*32];
+ Uint8 mask[4*32];
+ int hot_x, hot_y;
+
+ i = -1;
+ for ( row=0; row<32; ++row ) {
+ for ( col=0; col<32; ++col ) {
+ if ( col % 8 ) {
+ data[i] <<= 1;
+ mask[i] <<= 1;
+ } else {
+ ++i;
+ data[i] = mask[i] = 0;
+ }
+ switch (image[4+row][col]) {
+ case \&'X\&':
+ data[i] |= 0x01;
+ k[i] |= 0x01;
+ break;
+ case \&'\&.\&':
+ mask[i] |= 0x01;
+ break;
+ case \&' \&':
+ break;
+ }
+ }
+ }
+ sscanf(image[4+row], "%d,%d", &hot_x, &hot_y);
+ return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y);
+}\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_FreeCursor\fP\fR, \fI\fBSDL_SetCursor\fP\fR, \fI\fBSDL_ShowCursor\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CreateMutex.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CreateMutex.3
new file mode 100644
index 0000000..c665e1c
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CreateMutex.3
@@ -0,0 +1,43 @@
+.TH "SDL_CreateMutex" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CreateMutex \- Create a mutex
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL_thread\&.h"
+.sp
+\fBSDL_mutex *\fBSDL_CreateMutex\fP\fR(\fBvoid\fR);
+.SH "DESCRIPTION"
+.PP
+Create a new, unlocked mutex\&.
+.SH "EXAMPLES"
+.PP
+.nf
+\f(CWSDL_mutex *mut;
+
+mut=SDL_CreateMutex();
+\&.
+\&.
+if(SDL_mutexP(mut)==-1){
+ fprintf(stderr, "Couldn\&'t lock mutex
+");
+ exit(-1);
+}
+\&.
+/* Do stuff while mutex is locked */
+\&.
+\&.
+if(SDL_mutexV(mut)==-1){
+ fprintf(stderr, "Couldn\&'t unlock mutex
+");
+ exit(-1);
+}
+
+SDL_DestroyMutex(mut);
+\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_mutexP\fP\fR, \fI\fBSDL_mutexV\fP\fR, \fI\fBSDL_DestroyMutex\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CreateRGBSurface.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CreateRGBSurface.3
new file mode 100644
index 0000000..142b7b7
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CreateRGBSurface.3
@@ -0,0 +1,69 @@
+.TH "SDL_CreateRGBSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CreateRGBSurface \- Create an empty SDL_Surface
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSDL_Surface *\fBSDL_CreateRGBSurface\fP\fR(\fBUint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask\fR);
+.SH "DESCRIPTION"
+.PP
+Allocate an empty surface (must be called after \fISDL_SetVideoMode\fR)
+.PP
+If \fBdepth\fR is 8 bits an empty palette is allocated for the surface, otherwise a \&'packed-pixel\&' \fI\fBSDL_PixelFormat\fR\fR is created using the \fB[RGBA]mask\fR\&'s provided (see \fI\fBSDL_PixelFormat\fR\fR)\&. The \fBflags\fR specifies the type of surface that should be created, it is an OR\&'d combination of the following possible values\&.
+.TP 20
+\fBSDL_SWSURFACE\fP
+SDL will create the surface in system memory\&. This improves the performance of pixel level access, however you may not be able to take advantage of some types of hardware blitting\&.
+.TP 20
+\fBSDL_HWSURFACE\fP
+SDL will attempt to create the surface in video memory\&. This will allow SDL to take advantage of Video->Video blits (which are often accelerated)\&.
+.TP 20
+\fBSDL_SRCCOLORKEY\fP
+This flag turns on colourkeying for blits from this surface\&. If \fBSDL_HWSURFACE\fP is also specified and colourkeyed blits are hardware-accelerated, then SDL will attempt to place the surface in video memory\&. Use \fI\fBSDL_SetColorKey\fP\fR to set or clear this flag after surface creation\&.
+.TP 20
+\fBSDL_SRCALPHA\fP
+This flag turns on alpha-blending for blits from this surface\&. If \fBSDL_HWSURFACE\fP is also specified and alpha-blending blits are hardware-accelerated, then the surface will be placed in video memory if possible\&. Use \fI\fBSDL_SetAlpha\fP\fR to set or clear this flag after surface creation\&.
+.PP
+.RS
+\fBNote:
+.PP
+If an alpha-channel is specified (that is, if \fBAmask\fR is nonzero), then the \fBSDL_SRCALPHA\fP flag is automatically set\&. You may remove this flag by calling \fI\fBSDL_SetAlpha\fP\fR after surface creation\&.
+.RE
+.SH "RETURN VALUE"
+.PP
+Returns the created surface, or \fBNULL\fR upon error\&.
+.SH "EXAMPLE"
+.PP
+.nf
+\f(CW /* Create a 32-bit surface with the bytes of each pixel in R,G,B,A order,
+ as expected by OpenGL for textures */
+ SDL_Surface *surface;
+ Uint32 rmask, gmask, bmask, amask;
+
+ /* SDL interprets each pixel as a 32-bit number, so our masks must depend
+ on the endianness (byte order) of the machine */
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+ rmask = 0xff000000;
+ gmask = 0x00ff0000;
+ bmask = 0x0000ff00;
+ amask = 0x000000ff;
+#else
+ rmask = 0x000000ff;
+ gmask = 0x0000ff00;
+ bmask = 0x00ff0000;
+ amask = 0xff000000;
+#endif
+
+ surface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32,
+ rmask, gmask, bmask, amask);
+ if(surface == NULL) {
+ fprintf(stderr, "CreateRGBSurface failed: %s
+", SDL_GetError());
+ exit(1);
+ }\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CreateRGBSurfaceFrom\fP\fR, \fI\fBSDL_FreeSurface\fP\fR, \fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_LockSurface\fP\fR, \fI\fBSDL_PixelFormat\fR\fR, \fI\fBSDL_Surface\fR\fR \fI\fBSDL_SetAlpha\fP\fR \fI\fBSDL_SetColorKey\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CreateRGBSurfaceFrom.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CreateRGBSurfaceFrom.3
new file mode 100644
index 0000000..5330c1b
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CreateRGBSurfaceFrom.3
@@ -0,0 +1,22 @@
+.TH "SDL_CreateRGBSurfaceFrom" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CreateRGBSurfaceFrom \- Create an SDL_Surface from pixel data
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSDL_Surface *\fBSDL_CreateRGBSurfaceFrom\fP\fR(\fBvoid *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask\fR);
+.SH "DESCRIPTION"
+.PP
+Creates an SDL_Surface from the provided pixel data\&.
+.PP
+The data stored in \fBpixels\fR is assumed to be of the \fBdepth\fR specified in the parameter list\&. The pixel data is not copied into the \fBSDL_Surface\fR structure so it should not be freed until the surface has been freed with a called to \fISDL_FreeSurface\fR\&. \fBpitch\fR is the length of each scanline in bytes\&.
+.PP
+See \fI\fBSDL_CreateRGBSurface\fP\fR for a more detailed description of the other parameters\&.
+.SH "RETURN VALUE"
+.PP
+Returns the created surface, or \fBNULL\fR upon error\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CreateRGBSurface\fP\fR, \fI\fBSDL_FreeSurface\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CreateSemaphore.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CreateSemaphore.3
new file mode 100644
index 0000000..b803ead
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CreateSemaphore.3
@@ -0,0 +1,32 @@
+.TH "SDL_CreateSemaphore" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CreateSemaphore \- Creates a new semaphore and assigns an initial value to it\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL_thread\&.h"
+.sp
+\fBSDL_sem *\fBSDL_CreateSemaphore\fP\fR(\fBUint32 initial_value\fR);
+.SH "DESCRIPTION"
+.PP
+\fBSDL_CreateSemaphore()\fP creates a new semaphore and initializes it with the value \fBinitial_value\fR\&. Each locking operation on the semaphore by \fISDL_SemWait\fR, \fISDL_SemTryWait\fR or \fISDL_SemWaitTimeout\fR will atomically decrement the semaphore value\&. The locking operation will be blocked if the semaphore value is not positive (greater than zero)\&. Each unlock operation by \fISDL_SemPost\fR will atomically increment the semaphore value\&.
+.SH "RETURN VALUE"
+.PP
+Returns a pointer to an initialized semaphore or \fBNULL\fR if there was an error\&.
+.SH "EXAMPLES"
+.PP
+.PP
+.nf
+\f(CWSDL_sem *my_sem;
+
+my_sem = SDL_CreateSemaphore(INITIAL_SEM_VALUE);
+
+if (my_sem == NULL) {
+ return CREATE_SEM_FAILED;
+}\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_DestroySemaphore\fP\fR, \fI\fBSDL_SemWait\fP\fR, \fI\fBSDL_SemTryWait\fP\fR, \fI\fBSDL_SemWaitTimeout\fP\fR, \fI\fBSDL_SemPost\fP\fR, \fI\fBSDL_SemValue\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CreateThread.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CreateThread.3
new file mode 100644
index 0000000..ab9e79f
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CreateThread.3
@@ -0,0 +1,16 @@
+.TH "SDL_CreateThread" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CreateThread \- Creates a new thread of execution that shares its parent\&'s properties\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL_thread\&.h"
+.sp
+\fBSDL_Thread *\fBSDL_CreateThread\fP\fR(\fBint (*fn)(void *), void *data\fR);
+.SH "DESCRIPTION"
+.PP
+\fBSDL_CreateThread\fP creates a new thread of execution that shares all of its parent\&'s global memory, signal handlers, file descriptors, etc, and runs the function \fBfn\fR passed the void pointer \fBdata\fR The thread quits when this function returns\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_KillThread\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_CreateYUVOverlay.3 b/distrib/sdl-1.2.15/docs/man3/SDL_CreateYUVOverlay.3
new file mode 100644
index 0000000..fda6bc8
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_CreateYUVOverlay.3
@@ -0,0 +1,17 @@
+.TH "SDL_CreateYUVOverlay" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_CreateYUVOverlay \- Create a YUV video overlay
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSDL_Overlay *\fBSDL_CreateYUVOverlay\fP\fR(\fBint width, int height, Uint32 format, SDL_Surface *display\fR);
+.SH "DESCRIPTION"
+.PP
+\fBSDL_CreateYUVOverlay\fP creates a YUV overlay of the specified \fBwidth\fR, \fBheight\fR and \fBformat\fR (see \fI\fBSDL_Overlay\fR\fR for a list of available formats), for the provided \fBdisplay\fR\&. A \fI\fBSDL_Overlay\fR\fR structure is returned\&.
+.PP
+The term \&'overlay\&' is a misnomer since, unless the overlay is created in hardware, the contents for the display surface underneath the area where the overlay is shown will be overwritten when the overlay is displayed\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Overlay\fR\fR, \fI\fBSDL_DisplayYUVOverlay\fP\fR, \fI\fBSDL_FreeYUVOverlay\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_Delay.3 b/distrib/sdl-1.2.15/docs/man3/SDL_Delay.3
new file mode 100644
index 0000000..bfa80b1
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_Delay.3
@@ -0,0 +1,21 @@
+.TH "SDL_Delay" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_Delay \- Wait a specified number of milliseconds before returning\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_Delay\fP\fR(\fBUint32 ms\fR);
+.SH "DESCRIPTION"
+.PP
+Wait a specified number of milliseconds before returning\&. \fBSDL_Delay\fP will wait at \fIleast\fP the specified time, but possible longer due to OS scheduling\&.
+.PP
+.RS
+\fBNote:
+.PP
+Count on a delay granularity of \fIat least\fP 10 ms\&. Some platforms have shorter clock ticks but this is the most common\&.
+.RE
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_AddTimer\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_DestroyCond.3 b/distrib/sdl-1.2.15/docs/man3/SDL_DestroyCond.3
new file mode 100644
index 0000000..308b9d0
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_DestroyCond.3
@@ -0,0 +1,16 @@
+.TH "SDL_DestroyCond" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_DestroyCond \- Destroy a condition variable
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL_thread\&.h"
+.sp
+\fBvoid \fBSDL_DestroyCond\fP\fR(\fBSDL_cond *cond\fR);
+.SH "DESCRIPTION"
+.PP
+Destroys a condition variable\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CreateCond\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_DestroyMutex.3 b/distrib/sdl-1.2.15/docs/man3/SDL_DestroyMutex.3
new file mode 100644
index 0000000..1582e49
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_DestroyMutex.3
@@ -0,0 +1,16 @@
+.TH "SDL_DestroyMutex" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_DestroyMutex \- Destroy a mutex
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL_thread\&.h"
+.sp
+\fBvoid \fBSDL_DestroyMutex\fP\fR(\fBSDL_mutex *mutex\fR);
+.SH "DESCRIPTION"
+.PP
+Destroy a previously \fIcreated\fR mutex\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CreateMutex\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_DestroySemaphore.3 b/distrib/sdl-1.2.15/docs/man3/SDL_DestroySemaphore.3
new file mode 100644
index 0000000..892334f
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_DestroySemaphore.3
@@ -0,0 +1,26 @@
+.TH "SDL_DestroySemaphore" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_DestroySemaphore \- Destroys a semaphore that was created by \fISDL_CreateSemaphore\fR\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL_thread\&.h"
+.sp
+\fBvoid \fBSDL_DestroySemaphore\fP\fR(\fBSDL_sem *sem\fR);
+.SH "DESCRIPTION"
+.PP
+\fBSDL_DestroySemaphore\fP destroys the semaphore pointed to by \fBsem\fR that was created by \fI\fBSDL_CreateSemaphore\fP\fR\&. It is not safe to destroy a semaphore if there are threads currently blocked waiting on it\&.
+.SH "EXAMPLES"
+.PP
+.PP
+.nf
+\f(CWif (my_sem != NULL) {
+ SDL_DestroySemaphore(my_sem);
+ my_sem = NULL;
+}\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CreateSemaphore\fP\fR, \fI\fBSDL_SemWait\fP\fR, \fI\fBSDL_SemTryWait\fP\fR, \fI\fBSDL_SemWaitTimeout\fP\fR, \fI\fBSDL_SemPost\fP\fR, \fI\fBSDL_SemValue\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_DisplayFormat.3 b/distrib/sdl-1.2.15/docs/man3/SDL_DisplayFormat.3
new file mode 100644
index 0000000..ca16e2a
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_DisplayFormat.3
@@ -0,0 +1,22 @@
+.TH "SDL_DisplayFormat" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_DisplayFormat \- Convert a surface to the display format
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSDL_Surface *\fBSDL_DisplayFormat\fP\fR(\fBSDL_Surface *surface\fR);
+.SH "DESCRIPTION"
+.PP
+This function takes a surface and copies it to a new surface of the pixel format and colors of the video framebuffer, suitable for fast blitting onto the display surface\&. It calls \fISDL_ConvertSurface\fR
+.PP
+If you want to take advantage of hardware colorkey or alpha blit acceleration, you should set the colorkey and alpha value before calling this function\&.
+.PP
+If you want an alpha channel, see \fISDL_DisplayFormatAlpha\fR\&.
+.SH "RETURN VALUE"
+.PP
+If the conversion fails or runs out of memory, it returns \fBNULL\fR
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_ConvertSurface\fP\fR, \fI\fBSDL_DisplayFormatAlpha\fP\fR \fI\fBSDL_SetAlpha\fP\fR, \fI\fBSDL_SetColorKey\fP\fR, \fI\fBSDL_Surface\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_DisplayFormatAlpha.3 b/distrib/sdl-1.2.15/docs/man3/SDL_DisplayFormatAlpha.3
new file mode 100644
index 0000000..a87ddd5
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_DisplayFormatAlpha.3
@@ -0,0 +1,22 @@
+.TH "SDL_DisplayFormatAlpha" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_DisplayFormatAlpha \- Convert a surface to the display format
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSDL_Surface *\fBSDL_DisplayFormatAlpha\fP\fR(\fBSDL_Surface *surface\fR);
+.SH "DESCRIPTION"
+.PP
+This function takes a surface and copies it to a new surface of the pixel format and colors of the video framebuffer plus an alpha channel, suitable for fast blitting onto the display surface\&. It calls \fISDL_ConvertSurface\fR
+.PP
+If you want to take advantage of hardware colorkey or alpha blit acceleration, you should set the colorkey and alpha value before calling this function\&.
+.PP
+This function can be used to convert a colourkey to an alpha channel, if the \fBSDL_SRCCOLORKEY\fP flag is set on the surface\&. The generated surface will then be transparent (alpha=0) where the pixels match the colourkey, and opaque (alpha=255) elsewhere\&.
+.SH "RETURN VALUE"
+.PP
+If the conversion fails or runs out of memory, it returns \fBNULL\fR
+.SH "SEE ALSO"
+.PP
+\fISDL_ConvertSurface\fR, \fISDL_SetAlpha\fR, \fISDL_SetColorKey\fR, \fISDL_DisplayFormat\fR, \fISDL_Surface\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_DisplayYUVOverlay.3 b/distrib/sdl-1.2.15/docs/man3/SDL_DisplayYUVOverlay.3
new file mode 100644
index 0000000..d89d94c
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_DisplayYUVOverlay.3
@@ -0,0 +1,18 @@
+.TH "SDL_DisplayYUVOverlay" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_DisplayYUVOverlay \- Blit the overlay to the display
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_DisplayYUVOverlay\fP\fR(\fBSDL_Overlay *overlay, SDL_Rect *dstrect\fR);
+.SH "DESCRIPTION"
+.PP
+Blit the \fBoverlay\fR to the surface specified when it was \fIcreated\fR\&. The \fI\fBSDL_Rect\fR\fR structure, \fBdstrect\fR, specifies the position and size of the destination\&. If the \fBdstrect\fR is a larger or smaller than the overlay then the overlay will be scaled, this is optimized for 2x scaling\&.
+.SH "RETURN VALUES"
+.PP
+Returns 0 on success
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Overlay\fR\fR, \fI\fBSDL_CreateYUVOverlay\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_EnableKeyRepeat.3 b/distrib/sdl-1.2.15/docs/man3/SDL_EnableKeyRepeat.3
new file mode 100644
index 0000000..ea4b231
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_EnableKeyRepeat.3
@@ -0,0 +1,17 @@
+.TH "SDL_EnableKeyRepeat" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_EnableKeyRepeat \- Set keyboard repeat rate\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_EnableKeyRepeat\fP\fR(\fBint delay, int interval\fR);
+.SH "DESCRIPTION"
+.PP
+Enables or disables the keyboard repeat rate\&. \fBdelay\fR specifies how long the key must be pressed before it begins repeating, it then repeats at the speed specified by \fBinterval\fR\&. Both \fBdelay\fR and \fBinterval\fR are expressed in milliseconds\&.
+.PP
+Setting \fBdelay\fR to 0 disables key repeating completely\&. Good default values are \fBSDL_DEFAULT_REPEAT_DELAY\fP and \fISDL_DEFAULT_REPEAT_INTERVAL\fP\&.
+.SH "RETURN VALUE"
+.PP
+Returns \fB0\fR on success and \fB-1\fR on failure\&.
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_EnableUNICODE.3 b/distrib/sdl-1.2.15/docs/man3/SDL_EnableUNICODE.3
new file mode 100644
index 0000000..d9d2027
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_EnableUNICODE.3
@@ -0,0 +1,24 @@
+.TH "SDL_EnableUNICODE" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_EnableUNICODE \- Enable UNICODE translation
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_EnableUNICODE\fP\fR(\fBint enable\fR);
+.SH "DESCRIPTION"
+.PP
+Enables/Disables Unicode keyboard translation\&.
+.PP
+To obtain the character codes corresponding to received keyboard events, Unicode translation must first be turned on using this function\&. The translation incurs a slight overhead for each keyboard event and is therefore disabled by default\&. For each subsequently received key down event, the \fBunicode\fR member of the \fI\fBSDL_keysym\fR\fR structure will then contain the corresponding character code, or zero for keysyms that do not correspond to any character code\&.
+.PP
+A value of 1 for \fBenable\fR enables Unicode translation; 0 disables it, and -1 leaves it unchanged (useful for querying the current translation mode)\&.
+.PP
+Note that only key press events will be translated, not release events\&.
+.SH "RETURN VALUE"
+.PP
+Returns the previous translation mode (\fB0\fR or \fB1\fR)\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_keysym\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_Event.3 b/distrib/sdl-1.2.15/docs/man3/SDL_Event.3
new file mode 100644
index 0000000..b508f19
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_Event.3
@@ -0,0 +1,182 @@
+.TH "SDL_Event" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_Event \- General event structure
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef union{
+ Uint8 type;
+ SDL_ActiveEvent active;
+ SDL_KeyboardEvent key;
+ SDL_MouseMotionEvent motion;
+ SDL_MouseButtonEvent button;
+ SDL_JoyAxisEvent jaxis;
+ SDL_JoyBallEvent jball;
+ SDL_JoyHatEvent jhat;
+ SDL_JoyButtonEvent jbutton;
+ SDL_ResizeEvent resize;
+ SDL_ExposeEvent expose;
+ SDL_QuitEvent quit;
+ SDL_UserEvent user;
+ SDL_SysWMEvent syswm;
+} SDL_Event;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBtype\fR
+The type of event
+.TP 20
+\fBactive\fR
+\fIActivation event\fR
+.TP 20
+\fBkey\fR
+\fIKeyboard event\fR
+.TP 20
+\fBmotion\fR
+\fIMouse motion event\fR
+.TP 20
+\fBbutton\fR
+\fIMouse button event\fR
+.TP 20
+\fBjaxis\fR
+\fIJoystick axis motion event\fR
+.TP 20
+\fBjball\fR
+\fIJoystick trackball motion event\fR
+.TP 20
+\fBjhat\fR
+\fIJoystick hat motion event\fR
+.TP 20
+\fBjbutton\fR
+\fIJoystick button event\fR
+.TP 20
+\fBresize\fR
+\fIApplication window resize event\fR
+.TP 20
+\fBexpose\fR
+\fIApplication window expose event\fR
+.TP 20
+\fBquit\fR
+\fIApplication quit request event\fR
+.TP 20
+\fBuser\fR
+\fIUser defined event\fR
+.TP 20
+\fBsyswm\fR
+\fIUndefined window manager event\fR
+.SH "DESCRIPTION"
+.PP
+The \fBSDL_Event\fR union is the core to all event handling is SDL, its probably the most important structure after \fBSDL_Surface\fR\&. \fBSDL_Event\fR is a union of all event structures used in SDL, using it is a simple matter of knowing which union member relates to which event \fBtype\fR\&.
+.PP
+.TP 20
+\fBEvent \fBtype\fR\fR
+\fBEvent Structure\fR
+.TP 20
+\fBSDL_ACTIVEEVENT\fP
+\fI\fBSDL_ActiveEvent\fR\fR
+.TP 20
+\fBSDL_KEYDOWN/UP\fP
+\fI\fBSDL_KeyboardEvent\fR\fR
+.TP 20
+\fBSDL_MOUSEMOTION\fP
+\fI\fBSDL_MouseMotionEvent\fR\fR
+.TP 20
+\fBSDL_MOUSEBUTTONDOWN/UP\fP
+\fI\fBSDL_MouseButtonEvent\fR\fR
+.TP 20
+\fBSDL_JOYAXISMOTION\fP
+\fI\fBSDL_JoyAxisEvent\fR\fR
+.TP 20
+\fBSDL_JOYBALLMOTION\fP
+\fI\fBSDL_JoyBallEvent\fR\fR
+.TP 20
+\fBSDL_JOYHATMOTION\fP
+\fI\fBSDL_JoyHatEvent\fR\fR
+.TP 20
+\fBSDL_JOYBUTTONDOWN/UP\fP
+\fI\fBSDL_JoyButtonEvent\fR\fR
+.TP 20
+\fBSDL_QUIT\fP
+\fI\fBSDL_QuitEvent\fR\fR
+.TP 20
+\fBSDL_SYSWMEVENT\fP
+\fI\fBSDL_SysWMEvent\fR\fR
+.TP 20
+\fBSDL_VIDEORESIZE\fP
+\fI\fBSDL_ResizeEvent\fR\fR
+.TP 20
+\fBSDL_VIDEOEXPOSE\fP
+\fI\fBSDL_ExposeEvent\fR\fR
+.TP 20
+\fBSDL_USEREVENT\fP
+\fI\fBSDL_UserEvent\fR\fR
+.SH "USE"
+.PP
+The \fBSDL_Event\fR structure has two uses
+.IP " \(bu" 6
+Reading events on the event queue
+.IP " \(bu" 6
+Placing events on the event queue
+.PP
+Reading events from the event queue is done with either \fI\fBSDL_PollEvent\fP\fR or \fI\fBSDL_PeepEvents\fP\fR\&. We\&'ll use \fBSDL_PollEvent\fP and step through an example\&.
+.PP
+First off, we create an empty \fBSDL_Event\fR structure\&.
+.PP
+.nf
+\f(CWSDL_Event test_event;\fR
+.fi
+.PP
+ \fBSDL_PollEvent\fP removes the next event from the event queue, if there are no events on the queue it returns \fB0\fR otherwise it returns \fB1\fR\&. We use a \fBwhile\fP loop to process each event in turn\&.
+.PP
+.nf
+\f(CWwhile(SDL_PollEvent(&test_event)) {\fR
+.fi
+.PP
+ The \fBSDL_PollEvent\fP function take a pointer to an \fBSDL_Event\fR structure that is to be filled with event information\&. We know that if \fBSDL_PollEvent\fP removes an event from the queue then the event information will be placed in our \fBtest_event\fR structure, but we also know that the \fItype\fP of event will be placed in the \fBtype\fR member of \fBtest_event\fR\&. So to handle each event \fBtype\fR seperately we use a \fBswitch\fP statement\&.
+.PP
+.nf
+\f(CW switch(test_event\&.type) {\fR
+.fi
+.PP
+ We need to know what kind of events we\&'re looking for \fIand\fP the event \fBtype\fR\&'s of those events\&. So lets assume we want to detect where the user is moving the mouse pointer within our application\&. We look through our event types and notice that \fBSDL_MOUSEMOTION\fP is, more than likely, the event we\&'re looking for\&. A little \fImore\fR research tells use that \fBSDL_MOUSEMOTION\fP events are handled within the \fI\fBSDL_MouseMotionEvent\fR\fR structure which is the \fBmotion\fR member of \fBSDL_Event\fR\&. We can check for the \fBSDL_MOUSEMOTION\fP event \fBtype\fR within our \fBswitch\fP statement like so:
+.PP
+.nf
+\f(CW case SDL_MOUSEMOTION:\fR
+.fi
+.PP
+ All we need do now is read the information out of the \fBmotion\fR member of \fBtest_event\fR\&.
+.PP
+.nf
+\f(CW printf("We got a motion event\&.
+");
+ printf("Current mouse position is: (%d, %d)
+", test_event\&.motion\&.x, test_event\&.motion\&.y);
+ break;
+ default:
+ printf("Unhandled Event!
+");
+ break;
+ }
+}
+printf("Event queue empty\&.
+");\fR
+.fi
+.PP
+.PP
+It is also possible to push events onto the event queue and so use it as a two-way communication path\&. Both \fI\fBSDL_PushEvent\fP\fR and \fI\fBSDL_PeepEvents\fP\fR allow you to place events onto the event queue\&. This is usually used to place a \fBSDL_USEREVENT\fP on the event queue, however you could use it to post fake input events if you wished\&. Creating your own events is a simple matter of choosing the event type you want, setting the \fBtype\fR member and filling the appropriate member structure with information\&.
+.PP
+.nf
+\f(CWSDL_Event user_event;
+
+user_event\&.type=SDL_USEREVENT;
+user_event\&.user\&.code=2;
+user_event\&.user\&.data1=NULL;
+user_event\&.user\&.data2=NULL;
+SDL_PushEvent(&user_event);\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_PollEvent\fP\fR, \fI\fBSDL_PushEvent\fP\fR, \fI\fBSDL_PeepEvents\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_EventState.3 b/distrib/sdl-1.2.15/docs/man3/SDL_EventState.3
new file mode 100644
index 0000000..5ee6ab5
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_EventState.3
@@ -0,0 +1,23 @@
+.TH "SDL_EventState" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_EventState \- This function allows you to set the state of processing certain events\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBUint8 \fBSDL_EventState\fP\fR(\fBUint8 type, int state\fR);
+.SH "DESCRIPTION"
+.PP
+This function allows you to set the state of processing certain event \fBtype\fR\&'s\&.
+.PP
+If \fBstate\fR is set to \fBSDL_IGNORE\fP, that event \fBtype\fR will be automatically dropped from the event queue and will not be filtered\&.
+.PP
+If \fBstate\fR is set to \fBSDL_ENABLE\fP, that event \fBtype\fR will be processed normally\&.
+.PP
+If \fBstate\fR is set to \fBSDL_QUERY\fP, \fBSDL_EventState\fP will return the current processing state of the specified event \fBtype\fR\&.
+.PP
+A list of event \fBtype\fR\&'s can be found in the \fI\fBSDL_Event\fR\fR section\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Event\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_ExposeEvent.3 b/distrib/sdl-1.2.15/docs/man3/SDL_ExposeEvent.3
new file mode 100644
index 0000000..e1aa5c3
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_ExposeEvent.3
@@ -0,0 +1,24 @@
+.TH "SDL_ExposeEvent" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_ExposeEvent \- Quit requested event
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ Uint8 type
+} SDL_ExposeEvent;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBtype\fR
+\fBSDL_VIDEOEXPOSE\fP
+.SH "DESCRIPTION"
+.PP
+\fBSDL_ExposeEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used whan an event of type \fBSDL_VIDEOEXPOSE\fP is reported\&.
+.PP
+A VIDEOEXPOSE event is triggered when the screen has been modified outside of the application, usually by the window manager and needs to be redrawn\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Event\fR\fR, \fI\fBSDL_SetEventFilter\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_FillRect.3 b/distrib/sdl-1.2.15/docs/man3/SDL_FillRect.3
new file mode 100644
index 0000000..c2b83ab
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_FillRect.3
@@ -0,0 +1,22 @@
+.TH "SDL_FillRect" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_FillRect \- This function performs a fast fill of the given rectangle with some color
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_FillRect\fP\fR(\fBSDL_Surface *dst, SDL_Rect *dstrect, Uint32 color\fR);
+.SH "DESCRIPTION"
+.PP
+This function performs a fast fill of the given rectangle with \fBcolor\fR\&. If \fBdstrect\fR is \fBNULL\fP, the whole surface will be filled with \fBcolor\fR\&.
+.PP
+The color should be a pixel of the format used by the surface, and can be generated by the \fISDL_MapRGB\fR or \fISDL_MapRGBA\fR functions\&. If the color value contains an alpha value then the destination is simply "filled" with that alpha information, no blending takes place\&.
+.PP
+If there is a clip rectangle set on the destination (set via \fISDL_SetClipRect\fR) then this function will clip based on the intersection of the clip rectangle and the \fBdstrect\fR rectangle and the dstrect rectangle will be modified to represent the area actually filled\&.
+.SH "RETURN VALUE"
+.PP
+This function returns \fB0\fR on success, or \fB-1\fR on error\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_MapRGB\fP\fR, \fI\fBSDL_MapRGBA\fP\fR, \fI\fBSDL_BlitSurface\fP\fR, \fI\fBSDL_Rect\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_Flip.3 b/distrib/sdl-1.2.15/docs/man3/SDL_Flip.3
new file mode 100644
index 0000000..b3b2d65
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_Flip.3
@@ -0,0 +1,20 @@
+.TH "SDL_Flip" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_Flip \- Swaps screen buffers
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_Flip\fP\fR(\fBSDL_Surface *screen\fR);
+.SH "DESCRIPTION"
+.PP
+On hardware that supports double-buffering, this function sets up a flip and returns\&. The hardware will wait for vertical retrace, and then swap video buffers before the next video surface blit or lock will return\&. On hardware that doesn\&'t support double-buffering, this is equivalent to calling \fISDL_UpdateRect\fR\fB(screen, 0, 0, 0, 0)\fR
+.PP
+The \fBSDL_DOUBLEBUF\fP flag must have been passed to \fISDL_SetVideoMode\fR, when setting the video mode for this function to perform hardware flipping\&.
+.SH "RETURN VALUE"
+.PP
+This function returns \fB0\fR if successful, or \fB-1\fR if there was an error\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_UpdateRect\fP\fR, \fI\fBSDL_Surface\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_FreeCursor.3 b/distrib/sdl-1.2.15/docs/man3/SDL_FreeCursor.3
new file mode 100644
index 0000000..22277ea
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_FreeCursor.3
@@ -0,0 +1,15 @@
+.TH "SDL_FreeCursor" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_FreeCursor \- Frees a cursor created with SDL_CreateCursor\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_FreeCursor\fP\fR(\fBSDL_Cursor *cursor\fR);
+.SH "DESCRIPTION"
+.PP
+Frees a \fBSDL_Cursor\fR that was created using \fISDL_CreateCursor\fR\&.
+.SH "SEE ALSO"
+.PP
+\fISDL_CreateCursor\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_FreeSurface.3 b/distrib/sdl-1.2.15/docs/man3/SDL_FreeSurface.3
new file mode 100644
index 0000000..d849139
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_FreeSurface.3
@@ -0,0 +1,15 @@
+.TH "SDL_FreeSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_FreeSurface \- Frees (deletes) a SDL_Surface
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_FreeSurface\fP\fR(\fBSDL_Surface *surface\fR);
+.SH "DESCRIPTION"
+.PP
+Frees the resources used by a previously created \fBSDL_Surface\fR\&. If the surface was created using \fISDL_CreateRGBSurfaceFrom\fR then the pixel data is not freed\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CreateRGBSurface\fP\fR \fI\fBSDL_CreateRGBSurfaceFrom\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_FreeWAV.3 b/distrib/sdl-1.2.15/docs/man3/SDL_FreeWAV.3
new file mode 100644
index 0000000..a7cd148
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_FreeWAV.3
@@ -0,0 +1,15 @@
+.TH "SDL_FreeWAV" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_FreeWAV \- Frees previously opened WAV data
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_FreeWAV\fP\fR(\fBUint8 *audio_buf\fR);
+.SH "DESCRIPTION"
+.PP
+After a WAVE file has been opened with \fI\fBSDL_LoadWAV\fP\fR its data can eventually be freed with \fBSDL_FreeWAV\fP\&. \fBaudio_buf\fR is a pointer to the buffer created by \fBSDL_LoadWAV\fP\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_LoadWAV\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_FreeYUVOverlay.3 b/distrib/sdl-1.2.15/docs/man3/SDL_FreeYUVOverlay.3
new file mode 100644
index 0000000..3971a93
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_FreeYUVOverlay.3
@@ -0,0 +1,15 @@
+.TH "SDL_FreeYUVOverlay" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_FreeYUVOverlay \- Free a YUV video overlay
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_FreeYUVOverlay\fP\fR(\fBSDL_Overlay *overlay\fR);
+.SH "DESCRIPTION"
+.PP
+Frees and \fI\fBoverlay\fR\fR created by \fI\fBSDL_CreateYUVOverlay\fP\fR\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Overlay\fR\fR, \fI\fBSDL_DisplayYUVOverlay\fP\fR, \fI\fBSDL_FreeYUVOverlay\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GL_GetAttribute.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GL_GetAttribute.3
new file mode 100644
index 0000000..9135da2
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GL_GetAttribute.3
@@ -0,0 +1,18 @@
+.TH "SDL_GL_GetAttribute" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GL_GetAttribute \- Get the value of a special SDL/OpenGL attribute
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_GL_GetAttribute\fP\fR(\fBSDLGLattr attr, int *value\fR);
+.SH "DESCRIPTION"
+.PP
+Places the value of the SDL/OpenGL \fIattribute\fR \fBattr\fR into \fBvalue\fR\&. This is useful after a call to \fI\fBSDL_SetVideoMode\fP\fR to check whether your attributes have been \fIset\fR as you expected\&.
+.SH "RETURN VALUE"
+.PP
+Returns \fB0\fR on success, or \fB-1\fR on an error\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_GL_SetAttribute\fP\fR, \fIGL Attributes\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GL_GetProcAddress.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GL_GetProcAddress.3
new file mode 100644
index 0000000..4fcc7a4
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GL_GetProcAddress.3
@@ -0,0 +1,48 @@
+.TH "SDL_GL_GetProcAddress" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GL_GetProcAddress \- Get the address of a GL function
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid *\fBSDL_GL_GetProcAddress\fP\fR(\fBconst char* proc\fR);
+.SH "DESCRIPTION"
+.PP
+Returns the address of the GL function \fBproc\fR, or \fBNULL\fR if the function is not found\&. If the GL library is loaded at runtime, with \fI\fBSDL_GL_LoadLibrary\fP\fR, then \fIall\fP GL functions must be retrieved this way\&. Usually this is used to retrieve function pointers to OpenGL extensions\&.
+.SH "EXAMPLE"
+.PP
+.nf
+\f(CWtypedef void (*GL_ActiveTextureARB_Func)(unsigned int);
+GL_ActiveTextureARB_Func glActiveTextureARB_ptr = 0;
+int has_multitexture=1;
+\&.
+\&.
+\&.
+/* Get function pointer */
+glActiveTextureARB_ptr=(GL_ActiveTextureARB_Func) SDL_GL_GetProcAddress("glActiveTextureARB");
+
+/* Check for a valid function ptr */
+if(!glActiveTextureARB_ptr){
+ fprintf(stderr, "Multitexture Extensions not present\&.
+");
+ has_multitexture=0;
+}
+\&.
+\&.
+\&.
+\&.
+if(has_multitexture){
+ glActiveTextureARB_ptr(GL_TEXTURE0_ARB);
+ \&.
+ \&.
+}
+else{
+ \&.
+ \&.
+}\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_GL_LoadLibrary\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GL_LoadLibrary.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GL_LoadLibrary.3
new file mode 100644
index 0000000..e6544c9
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GL_LoadLibrary.3
@@ -0,0 +1,15 @@
+.TH "SDL_GL_LoadLibrary" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GL_LoadLibrary \- Specify an OpenGL library
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_GL_LoadLibrary\fP\fR(\fBconst char *path\fR);
+.SH "DESCRIPTION"
+.PP
+If you wish, you may load the OpenGL library at runtime, this must be done before \fI\fBSDL_SetVideoMode\fP\fR is called\&. The \fBpath\fR of the GL library is passed to \fBSDL_GL_LoadLibrary\fP and it returns \fB0\fR on success, or \fB-1\fR on an error\&. You must then use \fI\fBSDL_GL_GetProcAddress\fP\fR to retrieve function pointers to GL functions\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_GL_GetProcAddress\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GL_SetAttribute.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GL_SetAttribute.3
new file mode 100644
index 0000000..deb38e7
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GL_SetAttribute.3
@@ -0,0 +1,40 @@
+.TH "SDL_GL_SetAttribute" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GL_SetAttribute \- Set a special SDL/OpenGL attribute
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_GL_SetAttribute\fP\fR(\fBSDL_GLattr attr, int value\fR);
+.SH "DESCRIPTION"
+.PP
+Sets the OpenGL \fIattribute\fR \fBattr\fR to \fBvalue\fR\&. The attributes you set don\&'t take effect until after a call to \fI\fBSDL_SetVideoMode\fP\fR\&. You should use \fI\fBSDL_GL_GetAttribute\fP\fR to check the values after a \fBSDL_SetVideoMode\fP call\&.
+.SH "RETURN VALUE"
+.PP
+Returns \fB0\fR on success, or \fB-1\fR on error\&.
+.SH "EXAMPLE"
+.PP
+.nf
+\f(CWSDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
+SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
+SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
+SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
+SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
+if ( (screen=SDL_SetVideoMode( 640, 480, 16, SDL_OPENGL )) == NULL ) {
+ fprintf(stderr, "Couldn\&'t set GL mode: %s
+", SDL_GetError());
+ SDL_Quit();
+ return;
+}\fR
+.fi
+.PP
+.PP
+.RS
+\fBNote:
+.PP
+The \fBSDL_DOUBLEBUF\fP flag is not required to enable double buffering when setting an OpenGL video mode\&. Double buffering is enabled or disabled using the SDL_GL_DOUBLEBUFFER attribute\&.
+.RE
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_GL_GetAttribute\fP\fR, \fIGL Attributes\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GL_SwapBuffers.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GL_SwapBuffers.3
new file mode 100644
index 0000000..31d31cf
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GL_SwapBuffers.3
@@ -0,0 +1,15 @@
+.TH "SDL_GL_SwapBuffers" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GL_SwapBuffers \- Swap OpenGL framebuffers/Update Display
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_GL_SwapBuffers\fP\fR(\fBvoid \fR);
+.SH "DESCRIPTION"
+.PP
+Swap the OpenGL buffers, if double-buffering is supported\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_GL_SetAttribute\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GLattr.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GLattr.3
new file mode 100644
index 0000000..23d3726
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GLattr.3
@@ -0,0 +1,47 @@
+.TH "SDL_GLattr" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GLattr \- SDL GL Attributes
+.SH "ATTRIBUTES"
+.TP 20
+\fBSDL_GL_RED_SIZE\fP
+Size of the framebuffer red component, in bits
+.TP 20
+\fBSDL_GL_GREEN_SIZE\fP
+Size of the framebuffer green component, in bits
+.TP 20
+\fBSDL_GL_BLUE_SIZE\fP
+Size of the framebuffer blue component, in bits
+.TP 20
+\fBSDL_GL_ALPHA_SIZE\fP
+Size of the framebuffer alpha component, in bits
+.TP 20
+\fBSDL_GL_DOUBLEBUFFER\fP
+0 or 1, enable or disable double buffering
+.TP 20
+\fBSDL_GL_BUFFER_SIZE\fP
+Size of the framebuffer, in bits
+.TP 20
+\fBSDL_GL_DEPTH_SIZE\fP
+Size of the depth buffer, in bits
+.TP 20
+\fBSDL_GL_STENCIL_SIZE\fP
+Size of the stencil buffer, in bits
+.TP 20
+\fBSDL_GL_ACCUM_RED_SIZE\fP
+Size of the accumulation buffer red component, in bits
+.TP 20
+\fBSDL_GL_ACCUM_GREEN_SIZE\fP
+Size of the accumulation buffer green component, in bits
+.TP 20
+\fBSDL_GL_ACCUM_BLUE_SIZE\fP
+Size of the accumulation buffer blue component, in bits
+.TP 20
+\fBSDL_GL_ACCUM_ALPHA_SIZE\fP
+Size of the accumulation buffer alpha component, in bits
+.SH "DESCRIPTION"
+.PP
+While you can set most OpenGL attributes normally, the attributes list above must be known \fIbefore\fP SDL sets the video mode\&. These attributes a set and read with \fI\fBSDL_GL_SetAttribute\fP\fR and \fI\fBSDL_GL_GetAttribute\fP\fR\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_GL_SetAttribute\fP\fR, \fI\fBSDL_GL_GetAttribute\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GetAppState.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GetAppState.3
new file mode 100644
index 0000000..9d644a1
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GetAppState.3
@@ -0,0 +1,24 @@
+.TH "SDL_GetAppState" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+\fBSDL_GetAppState\fP \- Get the state of the application
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBUint8 \fBSDL_GetAppState\fP\fR(\fBvoid\fR);
+.SH "DESCRIPTION"
+.PP
+This function returns the current state of the application\&. The value returned is a bitwise combination of:
+.TP 20
+\fBSDL_APPMOUSEFOCUS\fP
+The application has mouse focus\&.
+.TP 20
+\fBSDL_APPINPUTFOCUS\fP
+The application has keyboard focus
+.TP 20
+\fBSDL_APPACTIVE\fP
+The application is visible
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_ActiveEvent\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GetAudioStatus.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GetAudioStatus.3
new file mode 100644
index 0000000..9895c95
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GetAudioStatus.3
@@ -0,0 +1,24 @@
+.TH "SDL_GetAudioStatus" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GetAudioStatus \- Get the current audio state
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSDL_audiostatus\fBSDL_GetAudioStatus\fP\fR(\fBvoid\fR);
+.SH "DESCRIPTION"
+.PP
+.nf
+\f(CWtypedef enum{
+ SDL_AUDIO_STOPPED,
+ SDL_AUDIO_PAUSED,
+ SDL_AUDIO_PLAYING
+} SDL_audiostatus;\fR
+.fi
+.PP
+.PP
+Returns either \fBSDL_AUDIO_STOPPED\fP, \fBSDL_AUDIO_PAUSED\fP or \fBSDL_AUDIO_PLAYING\fP depending on the current audio state\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_PauseAudio\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GetClipRect.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GetClipRect.3
new file mode 100644
index 0000000..b911ff6
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GetClipRect.3
@@ -0,0 +1,17 @@
+.TH "SDL_GetClipRect" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GetClipRect \- Gets the clipping rectangle for a surface\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_GetClipRect\fP\fR(\fBSDL_Surface *surface, SDL_Rect *rect\fR);
+.SH "DESCRIPTION"
+.PP
+Gets the clipping rectangle for a surface\&. When this surface is the destination of a blit, only the area within the clip rectangle is drawn into\&.
+.PP
+The rectangle pointed to by \fBrect\fR will be filled with the clipping rectangle of the surface\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_SetClipRect\fP\fR, \fI\fBSDL_BlitSurface\fP\fR, \fI\fBSDL_Surface\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GetCursor.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GetCursor.3
new file mode 100644
index 0000000..ce5ba72
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GetCursor.3
@@ -0,0 +1,15 @@
+.TH "SDL_GetCursor" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GetCursor \- Get the currently active mouse cursor\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSDL_Cursor *\fBSDL_GetCursor\fP\fR(\fBvoid\fR);
+.SH "DESCRIPTION"
+.PP
+Returns the currently active mouse cursor\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_SetCursor\fP\fR, \fI\fBSDL_CreateCursor\fP\fR, \fI\fBSDL_ShowCursor\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GetError.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GetError.3
new file mode 100644
index 0000000..ecdb98c
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GetError.3
@@ -0,0 +1,15 @@
+.TH "SDL_GetError" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GetError \- Get SDL error string
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL/SDL\&.h"
+.sp
+\fBchar *\fBSDL_GetError\fP\fR(\fBvoid\fR);
+.SH "DESCRIPTION"
+.PP
+\fBSDL_GetError\fP returns a NULL terminated string containing information about the last internal SDL error\&.
+.SH "RETURN VALUE"
+.PP
+\fBSDL_GetError\fP returns a string containing the last error\&.
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GetEventFilter.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GetEventFilter.3
new file mode 100644
index 0000000..41bf337
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GetEventFilter.3
@@ -0,0 +1,23 @@
+.TH "SDL_GetEventFilter" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GetEventFilter \- Retrieves a pointer to he event filter
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSDL_EventFilter \fBSDL_GetEventFilter\fP\fR(\fBvoid\fR);
+.SH "DESCRIPTION"
+.PP
+This function retrieces a pointer to the event filter that was previously set using \fI\fBSDL_SetEventFilter\fP\fR\&. An SDL_EventFilter function is defined as:
+.PP
+.nf
+\f(CWtypedef int (*SDL_EventFilter)(const SDL_Event *event);\fR
+.fi
+.PP
+.SH "RETURN VALUE"
+.PP
+Returns a pointer to the event filter or \fBNULL\fP if no filter has been set\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Event\fR\fR, \fI\fBSDL_SetEventFilter\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GetGamma.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GetGamma.3
new file mode 100644
index 0000000..f3493aa
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GetGamma.3
@@ -0,0 +1,21 @@
+.TH "SDL_GetGamma" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GetGamma \- Gets the gamma of the display
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_GetGamma\fP\fR(\fBfloat *red, float *green, float *blue\fR);
+.SH "DESCRIPTION"
+.PP
+Gets the color gamma of the display\&. The gamma value for each color component will be place in the parameters \fBred\fR, \fBgreen\fR and \fBblue\fR\&. The values can range from 0\&.1 to 10\&.
+.PP
+.RS
+\fBNote:
+.PP
+This function currently only works on XFreee 4\&.0 and up\&.
+.RE
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_SetGamma\fP\fR, \fI\fBSDL_SetVideoMode\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GetGammaRamp.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GetGammaRamp.3
new file mode 100644
index 0000000..c1116d5
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GetGammaRamp.3
@@ -0,0 +1,20 @@
+.TH "SDL_GetGammaRamp" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GetGammaRamp \- Gets the color gamma lookup tables for the display
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_GetGammaRamp\fP\fR(\fBUint16 *redtable, Uint16 *greentable, Uint16 *bluetable\fR);
+.SH "DESCRIPTION"
+.PP
+Gets the gamma translation lookup tables currently used by the display\&. Each table is an array of 256 Uint16 values\&.
+.PP
+Not all display hardware is able to change gamma\&.
+.SH "RETURN VALUE"
+.PP
+Returns -1 on error\&.
+.SH "SEE ALSO"
+.PP
+\fISDL_SetGamma\fR \fISDL_SetGammaRamp\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GetKeyName.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GetKeyName.3
new file mode 100644
index 0000000..fc76ca8
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GetKeyName.3
@@ -0,0 +1,15 @@
+.TH "SDL_GetKeyName" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GetKeyName \- Get the name of an SDL virtual keysym
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBchar *\fBSDL_GetKeyName\fP\fR(\fBSDLKey key\fR);
+.SH "DESCRIPTION"
+.PP
+Returns the SDL-defined name of the \fI\fBSDLKey\fR\fR \fBkey\fR\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDLKey\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GetKeyState.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GetKeyState.3
new file mode 100644
index 0000000..f679c81
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GetKeyState.3
@@ -0,0 +1,30 @@
+.TH "SDL_GetKeyState" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GetKeyState \- Get a snapshot of the current keyboard state
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBUint8 *\fBSDL_GetKeyState\fP\fR(\fBint *numkeys\fR);
+.SH "DESCRIPTION"
+.PP
+Gets a snapshot of the current keyboard state\&. The current state is return as a pointer to an array, the size of this array is stored in \fBnumkeys\fR\&. The array is indexed by the \fI\fBSDLK_*\fP\fR symbols\&. A value of 1 means the key is pressed and a value of 0 means its not\&. The pointer returned is a pointer to an internal SDL array and should not be freed by the caller\&.
+.PP
+.RS
+\fBNote:
+.PP
+Use \fI\fBSDL_PumpEvents\fP\fR to update the state array\&.
+.RE
+.SH "EXAMPLE"
+.PP
+.PP
+.nf
+\f(CWUint8 *keystate = SDL_GetKeyState(NULL);
+if ( keystate[SDLK_RETURN] ) printf("Return Key Pressed\&.
+");\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL Key Symbols\fP\fR, \fI\fBSDL_PumpEvents\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GetModState.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GetModState.3
new file mode 100644
index 0000000..5cff3d5
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GetModState.3
@@ -0,0 +1,54 @@
+.TH "SDL_GetModState" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GetModState \- Get the state of modifier keys\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSDLMod \fBSDL_GetModState\fP\fR(\fBvoid\fR);
+.SH "DESCRIPTION"
+.PP
+Returns the current state of the modifier keys (CTRL, ALT, etc\&.)\&.
+.SH "RETURN VALUE"
+.PP
+The return value can be an OR\&'d combination of the SDLMod enum\&.
+.PP
+.PP
+.RS
+\fBSDLMod\fR
+.PP
+.PP
+.nf
+\f(CWtypedef enum {
+ KMOD_NONE = 0x0000,
+ KMOD_LSHIFT= 0x0001,
+ KMOD_RSHIFT= 0x0002,
+ KMOD_LCTRL = 0x0040,
+ KMOD_RCTRL = 0x0080,
+ KMOD_LALT = 0x0100,
+ KMOD_RALT = 0x0200,
+ KMOD_LMETA = 0x0400,
+ KMOD_RMETA = 0x0800,
+ KMOD_NUM = 0x1000,
+ KMOD_CAPS = 0x2000,
+ KMOD_MODE = 0x4000,
+} SDLMod;\fR
+.fi
+.PP
+.RE
+ SDL also defines the following symbols for convenience:
+.PP
+.RS
+.PP
+.nf
+\f(CW#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
+#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
+#define KMOD_ALT (KMOD_LALT|KMOD_RALT)
+#define KMOD_META (KMOD_LMETA|KMOD_RMETA)\fR
+.fi
+.PP
+.RE
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_GetKeyState\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GetMouseState.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GetMouseState.3
new file mode 100644
index 0000000..e92aa43
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GetMouseState.3
@@ -0,0 +1,24 @@
+.TH "SDL_GetMouseState" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GetMouseState \- Retrieve the current state of the mouse
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBUint8 \fBSDL_GetMouseState\fP\fR(\fBint *x, int *y\fR);
+.SH "DESCRIPTION"
+.PP
+The current button state is returned as a button bitmask, which can be tested using the \fBSDL_BUTTON(X)\fP macros, and \fBx\fR and \fBy\fR are set to the current mouse cursor position\&. You can pass \fBNULL\fP for either \fBx\fR or \fBy\fR\&.
+.SH "EXAMPLE"
+.PP
+.nf
+\f(CWSDL_PumpEvents();
+if(SDL_GetMouseState(NULL, NULL)&SDL_BUTTON(1))
+ printf("Mouse Button 1(left) is pressed\&.
+");\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_GetRelativeMouseState\fP\fR, \fI\fBSDL_PumpEvents\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GetRGB.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GetRGB.3
new file mode 100644
index 0000000..f21a162
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GetRGB.3
@@ -0,0 +1,17 @@
+.TH "SDL_GetRGB" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GetRGB \- Get RGB values from a pixel in the specified pixel format\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_GetRGB\fP\fR(\fBUint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b\fR);
+.SH "DESCRIPTION"
+.PP
+Get RGB component values from a pixel stored in the specified pixel format\&.
+.PP
+This function uses the entire 8-bit [0\&.\&.255] range when converting color components from pixel formats with less than 8-bits per RGB component (e\&.g\&., a completely white pixel in 16-bit RGB565 format would return [0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8])\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_GetRGBA\fP\fR, \fI\fBSDL_MapRGB\fP\fR, \fI\fBSDL_MapRGBA\fP\fR, \fI\fBSDL_PixelFormat\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GetRGBA.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GetRGBA.3
new file mode 100644
index 0000000..eba9dfb
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GetRGBA.3
@@ -0,0 +1,19 @@
+.TH "SDL_GetRGBA" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GetRGBA \- Get RGBA values from a pixel in the specified pixel format\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_GetRGBA\fP\fR(\fBUint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a\fR);
+.SH "DESCRIPTION"
+.PP
+Get RGBA component values from a pixel stored in the specified pixel format\&.
+.PP
+This function uses the entire 8-bit [0\&.\&.255] range when converting color components from pixel formats with less than 8-bits per RGB component (e\&.g\&., a completely white pixel in 16-bit RGB565 format would return [0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8])\&.
+.PP
+If the surface has no alpha component, the alpha will be returned as 0xff (100% opaque)\&.
+.SH "SEE ALSO"
+.PP
+\fISDL_GetRGB\fR, \fISDL_MapRGB\fR, \fISDL_MapRGBA\fR, \fISDL_PixelFormat\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GetRelativeMouseState.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GetRelativeMouseState.3
new file mode 100644
index 0000000..349f47d
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GetRelativeMouseState.3
@@ -0,0 +1,15 @@
+.TH "SDL_GetRelativeMouseState" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GetRelativeMouseState \- Retrieve the current state of the mouse
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBUint8 \fBSDL_GetRelativeMouseState\fP\fR(\fBint *x, int *y\fR);
+.SH "DESCRIPTION"
+.PP
+The current button state is returned as a button bitmask, which can be tested using the \fBSDL_BUTTON(X)\fP macros, and \fBx\fR and \fBy\fR are set to the change in the mouse position since the last call to \fBSDL_GetRelativeMouseState\fP or since event initialization\&. You can pass \fBNULL\fP for either \fBx\fR or \fBy\fR\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_GetMouseState\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GetThreadID.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GetThreadID.3
new file mode 100644
index 0000000..6385aeb
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GetThreadID.3
@@ -0,0 +1,16 @@
+.TH "SDL_GetThreadID" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GetThreadID \- Get the SDL thread ID of a SDL_Thread
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL_thread\&.h"
+.sp
+\fBUint32 \fBSDL_GetThreadID\fP\fR(\fBSDL_Thread *thread\fR);
+.SH "DESCRIPTION"
+.PP
+Returns the ID of a \fBSDL_Thread\fR created by \fISDL_CreateThread\fR\&.
+.SH "SEE ALSO"
+.PP
+\fISDL_CreateThread\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GetTicks.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GetTicks.3
new file mode 100644
index 0000000..4615737
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GetTicks.3
@@ -0,0 +1,15 @@
+.TH "SDL_GetTicks" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GetTicks \- Get the number of milliseconds since the SDL library initialization\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBUint32 \fBSDL_GetTicks\fP\fR(\fBvoid\fR)
+.SH "DESCRIPTION"
+.PP
+Get the number of milliseconds since the SDL library initialization\&. Note that this value wraps if the program runs for more than ~49 days\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Delay\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GetVideoInfo.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GetVideoInfo.3
new file mode 100644
index 0000000..b82b28e
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GetVideoInfo.3
@@ -0,0 +1,15 @@
+.TH "SDL_GetVideoInfo" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GetVideoInfo \- returns a pointer to information about the video hardware
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSDL_VideoInfo *\fBSDL_GetVideoInfo\fP\fR(\fBvoid\fR);
+.SH "DESCRIPTION"
+.PP
+This function returns a read-only pointer to \fIinformation\fR about the video hardware\&. If this is called before \fISDL_SetVideoMode\fR, the \fBvfmt\fR member of the returned structure will contain the pixel format of the "best" video mode\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_VideoInfo\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_GetVideoSurface.3 b/distrib/sdl-1.2.15/docs/man3/SDL_GetVideoSurface.3
new file mode 100644
index 0000000..4a5d7eb
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_GetVideoSurface.3
@@ -0,0 +1,15 @@
+.TH "SDL_GetVideoSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_GetVideoSurface \- returns a pointer to the current display surface
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSDL_Surface *\fBSDL_GetVideoSurface\fP\fR(\fBvoid\fR);
+.SH "DESCRIPTION"
+.PP
+This function returns a pointer to the current display surface\&. If SDL is doing format conversion on the display surface, this function returns the publicly visible surface, not the real video surface\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Surface\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_Init.3 b/distrib/sdl-1.2.15/docs/man3/SDL_Init.3
new file mode 100644
index 0000000..5f50054
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_Init.3
@@ -0,0 +1,41 @@
+.TH "SDL_Init" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_Init \- Initializes SDL
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_Init\fP\fR(\fBUint32 flags\fR);
+.SH "DESCRIPTION"
+.PP
+Initializes SDL\&. This should be called before all other SDL functions\&. The \fBflags\fR parameter specifies what part(s) of SDL to initialize\&.
+.TP 20
+\fBSDL_INIT_TIMER\fP
+Initializes the \fItimer\fR subsystem\&.
+.TP 20
+\fBSDL_INIT_AUDIO\fP
+Initializes the \fIaudio\fR subsystem\&.
+.TP 20
+\fBSDL_INIT_VIDEO\fP
+Initializes the \fIvideo\fR subsystem\&.
+.TP 20
+\fBSDL_INIT_CDROM\fP
+Initializes the \fIcdrom\fR subsystem\&.
+.TP 20
+\fBSDL_INIT_JOYSTICK\fP
+Initializes the \fIjoystick\fR subsystem\&.
+.TP 20
+\fBSDL_INIT_EVERYTHING\fP
+Initialize all of the above\&.
+.TP 20
+\fBSDL_INIT_NOPARACHUTE\fP
+Prevents SDL from catching fatal signals\&.
+.TP 20
+\fBSDL_INIT_EVENTTHREAD\fP
+.SH "RETURN VALUE"
+.PP
+Returns \fB-1\fR on an error or \fB0\fR on success\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Quit\fP\fR, \fI\fBSDL_InitSubSystem\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_InitSubSystem.3 b/distrib/sdl-1.2.15/docs/man3/SDL_InitSubSystem.3
new file mode 100644
index 0000000..f0a82a5
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_InitSubSystem.3
@@ -0,0 +1,41 @@
+.TH "SDL_InitSubSystem" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_InitSubSystem \- Initialize subsystems
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_InitSubSystem\fP\fR(\fBUint32 flags\fR);
+.SH "DESCRIPTION"
+.PP
+After SDL has been initialized with \fI\fBSDL_Init\fP\fR you may initialize uninitialized subsystems with \fBSDL_InitSubSystem\fP\&. The \fBflags\fR parameter is the same as that used in \fI\fBSDL_Init\fP\fR\&.
+.SH "EXAMPLES"
+.PP
+.nf
+\f(CW/* Seperating Joystick and Video initialization\&. */
+SDL_Init(SDL_INIT_VIDEO);
+\&.
+\&.
+SDL_SetVideoMode(640, 480, 16, SDL_DOUBLEBUF|SDL_FULLSCREEN);
+\&.
+/* Do Some Video stuff */
+\&.
+\&.
+/* Initialize the joystick subsystem */
+SDL_InitSubSystem(SDL_INIT_JOYSTICK);
+
+/* Do some stuff with video and joystick */
+\&.
+\&.
+\&.
+/* Shut them both down */
+SDL_Quit();\fR
+.fi
+.PP
+.SH "RETURN VALUE"
+.PP
+Returns \fB-1\fR on an error or \fB0\fR on success\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Init\fP\fR, \fI\fBSDL_Quit\fP\fR, \fI\fBSDL_QuitSubSystem\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_JoyAxisEvent.3 b/distrib/sdl-1.2.15/docs/man3/SDL_JoyAxisEvent.3
new file mode 100644
index 0000000..f8301fd
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_JoyAxisEvent.3
@@ -0,0 +1,36 @@
+.TH "SDL_JoyAxisEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_JoyAxisEvent \- Joystick axis motion event structure
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ Uint8 type;
+ Uint8 which;
+ Uint8 axis;
+ Sint16 value;
+} SDL_JoyAxisEvent;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBtype\fR
+\fBSDL_JOYAXISMOTION\fP
+.TP 20
+\fBwhich\fR
+Joystick device index
+.TP 20
+\fBaxis\fR
+Joystick axis index
+.TP 20
+\fBvalue\fR
+Axis value (range: -32768 to 32767)
+.SH "DESCRIPTION"
+.PP
+\fBSDL_JoyAxisEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_JOYAXISMOTION\fP is reported\&.
+.PP
+A \fBSDL_JOYAXISMOTION\fP event occurs when ever a user moves an axis on the joystick\&. The field \fBwhich\fR is the index of the joystick that reported the event and \fBaxis\fR is the index of the axis (for a more detailed explaination see the \fIJoystick section\fR)\&. \fBvalue\fR is the current position of the axis\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Event\fR\fR, \fIJoystick Functions\fR, \fI\fBSDL_JoystickEventState\fP\fR, \fI\fBSDL_JoystickGetAxis\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_JoyBallEvent.3 b/distrib/sdl-1.2.15/docs/man3/SDL_JoyBallEvent.3
new file mode 100644
index 0000000..7f42f7b
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_JoyBallEvent.3
@@ -0,0 +1,36 @@
+.TH "SDL_JoyBallEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_JoyBallEvent \- Joystick trackball motion event structure
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ Uint8 type;
+ Uint8 which;
+ Uint8 ball;
+ Sint16 xrel, yrel;
+} SDL_JoyBallEvent;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBtype\fR
+\fBSDL_JOYBALLMOTION\fP
+.TP 20
+\fBwhich\fR
+Joystick device index
+.TP 20
+\fBball\fR
+Joystick trackball index
+.TP 20
+\fBxrel\fR, \fByrel\fR
+The relative motion in the X/Y direction
+.SH "DESCRIPTION"
+.PP
+\fBSDL_JoyBallEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_JOYBALLMOTION\fP is reported\&.
+.PP
+A \fBSDL_JOYBALLMOTION\fP event occurs when a user moves a trackball on the joystick\&. The field \fBwhich\fR is the index of the joystick that reported the event and \fBball\fR is the index of the trackball (for a more detailed explaination see the \fIJoystick section\fR)\&. Trackballs only return relative motion, this is the change in position on the ball since it was last polled (last cycle of the event loop) and it is stored in \fBxrel\fR and \fByrel\fR\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Event\fR\fR, \fIJoystick Functions\fR, \fI\fBSDL_JoystickEventState\fP\fR, \fI\fBSDL_JoystickGetBall\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_JoyButtonEvent.3 b/distrib/sdl-1.2.15/docs/man3/SDL_JoyButtonEvent.3
new file mode 100644
index 0000000..dfd0793
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_JoyButtonEvent.3
@@ -0,0 +1,36 @@
+.TH "SDL_JoyButtonEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_JoyButtonEvent \- Joystick button event structure
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ Uint8 type;
+ Uint8 which;
+ Uint8 button;
+ Uint8 state;
+} SDL_JoyButtonEvent;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBtype\fR
+\fBSDL_JOYBUTTONDOWN\fP or \fBSDL_JOYBUTTONUP\fP
+.TP 20
+\fBwhich\fR
+Joystick device index
+.TP 20
+\fBbutton\fR
+Joystick button index
+.TP 20
+\fBstate\fR
+\fBSDL_PRESSED\fP or \fBSDL_RELEASED\fP
+.SH "DESCRIPTION"
+.PP
+\fBSDL_JoyButtonEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_JOYBUTTONDOWN\fP or \fBSDL_JOYBUTTONUP\fP is reported\&.
+.PP
+A \fBSDL_JOYBUTTONDOWN\fP or \fBSDL_JOYBUTTONUP\fP event occurs when ever a user presses or releases a button on a joystick\&. The field \fBwhich\fR is the index of the joystick that reported the event and \fBbutton\fR is the index of the button (for a more detailed explaination see the \fIJoystick section\fR)\&. \fBstate\fR is the current state or the button which is either \fBSDL_PRESSED\fP or \fBSDL_RELEASED\fP\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Event\fR\fR, \fIJoystick Functions\fR, \fI\fBSDL_JoystickEventState\fP\fR, \fI\fBSDL_JoystickGetButton\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_JoyHatEvent.3 b/distrib/sdl-1.2.15/docs/man3/SDL_JoyHatEvent.3
new file mode 100644
index 0000000..5817ad6
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_JoyHatEvent.3
@@ -0,0 +1,56 @@
+.TH "SDL_JoyHatEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_JoyHatEvent \- Joystick hat position change event structure
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ Uint8 type;
+ Uint8 which;
+ Uint8 hat;
+ Uint8 value;
+} SDL_JoyHatEvent;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBtype\fR
+\fBSDL_JOY\fP
+.TP 20
+\fBwhich\fR
+Joystick device index
+.TP 20
+\fBhat\fR
+Joystick hat index
+.TP 20
+\fBvalue\fR
+Hat position
+.SH "DESCRIPTION"
+.PP
+\fBSDL_JoyHatEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_JOYHATMOTION\fP is reported\&.
+.PP
+A \fBSDL_JOYHATMOTION\fP event occurs when ever a user moves a hat on the joystick\&. The field \fBwhich\fR is the index of the joystick that reported the event and \fBhat\fR is the index of the hat (for a more detailed exlaination see the \fIJoystick section\fR)\&. \fBvalue\fR is the current position of the hat\&. It is a logically OR\&'d combination of the following values (whose meanings should be pretty obvious:) :
+.IP "" 10
+\fBSDL_HAT_CENTERED\fP
+.IP "" 10
+\fBSDL_HAT_UP\fP
+.IP "" 10
+\fBSDL_HAT_RIGHT\fP
+.IP "" 10
+\fBSDL_HAT_DOWN\fP
+.IP "" 10
+\fBSDL_HAT_LEFT\fP
+.PP
+The following defines are also provided:
+.IP "" 10
+\fBSDL_HAT_RIGHTUP\fP
+.IP "" 10
+\fBSDL_HAT_RIGHTDOWN\fP
+.IP "" 10
+\fBSDL_HAT_LEFTUP\fP
+.IP "" 10
+\fBSDL_HAT_LEFTDOWN\fP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Event\fR\fR, \fIJoystick Functions\fR, \fI\fBSDL_JoystickEventState\fP\fR, \fI\fBSDL_JoystickGetHat\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_JoystickClose.3 b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickClose.3
new file mode 100644
index 0000000..281702f
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickClose.3
@@ -0,0 +1,15 @@
+.TH "SDL_JoystickClose" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_JoystickClose \- Closes a previously opened joystick
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_JoystickClose\fP\fR(\fBSDL_Joystick *joystick\fR);
+.SH "DESCRIPTION"
+.PP
+Close a \fBjoystick\fR that was previously opened with \fI\fBSDL_JoystickOpen\fP\fR\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_JoystickOpen\fP\fR, \fI\fBSDL_JoystickOpened\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_JoystickEventState.3 b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickEventState.3
new file mode 100644
index 0000000..7e410f3
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickEventState.3
@@ -0,0 +1,24 @@
+.TH "SDL_JoystickEventState" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_JoystickEventState \- Enable/disable joystick event polling
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_JoystickEventState\fP\fR(\fBint state\fR);
+.SH "DESCRIPTION"
+.PP
+This function is used to enable or disable joystick event processing\&. With joystick event processing disabled you will have to update joystick states with \fI\fBSDL_JoystickUpdate\fP\fR and read the joystick information manually\&. \fBstate\fR is either \fBSDL_QUERY\fP, \fBSDL_ENABLE\fP or \fBSDL_IGNORE\fP\&.
+.PP
+.RS
+\fBNote:
+.PP
+Joystick event handling is prefered
+.RE
+.SH "RETURN VALUE"
+.PP
+If \fBstate\fR is \fBSDL_QUERY\fP then the current state is returned, otherwise the new processing \fBstate\fR is returned\&.
+.SH "SEE ALSO"
+.PP
+\fISDL Joystick Functions\fR, \fI\fBSDL_JoystickUpdate\fP\fR, \fI\fBSDL_JoyAxisEvent\fR\fR, \fI\fBSDL_JoyBallEvent\fR\fR, \fI\fBSDL_JoyButtonEvent\fR\fR, \fI\fBSDL_JoyHatEvent\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_JoystickGetAxis.3 b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickGetAxis.3
new file mode 100644
index 0000000..0a80b34
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickGetAxis.3
@@ -0,0 +1,32 @@
+.TH "SDL_JoystickGetAxis" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_JoystickGetAxis \- Get the current state of an axis
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSint16 \fBSDL_JoystickGetAxis\fP\fR(\fBSDL_Joystick *joystick, int axis\fR);
+.SH "DESCRIPTION"
+.PP
+\fBSDL_JoystickGetAxis\fP returns the current state of the given \fBaxis\fR on the given \fBjoystick\fR\&.
+.PP
+On most modern joysticks the X axis is usually represented by \fBaxis\fR 0 and the Y axis by \fBaxis\fR 1\&. The value returned by \fBSDL_JoystickGetAxis\fP is a signed integer (-32768 to 32768) representing the current position of the \fBaxis\fR, it maybe necessary to impose certain tolerances on these values to account for jitter\&. It is worth noting that some joysticks use axes 2 and 3 for extra buttons\&.
+.SH "RETURN VALUE"
+.PP
+Returns a 16-bit signed integer representing the current position of the \fBaxis\fR\&.
+.SH "EXAMPLES"
+.PP
+.PP
+.nf
+\f(CWSint16 x_move, y_move;
+SDL_Joystick *joy1;
+\&.
+\&.
+x_move=SDL_JoystickGetAxis(joy1, 0);
+y_move=SDL_JoystickGetAxis(joy1, 1);\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_JoystickNumAxes\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_JoystickGetBall.3 b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickGetBall.3
new file mode 100644
index 0000000..124c910
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickGetBall.3
@@ -0,0 +1,37 @@
+.TH "SDL_JoystickGetBall" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_JoystickGetBall \- Get relative trackball motion
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_JoystickGetBall\fP\fR(\fBSDL_Joystick *joystick, int ball, int *dx, int *dy\fR);
+.SH "DESCRIPTION"
+.PP
+Get the \fBball\fR axis change\&.
+.PP
+Trackballs can only return relative motion since the last call to \fBSDL_JoystickGetBall\fP, these motion deltas a placed into \fBdx\fR and \fBdy\fR\&.
+.SH "RETURN VALUE"
+.PP
+Returns \fB0\fR on success or \fB-1\fR on failure
+.SH "EXAMPLES"
+.PP
+.PP
+.nf
+\f(CWint delta_x, delta_y;
+SDL_Joystick *joy;
+\&.
+\&.
+\&.
+SDL_JoystickUpdate();
+if(SDL_JoystickGetBall(joy, 0, &delta_x, &delta_y)==-1)
+ printf("TrackBall Read Error!
+");
+printf("Trackball Delta- X:%d, Y:%d
+", delta_x, delta_y);\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_JoystickNumBalls\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_JoystickGetButton.3 b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickGetButton.3
new file mode 100644
index 0000000..e7b336b
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickGetButton.3
@@ -0,0 +1,18 @@
+.TH "SDL_JoystickGetButton" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_JoystickGetButton \- Get the current state of a given button on a given joystick
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBUint8 \fBSDL_JoystickGetButton\fP\fR(\fBSDL_Joystick *joystick, int button\fR);
+.SH "DESCRIPTION"
+.PP
+SDL_JoystickGetButton returns the current state of the given \fBbutton\fR on the given \fBjoystick\fR\&.
+.SH "RETURN VALUE"
+.PP
+\fB1\fR if the button is pressed\&. Otherwise, \fB0\fR\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_JoystickNumButtons\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_JoystickGetHat.3 b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickGetHat.3
new file mode 100644
index 0000000..cdbd910
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickGetHat.3
@@ -0,0 +1,36 @@
+.TH "SDL_JoystickGetHat" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_JoystickGetHat \- Get the current state of a joystick hat
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBUint8 \fBSDL_JoystickGetHat\fP\fR(\fBSDL_Joystick *joystick, int hat\fR);
+.SH "DESCRIPTION"
+.PP
+SDL_JoystickGetHat returns the current state of the given \fBhat\fR on the given \fBjoystick\fR\&.
+.SH "RETURN VALUE"
+.PP
+The current state is returned as a Uint8 which is defined as an OR\&'d combination of one or more of the following
+.IP "" 10
+\fBSDL_HAT_CENTERED\fP
+.IP "" 10
+\fBSDL_HAT_UP\fP
+.IP "" 10
+\fBSDL_HAT_RIGHT\fP
+.IP "" 10
+\fBSDL_HAT_DOWN\fP
+.IP "" 10
+\fBSDL_HAT_LEFT\fP
+.IP "" 10
+\fBSDL_HAT_RIGHTUP\fP
+.IP "" 10
+\fBSDL_HAT_RIGHTDOWN\fP
+.IP "" 10
+\fBSDL_HAT_LEFTUP\fP
+.IP "" 10
+\fBSDL_HAT_LEFTDOWN\fP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_JoystickNumHats\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_JoystickIndex.3 b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickIndex.3
new file mode 100644
index 0000000..611e4b6
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickIndex.3
@@ -0,0 +1,18 @@
+.TH "SDL_JoystickIndex" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_JoystickIndex \- Get the index of an SDL_Joystick\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_JoystickIndex\fP\fR(\fBSDL_Joystick *joystick\fR);
+.SH "DESCRIPTION"
+.PP
+Returns the index of a given \fBSDL_Joystick\fR structure\&.
+.SH "RETURN VALUE"
+.PP
+Index number of the joystick\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_JoystickOpen\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_JoystickName.3 b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickName.3
new file mode 100644
index 0000000..364297e
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickName.3
@@ -0,0 +1,32 @@
+.TH "SDL_JoystickName" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_JoystickName \- Get joystick name\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBconst char *\fBSDL_JoystickName\fP\fR(\fBint index\fR);
+.SH "DESCRIPTION"
+.PP
+Get the implementation dependent name of joystick\&. The \fBindex\fR parameter refers to the N\&'th joystick on the system\&.
+.SH "RETURN VALUE"
+.PP
+Returns a char pointer to the joystick name\&.
+.SH "EXAMPLES"
+.PP
+.PP
+.nf
+\f(CW/* Print the names of all attached joysticks */
+int num_joy, i;
+num_joy=SDL_NumJoysticks();
+printf("%d joysticks found
+", num_joy);
+for(i=0;i<num_joy;i++)
+ printf("%s
+", SDL_JoystickName(i));\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_JoystickOpen\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_JoystickNumAxes.3 b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickNumAxes.3
new file mode 100644
index 0000000..339c36c
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickNumAxes.3
@@ -0,0 +1,18 @@
+.TH "SDL_JoystickNumAxes" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_JoystickNumAxes \- Get the number of joystick axes
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_JoystickNumAxes\fP\fR(\fBSDL_Joystick *joystick\fR);
+.SH "DESCRIPTION"
+.PP
+Return the number of axes available from a previously opened \fBSDL_Joystick\fR\&.
+.SH "RETURN VALUE"
+.PP
+Number of axes\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_JoystickGetAxis\fP\fR, \fI\fBSDL_JoystickOpen\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_JoystickNumBalls.3 b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickNumBalls.3
new file mode 100644
index 0000000..32dcae3
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickNumBalls.3
@@ -0,0 +1,18 @@
+.TH "SDL_JoystickNumBalls" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_JoystickNumBalls \- Get the number of joystick trackballs
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_JoystickNumBalls\fP\fR(\fBSDL_Joystick *joystick\fR);
+.SH "DESCRIPTION"
+.PP
+Return the number of trackballs available from a previously opened \fBSDL_Joystick\fR\&.
+.SH "RETURN VALUE"
+.PP
+Number of trackballs\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_JoystickGetBall\fP\fR, \fI\fBSDL_JoystickOpen\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_JoystickNumButtons.3 b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickNumButtons.3
new file mode 100644
index 0000000..652ea4e
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickNumButtons.3
@@ -0,0 +1,18 @@
+.TH "SDL_JoystickNumButtons" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_JoystickNumButtons \- Get the number of joysitck buttons
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_JoystickNumButtons\fP\fR(\fBSDL_Joystick *joystick\fR);
+.SH "DESCRIPTION"
+.PP
+Return the number of buttons available from a previously opened \fBSDL_Joystick\fR\&.
+.SH "RETURN VALUE"
+.PP
+Number of buttons\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_JoystickGetButton\fP\fR, \fI\fBSDL_JoystickOpen\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_JoystickNumHats.3 b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickNumHats.3
new file mode 100644
index 0000000..9a4ca7f
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickNumHats.3
@@ -0,0 +1,18 @@
+.TH "SDL_JoystickNumHats" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_JoystickNumHats \- Get the number of joystick hats
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_JoystickNumHats\fP\fR(\fBSDL_Joystick *joystick\fR);
+.SH "DESCRIPTION"
+.PP
+Return the number of hats available from a previously opened \fBSDL_Joystick\fR\&.
+.SH "RETURN VALUE"
+.PP
+Number of hats\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_JoystickGetHat\fP\fR, \fI\fBSDL_JoystickOpen\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_JoystickOpen.3 b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickOpen.3
new file mode 100644
index 0000000..7e1d6a6
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickOpen.3
@@ -0,0 +1,51 @@
+.TH "SDL_JoystickOpen" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_JoystickOpen \- Opens a joystick for use\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSDL_Joystick *\fBSDL_JoystickOpen\fP\fR(\fBint index\fR);
+.SH "DESCRIPTION"
+.PP
+Opens a joystick for use within SDL\&. The \fBindex\fR refers to the N\&'th joystick in the system\&. A joystick must be opened before it game be used\&.
+.SH "RETURN VALUE"
+.PP
+Returns a \fBSDL_Joystick\fR structure on success\&. \fBNULL\fR on failure\&.
+.SH "EXAMPLES"
+.PP
+.PP
+.nf
+\f(CWSDL_Joystick *joy;
+// Check for joystick
+if(SDL_NumJoysticks()>0){
+ // Open joystick
+ joy=SDL_JoystickOpen(0);
+
+ if(joy)
+ {
+ printf("Opened Joystick 0
+");
+ printf("Name: %s
+", SDL_JoystickName(0));
+ printf("Number of Axes: %d
+", SDL_JoystickNumAxes(joy));
+ printf("Number of Buttons: %d
+", SDL_JoystickNumButtons(joy));
+ printf("Number of Balls: %d
+", SDL_JoystickNumBalls(joy));
+ }
+ else
+ printf("Couldn\&'t open Joystick 0
+");
+
+ // Close if opened
+ if(SDL_JoystickOpened(0))
+ SDL_JoystickClose(joy);
+}\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_JoystickClose\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_JoystickOpened.3 b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickOpened.3
new file mode 100644
index 0000000..9d82e09
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickOpened.3
@@ -0,0 +1,18 @@
+.TH "SDL_JoystickOpened" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_JoystickOpened \- Determine if a joystick has been opened
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_JoystickOpened\fP\fR(\fBint index\fR);
+.SH "DESCRIPTION"
+.PP
+Determines whether a joystick has already been opened within the application\&. \fBindex\fR refers to the N\&'th joystick on the system\&.
+.SH "RETURN VALUE"
+.PP
+Returns \fB1\fR if the joystick has been opened, or \fB0\fR if it has not\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_JoystickOpen\fP\fR, \fI\fBSDL_JoystickClose\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_JoystickUpdate.3 b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickUpdate.3
new file mode 100644
index 0000000..7d1035b
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_JoystickUpdate.3
@@ -0,0 +1,15 @@
+.TH "SDL_JoystickUpdate" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_JoystickUpdate \- Updates the state of all joysticks
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_JoystickUpdate\fP\fR(\fBvoid\fR);
+.SH "DESCRIPTION"
+.PP
+Updates the state(position, buttons, etc\&.) of all open joysticks\&. If joystick events have been enabled with \fI\fBSDL_JoystickEventState\fP\fR then this is called automatically in the event loop\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_JoystickEventState\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_KeyboardEvent.3 b/distrib/sdl-1.2.15/docs/man3/SDL_KeyboardEvent.3
new file mode 100644
index 0000000..4aeea79
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_KeyboardEvent.3
@@ -0,0 +1,38 @@
+.TH "SDL_KeyboardEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_KeyboardEvent \- Keyboard event structure
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ Uint8 type;
+ Uint8 state;
+ SDL_keysym keysym;
+} SDL_KeyboardEvent;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBtype\fR
+\fBSDL_KEYDOWN\fP or \fBSDL_KEYUP\fP
+.TP 20
+\fBstate\fR
+\fBSDL_PRESSED\fP or \fBSDL_RELEASED\fP
+.TP 20
+\fBkeysym\fR
+Contains key press information
+.SH "DESCRIPTION"
+.PP
+\fBSDL_KeyboardEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_KEYDOWN\fP or \fBSDL_KEYUP\fP is reported\&.
+.PP
+The \fBtype\fR and \fBstate\fR actually report the same information, they just use different values to do it! A keyboard event occurs when a key is released (\fBtype\fR=\fBSDK_KEYUP\fP or \fBstate\fR=\fBSDL_RELEASED\fP) and when a key is pressed (\fBtype\fR=\fBSDL_KEYDOWN\fP or \fBstate\fR=\fBSDL_PRESSED\fP)\&. The information on what key was pressed or released is in the \fI\fBkeysym\fR\fR structure\&.
+.PP
+.RS
+\fBNote:
+.PP
+Repeating \fBSDL_KEYDOWN\fP events will occur if key repeat is enabled (see \fI\fBSDL_EnableKeyRepeat\fP\fR)\&.
+.RE
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Event\fR\fR, \fI\fBSDL_keysym\fR\fR, \fI\fBSDL_EnableKeyRepeat\fP\fR, \fI\fBSDL_EnableUNICODE\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_KillThread.3 b/distrib/sdl-1.2.15/docs/man3/SDL_KillThread.3
new file mode 100644
index 0000000..2a34f11
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_KillThread.3
@@ -0,0 +1,16 @@
+.TH "SDL_KillThread" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_KillThread \- Gracelessly terminates the thread\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL_thread\&.h"
+.sp
+\fBvoid \fBSDL_KillThread\fP\fR(\fBSDL_Thread *thread\fR);
+.SH "DESCRIPTION"
+.PP
+\fBSDL_KillThread\fP gracelessly terminates the thread associated with \fBthread\fR\&. If possible, you should use some other form of IPC to signal the thread to quit\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CreateThread\fP\fR, \fI\fBSDL_WaitThread\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_ListModes.3 b/distrib/sdl-1.2.15/docs/man3/SDL_ListModes.3
new file mode 100644
index 0000000..3cc9376
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_ListModes.3
@@ -0,0 +1,53 @@
+.TH "SDL_ListModes" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_ListModes \- Returns a pointer to an array of available screen dimensions for the given format and video flags
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSDL_Rect **\fBSDL_ListModes\fP\fR(\fBSDL_PixelFormat *format, Uint32 flags\fR);
+.SH "DESCRIPTION"
+.PP
+Return a pointer to an array of available screen dimensions for the given format and video flags, sorted largest to smallest\&. Returns \fBNULL\fP if there are no dimensions available for a particular format, or \fB-1\fR if any dimension is okay for the given format\&.
+.PP
+If \fBformat\fR is \fBNULL\fP, the mode list will be for the format returned by \fISDL_GetVideoInfo()\fR->\fBvfmt\fR\&. The \fBflag\fR parameter is an OR\&'d combination of \fIsurface\fR flags\&. The flags are the same as those used \fI\fBSDL_SetVideoMode\fP\fR and they play a strong role in deciding what modes are valid\&. For instance, if you pass \fBSDL_HWSURFACE\fP as a flag only modes that support hardware video surfaces will be returned\&.
+.SH "EXAMPLE"
+.PP
+.nf
+\f(CWSDL_Rect **modes;
+int i;
+\&.
+\&.
+\&.
+
+/* Get available fullscreen/hardware modes */
+modes=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE);
+
+/* Check is there are any modes available */
+if(modes == (SDL_Rect **)0){
+ printf("No modes available!
+");
+ exit(-1);
+}
+
+/* Check if or resolution is restricted */
+if(modes == (SDL_Rect **)-1){
+ printf("All resolutions available\&.
+");
+}
+else{
+ /* Print valid modes */
+ printf("Available Modes
+");
+ for(i=0;modes[i];++i)
+ printf(" %d x %d
+", modes[i]->w, modes[i]->h);
+}
+\&.
+\&.\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_GetVideoInfo\fP\fR, \fI\fBSDL_Rect\fR\fR, \fI\fBSDL_PixelFormat\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_LoadBMP.3 b/distrib/sdl-1.2.15/docs/man3/SDL_LoadBMP.3
new file mode 100644
index 0000000..7e3b4af
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_LoadBMP.3
@@ -0,0 +1,18 @@
+.TH "SDL_LoadBMP" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_LoadBMP \- Load a Windows BMP file into an SDL_Surface\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSDL_Surface *\fBSDL_LoadBMP\fP\fR(\fBconst char *file\fR);
+.SH "DESCRIPTION"
+.PP
+Loads a surface from a named Windows BMP file\&.
+.SH "RETURN VALUE"
+.PP
+Returns the new surface, or \fBNULL\fP if there was an error\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_SaveBMP\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_LoadWAV.3 b/distrib/sdl-1.2.15/docs/man3/SDL_LoadWAV.3
new file mode 100644
index 0000000..490ff67
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_LoadWAV.3
@@ -0,0 +1,42 @@
+.TH "SDL_LoadWAV" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_LoadWAV \- Load a WAVE file
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSDL_AudioSpec *\fBSDL_LoadWAV\fP\fR(\fBconst char *file, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len\fR);
+.SH "DESCRIPTION"
+.PP
+\fBSDL_LoadWAV\fP This function loads a WAVE \fBfile\fR into memory\&.
+.PP
+If this function succeeds, it returns the given \fI\fBSDL_AudioSpec\fP\fR, filled with the audio data format of the wave data, and sets \fBaudio_buf\fR to a \fBmalloc\fP\&'d buffer containing the audio data, and sets \fBaudio_len\fR to the length of that audio buffer, in bytes\&. You need to free the audio buffer with \fI\fBSDL_FreeWAV\fP\fR when you are done with it\&.
+.PP
+This function returns \fBNULL\fP and sets the SDL error message if the wave file cannot be opened, uses an unknown data format, or is corrupt\&. Currently raw, MS-ADPCM and IMA-ADPCM WAVE files are supported\&.
+.SH "EXAMPLE"
+.PP
+.nf
+\f(CWSDL_AudioSpec wav_spec;
+Uint32 wav_length;
+Uint8 *wav_buffer;
+
+/* Load the WAV */
+if( SDL_LoadWAV("test\&.wav", &wav_spec, &wav_buffer, &wav_length) == NULL ){
+ fprintf(stderr, "Could not open test\&.wav: %s
+", SDL_GetError());
+ exit(-1);
+}
+\&.
+\&.
+\&.
+/* Do stuff with the WAV */
+\&.
+\&.
+/* Free It */
+SDL_FreeWAV(wav_buffer);\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_AudioSpec\fR\fR, \fI\fBSDL_OpenAudio\fP\fR, \fI\fBSDL_FreeWAV\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_LockAudio.3 b/distrib/sdl-1.2.15/docs/man3/SDL_LockAudio.3
new file mode 100644
index 0000000..8c141fd
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_LockAudio.3
@@ -0,0 +1,15 @@
+.TH "SDL_LockAudio" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_LockAudio \- Lock out the callback function
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_LockAudio\fP\fR(\fBvoid\fR)
+.SH "DESCRIPTION"
+.PP
+The lock manipulated by these functions protects the callback function\&. During a LockAudio period, you can be guaranteed that the callback function is not running\&. Do not call these from the callback function or you will cause deadlock\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_OpenAudio\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_LockSurface.3 b/distrib/sdl-1.2.15/docs/man3/SDL_LockSurface.3
new file mode 100644
index 0000000..6db3ad7
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_LockSurface.3
@@ -0,0 +1,48 @@
+.TH "SDL_LockSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_LockSurface \- Lock a surface for directly access\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_LockSurface\fP\fR(\fBSDL_Surface *surface\fR);
+.SH "DESCRIPTION"
+.PP
+\fBSDL_LockSurface\fP sets up a surface for directly accessing the pixels\&. Between calls to \fBSDL_LockSurface\fP and \fBSDL_UnlockSurface\fP, you can write to and read from \fBsurface->\fBpixels\fR\fR, using the pixel format stored in \fBsurface->\fBformat\fR\fR\&. Once you are done accessing the surface, you should use \fBSDL_UnlockSurface\fP to release it\&.
+.PP
+Not all surfaces require locking\&. If \fBSDL_MUSTLOCK\fP(\fBsurface\fR) evaluates to \fB0\fR, then you can read and write to the surface at any time, and the pixel format of the surface will not change\&.
+.PP
+No operating system or library calls should be made between lock/unlock pairs, as critical system locks may be held during this time\&.
+.PP
+It should be noted, that since SDL 1\&.1\&.8 surface locks are recursive\&. This means that you can lock a surface multiple times, but each lock must have a match unlock\&.
+.PP
+.nf
+\f(CW \&.
+ \&.
+ SDL_LockSurface( surface );
+ \&.
+ /* Surface is locked */
+ /* Direct pixel access on surface here */
+ \&.
+ SDL_LockSurface( surface );
+ \&.
+ /* More direct pixel access on surface */
+ \&.
+ SDL_UnlockSurface( surface );
+ /* Surface is still locked */
+ /* Note: Is versions < 1\&.1\&.8, the surface would have been */
+ /* no longer locked at this stage */
+ \&.
+ SDL_UnlockSurface( surface );
+ /* Surface is now unlocked */
+ \&.
+ \&.\fR
+.fi
+.PP
+.SH "RETURN VALUE"
+.PP
+\fBSDL_LockSurface\fP returns \fB0\fR, or \fB-1\fR if the surface couldn\&'t be locked\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_UnlockSurface\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_LockYUVOverlay.3 b/distrib/sdl-1.2.15/docs/man3/SDL_LockYUVOverlay.3
new file mode 100644
index 0000000..286d96f
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_LockYUVOverlay.3
@@ -0,0 +1,18 @@
+.TH "SDL_LockYUVOverlay" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_LockYUVOverlay \- Lock an overlay
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_LockYUVOverlay\fP\fR(\fBSDL_Overlay *overlay\fR);
+.SH "DESCRIPTION"
+.PP
+Much the same as \fI\fBSDL_LockSurface\fP\fR, \fBSDL_LockYUVOverlay\fP locks the \fI\fBoverlay\fR\fR for direct access to pixel data\&.
+.SH "RETURN VALUE"
+.PP
+Returns \fB0\fR on success, or \fB-1\fR on an error\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_UnlockYUVOverlay\fP\fR, \fI\fBSDL_CreateYUVOverlay\fP\fR, \fI\fBSDL_Overlay\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_MapRGB.3 b/distrib/sdl-1.2.15/docs/man3/SDL_MapRGB.3
new file mode 100644
index 0000000..1e4c963
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_MapRGB.3
@@ -0,0 +1,22 @@
+.TH "SDL_MapRGB" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_MapRGB \- Map a RGB color value to a pixel format\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBUint32 \fBSDL_MapRGB\fP\fR(\fBSDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b\fR);
+.SH "DESCRIPTION"
+.PP
+Maps the RGB color value to the specified pixel format and returns the pixel value as a 32-bit int\&.
+.PP
+If the format has a palette (8-bit) the index of the closest matching color in the palette will be returned\&.
+.PP
+If the specified pixel format has an alpha component it will be returned as all 1 bits (fully opaque)\&.
+.SH "RETURN VALUE"
+.PP
+A pixel value best approximating the given RGB color value for a given pixel format\&. If the pixel format bpp (color depth) is less than 32-bpp then the unused upper bits of the return value can safely be ignored (e\&.g\&., with a 16-bpp format the return value can be assigned to a \fBUint16\fP, and similarly a \fBUint8\fP for an 8-bpp format)\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_GetRGB\fP\fR, \fI\fBSDL_GetRGBA\fP\fR, \fI\fBSDL_MapRGBA\fP\fR, \fI\fBSDL_PixelFormat\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_MapRGBA.3 b/distrib/sdl-1.2.15/docs/man3/SDL_MapRGBA.3
new file mode 100644
index 0000000..03d78d8
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_MapRGBA.3
@@ -0,0 +1,22 @@
+.TH "SDL_MapRGBA" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_MapRGBA \- Map a RGBA color value to a pixel format\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBUint32 \fBSDL_MapRGBA\fP\fR(\fBSDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b, Uint8 a\fR);
+.SH "DESCRIPTION"
+.PP
+Maps the RGBA color value to the specified pixel format and returns the pixel value as a 32-bit int\&.
+.PP
+If the format has a palette (8-bit) the index of the closest matching color in the palette will be returned\&.
+.PP
+If the specified pixel format has no alpha component the alpha value will be ignored (as it will be in formats with a palette)\&.
+.SH "RETURN VALUE"
+.PP
+A pixel value best approximating the given RGBA color value for a given pixel format\&. If the pixel format bpp (color depth) is less than 32-bpp then the unused upper bits of the return value can safely be ignored (e\&.g\&., with a 16-bpp format the return value can be assigned to a \fBUint16\fP, and similarly a \fBUint8\fP for an 8-bpp format)\&.
+.SH "SEE ALSO"
+.PP
+\fISDL_GetRGB\fR, \fISDL_GetRGBA\fR, \fISDL_MapRGB\fR, \fISDL_PixelFormat\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_MixAudio.3 b/distrib/sdl-1.2.15/docs/man3/SDL_MixAudio.3
new file mode 100644
index 0000000..b98660d
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_MixAudio.3
@@ -0,0 +1,21 @@
+.TH "SDL_MixAudio" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_MixAudio \- Mix audio data
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_MixAudio\fP\fR(\fBUint8 *dst, Uint8 *src, Uint32 len, int volume\fR);
+.SH "DESCRIPTION"
+.PP
+This function takes two audio buffers of \fBlen\fR bytes each of the playing audio format and mixes them, performing addition, volume adjustment, and overflow clipping\&. The \fBvolume\fR ranges from 0 to \fBSDL_MIX_MAXVOLUME\fP and should be set to the maximum value for full audio volume\&. Note this does not change hardware volume\&. This is provided for convenience -- you can mix your own audio data\&.
+.PP
+.RS
+\fBNote:
+.PP
+Do not use this function for mixing together more than two streams of sample data\&. The output from repeated application of this function may be distorted by clipping, because there is no accumulator with greater range than the input (not to mention this being an inefficient way of doing it)\&. Use mixing functions from SDL_mixer, OpenAL, or write your own mixer instead\&.
+.RE
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_OpenAudio\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_MouseButtonEvent.3 b/distrib/sdl-1.2.15/docs/man3/SDL_MouseButtonEvent.3
new file mode 100644
index 0000000..d2d34a0
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_MouseButtonEvent.3
@@ -0,0 +1,36 @@
+.TH "SDL_MouseButtonEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_MouseButtonEvent \- Mouse button event structure
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ Uint8 type;
+ Uint8 button;
+ Uint8 state;
+ Uint16 x, y;
+} SDL_MouseButtonEvent;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBtype\fR
+\fBSDL_MOUSEBUTTONDOWN\fP or \fBSDL_MOUSEBUTTONUP\fP
+.TP 20
+\fBbutton\fR
+The mouse button index (SDL_BUTTON_LEFT, SDL_BUTTON_MIDDLE, SDL_BUTTON_RIGHT)
+.TP 20
+\fBstate\fR
+\fBSDL_PRESSED\fP or \fBSDL_RELEASED\fP
+.TP 20
+\fBx\fR, \fBy\fR
+The X/Y coordinates of the mouse at press/release time
+.SH "DESCRIPTION"
+.PP
+\fBSDL_MouseButtonEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_MOUSEBUTTONDOWN\fP or \fBSDL_MOUSEBUTTONUP\fP is reported\&.
+.PP
+When a mouse button press or release is detected then number of the button pressed (from 1 to 255, with 1 usually being the left button and 2 the right) is placed into \fBbutton\fR, the position of the mouse when this event occured is stored in the \fBx\fR and the \fBy\fR fields\&. Like \fI\fBSDL_KeyboardEvent\fR\fR, information on whether the event was a press or a release event is stored in both the \fBtype\fR and \fBstate\fR fields, but this should be obvious\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Event\fR\fR, \fI\fBSDL_MouseMotionEvent\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_MouseMotionEvent.3 b/distrib/sdl-1.2.15/docs/man3/SDL_MouseMotionEvent.3
new file mode 100644
index 0000000..c1b036d
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_MouseMotionEvent.3
@@ -0,0 +1,38 @@
+.TH "SDL_MouseMotionEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_MouseMotionEvent \- Mouse motion event structure
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ Uint8 type;
+ Uint8 state;
+ Uint16 x, y;
+ Sint16 xrel, yrel;
+} SDL_MouseMotionEvent;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBtype\fR
+\fBSDL_MOUSEMOTION\fP
+.TP 20
+\fBstate\fR
+The current button state
+.TP 20
+\fBx\fR, \fBy\fR
+The X/Y coordinates of the mouse
+.TP 20
+\fBxrel\fR, \fByrel\fR
+Relative motion in the X/Y direction
+.SH "DESCRIPTION"
+.PP
+\fBSDL_MouseMotionEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_MOUSEMOTION\fP is reported\&.
+.PP
+Simply put, a \fBSDL_MOUSEMOTION\fP type event occurs when a user moves the mouse within the application window or when \fI\fBSDL_WarpMouse\fP\fR is called\&. Both the absolute (\fBx\fR and \fBy\fR) and relative (\fBxrel\fR and \fByrel\fR) coordinates are reported along with the current button states (\fBstate\fR)\&. The button state can be interpreted using the \fBSDL_BUTTON\fP macro (see \fI\fBSDL_GetMouseState\fP\fR)\&.
+.PP
+If the cursor is hidden (\fI\fBSDL_ShowCursor\fP(0)\fR) and the input is grabbed (\fI\fBSDL_WM_GrabInput\fP(SDL_GRAB_ON)\fR), then the mouse will give relative motion events even when the cursor reaches the edge fo the screen\&. This is currently only implemented on Windows and Linux/Unix-a-likes\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Event\fR\fR, \fI\fBSDL_MouseButtonEvent\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_NumJoysticks.3 b/distrib/sdl-1.2.15/docs/man3/SDL_NumJoysticks.3
new file mode 100644
index 0000000..c737a1c
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_NumJoysticks.3
@@ -0,0 +1,18 @@
+.TH "SDL_NumJoysticks" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_NumJoysticks \- Count available joysticks\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_NumJoysticks\fP\fR(\fBvoid\fR);
+.SH "DESCRIPTION"
+.PP
+Counts the number of joysticks attached to the system\&.
+.SH "RETURN VALUE"
+.PP
+Returns the number of attached joysticks
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_JoystickName\fP\fR, \fI\fBSDL_JoystickOpen\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_OpenAudio.3 b/distrib/sdl-1.2.15/docs/man3/SDL_OpenAudio.3
new file mode 100644
index 0000000..38a232c
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_OpenAudio.3
@@ -0,0 +1,97 @@
+.TH "SDL_OpenAudio" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_OpenAudio \- Opens the audio device with the desired parameters\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_OpenAudio\fP\fR(\fBSDL_AudioSpec *desired, SDL_AudioSpec *obtained\fR);
+.SH "DESCRIPTION"
+.PP
+This function opens the audio device with the \fBdesired\fR parameters, and returns 0 if successful, placing the actual hardware parameters in the structure pointed to by \fBobtained\fR\&. If \fBobtained\fR is NULL, the audio data passed to the callback function will be guaranteed to be in the requested format, and will be automatically converted to the hardware audio format if necessary\&. This function returns -1 if it failed to open the audio device, or couldn\&'t set up the audio thread\&.
+.PP
+To open the audio device a \fBdesired\fR \fI\fBSDL_AudioSpec\fR\fR must be created\&.
+.PP
+.nf
+\f(CWSDL_AudioSpec *desired;
+\&.
+\&.
+desired=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec));\fR
+.fi
+.PP
+ You must then fill this structure with your desired audio specifications\&.
+.IP "\fBdesired\fR->\fBfreq\fR" 10The desired audio frequency in samples-per-second\&.
+.IP "\fBdesired\fR->\fBformat\fR" 10The desired audio format (see \fI\fBSDL_AudioSpec\fR\fR)
+.IP "\fBdesired\fR->\fBsamples\fR" 10The desired size of the audio buffer in samples\&. This number should be a power of two, and may be adjusted by the audio driver to a value more suitable for the hardware\&. Good values seem to range between 512 and 8192 inclusive, depending on the application and CPU speed\&. Smaller values yield faster response time, but can lead to underflow if the application is doing heavy processing and cannot fill the audio buffer in time\&. A stereo sample consists of both right and left channels in LR ordering\&. Note that the number of samples is directly related to time by the following formula: ms = (samples*1000)/freq
+.IP "\fBdesired\fR->\fBcallback\fR" 10This should be set to a function that will be called when the audio device is ready for more data\&. It is passed a pointer to the audio buffer, and the length in bytes of the audio buffer\&. This function usually runs in a separate thread, and so you should protect data structures that it accesses by calling \fI\fBSDL_LockAudio\fP\fR and \fI\fBSDL_UnlockAudio\fP\fR in your code\&. The callback prototype is:
+.PP
+.nf
+\f(CWvoid callback(void *userdata, Uint8 *stream, int len);\fR
+.fi
+.PP
+ \fBuserdata\fR is the pointer stored in \fBuserdata\fR field of the \fBSDL_AudioSpec\fR\&. \fBstream\fR is a pointer to the audio buffer you want to fill with information and \fBlen\fR is the length of the audio buffer in bytes\&.
+.IP "\fBdesired\fR->\fBuserdata\fR" 10This pointer is passed as the first parameter to the \fBcallback\fP function\&.
+.PP
+\fBSDL_OpenAudio\fP reads these fields from the \fBdesired\fR \fBSDL_AudioSpec\fR structure pass to the function and attempts to find an audio configuration matching your \fBdesired\fR\&. As mentioned above, if the \fBobtained\fR parameter is \fBNULL\fP then SDL with convert from your \fBdesired\fR audio settings to the hardware settings as it plays\&.
+.PP
+If \fBobtained\fR is \fBNULL\fP then the \fBdesired\fR \fBSDL_AudioSpec\fR is your working specification, otherwise the \fBobtained\fR \fBSDL_AudioSpec\fR becomes the working specification and the \fBdesirec\fR specification can be deleted\&. The data in the working specification is used when building \fBSDL_AudioCVT\fR\&'s for converting loaded data to the hardware format\&.
+.PP
+\fBSDL_OpenAudio\fP calculates the \fBsize\fR and \fBsilence\fR fields for both the \fBdesired\fR and \fBobtained\fR specifications\&. The \fBsize\fR field stores the total size of the audio buffer in bytes, while the \fBsilence\fR stores the value used to represent silence in the audio buffer
+.PP
+The audio device starts out playing \fBsilence\fR when it\&'s opened, and should be enabled for playing by calling \fI\fBSDL_PauseAudio\fP(\fB0\fR)\fR when you are ready for your audio \fBcallback\fR function to be called\&. Since the audio driver may modify the requested \fBsize\fR of the audio buffer, you should allocate any local mixing buffers after you open the audio device\&.
+.SH "EXAMPLES"
+.PP
+.nf
+\f(CW/* Prototype of our callback function */
+void my_audio_callback(void *userdata, Uint8 *stream, int len);
+
+/* Open the audio device */
+SDL_AudioSpec *desired, *obtained;
+SDL_AudioSpec *hardware_spec;
+
+/* Allocate a desired SDL_AudioSpec */
+desired=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec));
+
+/* Allocate space for the obtained SDL_AudioSpec */
+obtained=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec));
+
+/* 22050Hz - FM Radio quality */
+desired->freq=22050;
+
+/* 16-bit signed audio */
+desired->format=AUDIO_S16LSB;
+
+/* Mono */
+desired->channels=0;
+
+/* Large audio buffer reduces risk of dropouts but increases response time */
+desired->samples=8192;
+
+/* Our callback function */
+desired->callback=my_audio_callback;
+
+desired->userdata=NULL;
+
+/* Open the audio device */
+if ( SDL_OpenAudio(desired, obtained) < 0 ){
+ fprintf(stderr, "Couldn\&'t open audio: %s
+", SDL_GetError());
+ exit(-1);
+}
+/* desired spec is no longer needed */
+free(desired);
+hardware_spec=obtained;
+\&.
+\&.
+/* Prepare callback for playing */
+\&.
+\&.
+\&.
+/* Start playing */
+SDL_PauseAudio(0);\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_AudioSpec\fP\fR, \fI\fBSDL_LockAudio\fP\fR, \fI\fBSDL_UnlockAudio\fP\fR, \fI\fBSDL_PauseAudio\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_Overlay.3 b/distrib/sdl-1.2.15/docs/man3/SDL_Overlay.3
new file mode 100644
index 0000000..a852e91
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_Overlay.3
@@ -0,0 +1,52 @@
+.TH "SDL_Overlay" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_Overlay \- YUV video overlay
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ Uint32 format;
+ int w, h;
+ int planes;
+ Uint16 *pitches;
+ Uint8 **pixels;
+ Uint32 hw_overlay:1;
+} SDL_Overlay;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBformat\fR
+Overlay format (see below)
+.TP 20
+\fBw, h\fR
+Width and height of overlay
+.TP 20
+\fBplanes\fR
+Number of planes in the overlay\&. Usually either 1 or 3
+.TP 20
+\fBpitches\fR
+An array of pitches, one for each plane\&. Pitch is the length of a row in bytes\&.
+.TP 20
+\fBpixels\fR
+An array of pointers to teh data of each plane\&. The overlay should be locked before these pointers are used\&.
+.TP 20
+\fBhw_overlay\fR
+This will be set to 1 if the overlay is hardware accelerated\&.
+.SH "DESCRIPTION"
+.PP
+A \fBSDL_Overlay\fR is similar to a \fI\fBSDL_Surface\fR\fR except it stores a YUV overlay\&. All the fields are read only, except for \fBpixels\fR which should be \fIlocked\fR before use\&. The \fBformat\fR field stores the format of the overlay which is one of the following:
+.PP
+.nf
+\f(CW#define SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U */
+#define SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V */
+#define SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 */
+#define SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 */
+#define SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 */\fR
+.fi
+.PP
+ More information on YUV formats can be found at \fIhttp://www\&.webartz\&.com/fourcc/indexyuv\&.htm (link to URL http://www.webartz.com/fourcc/indexyuv.htm) \fR\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CreateYUVOverlay\fP\fR, \fI\fBSDL_LockYUVOverlay\fP\fR, \fI\fBSDL_UnlockYUVOverlay\fP\fR, \fI\fBSDL_FreeYUVOverlay\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_Palette.3 b/distrib/sdl-1.2.15/docs/man3/SDL_Palette.3
new file mode 100644
index 0000000..ea5e406
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_Palette.3
@@ -0,0 +1,26 @@
+.TH "SDL_Palette" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_Palette \- Color palette for 8-bit pixel formats
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ int ncolors;
+ SDL_Color *colors;
+} SDL_Palette;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBncolors\fR
+Number of colors used in this palette
+.TP 20
+\fBcolors\fR
+Pointer to \fI\fBSDL_Color\fR\fR structures that make up the palette\&.
+.SH "DESCRIPTION"
+.PP
+Each pixel in an 8-bit surface is an index into the \fBcolors\fR field of the \fBSDL_Palette\fR structure store in \fI\fBSDL_PixelFormat\fR\fR\&. A \fBSDL_Palette\fR should never need to be created manually\&. It is automatically created when SDL allocates a \fBSDL_PixelFormat\fR for a surface\&. The colors values of a \fI\fBSDL_Surface\fR\fRs palette can be set with the \fI\fBSDL_SetColors\fP\fR\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Color\fR\fR, \fI\fBSDL_Surface\fR\fR, \fI\fBSDL_SetColors\fP\fR \fI\fBSDL_SetPalette\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_PauseAudio.3 b/distrib/sdl-1.2.15/docs/man3/SDL_PauseAudio.3
new file mode 100644
index 0000000..1ca979a
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_PauseAudio.3
@@ -0,0 +1,15 @@
+.TH "SDL_PauseAudio" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_PauseAudio \- Pauses and unpauses the audio callback processing
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_PauseAudio\fP\fR(\fBint pause_on\fR);
+.SH "DESCRIPTION"
+.PP
+This function pauses and unpauses the audio callback processing\&. It should be called with \fBpause_on\fR=0 after opening the audio device to start playing sound\&. This is so you can safely initialize data for your callback function after opening the audio device\&. Silence will be written to the audio device during the pause\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_GetAudioStatus\fP\fR, \fI\fBSDL_OpenAudio\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_PeepEvents.3 b/distrib/sdl-1.2.15/docs/man3/SDL_PeepEvents.3
new file mode 100644
index 0000000..016542d
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_PeepEvents.3
@@ -0,0 +1,26 @@
+.TH "SDL_PeepEvents" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_PeepEvents \- Checks the event queue for messages and optionally returns them\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_PeepEvents\fP\fR(\fBSDL_Event *events, int numevents, SDL_eventaction action, Uint32 mask\fR);
+.SH "DESCRIPTION"
+.PP
+Checks the event queue for messages and optionally returns them\&.
+.PP
+If \fBaction\fR is \fBSDL_ADDEVENT\fP, up to \fBnumevents\fR events will be added to the back of the event queue\&.
+.PP
+If \fBaction\fR is \fBSDL_PEEKEVENT\fP, up to \fBnumevents\fR events at the front of the event queue, matching \fI\fBmask\fR\fR, will be returned and will not be removed from the queue\&.
+.PP
+If \fBaction\fR is \fBSDL_GETEVENT\fP, up to \fBnumevents\fR events at the front of the event queue, matching \fI\fBmask\fR\fR, will be returned and will be removed from the queue\&.
+.PP
+This function is thread-safe\&.
+.SH "RETURN VALUE"
+.PP
+This function returns the number of events actually stored, or \fB-1\fR if there was an error\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Event\fR\fR, \fI\fBSDL_PollEvent\fP\fR, \fI\fBSDL_PushEvent\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_PixelFormat.3 b/distrib/sdl-1.2.15/docs/man3/SDL_PixelFormat.3
new file mode 100644
index 0000000..f91593e
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_PixelFormat.3
@@ -0,0 +1,140 @@
+.TH "SDL_PixelFormat" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_PixelFormat \- Stores surface format information
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct SDL_PixelFormat {
+ SDL_Palette *palette;
+ Uint8 BitsPerPixel;
+ Uint8 BytesPerPixel;
+ Uint8 Rloss, Gloss, Bloss, Aloss;
+ Uint8 Rshift, Gshift, Bshift, Ashift;
+ Uint32 Rmask, Gmask, Bmask, Amask;
+ Uint32 colorkey;
+ Uint8 alpha;
+} SDL_PixelFormat;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBpalette\fR
+Pointer to the \fIpalette\fR, or \fBNULL\fP if the \fBBitsPerPixel\fR>8
+.TP 20
+\fBBitsPerPixel\fR
+The number of bits used to represent each pixel in a surface\&. Usually 8, 16, 24 or 32\&.
+.TP 20
+\fBBytesPerPixel\fR
+The number of bytes used to represent each pixel in a surface\&. Usually one to four\&.
+.TP 20
+\fB[RGBA]mask\fR
+Binary mask used to retrieve individual color values
+.TP 20
+\fB[RGBA]loss\fR
+Precision loss of each color component (2^[RGBA]loss)
+.TP 20
+\fB[RGBA]shift\fR
+Binary left shift of each color component in the pixel value
+.TP 20
+\fBcolorkey\fR
+Pixel value of transparent pixels
+.TP 20
+\fBalpha\fR
+Overall surface alpha value
+.SH "DESCRIPTION"
+.PP
+A \fBSDL_PixelFormat\fR describes the format of the pixel data stored at the \fBpixels\fR field of a \fI\fBSDL_Surface\fR\fR\&. Every surface stores a \fBSDL_PixelFormat\fR in the \fBformat\fR field\&.
+.PP
+If you wish to do pixel level modifications on a surface, then understanding how SDL stores its color information is essential\&.
+.PP
+8-bit pixel formats are the easiest to understand\&. Since its an 8-bit format, we have 8 \fBBitsPerPixel\fR and 1 \fBBytesPerPixel\fR\&. Since \fBBytesPerPixel\fR is 1, all pixels are represented by a Uint8 which contains an index into \fBpalette\fR->\fBcolors\fR\&. So, to determine the color of a pixel in a 8-bit surface: we read the color index from \fBsurface\fR->\fBpixels\fR and we use that index to read the \fI\fBSDL_Color\fR\fR structure from \fBsurface\fR->\fBformat\fR->\fBpalette\fR->\fBcolors\fR\&. Like so:
+.PP
+.nf
+\f(CWSDL_Surface *surface;
+SDL_PixelFormat *fmt;
+SDL_Color *color;
+Uint8 index;
+
+\&.
+\&.
+
+/* Create surface */
+\&.
+\&.
+fmt=surface->format;
+
+/* Check the bitdepth of the surface */
+if(fmt->BitsPerPixel!=8){
+ fprintf(stderr, "Not an 8-bit surface\&.
+");
+ return(-1);
+}
+
+/* Lock the surface */
+SDL_LockSurface(surface);
+
+/* Get the topleft pixel */
+index=*(Uint8 *)surface->pixels;
+color=fmt->palette->colors[index];
+
+/* Unlock the surface */
+SDL_UnlockSurface(surface);
+printf("Pixel Color-> Red: %d, Green: %d, Blue: %d\&. Index: %d
+",
+ color->r, color->g, color->b, index);
+\&.
+\&.\fR
+.fi
+.PP
+.PP
+Pixel formats above 8-bit are an entirely different experience\&. They are considered to be "TrueColor" formats and the color information is stored in the pixels themselves, not in a palette\&. The mask, shift and loss fields tell us how the color information is encoded\&. The mask fields allow us to isolate each color component, the shift fields tell us the number of bits to the right of each component in the pixel value and the loss fields tell us the number of bits lost from each component when packing 8-bit color component in a pixel\&.
+.PP
+.nf
+\f(CW/* Extracting color components from a 32-bit color value */
+SDL_PixelFormat *fmt;
+SDL_Surface *surface;
+Uint32 temp, pixel;
+Uint8 red, green, blue, alpha;
+\&.
+\&.
+\&.
+fmt=surface->format;
+SDL_LockSurface(surface);
+pixel=*((Uint32*)surface->pixels);
+SDL_UnlockSurface(surface);
+
+/* Get Red component */
+temp=pixel&fmt->Rmask; /* Isolate red component */
+temp=temp>>fmt->Rshift;/* Shift it down to 8-bit */
+temp=temp<<fmt->Rloss; /* Expand to a full 8-bit number */
+red=(Uint8)temp;
+
+/* Get Green component */
+temp=pixel&fmt->Gmask; /* Isolate green component */
+temp=temp>>fmt->Gshift;/* Shift it down to 8-bit */
+temp=temp<<fmt->Gloss; /* Expand to a full 8-bit number */
+green=(Uint8)temp;
+
+/* Get Blue component */
+temp=pixel&fmt->Bmask; /* Isolate blue component */
+temp=temp>>fmt->Bshift;/* Shift it down to 8-bit */
+temp=temp<<fmt->Bloss; /* Expand to a full 8-bit number */
+blue=(Uint8)temp;
+
+/* Get Alpha component */
+temp=pixel&fmt->Amask; /* Isolate alpha component */
+temp=temp>>fmt->Ashift;/* Shift it down to 8-bit */
+temp=temp<<fmt->Aloss; /* Expand to a full 8-bit number */
+alpha=(Uint8)temp;
+
+printf("Pixel Color -> R: %d, G: %d, B: %d, A: %d
+", red, green, blue, alpha);
+\&.
+\&.
+\&.\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Surface\fR\fR, \fI\fBSDL_MapRGB\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_PollEvent.3 b/distrib/sdl-1.2.15/docs/man3/SDL_PollEvent.3
new file mode 100644
index 0000000..6197f7e
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_PollEvent.3
@@ -0,0 +1,44 @@
+.TH "SDL_PollEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_PollEvent \- Polls for currently pending events\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_PollEvent\fP\fR(\fBSDL_Event *event\fR);
+.SH "DESCRIPTION"
+.PP
+Polls for currently pending events, and returns \fB1\fR if there are any pending events, or \fB0\fR if there are none available\&.
+.PP
+If \fBevent\fR is not \fBNULL\fP, the next event is removed from the queue and stored in that area\&.
+.SH "EXAMPLES"
+.PP
+.PP
+.nf
+\f(CWSDL_Event event; /* Event structure */
+
+\&.
+\&.
+\&.
+/* Check for events */
+while(SDL_PollEvent(&event)){ /* Loop until there are no events left on the queue */
+ switch(event\&.type){ /* Process the appropiate event type */
+ case SDL_KEYDOWN: /* Handle a KEYDOWN event */
+ printf("Oh! Key press
+");
+ break;
+ case SDL_MOUSEMOTION:
+ \&.
+ \&.
+ \&.
+ default: /* Report an unhandled event */
+ printf("I don\&'t know what this event is!
+");
+ }
+}\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Event\fR\fR, \fI\fBSDL_WaitEvent\fP\fR, \fI\fBSDL_PeepEvents\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_PumpEvents.3 b/distrib/sdl-1.2.15/docs/man3/SDL_PumpEvents.3
new file mode 100644
index 0000000..62cc13d
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_PumpEvents.3
@@ -0,0 +1,23 @@
+.TH "SDL_PumpEvents" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_PumpEvents \- Pumps the event loop, gathering events from the input devices\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_PumpEvents\fP\fR(\fBvoid\fR);
+.SH "DESCRIPTION"
+.PP
+Pumps the event loop, gathering events from the input devices\&.
+.PP
+\fBSDL_PumpEvents\fP gathers all the pending input information from devices and places it on the event queue\&. Without calls to \fBSDL_PumpEvents\fP no events would ever be placed on the queue\&. Often calls the need for \fBSDL_PumpEvents\fP is hidden from the user since \fI\fBSDL_PollEvent\fP\fR and \fI\fBSDL_WaitEvent\fP\fR implicitly call \fBSDL_PumpEvents\fP\&. However, if you are not polling or waiting for events (e\&.g\&. your filtering them), then you must call \fBSDL_PumpEvents\fP to force an event queue update\&.
+.PP
+.RS
+\fBNote:
+.PP
+You can only call this function in the thread that set the video mode\&.
+.RE
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_PollEvent\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_PushEvent.3 b/distrib/sdl-1.2.15/docs/man3/SDL_PushEvent.3
new file mode 100644
index 0000000..4be188f
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_PushEvent.3
@@ -0,0 +1,27 @@
+.TH "SDL_PushEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_PushEvent \- Pushes an event onto the event queue
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_PushEvent\fP\fR(\fBSDL_Event *event\fR);
+.SH "DESCRIPTION"
+.PP
+The event queue can actually be used as a two way communication channel\&. Not only can events be read from the queue, but the user can also push their own events onto it\&. \fBevent\fR is a pointer to the event structure you wish to push onto the queue\&.
+.PP
+.RS
+\fBNote:
+.PP
+Pushing device input events onto the queue doesn\&'t modify the state of the device within SDL\&.
+.RE
+.SH "RETURN VALUE"
+.PP
+Returns \fB0\fR on success or \fB-1\fR if the event couldn\&'t be pushed\&.
+.SH "EXAMPLES"
+.PP
+See \fI\fBSDL_Event\fR\fR\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_PollEvent\fP\fR, \fI\fBSDL_PeepEvents\fP\fR, \fI\fBSDL_Event\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_Quit.3 b/distrib/sdl-1.2.15/docs/man3/SDL_Quit.3
new file mode 100644
index 0000000..42fe8c1
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_Quit.3
@@ -0,0 +1,29 @@
+.TH "SDL_Quit" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_Quit \- Shut down SDL
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_Quit\fP\fR(\fBvoid\fR);
+.SH "DESCRIPTION"
+.PP
+\fBSDL_Quit\fP shuts down all SDL subsystems and frees the resources allocated to them\&. This should always be called before you exit\&. For the sake of simplicity you can set \fBSDL_Quit\fP as your \fBatexit\fP call, like:
+.PP
+.nf
+\f(CWSDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO);
+atexit(SDL_Quit);
+\&.
+\&.\fR
+.fi
+.PP
+.PP
+.RS
+\fBNote:
+.PP
+While using \fBatexit\fP maybe be fine for small programs, more advanced users should shut down SDL in their own cleanup code\&. Plus, using \fBatexit\fP in a library is a sure way to crash dynamically loaded code
+.RE
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_QuitSubsystem\fP\fR, \fI\fBSDL_Init\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_QuitEvent.3 b/distrib/sdl-1.2.15/docs/man3/SDL_QuitEvent.3
new file mode 100644
index 0000000..c357e2a
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_QuitEvent.3
@@ -0,0 +1,30 @@
+.TH "SDL_QuitEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_QuitEvent \- Quit requested event
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ Uint8 type
+} SDL_QuitEvent;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBtype\fR
+\fBSDL_QUIT\fP
+.SH "DESCRIPTION"
+.PP
+\fBSDL_QuitEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used whan an event of type \fBSDL_QUIT\fP is reported\&.
+.PP
+As can be seen, the SDL_QuitEvent structure serves no useful purpose\&. The event itself, on the other hand, is very important\&. If you filter out or ignore a quit event then it is impossible for the user to close the window\&. On the other hand, if you do accept a quit event then the application window will be closed, and screen updates will still report success event though the application will no longer be visible\&.
+.PP
+.RS
+\fBNote:
+.PP
+The macro \fBSDL_QuitRequested\fP will return non-zero if a quit event is pending
+.RE
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Event\fR\fR, \fI\fBSDL_SetEventFilter\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_QuitSubSystem.3 b/distrib/sdl-1.2.15/docs/man3/SDL_QuitSubSystem.3
new file mode 100644
index 0000000..79e3ca5
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_QuitSubSystem.3
@@ -0,0 +1,15 @@
+.TH "SDL_QuitSubSystem" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_QuitSubSystem \- Shut down a subsystem
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_QuitSubSystem\fP\fR(\fBUint32 flags\fR);
+.SH "DESCRIPTION"
+.PP
+\fBSDL_QuitSubSystem\fP allows you to shut down a subsystem that has been previously initialized by \fI\fBSDL_Init\fP\fR or \fI\fBSDL_InitSubSystem\fP\fR\&. The \fBflags\fR tells \fBSDL_QuitSubSystem\fP which subsystems to shut down, it uses the same values that are passed to \fI\fBSDL_Init\fP\fR\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Quit\fP\fR, \fI\fBSDL_Init\fP\fR, \fI\fBSDL_InitSubSystem\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_RWFromFile.3 b/distrib/sdl-1.2.15/docs/man3/SDL_RWFromFile.3
new file mode 100644
index 0000000..9ea68b9
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_RWFromFile.3
@@ -0,0 +1,18 @@
+.TH "SDL_FunctionName" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_FunctionName \- Short description of function
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBreturn type\fBSDL_FunctionName\fP\fR(\fBparameter\fR);
+.SH "DESCRIPTION"
+.PP
+Full description
+.SH "EXAMPLES"
+.PP
+examples here
+.SH "SEE ALSO"
+.PP
+\fISDL_AnotherFunction\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_Rect.3 b/distrib/sdl-1.2.15/docs/man3/SDL_Rect.3
new file mode 100644
index 0000000..8db224d
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_Rect.3
@@ -0,0 +1,26 @@
+.TH "SDL_Rect" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_Rect \- Defines a rectangular area
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ Sint16 x, y;
+ Uint16 w, h;
+} SDL_Rect;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBx, y\fR
+Position of the upper-left corner of the rectangle
+.TP 20
+\fBw, h\fR
+The width and height of the rectangle
+.SH "DESCRIPTION"
+.PP
+A \fBSDL_Rect\fR defines a rectangular area of pixels\&. It is used by \fI\fBSDL_BlitSurface\fP\fR to define blitting regions and by several other video functions\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_BlitSurface\fP\fR, \fI\fBSDL_UpdateRect\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_RemoveTimer.3 b/distrib/sdl-1.2.15/docs/man3/SDL_RemoveTimer.3
new file mode 100644
index 0000000..1203c6f
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_RemoveTimer.3
@@ -0,0 +1,25 @@
+.TH "SDL_RemoveTimer" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_RemoveTimer \- Remove a timer which was added with \fISDL_AddTimer\fR\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSDL_bool \fBSDL_RemoveTimer\fP\fR(\fBSDL_TimerID id\fR);
+.SH "DESCRIPTION"
+.PP
+Removes a timer callback previously added with \fISDL_AddTimer\fR\&.
+.SH "RETURN VALUE"
+.PP
+Returns a boolean value indicating success\&.
+.SH "EXAMPLES"
+.PP
+.PP
+.nf
+\f(CWSDL_RemoveTimer(my_timer_id);\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_AddTimer\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_ResizeEvent.3 b/distrib/sdl-1.2.15/docs/man3/SDL_ResizeEvent.3
new file mode 100644
index 0000000..7b0a5e2
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_ResizeEvent.3
@@ -0,0 +1,28 @@
+.TH "SDL_ResizeEvent" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_ResizeEvent \- Window resize event structure
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ Uint8 type;
+ int w, h;
+} SDL_ResizeEvent;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBtype\fR
+\fBSDL_VIDEORESIZE\fP
+.TP 20
+\fBw\fR, \fBh\fR
+New width and height of the window
+.SH "DESCRIPTION"
+.PP
+\fBSDL_ResizeEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_VIDEORESIZE\fP is reported\&.
+.PP
+When \fBSDL_RESIZABLE\fP is passed as a \fBflag\fR to \fI\fBSDL_SetVideoMode\fP\fR the user is allowed to resize the applications window\&. When the window is resized an \fBSDL_VIDEORESIZE\fP is report, with the new window width and height values stored in \fBw\fR and \fBh\fR, respectively\&. When an \fBSDL_VIDEORESIZE\fP is received the window should be resized to the new dimensions using \fI\fBSDL_SetVideoMode\fP\fR\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Event\fR\fR, \fI\fBSDL_SetVideoMode\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_SaveBMP.3 b/distrib/sdl-1.2.15/docs/man3/SDL_SaveBMP.3
new file mode 100644
index 0000000..61e00dd
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_SaveBMP.3
@@ -0,0 +1,18 @@
+.TH "SDL_SaveBMP" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_SaveBMP \- Save an SDL_Surface as a Windows BMP file\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_SaveBMP\fP\fR(\fBSDL_Surface *surface, const char *file\fR);
+.SH "DESCRIPTION"
+.PP
+Saves the \fBSDL_Surface\fR \fBsurface\fR as a Windows BMP file named \fBfile\fR\&.
+.SH "RETURN VALUE"
+.PP
+Returns \fB0\fR if successful or \fB-1\fR if there was an error\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_LoadBMP\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_SemPost.3 b/distrib/sdl-1.2.15/docs/man3/SDL_SemPost.3
new file mode 100644
index 0000000..5487d2d
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_SemPost.3
@@ -0,0 +1,28 @@
+.TH "SDL_SemPost" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_SemPost \- Unlock a semaphore\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL_thread\&.h"
+.sp
+\fBint \fBSDL_SemPost\fP\fR(\fBSDL_sem *sem\fR);
+.SH "DESCRIPTION"
+.PP
+\fBSDL_SemPost\fP unlocks the semaphore pointed to by \fBsem\fR and atomically increments the semaphores value\&. Threads that were blocking on the semaphore may be scheduled after this call succeeds\&.
+.PP
+\fBSDL_SemPost\fP should be called after a semaphore is locked by a successful call to \fISDL_SemWait\fR, \fISDL_SemTryWait\fR or \fISDL_SemWaitTimeout\fR\&.
+.SH "RETURN VALUE"
+.PP
+Returns \fB0\fR if successful or \fB-1\fR if there was an error (leaving the semaphore unchanged)\&.
+.SH "EXAMPLES"
+.PP
+.PP
+.nf
+\f(CWSDL_SemPost(my_sem);\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CreateSemaphore\fP\fR, \fI\fBSDL_DestroySemaphore\fP\fR, \fI\fBSDL_SemWait\fP\fR, \fI\fBSDL_SemTryWait\fP\fR, \fI\fBSDL_SemWaitTimeout\fP\fR, \fI\fBSDL_SemValue\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_SemTryWait.3 b/distrib/sdl-1.2.15/docs/man3/SDL_SemTryWait.3
new file mode 100644
index 0000000..aee9aff
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_SemTryWait.3
@@ -0,0 +1,41 @@
+.TH "SDL_SemTryWait" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_SemTryWait \- Attempt to lock a semaphore but don\&'t suspend the thread\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL_thread\&.h"
+.sp
+\fBint \fBSDL_SemTryWait\fP\fR(\fBSDL_sem *sem\fR);
+.SH "DESCRIPTION"
+.PP
+\fBSDL_SemTryWait\fP is a non-blocking varient of \fI\fBSDL_SemWait\fP\fR\&. If the value of the semaphore pointed to by \fBsem\fR is positive it will atomically decrement the semaphore value and return 0, otherwise it will return \fBSDL_MUTEX_TIMEOUT\fR instead of suspending the thread\&.
+.PP
+After \fBSDL_SemTryWait\fP is successful, the semaphore can be released and its count atomically incremented by a successful call to \fISDL_SemPost\fR\&.
+.SH "RETURN VALUE"
+.PP
+Returns \fB0\fR if the semaphore was successfully locked or either \fBSDL_MUTEX_TIMEOUT\fR or \fB-1\fR if the thread would have suspended or there was an error, respectivly\&.
+.PP
+If the semaphore was not successfully locked, the semaphore will be unchanged\&.
+.SH "EXAMPLES"
+.PP
+.PP
+.nf
+\f(CWres = SDL_SemTryWait(my_sem);
+
+if (res == SDL_MUTEX_TIMEOUT) {
+ return TRY_AGAIN;
+}
+if (res == -1) {
+ return WAIT_ERROR;
+}
+
+\&.\&.\&.
+
+SDL_SemPost(my_sem);\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CreateSemaphore\fP\fR, \fI\fBSDL_DestroySemaphore\fP\fR, \fI\fBSDL_SemWait\fP\fR, \fI\fBSDL_SemWaitTimeout\fP\fR, \fI\fBSDL_SemPost\fP\fR, \fI\fBSDL_SemValue\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_SemValue.3 b/distrib/sdl-1.2.15/docs/man3/SDL_SemValue.3
new file mode 100644
index 0000000..0703143
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_SemValue.3
@@ -0,0 +1,26 @@
+.TH "SDL_SemValue" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_SemValue \- Return the current value of a semaphore\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL/SDL_thread\&.h"
+.sp
+\fBUint32 \fBSDL_SemValue\fP\fR(\fBSDL_sem *sem\fR);
+.SH "DESCRIPTION"
+.PP
+\fBSDL_SemValue()\fP returns the current semaphore value from the semaphore pointed to by \fBsem\fR\&.
+.SH "RETURN VALUE"
+.PP
+Returns current value of the semaphore\&.
+.SH "EXAMPLES"
+.PP
+.PP
+.nf
+\f(CW sem_value = SDL_SemValue(my_sem);\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CreateSemaphore\fP\fR, \fI\fBSDL_DestroySemaphore\fP\fR, \fI\fBSDL_SemWait\fP\fR, \fI\fBSDL_SemTryWait\fP\fR, \fI\fBSDL_SemWaitTimeout\fP\fR, \fI\fBSDL_SemPost\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_SemWait.3 b/distrib/sdl-1.2.15/docs/man3/SDL_SemWait.3
new file mode 100644
index 0000000..b7bba3f
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_SemWait.3
@@ -0,0 +1,34 @@
+.TH "SDL_SemWait" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_SemWait \- Lock a semaphore and suspend the thread if the semaphore value is zero\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL_thread\&.h"
+.sp
+\fBint \fBSDL_SemWait\fP\fR(\fBSDL_sem *sem\fR);
+.SH "DESCRIPTION"
+.PP
+\fBSDL_SemWait()\fP suspends the calling thread until either the semaphore pointed to by \fBsem\fR has a positive value, the call is interrupted by a signal or error\&. If the call is successful it will atomically decrement the semaphore value\&.
+.PP
+After \fBSDL_SemWait()\fP is successful, the semaphore can be released and its count atomically incremented by a successful call to \fISDL_SemPost\fR\&.
+.SH "RETURN VALUE"
+.PP
+Returns \fB0\fR if successful or \fB-1\fR if there was an error (leaving the semaphore unchanged)\&.
+.SH "EXAMPLES"
+.PP
+.PP
+.nf
+\f(CWif (SDL_SemWait(my_sem) == -1) {
+ return WAIT_FAILED;
+}
+
+\&.\&.\&.
+
+SDL_SemPost(my_sem);\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CreateSemaphore\fP\fR, \fI\fBSDL_DestroySemaphore\fP\fR, \fI\fBSDL_SemTryWait\fP\fR, \fI\fBSDL_SemWaitTimeout\fP\fR, \fI\fBSDL_SemPost\fP\fR, \fI\fBSDL_SemValue\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_SemWaitTimeout.3 b/distrib/sdl-1.2.15/docs/man3/SDL_SemWaitTimeout.3
new file mode 100644
index 0000000..8afd1cb
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_SemWaitTimeout.3
@@ -0,0 +1,41 @@
+.TH "SDL_SemWaitTimeout" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_SemWaitTimeout \- Lock a semaphore, but only wait up to a specified maximum time\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL_thread\&.h"
+.sp
+\fBint \fBSDL_SemWaitTimeout\fP\fR(\fBSDL_sem *sem, Uint32 timeout\fR);
+.SH "DESCRIPTION"
+.PP
+\fBSDL_SemWaitTimeout()\fP is a varient of \fISDL_SemWait\fR with a maximum timeout value\&. If the value of the semaphore pointed to by \fBsem\fR is positive (greater than zero) it will atomically decrement the semaphore value and return 0, otherwise it will wait up to \fBtimeout\fR milliseconds trying to lock the semaphore\&. This function is to be avoided if possible since on some platforms it is implemented by polling the semaphore every millisecond in a busy loop\&.
+.PP
+After \fBSDL_SemWaitTimeout()\fP is successful, the semaphore can be released and its count atomically incremented by a successful call to \fISDL_SemPost\fR\&.
+.SH "RETURN VALUE"
+.PP
+Returns \fB0\fR if the semaphore was successfully locked or either \fBSDL_MUTEX_TIMEOUT\fR or \fB-1\fR if the timeout period was exceeded or there was an error, respectivly\&.
+.PP
+If the semaphore was not successfully locked, the semaphore will be unchanged\&.
+.SH "EXAMPLES"
+.PP
+.PP
+.nf
+\f(CWres = SDL_SemWaitTimeout(my_sem, WAIT_TIMEOUT_MILLISEC);
+
+if (res == SDL_MUTEX_TIMEOUT) {
+ return TRY_AGAIN;
+}
+if (res == -1) {
+ return WAIT_ERROR;
+}
+
+\&.\&.\&.
+
+SDL_SemPost(my_sem);\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CreateSemaphore\fP\fR, \fI\fBSDL_DestroySemaphore\fP\fR, \fI\fBSDL_SemWait\fP\fR, \fI\fBSDL_SemTryWait\fP\fR, \fI\fBSDL_SemPost\fP\fR, \fI\fBSDL_SemValue\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_SetAlpha.3 b/distrib/sdl-1.2.15/docs/man3/SDL_SetAlpha.3
new file mode 100644
index 0000000..282ecde
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_SetAlpha.3
@@ -0,0 +1,66 @@
+.TH "SDL_SetAlpha" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_SetAlpha \- Adjust the alpha properties of a surface
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_SetAlpha\fP\fR(\fBSDL_Surface *surface, Uint32 flag, Uint8 alpha\fR);
+.SH "DESCRIPTION"
+.PP
+.RS
+\fBNote:
+.PP
+This function and the semantics of SDL alpha blending have changed since version 1\&.1\&.4\&. Up until version 1\&.1\&.5, an alpha value of 0 was considered opaque and a value of 255 was considered transparent\&. This has now been inverted: 0 (\fBSDL_ALPHA_TRANSPARENT\fP) is now considered transparent and 255 (\fBSDL_ALPHA_OPAQUE\fP) is now considered opaque\&.
+.RE
+.PP
+\fBSDL_SetAlpha\fP is used for setting the per-surface alpha value and/or enabling and disabling alpha blending\&.
+.PP
+The\fBsurface\fR parameter specifies which surface whose alpha attributes you wish to adjust\&. \fBflags\fR is used to specify whether alpha blending should be used (\fBSDL_SRCALPHA\fP) and whether the surface should use RLE acceleration for blitting (\fBSDL_RLEACCEL\fP)\&. \fBflags\fR can be an OR\&'d combination of these two options, one of these options or 0\&. If \fBSDL_SRCALPHA\fP is not passed as a flag then all alpha information is ignored when blitting the surface\&. The \fBalpha\fR parameter is the per-surface alpha value; a surface need not have an alpha channel to use per-surface alpha and blitting can still be accelerated with \fBSDL_RLEACCEL\fP\&.
+.PP
+.RS
+\fBNote:
+.PP
+The per-surface alpha value of 128 is considered a special case and is optimised, so it\&'s much faster than other per-surface values\&.
+.RE
+.PP
+Alpha effects surface blitting in the following ways:
+.TP 20
+RGBA->RGB with \fBSDL_SRCALPHA\fP
+The source is alpha-blended with the destination, using the alpha channel\&. \fBSDL_SRCCOLORKEY\fP and the per-surface alpha are ignored\&.
+.TP 20
+RGBA->RGB without \fBSDL_SRCALPHA\fP
+The RGB data is copied from the source\&. The source alpha channel and the per-surface alpha value are ignored\&.
+.TP 20
+RGB->RGBA with \fBSDL_SRCALPHA\fP
+The source is alpha-blended with the destination using the per-surface alpha value\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&. The alpha channel of the copied pixels is set to opaque\&.
+.TP 20
+RGB->RGBA without \fBSDL_SRCALPHA\fP
+The RGB data is copied from the source and the alpha value of the copied pixels is set to opaque\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&.
+.TP 20
+RGBA->RGBA with \fBSDL_SRCALPHA\fP
+The source is alpha-blended with the destination using the source alpha channel\&. The alpha channel in the destination surface is left untouched\&. \fBSDL_SRCCOLORKEY\fP is ignored\&.
+.TP 20
+RGBA->RGBA without \fBSDL_SRCALPHA\fP
+The RGBA data is copied to the destination surface\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&.
+.TP 20
+RGB->RGB with \fBSDL_SRCALPHA\fP
+The source is alpha-blended with the destination using the per-surface alpha value\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&.
+.TP 20
+RGB->RGB without \fBSDL_SRCALPHA\fP
+The RGB data is copied from the source\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&.
+.PP
+.RS
+\fBNote:
+.PP
+ Note that RGBA->RGBA blits (with SDL_SRCALPHA set) keep the alpha of the destination surface\&. This means that you cannot compose two arbitrary RGBA surfaces this way and get the result you would expect from "overlaying" them; the destination alpha will work as a mask\&.
+.PP
+Also note that per-pixel and per-surface alpha cannot be combined; the per-pixel alpha is always used if available
+.RE
+.SH "RETURN VALUE"
+.PP
+This function returns \fB0\fR, or \fB-1\fR if there was an error\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_MapRGBA\fP\fR, \fI\fBSDL_GetRGBA\fP\fR, \fI\fBSDL_DisplayFormatAlpha\fP\fR, \fI\fBSDL_BlitSurface\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_SetClipRect.3 b/distrib/sdl-1.2.15/docs/man3/SDL_SetClipRect.3
new file mode 100644
index 0000000..a1bde08
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_SetClipRect.3
@@ -0,0 +1,19 @@
+.TH "SDL_SetClipRect" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_SetClipRect \- Sets the clipping rectangle for a surface\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_SetClipRect\fP\fR(\fBSDL_Surface *surface, SDL_Rect *rect\fR);
+.SH "DESCRIPTION"
+.PP
+Sets the clipping rectangle for a surface\&. When this surface is the destination of a blit, only the area within the clip rectangle will be drawn into\&.
+.PP
+The rectangle pointed to by \fBrect\fR will be clipped to the edges of the surface so that the clip rectangle for a surface can never fall outside the edges of the surface\&.
+.PP
+If \fBrect\fR is \fBNULL\fP the clipping rectangle will be set to the full size of the surface\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_GetClipRect\fP\fR, \fI\fBSDL_BlitSurface\fP\fR, \fI\fBSDL_Surface\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_SetColorKey.3 b/distrib/sdl-1.2.15/docs/man3/SDL_SetColorKey.3
new file mode 100644
index 0000000..36f8893
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_SetColorKey.3
@@ -0,0 +1,26 @@
+.TH "SDL_SetColorKey" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_SetColorKey \- Sets the color key (transparent pixel) in a blittable surface and RLE acceleration\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_SetColorKey\fP\fR(\fBSDL_Surface *surface, Uint32 flag, Uint32 key\fR);
+.SH "DESCRIPTION"
+.PP
+ Sets the color key (transparent pixel) in a blittable surface and enables or disables RLE blit acceleration\&.
+.PP
+RLE acceleration can substantially speed up blitting of images with large horizontal runs of transparent pixels (i\&.e\&., pixels that match the \fBkey\fR value)\&. The \fBkey\fR must be of the same pixel format as the \fBsurface\fR, \fI\fBSDL_MapRGB\fP\fR is often useful for obtaining an acceptable value\&.
+.PP
+If \fBflag\fR is \fBSDL_SRCCOLORKEY\fP then \fBkey\fR is the transparent pixel value in the source image of a blit\&.
+.PP
+If \fBflag\fR is OR\&'d with \fBSDL_RLEACCEL\fP then the surface will be draw using RLE acceleration when drawn with \fISDL_BlitSurface\fR\&. The surface will actually be encoded for RLE acceleration the first time \fISDL_BlitSurface\fR or \fISDL_DisplayFormat\fR is called on the surface\&.
+.PP
+If \fBflag\fR is 0, this function clears any current color key\&.
+.SH "RETURN VALUE"
+.PP
+This function returns \fB0\fR, or \fB-1\fR if there was an error\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_BlitSurface\fP\fR, \fI\fBSDL_DisplayFormat\fP\fR, \fI\fBSDL_MapRGB\fP\fR, \fI\fBSDL_SetAlpha\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_SetColors.3 b/distrib/sdl-1.2.15/docs/man3/SDL_SetColors.3
new file mode 100644
index 0000000..7137a6c
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_SetColors.3
@@ -0,0 +1,57 @@
+.TH "SDL_SetColors" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_SetColors \- Sets a portion of the colormap for the given 8-bit surface\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_SetColors\fP\fR(\fBSDL_Surface *surface, SDL_Color *colors, int firstcolor, int ncolors\fR);
+.SH "DESCRIPTION"
+.PP
+Sets a portion of the colormap for the given 8-bit surface\&.
+.PP
+When \fBsurface\fR is the surface associated with the current display, the display colormap will be updated with the requested colors\&. If \fBSDL_HWPALETTE\fP was set in \fISDL_SetVideoMode\fR flags, \fBSDL_SetColors\fP will always return \fB1\fR, and the palette is guaranteed to be set the way you desire, even if the window colormap has to be warped or run under emulation\&.
+.PP
+The color components of a \fI\fBSDL_Color\fR\fR structure are 8-bits in size, giving you a total of 256^3 =16777216 colors\&.
+.PP
+Palettized (8-bit) screen surfaces with the \fBSDL_HWPALETTE\fP flag have two palettes, a logical palette that is used for mapping blits to/from the surface and a physical palette (that determines how the hardware will map the colors to the display)\&. \fBSDL_SetColors\fP modifies both palettes (if present), and is equivalent to calling \fISDL_SetPalette\fR with the \fBflags\fR set to \fB(SDL_LOGPAL | SDL_PHYSPAL)\fP\&.
+.SH "RETURN VALUE"
+.PP
+If \fBsurface\fR is not a palettized surface, this function does nothing, returning \fB0\fR\&. If all of the colors were set as passed to \fBSDL_SetColors\fP, it will return \fB1\fR\&. If not all the color entries were set exactly as given, it will return \fB0\fR, and you should look at the surface palette to determine the actual color palette\&.
+.SH "EXAMPLE"
+.PP
+.nf
+\f(CW/* Create a display surface with a grayscale palette */
+SDL_Surface *screen;
+SDL_Color colors[256];
+int i;
+\&.
+\&.
+\&.
+/* Fill colors with color information */
+for(i=0;i<256;i++){
+ colors[i]\&.r=i;
+ colors[i]\&.g=i;
+ colors[i]\&.b=i;
+}
+
+/* Create display */
+screen=SDL_SetVideoMode(640, 480, 8, SDL_HWPALETTE);
+if(!screen){
+ printf("Couldn\&'t set video mode: %s
+", SDL_GetError());
+ exit(-1);
+}
+
+/* Set palette */
+SDL_SetColors(screen, colors, 0, 256);
+\&.
+\&.
+\&.
+\&.\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Color\fR\fR \fI\fBSDL_Surface\fR\fR, \fI\fBSDL_SetPalette\fP\fR, \fI\fBSDL_SetVideoMode\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_SetCursor.3 b/distrib/sdl-1.2.15/docs/man3/SDL_SetCursor.3
new file mode 100644
index 0000000..78c4cf9
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_SetCursor.3
@@ -0,0 +1,15 @@
+.TH "SDL_SetCursor" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_SetCursor \- Set the currently active mouse cursor\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_SetCursor\fP\fR(\fBSDL_Cursor *cursor\fR);
+.SH "DESCRIPTION"
+.PP
+Sets the currently active cursor to the specified one\&. If the cursor is currently visible, the change will be immediately represented on the display\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_GetCursor\fP\fR, \fI\fBSDL_CreateCursor\fP\fR, \fI\fBSDL_ShowCursor\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_SetEventFilter.3 b/distrib/sdl-1.2.15/docs/man3/SDL_SetEventFilter.3
new file mode 100644
index 0000000..8d3ed03
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_SetEventFilter.3
@@ -0,0 +1,35 @@
+.TH "SDL_SetEventFilter" "3" "Tue 11 Sep 2001, 22:59" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_SetEventFilter \- Sets up a filter to process all events before they are posted to the event queue\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_SetEventFilter\fP\fR(\fBSDL_EventFilter filter\fR);
+.SH "DESCRIPTION"
+.PP
+This function sets up a filter to process all events before they are posted to the event queue\&. This is a very powerful and flexible feature\&. The filter is prototyped as:
+.PP
+.nf
+\f(CWtypedef int (*SDL_EventFilter)(const SDL_Event *event);\fR
+.fi
+.PP
+ If the filter returns \fB1\fR, then the event will be added to the internal queue\&. If it returns \fB0\fR, then the event will be dropped from the queue\&. This allows selective filtering of dynamically\&.
+.PP
+There is one caveat when dealing with the \fBSDL_QUITEVENT\fP event type\&. The event filter is only called when the window manager desires to close the application window\&. If the event filter returns 1, then the window will be closed, otherwise the window will remain open if possible\&. If the quit event is generated by an interrupt signal, it will bypass the internal queue and be delivered to the application at the next event poll\&.
+.PP
+.RS
+\fBNote:
+.PP
+Events pushed onto the queue with \fI\fBSDL_PushEvent\fP\fR or \fI\fBSDL_PeepEvents\fP\fR do not get passed through the event filter\&.
+.RE
+.PP
+.RS
+\fBNote:
+.PP
+\fIBe Careful!\fP The event filter function may run in a different thread so be careful what you do within it\&.
+.RE
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Event\fR\fR, \fI\fBSDL_GetEventFilter\fP\fR, \fI\fBSDL_PushEvent\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:59
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_SetGamma.3 b/distrib/sdl-1.2.15/docs/man3/SDL_SetGamma.3
new file mode 100644
index 0000000..4897272
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_SetGamma.3
@@ -0,0 +1,22 @@
+.TH "SDL_SetGamma" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_SetGamma \- Sets the color gamma function for the display
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_SetGamma\fP\fR(\fBfloat redgamma, float greengamma, float bluegamma\fR);
+.SH "DESCRIPTION"
+.PP
+Sets the "gamma function" for the display of each color component\&. Gamma controls the brightness/contrast of colors displayed on the screen\&. A gamma value of 1\&.0 is identity (i\&.e\&., no adjustment is made)\&.
+.PP
+This function adjusts the gamma based on the "gamma function" parameter, you can directly specify lookup tables for gamma adjustment with \fISDL_SetGammaRamp\fR\&.
+.PP
+Not all display hardware is able to change gamma\&.
+.SH "RETURN VALUE"
+.PP
+Returns -1 on error (or if gamma adjustment is not supported)\&.
+.SH "SEE ALSO"
+.PP
+\fISDL_GetGammaRamp\fR \fISDL_SetGammaRamp\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_SetGammaRamp.3 b/distrib/sdl-1.2.15/docs/man3/SDL_SetGammaRamp.3
new file mode 100644
index 0000000..52bf9f5
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_SetGammaRamp.3
@@ -0,0 +1,22 @@
+.TH "SDL_SetGammaRamp" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_SetGammaRamp \- Sets the color gamma lookup tables for the display
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_SetGammaRamp\fP\fR(\fBUint16 *redtable, Uint16 *greentable, Uint16 *bluetable\fR);
+.SH "DESCRIPTION"
+.PP
+Sets the gamma lookup tables for the display for each color component\&. Each table is an array of 256 Uint16 values, representing a mapping between the input and output for that channel\&. The input is the index into the array, and the output is the 16-bit gamma value at that index, scaled to the output color precision\&. You may pass NULL to any of the channels to leave them unchanged\&.
+.PP
+This function adjusts the gamma based on lookup tables, you can also have the gamma calculated based on a "gamma function" parameter with \fISDL_SetGamma\fR\&.
+.PP
+Not all display hardware is able to change gamma\&.
+.SH "RETURN VALUE"
+.PP
+Returns -1 on error (or if gamma adjustment is not supported)\&.
+.SH "SEE ALSO"
+.PP
+\fISDL_SetGamma\fR \fISDL_GetGammaRamp\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_SetModState.3 b/distrib/sdl-1.2.15/docs/man3/SDL_SetModState.3
new file mode 100644
index 0000000..f356ca1
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_SetModState.3
@@ -0,0 +1,35 @@
+.TH "SDL_SetModState" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_SetModState \- Set the current key modifier state
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_SetModState\fP\fR(\fBSDLMod modstate\fR);
+.SH "DESCRIPTION"
+.PP
+The inverse of \fI\fBSDL_GetModState\fP\fR, \fBSDL_SetModState\fP allows you to impose modifier key states on your application\&.
+.PP
+Simply pass your desired modifier states into \fBmodstate\fR\&. This value my be a logical OR\&'d combination of the following:
+.PP
+.nf
+\f(CWtypedef enum {
+ KMOD_NONE = 0x0000,
+ KMOD_LSHIFT= 0x0001,
+ KMOD_RSHIFT= 0x0002,
+ KMOD_LCTRL = 0x0040,
+ KMOD_RCTRL = 0x0080,
+ KMOD_LALT = 0x0100,
+ KMOD_RALT = 0x0200,
+ KMOD_LMETA = 0x0400,
+ KMOD_RMETA = 0x0800,
+ KMOD_NUM = 0x1000,
+ KMOD_CAPS = 0x2000,
+ KMOD_MODE = 0x4000,
+} SDLMod;\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_GetModState\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_SetPalette.3 b/distrib/sdl-1.2.15/docs/man3/SDL_SetPalette.3
new file mode 100644
index 0000000..a2ca3f6
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_SetPalette.3
@@ -0,0 +1,59 @@
+.TH "SDL_SetPalette" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_SetPalette \- Sets the colors in the palette of an 8-bit surface\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_SetPalette\fP\fR(\fBSDL_Surface *surface, int flags, SDL_Color *colors, int firstcolor, int ncolors\fR);
+.SH "DESCRIPTION"
+.PP
+Sets a portion of the palette for the given 8-bit surface\&.
+.PP
+Palettized (8-bit) screen surfaces with the \fBSDL_HWPALETTE\fP flag have two palettes, a logical palette that is used for mapping blits to/from the surface and a physical palette (that determines how the hardware will map the colors to the display)\&. \fISDL_BlitSurface\fR always uses the logical palette when blitting surfaces (if it has to convert between surface pixel formats)\&. Because of this, it is often useful to modify only one or the other palette to achieve various special color effects (e\&.g\&., screen fading, color flashes, screen dimming)\&.
+.PP
+This function can modify either the logical or physical palette by specifing \fBSDL_LOGPAL\fP or \fBSDL_PHYSPAL\fPthe in the \fBflags\fR parameter\&.
+.PP
+When \fBsurface\fR is the surface associated with the current display, the display colormap will be updated with the requested colors\&. If \fBSDL_HWPALETTE\fP was set in \fISDL_SetVideoMode\fR flags, \fBSDL_SetPalette\fP will always return \fB1\fR, and the palette is guaranteed to be set the way you desire, even if the window colormap has to be warped or run under emulation\&.
+.PP
+The color components of a \fI\fBSDL_Color\fR\fR structure are 8-bits in size, giving you a total of 256^3=16777216 colors\&.
+.SH "RETURN VALUE"
+.PP
+If \fBsurface\fR is not a palettized surface, this function does nothing, returning \fB0\fR\&. If all of the colors were set as passed to \fBSDL_SetPalette\fP, it will return \fB1\fR\&. If not all the color entries were set exactly as given, it will return \fB0\fR, and you should look at the surface palette to determine the actual color palette\&.
+.SH "EXAMPLE"
+.PP
+.nf
+\f(CW /* Create a display surface with a grayscale palette */
+ SDL_Surface *screen;
+ SDL_Color colors[256];
+ int i;
+ \&.
+ \&.
+ \&.
+ /* Fill colors with color information */
+ for(i=0;i<256;i++){
+ colors[i]\&.r=i;
+ colors[i]\&.g=i;
+ colors[i]\&.b=i;
+ }
+
+ /* Create display */
+ screen=SDL_SetVideoMode(640, 480, 8, SDL_HWPALETTE);
+ if(!screen){
+ printf("Couldn\&'t set video mode: %s
+", SDL_GetError());
+ exit(-1);
+ }
+
+ /* Set palette */
+ SDL_SetPalette(screen, SDL_LOGPAL|SDL_PHYSPAL, colors, 0, 256);
+ \&.
+ \&.
+ \&.
+ \&.\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fISDL_SetColors\fR, \fISDL_SetVideoMode\fR, \fISDL_Surface\fR, \fISDL_Color\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_SetTimer.3 b/distrib/sdl-1.2.15/docs/man3/SDL_SetTimer.3
new file mode 100644
index 0000000..418ac86
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_SetTimer.3
@@ -0,0 +1,39 @@
+.TH "SDL_SetTimer" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_SetTimer \- Set a callback to run after the specified number of milliseconds has elapsed\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_SetTimer\fP\fR(\fBUint32 interval, SDL_TimerCallback callback\fR);
+.SH "CALLBACK"
+.PP
+/* Function prototype for the timer callback function */ typedef Uint32 (*SDL_TimerCallback)(Uint32 interval);
+.SH "DESCRIPTION"
+.PP
+Set a callback to run after the specified number of milliseconds has elapsed\&. The callback function is passed the current timer interval and returns the next timer interval\&. If the returned value is the same as the one passed in, the periodic alarm continues, otherwise a new alarm is scheduled\&.
+.PP
+To cancel a currently running timer, call \fBSDL_SetTimer(0, NULL);\fP
+.PP
+The timer callback function may run in a different thread than your main constant, and so shouldn\&'t call any functions from within itself\&.
+.PP
+The maximum resolution of this timer is 10 ms, which means that if you request a 16 ms timer, your callback will run approximately 20 ms later on an unloaded system\&. If you wanted to set a flag signaling a frame update at 30 frames per second (every 33 ms), you might set a timer for 30 ms (see example below)\&.
+.PP
+If you use this function, you need to pass \fBSDL_INIT_TIMER\fP to \fBSDL_Init()\fP\&.
+.PP
+.RS
+\fBNote:
+.PP
+This function is kept for compatibility but has been superseded by the new timer functions \fISDL_AddTimer\fR and \fISDL_RemoveTimer\fR which support multiple timers\&.
+.RE
+.SH "EXAMPLES"
+.PP
+.PP
+.nf
+\f(CWSDL_SetTimer((33/10)*10, my_callback);\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_AddTimer\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_SetVideoMode.3 b/distrib/sdl-1.2.15/docs/man3/SDL_SetVideoMode.3
new file mode 100644
index 0000000..95defb1
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_SetVideoMode.3
@@ -0,0 +1,67 @@
+.TH "SDL_SetVideoMode" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_SetVideoMode \- Set up a video mode with the specified width, height and bits-per-pixel\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSDL_Surface *\fBSDL_SetVideoMode\fP\fR(\fBint width, int height, int bpp, Uint32 flags\fR);
+.SH "DESCRIPTION"
+.PP
+Set up a video mode with the specified width, height and bits-per-pixel\&.
+.PP
+If \fBbpp\fR is 0, it is treated as the current display bits per pixel\&.
+.PP
+The \fBflags\fR parameter is the same as the \fBflags\fR field of the \fI\fBSDL_Surface\fR\fR structure\&. OR\&'d combinations of the following values are valid\&.
+.TP 20
+\fBSDL_SWSURFACE\fP
+Create the video surface in system memory
+.TP 20
+\fBSDL_HWSURFACE\fP
+Create the video surface in video memory
+.TP 20
+\fBSDL_ASYNCBLIT\fP
+Enables the use of asynchronous updates of the display surface\&. This will usually slow down blitting on single CPU machines, but may provide a speed increase on SMP systems\&.
+.TP 20
+\fBSDL_ANYFORMAT\fP
+Normally, if a video surface of the requested bits-per-pixel (\fBbpp\fR) is not available, SDL will emulate one with a shadow surface\&. Passing \fBSDL_ANYFORMAT\fP prevents this and causes SDL to use the video surface, regardless of its pixel depth\&.
+.TP 20
+\fBSDL_HWPALETTE\fP
+Give SDL exclusive palette access\&. Without this flag you may not always get the the colors you request with \fI\fBSDL_SetColors\fP\fR or \fI\fBSDL_SetPalette\fP\fR\&.
+.TP 20
+\fBSDL_DOUBLEBUF\fP
+Enable hardware double buffering; only valid with SDL_HWSURFACE\&. Calling \fI\fBSDL_Flip\fP\fR will flip the buffers and update the screen\&. All drawing will take place on the surface that is not displayed at the moment\&. If double buffering could not be enabled then \fBSDL_Flip\fP will just perform a \fI\fBSDL_UpdateRect\fP\fR on the entire screen\&.
+.TP 20
+\fBSDL_FULLSCREEN\fP
+SDL will attempt to use a fullscreen mode\&. If a hardware resolution change is not possible (for whatever reason), the next higher resolution will be used and the display window centered on a black background\&.
+.TP 20
+\fBSDL_OPENGL\fP
+Create an OpenGL rendering context\&. You should have previously set OpenGL video attributes with \fI\fBSDL_GL_SetAttribute\fP\fR\&.
+.TP 20
+\fBSDL_OPENGLBLIT\fP
+Create an OpenGL rendering context, like above, but allow normal blitting operations\&. The screen (2D) surface may have an alpha channel, and \fI\fBSDL_UpdateRects\fP\fR must be used for updating changes to the screen surface\&.
+.TP 20
+\fBSDL_RESIZABLE\fP
+Create a resizable window\&. When the window is resized by the user a \fI\fBSDL_VIDEORESIZE\fP\fR event is generated and \fBSDL_SetVideoMode\fP can be called again with the new size\&.
+.TP 20
+\fBSDL_NOFRAME\fP
+If possible, \fBSDL_NOFRAME\fP causes SDL to create a window with no title bar or frame decoration\&. Fullscreen modes automatically have this flag set\&.
+.PP
+.RS
+\fBNote:
+.PP
+Whatever \fBflags\fR \fBSDL_SetVideoMode\fP could satisfy are set in the \fBflags\fR member of the returned surface\&.
+.RE
+.PP
+.RS
+\fBNote:
+.PP
+The \fBbpp\fR parameter is the number of bits per pixel, so a \fBbpp\fR of 24 uses the packed representation of 3 bytes/pixel\&. For the more common 4 bytes/pixel mode, use a \fBbpp\fR of 32\&. Somewhat oddly, both 15 and 16 will request a 2 bytes/pixel mode, but different pixel formats\&.
+.RE
+.SH "RETURN VALUE"
+.PP
+The framebuffer surface, or \fBNULL\fR if it fails\&. The surface returned is freed by SDL_Quit() and should nt be freed by the caller\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_LockSurface\fP\fR, \fI\fBSDL_SetColors\fP\fR, \fI\fBSDL_Flip\fP\fR, \fI\fBSDL_Surface\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_ShowCursor.3 b/distrib/sdl-1.2.15/docs/man3/SDL_ShowCursor.3
new file mode 100644
index 0000000..0376415
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_ShowCursor.3
@@ -0,0 +1,20 @@
+.TH "SDL_ShowCursor" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_ShowCursor \- Toggle whether or not the cursor is shown on the screen\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_ShowCursor\fP\fR(\fBint toggle\fR);
+.SH "DESCRIPTION"
+.PP
+Toggle whether or not the cursor is shown on the screen\&. Passing \fBSDL_ENABLE\fP displays the cursor and passing \fBSDL_DISABLE\fP hides it\&. The current state of the mouse cursor can be queried by passing \fBSDL_QUERY\fP, either \fBSDL_DISABLE\fP or \fBSDL_ENABLE\fP will be returned\&.
+.PP
+The cursor starts off displayed, but can be turned off\&.
+.SH "RETURN VALUE"
+.PP
+Returns the current state of the cursor\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CreateCursor\fP\fR, \fI\fBSDL_SetCursor\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_Surface.3 b/distrib/sdl-1.2.15/docs/man3/SDL_Surface.3
new file mode 100644
index 0000000..03d6ff9
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_Surface.3
@@ -0,0 +1,96 @@
+.TH "SDL_Surface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_Surface \- Graphical Surface Structure
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct SDL_Surface {
+ Uint32 flags; /* Read-only */
+ SDL_PixelFormat *format; /* Read-only */
+ int w, h; /* Read-only */
+ Uint16 pitch; /* Read-only */
+ void *pixels; /* Read-write */
+
+ /* clipping information */
+ SDL_Rect clip_rect; /* Read-only */
+
+ /* Reference count -- used when freeing surface */
+ int refcount; /* Read-mostly */
+
+ /* This structure also contains private fields not shown here */
+} SDL_Surface;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBflags\fR
+Surface flags
+.TP 20
+\fBformat\fR
+Pixel \fIformat\fR
+.TP 20
+\fBw, h\fR
+Width and height of the surface
+.TP 20
+\fBpitch\fR
+Length of a surface scanline in bytes
+.TP 20
+\fBpixels\fR
+Pointer to the actual pixel data
+.TP 20
+\fBclip_rect\fR
+surface clip \fIrectangle\fR
+.SH "DESCRIPTION"
+.PP
+\fBSDL_Surface\fR\&'s represent areas of "graphical" memory, memory that can be drawn to\&. The video framebuffer is returned as a \fBSDL_Surface\fR by \fI\fBSDL_SetVideoMode\fP\fR and \fI\fBSDL_GetVideoSurface\fP\fR\&. Most of the fields should be pretty obvious\&. \fBw\fR and \fBh\fR are the width and height of the surface in pixels\&. \fBpixels\fR is a pointer to the actual pixel data, the surface should be \fIlocked\fR before accessing this field\&. The \fBclip_rect\fR field is the clipping rectangle as set by \fI\fBSDL_SetClipRect\fP\fR\&.
+.PP
+The following are supported in the \fBflags\fR field\&.
+.TP 20
+\fBSDL_SWSURFACE\fP
+Surface is stored in system memory
+.TP 20
+\fBSDL_HWSURFACE\fP
+Surface is stored in video memory
+.TP 20
+\fBSDL_ASYNCBLIT\fP
+Surface uses asynchronous blits if possible
+.TP 20
+\fBSDL_ANYFORMAT\fP
+Allows any pixel-format (Display surface)
+.TP 20
+\fBSDL_HWPALETTE\fP
+Surface has exclusive palette
+.TP 20
+\fBSDL_DOUBLEBUF\fP
+Surface is double buffered (Display surface)
+.TP 20
+\fBSDL_FULLSCREEN\fP
+Surface is full screen (Display Surface)
+.TP 20
+\fBSDL_OPENGL\fP
+Surface has an OpenGL context (Display Surface)
+.TP 20
+\fBSDL_OPENGLBLIT\fP
+Surface supports OpenGL blitting (Display Surface)
+.TP 20
+\fBSDL_RESIZABLE\fP
+Surface is resizable (Display Surface)
+.TP 20
+\fBSDL_HWACCEL\fP
+Surface blit uses hardware acceleration
+.TP 20
+\fBSDL_SRCCOLORKEY\fP
+Surface use colorkey blitting
+.TP 20
+\fBSDL_RLEACCEL\fP
+Colorkey blitting is accelerated with RLE
+.TP 20
+\fBSDL_SRCALPHA\fP
+Surface blit uses alpha blending
+.TP 20
+\fBSDL_PREALLOC\fP
+Surface uses preallocated memory
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_PixelFormat\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_SysWMEvent.3 b/distrib/sdl-1.2.15/docs/man3/SDL_SysWMEvent.3
new file mode 100644
index 0000000..ca1b7ab
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_SysWMEvent.3
@@ -0,0 +1,21 @@
+.TH "SDL_SysWMEvent" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_SysWMEvent \- Platform-dependent window manager event\&.
+.SH "DESCRIPTION"
+.PP
+The system window manager event contains a pointer to system-specific information about unknown window manager events\&. If you enable this event using \fI\fBSDL_EventState()\fP\fR, it will be generated whenever unhandled events are received from the window manager\&. This can be used, for example, to implement cut-and-paste in your application\&.
+.PP
+.nf
+\f(CWtypedef struct {
+ Uint8 type; /* Always SDL_SysWM */
+ } SDL_SysWMEvent;\fR
+.fi
+.PP
+ If you want to obtain system-specific information about the window manager, you can fill the version member of a \fBSDL_SysWMinfo\fR structure (details can be found in \fBSDL_syswm\&.h\fP, which must be included) using the \fBSDL_VERSION()\fP macro found in \fBSDL_version\&.h\fP, and pass it to the function:
+.PP
+.sp
+\fBint \fBSDL_GetWMInfo\fP\fR(\fBSDL_SysWMinfo *info\fR);
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_EventState\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_ThreadID.3 b/distrib/sdl-1.2.15/docs/man3/SDL_ThreadID.3
new file mode 100644
index 0000000..10e2cf8
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_ThreadID.3
@@ -0,0 +1,13 @@
+.TH "SDL_ThreadID" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_ThreadID \- Get the 32-bit thread identifier for the current thread\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL_thread\&.h"
+.sp
+\fBUint32 \fBSDL_ThreadID\fP\fR(\fBvoid\fR)
+.SH "DESCRIPTION"
+.PP
+Get the 32-bit thread identifier for the current thread\&.
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_UnlockAudio.3 b/distrib/sdl-1.2.15/docs/man3/SDL_UnlockAudio.3
new file mode 100644
index 0000000..8506319
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_UnlockAudio.3
@@ -0,0 +1,15 @@
+.TH "SDL_UnlockAudio" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_UnlockAudio \- Unlock the callback function
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_UnlockAudio\fP\fR(\fBvoid\fR)
+.SH "DESCRIPTION"
+.PP
+Unlocks a previous \fI\fBSDL_LockAudio\fP\fR call\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_OpenAudio\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_UnlockSurface.3 b/distrib/sdl-1.2.15/docs/man3/SDL_UnlockSurface.3
new file mode 100644
index 0000000..a3fe5c9
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_UnlockSurface.3
@@ -0,0 +1,17 @@
+.TH "SDL_UnlockSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_UnlockSurface \- Unlocks a previously locked surface\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_UnlockSurface\fP\fR(\fBSDL_Surface *surface\fR);
+.SH "DESCRIPTION"
+.PP
+Surfaces that were previously locked using \fBSDL_LockSurface\fP must be unlocked with \fBSDL_UnlockSurface\fP\&. Surfaces should be unlocked as soon as possible\&.
+.PP
+It should be noted that since 1\&.1\&.8, surface locks are recursive\&. See \fI\fBSDL_LockSurface\fP\fR\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_LockSurface\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_UnlockYUVOverlay.3 b/distrib/sdl-1.2.15/docs/man3/SDL_UnlockYUVOverlay.3
new file mode 100644
index 0000000..1e6b721
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_UnlockYUVOverlay.3
@@ -0,0 +1,15 @@
+.TH "SDL_UnlockYUVOverlay" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_UnlockYUVOverlay \- Unlock an overlay
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_UnlockYUVOverlay\fP\fR(\fBSDL_Overlay *overlay\fR);
+.SH "DESCRIPTION"
+.PP
+The opposite to \fI\fBSDL_LockYUVOverlay\fP\fR\&. Unlocks a previously locked overlay\&. An overlay must be unlocked before it can be displayed\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_UnlockYUVOverlay\fP\fR, \fI\fBSDL_CreateYUVOverlay\fP\fR, \fI\fBSDL_Overlay\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_UpdateRect.3 b/distrib/sdl-1.2.15/docs/man3/SDL_UpdateRect.3
new file mode 100644
index 0000000..a101a83
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_UpdateRect.3
@@ -0,0 +1,19 @@
+.TH "SDL_UpdateRect" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_UpdateRect \- Makes sure the given area is updated on the given screen\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_UpdateRect\fP\fR(\fBSDL_Surface *screen, Sint32 x, Sint32 y, Sint32 w, Sint32 h\fR);
+.SH "DESCRIPTION"
+.PP
+Makes sure the given area is updated on the given screen\&. The rectangle must be confined within the screen boundaries (no clipping is done)\&.
+.PP
+If \&'\fBx\fR\&', \&'\fBy\fR\&', \&'\fBw\fR\&' and \&'\fBh\fR\&' are all 0, \fBSDL_UpdateRect\fP will update the entire screen\&.
+.PP
+This function should not be called while \&'\fBscreen\fR\&' is \fIlocked\fR\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_UpdateRects\fP\fR, \fI\fBSDL_Rect\fR\fR, \fI\fBSDL_Surface\fR\fR, \fI\fBSDL_LockSurface\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_UpdateRects.3 b/distrib/sdl-1.2.15/docs/man3/SDL_UpdateRects.3
new file mode 100644
index 0000000..9ffdb08
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_UpdateRects.3
@@ -0,0 +1,25 @@
+.TH "SDL_UpdateRects" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_UpdateRects \- Makes sure the given list of rectangles is updated on the given screen\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_UpdateRects\fP\fR(\fBSDL_Surface *screen, int numrects, SDL_Rect *rects\fR);
+.SH "DESCRIPTION"
+.PP
+Makes sure the given list of rectangles is updated on the given screen\&. The rectangles must all be confined within the screen boundaries (no clipping is done)\&.
+.PP
+This function should not be called while \fBscreen\fR is \fIlocked\fR\&.
+.PP
+.RS
+\fBNote:
+.PP
+It is adviced to call this function only once per frame, since each call has some processing overhead\&. This is no restriction since you can pass any number of rectangles each time\&.
+.PP
+The rectangles are not automatically merged or checked for overlap\&. In general, the programmer can use his knowledge about his particular rectangles to merge them in an efficient way, to avoid overdraw\&.
+.RE
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_UpdateRect\fP\fR, \fI\fBSDL_Rect\fR\fR, \fI\fBSDL_Surface\fR\fR, \fI\fBSDL_LockSurface\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_UserEvent.3 b/distrib/sdl-1.2.15/docs/man3/SDL_UserEvent.3
new file mode 100644
index 0000000..d92ec53
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_UserEvent.3
@@ -0,0 +1,47 @@
+.TH "SDL_UserEvent" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_UserEvent \- A user-defined event type
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ Uint8 type;
+ int code;
+ void *data1;
+ void *data2;
+} SDL_UserEvent;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBtype\fR
+\fBSDL_USEREVENT\fP through to \fBSDL_NUMEVENTS-1\fP
+.TP 20
+\fBcode\fR
+User defined event code
+.TP 20
+\fBdata1\fR
+User defined data pointer
+.TP 20
+\fBdata2\fR
+User defined data pointer
+.SH "DESCRIPTION"
+.PP
+\fBSDL_UserEvent\fR is in the \fBuser\fR member of the structure \fI\fBSDL_Event\fR\fR\&. This event is unique, it is never created by SDL but only by the user\&. The event can be pushed onto the event queue using \fI\fBSDL_PushEvent\fP\fR\&. The contents of the structure members or completely up to the programmer, the only requirement is that \fBtype\fR is a value from \fBSDL_USEREVENT\fP to \fBSDL_NUMEVENTS-1\fP (inclusive)\&.
+.SH "EXAMPLES"
+.PP
+.PP
+.nf
+\f(CWSDL_Event event;
+
+event\&.type = SDL_USEREVENT;
+event\&.user\&.code = my_event_code;
+event\&.user\&.data1 = significant_data;
+event\&.user\&.data2 = 0;
+SDL_PushEvent(&event);\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Event\fR\fR, \fI\fBSDL_PushEvent\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_VideoDriverName.3 b/distrib/sdl-1.2.15/docs/man3/SDL_VideoDriverName.3
new file mode 100644
index 0000000..e8563b6
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_VideoDriverName.3
@@ -0,0 +1,18 @@
+.TH "SDL_VideoDriverName" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_VideoDriverName \- Obtain the name of the video driver
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBchar *\fBSDL_VideoDriverName\fP\fR(\fBchar *namebuf, int maxlen\fR);
+.SH "DESCRIPTION"
+.PP
+The buffer pointed to by \fBnamebuf\fR is filled up to a maximum of \fBmaxlen\fR characters (include the NULL terminator) with the name of the initialised video driver\&. The driver name is a simple one word identifier like "x11" or "windib"\&.
+.SH "RETURN VALUE"
+.PP
+Returns \fBNULL\fP if video has not been initialised with \fBSDL_Init\fP or a pointer to \fBnamebuf\fR otherwise\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Init\fP\fR \fI\fBSDL_InitSubSystem\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_VideoInfo.3 b/distrib/sdl-1.2.15/docs/man3/SDL_VideoInfo.3
new file mode 100644
index 0000000..c62e1ff
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_VideoInfo.3
@@ -0,0 +1,62 @@
+.TH "SDL_VideoInfo" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_VideoInfo \- Video Target information
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ Uint32 hw_available:1;
+ Uint32 wm_available:1;
+ Uint32 blit_hw:1;
+ Uint32 blit_hw_CC:1;
+ Uint32 blit_hw_A:1;
+ Uint32 blit_sw:1;
+ Uint32 blit_sw_CC:1;
+ Uint32 blit_sw_A:1;
+ Uint32 blit_fill;
+ Uint32 video_mem;
+ SDL_PixelFormat *vfmt;
+} SDL_VideoInfo;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBhw_available\fR
+Is it possible to create hardware surfaces?
+.TP 20
+\fBwm_available\fR
+Is there a window manager available
+.TP 20
+\fBblit_hw\fR
+Are hardware to hardware blits accelerated?
+.TP 20
+\fBblit_hw_CC\fR
+Are hardware to hardware colorkey blits accelerated?
+.TP 20
+\fBblit_hw_A\fR
+Are hardware to hardware alpha blits accelerated?
+.TP 20
+\fBblit_sw\fR
+Are software to hardware blits accelerated?
+.TP 20
+\fBblit_sw_CC\fR
+Are software to hardware colorkey blits accelerated?
+.TP 20
+\fBblit_sw_A\fR
+Are software to hardware alpha blits accelerated?
+.TP 20
+\fBblit_fill\fR
+Are color fills accelerated?
+.TP 20
+\fBvideo_mem\fR
+Total amount of video memory in Kilobytes
+.TP 20
+\fBvfmt\fR
+\fIPixel format\fR of the video device
+.SH "DESCRIPTION"
+.PP
+This (read-only) structure is returned by \fI\fBSDL_GetVideoInfo\fP\fR\&. It contains information on either the \&'best\&' available mode (if called before \fI\fBSDL_SetVideoMode\fP\fR) or the current video mode\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_PixelFormat\fR\fR, \fI\fBSDL_GetVideoInfo\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_VideoModeOK.3 b/distrib/sdl-1.2.15/docs/man3/SDL_VideoModeOK.3
new file mode 100644
index 0000000..72c9a90
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_VideoModeOK.3
@@ -0,0 +1,44 @@
+.TH "SDL_VideoModeOK" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_VideoModeOK \- Check to see if a particular video mode is supported\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_VideoModeOK\fP\fR(\fBint width, int height, int bpp, Uint32 flags\fR);
+.SH "DESCRIPTION"
+.PP
+\fBSDL_VideoModeOK\fP returns \fB0\fR if the requested mode is not supported under any bit depth, or returns the bits-per-pixel of the closest available mode with the given width, height and requested \fIsurface\fR flags (see \fI\fBSDL_SetVideoMode\fP\fR)\&.
+.PP
+The bits-per-pixel value returned is only a suggested mode\&. You can usually request and bpp you want when \fIsetting\fR the video mode and SDL will emulate that color depth with a shadow video surface\&.
+.PP
+The arguments to \fBSDL_VideoModeOK\fP are the same ones you would pass to \fISDL_SetVideoMode\fR
+.SH "EXAMPLE"
+.PP
+.nf
+\f(CWSDL_Surface *screen;
+Uint32 bpp;
+\&.
+\&.
+\&.
+printf("Checking mode 640x480@16bpp\&.
+");
+bpp=SDL_VideoModeOK(640, 480, 16, SDL_HWSURFACE);
+
+if(!bpp){
+ printf("Mode not available\&.
+");
+ exit(-1);
+}
+
+printf("SDL Recommends 640x480@%dbpp\&.
+", bpp);
+screen=SDL_SetVideoMode(640, 480, bpp, SDL_HWSURFACE);
+\&.
+\&.\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_GetVideoInfo\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_WM_GetCaption.3 b/distrib/sdl-1.2.15/docs/man3/SDL_WM_GetCaption.3
new file mode 100644
index 0000000..68ed8b2
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_WM_GetCaption.3
@@ -0,0 +1,15 @@
+.TH "SDL_WM_GetCaption" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_WM_GetCaption \- Gets the window title and icon name\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_WM_GetCaption\fP\fR(\fBchar **title, char **icon\fR);
+.SH "DESCRIPTION"
+.PP
+Set pointers to the window \fBtitle\fR and \fBicon\fR name\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_WM_SetCaption\fP\fR, \fI\fBSDL_WM_SetIcon\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_WM_GrabInput.3 b/distrib/sdl-1.2.15/docs/man3/SDL_WM_GrabInput.3
new file mode 100644
index 0000000..556681e
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_WM_GrabInput.3
@@ -0,0 +1,28 @@
+.TH "SDL_WM_GrabInput" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_WM_GrabInput \- Grabs mouse and keyboard input\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBSDL_GrabMode \fBSDL_WM_GrabInput\fP\fR(\fBSDL_GrabMode mode\fR);
+.SH "DESCRIPTION"
+.PP
+Grabbing means that the mouse is confined to the application window, and nearly all keyboard input is passed directly to the application, and not interpreted by a window manager, if any\&.
+.PP
+When \fBmode\fR is \fBSDL_GRAB_QUERY\fP the grab mode is not changed, but the current grab mode is returned\&.
+.PP
+.PP
+.nf
+\f(CWtypedef enum {
+ SDL_GRAB_QUERY,
+ SDL_GRAB_OFF,
+ SDL_GRAB_ON
+} SDL_GrabMode;\fR
+.fi
+.PP
+
+.SH "RETURN VALUE"
+.PP
+The current/new \fBSDL_GrabMode\fR\&.
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_WM_IconifyWindow.3 b/distrib/sdl-1.2.15/docs/man3/SDL_WM_IconifyWindow.3
new file mode 100644
index 0000000..922df8f
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_WM_IconifyWindow.3
@@ -0,0 +1,15 @@
+.TH "SDL_WM_IconifyWindow" "3" "Tue 11 Sep 2001, 23:02" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_WM_IconifyWindow \- Iconify/Minimise the window
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_WM_IconifyWindow\fP\fR(\fBvoid\fR);
+.SH "DESCRIPTION"
+.PP
+If the application is running in a window managed environment SDL attempts to iconify/minimise it\&. If \fBSDL_WM_IconifyWindow\fP is successful, the application will receive a \fI\fBSDL_APPACTIVE\fP\fR loss event\&.
+.SH "RETURN VALUE"
+.PP
+Returns non-zero on success or \fB0\fR if iconification is not support or was refused by the window manager\&.
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:02
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_WM_SetCaption.3 b/distrib/sdl-1.2.15/docs/man3/SDL_WM_SetCaption.3
new file mode 100644
index 0000000..847ff5d
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_WM_SetCaption.3
@@ -0,0 +1,15 @@
+.TH "SDL_WM_SetCaption" "3" "Tue 11 Sep 2001, 23:02" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_WM_SetCaption \- Sets the window tile and icon name\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_WM_SetCaption\fP\fR(\fBconst char *title, const char *icon\fR);
+.SH "DESCRIPTION"
+.PP
+Sets the title-bar and icon name of the display window\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_WM_GetCaption\fP\fR, \fI\fBSDL_WM_SetIcon\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:02
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_WM_SetIcon.3 b/distrib/sdl-1.2.15/docs/man3/SDL_WM_SetIcon.3
new file mode 100644
index 0000000..3f3a519
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_WM_SetIcon.3
@@ -0,0 +1,27 @@
+.TH "SDL_WM_SetIcon" "3" "Tue 11 Sep 2001, 23:02" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_WM_SetIcon \- Sets the icon for the display window\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_WM_SetIcon\fP\fR(\fBSDL_Surface *icon, Uint8 *mask\fR);
+.SH "DESCRIPTION"
+.PP
+Sets the icon for the display window\&. Win32 icons must be 32x32\&.
+.PP
+This function must be called before the first call to \fISDL_SetVideoMode\fR\&.
+.PP
+It takes an \fBicon\fR surface, and a \fBmask\fR in MSB format\&.
+.PP
+If \fBmask\fR is \fBNULL\fP, the entire icon surface will be used as the icon\&.
+.SH "EXAMPLE"
+.PP
+.nf
+\f(CWSDL_WM_SetIcon(SDL_LoadBMP("icon\&.bmp"), NULL);\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_WM_SetCaption\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:02
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_WM_ToggleFullScreen.3 b/distrib/sdl-1.2.15/docs/man3/SDL_WM_ToggleFullScreen.3
new file mode 100644
index 0000000..d4cf8de
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_WM_ToggleFullScreen.3
@@ -0,0 +1,15 @@
+.TH "SDL_WM_ToggleFullScreen" "3" "Tue 11 Sep 2001, 23:02" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_WM_ToggleFullScreen \- Toggles fullscreen mode
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_WM_ToggleFullScreen\fP\fR(\fBSDL_Surface *surface\fR);
+.SH "DESCRIPTION"
+.PP
+Toggles the application between windowed and fullscreen mode, if supported\&. (X11 is the only target currently supported, BeOS support is experimental)\&.
+.SH "RETURN VALUE"
+.PP
+Returns \fB0\fR on failure or \fB1\fR on success\&.
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:02
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_WaitEvent.3 b/distrib/sdl-1.2.15/docs/man3/SDL_WaitEvent.3
new file mode 100644
index 0000000..adadb4a
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_WaitEvent.3
@@ -0,0 +1,17 @@
+.TH "SDL_WaitEvent" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_WaitEvent \- Waits indefinitely for the next available event\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_WaitEvent\fP\fR(\fBSDL_Event *event\fR);
+.SH "DESCRIPTION"
+.PP
+Waits indefinitely for the next available event, returning \fB1\fR, or \fB0\fR if there was an error while waiting for events\&.
+.PP
+If \fBevent\fR is not \fBNULL\fP, the next event is removed from the queue and stored in that area\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Event\fR\fR, \fI\fBSDL_PollEvent\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_WaitThread.3 b/distrib/sdl-1.2.15/docs/man3/SDL_WaitThread.3
new file mode 100644
index 0000000..11679fc
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_WaitThread.3
@@ -0,0 +1,19 @@
+.TH "SDL_WaitThread" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_WaitThread \- Wait for a thread to finish\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL_thread\&.h"
+.sp
+\fBvoid \fBSDL_WaitThread\fP\fR(\fBSDL_Thread *thread, int *status\fR);
+.SH "DESCRIPTION"
+.PP
+Wait for a thread to finish (timeouts are not supported)\&.
+.SH "RETURN VALUE"
+.PP
+The return code for the thread function is placed in the area pointed to by \fBstatus\fR, if \fBstatus\fR is not \fBNULL\fR\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CreateThread\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_WarpMouse.3 b/distrib/sdl-1.2.15/docs/man3/SDL_WarpMouse.3
new file mode 100644
index 0000000..5cab3ce
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_WarpMouse.3
@@ -0,0 +1,15 @@
+.TH "SDL_WarpMouse" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_WarpMouse \- Set the position of the mouse cursor\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBvoid \fBSDL_WarpMouse\fP\fR(\fBUint16 x, Uint16 y\fR);
+.SH "DESCRIPTION"
+.PP
+Set the position of the mouse cursor (generates a mouse motion event)\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_MouseMotionEvent\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_WasInit.3 b/distrib/sdl-1.2.15/docs/man3/SDL_WasInit.3
new file mode 100644
index 0000000..5bc75c5
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_WasInit.3
@@ -0,0 +1,63 @@
+.TH "SDL_WasInit" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_WasInit \- Check which subsystems are initialized
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBUint32 \fBSDL_WasInit\fP\fR(\fBUint32 flags\fR);
+.SH "DESCRIPTION"
+.PP
+\fBSDL_WasInit\fP allows you to see which SDL subsytems have been \fIinitialized\fR\&. \fBflags\fR is a bitwise OR\&'d combination of the subsystems you wish to check (see \fI\fBSDL_Init\fP\fR for a list of subsystem flags)\&.
+.SH "RETURN VALUE"
+.PP
+\fBSDL_WasInit\fP returns a bitwised OR\&'d combination of the initialized subsystems\&.
+.SH "EXAMPLES"
+.PP
+.nf
+\f(CW
+/* Here are several ways you can use SDL_WasInit() */
+
+/* Get init data on all the subsystems */
+Uint32 subsystem_init;
+
+subsystem_init=SDL_WasInit(SDL_INIT_EVERYTHING);
+
+if(subsystem_init&SDL_INIT_VIDEO)
+ printf("Video is initialized\&.
+");
+else
+ printf("Video is not initialized\&.
+");
+
+
+
+/* Just check for one specfic subsystem */
+
+if(SDL_WasInit(SDL_INIT_VIDEO)!=0)
+ printf("Video is initialized\&.
+");
+else
+ printf("Video is not initialized\&.
+");
+
+
+
+
+/* Check for two subsystems */
+
+Uint32 subsystem_mask=SDL_INIT_VIDEO|SDL_INIT_AUDIO;
+
+if(SDL_WasInit(subsystem_mask)==subsystem_mask)
+ printf("Video and Audio initialized\&.
+");
+else
+ printf("Video and Audio not initialized\&.
+");
+\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Init\fP\fR, \fI\fBSDL_Subsystem\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_keysym.3 b/distrib/sdl-1.2.15/docs/man3/SDL_keysym.3
new file mode 100644
index 0000000..52065c1
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_keysym.3
@@ -0,0 +1,69 @@
+.TH "SDL_keysym" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_keysym \- Keysym structure
+.SH "STRUCTURE DEFINITION"
+.PP
+.nf
+\f(CWtypedef struct{
+ Uint8 scancode;
+ SDLKey sym;
+ SDLMod mod;
+ Uint16 unicode;
+} SDL_keysym;\fR
+.fi
+.PP
+.SH "STRUCTURE DATA"
+.TP 20
+\fBscancode\fR
+Hardware specific scancode
+.TP 20
+\fBsym\fR
+SDL virtual keysym
+.TP 20
+\fBmod\fR
+Current key modifiers
+.TP 20
+\fBunicode\fR
+Translated character
+.SH "DESCRIPTION"
+.PP
+The \fBSDL_keysym\fR structure is used by reporting key presses and releases since it is a part of the \fI\fBSDL_KeyboardEvent\fR\fR\&.
+.PP
+The \fBscancode\fR field should generally be left alone, it is the hardware dependent scancode returned by the keyboard\&. The \fBsym\fR field is extremely useful\&. It is the SDL-defined value of the key (see \fISDL Key Syms\fR\&. This field is very useful when you are checking for certain key presses, like so:
+.PP
+.nf
+\f(CW\&.
+\&.
+while(SDL_PollEvent(&event)){
+ switch(event\&.type){
+ case SDL_KEYDOWN:
+ if(event\&.key\&.keysym\&.sym==SDLK_LEFT)
+ move_left();
+ break;
+ \&.
+ \&.
+ \&.
+ }
+}
+\&.
+\&.\fR
+.fi
+.PP
+ \fBmod\fR stores the current state of the keyboard modifiers as explained in \fI\fBSDL_GetModState\fP\fR\&. The \fBunicode\fR is only used when UNICODE translation is enabled with \fI\fBSDL_EnableUNICODE\fP\fR\&. If \fBunicode\fR is non-zero then this a the UNICODE character corresponding to the keypress\&. If the high 9 bits of the character are 0, then this maps to the equivalent ASCII character:
+.PP
+.nf
+\f(CWchar ch;
+if ( (keysym\&.unicode & 0xFF80) == 0 ) {
+ ch = keysym\&.unicode & 0x7F;
+}
+else {
+ printf("An International Character\&.
+");
+}\fR
+.fi
+.PP
+ UNICODE translation does have a slight overhead so don\&'t enable it unless its needed\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDLKey\fR\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_mutexP.3 b/distrib/sdl-1.2.15/docs/man3/SDL_mutexP.3
new file mode 100644
index 0000000..3f21716
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_mutexP.3
@@ -0,0 +1,18 @@
+.TH "SDL_mutexP" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_mutexP \- Lock a mutex
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL_thread\&.h"
+.sp
+\fBint \fBSDL_mutexP\fP\fR(\fBSDL_mutex *mutex\fR);
+.SH "DESCRIPTION"
+.PP
+Locks the \fBmutex\fR, which was previously created with \fI\fBSDL_CreateMutex\fP\fR\&. If the mutex is already locked then \fBSDL_mutexP\fP will not return until it is \fIunlocked\fR\&. Returns \fB0\fR on success, or \fB-1\fR on an error\&.
+.PP
+SDL also defines a macro \fB#define SDL_LockMutex(m) SDL_mutexP(m)\fP\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CreateMutex\fP\fR, \fI\fBSDL_mutexV\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_mutexV.3 b/distrib/sdl-1.2.15/docs/man3/SDL_mutexV.3
new file mode 100644
index 0000000..e914abb
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_mutexV.3
@@ -0,0 +1,18 @@
+.TH "SDL_mutexV" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_mutexV \- Unlock a mutex
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+#include "SDL_thread\&.h"
+.sp
+\fBint \fBSDL_mutexV\fP\fR(\fBSDL_mutex *mutex\fR);
+.SH "DESCRIPTION"
+.PP
+Unlocks the \fBmutex\fR, which was previously created with \fI\fBSDL_CreateMutex\fP\fR\&. Returns \fB0\fR on success, or \fB-1\fR on an error\&.
+.PP
+SDL also defines a macro \fB#define SDL_UnlockMutex(m) SDL_mutexV(m)\fP\&.
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_CreateMutex\fP\fR, \fI\fBSDL_mutexP\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01
diff --git a/distrib/sdl-1.2.15/include/SDL.h b/distrib/sdl-1.2.15/include/SDL.h
new file mode 100644
index 0000000..6087b7c
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL.h
@@ -0,0 +1,101 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/** @file SDL.h
+ * Main include header for the SDL library
+ */
+
+#ifndef _SDL_H
+#define _SDL_H
+
+#include "SDL_main.h"
+#include "SDL_stdinc.h"
+#include "SDL_audio.h"
+#include "SDL_cdrom.h"
+#include "SDL_cpuinfo.h"
+#include "SDL_endian.h"
+#include "SDL_error.h"
+#include "SDL_events.h"
+#include "SDL_loadso.h"
+#include "SDL_mutex.h"
+#include "SDL_rwops.h"
+#include "SDL_thread.h"
+#include "SDL_timer.h"
+#include "SDL_video.h"
+#include "SDL_version.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @file SDL.h
+ * @note As of version 0.5, SDL is loaded dynamically into the application
+ */
+
+/** @name SDL_INIT Flags
+ * These are the flags which may be passed to SDL_Init() -- you should
+ * specify the subsystems which you will be using in your application.
+ */
+/*@{*/
+#define SDL_INIT_TIMER 0x00000001
+#define SDL_INIT_AUDIO 0x00000010
+#define SDL_INIT_VIDEO 0x00000020
+#define SDL_INIT_CDROM 0x00000100
+#define SDL_INIT_JOYSTICK 0x00000200
+#define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */
+#define SDL_INIT_EVENTTHREAD 0x01000000 /**< Not supported on all OS's */
+#define SDL_INIT_EVERYTHING 0x0000FFFF
+/*@}*/
+
+/** This function loads the SDL dynamically linked library and initializes
+ * the subsystems specified by 'flags' (and those satisfying dependencies)
+ * Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
+ * signal handlers for some commonly ignored fatal signals (like SIGSEGV)
+ */
+extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
+
+/** This function initializes specific SDL subsystems */
+extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
+
+/** This function cleans up specific SDL subsystems */
+extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
+
+/** This function returns mask of the specified subsystems which have
+ * been initialized.
+ * If 'flags' is 0, it returns a mask of all initialized subsystems.
+ */
+extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
+
+/** This function cleans up all initialized subsystems and unloads the
+ * dynamically linked library. You should call it upon all exit conditions.
+ */
+extern DECLSPEC void SDLCALL SDL_Quit(void);
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_H */
diff --git a/distrib/sdl-1.2.15/include/SDL_active.h b/distrib/sdl-1.2.15/include/SDL_active.h
new file mode 100644
index 0000000..cd854e8
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_active.h
@@ -0,0 +1,63 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/**
+ * @file SDL_active.h
+ * Include file for SDL application focus event handling
+ */
+
+#ifndef _SDL_active_h
+#define _SDL_active_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @name The available application states */
+/*@{*/
+#define SDL_APPMOUSEFOCUS 0x01 /**< The app has mouse coverage */
+#define SDL_APPINPUTFOCUS 0x02 /**< The app has input focus */
+#define SDL_APPACTIVE 0x04 /**< The application is active */
+/*@}*/
+
+/* Function prototypes */
+/**
+ * This function returns the current state of the application, which is a
+ * bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and
+ * SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to
+ * see your application, otherwise it has been iconified or disabled.
+ */
+extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_active_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_audio.h b/distrib/sdl-1.2.15/include/SDL_audio.h
new file mode 100644
index 0000000..e879c98
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_audio.h
@@ -0,0 +1,284 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/**
+ * @file SDL_audio.h
+ * Access to the raw audio mixing buffer for the SDL library
+ */
+
+#ifndef _SDL_audio_h
+#define _SDL_audio_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+#include "SDL_endian.h"
+#include "SDL_mutex.h"
+#include "SDL_thread.h"
+#include "SDL_rwops.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * When filling in the desired audio spec structure,
+ * - 'desired->freq' should be the desired audio frequency in samples-per-second.
+ * - 'desired->format' should be the desired audio format.
+ * - 'desired->samples' is the desired size of the audio buffer, in samples.
+ * This number should be a power of two, and may be adjusted by the audio
+ * driver to a value more suitable for the hardware. Good values seem to
+ * range between 512 and 8096 inclusive, depending on the application and
+ * CPU speed. Smaller values yield faster response time, but can lead
+ * to underflow if the application is doing heavy processing and cannot
+ * fill the audio buffer in time. A stereo sample consists of both right
+ * and left channels in LR ordering.
+ * Note that the number of samples is directly related to time by the
+ * following formula: ms = (samples*1000)/freq
+ * - 'desired->size' is the size in bytes of the audio buffer, and is
+ * calculated by SDL_OpenAudio().
+ * - 'desired->silence' is the value used to set the buffer to silence,
+ * and is calculated by SDL_OpenAudio().
+ * - 'desired->callback' should be set to a function that will be called
+ * when the audio device is ready for more data. It is passed a pointer
+ * to the audio buffer, and the length in bytes of the audio buffer.
+ * This function usually runs in a separate thread, and so you should
+ * protect data structures that it accesses by calling SDL_LockAudio()
+ * and SDL_UnlockAudio() in your code.
+ * - 'desired->userdata' is passed as the first parameter to your callback
+ * function.
+ *
+ * @note The calculated values in this structure are calculated by SDL_OpenAudio()
+ *
+ */
+typedef struct SDL_AudioSpec {
+ int freq; /**< DSP frequency -- samples per second */
+ Uint16 format; /**< Audio data format */
+ Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */
+ Uint8 silence; /**< Audio buffer silence value (calculated) */
+ Uint16 samples; /**< Audio buffer size in samples (power of 2) */
+ Uint16 padding; /**< Necessary for some compile environments */
+ Uint32 size; /**< Audio buffer size in bytes (calculated) */
+ /**
+ * This function is called when the audio device needs more data.
+ *
+ * @param[out] stream A pointer to the audio data buffer
+ * @param[in] len The length of the audio buffer in bytes.
+ *
+ * Once the callback returns, the buffer will no longer be valid.
+ * Stereo samples are stored in a LRLRLR ordering.
+ */
+ void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len);
+ void *userdata;
+} SDL_AudioSpec;
+
+/**
+ * @name Audio format flags
+ * defaults to LSB byte order
+ */
+/*@{*/
+#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */
+#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */
+#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */
+#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */
+#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */
+#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */
+#define AUDIO_U16 AUDIO_U16LSB
+#define AUDIO_S16 AUDIO_S16LSB
+
+/**
+ * @name Native audio byte ordering
+ */
+/*@{*/
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+#define AUDIO_U16SYS AUDIO_U16LSB
+#define AUDIO_S16SYS AUDIO_S16LSB
+#else
+#define AUDIO_U16SYS AUDIO_U16MSB
+#define AUDIO_S16SYS AUDIO_S16MSB
+#endif
+/*@}*/
+
+/*@}*/
+
+
+/** A structure to hold a set of audio conversion filters and buffers */
+typedef struct SDL_AudioCVT {
+ int needed; /**< Set to 1 if conversion possible */
+ Uint16 src_format; /**< Source audio format */
+ Uint16 dst_format; /**< Target audio format */
+ double rate_incr; /**< Rate conversion increment */
+ Uint8 *buf; /**< Buffer to hold entire audio data */
+ int len; /**< Length of original audio buffer */
+ int len_cvt; /**< Length of converted audio buffer */
+ int len_mult; /**< buffer must be len*len_mult big */
+ double len_ratio; /**< Given len, final size is len*len_ratio */
+ void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
+ int filter_index; /**< Current audio conversion function */
+} SDL_AudioCVT;
+
+
+/* Function prototypes */
+
+/**
+ * @name Audio Init and Quit
+ * These functions are used internally, and should not be used unless you
+ * have a specific need to specify the audio driver you want to use.
+ * You should normally use SDL_Init() or SDL_InitSubSystem().
+ */
+/*@{*/
+extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name);
+extern DECLSPEC void SDLCALL SDL_AudioQuit(void);
+/*@}*/
+
+/**
+ * This function fills the given character buffer with the name of the
+ * current audio driver, and returns a pointer to it if the audio driver has
+ * been initialized. It returns NULL if no driver has been initialized.
+ */
+extern DECLSPEC char * SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen);
+
+/**
+ * This function opens the audio device with the desired parameters, and
+ * returns 0 if successful, placing the actual hardware parameters in the
+ * structure pointed to by 'obtained'. If 'obtained' is NULL, the audio
+ * data passed to the callback function will be guaranteed to be in the
+ * requested format, and will be automatically converted to the hardware
+ * audio format if necessary. This function returns -1 if it failed
+ * to open the audio device, or couldn't set up the audio thread.
+ *
+ * The audio device starts out playing silence when it's opened, and should
+ * be enabled for playing by calling SDL_PauseAudio(0) when you are ready
+ * for your audio callback function to be called. Since the audio driver
+ * may modify the requested size of the audio buffer, you should allocate
+ * any local mixing buffers after you open the audio device.
+ *
+ * @sa SDL_AudioSpec
+ */
+extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained);
+
+typedef enum {
+ SDL_AUDIO_STOPPED = 0,
+ SDL_AUDIO_PLAYING,
+ SDL_AUDIO_PAUSED
+} SDL_audiostatus;
+
+/** Get the current audio state */
+extern DECLSPEC SDL_audiostatus SDLCALL SDL_GetAudioStatus(void);
+
+/**
+ * This function pauses and unpauses the audio callback processing.
+ * It should be called with a parameter of 0 after opening the audio
+ * device to start playing sound. This is so you can safely initialize
+ * data for your callback function after opening the audio device.
+ * Silence will be written to the audio device during the pause.
+ */
+extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on);
+
+/**
+ * This function loads a WAVE from the data source, automatically freeing
+ * that source if 'freesrc' is non-zero. For example, to load a WAVE file,
+ * you could do:
+ * @code SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); @endcode
+ *
+ * If this function succeeds, it returns the given SDL_AudioSpec,
+ * filled with the audio data format of the wave data, and sets
+ * 'audio_buf' to a malloc()'d buffer containing the audio data,
+ * and sets 'audio_len' to the length of that audio buffer, in bytes.
+ * You need to free the audio buffer with SDL_FreeWAV() when you are
+ * done with it.
+ *
+ * This function returns NULL and sets the SDL error message if the
+ * wave file cannot be opened, uses an unknown data format, or is
+ * corrupt. Currently raw and MS-ADPCM WAVE files are supported.
+ */
+extern DECLSPEC SDL_AudioSpec * SDLCALL SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
+
+/** Compatibility convenience function -- loads a WAV from a file */
+#define SDL_LoadWAV(file, 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()
+ */
+extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 *audio_buf);
+
+/**
+ * This function takes a source format and rate and a destination format
+ * and rate, and initializes the 'cvt' structure with information needed
+ * by SDL_ConvertAudio() to convert a buffer of audio data from one format
+ * to the other.
+ *
+ * @return This function returns 0, or -1 if there was an error.
+ */
+extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT *cvt,
+ Uint16 src_format, Uint8 src_channels, int src_rate,
+ Uint16 dst_format, Uint8 dst_channels, int dst_rate);
+
+/**
+ * Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(),
+ * created an audio buffer cvt->buf, and filled it with cvt->len bytes of
+ * audio data in the source format, this function will convert it in-place
+ * to the desired format.
+ * The data conversion may expand the size of the audio data, so the buffer
+ * cvt->buf should be allocated after the cvt structure is initialized by
+ * SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long.
+ */
+extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT *cvt);
+
+
+#define SDL_MIX_MAXVOLUME 128
+/**
+ * This takes two audio buffers of the playing audio format and mixes
+ * them, performing addition, volume adjustment, and overflow clipping.
+ * The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME
+ * for full audio volume. Note this does not change hardware volume.
+ * This is provided for convenience -- you can mix your own audio data.
+ */
+extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume);
+
+/**
+ * @name Audio Locks
+ * The lock manipulated by these functions protects the callback function.
+ * During a LockAudio/UnlockAudio pair, you can be guaranteed that the
+ * callback function is not running. Do not call these from the callback
+ * function or you will cause deadlock.
+ */
+/*@{*/
+extern DECLSPEC void SDLCALL SDL_LockAudio(void);
+extern DECLSPEC void SDLCALL SDL_UnlockAudio(void);
+/*@}*/
+
+/**
+ * This function shuts down audio processing and closes the audio device.
+ */
+extern DECLSPEC void SDLCALL SDL_CloseAudio(void);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_audio_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_byteorder.h b/distrib/sdl-1.2.15/include/SDL_byteorder.h
new file mode 100644
index 0000000..47332c3
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_byteorder.h
@@ -0,0 +1,29 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/**
+ * @file SDL_byteorder.h
+ * @deprecated Use SDL_endian.h instead
+ */
+
+/* DEPRECATED */
+#include "SDL_endian.h"
diff --git a/distrib/sdl-1.2.15/include/SDL_cdrom.h b/distrib/sdl-1.2.15/include/SDL_cdrom.h
new file mode 100644
index 0000000..febb19d
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_cdrom.h
@@ -0,0 +1,202 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/**
+ * @file SDL_cdrom.h
+ * This is the CD-audio control API for Simple DirectMedia Layer
+ */
+
+#ifndef _SDL_cdrom_h
+#define _SDL_cdrom_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @file SDL_cdrom.h
+ * In order to use these functions, SDL_Init() must have been called
+ * with the SDL_INIT_CDROM flag. This causes SDL to scan the system
+ * for CD-ROM drives, and load appropriate drivers.
+ */
+
+/** The maximum number of CD-ROM tracks on a disk */
+#define SDL_MAX_TRACKS 99
+
+/** @name Track Types
+ * The types of CD-ROM track possible
+ */
+/*@{*/
+#define SDL_AUDIO_TRACK 0x00
+#define SDL_DATA_TRACK 0x04
+/*@}*/
+
+/** The possible states which a CD-ROM drive can be in. */
+typedef enum {
+ CD_TRAYEMPTY,
+ CD_STOPPED,
+ CD_PLAYING,
+ CD_PAUSED,
+ CD_ERROR = -1
+} CDstatus;
+
+/** Given a status, returns true if there's a disk in the drive */
+#define CD_INDRIVE(status) ((int)(status) > 0)
+
+typedef struct SDL_CDtrack {
+ Uint8 id; /**< Track number */
+ Uint8 type; /**< Data or audio track */
+ Uint16 unused;
+ Uint32 length; /**< Length, in frames, of this track */
+ Uint32 offset; /**< Offset, in frames, from start of disk */
+} SDL_CDtrack;
+
+/** This structure is only current as of the last call to SDL_CDStatus() */
+typedef struct SDL_CD {
+ int id; /**< Private drive identifier */
+ CDstatus status; /**< Current drive status */
+
+ /** The rest of this structure is only valid if there's a CD in drive */
+ /*@{*/
+ int numtracks; /**< Number of tracks on disk */
+ int cur_track; /**< Current track position */
+ int cur_frame; /**< Current frame offset within current track */
+ SDL_CDtrack track[SDL_MAX_TRACKS+1];
+ /*@}*/
+} SDL_CD;
+
+/** @name Frames / MSF Conversion Functions
+ * Conversion functions from frames to Minute/Second/Frames and vice versa
+ */
+/*@{*/
+#define CD_FPS 75
+#define FRAMES_TO_MSF(f, M,S,F) { \
+ int value = f; \
+ *(F) = value%CD_FPS; \
+ value /= CD_FPS; \
+ *(S) = value%60; \
+ value /= 60; \
+ *(M) = value; \
+}
+#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F))
+/*@}*/
+
+/* CD-audio API functions: */
+
+/**
+ * Returns the number of CD-ROM drives on the system, or -1 if
+ * SDL_Init() has not been called with the SDL_INIT_CDROM flag.
+ */
+extern DECLSPEC int SDLCALL SDL_CDNumDrives(void);
+
+/**
+ * Returns a human-readable, system-dependent identifier for the CD-ROM.
+ * Example:
+ * - "/dev/cdrom"
+ * - "E:"
+ * - "/dev/disk/ide/1/master"
+ */
+extern DECLSPEC const char * SDLCALL SDL_CDName(int drive);
+
+/**
+ * Opens a CD-ROM drive for access. It returns a drive handle on success,
+ * or NULL if the drive was invalid or busy. This newly opened CD-ROM
+ * becomes the default CD used when other CD functions are passed a NULL
+ * CD-ROM handle.
+ * Drives are numbered starting with 0. Drive 0 is the system default CD-ROM.
+ */
+extern DECLSPEC SDL_CD * SDLCALL SDL_CDOpen(int drive);
+
+/**
+ * This function returns the current status of the given drive.
+ * If the drive has a CD in it, the table of contents of the CD and current
+ * play position of the CD will be stored in the SDL_CD structure.
+ */
+extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD *cdrom);
+
+/**
+ * Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks'
+ * tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play
+ * until the end of the CD. This function will skip data tracks.
+ * This function should only be called after calling SDL_CDStatus() to
+ * get track information about the CD.
+ * For example:
+ * @code
+ * // Play entire CD:
+ * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
+ * SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
+ * // Play last track:
+ * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
+ * SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0);
+ * }
+ * // Play first and second track and 10 seconds of third track:
+ * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
+ * SDL_CDPlayTracks(cdrom, 0, 0, 2, 10);
+ * @endcode
+ *
+ * @return This function returns 0, or -1 if there was an error.
+ */
+extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom,
+ int start_track, int start_frame, int ntracks, int nframes);
+
+/**
+ * Play the given CD starting at 'start' frame for 'length' frames.
+ * @return It returns 0, or -1 if there was an error.
+ */
+extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD *cdrom, int start, int length);
+
+/** Pause play
+ * @return returns 0, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD *cdrom);
+
+/** Resume play
+ * @return returns 0, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD *cdrom);
+
+/** Stop play
+ * @return returns 0, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD *cdrom);
+
+/** Eject CD-ROM
+ * @return returns 0, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD *cdrom);
+
+/** Closes the handle for the CD-ROM drive */
+extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD *cdrom);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_video_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_config.h.default b/distrib/sdl-1.2.15/include/SDL_config.h.default
new file mode 100644
index 0000000..09ba38a
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_config.h.default
@@ -0,0 +1,45 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#ifndef _SDL_config_h
+#define _SDL_config_h
+
+#include "SDL_platform.h"
+
+/* Add any platform that doesn't build using the configure system */
+#if defined(__DREAMCAST__)
+#include "SDL_config_dreamcast.h"
+#elif defined(__MACOS__)
+#include "SDL_config_macos.h"
+#elif defined(__MACOSX__)
+#include "SDL_config_macosx.h"
+#elif defined(__SYMBIAN32__)
+#include "SDL_config_symbian.h" /* must be before win32! */
+#elif defined(__WIN32__)
+#include "SDL_config_win32.h"
+#elif defined(__OS2__)
+#include "SDL_config_os2.h"
+#else
+#include "SDL_config_minimal.h"
+#endif /* platform config */
+
+#endif /* _SDL_config_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_config.h.in b/distrib/sdl-1.2.15/include/SDL_config.h.in
new file mode 100644
index 0000000..8bb1773
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_config.h.in
@@ -0,0 +1,312 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#ifndef _SDL_config_h
+#define _SDL_config_h
+
+/* This is a set of defines to configure the SDL features */
+
+/* General platform specific identifiers */
+#include "SDL_platform.h"
+
+/* Make sure that this isn't included by Visual C++ */
+#ifdef _MSC_VER
+#error You should copy include/SDL_config.h.default to include/SDL_config.h
+#endif
+
+/* C language features */
+#undef const
+#undef inline
+#undef volatile
+
+/* C datatypes */
+#undef size_t
+#undef int8_t
+#undef uint8_t
+#undef int16_t
+#undef uint16_t
+#undef int32_t
+#undef uint32_t
+#undef int64_t
+#undef uint64_t
+#undef uintptr_t
+#undef SDL_HAS_64BIT_TYPE
+
+/* Endianness */
+#undef SDL_BYTEORDER
+
+/* Comment this if you want to build without any C library requirements */
+#undef HAVE_LIBC
+#if HAVE_LIBC
+
+/* Useful headers */
+#undef HAVE_ALLOCA_H
+#undef HAVE_SYS_TYPES_H
+#undef HAVE_STDIO_H
+#undef STDC_HEADERS
+#undef HAVE_STDLIB_H
+#undef HAVE_STDARG_H
+#undef HAVE_MALLOC_H
+#undef HAVE_MEMORY_H
+#undef HAVE_STRING_H
+#undef HAVE_STRINGS_H
+#undef HAVE_INTTYPES_H
+#undef HAVE_STDINT_H
+#undef HAVE_CTYPE_H
+#undef HAVE_MATH_H
+#undef HAVE_ICONV_H
+#undef HAVE_SIGNAL_H
+#undef HAVE_ALTIVEC_H
+
+/* C library functions */
+#undef HAVE_MALLOC
+#undef HAVE_CALLOC
+#undef HAVE_REALLOC
+#undef HAVE_FREE
+#undef HAVE_ALLOCA
+#ifndef _WIN32 /* Don't use C runtime versions of these on Windows */
+#undef HAVE_GETENV
+#undef HAVE_PUTENV
+#undef HAVE_UNSETENV
+#endif
+#undef HAVE_QSORT
+#undef HAVE_ABS
+#undef HAVE_BCOPY
+#undef HAVE_MEMSET
+#undef HAVE_MEMCPY
+#undef HAVE_MEMMOVE
+#undef HAVE_MEMCMP
+#undef HAVE_STRLEN
+#undef HAVE_STRLCPY
+#undef HAVE_STRLCAT
+#undef HAVE_STRDUP
+#undef HAVE__STRREV
+#undef HAVE__STRUPR
+#undef HAVE__STRLWR
+#undef HAVE_INDEX
+#undef HAVE_RINDEX
+#undef HAVE_STRCHR
+#undef HAVE_STRRCHR
+#undef HAVE_STRSTR
+#undef HAVE_ITOA
+#undef HAVE__LTOA
+#undef HAVE__UITOA
+#undef HAVE__ULTOA
+#undef HAVE_STRTOL
+#undef HAVE_STRTOUL
+#undef HAVE__I64TOA
+#undef HAVE__UI64TOA
+#undef HAVE_STRTOLL
+#undef HAVE_STRTOULL
+#undef HAVE_STRTOD
+#undef HAVE_ATOI
+#undef HAVE_ATOF
+#undef HAVE_STRCMP
+#undef HAVE_STRNCMP
+#undef HAVE__STRICMP
+#undef HAVE_STRCASECMP
+#undef HAVE__STRNICMP
+#undef HAVE_STRNCASECMP
+#undef HAVE_SSCANF
+#undef HAVE_SNPRINTF
+#undef HAVE_VSNPRINTF
+#undef HAVE_ICONV
+#undef HAVE_SIGACTION
+#undef HAVE_SA_SIGACTION
+#undef HAVE_SETJMP
+#undef HAVE_NANOSLEEP
+#undef HAVE_CLOCK_GETTIME
+#undef HAVE_GETPAGESIZE
+#undef HAVE_MPROTECT
+#undef HAVE_SEM_TIMEDWAIT
+
+#else
+/* We may need some replacement for stdarg.h here */
+#include <stdarg.h>
+#endif /* HAVE_LIBC */
+
+/* Allow disabling of core subsystems */
+#undef SDL_AUDIO_DISABLED
+#undef SDL_CDROM_DISABLED
+#undef SDL_CPUINFO_DISABLED
+#undef SDL_EVENTS_DISABLED
+#undef SDL_FILE_DISABLED
+#undef SDL_JOYSTICK_DISABLED
+#undef SDL_LOADSO_DISABLED
+#undef SDL_THREADS_DISABLED
+#undef SDL_TIMERS_DISABLED
+#undef SDL_VIDEO_DISABLED
+
+/* Enable various audio drivers */
+#undef SDL_AUDIO_DRIVER_ALSA
+#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
+#undef SDL_AUDIO_DRIVER_ARTS
+#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
+#undef SDL_AUDIO_DRIVER_BAUDIO
+#undef SDL_AUDIO_DRIVER_BSD
+#undef SDL_AUDIO_DRIVER_COREAUDIO
+#undef SDL_AUDIO_DRIVER_DART
+#undef SDL_AUDIO_DRIVER_DC
+#undef SDL_AUDIO_DRIVER_DISK
+#undef SDL_AUDIO_DRIVER_DUMMY
+#undef SDL_AUDIO_DRIVER_DMEDIA
+#undef SDL_AUDIO_DRIVER_DSOUND
+#undef SDL_AUDIO_DRIVER_PULSE
+#undef SDL_AUDIO_DRIVER_PULSE_DYNAMIC
+#undef SDL_AUDIO_DRIVER_ESD
+#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC
+#undef SDL_AUDIO_DRIVER_MINT
+#undef SDL_AUDIO_DRIVER_MMEAUDIO
+#undef SDL_AUDIO_DRIVER_NAS
+#undef SDL_AUDIO_DRIVER_NAS_DYNAMIC
+#undef SDL_AUDIO_DRIVER_OSS
+#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
+#undef SDL_AUDIO_DRIVER_PAUD
+#undef SDL_AUDIO_DRIVER_QNXNTO
+#undef SDL_AUDIO_DRIVER_SNDMGR
+#undef SDL_AUDIO_DRIVER_SUNAUDIO
+#undef SDL_AUDIO_DRIVER_WAVEOUT
+
+/* Enable various cdrom drivers */
+#undef SDL_CDROM_AIX
+#undef SDL_CDROM_BEOS
+#undef SDL_CDROM_BSDI
+#undef SDL_CDROM_DC
+#undef SDL_CDROM_DUMMY
+#undef SDL_CDROM_FREEBSD
+#undef SDL_CDROM_LINUX
+#undef SDL_CDROM_MACOS
+#undef SDL_CDROM_MACOSX
+#undef SDL_CDROM_MINT
+#undef SDL_CDROM_OPENBSD
+#undef SDL_CDROM_OS2
+#undef SDL_CDROM_OSF
+#undef SDL_CDROM_QNX
+#undef SDL_CDROM_WIN32
+
+/* Enable various input drivers */
+#undef SDL_INPUT_LINUXEV
+#undef SDL_INPUT_TSLIB
+#undef SDL_JOYSTICK_BEOS
+#undef SDL_JOYSTICK_DC
+#undef SDL_JOYSTICK_DUMMY
+#undef SDL_JOYSTICK_IOKIT
+#undef SDL_JOYSTICK_LINUX
+#undef SDL_JOYSTICK_MACOS
+#undef SDL_JOYSTICK_MINT
+#undef SDL_JOYSTICK_OS2
+#undef SDL_JOYSTICK_RISCOS
+#undef SDL_JOYSTICK_WINMM
+#undef SDL_JOYSTICK_USBHID
+#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
+
+/* Enable various shared object loading systems */
+#undef SDL_LOADSO_BEOS
+#undef SDL_LOADSO_DLCOMPAT
+#undef SDL_LOADSO_DLOPEN
+#undef SDL_LOADSO_DUMMY
+#undef SDL_LOADSO_LDG
+#undef SDL_LOADSO_MACOS
+#undef SDL_LOADSO_OS2
+#undef SDL_LOADSO_WIN32
+
+/* Enable various threading systems */
+#undef SDL_THREAD_BEOS
+#undef SDL_THREAD_DC
+#undef SDL_THREAD_OS2
+#undef SDL_THREAD_PTH
+#undef SDL_THREAD_PTHREAD
+#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
+#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
+#undef SDL_THREAD_SPROC
+#undef SDL_THREAD_WIN32
+
+/* Enable various timer systems */
+#undef SDL_TIMER_BEOS
+#undef SDL_TIMER_DC
+#undef SDL_TIMER_DUMMY
+#undef SDL_TIMER_MACOS
+#undef SDL_TIMER_MINT
+#undef SDL_TIMER_OS2
+#undef SDL_TIMER_RISCOS
+#undef SDL_TIMER_UNIX
+#undef SDL_TIMER_WIN32
+#undef SDL_TIMER_WINCE
+
+/* Enable various video drivers */
+#undef SDL_VIDEO_DRIVER_AALIB
+#undef SDL_VIDEO_DRIVER_BWINDOW
+#undef SDL_VIDEO_DRIVER_CACA
+#undef SDL_VIDEO_DRIVER_DC
+#undef SDL_VIDEO_DRIVER_DDRAW
+#undef SDL_VIDEO_DRIVER_DGA
+#undef SDL_VIDEO_DRIVER_DIRECTFB
+#undef SDL_VIDEO_DRIVER_DRAWSPROCKET
+#undef SDL_VIDEO_DRIVER_DUMMY
+#undef SDL_VIDEO_DRIVER_FBCON
+#undef SDL_VIDEO_DRIVER_GAPI
+#undef SDL_VIDEO_DRIVER_GEM
+#undef SDL_VIDEO_DRIVER_GGI
+#undef SDL_VIDEO_DRIVER_IPOD
+#undef SDL_VIDEO_DRIVER_NANOX
+#undef SDL_VIDEO_DRIVER_OS2FS
+#undef SDL_VIDEO_DRIVER_PHOTON
+#undef SDL_VIDEO_DRIVER_PICOGUI
+#undef SDL_VIDEO_DRIVER_PS2GS
+#undef SDL_VIDEO_DRIVER_PS3
+#undef SDL_VIDEO_DRIVER_QTOPIA
+#undef SDL_VIDEO_DRIVER_QUARTZ
+#undef SDL_VIDEO_DRIVER_RISCOS
+#undef SDL_VIDEO_DRIVER_SVGALIB
+#undef SDL_VIDEO_DRIVER_TOOLBOX
+#undef SDL_VIDEO_DRIVER_VGL
+#undef SDL_VIDEO_DRIVER_WINDIB
+#undef SDL_VIDEO_DRIVER_WSCONS
+#undef SDL_VIDEO_DRIVER_X11
+#undef SDL_VIDEO_DRIVER_X11_DGAMOUSE
+#undef SDL_VIDEO_DRIVER_X11_DYNAMIC
+#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
+#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR
+#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER
+#undef SDL_VIDEO_DRIVER_X11_VIDMODE
+#undef SDL_VIDEO_DRIVER_X11_XINERAMA
+#undef SDL_VIDEO_DRIVER_X11_XME
+#undef SDL_VIDEO_DRIVER_X11_XRANDR
+#undef SDL_VIDEO_DRIVER_X11_XV
+#undef SDL_VIDEO_DRIVER_XBIOS
+
+/* Enable OpenGL support */
+#undef SDL_VIDEO_OPENGL
+#undef SDL_VIDEO_OPENGL_GLX
+#undef SDL_VIDEO_OPENGL_WGL
+#undef SDL_VIDEO_OPENGL_OSMESA
+#undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC
+
+/* Disable screensaver */
+#undef SDL_VIDEO_DISABLE_SCREENSAVER
+
+/* Enable assembly routines */
+#undef SDL_ASSEMBLY_ROUTINES
+#undef SDL_HERMES_BLITTERS
+#undef SDL_ALTIVEC_BLITTERS
+
+#endif /* _SDL_config_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_config_dreamcast.h b/distrib/sdl-1.2.15/include/SDL_config_dreamcast.h
new file mode 100644
index 0000000..fb03098
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_config_dreamcast.h
@@ -0,0 +1,106 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#ifndef _SDL_config_dreamcast_h
+#define _SDL_config_dreamcast_h
+
+#include "SDL_platform.h"
+
+/* This is a set of defines to configure the SDL features */
+
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef signed short int16_t;
+typedef unsigned short uint16_t;
+typedef signed int int32_t;
+typedef unsigned int uint32_t;
+typedef signed long long int64_t;
+typedef unsigned long long uint64_t;
+typedef unsigned long uintptr_t;
+#define SDL_HAS_64BIT_TYPE 1
+
+/* Useful headers */
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_STDIO_H 1
+#define STDC_HEADERS 1
+#define HAVE_STRING_H 1
+#define HAVE_CTYPE_H 1
+
+/* C library functions */
+#define HAVE_MALLOC 1
+#define HAVE_CALLOC 1
+#define HAVE_REALLOC 1
+#define HAVE_FREE 1
+#define HAVE_ALLOCA 1
+#define HAVE_GETENV 1
+#define HAVE_PUTENV 1
+#define HAVE_QSORT 1
+#define HAVE_ABS 1
+#define HAVE_BCOPY 1
+#define HAVE_MEMSET 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMCMP 1
+#define HAVE_STRLEN 1
+#define HAVE_STRDUP 1
+#define HAVE_INDEX 1
+#define HAVE_RINDEX 1
+#define HAVE_STRCHR 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSTR 1
+#define HAVE_STRTOL 1
+#define HAVE_STRTOD 1
+#define HAVE_ATOI 1
+#define HAVE_ATOF 1
+#define HAVE_STRCMP 1
+#define HAVE_STRNCMP 1
+#define HAVE_STRICMP 1
+#define HAVE_STRCASECMP 1
+#define HAVE_SSCANF 1
+#define HAVE_SNPRINTF 1
+#define HAVE_VSNPRINTF 1
+
+/* Enable various audio drivers */
+#define SDL_AUDIO_DRIVER_DC 1
+#define SDL_AUDIO_DRIVER_DISK 1
+#define SDL_AUDIO_DRIVER_DUMMY 1
+
+/* Enable various cdrom drivers */
+#define SDL_CDROM_DC 1
+
+/* Enable various input drivers */
+#define SDL_JOYSTICK_DC 1
+
+/* Enable various shared object loading systems */
+#define SDL_LOADSO_DUMMY 1
+
+/* Enable various threading systems */
+#define SDL_THREAD_DC 1
+
+/* Enable various timer systems */
+#define SDL_TIMER_DC 1
+
+/* Enable various video drivers */
+#define SDL_VIDEO_DRIVER_DC 1
+#define SDL_VIDEO_DRIVER_DUMMY 1
+
+#endif /* _SDL_config_dreamcast_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_config_macos.h b/distrib/sdl-1.2.15/include/SDL_config_macos.h
new file mode 100644
index 0000000..4fe1715
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_config_macos.h
@@ -0,0 +1,112 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#ifndef _SDL_config_macos_h
+#define _SDL_config_macos_h
+
+#include "SDL_platform.h"
+
+/* This is a set of defines to configure the SDL features */
+
+#include <MacTypes.h>
+
+typedef SInt8 int8_t;
+typedef UInt8 uint8_t;
+typedef SInt16 int16_t;
+typedef UInt16 uint16_t;
+typedef SInt32 int32_t;
+typedef UInt32 uint32_t;
+typedef SInt64 int64_t;
+typedef UInt64 uint64_t;
+typedef unsigned long uintptr_t;
+
+#define SDL_HAS_64BIT_TYPE 1
+
+/* Useful headers */
+#define HAVE_STDIO_H 1
+#define STDC_HEADERS 1
+#define HAVE_STRING_H 1
+#define HAVE_CTYPE_H 1
+#define HAVE_MATH_H 1
+#define HAVE_SIGNAL_H 1
+
+/* C library functions */
+#define HAVE_MALLOC 1
+#define HAVE_CALLOC 1
+#define HAVE_REALLOC 1
+#define HAVE_FREE 1
+#define HAVE_ALLOCA 1
+#define HAVE_ABS 1
+#define HAVE_MEMSET 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMCMP 1
+#define HAVE_STRLEN 1
+#define HAVE_STRCHR 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSTR 1
+#define HAVE_ITOA 1
+#define HAVE_STRTOL 1
+#define HAVE_STRTOD 1
+#define HAVE_ATOI 1
+#define HAVE_ATOF 1
+#define HAVE_STRCMP 1
+#define HAVE_STRNCMP 1
+#define HAVE_SSCANF 1
+
+/* Enable various audio drivers */
+#define SDL_AUDIO_DRIVER_SNDMGR 1
+#define SDL_AUDIO_DRIVER_DISK 1
+#define SDL_AUDIO_DRIVER_DUMMY 1
+
+/* Enable various cdrom drivers */
+#if TARGET_API_MAC_CARBON
+#define SDL_CDROM_DUMMY 1
+#else
+#define SDL_CDROM_MACOS 1
+#endif
+
+/* Enable various input drivers */
+#if TARGET_API_MAC_CARBON
+#define SDL_JOYSTICK_DUMMY 1
+#else
+#define SDL_JOYSTICK_MACOS 1
+#endif
+
+/* Enable various shared object loading systems */
+#define SDL_LOADSO_MACOS 1
+
+/* Enable various threading systems */
+#define SDL_THREADS_DISABLED 1
+
+/* Enable various timer systems */
+#define SDL_TIMER_MACOS 1
+
+/* Enable various video drivers */
+#define SDL_VIDEO_DRIVER_DUMMY 1
+#define SDL_VIDEO_DRIVER_DRAWSPROCKET 1
+#define SDL_VIDEO_DRIVER_TOOLBOX 1
+
+/* Enable OpenGL support */
+#define SDL_VIDEO_OPENGL 1
+
+#endif /* _SDL_config_macos_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_config_macosx.h b/distrib/sdl-1.2.15/include/SDL_config_macosx.h
new file mode 100644
index 0000000..84be617
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_config_macosx.h
@@ -0,0 +1,150 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#ifndef _SDL_config_macosx_h
+#define _SDL_config_macosx_h
+
+#include "SDL_platform.h"
+
+/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */
+#include <AvailabilityMacros.h>
+
+/* This is a set of defines to configure the SDL features */
+
+#define SDL_HAS_64BIT_TYPE 1
+
+/* 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
+
+/* C library functions */
+#define HAVE_MALLOC 1
+#define HAVE_CALLOC 1
+#define HAVE_REALLOC 1
+#define HAVE_FREE 1
+#define HAVE_ALLOCA 1
+#define HAVE_GETENV 1
+#define HAVE_PUTENV 1
+#define HAVE_UNSETENV 1
+#define HAVE_QSORT 1
+#define HAVE_ABS 1
+#define HAVE_BCOPY 1
+#define HAVE_MEMSET 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMCMP 1
+#define HAVE_STRLEN 1
+#define HAVE_STRLCPY 1
+#define HAVE_STRLCAT 1
+#define HAVE_STRDUP 1
+#define HAVE_STRCHR 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSTR 1
+#define HAVE_STRTOL 1
+#define HAVE_STRTOUL 1
+#define HAVE_STRTOLL 1
+#define HAVE_STRTOULL 1
+#define HAVE_STRTOD 1
+#define HAVE_ATOI 1
+#define HAVE_ATOF 1
+#define HAVE_STRCMP 1
+#define HAVE_STRNCMP 1
+#define HAVE_STRCASECMP 1
+#define HAVE_STRNCASECMP 1
+#define HAVE_SSCANF 1
+#define HAVE_SNPRINTF 1
+#define HAVE_VSNPRINTF 1
+#define HAVE_SIGACTION 1
+#define HAVE_SETJMP 1
+#define HAVE_NANOSLEEP 1
+
+/* Enable various audio drivers */
+#define SDL_AUDIO_DRIVER_COREAUDIO 1
+#define SDL_AUDIO_DRIVER_DISK 1
+#define SDL_AUDIO_DRIVER_DUMMY 1
+
+/* Enable various cdrom drivers */
+#define SDL_CDROM_MACOSX 1
+
+/* Enable various input drivers */
+#define SDL_JOYSTICK_IOKIT 1
+
+/* Enable various shared object loading systems */
+#ifdef __ppc__
+/* For Mac OS X 10.2 compatibility */
+#define SDL_LOADSO_DLCOMPAT 1
+#else
+#define SDL_LOADSO_DLOPEN 1
+#endif
+
+/* Enable various threading systems */
+#define SDL_THREAD_PTHREAD 1
+#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
+
+/* Enable various timer systems */
+#define SDL_TIMER_UNIX 1
+
+/* Enable various video drivers */
+#define SDL_VIDEO_DRIVER_DUMMY 1
+#if ((defined TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON))
+#define SDL_VIDEO_DRIVER_TOOLBOX 1
+#else
+#define SDL_VIDEO_DRIVER_QUARTZ 1
+#endif
+#define SDL_VIDEO_DRIVER_DGA 1
+#define SDL_VIDEO_DRIVER_X11 1
+#define SDL_VIDEO_DRIVER_X11_DGAMOUSE 1
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER "/usr/X11R6/lib/libXrender.1.dylib"
+#define SDL_VIDEO_DRIVER_X11_VIDMODE 1
+#define SDL_VIDEO_DRIVER_X11_XINERAMA 1
+#define SDL_VIDEO_DRIVER_X11_XME 1
+#define SDL_VIDEO_DRIVER_X11_XRANDR 1
+#define SDL_VIDEO_DRIVER_X11_XV 1
+
+/* Enable OpenGL support */
+#define SDL_VIDEO_OPENGL 1
+#define SDL_VIDEO_OPENGL_GLX 1
+
+/* Disable screensaver */
+#define SDL_VIDEO_DISABLE_SCREENSAVER 1
+
+/* Enable assembly routines */
+#define SDL_ASSEMBLY_ROUTINES 1
+#ifdef __ppc__
+#define SDL_ALTIVEC_BLITTERS 1
+#endif
+
+#endif /* _SDL_config_macosx_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_config_minimal.h b/distrib/sdl-1.2.15/include/SDL_config_minimal.h
new file mode 100644
index 0000000..d10db7c
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_config_minimal.h
@@ -0,0 +1,62 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#ifndef _SDL_config_minimal_h
+#define _SDL_config_minimal_h
+
+#include "SDL_platform.h"
+
+/* This is the minimal configuration that can be used to build SDL */
+
+#include <stdarg.h>
+
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef signed short int16_t;
+typedef unsigned short uint16_t;
+typedef signed int int32_t;
+typedef unsigned int uint32_t;
+typedef unsigned int size_t;
+typedef unsigned long uintptr_t;
+
+/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
+#define SDL_AUDIO_DRIVER_DUMMY 1
+
+/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */
+#define SDL_CDROM_DISABLED 1
+
+/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */
+#define SDL_JOYSTICK_DISABLED 1
+
+/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
+#define SDL_LOADSO_DISABLED 1
+
+/* Enable the stub thread support (src/thread/generic/\*.c) */
+#define SDL_THREADS_DISABLED 1
+
+/* Enable the stub timer support (src/timer/dummy/\*.c) */
+#define SDL_TIMERS_DISABLED 1
+
+/* Enable the dummy video driver (src/video/dummy/\*.c) */
+#define SDL_VIDEO_DRIVER_DUMMY 1
+
+#endif /* _SDL_config_minimal_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_config_nds.h b/distrib/sdl-1.2.15/include/SDL_config_nds.h
new file mode 100644
index 0000000..cb4d61f
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_config_nds.h
@@ -0,0 +1,115 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#ifndef _SDL_config_nds_h
+#define _SDL_config_nds_h
+
+#include "SDL_platform.h"
+
+/* This is a set of defines to configure the SDL features */
+
+/* General platform specific identifiers */
+#include "SDL_platform.h"
+
+/* C datatypes */
+#define SDL_HAS_64BIT_TYPE 1
+
+/* Endianness */
+#define SDL_BYTEORDER 1234
+
+/* Useful headers */
+#define HAVE_ALLOCA_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_STDIO_H 1
+#define STDC_HEADERS 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STDARG_H 1
+#define HAVE_MALLOC_H 1
+#define HAVE_STRING_H 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_CTYPE_H 1
+#define HAVE_MATH_H 1
+#define HAVE_ICONV_H 1
+#define HAVE_SIGNAL_H 1
+
+/* C library functions */
+#define HAVE_MALLOC 1
+#define HAVE_CALLOC 1
+#define HAVE_REALLOC 1
+#define HAVE_FREE 1
+#define HAVE_ALLOCA 1
+#define HAVE_GETENV 1
+#define HAVE_PUTENV 1
+#define HAVE_UNSETENV 1
+#define HAVE_QSORT 1
+#define HAVE_ABS 1
+#define HAVE_BCOPY 1
+#define HAVE_MEMSET 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_STRLEN 1
+#define HAVE_STRLCPY 1
+#define HAVE_STRLCAT 1
+#define HAVE_STRDUP 1
+#define HAVE_STRCHR 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSTR 1
+#define HAVE_STRTOL 1
+#define HAVE_STRTOUL 1
+#define HAVE_STRTOLL 1
+#define HAVE_STRTOULL 1
+#define HAVE_ATOI 1
+#define HAVE_ATOF 1
+#define HAVE_STRCMP 1
+#define HAVE_STRNCMP 1
+#define HAVE_STRCASECMP 1
+#define HAVE_STRNCASECMP 1
+#define HAVE_SSCANF 1
+#define HAVE_SNPRINTF 1
+#define HAVE_VSNPRINTF 1
+#define HAVE_SETJMP 1
+
+/* Enable various audio drivers */
+#define SDL_AUDIO_DRIVER_NDS 1
+#define SDL_AUDIO_DRIVER_DUMMY 1
+
+/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */
+#define SDL_CDROM_DISABLED 1
+
+/* Enable various input drivers */
+#define SDL_JOYSTICK_NDS 1
+
+/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
+#define SDL_LOADSO_DISABLED 1
+
+/* Enable the stub thread support (src/thread/generic/\*.c) */
+#define SDL_THREADS_DISABLED 1
+
+/* Enable various timer systems */
+#define SDL_TIMER_NDS 1
+
+/* Enable various video drivers */
+#define SDL_VIDEO_DRIVER_NDS 1
+#define SDL_VIDEO_DRIVER_DUMMY 1
+
+#endif /* _SDL_config_nds_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_config_os2.h b/distrib/sdl-1.2.15/include/SDL_config_os2.h
new file mode 100644
index 0000000..42edd20
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_config_os2.h
@@ -0,0 +1,141 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#ifndef _SDL_config_os2_h
+#define _SDL_config_os2_h
+
+#include "SDL_platform.h"
+
+/* This is a set of defines to configure the SDL features */
+
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef signed short int16_t;
+typedef unsigned short uint16_t;
+typedef signed int int32_t;
+typedef unsigned int uint32_t;
+typedef unsigned int size_t;
+typedef unsigned long uintptr_t;
+typedef signed long long int64_t;
+typedef unsigned long long uint64_t;
+
+#define SDL_HAS_64BIT_TYPE 1
+
+/* Use Watcom's LIBC */
+#define HAVE_LIBC 1
+
+/* Useful headers */
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_STDIO_H 1
+#define STDC_HEADERS 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STDARG_H 1
+#define HAVE_MALLOC_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_STRING_H 1
+#define HAVE_STRINGS_H 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_CTYPE_H 1
+#define HAVE_MATH_H 1
+#define HAVE_SIGNAL_H 1
+
+/* C library functions */
+#define HAVE_MALLOC 1
+#define HAVE_CALLOC 1
+#define HAVE_REALLOC 1
+#define HAVE_FREE 1
+#define HAVE_ALLOCA 1
+#define HAVE_GETENV 1
+#define HAVE_PUTENV 1
+#define HAVE_UNSETENV 1
+#define HAVE_QSORT 1
+#define HAVE_ABS 1
+#define HAVE_BCOPY 1
+#define HAVE_MEMSET 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMCMP 1
+#define HAVE_STRLEN 1
+#define HAVE_STRLCPY 1
+#define HAVE_STRLCAT 1
+#define HAVE_STRDUP 1
+#define HAVE__STRREV 1
+#define HAVE__STRUPR 1
+#define HAVE__STRLWR 1
+#define HAVE_INDEX 1
+#define HAVE_RINDEX 1
+#define HAVE_STRCHR 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSTR 1
+#define HAVE_ITOA 1
+#define HAVE__LTOA 1
+#define HAVE__UITOA 1
+#define HAVE__ULTOA 1
+#define HAVE_STRTOL 1
+#define HAVE__I64TOA 1
+#define HAVE__UI64TOA 1
+#define HAVE_STRTOLL 1
+#define HAVE_STRTOD 1
+#define HAVE_ATOI 1
+#define HAVE_ATOF 1
+#define HAVE_STRCMP 1
+#define HAVE_STRNCMP 1
+#define HAVE_STRICMP 1
+#define HAVE_STRCASECMP 1
+#define HAVE_SSCANF 1
+#define HAVE_SNPRINTF 1
+#define HAVE_VSNPRINTF 1
+#define HAVE_SETJMP 1
+#define HAVE_CLOCK_GETTIME 1
+
+/* Enable various audio drivers */
+#define SDL_AUDIO_DRIVER_DART 1
+#define SDL_AUDIO_DRIVER_DISK 1
+#define SDL_AUDIO_DRIVER_DUMMY 1
+
+/* Enable various cdrom drivers */
+#define SDL_CDROM_OS2 1
+
+/* Enable various input drivers */
+#define SDL_JOYSTICK_OS2 1
+
+/* Enable various shared object loading systems */
+#define SDL_LOADSO_OS2 1
+
+/* Enable various threading systems */
+#define SDL_THREAD_OS2 1
+
+/* Enable various timer systems */
+#define SDL_TIMER_OS2 1
+
+/* Enable various video drivers */
+#define SDL_VIDEO_DRIVER_DUMMY 1
+#define SDL_VIDEO_DRIVER_OS2FS 1
+
+/* Enable OpenGL support */
+/* Nothing here yet for OS/2... :( */
+
+/* Enable assembly routines where available */
+#define SDL_ASSEMBLY_ROUTINES 1
+
+#endif /* _SDL_config_os2_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_config_symbian.h b/distrib/sdl-1.2.15/include/SDL_config_symbian.h
new file mode 100644
index 0000000..e917ac6
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_config_symbian.h
@@ -0,0 +1,146 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/*
+
+Symbian version Markus Mertama
+
+*/
+
+
+#ifndef _SDL_CONFIG_SYMBIAN_H
+#define _SDL_CONFIG_SYMBIAN_H
+
+#include "SDL_platform.h"
+
+/* This is the minimal configuration that can be used to build SDL */
+
+
+#include <stdarg.h>
+#include <stddef.h>
+
+
+#ifdef __GCCE__
+#define SYMBIAN32_GCCE
+#endif
+
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#endif
+
+#ifndef _INTPTR_T_DECLARED
+typedef unsigned int uintptr_t;
+#endif
+
+#ifndef _INT8_T_DECLARED
+typedef signed char int8_t;
+#endif
+
+#ifndef _UINT8_T_DECLARED
+typedef unsigned char uint8_t;
+#endif
+
+#ifndef _INT16_T_DECLARED
+typedef signed short int16_t;
+#endif
+
+#ifndef _UINT16_T_DECLARED
+typedef unsigned short uint16_t;
+#endif
+
+#ifndef _INT32_T_DECLARED
+typedef signed int int32_t;
+#endif
+
+#ifndef _UINT32_T_DECLARED
+typedef unsigned int uint32_t;
+#endif
+
+#ifndef _INT64_T_DECLARED
+typedef signed long long int64_t;
+#endif
+
+#ifndef _UINT64_T_DECLARED
+typedef unsigned long long uint64_t;
+#endif
+
+#define SDL_AUDIO_DRIVER_EPOCAUDIO 1
+
+
+/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */
+#define SDL_CDROM_DISABLED 1
+
+/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */
+#define SDL_JOYSTICK_DISABLED 1
+
+/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
+#define SDL_LOADSO_DISABLED 1
+
+#define SDL_THREAD_SYMBIAN 1
+
+#define SDL_VIDEO_DRIVER_EPOC 1
+
+#define SDL_VIDEO_OPENGL 0
+
+#define SDL_HAS_64BIT_TYPE 1
+
+#define HAVE_LIBC 1
+#define HAVE_STDIO_H 1
+#define STDC_HEADERS 1
+#define HAVE_STRING_H 1
+#define HAVE_CTYPE_H 1
+#define HAVE_MATH_H 1
+
+#define HAVE_MALLOC 1
+#define HAVE_CALLOC 1
+#define HAVE_REALLOC 1
+#define HAVE_FREE 1
+/*#define HAVE_ALLOCA 1*/
+#define HAVE_QSORT 1
+#define HAVE_ABS 1
+#define HAVE_MEMSET 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMCMP 1
+#define HAVE_STRLEN 1
+#define HAVE__STRUPR 1
+#define HAVE_STRCHR 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSTR 1
+#define HAVE_ITOA 1
+#define HAVE_STRTOL 1
+#define HAVE_STRTOUL 1
+#define HAVE_STRTOLL 1
+#define HAVE_STRTOD 1
+#define HAVE_ATOI 1
+#define HAVE_ATOF 1
+#define HAVE_STRCMP 1
+#define HAVE_STRNCMP 1
+/*#define HAVE__STRICMP 1*/
+#define HAVE__STRNICMP 1
+#define HAVE_SSCANF 1
+#define HAVE_STDARG_H 1
+#define HAVE_STDDEF_H 1
+
+
+
+#endif /* _SDL_CONFIG_SYMBIAN_H */
diff --git a/distrib/sdl-1.2.15/include/SDL_config_win32.h b/distrib/sdl-1.2.15/include/SDL_config_win32.h
new file mode 100644
index 0000000..da2c15d
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_config_win32.h
@@ -0,0 +1,183 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#ifndef _SDL_config_win32_h
+#define _SDL_config_win32_h
+
+#include "SDL_platform.h"
+
+/* This is a set of defines to configure the SDL features */
+
+#if defined(__GNUC__) || defined(__DMC__)
+#define HAVE_STDINT_H 1
+#elif defined(_MSC_VER)
+typedef signed __int8 int8_t;
+typedef unsigned __int8 uint8_t;
+typedef signed __int16 int16_t;
+typedef unsigned __int16 uint16_t;
+typedef signed __int32 int32_t;
+typedef unsigned __int32 uint32_t;
+typedef signed __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#ifndef _UINTPTR_T_DEFINED
+#ifdef _WIN64
+typedef unsigned __int64 uintptr_t;
+#else
+typedef unsigned int uintptr_t;
+#endif
+#define _UINTPTR_T_DEFINED
+#endif
+/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
+#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
+#define DWORD_PTR DWORD
+#endif
+#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
+#define LONG_PTR LONG
+#endif
+#else /* !__GNUC__ && !_MSC_VER */
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef signed short int16_t;
+typedef unsigned short uint16_t;
+typedef signed int int32_t;
+typedef unsigned int uint32_t;
+typedef signed long long int64_t;
+typedef unsigned long long uint64_t;
+#ifndef _SIZE_T_DEFINED_
+#define _SIZE_T_DEFINED_
+typedef unsigned int size_t;
+#endif
+typedef unsigned int uintptr_t;
+#endif /* __GNUC__ || _MSC_VER */
+#define SDL_HAS_64BIT_TYPE 1
+
+/* Enabled for SDL 1.2 (binary compatibility) */
+#define HAVE_LIBC 1
+#ifdef HAVE_LIBC
+/* Useful headers */
+#define HAVE_STDIO_H 1
+#define STDC_HEADERS 1
+#define HAVE_STRING_H 1
+#define HAVE_CTYPE_H 1
+#define HAVE_MATH_H 1
+#ifndef _WIN32_WCE
+#define HAVE_SIGNAL_H 1
+#endif
+
+/* C library functions */
+#define HAVE_MALLOC 1
+#define HAVE_CALLOC 1
+#define HAVE_REALLOC 1
+#define HAVE_FREE 1
+#define HAVE_ALLOCA 1
+#define HAVE_QSORT 1
+#define HAVE_ABS 1
+#define HAVE_MEMSET 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMCMP 1
+#define HAVE_STRLEN 1
+#define HAVE__STRREV 1
+#define HAVE__STRUPR 1
+#define HAVE__STRLWR 1
+#define HAVE_STRCHR 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSTR 1
+#define HAVE_ITOA 1
+#define HAVE__LTOA 1
+#define HAVE__ULTOA 1
+#define HAVE_STRTOL 1
+#define HAVE_STRTOUL 1
+#define HAVE_STRTOLL 1
+#define HAVE_STRTOD 1
+#define HAVE_ATOI 1
+#define HAVE_ATOF 1
+#define HAVE_STRCMP 1
+#define HAVE_STRNCMP 1
+#define HAVE__STRICMP 1
+#define HAVE__STRNICMP 1
+#define HAVE_SSCANF 1
+#else
+#define HAVE_STDARG_H 1
+#define HAVE_STDDEF_H 1
+#endif
+
+/* Enable various audio drivers */
+#ifndef _WIN32_WCE
+#define SDL_AUDIO_DRIVER_DSOUND 1
+#endif
+#define SDL_AUDIO_DRIVER_WAVEOUT 1
+#define SDL_AUDIO_DRIVER_DISK 1
+#define SDL_AUDIO_DRIVER_DUMMY 1
+
+/* Enable various cdrom drivers */
+#ifdef _WIN32_WCE
+#define SDL_CDROM_DISABLED 1
+#else
+#define SDL_CDROM_WIN32 1
+#endif
+
+/* Enable various input drivers */
+#ifdef _WIN32_WCE
+#define SDL_JOYSTICK_DISABLED 1
+#else
+#define SDL_JOYSTICK_WINMM 1
+#endif
+
+/* Enable various shared object loading systems */
+#define SDL_LOADSO_WIN32 1
+
+/* Enable various threading systems */
+#define SDL_THREAD_WIN32 1
+
+/* Enable various timer systems */
+#ifdef _WIN32_WCE
+#define SDL_TIMER_WINCE 1
+#else
+#define SDL_TIMER_WIN32 1
+#endif
+
+/* Enable various video drivers */
+#ifdef _WIN32_WCE
+#define SDL_VIDEO_DRIVER_GAPI 1
+#endif
+#ifndef _WIN32_WCE
+#define SDL_VIDEO_DRIVER_DDRAW 1
+#endif
+#define SDL_VIDEO_DRIVER_DUMMY 1
+#define SDL_VIDEO_DRIVER_WINDIB 1
+
+/* Enable OpenGL support */
+#ifndef _WIN32_WCE
+#define SDL_VIDEO_OPENGL 1
+#define SDL_VIDEO_OPENGL_WGL 1
+#endif
+
+/* Disable screensaver */
+#define SDL_VIDEO_DISABLE_SCREENSAVER 1
+
+/* Enable assembly routines (Win64 doesn't have inline asm) */
+#ifndef _WIN64
+#define SDL_ASSEMBLY_ROUTINES 1
+#endif
+
+#endif /* _SDL_config_win32_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_copying.h b/distrib/sdl-1.2.15/include/SDL_copying.h
new file mode 100644
index 0000000..b5b64f2
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_copying.h
@@ -0,0 +1,22 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
diff --git a/distrib/sdl-1.2.15/include/SDL_cpuinfo.h b/distrib/sdl-1.2.15/include/SDL_cpuinfo.h
new file mode 100644
index 0000000..4200d6d
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_cpuinfo.h
@@ -0,0 +1,69 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/**
+ * @file SDL_cpuinfo.h
+ * CPU feature detection for SDL
+ */
+
+#ifndef _SDL_cpuinfo_h
+#define _SDL_cpuinfo_h
+
+#include "SDL_stdinc.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** This function returns true if the CPU has the RDTSC instruction */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void);
+
+/** This function returns true if the CPU has MMX features */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
+
+/** This function returns true if the CPU has MMX Ext. features */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void);
+
+/** This function returns true if the CPU has 3DNow features */
+extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void);
+
+/** This function returns true if the CPU has 3DNow! Ext. features */
+extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void);
+
+/** This function returns true if the CPU has SSE features */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
+
+/** This function returns true if the CPU has SSE2 features */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
+
+/** This function returns true if the CPU has AltiVec features */
+extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_cpuinfo_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_endian.h b/distrib/sdl-1.2.15/include/SDL_endian.h
new file mode 100644
index 0000000..068da91
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_endian.h
@@ -0,0 +1,214 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/**
+ * @file SDL_endian.h
+ * Functions for reading and writing endian-specific values
+ */
+
+#ifndef _SDL_endian_h
+#define _SDL_endian_h
+
+#include "SDL_stdinc.h"
+
+/** @name SDL_ENDIANs
+ * The two types of endianness
+ */
+/*@{*/
+#define SDL_LIL_ENDIAN 1234
+#define SDL_BIG_ENDIAN 4321
+/*@}*/
+
+#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
+#ifdef __linux__
+#include <endian.h>
+#define SDL_BYTEORDER __BYTE_ORDER
+#else /* __linux __ */
+#if defined(__hppa__) || \
+ defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
+ (defined(__MIPS__) && defined(__MISPEB__)) || \
+ defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
+ defined(__sparc__)
+#define SDL_BYTEORDER SDL_BIG_ENDIAN
+#else
+#define SDL_BYTEORDER SDL_LIL_ENDIAN
+#endif
+#endif /* __linux __ */
+#endif /* !SDL_BYTEORDER */
+
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @name SDL_Swap Functions
+ * Use inline functions for compilers that support them, and static
+ * functions for those that do not. Because these functions become
+ * static for compilers that do not support inline functions, this
+ * header should only be included in files that actually use them.
+ */
+/*@{*/
+#if defined(__GNUC__) && defined(__i386__) && \
+ !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
+static __inline__ Uint16 SDL_Swap16(Uint16 x)
+{
+ __asm__("xchgb %b0,%h0" : "=q" (x) : "0" (x));
+ return x;
+}
+#elif defined(__GNUC__) && defined(__x86_64__)
+static __inline__ Uint16 SDL_Swap16(Uint16 x)
+{
+ __asm__("xchgb %b0,%h0" : "=Q" (x) : "0" (x));
+ return x;
+}
+#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
+static __inline__ Uint16 SDL_Swap16(Uint16 x)
+{
+ int result;
+
+ __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x));
+ return (Uint16)result;
+}
+#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__))
+static __inline__ Uint16 SDL_Swap16(Uint16 x)
+{
+ __asm__("rorw #8,%0" : "=d" (x) : "0" (x) : "cc");
+ return x;
+}
+#else
+static __inline__ Uint16 SDL_Swap16(Uint16 x) {
+ return SDL_static_cast(Uint16, ((x<<8)|(x>>8)));
+}
+#endif
+
+#if defined(__GNUC__) && defined(__i386__) && \
+ !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
+static __inline__ Uint32 SDL_Swap32(Uint32 x)
+{
+ __asm__("bswap %0" : "=r" (x) : "0" (x));
+ return x;
+}
+#elif defined(__GNUC__) && defined(__x86_64__)
+static __inline__ Uint32 SDL_Swap32(Uint32 x)
+{
+ __asm__("bswapl %0" : "=r" (x) : "0" (x));
+ return x;
+}
+#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
+static __inline__ Uint32 SDL_Swap32(Uint32 x)
+{
+ Uint32 result;
+
+ __asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x));
+ __asm__("rlwimi %0,%2,8,8,15" : "=&r" (result) : "0" (result), "r" (x));
+ __asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x));
+ return result;
+}
+#elif defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__))
+static __inline__ Uint32 SDL_Swap32(Uint32 x)
+{
+ __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) : "0" (x) : "cc");
+ return x;
+}
+#else
+static __inline__ Uint32 SDL_Swap32(Uint32 x) {
+ return SDL_static_cast(Uint32, ((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24)));
+}
+#endif
+
+#ifdef SDL_HAS_64BIT_TYPE
+#if defined(__GNUC__) && defined(__i386__) && \
+ !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */)
+static __inline__ Uint64 SDL_Swap64(Uint64 x)
+{
+ union {
+ struct { Uint32 a,b; } s;
+ Uint64 u;
+ } v;
+ v.u = x;
+ __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
+ : "=r" (v.s.a), "=r" (v.s.b)
+ : "0" (v.s.a), "1" (v.s.b));
+ return v.u;
+}
+#elif defined(__GNUC__) && defined(__x86_64__)
+static __inline__ Uint64 SDL_Swap64(Uint64 x)
+{
+ __asm__("bswapq %0" : "=r" (x) : "0" (x));
+ return x;
+}
+#else
+static __inline__ Uint64 SDL_Swap64(Uint64 x)
+{
+ Uint32 hi, lo;
+
+ /* Separate into high and low 32-bit values and swap them */
+ lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
+ x >>= 32;
+ hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
+ x = SDL_Swap32(lo);
+ x <<= 32;
+ x |= SDL_Swap32(hi);
+ return (x);
+}
+#endif
+#else
+/* This is mainly to keep compilers from complaining in SDL code.
+ * If there is no real 64-bit datatype, then compilers will complain about
+ * the fake 64-bit datatype that SDL provides when it compiles user code.
+ */
+#define SDL_Swap64(X) (X)
+#endif /* SDL_HAS_64BIT_TYPE */
+/*@}*/
+
+/**
+ * @name SDL_SwapLE and SDL_SwapBE Functions
+ * Byteswap item from the specified endianness to the native endianness
+ */
+/*@{*/
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+#define SDL_SwapLE16(X) (X)
+#define SDL_SwapLE32(X) (X)
+#define SDL_SwapLE64(X) (X)
+#define SDL_SwapBE16(X) SDL_Swap16(X)
+#define SDL_SwapBE32(X) SDL_Swap32(X)
+#define SDL_SwapBE64(X) SDL_Swap64(X)
+#else
+#define SDL_SwapLE16(X) SDL_Swap16(X)
+#define SDL_SwapLE32(X) SDL_Swap32(X)
+#define SDL_SwapLE64(X) SDL_Swap64(X)
+#define SDL_SwapBE16(X) (X)
+#define SDL_SwapBE32(X) (X)
+#define SDL_SwapBE64(X) (X)
+#endif
+/*@}*/
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_endian_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_error.h b/distrib/sdl-1.2.15/include/SDL_error.h
new file mode 100644
index 0000000..4e1cce3
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_error.h
@@ -0,0 +1,72 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/**
+ * @file SDL_error.h
+ * Simple error message routines for SDL
+ */
+
+#ifndef _SDL_error_h
+#define _SDL_error_h
+
+#include "SDL_stdinc.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @name Public functions
+ */
+/*@{*/
+extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...);
+extern DECLSPEC char * SDLCALL SDL_GetError(void);
+extern DECLSPEC void SDLCALL SDL_ClearError(void);
+/*@}*/
+
+/**
+ * @name Private functions
+ * @internal Private error message function - used internally
+ */
+/*@{*/
+#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
+#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
+typedef enum {
+ SDL_ENOMEM,
+ SDL_EFREAD,
+ SDL_EFWRITE,
+ SDL_EFSEEK,
+ SDL_UNSUPPORTED,
+ SDL_LASTERROR
+} SDL_errorcode;
+extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code);
+/*@}*/
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_error_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_events.h b/distrib/sdl-1.2.15/include/SDL_events.h
new file mode 100644
index 0000000..94b4202
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_events.h
@@ -0,0 +1,356 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/**
+ * @file SDL_events.h
+ * Include file for SDL event handling
+ */
+
+#ifndef _SDL_events_h
+#define _SDL_events_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+#include "SDL_active.h"
+#include "SDL_keyboard.h"
+#include "SDL_mouse.h"
+#include "SDL_joystick.h"
+#include "SDL_quit.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @name General keyboard/mouse state definitions */
+/*@{*/
+#define SDL_RELEASED 0
+#define SDL_PRESSED 1
+/*@}*/
+
+/** Event enumerations */
+typedef enum {
+ SDL_NOEVENT = 0, /**< Unused (do not remove) */
+ SDL_ACTIVEEVENT, /**< Application loses/gains visibility */
+ SDL_KEYDOWN, /**< Keys pressed */
+ SDL_KEYUP, /**< Keys released */
+ SDL_MOUSEMOTION, /**< Mouse moved */
+ SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */
+ SDL_MOUSEBUTTONUP, /**< Mouse button released */
+ SDL_JOYAXISMOTION, /**< Joystick axis motion */
+ SDL_JOYBALLMOTION, /**< Joystick trackball motion */
+ SDL_JOYHATMOTION, /**< Joystick hat position change */
+ SDL_JOYBUTTONDOWN, /**< Joystick button pressed */
+ SDL_JOYBUTTONUP, /**< Joystick button released */
+ SDL_QUIT, /**< User-requested quit */
+ SDL_SYSWMEVENT, /**< System specific event */
+ SDL_EVENT_RESERVEDA, /**< Reserved for future use.. */
+ SDL_EVENT_RESERVEDB, /**< Reserved for future use.. */
+ SDL_VIDEORESIZE, /**< User resized video mode */
+ SDL_VIDEOEXPOSE, /**< Screen needs to be redrawn */
+ SDL_EVENT_RESERVED2, /**< Reserved for future use.. */
+ SDL_EVENT_RESERVED3, /**< Reserved for future use.. */
+ SDL_EVENT_RESERVED4, /**< Reserved for future use.. */
+ SDL_EVENT_RESERVED5, /**< Reserved for future use.. */
+ SDL_EVENT_RESERVED6, /**< Reserved for future use.. */
+ SDL_EVENT_RESERVED7, /**< Reserved for future use.. */
+ /** Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */
+ SDL_USEREVENT = 24,
+ /** This last event is only for bounding internal arrays
+ * It is the number of bits in the event mask datatype -- Uint32
+ */
+ SDL_NUMEVENTS = 32
+} SDL_EventType;
+
+/** @name Predefined event masks */
+/*@{*/
+#define SDL_EVENTMASK(X) (1<<(X))
+typedef enum {
+ SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT),
+ SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN),
+ SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP),
+ SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN)|
+ SDL_EVENTMASK(SDL_KEYUP),
+ SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION),
+ SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN),
+ SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
+ SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION)|
+ SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)|
+ SDL_EVENTMASK(SDL_MOUSEBUTTONUP),
+ SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION),
+ SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION),
+ SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION),
+ SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN),
+ SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP),
+ SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION)|
+ SDL_EVENTMASK(SDL_JOYBALLMOTION)|
+ SDL_EVENTMASK(SDL_JOYHATMOTION)|
+ SDL_EVENTMASK(SDL_JOYBUTTONDOWN)|
+ SDL_EVENTMASK(SDL_JOYBUTTONUP),
+ SDL_VIDEORESIZEMASK = SDL_EVENTMASK(SDL_VIDEORESIZE),
+ SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE),
+ SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT),
+ SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT)
+} SDL_EventMask ;
+#define SDL_ALLEVENTS 0xFFFFFFFF
+/*@}*/
+
+/** Application visibility event structure */
+typedef struct SDL_ActiveEvent {
+ Uint8 type; /**< SDL_ACTIVEEVENT */
+ Uint8 gain; /**< Whether given states were gained or lost (1/0) */
+ Uint8 state; /**< A mask of the focus states */
+} SDL_ActiveEvent;
+
+/** Keyboard event structure */
+typedef struct SDL_KeyboardEvent {
+ Uint8 type; /**< SDL_KEYDOWN or SDL_KEYUP */
+ Uint8 which; /**< The keyboard device index */
+ Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
+ SDL_keysym keysym;
+} SDL_KeyboardEvent;
+
+/** Mouse motion event structure */
+typedef struct SDL_MouseMotionEvent {
+ Uint8 type; /**< SDL_MOUSEMOTION */
+ Uint8 which; /**< The mouse device index */
+ Uint8 state; /**< The current button state */
+ Uint16 x, y; /**< The X/Y coordinates of the mouse */
+ Sint16 xrel; /**< The relative motion in the X direction */
+ Sint16 yrel; /**< The relative motion in the Y direction */
+} SDL_MouseMotionEvent;
+
+/** Mouse button event structure */
+typedef struct SDL_MouseButtonEvent {
+ Uint8 type; /**< SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */
+ Uint8 which; /**< The mouse device index */
+ Uint8 button; /**< The mouse button index */
+ Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
+ Uint16 x, y; /**< The X/Y coordinates of the mouse at press time */
+} SDL_MouseButtonEvent;
+
+/** Joystick axis motion event structure */
+typedef struct SDL_JoyAxisEvent {
+ Uint8 type; /**< SDL_JOYAXISMOTION */
+ Uint8 which; /**< The joystick device index */
+ Uint8 axis; /**< The joystick axis index */
+ Sint16 value; /**< The axis value (range: -32768 to 32767) */
+} SDL_JoyAxisEvent;
+
+/** Joystick trackball motion event structure */
+typedef struct SDL_JoyBallEvent {
+ Uint8 type; /**< SDL_JOYBALLMOTION */
+ Uint8 which; /**< The joystick device index */
+ Uint8 ball; /**< The joystick trackball index */
+ Sint16 xrel; /**< The relative motion in the X direction */
+ Sint16 yrel; /**< The relative motion in the Y direction */
+} SDL_JoyBallEvent;
+
+/** Joystick hat position change event structure */
+typedef struct SDL_JoyHatEvent {
+ Uint8 type; /**< SDL_JOYHATMOTION */
+ Uint8 which; /**< The joystick device index */
+ Uint8 hat; /**< The joystick hat index */
+ Uint8 value; /**< The hat position value:
+ * SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP
+ * SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT
+ * SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN
+ * Note that zero means the POV is centered.
+ */
+} SDL_JoyHatEvent;
+
+/** Joystick button event structure */
+typedef struct SDL_JoyButtonEvent {
+ Uint8 type; /**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */
+ Uint8 which; /**< The joystick device index */
+ Uint8 button; /**< The joystick button index */
+ Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */
+} SDL_JoyButtonEvent;
+
+/** The "window resized" event
+ * When you get this event, you are responsible for setting a new video
+ * mode with the new width and height.
+ */
+typedef struct SDL_ResizeEvent {
+ Uint8 type; /**< SDL_VIDEORESIZE */
+ int w; /**< New width */
+ int h; /**< New height */
+} SDL_ResizeEvent;
+
+/** The "screen redraw" event */
+typedef struct SDL_ExposeEvent {
+ Uint8 type; /**< SDL_VIDEOEXPOSE */
+} SDL_ExposeEvent;
+
+/** The "quit requested" event */
+typedef struct SDL_QuitEvent {
+ Uint8 type; /**< SDL_QUIT */
+} SDL_QuitEvent;
+
+/** A user-defined event type */
+typedef struct SDL_UserEvent {
+ Uint8 type; /**< SDL_USEREVENT through SDL_NUMEVENTS-1 */
+ int code; /**< User defined event code */
+ void *data1; /**< User defined data pointer */
+ void *data2; /**< User defined data pointer */
+} SDL_UserEvent;
+
+/** If you want to use this event, you should include SDL_syswm.h */
+struct SDL_SysWMmsg;
+typedef struct SDL_SysWMmsg SDL_SysWMmsg;
+typedef struct SDL_SysWMEvent {
+ Uint8 type;
+ SDL_SysWMmsg *msg;
+} SDL_SysWMEvent;
+
+/** General event structure */
+typedef union SDL_Event {
+ Uint8 type;
+ SDL_ActiveEvent active;
+ SDL_KeyboardEvent key;
+ SDL_MouseMotionEvent motion;
+ SDL_MouseButtonEvent button;
+ SDL_JoyAxisEvent jaxis;
+ SDL_JoyBallEvent jball;
+ SDL_JoyHatEvent jhat;
+ SDL_JoyButtonEvent jbutton;
+ SDL_ResizeEvent resize;
+ SDL_ExposeEvent expose;
+ SDL_QuitEvent quit;
+ SDL_UserEvent user;
+ SDL_SysWMEvent syswm;
+} SDL_Event;
+
+
+/* Function prototypes */
+
+/** Pumps the event loop, gathering events from the input devices.
+ * This function updates the event queue and internal input device state.
+ * This should only be run in the thread that sets the video mode.
+ */
+extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
+
+typedef enum {
+ SDL_ADDEVENT,
+ SDL_PEEKEVENT,
+ SDL_GETEVENT
+} SDL_eventaction;
+
+/**
+ * Checks the event queue for messages and optionally returns them.
+ *
+ * If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to
+ * the back of the event queue.
+ * If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front
+ * of the event queue, matching 'mask', will be returned and will not
+ * be removed from the queue.
+ * If 'action' is SDL_GETEVENT, up to 'numevents' events at the front
+ * of the event queue, matching 'mask', will be returned and will be
+ * removed from the queue.
+ *
+ * @return
+ * This function returns the number of events actually stored, or -1
+ * if there was an error.
+ *
+ * This function is thread-safe.
+ */
+extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents,
+ SDL_eventaction action, Uint32 mask);
+
+/** Polls for currently pending events, and returns 1 if there are any pending
+ * events, or 0 if there are none available. If 'event' is not NULL, the next
+ * event is removed from the queue and stored in that area.
+ */
+extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event *event);
+
+/** Waits indefinitely for the next available event, returning 1, or 0 if there
+ * was an error while waiting for events. If 'event' is not NULL, the next
+ * event is removed from the queue and stored in that area.
+ */
+extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event *event);
+
+/** Add an event to the event queue.
+ * This function returns 0 on success, or -1 if the event queue was full
+ * or there was some other error.
+ */
+extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event);
+
+/** @name Event Filtering */
+/*@{*/
+typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event);
+/**
+ * This function sets up a filter to process all events before they
+ * change internal state and are posted to the internal event queue.
+ *
+ * The filter is protypted as:
+ * @code typedef int (SDLCALL *SDL_EventFilter)(const 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
+ * 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
+ * it may run in a different thread!
+ *
+ * There is one caveat when dealing with the SDL_QUITEVENT event type. The
+ * event filter is only called when the window manager desires to close the
+ * application window. If the event filter returns 1, then the window will
+ * be closed, otherwise the window will remain open if possible.
+ * If the quit event is generated by an interrupt signal, it will bypass the
+ * internal queue and be delivered to the application at the next event poll.
+ */
+extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter);
+
+/**
+ * Return the current event filter - can be used to "chain" filters.
+ * If there is no event filter set, this function returns NULL.
+ */
+extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void);
+/*@}*/
+
+/** @name Event State */
+/*@{*/
+#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 'state' is set to SDL_IGNORE, that event will be automatically dropped
+* from the event queue and will not event be filtered.
+* If 'state' is set to SDL_ENABLE, that event will be processed normally.
+* If 'state' is set to SDL_QUERY, SDL_EventState() will return the
+* current processing state of the specified event.
+*/
+extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state);
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_events_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_getenv.h b/distrib/sdl-1.2.15/include/SDL_getenv.h
new file mode 100644
index 0000000..bea6300
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_getenv.h
@@ -0,0 +1,28 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/** @file SDL_getenv.h
+ * @deprecated Use SDL_stdinc.h instead
+ */
+
+/* DEPRECATED */
+#include "SDL_stdinc.h"
diff --git a/distrib/sdl-1.2.15/include/SDL_joystick.h b/distrib/sdl-1.2.15/include/SDL_joystick.h
new file mode 100644
index 0000000..708d1a9
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_joystick.h
@@ -0,0 +1,187 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/** @file SDL_joystick.h
+ * Include file for SDL joystick event handling
+ */
+
+#ifndef _SDL_joystick_h
+#define _SDL_joystick_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @file SDL_joystick.h
+ * @note In order to use these functions, SDL_Init() must have been called
+ * with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system
+ * for joysticks, and load appropriate drivers.
+ */
+
+/** The joystick structure used to identify an SDL joystick */
+struct _SDL_Joystick;
+typedef struct _SDL_Joystick SDL_Joystick;
+
+/* Function prototypes */
+/**
+ * Count the number of joysticks attached to the system
+ */
+extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
+
+/**
+ * Get the implementation dependent name of a joystick.
+ *
+ * This can be called before any joysticks are opened.
+ * If no name can be found, this function returns NULL.
+ */
+extern DECLSPEC const char * SDLCALL SDL_JoystickName(int device_index);
+
+/**
+ * Open a joystick for use.
+ *
+ * @param[in] device_index
+ * The index passed as an argument refers to
+ * the N'th joystick on the system. This index is the value which will
+ * identify this joystick in future joystick events.
+ *
+ * @return This function returns a joystick identifier, or NULL if an error occurred.
+ */
+extern DECLSPEC SDL_Joystick * SDLCALL SDL_JoystickOpen(int device_index);
+
+/**
+ * Returns 1 if the joystick has been opened, or 0 if it has not.
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index);
+
+/**
+ * Get the device index of an opened joystick.
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickIndex(SDL_Joystick *joystick);
+
+/**
+ * Get the number of general axis controls on a joystick
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick);
+
+/**
+ * Get the number of trackballs on a joystick
+ *
+ * Joystick trackballs have only relative motion events associated
+ * with them and their state cannot be polled.
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick);
+
+/**
+ * Get the number of POV hats on a joystick
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick);
+
+/**
+ * Get the number of buttons on a joystick
+ */
+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.
+ */
+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.
+ *
+ * @param[in] state 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
+ *
+ * @param[in] axis The axis indices start at index 0.
+ *
+ * @return The state is a value ranging from -32768 to 32767.
+ */
+extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis);
+
+/**
+ * @name Hat Positions
+ * The return value of SDL_JoystickGetHat() is one of the following positions:
+ */
+/*@{*/
+#define SDL_HAT_CENTERED 0x00
+#define SDL_HAT_UP 0x01
+#define SDL_HAT_RIGHT 0x02
+#define SDL_HAT_DOWN 0x04
+#define SDL_HAT_LEFT 0x08
+#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP)
+#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)
+#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)
+#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)
+/*@}*/
+
+/**
+ * Get the current state of a POV hat on a joystick
+ *
+ * @param[in] hat The hat indices start at index 0.
+ */
+extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat);
+
+/**
+ * Get the ball axis change since the last poll
+ *
+ * @param[in] ball The ball indices start at index 0.
+ *
+ * @return This returns 0, or -1 if you passed it invalid parameters.
+ */
+extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);
+
+/**
+ * Get the current state of a button on a joystick
+ *
+ * @param[in] button The button indices start at index 0.
+ */
+extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, int button);
+
+/**
+ * Close a joystick previously opened with SDL_JoystickOpen()
+ */
+extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_joystick_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_keyboard.h b/distrib/sdl-1.2.15/include/SDL_keyboard.h
new file mode 100644
index 0000000..9d7129c
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_keyboard.h
@@ -0,0 +1,135 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/** @file SDL_keyboard.h
+ * Include file for SDL keyboard event handling
+ */
+
+#ifndef _SDL_keyboard_h
+#define _SDL_keyboard_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+#include "SDL_keysym.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Keysym structure
+ *
+ * - The scancode is hardware dependent, and should not be used by general
+ * applications. If no hardware scancode is available, it will be 0.
+ *
+ * - The 'unicode' translated character is only available when character
+ * translation is enabled by the SDL_EnableUNICODE() API. If non-zero,
+ * this is a UNICODE character corresponding to the keypress. If the
+ * high 9 bits of the character are 0, then this maps to the equivalent
+ * ASCII character:
+ * @code
+ * char ch;
+ * if ( (keysym.unicode & 0xFF80) == 0 ) {
+ * ch = keysym.unicode & 0x7F;
+ * } else {
+ * An international character..
+ * }
+ * @endcode
+ */
+typedef struct SDL_keysym {
+ Uint8 scancode; /**< hardware specific scancode */
+ SDLKey sym; /**< SDL virtual keysym */
+ SDLMod mod; /**< current key modifiers */
+ Uint16 unicode; /**< translated character */
+} SDL_keysym;
+
+/** This is the mask which refers to all hotkey bindings */
+#define SDL_ALL_HOTKEYS 0xFFFFFFFF
+
+/* Function prototypes */
+/**
+ * Enable/Disable UNICODE translation of keyboard input.
+ *
+ * This translation has some overhead, so translation defaults off.
+ *
+ * @param[in] enable
+ * If 'enable' is 1, translation is enabled.
+ * If 'enable' is 0, translation is disabled.
+ * If 'enable' is -1, the translation state is not changed.
+ *
+ * @return It returns the previous state of keyboard translation.
+ */
+extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable);
+
+#define SDL_DEFAULT_REPEAT_DELAY 500
+#define SDL_DEFAULT_REPEAT_INTERVAL 30
+/**
+ * Enable/Disable keyboard repeat. Keyboard repeat defaults to off.
+ *
+ * @param[in] delay
+ * 'delay' is the initial delay in ms between the time when a key is
+ * pressed, and keyboard repeat begins.
+ *
+ * @param[in] interval
+ * 'interval' is the time in ms between keyboard repeat events.
+ *
+ * If 'delay' is set to 0, keyboard repeat is disabled.
+ */
+extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval);
+extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval);
+
+/**
+ * Get a snapshot of the current state of the keyboard.
+ * Returns an array of keystates, indexed by the SDLK_* syms.
+ * Usage:
+ * @code
+ * Uint8 *keystate = SDL_GetKeyState(NULL);
+ * if ( keystate[SDLK_RETURN] ) //... \<RETURN> is pressed.
+ * @endcode
+ */
+extern DECLSPEC Uint8 * SDLCALL SDL_GetKeyState(int *numkeys);
+
+/**
+ * Get the current key modifier state
+ */
+extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void);
+
+/**
+ * Set the current key modifier state.
+ * This does not change the keyboard state, only the key modifier flags.
+ */
+extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate);
+
+/**
+ * Get the name of an SDL virtual keysym
+ */
+extern DECLSPEC char * SDLCALL SDL_GetKeyName(SDLKey key);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_keyboard_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_keysym.h b/distrib/sdl-1.2.15/include/SDL_keysym.h
new file mode 100644
index 0000000..f2ad12b
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_keysym.h
@@ -0,0 +1,326 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#ifndef _SDL_keysym_h
+#define _SDL_keysym_h
+
+/** What we really want is a mapping of every raw key on the keyboard.
+ * To support international keyboards, we use the range 0xA1 - 0xFF
+ * as international virtual keycodes. We'll follow in the footsteps of X11...
+ * @brief The names of the keys
+ */
+typedef enum {
+ /** @name ASCII mapped keysyms
+ * The keyboard syms have been cleverly chosen to map to ASCII
+ */
+ /*@{*/
+ SDLK_UNKNOWN = 0,
+ SDLK_FIRST = 0,
+ SDLK_BACKSPACE = 8,
+ SDLK_TAB = 9,
+ SDLK_CLEAR = 12,
+ SDLK_RETURN = 13,
+ SDLK_PAUSE = 19,
+ SDLK_ESCAPE = 27,
+ SDLK_SPACE = 32,
+ SDLK_EXCLAIM = 33,
+ SDLK_QUOTEDBL = 34,
+ SDLK_HASH = 35,
+ SDLK_DOLLAR = 36,
+ SDLK_AMPERSAND = 38,
+ SDLK_QUOTE = 39,
+ SDLK_LEFTPAREN = 40,
+ SDLK_RIGHTPAREN = 41,
+ SDLK_ASTERISK = 42,
+ SDLK_PLUS = 43,
+ SDLK_COMMA = 44,
+ SDLK_MINUS = 45,
+ SDLK_PERIOD = 46,
+ SDLK_SLASH = 47,
+ SDLK_0 = 48,
+ SDLK_1 = 49,
+ SDLK_2 = 50,
+ SDLK_3 = 51,
+ SDLK_4 = 52,
+ SDLK_5 = 53,
+ SDLK_6 = 54,
+ SDLK_7 = 55,
+ SDLK_8 = 56,
+ SDLK_9 = 57,
+ SDLK_COLON = 58,
+ SDLK_SEMICOLON = 59,
+ SDLK_LESS = 60,
+ SDLK_EQUALS = 61,
+ SDLK_GREATER = 62,
+ SDLK_QUESTION = 63,
+ SDLK_AT = 64,
+ /*
+ Skip uppercase letters
+ */
+ SDLK_LEFTBRACKET = 91,
+ SDLK_BACKSLASH = 92,
+ SDLK_RIGHTBRACKET = 93,
+ SDLK_CARET = 94,
+ SDLK_UNDERSCORE = 95,
+ SDLK_BACKQUOTE = 96,
+ SDLK_a = 97,
+ SDLK_b = 98,
+ SDLK_c = 99,
+ SDLK_d = 100,
+ SDLK_e = 101,
+ SDLK_f = 102,
+ SDLK_g = 103,
+ SDLK_h = 104,
+ SDLK_i = 105,
+ SDLK_j = 106,
+ SDLK_k = 107,
+ SDLK_l = 108,
+ SDLK_m = 109,
+ SDLK_n = 110,
+ SDLK_o = 111,
+ SDLK_p = 112,
+ SDLK_q = 113,
+ SDLK_r = 114,
+ SDLK_s = 115,
+ SDLK_t = 116,
+ SDLK_u = 117,
+ SDLK_v = 118,
+ SDLK_w = 119,
+ SDLK_x = 120,
+ SDLK_y = 121,
+ SDLK_z = 122,
+ SDLK_DELETE = 127,
+ /* End of ASCII mapped keysyms */
+ /*@}*/
+
+ /** @name International keyboard syms */
+ /*@{*/
+ SDLK_WORLD_0 = 160, /* 0xA0 */
+ SDLK_WORLD_1 = 161,
+ SDLK_WORLD_2 = 162,
+ SDLK_WORLD_3 = 163,
+ SDLK_WORLD_4 = 164,
+ SDLK_WORLD_5 = 165,
+ SDLK_WORLD_6 = 166,
+ SDLK_WORLD_7 = 167,
+ SDLK_WORLD_8 = 168,
+ SDLK_WORLD_9 = 169,
+ SDLK_WORLD_10 = 170,
+ SDLK_WORLD_11 = 171,
+ SDLK_WORLD_12 = 172,
+ SDLK_WORLD_13 = 173,
+ SDLK_WORLD_14 = 174,
+ SDLK_WORLD_15 = 175,
+ SDLK_WORLD_16 = 176,
+ SDLK_WORLD_17 = 177,
+ SDLK_WORLD_18 = 178,
+ SDLK_WORLD_19 = 179,
+ SDLK_WORLD_20 = 180,
+ SDLK_WORLD_21 = 181,
+ SDLK_WORLD_22 = 182,
+ SDLK_WORLD_23 = 183,
+ SDLK_WORLD_24 = 184,
+ SDLK_WORLD_25 = 185,
+ SDLK_WORLD_26 = 186,
+ SDLK_WORLD_27 = 187,
+ SDLK_WORLD_28 = 188,
+ SDLK_WORLD_29 = 189,
+ SDLK_WORLD_30 = 190,
+ SDLK_WORLD_31 = 191,
+ SDLK_WORLD_32 = 192,
+ SDLK_WORLD_33 = 193,
+ SDLK_WORLD_34 = 194,
+ SDLK_WORLD_35 = 195,
+ SDLK_WORLD_36 = 196,
+ SDLK_WORLD_37 = 197,
+ SDLK_WORLD_38 = 198,
+ SDLK_WORLD_39 = 199,
+ SDLK_WORLD_40 = 200,
+ SDLK_WORLD_41 = 201,
+ SDLK_WORLD_42 = 202,
+ SDLK_WORLD_43 = 203,
+ SDLK_WORLD_44 = 204,
+ SDLK_WORLD_45 = 205,
+ SDLK_WORLD_46 = 206,
+ SDLK_WORLD_47 = 207,
+ SDLK_WORLD_48 = 208,
+ SDLK_WORLD_49 = 209,
+ SDLK_WORLD_50 = 210,
+ SDLK_WORLD_51 = 211,
+ SDLK_WORLD_52 = 212,
+ SDLK_WORLD_53 = 213,
+ SDLK_WORLD_54 = 214,
+ SDLK_WORLD_55 = 215,
+ SDLK_WORLD_56 = 216,
+ SDLK_WORLD_57 = 217,
+ SDLK_WORLD_58 = 218,
+ SDLK_WORLD_59 = 219,
+ SDLK_WORLD_60 = 220,
+ SDLK_WORLD_61 = 221,
+ SDLK_WORLD_62 = 222,
+ SDLK_WORLD_63 = 223,
+ SDLK_WORLD_64 = 224,
+ SDLK_WORLD_65 = 225,
+ SDLK_WORLD_66 = 226,
+ SDLK_WORLD_67 = 227,
+ SDLK_WORLD_68 = 228,
+ SDLK_WORLD_69 = 229,
+ SDLK_WORLD_70 = 230,
+ SDLK_WORLD_71 = 231,
+ SDLK_WORLD_72 = 232,
+ SDLK_WORLD_73 = 233,
+ SDLK_WORLD_74 = 234,
+ SDLK_WORLD_75 = 235,
+ SDLK_WORLD_76 = 236,
+ SDLK_WORLD_77 = 237,
+ SDLK_WORLD_78 = 238,
+ SDLK_WORLD_79 = 239,
+ SDLK_WORLD_80 = 240,
+ SDLK_WORLD_81 = 241,
+ SDLK_WORLD_82 = 242,
+ SDLK_WORLD_83 = 243,
+ SDLK_WORLD_84 = 244,
+ SDLK_WORLD_85 = 245,
+ SDLK_WORLD_86 = 246,
+ SDLK_WORLD_87 = 247,
+ SDLK_WORLD_88 = 248,
+ SDLK_WORLD_89 = 249,
+ SDLK_WORLD_90 = 250,
+ SDLK_WORLD_91 = 251,
+ SDLK_WORLD_92 = 252,
+ SDLK_WORLD_93 = 253,
+ SDLK_WORLD_94 = 254,
+ SDLK_WORLD_95 = 255, /* 0xFF */
+ /*@}*/
+
+ /** @name Numeric keypad */
+ /*@{*/
+ SDLK_KP0 = 256,
+ SDLK_KP1 = 257,
+ SDLK_KP2 = 258,
+ SDLK_KP3 = 259,
+ SDLK_KP4 = 260,
+ SDLK_KP5 = 261,
+ SDLK_KP6 = 262,
+ SDLK_KP7 = 263,
+ SDLK_KP8 = 264,
+ SDLK_KP9 = 265,
+ SDLK_KP_PERIOD = 266,
+ SDLK_KP_DIVIDE = 267,
+ SDLK_KP_MULTIPLY = 268,
+ SDLK_KP_MINUS = 269,
+ SDLK_KP_PLUS = 270,
+ SDLK_KP_ENTER = 271,
+ SDLK_KP_EQUALS = 272,
+ /*@}*/
+
+ /** @name Arrows + Home/End pad */
+ /*@{*/
+ SDLK_UP = 273,
+ SDLK_DOWN = 274,
+ SDLK_RIGHT = 275,
+ SDLK_LEFT = 276,
+ SDLK_INSERT = 277,
+ SDLK_HOME = 278,
+ SDLK_END = 279,
+ SDLK_PAGEUP = 280,
+ SDLK_PAGEDOWN = 281,
+ /*@}*/
+
+ /** @name Function keys */
+ /*@{*/
+ SDLK_F1 = 282,
+ SDLK_F2 = 283,
+ SDLK_F3 = 284,
+ SDLK_F4 = 285,
+ SDLK_F5 = 286,
+ SDLK_F6 = 287,
+ SDLK_F7 = 288,
+ SDLK_F8 = 289,
+ SDLK_F9 = 290,
+ SDLK_F10 = 291,
+ SDLK_F11 = 292,
+ SDLK_F12 = 293,
+ SDLK_F13 = 294,
+ SDLK_F14 = 295,
+ SDLK_F15 = 296,
+ /*@}*/
+
+ /** @name Key state modifier keys */
+ /*@{*/
+ SDLK_NUMLOCK = 300,
+ SDLK_CAPSLOCK = 301,
+ SDLK_SCROLLOCK = 302,
+ SDLK_RSHIFT = 303,
+ SDLK_LSHIFT = 304,
+ SDLK_RCTRL = 305,
+ SDLK_LCTRL = 306,
+ SDLK_RALT = 307,
+ SDLK_LALT = 308,
+ SDLK_RMETA = 309,
+ SDLK_LMETA = 310,
+ SDLK_LSUPER = 311, /**< Left "Windows" key */
+ SDLK_RSUPER = 312, /**< Right "Windows" key */
+ SDLK_MODE = 313, /**< "Alt Gr" key */
+ SDLK_COMPOSE = 314, /**< Multi-key compose key */
+ /*@}*/
+
+ /** @name Miscellaneous function keys */
+ /*@{*/
+ SDLK_HELP = 315,
+ SDLK_PRINT = 316,
+ SDLK_SYSREQ = 317,
+ SDLK_BREAK = 318,
+ SDLK_MENU = 319,
+ SDLK_POWER = 320, /**< Power Macintosh power key */
+ SDLK_EURO = 321, /**< Some european keyboards */
+ SDLK_UNDO = 322, /**< Atari keyboard has Undo */
+ /*@}*/
+
+ /* Add any other keys here */
+
+ SDLK_LAST
+} SDLKey;
+
+/** Enumeration of valid key mods (possibly OR'd together) */
+typedef enum {
+ KMOD_NONE = 0x0000,
+ KMOD_LSHIFT= 0x0001,
+ KMOD_RSHIFT= 0x0002,
+ KMOD_LCTRL = 0x0040,
+ KMOD_RCTRL = 0x0080,
+ KMOD_LALT = 0x0100,
+ KMOD_RALT = 0x0200,
+ KMOD_LMETA = 0x0400,
+ KMOD_RMETA = 0x0800,
+ KMOD_NUM = 0x1000,
+ KMOD_CAPS = 0x2000,
+ KMOD_MODE = 0x4000,
+ KMOD_RESERVED = 0x8000
+} SDLMod;
+
+#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
+#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
+#define KMOD_ALT (KMOD_LALT|KMOD_RALT)
+#define KMOD_META (KMOD_LMETA|KMOD_RMETA)
+
+#endif /* _SDL_keysym_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_loadso.h b/distrib/sdl-1.2.15/include/SDL_loadso.h
new file mode 100644
index 0000000..0c5e536
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_loadso.h
@@ -0,0 +1,78 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/** @file SDL_loadso.h
+ * System dependent library loading routines
+ */
+
+/** @file SDL_loadso.h
+ * Some things to keep in mind:
+ * - These functions only work on C function names. Other languages may
+ * have name mangling and intrinsic language support that varies from
+ * compiler to compiler.
+ * - Make sure you declare your function pointers with the same calling
+ * convention as the actual library function. Your code will crash
+ * mysteriously if you do not do this.
+ * - Avoid namespace collisions. If you load a symbol from the library,
+ * it is not defined whether or not it goes into the global symbol
+ * namespace for the application. If it does and it conflicts with
+ * symbols in your code or other shared libraries, you will not get
+ * the results you expect. :)
+ */
+
+
+#ifndef _SDL_loadso_h
+#define _SDL_loadso_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * This function dynamically loads a shared object and returns a pointer
+ * to the object handle (or NULL if there was an error).
+ * The 'sofile' parameter is a system dependent name of the object file.
+ */
+extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile);
+
+/**
+ * Given an object handle, this function looks up the address of the
+ * named function in the shared object and returns it. This address
+ * is no longer valid after calling SDL_UnloadObject().
+ */
+extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name);
+
+/** Unload a shared object from memory */
+extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_loadso_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_main.h b/distrib/sdl-1.2.15/include/SDL_main.h
new file mode 100644
index 0000000..ab50ef1
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_main.h
@@ -0,0 +1,106 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#ifndef _SDL_main_h
+#define _SDL_main_h
+
+#include "SDL_stdinc.h"
+
+/** @file SDL_main.h
+ * Redefine main() on Win32 and MacOS so that it is called by winmain.c
+ */
+
+#if defined(__WIN32__) || \
+ (defined(__MWERKS__) && !defined(__BEOS__)) || \
+ defined(__MACOS__) || defined(__MACOSX__) || \
+ defined(__SYMBIAN32__) || defined(QWS)
+
+#ifdef __cplusplus
+#define C_LINKAGE "C"
+#else
+#define C_LINKAGE
+#endif /* __cplusplus */
+
+/** The application's main() function must be called with C linkage,
+ * and should be declared like this:
+ * @code
+ * #ifdef __cplusplus
+ * extern "C"
+ * #endif
+ * int main(int argc, char *argv[])
+ * {
+ * }
+ * @endcode
+ */
+#define main SDL_main
+
+/** The prototype for the application's main() function */
+extern C_LINKAGE int SDL_main(int argc, char *argv[]);
+
+
+/** @name From the SDL library code -- needed for registering the app on Win32 */
+/*@{*/
+#ifdef __WIN32__
+
+#include "begin_code.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** This should be called from your WinMain() function, if any */
+extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst);
+/** This can also be called, but is no longer necessary */
+extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst);
+/** This can also be called, but is no longer necessary (SDL_Quit calls it) */
+extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+#endif
+/*@}*/
+
+/** @name From the SDL library code -- needed for registering QuickDraw on MacOS */
+/*@{*/
+#if defined(__MACOS__)
+
+#include "begin_code.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Forward declaration so we don't need to include QuickDraw.h */
+struct QDGlobals;
+
+/** This should be called from your main() function, if any */
+extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd);
+
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+#endif
+/*@}*/
+
+#endif /* Need to redefine main()? */
+
+#endif /* _SDL_main_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_mouse.h b/distrib/sdl-1.2.15/include/SDL_mouse.h
new file mode 100644
index 0000000..7c563b9
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_mouse.h
@@ -0,0 +1,143 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/** @file SDL_mouse.h
+ * Include file for SDL mouse event handling
+ */
+
+#ifndef _SDL_mouse_h
+#define _SDL_mouse_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+#include "SDL_video.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct WMcursor WMcursor; /**< Implementation dependent */
+typedef struct SDL_Cursor {
+ SDL_Rect area; /**< The area of the mouse cursor */
+ Sint16 hot_x, hot_y; /**< The "tip" of the cursor */
+ Uint8 *data; /**< B/W cursor data */
+ Uint8 *mask; /**< B/W cursor mask */
+ Uint8 *save[2]; /**< Place to save cursor area */
+ WMcursor *wm_cursor; /**< Window-manager cursor */
+} SDL_Cursor;
+
+/* Function prototypes */
+/**
+ * Retrieve the current state of the mouse.
+ * The current button state is returned as a button bitmask, which can
+ * be tested using the SDL_BUTTON(X) macros, and x and y are set to the
+ * current mouse cursor position. You can pass NULL for either x or y.
+ */
+extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y);
+
+/**
+ * Retrieve the current state of the mouse.
+ * The current button state is returned as a button bitmask, which can
+ * be tested using the SDL_BUTTON(X) macros, and x and y are set to the
+ * mouse deltas since the last call to SDL_GetRelativeMouseState().
+ */
+extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
+
+/**
+ * Set the position of the mouse cursor (generates a mouse motion event)
+ */
+extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);
+
+/**
+ * Create a cursor using the specified data and mask (in MSB format).
+ * The cursor width must be a multiple of 8 bits.
+ *
+ * The cursor is created in black and white according to the following:
+ * data mask resulting pixel on screen
+ * 0 1 White
+ * 1 1 Black
+ * 0 0 Transparent
+ * 1 0 Inverted color if possible, black if not.
+ *
+ * Cursors created with this function must be freed with SDL_FreeCursor().
+ */
+extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor
+ (Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
+
+/**
+ * Set the currently active cursor to the specified one.
+ * If the cursor is currently visible, the change will be immediately
+ * represented on the display.
+ */
+extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor);
+
+/**
+ * Returns the currently active cursor.
+ */
+extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void);
+
+/**
+ * Deallocates a cursor created with SDL_CreateCursor().
+ */
+extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor);
+
+/**
+ * Toggle whether or not the cursor is shown on the screen.
+ * The cursor start off displayed, but can be turned off.
+ * SDL_ShowCursor() returns 1 if the cursor was being displayed
+ * before the call, or 0 if it was not. You can query the current
+ * state by passing a 'toggle' value of -1.
+ */
+extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
+
+/*@{*/
+/** Used as a mask when testing buttons in buttonstate
+ * Button 1: Left mouse button
+ * Button 2: Middle mouse button
+ * Button 3: Right mouse button
+ * Button 4: Mouse wheel up (may also be a real button)
+ * Button 5: Mouse wheel down (may also be a real button)
+ */
+#define SDL_BUTTON(X) (1 << ((X)-1))
+#define SDL_BUTTON_LEFT 1
+#define SDL_BUTTON_MIDDLE 2
+#define SDL_BUTTON_RIGHT 3
+#define SDL_BUTTON_WHEELUP 4
+#define SDL_BUTTON_WHEELDOWN 5
+#define SDL_BUTTON_X1 6
+#define SDL_BUTTON_X2 7
+#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)
+#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)
+#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)
+#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1)
+#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2)
+/*@}*/
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_mouse_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_mutex.h b/distrib/sdl-1.2.15/include/SDL_mutex.h
new file mode 100644
index 0000000..c8da9b1
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_mutex.h
@@ -0,0 +1,177 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#ifndef _SDL_mutex_h
+#define _SDL_mutex_h
+
+/** @file SDL_mutex.h
+ * Functions to provide thread synchronization primitives
+ *
+ * @note These are independent of the other SDL routines.
+ */
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Synchronization functions which can time out return this value
+ * if they time out.
+ */
+#define SDL_MUTEX_TIMEDOUT 1
+
+/** This is the timeout value which corresponds to never time out */
+#define SDL_MUTEX_MAXWAIT (~(Uint32)0)
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** @name Mutex functions */ /*@{*/
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/** The SDL mutex structure, defined in SDL_mutex.c */
+struct SDL_mutex;
+typedef struct SDL_mutex SDL_mutex;
+
+/** Create a mutex, initialized unlocked */
+extern DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void);
+
+#define SDL_LockMutex(m) SDL_mutexP(m)
+/** Lock the mutex
+ * @return 0, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex);
+
+#define SDL_UnlockMutex(m) SDL_mutexV(m)
+/** Unlock the mutex
+ * @return 0, or -1 on error
+ *
+ * It is an error to unlock a mutex that has not been locked by
+ * the current thread, and doing so results in undefined behavior.
+ */
+extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex);
+
+/** Destroy a mutex */
+extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex);
+
+/*@}*/
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** @name Semaphore functions */ /*@{*/
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/** The SDL semaphore structure, defined in SDL_sem.c */
+struct SDL_semaphore;
+typedef struct SDL_semaphore SDL_sem;
+
+/** Create a semaphore, initialized with value, returns NULL on failure. */
+extern DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value);
+
+/** Destroy a semaphore */
+extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem);
+
+/**
+ * This function suspends the calling thread until the semaphore pointed
+ * to by sem has a positive count. It then atomically decreases the semaphore
+ * count.
+ */
+extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem);
+
+/** Non-blocking variant of SDL_SemWait().
+ * @return 0 if the wait succeeds,
+ * SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error.
+ */
+extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem *sem);
+
+/** Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if
+ * the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in
+ * the allotted time, and -1 on error.
+ *
+ * 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);
+
+/** Returns the current count of the semaphore */
+extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem);
+
+/*@}*/
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** @name Condition_variable_functions */ /*@{*/
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*@{*/
+/** The SDL condition variable structure, defined in SDL_cond.c */
+struct SDL_cond;
+typedef struct SDL_cond SDL_cond;
+/*@}*/
+
+/** Create a condition variable */
+extern DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void);
+
+/** Destroy a condition variable */
+extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond);
+
+/** Restart one of the threads that are waiting on the condition variable,
+ * @return 0 or -1 on error.
+ */
+extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond);
+
+/** Restart all threads that are waiting on the condition variable,
+ * @return 0 or -1 on error.
+ */
+extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond);
+
+/** Wait on the condition variable, unlocking the provided mutex.
+ * The mutex must be locked before entering this function!
+ * 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 *mut);
+
+/** Waits for at most 'ms' milliseconds, and returns 0 if the condition
+ * variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not
+ * signaled in the allotted time, and -1 on error.
+ * On some platforms this function is implemented by looping with a delay
+ * of 1 ms, and so should be avoided if possible.
+ */
+extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms);
+
+/*@}*/
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_mutex_h */
+
diff --git a/distrib/sdl-1.2.12/include/SDL_name.h b/distrib/sdl-1.2.15/include/SDL_name.h
index 511619a..511619a 100644
--- a/distrib/sdl-1.2.12/include/SDL_name.h
+++ b/distrib/sdl-1.2.15/include/SDL_name.h
diff --git a/distrib/sdl-1.2.15/include/SDL_opengl.h b/distrib/sdl-1.2.15/include/SDL_opengl.h
new file mode 100644
index 0000000..3d791d6
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_opengl.h
@@ -0,0 +1,6570 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/** @file SDL_opengl.h
+ * This is a simple file to encapsulate the OpenGL API headers
+ */
+
+#include "SDL_config.h"
+
+#ifdef __WIN32__
+#define WIN32_LEAN_AND_MEAN
+#ifndef NOMINMAX
+#define NOMINMAX /* Don't defined min() and max() */
+#endif
+#include <windows.h>
+#endif
+#ifndef NO_SDL_GLEXT
+#define __glext_h_ /* Don't let gl.h include glext.h */
+#endif
+#if defined(__MACOSX__)
+#include <OpenGL/gl.h> /* Header File For The OpenGL Library */
+#include <OpenGL/glu.h> /* Header File For The GLU Library */
+#elif defined(__MACOS__)
+#include <gl.h> /* Header File For The OpenGL Library */
+#include <glu.h> /* Header File For The GLU Library */
+#else
+#include <GL/gl.h> /* Header File For The OpenGL Library */
+#include <GL/glu.h> /* Header File For The GLU Library */
+#endif
+#ifndef NO_SDL_GLEXT
+#undef __glext_h_
+#endif
+
+/** @name GLext.h
+ * This file taken from "GLext.h" from the Jeff Molofee OpenGL tutorials.
+ * It is included here because glext.h is not available on some systems.
+ * If you don't want this version included, simply define "NO_SDL_GLEXT"
+ */
+/*@{*/
+#ifndef NO_SDL_GLEXT
+#if !defined(__glext_h_) && !defined(GL_GLEXT_LEGACY)
+#define __glext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: This software was created using the
+** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
+** not been independently verified as being compliant with the OpenGL(R)
+** version 1.2.1 Specification.
+*/
+
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+/*************************************************************/
+
+/* Header file version number, required by OpenGL ABI for Linux */
+/* glext.h last updated 2005/06/20 */
+/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
+#define GL_GLEXT_VERSION 29
+
+#ifndef GL_VERSION_1_2
+#define GL_UNSIGNED_BYTE_3_3_2 0x8032
+#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
+#define GL_UNSIGNED_INT_8_8_8_8 0x8035
+#define GL_UNSIGNED_INT_10_10_10_2 0x8036
+#define GL_RESCALE_NORMAL 0x803A
+#define GL_TEXTURE_BINDING_3D 0x806A
+#define GL_PACK_SKIP_IMAGES 0x806B
+#define GL_PACK_IMAGE_HEIGHT 0x806C
+#define GL_UNPACK_SKIP_IMAGES 0x806D
+#define GL_UNPACK_IMAGE_HEIGHT 0x806E
+#define GL_TEXTURE_3D 0x806F
+#define GL_PROXY_TEXTURE_3D 0x8070
+#define GL_TEXTURE_DEPTH 0x8071
+#define GL_TEXTURE_WRAP_R 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE 0x8073
+#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
+#define GL_UNSIGNED_SHORT_5_6_5 0x8363
+#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
+#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
+#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
+#define GL_BGR 0x80E0
+#define GL_BGRA 0x80E1
+#define GL_MAX_ELEMENTS_VERTICES 0x80E8
+#define GL_MAX_ELEMENTS_INDICES 0x80E9
+#define GL_CLAMP_TO_EDGE 0x812F
+#define GL_TEXTURE_MIN_LOD 0x813A
+#define GL_TEXTURE_MAX_LOD 0x813B
+#define GL_TEXTURE_BASE_LEVEL 0x813C
+#define GL_TEXTURE_MAX_LEVEL 0x813D
+#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
+#define GL_SINGLE_COLOR 0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
+#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
+#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
+#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#endif
+
+#ifndef GL_ARB_imaging
+#define GL_CONSTANT_COLOR 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
+#define GL_CONSTANT_ALPHA 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
+#define GL_BLEND_COLOR 0x8005
+#define GL_FUNC_ADD 0x8006
+#define GL_MIN 0x8007
+#define GL_MAX 0x8008
+#define GL_BLEND_EQUATION 0x8009
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+#define GL_CONVOLUTION_1D 0x8010
+#define GL_CONVOLUTION_2D 0x8011
+#define GL_SEPARABLE_2D 0x8012
+#define GL_CONVOLUTION_BORDER_MODE 0x8013
+#define GL_CONVOLUTION_FILTER_SCALE 0x8014
+#define GL_CONVOLUTION_FILTER_BIAS 0x8015
+#define GL_REDUCE 0x8016
+#define GL_CONVOLUTION_FORMAT 0x8017
+#define GL_CONVOLUTION_WIDTH 0x8018
+#define GL_CONVOLUTION_HEIGHT 0x8019
+#define GL_MAX_CONVOLUTION_WIDTH 0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
+#define GL_HISTOGRAM 0x8024
+#define GL_PROXY_HISTOGRAM 0x8025
+#define GL_HISTOGRAM_WIDTH 0x8026
+#define GL_HISTOGRAM_FORMAT 0x8027
+#define GL_HISTOGRAM_RED_SIZE 0x8028
+#define GL_HISTOGRAM_GREEN_SIZE 0x8029
+#define GL_HISTOGRAM_BLUE_SIZE 0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
+#define GL_HISTOGRAM_SINK 0x802D
+#define GL_MINMAX 0x802E
+#define GL_MINMAX_FORMAT 0x802F
+#define GL_MINMAX_SINK 0x8030
+#define GL_TABLE_TOO_LARGE 0x8031
+#define GL_COLOR_MATRIX 0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
+#define GL_COLOR_TABLE 0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
+#define GL_PROXY_COLOR_TABLE 0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
+#define GL_COLOR_TABLE_SCALE 0x80D6
+#define GL_COLOR_TABLE_BIAS 0x80D7
+#define GL_COLOR_TABLE_FORMAT 0x80D8
+#define GL_COLOR_TABLE_WIDTH 0x80D9
+#define GL_COLOR_TABLE_RED_SIZE 0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
+#define GL_CONSTANT_BORDER 0x8151
+#define GL_REPLICATE_BORDER 0x8153
+#define GL_CONVOLUTION_BORDER_COLOR 0x8154
+#endif
+
+#ifndef GL_VERSION_1_3
+#define GL_TEXTURE0 0x84C0
+#define GL_TEXTURE1 0x84C1
+#define GL_TEXTURE2 0x84C2
+#define GL_TEXTURE3 0x84C3
+#define GL_TEXTURE4 0x84C4
+#define GL_TEXTURE5 0x84C5
+#define GL_TEXTURE6 0x84C6
+#define GL_TEXTURE7 0x84C7
+#define GL_TEXTURE8 0x84C8
+#define GL_TEXTURE9 0x84C9
+#define GL_TEXTURE10 0x84CA
+#define GL_TEXTURE11 0x84CB
+#define GL_TEXTURE12 0x84CC
+#define GL_TEXTURE13 0x84CD
+#define GL_TEXTURE14 0x84CE
+#define GL_TEXTURE15 0x84CF
+#define GL_TEXTURE16 0x84D0
+#define GL_TEXTURE17 0x84D1
+#define GL_TEXTURE18 0x84D2
+#define GL_TEXTURE19 0x84D3
+#define GL_TEXTURE20 0x84D4
+#define GL_TEXTURE21 0x84D5
+#define GL_TEXTURE22 0x84D6
+#define GL_TEXTURE23 0x84D7
+#define GL_TEXTURE24 0x84D8
+#define GL_TEXTURE25 0x84D9
+#define GL_TEXTURE26 0x84DA
+#define GL_TEXTURE27 0x84DB
+#define GL_TEXTURE28 0x84DC
+#define GL_TEXTURE29 0x84DD
+#define GL_TEXTURE30 0x84DE
+#define GL_TEXTURE31 0x84DF
+#define GL_ACTIVE_TEXTURE 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
+#define GL_MAX_TEXTURE_UNITS 0x84E2
+#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
+#define GL_MULTISAMPLE 0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
+#define GL_SAMPLE_COVERAGE 0x80A0
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
+#define GL_MULTISAMPLE_BIT 0x20000000
+#define GL_NORMAL_MAP 0x8511
+#define GL_REFLECTION_MAP 0x8512
+#define GL_TEXTURE_CUBE_MAP 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
+#define GL_COMPRESSED_ALPHA 0x84E9
+#define GL_COMPRESSED_LUMINANCE 0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
+#define GL_COMPRESSED_INTENSITY 0x84EC
+#define GL_COMPRESSED_RGB 0x84ED
+#define GL_COMPRESSED_RGBA 0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
+#define GL_TEXTURE_COMPRESSED 0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+#define GL_CLAMP_TO_BORDER 0x812D
+#define GL_COMBINE 0x8570
+#define GL_COMBINE_RGB 0x8571
+#define GL_COMBINE_ALPHA 0x8572
+#define GL_SOURCE0_RGB 0x8580
+#define GL_SOURCE1_RGB 0x8581
+#define GL_SOURCE2_RGB 0x8582
+#define GL_SOURCE0_ALPHA 0x8588
+#define GL_SOURCE1_ALPHA 0x8589
+#define GL_SOURCE2_ALPHA 0x858A
+#define GL_OPERAND0_RGB 0x8590
+#define GL_OPERAND1_RGB 0x8591
+#define GL_OPERAND2_RGB 0x8592
+#define GL_OPERAND0_ALPHA 0x8598
+#define GL_OPERAND1_ALPHA 0x8599
+#define GL_OPERAND2_ALPHA 0x859A
+#define GL_RGB_SCALE 0x8573
+#define GL_ADD_SIGNED 0x8574
+#define GL_INTERPOLATE 0x8575
+#define GL_SUBTRACT 0x84E7
+#define GL_CONSTANT 0x8576
+#define GL_PRIMARY_COLOR 0x8577
+#define GL_PREVIOUS 0x8578
+#define GL_DOT3_RGB 0x86AE
+#define GL_DOT3_RGBA 0x86AF
+#endif
+
+#ifndef GL_VERSION_1_4
+#define GL_BLEND_DST_RGB 0x80C8
+#define GL_BLEND_SRC_RGB 0x80C9
+#define GL_BLEND_DST_ALPHA 0x80CA
+#define GL_BLEND_SRC_ALPHA 0x80CB
+#define GL_POINT_SIZE_MIN 0x8126
+#define GL_POINT_SIZE_MAX 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
+#define GL_POINT_DISTANCE_ATTENUATION 0x8129
+#define GL_GENERATE_MIPMAP 0x8191
+#define GL_GENERATE_MIPMAP_HINT 0x8192
+#define GL_DEPTH_COMPONENT16 0x81A5
+#define GL_DEPTH_COMPONENT24 0x81A6
+#define GL_DEPTH_COMPONENT32 0x81A7
+#define GL_MIRRORED_REPEAT 0x8370
+#define GL_FOG_COORDINATE_SOURCE 0x8450
+#define GL_FOG_COORDINATE 0x8451
+#define GL_FRAGMENT_DEPTH 0x8452
+#define GL_CURRENT_FOG_COORDINATE 0x8453
+#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454
+#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455
+#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456
+#define GL_FOG_COORDINATE_ARRAY 0x8457
+#define GL_COLOR_SUM 0x8458
+#define GL_CURRENT_SECONDARY_COLOR 0x8459
+#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A
+#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B
+#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C
+#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
+#define GL_SECONDARY_COLOR_ARRAY 0x845E
+#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
+#define GL_TEXTURE_FILTER_CONTROL 0x8500
+#define GL_TEXTURE_LOD_BIAS 0x8501
+#define GL_INCR_WRAP 0x8507
+#define GL_DECR_WRAP 0x8508
+#define GL_TEXTURE_DEPTH_SIZE 0x884A
+#define GL_DEPTH_TEXTURE_MODE 0x884B
+#define GL_TEXTURE_COMPARE_MODE 0x884C
+#define GL_TEXTURE_COMPARE_FUNC 0x884D
+#define GL_COMPARE_R_TO_TEXTURE 0x884E
+#endif
+
+#ifndef GL_VERSION_1_5
+#define GL_BUFFER_SIZE 0x8764
+#define GL_BUFFER_USAGE 0x8765
+#define GL_QUERY_COUNTER_BITS 0x8864
+#define GL_CURRENT_QUERY 0x8865
+#define GL_QUERY_RESULT 0x8866
+#define GL_QUERY_RESULT_AVAILABLE 0x8867
+#define GL_ARRAY_BUFFER 0x8892
+#define GL_ELEMENT_ARRAY_BUFFER 0x8893
+#define GL_ARRAY_BUFFER_BINDING 0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
+#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
+#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
+#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
+#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
+#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
+#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
+#define GL_READ_ONLY 0x88B8
+#define GL_WRITE_ONLY 0x88B9
+#define GL_READ_WRITE 0x88BA
+#define GL_BUFFER_ACCESS 0x88BB
+#define GL_BUFFER_MAPPED 0x88BC
+#define GL_BUFFER_MAP_POINTER 0x88BD
+#define GL_STREAM_DRAW 0x88E0
+#define GL_STREAM_READ 0x88E1
+#define GL_STREAM_COPY 0x88E2
+#define GL_STATIC_DRAW 0x88E4
+#define GL_STATIC_READ 0x88E5
+#define GL_STATIC_COPY 0x88E6
+#define GL_DYNAMIC_DRAW 0x88E8
+#define GL_DYNAMIC_READ 0x88E9
+#define GL_DYNAMIC_COPY 0x88EA
+#define GL_SAMPLES_PASSED 0x8914
+#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE
+#define GL_FOG_COORD GL_FOG_COORDINATE
+#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE
+#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE
+#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE
+#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER
+#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY
+#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING
+#define GL_SRC0_RGB GL_SOURCE0_RGB
+#define GL_SRC1_RGB GL_SOURCE1_RGB
+#define GL_SRC2_RGB GL_SOURCE2_RGB
+#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA
+#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA
+#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA
+#endif
+
+#ifndef GL_VERSION_2_0
+#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
+#define GL_CURRENT_VERTEX_ATTRIB 0x8626
+#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
+#define GL_STENCIL_BACK_FUNC 0x8800
+#define GL_STENCIL_BACK_FAIL 0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
+#define GL_MAX_DRAW_BUFFERS 0x8824
+#define GL_DRAW_BUFFER0 0x8825
+#define GL_DRAW_BUFFER1 0x8826
+#define GL_DRAW_BUFFER2 0x8827
+#define GL_DRAW_BUFFER3 0x8828
+#define GL_DRAW_BUFFER4 0x8829
+#define GL_DRAW_BUFFER5 0x882A
+#define GL_DRAW_BUFFER6 0x882B
+#define GL_DRAW_BUFFER7 0x882C
+#define GL_DRAW_BUFFER8 0x882D
+#define GL_DRAW_BUFFER9 0x882E
+#define GL_DRAW_BUFFER10 0x882F
+#define GL_DRAW_BUFFER11 0x8830
+#define GL_DRAW_BUFFER12 0x8831
+#define GL_DRAW_BUFFER13 0x8832
+#define GL_DRAW_BUFFER14 0x8833
+#define GL_DRAW_BUFFER15 0x8834
+#define GL_BLEND_EQUATION_ALPHA 0x883D
+#define GL_POINT_SPRITE 0x8861
+#define GL_COORD_REPLACE 0x8862
+#define GL_MAX_VERTEX_ATTRIBS 0x8869
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
+#define GL_MAX_TEXTURE_COORDS 0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
+#define GL_FRAGMENT_SHADER 0x8B30
+#define GL_VERTEX_SHADER 0x8B31
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
+#define GL_MAX_VARYING_FLOATS 0x8B4B
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
+#define GL_SHADER_TYPE 0x8B4F
+#define GL_FLOAT_VEC2 0x8B50
+#define GL_FLOAT_VEC3 0x8B51
+#define GL_FLOAT_VEC4 0x8B52
+#define GL_INT_VEC2 0x8B53
+#define GL_INT_VEC3 0x8B54
+#define GL_INT_VEC4 0x8B55
+#define GL_BOOL 0x8B56
+#define GL_BOOL_VEC2 0x8B57
+#define GL_BOOL_VEC3 0x8B58
+#define GL_BOOL_VEC4 0x8B59
+#define GL_FLOAT_MAT2 0x8B5A
+#define GL_FLOAT_MAT3 0x8B5B
+#define GL_FLOAT_MAT4 0x8B5C
+#define GL_SAMPLER_1D 0x8B5D
+#define GL_SAMPLER_2D 0x8B5E
+#define GL_SAMPLER_3D 0x8B5F
+#define GL_SAMPLER_CUBE 0x8B60
+#define GL_SAMPLER_1D_SHADOW 0x8B61
+#define GL_SAMPLER_2D_SHADOW 0x8B62
+#define GL_DELETE_STATUS 0x8B80
+#define GL_COMPILE_STATUS 0x8B81
+#define GL_LINK_STATUS 0x8B82
+#define GL_VALIDATE_STATUS 0x8B83
+#define GL_INFO_LOG_LENGTH 0x8B84
+#define GL_ATTACHED_SHADERS 0x8B85
+#define GL_ACTIVE_UNIFORMS 0x8B86
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
+#define GL_SHADER_SOURCE_LENGTH 0x8B88
+#define GL_ACTIVE_ATTRIBUTES 0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
+#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
+#define GL_CURRENT_PROGRAM 0x8B8D
+#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
+#define GL_LOWER_LEFT 0x8CA1
+#define GL_UPPER_LEFT 0x8CA2
+#define GL_STENCIL_BACK_REF 0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
+#endif
+
+#ifndef GL_ARB_multitexture
+#define GL_TEXTURE0_ARB 0x84C0
+#define GL_TEXTURE1_ARB 0x84C1
+#define GL_TEXTURE2_ARB 0x84C2
+#define GL_TEXTURE3_ARB 0x84C3
+#define GL_TEXTURE4_ARB 0x84C4
+#define GL_TEXTURE5_ARB 0x84C5
+#define GL_TEXTURE6_ARB 0x84C6
+#define GL_TEXTURE7_ARB 0x84C7
+#define GL_TEXTURE8_ARB 0x84C8
+#define GL_TEXTURE9_ARB 0x84C9
+#define GL_TEXTURE10_ARB 0x84CA
+#define GL_TEXTURE11_ARB 0x84CB
+#define GL_TEXTURE12_ARB 0x84CC
+#define GL_TEXTURE13_ARB 0x84CD
+#define GL_TEXTURE14_ARB 0x84CE
+#define GL_TEXTURE15_ARB 0x84CF
+#define GL_TEXTURE16_ARB 0x84D0
+#define GL_TEXTURE17_ARB 0x84D1
+#define GL_TEXTURE18_ARB 0x84D2
+#define GL_TEXTURE19_ARB 0x84D3
+#define GL_TEXTURE20_ARB 0x84D4
+#define GL_TEXTURE21_ARB 0x84D5
+#define GL_TEXTURE22_ARB 0x84D6
+#define GL_TEXTURE23_ARB 0x84D7
+#define GL_TEXTURE24_ARB 0x84D8
+#define GL_TEXTURE25_ARB 0x84D9
+#define GL_TEXTURE26_ARB 0x84DA
+#define GL_TEXTURE27_ARB 0x84DB
+#define GL_TEXTURE28_ARB 0x84DC
+#define GL_TEXTURE29_ARB 0x84DD
+#define GL_TEXTURE30_ARB 0x84DE
+#define GL_TEXTURE31_ARB 0x84DF
+#define GL_ACTIVE_TEXTURE_ARB 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
+#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
+#endif
+
+#ifndef GL_ARB_transpose_matrix
+#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6
+#endif
+
+#ifndef GL_ARB_multisample
+#define GL_MULTISAMPLE_ARB 0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F
+#define GL_SAMPLE_COVERAGE_ARB 0x80A0
+#define GL_SAMPLE_BUFFERS_ARB 0x80A8
+#define GL_SAMPLES_ARB 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB
+#define GL_MULTISAMPLE_BIT_ARB 0x20000000
+#endif
+
+#ifndef GL_ARB_texture_env_add
+#endif
+
+#ifndef GL_ARB_texture_cube_map
+#define GL_NORMAL_MAP_ARB 0x8511
+#define GL_REFLECTION_MAP_ARB 0x8512
+#define GL_TEXTURE_CUBE_MAP_ARB 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C
+#endif
+
+#ifndef GL_ARB_texture_compression
+#define GL_COMPRESSED_ALPHA_ARB 0x84E9
+#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
+#define GL_COMPRESSED_INTENSITY_ARB 0x84EC
+#define GL_COMPRESSED_RGB_ARB 0x84ED
+#define GL_COMPRESSED_RGBA_ARB 0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
+#define GL_TEXTURE_COMPRESSED_ARB 0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
+#endif
+
+#ifndef GL_ARB_texture_border_clamp
+#define GL_CLAMP_TO_BORDER_ARB 0x812D
+#endif
+
+#ifndef GL_ARB_point_parameters
+#define GL_POINT_SIZE_MIN_ARB 0x8126
+#define GL_POINT_SIZE_MAX_ARB 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128
+#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129
+#endif
+
+#ifndef GL_ARB_vertex_blend
+#define GL_MAX_VERTEX_UNITS_ARB 0x86A4
+#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5
+#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6
+#define GL_VERTEX_BLEND_ARB 0x86A7
+#define GL_CURRENT_WEIGHT_ARB 0x86A8
+#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9
+#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA
+#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB
+#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC
+#define GL_WEIGHT_ARRAY_ARB 0x86AD
+#define GL_MODELVIEW0_ARB 0x1700
+#define GL_MODELVIEW1_ARB 0x850A
+#define GL_MODELVIEW2_ARB 0x8722
+#define GL_MODELVIEW3_ARB 0x8723
+#define GL_MODELVIEW4_ARB 0x8724
+#define GL_MODELVIEW5_ARB 0x8725
+#define GL_MODELVIEW6_ARB 0x8726
+#define GL_MODELVIEW7_ARB 0x8727
+#define GL_MODELVIEW8_ARB 0x8728
+#define GL_MODELVIEW9_ARB 0x8729
+#define GL_MODELVIEW10_ARB 0x872A
+#define GL_MODELVIEW11_ARB 0x872B
+#define GL_MODELVIEW12_ARB 0x872C
+#define GL_MODELVIEW13_ARB 0x872D
+#define GL_MODELVIEW14_ARB 0x872E
+#define GL_MODELVIEW15_ARB 0x872F
+#define GL_MODELVIEW16_ARB 0x8730
+#define GL_MODELVIEW17_ARB 0x8731
+#define GL_MODELVIEW18_ARB 0x8732
+#define GL_MODELVIEW19_ARB 0x8733
+#define GL_MODELVIEW20_ARB 0x8734
+#define GL_MODELVIEW21_ARB 0x8735
+#define GL_MODELVIEW22_ARB 0x8736
+#define GL_MODELVIEW23_ARB 0x8737
+#define GL_MODELVIEW24_ARB 0x8738
+#define GL_MODELVIEW25_ARB 0x8739
+#define GL_MODELVIEW26_ARB 0x873A
+#define GL_MODELVIEW27_ARB 0x873B
+#define GL_MODELVIEW28_ARB 0x873C
+#define GL_MODELVIEW29_ARB 0x873D
+#define GL_MODELVIEW30_ARB 0x873E
+#define GL_MODELVIEW31_ARB 0x873F
+#endif
+
+#ifndef GL_ARB_matrix_palette
+#define GL_MATRIX_PALETTE_ARB 0x8840
+#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841
+#define GL_MAX_PALETTE_MATRICES_ARB 0x8842
+#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843
+#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844
+#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845
+#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846
+#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847
+#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848
+#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849
+#endif
+
+#ifndef GL_ARB_texture_env_combine
+#define GL_COMBINE_ARB 0x8570
+#define GL_COMBINE_RGB_ARB 0x8571
+#define GL_COMBINE_ALPHA_ARB 0x8572
+#define GL_SOURCE0_RGB_ARB 0x8580
+#define GL_SOURCE1_RGB_ARB 0x8581
+#define GL_SOURCE2_RGB_ARB 0x8582
+#define GL_SOURCE0_ALPHA_ARB 0x8588
+#define GL_SOURCE1_ALPHA_ARB 0x8589
+#define GL_SOURCE2_ALPHA_ARB 0x858A
+#define GL_OPERAND0_RGB_ARB 0x8590
+#define GL_OPERAND1_RGB_ARB 0x8591
+#define GL_OPERAND2_RGB_ARB 0x8592
+#define GL_OPERAND0_ALPHA_ARB 0x8598
+#define GL_OPERAND1_ALPHA_ARB 0x8599
+#define GL_OPERAND2_ALPHA_ARB 0x859A
+#define GL_RGB_SCALE_ARB 0x8573
+#define GL_ADD_SIGNED_ARB 0x8574
+#define GL_INTERPOLATE_ARB 0x8575
+#define GL_SUBTRACT_ARB 0x84E7
+#define GL_CONSTANT_ARB 0x8576
+#define GL_PRIMARY_COLOR_ARB 0x8577
+#define GL_PREVIOUS_ARB 0x8578
+#endif
+
+#ifndef GL_ARB_texture_env_crossbar
+#endif
+
+#ifndef GL_ARB_texture_env_dot3
+#define GL_DOT3_RGB_ARB 0x86AE
+#define GL_DOT3_RGBA_ARB 0x86AF
+#endif
+
+#ifndef GL_ARB_texture_mirrored_repeat
+#define GL_MIRRORED_REPEAT_ARB 0x8370
+#endif
+
+#ifndef GL_ARB_depth_texture
+#define GL_DEPTH_COMPONENT16_ARB 0x81A5
+#define GL_DEPTH_COMPONENT24_ARB 0x81A6
+#define GL_DEPTH_COMPONENT32_ARB 0x81A7
+#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A
+#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B
+#endif
+
+#ifndef GL_ARB_shadow
+#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C
+#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D
+#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E
+#endif
+
+#ifndef GL_ARB_shadow_ambient
+#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
+#endif
+
+#ifndef GL_ARB_window_pos
+#endif
+
+#ifndef GL_ARB_vertex_program
+#define GL_COLOR_SUM_ARB 0x8458
+#define GL_VERTEX_PROGRAM_ARB 0x8620
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625
+#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626
+#define GL_PROGRAM_LENGTH_ARB 0x8627
+#define GL_PROGRAM_STRING_ARB 0x8628
+#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E
+#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F
+#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640
+#define GL_CURRENT_MATRIX_ARB 0x8641
+#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645
+#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B
+#define GL_PROGRAM_BINDING_ARB 0x8677
+#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A
+#define GL_PROGRAM_ERROR_STRING_ARB 0x8874
+#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875
+#define GL_PROGRAM_FORMAT_ARB 0x8876
+#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0
+#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1
+#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2
+#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3
+#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4
+#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5
+#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6
+#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7
+#define GL_PROGRAM_PARAMETERS_ARB 0x88A8
+#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9
+#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA
+#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB
+#define GL_PROGRAM_ATTRIBS_ARB 0x88AC
+#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD
+#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE
+#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF
+#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0
+#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1
+#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2
+#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3
+#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4
+#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5
+#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6
+#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7
+#define GL_MATRIX0_ARB 0x88C0
+#define GL_MATRIX1_ARB 0x88C1
+#define GL_MATRIX2_ARB 0x88C2
+#define GL_MATRIX3_ARB 0x88C3
+#define GL_MATRIX4_ARB 0x88C4
+#define GL_MATRIX5_ARB 0x88C5
+#define GL_MATRIX6_ARB 0x88C6
+#define GL_MATRIX7_ARB 0x88C7
+#define GL_MATRIX8_ARB 0x88C8
+#define GL_MATRIX9_ARB 0x88C9
+#define GL_MATRIX10_ARB 0x88CA
+#define GL_MATRIX11_ARB 0x88CB
+#define GL_MATRIX12_ARB 0x88CC
+#define GL_MATRIX13_ARB 0x88CD
+#define GL_MATRIX14_ARB 0x88CE
+#define GL_MATRIX15_ARB 0x88CF
+#define GL_MATRIX16_ARB 0x88D0
+#define GL_MATRIX17_ARB 0x88D1
+#define GL_MATRIX18_ARB 0x88D2
+#define GL_MATRIX19_ARB 0x88D3
+#define GL_MATRIX20_ARB 0x88D4
+#define GL_MATRIX21_ARB 0x88D5
+#define GL_MATRIX22_ARB 0x88D6
+#define GL_MATRIX23_ARB 0x88D7
+#define GL_MATRIX24_ARB 0x88D8
+#define GL_MATRIX25_ARB 0x88D9
+#define GL_MATRIX26_ARB 0x88DA
+#define GL_MATRIX27_ARB 0x88DB
+#define GL_MATRIX28_ARB 0x88DC
+#define GL_MATRIX29_ARB 0x88DD
+#define GL_MATRIX30_ARB 0x88DE
+#define GL_MATRIX31_ARB 0x88DF
+#endif
+
+#ifndef GL_ARB_fragment_program
+#define GL_FRAGMENT_PROGRAM_ARB 0x8804
+#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805
+#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806
+#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807
+#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808
+#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809
+#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A
+#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B
+#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C
+#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D
+#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E
+#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F
+#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810
+#define GL_MAX_TEXTURE_COORDS_ARB 0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+#define GL_BUFFER_SIZE_ARB 0x8764
+#define GL_BUFFER_USAGE_ARB 0x8765
+#define GL_ARRAY_BUFFER_ARB 0x8892
+#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893
+#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
+#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
+#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
+#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
+#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
+#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
+#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
+#define GL_READ_ONLY_ARB 0x88B8
+#define GL_WRITE_ONLY_ARB 0x88B9
+#define GL_READ_WRITE_ARB 0x88BA
+#define GL_BUFFER_ACCESS_ARB 0x88BB
+#define GL_BUFFER_MAPPED_ARB 0x88BC
+#define GL_BUFFER_MAP_POINTER_ARB 0x88BD
+#define GL_STREAM_DRAW_ARB 0x88E0
+#define GL_STREAM_READ_ARB 0x88E1
+#define GL_STREAM_COPY_ARB 0x88E2
+#define GL_STATIC_DRAW_ARB 0x88E4
+#define GL_STATIC_READ_ARB 0x88E5
+#define GL_STATIC_COPY_ARB 0x88E6
+#define GL_DYNAMIC_DRAW_ARB 0x88E8
+#define GL_DYNAMIC_READ_ARB 0x88E9
+#define GL_DYNAMIC_COPY_ARB 0x88EA
+#endif
+
+#ifndef GL_ARB_occlusion_query
+#define GL_QUERY_COUNTER_BITS_ARB 0x8864
+#define GL_CURRENT_QUERY_ARB 0x8865
+#define GL_QUERY_RESULT_ARB 0x8866
+#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867
+#define GL_SAMPLES_PASSED_ARB 0x8914
+#endif
+
+#ifndef GL_ARB_shader_objects
+#define GL_PROGRAM_OBJECT_ARB 0x8B40
+#define GL_SHADER_OBJECT_ARB 0x8B48
+#define GL_OBJECT_TYPE_ARB 0x8B4E
+#define GL_OBJECT_SUBTYPE_ARB 0x8B4F
+#define GL_FLOAT_VEC2_ARB 0x8B50
+#define GL_FLOAT_VEC3_ARB 0x8B51
+#define GL_FLOAT_VEC4_ARB 0x8B52
+#define GL_INT_VEC2_ARB 0x8B53
+#define GL_INT_VEC3_ARB 0x8B54
+#define GL_INT_VEC4_ARB 0x8B55
+#define GL_BOOL_ARB 0x8B56
+#define GL_BOOL_VEC2_ARB 0x8B57
+#define GL_BOOL_VEC3_ARB 0x8B58
+#define GL_BOOL_VEC4_ARB 0x8B59
+#define GL_FLOAT_MAT2_ARB 0x8B5A
+#define GL_FLOAT_MAT3_ARB 0x8B5B
+#define GL_FLOAT_MAT4_ARB 0x8B5C
+#define GL_SAMPLER_1D_ARB 0x8B5D
+#define GL_SAMPLER_2D_ARB 0x8B5E
+#define GL_SAMPLER_3D_ARB 0x8B5F
+#define GL_SAMPLER_CUBE_ARB 0x8B60
+#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61
+#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62
+#define GL_SAMPLER_2D_RECT_ARB 0x8B63
+#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64
+#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80
+#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81
+#define GL_OBJECT_LINK_STATUS_ARB 0x8B82
+#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83
+#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84
+#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85
+#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86
+#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
+#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88
+#endif
+
+#ifndef GL_ARB_vertex_shader
+#define GL_VERTEX_SHADER_ARB 0x8B31
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A
+#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D
+#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89
+#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A
+#endif
+
+#ifndef GL_ARB_fragment_shader
+#define GL_FRAGMENT_SHADER_ARB 0x8B30
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
+#endif
+
+#ifndef GL_ARB_shading_language_100
+#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C
+#endif
+
+#ifndef GL_ARB_texture_non_power_of_two
+#endif
+
+#ifndef GL_ARB_point_sprite
+#define GL_POINT_SPRITE_ARB 0x8861
+#define GL_COORD_REPLACE_ARB 0x8862
+#endif
+
+#ifndef GL_ARB_fragment_program_shadow
+#endif
+
+#ifndef GL_ARB_draw_buffers
+#define GL_MAX_DRAW_BUFFERS_ARB 0x8824
+#define GL_DRAW_BUFFER0_ARB 0x8825
+#define GL_DRAW_BUFFER1_ARB 0x8826
+#define GL_DRAW_BUFFER2_ARB 0x8827
+#define GL_DRAW_BUFFER3_ARB 0x8828
+#define GL_DRAW_BUFFER4_ARB 0x8829
+#define GL_DRAW_BUFFER5_ARB 0x882A
+#define GL_DRAW_BUFFER6_ARB 0x882B
+#define GL_DRAW_BUFFER7_ARB 0x882C
+#define GL_DRAW_BUFFER8_ARB 0x882D
+#define GL_DRAW_BUFFER9_ARB 0x882E
+#define GL_DRAW_BUFFER10_ARB 0x882F
+#define GL_DRAW_BUFFER11_ARB 0x8830
+#define GL_DRAW_BUFFER12_ARB 0x8831
+#define GL_DRAW_BUFFER13_ARB 0x8832
+#define GL_DRAW_BUFFER14_ARB 0x8833
+#define GL_DRAW_BUFFER15_ARB 0x8834
+#endif
+
+#ifndef GL_ARB_texture_rectangle
+#define GL_TEXTURE_RECTANGLE_ARB 0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
+#endif
+
+#ifndef GL_ARB_color_buffer_float
+#define GL_RGBA_FLOAT_MODE_ARB 0x8820
+#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A
+#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B
+#define GL_CLAMP_READ_COLOR_ARB 0x891C
+#define GL_FIXED_ONLY_ARB 0x891D
+#endif
+
+#ifndef GL_ARB_half_float_pixel
+#define GL_HALF_FLOAT_ARB 0x140B
+#endif
+
+#ifndef GL_ARB_texture_float
+#define GL_TEXTURE_RED_TYPE_ARB 0x8C10
+#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11
+#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12
+#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13
+#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14
+#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15
+#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16
+#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17
+#define GL_RGBA32F_ARB 0x8814
+#define GL_RGB32F_ARB 0x8815
+#define GL_ALPHA32F_ARB 0x8816
+#define GL_INTENSITY32F_ARB 0x8817
+#define GL_LUMINANCE32F_ARB 0x8818
+#define GL_LUMINANCE_ALPHA32F_ARB 0x8819
+#define GL_RGBA16F_ARB 0x881A
+#define GL_RGB16F_ARB 0x881B
+#define GL_ALPHA16F_ARB 0x881C
+#define GL_INTENSITY16F_ARB 0x881D
+#define GL_LUMINANCE16F_ARB 0x881E
+#define GL_LUMINANCE_ALPHA16F_ARB 0x881F
+#endif
+
+#ifndef GL_ARB_pixel_buffer_object
+#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB
+#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
+#endif
+
+#ifndef GL_EXT_abgr
+#define GL_ABGR_EXT 0x8000
+#endif
+
+#ifndef GL_EXT_blend_color
+#define GL_CONSTANT_COLOR_EXT 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002
+#define GL_CONSTANT_ALPHA_EXT 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004
+#define GL_BLEND_COLOR_EXT 0x8005
+#endif
+
+#ifndef GL_EXT_polygon_offset
+#define GL_POLYGON_OFFSET_EXT 0x8037
+#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038
+#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039
+#endif
+
+#ifndef GL_EXT_texture
+#define GL_ALPHA4_EXT 0x803B
+#define GL_ALPHA8_EXT 0x803C
+#define GL_ALPHA12_EXT 0x803D
+#define GL_ALPHA16_EXT 0x803E
+#define GL_LUMINANCE4_EXT 0x803F
+#define GL_LUMINANCE8_EXT 0x8040
+#define GL_LUMINANCE12_EXT 0x8041
+#define GL_LUMINANCE16_EXT 0x8042
+#define GL_LUMINANCE4_ALPHA4_EXT 0x8043
+#define GL_LUMINANCE6_ALPHA2_EXT 0x8044
+#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
+#define GL_LUMINANCE12_ALPHA4_EXT 0x8046
+#define GL_LUMINANCE12_ALPHA12_EXT 0x8047
+#define GL_LUMINANCE16_ALPHA16_EXT 0x8048
+#define GL_INTENSITY_EXT 0x8049
+#define GL_INTENSITY4_EXT 0x804A
+#define GL_INTENSITY8_EXT 0x804B
+#define GL_INTENSITY12_EXT 0x804C
+#define GL_INTENSITY16_EXT 0x804D
+#define GL_RGB2_EXT 0x804E
+#define GL_RGB4_EXT 0x804F
+#define GL_RGB5_EXT 0x8050
+#define GL_RGB8_EXT 0x8051
+#define GL_RGB10_EXT 0x8052
+#define GL_RGB12_EXT 0x8053
+#define GL_RGB16_EXT 0x8054
+#define GL_RGBA2_EXT 0x8055
+#define GL_RGBA4_EXT 0x8056
+#define GL_RGB5_A1_EXT 0x8057
+#define GL_RGBA8_EXT 0x8058
+#define GL_RGB10_A2_EXT 0x8059
+#define GL_RGBA12_EXT 0x805A
+#define GL_RGBA16_EXT 0x805B
+#define GL_TEXTURE_RED_SIZE_EXT 0x805C
+#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D
+#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E
+#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F
+#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060
+#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061
+#define GL_REPLACE_EXT 0x8062
+#define GL_PROXY_TEXTURE_1D_EXT 0x8063
+#define GL_PROXY_TEXTURE_2D_EXT 0x8064
+#define GL_TEXTURE_TOO_LARGE_EXT 0x8065
+#endif
+
+#ifndef GL_EXT_texture3D
+#define GL_PACK_SKIP_IMAGES_EXT 0x806B
+#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C
+#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D
+#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E
+#define GL_TEXTURE_3D_EXT 0x806F
+#define GL_PROXY_TEXTURE_3D_EXT 0x8070
+#define GL_TEXTURE_DEPTH_EXT 0x8071
+#define GL_TEXTURE_WRAP_R_EXT 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073
+#endif
+
+#ifndef GL_SGIS_texture_filter4
+#define GL_FILTER4_SGIS 0x8146
+#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147
+#endif
+
+#ifndef GL_EXT_subtexture
+#endif
+
+#ifndef GL_EXT_copy_texture
+#endif
+
+#ifndef GL_EXT_histogram
+#define GL_HISTOGRAM_EXT 0x8024
+#define GL_PROXY_HISTOGRAM_EXT 0x8025
+#define GL_HISTOGRAM_WIDTH_EXT 0x8026
+#define GL_HISTOGRAM_FORMAT_EXT 0x8027
+#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028
+#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029
+#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C
+#define GL_HISTOGRAM_SINK_EXT 0x802D
+#define GL_MINMAX_EXT 0x802E
+#define GL_MINMAX_FORMAT_EXT 0x802F
+#define GL_MINMAX_SINK_EXT 0x8030
+#define GL_TABLE_TOO_LARGE_EXT 0x8031
+#endif
+
+#ifndef GL_EXT_convolution
+#define GL_CONVOLUTION_1D_EXT 0x8010
+#define GL_CONVOLUTION_2D_EXT 0x8011
+#define GL_SEPARABLE_2D_EXT 0x8012
+#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013
+#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014
+#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015
+#define GL_REDUCE_EXT 0x8016
+#define GL_CONVOLUTION_FORMAT_EXT 0x8017
+#define GL_CONVOLUTION_WIDTH_EXT 0x8018
+#define GL_CONVOLUTION_HEIGHT_EXT 0x8019
+#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023
+#endif
+
+#ifndef GL_SGI_color_matrix
+#define GL_COLOR_MATRIX_SGI 0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB
+#endif
+
+#ifndef GL_SGI_color_table
+#define GL_COLOR_TABLE_SGI 0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2
+#define GL_PROXY_COLOR_TABLE_SGI 0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5
+#define GL_COLOR_TABLE_SCALE_SGI 0x80D6
+#define GL_COLOR_TABLE_BIAS_SGI 0x80D7
+#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8
+#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9
+#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF
+#endif
+
+#ifndef GL_SGIS_pixel_texture
+#define GL_PIXEL_TEXTURE_SGIS 0x8353
+#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354
+#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355
+#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356
+#endif
+
+#ifndef GL_SGIX_pixel_texture
+#define GL_PIXEL_TEX_GEN_SGIX 0x8139
+#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B
+#endif
+
+#ifndef GL_SGIS_texture4D
+#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130
+#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131
+#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132
+#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133
+#define GL_TEXTURE_4D_SGIS 0x8134
+#define GL_PROXY_TEXTURE_4D_SGIS 0x8135
+#define GL_TEXTURE_4DSIZE_SGIS 0x8136
+#define GL_TEXTURE_WRAP_Q_SGIS 0x8137
+#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138
+#define GL_TEXTURE_4D_BINDING_SGIS 0x814F
+#endif
+
+#ifndef GL_SGI_texture_color_table
+#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC
+#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD
+#endif
+
+#ifndef GL_EXT_cmyka
+#define GL_CMYK_EXT 0x800C
+#define GL_CMYKA_EXT 0x800D
+#define GL_PACK_CMYK_HINT_EXT 0x800E
+#define GL_UNPACK_CMYK_HINT_EXT 0x800F
+#endif
+
+#ifndef GL_EXT_texture_object
+#define GL_TEXTURE_PRIORITY_EXT 0x8066
+#define GL_TEXTURE_RESIDENT_EXT 0x8067
+#define GL_TEXTURE_1D_BINDING_EXT 0x8068
+#define GL_TEXTURE_2D_BINDING_EXT 0x8069
+#define GL_TEXTURE_3D_BINDING_EXT 0x806A
+#endif
+
+#ifndef GL_SGIS_detail_texture
+#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095
+#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096
+#define GL_LINEAR_DETAIL_SGIS 0x8097
+#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098
+#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099
+#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A
+#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B
+#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C
+#endif
+
+#ifndef GL_SGIS_sharpen_texture
+#define GL_LINEAR_SHARPEN_SGIS 0x80AD
+#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE
+#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF
+#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0
+#endif
+
+#ifndef GL_EXT_packed_pixels
+#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032
+#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034
+#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035
+#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036
+#endif
+
+#ifndef GL_SGIS_texture_lod
+#define GL_TEXTURE_MIN_LOD_SGIS 0x813A
+#define GL_TEXTURE_MAX_LOD_SGIS 0x813B
+#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C
+#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D
+#endif
+
+#ifndef GL_SGIS_multisample
+#define GL_MULTISAMPLE_SGIS 0x809D
+#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F
+#define GL_SAMPLE_MASK_SGIS 0x80A0
+#define GL_1PASS_SGIS 0x80A1
+#define GL_2PASS_0_SGIS 0x80A2
+#define GL_2PASS_1_SGIS 0x80A3
+#define GL_4PASS_0_SGIS 0x80A4
+#define GL_4PASS_1_SGIS 0x80A5
+#define GL_4PASS_2_SGIS 0x80A6
+#define GL_4PASS_3_SGIS 0x80A7
+#define GL_SAMPLE_BUFFERS_SGIS 0x80A8
+#define GL_SAMPLES_SGIS 0x80A9
+#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA
+#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB
+#define GL_SAMPLE_PATTERN_SGIS 0x80AC
+#endif
+
+#ifndef GL_EXT_rescale_normal
+#define GL_RESCALE_NORMAL_EXT 0x803A
+#endif
+
+#ifndef GL_EXT_vertex_array
+#define GL_VERTEX_ARRAY_EXT 0x8074
+#define GL_NORMAL_ARRAY_EXT 0x8075
+#define GL_COLOR_ARRAY_EXT 0x8076
+#define GL_INDEX_ARRAY_EXT 0x8077
+#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078
+#define GL_EDGE_FLAG_ARRAY_EXT 0x8079
+#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A
+#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B
+#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C
+#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D
+#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E
+#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F
+#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080
+#define GL_COLOR_ARRAY_SIZE_EXT 0x8081
+#define GL_COLOR_ARRAY_TYPE_EXT 0x8082
+#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083
+#define GL_COLOR_ARRAY_COUNT_EXT 0x8084
+#define GL_INDEX_ARRAY_TYPE_EXT 0x8085
+#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086
+#define GL_INDEX_ARRAY_COUNT_EXT 0x8087
+#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
+#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B
+#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C
+#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D
+#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E
+#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F
+#define GL_COLOR_ARRAY_POINTER_EXT 0x8090
+#define GL_INDEX_ARRAY_POINTER_EXT 0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093
+#endif
+
+#ifndef GL_EXT_misc_attribute
+#endif
+
+#ifndef GL_SGIS_generate_mipmap
+#define GL_GENERATE_MIPMAP_SGIS 0x8191
+#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
+#endif
+
+#ifndef GL_SGIX_clipmap
+#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170
+#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171
+#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172
+#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173
+#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174
+#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175
+#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176
+#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177
+#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178
+#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D
+#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E
+#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F
+#endif
+
+#ifndef GL_SGIX_shadow
+#define GL_TEXTURE_COMPARE_SGIX 0x819A
+#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B
+#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C
+#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D
+#endif
+
+#ifndef GL_SGIS_texture_edge_clamp
+#define GL_CLAMP_TO_EDGE_SGIS 0x812F
+#endif
+
+#ifndef GL_SGIS_texture_border_clamp
+#define GL_CLAMP_TO_BORDER_SGIS 0x812D
+#endif
+
+#ifndef GL_EXT_blend_minmax
+#define GL_FUNC_ADD_EXT 0x8006
+#define GL_MIN_EXT 0x8007
+#define GL_MAX_EXT 0x8008
+#define GL_BLEND_EQUATION_EXT 0x8009
+#endif
+
+#ifndef GL_EXT_blend_subtract
+#define GL_FUNC_SUBTRACT_EXT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B
+#endif
+
+#ifndef GL_EXT_blend_logic_op
+#endif
+
+#ifndef GL_SGIX_interlace
+#define GL_INTERLACE_SGIX 0x8094
+#endif
+
+#ifndef GL_SGIX_pixel_tiles
+#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E
+#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F
+#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140
+#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141
+#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142
+#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143
+#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144
+#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145
+#endif
+
+#ifndef GL_SGIS_texture_select
+#define GL_DUAL_ALPHA4_SGIS 0x8110
+#define GL_DUAL_ALPHA8_SGIS 0x8111
+#define GL_DUAL_ALPHA12_SGIS 0x8112
+#define GL_DUAL_ALPHA16_SGIS 0x8113
+#define GL_DUAL_LUMINANCE4_SGIS 0x8114
+#define GL_DUAL_LUMINANCE8_SGIS 0x8115
+#define GL_DUAL_LUMINANCE12_SGIS 0x8116
+#define GL_DUAL_LUMINANCE16_SGIS 0x8117
+#define GL_DUAL_INTENSITY4_SGIS 0x8118
+#define GL_DUAL_INTENSITY8_SGIS 0x8119
+#define GL_DUAL_INTENSITY12_SGIS 0x811A
+#define GL_DUAL_INTENSITY16_SGIS 0x811B
+#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C
+#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D
+#define GL_QUAD_ALPHA4_SGIS 0x811E
+#define GL_QUAD_ALPHA8_SGIS 0x811F
+#define GL_QUAD_LUMINANCE4_SGIS 0x8120
+#define GL_QUAD_LUMINANCE8_SGIS 0x8121
+#define GL_QUAD_INTENSITY4_SGIS 0x8122
+#define GL_QUAD_INTENSITY8_SGIS 0x8123
+#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124
+#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125
+#endif
+
+#ifndef GL_SGIX_sprite
+#define GL_SPRITE_SGIX 0x8148
+#define GL_SPRITE_MODE_SGIX 0x8149
+#define GL_SPRITE_AXIS_SGIX 0x814A
+#define GL_SPRITE_TRANSLATION_SGIX 0x814B
+#define GL_SPRITE_AXIAL_SGIX 0x814C
+#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D
+#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E
+#endif
+
+#ifndef GL_SGIX_texture_multi_buffer
+#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E
+#endif
+
+#ifndef GL_EXT_point_parameters
+#define GL_POINT_SIZE_MIN_EXT 0x8126
+#define GL_POINT_SIZE_MAX_EXT 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128
+#define GL_DISTANCE_ATTENUATION_EXT 0x8129
+#endif
+
+#ifndef GL_SGIS_point_parameters
+#define GL_POINT_SIZE_MIN_SGIS 0x8126
+#define GL_POINT_SIZE_MAX_SGIS 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128
+#define GL_DISTANCE_ATTENUATION_SGIS 0x8129
+#endif
+
+#ifndef GL_SGIX_instruments
+#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180
+#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181
+#endif
+
+#ifndef GL_SGIX_texture_scale_bias
+#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179
+#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A
+#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B
+#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C
+#endif
+
+#ifndef GL_SGIX_framezoom
+#define GL_FRAMEZOOM_SGIX 0x818B
+#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C
+#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D
+#endif
+
+#ifndef GL_SGIX_tag_sample_buffer
+#endif
+
+#ifndef GL_FfdMaskSGIX
+#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001
+#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002
+#endif
+
+#ifndef GL_SGIX_polynomial_ffd
+#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194
+#define GL_TEXTURE_DEFORMATION_SGIX 0x8195
+#define GL_DEFORMATIONS_MASK_SGIX 0x8196
+#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197
+#endif
+
+#ifndef GL_SGIX_reference_plane
+#define GL_REFERENCE_PLANE_SGIX 0x817D
+#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E
+#endif
+
+#ifndef GL_SGIX_flush_raster
+#endif
+
+#ifndef GL_SGIX_depth_texture
+#define GL_DEPTH_COMPONENT16_SGIX 0x81A5
+#define GL_DEPTH_COMPONENT24_SGIX 0x81A6
+#define GL_DEPTH_COMPONENT32_SGIX 0x81A7
+#endif
+
+#ifndef GL_SGIS_fog_function
+#define GL_FOG_FUNC_SGIS 0x812A
+#define GL_FOG_FUNC_POINTS_SGIS 0x812B
+#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C
+#endif
+
+#ifndef GL_SGIX_fog_offset
+#define GL_FOG_OFFSET_SGIX 0x8198
+#define GL_FOG_OFFSET_VALUE_SGIX 0x8199
+#endif
+
+#ifndef GL_HP_image_transform
+#define GL_IMAGE_SCALE_X_HP 0x8155
+#define GL_IMAGE_SCALE_Y_HP 0x8156
+#define GL_IMAGE_TRANSLATE_X_HP 0x8157
+#define GL_IMAGE_TRANSLATE_Y_HP 0x8158
+#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159
+#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A
+#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B
+#define GL_IMAGE_MAG_FILTER_HP 0x815C
+#define GL_IMAGE_MIN_FILTER_HP 0x815D
+#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E
+#define GL_CUBIC_HP 0x815F
+#define GL_AVERAGE_HP 0x8160
+#define GL_IMAGE_TRANSFORM_2D_HP 0x8161
+#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162
+#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163
+#endif
+
+#ifndef GL_HP_convolution_border_modes
+#define GL_IGNORE_BORDER_HP 0x8150
+#define GL_CONSTANT_BORDER_HP 0x8151
+#define GL_REPLICATE_BORDER_HP 0x8153
+#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154
+#endif
+
+#ifndef GL_INGR_palette_buffer
+#endif
+
+#ifndef GL_SGIX_texture_add_env
+#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE
+#endif
+
+#ifndef GL_EXT_color_subtable
+#endif
+
+#ifndef GL_PGI_vertex_hints
+#define GL_VERTEX_DATA_HINT_PGI 0x1A22A
+#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B
+#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C
+#define GL_MAX_VERTEX_HINT_PGI 0x1A22D
+#define GL_COLOR3_BIT_PGI 0x00010000
+#define GL_COLOR4_BIT_PGI 0x00020000
+#define GL_EDGEFLAG_BIT_PGI 0x00040000
+#define GL_INDEX_BIT_PGI 0x00080000
+#define GL_MAT_AMBIENT_BIT_PGI 0x00100000
+#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000
+#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000
+#define GL_MAT_EMISSION_BIT_PGI 0x00800000
+#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000
+#define GL_MAT_SHININESS_BIT_PGI 0x02000000
+#define GL_MAT_SPECULAR_BIT_PGI 0x04000000
+#define GL_NORMAL_BIT_PGI 0x08000000
+#define GL_TEXCOORD1_BIT_PGI 0x10000000
+#define GL_TEXCOORD2_BIT_PGI 0x20000000
+#define GL_TEXCOORD3_BIT_PGI 0x40000000
+#define GL_TEXCOORD4_BIT_PGI 0x80000000
+#define GL_VERTEX23_BIT_PGI 0x00000004
+#define GL_VERTEX4_BIT_PGI 0x00000008
+#endif
+
+#ifndef GL_PGI_misc_hints
+#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8
+#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD
+#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE
+#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202
+#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203
+#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204
+#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C
+#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D
+#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E
+#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F
+#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210
+#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211
+#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216
+#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217
+#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218
+#define GL_FULL_STIPPLE_HINT_PGI 0x1A219
+#define GL_CLIP_NEAR_HINT_PGI 0x1A220
+#define GL_CLIP_FAR_HINT_PGI 0x1A221
+#define GL_WIDE_LINE_HINT_PGI 0x1A222
+#define GL_BACK_NORMALS_HINT_PGI 0x1A223
+#endif
+
+#ifndef GL_EXT_paletted_texture
+#define GL_COLOR_INDEX1_EXT 0x80E2
+#define GL_COLOR_INDEX2_EXT 0x80E3
+#define GL_COLOR_INDEX4_EXT 0x80E4
+#define GL_COLOR_INDEX8_EXT 0x80E5
+#define GL_COLOR_INDEX12_EXT 0x80E6
+#define GL_COLOR_INDEX16_EXT 0x80E7
+#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED
+#endif
+
+#ifndef GL_EXT_clip_volume_hint
+#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0
+#endif
+
+#ifndef GL_SGIX_list_priority
+#define GL_LIST_PRIORITY_SGIX 0x8182
+#endif
+
+#ifndef GL_SGIX_ir_instrument1
+#define GL_IR_INSTRUMENT1_SGIX 0x817F
+#endif
+
+#ifndef GL_SGIX_calligraphic_fragment
+#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183
+#endif
+
+#ifndef GL_SGIX_texture_lod_bias
+#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E
+#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F
+#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190
+#endif
+
+#ifndef GL_SGIX_shadow_ambient
+#define GL_SHADOW_AMBIENT_SGIX 0x80BF
+#endif
+
+#ifndef GL_EXT_index_texture
+#endif
+
+#ifndef GL_EXT_index_material
+#define GL_INDEX_MATERIAL_EXT 0x81B8
+#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9
+#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA
+#endif
+
+#ifndef GL_EXT_index_func
+#define GL_INDEX_TEST_EXT 0x81B5
+#define GL_INDEX_TEST_FUNC_EXT 0x81B6
+#define GL_INDEX_TEST_REF_EXT 0x81B7
+#endif
+
+#ifndef GL_EXT_index_array_formats
+#define GL_IUI_V2F_EXT 0x81AD
+#define GL_IUI_V3F_EXT 0x81AE
+#define GL_IUI_N3F_V2F_EXT 0x81AF
+#define GL_IUI_N3F_V3F_EXT 0x81B0
+#define GL_T2F_IUI_V2F_EXT 0x81B1
+#define GL_T2F_IUI_V3F_EXT 0x81B2
+#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3
+#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4
+#endif
+
+#ifndef GL_EXT_compiled_vertex_array
+#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8
+#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9
+#endif
+
+#ifndef GL_EXT_cull_vertex
+#define GL_CULL_VERTEX_EXT 0x81AA
+#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB
+#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC
+#endif
+
+#ifndef GL_SGIX_ycrcb
+#define GL_YCRCB_422_SGIX 0x81BB
+#define GL_YCRCB_444_SGIX 0x81BC
+#endif
+
+#ifndef GL_SGIX_fragment_lighting
+#define GL_FRAGMENT_LIGHTING_SGIX 0x8400
+#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401
+#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402
+#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403
+#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404
+#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405
+#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406
+#define GL_LIGHT_ENV_MODE_SGIX 0x8407
+#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408
+#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409
+#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A
+#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B
+#define GL_FRAGMENT_LIGHT0_SGIX 0x840C
+#define GL_FRAGMENT_LIGHT1_SGIX 0x840D
+#define GL_FRAGMENT_LIGHT2_SGIX 0x840E
+#define GL_FRAGMENT_LIGHT3_SGIX 0x840F
+#define GL_FRAGMENT_LIGHT4_SGIX 0x8410
+#define GL_FRAGMENT_LIGHT5_SGIX 0x8411
+#define GL_FRAGMENT_LIGHT6_SGIX 0x8412
+#define GL_FRAGMENT_LIGHT7_SGIX 0x8413
+#endif
+
+#ifndef GL_IBM_rasterpos_clip
+#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262
+#endif
+
+#ifndef GL_HP_texture_lighting
+#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167
+#define GL_TEXTURE_POST_SPECULAR_HP 0x8168
+#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169
+#endif
+
+#ifndef GL_EXT_draw_range_elements
+#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8
+#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9
+#endif
+
+#ifndef GL_WIN_phong_shading
+#define GL_PHONG_WIN 0x80EA
+#define GL_PHONG_HINT_WIN 0x80EB
+#endif
+
+#ifndef GL_WIN_specular_fog
+#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC
+#endif
+
+#ifndef GL_EXT_light_texture
+#define GL_FRAGMENT_MATERIAL_EXT 0x8349
+#define GL_FRAGMENT_NORMAL_EXT 0x834A
+#define GL_FRAGMENT_COLOR_EXT 0x834C
+#define GL_ATTENUATION_EXT 0x834D
+#define GL_SHADOW_ATTENUATION_EXT 0x834E
+#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F
+#define GL_TEXTURE_LIGHT_EXT 0x8350
+#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351
+#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352
+/* reuse GL_FRAGMENT_DEPTH_EXT */
+#endif
+
+#ifndef GL_SGIX_blend_alpha_minmax
+#define GL_ALPHA_MIN_SGIX 0x8320
+#define GL_ALPHA_MAX_SGIX 0x8321
+#endif
+
+#ifndef GL_SGIX_impact_pixel_texture
+#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184
+#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185
+#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186
+#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187
+#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188
+#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189
+#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A
+#endif
+
+#ifndef GL_EXT_bgra
+#define GL_BGR_EXT 0x80E0
+#define GL_BGRA_EXT 0x80E1
+#endif
+
+#ifndef GL_SGIX_async
+#define GL_ASYNC_MARKER_SGIX 0x8329
+#endif
+
+#ifndef GL_SGIX_async_pixel
+#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C
+#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D
+#define GL_ASYNC_READ_PIXELS_SGIX 0x835E
+#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F
+#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360
+#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361
+#endif
+
+#ifndef GL_SGIX_async_histogram
+#define GL_ASYNC_HISTOGRAM_SGIX 0x832C
+#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D
+#endif
+
+#ifndef GL_INTEL_texture_scissor
+#endif
+
+#ifndef GL_INTEL_parallel_arrays
+#define GL_PARALLEL_ARRAYS_INTEL 0x83F4
+#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5
+#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6
+#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7
+#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8
+#endif
+
+#ifndef GL_HP_occlusion_test
+#define GL_OCCLUSION_TEST_HP 0x8165
+#define GL_OCCLUSION_TEST_RESULT_HP 0x8166
+#endif
+
+#ifndef GL_EXT_pixel_transform
+#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330
+#define GL_PIXEL_MAG_FILTER_EXT 0x8331
+#define GL_PIXEL_MIN_FILTER_EXT 0x8332
+#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333
+#define GL_CUBIC_EXT 0x8334
+#define GL_AVERAGE_EXT 0x8335
+#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336
+#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337
+#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338
+#endif
+
+#ifndef GL_EXT_pixel_transform_color_table
+#endif
+
+#ifndef GL_EXT_shared_texture_palette
+#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
+#endif
+
+#ifndef GL_EXT_separate_specular_color
+#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8
+#define GL_SINGLE_COLOR_EXT 0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA
+#endif
+
+#ifndef GL_EXT_secondary_color
+#define GL_COLOR_SUM_EXT 0x8458
+#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459
+#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
+#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
+#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
+#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
+#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E
+#endif
+
+#ifndef GL_EXT_texture_perturb_normal
+#define GL_PERTURB_EXT 0x85AE
+#define GL_TEXTURE_NORMAL_EXT 0x85AF
+#endif
+
+#ifndef GL_EXT_multi_draw_arrays
+#endif
+
+#ifndef GL_EXT_fog_coord
+#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450
+#define GL_FOG_COORDINATE_EXT 0x8451
+#define GL_FRAGMENT_DEPTH_EXT 0x8452
+#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453
+#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454
+#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455
+#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456
+#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457
+#endif
+
+#ifndef GL_REND_screen_coordinates
+#define GL_SCREEN_COORDINATES_REND 0x8490
+#define GL_INVERTED_SCREEN_W_REND 0x8491
+#endif
+
+#ifndef GL_EXT_coordinate_frame
+#define GL_TANGENT_ARRAY_EXT 0x8439
+#define GL_BINORMAL_ARRAY_EXT 0x843A
+#define GL_CURRENT_TANGENT_EXT 0x843B
+#define GL_CURRENT_BINORMAL_EXT 0x843C
+#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E
+#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F
+#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440
+#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441
+#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442
+#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443
+#define GL_MAP1_TANGENT_EXT 0x8444
+#define GL_MAP2_TANGENT_EXT 0x8445
+#define GL_MAP1_BINORMAL_EXT 0x8446
+#define GL_MAP2_BINORMAL_EXT 0x8447
+#endif
+
+#ifndef GL_EXT_texture_env_combine
+#define GL_COMBINE_EXT 0x8570
+#define GL_COMBINE_RGB_EXT 0x8571
+#define GL_COMBINE_ALPHA_EXT 0x8572
+#define GL_RGB_SCALE_EXT 0x8573
+#define GL_ADD_SIGNED_EXT 0x8574
+#define GL_INTERPOLATE_EXT 0x8575
+#define GL_CONSTANT_EXT 0x8576
+#define GL_PRIMARY_COLOR_EXT 0x8577
+#define GL_PREVIOUS_EXT 0x8578
+#define GL_SOURCE0_RGB_EXT 0x8580
+#define GL_SOURCE1_RGB_EXT 0x8581
+#define GL_SOURCE2_RGB_EXT 0x8582
+#define GL_SOURCE0_ALPHA_EXT 0x8588
+#define GL_SOURCE1_ALPHA_EXT 0x8589
+#define GL_SOURCE2_ALPHA_EXT 0x858A
+#define GL_OPERAND0_RGB_EXT 0x8590
+#define GL_OPERAND1_RGB_EXT 0x8591
+#define GL_OPERAND2_RGB_EXT 0x8592
+#define GL_OPERAND0_ALPHA_EXT 0x8598
+#define GL_OPERAND1_ALPHA_EXT 0x8599
+#define GL_OPERAND2_ALPHA_EXT 0x859A
+#endif
+
+#ifndef GL_APPLE_specular_vector
+#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0
+#endif
+
+#ifndef GL_APPLE_transform_hint
+#define GL_TRANSFORM_HINT_APPLE 0x85B1
+#endif
+
+#ifndef GL_SGIX_fog_scale
+#define GL_FOG_SCALE_SGIX 0x81FC
+#define GL_FOG_SCALE_VALUE_SGIX 0x81FD
+#endif
+
+#ifndef GL_SUNX_constant_data
+#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5
+#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6
+#endif
+
+#ifndef GL_SUN_global_alpha
+#define GL_GLOBAL_ALPHA_SUN 0x81D9
+#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA
+#endif
+
+#ifndef GL_SUN_triangle_list
+#define GL_RESTART_SUN 0x0001
+#define GL_REPLACE_MIDDLE_SUN 0x0002
+#define GL_REPLACE_OLDEST_SUN 0x0003
+#define GL_TRIANGLE_LIST_SUN 0x81D7
+#define GL_REPLACEMENT_CODE_SUN 0x81D8
+#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0
+#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1
+#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2
+#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3
+#define GL_R1UI_V3F_SUN 0x85C4
+#define GL_R1UI_C4UB_V3F_SUN 0x85C5
+#define GL_R1UI_C3F_V3F_SUN 0x85C6
+#define GL_R1UI_N3F_V3F_SUN 0x85C7
+#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8
+#define GL_R1UI_T2F_V3F_SUN 0x85C9
+#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA
+#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB
+#endif
+
+#ifndef GL_SUN_vertex
+#endif
+
+#ifndef GL_EXT_blend_func_separate
+#define GL_BLEND_DST_RGB_EXT 0x80C8
+#define GL_BLEND_SRC_RGB_EXT 0x80C9
+#define GL_BLEND_DST_ALPHA_EXT 0x80CA
+#define GL_BLEND_SRC_ALPHA_EXT 0x80CB
+#endif
+
+#ifndef GL_INGR_color_clamp
+#define GL_RED_MIN_CLAMP_INGR 0x8560
+#define GL_GREEN_MIN_CLAMP_INGR 0x8561
+#define GL_BLUE_MIN_CLAMP_INGR 0x8562
+#define GL_ALPHA_MIN_CLAMP_INGR 0x8563
+#define GL_RED_MAX_CLAMP_INGR 0x8564
+#define GL_GREEN_MAX_CLAMP_INGR 0x8565
+#define GL_BLUE_MAX_CLAMP_INGR 0x8566
+#define GL_ALPHA_MAX_CLAMP_INGR 0x8567
+#endif
+
+#ifndef GL_INGR_interlace_read
+#define GL_INTERLACE_READ_INGR 0x8568
+#endif
+
+#ifndef GL_EXT_stencil_wrap
+#define GL_INCR_WRAP_EXT 0x8507
+#define GL_DECR_WRAP_EXT 0x8508
+#endif
+
+#ifndef GL_EXT_422_pixels
+#define GL_422_EXT 0x80CC
+#define GL_422_REV_EXT 0x80CD
+#define GL_422_AVERAGE_EXT 0x80CE
+#define GL_422_REV_AVERAGE_EXT 0x80CF
+#endif
+
+#ifndef GL_NV_texgen_reflection
+#define GL_NORMAL_MAP_NV 0x8511
+#define GL_REFLECTION_MAP_NV 0x8512
+#endif
+
+#ifndef GL_EXT_texture_cube_map
+#define GL_NORMAL_MAP_EXT 0x8511
+#define GL_REFLECTION_MAP_EXT 0x8512
+#define GL_TEXTURE_CUBE_MAP_EXT 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C
+#endif
+
+#ifndef GL_SUN_convolution_border_modes
+#define GL_WRAP_BORDER_SUN 0x81D4
+#endif
+
+#ifndef GL_EXT_texture_env_add
+#endif
+
+#ifndef GL_EXT_texture_lod_bias
+#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD
+#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500
+#define GL_TEXTURE_LOD_BIAS_EXT 0x8501
+#endif
+
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
+#endif
+
+#ifndef GL_EXT_vertex_weighting
+#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH
+#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502
+#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX
+#define GL_MODELVIEW1_MATRIX_EXT 0x8506
+#define GL_VERTEX_WEIGHTING_EXT 0x8509
+#define GL_MODELVIEW0_EXT GL_MODELVIEW
+#define GL_MODELVIEW1_EXT 0x850A
+#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B
+#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C
+#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D
+#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E
+#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F
+#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510
+#endif
+
+#ifndef GL_NV_light_max_exponent
+#define GL_MAX_SHININESS_NV 0x8504
+#define GL_MAX_SPOT_EXPONENT_NV 0x8505
+#endif
+
+#ifndef GL_NV_vertex_array_range
+#define GL_VERTEX_ARRAY_RANGE_NV 0x851D
+#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E
+#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F
+#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520
+#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521
+#endif
+
+#ifndef GL_NV_register_combiners
+#define GL_REGISTER_COMBINERS_NV 0x8522
+#define GL_VARIABLE_A_NV 0x8523
+#define GL_VARIABLE_B_NV 0x8524
+#define GL_VARIABLE_C_NV 0x8525
+#define GL_VARIABLE_D_NV 0x8526
+#define GL_VARIABLE_E_NV 0x8527
+#define GL_VARIABLE_F_NV 0x8528
+#define GL_VARIABLE_G_NV 0x8529
+#define GL_CONSTANT_COLOR0_NV 0x852A
+#define GL_CONSTANT_COLOR1_NV 0x852B
+#define GL_PRIMARY_COLOR_NV 0x852C
+#define GL_SECONDARY_COLOR_NV 0x852D
+#define GL_SPARE0_NV 0x852E
+#define GL_SPARE1_NV 0x852F
+#define GL_DISCARD_NV 0x8530
+#define GL_E_TIMES_F_NV 0x8531
+#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532
+#define GL_UNSIGNED_IDENTITY_NV 0x8536
+#define GL_UNSIGNED_INVERT_NV 0x8537
+#define GL_EXPAND_NORMAL_NV 0x8538
+#define GL_EXPAND_NEGATE_NV 0x8539
+#define GL_HALF_BIAS_NORMAL_NV 0x853A
+#define GL_HALF_BIAS_NEGATE_NV 0x853B
+#define GL_SIGNED_IDENTITY_NV 0x853C
+#define GL_SIGNED_NEGATE_NV 0x853D
+#define GL_SCALE_BY_TWO_NV 0x853E
+#define GL_SCALE_BY_FOUR_NV 0x853F
+#define GL_SCALE_BY_ONE_HALF_NV 0x8540
+#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541
+#define GL_COMBINER_INPUT_NV 0x8542
+#define GL_COMBINER_MAPPING_NV 0x8543
+#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544
+#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545
+#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546
+#define GL_COMBINER_MUX_SUM_NV 0x8547
+#define GL_COMBINER_SCALE_NV 0x8548
+#define GL_COMBINER_BIAS_NV 0x8549
+#define GL_COMBINER_AB_OUTPUT_NV 0x854A
+#define GL_COMBINER_CD_OUTPUT_NV 0x854B
+#define GL_COMBINER_SUM_OUTPUT_NV 0x854C
+#define GL_MAX_GENERAL_COMBINERS_NV 0x854D
+#define GL_NUM_GENERAL_COMBINERS_NV 0x854E
+#define GL_COLOR_SUM_CLAMP_NV 0x854F
+#define GL_COMBINER0_NV 0x8550
+#define GL_COMBINER1_NV 0x8551
+#define GL_COMBINER2_NV 0x8552
+#define GL_COMBINER3_NV 0x8553
+#define GL_COMBINER4_NV 0x8554
+#define GL_COMBINER5_NV 0x8555
+#define GL_COMBINER6_NV 0x8556
+#define GL_COMBINER7_NV 0x8557
+/* reuse GL_TEXTURE0_ARB */
+/* reuse GL_TEXTURE1_ARB */
+/* reuse GL_ZERO */
+/* reuse GL_NONE */
+/* reuse GL_FOG */
+#endif
+
+#ifndef GL_NV_fog_distance
+#define GL_FOG_DISTANCE_MODE_NV 0x855A
+#define GL_EYE_RADIAL_NV 0x855B
+#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C
+/* reuse GL_EYE_PLANE */
+#endif
+
+#ifndef GL_NV_texgen_emboss
+#define GL_EMBOSS_LIGHT_NV 0x855D
+#define GL_EMBOSS_CONSTANT_NV 0x855E
+#define GL_EMBOSS_MAP_NV 0x855F
+#endif
+
+#ifndef GL_NV_blend_square
+#endif
+
+#ifndef GL_NV_texture_env_combine4
+#define GL_COMBINE4_NV 0x8503
+#define GL_SOURCE3_RGB_NV 0x8583
+#define GL_SOURCE3_ALPHA_NV 0x858B
+#define GL_OPERAND3_RGB_NV 0x8593
+#define GL_OPERAND3_ALPHA_NV 0x859B
+#endif
+
+#ifndef GL_MESA_resize_buffers
+#endif
+
+#ifndef GL_MESA_window_pos
+#endif
+
+#ifndef GL_EXT_texture_compression_s3tc
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
+#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
+#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
+#endif
+
+#ifndef GL_IBM_cull_vertex
+#define GL_CULL_VERTEX_IBM 103050
+#endif
+
+#ifndef GL_IBM_multimode_draw_arrays
+#endif
+
+#ifndef GL_IBM_vertex_array_lists
+#define GL_VERTEX_ARRAY_LIST_IBM 103070
+#define GL_NORMAL_ARRAY_LIST_IBM 103071
+#define GL_COLOR_ARRAY_LIST_IBM 103072
+#define GL_INDEX_ARRAY_LIST_IBM 103073
+#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074
+#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075
+#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076
+#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077
+#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080
+#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081
+#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082
+#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083
+#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084
+#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085
+#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086
+#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087
+#endif
+
+#ifndef GL_SGIX_subsample
+#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0
+#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1
+#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2
+#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3
+#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4
+#endif
+
+#ifndef GL_SGIX_ycrcb_subsample
+#endif
+
+#ifndef GL_SGIX_ycrcba
+#define GL_YCRCB_SGIX 0x8318
+#define GL_YCRCBA_SGIX 0x8319
+#endif
+
+#ifndef GL_SGI_depth_pass_instrument
+#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310
+#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311
+#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312
+#endif
+
+#ifndef GL_3DFX_texture_compression_FXT1
+#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0
+#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1
+#endif
+
+#ifndef GL_3DFX_multisample
+#define GL_MULTISAMPLE_3DFX 0x86B2
+#define GL_SAMPLE_BUFFERS_3DFX 0x86B3
+#define GL_SAMPLES_3DFX 0x86B4
+#define GL_MULTISAMPLE_BIT_3DFX 0x20000000
+#endif
+
+#ifndef GL_3DFX_tbuffer
+#endif
+
+#ifndef GL_EXT_multisample
+#define GL_MULTISAMPLE_EXT 0x809D
+#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F
+#define GL_SAMPLE_MASK_EXT 0x80A0
+#define GL_1PASS_EXT 0x80A1
+#define GL_2PASS_0_EXT 0x80A2
+#define GL_2PASS_1_EXT 0x80A3
+#define GL_4PASS_0_EXT 0x80A4
+#define GL_4PASS_1_EXT 0x80A5
+#define GL_4PASS_2_EXT 0x80A6
+#define GL_4PASS_3_EXT 0x80A7
+#define GL_SAMPLE_BUFFERS_EXT 0x80A8
+#define GL_SAMPLES_EXT 0x80A9
+#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA
+#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB
+#define GL_SAMPLE_PATTERN_EXT 0x80AC
+#define GL_MULTISAMPLE_BIT_EXT 0x20000000
+#endif
+
+#ifndef GL_SGIX_vertex_preclip
+#define GL_VERTEX_PRECLIP_SGIX 0x83EE
+#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF
+#endif
+
+#ifndef GL_SGIX_convolution_accuracy
+#define GL_CONVOLUTION_HINT_SGIX 0x8316
+#endif
+
+#ifndef GL_SGIX_resample
+#define GL_PACK_RESAMPLE_SGIX 0x842C
+#define GL_UNPACK_RESAMPLE_SGIX 0x842D
+#define GL_RESAMPLE_REPLICATE_SGIX 0x842E
+#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F
+#define GL_RESAMPLE_DECIMATE_SGIX 0x8430
+#endif
+
+#ifndef GL_SGIS_point_line_texgen
+#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0
+#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1
+#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2
+#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3
+#define GL_EYE_POINT_SGIS 0x81F4
+#define GL_OBJECT_POINT_SGIS 0x81F5
+#define GL_EYE_LINE_SGIS 0x81F6
+#define GL_OBJECT_LINE_SGIS 0x81F7
+#endif
+
+#ifndef GL_SGIS_texture_color_mask
+#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF
+#endif
+
+#ifndef GL_EXT_texture_env_dot3
+#define GL_DOT3_RGB_EXT 0x8740
+#define GL_DOT3_RGBA_EXT 0x8741
+#endif
+
+#ifndef GL_ATI_texture_mirror_once
+#define GL_MIRROR_CLAMP_ATI 0x8742
+#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743
+#endif
+
+#ifndef GL_NV_fence
+#define GL_ALL_COMPLETED_NV 0x84F2
+#define GL_FENCE_STATUS_NV 0x84F3
+#define GL_FENCE_CONDITION_NV 0x84F4
+#endif
+
+#ifndef GL_IBM_texture_mirrored_repeat
+#define GL_MIRRORED_REPEAT_IBM 0x8370
+#endif
+
+#ifndef GL_NV_evaluators
+#define GL_EVAL_2D_NV 0x86C0
+#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1
+#define GL_MAP_TESSELLATION_NV 0x86C2
+#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3
+#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4
+#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5
+#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6
+#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7
+#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8
+#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9
+#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA
+#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB
+#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC
+#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD
+#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE
+#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF
+#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0
+#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1
+#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2
+#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3
+#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4
+#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5
+#define GL_MAX_MAP_TESSELLATION_NV 0x86D6
+#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7
+#endif
+
+#ifndef GL_NV_packed_depth_stencil
+#define GL_DEPTH_STENCIL_NV 0x84F9
+#define GL_UNSIGNED_INT_24_8_NV 0x84FA
+#endif
+
+#ifndef GL_NV_register_combiners2
+#define GL_PER_STAGE_CONSTANTS_NV 0x8535
+#endif
+
+#ifndef GL_NV_texture_compression_vtc
+#endif
+
+#ifndef GL_NV_texture_rectangle
+#define GL_TEXTURE_RECTANGLE_NV 0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8
+#endif
+
+#ifndef GL_NV_texture_shader
+#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C
+#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D
+#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
+#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9
+#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA
+#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB
+#define GL_DSDT_MAG_INTENSITY_NV 0x86DC
+#define GL_SHADER_CONSISTENT_NV 0x86DD
+#define GL_TEXTURE_SHADER_NV 0x86DE
+#define GL_SHADER_OPERATION_NV 0x86DF
+#define GL_CULL_MODES_NV 0x86E0
+#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1
+#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2
+#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3
+#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV
+#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV
+#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV
+#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4
+#define GL_CONST_EYE_NV 0x86E5
+#define GL_PASS_THROUGH_NV 0x86E6
+#define GL_CULL_FRAGMENT_NV 0x86E7
+#define GL_OFFSET_TEXTURE_2D_NV 0x86E8
+#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9
+#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA
+#define GL_DOT_PRODUCT_NV 0x86EC
+#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED
+#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE
+#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0
+#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1
+#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2
+#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3
+#define GL_HILO_NV 0x86F4
+#define GL_DSDT_NV 0x86F5
+#define GL_DSDT_MAG_NV 0x86F6
+#define GL_DSDT_MAG_VIB_NV 0x86F7
+#define GL_HILO16_NV 0x86F8
+#define GL_SIGNED_HILO_NV 0x86F9
+#define GL_SIGNED_HILO16_NV 0x86FA
+#define GL_SIGNED_RGBA_NV 0x86FB
+#define GL_SIGNED_RGBA8_NV 0x86FC
+#define GL_SIGNED_RGB_NV 0x86FE
+#define GL_SIGNED_RGB8_NV 0x86FF
+#define GL_SIGNED_LUMINANCE_NV 0x8701
+#define GL_SIGNED_LUMINANCE8_NV 0x8702
+#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703
+#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704
+#define GL_SIGNED_ALPHA_NV 0x8705
+#define GL_SIGNED_ALPHA8_NV 0x8706
+#define GL_SIGNED_INTENSITY_NV 0x8707
+#define GL_SIGNED_INTENSITY8_NV 0x8708
+#define GL_DSDT8_NV 0x8709
+#define GL_DSDT8_MAG8_NV 0x870A
+#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B
+#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C
+#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
+#define GL_HI_SCALE_NV 0x870E
+#define GL_LO_SCALE_NV 0x870F
+#define GL_DS_SCALE_NV 0x8710
+#define GL_DT_SCALE_NV 0x8711
+#define GL_MAGNITUDE_SCALE_NV 0x8712
+#define GL_VIBRANCE_SCALE_NV 0x8713
+#define GL_HI_BIAS_NV 0x8714
+#define GL_LO_BIAS_NV 0x8715
+#define GL_DS_BIAS_NV 0x8716
+#define GL_DT_BIAS_NV 0x8717
+#define GL_MAGNITUDE_BIAS_NV 0x8718
+#define GL_VIBRANCE_BIAS_NV 0x8719
+#define GL_TEXTURE_BORDER_VALUES_NV 0x871A
+#define GL_TEXTURE_HI_SIZE_NV 0x871B
+#define GL_TEXTURE_LO_SIZE_NV 0x871C
+#define GL_TEXTURE_DS_SIZE_NV 0x871D
+#define GL_TEXTURE_DT_SIZE_NV 0x871E
+#define GL_TEXTURE_MAG_SIZE_NV 0x871F
+#endif
+
+#ifndef GL_NV_texture_shader2
+#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF
+#endif
+
+#ifndef GL_NV_vertex_array_range2
+#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533
+#endif
+
+#ifndef GL_NV_vertex_program
+#define GL_VERTEX_PROGRAM_NV 0x8620
+#define GL_VERTEX_STATE_PROGRAM_NV 0x8621
+#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623
+#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624
+#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625
+#define GL_CURRENT_ATTRIB_NV 0x8626
+#define GL_PROGRAM_LENGTH_NV 0x8627
+#define GL_PROGRAM_STRING_NV 0x8628
+#define GL_MODELVIEW_PROJECTION_NV 0x8629
+#define GL_IDENTITY_NV 0x862A
+#define GL_INVERSE_NV 0x862B
+#define GL_TRANSPOSE_NV 0x862C
+#define GL_INVERSE_TRANSPOSE_NV 0x862D
+#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E
+#define GL_MAX_TRACK_MATRICES_NV 0x862F
+#define GL_MATRIX0_NV 0x8630
+#define GL_MATRIX1_NV 0x8631
+#define GL_MATRIX2_NV 0x8632
+#define GL_MATRIX3_NV 0x8633
+#define GL_MATRIX4_NV 0x8634
+#define GL_MATRIX5_NV 0x8635
+#define GL_MATRIX6_NV 0x8636
+#define GL_MATRIX7_NV 0x8637
+#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640
+#define GL_CURRENT_MATRIX_NV 0x8641
+#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643
+#define GL_PROGRAM_PARAMETER_NV 0x8644
+#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645
+#define GL_PROGRAM_TARGET_NV 0x8646
+#define GL_PROGRAM_RESIDENT_NV 0x8647
+#define GL_TRACK_MATRIX_NV 0x8648
+#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649
+#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A
+#define GL_PROGRAM_ERROR_POSITION_NV 0x864B
+#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650
+#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651
+#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652
+#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653
+#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654
+#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655
+#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656
+#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657
+#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658
+#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659
+#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A
+#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B
+#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C
+#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D
+#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E
+#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F
+#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660
+#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661
+#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662
+#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663
+#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664
+#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665
+#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666
+#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667
+#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668
+#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669
+#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A
+#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B
+#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C
+#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D
+#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E
+#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F
+#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670
+#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671
+#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672
+#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673
+#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674
+#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675
+#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676
+#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677
+#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678
+#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679
+#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A
+#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B
+#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C
+#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D
+#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E
+#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F
+#endif
+
+#ifndef GL_SGIX_texture_coordinate_clamp
+#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369
+#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A
+#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B
+#endif
+
+#ifndef GL_SGIX_scalebias_hint
+#define GL_SCALEBIAS_HINT_SGIX 0x8322
+#endif
+
+#ifndef GL_OML_interlace
+#define GL_INTERLACE_OML 0x8980
+#define GL_INTERLACE_READ_OML 0x8981
+#endif
+
+#ifndef GL_OML_subsample
+#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982
+#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983
+#endif
+
+#ifndef GL_OML_resample
+#define GL_PACK_RESAMPLE_OML 0x8984
+#define GL_UNPACK_RESAMPLE_OML 0x8985
+#define GL_RESAMPLE_REPLICATE_OML 0x8986
+#define GL_RESAMPLE_ZERO_FILL_OML 0x8987
+#define GL_RESAMPLE_AVERAGE_OML 0x8988
+#define GL_RESAMPLE_DECIMATE_OML 0x8989
+#endif
+
+#ifndef GL_NV_copy_depth_to_color
+#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E
+#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F
+#endif
+
+#ifndef GL_ATI_envmap_bumpmap
+#define GL_BUMP_ROT_MATRIX_ATI 0x8775
+#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776
+#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777
+#define GL_BUMP_TEX_UNITS_ATI 0x8778
+#define GL_DUDV_ATI 0x8779
+#define GL_DU8DV8_ATI 0x877A
+#define GL_BUMP_ENVMAP_ATI 0x877B
+#define GL_BUMP_TARGET_ATI 0x877C
+#endif
+
+#ifndef GL_ATI_fragment_shader
+#define GL_FRAGMENT_SHADER_ATI 0x8920
+#define GL_REG_0_ATI 0x8921
+#define GL_REG_1_ATI 0x8922
+#define GL_REG_2_ATI 0x8923
+#define GL_REG_3_ATI 0x8924
+#define GL_REG_4_ATI 0x8925
+#define GL_REG_5_ATI 0x8926
+#define GL_REG_6_ATI 0x8927
+#define GL_REG_7_ATI 0x8928
+#define GL_REG_8_ATI 0x8929
+#define GL_REG_9_ATI 0x892A
+#define GL_REG_10_ATI 0x892B
+#define GL_REG_11_ATI 0x892C
+#define GL_REG_12_ATI 0x892D
+#define GL_REG_13_ATI 0x892E
+#define GL_REG_14_ATI 0x892F
+#define GL_REG_15_ATI 0x8930
+#define GL_REG_16_ATI 0x8931
+#define GL_REG_17_ATI 0x8932
+#define GL_REG_18_ATI 0x8933
+#define GL_REG_19_ATI 0x8934
+#define GL_REG_20_ATI 0x8935
+#define GL_REG_21_ATI 0x8936
+#define GL_REG_22_ATI 0x8937
+#define GL_REG_23_ATI 0x8938
+#define GL_REG_24_ATI 0x8939
+#define GL_REG_25_ATI 0x893A
+#define GL_REG_26_ATI 0x893B
+#define GL_REG_27_ATI 0x893C
+#define GL_REG_28_ATI 0x893D
+#define GL_REG_29_ATI 0x893E
+#define GL_REG_30_ATI 0x893F
+#define GL_REG_31_ATI 0x8940
+#define GL_CON_0_ATI 0x8941
+#define GL_CON_1_ATI 0x8942
+#define GL_CON_2_ATI 0x8943
+#define GL_CON_3_ATI 0x8944
+#define GL_CON_4_ATI 0x8945
+#define GL_CON_5_ATI 0x8946
+#define GL_CON_6_ATI 0x8947
+#define GL_CON_7_ATI 0x8948
+#define GL_CON_8_ATI 0x8949
+#define GL_CON_9_ATI 0x894A
+#define GL_CON_10_ATI 0x894B
+#define GL_CON_11_ATI 0x894C
+#define GL_CON_12_ATI 0x894D
+#define GL_CON_13_ATI 0x894E
+#define GL_CON_14_ATI 0x894F
+#define GL_CON_15_ATI 0x8950
+#define GL_CON_16_ATI 0x8951
+#define GL_CON_17_ATI 0x8952
+#define GL_CON_18_ATI 0x8953
+#define GL_CON_19_ATI 0x8954
+#define GL_CON_20_ATI 0x8955
+#define GL_CON_21_ATI 0x8956
+#define GL_CON_22_ATI 0x8957
+#define GL_CON_23_ATI 0x8958
+#define GL_CON_24_ATI 0x8959
+#define GL_CON_25_ATI 0x895A
+#define GL_CON_26_ATI 0x895B
+#define GL_CON_27_ATI 0x895C
+#define GL_CON_28_ATI 0x895D
+#define GL_CON_29_ATI 0x895E
+#define GL_CON_30_ATI 0x895F
+#define GL_CON_31_ATI 0x8960
+#define GL_MOV_ATI 0x8961
+#define GL_ADD_ATI 0x8963
+#define GL_MUL_ATI 0x8964
+#define GL_SUB_ATI 0x8965
+#define GL_DOT3_ATI 0x8966
+#define GL_DOT4_ATI 0x8967
+#define GL_MAD_ATI 0x8968
+#define GL_LERP_ATI 0x8969
+#define GL_CND_ATI 0x896A
+#define GL_CND0_ATI 0x896B
+#define GL_DOT2_ADD_ATI 0x896C
+#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D
+#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E
+#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F
+#define GL_NUM_PASSES_ATI 0x8970
+#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971
+#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972
+#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973
+#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974
+#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975
+#define GL_SWIZZLE_STR_ATI 0x8976
+#define GL_SWIZZLE_STQ_ATI 0x8977
+#define GL_SWIZZLE_STR_DR_ATI 0x8978
+#define GL_SWIZZLE_STQ_DQ_ATI 0x8979
+#define GL_SWIZZLE_STRQ_ATI 0x897A
+#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B
+#define GL_RED_BIT_ATI 0x00000001
+#define GL_GREEN_BIT_ATI 0x00000002
+#define GL_BLUE_BIT_ATI 0x00000004
+#define GL_2X_BIT_ATI 0x00000001
+#define GL_4X_BIT_ATI 0x00000002
+#define GL_8X_BIT_ATI 0x00000004
+#define GL_HALF_BIT_ATI 0x00000008
+#define GL_QUARTER_BIT_ATI 0x00000010
+#define GL_EIGHTH_BIT_ATI 0x00000020
+#define GL_SATURATE_BIT_ATI 0x00000040
+#define GL_COMP_BIT_ATI 0x00000002
+#define GL_NEGATE_BIT_ATI 0x00000004
+#define GL_BIAS_BIT_ATI 0x00000008
+#endif
+
+#ifndef GL_ATI_pn_triangles
+#define GL_PN_TRIANGLES_ATI 0x87F0
+#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1
+#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2
+#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3
+#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4
+#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5
+#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6
+#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7
+#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8
+#endif
+
+#ifndef GL_ATI_vertex_array_object
+#define GL_STATIC_ATI 0x8760
+#define GL_DYNAMIC_ATI 0x8761
+#define GL_PRESERVE_ATI 0x8762
+#define GL_DISCARD_ATI 0x8763
+#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764
+#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765
+#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766
+#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767
+#endif
+
+#ifndef GL_EXT_vertex_shader
+#define GL_VERTEX_SHADER_EXT 0x8780
+#define GL_VERTEX_SHADER_BINDING_EXT 0x8781
+#define GL_OP_INDEX_EXT 0x8782
+#define GL_OP_NEGATE_EXT 0x8783
+#define GL_OP_DOT3_EXT 0x8784
+#define GL_OP_DOT4_EXT 0x8785
+#define GL_OP_MUL_EXT 0x8786
+#define GL_OP_ADD_EXT 0x8787
+#define GL_OP_MADD_EXT 0x8788
+#define GL_OP_FRAC_EXT 0x8789
+#define GL_OP_MAX_EXT 0x878A
+#define GL_OP_MIN_EXT 0x878B
+#define GL_OP_SET_GE_EXT 0x878C
+#define GL_OP_SET_LT_EXT 0x878D
+#define GL_OP_CLAMP_EXT 0x878E
+#define GL_OP_FLOOR_EXT 0x878F
+#define GL_OP_ROUND_EXT 0x8790
+#define GL_OP_EXP_BASE_2_EXT 0x8791
+#define GL_OP_LOG_BASE_2_EXT 0x8792
+#define GL_OP_POWER_EXT 0x8793
+#define GL_OP_RECIP_EXT 0x8794
+#define GL_OP_RECIP_SQRT_EXT 0x8795
+#define GL_OP_SUB_EXT 0x8796
+#define GL_OP_CROSS_PRODUCT_EXT 0x8797
+#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798
+#define GL_OP_MOV_EXT 0x8799
+#define GL_OUTPUT_VERTEX_EXT 0x879A
+#define GL_OUTPUT_COLOR0_EXT 0x879B
+#define GL_OUTPUT_COLOR1_EXT 0x879C
+#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D
+#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E
+#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F
+#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0
+#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1
+#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2
+#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3
+#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4
+#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5
+#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6
+#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7
+#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8
+#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9
+#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA
+#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB
+#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC
+#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD
+#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE
+#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF
+#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0
+#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1
+#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2
+#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3
+#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4
+#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5
+#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6
+#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7
+#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8
+#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9
+#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA
+#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB
+#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC
+#define GL_OUTPUT_FOG_EXT 0x87BD
+#define GL_SCALAR_EXT 0x87BE
+#define GL_VECTOR_EXT 0x87BF
+#define GL_MATRIX_EXT 0x87C0
+#define GL_VARIANT_EXT 0x87C1
+#define GL_INVARIANT_EXT 0x87C2
+#define GL_LOCAL_CONSTANT_EXT 0x87C3
+#define GL_LOCAL_EXT 0x87C4
+#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5
+#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6
+#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7
+#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8
+#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE
+#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF
+#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0
+#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1
+#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2
+#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3
+#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4
+#define GL_X_EXT 0x87D5
+#define GL_Y_EXT 0x87D6
+#define GL_Z_EXT 0x87D7
+#define GL_W_EXT 0x87D8
+#define GL_NEGATIVE_X_EXT 0x87D9
+#define GL_NEGATIVE_Y_EXT 0x87DA
+#define GL_NEGATIVE_Z_EXT 0x87DB
+#define GL_NEGATIVE_W_EXT 0x87DC
+#define GL_ZERO_EXT 0x87DD
+#define GL_ONE_EXT 0x87DE
+#define GL_NEGATIVE_ONE_EXT 0x87DF
+#define GL_NORMALIZED_RANGE_EXT 0x87E0
+#define GL_FULL_RANGE_EXT 0x87E1
+#define GL_CURRENT_VERTEX_EXT 0x87E2
+#define GL_MVP_MATRIX_EXT 0x87E3
+#define GL_VARIANT_VALUE_EXT 0x87E4
+#define GL_VARIANT_DATATYPE_EXT 0x87E5
+#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6
+#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7
+#define GL_VARIANT_ARRAY_EXT 0x87E8
+#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9
+#define GL_INVARIANT_VALUE_EXT 0x87EA
+#define GL_INVARIANT_DATATYPE_EXT 0x87EB
+#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC
+#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED
+#endif
+
+#ifndef GL_ATI_vertex_streams
+#define GL_MAX_VERTEX_STREAMS_ATI 0x876B
+#define GL_VERTEX_STREAM0_ATI 0x876C
+#define GL_VERTEX_STREAM1_ATI 0x876D
+#define GL_VERTEX_STREAM2_ATI 0x876E
+#define GL_VERTEX_STREAM3_ATI 0x876F
+#define GL_VERTEX_STREAM4_ATI 0x8770
+#define GL_VERTEX_STREAM5_ATI 0x8771
+#define GL_VERTEX_STREAM6_ATI 0x8772
+#define GL_VERTEX_STREAM7_ATI 0x8773
+#define GL_VERTEX_SOURCE_ATI 0x8774
+#endif
+
+#ifndef GL_ATI_element_array
+#define GL_ELEMENT_ARRAY_ATI 0x8768
+#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769
+#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A
+#endif
+
+#ifndef GL_SUN_mesh_array
+#define GL_QUAD_MESH_SUN 0x8614
+#define GL_TRIANGLE_MESH_SUN 0x8615
+#endif
+
+#ifndef GL_SUN_slice_accum
+#define GL_SLICE_ACCUM_SUN 0x85CC
+#endif
+
+#ifndef GL_NV_multisample_filter_hint
+#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534
+#endif
+
+#ifndef GL_NV_depth_clamp
+#define GL_DEPTH_CLAMP_NV 0x864F
+#endif
+
+#ifndef GL_NV_occlusion_query
+#define GL_PIXEL_COUNTER_BITS_NV 0x8864
+#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865
+#define GL_PIXEL_COUNT_NV 0x8866
+#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867
+#endif
+
+#ifndef GL_NV_point_sprite
+#define GL_POINT_SPRITE_NV 0x8861
+#define GL_COORD_REPLACE_NV 0x8862
+#define GL_POINT_SPRITE_R_MODE_NV 0x8863
+#endif
+
+#ifndef GL_NV_texture_shader3
+#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850
+#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851
+#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852
+#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853
+#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854
+#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855
+#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856
+#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857
+#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858
+#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859
+#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A
+#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B
+#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C
+#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D
+#define GL_HILO8_NV 0x885E
+#define GL_SIGNED_HILO8_NV 0x885F
+#define GL_FORCE_BLUE_TO_ONE_NV 0x8860
+#endif
+
+#ifndef GL_NV_vertex_program1_1
+#endif
+
+#ifndef GL_EXT_shadow_funcs
+#endif
+
+#ifndef GL_EXT_stencil_two_side
+#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910
+#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911
+#endif
+
+#ifndef GL_ATI_text_fragment_shader
+#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200
+#endif
+
+#ifndef GL_APPLE_client_storage
+#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
+#endif
+
+#ifndef GL_APPLE_element_array
+#define GL_ELEMENT_ARRAY_APPLE 0x8768
+#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769
+#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A
+#endif
+
+#ifndef GL_APPLE_fence
+#define GL_DRAW_PIXELS_APPLE 0x8A0A
+#define GL_FENCE_APPLE 0x8A0B
+#endif
+
+#ifndef GL_APPLE_vertex_array_object
+#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5
+#endif
+
+#ifndef GL_APPLE_vertex_array_range
+#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D
+#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E
+#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F
+#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521
+#define GL_STORAGE_CACHED_APPLE 0x85BE
+#define GL_STORAGE_SHARED_APPLE 0x85BF
+#endif
+
+#ifndef GL_APPLE_ycbcr_422
+#define GL_YCBCR_422_APPLE 0x85B9
+#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
+#endif
+
+#ifndef GL_S3_s3tc
+#define GL_RGB_S3TC 0x83A0
+#define GL_RGB4_S3TC 0x83A1
+#define GL_RGBA_S3TC 0x83A2
+#define GL_RGBA4_S3TC 0x83A3
+#endif
+
+#ifndef GL_ATI_draw_buffers
+#define GL_MAX_DRAW_BUFFERS_ATI 0x8824
+#define GL_DRAW_BUFFER0_ATI 0x8825
+#define GL_DRAW_BUFFER1_ATI 0x8826
+#define GL_DRAW_BUFFER2_ATI 0x8827
+#define GL_DRAW_BUFFER3_ATI 0x8828
+#define GL_DRAW_BUFFER4_ATI 0x8829
+#define GL_DRAW_BUFFER5_ATI 0x882A
+#define GL_DRAW_BUFFER6_ATI 0x882B
+#define GL_DRAW_BUFFER7_ATI 0x882C
+#define GL_DRAW_BUFFER8_ATI 0x882D
+#define GL_DRAW_BUFFER9_ATI 0x882E
+#define GL_DRAW_BUFFER10_ATI 0x882F
+#define GL_DRAW_BUFFER11_ATI 0x8830
+#define GL_DRAW_BUFFER12_ATI 0x8831
+#define GL_DRAW_BUFFER13_ATI 0x8832
+#define GL_DRAW_BUFFER14_ATI 0x8833
+#define GL_DRAW_BUFFER15_ATI 0x8834
+#endif
+
+#ifndef GL_ATI_pixel_format_float
+#define GL_TYPE_RGBA_FLOAT_ATI 0x8820
+#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
+#endif
+
+#ifndef GL_ATI_texture_env_combine3
+#define GL_MODULATE_ADD_ATI 0x8744
+#define GL_MODULATE_SIGNED_ADD_ATI 0x8745
+#define GL_MODULATE_SUBTRACT_ATI 0x8746
+#endif
+
+#ifndef GL_ATI_texture_float
+#define GL_RGBA_FLOAT32_ATI 0x8814
+#define GL_RGB_FLOAT32_ATI 0x8815
+#define GL_ALPHA_FLOAT32_ATI 0x8816
+#define GL_INTENSITY_FLOAT32_ATI 0x8817
+#define GL_LUMINANCE_FLOAT32_ATI 0x8818
+#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819
+#define GL_RGBA_FLOAT16_ATI 0x881A
+#define GL_RGB_FLOAT16_ATI 0x881B
+#define GL_ALPHA_FLOAT16_ATI 0x881C
+#define GL_INTENSITY_FLOAT16_ATI 0x881D
+#define GL_LUMINANCE_FLOAT16_ATI 0x881E
+#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F
+#endif
+
+#ifndef GL_NV_float_buffer
+#define GL_FLOAT_R_NV 0x8880
+#define GL_FLOAT_RG_NV 0x8881
+#define GL_FLOAT_RGB_NV 0x8882
+#define GL_FLOAT_RGBA_NV 0x8883
+#define GL_FLOAT_R16_NV 0x8884
+#define GL_FLOAT_R32_NV 0x8885
+#define GL_FLOAT_RG16_NV 0x8886
+#define GL_FLOAT_RG32_NV 0x8887
+#define GL_FLOAT_RGB16_NV 0x8888
+#define GL_FLOAT_RGB32_NV 0x8889
+#define GL_FLOAT_RGBA16_NV 0x888A
+#define GL_FLOAT_RGBA32_NV 0x888B
+#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C
+#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D
+#define GL_FLOAT_RGBA_MODE_NV 0x888E
+#endif
+
+#ifndef GL_NV_fragment_program
+#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868
+#define GL_FRAGMENT_PROGRAM_NV 0x8870
+#define GL_MAX_TEXTURE_COORDS_NV 0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872
+#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873
+#define GL_PROGRAM_ERROR_STRING_NV 0x8874
+#endif
+
+#ifndef GL_NV_half_float
+#define GL_HALF_FLOAT_NV 0x140B
+#endif
+
+#ifndef GL_NV_pixel_data_range
+#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878
+#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879
+#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A
+#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B
+#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C
+#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D
+#endif
+
+#ifndef GL_NV_primitive_restart
+#define GL_PRIMITIVE_RESTART_NV 0x8558
+#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559
+#endif
+
+#ifndef GL_NV_texture_expand_normal
+#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F
+#endif
+
+#ifndef GL_NV_vertex_program2
+#endif
+
+#ifndef GL_ATI_map_object_buffer
+#endif
+
+#ifndef GL_ATI_separate_stencil
+#define GL_STENCIL_BACK_FUNC_ATI 0x8800
+#define GL_STENCIL_BACK_FAIL_ATI 0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803
+#endif
+
+#ifndef GL_ATI_vertex_attrib_array_object
+#endif
+
+#ifndef GL_OES_read_format
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
+#endif
+
+#ifndef GL_EXT_depth_bounds_test
+#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890
+#define GL_DEPTH_BOUNDS_EXT 0x8891
+#endif
+
+#ifndef GL_EXT_texture_mirror_clamp
+#define GL_MIRROR_CLAMP_EXT 0x8742
+#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743
+#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912
+#endif
+
+#ifndef GL_EXT_blend_equation_separate
+#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION
+#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D
+#endif
+
+#ifndef GL_MESA_pack_invert
+#define GL_PACK_INVERT_MESA 0x8758
+#endif
+
+#ifndef GL_MESA_ycbcr_texture
+#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB
+#define GL_YCBCR_MESA 0x8757
+#endif
+
+#ifndef GL_EXT_pixel_buffer_object
+#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB
+#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF
+#endif
+
+#ifndef GL_NV_fragment_program_option
+#endif
+
+#ifndef GL_NV_fragment_program2
+#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4
+#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5
+#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6
+#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7
+#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8
+#endif
+
+#ifndef GL_NV_vertex_program2_option
+/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
+/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */
+#endif
+
+#ifndef GL_NV_vertex_program3
+/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
+#endif
+
+#ifndef GL_EXT_framebuffer_object
+#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
+#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
+#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
+#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
+#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
+#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
+#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
+#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
+#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
+#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
+#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
+#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
+#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
+#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
+#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
+#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
+#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
+#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
+#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
+#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
+#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
+#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
+#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
+#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
+#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
+#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
+#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
+#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
+#define GL_FRAMEBUFFER_EXT 0x8D40
+#define GL_RENDERBUFFER_EXT 0x8D41
+#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
+#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
+#define GL_STENCIL_INDEX1_EXT 0x8D46
+#define GL_STENCIL_INDEX4_EXT 0x8D47
+#define GL_STENCIL_INDEX8_EXT 0x8D48
+#define GL_STENCIL_INDEX16_EXT 0x8D49
+#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
+#endif
+
+#ifndef GL_GREMEDY_string_marker
+#endif
+
+
+/*************************************************************/
+
+#include <stddef.h>
+#ifndef GL_VERSION_2_0
+/* GL type for program/shader text */
+typedef char GLchar; /* native character */
+#endif
+
+#ifndef GL_VERSION_1_5
+/* GL types for handling large vertex buffer objects */
+#ifdef __APPLE__
+typedef long GLintptr;
+typedef long GLsizeiptr;
+#else
+typedef ptrdiff_t GLintptr;
+typedef ptrdiff_t GLsizeiptr;
+#endif
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+/* GL types for handling large vertex buffer objects */
+#ifdef __APPLE__
+typedef long GLintptrARB;
+typedef long GLsizeiptrARB;
+#else
+typedef ptrdiff_t GLintptrARB;
+typedef ptrdiff_t GLsizeiptrARB;
+#endif
+#endif
+
+#ifndef GL_ARB_shader_objects
+/* GL types for handling shader object handles and program/shader text */
+typedef char GLcharARB; /* native character */
+#if defined(__APPLE__)
+typedef void *GLhandleARB; /* shader object handle */
+#else
+typedef unsigned int GLhandleARB; /* shader object handle */
+#endif
+#endif
+
+/* GL types for "half" precision (s10e5) float data in host memory */
+#ifndef GL_ARB_half_float_pixel
+typedef unsigned short GLhalfARB;
+#endif
+
+#ifndef GL_NV_half_float
+typedef unsigned short GLhalfNV;
+#endif
+
+#ifndef GL_VERSION_1_2
+#define GL_VERSION_1_2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf);
+GLAPI void APIENTRY glBlendEquation (GLenum);
+GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
+GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
+GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
+GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean);
+GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean);
+GLAPI void APIENTRY glResetHistogram (GLenum);
+GLAPI void APIENTRY glResetMinmax (GLenum);
+GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_VERSION_1_3
+#define GL_VERSION_1_3 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveTexture (GLenum);
+GLAPI void APIENTRY glClientActiveTexture (GLenum);
+GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint);
+GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort);
+GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *);
+GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *);
+GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *);
+GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *);
+GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean);
+GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
+#endif
+
+#ifndef GL_VERSION_1_4
+#define GL_VERSION_1_4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glFogCoordf (GLfloat);
+GLAPI void APIENTRY glFogCoordfv (const GLfloat *);
+GLAPI void APIENTRY glFogCoordd (GLdouble);
+GLAPI void APIENTRY glFogCoorddv (const GLdouble *);
+GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei);
+GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
+GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glPointParameteri (GLenum, GLint);
+GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *);
+GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *);
+GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *);
+GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *);
+GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint);
+GLAPI void APIENTRY glSecondaryColor3iv (const GLint *);
+GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *);
+GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *);
+GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *);
+GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort);
+GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *);
+GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos2dv (const GLdouble *);
+GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos2fv (const GLfloat *);
+GLAPI void APIENTRY glWindowPos2i (GLint, GLint);
+GLAPI void APIENTRY glWindowPos2iv (const GLint *);
+GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos2sv (const GLshort *);
+GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos3dv (const GLdouble *);
+GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos3fv (const GLfloat *);
+GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos3iv (const GLint *);
+GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos3sv (const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord);
+typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_VERSION_1_5
+#define GL_VERSION_1_5 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsQuery (GLuint);
+GLAPI void APIENTRY glBeginQuery (GLenum, GLuint);
+GLAPI void APIENTRY glEndQuery (GLenum);
+GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *);
+GLAPI void APIENTRY glBindBuffer (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsBuffer (GLuint);
+GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum);
+GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *);
+GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *);
+GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum);
+GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum);
+GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
+typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
+typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
+typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
+typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
+typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params);
+#endif
+
+#ifndef GL_VERSION_2_0
+#define GL_VERSION_2_0 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum);
+GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *);
+GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint);
+GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint);
+GLAPI void APIENTRY glAttachShader (GLuint, GLuint);
+GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *);
+GLAPI void APIENTRY glCompileShader (GLuint);
+GLAPI GLuint APIENTRY glCreateProgram (void);
+GLAPI GLuint APIENTRY glCreateShader (GLenum);
+GLAPI void APIENTRY glDeleteProgram (GLuint);
+GLAPI void APIENTRY glDeleteShader (GLuint);
+GLAPI void APIENTRY glDetachShader (GLuint, GLuint);
+GLAPI void APIENTRY glDisableVertexAttribArray (GLuint);
+GLAPI void APIENTRY glEnableVertexAttribArray (GLuint);
+GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
+GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
+GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *);
+GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *);
+GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *);
+GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *);
+GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *);
+GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *);
+GLAPI GLboolean APIENTRY glIsProgram (GLuint);
+GLAPI GLboolean APIENTRY glIsShader (GLuint);
+GLAPI void APIENTRY glLinkProgram (GLuint);
+GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *);
+GLAPI void APIENTRY glUseProgram (GLuint);
+GLAPI void APIENTRY glUniform1f (GLint, GLfloat);
+GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform1i (GLint, GLint);
+GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glValidateProgram (GLuint);
+GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble);
+GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat);
+GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort);
+GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
+typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
+typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
+typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
+typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
+typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
+typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
+typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
+typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
+typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
+typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
+typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_ARB_multitexture
+#define GL_ARB_multitexture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveTextureARB (GLenum);
+GLAPI void APIENTRY glClientActiveTextureARB (GLenum);
+GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint);
+GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort);
+GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
+#endif
+
+#ifndef GL_ARB_transpose_matrix
+#define GL_ARB_transpose_matrix 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *);
+GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *);
+GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *);
+GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
+#endif
+
+#ifndef GL_ARB_multisample
+#define GL_ARB_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert);
+#endif
+
+#ifndef GL_ARB_texture_env_add
+#define GL_ARB_texture_env_add 1
+#endif
+
+#ifndef GL_ARB_texture_cube_map
+#define GL_ARB_texture_cube_map 1
+#endif
+
+#ifndef GL_ARB_texture_compression
+#define GL_ARB_texture_compression 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img);
+#endif
+
+#ifndef GL_ARB_texture_border_clamp
+#define GL_ARB_texture_border_clamp 1
+#endif
+
+#ifndef GL_ARB_point_parameters
+#define GL_ARB_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_ARB_vertex_blend
+#define GL_ARB_vertex_blend 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *);
+GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *);
+GLAPI void APIENTRY glWeightivARB (GLint, const GLint *);
+GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *);
+GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *);
+GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *);
+GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *);
+GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *);
+GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glVertexBlendARB (GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights);
+typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights);
+typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights);
+typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights);
+typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights);
+typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count);
+#endif
+
+#ifndef GL_ARB_matrix_palette
+#define GL_ARB_matrix_palette 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint);
+GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *);
+GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *);
+GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *);
+GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_ARB_texture_env_combine
+#define GL_ARB_texture_env_combine 1
+#endif
+
+#ifndef GL_ARB_texture_env_crossbar
+#define GL_ARB_texture_env_crossbar 1
+#endif
+
+#ifndef GL_ARB_texture_env_dot3
+#define GL_ARB_texture_env_dot3 1
+#endif
+
+#ifndef GL_ARB_texture_mirrored_repeat
+#define GL_ARB_texture_mirrored_repeat 1
+#endif
+
+#ifndef GL_ARB_depth_texture
+#define GL_ARB_depth_texture 1
+#endif
+
+#ifndef GL_ARB_shadow
+#define GL_ARB_shadow 1
+#endif
+
+#ifndef GL_ARB_shadow_ambient
+#define GL_ARB_shadow_ambient 1
+#endif
+
+#ifndef GL_ARB_window_pos
+#define GL_ARB_window_pos 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *);
+GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *);
+GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint);
+GLAPI void APIENTRY glWindowPos2ivARB (const GLint *);
+GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos2svARB (const GLshort *);
+GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *);
+GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *);
+GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos3ivARB (const GLint *);
+GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos3svARB (const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_ARB_vertex_program
+#define GL_ARB_vertex_program 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble);
+GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat);
+GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort);
+GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint);
+GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint);
+GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *);
+GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *);
+GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *);
+GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *);
+GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *);
+GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *);
+GLAPI GLboolean APIENTRY glIsProgramARB (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
+typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program);
+#endif
+
+#ifndef GL_ARB_fragment_program
+#define GL_ARB_fragment_program 1
+/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+#define GL_ARB_vertex_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsBufferARB (GLuint);
+GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
+GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *);
+GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *);
+GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum);
+GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum);
+GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
+typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);
+typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
+typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
+typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
+typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params);
+#endif
+
+#ifndef GL_ARB_occlusion_query
+#define GL_ARB_occlusion_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsQueryARB (GLuint);
+GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint);
+GLAPI void APIENTRY glEndQueryARB (GLenum);
+GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_ARB_shader_objects
+#define GL_ARB_shader_objects 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB);
+GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum);
+GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB);
+GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum);
+GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *);
+GLAPI void APIENTRY glCompileShaderARB (GLhandleARB);
+GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void);
+GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB);
+GLAPI void APIENTRY glLinkProgramARB (GLhandleARB);
+GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB);
+GLAPI void APIENTRY glValidateProgramARB (GLhandleARB);
+GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat);
+GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform1iARB (GLint, GLint);
+GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *);
+GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
+GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *);
+GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *);
+GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
+GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *);
+GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *);
+GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
+typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname);
+typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);
+typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
+typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
+typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
+typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void);
+typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);
+typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
+typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params);
+typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
+#endif
+
+#ifndef GL_ARB_vertex_shader
+#define GL_ARB_vertex_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *);
+GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
+GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
+#endif
+
+#ifndef GL_ARB_fragment_shader
+#define GL_ARB_fragment_shader 1
+#endif
+
+#ifndef GL_ARB_shading_language_100
+#define GL_ARB_shading_language_100 1
+#endif
+
+#ifndef GL_ARB_texture_non_power_of_two
+#define GL_ARB_texture_non_power_of_two 1
+#endif
+
+#ifndef GL_ARB_point_sprite
+#define GL_ARB_point_sprite 1
+#endif
+
+#ifndef GL_ARB_fragment_program_shadow
+#define GL_ARB_fragment_program_shadow 1
+#endif
+
+#ifndef GL_ARB_draw_buffers
+#define GL_ARB_draw_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs);
+#endif
+
+#ifndef GL_ARB_texture_rectangle
+#define GL_ARB_texture_rectangle 1
+#endif
+
+#ifndef GL_ARB_color_buffer_float
+#define GL_ARB_color_buffer_float 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glClampColorARB (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
+#endif
+
+#ifndef GL_ARB_half_float_pixel
+#define GL_ARB_half_float_pixel 1
+#endif
+
+#ifndef GL_ARB_texture_float
+#define GL_ARB_texture_float 1
+#endif
+
+#ifndef GL_ARB_pixel_buffer_object
+#define GL_ARB_pixel_buffer_object 1
+#endif
+
+#ifndef GL_EXT_abgr
+#define GL_EXT_abgr 1
+#endif
+
+#ifndef GL_EXT_blend_color
+#define GL_EXT_blend_color 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+#endif
+
+#ifndef GL_EXT_polygon_offset
+#define GL_EXT_polygon_offset 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);
+#endif
+
+#ifndef GL_EXT_texture
+#define GL_EXT_texture 1
+#endif
+
+#ifndef GL_EXT_texture3D
+#define GL_EXT_texture3D 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_SGIS_texture_filter4
+#define GL_SGIS_texture_filter4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights);
+typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
+#endif
+
+#ifndef GL_EXT_subtexture
+#define GL_EXT_subtexture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_EXT_copy_texture
+#define GL_EXT_copy_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
+GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
+GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_EXT_histogram
+#define GL_EXT_histogram 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean);
+GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean);
+GLAPI void APIENTRY glResetHistogramEXT (GLenum);
+GLAPI void APIENTRY glResetMinmaxEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target);
+#endif
+
+#ifndef GL_EXT_convolution
+#define GL_EXT_convolution 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
+GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+#endif
+
+#ifndef GL_EXT_color_matrix
+#define GL_EXT_color_matrix 1
+#endif
+
+#ifndef GL_SGI_color_table
+#define GL_SGI_color_table 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_SGIX_pixel_texture
+#define GL_SGIX_pixel_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTexGenSGIX (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);
+#endif
+
+#ifndef GL_SGIS_pixel_texture
+#define GL_SGIS_pixel_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint);
+GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *);
+GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat);
+GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *);
+GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_SGIS_texture4D
+#define GL_SGIS_texture4D 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_SGI_texture_color_table
+#define GL_SGI_texture_color_table 1
+#endif
+
+#ifndef GL_EXT_cmyka
+#define GL_EXT_cmyka 1
+#endif
+
+#ifndef GL_EXT_texture_object
+#define GL_EXT_texture_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *);
+GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint);
+GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences);
+typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);
+typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures);
+typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures);
+typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture);
+typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities);
+#endif
+
+#ifndef GL_SGIS_detail_texture
+#define GL_SGIS_detail_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
+#endif
+
+#ifndef GL_SGIS_sharpen_texture
+#define GL_SGIS_sharpen_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
+#endif
+
+#ifndef GL_EXT_packed_pixels
+#define GL_EXT_packed_pixels 1
+#endif
+
+#ifndef GL_SGIS_texture_lod
+#define GL_SGIS_texture_lod 1
+#endif
+
+#ifndef GL_SGIS_multisample
+#define GL_SGIS_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean);
+GLAPI void APIENTRY glSamplePatternSGIS (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);
+#endif
+
+#ifndef GL_EXT_rescale_normal
+#define GL_EXT_rescale_normal 1
+#endif
+
+#ifndef GL_EXT_vertex_array
+#define GL_EXT_vertex_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glArrayElementEXT (GLint);
+GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei);
+GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *);
+GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *);
+GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i);
+typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer);
+typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params);
+typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_misc_attribute
+#define GL_EXT_misc_attribute 1
+#endif
+
+#ifndef GL_SGIS_generate_mipmap
+#define GL_SGIS_generate_mipmap 1
+#endif
+
+#ifndef GL_SGIX_clipmap
+#define GL_SGIX_clipmap 1
+#endif
+
+#ifndef GL_SGIX_shadow
+#define GL_SGIX_shadow 1
+#endif
+
+#ifndef GL_SGIS_texture_edge_clamp
+#define GL_SGIS_texture_edge_clamp 1
+#endif
+
+#ifndef GL_SGIS_texture_border_clamp
+#define GL_SGIS_texture_border_clamp 1
+#endif
+
+#ifndef GL_EXT_blend_minmax
+#define GL_EXT_blend_minmax 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);
+#endif
+
+#ifndef GL_EXT_blend_subtract
+#define GL_EXT_blend_subtract 1
+#endif
+
+#ifndef GL_EXT_blend_logic_op
+#define GL_EXT_blend_logic_op 1
+#endif
+
+#ifndef GL_SGIX_interlace
+#define GL_SGIX_interlace 1
+#endif
+
+#ifndef GL_SGIX_pixel_tiles
+#define GL_SGIX_pixel_tiles 1
+#endif
+
+#ifndef GL_SGIX_texture_select
+#define GL_SGIX_texture_select 1
+#endif
+
+#ifndef GL_SGIX_sprite
+#define GL_SGIX_sprite 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat);
+GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *);
+GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint);
+GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_SGIX_texture_multi_buffer
+#define GL_SGIX_texture_multi_buffer 1
+#endif
+
+#ifndef GL_EXT_point_parameters
+#define GL_EXT_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_SGIS_point_parameters
+#define GL_SGIS_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_SGIX_instruments
+#define GL_SGIX_instruments 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLint APIENTRY glGetInstrumentsSGIX (void);
+GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *);
+GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *);
+GLAPI void APIENTRY glReadInstrumentsSGIX (GLint);
+GLAPI void APIENTRY glStartInstrumentsSGIX (void);
+GLAPI void APIENTRY glStopInstrumentsSGIX (GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void);
+typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer);
+typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p);
+typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker);
+typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void);
+typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker);
+#endif
+
+#ifndef GL_SGIX_texture_scale_bias
+#define GL_SGIX_texture_scale_bias 1
+#endif
+
+#ifndef GL_SGIX_framezoom
+#define GL_SGIX_framezoom 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFrameZoomSGIX (GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor);
+#endif
+
+#ifndef GL_SGIX_tag_sample_buffer
+#define GL_SGIX_tag_sample_buffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTagSampleBufferSGIX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);
+#endif
+
+#ifndef GL_SGIX_polynomial_ffd
+#define GL_SGIX_polynomial_ffd 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *);
+GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *);
+GLAPI void APIENTRY glDeformSGIX (GLbitfield);
+GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
+typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
+typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask);
+typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask);
+#endif
+
+#ifndef GL_SGIX_reference_plane
+#define GL_SGIX_reference_plane 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation);
+#endif
+
+#ifndef GL_SGIX_flush_raster
+#define GL_SGIX_flush_raster 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFlushRasterSGIX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void);
+#endif
+
+#ifndef GL_SGIX_depth_texture
+#define GL_SGIX_depth_texture 1
+#endif
+
+#ifndef GL_SGIS_fog_function
+#define GL_SGIS_fog_function 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *);
+GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points);
+#endif
+
+#ifndef GL_SGIX_fog_offset
+#define GL_SGIX_fog_offset 1
+#endif
+
+#ifndef GL_HP_image_transform
+#define GL_HP_image_transform 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_HP_convolution_border_modes
+#define GL_HP_convolution_border_modes 1
+#endif
+
+#ifndef GL_SGIX_texture_add_env
+#define GL_SGIX_texture_add_env 1
+#endif
+
+#ifndef GL_EXT_color_subtable
+#define GL_EXT_color_subtable 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+#endif
+
+#ifndef GL_PGI_vertex_hints
+#define GL_PGI_vertex_hints 1
+#endif
+
+#ifndef GL_PGI_misc_hints
+#define GL_PGI_misc_hints 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glHintPGI (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode);
+#endif
+
+#ifndef GL_EXT_paletted_texture
+#define GL_EXT_paletted_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_EXT_clip_volume_hint
+#define GL_EXT_clip_volume_hint 1
+#endif
+
+#ifndef GL_SGIX_list_priority
+#define GL_SGIX_list_priority 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat);
+GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *);
+GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint);
+GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_SGIX_ir_instrument1
+#define GL_SGIX_ir_instrument1 1
+#endif
+
+#ifndef GL_SGIX_calligraphic_fragment
+#define GL_SGIX_calligraphic_fragment 1
+#endif
+
+#ifndef GL_SGIX_texture_lod_bias
+#define GL_SGIX_texture_lod_bias 1
+#endif
+
+#ifndef GL_SGIX_shadow_ambient
+#define GL_SGIX_shadow_ambient 1
+#endif
+
+#ifndef GL_EXT_index_texture
+#define GL_EXT_index_texture 1
+#endif
+
+#ifndef GL_EXT_index_material
+#define GL_EXT_index_material 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);
+#endif
+
+#ifndef GL_EXT_index_func
+#define GL_EXT_index_func 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref);
+#endif
+
+#ifndef GL_EXT_index_array_formats
+#define GL_EXT_index_array_formats 1
+#endif
+
+#ifndef GL_EXT_compiled_vertex_array
+#define GL_EXT_compiled_vertex_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei);
+GLAPI void APIENTRY glUnlockArraysEXT (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void);
+#endif
+
+#ifndef GL_EXT_cull_vertex
+#define GL_EXT_cull_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *);
+GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_SGIX_ycrcb
+#define GL_SGIX_ycrcb 1
+#endif
+
+#ifndef GL_SGIX_fragment_lighting
+#define GL_SGIX_fragment_lighting 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum);
+GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat);
+GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *);
+GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint);
+GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *);
+GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param);
+#endif
+
+#ifndef GL_IBM_rasterpos_clip
+#define GL_IBM_rasterpos_clip 1
+#endif
+
+#ifndef GL_HP_texture_lighting
+#define GL_HP_texture_lighting 1
+#endif
+
+#ifndef GL_EXT_draw_range_elements
+#define GL_EXT_draw_range_elements 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+#endif
+
+#ifndef GL_WIN_phong_shading
+#define GL_WIN_phong_shading 1
+#endif
+
+#ifndef GL_WIN_specular_fog
+#define GL_WIN_specular_fog 1
+#endif
+
+#ifndef GL_EXT_light_texture
+#define GL_EXT_light_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glApplyTextureEXT (GLenum);
+GLAPI void APIENTRY glTextureLightEXT (GLenum);
+GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);
+typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode);
+#endif
+
+#ifndef GL_SGIX_blend_alpha_minmax
+#define GL_SGIX_blend_alpha_minmax 1
+#endif
+
+#ifndef GL_EXT_bgra
+#define GL_EXT_bgra 1
+#endif
+
+#ifndef GL_SGIX_async
+#define GL_SGIX_async 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint);
+GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *);
+GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *);
+GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei);
+GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei);
+GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker);
+typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp);
+typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp);
+typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range);
+typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range);
+typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker);
+#endif
+
+#ifndef GL_SGIX_async_pixel
+#define GL_SGIX_async_pixel 1
+#endif
+
+#ifndef GL_SGIX_async_histogram
+#define GL_SGIX_async_histogram 1
+#endif
+
+#ifndef GL_INTEL_parallel_arrays
+#define GL_INTEL_parallel_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *);
+GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *);
+GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *);
+GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+#endif
+
+#ifndef GL_HP_occlusion_test
+#define GL_HP_occlusion_test 1
+#endif
+
+#ifndef GL_EXT_pixel_transform
+#define GL_EXT_pixel_transform 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_EXT_pixel_transform_color_table
+#define GL_EXT_pixel_transform_color_table 1
+#endif
+
+#ifndef GL_EXT_shared_texture_palette
+#define GL_EXT_shared_texture_palette 1
+#endif
+
+#ifndef GL_EXT_separate_specular_color
+#define GL_EXT_separate_specular_color 1
+#endif
+
+#ifndef GL_EXT_secondary_color
+#define GL_EXT_secondary_color 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *);
+GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *);
+GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *);
+GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint);
+GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *);
+GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *);
+GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *);
+GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *);
+GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort);
+GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *);
+GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_texture_perturb_normal
+#define GL_EXT_texture_perturb_normal 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureNormalEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode);
+#endif
+
+#ifndef GL_EXT_multi_draw_arrays
+#define GL_EXT_multi_draw_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei);
+GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+#endif
+
+#ifndef GL_EXT_fog_coord
+#define GL_EXT_fog_coord 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFogCoordfEXT (GLfloat);
+GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *);
+GLAPI void APIENTRY glFogCoorddEXT (GLdouble);
+GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *);
+GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
+typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_REND_screen_coordinates
+#define GL_REND_screen_coordinates 1
+#endif
+
+#ifndef GL_EXT_coordinate_frame
+#define GL_EXT_coordinate_frame 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *);
+GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *);
+GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *);
+GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint);
+GLAPI void APIENTRY glTangent3ivEXT (const GLint *);
+GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glTangent3svEXT (const GLshort *);
+GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *);
+GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *);
+GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *);
+GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint);
+GLAPI void APIENTRY glBinormal3ivEXT (const GLint *);
+GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glBinormal3svEXT (const GLshort *);
+GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz);
+typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz);
+typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz);
+typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz);
+typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz);
+typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz);
+typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz);
+typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz);
+typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz);
+typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz);
+typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_texture_env_combine
+#define GL_EXT_texture_env_combine 1
+#endif
+
+#ifndef GL_APPLE_specular_vector
+#define GL_APPLE_specular_vector 1
+#endif
+
+#ifndef GL_APPLE_transform_hint
+#define GL_APPLE_transform_hint 1
+#endif
+
+#ifndef GL_SGIX_fog_scale
+#define GL_SGIX_fog_scale 1
+#endif
+
+#ifndef GL_SUNX_constant_data
+#define GL_SUNX_constant_data 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFinishTextureSUNX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void);
+#endif
+
+#ifndef GL_SUN_global_alpha
+#define GL_SUN_global_alpha 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte);
+GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort);
+GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint);
+GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat);
+GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble);
+GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte);
+GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort);
+GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor);
+#endif
+
+#ifndef GL_SUN_triangle_list
+#define GL_SUN_triangle_list 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint);
+GLAPI void APIENTRY glReplacementCodeusSUN (GLushort);
+GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte);
+GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *);
+GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *);
+GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *);
+GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer);
+#endif
+
+#ifndef GL_SUN_vertex
+#define GL_SUN_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+#endif
+
+#ifndef GL_EXT_blend_func_separate
+#define GL_EXT_blend_func_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+#endif
+
+#ifndef GL_INGR_blend_func_separate
+#define GL_INGR_blend_func_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+#endif
+
+#ifndef GL_INGR_color_clamp
+#define GL_INGR_color_clamp 1
+#endif
+
+#ifndef GL_INGR_interlace_read
+#define GL_INGR_interlace_read 1
+#endif
+
+#ifndef GL_EXT_stencil_wrap
+#define GL_EXT_stencil_wrap 1
+#endif
+
+#ifndef GL_EXT_422_pixels
+#define GL_EXT_422_pixels 1
+#endif
+
+#ifndef GL_NV_texgen_reflection
+#define GL_NV_texgen_reflection 1
+#endif
+
+#ifndef GL_SUN_convolution_border_modes
+#define GL_SUN_convolution_border_modes 1
+#endif
+
+#ifndef GL_EXT_texture_env_add
+#define GL_EXT_texture_env_add 1
+#endif
+
+#ifndef GL_EXT_texture_lod_bias
+#define GL_EXT_texture_lod_bias 1
+#endif
+
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_EXT_texture_filter_anisotropic 1
+#endif
+
+#ifndef GL_EXT_vertex_weighting
+#define GL_EXT_vertex_weighting 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexWeightfEXT (GLfloat);
+GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *);
+GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_NV_light_max_exponent
+#define GL_NV_light_max_exponent 1
+#endif
+
+#ifndef GL_NV_vertex_array_range
+#define GL_NV_vertex_array_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFlushVertexArrayRangeNV (void);
+GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);
+typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer);
+#endif
+
+#ifndef GL_NV_register_combiners
+#define GL_NV_register_combiners 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *);
+GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat);
+GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *);
+GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint);
+GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean);
+GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
+typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_NV_fog_distance
+#define GL_NV_fog_distance 1
+#endif
+
+#ifndef GL_NV_texgen_emboss
+#define GL_NV_texgen_emboss 1
+#endif
+
+#ifndef GL_NV_blend_square
+#define GL_NV_blend_square 1
+#endif
+
+#ifndef GL_NV_texture_env_combine4
+#define GL_NV_texture_env_combine4 1
+#endif
+
+#ifndef GL_MESA_resize_buffers
+#define GL_MESA_resize_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glResizeBuffersMESA (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void);
+#endif
+
+#ifndef GL_MESA_window_pos
+#define GL_MESA_window_pos 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *);
+GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *);
+GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint);
+GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *);
+GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *);
+GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *);
+GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *);
+GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *);
+GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *);
+GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *);
+GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *);
+GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *);
+GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_IBM_cull_vertex
+#define GL_IBM_cull_vertex 1
+#endif
+
+#ifndef GL_IBM_multimode_draw_arrays
+#define GL_IBM_multimode_draw_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint);
+GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
+typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);
+#endif
+
+#ifndef GL_IBM_vertex_array_lists
+#define GL_IBM_vertex_array_lists 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint);
+GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+#endif
+
+#ifndef GL_SGIX_subsample
+#define GL_SGIX_subsample 1
+#endif
+
+#ifndef GL_SGIX_ycrcba
+#define GL_SGIX_ycrcba 1
+#endif
+
+#ifndef GL_SGIX_ycrcb_subsample
+#define GL_SGIX_ycrcb_subsample 1
+#endif
+
+#ifndef GL_SGIX_depth_pass_instrument
+#define GL_SGIX_depth_pass_instrument 1
+#endif
+
+#ifndef GL_3DFX_texture_compression_FXT1
+#define GL_3DFX_texture_compression_FXT1 1
+#endif
+
+#ifndef GL_3DFX_multisample
+#define GL_3DFX_multisample 1
+#endif
+
+#ifndef GL_3DFX_tbuffer
+#define GL_3DFX_tbuffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTbufferMask3DFX (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);
+#endif
+
+#ifndef GL_EXT_multisample
+#define GL_EXT_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean);
+GLAPI void APIENTRY glSamplePatternEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);
+#endif
+
+#ifndef GL_SGIX_vertex_preclip
+#define GL_SGIX_vertex_preclip 1
+#endif
+
+#ifndef GL_SGIX_convolution_accuracy
+#define GL_SGIX_convolution_accuracy 1
+#endif
+
+#ifndef GL_SGIX_resample
+#define GL_SGIX_resample 1
+#endif
+
+#ifndef GL_SGIS_point_line_texgen
+#define GL_SGIS_point_line_texgen 1
+#endif
+
+#ifndef GL_SGIS_texture_color_mask
+#define GL_SGIS_texture_color_mask 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+#endif
+
+#ifndef GL_SGIX_igloo_interface
+#define GL_SGIX_igloo_interface 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params);
+#endif
+
+#ifndef GL_EXT_texture_env_dot3
+#define GL_EXT_texture_env_dot3 1
+#endif
+
+#ifndef GL_ATI_texture_mirror_once
+#define GL_ATI_texture_mirror_once 1
+#endif
+
+#ifndef GL_NV_fence
+#define GL_NV_fence 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsFenceNV (GLuint);
+GLAPI GLboolean APIENTRY glTestFenceNV (GLuint);
+GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glFinishFenceNV (GLuint);
+GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
+typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
+typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
+#endif
+
+#ifndef GL_NV_evaluators
+#define GL_NV_evaluators 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *);
+GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *);
+GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);
+typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);
+typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode);
+#endif
+
+#ifndef GL_NV_packed_depth_stencil
+#define GL_NV_packed_depth_stencil 1
+#endif
+
+#ifndef GL_NV_register_combiners2
+#define GL_NV_register_combiners2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_NV_texture_compression_vtc
+#define GL_NV_texture_compression_vtc 1
+#endif
+
+#ifndef GL_NV_texture_rectangle
+#define GL_NV_texture_rectangle 1
+#endif
+
+#ifndef GL_NV_texture_shader
+#define GL_NV_texture_shader 1
+#endif
+
+#ifndef GL_NV_texture_shader2
+#define GL_NV_texture_shader2 1
+#endif
+
+#ifndef GL_NV_vertex_array_range2
+#define GL_NV_vertex_array_range2 1
+#endif
+
+#ifndef GL_NV_vertex_program
+#define GL_NV_vertex_program 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *);
+GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *);
+GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *);
+GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *);
+GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *);
+GLAPI GLboolean APIENTRY glIsProgramNV (GLuint);
+GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *);
+GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *);
+GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *);
+GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum);
+GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble);
+GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat);
+GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort);
+GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences);
+typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs);
+typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program);
+typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v);
+#endif
+
+#ifndef GL_SGIX_texture_coordinate_clamp
+#define GL_SGIX_texture_coordinate_clamp 1
+#endif
+
+#ifndef GL_SGIX_scalebias_hint
+#define GL_SGIX_scalebias_hint 1
+#endif
+
+#ifndef GL_OML_interlace
+#define GL_OML_interlace 1
+#endif
+
+#ifndef GL_OML_subsample
+#define GL_OML_subsample 1
+#endif
+
+#ifndef GL_OML_resample
+#define GL_OML_resample 1
+#endif
+
+#ifndef GL_NV_copy_depth_to_color
+#define GL_NV_copy_depth_to_color 1
+#endif
+
+#ifndef GL_ATI_envmap_bumpmap
+#define GL_ATI_envmap_bumpmap 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *);
+GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param);
+typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param);
+typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);
+typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);
+#endif
+
+#ifndef GL_ATI_fragment_shader
+#define GL_ATI_fragment_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint);
+GLAPI void APIENTRY glBindFragmentShaderATI (GLuint);
+GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint);
+GLAPI void APIENTRY glBeginFragmentShaderATI (void);
+GLAPI void APIENTRY glEndFragmentShaderATI (void);
+GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum);
+GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum);
+GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);
+typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void);
+typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void);
+typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle);
+typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value);
+#endif
+
+#ifndef GL_ATI_pn_triangles
+#define GL_ATI_pn_triangles 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint);
+GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);
+#endif
+
+#ifndef GL_ATI_vertex_array_object
+#define GL_ATI_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum);
+GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint);
+GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum);
+GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glFreeObjectBufferATI (GLuint);
+GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint);
+GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint);
+GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage);
+typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);
+typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_EXT_vertex_shader
+#define GL_EXT_vertex_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginVertexShaderEXT (void);
+GLAPI void APIENTRY glEndVertexShaderEXT (void);
+GLAPI void APIENTRY glBindVertexShaderEXT (GLuint);
+GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint);
+GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint);
+GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint);
+GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint);
+GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint);
+GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *);
+GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *);
+GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *);
+GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *);
+GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *);
+GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *);
+GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *);
+GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint);
+GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint);
+GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindParameterEXT (GLenum);
+GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum);
+GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *);
+GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *);
+GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *);
+GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *);
+GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void);
+typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void);
+typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id);
+typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range);
+typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1);
+typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
+typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
+typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
+typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
+typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
+typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr);
+typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr);
+typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr);
+typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr);
+typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr);
+typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr);
+typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr);
+typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr);
+typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
+typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value);
+typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap);
+typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+#endif
+
+#ifndef GL_ATI_vertex_streams
+#define GL_ATI_vertex_streams 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort);
+GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint);
+GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat);
+GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble);
+GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort);
+GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint);
+GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *);
+GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum);
+GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint);
+GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream);
+typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param);
+#endif
+
+#ifndef GL_ATI_element_array
+#define GL_ATI_element_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *);
+GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei);
+GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count);
+#endif
+
+#ifndef GL_SUN_mesh_array
+#define GL_SUN_mesh_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width);
+#endif
+
+#ifndef GL_SUN_slice_accum
+#define GL_SUN_slice_accum 1
+#endif
+
+#ifndef GL_NV_multisample_filter_hint
+#define GL_NV_multisample_filter_hint 1
+#endif
+
+#ifndef GL_NV_depth_clamp
+#define GL_NV_depth_clamp 1
+#endif
+
+#ifndef GL_NV_occlusion_query
+#define GL_NV_occlusion_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint);
+GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint);
+GLAPI void APIENTRY glEndOcclusionQueryNV (void);
+GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void);
+typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_NV_point_sprite
+#define GL_NV_point_sprite 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint);
+GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_NV_texture_shader3
+#define GL_NV_texture_shader3 1
+#endif
+
+#ifndef GL_NV_vertex_program1_1
+#define GL_NV_vertex_program1_1 1
+#endif
+
+#ifndef GL_EXT_shadow_funcs
+#define GL_EXT_shadow_funcs 1
+#endif
+
+#ifndef GL_EXT_stencil_two_side
+#define GL_EXT_stencil_two_side 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
+#endif
+
+#ifndef GL_ATI_text_fragment_shader
+#define GL_ATI_text_fragment_shader 1
+#endif
+
+#ifndef GL_APPLE_client_storage
+#define GL_APPLE_client_storage 1
+#endif
+
+#ifndef GL_APPLE_element_array
+#define GL_APPLE_element_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *);
+GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei);
+GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei);
+GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei);
+GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
+#endif
+
+#ifndef GL_APPLE_fence
+#define GL_APPLE_fence 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *);
+GLAPI void APIENTRY glSetFenceAPPLE (GLuint);
+GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint);
+GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint);
+GLAPI void APIENTRY glFinishFenceAPPLE (GLuint);
+GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint);
+GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences);
+typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences);
+typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name);
+typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name);
+#endif
+
+#ifndef GL_APPLE_vertex_array_object
+#define GL_APPLE_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint);
+GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
+typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
+typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
+typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
+#endif
+
+#ifndef GL_APPLE_vertex_array_range
+#define GL_APPLE_vertex_array_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *);
+GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *);
+GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param);
+#endif
+
+#ifndef GL_APPLE_ycbcr_422
+#define GL_APPLE_ycbcr_422 1
+#endif
+
+#ifndef GL_S3_s3tc
+#define GL_S3_s3tc 1
+#endif
+
+#ifndef GL_ATI_draw_buffers
+#define GL_ATI_draw_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs);
+#endif
+
+#ifndef GL_ATI_pixel_format_float
+#define GL_ATI_pixel_format_float 1
+/* This is really a WGL extension, but defines some associated GL enums.
+ * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string.
+ */
+#endif
+
+#ifndef GL_ATI_texture_env_combine3
+#define GL_ATI_texture_env_combine3 1
+#endif
+
+#ifndef GL_ATI_texture_float
+#define GL_ATI_texture_float 1
+#endif
+
+#ifndef GL_NV_float_buffer
+#define GL_NV_float_buffer 1
+#endif
+
+#ifndef GL_NV_fragment_program
+#define GL_NV_fragment_program 1
+/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *);
+GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *);
+GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
+typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
+#endif
+
+#ifndef GL_NV_half_float
+#define GL_NV_half_float 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV);
+GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glFogCoordhNV (GLhalfNV);
+GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *);
+GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV);
+GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y);
+typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z);
+typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
+typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
+typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s);
+typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t);
+typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r);
+typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog);
+typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+#endif
+
+#ifndef GL_NV_pixel_data_range
+#define GL_NV_pixel_data_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *);
+GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target);
+#endif
+
+#ifndef GL_NV_primitive_restart
+#define GL_NV_primitive_restart 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPrimitiveRestartNV (void);
+GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void);
+typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);
+#endif
+
+#ifndef GL_NV_texture_expand_normal
+#define GL_NV_texture_expand_normal 1
+#endif
+
+#ifndef GL_NV_vertex_program2
+#define GL_NV_vertex_program2 1
+#endif
+
+#ifndef GL_ATI_map_object_buffer
+#define GL_ATI_map_object_buffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint);
+GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);
+#endif
+
+#ifndef GL_ATI_separate_stencil
+#define GL_ATI_separate_stencil 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+#endif
+
+#ifndef GL_ATI_vertex_attrib_array_object
+#define GL_ATI_vertex_attrib_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint);
+GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_OES_read_format
+#define GL_OES_read_format 1
+#endif
+
+#ifndef GL_EXT_depth_bounds_test
+#define GL_EXT_depth_bounds_test 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax);
+#endif
+
+#ifndef GL_EXT_texture_mirror_clamp
+#define GL_EXT_texture_mirror_clamp 1
+#endif
+
+#ifndef GL_EXT_blend_equation_separate
+#define GL_EXT_blend_equation_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha);
+#endif
+
+#ifndef GL_MESA_pack_invert
+#define GL_MESA_pack_invert 1
+#endif
+
+#ifndef GL_MESA_ycbcr_texture
+#define GL_MESA_ycbcr_texture 1
+#endif
+
+#ifndef GL_EXT_pixel_buffer_object
+#define GL_EXT_pixel_buffer_object 1
+#endif
+
+#ifndef GL_NV_fragment_program_option
+#define GL_NV_fragment_program_option 1
+#endif
+
+#ifndef GL_NV_fragment_program2
+#define GL_NV_fragment_program2 1
+#endif
+
+#ifndef GL_NV_vertex_program2_option
+#define GL_NV_vertex_program2_option 1
+#endif
+
+#ifndef GL_NV_vertex_program3
+#define GL_NV_vertex_program3 1
+#endif
+
+#ifndef GL_EXT_framebuffer_object
+#define GL_EXT_framebuffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint);
+GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *);
+GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei);
+GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint);
+GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *);
+GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum);
+GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
+GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
+GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint);
+GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint);
+GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGenerateMipmapEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
+typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
+typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
+typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
+typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
+#endif
+
+#ifndef GL_GREMEDY_string_marker
+#define GL_GREMEDY_string_marker 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string);
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+#endif /* NO_SDL_GLEXT */
+/*@}*/
diff --git a/distrib/sdl-1.2.15/include/SDL_platform.h b/distrib/sdl-1.2.15/include/SDL_platform.h
new file mode 100644
index 0000000..48540a8
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_platform.h
@@ -0,0 +1,110 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/** @file SDL_platform.h
+ * Try to get a standard set of platform defines
+ */
+
+#ifndef _SDL_platform_h
+#define _SDL_platform_h
+
+#if defined(_AIX)
+#undef __AIX__
+#define __AIX__ 1
+#endif
+#if defined(__BEOS__)
+#undef __BEOS__
+#define __BEOS__ 1
+#endif
+#if defined(__HAIKU__)
+#undef __HAIKU__
+#define __HAIKU__ 1
+#endif
+#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
+#undef __BSDI__
+#define __BSDI__ 1
+#endif
+#if defined(_arch_dreamcast)
+#undef __DREAMCAST__
+#define __DREAMCAST__ 1
+#endif
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
+#undef __FREEBSD__
+#define __FREEBSD__ 1
+#endif
+#if defined(__HAIKU__)
+#undef __HAIKU__
+#define __HAIKU__ 1
+#endif
+#if defined(hpux) || defined(__hpux) || defined(__hpux__)
+#undef __HPUX__
+#define __HPUX__ 1
+#endif
+#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
+#undef __IRIX__
+#define __IRIX__ 1
+#endif
+#if defined(linux) || defined(__linux) || defined(__linux__)
+#undef __LINUX__
+#define __LINUX__ 1
+#endif
+#if defined(__APPLE__)
+#undef __MACOSX__
+#define __MACOSX__ 1
+#elif defined(macintosh)
+#undef __MACOS__
+#define __MACOS__ 1
+#endif
+#if defined(__NetBSD__)
+#undef __NETBSD__
+#define __NETBSD__ 1
+#endif
+#if defined(__OpenBSD__)
+#undef __OPENBSD__
+#define __OPENBSD__ 1
+#endif
+#if defined(__OS2__)
+#undef __OS2__
+#define __OS2__ 1
+#endif
+#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
+#undef __OSF__
+#define __OSF__ 1
+#endif
+#if defined(__QNXNTO__)
+#undef __QNXNTO__
+#define __QNXNTO__ 1
+#endif
+#if defined(riscos) || defined(__riscos) || defined(__riscos__)
+#undef __RISCOS__
+#define __RISCOS__ 1
+#endif
+#if defined(__SVR4)
+#undef __SOLARIS__
+#define __SOLARIS__ 1
+#endif
+#if defined(WIN32) || defined(_WIN32)
+#undef __WIN32__
+#define __WIN32__ 1
+#endif
+
+#endif /* _SDL_platform_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_quit.h b/distrib/sdl-1.2.15/include/SDL_quit.h
new file mode 100644
index 0000000..abd2ec6
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_quit.h
@@ -0,0 +1,55 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/** @file SDL_quit.h
+ * Include file for SDL quit event handling
+ */
+
+#ifndef _SDL_quit_h
+#define _SDL_quit_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+/** @file SDL_quit.h
+ * An SDL_QUITEVENT is generated when the user tries to close the application
+ * 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
+ * complete, but have no effect.
+ *
+ * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
+ * and SIGTERM (system termination request), if handlers do not already
+ * exist, that generate SDL_QUITEVENT events as well. There is no way
+ * to determine the cause of an SDL_QUITEVENT, but setting a signal
+ * handler in your application will override the default generation of
+ * quit events for that signal.
+ */
+
+/** @file SDL_quit.h
+ * There are no functions directly affecting the quit event
+ */
+
+#define SDL_QuitRequested() \
+ (SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK))
+
+#endif /* _SDL_quit_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_rwops.h b/distrib/sdl-1.2.15/include/SDL_rwops.h
new file mode 100644
index 0000000..98361d7
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_rwops.h
@@ -0,0 +1,155 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/** @file SDL_rwops.h
+ * This file provides a general interface for SDL to read and write
+ * data sources. It can easily be extended to files, memory, etc.
+ */
+
+#ifndef _SDL_rwops_h
+#define _SDL_rwops_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** This is the read/write operation structure -- very basic */
+
+typedef struct SDL_RWops {
+ /** Seek to 'offset' relative to whence, one of stdio's whence values:
+ * SEEK_SET, SEEK_CUR, SEEK_END
+ * Returns the final offset in the data source.
+ */
+ int (SDLCALL *seek)(struct SDL_RWops *context, int offset, int whence);
+
+ /** Read up to 'maxnum' objects each of size 'size' from the data
+ * source to the area pointed at by 'ptr'.
+ * Returns the number of objects read, or -1 if the read failed.
+ */
+ int (SDLCALL *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum);
+
+ /** Write exactly 'num' objects each of size 'objsize' from the area
+ * pointed at by 'ptr' to data source.
+ * Returns 'num', or -1 if the write failed.
+ */
+ int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int size, int num);
+
+ /** Close and free an allocated SDL_FSops structure */
+ int (SDLCALL *close)(struct SDL_RWops *context);
+
+ Uint32 type;
+ union {
+#if defined(__WIN32__) && !defined(__SYMBIAN32__)
+ struct {
+ int append;
+ void *h;
+ struct {
+ void *data;
+ int size;
+ int left;
+ } buffer;
+ } win32io;
+#endif
+#ifdef HAVE_STDIO_H
+ struct {
+ int autoclose;
+ FILE *fp;
+ } stdio;
+#endif
+ struct {
+ Uint8 *base;
+ Uint8 *here;
+ Uint8 *stop;
+ } mem;
+ struct {
+ void *data1;
+ } unknown;
+ } hidden;
+
+} SDL_RWops;
+
+
+/** @name Functions to create SDL_RWops structures from various data sources */
+/*@{*/
+
+extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFile(const char *file, const char *mode);
+
+#ifdef HAVE_STDIO_H
+extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFP(FILE *fp, int autoclose);
+#endif
+
+extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromMem(void *mem, int size);
+extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromConstMem(const void *mem, int size);
+
+extern DECLSPEC SDL_RWops * SDLCALL SDL_AllocRW(void);
+extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops *area);
+
+/*@}*/
+
+/** @name Seek Reference Points */
+/*@{*/
+#define RW_SEEK_SET 0 /**< Seek from the beginning of data */
+#define RW_SEEK_CUR 1 /**< Seek relative to current read point */
+#define RW_SEEK_END 2 /**< Seek relative to the end of data */
+/*@}*/
+
+/** @name Macros to easily read and write from an SDL_RWops structure */
+/*@{*/
+#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence)
+#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR)
+#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n)
+#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n)
+#define SDL_RWclose(ctx) (ctx)->close(ctx)
+/*@}*/
+
+/** @name Read an item of the specified endianness and return in native format */
+/*@{*/
+extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops *src);
+extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops *src);
+extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops *src);
+extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops *src);
+extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops *src);
+extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops *src);
+/*@}*/
+
+/** @name Write an item of native format to the specified endianness */
+/*@{*/
+extern DECLSPEC int SDLCALL SDL_WriteLE16(SDL_RWops *dst, Uint16 value);
+extern DECLSPEC int SDLCALL SDL_WriteBE16(SDL_RWops *dst, Uint16 value);
+extern DECLSPEC int SDLCALL SDL_WriteLE32(SDL_RWops *dst, Uint32 value);
+extern DECLSPEC int SDLCALL SDL_WriteBE32(SDL_RWops *dst, Uint32 value);
+extern DECLSPEC int SDLCALL SDL_WriteLE64(SDL_RWops *dst, Uint64 value);
+extern DECLSPEC int SDLCALL SDL_WriteBE64(SDL_RWops *dst, Uint64 value);
+/*@}*/
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_rwops_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_stdinc.h b/distrib/sdl-1.2.15/include/SDL_stdinc.h
new file mode 100644
index 0000000..35a4fdd
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_stdinc.h
@@ -0,0 +1,620 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/** @file SDL_stdinc.h
+ * This is a general header that includes C language support
+ */
+
+#ifndef _SDL_stdinc_h
+#define _SDL_stdinc_h
+
+#include "SDL_config.h"
+
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_STDIO_H
+#include <stdio.h>
+#endif
+#if defined(STDC_HEADERS)
+# include <stdlib.h>
+# include <stddef.h>
+# include <stdarg.h>
+#else
+# if defined(HAVE_STDLIB_H)
+# include <stdlib.h>
+# elif defined(HAVE_MALLOC_H)
+# include <malloc.h>
+# endif
+# if defined(HAVE_STDDEF_H)
+# include <stddef.h>
+# endif
+# if defined(HAVE_STDARG_H)
+# include <stdarg.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if defined(HAVE_INTTYPES_H)
+# include <inttypes.h>
+#elif defined(HAVE_STDINT_H)
+# include <stdint.h>
+#endif
+#ifdef HAVE_CTYPE_H
+# include <ctype.h>
+#endif
+#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H)
+# include <iconv.h>
+#endif
+
+/** The number of elements in an array */
+#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
+#define SDL_TABLESIZE(table) SDL_arraysize(table)
+
+/* Use proper C++ casts when compiled as C++ to be compatible with the option
+ -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above. */
+#ifdef __cplusplus
+#define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression)
+#define SDL_static_cast(type, expression) static_cast<type>(expression)
+#else
+#define SDL_reinterpret_cast(type, expression) ((type)(expression))
+#define SDL_static_cast(type, expression) ((type)(expression))
+#endif
+
+/** @name Basic data types */
+/*@{*/
+typedef enum {
+ SDL_FALSE = 0,
+ SDL_TRUE = 1
+} SDL_bool;
+
+typedef int8_t Sint8;
+typedef uint8_t Uint8;
+typedef int16_t Sint16;
+typedef uint16_t Uint16;
+typedef int32_t Sint32;
+typedef uint32_t Uint32;
+
+#ifdef SDL_HAS_64BIT_TYPE
+typedef int64_t Sint64;
+#ifndef SYMBIAN32_GCCE
+typedef uint64_t Uint64;
+#endif
+#else
+/* This is really just a hack to prevent the compiler from complaining */
+typedef struct {
+ Uint32 hi;
+ Uint32 lo;
+} Uint64, Sint64;
+#endif
+
+/*@}*/
+
+/** @name Make sure the types really have the right sizes */
+/*@{*/
+#define SDL_COMPILE_TIME_ASSERT(name, x) \
+ typedef int SDL_dummy_ ## name[(x) * 2 - 1]
+
+SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);
+SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1);
+SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2);
+SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2);
+SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4);
+SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4);
+SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
+SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
+/*@}*/
+
+/** @name Enum Size Check
+ * Check to make sure enums are the size of ints, for structure packing.
+ * For both Watcom C/C++ and Borland C/C++ the compiler option that makes
+ * enums having the size of an int must be enabled.
+ * This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11).
+ */
+/* Enable enums always int in CodeWarrior (for MPW use "-enum int") */
+#ifdef __MWERKS__
+#pragma enumsalwaysint on
+#endif
+
+typedef enum {
+ DUMMY_ENUM_VALUE
+} SDL_DUMMY_ENUM;
+
+#ifndef __NDS__
+SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
+#endif
+/*@}*/
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef HAVE_MALLOC
+#define SDL_malloc malloc
+#else
+extern DECLSPEC void * SDLCALL SDL_malloc(size_t size);
+#endif
+
+#ifdef HAVE_CALLOC
+#define SDL_calloc calloc
+#else
+extern DECLSPEC void * SDLCALL SDL_calloc(size_t nmemb, size_t size);
+#endif
+
+#ifdef HAVE_REALLOC
+#define SDL_realloc realloc
+#else
+extern DECLSPEC void * SDLCALL SDL_realloc(void *mem, size_t size);
+#endif
+
+#ifdef HAVE_FREE
+#define SDL_free free
+#else
+extern DECLSPEC void SDLCALL SDL_free(void *mem);
+#endif
+
+#if defined(HAVE_ALLOCA) && !defined(alloca)
+# if defined(HAVE_ALLOCA_H)
+# include <alloca.h>
+# elif defined(__GNUC__)
+# define alloca __builtin_alloca
+# elif defined(_MSC_VER)
+# include <malloc.h>
+# define alloca _alloca
+# elif defined(__WATCOMC__)
+# include <malloc.h>
+# elif defined(__BORLANDC__)
+# include <malloc.h>
+# elif defined(__DMC__)
+# include <stdlib.h>
+# elif defined(__AIX__)
+ #pragma alloca
+# elif defined(__MRC__)
+ void *alloca (unsigned);
+# else
+ char *alloca ();
+# endif
+#endif
+#ifdef HAVE_ALLOCA
+#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count))
+#define SDL_stack_free(data)
+#else
+#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count))
+#define SDL_stack_free(data) SDL_free(data)
+#endif
+
+#ifdef HAVE_GETENV
+#define SDL_getenv getenv
+#else
+extern DECLSPEC char * SDLCALL SDL_getenv(const char *name);
+#endif
+
+#ifdef HAVE_PUTENV
+#define SDL_putenv putenv
+#else
+extern DECLSPEC int SDLCALL SDL_putenv(const char *variable);
+#endif
+
+#ifdef HAVE_QSORT
+#define SDL_qsort qsort
+#else
+extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size,
+ int (*compare)(const void *, const void *));
+#endif
+
+#ifdef HAVE_ABS
+#define SDL_abs abs
+#else
+#define SDL_abs(X) ((X) < 0 ? -(X) : (X))
+#endif
+
+#define SDL_min(x, y) (((x) < (y)) ? (x) : (y))
+#define SDL_max(x, y) (((x) > (y)) ? (x) : (y))
+
+#ifdef HAVE_CTYPE_H
+#define SDL_isdigit(X) isdigit(X)
+#define SDL_isspace(X) isspace(X)
+#define SDL_toupper(X) toupper(X)
+#define SDL_tolower(X) tolower(X)
+#else
+#define SDL_isdigit(X) (((X) >= '0') && ((X) <= '9'))
+#define SDL_isspace(X) (((X) == ' ') || ((X) == '\t') || ((X) == '\r') || ((X) == '\n'))
+#define SDL_toupper(X) (((X) >= 'a') && ((X) <= 'z') ? ('A'+((X)-'a')) : (X))
+#define SDL_tolower(X) (((X) >= 'A') && ((X) <= 'Z') ? ('a'+((X)-'A')) : (X))
+#endif
+
+#ifdef HAVE_MEMSET
+#define SDL_memset memset
+#else
+extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len);
+#endif
+
+#if defined(__GNUC__) && defined(i386)
+#define SDL_memset4(dst, val, len) \
+do { \
+ int u0, u1, u2; \
+ __asm__ __volatile__ ( \
+ "cld\n\t" \
+ "rep ; stosl\n\t" \
+ : "=&D" (u0), "=&a" (u1), "=&c" (u2) \
+ : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, len)) \
+ : "memory" ); \
+} while(0)
+#endif
+#ifndef SDL_memset4
+#define SDL_memset4(dst, val, len) \
+do { \
+ unsigned _count = (len); \
+ unsigned _n = (_count + 3) / 4; \
+ Uint32 *_p = SDL_static_cast(Uint32 *, dst); \
+ Uint32 _val = (val); \
+ if (len == 0) break; \
+ switch (_count % 4) { \
+ case 0: do { *_p++ = _val; \
+ case 3: *_p++ = _val; \
+ case 2: *_p++ = _val; \
+ case 1: *_p++ = _val; \
+ } while ( --_n ); \
+ } \
+} while(0)
+#endif
+
+/* We can count on memcpy existing on Mac OS X and being well-tuned. */
+#if defined(__MACH__) && defined(__APPLE__)
+#define SDL_memcpy(dst, src, len) memcpy(dst, src, len)
+#elif defined(__GNUC__) && defined(i386)
+#define SDL_memcpy(dst, src, len) \
+do { \
+ int u0, u1, u2; \
+ __asm__ __volatile__ ( \
+ "cld\n\t" \
+ "rep ; movsl\n\t" \
+ "testb $2,%b4\n\t" \
+ "je 1f\n\t" \
+ "movsw\n" \
+ "1:\ttestb $1,%b4\n\t" \
+ "je 2f\n\t" \
+ "movsb\n" \
+ "2:" \
+ : "=&c" (u0), "=&D" (u1), "=&S" (u2) \
+ : "0" (SDL_static_cast(unsigned, len)/4), "q" (len), "1" (dst),"2" (src) \
+ : "memory" ); \
+} while(0)
+#endif
+#ifndef SDL_memcpy
+#ifdef HAVE_MEMCPY
+#define SDL_memcpy memcpy
+#elif defined(HAVE_BCOPY)
+#define SDL_memcpy(d, s, n) bcopy((s), (d), (n))
+#else
+extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len);
+#endif
+#endif
+
+/* We can count on memcpy existing on Mac OS X and being well-tuned. */
+#if defined(__MACH__) && defined(__APPLE__)
+#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4)
+#elif defined(__GNUC__) && defined(i386)
+#define SDL_memcpy4(dst, src, len) \
+do { \
+ int ecx, edi, esi; \
+ __asm__ __volatile__ ( \
+ "cld\n\t" \
+ "rep ; movsl" \
+ : "=&c" (ecx), "=&D" (edi), "=&S" (esi) \
+ : "0" (SDL_static_cast(unsigned, len)), "1" (dst), "2" (src) \
+ : "memory" ); \
+} while(0)
+#endif
+#ifndef SDL_memcpy4
+#define SDL_memcpy4(dst, src, len) SDL_memcpy(dst, src, (len) << 2)
+#endif
+
+#if defined(__GNUC__) && defined(i386)
+#define SDL_revcpy(dst, src, len) \
+do { \
+ int u0, u1, u2; \
+ char *dstp = SDL_static_cast(char *, dst); \
+ char *srcp = SDL_static_cast(char *, src); \
+ int n = (len); \
+ if ( n >= 4 ) { \
+ __asm__ __volatile__ ( \
+ "std\n\t" \
+ "rep ; movsl\n\t" \
+ "cld\n\t" \
+ : "=&c" (u0), "=&D" (u1), "=&S" (u2) \
+ : "0" (n >> 2), \
+ "1" (dstp+(n-4)), "2" (srcp+(n-4)) \
+ : "memory" ); \
+ } \
+ switch (n & 3) { \
+ case 3: dstp[2] = srcp[2]; \
+ case 2: dstp[1] = srcp[1]; \
+ case 1: dstp[0] = srcp[0]; \
+ break; \
+ default: \
+ break; \
+ } \
+} while(0)
+#endif
+#ifndef SDL_revcpy
+extern DECLSPEC void * SDLCALL SDL_revcpy(void *dst, const void *src, size_t len);
+#endif
+
+#ifdef HAVE_MEMMOVE
+#define SDL_memmove memmove
+#elif defined(HAVE_BCOPY)
+#define SDL_memmove(d, s, n) bcopy((s), (d), (n))
+#else
+#define SDL_memmove(dst, src, len) \
+do { \
+ if ( dst < src ) { \
+ SDL_memcpy(dst, src, len); \
+ } else { \
+ SDL_revcpy(dst, src, len); \
+ } \
+} while(0)
+#endif
+
+#ifdef HAVE_MEMCMP
+#define SDL_memcmp memcmp
+#else
+extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len);
+#endif
+
+#ifdef HAVE_STRLEN
+#define SDL_strlen strlen
+#else
+extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string);
+#endif
+
+#ifdef HAVE_STRLCPY
+#define SDL_strlcpy strlcpy
+#else
+extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen);
+#endif
+
+#ifdef HAVE_STRLCAT
+#define SDL_strlcat strlcat
+#else
+extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, size_t maxlen);
+#endif
+
+#ifdef HAVE_STRDUP
+#define SDL_strdup strdup
+#else
+extern DECLSPEC char * SDLCALL SDL_strdup(const char *string);
+#endif
+
+#ifdef HAVE__STRREV
+#define SDL_strrev _strrev
+#else
+extern DECLSPEC char * SDLCALL SDL_strrev(char *string);
+#endif
+
+#ifdef HAVE__STRUPR
+#define SDL_strupr _strupr
+#else
+extern DECLSPEC char * SDLCALL SDL_strupr(char *string);
+#endif
+
+#ifdef HAVE__STRLWR
+#define SDL_strlwr _strlwr
+#else
+extern DECLSPEC char * SDLCALL SDL_strlwr(char *string);
+#endif
+
+#ifdef HAVE_STRCHR
+#define SDL_strchr strchr
+#elif defined(HAVE_INDEX)
+#define SDL_strchr index
+#else
+extern DECLSPEC char * SDLCALL SDL_strchr(const char *string, int c);
+#endif
+
+#ifdef HAVE_STRRCHR
+#define SDL_strrchr strrchr
+#elif defined(HAVE_RINDEX)
+#define SDL_strrchr rindex
+#else
+extern DECLSPEC char * SDLCALL SDL_strrchr(const char *string, int c);
+#endif
+
+#ifdef HAVE_STRSTR
+#define SDL_strstr strstr
+#else
+extern DECLSPEC char * SDLCALL SDL_strstr(const char *haystack, const char *needle);
+#endif
+
+#ifdef HAVE_ITOA
+#define SDL_itoa itoa
+#else
+#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix)
+#endif
+
+#ifdef HAVE__LTOA
+#define SDL_ltoa _ltoa
+#else
+extern DECLSPEC char * SDLCALL SDL_ltoa(long value, char *string, int radix);
+#endif
+
+#ifdef HAVE__UITOA
+#define SDL_uitoa _uitoa
+#else
+#define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix)
+#endif
+
+#ifdef HAVE__ULTOA
+#define SDL_ultoa _ultoa
+#else
+extern DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *string, int radix);
+#endif
+
+#ifdef HAVE_STRTOL
+#define SDL_strtol strtol
+#else
+extern DECLSPEC long SDLCALL SDL_strtol(const char *string, char **endp, int base);
+#endif
+
+#ifdef HAVE_STRTOUL
+#define SDL_strtoul strtoul
+#else
+extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string, char **endp, int base);
+#endif
+
+#ifdef SDL_HAS_64BIT_TYPE
+
+#ifdef HAVE__I64TOA
+#define SDL_lltoa _i64toa
+#else
+extern DECLSPEC char* SDLCALL SDL_lltoa(Sint64 value, char *string, int radix);
+#endif
+
+#ifdef HAVE__UI64TOA
+#define SDL_ulltoa _ui64toa
+#else
+extern DECLSPEC char* SDLCALL SDL_ulltoa(Uint64 value, char *string, int radix);
+#endif
+
+#ifdef HAVE_STRTOLL
+#define SDL_strtoll strtoll
+#else
+extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *string, char **endp, int base);
+#endif
+
+#ifdef HAVE_STRTOULL
+#define SDL_strtoull strtoull
+#else
+extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp, int base);
+#endif
+
+#endif /* SDL_HAS_64BIT_TYPE */
+
+#ifdef HAVE_STRTOD
+#define SDL_strtod strtod
+#else
+extern DECLSPEC double SDLCALL SDL_strtod(const char *string, char **endp);
+#endif
+
+#ifdef HAVE_ATOI
+#define SDL_atoi atoi
+#else
+#define SDL_atoi(X) SDL_strtol(X, NULL, 0)
+#endif
+
+#ifdef HAVE_ATOF
+#define SDL_atof atof
+#else
+#define SDL_atof(X) SDL_strtod(X, NULL)
+#endif
+
+#ifdef HAVE_STRCMP
+#define SDL_strcmp strcmp
+#else
+extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2);
+#endif
+
+#ifdef HAVE_STRNCMP
+#define SDL_strncmp strncmp
+#else
+extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen);
+#endif
+
+#ifdef HAVE_STRCASECMP
+#define SDL_strcasecmp strcasecmp
+#elif defined(HAVE__STRICMP)
+#define SDL_strcasecmp _stricmp
+#else
+extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2);
+#endif
+
+#ifdef HAVE_STRNCASECMP
+#define SDL_strncasecmp strncasecmp
+#elif defined(HAVE__STRNICMP)
+#define SDL_strncasecmp _strnicmp
+#else
+extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen);
+#endif
+
+#ifdef HAVE_SSCANF
+#define SDL_sscanf sscanf
+#else
+extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...);
+#endif
+
+#ifdef HAVE_SNPRINTF
+#define SDL_snprintf snprintf
+#else
+extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...);
+#endif
+
+#ifdef HAVE_VSNPRINTF
+#define SDL_vsnprintf vsnprintf
+#else
+extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap);
+#endif
+
+/** @name SDL_ICONV Error Codes
+ * The SDL implementation of iconv() returns these error codes
+ */
+/*@{*/
+#define SDL_ICONV_ERROR (size_t)-1
+#define SDL_ICONV_E2BIG (size_t)-2
+#define SDL_ICONV_EILSEQ (size_t)-3
+#define SDL_ICONV_EINVAL (size_t)-4
+/*@}*/
+
+#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H)
+#define SDL_iconv_t iconv_t
+#define SDL_iconv_open iconv_open
+#define SDL_iconv_close iconv_close
+#else
+typedef struct _SDL_iconv_t *SDL_iconv_t;
+extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, const char *fromcode);
+extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd);
+#endif
+extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
+/** This function converts a string between encodings in one pass, returning a
+ * string that must be freed with SDL_free() or NULL on error.
+ */
+extern DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft);
+#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
+#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1)
+#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1)
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_stdinc_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_syswm.h b/distrib/sdl-1.2.15/include/SDL_syswm.h
new file mode 100644
index 0000000..771d6b1
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_syswm.h
@@ -0,0 +1,238 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/** @file SDL_syswm.h
+ * Include file for SDL custom system window manager hooks
+ */
+
+#ifndef _SDL_syswm_h
+#define _SDL_syswm_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+#include "SDL_version.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#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
+ * you can enable it with SDL_EventState()
+ */
+#ifdef SDL_PROTOTYPES_ONLY
+struct SDL_SysWMinfo;
+typedef struct SDL_SysWMinfo SDL_SysWMinfo;
+#else
+
+/* This is the structure for custom window manager events */
+#if defined(SDL_VIDEO_DRIVER_X11)
+#if defined(__APPLE__) && defined(__MACH__)
+/* conflicts with Quickdraw.h */
+#define Cursor X11Cursor
+#endif
+
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+
+#if defined(__APPLE__) && defined(__MACH__)
+/* matches the re-define above */
+#undef Cursor
+#endif
+
+/** These are the various supported subsystems under UNIX */
+typedef enum {
+ SDL_SYSWM_X11
+} SDL_SYSWM_TYPE;
+
+/** The UNIX custom event structure */
+struct SDL_SysWMmsg {
+ SDL_version version;
+ SDL_SYSWM_TYPE subsystem;
+ union {
+ XEvent xevent;
+ } event;
+};
+
+/** The UNIX custom window manager information structure.
+ * When this structure is returned, it holds information about which
+ * low level system it is using, and will be one of SDL_SYSWM_TYPE.
+ */
+typedef struct SDL_SysWMinfo {
+ SDL_version version;
+ SDL_SYSWM_TYPE subsystem;
+ union {
+ struct {
+ Display *display; /**< The X11 display */
+ Window window; /**< The X11 display window */
+ /** These locking functions should be called around
+ * any X11 functions using the display variable,
+ * but not the gfxdisplay variable.
+ * They lock the event thread, so should not be
+ * called around event functions or from event filters.
+ */
+ /*@{*/
+ void (*lock_func)(void);
+ void (*unlock_func)(void);
+ /*@}*/
+
+ /** @name Introduced in SDL 1.0.2 */
+ /*@{*/
+ Window fswindow; /**< The X11 fullscreen window */
+ Window wmwindow; /**< The X11 managed input window */
+ /*@}*/
+
+ /** @name Introduced in SDL 1.2.12 */
+ /*@{*/
+ Display *gfxdisplay; /**< The X11 display to which rendering is done */
+ /*@}*/
+ } x11;
+ } info;
+} SDL_SysWMinfo;
+
+#elif defined(SDL_VIDEO_DRIVER_NANOX)
+#include <microwin/nano-X.h>
+
+/** The generic custom event structure */
+struct SDL_SysWMmsg {
+ SDL_version version;
+ int data;
+};
+
+/** The windows custom window manager information structure */
+typedef struct SDL_SysWMinfo {
+ SDL_version version ;
+ GR_WINDOW_ID window ; /* The display window */
+} SDL_SysWMinfo;
+
+#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI)
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+/** The windows custom event structure */
+struct SDL_SysWMmsg {
+ SDL_version version;
+ HWND hwnd; /**< The window for the message */
+ UINT msg; /**< The type of message */
+ WPARAM wParam; /**< WORD message parameter */
+ LPARAM lParam; /**< LONG message parameter */
+};
+
+/** The windows custom window manager information structure */
+typedef struct SDL_SysWMinfo {
+ SDL_version version;
+ HWND window; /**< The Win32 display window */
+ HGLRC hglrc; /**< The OpenGL context, if any */
+} SDL_SysWMinfo;
+
+#elif defined(SDL_VIDEO_DRIVER_RISCOS)
+
+/** RISC OS custom event structure */
+struct SDL_SysWMmsg {
+ SDL_version version;
+ int eventCode; /**< The window for the message */
+ int pollBlock[64];
+};
+
+/** The RISC OS custom window manager information structure */
+typedef struct SDL_SysWMinfo {
+ SDL_version version;
+ int wimpVersion; /**< Wimp version running under */
+ int taskHandle; /**< The RISC OS task handle */
+ int window; /**< The RISC OS display window */
+} SDL_SysWMinfo;
+
+#elif defined(SDL_VIDEO_DRIVER_PHOTON)
+#include <sys/neutrino.h>
+#include <Ph.h>
+
+/** The QNX custom event structure */
+struct SDL_SysWMmsg {
+ SDL_version version;
+ int data;
+};
+
+/** The QNX custom window manager information structure */
+typedef struct SDL_SysWMinfo {
+ SDL_version version;
+ int data;
+} SDL_SysWMinfo;
+
+#elif defined(SDL_VIDEO_DRIVER_QUARTZ)
+
+struct SDL_SysWMmsg {
+ SDL_version version;
+ int data;
+};
+
+typedef struct SDL_SysWMinfo {
+ SDL_version version;
+ void* nsWindowPtr;
+} SDL_SysWMinfo;
+
+#else
+
+/** The generic custom event structure */
+struct SDL_SysWMmsg {
+ SDL_version version;
+ int data;
+};
+
+/** The generic custom window manager information structure */
+typedef struct SDL_SysWMinfo {
+ SDL_version version;
+ int data;
+} SDL_SysWMinfo;
+
+#endif /* video driver type */
+
+#endif /* SDL_PROTOTYPES_ONLY */
+
+/* Function prototypes */
+/**
+ * This function gives you custom hooks into the window manager information.
+ * It fills the structure pointed to by 'info' with custom information and
+ * returns 0 if the function is not implemented, 1 if the function is
+ * implemented and no error occurred, and -1 if the version member of
+ * the 'info' structure is not filled in or not supported.
+ *
+ * You typically use this function like this:
+ * @code
+ * SDL_SysWMinfo info;
+ * SDL_VERSION(&info.version);
+ * if ( SDL_GetWMInfo(&info) ) { ... }
+ * @endcode
+ */
+extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_syswm_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_thread.h b/distrib/sdl-1.2.15/include/SDL_thread.h
new file mode 100644
index 0000000..9ebe00e
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_thread.h
@@ -0,0 +1,115 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#ifndef _SDL_thread_h
+#define _SDL_thread_h
+
+/** @file SDL_thread.h
+ * Header for the SDL thread management routines
+ *
+ * @note These are independent of the other SDL routines.
+ */
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+/* Thread synchronization primitives */
+#include "SDL_mutex.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** The SDL thread structure, defined in SDL_thread.c */
+struct SDL_Thread;
+typedef struct SDL_Thread SDL_Thread;
+
+/** Create a thread */
+#if ((defined(__WIN32__) && !defined(HAVE_LIBC)) || defined(__OS2__)) && !defined(__SYMBIAN32__)
+/**
+ * We compile SDL into a DLL on OS/2. This means, that it's the DLL which
+ * creates a new thread for the calling process with the SDL_CreateThread()
+ * API. There is a problem with this, that only the RTL of the SDL.DLL will
+ * be initialized for those threads, and not the RTL of the calling application!
+ * To solve this, we make a little hack here.
+ * We'll always use the caller's _beginthread() and _endthread() APIs to
+ * start a new thread. This way, if it's the SDL.DLL which uses this API,
+ * then the RTL of SDL.DLL will be used to create the new thread, and if it's
+ * the application, then the RTL of the application will be used.
+ * So, in short:
+ * Always use the _beginthread() and _endthread() of the calling runtime library!
+ */
+#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
+#ifndef _WIN32_WCE
+#include <process.h> /* This has _beginthread() and _endthread() defined! */
+#endif
+
+#ifdef __OS2__
+typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg);
+typedef void (*pfnSDL_CurrentEndThread)(void);
+#else
+typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
+ unsigned (__stdcall *func)(void *), void *arg,
+ unsigned, unsigned *threadID);
+typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
+#endif
+
+extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread);
+
+#ifdef __OS2__
+#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthread, _endthread)
+#elif defined(_WIN32_WCE)
+#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, NULL, NULL)
+#else
+#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex)
+#endif
+#else
+extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data);
+#endif
+
+/** Get the 32-bit thread identifier for the current thread */
+extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void);
+
+/** Get the 32-bit thread identifier for the specified thread,
+ * equivalent to SDL_ThreadID() if the specified thread is NULL.
+ */
+extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread);
+
+/** Wait for a thread to finish.
+ * The return code for the thread function is placed in the area
+ * pointed to by 'status', if 'status' is not NULL.
+ */
+extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status);
+
+/** Forcefully kill a thread without worrying about its state */
+extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_thread_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_timer.h b/distrib/sdl-1.2.15/include/SDL_timer.h
new file mode 100644
index 0000000..d764d5f
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_timer.h
@@ -0,0 +1,125 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#ifndef _SDL_timer_h
+#define _SDL_timer_h
+
+/** @file SDL_timer.h
+ * Header for the SDL time management routines
+ */
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** This is the OS scheduler timeslice, in milliseconds */
+#define SDL_TIMESLICE 10
+
+/** This is the maximum resolution of the SDL timer on all platforms */
+#define TIMER_RESOLUTION 10 /**< Experimentally determined */
+
+/**
+ * Get the number of milliseconds since the SDL library initialization.
+ * Note that this value wraps if the program runs for more than ~49 days.
+ */
+extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
+
+/** Wait a specified number of milliseconds before returning */
+extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
+
+/** Function prototype for the timer callback function */
+typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval);
+
+/**
+ * Set a callback to run after the specified number of milliseconds has
+ * elapsed. The callback function is passed the current timer interval
+ * and returns the next timer interval. If the returned value is the
+ * same as the one passed in, the periodic alarm continues, otherwise a
+ * new alarm is scheduled. If the callback returns 0, the periodic alarm
+ * is cancelled.
+ *
+ * To cancel a currently running timer, call SDL_SetTimer(0, NULL);
+ *
+ * The timer callback function may run in a different thread than your
+ * main code, and so shouldn't call any functions from within itself.
+ *
+ * The maximum resolution of this timer is 10 ms, which means that if
+ * you request a 16 ms timer, your callback will run approximately 20 ms
+ * later on an unloaded system. If you wanted to set a flag signaling
+ * a frame update at 30 frames per second (every 33 ms), you might set a
+ * timer for 30 ms:
+ * @code SDL_SetTimer((33/10)*10, flag_update); @endcode
+ *
+ * If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init().
+ *
+ * Under UNIX, you should not use raise or use SIGALRM and this function
+ * in the same program, as it is implemented using setitimer(). You also
+ * should not use this function in multi-threaded applications as signals
+ * to multi-threaded apps have undefined behavior in some implementations.
+ *
+ * This function returns 0 if successful, or -1 if there was an error.
+ */
+extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback);
+
+/** @name New timer API
+ * New timer API, supports multiple timers
+ * Written by Stephane Peter <megastep@lokigames.com>
+ */
+/*@{*/
+
+/**
+ * Function prototype for the new timer callback function.
+ * The callback function is passed the current timer interval and returns
+ * the next timer interval. If the returned value is the same as the one
+ * passed in, the periodic alarm continues, otherwise a new alarm is
+ * scheduled. If the callback returns 0, the periodic alarm is cancelled.
+ */
+typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param);
+
+/** Definition of the timer ID type */
+typedef struct _SDL_TimerID *SDL_TimerID;
+
+/** Add a new timer to the pool of timers already running.
+ * Returns a timer ID, or NULL when an error occurs.
+ */
+extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param);
+
+/**
+ * Remove one of the multiple timers knowing its ID.
+ * Returns a boolean value indicating success.
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t);
+
+/*@}*/
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_timer_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_types.h b/distrib/sdl-1.2.15/include/SDL_types.h
new file mode 100644
index 0000000..79d8b28
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_types.h
@@ -0,0 +1,28 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/** @file SDL_types.h
+ * @deprecated Use SDL_stdinc.h instead.
+ */
+
+/* DEPRECATED */
+#include "SDL_stdinc.h"
diff --git a/distrib/sdl-1.2.15/include/SDL_version.h b/distrib/sdl-1.2.15/include/SDL_version.h
new file mode 100644
index 0000000..fdc17c6
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_version.h
@@ -0,0 +1,91 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/** @file SDL_version.h
+ * This header defines the current SDL version
+ */
+
+#ifndef _SDL_version_h
+#define _SDL_version_h
+
+#include "SDL_stdinc.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @name Version Number
+ * Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
+ */
+/*@{*/
+#define SDL_MAJOR_VERSION 1
+#define SDL_MINOR_VERSION 2
+#define SDL_PATCHLEVEL 15
+/*@}*/
+
+typedef struct SDL_version {
+ Uint8 major;
+ Uint8 minor;
+ Uint8 patch;
+} SDL_version;
+
+/**
+ * This macro can be used to fill a version structure with the compile-time
+ * version of the SDL library.
+ */
+#define SDL_VERSION(X) \
+{ \
+ (X)->major = SDL_MAJOR_VERSION; \
+ (X)->minor = SDL_MINOR_VERSION; \
+ (X)->patch = SDL_PATCHLEVEL; \
+}
+
+/** This macro turns the version numbers into a numeric value:
+ * (1,2,3) -> (1203)
+ * This assumes that there will never be more than 100 patchlevels
+ */
+#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)
+
+/** 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))
+
+/** This function gets the version of the dynamically linked SDL library.
+ * it should NOT be used to fill a version structure, instead you should
+ * use the SDL_Version() macro.
+ */
+extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void);
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_version_h */
diff --git a/distrib/sdl-1.2.15/include/SDL_video.h b/distrib/sdl-1.2.15/include/SDL_video.h
new file mode 100644
index 0000000..9a2df0c
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/SDL_video.h
@@ -0,0 +1,981 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/** @file SDL_video.h
+ * Header file for access to the SDL raw framebuffer window
+ */
+
+#ifndef _SDL_video_h
+#define _SDL_video_h
+
+#include "SDL_stdinc.h"
+#include "SDL_error.h"
+#include "SDL_rwops.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @name Transparency definitions
+ * These define alpha as the opacity of a surface
+ */
+/*@{*/
+#define SDL_ALPHA_OPAQUE 255
+#define SDL_ALPHA_TRANSPARENT 0
+/*@}*/
+
+/** @name Useful data types */
+/*@{*/
+typedef struct SDL_Rect {
+ Sint16 x, y;
+ Uint16 w, h;
+} SDL_Rect;
+
+typedef struct SDL_Color {
+ Uint8 r;
+ Uint8 g;
+ Uint8 b;
+ Uint8 unused;
+} SDL_Color;
+#define SDL_Colour SDL_Color
+
+typedef struct SDL_Palette {
+ int ncolors;
+ SDL_Color *colors;
+} SDL_Palette;
+/*@}*/
+
+/** Everything in the pixel format structure is read-only */
+typedef struct SDL_PixelFormat {
+ SDL_Palette *palette;
+ Uint8 BitsPerPixel;
+ Uint8 BytesPerPixel;
+ Uint8 Rloss;
+ Uint8 Gloss;
+ Uint8 Bloss;
+ Uint8 Aloss;
+ Uint8 Rshift;
+ Uint8 Gshift;
+ Uint8 Bshift;
+ Uint8 Ashift;
+ Uint32 Rmask;
+ Uint32 Gmask;
+ Uint32 Bmask;
+ Uint32 Amask;
+
+ /** RGB color key information */
+ Uint32 colorkey;
+ /** Alpha value information (per-surface alpha) */
+ Uint8 alpha;
+} SDL_PixelFormat;
+
+/** This structure should be treated as read-only, except for 'pixels',
+ * which, if not NULL, contains the raw pixel data for the surface.
+ */
+typedef struct SDL_Surface {
+ Uint32 flags; /**< Read-only */
+ SDL_PixelFormat *format; /**< Read-only */
+ int w, h; /**< Read-only */
+ Uint16 pitch; /**< Read-only */
+ void *pixels; /**< Read-write */
+ int offset; /**< Private */
+
+ /** Hardware-specific surface info */
+ struct private_hwdata *hwdata;
+
+ /** clipping information */
+ SDL_Rect clip_rect; /**< Read-only */
+ Uint32 unused1; /**< for binary compatibility */
+
+ /** Allow recursive locks */
+ Uint32 locked; /**< Private */
+
+ /** info for fast blit mapping to other surfaces */
+ struct SDL_BlitMap *map; /**< Private */
+
+ /** format version, bumped at every change to invalidate blit maps */
+ unsigned int format_version; /**< Private */
+
+ /** Reference count -- used when freeing surface */
+ int refcount; /**< Read-mostly */
+} SDL_Surface;
+
+/** @name SDL_Surface Flags
+ * These are the currently supported flags for the SDL_surface
+ */
+/*@{*/
+
+/** Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */
+/*@{*/
+#define SDL_SWSURFACE 0x00000000 /**< Surface is in system memory */
+#define SDL_HWSURFACE 0x00000001 /**< Surface is in video memory */
+#define SDL_ASYNCBLIT 0x00000004 /**< Use asynchronous blits if possible */
+/*@}*/
+
+/** Available for SDL_SetVideoMode() */
+/*@{*/
+#define SDL_ANYFORMAT 0x10000000 /**< Allow any video depth/pixel-format */
+#define SDL_HWPALETTE 0x20000000 /**< Surface has exclusive palette */
+#define SDL_DOUBLEBUF 0x40000000 /**< Set up double-buffered video mode */
+#define SDL_FULLSCREEN 0x80000000 /**< Surface is a full screen display */
+#define SDL_OPENGL 0x00000002 /**< Create an OpenGL rendering context */
+#define SDL_OPENGLBLIT 0x0000000A /**< Create an OpenGL rendering context and use it for blitting */
+#define SDL_RESIZABLE 0x00000010 /**< This video mode may be resized */
+#define SDL_NOFRAME 0x00000020 /**< No window caption or edge frame */
+/*@}*/
+
+/** Used internally (read-only) */
+/*@{*/
+#define SDL_HWACCEL 0x00000100 /**< Blit uses hardware acceleration */
+#define SDL_SRCCOLORKEY 0x00001000 /**< Blit uses a source color key */
+#define SDL_RLEACCELOK 0x00002000 /**< Private flag */
+#define SDL_RLEACCEL 0x00004000 /**< Surface is RLE encoded */
+#define SDL_SRCALPHA 0x00010000 /**< Blit uses source alpha blending */
+#define SDL_PREALLOC 0x01000000 /**< Surface uses preallocated memory */
+/*@}*/
+
+/*@}*/
+
+/** Evaluates to true if the surface needs to be locked before access */
+#define SDL_MUSTLOCK(surface) \
+ (surface->offset || \
+ ((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0))
+
+/** typedef for private surface blitting functions */
+typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect,
+ struct SDL_Surface *dst, SDL_Rect *dstrect);
+
+
+/** Useful for determining the video hardware capabilities */
+typedef struct SDL_VideoInfo {
+ Uint32 hw_available :1; /**< Flag: Can you create hardware surfaces? */
+ Uint32 wm_available :1; /**< Flag: Can you talk to a window manager? */
+ Uint32 UnusedBits1 :6;
+ Uint32 UnusedBits2 :1;
+ Uint32 blit_hw :1; /**< Flag: Accelerated blits HW --> HW */
+ Uint32 blit_hw_CC :1; /**< Flag: Accelerated blits with Colorkey */
+ Uint32 blit_hw_A :1; /**< Flag: Accelerated blits with Alpha */
+ Uint32 blit_sw :1; /**< Flag: Accelerated blits SW --> HW */
+ Uint32 blit_sw_CC :1; /**< Flag: Accelerated blits with Colorkey */
+ Uint32 blit_sw_A :1; /**< Flag: Accelerated blits with Alpha */
+ Uint32 blit_fill :1; /**< Flag: Accelerated color fill */
+ Uint32 UnusedBits3 :16;
+ Uint32 video_mem; /**< The total amount of video memory (in K) */
+ SDL_PixelFormat *vfmt; /**< Value: The format of the video surface */
+ int current_w; /**< Value: The current video mode width */
+ int current_h; /**< Value: The current video mode height */
+} SDL_VideoInfo;
+
+
+/** @name Overlay Formats
+ * The most common video overlay formats.
+ * For an explanation of these pixel formats, see:
+ * http://www.webartz.com/fourcc/indexyuv.htm
+ *
+ * For information on the relationship between color spaces, see:
+ * http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
+ */
+/*@{*/
+#define SDL_YV12_OVERLAY 0x32315659 /**< Planar mode: Y + V + U (3 planes) */
+#define SDL_IYUV_OVERLAY 0x56555949 /**< Planar mode: Y + U + V (3 planes) */
+#define SDL_YUY2_OVERLAY 0x32595559 /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
+#define SDL_UYVY_OVERLAY 0x59565955 /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
+#define SDL_YVYU_OVERLAY 0x55595659 /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
+/*@}*/
+
+/** The YUV hardware video overlay */
+typedef struct SDL_Overlay {
+ Uint32 format; /**< Read-only */
+ int w, h; /**< Read-only */
+ int planes; /**< Read-only */
+ Uint16 *pitches; /**< Read-only */
+ Uint8 **pixels; /**< Read-write */
+
+ /** @name Hardware-specific surface info */
+ /*@{*/
+ struct private_yuvhwfuncs *hwfuncs;
+ struct private_yuvhwdata *hwdata;
+ /*@{*/
+
+ /** @name Special flags */
+ /*@{*/
+ Uint32 hw_overlay :1; /**< Flag: This overlay hardware accelerated? */
+ Uint32 UnusedBits :31;
+ /*@}*/
+} SDL_Overlay;
+
+
+/** Public enumeration for setting the OpenGL window attributes. */
+typedef enum {
+ SDL_GL_RED_SIZE,
+ SDL_GL_GREEN_SIZE,
+ SDL_GL_BLUE_SIZE,
+ SDL_GL_ALPHA_SIZE,
+ SDL_GL_BUFFER_SIZE,
+ SDL_GL_DOUBLEBUFFER,
+ SDL_GL_DEPTH_SIZE,
+ SDL_GL_STENCIL_SIZE,
+ SDL_GL_ACCUM_RED_SIZE,
+ SDL_GL_ACCUM_GREEN_SIZE,
+ SDL_GL_ACCUM_BLUE_SIZE,
+ SDL_GL_ACCUM_ALPHA_SIZE,
+ SDL_GL_STEREO,
+ SDL_GL_MULTISAMPLEBUFFERS,
+ SDL_GL_MULTISAMPLESAMPLES,
+ SDL_GL_ACCELERATED_VISUAL,
+ SDL_GL_SWAP_CONTROL
+} SDL_GLattr;
+
+/** @name flags for SDL_SetPalette() */
+/*@{*/
+#define SDL_LOGPAL 0x01
+#define SDL_PHYSPAL 0x02
+/*@}*/
+
+/* Function prototypes */
+
+/**
+ * @name Video Init and Quit
+ * These functions are used internally, and should not be used unless you
+ * have a specific need to specify the video driver you want to use.
+ * You should normally use SDL_Init() or SDL_InitSubSystem().
+ */
+/*@{*/
+/**
+ * Initializes the video subsystem. Sets up a connection
+ * to the window manager, etc, and determines the current video mode and
+ * pixel format, but does not initialize a window or graphics mode.
+ * Note that event handling is activated by this routine.
+ *
+ * If you use both sound and video in your application, you need to call
+ * SDL_Init() before opening the sound device, otherwise under Win32 DirectX,
+ * you won't be able to set full-screen display modes.
+ */
+extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name, Uint32 flags);
+extern DECLSPEC void SDLCALL SDL_VideoQuit(void);
+/*@}*/
+
+/**
+ * This function fills the given character buffer with the name of the
+ * video driver, and returns a pointer to it if the video driver has
+ * been initialized. It returns NULL if no driver has been initialized.
+ */
+extern DECLSPEC char * SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen);
+
+/**
+ * This function returns a pointer to the current display surface.
+ * If SDL is doing format conversion on the display surface, this
+ * function returns the publicly visible surface, not the real video
+ * surface.
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_GetVideoSurface(void);
+
+/**
+ * This function returns a read-only pointer to information about the
+ * video hardware. If this is called before SDL_SetVideoMode(), the 'vfmt'
+ * member of the returned structure will contain the pixel format of the
+ * "best" video mode.
+ */
+extern DECLSPEC const SDL_VideoInfo * SDLCALL SDL_GetVideoInfo(void);
+
+/**
+ * Check to see if a particular video mode is supported.
+ * It returns 0 if the requested mode is not supported under any bit depth,
+ * or returns the bits-per-pixel of the closest available mode with the
+ * given width and height. If this bits-per-pixel is different from the
+ * one used when setting the video mode, SDL_SetVideoMode() will succeed,
+ * but will emulate the requested bits-per-pixel with a shadow surface.
+ *
+ * The arguments to SDL_VideoModeOK() are the same ones you would pass to
+ * SDL_SetVideoMode()
+ */
+extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags);
+
+/**
+ * Return a pointer to an array of available screen dimensions for the
+ * given format and video flags, sorted largest to smallest. Returns
+ * NULL if there are no dimensions available for a particular format,
+ * or (SDL_Rect **)-1 if any dimension is okay for the given format.
+ *
+ * If 'format' is NULL, the mode list will be for the format given
+ * by SDL_GetVideoInfo()->vfmt
+ */
+extern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags);
+
+/**
+ * Set up a video mode with the specified width, height and bits-per-pixel.
+ *
+ * If 'bpp' is 0, it is treated as the current display bits per pixel.
+ *
+ * If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the
+ * requested bits-per-pixel, but will return whatever video pixel format is
+ * available. The default is to emulate the requested pixel format if it
+ * is not natively available.
+ *
+ * If SDL_HWSURFACE is set in 'flags', the video surface will be placed in
+ * video memory, if possible, and you may have to call SDL_LockSurface()
+ * in order to access the raw framebuffer. Otherwise, the video surface
+ * will be created in system memory.
+ *
+ * If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle
+ * updates asynchronously, but you must always lock before accessing pixels.
+ * SDL will wait for updates to complete before returning from the lock.
+ *
+ * If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee
+ * that the colors set by SDL_SetColors() will be the colors you get.
+ * Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all
+ * of the colors exactly the way they are requested, and you should look
+ * at the video surface structure to determine the actual palette.
+ * If SDL cannot guarantee that the colors you request can be set,
+ * i.e. if the colormap is shared, then the video surface may be created
+ * under emulation in system memory, overriding the SDL_HWSURFACE flag.
+ *
+ * If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set
+ * a fullscreen video mode. The default is to create a windowed mode
+ * if the current graphics system has a window manager.
+ * If the SDL library is able to set a fullscreen video mode, this flag
+ * will be set in the surface that is returned.
+ *
+ * If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up
+ * two surfaces in video memory and swap between them when you call
+ * SDL_Flip(). This is usually slower than the normal single-buffering
+ * scheme, but prevents "tearing" artifacts caused by modifying video
+ * memory while the monitor is refreshing. It should only be used by
+ * applications that redraw the entire screen on every update.
+ *
+ * If SDL_RESIZABLE is set in 'flags', the SDL library will allow the
+ * window manager, if any, to resize the window at runtime. When this
+ * occurs, SDL will send a SDL_VIDEORESIZE event to you application,
+ * and you must respond to the event by re-calling SDL_SetVideoMode()
+ * with the requested size (or another size that suits the application).
+ *
+ * If SDL_NOFRAME is set in 'flags', the SDL library will create a window
+ * without any title bar or frame decoration. Fullscreen video modes have
+ * this flag set automatically.
+ *
+ * This function returns the video framebuffer surface, or NULL if it fails.
+ *
+ * If you rely on functionality provided by certain video flags, check the
+ * flags of the returned surface to make sure that functionality is available.
+ * SDL will fall back to reduced functionality if the exact flags you wanted
+ * are not available.
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_SetVideoMode
+ (int width, int height, int bpp, Uint32 flags);
+
+/** @name SDL_Update Functions
+ * These functions should not be called while 'screen' is locked.
+ */
+/*@{*/
+/**
+ * Makes sure the given list of rectangles is updated on the given screen.
+ */
+extern DECLSPEC void SDLCALL SDL_UpdateRects
+ (SDL_Surface *screen, int numrects, SDL_Rect *rects);
+/**
+ * If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire
+ * screen.
+ */
+extern DECLSPEC void SDLCALL SDL_UpdateRect
+ (SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h);
+/*@}*/
+
+/**
+ * On hardware that supports double-buffering, this function sets up a flip
+ * and returns. The hardware will wait for vertical retrace, and then swap
+ * video buffers before the next video surface blit or lock will return.
+ * On hardware that doesn not support double-buffering, this is equivalent
+ * to calling SDL_UpdateRect(screen, 0, 0, 0, 0);
+ * The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when
+ * setting the video mode for this function to perform hardware flipping.
+ * This function returns 0 if successful, or -1 if there was an error.
+ */
+extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface *screen);
+
+/**
+ * Set the gamma correction for each of the color channels.
+ * The gamma values range (approximately) between 0.1 and 10.0
+ *
+ * If this function isn't supported directly by the hardware, it will
+ * be emulated using gamma ramps, if available. If successful, this
+ * function returns 0, otherwise it returns -1.
+ */
+extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue);
+
+/**
+ * Set the gamma translation table for the red, green, and blue channels
+ * of the video hardware. Each table is an array of 256 16-bit quantities,
+ * representing a mapping between the input and output for that channel.
+ * The input is the index into the array, and the output is the 16-bit
+ * gamma value at that index, scaled to the output color precision.
+ *
+ * You may pass NULL for any of the channels to leave it unchanged.
+ * If the call succeeds, it will return 0. If the display driver or
+ * hardware does not support gamma translation, or otherwise fails,
+ * this function will return -1.
+ */
+extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue);
+
+/**
+ * Retrieve the current values of the gamma translation tables.
+ *
+ * You must pass in valid pointers to arrays of 256 16-bit quantities.
+ * Any of the pointers may be NULL to ignore that channel.
+ * If the call succeeds, it will return 0. If the display driver or
+ * hardware does not support gamma translation, or otherwise fails,
+ * this function will return -1.
+ */
+extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue);
+
+/**
+ * Sets a portion of the colormap for the given 8-bit surface. If 'surface'
+ * is not a palettized surface, this function does nothing, returning 0.
+ * If all of the colors were set as passed to SDL_SetColors(), it will
+ * return 1. If not all the color entries were set exactly as given,
+ * it will return 0, and you should look at the surface palette to
+ * determine the actual color palette.
+ *
+ * When 'surface' is the surface associated with the current display, the
+ * display colormap will be updated with the requested colors. If
+ * SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors()
+ * will always return 1, and the palette is guaranteed to be set the way
+ * you desire, even if the window colormap has to be warped or run under
+ * emulation.
+ */
+extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface *surface,
+ SDL_Color *colors, int firstcolor, int ncolors);
+
+/**
+ * Sets a portion of the colormap for a given 8-bit surface.
+ * 'flags' is one or both of:
+ * SDL_LOGPAL -- set logical palette, which controls how blits are mapped
+ * to/from the surface,
+ * SDL_PHYSPAL -- set physical palette, which controls how pixels look on
+ * the screen
+ * Only screens have physical palettes. Separate change of physical/logical
+ * palettes is only possible if the screen has SDL_HWPALETTE set.
+ *
+ * The return value is 1 if all colours could be set as requested, and 0
+ * otherwise.
+ *
+ * SDL_SetColors() is equivalent to calling this function with
+ * flags = (SDL_LOGPAL|SDL_PHYSPAL).
+ */
+extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface *surface, int flags,
+ SDL_Color *colors, int firstcolor,
+ int ncolors);
+
+/**
+ * Maps an RGB triple to an opaque pixel value for a given pixel format
+ */
+extern DECLSPEC Uint32 SDLCALL SDL_MapRGB
+(const SDL_PixelFormat * const format,
+ const Uint8 r, const Uint8 g, const Uint8 b);
+
+/**
+ * Maps an RGBA quadruple to a pixel value for a given pixel format
+ */
+extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA
+(const SDL_PixelFormat * const format,
+ const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a);
+
+/**
+ * Maps a pixel value into the RGB components for a given pixel format
+ */
+extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
+ const SDL_PixelFormat * const fmt,
+ Uint8 *r, Uint8 *g, Uint8 *b);
+
+/**
+ * Maps a pixel value into the RGBA components for a given pixel format
+ */
+extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
+ const SDL_PixelFormat * const fmt,
+ Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
+
+/** @sa SDL_CreateRGBSurface */
+#define SDL_AllocSurface SDL_CreateRGBSurface
+/**
+ * Allocate and free an RGB surface (must be called after SDL_SetVideoMode)
+ * If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
+ * If the depth is greater than 8 bits, the pixel format is set using the
+ * flags '[RGB]mask'.
+ * If the function runs out of memory, it will return NULL.
+ *
+ * The 'flags' tell what kind of surface to create.
+ * SDL_SWSURFACE means that the surface should be created in system memory.
+ * SDL_HWSURFACE means that the surface should be created in video memory,
+ * with the same format as the display surface. This is useful for surfaces
+ * that will not change much, to take advantage of hardware acceleration
+ * when being blitted to the display surface.
+ * SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with
+ * this surface, but you must always lock it before accessing the pixels.
+ * SDL will wait for current blits to finish before returning from the lock.
+ * SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits.
+ * If the hardware supports acceleration of colorkey blits between
+ * two surfaces in video memory, SDL will try to place the surface in
+ * video memory. If this isn't possible or if there is no hardware
+ * acceleration available, the surface will be placed in system memory.
+ * SDL_SRCALPHA means that the surface will be used for alpha blits and
+ * if the hardware supports hardware acceleration of alpha blits between
+ * two surfaces in video memory, to place the surface in video memory
+ * if possible, otherwise it will be placed in system memory.
+ * If the surface is created in video memory, blits will be _much_ faster,
+ * but the surface format must be identical to the video surface format,
+ * and the only way to access the pixels member of the surface is to use
+ * the SDL_LockSurface() and SDL_UnlockSurface() calls.
+ * If the requested surface actually resides in video memory, SDL_HWSURFACE
+ * will be set in the flags member of the returned surface. If for some
+ * reason the surface could not be placed in video memory, it will not have
+ * the SDL_HWSURFACE flag set, and will be created in system memory instead.
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurface
+ (Uint32 flags, int width, int height, int depth,
+ Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
+/** @sa SDL_CreateRGBSurface */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
+ int width, int height, int depth, int pitch,
+ Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
+extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface);
+
+/**
+ * SDL_LockSurface() sets up a surface for directly accessing the pixels.
+ * Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write
+ * to and read from 'surface->pixels', using the pixel format stored in
+ * 'surface->format'. Once you are done accessing the surface, you should
+ * use SDL_UnlockSurface() to release it.
+ *
+ * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates
+ * to 0, then you can read and write to the surface at any time, and the
+ * pixel format of the surface will not change. In particular, if the
+ * SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you
+ * will not need to lock the display surface before accessing it.
+ *
+ * No operating system or library calls should be made between lock/unlock
+ * pairs, as critical system locks may be held during this time.
+ *
+ * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
+ */
+extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface);
+extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface);
+
+/**
+ * Load a surface from a seekable SDL data source (memory or file.)
+ * If 'freesrc' is non-zero, the source will be closed after being read.
+ * Returns the new surface, or NULL if there was an error.
+ * The new surface should be freed with SDL_FreeSurface().
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, int freesrc);
+
+/** Convenience macro -- load a surface from a file */
+#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
+
+/**
+ * Save a surface to a seekable SDL data source (memory or file.)
+ * If 'freedst' is non-zero, the source will be closed after being written.
+ * Returns 0 if successful or -1 if there was an error.
+ */
+extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
+ (SDL_Surface *surface, SDL_RWops *dst, int freedst);
+
+/** Convenience macro -- save a surface to a file */
+#define SDL_SaveBMP(surface, file) \
+ SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
+
+/**
+ * Sets the color key (transparent pixel) in a blittable surface.
+ * If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL),
+ * 'key' will be the transparent pixel in the source image of a blit.
+ * SDL_RLEACCEL requests RLE acceleration for the surface if present,
+ * and removes RLE acceleration if absent.
+ * If 'flag' is 0, this function clears any current color key.
+ * This function returns 0, or -1 if there was an error.
+ */
+extern DECLSPEC int SDLCALL SDL_SetColorKey
+ (SDL_Surface *surface, Uint32 flag, Uint32 key);
+
+/**
+ * This function sets the alpha value for the entire surface, as opposed to
+ * using the alpha component of each pixel. This value measures the range
+ * of transparency of the surface, 0 being completely transparent to 255
+ * being completely opaque. An 'alpha' value of 255 causes blits to be
+ * opaque, the source pixels copied to the destination (the default). Note
+ * that per-surface alpha can be combined with colorkey transparency.
+ *
+ * If 'flag' is 0, alpha blending is disabled for the surface.
+ * If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface.
+ * OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the
+ * surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed.
+ *
+ * The 'alpha' parameter is ignored for surfaces that have an alpha channel.
+ */
+extern DECLSPEC int SDLCALL SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha);
+
+/**
+ * Sets the clipping rectangle for the destination surface in a blit.
+ *
+ * If the clip rectangle is NULL, clipping will be disabled.
+ * If the clip rectangle doesn't intersect the surface, the function will
+ * return SDL_FALSE and blits will be completely clipped. Otherwise the
+ * function returns SDL_TRUE and blits to the surface will be clipped to
+ * the intersection of the surface area and the clipping rectangle.
+ *
+ * Note that blits are automatically clipped to the edges of the source
+ * and destination surfaces.
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect);
+
+/**
+ * Gets the clipping rectangle for the destination surface in a blit.
+ * 'rect' must be a pointer to a valid rectangle which will be filled
+ * with the correct values.
+ */
+extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect);
+
+/**
+ * Creates a new surface of the specified format, and then copies and maps
+ * the given surface to it so the blit of the converted surface will be as
+ * fast as possible. If this function fails, it returns NULL.
+ *
+ * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those
+ * semantics. You can also pass SDL_RLEACCEL in the flags parameter and
+ * SDL will try to RLE accelerate colorkey and alpha blits in the resulting
+ * surface.
+ *
+ * This function is used internally by SDL_DisplayFormat().
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface
+ (SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags);
+
+/**
+ * This performs a fast blit from the source surface to the destination
+ * surface. It assumes that the source and destination rectangles are
+ * the same size. If either 'srcrect' or 'dstrect' are NULL, the entire
+ * surface (src or dst) is copied. The final blit rectangles are saved
+ * in 'srcrect' and 'dstrect' after all clipping is performed.
+ * If the blit is successful, it returns 0, otherwise it returns -1.
+ *
+ * The blit function should not be called on a locked surface.
+ *
+ * The blit semantics for surfaces with and without alpha and colorkey
+ * are defined as follows:
+ *
+ * RGBA->RGB:
+ * SDL_SRCALPHA set:
+ * alpha-blend (using alpha-channel).
+ * SDL_SRCCOLORKEY ignored.
+ * SDL_SRCALPHA not set:
+ * copy RGB.
+ * if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ * RGB values of the source colour key, ignoring alpha in the
+ * comparison.
+ *
+ * RGB->RGBA:
+ * SDL_SRCALPHA set:
+ * alpha-blend (using the source per-surface alpha value);
+ * set destination alpha to opaque.
+ * SDL_SRCALPHA not set:
+ * copy RGB, set destination alpha to source per-surface alpha value.
+ * both:
+ * if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ * source colour key.
+ *
+ * RGBA->RGBA:
+ * SDL_SRCALPHA set:
+ * alpha-blend (using the source alpha channel) the RGB values;
+ * leave destination alpha untouched. [Note: is this correct?]
+ * SDL_SRCCOLORKEY ignored.
+ * SDL_SRCALPHA not set:
+ * copy all of RGBA to the destination.
+ * if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ * RGB values of the source colour key, ignoring alpha in the
+ * comparison.
+ *
+ * RGB->RGB:
+ * SDL_SRCALPHA set:
+ * alpha-blend (using the source per-surface alpha value).
+ * SDL_SRCALPHA not set:
+ * copy RGB.
+ * both:
+ * if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ * source colour key.
+ *
+ * If either of the surfaces were in video memory, and the blit returns -2,
+ * the video memory was lost, so it should be reloaded with artwork and
+ * re-blitted:
+ * @code
+ * while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
+ * while ( SDL_LockSurface(image) < 0 )
+ * Sleep(10);
+ * -- Write image pixels to image->pixels --
+ * SDL_UnlockSurface(image);
+ * }
+ * @endcode
+ *
+ * This happens under DirectX 5.0 when the system switches away from your
+ * fullscreen application. The lock will also fail until you have access
+ * to the video memory again.
+ *
+ * You should call SDL_BlitSurface() unless you know exactly how SDL
+ * blitting works internally and how to use the other blit functions.
+ */
+#define SDL_BlitSurface SDL_UpperBlit
+
+/** This is the public blit function, SDL_BlitSurface(), and it performs
+ * rectangle validation and clipping before passing it to SDL_LowerBlit()
+ */
+extern DECLSPEC int SDLCALL SDL_UpperBlit
+ (SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect);
+/** This is a semi-private blit function and it performs low-level surface
+ * blitting only.
+ */
+extern DECLSPEC int SDLCALL SDL_LowerBlit
+ (SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect);
+
+/**
+ * This function performs a fast fill of the given rectangle with 'color'
+ * The given rectangle is clipped to the destination surface clip area
+ * and the final fill rectangle is saved in the passed in pointer.
+ * If 'dstrect' is NULL, the whole surface will be filled with 'color'
+ * The color should be a pixel of the format used by the surface, and
+ * can be generated by the SDL_MapRGB() function.
+ * This function returns 0 on success, or -1 on error.
+ */
+extern DECLSPEC int SDLCALL SDL_FillRect
+ (SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);
+
+/**
+ * This function takes a surface and copies it to a new surface of the
+ * pixel format and colors of the video framebuffer, suitable for fast
+ * blitting onto the display surface. It calls SDL_ConvertSurface()
+ *
+ * If you want to take advantage of hardware colorkey or alpha blit
+ * acceleration, you should set the colorkey and alpha value before
+ * calling this function.
+ *
+ * If the conversion fails or runs out of memory, it returns NULL
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormat(SDL_Surface *surface);
+
+/**
+ * This function takes a surface and copies it to a new surface of the
+ * pixel format and colors of the video framebuffer (if possible),
+ * suitable for fast alpha blitting onto the display surface.
+ * The new surface will always have an alpha channel.
+ *
+ * If you want to take advantage of hardware colorkey or alpha blit
+ * acceleration, you should set the colorkey and alpha value before
+ * calling this function.
+ *
+ * If the conversion fails or runs out of memory, it returns NULL
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *surface);
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** @name YUV video surface overlay functions */ /*@{*/
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/** This function creates a video output overlay
+ * Calling the returned surface an overlay is something of a misnomer because
+ * the contents of the display surface underneath the area where the overlay
+ * is shown is undefined - it may be overwritten with the converted YUV data.
+ */
+extern DECLSPEC SDL_Overlay * SDLCALL SDL_CreateYUVOverlay(int width, int height,
+ Uint32 format, SDL_Surface *display);
+
+/** Lock an overlay for direct access, and unlock it when you are done */
+extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay *overlay);
+extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay *overlay);
+
+/** Blit a video overlay to the display surface.
+ * The contents of the video surface underneath the blit destination are
+ * not defined.
+ * The width and height of the destination rectangle may be different from
+ * that of the overlay, but currently only 2x scaling is supported.
+ */
+extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect);
+
+/** Free a video overlay */
+extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay *overlay);
+
+/*@}*/
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** @name OpenGL support functions. */ /*@{*/
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/**
+ * Dynamically load an OpenGL library, or the default one if path is NULL
+ *
+ * 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().
+ */
+extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
+
+/**
+ * Get the address of a GL function
+ */
+extern DECLSPEC void * SDLCALL SDL_GL_GetProcAddress(const char* proc);
+
+/**
+ * Set an attribute of the OpenGL subsystem before intialization.
+ */
+extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
+
+/**
+ * Get an attribute of the OpenGL subsystem from the windowing
+ * interface, such as glX. This is of course different from getting
+ * the values from SDL's internal OpenGL subsystem, which only
+ * stores the values you request before initialization.
+ *
+ * Developers should track the values they pass into SDL_GL_SetAttribute
+ * themselves if they want to retrieve these values.
+ */
+extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int* value);
+
+/**
+ * Swap the OpenGL buffers, if double-buffering is supported.
+ */
+extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void);
+
+/** @name OpenGL Internal Functions
+ * Internal functions that should not be called unless you have read
+ * and understood the source code for these functions.
+ */
+/*@{*/
+extern DECLSPEC void SDLCALL SDL_GL_UpdateRects(int numrects, SDL_Rect* rects);
+extern DECLSPEC void SDLCALL SDL_GL_Lock(void);
+extern DECLSPEC void SDLCALL SDL_GL_Unlock(void);
+/*@}*/
+
+/*@}*/
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/** @name Window Manager Functions */
+/** These functions allow interaction with the window manager, if any. */ /*@{*/
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/**
+ * Sets the title and icon text of the display window (UTF-8 encoded)
+ */
+extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title, const char *icon);
+/**
+ * Gets the title and icon text of the display window (UTF-8 encoded)
+ */
+extern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon);
+
+/**
+ * Sets the icon for the display window.
+ * This function must be called before the first call to SDL_SetVideoMode().
+ * It takes an icon surface, and a mask in MSB format.
+ * If 'mask' is NULL, the entire icon surface will be used as the icon.
+ */
+extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask);
+
+/**
+ * This function iconifies the window, and returns 1 if it succeeded.
+ * If the function succeeds, it generates an SDL_APPACTIVE loss event.
+ * This function is a noop and returns 0 in non-windowed environments.
+ */
+extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void);
+
+/**
+ * Toggle fullscreen mode without changing the contents of the screen.
+ * If the display surface does not require locking before accessing
+ * the pixel information, then the memory pointers will not change.
+ *
+ * If this function was able to toggle fullscreen mode (change from
+ * running in a window to fullscreen, or vice-versa), it will return 1.
+ * If it is not implemented, or fails, it returns 0.
+ *
+ * The next call to SDL_SetVideoMode() will set the mode fullscreen
+ * attribute based on the flags parameter - if SDL_FULLSCREEN is not
+ * set, then the display will be windowed by default where supported.
+ *
+ * This is currently only implemented in the X11 video driver.
+ */
+extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface *surface);
+
+typedef enum {
+ SDL_GRAB_QUERY = -1,
+ SDL_GRAB_OFF = 0,
+ SDL_GRAB_ON = 1,
+ SDL_GRAB_FULLSCREEN /**< Used internally */
+} SDL_GrabMode;
+/**
+ * This function allows you to set and query the input grab state of
+ * the application. It returns the new input grab state.
+ *
+ * Grabbing means that the mouse is confined to the application window,
+ * and nearly all keyboard input is passed directly to the application,
+ * and not interpreted by a window manager, if any.
+ */
+extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode);
+
+/*
+ * Move the SDL Window to a specific position. Does nothing in fullscreen mode.
+ */
+extern DECLSPEC void SDL_WM_SetPos(int x, int y);
+
+/*
+ * Get the current SDL window position. Returns (0,0) in fullscreen mode.
+ */
+extern DECLSPEC void SDL_WM_GetPos(int *px, int *py);
+
+/*
+ * If the window is fully visible, return TRUE; otherwise, recenter the window
+ * if the 'recenter' parameter is non-0, and return FALSE.
+ */
+extern DECLSPEC int SDL_WM_IsFullyVisible(int recenter);
+
+/*
+ * Get the resolution of the main monitor in DPIs, if available.
+ * Return 0 on success, or -1 if the data is not available.
+ */
+extern DECLSPEC int SDL_WM_GetMonitorDPI(int *xDPI, int *yDPI);
+
+/*
+ * Get the coordinates of the monitor in virtual desktop space.
+ * In the case of multi-monitor systems, returns the rectangle of
+ * the 'nearest' monitor relative to the main SDL_window. Returns
+ * 0 on success, or -1 if the data is not available.
+ */
+extern DECLSPEC int SDL_WM_GetMonitorRect(SDL_Rect *rect);
+
+/*@}*/
+
+/** @internal Not in public API at the moment - do not use! */
+extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect);
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_video_h */
diff --git a/distrib/sdl-1.2.15/include/begin_code.h b/distrib/sdl-1.2.15/include/begin_code.h
new file mode 100644
index 0000000..27e2f7b
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/begin_code.h
@@ -0,0 +1,196 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/**
+ * @file begin_code.h
+ * This file sets things up for C dynamic library function definitions,
+ * static inlined functions, and structures aligned at 4-byte alignment.
+ * If you don't like ugly C preprocessor code, don't look at this file. :)
+ */
+
+/**
+ * @file begin_code.h
+ * This shouldn't be nested -- included it around code only.
+ */
+#ifdef _begin_code_h
+#error Nested inclusion of begin_code.h
+#endif
+#define _begin_code_h
+
+/**
+ * @def DECLSPEC
+ * Some compilers use a special export keyword
+ */
+#ifndef DECLSPEC
+# if defined(__BEOS__) || defined(__HAIKU__)
+# if defined(__GNUC__)
+# define DECLSPEC
+# else
+# define DECLSPEC __declspec(export)
+# endif
+# elif defined(__WIN32__)
+# ifdef __BORLANDC__
+# ifdef BUILD_SDL
+# define DECLSPEC
+# else
+# define DECLSPEC __declspec(dllimport)
+# endif
+# else
+# define DECLSPEC __declspec(dllexport)
+# endif
+# elif defined(__OS2__)
+# ifdef __WATCOMC__
+# ifdef BUILD_SDL
+# define DECLSPEC __declspec(dllexport)
+# else
+# define DECLSPEC
+# endif
+# elif defined (__GNUC__) && __GNUC__ < 4
+# /* Added support for GCC-EMX <v4.x */
+# /* this is needed for XFree86/OS2 developement */
+# /* F. Ambacher(anakor@snafu.de) 05.2008 */
+# ifdef BUILD_SDL
+# define DECLSPEC __declspec(dllexport)
+# else
+# define DECLSPEC
+# endif
+# else
+# define DECLSPEC
+# endif
+# else
+# if defined(__GNUC__) && __GNUC__ >= 4
+# define DECLSPEC __attribute__ ((visibility("default")))
+# else
+# define DECLSPEC
+# endif
+# endif
+#endif
+
+/**
+ * @def SDLCALL
+ * By default SDL uses the C calling convention
+ */
+#ifndef SDLCALL
+# if defined(__WIN32__) && !defined(__GNUC__)
+# define SDLCALL __cdecl
+# elif defined(__OS2__)
+# if defined (__GNUC__) && __GNUC__ < 4
+# /* Added support for GCC-EMX <v4.x */
+# /* this is needed for XFree86/OS2 developement */
+# /* F. Ambacher(anakor@snafu.de) 05.2008 */
+# define SDLCALL _cdecl
+# else
+# /* On other compilers on OS/2, we use the _System calling convention */
+# /* to be compatible with every compiler */
+# define SDLCALL _System
+# endif
+# else
+# define SDLCALL
+# endif
+#endif /* SDLCALL */
+
+#ifdef __SYMBIAN32__
+#ifndef EKA2
+#undef DECLSPEC
+#define DECLSPEC
+#elif !defined(__WINS__)
+#undef DECLSPEC
+#define DECLSPEC __declspec(dllexport)
+#endif /* !EKA2 */
+#endif /* __SYMBIAN32__ */
+
+/**
+ * @file begin_code.h
+ * Force structure packing at 4 byte alignment.
+ * This is necessary if the header is included in code which has structure
+ * packing set to an alternate value, say for loading structures from disk.
+ * The packing is reset to the previous value in close_code.h
+ */
+#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
+#ifdef _MSC_VER
+#pragma warning(disable: 4103)
+#endif
+#ifdef __BORLANDC__
+#pragma nopackwarning
+#endif
+#ifdef _M_X64
+/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */
+#pragma pack(push,8)
+#else
+#pragma pack(push,4)
+#endif
+#elif (defined(__MWERKS__) && defined(__MACOS__))
+#pragma options align=mac68k4byte
+#pragma enumsalwaysint on
+#endif /* Compiler needs structure packing set */
+
+/**
+ * @def SDL_INLINE_OKAY
+ * Set up compiler-specific options for inlining functions
+ */
+#ifndef SDL_INLINE_OKAY
+#ifdef __GNUC__
+#define SDL_INLINE_OKAY
+#else
+/* Add any special compiler-specific cases here */
+#if defined(_MSC_VER) || defined(__BORLANDC__) || \
+ defined(__DMC__) || defined(__SC__) || \
+ defined(__WATCOMC__) || defined(__LCC__) || \
+ defined(__DECC) || defined(__EABI__)
+#ifndef __inline__
+#define __inline__ __inline
+#endif
+#define SDL_INLINE_OKAY
+#else
+#if !defined(__MRC__) && !defined(_SGI_SOURCE)
+#ifndef __inline__
+#define __inline__ inline
+#endif
+#define SDL_INLINE_OKAY
+#endif /* Not a funky compiler */
+#endif /* Visual C++ */
+#endif /* GNU C */
+#endif /* SDL_INLINE_OKAY */
+
+/**
+ * @def __inline__
+ * If inlining isn't supported, remove "__inline__", turning static
+ * inlined functions into static functions (resulting in code bloat
+ * in all files which include the offending header files)
+ */
+#ifndef SDL_INLINE_OKAY
+#define __inline__
+#endif
+
+/**
+ * @def NULL
+ * Apparently this is needed by several Windows compilers
+ */
+#if !defined(__MACH__)
+#ifndef NULL
+#ifdef __cplusplus
+#define NULL 0
+#else
+#define NULL ((void *)0)
+#endif
+#endif /* NULL */
+#endif /* ! Mac OS X - breaks precompiled headers */
diff --git a/distrib/sdl-1.2.15/include/close_code.h b/distrib/sdl-1.2.15/include/close_code.h
new file mode 100644
index 0000000..19a0024
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/close_code.h
@@ -0,0 +1,46 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/**
+ * @file close_code.h
+ * This file reverses the effects of begin_code.h and should be included
+ * after you finish any function and structure declarations in your headers
+ */
+
+#undef _begin_code_h
+
+/**
+ * @file close_code.h
+ * Reset structure packing at previous byte alignment
+ */
+#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__)
+#ifdef __BORLANDC__
+#pragma nopackwarning
+#endif
+#if (defined(__MWERKS__) && defined(__MACOS__))
+#pragma options align=reset
+#pragma enumsalwaysint reset
+#else
+#pragma pack(pop)
+#endif
+#endif /* Compiler needs structure packing set */
+
diff --git a/distrib/sdl-1.2.15/include/doxyfile b/distrib/sdl-1.2.15/include/doxyfile
new file mode 100644
index 0000000..29dcf5b
--- /dev/null
+++ b/distrib/sdl-1.2.15/include/doxyfile
@@ -0,0 +1,946 @@
+# Doxyfile 1.2.16
+
+# 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 (" ")
+
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = SDL
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 1.2.15
+
+# 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
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Brazilian, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch,
+# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Korean,
+# Norwegian, Polish, Portuguese, Romanian, Russian, Slovak, Slovene,
+# Spanish, Swedish and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = NO
+
+# 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 = 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 class will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# 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
+
+# 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 = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. It is allowed to use relative paths in the argument list.
+
+STRIP_FROM_PATH =
+
+# 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
+
+# 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 = YES
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower case letters. If set to YES upper case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# users are adviced to set this option to NO.
+
+CASE_SENSE_NAMES = YES
+
+# 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 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 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
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like the Qt-style comments (thus requiring an
+# explict @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member
+# documentation.
+
+DETAILS_AT_TOP = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# reimplements.
+
+INHERIT_DOCS = 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 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
+
+# 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
+
+# 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
+
+# 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 =
+
+# 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 consist of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C.
+# For instance some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+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 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
+
+#---------------------------------------------------------------------------
+# 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
+
+# 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.
+
+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 = include
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp
+# *.h++ *.idl *.odl
+
+FILE_PATTERNS = *.h
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = NO
+
+# 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.
+
+EXCLUDE_PATTERNS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \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 <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+
+INPUT_FILTER =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse.
+
+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.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default)
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default)
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = 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
+
+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 GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the Html help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# 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
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript and frames is required (for instance Mozilla, Netscape 4.0+,
+# or Internet explorer 4.0+). Note that for large projects the tree generation
+# can take a very long time. In such cases it is better to disable this feature.
+# Windows users are probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW = NO
+
+# 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
+
+#---------------------------------------------------------------------------
+# 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 = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = NO
+
+# 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
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimised for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = YES
+
+# 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 assigments. 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 = YES
+
+# 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 = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_XML = NO
+
+#---------------------------------------------------------------------------
+# 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 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 = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_PREDEFINED tags.
+
+EXPAND_ONLY_PREDEF = YES
+
+# 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.
+
+PREDEFINED = DOXYGEN_SHOULD_IGNORE_THIS=1 SDLCALL= SNDDECLSPEC=
+
+# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# 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 and do not end with a semicolon. Such function macros are typically
+# used for boiler-plate code, and will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tagfiles.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# 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 superceded by the HAVE_DOT option below. This is only a fallback. It is
+# recommended to install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS = NO
+
+# 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
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = NO
+
+# 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 = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found on the path.
+
+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 MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_WIDTH = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT = 1024
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermedate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions 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
+
+# The CGI_NAME tag should be the name of the CGI script that
+# starts the search engine (doxysearch) with the correct parameters.
+# A script with this name will be generated by doxygen.
+
+CGI_NAME = search.cgi
+
+# The CGI_URL tag should be the absolute URL to the directory where the
+# cgi binaries are located. See the documentation of your http daemon for
+# details.
+
+CGI_URL =
+
+# The DOC_URL tag should be the absolute URL to the directory where the
+# documentation is located. If left blank the absolute path to the
+# documentation, with file:// prepended to it, will be used.
+
+DOC_URL =
+
+# The DOC_ABSPATH tag should be the absolute path to the directory where the
+# documentation is located. If left blank the directory on the local machine
+# will be used.
+
+DOC_ABSPATH =
+
+# The BIN_ABSPATH tag must point to the directory where the doxysearch binary
+# is installed.
+
+BIN_ABSPATH = /usr/local/bin/
+
+# The EXT_DOC_PATHS tag can be used to specify one or more paths to
+# documentation generated for other projects. This allows doxysearch to search
+# the documentation for these projects as well.
+
+EXT_DOC_PATHS =
diff --git a/distrib/sdl-1.2.12/sdl-config.in b/distrib/sdl-1.2.15/sdl-config.in
index 843c1a6..843c1a6 100644
--- a/distrib/sdl-1.2.12/sdl-config.in
+++ b/distrib/sdl-1.2.15/sdl-config.in
diff --git a/distrib/sdl-1.2.15/sdl.m4 b/distrib/sdl-1.2.15/sdl.m4
new file mode 100644
index 0000000..639eb85
--- /dev/null
+++ b/distrib/sdl-1.2.15/sdl.m4
@@ -0,0 +1,185 @@
+# Configure paths for SDL
+# Sam Lantinga 9/21/99
+# stolen from Manish Singh
+# stolen back from Frank Belew
+# stolen from Manish Singh
+# Shamelessly stolen from Owen Taylor
+
+# serial 1
+
+dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
+dnl
+AC_DEFUN([AM_PATH_SDL],
+[dnl
+dnl Get the cflags and libraries from the sdl-config script
+dnl
+AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
+ sdl_prefix="$withval", sdl_prefix="")
+AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
+ sdl_exec_prefix="$withval", sdl_exec_prefix="")
+AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
+ , enable_sdltest=yes)
+
+ if test x$sdl_exec_prefix != x ; then
+ sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
+ if test x${SDL_CONFIG+set} != xset ; then
+ SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
+ fi
+ fi
+ if test x$sdl_prefix != x ; then
+ sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
+ if test x${SDL_CONFIG+set} != xset ; then
+ SDL_CONFIG=$sdl_prefix/bin/sdl-config
+ fi
+ fi
+
+ as_save_PATH="$PATH"
+ if test "x$prefix" != xNONE; then
+ PATH="$prefix/bin:$prefix/usr/bin:$PATH"
+ fi
+ AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
+ PATH="$as_save_PATH"
+ min_sdl_version=ifelse([$1], ,0.11.0,$1)
+ AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
+ no_sdl=""
+ if test "$SDL_CONFIG" = "no" ; then
+ no_sdl=yes
+ else
+ SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags`
+ SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs`
+
+ sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ if test "x$enable_sdltest" = "xyes" ; then
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $SDL_CFLAGS"
+ CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
+ LIBS="$LIBS $SDL_LIBS"
+dnl
+dnl Now check if the installed SDL is sufficiently new. (Also sanity
+dnl checks the results of sdl-config to some extent
+dnl
+ rm -f conf.sdltest
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "SDL.h"
+
+char*
+my_strdup (char *str)
+{
+ char *new_str;
+
+ if (str)
+ {
+ new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
+ strcpy (new_str, str);
+ }
+ else
+ new_str = NULL;
+
+ return new_str;
+}
+
+int main (int argc, char *argv[])
+{
+ int major, minor, micro;
+ char *tmp_version;
+
+ /* This hangs on some systems (?)
+ system ("touch conf.sdltest");
+ */
+ { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
+
+ /* HP/UX 9 (%@#!) writes to sscanf strings */
+ tmp_version = my_strdup("$min_sdl_version");
+ if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+ printf("%s, bad version string\n", "$min_sdl_version");
+ exit(1);
+ }
+
+ if (($sdl_major_version > major) ||
+ (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
+ (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
+ {
+ return 0;
+ }
+ else
+ {
+ printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
+ printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
+ printf("*** best to upgrade to the required version.\n");
+ printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
+ printf("*** to point to the correct copy of sdl-config, and remove the file\n");
+ printf("*** config.cache before re-running configure\n");
+ return 1;
+ }
+}
+
+],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+ CFLAGS="$ac_save_CFLAGS"
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ if test "x$no_sdl" = x ; then
+ AC_MSG_RESULT(yes)
+ ifelse([$2], , :, [$2])
+ else
+ AC_MSG_RESULT(no)
+ if test "$SDL_CONFIG" = "no" ; then
+ echo "*** The sdl-config script installed by SDL could not be found"
+ echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
+ echo "*** your path, or set the SDL_CONFIG environment variable to the"
+ echo "*** full path to sdl-config."
+ else
+ if test -f conf.sdltest ; then
+ :
+ else
+ echo "*** Could not run SDL test program, checking why..."
+ CFLAGS="$CFLAGS $SDL_CFLAGS"
+ CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
+ LIBS="$LIBS $SDL_LIBS"
+ AC_TRY_LINK([
+#include <stdio.h>
+#include "SDL.h"
+
+int main(int argc, char *argv[])
+{ return 0; }
+#undef main
+#define main K_and_R_C_main
+], [ return 0; ],
+ [ echo "*** The test program compiled, but did not run. This usually means"
+ echo "*** that the run-time linker is not finding SDL or finding the wrong"
+ echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
+ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+ echo "*** to the installed location Also, make sure you have run ldconfig if that"
+ echo "*** is required on your system"
+ echo "***"
+ echo "*** If you have an old version installed, it is best to remove it, although"
+ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+ [ echo "*** The test program failed to compile or link. See the file config.log for the"
+ echo "*** exact error that occured. This usually means SDL was incorrectly installed"
+ echo "*** or that you have moved SDL since it was installed. In the latter case, you"
+ echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
+ CFLAGS="$ac_save_CFLAGS"
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ SDL_CFLAGS=""
+ SDL_LIBS=""
+ ifelse([$3], , :, [$3])
+ fi
+ AC_SUBST(SDL_CFLAGS)
+ AC_SUBST(SDL_LIBS)
+ rm -f conf.sdltest
+])
diff --git a/distrib/sdl-1.2.15/sdl.pc.in b/distrib/sdl-1.2.15/sdl.pc.in
new file mode 100644
index 0000000..2d43ac9
--- /dev/null
+++ b/distrib/sdl-1.2.15/sdl.pc.in
@@ -0,0 +1,15 @@
+# sdl pkg-config source file
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: sdl
+Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.
+Version: @SDL_VERSION@
+Requires:
+Conflicts:
+Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@
+Libs.private: @SDL_STATIC_LIBS@
+Cflags: -I${includedir}/SDL @SDL_CFLAGS@
diff --git a/distrib/sdl-1.2.15/sources.make b/distrib/sdl-1.2.15/sources.make
new file mode 100644
index 0000000..5117506
--- /dev/null
+++ b/distrib/sdl-1.2.15/sources.make
@@ -0,0 +1,243 @@
+# This is included from the main Android emulator build script
+# to declare the SDL-related sources, compiler flags and libraries
+#
+
+SDL_CFLAGS :=
+SDL_LDLIBS :=
+SDL_STATIC_LIBRARIES :=
+
+SDL_SOURCES :=
+
+ifeq ($(HOST_OS),linux)
+ SDL_CONFIG_LOADSO_DLOPEN := yes
+ SDL_CONFIG_THREAD_PTHREAD := yes
+ SDL_CONFIG_THREAD_PTHREAD_RECURSIVE_MUTEX_NP := yes
+ SDL_CONFIG_TIMER_UNIX := yes
+ SDL_CONFIG_VIDEO_X11 := yes
+ SDL_CONFIG_VIDEO_X11_DPMS := yes
+ SDL_CONFIG_VIDEO_X11_XINERAMA := yes
+ SDL_CONFIG_VIDEO_X11_XME := yes
+ SDL_CONFIG_MAIN_DUMMY := yes
+
+ SDL_CFLAGS += -D_GNU_SOURCE=1 -D_REENTRANT
+ SDL_LDLIBS += -lm -ldl -lpthread -lrt
+endif
+
+ifeq ($(HOST_OS),freebsd)
+ SDL_CONFIG_LOADSO_DLOPEN := yes
+ SDL_CONFIG_THREAD_PTHREAD := yes
+ SDL_CONFIG_THREAD_PTHREAD_RECURSIVE_MUTEX := yes
+ SDL_CONFIG_TIMER_UNIX := yes
+ SDL_CONFIG_VIDEO_X11 := yes
+ SDL_CONFIG_VIDEO_X11_DPMS := yes
+ SDL_CONFIG_VIDEO_X11_XINERAMA := yes
+ SDL_CONFIG_VIDEO_X11_XME := yes
+ SDL_CONFIG_MAIN_DUMMY := yes
+
+ SDL_CFLAGS += -D_GNU_SOURCE=1 -D_REENTRANT
+ SDL_LDLIBS += -lm -ldl -lpthread
+endif
+
+ifeq ($(HOST_OS),darwin)
+ SDL_CONFIG_LOADSO_DLCOMPAT := yes
+ SDL_CONFIG_THREAD_PTHREAD := yes
+ SDL_CONFIG_THREAD_PTHREAD_RECURSIVE_MUTEX := yes
+ SDL_CONFIG_TIMER_UNIX := yes
+ SDL_CONFIG_VIDEO_QUARTZ := yes
+ SDL_CONFIG_MAIN_MACOSX := yes
+
+ SDL_CFLAGS += -D_GNU_SOURCE=1 -DTHREAD_SAFE
+ FRAMEWORKS := OpenGL Cocoa QuickTime ApplicationServices Carbon IOKit
+ SDL_LDLIBS += $(FRAMEWORKS:%=-Wl,-framework,%)
+endif
+
+ifeq ($(HOST_OS),windows)
+ SDL_CONFIG_LOADSO_WIN32 := yes
+ SDL_CONFIG_THREAD_WIN32 := yes
+ SDL_CONFIG_TIMER_WIN32 := yes
+ SDL_CONFIG_VIDEO_WINDIB := yes
+ SDL_CONFIG_MAIN_WIN32 := yes
+
+ SDL_CFLAGS += -D_GNU_SOURCE=1 -Dmain=SDL_main -DNO_STDIO_REDIRECT=1
+ SDL_LDLIBS += -luser32 -lgdi32 -lwinmm
+endif
+
+
+# the main src/ sources
+#
+SRCS := SDL.c \
+ SDL_error.c \
+ SDL_fatal.c \
+
+SRCS += events/SDL_active.c \
+ events/SDL_events.c \
+ events/SDL_expose.c \
+ events/SDL_keyboard.c \
+ events/SDL_mouse.c \
+ events/SDL_quit.c \
+ events/SDL_resize.c \
+
+SRCS += file/SDL_rwops.c
+
+SRCS += stdlib/SDL_getenv.c \
+ stdlib/SDL_iconv.c \
+ stdlib/SDL_malloc.c \
+ stdlib/SDL_qsort.c \
+ stdlib/SDL_stdlib.c \
+ stdlib/SDL_string.c
+
+SRCS += cpuinfo/SDL_cpuinfo.c
+
+SDL_SOURCES += $(SRCS:%=$(SDL_DIR)/src/%)
+
+# the LoadSO sources
+#
+
+SRCS :=
+
+ifeq ($(SDL_CONFIG_LOADSO_DLOPEN),yes)
+ SRCS += dlopen/SDL_sysloadso.c
+ SDL_LDLIBS += -ldl
+endif
+
+ifeq ($(SDL_CONFIG_LOADSO_DLCOMPAT),yes)
+ SRCS += macosx/SDL_dlcompat.c
+endif
+
+ifeq ($(SDL_CONFIG_LOADSO_WIN32),yes)
+ SRCS += win32/SDL_sysloadso.c
+endif
+
+SDL_SOURCES += $(SRCS:%=$(SDL_DIR)/src/loadso/%)
+
+# the Thread sources
+#
+
+SRCS := SDL_thread.c
+
+ifeq ($(SDL_CONFIG_THREAD_PTHREAD),yes)
+ SRCS += pthread/SDL_syscond.c \
+ pthread/SDL_sysmutex.c \
+ pthread/SDL_syssem.c \
+ pthread/SDL_systhread.c
+endif
+
+ifeq ($(SDL_CONFIG_THREAD_WIN32),yes)
+ SRCS += win32/SDL_sysmutex.c \
+ win32/SDL_syssem.c \
+ win32/SDL_systhread.c
+endif
+
+SDL_SOURCES += $(SRCS:%=$(SDL_DIR)/src/thread/%)
+
+# the Timer sources
+#
+
+SRCS := SDL_timer.c
+
+ifeq ($(SDL_CONFIG_TIMER_UNIX),yes)
+ SRCS += unix/SDL_systimer.c
+endif
+
+ifeq ($(SDL_CONFIG_TIMER_WIN32),yes)
+ SRCS += win32/SDL_systimer.c
+endif
+
+SDL_SOURCES += $(SRCS:%=$(SDL_DIR)/src/timer/%)
+
+# the Video sources
+#
+
+SRCS := SDL_RLEaccel.c \
+ SDL_blit.c \
+ SDL_blit_0.c \
+ SDL_blit_1.c \
+ SDL_blit_A.c \
+ SDL_blit_N.c \
+ SDL_bmp.c \
+ SDL_cursor.c \
+ SDL_gamma.c \
+ SDL_pixels.c \
+ SDL_stretch.c \
+ SDL_surface.c \
+ SDL_video.c \
+ SDL_yuv.c \
+ SDL_yuv_mmx.c \
+ SDL_yuv_sw.c \
+
+SRCS += dummy/SDL_nullevents.c \
+ dummy/SDL_nullmouse.c \
+ dummy/SDL_nullvideo.c
+
+ifeq ($(SDL_CONFIG_VIDEO_WINDIB),yes)
+ SRCS += windib/SDL_dibevents.c \
+ windib/SDL_dibvideo.c \
+ wincommon/SDL_sysevents.c \
+ wincommon/SDL_sysmouse.c \
+ wincommon/SDL_syswm.c \
+ wincommon/SDL_wingl.c
+endif
+
+ifeq ($(SDL_CONFIG_VIDEO_QUARTZ),yes)
+ SRCS += quartz/SDL_QuartzGL.m \
+ quartz/SDL_QuartzVideo.m \
+ quartz/SDL_QuartzWM.m \
+ quartz/SDL_QuartzWindow.m \
+ quartz/SDL_QuartzEvents.m \
+ maccommon/SDL_macevents.c \
+ maccommon/SDL_macgl.c \
+ maccommon/SDL_macmouse.c \
+ maccommon/SDL_macwm.c
+
+endif
+
+ifeq ($(SDL_CONFIG_VIDEO_X11),yes)
+ SRCS += x11/SDL_x11dyn.c \
+ x11/SDL_x11dga.c \
+ x11/SDL_x11events.c \
+ x11/SDL_x11gamma.c \
+ x11/SDL_x11gl.c \
+ x11/SDL_x11image.c \
+ x11/SDL_x11modes.c \
+ x11/SDL_x11mouse.c \
+ x11/SDL_x11video.c \
+ x11/SDL_x11wm.c \
+ x11/SDL_x11yuv.c
+endif
+
+ifeq ($(SDL_CONFIG_VIDEO_X11_DGAMOUSE),yes)
+ SRCS += x11/SDL_x11dga.c
+endif
+
+ifeq ($(SDL_CONFIG_VIDEO_X11_XME),yes)
+ SRCS += Xext/XME/xme.c
+endif
+
+ifeq ($(SDL_CONFIG_VIDEO_X11_XINERAMA),yes)
+ SRCS += Xext/Xinerama/Xinerama.c
+endif
+
+ifeq ($(SDL_CONFIG_VIDEO_X11_XV),yes)
+ SRCS += Xext/Xv/Xv.c
+endif
+
+SDL_SOURCES += $(SRCS:%=$(SDL_DIR)/src/video/%)
+
+## Build libSDLmain
+##
+
+SRCS :=
+
+ifeq ($(SDL_CONFIG_MAIN_DUMMY),yes)
+ SRCS += dummy/SDL_dummy_main.c
+endif
+
+ifeq ($(SDL_CONFIG_MAIN_MACOSX),yes)
+ SRCS += macosx/SDLMain.m
+endif
+
+ifeq ($(SDL_CONFIG_MAIN_WIN32),yes)
+ SRCS += win32/SDL_win32_main.c
+endif
+
+SDLMAIN_SOURCES := $(SRCS:%=$(SDL_DIR)/src/main/%)
diff --git a/distrib/sdl-1.2.15/src/SDL.c b/distrib/sdl-1.2.15/src/SDL.c
new file mode 100644
index 0000000..87f1b1a
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/SDL.c
@@ -0,0 +1,350 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Initialization code for SDL */
+
+#include "SDL.h"
+#include "SDL_fatal.h"
+#if !SDL_VIDEO_DISABLED
+#include "video/SDL_leaks.h"
+#endif
+
+#if SDL_THREAD_PTH
+#include <pth.h>
+#endif
+
+/* Initialization/Cleanup routines */
+#if !SDL_JOYSTICK_DISABLED
+extern int SDL_JoystickInit(void);
+extern void SDL_JoystickQuit(void);
+#endif
+#if !SDL_CDROM_DISABLED
+extern int SDL_CDROMInit(void);
+extern void SDL_CDROMQuit(void);
+#endif
+#if !SDL_TIMERS_DISABLED
+extern void SDL_StartTicks(void);
+extern int SDL_TimerInit(void);
+extern void SDL_TimerQuit(void);
+#endif
+
+/* The current SDL version */
+static SDL_version version =
+ { SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL };
+
+/* The initialized subsystems */
+static Uint32 SDL_initialized = 0;
+#if !SDL_TIMERS_DISABLED
+static Uint32 ticks_started = 0;
+#endif
+
+#ifdef CHECK_LEAKS
+int surfaces_allocated = 0;
+#endif
+
+int SDL_InitSubSystem(Uint32 flags)
+{
+#if !SDL_TIMERS_DISABLED
+ /* Initialize the timer subsystem */
+ if ( ! ticks_started ) {
+ SDL_StartTicks();
+ ticks_started = 1;
+ }
+ if ( (flags & SDL_INIT_TIMER) && !(SDL_initialized & SDL_INIT_TIMER) ) {
+ if ( SDL_TimerInit() < 0 ) {
+ return(-1);
+ }
+ SDL_initialized |= SDL_INIT_TIMER;
+ }
+#else
+ if ( flags & SDL_INIT_TIMER ) {
+ SDL_SetError("SDL not built with timer support");
+ return(-1);
+ }
+#endif
+
+#if !SDL_VIDEO_DISABLED
+ /* Initialize the video/event subsystem */
+ if ( (flags & SDL_INIT_VIDEO) && !(SDL_initialized & SDL_INIT_VIDEO) ) {
+ if ( SDL_VideoInit(SDL_getenv("SDL_VIDEODRIVER"),
+ (flags&SDL_INIT_EVENTTHREAD)) < 0 ) {
+ return(-1);
+ }
+ SDL_initialized |= SDL_INIT_VIDEO;
+ }
+#else
+ if ( flags & SDL_INIT_VIDEO ) {
+ SDL_SetError("SDL not built with video support");
+ return(-1);
+ }
+#endif
+
+#if !SDL_AUDIO_DISABLED
+ /* Initialize the audio subsystem */
+ if ( (flags & SDL_INIT_AUDIO) && !(SDL_initialized & SDL_INIT_AUDIO) ) {
+ if ( SDL_AudioInit(SDL_getenv("SDL_AUDIODRIVER")) < 0 ) {
+ return(-1);
+ }
+ SDL_initialized |= SDL_INIT_AUDIO;
+ }
+#else
+ if ( flags & SDL_INIT_AUDIO ) {
+ SDL_SetError("SDL not built with audio support");
+ return(-1);
+ }
+#endif
+
+#if !SDL_JOYSTICK_DISABLED
+ /* Initialize the joystick subsystem */
+ if ( (flags & SDL_INIT_JOYSTICK) &&
+ !(SDL_initialized & SDL_INIT_JOYSTICK) ) {
+ if ( SDL_JoystickInit() < 0 ) {
+ return(-1);
+ }
+ SDL_initialized |= SDL_INIT_JOYSTICK;
+ }
+#else
+ if ( flags & SDL_INIT_JOYSTICK ) {
+ SDL_SetError("SDL not built with joystick support");
+ return(-1);
+ }
+#endif
+
+#if !SDL_CDROM_DISABLED
+ /* Initialize the CD-ROM subsystem */
+ if ( (flags & SDL_INIT_CDROM) && !(SDL_initialized & SDL_INIT_CDROM) ) {
+ if ( SDL_CDROMInit() < 0 ) {
+ return(-1);
+ }
+ SDL_initialized |= SDL_INIT_CDROM;
+ }
+#else
+ if ( flags & SDL_INIT_CDROM ) {
+ SDL_SetError("SDL not built with cdrom support");
+ return(-1);
+ }
+#endif
+ return(0);
+}
+
+int SDL_Init(Uint32 flags)
+{
+#if !SDL_THREADS_DISABLED && SDL_THREAD_PTH
+ if (!pth_init()) {
+ return -1;
+ }
+#endif
+
+ /* Clear the error message */
+ SDL_ClearError();
+
+ /* Initialize the desired subsystems */
+ if ( SDL_InitSubSystem(flags) < 0 ) {
+ return(-1);
+ }
+
+ /* Everything is initialized */
+ if ( !(flags & SDL_INIT_NOPARACHUTE) ) {
+ SDL_InstallParachute();
+ }
+ return(0);
+}
+
+void SDL_QuitSubSystem(Uint32 flags)
+{
+ /* Shut down requested initialized subsystems */
+#if !SDL_CDROM_DISABLED
+ if ( (flags & SDL_initialized & SDL_INIT_CDROM) ) {
+ SDL_CDROMQuit();
+ SDL_initialized &= ~SDL_INIT_CDROM;
+ }
+#endif
+#if !SDL_JOYSTICK_DISABLED
+ if ( (flags & SDL_initialized & SDL_INIT_JOYSTICK) ) {
+ SDL_JoystickQuit();
+ SDL_initialized &= ~SDL_INIT_JOYSTICK;
+ }
+#endif
+#if !SDL_AUDIO_DISABLED
+ if ( (flags & SDL_initialized & SDL_INIT_AUDIO) ) {
+ SDL_AudioQuit();
+ SDL_initialized &= ~SDL_INIT_AUDIO;
+ }
+#endif
+#if !SDL_VIDEO_DISABLED
+ if ( (flags & SDL_initialized & SDL_INIT_VIDEO) ) {
+ SDL_VideoQuit();
+ SDL_initialized &= ~SDL_INIT_VIDEO;
+ }
+#endif
+#if !SDL_TIMERS_DISABLED
+ if ( (flags & SDL_initialized & SDL_INIT_TIMER) ) {
+ SDL_TimerQuit();
+ SDL_initialized &= ~SDL_INIT_TIMER;
+ }
+#endif
+}
+
+Uint32 SDL_WasInit(Uint32 flags)
+{
+ if ( ! flags ) {
+ flags = SDL_INIT_EVERYTHING;
+ }
+ return (SDL_initialized&flags);
+}
+
+void SDL_Quit(void)
+{
+ /* Quit all subsystems */
+#ifdef DEBUG_BUILD
+ printf("[SDL_Quit] : Enter! Calling QuitSubSystem()\n"); fflush(stdout);
+#endif
+ SDL_QuitSubSystem(SDL_INIT_EVERYTHING);
+
+#ifdef CHECK_LEAKS
+#ifdef DEBUG_BUILD
+ printf("[SDL_Quit] : CHECK_LEAKS\n"); fflush(stdout);
+#endif
+
+ /* Print the number of surfaces not freed */
+ if ( surfaces_allocated != 0 ) {
+ fprintf(stderr, "SDL Warning: %d SDL surfaces extant\n",
+ surfaces_allocated);
+ }
+#endif
+#ifdef DEBUG_BUILD
+ printf("[SDL_Quit] : SDL_UninstallParachute()\n"); fflush(stdout);
+#endif
+
+ /* Uninstall any parachute signal handlers */
+ SDL_UninstallParachute();
+
+#if !SDL_THREADS_DISABLED && SDL_THREAD_PTH
+ pth_kill();
+#endif
+#ifdef DEBUG_BUILD
+ printf("[SDL_Quit] : Returning!\n"); fflush(stdout);
+#endif
+
+}
+
+/* Return the library version number */
+const SDL_version * SDL_Linked_Version(void)
+{
+ return(&version);
+}
+
+#if defined(__OS2__)
+/* Building for OS/2 */
+#ifdef __WATCOMC__
+
+#define INCL_DOSERRORS
+#define INCL_DOSEXCEPTIONS
+#include <os2.h>
+
+/* Exception handler to prevent the Audio thread hanging, making a zombie process! */
+ULONG _System SDL_Main_ExceptionHandler(PEXCEPTIONREPORTRECORD pERepRec,
+ PEXCEPTIONREGISTRATIONRECORD pERegRec,
+ PCONTEXTRECORD pCtxRec,
+ PVOID p)
+{
+ if (pERepRec->fHandlerFlags & EH_EXIT_UNWIND)
+ return XCPT_CONTINUE_SEARCH;
+ if (pERepRec->fHandlerFlags & EH_UNWINDING)
+ return XCPT_CONTINUE_SEARCH;
+ if (pERepRec->fHandlerFlags & EH_NESTED_CALL)
+ return XCPT_CONTINUE_SEARCH;
+
+ /* Do cleanup at every fatal exception! */
+ if (((pERepRec->ExceptionNum & XCPT_SEVERITY_CODE) == XCPT_FATAL_EXCEPTION) &&
+ (pERepRec->ExceptionNum != XCPT_BREAKPOINT) &&
+ (pERepRec->ExceptionNum != XCPT_SINGLE_STEP)
+ )
+ {
+ if (SDL_initialized & SDL_INIT_AUDIO)
+ {
+ /* This removes the zombie audio thread in case of emergency. */
+#ifdef DEBUG_BUILD
+ printf("[SDL_Main_ExceptionHandler] : Calling SDL_CloseAudio()!\n");
+#endif
+ SDL_CloseAudio();
+ }
+ }
+ return (XCPT_CONTINUE_SEARCH);
+}
+
+
+EXCEPTIONREGISTRATIONRECORD SDL_Main_xcpthand = {0, SDL_Main_ExceptionHandler};
+
+/* The main DLL entry for DLL Initialization and Uninitialization: */
+unsigned _System LibMain(unsigned hmod, unsigned termination)
+{
+ if (termination)
+ {
+#ifdef DEBUG_BUILD
+/* printf("[SDL DLL Unintialization] : Removing exception handler\n"); */
+#endif
+ DosUnsetExceptionHandler(&SDL_Main_xcpthand);
+ return 1;
+ } else
+ {
+#ifdef DEBUG_BUILD
+ /* Make stdout and stderr unbuffered! */
+ setbuf(stdout, NULL);
+ setbuf(stderr, NULL);
+#endif
+ /* Fire up exception handler */
+#ifdef DEBUG_BUILD
+/* printf("[SDL DLL Initialization] : Setting exception handler\n"); */
+#endif
+ /* Set exception handler */
+ DosSetExceptionHandler(&SDL_Main_xcpthand);
+
+ return 1;
+ }
+}
+#endif /* __WATCOMC__ */
+
+#elif defined(__WIN32__) && !defined(__SYMBIAN32__)
+
+#if !defined(HAVE_LIBC) || (defined(__WATCOMC__) && defined(BUILD_DLL))
+/* Need to include DllMain() on Watcom C for some reason.. */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+BOOL APIENTRY _DllMainCRTStartup( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved )
+{
+ switch (ul_reason_for_call) {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
+}
+#endif /* building DLL with Watcom C */
+
+#endif /* OS/2 elif __WIN32__ */
diff --git a/distrib/sdl-1.2.15/src/SDL_error.c b/distrib/sdl-1.2.15/src/SDL_error.c
new file mode 100644
index 0000000..0f06bd5
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/SDL_error.c
@@ -0,0 +1,238 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Simple error handling in SDL */
+
+#include "SDL_error.h"
+#include "SDL_error_c.h"
+
+/* Routine to get the thread-specific error variable */
+#if SDL_THREADS_DISABLED
+/* The SDL_arraysize(The ),default (non-thread-safe) global error variable */
+static SDL_error SDL_global_error;
+#define SDL_GetErrBuf() (&SDL_global_error)
+#else
+extern SDL_error *SDL_GetErrBuf(void);
+#endif /* SDL_THREADS_DISABLED */
+
+#define SDL_ERRBUFIZE 1024
+
+/* Private functions */
+
+static const char *SDL_LookupString(const char *key)
+{
+ /* FIXME: Add code to lookup key in language string hash-table */
+ return key;
+}
+
+/* Public functions */
+
+void SDL_SetError (const char *fmt, ...)
+{
+ va_list ap;
+ SDL_error *error;
+
+ /* Copy in the key, mark error as valid */
+ error = SDL_GetErrBuf();
+ error->error = 1;
+ SDL_strlcpy((char *)error->key, fmt, sizeof(error->key));
+
+ va_start(ap, fmt);
+ error->argc = 0;
+ while ( *fmt ) {
+ if ( *fmt++ == '%' ) {
+ while ( *fmt == '.' || (*fmt >= '0' && *fmt <= '9') ) {
+ ++fmt;
+ }
+ switch (*fmt++) {
+ case 0: /* Malformed format string.. */
+ --fmt;
+ break;
+ case 'c':
+ case 'i':
+ case 'd':
+ case 'u':
+ case 'o':
+ case 'x':
+ case 'X':
+ error->args[error->argc++].value_i =
+ va_arg(ap, int);
+ break;
+ case 'f':
+ error->args[error->argc++].value_f =
+ va_arg(ap, double);
+ break;
+ case 'p':
+ error->args[error->argc++].value_ptr =
+ va_arg(ap, void *);
+ break;
+ case 's':
+ {
+ int i = error->argc;
+ const char *str = va_arg(ap, const char *);
+ if (str == NULL)
+ str = "(null)";
+ SDL_strlcpy((char *)error->args[i].buf, str, ERR_MAX_STRLEN);
+ error->argc++;
+ }
+ break;
+ default:
+ break;
+ }
+ if ( error->argc >= ERR_MAX_ARGS ) {
+ break;
+ }
+ }
+ }
+ va_end(ap);
+
+ /* If we are in debug mode, print out an error message */
+#ifdef DEBUG_ERROR
+ fprintf(stderr, "SDL_SetError: %s\n", SDL_GetError());
+#endif
+}
+
+/* This function has a bit more overhead than most error functions
+ so that it supports internationalization and thread-safe errors.
+*/
+char *SDL_GetErrorMsg(char *errstr, unsigned int maxlen)
+{
+ SDL_error *error;
+
+ /* Clear the error string */
+ *errstr = '\0'; --maxlen;
+
+ /* Get the thread-safe error, and print it out */
+ error = SDL_GetErrBuf();
+ if ( error->error ) {
+ const char *fmt;
+ char *msg = errstr;
+ int len;
+ int argi;
+
+ fmt = SDL_LookupString(error->key);
+ argi = 0;
+ while ( *fmt && (maxlen > 0) ) {
+ if ( *fmt == '%' ) {
+ char tmp[32], *spot = tmp;
+ *spot++ = *fmt++;
+ while ( (*fmt == '.' || (*fmt >= '0' && *fmt <= '9')) && spot < (tmp+SDL_arraysize(tmp)-2) ) {
+ *spot++ = *fmt++;
+ }
+ *spot++ = *fmt++;
+ *spot++ = '\0';
+ switch (spot[-2]) {
+ case '%':
+ *msg++ = '%';
+ maxlen -= 1;
+ break;
+ case 'c':
+ case 'i':
+ case 'd':
+ case 'u':
+ case 'o':
+ case 'x':
+ case 'X':
+ len = SDL_snprintf(msg, maxlen, tmp, error->args[argi++].value_i);
+ msg += len;
+ maxlen -= len;
+ break;
+ case 'f':
+ len = SDL_snprintf(msg, maxlen, tmp, error->args[argi++].value_f);
+ msg += len;
+ maxlen -= len;
+ break;
+ case 'p':
+ len = SDL_snprintf(msg, maxlen, tmp, error->args[argi++].value_ptr);
+ msg += len;
+ maxlen -= len;
+ break;
+ case 's':
+ len = SDL_snprintf(msg, maxlen, tmp, SDL_LookupString(error->args[argi++].buf));
+ msg += len;
+ maxlen -= len;
+ break;
+ }
+ } else {
+ *msg++ = *fmt++;
+ maxlen -= 1;
+ }
+ }
+ *msg = 0; /* NULL terminate the string */
+ }
+ return(errstr);
+}
+
+/* Available for backwards compatibility */
+char *SDL_GetError (void)
+{
+ static char errmsg[SDL_ERRBUFIZE];
+
+ return((char *)SDL_GetErrorMsg(errmsg, SDL_ERRBUFIZE));
+}
+
+void SDL_ClearError(void)
+{
+ SDL_error *error;
+
+ error = SDL_GetErrBuf();
+ error->error = 0;
+}
+
+/* Very common errors go here */
+void SDL_Error(SDL_errorcode code)
+{
+ switch (code) {
+ case SDL_ENOMEM:
+ SDL_SetError("Out of memory");
+ break;
+ case SDL_EFREAD:
+ SDL_SetError("Error reading from datastream");
+ break;
+ case SDL_EFWRITE:
+ SDL_SetError("Error writing to datastream");
+ break;
+ case SDL_EFSEEK:
+ SDL_SetError("Error seeking in datastream");
+ break;
+ default:
+ SDL_SetError("Unknown SDL error");
+ break;
+ }
+}
+
+#ifdef TEST_ERROR
+int main(int argc, char *argv[])
+{
+ char buffer[BUFSIZ+1];
+
+ SDL_SetError("Hi there!");
+ printf("Error 1: %s\n", SDL_GetError());
+ SDL_ClearError();
+ SDL_memset(buffer, '1', BUFSIZ);
+ buffer[BUFSIZ] = 0;
+ SDL_SetError("This is the error: %s (%f)", buffer, 1.0);
+ printf("Error 2: %s\n", SDL_GetError());
+ exit(0);
+}
+#endif
diff --git a/distrib/sdl-1.2.15/src/SDL_error_c.h b/distrib/sdl-1.2.15/src/SDL_error_c.h
new file mode 100644
index 0000000..8e54e42
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/SDL_error_c.h
@@ -0,0 +1,58 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This file defines a structure that carries language-independent
+ error messages
+*/
+
+#ifndef _SDL_error_c_h
+#define _SDL_error_c_h
+
+#define ERR_MAX_STRLEN 128
+#define ERR_MAX_ARGS 5
+
+typedef struct SDL_error {
+ /* This is a numeric value corresponding to the current error */
+ int error;
+
+ /* This is a key used to index into a language hashtable containing
+ internationalized versions of the SDL error messages. If the key
+ is not in the hashtable, or no hashtable is available, the key is
+ used directly as an error message format string.
+ */
+ char key[ERR_MAX_STRLEN];
+
+ /* These are the arguments for the error functions */
+ int argc;
+ union {
+ void *value_ptr;
+#if 0 /* What is a character anyway? (UNICODE issues) */
+ unsigned char value_c;
+#endif
+ int value_i;
+ double value_f;
+ char buf[ERR_MAX_STRLEN];
+ } args[ERR_MAX_ARGS];
+} SDL_error;
+
+#endif /* _SDL_error_c_h */
diff --git a/distrib/sdl-1.2.15/src/SDL_fatal.c b/distrib/sdl-1.2.15/src/SDL_fatal.c
new file mode 100644
index 0000000..d422a01
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/SDL_fatal.c
@@ -0,0 +1,134 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* General fatal signal handling code for SDL */
+
+#ifdef HAVE_SIGNAL_H
+
+#include <signal.h>
+
+#include "SDL.h"
+#include "SDL_fatal.h"
+
+/* This installs some signal handlers for the more common fatal signals,
+ so that if the programmer is lazy, the app doesn't die so horribly if
+ the program crashes.
+*/
+
+static void SDL_Parachute(int sig)
+{
+ signal(sig, SIG_DFL);
+ SDL_Quit();
+ raise(sig);
+}
+
+static int SDL_fatal_signals[] = {
+ SIGSEGV,
+#ifdef SIGBUS
+ SIGBUS,
+#endif
+#ifdef SIGFPE
+ SIGFPE,
+#endif
+#ifdef SIGQUIT
+ SIGQUIT,
+#endif
+ 0
+};
+
+void SDL_InstallParachute(void)
+{
+ /* Set a handler for any fatal signal not already handled */
+ int i;
+#ifdef HAVE_SIGACTION
+ struct sigaction action;
+
+ for ( i=0; SDL_fatal_signals[i]; ++i ) {
+ sigaction(SDL_fatal_signals[i], NULL, &action);
+ if ( action.sa_handler == SIG_DFL ) {
+ action.sa_handler = SDL_Parachute;
+ sigaction(SDL_fatal_signals[i], &action, NULL);
+ }
+ }
+#ifdef SIGALRM
+ /* Set SIGALRM to be ignored -- necessary on Solaris */
+ sigaction(SIGALRM, NULL, &action);
+ if ( action.sa_handler == SIG_DFL ) {
+ action.sa_handler = SIG_IGN;
+ sigaction(SIGALRM, &action, NULL);
+ }
+#endif
+#else
+ void (*ohandler)(int);
+
+ for ( i=0; SDL_fatal_signals[i]; ++i ) {
+ ohandler = signal(SDL_fatal_signals[i], SDL_Parachute);
+ if ( ohandler != SIG_DFL ) {
+ signal(SDL_fatal_signals[i], ohandler);
+ }
+ }
+#endif /* HAVE_SIGACTION */
+ return;
+}
+
+void SDL_UninstallParachute(void)
+{
+ /* Remove a handler for any fatal signal handled */
+ int i;
+#ifdef HAVE_SIGACTION
+ struct sigaction action;
+
+ for ( i=0; SDL_fatal_signals[i]; ++i ) {
+ sigaction(SDL_fatal_signals[i], NULL, &action);
+ if ( action.sa_handler == SDL_Parachute ) {
+ action.sa_handler = SIG_DFL;
+ sigaction(SDL_fatal_signals[i], &action, NULL);
+ }
+ }
+#else
+ void (*ohandler)(int);
+
+ for ( i=0; SDL_fatal_signals[i]; ++i ) {
+ ohandler = signal(SDL_fatal_signals[i], SIG_DFL);
+ if ( ohandler != SDL_Parachute ) {
+ signal(SDL_fatal_signals[i], ohandler);
+ }
+ }
+#endif /* HAVE_SIGACTION */
+}
+
+#else
+
+/* No signals on this platform, nothing to do.. */
+
+void SDL_InstallParachute(void)
+{
+ return;
+}
+
+void SDL_UninstallParachute(void)
+{
+ return;
+}
+
+#endif /* HAVE_SIGNAL_H */
diff --git a/distrib/sdl-1.2.15/src/SDL_fatal.h b/distrib/sdl-1.2.15/src/SDL_fatal.h
new file mode 100644
index 0000000..6789784
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/SDL_fatal.h
@@ -0,0 +1,28 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* General fatal signal handling code for SDL */
+
+extern void SDL_InstallParachute(void);
+extern void SDL_UninstallParachute(void);
+
diff --git a/distrib/sdl-1.2.15/src/audio/SDL_audio.c b/distrib/sdl-1.2.15/src/audio/SDL_audio.c
new file mode 100644
index 0000000..beb26e0
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/SDL_audio.c
@@ -0,0 +1,703 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Allow access to a raw mixing buffer */
+
+#include "SDL.h"
+#include "SDL_audio_c.h"
+#include "SDL_audiomem.h"
+#include "SDL_sysaudio.h"
+
+#ifdef __OS2__
+/* We'll need the DosSetPriority() API! */
+#define INCL_DOSPROCESS
+#include <os2.h>
+#endif
+
+/* Available audio drivers */
+static AudioBootStrap *bootstrap[] = {
+#if SDL_AUDIO_DRIVER_PULSE
+ &PULSE_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_ALSA
+ &ALSA_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_BSD
+ &BSD_AUDIO_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_OSS
+ &DSP_bootstrap,
+ &DMA_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_QNXNTO
+ &QNXNTOAUDIO_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_SUNAUDIO
+ &SUNAUDIO_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_DMEDIA
+ &DMEDIA_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_ARTS
+ &ARTS_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_ESD
+ &ESD_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_NAS
+ &NAS_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_DSOUND
+ &DSOUND_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_WAVEOUT
+ &WAVEOUT_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_PAUD
+ &Paud_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_BAUDIO
+ &BAUDIO_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_COREAUDIO
+ &COREAUDIO_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_SNDMGR
+ &SNDMGR_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_MINT
+ &MINTAUDIO_GSXB_bootstrap,
+ &MINTAUDIO_MCSN_bootstrap,
+ &MINTAUDIO_STFA_bootstrap,
+ &MINTAUDIO_XBIOS_bootstrap,
+ &MINTAUDIO_DMA8_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_DISK
+ &DISKAUD_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_DUMMY
+ &DUMMYAUD_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_DC
+ &DCAUD_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_NDS
+ &NDSAUD_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_MMEAUDIO
+ &MMEAUDIO_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_DART
+ &DART_bootstrap,
+#endif
+#if SDL_AUDIO_DRIVER_EPOCAUDIO
+ &EPOCAudio_bootstrap,
+#endif
+ NULL
+};
+SDL_AudioDevice *current_audio = NULL;
+
+/* Various local functions */
+int SDL_AudioInit(const char *driver_name);
+void SDL_AudioQuit(void);
+
+/* The general mixing thread function */
+int SDLCALL SDL_RunAudio(void *audiop)
+{
+ SDL_AudioDevice *audio = (SDL_AudioDevice *)audiop;
+ Uint8 *stream;
+ int stream_len;
+ void *udata;
+ void (SDLCALL *fill)(void *userdata,Uint8 *stream, int len);
+ int silence;
+
+ /* Perform any thread setup */
+ if ( audio->ThreadInit ) {
+ audio->ThreadInit(audio);
+ }
+ audio->threadid = SDL_ThreadID();
+
+ /* Set up the mixing function */
+ fill = audio->spec.callback;
+ udata = audio->spec.userdata;
+
+ if ( audio->convert.needed ) {
+ if ( audio->convert.src_format == AUDIO_U8 ) {
+ silence = 0x80;
+ } else {
+ silence = 0;
+ }
+ stream_len = audio->convert.len;
+ } else {
+ silence = audio->spec.silence;
+ stream_len = audio->spec.size;
+ }
+
+#ifdef __OS2__
+ /* Increase the priority of this thread to make sure that
+ the audio will be continuous all the time! */
+#ifdef USE_DOSSETPRIORITY
+ if (SDL_getenv("SDL_USE_TIMECRITICAL_AUDIO"))
+ {
+#ifdef DEBUG_BUILD
+ printf("[SDL_RunAudio] : Setting priority to TimeCritical+0! (TID%d)\n", SDL_ThreadID());
+#endif
+ DosSetPriority(PRTYS_THREAD, PRTYC_TIMECRITICAL, 0, 0);
+ }
+ else
+ {
+#ifdef DEBUG_BUILD
+ printf("[SDL_RunAudio] : Setting priority to ForegroundServer+0! (TID%d)\n", SDL_ThreadID());
+#endif
+ DosSetPriority(PRTYS_THREAD, PRTYC_FOREGROUNDSERVER, 0, 0);
+ }
+#endif
+#endif
+
+ /* Loop, filling the audio buffers */
+ while ( audio->enabled ) {
+
+ /* Fill the current buffer with sound */
+ if ( audio->convert.needed ) {
+ if ( audio->convert.buf ) {
+ stream = audio->convert.buf;
+ } else {
+ continue;
+ }
+ } else {
+ stream = audio->GetAudioBuf(audio);
+ if ( stream == NULL ) {
+ stream = audio->fake_stream;
+ }
+ }
+
+ SDL_memset(stream, silence, stream_len);
+
+ if ( ! audio->paused ) {
+ SDL_mutexP(audio->mixer_lock);
+ (*fill)(udata, stream, stream_len);
+ SDL_mutexV(audio->mixer_lock);
+ }
+
+ /* Convert the audio if necessary */
+ if ( audio->convert.needed ) {
+ SDL_ConvertAudio(&audio->convert);
+ stream = audio->GetAudioBuf(audio);
+ if ( stream == NULL ) {
+ stream = audio->fake_stream;
+ }
+ SDL_memcpy(stream, audio->convert.buf,
+ audio->convert.len_cvt);
+ }
+
+ /* Ready current buffer for play and change current buffer */
+ if ( stream != audio->fake_stream ) {
+ audio->PlayAudio(audio);
+ }
+
+ /* Wait for an audio buffer to become available */
+ if ( stream == audio->fake_stream ) {
+ SDL_Delay((audio->spec.samples*1000)/audio->spec.freq);
+ } else {
+ audio->WaitAudio(audio);
+ }
+ }
+
+ /* Wait for the audio to drain.. */
+ if ( audio->WaitDone ) {
+ audio->WaitDone(audio);
+ }
+
+#ifdef __OS2__
+#ifdef DEBUG_BUILD
+ printf("[SDL_RunAudio] : Task exiting. (TID%d)\n", SDL_ThreadID());
+#endif
+#endif
+ return(0);
+}
+
+static void SDL_LockAudio_Default(SDL_AudioDevice *audio)
+{
+ if ( audio->thread && (SDL_ThreadID() == audio->threadid) ) {
+ return;
+ }
+ SDL_mutexP(audio->mixer_lock);
+}
+
+static void SDL_UnlockAudio_Default(SDL_AudioDevice *audio)
+{
+ if ( audio->thread && (SDL_ThreadID() == audio->threadid) ) {
+ return;
+ }
+ SDL_mutexV(audio->mixer_lock);
+}
+
+static Uint16 SDL_ParseAudioFormat(const char *string)
+{
+ Uint16 format = 0;
+
+ switch (*string) {
+ case 'U':
+ ++string;
+ format |= 0x0000;
+ break;
+ case 'S':
+ ++string;
+ format |= 0x8000;
+ break;
+ default:
+ return 0;
+ }
+ switch (SDL_atoi(string)) {
+ case 8:
+ string += 1;
+ format |= 8;
+ break;
+ case 16:
+ string += 2;
+ format |= 16;
+ if ( SDL_strcmp(string, "LSB") == 0
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+ || SDL_strcmp(string, "SYS") == 0
+#endif
+ ) {
+ format |= 0x0000;
+ }
+ if ( SDL_strcmp(string, "MSB") == 0
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+ || SDL_strcmp(string, "SYS") == 0
+#endif
+ ) {
+ format |= 0x1000;
+ }
+ break;
+ default:
+ return 0;
+ }
+ return format;
+}
+
+int SDL_AudioInit(const char *driver_name)
+{
+ SDL_AudioDevice *audio;
+ int i = 0, idx;
+
+ /* Check to make sure we don't overwrite 'current_audio' */
+ if ( current_audio != NULL ) {
+ SDL_AudioQuit();
+ }
+
+ /* Select the proper audio driver */
+ audio = NULL;
+ idx = 0;
+#if SDL_AUDIO_DRIVER_ESD
+ if ( (driver_name == NULL) && (SDL_getenv("ESPEAKER") != NULL) ) {
+ /* Ahem, we know that if ESPEAKER is set, user probably wants
+ to use ESD, but don't start it if it's not already running.
+ This probably isn't the place to do this, but... Shh! :)
+ */
+ for ( i=0; bootstrap[i]; ++i ) {
+ if ( SDL_strcasecmp(bootstrap[i]->name, "esd") == 0 ) {
+#ifdef HAVE_PUTENV
+ const char *esd_no_spawn;
+
+ /* Don't start ESD if it's not running */
+ esd_no_spawn = getenv("ESD_NO_SPAWN");
+ if ( esd_no_spawn == NULL ) {
+ putenv("ESD_NO_SPAWN=1");
+ }
+#endif
+ if ( bootstrap[i]->available() ) {
+ audio = bootstrap[i]->create(0);
+ break;
+ }
+#ifdef HAVE_UNSETENV
+ if ( esd_no_spawn == NULL ) {
+ unsetenv("ESD_NO_SPAWN");
+ }
+#endif
+ }
+ }
+ }
+#endif /* SDL_AUDIO_DRIVER_ESD */
+ if ( audio == NULL ) {
+ if ( driver_name != NULL ) {
+#if 0 /* This will be replaced with a better driver selection API */
+ if ( SDL_strrchr(driver_name, ':') != NULL ) {
+ idx = atoi(SDL_strrchr(driver_name, ':')+1);
+ }
+#endif
+ for ( i=0; bootstrap[i]; ++i ) {
+ if (SDL_strcasecmp(bootstrap[i]->name, driver_name) == 0) {
+ if ( bootstrap[i]->available() ) {
+ audio=bootstrap[i]->create(idx);
+ break;
+ }
+ }
+ }
+ } else {
+ for ( i=0; bootstrap[i]; ++i ) {
+ if ( bootstrap[i]->available() ) {
+ audio = bootstrap[i]->create(idx);
+ if ( audio != NULL ) {
+ break;
+ }
+ }
+ }
+ }
+ if ( audio == NULL ) {
+ SDL_SetError("No available audio device");
+#if 0 /* Don't fail SDL_Init() if audio isn't available.
+ SDL_OpenAudio() will handle it at that point. *sigh*
+ */
+ return(-1);
+#endif
+ }
+ }
+ current_audio = audio;
+ if ( current_audio ) {
+ current_audio->name = bootstrap[i]->name;
+ if ( !current_audio->LockAudio && !current_audio->UnlockAudio ) {
+ current_audio->LockAudio = SDL_LockAudio_Default;
+ current_audio->UnlockAudio = SDL_UnlockAudio_Default;
+ }
+ }
+ return(0);
+}
+
+char *SDL_AudioDriverName(char *namebuf, int maxlen)
+{
+ if ( current_audio != NULL ) {
+ SDL_strlcpy(namebuf, current_audio->name, maxlen);
+ return(namebuf);
+ }
+ return(NULL);
+}
+
+int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained)
+{
+ SDL_AudioDevice *audio;
+ const char *env;
+
+ /* Start up the audio driver, if necessary */
+ if ( ! current_audio ) {
+ if ( (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) ||
+ (current_audio == NULL) ) {
+ return(-1);
+ }
+ }
+ audio = current_audio;
+
+ if (audio->opened) {
+ SDL_SetError("Audio device is already opened");
+ return(-1);
+ }
+
+ /* Verify some parameters */
+ if ( desired->freq == 0 ) {
+ env = SDL_getenv("SDL_AUDIO_FREQUENCY");
+ if ( env ) {
+ desired->freq = SDL_atoi(env);
+ }
+ }
+ if ( desired->freq == 0 ) {
+ /* Pick some default audio frequency */
+ desired->freq = 22050;
+ }
+ if ( desired->format == 0 ) {
+ env = SDL_getenv("SDL_AUDIO_FORMAT");
+ if ( env ) {
+ desired->format = SDL_ParseAudioFormat(env);
+ }
+ }
+ if ( desired->format == 0 ) {
+ /* Pick some default audio format */
+ desired->format = AUDIO_S16;
+ }
+ if ( desired->channels == 0 ) {
+ env = SDL_getenv("SDL_AUDIO_CHANNELS");
+ if ( env ) {
+ desired->channels = (Uint8)SDL_atoi(env);
+ }
+ }
+ if ( desired->channels == 0 ) {
+ /* Pick a default number of channels */
+ desired->channels = 2;
+ }
+ switch ( desired->channels ) {
+ case 1: /* Mono */
+ case 2: /* Stereo */
+ case 4: /* surround */
+ case 6: /* surround with center and lfe */
+ break;
+ default:
+ SDL_SetError("1 (mono) and 2 (stereo) channels supported");
+ return(-1);
+ }
+ if ( desired->samples == 0 ) {
+ env = SDL_getenv("SDL_AUDIO_SAMPLES");
+ if ( env ) {
+ desired->samples = (Uint16)SDL_atoi(env);
+ }
+ }
+ if ( desired->samples == 0 ) {
+ /* Pick a default of ~46 ms at desired frequency */
+ int samples = (desired->freq / 1000) * 46;
+ int power2 = 1;
+ while ( power2 < samples ) {
+ power2 *= 2;
+ }
+ desired->samples = power2;
+ }
+ if ( desired->callback == NULL ) {
+ SDL_SetError("SDL_OpenAudio() passed a NULL callback");
+ return(-1);
+ }
+
+#if SDL_THREADS_DISABLED
+ /* Uses interrupt driven audio, without thread */
+#else
+ /* Create a semaphore for locking the sound buffers */
+ audio->mixer_lock = SDL_CreateMutex();
+ if ( audio->mixer_lock == NULL ) {
+ SDL_SetError("Couldn't create mixer lock");
+ SDL_CloseAudio();
+ return(-1);
+ }
+#endif /* SDL_THREADS_DISABLED */
+
+ /* Calculate the silence and size of the audio specification */
+ SDL_CalculateAudioSpec(desired);
+
+ /* Open the audio subsystem */
+ SDL_memcpy(&audio->spec, desired, sizeof(audio->spec));
+ audio->convert.needed = 0;
+ audio->enabled = 1;
+ audio->paused = 1;
+
+ audio->opened = audio->OpenAudio(audio, &audio->spec)+1;
+
+ if ( ! audio->opened ) {
+ SDL_CloseAudio();
+ return(-1);
+ }
+
+ /* If the audio driver changes the buffer size, accept it */
+ if ( audio->spec.samples != desired->samples ) {
+ desired->samples = audio->spec.samples;
+ SDL_CalculateAudioSpec(desired);
+ }
+
+ /* Allocate a fake audio memory buffer */
+ audio->fake_stream = SDL_AllocAudioMem(audio->spec.size);
+ if ( audio->fake_stream == NULL ) {
+ SDL_CloseAudio();
+ SDL_OutOfMemory();
+ return(-1);
+ }
+
+ /* See if we need to do any conversion */
+ if ( obtained != NULL ) {
+ SDL_memcpy(obtained, &audio->spec, sizeof(audio->spec));
+ } else if ( desired->freq != audio->spec.freq ||
+ desired->format != audio->spec.format ||
+ desired->channels != audio->spec.channels ) {
+ /* Build an audio conversion block */
+ if ( SDL_BuildAudioCVT(&audio->convert,
+ desired->format, desired->channels,
+ desired->freq,
+ audio->spec.format, audio->spec.channels,
+ audio->spec.freq) < 0 ) {
+ SDL_CloseAudio();
+ return(-1);
+ }
+ if ( audio->convert.needed ) {
+ audio->convert.len = (int) ( ((double) audio->spec.size) /
+ audio->convert.len_ratio );
+ audio->convert.buf =(Uint8 *)SDL_AllocAudioMem(
+ audio->convert.len*audio->convert.len_mult);
+ if ( audio->convert.buf == NULL ) {
+ SDL_CloseAudio();
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ }
+ }
+
+ /* Start the audio thread if necessary */
+ switch (audio->opened) {
+ case 1:
+ /* Start the audio thread */
+#if (defined(__WIN32__) && !defined(_WIN32_WCE)) && !defined(HAVE_LIBC) && !defined(__SYMBIAN32__)
+#undef SDL_CreateThread
+ audio->thread = SDL_CreateThread(SDL_RunAudio, audio, NULL, NULL);
+#else
+ audio->thread = SDL_CreateThread(SDL_RunAudio, audio);
+#endif
+ if ( audio->thread == NULL ) {
+ SDL_CloseAudio();
+ SDL_SetError("Couldn't create audio thread");
+ return(-1);
+ }
+ break;
+
+ default:
+ /* The audio is now playing */
+ break;
+ }
+
+ return(0);
+}
+
+SDL_audiostatus SDL_GetAudioStatus(void)
+{
+ SDL_AudioDevice *audio = current_audio;
+ SDL_audiostatus status;
+
+ status = SDL_AUDIO_STOPPED;
+ if ( audio && audio->enabled ) {
+ if ( audio->paused ) {
+ status = SDL_AUDIO_PAUSED;
+ } else {
+ status = SDL_AUDIO_PLAYING;
+ }
+ }
+ return(status);
+}
+
+void SDL_PauseAudio (int pause_on)
+{
+ SDL_AudioDevice *audio = current_audio;
+
+ if ( audio ) {
+ audio->paused = pause_on;
+ }
+}
+
+void SDL_LockAudio (void)
+{
+ SDL_AudioDevice *audio = current_audio;
+
+ /* Obtain a lock on the mixing buffers */
+ if ( audio && audio->LockAudio ) {
+ audio->LockAudio(audio);
+ }
+}
+
+void SDL_UnlockAudio (void)
+{
+ SDL_AudioDevice *audio = current_audio;
+
+ /* Release lock on the mixing buffers */
+ if ( audio && audio->UnlockAudio ) {
+ audio->UnlockAudio(audio);
+ }
+}
+
+void SDL_CloseAudio (void)
+{
+ SDL_QuitSubSystem(SDL_INIT_AUDIO);
+}
+
+void SDL_AudioQuit(void)
+{
+ SDL_AudioDevice *audio = current_audio;
+
+ if ( audio ) {
+ audio->enabled = 0;
+ if ( audio->thread != NULL ) {
+ SDL_WaitThread(audio->thread, NULL);
+ }
+ if ( audio->mixer_lock != NULL ) {
+ SDL_DestroyMutex(audio->mixer_lock);
+ }
+ if ( audio->fake_stream != NULL ) {
+ SDL_FreeAudioMem(audio->fake_stream);
+ }
+ if ( audio->convert.needed ) {
+ SDL_FreeAudioMem(audio->convert.buf);
+
+ }
+ if ( audio->opened ) {
+ audio->CloseAudio(audio);
+ audio->opened = 0;
+ }
+ /* Free the driver data */
+ audio->free(audio);
+ current_audio = NULL;
+ }
+}
+
+#define NUM_FORMATS 6
+static int format_idx;
+static int format_idx_sub;
+static Uint16 format_list[NUM_FORMATS][NUM_FORMATS] = {
+ { AUDIO_U8, AUDIO_S8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB },
+ { AUDIO_S8, AUDIO_U8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB },
+ { AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_U8, AUDIO_S8 },
+ { AUDIO_S16MSB, AUDIO_S16LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_U8, AUDIO_S8 },
+ { AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U8, AUDIO_S8 },
+ { AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_S16MSB, AUDIO_S16LSB, AUDIO_U8, AUDIO_S8 },
+};
+
+Uint16 SDL_FirstAudioFormat(Uint16 format)
+{
+ for ( format_idx=0; format_idx < NUM_FORMATS; ++format_idx ) {
+ if ( format_list[format_idx][0] == format ) {
+ break;
+ }
+ }
+ format_idx_sub = 0;
+ return(SDL_NextAudioFormat());
+}
+
+Uint16 SDL_NextAudioFormat(void)
+{
+ if ( (format_idx == NUM_FORMATS) || (format_idx_sub == NUM_FORMATS) ) {
+ return(0);
+ }
+ return(format_list[format_idx][format_idx_sub++]);
+}
+
+void SDL_CalculateAudioSpec(SDL_AudioSpec *spec)
+{
+ switch (spec->format) {
+ case AUDIO_U8:
+ spec->silence = 0x80;
+ break;
+ default:
+ spec->silence = 0x00;
+ break;
+ }
+ spec->size = (spec->format&0xFF)/8;
+ spec->size *= spec->channels;
+ spec->size *= spec->samples;
+}
+
+void SDL_Audio_SetCaption(const char *caption)
+{
+ if ((current_audio) && (current_audio->SetCaption)) {
+ current_audio->SetCaption(current_audio, caption);
+ }
+}
+
diff --git a/distrib/sdl-1.2.15/src/audio/SDL_audio_c.h b/distrib/sdl-1.2.15/src/audio/SDL_audio_c.h
new file mode 100644
index 0000000..5fcf202
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/SDL_audio_c.h
@@ -0,0 +1,35 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Functions and variables exported from SDL_audio.c for SDL_sysaudio.c */
+
+/* Functions to get a list of "close" audio formats */
+extern Uint16 SDL_FirstAudioFormat(Uint16 format);
+extern Uint16 SDL_NextAudioFormat(void);
+
+/* Function to calculate the size and silence for a SDL_AudioSpec */
+extern void SDL_CalculateAudioSpec(SDL_AudioSpec *spec);
+
+/* The actual mixing thread function */
+extern int SDLCALL SDL_RunAudio(void *audiop);
+
diff --git a/distrib/sdl-1.2.15/src/audio/SDL_audiocvt.c b/distrib/sdl-1.2.15/src/audio/SDL_audiocvt.c
new file mode 100644
index 0000000..9b8fbcd
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/SDL_audiocvt.c
@@ -0,0 +1,1510 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Functions for audio drivers to perform runtime conversion of audio format */
+
+#include "SDL_audio.h"
+
+
+/* Effectively mix right and left channels into a single channel */
+void SDLCALL SDL_ConvertMono(SDL_AudioCVT *cvt, Uint16 format)
+{
+ int i;
+ Sint32 sample;
+
+#ifdef DEBUG_CONVERT
+ fprintf(stderr, "Converting to mono\n");
+#endif
+ switch (format&0x8018) {
+
+ case AUDIO_U8: {
+ Uint8 *src, *dst;
+
+ src = cvt->buf;
+ dst = cvt->buf;
+ for ( i=cvt->len_cvt/2; i; --i ) {
+ sample = src[0] + src[1];
+ *dst = (Uint8)(sample / 2);
+ src += 2;
+ dst += 1;
+ }
+ }
+ break;
+
+ case AUDIO_S8: {
+ Sint8 *src, *dst;
+
+ src = (Sint8 *)cvt->buf;
+ dst = (Sint8 *)cvt->buf;
+ for ( i=cvt->len_cvt/2; i; --i ) {
+ sample = src[0] + src[1];
+ *dst = (Sint8)(sample / 2);
+ src += 2;
+ dst += 1;
+ }
+ }
+ break;
+
+ case AUDIO_U16: {
+ Uint8 *src, *dst;
+
+ src = cvt->buf;
+ dst = cvt->buf;
+ if ( (format & 0x1000) == 0x1000 ) {
+ for ( i=cvt->len_cvt/4; i; --i ) {
+ sample = (Uint16)((src[0]<<8)|src[1])+
+ (Uint16)((src[2]<<8)|src[3]);
+ sample /= 2;
+ dst[1] = (sample&0xFF);
+ sample >>= 8;
+ dst[0] = (sample&0xFF);
+ src += 4;
+ dst += 2;
+ }
+ } else {
+ for ( i=cvt->len_cvt/4; i; --i ) {
+ sample = (Uint16)((src[1]<<8)|src[0])+
+ (Uint16)((src[3]<<8)|src[2]);
+ sample /= 2;
+ dst[0] = (sample&0xFF);
+ sample >>= 8;
+ dst[1] = (sample&0xFF);
+ src += 4;
+ dst += 2;
+ }
+ }
+ }
+ break;
+
+ case AUDIO_S16: {
+ Uint8 *src, *dst;
+
+ src = cvt->buf;
+ dst = cvt->buf;
+ if ( (format & 0x1000) == 0x1000 ) {
+ for ( i=cvt->len_cvt/4; i; --i ) {
+ sample = (Sint16)((src[0]<<8)|src[1])+
+ (Sint16)((src[2]<<8)|src[3]);
+ sample /= 2;
+ dst[1] = (sample&0xFF);
+ sample >>= 8;
+ dst[0] = (sample&0xFF);
+ src += 4;
+ dst += 2;
+ }
+ } else {
+ for ( i=cvt->len_cvt/4; i; --i ) {
+ sample = (Sint16)((src[1]<<8)|src[0])+
+ (Sint16)((src[3]<<8)|src[2]);
+ sample /= 2;
+ dst[0] = (sample&0xFF);
+ sample >>= 8;
+ dst[1] = (sample&0xFF);
+ src += 4;
+ dst += 2;
+ }
+ }
+ }
+ break;
+ }
+ cvt->len_cvt /= 2;
+ if ( cvt->filters[++cvt->filter_index] ) {
+ cvt->filters[cvt->filter_index](cvt, format);
+ }
+}
+
+/* Discard top 4 channels */
+void SDLCALL SDL_ConvertStrip(SDL_AudioCVT *cvt, Uint16 format)
+{
+ int i;
+ Sint32 lsample, rsample;
+
+#ifdef DEBUG_CONVERT
+ fprintf(stderr, "Converting down to stereo\n");
+#endif
+ switch (format&0x8018) {
+
+ case AUDIO_U8: {
+ Uint8 *src, *dst;
+
+ src = cvt->buf;
+ dst = cvt->buf;
+ for ( i=cvt->len_cvt/6; i; --i ) {
+ dst[0] = src[0];
+ dst[1] = src[1];
+ src += 6;
+ dst += 2;
+ }
+ }
+ break;
+
+ case AUDIO_S8: {
+ Sint8 *src, *dst;
+
+ src = (Sint8 *)cvt->buf;
+ dst = (Sint8 *)cvt->buf;
+ for ( i=cvt->len_cvt/6; i; --i ) {
+ dst[0] = src[0];
+ dst[1] = src[1];
+ src += 6;
+ dst += 2;
+ }
+ }
+ break;
+
+ case AUDIO_U16: {
+ Uint8 *src, *dst;
+
+ src = cvt->buf;
+ dst = cvt->buf;
+ if ( (format & 0x1000) == 0x1000 ) {
+ for ( i=cvt->len_cvt/12; i; --i ) {
+ lsample = (Uint16)((src[0]<<8)|src[1]);
+ rsample = (Uint16)((src[2]<<8)|src[3]);
+ dst[1] = (lsample&0xFF);
+ lsample >>= 8;
+ dst[0] = (lsample&0xFF);
+ dst[3] = (rsample&0xFF);
+ rsample >>= 8;
+ dst[2] = (rsample&0xFF);
+ src += 12;
+ dst += 4;
+ }
+ } else {
+ for ( i=cvt->len_cvt/12; i; --i ) {
+ lsample = (Uint16)((src[1]<<8)|src[0]);
+ rsample = (Uint16)((src[3]<<8)|src[2]);
+ dst[0] = (lsample&0xFF);
+ lsample >>= 8;
+ dst[1] = (lsample&0xFF);
+ dst[2] = (rsample&0xFF);
+ rsample >>= 8;
+ dst[3] = (rsample&0xFF);
+ src += 12;
+ dst += 4;
+ }
+ }
+ }
+ break;
+
+ case AUDIO_S16: {
+ Uint8 *src, *dst;
+
+ src = cvt->buf;
+ dst = cvt->buf;
+ if ( (format & 0x1000) == 0x1000 ) {
+ for ( i=cvt->len_cvt/12; i; --i ) {
+ lsample = (Sint16)((src[0]<<8)|src[1]);
+ rsample = (Sint16)((src[2]<<8)|src[3]);
+ dst[1] = (lsample&0xFF);
+ lsample >>= 8;
+ dst[0] = (lsample&0xFF);
+ dst[3] = (rsample&0xFF);
+ rsample >>= 8;
+ dst[2] = (rsample&0xFF);
+ src += 12;
+ dst += 4;
+ }
+ } else {
+ for ( i=cvt->len_cvt/12; i; --i ) {
+ lsample = (Sint16)((src[1]<<8)|src[0]);
+ rsample = (Sint16)((src[3]<<8)|src[2]);
+ dst[0] = (lsample&0xFF);
+ lsample >>= 8;
+ dst[1] = (lsample&0xFF);
+ dst[2] = (rsample&0xFF);
+ rsample >>= 8;
+ dst[3] = (rsample&0xFF);
+ src += 12;
+ dst += 4;
+ }
+ }
+ }
+ break;
+ }
+ cvt->len_cvt /= 3;
+ if ( cvt->filters[++cvt->filter_index] ) {
+ cvt->filters[cvt->filter_index](cvt, format);
+ }
+}
+
+
+/* Discard top 2 channels of 6 */
+void SDLCALL SDL_ConvertStrip_2(SDL_AudioCVT *cvt, Uint16 format)
+{
+ int i;
+ Sint32 lsample, rsample;
+
+#ifdef DEBUG_CONVERT
+ fprintf(stderr, "Converting 6 down to quad\n");
+#endif
+ switch (format&0x8018) {
+
+ case AUDIO_U8: {
+ Uint8 *src, *dst;
+
+ src = cvt->buf;
+ dst = cvt->buf;
+ for ( i=cvt->len_cvt/4; i; --i ) {
+ dst[0] = src[0];
+ dst[1] = src[1];
+ src += 4;
+ dst += 2;
+ }
+ }
+ break;
+
+ case AUDIO_S8: {
+ Sint8 *src, *dst;
+
+ src = (Sint8 *)cvt->buf;
+ dst = (Sint8 *)cvt->buf;
+ for ( i=cvt->len_cvt/4; i; --i ) {
+ dst[0] = src[0];
+ dst[1] = src[1];
+ src += 4;
+ dst += 2;
+ }
+ }
+ break;
+
+ case AUDIO_U16: {
+ Uint8 *src, *dst;
+
+ src = cvt->buf;
+ dst = cvt->buf;
+ if ( (format & 0x1000) == 0x1000 ) {
+ for ( i=cvt->len_cvt/8; i; --i ) {
+ lsample = (Uint16)((src[0]<<8)|src[1]);
+ rsample = (Uint16)((src[2]<<8)|src[3]);
+ dst[1] = (lsample&0xFF);
+ lsample >>= 8;
+ dst[0] = (lsample&0xFF);
+ dst[3] = (rsample&0xFF);
+ rsample >>= 8;
+ dst[2] = (rsample&0xFF);
+ src += 8;
+ dst += 4;
+ }
+ } else {
+ for ( i=cvt->len_cvt/8; i; --i ) {
+ lsample = (Uint16)((src[1]<<8)|src[0]);
+ rsample = (Uint16)((src[3]<<8)|src[2]);
+ dst[0] = (lsample&0xFF);
+ lsample >>= 8;
+ dst[1] = (lsample&0xFF);
+ dst[2] = (rsample&0xFF);
+ rsample >>= 8;
+ dst[3] = (rsample&0xFF);
+ src += 8;
+ dst += 4;
+ }
+ }
+ }
+ break;
+
+ case AUDIO_S16: {
+ Uint8 *src, *dst;
+
+ src = cvt->buf;
+ dst = cvt->buf;
+ if ( (format & 0x1000) == 0x1000 ) {
+ for ( i=cvt->len_cvt/8; i; --i ) {
+ lsample = (Sint16)((src[0]<<8)|src[1]);
+ rsample = (Sint16)((src[2]<<8)|src[3]);
+ dst[1] = (lsample&0xFF);
+ lsample >>= 8;
+ dst[0] = (lsample&0xFF);
+ dst[3] = (rsample&0xFF);
+ rsample >>= 8;
+ dst[2] = (rsample&0xFF);
+ src += 8;
+ dst += 4;
+ }
+ } else {
+ for ( i=cvt->len_cvt/8; i; --i ) {
+ lsample = (Sint16)((src[1]<<8)|src[0]);
+ rsample = (Sint16)((src[3]<<8)|src[2]);
+ dst[0] = (lsample&0xFF);
+ lsample >>= 8;
+ dst[1] = (lsample&0xFF);
+ dst[2] = (rsample&0xFF);
+ rsample >>= 8;
+ dst[3] = (rsample&0xFF);
+ src += 8;
+ dst += 4;
+ }
+ }
+ }
+ break;
+ }
+ cvt->len_cvt /= 2;
+ if ( cvt->filters[++cvt->filter_index] ) {
+ cvt->filters[cvt->filter_index](cvt, format);
+ }
+}
+
+/* Duplicate a mono channel to both stereo channels */
+void SDLCALL SDL_ConvertStereo(SDL_AudioCVT *cvt, Uint16 format)
+{
+ int i;
+
+#ifdef DEBUG_CONVERT
+ fprintf(stderr, "Converting to stereo\n");
+#endif
+ if ( (format & 0xFF) == 16 ) {
+ Uint16 *src, *dst;
+
+ src = (Uint16 *)(cvt->buf+cvt->len_cvt);
+ dst = (Uint16 *)(cvt->buf+cvt->len_cvt*2);
+ for ( i=cvt->len_cvt/2; i; --i ) {
+ dst -= 2;
+ src -= 1;
+ dst[0] = src[0];
+ dst[1] = src[0];
+ }
+ } else {
+ Uint8 *src, *dst;
+
+ src = cvt->buf+cvt->len_cvt;
+ dst = cvt->buf+cvt->len_cvt*2;
+ for ( i=cvt->len_cvt; i; --i ) {
+ dst -= 2;
+ src -= 1;
+ dst[0] = src[0];
+ dst[1] = src[0];
+ }
+ }
+ cvt->len_cvt *= 2;
+ if ( cvt->filters[++cvt->filter_index] ) {
+ cvt->filters[cvt->filter_index](cvt, format);
+ }
+}
+
+
+/* Duplicate a stereo channel to a pseudo-5.1 stream */
+void SDLCALL SDL_ConvertSurround(SDL_AudioCVT *cvt, Uint16 format)
+{
+ int i;
+
+#ifdef DEBUG_CONVERT
+ fprintf(stderr, "Converting stereo to surround\n");
+#endif
+ switch (format&0x8018) {
+
+ case AUDIO_U8: {
+ Uint8 *src, *dst, lf, rf, ce;
+
+ src = (Uint8 *)(cvt->buf+cvt->len_cvt);
+ dst = (Uint8 *)(cvt->buf+cvt->len_cvt*3);
+ for ( i=cvt->len_cvt; i; --i ) {
+ dst -= 6;
+ src -= 2;
+ lf = src[0];
+ rf = src[1];
+ ce = (lf/2) + (rf/2);
+ dst[0] = lf;
+ dst[1] = rf;
+ dst[2] = lf - ce;
+ dst[3] = rf - ce;
+ dst[4] = ce;
+ dst[5] = ce;
+ }
+ }
+ break;
+
+ case AUDIO_S8: {
+ Sint8 *src, *dst, lf, rf, ce;
+
+ src = (Sint8 *)cvt->buf+cvt->len_cvt;
+ dst = (Sint8 *)cvt->buf+cvt->len_cvt*3;
+ for ( i=cvt->len_cvt; i; --i ) {
+ dst -= 6;
+ src -= 2;
+ lf = src[0];
+ rf = src[1];
+ ce = (lf/2) + (rf/2);
+ dst[0] = lf;
+ dst[1] = rf;
+ dst[2] = lf - ce;
+ dst[3] = rf - ce;
+ dst[4] = ce;
+ dst[5] = ce;
+ }
+ }
+ break;
+
+ case AUDIO_U16: {
+ Uint8 *src, *dst;
+ Uint16 lf, rf, ce, lr, rr;
+
+ src = cvt->buf+cvt->len_cvt;
+ dst = cvt->buf+cvt->len_cvt*3;
+
+ if ( (format & 0x1000) == 0x1000 ) {
+ for ( i=cvt->len_cvt/4; i; --i ) {
+ dst -= 12;
+ src -= 4;
+ lf = (Uint16)((src[0]<<8)|src[1]);
+ rf = (Uint16)((src[2]<<8)|src[3]);
+ ce = (lf/2) + (rf/2);
+ rr = lf - ce;
+ lr = rf - ce;
+ dst[1] = (lf&0xFF);
+ dst[0] = ((lf>>8)&0xFF);
+ dst[3] = (rf&0xFF);
+ dst[2] = ((rf>>8)&0xFF);
+
+ dst[1+4] = (lr&0xFF);
+ dst[0+4] = ((lr>>8)&0xFF);
+ dst[3+4] = (rr&0xFF);
+ dst[2+4] = ((rr>>8)&0xFF);
+
+ dst[1+8] = (ce&0xFF);
+ dst[0+8] = ((ce>>8)&0xFF);
+ dst[3+8] = (ce&0xFF);
+ dst[2+8] = ((ce>>8)&0xFF);
+ }
+ } else {
+ for ( i=cvt->len_cvt/4; i; --i ) {
+ dst -= 12;
+ src -= 4;
+ lf = (Uint16)((src[1]<<8)|src[0]);
+ rf = (Uint16)((src[3]<<8)|src[2]);
+ ce = (lf/2) + (rf/2);
+ rr = lf - ce;
+ lr = rf - ce;
+ dst[0] = (lf&0xFF);
+ dst[1] = ((lf>>8)&0xFF);
+ dst[2] = (rf&0xFF);
+ dst[3] = ((rf>>8)&0xFF);
+
+ dst[0+4] = (lr&0xFF);
+ dst[1+4] = ((lr>>8)&0xFF);
+ dst[2+4] = (rr&0xFF);
+ dst[3+4] = ((rr>>8)&0xFF);
+
+ dst[0+8] = (ce&0xFF);
+ dst[1+8] = ((ce>>8)&0xFF);
+ dst[2+8] = (ce&0xFF);
+ dst[3+8] = ((ce>>8)&0xFF);
+ }
+ }
+ }
+ break;
+
+ case AUDIO_S16: {
+ Uint8 *src, *dst;
+ Sint16 lf, rf, ce, lr, rr;
+
+ src = cvt->buf+cvt->len_cvt;
+ dst = cvt->buf+cvt->len_cvt*3;
+
+ if ( (format & 0x1000) == 0x1000 ) {
+ for ( i=cvt->len_cvt/4; i; --i ) {
+ dst -= 12;
+ src -= 4;
+ lf = (Sint16)((src[0]<<8)|src[1]);
+ rf = (Sint16)((src[2]<<8)|src[3]);
+ ce = (lf/2) + (rf/2);
+ rr = lf - ce;
+ lr = rf - ce;
+ dst[1] = (lf&0xFF);
+ dst[0] = ((lf>>8)&0xFF);
+ dst[3] = (rf&0xFF);
+ dst[2] = ((rf>>8)&0xFF);
+
+ dst[1+4] = (lr&0xFF);
+ dst[0+4] = ((lr>>8)&0xFF);
+ dst[3+4] = (rr&0xFF);
+ dst[2+4] = ((rr>>8)&0xFF);
+
+ dst[1+8] = (ce&0xFF);
+ dst[0+8] = ((ce>>8)&0xFF);
+ dst[3+8] = (ce&0xFF);
+ dst[2+8] = ((ce>>8)&0xFF);
+ }
+ } else {
+ for ( i=cvt->len_cvt/4; i; --i ) {
+ dst -= 12;
+ src -= 4;
+ lf = (Sint16)((src[1]<<8)|src[0]);
+ rf = (Sint16)((src[3]<<8)|src[2]);
+ ce = (lf/2) + (rf/2);
+ rr = lf - ce;
+ lr = rf - ce;
+ dst[0] = (lf&0xFF);
+ dst[1] = ((lf>>8)&0xFF);
+ dst[2] = (rf&0xFF);
+ dst[3] = ((rf>>8)&0xFF);
+
+ dst[0+4] = (lr&0xFF);
+ dst[1+4] = ((lr>>8)&0xFF);
+ dst[2+4] = (rr&0xFF);
+ dst[3+4] = ((rr>>8)&0xFF);
+
+ dst[0+8] = (ce&0xFF);
+ dst[1+8] = ((ce>>8)&0xFF);
+ dst[2+8] = (ce&0xFF);
+ dst[3+8] = ((ce>>8)&0xFF);
+ }
+ }
+ }
+ break;
+ }
+ cvt->len_cvt *= 3;
+ if ( cvt->filters[++cvt->filter_index] ) {
+ cvt->filters[cvt->filter_index](cvt, format);
+ }
+}
+
+
+/* Duplicate a stereo channel to a pseudo-4.0 stream */
+void SDLCALL SDL_ConvertSurround_4(SDL_AudioCVT *cvt, Uint16 format)
+{
+ int i;
+
+#ifdef DEBUG_CONVERT
+ fprintf(stderr, "Converting stereo to quad\n");
+#endif
+ switch (format&0x8018) {
+
+ case AUDIO_U8: {
+ Uint8 *src, *dst, lf, rf, ce;
+
+ src = (Uint8 *)(cvt->buf+cvt->len_cvt);
+ dst = (Uint8 *)(cvt->buf+cvt->len_cvt*2);
+ for ( i=cvt->len_cvt; i; --i ) {
+ dst -= 4;
+ src -= 2;
+ lf = src[0];
+ rf = src[1];
+ ce = (lf/2) + (rf/2);
+ dst[0] = lf;
+ dst[1] = rf;
+ dst[2] = lf - ce;
+ dst[3] = rf - ce;
+ }
+ }
+ break;
+
+ case AUDIO_S8: {
+ Sint8 *src, *dst, lf, rf, ce;
+
+ src = (Sint8 *)cvt->buf+cvt->len_cvt;
+ dst = (Sint8 *)cvt->buf+cvt->len_cvt*2;
+ for ( i=cvt->len_cvt; i; --i ) {
+ dst -= 4;
+ src -= 2;
+ lf = src[0];
+ rf = src[1];
+ ce = (lf/2) + (rf/2);
+ dst[0] = lf;
+ dst[1] = rf;
+ dst[2] = lf - ce;
+ dst[3] = rf - ce;
+ }
+ }
+ break;
+
+ case AUDIO_U16: {
+ Uint8 *src, *dst;
+ Uint16 lf, rf, ce, lr, rr;
+
+ src = cvt->buf+cvt->len_cvt;
+ dst = cvt->buf+cvt->len_cvt*2;
+
+ if ( (format & 0x1000) == 0x1000 ) {
+ for ( i=cvt->len_cvt/4; i; --i ) {
+ dst -= 8;
+ src -= 4;
+ lf = (Uint16)((src[0]<<8)|src[1]);
+ rf = (Uint16)((src[2]<<8)|src[3]);
+ ce = (lf/2) + (rf/2);
+ rr = lf - ce;
+ lr = rf - ce;
+ dst[1] = (lf&0xFF);
+ dst[0] = ((lf>>8)&0xFF);
+ dst[3] = (rf&0xFF);
+ dst[2] = ((rf>>8)&0xFF);
+
+ dst[1+4] = (lr&0xFF);
+ dst[0+4] = ((lr>>8)&0xFF);
+ dst[3+4] = (rr&0xFF);
+ dst[2+4] = ((rr>>8)&0xFF);
+ }
+ } else {
+ for ( i=cvt->len_cvt/4; i; --i ) {
+ dst -= 8;
+ src -= 4;
+ lf = (Uint16)((src[1]<<8)|src[0]);
+ rf = (Uint16)((src[3]<<8)|src[2]);
+ ce = (lf/2) + (rf/2);
+ rr = lf - ce;
+ lr = rf - ce;
+ dst[0] = (lf&0xFF);
+ dst[1] = ((lf>>8)&0xFF);
+ dst[2] = (rf&0xFF);
+ dst[3] = ((rf>>8)&0xFF);
+
+ dst[0+4] = (lr&0xFF);
+ dst[1+4] = ((lr>>8)&0xFF);
+ dst[2+4] = (rr&0xFF);
+ dst[3+4] = ((rr>>8)&0xFF);
+ }
+ }
+ }
+ break;
+
+ case AUDIO_S16: {
+ Uint8 *src, *dst;
+ Sint16 lf, rf, ce, lr, rr;
+
+ src = cvt->buf+cvt->len_cvt;
+ dst = cvt->buf+cvt->len_cvt*2;
+
+ if ( (format & 0x1000) == 0x1000 ) {
+ for ( i=cvt->len_cvt/4; i; --i ) {
+ dst -= 8;
+ src -= 4;
+ lf = (Sint16)((src[0]<<8)|src[1]);
+ rf = (Sint16)((src[2]<<8)|src[3]);
+ ce = (lf/2) + (rf/2);
+ rr = lf - ce;
+ lr = rf - ce;
+ dst[1] = (lf&0xFF);
+ dst[0] = ((lf>>8)&0xFF);
+ dst[3] = (rf&0xFF);
+ dst[2] = ((rf>>8)&0xFF);
+
+ dst[1+4] = (lr&0xFF);
+ dst[0+4] = ((lr>>8)&0xFF);
+ dst[3+4] = (rr&0xFF);
+ dst[2+4] = ((rr>>8)&0xFF);
+ }
+ } else {
+ for ( i=cvt->len_cvt/4; i; --i ) {
+ dst -= 8;
+ src -= 4;
+ lf = (Sint16)((src[1]<<8)|src[0]);
+ rf = (Sint16)((src[3]<<8)|src[2]);
+ ce = (lf/2) + (rf/2);
+ rr = lf - ce;
+ lr = rf - ce;
+ dst[0] = (lf&0xFF);
+ dst[1] = ((lf>>8)&0xFF);
+ dst[2] = (rf&0xFF);
+ dst[3] = ((rf>>8)&0xFF);
+
+ dst[0+4] = (lr&0xFF);
+ dst[1+4] = ((lr>>8)&0xFF);
+ dst[2+4] = (rr&0xFF);
+ dst[3+4] = ((rr>>8)&0xFF);
+ }
+ }
+ }
+ break;
+ }
+ cvt->len_cvt *= 2;
+ if ( cvt->filters[++cvt->filter_index] ) {
+ cvt->filters[cvt->filter_index](cvt, format);
+ }
+}
+
+
+/* Convert 8-bit to 16-bit - LSB */
+void SDLCALL SDL_Convert16LSB(SDL_AudioCVT *cvt, Uint16 format)
+{
+ int i;
+ Uint8 *src, *dst;
+
+#ifdef DEBUG_CONVERT
+ fprintf(stderr, "Converting to 16-bit LSB\n");
+#endif
+ src = cvt->buf+cvt->len_cvt;
+ dst = cvt->buf+cvt->len_cvt*2;
+ for ( i=cvt->len_cvt; i; --i ) {
+ src -= 1;
+ dst -= 2;
+ dst[1] = *src;
+ dst[0] = 0;
+ }
+ format = ((format & ~0x0008) | AUDIO_U16LSB);
+ cvt->len_cvt *= 2;
+ if ( cvt->filters[++cvt->filter_index] ) {
+ cvt->filters[cvt->filter_index](cvt, format);
+ }
+}
+/* Convert 8-bit to 16-bit - MSB */
+void SDLCALL SDL_Convert16MSB(SDL_AudioCVT *cvt, Uint16 format)
+{
+ int i;
+ Uint8 *src, *dst;
+
+#ifdef DEBUG_CONVERT
+ fprintf(stderr, "Converting to 16-bit MSB\n");
+#endif
+ src = cvt->buf+cvt->len_cvt;
+ dst = cvt->buf+cvt->len_cvt*2;
+ for ( i=cvt->len_cvt; i; --i ) {
+ src -= 1;
+ dst -= 2;
+ dst[0] = *src;
+ dst[1] = 0;
+ }
+ format = ((format & ~0x0008) | AUDIO_U16MSB);
+ cvt->len_cvt *= 2;
+ if ( cvt->filters[++cvt->filter_index] ) {
+ cvt->filters[cvt->filter_index](cvt, format);
+ }
+}
+
+/* Convert 16-bit to 8-bit */
+void SDLCALL SDL_Convert8(SDL_AudioCVT *cvt, Uint16 format)
+{
+ int i;
+ Uint8 *src, *dst;
+
+#ifdef DEBUG_CONVERT
+ fprintf(stderr, "Converting to 8-bit\n");
+#endif
+ src = cvt->buf;
+ dst = cvt->buf;
+ if ( (format & 0x1000) != 0x1000 ) { /* Little endian */
+ ++src;
+ }
+ for ( i=cvt->len_cvt/2; i; --i ) {
+ *dst = *src;
+ src += 2;
+ dst += 1;
+ }
+ format = ((format & ~0x9010) | AUDIO_U8);
+ cvt->len_cvt /= 2;
+ if ( cvt->filters[++cvt->filter_index] ) {
+ cvt->filters[cvt->filter_index](cvt, format);
+ }
+}
+
+/* Toggle signed/unsigned */
+void SDLCALL SDL_ConvertSign(SDL_AudioCVT *cvt, Uint16 format)
+{
+ int i;
+ Uint8 *data;
+
+#ifdef DEBUG_CONVERT
+ fprintf(stderr, "Converting audio signedness\n");
+#endif
+ data = cvt->buf;
+ if ( (format & 0xFF) == 16 ) {
+ if ( (format & 0x1000) != 0x1000 ) { /* Little endian */
+ ++data;
+ }
+ for ( i=cvt->len_cvt/2; i; --i ) {
+ *data ^= 0x80;
+ data += 2;
+ }
+ } else {
+ for ( i=cvt->len_cvt; i; --i ) {
+ *data++ ^= 0x80;
+ }
+ }
+ format = (format ^ 0x8000);
+ if ( cvt->filters[++cvt->filter_index] ) {
+ cvt->filters[cvt->filter_index](cvt, format);
+ }
+}
+
+/* Toggle endianness */
+void SDLCALL SDL_ConvertEndian(SDL_AudioCVT *cvt, Uint16 format)
+{
+ int i;
+ Uint8 *data, tmp;
+
+#ifdef DEBUG_CONVERT
+ fprintf(stderr, "Converting audio endianness\n");
+#endif
+ data = cvt->buf;
+ for ( i=cvt->len_cvt/2; i; --i ) {
+ tmp = data[0];
+ data[0] = data[1];
+ data[1] = tmp;
+ data += 2;
+ }
+ format = (format ^ 0x1000);
+ if ( cvt->filters[++cvt->filter_index] ) {
+ cvt->filters[cvt->filter_index](cvt, format);
+ }
+}
+
+/* Convert rate up by multiple of 2 */
+void SDLCALL SDL_RateMUL2(SDL_AudioCVT *cvt, Uint16 format)
+{
+ int i;
+ Uint8 *src, *dst;
+
+#ifdef DEBUG_CONVERT
+ fprintf(stderr, "Converting audio rate * 2\n");
+#endif
+ src = cvt->buf+cvt->len_cvt;
+ dst = cvt->buf+cvt->len_cvt*2;
+ switch (format & 0xFF) {
+ case 8:
+ for ( i=cvt->len_cvt; i; --i ) {
+ src -= 1;
+ dst -= 2;
+ dst[0] = src[0];
+ dst[1] = src[0];
+ }
+ break;
+ case 16:
+ for ( i=cvt->len_cvt/2; i; --i ) {
+ src -= 2;
+ dst -= 4;
+ dst[0] = src[0];
+ dst[1] = src[1];
+ dst[2] = src[0];
+ dst[3] = src[1];
+ }
+ break;
+ }
+ cvt->len_cvt *= 2;
+ if ( cvt->filters[++cvt->filter_index] ) {
+ cvt->filters[cvt->filter_index](cvt, format);
+ }
+}
+
+
+/* Convert rate up by multiple of 2, for stereo */
+void SDLCALL SDL_RateMUL2_c2(SDL_AudioCVT *cvt, Uint16 format)
+{
+ int i;
+ Uint8 *src, *dst;
+
+#ifdef DEBUG_CONVERT
+ fprintf(stderr, "Converting audio rate * 2\n");
+#endif
+ src = cvt->buf+cvt->len_cvt;
+ dst = cvt->buf+cvt->len_cvt*2;
+ switch (format & 0xFF) {
+ case 8:
+ for ( i=cvt->len_cvt/2; i; --i ) {
+ src -= 2;
+ dst -= 4;
+ dst[0] = src[0];
+ dst[1] = src[1];
+ dst[2] = src[0];
+ dst[3] = src[1];
+ }
+ break;
+ case 16:
+ for ( i=cvt->len_cvt/4; i; --i ) {
+ src -= 4;
+ dst -= 8;
+ dst[0] = src[0];
+ dst[1] = src[1];
+ dst[2] = src[2];
+ dst[3] = src[3];
+ dst[4] = src[0];
+ dst[5] = src[1];
+ dst[6] = src[2];
+ dst[7] = src[3];
+ }
+ break;
+ }
+ cvt->len_cvt *= 2;
+ if ( cvt->filters[++cvt->filter_index] ) {
+ cvt->filters[cvt->filter_index](cvt, format);
+ }
+}
+
+/* Convert rate up by multiple of 2, for quad */
+void SDLCALL SDL_RateMUL2_c4(SDL_AudioCVT *cvt, Uint16 format)
+{
+ int i;
+ Uint8 *src, *dst;
+
+#ifdef DEBUG_CONVERT
+ fprintf(stderr, "Converting audio rate * 2\n");
+#endif
+ src = cvt->buf+cvt->len_cvt;
+ dst = cvt->buf+cvt->len_cvt*2;
+ switch (format & 0xFF) {
+ case 8:
+ for ( i=cvt->len_cvt/4; i; --i ) {
+ src -= 4;
+ dst -= 8;
+ dst[0] = src[0];
+ dst[1] = src[1];
+ dst[2] = src[2];
+ dst[3] = src[3];
+ dst[4] = src[0];
+ dst[5] = src[1];
+ dst[6] = src[2];
+ dst[7] = src[3];
+ }
+ break;
+ case 16:
+ for ( i=cvt->len_cvt/8; i; --i ) {
+ src -= 8;
+ dst -= 16;
+ dst[0] = src[0];
+ dst[1] = src[1];
+ dst[2] = src[2];
+ dst[3] = src[3];
+ dst[4] = src[4];
+ dst[5] = src[5];
+ dst[6] = src[6];
+ dst[7] = src[7];
+ dst[8] = src[0];
+ dst[9] = src[1];
+ dst[10] = src[2];
+ dst[11] = src[3];
+ dst[12] = src[4];
+ dst[13] = src[5];
+ dst[14] = src[6];
+ dst[15] = src[7];
+ }
+ break;
+ }
+ cvt->len_cvt *= 2;
+ if ( cvt->filters[++cvt->filter_index] ) {
+ cvt->filters[cvt->filter_index](cvt, format);
+ }
+}
+
+
+/* Convert rate up by multiple of 2, for 5.1 */
+void SDLCALL SDL_RateMUL2_c6(SDL_AudioCVT *cvt, Uint16 format)
+{
+ int i;
+ Uint8 *src, *dst;
+
+#ifdef DEBUG_CONVERT
+ fprintf(stderr, "Converting audio rate * 2\n");
+#endif
+ src = cvt->buf+cvt->len_cvt;
+ dst = cvt->buf+cvt->len_cvt*2;
+ switch (format & 0xFF) {
+ case 8:
+ for ( i=cvt->len_cvt/6; i; --i ) {
+ src -= 6;
+ dst -= 12;
+ dst[0] = src[0];
+ dst[1] = src[1];
+ dst[2] = src[2];
+ dst[3] = src[3];
+ dst[4] = src[4];
+ dst[5] = src[5];
+ dst[6] = src[0];
+ dst[7] = src[1];
+ dst[8] = src[2];
+ dst[9] = src[3];
+ dst[10] = src[4];
+ dst[11] = src[5];
+ }
+ break;
+ case 16:
+ for ( i=cvt->len_cvt/12; i; --i ) {
+ src -= 12;
+ dst -= 24;
+ dst[0] = src[0];
+ dst[1] = src[1];
+ dst[2] = src[2];
+ dst[3] = src[3];
+ dst[4] = src[4];
+ dst[5] = src[5];
+ dst[6] = src[6];
+ dst[7] = src[7];
+ dst[8] = src[8];
+ dst[9] = src[9];
+ dst[10] = src[10];
+ dst[11] = src[11];
+ dst[12] = src[0];
+ dst[13] = src[1];
+ dst[14] = src[2];
+ dst[15] = src[3];
+ dst[16] = src[4];
+ dst[17] = src[5];
+ dst[18] = src[6];
+ dst[19] = src[7];
+ dst[20] = src[8];
+ dst[21] = src[9];
+ dst[22] = src[10];
+ dst[23] = src[11];
+ }
+ break;
+ }
+ cvt->len_cvt *= 2;
+ if ( cvt->filters[++cvt->filter_index] ) {
+ cvt->filters[cvt->filter_index](cvt, format);
+ }
+}
+
+/* Convert rate down by multiple of 2 */
+void SDLCALL SDL_RateDIV2(SDL_AudioCVT *cvt, Uint16 format)
+{
+ int i;
+ Uint8 *src, *dst;
+
+#ifdef DEBUG_CONVERT
+ fprintf(stderr, "Converting audio rate / 2\n");
+#endif
+ src = cvt->buf;
+ dst = cvt->buf;
+ switch (format & 0xFF) {
+ case 8:
+ for ( i=cvt->len_cvt/2; i; --i ) {
+ dst[0] = src[0];
+ src += 2;
+ dst += 1;
+ }
+ break;
+ case 16:
+ for ( i=cvt->len_cvt/4; i; --i ) {
+ dst[0] = src[0];
+ dst[1] = src[1];
+ src += 4;
+ dst += 2;
+ }
+ break;
+ }
+ cvt->len_cvt /= 2;
+ if ( cvt->filters[++cvt->filter_index] ) {
+ cvt->filters[cvt->filter_index](cvt, format);
+ }
+}
+
+
+/* Convert rate down by multiple of 2, for stereo */
+void SDLCALL SDL_RateDIV2_c2(SDL_AudioCVT *cvt, Uint16 format)
+{
+ int i;
+ Uint8 *src, *dst;
+
+#ifdef DEBUG_CONVERT
+ fprintf(stderr, "Converting audio rate / 2\n");
+#endif
+ src = cvt->buf;
+ dst = cvt->buf;
+ switch (format & 0xFF) {
+ case 8:
+ for ( i=cvt->len_cvt/4; i; --i ) {
+ dst[0] = src[0];
+ dst[1] = src[1];
+ src += 4;
+ dst += 2;
+ }
+ break;
+ case 16:
+ for ( i=cvt->len_cvt/8; i; --i ) {
+ dst[0] = src[0];
+ dst[1] = src[1];
+ dst[2] = src[2];
+ dst[3] = src[3];
+ src += 8;
+ dst += 4;
+ }
+ break;
+ }
+ cvt->len_cvt /= 2;
+ if ( cvt->filters[++cvt->filter_index] ) {
+ cvt->filters[cvt->filter_index](cvt, format);
+ }
+}
+
+
+/* Convert rate down by multiple of 2, for quad */
+void SDLCALL SDL_RateDIV2_c4(SDL_AudioCVT *cvt, Uint16 format)
+{
+ int i;
+ Uint8 *src, *dst;
+
+#ifdef DEBUG_CONVERT
+ fprintf(stderr, "Converting audio rate / 2\n");
+#endif
+ src = cvt->buf;
+ dst = cvt->buf;
+ switch (format & 0xFF) {
+ case 8:
+ for ( i=cvt->len_cvt/8; i; --i ) {
+ dst[0] = src[0];
+ dst[1] = src[1];
+ dst[2] = src[2];
+ dst[3] = src[3];
+ src += 8;
+ dst += 4;
+ }
+ break;
+ case 16:
+ for ( i=cvt->len_cvt/16; i; --i ) {
+ dst[0] = src[0];
+ dst[1] = src[1];
+ dst[2] = src[2];
+ dst[3] = src[3];
+ dst[4] = src[4];
+ dst[5] = src[5];
+ dst[6] = src[6];
+ dst[7] = src[7];
+ src += 16;
+ dst += 8;
+ }
+ break;
+ }
+ cvt->len_cvt /= 2;
+ if ( cvt->filters[++cvt->filter_index] ) {
+ cvt->filters[cvt->filter_index](cvt, format);
+ }
+}
+
+/* Convert rate down by multiple of 2, for 5.1 */
+void SDLCALL SDL_RateDIV2_c6(SDL_AudioCVT *cvt, Uint16 format)
+{
+ int i;
+ Uint8 *src, *dst;
+
+#ifdef DEBUG_CONVERT
+ fprintf(stderr, "Converting audio rate / 2\n");
+#endif
+ src = cvt->buf;
+ dst = cvt->buf;
+ switch (format & 0xFF) {
+ case 8:
+ for ( i=cvt->len_cvt/12; i; --i ) {
+ dst[0] = src[0];
+ dst[1] = src[1];
+ dst[2] = src[2];
+ dst[3] = src[3];
+ dst[4] = src[4];
+ dst[5] = src[5];
+ src += 12;
+ dst += 6;
+ }
+ break;
+ case 16:
+ for ( i=cvt->len_cvt/24; i; --i ) {
+ dst[0] = src[0];
+ dst[1] = src[1];
+ dst[2] = src[2];
+ dst[3] = src[3];
+ dst[4] = src[4];
+ dst[5] = src[5];
+ dst[6] = src[6];
+ dst[7] = src[7];
+ dst[8] = src[8];
+ dst[9] = src[9];
+ dst[10] = src[10];
+ dst[11] = src[11];
+ src += 24;
+ dst += 12;
+ }
+ break;
+ }
+ cvt->len_cvt /= 2;
+ if ( cvt->filters[++cvt->filter_index] ) {
+ cvt->filters[cvt->filter_index](cvt, format);
+ }
+}
+
+/* Very slow rate conversion routine */
+void SDLCALL SDL_RateSLOW(SDL_AudioCVT *cvt, Uint16 format)
+{
+ double ipos;
+ int i, clen;
+
+#ifdef DEBUG_CONVERT
+ fprintf(stderr, "Converting audio rate * %4.4f\n", 1.0/cvt->rate_incr);
+#endif
+ clen = (int)((double)cvt->len_cvt / cvt->rate_incr);
+ if ( cvt->rate_incr > 1.0 ) {
+ switch (format & 0xFF) {
+ case 8: {
+ Uint8 *output;
+
+ output = cvt->buf;
+ ipos = 0.0;
+ for ( i=clen; i; --i ) {
+ *output = cvt->buf[(int)ipos];
+ ipos += cvt->rate_incr;
+ output += 1;
+ }
+ }
+ break;
+
+ case 16: {
+ Uint16 *output;
+
+ clen &= ~1;
+ output = (Uint16 *)cvt->buf;
+ ipos = 0.0;
+ for ( i=clen/2; i; --i ) {
+ *output=((Uint16 *)cvt->buf)[(int)ipos];
+ ipos += cvt->rate_incr;
+ output += 1;
+ }
+ }
+ break;
+ }
+ } else {
+ switch (format & 0xFF) {
+ case 8: {
+ Uint8 *output;
+
+ output = cvt->buf+clen;
+ ipos = (double)cvt->len_cvt;
+ for ( i=clen; i; --i ) {
+ ipos -= cvt->rate_incr;
+ output -= 1;
+ *output = cvt->buf[(int)ipos];
+ }
+ }
+ break;
+
+ case 16: {
+ Uint16 *output;
+
+ clen &= ~1;
+ output = (Uint16 *)(cvt->buf+clen);
+ ipos = (double)cvt->len_cvt/2;
+ for ( i=clen/2; i; --i ) {
+ ipos -= cvt->rate_incr;
+ output -= 1;
+ *output=((Uint16 *)cvt->buf)[(int)ipos];
+ }
+ }
+ break;
+ }
+ }
+ cvt->len_cvt = clen;
+ if ( cvt->filters[++cvt->filter_index] ) {
+ cvt->filters[cvt->filter_index](cvt, format);
+ }
+}
+
+int SDL_ConvertAudio(SDL_AudioCVT *cvt)
+{
+ /* Make sure there's data to convert */
+ if ( cvt->buf == NULL ) {
+ SDL_SetError("No buffer allocated for conversion");
+ return(-1);
+ }
+ /* Return okay if no conversion is necessary */
+ cvt->len_cvt = cvt->len;
+ if ( cvt->filters[0] == NULL ) {
+ return(0);
+ }
+
+ /* Set up the conversion and go! */
+ cvt->filter_index = 0;
+ cvt->filters[0](cvt, cvt->src_format);
+ return(0);
+}
+
+/* Creates a set of audio filters to convert from one format to another.
+ Returns -1 if the format conversion is not supported, or 1 if the
+ audio filter is set up.
+*/
+
+int SDL_BuildAudioCVT(SDL_AudioCVT *cvt,
+ Uint16 src_format, Uint8 src_channels, int src_rate,
+ Uint16 dst_format, Uint8 dst_channels, int dst_rate)
+{
+/*printf("Build format %04x->%04x, channels %u->%u, rate %d->%d\n",
+ src_format, dst_format, src_channels, dst_channels, src_rate, dst_rate);*/
+ /* Start off with no conversion necessary */
+ cvt->needed = 0;
+ cvt->filter_index = 0;
+ cvt->filters[0] = NULL;
+ cvt->len_mult = 1;
+ cvt->len_ratio = 1.0;
+
+ /* First filter: Endian conversion from src to dst */
+ if ( (src_format & 0x1000) != (dst_format & 0x1000)
+ && ((src_format & 0xff) == 16) && ((dst_format & 0xff) == 16)) {
+ cvt->filters[cvt->filter_index++] = SDL_ConvertEndian;
+ }
+
+ /* Second filter: Sign conversion -- signed/unsigned */
+ if ( (src_format & 0x8000) != (dst_format & 0x8000) ) {
+ cvt->filters[cvt->filter_index++] = SDL_ConvertSign;
+ }
+
+ /* Next filter: Convert 16 bit <--> 8 bit PCM */
+ if ( (src_format & 0xFF) != (dst_format & 0xFF) ) {
+ switch (dst_format&0x10FF) {
+ case AUDIO_U8:
+ cvt->filters[cvt->filter_index++] =
+ SDL_Convert8;
+ cvt->len_ratio /= 2;
+ break;
+ case AUDIO_U16LSB:
+ cvt->filters[cvt->filter_index++] =
+ SDL_Convert16LSB;
+ cvt->len_mult *= 2;
+ cvt->len_ratio *= 2;
+ break;
+ case AUDIO_U16MSB:
+ cvt->filters[cvt->filter_index++] =
+ SDL_Convert16MSB;
+ cvt->len_mult *= 2;
+ cvt->len_ratio *= 2;
+ break;
+ }
+ }
+
+ /* Last filter: Mono/Stereo conversion */
+ if ( src_channels != dst_channels ) {
+ if ( (src_channels == 1) && (dst_channels > 1) ) {
+ cvt->filters[cvt->filter_index++] =
+ SDL_ConvertStereo;
+ cvt->len_mult *= 2;
+ src_channels = 2;
+ cvt->len_ratio *= 2;
+ }
+ if ( (src_channels == 2) &&
+ (dst_channels == 6) ) {
+ cvt->filters[cvt->filter_index++] =
+ SDL_ConvertSurround;
+ src_channels = 6;
+ cvt->len_mult *= 3;
+ cvt->len_ratio *= 3;
+ }
+ if ( (src_channels == 2) &&
+ (dst_channels == 4) ) {
+ cvt->filters[cvt->filter_index++] =
+ SDL_ConvertSurround_4;
+ src_channels = 4;
+ cvt->len_mult *= 2;
+ cvt->len_ratio *= 2;
+ }
+ while ( (src_channels*2) <= dst_channels ) {
+ cvt->filters[cvt->filter_index++] =
+ SDL_ConvertStereo;
+ cvt->len_mult *= 2;
+ src_channels *= 2;
+ cvt->len_ratio *= 2;
+ }
+ if ( (src_channels == 6) &&
+ (dst_channels <= 2) ) {
+ cvt->filters[cvt->filter_index++] =
+ SDL_ConvertStrip;
+ src_channels = 2;
+ cvt->len_ratio /= 3;
+ }
+ if ( (src_channels == 6) &&
+ (dst_channels == 4) ) {
+ cvt->filters[cvt->filter_index++] =
+ SDL_ConvertStrip_2;
+ src_channels = 4;
+ cvt->len_ratio /= 2;
+ }
+ /* This assumes that 4 channel audio is in the format:
+ Left {front/back} + Right {front/back}
+ so converting to L/R stereo works properly.
+ */
+ while ( ((src_channels%2) == 0) &&
+ ((src_channels/2) >= dst_channels) ) {
+ cvt->filters[cvt->filter_index++] =
+ SDL_ConvertMono;
+ src_channels /= 2;
+ cvt->len_ratio /= 2;
+ }
+ if ( src_channels != dst_channels ) {
+ /* Uh oh.. */;
+ }
+ }
+
+ /* Do rate conversion */
+ cvt->rate_incr = 0.0;
+ if ( (src_rate/100) != (dst_rate/100) ) {
+ Uint32 hi_rate, lo_rate;
+ int len_mult;
+ double len_ratio;
+ void (SDLCALL *rate_cvt)(SDL_AudioCVT *cvt, Uint16 format);
+
+ if ( src_rate > dst_rate ) {
+ hi_rate = src_rate;
+ lo_rate = dst_rate;
+ switch (src_channels) {
+ case 1: rate_cvt = SDL_RateDIV2; break;
+ case 2: rate_cvt = SDL_RateDIV2_c2; break;
+ case 4: rate_cvt = SDL_RateDIV2_c4; break;
+ case 6: rate_cvt = SDL_RateDIV2_c6; break;
+ default: return -1;
+ }
+ len_mult = 1;
+ len_ratio = 0.5;
+ } else {
+ hi_rate = dst_rate;
+ lo_rate = src_rate;
+ switch (src_channels) {
+ case 1: rate_cvt = SDL_RateMUL2; break;
+ case 2: rate_cvt = SDL_RateMUL2_c2; break;
+ case 4: rate_cvt = SDL_RateMUL2_c4; break;
+ case 6: rate_cvt = SDL_RateMUL2_c6; break;
+ default: return -1;
+ }
+ len_mult = 2;
+ len_ratio = 2.0;
+ }
+ /* If hi_rate = lo_rate*2^x then conversion is easy */
+ while ( ((lo_rate*2)/100) <= (hi_rate/100) ) {
+ cvt->filters[cvt->filter_index++] = rate_cvt;
+ cvt->len_mult *= len_mult;
+ lo_rate *= 2;
+ cvt->len_ratio *= len_ratio;
+ }
+ /* We may need a slow conversion here to finish up */
+ if ( (lo_rate/100) != (hi_rate/100) ) {
+#if 1
+ /* The problem with this is that if the input buffer is
+ say 1K, and the conversion rate is say 1.1, then the
+ output buffer is 1.1K, which may not be an acceptable
+ buffer size for the audio driver (not a power of 2)
+ */
+ /* For now, punt and hope the rate distortion isn't great.
+ */
+#else
+ if ( src_rate < dst_rate ) {
+ cvt->rate_incr = (double)lo_rate/hi_rate;
+ cvt->len_mult *= 2;
+ cvt->len_ratio /= cvt->rate_incr;
+ } else {
+ cvt->rate_incr = (double)hi_rate/lo_rate;
+ cvt->len_ratio *= cvt->rate_incr;
+ }
+ cvt->filters[cvt->filter_index++] = SDL_RateSLOW;
+#endif
+ }
+ }
+
+ /* Set up the filter information */
+ if ( cvt->filter_index != 0 ) {
+ cvt->needed = 1;
+ cvt->src_format = src_format;
+ cvt->dst_format = dst_format;
+ cvt->len = 0;
+ cvt->buf = NULL;
+ cvt->filters[cvt->filter_index] = NULL;
+ }
+ return(cvt->needed);
+}
diff --git a/distrib/sdl-1.2.15/src/audio/SDL_audiodev.c b/distrib/sdl-1.2.15/src/audio/SDL_audiodev.c
new file mode 100644
index 0000000..396156c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/SDL_audiodev.c
@@ -0,0 +1,179 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Get the name of the audio device we use for output */
+
+#if SDL_AUDIO_DRIVER_BSD || SDL_AUDIO_DRIVER_OSS || SDL_AUDIO_DRIVER_SUNAUDIO
+
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "SDL_stdinc.h"
+#include "SDL_audiodev_c.h"
+
+#ifndef _PATH_DEV_DSP
+#if defined(__NETBSD__) || defined(__OPENBSD__)
+#define _PATH_DEV_DSP "/dev/audio"
+#else
+#define _PATH_DEV_DSP "/dev/dsp"
+#endif
+#endif
+#ifndef _PATH_DEV_DSP24
+#define _PATH_DEV_DSP24 "/dev/sound/dsp"
+#endif
+#ifndef _PATH_DEV_AUDIO
+#define _PATH_DEV_AUDIO "/dev/audio"
+#endif
+
+
+int SDL_OpenAudioPath(char *path, int maxlen, int flags, int classic)
+{
+ const char *audiodev;
+ int audio_fd;
+ char audiopath[1024];
+
+ /* Figure out what our audio device is */
+ if ( ((audiodev=SDL_getenv("SDL_PATH_DSP")) == NULL) &&
+ ((audiodev=SDL_getenv("AUDIODEV")) == NULL) ) {
+ if ( classic ) {
+ audiodev = _PATH_DEV_AUDIO;
+ } else {
+ struct stat sb;
+
+ /* Added support for /dev/sound/\* in Linux 2.4 */
+ if ( ((stat("/dev/sound", &sb) == 0) && S_ISDIR(sb.st_mode)) &&
+ ((stat(_PATH_DEV_DSP24, &sb) == 0) && S_ISCHR(sb.st_mode)) ) {
+ audiodev = _PATH_DEV_DSP24;
+ } else {
+ audiodev = _PATH_DEV_DSP;
+ }
+ }
+ }
+ audio_fd = open(audiodev, flags, 0);
+
+ /* If the first open fails, look for other devices */
+ if ( (audio_fd < 0) && (SDL_strlen(audiodev) < (sizeof(audiopath)-3)) ) {
+ int exists, instance;
+ struct stat sb;
+
+ instance = 1;
+ do { /* Don't use errno ENOENT - it may not be thread-safe */
+ SDL_snprintf(audiopath, SDL_arraysize(audiopath),
+ "%s%d", audiodev, instance++);
+ exists = 0;
+ if ( stat(audiopath, &sb) == 0 ) {
+ exists = 1;
+ audio_fd = open(audiopath, flags, 0);
+ }
+ } while ( exists && (audio_fd < 0) );
+ audiodev = audiopath;
+ }
+ if ( path != NULL ) {
+ SDL_strlcpy(path, audiodev, maxlen);
+ path[maxlen-1] = '\0';
+ }
+ return(audio_fd);
+}
+
+#elif SDL_AUDIO_DRIVER_PAUD
+
+/* Get the name of the audio device we use for output */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "SDL_stdinc.h"
+#include "SDL_audiodev_c.h"
+
+#ifndef _PATH_DEV_DSP
+#define _PATH_DEV_DSP "/dev/%caud%c/%c"
+#endif
+
+char devsettings[][3] =
+{
+ { 'p', '0', '1' }, { 'p', '0', '2' }, { 'p', '0', '3' }, { 'p', '0', '4' },
+ { 'p', '1', '1' }, { 'p', '1', '2' }, { 'p', '1', '3' }, { 'p', '1', '4' },
+ { 'p', '2', '1' }, { 'p', '2', '2' }, { 'p', '2', '3' }, { 'p', '2', '4' },
+ { 'p', '3', '1' }, { 'p', '3', '2' }, { 'p', '3', '3' }, { 'p', '3', '4' },
+ { 'b', '0', '1' }, { 'b', '0', '2' }, { 'b', '0', '3' }, { 'b', '0', '4' },
+ { 'b', '1', '1' }, { 'b', '1', '2' }, { 'b', '1', '3' }, { 'b', '1', '4' },
+ { 'b', '2', '1' }, { 'b', '2', '2' }, { 'b', '2', '3' }, { 'b', '2', '4' },
+ { 'b', '3', '1' }, { 'b', '3', '2' }, { 'b', '3', '3' }, { 'b', '3', '4' },
+ { '\0', '\0', '\0' }
+};
+
+static int OpenUserDefinedDevice(char *path, int maxlen, int flags)
+{
+ const char *audiodev;
+ int audio_fd;
+
+ /* Figure out what our audio device is */
+ if ((audiodev=SDL_getenv("SDL_PATH_DSP")) == NULL) {
+ audiodev=SDL_getenv("AUDIODEV");
+ }
+ if ( audiodev == NULL ) {
+ return -1;
+ }
+ audio_fd = open(audiodev, flags, 0);
+ if ( path != NULL ) {
+ SDL_strlcpy(path, audiodev, maxlen);
+ path[maxlen-1] = '\0';
+ }
+ return audio_fd;
+}
+
+int SDL_OpenAudioPath(char *path, int maxlen, int flags, int classic)
+{
+ struct stat sb;
+ int audio_fd;
+ char audiopath[1024];
+ int cycle;
+
+ audio_fd = OpenUserDefinedDevice(path,maxlen,flags);
+ if ( audio_fd != -1 ) {
+ return audio_fd;
+ }
+
+ cycle = 0;
+ while( devsettings[cycle][0] != '\0' ) {
+ SDL_snprintf( audiopath, SDL_arraysize(audiopath),
+ _PATH_DEV_DSP,
+ devsettings[cycle][0],
+ devsettings[cycle][1],
+ devsettings[cycle][2]);
+
+ if ( stat(audiopath, &sb) == 0 ) {
+ audio_fd = open(audiopath, flags, 0);
+ if ( audio_fd > 0 ) {
+ if ( path != NULL ) {
+ SDL_strlcpy( path, audiopath, maxlen );
+ }
+ return audio_fd;
+ }
+ }
+ }
+ return -1;
+}
+
+#endif /* Audio driver selection */
diff --git a/distrib/sdl-1.2.15/src/audio/SDL_audiodev_c.h b/distrib/sdl-1.2.15/src/audio/SDL_audiodev_c.h
new file mode 100644
index 0000000..179d0d0
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/SDL_audiodev_c.h
@@ -0,0 +1,26 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Open the audio device, storing the pathname in 'path' */
+extern int SDL_OpenAudioPath(char *path, int maxlen, int flags, int classic);
+
diff --git a/distrib/sdl-1.2.15/src/audio/SDL_audiomem.h b/distrib/sdl-1.2.15/src/audio/SDL_audiomem.h
new file mode 100644
index 0000000..a473a5e
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/SDL_audiomem.h
@@ -0,0 +1,25 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#define SDL_AllocAudioMem SDL_malloc
+#define SDL_FreeAudioMem SDL_free
diff --git a/distrib/sdl-1.2.15/src/audio/SDL_mixer.c b/distrib/sdl-1.2.15/src/audio/SDL_mixer.c
new file mode 100644
index 0000000..b5d4d8b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/SDL_mixer.c
@@ -0,0 +1,264 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This provides the default mixing callback for the SDL audio routines */
+
+#include "SDL_cpuinfo.h"
+#include "SDL_timer.h"
+#include "SDL_audio.h"
+#include "SDL_sysaudio.h"
+#include "SDL_mixer_MMX.h"
+#include "SDL_mixer_MMX_VC.h"
+#include "SDL_mixer_m68k.h"
+
+/* This table is used to add two sound values together and pin
+ * the value to avoid overflow. (used with permission from ARDI)
+ * Changed to use 0xFE instead of 0xFF for better sound quality.
+ */
+static const Uint8 mix8[] =
+{
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03,
+ 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,
+ 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19,
+ 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24,
+ 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A,
+ 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45,
+ 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50,
+ 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B,
+ 0x5C, 0x5D, 0x5E, 0x5F, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66,
+ 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71,
+ 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C,
+ 0x7D, 0x7E, 0x7F, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92,
+ 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D,
+ 0x9E, 0x9F, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8,
+ 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3,
+ 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE,
+ 0xBF, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9,
+ 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4,
+ 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
+ 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA,
+ 0xEB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5,
+ 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFE, 0xFE,
+ 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
+ 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
+ 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
+ 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
+ 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
+ 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
+ 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
+ 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
+ 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
+ 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
+ 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
+ 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE
+};
+
+/* 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)
+
+void SDL_MixAudio (Uint8 *dst, const Uint8 *src, Uint32 len, int volume)
+{
+ Uint16 format;
+
+ if ( volume == 0 ) {
+ return;
+ }
+ /* Mix the user-level audio format */
+ if ( current_audio ) {
+ if ( current_audio->convert.needed ) {
+ format = current_audio->convert.src_format;
+ } else {
+ format = current_audio->spec.format;
+ }
+ } else {
+ /* HACK HACK HACK */
+ format = AUDIO_S16;
+ }
+ switch (format) {
+
+ case AUDIO_U8: {
+#if defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) && defined(SDL_ASSEMBLY_ROUTINES)
+ SDL_MixAudio_m68k_U8((char*)dst,(char*)src,(unsigned long)len,(long)volume,(char *)mix8);
+#else
+ Uint8 src_sample;
+
+ while ( len-- ) {
+ src_sample = *src;
+ ADJUST_VOLUME_U8(src_sample, volume);
+ *dst = mix8[*dst+src_sample];
+ ++dst;
+ ++src;
+ }
+#endif
+ }
+ break;
+
+ case AUDIO_S8: {
+#if defined(SDL_BUGGY_MMX_MIXERS) /* buggy, so we're disabling them. --ryan. */
+#if defined(__GNUC__) && defined(__i386__) && defined(SDL_ASSEMBLY_ROUTINES)
+ if (SDL_HasMMX())
+ {
+ SDL_MixAudio_MMX_S8((char*)dst,(char*)src,(unsigned int)len,(int)volume);
+ }
+ else
+#elif ((defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)) && defined(SDL_ASSEMBLY_ROUTINES)
+ if (SDL_HasMMX())
+ {
+ SDL_MixAudio_MMX_S8_VC((char*)dst,(char*)src,(unsigned int)len,(int)volume);
+ }
+ else
+#endif
+#endif
+
+#if defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) && defined(SDL_ASSEMBLY_ROUTINES)
+ SDL_MixAudio_m68k_S8((char*)dst,(char*)src,(unsigned long)len,(long)volume);
+#else
+ {
+ Sint8 *dst8, *src8;
+ Sint8 src_sample;
+ int dst_sample;
+ const int max_audioval = ((1<<(8-1))-1);
+ const int min_audioval = -(1<<(8-1));
+
+ src8 = (Sint8 *)src;
+ dst8 = (Sint8 *)dst;
+ while ( len-- ) {
+ src_sample = *src8;
+ ADJUST_VOLUME(src_sample, volume);
+ dst_sample = *dst8 + src_sample;
+ if ( dst_sample > max_audioval ) {
+ *dst8 = max_audioval;
+ } else
+ if ( dst_sample < min_audioval ) {
+ *dst8 = min_audioval;
+ } else {
+ *dst8 = dst_sample;
+ }
+ ++dst8;
+ ++src8;
+ }
+ }
+#endif
+ }
+ break;
+
+ case AUDIO_S16LSB: {
+#if defined(SDL_BUGGY_MMX_MIXERS) /* buggy, so we're disabling them. --ryan. */
+#if defined(__GNUC__) && defined(__i386__) && defined(SDL_ASSEMBLY_ROUTINES)
+ if (SDL_HasMMX())
+ {
+ SDL_MixAudio_MMX_S16((char*)dst,(char*)src,(unsigned int)len,(int)volume);
+ }
+ else
+#elif ((defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)) && defined(SDL_ASSEMBLY_ROUTINES)
+ if (SDL_HasMMX())
+ {
+ SDL_MixAudio_MMX_S16_VC((char*)dst,(char*)src,(unsigned int)len,(int)volume);
+ }
+ else
+#endif
+#endif
+
+#if defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) && defined(SDL_ASSEMBLY_ROUTINES)
+ SDL_MixAudio_m68k_S16LSB((short*)dst,(short*)src,(unsigned long)len,(long)volume);
+#else
+ {
+ Sint16 src1, src2;
+ int dst_sample;
+ const int max_audioval = ((1<<(16-1))-1);
+ const int min_audioval = -(1<<(16-1));
+
+ len /= 2;
+ while ( len-- ) {
+ src1 = ((src[1])<<8|src[0]);
+ ADJUST_VOLUME(src1, volume);
+ src2 = ((dst[1])<<8|dst[0]);
+ src += 2;
+ dst_sample = src1+src2;
+ if ( dst_sample > max_audioval ) {
+ dst_sample = max_audioval;
+ } else
+ if ( dst_sample < min_audioval ) {
+ dst_sample = min_audioval;
+ }
+ dst[0] = dst_sample&0xFF;
+ dst_sample >>= 8;
+ dst[1] = dst_sample&0xFF;
+ dst += 2;
+ }
+ }
+#endif
+ }
+ break;
+
+ case AUDIO_S16MSB: {
+#if defined(__GNUC__) && (defined(__m68k__) && !defined(__mcoldfire__)) && defined(SDL_ASSEMBLY_ROUTINES)
+ SDL_MixAudio_m68k_S16MSB((short*)dst,(short*)src,(unsigned long)len,(long)volume);
+#else
+ Sint16 src1, src2;
+ int dst_sample;
+ const int max_audioval = ((1<<(16-1))-1);
+ const int min_audioval = -(1<<(16-1));
+
+ len /= 2;
+ while ( len-- ) {
+ src1 = ((src[0])<<8|src[1]);
+ ADJUST_VOLUME(src1, volume);
+ src2 = ((dst[0])<<8|dst[1]);
+ src += 2;
+ dst_sample = src1+src2;
+ if ( dst_sample > max_audioval ) {
+ dst_sample = max_audioval;
+ } else
+ if ( dst_sample < min_audioval ) {
+ dst_sample = min_audioval;
+ }
+ dst[1] = dst_sample&0xFF;
+ dst_sample >>= 8;
+ dst[0] = dst_sample&0xFF;
+ dst += 2;
+ }
+#endif
+ }
+ break;
+
+ default: /* If this happens... FIXME! */
+ SDL_SetError("SDL_MixAudio(): unknown audio format");
+ return;
+ }
+}
+
diff --git a/distrib/sdl-1.2.15/src/audio/SDL_mixer_MMX.c b/distrib/sdl-1.2.15/src/audio/SDL_mixer_MMX.c
new file mode 100644
index 0000000..a2f1d8d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/SDL_mixer_MMX.c
@@ -0,0 +1,207 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ MMX assembler version of SDL_MixAudio for signed little endian 16 bit samples and signed 8 bit samples
+ Copyright 2002 Stephane Marchesin (stephane.marchesin@wanadoo.fr)
+ This code is licensed under the LGPL (see COPYING for details)
+
+ Assumes buffer size in bytes is a multiple of 16
+ Assumes SDL_MIX_MAXVOLUME = 128
+*/
+
+
+/***********************************************
+* Mixing for 16 bit signed buffers
+***********************************************/
+
+#if defined(SDL_BUGGY_MMX_MIXERS) /* buggy, so we're disabling them. --ryan. */
+#if defined(__GNUC__) && defined(__i386__) && defined(SDL_ASSEMBLY_ROUTINES)
+void SDL_MixAudio_MMX_S16(char* dst,char* src,unsigned int size,int volume)
+{
+ __asm__ __volatile__ (
+
+" movl %3,%%eax\n" /* eax = volume */
+
+" movl %2,%%edx\n" /* edx = size */
+
+" shrl $4,%%edx\n" /* process 16 bytes per iteration = 8 samples */
+
+" jz .endS16\n"
+
+" pxor %%mm0,%%mm0\n"
+
+" movd %%eax,%%mm0\n"
+" movq %%mm0,%%mm1\n"
+" psllq $16,%%mm0\n"
+" por %%mm1,%%mm0\n"
+" psllq $16,%%mm0\n"
+" por %%mm1,%%mm0\n"
+" psllq $16,%%mm0\n"
+" por %%mm1,%%mm0\n" /* mm0 = vol|vol|vol|vol */
+
+".align 8\n"
+" .mixloopS16:\n"
+
+" movq (%1),%%mm1\n" /* mm1 = a|b|c|d */
+
+" movq %%mm1,%%mm2\n" /* mm2 = a|b|c|d */
+
+" movq 8(%1),%%mm4\n" /* mm4 = e|f|g|h */
+
+ /* pré charger le buffer dst dans mm7 */
+" movq (%0),%%mm7\n" /* mm7 = dst[0] */
+
+ /* multiplier par le volume */
+" pmullw %%mm0,%%mm1\n" /* mm1 = l(a*v)|l(b*v)|l(c*v)|l(d*v) */
+
+" pmulhw %%mm0,%%mm2\n" /* mm2 = h(a*v)|h(b*v)|h(c*v)|h(d*v) */
+" movq %%mm4,%%mm5\n" /* mm5 = e|f|g|h */
+
+" pmullw %%mm0,%%mm4\n" /* mm4 = l(e*v)|l(f*v)|l(g*v)|l(h*v) */
+
+" pmulhw %%mm0,%%mm5\n" /* mm5 = h(e*v)|h(f*v)|h(g*v)|h(h*v) */
+" movq %%mm1,%%mm3\n" /* mm3 = l(a*v)|l(b*v)|l(c*v)|l(d*v) */
+
+" punpckhwd %%mm2,%%mm1\n" /* mm1 = a*v|b*v */
+
+" movq %%mm4,%%mm6\n" /* mm6 = l(e*v)|l(f*v)|l(g*v)|l(h*v) */
+" punpcklwd %%mm2,%%mm3\n" /* mm3 = c*v|d*v */
+
+" punpckhwd %%mm5,%%mm4\n" /* mm4 = e*f|f*v */
+
+" punpcklwd %%mm5,%%mm6\n" /* mm6 = g*v|h*v */
+
+ /* pré charger le buffer dst dans mm5 */
+" movq 8(%0),%%mm5\n" /* mm5 = dst[1] */
+
+ /* diviser par 128 */
+" psrad $7,%%mm1\n" /* mm1 = a*v/128|b*v/128 , 128 = SDL_MIX_MAXVOLUME */
+" add $16,%1\n"
+
+" psrad $7,%%mm3\n" /* mm3 = c*v/128|d*v/128 */
+
+" psrad $7,%%mm4\n" /* mm4 = e*v/128|f*v/128 */
+
+ /* mm1 = le sample avec le volume modifié */
+" packssdw %%mm1,%%mm3\n" /* mm3 = s(a*v|b*v|c*v|d*v) */
+
+" psrad $7,%%mm6\n" /* mm6= g*v/128|h*v/128 */
+" paddsw %%mm7,%%mm3\n" /* mm3 = adjust_volume(src)+dst */
+
+ /* mm4 = le sample avec le volume modifié */
+" packssdw %%mm4,%%mm6\n" /* mm6 = s(e*v|f*v|g*v|h*v) */
+" movq %%mm3,(%0)\n"
+
+" paddsw %%mm5,%%mm6\n" /* mm6 = adjust_volume(src)+dst */
+
+" movq %%mm6,8(%0)\n"
+
+" add $16,%0\n"
+
+" dec %%edx\n"
+
+" jnz .mixloopS16\n"
+
+" emms\n"
+
+".endS16:\n"
+ :
+ : "r" (dst), "r"(src),"m"(size),
+ "m"(volume)
+ : "eax","edx","memory"
+ );
+}
+
+
+
+/*////////////////////////////////////////////// */
+/* Mixing for 8 bit signed buffers */
+/*////////////////////////////////////////////// */
+
+void SDL_MixAudio_MMX_S8(char* dst,char* src,unsigned int size,int volume)
+{
+ __asm__ __volatile__ (
+
+" movl %3,%%eax\n" /* eax = volume */
+
+" movd %%eax,%%mm0\n"
+" movq %%mm0,%%mm1\n"
+" psllq $16,%%mm0\n"
+" por %%mm1,%%mm0\n"
+" psllq $16,%%mm0\n"
+" por %%mm1,%%mm0\n"
+" psllq $16,%%mm0\n"
+" por %%mm1,%%mm0\n"
+
+" movl %2,%%edx\n" /* edx = size */
+" shr $3,%%edx\n" /* process 8 bytes per iteration = 8 samples */
+
+" cmp $0,%%edx\n"
+" je .endS8\n"
+
+".align 8\n"
+" .mixloopS8:\n"
+
+" pxor %%mm2,%%mm2\n" /* mm2 = 0 */
+" movq (%1),%%mm1\n" /* mm1 = a|b|c|d|e|f|g|h */
+
+" movq %%mm1,%%mm3\n" /* mm3 = a|b|c|d|e|f|g|h */
+
+ /* on va faire le "sign extension" en faisant un cmp avec 0 qui retourne 1 si <0, 0 si >0 */
+" pcmpgtb %%mm1,%%mm2\n" /* mm2 = 11111111|00000000|00000000.... */
+
+" punpckhbw %%mm2,%%mm1\n" /* mm1 = 0|a|0|b|0|c|0|d */
+
+" punpcklbw %%mm2,%%mm3\n" /* mm3 = 0|e|0|f|0|g|0|h */
+" movq (%0),%%mm2\n" /* mm2 = destination */
+
+" pmullw %%mm0,%%mm1\n" /* mm1 = v*a|v*b|v*c|v*d */
+" add $8,%1\n"
+
+" pmullw %%mm0,%%mm3\n" /* mm3 = v*e|v*f|v*g|v*h */
+" psraw $7,%%mm1\n" /* mm1 = v*a/128|v*b/128|v*c/128|v*d/128 */
+
+" psraw $7,%%mm3\n" /* mm3 = v*e/128|v*f/128|v*g/128|v*h/128 */
+
+" packsswb %%mm1,%%mm3\n" /* mm1 = v*a/128|v*b/128|v*c/128|v*d/128|v*e/128|v*f/128|v*g/128|v*h/128 */
+
+" paddsb %%mm2,%%mm3\n" /* add to destination buffer */
+
+" movq %%mm3,(%0)\n" /* store back to ram */
+" add $8,%0\n"
+
+" dec %%edx\n"
+
+" jnz .mixloopS8\n"
+
+".endS8:\n"
+" emms\n"
+ :
+ : "r" (dst), "r"(src),"m"(size),
+ "m"(volume)
+ : "eax","edx","memory"
+ );
+}
+#endif
+#endif
diff --git a/distrib/sdl-1.2.15/src/audio/SDL_mixer_MMX.h b/distrib/sdl-1.2.15/src/audio/SDL_mixer_MMX.h
new file mode 100644
index 0000000..836b259
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/SDL_mixer_MMX.h
@@ -0,0 +1,17 @@
+/*
+ headers for MMX assembler version of SDL_MixAudio
+ Copyright 2002 Stephane Marchesin (stephane.marchesin@wanadoo.fr)
+ This code is licensed under the LGPL (see COPYING for details)
+
+ Assumes buffer size in bytes is a multiple of 16
+ Assumes SDL_MIX_MAXVOLUME = 128
+*/
+#include "SDL_config.h"
+
+#if defined(SDL_BUGGY_MMX_MIXERS) /* buggy, so we're disabling them. --ryan. */
+#if defined(__GNUC__) && defined(__i386__) && defined(SDL_ASSEMBLY_ROUTINES)
+void SDL_MixAudio_MMX_S16(char* ,char* ,unsigned int ,int );
+void SDL_MixAudio_MMX_S8(char* ,char* ,unsigned int ,int );
+#endif
+#endif
+
diff --git a/distrib/sdl-1.2.15/src/audio/SDL_mixer_MMX_VC.c b/distrib/sdl-1.2.15/src/audio/SDL_mixer_MMX_VC.c
new file mode 100644
index 0000000..cd0aa4c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/SDL_mixer_MMX_VC.c
@@ -0,0 +1,183 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_mixer_MMX_VC.h"
+
+#if defined(SDL_BUGGY_MMX_MIXERS) /* buggy, so we're disabling them. --ryan. */
+#if ((defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)) && defined(SDL_ASSEMBLY_ROUTINES)
+// MMX assembler version of SDL_MixAudio for signed little endian 16 bit samples and signed 8 bit samples
+// Copyright 2002 Stephane Marchesin (stephane.marchesin@wanadoo.fr)
+// Converted to Intel ASM notation by Cth
+// This code is licensed under the LGPL (see COPYING for details)
+//
+// Assumes buffer size in bytes is a multiple of 16
+// Assumes SDL_MIX_MAXVOLUME = 128
+
+
+////////////////////////////////////////////////
+// Mixing for 16 bit signed buffers
+////////////////////////////////////////////////
+
+void SDL_MixAudio_MMX_S16_VC(char* dst,char* src,unsigned int nSize,int volume)
+{
+ __asm
+ {
+
+ push edi
+ push esi
+ push ebx
+
+ mov edi, dst // edi = dst
+ mov esi, src // esi = src
+ mov eax, volume // eax = volume
+ mov ebx, nSize // ebx = size
+ shr ebx, 4 // process 16 bytes per iteration = 8 samples
+ jz endS16
+
+ pxor mm0, mm0
+ movd mm0, eax //%%eax,%%mm0
+ movq mm1, mm0 //%%mm0,%%mm1
+ psllq mm0, 16 //$16,%%mm0
+ por mm0, mm1 //%%mm1,%%mm0
+ psllq mm0, 16 //$16,%%mm0
+ por mm0, mm1 //%%mm1,%%mm0
+ psllq mm0, 16 //$16,%%mm0
+ por mm0, mm1 //%%mm1,%%mm0 // mm0 = vol|vol|vol|vol
+
+ #ifndef __WATCOMC__
+ align 16
+ #endif
+mixloopS16:
+ movq mm1, [esi] //(%%esi),%%mm1\n" // mm1 = a|b|c|d
+ movq mm2, mm1 //%%mm1,%%mm2\n" // mm2 = a|b|c|d
+ movq mm4, [esi + 8] //8(%%esi),%%mm4\n" // mm4 = e|f|g|h
+ // pre charger le buffer dst dans mm7
+ movq mm7, [edi] //(%%edi),%%mm7\n" // mm7 = dst[0]"
+ // multiplier par le volume
+ pmullw mm1, mm0 //%%mm0,%%mm1\n" // mm1 = l(a*v)|l(b*v)|l(c*v)|l(d*v)
+ pmulhw mm2, mm0 //%%mm0,%%mm2\n" // mm2 = h(a*v)|h(b*v)|h(c*v)|h(d*v)
+ movq mm5, mm4 //%%mm4,%%mm5\n" // mm5 = e|f|g|h
+ pmullw mm4, mm0 //%%mm0,%%mm4\n" // mm4 = l(e*v)|l(f*v)|l(g*v)|l(h*v)
+ pmulhw mm5, mm0 //%%mm0,%%mm5\n" // mm5 = h(e*v)|h(f*v)|h(g*v)|h(h*v)
+ movq mm3, mm1 //%%mm1,%%mm3\n" // mm3 = l(a*v)|l(b*v)|l(c*v)|l(d*v)
+ punpckhwd mm1, mm2 //%%mm2,%%mm1\n" // mm1 = a*v|b*v
+ movq mm6, mm4 //%%mm4,%%mm6\n" // mm6 = l(e*v)|l(f*v)|l(g*v)|l(h*v)
+ punpcklwd mm3, mm2 //%%mm2,%%mm3\n" // mm3 = c*v|d*v
+ punpckhwd mm4, mm5 //%%mm5,%%mm4\n" // mm4 = e*f|f*v
+ punpcklwd mm6, mm5 //%%mm5,%%mm6\n" // mm6 = g*v|h*v
+ // pre charger le buffer dst dans mm5
+ movq mm5, [edi + 8] //8(%%edi),%%mm5\n" // mm5 = dst[1]
+ // diviser par 128
+ psrad mm1, 7 //$7,%%mm1\n" // mm1 = a*v/128|b*v/128 , 128 = SDL_MIX_MAXVOLUME
+ add esi, 16 //$16,%%esi\n"
+ psrad mm3, 7 //$7,%%mm3\n" // mm3 = c*v/128|d*v/128
+ psrad mm4, 7 //$7,%%mm4\n" // mm4 = e*v/128|f*v/128
+ // mm1 = le sample avec le volume modifie
+ packssdw mm3, mm1 //%%mm1,%%mm3\n" // mm3 = s(a*v|b*v|c*v|d*v)
+ psrad mm6, 7 //$7,%%mm6\n" // mm6= g*v/128|h*v/128
+ paddsw mm3, mm7 //%%mm7,%%mm3\n" // mm3 = adjust_volume(src)+dst
+ // mm4 = le sample avec le volume modifie
+ packssdw mm6, mm4 //%%mm4,%%mm6\n" // mm6 = s(e*v|f*v|g*v|h*v)
+ movq [edi], mm3 //%%mm3,(%%edi)\n"
+ paddsw mm6, mm5 //%%mm5,%%mm6\n" // mm6 = adjust_volume(src)+dst
+ movq [edi + 8], mm6 //%%mm6,8(%%edi)\n"
+ add edi, 16 //$16,%%edi\n"
+ dec ebx //%%ebx\n"
+ jnz mixloopS16
+
+endS16:
+ emms
+
+ pop ebx
+ pop esi
+ pop edi
+ }
+
+}
+
+////////////////////////////////////////////////
+// Mixing for 8 bit signed buffers
+////////////////////////////////////////////////
+
+void SDL_MixAudio_MMX_S8_VC(char* dst,char* src,unsigned int nSize,int volume)
+{
+ _asm
+ {
+
+ push edi
+ push esi
+ push ebx
+
+ mov edi, dst //movl %0,%%edi // edi = dst
+ mov esi, src //%1,%%esi // esi = src
+ mov eax, volume //%3,%%eax // eax = volume
+
+ movd mm0, eax //%%eax,%%mm0
+ movq mm1, mm0 //%%mm0,%%mm1
+ psllq mm0, 16 //$16,%%mm0
+ por mm0, mm1 //%%mm1,%%mm0
+ psllq mm0, 16 //$16,%%mm0
+ por mm0, mm1 //%%mm1,%%mm0
+ psllq mm0, 16 //$16,%%mm0
+ por mm0, mm1 //%%mm1,%%mm0
+
+ mov ebx, nSize //%2,%%ebx // ebx = size
+ shr ebx, 3 //$3,%%ebx // process 8 bytes per iteration = 8 samples
+ cmp ebx, 0 //$0,%%ebx
+ je endS8
+
+ #ifndef __WATCOMC__
+ align 16
+ #endif
+mixloopS8:
+ pxor mm2, mm2 //%%mm2,%%mm2 // mm2 = 0
+ movq mm1, [esi] //(%%esi),%%mm1 // mm1 = a|b|c|d|e|f|g|h
+ movq mm3, mm1 //%%mm1,%%mm3 // mm3 = a|b|c|d|e|f|g|h
+ // on va faire le "sign extension" en faisant un cmp avec 0 qui retourne 1 si <0, 0 si >0
+ pcmpgtb mm2, mm1 //%%mm1,%%mm2 // mm2 = 11111111|00000000|00000000....
+ punpckhbw mm1, mm2 //%%mm2,%%mm1 // mm1 = 0|a|0|b|0|c|0|d
+ punpcklbw mm3, mm2 //%%mm2,%%mm3 // mm3 = 0|e|0|f|0|g|0|h
+ movq mm2, [edi] //(%%edi),%%mm2 // mm2 = destination
+ pmullw mm1, mm0 //%%mm0,%%mm1 // mm1 = v*a|v*b|v*c|v*d
+ add esi, 8 //$8,%%esi
+ pmullw mm3, mm0 //%%mm0,%%mm3 // mm3 = v*e|v*f|v*g|v*h
+ psraw mm1, 7 //$7,%%mm1 // mm1 = v*a/128|v*b/128|v*c/128|v*d/128
+ psraw mm3, 7 //$7,%%mm3 // mm3 = v*e/128|v*f/128|v*g/128|v*h/128
+ packsswb mm3, mm1 //%%mm1,%%mm3 // mm1 = v*a/128|v*b/128|v*c/128|v*d/128|v*e/128|v*f/128|v*g/128|v*h/128
+ paddsb mm3, mm2 //%%mm2,%%mm3 // add to destination buffer
+ movq [edi], mm3 //%%mm3,(%%edi) // store back to ram
+ add edi, 8 //$8,%%edi
+ dec ebx //%%ebx
+ jnz mixloopS8
+
+endS8:
+ emms
+
+ pop ebx
+ pop esi
+ pop edi
+ }
+}
+
+#endif /* SDL_ASSEMBLY_ROUTINES */
+#endif /* SDL_BUGGY_MMX_MIXERS */
diff --git a/distrib/sdl-1.2.15/src/audio/SDL_mixer_MMX_VC.h b/distrib/sdl-1.2.15/src/audio/SDL_mixer_MMX_VC.h
new file mode 100644
index 0000000..fbd0eb8
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/SDL_mixer_MMX_VC.h
@@ -0,0 +1,38 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+
+#if defined(SDL_BUGGY_MMX_MIXERS) /* buggy, so we're disabling them. --ryan. */
+#if ((defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)) && defined(SDL_ASSEMBLY_ROUTINES)
+/* headers for MMX assembler version of SDL_MixAudio
+ Copyright 2002 Stephane Marchesin (stephane.marchesin@wanadoo.fr)
+ Converted to Intel ASM notation by Cth
+ This code is licensed under the LGPL (see COPYING for details)
+
+ Assumes buffer size in bytes is a multiple of 16
+ Assumes SDL_MIX_MAXVOLUME = 128
+*/
+void SDL_MixAudio_MMX_S16_VC(char* ,char* ,unsigned int ,int );
+void SDL_MixAudio_MMX_S8_VC(char* ,char* ,unsigned int ,int );
+#endif
+#endif
diff --git a/distrib/sdl-1.2.15/src/audio/SDL_mixer_m68k.c b/distrib/sdl-1.2.15/src/audio/SDL_mixer_m68k.c
new file mode 100644
index 0000000..22bb1cb
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/SDL_mixer_m68k.c
@@ -0,0 +1,210 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ m68k assembly mix routines
+
+ Patrice Mandin
+*/
+
+#if (defined(__m68k__) && !defined(__mcoldfire__)) && defined(__GNUC__)
+void SDL_MixAudio_m68k_U8(char* dst, char* src, long len, long volume, char* mix8)
+{
+ __asm__ __volatile__ (
+
+ "tstl %2\n"
+" beqs stoploop_u8\n"
+"mixloop_u8:\n"
+
+ /* Mix a sample */
+
+" moveq #0,%%d0\n"
+" moveq #0,%%d1\n"
+
+" moveb %1@+,%%d0\n" /* d0 = *src++ */
+" sub #128,%%d0\n" /* d0 -= 128 */
+" muls %3,%%d0\n" /* d0 *= volume (0<=volume<=128) */
+" moveb %0@,%%d1\n" /* d1 = *dst */
+" asr #7,%%d0\n" /* d0 /= 128 (SDL_MIX_MAXVOLUME) */
+" add #128,%%d0\n" /* d0 += 128 */
+
+" add %%d1,%%d0\n"
+
+" moveb %4@(%%d0:w),%0@+\n"
+
+ /* Loop till done */
+
+" subql #1,%2\n"
+" bhis mixloop_u8\n"
+"stoploop_u8:\n"
+
+ : /* no return value */
+ : /* input */
+ "a"(dst), "a"(src), "d"(len), "d"(volume), "a"(mix8)
+ : /* clobbered registers */
+ "d0", "d1", "cc", "memory"
+ );
+}
+
+void SDL_MixAudio_m68k_S8(char* dst, char* src, long len, long volume)
+{
+ __asm__ __volatile__ (
+
+ "tstl %2\n"
+" beqs stoploop_s8\n"
+" moveq #-128,%%d2\n"
+" moveq #127,%%d3\n"
+"mixloop_s8:\n"
+
+ /* Mix a sample */
+
+" moveq #0,%%d0\n"
+" moveq #0,%%d1\n"
+
+" moveb %1@+,%%d0\n" /* d0 = *src++ */
+" muls %3,%%d0\n" /* d0 *= volume (0<=volume<=128) */
+" moveb %0@,%%d1\n" /* d1 = *dst */
+" asr #7,%%d0\n" /* d0 /= 128 (SDL_MIX_MAXVOLUME) */
+
+" add %%d1,%%d0\n"
+
+" cmp %%d2,%%d0\n"
+" bges lower_limit_s8\n"
+" move %%d2,%%d0\n"
+"lower_limit_s8:\n"
+
+" cmp %%d3,%%d0\n"
+" bles upper_limit_s8\n"
+" move %%d3,%%d0\n"
+"upper_limit_s8:\n"
+" moveb %%d0,%0@+\n"
+
+ /* Loop till done */
+
+" subql #1,%2\n"
+" bhis mixloop_s8\n"
+"stoploop_s8:\n"
+
+ : /* no return value */
+ : /* input */
+ "a"(dst), "a"(src), "d"(len), "d"(volume)
+ : /* clobbered registers */
+ "d0", "d1", "d2", "d3", "cc", "memory"
+ );
+}
+
+void SDL_MixAudio_m68k_S16MSB(short* dst, short* src, long len, long volume)
+{
+ __asm__ __volatile__ (
+
+ "tstl %2\n"
+" beqs stoploop_s16msb\n"
+" movel #-32768,%%d2\n"
+" movel #32767,%%d3\n"
+" lsrl #1,%2\n"
+"mixloop_s16msb:\n"
+
+ /* Mix a sample */
+
+" move %1@+,%%d0\n" /* d0 = *src++ */
+" muls %3,%%d0\n" /* d0 *= volume (0<=volume<=128) */
+" move %0@,%%d1\n" /* d1 = *dst */
+" extl %%d1\n" /* extend d1 to 32 bits */
+" asrl #7,%%d0\n" /* d0 /= 128 (SDL_MIX_MAXVOLUME) */
+
+" addl %%d1,%%d0\n"
+
+" cmpl %%d2,%%d0\n"
+" bges lower_limit_s16msb\n"
+" move %%d2,%%d0\n"
+"lower_limit_s16msb:\n"
+
+" cmpl %%d3,%%d0\n"
+" bles upper_limit_s16msb\n"
+" move %%d3,%%d0\n"
+"upper_limit_s16msb:\n"
+" move %%d0,%0@+\n"
+
+ /* Loop till done */
+
+" subql #1,%2\n"
+" bhis mixloop_s16msb\n"
+"stoploop_s16msb:\n"
+
+ : /* no return value */
+ : /* input */
+ "a"(dst), "a"(src), "d"(len), "d"(volume)
+ : /* clobbered registers */
+ "d0", "d1", "d2", "d3", "cc", "memory"
+ );
+}
+
+void SDL_MixAudio_m68k_S16LSB(short* dst, short* src, long len, long volume)
+{
+ __asm__ __volatile__ (
+
+ "tstl %2\n"
+" beqs stoploop_s16lsb\n"
+" movel #-32768,%%d2\n"
+" movel #32767,%%d3\n"
+" lsrl #1,%2\n"
+"mixloop_s16lsb:\n"
+
+ /* Mix a sample */
+
+" move %1@+,%%d0\n" /* d0 = *src++ */
+" rorw #8,%%d0\n"
+" muls %3,%%d0\n" /* d0 *= volume (0<=volume<=128) */
+" move %0@,%%d1\n" /* d1 = *dst */
+" rorw #8,%%d1\n"
+" extl %%d1\n" /* extend d1 to 32 bits */
+" asrl #7,%%d0\n" /* d0 /= 128 (SDL_MIX_MAXVOLUME) */
+
+" addl %%d1,%%d0\n"
+
+" cmpl %%d2,%%d0\n"
+" bges lower_limit_s16lsb\n"
+" move %%d2,%%d0\n"
+"lower_limit_s16lsb:\n"
+
+" cmpl %%d3,%%d0\n"
+" bles upper_limit_s16lsb\n"
+" move %%d3,%%d0\n"
+"upper_limit_s16lsb:\n"
+" rorw #8,%%d0\n"
+" move %%d0,%0@+\n"
+
+ /* Loop till done */
+
+" subql #1,%2\n"
+" bhis mixloop_s16lsb\n"
+"stoploop_s16lsb:\n"
+
+ : /* no return value */
+ : /* input */
+ "a"(dst), "a"(src), "d"(len), "d"(volume)
+ : /* clobbered registers */
+ "d0", "d1", "d2", "d3", "cc", "memory"
+ );
+}
+#endif
diff --git a/distrib/sdl-1.2.15/src/audio/SDL_mixer_m68k.h b/distrib/sdl-1.2.15/src/audio/SDL_mixer_m68k.h
new file mode 100644
index 0000000..673df00
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/SDL_mixer_m68k.h
@@ -0,0 +1,36 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ m68k assembly mix routines
+
+ Patrice Mandin
+*/
+
+#if (defined(__m68k__) && !defined(__mcoldfire__)) && defined(__GNUC__)
+void SDL_MixAudio_m68k_U8(char* dst,char* src, long len, long volume, char* mix8);
+void SDL_MixAudio_m68k_S8(char* dst,char* src, long len, long volume);
+
+void SDL_MixAudio_m68k_S16MSB(short* dst,short* src, long len, long volume);
+void SDL_MixAudio_m68k_S16LSB(short* dst,short* src, long len, long volume);
+#endif
diff --git a/distrib/sdl-1.2.15/src/audio/SDL_sysaudio.h b/distrib/sdl-1.2.15/src/audio/SDL_sysaudio.h
new file mode 100644
index 0000000..74ac21d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/SDL_sysaudio.h
@@ -0,0 +1,186 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is SDL_free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_sysaudio_h
+#define _SDL_sysaudio_h
+
+#include "SDL_mutex.h"
+#include "SDL_thread.h"
+
+/* The SDL audio driver */
+typedef struct SDL_AudioDevice SDL_AudioDevice;
+
+/* Define the SDL audio driver structure */
+#define _THIS SDL_AudioDevice *_this
+#ifndef _STATUS
+#define _STATUS SDL_status *status
+#endif
+struct SDL_AudioDevice {
+ /* * * */
+ /* The name of this audio driver */
+ const char *name;
+
+ /* * * */
+ /* The description of this audio driver */
+ const char *desc;
+
+ /* * * */
+ /* Public driver functions */
+ int (*OpenAudio)(_THIS, SDL_AudioSpec *spec);
+ void (*ThreadInit)(_THIS); /* Called by audio thread at start */
+ void (*WaitAudio)(_THIS);
+ void (*PlayAudio)(_THIS);
+ Uint8 *(*GetAudioBuf)(_THIS);
+ void (*WaitDone)(_THIS);
+ void (*CloseAudio)(_THIS);
+
+ /* * * */
+ /* Lock / Unlock functions added for the Mac port */
+ void (*LockAudio)(_THIS);
+ void (*UnlockAudio)(_THIS);
+
+ void (*SetCaption)(_THIS, const char *caption);
+
+ /* * * */
+ /* Data common to all devices */
+
+ /* The current audio specification (shared with audio thread) */
+ SDL_AudioSpec spec;
+
+ /* An audio conversion block for audio format emulation */
+ SDL_AudioCVT convert;
+
+ /* Current state flags */
+ int enabled;
+ int paused;
+ int opened;
+
+ /* Fake audio buffer for when the audio hardware is busy */
+ Uint8 *fake_stream;
+
+ /* A semaphore for locking the mixing buffers */
+ SDL_mutex *mixer_lock;
+
+ /* A thread to feed the audio device */
+ SDL_Thread *thread;
+ Uint32 threadid;
+
+ /* * * */
+ /* Data private to this driver */
+ struct SDL_PrivateAudioData *hidden;
+
+ /* * * */
+ /* The function used to dispose of this structure */
+ void (*free)(_THIS);
+};
+#undef _THIS
+
+typedef struct AudioBootStrap {
+ const char *name;
+ const char *desc;
+ int (*available)(void);
+ SDL_AudioDevice *(*create)(int devindex);
+} AudioBootStrap;
+
+#if SDL_AUDIO_DRIVER_BSD
+extern AudioBootStrap BSD_AUDIO_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_PULSE
+extern AudioBootStrap PULSE_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_ALSA
+extern AudioBootStrap ALSA_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_OSS
+extern AudioBootStrap DSP_bootstrap;
+extern AudioBootStrap DMA_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_QNXNTO
+extern AudioBootStrap QNXNTOAUDIO_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_SUNAUDIO
+extern AudioBootStrap SUNAUDIO_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_DMEDIA
+extern AudioBootStrap DMEDIA_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_ARTS
+extern AudioBootStrap ARTS_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_ESD
+extern AudioBootStrap ESD_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_NAS
+extern AudioBootStrap NAS_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_DSOUND
+extern AudioBootStrap DSOUND_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_WAVEOUT
+extern AudioBootStrap WAVEOUT_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_PAUD
+extern AudioBootStrap Paud_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_BAUDIO
+extern AudioBootStrap BAUDIO_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_COREAUDIO
+extern AudioBootStrap COREAUDIO_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_SNDMGR
+extern AudioBootStrap SNDMGR_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_MINT
+extern AudioBootStrap MINTAUDIO_GSXB_bootstrap;
+extern AudioBootStrap MINTAUDIO_MCSN_bootstrap;
+extern AudioBootStrap MINTAUDIO_STFA_bootstrap;
+extern AudioBootStrap MINTAUDIO_XBIOS_bootstrap;
+extern AudioBootStrap MINTAUDIO_DMA8_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_DISK
+extern AudioBootStrap DISKAUD_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_DUMMY
+extern AudioBootStrap DUMMYAUD_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_DC
+extern AudioBootStrap DCAUD_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_NDS
+extern AudioBootStrap NDSAUD_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_MMEAUDIO
+extern AudioBootStrap MMEAUDIO_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_DART
+extern AudioBootStrap DART_bootstrap;
+#endif
+#if SDL_AUDIO_DRIVER_EPOCAUDIO
+extern AudioBootStrap EPOCAudio_bootstrap;
+#endif
+
+/* This is the current audio device */
+extern SDL_AudioDevice *current_audio;
+
+#endif /* _SDL_sysaudio_h */
diff --git a/distrib/sdl-1.2.15/src/audio/SDL_wave.c b/distrib/sdl-1.2.15/src/audio/SDL_wave.c
new file mode 100644
index 0000000..b4ad6c7
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/SDL_wave.c
@@ -0,0 +1,596 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Microsoft WAVE file loading routines */
+
+#include "SDL_audio.h"
+#include "SDL_wave.h"
+
+
+static int ReadChunk(SDL_RWops *src, Chunk *chunk);
+
+struct MS_ADPCM_decodestate {
+ Uint8 hPredictor;
+ Uint16 iDelta;
+ Sint16 iSamp1;
+ Sint16 iSamp2;
+};
+static struct MS_ADPCM_decoder {
+ WaveFMT wavefmt;
+ Uint16 wSamplesPerBlock;
+ Uint16 wNumCoef;
+ Sint16 aCoeff[7][2];
+ /* * * */
+ struct MS_ADPCM_decodestate state[2];
+} MS_ADPCM_state;
+
+static int InitMS_ADPCM(WaveFMT *format)
+{
+ Uint8 *rogue_feel;
+ int i;
+
+ /* Set the rogue pointer to the MS_ADPCM specific data */
+ MS_ADPCM_state.wavefmt.encoding = SDL_SwapLE16(format->encoding);
+ MS_ADPCM_state.wavefmt.channels = SDL_SwapLE16(format->channels);
+ MS_ADPCM_state.wavefmt.frequency = SDL_SwapLE32(format->frequency);
+ MS_ADPCM_state.wavefmt.byterate = SDL_SwapLE32(format->byterate);
+ MS_ADPCM_state.wavefmt.blockalign = SDL_SwapLE16(format->blockalign);
+ MS_ADPCM_state.wavefmt.bitspersample =
+ SDL_SwapLE16(format->bitspersample);
+ rogue_feel = (Uint8 *)format+sizeof(*format);
+ if ( sizeof(*format) == 16 ) {
+ rogue_feel += sizeof(Uint16);
+ }
+ MS_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1]<<8)|rogue_feel[0]);
+ rogue_feel += sizeof(Uint16);
+ MS_ADPCM_state.wNumCoef = ((rogue_feel[1]<<8)|rogue_feel[0]);
+ rogue_feel += sizeof(Uint16);
+ if ( MS_ADPCM_state.wNumCoef != 7 ) {
+ SDL_SetError("Unknown set of MS_ADPCM coefficients");
+ return(-1);
+ }
+ for ( i=0; i<MS_ADPCM_state.wNumCoef; ++i ) {
+ MS_ADPCM_state.aCoeff[i][0] = ((rogue_feel[1]<<8)|rogue_feel[0]);
+ rogue_feel += sizeof(Uint16);
+ MS_ADPCM_state.aCoeff[i][1] = ((rogue_feel[1]<<8)|rogue_feel[0]);
+ rogue_feel += sizeof(Uint16);
+ }
+ return(0);
+}
+
+static Sint32 MS_ADPCM_nibble(struct MS_ADPCM_decodestate *state,
+ Uint8 nybble, Sint16 *coeff)
+{
+ const Sint32 max_audioval = ((1<<(16-1))-1);
+ const Sint32 min_audioval = -(1<<(16-1));
+ const Sint32 adaptive[] = {
+ 230, 230, 230, 230, 307, 409, 512, 614,
+ 768, 614, 512, 409, 307, 230, 230, 230
+ };
+ Sint32 new_sample, delta;
+
+ new_sample = ((state->iSamp1 * coeff[0]) +
+ (state->iSamp2 * coeff[1]))/256;
+ if ( nybble & 0x08 ) {
+ new_sample += state->iDelta * (nybble-0x10);
+ } else {
+ new_sample += state->iDelta * nybble;
+ }
+ if ( new_sample < min_audioval ) {
+ new_sample = min_audioval;
+ } else
+ if ( new_sample > max_audioval ) {
+ new_sample = max_audioval;
+ }
+ delta = ((Sint32)state->iDelta * adaptive[nybble])/256;
+ if ( delta < 16 ) {
+ delta = 16;
+ }
+ state->iDelta = (Uint16)delta;
+ state->iSamp2 = state->iSamp1;
+ state->iSamp1 = (Sint16)new_sample;
+ return(new_sample);
+}
+
+static int MS_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len)
+{
+ struct MS_ADPCM_decodestate *state[2];
+ Uint8 *freeable, *encoded, *decoded;
+ Sint32 encoded_len, samplesleft;
+ Sint8 nybble, stereo;
+ Sint16 *coeff[2];
+ Sint32 new_sample;
+
+ /* Allocate the proper sized output buffer */
+ encoded_len = *audio_len;
+ encoded = *audio_buf;
+ freeable = *audio_buf;
+ *audio_len = (encoded_len/MS_ADPCM_state.wavefmt.blockalign) *
+ MS_ADPCM_state.wSamplesPerBlock*
+ MS_ADPCM_state.wavefmt.channels*sizeof(Sint16);
+ *audio_buf = (Uint8 *)SDL_malloc(*audio_len);
+ if ( *audio_buf == NULL ) {
+ SDL_Error(SDL_ENOMEM);
+ return(-1);
+ }
+ decoded = *audio_buf;
+
+ /* Get ready... Go! */
+ stereo = (MS_ADPCM_state.wavefmt.channels == 2);
+ state[0] = &MS_ADPCM_state.state[0];
+ state[1] = &MS_ADPCM_state.state[stereo];
+ while ( encoded_len >= MS_ADPCM_state.wavefmt.blockalign ) {
+ /* Grab the initial information for this block */
+ state[0]->hPredictor = *encoded++;
+ if ( stereo ) {
+ state[1]->hPredictor = *encoded++;
+ }
+ state[0]->iDelta = ((encoded[1]<<8)|encoded[0]);
+ encoded += sizeof(Sint16);
+ if ( stereo ) {
+ state[1]->iDelta = ((encoded[1]<<8)|encoded[0]);
+ encoded += sizeof(Sint16);
+ }
+ state[0]->iSamp1 = ((encoded[1]<<8)|encoded[0]);
+ encoded += sizeof(Sint16);
+ if ( stereo ) {
+ state[1]->iSamp1 = ((encoded[1]<<8)|encoded[0]);
+ encoded += sizeof(Sint16);
+ }
+ state[0]->iSamp2 = ((encoded[1]<<8)|encoded[0]);
+ encoded += sizeof(Sint16);
+ if ( stereo ) {
+ state[1]->iSamp2 = ((encoded[1]<<8)|encoded[0]);
+ encoded += sizeof(Sint16);
+ }
+ coeff[0] = MS_ADPCM_state.aCoeff[state[0]->hPredictor];
+ coeff[1] = MS_ADPCM_state.aCoeff[state[1]->hPredictor];
+
+ /* Store the two initial samples we start with */
+ decoded[0] = state[0]->iSamp2&0xFF;
+ decoded[1] = state[0]->iSamp2>>8;
+ decoded += 2;
+ if ( stereo ) {
+ decoded[0] = state[1]->iSamp2&0xFF;
+ decoded[1] = state[1]->iSamp2>>8;
+ decoded += 2;
+ }
+ decoded[0] = state[0]->iSamp1&0xFF;
+ decoded[1] = state[0]->iSamp1>>8;
+ decoded += 2;
+ if ( stereo ) {
+ decoded[0] = state[1]->iSamp1&0xFF;
+ decoded[1] = state[1]->iSamp1>>8;
+ decoded += 2;
+ }
+
+ /* Decode and store the other samples in this block */
+ samplesleft = (MS_ADPCM_state.wSamplesPerBlock-2)*
+ MS_ADPCM_state.wavefmt.channels;
+ while ( samplesleft > 0 ) {
+ nybble = (*encoded)>>4;
+ new_sample = MS_ADPCM_nibble(state[0],nybble,coeff[0]);
+ decoded[0] = new_sample&0xFF;
+ new_sample >>= 8;
+ decoded[1] = new_sample&0xFF;
+ decoded += 2;
+
+ nybble = (*encoded)&0x0F;
+ new_sample = MS_ADPCM_nibble(state[1],nybble,coeff[1]);
+ decoded[0] = new_sample&0xFF;
+ new_sample >>= 8;
+ decoded[1] = new_sample&0xFF;
+ decoded += 2;
+
+ ++encoded;
+ samplesleft -= 2;
+ }
+ encoded_len -= MS_ADPCM_state.wavefmt.blockalign;
+ }
+ SDL_free(freeable);
+ return(0);
+}
+
+struct IMA_ADPCM_decodestate {
+ Sint32 sample;
+ Sint8 index;
+};
+static struct IMA_ADPCM_decoder {
+ WaveFMT wavefmt;
+ Uint16 wSamplesPerBlock;
+ /* * * */
+ struct IMA_ADPCM_decodestate state[2];
+} IMA_ADPCM_state;
+
+static int InitIMA_ADPCM(WaveFMT *format)
+{
+ Uint8 *rogue_feel;
+
+ /* Set the rogue pointer to the IMA_ADPCM specific data */
+ IMA_ADPCM_state.wavefmt.encoding = SDL_SwapLE16(format->encoding);
+ IMA_ADPCM_state.wavefmt.channels = SDL_SwapLE16(format->channels);
+ IMA_ADPCM_state.wavefmt.frequency = SDL_SwapLE32(format->frequency);
+ IMA_ADPCM_state.wavefmt.byterate = SDL_SwapLE32(format->byterate);
+ IMA_ADPCM_state.wavefmt.blockalign = SDL_SwapLE16(format->blockalign);
+ IMA_ADPCM_state.wavefmt.bitspersample =
+ SDL_SwapLE16(format->bitspersample);
+ rogue_feel = (Uint8 *)format+sizeof(*format);
+ if ( sizeof(*format) == 16 ) {
+ rogue_feel += sizeof(Uint16);
+ }
+ IMA_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1]<<8)|rogue_feel[0]);
+ return(0);
+}
+
+static Sint32 IMA_ADPCM_nibble(struct IMA_ADPCM_decodestate *state,Uint8 nybble)
+{
+ const Sint32 max_audioval = ((1<<(16-1))-1);
+ const Sint32 min_audioval = -(1<<(16-1));
+ const int index_table[16] = {
+ -1, -1, -1, -1,
+ 2, 4, 6, 8,
+ -1, -1, -1, -1,
+ 2, 4, 6, 8
+ };
+ const Sint32 step_table[89] = {
+ 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, 25, 28, 31,
+ 34, 37, 41, 45, 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 130,
+ 143, 157, 173, 190, 209, 230, 253, 279, 307, 337, 371, 408,
+ 449, 494, 544, 598, 658, 724, 796, 876, 963, 1060, 1166, 1282,
+ 1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024, 3327,
+ 3660, 4026, 4428, 4871, 5358, 5894, 6484, 7132, 7845, 8630,
+ 9493, 10442, 11487, 12635, 13899, 15289, 16818, 18500, 20350,
+ 22385, 24623, 27086, 29794, 32767
+ };
+ Sint32 delta, step;
+
+ /* Compute difference and new sample value */
+ step = step_table[state->index];
+ delta = step >> 3;
+ if ( nybble & 0x04 ) delta += step;
+ if ( nybble & 0x02 ) delta += (step >> 1);
+ if ( nybble & 0x01 ) delta += (step >> 2);
+ if ( nybble & 0x08 ) delta = -delta;
+ state->sample += delta;
+
+ /* Update index value */
+ state->index += index_table[nybble];
+ if ( state->index > 88 ) {
+ state->index = 88;
+ } else
+ if ( state->index < 0 ) {
+ state->index = 0;
+ }
+
+ /* Clamp output sample */
+ if ( state->sample > max_audioval ) {
+ state->sample = max_audioval;
+ } else
+ if ( state->sample < min_audioval ) {
+ state->sample = min_audioval;
+ }
+ return(state->sample);
+}
+
+/* Fill the decode buffer with a channel block of data (8 samples) */
+static void Fill_IMA_ADPCM_block(Uint8 *decoded, Uint8 *encoded,
+ int channel, int numchannels, struct IMA_ADPCM_decodestate *state)
+{
+ int i;
+ Sint8 nybble;
+ Sint32 new_sample;
+
+ decoded += (channel * 2);
+ for ( i=0; i<4; ++i ) {
+ nybble = (*encoded)&0x0F;
+ new_sample = IMA_ADPCM_nibble(state, nybble);
+ decoded[0] = new_sample&0xFF;
+ new_sample >>= 8;
+ decoded[1] = new_sample&0xFF;
+ decoded += 2 * numchannels;
+
+ nybble = (*encoded)>>4;
+ new_sample = IMA_ADPCM_nibble(state, nybble);
+ decoded[0] = new_sample&0xFF;
+ new_sample >>= 8;
+ decoded[1] = new_sample&0xFF;
+ decoded += 2 * numchannels;
+
+ ++encoded;
+ }
+}
+
+static int IMA_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len)
+{
+ struct IMA_ADPCM_decodestate *state;
+ Uint8 *freeable, *encoded, *decoded;
+ Sint32 encoded_len, samplesleft;
+ unsigned int c, channels;
+
+ /* Check to make sure we have enough variables in the state array */
+ channels = IMA_ADPCM_state.wavefmt.channels;
+ if ( channels > SDL_arraysize(IMA_ADPCM_state.state) ) {
+ SDL_SetError("IMA ADPCM decoder can only handle %d channels",
+ SDL_arraysize(IMA_ADPCM_state.state));
+ return(-1);
+ }
+ state = IMA_ADPCM_state.state;
+
+ /* Allocate the proper sized output buffer */
+ encoded_len = *audio_len;
+ encoded = *audio_buf;
+ freeable = *audio_buf;
+ *audio_len = (encoded_len/IMA_ADPCM_state.wavefmt.blockalign) *
+ IMA_ADPCM_state.wSamplesPerBlock*
+ IMA_ADPCM_state.wavefmt.channels*sizeof(Sint16);
+ *audio_buf = (Uint8 *)SDL_malloc(*audio_len);
+ if ( *audio_buf == NULL ) {
+ SDL_Error(SDL_ENOMEM);
+ return(-1);
+ }
+ decoded = *audio_buf;
+
+ /* Get ready... Go! */
+ while ( encoded_len >= IMA_ADPCM_state.wavefmt.blockalign ) {
+ /* Grab the initial information for this block */
+ for ( c=0; c<channels; ++c ) {
+ /* Fill the state information for this block */
+ state[c].sample = ((encoded[1]<<8)|encoded[0]);
+ encoded += 2;
+ if ( state[c].sample & 0x8000 ) {
+ state[c].sample -= 0x10000;
+ }
+ state[c].index = *encoded++;
+ /* Reserved byte in buffer header, should be 0 */
+ if ( *encoded++ != 0 ) {
+ /* Uh oh, corrupt data? Buggy code? */;
+ }
+
+ /* Store the initial sample we start with */
+ decoded[0] = (Uint8)(state[c].sample&0xFF);
+ decoded[1] = (Uint8)(state[c].sample>>8);
+ decoded += 2;
+ }
+
+ /* Decode and store the other samples in this block */
+ samplesleft = (IMA_ADPCM_state.wSamplesPerBlock-1)*channels;
+ while ( samplesleft > 0 ) {
+ for ( c=0; c<channels; ++c ) {
+ Fill_IMA_ADPCM_block(decoded, encoded,
+ c, channels, &state[c]);
+ encoded += 4;
+ samplesleft -= 8;
+ }
+ decoded += (channels * 8 * 2);
+ }
+ encoded_len -= IMA_ADPCM_state.wavefmt.blockalign;
+ }
+ SDL_free(freeable);
+ return(0);
+}
+
+SDL_AudioSpec * SDL_LoadWAV_RW (SDL_RWops *src, int freesrc,
+ SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
+{
+ int was_error;
+ Chunk chunk;
+ int lenread;
+ int MS_ADPCM_encoded, IMA_ADPCM_encoded;
+ int samplesize;
+
+ /* WAV magic header */
+ Uint32 RIFFchunk;
+ Uint32 wavelen = 0;
+ Uint32 WAVEmagic;
+ Uint32 headerDiff = 0;
+
+ /* FMT chunk */
+ WaveFMT *format = NULL;
+
+ /* Make sure we are passed a valid data source */
+ was_error = 0;
+ if ( src == NULL ) {
+ was_error = 1;
+ goto done;
+ }
+
+ /* Check the magic header */
+ RIFFchunk = SDL_ReadLE32(src);
+ wavelen = SDL_ReadLE32(src);
+ if ( wavelen == WAVE ) { /* The RIFFchunk has already been read */
+ WAVEmagic = wavelen;
+ wavelen = RIFFchunk;
+ RIFFchunk = RIFF;
+ } else {
+ WAVEmagic = SDL_ReadLE32(src);
+ }
+ if ( (RIFFchunk != RIFF) || (WAVEmagic != WAVE) ) {
+ SDL_SetError("Unrecognized file type (not WAVE)");
+ was_error = 1;
+ goto done;
+ }
+ headerDiff += sizeof(Uint32); /* for WAVE */
+
+ /* Read the audio data format chunk */
+ chunk.data = NULL;
+ do {
+ if ( chunk.data != NULL ) {
+ SDL_free(chunk.data);
+ chunk.data = NULL;
+ }
+ lenread = ReadChunk(src, &chunk);
+ if ( lenread < 0 ) {
+ was_error = 1;
+ goto done;
+ }
+ /* 2 Uint32's for chunk header+len, plus the lenread */
+ headerDiff += lenread + 2 * sizeof(Uint32);
+ } while ( (chunk.magic == FACT) || (chunk.magic == LIST) );
+
+ /* Decode the audio data format */
+ format = (WaveFMT *)chunk.data;
+ if ( chunk.magic != FMT ) {
+ SDL_SetError("Complex WAVE files not supported");
+ was_error = 1;
+ goto done;
+ }
+ MS_ADPCM_encoded = IMA_ADPCM_encoded = 0;
+ switch (SDL_SwapLE16(format->encoding)) {
+ case PCM_CODE:
+ /* We can understand this */
+ break;
+ case MS_ADPCM_CODE:
+ /* Try to understand this */
+ if ( InitMS_ADPCM(format) < 0 ) {
+ was_error = 1;
+ goto done;
+ }
+ MS_ADPCM_encoded = 1;
+ break;
+ case IMA_ADPCM_CODE:
+ /* Try to understand this */
+ if ( InitIMA_ADPCM(format) < 0 ) {
+ was_error = 1;
+ goto done;
+ }
+ IMA_ADPCM_encoded = 1;
+ break;
+ case MP3_CODE:
+ SDL_SetError("MPEG Layer 3 data not supported",
+ SDL_SwapLE16(format->encoding));
+ was_error = 1;
+ goto done;
+ default:
+ SDL_SetError("Unknown WAVE data format: 0x%.4x",
+ SDL_SwapLE16(format->encoding));
+ was_error = 1;
+ goto done;
+ }
+ SDL_memset(spec, 0, (sizeof *spec));
+ spec->freq = SDL_SwapLE32(format->frequency);
+ switch (SDL_SwapLE16(format->bitspersample)) {
+ case 4:
+ if ( MS_ADPCM_encoded || IMA_ADPCM_encoded ) {
+ spec->format = AUDIO_S16;
+ } else {
+ was_error = 1;
+ }
+ break;
+ case 8:
+ spec->format = AUDIO_U8;
+ break;
+ case 16:
+ spec->format = AUDIO_S16;
+ break;
+ default:
+ was_error = 1;
+ break;
+ }
+ if ( was_error ) {
+ SDL_SetError("Unknown %d-bit PCM data format",
+ SDL_SwapLE16(format->bitspersample));
+ goto done;
+ }
+ spec->channels = (Uint8)SDL_SwapLE16(format->channels);
+ spec->samples = 4096; /* Good default buffer size */
+
+ /* Read the audio data chunk */
+ *audio_buf = NULL;
+ do {
+ if ( *audio_buf != NULL ) {
+ SDL_free(*audio_buf);
+ *audio_buf = NULL;
+ }
+ lenread = ReadChunk(src, &chunk);
+ if ( lenread < 0 ) {
+ was_error = 1;
+ goto done;
+ }
+ *audio_len = lenread;
+ *audio_buf = chunk.data;
+ if(chunk.magic != DATA) headerDiff += lenread + 2 * sizeof(Uint32);
+ } while ( chunk.magic != DATA );
+ headerDiff += 2 * sizeof(Uint32); /* for the data chunk and len */
+
+ if ( MS_ADPCM_encoded ) {
+ if ( MS_ADPCM_decode(audio_buf, audio_len) < 0 ) {
+ was_error = 1;
+ goto done;
+ }
+ }
+ if ( IMA_ADPCM_encoded ) {
+ if ( IMA_ADPCM_decode(audio_buf, audio_len) < 0 ) {
+ was_error = 1;
+ goto done;
+ }
+ }
+
+ /* Don't return a buffer that isn't a multiple of samplesize */
+ samplesize = ((spec->format & 0xFF)/8)*spec->channels;
+ *audio_len &= ~(samplesize-1);
+
+done:
+ if ( format != NULL ) {
+ SDL_free(format);
+ }
+ if ( src ) {
+ if ( freesrc ) {
+ SDL_RWclose(src);
+ } else {
+ /* seek to the end of the file (given by the RIFF chunk) */
+ SDL_RWseek(src, wavelen - chunk.length - headerDiff, RW_SEEK_CUR);
+ }
+ }
+ if ( was_error ) {
+ spec = NULL;
+ }
+ return(spec);
+}
+
+/* Since the WAV memory is allocated in the shared library, it must also
+ be freed here. (Necessary under Win32, VC++)
+ */
+void SDL_FreeWAV(Uint8 *audio_buf)
+{
+ if ( audio_buf != NULL ) {
+ SDL_free(audio_buf);
+ }
+}
+
+static int ReadChunk(SDL_RWops *src, Chunk *chunk)
+{
+ chunk->magic = SDL_ReadLE32(src);
+ chunk->length = SDL_ReadLE32(src);
+ chunk->data = (Uint8 *)SDL_malloc(chunk->length);
+ if ( chunk->data == NULL ) {
+ SDL_Error(SDL_ENOMEM);
+ return(-1);
+ }
+ if ( SDL_RWread(src, chunk->data, chunk->length, 1) != 1 ) {
+ SDL_Error(SDL_EFREAD);
+ SDL_free(chunk->data);
+ chunk->data = NULL;
+ return(-1);
+ }
+ return(chunk->length);
+}
diff --git a/distrib/sdl-1.2.15/src/audio/SDL_wave.h b/distrib/sdl-1.2.15/src/audio/SDL_wave.h
new file mode 100644
index 0000000..53b12e7
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/SDL_wave.h
@@ -0,0 +1,62 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is SDL_free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* WAVE files are little-endian */
+
+/*******************************************/
+/* Define values for Microsoft WAVE format */
+/*******************************************/
+#define RIFF 0x46464952 /* "RIFF" */
+#define WAVE 0x45564157 /* "WAVE" */
+#define FACT 0x74636166 /* "fact" */
+#define LIST 0x5453494c /* "LIST" */
+#define FMT 0x20746D66 /* "fmt " */
+#define DATA 0x61746164 /* "data" */
+#define PCM_CODE 0x0001
+#define MS_ADPCM_CODE 0x0002
+#define IMA_ADPCM_CODE 0x0011
+#define MP3_CODE 0x0055
+#define WAVE_MONO 1
+#define WAVE_STEREO 2
+
+/* Normally, these three chunks come consecutively in a WAVE file */
+typedef struct WaveFMT {
+/* Not saved in the chunk we read:
+ Uint32 FMTchunk;
+ Uint32 fmtlen;
+*/
+ Uint16 encoding;
+ Uint16 channels; /* 1 = mono, 2 = stereo */
+ Uint32 frequency; /* One of 11025, 22050, or 44100 Hz */
+ Uint32 byterate; /* Average bytes per second */
+ Uint16 blockalign; /* Bytes per sample block */
+ Uint16 bitspersample; /* One of 8, 12, 16, or 4 for ADPCM */
+} WaveFMT;
+
+/* The general chunk found in the WAVE file */
+typedef struct Chunk {
+ Uint32 magic;
+ Uint32 length;
+ Uint8 *data;
+} Chunk;
+
diff --git a/distrib/sdl-1.2.15/src/audio/alsa/SDL_alsa_audio.c b/distrib/sdl-1.2.15/src/audio/alsa/SDL_alsa_audio.c
new file mode 100644
index 0000000..f10733e
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/alsa/SDL_alsa_audio.c
@@ -0,0 +1,619 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Allow access to a raw mixing buffer */
+
+#include <sys/types.h>
+#include <signal.h> /* For kill() */
+
+#include "SDL_timer.h"
+#include "SDL_audio.h"
+#include "../SDL_audiomem.h"
+#include "../SDL_audio_c.h"
+#include "SDL_alsa_audio.h"
+
+#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
+#include "SDL_name.h"
+#include "SDL_loadso.h"
+#else
+#define SDL_NAME(X) X
+#endif
+
+
+/* The tag name used by ALSA audio */
+#define DRIVER_NAME "alsa"
+
+/* Audio driver functions */
+static int ALSA_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void ALSA_WaitAudio(_THIS);
+static void ALSA_PlayAudio(_THIS);
+static Uint8 *ALSA_GetAudioBuf(_THIS);
+static void ALSA_CloseAudio(_THIS);
+
+#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
+
+static const char *alsa_library = SDL_AUDIO_DRIVER_ALSA_DYNAMIC;
+static void *alsa_handle = NULL;
+static int alsa_loaded = 0;
+
+static int (*SDL_NAME(snd_pcm_open))(snd_pcm_t **pcm, const char *name, snd_pcm_stream_t stream, int mode);
+static int (*SDL_NAME(snd_pcm_close))(snd_pcm_t *pcm);
+static snd_pcm_sframes_t (*SDL_NAME(snd_pcm_writei))(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
+static int (*SDL_NAME(snd_pcm_recover))(snd_pcm_t *pcm, int err, int silent);
+static int (*SDL_NAME(snd_pcm_prepare))(snd_pcm_t *pcm);
+static int (*SDL_NAME(snd_pcm_drain))(snd_pcm_t *pcm);
+static const char *(*SDL_NAME(snd_strerror))(int errnum);
+static size_t (*SDL_NAME(snd_pcm_hw_params_sizeof))(void);
+static size_t (*SDL_NAME(snd_pcm_sw_params_sizeof))(void);
+static void (*SDL_NAME(snd_pcm_hw_params_copy))(snd_pcm_hw_params_t *dst, const snd_pcm_hw_params_t *src);
+static int (*SDL_NAME(snd_pcm_hw_params_any))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
+static int (*SDL_NAME(snd_pcm_hw_params_set_access))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t access);
+static int (*SDL_NAME(snd_pcm_hw_params_set_format))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val);
+static int (*SDL_NAME(snd_pcm_hw_params_set_channels))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val);
+static int (*SDL_NAME(snd_pcm_hw_params_get_channels))(const snd_pcm_hw_params_t *params, unsigned int *val);
+static int (*SDL_NAME(snd_pcm_hw_params_set_rate_near))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+static int (*SDL_NAME(snd_pcm_hw_params_set_period_size_near))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir);
+static int (*SDL_NAME(snd_pcm_hw_params_get_period_size))(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir);
+static int (*SDL_NAME(snd_pcm_hw_params_set_periods_near))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+static int (*SDL_NAME(snd_pcm_hw_params_get_periods))(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir);
+static int (*SDL_NAME(snd_pcm_hw_params_set_buffer_size_near))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
+static int (*SDL_NAME(snd_pcm_hw_params_get_buffer_size))(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
+static int (*SDL_NAME(snd_pcm_hw_params))(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
+/*
+*/
+static int (*SDL_NAME(snd_pcm_sw_params_set_avail_min))(snd_pcm_t *pcm, snd_pcm_sw_params_t *swparams, snd_pcm_uframes_t val);
+static int (*SDL_NAME(snd_pcm_sw_params_current))(snd_pcm_t *pcm, snd_pcm_sw_params_t *swparams);
+static int (*SDL_NAME(snd_pcm_sw_params_set_start_threshold))(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val);
+static int (*SDL_NAME(snd_pcm_sw_params))(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
+static int (*SDL_NAME(snd_pcm_nonblock))(snd_pcm_t *pcm, int nonblock);
+static int (*SDL_NAME(snd_pcm_wait))(snd_pcm_t *pcm, int timeout);
+#define snd_pcm_hw_params_sizeof SDL_NAME(snd_pcm_hw_params_sizeof)
+#define snd_pcm_sw_params_sizeof SDL_NAME(snd_pcm_sw_params_sizeof)
+
+/* cast funcs to char* first, to please GCC's strict aliasing rules. */
+static struct {
+ const char *name;
+ void **func;
+} alsa_functions[] = {
+ { "snd_pcm_open", (void**)(char*)&SDL_NAME(snd_pcm_open) },
+ { "snd_pcm_close", (void**)(char*)&SDL_NAME(snd_pcm_close) },
+ { "snd_pcm_writei", (void**)(char*)&SDL_NAME(snd_pcm_writei) },
+ { "snd_pcm_recover", (void**)(char*)&SDL_NAME(snd_pcm_recover) },
+ { "snd_pcm_prepare", (void**)(char*)&SDL_NAME(snd_pcm_prepare) },
+ { "snd_pcm_drain", (void**)(char*)&SDL_NAME(snd_pcm_drain) },
+ { "snd_strerror", (void**)(char*)&SDL_NAME(snd_strerror) },
+ { "snd_pcm_hw_params_sizeof", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_sizeof) },
+ { "snd_pcm_sw_params_sizeof", (void**)(char*)&SDL_NAME(snd_pcm_sw_params_sizeof) },
+ { "snd_pcm_hw_params_copy", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_copy) },
+ { "snd_pcm_hw_params_any", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_any) },
+ { "snd_pcm_hw_params_set_access", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_set_access) },
+ { "snd_pcm_hw_params_set_format", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_set_format) },
+ { "snd_pcm_hw_params_set_channels", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_set_channels) },
+ { "snd_pcm_hw_params_get_channels", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_get_channels) },
+ { "snd_pcm_hw_params_set_rate_near", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_set_rate_near) },
+ { "snd_pcm_hw_params_set_period_size_near", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_set_period_size_near) },
+ { "snd_pcm_hw_params_get_period_size", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_get_period_size) },
+ { "snd_pcm_hw_params_set_periods_near", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_set_periods_near) },
+ { "snd_pcm_hw_params_get_periods", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_get_periods) },
+ { "snd_pcm_hw_params_set_buffer_size_near", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_set_buffer_size_near) },
+ { "snd_pcm_hw_params_get_buffer_size", (void**)(char*)&SDL_NAME(snd_pcm_hw_params_get_buffer_size) },
+ { "snd_pcm_hw_params", (void**)(char*)&SDL_NAME(snd_pcm_hw_params) },
+ { "snd_pcm_sw_params_set_avail_min", (void**)(char*)&SDL_NAME(snd_pcm_sw_params_set_avail_min) },
+ { "snd_pcm_sw_params_current", (void**)(char*)&SDL_NAME(snd_pcm_sw_params_current) },
+ { "snd_pcm_sw_params_set_start_threshold", (void**)(char*)&SDL_NAME(snd_pcm_sw_params_set_start_threshold) },
+ { "snd_pcm_sw_params", (void**)(char*)&SDL_NAME(snd_pcm_sw_params) },
+ { "snd_pcm_nonblock", (void**)(char*)&SDL_NAME(snd_pcm_nonblock) },
+ { "snd_pcm_wait", (void**)(char*)&SDL_NAME(snd_pcm_wait) },
+};
+
+static void UnloadALSALibrary(void) {
+ if (alsa_loaded) {
+ SDL_UnloadObject(alsa_handle);
+ alsa_handle = NULL;
+ alsa_loaded = 0;
+ }
+}
+
+static int LoadALSALibrary(void) {
+ int i, retval = -1;
+
+ alsa_handle = SDL_LoadObject(alsa_library);
+ if (alsa_handle) {
+ alsa_loaded = 1;
+ retval = 0;
+ for (i = 0; i < SDL_arraysize(alsa_functions); i++) {
+ *alsa_functions[i].func = SDL_LoadFunction(alsa_handle,alsa_functions[i].name);
+ if (!*alsa_functions[i].func) {
+ retval = -1;
+ UnloadALSALibrary();
+ break;
+ }
+ }
+ }
+ return retval;
+}
+
+#else
+
+static void UnloadALSALibrary(void) {
+ return;
+}
+
+static int LoadALSALibrary(void) {
+ return 0;
+}
+
+#endif /* SDL_AUDIO_DRIVER_ALSA_DYNAMIC */
+
+static const char *get_audio_device(int channels)
+{
+ const char *device;
+
+ device = SDL_getenv("AUDIODEV"); /* Is there a standard variable name? */
+ if ( device == NULL ) {
+ switch (channels) {
+ case 6:
+ device = "plug:surround51";
+ break;
+ case 4:
+ device = "plug:surround40";
+ break;
+ default:
+ device = "default";
+ break;
+ }
+ }
+ return device;
+}
+
+/* Audio driver bootstrap functions */
+
+static int Audio_Available(void)
+{
+ int available;
+ int status;
+ snd_pcm_t *handle;
+
+ available = 0;
+ if (LoadALSALibrary() < 0) {
+ return available;
+ }
+ status = SDL_NAME(snd_pcm_open)(&handle, get_audio_device(2), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK);
+ if ( status >= 0 ) {
+ available = 1;
+ SDL_NAME(snd_pcm_close)(handle);
+ }
+ UnloadALSALibrary();
+ return(available);
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+ UnloadALSALibrary();
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ LoadALSALibrary();
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+
+ /* Set the function pointers */
+ this->OpenAudio = ALSA_OpenAudio;
+ this->WaitAudio = ALSA_WaitAudio;
+ this->PlayAudio = ALSA_PlayAudio;
+ this->GetAudioBuf = ALSA_GetAudioBuf;
+ this->CloseAudio = ALSA_CloseAudio;
+
+ this->free = Audio_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap ALSA_bootstrap = {
+ DRIVER_NAME, "ALSA PCM audio",
+ Audio_Available, Audio_CreateDevice
+};
+
+/* This function waits until it is possible to write a full sound buffer */
+static void ALSA_WaitAudio(_THIS)
+{
+ /* We're in blocking mode, so there's nothing to do here */
+}
+
+
+/*
+ * http://bugzilla.libsdl.org/show_bug.cgi?id=110
+ * "For Linux ALSA, this is FL-FR-RL-RR-C-LFE
+ * and for Windows DirectX [and CoreAudio], this is FL-FR-C-LFE-RL-RR"
+ */
+#define SWIZ6(T) \
+ T *ptr = (T *) mixbuf; \
+ Uint32 i; \
+ for (i = 0; i < this->spec.samples; i++, ptr += 6) { \
+ T tmp; \
+ tmp = ptr[2]; ptr[2] = ptr[4]; ptr[4] = tmp; \
+ tmp = ptr[3]; ptr[3] = ptr[5]; ptr[5] = tmp; \
+ }
+
+static __inline__ void swizzle_alsa_channels_6_64bit(_THIS) { SWIZ6(Uint64); }
+static __inline__ void swizzle_alsa_channels_6_32bit(_THIS) { SWIZ6(Uint32); }
+static __inline__ void swizzle_alsa_channels_6_16bit(_THIS) { SWIZ6(Uint16); }
+static __inline__ void swizzle_alsa_channels_6_8bit(_THIS) { SWIZ6(Uint8); }
+
+#undef SWIZ6
+
+
+/*
+ * Called right before feeding this->mixbuf to the hardware. Swizzle channels
+ * from Windows/Mac order to the format alsalib will want.
+ */
+static __inline__ void swizzle_alsa_channels(_THIS)
+{
+ if (this->spec.channels == 6) {
+ const Uint16 fmtsize = (this->spec.format & 0xFF); /* bits/channel. */
+ if (fmtsize == 16)
+ swizzle_alsa_channels_6_16bit(this);
+ else if (fmtsize == 8)
+ swizzle_alsa_channels_6_8bit(this);
+ else if (fmtsize == 32)
+ swizzle_alsa_channels_6_32bit(this);
+ else if (fmtsize == 64)
+ swizzle_alsa_channels_6_64bit(this);
+ }
+
+ /* !!! FIXME: update this for 7.1 if needed, later. */
+}
+
+
+static void ALSA_PlayAudio(_THIS)
+{
+ int status;
+ snd_pcm_uframes_t frames_left;
+ const Uint8 *sample_buf = (const Uint8 *) mixbuf;
+ const int frame_size = (((int) (this->spec.format & 0xFF)) / 8) * this->spec.channels;
+
+ swizzle_alsa_channels(this);
+
+ frames_left = ((snd_pcm_uframes_t) this->spec.samples);
+
+ while ( frames_left > 0 && this->enabled ) {
+ /* This works, but needs more testing before going live */
+ /*SDL_NAME(snd_pcm_wait)(pcm_handle, -1);*/
+
+ status = SDL_NAME(snd_pcm_writei)(pcm_handle, sample_buf, frames_left);
+ if ( status < 0 ) {
+ if ( status == -EAGAIN ) {
+ /* Apparently snd_pcm_recover() doesn't handle this case - does it assume snd_pcm_wait() above? */
+ SDL_Delay(1);
+ continue;
+ }
+ status = SDL_NAME(snd_pcm_recover)(pcm_handle, status, 0);
+ if ( status < 0 ) {
+ /* Hmm, not much we can do - abort */
+ fprintf(stderr, "ALSA write failed (unrecoverable): %s\n", SDL_NAME(snd_strerror)(status));
+ this->enabled = 0;
+ return;
+ }
+ continue;
+ }
+ sample_buf += status * frame_size;
+ frames_left -= status;
+ }
+}
+
+static Uint8 *ALSA_GetAudioBuf(_THIS)
+{
+ return(mixbuf);
+}
+
+static void ALSA_CloseAudio(_THIS)
+{
+ if ( mixbuf != NULL ) {
+ SDL_FreeAudioMem(mixbuf);
+ mixbuf = NULL;
+ }
+ if ( pcm_handle ) {
+ SDL_NAME(snd_pcm_drain)(pcm_handle);
+ SDL_NAME(snd_pcm_close)(pcm_handle);
+ pcm_handle = NULL;
+ }
+}
+
+static int ALSA_finalize_hardware(_THIS, SDL_AudioSpec *spec, snd_pcm_hw_params_t *hwparams, int override)
+{
+ int status;
+ snd_pcm_uframes_t bufsize;
+
+ /* "set" the hardware with the desired parameters */
+ status = SDL_NAME(snd_pcm_hw_params)(pcm_handle, hwparams);
+ if ( status < 0 ) {
+ return(-1);
+ }
+
+ /* Get samples for the actual buffer size */
+ status = SDL_NAME(snd_pcm_hw_params_get_buffer_size)(hwparams, &bufsize);
+ if ( status < 0 ) {
+ return(-1);
+ }
+ if ( !override && bufsize != spec->samples * 2 ) {
+ return(-1);
+ }
+
+ /* FIXME: Is this safe to do? */
+ spec->samples = bufsize / 2;
+
+ /* This is useful for debugging */
+ if ( getenv("SDL_AUDIO_ALSA_DEBUG") ) {
+ snd_pcm_uframes_t persize = 0;
+ unsigned int periods = 0;
+
+ SDL_NAME(snd_pcm_hw_params_get_period_size)(hwparams, &persize, NULL);
+ SDL_NAME(snd_pcm_hw_params_get_periods)(hwparams, &periods, NULL);
+
+ fprintf(stderr, "ALSA: period size = %ld, periods = %u, buffer size = %lu\n", persize, periods, bufsize);
+ }
+ return(0);
+}
+
+static int ALSA_set_period_size(_THIS, SDL_AudioSpec *spec, snd_pcm_hw_params_t *params, int override)
+{
+ const char *env;
+ int status;
+ snd_pcm_hw_params_t *hwparams;
+ snd_pcm_uframes_t frames;
+ unsigned int periods;
+
+ /* Copy the hardware parameters for this setup */
+ snd_pcm_hw_params_alloca(&hwparams);
+ SDL_NAME(snd_pcm_hw_params_copy)(hwparams, params);
+
+ if ( !override ) {
+ env = getenv("SDL_AUDIO_ALSA_SET_PERIOD_SIZE");
+ if ( env ) {
+ override = SDL_atoi(env);
+ if ( override == 0 ) {
+ return(-1);
+ }
+ }
+ }
+
+ frames = spec->samples;
+ status = SDL_NAME(snd_pcm_hw_params_set_period_size_near)(pcm_handle, hwparams, &frames, NULL);
+ if ( status < 0 ) {
+ return(-1);
+ }
+
+ periods = 2;
+ status = SDL_NAME(snd_pcm_hw_params_set_periods_near)(pcm_handle, hwparams, &periods, NULL);
+ if ( status < 0 ) {
+ return(-1);
+ }
+
+ return ALSA_finalize_hardware(this, spec, hwparams, override);
+}
+
+static int ALSA_set_buffer_size(_THIS, SDL_AudioSpec *spec, snd_pcm_hw_params_t *params, int override)
+{
+ const char *env;
+ int status;
+ snd_pcm_hw_params_t *hwparams;
+ snd_pcm_uframes_t frames;
+
+ /* Copy the hardware parameters for this setup */
+ snd_pcm_hw_params_alloca(&hwparams);
+ SDL_NAME(snd_pcm_hw_params_copy)(hwparams, params);
+
+ if ( !override ) {
+ env = getenv("SDL_AUDIO_ALSA_SET_BUFFER_SIZE");
+ if ( env ) {
+ override = SDL_atoi(env);
+ if ( override == 0 ) {
+ return(-1);
+ }
+ }
+ }
+
+ frames = spec->samples * 2;
+ status = SDL_NAME(snd_pcm_hw_params_set_buffer_size_near)(pcm_handle, hwparams, &frames);
+ if ( status < 0 ) {
+ return(-1);
+ }
+
+ return ALSA_finalize_hardware(this, spec, hwparams, override);
+}
+
+static int ALSA_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ int status;
+ snd_pcm_hw_params_t *hwparams;
+ snd_pcm_sw_params_t *swparams;
+ snd_pcm_format_t format;
+ unsigned int rate;
+ unsigned int channels;
+ Uint16 test_format;
+
+ /* Open the audio device */
+ /* Name of device should depend on # channels in spec */
+ status = SDL_NAME(snd_pcm_open)(&pcm_handle, get_audio_device(spec->channels), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK);
+
+ if ( status < 0 ) {
+ SDL_SetError("Couldn't open audio device: %s", SDL_NAME(snd_strerror)(status));
+ return(-1);
+ }
+
+ /* Figure out what the hardware is capable of */
+ snd_pcm_hw_params_alloca(&hwparams);
+ status = SDL_NAME(snd_pcm_hw_params_any)(pcm_handle, hwparams);
+ if ( status < 0 ) {
+ SDL_SetError("Couldn't get hardware config: %s", SDL_NAME(snd_strerror)(status));
+ ALSA_CloseAudio(this);
+ return(-1);
+ }
+
+ /* SDL only uses interleaved sample output */
+ status = SDL_NAME(snd_pcm_hw_params_set_access)(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED);
+ if ( status < 0 ) {
+ SDL_SetError("Couldn't set interleaved access: %s", SDL_NAME(snd_strerror)(status));
+ ALSA_CloseAudio(this);
+ return(-1);
+ }
+
+ /* Try for a closest match on audio format */
+ status = -1;
+ for ( test_format = SDL_FirstAudioFormat(spec->format);
+ test_format && (status < 0); ) {
+ switch ( test_format ) {
+ case AUDIO_U8:
+ format = SND_PCM_FORMAT_U8;
+ break;
+ case AUDIO_S8:
+ format = SND_PCM_FORMAT_S8;
+ break;
+ case AUDIO_S16LSB:
+ format = SND_PCM_FORMAT_S16_LE;
+ break;
+ case AUDIO_S16MSB:
+ format = SND_PCM_FORMAT_S16_BE;
+ break;
+ case AUDIO_U16LSB:
+ format = SND_PCM_FORMAT_U16_LE;
+ break;
+ case AUDIO_U16MSB:
+ format = SND_PCM_FORMAT_U16_BE;
+ break;
+ default:
+ format = 0;
+ break;
+ }
+ if ( format != 0 ) {
+ status = SDL_NAME(snd_pcm_hw_params_set_format)(pcm_handle, hwparams, format);
+ }
+ if ( status < 0 ) {
+ test_format = SDL_NextAudioFormat();
+ }
+ }
+ if ( status < 0 ) {
+ SDL_SetError("Couldn't find any hardware audio formats");
+ ALSA_CloseAudio(this);
+ return(-1);
+ }
+ spec->format = test_format;
+
+ /* Set the number of channels */
+ status = SDL_NAME(snd_pcm_hw_params_set_channels)(pcm_handle, hwparams, spec->channels);
+ channels = spec->channels;
+ if ( status < 0 ) {
+ status = SDL_NAME(snd_pcm_hw_params_get_channels)(hwparams, &channels);
+ if ( status < 0 ) {
+ SDL_SetError("Couldn't set audio channels");
+ ALSA_CloseAudio(this);
+ return(-1);
+ }
+ spec->channels = channels;
+ }
+
+ /* Set the audio rate */
+ rate = spec->freq;
+
+ status = SDL_NAME(snd_pcm_hw_params_set_rate_near)(pcm_handle, hwparams, &rate, NULL);
+ if ( status < 0 ) {
+ SDL_SetError("Couldn't set audio frequency: %s", SDL_NAME(snd_strerror)(status));
+ ALSA_CloseAudio(this);
+ return(-1);
+ }
+ spec->freq = rate;
+
+ /* Set the buffer size, in samples */
+ if ( ALSA_set_period_size(this, spec, hwparams, 0) < 0 &&
+ ALSA_set_buffer_size(this, spec, hwparams, 0) < 0 ) {
+ /* Failed to set desired buffer size, do the best you can... */
+ if ( ALSA_set_period_size(this, spec, hwparams, 1) < 0 ) {
+ SDL_SetError("Couldn't set hardware audio parameters: %s", SDL_NAME(snd_strerror)(status));
+ ALSA_CloseAudio(this);
+ return(-1);
+ }
+ }
+
+ /* Set the software parameters */
+ snd_pcm_sw_params_alloca(&swparams);
+ status = SDL_NAME(snd_pcm_sw_params_current)(pcm_handle, swparams);
+ if ( status < 0 ) {
+ SDL_SetError("Couldn't get software config: %s", SDL_NAME(snd_strerror)(status));
+ ALSA_CloseAudio(this);
+ return(-1);
+ }
+ status = SDL_NAME(snd_pcm_sw_params_set_avail_min)(pcm_handle, swparams, spec->samples);
+ if ( status < 0 ) {
+ SDL_SetError("Couldn't set minimum available samples: %s", SDL_NAME(snd_strerror)(status));
+ ALSA_CloseAudio(this);
+ return(-1);
+ }
+ status = SDL_NAME(snd_pcm_sw_params_set_start_threshold)(pcm_handle, swparams, 1);
+ if ( status < 0 ) {
+ SDL_SetError("Couldn't set start threshold: %s", SDL_NAME(snd_strerror)(status));
+ ALSA_CloseAudio(this);
+ return(-1);
+ }
+ status = SDL_NAME(snd_pcm_sw_params)(pcm_handle, swparams);
+ if ( status < 0 ) {
+ SDL_SetError("Couldn't set software audio parameters: %s", SDL_NAME(snd_strerror)(status));
+ ALSA_CloseAudio(this);
+ return(-1);
+ }
+
+ /* Calculate the final parameters for this audio specification */
+ SDL_CalculateAudioSpec(spec);
+
+ /* Allocate mixing buffer */
+ mixlen = spec->size;
+ mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen);
+ if ( mixbuf == NULL ) {
+ ALSA_CloseAudio(this);
+ return(-1);
+ }
+ SDL_memset(mixbuf, spec->silence, spec->size);
+
+ /* Switch to blocking mode for playback */
+ SDL_NAME(snd_pcm_nonblock)(pcm_handle, 0);
+
+ /* We're ready to rock and roll. :-) */
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/src/audio/alsa/SDL_alsa_audio.h b/distrib/sdl-1.2.15/src/audio/alsa/SDL_alsa_audio.h
new file mode 100644
index 0000000..55ae87b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/alsa/SDL_alsa_audio.h
@@ -0,0 +1,48 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _ALSA_PCM_audio_h
+#define _ALSA_PCM_audio_h
+
+#include <alsa/asoundlib.h>
+
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_AudioDevice *this
+
+struct SDL_PrivateAudioData {
+ /* The audio device handle */
+ snd_pcm_t *pcm_handle;
+
+ /* Raw mixing buffer */
+ Uint8 *mixbuf;
+ int mixlen;
+};
+
+/* Old variable names */
+#define pcm_handle (this->hidden->pcm_handle)
+#define mixbuf (this->hidden->mixbuf)
+#define mixlen (this->hidden->mixlen)
+
+#endif /* _ALSA_PCM_audio_h */
diff --git a/distrib/sdl-1.2.15/src/audio/arts/SDL_artsaudio.c b/distrib/sdl-1.2.15/src/audio/arts/SDL_artsaudio.c
new file mode 100644
index 0000000..373f8c1
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/arts/SDL_artsaudio.c
@@ -0,0 +1,362 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Allow access to a raw mixing buffer */
+
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+#include <unistd.h>
+
+#include "SDL_timer.h"
+#include "SDL_audio.h"
+#include "../SDL_audiomem.h"
+#include "../SDL_audio_c.h"
+#include "../SDL_audiodev_c.h"
+#include "SDL_artsaudio.h"
+
+#ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
+#include "SDL_name.h"
+#include "SDL_loadso.h"
+#else
+#define SDL_NAME(X) X
+#endif
+
+/* The tag name used by artsc audio */
+#define ARTS_DRIVER_NAME "arts"
+
+/* Audio driver functions */
+static int ARTS_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void ARTS_WaitAudio(_THIS);
+static void ARTS_PlayAudio(_THIS);
+static Uint8 *ARTS_GetAudioBuf(_THIS);
+static void ARTS_CloseAudio(_THIS);
+
+#ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
+
+static const char *arts_library = SDL_AUDIO_DRIVER_ARTS_DYNAMIC;
+static void *arts_handle = NULL;
+static int arts_loaded = 0;
+
+static int (*SDL_NAME(arts_init))(void);
+static void (*SDL_NAME(arts_free))(void);
+static arts_stream_t (*SDL_NAME(arts_play_stream))(int rate, int bits, int channels, const char *name);
+static int (*SDL_NAME(arts_stream_set))(arts_stream_t s, arts_parameter_t param, int value);
+static int (*SDL_NAME(arts_stream_get))(arts_stream_t s, arts_parameter_t param);
+static int (*SDL_NAME(arts_write))(arts_stream_t s, const void *buffer, int count);
+static void (*SDL_NAME(arts_close_stream))(arts_stream_t s);
+static int (*SDL_NAME(arts_suspend))(void);
+static int (*SDL_NAME(arts_suspended))(void);
+static const char *(*SDL_NAME(arts_error_text))(int errorcode);
+
+static struct {
+ const char *name;
+ void **func;
+} arts_functions[] = {
+ { "arts_init", (void **)&SDL_NAME(arts_init) },
+ { "arts_free", (void **)&SDL_NAME(arts_free) },
+ { "arts_play_stream", (void **)&SDL_NAME(arts_play_stream) },
+ { "arts_stream_set", (void **)&SDL_NAME(arts_stream_set) },
+ { "arts_stream_get", (void **)&SDL_NAME(arts_stream_get) },
+ { "arts_write", (void **)&SDL_NAME(arts_write) },
+ { "arts_close_stream", (void **)&SDL_NAME(arts_close_stream) },
+ { "arts_suspend", (void **)&SDL_NAME(arts_suspend) },
+ { "arts_suspended", (void **)&SDL_NAME(arts_suspended) },
+ { "arts_error_text", (void **)&SDL_NAME(arts_error_text) },
+};
+
+static void UnloadARTSLibrary()
+{
+ if ( arts_loaded ) {
+ SDL_UnloadObject(arts_handle);
+ arts_handle = NULL;
+ arts_loaded = 0;
+ }
+}
+
+static int LoadARTSLibrary(void)
+{
+ int i, retval = -1;
+
+ arts_handle = SDL_LoadObject(arts_library);
+ if ( arts_handle ) {
+ arts_loaded = 1;
+ retval = 0;
+ for ( i=0; i<SDL_arraysize(arts_functions); ++i ) {
+ *arts_functions[i].func = SDL_LoadFunction(arts_handle, arts_functions[i].name);
+ if ( !*arts_functions[i].func ) {
+ retval = -1;
+ UnloadARTSLibrary();
+ break;
+ }
+ }
+ }
+ return retval;
+}
+
+#else
+
+static void UnloadARTSLibrary()
+{
+ return;
+}
+
+static int LoadARTSLibrary(void)
+{
+ return 0;
+}
+
+#endif /* SDL_AUDIO_DRIVER_ARTS_DYNAMIC */
+
+/* Audio driver bootstrap functions */
+
+static int ARTS_Suspend(void)
+{
+ const Uint32 abortms = SDL_GetTicks() + 3000; /* give up after 3 secs */
+ while ( (!SDL_NAME(arts_suspended)()) && (SDL_GetTicks() < abortms) ) {
+ if ( SDL_NAME(arts_suspend)() ) {
+ break;
+ }
+ }
+
+ return SDL_NAME(arts_suspended)();
+}
+
+static int Audio_Available(void)
+{
+ int available = 0;
+
+ if ( LoadARTSLibrary() < 0 ) {
+ return available;
+ }
+ if ( SDL_NAME(arts_init)() == 0 ) {
+ if ( ARTS_Suspend() ) {
+ /* Play a stream so aRts doesn't crash */
+ arts_stream_t stream2;
+ stream2=SDL_NAME(arts_play_stream)(44100, 16, 2, "SDL");
+ SDL_NAME(arts_write)(stream2, "", 0);
+ SDL_NAME(arts_close_stream)(stream2);
+ available = 1;
+ }
+ SDL_NAME(arts_free)();
+ }
+ UnloadARTSLibrary();
+
+ return available;
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+ UnloadARTSLibrary();
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ LoadARTSLibrary();
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+ stream = 0;
+
+ /* Set the function pointers */
+ this->OpenAudio = ARTS_OpenAudio;
+ this->WaitAudio = ARTS_WaitAudio;
+ this->PlayAudio = ARTS_PlayAudio;
+ this->GetAudioBuf = ARTS_GetAudioBuf;
+ this->CloseAudio = ARTS_CloseAudio;
+
+ this->free = Audio_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap ARTS_bootstrap = {
+ ARTS_DRIVER_NAME, "Analog Realtime Synthesizer",
+ Audio_Available, Audio_CreateDevice
+};
+
+/* This function waits until it is possible to write a full sound buffer */
+static void ARTS_WaitAudio(_THIS)
+{
+ Sint32 ticks;
+
+ /* Check to see if the thread-parent process is still alive */
+ { static int cnt = 0;
+ /* Note that this only works with thread implementations
+ that use a different process id for each thread.
+ */
+ if (parent && (((++cnt)%10) == 0)) { /* Check every 10 loops */
+ if ( kill(parent, 0) < 0 ) {
+ this->enabled = 0;
+ }
+ }
+ }
+
+ /* Use timer for general audio synchronization */
+ ticks = ((Sint32)(next_frame - SDL_GetTicks()))-FUDGE_TICKS;
+ if ( ticks > 0 ) {
+ SDL_Delay(ticks);
+ }
+}
+
+static void ARTS_PlayAudio(_THIS)
+{
+ int written;
+
+ /* Write the audio data */
+ written = SDL_NAME(arts_write)(stream, mixbuf, mixlen);
+
+ /* If timer synchronization is enabled, set the next write frame */
+ if ( frame_ticks ) {
+ next_frame += frame_ticks;
+ }
+
+ /* If we couldn't write, assume fatal error for now */
+ if ( written < 0 ) {
+ this->enabled = 0;
+ }
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Wrote %d bytes of audio data\n", written);
+#endif
+}
+
+static Uint8 *ARTS_GetAudioBuf(_THIS)
+{
+ return(mixbuf);
+}
+
+static void ARTS_CloseAudio(_THIS)
+{
+ if ( mixbuf != NULL ) {
+ SDL_FreeAudioMem(mixbuf);
+ mixbuf = NULL;
+ }
+ if ( stream ) {
+ SDL_NAME(arts_close_stream)(stream);
+ stream = 0;
+ }
+ SDL_NAME(arts_free)();
+}
+
+static int ARTS_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ int bits, frag_spec;
+ Uint16 test_format, format;
+ int error_code;
+
+ /* Reset the timer synchronization flag */
+ frame_ticks = 0.0;
+
+ mixbuf = NULL;
+
+ /* Try for a closest match on audio format */
+ format = 0;
+ bits = 0;
+ for ( test_format = SDL_FirstAudioFormat(spec->format);
+ ! format && test_format; ) {
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Trying format 0x%4.4x\n", test_format);
+#endif
+ switch ( test_format ) {
+ case AUDIO_U8:
+ bits = 8;
+ format = 1;
+ break;
+ case AUDIO_S16LSB:
+ bits = 16;
+ format = 1;
+ break;
+ default:
+ format = 0;
+ break;
+ }
+ if ( ! format ) {
+ test_format = SDL_NextAudioFormat();
+ }
+ }
+ if ( format == 0 ) {
+ SDL_SetError("Couldn't find any hardware audio formats");
+ return(-1);
+ }
+ spec->format = test_format;
+
+ error_code = SDL_NAME(arts_init)();
+ if ( error_code != 0 ) {
+ SDL_SetError("Unable to initialize ARTS: %s", SDL_NAME(arts_error_text)(error_code));
+ return(-1);
+ }
+ if ( ! ARTS_Suspend() ) {
+ SDL_SetError("ARTS can not open audio device");
+ return(-1);
+ }
+ stream = SDL_NAME(arts_play_stream)(spec->freq, bits, spec->channels, "SDL");
+
+ /* Calculate the final parameters for this audio specification */
+ SDL_CalculateAudioSpec(spec);
+
+ /* Determine the power of two of the fragment size */
+ for ( frag_spec = 0; (0x01<<frag_spec) < spec->size; ++frag_spec );
+ if ( (0x01<<frag_spec) != spec->size ) {
+ SDL_SetError("Fragment size must be a power of two");
+ return(-1);
+ }
+ frag_spec |= 0x00020000; /* two fragments, for low latency */
+
+#ifdef ARTS_P_PACKET_SETTINGS
+ SDL_NAME(arts_stream_set)(stream, ARTS_P_PACKET_SETTINGS, frag_spec);
+#else
+ SDL_NAME(arts_stream_set)(stream, ARTS_P_PACKET_SIZE, frag_spec&0xffff);
+ SDL_NAME(arts_stream_set)(stream, ARTS_P_PACKET_COUNT, frag_spec>>16);
+#endif
+ spec->size = SDL_NAME(arts_stream_get)(stream, ARTS_P_PACKET_SIZE);
+
+ /* Allocate mixing buffer */
+ mixlen = spec->size;
+ mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen);
+ if ( mixbuf == NULL ) {
+ return(-1);
+ }
+ SDL_memset(mixbuf, spec->silence, spec->size);
+
+ /* Get the parent process id (we're the parent of the audio thread) */
+ parent = getpid();
+
+ /* We're ready to rock and roll. :-) */
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/src/audio/arts/SDL_artsaudio.h b/distrib/sdl-1.2.15/src/audio/arts/SDL_artsaudio.h
new file mode 100644
index 0000000..de3b228
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/arts/SDL_artsaudio.h
@@ -0,0 +1,60 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_artscaudio_h
+#define _SDL_artscaudio_h
+
+#include <artsc.h>
+
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_AudioDevice *this
+
+struct SDL_PrivateAudioData {
+ /* The stream descriptor for the audio device */
+ arts_stream_t stream;
+
+ /* The parent process id, to detect when application quits */
+ pid_t parent;
+
+ /* Raw mixing buffer */
+ Uint8 *mixbuf;
+ int mixlen;
+
+ /* Support for audio timing using a timer, in addition to select() */
+ float frame_ticks;
+ float next_frame;
+};
+#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */
+
+/* Old variable names */
+#define stream (this->hidden->stream)
+#define parent (this->hidden->parent)
+#define mixbuf (this->hidden->mixbuf)
+#define mixlen (this->hidden->mixlen)
+#define frame_ticks (this->hidden->frame_ticks)
+#define next_frame (this->hidden->next_frame)
+
+#endif /* _SDL_artscaudio_h */
+
diff --git a/distrib/sdl-1.2.15/src/audio/baudio/SDL_beaudio.cc b/distrib/sdl-1.2.15/src/audio/baudio/SDL_beaudio.cc
new file mode 100644
index 0000000..de635f8
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/baudio/SDL_beaudio.cc
@@ -0,0 +1,225 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Allow access to the audio stream on BeOS */
+
+#include <SoundPlayer.h>
+
+#include "../../main/beos/SDL_BeApp.h"
+
+extern "C" {
+
+#include "SDL_audio.h"
+#include "../SDL_audio_c.h"
+#include "../SDL_sysaudio.h"
+#include "../../thread/beos/SDL_systhread_c.h"
+#include "SDL_beaudio.h"
+
+
+/* Audio driver functions */
+static int BE_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void BE_WaitAudio(_THIS);
+static void BE_PlayAudio(_THIS);
+static Uint8 *BE_GetAudioBuf(_THIS);
+static void BE_CloseAudio(_THIS);
+
+/* Audio driver bootstrap functions */
+
+static int Audio_Available(void)
+{
+ return(1);
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *device;
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( device ) {
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *device->hidden));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( device ) {
+ SDL_free(device);
+ }
+ return(0);
+ }
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+
+ /* Set the function pointers */
+ device->OpenAudio = BE_OpenAudio;
+ device->WaitAudio = BE_WaitAudio;
+ device->PlayAudio = BE_PlayAudio;
+ device->GetAudioBuf = BE_GetAudioBuf;
+ device->CloseAudio = BE_CloseAudio;
+
+ device->free = Audio_DeleteDevice;
+
+ return device;
+}
+
+AudioBootStrap BAUDIO_bootstrap = {
+ "baudio", "BeOS BSoundPlayer",
+ Audio_Available, Audio_CreateDevice
+};
+
+/* The BeOS callback for handling the audio buffer */
+static void FillSound(void *device, void *stream, size_t len,
+ const media_raw_audio_format &format)
+{
+ SDL_AudioDevice *audio = (SDL_AudioDevice *)device;
+
+ /* Silence the buffer, since it's ours */
+ SDL_memset(stream, audio->spec.silence, len);
+
+ /* Only do soemthing if audio is enabled */
+ if ( ! audio->enabled )
+ return;
+
+ if ( ! audio->paused ) {
+ if ( audio->convert.needed ) {
+ SDL_mutexP(audio->mixer_lock);
+ (*audio->spec.callback)(audio->spec.userdata,
+ (Uint8 *)audio->convert.buf,audio->convert.len);
+ SDL_mutexV(audio->mixer_lock);
+ SDL_ConvertAudio(&audio->convert);
+ SDL_memcpy(stream,audio->convert.buf,audio->convert.len_cvt);
+ } else {
+ SDL_mutexP(audio->mixer_lock);
+ (*audio->spec.callback)(audio->spec.userdata,
+ (Uint8 *)stream, len);
+ SDL_mutexV(audio->mixer_lock);
+ }
+ }
+ return;
+}
+
+/* Dummy functions -- we don't use thread-based audio */
+void BE_WaitAudio(_THIS)
+{
+ return;
+}
+void BE_PlayAudio(_THIS)
+{
+ return;
+}
+Uint8 *BE_GetAudioBuf(_THIS)
+{
+ return(NULL);
+}
+
+void BE_CloseAudio(_THIS)
+{
+ if ( audio_obj ) {
+ audio_obj->Stop();
+ delete audio_obj;
+ audio_obj = NULL;
+ }
+
+ /* Quit the Be Application, if there's nothing left to do */
+ SDL_QuitBeApp();
+}
+
+int BE_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ int valid_datatype = 0;
+ media_raw_audio_format format;
+ Uint16 test_format = SDL_FirstAudioFormat(spec->format);
+
+ /* Parse the audio format and fill the Be raw audio format */
+ memset(&format, '\0', sizeof (media_raw_audio_format));
+ format.byte_order = B_MEDIA_LITTLE_ENDIAN;
+ format.frame_rate = (float) spec->freq;
+ format.channel_count = spec->channels; /* !!! FIXME: support > 2? */
+ while ((!valid_datatype) && (test_format)) {
+ valid_datatype = 1;
+ spec->format = test_format;
+ switch (test_format) {
+ case AUDIO_S8:
+ format.format = media_raw_audio_format::B_AUDIO_CHAR;
+ break;
+
+ case AUDIO_U8:
+ format.format = media_raw_audio_format::B_AUDIO_UCHAR;
+ break;
+
+ case AUDIO_S16LSB:
+ format.format = media_raw_audio_format::B_AUDIO_SHORT;
+ break;
+
+ case AUDIO_S16MSB:
+ format.format = media_raw_audio_format::B_AUDIO_SHORT;
+ format.byte_order = B_MEDIA_BIG_ENDIAN;
+ break;
+
+ default:
+ valid_datatype = 0;
+ test_format = SDL_NextAudioFormat();
+ break;
+ }
+ }
+
+ if (!valid_datatype) { /* shouldn't happen, but just in case... */
+ SDL_SetError("Unsupported audio format");
+ return (-1);
+ }
+
+ /* Initialize the Be Application, if it's not already started */
+ if (SDL_InitBeApp() < 0) {
+ return (-1);
+ }
+
+ format.buffer_size = spec->samples;
+
+ /* Calculate the final parameters for this audio specification */
+ SDL_CalculateAudioSpec(spec);
+
+ /* Subscribe to the audio stream (creates a new thread) */
+ { sigset_t omask;
+ SDL_MaskSignals(&omask);
+ audio_obj = new BSoundPlayer(&format, "SDL Audio", FillSound,
+ NULL, _this);
+ SDL_UnmaskSignals(&omask);
+ }
+ if ( audio_obj->Start() == B_NO_ERROR ) {
+ audio_obj->SetHasData(true);
+ } else {
+ SDL_SetError("Unable to start Be audio");
+ return(-1);
+ }
+
+ /* We're running! */
+ return(1);
+}
+
+}; /* Extern C */
diff --git a/distrib/sdl-1.2.15/src/audio/baudio/SDL_beaudio.h b/distrib/sdl-1.2.15/src/audio/baudio/SDL_beaudio.h
new file mode 100644
index 0000000..adaf1de
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/baudio/SDL_beaudio.h
@@ -0,0 +1,39 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_lowaudio_h
+#define _SDL_lowaudio_h
+
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_AudioDevice *_this
+
+struct SDL_PrivateAudioData {
+ BSoundPlayer *audio_obj;
+};
+
+/* Old variable names */
+#define audio_obj (_this->hidden->audio_obj)
+
+#endif /* _SDL_lowaudio_h */
diff --git a/distrib/sdl-1.2.15/src/audio/bsd/SDL_bsdaudio.c b/distrib/sdl-1.2.15/src/audio/bsd/SDL_bsdaudio.c
new file mode 100644
index 0000000..e5e0d94
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/bsd/SDL_bsdaudio.c
@@ -0,0 +1,404 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * Driver for native OpenBSD/NetBSD audio(4).
+ * vedge@vedge.com.ar.
+ */
+
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/audioio.h>
+
+#include "SDL_timer.h"
+#include "SDL_audio.h"
+#include "../SDL_audiomem.h"
+#include "../SDL_audio_c.h"
+#include "../SDL_audiodev_c.h"
+#include "SDL_bsdaudio.h"
+
+/* The tag name used by NetBSD/OpenBSD audio */
+#ifdef __NetBSD__
+#define BSD_AUDIO_DRIVER_NAME "netbsd"
+#define BSD_AUDIO_DRIVER_DESC "Native NetBSD audio"
+#else
+#define BSD_AUDIO_DRIVER_NAME "openbsd"
+#define BSD_AUDIO_DRIVER_DESC "Native OpenBSD audio"
+#endif
+
+/* Open the audio device for playback, and don't block if busy */
+/* #define USE_BLOCKING_WRITES */
+
+/* Use timer for synchronization */
+/* #define USE_TIMER_SYNC */
+
+/* #define DEBUG_AUDIO */
+/* #define DEBUG_AUDIO_STREAM */
+
+#ifdef USE_BLOCKING_WRITES
+#define OPEN_FLAGS O_WRONLY
+#else
+#define OPEN_FLAGS (O_WRONLY|O_NONBLOCK)
+#endif
+
+/* Audio driver functions */
+static void OBSD_WaitAudio(_THIS);
+static int OBSD_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void OBSD_PlayAudio(_THIS);
+static Uint8 *OBSD_GetAudioBuf(_THIS);
+static void OBSD_CloseAudio(_THIS);
+
+#ifdef DEBUG_AUDIO
+static void OBSD_Status(_THIS);
+#endif
+
+/* Audio driver bootstrap functions */
+
+static int
+Audio_Available(void)
+{
+ int fd;
+ int available;
+
+ available = 0;
+ fd = SDL_OpenAudioPath(NULL, 0, OPEN_FLAGS, 0);
+ if(fd >= 0) {
+ available = 1;
+ close(fd);
+ }
+ return(available);
+}
+
+static void
+Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_AudioDevice
+*Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice*)SDL_malloc(sizeof(SDL_AudioDevice));
+ if(this) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden =
+ (struct SDL_PrivateAudioData*)SDL_malloc((sizeof *this->hidden));
+ }
+ if((this == NULL) || (this->hidden == NULL)) {
+ SDL_OutOfMemory();
+ if(this) SDL_free(this);
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+ audio_fd = -1;
+
+ /* Set the function pointers */
+ this->OpenAudio = OBSD_OpenAudio;
+ this->WaitAudio = OBSD_WaitAudio;
+ this->PlayAudio = OBSD_PlayAudio;
+ this->GetAudioBuf = OBSD_GetAudioBuf;
+ this->CloseAudio = OBSD_CloseAudio;
+
+ this->free = Audio_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap BSD_AUDIO_bootstrap = {
+ BSD_AUDIO_DRIVER_NAME, BSD_AUDIO_DRIVER_DESC,
+ Audio_Available, Audio_CreateDevice
+};
+
+/* This function waits until it is possible to write a full sound buffer */
+static void
+OBSD_WaitAudio(_THIS)
+{
+#ifndef USE_BLOCKING_WRITES /* Not necessary when using blocking writes */
+ /* See if we need to use timed audio synchronization */
+ if ( frame_ticks ) {
+ /* Use timer for general audio synchronization */
+ Sint32 ticks;
+
+ ticks = ((Sint32)(next_frame - SDL_GetTicks()))-FUDGE_TICKS;
+ if ( ticks > 0 ) {
+ SDL_Delay(ticks);
+ }
+ } else {
+ /* Use select() for audio synchronization */
+ fd_set fdset;
+ struct timeval timeout;
+
+ FD_ZERO(&fdset);
+ FD_SET(audio_fd, &fdset);
+ timeout.tv_sec = 10;
+ timeout.tv_usec = 0;
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Waiting for audio to get ready\n");
+#endif
+ if ( select(audio_fd+1, NULL, &fdset, NULL, &timeout) <= 0 ) {
+ const char *message =
+ "Audio timeout - buggy audio driver? (disabled)";
+ /* In general we should never print to the screen,
+ but in this case we have no other way of letting
+ the user know what happened.
+ */
+ fprintf(stderr, "SDL: %s\n", message);
+ this->enabled = 0;
+ /* Don't try to close - may hang */
+ audio_fd = -1;
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Done disabling audio\n");
+#endif
+ }
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Ready!\n");
+#endif
+ }
+#endif /* !USE_BLOCKING_WRITES */
+}
+
+static void
+OBSD_PlayAudio(_THIS)
+{
+ int written, p=0;
+
+ /* Write the audio data, checking for EAGAIN on broken audio drivers */
+ do {
+ written = write(audio_fd, &mixbuf[p], mixlen-p);
+ if (written>0)
+ p += written;
+ if (written == -1 && errno != 0 && errno != EAGAIN && errno != EINTR)
+ {
+ /* Non recoverable error has occurred. It should be reported!!! */
+ perror("audio");
+ break;
+ }
+
+ if ( p < written || ((written < 0) && ((errno == 0) || (errno == EAGAIN))) ) {
+ SDL_Delay(1); /* Let a little CPU time go by */
+ }
+ } while ( p < written );
+
+ /* If timer synchronization is enabled, set the next write frame */
+ if ( frame_ticks ) {
+ next_frame += frame_ticks;
+ }
+
+ /* If we couldn't write, assume fatal error for now */
+ if ( written < 0 ) {
+ this->enabled = 0;
+ }
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Wrote %d bytes of audio data\n", written);
+#endif
+}
+
+static Uint8
+*OBSD_GetAudioBuf(_THIS)
+{
+ return(mixbuf);
+}
+
+static void
+OBSD_CloseAudio(_THIS)
+{
+ if(mixbuf != NULL) {
+ SDL_FreeAudioMem(mixbuf);
+ mixbuf = NULL;
+ }
+ if(audio_fd >= 0) {
+ close(audio_fd);
+ audio_fd = -1;
+ }
+}
+
+#ifdef DEBUG_AUDIO
+void
+OBSD_Status(_THIS)
+{
+ audio_info_t info;
+
+ if(ioctl(audio_fd, AUDIO_GETINFO, &info) < 0) {
+ fprintf(stderr,"AUDIO_GETINFO failed.\n");
+ return;
+ }
+
+ fprintf(stderr,"\n"
+"[play/record info]\n"
+"buffer size : %d bytes\n"
+"sample rate : %i Hz\n"
+"channels : %i\n"
+"precision : %i-bit\n"
+"encoding : 0x%x\n"
+"seek : %i\n"
+"sample count : %i\n"
+"EOF count : %i\n"
+"paused : %s\n"
+"error occured : %s\n"
+"waiting : %s\n"
+"active : %s\n"
+"",
+ info.play.buffer_size,
+ info.play.sample_rate,
+ info.play.channels,
+ info.play.precision,
+ info.play.encoding,
+ info.play.seek,
+ info.play.samples,
+ info.play.eof,
+ info.play.pause ? "yes" : "no",
+ info.play.error ? "yes" : "no",
+ info.play.waiting ? "yes" : "no",
+ info.play.active ? "yes": "no");
+
+ fprintf(stderr,"\n"
+"[audio info]\n"
+"monitor_gain : %i\n"
+"hw block size : %d bytes\n"
+"hi watermark : %i\n"
+"lo watermark : %i\n"
+"audio mode : %s\n"
+"",
+ info.monitor_gain,
+ info.blocksize,
+ info.hiwat, info.lowat,
+ (info.mode == AUMODE_PLAY) ? "PLAY"
+ : (info.mode = AUMODE_RECORD) ? "RECORD"
+ : (info.mode == AUMODE_PLAY_ALL ? "PLAY_ALL"
+ : "?"));
+}
+#endif /* DEBUG_AUDIO */
+
+static int
+OBSD_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ char audiodev[64];
+ Uint16 format;
+ audio_info_t info;
+
+ AUDIO_INITINFO(&info);
+
+ /* Calculate the final parameters for this audio specification */
+ SDL_CalculateAudioSpec(spec);
+
+#ifdef USE_TIMER_SYNC
+ frame_ticks = 0.0;
+#endif
+
+ /* Open the audio device */
+ audio_fd = SDL_OpenAudioPath(audiodev, sizeof(audiodev), OPEN_FLAGS, 0);
+ if(audio_fd < 0) {
+ SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno));
+ return(-1);
+ }
+
+ /* Set to play mode */
+ info.mode = AUMODE_PLAY;
+ if(ioctl(audio_fd, AUDIO_SETINFO, &info) < 0) {
+ SDL_SetError("Couldn't put device into play mode");
+ return(-1);
+ }
+
+ mixbuf = NULL;
+ AUDIO_INITINFO(&info);
+ for (format = SDL_FirstAudioFormat(spec->format);
+ format; format = SDL_NextAudioFormat())
+ {
+ switch(format) {
+ case AUDIO_U8:
+ info.play.encoding = AUDIO_ENCODING_ULINEAR;
+ info.play.precision = 8;
+ break;
+ case AUDIO_S8:
+ info.play.encoding = AUDIO_ENCODING_SLINEAR;
+ info.play.precision = 8;
+ break;
+ case AUDIO_S16LSB:
+ info.play.encoding = AUDIO_ENCODING_SLINEAR_LE;
+ info.play.precision = 16;
+ break;
+ case AUDIO_S16MSB:
+ info.play.encoding = AUDIO_ENCODING_SLINEAR_BE;
+ info.play.precision = 16;
+ break;
+ case AUDIO_U16LSB:
+ info.play.encoding = AUDIO_ENCODING_ULINEAR_LE;
+ info.play.precision = 16;
+ break;
+ case AUDIO_U16MSB:
+ info.play.encoding = AUDIO_ENCODING_ULINEAR_BE;
+ info.play.precision = 16;
+ break;
+ default:
+ continue;
+ }
+ if (ioctl(audio_fd, AUDIO_SETINFO, &info) == 0)
+ break;
+ }
+
+ if(!format) {
+ SDL_SetError("No supported encoding for 0x%x", spec->format);
+ return(-1);
+ }
+
+ spec->format = format;
+
+ AUDIO_INITINFO(&info);
+ info.play.channels = spec->channels;
+ if (ioctl(audio_fd, AUDIO_SETINFO, &info) == -1)
+ spec->channels = 1;
+ AUDIO_INITINFO(&info);
+ info.play.sample_rate = spec->freq;
+ info.blocksize = spec->size;
+ info.hiwat = 5;
+ info.lowat = 3;
+ (void)ioctl(audio_fd, AUDIO_SETINFO, &info);
+ (void)ioctl(audio_fd, AUDIO_GETINFO, &info);
+ spec->freq = info.play.sample_rate;
+ /* Allocate mixing buffer */
+ mixlen = spec->size;
+ mixbuf = (Uint8*)SDL_AllocAudioMem(mixlen);
+ if(mixbuf == NULL) {
+ return(-1);
+ }
+ SDL_memset(mixbuf, spec->silence, spec->size);
+
+ /* Get the parent process id (we're the parent of the audio thread) */
+ parent = getpid();
+
+#ifdef DEBUG_AUDIO
+ OBSD_Status(this);
+#endif
+
+ /* We're ready to rock and roll. :-) */
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/src/audio/bsd/SDL_bsdaudio.h b/distrib/sdl-1.2.15/src/audio/bsd/SDL_bsdaudio.h
new file mode 100644
index 0000000..c9f69cf
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/bsd/SDL_bsdaudio.h
@@ -0,0 +1,58 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_openbsdaudio_h
+#define _SDL_openbsdaudio_h
+
+#include "../SDL_sysaudio.h"
+
+#define _THIS SDL_AudioDevice *this
+
+struct SDL_PrivateAudioData
+{
+ /* The file descriptor for the audio device */
+ int audio_fd;
+
+ /* The parent process id, to detect when application quits */
+ pid_t parent;
+
+ /* Raw mixing buffer */
+ Uint8 *mixbuf;
+ int mixlen;
+
+ /* Support for audio timing using a timer, in addition to select() */
+ float frame_ticks;
+ float next_frame;
+};
+
+#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */
+
+/* Old variable names */
+#define audio_fd (this->hidden->audio_fd)
+#define parent (this->hidden->parent)
+#define mixbuf (this->hidden->mixbuf)
+#define mixlen (this->hidden->mixlen)
+#define frame_ticks (this->hidden->frame_ticks)
+#define next_frame (this->hidden->next_frame)
+
+#endif /* _SDL_openbsdaudio_h */
diff --git a/distrib/sdl-1.2.15/src/audio/dart/SDL_dart.c b/distrib/sdl-1.2.15/src/audio/dart/SDL_dart.c
new file mode 100644
index 0000000..77e530d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/dart/SDL_dart.c
@@ -0,0 +1,441 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Allow access to a raw mixing buffer */
+
+#include "SDL_timer.h"
+#include "SDL_audio.h"
+#include "../SDL_audio_c.h"
+#include "SDL_dart.h"
+
+// Buffer states:
+#define BUFFER_EMPTY 0
+#define BUFFER_USED 1
+
+typedef struct _tMixBufferDesc {
+ int iBufferUsage; // BUFFER_EMPTY or BUFFER_USED
+ SDL_AudioDevice *pSDLAudioDevice;
+} tMixBufferDesc, *pMixBufferDesc;
+
+
+//---------------------------------------------------------------------
+// DARTEventFunc
+//
+// This function is called by DART, when an event occures, like end of
+// playback of a buffer, etc...
+//---------------------------------------------------------------------
+LONG APIENTRY DARTEventFunc(ULONG ulStatus,
+ PMCI_MIX_BUFFER pBuffer,
+ ULONG ulFlags)
+{
+ if (ulFlags && MIX_WRITE_COMPLETE)
+ { // Playback of buffer completed!
+
+ // Get pointer to buffer description
+ pMixBufferDesc pBufDesc;
+
+ if (pBuffer)
+ {
+ pBufDesc = (pMixBufferDesc) (*pBuffer).ulUserParm;
+
+ if (pBufDesc)
+ {
+ SDL_AudioDevice *pSDLAudioDevice = pBufDesc->pSDLAudioDevice;
+ // Set the buffer to be empty
+ pBufDesc->iBufferUsage = BUFFER_EMPTY;
+ // And notify DART feeder thread that it will have to work a bit.
+ if (pSDLAudioDevice)
+ DosPostEventSem(pSDLAudioDevice->hidden->hevAudioBufferPlayed);
+ }
+ }
+ }
+ return TRUE;
+}
+
+
+int DART_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ Uint16 test_format = SDL_FirstAudioFormat(spec->format);
+ int valid_datatype = 0;
+ MCI_AMP_OPEN_PARMS AmpOpenParms;
+ MCI_GENERIC_PARMS GenericParms;
+ int iDeviceOrd = 0; // Default device to be used
+ int bOpenShared = 1; // Try opening it shared
+ int iBits = 16; // Default is 16 bits signed
+ int iFreq = 44100; // Default is 44KHz
+ int iChannels = 2; // Default is 2 channels (Stereo)
+ int iNumBufs = 2; // Number of audio buffers: 2
+ int iBufSize;
+ int iOpenMode;
+ int iSilence;
+ int rc;
+
+ // First thing is to try to open a given DART device!
+ SDL_memset(&AmpOpenParms, 0, sizeof(MCI_AMP_OPEN_PARMS));
+ // pszDeviceType should contain the device type in low word, and device ordinal in high word!
+ AmpOpenParms.pszDeviceType = (PSZ) (MCI_DEVTYPE_AUDIO_AMPMIX | (iDeviceOrd << 16));
+
+ iOpenMode = MCI_WAIT | MCI_OPEN_TYPE_ID;
+ if (bOpenShared) iOpenMode |= MCI_OPEN_SHAREABLE;
+
+ rc = mciSendCommand( 0, MCI_OPEN,
+ iOpenMode,
+ (PVOID) &AmpOpenParms, 0);
+ if (rc!=MCIERR_SUCCESS) // No audio available??
+ return (-1);
+ // Save the device ID we got from DART!
+ // We will use this in the next calls!
+ iDeviceOrd = AmpOpenParms.usDeviceID;
+
+ // Determine the audio parameters from the AudioSpec
+ if (spec->channels > 2)
+ spec->channels = 2; // !!! FIXME: more than stereo support in OS/2?
+
+ while ((!valid_datatype) && (test_format)) {
+ spec->format = test_format;
+ valid_datatype = 1;
+ switch (test_format) {
+ case AUDIO_U8:
+ // Unsigned 8 bit audio data
+ iSilence = 0x80;
+ iBits = 8;
+ break;
+
+ case AUDIO_S16LSB:
+ // Signed 16 bit audio data
+ iSilence = 0x00;
+ iBits = 16;
+ break;
+
+ default:
+ valid_datatype = 0;
+ test_format = SDL_NextAudioFormat();
+ break;
+ }
+ }
+
+ if (!valid_datatype) { // shouldn't happen, but just in case...
+ // Close DART, and exit with error code!
+ mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0);
+ SDL_SetError("Unsupported audio format");
+ return (-1);
+ }
+
+ iFreq = spec->freq;
+ iChannels = spec->channels;
+ /* Update the fragment size as size in bytes */
+ SDL_CalculateAudioSpec(spec);
+ iBufSize = spec->size;
+
+ // Now query this device if it supports the given freq/bits/channels!
+ SDL_memset(&(_this->hidden->MixSetupParms), 0, sizeof(MCI_MIXSETUP_PARMS));
+ _this->hidden->MixSetupParms.ulBitsPerSample = iBits;
+ _this->hidden->MixSetupParms.ulFormatTag = MCI_WAVE_FORMAT_PCM;
+ _this->hidden->MixSetupParms.ulSamplesPerSec = iFreq;
+ _this->hidden->MixSetupParms.ulChannels = iChannels;
+ _this->hidden->MixSetupParms.ulFormatMode = MCI_PLAY;
+ _this->hidden->MixSetupParms.ulDeviceType = MCI_DEVTYPE_WAVEFORM_AUDIO;
+ _this->hidden->MixSetupParms.pmixEvent = DARTEventFunc;
+ rc = mciSendCommand (iDeviceOrd, MCI_MIXSETUP,
+ MCI_WAIT | MCI_MIXSETUP_QUERYMODE,
+ &(_this->hidden->MixSetupParms), 0);
+ if (rc!=MCIERR_SUCCESS)
+ { // The device cannot handle this format!
+ // Close DART, and exit with error code!
+ mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0);
+ SDL_SetError("Audio device doesn't support requested audio format");
+ return(-1);
+ }
+ // The device can handle this format, so initialize!
+ rc = mciSendCommand(iDeviceOrd, MCI_MIXSETUP,
+ MCI_WAIT | MCI_MIXSETUP_INIT,
+ &(_this->hidden->MixSetupParms), 0);
+ if (rc!=MCIERR_SUCCESS)
+ { // The device could not be opened!
+ // Close DART, and exit with error code!
+ mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0);
+ SDL_SetError("Audio device could not be set up");
+ return(-1);
+ }
+ // Ok, the device is initialized.
+ // Now we should allocate buffers. For this, we need a place where
+ // the buffer descriptors will be:
+ _this->hidden->pMixBuffers = (MCI_MIX_BUFFER *) SDL_malloc(sizeof(MCI_MIX_BUFFER)*iNumBufs);
+ if (!(_this->hidden->pMixBuffers))
+ { // Not enough memory!
+ // Close DART, and exit with error code!
+ mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0);
+ SDL_SetError("Not enough memory for audio buffer descriptors");
+ return(-1);
+ }
+ // Now that we have the place for buffer list, we can ask DART for the
+ // buffers!
+ _this->hidden->BufferParms.ulNumBuffers = iNumBufs; // Number of buffers
+ _this->hidden->BufferParms.ulBufferSize = iBufSize; // each with this size
+ _this->hidden->BufferParms.pBufList = _this->hidden->pMixBuffers; // getting descriptorts into this list
+ // Allocate buffers!
+ rc = mciSendCommand(iDeviceOrd, MCI_BUFFER,
+ MCI_WAIT | MCI_ALLOCATE_MEMORY,
+ &(_this->hidden->BufferParms), 0);
+ if ((rc!=MCIERR_SUCCESS) || (iNumBufs != _this->hidden->BufferParms.ulNumBuffers) || (_this->hidden->BufferParms.ulBufferSize==0))
+ { // Could not allocate memory!
+ // Close DART, and exit with error code!
+ SDL_free(_this->hidden->pMixBuffers); _this->hidden->pMixBuffers = NULL;
+ mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0);
+ SDL_SetError("DART could not allocate buffers");
+ return(-1);
+ }
+ // Ok, we have all the buffers allocated, let's mark them!
+ {
+ int i;
+ for (i=0; i<iNumBufs; i++)
+ {
+ pMixBufferDesc pBufferDesc = (pMixBufferDesc) SDL_malloc(sizeof(tMixBufferDesc));;
+ // Check if this buffer was really allocated by DART
+ if ((!(_this->hidden->pMixBuffers[i].pBuffer)) || (!pBufferDesc))
+ { // Wrong buffer!
+ // Close DART, and exit with error code!
+ // Free buffer descriptions
+ { int j;
+ for (j=0; j<i; j++) SDL_free((void *)(_this->hidden->pMixBuffers[j].ulUserParm));
+ }
+ // and cleanup
+ mciSendCommand(iDeviceOrd, MCI_BUFFER, MCI_WAIT | MCI_DEALLOCATE_MEMORY, &(_this->hidden->BufferParms), 0);
+ SDL_free(_this->hidden->pMixBuffers); _this->hidden->pMixBuffers = NULL;
+ mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0);
+ SDL_SetError("Error at internal buffer check");
+ return(-1);
+ }
+ pBufferDesc->iBufferUsage = BUFFER_EMPTY;
+ pBufferDesc->pSDLAudioDevice = _this;
+
+ _this->hidden->pMixBuffers[i].ulBufferLength = _this->hidden->BufferParms.ulBufferSize;
+ _this->hidden->pMixBuffers[i].ulUserParm = (ULONG) pBufferDesc; // User parameter: Description of buffer
+ _this->hidden->pMixBuffers[i].ulFlags = 0; // Some stuff should be flagged here for DART, like end of
+ // audio data, but as we will continously send
+ // audio data, there will be no end.:)
+ SDL_memset(_this->hidden->pMixBuffers[i].pBuffer, iSilence, iBufSize);
+ }
+ }
+ _this->hidden->iNextFreeBuffer = 0;
+ _this->hidden->iLastPlayedBuf = -1;
+ // Create event semaphore
+ if (DosCreateEventSem(NULL, &(_this->hidden->hevAudioBufferPlayed), 0, FALSE)!=NO_ERROR)
+ {
+ // Could not create event semaphore!
+ {
+ int i;
+ for (i=0; i<iNumBufs; i++) SDL_free((void *)(_this->hidden->pMixBuffers[i].ulUserParm));
+ }
+ mciSendCommand(iDeviceOrd, MCI_BUFFER, MCI_WAIT | MCI_DEALLOCATE_MEMORY, &(_this->hidden->BufferParms), 0);
+ SDL_free(_this->hidden->pMixBuffers); _this->hidden->pMixBuffers = NULL;
+ mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0);
+ SDL_SetError("Could not create event semaphore");
+ return(-1);
+ }
+
+ // Store the new settings in global variables
+ _this->hidden->iCurrDeviceOrd = iDeviceOrd;
+ _this->hidden->iCurrFreq = iFreq;
+ _this->hidden->iCurrBits = iBits;
+ _this->hidden->iCurrChannels = iChannels;
+ _this->hidden->iCurrNumBufs = iNumBufs;
+ _this->hidden->iCurrBufSize = iBufSize;
+
+ return (0);
+}
+
+
+
+void DART_ThreadInit(_THIS)
+{
+ return;
+}
+
+/* This function waits until it is possible to write a full sound buffer */
+void DART_WaitAudio(_THIS)
+{
+ int i;
+ pMixBufferDesc pBufDesc;
+ ULONG ulPostCount;
+
+ DosResetEventSem(_this->hidden->hevAudioBufferPlayed, &ulPostCount);
+ // If there is already an empty buffer, then return now!
+ for (i=0; i<_this->hidden->iCurrNumBufs; i++)
+ {
+ pBufDesc = (pMixBufferDesc) _this->hidden->pMixBuffers[i].ulUserParm;
+ if (pBufDesc->iBufferUsage == BUFFER_EMPTY)
+ return;
+ }
+ // If there is no empty buffer, wait for one to be empty!
+ DosWaitEventSem(_this->hidden->hevAudioBufferPlayed, 1000); // Wait max 1 sec!!! Important!
+ return;
+}
+
+void DART_PlayAudio(_THIS)
+{
+ int iFreeBuf = _this->hidden->iNextFreeBuffer;
+ pMixBufferDesc pBufDesc;
+
+ pBufDesc = (pMixBufferDesc) _this->hidden->pMixBuffers[iFreeBuf].ulUserParm;
+ pBufDesc->iBufferUsage = BUFFER_USED;
+ // Send it to DART to be queued
+ _this->hidden->MixSetupParms.pmixWrite(_this->hidden->MixSetupParms.ulMixHandle,
+ &(_this->hidden->pMixBuffers[iFreeBuf]), 1);
+
+ _this->hidden->iLastPlayedBuf = iFreeBuf;
+ iFreeBuf = (iFreeBuf+1) % _this->hidden->iCurrNumBufs;
+ _this->hidden->iNextFreeBuffer = iFreeBuf;
+}
+
+Uint8 *DART_GetAudioBuf(_THIS)
+{
+ int iFreeBuf;
+ Uint8 *pResult;
+ pMixBufferDesc pBufDesc;
+
+ if (_this)
+ {
+ if (_this->hidden)
+ {
+ iFreeBuf = _this->hidden->iNextFreeBuffer;
+ pBufDesc = (pMixBufferDesc) _this->hidden->pMixBuffers[iFreeBuf].ulUserParm;
+
+ if (pBufDesc)
+ {
+ if (pBufDesc->iBufferUsage == BUFFER_EMPTY)
+ {
+ pResult = _this->hidden->pMixBuffers[iFreeBuf].pBuffer;
+ return pResult;
+ }
+ } else
+ printf("[DART_GetAudioBuf] : ERROR! pBufDesc = %p\n", pBufDesc);
+ } else
+ printf("[DART_GetAudioBuf] : ERROR! _this->hidden = %p\n", _this->hidden);
+ } else
+ printf("[DART_GetAudioBuf] : ERROR! _this = %p\n", _this);
+ return NULL;
+}
+
+void DART_WaitDone(_THIS)
+{
+ pMixBufferDesc pBufDesc;
+ ULONG ulPostCount;
+ APIRET rc;
+
+ pBufDesc = (pMixBufferDesc) _this->hidden->pMixBuffers[_this->hidden->iLastPlayedBuf].ulUserParm;
+ rc = NO_ERROR;
+ while ((pBufDesc->iBufferUsage != BUFFER_EMPTY) && (rc==NO_ERROR))
+ {
+ DosResetEventSem(_this->hidden->hevAudioBufferPlayed, &ulPostCount);
+ rc = DosWaitEventSem(_this->hidden->hevAudioBufferPlayed, 1000); // 1 sec timeout! Important!
+ }
+}
+
+void DART_CloseAudio(_THIS)
+{
+ MCI_GENERIC_PARMS GenericParms;
+ int rc;
+
+ // Stop DART playback
+ rc = mciSendCommand(_this->hidden->iCurrDeviceOrd, MCI_STOP, MCI_WAIT, &GenericParms, 0);
+ if (rc!=MCIERR_SUCCESS)
+ {
+#ifdef SFX_DEBUG_BUILD
+ printf("Could not stop DART playback!\n");
+ fflush(stdout);
+#endif
+ }
+
+ // Close event semaphore
+ DosCloseEventSem(_this->hidden->hevAudioBufferPlayed);
+
+ // Free memory of buffer descriptions
+ {
+ int i;
+ for (i=0; i<_this->hidden->iCurrNumBufs; i++) SDL_free((void *)(_this->hidden->pMixBuffers[i].ulUserParm));
+ }
+
+ // Deallocate buffers
+ rc = mciSendCommand(_this->hidden->iCurrDeviceOrd, MCI_BUFFER, MCI_WAIT | MCI_DEALLOCATE_MEMORY, &(_this->hidden->BufferParms), 0);
+
+ // Free bufferlist
+ SDL_free(_this->hidden->pMixBuffers); _this->hidden->pMixBuffers = NULL;
+
+ // Close dart
+ rc = mciSendCommand(_this->hidden->iCurrDeviceOrd, MCI_CLOSE, MCI_WAIT, &(GenericParms), 0);
+}
+
+/* Audio driver bootstrap functions */
+
+int Audio_Available(void)
+{
+ return(1);
+}
+
+void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this )
+ {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) )
+ {
+ SDL_OutOfMemory();
+ if ( this )
+ SDL_free(this);
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+
+ /* Set the function pointers */
+ this->OpenAudio = DART_OpenAudio;
+ this->ThreadInit = DART_ThreadInit;
+ this->WaitAudio = DART_WaitAudio;
+ this->PlayAudio = DART_PlayAudio;
+ this->GetAudioBuf = DART_GetAudioBuf;
+ this->WaitDone = DART_WaitDone;
+ this->CloseAudio = DART_CloseAudio;
+
+ this->free = Audio_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap DART_bootstrap = {
+ "dart", "OS/2 Direct Audio RouTines (DART)",
+ Audio_Available, Audio_CreateDevice
+};
+
diff --git a/distrib/sdl-1.2.15/src/audio/dart/SDL_dart.h b/distrib/sdl-1.2.15/src/audio/dart/SDL_dart.h
new file mode 100644
index 0000000..68c27bd
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/dart/SDL_dart.h
@@ -0,0 +1,63 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_lowaudio_h
+#define _SDL_lowaudio_h
+
+#define INCL_TYPES
+#define INCL_DOSSEMAPHORES
+#define INCL_DOSRESOURCES
+#define INCL_DOSMISC
+#define INCL_DOSERRORS
+
+#define INCL_OS2MM
+#define INCL_MMIOOS2
+#define INCL_MCIOS2
+#include <os2.h>
+#include <os2me.h> // DART stuff and MMIO stuff
+
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the audio functions */
+#define _THIS SDL_AudioDevice *_this
+
+/* The DirectSound objects */
+struct SDL_PrivateAudioData
+{
+ int iCurrDeviceOrd;
+ int iCurrFreq;
+ int iCurrBits;
+ int iCurrChannels;
+ int iCurrNumBufs;
+ int iCurrBufSize;
+
+ int iLastPlayedBuf;
+ int iNextFreeBuffer;
+
+ MCI_BUFFER_PARMS BufferParms; // Sound buffer parameters
+ MCI_MIX_BUFFER *pMixBuffers; // Sound buffers
+ MCI_MIXSETUP_PARMS MixSetupParms; // Mixer setup parameters
+ HEV hevAudioBufferPlayed; // Event semaphore to indicate that an audio buffer has been played by DART
+};
+
+#endif /* _SDL_lowaudio_h */
diff --git a/distrib/sdl-1.2.15/src/audio/dc/SDL_dcaudio.c b/distrib/sdl-1.2.15/src/audio/dc/SDL_dcaudio.c
new file mode 100644
index 0000000..88daa87
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/dc/SDL_dcaudio.c
@@ -0,0 +1,246 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+*/
+#include "SDL_config.h"
+
+/* Output dreamcast aica */
+
+#include "SDL_timer.h"
+#include "SDL_audio.h"
+#include "../SDL_audiomem.h"
+#include "../SDL_audio_c.h"
+#include "../SDL_audiodev_c.h"
+#include "SDL_dcaudio.h"
+
+#include "aica.h"
+#include <dc/spu.h>
+
+/* Audio driver functions */
+static int DCAUD_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void DCAUD_WaitAudio(_THIS);
+static void DCAUD_PlayAudio(_THIS);
+static Uint8 *DCAUD_GetAudioBuf(_THIS);
+static void DCAUD_CloseAudio(_THIS);
+
+/* Audio driver bootstrap functions */
+static int DCAUD_Available(void)
+{
+ return 1;
+}
+
+static void DCAUD_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_AudioDevice *DCAUD_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+
+ /* Set the function pointers */
+ this->OpenAudio = DCAUD_OpenAudio;
+ this->WaitAudio = DCAUD_WaitAudio;
+ this->PlayAudio = DCAUD_PlayAudio;
+ this->GetAudioBuf = DCAUD_GetAudioBuf;
+ this->CloseAudio = DCAUD_CloseAudio;
+
+ this->free = DCAUD_DeleteDevice;
+
+ spu_init();
+
+ return this;
+}
+
+AudioBootStrap DCAUD_bootstrap = {
+ "dcaudio", "Dreamcast AICA audio",
+ DCAUD_Available, DCAUD_CreateDevice
+};
+
+/* This function waits until it is possible to write a full sound buffer */
+static void DCAUD_WaitAudio(_THIS)
+{
+ if (this->hidden->playing) {
+ /* wait */
+ while(aica_get_pos(0)/this->spec.samples == this->hidden->nextbuf) {
+ thd_pass();
+ }
+ }
+}
+
+#define SPU_RAM_BASE 0xa0800000
+
+static void spu_memload_stereo8(int leftpos,int rightpos,void *src0,size_t size)
+{
+ uint8 *src = src0;
+ uint32 *left = (uint32*)(leftpos +SPU_RAM_BASE);
+ uint32 *right = (uint32*)(rightpos+SPU_RAM_BASE);
+ size = (size+7)/8;
+ while(size--) {
+ unsigned lval,rval;
+ lval = *src++;
+ rval = *src++;
+ lval|= (*src++)<<8;
+ rval|= (*src++)<<8;
+ lval|= (*src++)<<16;
+ rval|= (*src++)<<16;
+ lval|= (*src++)<<24;
+ rval|= (*src++)<<24;
+ g2_write_32(left++,lval);
+ g2_write_32(right++,rval);
+ g2_fifo_wait();
+ }
+}
+
+static void spu_memload_stereo16(int leftpos,int rightpos,void *src0,size_t size)
+{
+ uint16 *src = src0;
+ uint32 *left = (uint32*)(leftpos +SPU_RAM_BASE);
+ uint32 *right = (uint32*)(rightpos+SPU_RAM_BASE);
+ size = (size+7)/8;
+ while(size--) {
+ unsigned lval,rval;
+ lval = *src++;
+ rval = *src++;
+ lval|= (*src++)<<16;
+ rval|= (*src++)<<16;
+ g2_write_32(left++,lval);
+ g2_write_32(right++,rval);
+ g2_fifo_wait();
+ }
+}
+
+static void DCAUD_PlayAudio(_THIS)
+{
+ SDL_AudioSpec *spec = &this->spec;
+ unsigned int offset;
+
+ if (this->hidden->playing) {
+ /* wait */
+ while(aica_get_pos(0)/spec->samples == this->hidden->nextbuf) {
+ thd_pass();
+ }
+ }
+
+ offset = this->hidden->nextbuf*spec->size;
+ this->hidden->nextbuf^=1;
+ /* Write the audio data, checking for EAGAIN on broken audio drivers */
+ if (spec->channels==1) {
+ spu_memload(this->hidden->leftpos+offset,this->hidden->mixbuf,this->hidden->mixlen);
+ } else {
+ offset/=2;
+ if ((this->spec.format&255)==8) {
+ spu_memload_stereo8(this->hidden->leftpos+offset,this->hidden->rightpos+offset,this->hidden->mixbuf,this->hidden->mixlen);
+ } else {
+ spu_memload_stereo16(this->hidden->leftpos+offset,this->hidden->rightpos+offset,this->hidden->mixbuf,this->hidden->mixlen);
+ }
+ }
+
+ if (!this->hidden->playing) {
+ int mode;
+ this->hidden->playing = 1;
+ mode = (spec->format==AUDIO_S8)?SM_8BIT:SM_16BIT;
+ if (spec->channels==1) {
+ aica_play(0,mode,this->hidden->leftpos,0,spec->samples*2,spec->freq,255,128,1);
+ } else {
+ aica_play(0,mode,this->hidden->leftpos ,0,spec->samples*2,spec->freq,255,0,1);
+ aica_play(1,mode,this->hidden->rightpos,0,spec->samples*2,spec->freq,255,255,1);
+ }
+ }
+}
+
+static Uint8 *DCAUD_GetAudioBuf(_THIS)
+{
+ return(this->hidden->mixbuf);
+}
+
+static void DCAUD_CloseAudio(_THIS)
+{
+ aica_stop(0);
+ if (this->spec.channels==2) aica_stop(1);
+ if ( this->hidden->mixbuf != NULL ) {
+ SDL_FreeAudioMem(this->hidden->mixbuf);
+ this->hidden->mixbuf = NULL;
+ }
+}
+
+static int DCAUD_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ Uint16 test_format = SDL_FirstAudioFormat(spec->format);
+ int valid_datatype = 0;
+ while ((!valid_datatype) && (test_format)) {
+ spec->format = test_format;
+ switch (test_format) {
+ /* only formats Dreamcast accepts... */
+ case AUDIO_S8:
+ case AUDIO_S16LSB:
+ valid_datatype = 1;
+ break;
+
+ default:
+ test_format = SDL_NextAudioFormat();
+ break;
+ }
+ }
+
+ if (!valid_datatype) { /* shouldn't happen, but just in case... */
+ SDL_SetError("Unsupported audio format");
+ return (-1);
+ }
+
+ if (spec->channels > 2)
+ spec->channels = 2; /* no more than stereo on the Dreamcast. */
+
+ /* Update the fragment size as size in bytes */
+ SDL_CalculateAudioSpec(spec);
+
+ /* Allocate mixing buffer */
+ this->hidden->mixlen = spec->size;
+ this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
+ if ( this->hidden->mixbuf == NULL ) {
+ return(-1);
+ }
+ SDL_memset(this->hidden->mixbuf, spec->silence, spec->size);
+ this->hidden->leftpos = 0x11000;
+ this->hidden->rightpos = 0x11000+spec->size;
+ this->hidden->playing = 0;
+ this->hidden->nextbuf = 0;
+
+ /* We're ready to rock and roll. :-) */
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/src/audio/dc/SDL_dcaudio.h b/distrib/sdl-1.2.15/src/audio/dc/SDL_dcaudio.h
new file mode 100644
index 0000000..fba95b3
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/dc/SDL_dcaudio.h
@@ -0,0 +1,41 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_dcaudio_h
+#define _SDL_dcaudio_h
+
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_AudioDevice *this
+
+struct SDL_PrivateAudioData {
+ /* The file descriptor for the audio device */
+ Uint8 *mixbuf;
+ Uint32 mixlen;
+ int playing;
+ int leftpos,rightpos;
+ int nextbuf;
+};
+
+#endif /* _SDL_dcaudio_h */
diff --git a/distrib/sdl-1.2.12/src/audio/dc/aica.c b/distrib/sdl-1.2.15/src/audio/dc/aica.c
index b6a1c93..b6a1c93 100644
--- a/distrib/sdl-1.2.12/src/audio/dc/aica.c
+++ b/distrib/sdl-1.2.15/src/audio/dc/aica.c
diff --git a/distrib/sdl-1.2.15/src/audio/dc/aica.h b/distrib/sdl-1.2.15/src/audio/dc/aica.h
new file mode 100644
index 0000000..2721e42
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/dc/aica.h
@@ -0,0 +1,40 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _AICA_H_
+#define _AICA_H_
+
+#define AICA_MEM 0xa0800000
+
+#define SM_8BIT 1
+#define SM_16BIT 0
+#define SM_ADPCM 2
+
+void aica_play(int ch,int mode,unsigned long smpptr,int looptst,int loopend,int freq,int vol,int pan,int loopflag);
+void aica_stop(int ch);
+void aica_vol(int ch,int vol);
+void aica_pan(int ch,int pan);
+void aica_freq(int ch,int freq);
+int aica_get_pos(int ch);
+
+#endif
diff --git a/distrib/sdl-1.2.15/src/audio/disk/SDL_diskaudio.c b/distrib/sdl-1.2.15/src/audio/disk/SDL_diskaudio.c
new file mode 100644
index 0000000..47c1009
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/disk/SDL_diskaudio.c
@@ -0,0 +1,186 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ This file written by Ryan C. Gordon (icculus@icculus.org)
+*/
+#include "SDL_config.h"
+
+/* Output raw audio data to a file. */
+
+#if HAVE_STDIO_H
+#include <stdio.h>
+#endif
+
+#include "SDL_rwops.h"
+#include "SDL_timer.h"
+#include "SDL_audio.h"
+#include "../SDL_audiomem.h"
+#include "../SDL_audio_c.h"
+#include "../SDL_audiodev_c.h"
+#include "SDL_diskaudio.h"
+
+/* The tag name used by DISK audio */
+#define DISKAUD_DRIVER_NAME "disk"
+
+/* environment variables and defaults. */
+#define DISKENVR_OUTFILE "SDL_DISKAUDIOFILE"
+#define DISKDEFAULT_OUTFILE "sdlaudio.raw"
+#define DISKENVR_WRITEDELAY "SDL_DISKAUDIODELAY"
+#define DISKDEFAULT_WRITEDELAY 150
+
+/* Audio driver functions */
+static int DISKAUD_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void DISKAUD_WaitAudio(_THIS);
+static void DISKAUD_PlayAudio(_THIS);
+static Uint8 *DISKAUD_GetAudioBuf(_THIS);
+static void DISKAUD_CloseAudio(_THIS);
+
+static const char *DISKAUD_GetOutputFilename(void)
+{
+ const char *envr = SDL_getenv(DISKENVR_OUTFILE);
+ return((envr != NULL) ? envr : DISKDEFAULT_OUTFILE);
+}
+
+/* Audio driver bootstrap functions */
+static int DISKAUD_Available(void)
+{
+ const char *envr = SDL_getenv("SDL_AUDIODRIVER");
+ if (envr && (SDL_strcmp(envr, DISKAUD_DRIVER_NAME) == 0)) {
+ return(1);
+ }
+ return(0);
+}
+
+static void DISKAUD_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_AudioDevice *DISKAUD_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+ const char *envr;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+
+ envr = SDL_getenv(DISKENVR_WRITEDELAY);
+ this->hidden->write_delay = (envr) ? SDL_atoi(envr) : DISKDEFAULT_WRITEDELAY;
+
+ /* Set the function pointers */
+ this->OpenAudio = DISKAUD_OpenAudio;
+ this->WaitAudio = DISKAUD_WaitAudio;
+ this->PlayAudio = DISKAUD_PlayAudio;
+ this->GetAudioBuf = DISKAUD_GetAudioBuf;
+ this->CloseAudio = DISKAUD_CloseAudio;
+
+ this->free = DISKAUD_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap DISKAUD_bootstrap = {
+ DISKAUD_DRIVER_NAME, "direct-to-disk audio",
+ DISKAUD_Available, DISKAUD_CreateDevice
+};
+
+/* This function waits until it is possible to write a full sound buffer */
+static void DISKAUD_WaitAudio(_THIS)
+{
+ SDL_Delay(this->hidden->write_delay);
+}
+
+static void DISKAUD_PlayAudio(_THIS)
+{
+ int written;
+
+ /* Write the audio data */
+ written = SDL_RWwrite(this->hidden->output,
+ this->hidden->mixbuf, 1,
+ this->hidden->mixlen);
+
+ /* If we couldn't write, assume fatal error for now */
+ if ( (Uint32)written != this->hidden->mixlen ) {
+ this->enabled = 0;
+ }
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Wrote %d bytes of audio data\n", written);
+#endif
+}
+
+static Uint8 *DISKAUD_GetAudioBuf(_THIS)
+{
+ return(this->hidden->mixbuf);
+}
+
+static void DISKAUD_CloseAudio(_THIS)
+{
+ if ( this->hidden->mixbuf != NULL ) {
+ SDL_FreeAudioMem(this->hidden->mixbuf);
+ this->hidden->mixbuf = NULL;
+ }
+ if ( this->hidden->output != NULL ) {
+ SDL_RWclose(this->hidden->output);
+ this->hidden->output = NULL;
+ }
+}
+
+static int DISKAUD_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ const char *fname = DISKAUD_GetOutputFilename();
+
+ /* Open the audio device */
+ this->hidden->output = SDL_RWFromFile(fname, "wb");
+ if ( this->hidden->output == NULL ) {
+ return(-1);
+ }
+
+#if HAVE_STDIO_H
+ fprintf(stderr, "WARNING: You are using the SDL disk writer"
+ " audio driver!\n Writing to file [%s].\n", fname);
+#endif
+
+ /* Allocate mixing buffer */
+ this->hidden->mixlen = spec->size;
+ this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
+ if ( this->hidden->mixbuf == NULL ) {
+ return(-1);
+ }
+ SDL_memset(this->hidden->mixbuf, spec->silence, spec->size);
+
+ /* We're ready to rock and roll. :-) */
+ return(0);
+}
+
diff --git a/distrib/sdl-1.2.15/src/audio/disk/SDL_diskaudio.h b/distrib/sdl-1.2.15/src/audio/disk/SDL_diskaudio.h
new file mode 100644
index 0000000..24d7c9e
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/disk/SDL_diskaudio.h
@@ -0,0 +1,41 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_diskaudio_h
+#define _SDL_diskaudio_h
+
+#include "SDL_rwops.h"
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_AudioDevice *this
+
+struct SDL_PrivateAudioData {
+ /* The file descriptor for the audio device */
+ SDL_RWops *output;
+ Uint8 *mixbuf;
+ Uint32 mixlen;
+ Uint32 write_delay;
+};
+
+#endif /* _SDL_diskaudio_h */
diff --git a/distrib/sdl-1.2.15/src/audio/dma/SDL_dmaaudio.c b/distrib/sdl-1.2.15/src/audio/dma/SDL_dmaaudio.c
new file mode 100644
index 0000000..39f81d9
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/dma/SDL_dmaaudio.c
@@ -0,0 +1,455 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Allow access to a raw mixing buffer */
+
+#include <stdio.h>
+#include <string.h> /* For strerror() */
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+
+#if SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
+/* This is installed on some systems */
+#include <soundcard.h>
+#else
+/* This is recommended by OSS */
+#include <sys/soundcard.h>
+#endif
+
+#ifndef MAP_FAILED
+#define MAP_FAILED ((Uint8 *)-1)
+#endif
+
+#include "SDL_timer.h"
+#include "SDL_audio.h"
+#include "../SDL_audio_c.h"
+#include "../SDL_audiodev_c.h"
+#include "SDL_dmaaudio.h"
+
+/* The tag name used by DMA audio */
+#define DMA_DRIVER_NAME "dma"
+
+/* Open the audio device for playback, and don't block if busy */
+#define OPEN_FLAGS (O_RDWR|O_NONBLOCK)
+
+/* Audio driver functions */
+static int DMA_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void DMA_WaitAudio(_THIS);
+static void DMA_PlayAudio(_THIS);
+static Uint8 *DMA_GetAudioBuf(_THIS);
+static void DMA_CloseAudio(_THIS);
+
+/* Audio driver bootstrap functions */
+
+static int Audio_Available(void)
+{
+ int available;
+ int fd;
+
+ available = 0;
+
+ fd = SDL_OpenAudioPath(NULL, 0, OPEN_FLAGS, 0);
+ if ( fd >= 0 ) {
+ int caps;
+ struct audio_buf_info info;
+
+ if ( (ioctl(fd, SNDCTL_DSP_GETCAPS, &caps) == 0) &&
+ (caps & DSP_CAP_TRIGGER) && (caps & DSP_CAP_MMAP) &&
+ (ioctl(fd, SNDCTL_DSP_GETOSPACE, &info) == 0) ) {
+ available = 1;
+ }
+ close(fd);
+ }
+ return(available);
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+ audio_fd = -1;
+
+ /* Set the function pointers */
+ this->OpenAudio = DMA_OpenAudio;
+ this->WaitAudio = DMA_WaitAudio;
+ this->PlayAudio = DMA_PlayAudio;
+ this->GetAudioBuf = DMA_GetAudioBuf;
+ this->CloseAudio = DMA_CloseAudio;
+
+ this->free = Audio_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap DMA_bootstrap = {
+ DMA_DRIVER_NAME, "OSS /dev/dsp DMA audio",
+ Audio_Available, Audio_CreateDevice
+};
+
+/* This function waits until it is possible to write a full sound buffer */
+static void DMA_WaitAudio(_THIS)
+{
+ fd_set fdset;
+
+ /* Check to see if the thread-parent process is still alive */
+ { static int cnt = 0;
+ /* Note that this only works with thread implementations
+ that use a different process id for each thread.
+ */
+ if (parent && (((++cnt)%10) == 0)) { /* Check every 10 loops */
+ if ( kill(parent, 0) < 0 ) {
+ this->enabled = 0;
+ }
+ }
+ }
+
+ /* See if we need to use timed audio synchronization */
+ if ( frame_ticks ) {
+ /* Use timer for general audio synchronization */
+ Sint32 ticks;
+
+ ticks = ((Sint32)(next_frame - SDL_GetTicks()))-FUDGE_TICKS;
+ if ( ticks > 0 ) {
+ SDL_Delay(ticks);
+ }
+ } else {
+ /* Use select() for audio synchronization */
+ struct timeval timeout;
+ FD_ZERO(&fdset);
+ FD_SET(audio_fd, &fdset);
+ timeout.tv_sec = 10;
+ timeout.tv_usec = 0;
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Waiting for audio to get ready\n");
+#endif
+ if ( select(audio_fd+1, NULL, &fdset, NULL, &timeout) <= 0 ) {
+ const char *message =
+#ifdef AUDIO_OSPACE_HACK
+ "Audio timeout - buggy audio driver? (trying ospace)";
+#else
+ "Audio timeout - buggy audio driver? (disabled)";
+#endif
+ /* In general we should never print to the screen,
+ but in this case we have no other way of letting
+ the user know what happened.
+ */
+ fprintf(stderr, "SDL: %s\n", message);
+#ifdef AUDIO_OSPACE_HACK
+ /* We may be able to use GET_OSPACE trick */
+ frame_ticks = (float)(this->spec->samples*1000) /
+ this->spec->freq;
+ next_frame = SDL_GetTicks()+frame_ticks;
+#else
+ this->enabled = 0;
+ /* Don't try to close - may hang */
+ audio_fd = -1;
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Done disabling audio\n");
+#endif
+#endif /* AUDIO_OSPACE_HACK */
+ }
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Ready!\n");
+#endif
+ }
+}
+
+static void DMA_PlayAudio(_THIS)
+{
+ /* If timer synchronization is enabled, set the next write frame */
+ if ( frame_ticks ) {
+ next_frame += frame_ticks;
+ }
+ return;
+}
+
+static Uint8 *DMA_GetAudioBuf(_THIS)
+{
+ count_info info;
+ int playing;
+ int filling;
+
+ /* Get number of blocks, looping if we're not using select() */
+ do {
+ if ( ioctl(audio_fd, SNDCTL_DSP_GETOPTR, &info) < 0 ) {
+ /* Uh oh... */
+ this->enabled = 0;
+ return(NULL);
+ }
+ } while ( frame_ticks && (info.blocks < 1) );
+#ifdef DEBUG_AUDIO
+ if ( info.blocks > 1 ) {
+ printf("Warning: audio underflow (%d frags)\n", info.blocks-1);
+ }
+#endif
+ playing = info.ptr / this->spec.size;
+ filling = (playing + 1)%num_buffers;
+ return (dma_buf + (filling * this->spec.size));
+}
+
+static void DMA_CloseAudio(_THIS)
+{
+ if ( dma_buf != NULL ) {
+ munmap(dma_buf, dma_len);
+ dma_buf = NULL;
+ }
+ if ( audio_fd >= 0 ) {
+ close(audio_fd);
+ audio_fd = -1;
+ }
+}
+
+static int DMA_ReopenAudio(_THIS, const char *audiodev, int format, int stereo,
+ SDL_AudioSpec *spec)
+{
+ int frag_spec;
+ int value;
+
+ /* Close and then reopen the audio device */
+ close(audio_fd);
+ audio_fd = open(audiodev, O_RDWR, 0);
+ if ( audio_fd < 0 ) {
+ SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno));
+ return(-1);
+ }
+
+ /* Calculate the final parameters for this audio specification */
+ SDL_CalculateAudioSpec(spec);
+
+ /* Determine the power of two of the fragment size */
+ for ( frag_spec = 0; (0x01<<frag_spec) < spec->size; ++frag_spec );
+ if ( (0x01<<frag_spec) != spec->size ) {
+ SDL_SetError("Fragment size must be a power of two");
+ return(-1);
+ }
+
+ /* Set the audio buffering parameters */
+ if ( ioctl(audio_fd, SNDCTL_DSP_SETFRAGMENT, &frag_spec) < 0 ) {
+ SDL_SetError("Couldn't set audio fragment spec");
+ return(-1);
+ }
+
+ /* Set the audio format */
+ value = format;
+ if ( (ioctl(audio_fd, SNDCTL_DSP_SETFMT, &value) < 0) ||
+ (value != format) ) {
+ SDL_SetError("Couldn't set audio format");
+ return(-1);
+ }
+
+ /* Set mono or stereo audio */
+ value = (spec->channels > 1);
+ if ( (ioctl(audio_fd, SNDCTL_DSP_STEREO, &stereo) < 0) ||
+ (value != stereo) ) {
+ SDL_SetError("Couldn't set audio channels");
+ return(-1);
+ }
+
+ /* Set the DSP frequency */
+ value = spec->freq;
+ if ( ioctl(audio_fd, SNDCTL_DSP_SPEED, &value) < 0 ) {
+ SDL_SetError("Couldn't set audio frequency");
+ return(-1);
+ }
+ spec->freq = value;
+
+ /* We successfully re-opened the audio */
+ return(0);
+}
+
+static int DMA_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ char audiodev[1024];
+ int format;
+ int stereo;
+ int value;
+ Uint16 test_format;
+ struct audio_buf_info info;
+
+ /* Reset the timer synchronization flag */
+ frame_ticks = 0.0;
+
+ /* Open the audio device */
+ audio_fd = SDL_OpenAudioPath(audiodev, sizeof(audiodev), OPEN_FLAGS, 0);
+ if ( audio_fd < 0 ) {
+ SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno));
+ return(-1);
+ }
+ dma_buf = NULL;
+ ioctl(audio_fd, SNDCTL_DSP_RESET, 0);
+
+ /* Get a list of supported hardware formats */
+ if ( ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &value) < 0 ) {
+ SDL_SetError("Couldn't get audio format list");
+ return(-1);
+ }
+
+ /* Try for a closest match on audio format */
+ format = 0;
+ for ( test_format = SDL_FirstAudioFormat(spec->format);
+ ! format && test_format; ) {
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Trying format 0x%4.4x\n", test_format);
+#endif
+ switch ( test_format ) {
+ case AUDIO_U8:
+ if ( value & AFMT_U8 ) {
+ format = AFMT_U8;
+ }
+ break;
+ case AUDIO_S8:
+ if ( value & AFMT_S8 ) {
+ format = AFMT_S8;
+ }
+ break;
+ case AUDIO_S16LSB:
+ if ( value & AFMT_S16_LE ) {
+ format = AFMT_S16_LE;
+ }
+ break;
+ case AUDIO_S16MSB:
+ if ( value & AFMT_S16_BE ) {
+ format = AFMT_S16_BE;
+ }
+ break;
+ case AUDIO_U16LSB:
+ if ( value & AFMT_U16_LE ) {
+ format = AFMT_U16_LE;
+ }
+ break;
+ case AUDIO_U16MSB:
+ if ( value & AFMT_U16_BE ) {
+ format = AFMT_U16_BE;
+ }
+ break;
+ default:
+ format = 0;
+ break;
+ }
+ if ( ! format ) {
+ test_format = SDL_NextAudioFormat();
+ }
+ }
+ if ( format == 0 ) {
+ SDL_SetError("Couldn't find any hardware audio formats");
+ return(-1);
+ }
+ spec->format = test_format;
+
+ /* Set the audio format */
+ value = format;
+ if ( (ioctl(audio_fd, SNDCTL_DSP_SETFMT, &value) < 0) ||
+ (value != format) ) {
+ SDL_SetError("Couldn't set audio format");
+ return(-1);
+ }
+
+ /* Set mono or stereo audio (currently only two channels supported) */
+ stereo = (spec->channels > 1);
+ ioctl(audio_fd, SNDCTL_DSP_STEREO, &stereo);
+ if ( stereo ) {
+ spec->channels = 2;
+ } else {
+ spec->channels = 1;
+ }
+
+ /* Because some drivers don't allow setting the buffer size
+ after setting the format, we must re-open the audio device
+ once we know what format and channels are supported
+ */
+ if ( DMA_ReopenAudio(this, audiodev, format, stereo, spec) < 0 ) {
+ /* Error is set by DMA_ReopenAudio() */
+ return(-1);
+ }
+
+ /* Memory map the audio buffer */
+ if ( ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info) < 0 ) {
+ SDL_SetError("Couldn't get OSPACE parameters");
+ return(-1);
+ }
+ spec->size = info.fragsize;
+ spec->samples = spec->size / ((spec->format & 0xFF) / 8);
+ spec->samples /= spec->channels;
+ num_buffers = info.fragstotal;
+ dma_len = num_buffers*spec->size;
+ dma_buf = (Uint8 *)mmap(NULL, dma_len, PROT_WRITE, MAP_SHARED,
+ audio_fd, 0);
+ if ( dma_buf == MAP_FAILED ) {
+ SDL_SetError("DMA memory map failed");
+ dma_buf = NULL;
+ return(-1);
+ }
+ SDL_memset(dma_buf, spec->silence, dma_len);
+
+ /* Check to see if we need to use select() workaround */
+ { char *workaround;
+ workaround = SDL_getenv("SDL_DSP_NOSELECT");
+ if ( workaround ) {
+ frame_ticks = (float)(spec->samples*1000)/spec->freq;
+ next_frame = SDL_GetTicks()+frame_ticks;
+ }
+ }
+
+ /* Trigger audio playback */
+ value = 0;
+ ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &value);
+ value = PCM_ENABLE_OUTPUT;
+ if ( ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &value) < 0 ) {
+ SDL_SetError("Couldn't trigger audio output");
+ return(-1);
+ }
+
+ /* Get the parent process id (we're the parent of the audio thread) */
+ parent = getpid();
+
+ /* We're ready to rock and roll. :-) */
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/src/audio/dma/SDL_dmaaudio.h b/distrib/sdl-1.2.15/src/audio/dma/SDL_dmaaudio.h
new file mode 100644
index 0000000..9a45f73
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/dma/SDL_dmaaudio.h
@@ -0,0 +1,59 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_dspaudio_h
+#define _SDL_dspaudio_h
+
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_AudioDevice *this
+
+struct SDL_PrivateAudioData {
+ /* The file descriptor for the audio device */
+ int audio_fd;
+
+ /* The parent process id, to detect when application quits */
+ pid_t parent;
+
+ /* Raw mixing buffer */
+ Uint8 *dma_buf;
+ int dma_len;
+ int num_buffers;
+
+ /* Support for audio timing using a timer, in addition to select() */
+ float frame_ticks;
+ float next_frame;
+};
+#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */
+
+/* Old variable names */
+#define audio_fd (this->hidden->audio_fd)
+#define parent (this->hidden->parent)
+#define dma_buf (this->hidden->dma_buf)
+#define dma_len (this->hidden->dma_len)
+#define num_buffers (this->hidden->num_buffers)
+#define frame_ticks (this->hidden->frame_ticks)
+#define next_frame (this->hidden->next_frame)
+
+#endif /* _SDL_dspaudio_h */
diff --git a/distrib/sdl-1.2.15/src/audio/dmedia/SDL_irixaudio.c b/distrib/sdl-1.2.15/src/audio/dmedia/SDL_irixaudio.c
new file mode 100644
index 0000000..1dcd242
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/dmedia/SDL_irixaudio.c
@@ -0,0 +1,242 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Allow access to a raw mixing buffer (For IRIX 6.5 and higher) */
+/* patch for IRIX 5 by Georg Schwarz 18/07/2004 */
+
+#include "SDL_timer.h"
+#include "SDL_audio.h"
+#include "../SDL_audiomem.h"
+#include "../SDL_audio_c.h"
+#include "SDL_irixaudio.h"
+
+
+#ifndef AL_RESOURCE /* as a test whether we use the old IRIX audio libraries */
+#define OLD_IRIX_AUDIO
+#define alClosePort(x) ALcloseport(x)
+#define alFreeConfig(x) ALfreeconfig(x)
+#define alGetFillable(x) ALgetfillable(x)
+#define alNewConfig() ALnewconfig()
+#define alOpenPort(x,y,z) ALopenport(x,y,z)
+#define alSetChannels(x,y) ALsetchannels(x,y)
+#define alSetQueueSize(x,y) ALsetqueuesize(x,y)
+#define alSetSampFmt(x,y) ALsetsampfmt(x,y)
+#define alSetWidth(x,y) ALsetwidth(x,y)
+#endif
+
+/* Audio driver functions */
+static int AL_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void AL_WaitAudio(_THIS);
+static void AL_PlayAudio(_THIS);
+static Uint8 *AL_GetAudioBuf(_THIS);
+static void AL_CloseAudio(_THIS);
+
+/* Audio driver bootstrap functions */
+
+static int Audio_Available(void)
+{
+ return 1;
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+
+ /* Set the function pointers */
+ this->OpenAudio = AL_OpenAudio;
+ this->WaitAudio = AL_WaitAudio;
+ this->PlayAudio = AL_PlayAudio;
+ this->GetAudioBuf = AL_GetAudioBuf;
+ this->CloseAudio = AL_CloseAudio;
+
+ this->free = Audio_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap DMEDIA_bootstrap = {
+ "AL", "IRIX DMedia audio",
+ Audio_Available, Audio_CreateDevice
+};
+
+
+void static AL_WaitAudio(_THIS)
+{
+ Sint32 timeleft;
+
+ timeleft = this->spec.samples - alGetFillable(audio_port);
+ if ( timeleft > 0 ) {
+ timeleft /= (this->spec.freq/1000);
+ SDL_Delay((Uint32)timeleft);
+ }
+}
+
+static void AL_PlayAudio(_THIS)
+{
+ /* Write the audio data out */
+ if ( alWriteFrames(audio_port, mixbuf, this->spec.samples) < 0 ) {
+ /* Assume fatal error, for now */
+ this->enabled = 0;
+ }
+}
+
+static Uint8 *AL_GetAudioBuf(_THIS)
+{
+ return(mixbuf);
+}
+
+static void AL_CloseAudio(_THIS)
+{
+ if ( mixbuf != NULL ) {
+ SDL_FreeAudioMem(mixbuf);
+ mixbuf = NULL;
+ }
+ if ( audio_port != NULL ) {
+ alClosePort(audio_port);
+ audio_port = NULL;
+ }
+}
+
+static int AL_OpenAudio(_THIS, SDL_AudioSpec * spec)
+{
+ Uint16 test_format = SDL_FirstAudioFormat(spec->format);
+ long width = 0;
+ long fmt = 0;
+ int valid = 0;
+
+#ifdef OLD_IRIX_AUDIO
+ {
+ long audio_param[2];
+ audio_param[0] = AL_OUTPUT_RATE;
+ audio_param[1] = spec->freq;
+ valid = (ALsetparams(AL_DEFAULT_DEVICE, audio_param, 2) < 0);
+ }
+#else
+ {
+ ALpv audio_param;
+ audio_param.param = AL_RATE;
+ audio_param.value.i = spec->freq;
+ valid = (alSetParams(AL_DEFAULT_OUTPUT, &audio_param, 1) < 0);
+ }
+#endif
+
+ while ((!valid) && (test_format)) {
+ valid = 1;
+ spec->format = test_format;
+
+ switch (test_format) {
+ case AUDIO_S8:
+ width = AL_SAMPLE_8;
+ fmt = AL_SAMPFMT_TWOSCOMP;
+ break;
+
+ case AUDIO_S16SYS:
+ width = AL_SAMPLE_16;
+ fmt = AL_SAMPFMT_TWOSCOMP;
+ break;
+
+ default:
+ valid = 0;
+ test_format = SDL_NextAudioFormat();
+ break;
+ }
+
+ if (valid) {
+ ALconfig audio_config = alNewConfig();
+ valid = 0;
+ if (audio_config) {
+ if (alSetChannels(audio_config, spec->channels) < 0) {
+ if (spec->channels > 2) { /* can't handle > stereo? */
+ spec->channels = 2; /* try again below. */
+ }
+ }
+
+ if ((alSetSampFmt(audio_config, fmt) >= 0) &&
+ ((!width) || (alSetWidth(audio_config, width) >= 0)) &&
+ (alSetQueueSize(audio_config, spec->samples * 2) >= 0) &&
+ (alSetChannels(audio_config, spec->channels) >= 0)) {
+
+ audio_port = alOpenPort("SDL audio", "w", audio_config);
+ if (audio_port == NULL) {
+ /* docs say AL_BAD_CHANNELS happens here, too. */
+ int err = oserror();
+ if (err == AL_BAD_CHANNELS) {
+ spec->channels = 2;
+ alSetChannels(audio_config, spec->channels);
+ audio_port = alOpenPort("SDL audio", "w",
+ audio_config);
+ }
+ }
+
+ if (audio_port != NULL) {
+ valid = 1;
+ }
+ }
+
+ alFreeConfig(audio_config);
+ }
+ }
+ }
+
+ if (!valid) {
+ SDL_SetError("Unsupported audio format");
+ return (-1);
+ }
+
+ /* Update the fragment size as size in bytes */
+ SDL_CalculateAudioSpec(spec);
+
+ /* Allocate mixing buffer */
+ mixbuf = (Uint8 *) SDL_AllocAudioMem(spec->size);
+ if (mixbuf == NULL) {
+ SDL_OutOfMemory();
+ return (-1);
+ }
+ SDL_memset(mixbuf, spec->silence, spec->size);
+
+ /* We're ready to rock and roll. :-) */
+ return (0);
+}
+
diff --git a/distrib/sdl-1.2.15/src/audio/dmedia/SDL_irixaudio.h b/distrib/sdl-1.2.15/src/audio/dmedia/SDL_irixaudio.h
new file mode 100644
index 0000000..c04f497
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/dmedia/SDL_irixaudio.h
@@ -0,0 +1,45 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_lowaudio_h
+#define _SDL_lowaudio_h
+
+#include <dmedia/audio.h>
+
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the audio functions */
+#define _THIS SDL_AudioDevice *this
+
+struct SDL_PrivateAudioData {
+ /* The handle for the audio device */
+ ALport audio_port;
+
+ Uint8 *mixbuf; /* The app mixing buffer */
+};
+
+/* Old variable names */
+#define audio_port (this->hidden->audio_port)
+#define mixbuf (this->hidden->mixbuf)
+
+#endif /* _SDL_lowaudio_h */
diff --git a/distrib/sdl-1.2.15/src/audio/dsp/SDL_dspaudio.c b/distrib/sdl-1.2.15/src/audio/dsp/SDL_dspaudio.c
new file mode 100644
index 0000000..256c547
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/dsp/SDL_dspaudio.c
@@ -0,0 +1,340 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ Modified in Oct 2004 by Hannu Savolainen
+ hannu@opensound.com
+*/
+#include "SDL_config.h"
+
+/* Allow access to a raw mixing buffer */
+
+#include <stdio.h> /* For perror() */
+#include <string.h> /* For strerror() */
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+
+#if SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
+/* This is installed on some systems */
+#include <soundcard.h>
+#else
+/* This is recommended by OSS */
+#include <sys/soundcard.h>
+#endif
+
+#include "SDL_timer.h"
+#include "SDL_audio.h"
+#include "../SDL_audiomem.h"
+#include "../SDL_audio_c.h"
+#include "../SDL_audiodev_c.h"
+#include "SDL_dspaudio.h"
+
+/* The tag name used by DSP audio */
+#define DSP_DRIVER_NAME "dsp"
+
+/* Open the audio device for playback, and don't block if busy */
+#define OPEN_FLAGS (O_WRONLY|O_NONBLOCK)
+
+/* Audio driver functions */
+static int DSP_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void DSP_WaitAudio(_THIS);
+static void DSP_PlayAudio(_THIS);
+static Uint8 *DSP_GetAudioBuf(_THIS);
+static void DSP_CloseAudio(_THIS);
+
+/* Audio driver bootstrap functions */
+
+static int Audio_Available(void)
+{
+ int fd;
+ int available;
+
+ available = 0;
+ fd = SDL_OpenAudioPath(NULL, 0, OPEN_FLAGS, 0);
+ if ( fd >= 0 ) {
+ available = 1;
+ close(fd);
+ }
+ return(available);
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+ audio_fd = -1;
+
+ /* Set the function pointers */
+ this->OpenAudio = DSP_OpenAudio;
+ this->WaitAudio = DSP_WaitAudio;
+ this->PlayAudio = DSP_PlayAudio;
+ this->GetAudioBuf = DSP_GetAudioBuf;
+ this->CloseAudio = DSP_CloseAudio;
+
+ this->free = Audio_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap DSP_bootstrap = {
+ DSP_DRIVER_NAME, "OSS /dev/dsp standard audio",
+ Audio_Available, Audio_CreateDevice
+};
+
+/* This function waits until it is possible to write a full sound buffer */
+static void DSP_WaitAudio(_THIS)
+{
+ /* Not needed at all since OSS handles waiting automagically */
+}
+
+static void DSP_PlayAudio(_THIS)
+{
+ if (write(audio_fd, mixbuf, mixlen)==-1)
+ {
+ perror("Audio write");
+ this->enabled = 0;
+ }
+
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Wrote %d bytes of audio data\n", mixlen);
+#endif
+}
+
+static Uint8 *DSP_GetAudioBuf(_THIS)
+{
+ return(mixbuf);
+}
+
+static void DSP_CloseAudio(_THIS)
+{
+ if ( mixbuf != NULL ) {
+ SDL_FreeAudioMem(mixbuf);
+ mixbuf = NULL;
+ }
+ if ( audio_fd >= 0 ) {
+ close(audio_fd);
+ audio_fd = -1;
+ }
+}
+
+static int DSP_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ char audiodev[1024];
+ int format;
+ int value;
+ int frag_spec;
+ Uint16 test_format;
+
+ /* Make sure fragment size stays a power of 2, or OSS fails. */
+ /* I don't know which of these are actually legal values, though... */
+ if (spec->channels > 8)
+ spec->channels = 8;
+ else if (spec->channels > 4)
+ spec->channels = 4;
+ else if (spec->channels > 2)
+ spec->channels = 2;
+
+ /* Open the audio device */
+ audio_fd = SDL_OpenAudioPath(audiodev, sizeof(audiodev), OPEN_FLAGS, 0);
+ if ( audio_fd < 0 ) {
+ SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno));
+ return(-1);
+ }
+ mixbuf = NULL;
+
+ /* Make the file descriptor use blocking writes with fcntl() */
+ { long flags;
+ flags = fcntl(audio_fd, F_GETFL);
+ flags &= ~O_NONBLOCK;
+ if ( fcntl(audio_fd, F_SETFL, flags) < 0 ) {
+ SDL_SetError("Couldn't set audio blocking mode");
+ DSP_CloseAudio(this);
+ return(-1);
+ }
+ }
+
+ /* Get a list of supported hardware formats */
+ if ( ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &value) < 0 ) {
+ perror("SNDCTL_DSP_GETFMTS");
+ SDL_SetError("Couldn't get audio format list");
+ DSP_CloseAudio(this);
+ return(-1);
+ }
+
+ /* Try for a closest match on audio format */
+ format = 0;
+ for ( test_format = SDL_FirstAudioFormat(spec->format);
+ ! format && test_format; ) {
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Trying format 0x%4.4x\n", test_format);
+#endif
+ switch ( test_format ) {
+ case AUDIO_U8:
+ if ( value & AFMT_U8 ) {
+ format = AFMT_U8;
+ }
+ break;
+ case AUDIO_S16LSB:
+ if ( value & AFMT_S16_LE ) {
+ format = AFMT_S16_LE;
+ }
+ break;
+ case AUDIO_S16MSB:
+ if ( value & AFMT_S16_BE ) {
+ format = AFMT_S16_BE;
+ }
+ break;
+#if 0
+/*
+ * These formats are not used by any real life systems so they are not
+ * needed here.
+ */
+ case AUDIO_S8:
+ if ( value & AFMT_S8 ) {
+ format = AFMT_S8;
+ }
+ break;
+ case AUDIO_U16LSB:
+ if ( value & AFMT_U16_LE ) {
+ format = AFMT_U16_LE;
+ }
+ break;
+ case AUDIO_U16MSB:
+ if ( value & AFMT_U16_BE ) {
+ format = AFMT_U16_BE;
+ }
+ break;
+#endif
+ default:
+ format = 0;
+ break;
+ }
+ if ( ! format ) {
+ test_format = SDL_NextAudioFormat();
+ }
+ }
+ if ( format == 0 ) {
+ SDL_SetError("Couldn't find any hardware audio formats");
+ DSP_CloseAudio(this);
+ return(-1);
+ }
+ spec->format = test_format;
+
+ /* Set the audio format */
+ value = format;
+ if ( (ioctl(audio_fd, SNDCTL_DSP_SETFMT, &value) < 0) ||
+ (value != format) ) {
+ perror("SNDCTL_DSP_SETFMT");
+ SDL_SetError("Couldn't set audio format");
+ DSP_CloseAudio(this);
+ return(-1);
+ }
+
+ /* Set the number of channels of output */
+ value = spec->channels;
+ if ( ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &value) < 0 ) {
+ perror("SNDCTL_DSP_CHANNELS");
+ SDL_SetError("Cannot set the number of channels");
+ DSP_CloseAudio(this);
+ return(-1);
+ }
+ spec->channels = value;
+
+ /* Set the DSP frequency */
+ value = spec->freq;
+ if ( ioctl(audio_fd, SNDCTL_DSP_SPEED, &value) < 0 ) {
+ perror("SNDCTL_DSP_SPEED");
+ SDL_SetError("Couldn't set audio frequency");
+ DSP_CloseAudio(this);
+ return(-1);
+ }
+ spec->freq = value;
+
+ /* Calculate the final parameters for this audio specification */
+ SDL_CalculateAudioSpec(spec);
+
+ /* Determine the power of two of the fragment size */
+ for ( frag_spec = 0; (0x01U<<frag_spec) < spec->size; ++frag_spec );
+ if ( (0x01U<<frag_spec) != spec->size ) {
+ SDL_SetError("Fragment size must be a power of two");
+ DSP_CloseAudio(this);
+ return(-1);
+ }
+ frag_spec |= 0x00020000; /* two fragments, for low latency */
+
+ /* Set the audio buffering parameters */
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Requesting %d fragments of size %d\n",
+ (frag_spec >> 16), 1<<(frag_spec&0xFFFF));
+#endif
+ if ( ioctl(audio_fd, SNDCTL_DSP_SETFRAGMENT, &frag_spec) < 0 ) {
+ perror("SNDCTL_DSP_SETFRAGMENT");
+ }
+#ifdef DEBUG_AUDIO
+ { audio_buf_info info;
+ ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info);
+ fprintf(stderr, "fragments = %d\n", info.fragments);
+ fprintf(stderr, "fragstotal = %d\n", info.fragstotal);
+ fprintf(stderr, "fragsize = %d\n", info.fragsize);
+ fprintf(stderr, "bytes = %d\n", info.bytes);
+ }
+#endif
+
+ /* Allocate mixing buffer */
+ mixlen = spec->size;
+ mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen);
+ if ( mixbuf == NULL ) {
+ DSP_CloseAudio(this);
+ return(-1);
+ }
+ SDL_memset(mixbuf, spec->silence, spec->size);
+
+ /* Get the parent process id (we're the parent of the audio thread) */
+ parent = getpid();
+
+ /* We're ready to rock and roll. :-) */
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/src/audio/dsp/SDL_dspaudio.h b/distrib/sdl-1.2.15/src/audio/dsp/SDL_dspaudio.h
new file mode 100644
index 0000000..382544f
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/dsp/SDL_dspaudio.h
@@ -0,0 +1,53 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_dspaudio_h
+#define _SDL_dspaudio_h
+
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_AudioDevice *this
+
+struct SDL_PrivateAudioData {
+ /* The file descriptor for the audio device */
+ int audio_fd;
+
+ /* The parent process id, to detect when application quits */
+ pid_t parent;
+
+ /* Raw mixing buffer */
+ Uint8 *mixbuf;
+ int mixlen;
+};
+#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */
+
+/* Old variable names */
+#define audio_fd (this->hidden->audio_fd)
+#define parent (this->hidden->parent)
+#define mixbuf (this->hidden->mixbuf)
+#define mixlen (this->hidden->mixlen)
+#define frame_ticks (this->hidden->frame_ticks)
+#define next_frame (this->hidden->next_frame)
+
+#endif /* _SDL_dspaudio_h */
diff --git a/distrib/sdl-1.2.15/src/audio/dummy/SDL_dummyaudio.c b/distrib/sdl-1.2.15/src/audio/dummy/SDL_dummyaudio.c
new file mode 100644
index 0000000..484b50d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/dummy/SDL_dummyaudio.c
@@ -0,0 +1,156 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ This file written by Ryan C. Gordon (icculus@icculus.org)
+*/
+#include "SDL_config.h"
+
+/* Output audio to nowhere... */
+
+#include "SDL_rwops.h"
+#include "SDL_timer.h"
+#include "SDL_audio.h"
+#include "../SDL_audiomem.h"
+#include "../SDL_audio_c.h"
+#include "../SDL_audiodev_c.h"
+#include "SDL_dummyaudio.h"
+
+/* The tag name used by DUMMY audio */
+#define DUMMYAUD_DRIVER_NAME "dummy"
+
+/* Audio driver functions */
+static int DUMMYAUD_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void DUMMYAUD_WaitAudio(_THIS);
+static void DUMMYAUD_PlayAudio(_THIS);
+static Uint8 *DUMMYAUD_GetAudioBuf(_THIS);
+static void DUMMYAUD_CloseAudio(_THIS);
+
+/* Audio driver bootstrap functions */
+static int DUMMYAUD_Available(void)
+{
+ const char *envr = SDL_getenv("SDL_AUDIODRIVER");
+ if (envr && (SDL_strcmp(envr, DUMMYAUD_DRIVER_NAME) == 0)) {
+ return(1);
+ }
+ return(0);
+}
+
+static void DUMMYAUD_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_AudioDevice *DUMMYAUD_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+
+ /* Set the function pointers */
+ this->OpenAudio = DUMMYAUD_OpenAudio;
+ this->WaitAudio = DUMMYAUD_WaitAudio;
+ this->PlayAudio = DUMMYAUD_PlayAudio;
+ this->GetAudioBuf = DUMMYAUD_GetAudioBuf;
+ this->CloseAudio = DUMMYAUD_CloseAudio;
+
+ this->free = DUMMYAUD_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap DUMMYAUD_bootstrap = {
+ DUMMYAUD_DRIVER_NAME, "SDL dummy audio driver",
+ DUMMYAUD_Available, DUMMYAUD_CreateDevice
+};
+
+/* This function waits until it is possible to write a full sound buffer */
+static void DUMMYAUD_WaitAudio(_THIS)
+{
+ /* Don't block on first calls to simulate initial fragment filling. */
+ if (this->hidden->initial_calls)
+ this->hidden->initial_calls--;
+ else
+ SDL_Delay(this->hidden->write_delay);
+}
+
+static void DUMMYAUD_PlayAudio(_THIS)
+{
+ /* no-op...this is a null driver. */
+}
+
+static Uint8 *DUMMYAUD_GetAudioBuf(_THIS)
+{
+ return(this->hidden->mixbuf);
+}
+
+static void DUMMYAUD_CloseAudio(_THIS)
+{
+ if ( this->hidden->mixbuf != NULL ) {
+ SDL_FreeAudioMem(this->hidden->mixbuf);
+ this->hidden->mixbuf = NULL;
+ }
+}
+
+static int DUMMYAUD_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ float bytes_per_sec = 0.0f;
+
+ /* Allocate mixing buffer */
+ this->hidden->mixlen = spec->size;
+ this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
+ if ( this->hidden->mixbuf == NULL ) {
+ return(-1);
+ }
+ SDL_memset(this->hidden->mixbuf, spec->silence, spec->size);
+
+ bytes_per_sec = (float) (((spec->format & 0xFF) / 8) *
+ spec->channels * spec->freq);
+
+ /*
+ * We try to make this request more audio at the correct rate for
+ * a given audio spec, so timing stays fairly faithful.
+ * Also, we have it not block at all for the first two calls, so
+ * it seems like we're filling two audio fragments right out of the
+ * gate, like other SDL drivers tend to do.
+ */
+ this->hidden->initial_calls = 2;
+ this->hidden->write_delay =
+ (Uint32) ((((float) spec->size) / bytes_per_sec) * 1000.0f);
+
+ /* We're ready to rock and roll. :-) */
+ return(0);
+}
+
diff --git a/distrib/sdl-1.2.15/src/audio/dummy/SDL_dummyaudio.h b/distrib/sdl-1.2.15/src/audio/dummy/SDL_dummyaudio.h
new file mode 100644
index 0000000..74a69ca
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/dummy/SDL_dummyaudio.h
@@ -0,0 +1,40 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_dummyaudio_h
+#define _SDL_dummyaudio_h
+
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_AudioDevice *this
+
+struct SDL_PrivateAudioData {
+ /* The file descriptor for the audio device */
+ Uint8 *mixbuf;
+ Uint32 mixlen;
+ Uint32 write_delay;
+ Uint32 initial_calls;
+};
+
+#endif /* _SDL_dummyaudio_h */
diff --git a/distrib/sdl-1.2.15/src/audio/esd/SDL_esdaudio.c b/distrib/sdl-1.2.15/src/audio/esd/SDL_esdaudio.c
new file mode 100644
index 0000000..f54b0ea
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/esd/SDL_esdaudio.c
@@ -0,0 +1,323 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Allow access to an ESD network stream mixing buffer */
+
+#include <sys/types.h>
+#include <unistd.h>
+#include <signal.h>
+#include <errno.h>
+#include <esd.h>
+
+#include "SDL_timer.h"
+#include "SDL_audio.h"
+#include "../SDL_audiomem.h"
+#include "../SDL_audio_c.h"
+#include "../SDL_audiodev_c.h"
+#include "SDL_esdaudio.h"
+
+#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC
+#include "SDL_name.h"
+#include "SDL_loadso.h"
+#else
+#define SDL_NAME(X) X
+#endif
+
+/* The tag name used by ESD audio */
+#define ESD_DRIVER_NAME "esd"
+
+/* Audio driver functions */
+static int ESD_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void ESD_WaitAudio(_THIS);
+static void ESD_PlayAudio(_THIS);
+static Uint8 *ESD_GetAudioBuf(_THIS);
+static void ESD_CloseAudio(_THIS);
+
+#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC
+
+static const char *esd_library = SDL_AUDIO_DRIVER_ESD_DYNAMIC;
+static void *esd_handle = NULL;
+static int esd_loaded = 0;
+
+static int (*SDL_NAME(esd_open_sound))( const char *host );
+static int (*SDL_NAME(esd_close))( int esd );
+static int (*SDL_NAME(esd_play_stream))( esd_format_t format, int rate,
+ const char *host, const char *name );
+static struct {
+ const char *name;
+ void **func;
+} esd_functions[] = {
+ { "esd_open_sound", (void **)&SDL_NAME(esd_open_sound) },
+ { "esd_close", (void **)&SDL_NAME(esd_close) },
+ { "esd_play_stream", (void **)&SDL_NAME(esd_play_stream) },
+};
+
+static void UnloadESDLibrary()
+{
+ if ( esd_loaded ) {
+ SDL_UnloadObject(esd_handle);
+ esd_handle = NULL;
+ esd_loaded = 0;
+ }
+}
+
+static int LoadESDLibrary(void)
+{
+ int i, retval = -1;
+
+ esd_handle = SDL_LoadObject(esd_library);
+ if ( esd_handle ) {
+ esd_loaded = 1;
+ retval = 0;
+ for ( i=0; i<SDL_arraysize(esd_functions); ++i ) {
+ *esd_functions[i].func = SDL_LoadFunction(esd_handle, esd_functions[i].name);
+ if ( !*esd_functions[i].func ) {
+ retval = -1;
+ UnloadESDLibrary();
+ break;
+ }
+ }
+ }
+ return retval;
+}
+
+#else
+
+static void UnloadESDLibrary()
+{
+ return;
+}
+
+static int LoadESDLibrary(void)
+{
+ return 0;
+}
+
+#endif /* SDL_AUDIO_DRIVER_ESD_DYNAMIC */
+
+/* Audio driver bootstrap functions */
+
+static int Audio_Available(void)
+{
+ int connection;
+ int available;
+
+ available = 0;
+ if ( LoadESDLibrary() < 0 ) {
+ return available;
+ }
+ connection = SDL_NAME(esd_open_sound)(NULL);
+ if ( connection >= 0 ) {
+ available = 1;
+ SDL_NAME(esd_close)(connection);
+ }
+ UnloadESDLibrary();
+ return(available);
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+ UnloadESDLibrary();
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ LoadESDLibrary();
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+ audio_fd = -1;
+
+ /* Set the function pointers */
+ this->OpenAudio = ESD_OpenAudio;
+ this->WaitAudio = ESD_WaitAudio;
+ this->PlayAudio = ESD_PlayAudio;
+ this->GetAudioBuf = ESD_GetAudioBuf;
+ this->CloseAudio = ESD_CloseAudio;
+
+ this->free = Audio_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap ESD_bootstrap = {
+ ESD_DRIVER_NAME, "Enlightened Sound Daemon",
+ Audio_Available, Audio_CreateDevice
+};
+
+/* This function waits until it is possible to write a full sound buffer */
+static void ESD_WaitAudio(_THIS)
+{
+ Sint32 ticks;
+
+ /* Check to see if the thread-parent process is still alive */
+ { static int cnt = 0;
+ /* Note that this only works with thread implementations
+ that use a different process id for each thread.
+ */
+ if (parent && (((++cnt)%10) == 0)) { /* Check every 10 loops */
+ if ( kill(parent, 0) < 0 ) {
+ this->enabled = 0;
+ }
+ }
+ }
+
+ /* Use timer for general audio synchronization */
+ ticks = ((Sint32)(next_frame - SDL_GetTicks()))-FUDGE_TICKS;
+ if ( ticks > 0 ) {
+ SDL_Delay(ticks);
+ }
+}
+
+static void ESD_PlayAudio(_THIS)
+{
+ int written;
+
+ /* Write the audio data, checking for EAGAIN on broken audio drivers */
+ do {
+ written = write(audio_fd, mixbuf, mixlen);
+ if ( (written < 0) && ((errno == 0) || (errno == EAGAIN)) ) {
+ SDL_Delay(1); /* Let a little CPU time go by */
+ }
+ } while ( (written < 0) &&
+ ((errno == 0) || (errno == EAGAIN) || (errno == EINTR)) );
+
+ /* Set the next write frame */
+ next_frame += frame_ticks;
+
+ /* If we couldn't write, assume fatal error for now */
+ if ( written < 0 ) {
+ this->enabled = 0;
+ }
+}
+
+static Uint8 *ESD_GetAudioBuf(_THIS)
+{
+ return(mixbuf);
+}
+
+static void ESD_CloseAudio(_THIS)
+{
+ if ( mixbuf != NULL ) {
+ SDL_FreeAudioMem(mixbuf);
+ mixbuf = NULL;
+ }
+ if ( audio_fd >= 0 ) {
+ SDL_NAME(esd_close)(audio_fd);
+ audio_fd = -1;
+ }
+}
+
+/* Try to get the name of the program */
+static char *get_progname(void)
+{
+ char *progname = NULL;
+#ifdef __LINUX__
+ FILE *fp;
+ static char temp[BUFSIZ];
+
+ SDL_snprintf(temp, SDL_arraysize(temp), "/proc/%d/cmdline", getpid());
+ fp = fopen(temp, "r");
+ if ( fp != NULL ) {
+ if ( fgets(temp, sizeof(temp)-1, fp) ) {
+ progname = SDL_strrchr(temp, '/');
+ if ( progname == NULL ) {
+ progname = temp;
+ } else {
+ progname = progname+1;
+ }
+ }
+ fclose(fp);
+ }
+#endif
+ return(progname);
+}
+
+static int ESD_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ esd_format_t format;
+
+ /* Convert audio spec to the ESD audio format */
+ format = (ESD_STREAM | ESD_PLAY);
+ switch ( spec->format & 0xFF ) {
+ case 8:
+ format |= ESD_BITS8;
+ break;
+ case 16:
+ format |= ESD_BITS16;
+ break;
+ default:
+ SDL_SetError("Unsupported ESD audio format");
+ return(-1);
+ }
+ if ( spec->channels == 1 ) {
+ format |= ESD_MONO;
+ } else {
+ format |= ESD_STEREO;
+ }
+#if 0
+ spec->samples = ESD_BUF_SIZE; /* Darn, no way to change this yet */
+#endif
+
+ /* Open a connection to the ESD audio server */
+ audio_fd = SDL_NAME(esd_play_stream)(format, spec->freq, NULL, get_progname());
+ if ( audio_fd < 0 ) {
+ SDL_SetError("Couldn't open ESD connection");
+ return(-1);
+ }
+
+ /* Calculate the final parameters for this audio specification */
+ SDL_CalculateAudioSpec(spec);
+ frame_ticks = (float)(spec->samples*1000)/spec->freq;
+ next_frame = SDL_GetTicks()+frame_ticks;
+
+ /* Allocate mixing buffer */
+ mixlen = spec->size;
+ mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen);
+ if ( mixbuf == NULL ) {
+ return(-1);
+ }
+ SDL_memset(mixbuf, spec->silence, spec->size);
+
+ /* Get the parent process id (we're the parent of the audio thread) */
+ parent = getpid();
+
+ /* We're ready to rock and roll. :-) */
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/src/audio/esd/SDL_esdaudio.h b/distrib/sdl-1.2.15/src/audio/esd/SDL_esdaudio.h
new file mode 100644
index 0000000..da4ae6a
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/esd/SDL_esdaudio.h
@@ -0,0 +1,57 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_esdaudio_h
+#define _SDL_esdaudio_h
+
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_AudioDevice *this
+
+struct SDL_PrivateAudioData {
+ /* The file descriptor for the audio device */
+ int audio_fd;
+
+ /* The parent process id, to detect when application quits */
+ pid_t parent;
+
+ /* Raw mixing buffer */
+ Uint8 *mixbuf;
+ int mixlen;
+
+ /* Support for audio timing using a timer */
+ float frame_ticks;
+ float next_frame;
+};
+#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */
+
+/* Old variable names */
+#define audio_fd (this->hidden->audio_fd)
+#define parent (this->hidden->parent)
+#define mixbuf (this->hidden->mixbuf)
+#define mixlen (this->hidden->mixlen)
+#define frame_ticks (this->hidden->frame_ticks)
+#define next_frame (this->hidden->next_frame)
+
+#endif /* _SDL_esdaudio_h */
diff --git a/distrib/sdl-1.2.15/src/audio/macosx/SDL_coreaudio.c b/distrib/sdl-1.2.15/src/audio/macosx/SDL_coreaudio.c
new file mode 100644
index 0000000..31316d1
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/macosx/SDL_coreaudio.c
@@ -0,0 +1,291 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <CoreAudio/CoreAudio.h>
+#include <CoreServices/CoreServices.h>
+#include <AudioUnit/AudioUnit.h>
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1050
+#include <AudioUnit/AUNTComponent.h>
+#endif
+
+#include "SDL_audio.h"
+#include "../SDL_audio_c.h"
+#include "../SDL_sysaudio.h"
+#include "SDL_coreaudio.h"
+
+
+/* Audio driver functions */
+
+static int Core_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void Core_WaitAudio(_THIS);
+static void Core_PlayAudio(_THIS);
+static Uint8 *Core_GetAudioBuf(_THIS);
+static void Core_CloseAudio(_THIS);
+
+/* Audio driver bootstrap functions */
+
+static int Audio_Available(void)
+{
+ return(1);
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+
+ /* Set the function pointers */
+ this->OpenAudio = Core_OpenAudio;
+ this->WaitAudio = Core_WaitAudio;
+ this->PlayAudio = Core_PlayAudio;
+ this->GetAudioBuf = Core_GetAudioBuf;
+ this->CloseAudio = Core_CloseAudio;
+
+ this->free = Audio_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap COREAUDIO_bootstrap = {
+ "coreaudio", "Mac OS X CoreAudio",
+ Audio_Available, Audio_CreateDevice
+};
+
+/* The CoreAudio callback */
+static OSStatus audioCallback (void *inRefCon,
+ AudioUnitRenderActionFlags *ioActionFlags,
+ const AudioTimeStamp *inTimeStamp,
+ UInt32 inBusNumber,
+ UInt32 inNumberFrames,
+ AudioBufferList *ioData)
+{
+ SDL_AudioDevice *this = (SDL_AudioDevice *)inRefCon;
+ UInt32 remaining, len;
+ AudioBuffer *abuf;
+ void *ptr;
+ UInt32 i;
+
+ /* Only do anything if audio is enabled and not paused */
+ if ( ! this->enabled || this->paused ) {
+ for (i = 0; i < ioData->mNumberBuffers; i++) {
+ abuf = &ioData->mBuffers[i];
+ SDL_memset(abuf->mData, this->spec.silence, abuf->mDataByteSize);
+ }
+ return 0;
+ }
+
+ /* No SDL conversion should be needed here, ever, since we accept
+ any input format in OpenAudio, and leave the conversion to CoreAudio.
+ */
+ /*
+ assert(!this->convert.needed);
+ assert(this->spec.channels == ioData->mNumberChannels);
+ */
+
+ for (i = 0; i < ioData->mNumberBuffers; i++) {
+ abuf = &ioData->mBuffers[i];
+ remaining = abuf->mDataByteSize;
+ ptr = abuf->mData;
+ while (remaining > 0) {
+ if (bufferOffset >= bufferSize) {
+ /* Generate the data */
+ SDL_memset(buffer, this->spec.silence, bufferSize);
+ SDL_mutexP(this->mixer_lock);
+ (*this->spec.callback)(this->spec.userdata,
+ buffer, bufferSize);
+ SDL_mutexV(this->mixer_lock);
+ bufferOffset = 0;
+ }
+
+ len = bufferSize - bufferOffset;
+ if (len > remaining)
+ len = remaining;
+ SDL_memcpy(ptr, (char *)buffer + bufferOffset, len);
+ ptr = (char *)ptr + len;
+ remaining -= len;
+ bufferOffset += len;
+ }
+ }
+
+ return 0;
+}
+
+/* Dummy functions -- we don't use thread-based audio */
+void Core_WaitAudio(_THIS)
+{
+ return;
+}
+
+void Core_PlayAudio(_THIS)
+{
+ return;
+}
+
+Uint8 *Core_GetAudioBuf(_THIS)
+{
+ return(NULL);
+}
+
+void Core_CloseAudio(_THIS)
+{
+ OSStatus result;
+ struct AURenderCallbackStruct callback;
+
+ /* stop processing the audio unit */
+ result = AudioOutputUnitStop (outputAudioUnit);
+ if (result != noErr) {
+ SDL_SetError("Core_CloseAudio: AudioOutputUnitStop");
+ return;
+ }
+
+ /* Remove the input callback */
+ callback.inputProc = 0;
+ callback.inputProcRefCon = 0;
+ result = AudioUnitSetProperty (outputAudioUnit,
+ kAudioUnitProperty_SetRenderCallback,
+ kAudioUnitScope_Input,
+ 0,
+ &callback,
+ sizeof(callback));
+ if (result != noErr) {
+ SDL_SetError("Core_CloseAudio: AudioUnitSetProperty (kAudioUnitProperty_SetInputCallback)");
+ return;
+ }
+
+ result = CloseComponent(outputAudioUnit);
+ if (result != noErr) {
+ SDL_SetError("Core_CloseAudio: CloseComponent");
+ return;
+ }
+
+ SDL_free(buffer);
+}
+
+#define CHECK_RESULT(msg) \
+ if (result != noErr) { \
+ SDL_SetError("Failed to start CoreAudio: " msg); \
+ return -1; \
+ }
+
+
+int Core_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ OSStatus result = noErr;
+ Component comp;
+ ComponentDescription desc;
+ struct AURenderCallbackStruct callback;
+ AudioStreamBasicDescription requestedDesc;
+
+ /* Setup a AudioStreamBasicDescription with the requested format */
+ requestedDesc.mFormatID = kAudioFormatLinearPCM;
+ requestedDesc.mFormatFlags = kLinearPCMFormatFlagIsPacked;
+ requestedDesc.mChannelsPerFrame = spec->channels;
+ requestedDesc.mSampleRate = spec->freq;
+
+ requestedDesc.mBitsPerChannel = spec->format & 0xFF;
+ if (spec->format & 0x8000)
+ requestedDesc.mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger;
+ if (spec->format & 0x1000)
+ requestedDesc.mFormatFlags |= kLinearPCMFormatFlagIsBigEndian;
+
+ requestedDesc.mFramesPerPacket = 1;
+ requestedDesc.mBytesPerFrame = requestedDesc.mBitsPerChannel * requestedDesc.mChannelsPerFrame / 8;
+ requestedDesc.mBytesPerPacket = requestedDesc.mBytesPerFrame * requestedDesc.mFramesPerPacket;
+
+
+ /* Locate the default output audio unit */
+ desc.componentType = kAudioUnitType_Output;
+ desc.componentSubType = kAudioUnitSubType_DefaultOutput;
+ desc.componentManufacturer = kAudioUnitManufacturer_Apple;
+ desc.componentFlags = 0;
+ desc.componentFlagsMask = 0;
+
+ comp = FindNextComponent (NULL, &desc);
+ if (comp == NULL) {
+ SDL_SetError ("Failed to start CoreAudio: FindNextComponent returned NULL");
+ return -1;
+ }
+
+ /* Open & initialize the default output audio unit */
+ result = OpenAComponent (comp, &outputAudioUnit);
+ CHECK_RESULT("OpenAComponent")
+
+ result = AudioUnitInitialize (outputAudioUnit);
+ CHECK_RESULT("AudioUnitInitialize")
+
+ /* Set the input format of the audio unit. */
+ result = AudioUnitSetProperty (outputAudioUnit,
+ kAudioUnitProperty_StreamFormat,
+ kAudioUnitScope_Input,
+ 0,
+ &requestedDesc,
+ sizeof (requestedDesc));
+ CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_StreamFormat)")
+
+ /* Set the audio callback */
+ callback.inputProc = audioCallback;
+ callback.inputProcRefCon = this;
+ result = AudioUnitSetProperty (outputAudioUnit,
+ kAudioUnitProperty_SetRenderCallback,
+ kAudioUnitScope_Input,
+ 0,
+ &callback,
+ sizeof(callback));
+ CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_SetInputCallback)")
+
+ /* Calculate the final parameters for this audio specification */
+ SDL_CalculateAudioSpec(spec);
+
+ /* Allocate a sample buffer */
+ bufferOffset = bufferSize = this->spec.size;
+ buffer = SDL_malloc(bufferSize);
+
+ /* Finally, start processing of the audio unit */
+ result = AudioOutputUnitStart (outputAudioUnit);
+ CHECK_RESULT("AudioOutputUnitStart")
+
+
+ /* We're running! */
+ return(1);
+}
diff --git a/distrib/sdl-1.2.15/src/audio/macosx/SDL_coreaudio.h b/distrib/sdl-1.2.15/src/audio/macosx/SDL_coreaudio.h
new file mode 100644
index 0000000..3f0e218
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/macosx/SDL_coreaudio.h
@@ -0,0 +1,46 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_coreaudio_h
+#define _SDL_coreaudio_h
+
+#include "../SDL_sysaudio.h"
+#include <AudioUnit/AUNTComponent.h>
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_AudioDevice *this
+
+struct SDL_PrivateAudioData {
+ AudioUnit outputAudioUnit;
+ void *buffer;
+ UInt32 bufferOffset;
+ UInt32 bufferSize;
+};
+
+/* Old variable names */
+#define outputAudioUnit (this->hidden->outputAudioUnit)
+#define buffer (this->hidden->buffer)
+#define bufferOffset (this->hidden->bufferOffset)
+#define bufferSize (this->hidden->bufferSize)
+
+#endif /* _SDL_coreaudio_h */
diff --git a/distrib/sdl-1.2.15/src/audio/macrom/SDL_romaudio.c b/distrib/sdl-1.2.15/src/audio/macrom/SDL_romaudio.c
new file mode 100644
index 0000000..1b3d49e
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/macrom/SDL_romaudio.c
@@ -0,0 +1,496 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#if defined(__APPLE__) && defined(__MACH__)
+# include <Carbon/Carbon.h>
+#elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335)
+# include <Carbon.h>
+#else
+# include <Sound.h> /* SoundManager interface */
+# include <Gestalt.h>
+# include <DriverServices.h>
+#endif
+
+#if !defined(NewSndCallBackUPP) && (UNIVERSAL_INTERFACES_VERSION < 0x0335)
+#if !defined(NewSndCallBackProc) /* avoid circular redefinition... */
+#define NewSndCallBackUPP NewSndCallBackProc
+#endif
+#if !defined(NewSndCallBackUPP)
+#define NewSndCallBackUPP NewSndCallBackProc
+#endif
+#endif
+
+#include "SDL_audio.h"
+#include "../SDL_audio_c.h"
+#include "../SDL_sysaudio.h"
+#include "SDL_romaudio.h"
+
+/* Audio driver functions */
+
+static void Mac_CloseAudio(_THIS);
+static int Mac_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void Mac_LockAudio(_THIS);
+static void Mac_UnlockAudio(_THIS);
+
+/* Audio driver bootstrap functions */
+
+
+static int Audio_Available(void)
+{
+ return(1);
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+
+ /* Set the function pointers */
+ this->OpenAudio = Mac_OpenAudio;
+ this->CloseAudio = Mac_CloseAudio;
+ this->LockAudio = Mac_LockAudio;
+ this->UnlockAudio = Mac_UnlockAudio;
+ this->free = Audio_DeleteDevice;
+
+#ifdef __MACOSX__ /* Mac OS X uses threaded audio, so normal thread code is okay */
+ this->LockAudio = NULL;
+ this->UnlockAudio = NULL;
+#endif
+ return this;
+}
+
+AudioBootStrap SNDMGR_bootstrap = {
+ "sndmgr", "MacOS SoundManager 3.0",
+ Audio_Available, Audio_CreateDevice
+};
+
+#if defined(TARGET_API_MAC_CARBON) || defined(USE_RYANS_SOUNDCODE)
+/* This works correctly on Mac OS X */
+
+#pragma options align=power
+
+static volatile SInt32 audio_is_locked = 0;
+static volatile SInt32 need_to_mix = 0;
+
+static UInt8 *buffer[2];
+static volatile UInt32 running = 0;
+static CmpSoundHeader header;
+static volatile Uint32 fill_me = 0;
+
+static void mix_buffer(SDL_AudioDevice *audio, UInt8 *buffer)
+{
+ if ( ! audio->paused ) {
+#ifdef __MACOSX__
+ SDL_mutexP(audio->mixer_lock);
+#endif
+ if ( audio->convert.needed ) {
+ audio->spec.callback(audio->spec.userdata,
+ (Uint8 *)audio->convert.buf,audio->convert.len);
+ SDL_ConvertAudio(&audio->convert);
+ if ( audio->convert.len_cvt != audio->spec.size ) {
+ /* Uh oh... probably crashes here */;
+ }
+ SDL_memcpy(buffer, audio->convert.buf, audio->convert.len_cvt);
+ } else {
+ audio->spec.callback(audio->spec.userdata, buffer, audio->spec.size);
+ }
+#ifdef __MACOSX__
+ SDL_mutexV(audio->mixer_lock);
+#endif
+ }
+
+ DecrementAtomic((SInt32 *) &need_to_mix);
+}
+
+static void Mac_LockAudio(_THIS)
+{
+ IncrementAtomic((SInt32 *) &audio_is_locked);
+}
+
+static void Mac_UnlockAudio(_THIS)
+{
+ SInt32 oldval;
+
+ oldval = DecrementAtomic((SInt32 *) &audio_is_locked);
+ if ( oldval != 1 ) /* != 1 means audio is still locked. */
+ return;
+
+ /* Did we miss the chance to mix in an interrupt? Do it now. */
+ if ( BitAndAtomic (0xFFFFFFFF, (UInt32 *) &need_to_mix) ) {
+ /*
+ * Note that this could be a problem if you missed an interrupt
+ * while the audio was locked, and get preempted by a second
+ * interrupt here, but that means you locked for way too long anyhow.
+ */
+ mix_buffer (this, buffer[fill_me]);
+ }
+}
+
+static void callBackProc (SndChannel *chan, SndCommand *cmd_passed ) {
+ UInt32 play_me;
+ SndCommand cmd;
+ SDL_AudioDevice *audio = (SDL_AudioDevice *)chan->userInfo;
+
+ IncrementAtomic((SInt32 *) &need_to_mix);
+
+ fill_me = cmd_passed->param2; /* buffer that has just finished playing, so fill it */
+ play_me = ! fill_me; /* filled buffer to play _now_ */
+
+ if ( ! audio->enabled ) {
+ return;
+ }
+
+ /* queue previously mixed buffer for playback. */
+ header.samplePtr = (Ptr)buffer[play_me];
+ cmd.cmd = bufferCmd;
+ cmd.param1 = 0;
+ cmd.param2 = (long)&header;
+ SndDoCommand (chan, &cmd, 0);
+
+ memset (buffer[fill_me], 0, audio->spec.size);
+
+ /*
+ * if audio device isn't locked, mix the next buffer to be queued in
+ * the memory block that just finished playing.
+ */
+ if ( ! BitAndAtomic(0xFFFFFFFF, (UInt32 *) &audio_is_locked) ) {
+ mix_buffer (audio, buffer[fill_me]);
+ }
+
+ /* set this callback to run again when current buffer drains. */
+ if ( running ) {
+ cmd.cmd = callBackCmd;
+ cmd.param1 = 0;
+ cmd.param2 = play_me;
+
+ SndDoCommand (chan, &cmd, 0);
+ }
+}
+
+static int Mac_OpenAudio(_THIS, SDL_AudioSpec *spec) {
+
+ SndCallBackUPP callback;
+ int sample_bits;
+ int i;
+ long initOptions;
+
+ /* Very few conversions are required, but... */
+ switch (spec->format) {
+ case AUDIO_S8:
+ spec->format = AUDIO_U8;
+ break;
+ case AUDIO_U16LSB:
+ spec->format = AUDIO_S16LSB;
+ break;
+ case AUDIO_U16MSB:
+ spec->format = AUDIO_S16MSB;
+ break;
+ }
+ SDL_CalculateAudioSpec(spec);
+
+ /* initialize bufferCmd header */
+ memset (&header, 0, sizeof(header));
+ callback = (SndCallBackUPP) NewSndCallBackUPP (callBackProc);
+ sample_bits = spec->size / spec->samples / spec->channels * 8;
+
+#ifdef DEBUG_AUDIO
+ fprintf(stderr,
+ "Audio format 0x%x, channels = %d, sample_bits = %d, frequency = %d\n",
+ spec->format, spec->channels, sample_bits, spec->freq);
+#endif /* DEBUG_AUDIO */
+
+ header.numChannels = spec->channels;
+ header.sampleSize = sample_bits;
+ header.sampleRate = spec->freq << 16;
+ header.numFrames = spec->samples;
+ header.encode = cmpSH;
+
+ /* Note that we install the 16bitLittleEndian Converter if needed. */
+ if ( spec->format == 0x8010 ) {
+ header.compressionID = fixedCompression;
+ header.format = k16BitLittleEndianFormat;
+ }
+
+ /* allocate 2 buffers */
+ for (i=0; i<2; i++) {
+ buffer[i] = (UInt8*)malloc (sizeof(UInt8) * spec->size);
+ if (buffer[i] == NULL) {
+ SDL_OutOfMemory();
+ return (-1);
+ }
+ memset (buffer[i], 0, spec->size);
+ }
+
+ /* Create the sound manager channel */
+ channel = (SndChannelPtr)SDL_malloc(sizeof(*channel));
+ if ( channel == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ if ( spec->channels >= 2 ) {
+ initOptions = initStereo;
+ } else {
+ initOptions = initMono;
+ }
+ channel->userInfo = (long)this;
+ channel->qLength = 128;
+ if ( SndNewChannel(&channel, sampledSynth, initOptions, callback) != noErr ) {
+ SDL_SetError("Unable to create audio channel");
+ SDL_free(channel);
+ channel = NULL;
+ return(-1);
+ }
+
+ /* start playback */
+ {
+ SndCommand cmd;
+ cmd.cmd = callBackCmd;
+ cmd.param2 = 0;
+ running = 1;
+ SndDoCommand (channel, &cmd, 0);
+ }
+
+ return 1;
+}
+
+static void Mac_CloseAudio(_THIS) {
+
+ int i;
+
+ running = 0;
+
+ if (channel) {
+ SndDisposeChannel (channel, true);
+ channel = NULL;
+ }
+
+ for ( i=0; i<2; ++i ) {
+ if ( buffer[i] ) {
+ SDL_free(buffer[i]);
+ buffer[i] = NULL;
+ }
+ }
+}
+
+#else /* !TARGET_API_MAC_CARBON && !USE_RYANS_SOUNDCODE */
+
+static void Mac_LockAudio(_THIS)
+{
+ /* no-op. */
+}
+
+static void Mac_UnlockAudio(_THIS)
+{
+ /* no-op. */
+}
+
+
+/* This function is called by Sound Manager when it has exhausted one of
+ the buffers, so we'll zero it to silence and fill it with audio if
+ we're not paused.
+*/
+static pascal
+void sndDoubleBackProc (SndChannelPtr chan, SndDoubleBufferPtr newbuf)
+{
+ SDL_AudioDevice *audio = (SDL_AudioDevice *)newbuf->dbUserInfo[0];
+
+ /* If audio is quitting, don't do anything */
+ if ( ! audio->enabled ) {
+ return;
+ }
+ memset (newbuf->dbSoundData, 0, audio->spec.size);
+ newbuf->dbNumFrames = audio->spec.samples;
+ if ( ! audio->paused ) {
+ if ( audio->convert.needed ) {
+ audio->spec.callback(audio->spec.userdata,
+ (Uint8 *)audio->convert.buf,audio->convert.len);
+ SDL_ConvertAudio(&audio->convert);
+#if 0
+ if ( audio->convert.len_cvt != audio->spec.size ) {
+ /* Uh oh... probably crashes here */;
+ }
+#endif
+ SDL_memcpy(newbuf->dbSoundData, audio->convert.buf,
+ audio->convert.len_cvt);
+ } else {
+ audio->spec.callback(audio->spec.userdata,
+ (Uint8 *)newbuf->dbSoundData, audio->spec.size);
+ }
+ }
+ newbuf->dbFlags |= dbBufferReady;
+}
+
+static int DoubleBufferAudio_Available(void)
+{
+ int available;
+ NumVersion sndversion;
+ long response;
+
+ available = 0;
+ sndversion = SndSoundManagerVersion();
+ if ( sndversion.majorRev >= 3 ) {
+ if ( Gestalt(gestaltSoundAttr, &response) == noErr ) {
+ if ( (response & (1 << gestaltSndPlayDoubleBuffer)) ) {
+ available = 1;
+ }
+ }
+ } else {
+ if ( Gestalt(gestaltSoundAttr, &response) == noErr ) {
+ if ( (response & (1 << gestaltHasASC)) ) {
+ available = 1;
+ }
+ }
+ }
+ return(available);
+}
+
+static void Mac_CloseAudio(_THIS)
+{
+ int i;
+
+ if ( channel != NULL ) {
+ /* Clean up the audio channel */
+ SndDisposeChannel(channel, true);
+ channel = NULL;
+ }
+ for ( i=0; i<2; ++i ) {
+ if ( audio_buf[i] ) {
+ SDL_free(audio_buf[i]);
+ audio_buf[i] = NULL;
+ }
+ }
+}
+
+static int Mac_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ SndDoubleBufferHeader2 audio_dbh;
+ int i;
+ long initOptions;
+ int sample_bits;
+ SndDoubleBackUPP doubleBackProc;
+
+ /* Check to make sure double-buffered audio is available */
+ if ( ! DoubleBufferAudio_Available() ) {
+ SDL_SetError("Sound manager doesn't support double-buffering");
+ return(-1);
+ }
+
+ /* Very few conversions are required, but... */
+ switch (spec->format) {
+ case AUDIO_S8:
+ spec->format = AUDIO_U8;
+ break;
+ case AUDIO_U16LSB:
+ spec->format = AUDIO_S16LSB;
+ break;
+ case AUDIO_U16MSB:
+ spec->format = AUDIO_S16MSB;
+ break;
+ }
+ SDL_CalculateAudioSpec(spec);
+
+ /* initialize the double-back header */
+ SDL_memset(&audio_dbh, 0, sizeof(audio_dbh));
+ doubleBackProc = NewSndDoubleBackProc (sndDoubleBackProc);
+ sample_bits = spec->size / spec->samples / spec->channels * 8;
+
+ audio_dbh.dbhNumChannels = spec->channels;
+ audio_dbh.dbhSampleSize = sample_bits;
+ audio_dbh.dbhCompressionID = 0;
+ audio_dbh.dbhPacketSize = 0;
+ audio_dbh.dbhSampleRate = spec->freq << 16;
+ audio_dbh.dbhDoubleBack = doubleBackProc;
+ audio_dbh.dbhFormat = 0;
+
+ /* Note that we install the 16bitLittleEndian Converter if needed. */
+ if ( spec->format == 0x8010 ) {
+ audio_dbh.dbhCompressionID = fixedCompression;
+ audio_dbh.dbhFormat = k16BitLittleEndianFormat;
+ }
+
+ /* allocate the 2 double-back buffers */
+ for ( i=0; i<2; ++i ) {
+ audio_buf[i] = SDL_calloc(1, sizeof(SndDoubleBuffer)+spec->size);
+ if ( audio_buf[i] == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ audio_buf[i]->dbNumFrames = spec->samples;
+ audio_buf[i]->dbFlags = dbBufferReady;
+ audio_buf[i]->dbUserInfo[0] = (long)this;
+ audio_dbh.dbhBufferPtr[i] = audio_buf[i];
+ }
+
+ /* Create the sound manager channel */
+ channel = (SndChannelPtr)SDL_malloc(sizeof(*channel));
+ if ( channel == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ if ( spec->channels >= 2 ) {
+ initOptions = initStereo;
+ } else {
+ initOptions = initMono;
+ }
+ channel->userInfo = 0;
+ channel->qLength = 128;
+ if ( SndNewChannel(&channel, sampledSynth, initOptions, 0L) != noErr ) {
+ SDL_SetError("Unable to create audio channel");
+ SDL_free(channel);
+ channel = NULL;
+ return(-1);
+ }
+
+ /* Start playback */
+ if ( SndPlayDoubleBuffer(channel, (SndDoubleBufferHeaderPtr)&audio_dbh)
+ != noErr ) {
+ SDL_SetError("Unable to play double buffered audio");
+ return(-1);
+ }
+
+ return 1;
+}
+
+#endif /* TARGET_API_MAC_CARBON || USE_RYANS_SOUNDCODE */
+
diff --git a/distrib/sdl-1.2.15/src/audio/macrom/SDL_romaudio.h b/distrib/sdl-1.2.15/src/audio/macrom/SDL_romaudio.h
new file mode 100644
index 0000000..90e19c0
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/macrom/SDL_romaudio.h
@@ -0,0 +1,50 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_romaudio_h
+#define _SDL_romaudio_h
+
+#include "../SDL_sysaudio.h"
+
+/* This is Ryan's improved MacOS sound code, with locking support */
+#define USE_RYANS_SOUNDCODE
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_AudioDevice *this
+
+struct SDL_PrivateAudioData {
+ /* Sound manager audio channel */
+ SndChannelPtr channel;
+#if defined(TARGET_API_MAC_CARBON) || defined(USE_RYANS_SOUNDCODE)
+ /* FIXME: Add Ryan's static data here */
+#else
+ /* Double buffering variables */
+ SndDoubleBufferPtr audio_buf[2];
+#endif
+};
+
+/* Old variable names */
+#define channel (this->hidden->channel)
+#define audio_buf (this->hidden->audio_buf)
+
+#endif /* _SDL_romaudio_h */
diff --git a/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio.c b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio.c
new file mode 100644
index 0000000..46ba690
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio.c
@@ -0,0 +1,215 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ Audio interrupt variables and callback function
+
+ Patrice Mandin
+*/
+
+#include <unistd.h>
+
+#include <mint/osbind.h>
+#include <mint/falcon.h>
+#include <mint/mintbind.h>
+#include <mint/cookie.h>
+
+#include "SDL_audio.h"
+#include "SDL_mintaudio.h"
+#include "SDL_mintaudio_stfa.h"
+
+/* The audio device */
+
+SDL_AudioDevice *SDL_MintAudio_device;
+Uint8 *SDL_MintAudio_audiobuf[2]; /* Pointers to buffers */
+unsigned long SDL_MintAudio_audiosize; /* Length of audio buffer=spec->size */
+volatile unsigned short SDL_MintAudio_numbuf; /* Buffer to play */
+volatile unsigned short SDL_MintAudio_mutex;
+volatile unsigned long SDL_MintAudio_clocktics;
+cookie_stfa_t *SDL_MintAudio_stfa;
+unsigned short SDL_MintAudio_hasfpu;
+
+/* MiNT thread variables */
+SDL_bool SDL_MintAudio_mint_present;
+SDL_bool SDL_MintAudio_quit_thread;
+SDL_bool SDL_MintAudio_thread_finished;
+long SDL_MintAudio_thread_pid;
+
+/* The callback function, called by each driver whenever needed */
+
+void SDL_MintAudio_Callback(void)
+{
+ Uint8 *buffer;
+ SDL_AudioDevice *audio = SDL_MintAudio_device;
+
+ buffer = SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf];
+ SDL_memset(buffer, audio->spec.silence, audio->spec.size);
+
+ if (audio->paused)
+ return;
+
+ if (audio->convert.needed) {
+ int silence;
+
+ if ( audio->convert.src_format == AUDIO_U8 ) {
+ silence = 0x80;
+ } else {
+ silence = 0;
+ }
+ SDL_memset(audio->convert.buf, silence, audio->convert.len);
+ audio->spec.callback(audio->spec.userdata,
+ (Uint8 *)audio->convert.buf,audio->convert.len);
+ SDL_ConvertAudio(&audio->convert);
+ SDL_memcpy(buffer, audio->convert.buf, audio->convert.len_cvt);
+ } else {
+ audio->spec.callback(audio->spec.userdata, buffer, audio->spec.size);
+ }
+}
+
+/* Add a new frequency/clock/predivisor to the current list */
+void SDL_MintAudio_AddFrequency(_THIS, Uint32 frequency, Uint32 clock,
+ Uint32 prediv, int gpio_bits)
+{
+ int i, p;
+
+ if (MINTAUDIO_freqcount==MINTAUDIO_maxfreqs) {
+ return;
+ }
+
+ /* Search where to insert the frequency (highest first) */
+ for (p=0; p<MINTAUDIO_freqcount; p++) {
+ if (frequency > MINTAUDIO_frequencies[p].frequency) {
+ break;
+ }
+ }
+
+ /* Put all following ones farer */
+ if (MINTAUDIO_freqcount>0) {
+ for (i=MINTAUDIO_freqcount; i>p; i--) {
+ SDL_memcpy(&MINTAUDIO_frequencies[i], &MINTAUDIO_frequencies[i-1], sizeof(mint_frequency_t));
+ }
+ }
+
+ /* And insert new one */
+ MINTAUDIO_frequencies[p].frequency = frequency;
+ MINTAUDIO_frequencies[p].masterclock = clock;
+ MINTAUDIO_frequencies[p].predivisor = prediv;
+ MINTAUDIO_frequencies[p].gpio_bits = gpio_bits;
+
+ MINTAUDIO_freqcount++;
+}
+
+/* Search for the nearest frequency */
+int SDL_MintAudio_SearchFrequency(_THIS, int desired_freq)
+{
+ int i;
+
+ /* Only 1 freq ? */
+ if (MINTAUDIO_freqcount==1) {
+ return 0;
+ }
+
+ /* Check the array */
+ for (i=0; i<MINTAUDIO_freqcount; i++) {
+ if (desired_freq >= ((MINTAUDIO_frequencies[i].frequency+
+ MINTAUDIO_frequencies[i+1].frequency)>>1)) {
+ return i;
+ }
+ }
+
+ /* Not in the array, give the latest */
+ return MINTAUDIO_freqcount-1;
+}
+
+/* Check if FPU is present */
+void SDL_MintAudio_CheckFpu(void)
+{
+ long cookie_fpu;
+
+ SDL_MintAudio_hasfpu = 0;
+ if (Getcookie(C__FPU, &cookie_fpu) != C_FOUND) {
+ return;
+ }
+ switch ((cookie_fpu>>16)&0xfffe) {
+ case 2:
+ case 4:
+ case 6:
+ case 8:
+ case 16:
+ SDL_MintAudio_hasfpu = 1;
+ break;
+ }
+}
+
+/* The thread function, used under MiNT with xbios */
+int SDL_MintAudio_Thread(long param)
+{
+ SndBufPtr pointers;
+ SDL_bool buffers_filled[2] = {SDL_FALSE, SDL_FALSE};
+
+ SDL_MintAudio_thread_finished = SDL_FALSE;
+ while (!SDL_MintAudio_quit_thread) {
+ if (Buffptr(&pointers)!=0)
+ continue;
+
+ if (( (unsigned long)pointers.play>=(unsigned long)SDL_MintAudio_audiobuf[0])
+ && ( (unsigned long)pointers.play<=(unsigned long)SDL_MintAudio_audiobuf[1]))
+ {
+ /* DMA is reading buffer #0, setup buffer #1 if not already done */
+ if (!buffers_filled[1]) {
+ SDL_MintAudio_numbuf = 1;
+ SDL_MintAudio_Callback();
+ Setbuffer(0, SDL_MintAudio_audiobuf[1], SDL_MintAudio_audiobuf[1] + SDL_MintAudio_audiosize);
+ buffers_filled[1]=SDL_TRUE;
+ buffers_filled[0]=SDL_FALSE;
+ }
+ } else {
+ /* DMA is reading buffer #1, setup buffer #0 if not already done */
+ if (!buffers_filled[0]) {
+ SDL_MintAudio_numbuf = 0;
+ SDL_MintAudio_Callback();
+ Setbuffer(0, SDL_MintAudio_audiobuf[0], SDL_MintAudio_audiobuf[0] + SDL_MintAudio_audiosize);
+ buffers_filled[0]=SDL_TRUE;
+ buffers_filled[1]=SDL_FALSE;
+ }
+ }
+
+ usleep(100);
+ }
+ SDL_MintAudio_thread_finished = SDL_TRUE;
+ return 0;
+}
+
+void SDL_MintAudio_WaitThread(void)
+{
+ if (!SDL_MintAudio_mint_present)
+ return;
+
+ if (SDL_MintAudio_thread_finished)
+ return;
+
+ SDL_MintAudio_quit_thread = SDL_TRUE;
+ while (!SDL_MintAudio_thread_finished) {
+ Syield();
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio.h b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio.h
new file mode 100644
index 0000000..ba6056e
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio.h
@@ -0,0 +1,121 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ MiNT audio driver
+
+ Patrice Mandin
+*/
+
+#ifndef _SDL_mintaudio_h
+#define _SDL_mintaudio_h
+
+#include "../SDL_sysaudio.h"
+#include "SDL_mintaudio_stfa.h"
+
+/* Hidden "this" pointer for the audio functions */
+#define _THIS SDL_AudioDevice *this
+
+/* 16 predivisors with 3 clocks max. */
+#define MINTAUDIO_maxfreqs (16*3)
+
+typedef struct {
+ Uint32 frequency;
+ Uint32 masterclock;
+ Uint32 predivisor;
+ int gpio_bits; /* in case of external clock */
+} mint_frequency_t;
+
+struct SDL_PrivateAudioData {
+ mint_frequency_t frequencies[MINTAUDIO_maxfreqs];
+ int freq_count; /* Number of frequencies in the array */
+ int numfreq; /* Number of selected frequency */
+};
+
+/* Old variable names */
+
+#define MINTAUDIO_frequencies (this->hidden->frequencies)
+#define MINTAUDIO_freqcount (this->hidden->freq_count)
+#define MINTAUDIO_numfreq (this->hidden->numfreq)
+
+/* _MCH cookie (values>>16) */
+enum {
+ MCH_ST=0,
+ MCH_STE,
+ MCH_TT,
+ MCH_F30,
+ MCH_CLONE,
+ MCH_ARANYM
+};
+
+/* Master clocks for replay frequencies */
+#define MASTERCLOCK_STE 8010666 /* Not sure of this one */
+#define MASTERCLOCK_TT 16107953 /* Not sure of this one */
+#define MASTERCLOCK_FALCON1 25175000
+#define MASTERCLOCK_FALCON2 32000000 /* Only usable for DSP56K */
+#define MASTERCLOCK_FALCONEXT -1 /* Clock on DSP56K port, unknown */
+#define MASTERCLOCK_44K 22579200 /* Standard clock for 44.1 Khz */
+#define MASTERCLOCK_48K 24576000 /* Standard clock for 48 Khz */
+
+/* Master clock predivisors */
+#define MASTERPREDIV_STE 160
+#define MASTERPREDIV_TT 320
+#define MASTERPREDIV_FALCON 256
+#define MASTERPREDIV_MILAN 256
+
+/* Variables */
+extern SDL_AudioDevice *SDL_MintAudio_device;
+extern Uint8 *SDL_MintAudio_audiobuf[2]; /* Pointers to buffers */
+extern unsigned long SDL_MintAudio_audiosize; /* Length of audio buffer=spec->size */
+extern volatile unsigned short SDL_MintAudio_numbuf; /* Buffer to play */
+extern volatile unsigned short SDL_MintAudio_mutex;
+extern cookie_stfa_t *SDL_MintAudio_stfa;
+extern volatile unsigned long SDL_MintAudio_clocktics;
+extern unsigned short SDL_MintAudio_hasfpu; /* To preserve fpu registers if needed */
+
+/* MiNT thread variables */
+extern SDL_bool SDL_MintAudio_mint_present;
+extern SDL_bool SDL_MintAudio_quit_thread;
+extern SDL_bool SDL_MintAudio_thread_finished;
+extern long SDL_MintAudio_thread_pid;
+
+/* Functions */
+void SDL_MintAudio_Callback(void);
+void SDL_MintAudio_AddFrequency(_THIS, Uint32 frequency, Uint32 clock,
+ Uint32 prediv, int gpio_bits);
+int SDL_MintAudio_SearchFrequency(_THIS, int desired_freq);
+void SDL_MintAudio_CheckFpu(void);
+
+/* MiNT thread functions */
+int SDL_MintAudio_Thread(long param);
+void SDL_MintAudio_WaitThread(void);
+
+/* ASM interrupt functions */
+void SDL_MintAudio_GsxbInterrupt(void);
+void SDL_MintAudio_EmptyGsxbInterrupt(void);
+void SDL_MintAudio_XbiosInterruptMeasureClock(void);
+void SDL_MintAudio_XbiosInterrupt(void);
+void SDL_MintAudio_Dma8Interrupt(void);
+void SDL_MintAudio_StfaInterrupt(void);
+
+#endif /* _SDL_mintaudio_h */
diff --git a/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_dma8.c b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_dma8.c
new file mode 100644
index 0000000..61feba3
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_dma8.c
@@ -0,0 +1,357 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ MiNT audio driver
+ using DMA 8bits (hardware access)
+
+ Patrice Mandin
+*/
+
+/* Mint includes */
+#include <mint/osbind.h>
+#include <mint/falcon.h>
+#include <mint/cookie.h>
+
+#include "SDL_audio.h"
+#include "../SDL_audio_c.h"
+#include "../SDL_sysaudio.h"
+
+#include "../../video/ataricommon/SDL_atarimxalloc_c.h"
+
+#include "SDL_mintaudio.h"
+#include "SDL_mintaudio_dma8.h"
+
+/*--- Defines ---*/
+
+#define MINT_AUDIO_DRIVER_NAME "mint_dma8"
+
+/* Debug print info */
+#define DEBUG_NAME "audio:dma8: "
+#if 0
+#define DEBUG_PRINT(what) \
+ { \
+ printf what; \
+ }
+#else
+#define DEBUG_PRINT(what)
+#endif
+
+/*--- Static variables ---*/
+
+static long cookie_snd, cookie_mch;
+
+/*--- Audio driver functions ---*/
+
+static void Mint_CloseAudio(_THIS);
+static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void Mint_LockAudio(_THIS);
+static void Mint_UnlockAudio(_THIS);
+
+/* To check/init hardware audio */
+static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec);
+
+/* Functions called in supervisor mode */
+static void Mint_InitDma(void);
+static void Mint_StopReplay(void);
+static void Mint_StartReplay(void);
+
+/*--- Audio driver bootstrap functions ---*/
+
+static int Audio_Available(void)
+{
+ const char *envr = SDL_getenv("SDL_AUDIODRIVER");
+
+ /* Check if user asked a different audio driver */
+ if ((envr) && (SDL_strcmp(envr, MINT_AUDIO_DRIVER_NAME)!=0)) {
+ DEBUG_PRINT((DEBUG_NAME "user asked a different audio driver\n"));
+ return 0;
+ }
+
+ /* Cookie _MCH present ? if not, assume ST machine */
+ if (Getcookie(C__MCH, &cookie_mch) == C_NOTFOUND) {
+ cookie_mch = MCH_ST;
+ }
+
+ /* Cookie _SND present ? if not, assume ST machine */
+ if (Getcookie(C__SND, &cookie_snd) == C_NOTFOUND) {
+ cookie_snd = SND_PSG;
+ }
+
+ /* Check if we have 8 bits audio */
+ if ((cookie_snd & SND_8BIT)==0) {
+ DEBUG_PRINT((DEBUG_NAME "no 8 bits sound\n"));
+ return(0);
+ }
+
+ /* Check if audio is lockable */
+ if (cookie_snd & SND_16BIT) {
+ if (Locksnd()!=1) {
+ DEBUG_PRINT((DEBUG_NAME "audio locked by other application\n"));
+ return(0);
+ }
+
+ Unlocksnd();
+ }
+
+ DEBUG_PRINT((DEBUG_NAME "8 bits audio available!\n"));
+ return(1);
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+
+ /* Set the function pointers */
+ this->OpenAudio = Mint_OpenAudio;
+ this->CloseAudio = Mint_CloseAudio;
+ this->LockAudio = Mint_LockAudio;
+ this->UnlockAudio = Mint_UnlockAudio;
+ this->free = Audio_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap MINTAUDIO_DMA8_bootstrap = {
+ MINT_AUDIO_DRIVER_NAME, "MiNT DMA 8 bits audio driver",
+ Audio_Available, Audio_CreateDevice
+};
+
+static void Mint_LockAudio(_THIS)
+{
+ Supexec(Mint_StopReplay);
+}
+
+static void Mint_UnlockAudio(_THIS)
+{
+ Supexec(Mint_StartReplay);
+}
+
+static void Mint_CloseAudio(_THIS)
+{
+ Supexec(Mint_StopReplay);
+
+ DEBUG_PRINT((DEBUG_NAME "closeaudio: replay stopped\n"));
+
+ /* Disable interrupt */
+ Jdisint(MFP_DMASOUND);
+
+ DEBUG_PRINT((DEBUG_NAME "closeaudio: interrupt disabled\n"));
+
+ /* Wait if currently playing sound */
+ while (SDL_MintAudio_mutex != 0) {
+ }
+
+ DEBUG_PRINT((DEBUG_NAME "closeaudio: no more interrupt running\n"));
+
+ /* Clear buffers */
+ if (SDL_MintAudio_audiobuf[0]) {
+ Mfree(SDL_MintAudio_audiobuf[0]);
+ SDL_MintAudio_audiobuf[0] = SDL_MintAudio_audiobuf[1] = NULL;
+ }
+
+ DEBUG_PRINT((DEBUG_NAME "closeaudio: buffers freed\n"));
+}
+
+static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
+{
+ int i, masterprediv, sfreq;
+ unsigned long masterclock;
+
+ DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff));
+ DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
+ DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
+ DEBUG_PRINT(("channels=%d, ", spec->channels));
+ DEBUG_PRINT(("freq=%d\n", spec->freq));
+
+ if (spec->channels > 2)
+ spec->channels = 2;
+
+ /* Check formats available */
+ spec->format = AUDIO_S8;
+
+ /* Calculate and select the closest frequency */
+ sfreq=0;
+ masterclock=MASTERCLOCK_STE;
+ masterprediv=MASTERPREDIV_STE;
+ switch(cookie_mch>>16) {
+/*
+ case MCH_STE:
+ masterclock=MASTERCLOCK_STE;
+ masterprediv=MASTERPREDIV_STE;
+ break;
+*/
+ case MCH_TT:
+ masterclock=MASTERCLOCK_TT;
+ masterprediv=MASTERPREDIV_TT;
+ break;
+ case MCH_F30:
+ case MCH_ARANYM:
+ masterclock=MASTERCLOCK_FALCON1;
+ masterprediv=MASTERPREDIV_FALCON;
+ sfreq=1;
+ break;
+ }
+
+ MINTAUDIO_freqcount=0;
+ for (i=sfreq;i<4;i++) {
+ SDL_MintAudio_AddFrequency(this, masterclock/(masterprediv*(1<<i)),
+ masterclock, i-sfreq, -1);
+ }
+
+#if 1
+ for (i=0; i<MINTAUDIO_freqcount; i++) {
+ DEBUG_PRINT((DEBUG_NAME "freq %d: %lu Hz, clock %lu, prediv %d\n",
+ i, MINTAUDIO_frequencies[i].frequency, MINTAUDIO_frequencies[i].masterclock,
+ MINTAUDIO_frequencies[i].predivisor
+ ));
+ }
+#endif
+
+ MINTAUDIO_numfreq=SDL_MintAudio_SearchFrequency(this, spec->freq);
+ spec->freq=MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
+
+ DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff));
+ DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
+ DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
+ DEBUG_PRINT(("channels=%d, ", spec->channels));
+ DEBUG_PRINT(("freq=%d\n", spec->freq));
+
+ return 0;
+}
+
+static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ SDL_MintAudio_device = this;
+
+ /* Check audio capabilities */
+ if (Mint_CheckAudio(this, spec)==-1) {
+ return -1;
+ }
+
+ SDL_CalculateAudioSpec(spec);
+
+ /* Allocate memory for audio buffers in DMA-able RAM */
+ DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size));
+
+ SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM);
+ if (SDL_MintAudio_audiobuf[0]==NULL) {
+ SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer");
+ return (-1);
+ }
+ SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + spec->size ;
+ SDL_MintAudio_numbuf=0;
+ SDL_memset(SDL_MintAudio_audiobuf[0], spec->silence, spec->size *2);
+ SDL_MintAudio_audiosize = spec->size;
+ SDL_MintAudio_mutex = 0;
+
+ DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n", SDL_MintAudio_audiobuf[0]));
+ DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n", SDL_MintAudio_audiobuf[1]));
+
+ SDL_MintAudio_CheckFpu();
+
+ /* Set replay tracks */
+ if (cookie_snd & SND_16BIT) {
+ Settracks(0,0);
+ Setmontracks(0);
+ }
+
+ Supexec(Mint_InitDma);
+
+ /* Set interrupt */
+ Jdisint(MFP_DMASOUND);
+ Xbtimer(XB_TIMERA, 8, 1, SDL_MintAudio_Dma8Interrupt);
+ Jenabint(MFP_DMASOUND);
+
+ if (cookie_snd & SND_16BIT) {
+ if (Setinterrupt(SI_TIMERA, SI_PLAY)<0) {
+ DEBUG_PRINT((DEBUG_NAME "Setinterrupt() failed\n"));
+ }
+ }
+
+ Supexec(Mint_StartReplay);
+
+ return(1); /* We don't use threaded audio */
+}
+
+/* Functions called in supervisor mode */
+
+static void Mint_InitDma(void)
+{
+ unsigned long buffer;
+ unsigned char mode;
+ SDL_AudioDevice *this = SDL_MintAudio_device;
+
+ Mint_StopReplay();
+
+ /* Set buffer */
+ buffer = (unsigned long) SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf];
+ DMAAUDIO_IO.start_high = (buffer>>16) & 255;
+ DMAAUDIO_IO.start_mid = (buffer>>8) & 255;
+ DMAAUDIO_IO.start_low = buffer & 255;
+
+ buffer += SDL_MintAudio_audiosize;
+ DMAAUDIO_IO.end_high = (buffer>>16) & 255;
+ DMAAUDIO_IO.end_mid = (buffer>>8) & 255;
+ DMAAUDIO_IO.end_low = buffer & 255;
+
+ mode = 3-MINTAUDIO_frequencies[MINTAUDIO_numfreq].predivisor;
+ if (this->spec.channels==1) {
+ mode |= 1<<7;
+ }
+ DMAAUDIO_IO.sound_ctrl = mode;
+}
+
+static void Mint_StopReplay(void)
+{
+ /* Stop replay */
+ DMAAUDIO_IO.control=0;
+}
+
+static void Mint_StartReplay(void)
+{
+ /* Start replay */
+ DMAAUDIO_IO.control=3;
+}
diff --git a/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_dma8.h b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_dma8.h
new file mode 100644
index 0000000..a52e5db
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_dma8.h
@@ -0,0 +1,85 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ DMA 8bits and Falcon Codec audio definitions
+
+ Patrice Mandin, Didier Méquignon
+*/
+
+#ifndef _SDL_mintaudio_dma8_h
+#define _SDL_mintaudio_dma8_h
+
+#define DMAAUDIO_IO_BASE (0xffff8900)
+struct DMAAUDIO_IO_S {
+ unsigned char int_ctrl;
+ unsigned char control;
+
+ unsigned char dummy1;
+ unsigned char start_high;
+ unsigned char dummy2;
+ unsigned char start_mid;
+ unsigned char dummy3;
+ unsigned char start_low;
+
+ unsigned char dummy4;
+ unsigned char cur_high;
+ unsigned char dummy5;
+ unsigned char cur_mid;
+ unsigned char dummy6;
+ unsigned char cur_low;
+
+ unsigned char dummy7;
+ unsigned char end_high;
+ unsigned char dummy8;
+ unsigned char end_mid;
+ unsigned char dummy9;
+ unsigned char end_low;
+
+ unsigned char dummy10[12];
+
+ unsigned char track_ctrl; /* CODEC only */
+ unsigned char sound_ctrl;
+ unsigned short sound_data;
+ unsigned short sound_mask;
+
+ unsigned char dummy11[10];
+
+ unsigned short dev_ctrl;
+ unsigned short dest_ctrl;
+ unsigned short sync_div;
+ unsigned char track_rec;
+ unsigned char adderin_input;
+ unsigned char channel_input;
+ unsigned char channel_amplification;
+ unsigned char channel_reduction;
+
+ unsigned char dummy12[6];
+
+ unsigned char data_direction;
+ unsigned char dummy13;
+ unsigned char dev_data;
+};
+#define DMAAUDIO_IO ((*(volatile struct DMAAUDIO_IO_S *)DMAAUDIO_IO_BASE))
+
+#endif /* _SDL_mintaudio_dma8_h */
diff --git a/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_gsxb.c b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_gsxb.c
new file mode 100644
index 0000000..8d7716a
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_gsxb.c
@@ -0,0 +1,436 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ MiNT audio driver
+ using XBIOS functions (GSXB compatible driver)
+
+ Patrice Mandin
+*/
+
+/* Mint includes */
+#include <mint/osbind.h>
+#include <mint/falcon.h>
+#include <mint/cookie.h>
+
+#include "SDL_audio.h"
+#include "../SDL_audio_c.h"
+#include "../SDL_sysaudio.h"
+
+#include "../../video/ataricommon/SDL_atarimxalloc_c.h"
+
+#include "SDL_mintaudio.h"
+#include "SDL_mintaudio_gsxb.h"
+
+/*--- Defines ---*/
+
+#define MINT_AUDIO_DRIVER_NAME "mint_gsxb"
+
+/* Debug print info */
+#define DEBUG_NAME "audio:gsxb: "
+#if 0
+#define DEBUG_PRINT(what) \
+ { \
+ printf what; \
+ }
+#else
+#define DEBUG_PRINT(what)
+#endif
+
+/*--- Static variables ---*/
+
+static long cookie_snd, cookie_gsxb;
+
+/*--- Audio driver functions ---*/
+
+static void Mint_CloseAudio(_THIS);
+static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void Mint_LockAudio(_THIS);
+static void Mint_UnlockAudio(_THIS);
+
+/* To check/init hardware audio */
+static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec);
+static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec);
+
+/* GSXB callbacks */
+static void Mint_GsxbInterrupt(void);
+static void Mint_GsxbNullInterrupt(void);
+
+/*--- Audio driver bootstrap functions ---*/
+
+static int Audio_Available(void)
+{
+ const char *envr = SDL_getenv("SDL_AUDIODRIVER");
+
+ /* Check if user asked a different audio driver */
+ if ((envr) && (SDL_strcmp(envr, MINT_AUDIO_DRIVER_NAME)!=0)) {
+ DEBUG_PRINT((DEBUG_NAME "user asked a different audio driver\n"));
+ return(0);
+ }
+
+ /* Cookie _SND present ? if not, assume ST machine */
+ if (Getcookie(C__SND, &cookie_snd) == C_NOTFOUND) {
+ cookie_snd = SND_PSG;
+ }
+
+ /* Check if we have 16 bits audio */
+ if ((cookie_snd & SND_16BIT)==0) {
+ DEBUG_PRINT((DEBUG_NAME "no 16 bits sound\n"));
+ return(0);
+ }
+
+ /* Cookie GSXB present ? */
+ cookie_gsxb = (Getcookie(C_GSXB, &cookie_gsxb) == C_FOUND);
+
+ /* Is it GSXB ? */
+ if (((cookie_snd & SND_GSXB)==0) || (cookie_gsxb==0)) {
+ DEBUG_PRINT((DEBUG_NAME "no GSXB audio\n"));
+ return(0);
+ }
+
+ /* Check if audio is lockable */
+ if (Locksnd()!=1) {
+ DEBUG_PRINT((DEBUG_NAME "audio locked by other application\n"));
+ return(0);
+ }
+
+ Unlocksnd();
+
+ DEBUG_PRINT((DEBUG_NAME "GSXB audio available!\n"));
+ return(1);
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+
+ /* Set the function pointers */
+ this->OpenAudio = Mint_OpenAudio;
+ this->CloseAudio = Mint_CloseAudio;
+ this->LockAudio = Mint_LockAudio;
+ this->UnlockAudio = Mint_UnlockAudio;
+ this->free = Audio_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap MINTAUDIO_GSXB_bootstrap = {
+ MINT_AUDIO_DRIVER_NAME, "MiNT GSXB audio driver",
+ Audio_Available, Audio_CreateDevice
+};
+
+static void Mint_LockAudio(_THIS)
+{
+ /* Stop replay */
+ Buffoper(0);
+}
+
+static void Mint_UnlockAudio(_THIS)
+{
+ /* Restart replay */
+ Buffoper(SB_PLA_ENA|SB_PLA_RPT);
+}
+
+static void Mint_CloseAudio(_THIS)
+{
+ /* Stop replay */
+ Buffoper(0);
+
+ /* Uninstall interrupt */
+ if (NSetinterrupt(2, SI_NONE, Mint_GsxbNullInterrupt)<0) {
+ DEBUG_PRINT((DEBUG_NAME "NSetinterrupt() failed in close\n"));
+ }
+
+ /* Wait if currently playing sound */
+ while (SDL_MintAudio_mutex != 0) {
+ }
+
+ /* Clear buffers */
+ if (SDL_MintAudio_audiobuf[0]) {
+ Mfree(SDL_MintAudio_audiobuf[0]);
+ SDL_MintAudio_audiobuf[0] = SDL_MintAudio_audiobuf[1] = NULL;
+ }
+
+ /* Unlock sound system */
+ Unlocksnd();
+}
+
+static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
+{
+ long snd_format = 0;
+ int i, resolution, format_signed, format_bigendian;
+ Uint16 test_format = SDL_FirstAudioFormat(spec->format);
+ int valid_datatype = 0;
+
+ resolution = spec->format & 0x00ff;
+ format_signed = ((spec->format & 0x8000)!=0);
+ format_bigendian = ((spec->format & 0x1000)!=0);
+
+ DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff));
+ DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
+ DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
+ DEBUG_PRINT(("channels=%d, ", spec->channels));
+ DEBUG_PRINT(("freq=%d\n", spec->freq));
+
+ if (spec->channels > 2) {
+ spec->channels = 2; /* no more than stereo! */
+ }
+
+ while ((!valid_datatype) && (test_format)) {
+ /* Check formats available */
+ snd_format = Sndstatus(SND_QUERYFORMATS);
+ spec->format = test_format;
+ resolution = spec->format & 0xff;
+ format_signed = (spec->format & (1<<15));
+ format_bigendian = (spec->format & (1<<12));
+ switch (test_format) {
+ case AUDIO_U8:
+ case AUDIO_S8:
+ if (snd_format & SND_FORMAT8) {
+ valid_datatype = 1;
+ snd_format = Sndstatus(SND_QUERY8BIT);
+ }
+ break;
+
+ case AUDIO_U16LSB:
+ case AUDIO_S16LSB:
+ case AUDIO_U16MSB:
+ case AUDIO_S16MSB:
+ if (snd_format & SND_FORMAT16) {
+ valid_datatype = 1;
+ snd_format = Sndstatus(SND_QUERY16BIT);
+ }
+ break;
+
+ default:
+ test_format = SDL_NextAudioFormat();
+ break;
+ }
+ }
+
+ if (!valid_datatype) {
+ SDL_SetError("Unsupported audio format");
+ return (-1);
+ }
+
+ /* Check signed/unsigned format */
+ if (format_signed) {
+ if (snd_format & SND_FORMATSIGNED) {
+ /* Ok */
+ } else if (snd_format & SND_FORMATUNSIGNED) {
+ /* Give unsigned format */
+ spec->format = spec->format & (~0x8000);
+ }
+ } else {
+ if (snd_format & SND_FORMATUNSIGNED) {
+ /* Ok */
+ } else if (snd_format & SND_FORMATSIGNED) {
+ /* Give signed format */
+ spec->format |= 0x8000;
+ }
+ }
+
+ if (format_bigendian) {
+ if (snd_format & SND_FORMATBIGENDIAN) {
+ /* Ok */
+ } else if (snd_format & SND_FORMATLITTLEENDIAN) {
+ /* Give little endian format */
+ spec->format = spec->format & (~0x1000);
+ }
+ } else {
+ if (snd_format & SND_FORMATLITTLEENDIAN) {
+ /* Ok */
+ } else if (snd_format & SND_FORMATBIGENDIAN) {
+ /* Give big endian format */
+ spec->format |= 0x1000;
+ }
+ }
+
+ /* Calculate and select the closest frequency */
+ MINTAUDIO_freqcount=0;
+ for (i=1;i<4;i++) {
+ SDL_MintAudio_AddFrequency(this,
+ MASTERCLOCK_44K/(MASTERPREDIV_MILAN*(1<<i)), MASTERCLOCK_44K,
+ (1<<i)-1, -1);
+ }
+
+#if 1
+ for (i=0; i<MINTAUDIO_freqcount; i++) {
+ DEBUG_PRINT((DEBUG_NAME "freq %d: %lu Hz, clock %lu, prediv %d\n",
+ i, MINTAUDIO_frequencies[i].frequency, MINTAUDIO_frequencies[i].masterclock,
+ MINTAUDIO_frequencies[i].predivisor
+ ));
+ }
+#endif
+
+ MINTAUDIO_numfreq=SDL_MintAudio_SearchFrequency(this, spec->freq);
+ spec->freq=MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
+
+ DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff));
+ DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
+ DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
+ DEBUG_PRINT(("channels=%d, ", spec->channels));
+ DEBUG_PRINT(("freq=%d\n", spec->freq));
+
+ return 0;
+}
+
+static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec)
+{
+ int channels_mode, prediv;
+ void *buffer;
+
+ /* Stop currently playing sound */
+ Buffoper(0);
+
+ /* Set replay tracks */
+ Settracks(0,0);
+ Setmontracks(0);
+
+ /* Select replay format */
+ switch (spec->format & 0xff) {
+ case 8:
+ if (spec->channels==2) {
+ channels_mode=STEREO8;
+ } else {
+ channels_mode=MONO8;
+ }
+ break;
+ case 16:
+ if (spec->channels==2) {
+ channels_mode=STEREO16;
+ } else {
+ channels_mode=MONO16;
+ }
+ break;
+ default:
+ channels_mode=STEREO16;
+ break;
+ }
+ if (Setmode(channels_mode)<0) {
+ DEBUG_PRINT((DEBUG_NAME "Setmode() failed\n"));
+ }
+
+ prediv = MINTAUDIO_frequencies[MINTAUDIO_numfreq].predivisor;
+ Devconnect(DMAPLAY, DAC, CLKEXT, prediv, 1);
+
+ /* Set buffer */
+ buffer = SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf];
+ if (Setbuffer(0, buffer, buffer + spec->size)<0) {
+ DEBUG_PRINT((DEBUG_NAME "Setbuffer() failed\n"));
+ }
+
+ /* Install interrupt */
+ if (NSetinterrupt(2, SI_PLAY, Mint_GsxbInterrupt)<0) {
+ DEBUG_PRINT((DEBUG_NAME "NSetinterrupt() failed\n"));
+ }
+
+ /* Go */
+ Buffoper(SB_PLA_ENA|SB_PLA_RPT);
+ DEBUG_PRINT((DEBUG_NAME "hardware initialized\n"));
+}
+
+static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ /* Lock sound system */
+ if (Locksnd()!=1) {
+ SDL_SetError("Mint_OpenAudio: Audio system already in use");
+ return(-1);
+ }
+
+ SDL_MintAudio_device = this;
+
+ /* Check audio capabilities */
+ if (Mint_CheckAudio(this, spec)==-1) {
+ return -1;
+ }
+
+ SDL_CalculateAudioSpec(spec);
+
+ /* Allocate memory for audio buffers in DMA-able RAM */
+ DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size));
+
+ SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM);
+ if (SDL_MintAudio_audiobuf[0]==NULL) {
+ SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer");
+ return (-1);
+ }
+ SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + spec->size ;
+ SDL_MintAudio_numbuf=0;
+ SDL_memset(SDL_MintAudio_audiobuf[0], spec->silence, spec->size *2);
+ SDL_MintAudio_audiosize = spec->size;
+ SDL_MintAudio_mutex = 0;
+
+ DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n", SDL_MintAudio_audiobuf[0]));
+ DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n", SDL_MintAudio_audiobuf[1]));
+
+ SDL_MintAudio_CheckFpu();
+
+ /* Setup audio hardware */
+ Mint_InitAudio(this, spec);
+
+ return(1); /* We don't use threaded audio */
+}
+
+static void Mint_GsxbInterrupt(void)
+{
+ Uint8 *newbuf;
+
+ if (SDL_MintAudio_mutex)
+ return;
+
+ SDL_MintAudio_mutex=1;
+
+ SDL_MintAudio_numbuf ^= 1;
+ SDL_MintAudio_Callback();
+ newbuf = SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf];
+ Setbuffer(0, newbuf, newbuf + SDL_MintAudio_audiosize);
+
+ SDL_MintAudio_mutex=0;
+}
+
+static void Mint_GsxbNullInterrupt(void)
+{
+}
diff --git a/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_gsxb.h b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_gsxb.h
new file mode 100644
index 0000000..aee26b7
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_gsxb.h
@@ -0,0 +1,104 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * GSXB audio definitions
+ *
+ * Patrice Mandin
+ */
+
+#ifndef _SDL_mintaudio_gsxb_h
+#define _SDL_mintaudio_gsxb_h
+
+#include <mint/falcon.h> /* for trap_14_xxx macros */
+
+/* Bit 5 in cookie _SND */
+
+#define SND_GSXB (1<<5)
+
+/* NSoundcmd modes */
+
+#define SETRATE 7 /* Set sample rate */
+#define SET8BITFORMAT 8 /* 8 bits format */
+#define SET16BITFORMAT 9 /* 16 bits format */
+#define SET24BITFORMAT 10 /* 24 bits format */
+#define SET32BITFORMAT 11 /* 32 bits format */
+#define LTATTEN_MASTER 12 /* Attenuation */
+#define RTATTEN_MASTER 13
+#define LTATTEN_MICIN 14
+#define RTATTEN_MICIN 15
+#define LTATTEN_FMGEN 16
+#define RTATTEN_FMGEN 17
+#define LTATTEN_LINEIN 18
+#define RTATTEN_LINEIN 19
+#define LTATTEN_CDIN 20
+#define RTATTEN_CDIN 21
+#define LTATTEN_VIDIN 22
+#define RTATTEN_VIDIN 23
+#define LTATTEN_AUXIN 24
+#define RTATTEN_AUXIN 25
+
+/* Setmode modes */
+
+#define MONO16 3
+#define STEREO24 4
+#define STEREO32 5
+#define MONO24 6
+#define MONO32 7
+
+/* Sndstatus modes */
+
+#define SND_QUERYFORMATS 2
+#define SND_QUERYMIXERS 3
+#define SND_QUERYSOURCES 4
+#define SND_QUERYDUPLEX 5
+#define SND_QUERY8BIT 8
+#define SND_QUERY16BIT 9
+#define SND_QUERY24BIT 10
+#define SND_QUERY32BIT 11
+
+#define SND_FORMAT8 (1<<0)
+#define SND_FORMAT16 (1<<1)
+#define SND_FORMAT24 (1<<2)
+#define SND_FORMAT32 (1<<3)
+
+#define SND_FORMATSIGNED (1<<0)
+#define SND_FORMATUNSIGNED (1<<1)
+#define SND_FORMATBIGENDIAN (1<<2)
+#define SND_FORMATLITTLEENDIAN (1<<3)
+
+/* Devconnect prescalers */
+
+#define CLK_44K 1
+#define CLK_22K 3
+#define CLK_11K 7
+
+/* Extra xbios functions */
+
+#define NSoundcmd(mode,data,data2) \
+ (long)trap_14_wwl((short)130,(short)(mode),(short)(data),(long)(data2))
+#define NSetinterrupt(src_inter,cause,inth_addr) \
+ (long)trap_14_wwwl((short)135,(short)(src_inter),(short)(cause), \
+ (long)(inth_addr))
+
+#endif /* _SDL_mintaudio_gsxb_h */
diff --git a/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_it.S b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_it.S
new file mode 100644
index 0000000..a2ecac4
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_it.S
@@ -0,0 +1,386 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/*
+ Audio interrupts
+
+ Patrice Mandin, Didier Méquignon
+ */
+
+ .text
+
+ .globl _SDL_MintAudio_Callback
+
+ .globl _SDL_MintAudio_XbiosInterrupt
+ .globl _SDL_MintAudio_XbiosInterruptMeasureClock
+ .globl _SDL_MintAudio_Dma8Interrupt
+ .globl _SDL_MintAudio_StfaInterrupt
+
+ .globl _SDL_MintAudio_mutex
+ .globl _SDL_MintAudio_audiobuf
+ .globl _SDL_MintAudio_numbuf
+ .globl _SDL_MintAudio_audiosize
+ .globl _SDL_MintAudio_clocktics
+ .globl _SDL_MintAudio_hasfpu
+
+ .globl _SDL_MintAudio_stfa
+
+/*
+ How it works:
+ - Audio is playing buffer #0 (resp. #1)
+ - We must calculate a sample in buffer #1 (resp. #0)
+ so we first call the callback to do it
+ - Then we swap the buffers
+*/
+
+#define savptr 0x4a2
+#define savamt 0x46
+
+/*--- Save/restore FPU context ---*/
+
+#if defined(__mcoldfire__)
+
+#define SAVE_FPU_CONTEXT \
+ lea sp@(-216),sp; \
+ fsave sp@; \
+ fmovel fpiar,sp@-; \
+ lea sp@(-64),sp; \
+ fmovemd fp0-fp7,sp@
+
+#define RESTORE_FPU_CONTEXT \
+ fmovemd sp@,fp0-fp7; \
+ lea sp@(64),sp; \
+ fmovel sp@+,fpiar; \
+ frestore sp@; \
+ lea sp@(216),sp
+
+#else
+
+#define SAVE_FPU_CONTEXT \
+ .chip 68k/68881; \
+ fsave sp@-; \
+ fmoveml fpcr/fpsr/fpiar,sp@-; \
+ fmovemx fp0-fp7,sp@-; \
+ .chip 68k
+
+#define RESTORE_FPU_CONTEXT \
+ .chip 68k/68881; \
+ fmovemx sp@+,fp0-fp7; \
+ fmoveml sp@+,fpcr/fpsr/fpiar; \
+ frestore sp@+; \
+ .chip 68k
+
+#endif
+
+/*--- Xbios interrupt vector to measure Falcon external clock ---*/
+
+_SDL_MintAudio_XbiosInterruptMeasureClock: /* 1 mS */
+#if defined(__mcoldfire__)
+ movel d0,sp@-
+
+ moveql #0,d0
+ btst d0,0xFFFF8901:w /* state DMA sound */
+#else
+ btst #0,0xFFFF8901:w /* state DMA sound */
+#endif
+ beqs SDL_MintAudio_EndIntMeasure
+ addql #1,_SDL_MintAudio_clocktics
+SDL_MintAudio_EndIntMeasure:
+#if defined(__mcoldfire__)
+ moveql #5,d0
+ bclr d0,0xFFFFFA0F:w /* Clear service bit */
+
+ movel sp@+,d0
+#else
+ bclr #5,0xFFFFFA0F:w /* Clear service bit */
+#endif
+ rte
+
+/*--- Xbios interrupt vector ---*/
+
+_SDL_MintAudio_XbiosInterrupt:
+#if defined(__mcoldfire__)
+ lea sp@(-60),sp
+ moveml d0-d7/a0-a6,sp@
+#else
+ moveml d0-d7/a0-a6,sp@-
+#endif
+
+ /* Reenable interrupts, so other interrupts can work */
+ movew #0x2300,sr
+
+ /* Clear service bit, so other MFP interrupts can work */
+#if defined(__mcoldfire__)
+ moveql #5,d0
+ bclr d0,0xfffffa0f:w
+#else
+ bclr #5,0xfffffa0f:w
+#endif
+
+ /* Check if we are not already running */
+ tstw _SDL_MintAudio_mutex
+ bne SDL_MintAudio_XbiosEnd
+
+#if defined(__mcoldfire__)
+ movew _SDL_MintAudio_mutex,d0
+ notl d0
+ movew d0,_SDL_MintAudio_mutex
+
+ movew _SDL_MintAudio_numbuf,d1
+ eorl #1,d1
+ movew d1,_SDL_MintAudio_numbuf
+#else
+ notw _SDL_MintAudio_mutex
+
+ /* Swap buffers */
+ eorw #1,_SDL_MintAudio_numbuf
+#endif
+
+ /* Save FPU if needed */
+ tstw _SDL_MintAudio_hasfpu
+ beqs SDL_MintAudio_Xbios_nofpu1
+ SAVE_FPU_CONTEXT
+SDL_MintAudio_Xbios_nofpu1:
+
+ /* Callback */
+ jsr _SDL_MintAudio_Callback
+
+ /* Restore FPU if needed */
+ tstw _SDL_MintAudio_hasfpu
+ beqs SDL_MintAudio_Xbios_nofpu2
+ RESTORE_FPU_CONTEXT
+SDL_MintAudio_Xbios_nofpu2:
+
+ /* Reserve space for registers */
+#if defined(__mcoldfire__)
+ movel #savamt,d0
+ subl d0,savptr
+#else
+ subl #savamt,savptr
+#endif
+
+ /* Set new buffer */
+
+ moveq #0,d0
+ movel _SDL_MintAudio_audiosize,d1
+
+ movew _SDL_MintAudio_numbuf,d0
+ lsll #2,d0
+ lea _SDL_MintAudio_audiobuf,a0
+ movel a0@(d0:l),a1
+
+ lea a1@(d1:l),a2
+
+ movel a2,sp@-
+ movel a1,sp@-
+ clrw sp@-
+ movew #131,sp@-
+ trap #14
+ lea sp@(12),sp
+
+ /* Restore registers space */
+#if defined(__mcoldfire__)
+ movel #savamt,d0
+ addl d0,savptr
+#else
+ addl #savamt,savptr
+#endif
+
+ clrw _SDL_MintAudio_mutex
+SDL_MintAudio_XbiosEnd:
+#if defined(__mcoldfire__)
+ moveml sp@,d0-d7/a0-a6
+ lea sp@(60),sp
+#else
+ moveml sp@+,d0-d7/a0-a6
+#endif
+ rte
+
+/*--- DMA 8 bits interrupt vector ---*/
+
+_SDL_MintAudio_Dma8Interrupt:
+#if defined(__mcoldfire__)
+ lea sp@(-16),sp
+ moveml d0-d1/a0-a1,sp@
+#else
+ moveml d0-d1/a0-a1,sp@-
+#endif
+
+ /* Reenable interrupts, so other interrupts can work */
+ movew #0x2300,sr
+
+ /* Clear service bit, so other MFP interrupts can work */
+#if defined(__mcoldfire__)
+ moveql #5,d0
+ bclr d0,0xfffffa0f:w
+#else
+ bclr #5,0xfffffa0f:w
+#endif
+ /* Check if we are not already running */
+ tstw _SDL_MintAudio_mutex
+ bne SDL_MintAudio_Dma8End
+
+#if defined(__mcoldfire__)
+ movew _SDL_MintAudio_mutex,d0
+ notl d0
+ movew d0,_SDL_MintAudio_mutex
+
+ movew _SDL_MintAudio_numbuf,d1
+ eorl #1,d1
+ movew d1,_SDL_MintAudio_numbuf
+#else
+ notw _SDL_MintAudio_mutex
+
+ /* Swap buffers */
+ eorw #1,_SDL_MintAudio_numbuf
+#endif
+
+ /* Save FPU if needed */
+ tstw _SDL_MintAudio_hasfpu
+ beqs SDL_MintAudio_Dma8_nofpu1
+ SAVE_FPU_CONTEXT
+SDL_MintAudio_Dma8_nofpu1:
+
+ /* Callback */
+ jsr _SDL_MintAudio_Callback
+
+ /* Restore FPU if needed */
+ tstw _SDL_MintAudio_hasfpu
+ beqs SDL_MintAudio_Dma8_nofpu2
+ RESTORE_FPU_CONTEXT
+SDL_MintAudio_Dma8_nofpu2:
+
+ /* Set new buffer */
+
+ moveq #0,d0
+
+ movew _SDL_MintAudio_numbuf,d0
+ lsll #2,d0
+ lea _SDL_MintAudio_audiobuf,a0
+ movel a0@(d0:l),d1
+
+ /* Modify DMA addresses */
+ lea 0xffff8900:w,a0
+
+ movel d1,d0
+
+ moveb d0,a0@(0x07) /* Start address */
+ lsrl #8,d0
+ moveb d0,a0@(0x05)
+ lsrl #8,d0
+ moveb d0,a0@(0x03)
+
+ addl _SDL_MintAudio_audiosize,d1
+
+ movel d1,d0
+
+ moveb d0,a0@(0x13) /* End address */
+ lsrl #8,d0
+ moveb d0,a0@(0x11)
+ lsrl #8,d0
+ moveb d0,a0@(0x0f)
+
+ clrw _SDL_MintAudio_mutex
+SDL_MintAudio_Dma8End:
+#if defined(__mcoldfire__)
+ moveml sp@,d0-d1/a0-a1
+ lea sp@(16),sp
+#else
+ moveml sp@+,d0-d1/a0-a1
+#endif
+ rte
+
+/*--- STFA interrupt vector ---*/
+
+STFA_SOUND_START = 6
+STFA_SOUND_END = STFA_SOUND_START+8
+
+_SDL_MintAudio_StfaInterrupt:
+ /* Reenable interrupts, so other interrupts can work */
+ movew #0x2300,sr
+
+ /* Check if we are not already running */
+ tstw _SDL_MintAudio_mutex
+
+#if defined(__mcoldfire__)
+ bne SDL_MintAudio_StfaEnd
+
+ lea sp@(-60),sp
+ moveml d0-d7/a0-a6,sp@
+
+ movew _SDL_MintAudio_mutex,d0
+ notl d0
+ movew d0,_SDL_MintAudio_mutex
+
+ movew _SDL_MintAudio_numbuf,d1
+ eorl #1,d1
+ movew d1,_SDL_MintAudio_numbuf
+#else
+ bnes SDL_MintAudio_StfaEnd
+
+ moveml d0-d7/a0-a6,sp@-
+
+ notw _SDL_MintAudio_mutex
+
+ /* Swap buffers */
+ eorw #1,_SDL_MintAudio_numbuf
+#endif
+
+ /* Save FPU if needed */
+ tstw _SDL_MintAudio_hasfpu
+ beqs SDL_MintAudio_Stfa_nofpu1
+ SAVE_FPU_CONTEXT
+SDL_MintAudio_Stfa_nofpu1:
+
+ /* Callback */
+ jsr _SDL_MintAudio_Callback
+
+ /* Restore FPU if needed */
+ tstw _SDL_MintAudio_hasfpu
+ beqs SDL_MintAudio_Stfa_nofpu2
+ RESTORE_FPU_CONTEXT
+SDL_MintAudio_Stfa_nofpu2:
+
+ /* Set new buffer */
+
+ moveq #0,d0
+ movel _SDL_MintAudio_stfa,a1
+
+ movew _SDL_MintAudio_numbuf,d0
+ lsll #2,d0
+ lea _SDL_MintAudio_audiobuf,a0
+ movel a0@(d0:l),d1
+
+ /* Modify STFA replay buffers */
+ movel d1,a1@(STFA_SOUND_START)
+ addl _SDL_MintAudio_audiosize,d1
+ movel d1,a1@(STFA_SOUND_END)
+
+#if defined(__mcoldfire__)
+ moveml sp@,d0-d7/a0-a6
+ lea sp@(60),sp
+#else
+ moveml sp@+,d0-d7/a0-a6
+#endif
+ clrw _SDL_MintAudio_mutex
+SDL_MintAudio_StfaEnd:
+ rte
diff --git a/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_mcsn.c b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_mcsn.c
new file mode 100644
index 0000000..387609b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_mcsn.c
@@ -0,0 +1,405 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ MiNT audio driver
+ using XBIOS functions (MacSound compatible driver)
+
+ Patrice Mandin
+*/
+
+#include <support.h>
+
+/* Mint includes */
+#include <mint/osbind.h>
+#include <mint/falcon.h>
+#include <mint/cookie.h>
+
+#include "SDL_audio.h"
+#include "../SDL_audio_c.h"
+#include "../SDL_sysaudio.h"
+
+#include "../../video/ataricommon/SDL_atarimxalloc_c.h"
+
+#include "SDL_mintaudio.h"
+#include "SDL_mintaudio_mcsn.h"
+
+/*--- Defines ---*/
+
+#define MINT_AUDIO_DRIVER_NAME "mint_mcsn"
+
+/* Debug print info */
+#define DEBUG_NAME "audio:mcsn: "
+#if 0
+#define DEBUG_PRINT(what) \
+ { \
+ printf what; \
+ }
+#else
+#define DEBUG_PRINT(what)
+#endif
+
+/*--- Static variables ---*/
+
+static long cookie_snd, cookie_mch;
+static cookie_mcsn_t *cookie_mcsn;
+
+/*--- Audio driver functions ---*/
+
+static void Mint_CloseAudio(_THIS);
+static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void Mint_LockAudio(_THIS);
+static void Mint_UnlockAudio(_THIS);
+
+/* To check/init hardware audio */
+static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec);
+static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec);
+
+/*--- Audio driver bootstrap functions ---*/
+
+static int Audio_Available(void)
+{
+ long dummy;
+ const char *envr = SDL_getenv("SDL_AUDIODRIVER");
+
+ SDL_MintAudio_mint_present = (Getcookie(C_MiNT, &dummy) == C_FOUND);
+
+ /* We can't use XBIOS in interrupt with Magic, don't know about thread */
+ if (Getcookie(C_MagX, &dummy) == C_FOUND) {
+ return(0);
+ }
+
+ /* Check if user asked a different audio driver */
+ if ((envr) && (SDL_strcmp(envr, MINT_AUDIO_DRIVER_NAME)!=0)) {
+ DEBUG_PRINT((DEBUG_NAME "user asked a different audio driver\n"));
+ return(0);
+ }
+
+ /* Cookie _MCH present ? if not, assume ST machine */
+ if (Getcookie(C__MCH, &cookie_mch) == C_NOTFOUND) {
+ cookie_mch = MCH_ST;
+ }
+
+ /* Cookie _SND present ? if not, assume ST machine */
+ if (Getcookie(C__SND, &cookie_snd) == C_NOTFOUND) {
+ cookie_snd = SND_PSG;
+ }
+
+ /* Check if we have 16 bits audio */
+ if ((cookie_snd & SND_16BIT)==0) {
+ DEBUG_PRINT((DEBUG_NAME "no 16 bits sound\n"));
+ return(0);
+ }
+
+ /* Cookie MCSN present ? */
+ if (Getcookie(C_McSn, &dummy) != C_FOUND) {
+ DEBUG_PRINT((DEBUG_NAME "no MCSN audio\n"));
+ return(0);
+ }
+ cookie_mcsn = (cookie_mcsn_t *) dummy;
+
+ /* Check if interrupt at end of replay */
+ if (cookie_mcsn->pint == 0) {
+ DEBUG_PRINT((DEBUG_NAME "no interrupt at end of replay\n"));
+ return(0);
+ }
+
+ /* Check if audio is lockable */
+ if (Locksnd()!=1) {
+ DEBUG_PRINT((DEBUG_NAME "audio locked by other application\n"));
+ return(0);
+ }
+
+ Unlocksnd();
+
+ DEBUG_PRINT((DEBUG_NAME "MCSN audio available!\n"));
+ return(1);
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+
+ /* Set the function pointers */
+ this->OpenAudio = Mint_OpenAudio;
+ this->CloseAudio = Mint_CloseAudio;
+ this->LockAudio = Mint_LockAudio;
+ this->UnlockAudio = Mint_UnlockAudio;
+ this->free = Audio_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap MINTAUDIO_MCSN_bootstrap = {
+ MINT_AUDIO_DRIVER_NAME, "MiNT MCSN audio driver",
+ Audio_Available, Audio_CreateDevice
+};
+
+static void Mint_LockAudio(_THIS)
+{
+ /* Stop replay */
+ Buffoper(0);
+}
+
+static void Mint_UnlockAudio(_THIS)
+{
+ /* Restart replay */
+ Buffoper(SB_PLA_ENA|SB_PLA_RPT);
+}
+
+static void Mint_CloseAudio(_THIS)
+{
+ /* Stop replay */
+ SDL_MintAudio_WaitThread();
+ Buffoper(0);
+
+ if (!SDL_MintAudio_mint_present) {
+ /* Uninstall interrupt */
+ Jdisint(MFP_DMASOUND);
+ }
+
+ /* Wait if currently playing sound */
+ while (SDL_MintAudio_mutex != 0) {
+ }
+
+ /* Clear buffers */
+ if (SDL_MintAudio_audiobuf[0]) {
+ Mfree(SDL_MintAudio_audiobuf[0]);
+ SDL_MintAudio_audiobuf[0] = SDL_MintAudio_audiobuf[1] = NULL;
+ }
+
+ /* Unlock sound system */
+ Unlocksnd();
+}
+
+static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
+{
+ int i;
+ unsigned long masterclock, masterprediv;
+
+ DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff));
+ DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
+ DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
+ DEBUG_PRINT(("channels=%d, ", spec->channels));
+ DEBUG_PRINT(("freq=%d\n", spec->freq));
+
+ if (spec->channels > 2) {
+ spec->channels = 2; /* no more than stereo! */
+ }
+
+ /* Check formats available */
+ MINTAUDIO_freqcount=0;
+ switch(cookie_mcsn->play) {
+ case MCSN_ST:
+ spec->channels=1;
+ spec->format=8; /* FIXME: is it signed or unsigned ? */
+ SDL_MintAudio_AddFrequency(this, 12500, 0, 0, -1);
+ break;
+ case MCSN_TT: /* Also STE, Mega STE */
+ spec->format=AUDIO_S8;
+ masterclock=MASTERCLOCK_STE;
+ masterprediv=MASTERPREDIV_STE;
+ if ((cookie_mch>>16)==MCH_TT) {
+ masterclock=MASTERCLOCK_TT;
+ masterprediv=MASTERPREDIV_TT;
+ }
+ for (i=0; i<4; i++) {
+ SDL_MintAudio_AddFrequency(this, masterclock/(masterprediv*(1<<i)),
+ masterclock, 3-i, -1);
+ }
+ break;
+ case MCSN_FALCON: /* Also Mac */
+ for (i=1; i<12; i++) {
+ /* Remove unusable Falcon codec predivisors */
+ if ((i==6) || (i==8) || (i==10)) {
+ continue;
+ }
+ SDL_MintAudio_AddFrequency(this, MASTERCLOCK_FALCON1/(MASTERPREDIV_FALCON*(i+1)),
+ CLK25M, i+1, -1);
+ }
+ if (cookie_mcsn->res1 != 0) {
+ for (i=1; i<4; i++) {
+ SDL_MintAudio_AddFrequency(this, (cookie_mcsn->res1)/(MASTERPREDIV_FALCON*(1<<i)),
+ CLKEXT, (1<<i)-1, -1);
+ }
+ }
+ spec->format |= 0x8000; /* Audio is always signed */
+ if ((spec->format & 0x00ff)==16) {
+ spec->format |= 0x1000; /* Audio is always big endian */
+ spec->channels=2; /* 16 bits always stereo */
+ }
+ break;
+ }
+
+#if 0
+ for (i=0; i<MINTAUDIO_freqcount; i++) {
+ DEBUG_PRINT((DEBUG_NAME "freq %d: %lu Hz, clock %lu, prediv %d\n",
+ i, MINTAUDIO_frequencies[i].frequency, MINTAUDIO_frequencies[i].masterclock,
+ MINTAUDIO_frequencies[i].predivisor
+ ));
+ }
+#endif
+
+ MINTAUDIO_numfreq=SDL_MintAudio_SearchFrequency(this, spec->freq);
+ spec->freq=MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
+
+ DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff));
+ DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
+ DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
+ DEBUG_PRINT(("channels=%d, ", spec->channels));
+ DEBUG_PRINT(("freq=%d\n", spec->freq));
+
+ return 0;
+}
+
+static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec)
+{
+ int channels_mode, prediv, dmaclock;
+ void *buffer;
+
+ /* Stop currently playing sound */
+ SDL_MintAudio_quit_thread = SDL_FALSE;
+ SDL_MintAudio_thread_finished = SDL_TRUE;
+ SDL_MintAudio_WaitThread();
+ Buffoper(0);
+
+ /* Set replay tracks */
+ Settracks(0,0);
+ Setmontracks(0);
+
+ /* Select replay format */
+ channels_mode=STEREO16;
+ switch (spec->format & 0xff) {
+ case 8:
+ if (spec->channels==2) {
+ channels_mode=STEREO8;
+ } else {
+ channels_mode=MONO8;
+ }
+ break;
+ }
+ if (Setmode(channels_mode)<0) {
+ DEBUG_PRINT((DEBUG_NAME "Setmode() failed\n"));
+ }
+
+ dmaclock = MINTAUDIO_frequencies[MINTAUDIO_numfreq].masterclock;
+ prediv = MINTAUDIO_frequencies[MINTAUDIO_numfreq].predivisor;
+ switch(cookie_mcsn->play) {
+ case MCSN_TT:
+ Devconnect(DMAPLAY, DAC, CLK25M, CLKOLD, 1);
+ Soundcmd(SETPRESCALE, prediv);
+ DEBUG_PRINT((DEBUG_NAME "STE/TT prescaler selected\n"));
+ break;
+ case MCSN_FALCON:
+ Devconnect(DMAPLAY, DAC, dmaclock, prediv, 1);
+ DEBUG_PRINT((DEBUG_NAME "Falcon prescaler selected\n"));
+ break;
+ }
+
+ /* Set buffer */
+ buffer = SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf];
+ if (Setbuffer(0, buffer, buffer + spec->size)<0) {
+ DEBUG_PRINT((DEBUG_NAME "Setbuffer() failed\n"));
+ }
+
+ if (SDL_MintAudio_mint_present) {
+ SDL_MintAudio_thread_pid = tfork(SDL_MintAudio_Thread, 0);
+ } else {
+ /* Install interrupt */
+ Jdisint(MFP_DMASOUND);
+ Xbtimer(XB_TIMERA, 8, 1, SDL_MintAudio_XbiosInterrupt);
+ Jenabint(MFP_DMASOUND);
+
+ if (Setinterrupt(SI_TIMERA, SI_PLAY)<0) {
+ DEBUG_PRINT((DEBUG_NAME "Setinterrupt() failed\n"));
+ }
+ }
+
+ /* Go */
+ Buffoper(SB_PLA_ENA|SB_PLA_RPT);
+ DEBUG_PRINT((DEBUG_NAME "hardware initialized\n"));
+}
+
+static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ /* Lock sound system */
+ if (Locksnd()!=1) {
+ SDL_SetError("Mint_OpenAudio: Audio system already in use");
+ return(-1);
+ }
+
+ SDL_MintAudio_device = this;
+
+ /* Check audio capabilities */
+ if (Mint_CheckAudio(this, spec)==-1) {
+ return -1;
+ }
+
+ SDL_CalculateAudioSpec(spec);
+
+ /* Allocate memory for audio buffers in DMA-able RAM */
+ DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size));
+
+ SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM);
+ if (SDL_MintAudio_audiobuf[0]==NULL) {
+ SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer");
+ return (-1);
+ }
+ SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + spec->size ;
+ SDL_MintAudio_numbuf=0;
+ SDL_memset(SDL_MintAudio_audiobuf[0], spec->silence, spec->size *2);
+ SDL_MintAudio_audiosize = spec->size;
+ SDL_MintAudio_mutex = 0;
+
+ DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n", SDL_MintAudio_audiobuf[0]));
+ DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n", SDL_MintAudio_audiobuf[1]));
+
+ SDL_MintAudio_CheckFpu();
+
+ /* Setup audio hardware */
+ Mint_InitAudio(this, spec);
+
+ return(1); /* We don't use SDL threaded audio */
+}
diff --git a/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_mcsn.h b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_mcsn.h
new file mode 100644
index 0000000..b772fda
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_mcsn.h
@@ -0,0 +1,59 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ MCSN control structure
+
+ Patrice Mandin
+*/
+
+#ifndef _SDL_mintaudio_mcsh_h
+#define _SDL_mintaudio_mcsh_h
+
+typedef struct {
+ unsigned short version; /* Version */
+ unsigned short size; /* Size of structure */
+
+ unsigned short play; /* Replay capability */
+ unsigned short record; /* Record capability */
+ unsigned short dsp; /* DSP56K present */
+ unsigned short pint; /* Interrupt at end of replay */
+ unsigned short rint; /* Interrupt at end of record */
+
+ unsigned long res1; /* Frequency of external clock */
+ unsigned long res2;
+ unsigned long res3;
+ unsigned long res4;
+} cookie_mcsn_t;
+
+enum {
+ MCSN_ST=0,
+ MCSN_TT,
+ MCSN_STE=MCSN_TT,
+ MCSN_FALCON,
+ MCSN_MAC=MCSN_FALCON
+};
+
+#define SETSMPFREQ 7 /* Set sample frequency */
+
+#endif /* _SDL_mintaudio_mcsh_h */
diff --git a/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_stfa.c b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_stfa.c
new file mode 100644
index 0000000..4a581e0
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_stfa.c
@@ -0,0 +1,326 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ MiNT audio driver
+ using XBIOS functions (STFA driver)
+
+ Patrice Mandin
+*/
+
+/* Mint includes */
+#include <mint/osbind.h>
+#include <mint/falcon.h>
+#include <mint/cookie.h>
+
+#include "SDL_audio.h"
+#include "../SDL_audio_c.h"
+#include "../SDL_sysaudio.h"
+
+#include "../../video/ataricommon/SDL_atarimxalloc_c.h"
+#include "../../video/ataricommon/SDL_atarisuper.h"
+
+#include "SDL_mintaudio.h"
+#include "SDL_mintaudio_stfa.h"
+
+/*--- Defines ---*/
+
+#define MINT_AUDIO_DRIVER_NAME "mint_stfa"
+
+/* Debug print info */
+#define DEBUG_NAME "audio:stfa: "
+#if 0
+#define DEBUG_PRINT(what) \
+ { \
+ printf what; \
+ }
+#else
+#define DEBUG_PRINT(what)
+#endif
+
+/*--- Static variables ---*/
+
+static long cookie_snd, cookie_mch;
+static cookie_stfa_t *cookie_stfa;
+
+static const int freqs[16]={
+ 4995, 6269, 7493, 8192,
+ 9830, 10971, 12538, 14985,
+ 16384, 19819, 21943, 24576,
+ 30720, 32336, 43885, 49152
+};
+
+/*--- Audio driver functions ---*/
+
+static void Mint_CloseAudio(_THIS);
+static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void Mint_LockAudio(_THIS);
+static void Mint_UnlockAudio(_THIS);
+
+/* To check/init hardware audio */
+static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec);
+static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec);
+
+/*--- Audio driver bootstrap functions ---*/
+
+static int Audio_Available(void)
+{
+ long dummy;
+ const char *envr = SDL_getenv("SDL_AUDIODRIVER");
+
+ /* Check if user asked a different audio driver */
+ if ((envr) && (SDL_strcmp(envr, MINT_AUDIO_DRIVER_NAME)!=0)) {
+ DEBUG_PRINT((DEBUG_NAME "user asked a different audio driver\n"));
+ return(0);
+ }
+
+ /* Cookie _MCH present ? if not, assume ST machine */
+ if (Getcookie(C__MCH, &cookie_mch) == C_NOTFOUND) {
+ cookie_mch = MCH_ST;
+ }
+
+ /* Cookie _SND present ? if not, assume ST machine */
+ if (Getcookie(C__SND, &cookie_snd) == C_NOTFOUND) {
+ cookie_snd = SND_PSG;
+ }
+
+ /* Cookie STFA present ? */
+ if (Getcookie(C_STFA, &dummy) != C_FOUND) {
+ DEBUG_PRINT((DEBUG_NAME "no STFA audio\n"));
+ return(0);
+ }
+ cookie_stfa = (cookie_stfa_t *) dummy;
+
+ SDL_MintAudio_stfa = cookie_stfa;
+
+ DEBUG_PRINT((DEBUG_NAME "STFA audio available!\n"));
+ return(1);
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+
+ /* Set the function pointers */
+ this->OpenAudio = Mint_OpenAudio;
+ this->CloseAudio = Mint_CloseAudio;
+ this->LockAudio = Mint_LockAudio;
+ this->UnlockAudio = Mint_UnlockAudio;
+ this->free = Audio_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap MINTAUDIO_STFA_bootstrap = {
+ MINT_AUDIO_DRIVER_NAME, "MiNT STFA audio driver",
+ Audio_Available, Audio_CreateDevice
+};
+
+static void Mint_LockAudio(_THIS)
+{
+ void *oldpile;
+
+ /* Stop replay */
+ oldpile=(void *)Super(0);
+ cookie_stfa->sound_enable=STFA_PLAY_DISABLE;
+ SuperToUser(oldpile);
+}
+
+static void Mint_UnlockAudio(_THIS)
+{
+ void *oldpile;
+
+ /* Restart replay */
+ oldpile=(void *)Super(0);
+ cookie_stfa->sound_enable=STFA_PLAY_ENABLE|STFA_PLAY_REPEAT;
+ SuperToUser(oldpile);
+}
+
+static void Mint_CloseAudio(_THIS)
+{
+ void *oldpile;
+
+ /* Stop replay */
+ oldpile=(void *)Super(0);
+ cookie_stfa->sound_enable=STFA_PLAY_DISABLE;
+ SuperToUser(oldpile);
+
+ /* Wait if currently playing sound */
+ while (SDL_MintAudio_mutex != 0) {
+ }
+
+ /* Clear buffers */
+ if (SDL_MintAudio_audiobuf[0]) {
+ Mfree(SDL_MintAudio_audiobuf[0]);
+ SDL_MintAudio_audiobuf[0] = SDL_MintAudio_audiobuf[1] = NULL;
+ }
+}
+
+static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
+{
+ int i;
+
+ DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff));
+ DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
+ DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
+ DEBUG_PRINT(("channels=%d, ", spec->channels));
+ DEBUG_PRINT(("freq=%d\n", spec->freq));
+
+ if (spec->channels > 2) {
+ spec->channels = 2; /* no more than stereo! */
+ }
+
+ /* Check formats available */
+ MINTAUDIO_freqcount=0;
+ for (i=0;i<16;i++) {
+ SDL_MintAudio_AddFrequency(this, freqs[i], 0, i, -1);
+ }
+
+#if 1
+ for (i=0; i<MINTAUDIO_freqcount; i++) {
+ DEBUG_PRINT((DEBUG_NAME "freq %d: %lu Hz, clock %lu, prediv %d\n",
+ i, MINTAUDIO_frequencies[i].frequency, MINTAUDIO_frequencies[i].masterclock,
+ MINTAUDIO_frequencies[i].predivisor
+ ));
+ }
+#endif
+
+ MINTAUDIO_numfreq=SDL_MintAudio_SearchFrequency(this, spec->freq);
+ spec->freq=MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
+
+ DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff));
+ DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
+ DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
+ DEBUG_PRINT(("channels=%d, ", spec->channels));
+ DEBUG_PRINT(("freq=%d\n", spec->freq));
+
+ return 0;
+}
+
+static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec)
+{
+ void *buffer;
+ void *oldpile;
+
+ buffer = SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf];
+
+ oldpile=(void *)Super(0);
+
+ /* Stop replay */
+ cookie_stfa->sound_enable=STFA_PLAY_DISABLE;
+
+ /* Select replay format */
+ cookie_stfa->sound_control = MINTAUDIO_frequencies[MINTAUDIO_numfreq].predivisor;
+ if ((spec->format & 0xff)==8) {
+ cookie_stfa->sound_control |= STFA_FORMAT_8BIT;
+ } else {
+ cookie_stfa->sound_control |= STFA_FORMAT_16BIT;
+ }
+ if (spec->channels==2) {
+ cookie_stfa->sound_control |= STFA_FORMAT_STEREO;
+ } else {
+ cookie_stfa->sound_control |= STFA_FORMAT_MONO;
+ }
+ if ((spec->format & 0x8000)!=0) {
+ cookie_stfa->sound_control |= STFA_FORMAT_SIGNED;
+ } else {
+ cookie_stfa->sound_control |= STFA_FORMAT_UNSIGNED;
+ }
+ if ((spec->format & 0x1000)!=0) {
+ cookie_stfa->sound_control |= STFA_FORMAT_BIGENDIAN;
+ } else {
+ cookie_stfa->sound_control |= STFA_FORMAT_LITENDIAN;
+ }
+
+ /* Set buffer */
+ cookie_stfa->sound_start = (unsigned long) buffer;
+ cookie_stfa->sound_end = (unsigned long) (buffer + spec->size);
+
+ /* Set interrupt */
+ cookie_stfa->stfa_it = SDL_MintAudio_StfaInterrupt;
+
+ /* Restart replay */
+ cookie_stfa->sound_enable=STFA_PLAY_ENABLE|STFA_PLAY_REPEAT;
+
+ SuperToUser(oldpile);
+
+ DEBUG_PRINT((DEBUG_NAME "hardware initialized\n"));
+}
+
+static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ SDL_MintAudio_device = this;
+
+ /* Check audio capabilities */
+ if (Mint_CheckAudio(this, spec)==-1) {
+ return -1;
+ }
+
+ SDL_CalculateAudioSpec(spec);
+
+ /* Allocate memory for audio buffers in DMA-able RAM */
+ DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size));
+
+ SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM);
+ if (SDL_MintAudio_audiobuf[0]==NULL) {
+ SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer");
+ return (-1);
+ }
+ SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + spec->size ;
+ SDL_MintAudio_numbuf=0;
+ SDL_memset(SDL_MintAudio_audiobuf[0], spec->silence, spec->size *2);
+ SDL_MintAudio_audiosize = spec->size;
+ SDL_MintAudio_mutex = 0;
+
+ DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n", SDL_MintAudio_audiobuf[0]));
+ DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n", SDL_MintAudio_audiobuf[1]));
+
+ SDL_MintAudio_CheckFpu();
+
+ /* Setup audio hardware */
+ Mint_InitAudio(this, spec);
+
+ return(1); /* We don't use threaded audio */
+}
diff --git a/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_stfa.h b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_stfa.h
new file mode 100644
index 0000000..1789b4b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_stfa.h
@@ -0,0 +1,97 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ STFA control structure
+
+ Patrice Mandin
+*/
+
+#ifndef _SDL_mintaudio_stfa_h
+#define _SDL_mintaudio_stfa_h
+
+/*--- Defines ---*/
+
+#define STFA_PLAY_ENABLE (1<<0)
+#define STFA_PLAY_DISABLE (0<<0)
+#define STFA_PLAY_REPEAT (1<<1)
+#define STFA_PLAY_SINGLE (0<<1)
+
+#define STFA_FORMAT_SIGNED (1<<15)
+#define STFA_FORMAT_UNSIGNED (0<<15)
+#define STFA_FORMAT_STEREO (1<<14)
+#define STFA_FORMAT_MONO (0<<14)
+#define STFA_FORMAT_16BIT (1<<13)
+#define STFA_FORMAT_8BIT (0<<13)
+#define STFA_FORMAT_LITENDIAN (1<<9)
+#define STFA_FORMAT_BIGENDIAN (0<<9)
+#define STFA_FORMAT_FREQ_MASK 0x0f
+enum {
+ STFA_FORMAT_F4995=0,
+ STFA_FORMAT_F6269,
+ STFA_FORMAT_F7493,
+ STFA_FORMAT_F8192,
+
+ STFA_FORMAT_F9830,
+ STFA_FORMAT_F10971,
+ STFA_FORMAT_F12538,
+ STFA_FORMAT_F14985,
+
+ STFA_FORMAT_F16384,
+ STFA_FORMAT_F19819,
+ STFA_FORMAT_F21943,
+ STFA_FORMAT_F24576,
+
+ STFA_FORMAT_F30720,
+ STFA_FORMAT_F32336,
+ STFA_FORMAT_F43885,
+ STFA_FORMAT_F49152
+};
+
+/*--- Types ---*/
+
+typedef struct {
+ unsigned short sound_enable;
+ unsigned short sound_control;
+ unsigned short sound_output;
+ unsigned long sound_start;
+ unsigned long sound_current;
+ unsigned long sound_end;
+ unsigned short version;
+ void *old_vbl;
+ void *old_timera;
+ unsigned long old_mfp_status;
+ void *new_vbl;
+ void *drivers_list;
+ void *play_stop;
+ unsigned short frequency;
+ void *set_frequency;
+ unsigned short frequency_threshold;
+ unsigned short *custom_freq_table;
+ unsigned short stfa_on_off;
+ void *new_drivers_list;
+ unsigned long old_bit_2_of_cookie_snd;
+ void (*stfa_it)(void);
+} cookie_stfa_t;
+
+#endif /* _SDL_mintaudio_stfa_h */
diff --git a/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_xbios.c b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_xbios.c
new file mode 100644
index 0000000..42a0d4a
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/mint/SDL_mintaudio_xbios.c
@@ -0,0 +1,490 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ MiNT audio driver
+ using XBIOS functions (Falcon)
+
+ Patrice Mandin, Didier Méquignon
+*/
+
+#include <unistd.h>
+#include <support.h>
+
+/* Mint includes */
+#include <mint/osbind.h>
+#include <mint/falcon.h>
+#include <mint/cookie.h>
+
+#include "SDL_audio.h"
+#include "../SDL_audio_c.h"
+#include "../SDL_sysaudio.h"
+
+#include "../../video/ataricommon/SDL_atarimxalloc_c.h"
+#include "../../video/ataricommon/SDL_atarisuper.h"
+
+#include "SDL_mintaudio.h"
+#include "SDL_mintaudio_dma8.h"
+
+/*--- Defines ---*/
+
+#define MINT_AUDIO_DRIVER_NAME "mint_xbios"
+
+/* Debug print info */
+#define DEBUG_NAME "audio:xbios: "
+#if 0
+#define DEBUG_PRINT(what) \
+ { \
+ printf what; \
+ }
+#else
+#define DEBUG_PRINT(what)
+#endif
+
+/*--- Static variables ---*/
+
+static long cookie_snd;
+
+/*--- Audio driver functions ---*/
+
+static void Mint_CloseAudio(_THIS);
+static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void Mint_LockAudio(_THIS);
+static void Mint_UnlockAudio(_THIS);
+
+/* To check/init hardware audio */
+static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec);
+static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec);
+
+/*--- Audio driver bootstrap functions ---*/
+
+static int Audio_Available(void)
+{
+/* unsigned long dummy;*/
+ const char *envr = SDL_getenv("SDL_AUDIODRIVER");
+
+ /*SDL_MintAudio_mint_present = (Getcookie(C_MiNT, &dummy) == C_FOUND);*/
+ SDL_MintAudio_mint_present = SDL_FALSE;
+
+ /* We can't use XBIOS in interrupt with Magic, don't know about thread */
+ /*if (Getcookie(C_MagX, &dummy) == C_FOUND) {
+ return(0);
+ }*/
+
+ /* Check if user asked a different audio driver */
+ if ((envr) && (SDL_strcmp(envr, MINT_AUDIO_DRIVER_NAME)!=0)) {
+ DEBUG_PRINT((DEBUG_NAME "user asked a different audio driver\n"));
+ return(0);
+ }
+
+ /* Cookie _SND present ? if not, assume ST machine */
+ if (Getcookie(C__SND, &cookie_snd) == C_NOTFOUND) {
+ cookie_snd = SND_PSG;
+ }
+
+ /* Check if we have 16 bits audio */
+ if ((cookie_snd & SND_16BIT)==0) {
+ DEBUG_PRINT((DEBUG_NAME "no 16 bits sound\n"));
+ return(0);
+ }
+
+ /* Check if audio is lockable */
+ if (Locksnd()!=1) {
+ DEBUG_PRINT((DEBUG_NAME "audio locked by other application\n"));
+ return(0);
+ }
+
+ Unlocksnd();
+
+ DEBUG_PRINT((DEBUG_NAME "XBIOS audio available!\n"));
+ return(1);
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+
+ /* Set the function pointers */
+ this->OpenAudio = Mint_OpenAudio;
+ this->CloseAudio = Mint_CloseAudio;
+ this->LockAudio = Mint_LockAudio;
+ this->UnlockAudio = Mint_UnlockAudio;
+ this->free = Audio_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap MINTAUDIO_XBIOS_bootstrap = {
+ MINT_AUDIO_DRIVER_NAME, "MiNT XBIOS audio driver",
+ Audio_Available, Audio_CreateDevice
+};
+
+static void Mint_LockAudio(_THIS)
+{
+ /* Stop replay */
+ Buffoper(0);
+}
+
+static void Mint_UnlockAudio(_THIS)
+{
+ /* Restart replay */
+ Buffoper(SB_PLA_ENA|SB_PLA_RPT);
+}
+
+static void Mint_CloseAudio(_THIS)
+{
+ /* Stop replay */
+ SDL_MintAudio_WaitThread();
+ Buffoper(0);
+
+ if (!SDL_MintAudio_mint_present) {
+ /* Uninstall interrupt */
+ Jdisint(MFP_DMASOUND);
+ }
+
+ /* Wait if currently playing sound */
+ while (SDL_MintAudio_mutex != 0) {
+ }
+
+ /* Clear buffers */
+ if (SDL_MintAudio_audiobuf[0]) {
+ Mfree(SDL_MintAudio_audiobuf[0]);
+ SDL_MintAudio_audiobuf[0] = SDL_MintAudio_audiobuf[1] = NULL;
+ }
+
+ /* Unlock sound system */
+ Unlocksnd();
+}
+
+/* Falcon XBIOS implementation of Devconnect() is buggy with external clock */
+static void Devconnect2(int src, int dst, int sclk, int pre)
+{
+ static const unsigned short MASK1[3] = { 0, 0x6000, 0 };
+ static const unsigned short MASK2[4] = { 0xFFF0, 0xFF8F, 0xF0FF, 0x0FFF };
+ static const unsigned short INDEX1[4] = { 1, 3, 5, 7 };
+ static const unsigned short INDEX2[4] = { 0, 2, 4, 6 };
+ unsigned short sync_div,dev_ctrl,dest_ctrl;
+ void *oldstack;
+
+ if (dst==0) {
+ return;
+ }
+
+ oldstack=(void *)Super(0);
+
+ dev_ctrl = DMAAUDIO_IO.dev_ctrl;
+ dest_ctrl = DMAAUDIO_IO.dest_ctrl;
+ dev_ctrl &= MASK2[src];
+
+ if (src==ADC) {
+ dev_ctrl |= MASK1[sclk];
+ } else {
+ dev_ctrl |= (INDEX1[sclk] << (src<<4));
+ }
+
+ if (dst & DMAREC) {
+ dest_ctrl &= 0xFFF0;
+ dest_ctrl |= INDEX1[src];
+ }
+
+ if (dst & DSPRECV) {
+ dest_ctrl &= 0xFF8F;
+ dest_ctrl |= (INDEX1[src]<<4);
+ }
+
+ if (dst & EXTOUT) {
+ dest_ctrl &= 0xF0FF;
+ dest_ctrl |= (INDEX1[src]<<8);
+ }
+
+ if (dst & DAC) {
+ dev_ctrl &= 0x0FFF;
+ dev_ctrl |= MASK1[sclk];
+ dest_ctrl &= 0x0FFF;
+ dest_ctrl |= (INDEX2[src]<<12);
+ }
+
+ sync_div = DMAAUDIO_IO.sync_div;
+ if (sclk==CLKEXT) {
+ pre<<=8;
+ sync_div &= 0xF0FF;
+ } else {
+ sync_div &= 0xFFF0;
+ }
+ sync_div |= pre;
+
+ DMAAUDIO_IO.dev_ctrl = dev_ctrl;
+ DMAAUDIO_IO.dest_ctrl = dest_ctrl;
+ DMAAUDIO_IO.sync_div = sync_div;
+
+ SuperToUser(oldstack);
+}
+
+static void Mint_CheckExternalClock(_THIS)
+{
+#define SIZE_BUF_CLOCK_MEASURE (44100/10)
+
+ char *buffer;
+ int i, j;
+
+ /* DSP present with its GPIO port ? */
+ if ((cookie_snd & SND_DSP)==0) {
+ return;
+ }
+
+ buffer = Atari_SysMalloc(SIZE_BUF_CLOCK_MEASURE, MX_STRAM);
+ if (buffer==NULL) {
+ DEBUG_PRINT((DEBUG_NAME "Not enough memory for the measure\n"));
+ return;
+ }
+ SDL_memset(buffer, 0, SIZE_BUF_CLOCK_MEASURE);
+
+ Buffoper(0);
+ Settracks(0,0);
+ Setmontracks(0);
+ Setmode(MONO8);
+ Jdisint(MFP_TIMERA);
+
+ for (i=0; i<2; i++) {
+ Gpio(GPIO_SET,7); /* DSP port gpio outputs */
+ Gpio(GPIO_WRITE,2+i); /* 22.5792/24.576 MHz for 44.1/48KHz */
+ Devconnect2(DMAPLAY, DAC, CLKEXT, CLK50K); /* Matrix and clock source */
+ Setbuffer(0, buffer, buffer + SIZE_BUF_CLOCK_MEASURE); /* Set buffer */
+ Xbtimer(XB_TIMERA, 5, 38, SDL_MintAudio_XbiosInterruptMeasureClock); /* delay mode timer A, prediv /64, 1KHz */
+ Jenabint(MFP_TIMERA);
+ SDL_MintAudio_clocktics = 0;
+ Buffoper(SB_PLA_ENA);
+ usleep(110000);
+
+ if((Buffoper(-1) & 1)==0) {
+ if (SDL_MintAudio_clocktics) {
+ unsigned long khz;
+
+ khz = ((SIZE_BUF_CLOCK_MEASURE/SDL_MintAudio_clocktics) +1) & 0xFFFFFFFE;
+ DEBUG_PRINT((DEBUG_NAME "measure %d: freq=%lu KHz\n", i+1, khz));
+
+ if(khz==44) {
+ for (j=1; j<4; j++) {
+ SDL_MintAudio_AddFrequency(this, MASTERCLOCK_44K/(MASTERPREDIV_FALCON*(1<<j)), MASTERCLOCK_44K, (1<<j)-1, 2+i);
+ }
+ } else if (khz==48) {
+ for (j=1; j<4; j++) {
+ SDL_MintAudio_AddFrequency(this, MASTERCLOCK_48K/(MASTERPREDIV_FALCON*(1<<j)), MASTERCLOCK_48K, (1<<j)-1, 2+i);
+ }
+ }
+ } else {
+ DEBUG_PRINT((DEBUG_NAME "No measure\n"));
+ }
+ } else {
+ DEBUG_PRINT((DEBUG_NAME "No SDMA clock\n"));
+ }
+
+ Buffoper(0); /* stop */
+ Jdisint(MFP_TIMERA); /* Uninstall interrupt */
+ }
+
+ Mfree(buffer);
+}
+
+static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
+{
+ int i;
+
+ DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff));
+ DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
+ DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
+ DEBUG_PRINT(("channels=%d, ", spec->channels));
+ DEBUG_PRINT(("freq=%d\n", spec->freq));
+
+ if (spec->channels > 2) {
+ spec->channels = 2; /* no more than stereo! */
+ }
+
+ spec->format |= 0x8000; /* Audio is always signed */
+ if ((spec->format & 0x00ff)==16) {
+ spec->format |= 0x1000; /* Audio is always big endian */
+ spec->channels=2; /* 16 bits always stereo */
+ }
+
+ MINTAUDIO_freqcount=0;
+
+ /* Add external clocks if present */
+ Mint_CheckExternalClock(this);
+
+ /* Standard clocks */
+ for (i=1;i<12;i++) {
+ /* Remove unusable Falcon codec predivisors */
+ if ((i==6) || (i==8) || (i==10)) {
+ continue;
+ }
+ SDL_MintAudio_AddFrequency(this, MASTERCLOCK_FALCON1/(MASTERPREDIV_FALCON*(i+1)), MASTERCLOCK_FALCON1, i, -1);
+ }
+
+#if 1
+ for (i=0; i<MINTAUDIO_freqcount; i++) {
+ DEBUG_PRINT((DEBUG_NAME "freq %d: %lu Hz, clock %lu, prediv %d\n",
+ i, MINTAUDIO_frequencies[i].frequency, MINTAUDIO_frequencies[i].masterclock,
+ MINTAUDIO_frequencies[i].predivisor
+ ));
+ }
+#endif
+
+ MINTAUDIO_numfreq=SDL_MintAudio_SearchFrequency(this, spec->freq);
+ spec->freq=MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
+
+ DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",spec->format & 0x00ff));
+ DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
+ DEBUG_PRINT(("big endian=%d, ", ((spec->format & 0x1000)!=0)));
+ DEBUG_PRINT(("channels=%d, ", spec->channels));
+ DEBUG_PRINT(("freq=%d\n", spec->freq));
+
+ return 0;
+}
+
+static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec)
+{
+ int channels_mode, prediv;
+ void *buffer;
+
+ /* Stop currently playing sound */
+ SDL_MintAudio_quit_thread = SDL_FALSE;
+ SDL_MintAudio_thread_finished = SDL_TRUE;
+ SDL_MintAudio_WaitThread();
+ Buffoper(0);
+
+ /* Set replay tracks */
+ Settracks(0,0);
+ Setmontracks(0);
+
+ /* Select replay format */
+ channels_mode=STEREO16;
+ switch (spec->format & 0xff) {
+ case 8:
+ if (spec->channels==2) {
+ channels_mode=STEREO8;
+ } else {
+ channels_mode=MONO8;
+ }
+ break;
+ }
+ if (Setmode(channels_mode)<0) {
+ DEBUG_PRINT((DEBUG_NAME "Setmode() failed\n"));
+ }
+
+ prediv = MINTAUDIO_frequencies[MINTAUDIO_numfreq].predivisor;
+ if (MINTAUDIO_frequencies[MINTAUDIO_numfreq].gpio_bits != -1) {
+ Gpio(GPIO_SET,7); /* DSP port gpio outputs */
+ Gpio(GPIO_WRITE, MINTAUDIO_frequencies[MINTAUDIO_numfreq].gpio_bits);
+ Devconnect2(DMAPLAY, DAC|EXTOUT, CLKEXT, prediv);
+ } else {
+ Devconnect2(DMAPLAY, DAC, CLK25M, prediv);
+ }
+
+ /* Set buffer */
+ buffer = SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf];
+ if (Setbuffer(0, buffer, buffer + spec->size)<0) {
+ DEBUG_PRINT((DEBUG_NAME "Setbuffer() failed\n"));
+ }
+
+ if (SDL_MintAudio_mint_present) {
+ SDL_MintAudio_thread_pid = tfork(SDL_MintAudio_Thread, 0);
+ } else {
+ /* Install interrupt */
+ Jdisint(MFP_DMASOUND);
+ /*Xbtimer(XB_TIMERA, 8, 1, SDL_MintAudio_XbiosInterrupt);*/
+ Xbtimer(XB_TIMERA, 8, 1, SDL_MintAudio_Dma8Interrupt);
+ Jenabint(MFP_DMASOUND);
+
+ if (Setinterrupt(SI_TIMERA, SI_PLAY)<0) {
+ DEBUG_PRINT((DEBUG_NAME "Setinterrupt() failed\n"));
+ }
+ }
+
+ /* Go */
+ Buffoper(SB_PLA_ENA|SB_PLA_RPT);
+ DEBUG_PRINT((DEBUG_NAME "hardware initialized\n"));
+}
+
+static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ /* Lock sound system */
+ if (Locksnd()!=1) {
+ SDL_SetError("Mint_OpenAudio: Audio system already in use");
+ return(-1);
+ }
+
+ SDL_MintAudio_device = this;
+
+ /* Check audio capabilities */
+ if (Mint_CheckAudio(this, spec)==-1) {
+ return -1;
+ }
+
+ SDL_CalculateAudioSpec(spec);
+
+ /* Allocate memory for audio buffers in DMA-able RAM */
+ DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", spec->size));
+
+ SDL_MintAudio_audiobuf[0] = Atari_SysMalloc(spec->size *2, MX_STRAM);
+ if (SDL_MintAudio_audiobuf[0]==NULL) {
+ SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer");
+ return (-1);
+ }
+ SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + spec->size ;
+ SDL_MintAudio_numbuf=0;
+ SDL_memset(SDL_MintAudio_audiobuf[0], spec->silence, spec->size *2);
+ SDL_MintAudio_audiosize = spec->size;
+ SDL_MintAudio_mutex = 0;
+
+ DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n", SDL_MintAudio_audiobuf[0]));
+ DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n", SDL_MintAudio_audiobuf[1]));
+
+ SDL_MintAudio_CheckFpu();
+
+ /* Setup audio hardware */
+ Mint_InitAudio(this, spec);
+
+ return(1); /* We don't use SDL threaded audio */
+}
diff --git a/distrib/sdl-1.2.15/src/audio/mme/SDL_mmeaudio.c b/distrib/sdl-1.2.15/src/audio/mme/SDL_mmeaudio.c
new file mode 100644
index 0000000..64a0ecc
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/mme/SDL_mmeaudio.c
@@ -0,0 +1,264 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Tru64 UNIX MME support */
+#include <mme_api.h>
+
+#include "SDL_timer.h"
+#include "SDL_audio.h"
+#include "../SDL_audio_c.h"
+#include "SDL_mmeaudio.h"
+
+static BOOL inUse[NUM_BUFFERS];
+
+/* Audio driver functions */
+static int MME_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void MME_WaitAudio(_THIS);
+static Uint8 *MME_GetAudioBuf(_THIS);
+static void MME_PlayAudio(_THIS);
+static void MME_WaitDone(_THIS);
+static void MME_CloseAudio(_THIS);
+
+/* Audio driver bootstrap functions */
+static int Audio_Available(void)
+{
+ return(1);
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ if ( device ) {
+ if ( device->hidden ) {
+ SDL_free(device->hidden);
+ device->hidden = NULL;
+ }
+ SDL_free(device);
+ device = NULL;
+ }
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+/* Initialize all variables that we clean on shutdown */
+ this = SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+ /* Set the function pointers */
+ this->OpenAudio = MME_OpenAudio;
+ this->WaitAudio = MME_WaitAudio;
+ this->PlayAudio = MME_PlayAudio;
+ this->GetAudioBuf = MME_GetAudioBuf;
+ this->WaitDone = MME_WaitDone;
+ this->CloseAudio = MME_CloseAudio;
+ this->free = Audio_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap MMEAUDIO_bootstrap = {
+ "waveout", "Tru64 MME WaveOut",
+ Audio_Available, Audio_CreateDevice
+};
+
+static void SetMMerror(char *function, MMRESULT code)
+{
+ int len;
+ char errbuf[MAXERRORLENGTH];
+
+ SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: ", function);
+ len = SDL_strlen(errbuf);
+ waveOutGetErrorText(code, errbuf+len, MAXERRORLENGTH-len);
+ SDL_SetError("%s",errbuf);
+}
+
+static void CALLBACK MME_CALLBACK(HWAVEOUT hwo,
+ UINT uMsg,
+ DWORD dwInstance,
+ LPARAM dwParam1,
+ LPARAM dwParam2)
+{
+ WAVEHDR *wp = (WAVEHDR *) dwParam1;
+
+ if ( uMsg == WOM_DONE )
+ inUse[wp->dwUser] = FALSE;
+}
+
+static int MME_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ MMRESULT result;
+ int i;
+
+ mixbuf = NULL;
+
+ /* Set basic WAVE format parameters */
+ shm = mmeAllocMem(sizeof(*shm));
+ if ( shm == NULL ) {
+ SDL_SetError("Out of memory: shm");
+ return(-1);
+ }
+ shm->sound = 0;
+ shm->wFmt.wf.wFormatTag = WAVE_FORMAT_PCM;
+
+ /* Determine the audio parameters from the AudioSpec */
+ switch ( spec->format & 0xFF ) {
+ case 8:
+ /* Unsigned 8 bit audio data */
+ spec->format = AUDIO_U8;
+ shm->wFmt.wBitsPerSample = 8;
+ break;
+ case 16:
+ /* Signed 16 bit audio data */
+ spec->format = AUDIO_S16;
+ shm->wFmt.wBitsPerSample = 16;
+ break;
+ default:
+ SDL_SetError("Unsupported audio format");
+ return(-1);
+ }
+
+ shm->wFmt.wf.nChannels = spec->channels;
+ shm->wFmt.wf.nSamplesPerSec = spec->freq;
+ shm->wFmt.wf.nBlockAlign =
+ shm->wFmt.wf.nChannels * shm->wFmt.wBitsPerSample / 8;
+ shm->wFmt.wf.nAvgBytesPerSec =
+ shm->wFmt.wf.nSamplesPerSec * shm->wFmt.wf.nBlockAlign;
+
+ /* Check the buffer size -- minimum of 1/4 second (word aligned) */
+ if ( spec->samples < (spec->freq/4) )
+ spec->samples = ((spec->freq/4)+3)&~3;
+
+ /* Update the fragment size as size in bytes */
+ SDL_CalculateAudioSpec(spec);
+
+ /* Open the audio device */
+ result = waveOutOpen(&(shm->sound),
+ WAVE_MAPPER,
+ &(shm->wFmt.wf),
+ MME_CALLBACK,
+ NULL,
+ (CALLBACK_FUNCTION|WAVE_OPEN_SHAREABLE));
+ if ( result != MMSYSERR_NOERROR ) {
+ SetMMerror("waveOutOpen()", result);
+ return(-1);
+ }
+
+ /* Create the sound buffers */
+ mixbuf = (Uint8 *)mmeAllocBuffer(NUM_BUFFERS * (spec->size));
+ if ( mixbuf == NULL ) {
+ SDL_SetError("Out of memory: mixbuf");
+ return(-1);
+ }
+
+ for (i = 0; i < NUM_BUFFERS; i++) {
+ shm->wHdr[i].lpData = &mixbuf[i * (spec->size)];
+ shm->wHdr[i].dwBufferLength = spec->size;
+ shm->wHdr[i].dwFlags = 0;
+ shm->wHdr[i].dwUser = i;
+ shm->wHdr[i].dwLoops = 0; /* loop control counter */
+ shm->wHdr[i].lpNext = NULL; /* reserved for driver */
+ shm->wHdr[i].reserved = 0;
+ inUse[i] = FALSE;
+ }
+ next_buffer = 0;
+ return 0;
+}
+
+static void MME_WaitAudio(_THIS)
+{
+ while ( inUse[next_buffer] ) {
+ mmeWaitForCallbacks();
+ mmeProcessCallbacks();
+ }
+}
+
+static Uint8 *MME_GetAudioBuf(_THIS)
+{
+ Uint8 *retval;
+
+ inUse[next_buffer] = TRUE;
+ retval = (Uint8 *)(shm->wHdr[next_buffer].lpData);
+ return retval;
+}
+
+static void MME_PlayAudio(_THIS)
+{
+ /* Queue it up */
+ waveOutWrite(shm->sound, &(shm->wHdr[next_buffer]), sizeof(WAVEHDR));
+ next_buffer = (next_buffer+1)%NUM_BUFFERS;
+}
+
+static void MME_WaitDone(_THIS)
+{
+ MMRESULT result;
+ int i;
+
+ if ( shm->sound ) {
+ for (i = 0; i < NUM_BUFFERS; i++)
+ while ( inUse[i] ) {
+ mmeWaitForCallbacks();
+ mmeProcessCallbacks();
+ }
+ result = waveOutReset(shm->sound);
+ if ( result != MMSYSERR_NOERROR )
+ SetMMerror("waveOutReset()", result);
+ mmeProcessCallbacks();
+ }
+}
+
+static void MME_CloseAudio(_THIS)
+{
+ MMRESULT result;
+
+ if ( mixbuf ) {
+ result = mmeFreeBuffer(mixbuf);
+ if (result != MMSYSERR_NOERROR )
+ SetMMerror("mmeFreeBuffer", result);
+ mixbuf = NULL;
+ }
+
+ if ( shm ) {
+ if ( shm->sound ) {
+ result = waveOutClose(shm->sound);
+ if (result != MMSYSERR_NOERROR )
+ SetMMerror("waveOutClose()", result);
+ mmeProcessCallbacks();
+ }
+ result = mmeFreeMem(shm);
+ if (result != MMSYSERR_NOERROR )
+ SetMMerror("mmeFreeMem()", result);
+ shm = NULL;
+ }
+}
+
diff --git a/distrib/sdl-1.2.15/src/audio/mme/SDL_mmeaudio.h b/distrib/sdl-1.2.15/src/audio/mme/SDL_mmeaudio.h
new file mode 100644
index 0000000..6bfaed3
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/mme/SDL_mmeaudio.h
@@ -0,0 +1,51 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Allow access to a raw mixing buffer */
+
+#ifndef _SDL_lowaudio_h
+#define _SDL_lowaudio_h
+
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_AudioDevice *this
+#define NUM_BUFFERS 2
+
+struct SharedMem {
+ HWAVEOUT sound;
+ WAVEHDR wHdr[NUM_BUFFERS];
+ PCMWAVEFORMAT wFmt;
+};
+
+struct SDL_PrivateAudioData {
+ Uint8 *mixbuf; /* The raw allocated mixing buffer */
+ struct SharedMem *shm;
+ int next_buffer;
+};
+
+#define shm (this->hidden->shm)
+#define mixbuf (this->hidden->mixbuf)
+#define next_buffer (this->hidden->next_buffer)
+/* Old variable names */
+#endif /* _SDL_lowaudio_h */
diff --git a/distrib/sdl-1.2.15/src/audio/nas/SDL_nasaudio.c b/distrib/sdl-1.2.15/src/audio/nas/SDL_nasaudio.c
new file mode 100644
index 0000000..a561e62
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/nas/SDL_nasaudio.c
@@ -0,0 +1,423 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ This driver was written by:
+ Erik Inge Bolsø
+ knan@mo.himolde.no
+*/
+#include "SDL_config.h"
+
+/* Allow access to a raw mixing buffer */
+
+#include <signal.h>
+#include <unistd.h>
+
+#include "SDL_timer.h"
+#include "SDL_audio.h"
+#include "../SDL_audiomem.h"
+#include "../SDL_audio_c.h"
+#include "../SDL_audiodev_c.h"
+#include "SDL_nasaudio.h"
+
+#ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC
+#include "SDL_loadso.h"
+#endif
+
+/* The tag name used by artsc audio */
+#define NAS_DRIVER_NAME "nas"
+
+static struct SDL_PrivateAudioData *this2 = NULL;
+
+static void (*NAS_AuCloseServer) (AuServer *);
+static void (*NAS_AuNextEvent) (AuServer *, AuBool, AuEvent *);
+static AuBool(*NAS_AuDispatchEvent) (AuServer *, AuEvent *);
+static AuFlowID(*NAS_AuCreateFlow) (AuServer *, AuStatus *);
+static void (*NAS_AuStartFlow) (AuServer *, AuFlowID, AuStatus *);
+static void (*NAS_AuSetElements)
+ (AuServer *, AuFlowID, AuBool, int, AuElement *, AuStatus *);
+static void (*NAS_AuWriteElement)
+ (AuServer *, AuFlowID, int, AuUint32, AuPointer, AuBool, AuStatus *);
+static AuServer *(*NAS_AuOpenServer)
+ (_AuConst char *, int, _AuConst char *, int, _AuConst char *, char **);
+static AuEventHandlerRec *(*NAS_AuRegisterEventHandler)
+ (AuServer *, AuMask, int, AuID, AuEventHandlerCallback, AuPointer);
+
+
+#ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC
+
+static const char *nas_library = SDL_AUDIO_DRIVER_NAS_DYNAMIC;
+static void *nas_handle = NULL;
+
+static int
+load_nas_sym(const char *fn, void **addr)
+{
+ *addr = SDL_LoadFunction(nas_handle, fn);
+ if (*addr == NULL) {
+ return 0;
+ }
+ return 1;
+}
+
+/* cast funcs to char* first, to please GCC's strict aliasing rules. */
+#define SDL_NAS_SYM(x) \
+ if (!load_nas_sym(#x, (void **) (char *) &NAS_##x)) return -1
+#else
+#define SDL_NAS_SYM(x) NAS_##x = x
+#endif
+
+static int
+load_nas_syms(void)
+{
+ SDL_NAS_SYM(AuCloseServer);
+ SDL_NAS_SYM(AuNextEvent);
+ SDL_NAS_SYM(AuDispatchEvent);
+ SDL_NAS_SYM(AuCreateFlow);
+ SDL_NAS_SYM(AuStartFlow);
+ SDL_NAS_SYM(AuSetElements);
+ SDL_NAS_SYM(AuWriteElement);
+ SDL_NAS_SYM(AuOpenServer);
+ SDL_NAS_SYM(AuRegisterEventHandler);
+ return 0;
+}
+
+#undef SDL_NAS_SYM
+
+#ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC
+
+static void
+UnloadNASLibrary(void)
+{
+ if (nas_handle != NULL) {
+ SDL_UnloadObject(nas_handle);
+ nas_handle = NULL;
+ }
+}
+
+static int
+LoadNASLibrary(void)
+{
+ int retval = 0;
+ if (nas_handle == NULL) {
+ nas_handle = SDL_LoadObject(nas_library);
+ if (nas_handle == NULL) {
+ /* Copy error string so we can use it in a new SDL_SetError(). */
+ char *origerr = SDL_GetError();
+ size_t len = SDL_strlen(origerr) + 1;
+ char *err = (char *) alloca(len);
+ SDL_strlcpy(err, origerr, len);
+ retval = -1;
+ SDL_SetError("NAS: SDL_LoadObject('%s') failed: %s\n",
+ nas_library, err);
+ } else {
+ retval = load_nas_syms();
+ if (retval < 0) {
+ UnloadNASLibrary();
+ }
+ }
+ }
+ return retval;
+}
+
+#else
+
+static void
+UnloadNASLibrary(void)
+{
+}
+
+static int
+LoadNASLibrary(void)
+{
+ load_nas_syms();
+ return 0;
+}
+
+#endif /* SDL_AUDIO_DRIVER_NAS_DYNAMIC */
+
+
+/* Audio driver functions */
+static int NAS_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void NAS_WaitAudio(_THIS);
+static void NAS_PlayAudio(_THIS);
+static Uint8 *NAS_GetAudioBuf(_THIS);
+static void NAS_CloseAudio(_THIS);
+
+/* Audio driver bootstrap functions */
+
+static int Audio_Available(void)
+{
+ if (LoadNASLibrary() == 0) {
+ AuServer *aud = NAS_AuOpenServer("", 0, NULL, 0, NULL, NULL);
+ if (!aud) {
+ UnloadNASLibrary();
+ return 0;
+ }
+ NAS_AuCloseServer(aud);
+ UnloadNASLibrary();
+ return 1;
+ }
+ return 0;
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ UnloadNASLibrary();
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ if (LoadNASLibrary() < 0) {
+ return NULL;
+ }
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return NULL;
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+
+ /* Set the function pointers */
+ this->OpenAudio = NAS_OpenAudio;
+ this->WaitAudio = NAS_WaitAudio;
+ this->PlayAudio = NAS_PlayAudio;
+ this->GetAudioBuf = NAS_GetAudioBuf;
+ this->CloseAudio = NAS_CloseAudio;
+
+ this->free = Audio_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap NAS_bootstrap = {
+ NAS_DRIVER_NAME, "Network Audio System",
+ Audio_Available, Audio_CreateDevice
+};
+
+/* This function waits until it is possible to write a full sound buffer */
+static void NAS_WaitAudio(_THIS)
+{
+ while ( this->hidden->buf_free < this->hidden->mixlen ) {
+ AuEvent ev;
+ NAS_AuNextEvent(this->hidden->aud, AuTrue, &ev);
+ NAS_AuDispatchEvent(this->hidden->aud, &ev);
+ }
+}
+
+static void NAS_PlayAudio(_THIS)
+{
+ while (this->hidden->mixlen > this->hidden->buf_free) { /* We think the buffer is full? Yikes! Ask the server for events,
+ in the hope that some of them is LowWater events telling us more
+ of the buffer is free now than what we think. */
+ AuEvent ev;
+ NAS_AuNextEvent(this->hidden->aud, AuTrue, &ev);
+ NAS_AuDispatchEvent(this->hidden->aud, &ev);
+ }
+ this->hidden->buf_free -= this->hidden->mixlen;
+
+ /* Write the audio data */
+ NAS_AuWriteElement(this->hidden->aud, this->hidden->flow, 0, this->hidden->mixlen, this->hidden->mixbuf, AuFalse, NULL);
+
+ this->hidden->written += this->hidden->mixlen;
+
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Wrote %d bytes of audio data\n", this->hidden->mixlen);
+#endif
+}
+
+static Uint8 *NAS_GetAudioBuf(_THIS)
+{
+ return(this->hidden->mixbuf);
+}
+
+static void NAS_CloseAudio(_THIS)
+{
+ if ( this->hidden->mixbuf != NULL ) {
+ SDL_FreeAudioMem(this->hidden->mixbuf);
+ this->hidden->mixbuf = NULL;
+ }
+ if ( this->hidden->aud ) {
+ NAS_AuCloseServer(this->hidden->aud);
+ this->hidden->aud = 0;
+ }
+}
+
+static unsigned char sdlformat_to_auformat(unsigned int fmt)
+{
+ switch (fmt)
+ {
+ case AUDIO_U8:
+ return AuFormatLinearUnsigned8;
+ case AUDIO_S8:
+ return AuFormatLinearSigned8;
+ case AUDIO_U16LSB:
+ return AuFormatLinearUnsigned16LSB;
+ case AUDIO_U16MSB:
+ return AuFormatLinearUnsigned16MSB;
+ case AUDIO_S16LSB:
+ return AuFormatLinearSigned16LSB;
+ case AUDIO_S16MSB:
+ return AuFormatLinearSigned16MSB;
+ }
+ return AuNone;
+}
+
+static AuBool
+event_handler(AuServer* aud, AuEvent* ev, AuEventHandlerRec* hnd)
+{
+ switch (ev->type) {
+ case AuEventTypeElementNotify: {
+ AuElementNotifyEvent* event = (AuElementNotifyEvent *)ev;
+
+ switch (event->kind) {
+ case AuElementNotifyKindLowWater:
+ if (this2->buf_free >= 0) {
+ this2->really += event->num_bytes;
+ gettimeofday(&this2->last_tv, 0);
+ this2->buf_free += event->num_bytes;
+ } else {
+ this2->buf_free = event->num_bytes;
+ }
+ break;
+ case AuElementNotifyKindState:
+ switch (event->cur_state) {
+ case AuStatePause:
+ if (event->reason != AuReasonUser) {
+ if (this2->buf_free >= 0) {
+ this2->really += event->num_bytes;
+ gettimeofday(&this2->last_tv, 0);
+ this2->buf_free += event->num_bytes;
+ } else {
+ this2->buf_free = event->num_bytes;
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+ return AuTrue;
+}
+
+static AuDeviceID
+find_device(_THIS, int nch)
+{
+ /* These "Au" things are all macros, not functions... */
+ int i;
+ for (i = 0; i < AuServerNumDevices(this->hidden->aud); i++) {
+ if ((AuDeviceKind(AuServerDevice(this->hidden->aud, i)) ==
+ AuComponentKindPhysicalOutput) &&
+ AuDeviceNumTracks(AuServerDevice(this->hidden->aud, i)) == nch) {
+ return AuDeviceIdentifier(AuServerDevice(this->hidden->aud, i));
+ }
+ }
+ return AuNone;
+}
+
+static int NAS_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ AuElement elms[3];
+ int buffer_size;
+ Uint16 test_format, format;
+
+ this->hidden->mixbuf = NULL;
+
+ /* Try for a closest match on audio format */
+ format = 0;
+ for ( test_format = SDL_FirstAudioFormat(spec->format);
+ ! format && test_format; ) {
+ format = sdlformat_to_auformat(test_format);
+
+ if (format == AuNone) {
+ test_format = SDL_NextAudioFormat();
+ }
+ }
+ if ( format == 0 ) {
+ SDL_SetError("Couldn't find any hardware audio formats");
+ return(-1);
+ }
+ spec->format = test_format;
+
+ this->hidden->aud = NAS_AuOpenServer("", 0, NULL, 0, NULL, NULL);
+ if (this->hidden->aud == 0)
+ {
+ SDL_SetError("Couldn't open connection to NAS server");
+ return (-1);
+ }
+
+ this->hidden->dev = find_device(this, spec->channels);
+ if ((this->hidden->dev == AuNone) || (!(this->hidden->flow = NAS_AuCreateFlow(this->hidden->aud, NULL)))) {
+ NAS_AuCloseServer(this->hidden->aud);
+ this->hidden->aud = 0;
+ SDL_SetError("Couldn't find a fitting playback device on NAS server");
+ return (-1);
+ }
+
+ buffer_size = spec->freq;
+ if (buffer_size < 4096)
+ buffer_size = 4096;
+
+ if (buffer_size > 32768)
+ buffer_size = 32768; /* So that the buffer won't get unmanageably big. */
+
+ /* Calculate the final parameters for this audio specification */
+ SDL_CalculateAudioSpec(spec);
+
+ this2 = this->hidden;
+
+ /* These "Au" things without a NAS_ prefix are macros, not functions... */
+ AuMakeElementImportClient(elms, spec->freq, format, spec->channels, AuTrue,
+ buffer_size, buffer_size / 4, 0, NULL);
+ AuMakeElementExportDevice(elms+1, 0, this->hidden->dev, spec->freq,
+ AuUnlimitedSamples, 0, NULL);
+ NAS_AuSetElements(this->hidden->aud, this->hidden->flow, AuTrue, 2, elms, NULL);
+ NAS_AuRegisterEventHandler(this->hidden->aud, AuEventHandlerIDMask, 0, this->hidden->flow,
+ event_handler, (AuPointer) NULL);
+
+ NAS_AuStartFlow(this->hidden->aud, this->hidden->flow, NULL);
+
+ /* Allocate mixing buffer */
+ this->hidden->mixlen = spec->size;
+ this->hidden->mixbuf = (Uint8 *)SDL_AllocAudioMem(this->hidden->mixlen);
+ if ( this->hidden->mixbuf == NULL ) {
+ return(-1);
+ }
+ SDL_memset(this->hidden->mixbuf, spec->silence, spec->size);
+
+ /* Get the parent process id (we're the parent of the audio thread) */
+ this->hidden->parent = getpid();
+
+ /* We're ready to rock and roll. :-) */
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/src/audio/nas/SDL_nasaudio.h b/distrib/sdl-1.2.15/src/audio/nas/SDL_nasaudio.h
new file mode 100644
index 0000000..1c09630
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/nas/SDL_nasaudio.h
@@ -0,0 +1,62 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ This driver was written by:
+ Erik Inge Bolsø
+ knan@mo.himolde.no
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_nasaudio_h
+#define _SDL_nasaudio_h
+
+#ifdef __sgi
+#include <nas/audiolib.h>
+#else
+#include <audio/audiolib.h>
+#endif
+#include <sys/time.h>
+
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_AudioDevice *this
+
+struct SDL_PrivateAudioData {
+ AuServer* aud;
+ AuFlowID flow;
+ AuDeviceID dev;
+
+ /* The parent process id, to detect when application quits */
+ pid_t parent;
+
+ /* Raw mixing buffer */
+ Uint8 *mixbuf;
+ int mixlen;
+
+ int written;
+ int really;
+ int bps;
+ struct timeval last_tv;
+ int buf_free;
+};
+#endif /* _SDL_nasaudio_h */
+
diff --git a/distrib/sdl-1.2.15/src/audio/nds/SDL_ndsaudio.c b/distrib/sdl-1.2.15/src/audio/nds/SDL_ndsaudio.c
new file mode 100644
index 0000000..afe141a
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/nds/SDL_ndsaudio.c
@@ -0,0 +1,335 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Allow access to a raw mixing buffer */
+#include <nds.h>
+#include "SDL.h"
+#include "SDL_endian.h"
+#include "SDL_timer.h"
+#include "SDL_audio.h"
+#include "../SDL_audiomem.h"
+#include "../SDL_audio_c.h"
+#include "SDL_ndsaudio.h"
+#include "soundcommon.h"
+
+
+/* Audio driver functions */
+static int NDS_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void NDS_WaitAudio(_THIS);
+static void NDS_PlayAudio(_THIS);
+static Uint8 *NDS_GetAudioBuf(_THIS);
+static void NDS_CloseAudio(_THIS);
+
+/* Audio driver bootstrap functions */
+
+u32 framecounter = 0,soundoffset = 0;
+static SDL_AudioDevice *sdl_nds_audiodevice;
+
+//void SoundMixCallback(void *stream,u32 size)
+//{
+// //printf("SoundMixCallback\n");
+//
+// Uint8 *buffer;
+//
+// buffer = sdl_nds_audiodevice->hidden->mixbuf;
+// memset(buffer, sdl_nds_audiodevice->spec.silence, size);
+//
+// if (!sdl_nds_audiodevice->paused){
+//
+//
+// //if (sdl_nds_audiodevice->convert.needed) {
+// // int silence;
+//
+// // if (sdl_nds_audiodevice->convert.src_format == AUDIO_U8 ) {
+// // silence = 0x80;
+// // } else {
+// // silence = 0;
+// // }
+// // memset(sdl_nds_audiodevice->convert.buf, silence, sdl_nds_audiodevice->convert.len);
+// // sdl_nds_audiodevice->spec.callback(sdl_nds_audiodevice->spec.userdata,
+// // (Uint8 *)sdl_nds_audiodevice->convert.buf,sdl_nds_audiodevice->convert.len);
+// // SDL_ConvertAudio(&sdl_nds_audiodevice->convert);
+// // memcpy(buffer, sdl_nds_audiodevice->convert.buf, sdl_nds_audiodevice->convert.len_cvt);
+// //} else
+// {
+// sdl_nds_audiodevice->spec.callback(sdl_nds_audiodevice->spec.userdata, buffer, size);
+// //memcpy((Sint16 *)stream,buffer, size);
+// }
+//
+// }
+//
+// if(soundsystem->format == 8)
+// {
+// int i;
+// s32 *buffer32 = (s32 *)buffer;
+// s32 *stream32 = (s32 *)stream;
+// for(i=0;i<size/4;i++){ *stream32++ = buffer32[i] ^ 0x80808080;}
+// //for(i = 0; i < size; i++)
+// // ((s8*)stream)[i]=(buffer[i]^0x80);
+// }
+// else
+// {
+// int i;
+// for(i = 0; i < size; i++){
+// //((short*)stream)[i] =(short)buffer[i] << 8; // sound 8bit ---> buffer 16bit
+// //if (buffer[i] &0x80)
+// //((Sint16*)stream)[i] = 0xff00 | buffer[i];
+// ((Sint16*)stream)[i] = (buffer[i] - 128) << 8;
+//
+// //else
+// // ((Sint16*)stream)[i] = buffer[i];
+// }
+// //register signed char *pSrc =buffer;
+// //register short *pDest =stream;
+// //int x;
+// // for (x=size; x>0; x--)
+// // {
+// // register short temp = (((short)*pSrc)-128)<<8;
+// // pSrc++;
+// // *pDest++ = temp;
+// // }
+//
+// //memcpy((Sint16 *)stream,buffer, size);
+// }
+//}
+
+void SoundMixCallback(void *stream,u32 len)
+{
+ SDL_AudioDevice *audio = (SDL_AudioDevice *)sdl_nds_audiodevice;
+
+ /* Silence the buffer, since it's ours */
+ SDL_memset(stream, audio->spec.silence, len);
+
+ /* Only do soemthing if audio is enabled */
+ if ( ! audio->enabled )
+ return;
+
+ if ( ! audio->paused ) {
+ if ( audio->convert.needed ) {
+ //fprintf(stderr,"converting audio\n");
+ SDL_mutexP(audio->mixer_lock);
+ (*audio->spec.callback)(audio->spec.userdata,
+ (Uint8 *)audio->convert.buf,audio->convert.len);
+ SDL_mutexV(audio->mixer_lock);
+ SDL_ConvertAudio(&audio->convert);
+ SDL_memcpy(stream,audio->convert.buf,audio->convert.len_cvt);
+ } else {
+ SDL_mutexP(audio->mixer_lock);
+ (*audio->spec.callback)(audio->spec.userdata,
+ (Uint8 *)stream, len);
+ SDL_mutexV(audio->mixer_lock);
+ }
+ }
+ return;
+}
+void MixSound(void)
+{
+ int remain;
+
+ if(soundsystem->format == 8)
+ {
+ if((soundsystem->soundcursor + soundsystem->numsamples) > soundsystem->buffersize)
+ {
+ SoundMixCallback(&soundsystem->mixbuffer[soundsystem->soundcursor],soundsystem->buffersize - soundsystem->soundcursor);
+ remain = soundsystem->numsamples - (soundsystem->buffersize - soundsystem->soundcursor);
+ SoundMixCallback(soundsystem->mixbuffer,remain);
+ }
+ else
+ {
+ SoundMixCallback(&soundsystem->mixbuffer[soundsystem->soundcursor],soundsystem->numsamples);
+ }
+ }
+ else
+ {
+ if((soundsystem->soundcursor + soundsystem->numsamples) > (soundsystem->buffersize >> 1))
+ {
+ SoundMixCallback(&soundsystem->mixbuffer[soundsystem->soundcursor << 1],(soundsystem->buffersize >> 1) - soundsystem->soundcursor);
+ remain = soundsystem->numsamples - ((soundsystem->buffersize >> 1) - soundsystem->soundcursor);
+ SoundMixCallback(soundsystem->mixbuffer,remain);
+ }
+ else
+ {
+ SoundMixCallback(&soundsystem->mixbuffer[soundsystem->soundcursor << 1],soundsystem->numsamples);
+ }
+ }
+}
+
+void InterruptHandler(void)
+{
+ framecounter++;
+}
+void FiFoHandler(void)
+{
+ u32 command;
+ while ( !(REG_IPC_FIFO_CR & (IPC_FIFO_RECV_EMPTY)) )
+ {
+ command = REG_IPC_FIFO_RX;
+
+ switch(command)
+ {
+ case FIFO_NONE:
+ break;
+ case UPDATEON_ARM9:
+ REG_IME = 0;
+ MixSound();
+ REG_IME = 1;
+ SendCommandToArm7(MIXCOMPLETE_ONARM9);
+ break;
+ }
+ }
+}
+
+
+
+
+
+static int Audio_Available(void)
+{
+ return(1);
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice *)malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+
+ /* Set the function pointers */
+ this->OpenAudio = NDS_OpenAudio;
+ this->WaitAudio = NDS_WaitAudio;
+ this->PlayAudio = NDS_PlayAudio;
+ this->GetAudioBuf = NDS_GetAudioBuf;
+ this->CloseAudio = NDS_CloseAudio;
+
+ this->free = Audio_DeleteDevice;
+//fprintf(stderr,"Audio_CreateDevice\n");
+ return this;
+}
+
+AudioBootStrap NDSAUD_bootstrap = {
+ "nds", "NDS audio",
+ Audio_Available, Audio_CreateDevice
+};
+
+
+void static NDS_WaitAudio(_THIS)
+{
+ //printf("NDS_WaitAudio\n");
+}
+
+static void NDS_PlayAudio(_THIS)
+{
+ //printf("playing audio\n");
+ if (this->paused)
+ return;
+
+}
+
+static Uint8 *NDS_GetAudioBuf(_THIS)
+{
+ return NULL;//(this->hidden->mixbuf);
+}
+
+static void NDS_CloseAudio(_THIS)
+{
+/* if ( this->hidden->mixbuf != NULL ) {
+ SDL_FreeAudioMem(this->hidden->mixbuf);
+ this->hidden->mixbuf = NULL;
+ }*/
+}
+
+static int NDS_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ //printf("NDS_OpenAudio\n");
+ int format = 0;
+ //switch(spec->format&0xff) {
+ //case 8: spec->format = AUDIO_S8;format=8; break;
+ //case 16: spec->format = AUDIO_S16LSB;format=16; break;
+ //default:
+ // SDL_SetError("Unsupported audio format");
+ // return(-1);
+ //}
+ switch (spec->format&~0x1000) {
+ case AUDIO_S8:
+ /* Signed 8-bit audio supported */
+ format=8;
+ break;
+ case AUDIO_U8:
+ spec->format ^= 0x80;format=8;
+ break;
+ case AUDIO_U16:
+ /* Unsigned 16-bit audio unsupported, convert to S16 */
+ spec->format ^=0x8000;format=16;
+ case AUDIO_S16:
+ /* Signed 16-bit audio supported */
+ format=16;
+ break;
+ }
+ /* Update the fragment size as size in bytes */
+ SDL_CalculateAudioSpec(spec);
+
+ /* Allocate mixing buffer */
+ //this->hidden->mixlen = spec->size;
+ //this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
+ //if ( this->hidden->mixbuf == NULL ) {
+ // SDL_SetError("Out of Memory");
+ // return(-1);
+ //}
+
+ SDL_NDSAudio_mutex = 0;
+ sdl_nds_audiodevice=this;
+
+ irqInit();
+ irqSet(IRQ_VBLANK,&InterruptHandler);
+ irqSet(IRQ_FIFO_NOT_EMPTY,&FiFoHandler);
+ irqEnable(IRQ_FIFO_NOT_EMPTY);
+
+ REG_IPC_FIFO_CR = IPC_FIFO_ENABLE | IPC_FIFO_SEND_CLEAR | IPC_FIFO_RECV_IRQ;
+
+
+
+ SoundSystemInit(spec->freq,spec->size,0,format);
+ SoundStartMixer();
+
+
+ return(1);
+}
diff --git a/distrib/sdl-1.2.15/src/audio/nds/SDL_ndsaudio.h b/distrib/sdl-1.2.15/src/audio/nds/SDL_ndsaudio.h
new file mode 100644
index 0000000..cb6d1ea
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/nds/SDL_ndsaudio.h
@@ -0,0 +1,40 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_lowaudio_h
+#define _SDL_lowaudio_h
+
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the audio functions */
+#define _THIS SDL_AudioDevice *this
+
+struct SDL_PrivateAudioData {
+ /* The file descriptor for the audio device */
+ //Uint8 *mixbuf;
+ //Uint32 mixlen;
+};
+unsigned short SDL_NDSAudio_mutex=0;
+
+
+#endif /* _SDL_lowaudio_h */
diff --git a/distrib/sdl-1.2.15/src/audio/nds/sound9.c b/distrib/sdl-1.2.15/src/audio/nds/sound9.c
new file mode 100644
index 0000000..59c1c21
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/nds/sound9.c
@@ -0,0 +1,61 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+#include "SDL_stdinc.h"
+
+#include "soundcommon.h"
+
+void SoundSystemInit(u32 rate,u32 buffersize,u8 channel,u8 format)
+{
+ soundsystem->rate = rate;
+
+ if(format == 8)
+ soundsystem->buffersize = buffersize;
+ else if(format == 16)
+ soundsystem->buffersize = buffersize * sizeof(short);
+
+ soundsystem->mixbuffer = (s8*)SDL_malloc(soundsystem->buffersize);
+ //soundsystem->soundbuffer = soundsystem->mixbuffer;
+ soundsystem->format = format;
+ soundsystem->channel = channel;
+ soundsystem->prevtimer = 0;
+ soundsystem->soundcursor = 0;
+ soundsystem->numsamples = 0;
+ soundsystem->period = 0x1000000 / rate;
+ soundsystem->cmd = INIT;
+}
+
+void SoundStartMixer(void)
+{
+ soundsystem->cmd |= MIX;
+}
+
+void SendCommandToArm7(u32 command)
+{
+ while (REG_IPC_FIFO_CR & IPC_FIFO_SEND_FULL);
+ if (REG_IPC_FIFO_CR & IPC_FIFO_ERROR)
+ {
+ REG_IPC_FIFO_CR |= IPC_FIFO_SEND_CLEAR;
+ }
+
+ REG_IPC_FIFO_TX = command;
+}
diff --git a/distrib/sdl-1.2.15/src/audio/nds/soundcommon.h b/distrib/sdl-1.2.15/src/audio/nds/soundcommon.h
new file mode 100644
index 0000000..d38e37c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/nds/soundcommon.h
@@ -0,0 +1,80 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef __SOUNDCOMMON_H
+#define __SOUNDCOMMON_H
+
+#include <nds.h>
+
+#define CLOCK (1 << 25)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum
+{
+ NONE = 0,
+ INIT = 1,
+ MIX = 2,
+ MIXING = 4,
+ STOP = 8
+}CommandType;
+
+typedef enum
+{
+ FIFO_NONE = 0,
+ UPDATEON_ARM9 = 1,
+ MIXCOMPLETE_ONARM9 = 2,
+}FifoType;
+
+typedef struct
+{
+ s8 *mixbuffer;//,*soundbuffer;
+ u32 rate;
+ u32 buffersize;
+ u32 cmd;
+ u8 channel,format;
+ u32 soundcursor,numsamples;
+ s32 prevtimer;
+ s16 period;
+}S_SoundSystem;
+
+#define soundsystem ((S_SoundSystem*)((u32)(IPC)+sizeof(TransferRegion)))
+
+#ifdef ARM9
+extern void SoundSystemInit(u32 rate,u32 buffersize,u8 channel,u8 format);
+extern void SoundStartMixer(void);
+extern void SendCommandToArm7(u32 command);
+#else
+extern void SoundVBlankIrq(void);
+extern void SoundSwapAndMix(void);
+extern void SoundSetTimer(int period);
+extern void SoundFifoHandler(void);
+extern void SendCommandToArm9(u32 command);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/distrib/sdl-1.2.15/src/audio/nto/SDL_nto_audio.c b/distrib/sdl-1.2.15/src/audio/nto/SDL_nto_audio.c
new file mode 100644
index 0000000..f951825
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/nto/SDL_nto_audio.c
@@ -0,0 +1,507 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sched.h>
+#include <sys/select.h>
+#include <sys/neutrino.h>
+#include <sys/asoundlib.h>
+
+#include "SDL_timer.h"
+#include "SDL_audio.h"
+#include "../SDL_audiomem.h"
+#include "../SDL_audio_c.h"
+#include "SDL_nto_audio.h"
+
+/* The tag name used by NTO audio */
+#define DRIVER_NAME "qsa-nto"
+
+/* default channel communication parameters */
+#define DEFAULT_CPARAMS_RATE 22050
+#define DEFAULT_CPARAMS_VOICES 1
+/* FIXME: need to add in the near future flexible logic with frag_size and frags count */
+#define DEFAULT_CPARAMS_FRAG_SIZE 4096
+#define DEFAULT_CPARAMS_FRAGS_MIN 1
+#define DEFAULT_CPARAMS_FRAGS_MAX 1
+
+/* Open the audio device for playback, and don't block if busy */
+#define OPEN_FLAGS SND_PCM_OPEN_PLAYBACK
+
+#define QSA_NO_WORKAROUNDS 0x00000000
+#define QSA_MMAP_WORKAROUND 0x00000001
+
+struct BuggyCards
+{
+ char* cardname;
+ unsigned long bugtype;
+};
+
+#define QSA_WA_CARDS 3
+
+struct BuggyCards buggycards[QSA_WA_CARDS]=
+{
+ {"Sound Blaster Live!", QSA_MMAP_WORKAROUND},
+ {"Vortex 8820", QSA_MMAP_WORKAROUND},
+ {"Vortex 8830", QSA_MMAP_WORKAROUND},
+};
+
+/* Audio driver functions */
+static void NTO_ThreadInit(_THIS);
+static int NTO_OpenAudio(_THIS, SDL_AudioSpec* spec);
+static void NTO_WaitAudio(_THIS);
+static void NTO_PlayAudio(_THIS);
+static Uint8* NTO_GetAudioBuf(_THIS);
+static void NTO_CloseAudio(_THIS);
+
+/* card names check to apply the workarounds */
+static int NTO_CheckBuggyCards(_THIS, unsigned long checkfor)
+{
+ char scardname[33];
+ int it;
+
+ if (snd_card_get_name(cardno, scardname, 32)<0)
+ {
+ return 0;
+ }
+
+ for (it=0; it<QSA_WA_CARDS; it++)
+ {
+ if (SDL_strcmp(buggycards[it].cardname, scardname)==0)
+ {
+ if (buggycards[it].bugtype==checkfor)
+ {
+ return 1;
+ }
+ }
+ }
+
+ return 0;
+}
+
+static void NTO_ThreadInit(_THIS)
+{
+ int status;
+ struct sched_param param;
+
+ /* increasing default 10 priority to 25 to avoid jerky sound */
+ status=SchedGet(0, 0, &param);
+ param.sched_priority=param.sched_curpriority+15;
+ status=SchedSet(0, 0, SCHED_NOCHANGE, &param);
+}
+
+/* PCM transfer channel parameters initialize function */
+static void NTO_InitAudioParams(snd_pcm_channel_params_t* cpars)
+{
+ SDL_memset(cpars, 0, sizeof(snd_pcm_channel_params_t));
+
+ cpars->channel = SND_PCM_CHANNEL_PLAYBACK;
+ cpars->mode = SND_PCM_MODE_BLOCK;
+ cpars->start_mode = SND_PCM_START_DATA;
+ cpars->stop_mode = SND_PCM_STOP_STOP;
+ cpars->format.format = SND_PCM_SFMT_S16_LE;
+ cpars->format.interleave = 1;
+ cpars->format.rate = DEFAULT_CPARAMS_RATE;
+ cpars->format.voices = DEFAULT_CPARAMS_VOICES;
+ cpars->buf.block.frag_size = DEFAULT_CPARAMS_FRAG_SIZE;
+ cpars->buf.block.frags_min = DEFAULT_CPARAMS_FRAGS_MIN;
+ cpars->buf.block.frags_max = DEFAULT_CPARAMS_FRAGS_MAX;
+}
+
+static int NTO_AudioAvailable(void)
+{
+ /* See if we can open a nonblocking channel.
+ Return value '1' means we can.
+ Return value '0' means we cannot. */
+
+ int available;
+ int rval;
+ snd_pcm_t* handle;
+
+ available = 0;
+ handle = NULL;
+
+ rval = snd_pcm_open_preferred(&handle, NULL, NULL, OPEN_FLAGS);
+
+ if (rval >= 0)
+ {
+ available = 1;
+
+ if ((rval = snd_pcm_close(handle)) < 0)
+ {
+ SDL_SetError("NTO_AudioAvailable(): snd_pcm_close failed: %s\n", snd_strerror(rval));
+ available = 0;
+ }
+ }
+ else
+ {
+ SDL_SetError("NTO_AudioAvailable(): there are no available audio devices.\n");
+ }
+
+ return (available);
+}
+
+static void NTO_DeleteAudioDevice(SDL_AudioDevice *device)
+{
+ if ((device)&&(device->hidden))
+ {
+ SDL_free(device->hidden);
+ }
+ if (device)
+ {
+ SDL_free(device);
+ }
+}
+
+static SDL_AudioDevice* NTO_CreateAudioDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if (this)
+ {
+ SDL_memset(this, 0, sizeof(SDL_AudioDevice));
+ this->hidden = (struct SDL_PrivateAudioData *)SDL_malloc(sizeof(struct SDL_PrivateAudioData));
+ }
+ if ((this == NULL) || (this->hidden == NULL))
+ {
+ SDL_OutOfMemory();
+ if (this)
+ {
+ SDL_free(this);
+ }
+ return (0);
+ }
+ SDL_memset(this->hidden, 0, sizeof(struct SDL_PrivateAudioData));
+ audio_handle = NULL;
+
+ /* Set the function pointers */
+ this->ThreadInit = NTO_ThreadInit;
+ this->OpenAudio = NTO_OpenAudio;
+ this->WaitAudio = NTO_WaitAudio;
+ this->PlayAudio = NTO_PlayAudio;
+ this->GetAudioBuf = NTO_GetAudioBuf;
+ this->CloseAudio = NTO_CloseAudio;
+
+ this->free = NTO_DeleteAudioDevice;
+
+ return this;
+}
+
+AudioBootStrap QNXNTOAUDIO_bootstrap =
+{
+ DRIVER_NAME, "QNX6 QSA-NTO Audio",
+ NTO_AudioAvailable,
+ NTO_CreateAudioDevice
+};
+
+/* This function waits until it is possible to write a full sound buffer */
+static void NTO_WaitAudio(_THIS)
+{
+ fd_set wfds;
+ int selectret;
+
+ FD_ZERO(&wfds);
+ FD_SET(audio_fd, &wfds);
+
+ do {
+ selectret=select(audio_fd + 1, NULL, &wfds, NULL, NULL);
+ switch (selectret)
+ {
+ case -1:
+ case 0: SDL_SetError("NTO_WaitAudio(): select() failed: %s\n", strerror(errno));
+ return;
+ default: if (FD_ISSET(audio_fd, &wfds))
+ {
+ return;
+ }
+ break;
+ }
+ } while(1);
+}
+
+static void NTO_PlayAudio(_THIS)
+{
+ int written, rval;
+ int towrite;
+ void* pcmbuffer;
+
+ if (!this->enabled)
+ {
+ return;
+ }
+
+ towrite = this->spec.size;
+ pcmbuffer = pcm_buf;
+
+ /* Write the audio data, checking for EAGAIN (buffer full) and underrun */
+ do {
+ written = snd_pcm_plugin_write(audio_handle, pcm_buf, towrite);
+ if (written != towrite)
+ {
+ if ((errno == EAGAIN) || (errno == EWOULDBLOCK))
+ {
+ /* Let a little CPU time go by and try to write again */
+ SDL_Delay(1);
+ /* if we wrote some data */
+ towrite -= written;
+ pcmbuffer += written * this->spec.channels;
+ continue;
+ }
+ else
+ {
+ if ((errno == EINVAL) || (errno == EIO))
+ {
+ SDL_memset(&cstatus, 0, sizeof(cstatus));
+ cstatus.channel = SND_PCM_CHANNEL_PLAYBACK;
+ if ((rval = snd_pcm_plugin_status(audio_handle, &cstatus)) < 0)
+ {
+ SDL_SetError("NTO_PlayAudio(): snd_pcm_plugin_status failed: %s\n", snd_strerror(rval));
+ return;
+ }
+ if ((cstatus.status == SND_PCM_STATUS_UNDERRUN) || (cstatus.status == SND_PCM_STATUS_READY))
+ {
+ if ((rval = snd_pcm_plugin_prepare(audio_handle, SND_PCM_CHANNEL_PLAYBACK)) < 0)
+ {
+ SDL_SetError("NTO_PlayAudio(): snd_pcm_plugin_prepare failed: %s\n", snd_strerror(rval));
+ return;
+ }
+ }
+ continue;
+ }
+ else
+ {
+ return;
+ }
+ }
+ }
+ else
+ {
+ /* we wrote all remaining data */
+ towrite -= written;
+ pcmbuffer += written * this->spec.channels;
+ }
+ } while ((towrite > 0) && (this->enabled));
+
+ /* If we couldn't write, assume fatal error for now */
+ if (towrite != 0)
+ {
+ this->enabled = 0;
+ }
+
+ return;
+}
+
+static Uint8* NTO_GetAudioBuf(_THIS)
+{
+ return pcm_buf;
+}
+
+static void NTO_CloseAudio(_THIS)
+{
+ int rval;
+
+ this->enabled = 0;
+
+ if (audio_handle != NULL)
+ {
+ if ((rval = snd_pcm_plugin_flush(audio_handle, SND_PCM_CHANNEL_PLAYBACK)) < 0)
+ {
+ SDL_SetError("NTO_CloseAudio(): snd_pcm_plugin_flush failed: %s\n", snd_strerror(rval));
+ return;
+ }
+ if ((rval = snd_pcm_close(audio_handle)) < 0)
+ {
+ SDL_SetError("NTO_CloseAudio(): snd_pcm_close failed: %s\n",snd_strerror(rval));
+ return;
+ }
+ audio_handle = NULL;
+ }
+}
+
+static int NTO_OpenAudio(_THIS, SDL_AudioSpec* spec)
+{
+ int rval;
+ int format;
+ Uint16 test_format;
+ int found;
+
+ audio_handle = NULL;
+ this->enabled = 0;
+
+ if (pcm_buf != NULL)
+ {
+ SDL_FreeAudioMem(pcm_buf);
+ pcm_buf = NULL;
+ }
+
+ /* initialize channel transfer parameters to default */
+ NTO_InitAudioParams(&cparams);
+
+ /* Open the audio device */
+ rval = snd_pcm_open_preferred(&audio_handle, &cardno, &deviceno, OPEN_FLAGS);
+ if (rval < 0)
+ {
+ SDL_SetError("NTO_OpenAudio(): snd_pcm_open failed: %s\n", snd_strerror(rval));
+ return (-1);
+ }
+
+ if (!NTO_CheckBuggyCards(this, QSA_MMAP_WORKAROUND))
+ {
+ /* enable count status parameter */
+ if ((rval = snd_pcm_plugin_set_disable(audio_handle, PLUGIN_DISABLE_MMAP)) < 0)
+ {
+ SDL_SetError("snd_pcm_plugin_set_disable failed: %s\n", snd_strerror(rval));
+ return (-1);
+ }
+ }
+
+ /* Try for a closest match on audio format */
+ format = 0;
+ /* can't use format as SND_PCM_SFMT_U8 = 0 in nto */
+ found = 0;
+
+ for (test_format=SDL_FirstAudioFormat(spec->format); !found ;)
+ {
+ /* if match found set format to equivalent ALSA format */
+ switch (test_format)
+ {
+ case AUDIO_U8:
+ format = SND_PCM_SFMT_U8;
+ found = 1;
+ break;
+ case AUDIO_S8:
+ format = SND_PCM_SFMT_S8;
+ found = 1;
+ break;
+ case AUDIO_S16LSB:
+ format = SND_PCM_SFMT_S16_LE;
+ found = 1;
+ break;
+ case AUDIO_S16MSB:
+ format = SND_PCM_SFMT_S16_BE;
+ found = 1;
+ break;
+ case AUDIO_U16LSB:
+ format = SND_PCM_SFMT_U16_LE;
+ found = 1;
+ break;
+ case AUDIO_U16MSB:
+ format = SND_PCM_SFMT_U16_BE;
+ found = 1;
+ break;
+ default:
+ break;
+ }
+
+ if (!found)
+ {
+ test_format = SDL_NextAudioFormat();
+ }
+ }
+
+ /* assumes test_format not 0 on success */
+ if (test_format == 0)
+ {
+ SDL_SetError("NTO_OpenAudio(): Couldn't find any hardware audio formats");
+ return (-1);
+ }
+
+ spec->format = test_format;
+
+ /* Set the audio format */
+ cparams.format.format = format;
+
+ /* Set mono or stereo audio (currently only two channels supported) */
+ cparams.format.voices = spec->channels;
+
+ /* Set rate */
+ cparams.format.rate = spec->freq;
+
+ /* Setup the transfer parameters according to cparams */
+ rval = snd_pcm_plugin_params(audio_handle, &cparams);
+ if (rval < 0)
+ {
+ SDL_SetError("NTO_OpenAudio(): snd_pcm_channel_params failed: %s\n", snd_strerror(rval));
+ return (-1);
+ }
+
+ /* Make sure channel is setup right one last time */
+ SDL_memset(&csetup, 0x00, sizeof(csetup));
+ csetup.channel = SND_PCM_CHANNEL_PLAYBACK;
+ if (snd_pcm_plugin_setup(audio_handle, &csetup) < 0)
+ {
+ SDL_SetError("NTO_OpenAudio(): Unable to setup playback channel\n");
+ return -1;
+ }
+
+
+ /* Calculate the final parameters for this audio specification */
+ SDL_CalculateAudioSpec(spec);
+
+ pcm_len = spec->size;
+
+ if (pcm_len==0)
+ {
+ pcm_len = csetup.buf.block.frag_size * spec->channels * (snd_pcm_format_width(format)/8);
+ }
+
+ /* Allocate memory to the audio buffer and initialize with silence (Note that
+ buffer size must be a multiple of fragment size, so find closest multiple)
+ */
+ pcm_buf = (Uint8*)SDL_AllocAudioMem(pcm_len);
+ if (pcm_buf == NULL)
+ {
+ SDL_SetError("NTO_OpenAudio(): pcm buffer allocation failed\n");
+ return (-1);
+ }
+ SDL_memset(pcm_buf, spec->silence, pcm_len);
+
+ /* get the file descriptor */
+ if ((audio_fd = snd_pcm_file_descriptor(audio_handle, SND_PCM_CHANNEL_PLAYBACK)) < 0)
+ {
+ SDL_SetError("NTO_OpenAudio(): snd_pcm_file_descriptor failed with error code: %s\n", snd_strerror(rval));
+ return (-1);
+ }
+
+ /* Trigger audio playback */
+ rval = snd_pcm_plugin_prepare(audio_handle, SND_PCM_CHANNEL_PLAYBACK);
+ if (rval < 0)
+ {
+ SDL_SetError("snd_pcm_plugin_prepare failed: %s\n", snd_strerror(rval));
+ return (-1);
+ }
+
+ this->enabled = 1;
+
+ /* Get the parent process id (we're the parent of the audio thread) */
+ parent = getpid();
+
+ /* We're really ready to rock and roll. :-) */
+ return (0);
+}
diff --git a/distrib/sdl-1.2.15/src/audio/nto/SDL_nto_audio.h b/distrib/sdl-1.2.15/src/audio/nto/SDL_nto_audio.h
new file mode 100644
index 0000000..cfd592c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/nto/SDL_nto_audio.h
@@ -0,0 +1,68 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef __SDL_NTO_AUDIO_H__
+#define __SDL_NTO_AUDIO_H__
+
+#include <sys/asoundlib.h>
+
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the audio functions */
+#define _THIS SDL_AudioDevice *this
+
+struct SDL_PrivateAudioData
+{
+ /* The audio device handle */
+ int cardno;
+ int deviceno;
+ snd_pcm_t* audio_handle;
+
+ /* The audio file descriptor */
+ int audio_fd;
+
+ /* The parent process id, to detect when application quits */
+ pid_t parent;
+
+ /* Raw mixing buffer */
+ Uint8* pcm_buf;
+ Uint32 pcm_len;
+
+ /* QSA parameters */
+ snd_pcm_channel_status_t cstatus;
+ snd_pcm_channel_params_t cparams;
+ snd_pcm_channel_setup_t csetup;
+};
+
+#define cardno (this->hidden->cardno)
+#define deviceno (this->hidden->deviceno)
+#define audio_handle (this->hidden->audio_handle)
+#define audio_fd (this->hidden->audio_fd)
+#define parent (this->hidden->parent)
+#define pcm_buf (this->hidden->pcm_buf)
+#define pcm_len (this->hidden->pcm_len)
+#define cstatus (this->hidden->cstatus)
+#define cparams (this->hidden->cparams)
+#define csetup (this->hidden->csetup)
+
+#endif /* __SDL_NTO_AUDIO_H__ */
diff --git a/distrib/sdl-1.2.15/src/audio/paudio/SDL_paudio.c b/distrib/sdl-1.2.15/src/audio/paudio/SDL_paudio.c
new file mode 100644
index 0000000..6270d8c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/paudio/SDL_paudio.c
@@ -0,0 +1,511 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Carsten Griwodz
+ griff@kom.tu-darmstadt.de
+
+ based on linux/SDL_dspaudio.c by Sam Lantinga
+*/
+#include "SDL_config.h"
+
+/* Allow access to a raw mixing buffer */
+
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+
+#include "SDL_timer.h"
+#include "SDL_audio.h"
+#include "../SDL_audiomem.h"
+#include "../SDL_audio_c.h"
+#include "../SDL_audiodev_c.h"
+#include "SDL_paudio.h"
+
+#define DEBUG_AUDIO 1
+
+/* A conflict within AIX 4.3.3 <sys/> headers and probably others as well.
+ * I guess nobody ever uses audio... Shame over AIX header files. */
+#include <sys/machine.h>
+#undef BIG_ENDIAN
+#include <sys/audio.h>
+
+/* The tag name used by paud audio */
+#define Paud_DRIVER_NAME "paud"
+
+/* Open the audio device for playback, and don't block if busy */
+/* #define OPEN_FLAGS (O_WRONLY|O_NONBLOCK) */
+#define OPEN_FLAGS O_WRONLY
+
+/* Audio driver functions */
+static int Paud_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void Paud_WaitAudio(_THIS);
+static void Paud_PlayAudio(_THIS);
+static Uint8 *Paud_GetAudioBuf(_THIS);
+static void Paud_CloseAudio(_THIS);
+
+/* Audio driver bootstrap functions */
+
+static int Audio_Available(void)
+{
+ int fd;
+ int available;
+
+ available = 0;
+ fd = SDL_OpenAudioPath(NULL, 0, OPEN_FLAGS, 0);
+ if ( fd >= 0 ) {
+ available = 1;
+ close(fd);
+ }
+ return(available);
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+ audio_fd = -1;
+
+ /* Set the function pointers */
+ this->OpenAudio = Paud_OpenAudio;
+ this->WaitAudio = Paud_WaitAudio;
+ this->PlayAudio = Paud_PlayAudio;
+ this->GetAudioBuf = Paud_GetAudioBuf;
+ this->CloseAudio = Paud_CloseAudio;
+
+ this->free = Audio_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap Paud_bootstrap = {
+ Paud_DRIVER_NAME, "AIX Paudio",
+ Audio_Available, Audio_CreateDevice
+};
+
+/* This function waits until it is possible to write a full sound buffer */
+static void Paud_WaitAudio(_THIS)
+{
+ fd_set fdset;
+
+ /* See if we need to use timed audio synchronization */
+ if ( frame_ticks ) {
+ /* Use timer for general audio synchronization */
+ Sint32 ticks;
+
+ ticks = ((Sint32)(next_frame - SDL_GetTicks()))-FUDGE_TICKS;
+ if ( ticks > 0 ) {
+ SDL_Delay(ticks);
+ }
+ } else {
+ audio_buffer paud_bufinfo;
+
+ /* Use select() for audio synchronization */
+ struct timeval timeout;
+ FD_ZERO(&fdset);
+ FD_SET(audio_fd, &fdset);
+
+ if ( ioctl(audio_fd, AUDIO_BUFFER, &paud_bufinfo) < 0 ) {
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Couldn't get audio buffer information\n");
+#endif
+ timeout.tv_sec = 10;
+ timeout.tv_usec = 0;
+ } else {
+ long ms_in_buf = paud_bufinfo.write_buf_time;
+ timeout.tv_sec = ms_in_buf/1000;
+ ms_in_buf = ms_in_buf - timeout.tv_sec*1000;
+ timeout.tv_usec = ms_in_buf*1000;
+#ifdef DEBUG_AUDIO
+ fprintf( stderr,
+ "Waiting for write_buf_time=%ld,%ld\n",
+ timeout.tv_sec,
+ timeout.tv_usec );
+#endif
+ }
+
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Waiting for audio to get ready\n");
+#endif
+ if ( select(audio_fd+1, NULL, &fdset, NULL, &timeout) <= 0 ) {
+ const char *message = "Audio timeout - buggy audio driver? (disabled)";
+ /*
+ * In general we should never print to the screen,
+ * but in this case we have no other way of letting
+ * the user know what happened.
+ */
+ fprintf(stderr, "SDL: %s - %s\n", strerror(errno), message);
+ this->enabled = 0;
+ /* Don't try to close - may hang */
+ audio_fd = -1;
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Done disabling audio\n");
+#endif
+ }
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Ready!\n");
+#endif
+ }
+}
+
+static void Paud_PlayAudio(_THIS)
+{
+ int written;
+
+ /* Write the audio data, checking for EAGAIN on broken audio drivers */
+ do {
+ written = write(audio_fd, mixbuf, mixlen);
+ if ( (written < 0) && ((errno == 0) || (errno == EAGAIN)) ) {
+ SDL_Delay(1); /* Let a little CPU time go by */
+ }
+ } while ( (written < 0) &&
+ ((errno == 0) || (errno == EAGAIN) || (errno == EINTR)) );
+
+ /* If timer synchronization is enabled, set the next write frame */
+ if ( frame_ticks ) {
+ next_frame += frame_ticks;
+ }
+
+ /* If we couldn't write, assume fatal error for now */
+ if ( written < 0 ) {
+ this->enabled = 0;
+ }
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Wrote %d bytes of audio data\n", written);
+#endif
+}
+
+static Uint8 *Paud_GetAudioBuf(_THIS)
+{
+ return mixbuf;
+}
+
+static void Paud_CloseAudio(_THIS)
+{
+ if ( mixbuf != NULL ) {
+ SDL_FreeAudioMem(mixbuf);
+ mixbuf = NULL;
+ }
+ if ( audio_fd >= 0 ) {
+ close(audio_fd);
+ audio_fd = -1;
+ }
+}
+
+static int Paud_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ char audiodev[1024];
+ int format;
+ int bytes_per_sample;
+ Uint16 test_format;
+ audio_init paud_init;
+ audio_buffer paud_bufinfo;
+ audio_status paud_status;
+ audio_control paud_control;
+ audio_change paud_change;
+
+ /* Reset the timer synchronization flag */
+ frame_ticks = 0.0;
+
+ /* Open the audio device */
+ audio_fd = SDL_OpenAudioPath(audiodev, sizeof(audiodev), OPEN_FLAGS, 0);
+ if ( audio_fd < 0 ) {
+ SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno));
+ return -1;
+ }
+
+ /*
+ * We can't set the buffer size - just ask the device for the maximum
+ * that we can have.
+ */
+ if ( ioctl(audio_fd, AUDIO_BUFFER, &paud_bufinfo) < 0 ) {
+ SDL_SetError("Couldn't get audio buffer information");
+ return -1;
+ }
+
+ mixbuf = NULL;
+
+ if ( spec->channels > 1 )
+ spec->channels = 2;
+ else
+ spec->channels = 1;
+
+ /*
+ * Fields in the audio_init structure:
+ *
+ * Ignored by us:
+ *
+ * paud.loadpath[LOAD_PATH]; * DSP code to load, MWave chip only?
+ * paud.slot_number; * slot number of the adapter
+ * paud.device_id; * adapter identification number
+ *
+ * Input:
+ *
+ * paud.srate; * the sampling rate in Hz
+ * paud.bits_per_sample; * 8, 16, 32, ...
+ * paud.bsize; * block size for this rate
+ * paud.mode; * ADPCM, PCM, MU_LAW, A_LAW, SOURCE_MIX
+ * paud.channels; * 1=mono, 2=stereo
+ * paud.flags; * FIXED - fixed length data
+ * * LEFT_ALIGNED, RIGHT_ALIGNED (var len only)
+ * * TWOS_COMPLEMENT - 2's complement data
+ * * SIGNED - signed? comment seems wrong in sys/audio.h
+ * * BIG_ENDIAN
+ * paud.operation; * PLAY, RECORD
+ *
+ * Output:
+ *
+ * paud.flags; * PITCH - pitch is supported
+ * * INPUT - input is supported
+ * * OUTPUT - output is supported
+ * * MONITOR - monitor is supported
+ * * VOLUME - volume is supported
+ * * VOLUME_DELAY - volume delay is supported
+ * * BALANCE - balance is supported
+ * * BALANCE_DELAY - balance delay is supported
+ * * TREBLE - treble control is supported
+ * * BASS - bass control is supported
+ * * BESTFIT_PROVIDED - best fit returned
+ * * LOAD_CODE - DSP load needed
+ * paud.rc; * NO_PLAY - DSP code can't do play requests
+ * * NO_RECORD - DSP code can't do record requests
+ * * INVALID_REQUEST - request was invalid
+ * * CONFLICT - conflict with open's flags
+ * * OVERLOADED - out of DSP MIPS or memory
+ * paud.position_resolution; * smallest increment for position
+ */
+
+ paud_init.srate = spec->freq;
+ paud_init.mode = PCM;
+ paud_init.operation = PLAY;
+ paud_init.channels = spec->channels;
+
+ /* Try for a closest match on audio format */
+ format = 0;
+ for ( test_format = SDL_FirstAudioFormat(spec->format);
+ ! format && test_format; ) {
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Trying format 0x%4.4x\n", test_format);
+#endif
+ switch ( test_format ) {
+ case AUDIO_U8:
+ bytes_per_sample = 1;
+ paud_init.bits_per_sample = 8;
+ paud_init.flags = TWOS_COMPLEMENT | FIXED;
+ format = 1;
+ break;
+ case AUDIO_S8:
+ bytes_per_sample = 1;
+ paud_init.bits_per_sample = 8;
+ paud_init.flags = SIGNED |
+ TWOS_COMPLEMENT | FIXED;
+ format = 1;
+ break;
+ case AUDIO_S16LSB:
+ bytes_per_sample = 2;
+ paud_init.bits_per_sample = 16;
+ paud_init.flags = SIGNED |
+ TWOS_COMPLEMENT | FIXED;
+ format = 1;
+ break;
+ case AUDIO_S16MSB:
+ bytes_per_sample = 2;
+ paud_init.bits_per_sample = 16;
+ paud_init.flags = BIG_ENDIAN |
+ SIGNED |
+ TWOS_COMPLEMENT | FIXED;
+ format = 1;
+ break;
+ case AUDIO_U16LSB:
+ bytes_per_sample = 2;
+ paud_init.bits_per_sample = 16;
+ paud_init.flags = TWOS_COMPLEMENT | FIXED;
+ format = 1;
+ break;
+ case AUDIO_U16MSB:
+ bytes_per_sample = 2;
+ paud_init.bits_per_sample = 16;
+ paud_init.flags = BIG_ENDIAN |
+ TWOS_COMPLEMENT | FIXED;
+ format = 1;
+ break;
+ default:
+ break;
+ }
+ if ( ! format ) {
+ test_format = SDL_NextAudioFormat();
+ }
+ }
+ if ( format == 0 ) {
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Couldn't find any hardware audio formats\n");
+#endif
+ SDL_SetError("Couldn't find any hardware audio formats");
+ return -1;
+ }
+ spec->format = test_format;
+
+ /*
+ * We know the buffer size and the max number of subsequent writes
+ * that can be pending. If more than one can pend, allow the application
+ * to do something like double buffering between our write buffer and
+ * the device's own buffer that we are filling with write() anyway.
+ *
+ * We calculate spec->samples like this because SDL_CalculateAudioSpec()
+ * will give put paud_bufinfo.write_buf_cap (or paud_bufinfo.write_buf_cap/2)
+ * into spec->size in return.
+ */
+ if ( paud_bufinfo.request_buf_cap == 1 )
+ {
+ spec->samples = paud_bufinfo.write_buf_cap
+ / bytes_per_sample
+ / spec->channels;
+ }
+ else
+ {
+ spec->samples = paud_bufinfo.write_buf_cap
+ / bytes_per_sample
+ / spec->channels
+ / 2;
+ }
+ paud_init.bsize = bytes_per_sample * spec->channels;
+
+ SDL_CalculateAudioSpec(spec);
+
+ /*
+ * The AIX paud device init can't modify the values of the audio_init
+ * structure that we pass to it. So we don't need any recalculation
+ * of this stuff and no reinit call as in linux dsp and dma code.
+ *
+ * /dev/paud supports all of the encoding formats, so we don't need
+ * to do anything like reopening the device, either.
+ */
+ if ( ioctl(audio_fd, AUDIO_INIT, &paud_init) < 0 ) {
+ switch ( paud_init.rc )
+ {
+ case 1 :
+ SDL_SetError("Couldn't set audio format: DSP can't do play requests");
+ return -1;
+ break;
+ case 2 :
+ SDL_SetError("Couldn't set audio format: DSP can't do record requests");
+ return -1;
+ break;
+ case 4 :
+ SDL_SetError("Couldn't set audio format: request was invalid");
+ return -1;
+ break;
+ case 5 :
+ SDL_SetError("Couldn't set audio format: conflict with open's flags");
+ return -1;
+ break;
+ case 6 :
+ SDL_SetError("Couldn't set audio format: out of DSP MIPS or memory");
+ return -1;
+ break;
+ default :
+ SDL_SetError("Couldn't set audio format: not documented in sys/audio.h");
+ return -1;
+ break;
+ }
+ }
+
+ /* Allocate mixing buffer */
+ mixlen = spec->size;
+ mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen);
+ if ( mixbuf == NULL ) {
+ return -1;
+ }
+ SDL_memset(mixbuf, spec->silence, spec->size);
+
+ /*
+ * Set some paramters: full volume, first speaker that we can find.
+ * Ignore the other settings for now.
+ */
+ paud_change.input = AUDIO_IGNORE; /* the new input source */
+ paud_change.output = OUTPUT_1; /* EXTERNAL_SPEAKER,INTERNAL_SPEAKER,OUTPUT_1 */
+ paud_change.monitor = AUDIO_IGNORE; /* the new monitor state */
+ paud_change.volume = 0x7fffffff; /* volume level [0-0x7fffffff] */
+ paud_change.volume_delay = AUDIO_IGNORE; /* the new volume delay */
+ paud_change.balance = 0x3fffffff; /* the new balance */
+ paud_change.balance_delay = AUDIO_IGNORE; /* the new balance delay */
+ paud_change.treble = AUDIO_IGNORE; /* the new treble state */
+ paud_change.bass = AUDIO_IGNORE; /* the new bass state */
+ paud_change.pitch = AUDIO_IGNORE; /* the new pitch state */
+
+ paud_control.ioctl_request = AUDIO_CHANGE;
+ paud_control.request_info = (char*)&paud_change;
+ if ( ioctl(audio_fd, AUDIO_CONTROL, &paud_control) < 0 ) {
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Can't change audio display settings\n" );
+#endif
+ }
+
+ /*
+ * Tell the device to expect data. Actual start will wait for
+ * the first write() call.
+ */
+ paud_control.ioctl_request = AUDIO_START;
+ paud_control.position = 0;
+ if ( ioctl(audio_fd, AUDIO_CONTROL, &paud_control) < 0 ) {
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Can't start audio play\n" );
+#endif
+ SDL_SetError("Can't start audio play");
+ return -1;
+ }
+
+ /* Check to see if we need to use select() workaround */
+ { char *workaround;
+ workaround = SDL_getenv("SDL_DSP_NOSELECT");
+ if ( workaround ) {
+ frame_ticks = (float)(spec->samples*1000)/spec->freq;
+ next_frame = SDL_GetTicks()+frame_ticks;
+ }
+ }
+
+ /* Get the parent process id (we're the parent of the audio thread) */
+ parent = getpid();
+
+ /* We're ready to rock and roll. :-) */
+ return 0;
+}
+
diff --git a/distrib/sdl-1.2.15/src/audio/paudio/SDL_paudio.h b/distrib/sdl-1.2.15/src/audio/paudio/SDL_paudio.h
new file mode 100644
index 0000000..72eff1d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/paudio/SDL_paudio.h
@@ -0,0 +1,57 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_paudaudio_h
+#define _SDL_paudaudio_h
+
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_AudioDevice *this
+
+struct SDL_PrivateAudioData {
+ /* The file descriptor for the audio device */
+ int audio_fd;
+
+ /* The parent process id, to detect when application quits */
+ pid_t parent;
+
+ /* Raw mixing buffer */
+ Uint8 *mixbuf;
+ int mixlen;
+
+ /* Support for audio timing using a timer, in addition to select() */
+ float frame_ticks;
+ float next_frame;
+};
+#define FUDGE_TICKS 10 /* The scheduler overhead ticks per frame */
+
+/* Old variable names */
+#define audio_fd (this->hidden->audio_fd)
+#define parent (this->hidden->parent)
+#define mixbuf (this->hidden->mixbuf)
+#define mixlen (this->hidden->mixlen)
+#define frame_ticks (this->hidden->frame_ticks)
+#define next_frame (this->hidden->next_frame)
+
+#endif /* _SDL_paudaudio_h */
diff --git a/distrib/sdl-1.2.15/src/audio/pulse/SDL_pulseaudio.c b/distrib/sdl-1.2.15/src/audio/pulse/SDL_pulseaudio.c
new file mode 100644
index 0000000..29373f3
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/pulse/SDL_pulseaudio.c
@@ -0,0 +1,570 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Stéphan Kochen
+ stephan@kochen.nl
+
+ Based on parts of the ALSA and ESounD output drivers.
+*/
+#include "SDL_config.h"
+
+/* Allow access to an PulseAudio network stream mixing buffer */
+
+#include <sys/types.h>
+#include <unistd.h>
+#include <signal.h>
+#include <errno.h>
+#include <pulse/pulseaudio.h>
+#include <pulse/simple.h>
+
+#include "SDL_timer.h"
+#include "SDL_audio.h"
+#include "../SDL_audiomem.h"
+#include "../SDL_audio_c.h"
+#include "../SDL_audiodev_c.h"
+#include "../../../include/SDL_video.h" /* for SDL_WM_GetCaption(). */
+#include "SDL_pulseaudio.h"
+
+#ifdef SDL_AUDIO_DRIVER_PULSE_DYNAMIC
+#include "SDL_name.h"
+#include "SDL_loadso.h"
+#else
+#define SDL_NAME(X) X
+#endif
+
+/* The tag name used by the driver */
+#define PULSE_DRIVER_NAME "pulse"
+
+/* Audio driver functions */
+static int PULSE_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void PULSE_WaitAudio(_THIS);
+static void PULSE_PlayAudio(_THIS);
+static Uint8 *PULSE_GetAudioBuf(_THIS);
+static void PULSE_CloseAudio(_THIS);
+static void PULSE_WaitDone(_THIS);
+static void PULSE_SetCaption(_THIS, const char *str);
+
+#ifdef SDL_AUDIO_DRIVER_PULSE_DYNAMIC
+
+static const char *pulse_library = SDL_AUDIO_DRIVER_PULSE_DYNAMIC;
+static void *pulse_handle = NULL;
+static int pulse_loaded = 0;
+
+static pa_simple* (*SDL_NAME(pa_simple_new))(
+ const char *server,
+ const char *name,
+ pa_stream_direction_t dir,
+ const char *dev,
+ const char *stream_name,
+ const pa_sample_spec *ss,
+ const pa_channel_map *map,
+ const pa_buffer_attr *attr,
+ int *error
+);
+static void (*SDL_NAME(pa_simple_free))(pa_simple *s);
+
+static pa_channel_map* (*SDL_NAME(pa_channel_map_init_auto))(
+ pa_channel_map *m,
+ unsigned channels,
+ pa_channel_map_def_t def
+);
+
+static pa_mainloop * (*SDL_NAME(pa_mainloop_new))(void);
+static pa_mainloop_api * (*SDL_NAME(pa_mainloop_get_api))(pa_mainloop *m);
+static int (*SDL_NAME(pa_mainloop_iterate))(pa_mainloop *m, int block, int *retval);
+static void (*SDL_NAME(pa_mainloop_free))(pa_mainloop *m);
+
+static pa_operation_state_t (*SDL_NAME(pa_operation_get_state))(pa_operation *o);
+static void (*SDL_NAME(pa_operation_cancel))(pa_operation *o);
+static void (*SDL_NAME(pa_operation_unref))(pa_operation *o);
+
+static pa_context * (*SDL_NAME(pa_context_new))(
+ pa_mainloop_api *m, const char *name);
+static int (*SDL_NAME(pa_context_connect))(
+ pa_context *c, const char *server,
+ pa_context_flags_t flags, const pa_spawn_api *api);
+static pa_context_state_t (*SDL_NAME(pa_context_get_state))(pa_context *c);
+static void (*SDL_NAME(pa_context_disconnect))(pa_context *c);
+static void (*SDL_NAME(pa_context_unref))(pa_context *c);
+
+static pa_stream * (*SDL_NAME(pa_stream_new))(pa_context *c,
+ const char *name, const pa_sample_spec *ss, const pa_channel_map *map);
+static int (*SDL_NAME(pa_stream_connect_playback))(pa_stream *s, const char *dev,
+ const pa_buffer_attr *attr, pa_stream_flags_t flags,
+ pa_cvolume *volume, pa_stream *sync_stream);
+static pa_stream_state_t (*SDL_NAME(pa_stream_get_state))(pa_stream *s);
+static size_t (*SDL_NAME(pa_stream_writable_size))(pa_stream *s);
+static int (*SDL_NAME(pa_stream_write))(pa_stream *s, const void *data, size_t nbytes,
+ pa_free_cb_t free_cb, int64_t offset, pa_seek_mode_t seek);
+static pa_operation * (*SDL_NAME(pa_stream_drain))(pa_stream *s,
+ pa_stream_success_cb_t cb, void *userdata);
+static int (*SDL_NAME(pa_stream_disconnect))(pa_stream *s);
+static void (*SDL_NAME(pa_stream_unref))(pa_stream *s);
+static pa_operation* (*SDL_NAME(pa_context_set_name))(pa_context *c,
+ const char *name, pa_context_success_cb_t cb, void *userdata);
+
+static struct {
+ const char *name;
+ void **func;
+} pulse_functions[] = {
+ { "pa_simple_new",
+ (void **)&SDL_NAME(pa_simple_new) },
+ { "pa_simple_free",
+ (void **)&SDL_NAME(pa_simple_free) },
+ { "pa_channel_map_init_auto",
+ (void **)&SDL_NAME(pa_channel_map_init_auto) },
+ { "pa_mainloop_new",
+ (void **)&SDL_NAME(pa_mainloop_new) },
+ { "pa_mainloop_get_api",
+ (void **)&SDL_NAME(pa_mainloop_get_api) },
+ { "pa_mainloop_iterate",
+ (void **)&SDL_NAME(pa_mainloop_iterate) },
+ { "pa_mainloop_free",
+ (void **)&SDL_NAME(pa_mainloop_free) },
+ { "pa_operation_get_state",
+ (void **)&SDL_NAME(pa_operation_get_state) },
+ { "pa_operation_cancel",
+ (void **)&SDL_NAME(pa_operation_cancel) },
+ { "pa_operation_unref",
+ (void **)&SDL_NAME(pa_operation_unref) },
+ { "pa_context_new",
+ (void **)&SDL_NAME(pa_context_new) },
+ { "pa_context_connect",
+ (void **)&SDL_NAME(pa_context_connect) },
+ { "pa_context_get_state",
+ (void **)&SDL_NAME(pa_context_get_state) },
+ { "pa_context_disconnect",
+ (void **)&SDL_NAME(pa_context_disconnect) },
+ { "pa_context_unref",
+ (void **)&SDL_NAME(pa_context_unref) },
+ { "pa_stream_new",
+ (void **)&SDL_NAME(pa_stream_new) },
+ { "pa_stream_connect_playback",
+ (void **)&SDL_NAME(pa_stream_connect_playback) },
+ { "pa_stream_get_state",
+ (void **)&SDL_NAME(pa_stream_get_state) },
+ { "pa_stream_writable_size",
+ (void **)&SDL_NAME(pa_stream_writable_size) },
+ { "pa_stream_write",
+ (void **)&SDL_NAME(pa_stream_write) },
+ { "pa_stream_drain",
+ (void **)&SDL_NAME(pa_stream_drain) },
+ { "pa_stream_disconnect",
+ (void **)&SDL_NAME(pa_stream_disconnect) },
+ { "pa_stream_unref",
+ (void **)&SDL_NAME(pa_stream_unref) },
+ { "pa_context_set_name",
+ (void **)&SDL_NAME(pa_context_set_name) },
+};
+
+static void UnloadPulseLibrary()
+{
+ if ( pulse_loaded ) {
+ SDL_UnloadObject(pulse_handle);
+ pulse_handle = NULL;
+ pulse_loaded = 0;
+ }
+}
+
+static int LoadPulseLibrary(void)
+{
+ int i, retval = -1;
+
+ pulse_handle = SDL_LoadObject(pulse_library);
+ if ( pulse_handle ) {
+ pulse_loaded = 1;
+ retval = 0;
+ for ( i=0; i<SDL_arraysize(pulse_functions); ++i ) {
+ *pulse_functions[i].func = SDL_LoadFunction(pulse_handle, pulse_functions[i].name);
+ if ( !*pulse_functions[i].func ) {
+ retval = -1;
+ UnloadPulseLibrary();
+ break;
+ }
+ }
+ }
+ return retval;
+}
+
+#else
+
+static void UnloadPulseLibrary()
+{
+ return;
+}
+
+static int LoadPulseLibrary(void)
+{
+ return 0;
+}
+
+#endif /* SDL_AUDIO_DRIVER_PULSE_DYNAMIC */
+
+/* Audio driver bootstrap functions */
+
+static int Audio_Available(void)
+{
+ pa_sample_spec paspec;
+ pa_simple *connection;
+ int available;
+
+ available = 0;
+ if ( LoadPulseLibrary() < 0 ) {
+ return available;
+ }
+
+ /* Connect with a dummy format. */
+ paspec.format = PA_SAMPLE_U8;
+ paspec.rate = 11025;
+ paspec.channels = 1;
+ connection = SDL_NAME(pa_simple_new)(
+ NULL, /* server */
+ "Test stream", /* application name */
+ PA_STREAM_PLAYBACK, /* playback mode */
+ NULL, /* device on the server */
+ "Simple DirectMedia Layer", /* stream description */
+ &paspec, /* sample format spec */
+ NULL, /* channel map */
+ NULL, /* buffering attributes */
+ NULL /* error code */
+ );
+ if ( connection != NULL ) {
+ available = 1;
+ SDL_NAME(pa_simple_free)(connection);
+ }
+
+ UnloadPulseLibrary();
+ return(available);
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden->caption);
+ SDL_free(device->hidden);
+ SDL_free(device);
+ UnloadPulseLibrary();
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ LoadPulseLibrary();
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+
+ /* Set the function pointers */
+ this->OpenAudio = PULSE_OpenAudio;
+ this->WaitAudio = PULSE_WaitAudio;
+ this->PlayAudio = PULSE_PlayAudio;
+ this->GetAudioBuf = PULSE_GetAudioBuf;
+ this->CloseAudio = PULSE_CloseAudio;
+ this->WaitDone = PULSE_WaitDone;
+ this->SetCaption = PULSE_SetCaption;
+
+ this->free = Audio_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap PULSE_bootstrap = {
+ PULSE_DRIVER_NAME, "PulseAudio",
+ Audio_Available, Audio_CreateDevice
+};
+
+/* This function waits until it is possible to write a full sound buffer */
+static void PULSE_WaitAudio(_THIS)
+{
+ int size;
+ while(1) {
+ if (SDL_NAME(pa_context_get_state)(context) != PA_CONTEXT_READY ||
+ SDL_NAME(pa_stream_get_state)(stream) != PA_STREAM_READY ||
+ SDL_NAME(pa_mainloop_iterate)(mainloop, 1, NULL) < 0) {
+ this->enabled = 0;
+ return;
+ }
+ size = SDL_NAME(pa_stream_writable_size)(stream);
+ if (size >= mixlen)
+ return;
+ }
+}
+
+static void PULSE_PlayAudio(_THIS)
+{
+ /* Write the audio data */
+ if (SDL_NAME(pa_stream_write)(stream, mixbuf, mixlen, NULL, 0LL, PA_SEEK_RELATIVE) < 0)
+ this->enabled = 0;
+}
+
+static Uint8 *PULSE_GetAudioBuf(_THIS)
+{
+ return(mixbuf);
+}
+
+static void PULSE_CloseAudio(_THIS)
+{
+ if ( mixbuf != NULL ) {
+ SDL_FreeAudioMem(mixbuf);
+ mixbuf = NULL;
+ }
+ if ( stream != NULL ) {
+ SDL_NAME(pa_stream_disconnect)(stream);
+ SDL_NAME(pa_stream_unref)(stream);
+ stream = NULL;
+ }
+ if (context != NULL) {
+ SDL_NAME(pa_context_disconnect)(context);
+ SDL_NAME(pa_context_unref)(context);
+ context = NULL;
+ }
+ if (mainloop != NULL) {
+ SDL_NAME(pa_mainloop_free)(mainloop);
+ mainloop = NULL;
+ }
+}
+
+/* Try to get the name of the program */
+static char *get_progname(void)
+{
+#ifdef __LINUX__
+ char *progname = NULL;
+ FILE *fp;
+ static char temp[BUFSIZ];
+
+ SDL_snprintf(temp, SDL_arraysize(temp), "/proc/%d/cmdline", getpid());
+ fp = fopen(temp, "r");
+ if ( fp != NULL ) {
+ if ( fgets(temp, sizeof(temp)-1, fp) ) {
+ progname = SDL_strrchr(temp, '/');
+ if ( progname == NULL ) {
+ progname = temp;
+ } else {
+ progname = progname+1;
+ }
+ }
+ fclose(fp);
+ }
+ return(progname);
+#elif defined(__NetBSD__)
+ return getprogname();
+#else
+ return("unknown");
+#endif
+}
+
+static void caption_set_complete(pa_context *c, int success, void *userdata)
+{
+ /* no-op. */
+}
+
+static void PULSE_SetCaption(_THIS, const char *str)
+{
+ SDL_free(this->hidden->caption);
+ if ((str == NULL) || (*str == '\0')) {
+ str = get_progname(); /* set a default so SOMETHING shows up. */
+ }
+ this->hidden->caption = SDL_strdup(str);
+ if (context != NULL) {
+ SDL_NAME(pa_context_set_name)(context, this->hidden->caption,
+ caption_set_complete, 0);
+ }
+}
+
+static void stream_drain_complete(pa_stream *s, int success, void *userdata)
+{
+ /* no-op. */
+}
+
+static void PULSE_WaitDone(_THIS)
+{
+ pa_operation *o;
+
+ o = SDL_NAME(pa_stream_drain)(stream, stream_drain_complete, NULL);
+ if (!o)
+ return;
+
+ while (SDL_NAME(pa_operation_get_state)(o) != PA_OPERATION_DONE) {
+ if (SDL_NAME(pa_context_get_state)(context) != PA_CONTEXT_READY ||
+ SDL_NAME(pa_stream_get_state)(stream) != PA_STREAM_READY ||
+ SDL_NAME(pa_mainloop_iterate)(mainloop, 1, NULL) < 0) {
+ SDL_NAME(pa_operation_cancel)(o);
+ break;
+ }
+ }
+ SDL_NAME(pa_operation_unref)(o);
+}
+
+static int PULSE_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ int state;
+ Uint16 test_format;
+ pa_sample_spec paspec;
+ pa_buffer_attr paattr;
+ pa_channel_map pacmap;
+ pa_stream_flags_t flags = 0;
+
+ paspec.format = PA_SAMPLE_INVALID;
+ for ( test_format = SDL_FirstAudioFormat(spec->format); test_format; ) {
+ switch ( test_format ) {
+ case AUDIO_U8:
+ paspec.format = PA_SAMPLE_U8;
+ break;
+ case AUDIO_S16LSB:
+ paspec.format = PA_SAMPLE_S16LE;
+ break;
+ case AUDIO_S16MSB:
+ paspec.format = PA_SAMPLE_S16BE;
+ break;
+ }
+ if ( paspec.format != PA_SAMPLE_INVALID )
+ break;
+ test_format = SDL_NextAudioFormat();
+ }
+ if (paspec.format == PA_SAMPLE_INVALID ) {
+ SDL_SetError("Couldn't find any suitable audio formats");
+ return(-1);
+ }
+ spec->format = test_format;
+
+ paspec.channels = spec->channels;
+ paspec.rate = spec->freq;
+
+ /* Calculate the final parameters for this audio specification */
+#ifdef PA_STREAM_ADJUST_LATENCY
+ spec->samples /= 2; /* Mix in smaller chunck to avoid underruns */
+#endif
+ SDL_CalculateAudioSpec(spec);
+
+ /* Allocate mixing buffer */
+ mixlen = spec->size;
+ mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen);
+ if ( mixbuf == NULL ) {
+ return(-1);
+ }
+ SDL_memset(mixbuf, spec->silence, spec->size);
+
+ /* Reduced prebuffering compared to the defaults. */
+#ifdef PA_STREAM_ADJUST_LATENCY
+ paattr.tlength = mixlen * 4; /* 2x original requested bufsize */
+ paattr.prebuf = -1;
+ paattr.maxlength = -1;
+ paattr.minreq = mixlen; /* -1 can lead to pa_stream_writable_size()
+ >= mixlen never becoming true */
+ flags = PA_STREAM_ADJUST_LATENCY;
+#else
+ paattr.tlength = mixlen*2;
+ paattr.prebuf = mixlen*2;
+ paattr.maxlength = mixlen*2;
+ paattr.minreq = mixlen;
+#endif
+
+ /* The SDL ALSA output hints us that we use Windows' channel mapping */
+ /* http://bugzilla.libsdl.org/show_bug.cgi?id=110 */
+ SDL_NAME(pa_channel_map_init_auto)(
+ &pacmap, spec->channels, PA_CHANNEL_MAP_WAVEEX);
+
+ /* Set up a new main loop */
+ if (!(mainloop = SDL_NAME(pa_mainloop_new)())) {
+ PULSE_CloseAudio(this);
+ SDL_SetError("pa_mainloop_new() failed");
+ return(-1);
+ }
+
+ if (this->hidden->caption == NULL) {
+ char *title = NULL;
+ SDL_WM_GetCaption(&title, NULL);
+ PULSE_SetCaption(this, title);
+ }
+
+ mainloop_api = SDL_NAME(pa_mainloop_get_api)(mainloop);
+ if (!(context = SDL_NAME(pa_context_new)(mainloop_api,
+ this->hidden->caption))) {
+ PULSE_CloseAudio(this);
+ SDL_SetError("pa_context_new() failed");
+ return(-1);
+ }
+
+ /* Connect to the PulseAudio server */
+ if (SDL_NAME(pa_context_connect)(context, NULL, 0, NULL) < 0) {
+ PULSE_CloseAudio(this);
+ SDL_SetError("Could not setup connection to PulseAudio");
+ return(-1);
+ }
+
+ do {
+ if (SDL_NAME(pa_mainloop_iterate)(mainloop, 1, NULL) < 0) {
+ PULSE_CloseAudio(this);
+ SDL_SetError("pa_mainloop_iterate() failed");
+ return(-1);
+ }
+ state = SDL_NAME(pa_context_get_state)(context);
+ if (!PA_CONTEXT_IS_GOOD(state)) {
+ PULSE_CloseAudio(this);
+ SDL_SetError("Could not connect to PulseAudio");
+ return(-1);
+ }
+ } while (state != PA_CONTEXT_READY);
+
+ stream = SDL_NAME(pa_stream_new)(
+ context,
+ "Simple DirectMedia Layer", /* stream description */
+ &paspec, /* sample format spec */
+ &pacmap /* channel map */
+ );
+ if ( stream == NULL ) {
+ PULSE_CloseAudio(this);
+ SDL_SetError("Could not setup PulseAudio stream");
+ return(-1);
+ }
+
+ if (SDL_NAME(pa_stream_connect_playback)(stream, NULL, &paattr, flags,
+ NULL, NULL) < 0) {
+ PULSE_CloseAudio(this);
+ SDL_SetError("Could not connect PulseAudio stream");
+ return(-1);
+ }
+
+ do {
+ if (SDL_NAME(pa_mainloop_iterate)(mainloop, 1, NULL) < 0) {
+ PULSE_CloseAudio(this);
+ SDL_SetError("pa_mainloop_iterate() failed");
+ return(-1);
+ }
+ state = SDL_NAME(pa_stream_get_state)(stream);
+ if (!PA_STREAM_IS_GOOD(state)) {
+ PULSE_CloseAudio(this);
+ SDL_SetError("Could not create to PulseAudio stream");
+ return(-1);
+ }
+ } while (state != PA_STREAM_READY);
+
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/src/audio/pulse/SDL_pulseaudio.h b/distrib/sdl-1.2.15/src/audio/pulse/SDL_pulseaudio.h
new file mode 100644
index 0000000..63ee751
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/pulse/SDL_pulseaudio.h
@@ -0,0 +1,73 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Stéphan Kochen
+ stephan@kochen.nl
+
+ Based on parts of the ALSA and ESounD output drivers.
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_pulseaudio_h
+#define _SDL_pulseaudio_h
+
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_AudioDevice *this
+
+struct SDL_PrivateAudioData {
+ pa_mainloop *mainloop;
+ pa_mainloop_api *mainloop_api;
+ pa_context *context;
+ pa_stream *stream;
+
+ char *caption;
+
+ /* Raw mixing buffer */
+ Uint8 *mixbuf;
+ int mixlen;
+};
+
+#if (PA_API_VERSION < 12)
+/** Return non-zero if the passed state is one of the connected states */
+static inline int PA_CONTEXT_IS_GOOD(pa_context_state_t x) {
+ return
+ x == PA_CONTEXT_CONNECTING ||
+ x == PA_CONTEXT_AUTHORIZING ||
+ x == PA_CONTEXT_SETTING_NAME ||
+ x == PA_CONTEXT_READY;
+}
+/** Return non-zero if the passed state is one of the connected states */
+static inline int PA_STREAM_IS_GOOD(pa_stream_state_t x) {
+ return
+ x == PA_STREAM_CREATING ||
+ x == PA_STREAM_READY;
+}
+#endif /* pulseaudio <= 0.9.10 */
+
+/* Old variable names */
+#define mainloop (this->hidden->mainloop)
+#define mainloop_api (this->hidden->mainloop_api)
+#define context (this->hidden->context)
+#define stream (this->hidden->stream)
+#define mixbuf (this->hidden->mixbuf)
+#define mixlen (this->hidden->mixlen)
+
+#endif /* _SDL_pulseaudio_h */
+
diff --git a/distrib/sdl-1.2.15/src/audio/sun/SDL_sunaudio.c b/distrib/sdl-1.2.15/src/audio/sun/SDL_sunaudio.c
new file mode 100644
index 0000000..7a39e71
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/sun/SDL_sunaudio.c
@@ -0,0 +1,432 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Allow access to a raw mixing buffer */
+
+#include <fcntl.h>
+#include <errno.h>
+#ifdef __NETBSD__
+#include <sys/ioctl.h>
+#include <sys/audioio.h>
+#endif
+#ifdef __SVR4
+#include <sys/audioio.h>
+#else
+#include <sys/time.h>
+#include <sys/types.h>
+#endif
+#include <unistd.h>
+
+#include "SDL_timer.h"
+#include "SDL_audio.h"
+#include "../SDL_audiomem.h"
+#include "../SDL_audio_c.h"
+#include "../SDL_audiodev_c.h"
+#include "SDL_sunaudio.h"
+
+/* Open the audio device for playback, and don't block if busy */
+#define OPEN_FLAGS (O_WRONLY|O_NONBLOCK)
+
+/* Audio driver functions */
+static int DSP_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void DSP_WaitAudio(_THIS);
+static void DSP_PlayAudio(_THIS);
+static Uint8 *DSP_GetAudioBuf(_THIS);
+static void DSP_CloseAudio(_THIS);
+
+static Uint8 snd2au(int sample);
+
+/* Audio driver bootstrap functions */
+
+static int Audio_Available(void)
+{
+ int fd;
+ int available;
+
+ available = 0;
+ fd = SDL_OpenAudioPath(NULL, 0, OPEN_FLAGS, 1);
+ if ( fd >= 0 ) {
+ available = 1;
+ close(fd);
+ }
+ return(available);
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+ audio_fd = -1;
+
+ /* Set the function pointers */
+ this->OpenAudio = DSP_OpenAudio;
+ this->WaitAudio = DSP_WaitAudio;
+ this->PlayAudio = DSP_PlayAudio;
+ this->GetAudioBuf = DSP_GetAudioBuf;
+ this->CloseAudio = DSP_CloseAudio;
+
+ this->free = Audio_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap SUNAUDIO_bootstrap = {
+ "audio", "UNIX /dev/audio interface",
+ Audio_Available, Audio_CreateDevice
+};
+
+#ifdef DEBUG_AUDIO
+void CheckUnderflow(_THIS)
+{
+#ifdef AUDIO_GETINFO
+ audio_info_t info;
+ int left;
+
+ ioctl(audio_fd, AUDIO_GETINFO, &info);
+ left = (written - info.play.samples);
+ if ( written && (left == 0) ) {
+ fprintf(stderr, "audio underflow!\n");
+ }
+#endif
+}
+#endif
+
+void DSP_WaitAudio(_THIS)
+{
+#ifdef AUDIO_GETINFO
+#define SLEEP_FUDGE 10 /* 10 ms scheduling fudge factor */
+ audio_info_t info;
+ Sint32 left;
+
+ ioctl(audio_fd, AUDIO_GETINFO, &info);
+ left = (written - info.play.samples);
+ if ( left > fragsize ) {
+ Sint32 sleepy;
+
+ sleepy = ((left - fragsize)/frequency);
+ sleepy -= SLEEP_FUDGE;
+ if ( sleepy > 0 ) {
+ SDL_Delay(sleepy);
+ }
+ }
+#else
+ fd_set fdset;
+
+ FD_ZERO(&fdset);
+ FD_SET(audio_fd, &fdset);
+ select(audio_fd+1, NULL, &fdset, NULL, NULL);
+#endif
+}
+
+void DSP_PlayAudio(_THIS)
+{
+ /* Write the audio data */
+ if ( ulaw_only ) {
+ /* Assuming that this->spec.freq >= 8000 Hz */
+ int accum, incr, pos;
+ Uint8 *aubuf;
+
+ accum = 0;
+ incr = this->spec.freq/8;
+ aubuf = ulaw_buf;
+ switch (audio_fmt & 0xFF) {
+ case 8: {
+ Uint8 *sndbuf;
+
+ sndbuf = mixbuf;
+ for ( pos=0; pos < fragsize; ++pos ) {
+ *aubuf = snd2au((0x80-*sndbuf)*64);
+ accum += incr;
+ while ( accum > 0 ) {
+ accum -= 1000;
+ sndbuf += 1;
+ }
+ aubuf += 1;
+ }
+ }
+ break;
+ case 16: {
+ Sint16 *sndbuf;
+
+ sndbuf = (Sint16 *)mixbuf;
+ for ( pos=0; pos < fragsize; ++pos ) {
+ *aubuf = snd2au(*sndbuf/4);
+ accum += incr;
+ while ( accum > 0 ) {
+ accum -= 1000;
+ sndbuf += 1;
+ }
+ aubuf += 1;
+ }
+ }
+ break;
+ }
+#ifdef DEBUG_AUDIO
+ CheckUnderflow(this);
+#endif
+ if ( write(audio_fd, ulaw_buf, fragsize) < 0 ) {
+ /* Assume fatal error, for now */
+ this->enabled = 0;
+ }
+ written += fragsize;
+ } else {
+#ifdef DEBUG_AUDIO
+ CheckUnderflow(this);
+#endif
+ if ( write(audio_fd, mixbuf, this->spec.size) < 0 ) {
+ /* Assume fatal error, for now */
+ this->enabled = 0;
+ }
+ written += fragsize;
+ }
+}
+
+Uint8 *DSP_GetAudioBuf(_THIS)
+{
+ return(mixbuf);
+}
+
+void DSP_CloseAudio(_THIS)
+{
+ if ( mixbuf != NULL ) {
+ SDL_FreeAudioMem(mixbuf);
+ mixbuf = NULL;
+ }
+ if ( ulaw_buf != NULL ) {
+ SDL_free(ulaw_buf);
+ ulaw_buf = NULL;
+ }
+ close(audio_fd);
+}
+
+int DSP_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ char audiodev[1024];
+#ifdef AUDIO_SETINFO
+ int enc;
+#endif
+ int desired_freq = spec->freq;
+
+ /* Initialize our freeable variables, in case we fail*/
+ audio_fd = -1;
+ mixbuf = NULL;
+ ulaw_buf = NULL;
+
+ /* Determine the audio parameters from the AudioSpec */
+ switch ( spec->format & 0xFF ) {
+
+ case 8: { /* Unsigned 8 bit audio data */
+ spec->format = AUDIO_U8;
+#ifdef AUDIO_SETINFO
+ enc = AUDIO_ENCODING_LINEAR8;
+#endif
+ }
+ break;
+
+ case 16: { /* Signed 16 bit audio data */
+ spec->format = AUDIO_S16SYS;
+#ifdef AUDIO_SETINFO
+ enc = AUDIO_ENCODING_LINEAR;
+#endif
+ }
+ break;
+
+ default: {
+ SDL_SetError("Unsupported audio format");
+ return(-1);
+ }
+ }
+ audio_fmt = spec->format;
+
+ /* Open the audio device */
+ audio_fd = SDL_OpenAudioPath(audiodev, sizeof(audiodev), OPEN_FLAGS, 1);
+ if ( audio_fd < 0 ) {
+ SDL_SetError("Couldn't open %s: %s", audiodev,
+ strerror(errno));
+ return(-1);
+ }
+
+ ulaw_only = 0; /* modern Suns do support linear audio */
+#ifdef AUDIO_SETINFO
+ for(;;) {
+ audio_info_t info;
+ AUDIO_INITINFO(&info); /* init all fields to "no change" */
+
+ /* Try to set the requested settings */
+ info.play.sample_rate = spec->freq;
+ info.play.channels = spec->channels;
+ info.play.precision = (enc == AUDIO_ENCODING_ULAW)
+ ? 8 : spec->format & 0xff;
+ info.play.encoding = enc;
+ if( ioctl(audio_fd, AUDIO_SETINFO, &info) == 0 ) {
+
+ /* Check to be sure we got what we wanted */
+ if(ioctl(audio_fd, AUDIO_GETINFO, &info) < 0) {
+ SDL_SetError("Error getting audio parameters: %s",
+ strerror(errno));
+ return -1;
+ }
+ if(info.play.encoding == enc
+ && info.play.precision == (spec->format & 0xff)
+ && info.play.channels == spec->channels) {
+ /* Yow! All seems to be well! */
+ spec->freq = info.play.sample_rate;
+ break;
+ }
+ }
+
+ switch(enc) {
+ case AUDIO_ENCODING_LINEAR8:
+ /* unsigned 8bit apparently not supported here */
+ enc = AUDIO_ENCODING_LINEAR;
+ spec->format = AUDIO_S16SYS;
+ break; /* try again */
+
+ case AUDIO_ENCODING_LINEAR:
+ /* linear 16bit didn't work either, resort to µ-law */
+ enc = AUDIO_ENCODING_ULAW;
+ spec->channels = 1;
+ spec->freq = 8000;
+ spec->format = AUDIO_U8;
+ ulaw_only = 1;
+ break;
+
+ default:
+ /* oh well... */
+ SDL_SetError("Error setting audio parameters: %s",
+ strerror(errno));
+ return -1;
+ }
+ }
+#endif /* AUDIO_SETINFO */
+ written = 0;
+
+ /* We can actually convert on-the-fly to U-Law */
+ if ( ulaw_only ) {
+ spec->freq = desired_freq;
+ fragsize = (spec->samples*1000)/(spec->freq/8);
+ frequency = 8;
+ ulaw_buf = (Uint8 *)SDL_malloc(fragsize);
+ if ( ulaw_buf == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ spec->channels = 1;
+ } else {
+ fragsize = spec->samples;
+ frequency = spec->freq/1000;
+ }
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Audio device %s U-Law only\n",
+ ulaw_only ? "is" : "is not");
+ fprintf(stderr, "format=0x%x chan=%d freq=%d\n",
+ spec->format, spec->channels, spec->freq);
+#endif
+
+ /* Update the fragment size as size in bytes */
+ SDL_CalculateAudioSpec(spec);
+
+ /* Allocate mixing buffer */
+ mixbuf = (Uint8 *)SDL_AllocAudioMem(spec->size);
+ if ( mixbuf == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ SDL_memset(mixbuf, spec->silence, spec->size);
+
+ /* We're ready to rock and roll. :-) */
+ return(0);
+}
+
+/************************************************************************/
+/* This function (snd2au()) copyrighted: */
+/************************************************************************/
+/* Copyright 1989 by Rich Gopstein and Harris Corporation */
+/* */
+/* Permission to use, copy, modify, and distribute this software */
+/* and its documentation for any purpose and without fee is */
+/* hereby granted, provided that the above copyright notice */
+/* appears in all copies and that both that copyright notice and */
+/* this permission notice appear in supporting documentation, and */
+/* that the name of Rich Gopstein and Harris Corporation not be */
+/* used in advertising or publicity pertaining to distribution */
+/* of the software without specific, written prior permission. */
+/* Rich Gopstein and Harris Corporation make no representations */
+/* about the suitability of this software for any purpose. It */
+/* provided "as is" without express or implied warranty. */
+/************************************************************************/
+
+static Uint8 snd2au(int sample)
+{
+
+ int mask;
+
+ if (sample < 0) {
+ sample = -sample;
+ mask = 0x7f;
+ } else {
+ mask = 0xff;
+ }
+
+ if (sample < 32) {
+ sample = 0xF0 | (15 - sample / 2);
+ } else if (sample < 96) {
+ sample = 0xE0 | (15 - (sample - 32) / 4);
+ } else if (sample < 224) {
+ sample = 0xD0 | (15 - (sample - 96) / 8);
+ } else if (sample < 480) {
+ sample = 0xC0 | (15 - (sample - 224) / 16);
+ } else if (sample < 992) {
+ sample = 0xB0 | (15 - (sample - 480) / 32);
+ } else if (sample < 2016) {
+ sample = 0xA0 | (15 - (sample - 992) / 64);
+ } else if (sample < 4064) {
+ sample = 0x90 | (15 - (sample - 2016) / 128);
+ } else if (sample < 8160) {
+ sample = 0x80 | (15 - (sample - 4064) / 256);
+ } else {
+ sample = 0x80;
+ }
+ return (mask & sample);
+}
diff --git a/distrib/sdl-1.2.15/src/audio/sun/SDL_sunaudio.h b/distrib/sdl-1.2.15/src/audio/sun/SDL_sunaudio.h
new file mode 100644
index 0000000..e6be419
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/sun/SDL_sunaudio.h
@@ -0,0 +1,55 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_lowaudio_h
+#define _SDL_lowaudio_h
+
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_AudioDevice *this
+
+struct SDL_PrivateAudioData {
+ /* The file descriptor for the audio device */
+ int audio_fd;
+
+ Uint16 audio_fmt; /* The app audio format */
+ Uint8 *mixbuf; /* The app mixing buffer */
+ int ulaw_only; /* Flag -- does hardware only output U-law? */
+ Uint8 *ulaw_buf; /* The U-law mixing buffer */
+ Sint32 written; /* The number of samples written */
+ int fragsize; /* The audio fragment size in samples */
+ int frequency; /* The audio frequency in KHz */
+};
+
+/* Old variable names */
+#define audio_fd (this->hidden->audio_fd)
+#define audio_fmt (this->hidden->audio_fmt)
+#define mixbuf (this->hidden->mixbuf)
+#define ulaw_only (this->hidden->ulaw_only)
+#define ulaw_buf (this->hidden->ulaw_buf)
+#define written (this->hidden->written)
+#define fragsize (this->hidden->fragsize)
+#define frequency (this->hidden->frequency)
+
+#endif /* _SDL_lowaudio_h */
diff --git a/distrib/sdl-1.2.15/src/audio/symbian/SDL_epocaudio.cpp b/distrib/sdl-1.2.15/src/audio/symbian/SDL_epocaudio.cpp
new file mode 100644
index 0000000..72a4eaf
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/symbian/SDL_epocaudio.cpp
@@ -0,0 +1,614 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@devolution.com
+*/
+
+/*
+ SDL_epocaudio.cpp
+ Epoc based SDL audio driver implementation
+
+ Markus Mertama
+*/
+
+#ifdef SAVE_RCSID
+static char rcsid =
+ "@(#) $Id: SDL_epocaudio.c,v 0.0.0.0 2001/06/19 17:19:56 hercules Exp $";
+#endif
+
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+
+#include "epoc_sdl.h"
+
+#include <e32hal.h>
+
+
+extern "C" {
+#include "SDL_audio.h"
+#include "SDL_error.h"
+#include "SDL_audiomem.h"
+#include "SDL_audio_c.h"
+#include "SDL_timer.h"
+#include "SDL_audiodev_c.h"
+}
+
+#include "SDL_epocaudio.h"
+
+#include "streamplayer.h"
+
+
+//#define DEBUG_AUDIO
+
+
+/* Audio driver functions */
+
+static int EPOC_OpenAudio(SDL_AudioDevice *thisdevice, SDL_AudioSpec *spec);
+static void EPOC_WaitAudio(SDL_AudioDevice *thisdevice);
+static void EPOC_PlayAudio(SDL_AudioDevice *thisdevice);
+static Uint8 *EPOC_GetAudioBuf(SDL_AudioDevice *thisdevice);
+static void EPOC_CloseAudio(SDL_AudioDevice *thisdevice);
+static void EPOC_ThreadInit(SDL_AudioDevice *thisdevice);
+
+static int Audio_Available(void);
+static SDL_AudioDevice *Audio_CreateDevice(int devindex);
+static void Audio_DeleteDevice(SDL_AudioDevice *device);
+
+
+//void sos_adump(SDL_AudioDevice* thisdevice, void* data, int len);
+
+#ifdef __WINS__
+#define DODUMP
+#endif
+
+#ifdef DODUMP
+NONSHARABLE_CLASS(TDump)
+ {
+ public:
+ TInt Open();
+ void Close();
+ void Dump(const TDesC8& aDes);
+ private:
+ RFile iFile;
+ RFs iFs;
+ };
+
+TInt TDump::Open()
+ {
+ TInt err = iFs.Connect();
+ if(err == KErrNone)
+ {
+#ifdef __WINS__
+_LIT(target, "C:\\sdlau.raw");
+#else
+_LIT(target, "E:\\sdlau.raw");
+#endif
+ err = iFile.Replace(iFs, target, EFileWrite);
+ }
+ return err;
+ }
+void TDump::Close()
+ {
+ iFile.Close();
+ iFs.Close();
+ }
+void TDump::Dump(const TDesC8& aDes)
+ {
+ iFile.Write(aDes);
+ }
+#endif
+
+
+NONSHARABLE_CLASS(CSimpleWait) : public CTimer
+ {
+ public:
+ void Wait(TTimeIntervalMicroSeconds32 aWait);
+ static CSimpleWait* NewL();
+ private:
+ CSimpleWait();
+ void RunL();
+ };
+
+
+CSimpleWait* CSimpleWait::NewL()
+ {
+ CSimpleWait* wait = new (ELeave) CSimpleWait();
+ CleanupStack::PushL(wait);
+ wait->ConstructL();
+ CleanupStack::Pop();
+ return wait;
+ }
+
+void CSimpleWait::Wait(TTimeIntervalMicroSeconds32 aWait)
+ {
+ After(aWait);
+ CActiveScheduler::Start();
+ }
+
+CSimpleWait::CSimpleWait() : CTimer(CActive::EPriorityStandard)
+ {
+ CActiveScheduler::Add(this);
+ }
+
+void CSimpleWait::RunL()
+ {
+ CActiveScheduler::Stop();
+ }
+
+const TInt KAudioBuffers(2);
+
+
+NONSHARABLE_CLASS(CEpocAudio) : public CBase, public MStreamObs, public MStreamProvider
+ {
+ public:
+ static void* NewL(TInt BufferSize, TInt aFill);
+ inline static CEpocAudio& Current(SDL_AudioDevice* thisdevice);
+
+ static void Free(SDL_AudioDevice* thisdevice);
+
+ void Wait();
+ void Play();
+ // void SetBuffer(const TDesC8& aBuffer);
+ void ThreadInitL(TAny* aDevice);
+ void Open(TInt iRate, TInt iChannels, TUint32 aType, TInt aBytes);
+ ~CEpocAudio();
+ TUint8* Buffer();
+ TBool SetPause(TBool aPause);
+ #ifdef DODUMP
+ void Dump(const TDesC8& aBuf) {iDump.Dump(aBuf);}
+ #endif
+ private:
+ CEpocAudio(TInt aBufferSize);
+ void Complete(TInt aState, TInt aError);
+ TPtrC8 Data();
+ void ConstructL(TInt aFill);
+ private:
+ TInt iBufferSize;
+ CStreamPlayer* iPlayer;
+ TInt iBufferRate;
+ TInt iRate;
+ TInt iChannels;
+ TUint32 iType;
+ TInt iPosition;
+ TThreadId iTid;
+ TUint8* iAudioPtr;
+ TUint8* iBuffer;
+ // TTimeIntervalMicroSeconds iStart;
+ TTime iStart;
+ TInt iTune;
+ CSimpleWait* iWait;
+ #ifdef DODUMP
+ TDump iDump;
+ #endif
+ };
+
+inline CEpocAudio& CEpocAudio::Current(SDL_AudioDevice* thisdevice)
+ {
+ return *static_cast<CEpocAudio*>((void*)thisdevice->hidden);
+ }
+
+/*
+
+TBool EndSc(TAny*)
+ {
+ CActiveScheduler::Stop();
+ }
+
+LOCAL_C void CleanScL()
+ {
+ CIdle* d = CIdle::NewLC(CActive:::EPriorityIdle);
+ d->Start(TCallBack(EndSc));
+ CActiveScheduler::Start();
+
+ }
+*/
+
+void CEpocAudio::Free(SDL_AudioDevice* thisdevice)
+ {
+ CEpocAudio* ea = static_cast<CEpocAudio*>((void*)thisdevice->hidden);
+ if(ea)
+ {
+ ASSERT(ea->iTid == RThread().Id());
+ delete ea;
+ thisdevice->hidden = NULL;
+
+ CActiveScheduler* as = CActiveScheduler::Current();
+ ASSERT(as->StackDepth() == 0);
+ delete as;
+ CActiveScheduler::Install(NULL);
+ }
+ ASSERT(thisdevice->hidden == NULL);
+ }
+
+CEpocAudio::CEpocAudio(TInt aBufferSize) : iBufferSize(aBufferSize), iPosition(-1)
+ {
+ }
+
+void* CEpocAudio::NewL(TInt aBufferSize, TInt aFill)
+ {
+ CEpocAudio* eAudioLib = new (ELeave) CEpocAudio(aBufferSize);
+ CleanupStack::PushL(eAudioLib);
+ eAudioLib->ConstructL(aFill);
+ CleanupStack::Pop();
+ return eAudioLib;
+ }
+
+void CEpocAudio::ConstructL(TInt aFill)
+ {
+ iBuffer = (TUint8*) User::AllocL(KAudioBuffers * iBufferSize);
+ memset(iBuffer, aFill, KAudioBuffers * iBufferSize);
+ iAudioPtr = iBuffer;
+ }
+
+
+TBool CEpocAudio::SetPause(TBool aPause)
+ {
+ if(aPause && iPosition >= 0)
+ {
+ iPosition = -1;
+ if(iPlayer != NULL)
+ iPlayer->Stop();
+ }
+ if(!aPause && iPosition < 0)
+ {
+ iPosition = 0;
+ if(iPlayer != NULL)
+ iPlayer->Start();
+ }
+ return iPosition < 0;
+ }
+
+void CEpocAudio::ThreadInitL(TAny* aDevice)
+ {
+ iTid = RThread().Id();
+ CActiveScheduler* as = new (ELeave) CActiveScheduler();
+ CActiveScheduler::Install(as);
+
+ EpocSdlEnv::AppendCleanupItem(TSdlCleanupItem((TSdlCleanupOperation)EPOC_CloseAudio, aDevice));
+
+ iWait = CSimpleWait::NewL();
+
+ iPlayer = new (ELeave) CStreamPlayer(*this, *this);
+ iPlayer->ConstructL();
+ iPlayer->OpenStream(iRate, iChannels, iType);
+
+ #ifdef DODUMP
+ User::LeaveIfError(iDump.Open());
+ #endif
+ }
+
+
+
+TUint8* CEpocAudio::Buffer()
+ {
+ iStart.UniversalTime();
+// iStart = iPlayer->Position();
+ return iAudioPtr;
+
+ }
+
+CEpocAudio::~CEpocAudio()
+ {
+ if(iWait != NULL)
+ iWait->Cancel();
+ delete iWait;
+ if(iPlayer != NULL)
+ iPlayer->Close();
+ delete iPlayer;
+ delete iBuffer;
+ }
+
+void CEpocAudio::Complete(TInt aState, TInt aError)
+ {
+ if(aState == MStreamObs::EClose)
+ {
+ }
+ if(iPlayer->Closed())
+ return;
+ switch(aError)
+ {
+ case KErrUnderflow:
+ case KErrInUse:
+ iPlayer->Start();
+ break;
+ case KErrAbort:
+ iPlayer->Open();
+ }
+ }
+
+
+void sos_adump(SDL_AudioDevice* thisdevice, void* data, int len)
+ {
+#ifdef DODUMP
+ const TPtrC8 buf((TUint8*)data, len);
+ CEpocAudio::Current(thisdevice).Dump(buf);
+#endif
+ }
+
+const TInt KClip(256);
+
+TPtrC8 CEpocAudio::Data()
+ {
+ if(iPosition < 0)
+ return KNullDesC8();
+
+ TPtrC8 data(iAudioPtr + iPosition, KClip);
+
+#ifdef DODUMP
+ iDump.Dump(data);
+#endif
+
+ iPosition += KClip;
+ if(iPosition >= iBufferSize)
+ {
+
+/* if(iAudioPtr == iBuffer)
+ iAudioPtr = iBuffer + iBufferSize;
+ else
+ iAudioPtr = iBuffer;
+*/
+ iAudioPtr += iBufferSize;
+
+ if((iAudioPtr - iBuffer) >= KAudioBuffers * iBufferSize)
+ iAudioPtr = iBuffer;
+
+ iPosition = -1;
+ if(iWait->IsActive())
+ {
+ iWait->Cancel();
+ CActiveScheduler::Stop();
+ }
+ }
+ return data;
+ }
+
+
+
+
+void CEpocAudio::Play()
+ {
+ iPosition = 0;
+ }
+
+void CEpocAudio::Wait()
+ {
+ if(iPosition >= 0 /*&& iPlayer->Playing()*/)
+ {
+ const TInt64 bufMs = TInt64(iBufferSize - KClip) * TInt64(1000000);
+ const TInt64 specTime = bufMs / TInt64(iRate * iChannels * 2);
+ iWait->After(specTime);
+
+ CActiveScheduler::Start();
+ TTime end;
+ end.UniversalTime();
+ const TTimeIntervalMicroSeconds delta = end.MicroSecondsFrom(iStart);
+
+
+// const TTimeIntervalMicroSeconds end = iPlayer->Position();
+
+
+
+
+ const TInt diff = specTime - delta.Int64();
+
+ if(diff > 0 && diff < 200000)
+ {
+ User::After(diff);
+ }
+
+ }
+ else
+ {
+ User::After(10000);
+// iWait->Wait(10000); //just give some time...
+ }
+ }
+
+void CEpocAudio::Open(TInt aRate, TInt aChannels, TUint32 aType, TInt aBytes)
+ {
+ iRate = aRate;
+ iChannels = aChannels;
+ iType = aType;
+ iBufferRate = iRate * iChannels * aBytes; //1/x
+ }
+
+
+/* Audio driver bootstrap functions */
+
+AudioBootStrap EPOCAudio_bootstrap = {
+ "epoc\0\0\0",
+ "EPOC streaming audio\0\0\0",
+ Audio_Available,
+ Audio_CreateDevice
+};
+
+
+static SDL_AudioDevice *Audio_CreateDevice(int /*devindex*/)
+{
+ SDL_AudioDevice *thisdevice;
+
+ /* Initialize all variables that we clean on shutdown */
+ thisdevice = (SDL_AudioDevice *)malloc(sizeof(SDL_AudioDevice));
+ if ( thisdevice ) {
+ memset(thisdevice, 0, (sizeof *thisdevice));
+ thisdevice->hidden = NULL; /*(struct SDL_PrivateAudioData *)
+ malloc((sizeof thisdevice->hidden)); */
+ }
+ if ( (thisdevice == NULL) /*|| (thisdevice->hidden == NULL) */) {
+ SDL_OutOfMemory();
+ if ( thisdevice ) {
+ free(thisdevice);
+ }
+ return(0);
+ }
+// memset(thisdevice->hidden, 0, (sizeof *thisdevice->hidden));
+
+ /* Set the function pointers */
+ thisdevice->OpenAudio = EPOC_OpenAudio;
+ thisdevice->WaitAudio = EPOC_WaitAudio;
+ thisdevice->PlayAudio = EPOC_PlayAudio;
+ thisdevice->GetAudioBuf = EPOC_GetAudioBuf;
+ thisdevice->CloseAudio = EPOC_CloseAudio;
+ thisdevice->ThreadInit = EPOC_ThreadInit;
+ thisdevice->free = Audio_DeleteDevice;
+
+ return thisdevice;
+}
+
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+ {
+ //free(device->hidden);
+ free(device);
+ }
+
+static int Audio_Available(void)
+{
+ return(1); // Audio stream modules should be always there!
+}
+
+
+static int EPOC_OpenAudio(SDL_AudioDevice *thisdevice, SDL_AudioSpec *spec)
+{
+ SDL_TRACE("SDL:EPOC_OpenAudio");
+
+
+ TUint32 type = KMMFFourCCCodePCM16;
+ TInt bytes = 2;
+
+ switch(spec->format)
+ {
+ case AUDIO_U16LSB:
+ type = KMMFFourCCCodePCMU16;
+ break;
+ case AUDIO_S16LSB:
+ type = KMMFFourCCCodePCM16;
+ break;
+ case AUDIO_U16MSB:
+ type = KMMFFourCCCodePCMU16B;
+ break;
+ case AUDIO_S16MSB:
+ type = KMMFFourCCCodePCM16B;
+ break;
+ //8 bit not supported!
+ case AUDIO_U8:
+ case AUDIO_S8:
+ default:
+ spec->format = AUDIO_S16LSB;
+ };
+
+
+
+ if(spec->channels > 2)
+ spec->channels = 2;
+
+ spec->freq = CStreamPlayer::ClosestSupportedRate(spec->freq);
+
+
+ /* Allocate mixing buffer */
+ const TInt buflen = spec->size;// * bytes * spec->channels;
+// audiobuf = NULL;
+
+ TRAPD(err, thisdevice->hidden = static_cast<SDL_PrivateAudioData*>(CEpocAudio::NewL(buflen, spec->silence)));
+ if(err != KErrNone)
+ return -1;
+
+ CEpocAudio::Current(thisdevice).Open(spec->freq, spec->channels, type, bytes);
+
+ CEpocAudio::Current(thisdevice).SetPause(ETrue);
+
+ // isSDLAudioPaused = 1;
+
+ thisdevice->enabled = 0; /* enable only after audio engine has been initialized!*/
+
+ /* We're ready to rock and roll. :-) */
+ return(0);
+}
+
+
+static void EPOC_CloseAudio(SDL_AudioDevice* thisdevice)
+ {
+#ifdef DEBUG_AUDIO
+ SDL_TRACE("Close audio\n");
+#endif
+
+ CEpocAudio::Free(thisdevice);
+ }
+
+
+static void EPOC_ThreadInit(SDL_AudioDevice *thisdevice)
+ {
+ SDL_TRACE("SDL:EPOC_ThreadInit");
+ CEpocAudio::Current(thisdevice).ThreadInitL(thisdevice);
+ RThread().SetPriority(EPriorityMore);
+ thisdevice->enabled = 1;
+ }
+
+/* This function waits until it is possible to write a full sound buffer */
+static void EPOC_WaitAudio(SDL_AudioDevice* thisdevice)
+{
+#ifdef DEBUG_AUDIO
+ SDL_TRACE1("wait %d audio\n", CEpocAudio::AudioLib().StreamPlayer(KSfxChannel).SyncTime());
+ TInt tics = User::TickCount();
+#endif
+
+ CEpocAudio::Current(thisdevice).Wait();
+
+#ifdef DEBUG_AUDIO
+ TInt ntics = User::TickCount() - tics;
+ SDL_TRACE1("audio waited %d\n", ntics);
+ SDL_TRACE1("audio at %d\n", tics);
+#endif
+}
+
+
+
+static void EPOC_PlayAudio(SDL_AudioDevice* thisdevice)
+ {
+ if(CEpocAudio::Current(thisdevice).SetPause(SDL_GetAudioStatus() == SDL_AUDIO_PAUSED))
+ SDL_Delay(500); //hold on the busy loop
+ else
+ CEpocAudio::Current(thisdevice).Play();
+
+#ifdef DEBUG_AUDIO
+ SDL_TRACE("buffer has audio data\n");
+#endif
+
+
+#ifdef DEBUG_AUDIO
+ SDL_TRACE1("Wrote %d bytes of audio data\n", buflen);
+#endif
+}
+
+static Uint8 *EPOC_GetAudioBuf(SDL_AudioDevice* thisdevice)
+ {
+ return CEpocAudio::Current(thisdevice).Buffer();
+ }
+
+
+
diff --git a/distrib/sdl-1.2.15/src/audio/symbian/SDL_epocaudio.h b/distrib/sdl-1.2.15/src/audio/symbian/SDL_epocaudio.h
new file mode 100644
index 0000000..5c95c86
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/symbian/SDL_epocaudio.h
@@ -0,0 +1,37 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@devolution.com
+*/
+
+
+#ifdef SAVE_RCSID
+static char rcsid =
+ "@(#) $Id: SDL_epocaudio.h,v 1.1.2.2 2001/02/10 07:20:03 hercules Exp $";
+#endif
+
+#ifndef _SDL_EPOCAUDIO_H
+#define _SDL_EPOCAUDIO_H
+
+extern "C" {
+#include "SDL_sysaudio.h"
+}
+
+
+#endif /* _SDL_EPOCAUDIO_H */
diff --git a/distrib/sdl-1.2.15/src/audio/symbian/streamplayer.cpp b/distrib/sdl-1.2.15/src/audio/symbian/streamplayer.cpp
new file mode 100644
index 0000000..dd733a1
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/symbian/streamplayer.cpp
@@ -0,0 +1,279 @@
+#include "streamplayer.h"
+#include<mda/common/audio.h>
+
+
+
+const TInt KMaxVolume(256);
+
+LOCAL_C TInt GetSampleRate(TInt aRate)
+ {
+ switch(aRate)
+ {
+ case 8000: return TMdaAudioDataSettings::ESampleRate8000Hz;
+ case 11025: return TMdaAudioDataSettings::ESampleRate11025Hz;
+ case 12000: return TMdaAudioDataSettings::ESampleRate12000Hz;
+ case 16000: return TMdaAudioDataSettings::ESampleRate16000Hz;
+ case 22050: return TMdaAudioDataSettings::ESampleRate22050Hz;
+ case 24000: return TMdaAudioDataSettings::ESampleRate24000Hz;
+ case 32000: return TMdaAudioDataSettings::ESampleRate32000Hz;
+ case 44100: return TMdaAudioDataSettings::ESampleRate44100Hz;
+ case 48000: return TMdaAudioDataSettings::ESampleRate48000Hz;
+ case 96000: return TMdaAudioDataSettings::ESampleRate96000Hz;
+ case 64000: return TMdaAudioDataSettings::ESampleRate64000Hz;
+ }
+ return KErrNotFound;
+ }
+
+LOCAL_C TInt GetChannels(TInt aChannels)
+ {
+ switch(aChannels)
+ {
+ case 1: return TMdaAudioDataSettings::EChannelsMono;
+ case 2: return TMdaAudioDataSettings::EChannelsStereo;
+ }
+ return KErrNotFound;
+ }
+
+TInt CStreamPlayer::ClosestSupportedRate(TInt aRate)
+ {
+ if(aRate > 96000)
+ return 96000;
+ TInt rate = aRate;
+ while(GetSampleRate(rate) == KErrNotFound)
+ {
+ ++rate;
+ }
+ return rate;
+ }
+
+CStreamPlayer::CStreamPlayer(MStreamProvider& aProvider, MStreamObs& aObs) :
+ iProvider(aProvider), iObs(aObs), iVolume(KMaxVolume)
+ {
+ }
+
+CStreamPlayer::~CStreamPlayer()
+ {
+ iState |= EDied;
+ if(iState & EInited)
+ Close();
+ User::After(100000); //wait buffer to be flushed
+ ASSERT(iPtr.Length() == 0);
+ delete iStream;
+ }
+
+
+void CStreamPlayer::ConstructL()
+ {
+ iStream = CMdaAudioOutputStream::NewL(*this, EMdaPriorityMax);
+ iSilence.SetMax();
+ iSilence.FillZ();
+ }
+
+
+TInt CStreamPlayer::OpenStream(TInt aRate, TInt aChannels, TUint32 aType)
+ {
+ Close();
+
+ iType = aType;
+
+ iRate = GetSampleRate(aRate);
+ if(iRate == KErrNotFound)
+ return KErrNotSupported;
+
+ iChannels = GetChannels(aChannels);
+ if(iChannels == KErrNotFound)
+ return KErrNotSupported;
+
+ Open();
+
+ return KErrNone;
+ }
+
+
+TInt CStreamPlayer::MaxVolume() const
+ {
+ return KMaxVolume;
+ }
+
+void CStreamPlayer::SetVolume(TInt aNew)
+ {
+
+ const TInt maxi = MaxVolume();
+ if(aNew > maxi)
+ return;
+ if(aNew < 0)
+ return;
+
+ iVolume = aNew;
+
+ iState |= EVolumeChange;
+ }
+
+ TInt CStreamPlayer::Volume() const
+ {
+ return iVolume;
+ }
+
+void CStreamPlayer::Open()
+ {
+ TMdaAudioDataSettings audioSettings;
+ audioSettings.Query();
+ audioSettings.iCaps = TMdaAudioDataSettings::ERealTime |
+ TMdaAudioDataSettings::ESampleRateFixed;
+ audioSettings.iSampleRate = iRate;
+ audioSettings.iChannels = iChannels;
+ audioSettings.iFlags = TMdaAudioDataSettings::ENoNetworkRouting;
+ audioSettings.iVolume = 0;
+
+ iState &= ~EStopped;
+ iStream->Open(&audioSettings);
+ }
+
+void CStreamPlayer::Stop()
+ {
+ if(iState & (EStarted | EInited))
+ {
+ Close();
+ iState |= EStopped;
+ }
+ }
+
+void CStreamPlayer::Start()
+ {
+ if(iPtr.Length() == 0)
+ {
+ iState |= EStarted;
+ if(iState & EInited)
+ {
+ Request();
+ }
+ else if(iState & EStopped)
+ {
+ Open();
+ }
+ }
+ }
+
+void CStreamPlayer::Close()
+ {
+ iState &= ~EInited;
+ iStream->Stop();
+ iState &= ~EStarted;
+ }
+
+void CStreamPlayer::Request()
+ {
+ if(iState & EInited)
+ {
+ iPtr.Set(KNullDesC8);
+
+ if(iState & EVolumeChange)
+ {
+ const TReal newVol = iVolume;
+ const TReal newMax = MaxVolume();
+ const TInt maxVol = iStream->MaxVolume();
+ const TReal max = static_cast<TReal>(maxVol);
+ const TReal newvolume = (newVol * max) / newMax;
+ const TInt vol = static_cast<TReal>(newvolume);
+ iStream->SetVolume(vol);
+ iState &= ~EVolumeChange;
+ }
+
+ if(iState & EStarted)
+ {
+ iPtr.Set(iProvider.Data());
+ }
+ if(iPtr.Length() == 0)
+ {
+ iPtr.Set(iSilence);
+ }
+ TRAPD(err, iStream->WriteL(iPtr));
+ if(err != KErrNone)
+ {
+ iObs.Complete(MStreamObs::EWrite, err);
+ }
+ /* else
+ {
+ iProvider.Written(iPtr.Length());
+ }*/
+ }
+ }
+
+
+void CStreamPlayer::SetCapsL()
+ {
+ iStream->SetDataTypeL(iType);
+ iStream->SetAudioPropertiesL(iRate, iChannels);
+ }
+
+void CStreamPlayer::MaoscOpenComplete(TInt aError)
+ {
+ if(aError == KErrNone)
+ {
+ TRAPD(err, SetCapsL());
+ if(err == KErrNone)
+ {
+ iStream->SetPriority(EPriorityNormal, EMdaPriorityPreferenceTime);
+ iState |= EInited;
+
+
+ SetVolume(Volume());
+
+ if(iState & EStarted)
+ {
+ Request();
+ }
+
+ }
+ aError = err;
+ }
+ if(!(iState & EDied))
+ iObs.Complete(MStreamObs::EInit, aError);
+ }
+
+void CStreamPlayer::MaoscBufferCopied(TInt aError, const TDesC8& /*aBuffer*/)
+ {
+ iPtr.Set(KNullDesC8);
+ if(aError == KErrNone)
+ {
+ if(iState & EInited)
+ Request();
+ else
+ iStream->Stop();
+ }
+ else if(!(iState & EDied))
+ iObs.Complete(MStreamObs::EPlay, aError);
+ }
+
+void CStreamPlayer::MaoscPlayComplete(TInt aError)
+ {
+ iPtr.Set(KNullDesC8);
+ iState &= ~EStarted;
+ if(!(iState & EDied))
+ iObs.Complete(MStreamObs::EClose, aError);
+ }
+
+TBool CStreamPlayer::Playing() const
+ {
+ return (iState & EInited) && (iState & EStarted);
+ }
+
+TBool CStreamPlayer::Closed() const
+ {
+ return !(iState & EInited) && !(iState & EDied);
+ }
+
+ /*
+void CStreamPlayer::Request()
+ {
+ SetActive();
+ TRequestStatus* s = &iStatus;
+ User::RequestComplete(s, KErrNone);
+ }
+ // iTimer.After(0);
+ */
+
+
+
+
+
diff --git a/distrib/sdl-1.2.15/src/audio/symbian/streamplayer.h b/distrib/sdl-1.2.15/src/audio/symbian/streamplayer.h
new file mode 100644
index 0000000..8c6e74f
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/symbian/streamplayer.h
@@ -0,0 +1,89 @@
+#ifndef STREAMPLAYER_H
+#define STREAMPLAYER_H
+
+#include<MdaAudioOutputStream.h>
+
+const TInt KSilenceBuffer = 256;
+
+class MStreamObs
+ {
+ public:
+ enum
+ {
+ EInit,
+ EPlay,
+ EWrite,
+ EClose,
+ };
+ virtual void Complete(TInt aState, TInt aError) = 0;
+ };
+
+class MStreamProvider
+ {
+ public:
+ virtual TPtrC8 Data() = 0;
+ };
+
+NONSHARABLE_CLASS(CStreamPlayer) : public CBase, public MMdaAudioOutputStreamCallback
+ {
+ public:
+ CStreamPlayer(MStreamProvider& aProvider, MStreamObs& aObs);
+ ~CStreamPlayer();
+ void ConstructL();
+
+ static TInt ClosestSupportedRate(TInt aRate);
+
+ TInt OpenStream(TInt aRate, TInt aChannels, TUint32 aType = KMMFFourCCCodePCM16);
+
+ void SetVolume(TInt aNew);
+ TInt Volume() const;
+ TInt MaxVolume() const;
+
+ void Stop();
+ void Start();
+ void Open();
+ void Close();
+
+ TBool Playing() const;
+ TBool Closed() const;
+
+ private:
+
+ void MaoscOpenComplete(TInt aError) ;
+ void MaoscBufferCopied(TInt aError, const TDesC8& aBuffer);
+ void MaoscPlayComplete(TInt aError);
+
+ private:
+ void Request();
+ void SetCapsL();
+
+ private:
+ MStreamProvider& iProvider;
+ MStreamObs& iObs;
+ TInt iVolume;
+
+ CMdaAudioOutputStream* iStream;
+
+ TInt iRate;
+ TInt iChannels;
+ TUint32 iType;
+
+ enum
+ {
+ ENone = 0,
+ EInited = 0x1,
+ EStarted = 0x2,
+ EStopped = 0x4,
+ EVolumeChange = 0x8,
+ EDied = 0x10
+ };
+
+ TInt iState;
+ TBuf8<KSilenceBuffer> iSilence;
+ TPtrC8 iPtr;
+
+ };
+
+
+#endif
+
diff --git a/distrib/sdl-1.2.15/src/audio/ums/SDL_umsaudio.c b/distrib/sdl-1.2.15/src/audio/ums/SDL_umsaudio.c
new file mode 100644
index 0000000..9488911
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/ums/SDL_umsaudio.c
@@ -0,0 +1,547 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Carsten Griwodz
+ griff@kom.tu-darmstadt.de
+
+ based on linux/SDL_dspaudio.c by Sam Lantinga
+*/
+#include "SDL_config.h"
+
+/* Allow access to a raw mixing buffer */
+
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+
+#include "SDL_audio.h"
+#include "../SDL_audio_c.h"
+#include "../SDL_audiodev_c.h"
+#include "SDL_umsaudio.h"
+
+/* The tag name used by UMS audio */
+#define UMS_DRIVER_NAME "ums"
+
+#define DEBUG_AUDIO 1
+
+/* Audio driver functions */
+static int UMS_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void UMS_PlayAudio(_THIS);
+static Uint8 *UMS_GetAudioBuf(_THIS);
+static void UMS_CloseAudio(_THIS);
+
+static UMSAudioDevice_ReturnCode UADOpen(_THIS, string device, string mode, long flags);
+static UMSAudioDevice_ReturnCode UADClose(_THIS);
+static UMSAudioDevice_ReturnCode UADGetBitsPerSample(_THIS, long* bits);
+static UMSAudioDevice_ReturnCode UADSetBitsPerSample(_THIS, long bits);
+static UMSAudioDevice_ReturnCode UADSetSampleRate(_THIS, long rate, long* set_rate);
+static UMSAudioDevice_ReturnCode UADSetByteOrder(_THIS, string byte_order);
+static UMSAudioDevice_ReturnCode UADSetAudioFormatType(_THIS, string fmt);
+static UMSAudioDevice_ReturnCode UADSetNumberFormat(_THIS, string fmt);
+static UMSAudioDevice_ReturnCode UADInitialize(_THIS);
+static UMSAudioDevice_ReturnCode UADStart(_THIS);
+static UMSAudioDevice_ReturnCode UADStop(_THIS);
+static UMSAudioDevice_ReturnCode UADSetTimeFormat(_THIS, UMSAudioTypes_TimeFormat fmt );
+static UMSAudioDevice_ReturnCode UADWriteBuffSize(_THIS, long* buff_size );
+static UMSAudioDevice_ReturnCode UADWriteBuffRemain(_THIS, long* buff_size );
+static UMSAudioDevice_ReturnCode UADWriteBuffUsed(_THIS, long* buff_size );
+static UMSAudioDevice_ReturnCode UADSetDMABufferSize(_THIS, long bytes, long* bytes_ret );
+static UMSAudioDevice_ReturnCode UADSetVolume(_THIS, long volume );
+static UMSAudioDevice_ReturnCode UADSetBalance(_THIS, long balance );
+static UMSAudioDevice_ReturnCode UADSetChannels(_THIS, long channels );
+static UMSAudioDevice_ReturnCode UADPlayRemainingData(_THIS, boolean block );
+static UMSAudioDevice_ReturnCode UADEnableOutput(_THIS, string output, long* left_gain, long* right_gain);
+static UMSAudioDevice_ReturnCode UADWrite(_THIS, UMSAudioTypes_Buffer* buff, long samples, long* samples_written);
+
+/* Audio driver bootstrap functions */
+static int Audio_Available(void)
+{
+ return 1;
+}
+
+static void Audio_DeleteDevice(_THIS)
+{
+ if(this->hidden->playbuf._buffer) SDL_free(this->hidden->playbuf._buffer);
+ if(this->hidden->fillbuf._buffer) SDL_free(this->hidden->fillbuf._buffer);
+ _somFree( this->hidden->umsdev );
+ SDL_free(this->hidden);
+ SDL_free(this);
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /*
+ * Allocate and initialize management storage and private management
+ * storage for this SDL-using library.
+ */
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Creating UMS Audio device\n");
+#endif
+
+ /*
+ * Calls for UMS env initialization and audio object construction.
+ */
+ this->hidden->ev = somGetGlobalEnvironment();
+ this->hidden->umsdev = UMSAudioDeviceNew();
+
+ /*
+ * Set the function pointers.
+ */
+ this->OpenAudio = UMS_OpenAudio;
+ this->WaitAudio = NULL; /* we do blocking output */
+ this->PlayAudio = UMS_PlayAudio;
+ this->GetAudioBuf = UMS_GetAudioBuf;
+ this->CloseAudio = UMS_CloseAudio;
+ this->free = Audio_DeleteDevice;
+
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "done\n");
+#endif
+ return this;
+}
+
+AudioBootStrap UMS_bootstrap = {
+ UMS_DRIVER_NAME, "AIX UMS audio",
+ Audio_Available, Audio_CreateDevice
+};
+
+static Uint8 *UMS_GetAudioBuf(_THIS)
+{
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "enter UMS_GetAudioBuf\n");
+#endif
+ return this->hidden->fillbuf._buffer;
+/*
+ long bufSize;
+ UMSAudioDevice_ReturnCode rc;
+
+ rc = UADSetTimeFormat(this, UMSAudioTypes_Bytes );
+ rc = UADWriteBuffSize(this, bufSize );
+*/
+}
+
+static void UMS_CloseAudio(_THIS)
+{
+ UMSAudioDevice_ReturnCode rc;
+
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "enter UMS_CloseAudio\n");
+#endif
+ rc = UADPlayRemainingData(this, TRUE);
+ rc = UADStop(this);
+ rc = UADClose(this);
+}
+
+static void UMS_PlayAudio(_THIS)
+{
+ UMSAudioDevice_ReturnCode rc;
+ long samplesToWrite;
+ long samplesWritten;
+ UMSAudioTypes_Buffer swpbuf;
+
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "enter UMS_PlayAudio\n");
+#endif
+ samplesToWrite = this->hidden->playbuf._length/this->hidden->bytesPerSample;
+ do
+ {
+ rc = UADWrite(this, &this->hidden->playbuf,
+ samplesToWrite,
+ &samplesWritten );
+ samplesToWrite -= samplesWritten;
+
+ /* rc values: UMSAudioDevice_Success
+ * UMSAudioDevice_Failure
+ * UMSAudioDevice_Preempted
+ * UMSAudioDevice_Interrupted
+ * UMSAudioDevice_DeviceError
+ */
+ if ( rc == UMSAudioDevice_DeviceError ) {
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Returning from PlayAudio with devices error\n");
+#endif
+ return;
+ }
+ }
+ while(samplesToWrite>0);
+
+ SDL_LockAudio();
+ SDL_memcpy( &swpbuf, &this->hidden->playbuf, sizeof(UMSAudioTypes_Buffer) );
+ SDL_memcpy( &this->hidden->playbuf, &this->hidden->fillbuf, sizeof(UMSAudioTypes_Buffer) );
+ SDL_memcpy( &this->hidden->fillbuf, &swpbuf, sizeof(UMSAudioTypes_Buffer) );
+ SDL_UnlockAudio();
+
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Wrote audio data and swapped buffer\n");
+#endif
+}
+
+#if 0
+// /* Set the DSP frequency */
+// value = spec->freq;
+// if ( ioctl(this->hidden->audio_fd, SOUND_PCM_WRITE_RATE, &value) < 0 ) {
+// SDL_SetError("Couldn't set audio frequency");
+// return(-1);
+// }
+// spec->freq = value;
+#endif
+
+static int UMS_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ char* audiodev = "/dev/paud0";
+ long lgain;
+ long rgain;
+ long outRate;
+ long outBufSize;
+ long bitsPerSample;
+ long samplesPerSec;
+ long success;
+ Uint16 test_format;
+ int frag_spec;
+ UMSAudioDevice_ReturnCode rc;
+
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "enter UMS_OpenAudio\n");
+#endif
+ rc = UADOpen(this, audiodev,"PLAY", UMSAudioDevice_BlockingIO);
+ if ( rc != UMSAudioDevice_Success ) {
+ SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno));
+ return -1;
+ }
+
+ rc = UADSetAudioFormatType(this, "PCM");
+
+ success = 0;
+ test_format = SDL_FirstAudioFormat(spec->format);
+ do
+ {
+#ifdef DEBUG_AUDIO
+ fprintf(stderr, "Trying format 0x%4.4x\n", test_format);
+#endif
+ switch ( test_format )
+ {
+ case AUDIO_U8:
+/* from the mac code: better ? */
+/* sample_bits = spec->size / spec->samples / spec->channels * 8; */
+ success = 1;
+ bitsPerSample = 8;
+ rc = UADSetSampleRate(this, spec->freq << 16, &outRate );
+ rc = UADSetByteOrder(this, "MSB"); /* irrelevant */
+ rc = UADSetNumberFormat(this, "UNSIGNED");
+ break;
+ case AUDIO_S8:
+ success = 1;
+ bitsPerSample = 8;
+ rc = UADSetSampleRate(this, spec->freq << 16, &outRate );
+ rc = UADSetByteOrder(this, "MSB"); /* irrelevant */
+ rc = UADSetNumberFormat(this, "SIGNED");
+ break;
+ case AUDIO_S16LSB:
+ success = 1;
+ bitsPerSample = 16;
+ rc = UADSetSampleRate(this, spec->freq << 16, &outRate );
+ rc = UADSetByteOrder(this, "LSB");
+ rc = UADSetNumberFormat(this, "SIGNED");
+ break;
+ case AUDIO_S16MSB:
+ success = 1;
+ bitsPerSample = 16;
+ rc = UADSetSampleRate(this, spec->freq << 16, &outRate );
+ rc = UADSetByteOrder(this, "MSB");
+ rc = UADSetNumberFormat(this, "SIGNED");
+ break;
+ case AUDIO_U16LSB:
+ success = 1;
+ bitsPerSample = 16;
+ rc = UADSetSampleRate(this, spec->freq << 16, &outRate );
+ rc = UADSetByteOrder(this, "LSB");
+ rc = UADSetNumberFormat(this, "UNSIGNED");
+ break;
+ case AUDIO_U16MSB:
+ success = 1;
+ bitsPerSample = 16;
+ rc = UADSetSampleRate(this, spec->freq << 16, &outRate );
+ rc = UADSetByteOrder(this, "MSB");
+ rc = UADSetNumberFormat(this, "UNSIGNED");
+ break;
+ default:
+ break;
+ }
+ if ( ! success ) {
+ test_format = SDL_NextAudioFormat();
+ }
+ }
+ while ( ! success && test_format );
+
+ if ( success == 0 ) {
+ SDL_SetError("Couldn't find any hardware audio formats");
+ return -1;
+ }
+
+ spec->format = test_format;
+
+ for ( frag_spec = 0; (0x01<<frag_spec) < spec->size; ++frag_spec );
+ if ( (0x01<<frag_spec) != spec->size ) {
+ SDL_SetError("Fragment size must be a power of two");
+ return -1;
+ }
+ if ( frag_spec > 2048 ) frag_spec = 2048;
+
+ this->hidden->bytesPerSample = (bitsPerSample / 8) * spec->channels;
+ samplesPerSec = this->hidden->bytesPerSample * outRate;
+
+ this->hidden->playbuf._length = 0;
+ this->hidden->playbuf._maximum = spec->size;
+ this->hidden->playbuf._buffer = (unsigned char*)SDL_malloc(spec->size);
+ this->hidden->fillbuf._length = 0;
+ this->hidden->fillbuf._maximum = spec->size;
+ this->hidden->fillbuf._buffer = (unsigned char*)SDL_malloc(spec->size);
+
+ rc = UADSetBitsPerSample(this, bitsPerSample );
+ rc = UADSetDMABufferSize(this, frag_spec, &outBufSize );
+ rc = UADSetChannels(this, spec->channels); /* functions reduces to mono or stereo */
+
+ lgain = 100; /*maximum left input gain*/
+ rgain = 100; /*maimum right input gain*/
+ rc = UADEnableOutput(this, "LINE_OUT",&lgain,&rgain);
+ rc = UADInitialize(this);
+ rc = UADStart(this);
+ rc = UADSetVolume(this, 100);
+ rc = UADSetBalance(this, 0);
+
+ /* We're ready to rock and roll. :-) */
+ return 0;
+}
+
+
+static UMSAudioDevice_ReturnCode UADGetBitsPerSample(_THIS, long* bits)
+{
+ return UMSAudioDevice_get_bits_per_sample( this->hidden->umsdev,
+ this->hidden->ev,
+ bits );
+}
+
+static UMSAudioDevice_ReturnCode UADSetBitsPerSample(_THIS, long bits)
+{
+ return UMSAudioDevice_set_bits_per_sample( this->hidden->umsdev,
+ this->hidden->ev,
+ bits );
+}
+
+static UMSAudioDevice_ReturnCode UADSetSampleRate(_THIS, long rate, long* set_rate)
+{
+ /* from the mac code: sample rate = spec->freq << 16; */
+ return UMSAudioDevice_set_sample_rate( this->hidden->umsdev,
+ this->hidden->ev,
+ rate,
+ set_rate );
+}
+
+static UMSAudioDevice_ReturnCode UADSetByteOrder(_THIS, string byte_order)
+{
+ return UMSAudioDevice_set_byte_order( this->hidden->umsdev,
+ this->hidden->ev,
+ byte_order );
+}
+
+static UMSAudioDevice_ReturnCode UADSetAudioFormatType(_THIS, string fmt)
+{
+ /* possible PCM, A_LAW or MU_LAW */
+ return UMSAudioDevice_set_audio_format_type( this->hidden->umsdev,
+ this->hidden->ev,
+ fmt );
+}
+
+static UMSAudioDevice_ReturnCode UADSetNumberFormat(_THIS, string fmt)
+{
+ /* possible SIGNED, UNSIGNED, or TWOS_COMPLEMENT */
+ return UMSAudioDevice_set_number_format( this->hidden->umsdev,
+ this->hidden->ev,
+ fmt );
+}
+
+static UMSAudioDevice_ReturnCode UADInitialize(_THIS)
+{
+ return UMSAudioDevice_initialize( this->hidden->umsdev,
+ this->hidden->ev );
+}
+
+static UMSAudioDevice_ReturnCode UADStart(_THIS)
+{
+ return UMSAudioDevice_start( this->hidden->umsdev,
+ this->hidden->ev );
+}
+
+static UMSAudioDevice_ReturnCode UADSetTimeFormat(_THIS, UMSAudioTypes_TimeFormat fmt )
+{
+ /*
+ * Switches the time format to the new format, immediately.
+ * possible UMSAudioTypes_Msecs, UMSAudioTypes_Bytes or UMSAudioTypes_Samples
+ */
+ return UMSAudioDevice_set_time_format( this->hidden->umsdev,
+ this->hidden->ev,
+ fmt );
+}
+
+static UMSAudioDevice_ReturnCode UADWriteBuffSize(_THIS, long* buff_size )
+{
+ /*
+ * returns write buffer size in the current time format
+ */
+ return UMSAudioDevice_write_buff_size( this->hidden->umsdev,
+ this->hidden->ev,
+ buff_size );
+}
+
+static UMSAudioDevice_ReturnCode UADWriteBuffRemain(_THIS, long* buff_size )
+{
+ /*
+ * returns amount of available space in the write buffer
+ * in the current time format
+ */
+ return UMSAudioDevice_write_buff_remain( this->hidden->umsdev,
+ this->hidden->ev,
+ buff_size );
+}
+
+static UMSAudioDevice_ReturnCode UADWriteBuffUsed(_THIS, long* buff_size )
+{
+ /*
+ * returns amount of filled space in the write buffer
+ * in the current time format
+ */
+ return UMSAudioDevice_write_buff_used( this->hidden->umsdev,
+ this->hidden->ev,
+ buff_size );
+}
+
+static UMSAudioDevice_ReturnCode UADSetDMABufferSize(_THIS, long bytes, long* bytes_ret )
+{
+ /*
+ * Request a new DMA buffer size, maximum requested size 2048.
+ * Takes effect with next initialize() call.
+ * Devices may or may not support DMA.
+ */
+ return UMSAudioDevice_set_DMA_buffer_size( this->hidden->umsdev,
+ this->hidden->ev,
+ bytes,
+ bytes_ret );
+}
+
+static UMSAudioDevice_ReturnCode UADSetVolume(_THIS, long volume )
+{
+ /*
+ * Set the volume.
+ * Takes effect immediately.
+ */
+ return UMSAudioDevice_set_volume( this->hidden->umsdev,
+ this->hidden->ev,
+ volume );
+}
+
+static UMSAudioDevice_ReturnCode UADSetBalance(_THIS, long balance )
+{
+ /*
+ * Set the balance.
+ * Takes effect immediately.
+ */
+ return UMSAudioDevice_set_balance( this->hidden->umsdev,
+ this->hidden->ev,
+ balance );
+}
+
+static UMSAudioDevice_ReturnCode UADSetChannels(_THIS, long channels )
+{
+ /*
+ * Set mono or stereo.
+ * Takes effect with next initialize() call.
+ */
+ if ( channels != 1 ) channels = 2;
+ return UMSAudioDevice_set_number_of_channels( this->hidden->umsdev,
+ this->hidden->ev,
+ channels );
+}
+
+static UMSAudioDevice_ReturnCode UADOpen(_THIS, string device, string mode, long flags)
+{
+ return UMSAudioDevice_open( this->hidden->umsdev,
+ this->hidden->ev,
+ device,
+ mode,
+ flags );
+}
+
+static UMSAudioDevice_ReturnCode UADWrite(_THIS, UMSAudioTypes_Buffer* buff,
+ long samples,
+ long* samples_written)
+{
+ return UMSAudioDevice_write( this->hidden->umsdev,
+ this->hidden->ev,
+ buff,
+ samples,
+ samples_written );
+}
+
+static UMSAudioDevice_ReturnCode UADPlayRemainingData(_THIS, boolean block )
+{
+ return UMSAudioDevice_play_remaining_data( this->hidden->umsdev,
+ this->hidden->ev,
+ block);
+}
+
+static UMSAudioDevice_ReturnCode UADStop(_THIS)
+{
+ return UMSAudioDevice_stop( this->hidden->umsdev,
+ this->hidden->ev );
+}
+
+static UMSAudioDevice_ReturnCode UADClose(_THIS)
+{
+ return UMSAudioDevice_close( this->hidden->umsdev,
+ this->hidden->ev );
+}
+
+static UMSAudioDevice_ReturnCode UADEnableOutput(_THIS, string output, long* left_gain, long* right_gain)
+{
+ return UMSAudioDevice_enable_output( this->hidden->umsdev,
+ this->hidden->ev,
+ output,
+ left_gain,
+ right_gain );
+}
+
diff --git a/distrib/sdl-1.2.15/src/audio/ums/SDL_umsaudio.h b/distrib/sdl-1.2.15/src/audio/ums/SDL_umsaudio.h
new file mode 100644
index 0000000..367fe85
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/ums/SDL_umsaudio.h
@@ -0,0 +1,50 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Carsten Griwodz
+ griff@kom.tu-darmstadt.de
+
+ based on linux/SDL_dspaudio.h by Sam Lantinga
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_UMSaudio_h
+#define _SDL_UMSaudio_h
+
+#include <UMS/UMSAudioDevice.h>
+
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_AudioDevice *this
+
+struct SDL_PrivateAudioData
+{
+ /* Pointer to the (open) UMS audio device */
+ Environment* ev;
+ UMSAudioDevice umsdev;
+
+ /* Raw mixing buffer */
+ UMSAudioTypes_Buffer playbuf;
+ UMSAudioTypes_Buffer fillbuf;
+
+ long bytesPerSample;
+};
+
+#endif /* _SDL_UMSaudio_h */
+
diff --git a/distrib/sdl-1.2.15/src/audio/windib/SDL_dibaudio.c b/distrib/sdl-1.2.15/src/audio/windib/SDL_dibaudio.c
new file mode 100644
index 0000000..b218ff9
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/windib/SDL_dibaudio.c
@@ -0,0 +1,343 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Allow access to a raw mixing buffer */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <mmsystem.h>
+
+#include "SDL_timer.h"
+#include "SDL_audio.h"
+#include "../SDL_audio_c.h"
+#include "SDL_dibaudio.h"
+#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
+#include "win_ce_semaphore.h"
+#endif
+
+
+/* Audio driver functions */
+static int DIB_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void DIB_ThreadInit(_THIS);
+static void DIB_WaitAudio(_THIS);
+static Uint8 *DIB_GetAudioBuf(_THIS);
+static void DIB_PlayAudio(_THIS);
+static void DIB_WaitDone(_THIS);
+static void DIB_CloseAudio(_THIS);
+
+int volatile dibaudio_thread_debug = 0;
+int volatile dibaudio_cb_debug = 0;
+int volatile dibaudio_main_debug = 0;
+
+/* Audio driver bootstrap functions */
+
+static int Audio_Available(void)
+{
+ return(1);
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+
+ /* Set the function pointers */
+ this->OpenAudio = DIB_OpenAudio;
+ this->ThreadInit = DIB_ThreadInit;
+ this->WaitAudio = DIB_WaitAudio;
+ this->PlayAudio = DIB_PlayAudio;
+ this->GetAudioBuf = DIB_GetAudioBuf;
+ this->WaitDone = DIB_WaitDone;
+ this->CloseAudio = DIB_CloseAudio;
+
+ this->free = Audio_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap WAVEOUT_bootstrap = {
+ "waveout", "Win95/98/NT/2000 WaveOut",
+ Audio_Available, Audio_CreateDevice
+};
+
+
+/* The Win32 callback for filling the WAVE device */
+static void CALLBACK FillSound(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance,
+ DWORD dwParam1, DWORD dwParam2)
+{
+ SDL_AudioDevice *this = (SDL_AudioDevice *)dwInstance;
+
+ /* Only service "buffer done playing" messages */
+ if ( uMsg != WOM_DONE )
+ return;
+
+ /* Signal that we are done playing a buffer */
+ dibaudio_cb_debug = 1;
+ EnterCriticalSection(&audio_cs);
+ dibaudio_cb_debug = 2;
+ SetEvent(audio_event);
+ dibaudio_cb_debug = 3;
+ LeaveCriticalSection(&audio_cs);
+ dibaudio_cb_debug = 4;
+}
+
+static void SetMMerror(char *function, MMRESULT code)
+{
+ size_t len;
+ char errbuf[MAXERRORLENGTH];
+#ifdef _WIN32_WCE
+ wchar_t werrbuf[MAXERRORLENGTH];
+#endif
+
+ SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: ", function);
+ len = SDL_strlen(errbuf);
+
+#ifdef _WIN32_WCE
+ /* UNICODE version */
+ waveOutGetErrorText(code, werrbuf, MAXERRORLENGTH-len);
+ WideCharToMultiByte(CP_ACP,0,werrbuf,-1,errbuf+len,MAXERRORLENGTH-len,NULL,NULL);
+#else
+ waveOutGetErrorText(code, errbuf+len, (UINT)(MAXERRORLENGTH-len));
+#endif
+
+ SDL_SetError("%s",errbuf);
+}
+
+/* Set high priority for the audio thread */
+static void DIB_ThreadInit(_THIS)
+{
+ SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST);
+}
+
+void DIB_WaitAudio(_THIS)
+{
+ /* Wait for an audio chunk to finish */
+ dibaudio_thread_debug = 1;
+ WaitForSingleObject(audio_event, INFINITE);
+ dibaudio_thread_debug = 2;
+ ResetEvent(audio_event);
+ dibaudio_thread_debug = 3;
+}
+
+Uint8 *DIB_GetAudioBuf(_THIS)
+{
+ Uint8 *retval;
+
+ dibaudio_thread_debug = 4;
+ EnterCriticalSection(&audio_cs);
+ dibaudio_thread_debug = 5;
+ retval = (Uint8 *)(wavebuf[next_buffer].lpData);
+ return retval;
+}
+
+void DIB_PlayAudio(_THIS)
+{
+ /* Queue it up */
+ dibaudio_thread_debug = 6;
+ waveOutWrite(sound, &wavebuf[next_buffer], sizeof(wavebuf[0]));
+ dibaudio_thread_debug = 7;
+ next_buffer = (next_buffer+1)%NUM_BUFFERS;
+ LeaveCriticalSection(&audio_cs);
+ dibaudio_thread_debug = 8;
+}
+
+void DIB_WaitDone(_THIS)
+{
+ int i, left, tries = 5;
+
+ dibaudio_thread_debug = 9;
+
+ /* give some time for the wave output to send the last buffer,
+ but don't hang if one was cancelled
+ */
+ do {
+ left = NUM_BUFFERS;
+ for ( i=0; i<NUM_BUFFERS; ++i ) {
+ if ( wavebuf[i].dwFlags & WHDR_DONE ) {
+ --left;
+ }
+ }
+ if ( left == 0 )
+ break;
+
+ SDL_Delay(100);
+ } while ( --tries > 0 );
+
+ dibaudio_thread_debug = 10;
+}
+
+void DIB_CloseAudio(_THIS)
+{
+ int i;
+
+ /* Close up audio */
+ if (audio_event != INVALID_HANDLE_VALUE ) {
+#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
+ CloseSynchHandle(audio_event);
+#else
+ CloseHandle(audio_event);
+#endif
+ }
+ if ( sound ) {
+ waveOutReset(sound);
+ }
+
+ /* Clean up mixing buffers */
+ for ( i=0; i<NUM_BUFFERS; ++i ) {
+ if ( wavebuf[i].dwUser != 0xFFFF ) {
+ waveOutUnprepareHeader(sound, &wavebuf[i],
+ sizeof(wavebuf[i]));
+ wavebuf[i].dwUser = 0xFFFF;
+ }
+ }
+ /* Free raw mixing buffer */
+ if ( mixbuf != NULL ) {
+ SDL_free(mixbuf);
+ mixbuf = NULL;
+ }
+
+ if ( sound )
+ waveOutClose(sound);
+}
+
+int DIB_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ MMRESULT result;
+ int i;
+ WAVEFORMATEX waveformat;
+
+ /* Initialize the wavebuf structures for closing */
+ sound = NULL;
+ InitializeCriticalSection(&audio_cs);
+ audio_event = INVALID_HANDLE_VALUE;
+ for ( i = 0; i < NUM_BUFFERS; ++i )
+ wavebuf[i].dwUser = 0xFFFF;
+ mixbuf = NULL;
+
+ /* Set basic WAVE format parameters */
+ SDL_memset(&waveformat, 0, sizeof(waveformat));
+ waveformat.wFormatTag = WAVE_FORMAT_PCM;
+
+ /* Determine the audio parameters from the AudioSpec */
+ switch ( spec->format & 0xFF ) {
+ case 8:
+ /* Unsigned 8 bit audio data */
+ spec->format = AUDIO_U8;
+ waveformat.wBitsPerSample = 8;
+ break;
+ case 16:
+ /* Signed 16 bit audio data */
+ spec->format = AUDIO_S16;
+ waveformat.wBitsPerSample = 16;
+ break;
+ default:
+ SDL_SetError("Unsupported audio format");
+ return(-1);
+ }
+ waveformat.nChannels = spec->channels;
+ waveformat.nSamplesPerSec = spec->freq;
+ waveformat.nBlockAlign =
+ waveformat.nChannels * (waveformat.wBitsPerSample/8);
+ waveformat.nAvgBytesPerSec =
+ waveformat.nSamplesPerSec * waveformat.nBlockAlign;
+
+ /* Check the buffer size -- minimum of 1/4 second (word aligned) */
+ if ( spec->samples < (spec->freq/4) )
+ spec->samples = ((spec->freq/4)+3)&~3;
+
+ /* Update the fragment size as size in bytes */
+ SDL_CalculateAudioSpec(spec);
+
+ /* Open the audio device */
+ result = waveOutOpen(&sound, WAVE_MAPPER, &waveformat,
+ (DWORD_PTR)FillSound, (DWORD_PTR)this, CALLBACK_FUNCTION);
+ if ( result != MMSYSERR_NOERROR ) {
+ SetMMerror("waveOutOpen()", result);
+ return(-1);
+ }
+
+#ifdef SOUND_DEBUG
+ /* Check the sound device we retrieved */
+ {
+ WAVEOUTCAPS caps;
+
+ result = waveOutGetDevCaps((UINT)sound, &caps, sizeof(caps));
+ if ( result != MMSYSERR_NOERROR ) {
+ SetMMerror("waveOutGetDevCaps()", result);
+ return(-1);
+ }
+ printf("Audio device: %s\n", caps.szPname);
+ }
+#endif
+
+ /* Create the audio buffer semaphore */
+ audio_event = CreateEvent( NULL, TRUE, FALSE, NULL );
+ if (audio_event == NULL) {
+ SDL_SetError("Couldn't create semaphore");
+ return(-1);
+ }
+
+ /* Create the sound buffers */
+ mixbuf = (Uint8 *)SDL_malloc(NUM_BUFFERS*spec->size);
+ if ( mixbuf == NULL ) {
+ SDL_SetError("Out of memory");
+ return(-1);
+ }
+ for ( i = 0; i < NUM_BUFFERS; ++i ) {
+ SDL_memset(&wavebuf[i], 0, sizeof(wavebuf[i]));
+ wavebuf[i].lpData = (LPSTR) &mixbuf[i*spec->size];
+ wavebuf[i].dwBufferLength = spec->size;
+ wavebuf[i].dwFlags = WHDR_DONE;
+ result = waveOutPrepareHeader(sound, &wavebuf[i],
+ sizeof(wavebuf[i]));
+ if ( result != MMSYSERR_NOERROR ) {
+ SetMMerror("waveOutPrepareHeader()", result);
+ return(-1);
+ }
+ }
+
+ /* Ready to go! */
+ next_buffer = 0;
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/src/audio/windib/SDL_dibaudio.h b/distrib/sdl-1.2.15/src/audio/windib/SDL_dibaudio.h
new file mode 100644
index 0000000..16fd078
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/windib/SDL_dibaudio.h
@@ -0,0 +1,53 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_lowaudio_h
+#define _SDL_lowaudio_h
+
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_AudioDevice *this
+
+#define NUM_BUFFERS 2 /* -- Don't lower this! */
+
+struct SDL_PrivateAudioData {
+ HWAVEOUT sound;
+ CRITICAL_SECTION audio_cs;
+ HANDLE audio_event;
+ Uint8* mixbuf; /* The raw allocated mixing buffer */
+ WAVEHDR wavebuf[NUM_BUFFERS]; /* Wave audio fragments */
+ int cur_buffer;
+ int next_buffer;
+};
+
+/* Old variable names */
+#define sound (this->hidden->sound)
+#define audio_event (this->hidden->audio_event)
+#define audio_cs (this->hidden->audio_cs)
+#define mixbuf (this->hidden->mixbuf)
+#define wavebuf (this->hidden->wavebuf)
+#define cur_buffer (this->hidden->cur_buffer)
+#define next_buffer (this->hidden->next_buffer)
+
+#endif /* _SDL_lowaudio_h */
diff --git a/distrib/sdl-1.2.15/src/audio/windx5/SDL_dx5audio.c b/distrib/sdl-1.2.15/src/audio/windx5/SDL_dx5audio.c
new file mode 100644
index 0000000..c3d42ae
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/windx5/SDL_dx5audio.c
@@ -0,0 +1,705 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Allow access to a raw mixing buffer */
+
+#include "SDL_timer.h"
+#include "SDL_audio.h"
+#include "../SDL_audio_c.h"
+#include "SDL_dx5audio.h"
+
+/* Define this if you want to use DirectX 6 DirectSoundNotify interface */
+//#define USE_POSITION_NOTIFY
+
+/* DirectX function pointers for audio */
+HRESULT (WINAPI *DSoundCreate)(LPGUID, LPDIRECTSOUND *, LPUNKNOWN);
+
+/* Audio driver functions */
+static int DX5_OpenAudio(_THIS, SDL_AudioSpec *spec);
+static void DX5_ThreadInit(_THIS);
+static void DX5_WaitAudio_BusyWait(_THIS);
+#ifdef USE_POSITION_NOTIFY
+static void DX6_WaitAudio_EventWait(_THIS);
+#endif
+static void DX5_PlayAudio(_THIS);
+static Uint8 *DX5_GetAudioBuf(_THIS);
+static void DX5_WaitDone(_THIS);
+static void DX5_CloseAudio(_THIS);
+
+/* Audio driver bootstrap functions */
+
+static int Audio_Available(void)
+{
+ HINSTANCE DSoundDLL;
+ int dsound_ok;
+
+ /* Version check DSOUND.DLL (Is DirectX okay?) */
+ dsound_ok = 0;
+ DSoundDLL = LoadLibrary(TEXT("DSOUND.DLL"));
+ if ( DSoundDLL != NULL ) {
+ /* We just use basic DirectSound, we're okay */
+ /* Yay! */
+ /* Unfortunately, the sound drivers on NT have
+ higher latencies than the audio buffers used
+ by many SDL applications, so there are gaps
+ in the audio - it sounds terrible. Punt for now.
+ */
+ OSVERSIONINFO ver;
+ ver.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
+ GetVersionEx(&ver);
+ switch (ver.dwPlatformId) {
+ case VER_PLATFORM_WIN32_NT:
+ if ( ver.dwMajorVersion > 4 ) {
+ /* Win2K */
+ dsound_ok = 1;
+ } else {
+ /* WinNT */
+ dsound_ok = 0;
+ }
+ break;
+ default:
+ /* Win95 or Win98 */
+ dsound_ok = 1;
+ break;
+ }
+ /* Now check for DirectX 5 or better - otherwise
+ * we will fail later in DX5_OpenAudio without a chance
+ * to fall back to the DIB driver. */
+ if (dsound_ok) {
+ /* DirectSoundCaptureCreate was added in DX5 */
+ if (!GetProcAddress(DSoundDLL, TEXT("DirectSoundCaptureCreate")))
+ dsound_ok = 0;
+
+ }
+ /* Clean up.. */
+ FreeLibrary(DSoundDLL);
+ }
+ return(dsound_ok);
+}
+
+/* Functions for loading the DirectX functions dynamically */
+static HINSTANCE DSoundDLL = NULL;
+
+static void DX5_Unload(void)
+{
+ if ( DSoundDLL != NULL ) {
+ FreeLibrary(DSoundDLL);
+ DSoundCreate = NULL;
+ DSoundDLL = NULL;
+ }
+}
+static int DX5_Load(void)
+{
+ int status;
+
+ DX5_Unload();
+ DSoundDLL = LoadLibrary(TEXT("DSOUND.DLL"));
+ if ( DSoundDLL != NULL ) {
+ DSoundCreate = (void *)GetProcAddress(DSoundDLL,
+ TEXT("DirectSoundCreate"));
+ }
+ if ( DSoundDLL && DSoundCreate ) {
+ status = 0;
+ } else {
+ DX5_Unload();
+ status = -1;
+ }
+ return status;
+}
+
+static void Audio_DeleteDevice(SDL_AudioDevice *device)
+{
+ DX5_Unload();
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_AudioDevice *Audio_CreateDevice(int devindex)
+{
+ SDL_AudioDevice *this;
+
+ /* Load DirectX */
+ if ( DX5_Load() < 0 ) {
+ return(NULL);
+ }
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateAudioData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+
+ /* Set the function pointers */
+ this->OpenAudio = DX5_OpenAudio;
+ this->ThreadInit = DX5_ThreadInit;
+ this->WaitAudio = DX5_WaitAudio_BusyWait;
+ this->PlayAudio = DX5_PlayAudio;
+ this->GetAudioBuf = DX5_GetAudioBuf;
+ this->WaitDone = DX5_WaitDone;
+ this->CloseAudio = DX5_CloseAudio;
+
+ this->free = Audio_DeleteDevice;
+
+ return this;
+}
+
+AudioBootStrap DSOUND_bootstrap = {
+ "dsound", "Win95/98/2000 DirectSound",
+ Audio_Available, Audio_CreateDevice
+};
+
+static void SetDSerror(const char *function, int code)
+{
+ static const char *error;
+ static char errbuf[1024];
+
+ errbuf[0] = 0;
+ switch (code) {
+ case E_NOINTERFACE:
+ error =
+ "Unsupported interface\n-- Is DirectX 5.0 or later installed?";
+ break;
+ case DSERR_ALLOCATED:
+ error = "Audio device in use";
+ break;
+ case DSERR_BADFORMAT:
+ error = "Unsupported audio format";
+ break;
+ case DSERR_BUFFERLOST:
+ error = "Mixing buffer was lost";
+ break;
+ case DSERR_CONTROLUNAVAIL:
+ error = "Control requested is not available";
+ break;
+ case DSERR_INVALIDCALL:
+ error = "Invalid call for the current state";
+ break;
+ case DSERR_INVALIDPARAM:
+ error = "Invalid parameter";
+ break;
+ case DSERR_NODRIVER:
+ error = "No audio device found";
+ break;
+ case DSERR_OUTOFMEMORY:
+ error = "Out of memory";
+ break;
+ case DSERR_PRIOLEVELNEEDED:
+ error = "Caller doesn't have priority";
+ break;
+ case DSERR_UNSUPPORTED:
+ error = "Function not supported";
+ break;
+ default:
+ SDL_snprintf(errbuf, SDL_arraysize(errbuf),
+ "%s: Unknown DirectSound error: 0x%x",
+ function, code);
+ break;
+ }
+ if ( ! errbuf[0] ) {
+ SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: %s", function, error);
+ }
+ SDL_SetError("%s", errbuf);
+ return;
+}
+
+/* DirectSound needs to be associated with a window */
+static HWND mainwin = NULL;
+/* */
+void DX5_SoundFocus(HWND hwnd)
+{
+ mainwin = hwnd;
+}
+
+static void DX5_ThreadInit(_THIS)
+{
+ SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST);
+}
+
+static void DX5_WaitAudio_BusyWait(_THIS)
+{
+ DWORD status;
+ DWORD cursor, junk;
+ HRESULT result;
+
+ /* Semi-busy wait, since we have no way of getting play notification
+ on a primary mixing buffer located in hardware (DirectX 5.0)
+ */
+ result = IDirectSoundBuffer_GetCurrentPosition(mixbuf, &junk, &cursor);
+ if ( result != DS_OK ) {
+ if ( result == DSERR_BUFFERLOST ) {
+ IDirectSoundBuffer_Restore(mixbuf);
+ }
+#ifdef DEBUG_SOUND
+ SetDSerror("DirectSound GetCurrentPosition", result);
+#endif
+ return;
+ }
+
+ while ( (cursor/mixlen) == lastchunk ) {
+ /* FIXME: find out how much time is left and sleep that long */
+ SDL_Delay(1);
+
+ /* Try to restore a lost sound buffer */
+ IDirectSoundBuffer_GetStatus(mixbuf, &status);
+ if ( (status&DSBSTATUS_BUFFERLOST) ) {
+ IDirectSoundBuffer_Restore(mixbuf);
+ IDirectSoundBuffer_GetStatus(mixbuf, &status);
+ if ( (status&DSBSTATUS_BUFFERLOST) ) {
+ break;
+ }
+ }
+ if ( ! (status&DSBSTATUS_PLAYING) ) {
+ result = IDirectSoundBuffer_Play(mixbuf, 0, 0, DSBPLAY_LOOPING);
+ if ( result == DS_OK ) {
+ continue;
+ }
+#ifdef DEBUG_SOUND
+ SetDSerror("DirectSound Play", result);
+#endif
+ return;
+ }
+
+ /* Find out where we are playing */
+ result = IDirectSoundBuffer_GetCurrentPosition(mixbuf,
+ &junk, &cursor);
+ if ( result != DS_OK ) {
+ SetDSerror("DirectSound GetCurrentPosition", result);
+ return;
+ }
+ }
+}
+
+#ifdef USE_POSITION_NOTIFY
+static void DX6_WaitAudio_EventWait(_THIS)
+{
+ DWORD status;
+ HRESULT result;
+
+ /* Try to restore a lost sound buffer */
+ IDirectSoundBuffer_GetStatus(mixbuf, &status);
+ if ( (status&DSBSTATUS_BUFFERLOST) ) {
+ IDirectSoundBuffer_Restore(mixbuf);
+ IDirectSoundBuffer_GetStatus(mixbuf, &status);
+ if ( (status&DSBSTATUS_BUFFERLOST) ) {
+ return;
+ }
+ }
+ if ( ! (status&DSBSTATUS_PLAYING) ) {
+ result = IDirectSoundBuffer_Play(mixbuf, 0, 0, DSBPLAY_LOOPING);
+ if ( result != DS_OK ) {
+#ifdef DEBUG_SOUND
+ SetDSerror("DirectSound Play", result);
+#endif
+ return;
+ }
+ }
+ WaitForSingleObject(audio_event, INFINITE);
+}
+#endif /* USE_POSITION_NOTIFY */
+
+static void DX5_PlayAudio(_THIS)
+{
+ /* Unlock the buffer, allowing it to play */
+ if ( locked_buf ) {
+ IDirectSoundBuffer_Unlock(mixbuf, locked_buf, mixlen, NULL, 0);
+ }
+
+}
+
+static Uint8 *DX5_GetAudioBuf(_THIS)
+{
+ DWORD cursor, junk;
+ HRESULT result;
+ DWORD rawlen;
+
+ /* Figure out which blocks to fill next */
+ locked_buf = NULL;
+ result = IDirectSoundBuffer_GetCurrentPosition(mixbuf, &junk, &cursor);
+ if ( result == DSERR_BUFFERLOST ) {
+ IDirectSoundBuffer_Restore(mixbuf);
+ result = IDirectSoundBuffer_GetCurrentPosition(mixbuf,
+ &junk, &cursor);
+ }
+ if ( result != DS_OK ) {
+ SetDSerror("DirectSound GetCurrentPosition", result);
+ return(NULL);
+ }
+ cursor /= mixlen;
+#ifdef DEBUG_SOUND
+ /* Detect audio dropouts */
+ { DWORD spot = cursor;
+ if ( spot < lastchunk ) {
+ spot += NUM_BUFFERS;
+ }
+ if ( spot > lastchunk+1 ) {
+ fprintf(stderr, "Audio dropout, missed %d fragments\n",
+ (spot - (lastchunk+1)));
+ }
+ }
+#endif
+ lastchunk = cursor;
+ cursor = (cursor+1)%NUM_BUFFERS;
+ cursor *= mixlen;
+
+ /* Lock the audio buffer */
+ result = IDirectSoundBuffer_Lock(mixbuf, cursor, mixlen,
+ (LPVOID *)&locked_buf, &rawlen, NULL, &junk, 0);
+ if ( result == DSERR_BUFFERLOST ) {
+ IDirectSoundBuffer_Restore(mixbuf);
+ result = IDirectSoundBuffer_Lock(mixbuf, cursor, mixlen,
+ (LPVOID *)&locked_buf, &rawlen, NULL, &junk, 0);
+ }
+ if ( result != DS_OK ) {
+ SetDSerror("DirectSound Lock", result);
+ return(NULL);
+ }
+ return(locked_buf);
+}
+
+static void DX5_WaitDone(_THIS)
+{
+ Uint8 *stream;
+
+ /* Wait for the playing chunk to finish */
+ stream = this->GetAudioBuf(this);
+ if ( stream != NULL ) {
+ SDL_memset(stream, silence, mixlen);
+ this->PlayAudio(this);
+ }
+ this->WaitAudio(this);
+
+ /* Stop the looping sound buffer */
+ IDirectSoundBuffer_Stop(mixbuf);
+}
+
+static void DX5_CloseAudio(_THIS)
+{
+ if ( sound != NULL ) {
+ if ( mixbuf != NULL ) {
+ /* Clean up the audio buffer */
+ IDirectSoundBuffer_Release(mixbuf);
+ mixbuf = NULL;
+ }
+ if ( audio_event != NULL ) {
+ CloseHandle(audio_event);
+ audio_event = NULL;
+ }
+ IDirectSound_Release(sound);
+ sound = NULL;
+ }
+}
+
+#ifdef USE_PRIMARY_BUFFER
+/* This function tries to create a primary audio buffer, and returns the
+ number of audio chunks available in the created buffer.
+*/
+static int CreatePrimary(LPDIRECTSOUND sndObj, HWND focus,
+ LPDIRECTSOUNDBUFFER *sndbuf, WAVEFORMATEX *wavefmt, Uint32 chunksize)
+{
+ HRESULT result;
+ DSBUFFERDESC format;
+ DSBCAPS caps;
+ int numchunks;
+
+ /* Try to set primary mixing privileges */
+ result = IDirectSound_SetCooperativeLevel(sndObj, focus,
+ DSSCL_WRITEPRIMARY);
+ if ( result != DS_OK ) {
+#ifdef DEBUG_SOUND
+ SetDSerror("DirectSound SetCooperativeLevel", result);
+#endif
+ return(-1);
+ }
+
+ /* Try to create the primary buffer */
+ SDL_memset(&format, 0, sizeof(format));
+ format.dwSize = sizeof(format);
+ format.dwFlags=(DSBCAPS_PRIMARYBUFFER|DSBCAPS_GETCURRENTPOSITION2);
+ format.dwFlags |= DSBCAPS_STICKYFOCUS;
+#ifdef USE_POSITION_NOTIFY
+ format.dwFlags |= DSBCAPS_CTRLPOSITIONNOTIFY;
+#endif
+ result = IDirectSound_CreateSoundBuffer(sndObj, &format, sndbuf, NULL);
+ if ( result != DS_OK ) {
+#ifdef DEBUG_SOUND
+ SetDSerror("DirectSound CreateSoundBuffer", result);
+#endif
+ return(-1);
+ }
+
+ /* Check the size of the fragment buffer */
+ SDL_memset(&caps, 0, sizeof(caps));
+ caps.dwSize = sizeof(caps);
+ result = IDirectSoundBuffer_GetCaps(*sndbuf, &caps);
+ if ( result != DS_OK ) {
+#ifdef DEBUG_SOUND
+ SetDSerror("DirectSound GetCaps", result);
+#endif
+ IDirectSoundBuffer_Release(*sndbuf);
+ return(-1);
+ }
+ if ( (chunksize > caps.dwBufferBytes) ||
+ ((caps.dwBufferBytes%chunksize) != 0) ) {
+ /* The primary buffer size is not a multiple of 'chunksize'
+ -- this hopefully doesn't happen when 'chunksize' is a
+ power of 2.
+ */
+ IDirectSoundBuffer_Release(*sndbuf);
+ SDL_SetError(
+"Primary buffer size is: %d, cannot break it into chunks of %d bytes\n",
+ caps.dwBufferBytes, chunksize);
+ return(-1);
+ }
+ numchunks = (caps.dwBufferBytes/chunksize);
+
+ /* Set the primary audio format */
+ result = IDirectSoundBuffer_SetFormat(*sndbuf, wavefmt);
+ if ( result != DS_OK ) {
+#ifdef DEBUG_SOUND
+ SetDSerror("DirectSound SetFormat", result);
+#endif
+ IDirectSoundBuffer_Release(*sndbuf);
+ return(-1);
+ }
+ return(numchunks);
+}
+#endif /* USE_PRIMARY_BUFFER */
+
+/* This function tries to create a secondary audio buffer, and returns the
+ number of audio chunks available in the created buffer.
+*/
+static int CreateSecondary(LPDIRECTSOUND sndObj, HWND focus,
+ LPDIRECTSOUNDBUFFER *sndbuf, WAVEFORMATEX *wavefmt, Uint32 chunksize)
+{
+ const int numchunks = 8;
+ HRESULT result;
+ DSBUFFERDESC format;
+ LPVOID pvAudioPtr1, pvAudioPtr2;
+ DWORD dwAudioBytes1, dwAudioBytes2;
+
+ /* Try to set primary mixing privileges */
+ if ( focus ) {
+ result = IDirectSound_SetCooperativeLevel(sndObj,
+ focus, DSSCL_PRIORITY);
+ } else {
+ result = IDirectSound_SetCooperativeLevel(sndObj,
+ GetDesktopWindow(), DSSCL_NORMAL);
+ }
+ if ( result != DS_OK ) {
+#ifdef DEBUG_SOUND
+ SetDSerror("DirectSound SetCooperativeLevel", result);
+#endif
+ return(-1);
+ }
+
+ /* Try to create the secondary buffer */
+ SDL_memset(&format, 0, sizeof(format));
+ format.dwSize = sizeof(format);
+ format.dwFlags = DSBCAPS_GETCURRENTPOSITION2;
+#ifdef USE_POSITION_NOTIFY
+ format.dwFlags |= DSBCAPS_CTRLPOSITIONNOTIFY;
+#endif
+ if ( ! focus ) {
+ format.dwFlags |= DSBCAPS_GLOBALFOCUS;
+ } else {
+ format.dwFlags |= DSBCAPS_STICKYFOCUS;
+ }
+ format.dwBufferBytes = numchunks*chunksize;
+ if ( (format.dwBufferBytes < DSBSIZE_MIN) ||
+ (format.dwBufferBytes > DSBSIZE_MAX) ) {
+ SDL_SetError("Sound buffer size must be between %d and %d",
+ DSBSIZE_MIN/numchunks, DSBSIZE_MAX/numchunks);
+ return(-1);
+ }
+ format.dwReserved = 0;
+ format.lpwfxFormat = wavefmt;
+ result = IDirectSound_CreateSoundBuffer(sndObj, &format, sndbuf, NULL);
+ if ( result != DS_OK ) {
+ SetDSerror("DirectSound CreateSoundBuffer", result);
+ return(-1);
+ }
+ IDirectSoundBuffer_SetFormat(*sndbuf, wavefmt);
+
+ /* Silence the initial audio buffer */
+ result = IDirectSoundBuffer_Lock(*sndbuf, 0, format.dwBufferBytes,
+ (LPVOID *)&pvAudioPtr1, &dwAudioBytes1,
+ (LPVOID *)&pvAudioPtr2, &dwAudioBytes2,
+ DSBLOCK_ENTIREBUFFER);
+ if ( result == DS_OK ) {
+ if ( wavefmt->wBitsPerSample == 8 ) {
+ SDL_memset(pvAudioPtr1, 0x80, dwAudioBytes1);
+ } else {
+ SDL_memset(pvAudioPtr1, 0x00, dwAudioBytes1);
+ }
+ IDirectSoundBuffer_Unlock(*sndbuf,
+ (LPVOID)pvAudioPtr1, dwAudioBytes1,
+ (LPVOID)pvAudioPtr2, dwAudioBytes2);
+ }
+
+ /* We're ready to go */
+ return(numchunks);
+}
+
+/* This function tries to set position notify events on the mixing buffer */
+#ifdef USE_POSITION_NOTIFY
+static int CreateAudioEvent(_THIS)
+{
+ LPDIRECTSOUNDNOTIFY notify;
+ DSBPOSITIONNOTIFY *notify_positions;
+ int i, retval;
+ HRESULT result;
+
+ /* Default to fail on exit */
+ retval = -1;
+ notify = NULL;
+
+ /* Query for the interface */
+ result = IDirectSoundBuffer_QueryInterface(mixbuf,
+ &IID_IDirectSoundNotify, (void *)&notify);
+ if ( result != DS_OK ) {
+ goto done;
+ }
+
+ /* Allocate the notify structures */
+ notify_positions = (DSBPOSITIONNOTIFY *)SDL_malloc(NUM_BUFFERS*
+ sizeof(*notify_positions));
+ if ( notify_positions == NULL ) {
+ goto done;
+ }
+
+ /* Create the notify event */
+ audio_event = CreateEvent(NULL, FALSE, FALSE, NULL);
+ if ( audio_event == NULL ) {
+ goto done;
+ }
+
+ /* Set up the notify structures */
+ for ( i=0; i<NUM_BUFFERS; ++i ) {
+ notify_positions[i].dwOffset = i*mixlen;
+ notify_positions[i].hEventNotify = audio_event;
+ }
+ result = IDirectSoundNotify_SetNotificationPositions(notify,
+ NUM_BUFFERS, notify_positions);
+ if ( result == DS_OK ) {
+ retval = 0;
+ }
+done:
+ if ( notify != NULL ) {
+ IDirectSoundNotify_Release(notify);
+ }
+ return(retval);
+}
+#endif /* USE_POSITION_NOTIFY */
+
+static int DX5_OpenAudio(_THIS, SDL_AudioSpec *spec)
+{
+ HRESULT result;
+ WAVEFORMATEX waveformat;
+
+ /* Set basic WAVE format parameters */
+ SDL_memset(&waveformat, 0, sizeof(waveformat));
+ waveformat.wFormatTag = WAVE_FORMAT_PCM;
+
+ /* Determine the audio parameters from the AudioSpec */
+ switch ( spec->format & 0xFF ) {
+ case 8:
+ /* Unsigned 8 bit audio data */
+ spec->format = AUDIO_U8;
+ silence = 0x80;
+ waveformat.wBitsPerSample = 8;
+ break;
+ case 16:
+ /* Signed 16 bit audio data */
+ spec->format = AUDIO_S16;
+ silence = 0x00;
+ waveformat.wBitsPerSample = 16;
+ break;
+ default:
+ SDL_SetError("Unsupported audio format");
+ return(-1);
+ }
+ waveformat.nChannels = spec->channels;
+ waveformat.nSamplesPerSec = spec->freq;
+ waveformat.nBlockAlign =
+ waveformat.nChannels * (waveformat.wBitsPerSample/8);
+ waveformat.nAvgBytesPerSec =
+ waveformat.nSamplesPerSec * waveformat.nBlockAlign;
+
+ /* Update the fragment size as size in bytes */
+ SDL_CalculateAudioSpec(spec);
+
+ /* Open the audio device */
+ result = DSoundCreate(NULL, &sound, NULL);
+ if ( result != DS_OK ) {
+ SetDSerror("DirectSoundCreate", result);
+ return(-1);
+ }
+
+ /* Create the audio buffer to which we write */
+ NUM_BUFFERS = -1;
+#ifdef USE_PRIMARY_BUFFER
+ if ( mainwin ) {
+ NUM_BUFFERS = CreatePrimary(sound, mainwin, &mixbuf,
+ &waveformat, spec->size);
+ }
+#endif /* USE_PRIMARY_BUFFER */
+ if ( NUM_BUFFERS < 0 ) {
+ NUM_BUFFERS = CreateSecondary(sound, mainwin, &mixbuf,
+ &waveformat, spec->size);
+ if ( NUM_BUFFERS < 0 ) {
+ return(-1);
+ }
+#ifdef DEBUG_SOUND
+ fprintf(stderr, "Using secondary audio buffer\n");
+#endif
+ }
+#ifdef DEBUG_SOUND
+ else
+ fprintf(stderr, "Using primary audio buffer\n");
+#endif
+
+ /* The buffer will auto-start playing in DX5_WaitAudio() */
+ lastchunk = 0;
+ mixlen = spec->size;
+
+#ifdef USE_POSITION_NOTIFY
+ /* See if we can use DirectX 6 event notification */
+ if ( CreateAudioEvent(this) == 0 ) {
+ this->WaitAudio = DX6_WaitAudio_EventWait;
+ } else {
+ this->WaitAudio = DX5_WaitAudio_BusyWait;
+ }
+#endif
+ return(0);
+}
+
diff --git a/distrib/sdl-1.2.15/src/audio/windx5/SDL_dx5audio.h b/distrib/sdl-1.2.15/src/audio/windx5/SDL_dx5audio.h
new file mode 100644
index 0000000..bc4022f
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/windx5/SDL_dx5audio.h
@@ -0,0 +1,55 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_lowaudio_h
+#define _SDL_lowaudio_h
+
+#include "directx.h"
+
+#include "../SDL_sysaudio.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_AudioDevice *this
+
+/* The DirectSound objects */
+struct SDL_PrivateAudioData {
+ LPDIRECTSOUND sound;
+ LPDIRECTSOUNDBUFFER mixbuf;
+ int NUM_BUFFERS;
+ int mixlen, silence;
+ DWORD lastchunk;
+ Uint8 *locked_buf;
+ HANDLE audio_event;
+};
+
+/* Old variable names */
+#define sound (this->hidden->sound)
+#define mixbuf (this->hidden->mixbuf)
+#define NUM_BUFFERS (this->hidden->NUM_BUFFERS)
+#define mixlen (this->hidden->mixlen)
+#define silence (this->hidden->silence)
+#define lastchunk (this->hidden->lastchunk)
+#define locked_buf (this->hidden->locked_buf)
+#define audio_event (this->hidden->audio_event)
+
+#endif /* _SDL_lowaudio_h */
diff --git a/distrib/sdl-1.2.15/src/audio/windx5/directx.h b/distrib/sdl-1.2.15/src/audio/windx5/directx.h
new file mode 100644
index 0000000..5f339f2
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/audio/windx5/directx.h
@@ -0,0 +1,81 @@
+
+#ifndef _directx_h
+#define _directx_h
+
+/* Include all of the DirectX 5.0 headers and adds any necessary tweaks */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <mmsystem.h>
+#ifndef WIN32
+#define WIN32
+#endif
+#undef WINNT
+
+/* Far pointers don't exist in 32-bit code */
+#ifndef FAR
+#define FAR
+#endif
+
+/* Error codes not yet included in Win32 API header files */
+#ifndef MAKE_HRESULT
+#define MAKE_HRESULT(sev,fac,code) \
+ ((HRESULT)(((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))))
+#endif
+
+#ifndef S_OK
+#define S_OK (HRESULT)0x00000000L
+#endif
+
+#ifndef SUCCEEDED
+#define SUCCEEDED(x) ((HRESULT)(x) >= 0)
+#endif
+#ifndef FAILED
+#define FAILED(x) ((HRESULT)(x)<0)
+#endif
+
+#ifndef E_FAIL
+#define E_FAIL (HRESULT)0x80000008L
+#endif
+#ifndef E_NOINTERFACE
+#define E_NOINTERFACE (HRESULT)0x80004002L
+#endif
+#ifndef E_OUTOFMEMORY
+#define E_OUTOFMEMORY (HRESULT)0x8007000EL
+#endif
+#ifndef E_INVALIDARG
+#define E_INVALIDARG (HRESULT)0x80070057L
+#endif
+#ifndef E_NOTIMPL
+#define E_NOTIMPL (HRESULT)0x80004001L
+#endif
+#ifndef REGDB_E_CLASSNOTREG
+#define REGDB_E_CLASSNOTREG (HRESULT)0x80040154L
+#endif
+
+/* Severity codes */
+#ifndef SEVERITY_ERROR
+#define SEVERITY_ERROR 1
+#endif
+
+/* Error facility codes */
+#ifndef FACILITY_WIN32
+#define FACILITY_WIN32 7
+#endif
+
+#ifndef FIELD_OFFSET
+#define FIELD_OFFSET(type, field) ((LONG)&(((type *)0)->field))
+#endif
+
+/* DirectX headers (if it isn't included, I haven't tested it yet)
+ */
+/* We need these defines to mark what version of DirectX API we use */
+#define DIRECTDRAW_VERSION 0x0700
+#define DIRECTSOUND_VERSION 0x0500
+#define DIRECTINPUT_VERSION 0x0500
+
+#include <ddraw.h>
+#include <dsound.h>
+#include <dinput.h>
+
+#endif /* _directx_h */
diff --git a/distrib/sdl-1.2.15/src/cdrom/SDL_cdrom.c b/distrib/sdl-1.2.15/src/cdrom/SDL_cdrom.c
new file mode 100644
index 0000000..8f91bb1
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/SDL_cdrom.c
@@ -0,0 +1,341 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This is the CD-audio control API for Simple DirectMedia Layer */
+
+#include "SDL_cdrom.h"
+#include "SDL_syscdrom.h"
+
+#if !defined(__MACOS__)
+#define CLIP_FRAMES 10 /* Some CD-ROMs won't go all the way */
+#endif
+
+static int SDL_cdinitted = 0;
+static SDL_CD *default_cdrom;
+
+/* The system level CD-ROM control functions */
+struct CDcaps SDL_CDcaps = {
+ NULL, /* Name */
+ NULL, /* Open */
+ NULL, /* GetTOC */
+ NULL, /* Status */
+ NULL, /* Play */
+ NULL, /* Pause */
+ NULL, /* Resume */
+ NULL, /* Stop */
+ NULL, /* Eject */
+ NULL, /* Close */
+};
+int SDL_numcds;
+
+int SDL_CDROMInit(void)
+{
+ int retval;
+
+ SDL_numcds = 0;
+ retval = SDL_SYS_CDInit();
+ if ( retval == 0 ) {
+ SDL_cdinitted = 1;
+ }
+ default_cdrom = NULL;
+ return(retval);
+}
+
+/* Check to see if the CD-ROM subsystem has been initialized */
+static int CheckInit(int check_cdrom, SDL_CD **cdrom)
+{
+ int okay;
+
+ okay = SDL_cdinitted;
+ if ( check_cdrom && (*cdrom == NULL) ) {
+ *cdrom = default_cdrom;
+ if ( *cdrom == NULL ) {
+ SDL_SetError("CD-ROM not opened");
+ okay = 0;
+ }
+ }
+ if ( ! SDL_cdinitted ) {
+ SDL_SetError("CD-ROM subsystem not initialized");
+ }
+ return(okay);
+}
+
+int SDL_CDNumDrives(void)
+{
+ if ( ! CheckInit(0, NULL) ) {
+ return(-1);
+ }
+ return(SDL_numcds);
+}
+
+const char *SDL_CDName(int drive)
+{
+ if ( ! CheckInit(0, NULL) ) {
+ return(NULL);
+ }
+ if ( drive >= SDL_numcds ) {
+ SDL_SetError("Invalid CD-ROM drive index");
+ return(NULL);
+ }
+ if ( SDL_CDcaps.Name ) {
+ return(SDL_CDcaps.Name(drive));
+ } else {
+ return("");
+ }
+}
+
+SDL_CD *SDL_CDOpen(int drive)
+{
+ struct SDL_CD *cdrom;
+
+ if ( ! CheckInit(0, NULL) ) {
+ return(NULL);
+ }
+ if ( drive >= SDL_numcds ) {
+ SDL_SetError("Invalid CD-ROM drive index");
+ return(NULL);
+ }
+ cdrom = (SDL_CD *)SDL_malloc(sizeof(*cdrom));
+ if ( cdrom == NULL ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ SDL_memset(cdrom, 0, sizeof(*cdrom));
+ cdrom->id = SDL_CDcaps.Open(drive);
+ if ( cdrom->id < 0 ) {
+ SDL_free(cdrom);
+ return(NULL);
+ }
+ default_cdrom = cdrom;
+ return(cdrom);
+}
+
+CDstatus SDL_CDStatus(SDL_CD *cdrom)
+{
+ CDstatus status;
+ int i;
+ Uint32 position;
+
+ /* Check if the CD-ROM subsystem has been initialized */
+ if ( ! CheckInit(1, &cdrom) ) {
+ return(CD_ERROR);
+ }
+
+ /* Get the current status of the drive */
+ cdrom->numtracks = 0;
+ cdrom->cur_track = 0;
+ cdrom->cur_frame = 0;
+ status = SDL_CDcaps.Status(cdrom, &i);
+ position = (Uint32)i;
+ cdrom->status = status;
+
+ /* Get the table of contents, if there's a CD available */
+ if ( CD_INDRIVE(status) ) {
+ if ( SDL_CDcaps.GetTOC(cdrom) < 0 ) {
+ status = CD_ERROR;
+ }
+ /* If the drive is playing, get current play position */
+ if ( (status == CD_PLAYING) || (status == CD_PAUSED) ) {
+ for ( i=1; cdrom->track[i].offset <= position; ++i ) {
+ /* Keep looking */;
+ }
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Current position: %d, track = %d (offset is %d)\n",
+ position, i-1, cdrom->track[i-1].offset);
+#endif
+ cdrom->cur_track = i-1;
+ position -= cdrom->track[cdrom->cur_track].offset;
+ cdrom->cur_frame = position;
+ }
+ }
+ return(status);
+}
+
+int SDL_CDPlayTracks(SDL_CD *cdrom,
+ int strack, int sframe, int ntracks, int nframes)
+{
+ int etrack, eframe;
+ int start, length;
+
+ /* Check if the CD-ROM subsystem has been initialized */
+ if ( ! CheckInit(1, &cdrom) ) {
+ return(CD_ERROR);
+ }
+
+ /* Determine the starting and ending tracks */
+ if ( (strack < 0) || (strack >= cdrom->numtracks) ) {
+ SDL_SetError("Invalid starting track");
+ return(CD_ERROR);
+ }
+ if ( ! ntracks && ! nframes ) {
+ etrack = cdrom->numtracks;
+ eframe = 0;
+ } else {
+ etrack = strack+ntracks;
+ if ( etrack == strack ) {
+ eframe = sframe + nframes;
+ } else {
+ eframe = nframes;
+ }
+ }
+ if ( etrack > cdrom->numtracks ) {
+ SDL_SetError("Invalid play length");
+ return(CD_ERROR);
+ }
+
+ /* Skip data tracks and verify frame offsets */
+ while ( (strack <= etrack) &&
+ (cdrom->track[strack].type == SDL_DATA_TRACK) ) {
+ ++strack;
+ }
+ if ( sframe >= (int)cdrom->track[strack].length ) {
+ SDL_SetError("Invalid starting frame for track %d", strack);
+ return(CD_ERROR);
+ }
+ while ( (etrack > strack) &&
+ (cdrom->track[etrack-1].type == SDL_DATA_TRACK) ) {
+ --etrack;
+ }
+ if ( eframe > (int)cdrom->track[etrack].length ) {
+ SDL_SetError("Invalid ending frame for track %d", etrack);
+ return(CD_ERROR);
+ }
+
+ /* Determine start frame and play length */
+ start = (cdrom->track[strack].offset+sframe);
+ length = (cdrom->track[etrack].offset+eframe)-start;
+#ifdef CLIP_FRAMES
+ /* I've never seen this necessary, but xmcd does it.. */
+ length -= CLIP_FRAMES; /* CLIP_FRAMES == 10 */
+#endif
+ if ( length < 0 ) {
+ return(0);
+ }
+
+ /* Play! */
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Playing %d frames at offset %d\n", length, start);
+#endif
+ return(SDL_CDcaps.Play(cdrom, start, length));
+}
+
+int SDL_CDPlay(SDL_CD *cdrom, int sframe, int length)
+{
+ /* Check if the CD-ROM subsystem has been initialized */
+ if ( ! CheckInit(1, &cdrom) ) {
+ return(CD_ERROR);
+ }
+
+ return(SDL_CDcaps.Play(cdrom, sframe, length));
+}
+
+int SDL_CDPause(SDL_CD *cdrom)
+{
+ CDstatus status;
+ int retval;
+
+ /* Check if the CD-ROM subsystem has been initialized */
+ if ( ! CheckInit(1, &cdrom) ) {
+ return(CD_ERROR);
+ }
+
+ status = SDL_CDcaps.Status(cdrom, NULL);
+ switch (status) {
+ case CD_PLAYING:
+ retval = SDL_CDcaps.Pause(cdrom);
+ break;
+ default:
+ retval = 0;
+ break;
+ }
+ return(retval);
+}
+
+int SDL_CDResume(SDL_CD *cdrom)
+{
+ CDstatus status;
+ int retval;
+
+ /* Check if the CD-ROM subsystem has been initialized */
+ if ( ! CheckInit(1, &cdrom) ) {
+ return(CD_ERROR);
+ }
+
+ status = SDL_CDcaps.Status(cdrom, NULL);
+ switch (status) {
+ case CD_PAUSED:
+ retval = SDL_CDcaps.Resume(cdrom);
+ default:
+ retval = 0;
+ break;
+ }
+ return(retval);
+}
+
+int SDL_CDStop(SDL_CD *cdrom)
+{
+ CDstatus status;
+ int retval;
+
+ /* Check if the CD-ROM subsystem has been initialized */
+ if ( ! CheckInit(1, &cdrom) ) {
+ return(CD_ERROR);
+ }
+
+ status = SDL_CDcaps.Status(cdrom, NULL);
+ switch (status) {
+ case CD_PLAYING:
+ case CD_PAUSED:
+ retval = SDL_CDcaps.Stop(cdrom);
+ default:
+ retval = 0;
+ break;
+ }
+ return(retval);
+}
+
+int SDL_CDEject(SDL_CD *cdrom)
+{
+ /* Check if the CD-ROM subsystem has been initialized */
+ if ( ! CheckInit(1, &cdrom) ) {
+ return(CD_ERROR);
+ }
+ return(SDL_CDcaps.Eject(cdrom));
+}
+
+void SDL_CDClose(SDL_CD *cdrom)
+{
+ /* Check if the CD-ROM subsystem has been initialized */
+ if ( ! CheckInit(1, &cdrom) ) {
+ return;
+ }
+ SDL_CDcaps.Close(cdrom);
+ SDL_free(cdrom);
+ default_cdrom = NULL;
+}
+
+void SDL_CDROMQuit(void)
+{
+ SDL_SYS_CDQuit();
+ SDL_cdinitted = 0;
+}
diff --git a/distrib/sdl-1.2.15/src/cdrom/SDL_syscdrom.h b/distrib/sdl-1.2.15/src/cdrom/SDL_syscdrom.h
new file mode 100644
index 0000000..0feeee5
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/SDL_syscdrom.h
@@ -0,0 +1,76 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is SDL_free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This is the system specific header for the SDL CD-ROM API */
+
+/* Structure of CD audio control functions */
+extern struct CDcaps {
+ /* Get the name of the specified drive */
+ const char *(*Name)(int drive);
+
+ /* Open the specified drive, returning a drive id, or -1 on error */
+ int (*Open)(int drive);
+
+ /* Get table-of-contents (number of tracks + track info) for disk.
+ The TOC information should be stored in the cdrom structure.
+ This function should return 0 on success, or -1 on error.
+ */
+ int (*GetTOC)(SDL_CD *cdrom);
+
+ /* Return the current status and play position, in frames, of the
+ drive. 'position' may be NULL, and if so, should be ignored.
+ */
+ CDstatus (*Status)(SDL_CD *cdrom, int *position);
+
+ /* Play from frame 'start' to 'start+len' */
+ int (*Play)(SDL_CD *cdrom, int start, int len);
+
+ /* Pause play */
+ int (*Pause)(SDL_CD *cdrom);
+
+ /* Resume play */
+ int (*Resume)(SDL_CD *cdrom);
+
+ /* Stop play */
+ int (*Stop)(SDL_CD *cdrom);
+
+ /* Eject the current disk */
+ int (*Eject)(SDL_CD *cdrom);
+
+ /* Close the specified drive */
+ void (*Close)(SDL_CD *cdrom);
+} SDL_CDcaps;
+
+/* The number of available CD-ROM drives on the system */
+extern int SDL_numcds;
+
+/* Function to scan the system for CD-ROM drives and fill SDL_CDcaps.
+ * This function should set SDL_numcds to the number of available CD
+ * drives. Drive 0 should be the system default CD-ROM.
+ * It should return 0, or -1 on an unrecoverable fatal error.
+*/
+extern int SDL_SYS_CDInit(void);
+
+/* Function to perform any system-specific CD-ROM related cleanup */
+extern void SDL_SYS_CDQuit(void);
+
diff --git a/distrib/sdl-1.2.15/src/cdrom/aix/SDL_syscdrom.c b/distrib/sdl-1.2.15/src/cdrom/aix/SDL_syscdrom.c
new file mode 100644
index 0000000..e7e0558
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/aix/SDL_syscdrom.c
@@ -0,0 +1,660 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Carsten Griwodz
+ griff@kom.tu-darmstadt.de
+
+ based on linux/SDL_syscdrom.c by Sam Lantinga
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_CDROM_AIX
+
+/* Functions for system-level CD-ROM audio control */
+
+/*#define DEBUG_CDROM 1*/
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <unistd.h>
+
+#include <sys/ioctl.h>
+#include <sys/devinfo.h>
+#include <sys/mntctl.h>
+#include <sys/statfs.h>
+#include <sys/vmount.h>
+#include <fstab.h>
+#include <sys/scdisk.h>
+
+#include "SDL_cdrom.h"
+#include "../SDL_syscdrom.h"
+
+/* The maximum number of CD-ROM drives we'll detect */
+#define MAX_DRIVES 16
+
+/* A list of available CD-ROM drives */
+static char *SDL_cdlist[MAX_DRIVES];
+static dev_t SDL_cdmode[MAX_DRIVES];
+
+/* The system-dependent CD control functions */
+static const char *SDL_SYS_CDName(int drive);
+static int SDL_SYS_CDOpen(int drive);
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
+static int SDL_SYS_CDPause(SDL_CD *cdrom);
+static int SDL_SYS_CDResume(SDL_CD *cdrom);
+static int SDL_SYS_CDStop(SDL_CD *cdrom);
+static int SDL_SYS_CDEject(SDL_CD *cdrom);
+static void SDL_SYS_CDClose(SDL_CD *cdrom);
+static int SDL_SYS_CDioctl(int id, int command, void *arg);
+
+/* Check a drive to see if it is a CD-ROM */
+static int CheckDrive(char *drive, struct stat *stbuf)
+{
+ int is_cd;
+ int cdfd;
+ int ret;
+ struct devinfo info;
+
+ /* If it doesn't exist, return -1 */
+ if ( stat(drive, stbuf) < 0 ) {
+ return -1;
+ }
+
+ /* If it does exist, verify that it's an available CD-ROM */
+ is_cd = 0;
+ if ( S_ISCHR(stbuf->st_mode) || S_ISBLK(stbuf->st_mode) ) {
+ cdfd = open(drive, (O_RDONLY|O_EXCL|O_NONBLOCK), 0);
+ if ( cdfd >= 0 ) {
+ ret = SDL_SYS_CDioctl( cdfd, IOCINFO, &info );
+ if ( ret < 0 ) {
+ /* Some kind of error */
+ is_cd = 0;
+ } else {
+ if ( info.devtype == DD_CDROM ) {
+ is_cd = 1;
+ } else {
+ is_cd = 0;
+ }
+ }
+ close(cdfd);
+ }
+#ifdef DEBUG_CDROM
+ else
+ {
+ fprintf(stderr, "Could not open drive %s (%s)\n", drive, strerror(errno));
+ }
+#endif
+ }
+ return is_cd;
+}
+
+/* Add a CD-ROM drive to our list of valid drives */
+static void AddDrive(char *drive, struct stat *stbuf)
+{
+ int i;
+
+ if ( SDL_numcds < MAX_DRIVES ) {
+ /* Check to make sure it's not already in our list.
+ This can happen when we see a drive via symbolic link.
+ */
+ for ( i=0; i<SDL_numcds; ++i ) {
+ if ( stbuf->st_rdev == SDL_cdmode[i] ) {
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Duplicate drive detected: %s == %s\n", drive, SDL_cdlist[i]);
+#endif
+ return;
+ }
+ }
+
+ /* Add this drive to our list */
+ i = SDL_numcds;
+ SDL_cdlist[i] = SDL_strdup(drive);
+ if ( SDL_cdlist[i] == NULL ) {
+ SDL_OutOfMemory();
+ return;
+ }
+ SDL_cdmode[i] = stbuf->st_rdev;
+ ++SDL_numcds;
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Added CD-ROM drive: %s\n", drive);
+#endif
+ }
+}
+
+static void CheckMounts()
+{
+ char* buffer;
+ int bufsz;
+ struct vmount* ptr;
+ int ret;
+
+ buffer = (char*)SDL_malloc(10);
+ bufsz = 10;
+ if ( buffer==NULL )
+ {
+ fprintf(stderr, "Could not allocate 10 bytes in aix/SDL_syscdrom.c:CheckMounts\n" );
+ exit ( -10 );
+ }
+
+ do
+ {
+ /* mntctrl() returns an array of all mounted filesystems */
+ ret = mntctl ( MCTL_QUERY, bufsz, buffer );
+ if ( ret == 0 )
+ {
+ /* Buffer was too small, realloc. */
+ bufsz = *(int*)buffer; /* Required size is in first word. */
+ /* (whatever a word is in AIX 4.3.3) */
+ /* int seems to be OK in 32bit mode. */
+ SDL_free(buffer);
+ buffer = (char*)SDL_malloc(bufsz);
+ if ( buffer==NULL )
+ {
+ fprintf(stderr,
+ "Could not allocate %d bytes in aix/SDL_syscdrom.c:CheckMounts\n",
+ bufsz );
+ exit ( -10 );
+ }
+ }
+ else if ( ret < 0 )
+ {
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Error reading vmount structures\n");
+#endif
+ return;
+ }
+ }
+ while ( ret == 0 );
+
+#ifdef DEBUG_CDROM
+ fprintf ( stderr, "Read %d vmount structures\n",ret );
+#endif
+ ptr = (struct vmount*)buffer;
+ do
+ {
+ switch(ptr->vmt_gfstype)
+ {
+ case MNT_CDROM :
+ {
+ struct stat stbuf;
+ char* text;
+
+ text = (char*)ptr + ptr->vmt_data[VMT_OBJECT].vmt_off;
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Checking mount path: %s mounted on %s\n",
+ text, (char*)ptr + ptr->vmt_data[VMT_STUB].vmt_off );
+#endif
+ if ( CheckDrive( text, &stbuf) > 0)
+ {
+ AddDrive( text, &stbuf);
+ }
+ }
+ break;
+ default :
+ break;
+ }
+ ptr = (struct vmount*)((char*)ptr + ptr->vmt_length);
+ ret--;
+ }
+ while ( ret > 0 );
+
+ free ( buffer );
+}
+
+static int CheckNonmounts()
+{
+#ifdef _THREAD_SAFE
+ AFILE_t fsFile = NULL;
+ int passNo = 0;
+ int ret;
+ struct fstab entry;
+ struct stat stbuf;
+
+ ret = setfsent_r( &fsFile, &passNo );
+ if ( ret != 0 ) return -1;
+ do
+ {
+ ret = getfsent_r ( &entry, &fsFile, &passNo );
+ if ( ret == 0 ) {
+ char* l = SDL_strrchr(entry.fs_spec,'/');
+ if ( l != NULL ) {
+ if ( !SDL_strncmp("cd",++l,2) ) {
+#ifdef DEBUG_CDROM
+ fprintf(stderr,
+ "Found unmounted CD ROM drive with device name %s\n",
+ entry.fs_spec);
+#endif
+ if ( CheckDrive( entry.fs_spec, &stbuf) > 0)
+ {
+ AddDrive( entry.fs_spec, &stbuf);
+ }
+ }
+ }
+ }
+ }
+ while ( ret == 0 );
+ ret = endfsent_r ( &fsFile );
+ if ( ret != 0 ) return -1;
+ return 0;
+#else
+ struct fstab* entry;
+ struct stat stbuf;
+
+ setfsent();
+ do
+ {
+ entry = getfsent();
+ if ( entry != NULL ) {
+ char* l = SDL_strrchr(entry->fs_spec,'/');
+ if ( l != NULL ) {
+ if ( !SDL_strncmp("cd",++l,2) ) {
+#ifdef DEBUG_CDROM
+ fprintf(stderr,"Found unmounted CD ROM drive with device name %s", entry->fs_spec);
+#endif
+ if ( CheckDrive( entry->fs_spec, &stbuf) > 0)
+ {
+ AddDrive( entry->fs_spec, &stbuf);
+ }
+ }
+ }
+ }
+ }
+ while ( entry != NULL );
+ endfsent();
+#endif
+}
+
+int SDL_SYS_CDInit(void)
+{
+ char *SDLcdrom;
+ struct stat stbuf;
+
+ /* Fill in our driver capabilities */
+ SDL_CDcaps.Name = SDL_SYS_CDName;
+ SDL_CDcaps.Open = SDL_SYS_CDOpen;
+ SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
+ SDL_CDcaps.Status = SDL_SYS_CDStatus;
+ SDL_CDcaps.Play = SDL_SYS_CDPlay;
+ SDL_CDcaps.Pause = SDL_SYS_CDPause;
+ SDL_CDcaps.Resume = SDL_SYS_CDResume;
+ SDL_CDcaps.Stop = SDL_SYS_CDStop;
+ SDL_CDcaps.Eject = SDL_SYS_CDEject;
+ SDL_CDcaps.Close = SDL_SYS_CDClose;
+
+ /* Look in the environment for our CD-ROM drive list */
+ SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */
+ if ( SDLcdrom != NULL ) {
+ char *cdpath, *delim;
+ size_t len = SDL_strlen(SDLcdrom)+1;
+ cdpath = SDL_stack_alloc(char, len);
+ if ( cdpath != NULL ) {
+ SDL_strlcpy(cdpath, SDLcdrom, len);
+ SDLcdrom = cdpath;
+ do {
+ delim = SDL_strchr(SDLcdrom, ':');
+ if ( delim ) {
+ *delim++ = '\0';
+ }
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Checking CD-ROM drive from SDL_CDROM: %s\n", SDLcdrom);
+#endif
+ if ( CheckDrive(SDLcdrom, &stbuf) > 0 ) {
+ AddDrive(SDLcdrom, &stbuf);
+ }
+ if ( delim ) {
+ SDLcdrom = delim;
+ } else {
+ SDLcdrom = NULL;
+ }
+ } while ( SDLcdrom );
+ SDL_stack_free(cdpath);
+ }
+
+ /* If we found our drives, there's nothing left to do */
+ if ( SDL_numcds > 0 ) {
+ return(0);
+ }
+ }
+
+ CheckMounts();
+ CheckNonmounts();
+
+ return 0;
+}
+
+/* General ioctl() CD-ROM command function */
+static int SDL_SYS_CDioctl(int id, int command, void *arg)
+{
+ int retval;
+
+ retval = ioctl(id, command, arg);
+ if ( retval < 0 ) {
+ SDL_SetError("ioctl() error: %s", strerror(errno));
+ }
+ return retval;
+}
+
+static const char *SDL_SYS_CDName(int drive)
+{
+ return(SDL_cdlist[drive]);
+}
+
+static int SDL_SYS_CDOpen(int drive)
+{
+ int fd;
+ char* lastsl;
+ char* cdromname;
+ size_t len;
+
+ /*
+ * We found /dev/cd? drives and that is in our list. But we can
+ * open only the /dev/rcd? versions of those devices for Audio CD.
+ */
+ len = SDL_strlen(SDL_cdlist[drive])+2;
+ cdromname = (char*)SDL_malloc(len);
+ SDL_strlcpy(cdromname,SDL_cdlist[drive],len);
+ lastsl = SDL_strrchr(cdromname,'/');
+ if (lastsl) {
+ *lastsl = 0;
+ SDL_strlcat(cdromname,"/r",len);
+ lastsl = SDL_strrchr(SDL_cdlist[drive],'/');
+ if (lastsl) {
+ lastsl++;
+ SDL_strlcat(cdromname,lastsl,len);
+ }
+ }
+
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Should open drive %s, opening %s\n", SDL_cdlist[drive], cdromname);
+#endif
+
+ /*
+ * Use exclusive access. Don't use SC_DIAGNOSTICS as xmcd does because they
+ * require root priviledges, and we don't want that. SC_SINGLE provides
+ * exclusive access with less trouble.
+ */
+ fd = openx(cdromname, O_RDONLY, NULL, SC_SINGLE);
+ if ( fd < 0 )
+ {
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Could not open drive %s (%s)\n", cdromname, strerror(errno));
+#endif
+ }
+ else
+ {
+ struct mode_form_op cdMode;
+ int ret;
+#ifdef DEBUG_CDROM
+ cdMode.action = CD_GET_MODE;
+ ret = SDL_SYS_CDioctl(fd, DK_CD_MODE, &cdMode);
+ if ( ret < 0 ) {
+ fprintf(stderr,
+ "Could not get drive mode for %s (%s)\n",
+ cdromname, strerror(errno));
+ } else {
+ switch(cdMode.cd_mode_form) {
+ case CD_MODE1 :
+ fprintf(stderr,
+ "Drive mode for %s is %s\n",
+ cdromname, "CD-ROM Data Mode 1");
+ break;
+ case CD_MODE2_FORM1 :
+ fprintf(stderr,
+ "Drive mode for %s is %s\n",
+ cdromname, "CD-ROM XA Data Mode 2 Form 1");
+ break;
+ case CD_MODE2_FORM2 :
+ fprintf(stderr,
+ "Drive mode for %s is %s\n",
+ cdromname, "CD-ROM XA Data Mode 2 Form 2");
+ break;
+ case CD_DA :
+ fprintf(stderr,
+ "Drive mode for %s is %s\n",
+ cdromname, "CD-DA");
+ break;
+ default :
+ fprintf(stderr,
+ "Drive mode for %s is %s\n",
+ cdromname, "unknown");
+ break;
+ }
+ }
+#endif
+
+ cdMode.action = CD_CHG_MODE;
+ cdMode.cd_mode_form = CD_DA;
+ ret = SDL_SYS_CDioctl(fd, DK_CD_MODE, &cdMode);
+ if ( ret < 0 ) {
+#ifdef DEBUG_CDROM
+ fprintf(stderr,
+ "Could not set drive mode for %s (%s)\n",
+ cdromname, strerror(errno));
+#endif
+ SDL_SetError("ioctl() error: Could not set CD drive mode, %s",
+ strerror(errno));
+ } else {
+#ifdef DEBUG_CDROM
+ fprintf(stderr,
+ "Drive mode for %s set to CD_DA\n",
+ cdromname);
+#endif
+ }
+ }
+ SDL_free(cdromname);
+ return fd;
+}
+
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
+{
+ struct cd_audio_cmd cmd;
+ struct cd_audio_cmd entry;
+ int i;
+ int okay;
+
+ cmd.audio_cmds = CD_TRK_INFO_AUDIO;
+ cmd.msf_flag = FALSE;
+ if ( SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd) < 0 ) {
+ return -1;
+ }
+
+ okay = 0;
+ cdrom->numtracks = cmd.indexing.track_index.last_track
+ - cmd.indexing.track_index.first_track+1;
+ if ( cdrom->numtracks > SDL_MAX_TRACKS ) {
+ cdrom->numtracks = SDL_MAX_TRACKS;
+ }
+
+ /* Read all the track TOC entries */
+ for ( i=0; i<=cdrom->numtracks; ++i ) {
+ if ( i == cdrom->numtracks ) {
+ cdrom->track[i].id = 0xAA;;
+ } else {
+ cdrom->track[i].id = cmd.indexing.track_index.first_track+i;
+ }
+ entry.audio_cmds = CD_GET_TRK_MSF;
+ entry.indexing.track_msf.track = cdrom->track[i].id;
+ if ( SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &entry) < 0 ) {
+ break;
+ } else {
+ cdrom->track[i].type = 0; /* don't know how to detect 0x04 data track */
+ cdrom->track[i].offset = MSF_TO_FRAMES(
+ entry.indexing.track_msf.mins,
+ entry.indexing.track_msf.secs,
+ entry.indexing.track_msf.frames);
+ cdrom->track[i].length = 0;
+ if ( i > 0 ) {
+ cdrom->track[i-1].length = cdrom->track[i].offset
+ - cdrom->track[i-1].offset;
+ }
+ }
+ }
+ if ( i == (cdrom->numtracks+1) ) {
+ okay = 1;
+ }
+ return(okay ? 0 : -1);
+}
+
+/* Get CD-ROM status */
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
+{
+ CDstatus status;
+ struct cd_audio_cmd cmd;
+ cmd.audio_cmds = CD_INFO_AUDIO;
+
+ if ( SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd) < 0 ) {
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "ioctl failed in SDL_SYS_CDStatus (%s)\n", SDL_GetError());
+#endif
+ status = CD_ERROR;
+ } else {
+ switch (cmd.status) {
+ case CD_NO_AUDIO:
+ case CD_COMPLETED:
+ status = CD_STOPPED;
+ break;
+ case CD_PLAY_AUDIO:
+ status = CD_PLAYING;
+ break;
+ case CD_PAUSE_AUDIO:
+ status = CD_PAUSED;
+ break;
+ case CD_NOT_VALID:
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "cdStatus failed with CD_NOT_VALID\n");
+#endif
+ status = CD_ERROR;
+ break;
+ case CD_STATUS_ERROR:
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "cdStatus failed with CD_STATUS_ERROR\n");
+#endif
+ status = CD_ERROR;
+ break;
+ default:
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "cdStatus failed with unknown error\n");
+#endif
+ status = CD_ERROR;
+ break;
+ }
+ }
+ if ( position ) {
+ if ( status == CD_PLAYING || (status == CD_PAUSED) ) {
+ *position = MSF_TO_FRAMES( cmd.indexing.info_audio.current_mins,
+ cmd.indexing.info_audio.current_secs,
+ cmd.indexing.info_audio.current_frames);
+ } else {
+ *position = 0;
+ }
+ }
+ return status;
+}
+
+/* Start play */
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
+{
+ struct cd_audio_cmd cmd;
+
+ /*
+ * My CD Rom is muted by default. I think I read that this is new with
+ * AIX 4.3. SDL does not change the volume, so I need a kludge. Maybe
+ * its better to do this elsewhere?
+ */
+ cmd.audio_cmds = CD_PLAY_AUDIO | CD_SET_VOLUME;
+ cmd.msf_flag = TRUE;
+ FRAMES_TO_MSF(start,
+ &cmd.indexing.msf.first_mins,
+ &cmd.indexing.msf.first_secs,
+ &cmd.indexing.msf.first_frames);
+ FRAMES_TO_MSF(start+length,
+ &cmd.indexing.msf.last_mins,
+ &cmd.indexing.msf.last_secs,
+ &cmd.indexing.msf.last_frames);
+ cmd.volume_type = CD_VOLUME_ALL;
+ cmd.all_channel_vol = 255; /* This is a uchar. What is a good value? No docu! */
+ cmd.out_port_0_sel = CD_AUDIO_CHNL_0;
+ cmd.out_port_1_sel = CD_AUDIO_CHNL_1;
+ cmd.out_port_2_sel = CD_AUDIO_CHNL_2;
+ cmd.out_port_3_sel = CD_AUDIO_CHNL_3;
+
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Trying to play from %d:%d:%d to %d:%d:%d\n",
+ cmd.indexing.msf.first_mins,
+ cmd.indexing.msf.first_secs,
+ cmd.indexing.msf.first_frames,
+ cmd.indexing.msf.last_mins,
+ cmd.indexing.msf.last_secs,
+ cmd.indexing.msf.last_frames);
+#endif
+ return(SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd));
+}
+
+/* Pause play */
+static int SDL_SYS_CDPause(SDL_CD *cdrom)
+{
+ struct cd_audio_cmd cmd;
+ cmd.audio_cmds = CD_PAUSE_AUDIO;
+ return(SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd));
+}
+
+/* Resume play */
+static int SDL_SYS_CDResume(SDL_CD *cdrom)
+{
+ struct cd_audio_cmd cmd;
+ cmd.audio_cmds = CD_RESUME_AUDIO;
+ return(SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd));
+}
+
+/* Stop play */
+static int SDL_SYS_CDStop(SDL_CD *cdrom)
+{
+ struct cd_audio_cmd cmd;
+ cmd.audio_cmds = CD_STOP_AUDIO;
+ return(SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd));
+}
+
+/* Eject the CD-ROM */
+static int SDL_SYS_CDEject(SDL_CD *cdrom)
+{
+ return(SDL_SYS_CDioctl(cdrom->id, DKEJECT, 0));
+}
+
+/* Close the CD-ROM handle */
+static void SDL_SYS_CDClose(SDL_CD *cdrom)
+{
+ close(cdrom->id);
+}
+
+void SDL_SYS_CDQuit(void)
+{
+ int i;
+
+ if ( SDL_numcds > 0 ) {
+ for ( i=0; i<SDL_numcds; ++i ) {
+ SDL_free(SDL_cdlist[i]);
+ }
+ SDL_numcds = 0;
+ }
+}
+
+#endif /* SDL_CDROM_AIX */
diff --git a/distrib/sdl-1.2.15/src/cdrom/beos/SDL_syscdrom.cc b/distrib/sdl-1.2.15/src/cdrom/beos/SDL_syscdrom.cc
new file mode 100644
index 0000000..9a62c38
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/beos/SDL_syscdrom.cc
@@ -0,0 +1,410 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_CDROM_BEOS
+
+/* Functions for system-level CD-ROM audio control on BeOS
+ (not completely implemented yet)
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <scsi.h>
+#include <Directory.h>
+#include <Entry.h>
+#include <Path.h>
+
+#include "SDL_cdrom.h"
+extern "C" {
+#include "../SDL_syscdrom.h"
+}
+
+/* Constants to help us get at the SCSI table-of-contents info */
+#define CD_NUMTRACKS(toc) toc.toc_data[3]
+#define CD_TRACK(toc, track) (&toc.toc_data[6+(track)*8])
+#define CD_TRACK_N(toc, track) CD_TRACK(toc, track)[0]
+#define CD_TRACK_M(toc, track) CD_TRACK(toc, track)[3]
+#define CD_TRACK_S(toc, track) CD_TRACK(toc, track)[4]
+#define CD_TRACK_F(toc, track) CD_TRACK(toc, track)[5]
+
+/* Constants to help us get at the SCSI position info */
+#define POS_TRACK(pos) pos.position[6]
+#define POS_ABS_M(pos) pos.position[9]
+#define POS_ABS_S(pos) pos.position[10]
+#define POS_ABS_F(pos) pos.position[11]
+#define POS_REL_M(pos) pos.position[13]
+#define POS_REL_S(pos) pos.position[14]
+#define POS_REL_F(pos) pos.position[15]
+
+/* The maximum number of CD-ROM drives we'll detect */
+#define MAX_DRIVES 16
+
+/* A list of available CD-ROM drives */
+static char *SDL_cdlist[MAX_DRIVES];
+
+/* The system-dependent CD control functions */
+static const char *SDL_SYS_CDName(int drive);
+static int SDL_SYS_CDOpen(int drive);
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
+static int SDL_SYS_CDPause(SDL_CD *cdrom);
+static int SDL_SYS_CDResume(SDL_CD *cdrom);
+static int SDL_SYS_CDStop(SDL_CD *cdrom);
+static int SDL_SYS_CDEject(SDL_CD *cdrom);
+static void SDL_SYS_CDClose(SDL_CD *cdrom);
+int try_dir(const char *directory);
+
+
+/* Check a drive to see if it is a CD-ROM */
+static int CheckDrive(char *drive)
+{
+ struct stat stbuf;
+ int is_cd, cdfd;
+ device_geometry info;
+
+ /* If it doesn't exist, return -1 */
+ if ( stat(drive, &stbuf) < 0 ) {
+ return(-1);
+ }
+
+ /* If it does exist, verify that it's an available CD-ROM */
+ is_cd = 0;
+ cdfd = open(drive, 0);
+ if ( cdfd >= 0 ) {
+ if ( ioctl(cdfd, B_GET_GEOMETRY, &info) == B_NO_ERROR ) {
+ if ( info.device_type == B_CD ) {
+ is_cd = 1;
+ }
+ }
+ close(cdfd);
+ } else {
+ /* This can happen when the drive is open .. (?) */;
+ is_cd = 1;
+ }
+ return(is_cd);
+}
+
+/* Add a CD-ROM drive to our list of valid drives */
+static void AddDrive(char *drive)
+{
+ int i;
+ size_t len;
+
+ if ( SDL_numcds < MAX_DRIVES ) {
+ /* Add this drive to our list */
+ i = SDL_numcds;
+ len = SDL_strlen(drive)+1;
+ SDL_cdlist[i] = (char *)SDL_malloc(len);
+ if ( SDL_cdlist[i] == NULL ) {
+ SDL_OutOfMemory();
+ return;
+ }
+ SDL_strlcpy(SDL_cdlist[i], drive, len);
+ ++SDL_numcds;
+#ifdef CDROM_DEBUG
+ fprintf(stderr, "Added CD-ROM drive: %s\n", drive);
+#endif
+ }
+}
+
+/* IDE bus scanning magic */
+enum {
+ IDE_GET_DEVICES_INFO = B_DEVICE_OP_CODES_END + 50,
+};
+struct ide_ctrl_info {
+ bool ide_0_present;
+ bool ide_0_master_present;
+ bool ide_0_slave_present;
+ int ide_0_master_type;
+ int ide_0_slave_type;
+ bool ide_1_present;
+ bool ide_1_master_present;
+ bool ide_1_slave_present;
+ int ide_1_master_type;
+ int ide_1_slave_type;
+};
+
+int SDL_SYS_CDInit(void)
+{
+ char *SDLcdrom;
+
+ /* Fill in our driver capabilities */
+ SDL_CDcaps.Name = SDL_SYS_CDName;
+ SDL_CDcaps.Open = SDL_SYS_CDOpen;
+ SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
+ SDL_CDcaps.Status = SDL_SYS_CDStatus;
+ SDL_CDcaps.Play = SDL_SYS_CDPlay;
+ SDL_CDcaps.Pause = SDL_SYS_CDPause;
+ SDL_CDcaps.Resume = SDL_SYS_CDResume;
+ SDL_CDcaps.Stop = SDL_SYS_CDStop;
+ SDL_CDcaps.Eject = SDL_SYS_CDEject;
+ SDL_CDcaps.Close = SDL_SYS_CDClose;
+
+ /* Look in the environment for our CD-ROM drive list */
+ SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */
+ if ( SDLcdrom != NULL ) {
+ char *cdpath, *delim;
+ size_t len = SDL_strlen(SDLcdrom)+1;
+ cdpath = SDL_stack_alloc(char, len);
+ if ( cdpath != NULL ) {
+ SDL_strlcpy(cdpath, SDLcdrom, len);
+ SDLcdrom = cdpath;
+ do {
+ delim = SDL_strchr(SDLcdrom, ':');
+ if ( delim ) {
+ *delim++ = '\0';
+ }
+ if ( CheckDrive(SDLcdrom) > 0 ) {
+ AddDrive(SDLcdrom);
+ }
+ if ( delim ) {
+ SDLcdrom = delim;
+ } else {
+ SDLcdrom = NULL;
+ }
+ } while ( SDLcdrom );
+ SDL_stack_free(cdpath);
+ }
+
+ /* If we found our drives, there's nothing left to do */
+ if ( SDL_numcds > 0 ) {
+ return(0);
+ }
+ }
+
+ /* Scan the system for CD-ROM drives */
+ try_dir("/dev/disk");
+ return 0;
+}
+
+
+int try_dir(const char *directory)
+{
+ BDirectory dir;
+ dir.SetTo(directory);
+ if(dir.InitCheck() != B_NO_ERROR) {
+ return false;
+ }
+ dir.Rewind();
+ BEntry entry;
+ while(dir.GetNextEntry(&entry) >= 0) {
+ BPath path;
+ const char *name;
+ entry_ref e;
+
+ if(entry.GetPath(&path) != B_NO_ERROR)
+ continue;
+ name = path.Path();
+
+ if(entry.GetRef(&e) != B_NO_ERROR)
+ continue;
+
+ if(entry.IsDirectory()) {
+ if(SDL_strcmp(e.name, "floppy") == 0)
+ continue; /* ignore floppy (it is not silent) */
+ int devfd = try_dir(name);
+ if(devfd >= 0)
+ return devfd;
+ }
+ else {
+ int devfd;
+ device_geometry g;
+
+ if(SDL_strcmp(e.name, "raw") != 0)
+ continue; /* ignore partitions */
+
+ devfd = open(name, O_RDONLY);
+ if(devfd < 0)
+ continue;
+
+ if(ioctl(devfd, B_GET_GEOMETRY, &g, sizeof(g)) >= 0) {
+ if(g.device_type == B_CD)
+ {
+ AddDrive(strdup(name));
+ }
+ }
+ close(devfd);
+ }
+ }
+ return B_ERROR;
+}
+
+
+/* General ioctl() CD-ROM command function */
+static int SDL_SYS_CDioctl(int index, int command, void *arg)
+{
+ int okay;
+ int fd;
+
+ okay = 0;
+ fd = open(SDL_cdlist[index], 0);
+ if ( fd >= 0 ) {
+ if ( ioctl(fd, command, arg) == B_NO_ERROR ) {
+ okay = 1;
+ }
+ close(fd);
+ }
+ return(okay ? 0 : -1);
+}
+
+static const char *SDL_SYS_CDName(int drive)
+{
+ return(SDL_cdlist[drive]);
+}
+
+static int SDL_SYS_CDOpen(int drive)
+{
+ return(drive);
+}
+
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
+{
+ int i;
+ scsi_toc toc;
+
+ if ( SDL_SYS_CDioctl(cdrom->id, B_SCSI_GET_TOC, &toc) == 0 ) {
+ cdrom->numtracks = CD_NUMTRACKS(toc);
+ if ( cdrom->numtracks > SDL_MAX_TRACKS ) {
+ cdrom->numtracks = SDL_MAX_TRACKS;
+ }
+ for ( i=0; i<=cdrom->numtracks; ++i ) {
+ cdrom->track[i].id = CD_TRACK_N(toc, i);
+ /* FIXME: How do we tell on BeOS? */
+ cdrom->track[i].type = SDL_AUDIO_TRACK;
+ cdrom->track[i].offset = MSF_TO_FRAMES(
+ CD_TRACK_M(toc, i),
+ CD_TRACK_S(toc, i),
+ CD_TRACK_F(toc, i));
+ cdrom->track[i].length = 0;
+ if ( i > 0 ) {
+ cdrom->track[i-1].length =
+ cdrom->track[i].offset-
+ cdrom->track[i-1].offset;
+ }
+ }
+ return(0);
+ } else {
+ return(-1);
+ }
+}
+
+/* Get CD-ROM status */
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
+{
+ CDstatus status;
+ int fd;
+ int cur_frame;
+ scsi_position pos;
+
+ fd = open(SDL_cdlist[cdrom->id], 0);
+ cur_frame = 0;
+ if ( fd >= 0 ) {
+ if ( ioctl(fd, B_SCSI_GET_POSITION, &pos) == B_NO_ERROR ) {
+ cur_frame = MSF_TO_FRAMES(
+ POS_ABS_M(pos), POS_ABS_S(pos), POS_ABS_F(pos));
+ }
+ if ( ! pos.position[1] || (pos.position[1] >= 0x13) ||
+ ((pos.position[1] == 0x12) && (!pos.position[6])) ) {
+ status = CD_STOPPED;
+ } else
+ if ( pos.position[1] == 0x11 ) {
+ status = CD_PLAYING;
+ } else {
+ status = CD_PAUSED;
+ }
+ close(fd);
+ } else {
+ status = CD_TRAYEMPTY;
+ }
+ if ( position ) {
+ *position = cur_frame;
+ }
+ return(status);
+}
+
+/* Start play */
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
+{
+ int okay;
+ int fd;
+ scsi_play_position pos;
+
+ okay = 0;
+ fd = open(SDL_cdlist[cdrom->id], 0);
+ if ( fd >= 0 ) {
+ FRAMES_TO_MSF(start, &pos.start_m, &pos.start_s, &pos.start_f);
+ FRAMES_TO_MSF(start+length, &pos.end_m, &pos.end_s, &pos.end_f);
+ if ( ioctl(fd, B_SCSI_PLAY_POSITION, &pos) == B_NO_ERROR ) {
+ okay = 1;
+ }
+ close(fd);
+ }
+ return(okay ? 0 : -1);
+}
+
+/* Pause play */
+static int SDL_SYS_CDPause(SDL_CD *cdrom)
+{
+ return(SDL_SYS_CDioctl(cdrom->id, B_SCSI_PAUSE_AUDIO, 0));
+}
+
+/* Resume play */
+static int SDL_SYS_CDResume(SDL_CD *cdrom)
+{
+ return(SDL_SYS_CDioctl(cdrom->id, B_SCSI_RESUME_AUDIO, 0));
+}
+
+/* Stop play */
+static int SDL_SYS_CDStop(SDL_CD *cdrom)
+{
+ return(SDL_SYS_CDioctl(cdrom->id, B_SCSI_STOP_AUDIO, 0));
+}
+
+/* Eject the CD-ROM */
+static int SDL_SYS_CDEject(SDL_CD *cdrom)
+{
+ return(SDL_SYS_CDioctl(cdrom->id, B_SCSI_EJECT, 0));
+}
+
+/* Close the CD-ROM handle */
+static void SDL_SYS_CDClose(SDL_CD *cdrom)
+{
+ close(cdrom->id);
+}
+
+void SDL_SYS_CDQuit(void)
+{
+ int i;
+
+ if ( SDL_numcds > 0 ) {
+ for ( i=0; i<SDL_numcds; ++i ) {
+ SDL_free(SDL_cdlist[i]);
+ }
+ SDL_numcds = 0;
+ }
+}
+
+#endif /* SDL_CDROM_BEOS */
diff --git a/distrib/sdl-1.2.15/src/cdrom/bsdi/SDL_syscdrom.c b/distrib/sdl-1.2.15/src/cdrom/bsdi/SDL_syscdrom.c
new file mode 100644
index 0000000..61edb81
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/bsdi/SDL_syscdrom.c
@@ -0,0 +1,542 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_CDROM_BSDI
+
+/*
+ * Functions for system-level CD-ROM audio control for BSD/OS 4.x
+ * This started life out as a copy of the freebsd/SDL_cdrom.c file but was
+ * heavily modified. Works for standard (MMC) SCSI and ATAPI CDrom drives.
+ *
+ * Steven Schultz - sms@to.gd-es.com
+*/
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <err.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include </sys/dev/scsi/scsi.h>
+#include </sys/dev/scsi/scsi_ioctl.h>
+
+#include "SDL_cdrom.h"
+#include "../SDL_syscdrom.h"
+
+/*
+ * The msf_to_frame and frame_to_msf were yanked from libcdrom and inlined
+ * here so that -lcdrom doesn't have to be dragged in for something so simple.
+*/
+
+#define FRAMES_PER_SECOND 75
+#define FRAMES_PER_MINUTE (FRAMES_PER_SECOND * 60)
+
+int
+msf_to_frame(int minute, int second, int frame)
+ {
+ return(minute * FRAMES_PER_MINUTE + second * FRAMES_PER_SECOND + frame);
+ }
+
+void
+frame_to_msf(int frame, int *minp, int *secp, int *framep)
+ {
+ *minp = frame / FRAMES_PER_MINUTE;
+ *secp = (frame % FRAMES_PER_MINUTE) / FRAMES_PER_SECOND;
+ *framep = frame % FRAMES_PER_SECOND;
+ }
+
+/* The maximum number of CD-ROM drives we'll detect */
+#define MAX_DRIVES 16
+
+/* A list of available CD-ROM drives */
+static char *SDL_cdlist[MAX_DRIVES];
+static dev_t SDL_cdmode[MAX_DRIVES];
+
+/* The system-dependent CD control functions */
+static const char *SDL_SYS_CDName(int drive);
+static int SDL_SYS_CDOpen(int drive);
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
+static int SDL_SYS_CDPause(SDL_CD *cdrom);
+static int SDL_SYS_CDResume(SDL_CD *cdrom);
+static int SDL_SYS_CDStop(SDL_CD *cdrom);
+static int SDL_SYS_CDEject(SDL_CD *cdrom);
+static void SDL_SYS_CDClose(SDL_CD *cdrom);
+
+typedef struct scsi_cdb cdb_t;
+
+static int scsi_cmd(int fd,
+ struct scsi_cdb *cdb,
+ int cdblen,
+ int rw,
+ caddr_t data,
+ int datalen,
+ struct scsi_user_cdb *sus)
+ {
+ int scsistatus;
+ unsigned char *cp;
+ struct scsi_user_cdb suc;
+
+ /* safety checks */
+ if (!cdb) return(-1);
+ if (rw != SUC_READ && rw != SUC_WRITE) return(-1);
+
+ suc.suc_flags = rw;
+ suc.suc_cdblen = cdblen;
+ bcopy(cdb, suc.suc_cdb, cdblen);
+ suc.suc_datalen = datalen;
+ suc.suc_data = data;
+ suc.suc_timeout = 10; /* 10 secs max for TUR or SENSE */
+ if (ioctl(fd, SCSIRAWCDB, &suc) == -1)
+ return(-11);
+ scsistatus = suc.suc_sus.sus_status;
+ cp = suc.suc_sus.sus_sense;
+
+/*
+ * If a place to copy the sense data back to has been provided then the
+ * caller is responsible for checking the errors and printing any information
+ * out if the status was not successful.
+*/
+ if (scsistatus != 0 && !sus)
+ {
+ fprintf(stderr,"scsistatus = %x cmd = %x\n",
+ scsistatus, cdb[0]);
+ fprintf(stderr, "sense %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x\n",
+ cp[0], cp[1], cp[2], cp[3], cp[4], cp[5],
+ cp[6], cp[7], cp[8], cp[9], cp[10], cp[11],
+ cp[12], cp[13], cp[14], cp[15]);
+ return(1);
+ }
+ if (sus)
+ bcopy(&suc, sus, sizeof (struct scsi_user_cdb));
+ if (scsistatus)
+ return(1); /* Return non-zero for unsuccessful status */
+ return(0);
+ }
+
+/* request vendor brand and model */
+unsigned char *Inquiry(int fd)
+ {
+ static struct scsi_cdb6 cdb =
+ {
+ 0x12,
+ 0, 0, 0,
+ 56,
+ 0
+ };
+ static unsigned char Inqbuffer[56];
+
+ if (scsi_cmd(fd, (cdb_t *)&cdb, 6, SUC_READ, Inqbuffer,
+ sizeof(Inqbuffer), 0))
+ return("\377");
+ return(Inqbuffer);
+ }
+
+#define ADD_SENSECODE 12
+#define ADD_SC_QUALIFIER 13
+
+int TestForMedium(int fd)
+ {
+ int sts, asc, ascq;
+ struct scsi_user_cdb sus;
+ static struct scsi_cdb6 cdb =
+ {
+ CMD_TEST_UNIT_READY, /* command */
+ 0, /* reserved */
+ 0, /* reserved */
+ 0, /* reserved */
+ 0, /* reserved */
+ 0 /* reserved */
+ };
+
+again: sts = scsi_cmd(fd, (cdb_t *)&cdb, 6, SUC_READ, 0, 0, &sus);
+ asc = sus.suc_sus.sus_sense[ADD_SENSECODE];
+ ascq = sus.suc_sus.sus_sense[ADD_SC_QUALIFIER];
+ if (asc == 0x3a && ascq == 0x0) /* no medium */
+ return(0);
+ if (asc == 0x28 && ascq == 0x0) /* medium changed */
+ goto again;
+ if (asc == 0x4 && ascq == 0x1 ) /* coming ready */
+ {
+ sleep(2);
+ goto again;
+ }
+ return(1);
+ }
+
+/* Check a drive to see if it is a CD-ROM */
+static int CheckDrive(char *drive, struct stat *stbuf)
+{
+ int is_cd = 0, cdfd;
+ char *p;
+
+ /* If it doesn't exist, return -1 */
+ if ( stat(drive, stbuf) < 0 ) {
+ return(-1);
+ }
+
+ /* If it does exist, verify that it's an available CD-ROM */
+ cdfd = open(drive, (O_RDONLY|O_EXCL|O_NONBLOCK), 0);
+ if ( cdfd >= 0 ) {
+ p = Inquiry(cdfd);
+ if (*p == TYPE_ROM)
+ is_cd = 1;
+ close(cdfd);
+ }
+ return(is_cd);
+}
+
+/* Add a CD-ROM drive to our list of valid drives */
+static void AddDrive(char *drive, struct stat *stbuf)
+{
+ int i;
+
+ if ( SDL_numcds < MAX_DRIVES ) {
+ /* Check to make sure it's not already in our list.
+ This can happen when we see a drive via symbolic link.
+ */
+ for ( i=0; i<SDL_numcds; ++i ) {
+ if ( stbuf->st_rdev == SDL_cdmode[i] ) {
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Duplicate drive detected: %s == %s\n", drive, SDL_cdlist[i]);
+#endif
+ return;
+ }
+ }
+
+ /* Add this drive to our list */
+ i = SDL_numcds;
+ SDL_cdlist[i] = SDL_strdup(drive);
+ if ( SDL_cdlist[i] == NULL ) {
+ SDL_OutOfMemory();
+ return;
+ }
+ SDL_cdmode[i] = stbuf->st_rdev;
+ ++SDL_numcds;
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Added CD-ROM drive: %s\n", drive);
+#endif
+ }
+}
+
+int SDL_SYS_CDInit(void)
+{
+ /* checklist: /dev/rsr?c */
+ static char *checklist[] = {
+ "?0 rsr?", NULL
+ };
+ char *SDLcdrom;
+ int i, j, exists;
+ char drive[32];
+ struct stat stbuf;
+
+ /* Fill in our driver capabilities */
+ SDL_CDcaps.Name = SDL_SYS_CDName;
+ SDL_CDcaps.Open = SDL_SYS_CDOpen;
+ SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
+ SDL_CDcaps.Status = SDL_SYS_CDStatus;
+ SDL_CDcaps.Play = SDL_SYS_CDPlay;
+ SDL_CDcaps.Pause = SDL_SYS_CDPause;
+ SDL_CDcaps.Resume = SDL_SYS_CDResume;
+ SDL_CDcaps.Stop = SDL_SYS_CDStop;
+ SDL_CDcaps.Eject = SDL_SYS_CDEject;
+ SDL_CDcaps.Close = SDL_SYS_CDClose;
+
+ /* Look in the environment for our CD-ROM drive list */
+ SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */
+ if ( SDLcdrom != NULL ) {
+ char *cdpath, *delim;
+ size_t len = SDL_strlen(SDLcdrom)+1;
+ cdpath = SDL_stack_alloc(char, len);
+ if ( cdpath != NULL ) {
+ SDL_strlcpy(cdpath, SDLcdrom, len);
+ SDLcdrom = cdpath;
+ do {
+ delim = SDL_strchr(SDLcdrom, ':');
+ if ( delim ) {
+ *delim++ = '\0';
+ }
+ if ( CheckDrive(SDLcdrom, &stbuf) > 0 ) {
+ AddDrive(SDLcdrom, &stbuf);
+ }
+ if ( delim ) {
+ SDLcdrom = delim;
+ } else {
+ SDLcdrom = NULL;
+ }
+ } while ( SDLcdrom );
+ SDL_stack_free(cdpath);
+ }
+
+ /* If we found our drives, there's nothing left to do */
+ if ( SDL_numcds > 0 ) {
+ return(0);
+ }
+ }
+
+ /* Scan the system for CD-ROM drives */
+ for ( i=0; checklist[i]; ++i ) {
+ if ( checklist[i][0] == '?' ) {
+ char *insert;
+ exists = 1;
+ for ( j=checklist[i][1]; exists; ++j ) {
+ SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%sc", &checklist[i][3]);
+ insert = SDL_strchr(drive, '?');
+ if ( insert != NULL ) {
+ *insert = j;
+ }
+ switch (CheckDrive(drive, &stbuf)) {
+ /* Drive exists and is a CD-ROM */
+ case 1:
+ AddDrive(drive, &stbuf);
+ break;
+ /* Drive exists, but isn't a CD-ROM */
+ case 0:
+ break;
+ /* Drive doesn't exist */
+ case -1:
+ exists = 0;
+ break;
+ }
+ }
+ } else {
+ SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]);
+ if ( CheckDrive(drive, &stbuf) > 0 ) {
+ AddDrive(drive, &stbuf);
+ }
+ }
+ }
+ return(0);
+}
+
+static const char *SDL_SYS_CDName(int drive)
+{
+ return(SDL_cdlist[drive]);
+}
+
+static int SDL_SYS_CDOpen(int drive)
+{
+ return(open(SDL_cdlist[drive], O_RDONLY | O_NONBLOCK | O_EXCL, 0));
+}
+
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
+ {
+ u_char cdb[10], buf[4], *p, *toc;
+ struct scsi_user_cdb sus;
+ int i, sts, first_track, last_track, ntracks, toc_size;
+
+ bzero(cdb, sizeof (cdb));
+ cdb[0] = 0x43; /* Read TOC */
+ cdb[1] = 0x2; /* MSF */
+ cdb[8] = 4; /* size TOC header */
+ sts = scsi_cmd(cdrom->id, (cdb_t *)cdb, 10, SUC_READ, buf, 4, &sus);
+ if (sts < 0)
+ return(-1);
+ first_track = buf[2];
+ last_track = buf[3];
+ ntracks = last_track - first_track + 1;
+ cdrom->numtracks = ntracks;
+ toc_size = 4 + (ntracks + 1) * 8;
+ toc = (u_char *)SDL_malloc(toc_size);
+ if (toc == NULL)
+ return(-1);
+ bzero(cdb, sizeof (cdb));
+ cdb[0] = 0x43;
+ cdb[1] = 0x2;
+ cdb[6] = first_track;
+ cdb[7] = toc_size >> 8;
+ cdb[8] = toc_size & 0xff;
+ sts = scsi_cmd(cdrom->id, (cdb_t *)cdb, 10, SUC_READ, toc, toc_size,
+ &sus);
+ if (sts < 0)
+ {
+ SDL_free(toc);
+ return(-1);
+ }
+
+ for (i = 0, p = toc+4; i <= ntracks; i++, p+= 8)
+ {
+ if (i == ntracks)
+ cdrom->track[i].id = 0xAA; /* Leadout */
+ else
+ cdrom->track[i].id = first_track + i;
+ if (p[1] & 0x20)
+ cdrom->track[i].type = SDL_DATA_TRACK;
+ else
+ cdrom->track[i].type = SDL_AUDIO_TRACK;
+ cdrom->track[i].offset = msf_to_frame(p[5], p[6], p[7]);
+ cdrom->track[i].length = 0;
+ if (i > 0)
+ cdrom->track[i-1].length = cdrom->track[i].offset -
+ cdrom->track[i-1].offset;
+ }
+ SDL_free(toc);
+ return(0);
+ }
+
+/* Get CD-ROM status */
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
+ {
+ CDstatus status;
+ u_char cdb[10], buf[16];
+ int sts;
+ struct scsi_user_cdb sus;
+
+ bzero(cdb, sizeof (cdb));
+ cdb[0] = 0x42; /* read subq */
+ cdb[1] = 0x2; /* MSF */
+ cdb[2] = 0x40; /* q channel */
+ cdb[3] = 1; /* current pos */
+ cdb[7] = sizeof (buf) >> 8;
+ cdb[8] = sizeof (buf) & 0xff;
+ sts = scsi_cmd(cdrom->id, (cdb_t *)cdb, 10, SUC_READ, buf, sizeof (buf),
+ &sus);
+ if (sts < 0)
+ return(-1);
+ if (sts)
+ {
+ if (TestForMedium(cdrom->id) == 0)
+ status = CD_TRAYEMPTY;
+ else
+ status = CD_ERROR;
+ }
+ else
+ {
+ switch (buf[1])
+ {
+ case 0x11:
+ status = CD_PLAYING;
+ break;
+ case 0x12:
+ status = CD_PAUSED;
+ break;
+ case 0x13:
+ case 0x14:
+ case 0x15:
+ status = CD_STOPPED;
+ break;
+ default:
+ status = CD_ERROR;
+ break;
+ }
+ }
+ if (position)
+ {
+ if ( status == CD_PLAYING || (status == CD_PAUSED) )
+ *position = msf_to_frame(buf[9], buf[10], buf[11]);
+ else
+ *position = 0;
+ }
+ return(status);
+ }
+
+/* Start play */
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
+ {
+ u_char cdb[10];
+ int sts, minute, second, frame, eminute, esecond, eframe;
+ struct scsi_user_cdb sus;
+
+ bzero(cdb, sizeof(cdb));
+ cdb[0] = 0x47; /* Play */
+ frame_to_msf(start, &minute, &second, &frame);
+ frame_to_msf(start + length, &eminute, &esecond, &eframe);
+ cdb[3] = minute;
+ cdb[4] = second;
+ cdb[5] = frame;
+ cdb[6] = eminute;
+ cdb[7] = esecond;
+ cdb[8] = eframe;
+ sts = scsi_cmd(cdrom->id, (cdb_t *)cdb, 10, SUC_READ, 0, 0, &sus);
+ return(sts);
+ }
+
+static int
+pauseresume(SDL_CD *cdrom, int flag)
+ {
+ u_char cdb[10];
+ struct scsi_user_cdb sus;
+
+ bzero(cdb, sizeof (cdb));
+ cdb[0] = 0x4b;
+ cdb[8] = flag & 0x1;
+ return(scsi_cmd(cdrom->id, (cdb_t *)cdb, 10, SUC_READ, 0, 0, &sus));
+ }
+
+/* Pause play */
+static int SDL_SYS_CDPause(SDL_CD *cdrom)
+{
+ return(pauseresume(cdrom, 0));
+}
+
+/* Resume play */
+static int SDL_SYS_CDResume(SDL_CD *cdrom)
+{
+ return(pauseresume(cdrom, 1));
+}
+
+/* Stop play */
+static int SDL_SYS_CDStop(SDL_CD *cdrom)
+{
+ u_char cdb[6];
+ struct scsi_user_cdb sus;
+
+ bzero(cdb, sizeof (cdb));
+ cdb[0] = 0x1b; /* stop */
+ cdb[1] = 1; /* immediate */
+ return(scsi_cmd(cdrom->id, (cdb_t *)cdb, 6, SUC_READ, 0, 0, &sus));
+}
+
+/* Eject the CD-ROM */
+static int SDL_SYS_CDEject(SDL_CD *cdrom)
+{
+ u_char cdb[6];
+ struct scsi_user_cdb sus;
+
+ bzero(cdb, sizeof (cdb));
+ cdb[0] = 0x1b; /* stop */
+ cdb[1] = 1; /* immediate */
+ cdb[4] = 2; /* eject */
+ return(scsi_cmd(cdrom->id, (cdb_t *)cdb, 6, SUC_READ, 0, 0, &sus));
+}
+
+/* Close the CD-ROM handle */
+static void SDL_SYS_CDClose(SDL_CD *cdrom)
+ {
+ close(cdrom->id);
+ }
+
+void SDL_SYS_CDQuit(void)
+{
+ int i;
+
+ if ( SDL_numcds > 0 ) {
+ for ( i=0; i<SDL_numcds; ++i ) {
+ SDL_free(SDL_cdlist[i]);
+ }
+ }
+ SDL_numcds = 0;
+}
+
+#endif /* SDL_CDROM_BSDI */
diff --git a/distrib/sdl-1.2.15/src/cdrom/dc/SDL_syscdrom.c b/distrib/sdl-1.2.15/src/cdrom/dc/SDL_syscdrom.c
new file mode 100644
index 0000000..445ad7c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/dc/SDL_syscdrom.c
@@ -0,0 +1,167 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_CDROM_DC
+
+/* Functions for system-level CD-ROM audio control */
+
+#include <dc/cdrom.h>
+#include <dc/spu.h>
+
+#include "SDL_cdrom.h"
+#include "../SDL_syscdrom.h"
+
+/* The system-dependent CD control functions */
+static const char *SDL_SYS_CDName(int drive);
+static int SDL_SYS_CDOpen(int drive);
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
+static int SDL_SYS_CDPause(SDL_CD *cdrom);
+static int SDL_SYS_CDResume(SDL_CD *cdrom);
+static int SDL_SYS_CDStop(SDL_CD *cdrom);
+static int SDL_SYS_CDEject(SDL_CD *cdrom);
+static void SDL_SYS_CDClose(SDL_CD *cdrom);
+
+
+int SDL_SYS_CDInit(void)
+{
+ /* Fill in our driver capabilities */
+ SDL_CDcaps.Name = SDL_SYS_CDName;
+ SDL_CDcaps.Open = SDL_SYS_CDOpen;
+ SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
+ SDL_CDcaps.Status = SDL_SYS_CDStatus;
+ SDL_CDcaps.Play = SDL_SYS_CDPlay;
+ SDL_CDcaps.Pause = SDL_SYS_CDPause;
+ SDL_CDcaps.Resume = SDL_SYS_CDResume;
+ SDL_CDcaps.Stop = SDL_SYS_CDStop;
+ SDL_CDcaps.Eject = SDL_SYS_CDEject;
+ SDL_CDcaps.Close = SDL_SYS_CDClose;
+
+ return(0);
+}
+
+static const char *SDL_SYS_CDName(int drive)
+{
+ return "/cd";
+}
+
+static int SDL_SYS_CDOpen(int drive)
+{
+ return(drive);
+}
+
+#define TRACK_CDDA 0
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
+{
+ CDROM_TOC toc;
+ int ret,i;
+
+ ret = cdrom_read_toc(&toc,0);
+ if (ret!=ERR_OK) {
+ return -1;
+ }
+
+ cdrom->numtracks = TOC_TRACK(toc.last)-TOC_TRACK(toc.first)+1;
+ for(i=0;i<cdrom->numtracks;i++) {
+ unsigned long entry = toc.entry[i];
+ cdrom->track[i].id = i+1;
+ cdrom->track[i].type = (TOC_CTRL(toc.entry[i])==TRACK_CDDA)?SDL_AUDIO_TRACK:SDL_DATA_TRACK;
+ cdrom->track[i].offset = TOC_LBA(entry)-150;
+ cdrom->track[i].length = TOC_LBA((i+1<toc.last)?toc.entry[i+1]:toc.leadout_sector)-TOC_LBA(entry);
+ }
+
+ return 0;
+}
+
+/* Get CD-ROM status */
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
+{
+ int ret,dc_status,disc_type;
+
+ ret = cdrom_get_status(&dc_status,&disc_type);
+ if (ret!=ERR_OK) return CD_ERROR;
+
+ switch(dc_status) {
+// case CD_STATUS_BUSY:
+ case CD_STATUS_PAUSED:
+ return CD_PAUSED;
+ case CD_STATUS_STANDBY:
+ return CD_STOPPED;
+ case CD_STATUS_PLAYING:
+ return CD_PLAYING;
+// case CD_STATUS_SEEKING:
+// case CD_STATUS_SCANING:
+ case CD_STATUS_OPEN:
+ case CD_STATUS_NO_DISC:
+ return CD_TRAYEMPTY;
+ default:
+ return CD_ERROR;
+ }
+}
+
+/* Start play */
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
+{
+ int ret = cdrom_cdda_play(start-150,start-150+length,1,CDDA_SECTORS);
+ return ret==ERR_OK?0:-1;
+}
+
+/* Pause play */
+static int SDL_SYS_CDPause(SDL_CD *cdrom)
+{
+ int ret=cdrom_cdda_pause();
+ return ret==ERR_OK?0:-1;
+}
+
+/* Resume play */
+static int SDL_SYS_CDResume(SDL_CD *cdrom)
+{
+ int ret=cdrom_cdda_resume();
+ return ret==ERR_OK?0:-1;
+}
+
+/* Stop play */
+static int SDL_SYS_CDStop(SDL_CD *cdrom)
+{
+ int ret=cdrom_spin_down();
+ return ret==ERR_OK?0:-1;
+}
+
+/* Eject the CD-ROM */
+static int SDL_SYS_CDEject(SDL_CD *cdrom)
+{
+ return -1;
+}
+
+/* Close the CD-ROM handle */
+static void SDL_SYS_CDClose(SDL_CD *cdrom)
+{
+}
+
+void SDL_SYS_CDQuit(void)
+{
+
+}
+
+#endif /* SDL_CDROM_DC */
diff --git a/distrib/sdl-1.2.15/src/cdrom/dummy/SDL_syscdrom.c b/distrib/sdl-1.2.15/src/cdrom/dummy/SDL_syscdrom.c
new file mode 100644
index 0000000..9821e97
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/dummy/SDL_syscdrom.c
@@ -0,0 +1,41 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#if defined(SDL_CDROM_DUMMY) || defined(SDL_CDROM_DISABLED)
+
+/* Stub functions for system-level CD-ROM audio control */
+
+#include "SDL_cdrom.h"
+#include "../SDL_syscdrom.h"
+
+int SDL_SYS_CDInit(void)
+{
+ return(0);
+}
+
+void SDL_SYS_CDQuit(void)
+{
+ return;
+}
+
+#endif /* SDL_CDROM_DUMMY || SDL_CDROM_DISABLED */
diff --git a/distrib/sdl-1.2.15/src/cdrom/freebsd/SDL_syscdrom.c b/distrib/sdl-1.2.15/src/cdrom/freebsd/SDL_syscdrom.c
new file mode 100644
index 0000000..0260c94
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/freebsd/SDL_syscdrom.c
@@ -0,0 +1,406 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_CDROM_FREEBSD
+
+/* Functions for system-level CD-ROM audio control */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/cdio.h>
+
+#include "SDL_cdrom.h"
+#include "../SDL_syscdrom.h"
+
+
+/* The maximum number of CD-ROM drives we'll detect */
+#define MAX_DRIVES 16
+
+/* A list of available CD-ROM drives */
+static char *SDL_cdlist[MAX_DRIVES];
+static dev_t SDL_cdmode[MAX_DRIVES];
+
+/* The system-dependent CD control functions */
+static const char *SDL_SYS_CDName(int drive);
+static int SDL_SYS_CDOpen(int drive);
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
+static int SDL_SYS_CDPause(SDL_CD *cdrom);
+static int SDL_SYS_CDResume(SDL_CD *cdrom);
+static int SDL_SYS_CDStop(SDL_CD *cdrom);
+static int SDL_SYS_CDEject(SDL_CD *cdrom);
+static void SDL_SYS_CDClose(SDL_CD *cdrom);
+
+/* Some ioctl() errno values which occur when the tray is empty */
+#define ERRNO_TRAYEMPTY(errno) \
+ ((errno == EIO) || (errno == ENOENT) || (errno == EINVAL))
+
+/* Check a drive to see if it is a CD-ROM */
+static int CheckDrive(char *drive, struct stat *stbuf)
+{
+ int is_cd, cdfd;
+ struct ioc_read_subchannel info;
+
+ /* If it doesn't exist, return -1 */
+ if ( stat(drive, stbuf) < 0 ) {
+ return(-1);
+ }
+
+ /* If it does exist, verify that it's an available CD-ROM */
+ is_cd = 0;
+ if ( S_ISCHR(stbuf->st_mode) || S_ISBLK(stbuf->st_mode) ) {
+ cdfd = open(drive, (O_RDONLY|O_EXCL|O_NONBLOCK), 0);
+ if ( cdfd >= 0 ) {
+ info.address_format = CD_MSF_FORMAT;
+ info.data_format = CD_CURRENT_POSITION;
+ info.data_len = 0;
+ info.data = NULL;
+ /* Under Linux, EIO occurs when a disk is not present.
+ This isn't 100% reliable, so we use the USE_MNTENT
+ code above instead.
+ */
+ if ( (ioctl(cdfd, CDIOCREADSUBCHANNEL, &info) == 0) ||
+ ERRNO_TRAYEMPTY(errno) ) {
+ is_cd = 1;
+ }
+ close(cdfd);
+ }
+ }
+ return(is_cd);
+}
+
+/* Add a CD-ROM drive to our list of valid drives */
+static void AddDrive(char *drive, struct stat *stbuf)
+{
+ int i;
+
+ if ( SDL_numcds < MAX_DRIVES ) {
+ /* Check to make sure it's not already in our list.
+ This can happen when we see a drive via symbolic link.
+ */
+ for ( i=0; i<SDL_numcds; ++i ) {
+ if ( stbuf->st_rdev == SDL_cdmode[i] ) {
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Duplicate drive detected: %s == %s\n", drive, SDL_cdlist[i]);
+#endif
+ return;
+ }
+ }
+
+ /* Add this drive to our list */
+ i = SDL_numcds;
+ SDL_cdlist[i] = SDL_strdup(drive);
+ if ( SDL_cdlist[i] == NULL ) {
+ SDL_OutOfMemory();
+ return;
+ }
+ SDL_cdmode[i] = stbuf->st_rdev;
+ ++SDL_numcds;
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Added CD-ROM drive: %s\n", drive);
+#endif
+ }
+}
+
+int SDL_SYS_CDInit(void)
+{
+ /* checklist: /dev/cdrom,/dev/cd?c /dev/acd?c
+ /dev/matcd?c /dev/mcd?c /dev/scd?c */
+ static char *checklist[] = {
+ "cdrom", "?0 cd?", "?0 acd?", "?0 matcd?", "?0 mcd?", "?0 scd?",NULL
+ };
+ char *SDLcdrom;
+ int i, j, exists;
+ char drive[32];
+ struct stat stbuf;
+
+ /* Fill in our driver capabilities */
+ SDL_CDcaps.Name = SDL_SYS_CDName;
+ SDL_CDcaps.Open = SDL_SYS_CDOpen;
+ SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
+ SDL_CDcaps.Status = SDL_SYS_CDStatus;
+ SDL_CDcaps.Play = SDL_SYS_CDPlay;
+ SDL_CDcaps.Pause = SDL_SYS_CDPause;
+ SDL_CDcaps.Resume = SDL_SYS_CDResume;
+ SDL_CDcaps.Stop = SDL_SYS_CDStop;
+ SDL_CDcaps.Eject = SDL_SYS_CDEject;
+ SDL_CDcaps.Close = SDL_SYS_CDClose;
+
+ /* Look in the environment for our CD-ROM drive list */
+ SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */
+ if ( SDLcdrom != NULL ) {
+ char *cdpath, *delim;
+ size_t len = SDL_strlen(SDLcdrom)+1;
+ cdpath = SDL_stack_alloc(char, len);
+ if ( cdpath != NULL ) {
+ SDL_strlcpy(cdpath, SDLcdrom, len);
+ SDLcdrom = cdpath;
+ do {
+ delim = SDL_strchr(SDLcdrom, ':');
+ if ( delim ) {
+ *delim++ = '\0';
+ }
+ if ( CheckDrive(SDLcdrom, &stbuf) > 0 ) {
+ AddDrive(SDLcdrom, &stbuf);
+ }
+ if ( delim ) {
+ SDLcdrom = delim;
+ } else {
+ SDLcdrom = NULL;
+ }
+ } while ( SDLcdrom );
+ SDL_stack_free(cdpath);
+ }
+
+ /* If we found our drives, there's nothing left to do */
+ if ( SDL_numcds > 0 ) {
+ return(0);
+ }
+ }
+
+ /* Scan the system for CD-ROM drives */
+ for ( i=0; checklist[i]; ++i ) {
+ if ( checklist[i][0] == '?' ) {
+ char *insert;
+ exists = 1;
+ for ( j=checklist[i][1]; exists; ++j ) {
+ SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%sc", &checklist[i][3]);
+ insert = SDL_strchr(drive, '?');
+ if ( insert != NULL ) {
+ *insert = j;
+ }
+ switch (CheckDrive(drive, &stbuf)) {
+ /* Drive exists and is a CD-ROM */
+ case 1:
+ AddDrive(drive, &stbuf);
+ break;
+ /* Drive exists, but isn't a CD-ROM */
+ case 0:
+ break;
+ /* Drive doesn't exist */
+ case -1:
+ exists = 0;
+ break;
+ }
+ }
+ } else {
+ SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]);
+ if ( CheckDrive(drive, &stbuf) > 0 ) {
+ AddDrive(drive, &stbuf);
+ }
+ }
+ }
+ return(0);
+}
+
+/* General ioctl() CD-ROM command function */
+static int SDL_SYS_CDioctl(int id, int command, void *arg)
+{
+ int retval;
+
+ retval = ioctl(id, command, arg);
+ if ( retval < 0 ) {
+ SDL_SetError("ioctl() error: %s", strerror(errno));
+ }
+ return(retval);
+}
+
+static const char *SDL_SYS_CDName(int drive)
+{
+ return(SDL_cdlist[drive]);
+}
+
+static int SDL_SYS_CDOpen(int drive)
+{
+ return(open(SDL_cdlist[drive], (O_RDONLY|O_EXCL|O_NONBLOCK), 0));
+}
+
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
+{
+ struct ioc_toc_header toc;
+ int i, okay;
+ struct ioc_read_toc_entry entry;
+ struct cd_toc_entry data;
+
+ okay = 0;
+ if ( SDL_SYS_CDioctl(cdrom->id, CDIOREADTOCHEADER, &toc) == 0 ) {
+ cdrom->numtracks = toc.ending_track-toc.starting_track+1;
+ if ( cdrom->numtracks > SDL_MAX_TRACKS ) {
+ cdrom->numtracks = SDL_MAX_TRACKS;
+ }
+ /* Read all the track TOC entries */
+ for ( i=0; i<=cdrom->numtracks; ++i ) {
+ if ( i == cdrom->numtracks ) {
+ cdrom->track[i].id = 0xAA; /* CDROM_LEADOUT */
+ } else {
+ cdrom->track[i].id = toc.starting_track+i;
+ }
+ entry.starting_track = cdrom->track[i].id;
+ entry.address_format = CD_MSF_FORMAT;
+ entry.data_len = sizeof(data);
+ entry.data = &data;
+ if ( SDL_SYS_CDioctl(cdrom->id, CDIOREADTOCENTRYS,
+ &entry) < 0 ) {
+ break;
+ } else {
+ cdrom->track[i].type = data.control;
+ cdrom->track[i].offset = MSF_TO_FRAMES(
+ data.addr.msf.minute,
+ data.addr.msf.second,
+ data.addr.msf.frame);
+ cdrom->track[i].length = 0;
+ if ( i > 0 ) {
+ cdrom->track[i-1].length =
+ cdrom->track[i].offset-
+ cdrom->track[i-1].offset;
+ }
+ }
+ }
+ if ( i == (cdrom->numtracks+1) ) {
+ okay = 1;
+ }
+ }
+ return(okay ? 0 : -1);
+}
+
+/* Get CD-ROM status */
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
+{
+ CDstatus status;
+ struct ioc_toc_header toc;
+ struct ioc_read_subchannel info;
+ struct cd_sub_channel_info data;
+
+ info.address_format = CD_MSF_FORMAT;
+ info.data_format = CD_CURRENT_POSITION;
+ info.track = 0;
+ info.data_len = sizeof(data);
+ info.data = &data;
+ if ( ioctl(cdrom->id, CDIOCREADSUBCHANNEL, &info) < 0 ) {
+ if ( ERRNO_TRAYEMPTY(errno) ) {
+ status = CD_TRAYEMPTY;
+ } else {
+ status = CD_ERROR;
+ }
+ } else {
+ switch (data.header.audio_status) {
+ case CD_AS_AUDIO_INVALID:
+ case CD_AS_NO_STATUS:
+ /* Try to determine if there's a CD available */
+ if (ioctl(cdrom->id,CDIOREADTOCHEADER,&toc)==0)
+ status = CD_STOPPED;
+ else
+ status = CD_TRAYEMPTY;
+ break;
+ case CD_AS_PLAY_COMPLETED:
+ status = CD_STOPPED;
+ break;
+ case CD_AS_PLAY_IN_PROGRESS:
+ status = CD_PLAYING;
+ break;
+ case CD_AS_PLAY_PAUSED:
+ status = CD_PAUSED;
+ break;
+ default:
+ status = CD_ERROR;
+ break;
+ }
+ }
+ if ( position ) {
+ if ( status == CD_PLAYING || (status == CD_PAUSED) ) {
+ *position = MSF_TO_FRAMES(
+ data.what.position.absaddr.msf.minute,
+ data.what.position.absaddr.msf.second,
+ data.what.position.absaddr.msf.frame);
+ } else {
+ *position = 0;
+ }
+ }
+ return(status);
+}
+
+/* Start play */
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
+{
+ struct ioc_play_msf playtime;
+
+ FRAMES_TO_MSF(start,
+ &playtime.start_m, &playtime.start_s, &playtime.start_f);
+ FRAMES_TO_MSF(start+length,
+ &playtime.end_m, &playtime.end_s, &playtime.end_f);
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Trying to play from %d:%d:%d to %d:%d:%d\n",
+ playtime.cdmsf_min0, playtime.cdmsf_sec0, playtime.cdmsf_frame0,
+ playtime.cdmsf_min1, playtime.cdmsf_sec1, playtime.cdmsf_frame1);
+#endif
+ ioctl(cdrom->id, CDIOCSTART, 0);
+ return(SDL_SYS_CDioctl(cdrom->id, CDIOCPLAYMSF, &playtime));
+}
+
+/* Pause play */
+static int SDL_SYS_CDPause(SDL_CD *cdrom)
+{
+ return(SDL_SYS_CDioctl(cdrom->id, CDIOCPAUSE, 0));
+}
+
+/* Resume play */
+static int SDL_SYS_CDResume(SDL_CD *cdrom)
+{
+ return(SDL_SYS_CDioctl(cdrom->id, CDIOCRESUME, 0));
+}
+
+/* Stop play */
+static int SDL_SYS_CDStop(SDL_CD *cdrom)
+{
+ return(SDL_SYS_CDioctl(cdrom->id, CDIOCSTOP, 0));
+}
+
+/* Eject the CD-ROM */
+static int SDL_SYS_CDEject(SDL_CD *cdrom)
+{
+ return(SDL_SYS_CDioctl(cdrom->id, CDIOCEJECT, 0));
+}
+
+/* Close the CD-ROM handle */
+static void SDL_SYS_CDClose(SDL_CD *cdrom)
+{
+ close(cdrom->id);
+}
+
+void SDL_SYS_CDQuit(void)
+{
+ int i;
+
+ if ( SDL_numcds > 0 ) {
+ for ( i=0; i<SDL_numcds; ++i ) {
+ SDL_free(SDL_cdlist[i]);
+ }
+ SDL_numcds = 0;
+ }
+}
+
+#endif /* SDL_CDROM_FREEBSD */
diff --git a/distrib/sdl-1.2.15/src/cdrom/linux/SDL_syscdrom.c b/distrib/sdl-1.2.15/src/cdrom/linux/SDL_syscdrom.c
new file mode 100644
index 0000000..6804057
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/linux/SDL_syscdrom.c
@@ -0,0 +1,564 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_CDROM_LINUX
+
+/* Functions for system-level CD-ROM audio control */
+
+#include <string.h> /* For strerror() */
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <unistd.h>
+#ifdef __LINUX__
+#ifdef HAVE_LINUX_VERSION_H
+/* linux 2.6.9 workaround */
+#include <linux/version.h>
+#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,9)
+#include <asm/types.h>
+#define __le64 __u64
+#define __le32 __u32
+#define __le16 __u16
+#define __be64 __u64
+#define __be32 __u32
+#define __be16 __u16
+#endif /* linux 2.6.9 workaround */
+#endif /* HAVE_LINUX_VERSION_H */
+#include <linux/cdrom.h>
+#endif
+#ifdef __SVR4
+#include <sys/cdio.h>
+#endif
+
+/* Define this to use the alternative getmntent() code */
+#ifndef __SVR4
+#define USE_MNTENT
+#endif
+
+#ifdef USE_MNTENT
+#if defined(__USLC__)
+#include <sys/mntent.h>
+#else
+#include <mntent.h>
+#endif
+
+#ifndef _PATH_MNTTAB
+#ifdef MNTTAB
+#define _PATH_MNTTAB MNTTAB
+#else
+#define _PATH_MNTTAB "/etc/fstab"
+#endif
+#endif /* !_PATH_MNTTAB */
+
+#ifndef _PATH_MOUNTED
+#define _PATH_MOUNTED "/etc/mtab"
+#endif /* !_PATH_MOUNTED */
+
+#ifndef MNTTYPE_CDROM
+#define MNTTYPE_CDROM "iso9660"
+#endif
+#ifndef MNTTYPE_SUPER
+#define MNTTYPE_SUPER "supermount"
+#endif
+#endif /* USE_MNTENT */
+
+#include "SDL_cdrom.h"
+#include "../SDL_syscdrom.h"
+
+
+/* The maximum number of CD-ROM drives we'll detect */
+#define MAX_DRIVES 16
+
+/* A list of available CD-ROM drives */
+static char *SDL_cdlist[MAX_DRIVES];
+static dev_t SDL_cdmode[MAX_DRIVES];
+
+/* The system-dependent CD control functions */
+static const char *SDL_SYS_CDName(int drive);
+static int SDL_SYS_CDOpen(int drive);
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
+static int SDL_SYS_CDPause(SDL_CD *cdrom);
+static int SDL_SYS_CDResume(SDL_CD *cdrom);
+static int SDL_SYS_CDStop(SDL_CD *cdrom);
+static int SDL_SYS_CDEject(SDL_CD *cdrom);
+static void SDL_SYS_CDClose(SDL_CD *cdrom);
+
+/* Some ioctl() errno values which occur when the tray is empty */
+#ifndef ENOMEDIUM
+#define ENOMEDIUM ENOENT
+#endif
+#define ERRNO_TRAYEMPTY(errno) \
+ ((errno == EIO) || (errno == ENOENT) || \
+ (errno == EINVAL) || (errno == ENOMEDIUM))
+
+/* Check a drive to see if it is a CD-ROM */
+static int CheckDrive(char *drive, char *mnttype, struct stat *stbuf)
+{
+ int is_cd, cdfd;
+ struct cdrom_subchnl info;
+
+ /* If it doesn't exist, return -1 */
+ if ( stat(drive, stbuf) < 0 ) {
+ return(-1);
+ }
+
+ /* If it does exist, verify that it's an available CD-ROM */
+ is_cd = 0;
+ if ( S_ISCHR(stbuf->st_mode) || S_ISBLK(stbuf->st_mode) ) {
+ cdfd = open(drive, (O_RDONLY|O_NONBLOCK), 0);
+ if ( cdfd >= 0 ) {
+ info.cdsc_format = CDROM_MSF;
+ /* Under Linux, EIO occurs when a disk is not present.
+ */
+ if ( (ioctl(cdfd, CDROMSUBCHNL, &info) == 0) ||
+ ERRNO_TRAYEMPTY(errno) ) {
+ is_cd = 1;
+ }
+ close(cdfd);
+ }
+#ifdef USE_MNTENT
+ /* Even if we can't read it, it might be mounted */
+ else if ( mnttype && (SDL_strcmp(mnttype, MNTTYPE_CDROM) == 0) ) {
+ is_cd = 1;
+ }
+#endif
+ }
+ return(is_cd);
+}
+
+/* Add a CD-ROM drive to our list of valid drives */
+static void AddDrive(char *drive, struct stat *stbuf)
+{
+ int i;
+
+ if ( SDL_numcds < MAX_DRIVES ) {
+ /* Check to make sure it's not already in our list.
+ This can happen when we see a drive via symbolic link.
+ */
+ for ( i=0; i<SDL_numcds; ++i ) {
+ if ( stbuf->st_rdev == SDL_cdmode[i] ) {
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Duplicate drive detected: %s == %s\n", drive, SDL_cdlist[i]);
+#endif
+ return;
+ }
+ }
+
+ /* Add this drive to our list */
+ i = SDL_numcds;
+ SDL_cdlist[i] = SDL_strdup(drive);
+ if ( SDL_cdlist[i] == NULL ) {
+ SDL_OutOfMemory();
+ return;
+ }
+ SDL_cdmode[i] = stbuf->st_rdev;
+ ++SDL_numcds;
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Added CD-ROM drive: %s\n", drive);
+#endif
+ }
+}
+
+#ifdef USE_MNTENT
+static void CheckMounts(const char *mtab)
+{
+ FILE *mntfp;
+ struct mntent *mntent;
+ struct stat stbuf;
+
+ mntfp = setmntent(mtab, "r");
+ if ( mntfp != NULL ) {
+ char *tmp;
+ char *mnt_type;
+ size_t mnt_type_len;
+ char *mnt_dev;
+ size_t mnt_dev_len;
+
+ while ( (mntent=getmntent(mntfp)) != NULL ) {
+ mnt_type_len = SDL_strlen(mntent->mnt_type) + 1;
+ mnt_type = SDL_stack_alloc(char, mnt_type_len);
+ if (mnt_type == NULL)
+ continue; /* maybe you'll get lucky next time. */
+
+ mnt_dev_len = SDL_strlen(mntent->mnt_fsname) + 1;
+ mnt_dev = SDL_stack_alloc(char, mnt_dev_len);
+ if (mnt_dev == NULL) {
+ SDL_stack_free(mnt_type);
+ continue;
+ }
+
+ SDL_strlcpy(mnt_type, mntent->mnt_type, mnt_type_len);
+ SDL_strlcpy(mnt_dev, mntent->mnt_fsname, mnt_dev_len);
+
+ /* Handle "supermount" filesystem mounts */
+ if ( SDL_strcmp(mnt_type, MNTTYPE_SUPER) == 0 ) {
+ tmp = SDL_strstr(mntent->mnt_opts, "fs=");
+ if ( tmp ) {
+ SDL_stack_free(mnt_type);
+ mnt_type = SDL_strdup(tmp + SDL_strlen("fs="));
+ if ( mnt_type ) {
+ tmp = SDL_strchr(mnt_type, ',');
+ if ( tmp ) {
+ *tmp = '\0';
+ }
+ }
+ }
+ tmp = SDL_strstr(mntent->mnt_opts, "dev=");
+ if ( tmp ) {
+ SDL_stack_free(mnt_dev);
+ mnt_dev = SDL_strdup(tmp + SDL_strlen("dev="));
+ if ( mnt_dev ) {
+ tmp = SDL_strchr(mnt_dev, ',');
+ if ( tmp ) {
+ *tmp = '\0';
+ }
+ }
+ }
+ }
+ if ( SDL_strcmp(mnt_type, MNTTYPE_CDROM) == 0 ) {
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Checking mount path from %s: %s mounted on %s of %s\n",
+ mtab, mnt_dev, mntent->mnt_dir, mnt_type);
+#endif
+ if (CheckDrive(mnt_dev, mnt_type, &stbuf) > 0) {
+ AddDrive(mnt_dev, &stbuf);
+ }
+ }
+ SDL_stack_free(mnt_dev);
+ SDL_stack_free(mnt_type);
+ }
+ endmntent(mntfp);
+ }
+}
+#endif /* USE_MNTENT */
+
+int SDL_SYS_CDInit(void)
+{
+ /* checklist: /dev/cdrom, /dev/hd?, /dev/scd? /dev/sr? */
+ static char *checklist[] = {
+ "cdrom", "?a hd?", "?0 scd?", "?0 sr?", NULL
+ };
+ char *SDLcdrom;
+ int i, j, exists;
+ char drive[32];
+ struct stat stbuf;
+
+ /* Fill in our driver capabilities */
+ SDL_CDcaps.Name = SDL_SYS_CDName;
+ SDL_CDcaps.Open = SDL_SYS_CDOpen;
+ SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
+ SDL_CDcaps.Status = SDL_SYS_CDStatus;
+ SDL_CDcaps.Play = SDL_SYS_CDPlay;
+ SDL_CDcaps.Pause = SDL_SYS_CDPause;
+ SDL_CDcaps.Resume = SDL_SYS_CDResume;
+ SDL_CDcaps.Stop = SDL_SYS_CDStop;
+ SDL_CDcaps.Eject = SDL_SYS_CDEject;
+ SDL_CDcaps.Close = SDL_SYS_CDClose;
+
+ /* Look in the environment for our CD-ROM drive list */
+ SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */
+ if ( SDLcdrom != NULL ) {
+ char *cdpath, *delim;
+ size_t len = SDL_strlen(SDLcdrom)+1;
+ cdpath = SDL_stack_alloc(char, len);
+ if ( cdpath != NULL ) {
+ SDL_strlcpy(cdpath, SDLcdrom, len);
+ SDLcdrom = cdpath;
+ do {
+ delim = SDL_strchr(SDLcdrom, ':');
+ if ( delim ) {
+ *delim++ = '\0';
+ }
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Checking CD-ROM drive from SDL_CDROM: %s\n", SDLcdrom);
+#endif
+ if ( CheckDrive(SDLcdrom, NULL, &stbuf) > 0 ) {
+ AddDrive(SDLcdrom, &stbuf);
+ }
+ if ( delim ) {
+ SDLcdrom = delim;
+ } else {
+ SDLcdrom = NULL;
+ }
+ } while ( SDLcdrom );
+ SDL_stack_free(cdpath);
+ }
+
+ /* If we found our drives, there's nothing left to do */
+ if ( SDL_numcds > 0 ) {
+ return(0);
+ }
+ }
+
+#ifdef USE_MNTENT
+ /* Check /dev/cdrom first :-) */
+ if (CheckDrive("/dev/cdrom", NULL, &stbuf) > 0) {
+ AddDrive("/dev/cdrom", &stbuf);
+ }
+
+ /* Now check the currently mounted CD drives */
+ CheckMounts(_PATH_MOUNTED);
+
+ /* Finally check possible mountable drives in /etc/fstab */
+ CheckMounts(_PATH_MNTTAB);
+
+ /* If we found our drives, there's nothing left to do */
+ if ( SDL_numcds > 0 ) {
+ return(0);
+ }
+#endif /* USE_MNTENT */
+
+ /* Scan the system for CD-ROM drives.
+ Not always 100% reliable, so use the USE_MNTENT code above first.
+ */
+ for ( i=0; checklist[i]; ++i ) {
+ if ( checklist[i][0] == '?' ) {
+ char *insert;
+ exists = 1;
+ for ( j=checklist[i][1]; exists; ++j ) {
+ SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", &checklist[i][3]);
+ insert = SDL_strchr(drive, '?');
+ if ( insert != NULL ) {
+ *insert = j;
+ }
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Checking possible CD-ROM drive: %s\n", drive);
+#endif
+ switch (CheckDrive(drive, NULL, &stbuf)) {
+ /* Drive exists and is a CD-ROM */
+ case 1:
+ AddDrive(drive, &stbuf);
+ break;
+ /* Drive exists, but isn't a CD-ROM */
+ case 0:
+ break;
+ /* Drive doesn't exist */
+ case -1:
+ exists = 0;
+ break;
+ }
+ }
+ } else {
+ SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]);
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Checking possible CD-ROM drive: %s\n", drive);
+#endif
+ if ( CheckDrive(drive, NULL, &stbuf) > 0 ) {
+ AddDrive(drive, &stbuf);
+ }
+ }
+ }
+ return(0);
+}
+
+/* General ioctl() CD-ROM command function */
+static int SDL_SYS_CDioctl(int id, int command, void *arg)
+{
+ int retval;
+
+ retval = ioctl(id, command, arg);
+ if ( retval < 0 ) {
+ SDL_SetError("ioctl() error: %s", strerror(errno));
+ }
+ return(retval);
+}
+
+static const char *SDL_SYS_CDName(int drive)
+{
+ return(SDL_cdlist[drive]);
+}
+
+static int SDL_SYS_CDOpen(int drive)
+{
+ return(open(SDL_cdlist[drive], (O_RDONLY|O_NONBLOCK), 0));
+}
+
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
+{
+ struct cdrom_tochdr toc;
+ int i, okay;
+ struct cdrom_tocentry entry;
+
+ okay = 0;
+ if ( SDL_SYS_CDioctl(cdrom->id, CDROMREADTOCHDR, &toc) == 0 ) {
+ cdrom->numtracks = toc.cdth_trk1-toc.cdth_trk0+1;
+ if ( cdrom->numtracks > SDL_MAX_TRACKS ) {
+ cdrom->numtracks = SDL_MAX_TRACKS;
+ }
+ /* Read all the track TOC entries */
+ for ( i=0; i<=cdrom->numtracks; ++i ) {
+ if ( i == cdrom->numtracks ) {
+ cdrom->track[i].id = CDROM_LEADOUT;
+ } else {
+ cdrom->track[i].id = toc.cdth_trk0+i;
+ }
+ entry.cdte_track = cdrom->track[i].id;
+ entry.cdte_format = CDROM_MSF;
+ if ( SDL_SYS_CDioctl(cdrom->id, CDROMREADTOCENTRY,
+ &entry) < 0 ) {
+ break;
+ } else {
+ if ( entry.cdte_ctrl & CDROM_DATA_TRACK ) {
+ cdrom->track[i].type = SDL_DATA_TRACK;
+ } else {
+ cdrom->track[i].type = SDL_AUDIO_TRACK;
+ }
+ cdrom->track[i].offset = MSF_TO_FRAMES(
+ entry.cdte_addr.msf.minute,
+ entry.cdte_addr.msf.second,
+ entry.cdte_addr.msf.frame);
+ cdrom->track[i].length = 0;
+ if ( i > 0 ) {
+ cdrom->track[i-1].length =
+ cdrom->track[i].offset-
+ cdrom->track[i-1].offset;
+ }
+ }
+ }
+ if ( i == (cdrom->numtracks+1) ) {
+ okay = 1;
+ }
+ }
+ return(okay ? 0 : -1);
+}
+
+/* Get CD-ROM status */
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
+{
+ CDstatus status;
+ struct cdrom_tochdr toc;
+ struct cdrom_subchnl info;
+
+ info.cdsc_format = CDROM_MSF;
+ if ( ioctl(cdrom->id, CDROMSUBCHNL, &info) < 0 ) {
+ if ( ERRNO_TRAYEMPTY(errno) ) {
+ status = CD_TRAYEMPTY;
+ } else {
+ status = CD_ERROR;
+ }
+ } else {
+ switch (info.cdsc_audiostatus) {
+ case CDROM_AUDIO_INVALID:
+ case CDROM_AUDIO_NO_STATUS:
+ /* Try to determine if there's a CD available */
+ if (ioctl(cdrom->id, CDROMREADTOCHDR, &toc)==0)
+ status = CD_STOPPED;
+ else
+ status = CD_TRAYEMPTY;
+ break;
+ case CDROM_AUDIO_COMPLETED:
+ status = CD_STOPPED;
+ break;
+ case CDROM_AUDIO_PLAY:
+ status = CD_PLAYING;
+ break;
+ case CDROM_AUDIO_PAUSED:
+ /* Workaround buggy CD-ROM drive */
+ if ( info.cdsc_trk == CDROM_LEADOUT ) {
+ status = CD_STOPPED;
+ } else {
+ status = CD_PAUSED;
+ }
+ break;
+ default:
+ status = CD_ERROR;
+ break;
+ }
+ }
+ if ( position ) {
+ if ( status == CD_PLAYING || (status == CD_PAUSED) ) {
+ *position = MSF_TO_FRAMES(
+ info.cdsc_absaddr.msf.minute,
+ info.cdsc_absaddr.msf.second,
+ info.cdsc_absaddr.msf.frame);
+ } else {
+ *position = 0;
+ }
+ }
+ return(status);
+}
+
+/* Start play */
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
+{
+ struct cdrom_msf playtime;
+
+ FRAMES_TO_MSF(start,
+ &playtime.cdmsf_min0, &playtime.cdmsf_sec0, &playtime.cdmsf_frame0);
+ FRAMES_TO_MSF(start+length,
+ &playtime.cdmsf_min1, &playtime.cdmsf_sec1, &playtime.cdmsf_frame1);
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Trying to play from %d:%d:%d to %d:%d:%d\n",
+ playtime.cdmsf_min0, playtime.cdmsf_sec0, playtime.cdmsf_frame0,
+ playtime.cdmsf_min1, playtime.cdmsf_sec1, playtime.cdmsf_frame1);
+#endif
+ return(SDL_SYS_CDioctl(cdrom->id, CDROMPLAYMSF, &playtime));
+}
+
+/* Pause play */
+static int SDL_SYS_CDPause(SDL_CD *cdrom)
+{
+ return(SDL_SYS_CDioctl(cdrom->id, CDROMPAUSE, 0));
+}
+
+/* Resume play */
+static int SDL_SYS_CDResume(SDL_CD *cdrom)
+{
+ return(SDL_SYS_CDioctl(cdrom->id, CDROMRESUME, 0));
+}
+
+/* Stop play */
+static int SDL_SYS_CDStop(SDL_CD *cdrom)
+{
+ return(SDL_SYS_CDioctl(cdrom->id, CDROMSTOP, 0));
+}
+
+/* Eject the CD-ROM */
+static int SDL_SYS_CDEject(SDL_CD *cdrom)
+{
+ return(SDL_SYS_CDioctl(cdrom->id, CDROMEJECT, 0));
+}
+
+/* Close the CD-ROM handle */
+static void SDL_SYS_CDClose(SDL_CD *cdrom)
+{
+ close(cdrom->id);
+}
+
+void SDL_SYS_CDQuit(void)
+{
+ int i;
+
+ if ( SDL_numcds > 0 ) {
+ for ( i=0; i<SDL_numcds; ++i ) {
+ SDL_free(SDL_cdlist[i]);
+ }
+ SDL_numcds = 0;
+ }
+}
+
+#endif /* SDL_CDROM_LINUX */
diff --git a/distrib/sdl-1.2.15/src/cdrom/macos/SDL_syscdrom.c b/distrib/sdl-1.2.15/src/cdrom/macos/SDL_syscdrom.c
new file mode 100644
index 0000000..10a2025
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/macos/SDL_syscdrom.c
@@ -0,0 +1,525 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_CDROM_MACOS
+
+/* MacOS functions for system-level CD-ROM audio control */
+
+#include <Devices.h>
+#include <Files.h>
+#include <LowMem.h> /* Use entry table macros, not functions in InterfaceLib */
+
+#include "SDL_cdrom.h"
+#include "../SDL_syscdrom.h"
+#include "SDL_syscdrom_c.h"
+
+/* Added by Matt Slot */
+#if !defined(LMGetUnitTableEntryCount)
+ #define LMGetUnitTableEntryCount() *(short *)0x01D2
+#endif
+
+/* The maximum number of CD-ROM drives we'll detect */
+#define MAX_DRIVES 26
+
+/* A list of available CD-ROM drives */
+static long SDL_cdversion = 0;
+static struct {
+ short dRefNum;
+ short driveNum;
+ long frames;
+ char name[256];
+ Boolean hasAudio;
+ } SDL_cdlist[MAX_DRIVES];
+static StringPtr gDriverName = "\p.AppleCD";
+
+/* The system-dependent CD control functions */
+static const char *SDL_SYS_CDName(int drive);
+static int SDL_SYS_CDOpen(int drive);
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
+static int SDL_SYS_CDPause(SDL_CD *cdrom);
+static int SDL_SYS_CDResume(SDL_CD *cdrom);
+static int SDL_SYS_CDStop(SDL_CD *cdrom);
+static int SDL_SYS_CDEject(SDL_CD *cdrom);
+static void SDL_SYS_CDClose(SDL_CD *cdrom);
+
+static short SDL_SYS_ShortToBCD(short value)
+{
+ return((value % 10) + (value / 10) * 0x10); /* Convert value to BCD */
+}
+
+static short SDL_SYS_BCDToShort(short value)
+{
+ return((value % 0x10) + (value / 0x10) * 10); /* Convert value from BCD */
+}
+
+int SDL_SYS_CDInit(void)
+{
+ SInt16 dRefNum = 0;
+ SInt16 first, last;
+
+ SDL_numcds = 0;
+
+ /* Check that the software is available */
+ if (Gestalt(kGestaltAudioCDSelector, &SDL_cdversion) ||
+ !SDL_cdversion) return(0);
+
+ /* Fill in our driver capabilities */
+ SDL_CDcaps.Name = SDL_SYS_CDName;
+ SDL_CDcaps.Open = SDL_SYS_CDOpen;
+ SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
+ SDL_CDcaps.Status = SDL_SYS_CDStatus;
+ SDL_CDcaps.Play = SDL_SYS_CDPlay;
+ SDL_CDcaps.Pause = SDL_SYS_CDPause;
+ SDL_CDcaps.Resume = SDL_SYS_CDResume;
+ SDL_CDcaps.Stop = SDL_SYS_CDStop;
+ SDL_CDcaps.Eject = SDL_SYS_CDEject;
+ SDL_CDcaps.Close = SDL_SYS_CDClose;
+
+ /* Walk the list, count each AudioCD driver, and save the refnums */
+ first = -1;
+ last = 0 - LMGetUnitTableEntryCount();
+ for(dRefNum = first; dRefNum >= last; dRefNum--) {
+ Str255 driverName;
+ StringPtr namePtr;
+ DCtlHandle deviceEntry;
+
+ deviceEntry = GetDCtlEntry(dRefNum);
+ if (! deviceEntry) continue;
+
+ /* Is this an .AppleCD ? */
+ namePtr = (*deviceEntry)->dCtlFlags & (1L << dRAMBased) ?
+ ((StringPtr) ((DCtlPtr) deviceEntry)->dCtlDriver + 18) :
+ ((StringPtr) (*deviceEntry)->dCtlDriver + 18);
+ BlockMoveData(namePtr, driverName, namePtr[0]+1);
+ if (driverName[0] > gDriverName[0]) driverName[0] = gDriverName[0];
+ if (! EqualString(driverName, gDriverName, false, false)) continue;
+
+ /* Record the basic info for each drive */
+ SDL_cdlist[SDL_numcds].dRefNum = dRefNum;
+ BlockMoveData(namePtr + 1, SDL_cdlist[SDL_numcds].name, namePtr[0]);
+ SDL_cdlist[SDL_numcds].name[namePtr[0]] = 0;
+ SDL_cdlist[SDL_numcds].hasAudio = false;
+ SDL_numcds++;
+ }
+ return(0);
+}
+
+static const char *SDL_SYS_CDName(int drive)
+{
+ return(SDL_cdlist[drive].name);
+}
+
+static int get_drivenum(int drive)
+{
+ QHdr *driveQ = GetDrvQHdr();
+ DrvQEl *driveElem;
+
+ /* Update the drive number */
+ SDL_cdlist[drive].driveNum = 0;
+ if ( driveQ->qTail ) {
+ driveQ->qTail->qLink = 0;
+ }
+ for ( driveElem=(DrvQEl *)driveQ->qHead; driveElem;
+ driveElem = (DrvQEl *)driveElem->qLink ) {
+ if ( driveElem->dQRefNum == SDL_cdlist[drive].dRefNum ) {
+ SDL_cdlist[drive].driveNum = driveElem->dQDrive;
+ break;
+ }
+ }
+ return(SDL_cdlist[drive].driveNum);
+}
+
+static int SDL_SYS_CDOpen(int drive)
+{
+ return(drive);
+}
+
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
+{
+ CDCntrlParam cdpb;
+ CDTrackData tracks[SDL_MAX_TRACKS];
+ long i, leadout;
+
+ /* Get the number of tracks on the CD by examining the TOC */
+ SDL_memset(&cdpb, 0, sizeof(cdpb));
+ cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
+ cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
+ cdpb.csCode = kReadTOC;
+ cdpb.csParam.words[0] = kGetTrackRange;
+ if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
+ SDL_SetError("PBControlSync() failed");
+ return(-1);
+ }
+
+ cdrom->numtracks =
+ SDL_SYS_BCDToShort(cdpb.csParam.bytes[1]) -
+ SDL_SYS_BCDToShort(cdpb.csParam.bytes[0]) + 1;
+ if ( cdrom->numtracks > SDL_MAX_TRACKS )
+ cdrom->numtracks = SDL_MAX_TRACKS;
+ cdrom->status = CD_STOPPED;
+ cdrom->cur_track = 0; /* Apparently these are set elsewhere */
+ cdrom->cur_frame = 0; /* Apparently these are set elsewhere */
+
+
+ /* Get the lead out area of the CD by examining the TOC */
+ SDL_memset(&cdpb, 0, sizeof(cdpb));
+ cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
+ cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
+ cdpb.csCode = kReadTOC;
+ cdpb.csParam.words[0] = kGetLeadOutArea;
+ if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
+ SDL_SetError("PBControlSync() failed");
+ return(-1);
+ }
+
+ leadout = MSF_TO_FRAMES(
+ SDL_SYS_BCDToShort(cdpb.csParam.bytes[0]),
+ SDL_SYS_BCDToShort(cdpb.csParam.bytes[1]),
+ SDL_SYS_BCDToShort(cdpb.csParam.bytes[2]));
+
+ /* Get an array of track locations by examining the TOC */
+ SDL_memset(tracks, 0, sizeof(tracks));
+ SDL_memset(&cdpb, 0, sizeof(cdpb));
+ cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
+ cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
+ cdpb.csCode = kReadTOC;
+ cdpb.csParam.words[0] = kGetTrackEntries; /* Type of Query */
+ * ((long *) (cdpb.csParam.words+1)) = (long) tracks;
+ cdpb.csParam.words[3] = cdrom->numtracks * sizeof(tracks[0]);
+ * ((char *) (cdpb.csParam.words+4)) = 1; /* First track */
+ if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
+ SDL_SetError("PBControlSync() failed");
+ return(-1);
+ }
+
+ /* Read all the track TOC entries */
+ SDL_cdlist[cdrom->id].hasAudio = false;
+ for ( i=0; i<cdrom->numtracks; ++i )
+ {
+ cdrom->track[i].id = i+1;
+ if (tracks[i].entry.control & kDataTrackMask)
+ cdrom->track[i].type = SDL_DATA_TRACK;
+ else
+ {
+ cdrom->track[i].type = SDL_AUDIO_TRACK;
+ SDL_cdlist[SDL_numcds].hasAudio = true;
+ }
+
+ cdrom->track[i].offset = MSF_TO_FRAMES(
+ SDL_SYS_BCDToShort(tracks[i].entry.min),
+ SDL_SYS_BCDToShort(tracks[i].entry.min),
+ SDL_SYS_BCDToShort(tracks[i].entry.frame));
+ cdrom->track[i].length = MSF_TO_FRAMES(
+ SDL_SYS_BCDToShort(tracks[i+1].entry.min),
+ SDL_SYS_BCDToShort(tracks[i+1].entry.min),
+ SDL_SYS_BCDToShort(tracks[i+1].entry.frame)) -
+ cdrom->track[i].offset;
+ }
+
+ /* Apparently SDL wants a fake last entry */
+ cdrom->track[i].offset = leadout;
+ cdrom->track[i].length = 0;
+
+ return(0);
+}
+
+/* Get CD-ROM status */
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
+{
+ CDCntrlParam cdpb;
+ CDstatus status = CD_ERROR;
+ Boolean spinning = false;
+
+ if (position) *position = 0;
+
+ /* Get the number of tracks on the CD by examining the TOC */
+ if ( ! get_drivenum(cdrom->id) ) {
+ return(CD_TRAYEMPTY);
+ }
+ SDL_memset(&cdpb, 0, sizeof(cdpb));
+ cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
+ cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
+ cdpb.csCode = kReadTOC;
+ cdpb.csParam.words[0] = kGetTrackRange;
+ if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
+ SDL_SetError("PBControlSync() failed");
+ return(CD_ERROR);
+ }
+
+ cdrom->numtracks =
+ SDL_SYS_BCDToShort(cdpb.csParam.bytes[1]) -
+ SDL_SYS_BCDToShort(cdpb.csParam.bytes[0]) + 1;
+ if ( cdrom->numtracks > SDL_MAX_TRACKS )
+ cdrom->numtracks = SDL_MAX_TRACKS;
+ cdrom->cur_track = 0; /* Apparently these are set elsewhere */
+ cdrom->cur_frame = 0; /* Apparently these are set elsewhere */
+
+
+ if (1 || SDL_cdlist[cdrom->id].hasAudio) {
+ /* Get the current playback status */
+ SDL_memset(&cdpb, 0, sizeof(cdpb));
+ cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
+ cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
+ cdpb.csCode = kAudioStatus;
+ if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
+ SDL_SetError("PBControlSync() failed");
+ return(-1);
+ }
+
+ switch(cdpb.csParam.cd.status) {
+ case kStatusPlaying:
+ status = CD_PLAYING;
+ spinning = true;
+ break;
+ case kStatusPaused:
+ status = CD_PAUSED;
+ spinning = true;
+ break;
+ case kStatusMuted:
+ status = CD_PLAYING; /* What should I do here? */
+ spinning = true;
+ break;
+ case kStatusDone:
+ status = CD_STOPPED;
+ spinning = true;
+ break;
+ case kStatusStopped:
+ status = CD_STOPPED;
+ spinning = false;
+ break;
+ case kStatusError:
+ default:
+ status = CD_ERROR;
+ spinning = false;
+ break;
+ }
+
+ if (spinning && position) *position = MSF_TO_FRAMES(
+ SDL_SYS_BCDToShort(cdpb.csParam.cd.minute),
+ SDL_SYS_BCDToShort(cdpb.csParam.cd.second),
+ SDL_SYS_BCDToShort(cdpb.csParam.cd.frame));
+ }
+ else
+ status = CD_ERROR; /* What should I do here? */
+
+ return(status);
+}
+
+/* Start play */
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
+{
+ CDCntrlParam cdpb;
+
+ /* Pause the current audio playback to avoid audible artifacts */
+ if ( SDL_SYS_CDPause(cdrom) < 0 ) {
+ return(-1);
+ }
+
+ /* Specify the AudioCD playback mode */
+ SDL_memset(&cdpb, 0, sizeof(cdpb));
+ cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
+ cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
+ cdpb.csCode = kSetPlayMode;
+ cdpb.csParam.bytes[0] = false; /* Repeat? */
+ cdpb.csParam.bytes[1] = kPlayModeSequential; /* Play mode */
+ /* ¥¥¥ÊTreat as soft error, NEC Drive doesnt support this call ¥¥¥ */
+ PBControlSync((ParmBlkPtr) &cdpb);
+
+#if 1
+ /* Specify the end of audio playback */
+ SDL_memset(&cdpb, 0, sizeof(cdpb));
+ cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
+ cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
+ cdpb.csCode = kAudioStop;
+ cdpb.csParam.words[0] = kBlockPosition; /* Position Mode */
+ *(long *) (cdpb.csParam.words + 1) = start+length-1; /* Search Address */
+ if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
+ SDL_SetError("PBControlSync() failed");
+ return(-1);
+ }
+
+ /* Specify the start of audio playback, and start it */
+ SDL_memset(&cdpb, 0, sizeof(cdpb));
+ cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
+ cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
+ cdpb.csCode = kAudioPlay;
+ cdpb.csParam.words[0] = kBlockPosition; /* Position Mode */
+ *(long *) (cdpb.csParam.words + 1) = start+1; /* Search Address */
+ cdpb.csParam.words[3] = false; /* Stop address? */
+ cdpb.csParam.words[4] = kStereoPlayMode; /* Audio Play Mode */
+ if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
+ SDL_SetError("PBControlSync() failed");
+ return(-1);
+ }
+#else
+ /* Specify the end of audio playback */
+ FRAMES_TO_MSF(start+length, &m, &s, &f);
+ SDL_memset(&cdpb, 0, sizeof(cdpb));
+ cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
+ cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
+ cdpb.csCode = kAudioStop;
+ cdpb.csParam.words[0] = kTrackPosition; /* Position Mode */
+ cdpb.csParam.words[1] = 0; /* Search Address (hiword)*/
+ cdpb.csParam.words[2] = /* Search Address (loword)*/
+ SDL_SYS_ShortToBCD(cdrom->numtracks);
+ if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
+ SDL_SetError("PBControlSync() failed");
+ return(-1);
+ }
+
+ /* Specify the start of audio playback, and start it */
+ FRAMES_TO_MSF(start, &m, &s, &f);
+ SDL_memset(&cdpb, 0, sizeof(cdpb));
+ cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
+ cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
+ cdpb.csCode = kAudioPlay;
+ cdpb.csParam.words[0] = kTrackPosition; /* Position Mode */
+ cdpb.csParam.words[1] = 0; /* Search Address (hiword)*/
+ cdpb.csParam.words[2] = SDL_SYS_ShortToBCD(1); /* Search Address (loword)*/
+ cdpb.csParam.words[3] = false; /* Stop address? */
+ cdpb.csParam.words[4] = kStereoPlayMode; /* Audio Play Mode */
+ if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
+ SDL_SetError("PBControlSync() failed");
+ return(-1);
+ }
+#endif
+
+ return(0);
+}
+
+/* Pause play */
+static int SDL_SYS_CDPause(SDL_CD *cdrom)
+{
+ CDCntrlParam cdpb;
+
+ SDL_memset(&cdpb, 0, sizeof(cdpb));
+ cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
+ cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
+ cdpb.csCode = kAudioPause;
+ cdpb.csParam.words[0] = 0; /* Pause/Continue Flag (hiword) */
+ cdpb.csParam.words[1] = 1; /* Pause/Continue Flag (loword) */
+ if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
+ SDL_SetError("PBControlSync() failed");
+ return(-1);
+ }
+ return(0);
+}
+
+/* Resume play */
+static int SDL_SYS_CDResume(SDL_CD *cdrom)
+{
+ CDCntrlParam cdpb;
+
+ SDL_memset(&cdpb, 0, sizeof(cdpb));
+ cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
+ cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
+ cdpb.csCode = kAudioPause;
+ cdpb.csParam.words[0] = 0; /* Pause/Continue Flag (hiword) */
+ cdpb.csParam.words[1] = 0; /* Pause/Continue Flag (loword) */
+ if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
+ SDL_SetError("PBControlSync() failed");
+ return(-1);
+ }
+ return(0);
+}
+
+/* Stop play */
+static int SDL_SYS_CDStop(SDL_CD *cdrom)
+{
+ CDCntrlParam cdpb;
+
+ SDL_memset(&cdpb, 0, sizeof(cdpb));
+ cdpb.ioVRefNum = SDL_cdlist[cdrom->id].driveNum;
+ cdpb.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
+ cdpb.csCode = kAudioStop;
+ cdpb.csParam.words[0] = 0; /* Position Mode */
+ cdpb.csParam.words[1] = 0; /* Search Address (hiword) */
+ cdpb.csParam.words[2] = 0; /* Search Address (loword) */
+ if ( PBControlSync((ParmBlkPtr)&cdpb) != noErr ) {
+ SDL_SetError("PBControlSync() failed");
+ return(-1);
+ }
+ return(0);
+}
+
+/* Eject the CD-ROM */
+static int SDL_SYS_CDEject(SDL_CD *cdrom)
+{
+ Boolean disk = false;
+ QHdr *driveQ = GetDrvQHdr();
+ DrvQEl *driveElem;
+ HParamBlockRec hpb;
+ ParamBlockRec cpb;
+
+ for ( driveElem = (DrvQEl *) driveQ->qHead; driveElem; driveElem =
+ (driveElem) ? ((DrvQEl *) driveElem->qLink) :
+ ((DrvQEl *) driveQ->qHead) ) {
+ if ( driveQ->qTail ) {
+ driveQ->qTail->qLink = 0;
+ }
+ if ( driveElem->dQRefNum != SDL_cdlist[cdrom->id].dRefNum ) {
+ continue;
+ }
+
+ /* Does drive contain mounted volume? If not, skip */
+ SDL_memset(&hpb, 0, sizeof(hpb));
+ hpb.volumeParam.ioVRefNum = driveElem->dQDrive;
+ if ( PBHGetVInfoSync(&hpb) != noErr ) {
+ continue;
+ }
+ if ( (UnmountVol(0, driveElem->dQDrive) == noErr) &&
+ (Eject(0, driveElem->dQDrive) == noErr) ) {
+ driveElem = 0; /* Clear pointer to reset our loop */
+ disk = true;
+ }
+ }
+
+ /* If no disk is present, just eject the tray */
+ if (! disk) {
+ SDL_memset(&cpb, 0, sizeof(cpb));
+ cpb.cntrlParam.ioVRefNum = 0; /* No Drive */
+ cpb.cntrlParam.ioCRefNum = SDL_cdlist[cdrom->id].dRefNum;
+ cpb.cntrlParam.csCode = kEjectTheDisc;
+ if ( PBControlSync((ParmBlkPtr)&cpb) != noErr ) {
+ SDL_SetError("PBControlSync() failed");
+ return(-1);
+ }
+ }
+ return(0);
+}
+
+/* Close the CD-ROM handle */
+static void SDL_SYS_CDClose(SDL_CD *cdrom)
+{
+ return;
+}
+
+void SDL_SYS_CDQuit(void)
+{
+ while(SDL_numcds--)
+ SDL_memset(SDL_cdlist + SDL_numcds, 0, sizeof(SDL_cdlist[0]));
+}
+
+#endif /* SDL_CDROM_MACOS */
diff --git a/distrib/sdl-1.2.15/src/cdrom/macos/SDL_syscdrom_c.h b/distrib/sdl-1.2.15/src/cdrom/macos/SDL_syscdrom_c.h
new file mode 100644
index 0000000..e715a25
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/macos/SDL_syscdrom_c.h
@@ -0,0 +1,140 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This is the MacOS specific header for the SDL CD-ROM API
+ Contributed by Matt Slot
+ */
+
+/* AppleCD Control calls */
+#define kVerifyTheDisc 5 /* Returns noErr if there is disc inserted */
+#define kEjectTheDisc 7 /* Eject disc from drive */
+#define kUserEject 80 /* Enable/disable the CD-ROM eject button */
+#define kReadTOC 100 /* Extract various TOC information from the disc */
+#define kReadQ 101 /* Extract Q subcode info for the current track */
+#define kAudioTrackSearch 103 /* Start playback from the indicated position */
+#define kAudioPlay 104 /* Start playback from the indicated position */
+#define kAudioPause 105 /* Pause/continue the playback */
+#define kAudioStop 106 /* Stop playback at the indicated position */
+#define kAudioStatus 107 /* Return audio play status */
+#define kAudioControl 109 /* Set the output volume for the audio channels */
+#define kReadAudioVolume 112 /* Get the output volume for the audio channels */
+#define kSetTrackList 122 /* Set the track program for the audio CD to play */
+#define kGetTrackList 123 /* Get the track program the audio CD is playing */
+#define kGetTrackIndex 124 /* Get the track index the audio CD is playing */
+#define kSetPlayMode 125 /* Set the audio tracks play mode */
+#define kGetPlayMode 126 /* Get the audio tracks play mode */
+
+/* AppleCD Status calls */
+#define kGetDriveType 96 /* Get the type of the physical CD-ROM drive */
+#define kWhoIsThere 97 /* Get a bitmap of SCSI IDs the driver controls */
+#define kGetBlockSize 98 /* Get current block size of the CD-ROM drive */
+
+/* AppleCD other constants */
+#define kBlockPosition 0 /* Position at the specified logical block number */
+#define kAbsMSFPosition 1 /* Position at the specified Min/Sec/Frame (in BCD) */
+#define kTrackPosition 2 /* Position at the specified track number (in BCD) */
+#define kIndexPosition 3 /* Position at the nth track in program (in BCD) */
+
+#define kMutedPlayMode 0 /* Play the audio track with no output */
+#define kStereoPlayMode 9 /* Play the audio track in normal stereo */
+
+#define kControlFieldMask 0x0D /* Bits 3,2,0 in the nibble */
+#define kDataTrackMask 0x04 /* Indicates Data Track */
+
+#define kGetTrackRange 1 /* Query TOC for track numbers */
+#define kGetLeadOutArea 2 /* Query TOC for "Lead Out" end of audio data */
+#define kGetTrackEntries 3 /* Query TOC for track starts and data types */
+
+#define kStatusPlaying 0 /* Audio Play operation in progress */
+#define kStatusPaused 1 /* CD-ROM device in Hold Track ("Pause") state */
+#define kStatusMuted 2 /* MUTING-ON operation in progress */
+#define kStatusDone 3 /* Audio Play completed */
+#define kStatusError 4 /* Error occurred during audio play operation */
+#define kStatusStopped 5 /* Audio play operation not requested */
+
+#define kPlayModeSequential 0 /* Play tracks in order */
+#define kPlayModeShuffled 1 /* Play tracks randomly */
+#define kPlayModeProgrammed 2 /* Use custom playlist */
+
+/* AppleCD Gestalt selectors */
+#define kGestaltAudioCDSelector 'aucd'
+#define kDriverVersion52 0x00000520
+#define kDriverVersion51 0x00000510
+#define kDriverVersion50 0x00000500
+
+/* Drive type constants */
+#define kDriveAppleCD_SC 1
+#define kDriveAppleCD_SCPlus_or_150 2
+#define kDriveAppleCD_300_or_300Plus 3
+
+/* Misc constants */
+#define kFirstSCSIDevice -33
+#define kLastSCSIDevice -40
+
+#if PRAGMA_STRUCT_ALIGN
+ #pragma options align=mac68k
+#endif
+
+/* AppleCD driver parameter block */
+typedef struct CDCntrlParam {
+ QElemPtr qLink;
+ short qType;
+ short ioTrap;
+ Ptr ioCmdAddr;
+ IOCompletionUPP ioCompletion;
+ OSErr ioResult;
+ StringPtr ioNamePtr;
+ short ioVRefNum;
+ short ioCRefNum;
+ short csCode;
+
+ union {
+ long longs[6];
+ short words[11];
+ unsigned char bytes[22];
+ struct {
+ unsigned char status;
+ unsigned char play;
+ unsigned char control;
+ unsigned char minute;
+ unsigned char second;
+ unsigned char frame;
+ } cd;
+ } csParam;
+
+ } CDCntrlParam, *CDCntrlParamPtr;
+
+typedef union CDTrackData {
+ long value; /* Treat as a longword value */
+ struct {
+ unsigned char reserved : 4; /* Unused by AppleCD driver */
+ unsigned char control : 4; /* Track flags (data track?) */
+ unsigned char min; /* Start of track (BCD) */
+ unsigned char sec; /* Start of track (BCD) */
+ unsigned char frame; /* Start of track (BCD) */
+ } entry; /* Broken into fields */
+ } CDTrackData, *CDTrackPtr;
+
+#if PRAGMA_STRUCT_ALIGN
+ #pragma options align=reset
+#endif
diff --git a/distrib/sdl-1.2.15/src/cdrom/macosx/AudioFilePlayer.c b/distrib/sdl-1.2.15/src/cdrom/macosx/AudioFilePlayer.c
new file mode 100644
index 0000000..97cb9b2
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/macosx/AudioFilePlayer.c
@@ -0,0 +1,360 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ This file based on Apple sample code. We haven't changed the file name,
+ so if you want to see the original search for it on apple.com/developer
+*/
+#include "SDL_config.h"
+#include "SDL_endian.h"
+
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ AudioFilePlayer.cpp
+*/
+#include "AudioFilePlayer.h"
+
+/*
+void ThrowResult (OSStatus result, const char* str)
+{
+ SDL_SetError ("Error: %s %d", str, result);
+ throw result;
+}
+*/
+
+#if DEBUG
+static void PrintStreamDesc (AudioStreamBasicDescription *inDesc)
+{
+ if (!inDesc) {
+ printf ("Can't print a NULL desc!\n");
+ return;
+ }
+
+ printf ("- - - - - - - - - - - - - - - - - - - -\n");
+ printf (" Sample Rate:%f\n", inDesc->mSampleRate);
+ printf (" Format ID:%s\n", (char*)&inDesc->mFormatID);
+ printf (" Format Flags:%lX\n", inDesc->mFormatFlags);
+ printf (" Bytes per Packet:%ld\n", inDesc->mBytesPerPacket);
+ printf (" Frames per Packet:%ld\n", inDesc->mFramesPerPacket);
+ printf (" Bytes per Frame:%ld\n", inDesc->mBytesPerFrame);
+ printf (" Channels per Frame:%ld\n", inDesc->mChannelsPerFrame);
+ printf (" Bits per Channel:%ld\n", inDesc->mBitsPerChannel);
+ printf ("- - - - - - - - - - - - - - - - - - - -\n");
+}
+#endif
+
+
+static int AudioFilePlayer_SetDestination (AudioFilePlayer *afp, AudioUnit *inDestUnit)
+{
+ /*if (afp->mConnected) throw static_cast<OSStatus>(-1);*/ /* can't set dest if already engaged */
+ if (afp->mConnected)
+ return 0 ;
+
+ SDL_memcpy(&afp->mPlayUnit, inDestUnit, sizeof (afp->mPlayUnit));
+
+ OSStatus result = noErr;
+
+
+ /* we can "down" cast a component instance to a component */
+ ComponentDescription desc;
+ result = GetComponentInfo ((Component)*inDestUnit, &desc, 0, 0, 0);
+ if (result) return 0; /*THROW_RESULT("GetComponentInfo")*/
+
+ /* we're going to use this to know which convert routine to call
+ a v1 audio unit will have a type of 'aunt'
+ a v2 audio unit will have one of several different types. */
+ if (desc.componentType != kAudioUnitType_Output) {
+ result = badComponentInstance;
+ /*THROW_RESULT("BAD COMPONENT")*/
+ if (result) return 0;
+ }
+
+ /* Set the input format of the audio unit. */
+ result = AudioUnitSetProperty (*inDestUnit,
+ kAudioUnitProperty_StreamFormat,
+ kAudioUnitScope_Input,
+ 0,
+ &afp->mFileDescription,
+ sizeof (afp->mFileDescription));
+ /*THROW_RESULT("AudioUnitSetProperty")*/
+ if (result) return 0;
+ return 1;
+}
+
+static void AudioFilePlayer_SetNotifier(AudioFilePlayer *afp, AudioFilePlayNotifier inNotifier, void *inRefCon)
+{
+ afp->mNotifier = inNotifier;
+ afp->mRefCon = inRefCon;
+}
+
+static int AudioFilePlayer_IsConnected(AudioFilePlayer *afp)
+{
+ return afp->mConnected;
+}
+
+static AudioUnit AudioFilePlayer_GetDestUnit(AudioFilePlayer *afp)
+{
+ return afp->mPlayUnit;
+}
+
+static void AudioFilePlayer_Print(AudioFilePlayer *afp)
+{
+#if DEBUG
+ printf ("Is Connected:%s\n", (IsConnected() ? "true" : "false"));
+ printf ("- - - - - - - - - - - - - - \n");
+#endif
+}
+
+static void AudioFilePlayer_SetStartFrame (AudioFilePlayer *afp, int frame)
+{
+ SInt64 position = frame * 2352;
+
+ afp->mStartFrame = frame;
+ afp->mAudioFileManager->SetPosition (afp->mAudioFileManager, position);
+}
+
+
+static int AudioFilePlayer_GetCurrentFrame (AudioFilePlayer *afp)
+{
+ return afp->mStartFrame + (afp->mAudioFileManager->GetByteCounter(afp->mAudioFileManager) / 2352);
+}
+
+static void AudioFilePlayer_SetStopFrame (AudioFilePlayer *afp, int frame)
+{
+ SInt64 position = frame * 2352;
+
+ afp->mAudioFileManager->SetEndOfFile (afp->mAudioFileManager, position);
+}
+
+void delete_AudioFilePlayer(AudioFilePlayer *afp)
+{
+ if (afp != NULL)
+ {
+ afp->Disconnect(afp);
+
+ if (afp->mAudioFileManager) {
+ delete_AudioFileManager(afp->mAudioFileManager);
+ afp->mAudioFileManager = 0;
+ }
+
+ if (afp->mForkRefNum) {
+ FSCloseFork (afp->mForkRefNum);
+ afp->mForkRefNum = 0;
+ }
+ SDL_free(afp);
+ }
+}
+
+static int AudioFilePlayer_Connect(AudioFilePlayer *afp)
+{
+#if DEBUG
+ printf ("Connect:%x, engaged=%d\n", (int)afp->mPlayUnit, (afp->mConnected ? 1 : 0));
+#endif
+ if (!afp->mConnected)
+ {
+ if (!afp->mAudioFileManager->DoConnect(afp->mAudioFileManager))
+ return 0;
+
+ /* set the render callback for the file data to be supplied to the sound converter AU */
+ afp->mInputCallback.inputProc = afp->mAudioFileManager->FileInputProc;
+ afp->mInputCallback.inputProcRefCon = afp->mAudioFileManager;
+
+ OSStatus result = AudioUnitSetProperty (afp->mPlayUnit,
+ kAudioUnitProperty_SetRenderCallback,
+ kAudioUnitScope_Input,
+ 0,
+ &afp->mInputCallback,
+ sizeof(afp->mInputCallback));
+ if (result) return 0; /*THROW_RESULT("AudioUnitSetProperty")*/
+ afp->mConnected = 1;
+ }
+
+ return 1;
+}
+
+/* warning noted, now please go away ;-) */
+/* #warning This should redirect the calling of notification code to some other thread */
+static void AudioFilePlayer_DoNotification (AudioFilePlayer *afp, OSStatus inStatus)
+{
+ if (afp->mNotifier) {
+ (*afp->mNotifier) (afp->mRefCon, inStatus);
+ } else {
+ SDL_SetError ("Notification posted with no notifier in place");
+
+ if (inStatus == kAudioFilePlay_FileIsFinished)
+ afp->Disconnect(afp);
+ else if (inStatus != kAudioFilePlayErr_FilePlayUnderrun)
+ afp->Disconnect(afp);
+ }
+}
+
+static void AudioFilePlayer_Disconnect (AudioFilePlayer *afp)
+{
+#if DEBUG
+ printf ("Disconnect:%x,%ld, engaged=%d\n", (int)afp->mPlayUnit, 0, (afp->mConnected ? 1 : 0));
+#endif
+ if (afp->mConnected)
+ {
+ afp->mConnected = 0;
+
+ afp->mInputCallback.inputProc = 0;
+ afp->mInputCallback.inputProcRefCon = 0;
+ OSStatus result = AudioUnitSetProperty (afp->mPlayUnit,
+ kAudioUnitProperty_SetRenderCallback,
+ kAudioUnitScope_Input,
+ 0,
+ &afp->mInputCallback,
+ sizeof(afp->mInputCallback));
+ if (result)
+ SDL_SetError ("AudioUnitSetProperty:RemoveInputCallback:%ld", result);
+
+ afp->mAudioFileManager->Disconnect(afp->mAudioFileManager);
+ }
+}
+
+typedef struct {
+ UInt32 offset;
+ UInt32 blockSize;
+} SSNDData;
+
+static int AudioFilePlayer_OpenFile (AudioFilePlayer *afp, const FSRef *inRef, SInt64 *outFileDataSize)
+{
+ ContainerChunk chunkHeader;
+ ChunkHeader chunk;
+ SSNDData ssndData;
+
+ OSErr result;
+ HFSUniStr255 dfName;
+ ByteCount actual;
+ SInt64 offset;
+
+ /* Open the data fork of the input file */
+ result = FSGetDataForkName(&dfName);
+ if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): FSGetDataForkName")*/
+
+ result = FSOpenFork(inRef, dfName.length, dfName.unicode, fsRdPerm, &afp->mForkRefNum);
+ if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): FSOpenFork")*/
+
+ /* Read the file header, and check if it's indeed an AIFC file */
+ result = FSReadFork(afp->mForkRefNum, fsAtMark, 0, sizeof(chunkHeader), &chunkHeader, &actual);
+ if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): FSReadFork")*/
+
+ if (SDL_SwapBE32(chunkHeader.ckID) != 'FORM') {
+ result = -1;
+ if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): chunk id is not 'FORM'");*/
+ }
+
+ if (SDL_SwapBE32(chunkHeader.formType) != 'AIFC') {
+ result = -1;
+ if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): file format is not 'AIFC'");*/
+ }
+
+ /* Search for the SSND chunk. We ignore all compression etc. information
+ in other chunks. Of course that is kind of evil, but for now we are lazy
+ and rely on the cdfs to always give us the same fixed format.
+ TODO: Parse the COMM chunk we currently skip to fill in mFileDescription.
+ */
+ offset = 0;
+ do {
+ result = FSReadFork(afp->mForkRefNum, fsFromMark, offset, sizeof(chunk), &chunk, &actual);
+ if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): FSReadFork")*/
+
+ chunk.ckID = SDL_SwapBE32(chunk.ckID);
+ chunk.ckSize = SDL_SwapBE32(chunk.ckSize);
+
+ /* Skip the chunk data */
+ offset = chunk.ckSize;
+ } while (chunk.ckID != 'SSND');
+
+ /* Read the header of the SSND chunk. After this, we are positioned right
+ at the start of the audio data. */
+ result = FSReadFork(afp->mForkRefNum, fsAtMark, 0, sizeof(ssndData), &ssndData, &actual);
+ if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): FSReadFork")*/
+
+ ssndData.offset = SDL_SwapBE32(ssndData.offset);
+
+ result = FSSetForkPosition(afp->mForkRefNum, fsFromMark, ssndData.offset);
+ if (result) return 0; /*THROW_RESULT("AudioFilePlayer::OpenFile(): FSSetForkPosition")*/
+
+ /* Data size */
+ *outFileDataSize = chunk.ckSize - ssndData.offset - 8;
+
+ /* File format */
+ afp->mFileDescription.mSampleRate = 44100;
+ afp->mFileDescription.mFormatID = kAudioFormatLinearPCM;
+ afp->mFileDescription.mFormatFlags = kLinearPCMFormatFlagIsPacked | kLinearPCMFormatFlagIsSignedInteger;
+ afp->mFileDescription.mBytesPerPacket = 4;
+ afp->mFileDescription.mFramesPerPacket = 1;
+ afp->mFileDescription.mBytesPerFrame = 4;
+ afp->mFileDescription.mChannelsPerFrame = 2;
+ afp->mFileDescription.mBitsPerChannel = 16;
+
+ return 1;
+}
+
+AudioFilePlayer *new_AudioFilePlayer (const FSRef *inFileRef)
+{
+ SInt64 fileDataSize = 0;
+
+ AudioFilePlayer *afp = (AudioFilePlayer *) SDL_malloc(sizeof (AudioFilePlayer));
+ if (afp == NULL)
+ return NULL;
+ SDL_memset(afp, '\0', sizeof (*afp));
+
+ #define SET_AUDIOFILEPLAYER_METHOD(m) afp->m = AudioFilePlayer_##m
+ SET_AUDIOFILEPLAYER_METHOD(SetDestination);
+ SET_AUDIOFILEPLAYER_METHOD(SetNotifier);
+ SET_AUDIOFILEPLAYER_METHOD(SetStartFrame);
+ SET_AUDIOFILEPLAYER_METHOD(GetCurrentFrame);
+ SET_AUDIOFILEPLAYER_METHOD(SetStopFrame);
+ SET_AUDIOFILEPLAYER_METHOD(Connect);
+ SET_AUDIOFILEPLAYER_METHOD(Disconnect);
+ SET_AUDIOFILEPLAYER_METHOD(DoNotification);
+ SET_AUDIOFILEPLAYER_METHOD(IsConnected);
+ SET_AUDIOFILEPLAYER_METHOD(GetDestUnit);
+ SET_AUDIOFILEPLAYER_METHOD(Print);
+ SET_AUDIOFILEPLAYER_METHOD(OpenFile);
+ #undef SET_AUDIOFILEPLAYER_METHOD
+
+ if (!afp->OpenFile (afp, inFileRef, &fileDataSize))
+ {
+ SDL_free(afp);
+ return NULL;
+ }
+
+ /* we want about 4 seconds worth of data for the buffer */
+ int bytesPerSecond = (UInt32) (4 * afp->mFileDescription.mSampleRate * afp->mFileDescription.mBytesPerFrame);
+
+#if DEBUG
+ printf("File format:\n");
+ PrintStreamDesc (&afp->mFileDescription);
+#endif
+
+ afp->mAudioFileManager = new_AudioFileManager(afp, afp->mForkRefNum,
+ fileDataSize,
+ bytesPerSecond);
+ if (afp->mAudioFileManager == NULL)
+ {
+ delete_AudioFilePlayer(afp);
+ return NULL;
+ }
+
+ return afp;
+}
+
diff --git a/distrib/sdl-1.2.15/src/cdrom/macosx/AudioFilePlayer.h b/distrib/sdl-1.2.15/src/cdrom/macosx/AudioFilePlayer.h
new file mode 100644
index 0000000..886d017
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/macosx/AudioFilePlayer.h
@@ -0,0 +1,178 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ This file based on Apple sample code. We haven't changed the file name,
+ so if you want to see the original search for it on apple.com/developer
+*/
+#include "SDL_config.h"
+
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ AudioFilePlayer.h
+*/
+#ifndef __AudioFilePlayer_H__
+#define __AudioFilePlayer_H__
+
+#include <CoreServices/CoreServices.h>
+
+#include <AudioUnit/AudioUnit.h>
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1050
+#include <AudioUnit/AUNTComponent.h>
+#endif
+
+#if (MAC_OS_X_VERSION_MAX_ALLOWED < 1050)
+typedef SInt16 FSIORefNum;
+#endif
+
+#include "SDL_error.h"
+
+const char* AudioFilePlayerErrorStr (OSStatus error);
+
+/*
+void ThrowResult (OSStatus result, const char *str);
+
+#define THROW_RESULT(str) \
+ if (result) { \
+ ThrowResult (result, str); \
+ }
+*/
+
+typedef void (*AudioFilePlayNotifier)(void *inRefCon,
+ OSStatus inStatus);
+
+enum {
+ kAudioFilePlayErr_FilePlayUnderrun = -10000,
+ kAudioFilePlay_FileIsFinished = -10001,
+ kAudioFilePlay_PlayerIsUninitialized = -10002
+};
+
+
+struct S_AudioFileManager;
+
+#pragma mark __________ AudioFilePlayer
+typedef struct S_AudioFilePlayer
+{
+/*public:*/
+ int (*SetDestination)(struct S_AudioFilePlayer *afp, AudioUnit *inDestUnit);
+ void (*SetNotifier)(struct S_AudioFilePlayer *afp, AudioFilePlayNotifier inNotifier, void *inRefCon);
+ void (*SetStartFrame)(struct S_AudioFilePlayer *afp, int frame); /* seek in the file */
+ int (*GetCurrentFrame)(struct S_AudioFilePlayer *afp); /* get the current frame position */
+ void (*SetStopFrame)(struct S_AudioFilePlayer *afp, int frame); /* set limit in the file */
+ int (*Connect)(struct S_AudioFilePlayer *afp);
+ void (*Disconnect)(struct S_AudioFilePlayer *afp);
+ void (*DoNotification)(struct S_AudioFilePlayer *afp, OSStatus inError);
+ int (*IsConnected)(struct S_AudioFilePlayer *afp);
+ AudioUnit (*GetDestUnit)(struct S_AudioFilePlayer *afp);
+ void (*Print)(struct S_AudioFilePlayer *afp);
+
+/*private:*/
+ AudioUnit mPlayUnit;
+ FSIORefNum mForkRefNum;
+
+ AURenderCallbackStruct mInputCallback;
+
+ AudioStreamBasicDescription mFileDescription;
+
+ int mConnected;
+
+ struct S_AudioFileManager* mAudioFileManager;
+
+ AudioFilePlayNotifier mNotifier;
+ void* mRefCon;
+
+ int mStartFrame;
+
+#pragma mark __________ Private_Methods
+
+ int (*OpenFile)(struct S_AudioFilePlayer *afp, const FSRef *inRef, SInt64 *outFileSize);
+} AudioFilePlayer;
+
+
+AudioFilePlayer *new_AudioFilePlayer(const FSRef *inFileRef);
+void delete_AudioFilePlayer(AudioFilePlayer *afp);
+
+
+
+#pragma mark __________ AudioFileManager
+typedef struct S_AudioFileManager
+{
+/*public:*/
+ /* this method should NOT be called by an object of this class
+ as it is called by the parent's Disconnect() method */
+ void (*Disconnect)(struct S_AudioFileManager *afm);
+ int (*DoConnect)(struct S_AudioFileManager *afm);
+ OSStatus (*Read)(struct S_AudioFileManager *afm, char *buffer, ByteCount *len);
+ const char* (*GetFileBuffer)(struct S_AudioFileManager *afm);
+ const AudioFilePlayer *(*GetParent)(struct S_AudioFileManager *afm);
+ void (*SetPosition)(struct S_AudioFileManager *afm, SInt64 pos); /* seek/rewind in the file */
+ int (*GetByteCounter)(struct S_AudioFileManager *afm); /* return actual bytes streamed to audio hardware */
+ void (*SetEndOfFile)(struct S_AudioFileManager *afm, SInt64 pos); /* set the "EOF" (will behave just like it reached eof) */
+
+/*protected:*/
+ AudioFilePlayer* mParent;
+ SInt16 mForkRefNum;
+ SInt64 mAudioDataOffset;
+
+ char* mFileBuffer;
+
+ int mByteCounter;
+
+ int mReadFromFirstBuffer;
+ int mLockUnsuccessful;
+ int mIsEngaged;
+
+ int mNumTimesAskedSinceFinished;
+
+
+ void* mTmpBuffer;
+ UInt32 mBufferSize;
+ UInt32 mBufferOffset;
+/*public:*/
+ UInt32 mChunkSize;
+ SInt64 mFileLength;
+ SInt64 mReadFilePosition;
+ int mWriteToFirstBuffer;
+ int mFinishedReadingData;
+
+/*protected:*/
+ OSStatus (*Render)(struct S_AudioFileManager *afm, AudioBufferList *ioData);
+ OSStatus (*GetFileData)(struct S_AudioFileManager *afm, void** inOutData, UInt32 *inOutDataSize);
+ void (*AfterRender)(struct S_AudioFileManager *afm);
+
+/*public:*/
+ /*static*/
+ OSStatus (*FileInputProc)(void *inRefCon,
+ AudioUnitRenderActionFlags *ioActionFlags,
+ const AudioTimeStamp *inTimeStamp,
+ UInt32 inBusNumber,
+ UInt32 inNumberFrames,
+ AudioBufferList *ioData);
+} AudioFileManager;
+
+
+AudioFileManager *new_AudioFileManager (AudioFilePlayer *inParent,
+ SInt16 inForkRefNum,
+ SInt64 inFileLength,
+ UInt32 inChunkSize);
+
+void delete_AudioFileManager(AudioFileManager *afm);
+
+#endif
+
diff --git a/distrib/sdl-1.2.15/src/cdrom/macosx/AudioFileReaderThread.c b/distrib/sdl-1.2.15/src/cdrom/macosx/AudioFileReaderThread.c
new file mode 100644
index 0000000..0007c07
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/macosx/AudioFileReaderThread.c
@@ -0,0 +1,610 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ This file based on Apple sample code. We haven't changed the file name,
+ so if you want to see the original search for it on apple.com/developer
+*/
+#include "SDL_config.h"
+
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ AudioFileManager.cpp
+*/
+#include "AudioFilePlayer.h"
+#include <mach/mach.h> /* used for setting policy of thread */
+#include "SDLOSXCAGuard.h"
+#include <pthread.h>
+
+/*#include <list>*/
+
+/*typedef void *FileData;*/
+typedef struct S_FileData
+{
+ AudioFileManager *obj;
+ struct S_FileData *next;
+} FileData;
+
+
+typedef struct S_FileReaderThread {
+/*public:*/
+ SDLOSXCAGuard* (*GetGuard)(struct S_FileReaderThread *frt);
+ void (*AddReader)(struct S_FileReaderThread *frt);
+ void (*RemoveReader)(struct S_FileReaderThread *frt, AudioFileManager* inItem);
+ int (*TryNextRead)(struct S_FileReaderThread *frt, AudioFileManager* inItem);
+
+ int mThreadShouldDie;
+
+/*private:*/
+ /*typedef std::list<AudioFileManager*> FileData;*/
+
+ SDLOSXCAGuard *mGuard;
+ UInt32 mThreadPriority;
+
+ int mNumReaders;
+ FileData *mFileData;
+
+
+ void (*ReadNextChunk)(struct S_FileReaderThread *frt);
+ int (*StartFixedPriorityThread)(struct S_FileReaderThread *frt);
+ /*static*/
+ UInt32 (*GetThreadBasePriority)(pthread_t inThread);
+ /*static*/
+ void* (*DiskReaderEntry)(void *inRefCon);
+} FileReaderThread;
+
+
+static SDLOSXCAGuard* FileReaderThread_GetGuard(FileReaderThread *frt)
+{
+ return frt->mGuard;
+}
+
+/* returns 1 if succeeded */
+static int FileReaderThread_TryNextRead (FileReaderThread *frt, AudioFileManager* inItem)
+{
+ int didLock = 0;
+ int succeeded = 0;
+ if (frt->mGuard->Try(frt->mGuard, &didLock))
+ {
+ /*frt->mFileData.push_back (inItem);*/
+ /* !!! FIXME: this could be faster with a "tail" member. --ryan. */
+ FileData *i = frt->mFileData;
+ FileData *prev = NULL;
+
+ FileData *newfd = (FileData *) SDL_malloc(sizeof (FileData));
+ newfd->obj = inItem;
+ newfd->next = NULL;
+
+ while (i != NULL) { prev = i; i = i->next; }
+ if (prev == NULL)
+ frt->mFileData = newfd;
+ else
+ prev->next = newfd;
+
+ frt->mGuard->Notify(frt->mGuard);
+ succeeded = 1;
+
+ if (didLock)
+ frt->mGuard->Unlock(frt->mGuard);
+ }
+
+ return succeeded;
+}
+
+static void FileReaderThread_AddReader(FileReaderThread *frt)
+{
+ if (frt->mNumReaders == 0)
+ {
+ frt->mThreadShouldDie = 0;
+ frt->StartFixedPriorityThread (frt);
+ }
+ frt->mNumReaders++;
+}
+
+static void FileReaderThread_RemoveReader (FileReaderThread *frt, AudioFileManager* inItem)
+{
+ if (frt->mNumReaders > 0)
+ {
+ int bNeedsRelease = frt->mGuard->Lock(frt->mGuard);
+
+ /*frt->mFileData.remove (inItem);*/
+ FileData *i = frt->mFileData;
+ FileData *prev = NULL;
+ while (i != NULL)
+ {
+ FileData *next = i->next;
+ if (i->obj != inItem)
+ prev = i;
+ else
+ {
+ if (prev == NULL)
+ frt->mFileData = next;
+ else
+ prev->next = next;
+ SDL_free(i);
+ }
+ i = next;
+ }
+
+ if (--frt->mNumReaders == 0) {
+ frt->mThreadShouldDie = 1;
+ frt->mGuard->Notify(frt->mGuard); /* wake up thread so it will quit */
+ frt->mGuard->Wait(frt->mGuard); /* wait for thread to die */
+ }
+
+ if (bNeedsRelease) frt->mGuard->Unlock(frt->mGuard);
+ }
+}
+
+static int FileReaderThread_StartFixedPriorityThread (FileReaderThread *frt)
+{
+ pthread_attr_t theThreadAttrs;
+ pthread_t pThread;
+
+ OSStatus result = pthread_attr_init(&theThreadAttrs);
+ if (result) return 0; /*THROW_RESULT("pthread_attr_init - Thread attributes could not be created.")*/
+
+ result = pthread_attr_setdetachstate(&theThreadAttrs, PTHREAD_CREATE_DETACHED);
+ if (result) return 0; /*THROW_RESULT("pthread_attr_setdetachstate - Thread attributes could not be detached.")*/
+
+ result = pthread_create (&pThread, &theThreadAttrs, frt->DiskReaderEntry, frt);
+ if (result) return 0; /*THROW_RESULT("pthread_create - Create and start the thread.")*/
+
+ pthread_attr_destroy(&theThreadAttrs);
+
+ /* we've now created the thread and started it
+ we'll now set the priority of the thread to the nominated priority
+ and we'll also make the thread fixed */
+ thread_extended_policy_data_t theFixedPolicy;
+ thread_precedence_policy_data_t thePrecedencePolicy;
+ SInt32 relativePriority;
+
+ /* make thread fixed */
+ theFixedPolicy.timeshare = 0; /* set to 1 for a non-fixed thread */
+ result = thread_policy_set (pthread_mach_thread_np(pThread), THREAD_EXTENDED_POLICY, (thread_policy_t)&theFixedPolicy, THREAD_EXTENDED_POLICY_COUNT);
+ if (result) return 0; /*THROW_RESULT("thread_policy - Couldn't set thread as fixed priority.")*/
+ /* set priority */
+ /* precedency policy's "importance" value is relative to spawning thread's priority */
+ relativePriority = frt->mThreadPriority - frt->GetThreadBasePriority(pthread_self());
+
+ thePrecedencePolicy.importance = relativePriority;
+ result = thread_policy_set (pthread_mach_thread_np(pThread), THREAD_PRECEDENCE_POLICY, (thread_policy_t)&thePrecedencePolicy, THREAD_PRECEDENCE_POLICY_COUNT);
+ if (result) return 0; /*THROW_RESULT("thread_policy - Couldn't set thread priority.")*/
+
+ return 1;
+}
+
+static UInt32 FileReaderThread_GetThreadBasePriority (pthread_t inThread)
+{
+ thread_basic_info_data_t threadInfo;
+ policy_info_data_t thePolicyInfo;
+ unsigned int count;
+
+ /* get basic info */
+ count = THREAD_BASIC_INFO_COUNT;
+ thread_info (pthread_mach_thread_np (inThread), THREAD_BASIC_INFO, (integer_t*)&threadInfo, &count);
+
+ switch (threadInfo.policy) {
+ case POLICY_TIMESHARE:
+ count = POLICY_TIMESHARE_INFO_COUNT;
+ thread_info(pthread_mach_thread_np (inThread), THREAD_SCHED_TIMESHARE_INFO, (integer_t*)&(thePolicyInfo.ts), &count);
+ return thePolicyInfo.ts.base_priority;
+ break;
+
+ case POLICY_FIFO:
+ count = POLICY_FIFO_INFO_COUNT;
+ thread_info(pthread_mach_thread_np (inThread), THREAD_SCHED_FIFO_INFO, (integer_t*)&(thePolicyInfo.fifo), &count);
+ if (thePolicyInfo.fifo.depressed) {
+ return thePolicyInfo.fifo.depress_priority;
+ } else {
+ return thePolicyInfo.fifo.base_priority;
+ }
+ break;
+
+ case POLICY_RR:
+ count = POLICY_RR_INFO_COUNT;
+ thread_info(pthread_mach_thread_np (inThread), THREAD_SCHED_RR_INFO, (integer_t*)&(thePolicyInfo.rr), &count);
+ if (thePolicyInfo.rr.depressed) {
+ return thePolicyInfo.rr.depress_priority;
+ } else {
+ return thePolicyInfo.rr.base_priority;
+ }
+ break;
+ }
+
+ return 0;
+}
+
+static void *FileReaderThread_DiskReaderEntry (void *inRefCon)
+{
+ FileReaderThread *frt = (FileReaderThread *)inRefCon;
+ frt->ReadNextChunk(frt);
+ #if DEBUG
+ printf ("finished with reading file\n");
+ #endif
+
+ return 0;
+}
+
+static void FileReaderThread_ReadNextChunk (FileReaderThread *frt)
+{
+ OSStatus result;
+ ByteCount dataChunkSize;
+ AudioFileManager* theItem = 0;
+
+ for (;;)
+ {
+ { /* this is a scoped based lock */
+ int bNeedsRelease = frt->mGuard->Lock(frt->mGuard);
+
+ if (frt->mThreadShouldDie) {
+ frt->mGuard->Notify(frt->mGuard);
+ if (bNeedsRelease) frt->mGuard->Unlock(frt->mGuard);
+ return;
+ }
+
+ /*if (frt->mFileData.empty())*/
+ if (frt->mFileData == NULL)
+ {
+ frt->mGuard->Wait(frt->mGuard);
+ }
+
+ /* kill thread */
+ if (frt->mThreadShouldDie) {
+
+ frt->mGuard->Notify(frt->mGuard);
+ if (bNeedsRelease) frt->mGuard->Unlock(frt->mGuard);
+ return;
+ }
+
+ /*theItem = frt->mFileData.front();*/
+ /*frt->mFileData.pop_front();*/
+ theItem = NULL;
+ if (frt->mFileData != NULL)
+ {
+ FileData *next = frt->mFileData->next;
+ theItem = frt->mFileData->obj;
+ SDL_free(frt->mFileData);
+ frt->mFileData = next;
+ }
+
+ if (bNeedsRelease) frt->mGuard->Unlock(frt->mGuard);
+ }
+
+ if ((theItem->mFileLength - theItem->mReadFilePosition) < theItem->mChunkSize)
+ dataChunkSize = theItem->mFileLength - theItem->mReadFilePosition;
+ else
+ dataChunkSize = theItem->mChunkSize;
+
+ /* this is the exit condition for the thread */
+ if (dataChunkSize <= 0) {
+ theItem->mFinishedReadingData = 1;
+ continue;
+ }
+ /* construct pointer */
+ char* writePtr = (char *) (theItem->GetFileBuffer(theItem) +
+ (theItem->mWriteToFirstBuffer ? 0 : theItem->mChunkSize));
+
+ /* read data */
+ result = theItem->Read(theItem, writePtr, &dataChunkSize);
+ if (result != noErr && result != eofErr) {
+ AudioFilePlayer *afp = (AudioFilePlayer *) theItem->GetParent(theItem);
+ afp->DoNotification(afp, result);
+ continue;
+ }
+
+ if (dataChunkSize != theItem->mChunkSize)
+ {
+ writePtr += dataChunkSize;
+
+ /* can't exit yet.. we still have to pass the partial buffer back */
+ SDL_memset(writePtr, 0, (theItem->mChunkSize - dataChunkSize));
+ }
+
+ theItem->mWriteToFirstBuffer = !theItem->mWriteToFirstBuffer; /* switch buffers */
+
+ if (result == eofErr)
+ theItem->mReadFilePosition = theItem->mFileLength;
+ else
+ theItem->mReadFilePosition += dataChunkSize; /* increment count */
+ }
+}
+
+void delete_FileReaderThread(FileReaderThread *frt)
+{
+ if (frt != NULL)
+ {
+ delete_SDLOSXCAGuard(frt->mGuard);
+ SDL_free(frt);
+ }
+}
+
+FileReaderThread *new_FileReaderThread ()
+{
+ FileReaderThread *frt = (FileReaderThread *) SDL_malloc(sizeof (FileReaderThread));
+ if (frt == NULL)
+ return NULL;
+ SDL_memset(frt, '\0', sizeof (*frt));
+
+ frt->mGuard = new_SDLOSXCAGuard();
+ if (frt->mGuard == NULL)
+ {
+ SDL_free(frt);
+ return NULL;
+ }
+
+ #define SET_FILEREADERTHREAD_METHOD(m) frt->m = FileReaderThread_##m
+ SET_FILEREADERTHREAD_METHOD(GetGuard);
+ SET_FILEREADERTHREAD_METHOD(AddReader);
+ SET_FILEREADERTHREAD_METHOD(RemoveReader);
+ SET_FILEREADERTHREAD_METHOD(TryNextRead);
+ SET_FILEREADERTHREAD_METHOD(ReadNextChunk);
+ SET_FILEREADERTHREAD_METHOD(StartFixedPriorityThread);
+ SET_FILEREADERTHREAD_METHOD(GetThreadBasePriority);
+ SET_FILEREADERTHREAD_METHOD(DiskReaderEntry);
+ #undef SET_FILEREADERTHREAD_METHOD
+
+ frt->mThreadPriority = 62;
+ return frt;
+}
+
+
+static FileReaderThread *sReaderThread;
+
+
+static int AudioFileManager_DoConnect (AudioFileManager *afm)
+{
+ if (!afm->mIsEngaged)
+ {
+ OSStatus result;
+
+ /*afm->mReadFilePosition = 0;*/
+ afm->mFinishedReadingData = 0;
+
+ afm->mNumTimesAskedSinceFinished = 0;
+ afm->mLockUnsuccessful = 0;
+
+ ByteCount dataChunkSize;
+
+ if ((afm->mFileLength - afm->mReadFilePosition) < afm->mChunkSize)
+ dataChunkSize = afm->mFileLength - afm->mReadFilePosition;
+ else
+ dataChunkSize = afm->mChunkSize;
+
+ result = afm->Read(afm, afm->mFileBuffer, &dataChunkSize);
+ if (result) return 0; /*THROW_RESULT("AudioFileManager::DoConnect(): Read")*/
+
+ afm->mReadFilePosition += dataChunkSize;
+
+ afm->mWriteToFirstBuffer = 0;
+ afm->mReadFromFirstBuffer = 1;
+
+ sReaderThread->AddReader(sReaderThread);
+
+ afm->mIsEngaged = 1;
+ }
+ /*
+ else
+ throw static_cast<OSStatus>(-1); */ /* thread has already been started */
+
+ return 1;
+}
+
+static void AudioFileManager_Disconnect (AudioFileManager *afm)
+{
+ if (afm->mIsEngaged)
+ {
+ sReaderThread->RemoveReader (sReaderThread, afm);
+ afm->mIsEngaged = 0;
+ }
+}
+
+static OSStatus AudioFileManager_Read(AudioFileManager *afm, char *buffer, ByteCount *len)
+{
+ return FSReadFork (afm->mForkRefNum,
+ fsFromStart,
+ afm->mReadFilePosition + afm->mAudioDataOffset,
+ *len,
+ buffer,
+ len);
+}
+
+static OSStatus AudioFileManager_GetFileData (AudioFileManager *afm, void** inOutData, UInt32 *inOutDataSize)
+{
+ if (afm->mFinishedReadingData)
+ {
+ ++afm->mNumTimesAskedSinceFinished;
+ *inOutDataSize = 0;
+ *inOutData = 0;
+ return noErr;
+ }
+
+ if (afm->mReadFromFirstBuffer == afm->mWriteToFirstBuffer) {
+ #if DEBUG
+ printf ("* * * * * * * Can't keep up with reading file\n");
+ #endif
+
+ afm->mParent->DoNotification (afm->mParent, kAudioFilePlayErr_FilePlayUnderrun);
+ *inOutDataSize = 0;
+ *inOutData = 0;
+ } else {
+ *inOutDataSize = afm->mChunkSize;
+ *inOutData = afm->mReadFromFirstBuffer ? afm->mFileBuffer : (afm->mFileBuffer + afm->mChunkSize);
+ }
+
+ afm->mLockUnsuccessful = !sReaderThread->TryNextRead (sReaderThread, afm);
+
+ afm->mReadFromFirstBuffer = !afm->mReadFromFirstBuffer;
+
+ return noErr;
+}
+
+static void AudioFileManager_AfterRender (AudioFileManager *afm)
+{
+ if (afm->mNumTimesAskedSinceFinished > 0)
+ {
+ int didLock = 0;
+ SDLOSXCAGuard *guard = sReaderThread->GetGuard(sReaderThread);
+ if (guard->Try(guard, &didLock)) {
+ afm->mParent->DoNotification (afm->mParent, kAudioFilePlay_FileIsFinished);
+ if (didLock)
+ guard->Unlock(guard);
+ }
+ }
+
+ if (afm->mLockUnsuccessful)
+ afm->mLockUnsuccessful = !sReaderThread->TryNextRead (sReaderThread, afm);
+}
+
+static void AudioFileManager_SetPosition (AudioFileManager *afm, SInt64 pos)
+{
+ if (pos < 0 || pos >= afm->mFileLength) {
+ SDL_SetError ("AudioFileManager::SetPosition - position invalid: %d filelen=%d\n",
+ (unsigned int)pos, (unsigned int)afm->mFileLength);
+ pos = 0;
+ }
+
+ afm->mReadFilePosition = pos;
+}
+
+static void AudioFileManager_SetEndOfFile (AudioFileManager *afm, SInt64 pos)
+{
+ if (pos <= 0 || pos > afm->mFileLength) {
+ SDL_SetError ("AudioFileManager::SetEndOfFile - position beyond actual eof\n");
+ pos = afm->mFileLength;
+ }
+
+ afm->mFileLength = pos;
+}
+
+static const char *AudioFileManager_GetFileBuffer(AudioFileManager *afm)
+{
+ return afm->mFileBuffer;
+}
+
+const AudioFilePlayer *AudioFileManager_GetParent(AudioFileManager *afm)
+{
+ return afm->mParent;
+}
+
+static int AudioFileManager_GetByteCounter(AudioFileManager *afm)
+{
+ return afm->mByteCounter;
+}
+
+static OSStatus AudioFileManager_FileInputProc (void *inRefCon,
+ AudioUnitRenderActionFlags *ioActionFlags,
+ const AudioTimeStamp *inTimeStamp,
+ UInt32 inBusNumber,
+ UInt32 inNumberFrames,
+ AudioBufferList *ioData)
+{
+ AudioFileManager* afm = (AudioFileManager*)inRefCon;
+ return afm->Render(afm, ioData);
+}
+
+static OSStatus AudioFileManager_Render (AudioFileManager *afm, AudioBufferList *ioData)
+{
+ OSStatus result = noErr;
+ AudioBuffer *abuf;
+ UInt32 i;
+
+ for (i = 0; i < ioData->mNumberBuffers; i++) {
+ abuf = &ioData->mBuffers[i];
+ if (afm->mBufferOffset >= afm->mBufferSize) {
+ result = afm->GetFileData(afm, &afm->mTmpBuffer, &afm->mBufferSize);
+ if (result) {
+ SDL_SetError ("AudioConverterFillBuffer:%ld\n", result);
+ afm->mParent->DoNotification(afm->mParent, result);
+ return result;
+ }
+
+ afm->mBufferOffset = 0;
+ }
+
+ if (abuf->mDataByteSize > afm->mBufferSize - afm->mBufferOffset)
+ abuf->mDataByteSize = afm->mBufferSize - afm->mBufferOffset;
+ abuf->mData = (char *)afm->mTmpBuffer + afm->mBufferOffset;
+ afm->mBufferOffset += abuf->mDataByteSize;
+
+ afm->mByteCounter += abuf->mDataByteSize;
+ afm->AfterRender(afm);
+ }
+ return result;
+}
+
+
+void delete_AudioFileManager (AudioFileManager *afm)
+{
+ if (afm != NULL) {
+ if (afm->mFileBuffer) {
+ free(afm->mFileBuffer);
+ }
+
+ SDL_free(afm);
+ }
+}
+
+
+AudioFileManager *new_AudioFileManager(AudioFilePlayer *inParent,
+ SInt16 inForkRefNum,
+ SInt64 inFileLength,
+ UInt32 inChunkSize)
+{
+ AudioFileManager *afm;
+
+ if (sReaderThread == NULL)
+ {
+ sReaderThread = new_FileReaderThread();
+ if (sReaderThread == NULL)
+ return NULL;
+ }
+
+ afm = (AudioFileManager *) SDL_malloc(sizeof (AudioFileManager));
+ if (afm == NULL)
+ return NULL;
+ SDL_memset(afm, '\0', sizeof (*afm));
+
+ #define SET_AUDIOFILEMANAGER_METHOD(m) afm->m = AudioFileManager_##m
+ SET_AUDIOFILEMANAGER_METHOD(Disconnect);
+ SET_AUDIOFILEMANAGER_METHOD(DoConnect);
+ SET_AUDIOFILEMANAGER_METHOD(Read);
+ SET_AUDIOFILEMANAGER_METHOD(GetFileBuffer);
+ SET_AUDIOFILEMANAGER_METHOD(GetParent);
+ SET_AUDIOFILEMANAGER_METHOD(SetPosition);
+ SET_AUDIOFILEMANAGER_METHOD(GetByteCounter);
+ SET_AUDIOFILEMANAGER_METHOD(SetEndOfFile);
+ SET_AUDIOFILEMANAGER_METHOD(Render);
+ SET_AUDIOFILEMANAGER_METHOD(GetFileData);
+ SET_AUDIOFILEMANAGER_METHOD(AfterRender);
+ SET_AUDIOFILEMANAGER_METHOD(FileInputProc);
+ #undef SET_AUDIOFILEMANAGER_METHOD
+
+ afm->mParent = inParent;
+ afm->mForkRefNum = inForkRefNum;
+ afm->mBufferSize = inChunkSize;
+ afm->mBufferOffset = inChunkSize;
+ afm->mChunkSize = inChunkSize;
+ afm->mFileLength = inFileLength;
+ afm->mFileBuffer = (char*) SDL_malloc(afm->mChunkSize * 2);
+ FSGetForkPosition(afm->mForkRefNum, &afm->mAudioDataOffset);
+ assert (afm->mFileBuffer != NULL);
+ return afm;
+}
+
diff --git a/distrib/sdl-1.2.15/src/cdrom/macosx/CDPlayer.c b/distrib/sdl-1.2.15/src/cdrom/macosx/CDPlayer.c
new file mode 100644
index 0000000..beb87cd
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/macosx/CDPlayer.c
@@ -0,0 +1,636 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "CDPlayer.h"
+#include "AudioFilePlayer.h"
+#include "SDLOSXCAGuard.h"
+
+/* we're exporting these functions into C land for SDL_syscdrom.c */
+/*extern "C" {*/
+
+/*///////////////////////////////////////////////////////////////////////////
+ Constants
+ //////////////////////////////////////////////////////////////////////////*/
+
+#define kAudioCDFilesystemID (UInt16)(('J' << 8) | 'H') /* 'JH'; this avoids compiler warning */
+
+/* XML PList keys */
+#define kRawTOCDataString "Format 0x02 TOC Data"
+#define kSessionsString "Sessions"
+#define kSessionTypeString "Session Type"
+#define kTrackArrayString "Track Array"
+#define kFirstTrackInSessionString "First Track"
+#define kLastTrackInSessionString "Last Track"
+#define kLeadoutBlockString "Leadout Block"
+#define kDataKeyString "Data"
+#define kPointKeyString "Point"
+#define kSessionNumberKeyString "Session Number"
+#define kStartBlockKeyString "Start Block"
+
+/*///////////////////////////////////////////////////////////////////////////
+ Globals
+ //////////////////////////////////////////////////////////////////////////*/
+
+#pragma mark -- Globals --
+
+static int playBackWasInit = 0;
+static AudioUnit theUnit;
+static AudioFilePlayer* thePlayer = NULL;
+static CDPlayerCompletionProc completionProc = NULL;
+static SDL_mutex *apiMutex = NULL;
+static SDL_sem *callbackSem;
+static SDL_CD* theCDROM;
+
+/*///////////////////////////////////////////////////////////////////////////
+ Prototypes
+ //////////////////////////////////////////////////////////////////////////*/
+
+#pragma mark -- Prototypes --
+
+static OSStatus CheckInit ();
+
+static void FilePlayNotificationHandler (void* inRefCon, OSStatus inStatus);
+
+static int RunCallBackThread (void* inRefCon);
+
+
+#pragma mark -- Public Functions --
+
+void Lock ()
+{
+ if (!apiMutex) {
+ apiMutex = SDL_CreateMutex();
+ }
+ SDL_mutexP(apiMutex);
+}
+
+void Unlock ()
+{
+ SDL_mutexV(apiMutex);
+}
+
+int DetectAudioCDVolumes(FSVolumeRefNum *volumes, int numVolumes)
+{
+ int volumeIndex;
+ int cdVolumeCount = 0;
+ OSStatus result = noErr;
+
+ for (volumeIndex = 1; result == noErr || result != nsvErr; volumeIndex++)
+ {
+ FSVolumeRefNum actualVolume;
+ FSVolumeInfo volumeInfo;
+
+ memset (&volumeInfo, 0, sizeof(volumeInfo));
+
+ result = FSGetVolumeInfo (kFSInvalidVolumeRefNum,
+ volumeIndex,
+ &actualVolume,
+ kFSVolInfoFSInfo,
+ &volumeInfo,
+ NULL,
+ NULL);
+
+ if (result == noErr)
+ {
+ if (volumeInfo.filesystemID == kAudioCDFilesystemID) /* It's an audio CD */
+ {
+ if (volumes != NULL && cdVolumeCount < numVolumes)
+ volumes[cdVolumeCount] = actualVolume;
+
+ cdVolumeCount++;
+ }
+ }
+ else
+ {
+ /* I'm commenting this out because it seems to be harmless */
+ /*SDL_SetError ("DetectAudioCDVolumes: FSGetVolumeInfo returned %d", result);*/
+ }
+ }
+
+ return cdVolumeCount;
+}
+
+int ReadTOCData (FSVolumeRefNum theVolume, SDL_CD *theCD)
+{
+ HFSUniStr255 dataForkName;
+ OSStatus theErr;
+ FSIORefNum forkRefNum;
+ SInt64 forkSize;
+ Ptr forkData = 0;
+ ByteCount actualRead;
+ CFDataRef dataRef = 0;
+ CFPropertyListRef propertyListRef = 0;
+ FSRefParam fsRefPB;
+ FSRef tocPlistFSRef;
+ FSRef rootRef;
+ const char* error = "Unspecified Error";
+ const UniChar uniName[] = { '.','T','O','C','.','p','l','i','s','t' };
+
+ theErr = FSGetVolumeInfo(theVolume, 0, 0, kFSVolInfoNone, 0, 0, &rootRef);
+ if(theErr != noErr) {
+ error = "FSGetVolumeInfo";
+ goto bail;
+ }
+
+ SDL_memset(&fsRefPB, '\0', sizeof (fsRefPB));
+
+ /* get stuff from .TOC.plist */
+ fsRefPB.ref = &rootRef;
+ fsRefPB.newRef = &tocPlistFSRef;
+ fsRefPB.nameLength = sizeof (uniName) / sizeof (uniName[0]);
+ fsRefPB.name = uniName;
+ fsRefPB.textEncodingHint = kTextEncodingUnknown;
+
+ theErr = PBMakeFSRefUnicodeSync (&fsRefPB);
+ if(theErr != noErr) {
+ error = "PBMakeFSRefUnicodeSync";
+ goto bail;
+ }
+
+ /* Load and parse the TOC XML data */
+
+ theErr = FSGetDataForkName (&dataForkName);
+ if (theErr != noErr) {
+ error = "FSGetDataForkName";
+ goto bail;
+ }
+
+ theErr = FSOpenFork (&tocPlistFSRef, dataForkName.length, dataForkName.unicode, fsRdPerm, &forkRefNum);
+ if (theErr != noErr) {
+ error = "FSOpenFork";
+ goto bail;
+ }
+
+ theErr = FSGetForkSize (forkRefNum, &forkSize);
+ if (theErr != noErr) {
+ error = "FSGetForkSize";
+ goto bail;
+ }
+
+ /* Allocate some memory for the XML data */
+ forkData = NewPtr (forkSize);
+ if(forkData == NULL) {
+ error = "NewPtr";
+ goto bail;
+ }
+
+ theErr = FSReadFork (forkRefNum, fsFromStart, 0 /* offset location */, forkSize, forkData, &actualRead);
+ if(theErr != noErr) {
+ error = "FSReadFork";
+ goto bail;
+ }
+
+ dataRef = CFDataCreate (kCFAllocatorDefault, (UInt8 *)forkData, forkSize);
+ if(dataRef == 0) {
+ error = "CFDataCreate";
+ goto bail;
+ }
+
+ propertyListRef = CFPropertyListCreateFromXMLData (kCFAllocatorDefault,
+ dataRef,
+ kCFPropertyListImmutable,
+ NULL);
+ if (propertyListRef == NULL) {
+ error = "CFPropertyListCreateFromXMLData";
+ goto bail;
+ }
+
+ /* Now we got the Property List in memory. Parse it. */
+
+ /* First, make sure the root item is a CFDictionary. If not, release and bail. */
+ if(CFGetTypeID(propertyListRef)== CFDictionaryGetTypeID())
+ {
+ CFDictionaryRef dictRef = (CFDictionaryRef)propertyListRef;
+
+ CFDataRef theRawTOCDataRef;
+ CFArrayRef theSessionArrayRef;
+ CFIndex numSessions;
+ CFIndex index;
+
+ /* This is how we get the Raw TOC Data */
+ theRawTOCDataRef = (CFDataRef)CFDictionaryGetValue (dictRef, CFSTR(kRawTOCDataString));
+
+ /* Get the session array info. */
+ theSessionArrayRef = (CFArrayRef)CFDictionaryGetValue (dictRef, CFSTR(kSessionsString));
+
+ /* Find out how many sessions there are. */
+ numSessions = CFArrayGetCount (theSessionArrayRef);
+
+ /* Initialize the total number of tracks to 0 */
+ theCD->numtracks = 0;
+
+ /* Iterate over all sessions, collecting the track data */
+ for(index = 0; index < numSessions; index++)
+ {
+ CFDictionaryRef theSessionDict;
+ CFNumberRef leadoutBlock;
+ CFArrayRef trackArray;
+ CFIndex numTracks;
+ CFIndex trackIndex;
+ UInt32 value = 0;
+
+ theSessionDict = (CFDictionaryRef) CFArrayGetValueAtIndex (theSessionArrayRef, index);
+ leadoutBlock = (CFNumberRef) CFDictionaryGetValue (theSessionDict, CFSTR(kLeadoutBlockString));
+
+ trackArray = (CFArrayRef)CFDictionaryGetValue (theSessionDict, CFSTR(kTrackArrayString));
+
+ numTracks = CFArrayGetCount (trackArray);
+
+ for(trackIndex = 0; trackIndex < numTracks; trackIndex++) {
+
+ CFDictionaryRef theTrackDict;
+ CFNumberRef trackNumber;
+ CFNumberRef sessionNumber;
+ CFNumberRef startBlock;
+ CFBooleanRef isDataTrack;
+ UInt32 value;
+
+ theTrackDict = (CFDictionaryRef) CFArrayGetValueAtIndex (trackArray, trackIndex);
+
+ trackNumber = (CFNumberRef) CFDictionaryGetValue (theTrackDict, CFSTR(kPointKeyString));
+ sessionNumber = (CFNumberRef) CFDictionaryGetValue (theTrackDict, CFSTR(kSessionNumberKeyString));
+ startBlock = (CFNumberRef) CFDictionaryGetValue (theTrackDict, CFSTR(kStartBlockKeyString));
+ isDataTrack = (CFBooleanRef) CFDictionaryGetValue (theTrackDict, CFSTR(kDataKeyString));
+
+ /* Fill in the SDL_CD struct */
+ int idx = theCD->numtracks++;
+
+ CFNumberGetValue (trackNumber, kCFNumberSInt32Type, &value);
+ theCD->track[idx].id = value;
+
+ CFNumberGetValue (startBlock, kCFNumberSInt32Type, &value);
+ theCD->track[idx].offset = value;
+
+ theCD->track[idx].type = (isDataTrack == kCFBooleanTrue) ? SDL_DATA_TRACK : SDL_AUDIO_TRACK;
+
+ /* Since the track lengths are not stored in .TOC.plist we compute them. */
+ if (trackIndex > 0) {
+ theCD->track[idx-1].length = theCD->track[idx].offset - theCD->track[idx-1].offset;
+ }
+ }
+
+ /* Compute the length of the last track */
+ CFNumberGetValue (leadoutBlock, kCFNumberSInt32Type, &value);
+
+ theCD->track[theCD->numtracks-1].length =
+ value - theCD->track[theCD->numtracks-1].offset;
+
+ /* Set offset to leadout track */
+ theCD->track[theCD->numtracks].offset = value;
+ }
+
+ }
+
+ theErr = 0;
+ goto cleanup;
+bail:
+ SDL_SetError ("ReadTOCData: %s returned %d", error, theErr);
+ theErr = -1;
+cleanup:
+
+ if (propertyListRef != NULL)
+ CFRelease(propertyListRef);
+ if (dataRef != NULL)
+ CFRelease(dataRef);
+ if (forkData != NULL)
+ DisposePtr(forkData);
+
+ FSCloseFork (forkRefNum);
+
+ return theErr;
+}
+
+int ListTrackFiles (FSVolumeRefNum theVolume, FSRef *trackFiles, int numTracks)
+{
+ OSStatus result = -1;
+ FSIterator iterator;
+ ItemCount actualObjects;
+ FSRef rootDirectory;
+ FSRef ref;
+ HFSUniStr255 nameStr;
+
+ result = FSGetVolumeInfo (theVolume,
+ 0,
+ NULL,
+ kFSVolInfoFSInfo,
+ NULL,
+ NULL,
+ &rootDirectory);
+
+ if (result != noErr) {
+ SDL_SetError ("ListTrackFiles: FSGetVolumeInfo returned %d", result);
+ return result;
+ }
+
+ result = FSOpenIterator (&rootDirectory, kFSIterateFlat, &iterator);
+ if (result == noErr) {
+ do
+ {
+ result = FSGetCatalogInfoBulk (iterator, 1, &actualObjects,
+ NULL, kFSCatInfoNone, NULL, &ref, NULL, &nameStr);
+ if (result == noErr) {
+
+ CFStringRef name;
+ name = CFStringCreateWithCharacters (NULL, nameStr.unicode, nameStr.length);
+
+ /* Look for .aiff extension */
+ if (CFStringHasSuffix (name, CFSTR(".aiff")) ||
+ CFStringHasSuffix (name, CFSTR(".cdda"))) {
+
+ /* Extract the track id from the filename */
+ int trackID = 0, i = 0;
+ while (i < nameStr.length && !isdigit(nameStr.unicode[i])) {
+ ++i;
+ }
+ while (i < nameStr.length && isdigit(nameStr.unicode[i])) {
+ trackID = 10 * trackID +(nameStr.unicode[i] - '0');
+ ++i;
+ }
+
+ #if DEBUG_CDROM
+ printf("Found AIFF for track %d: '%s'\n", trackID,
+ CFStringGetCStringPtr (name, CFStringGetSystemEncoding()));
+ #endif
+
+ /* Track ID's start at 1, but we want to start at 0 */
+ trackID--;
+
+ assert(0 <= trackID && trackID <= SDL_MAX_TRACKS);
+
+ if (trackID < numTracks)
+ memcpy (&trackFiles[trackID], &ref, sizeof(FSRef));
+ }
+ CFRelease (name);
+ }
+ } while(noErr == result);
+ FSCloseIterator (iterator);
+ }
+
+ return 0;
+}
+
+int LoadFile (const FSRef *ref, int startFrame, int stopFrame)
+{
+ int error = -1;
+
+ if (CheckInit () < 0)
+ goto bail;
+
+ /* release any currently playing file */
+ if (ReleaseFile () < 0)
+ goto bail;
+
+ #if DEBUG_CDROM
+ printf ("LoadFile: %d %d\n", startFrame, stopFrame);
+ #endif
+
+ /*try {*/
+
+ /* create a new player, and attach to the audio unit */
+
+ thePlayer = new_AudioFilePlayer(ref);
+ if (thePlayer == NULL) {
+ SDL_SetError ("LoadFile: Could not create player");
+ return -3; /*throw (-3);*/
+ }
+
+ if (!thePlayer->SetDestination(thePlayer, &theUnit))
+ goto bail;
+
+ if (startFrame >= 0)
+ thePlayer->SetStartFrame (thePlayer, startFrame);
+
+ if (stopFrame >= 0 && stopFrame > startFrame)
+ thePlayer->SetStopFrame (thePlayer, stopFrame);
+
+ /* we set the notifier later */
+ /*thePlayer->SetNotifier(thePlayer, FilePlayNotificationHandler, NULL);*/
+
+ if (!thePlayer->Connect(thePlayer))
+ goto bail;
+
+ #if DEBUG_CDROM
+ thePlayer->Print(thePlayer);
+ fflush (stdout);
+ #endif
+ /*}
+ catch (...)
+ {
+ goto bail;
+ }*/
+
+ error = 0;
+
+ bail:
+ return error;
+}
+
+int ReleaseFile ()
+{
+ int error = -1;
+
+ /* (Don't see any way that the original C++ code could throw here.) --ryan. */
+ /*try {*/
+ if (thePlayer != NULL) {
+
+ thePlayer->Disconnect(thePlayer);
+
+ delete_AudioFilePlayer(thePlayer);
+
+ thePlayer = NULL;
+ }
+ /*}
+ catch (...)
+ {
+ goto bail;
+ }*/
+
+ error = 0;
+
+/* bail: */
+ return error;
+}
+
+int PlayFile ()
+{
+ OSStatus result = -1;
+
+ if (CheckInit () < 0)
+ goto bail;
+
+ /*try {*/
+
+ // start processing of the audio unit
+ result = AudioOutputUnitStart (theUnit);
+ if (result) goto bail; //THROW_RESULT("PlayFile: AudioOutputUnitStart")
+
+ /*}
+ catch (...)
+ {
+ goto bail;
+ }*/
+
+ result = 0;
+
+bail:
+ return result;
+}
+
+int PauseFile ()
+{
+ OSStatus result = -1;
+
+ if (CheckInit () < 0)
+ goto bail;
+
+ /*try {*/
+
+ /* stop processing the audio unit */
+ result = AudioOutputUnitStop (theUnit);
+ if (result) goto bail; /*THROW_RESULT("PauseFile: AudioOutputUnitStop")*/
+ /*}
+ catch (...)
+ {
+ goto bail;
+ }*/
+
+ result = 0;
+bail:
+ return result;
+}
+
+void SetCompletionProc (CDPlayerCompletionProc proc, SDL_CD *cdrom)
+{
+ assert(thePlayer != NULL);
+
+ theCDROM = cdrom;
+ completionProc = proc;
+ thePlayer->SetNotifier (thePlayer, FilePlayNotificationHandler, cdrom);
+}
+
+int GetCurrentFrame ()
+{
+ int frame;
+
+ if (thePlayer == NULL)
+ frame = 0;
+ else
+ frame = thePlayer->GetCurrentFrame (thePlayer);
+
+ return frame;
+}
+
+
+#pragma mark -- Private Functions --
+
+static OSStatus CheckInit ()
+{
+ if (playBackWasInit)
+ return 0;
+
+ OSStatus result = noErr;
+
+ /* Create the callback semaphore */
+ callbackSem = SDL_CreateSemaphore(0);
+
+ /* Start callback thread */
+ SDL_CreateThread(RunCallBackThread, NULL);
+
+ { /*try {*/
+ ComponentDescription desc;
+
+ desc.componentType = kAudioUnitType_Output;
+ desc.componentSubType = kAudioUnitSubType_DefaultOutput;
+ desc.componentManufacturer = kAudioUnitManufacturer_Apple;
+ desc.componentFlags = 0;
+ desc.componentFlagsMask = 0;
+
+ Component comp = FindNextComponent (NULL, &desc);
+ if (comp == NULL) {
+ SDL_SetError ("CheckInit: FindNextComponent returned NULL");
+ if (result) return -1; //throw(internalComponentErr);
+ }
+
+ result = OpenAComponent (comp, &theUnit);
+ if (result) return -1; //THROW_RESULT("CheckInit: OpenAComponent")
+
+ // you need to initialize the output unit before you set it as a destination
+ result = AudioUnitInitialize (theUnit);
+ if (result) return -1; //THROW_RESULT("CheckInit: AudioUnitInitialize")
+
+
+ playBackWasInit = true;
+ }
+ /*catch (...)
+ {
+ return -1;
+ }*/
+
+ return 0;
+}
+
+static void FilePlayNotificationHandler(void * inRefCon, OSStatus inStatus)
+{
+ if (inStatus == kAudioFilePlay_FileIsFinished) {
+
+ /* notify non-CA thread to perform the callback */
+ SDL_SemPost(callbackSem);
+
+ } else if (inStatus == kAudioFilePlayErr_FilePlayUnderrun) {
+
+ SDL_SetError ("CDPlayer Notification: buffer underrun");
+ } else if (inStatus == kAudioFilePlay_PlayerIsUninitialized) {
+
+ SDL_SetError ("CDPlayer Notification: player is uninitialized");
+ } else {
+
+ SDL_SetError ("CDPlayer Notification: unknown error %ld", inStatus);
+ }
+}
+
+static int RunCallBackThread (void *param)
+{
+ for (;;) {
+
+ SDL_SemWait(callbackSem);
+
+ if (completionProc && theCDROM) {
+ #if DEBUG_CDROM
+ printf ("callback!\n");
+ #endif
+ (*completionProc)(theCDROM);
+ } else {
+ #if DEBUG_CDROM
+ printf ("callback?\n");
+ #endif
+ }
+ }
+
+ #if DEBUG_CDROM
+ printf ("thread dying now...\n");
+ #endif
+
+ return 0;
+}
+
+/*}; // extern "C" */
diff --git a/distrib/sdl-1.2.15/src/cdrom/macosx/CDPlayer.h b/distrib/sdl-1.2.15/src/cdrom/macosx/CDPlayer.h
new file mode 100644
index 0000000..be1ac18
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/macosx/CDPlayer.h
@@ -0,0 +1,69 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef __CDPlayer__H__
+#define __CDPlayer__H__ 1
+
+#include <string.h>
+
+#include <Carbon/Carbon.h>
+#include <CoreFoundation/CoreFoundation.h>
+#include <AudioUnit/AudioUnit.h>
+
+#include "SDL.h"
+#include "SDL_thread.h"
+#include "SDL_mutex.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void (*CDPlayerCompletionProc)(SDL_CD *cdrom) ;
+
+void Lock ();
+
+void Unlock();
+
+int LoadFile (const FSRef *ref, int startFrame, int endFrame); /* pass -1 to do nothing */
+
+int ReleaseFile ();
+
+int PlayFile ();
+
+int PauseFile ();
+
+void SetCompletionProc (CDPlayerCompletionProc proc, SDL_CD *cdrom);
+
+int ReadTOCData (FSVolumeRefNum theVolume, SDL_CD *theCD);
+
+int ListTrackFiles (FSVolumeRefNum theVolume, FSRef *trackFiles, int numTracks);
+
+int DetectAudioCDVolumes (FSVolumeRefNum *volumes, int numVolumes);
+
+int GetCurrentFrame ();
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif /* __CD_Player__H__ */
diff --git a/distrib/sdl-1.2.15/src/cdrom/macosx/SDLOSXCAGuard.c b/distrib/sdl-1.2.15/src/cdrom/macosx/SDLOSXCAGuard.c
new file mode 100644
index 0000000..e8caf1b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/macosx/SDLOSXCAGuard.c
@@ -0,0 +1,199 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ Note: This file hasn't been modified so technically we have to keep the disclaimer :-(
+
+ Copyright: © Copyright 2002 Apple Computer, Inc. All rights reserved.
+
+ Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
+ ("Apple") in consideration of your agreement to the following terms, and your
+ use, installation, modification or redistribution of this Apple software
+ constitutes acceptance of these terms. If you do not agree with these terms,
+ please do not use, install, modify or redistribute this Apple software.
+
+ In consideration of your agreement to abide by the following terms, and subject
+ to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs
+ copyrights in this original Apple software (the "Apple Software"), to use,
+ reproduce, modify and redistribute the Apple Software, with or without
+ modifications, in source and/or binary forms; provided that if you redistribute
+ the Apple Software in its entirety and without modifications, you must retain
+ this notice and the following text and disclaimers in all such redistributions of
+ the Apple Software. Neither the name, trademarks, service marks or logos of
+ Apple Computer, Inc. may be used to endorse or promote products derived from the
+ Apple Software without specific prior written permission from Apple. Except as
+ expressly stated in this notice, no other rights or licenses, express or implied,
+ are granted by Apple herein, including but not limited to any patent rights that
+ may be infringed by your derivative works or by other works in which the Apple
+ Software may be incorporated.
+
+ The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
+ WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
+ WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
+ COMBINATION WITH YOUR PRODUCTS.
+
+ IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
+ OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
+ (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/*=============================================================================
+ CAGuard.cp
+
+=============================================================================*/
+
+/*=============================================================================
+ Includes
+ =============================================================================*/
+
+/*
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+*/
+#include "SDL_stdinc.h"
+
+/*#define NDEBUG 1*/
+/*
+#include <assert.h>
+*/
+#define assert(X)
+
+
+#include "SDLOSXCAGuard.h"
+
+/*#warning Need a try-based Locker too*/
+/*=============================================================================
+ SDLOSXCAGuard
+ =============================================================================*/
+
+static int SDLOSXCAGuard_Lock(SDLOSXCAGuard *cag)
+{
+ int theAnswer = 0;
+
+ if(pthread_self() != cag->mOwner)
+ {
+ OSStatus theError = pthread_mutex_lock(&cag->mMutex);
+ (void)theError;
+ assert(theError == 0);
+ cag->mOwner = pthread_self();
+ theAnswer = 1;
+ }
+
+ return theAnswer;
+}
+
+static void SDLOSXCAGuard_Unlock(SDLOSXCAGuard *cag)
+{
+ OSStatus theError;
+ assert(pthread_self() == cag->mOwner);
+
+ cag->mOwner = 0;
+ theError = pthread_mutex_unlock(&cag->mMutex);
+ (void)theError;
+ assert(theError == 0);
+}
+
+static int SDLOSXCAGuard_Try (SDLOSXCAGuard *cag, int *outWasLocked)
+{
+ int theAnswer = 0;
+ *outWasLocked = 0;
+
+ if (pthread_self() == cag->mOwner) {
+ theAnswer = 1;
+ *outWasLocked = 0;
+ } else {
+ OSStatus theError = pthread_mutex_trylock(&cag->mMutex);
+ if (theError == 0) {
+ cag->mOwner = pthread_self();
+ theAnswer = 1;
+ *outWasLocked = 1;
+ }
+ }
+
+ return theAnswer;
+}
+
+static void SDLOSXCAGuard_Wait(SDLOSXCAGuard *cag)
+{
+ OSStatus theError;
+ assert(pthread_self() == cag->mOwner);
+
+ cag->mOwner = 0;
+
+ theError = pthread_cond_wait(&cag->mCondVar, &cag->mMutex);
+ (void)theError;
+ assert(theError == 0);
+ cag->mOwner = pthread_self();
+}
+
+static void SDLOSXCAGuard_Notify(SDLOSXCAGuard *cag)
+{
+ OSStatus theError = pthread_cond_signal(&cag->mCondVar);
+ (void)theError;
+ assert(theError == 0);
+}
+
+
+SDLOSXCAGuard *new_SDLOSXCAGuard(void)
+{
+ OSStatus theError;
+ SDLOSXCAGuard *cag = (SDLOSXCAGuard *) SDL_malloc(sizeof (SDLOSXCAGuard));
+ if (cag == NULL)
+ return NULL;
+ SDL_memset(cag, '\0', sizeof (*cag));
+
+ #define SET_SDLOSXCAGUARD_METHOD(m) cag->m = SDLOSXCAGuard_##m
+ SET_SDLOSXCAGUARD_METHOD(Lock);
+ SET_SDLOSXCAGUARD_METHOD(Unlock);
+ SET_SDLOSXCAGUARD_METHOD(Try);
+ SET_SDLOSXCAGUARD_METHOD(Wait);
+ SET_SDLOSXCAGUARD_METHOD(Notify);
+ #undef SET_SDLOSXCAGUARD_METHOD
+
+ theError = pthread_mutex_init(&cag->mMutex, NULL);
+ (void)theError;
+ assert(theError == 0);
+
+ theError = pthread_cond_init(&cag->mCondVar, NULL);
+ (void)theError;
+ assert(theError == 0);
+
+ cag->mOwner = 0;
+ return cag;
+}
+
+void delete_SDLOSXCAGuard(SDLOSXCAGuard *cag)
+{
+ if (cag != NULL)
+ {
+ pthread_mutex_destroy(&cag->mMutex);
+ pthread_cond_destroy(&cag->mCondVar);
+ SDL_free(cag);
+ }
+}
+
diff --git a/distrib/sdl-1.2.15/src/cdrom/macosx/SDLOSXCAGuard.h b/distrib/sdl-1.2.15/src/cdrom/macosx/SDLOSXCAGuard.h
new file mode 100644
index 0000000..f22c695
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/macosx/SDLOSXCAGuard.h
@@ -0,0 +1,116 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ Note: This file hasn't been modified so technically we have to keep the disclaimer :-(
+
+
+ Copyright: © Copyright 2002 Apple Computer, Inc. All rights reserved.
+
+ Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
+ ("Apple") in consideration of your agreement to the following terms, and your
+ use, installation, modification or redistribution of this Apple software
+ constitutes acceptance of these terms. If you do not agree with these terms,
+ please do not use, install, modify or redistribute this Apple software.
+
+ In consideration of your agreement to abide by the following terms, and subject
+ to these terms, Apple grants you a personal, non-exclusive license, under AppleÕs
+ copyrights in this original Apple software (the "Apple Software"), to use,
+ reproduce, modify and redistribute the Apple Software, with or without
+ modifications, in source and/or binary forms; provided that if you redistribute
+ the Apple Software in its entirety and without modifications, you must retain
+ this notice and the following text and disclaimers in all such redistributions of
+ the Apple Software. Neither the name, trademarks, service marks or logos of
+ Apple Computer, Inc. may be used to endorse or promote products derived from the
+ Apple Software without specific prior written permission from Apple. Except as
+ expressly stated in this notice, no other rights or licenses, express or implied,
+ are granted by Apple herein, including but not limited to any patent rights that
+ may be infringed by your derivative works or by other works in which the Apple
+ Software may be incorporated.
+
+ The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
+ WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
+ WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
+ COMBINATION WITH YOUR PRODUCTS.
+
+ IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
+ OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
+ (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/*=============================================================================
+ CAGuard.h
+
+=============================================================================*/
+#if !defined(__CAGuard_h__)
+#define __CAGuard_h__
+
+/*=============================================================================
+ Includes
+ =============================================================================*/
+
+#include <CoreAudio/CoreAudioTypes.h>
+#include <pthread.h>
+
+
+/*=============================================================================
+ CAGuard
+
+ This is your typical mutex with signalling implemented via pthreads.
+ Lock() will return true if and only if the guard is locked on that call.
+ A thread that already has the guard will receive 'false' if it locks it
+ again. Use of the stack-based CAGuard::Locker class is highly recommended
+ to properly manage the recursive nesting. The Wait calls with timeouts
+ will return true if and only if the timeout period expired. They will
+ return false if they receive notification any other way.
+ =============================================================================*/
+
+typedef struct S_SDLOSXCAGuard
+{
+
+/* Construction/Destruction */
+/*public:*/
+/* Actions */
+/*public:*/
+ int (*Lock)(struct S_SDLOSXCAGuard *cag);
+ void (*Unlock)(struct S_SDLOSXCAGuard *cag);
+ int (*Try)(struct S_SDLOSXCAGuard *cag, int *outWasLocked); /* returns true if lock is free, false if not */
+ void (*Wait)(struct S_SDLOSXCAGuard *cag);
+ void (*Notify)(struct S_SDLOSXCAGuard *cag);
+
+/* Implementation */
+/*protected:*/
+ pthread_mutex_t mMutex;
+ pthread_cond_t mCondVar;
+ pthread_t mOwner;
+} SDLOSXCAGuard;
+
+SDLOSXCAGuard *new_SDLOSXCAGuard(void);
+void delete_SDLOSXCAGuard(SDLOSXCAGuard *cag);
+
+#endif
+
diff --git a/distrib/sdl-1.2.15/src/cdrom/macosx/SDL_syscdrom.c b/distrib/sdl-1.2.15/src/cdrom/macosx/SDL_syscdrom.c
new file mode 100644
index 0000000..5018750
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/macosx/SDL_syscdrom.c
@@ -0,0 +1,514 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_CDROM_MACOSX
+
+#include "SDL_syscdrom_c.h"
+
+#pragma mark -- Globals --
+
+static FSRef** tracks;
+static FSVolumeRefNum* volumes;
+static CDstatus status;
+static int nextTrackFrame;
+static int nextTrackFramesRemaining;
+static int fakeCD;
+static int currentTrack;
+static int didReadTOC;
+static int cacheTOCNumTracks;
+static int currentDrive; /* Only allow 1 drive in use at a time */
+
+#pragma mark -- Prototypes --
+
+static const char *SDL_SYS_CDName (int drive);
+static int SDL_SYS_CDOpen (int drive);
+static int SDL_SYS_CDGetTOC (SDL_CD *cdrom);
+static CDstatus SDL_SYS_CDStatus (SDL_CD *cdrom, int *position);
+static int SDL_SYS_CDPlay (SDL_CD *cdrom, int start, int length);
+static int SDL_SYS_CDPause (SDL_CD *cdrom);
+static int SDL_SYS_CDResume (SDL_CD *cdrom);
+static int SDL_SYS_CDStop (SDL_CD *cdrom);
+static int SDL_SYS_CDEject (SDL_CD *cdrom);
+static void SDL_SYS_CDClose (SDL_CD *cdrom);
+
+#pragma mark -- Helper Functions --
+
+/* Read a list of tracks from the volume */
+static int LoadTracks (SDL_CD *cdrom)
+{
+ /* Check if tracks are already loaded */
+ if ( tracks[cdrom->id] != NULL )
+ return 0;
+
+ /* Allocate memory for tracks */
+ tracks[cdrom->id] = (FSRef*) SDL_calloc (1, sizeof(**tracks) * cdrom->numtracks);
+ if (tracks[cdrom->id] == NULL) {
+ SDL_OutOfMemory ();
+ return -1;
+ }
+
+ /* Load tracks */
+ if (ListTrackFiles (volumes[cdrom->id], tracks[cdrom->id], cdrom->numtracks) < 0)
+ return -1;
+
+ return 0;
+}
+
+/* Find a file for a given start frame and length */
+static FSRef* GetFileForOffset (SDL_CD *cdrom, int start, int length, int *outStartFrame, int *outStopFrame)
+{
+ int i;
+
+ for (i = 0; i < cdrom->numtracks; i++) {
+
+ if (cdrom->track[i].offset <= start &&
+ start < (cdrom->track[i].offset + cdrom->track[i].length))
+ break;
+ }
+
+ if (i == cdrom->numtracks)
+ return NULL;
+
+ currentTrack = i;
+
+ *outStartFrame = start - cdrom->track[i].offset;
+
+ if ((*outStartFrame + length) < cdrom->track[i].length) {
+ *outStopFrame = *outStartFrame + length;
+ length = 0;
+ nextTrackFrame = -1;
+ nextTrackFramesRemaining = -1;
+ }
+ else {
+ *outStopFrame = -1;
+ length -= cdrom->track[i].length - *outStartFrame;
+ nextTrackFrame = cdrom->track[i+1].offset;
+ nextTrackFramesRemaining = length;
+ }
+
+ return &tracks[cdrom->id][i];
+}
+
+/* Setup another file for playback, or stop playback (called from another thread) */
+static void CompletionProc (SDL_CD *cdrom)
+{
+
+ Lock ();
+
+ if (nextTrackFrame > 0 && nextTrackFramesRemaining > 0) {
+
+ /* Load the next file to play */
+ int startFrame, stopFrame;
+ FSRef *file;
+
+ PauseFile ();
+ ReleaseFile ();
+
+ file = GetFileForOffset (cdrom, nextTrackFrame,
+ nextTrackFramesRemaining, &startFrame, &stopFrame);
+
+ if (file == NULL) {
+ status = CD_STOPPED;
+ Unlock ();
+ return;
+ }
+
+ LoadFile (file, startFrame, stopFrame);
+
+ SetCompletionProc (CompletionProc, cdrom);
+
+ PlayFile ();
+ }
+ else {
+
+ /* Release the current file */
+ PauseFile ();
+ ReleaseFile ();
+ status = CD_STOPPED;
+ }
+
+ Unlock ();
+}
+
+
+#pragma mark -- Driver Functions --
+
+/* Initialize */
+int SDL_SYS_CDInit (void)
+{
+ /* Initialize globals */
+ volumes = NULL;
+ tracks = NULL;
+ status = CD_STOPPED;
+ nextTrackFrame = -1;
+ nextTrackFramesRemaining = -1;
+ fakeCD = SDL_FALSE;
+ currentTrack = -1;
+ didReadTOC = SDL_FALSE;
+ cacheTOCNumTracks = -1;
+ currentDrive = -1;
+
+ /* Fill in function pointers */
+ SDL_CDcaps.Name = SDL_SYS_CDName;
+ SDL_CDcaps.Open = SDL_SYS_CDOpen;
+ SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
+ SDL_CDcaps.Status = SDL_SYS_CDStatus;
+ SDL_CDcaps.Play = SDL_SYS_CDPlay;
+ SDL_CDcaps.Pause = SDL_SYS_CDPause;
+ SDL_CDcaps.Resume = SDL_SYS_CDResume;
+ SDL_CDcaps.Stop = SDL_SYS_CDStop;
+ SDL_CDcaps.Eject = SDL_SYS_CDEject;
+ SDL_CDcaps.Close = SDL_SYS_CDClose;
+
+ /*
+ Read the list of "drives"
+
+ This is currently a hack that infers drives from
+ mounted audio CD volumes, rather than
+ actual CD-ROM devices - which means it may not
+ act as expected sometimes.
+ */
+
+ /* Find out how many cd volumes are mounted */
+ SDL_numcds = DetectAudioCDVolumes (NULL, 0);
+
+ /*
+ If there are no volumes, fake a cd device
+ so tray empty can be reported.
+ */
+ if (SDL_numcds == 0) {
+
+ fakeCD = SDL_TRUE;
+ SDL_numcds = 1;
+ status = CD_TRAYEMPTY;
+
+ return 0;
+ }
+
+ /* Allocate space for volumes */
+ volumes = (FSVolumeRefNum*) SDL_calloc (1, sizeof(*volumes) * SDL_numcds);
+ if (volumes == NULL) {
+ SDL_OutOfMemory ();
+ return -1;
+ }
+
+ /* Allocate space for tracks */
+ tracks = (FSRef**) SDL_calloc (1, sizeof(*tracks) * (SDL_numcds + 1));
+ if (tracks == NULL) {
+ SDL_OutOfMemory ();
+ return -1;
+ }
+
+ /* Mark the end of the tracks array */
+ tracks[ SDL_numcds ] = (FSRef*)-1;
+
+ /*
+ Redetect, now save all volumes for later
+ Update SDL_numcds just in case it changed
+ */
+ {
+ int numVolumes = SDL_numcds;
+
+ SDL_numcds = DetectAudioCDVolumes (volumes, numVolumes);
+
+ /* If more cds suddenly show up, ignore them */
+ if (SDL_numcds > numVolumes) {
+ SDL_SetError ("Some CD's were added but they will be ignored");
+ SDL_numcds = numVolumes;
+ }
+ }
+
+ return 0;
+}
+
+/* Shutdown and cleanup */
+void SDL_SYS_CDQuit(void)
+{
+ ReleaseFile();
+
+ if (volumes != NULL)
+ free (volumes);
+
+ if (tracks != NULL) {
+
+ FSRef **ptr;
+ for (ptr = tracks; *ptr != (FSRef*)-1; ptr++)
+ if (*ptr != NULL)
+ free (*ptr);
+
+ free (tracks);
+ }
+}
+
+/* Get the Unix disk name of the volume */
+static const char *SDL_SYS_CDName (int drive)
+{
+ /*
+ * !!! FIXME: PBHGetVolParmsSync() is gone in 10.6,
+ * !!! FIXME: replaced with FSGetVolumeParms(), which
+ * !!! FIXME: isn't available before 10.5. :/
+ */
+ return "Mac OS X CD-ROM Device";
+
+#if 0
+ OSStatus err = noErr;
+ HParamBlockRec pb;
+ GetVolParmsInfoBuffer volParmsInfo;
+
+ if (fakeCD)
+ return "Fake CD-ROM Device";
+
+ pb.ioParam.ioNamePtr = NULL;
+ pb.ioParam.ioVRefNum = volumes[drive];
+ pb.ioParam.ioBuffer = (Ptr)&volParmsInfo;
+ pb.ioParam.ioReqCount = (SInt32)sizeof(volParmsInfo);
+ err = PBHGetVolParmsSync(&pb);
+
+ if (err != noErr) {
+ SDL_SetError ("PBHGetVolParmsSync returned %d", err);
+ return NULL;
+ }
+
+ return volParmsInfo.vMDeviceID;
+#endif
+}
+
+/* Open the "device" */
+static int SDL_SYS_CDOpen (int drive)
+{
+ /* Only allow 1 device to be open */
+ if (currentDrive >= 0) {
+ SDL_SetError ("Only one cdrom is supported");
+ return -1;
+ }
+ else
+ currentDrive = drive;
+
+ return drive;
+}
+
+/* Get the table of contents */
+static int SDL_SYS_CDGetTOC (SDL_CD *cdrom)
+{
+ if (fakeCD) {
+ SDL_SetError (kErrorFakeDevice);
+ return -1;
+ }
+
+ if (didReadTOC) {
+ cdrom->numtracks = cacheTOCNumTracks;
+ return 0;
+ }
+
+
+ ReadTOCData (volumes[cdrom->id], cdrom);
+ didReadTOC = SDL_TRUE;
+ cacheTOCNumTracks = cdrom->numtracks;
+
+ return 0;
+}
+
+/* Get CD-ROM status */
+static CDstatus SDL_SYS_CDStatus (SDL_CD *cdrom, int *position)
+{
+ if (position) {
+ int trackFrame;
+
+ Lock ();
+ trackFrame = GetCurrentFrame ();
+ Unlock ();
+
+ *position = cdrom->track[currentTrack].offset + trackFrame;
+ }
+
+ return status;
+}
+
+/* Start playback */
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
+{
+ int startFrame, stopFrame;
+ FSRef *ref;
+
+ if (fakeCD) {
+ SDL_SetError (kErrorFakeDevice);
+ return -1;
+ }
+
+ Lock();
+
+ if (LoadTracks (cdrom) < 0)
+ return -2;
+
+ if (PauseFile () < 0)
+ return -3;
+
+ if (ReleaseFile () < 0)
+ return -4;
+
+ ref = GetFileForOffset (cdrom, start, length, &startFrame, &stopFrame);
+ if (ref == NULL) {
+ SDL_SetError ("SDL_SYS_CDPlay: No file for start=%d, length=%d", start, length);
+ return -5;
+ }
+
+ if (LoadFile (ref, startFrame, stopFrame) < 0)
+ return -6;
+
+ SetCompletionProc (CompletionProc, cdrom);
+
+ if (PlayFile () < 0)
+ return -7;
+
+ status = CD_PLAYING;
+
+ Unlock();
+
+ return 0;
+}
+
+/* Pause playback */
+static int SDL_SYS_CDPause(SDL_CD *cdrom)
+{
+ if (fakeCD) {
+ SDL_SetError (kErrorFakeDevice);
+ return -1;
+ }
+
+ Lock ();
+
+ if (PauseFile () < 0) {
+ Unlock ();
+ return -2;
+ }
+
+ status = CD_PAUSED;
+
+ Unlock ();
+
+ return 0;
+}
+
+/* Resume playback */
+static int SDL_SYS_CDResume(SDL_CD *cdrom)
+{
+ if (fakeCD) {
+ SDL_SetError (kErrorFakeDevice);
+ return -1;
+ }
+
+ Lock ();
+
+ if (PlayFile () < 0) {
+ Unlock ();
+ return -2;
+ }
+
+ status = CD_PLAYING;
+
+ Unlock ();
+
+ return 0;
+}
+
+/* Stop playback */
+static int SDL_SYS_CDStop(SDL_CD *cdrom)
+{
+ if (fakeCD) {
+ SDL_SetError (kErrorFakeDevice);
+ return -1;
+ }
+
+ Lock ();
+
+ if (PauseFile () < 0) {
+ Unlock ();
+ return -2;
+ }
+
+ if (ReleaseFile () < 0) {
+ Unlock ();
+ return -3;
+ }
+
+ status = CD_STOPPED;
+
+ Unlock ();
+
+ return 0;
+}
+
+/* Eject the CD-ROM (Unmount the volume) */
+static int SDL_SYS_CDEject(SDL_CD *cdrom)
+{
+ OSStatus err;
+ pid_t dissenter;
+
+ if (fakeCD) {
+ SDL_SetError (kErrorFakeDevice);
+ return -1;
+ }
+
+ Lock ();
+
+ if (PauseFile () < 0) {
+ Unlock ();
+ return -2;
+ }
+
+ if (ReleaseFile () < 0) {
+ Unlock ();
+ return -3;
+ }
+
+ status = CD_STOPPED;
+
+ /* Eject the volume */
+ err = FSEjectVolumeSync(volumes[cdrom->id], kNilOptions, &dissenter);
+
+ if (err != noErr) {
+ Unlock ();
+ SDL_SetError ("PBUnmountVol returned %d", err);
+ return -4;
+ }
+
+ status = CD_TRAYEMPTY;
+
+ /* Invalidate volume and track info */
+ volumes[cdrom->id] = 0;
+ free (tracks[cdrom->id]);
+ tracks[cdrom->id] = NULL;
+
+ Unlock ();
+
+ return 0;
+}
+
+/* Close the CD-ROM */
+static void SDL_SYS_CDClose(SDL_CD *cdrom)
+{
+ currentDrive = -1;
+ return;
+}
+
+#endif /* SDL_CDROM_MACOSX */
diff --git a/distrib/sdl-1.2.15/src/cdrom/macosx/SDL_syscdrom_c.h b/distrib/sdl-1.2.15/src/cdrom/macosx/SDL_syscdrom_c.h
new file mode 100644
index 0000000..589c589
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/macosx/SDL_syscdrom_c.h
@@ -0,0 +1,136 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This is the Mac OS X / CoreAudio specific header for the SDL CD-ROM API
+ Contributed by Darrell Walisser and Max Horn
+ */
+
+/***********************************************************************************
+ Implementation Notes
+ *********************
+
+ This code has several limitations currently (all of which are proabaly fixable):
+
+ 1. A CD-ROM device is inferred from a mounted cdfs volume, so device 0 is
+ not necessarily the first CD-ROM device on the system. (Somewhat easy to fix
+ by useing the device name from the volume id's to reorder the volumes)
+
+ 2. You can only open and control 1 CD-ROM device at a time. (Challenging to fix,
+ due to extensive code restructuring)
+
+ 3. The status reported by SDL_CDStatus only changes to from CD_PLAYING to CD_STOPPED in
+ 1-second intervals (because the audio is buffered in 1-second chunks) If
+ the audio data is less than 1 second, the remainder is filled with silence.
+
+ If you need to play sequences back-to-back that are less that 1 second long,
+ use the frame position to determine when to play the next sequence, instead
+ of SDL_CDStatus.
+
+ This may be possible to fix with a clever usage of the AudioUnit API.
+
+ 4. When new volumes are inserted, our volume information is not updated. The only way
+ to refresh this information is to reinit the CD-ROM subsystem of SDL. To fix this,
+ one would probably have to fix point 1 above first, then figure out how to register
+ for a notification when new media is mounted in order to perform an automatic
+ rescan for cdfs volumes.
+
+
+
+ So, here comes a description of how this all works.
+
+ < Initializing >
+
+ To get things rolling, we have to locate mounted volumes that contain
+ audio (since nearly all Macs don't have analog audio-in on the sound card).
+ That's easy, since these volumes have a flag that indicates this special
+ filesystem. See DetectAudioCDVolumes() in CDPlayer.cpp for this code.
+
+ Next, we parse the invisible .TOC.plist in the root of the volume, which gets us
+ the track information (number, offset, length, leadout, etc). See ReadTOCData() in
+ CDPlayer.cpp for the skinny on this.
+
+
+ < The Playback Loop >
+
+ Now come the tricky parts. Let's start with basic audio playback. When a frame
+ range to play is requested, we must first find the .aiff files on the volume,
+ hopefully in the right order. Since these files all begin with a number "1 Audio Track",
+ etc, this is used to determine the correct track order.
+
+ Once all files are determined, we have to find what file corresponds to the start
+ and length parameter to SDL_SYS_CDPlay(). Again, this is quite simple by walking the
+ cdrom's track list. At this point, we also save the offset to the next track and frames
+ remaining, if we're going to have to play another file after the first one. See
+ GetFileForOffset() for this code.
+
+ At this point we have all info needed to start playback, so we hand off to the LoadFile()
+ function, which proceeds to do its magic and plays back the file.
+
+ When the file is finished playing, CompletionProc() is invoked, at which time we can
+ play the next file if the previously saved next track and frames remaining
+ indicates that we should.
+
+
+ < Magic >
+
+ OK, so it's not really magic, but since I don't fully understand all the hidden details it
+ seems like it to me ;-) The API's involved are the AudioUnit and AudioFile API's. These
+ appear to be an extension of CoreAudio for creating modular playback and f/x entities.
+ The important thing is that CPU usage is very low and reliability is very high. You'd
+ be hard-pressed to find a way to stutter the playback with other CPU-intensive tasks.
+
+ One part of this magic is that it uses multiple threads, which carries the usual potential
+ for disaster if not handled carefully. Playback currently requires 4 additional threads:
+ 1. The coreaudio runloop thread
+ 2. The coreaudio device i/o thread
+ 3. The file streaming thread
+ 4. The notification/callback thread
+
+ The first 2 threads are necessary evil - CoreAudio creates this no matter what the situation
+ is (even the SDL sound implementation creates theses suckers). The last two are are created
+ by us.
+
+ The file is streamed from disk using a threaded double-buffer approach.
+ This way, the high latency operation of reading from disk can be performed without interrupting
+ the real-time device thread (which amounts to avoiding dropouts). The device thread grabs the
+ buffer that isn't being read and sends it to the CoreAudio mixer where it eventually gets
+ to the sound card.
+
+ The device thread posts a notification when the file streaming thread is out of data. This
+ notification must be handled in a separate thread to avoid potential deadlock in the
+ device thread. That's where the notification thread comes in. This thread is signaled
+ whenever a notification needs to be processed, so another file can be played back if need be.
+
+ The API in CDPlayer.cpp contains synchronization because otherwise both the notification thread
+ and main thread (or another other thread using the SDL CD api) can potentially call it at the same time.
+
+************************************************************************************/
+
+
+#include "SDL_cdrom.h"
+#include "../SDL_syscdrom.h"
+
+#include "CDPlayer.h"
+
+#define kErrorFakeDevice "Error: Cannot proceed since we're faking a CD-ROM device. Reinit the CD-ROM subsystem to scan for new volumes."
+
diff --git a/distrib/sdl-1.2.15/src/cdrom/mint/SDL_syscdrom.c b/distrib/sdl-1.2.15/src/cdrom/mint/SDL_syscdrom.c
new file mode 100644
index 0000000..0bc10ed
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/mint/SDL_syscdrom.c
@@ -0,0 +1,317 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_CDROM_MINT
+
+/*
+ Atari MetaDOS CD-ROM functions
+
+ Patrice Mandin
+*/
+
+#include <errno.h>
+
+#include <mint/cdromio.h>
+#include <mint/metados.h>
+
+#include "SDL_cdrom.h"
+#include "../SDL_syscdrom.h"
+
+/* Some ioctl() errno values which occur when the tray is empty */
+#ifndef ENOMEDIUM
+#define ENOMEDIUM ENOENT
+#endif
+#define ERRNO_TRAYEMPTY(errno) \
+ ((errno == EIO) || (errno == ENOENT) || \
+ (errno == EINVAL) || (errno == ENOMEDIUM))
+
+/* The maximum number of CD-ROM drives we'll detect */
+#define MAX_DRIVES 32
+
+typedef struct {
+ char device[3]; /* Physical device letter + ':' + '\0' */
+ metaopen_t metaopen; /* Infos on opened drive */
+} metados_drive_t;
+
+static metados_drive_t metados_drives[MAX_DRIVES];
+
+/* The system-dependent CD control functions */
+static const char *SDL_SYS_CDName(int drive);
+static int SDL_SYS_CDOpen(int drive);
+static void SDL_SYS_CDClose(SDL_CD *cdrom);
+static int SDL_SYS_CDioctl(int id, int command, void *arg);
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
+static int SDL_SYS_CDPause(SDL_CD *cdrom);
+static int SDL_SYS_CDResume(SDL_CD *cdrom);
+static int SDL_SYS_CDStop(SDL_CD *cdrom);
+static int SDL_SYS_CDEject(SDL_CD *cdrom);
+
+int SDL_SYS_CDInit(void)
+{
+ metainit_t metainit={0,0,0,0};
+ metaopen_t metaopen;
+ int i, handle;
+ struct cdrom_subchnl info;
+
+ Metainit(&metainit);
+ if (metainit.version == NULL) {
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "MetaDOS not installed\n");
+#endif
+ return -1;
+ }
+
+ if (metainit.drives_map == 0) {
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "No MetaDOS devices present\n");
+#endif
+ return -1;
+ }
+
+ SDL_numcds = 0;
+
+ for (i='A'; i<='Z'; i++) {
+ metados_drives[SDL_numcds].device[0] = 0;
+ metados_drives[SDL_numcds].device[1] = ':';
+ metados_drives[SDL_numcds].device[2] = 0;
+
+ if (metainit.drives_map & (1<<(i-'A'))) {
+ handle = Metaopen(i, &metaopen);
+ if (handle == 0) {
+
+ info.cdsc_format = CDROM_MSF;
+ if ( (Metaioctl(i, METADOS_IOCTL_MAGIC, CDROMSUBCHNL, &info) == 0) || ERRNO_TRAYEMPTY(errno) ) {
+ metados_drives[SDL_numcds].device[0] = i;
+ ++SDL_numcds;
+ }
+
+ Metaclose(i);
+ }
+ }
+ }
+
+ /* Fill in our driver capabilities */
+ SDL_CDcaps.Name = SDL_SYS_CDName;
+ SDL_CDcaps.Open = SDL_SYS_CDOpen;
+ SDL_CDcaps.Close = SDL_SYS_CDClose;
+
+ SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
+ SDL_CDcaps.Status = SDL_SYS_CDStatus;
+ SDL_CDcaps.Play = SDL_SYS_CDPlay;
+ SDL_CDcaps.Pause = SDL_SYS_CDPause;
+ SDL_CDcaps.Resume = SDL_SYS_CDResume;
+ SDL_CDcaps.Stop = SDL_SYS_CDStop;
+ SDL_CDcaps.Eject = SDL_SYS_CDEject;
+
+ return 0;
+}
+
+void SDL_SYS_CDQuit(void)
+{
+ SDL_numcds = 0;
+}
+
+static const char *SDL_SYS_CDName(int drive)
+{
+ return(metados_drives[drive].device);
+}
+
+static int SDL_SYS_CDOpen(int drive)
+{
+ int handle;
+
+ handle = Metaopen(metados_drives[drive].device[0], &(metados_drives[drive].metaopen));
+ if (handle == 0) {
+ return drive;
+ }
+
+ return -1;
+}
+
+static void SDL_SYS_CDClose(SDL_CD *cdrom)
+{
+ Metaclose(metados_drives[cdrom->id].device[0]);
+}
+
+static int SDL_SYS_CDioctl(int id, int command, void *arg)
+{
+ int retval;
+
+ retval = Metaioctl(metados_drives[id].device[0], METADOS_IOCTL_MAGIC, command, arg);
+ if ( retval < 0 ) {
+ SDL_SetError("ioctl() error: %s", strerror(errno));
+ }
+ return(retval);
+}
+
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
+{
+ int i,okay;
+ struct cdrom_tochdr toc;
+ struct cdrom_tocentry entry;
+
+ /* Use standard ioctl() */
+ if (SDL_SYS_CDioctl(cdrom->id, CDROMREADTOCHDR, &toc)<0) {
+ return -1;
+ }
+
+ cdrom->numtracks = toc.cdth_trk1-toc.cdth_trk0+1;
+ if ( cdrom->numtracks > SDL_MAX_TRACKS ) {
+ cdrom->numtracks = SDL_MAX_TRACKS;
+ }
+
+ /* Read all the track TOC entries */
+ okay=1;
+ for ( i=0; i<=cdrom->numtracks; ++i ) {
+ if ( i == cdrom->numtracks ) {
+ cdrom->track[i].id = CDROM_LEADOUT;
+ } else {
+ cdrom->track[i].id = toc.cdth_trk0+i;
+ }
+ entry.cdte_track = cdrom->track[i].id;
+ entry.cdte_format = CDROM_MSF;
+ if ( SDL_SYS_CDioctl(cdrom->id, CDROMREADTOCENTRY, &entry) < 0 ) {
+ okay=0;
+ break;
+ } else {
+ if ( entry.cdte_ctrl & CDROM_DATA_TRACK ) {
+ cdrom->track[i].type = SDL_DATA_TRACK;
+ } else {
+ cdrom->track[i].type = SDL_AUDIO_TRACK;
+ }
+ cdrom->track[i].offset = MSF_TO_FRAMES(
+ entry.cdte_addr.msf.minute,
+ entry.cdte_addr.msf.second,
+ entry.cdte_addr.msf.frame);
+ cdrom->track[i].length = 0;
+ if ( i > 0 ) {
+ cdrom->track[i-1].length = cdrom->track[i].offset-cdrom->track[i-1].offset;
+ }
+ }
+ }
+
+ return(okay ? 0 : -1);
+}
+
+/* Get CD-ROM status */
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
+{
+ CDstatus status;
+ struct cdrom_tochdr toc;
+ struct cdrom_subchnl info;
+
+ info.cdsc_format = CDROM_MSF;
+ if ( SDL_SYS_CDioctl(cdrom->id, CDROMSUBCHNL, &info) < 0 ) {
+ if ( ERRNO_TRAYEMPTY(errno) ) {
+ status = CD_TRAYEMPTY;
+ } else {
+ status = CD_ERROR;
+ }
+ } else {
+ switch (info.cdsc_audiostatus) {
+ case CDROM_AUDIO_INVALID:
+ case CDROM_AUDIO_NO_STATUS:
+ /* Try to determine if there's a CD available */
+ if (SDL_SYS_CDioctl(cdrom->id, CDROMREADTOCHDR, &toc)==0) {
+ status = CD_STOPPED;
+ } else {
+ status = CD_TRAYEMPTY;
+ }
+ break;
+ case CDROM_AUDIO_COMPLETED:
+ status = CD_STOPPED;
+ break;
+ case CDROM_AUDIO_PLAY:
+ status = CD_PLAYING;
+ break;
+ case CDROM_AUDIO_PAUSED:
+ /* Workaround buggy CD-ROM drive */
+ if ( info.cdsc_trk == CDROM_LEADOUT ) {
+ status = CD_STOPPED;
+ } else {
+ status = CD_PAUSED;
+ }
+ break;
+ default:
+ status = CD_ERROR;
+ break;
+ }
+ }
+ if ( position ) {
+ if ( status == CD_PLAYING || (status == CD_PAUSED) ) {
+ *position = MSF_TO_FRAMES(
+ info.cdsc_absaddr.msf.minute,
+ info.cdsc_absaddr.msf.second,
+ info.cdsc_absaddr.msf.frame);
+ } else {
+ *position = 0;
+ }
+ }
+ return(status);
+}
+
+/* Start play */
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
+{
+ struct cdrom_msf playtime;
+
+ FRAMES_TO_MSF(start,
+ &playtime.cdmsf_min0, &playtime.cdmsf_sec0, &playtime.cdmsf_frame0);
+ FRAMES_TO_MSF(start+length,
+ &playtime.cdmsf_min1, &playtime.cdmsf_sec1, &playtime.cdmsf_frame1);
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Trying to play from %d:%d:%d to %d:%d:%d\n",
+ playtime.cdmsf_min0, playtime.cdmsf_sec0, playtime.cdmsf_frame0,
+ playtime.cdmsf_min1, playtime.cdmsf_sec1, playtime.cdmsf_frame1);
+#endif
+
+ return SDL_SYS_CDioctl(cdrom->id, CDROMPLAYMSF, &playtime);
+}
+
+/* Pause play */
+static int SDL_SYS_CDPause(SDL_CD *cdrom)
+{
+ return SDL_SYS_CDioctl(cdrom->id, CDROMPAUSE, 0);
+}
+
+/* Resume play */
+static int SDL_SYS_CDResume(SDL_CD *cdrom)
+{
+ return SDL_SYS_CDioctl(cdrom->id, CDROMRESUME, 0);
+}
+
+/* Stop play */
+static int SDL_SYS_CDStop(SDL_CD *cdrom)
+{
+ return SDL_SYS_CDioctl(cdrom->id, CDROMSTOP, 0);
+}
+
+/* Eject the CD-ROM */
+static int SDL_SYS_CDEject(SDL_CD *cdrom)
+{
+ return SDL_SYS_CDioctl(cdrom->id, CDROMEJECT, 0);
+}
+
+#endif /* SDL_CDROM_MINT */
diff --git a/distrib/sdl-1.2.15/src/cdrom/openbsd/SDL_syscdrom.c b/distrib/sdl-1.2.15/src/cdrom/openbsd/SDL_syscdrom.c
new file mode 100644
index 0000000..e4d03a6
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/openbsd/SDL_syscdrom.c
@@ -0,0 +1,416 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_CDROM_OPENBSD
+
+/* Functions for system-level CD-ROM audio control */
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <sys/cdio.h>
+
+#include "SDL_cdrom.h"
+#include "../SDL_syscdrom.h"
+
+
+/* The maximum number of CD-ROM drives we'll detect */
+#define MAX_DRIVES 16
+
+/* A list of available CD-ROM drives */
+static char *SDL_cdlist[MAX_DRIVES];
+static dev_t SDL_cdmode[MAX_DRIVES];
+
+/* The system-dependent CD control functions */
+static const char *SDL_SYS_CDName(int drive);
+static int SDL_SYS_CDOpen(int drive);
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
+static int SDL_SYS_CDPause(SDL_CD *cdrom);
+static int SDL_SYS_CDResume(SDL_CD *cdrom);
+static int SDL_SYS_CDStop(SDL_CD *cdrom);
+static int SDL_SYS_CDEject(SDL_CD *cdrom);
+static void SDL_SYS_CDClose(SDL_CD *cdrom);
+
+/* Some ioctl() errno values which occur when the tray is empty */
+#define ERRNO_TRAYEMPTY(errno) \
+ ((errno == EIO) || (errno == ENOENT) || (errno == EINVAL) || \
+ (errno == ENODEV))
+
+/* Check a drive to see if it is a CD-ROM */
+static int CheckDrive(char *drive, struct stat *stbuf)
+{
+ int is_cd, cdfd;
+ struct ioc_read_subchannel info;
+
+ /* If it doesn't exist, return -1 */
+ if ( stat(drive, stbuf) < 0 ) {
+ return(-1);
+ }
+
+ /* If it does exist, verify that it's an available CD-ROM */
+ is_cd = 0;
+ if ( S_ISCHR(stbuf->st_mode) || S_ISBLK(stbuf->st_mode) ) {
+ cdfd = open(drive, (O_RDONLY|O_EXCL|O_NONBLOCK), 0);
+ if ( cdfd >= 0 ) {
+ info.address_format = CD_MSF_FORMAT;
+ info.data_format = CD_CURRENT_POSITION;
+ info.data_len = 0;
+ info.data = NULL;
+ /* Under Linux, EIO occurs when a disk is not present.
+ This isn't 100% reliable, so we use the USE_MNTENT
+ code above instead.
+ */
+ if ( (ioctl(cdfd, CDIOCREADSUBCHANNEL, &info) == 0) ||
+ ERRNO_TRAYEMPTY(errno) ) {
+ is_cd = 1;
+ }
+ close(cdfd);
+ }
+ else if (ERRNO_TRAYEMPTY(errno))
+ is_cd = 1;
+ }
+ return(is_cd);
+}
+
+/* Add a CD-ROM drive to our list of valid drives */
+static void AddDrive(char *drive, struct stat *stbuf)
+{
+ int i;
+
+ if ( SDL_numcds < MAX_DRIVES ) {
+ /* Check to make sure it's not already in our list.
+ This can happen when we see a drive via symbolic link.
+ */
+ for ( i=0; i<SDL_numcds; ++i ) {
+ if ( stbuf->st_rdev == SDL_cdmode[i] ) {
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Duplicate drive detected: %s == %s\n", drive, SDL_cdlist[i]);
+#endif
+ return;
+ }
+ }
+
+ /* Add this drive to our list */
+ i = SDL_numcds;
+ SDL_cdlist[i] = SDL_strdup(drive);
+ if ( SDL_cdlist[i] == NULL ) {
+ SDL_OutOfMemory();
+ return;
+ }
+ SDL_cdmode[i] = stbuf->st_rdev;
+ ++SDL_numcds;
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Added CD-ROM drive: %s\n", drive);
+#endif
+ }
+}
+
+int SDL_SYS_CDInit(void)
+{
+ static char *checklist[] = {
+#if defined(__OPENBSD__)
+ "?0 cd?c", "cdrom", NULL
+#elif defined(__NETBSD__)
+ "?0 cd?d", "?0 cd?c", "cdrom", NULL
+#else
+ "?0 cd?c", "?0 acd?c", "cdrom", NULL
+#endif
+ };
+ char *SDLcdrom;
+ int i, j, exists;
+ char drive[32];
+ struct stat stbuf;
+
+ /* Fill in our driver capabilities */
+ SDL_CDcaps.Name = SDL_SYS_CDName;
+ SDL_CDcaps.Open = SDL_SYS_CDOpen;
+ SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
+ SDL_CDcaps.Status = SDL_SYS_CDStatus;
+ SDL_CDcaps.Play = SDL_SYS_CDPlay;
+ SDL_CDcaps.Pause = SDL_SYS_CDPause;
+ SDL_CDcaps.Resume = SDL_SYS_CDResume;
+ SDL_CDcaps.Stop = SDL_SYS_CDStop;
+ SDL_CDcaps.Eject = SDL_SYS_CDEject;
+ SDL_CDcaps.Close = SDL_SYS_CDClose;
+
+ /* Look in the environment for our CD-ROM drive list */
+ SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */
+ if ( SDLcdrom != NULL ) {
+ char *cdpath, *delim;
+ size_t len = SDL_strlen(SDLcdrom)+1;
+ cdpath = SDL_stack_alloc(char, len);
+ if ( cdpath != NULL ) {
+ SDL_strlcpy(cdpath, SDLcdrom, len);
+ SDLcdrom = cdpath;
+ do {
+ delim = SDL_strchr(SDLcdrom, ':');
+ if ( delim ) {
+ *delim++ = '\0';
+ }
+ if ( CheckDrive(SDLcdrom, &stbuf) > 0 ) {
+ AddDrive(SDLcdrom, &stbuf);
+ }
+ if ( delim ) {
+ SDLcdrom = delim;
+ } else {
+ SDLcdrom = NULL;
+ }
+ } while ( SDLcdrom );
+ SDL_stack_free(cdpath);
+ }
+
+ /* If we found our drives, there's nothing left to do */
+ if ( SDL_numcds > 0 ) {
+ return(0);
+ }
+ }
+
+ /* Scan the system for CD-ROM drives */
+ for ( i=0; checklist[i]; ++i ) {
+ if ( checklist[i][0] == '?' ) {
+ char *insert;
+ exists = 1;
+ for ( j=checklist[i][1]; exists; ++j ) {
+ SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", &checklist[i][3]);
+ insert = SDL_strchr(drive, '?');
+ if ( insert != NULL ) {
+ *insert = j;
+ }
+ switch (CheckDrive(drive, &stbuf)) {
+ /* Drive exists and is a CD-ROM */
+ case 1:
+ AddDrive(drive, &stbuf);
+ break;
+ /* Drive exists, but isn't a CD-ROM */
+ case 0:
+ break;
+ /* Drive doesn't exist */
+ case -1:
+ exists = 0;
+ break;
+ }
+ }
+ } else {
+ SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]);
+ if ( CheckDrive(drive, &stbuf) > 0 ) {
+ AddDrive(drive, &stbuf);
+ }
+ }
+ }
+ return(0);
+}
+
+/* General ioctl() CD-ROM command function */
+static int SDL_SYS_CDioctl(int id, int command, void *arg)
+{
+ int retval;
+
+ retval = ioctl(id, command, arg);
+ if ( retval < 0 ) {
+ SDL_SetError("ioctl() error: %s", strerror(errno));
+ }
+ return(retval);
+}
+
+static const char *SDL_SYS_CDName(int drive)
+{
+ return(SDL_cdlist[drive]);
+}
+
+static int SDL_SYS_CDOpen(int drive)
+{
+ return(open(SDL_cdlist[drive], (O_RDONLY|O_EXCL|O_NONBLOCK), 0));
+}
+
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
+{
+ struct ioc_toc_header toc;
+ int i, okay;
+ struct ioc_read_toc_entry entry;
+ struct cd_toc_entry data;
+
+ okay = 0;
+ if ( SDL_SYS_CDioctl(cdrom->id, CDIOREADTOCHEADER, &toc) == 0 ) {
+ cdrom->numtracks = toc.ending_track-toc.starting_track+1;
+ if ( cdrom->numtracks > SDL_MAX_TRACKS ) {
+ cdrom->numtracks = SDL_MAX_TRACKS;
+ }
+ /* Read all the track TOC entries */
+ for ( i=0; i<=cdrom->numtracks; ++i ) {
+ if ( i == cdrom->numtracks ) {
+ cdrom->track[i].id = 0xAA; /* CDROM_LEADOUT */
+ } else {
+ cdrom->track[i].id = toc.starting_track+i;
+ }
+ entry.starting_track = cdrom->track[i].id;
+ entry.address_format = CD_MSF_FORMAT;
+ entry.data_len = sizeof(data);
+ entry.data = &data;
+ if ( SDL_SYS_CDioctl(cdrom->id, CDIOREADTOCENTRYS,
+ &entry) < 0 ) {
+ break;
+ } else {
+ cdrom->track[i].type = data.control;
+ cdrom->track[i].offset = MSF_TO_FRAMES(
+ data.addr.msf.minute,
+ data.addr.msf.second,
+ data.addr.msf.frame);
+ cdrom->track[i].length = 0;
+ if ( i > 0 ) {
+ cdrom->track[i-1].length =
+ cdrom->track[i].offset-
+ cdrom->track[i-1].offset;
+ }
+ }
+ }
+ if ( i == (cdrom->numtracks+1) ) {
+ okay = 1;
+ }
+ }
+ return(okay ? 0 : -1);
+}
+
+/* Get CD-ROM status */
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
+{
+ CDstatus status;
+ struct ioc_toc_header toc;
+ struct ioc_read_subchannel info;
+ struct cd_sub_channel_info data;
+
+ info.address_format = CD_MSF_FORMAT;
+ info.data_format = CD_CURRENT_POSITION;
+ info.track = 0;
+ info.data_len = sizeof(data);
+ info.data = &data;
+ if ( ioctl(cdrom->id, CDIOCREADSUBCHANNEL, &info) < 0 ) {
+ if ( ERRNO_TRAYEMPTY(errno) ) {
+ status = CD_TRAYEMPTY;
+ } else {
+ status = CD_ERROR;
+ }
+ } else {
+ switch (data.header.audio_status) {
+ case CD_AS_AUDIO_INVALID:
+ case CD_AS_NO_STATUS:
+ /* Try to determine if there's a CD available */
+ if (ioctl(cdrom->id,CDIOREADTOCHEADER,&toc)==0)
+ status = CD_STOPPED;
+ else
+ status = CD_TRAYEMPTY;
+ break;
+ case CD_AS_PLAY_COMPLETED:
+ status = CD_STOPPED;
+ break;
+ case CD_AS_PLAY_IN_PROGRESS:
+ status = CD_PLAYING;
+ break;
+ case CD_AS_PLAY_PAUSED:
+ status = CD_PAUSED;
+ break;
+ default:
+ status = CD_ERROR;
+ break;
+ }
+ }
+ if ( position ) {
+ if ( status == CD_PLAYING || (status == CD_PAUSED) ) {
+ *position = MSF_TO_FRAMES(
+ data.what.position.absaddr.msf.minute,
+ data.what.position.absaddr.msf.second,
+ data.what.position.absaddr.msf.frame);
+ } else {
+ *position = 0;
+ }
+ }
+ return(status);
+}
+
+/* Start play */
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
+{
+ struct ioc_play_msf playtime;
+
+ FRAMES_TO_MSF(start,
+ &playtime.start_m, &playtime.start_s, &playtime.start_f);
+ FRAMES_TO_MSF(start+length,
+ &playtime.end_m, &playtime.end_s, &playtime.end_f);
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Trying to play from %d:%d:%d to %d:%d:%d\n",
+ playtime.start_m, playtime.start_s, playtime.start_f,
+ playtime.end_m, playtime.end_s, playtime.end_f);
+#endif
+ ioctl(cdrom->id, CDIOCSTART, 0);
+ return(SDL_SYS_CDioctl(cdrom->id, CDIOCPLAYMSF, &playtime));
+}
+
+/* Pause play */
+static int SDL_SYS_CDPause(SDL_CD *cdrom)
+{
+ return(SDL_SYS_CDioctl(cdrom->id, CDIOCPAUSE, 0));
+}
+
+/* Resume play */
+static int SDL_SYS_CDResume(SDL_CD *cdrom)
+{
+ return(SDL_SYS_CDioctl(cdrom->id, CDIOCRESUME, 0));
+}
+
+/* Stop play */
+static int SDL_SYS_CDStop(SDL_CD *cdrom)
+{
+ return(SDL_SYS_CDioctl(cdrom->id, CDIOCSTOP, 0));
+}
+
+/* Eject the CD-ROM */
+static int SDL_SYS_CDEject(SDL_CD *cdrom)
+{
+ SDL_SYS_CDioctl(cdrom->id, CDIOCALLOW, 0);
+ return(SDL_SYS_CDioctl(cdrom->id, CDIOCEJECT, 0));
+}
+
+/* Close the CD-ROM handle */
+static void SDL_SYS_CDClose(SDL_CD *cdrom)
+{
+ close(cdrom->id);
+}
+
+void SDL_SYS_CDQuit(void)
+{
+ int i;
+
+ if ( SDL_numcds > 0 ) {
+ for ( i=0; i<SDL_numcds; ++i ) {
+ SDL_free(SDL_cdlist[i]);
+ }
+ SDL_numcds = 0;
+ }
+}
+
+#endif /* SDL_CDROM_OPENBSD */
diff --git a/distrib/sdl-1.2.15/src/cdrom/os2/SDL_syscdrom.c b/distrib/sdl-1.2.15/src/cdrom/os2/SDL_syscdrom.c
new file mode 100644
index 0000000..6ed9c65
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/os2/SDL_syscdrom.c
@@ -0,0 +1,393 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_CDROM_OS2
+
+/* Functions for system-level CD-ROM audio control */
+
+#define INCL_MCIOS2
+#include <os2.h>
+#include <os2me.h>
+
+#include "SDL_cdrom.h"
+#include "../SDL_syscdrom.h"
+
+/* Size of MCI result buffer (in bytes) */
+#define MCI_CMDRETBUFSIZE 128
+
+/* The maximum number of CD-ROM drives we'll detect */
+#define MAX_DRIVES 16
+
+/* A list of available CD-ROM drives */
+static char *SDL_cdlist[MAX_DRIVES];
+//static dev_t SDL_cdmode[MAX_DRIVES];
+
+/* The system-dependent CD control functions */
+static const char *SDL_SYS_CDName(int drive);
+static int SDL_SYS_CDOpen(int drive);
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
+static int SDL_SYS_CDPause(SDL_CD *cdrom);
+static int SDL_SYS_CDResume(SDL_CD *cdrom);
+static int SDL_SYS_CDStop(SDL_CD *cdrom);
+static int SDL_SYS_CDEject(SDL_CD *cdrom);
+static void SDL_SYS_CDClose(SDL_CD *cdrom);
+
+/* MCI Timing Functions */
+#define MCI_MMTIMEPERSECOND 3000
+#define FRAMESFROMMM(mmtime) (((mmtime)*CD_FPS)/MCI_MMTIMEPERSECOND)
+
+
+/* Ready for MCI CDAudio Devices */
+int SDL_SYS_CDInit(void)
+{
+int i; /* generig counter */
+MCI_SYSINFO_PARMS msp; /* Structure to MCI SysInfo parameters */
+CHAR SysInfoRet[MCI_CMDRETBUFSIZE]; /* Buffer for MCI Command result */
+
+/* Fill in our driver capabilities */
+SDL_CDcaps.Name = SDL_SYS_CDName;
+SDL_CDcaps.Open = SDL_SYS_CDOpen;
+SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
+SDL_CDcaps.Status = SDL_SYS_CDStatus;
+SDL_CDcaps.Play = SDL_SYS_CDPlay;
+SDL_CDcaps.Pause = SDL_SYS_CDPause;
+SDL_CDcaps.Resume = SDL_SYS_CDResume;
+SDL_CDcaps.Stop = SDL_SYS_CDStop;
+SDL_CDcaps.Eject = SDL_SYS_CDEject;
+SDL_CDcaps.Close = SDL_SYS_CDClose;
+
+/* Get the number of CD ROMs in the System */
+/* Clean SysInfo structure */
+SDL_memset(&msp, 0x00, sizeof(MCI_SYSINFO_PARMS));
+/* Prepare structure to Ask Numer of Audio CDs */
+msp.usDeviceType = MCI_DEVTYPE_CD_AUDIO; /* CD Audio Type */
+msp.pszReturn = (PSZ)&SysInfoRet; /* Return Structure */
+msp.ulRetSize = MCI_CMDRETBUFSIZE; /* Size of ret struct */
+if (LOUSHORT(mciSendCommand(0,MCI_SYSINFO, MCI_SYSINFO_QUANTITY | MCI_WAIT, (PVOID)&msp, 0)) != MCIERR_SUCCESS) return(CD_ERROR);
+SDL_numcds = atoi(SysInfoRet);
+if (SDL_numcds > MAX_DRIVES) SDL_numcds = MAX_DRIVES; /* Limit maximum CD number */
+
+/* Get and Add their system name to the SDL_cdlist */
+msp.pszReturn = (PSZ)&SysInfoRet; /* Return Structure */
+msp.ulRetSize = MCI_CMDRETBUFSIZE; /* Size of ret struct */
+msp.usDeviceType = MCI_DEVTYPE_CD_AUDIO; /* CD Audio Type */
+for (i=0; i<SDL_numcds; i++)
+ {
+ msp.ulNumber = i+1;
+ mciSendCommand(0,MCI_SYSINFO, MCI_SYSINFO_NAME | MCI_WAIT,&msp, 0);
+ SDL_cdlist[i] = SDL_strdup(SysInfoRet);
+ if ( SDL_cdlist[i] == NULL )
+ {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ }
+return(0);
+}
+
+/* Return CDAudio System Dependent Device Name - Ready for MCI*/
+static const char *SDL_SYS_CDName(int drive)
+{
+return(SDL_cdlist[drive]);
+}
+
+/* Open CDAudio Device - Ready for MCI */
+static int SDL_SYS_CDOpen(int drive)
+{
+MCI_OPEN_PARMS mop;
+MCI_SET_PARMS msp;
+MCI_GENERIC_PARMS mgp;
+
+/* Open the device */
+mop.hwndCallback = (HWND)NULL; // None
+mop.usDeviceID = (USHORT)NULL; // Will be returned.
+mop.pszDeviceType = (PSZ)SDL_cdlist[drive]; // CDAudio Device
+if (LOUSHORT(mciSendCommand(0,MCI_OPEN,MCI_WAIT,&mop, 0)) != MCIERR_SUCCESS) return(CD_ERROR);
+/* Set time format */
+msp.hwndCallback = (HWND)NULL; // None
+msp.ulTimeFormat = MCI_FORMAT_MSF; // Minute : Second : Frame structure
+msp.ulSpeedFormat = (ULONG)NULL; // No change
+msp.ulAudio = (ULONG)NULL; // No Channel
+msp.ulLevel = (ULONG)NULL; // No Volume
+msp.ulOver = (ULONG)NULL; // No Delay
+msp.ulItem = (ULONG)NULL; // No item
+msp.ulValue = (ULONG)NULL; // No value for item flag
+if (LOUSHORT(mciSendCommand(mop.usDeviceID,MCI_SET,MCI_WAIT | MCI_SET_TIME_FORMAT,&msp, 0)) == MCIERR_SUCCESS) return (mop.usDeviceID);
+/* Error setting time format? - Close opened device */
+mgp.hwndCallback = (HWND)NULL; // None
+mciSendCommand(mop.usDeviceID,MCI_CLOSE,MCI_WAIT,&mgp, 0);
+return(CD_ERROR);
+}
+
+/* Get CD Table Of Contents - Ready for MCI */
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
+{
+MCI_TOC_PARMS mtp;
+MCI_STATUS_PARMS msp;
+MCI_TOC_REC * mtr;
+INT i;
+
+/* Correction because MCI cannot read TOC while CD is playing (it'll stop!) */
+if (cdrom->status == CD_PLAYING || cdrom->status == CD_PAUSED) return 0;
+
+/* Get Number of Tracks */
+msp.hwndCallback = (HWND)NULL; /* None */
+msp.ulReturn = (ULONG)NULL; /* We want this information */
+msp.ulItem = MCI_STATUS_NUMBER_OF_TRACKS;
+msp.ulValue = (ULONG)NULL; /* No additional information */
+if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STATUS,MCI_WAIT | MCI_STATUS_ITEM,&msp, 0)) != MCIERR_SUCCESS) return(CD_ERROR);
+cdrom->numtracks = msp.ulReturn;
+if ( cdrom->numtracks > SDL_MAX_TRACKS )
+ {
+ cdrom->numtracks = SDL_MAX_TRACKS;
+ }
+/* Alocate space for TOC data */
+mtr = (MCI_TOC_REC *)SDL_malloc(cdrom->numtracks*sizeof(MCI_TOC_REC));
+if ( mtr == NULL )
+ {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+/* Get TOC from CD */
+mtp.pBuf = mtr;
+mtp.ulBufSize = cdrom->numtracks*sizeof(MCI_TOC_REC);
+if (LOUSHORT(mciSendCommand(cdrom->id,MCI_GETTOC,MCI_WAIT,&mtp, 0)) != MCIERR_SUCCESS)
+ {
+ SDL_OutOfMemory();
+ SDL_free(mtr);
+ return(CD_ERROR);
+ }
+/* Fill SDL Tracks Structure */
+for (i=0; i<cdrom->numtracks; i++)
+ {
+ /* Set Track ID */
+ cdrom->track[i].id = (mtr+i)->TrackNum;
+ /* Set Track Type */
+ msp.hwndCallback = (HWND)NULL; /* None */
+ msp.ulReturn = (ULONG)NULL; /* We want this information */
+ msp.ulItem = MCI_CD_STATUS_TRACK_TYPE;
+ msp.ulValue = (ULONG)((mtr+i)->TrackNum); /* Track Number? */
+ if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STATUS,MCI_WAIT | MCI_TRACK | MCI_STATUS_ITEM,&msp, 0)) != MCIERR_SUCCESS)
+ {
+ SDL_free(mtr);
+ return (CD_ERROR);
+ }
+ if (msp.ulReturn==MCI_CD_TRACK_AUDIO) cdrom->track[i].type = SDL_AUDIO_TRACK;
+ else cdrom->track[i].type = SDL_DATA_TRACK;
+ /* Set Track Length - values from MCI are in MMTIMEs - 3000 MMTIME = 1 second */
+ cdrom->track[i].length = FRAMESFROMMM((mtr+i)->ulEndAddr - (mtr+i)->ulStartAddr);
+ /* Set Track Offset */
+ cdrom->track[i].offset = FRAMESFROMMM((mtr+i)->ulStartAddr);
+ }
+SDL_free(mtr);
+return(0);
+}
+
+
+/* Get CD-ROM status - Ready for MCI */
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
+{
+CDstatus status;
+MCI_STATUS_PARMS msp;
+
+/* Get Status from MCI */
+msp.hwndCallback = (HWND)NULL; /* None */
+msp.ulReturn = (ULONG)NULL; /* We want this information */
+msp.ulItem = MCI_STATUS_MODE;
+msp.ulValue = (ULONG)NULL; /* No additional information */
+if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STATUS,MCI_WAIT | MCI_STATUS_ITEM,&msp, 0)) != MCIERR_SUCCESS) status = CD_ERROR;
+else
+ {
+ switch(msp.ulReturn)
+ {
+ case MCI_MODE_NOT_READY:
+ status = CD_TRAYEMPTY;
+ break;
+ case MCI_MODE_PAUSE:
+ status = CD_PAUSED;
+ break;
+ case MCI_MODE_PLAY:
+ status = CD_PLAYING;
+ break;
+ case MCI_MODE_STOP:
+ status = CD_STOPPED;
+ break;
+ /* These cases should not occour */
+ case MCI_MODE_RECORD:
+ case MCI_MODE_SEEK:
+ default:
+ status = CD_ERROR;
+ break;
+ }
+ }
+
+/* Determine position */
+if (position != NULL) /* The SDL $&$&%# CDROM call sends NULL pointer here! */
+ {
+ if ((status == CD_PLAYING) || (status == CD_PAUSED))
+ {
+ /* Get Position */
+ msp.hwndCallback = (HWND)NULL; /* None */
+ msp.ulReturn = (ULONG)NULL; /* We want this information */
+ msp.ulItem = MCI_STATUS_POSITION;
+ msp.ulValue = (ULONG)NULL; /* No additiona info */
+ if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STATUS,MCI_WAIT | MCI_STATUS_ITEM,&msp, 0)) != MCIERR_SUCCESS) return (CD_ERROR);
+ /* Convert from MSF (format selected in the Open process) to Frames (format that will be returned) */
+ *position = MSF_TO_FRAMES(MSF_MINUTE(msp.ulReturn),MSF_SECOND(msp.ulReturn),MSF_FRAME(msp.ulReturn));
+ }
+ else *position = 0;
+ }
+return(status);
+}
+
+/* Start play - Ready for MCI */
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
+{
+MCI_GENERIC_PARMS mgp;
+MCI_STATUS_PARMS msp;
+MCI_PLAY_PARMS mpp;
+ULONG min,sec,frm;
+
+/* Start MSF */
+FRAMES_TO_MSF(start, &min, &sec, &frm);
+MSF_MINUTE(mpp.ulFrom) = min;
+MSF_SECOND(mpp.ulFrom) = sec;
+MSF_FRAME(mpp.ulFrom) = frm;
+/* End MSF */
+FRAMES_TO_MSF(start+length, &min, &sec, &frm);
+MSF_MINUTE(mpp.ulTo) = min;
+MSF_SECOND(mpp.ulTo) = sec;
+MSF_FRAME(mpp.ulTo) = frm;
+#ifdef DEBUG_CDROM
+ fprintf(stderr, "Trying to play from %d:%d:%d to %d:%d:%d\n",
+ playtime.cdmsf_min0, playtime.cdmsf_sec0, playtime.cdmsf_frame0,
+ playtime.cdmsf_min1, playtime.cdmsf_sec1, playtime.cdmsf_frame1);
+#endif
+/* Verifies if it is paused first... and if it is, unpause before stopping it. */
+msp.hwndCallback = (HWND)NULL; /* None */
+msp.ulReturn = (ULONG)NULL; /* We want this information */
+msp.ulItem = MCI_STATUS_MODE;
+msp.ulValue = (ULONG)NULL; /* No additional information */
+if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STATUS,MCI_WAIT | MCI_STATUS_ITEM,&msp, 0)) == MCIERR_SUCCESS)
+ {
+ if (msp.ulReturn == MCI_MODE_PAUSE)
+ {
+ mgp.hwndCallback = (HWND)NULL; // None
+ mciSendCommand(cdrom->id,MCI_RESUME,0,&mgp, 0);
+ }
+ }
+/* Now play it. */
+mpp.hwndCallback = (HWND)NULL; // We do not want the info. temp
+if (LOUSHORT(mciSendCommand(cdrom->id,MCI_PLAY,MCI_FROM | MCI_TO,&mpp, 0)) == MCIERR_SUCCESS) return 0;
+return (CD_ERROR);
+}
+
+/* Pause play - Ready for MCI */
+static int SDL_SYS_CDPause(SDL_CD *cdrom)
+{
+MCI_GENERIC_PARMS mgp;
+
+mgp.hwndCallback = (HWND)NULL; // None
+if (LOUSHORT(mciSendCommand(cdrom->id,MCI_PAUSE,MCI_WAIT,&mgp, 0)) == MCIERR_SUCCESS) return 0;
+return(CD_ERROR);
+}
+
+/* Resume play - Ready for MCI */
+static int SDL_SYS_CDResume(SDL_CD *cdrom)
+{
+MCI_GENERIC_PARMS mgp;
+
+mgp.hwndCallback = (HWND)NULL; // None
+if (LOUSHORT(mciSendCommand(cdrom->id,MCI_RESUME,MCI_WAIT,&mgp, 0)) == MCIERR_SUCCESS) return 0;
+return(CD_ERROR);
+}
+
+/* Stop play - Ready for MCI */
+static int SDL_SYS_CDStop(SDL_CD *cdrom)
+{
+MCI_GENERIC_PARMS mgp;
+MCI_STATUS_PARMS msp;
+
+/* Verifies if it is paused first... and if it is, unpause before stopping it. */
+msp.hwndCallback = (HWND)NULL; /* None */
+msp.ulReturn = (ULONG)NULL; /* We want this information */
+msp.ulItem = MCI_STATUS_MODE;
+msp.ulValue = (ULONG)NULL; /* No additional information */
+if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STATUS,MCI_WAIT | MCI_STATUS_ITEM,&msp, 0)) == MCIERR_SUCCESS)
+ {
+ if (msp.ulReturn == MCI_MODE_PAUSE)
+ {
+ mgp.hwndCallback = (HWND)NULL; // None
+ mciSendCommand(cdrom->id,MCI_RESUME,0,&mgp, 0);
+ }
+ }
+/* Now stops the media */
+mgp.hwndCallback = (HWND)NULL; // None
+if (LOUSHORT(mciSendCommand(cdrom->id,MCI_STOP,MCI_WAIT,&mgp, 0)) == MCIERR_SUCCESS) return 0;
+return(CD_ERROR);
+}
+
+/* Eject the CD-ROM - Ready for MCI */
+static int SDL_SYS_CDEject(SDL_CD *cdrom)
+{
+MCI_SET_PARMS msp;
+
+msp.hwndCallback = (HWND)NULL; // None
+msp.ulTimeFormat = (ULONG)NULL; // No change
+msp.ulSpeedFormat = (ULONG)NULL; // No change
+msp.ulAudio = (ULONG)NULL; // No Channel
+msp.ulLevel = (ULONG)NULL; // No Volume
+msp.ulOver = (ULONG)NULL; // No Delay
+msp.ulItem = (ULONG)NULL; // No item
+msp.ulValue = (ULONG)NULL; // No value for item flag
+if (LOUSHORT(mciSendCommand(cdrom->id,MCI_SET,MCI_WAIT | MCI_SET_DOOR_OPEN,&msp, 0)) == MCIERR_SUCCESS) return 0;
+return(CD_ERROR);
+}
+
+/* Close the CD-ROM handle - Ready for MCI */
+static void SDL_SYS_CDClose(SDL_CD *cdrom)
+{
+MCI_GENERIC_PARMS mgp;
+
+mgp.hwndCallback = (HWND)NULL; // None
+mciSendCommand(cdrom->id,MCI_CLOSE,MCI_WAIT,&mgp, 0);
+}
+
+/* Finalize CDROM Subsystem - Ready for MCI */
+void SDL_SYS_CDQuit(void)
+{
+int i;
+
+if ( SDL_numcds > 0 )
+ {
+ for ( i=0; i<SDL_numcds; ++i )
+ {
+ SDL_free(SDL_cdlist[i]);
+ }
+ SDL_numcds = 0;
+ }
+}
+
+#endif /* SDL_CDROM_OS2 */
diff --git a/distrib/sdl-1.2.12/src/cdrom/osf/SDL_syscdrom.c b/distrib/sdl-1.2.15/src/cdrom/osf/SDL_syscdrom.c
index 8478a7b..8478a7b 100644
--- a/distrib/sdl-1.2.12/src/cdrom/osf/SDL_syscdrom.c
+++ b/distrib/sdl-1.2.15/src/cdrom/osf/SDL_syscdrom.c
diff --git a/distrib/sdl-1.2.15/src/cdrom/qnx/SDL_syscdrom.c b/distrib/sdl-1.2.15/src/cdrom/qnx/SDL_syscdrom.c
new file mode 100644
index 0000000..0e38b79
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/qnx/SDL_syscdrom.c
@@ -0,0 +1,551 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_CDROM_QNX
+
+/* Functions for system-level CD-ROM audio control */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/cdrom.h>
+#include <sys/dcmd_cam.h>
+
+#include "SDL_timer.h"
+#include "SDL_cdrom.h"
+#include "../SDL_syscdrom.h"
+
+/* The maximum number of CD-ROM drives we'll detect */
+#define MAX_DRIVES 16
+
+#define QNX_CD_OPENMODE O_RDONLY | O_EXCL
+
+/* A list of available CD-ROM drives */
+static char *SDL_cdlist[MAX_DRIVES];
+static dev_t SDL_cdmode[MAX_DRIVES];
+static int SDL_cdopen[MAX_DRIVES];
+
+/* The system-dependent CD control functions */
+static const char *SDL_SYS_CDName(int drive);
+static int SDL_SYS_CDOpen(int drive);
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
+static int SDL_SYS_CDPause(SDL_CD *cdrom);
+static int SDL_SYS_CDResume(SDL_CD *cdrom);
+static int SDL_SYS_CDStop(SDL_CD *cdrom);
+static int SDL_SYS_CDEject(SDL_CD *cdrom);
+static void SDL_SYS_CDClose(SDL_CD *cdrom);
+
+/* Check a drive to see if it is a CD-ROM */
+static int CheckDrive(char *drive, struct stat *stbuf)
+{
+ int is_cd, cdfd;
+ cam_devinfo_t dinfo;
+ int devctlret=0;
+
+ int atapi;
+ int removable;
+ int cdb10;
+
+ /* If it doesn't exist, return -1 */
+ if (stat(drive, stbuf) < 0)
+ {
+ return(-1);
+ }
+
+ /* If it does exist, verify that it's an available CD-ROM */
+ is_cd = 0;
+
+ if (S_ISCHR(stbuf->st_mode) || S_ISBLK(stbuf->st_mode))
+ {
+ cdfd = open(drive, QNX_CD_OPENMODE);
+ if ( cdfd >= 0 )
+ {
+ devctlret=devctl(cdfd, DCMD_CAM_DEVINFO, &dinfo, sizeof(cam_devinfo_t), NULL);
+
+ if (devctlret==EOK)
+ {
+ atapi=dinfo.flags & DEV_ATAPI;
+ removable=dinfo.flags & DEV_REMOVABLE;
+ cdb10=dinfo.flags & DEV_CDB_10; /* I'm not sure about that flag */
+
+ /* in the near future need to add more checks for splitting cdroms from other devices */
+ if ((atapi)&&(removable))
+ {
+ is_cd = 1;
+ }
+ }
+
+ close(cdfd);
+ }
+ }
+ return(is_cd);
+}
+
+/* Add a CD-ROM drive to our list of valid drives */
+static void AddDrive(char *drive, struct stat *stbuf)
+{
+ int i;
+
+ if (SDL_numcds < MAX_DRIVES)
+ {
+ /* Check to make sure it's not already in our list.
+ This can happen when we see a drive via symbolic link. */
+
+ for (i=0; i<SDL_numcds; ++i)
+ {
+ if (stbuf->st_rdev == SDL_cdmode[i])
+ {
+ return;
+ }
+ }
+
+ /* Add this drive to our list */
+
+ i = SDL_numcds;
+ SDL_cdlist[i] = SDL_strdup(drive);
+ if (SDL_cdlist[i] == NULL)
+ {
+ SDL_OutOfMemory();
+ return;
+ }
+ SDL_cdmode[i] = stbuf->st_rdev;
+ ++SDL_numcds;
+ }
+}
+
+int SDL_SYS_CDInit(void)
+{
+ /* checklist: /dev/cdrom, /dev/cd?, /dev/scd? */
+ static char *checklist[]={"cdrom", "?0 cd?", "?1 cd?", "?0 scd?", NULL};
+
+ char *SDLcdrom;
+ int i, j, exists;
+ char drive[32];
+ struct stat stbuf;
+
+ /* Fill in our driver capabilities */
+ SDL_CDcaps.Name = SDL_SYS_CDName;
+ SDL_CDcaps.Open = SDL_SYS_CDOpen;
+ SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
+ SDL_CDcaps.Status = SDL_SYS_CDStatus;
+ SDL_CDcaps.Play = SDL_SYS_CDPlay;
+ SDL_CDcaps.Pause = SDL_SYS_CDPause;
+ SDL_CDcaps.Resume = SDL_SYS_CDResume;
+ SDL_CDcaps.Stop = SDL_SYS_CDStop;
+ SDL_CDcaps.Eject = SDL_SYS_CDEject;
+ SDL_CDcaps.Close = SDL_SYS_CDClose;
+
+ /* clearing device open status */
+ for (i=0; i<MAX_DRIVES; i++)
+ {
+ SDL_cdopen[i]=0;
+ }
+
+ /* Look in the environment for our CD-ROM drive list */
+ SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */
+ if ( SDLcdrom != NULL )
+ {
+ char *cdpath, *delim;
+ size_t len = SDL_strlen(SDLcdrom)+1;
+ cdpath = SDL_stack_alloc(char, len);
+ if (cdpath != NULL)
+ {
+ SDL_strlcpy(cdpath, SDLcdrom, len);
+ SDLcdrom = cdpath;
+ do {
+ delim = SDL_strchr(SDLcdrom, ':');
+ if (delim)
+ {
+ *delim++ = '\0';
+ }
+ if (CheckDrive(SDLcdrom, &stbuf) > 0)
+ {
+ AddDrive(SDLcdrom, &stbuf);
+ }
+ if (delim)
+ {
+ SDLcdrom = delim;
+ }
+ else
+ {
+ SDLcdrom = NULL;
+ }
+ } while (SDLcdrom);
+ SDL_stack_free(cdpath);
+ }
+
+ /* If we found our drives, there's nothing left to do */
+ if (SDL_numcds > 0)
+ {
+ return(0);
+ }
+ }
+
+ /* Scan the system for CD-ROM drives */
+ for ( i=0; checklist[i]; ++i )
+ {
+ if (checklist[i][0] == '?')
+ {
+ char* insert;
+ exists = 1;
+
+ for ( j=checklist[i][1]; exists; ++j )
+ {
+ SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", &checklist[i][3]);
+ insert = SDL_strchr(drive, '?');
+ if (insert != NULL)
+ {
+ *insert = j;
+ }
+ switch (CheckDrive(drive, &stbuf))
+ {
+ /* Drive exists and is a CD-ROM */
+ case 1:
+ AddDrive(drive, &stbuf);
+ break;
+ /* Drive exists, but isn't a CD-ROM */
+ case 0:
+ break;
+ /* Drive doesn't exist */
+ case -1:
+ exists = 0;
+ break;
+ }
+ }
+ }
+ else
+ {
+ SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]);
+ if (CheckDrive(drive, &stbuf) > 0)
+ {
+ AddDrive(drive, &stbuf);
+ }
+ }
+ }
+ return(0);
+}
+
+static const char *SDL_SYS_CDName(int drive)
+{
+ return(SDL_cdlist[drive]);
+}
+
+static int SDL_SYS_CDOpen(int drive)
+{
+ int handle;
+
+ handle=open(SDL_cdlist[drive], QNX_CD_OPENMODE);
+
+ if (handle>0)
+ {
+ SDL_cdopen[drive]=handle;
+ }
+
+ return (handle);
+}
+
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
+{
+ cdrom_read_toc_t toc;
+ int i, okay;
+
+ okay = 0;
+ if (devctl(cdrom->id, DCMD_CAM_CDROMREADTOC, &toc, sizeof(toc), NULL) == 0)
+ {
+ cdrom->numtracks = toc.last_track - toc.first_track + 1;
+ if (cdrom->numtracks > SDL_MAX_TRACKS)
+ {
+ cdrom->numtracks = SDL_MAX_TRACKS;
+ }
+ /* Read all the track TOC entries */
+ for (i=0; i<=cdrom->numtracks; ++i)
+ {
+ if (i == cdrom->numtracks)
+ {
+ cdrom->track[i].id = CDROM_LEADOUT;
+ }
+ else
+ {
+ cdrom->track[i].id = toc.first_track+i;
+ }
+
+ cdrom->track[i].type = toc.toc_entry[i].control_adr & 0x0F;
+ cdrom->track[i].offset = toc.toc_entry[i].addr.lba;
+ cdrom->track[i].length = 0;
+
+ if (i > 0)
+ {
+ cdrom->track[i-1].length = cdrom->track[i].offset-cdrom->track[i-1].offset;
+ }
+ }
+ if (i == (cdrom->numtracks+1))
+ {
+ okay = 1;
+ }
+ }
+ return (okay ? 0 : -1);
+}
+
+/* Get CD-ROM status */
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
+{
+ CDstatus status;
+
+ cdrom_read_toc_t toc;
+ cdrom_subch_data_t info;
+ cam_devinfo_t dinfo;
+
+ int devctlret=0;
+ int drive=-1;
+ int i;
+ int eagaincnt=0;
+
+ /* check media presence before read subchannel call, some cdroms can lockups */
+ /* if no media, while calling read subchannel functions. */
+ devctlret=devctl(cdrom->id, DCMD_CAM_DEVINFO, &dinfo, sizeof(cam_devinfo_t), NULL);
+
+ if (devctlret==EOK)
+ {
+ if ((dinfo.flags & DEV_NO_MEDIA)!=0)
+ {
+ status = CD_TRAYEMPTY;
+ if (position)
+ {
+ *position = 0;
+ }
+ return (status);
+ }
+ }
+
+ /* if media exists, then do other stuff */
+
+ SDL_memset(&info, 0x00, sizeof(info));
+ info.subch_command.data_format = CDROM_SUBCH_CURRENT_POSITION;
+
+ do {
+ devctlret=devctl(cdrom->id, DCMD_CAM_CDROMSUBCHNL, &info, sizeof(info), NULL);
+ if (devctlret==EIO)
+ {
+ /* big workaround for media change, handle is unusable after that,
+ that bug was found in QNX 6.2, 6.2.1 is not released yet. */
+
+ for (i=0; i<MAX_DRIVES; i++)
+ {
+ if (SDL_cdopen[i]==cdrom->id)
+ {
+ drive=i;
+ break;
+ }
+ }
+ if (drive==-1)
+ {
+ /* that cannot happen, but ... */
+ break;
+ }
+ close(cdrom->id);
+ cdrom->id=open(SDL_cdlist[drive], QNX_CD_OPENMODE);
+ devctlret=EAGAIN;
+ }
+ if (devctlret==EAGAIN)
+ {
+ eagaincnt++;
+ }
+ if (eagaincnt==2)
+ {
+ /* workaround for broken cdroms, which can return always EAGAIN when its not ready, */
+ /* that mean errornous media or just no media avail */
+ devctlret=ENXIO;
+ break;
+ }
+ } while ((devctlret==EAGAIN)||(devctlret==ESTALE));
+
+ if (devctlret != 0)
+ {
+ if (devctlret==ENXIO)
+ {
+ status = CD_TRAYEMPTY;
+ }
+ else
+ {
+ status = CD_ERROR;
+ }
+ }
+ else
+ {
+ switch (info.current_position.header.audio_status)
+ {
+ case CDROM_AUDIO_INVALID:
+ case CDROM_AUDIO_NO_STATUS:
+ /* Try to determine if there's a CD available */
+ if (devctl(cdrom->id, DCMD_CAM_CDROMREADTOC, &toc, sizeof(toc), NULL)==0)
+ status = CD_STOPPED;
+ else
+ status = CD_TRAYEMPTY;
+ break;
+ case CDROM_AUDIO_COMPLETED:
+ status = CD_STOPPED;
+ break;
+ case CDROM_AUDIO_PLAY:
+ status = CD_PLAYING;
+ break;
+ case CDROM_AUDIO_PAUSED:
+ /* Workaround buggy CD-ROM drive */
+ if (info.current_position.data_format == CDROM_LEADOUT)
+ {
+ status = CD_STOPPED;
+ }
+ else
+ {
+ status = CD_PAUSED;
+ }
+ break;
+ default:
+ status = CD_ERROR;
+ break;
+ }
+ }
+
+ if (position)
+ {
+ if (status==CD_PLAYING || (status==CD_PAUSED))
+ {
+ *position = MSF_TO_FRAMES(info.current_position.addr.msf.minute,
+ info.current_position.addr.msf.second,
+ info.current_position.addr.msf.frame);
+ }
+ else
+ {
+ *position = 0;
+ }
+ }
+
+ return (status);
+}
+
+/* Start play */
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
+{
+ cdrom_playmsf_t playtime;
+
+ FRAMES_TO_MSF(start, &playtime.start_minute, &playtime.start_second, &playtime.start_frame);
+ FRAMES_TO_MSF(start+length, &playtime.end_minute, &playtime.end_second, &playtime.end_frame);
+
+ if (devctl(cdrom->id, DCMD_CAM_CDROMPLAYMSF, &playtime, sizeof(playtime), NULL) != 0)
+ {
+ return -1;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+/* Pause play */
+static int SDL_SYS_CDPause(SDL_CD *cdrom)
+{
+ if (devctl(cdrom->id, DCMD_CAM_CDROMPAUSE, NULL, 0, NULL)!=0)
+ {
+ return -1;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+/* Resume play */
+static int SDL_SYS_CDResume(SDL_CD *cdrom)
+{
+ if (devctl(cdrom->id, DCMD_CAM_CDROMRESUME, NULL, 0, NULL)!=0)
+ {
+ return -1;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+/* Stop play */
+static int SDL_SYS_CDStop(SDL_CD *cdrom)
+{
+ if (devctl(cdrom->id, DCMD_CAM_CDROMSTOP, NULL, 0, NULL)!=0)
+ {
+ return -1;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+/* Eject the CD-ROM */
+static int SDL_SYS_CDEject(SDL_CD *cdrom)
+{
+ if (devctl(cdrom->id, DCMD_CAM_EJECT_MEDIA, NULL, 0, NULL)!=0)
+ {
+ return -1;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+/* Close the CD-ROM handle */
+static void SDL_SYS_CDClose(SDL_CD *cdrom)
+{
+ int i;
+
+ for (i=0; i<MAX_DRIVES; i++)
+ {
+ if (SDL_cdopen[i]==cdrom->id)
+ {
+ SDL_cdopen[i]=0;
+ break;
+ }
+ }
+
+ close(cdrom->id);
+}
+
+void SDL_SYS_CDQuit(void)
+{
+ int i;
+
+ if (SDL_numcds > 0)
+ {
+ for (i=0; i<SDL_numcds; ++i)
+ {
+ SDL_free(SDL_cdlist[i]);
+ }
+ SDL_numcds = 0;
+ }
+}
+
+#endif /* SDL_CDROM_QNX */
diff --git a/distrib/sdl-1.2.15/src/cdrom/win32/SDL_syscdrom.c b/distrib/sdl-1.2.15/src/cdrom/win32/SDL_syscdrom.c
new file mode 100644
index 0000000..cac9fd3
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cdrom/win32/SDL_syscdrom.c
@@ -0,0 +1,386 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_CDROM_WIN32
+
+/* Functions for system-level CD-ROM audio control */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <mmsystem.h>
+
+#include "SDL_cdrom.h"
+#include "../SDL_syscdrom.h"
+
+/* This really broken?? */
+#define BROKEN_MCI_PAUSE /* Pausing actually stops play -- Doh! */
+
+/* The maximum number of CD-ROM drives we'll detect (Don't change!) */
+#define MAX_DRIVES 26
+
+/* A list of available CD-ROM drives */
+static char *SDL_cdlist[MAX_DRIVES];
+static MCIDEVICEID SDL_mciID[MAX_DRIVES];
+#ifdef BROKEN_MCI_PAUSE
+static int SDL_paused[MAX_DRIVES];
+#endif
+static int SDL_CD_end_position;
+
+/* The system-dependent CD control functions */
+static const char *SDL_SYS_CDName(int drive);
+static int SDL_SYS_CDOpen(int drive);
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom);
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position);
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length);
+static int SDL_SYS_CDPause(SDL_CD *cdrom);
+static int SDL_SYS_CDResume(SDL_CD *cdrom);
+static int SDL_SYS_CDStop(SDL_CD *cdrom);
+static int SDL_SYS_CDEject(SDL_CD *cdrom);
+static void SDL_SYS_CDClose(SDL_CD *cdrom);
+
+
+/* Add a CD-ROM drive to our list of valid drives */
+static void AddDrive(char *drive)
+{
+ int i;
+
+ if ( SDL_numcds < MAX_DRIVES ) {
+ /* Add this drive to our list */
+ i = SDL_numcds;
+ SDL_cdlist[i] = SDL_strdup(drive);
+ if ( SDL_cdlist[i] == NULL ) {
+ SDL_OutOfMemory();
+ return;
+ }
+ ++SDL_numcds;
+#ifdef CDROM_DEBUG
+ fprintf(stderr, "Added CD-ROM drive: %s\n", drive);
+#endif
+ }
+}
+
+int SDL_SYS_CDInit(void)
+{
+ /* checklist: Drive 'A' - 'Z' */
+ int i;
+ char drive[4];
+
+ /* Fill in our driver capabilities */
+ SDL_CDcaps.Name = SDL_SYS_CDName;
+ SDL_CDcaps.Open = SDL_SYS_CDOpen;
+ SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC;
+ SDL_CDcaps.Status = SDL_SYS_CDStatus;
+ SDL_CDcaps.Play = SDL_SYS_CDPlay;
+ SDL_CDcaps.Pause = SDL_SYS_CDPause;
+ SDL_CDcaps.Resume = SDL_SYS_CDResume;
+ SDL_CDcaps.Stop = SDL_SYS_CDStop;
+ SDL_CDcaps.Eject = SDL_SYS_CDEject;
+ SDL_CDcaps.Close = SDL_SYS_CDClose;
+
+ /* Scan the system for CD-ROM drives */
+ for ( i='A'; i<='Z'; ++i ) {
+ SDL_snprintf(drive, SDL_arraysize(drive), "%c:\\", i);
+ if ( GetDriveType(drive) == DRIVE_CDROM ) {
+ AddDrive(drive);
+ }
+ }
+ SDL_memset(SDL_mciID, 0, sizeof(SDL_mciID));
+ return(0);
+}
+
+/* General ioctl() CD-ROM command function */
+static int SDL_SYS_CDioctl(int id, UINT msg, DWORD flags, void *arg)
+{
+ MCIERROR mci_error;
+
+ mci_error = mciSendCommand(SDL_mciID[id], msg, flags, (DWORD_PTR)arg);
+ if ( mci_error ) {
+ char error[256];
+
+ mciGetErrorString(mci_error, error, 256);
+ SDL_SetError("mciSendCommand() error: %s", error);
+ }
+ return(!mci_error ? 0 : -1);
+}
+
+static const char *SDL_SYS_CDName(int drive)
+{
+ return(SDL_cdlist[drive]);
+}
+
+static int SDL_SYS_CDOpen(int drive)
+{
+ MCI_OPEN_PARMS mci_open;
+ MCI_SET_PARMS mci_set;
+ char device[3];
+ DWORD flags;
+
+ /* Open the requested device */
+ mci_open.lpstrDeviceType = (LPCSTR) MCI_DEVTYPE_CD_AUDIO;
+ device[0] = *SDL_cdlist[drive];
+ device[1] = ':';
+ device[2] = '\0';
+ mci_open.lpstrElementName = device;
+ flags =
+ (MCI_OPEN_TYPE|MCI_OPEN_SHAREABLE|MCI_OPEN_TYPE_ID|MCI_OPEN_ELEMENT);
+ if ( SDL_SYS_CDioctl(0, MCI_OPEN, flags, &mci_open) < 0 ) {
+ flags &= ~MCI_OPEN_SHAREABLE;
+ if ( SDL_SYS_CDioctl(0, MCI_OPEN, flags, &mci_open) < 0 ) {
+ return(-1);
+ }
+ }
+ SDL_mciID[drive] = mci_open.wDeviceID;
+
+ /* Set the minute-second-frame time format */
+ mci_set.dwTimeFormat = MCI_FORMAT_MSF;
+ SDL_SYS_CDioctl(drive, MCI_SET, MCI_SET_TIME_FORMAT, &mci_set);
+
+#ifdef BROKEN_MCI_PAUSE
+ SDL_paused[drive] = 0;
+#endif
+ return(drive);
+}
+
+static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
+{
+ MCI_STATUS_PARMS mci_status;
+ int i, okay;
+ DWORD flags;
+
+ okay = 0;
+ mci_status.dwItem = MCI_STATUS_NUMBER_OF_TRACKS;
+ flags = MCI_STATUS_ITEM | MCI_WAIT;
+ if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags, &mci_status) == 0 ) {
+ cdrom->numtracks = mci_status.dwReturn;
+ if ( cdrom->numtracks > SDL_MAX_TRACKS ) {
+ cdrom->numtracks = SDL_MAX_TRACKS;
+ }
+ /* Read all the track TOC entries */
+ flags = MCI_STATUS_ITEM | MCI_TRACK | MCI_WAIT;
+ for ( i=0; i<cdrom->numtracks; ++i ) {
+ cdrom->track[i].id = i+1;
+ mci_status.dwTrack = cdrom->track[i].id;
+#ifdef MCI_CDA_STATUS_TYPE_TRACK
+ mci_status.dwItem = MCI_CDA_STATUS_TYPE_TRACK;
+ if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags,
+ &mci_status) < 0 ) {
+ break;
+ }
+ if ( mci_status.dwReturn == MCI_CDA_TRACK_AUDIO ) {
+ cdrom->track[i].type = SDL_AUDIO_TRACK;
+ } else {
+ cdrom->track[i].type = SDL_DATA_TRACK;
+ }
+#else
+ cdrom->track[i].type = SDL_AUDIO_TRACK;
+#endif
+ mci_status.dwItem = MCI_STATUS_POSITION;
+ if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags,
+ &mci_status) < 0 ) {
+ break;
+ }
+ cdrom->track[i].offset = MSF_TO_FRAMES(
+ MCI_MSF_MINUTE(mci_status.dwReturn),
+ MCI_MSF_SECOND(mci_status.dwReturn),
+ MCI_MSF_FRAME(mci_status.dwReturn));
+ cdrom->track[i].length = 0;
+ if ( i > 0 ) {
+ cdrom->track[i-1].length =
+ cdrom->track[i].offset-
+ cdrom->track[i-1].offset;
+ }
+ }
+ if ( i == cdrom->numtracks ) {
+ mci_status.dwTrack = cdrom->track[i - 1].id;
+ mci_status.dwItem = MCI_STATUS_LENGTH;
+ if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags,
+ &mci_status) == 0 ) {
+ cdrom->track[i - 1].length = MSF_TO_FRAMES(
+ MCI_MSF_MINUTE(mci_status.dwReturn),
+ MCI_MSF_SECOND(mci_status.dwReturn),
+ MCI_MSF_FRAME(mci_status.dwReturn));
+ /* compute lead-out offset */
+ cdrom->track[i].offset = cdrom->track[i - 1].offset +
+ cdrom->track[i - 1].length;
+ cdrom->track[i].length = 0;
+ okay = 1;
+ }
+ }
+ }
+ return(okay ? 0 : -1);
+}
+
+/* Get CD-ROM status */
+static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
+{
+ CDstatus status;
+ MCI_STATUS_PARMS mci_status;
+ DWORD flags;
+
+ flags = MCI_STATUS_ITEM | MCI_WAIT;
+ mci_status.dwItem = MCI_STATUS_MODE;
+ if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags, &mci_status) < 0 ) {
+ status = CD_ERROR;
+ } else {
+ switch (mci_status.dwReturn) {
+ case MCI_MODE_NOT_READY:
+ case MCI_MODE_OPEN:
+ status = CD_TRAYEMPTY;
+ break;
+ case MCI_MODE_STOP:
+#ifdef BROKEN_MCI_PAUSE
+ if ( SDL_paused[cdrom->id] ) {
+ status = CD_PAUSED;
+ } else {
+ status = CD_STOPPED;
+ }
+#else
+ status = CD_STOPPED;
+#endif /* BROKEN_MCI_PAUSE */
+ break;
+ case MCI_MODE_PLAY:
+#ifdef BROKEN_MCI_PAUSE
+ if ( SDL_paused[cdrom->id] ) {
+ status = CD_PAUSED;
+ } else {
+ status = CD_PLAYING;
+ }
+#else
+ status = CD_PLAYING;
+#endif /* BROKEN_MCI_PAUSE */
+ break;
+ case MCI_MODE_PAUSE:
+ status = CD_PAUSED;
+ break;
+ default:
+ status = CD_ERROR;
+ break;
+ }
+ }
+ if ( position ) {
+ if ( status == CD_PLAYING || (status == CD_PAUSED) ) {
+ mci_status.dwItem = MCI_STATUS_POSITION;
+ if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags,
+ &mci_status) == 0 ) {
+ *position = MSF_TO_FRAMES(
+ MCI_MSF_MINUTE(mci_status.dwReturn),
+ MCI_MSF_SECOND(mci_status.dwReturn),
+ MCI_MSF_FRAME(mci_status.dwReturn));
+ } else {
+ *position = 0;
+ }
+ } else {
+ *position = 0;
+ }
+ }
+ return(status);
+}
+
+/* Start play */
+static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length)
+{
+ MCI_PLAY_PARMS mci_play;
+ int m, s, f;
+ DWORD flags;
+
+ flags = MCI_FROM | MCI_TO | MCI_NOTIFY;
+ mci_play.dwCallback = 0;
+ FRAMES_TO_MSF(start, &m, &s, &f);
+ mci_play.dwFrom = MCI_MAKE_MSF(m, s, f);
+ FRAMES_TO_MSF(start+length, &m, &s, &f);
+ mci_play.dwTo = MCI_MAKE_MSF(m, s, f);
+ SDL_CD_end_position = mci_play.dwTo;
+ return(SDL_SYS_CDioctl(cdrom->id, MCI_PLAY, flags, &mci_play));
+}
+
+/* Pause play */
+static int SDL_SYS_CDPause(SDL_CD *cdrom)
+{
+#ifdef BROKEN_MCI_PAUSE
+ SDL_paused[cdrom->id] = 1;
+#endif
+ return(SDL_SYS_CDioctl(cdrom->id, MCI_PAUSE, MCI_WAIT, NULL));
+}
+
+/* Resume play */
+static int SDL_SYS_CDResume(SDL_CD *cdrom)
+{
+#ifdef BROKEN_MCI_PAUSE
+ MCI_STATUS_PARMS mci_status;
+ int okay;
+ int flags;
+
+ okay = 0;
+ /* Play from the current play position to the end position set earlier */
+ flags = MCI_STATUS_ITEM | MCI_WAIT;
+ mci_status.dwItem = MCI_STATUS_POSITION;
+ if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags, &mci_status) == 0 ) {
+ MCI_PLAY_PARMS mci_play;
+
+ flags = MCI_FROM | MCI_TO | MCI_NOTIFY;
+ mci_play.dwCallback = 0;
+ mci_play.dwFrom = mci_status.dwReturn;
+ mci_play.dwTo = SDL_CD_end_position;
+ if (SDL_SYS_CDioctl(cdrom->id,MCI_PLAY,flags,&mci_play) == 0) {
+ okay = 1;
+ SDL_paused[cdrom->id] = 0;
+ }
+ }
+ return(okay ? 0 : -1);
+#else
+ return(SDL_SYS_CDioctl(cdrom->id, MCI_RESUME, MCI_WAIT, NULL));
+#endif /* BROKEN_MCI_PAUSE */
+}
+
+/* Stop play */
+static int SDL_SYS_CDStop(SDL_CD *cdrom)
+{
+ return(SDL_SYS_CDioctl(cdrom->id, MCI_STOP, MCI_WAIT, NULL));
+}
+
+/* Eject the CD-ROM */
+static int SDL_SYS_CDEject(SDL_CD *cdrom)
+{
+ return(SDL_SYS_CDioctl(cdrom->id, MCI_SET, MCI_SET_DOOR_OPEN, NULL));
+}
+
+/* Close the CD-ROM handle */
+static void SDL_SYS_CDClose(SDL_CD *cdrom)
+{
+ SDL_SYS_CDioctl(cdrom->id, MCI_CLOSE, MCI_WAIT, NULL);
+}
+
+void SDL_SYS_CDQuit(void)
+{
+ int i;
+
+ if ( SDL_numcds > 0 ) {
+ for ( i=0; i<SDL_numcds; ++i ) {
+ SDL_free(SDL_cdlist[i]);
+ SDL_cdlist[i] = NULL;
+ }
+ SDL_numcds = 0;
+ }
+}
+
+#endif /* SDL_CDROM_WIN32 */
diff --git a/distrib/sdl-1.2.15/src/cpuinfo/SDL_cpuinfo.c b/distrib/sdl-1.2.15/src/cpuinfo/SDL_cpuinfo.c
new file mode 100644
index 0000000..0cd0838
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/cpuinfo/SDL_cpuinfo.c
@@ -0,0 +1,499 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* CPU feature detection for SDL */
+
+#include "SDL.h"
+#include "SDL_cpuinfo.h"
+
+#if defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))
+#include <sys/sysctl.h> /* For AltiVec check */
+#elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
+#include <signal.h>
+#include <setjmp.h>
+#endif
+
+#define CPU_HAS_RDTSC 0x00000001
+#define CPU_HAS_MMX 0x00000002
+#define CPU_HAS_MMXEXT 0x00000004
+#define CPU_HAS_3DNOW 0x00000010
+#define CPU_HAS_3DNOWEXT 0x00000020
+#define CPU_HAS_SSE 0x00000040
+#define CPU_HAS_SSE2 0x00000080
+#define CPU_HAS_ALTIVEC 0x00000100
+
+#if SDL_ALTIVEC_BLITTERS && HAVE_SETJMP && !__MACOSX__
+/* This is the brute force way of detecting instruction sets...
+ the idea is borrowed from the libmpeg2 library - thanks!
+ */
+static jmp_buf jmpbuf;
+static void illegal_instruction(int sig)
+{
+ longjmp(jmpbuf, 1);
+}
+#endif /* HAVE_SETJMP */
+
+static __inline__ int CPU_haveCPUID(void)
+{
+ int has_CPUID = 0;
+#if defined(__GNUC__) && defined(i386)
+ __asm__ (
+" pushfl # Get original EFLAGS \n"
+" popl %%eax \n"
+" movl %%eax,%%ecx \n"
+" xorl $0x200000,%%eax # Flip ID bit in EFLAGS \n"
+" pushl %%eax # Save new EFLAGS value on stack \n"
+" popfl # Replace current EFLAGS value \n"
+" pushfl # Get new EFLAGS \n"
+" popl %%eax # Store new EFLAGS in EAX \n"
+" xorl %%ecx,%%eax # Can not toggle ID bit, \n"
+" jz 1f # Processor=80486 \n"
+" movl $1,%0 # We have CPUID support \n"
+"1: \n"
+ : "=m" (has_CPUID)
+ :
+ : "%eax", "%ecx"
+ );
+#elif defined(__GNUC__) && defined(__x86_64__)
+/* Technically, if this is being compiled under __x86_64__ then it has
+CPUid by definition. But it's nice to be able to prove it. :) */
+ __asm__ (
+" pushfq # Get original EFLAGS \n"
+" popq %%rax \n"
+" movq %%rax,%%rcx \n"
+" xorl $0x200000,%%eax # Flip ID bit in EFLAGS \n"
+" pushq %%rax # Save new EFLAGS value on stack \n"
+" popfq # Replace current EFLAGS value \n"
+" pushfq # Get new EFLAGS \n"
+" popq %%rax # Store new EFLAGS in EAX \n"
+" xorl %%ecx,%%eax # Can not toggle ID bit, \n"
+" jz 1f # Processor=80486 \n"
+" movl $1,%0 # We have CPUID support \n"
+"1: \n"
+ : "=m" (has_CPUID)
+ :
+ : "%rax", "%rcx"
+ );
+#elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
+ __asm {
+ pushfd ; Get original EFLAGS
+ pop eax
+ mov ecx, eax
+ xor eax, 200000h ; Flip ID bit in EFLAGS
+ push eax ; Save new EFLAGS value on stack
+ popfd ; Replace current EFLAGS value
+ pushfd ; Get new EFLAGS
+ pop eax ; Store new EFLAGS in EAX
+ xor eax, ecx ; Can not toggle ID bit,
+ jz done ; Processor=80486
+ mov has_CPUID,1 ; We have CPUID support
+done:
+ }
+#elif defined(__sun) && defined(__i386)
+ __asm (
+" pushfl \n"
+" popl %eax \n"
+" movl %eax,%ecx \n"
+" xorl $0x200000,%eax \n"
+" pushl %eax \n"
+" popfl \n"
+" pushfl \n"
+" popl %eax \n"
+" xorl %ecx,%eax \n"
+" jz 1f \n"
+" movl $1,-8(%ebp) \n"
+"1: \n"
+ );
+#elif defined(__sun) && defined(__amd64)
+ __asm (
+" pushfq \n"
+" popq %rax \n"
+" movq %rax,%rcx \n"
+" xorl $0x200000,%eax \n"
+" pushq %rax \n"
+" popfq \n"
+" pushfq \n"
+" popq %rax \n"
+" xorl %ecx,%eax \n"
+" jz 1f \n"
+" movl $1,-8(%rbp) \n"
+"1: \n"
+ );
+#endif
+ return has_CPUID;
+}
+
+static __inline__ int CPU_getCPUIDFeatures(void)
+{
+ int features = 0;
+#if defined(__GNUC__) && defined(i386)
+ __asm__ (
+" xorl %%eax,%%eax # Set up for CPUID instruction \n"
+" pushl %%ebx \n"
+" cpuid # Get and save vendor ID \n"
+" popl %%ebx \n"
+" cmpl $1,%%eax # Make sure 1 is valid input for CPUID\n"
+" jl 1f # We dont have the CPUID instruction\n"
+" xorl %%eax,%%eax \n"
+" incl %%eax \n"
+" pushl %%ebx \n"
+" cpuid # Get family/model/stepping/features\n"
+" popl %%ebx \n"
+" movl %%edx,%0 \n"
+"1: \n"
+ : "=m" (features)
+ :
+ : "%eax", "%ecx", "%edx"
+ );
+#elif defined(__GNUC__) && defined(__x86_64__)
+ __asm__ (
+" xorl %%eax,%%eax # Set up for CPUID instruction \n"
+" pushq %%rbx \n"
+" cpuid # Get and save vendor ID \n"
+" popq %%rbx \n"
+" cmpl $1,%%eax # Make sure 1 is valid input for CPUID\n"
+" jl 1f # We dont have the CPUID instruction\n"
+" xorl %%eax,%%eax \n"
+" incl %%eax \n"
+" pushq %%rbx \n"
+" cpuid # Get family/model/stepping/features\n"
+" popq %%rbx \n"
+" movl %%edx,%0 \n"
+"1: \n"
+ : "=m" (features)
+ :
+ : "%rax", "%rcx", "%rdx"
+ );
+#elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
+ __asm {
+ xor eax, eax ; Set up for CPUID instruction
+ push ebx
+ cpuid ; Get and save vendor ID
+ pop ebx
+ cmp eax, 1 ; Make sure 1 is valid input for CPUID
+ jl done ; We dont have the CPUID instruction
+ xor eax, eax
+ inc eax
+ push ebx
+ cpuid ; Get family/model/stepping/features
+ pop ebx
+ mov features, edx
+done:
+ }
+#elif defined(__sun) && (defined(__i386) || defined(__amd64))
+ __asm(
+" xorl %eax,%eax \n"
+" pushl %ebx \n"
+" cpuid \n"
+" popl %ebx \n"
+" cmpl $1,%eax \n"
+" jl 1f \n"
+" xorl %eax,%eax \n"
+" incl %eax \n"
+" pushl %ebx \n"
+" cpuid \n"
+" popl %ebx \n"
+#ifdef __i386
+" movl %edx,-8(%ebp) \n"
+#else
+" movl %edx,-8(%rbp) \n"
+#endif
+"1: \n"
+#endif
+ return features;
+}
+
+static __inline__ int CPU_getCPUIDFeaturesExt(void)
+{
+ int features = 0;
+#if defined(__GNUC__) && defined(i386)
+ __asm__ (
+" movl $0x80000000,%%eax # Query for extended functions \n"
+" pushl %%ebx \n"
+" cpuid # Get extended function limit \n"
+" popl %%ebx \n"
+" cmpl $0x80000001,%%eax \n"
+" jl 1f # Nope, we dont have function 800000001h\n"
+" movl $0x80000001,%%eax # Setup extended function 800000001h\n"
+" pushl %%ebx \n"
+" cpuid # and get the information \n"
+" popl %%ebx \n"
+" movl %%edx,%0 \n"
+"1: \n"
+ : "=m" (features)
+ :
+ : "%eax", "%ecx", "%edx"
+ );
+#elif defined(__GNUC__) && defined (__x86_64__)
+ __asm__ (
+" movl $0x80000000,%%eax # Query for extended functions \n"
+" pushq %%rbx \n"
+" cpuid # Get extended function limit \n"
+" popq %%rbx \n"
+" cmpl $0x80000001,%%eax \n"
+" jl 1f # Nope, we dont have function 800000001h\n"
+" movl $0x80000001,%%eax # Setup extended function 800000001h\n"
+" pushq %%rbx \n"
+" cpuid # and get the information \n"
+" popq %%rbx \n"
+" movl %%edx,%0 \n"
+"1: \n"
+ : "=m" (features)
+ :
+ : "%rax", "%rcx", "%rdx"
+ );
+#elif (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
+ __asm {
+ mov eax,80000000h ; Query for extended functions
+ push ebx
+ cpuid ; Get extended function limit
+ pop ebx
+ cmp eax,80000001h
+ jl done ; Nope, we dont have function 800000001h
+ mov eax,80000001h ; Setup extended function 800000001h
+ push ebx
+ cpuid ; and get the information
+ pop ebx
+ mov features,edx
+done:
+ }
+#elif defined(__sun) && ( defined(__i386) || defined(__amd64) )
+ __asm (
+" movl $0x80000000,%eax \n"
+" pushl %ebx \n"
+" cpuid \n"
+" popl %ebx \n"
+" cmpl $0x80000001,%eax \n"
+" jl 1f \n"
+" movl $0x80000001,%eax \n"
+" pushl %ebx \n"
+" cpuid \n"
+" popl %ebx \n"
+#ifdef __i386
+" movl %edx,-8(%ebp) \n"
+#else
+" movl %edx,-8(%rbp) \n"
+#endif
+"1: \n"
+ );
+#endif
+ return features;
+}
+
+static __inline__ int CPU_haveRDTSC(void)
+{
+ if ( CPU_haveCPUID() ) {
+ return (CPU_getCPUIDFeatures() & 0x00000010);
+ }
+ return 0;
+}
+
+static __inline__ int CPU_haveMMX(void)
+{
+ if ( CPU_haveCPUID() ) {
+ return (CPU_getCPUIDFeatures() & 0x00800000);
+ }
+ return 0;
+}
+
+static __inline__ int CPU_haveMMXExt(void)
+{
+ if ( CPU_haveCPUID() ) {
+ return (CPU_getCPUIDFeaturesExt() & 0x00400000);
+ }
+ return 0;
+}
+
+static __inline__ int CPU_have3DNow(void)
+{
+ if ( CPU_haveCPUID() ) {
+ return (CPU_getCPUIDFeaturesExt() & 0x80000000);
+ }
+ return 0;
+}
+
+static __inline__ int CPU_have3DNowExt(void)
+{
+ if ( CPU_haveCPUID() ) {
+ return (CPU_getCPUIDFeaturesExt() & 0x40000000);
+ }
+ return 0;
+}
+
+static __inline__ int CPU_haveSSE(void)
+{
+ if ( CPU_haveCPUID() ) {
+ return (CPU_getCPUIDFeatures() & 0x02000000);
+ }
+ return 0;
+}
+
+static __inline__ int CPU_haveSSE2(void)
+{
+ if ( CPU_haveCPUID() ) {
+ return (CPU_getCPUIDFeatures() & 0x04000000);
+ }
+ return 0;
+}
+
+static __inline__ int CPU_haveAltiVec(void)
+{
+ volatile int altivec = 0;
+#if defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))
+ int selectors[2] = { CTL_HW, HW_VECTORUNIT };
+ int hasVectorUnit = 0;
+ size_t length = sizeof(hasVectorUnit);
+ int error = sysctl(selectors, 2, &hasVectorUnit, &length, NULL, 0);
+ if( 0 == error )
+ altivec = (hasVectorUnit != 0);
+#elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
+ void (*handler)(int sig);
+ handler = signal(SIGILL, illegal_instruction);
+ if ( setjmp(jmpbuf) == 0 ) {
+ asm volatile ("mtspr 256, %0\n\t"
+ "vand %%v0, %%v0, %%v0"
+ :
+ : "r" (-1));
+ altivec = 1;
+ }
+ signal(SIGILL, handler);
+#endif
+ return altivec;
+}
+
+static Uint32 SDL_CPUFeatures = 0xFFFFFFFF;
+
+static Uint32 SDL_GetCPUFeatures(void)
+{
+ if ( SDL_CPUFeatures == 0xFFFFFFFF ) {
+ SDL_CPUFeatures = 0;
+ if ( CPU_haveRDTSC() ) {
+ SDL_CPUFeatures |= CPU_HAS_RDTSC;
+ }
+ if ( CPU_haveMMX() ) {
+ SDL_CPUFeatures |= CPU_HAS_MMX;
+ }
+ if ( CPU_haveMMXExt() ) {
+ SDL_CPUFeatures |= CPU_HAS_MMXEXT;
+ }
+ if ( CPU_have3DNow() ) {
+ SDL_CPUFeatures |= CPU_HAS_3DNOW;
+ }
+ if ( CPU_have3DNowExt() ) {
+ SDL_CPUFeatures |= CPU_HAS_3DNOWEXT;
+ }
+ if ( CPU_haveSSE() ) {
+ SDL_CPUFeatures |= CPU_HAS_SSE;
+ }
+ if ( CPU_haveSSE2() ) {
+ SDL_CPUFeatures |= CPU_HAS_SSE2;
+ }
+ if ( CPU_haveAltiVec() ) {
+ SDL_CPUFeatures |= CPU_HAS_ALTIVEC;
+ }
+ }
+ return SDL_CPUFeatures;
+}
+
+SDL_bool SDL_HasRDTSC(void)
+{
+ if ( SDL_GetCPUFeatures() & CPU_HAS_RDTSC ) {
+ return SDL_TRUE;
+ }
+ return SDL_FALSE;
+}
+
+SDL_bool SDL_HasMMX(void)
+{
+ if ( SDL_GetCPUFeatures() & CPU_HAS_MMX ) {
+ return SDL_TRUE;
+ }
+ return SDL_FALSE;
+}
+
+SDL_bool SDL_HasMMXExt(void)
+{
+ if ( SDL_GetCPUFeatures() & CPU_HAS_MMXEXT ) {
+ return SDL_TRUE;
+ }
+ return SDL_FALSE;
+}
+
+SDL_bool SDL_Has3DNow(void)
+{
+ if ( SDL_GetCPUFeatures() & CPU_HAS_3DNOW ) {
+ return SDL_TRUE;
+ }
+ return SDL_FALSE;
+}
+
+SDL_bool SDL_Has3DNowExt(void)
+{
+ if ( SDL_GetCPUFeatures() & CPU_HAS_3DNOWEXT ) {
+ return SDL_TRUE;
+ }
+ return SDL_FALSE;
+}
+
+SDL_bool SDL_HasSSE(void)
+{
+ if ( SDL_GetCPUFeatures() & CPU_HAS_SSE ) {
+ return SDL_TRUE;
+ }
+ return SDL_FALSE;
+}
+
+SDL_bool SDL_HasSSE2(void)
+{
+ if ( SDL_GetCPUFeatures() & CPU_HAS_SSE2 ) {
+ return SDL_TRUE;
+ }
+ return SDL_FALSE;
+}
+
+SDL_bool SDL_HasAltiVec(void)
+{
+ if ( SDL_GetCPUFeatures() & CPU_HAS_ALTIVEC ) {
+ return SDL_TRUE;
+ }
+ return SDL_FALSE;
+}
+
+#ifdef TEST_MAIN
+
+#include <stdio.h>
+
+int main()
+{
+ printf("RDTSC: %d\n", SDL_HasRDTSC());
+ printf("MMX: %d\n", SDL_HasMMX());
+ printf("MMXExt: %d\n", SDL_HasMMXExt());
+ printf("3DNow: %d\n", SDL_Has3DNow());
+ printf("3DNowExt: %d\n", SDL_Has3DNowExt());
+ printf("SSE: %d\n", SDL_HasSSE());
+ printf("SSE2: %d\n", SDL_HasSSE2());
+ printf("AltiVec: %d\n", SDL_HasAltiVec());
+ return 0;
+}
+
+#endif /* TEST_MAIN */
diff --git a/distrib/sdl-1.2.15/src/events/SDL_active.c b/distrib/sdl-1.2.15/src/events/SDL_active.c
new file mode 100644
index 0000000..201fb80
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/events/SDL_active.c
@@ -0,0 +1,95 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Application focus/iconification handling code for SDL */
+
+#include "SDL_events.h"
+#include "SDL_events_c.h"
+
+
+/* These are static for our active event handling code */
+static Uint8 SDL_appstate = 0;
+
+/* Public functions */
+int SDL_AppActiveInit(void)
+{
+ /* Start completely active */
+ SDL_appstate = (SDL_APPACTIVE|SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS);
+
+ /* That's it! */
+ return(0);
+}
+void SDL_AppActiveQuit(void)
+{
+}
+
+Uint8 SDL_GetAppState(void)
+{
+ return(SDL_appstate);
+}
+
+/* This is global for SDL_eventloop.c */
+int SDL_PrivateAppActive(Uint8 gain, Uint8 state)
+{
+ int posted;
+ Uint8 new_state;
+
+ /* Modify the current state with the given mask */
+ if ( gain ) {
+ new_state = (SDL_appstate | state);
+ } else {
+ new_state = (SDL_appstate & ~state);
+ }
+
+ /* Drop events that don't change state */
+ if ( new_state == SDL_appstate ) {
+ return(0);
+ }
+
+ /* Update internal active state */
+ SDL_appstate = new_state;
+
+ /* Post the event, if desired */
+ posted = 0;
+ if ( SDL_ProcessEvents[SDL_ACTIVEEVENT] == SDL_ENABLE ) {
+ SDL_Event event;
+ SDL_memset(&event, 0, sizeof(event));
+ event.type = SDL_ACTIVEEVENT;
+ event.active.gain = gain;
+ event.active.state = state;
+ if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
+ posted = 1;
+ SDL_PushEvent(&event);
+ }
+ }
+
+ /* If we lost keyboard focus, post key-up events */
+ if ( (state & SDL_APPINPUTFOCUS) && !gain ) {
+ SDL_ResetKeyboard();
+ }
+ /* If we were minimized, post button-up events */
+ if ( (state & SDL_APPACTIVE) && !gain ) {
+ SDL_ResetMouse();
+ }
+ return(posted);
+}
diff --git a/distrib/sdl-1.2.15/src/events/SDL_events.c b/distrib/sdl-1.2.15/src/events/SDL_events.c
new file mode 100644
index 0000000..8f23c01
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/events/SDL_events.c
@@ -0,0 +1,502 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* General event handling code for SDL */
+
+#include "SDL.h"
+#include "SDL_syswm.h"
+#include "SDL_sysevents.h"
+#include "SDL_events_c.h"
+#include "../timer/SDL_timer_c.h"
+#if !SDL_JOYSTICK_DISABLED
+#include "../joystick/SDL_joystick_c.h"
+#endif
+
+/* Public data -- the event filter */
+SDL_EventFilter SDL_EventOK = NULL;
+Uint8 SDL_ProcessEvents[SDL_NUMEVENTS];
+static Uint32 SDL_eventstate = 0;
+
+/* Private data -- event queue */
+#define MAXEVENTS 128
+static struct {
+ SDL_mutex *lock;
+ int active;
+ int head;
+ int tail;
+ SDL_Event event[MAXEVENTS];
+ int wmmsg_next;
+ struct SDL_SysWMmsg wmmsg[MAXEVENTS];
+} SDL_EventQ;
+
+/* Private data -- event locking structure */
+static struct {
+ SDL_mutex *lock;
+ int safe;
+} SDL_EventLock;
+
+/* Thread functions */
+static SDL_Thread *SDL_EventThread = NULL; /* Thread handle */
+static Uint32 event_thread; /* The event thread id */
+
+void SDL_Lock_EventThread(void)
+{
+ if ( SDL_EventThread && (SDL_ThreadID() != event_thread) ) {
+ /* Grab lock and spin until we're sure event thread stopped */
+ SDL_mutexP(SDL_EventLock.lock);
+ while ( ! SDL_EventLock.safe ) {
+ SDL_Delay(1);
+ }
+ }
+}
+void SDL_Unlock_EventThread(void)
+{
+ if ( SDL_EventThread && (SDL_ThreadID() != event_thread) ) {
+ SDL_mutexV(SDL_EventLock.lock);
+ }
+}
+
+#ifdef __OS2__
+/*
+ * We'll increase the priority of GobbleEvents thread, so it will process
+ * events in time for sure! For this, we need the DosSetPriority() API
+ * from the os2.h include file.
+ */
+#define INCL_DOSPROCESS
+#include <os2.h>
+#include <time.h>
+#endif
+
+static int SDLCALL SDL_GobbleEvents(void *unused)
+{
+ event_thread = SDL_ThreadID();
+
+#ifdef __OS2__
+#ifdef USE_DOSSETPRIORITY
+ /* Increase thread priority, so it will process events in time for sure! */
+ DosSetPriority(PRTYS_THREAD, PRTYC_REGULAR, +16, 0);
+#endif
+#endif
+
+ while ( SDL_EventQ.active ) {
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+
+ /* Get events from the video subsystem */
+ if ( video ) {
+ video->PumpEvents(this);
+ }
+
+ /* Queue pending key-repeat events */
+ SDL_CheckKeyRepeat();
+
+#if !SDL_JOYSTICK_DISABLED
+ /* Check for joystick state change */
+ if ( SDL_numjoysticks && (SDL_eventstate & SDL_JOYEVENTMASK) ) {
+ SDL_JoystickUpdate();
+ }
+#endif
+
+ /* Give up the CPU for the rest of our timeslice */
+ SDL_EventLock.safe = 1;
+ if ( SDL_timer_running ) {
+ SDL_ThreadedTimerCheck();
+ }
+ SDL_Delay(1);
+
+ /* Check for event locking.
+ On the P of the lock mutex, if the lock is held, this thread
+ will wait until the lock is released before continuing. The
+ safe flag will be set, meaning that the other thread can go
+ about it's business. The safe flag is reset before the V,
+ so as soon as the mutex is free, other threads can see that
+ it's not safe to interfere with the event thread.
+ */
+ SDL_mutexP(SDL_EventLock.lock);
+ SDL_EventLock.safe = 0;
+ SDL_mutexV(SDL_EventLock.lock);
+ }
+ SDL_SetTimerThreaded(0);
+ event_thread = 0;
+ return(0);
+}
+
+static int SDL_StartEventThread(Uint32 flags)
+{
+ /* Reset everything to zero */
+ SDL_EventThread = NULL;
+ SDL_memset(&SDL_EventLock, 0, sizeof(SDL_EventLock));
+
+ /* Create the lock and set ourselves active */
+#if !SDL_THREADS_DISABLED
+ SDL_EventQ.lock = SDL_CreateMutex();
+ if ( SDL_EventQ.lock == NULL ) {
+#ifdef __MACOS__ /* MacOS classic you can't multithread, so no lock needed */
+ ;
+#else
+ return(-1);
+#endif
+ }
+#endif /* !SDL_THREADS_DISABLED */
+ SDL_EventQ.active = 1;
+
+ if ( (flags&SDL_INIT_EVENTTHREAD) == SDL_INIT_EVENTTHREAD ) {
+ SDL_EventLock.lock = SDL_CreateMutex();
+ if ( SDL_EventLock.lock == NULL ) {
+ return(-1);
+ }
+ SDL_EventLock.safe = 0;
+
+ /* The event thread will handle timers too */
+ SDL_SetTimerThreaded(2);
+#if (defined(__WIN32__) && !defined(_WIN32_WCE)) && !defined(HAVE_LIBC) && !defined(__SYMBIAN32__)
+#undef SDL_CreateThread
+ SDL_EventThread = SDL_CreateThread(SDL_GobbleEvents, NULL, NULL, NULL);
+#else
+ SDL_EventThread = SDL_CreateThread(SDL_GobbleEvents, NULL);
+#endif
+ if ( SDL_EventThread == NULL ) {
+ return(-1);
+ }
+ } else {
+ event_thread = 0;
+ }
+ return(0);
+}
+
+static void SDL_StopEventThread(void)
+{
+ SDL_EventQ.active = 0;
+ if ( SDL_EventThread ) {
+ SDL_WaitThread(SDL_EventThread, NULL);
+ SDL_EventThread = NULL;
+ SDL_DestroyMutex(SDL_EventLock.lock);
+ SDL_EventLock.lock = NULL;
+ }
+#ifndef IPOD
+ SDL_DestroyMutex(SDL_EventQ.lock);
+ SDL_EventQ.lock = NULL;
+#endif
+}
+
+Uint32 SDL_EventThreadID(void)
+{
+ return(event_thread);
+}
+
+/* Public functions */
+
+void SDL_StopEventLoop(void)
+{
+ /* Halt the event thread, if running */
+ SDL_StopEventThread();
+
+ /* Shutdown event handlers */
+ SDL_AppActiveQuit();
+ SDL_KeyboardQuit();
+ SDL_MouseQuit();
+ SDL_QuitQuit();
+
+ /* Clean out EventQ */
+ SDL_EventQ.head = 0;
+ SDL_EventQ.tail = 0;
+ SDL_EventQ.wmmsg_next = 0;
+}
+
+/* This function (and associated calls) may be called more than once */
+int SDL_StartEventLoop(Uint32 flags)
+{
+ int retcode;
+
+ /* Clean out the event queue */
+ SDL_EventThread = NULL;
+ SDL_EventQ.lock = NULL;
+ SDL_StopEventLoop();
+
+ /* No filter to start with, process most event types */
+ SDL_EventOK = NULL;
+ SDL_memset(SDL_ProcessEvents,SDL_ENABLE,sizeof(SDL_ProcessEvents));
+ SDL_eventstate = ~0;
+ /* It's not save to call SDL_EventState() yet */
+ SDL_eventstate &= ~(0x00000001 << SDL_SYSWMEVENT);
+ SDL_ProcessEvents[SDL_SYSWMEVENT] = SDL_IGNORE;
+
+ /* Initialize event handlers */
+ retcode = 0;
+ retcode += SDL_AppActiveInit();
+ retcode += SDL_KeyboardInit();
+ retcode += SDL_MouseInit();
+ retcode += SDL_QuitInit();
+ if ( retcode < 0 ) {
+ /* We don't expect them to fail, but... */
+ return(-1);
+ }
+
+ /* Create the lock and event thread */
+ if ( SDL_StartEventThread(flags) < 0 ) {
+ SDL_StopEventLoop();
+ return(-1);
+ }
+ return(0);
+}
+
+
+/* Add an event to the event queue -- called with the queue locked */
+static int SDL_AddEvent(SDL_Event *event)
+{
+ int tail, added;
+
+ tail = (SDL_EventQ.tail+1)%MAXEVENTS;
+ if ( tail == SDL_EventQ.head ) {
+ /* Overflow, drop event */
+ added = 0;
+ } else {
+ SDL_EventQ.event[SDL_EventQ.tail] = *event;
+ if (event->type == SDL_SYSWMEVENT) {
+ /* Note that it's possible to lose an event */
+ int next = SDL_EventQ.wmmsg_next;
+ SDL_EventQ.wmmsg[next] = *event->syswm.msg;
+ SDL_EventQ.event[SDL_EventQ.tail].syswm.msg =
+ &SDL_EventQ.wmmsg[next];
+ SDL_EventQ.wmmsg_next = (next+1)%MAXEVENTS;
+ }
+ SDL_EventQ.tail = tail;
+ added = 1;
+ }
+ return(added);
+}
+
+/* Cut an event, and return the next valid spot, or the tail */
+/* -- called with the queue locked */
+static int SDL_CutEvent(int spot)
+{
+ if ( spot == SDL_EventQ.head ) {
+ SDL_EventQ.head = (SDL_EventQ.head+1)%MAXEVENTS;
+ return(SDL_EventQ.head);
+ } else
+ if ( (spot+1)%MAXEVENTS == SDL_EventQ.tail ) {
+ SDL_EventQ.tail = spot;
+ return(SDL_EventQ.tail);
+ } else
+ /* We cut the middle -- shift everything over */
+ {
+ int here, next;
+
+ /* This can probably be optimized with SDL_memcpy() -- careful! */
+ if ( --SDL_EventQ.tail < 0 ) {
+ SDL_EventQ.tail = MAXEVENTS-1;
+ }
+ for ( here=spot; here != SDL_EventQ.tail; here = next ) {
+ next = (here+1)%MAXEVENTS;
+ SDL_EventQ.event[here] = SDL_EventQ.event[next];
+ }
+ return(spot);
+ }
+ /* NOTREACHED */
+}
+
+/* Lock the event queue, take a peep at it, and unlock it */
+int SDL_PeepEvents(SDL_Event *events, int numevents, SDL_eventaction action,
+ Uint32 mask)
+{
+ int i, used;
+
+ /* Don't look after we've quit */
+ if ( ! SDL_EventQ.active ) {
+ return(-1);
+ }
+ /* Lock the event queue */
+ used = 0;
+ if ( SDL_mutexP(SDL_EventQ.lock) == 0 ) {
+ if ( action == SDL_ADDEVENT ) {
+ for ( i=0; i<numevents; ++i ) {
+ used += SDL_AddEvent(&events[i]);
+ }
+ } else {
+ SDL_Event tmpevent;
+ int spot;
+
+ /* If 'events' is NULL, just see if they exist */
+ if ( events == NULL ) {
+ action = SDL_PEEKEVENT;
+ numevents = 1;
+ events = &tmpevent;
+ }
+ spot = SDL_EventQ.head;
+ while ((used < numevents)&&(spot != SDL_EventQ.tail)) {
+ if ( mask & SDL_EVENTMASK(SDL_EventQ.event[spot].type) ) {
+ events[used++] = SDL_EventQ.event[spot];
+ if ( action == SDL_GETEVENT ) {
+ spot = SDL_CutEvent(spot);
+ } else {
+ spot = (spot+1)%MAXEVENTS;
+ }
+ } else {
+ spot = (spot+1)%MAXEVENTS;
+ }
+ }
+ }
+ SDL_mutexV(SDL_EventQ.lock);
+ } else {
+ SDL_SetError("Couldn't lock event queue");
+ used = -1;
+ }
+ return(used);
+}
+
+/* Run the system dependent event loops */
+void SDL_PumpEvents(void)
+{
+ if ( !SDL_EventThread ) {
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+
+ /* Get events from the video subsystem */
+ if ( video ) {
+ video->PumpEvents(this);
+ }
+
+ /* Queue pending key-repeat events */
+ SDL_CheckKeyRepeat();
+
+#if !SDL_JOYSTICK_DISABLED
+ /* Check for joystick state change */
+ if ( SDL_numjoysticks && (SDL_eventstate & SDL_JOYEVENTMASK) ) {
+ SDL_JoystickUpdate();
+ }
+#endif
+ }
+}
+
+/* Public functions */
+
+int SDL_PollEvent (SDL_Event *event)
+{
+ SDL_PumpEvents();
+
+ /* We can't return -1, just return 0 (no event) on error */
+ if ( SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS) <= 0 )
+ return 0;
+ return 1;
+}
+
+int SDL_WaitEvent (SDL_Event *event)
+{
+ while ( 1 ) {
+ SDL_PumpEvents();
+ switch(SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS)) {
+ case -1: return 0;
+ case 1: return 1;
+ case 0: SDL_Delay(10);
+ }
+ }
+}
+
+int SDL_PushEvent(SDL_Event *event)
+{
+ if ( SDL_PeepEvents(event, 1, SDL_ADDEVENT, 0) <= 0 )
+ return -1;
+ return 0;
+}
+
+void SDL_SetEventFilter (SDL_EventFilter filter)
+{
+ SDL_Event bitbucket;
+
+ /* Set filter and discard pending events */
+ SDL_EventOK = filter;
+ while ( SDL_PollEvent(&bitbucket) > 0 )
+ ;
+}
+
+SDL_EventFilter SDL_GetEventFilter(void)
+{
+ return(SDL_EventOK);
+}
+
+Uint8 SDL_EventState (Uint8 type, int state)
+{
+ SDL_Event bitbucket;
+ Uint8 current_state;
+
+ /* If SDL_ALLEVENTS was specified... */
+ if ( type == 0xFF ) {
+ current_state = SDL_IGNORE;
+ for ( type=0; type<SDL_NUMEVENTS; ++type ) {
+ if ( SDL_ProcessEvents[type] != SDL_IGNORE ) {
+ current_state = SDL_ENABLE;
+ }
+ SDL_ProcessEvents[type] = state;
+ if ( state == SDL_ENABLE ) {
+ SDL_eventstate |= (0x00000001 << (type));
+ } else {
+ SDL_eventstate &= ~(0x00000001 << (type));
+ }
+ }
+ while ( SDL_PollEvent(&bitbucket) > 0 )
+ ;
+ return(current_state);
+ }
+
+ /* Just set the state for one event type */
+ current_state = SDL_ProcessEvents[type];
+ switch (state) {
+ case SDL_IGNORE:
+ case SDL_ENABLE:
+ /* Set state and discard pending events */
+ SDL_ProcessEvents[type] = state;
+ if ( state == SDL_ENABLE ) {
+ SDL_eventstate |= (0x00000001 << (type));
+ } else {
+ SDL_eventstate &= ~(0x00000001 << (type));
+ }
+ while ( SDL_PollEvent(&bitbucket) > 0 )
+ ;
+ break;
+ default:
+ /* Querying state? */
+ break;
+ }
+ return(current_state);
+}
+
+/* This is a generic event handler.
+ */
+int SDL_PrivateSysWMEvent(SDL_SysWMmsg *message)
+{
+ int posted;
+
+ posted = 0;
+ if ( SDL_ProcessEvents[SDL_SYSWMEVENT] == SDL_ENABLE ) {
+ SDL_Event event;
+ SDL_memset(&event, 0, sizeof(event));
+ event.type = SDL_SYSWMEVENT;
+ event.syswm.msg = message;
+ if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
+ posted = 1;
+ SDL_PushEvent(&event);
+ }
+ }
+ /* Update internal event state */
+ return(posted);
+}
diff --git a/distrib/sdl-1.2.15/src/events/SDL_events_c.h b/distrib/sdl-1.2.15/src/events/SDL_events_c.h
new file mode 100644
index 0000000..4378451
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/events/SDL_events_c.h
@@ -0,0 +1,83 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Useful functions and variables from SDL_events.c */
+#include "SDL_events.h"
+
+/* Start and stop the event processing loop */
+extern int SDL_StartEventLoop(Uint32 flags);
+extern void SDL_StopEventLoop(void);
+extern void SDL_QuitInterrupt(void);
+
+extern void SDL_Lock_EventThread(void);
+extern void SDL_Unlock_EventThread(void);
+extern Uint32 SDL_EventThreadID(void);
+
+/* Event handler init routines */
+extern int SDL_AppActiveInit(void);
+extern int SDL_KeyboardInit(void);
+extern int SDL_MouseInit(void);
+extern int SDL_QuitInit(void);
+
+/* Event handler quit routines */
+extern void SDL_AppActiveQuit(void);
+extern void SDL_KeyboardQuit(void);
+extern void SDL_MouseQuit(void);
+extern void SDL_QuitQuit(void);
+
+/* The event filter function */
+extern SDL_EventFilter SDL_EventOK;
+
+/* The array of event processing states */
+extern Uint8 SDL_ProcessEvents[SDL_NUMEVENTS];
+
+/* Internal event queueing functions
+ (from SDL_active.c, SDL_mouse.c, SDL_keyboard.c, SDL_quit.c, SDL_events.c)
+ */
+extern int SDL_PrivateAppActive(Uint8 gain, Uint8 state);
+extern int SDL_PrivateMouseMotion(Uint8 buttonstate, int relative,
+ Sint16 x, Sint16 y);
+extern int SDL_PrivateMouseButton(Uint8 state, Uint8 button,Sint16 x,Sint16 y);
+extern int SDL_PrivateKeyboard(Uint8 state, SDL_keysym *key);
+extern int SDL_PrivateResize(int w, int h);
+extern int SDL_PrivateExpose(void);
+extern int SDL_PrivateQuit(void);
+extern int SDL_PrivateSysWMEvent(SDL_SysWMmsg *message);
+
+/* Used to clamp the mouse coordinates separately from the video surface */
+extern void SDL_SetMouseRange(int maxX, int maxY);
+
+/* Used by the activity event handler to remove mouse focus */
+extern void SDL_ResetMouse(void);
+
+/* Used by the activity event handler to remove keyboard focus */
+extern void SDL_ResetKeyboard(void);
+
+/* Used by the event loop to queue pending keyboard repeat events */
+extern void SDL_CheckKeyRepeat(void);
+
+/* Used by the OS keyboard code to detect whether or not to do UNICODE */
+#ifndef DEFAULT_UNICODE_TRANSLATION
+#define DEFAULT_UNICODE_TRANSLATION 0 /* Default off because of overhead */
+#endif
+extern int SDL_TranslateUNICODE;
diff --git a/distrib/sdl-1.2.15/src/events/SDL_expose.c b/distrib/sdl-1.2.15/src/events/SDL_expose.c
new file mode 100644
index 0000000..d5b0143
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/events/SDL_expose.c
@@ -0,0 +1,51 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Refresh event handling code for SDL */
+
+#include "SDL_events.h"
+#include "SDL_events_c.h"
+
+
+/* This is global for SDL_eventloop.c */
+int SDL_PrivateExpose(void)
+{
+ int posted;
+ SDL_Event events[32];
+
+ /* Pull out all old refresh events */
+ SDL_PeepEvents(events, sizeof(events)/sizeof(events[0]),
+ SDL_GETEVENT, SDL_VIDEOEXPOSEMASK);
+
+ /* Post the event, if desired */
+ posted = 0;
+ if ( SDL_ProcessEvents[SDL_VIDEOEXPOSE] == SDL_ENABLE ) {
+ SDL_Event event;
+ event.type = SDL_VIDEOEXPOSE;
+ if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
+ posted = 1;
+ SDL_PushEvent(&event);
+ }
+ }
+ return(posted);
+}
diff --git a/distrib/sdl-1.2.15/src/events/SDL_keyboard.c b/distrib/sdl-1.2.15/src/events/SDL_keyboard.c
new file mode 100644
index 0000000..5753927
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/events/SDL_keyboard.c
@@ -0,0 +1,614 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* General keyboard handling code for SDL */
+
+#include "SDL_timer.h"
+#include "SDL_events.h"
+#include "SDL_events_c.h"
+#include "SDL_sysevents.h"
+
+
+/* Global keystate information */
+static Uint8 SDL_KeyState[SDLK_LAST];
+static SDLMod SDL_ModState;
+int SDL_TranslateUNICODE = 0;
+
+static const char *keynames[SDLK_LAST]; /* Array of keycode names */
+
+/*
+ * jk 991215 - added
+ */
+struct {
+ int firsttime; /* if we check against the delay or repeat value */
+ int delay; /* the delay before we start repeating */
+ int interval; /* the delay between key repeat events */
+ Uint32 timestamp; /* the time the first keydown event occurred */
+
+ SDL_Event evt; /* the event we are supposed to repeat */
+} SDL_KeyRepeat;
+
+/* Global no-lock-keys support */
+static Uint8 SDL_NoLockKeys;
+
+#define SDL_NLK_CAPS 0x01
+#define SDL_NLK_NUM 0x02
+
+/* Public functions */
+int SDL_KeyboardInit(void)
+{
+ const char* env;
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+
+ /* Set default mode of UNICODE translation */
+ SDL_EnableUNICODE(DEFAULT_UNICODE_TRANSLATION);
+
+ /* Initialize the tables */
+ SDL_ModState = KMOD_NONE;
+ SDL_memset((void*)keynames, 0, sizeof(keynames));
+ SDL_memset(SDL_KeyState, 0, sizeof(SDL_KeyState));
+ video->InitOSKeymap(this);
+
+ SDL_EnableKeyRepeat(0, 0);
+
+ /* Allow environment override to disable special lock-key behavior */
+ SDL_NoLockKeys = 0;
+ env = SDL_getenv("SDL_DISABLE_LOCK_KEYS");
+ if (env) {
+ switch (SDL_atoi(env)) {
+ case 1:
+ SDL_NoLockKeys = SDL_NLK_CAPS | SDL_NLK_NUM;
+ break;
+ case 2:
+ SDL_NoLockKeys = SDL_NLK_CAPS;
+ break;
+ case 3:
+ SDL_NoLockKeys = SDL_NLK_NUM;
+ break;
+ default:
+ break;
+ }
+ }
+
+ /* Fill in the blanks in keynames */
+ keynames[SDLK_BACKSPACE] = "backspace";
+ keynames[SDLK_TAB] = "tab";
+ keynames[SDLK_CLEAR] = "clear";
+ keynames[SDLK_RETURN] = "return";
+ keynames[SDLK_PAUSE] = "pause";
+ keynames[SDLK_ESCAPE] = "escape";
+ keynames[SDLK_SPACE] = "space";
+ keynames[SDLK_EXCLAIM] = "!";
+ keynames[SDLK_QUOTEDBL] = "\"";
+ keynames[SDLK_HASH] = "#";
+ keynames[SDLK_DOLLAR] = "$";
+ keynames[SDLK_AMPERSAND] = "&";
+ keynames[SDLK_QUOTE] = "'";
+ keynames[SDLK_LEFTPAREN] = "(";
+ keynames[SDLK_RIGHTPAREN] = ")";
+ keynames[SDLK_ASTERISK] = "*";
+ keynames[SDLK_PLUS] = "+";
+ keynames[SDLK_COMMA] = ",";
+ keynames[SDLK_MINUS] = "-";
+ keynames[SDLK_PERIOD] = ".";
+ keynames[SDLK_SLASH] = "/";
+ keynames[SDLK_0] = "0";
+ keynames[SDLK_1] = "1";
+ keynames[SDLK_2] = "2";
+ keynames[SDLK_3] = "3";
+ keynames[SDLK_4] = "4";
+ keynames[SDLK_5] = "5";
+ keynames[SDLK_6] = "6";
+ keynames[SDLK_7] = "7";
+ keynames[SDLK_8] = "8";
+ keynames[SDLK_9] = "9";
+ keynames[SDLK_COLON] = ":";
+ keynames[SDLK_SEMICOLON] = ";";
+ keynames[SDLK_LESS] = "<";
+ keynames[SDLK_EQUALS] = "=";
+ keynames[SDLK_GREATER] = ">";
+ keynames[SDLK_QUESTION] = "?";
+ keynames[SDLK_AT] = "@";
+ keynames[SDLK_LEFTBRACKET] = "[";
+ keynames[SDLK_BACKSLASH] = "\\";
+ keynames[SDLK_RIGHTBRACKET] = "]";
+ keynames[SDLK_CARET] = "^";
+ keynames[SDLK_UNDERSCORE] = "_";
+ keynames[SDLK_BACKQUOTE] = "`";
+ keynames[SDLK_a] = "a";
+ keynames[SDLK_b] = "b";
+ keynames[SDLK_c] = "c";
+ keynames[SDLK_d] = "d";
+ keynames[SDLK_e] = "e";
+ keynames[SDLK_f] = "f";
+ keynames[SDLK_g] = "g";
+ keynames[SDLK_h] = "h";
+ keynames[SDLK_i] = "i";
+ keynames[SDLK_j] = "j";
+ keynames[SDLK_k] = "k";
+ keynames[SDLK_l] = "l";
+ keynames[SDLK_m] = "m";
+ keynames[SDLK_n] = "n";
+ keynames[SDLK_o] = "o";
+ keynames[SDLK_p] = "p";
+ keynames[SDLK_q] = "q";
+ keynames[SDLK_r] = "r";
+ keynames[SDLK_s] = "s";
+ keynames[SDLK_t] = "t";
+ keynames[SDLK_u] = "u";
+ keynames[SDLK_v] = "v";
+ keynames[SDLK_w] = "w";
+ keynames[SDLK_x] = "x";
+ keynames[SDLK_y] = "y";
+ keynames[SDLK_z] = "z";
+ keynames[SDLK_DELETE] = "delete";
+
+ keynames[SDLK_WORLD_0] = "world 0";
+ keynames[SDLK_WORLD_1] = "world 1";
+ keynames[SDLK_WORLD_2] = "world 2";
+ keynames[SDLK_WORLD_3] = "world 3";
+ keynames[SDLK_WORLD_4] = "world 4";
+ keynames[SDLK_WORLD_5] = "world 5";
+ keynames[SDLK_WORLD_6] = "world 6";
+ keynames[SDLK_WORLD_7] = "world 7";
+ keynames[SDLK_WORLD_8] = "world 8";
+ keynames[SDLK_WORLD_9] = "world 9";
+ keynames[SDLK_WORLD_10] = "world 10";
+ keynames[SDLK_WORLD_11] = "world 11";
+ keynames[SDLK_WORLD_12] = "world 12";
+ keynames[SDLK_WORLD_13] = "world 13";
+ keynames[SDLK_WORLD_14] = "world 14";
+ keynames[SDLK_WORLD_15] = "world 15";
+ keynames[SDLK_WORLD_16] = "world 16";
+ keynames[SDLK_WORLD_17] = "world 17";
+ keynames[SDLK_WORLD_18] = "world 18";
+ keynames[SDLK_WORLD_19] = "world 19";
+ keynames[SDLK_WORLD_20] = "world 20";
+ keynames[SDLK_WORLD_21] = "world 21";
+ keynames[SDLK_WORLD_22] = "world 22";
+ keynames[SDLK_WORLD_23] = "world 23";
+ keynames[SDLK_WORLD_24] = "world 24";
+ keynames[SDLK_WORLD_25] = "world 25";
+ keynames[SDLK_WORLD_26] = "world 26";
+ keynames[SDLK_WORLD_27] = "world 27";
+ keynames[SDLK_WORLD_28] = "world 28";
+ keynames[SDLK_WORLD_29] = "world 29";
+ keynames[SDLK_WORLD_30] = "world 30";
+ keynames[SDLK_WORLD_31] = "world 31";
+ keynames[SDLK_WORLD_32] = "world 32";
+ keynames[SDLK_WORLD_33] = "world 33";
+ keynames[SDLK_WORLD_34] = "world 34";
+ keynames[SDLK_WORLD_35] = "world 35";
+ keynames[SDLK_WORLD_36] = "world 36";
+ keynames[SDLK_WORLD_37] = "world 37";
+ keynames[SDLK_WORLD_38] = "world 38";
+ keynames[SDLK_WORLD_39] = "world 39";
+ keynames[SDLK_WORLD_40] = "world 40";
+ keynames[SDLK_WORLD_41] = "world 41";
+ keynames[SDLK_WORLD_42] = "world 42";
+ keynames[SDLK_WORLD_43] = "world 43";
+ keynames[SDLK_WORLD_44] = "world 44";
+ keynames[SDLK_WORLD_45] = "world 45";
+ keynames[SDLK_WORLD_46] = "world 46";
+ keynames[SDLK_WORLD_47] = "world 47";
+ keynames[SDLK_WORLD_48] = "world 48";
+ keynames[SDLK_WORLD_49] = "world 49";
+ keynames[SDLK_WORLD_50] = "world 50";
+ keynames[SDLK_WORLD_51] = "world 51";
+ keynames[SDLK_WORLD_52] = "world 52";
+ keynames[SDLK_WORLD_53] = "world 53";
+ keynames[SDLK_WORLD_54] = "world 54";
+ keynames[SDLK_WORLD_55] = "world 55";
+ keynames[SDLK_WORLD_56] = "world 56";
+ keynames[SDLK_WORLD_57] = "world 57";
+ keynames[SDLK_WORLD_58] = "world 58";
+ keynames[SDLK_WORLD_59] = "world 59";
+ keynames[SDLK_WORLD_60] = "world 60";
+ keynames[SDLK_WORLD_61] = "world 61";
+ keynames[SDLK_WORLD_62] = "world 62";
+ keynames[SDLK_WORLD_63] = "world 63";
+ keynames[SDLK_WORLD_64] = "world 64";
+ keynames[SDLK_WORLD_65] = "world 65";
+ keynames[SDLK_WORLD_66] = "world 66";
+ keynames[SDLK_WORLD_67] = "world 67";
+ keynames[SDLK_WORLD_68] = "world 68";
+ keynames[SDLK_WORLD_69] = "world 69";
+ keynames[SDLK_WORLD_70] = "world 70";
+ keynames[SDLK_WORLD_71] = "world 71";
+ keynames[SDLK_WORLD_72] = "world 72";
+ keynames[SDLK_WORLD_73] = "world 73";
+ keynames[SDLK_WORLD_74] = "world 74";
+ keynames[SDLK_WORLD_75] = "world 75";
+ keynames[SDLK_WORLD_76] = "world 76";
+ keynames[SDLK_WORLD_77] = "world 77";
+ keynames[SDLK_WORLD_78] = "world 78";
+ keynames[SDLK_WORLD_79] = "world 79";
+ keynames[SDLK_WORLD_80] = "world 80";
+ keynames[SDLK_WORLD_81] = "world 81";
+ keynames[SDLK_WORLD_82] = "world 82";
+ keynames[SDLK_WORLD_83] = "world 83";
+ keynames[SDLK_WORLD_84] = "world 84";
+ keynames[SDLK_WORLD_85] = "world 85";
+ keynames[SDLK_WORLD_86] = "world 86";
+ keynames[SDLK_WORLD_87] = "world 87";
+ keynames[SDLK_WORLD_88] = "world 88";
+ keynames[SDLK_WORLD_89] = "world 89";
+ keynames[SDLK_WORLD_90] = "world 90";
+ keynames[SDLK_WORLD_91] = "world 91";
+ keynames[SDLK_WORLD_92] = "world 92";
+ keynames[SDLK_WORLD_93] = "world 93";
+ keynames[SDLK_WORLD_94] = "world 94";
+ keynames[SDLK_WORLD_95] = "world 95";
+
+ keynames[SDLK_KP0] = "[0]";
+ keynames[SDLK_KP1] = "[1]";
+ keynames[SDLK_KP2] = "[2]";
+ keynames[SDLK_KP3] = "[3]";
+ keynames[SDLK_KP4] = "[4]";
+ keynames[SDLK_KP5] = "[5]";
+ keynames[SDLK_KP6] = "[6]";
+ keynames[SDLK_KP7] = "[7]";
+ keynames[SDLK_KP8] = "[8]";
+ keynames[SDLK_KP9] = "[9]";
+ keynames[SDLK_KP_PERIOD] = "[.]";
+ keynames[SDLK_KP_DIVIDE] = "[/]";
+ keynames[SDLK_KP_MULTIPLY] = "[*]";
+ keynames[SDLK_KP_MINUS] = "[-]";
+ keynames[SDLK_KP_PLUS] = "[+]";
+ keynames[SDLK_KP_ENTER] = "enter";
+ keynames[SDLK_KP_EQUALS] = "equals";
+
+ keynames[SDLK_UP] = "up";
+ keynames[SDLK_DOWN] = "down";
+ keynames[SDLK_RIGHT] = "right";
+ keynames[SDLK_LEFT] = "left";
+ keynames[SDLK_DOWN] = "down";
+ keynames[SDLK_INSERT] = "insert";
+ keynames[SDLK_HOME] = "home";
+ keynames[SDLK_END] = "end";
+ keynames[SDLK_PAGEUP] = "page up";
+ keynames[SDLK_PAGEDOWN] = "page down";
+
+ keynames[SDLK_F1] = "f1";
+ keynames[SDLK_F2] = "f2";
+ keynames[SDLK_F3] = "f3";
+ keynames[SDLK_F4] = "f4";
+ keynames[SDLK_F5] = "f5";
+ keynames[SDLK_F6] = "f6";
+ keynames[SDLK_F7] = "f7";
+ keynames[SDLK_F8] = "f8";
+ keynames[SDLK_F9] = "f9";
+ keynames[SDLK_F10] = "f10";
+ keynames[SDLK_F11] = "f11";
+ keynames[SDLK_F12] = "f12";
+ keynames[SDLK_F13] = "f13";
+ keynames[SDLK_F14] = "f14";
+ keynames[SDLK_F15] = "f15";
+
+ keynames[SDLK_NUMLOCK] = "numlock";
+ keynames[SDLK_CAPSLOCK] = "caps lock";
+ keynames[SDLK_SCROLLOCK] = "scroll lock";
+ keynames[SDLK_RSHIFT] = "right shift";
+ keynames[SDLK_LSHIFT] = "left shift";
+ keynames[SDLK_RCTRL] = "right ctrl";
+ keynames[SDLK_LCTRL] = "left ctrl";
+ keynames[SDLK_RALT] = "right alt";
+ keynames[SDLK_LALT] = "left alt";
+ keynames[SDLK_RMETA] = "right meta";
+ keynames[SDLK_LMETA] = "left meta";
+ keynames[SDLK_LSUPER] = "left super"; /* "Windows" keys */
+ keynames[SDLK_RSUPER] = "right super";
+ keynames[SDLK_MODE] = "alt gr";
+ keynames[SDLK_COMPOSE] = "compose";
+
+ keynames[SDLK_HELP] = "help";
+ keynames[SDLK_PRINT] = "print screen";
+ keynames[SDLK_SYSREQ] = "sys req";
+ keynames[SDLK_BREAK] = "break";
+ keynames[SDLK_MENU] = "menu";
+ keynames[SDLK_POWER] = "power";
+ keynames[SDLK_EURO] = "euro";
+ keynames[SDLK_UNDO] = "undo";
+
+ /* Done. Whew. */
+ return(0);
+}
+void SDL_KeyboardQuit(void)
+{
+}
+
+/* We lost the keyboard, so post key up messages for all pressed keys */
+void SDL_ResetKeyboard(void)
+{
+ SDL_keysym keysym;
+ SDLKey key;
+
+ SDL_memset(&keysym, 0, (sizeof keysym));
+ for ( key=SDLK_FIRST; key<SDLK_LAST; ++key ) {
+ if ( SDL_KeyState[key] == SDL_PRESSED ) {
+ keysym.sym = key;
+ SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
+ }
+ }
+ SDL_KeyRepeat.timestamp = 0;
+}
+
+int SDL_EnableUNICODE(int enable)
+{
+ int old_mode;
+
+ old_mode = SDL_TranslateUNICODE;
+ if ( enable >= 0 ) {
+ SDL_TranslateUNICODE = enable;
+ }
+ return(old_mode);
+}
+
+Uint8 * SDL_GetKeyState (int *numkeys)
+{
+ if ( numkeys != (int *)0 )
+ *numkeys = SDLK_LAST;
+ return(SDL_KeyState);
+}
+SDLMod SDL_GetModState (void)
+{
+ return(SDL_ModState);
+}
+void SDL_SetModState (SDLMod modstate)
+{
+ SDL_ModState = modstate;
+}
+
+char *SDL_GetKeyName(SDLKey key)
+{
+ const char *keyname;
+
+ keyname = NULL;
+ if ( key < SDLK_LAST ) {
+ keyname = keynames[key];
+ }
+ if ( keyname == NULL ) {
+ keyname = "unknown key";
+ }
+ /* FIXME: make this function const in 1.3 */
+ return (char *)(keyname);
+}
+
+/* These are global for SDL_eventloop.c */
+int SDL_PrivateKeyboard(Uint8 state, SDL_keysym *keysym)
+{
+ SDL_Event event;
+ int posted, repeatable;
+ Uint16 modstate;
+
+ SDL_memset(&event, 0, sizeof(event));
+
+#if 0
+printf("The '%s' key has been %s\n", SDL_GetKeyName(keysym->sym),
+ state == SDL_PRESSED ? "pressed" : "released");
+#endif
+ /* Set up the keysym */
+ modstate = (Uint16)SDL_ModState;
+
+ repeatable = 0;
+
+ if ( state == SDL_PRESSED ) {
+ keysym->mod = (SDLMod)modstate;
+ switch (keysym->sym) {
+ case SDLK_UNKNOWN:
+ break;
+ case SDLK_NUMLOCK:
+ modstate ^= KMOD_NUM;
+ if ( SDL_NoLockKeys & SDL_NLK_NUM )
+ break;
+ if ( ! (modstate&KMOD_NUM) )
+ state = SDL_RELEASED;
+ keysym->mod = (SDLMod)modstate;
+ break;
+ case SDLK_CAPSLOCK:
+ modstate ^= KMOD_CAPS;
+ if ( SDL_NoLockKeys & SDL_NLK_CAPS )
+ break;
+ if ( ! (modstate&KMOD_CAPS) )
+ state = SDL_RELEASED;
+ keysym->mod = (SDLMod)modstate;
+ break;
+ case SDLK_LCTRL:
+ modstate |= KMOD_LCTRL;
+ break;
+ case SDLK_RCTRL:
+ modstate |= KMOD_RCTRL;
+ break;
+ case SDLK_LSHIFT:
+ modstate |= KMOD_LSHIFT;
+ break;
+ case SDLK_RSHIFT:
+ modstate |= KMOD_RSHIFT;
+ break;
+ case SDLK_LALT:
+ modstate |= KMOD_LALT;
+ break;
+ case SDLK_RALT:
+ modstate |= KMOD_RALT;
+ break;
+ case SDLK_LMETA:
+ modstate |= KMOD_LMETA;
+ break;
+ case SDLK_RMETA:
+ modstate |= KMOD_RMETA;
+ break;
+ case SDLK_MODE:
+ modstate |= KMOD_MODE;
+ break;
+ default:
+ repeatable = 1;
+ break;
+ }
+ } else {
+ switch (keysym->sym) {
+ case SDLK_UNKNOWN:
+ break;
+ case SDLK_NUMLOCK:
+ if ( SDL_NoLockKeys & SDL_NLK_NUM )
+ break;
+ /* Only send keydown events */
+ return(0);
+ case SDLK_CAPSLOCK:
+ if ( SDL_NoLockKeys & SDL_NLK_CAPS )
+ break;
+ /* Only send keydown events */
+ return(0);
+ case SDLK_LCTRL:
+ modstate &= ~KMOD_LCTRL;
+ break;
+ case SDLK_RCTRL:
+ modstate &= ~KMOD_RCTRL;
+ break;
+ case SDLK_LSHIFT:
+ modstate &= ~KMOD_LSHIFT;
+ break;
+ case SDLK_RSHIFT:
+ modstate &= ~KMOD_RSHIFT;
+ break;
+ case SDLK_LALT:
+ modstate &= ~KMOD_LALT;
+ break;
+ case SDLK_RALT:
+ modstate &= ~KMOD_RALT;
+ break;
+ case SDLK_LMETA:
+ modstate &= ~KMOD_LMETA;
+ break;
+ case SDLK_RMETA:
+ modstate &= ~KMOD_RMETA;
+ break;
+ case SDLK_MODE:
+ modstate &= ~KMOD_MODE;
+ break;
+ default:
+ break;
+ }
+ keysym->mod = (SDLMod)modstate;
+ }
+
+ /* Figure out what type of event this is */
+ switch (state) {
+ case SDL_PRESSED:
+ event.type = SDL_KEYDOWN;
+ break;
+ case SDL_RELEASED:
+ event.type = SDL_KEYUP;
+ /*
+ * jk 991215 - Added
+ */
+ if ( SDL_KeyRepeat.timestamp &&
+ SDL_KeyRepeat.evt.key.keysym.sym == keysym->sym ) {
+ SDL_KeyRepeat.timestamp = 0;
+ }
+ break;
+ default:
+ /* Invalid state -- bail */
+ return(0);
+ }
+
+ if ( keysym->sym != SDLK_UNKNOWN ) {
+ /* Drop events that don't change state */
+ if ( SDL_KeyState[keysym->sym] == state ) {
+#if 0
+printf("Keyboard event didn't change state - dropped!\n");
+#endif
+ return(0);
+ }
+
+ /* Update internal keyboard state */
+ SDL_ModState = (SDLMod)modstate;
+ SDL_KeyState[keysym->sym] = state;
+ }
+
+ /* Post the event, if desired */
+ posted = 0;
+ if ( SDL_ProcessEvents[event.type] == SDL_ENABLE ) {
+ event.key.state = state;
+ event.key.keysym = *keysym;
+ /*
+ * jk 991215 - Added
+ */
+ if (repeatable && (SDL_KeyRepeat.delay != 0)) {
+ SDL_KeyRepeat.evt = event;
+ SDL_KeyRepeat.firsttime = 1;
+ SDL_KeyRepeat.timestamp=SDL_GetTicks();
+ }
+ if ( (SDL_EventOK == NULL) || SDL_EventOK(&event) ) {
+ posted = 1;
+ SDL_PushEvent(&event);
+ }
+ }
+ return(posted);
+}
+
+/*
+ * jk 991215 - Added
+ */
+void SDL_CheckKeyRepeat(void)
+{
+ if ( SDL_KeyRepeat.timestamp ) {
+ Uint32 now, interval;
+
+ now = SDL_GetTicks();
+ interval = (now - SDL_KeyRepeat.timestamp);
+ if ( SDL_KeyRepeat.firsttime ) {
+ if ( interval > (Uint32)SDL_KeyRepeat.delay ) {
+ SDL_KeyRepeat.timestamp = now;
+ SDL_KeyRepeat.firsttime = 0;
+ }
+ } else {
+ if ( interval > (Uint32)SDL_KeyRepeat.interval ) {
+ SDL_KeyRepeat.timestamp = now;
+ if ( (SDL_EventOK == NULL) || SDL_EventOK(&SDL_KeyRepeat.evt) ) {
+ SDL_PushEvent(&SDL_KeyRepeat.evt);
+ }
+ }
+ }
+ }
+}
+
+int SDL_EnableKeyRepeat(int delay, int interval)
+{
+ if ( (delay < 0) || (interval < 0) ) {
+ SDL_SetError("keyboard repeat value less than zero");
+ return(-1);
+ }
+ SDL_KeyRepeat.firsttime = 0;
+ SDL_KeyRepeat.delay = delay;
+ SDL_KeyRepeat.interval = interval;
+ SDL_KeyRepeat.timestamp = 0;
+ return(0);
+}
+
+void SDL_GetKeyRepeat(int *delay, int *interval)
+{
+ *delay = SDL_KeyRepeat.delay;
+ *interval = SDL_KeyRepeat.interval;
+}
+
diff --git a/distrib/sdl-1.2.15/src/events/SDL_mouse.c b/distrib/sdl-1.2.15/src/events/SDL_mouse.c
new file mode 100644
index 0000000..e37a4c6
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/events/SDL_mouse.c
@@ -0,0 +1,268 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* General mouse handling code for SDL */
+
+#include "SDL_events.h"
+#include "SDL_events_c.h"
+#include "../video/SDL_cursor_c.h"
+#include "../video/SDL_sysvideo.h"
+
+
+/* These are static for our mouse handling code */
+static Sint16 SDL_MouseX = 0;
+static Sint16 SDL_MouseY = 0;
+static Sint16 SDL_DeltaX = 0;
+static Sint16 SDL_DeltaY = 0;
+static Sint16 SDL_MouseMaxX = 0;
+static Sint16 SDL_MouseMaxY = 0;
+static Uint8 SDL_ButtonState = 0;
+
+
+/* Public functions */
+int SDL_MouseInit(void)
+{
+ /* The mouse is at (0,0) */
+ SDL_MouseX = 0;
+ SDL_MouseY = 0;
+ SDL_DeltaX = 0;
+ SDL_DeltaY = 0;
+ SDL_MouseMaxX = 0;
+ SDL_MouseMaxY = 0;
+ SDL_ButtonState = 0;
+
+ /* That's it! */
+ return(0);
+}
+void SDL_MouseQuit(void)
+{
+}
+
+/* We lost the mouse, so post button up messages for all pressed buttons */
+void SDL_ResetMouse(void)
+{
+ Uint8 i;
+ for ( i = 0; i < sizeof(SDL_ButtonState)*8; ++i ) {
+ if ( SDL_ButtonState & SDL_BUTTON(i) ) {
+ SDL_PrivateMouseButton(SDL_RELEASED, i, 0, 0);
+ }
+ }
+}
+
+Uint8 SDL_GetMouseState (int *x, int *y)
+{
+ if ( x ) {
+ *x = SDL_MouseX;
+ }
+ if ( y ) {
+ *y = SDL_MouseY;
+ }
+ return(SDL_ButtonState);
+}
+
+Uint8 SDL_GetRelativeMouseState (int *x, int *y)
+{
+ if ( x )
+ *x = SDL_DeltaX;
+ if ( y )
+ *y = SDL_DeltaY;
+ SDL_DeltaX = 0;
+ SDL_DeltaY = 0;
+ return(SDL_ButtonState);
+}
+
+static void ClipOffset(Sint16 *x, Sint16 *y)
+{
+ /* This clips absolute mouse coordinates when the apparent
+ display surface is smaller than the real display surface.
+ */
+ if ( SDL_VideoSurface && SDL_VideoSurface->offset ) {
+ *y -= SDL_VideoSurface->offset/SDL_VideoSurface->pitch;
+ *x -= (SDL_VideoSurface->offset%SDL_VideoSurface->pitch)/
+ SDL_VideoSurface->format->BytesPerPixel;
+ }
+}
+
+void SDL_SetMouseRange(int maxX, int maxY)
+{
+ SDL_MouseMaxX = (Sint16)maxX;
+ SDL_MouseMaxY = (Sint16)maxY;
+}
+
+/* These are global for SDL_eventloop.c */
+int SDL_PrivateMouseMotion(Uint8 buttonstate, int relative, Sint16 x, Sint16 y)
+{
+ int posted;
+ Uint16 X, Y;
+ Sint16 Xrel;
+ Sint16 Yrel;
+
+ /* Default buttonstate is the current one */
+ if ( ! buttonstate ) {
+ buttonstate = SDL_ButtonState;
+ }
+
+ Xrel = x;
+ Yrel = y;
+ if ( relative ) {
+ /* Push the cursor around */
+ x = (SDL_MouseX+x);
+ y = (SDL_MouseY+y);
+ } else {
+ /* Do we need to clip {x,y} ? */
+ ClipOffset(&x, &y);
+ }
+
+ /* Mouse coordinates range from 0 - width-1 and 0 - height-1 */
+ if ( x < 0 )
+ X = 0;
+ else
+ if ( x >= SDL_MouseMaxX )
+ X = SDL_MouseMaxX-1;
+ else
+ X = (Uint16)x;
+
+ if ( y < 0 )
+ Y = 0;
+ else
+ if ( y >= SDL_MouseMaxY )
+ Y = SDL_MouseMaxY-1;
+ else
+ Y = (Uint16)y;
+
+ /* If not relative mode, generate relative motion from clamped X/Y.
+ This prevents lots of extraneous large delta relative motion when
+ the screen is windowed mode and the mouse is outside the window.
+ */
+ if ( ! relative ) {
+ Xrel = X-SDL_MouseX;
+ Yrel = Y-SDL_MouseY;
+ }
+
+ /* Drop events that don't change state */
+ if ( ! Xrel && ! Yrel ) {
+#if 0
+printf("Mouse event didn't change state - dropped!\n");
+#endif
+ return(0);
+ }
+
+ /* Update internal mouse state */
+ SDL_ButtonState = buttonstate;
+ SDL_MouseX = X;
+ SDL_MouseY = Y;
+ SDL_DeltaX += Xrel;
+ SDL_DeltaY += Yrel;
+ SDL_MoveCursor(SDL_MouseX, SDL_MouseY);
+
+ /* Post the event, if desired */
+ posted = 0;
+ if ( SDL_ProcessEvents[SDL_MOUSEMOTION] == SDL_ENABLE ) {
+ SDL_Event event;
+ SDL_memset(&event, 0, sizeof(event));
+ event.type = SDL_MOUSEMOTION;
+ event.motion.state = buttonstate;
+ event.motion.x = X;
+ event.motion.y = Y;
+ event.motion.xrel = Xrel;
+ event.motion.yrel = Yrel;
+ if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
+ posted = 1;
+ SDL_PushEvent(&event);
+ }
+ }
+ return(posted);
+}
+
+int SDL_PrivateMouseButton(Uint8 state, Uint8 button, Sint16 x, Sint16 y)
+{
+ SDL_Event event;
+ int posted;
+ int move_mouse;
+ Uint8 buttonstate;
+
+ SDL_memset(&event, 0, sizeof(event));
+
+ /* Check parameters */
+ if ( x || y ) {
+ ClipOffset(&x, &y);
+ move_mouse = 1;
+ /* Mouse coordinates range from 0 - width-1 and 0 - height-1 */
+ if ( x < 0 )
+ x = 0;
+ else
+ if ( x >= SDL_MouseMaxX )
+ x = SDL_MouseMaxX-1;
+
+ if ( y < 0 )
+ y = 0;
+ else
+ if ( y >= SDL_MouseMaxY )
+ y = SDL_MouseMaxY-1;
+ } else {
+ move_mouse = 0;
+ }
+ if ( ! x )
+ x = SDL_MouseX;
+ if ( ! y )
+ y = SDL_MouseY;
+
+ /* Figure out which event to perform */
+ buttonstate = SDL_ButtonState;
+ switch ( state ) {
+ case SDL_PRESSED:
+ event.type = SDL_MOUSEBUTTONDOWN;
+ buttonstate |= SDL_BUTTON(button);
+ break;
+ case SDL_RELEASED:
+ event.type = SDL_MOUSEBUTTONUP;
+ buttonstate &= ~SDL_BUTTON(button);
+ break;
+ default:
+ /* Invalid state -- bail */
+ return(0);
+ }
+
+ /* Update internal mouse state */
+ SDL_ButtonState = buttonstate;
+ if ( move_mouse ) {
+ SDL_MouseX = x;
+ SDL_MouseY = y;
+ SDL_MoveCursor(SDL_MouseX, SDL_MouseY);
+ }
+
+ /* Post the event, if desired */
+ posted = 0;
+ if ( SDL_ProcessEvents[event.type] == SDL_ENABLE ) {
+ event.button.state = state;
+ event.button.button = button;
+ event.button.x = x;
+ event.button.y = y;
+ if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
+ posted = 1;
+ SDL_PushEvent(&event);
+ }
+ }
+ return(posted);
+}
+
diff --git a/distrib/sdl-1.2.15/src/events/SDL_quit.c b/distrib/sdl-1.2.15/src/events/SDL_quit.c
new file mode 100644
index 0000000..2e6c56e
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/events/SDL_quit.c
@@ -0,0 +1,124 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* General quit handling code for SDL */
+
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+
+#include "SDL_events.h"
+#include "SDL_events_c.h"
+
+
+#ifdef HAVE_SIGNAL_H
+static void SDL_HandleSIG(int sig)
+{
+ /* Reset the signal handler */
+ signal(sig, SDL_HandleSIG);
+
+ /* Signal a quit interrupt */
+ SDL_PrivateQuit();
+}
+#endif /* HAVE_SIGNAL_H */
+
+/* Public functions */
+int SDL_QuitInit(void)
+{
+#ifdef HAVE_SIGACTION
+ struct sigaction action;
+ sigaction(SIGINT, NULL, &action);
+# ifdef HAVE_SA_SIGACTION
+ if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) {
+# else
+ if ( action.sa_handler == SIG_DFL ) {
+# endif
+ action.sa_handler = SDL_HandleSIG;
+ sigaction(SIGINT, &action, NULL);
+ }
+ sigaction(SIGTERM, NULL, &action);
+# ifdef HAVE_SA_SIGACTION
+ if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) {
+# else
+ if ( action.sa_handler == SIG_DFL ) {
+# endif
+ action.sa_handler = SDL_HandleSIG;
+ sigaction(SIGTERM, &action, NULL);
+ }
+#elif HAVE_SIGNAL_H
+ void (*ohandler)(int);
+
+ /* Both SIGINT and SIGTERM are translated into quit interrupts */
+ ohandler = signal(SIGINT, SDL_HandleSIG);
+ if ( ohandler != SIG_DFL )
+ signal(SIGINT, ohandler);
+ ohandler = signal(SIGTERM, SDL_HandleSIG);
+ if ( ohandler != SIG_DFL )
+ signal(SIGTERM, ohandler);
+#endif /* HAVE_SIGNAL_H */
+
+ /* That's it! */
+ return(0);
+}
+void SDL_QuitQuit(void)
+{
+#ifdef HAVE_SIGACTION
+ struct sigaction action;
+ sigaction(SIGINT, NULL, &action);
+ if ( action.sa_handler == SDL_HandleSIG ) {
+ action.sa_handler = SIG_DFL;
+ sigaction(SIGINT, &action, NULL);
+ }
+ sigaction(SIGTERM, NULL, &action);
+ if ( action.sa_handler == SDL_HandleSIG ) {
+ action.sa_handler = SIG_DFL;
+ sigaction(SIGTERM, &action, NULL);
+ }
+#elif HAVE_SIGNAL_H
+ void (*ohandler)(int);
+
+ ohandler = signal(SIGINT, SIG_DFL);
+ if ( ohandler != SDL_HandleSIG )
+ signal(SIGINT, ohandler);
+ ohandler = signal(SIGTERM, SIG_DFL);
+ if ( ohandler != SDL_HandleSIG )
+ signal(SIGTERM, ohandler);
+#endif /* HAVE_SIGNAL_H */
+}
+
+/* This function returns 1 if it's okay to close the application window */
+int SDL_PrivateQuit(void)
+{
+ int posted;
+
+ posted = 0;
+ if ( SDL_ProcessEvents[SDL_QUIT] == SDL_ENABLE ) {
+ SDL_Event event;
+ event.type = SDL_QUIT;
+ if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
+ posted = 1;
+ SDL_PushEvent(&event);
+ }
+ }
+ return(posted);
+}
diff --git a/distrib/sdl-1.2.15/src/events/SDL_resize.c b/distrib/sdl-1.2.15/src/events/SDL_resize.c
new file mode 100644
index 0000000..e754a07
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/events/SDL_resize.c
@@ -0,0 +1,71 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Resize event handling code for SDL */
+
+#include "SDL_events.h"
+#include "SDL_events_c.h"
+#include "../video/SDL_sysvideo.h"
+
+
+/* Keep the last resize event so we don't post duplicates */
+static struct {
+ int w;
+ int h;
+} last_resize;
+
+/* This is global for SDL_eventloop.c */
+int SDL_PrivateResize(int w, int h)
+{
+ int posted;
+ SDL_Event events[32];
+
+ /* See if this event would change the video surface */
+ if ( !w || !h ||
+ (( last_resize.w == w ) && ( last_resize.h == h )) ||
+ !SDL_VideoSurface ) {
+ return(0);
+ }
+ last_resize.w = w;
+ last_resize.h = h;
+
+ SDL_SetMouseRange(w, h);
+
+ /* Pull out all old resize events */
+ SDL_PeepEvents(events, sizeof(events)/sizeof(events[0]),
+ SDL_GETEVENT, SDL_VIDEORESIZEMASK);
+
+ /* Post the event, if desired */
+ posted = 0;
+ if ( SDL_ProcessEvents[SDL_VIDEORESIZE] == SDL_ENABLE ) {
+ SDL_Event event;
+ event.type = SDL_VIDEORESIZE;
+ event.resize.w = w;
+ event.resize.h = h;
+ if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
+ posted = 1;
+ SDL_PushEvent(&event);
+ }
+ }
+ return(posted);
+}
diff --git a/distrib/sdl-1.2.15/src/events/SDL_sysevents.h b/distrib/sdl-1.2.15/src/events/SDL_sysevents.h
new file mode 100644
index 0000000..480bfe1
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/events/SDL_sysevents.h
@@ -0,0 +1,46 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is SDL_free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "../video/SDL_sysvideo.h"
+
+/* Useful functions and variables from SDL_sysevents.c */
+
+#ifdef __BEOS__ /* The Be event loop runs in a separate thread */
+#define MUST_THREAD_EVENTS
+#endif
+
+#ifdef __WIN32__ /* Win32 doesn't allow a separate event thread */
+#define CANT_THREAD_EVENTS
+#endif
+
+#ifdef IPOD /* iPod doesn't support threading at all */
+#define CANT_THREAD_EVENTS
+#endif
+
+#ifdef __MACOS__ /* MacOS 7/8 don't support preemptive multi-tasking */
+#define CANT_THREAD_EVENTS
+#endif
+
+#ifdef __OS2__ /* The OS/2 event loop runs in a separate thread */
+#define MUST_THREAD_EVENTS
+#endif
diff --git a/distrib/sdl-1.2.15/src/file/SDL_rwops.c b/distrib/sdl-1.2.15/src/file/SDL_rwops.c
new file mode 100644
index 0000000..1593e97
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/file/SDL_rwops.c
@@ -0,0 +1,673 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This 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"
+
+
+#if defined(__WIN32__) && !defined(__SYMBIAN32__)
+
+/* Functions to read/write Win32 API file pointers */
+/* Will not use it on WinCE because stdio is buffered, it means
+ faster, and all stdio functions anyway are embedded in coredll.dll -
+ the main wince dll*/
+
+#define WINDOWS_LEAN_AND_MEAN
+#include <windows.h>
+
+#ifndef INVALID_SET_FILE_POINTER
+#define INVALID_SET_FILE_POINTER 0xFFFFFFFF
+#endif
+
+#define READAHEAD_BUFFER_SIZE 1024
+
+static int SDLCALL win32_file_open(SDL_RWops *context, const char *filename, const char *mode)
+{
+#ifndef _WIN32_WCE
+ UINT old_error_mode;
+#endif
+ HANDLE h;
+ DWORD r_right, w_right;
+ DWORD must_exist, truncate;
+ int a_mode;
+
+ if (!context)
+ return -1; /* failed (invalid call) */
+
+ context->hidden.win32io.h = INVALID_HANDLE_VALUE; /* mark this as unusable */
+ context->hidden.win32io.buffer.data = NULL;
+ context->hidden.win32io.buffer.size = 0;
+ context->hidden.win32io.buffer.left = 0;
+
+ /* "r" = reading, file must exist */
+ /* "w" = writing, truncate existing, file may not exist */
+ /* "r+"= reading or writing, file must exist */
+ /* "a" = writing, append file may not exist */
+ /* "a+"= append + read, file may not exist */
+ /* "w+" = read, write, truncate. file may not exist */
+
+ must_exist = ( SDL_strchr(mode,'r') != NULL ) ? OPEN_EXISTING : 0;
+ truncate = ( SDL_strchr(mode,'w') != NULL ) ? CREATE_ALWAYS : 0;
+ r_right = ( SDL_strchr(mode,'+') != NULL || must_exist ) ? GENERIC_READ : 0;
+ a_mode = ( SDL_strchr(mode,'a') != NULL ) ? OPEN_ALWAYS : 0;
+ w_right = ( a_mode || SDL_strchr(mode,'+') || truncate ) ? GENERIC_WRITE : 0;
+
+ if (!r_right && !w_right) /* inconsistent mode */
+ return -1; /* failed (invalid call) */
+
+ context->hidden.win32io.buffer.data = (char *)SDL_malloc(READAHEAD_BUFFER_SIZE);
+ if (!context->hidden.win32io.buffer.data) {
+ SDL_OutOfMemory();
+ return -1;
+ }
+
+#ifdef _WIN32_WCE
+ {
+ size_t size = SDL_strlen(filename)+1;
+ wchar_t *filenameW = SDL_stack_alloc(wchar_t, size);
+
+ if ( MultiByteToWideChar(CP_UTF8, 0, filename, -1, filenameW, size) == 0 ) {
+ SDL_stack_free(filenameW);
+ SDL_free(context->hidden.win32io.buffer.data);
+ context->hidden.win32io.buffer.data = NULL;
+ SDL_SetError("Unable to convert filename to Unicode");
+ return -1;
+ }
+ h = CreateFile(filenameW, (w_right|r_right), (w_right)? 0 : FILE_SHARE_READ,
+ NULL, (must_exist|truncate|a_mode), FILE_ATTRIBUTE_NORMAL,NULL);
+ SDL_stack_free(filenameW);
+ }
+#else
+ {
+
+ /* handle Unicode filenames. We do some tapdancing here to make sure this
+ works on Win9x, which doesn't support anything but 1-byte codepages. */
+ const size_t size = SDL_strlen(filename)+1;
+ static int unicode_support = -1;
+
+ if (unicode_support == -1) {
+ OSVERSIONINFO osVerInfo; /* Information about the OS */
+ osVerInfo.dwOSVersionInfoSize = sizeof(osVerInfo);
+ if (!GetVersionEx(&osVerInfo)) {
+ unicode_support = 0;
+ } else if (osVerInfo.dwPlatformId != VER_PLATFORM_WIN32_WINDOWS) {
+ unicode_support = 1; /* Not Win95/98/ME. */
+ } else {
+ unicode_support = 0;
+ }
+ }
+
+ if (unicode_support) { /* everything but Win95/98/ME. */
+ wchar_t *filenameW = SDL_stack_alloc(wchar_t, size);
+ if ( MultiByteToWideChar(CP_UTF8, 0, filename, -1, filenameW, size) == 0 ) {
+ SDL_stack_free(filenameW);
+ SDL_free(context->hidden.win32io.buffer.data);
+ context->hidden.win32io.buffer.data = NULL;
+ SDL_SetError("Unable to convert filename to Unicode");
+ return -1;
+ }
+
+ /* Do not open a dialog box if failure */
+ old_error_mode = SetErrorMode(SEM_NOOPENFILEERRORBOX|SEM_FAILCRITICALERRORS);
+ h = CreateFileW(filenameW, (w_right|r_right), (w_right)? 0 : FILE_SHARE_READ,
+ NULL, (must_exist|truncate|a_mode), FILE_ATTRIBUTE_NORMAL,NULL);
+ /* restore old behaviour */
+ SetErrorMode(old_error_mode);
+
+ SDL_stack_free(filenameW);
+ } else {
+ /* CP_UTF8 might not be supported (Win95), so use SDL_iconv to get wchars. */
+ /* Use UCS2: no UTF-16 support here. Try again in SDL 1.3. :) */
+ char *utf16 = SDL_iconv_string("UCS2", "UTF8", filename, SDL_strlen(filename) + 1);
+ char *filenameA = SDL_stack_alloc(char, size * 6); /* 6, just in case. */
+ BOOL bDefCharUsed = FALSE;
+
+ /* Dither down to a codepage and hope for the best. */
+ if (!utf16 ||
+ !WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)utf16, -1, filenameA, size*6, 0, &bDefCharUsed) ||
+ bDefCharUsed) {
+ SDL_stack_free(filenameA);
+ SDL_free(utf16);
+ SDL_free(context->hidden.win32io.buffer.data);
+ context->hidden.win32io.buffer.data = NULL;
+ SDL_SetError("Unable to convert filename to Unicode");
+ return -1;
+ }
+
+ /* Do not open a dialog box if failure */
+ old_error_mode = SetErrorMode(SEM_NOOPENFILEERRORBOX|SEM_FAILCRITICALERRORS);
+ h = CreateFile(filenameA, (w_right|r_right), (w_right)? 0 : FILE_SHARE_READ,
+ NULL, (must_exist|truncate|a_mode), FILE_ATTRIBUTE_NORMAL,NULL);
+ /* restore old behaviour */
+ SetErrorMode(old_error_mode);
+
+ SDL_stack_free(filenameA);
+ SDL_free(utf16);
+ }
+
+ }
+#endif /* _WIN32_WCE */
+
+ if (h==INVALID_HANDLE_VALUE) {
+ SDL_free(context->hidden.win32io.buffer.data);
+ context->hidden.win32io.buffer.data = NULL;
+ SDL_SetError("Couldn't open %s",filename);
+ return -2; /* failed (CreateFile) */
+ }
+ context->hidden.win32io.h = h;
+ context->hidden.win32io.append = a_mode;
+
+ return 0; /* ok */
+}
+static int SDLCALL win32_file_seek(SDL_RWops *context, int offset, int whence)
+{
+ DWORD win32whence;
+ int file_pos;
+
+ if (!context || context->hidden.win32io.h == INVALID_HANDLE_VALUE) {
+ SDL_SetError("win32_file_seek: invalid context/file not opened");
+ return -1;
+ }
+
+ /* FIXME: We may be able to satisfy the seek within buffered data */
+ if (whence == RW_SEEK_CUR && context->hidden.win32io.buffer.left) {
+ offset -= context->hidden.win32io.buffer.left;
+ }
+ context->hidden.win32io.buffer.left = 0;
+
+ switch (whence) {
+ case RW_SEEK_SET:
+ win32whence = FILE_BEGIN; break;
+ case RW_SEEK_CUR:
+ win32whence = FILE_CURRENT; break;
+ case RW_SEEK_END:
+ win32whence = FILE_END; break;
+ default:
+ SDL_SetError("win32_file_seek: Unknown value for 'whence'");
+ return -1;
+ }
+
+ file_pos = SetFilePointer(context->hidden.win32io.h,offset,NULL,win32whence);
+
+ if ( file_pos != INVALID_SET_FILE_POINTER )
+ return file_pos; /* success */
+
+ SDL_Error(SDL_EFSEEK);
+ return -1; /* error */
+}
+static int SDLCALL win32_file_read(SDL_RWops *context, void *ptr, int size, int maxnum)
+{
+ int total_need;
+ int total_read = 0;
+ int read_ahead;
+ DWORD byte_read;
+
+ total_need = size*maxnum;
+
+ if (!context || context->hidden.win32io.h == INVALID_HANDLE_VALUE || total_need<=0 || !size)
+ return 0;
+
+ if (context->hidden.win32io.buffer.left > 0) {
+ void *data = (char *)context->hidden.win32io.buffer.data +
+ context->hidden.win32io.buffer.size -
+ context->hidden.win32io.buffer.left;
+ read_ahead = SDL_min(total_need, context->hidden.win32io.buffer.left);
+ SDL_memcpy(ptr, data, read_ahead);
+ context->hidden.win32io.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.win32io.h,context->hidden.win32io.buffer.data,READAHEAD_BUFFER_SIZE,&byte_read,NULL)) {
+ SDL_Error(SDL_EFREAD);
+ return 0;
+ }
+ read_ahead = SDL_min(total_need, (int)byte_read);
+ SDL_memcpy(ptr, context->hidden.win32io.buffer.data, read_ahead);
+ context->hidden.win32io.buffer.size = byte_read;
+ context->hidden.win32io.buffer.left = byte_read-read_ahead;
+ total_read += read_ahead;
+ } else {
+ if (!ReadFile(context->hidden.win32io.h,ptr,total_need,&byte_read,NULL)) {
+ SDL_Error(SDL_EFREAD);
+ return 0;
+ }
+ total_read += byte_read;
+ }
+ return (total_read/size);
+}
+static int SDLCALL win32_file_write(SDL_RWops *context, const void *ptr, int size, int num)
+{
+
+ int total_bytes;
+ DWORD byte_written,nwritten;
+
+ total_bytes = size*num;
+
+ if (!context || context->hidden.win32io.h==INVALID_HANDLE_VALUE || total_bytes<=0 || !size)
+ return 0;
+
+ if (context->hidden.win32io.buffer.left) {
+ SetFilePointer(context->hidden.win32io.h,-context->hidden.win32io.buffer.left,NULL,FILE_CURRENT);
+ context->hidden.win32io.buffer.left = 0;
+ }
+
+ /* if in append mode, we must go to the EOF before write */
+ if (context->hidden.win32io.append) {
+ if ( SetFilePointer(context->hidden.win32io.h,0L,NULL,FILE_END) == INVALID_SET_FILE_POINTER ) {
+ SDL_Error(SDL_EFWRITE);
+ return 0;
+ }
+ }
+
+ if (!WriteFile(context->hidden.win32io.h,ptr,total_bytes,&byte_written,NULL)) {
+ SDL_Error(SDL_EFWRITE);
+ return 0;
+ }
+
+ nwritten = byte_written/size;
+ return nwritten;
+}
+static int SDLCALL win32_file_close(SDL_RWops *context)
+{
+
+ if ( context ) {
+ if (context->hidden.win32io.h != INVALID_HANDLE_VALUE) {
+ CloseHandle(context->hidden.win32io.h);
+ context->hidden.win32io.h = INVALID_HANDLE_VALUE; /* to be sure */
+ }
+ if (context->hidden.win32io.buffer.data) {
+ SDL_free(context->hidden.win32io.buffer.data);
+ context->hidden.win32io.buffer.data = NULL;
+ }
+ SDL_FreeRW(context);
+ }
+ return(0);
+}
+#endif /* __WIN32__ */
+
+#ifdef HAVE_STDIO_H
+
+/* Functions to read/write stdio file pointers */
+
+static int SDLCALL stdio_seek(SDL_RWops *context, int offset, int whence)
+{
+ if ( fseek(context->hidden.stdio.fp, offset, whence) == 0 ) {
+ return(ftell(context->hidden.stdio.fp));
+ } else {
+ SDL_Error(SDL_EFSEEK);
+ return(-1);
+ }
+}
+static int SDLCALL stdio_read(SDL_RWops *context, void *ptr, int size, int 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 int SDLCALL stdio_write(SDL_RWops *context, const void *ptr, int size, int 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)
+{
+ if ( context ) {
+ if ( context->hidden.stdio.autoclose ) {
+ /* WARNING: Check the return value here! */
+ fclose(context->hidden.stdio.fp);
+ }
+ SDL_FreeRW(context);
+ }
+ return(0);
+}
+#endif /* !HAVE_STDIO_H */
+
+/* Functions to read/write memory pointers */
+
+static int SDLCALL mem_seek(SDL_RWops *context, int 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:
+ SDL_SetError("Unknown value for 'whence'");
+ return(-1);
+ }
+ if ( newpos < context->hidden.mem.base ) {
+ newpos = context->hidden.mem.base;
+ }
+ if ( newpos > context->hidden.mem.stop ) {
+ newpos = context->hidden.mem.stop;
+ }
+ context->hidden.mem.here = newpos;
+ return(context->hidden.mem.here-context->hidden.mem.base);
+}
+static int SDLCALL mem_read(SDL_RWops *context, void *ptr, int size, int 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 int SDLCALL mem_write(SDL_RWops *context, const void *ptr, int size, int num)
+{
+ if ( (context->hidden.mem.here + (num*size)) > context->hidden.mem.stop ) {
+ num = (context->hidden.mem.stop-context->hidden.mem.here)/size;
+ }
+ SDL_memcpy(context->hidden.mem.here, ptr, num*size);
+ context->hidden.mem.here += num*size;
+ return(num);
+}
+static int SDLCALL mem_writeconst(SDL_RWops *context, const void *ptr, int size, int num)
+{
+ SDL_SetError("Can't write to read-only memory");
+ return(-1);
+}
+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 */
+
+#ifdef __MACOS__
+/*
+ * translate unix-style slash-separated filename to mac-style colon-separated
+ * name; return malloced string
+ */
+static char *unix_to_mac(const char *file)
+{
+ int flen = SDL_strlen(file);
+ char *path = SDL_malloc(flen + 2);
+ const char *src = file;
+ char *dst = path;
+ if(*src == '/') {
+ /* really depends on filesystem layout, hope for the best */
+ src++;
+ } else {
+ /* Check if this is a MacOS path to begin with */
+ if(*src != ':')
+ *dst++ = ':'; /* relative paths begin with ':' */
+ }
+ while(src < file + flen) {
+ const char *end = SDL_strchr(src, '/');
+ int len;
+ if(!end)
+ end = file + flen; /* last component */
+ len = end - src;
+ if(len == 0 || (len == 1 && src[0] == '.')) {
+ /* remove repeated slashes and . */
+ } else {
+ if(len == 2 && src[0] == '.' && src[1] == '.') {
+ /* replace .. with the empty string */
+ } else {
+ SDL_memcpy(dst, src, len);
+ dst += len;
+ }
+ if(end < file + flen)
+ *dst++ = ':';
+ }
+ src = end + 1;
+ }
+ *dst++ = '\0';
+ return path;
+}
+#endif /* __MACOS__ */
+
+SDL_RWops *SDL_RWFromFile(const char *file, const char *mode)
+{
+ SDL_RWops *rwops = NULL;
+#ifdef HAVE_STDIO_H
+ FILE *fp = NULL;
+ (void) fp;
+#endif
+ if ( !file || !*file || !mode || !*mode ) {
+ SDL_SetError("SDL_RWFromFile(): No file or no mode specified");
+ return NULL;
+ }
+
+#if defined(__WIN32__) && !defined(__SYMBIAN32__)
+ rwops = SDL_AllocRW();
+ if (!rwops)
+ return NULL; /* SDL_SetError already setup by SDL_AllocRW() */
+ if (win32_file_open(rwops,file,mode) < 0) {
+ SDL_FreeRW(rwops);
+ return NULL;
+ }
+ rwops->seek = win32_file_seek;
+ rwops->read = win32_file_read;
+ rwops->write = win32_file_write;
+ rwops->close = win32_file_close;
+
+#elif HAVE_STDIO_H
+
+#ifdef __MACOS__
+ {
+ char *mpath = unix_to_mac(file);
+ fp = fopen(mpath, mode);
+ SDL_free(mpath);
+ }
+#else
+ fp = fopen(file, mode);
+#endif
+ if ( fp == NULL ) {
+ SDL_SetError("Couldn't open %s", file);
+ } else {
+ rwops = SDL_RWFromFP(fp, 1);
+ }
+#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, int autoclose)
+{
+ SDL_RWops *rwops = NULL;
+
+ rwops = SDL_AllocRW();
+ if ( rwops != NULL ) {
+ rwops->seek = stdio_seek;
+ rwops->read = stdio_read;
+ rwops->write = stdio_write;
+ rwops->close = stdio_close;
+ rwops->hidden.stdio.fp = fp;
+ rwops->hidden.stdio.autoclose = autoclose;
+ }
+ return(rwops);
+}
+#endif /* HAVE_STDIO_H */
+
+SDL_RWops *SDL_RWFromMem(void *mem, int size)
+{
+ SDL_RWops *rwops;
+
+ rwops = SDL_AllocRW();
+ if ( rwops != NULL ) {
+ rwops->seek = mem_seek;
+ rwops->read = mem_read;
+ rwops->write = mem_write;
+ rwops->close = mem_close;
+ rwops->hidden.mem.base = (Uint8 *)mem;
+ rwops->hidden.mem.here = rwops->hidden.mem.base;
+ rwops->hidden.mem.stop = rwops->hidden.mem.base+size;
+ }
+ return(rwops);
+}
+
+SDL_RWops *SDL_RWFromConstMem(const void *mem, int size)
+{
+ SDL_RWops *rwops;
+
+ rwops = SDL_AllocRW();
+ if ( rwops != NULL ) {
+ rwops->seek = mem_seek;
+ rwops->read = mem_read;
+ rwops->write = mem_writeconst;
+ rwops->close = mem_close;
+ rwops->hidden.mem.base = (Uint8 *)mem;
+ rwops->hidden.mem.here = rwops->hidden.mem.base;
+ rwops->hidden.mem.stop = rwops->hidden.mem.base+size;
+ }
+ return(rwops);
+}
+
+SDL_RWops *SDL_AllocRW(void)
+{
+ SDL_RWops *area;
+
+ area = (SDL_RWops *)SDL_malloc(sizeof *area);
+ if ( area == NULL ) {
+ SDL_OutOfMemory();
+ }
+ return(area);
+}
+
+void SDL_FreeRW(SDL_RWops *area)
+{
+ SDL_free(area);
+}
+
+/* Functions for dynamically reading and writing endian-specific values */
+
+Uint16 SDL_ReadLE16 (SDL_RWops *src)
+{
+ Uint16 value;
+
+ SDL_RWread(src, &value, (sizeof value), 1);
+ return(SDL_SwapLE16(value));
+}
+Uint16 SDL_ReadBE16 (SDL_RWops *src)
+{
+ Uint16 value;
+
+ SDL_RWread(src, &value, (sizeof value), 1);
+ return(SDL_SwapBE16(value));
+}
+Uint32 SDL_ReadLE32 (SDL_RWops *src)
+{
+ Uint32 value;
+
+ SDL_RWread(src, &value, (sizeof value), 1);
+ return(SDL_SwapLE32(value));
+}
+Uint32 SDL_ReadBE32 (SDL_RWops *src)
+{
+ Uint32 value;
+
+ SDL_RWread(src, &value, (sizeof value), 1);
+ return(SDL_SwapBE32(value));
+}
+Uint64 SDL_ReadLE64 (SDL_RWops *src)
+{
+ Uint64 value;
+
+ SDL_RWread(src, &value, (sizeof value), 1);
+ return(SDL_SwapLE64(value));
+}
+Uint64 SDL_ReadBE64 (SDL_RWops *src)
+{
+ Uint64 value;
+
+ SDL_RWread(src, &value, (sizeof value), 1);
+ return(SDL_SwapBE64(value));
+}
+
+int SDL_WriteLE16 (SDL_RWops *dst, Uint16 value)
+{
+ value = SDL_SwapLE16(value);
+ return(SDL_RWwrite(dst, &value, (sizeof value), 1));
+}
+int SDL_WriteBE16 (SDL_RWops *dst, Uint16 value)
+{
+ value = SDL_SwapBE16(value);
+ return(SDL_RWwrite(dst, &value, (sizeof value), 1));
+}
+int SDL_WriteLE32 (SDL_RWops *dst, Uint32 value)
+{
+ value = SDL_SwapLE32(value);
+ return(SDL_RWwrite(dst, &value, (sizeof value), 1));
+}
+int SDL_WriteBE32 (SDL_RWops *dst, Uint32 value)
+{
+ value = SDL_SwapBE32(value);
+ return(SDL_RWwrite(dst, &value, (sizeof value), 1));
+}
+int SDL_WriteLE64 (SDL_RWops *dst, Uint64 value)
+{
+ value = SDL_SwapLE64(value);
+ return(SDL_RWwrite(dst, &value, (sizeof value), 1));
+}
+int SDL_WriteBE64 (SDL_RWops *dst, Uint64 value)
+{
+ value = SDL_SwapBE64(value);
+ return(SDL_RWwrite(dst, &value, (sizeof value), 1));
+}
diff --git a/distrib/sdl-1.2.12/src/hermes/COPYING.LIB b/distrib/sdl-1.2.15/src/hermes/COPYING.LIB
index 69679a5..69679a5 100644
--- a/distrib/sdl-1.2.12/src/hermes/COPYING.LIB
+++ b/distrib/sdl-1.2.15/src/hermes/COPYING.LIB
diff --git a/distrib/sdl-1.2.15/src/hermes/HeadMMX.h b/distrib/sdl-1.2.15/src/hermes/HeadMMX.h
new file mode 100644
index 0000000..5d9850c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/hermes/HeadMMX.h
@@ -0,0 +1,100 @@
+/*
+ Header definitions for the MMX routines for the HERMES library
+ Copyright (c) 1998 Christian Nentwich (c.nentwich@cs.ucl.ac.uk)
+ This source code is licensed under the GNU LGPL
+
+ Please refer to the file COPYING.LIB contained in the distribution for
+ licensing conditions
+*/
+#include "SDL_config.h"
+
+#ifndef __HERMES_HEAD_MMX__
+#define __HERMES_HEAD_MMX__
+
+
+/* If you cannot stand ifdefs, then please do not look into this file, it's
+ going to end your life :) */
+
+#ifdef X86_ASSEMBLER
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void STACKCALL ConvertMMX(HermesConverterInterface *);
+
+void STACKCALL ClearMMX_32(HermesClearInterface *);
+void STACKCALL ClearMMX_24(HermesClearInterface *);
+void STACKCALL ClearMMX_16(HermesClearInterface *);
+void STACKCALL ClearMMX_8(HermesClearInterface *);
+
+void ConvertMMXpII32_24RGB888();
+void ConvertMMXpII32_16RGB565();
+void ConvertMMXpII32_16BGR565();
+void ConvertMMXpII32_16RGB555();
+void ConvertMMXpII32_16BGR565();
+void ConvertMMXpII32_16BGR555();
+
+void ConvertMMXp32_16RGB555();
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+/* Fix the underscore business with ELF compilers */
+
+#if (defined(__ELF__) && defined(__GNUC__)) || defined(__SUNPRO_C)
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+
+ extern void _ConvertMMX(HermesConverterInterface *);
+ extern void _ConvertMMXpII32_24RGB888();
+ extern void _ConvertMMXpII32_16RGB565();
+ extern void _ConvertMMXpII32_16BGR565();
+ extern void _ConvertMMXpII32_16RGB555();
+ extern void _ConvertMMXpII32_16BGR555();
+
+ #define ConvertMMX _ConvertMMX
+ #define ConvertMMXpII32_24RGB888 _ConvertMMXpII32_24RGB888
+ #define ConvertMMXpII32_16RGB565 _ConvertMMXpII32_16RGB565
+ #define ConvertMMXpII32_16BGR565 _ConvertMMXpII32_16BGR565
+ #define ConvertMMXpII32_16RGB555 _ConvertMMXpII32_16RGB555
+ #define ConvertMMXpII32_16BGR555 _ConvertMMXpII32_16BGR555
+
+ #ifdef __cplusplus
+ }
+ #endif
+
+#endif /* ELF and GNUC */
+
+
+
+
+/* Make it work with Watcom */
+#ifdef __WATCOMC__
+#pragma warning 601 9
+
+#pragma aux ConvertMMX "_*" modify [EAX EBX ECX EDX ESI EDI]
+
+#pragma aux ClearMMX_32 "_*" modify [EAX EBX ECX EDX ESI EDI]
+#pragma aux ClearMMX_24 "_*" modify [EAX EBX ECX EDX ESI EDI]
+#pragma aux ClearMMX_16 "_*" modify [EAX EBX ECX EDX ESI EDI]
+#pragma aux ClearMMX_8 "_*" modify [EAX EBX ECX EDX ESI EDI]
+
+#pragma aux ConvertMMXpII32_24RGB888 "_*"
+#pragma aux ConvertMMXpII32_16RGB565 "_*"
+#pragma aux ConvertMMXpII32_16BGR565 "_*"
+#pragma aux ConvertMMXpII32_16RGB555 "_*"
+#pragma aux ConvertMMXpII32_16BGR555 "_*"
+#pragma aux ConvertMMXp32_16RGB555 "_*"
+
+#endif /* WATCOM */
+
+#endif /* X86_ASSEMBLER */
+
+
+#endif
diff --git a/distrib/sdl-1.2.15/src/hermes/HeadX86.h b/distrib/sdl-1.2.15/src/hermes/HeadX86.h
new file mode 100644
index 0000000..fc6b6dd
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/hermes/HeadX86.h
@@ -0,0 +1,186 @@
+/*
+ Header definitions for the x86 routines for the HERMES library
+ Copyright (c) 1998 Christian Nentwich (brn@eleet.mcb.at)
+ This source code is licensed under the GNU LGPL
+
+ Please refer to the file COPYING.LIB contained in the distribution for
+ licensing conditions
+*/
+
+#ifndef __HERMES_HEAD_X86__
+#define __HERMES_HEAD_X86__
+
+
+#ifdef X86_ASSEMBLER
+
+/* If you can't stand IFDEFS, then close your eyes now, please :) */
+
+/* Ok, we start with normal function definitions */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+void STACKCALL ConvertX86(HermesConverterInterface *);
+void STACKCALL ClearX86_32(HermesClearInterface *);
+void STACKCALL ClearX86_24(HermesClearInterface *);
+void STACKCALL ClearX86_16(HermesClearInterface *);
+void STACKCALL ClearX86_8(HermesClearInterface *);
+
+int STACKCALL Hermes_X86_CPU();
+
+void ConvertX86p32_32BGR888();
+void ConvertX86p32_32RGBA888();
+void ConvertX86p32_32BGRA888();
+void ConvertX86p32_24RGB888();
+void ConvertX86p32_24BGR888();
+void ConvertX86p32_16RGB565();
+void ConvertX86p32_16BGR565();
+void ConvertX86p32_16RGB555();
+void ConvertX86p32_16BGR555();
+void ConvertX86p32_8RGB332();
+
+void ConvertX86p16_32RGB888();
+void ConvertX86p16_32BGR888();
+void ConvertX86p16_32RGBA888();
+void ConvertX86p16_32BGRA888();
+void ConvertX86p16_24RGB888();
+void ConvertX86p16_24BGR888();
+void ConvertX86p16_16BGR565();
+void ConvertX86p16_16RGB555();
+void ConvertX86p16_16BGR555();
+void ConvertX86p16_8RGB332();
+
+void CopyX86p_4byte();
+void CopyX86p_3byte();
+void CopyX86p_2byte();
+void CopyX86p_1byte();
+
+void ConvertX86pI8_32();
+void ConvertX86pI8_24();
+void ConvertX86pI8_16();
+
+extern int ConvertX86p16_32RGB888_LUT_X86[512];
+extern int ConvertX86p16_32BGR888_LUT_X86[512];
+extern int ConvertX86p16_32RGBA888_LUT_X86[512];
+extern int ConvertX86p16_32BGRA888_LUT_X86[512];
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+
+/* Now fix up the ELF underscore problem */
+
+#if (defined(__ELF__) && defined(__GNUC__)) || defined(__SUNPRO_C)
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+
+ extern int _Hermes_X86_CPU();
+
+ extern void _ConvertX86(HermesConverterInterface *);
+
+ extern void _ConvertX86p32_32BGR888();
+ extern void _ConvertX86p32_32RGBA888();
+ extern void _ConvertX86p32_32BGRA888();
+ extern void _ConvertX86p32_24RGB888();
+ extern void _ConvertX86p32_24BGR888();
+ extern void _ConvertX86p32_16RGB565();
+ extern void _ConvertX86p32_16BGR565();
+ extern void _ConvertX86p32_16RGB555();
+ extern void _ConvertX86p32_16BGR555();
+ extern void _ConvertX86p32_8RGB332();
+
+ extern void _ConvertX86p16_16BGR565();
+ extern void _ConvertX86p16_16RGB555();
+ extern void _ConvertX86p16_16BGR555();
+ extern void _ConvertX86p16_8RGB332();
+
+
+ #define Hermes_X86_CPU _Hermes_X86_CPU
+
+ #define ConvertX86 _ConvertX86
+
+ #define ConvertX86p32_32BGR888 _ConvertX86p32_32BGR888
+ #define ConvertX86p32_32RGBA888 _ConvertX86p32_32RGBA888
+ #define ConvertX86p32_32BGRA888 _ConvertX86p32_32BGRA888
+ #define ConvertX86p32_24RGB888 _ConvertX86p32_24RGB888
+ #define ConvertX86p32_24BGR888 _ConvertX86p32_24BGR888
+ #define ConvertX86p32_16RGB565 _ConvertX86p32_16RGB565
+ #define ConvertX86p32_16BGR565 _ConvertX86p32_16BGR565
+ #define ConvertX86p32_16RGB555 _ConvertX86p32_16RGB555
+ #define ConvertX86p32_16BGR555 _ConvertX86p32_16BGR555
+ #define ConvertX86p32_8RGB332 _ConvertX86p32_8RGB332
+
+ #define ConvertX86p16_16BGR565 _ConvertX86p16_16BGR565
+ #define ConvertX86p16_16RGB555 _ConvertX86p16_16RGB555
+ #define ConvertX86p16_16BGR555 _ConvertX86p16_16BGR555
+ #define ConvertX86p16_8RGB332 _ConvertX86p16_8RGB332
+
+
+ #ifdef __cplusplus
+ }
+ #endif
+
+#endif /* ELF & GNU */
+
+
+
+/* Make it run with WATCOM C */
+#ifdef __WATCOMC__
+#pragma warning 601 9
+
+#pragma aux Hermes_X86_CPU "_*"
+
+#pragma aux ConvertX86 "_*" modify [EAX EBX ECX EDX ESI EDI]
+#pragma aux ClearX86_32 "_*" modify [EAX EBX ECX EDX ESI EDI]
+#pragma aux ClearX86_24 "_*" modify [EAX EBX ECX EDX ESI EDI]
+#pragma aux ClearX86_16 "_*" modify [EAX EBX ECX EDX ESI EDI]
+#pragma aux ClearX86_8 "_*" modify [EAX EBX ECX EDX ESI EDI]
+
+#pragma aux ConvertX86p32_32BGR888 "_*"
+#pragma aux ConvertX86p32_32RGBA888 "_*"
+#pragma aux ConvertX86p32_32BGRA888 "_*"
+#pragma aux ConvertX86p32_24RGB888 "_*"
+#pragma aux ConvertX86p32_24BGR888 "_*"
+#pragma aux ConvertX86p32_16RGB565 "_*"
+#pragma aux ConvertX86p32_16BGR565 "_*"
+#pragma aux ConvertX86p32_16RGB555 "_*"
+#pragma aux ConvertX86p32_16BGR555 "_*"
+#pragma aux ConvertX86p32_8RGB332 "_*"
+
+#pragma aux ConvertX86p16_32RGB888 "_*"
+#pragma aux ConvertX86p16_32BGR888 "_*"
+#pragma aux ConvertX86p16_32RGBA888 "_*"
+#pragma aux ConvertX86p16_32BGRA888 "_*"
+#pragma aux ConvertX86p16_24RGB888 "_*"
+#pragma aux ConvertX86p16_24BGR888 "_*"
+#pragma aux ConvertX86p16_16BGR565 "_*"
+#pragma aux ConvertX86p16_16RGB555 "_*"
+#pragma aux ConvertX86p16_16BGR555 "_*"
+#pragma aux ConvertX86p16_8RGB332 "_*"
+
+#pragma aux CopyX86p_4byte "_*"
+#pragma aux CopyX86p_3byte "_*"
+#pragma aux CopyX86p_2byte "_*"
+#pragma aux CopyX86p_1byte "_*"
+
+#pragma aux ConvertX86pI8_32 "_*"
+#pragma aux ConvertX86pI8_24 "_*"
+#pragma aux ConvertX86pI8_16 "_*"
+
+#pragma aux ConvertX86p16_32RGB888_LUT_X86 "_*"
+#pragma aux ConvertX86p16_32BGR888_LUT_X86 "_*"
+#pragma aux ConvertX86p16_32RGBA888_LUT_X86 "_*"
+#pragma aux ConvertX86p16_32BGRA888_LUT_X86 "_*"
+
+#endif /* __WATCOMC__ */
+
+
+#endif /* X86_ASSEMBLER */
+
+
+#endif
diff --git a/distrib/sdl-1.2.12/src/hermes/README b/distrib/sdl-1.2.15/src/hermes/README
index a03b6cf..a03b6cf 100644
--- a/distrib/sdl-1.2.12/src/hermes/README
+++ b/distrib/sdl-1.2.15/src/hermes/README
diff --git a/distrib/sdl-1.2.12/src/hermes/common.inc b/distrib/sdl-1.2.15/src/hermes/common.inc
index 9587e6f..9587e6f 100644
--- a/distrib/sdl-1.2.12/src/hermes/common.inc
+++ b/distrib/sdl-1.2.15/src/hermes/common.inc
diff --git a/distrib/sdl-1.2.15/src/hermes/mmx_main.asm b/distrib/sdl-1.2.15/src/hermes/mmx_main.asm
new file mode 100644
index 0000000..00032b9
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/hermes/mmx_main.asm
@@ -0,0 +1,74 @@
+;
+; mmx format converter main loops for HERMES
+; Some routines Copyright (c) 1998 Christian Nentwich (c.nentwich@cs.ucl.ac.uk)
+; This source code is licensed under the GNU LGPL
+;
+; Please refer to the file COPYING.LIB contained in the distribution for
+; licensing conditions
+;
+
+BITS 32
+
+%include "common.inc"
+
+SDL_FUNC _ConvertMMX
+
+SECTION .text
+
+;; _ConvertMMX:
+;; [ESP+8] ConverterInfo*
+;; --------------------------------------------------------------------------
+;; ConverterInfo (ebp+..)
+;; 0: void *s_pixels
+;; 4: int s_width
+;; 8: int s_height
+;; 12: int s_add
+;; 16: void *d_pixels
+;; 20: int d_width
+;; 24: int d_height
+;; 28: int d_add
+;; 32: void (*converter_function)()
+;; 36: int32 *lookup
+
+_ConvertMMX:
+ push ebp
+ mov ebp,esp
+
+; Save the registers used by the blitters, necessary for optimized code
+ pusha
+
+ mov eax,[ebp+8]
+
+ cmp dword [eax+4],BYTE 0
+ je endconvert
+
+ mov ebp,eax
+
+ mov esi,[ebp+0]
+ mov edi,[ebp+16]
+
+y_loop:
+ mov ecx,[ebp+4]
+
+ call [ebp+32]
+
+ add esi,[ebp+12]
+ add edi,[ebp+28]
+
+ dec dword [ebp+8]
+ jnz y_loop
+
+
+; Restore the registers used by the blitters, necessary for optimized code
+ popa
+
+ pop ebp
+
+endconvert:
+ emms
+
+ ret
+
+%ifidn __OUTPUT_FORMAT__,elf32
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif
diff --git a/distrib/sdl-1.2.15/src/hermes/mmxp2_32.asm b/distrib/sdl-1.2.15/src/hermes/mmxp2_32.asm
new file mode 100644
index 0000000..20c3277
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/hermes/mmxp2_32.asm
@@ -0,0 +1,405 @@
+;
+; pII-optimised MMX format converters for HERMES
+; Copyright (c) 1998 Christian Nentwich (c.nentwich@cs.ucl.ac.uk)
+; and (c) 1999 Jonathan Matthew (jmatthew@uq.net.au)
+; This source code is licensed under the GNU LGPL
+;
+; Please refer to the file COPYING.LIB contained in the distribution for
+; licensing conditions
+;
+; COPYRIGHT NOTICE
+;
+; This file partly contains code that is (c) Intel Corporation, specifically
+; the mode detection routine, and the converter to 15 bit (8 pixel
+; conversion routine from the mmx programming tutorial pages).
+;
+;
+; These routines aren't exactly pII optimised - it's just that as they
+; are, they're terrible on p5 MMXs, but less so on pIIs. Someone needs to
+; optimise them for p5 MMXs..
+
+BITS 32
+
+%include "common.inc"
+
+SDL_FUNC _ConvertMMXpII32_24RGB888
+SDL_FUNC _ConvertMMXpII32_16RGB565
+SDL_FUNC _ConvertMMXpII32_16BGR565
+SDL_FUNC _ConvertMMXpII32_16RGB555
+SDL_FUNC _ConvertMMXpII32_16BGR555
+
+;; Macros for conversion routines
+
+%macro _push_immq_mask 1
+ push dword %1
+ push dword %1
+%endmacro
+
+%macro load_immq 2
+ _push_immq_mask %2
+ movq %1, [esp]
+%endmacro
+
+%macro pand_immq 2
+ _push_immq_mask %2
+ pand %1, [esp]
+%endmacro
+
+%define CLEANUP_IMMQ_LOADS(num) \
+ add esp, byte 8 * num
+
+%define mmx32_rgb888_mask 00ffffffh
+%define mmx32_rgb565_b 000000f8h
+%define mmx32_rgb565_g 0000fc00h
+%define mmx32_rgb565_r 00f80000h
+
+%define mmx32_rgb555_rb 00f800f8h
+%define mmx32_rgb555_g 0000f800h
+%define mmx32_rgb555_mul 20000008h
+%define mmx32_bgr555_mul 00082000h
+
+SECTION .text
+
+_ConvertMMXpII32_24RGB888:
+
+ ; set up mm6 as the mask, mm7 as zero
+ load_immq mm6, mmx32_rgb888_mask
+ CLEANUP_IMMQ_LOADS(1)
+ pxor mm7, mm7
+
+ mov edx, ecx ; save ecx
+ and ecx, 0fffffffch ; clear lower two bits
+ jnz .L1
+ jmp .L2
+
+.L1:
+
+ movq mm0, [esi] ; A R G B a r g b
+ pand mm0, mm6 ; 0 R G B 0 r g b
+ movq mm1, [esi+8] ; A R G B a r g b
+ pand mm1, mm6 ; 0 R G B 0 r g b
+
+ movq mm2, mm0 ; 0 R G B 0 r g b
+ punpckhdq mm2, mm7 ; 0 0 0 0 0 R G B
+ punpckldq mm0, mm7 ; 0 0 0 0 0 r g b
+ psllq mm2, 24 ; 0 0 R G B 0 0 0
+ por mm0, mm2 ; 0 0 R G B r g b
+
+ movq mm3, mm1 ; 0 R G B 0 r g b
+ psllq mm3, 48 ; g b 0 0 0 0 0 0
+ por mm0, mm3 ; g b R G B r g b
+
+ movq mm4, mm1 ; 0 R G B 0 r g b
+ punpckhdq mm4, mm7 ; 0 0 0 0 0 R G B
+ punpckldq mm1, mm7 ; 0 0 0 0 0 r g b
+ psrlq mm1, 16 ; 0 0 0 R G B 0 r
+ psllq mm4, 8 ; 0 0 0 0 R G B 0
+ por mm1, mm4 ; 0 0 0 0 R G B r
+
+ movq [edi], mm0
+ add esi, BYTE 16
+ movd [edi+8], mm1
+ add edi, BYTE 12
+ sub ecx, BYTE 4
+ jnz .L1
+
+.L2:
+ mov ecx, edx
+ and ecx, BYTE 3
+ jz .L4
+.L3:
+ mov al, [esi]
+ mov bl, [esi+1]
+ mov dl, [esi+2]
+ mov [edi], al
+ mov [edi+1], bl
+ mov [edi+2], dl
+ add esi, BYTE 4
+ add edi, BYTE 3
+ dec ecx
+ jnz .L3
+.L4:
+ retn
+
+
+
+_ConvertMMXpII32_16RGB565:
+
+ ; set up masks
+ load_immq mm5, mmx32_rgb565_b
+ load_immq mm6, mmx32_rgb565_g
+ load_immq mm7, mmx32_rgb565_r
+ CLEANUP_IMMQ_LOADS(3)
+
+ mov edx, ecx
+ shr ecx, 2
+ jnz .L1
+ jmp .L2 ; not necessary at the moment, but doesn't hurt (much)
+
+.L1:
+ movq mm0, [esi] ; argb
+ movq mm1, mm0 ; argb
+ pand mm0, mm6 ; 00g0
+ movq mm3, mm1 ; argb
+ pand mm1, mm5 ; 000b
+ pand mm3, mm7 ; 0r00
+ pslld mm1, 2 ; 0 0 000000bb bbb00000
+ por mm0, mm1 ; 0 0 ggggggbb bbb00000
+ psrld mm0, 5 ; 0 0 00000ggg gggbbbbb
+
+ movq mm4, [esi+8] ; argb
+ movq mm2, mm4 ; argb
+ pand mm4, mm6 ; 00g0
+ movq mm1, mm2 ; argb
+ pand mm2, mm5 ; 000b
+ pand mm1, mm7 ; 0r00
+ pslld mm2, 2 ; 0 0 000000bb bbb00000
+ por mm4, mm2 ; 0 0 ggggggbb bbb00000
+ psrld mm4, 5 ; 0 0 00000ggg gggbbbbb
+
+ packuswb mm3, mm1 ; R 0 r 0
+ packssdw mm0, mm4 ; as above.. ish
+ por mm0, mm3 ; done.
+ movq [edi], mm0
+
+ add esi, 16
+ add edi, 8
+ dec ecx
+ jnz .L1
+
+.L2:
+ mov ecx, edx
+ and ecx, BYTE 3
+ jz .L4
+.L3:
+ mov al, [esi]
+ mov bh, [esi+1]
+ mov ah, [esi+2]
+ shr al, 3
+ and eax, 0F81Fh ; BYTE?
+ shr ebx, 5
+ and ebx, 07E0h ; BYTE?
+ add eax, ebx
+ mov [edi], al
+ mov [edi+1], ah
+ add esi, BYTE 4
+ add edi, BYTE 2
+ dec ecx
+ jnz .L3
+
+.L4:
+ retn
+
+
+_ConvertMMXpII32_16BGR565:
+
+ load_immq mm5, mmx32_rgb565_r
+ load_immq mm6, mmx32_rgb565_g
+ load_immq mm7, mmx32_rgb565_b
+ CLEANUP_IMMQ_LOADS(3)
+
+ mov edx, ecx
+ shr ecx, 2
+ jnz .L1
+ jmp .L2
+
+.L1:
+ movq mm0, [esi] ; a r g b
+ movq mm1, mm0 ; a r g b
+ pand mm0, mm6 ; 0 0 g 0
+ movq mm3, mm1 ; a r g b
+ pand mm1, mm5 ; 0 r 0 0
+ pand mm3, mm7 ; 0 0 0 b
+
+ psllq mm3, 16 ; 0 b 0 0
+ psrld mm1, 14 ; 0 0 000000rr rrr00000
+ por mm0, mm1 ; 0 0 ggggggrr rrr00000
+ psrld mm0, 5 ; 0 0 00000ggg gggrrrrr
+
+ movq mm4, [esi+8] ; a r g b
+ movq mm2, mm4 ; a r g b
+ pand mm4, mm6 ; 0 0 g 0
+ movq mm1, mm2 ; a r g b
+ pand mm2, mm5 ; 0 r 0 0
+ pand mm1, mm7 ; 0 0 0 b
+
+ psllq mm1, 16 ; 0 b 0 0
+ psrld mm2, 14 ; 0 0 000000rr rrr00000
+ por mm4, mm2 ; 0 0 ggggggrr rrr00000
+ psrld mm4, 5 ; 0 0 00000ggg gggrrrrr
+
+ packuswb mm3, mm1 ; BBBBB000 00000000 bbbbb000 00000000
+ packssdw mm0, mm4 ; 00000GGG GGGRRRRR 00000GGG GGGRRRRR
+ por mm0, mm3 ; BBBBBGGG GGGRRRRR bbbbbggg gggrrrrr
+ movq [edi], mm0
+
+ add esi, BYTE 16
+ add edi, BYTE 8
+ dec ecx
+ jnz .L1
+
+.L2:
+ and edx, BYTE 3
+ jz .L4
+.L3:
+ mov al, [esi+2]
+ mov bh, [esi+1]
+ mov ah, [esi]
+ shr al, 3
+ and eax, 0F81Fh ; BYTE ?
+ shr ebx, 5
+ and ebx, 07E0h ; BYTE ?
+ add eax, ebx
+ mov [edi], al
+ mov [edi+1], ah
+ add esi, BYTE 4
+ add edi, BYTE 2
+ dec edx
+ jnz .L3
+
+.L4:
+ retn
+
+_ConvertMMXpII32_16BGR555:
+
+ ; the 16BGR555 converter is identical to the RGB555 one,
+ ; except it uses a different multiplier for the pmaddwd
+ ; instruction. cool huh.
+
+ load_immq mm7, mmx32_bgr555_mul
+ jmp _convert_bgr555_cheat
+
+; This is the same as the Intel version.. they obviously went to
+; much more trouble to expand/coil the loop than I did, so theirs
+; would almost certainly be faster, even if only a little.
+; I did rename 'mmx32_rgb555_add' to 'mmx32_rgb555_mul', which is
+; (I think) a more accurate name..
+_ConvertMMXpII32_16RGB555:
+
+ load_immq mm7, mmx32_rgb555_mul
+_convert_bgr555_cheat:
+ load_immq mm6, mmx32_rgb555_g
+ CLEANUP_IMMQ_LOADS(2)
+
+ mov edx,ecx ; Save ecx
+
+ and ecx,DWORD 0fffffff8h ; clear lower three bits
+ jnz .L_OK
+ jmp near .L2
+
+.L_OK:
+
+ movq mm2,[esi+8]
+
+ movq mm0,[esi]
+ movq mm3,mm2
+
+ pand_immq mm3, mmx32_rgb555_rb
+ movq mm1,mm0
+
+ pand_immq mm1, mmx32_rgb555_rb
+ pmaddwd mm3,mm7
+
+ CLEANUP_IMMQ_LOADS(2)
+
+ pmaddwd mm1,mm7
+ pand mm2,mm6
+
+.L1:
+ movq mm4,[esi+24]
+ pand mm0,mm6
+
+ movq mm5,[esi+16]
+ por mm3,mm2
+
+ psrld mm3,6
+ por mm1,mm0
+
+ movq mm0,mm4
+ psrld mm1,6
+
+ pand_immq mm0, mmx32_rgb555_rb
+ packssdw mm1,mm3
+
+ movq mm3,mm5
+ pmaddwd mm0,mm7
+
+ pand_immq mm3, mmx32_rgb555_rb
+ pand mm4,mm6
+
+ movq [edi],mm1
+ pmaddwd mm3,mm7
+
+ add esi,BYTE 32
+ por mm4,mm0
+
+ pand mm5,mm6
+ psrld mm4,6
+
+ movq mm2,[esi+8]
+ por mm5,mm3
+
+ movq mm0,[esi]
+ psrld mm5,6
+
+ movq mm3,mm2
+ movq mm1,mm0
+
+ pand_immq mm3, mmx32_rgb555_rb
+ packssdw mm5,mm4
+
+ pand_immq mm1, mmx32_rgb555_rb
+ pand mm2,mm6
+
+ CLEANUP_IMMQ_LOADS(4)
+
+ movq [edi+8],mm5
+ pmaddwd mm3,mm7
+
+ pmaddwd mm1,mm7
+ add edi,BYTE 16
+
+ sub ecx,BYTE 8
+ jz .L2
+ jmp .L1
+
+
+.L2:
+ mov ecx,edx
+
+ and ecx,BYTE 7
+ jz .L4
+
+.L3:
+ mov ebx,[esi]
+ add esi,BYTE 4
+
+ mov eax,ebx
+ mov edx,ebx
+
+ shr eax,3
+ shr edx,6
+
+ and eax,BYTE 0000000000011111b
+ and edx, 0000001111100000b
+
+ shr ebx,9
+
+ or eax,edx
+
+ and ebx, 0111110000000000b
+
+ or eax,ebx
+
+ mov [edi],ax
+ add edi,BYTE 2
+
+ dec ecx
+ jnz .L3
+
+.L4:
+ retn
+
+%ifidn __OUTPUT_FORMAT__,elf32
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif
diff --git a/distrib/sdl-1.2.15/src/hermes/x86_main.asm b/distrib/sdl-1.2.15/src/hermes/x86_main.asm
new file mode 100644
index 0000000..f7dd3db
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/hermes/x86_main.asm
@@ -0,0 +1,75 @@
+;
+; x86 format converters for HERMES
+; Some routines Copyright (c) 1998 Christian Nentwich (brn@eleet.mcb.at)
+; This source code is licensed under the GNU LGPL
+;
+; Please refer to the file COPYING.LIB contained in the distribution for
+; licensing conditions
+;
+; Most routines are (c) Glenn Fiedler (ptc@gaffer.org), used with permission
+;
+
+BITS 32
+
+%include "common.inc"
+
+SDL_FUNC _ConvertX86
+
+SECTION .text
+
+;; _ConvertX86:
+;; [ESP+8] ConverterInfo*
+;; --------------------------------------------------------------------------
+;; ConverterInfo (ebp+..)
+;; 0: void *s_pixels
+;; 4: int s_width
+;; 8: int s_height
+;; 12: int s_add
+;; 16: void *d_pixels
+;; 20: int d_width
+;; 24: int d_height
+;; 28: int d_add
+;; 32: void (*converter_function)()
+;; 36: int32 *lookup
+
+_ConvertX86:
+ push ebp
+ mov ebp,esp
+
+; Save the registers used by the blitters, necessary for optimized code
+ pusha
+
+ mov eax,[ebp+8]
+
+ cmp dword [eax+4],BYTE 0
+ je endconvert
+
+ mov ebp,eax
+
+ mov esi,[ebp+0]
+ mov edi,[ebp+16]
+
+y_loop:
+ mov ecx,[ebp+4]
+
+ call [ebp+32]
+
+ add esi,[ebp+12]
+ add edi,[ebp+28]
+
+ dec dword [ebp+8]
+ jnz y_loop
+
+; Restore the registers used by the blitters, necessary for optimized code
+ popa
+
+ pop ebp
+
+endconvert:
+ ret
+
+
+
+%ifidn __OUTPUT_FORMAT__,elf32
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif
diff --git a/distrib/sdl-1.2.15/src/hermes/x86p_16.asm b/distrib/sdl-1.2.15/src/hermes/x86p_16.asm
new file mode 100644
index 0000000..1801bcd
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/hermes/x86p_16.asm
@@ -0,0 +1,490 @@
+;
+; x86 format converters for HERMES
+; Copyright (c) 1998 Glenn Fielder (gaffer@gaffer.org)
+; This source code is licensed under the GNU LGPL
+;
+; Please refer to the file COPYING.LIB contained in the distribution for
+; licensing conditions
+;
+; Routines adjusted for Hermes by Christian Nentwich (brn@eleet.mcb.at)
+; Used with permission.
+;
+
+BITS 32
+
+%include "common.inc"
+
+SDL_FUNC _ConvertX86p16_16BGR565
+SDL_FUNC _ConvertX86p16_16RGB555
+SDL_FUNC _ConvertX86p16_16BGR555
+SDL_FUNC _ConvertX86p16_8RGB332
+
+EXTERN _ConvertX86
+
+SECTION .text
+
+_ConvertX86p16_16BGR565:
+
+ ; check short
+ cmp ecx,BYTE 16
+ ja .L3
+
+
+.L1: ; short loop
+ mov al,[esi]
+ mov ah,[esi+1]
+ mov ebx,eax
+ mov edx,eax
+ shr eax,11
+ and eax,BYTE 11111b
+ and ebx,11111100000b
+ shl edx,11
+ add eax,ebx
+ add eax,edx
+ mov [edi],al
+ mov [edi+1],ah
+ add esi,BYTE 2
+ add edi,BYTE 2
+ dec ecx
+ jnz .L1
+.L2:
+ retn
+
+.L3: ; head
+ mov eax,edi
+ and eax,BYTE 11b
+ jz .L4
+ mov al,[esi]
+ mov ah,[esi+1]
+ mov ebx,eax
+ mov edx,eax
+ shr eax,11
+ and eax,BYTE 11111b
+ and ebx,11111100000b
+ shl edx,11
+ add eax,ebx
+ add eax,edx
+ mov [edi],al
+ mov [edi+1],ah
+ add esi,BYTE 2
+ add edi,BYTE 2
+ dec ecx
+
+.L4: ; save count
+ push ecx
+
+ ; unroll twice
+ shr ecx,1
+
+ ; point arrays to end
+ lea esi,[esi+ecx*4]
+ lea edi,[edi+ecx*4]
+
+ ; negative counter
+ neg ecx
+ jmp SHORT .L6
+
+.L5: mov [edi+ecx*4-4],eax
+.L6: mov eax,[esi+ecx*4]
+
+ mov ebx,[esi+ecx*4]
+ and eax,07E007E0h
+
+ mov edx,[esi+ecx*4]
+ and ebx,0F800F800h
+
+ shr ebx,11
+ and edx,001F001Fh
+
+ shl edx,11
+ add eax,ebx
+
+ add eax,edx
+ inc ecx
+
+ jnz .L5
+
+ mov [edi+ecx*4-4],eax
+
+ ; tail
+ pop ecx
+ and ecx,BYTE 1
+ jz .L7
+ mov al,[esi]
+ mov ah,[esi+1]
+ mov ebx,eax
+ mov edx,eax
+ shr eax,11
+ and eax,BYTE 11111b
+ and ebx,11111100000b
+ shl edx,11
+ add eax,ebx
+ add eax,edx
+ mov [edi],al
+ mov [edi+1],ah
+ add esi,BYTE 2
+ add edi,BYTE 2
+
+.L7:
+ retn
+
+
+
+
+
+
+_ConvertX86p16_16RGB555:
+
+ ; check short
+ cmp ecx,BYTE 32
+ ja .L3
+
+
+.L1: ; short loop
+ mov al,[esi]
+ mov ah,[esi+1]
+ mov ebx,eax
+ shr ebx,1
+ and ebx, 0111111111100000b
+ and eax,BYTE 0000000000011111b
+ add eax,ebx
+ mov [edi],al
+ mov [edi+1],ah
+ add esi,BYTE 2
+ add edi,BYTE 2
+ dec ecx
+ jnz .L1
+.L2:
+ retn
+
+.L3: ; head
+ mov eax,edi
+ and eax,BYTE 11b
+ jz .L4
+ mov al,[esi]
+ mov ah,[esi+1]
+ mov ebx,eax
+ shr ebx,1
+ and ebx, 0111111111100000b
+ and eax,BYTE 0000000000011111b
+ add eax,ebx
+ mov [edi],al
+ mov [edi+1],ah
+ add esi,BYTE 2
+ add edi,BYTE 2
+ dec ecx
+
+.L4: ; save ebp
+ push ebp
+
+ ; save count
+ push ecx
+
+ ; unroll four times
+ shr ecx,2
+
+ ; point arrays to end
+ lea esi,[esi+ecx*8]
+ lea edi,[edi+ecx*8]
+
+ ; negative counter
+ xor ebp,ebp
+ sub ebp,ecx
+
+.L5: mov eax,[esi+ebp*8] ; agi?
+ mov ecx,[esi+ebp*8+4]
+
+ mov ebx,eax
+ mov edx,ecx
+
+ and eax,0FFC0FFC0h
+ and ecx,0FFC0FFC0h
+
+ shr eax,1
+ and ebx,001F001Fh
+
+ shr ecx,1
+ and edx,001F001Fh
+
+ add eax,ebx
+ add ecx,edx
+
+ mov [edi+ebp*8],eax
+ mov [edi+ebp*8+4],ecx
+
+ inc ebp
+ jnz .L5
+
+ ; tail
+ pop ecx
+.L6: and ecx,BYTE 11b
+ jz .L7
+ mov al,[esi]
+ mov ah,[esi+1]
+ mov ebx,eax
+ shr ebx,1
+ and ebx, 0111111111100000b
+ and eax,BYTE 0000000000011111b
+ add eax,ebx
+ mov [edi],al
+ mov [edi+1],ah
+ add esi,BYTE 2
+ add edi,BYTE 2
+ dec ecx
+ jmp SHORT .L6
+
+.L7: pop ebp
+ retn
+
+
+
+
+
+
+_ConvertX86p16_16BGR555:
+
+ ; check short
+ cmp ecx,BYTE 16
+ ja .L3
+
+
+.L1: ; short loop
+ mov al,[esi]
+ mov ah,[esi+1]
+ mov ebx,eax
+ mov edx,eax
+ shr eax,11
+ and eax,BYTE 11111b
+ shr ebx,1
+ and ebx,1111100000b
+ shl edx,10
+ and edx,0111110000000000b
+ add eax,ebx
+ add eax,edx
+ mov [edi],al
+ mov [edi+1],ah
+ add esi,BYTE 2
+ add edi,BYTE 2
+ dec ecx
+ jnz .L1
+.L2:
+ retn
+
+.L3: ; head
+ mov eax,edi
+ and eax,BYTE 11b
+ jz .L4
+ mov al,[esi]
+ mov ah,[esi+1]
+ mov ebx,eax
+ mov edx,eax
+ shr eax,11
+ and eax,BYTE 11111b
+ shr ebx,1
+ and ebx,1111100000b
+ shl edx,10
+ and edx,0111110000000000b
+ add eax,ebx
+ add eax,edx
+ mov [edi],al
+ mov [edi+1],ah
+ add esi,BYTE 2
+ add edi,BYTE 2
+ dec ecx
+
+.L4: ; save count
+ push ecx
+
+ ; unroll twice
+ shr ecx,1
+
+ ; point arrays to end
+ lea esi,[esi+ecx*4]
+ lea edi,[edi+ecx*4]
+
+ ; negative counter
+ neg ecx
+ jmp SHORT .L6
+
+.L5: mov [edi+ecx*4-4],eax
+.L6: mov eax,[esi+ecx*4]
+
+ shr eax,1
+ mov ebx,[esi+ecx*4]
+
+ and eax,03E003E0h
+ mov edx,[esi+ecx*4]
+
+ and ebx,0F800F800h
+
+ shr ebx,11
+ and edx,001F001Fh
+
+ shl edx,10
+ add eax,ebx
+
+ add eax,edx
+ inc ecx
+
+ jnz .L5
+
+ mov [edi+ecx*4-4],eax
+
+ ; tail
+ pop ecx
+ and ecx,BYTE 1
+ jz .L7
+ mov al,[esi]
+ mov ah,[esi+1]
+ mov ebx,eax
+ mov edx,eax
+ shr eax,11
+ and eax,BYTE 11111b
+ shr ebx,1
+ and ebx,1111100000b
+ shl edx,10
+ and edx,0111110000000000b
+ add eax,ebx
+ add eax,edx
+ mov [edi],al
+ mov [edi+1],ah
+ add esi,BYTE 2
+ add edi,BYTE 2
+
+.L7:
+ retn
+
+
+
+
+
+
+_ConvertX86p16_8RGB332:
+
+ ; check short
+ cmp ecx,BYTE 16
+ ja .L3
+
+
+.L1: ; short loop
+ mov al,[esi+0]
+ mov ah,[esi+1]
+ mov ebx,eax
+ mov edx,eax
+ and eax,BYTE 11000b ; blue
+ shr eax,3
+ and ebx,11100000000b ; green
+ shr ebx,6
+ and edx,1110000000000000b ; red
+ shr edx,8
+ add eax,ebx
+ add eax,edx
+ mov [edi],al
+ add esi,BYTE 2
+ inc edi
+ dec ecx
+ jnz .L1
+.L2:
+ retn
+
+.L3: mov eax,edi
+ and eax,BYTE 11b
+ jz .L4
+ mov al,[esi+0]
+ mov ah,[esi+1]
+ mov ebx,eax
+ mov edx,eax
+ and eax,BYTE 11000b ; blue
+ shr eax,3
+ and ebx,11100000000b ; green
+ shr ebx,6
+ and edx,1110000000000000b ; red
+ shr edx,8
+ add eax,ebx
+ add eax,edx
+ mov [edi],al
+ add esi,BYTE 2
+ inc edi
+ dec ecx
+ jmp SHORT .L3
+
+.L4: ; save ebp
+ push ebp
+
+ ; save count
+ push ecx
+
+ ; unroll 4 times
+ shr ecx,2
+
+ ; prestep
+ mov dl,[esi+0]
+ mov bl,[esi+1]
+ mov dh,[esi+2]
+
+.L5: shl edx,16
+ mov bh,[esi+3]
+
+ shl ebx,16
+ mov dl,[esi+4]
+
+ mov dh,[esi+6]
+ mov bl,[esi+5]
+
+ and edx,00011000000110000001100000011000b
+ mov bh,[esi+7]
+
+ ror edx,16+3
+ mov eax,ebx ; setup eax for reds
+
+ and ebx,00000111000001110000011100000111b
+ and eax,11100000111000001110000011100000b ; reds
+
+ ror ebx,16-2
+ add esi,BYTE 8
+
+ ror eax,16
+ add edi,BYTE 4
+
+ add eax,ebx
+ mov bl,[esi+1] ; greens
+
+ add eax,edx
+ mov dl,[esi+0] ; blues
+
+ mov [edi-4],eax
+ mov dh,[esi+2]
+
+ dec ecx
+ jnz .L5
+
+ ; check tail
+ pop ecx
+ and ecx,BYTE 11b
+ jz .L7
+
+.L6: ; tail
+ mov al,[esi+0]
+ mov ah,[esi+1]
+ mov ebx,eax
+ mov edx,eax
+ and eax,BYTE 11000b ; blue
+ shr eax,3
+ and ebx,11100000000b ; green
+ shr ebx,6
+ and edx,1110000000000000b ; red
+ shr edx,8
+ add eax,ebx
+ add eax,edx
+ mov [edi],al
+ add esi,BYTE 2
+ inc edi
+ dec ecx
+ jnz .L6
+
+.L7: pop ebp
+ retn
+
+%ifidn __OUTPUT_FORMAT__,elf32
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif
diff --git a/distrib/sdl-1.2.15/src/hermes/x86p_32.asm b/distrib/sdl-1.2.15/src/hermes/x86p_32.asm
new file mode 100644
index 0000000..2b47880
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/hermes/x86p_32.asm
@@ -0,0 +1,1044 @@
+;
+; x86 format converters for HERMES
+; Some routines Copyright (c) 1998 Christian Nentwich (brn@eleet.mcb.at)
+; This source code is licensed under the GNU LGPL
+;
+; Please refer to the file COPYING.LIB contained in the distribution for
+; licensing conditions
+;
+; Most routines are (c) Glenn Fiedler (ptc@gaffer.org), used with permission
+;
+
+BITS 32
+
+%include "common.inc"
+
+SDL_FUNC _ConvertX86p32_32BGR888
+SDL_FUNC _ConvertX86p32_32RGBA888
+SDL_FUNC _ConvertX86p32_32BGRA888
+SDL_FUNC _ConvertX86p32_24RGB888
+SDL_FUNC _ConvertX86p32_24BGR888
+SDL_FUNC _ConvertX86p32_16RGB565
+SDL_FUNC _ConvertX86p32_16BGR565
+SDL_FUNC _ConvertX86p32_16RGB555
+SDL_FUNC _ConvertX86p32_16BGR555
+SDL_FUNC _ConvertX86p32_8RGB332
+
+SECTION .text
+
+;; _Convert_*
+;; Paramters:
+;; ESI = source
+;; EDI = dest
+;; ECX = amount (NOT 0!!! (the _ConvertX86 routine checks for that though))
+;; Destroys:
+;; EAX, EBX, EDX
+
+
+_ConvertX86p32_32BGR888:
+
+ ; check short
+ cmp ecx,BYTE 32
+ ja .L3
+
+.L1: ; short loop
+ mov edx,[esi]
+ bswap edx
+ ror edx,8
+ mov [edi],edx
+ add esi,BYTE 4
+ add edi,BYTE 4
+ dec ecx
+ jnz .L1
+.L2:
+ retn
+
+.L3: ; save ebp
+ push ebp
+
+ ; unroll four times
+ mov ebp,ecx
+ shr ebp,2
+
+ ; save count
+ push ecx
+
+.L4: mov eax,[esi]
+ mov ebx,[esi+4]
+
+ bswap eax
+
+ bswap ebx
+
+ ror eax,8
+ mov ecx,[esi+8]
+
+ ror ebx,8
+ mov edx,[esi+12]
+
+ bswap ecx
+
+ bswap edx
+
+ ror ecx,8
+ mov [edi+0],eax
+
+ ror edx,8
+ mov [edi+4],ebx
+
+ mov [edi+8],ecx
+ mov [edi+12],edx
+
+ add esi,BYTE 16
+ add edi,BYTE 16
+
+ dec ebp
+ jnz .L4
+
+ ; check tail
+ pop ecx
+ and ecx,BYTE 11b
+ jz .L6
+
+.L5: ; tail loop
+ mov edx,[esi]
+ bswap edx
+ ror edx,8
+ mov [edi],edx
+ add esi,BYTE 4
+ add edi,BYTE 4
+ dec ecx
+ jnz .L5
+
+.L6: pop ebp
+ retn
+
+
+
+
+_ConvertX86p32_32RGBA888:
+
+ ; check short
+ cmp ecx,BYTE 32
+ ja .L3
+
+.L1: ; short loop
+ mov edx,[esi]
+ rol edx,8
+ mov [edi],edx
+ add esi,BYTE 4
+ add edi,BYTE 4
+ dec ecx
+ jnz .L1
+.L2:
+ retn
+
+.L3: ; save ebp
+ push ebp
+
+ ; unroll four times
+ mov ebp,ecx
+ shr ebp,2
+
+ ; save count
+ push ecx
+
+.L4: mov eax,[esi]
+ mov ebx,[esi+4]
+
+ rol eax,8
+ mov ecx,[esi+8]
+
+ rol ebx,8
+ mov edx,[esi+12]
+
+ rol ecx,8
+ mov [edi+0],eax
+
+ rol edx,8
+ mov [edi+4],ebx
+
+ mov [edi+8],ecx
+ mov [edi+12],edx
+
+ add esi,BYTE 16
+ add edi,BYTE 16
+
+ dec ebp
+ jnz .L4
+
+ ; check tail
+ pop ecx
+ and ecx,BYTE 11b
+ jz .L6
+
+.L5: ; tail loop
+ mov edx,[esi]
+ rol edx,8
+ mov [edi],edx
+ add esi,BYTE 4
+ add edi,BYTE 4
+ dec ecx
+ jnz .L5
+
+.L6: pop ebp
+ retn
+
+
+
+
+_ConvertX86p32_32BGRA888:
+
+ ; check short
+ cmp ecx,BYTE 32
+ ja .L3
+
+.L1: ; short loop
+ mov edx,[esi]
+ bswap edx
+ mov [edi],edx
+ add esi,BYTE 4
+ add edi,BYTE 4
+ dec ecx
+ jnz .L1
+.L2:
+ retn
+
+.L3: ; save ebp
+ push ebp
+
+ ; unroll four times
+ mov ebp,ecx
+ shr ebp,2
+
+ ; save count
+ push ecx
+
+.L4: mov eax,[esi]
+ mov ebx,[esi+4]
+
+ mov ecx,[esi+8]
+ mov edx,[esi+12]
+
+ bswap eax
+
+ bswap ebx
+
+ bswap ecx
+
+ bswap edx
+
+ mov [edi+0],eax
+ mov [edi+4],ebx
+
+ mov [edi+8],ecx
+ mov [edi+12],edx
+
+ add esi,BYTE 16
+ add edi,BYTE 16
+
+ dec ebp
+ jnz .L4
+
+ ; check tail
+ pop ecx
+ and ecx,BYTE 11b
+ jz .L6
+
+.L5: ; tail loop
+ mov edx,[esi]
+ bswap edx
+ mov [edi],edx
+ add esi,BYTE 4
+ add edi,BYTE 4
+ dec ecx
+ jnz .L5
+
+.L6: pop ebp
+ retn
+
+
+
+
+;; 32 bit RGB 888 to 24 BIT RGB 888
+
+_ConvertX86p32_24RGB888:
+
+ ; check short
+ cmp ecx,BYTE 32
+ ja .L3
+
+.L1: ; short loop
+ mov al,[esi]
+ mov bl,[esi+1]
+ mov dl,[esi+2]
+ mov [edi],al
+ mov [edi+1],bl
+ mov [edi+2],dl
+ add esi,BYTE 4
+ add edi,BYTE 3
+ dec ecx
+ jnz .L1
+.L2:
+ retn
+
+.L3: ; head
+ mov edx,edi
+ and edx,BYTE 11b
+ jz .L4
+ mov al,[esi]
+ mov bl,[esi+1]
+ mov dl,[esi+2]
+ mov [edi],al
+ mov [edi+1],bl
+ mov [edi+2],dl
+ add esi,BYTE 4
+ add edi,BYTE 3
+ dec ecx
+ jmp SHORT .L3
+
+.L4: ; unroll 4 times
+ push ebp
+ mov ebp,ecx
+ shr ebp,2
+
+ ; save count
+ push ecx
+
+.L5: mov eax,[esi] ; first dword eax = [A][R][G][B]
+ mov ebx,[esi+4] ; second dword ebx = [a][r][g][b]
+
+ shl eax,8 ; eax = [R][G][B][.]
+ mov ecx,[esi+12] ; third dword ecx = [a][r][g][b]
+
+ shl ebx,8 ; ebx = [r][g][b][.]
+ mov al,[esi+4] ; eax = [R][G][B][b]
+
+ ror eax,8 ; eax = [b][R][G][B] (done)
+ mov bh,[esi+8+1] ; ebx = [r][g][G][.]
+
+ mov [edi],eax
+ add edi,BYTE 3*4
+
+ shl ecx,8 ; ecx = [r][g][b][.]
+ mov bl,[esi+8+0] ; ebx = [r][g][G][B]
+
+ rol ebx,16 ; ebx = [G][B][r][g] (done)
+ mov cl,[esi+8+2] ; ecx = [r][g][b][R] (done)
+
+ mov [edi+4-3*4],ebx
+ add esi,BYTE 4*4
+
+ mov [edi+8-3*4],ecx
+ dec ebp
+
+ jnz .L5
+
+ ; check tail
+ pop ecx
+ and ecx,BYTE 11b
+ jz .L7
+
+.L6: ; tail loop
+ mov al,[esi]
+ mov bl,[esi+1]
+ mov dl,[esi+2]
+ mov [edi],al
+ mov [edi+1],bl
+ mov [edi+2],dl
+ add esi,BYTE 4
+ add edi,BYTE 3
+ dec ecx
+ jnz .L6
+
+.L7: pop ebp
+ retn
+
+
+
+
+;; 32 bit RGB 888 to 24 bit BGR 888
+
+_ConvertX86p32_24BGR888:
+
+ ; check short
+ cmp ecx,BYTE 32
+ ja .L3
+
+.L1: ; short loop
+ mov dl,[esi]
+ mov bl,[esi+1]
+ mov al,[esi+2]
+ mov [edi],al
+ mov [edi+1],bl
+ mov [edi+2],dl
+ add esi,BYTE 4
+ add edi,BYTE 3
+ dec ecx
+ jnz .L1
+.L2:
+ retn
+
+.L3: ; head
+ mov edx,edi
+ and edx,BYTE 11b
+ jz .L4
+ mov dl,[esi]
+ mov bl,[esi+1]
+ mov al,[esi+2]
+ mov [edi],al
+ mov [edi+1],bl
+ mov [edi+2],dl
+ add esi,BYTE 4
+ add edi,BYTE 3
+ dec ecx
+ jmp SHORT .L3
+
+.L4: ; unroll 4 times
+ push ebp
+ mov ebp,ecx
+ shr ebp,2
+
+ ; save count
+ push ecx
+
+.L5:
+ mov eax,[esi] ; first dword eax = [A][R][G][B]
+ mov ebx,[esi+4] ; second dword ebx = [a][r][g][b]
+
+ bswap eax ; eax = [B][G][R][A]
+
+ bswap ebx ; ebx = [b][g][r][a]
+
+ mov al,[esi+4+2] ; eax = [B][G][R][r]
+ mov bh,[esi+4+4+1] ; ebx = [b][g][G][a]
+
+ ror eax,8 ; eax = [r][B][G][R] (done)
+ mov bl,[esi+4+4+2] ; ebx = [b][g][G][R]
+
+ ror ebx,16 ; ebx = [G][R][b][g] (done)
+ mov [edi],eax
+
+ mov [edi+4],ebx
+ mov ecx,[esi+12] ; third dword ecx = [a][r][g][b]
+
+ bswap ecx ; ecx = [b][g][r][a]
+
+ mov cl,[esi+8] ; ecx = [b][g][r][B] (done)
+ add esi,BYTE 4*4
+
+ mov [edi+8],ecx
+ add edi,BYTE 3*4
+
+ dec ebp
+ jnz .L5
+
+ ; check tail
+ pop ecx
+ and ecx,BYTE 11b
+ jz .L7
+
+.L6: ; tail loop
+ mov dl,[esi]
+ mov bl,[esi+1]
+ mov al,[esi+2]
+ mov [edi],al
+ mov [edi+1],bl
+ mov [edi+2],dl
+ add esi,BYTE 4
+ add edi,BYTE 3
+ dec ecx
+ jnz .L6
+
+.L7:
+ pop ebp
+ retn
+
+
+
+
+;; 32 bit RGB 888 to 16 BIT RGB 565
+
+_ConvertX86p32_16RGB565:
+ ; check short
+ cmp ecx,BYTE 16
+ ja .L3
+
+.L1: ; short loop
+ mov bl,[esi+0] ; blue
+ mov al,[esi+1] ; green
+ mov ah,[esi+2] ; red
+ shr ah,3
+ and al,11111100b
+ shl eax,3
+ shr bl,3
+ add al,bl
+ mov [edi+0],al
+ mov [edi+1],ah
+ add esi,BYTE 4
+ add edi,BYTE 2
+ dec ecx
+ jnz .L1
+
+.L2: ; End of short loop
+ retn
+
+
+.L3: ; head
+ mov ebx,edi
+ and ebx,BYTE 11b
+ jz .L4
+
+ mov bl,[esi+0] ; blue
+ mov al,[esi+1] ; green
+ mov ah,[esi+2] ; red
+ shr ah,3
+ and al,11111100b
+ shl eax,3
+ shr bl,3
+ add al,bl
+ mov [edi+0],al
+ mov [edi+1],ah
+ add esi,BYTE 4
+ add edi,BYTE 2
+ dec ecx
+
+.L4:
+ ; save count
+ push ecx
+
+ ; unroll twice
+ shr ecx,1
+
+ ; point arrays to end
+ lea esi,[esi+ecx*8]
+ lea edi,[edi+ecx*4]
+
+ ; negative counter
+ neg ecx
+ jmp SHORT .L6
+
+.L5:
+ mov [edi+ecx*4-4],eax
+.L6:
+ mov eax,[esi+ecx*8]
+
+ shr ah,2
+ mov ebx,[esi+ecx*8+4]
+
+ shr eax,3
+ mov edx,[esi+ecx*8+4]
+
+ shr bh,2
+ mov dl,[esi+ecx*8+2]
+
+ shl ebx,13
+ and eax,000007FFh
+
+ shl edx,8
+ and ebx,07FF0000h
+
+ and edx,0F800F800h
+ add eax,ebx
+
+ add eax,edx
+ inc ecx
+
+ jnz .L5
+
+ mov [edi+ecx*4-4],eax
+
+ ; tail
+ pop ecx
+ test cl,1
+ jz .L7
+
+ mov bl,[esi+0] ; blue
+ mov al,[esi+1] ; green
+ mov ah,[esi+2] ; red
+ shr ah,3
+ and al,11111100b
+ shl eax,3
+ shr bl,3
+ add al,bl
+ mov [edi+0],al
+ mov [edi+1],ah
+ add esi,BYTE 4
+ add edi,BYTE 2
+
+.L7:
+ retn
+
+
+
+
+;; 32 bit RGB 888 to 16 BIT BGR 565
+
+_ConvertX86p32_16BGR565:
+
+ ; check short
+ cmp ecx,BYTE 16
+ ja .L3
+
+.L1: ; short loop
+ mov ah,[esi+0] ; blue
+ mov al,[esi+1] ; green
+ mov bl,[esi+2] ; red
+ shr ah,3
+ and al,11111100b
+ shl eax,3
+ shr bl,3
+ add al,bl
+ mov [edi+0],al
+ mov [edi+1],ah
+ add esi,BYTE 4
+ add edi,BYTE 2
+ dec ecx
+ jnz .L1
+.L2:
+ retn
+
+.L3: ; head
+ mov ebx,edi
+ and ebx,BYTE 11b
+ jz .L4
+ mov ah,[esi+0] ; blue
+ mov al,[esi+1] ; green
+ mov bl,[esi+2] ; red
+ shr ah,3
+ and al,11111100b
+ shl eax,3
+ shr bl,3
+ add al,bl
+ mov [edi+0],al
+ mov [edi+1],ah
+ add esi,BYTE 4
+ add edi,BYTE 2
+ dec ecx
+
+.L4: ; save count
+ push ecx
+
+ ; unroll twice
+ shr ecx,1
+
+ ; point arrays to end
+ lea esi,[esi+ecx*8]
+ lea edi,[edi+ecx*4]
+
+ ; negative count
+ neg ecx
+ jmp SHORT .L6
+
+.L5:
+ mov [edi+ecx*4-4],eax
+.L6:
+ mov edx,[esi+ecx*8+4]
+
+ mov bh,[esi+ecx*8+4]
+ mov ah,[esi+ecx*8]
+
+ shr bh,3
+ mov al,[esi+ecx*8+1]
+
+ shr ah,3
+ mov bl,[esi+ecx*8+5]
+
+ shl eax,3
+ mov dl,[esi+ecx*8+2]
+
+ shl ebx,19
+ and eax,0000FFE0h
+
+ shr edx,3
+ and ebx,0FFE00000h
+
+ and edx,001F001Fh
+ add eax,ebx
+
+ add eax,edx
+ inc ecx
+
+ jnz .L5
+
+ mov [edi+ecx*4-4],eax
+
+ ; tail
+ pop ecx
+ and ecx,BYTE 1
+ jz .L7
+ mov ah,[esi+0] ; blue
+ mov al,[esi+1] ; green
+ mov bl,[esi+2] ; red
+ shr ah,3
+ and al,11111100b
+ shl eax,3
+ shr bl,3
+ add al,bl
+ mov [edi+0],al
+ mov [edi+1],ah
+ add esi,BYTE 4
+ add edi,BYTE 2
+
+.L7:
+ retn
+
+
+
+
+;; 32 BIT RGB TO 16 BIT RGB 555
+
+_ConvertX86p32_16RGB555:
+
+ ; check short
+ cmp ecx,BYTE 16
+ ja .L3
+
+.L1: ; short loop
+ mov bl,[esi+0] ; blue
+ mov al,[esi+1] ; green
+ mov ah,[esi+2] ; red
+ shr ah,3
+ and al,11111000b
+ shl eax,2
+ shr bl,3
+ add al,bl
+ mov [edi+0],al
+ mov [edi+1],ah
+ add esi,BYTE 4
+ add edi,BYTE 2
+ dec ecx
+ jnz .L1
+.L2:
+ retn
+
+.L3: ; head
+ mov ebx,edi
+ and ebx,BYTE 11b
+ jz .L4
+ mov bl,[esi+0] ; blue
+ mov al,[esi+1] ; green
+ mov ah,[esi+2] ; red
+ shr ah,3
+ and al,11111000b
+ shl eax,2
+ shr bl,3
+ add al,bl
+ mov [edi+0],al
+ mov [edi+1],ah
+ add esi,BYTE 4
+ add edi,BYTE 2
+ dec ecx
+
+.L4: ; save count
+ push ecx
+
+ ; unroll twice
+ shr ecx,1
+
+ ; point arrays to end
+ lea esi,[esi+ecx*8]
+ lea edi,[edi+ecx*4]
+
+ ; negative counter
+ neg ecx
+ jmp SHORT .L6
+
+.L5:
+ mov [edi+ecx*4-4],eax
+.L6:
+ mov eax,[esi+ecx*8]
+
+ shr ah,3
+ mov ebx,[esi+ecx*8+4]
+
+ shr eax,3
+ mov edx,[esi+ecx*8+4]
+
+ shr bh,3
+ mov dl,[esi+ecx*8+2]
+
+ shl ebx,13
+ and eax,000007FFh
+
+ shl edx,7
+ and ebx,07FF0000h
+
+ and edx,07C007C00h
+ add eax,ebx
+
+ add eax,edx
+ inc ecx
+
+ jnz .L5
+
+ mov [edi+ecx*4-4],eax
+
+ ; tail
+ pop ecx
+ and ecx,BYTE 1
+ jz .L7
+ mov bl,[esi+0] ; blue
+ mov al,[esi+1] ; green
+ mov ah,[esi+2] ; red
+ shr ah,3
+ and al,11111000b
+ shl eax,2
+ shr bl,3
+ add al,bl
+ mov [edi+0],al
+ mov [edi+1],ah
+ add esi,BYTE 4
+ add edi,BYTE 2
+
+.L7:
+ retn
+
+
+
+
+;; 32 BIT RGB TO 16 BIT BGR 555
+
+_ConvertX86p32_16BGR555:
+
+ ; check short
+ cmp ecx,BYTE 16
+ ja .L3
+
+
+.L1: ; short loop
+ mov ah,[esi+0] ; blue
+ mov al,[esi+1] ; green
+ mov bl,[esi+2] ; red
+ shr ah,3
+ and al,11111000b
+ shl eax,2
+ shr bl,3
+ add al,bl
+ mov [edi+0],al
+ mov [edi+1],ah
+ add esi,BYTE 4
+ add edi,BYTE 2
+ dec ecx
+ jnz .L1
+.L2:
+ retn
+
+.L3: ; head
+ mov ebx,edi
+ and ebx,BYTE 11b
+ jz .L4
+ mov ah,[esi+0] ; blue
+ mov al,[esi+1] ; green
+ mov bl,[esi+2] ; red
+ shr ah,3
+ and al,11111000b
+ shl eax,2
+ shr bl,3
+ add al,bl
+ mov [edi+0],al
+ mov [edi+1],ah
+ add esi,BYTE 4
+ add edi,BYTE 2
+ dec ecx
+
+.L4: ; save count
+ push ecx
+
+ ; unroll twice
+ shr ecx,1
+
+ ; point arrays to end
+ lea esi,[esi+ecx*8]
+ lea edi,[edi+ecx*4]
+
+ ; negative counter
+ neg ecx
+ jmp SHORT .L6
+
+.L5:
+ mov [edi+ecx*4-4],eax
+.L6:
+ mov edx,[esi+ecx*8+4]
+
+ mov bh,[esi+ecx*8+4]
+ mov ah,[esi+ecx*8]
+
+ shr bh,3
+ mov al,[esi+ecx*8+1]
+
+ shr ah,3
+ mov bl,[esi+ecx*8+5]
+
+ shl eax,2
+ mov dl,[esi+ecx*8+2]
+
+ shl ebx,18
+ and eax,00007FE0h
+
+ shr edx,3
+ and ebx,07FE00000h
+
+ and edx,001F001Fh
+ add eax,ebx
+
+ add eax,edx
+ inc ecx
+
+ jnz .L5
+
+ mov [edi+ecx*4-4],eax
+
+ ; tail
+ pop ecx
+ and ecx,BYTE 1
+ jz .L7
+ mov ah,[esi+0] ; blue
+ mov al,[esi+1] ; green
+ mov bl,[esi+2] ; red
+ shr ah,3
+ and al,11111000b
+ shl eax,2
+ shr bl,3
+ add al,bl
+ mov [edi+0],al
+ mov [edi+1],ah
+ add esi,BYTE 4
+ add edi,BYTE 2
+
+.L7:
+ retn
+
+
+
+
+
+;; FROM 32 BIT RGB to 8 BIT RGB (rrrgggbbb)
+;; This routine writes FOUR pixels at once (dword) and then, if they exist
+;; the trailing three pixels
+_ConvertX86p32_8RGB332:
+
+
+.L_ALIGNED:
+ push ecx
+
+ shr ecx,2 ; We will draw 4 pixels at once
+ jnz .L1
+
+ jmp .L2 ; short jump out of range :(
+
+.L1:
+ mov eax,[esi] ; first pair of pixels
+ mov edx,[esi+4]
+
+ shr dl,6
+ mov ebx,eax
+
+ shr al,6
+ and ah,0e0h
+
+ shr ebx,16
+ and dh,0e0h
+
+ shr ah,3
+ and bl,0e0h
+
+ shr dh,3
+
+ or al,bl
+
+ mov ebx,edx
+ or al,ah
+
+ shr ebx,16
+ or dl,dh
+
+ and bl,0e0h
+
+ or dl,bl
+
+ mov ah,dl
+
+
+
+ mov ebx,[esi+8] ; second pair of pixels
+
+ mov edx,ebx
+ and bh,0e0h
+
+ shr bl,6
+ and edx,0e00000h
+
+ shr edx,16
+
+ shr bh,3
+
+ ror eax,16
+ or bl,dl
+
+ mov edx,[esi+12]
+ or bl,bh
+
+ mov al,bl
+
+ mov ebx,edx
+ and dh,0e0h
+
+ shr dl,6
+ and ebx,0e00000h
+
+ shr dh,3
+ mov ah,dl
+
+ shr ebx,16
+ or ah,dh
+
+ or ah,bl
+
+ rol eax,16
+ add esi,BYTE 16
+
+ mov [edi],eax
+ add edi,BYTE 4
+
+ dec ecx
+ jz .L2 ; L1 out of range for short jump :(
+
+ jmp .L1
+.L2:
+
+ pop ecx
+ and ecx,BYTE 3 ; mask out number of pixels to draw
+
+ jz .L4 ; Nothing to do anymore
+
+.L3:
+ mov eax,[esi] ; single pixel conversion for trailing pixels
+
+ mov ebx,eax
+
+ shr al,6
+ and ah,0e0h
+
+ shr ebx,16
+
+ shr ah,3
+ and bl,0e0h
+
+ or al,ah
+ or al,bl
+
+ mov [edi],al
+
+ inc edi
+ add esi,BYTE 4
+
+ dec ecx
+ jnz .L3
+
+.L4:
+ retn
+
+%ifidn __OUTPUT_FORMAT__,elf32
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif
diff --git a/distrib/sdl-1.2.15/src/joystick/SDL_joystick.c b/distrib/sdl-1.2.15/src/joystick/SDL_joystick.c
new file mode 100644
index 0000000..083b017
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/joystick/SDL_joystick.c
@@ -0,0 +1,606 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This is the joystick API for Simple DirectMedia Layer */
+
+#include "SDL_events.h"
+#include "SDL_sysjoystick.h"
+#include "SDL_joystick_c.h"
+#if !SDL_EVENTS_DISABLED
+#include "../events/SDL_events_c.h"
+#endif
+
+/* This is used for Quake III Arena */
+#if SDL_EVENTS_DISABLED
+#define SDL_Lock_EventThread()
+#define SDL_Unlock_EventThread()
+#endif
+
+Uint8 SDL_numjoysticks = 0;
+int SDL_allocatedjoysticks = 0;
+SDL_Joystick **SDL_joysticks = NULL;
+
+int SDL_JoystickInit(void)
+{
+ int arraylen;
+ int status;
+
+ SDL_numjoysticks = 0;
+ status = SDL_SYS_JoystickInit();
+ if ( status >= 0 ) {
+ SDL_allocatedjoysticks = status;
+ arraylen = (SDL_allocatedjoysticks+1)*sizeof(*SDL_joysticks);
+ SDL_joysticks = (SDL_Joystick **)SDL_malloc(arraylen);
+ if ( SDL_joysticks == NULL ) {
+ SDL_numjoysticks = 0;
+ SDL_allocatedjoysticks = 0;
+ } else {
+ SDL_memset(SDL_joysticks, 0, arraylen);
+ SDL_numjoysticks = status;
+ }
+ status = 0;
+ }
+ return(status);
+}
+
+/*
+ * Count the number of joysticks attached to the system
+ */
+int SDL_NumJoysticks(void)
+{
+ return SDL_numjoysticks;
+}
+
+/*
+ * Get the implementation dependent name of a joystick
+ */
+const char *SDL_JoystickName(int device_index)
+{
+ if ( (device_index < 0) || (device_index >= SDL_numjoysticks) ) {
+ SDL_SetError("There are %d joysticks available",
+ SDL_numjoysticks);
+ return(NULL);
+ }
+ return(SDL_SYS_JoystickName(device_index));
+}
+
+/*
+ * Open a joystick for use - the index passed as an argument refers to
+ * the N'th joystick on the system. This index is the value which will
+ * identify this joystick in future joystick events.
+ *
+ * This function returns a joystick identifier, or NULL if an error occurred.
+ */
+SDL_Joystick *SDL_JoystickOpen(int device_index)
+{
+ int i;
+ SDL_Joystick *joystick;
+
+ if ( (device_index < 0) || (device_index >= SDL_numjoysticks) ) {
+ SDL_SetError("There are %d joysticks available",
+ SDL_numjoysticks);
+ return(NULL);
+ }
+
+ /* If the joystick is already open, return it */
+ for ( i=0; SDL_joysticks[i]; ++i ) {
+ if ( device_index == SDL_joysticks[i]->index ) {
+ joystick = SDL_joysticks[i];
+ ++joystick->ref_count;
+ return(joystick);
+ }
+ }
+
+ /* Create and initialize the joystick */
+ joystick = (SDL_Joystick *)SDL_malloc((sizeof *joystick));
+ if ( !joystick ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+
+ SDL_memset(joystick, 0, (sizeof *joystick));
+ joystick->index = device_index;
+ if ( SDL_SYS_JoystickOpen(joystick) < 0 ) {
+ SDL_free(joystick);
+ return(NULL);
+ }
+
+ if ( joystick->naxes > 0 ) {
+ joystick->axes = (Sint16 *)SDL_malloc
+ (joystick->naxes*sizeof(Sint16));
+ }
+ if ( joystick->nhats > 0 ) {
+ joystick->hats = (Uint8 *)SDL_malloc
+ (joystick->nhats*sizeof(Uint8));
+ }
+ if ( joystick->nballs > 0 ) {
+ joystick->balls = (struct balldelta *)SDL_malloc
+ (joystick->nballs*sizeof(*joystick->balls));
+ }
+ if ( joystick->nbuttons > 0 ) {
+ joystick->buttons = (Uint8 *)SDL_malloc
+ (joystick->nbuttons*sizeof(Uint8));
+ }
+ if ( ((joystick->naxes > 0) && !joystick->axes)
+ || ((joystick->nhats > 0) && !joystick->hats)
+ || ((joystick->nballs > 0) && !joystick->balls)
+ || ((joystick->nbuttons > 0) && !joystick->buttons)) {
+ SDL_OutOfMemory();
+ SDL_JoystickClose(joystick);
+ return(NULL);
+ }
+
+ if ( joystick->axes ) {
+ SDL_memset(joystick->axes, 0,
+ joystick->naxes*sizeof(Sint16));
+ }
+ if ( joystick->hats ) {
+ SDL_memset(joystick->hats, 0,
+ joystick->nhats*sizeof(Uint8));
+ }
+ if ( joystick->balls ) {
+ SDL_memset(joystick->balls, 0,
+ joystick->nballs*sizeof(*joystick->balls));
+ }
+ if ( joystick->buttons ) {
+ SDL_memset(joystick->buttons, 0,
+ joystick->nbuttons*sizeof(Uint8));
+ }
+
+ /* Add joystick to list */
+ ++joystick->ref_count;
+ SDL_Lock_EventThread();
+ for ( i=0; SDL_joysticks[i]; ++i )
+ /* Skip to next joystick */ ;
+ SDL_joysticks[i] = joystick;
+ SDL_Unlock_EventThread();
+
+ return(joystick);
+}
+
+/*
+ * Returns 1 if the joystick has been opened, or 0 if it has not.
+ */
+int SDL_JoystickOpened(int device_index)
+{
+ int i, opened;
+
+ opened = 0;
+ for ( i=0; SDL_joysticks[i]; ++i ) {
+ if ( SDL_joysticks[i]->index == (Uint8)device_index ) {
+ opened = 1;
+ break;
+ }
+ }
+ return(opened);
+}
+
+static int ValidJoystick(SDL_Joystick **joystick)
+{
+ int valid;
+
+ if ( *joystick == NULL ) {
+ SDL_SetError("Joystick hasn't been opened yet");
+ valid = 0;
+ } else {
+ valid = 1;
+ }
+ return valid;
+}
+
+/*
+ * Get the device index of an opened joystick.
+ */
+int SDL_JoystickIndex(SDL_Joystick *joystick)
+{
+ if ( ! ValidJoystick(&joystick) ) {
+ return(-1);
+ }
+ return(joystick->index);
+}
+
+/*
+ * Get the number of multi-dimensional axis controls on a joystick
+ */
+int SDL_JoystickNumAxes(SDL_Joystick *joystick)
+{
+ if ( ! ValidJoystick(&joystick) ) {
+ return(-1);
+ }
+ return(joystick->naxes);
+}
+
+/*
+ * Get the number of hats on a joystick
+ */
+int SDL_JoystickNumHats(SDL_Joystick *joystick)
+{
+ if ( ! ValidJoystick(&joystick) ) {
+ return(-1);
+ }
+ return(joystick->nhats);
+}
+
+/*
+ * Get the number of trackballs on a joystick
+ */
+int SDL_JoystickNumBalls(SDL_Joystick *joystick)
+{
+ if ( ! ValidJoystick(&joystick) ) {
+ return(-1);
+ }
+ return(joystick->nballs);
+}
+
+/*
+ * Get the number of buttons on a joystick
+ */
+int SDL_JoystickNumButtons(SDL_Joystick *joystick)
+{
+ if ( ! ValidJoystick(&joystick) ) {
+ return(-1);
+ }
+ return(joystick->nbuttons);
+}
+
+/*
+ * Get the current state of an axis control on a joystick
+ */
+Sint16 SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis)
+{
+ Sint16 state;
+
+ if ( ! ValidJoystick(&joystick) ) {
+ return(0);
+ }
+ if ( axis < joystick->naxes ) {
+ state = joystick->axes[axis];
+ } else {
+ SDL_SetError("Joystick only has %d axes", joystick->naxes);
+ state = 0;
+ }
+ return(state);
+}
+
+/*
+ * Get the current state of a hat on a joystick
+ */
+Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat)
+{
+ Uint8 state;
+
+ if ( ! ValidJoystick(&joystick) ) {
+ return(0);
+ }
+ if ( hat < joystick->nhats ) {
+ state = joystick->hats[hat];
+ } else {
+ SDL_SetError("Joystick only has %d hats", joystick->nhats);
+ state = 0;
+ }
+ return(state);
+}
+
+/*
+ * Get the ball axis change since the last poll
+ */
+int SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy)
+{
+ int retval;
+
+ if ( ! ValidJoystick(&joystick) ) {
+ return(-1);
+ }
+
+ retval = 0;
+ if ( ball < joystick->nballs ) {
+ if ( dx ) {
+ *dx = joystick->balls[ball].dx;
+ }
+ if ( dy ) {
+ *dy = joystick->balls[ball].dy;
+ }
+ joystick->balls[ball].dx = 0;
+ joystick->balls[ball].dy = 0;
+ } else {
+ SDL_SetError("Joystick only has %d balls", joystick->nballs);
+ retval = -1;
+ }
+ return(retval);
+}
+
+/*
+ * Get the current state of a button on a joystick
+ */
+Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button)
+{
+ Uint8 state;
+
+ if ( ! ValidJoystick(&joystick) ) {
+ return(0);
+ }
+ if ( button < joystick->nbuttons ) {
+ state = joystick->buttons[button];
+ } else {
+ SDL_SetError("Joystick only has %d buttons",joystick->nbuttons);
+ state = 0;
+ }
+ return(state);
+}
+
+/*
+ * Close a joystick previously opened with SDL_JoystickOpen()
+ */
+void SDL_JoystickClose(SDL_Joystick *joystick)
+{
+ int i;
+
+ if ( ! ValidJoystick(&joystick) ) {
+ return;
+ }
+
+ /* First decrement ref count */
+ if ( --joystick->ref_count > 0 ) {
+ return;
+ }
+
+ /* Lock the event queue - prevent joystick polling */
+ SDL_Lock_EventThread();
+
+ SDL_SYS_JoystickClose(joystick);
+
+ /* Remove joystick from list */
+ for ( i=0; SDL_joysticks[i]; ++i ) {
+ if ( joystick == SDL_joysticks[i] ) {
+ SDL_memmove(&SDL_joysticks[i], &SDL_joysticks[i+1],
+ (SDL_allocatedjoysticks-i)*sizeof(joystick));
+ break;
+ }
+ }
+
+ /* Let the event thread keep running */
+ SDL_Unlock_EventThread();
+
+ /* Free the data associated with this joystick */
+ if ( joystick->axes ) {
+ SDL_free(joystick->axes);
+ }
+ if ( joystick->hats ) {
+ SDL_free(joystick->hats);
+ }
+ if ( joystick->balls ) {
+ SDL_free(joystick->balls);
+ }
+ if ( joystick->buttons ) {
+ SDL_free(joystick->buttons);
+ }
+ SDL_free(joystick);
+}
+
+void SDL_JoystickQuit(void)
+{
+ const int numsticks = SDL_numjoysticks;
+ int i;
+
+ /* Stop the event polling */
+ SDL_Lock_EventThread();
+ SDL_numjoysticks = 0;
+ SDL_Unlock_EventThread();
+
+ if (SDL_joysticks != NULL) {
+ for (i = 0; i < numsticks; i++) {
+ SDL_Joystick *stick = SDL_joysticks[i];
+ if (stick && (stick->ref_count >= 1)) {
+ stick->ref_count = 1;
+ SDL_JoystickClose(stick);
+ }
+ }
+ }
+
+ /* Quit the joystick setup */
+ SDL_SYS_JoystickQuit();
+ if ( SDL_joysticks ) {
+ SDL_free(SDL_joysticks);
+ SDL_joysticks = NULL;
+ SDL_allocatedjoysticks = 0;
+ }
+}
+
+
+/* These are global for SDL_sysjoystick.c and SDL_events.c */
+
+int SDL_PrivateJoystickAxis(SDL_Joystick *joystick, Uint8 axis, Sint16 value)
+{
+ int posted;
+
+ /* Make sure we're not getting garbage events */
+ if (axis >= joystick->naxes) {
+ return 0;
+ }
+
+ /* Update internal joystick state */
+ joystick->axes[axis] = value;
+
+ /* Post the event, if desired */
+ posted = 0;
+#if !SDL_EVENTS_DISABLED
+ if ( SDL_ProcessEvents[SDL_JOYAXISMOTION] == SDL_ENABLE ) {
+ SDL_Event event;
+ event.type = SDL_JOYAXISMOTION;
+ event.jaxis.which = joystick->index;
+ event.jaxis.axis = axis;
+ event.jaxis.value = value;
+ if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
+ posted = 1;
+ SDL_PushEvent(&event);
+ }
+ }
+#endif /* !SDL_EVENTS_DISABLED */
+ return(posted);
+}
+
+int SDL_PrivateJoystickHat(SDL_Joystick *joystick, Uint8 hat, Uint8 value)
+{
+ int posted;
+
+ /* Make sure we're not getting garbage events */
+ if (hat >= joystick->nhats) {
+ return 0;
+ }
+
+ /* Update internal joystick state */
+ joystick->hats[hat] = value;
+
+ /* Post the event, if desired */
+ posted = 0;
+#if !SDL_EVENTS_DISABLED
+ if ( SDL_ProcessEvents[SDL_JOYHATMOTION] == SDL_ENABLE ) {
+ SDL_Event event;
+ event.jhat.type = SDL_JOYHATMOTION;
+ event.jhat.which = joystick->index;
+ event.jhat.hat = hat;
+ event.jhat.value = value;
+ if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
+ posted = 1;
+ SDL_PushEvent(&event);
+ }
+ }
+#endif /* !SDL_EVENTS_DISABLED */
+ return(posted);
+}
+
+int SDL_PrivateJoystickBall(SDL_Joystick *joystick, Uint8 ball,
+ Sint16 xrel, Sint16 yrel)
+{
+ int posted;
+
+ /* Make sure we're not getting garbage events */
+ if (ball >= joystick->nballs) {
+ return 0;
+ }
+
+ /* Update internal mouse state */
+ joystick->balls[ball].dx += xrel;
+ joystick->balls[ball].dy += yrel;
+
+ /* Post the event, if desired */
+ posted = 0;
+#if !SDL_EVENTS_DISABLED
+ if ( SDL_ProcessEvents[SDL_JOYBALLMOTION] == SDL_ENABLE ) {
+ SDL_Event event;
+ event.jball.type = SDL_JOYBALLMOTION;
+ event.jball.which = joystick->index;
+ event.jball.ball = ball;
+ event.jball.xrel = xrel;
+ event.jball.yrel = yrel;
+ if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
+ posted = 1;
+ SDL_PushEvent(&event);
+ }
+ }
+#endif /* !SDL_EVENTS_DISABLED */
+ return(posted);
+}
+
+int SDL_PrivateJoystickButton(SDL_Joystick *joystick, Uint8 button, Uint8 state)
+{
+ int posted;
+#if !SDL_EVENTS_DISABLED
+ SDL_Event event;
+
+ switch ( state ) {
+ case SDL_PRESSED:
+ event.type = SDL_JOYBUTTONDOWN;
+ break;
+ case SDL_RELEASED:
+ event.type = SDL_JOYBUTTONUP;
+ break;
+ default:
+ /* Invalid state -- bail */
+ return(0);
+ }
+#endif /* !SDL_EVENTS_DISABLED */
+
+ /* Make sure we're not getting garbage events */
+ if (button >= joystick->nbuttons) {
+ return 0;
+ }
+
+ /* Update internal joystick state */
+ joystick->buttons[button] = state;
+
+ /* Post the event, if desired */
+ posted = 0;
+#if !SDL_EVENTS_DISABLED
+ if ( SDL_ProcessEvents[event.type] == SDL_ENABLE ) {
+ event.jbutton.which = joystick->index;
+ event.jbutton.button = button;
+ event.jbutton.state = state;
+ if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
+ posted = 1;
+ SDL_PushEvent(&event);
+ }
+ }
+#endif /* !SDL_EVENTS_DISABLED */
+ return(posted);
+}
+
+void SDL_JoystickUpdate(void)
+{
+ int i;
+
+ for ( i=0; SDL_joysticks[i]; ++i ) {
+ SDL_SYS_JoystickUpdate(SDL_joysticks[i]);
+ }
+}
+
+int SDL_JoystickEventState(int state)
+{
+#if SDL_EVENTS_DISABLED
+ return SDL_IGNORE;
+#else
+ const Uint8 event_list[] = {
+ SDL_JOYAXISMOTION, SDL_JOYBALLMOTION, SDL_JOYHATMOTION,
+ SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP,
+ };
+ unsigned int i;
+
+ switch (state) {
+ case SDL_QUERY:
+ state = SDL_IGNORE;
+ for ( i=0; i<SDL_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 */
+}
diff --git a/distrib/sdl-1.2.15/src/joystick/SDL_joystick_c.h b/distrib/sdl-1.2.15/src/joystick/SDL_joystick_c.h
new file mode 100644
index 0000000..9a9d130
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/joystick/SDL_joystick_c.h
@@ -0,0 +1,38 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Useful functions and variables from SDL_joystick.c */
+#include "SDL_joystick.h"
+
+/* The number of available joysticks on the system */
+extern Uint8 SDL_numjoysticks;
+
+/* Internal event queueing functions */
+extern int SDL_PrivateJoystickAxis(SDL_Joystick *joystick,
+ Uint8 axis, Sint16 value);
+extern int SDL_PrivateJoystickBall(SDL_Joystick *joystick,
+ Uint8 ball, Sint16 xrel, Sint16 yrel);
+extern int SDL_PrivateJoystickHat(SDL_Joystick *joystick,
+ Uint8 hat, Uint8 value);
+extern int SDL_PrivateJoystickButton(SDL_Joystick *joystick,
+ Uint8 button, Uint8 state);
diff --git a/distrib/sdl-1.2.15/src/joystick/SDL_sysjoystick.h b/distrib/sdl-1.2.15/src/joystick/SDL_sysjoystick.h
new file mode 100644
index 0000000..6a1b76a
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/joystick/SDL_sysjoystick.h
@@ -0,0 +1,82 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is SDL_free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This is the system specific header for the SDL joystick API */
+
+#include "SDL_joystick.h"
+
+/* The SDL joystick structure */
+struct _SDL_Joystick {
+ Uint8 index; /* Device index */
+ const char *name; /* Joystick name - system dependent */
+
+ int naxes; /* Number of axis controls on the joystick */
+ Sint16 *axes; /* Current axis states */
+
+ int nhats; /* Number of hats on the joystick */
+ Uint8 *hats; /* Current hat states */
+
+ int nballs; /* Number of trackballs on the joystick */
+ struct balldelta {
+ int dx;
+ int dy;
+ } *balls; /* Current ball motion deltas */
+
+ int nbuttons; /* Number of buttons on the joystick */
+ Uint8 *buttons; /* Current button states */
+
+ struct joystick_hwdata *hwdata; /* Driver dependent information */
+
+ int ref_count; /* Reference count for multiple opens */
+};
+
+/* Function to scan the system for joysticks.
+ * Joystick 0 should be the system default joystick.
+ * This function should return the number of available joysticks, or -1
+ * on an unrecoverable fatal error.
+ */
+extern int SDL_SYS_JoystickInit(void);
+
+/* Function to get the device-dependent name of a joystick */
+extern const char *SDL_SYS_JoystickName(int index);
+
+/* Function to open a joystick for use.
+ The joystick to open is specified by the index field of the joystick.
+ This should fill the nbuttons and naxes fields of the joystick structure.
+ It returns 0, or -1 if there is an error.
+ */
+extern int SDL_SYS_JoystickOpen(SDL_Joystick *joystick);
+
+/* Function to update the state of a joystick - called as a device poll.
+ * This function shouldn't update the joystick structure directly,
+ * but instead should call SDL_PrivateJoystick*() to deliver events
+ * and update joystick device state.
+ */
+extern void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick);
+
+/* Function to close a joystick after use */
+extern void SDL_SYS_JoystickClose(SDL_Joystick *joystick);
+
+/* Function to perform any system-specific joystick related cleanup */
+extern void SDL_SYS_JoystickQuit(void);
+
diff --git a/distrib/sdl-1.2.15/src/joystick/beos/SDL_bejoystick.cc b/distrib/sdl-1.2.15/src/joystick/beos/SDL_bejoystick.cc
new file mode 100644
index 0000000..af8a341
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/joystick/beos/SDL_bejoystick.cc
@@ -0,0 +1,237 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_JOYSTICK_BEOS
+
+/* This is the system specific header for the SDL joystick API */
+
+#include <be/support/String.h>
+#include <be/device/Joystick.h>
+
+extern "C" {
+
+#include "SDL_joystick.h"
+#include "../SDL_sysjoystick.h"
+#include "../SDL_joystick_c.h"
+
+
+/* The maximum number of joysticks we'll detect */
+#define MAX_JOYSTICKS 16
+
+/* A list of available joysticks */
+static char *SDL_joyport[MAX_JOYSTICKS];
+static char *SDL_joyname[MAX_JOYSTICKS];
+
+/* The private structure used to keep track of a joystick */
+struct joystick_hwdata {
+ BJoystick *stick;
+ uint8 *new_hats;
+ int16 *new_axes;
+};
+
+/* Function to scan the system for joysticks.
+ * This function should set SDL_numjoysticks to the number of available
+ * joysticks. Joystick 0 should be the system default joystick.
+ * It should return 0, or -1 on an unrecoverable fatal error.
+ */
+int SDL_SYS_JoystickInit(void)
+{
+ BJoystick joystick;
+ int numjoysticks;
+ int i;
+ int32 nports;
+ char name[B_OS_NAME_LENGTH];
+
+ /* Search for attached joysticks */
+ nports = joystick.CountDevices();
+ numjoysticks = 0;
+ SDL_memset(SDL_joyport, 0, (sizeof SDL_joyport));
+ SDL_memset(SDL_joyname, 0, (sizeof SDL_joyname));
+ for ( i=0; (SDL_numjoysticks < MAX_JOYSTICKS) && (i < nports); ++i ) {
+ if ( joystick.GetDeviceName(i, name) == B_OK ) {
+ if ( joystick.Open(name) != B_ERROR ) {
+ BString stick_name;
+ joystick.GetControllerName(&stick_name);
+ SDL_joyport[numjoysticks] = strdup(name);
+ SDL_joyname[numjoysticks] =
+ strdup(stick_name.String());
+ numjoysticks++;
+ joystick.Close();
+ }
+ }
+ }
+ return(numjoysticks);
+}
+
+/* Function to get the device-dependent name of a joystick */
+const char *SDL_SYS_JoystickName(int index)
+{
+ return SDL_joyname[index];
+}
+
+/* Function to open a joystick for use.
+ The joystick to open is specified by the index field of the joystick.
+ This should fill the nbuttons and naxes fields of the joystick structure.
+ It returns 0, or -1 if there is an error.
+ */
+int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
+{
+ BJoystick *stick;
+
+ /* Create the joystick data structure */
+ joystick->hwdata = (struct joystick_hwdata *)
+ SDL_malloc(sizeof(*joystick->hwdata));
+ if ( joystick->hwdata == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
+ stick = new BJoystick;
+ joystick->hwdata->stick = stick;
+
+ /* Open the requested joystick for use */
+ if ( stick->Open(SDL_joyport[joystick->index]) == B_ERROR ) {
+ SDL_SetError("Unable to open joystick");
+ SDL_SYS_JoystickClose(joystick);
+ return(-1);
+ }
+
+ /* Set the joystick to calibrated mode */
+ stick->EnableCalibration();
+
+ /* Get the number of buttons, hats, and axes on the joystick */
+ joystick->nbuttons = stick->CountButtons();
+ joystick->naxes = stick->CountAxes();
+ joystick->nhats = stick->CountHats();
+
+ joystick->hwdata->new_axes = (int16 *)
+ SDL_malloc(joystick->naxes*sizeof(int16));
+ joystick->hwdata->new_hats = (uint8 *)
+ SDL_malloc(joystick->nhats*sizeof(uint8));
+ if ( ! joystick->hwdata->new_hats || ! joystick->hwdata->new_axes ) {
+ SDL_OutOfMemory();
+ SDL_SYS_JoystickClose(joystick);
+ return(-1);
+ }
+
+ /* We're done! */
+ return(0);
+}
+
+/* Function to update the state of a joystick - called as a device poll.
+ * This function shouldn't update the joystick structure directly,
+ * but instead should call SDL_PrivateJoystick*() to deliver events
+ * and update joystick device state.
+ */
+void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
+{
+ static const Uint8 hat_map[9] = {
+ SDL_HAT_CENTERED,
+ SDL_HAT_UP,
+ SDL_HAT_RIGHTUP,
+ SDL_HAT_RIGHT,
+ SDL_HAT_RIGHTDOWN,
+ SDL_HAT_DOWN,
+ SDL_HAT_LEFTDOWN,
+ SDL_HAT_LEFT,
+ SDL_HAT_LEFTUP
+ };
+ const int JITTER = (32768/10); /* 10% jitter threshold (ok?) */
+
+ BJoystick *stick;
+ int i, change;
+ int16 *axes;
+ uint8 *hats;
+ uint32 buttons;
+
+ /* Set up data pointers */
+ stick = joystick->hwdata->stick;
+ axes = joystick->hwdata->new_axes;
+ hats = joystick->hwdata->new_hats;
+
+ /* Get the new joystick state */
+ stick->Update();
+ stick->GetAxisValues(axes);
+ stick->GetHatValues(hats);
+ buttons = stick->ButtonValues();
+
+ /* Generate axis motion events */
+ for ( i=0; i<joystick->naxes; ++i ) {
+ change = ((int32)axes[i] - joystick->axes[i]);
+ if ( (change > JITTER) || (change < -JITTER) ) {
+ SDL_PrivateJoystickAxis(joystick, i, axes[i]);
+ }
+ }
+
+ /* Generate hat change events */
+ for ( i=0; i<joystick->nhats; ++i ) {
+ if ( hats[i] != joystick->hats[i] ) {
+ SDL_PrivateJoystickHat(joystick, i, hat_map[hats[i]]);
+ }
+ }
+
+ /* Generate button events */
+ for ( i=0; i<joystick->nbuttons; ++i ) {
+ if ( (buttons&0x01) != joystick->buttons[i] ) {
+ SDL_PrivateJoystickButton(joystick, i, (buttons&0x01));
+ }
+ buttons >>= 1;
+ }
+}
+
+/* Function to close a joystick after use */
+void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
+{
+ if ( joystick->hwdata ) {
+ joystick->hwdata->stick->Close();
+ delete joystick->hwdata->stick;
+ if ( joystick->hwdata->new_hats ) {
+ SDL_free(joystick->hwdata->new_hats);
+ }
+ if ( joystick->hwdata->new_axes ) {
+ SDL_free(joystick->hwdata->new_axes);
+ }
+ SDL_free(joystick->hwdata);
+ joystick->hwdata = NULL;
+ }
+}
+
+/* Function to perform any system-specific joystick related cleanup */
+void SDL_SYS_JoystickQuit(void)
+{
+ int i;
+
+ for ( i=0; SDL_joyport[i]; ++i ) {
+ SDL_free(SDL_joyport[i]);
+ }
+ SDL_joyport[0] = NULL;
+
+ for ( i=0; SDL_joyname[i]; ++i ) {
+ SDL_free(SDL_joyname[i]);
+ }
+ SDL_joyname[0] = NULL;
+}
+
+}; // extern "C"
+
+#endif /* SDL_JOYSTICK_BEOS */
diff --git a/distrib/sdl-1.2.15/src/joystick/bsd/SDL_sysjoystick.c b/distrib/sdl-1.2.15/src/joystick/bsd/SDL_sysjoystick.c
new file mode 100644
index 0000000..500fc62
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/joystick/bsd/SDL_sysjoystick.c
@@ -0,0 +1,608 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_JOYSTICK_USBHID
+
+/*
+ * Joystick driver for the uhid(4) interface found in OpenBSD,
+ * NetBSD and FreeBSD.
+ *
+ * Maintainer: <vedge at csoft.org>
+ */
+
+#include <sys/param.h>
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#ifndef __FreeBSD_kernel_version
+#define __FreeBSD_kernel_version __FreeBSD_version
+#endif
+
+#if defined(HAVE_USB_H)
+#include <usb.h>
+#endif
+#ifdef __DragonFly__
+#include <bus/usb/usb.h>
+#include <bus/usb/usbhid.h>
+#else
+#include <dev/usb/usb.h>
+#include <dev/usb/usbhid.h>
+#endif
+
+#if defined(HAVE_USBHID_H)
+#include <usbhid.h>
+#elif defined(HAVE_LIBUSB_H)
+#include <libusb.h>
+#elif defined(HAVE_LIBUSBHID_H)
+#include <libusbhid.h>
+#endif
+
+#if defined(__FREEBSD__) || defined(__FreeBSD_kernel__)
+#ifndef __DragonFly__
+#include <osreldate.h>
+#endif
+#if __FreeBSD_kernel_version > 800063
+#include <dev/usb/usb_ioctl.h>
+#endif
+#include <sys/joystick.h>
+#endif
+
+#if SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
+#include <machine/joystick.h>
+#endif
+
+#include "SDL_joystick.h"
+#include "../SDL_sysjoystick.h"
+#include "../SDL_joystick_c.h"
+
+#define MAX_UHID_JOYS 4
+#define MAX_JOY_JOYS 2
+#define MAX_JOYS (MAX_UHID_JOYS + MAX_JOY_JOYS)
+
+struct report {
+#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)
+ struct usb_gen_descriptor *buf; /* Buffer */
+#else
+ struct usb_ctl_report *buf; /* Buffer */
+#endif
+ size_t size; /* Buffer size */
+ int rid; /* Report ID */
+ enum {
+ SREPORT_UNINIT,
+ SREPORT_CLEAN,
+ SREPORT_DIRTY
+ } status;
+};
+
+static struct {
+ int uhid_report;
+ hid_kind_t kind;
+ const char *name;
+} const repinfo[] = {
+ { UHID_INPUT_REPORT, hid_input, "input" },
+ { UHID_OUTPUT_REPORT, hid_output, "output" },
+ { UHID_FEATURE_REPORT, hid_feature, "feature" }
+};
+
+enum {
+ REPORT_INPUT = 0,
+ REPORT_OUTPUT = 1,
+ REPORT_FEATURE = 2
+};
+
+enum {
+ JOYAXE_X,
+ JOYAXE_Y,
+ JOYAXE_Z,
+ JOYAXE_SLIDER,
+ JOYAXE_WHEEL,
+ JOYAXE_RX,
+ JOYAXE_RY,
+ JOYAXE_RZ,
+ JOYAXE_count
+};
+
+struct joystick_hwdata {
+ int fd;
+ char *path;
+ enum {
+ BSDJOY_UHID, /* uhid(4) */
+ BSDJOY_JOY /* joy(4) */
+ } type;
+ struct report_desc *repdesc;
+ struct report inreport;
+ int axis_map[JOYAXE_count]; /* map present JOYAXE_* to 0,1,..*/
+ int x;
+ int y;
+ int xmin;
+ int ymin;
+ int xmax;
+ int ymax;
+};
+
+static char *joynames[MAX_JOYS];
+static char *joydevnames[MAX_JOYS];
+
+static int report_alloc(struct report *, struct report_desc *, int);
+static void report_free(struct report *);
+
+#if defined(USBHID_UCR_DATA) || defined(__FreeBSD_kernel__)
+#define REP_BUF_DATA(rep) ((rep)->buf->ucr_data)
+#elif (defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063))
+#define REP_BUF_DATA(rep) ((rep)->buf->ugd_data)
+#else
+#define REP_BUF_DATA(rep) ((rep)->buf->data)
+#endif
+
+int
+SDL_SYS_JoystickInit(void)
+{
+ char s[16];
+ int i, fd;
+
+ SDL_numjoysticks = 0;
+
+ SDL_memset(joynames, 0, sizeof(joynames));
+ SDL_memset(joydevnames, 0, sizeof(joydevnames));
+
+ for (i = 0; i < MAX_UHID_JOYS; i++) {
+ SDL_Joystick nj;
+
+ SDL_snprintf(s, SDL_arraysize(s), "/dev/uhid%d", i);
+
+ nj.index = SDL_numjoysticks;
+ joynames[nj.index] = strdup(s);
+
+ if (SDL_SYS_JoystickOpen(&nj) == 0) {
+ SDL_SYS_JoystickClose(&nj);
+ SDL_numjoysticks++;
+ } else {
+ SDL_free(joynames[nj.index]);
+ joynames[nj.index] = NULL;
+ }
+ }
+ for (i = 0; i < MAX_JOY_JOYS; i++) {
+ SDL_snprintf(s, SDL_arraysize(s), "/dev/joy%d", i);
+ fd = open(s, O_RDONLY);
+ if (fd != -1) {
+ joynames[SDL_numjoysticks++] = strdup(s);
+ close(fd);
+ }
+ }
+
+ /* Read the default USB HID usage table. */
+ hid_init(NULL);
+
+ return (SDL_numjoysticks);
+}
+
+const char *
+SDL_SYS_JoystickName(int index)
+{
+ if (joydevnames[index] != NULL) {
+ return (joydevnames[index]);
+ }
+ return (joynames[index]);
+}
+
+static int
+usage_to_joyaxe(unsigned usage)
+{
+ int joyaxe;
+ switch (usage) {
+ case HUG_X:
+ joyaxe = JOYAXE_X; break;
+ case HUG_Y:
+ joyaxe = JOYAXE_Y; break;
+ case HUG_Z:
+ joyaxe = JOYAXE_Z; break;
+ case HUG_SLIDER:
+ joyaxe = JOYAXE_SLIDER; break;
+ case HUG_WHEEL:
+ joyaxe = JOYAXE_WHEEL; break;
+ case HUG_RX:
+ joyaxe = JOYAXE_RX; break;
+ case HUG_RY:
+ joyaxe = JOYAXE_RY; break;
+ case HUG_RZ:
+ joyaxe = JOYAXE_RZ; break;
+ default:
+ joyaxe = -1;
+ }
+ return joyaxe;
+}
+
+static unsigned
+hatval_to_sdl(Sint32 hatval)
+{
+ static const unsigned hat_dir_map[8] = {
+ SDL_HAT_UP, SDL_HAT_RIGHTUP, SDL_HAT_RIGHT, SDL_HAT_RIGHTDOWN,
+ SDL_HAT_DOWN, SDL_HAT_LEFTDOWN, SDL_HAT_LEFT, SDL_HAT_LEFTUP
+ };
+ unsigned result;
+ if ((hatval & 7) == hatval)
+ result = hat_dir_map[hatval];
+ else
+ result = SDL_HAT_CENTERED;
+ return result;
+}
+
+
+int
+SDL_SYS_JoystickOpen(SDL_Joystick *joy)
+{
+ char *path = joynames[joy->index];
+ struct joystick_hwdata *hw;
+ struct hid_item hitem;
+ struct hid_data *hdata;
+ struct report *rep;
+ int fd;
+ int i;
+
+ fd = open(path, O_RDONLY);
+ if (fd == -1) {
+ SDL_SetError("%s: %s", path, strerror(errno));
+ return (-1);
+ }
+
+ hw = (struct joystick_hwdata *)SDL_malloc(sizeof(struct joystick_hwdata));
+ if (hw == NULL) {
+ SDL_OutOfMemory();
+ close(fd);
+ return (-1);
+ }
+ joy->hwdata = hw;
+ hw->fd = fd;
+ hw->path = strdup(path);
+ hw->x = 0;
+ hw->y = 0;
+ hw->xmin = 0xffff;
+ hw->ymin = 0xffff;
+ hw->xmax = 0;
+ hw->ymax = 0;
+ if (! SDL_strncmp(path, "/dev/joy", 8)) {
+ hw->type = BSDJOY_JOY;
+ joy->naxes = 2;
+ joy->nbuttons = 2;
+ joy->nhats = 0;
+ joy->nballs = 0;
+ joydevnames[joy->index] = strdup("Gameport joystick");
+ goto usbend;
+ } else {
+ hw->type = BSDJOY_UHID;
+ }
+
+ {
+ int ax;
+ for (ax = 0; ax < JOYAXE_count; ax++)
+ hw->axis_map[ax] = -1;
+ }
+ hw->repdesc = hid_get_report_desc(fd);
+ if (hw->repdesc == NULL) {
+ SDL_SetError("%s: USB_GET_REPORT_DESC: %s", hw->path,
+ strerror(errno));
+ goto usberr;
+ }
+ rep = &hw->inreport;
+#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063) || defined(__FreeBSD_kernel__)
+ rep->rid = hid_get_report_id(fd);
+ if (rep->rid < 0) {
+#else
+ if (ioctl(fd, USB_GET_REPORT_ID, &rep->rid) < 0) {
+#endif
+ rep->rid = -1; /* XXX */
+ }
+ if (report_alloc(rep, hw->repdesc, REPORT_INPUT) < 0) {
+ goto usberr;
+ }
+ if (rep->size <= 0) {
+ SDL_SetError("%s: Input report descriptor has invalid length",
+ hw->path);
+ goto usberr;
+ }
+
+#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111) || defined(__FreeBSD_kernel__)
+ hdata = hid_start_parse(hw->repdesc, 1 << hid_input, rep->rid);
+#else
+ hdata = hid_start_parse(hw->repdesc, 1 << hid_input);
+#endif
+ if (hdata == NULL) {
+ SDL_SetError("%s: Cannot start HID parser", hw->path);
+ goto usberr;
+ }
+ joy->naxes = 0;
+ joy->nbuttons = 0;
+ joy->nhats = 0;
+ joy->nballs = 0;
+ for (i=0; i<JOYAXE_count; i++)
+ hw->axis_map[i] = -1;
+
+ while (hid_get_item(hdata, &hitem) > 0) {
+ char *sp;
+ const char *s;
+
+ switch (hitem.kind) {
+ case hid_collection:
+ switch (HID_PAGE(hitem.usage)) {
+ case HUP_GENERIC_DESKTOP:
+ switch (HID_USAGE(hitem.usage)) {
+ case HUG_JOYSTICK:
+ case HUG_GAME_PAD:
+ s = hid_usage_in_page(hitem.usage);
+ sp = SDL_malloc(SDL_strlen(s) + 5);
+ SDL_snprintf(sp, SDL_strlen(s) + 5, "%s (%d)", s,
+ joy->index);
+ joydevnames[joy->index] = sp;
+ }
+ }
+ break;
+ case hid_input:
+ switch (HID_PAGE(hitem.usage)) {
+ case HUP_GENERIC_DESKTOP: {
+ unsigned usage = HID_USAGE(hitem.usage);
+ int joyaxe = usage_to_joyaxe(usage);
+ if (joyaxe >= 0) {
+ hw->axis_map[joyaxe] = 1;
+ } else if (usage == HUG_HAT_SWITCH) {
+ joy->nhats++;
+ }
+ break;
+ }
+ case HUP_BUTTON:
+ joy->nbuttons++;
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ hid_end_parse(hdata);
+ for (i=0; i<JOYAXE_count; i++)
+ if (hw->axis_map[i] > 0)
+ hw->axis_map[i] = joy->naxes++;
+
+usbend:
+ /* The poll blocks the event thread. */
+ fcntl(fd, F_SETFL, O_NONBLOCK);
+
+ return (0);
+usberr:
+ close(hw->fd);
+ SDL_free(hw->path);
+ SDL_free(hw);
+ return (-1);
+}
+
+void
+SDL_SYS_JoystickUpdate(SDL_Joystick *joy)
+{
+ struct hid_item hitem;
+ struct hid_data *hdata;
+ struct report *rep;
+ int nbutton, naxe = -1;
+ Sint32 v;
+
+#if defined(__FREEBSD__) || SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H || defined(__FreeBSD_kernel__)
+ struct joystick gameport;
+
+ if (joy->hwdata->type == BSDJOY_JOY) {
+ if (read(joy->hwdata->fd, &gameport, sizeof gameport) != sizeof gameport)
+ return;
+ if (abs(joy->hwdata->x - gameport.x) > 8) {
+ joy->hwdata->x = gameport.x;
+ if (joy->hwdata->x < joy->hwdata->xmin) {
+ joy->hwdata->xmin = joy->hwdata->x;
+ }
+ if (joy->hwdata->x > joy->hwdata->xmax) {
+ joy->hwdata->xmax = joy->hwdata->x;
+ }
+ if (joy->hwdata->xmin == joy->hwdata->xmax) {
+ joy->hwdata->xmin--;
+ joy->hwdata->xmax++;
+ }
+ v = (Sint32)joy->hwdata->x;
+ v -= (joy->hwdata->xmax + joy->hwdata->xmin + 1)/2;
+ v *= 32768/((joy->hwdata->xmax - joy->hwdata->xmin + 1)/2);
+ SDL_PrivateJoystickAxis(joy, 0, v);
+ }
+ if (abs(joy->hwdata->y - gameport.y) > 8) {
+ joy->hwdata->y = gameport.y;
+ if (joy->hwdata->y < joy->hwdata->ymin) {
+ joy->hwdata->ymin = joy->hwdata->y;
+ }
+ if (joy->hwdata->y > joy->hwdata->ymax) {
+ joy->hwdata->ymax = joy->hwdata->y;
+ }
+ if (joy->hwdata->ymin == joy->hwdata->ymax) {
+ joy->hwdata->ymin--;
+ joy->hwdata->ymax++;
+ }
+ v = (Sint32)joy->hwdata->y;
+ v -= (joy->hwdata->ymax + joy->hwdata->ymin + 1)/2;
+ v *= 32768/((joy->hwdata->ymax - joy->hwdata->ymin + 1)/2);
+ SDL_PrivateJoystickAxis(joy, 1, v);
+ }
+ if (gameport.b1 != joy->buttons[0]) {
+ SDL_PrivateJoystickButton(joy, 0, gameport.b1);
+ }
+ if (gameport.b2 != joy->buttons[1]) {
+ SDL_PrivateJoystickButton(joy, 1, gameport.b2);
+ }
+ return;
+ }
+#endif /* defined(__FREEBSD__) || SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H */
+
+ rep = &joy->hwdata->inreport;
+
+ if (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) != rep->size) {
+ return;
+ }
+#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111) || defined(__FreeBSD_kernel__)
+ hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input, rep->rid);
+#else
+ hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input);
+#endif
+ if (hdata == NULL) {
+ fprintf(stderr, "%s: Cannot start HID parser\n",
+ joy->hwdata->path);
+ return;
+ }
+
+ for (nbutton = 0; hid_get_item(hdata, &hitem) > 0;) {
+ switch (hitem.kind) {
+ case hid_input:
+ switch (HID_PAGE(hitem.usage)) {
+ case HUP_GENERIC_DESKTOP: {
+ unsigned usage = HID_USAGE(hitem.usage);
+ int joyaxe = usage_to_joyaxe(usage);
+ if (joyaxe >= 0) {
+ naxe = joy->hwdata->axis_map[joyaxe];
+ /* scaleaxe */
+ v = (Sint32)hid_get_data(REP_BUF_DATA(rep),
+ &hitem);
+ v -= (hitem.logical_maximum + hitem.logical_minimum + 1)/2;
+ v *= 32768/((hitem.logical_maximum - hitem.logical_minimum + 1)/2);
+ if (v != joy->axes[naxe]) {
+ SDL_PrivateJoystickAxis(joy, naxe, v);
+ }
+ } else if (usage == HUG_HAT_SWITCH) {
+ v = (Sint32)hid_get_data(REP_BUF_DATA(rep),
+ &hitem);
+ SDL_PrivateJoystickHat(joy, 0,
+ hatval_to_sdl(v)-hitem.logical_minimum);
+ }
+ break;
+ }
+ case HUP_BUTTON:
+ v = (Sint32)hid_get_data(REP_BUF_DATA(rep),
+ &hitem);
+ if (joy->buttons[nbutton] != v) {
+ SDL_PrivateJoystickButton(joy,
+ nbutton, v);
+ }
+ nbutton++;
+ break;
+ default:
+ continue;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ hid_end_parse(hdata);
+
+ return;
+}
+
+/* Function to close a joystick after use */
+void
+SDL_SYS_JoystickClose(SDL_Joystick *joy)
+{
+ if (SDL_strncmp(joy->hwdata->path, "/dev/joy", 8)) {
+ report_free(&joy->hwdata->inreport);
+ hid_dispose_report_desc(joy->hwdata->repdesc);
+ }
+ close(joy->hwdata->fd);
+ SDL_free(joy->hwdata->path);
+ SDL_free(joy->hwdata);
+
+ return;
+}
+
+void
+SDL_SYS_JoystickQuit(void)
+{
+ int i;
+
+ for (i = 0; i < MAX_JOYS; i++) {
+ if (joynames[i] != NULL)
+ SDL_free(joynames[i]);
+ if (joydevnames[i] != NULL)
+ SDL_free(joydevnames[i]);
+ }
+
+ return;
+}
+
+static int
+report_alloc(struct report *r, struct report_desc *rd, int repind)
+{
+ int len;
+
+#ifdef __DragonFly__
+ len = hid_report_size(rd, r->rid, repinfo[repind].kind);
+#elif __FREEBSD__
+# if (__FreeBSD_kernel_version >= 460000) || defined(__FreeBSD_kernel__)
+# if (__FreeBSD_kernel_version <= 500111)
+ len = hid_report_size(rd, r->rid, repinfo[repind].kind);
+# else
+ len = hid_report_size(rd, repinfo[repind].kind, r->rid);
+# endif
+# else
+ len = hid_report_size(rd, repinfo[repind].kind, &r->rid);
+# endif
+#else
+# ifdef USBHID_NEW
+ len = hid_report_size(rd, repinfo[repind].kind, r->rid);
+# else
+ len = hid_report_size(rd, repinfo[repind].kind, &r->rid);
+# endif
+#endif
+
+ if (len < 0) {
+ SDL_SetError("Negative HID report size");
+ return (-1);
+ }
+ r->size = len;
+
+ if (r->size > 0) {
+ r->buf = SDL_malloc(sizeof(*r->buf) - sizeof(REP_BUF_DATA(r)) +
+ r->size);
+ if (r->buf == NULL) {
+ SDL_OutOfMemory();
+ return (-1);
+ }
+ } else {
+ r->buf = NULL;
+ }
+
+ r->status = SREPORT_CLEAN;
+ return (0);
+}
+
+static void
+report_free(struct report *r)
+{
+ if (r->buf != NULL) {
+ SDL_free(r->buf);
+ }
+ r->status = SREPORT_UNINIT;
+}
+
+#endif /* SDL_JOYSTICK_USBHID */
diff --git a/distrib/sdl-1.2.15/src/joystick/darwin/SDL_sysjoystick.c b/distrib/sdl-1.2.15/src/joystick/darwin/SDL_sysjoystick.c
new file mode 100644
index 0000000..a9ccb35
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/joystick/darwin/SDL_sysjoystick.c
@@ -0,0 +1,842 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_JOYSTICK_IOKIT
+
+/* SDL joystick driver for Darwin / Mac OS X, based on the IOKit HID API */
+/* Written 2001 by Max Horn */
+
+#include <unistd.h>
+#include <ctype.h>
+#include <sysexits.h>
+#include <mach/mach.h>
+#include <mach/mach_error.h>
+#include <IOKit/IOKitLib.h>
+#include <IOKit/IOCFPlugIn.h>
+#ifdef MACOS_10_0_4
+#include <IOKit/hidsystem/IOHIDUsageTables.h>
+#else
+/* The header was moved here in Mac OS X 10.1 */
+#include <Kernel/IOKit/hidsystem/IOHIDUsageTables.h>
+#endif
+#include <IOKit/hid/IOHIDLib.h>
+#include <IOKit/hid/IOHIDKeys.h>
+#include <CoreFoundation/CoreFoundation.h>
+#include <Carbon/Carbon.h> /* for NewPtrClear, DisposePtr */
+
+#include "SDL_joystick.h"
+#include "../SDL_sysjoystick.h"
+#include "../SDL_joystick_c.h"
+
+struct recElement
+{
+ IOHIDElementCookie cookie; /* unique value which identifies element, will NOT change */
+ long min; /* reported min value possible */
+ long max; /* reported max value possible */
+#if 0
+ /* TODO: maybe should handle the following stuff somehow? */
+
+ long scaledMin; /* reported scaled min value possible */
+ long scaledMax; /* reported scaled max value possible */
+ long size; /* size in bits of data return from element */
+ Boolean relative; /* are reports relative to last report (deltas) */
+ Boolean wrapping; /* does element wrap around (one value higher than max is min) */
+ Boolean nonLinear; /* are the values reported non-linear relative to element movement */
+ Boolean preferredState; /* does element have a preferred state (such as a button) */
+ Boolean nullState; /* does element have null state */
+#endif /* 0 */
+
+ /* runtime variables used for auto-calibration */
+ long minReport; /* min returned value */
+ long maxReport; /* max returned value */
+
+ struct recElement * pNext; /* next element in list */
+};
+typedef struct recElement recElement;
+
+struct joystick_hwdata
+{
+ IOHIDDeviceInterface ** interface; /* interface to device, NULL = no interface */
+
+ char product[256]; /* name of product */
+ long usage; /* usage page from IOUSBHID Parser.h which defines general usage */
+ long usagePage; /* usage within above page from IOUSBHID Parser.h which defines specific usage */
+
+ long axes; /* number of axis (calculated, not reported by device) */
+ long buttons; /* number of buttons (calculated, not reported by device) */
+ long hats; /* number of hat switches (calculated, not reported by device) */
+ long elements; /* number of total elements (shouldbe total of above) (calculated, not reported by device) */
+
+ recElement* firstAxis;
+ recElement* firstButton;
+ recElement* firstHat;
+
+ int removed;
+ int uncentered;
+
+ struct joystick_hwdata* pNext; /* next device */
+};
+typedef struct joystick_hwdata recDevice;
+
+
+/* Linked list of all available devices */
+static recDevice *gpDeviceList = NULL;
+
+
+static void HIDReportErrorNum (char * strError, long numError)
+{
+ SDL_SetError(strError);
+}
+
+static void HIDGetCollectionElements (CFMutableDictionaryRef deviceProperties, recDevice *pDevice);
+
+/* returns current value for element, polling element
+ * will return 0 on error conditions which should be accounted for by application
+ */
+
+static SInt32 HIDGetElementValue (recDevice *pDevice, recElement *pElement)
+{
+ IOReturn result = kIOReturnSuccess;
+ IOHIDEventStruct hidEvent;
+ hidEvent.value = 0;
+
+ if (NULL != pDevice && NULL != pElement && NULL != pDevice->interface)
+ {
+ result = (*(pDevice->interface))->getElementValue(pDevice->interface, pElement->cookie, &hidEvent);
+ if (kIOReturnSuccess == result)
+ {
+ /* record min and max for auto calibration */
+ if (hidEvent.value < pElement->minReport)
+ pElement->minReport = hidEvent.value;
+ if (hidEvent.value > pElement->maxReport)
+ pElement->maxReport = hidEvent.value;
+ }
+ }
+
+ /* auto user scale */
+ return hidEvent.value;
+}
+
+static SInt32 HIDScaledCalibratedValue (recDevice *pDevice, recElement *pElement, long min, long max)
+{
+ float deviceScale = max - min;
+ float readScale = pElement->maxReport - pElement->minReport;
+ SInt32 value = HIDGetElementValue(pDevice, pElement);
+ if (readScale == 0)
+ return value; /* no scaling at all */
+ else
+ return ((value - pElement->minReport) * deviceScale / readScale) + min;
+}
+
+
+static void HIDRemovalCallback(void * target,
+ IOReturn result,
+ void * refcon,
+ void * sender)
+{
+ recDevice *device = (recDevice *) refcon;
+ device->removed = 1;
+ device->uncentered = 1;
+}
+
+
+
+/* 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
+ */
+
+static IOReturn HIDCreateOpenDeviceInterface (io_object_t hidDevice, recDevice *pDevice)
+{
+ IOReturn result = kIOReturnSuccess;
+ HRESULT plugInResult = S_OK;
+ SInt32 score = 0;
+ IOCFPlugInInterface ** ppPlugInInterface = NULL;
+
+ if (NULL == pDevice->interface)
+ {
+ result = IOCreatePlugInInterfaceForService (hidDevice, kIOHIDDeviceUserClientTypeID,
+ kIOCFPlugInInterfaceID, &ppPlugInInterface, &score);
+ if (kIOReturnSuccess == result)
+ {
+ /* Call a method of the intermediate plug-in to create the device interface */
+ plugInResult = (*ppPlugInInterface)->QueryInterface (ppPlugInInterface,
+ CFUUIDGetUUIDBytes (kIOHIDDeviceInterfaceID), (void *) &(pDevice->interface));
+ if (S_OK != plugInResult)
+ HIDReportErrorNum ("CouldnÕt query HID class device interface from plugInInterface", plugInResult);
+ (*ppPlugInInterface)->Release (ppPlugInInterface);
+ }
+ else
+ HIDReportErrorNum ("Failed to create **plugInInterface via IOCreatePlugInInterfaceForService.", result);
+ }
+ if (NULL != pDevice->interface)
+ {
+ result = (*(pDevice->interface))->open (pDevice->interface, 0);
+ if (kIOReturnSuccess != result)
+ HIDReportErrorNum ("Failed to open pDevice->interface via open.", result);
+ else
+ (*(pDevice->interface))->setRemovalCallback (pDevice->interface, HIDRemovalCallback, pDevice, pDevice);
+
+ }
+ return result;
+}
+
+/* Closes and releases interface to device, should be done prior to exting application
+ * Note: will have no affect if device or interface do not exist
+ * application will "own" the device if interface is not closed
+ * (device may have to be plug and re-plugged in different location to get it working again without a restart)
+ */
+
+static IOReturn HIDCloseReleaseInterface (recDevice *pDevice)
+{
+ IOReturn result = kIOReturnSuccess;
+
+ if ((NULL != pDevice) && (NULL != pDevice->interface))
+ {
+ /* close the interface */
+ result = (*(pDevice->interface))->close (pDevice->interface);
+ if (kIOReturnNotOpen == result)
+ {
+ /* do nothing as device was not opened, thus can't be closed */
+ }
+ else if (kIOReturnSuccess != result)
+ HIDReportErrorNum ("Failed to close IOHIDDeviceInterface.", result);
+ /* release the interface */
+ result = (*(pDevice->interface))->Release (pDevice->interface);
+ if (kIOReturnSuccess != result)
+ HIDReportErrorNum ("Failed to release IOHIDDeviceInterface.", result);
+ pDevice->interface = NULL;
+ }
+ return result;
+}
+
+/* extracts actual specific element information from each element CF dictionary entry */
+
+static void HIDGetElementInfo (CFTypeRef refElement, recElement *pElement)
+{
+ long number;
+ CFTypeRef refType;
+
+ refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementCookieKey));
+ if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number))
+ pElement->cookie = (IOHIDElementCookie) number;
+ refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementMinKey));
+ if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number))
+ pElement->minReport = pElement->min = number;
+ refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementMaxKey));
+ if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number))
+ pElement->maxReport = pElement->max = number;
+/*
+ TODO: maybe should handle the following stuff somehow?
+
+ refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementScaledMinKey));
+ if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number))
+ pElement->scaledMin = number;
+ refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementScaledMaxKey));
+ if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number))
+ pElement->scaledMax = number;
+ refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementSizeKey));
+ if (refType && CFNumberGetValue (refType, kCFNumberLongType, &number))
+ pElement->size = number;
+ refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementIsRelativeKey));
+ if (refType)
+ pElement->relative = CFBooleanGetValue (refType);
+ refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementIsWrappingKey));
+ if (refType)
+ pElement->wrapping = CFBooleanGetValue (refType);
+ refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementIsNonLinearKey));
+ if (refType)
+ pElement->nonLinear = CFBooleanGetValue (refType);
+ refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementHasPreferedStateKey));
+ if (refType)
+ pElement->preferredState = CFBooleanGetValue (refType);
+ refType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementHasNullStateKey));
+ if (refType)
+ pElement->nullState = CFBooleanGetValue (refType);
+*/
+}
+
+/* examines CF dictionary vlaue in device element hierarchy to determine if it is element of interest or a collection of more elements
+ * if element of interest allocate storage, add to list and retrieve element specific info
+ * if collection then pass on to deconstruction collection into additional individual elements
+ */
+
+static void HIDAddElement (CFTypeRef refElement, recDevice* pDevice)
+{
+ recElement* element = NULL;
+ recElement** headElement = NULL;
+ long elementType, usagePage, usage;
+ CFTypeRef refElementType = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementTypeKey));
+ CFTypeRef refUsagePage = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementUsagePageKey));
+ CFTypeRef refUsage = CFDictionaryGetValue (refElement, CFSTR(kIOHIDElementUsageKey));
+
+
+ if ((refElementType) && (CFNumberGetValue (refElementType, kCFNumberLongType, &elementType)))
+ {
+ /* look at types of interest */
+ if ((elementType == kIOHIDElementTypeInput_Misc) || (elementType == kIOHIDElementTypeInput_Button) ||
+ (elementType == kIOHIDElementTypeInput_Axis))
+ {
+ if (refUsagePage && CFNumberGetValue (refUsagePage, kCFNumberLongType, &usagePage) &&
+ refUsage && CFNumberGetValue (refUsage, kCFNumberLongType, &usage))
+ {
+ switch (usagePage) /* only interested in kHIDPage_GenericDesktop and kHIDPage_Button */
+ {
+ case kHIDPage_GenericDesktop:
+ {
+ switch (usage) /* look at usage to determine function */
+ {
+ case kHIDUsage_GD_X:
+ case kHIDUsage_GD_Y:
+ case kHIDUsage_GD_Z:
+ case kHIDUsage_GD_Rx:
+ case kHIDUsage_GD_Ry:
+ case kHIDUsage_GD_Rz:
+ case kHIDUsage_GD_Slider:
+ case kHIDUsage_GD_Dial:
+ case kHIDUsage_GD_Wheel:
+ element = (recElement *) NewPtrClear (sizeof (recElement));
+ if (element)
+ {
+ pDevice->axes++;
+ headElement = &(pDevice->firstAxis);
+ }
+ break;
+ case kHIDUsage_GD_Hatswitch:
+ element = (recElement *) NewPtrClear (sizeof (recElement));
+ if (element)
+ {
+ pDevice->hats++;
+ headElement = &(pDevice->firstHat);
+ }
+ break;
+ }
+ }
+ break;
+ case kHIDPage_Button:
+ element = (recElement *) NewPtrClear (sizeof (recElement));
+ if (element)
+ {
+ pDevice->buttons++;
+ headElement = &(pDevice->firstButton);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ else if (kIOHIDElementTypeCollection == elementType)
+ HIDGetCollectionElements ((CFMutableDictionaryRef) refElement, pDevice);
+ }
+
+ if (element && headElement) /* add to list */
+ {
+ pDevice->elements++;
+ if (NULL == *headElement)
+ *headElement = element;
+ else
+ {
+ recElement *elementPrevious, *elementCurrent;
+ elementCurrent = *headElement;
+ while (elementCurrent)
+ {
+ elementPrevious = elementCurrent;
+ elementCurrent = elementPrevious->pNext;
+ }
+ elementPrevious->pNext = element;
+ }
+ element->pNext = NULL;
+ HIDGetElementInfo (refElement, element);
+ }
+}
+
+/* collects information from each array member in device element list (each array memeber = element) */
+
+static void HIDGetElementsCFArrayHandler (const void * value, void * parameter)
+{
+ if (CFGetTypeID (value) == CFDictionaryGetTypeID ())
+ HIDAddElement ((CFTypeRef) value, (recDevice *) parameter);
+}
+
+/* handles retrieval of element information from arrays of elements in device IO registry information */
+
+static void HIDGetElements (CFTypeRef refElementCurrent, recDevice *pDevice)
+{
+ CFTypeID type = CFGetTypeID (refElementCurrent);
+ if (type == CFArrayGetTypeID()) /* if element is an array */
+ {
+ CFRange range = {0, CFArrayGetCount (refElementCurrent)};
+ /* CountElementsCFArrayHandler called for each array member */
+ CFArrayApplyFunction (refElementCurrent, range, HIDGetElementsCFArrayHandler, pDevice);
+ }
+}
+
+/* handles extracting element information from element collection CF types
+ * used from top level element decoding and hierarchy deconstruction to flatten device element list
+ */
+
+static void HIDGetCollectionElements (CFMutableDictionaryRef deviceProperties, recDevice *pDevice)
+{
+ CFTypeRef refElementTop = CFDictionaryGetValue (deviceProperties, CFSTR(kIOHIDElementKey));
+ if (refElementTop)
+ HIDGetElements (refElementTop, pDevice);
+}
+
+/* use top level element usage page and usage to discern device usage page and usage setting appropriate vlaues in device record */
+
+static void HIDTopLevelElementHandler (const void * value, void * parameter)
+{
+ CFTypeRef refCF = 0;
+ if (CFGetTypeID (value) != CFDictionaryGetTypeID ())
+ return;
+ refCF = CFDictionaryGetValue (value, CFSTR(kIOHIDElementUsagePageKey));
+ if (!CFNumberGetValue (refCF, kCFNumberLongType, &((recDevice *) parameter)->usagePage))
+ SDL_SetError ("CFNumberGetValue error retrieving pDevice->usagePage.");
+ refCF = CFDictionaryGetValue (value, CFSTR(kIOHIDElementUsageKey));
+ if (!CFNumberGetValue (refCF, kCFNumberLongType, &((recDevice *) parameter)->usage))
+ SDL_SetError ("CFNumberGetValue error retrieving pDevice->usage.");
+}
+
+/* extracts device info from CF dictionary records in IO registry */
+
+static void HIDGetDeviceInfo (io_object_t hidDevice, CFMutableDictionaryRef hidProperties, recDevice *pDevice)
+{
+ CFMutableDictionaryRef usbProperties = 0;
+ io_registry_entry_t parent1, parent2;
+
+ /* Mac OS X currently is not mirroring all USB properties to HID page so need to look at USB device page also
+ * get dictionary for usb properties: step up two levels and get CF dictionary for USB properties
+ */
+ if ((KERN_SUCCESS == IORegistryEntryGetParentEntry (hidDevice, kIOServicePlane, &parent1)) &&
+ (KERN_SUCCESS == IORegistryEntryGetParentEntry (parent1, kIOServicePlane, &parent2)) &&
+ (KERN_SUCCESS == IORegistryEntryCreateCFProperties (parent2, &usbProperties, kCFAllocatorDefault, kNilOptions)))
+ {
+ if (usbProperties)
+ {
+ CFTypeRef refCF = 0;
+ /* get device info
+ * try hid dictionary first, if fail then go to usb dictionary
+ */
+
+
+ /* get product name */
+ refCF = CFDictionaryGetValue (hidProperties, CFSTR(kIOHIDProductKey));
+ if (!refCF)
+ refCF = CFDictionaryGetValue (usbProperties, CFSTR("USB Product Name"));
+ if (refCF)
+ {
+ if (!CFStringGetCString (refCF, pDevice->product, 256, CFStringGetSystemEncoding ()))
+ SDL_SetError ("CFStringGetCString error retrieving pDevice->product.");
+ }
+
+ /* get usage page and usage */
+ refCF = CFDictionaryGetValue (hidProperties, CFSTR(kIOHIDPrimaryUsagePageKey));
+ if (refCF)
+ {
+ if (!CFNumberGetValue (refCF, kCFNumberLongType, &pDevice->usagePage))
+ SDL_SetError ("CFNumberGetValue error retrieving pDevice->usagePage.");
+ refCF = CFDictionaryGetValue (hidProperties, CFSTR(kIOHIDPrimaryUsageKey));
+ if (refCF)
+ if (!CFNumberGetValue (refCF, kCFNumberLongType, &pDevice->usage))
+ SDL_SetError ("CFNumberGetValue error retrieving pDevice->usage.");
+ }
+
+ if (NULL == refCF) /* get top level element HID usage page or usage */
+ {
+ /* use top level element instead */
+ CFTypeRef refCFTopElement = 0;
+ refCFTopElement = CFDictionaryGetValue (hidProperties, CFSTR(kIOHIDElementKey));
+ {
+ /* refCFTopElement points to an array of element dictionaries */
+ CFRange range = {0, CFArrayGetCount (refCFTopElement)};
+ CFArrayApplyFunction (refCFTopElement, range, HIDTopLevelElementHandler, pDevice);
+ }
+ }
+
+ CFRelease (usbProperties);
+ }
+ else
+ SDL_SetError ("IORegistryEntryCreateCFProperties failed to create usbProperties.");
+
+ if (kIOReturnSuccess != IOObjectRelease (parent2))
+ SDL_SetError ("IOObjectRelease error with parent2.");
+ if (kIOReturnSuccess != IOObjectRelease (parent1))
+ SDL_SetError ("IOObjectRelease error with parent1.");
+ }
+}
+
+
+static recDevice *HIDBuildDevice (io_object_t hidDevice)
+{
+ recDevice *pDevice = (recDevice *) NewPtrClear (sizeof (recDevice));
+ if (pDevice)
+ {
+ /* get dictionary for HID properties */
+ CFMutableDictionaryRef hidProperties = 0;
+ kern_return_t result = IORegistryEntryCreateCFProperties (hidDevice, &hidProperties, kCFAllocatorDefault, kNilOptions);
+ if ((result == KERN_SUCCESS) && hidProperties)
+ {
+ /* create device interface */
+ result = HIDCreateOpenDeviceInterface (hidDevice, pDevice);
+ if (kIOReturnSuccess == result)
+ {
+ HIDGetDeviceInfo (hidDevice, hidProperties, pDevice); /* hidDevice used to find parents in registry tree */
+ HIDGetCollectionElements (hidProperties, pDevice);
+ }
+ else
+ {
+ DisposePtr((Ptr)pDevice);
+ pDevice = NULL;
+ }
+ CFRelease (hidProperties);
+ }
+ else
+ {
+ DisposePtr((Ptr)pDevice);
+ pDevice = NULL;
+ }
+ }
+ return pDevice;
+}
+
+/* disposes of the element list associated with a device and the memory associated with the list
+ */
+
+static void HIDDisposeElementList (recElement **elementList)
+{
+ recElement *pElement = *elementList;
+ while (pElement)
+ {
+ recElement *pElementNext = pElement->pNext;
+ DisposePtr ((Ptr) pElement);
+ pElement = pElementNext;
+ }
+ *elementList = NULL;
+}
+
+/* disposes of a single device, closing and releaseing interface, freeing memory fro device and elements, setting device pointer to NULL
+ * all your device no longer belong to us... (i.e., you do not 'own' the device anymore)
+ */
+
+static recDevice *HIDDisposeDevice (recDevice **ppDevice)
+{
+ kern_return_t result = KERN_SUCCESS;
+ recDevice *pDeviceNext = NULL;
+ if (*ppDevice)
+ {
+ /* save next device prior to disposing of this device */
+ pDeviceNext = (*ppDevice)->pNext;
+
+ /* free element lists */
+ HIDDisposeElementList (&(*ppDevice)->firstAxis);
+ HIDDisposeElementList (&(*ppDevice)->firstButton);
+ HIDDisposeElementList (&(*ppDevice)->firstHat);
+
+ result = HIDCloseReleaseInterface (*ppDevice); /* function sanity checks interface value (now application does not own device) */
+ if (kIOReturnSuccess != result)
+ HIDReportErrorNum ("HIDCloseReleaseInterface failed when trying to dipose device.", result);
+ DisposePtr ((Ptr)*ppDevice);
+ *ppDevice = NULL;
+ }
+ return pDeviceNext;
+}
+
+
+/* Function to scan the system for joysticks.
+ * Joystick 0 should be the system default joystick.
+ * This function should return the number of available joysticks, or -1
+ * on an unrecoverable fatal error.
+ */
+int SDL_SYS_JoystickInit(void)
+{
+ IOReturn result = kIOReturnSuccess;
+ mach_port_t masterPort = 0;
+ io_iterator_t hidObjectIterator = 0;
+ CFMutableDictionaryRef hidMatchDictionary = NULL;
+ recDevice *device, *lastDevice;
+ io_object_t ioHIDDeviceObject = 0;
+
+ SDL_numjoysticks = 0;
+
+ if (gpDeviceList)
+ {
+ SDL_SetError("Joystick: Device list already inited.");
+ return -1;
+ }
+
+ result = IOMasterPort (bootstrap_port, &masterPort);
+ if (kIOReturnSuccess != result)
+ {
+ SDL_SetError("Joystick: IOMasterPort error with bootstrap_port.");
+ return -1;
+ }
+
+ /* Set up a matching dictionary to search I/O Registry by class name for all HID class devices. */
+ hidMatchDictionary = IOServiceMatching (kIOHIDDeviceKey);
+ if (hidMatchDictionary)
+ {
+ /* Add key for device type (joystick, in this case) to refine the matching dictionary. */
+
+ /* NOTE: we now perform this filtering later
+ UInt32 usagePage = kHIDPage_GenericDesktop;
+ UInt32 usage = kHIDUsage_GD_Joystick;
+ CFNumberRef refUsage = NULL, refUsagePage = NULL;
+
+ refUsage = CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &usage);
+ CFDictionarySetValue (hidMatchDictionary, CFSTR (kIOHIDPrimaryUsageKey), refUsage);
+ refUsagePage = CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &usagePage);
+ CFDictionarySetValue (hidMatchDictionary, CFSTR (kIOHIDPrimaryUsagePageKey), refUsagePage);
+ */
+ }
+ else
+ {
+ SDL_SetError("Joystick: Failed to get HID CFMutableDictionaryRef via IOServiceMatching.");
+ return -1;
+ }
+
+ /*/ Now search I/O Registry for matching devices. */
+ result = IOServiceGetMatchingServices (masterPort, hidMatchDictionary, &hidObjectIterator);
+ /* Check for errors */
+ if (kIOReturnSuccess != result)
+ {
+ SDL_SetError("Joystick: Couldn't create a HID object iterator.");
+ return -1;
+ }
+ if (!hidObjectIterator) /* there are no joysticks */
+ {
+ gpDeviceList = NULL;
+ SDL_numjoysticks = 0;
+ return 0;
+ }
+ /* IOServiceGetMatchingServices consumes a reference to the dictionary, so we don't need to release the dictionary ref. */
+
+ /* build flat linked list of devices from device iterator */
+
+ gpDeviceList = lastDevice = NULL;
+
+ while ((ioHIDDeviceObject = IOIteratorNext (hidObjectIterator)))
+ {
+ /* build a device record */
+ device = HIDBuildDevice (ioHIDDeviceObject);
+ if (!device)
+ continue;
+
+ /* dump device object, it is no longer needed */
+ result = IOObjectRelease (ioHIDDeviceObject);
+/* if (KERN_SUCCESS != result)
+ HIDReportErrorNum ("IOObjectRelease error with ioHIDDeviceObject.", result);
+*/
+
+ /* Filter device list to non-keyboard/mouse stuff */
+ if ( (device->usagePage != kHIDPage_GenericDesktop) ||
+ ((device->usage != kHIDUsage_GD_Joystick &&
+ device->usage != kHIDUsage_GD_GamePad &&
+ device->usage != kHIDUsage_GD_MultiAxisController)) ) {
+
+ /* release memory for the device */
+ HIDDisposeDevice (&device);
+ DisposePtr((Ptr)device);
+ continue;
+ }
+
+ /* Add device to the end of the list */
+ if (lastDevice)
+ lastDevice->pNext = device;
+ else
+ gpDeviceList = device;
+ lastDevice = device;
+ }
+ result = IOObjectRelease (hidObjectIterator); /* release the iterator */
+
+ /* Count the total number of devices we found */
+ device = gpDeviceList;
+ while (device)
+ {
+ SDL_numjoysticks++;
+ device = device->pNext;
+ }
+
+ return SDL_numjoysticks;
+}
+
+/* Function to get the device-dependent name of a joystick */
+const char *SDL_SYS_JoystickName(int index)
+{
+ recDevice *device = gpDeviceList;
+
+ for (; index > 0; index--)
+ device = device->pNext;
+
+ return device->product;
+}
+
+/* Function to open a joystick for use.
+ * The joystick to open is specified by the index field of the joystick.
+ * This should fill the nbuttons and naxes fields of the joystick structure.
+ * It returns 0, or -1 if there is an error.
+ */
+int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
+{
+ recDevice *device = gpDeviceList;
+ int index;
+
+ for (index = joystick->index; index > 0; index--)
+ device = device->pNext;
+
+ joystick->hwdata = device;
+ joystick->name = device->product;
+
+ joystick->naxes = device->axes;
+ joystick->nhats = device->hats;
+ joystick->nballs = 0;
+ joystick->nbuttons = device->buttons;
+
+ return 0;
+}
+
+/* Function to update the state of a joystick - called as a device poll.
+ * This function shouldn't update the joystick structure directly,
+ * but instead should call SDL_PrivateJoystick*() to deliver events
+ * and update joystick device state.
+ */
+void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
+{
+ recDevice *device = joystick->hwdata;
+ recElement *element;
+ SInt32 value, range;
+ int i;
+
+ if (device->removed) /* device was unplugged; ignore it. */
+ {
+ if (device->uncentered)
+ {
+ device->uncentered = 0;
+
+ /* Tell the app that everything is centered/unpressed... */
+ for (i = 0; i < device->axes; i++)
+ SDL_PrivateJoystickAxis(joystick, i, 0);
+
+ for (i = 0; i < device->buttons; i++)
+ SDL_PrivateJoystickButton(joystick, i, 0);
+
+ for (i = 0; i < device->hats; i++)
+ SDL_PrivateJoystickHat(joystick, i, SDL_HAT_CENTERED);
+ }
+
+ return;
+ }
+
+ element = device->firstAxis;
+ i = 0;
+ while (element)
+ {
+ value = HIDScaledCalibratedValue(device, element, -32768, 32767);
+ if ( value != joystick->axes[i] )
+ SDL_PrivateJoystickAxis(joystick, i, value);
+ element = element->pNext;
+ ++i;
+ }
+
+ element = device->firstButton;
+ i = 0;
+ while (element)
+ {
+ value = HIDGetElementValue(device, element);
+ if (value > 1) /* handle pressure-sensitive buttons */
+ value = 1;
+ if ( value != joystick->buttons[i] )
+ SDL_PrivateJoystickButton(joystick, i, value);
+ element = element->pNext;
+ ++i;
+ }
+
+ element = device->firstHat;
+ i = 0;
+ while (element)
+ {
+ Uint8 pos = 0;
+
+ range = (element->max - element->min + 1);
+ value = HIDGetElementValue(device, element) - element->min;
+ if (range == 4) /* 4 position hatswitch - scale up value */
+ value *= 2;
+ else if (range != 8) /* Neither a 4 nor 8 positions - fall back to default position (centered) */
+ value = -1;
+ switch(value)
+ {
+ case 0:
+ pos = SDL_HAT_UP;
+ break;
+ case 1:
+ pos = SDL_HAT_RIGHTUP;
+ break;
+ case 2:
+ pos = SDL_HAT_RIGHT;
+ break;
+ case 3:
+ pos = SDL_HAT_RIGHTDOWN;
+ break;
+ case 4:
+ pos = SDL_HAT_DOWN;
+ break;
+ case 5:
+ pos = SDL_HAT_LEFTDOWN;
+ break;
+ case 6:
+ pos = SDL_HAT_LEFT;
+ break;
+ case 7:
+ pos = SDL_HAT_LEFTUP;
+ break;
+ default:
+ /* Every other value is mapped to center. We do that because some
+ * joysticks use 8 and some 15 for this value, and apparently
+ * there are even more variants out there - so we try to be generous.
+ */
+ pos = SDL_HAT_CENTERED;
+ break;
+ }
+ if ( pos != joystick->hats[i] )
+ SDL_PrivateJoystickHat(joystick, i, pos);
+ element = element->pNext;
+ ++i;
+ }
+
+ return;
+}
+
+/* Function to close a joystick after use */
+void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
+{
+ /* Should we do anything here? */
+ return;
+}
+
+/* Function to perform any system-specific joystick related cleanup */
+void SDL_SYS_JoystickQuit(void)
+{
+ while (NULL != gpDeviceList)
+ gpDeviceList = HIDDisposeDevice (&gpDeviceList);
+}
+
+#endif /* SDL_JOYSTICK_IOKIT */
diff --git a/distrib/sdl-1.2.15/src/joystick/dc/SDL_sysjoystick.c b/distrib/sdl-1.2.15/src/joystick/dc/SDL_sysjoystick.c
new file mode 100644
index 0000000..dc089e7
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/joystick/dc/SDL_sysjoystick.c
@@ -0,0 +1,193 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_JOYSTICK_DC
+
+#include "SDL_events.h"
+#include "SDL_joystick.h"
+#include "../SDL_sysjoystick.h"
+#include "../SDL_joystick_c.h"
+
+#include <dc/maple.h>
+#include <dc/maple/controller.h>
+
+#define MAX_JOYSTICKS 8 /* only 2 are supported in the multimedia API */
+#define MAX_AXES 6 /* each joystick can have up to 6 axes */
+#define MAX_BUTTONS 8 /* and 8 buttons */
+#define MAX_HATS 2
+
+#define JOYNAMELEN 8
+
+/* array to hold joystick ID values */
+static uint8 SYS_Joystick_addr[MAX_JOYSTICKS];
+
+/* The private structure used to keep track of a joystick */
+struct joystick_hwdata
+{
+ cont_cond_t prev_cond;
+ int prev_buttons;
+};
+
+/* Function to scan the system for joysticks.
+ * This function should set SDL_numjoysticks to the number of available
+ * joysticks. Joystick 0 should be the system default joystick.
+ * It should return 0, or -1 on an unrecoverable fatal error.
+ */
+int SDL_SYS_JoystickInit(void)
+{
+ int numdevs;
+
+ int p,u;
+
+ numdevs = 0;
+ for(p=0;p<MAPLE_PORT_COUNT;p++) {
+ for(u=0;u<MAPLE_UNIT_COUNT;u++) {
+ if (maple_device_func(p,u)&MAPLE_FUNC_CONTROLLER) {
+ SYS_Joystick_addr[numdevs] = maple_addr(p,u);
+ numdevs++;
+ }
+ }
+ }
+
+ return(numdevs);
+}
+
+/* Function to get the device-dependent name of a joystick */
+const char *SDL_SYS_JoystickName(int index)
+{
+ maple_device_t *dev;
+ if (maple_compat_resolve(SYS_Joystick_addr[index],&dev,MAPLE_FUNC_CONTROLLER)!=0) return NULL;
+ return dev->info.product_name;
+}
+
+/* Function to open a joystick for use.
+ The joystick to open is specified by the index field of the joystick.
+ This should fill the nbuttons and naxes fields of the joystick structure.
+ It returns 0, or -1 if there is an error.
+ */
+int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
+{
+ /* allocate memory for system specific hardware data */
+ joystick->hwdata = (struct joystick_hwdata *) SDL_malloc(sizeof(*joystick->hwdata));
+ if (joystick->hwdata == NULL)
+ {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
+
+ /* fill nbuttons, naxes, and nhats fields */
+ joystick->nbuttons = MAX_BUTTONS;
+ joystick->naxes = MAX_AXES;
+ joystick->nhats = MAX_HATS;
+ return(0);
+}
+
+
+/* Function to update the state of a joystick - called as a device poll.
+ * This function shouldn't update the joystick structure directly,
+ * but instead should call SDL_PrivateJoystick*() to deliver events
+ * and update joystick device state.
+ */
+
+void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
+{
+const int sdl_buttons[] = {
+ CONT_C,
+ CONT_B,
+ CONT_A,
+ CONT_START,
+ CONT_Z,
+ CONT_Y,
+ CONT_X,
+ CONT_D
+};
+
+ uint8 addr;
+ cont_cond_t cond,*prev_cond;
+ int buttons,prev_buttons,i,changed;
+
+ addr = SYS_Joystick_addr[joystick->index];
+ if (cont_get_cond(addr,&cond)<0) return;
+
+ buttons = cond.buttons;
+ prev_buttons = joystick->hwdata->prev_buttons;
+ changed = buttons^prev_buttons;
+
+ if ((changed)&(CONT_DPAD_UP|CONT_DPAD_DOWN|CONT_DPAD_LEFT|CONT_DPAD_RIGHT)) {
+ int hat = SDL_HAT_CENTERED;
+ if (buttons&CONT_DPAD_UP) hat|=SDL_HAT_UP;
+ if (buttons&CONT_DPAD_DOWN) hat|=SDL_HAT_DOWN;
+ if (buttons&CONT_DPAD_LEFT) hat|=SDL_HAT_LEFT;
+ if (buttons&CONT_DPAD_RIGHT) hat|=SDL_HAT_RIGHT;
+ SDL_PrivateJoystickHat(joystick, 0, hat);
+ }
+ if ((changed)&(CONT_DPAD2_UP|CONT_DPAD2_DOWN|CONT_DPAD2_LEFT|CONT_DPAD2_RIGHT)) {
+ int hat = SDL_HAT_CENTERED;
+ if (buttons&CONT_DPAD2_UP) hat|=SDL_HAT_UP;
+ if (buttons&CONT_DPAD2_DOWN) hat|=SDL_HAT_DOWN;
+ if (buttons&CONT_DPAD2_LEFT) hat|=SDL_HAT_LEFT;
+ if (buttons&CONT_DPAD2_RIGHT) hat|=SDL_HAT_RIGHT;
+ SDL_PrivateJoystickHat(joystick, 1, hat);
+ }
+
+ for(i=0;i<sizeof(sdl_buttons)/sizeof(sdl_buttons[0]);i++) {
+ if (changed & sdl_buttons[i]) {
+ SDL_PrivateJoystickButton(joystick, i, (buttons & sdl_buttons[i])?SDL_PRESSED:SDL_RELEASED);
+ }
+ }
+
+ prev_cond = &joystick->hwdata->prev_cond;
+ if (cond.joyx!=prev_cond->joyx)
+ SDL_PrivateJoystickAxis(joystick, 0, cond.joyx-128);
+ if (cond.joyy!=prev_cond->joyy)
+ SDL_PrivateJoystickAxis(joystick, 1, cond.joyy-128);
+ if (cond.rtrig!=prev_cond->rtrig)
+ SDL_PrivateJoystickAxis(joystick, 2, cond.rtrig);
+ if (cond.ltrig!=prev_cond->ltrig)
+ SDL_PrivateJoystickAxis(joystick, 3, cond.ltrig);
+ if (cond.joy2x!=prev_cond->joy2x)
+ SDL_PrivateJoystickAxis(joystick, 4, cond.joy2x-128);
+ if (cond.joy2y!=prev_cond->joy2y)
+ SDL_PrivateJoystickAxis(joystick, 5, cond.joy2y-128);
+
+ joystick->hwdata->prev_buttons = buttons;
+ joystick->hwdata->prev_cond = cond;
+}
+
+/* Function to close a joystick after use */
+void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
+{
+ if (joystick->hwdata != NULL) {
+ /* free system specific hardware data */
+ SDL_free(joystick->hwdata);
+ }
+}
+
+/* Function to perform any system-specific joystick related cleanup */
+void SDL_SYS_JoystickQuit(void)
+{
+ return;
+}
+
+#endif /* SDL_JOYSTICK_DC */
diff --git a/distrib/sdl-1.2.15/src/joystick/dummy/SDL_sysjoystick.c b/distrib/sdl-1.2.15/src/joystick/dummy/SDL_sysjoystick.c
new file mode 100644
index 0000000..3a1aae7
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/joystick/dummy/SDL_sysjoystick.c
@@ -0,0 +1,83 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#if defined(SDL_JOYSTICK_DUMMY) || defined(SDL_JOYSTICK_DISABLED)
+
+/* This is the system specific header for the SDL joystick API */
+
+#include "SDL_joystick.h"
+#include "../SDL_sysjoystick.h"
+#include "../SDL_joystick_c.h"
+
+/* Function to scan the system for joysticks.
+ * This function should set SDL_numjoysticks to the number of available
+ * joysticks. Joystick 0 should be the system default joystick.
+ * It should return 0, or -1 on an unrecoverable fatal error.
+ */
+int SDL_SYS_JoystickInit(void)
+{
+ SDL_numjoysticks = 0;
+ return(0);
+}
+
+/* Function to get the device-dependent name of a joystick */
+const char *SDL_SYS_JoystickName(int index)
+{
+ SDL_SetError("Logic error: No joysticks available");
+ return(NULL);
+}
+
+/* Function to open a joystick for use.
+ The joystick to open is specified by the index field of the joystick.
+ This should fill the nbuttons and naxes fields of the joystick structure.
+ It returns 0, or -1 if there is an error.
+ */
+int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
+{
+ SDL_SetError("Logic error: No joysticks available");
+ return(-1);
+}
+
+/* Function to update the state of a joystick - called as a device poll.
+ * This function shouldn't update the joystick structure directly,
+ * but instead should call SDL_PrivateJoystick*() to deliver events
+ * and update joystick device state.
+ */
+void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
+{
+ return;
+}
+
+/* Function to close a joystick after use */
+void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
+{
+ return;
+}
+
+/* Function to perform any system-specific joystick related cleanup */
+void SDL_SYS_JoystickQuit(void)
+{
+ return;
+}
+
+#endif /* SDL_JOYSTICK_DUMMY || SDL_JOYSTICK_DISABLED */
diff --git a/distrib/sdl-1.2.15/src/joystick/linux/SDL_sysjoystick.c b/distrib/sdl-1.2.15/src/joystick/linux/SDL_sysjoystick.c
new file mode 100644
index 0000000..ee43974
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/joystick/linux/SDL_sysjoystick.c
@@ -0,0 +1,1218 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_JOYSTICK_LINUX
+
+/* This is the system specific header for the SDL joystick API */
+
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <limits.h> /* For the definition of PATH_MAX */
+#include <linux/joystick.h>
+#if SDL_INPUT_LINUXEV
+#include <linux/input.h>
+#endif
+
+#include "SDL_joystick.h"
+#include "../SDL_sysjoystick.h"
+#include "../SDL_joystick_c.h"
+
+/* Special joystick configurations */
+static struct {
+ const char *name;
+ int naxes;
+ int nhats;
+ int nballs;
+} special_joysticks[] = {
+ { "MadCatz Panther XL", 3, 2, 1 }, /* We don't handle rudder (axis 8) */
+ { "SideWinder Precision Pro", 4, 1, 0 },
+ { "SideWinder 3D Pro", 4, 1, 0 },
+ { "Microsoft SideWinder 3D Pro", 4, 1, 0 },
+ { "Microsoft SideWinder Precision Pro", 4, 1, 0 },
+ { "Microsoft SideWinder Dual Strike USB version 1.0", 2, 1, 0 },
+ { "WingMan Interceptor", 3, 3, 0 },
+ { "WingMan Extreme Digital 3D", 4, 1, 0 },
+ { "Microsoft SideWinder Precision 2 Joystick", 4, 1, 0 },
+ { "Logitech Inc. WingMan Extreme Digital 3D", 4, 1, 0 },
+ { "Saitek Saitek X45", 6, 1, 0 }
+};
+
+/* It looks like newer kernels have the logical mapping at the driver level */
+#define NO_LOGICAL_JOYSTICKS
+
+#ifndef NO_LOGICAL_JOYSTICKS
+
+/*
+ Some USB HIDs show up as a single joystick even though they actually
+ control 2 or more joysticks.
+*/
+/*
+ This code handles the MP-8800 (Quad) and MP-8866 (Dual), which can
+ be identified by their transparent blue design. It's quite trivial
+ to add other joysticks with similar quirky behavior.
+ -id
+*/
+
+struct joystick_logical_mapping {
+ int njoy;
+ int nthing;
+};
+
+/*
+ {logical joy, logical axis},
+ {logical joy, logical hat},
+ {logical joy, logical ball},
+ {logical joy, logical button}
+*/
+
+static struct joystick_logical_mapping mp88xx_1_logical_axismap[] = {
+ {0,0},{0,1},{0,2},{0,3},{0,4},{0,5}
+};
+static struct joystick_logical_mapping mp88xx_1_logical_buttonmap[] = {
+ {0,0},{0,1},{0,2},{0,3},{0,4},{0,5},{0,6},{0,7},{0,8},{0,9},{0,10},{0,11}
+};
+
+static struct joystick_logical_mapping mp88xx_2_logical_axismap[] = {
+ {0,0},{0,1},{0,2},{1,0},{1,1},{0,3},
+ {1,2},{1,3},{0,4},{0,5},{1,4},{1,5}
+};
+static struct joystick_logical_mapping mp88xx_2_logical_buttonmap[] = {
+ {0,0},{0,1},{0,2},{0,3},{0,4},{0,5},{0,6},{0,7},{0,8},{0,9},{0,10},{0,11},
+ {1,0},{1,1},{1,2},{1,3},{1,4},{1,5},{1,6},{1,7},{1,8},{1,9},{1,10},{1,11}
+};
+
+static struct joystick_logical_mapping mp88xx_3_logical_axismap[] = {
+ {0,0},{0,1},{0,2},{1,0},{1,1},{0,3},
+ {1,2},{1,3},{2,0},{2,1},{2,2},{2,3},
+ {0,4},{0,5},{1,4},{1,5},{2,4},{2,5}
+};
+static struct joystick_logical_mapping mp88xx_3_logical_buttonmap[] = {
+ {0,0},{0,1},{0,2},{0,3},{0,4},{0,5},{0,6},{0,7},{0,8},{0,9},{0,10},{0,11},
+ {1,0},{1,1},{1,2},{1,3},{1,4},{1,5},{1,6},{1,7},{1,8},{1,9},{1,10},{1,11},
+ {2,0},{2,1},{2,2},{2,3},{2,4},{2,5},{2,6},{2,7},{2,8},{2,9},{2,10},{2,11}
+};
+
+static struct joystick_logical_mapping mp88xx_4_logical_axismap[] = {
+ {0,0},{0,1},{0,2},{1,0},{1,1},{0,3},
+ {1,2},{1,3},{2,0},{2,1},{2,2},{2,3},
+ {3,0},{3,1},{3,2},{3,3},{0,4},{0,5},
+ {1,4},{1,5},{2,4},{2,5},{3,4},{3,5}
+};
+static struct joystick_logical_mapping mp88xx_4_logical_buttonmap[] = {
+ {0,0},{0,1},{0,2},{0,3},{0,4},{0,5},{0,6},{0,7},{0,8},{0,9},{0,10},{0,11},
+ {1,0},{1,1},{1,2},{1,3},{1,4},{1,5},{1,6},{1,7},{1,8},{1,9},{1,10},{1,11},
+ {2,0},{2,1},{2,2},{2,3},{2,4},{2,5},{2,6},{2,7},{2,8},{2,9},{2,10},{2,11},
+ {3,0},{3,1},{3,2},{3,3},{3,4},{3,5},{3,6},{3,7},{3,8},{3,9},{3,10},{3,11}
+};
+
+struct joystick_logical_layout {
+ int naxes;
+ int nhats;
+ int nballs;
+ int nbuttons;
+};
+
+static struct joystick_logical_layout mp88xx_1_logical_layout[] = {
+ {6, 0, 0, 12}
+};
+static struct joystick_logical_layout mp88xx_2_logical_layout[] = {
+ {6, 0, 0, 12},
+ {6, 0, 0, 12}
+};
+static struct joystick_logical_layout mp88xx_3_logical_layout[] = {
+ {6, 0, 0, 12},
+ {6, 0, 0, 12},
+ {6, 0, 0, 12}
+};
+static struct joystick_logical_layout mp88xx_4_logical_layout[] = {
+ {6, 0, 0, 12},
+ {6, 0, 0, 12},
+ {6, 0, 0, 12},
+ {6, 0, 0, 12}
+};
+
+/*
+ This array sets up a means of mapping a single physical joystick to
+ multiple logical joysticks. (djm)
+
+ njoys
+ the number of logical joysticks
+
+ layouts
+ an array of layout structures, one to describe each logical joystick
+
+ axes, hats, balls, buttons
+ arrays that map a physical thingy to a logical thingy
+ */
+struct joystick_logicalmap {
+ const char *name;
+ int nbuttons;
+ int njoys;
+ struct joystick_logical_layout *layout;
+ struct joystick_logical_mapping *axismap;
+ struct joystick_logical_mapping *hatmap;
+ struct joystick_logical_mapping *ballmap;
+ struct joystick_logical_mapping *buttonmap;
+};
+
+static struct joystick_logicalmap joystick_logicalmap[] = {
+ {
+ "WiseGroup.,Ltd MP-8866 Dual USB Joypad",
+ 12,
+ 1,
+ mp88xx_1_logical_layout,
+ mp88xx_1_logical_axismap,
+ NULL,
+ NULL,
+ mp88xx_1_logical_buttonmap
+ },
+ {
+ "WiseGroup.,Ltd MP-8866 Dual USB Joypad",
+ 24,
+ 2,
+ mp88xx_2_logical_layout,
+ mp88xx_2_logical_axismap,
+ NULL,
+ NULL,
+ mp88xx_2_logical_buttonmap
+ },
+ {
+ "WiseGroup.,Ltd MP-8800 Quad USB Joypad",
+ 12,
+ 1,
+ mp88xx_1_logical_layout,
+ mp88xx_1_logical_axismap,
+ NULL,
+ NULL,
+ mp88xx_1_logical_buttonmap
+ },
+ {
+ "WiseGroup.,Ltd MP-8800 Quad USB Joypad",
+ 24,
+ 2,
+ mp88xx_2_logical_layout,
+ mp88xx_2_logical_axismap,
+ NULL,
+ NULL,
+ mp88xx_2_logical_buttonmap
+ },
+ {
+ "WiseGroup.,Ltd MP-8800 Quad USB Joypad",
+ 36,
+ 3,
+ mp88xx_3_logical_layout,
+ mp88xx_3_logical_axismap,
+ NULL,
+ NULL,
+ mp88xx_3_logical_buttonmap
+ },
+ {
+ "WiseGroup.,Ltd MP-8800 Quad USB Joypad",
+ 48,
+ 4,
+ mp88xx_4_logical_layout,
+ mp88xx_4_logical_axismap,
+ NULL,
+ NULL,
+ mp88xx_4_logical_buttonmap
+ }
+};
+
+/* find the head of a linked list, given a point in it
+ */
+#define SDL_joylist_head(i, start)\
+ for(i = start; SDL_joylist[i].fname == NULL;) i = SDL_joylist[i].prev;
+
+#define SDL_logical_joydecl(d) d
+
+
+#else
+
+#define SDL_logical_joydecl(d)
+
+#endif /* USE_LOGICAL_JOYSTICKS */
+
+/* The maximum number of joysticks we'll detect */
+#define MAX_JOYSTICKS 32
+
+/* A list of available joysticks */
+static struct
+{
+ char* fname;
+#ifndef NO_LOGICAL_JOYSTICKS
+ SDL_Joystick* joy;
+ struct joystick_logicalmap* map;
+ int prev;
+ int next;
+ int logicalno;
+#endif /* USE_LOGICAL_JOYSTICKS */
+} SDL_joylist[MAX_JOYSTICKS];
+
+
+/* The private structure used to keep track of a joystick */
+struct joystick_hwdata {
+ int fd;
+ /* The current linux joystick driver maps hats to two axes */
+ struct hwdata_hat {
+ int axis[2];
+ } *hats;
+ /* The current linux joystick driver maps balls to two axes */
+ struct hwdata_ball {
+ int axis[2];
+ } *balls;
+
+ /* Support for the Linux 2.4 unified input interface */
+#if SDL_INPUT_LINUXEV
+ SDL_bool is_hid;
+ Uint8 key_map[KEY_MAX-BTN_MISC];
+ Uint8 abs_map[ABS_MAX];
+ struct axis_correct {
+ int used;
+ int coef[3];
+ } abs_correct[ABS_MAX];
+#endif
+};
+
+
+#ifndef NO_LOGICAL_JOYSTICKS
+
+static int CountLogicalJoysticks(int max)
+{
+ register int i, j, k, ret, prev;
+ const char* name;
+ int nbuttons, fd;
+ unsigned char n;
+
+ ret = 0;
+
+ for(i = 0; i < max; i++) {
+ name = SDL_SYS_JoystickName(i);
+
+ fd = open(SDL_joylist[i].fname, O_RDONLY, 0);
+ if ( fd >= 0 ) {
+ if ( ioctl(fd, JSIOCGBUTTONS, &n) < 0 ) {
+ nbuttons = -1;
+ } else {
+ nbuttons = n;
+ }
+ close(fd);
+ }
+ else {
+ nbuttons=-1;
+ }
+
+ if (name) {
+ for(j = 0; j < SDL_arraysize(joystick_logicalmap); j++) {
+ if (!SDL_strcmp(name, joystick_logicalmap[j].name) && (nbuttons==-1 || nbuttons==joystick_logicalmap[j].nbuttons)) {
+ prev = i;
+ SDL_joylist[prev].map = &(joystick_logicalmap[j]);
+
+ for(k = 1; k < joystick_logicalmap[j].njoys; k++) {
+ SDL_joylist[prev].next = max + ret;
+ SDL_joylist[max+ret].prev = prev;
+
+ prev = max + ret;
+ SDL_joylist[prev].logicalno = k;
+ SDL_joylist[prev].map = &(joystick_logicalmap[j]);
+ ret++;
+ }
+
+ break;
+ }
+ }
+ }
+ }
+
+ return ret;
+}
+
+static void LogicalSuffix(int logicalno, char* namebuf, int len)
+{
+ register int slen;
+ const static char suffixs[] =
+ "01020304050607080910111213141516171819"
+ "20212223242526272829303132";
+ const char* suffix;
+ slen = SDL_strlen(namebuf);
+ suffix = NULL;
+
+ if (logicalno*2<sizeof(suffixs))
+ suffix = suffixs + (logicalno*2);
+
+ if (slen + 4 < len && suffix) {
+ namebuf[slen++] = ' ';
+ namebuf[slen++] = '#';
+ namebuf[slen++] = suffix[0];
+ namebuf[slen++] = suffix[1];
+ namebuf[slen++] = 0;
+ }
+}
+
+#endif /* USE_LOGICAL_JOYSTICKS */
+
+#if SDL_INPUT_LINUXEV
+#define test_bit(nr, addr) \
+ (((1UL << ((nr) % (sizeof(long) * 8))) & ((addr)[(nr) / (sizeof(long) * 8)])) != 0)
+#define NBITS(x) ((((x)-1)/(sizeof(long) * 8))+1)
+
+static int EV_IsJoystick(int fd)
+{
+ unsigned long evbit[NBITS(EV_MAX)] = { 0 };
+ unsigned long keybit[NBITS(KEY_MAX)] = { 0 };
+ unsigned long absbit[NBITS(ABS_MAX)] = { 0 };
+
+ if ( (ioctl(fd, EVIOCGBIT(0, sizeof(evbit)), evbit) < 0) ||
+ (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) < 0) ||
+ (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) < 0) ) {
+ return(0);
+ }
+ if (!(test_bit(EV_KEY, evbit) && test_bit(EV_ABS, evbit) &&
+ test_bit(ABS_X, absbit) && test_bit(ABS_Y, absbit) &&
+ (test_bit(BTN_TRIGGER, keybit) || test_bit(BTN_A, keybit) || test_bit(BTN_1, keybit)))) return 0;
+ return(1);
+}
+
+#endif /* SDL_INPUT_LINUXEV */
+
+/* Function to scan the system for joysticks */
+int SDL_SYS_JoystickInit(void)
+{
+ /* The base path of the joystick devices */
+ const char *joydev_pattern[] = {
+#if SDL_INPUT_LINUXEV
+ "/dev/input/event%d",
+#endif
+ "/dev/input/js%d",
+ "/dev/js%d"
+ };
+ int numjoysticks;
+ int i, j;
+ int fd;
+ char path[PATH_MAX];
+ dev_t dev_nums[MAX_JOYSTICKS]; /* major/minor device numbers */
+ struct stat sb;
+ int n, duplicate;
+
+ numjoysticks = 0;
+
+ /* First see if the user specified one or more joysticks to use */
+ if ( SDL_getenv("SDL_JOYSTICK_DEVICE") != NULL ) {
+ char *envcopy, *envpath, *delim;
+ envcopy = SDL_strdup(SDL_getenv("SDL_JOYSTICK_DEVICE"));
+ envpath = envcopy;
+ while ( envpath != NULL ) {
+ delim = SDL_strchr(envpath, ':');
+ if ( delim != NULL ) {
+ *delim++ = '\0';
+ }
+ if ( stat(envpath, &sb) == 0 ) {
+ fd = open(envpath, O_RDONLY, 0);
+ if ( fd >= 0 ) {
+ /* Assume the user knows what they're doing. */
+ SDL_joylist[numjoysticks].fname = SDL_strdup(envpath);
+ if ( SDL_joylist[numjoysticks].fname ) {
+ dev_nums[numjoysticks] = sb.st_rdev;
+ ++numjoysticks;
+ }
+ close(fd);
+ }
+ }
+ envpath = delim;
+ }
+ SDL_free(envcopy);
+ }
+
+ for ( i=0; i<SDL_arraysize(joydev_pattern); ++i ) {
+ for ( j=0; j < MAX_JOYSTICKS; ++j ) {
+ SDL_snprintf(path, SDL_arraysize(path), joydev_pattern[i], j);
+
+ /* rcg06302000 replaced access(F_OK) call with stat().
+ * stat() will fail if the file doesn't exist, so it's
+ * equivalent behaviour.
+ */
+ if ( stat(path, &sb) == 0 ) {
+ /* Check to make sure it's not already in list.
+ * This happens when we see a stick via symlink.
+ */
+ duplicate = 0;
+ for (n=0; (n<numjoysticks) && !duplicate; ++n) {
+ if ( sb.st_rdev == dev_nums[n] ) {
+ duplicate = 1;
+ }
+ }
+ if (duplicate) {
+ continue;
+ }
+
+ fd = open(path, O_RDONLY, 0);
+ if ( fd < 0 ) {
+ continue;
+ }
+#if SDL_INPUT_LINUXEV
+#ifdef DEBUG_INPUT_EVENTS
+ printf("Checking %s\n", path);
+#endif
+ if ( (i == 0) && ! EV_IsJoystick(fd) ) {
+ close(fd);
+ continue;
+ }
+#endif
+ close(fd);
+
+ /* We're fine, add this joystick */
+ SDL_joylist[numjoysticks].fname = SDL_strdup(path);
+ if ( SDL_joylist[numjoysticks].fname ) {
+ dev_nums[numjoysticks] = sb.st_rdev;
+ ++numjoysticks;
+ }
+ }
+ }
+
+#if SDL_INPUT_LINUXEV
+ /* This is a special case...
+ If the event devices are valid then the joystick devices
+ will be duplicates but without extra information about their
+ hats or balls. Unfortunately, the event devices can't
+ currently be calibrated, so it's a win-lose situation.
+ So : /dev/input/eventX = /dev/input/jsY = /dev/jsY
+ */
+ if ( (i == 0) && (numjoysticks > 0) )
+ break;
+#endif
+ }
+#ifndef NO_LOGICAL_JOYSTICKS
+ numjoysticks += CountLogicalJoysticks(numjoysticks);
+#endif
+
+ return(numjoysticks);
+}
+
+/* Function to get the device-dependent name of a joystick */
+const char *SDL_SYS_JoystickName(int index)
+{
+ int fd;
+ static char namebuf[128];
+ char *name;
+ SDL_logical_joydecl(int oindex = index);
+
+#ifndef NO_LOGICAL_JOYSTICKS
+ SDL_joylist_head(index, index);
+#endif
+ name = NULL;
+ fd = open(SDL_joylist[index].fname, O_RDONLY, 0);
+ if ( fd >= 0 ) {
+ if (
+#if SDL_INPUT_LINUXEV
+ (ioctl(fd, EVIOCGNAME(sizeof(namebuf)), namebuf) <= 0) &&
+#endif
+ (ioctl(fd, JSIOCGNAME(sizeof(namebuf)), namebuf) <= 0) ) {
+ name = SDL_joylist[index].fname;
+ } else {
+ name = namebuf;
+ }
+ close(fd);
+
+
+#ifndef NO_LOGICAL_JOYSTICKS
+ if (SDL_joylist[oindex].prev || SDL_joylist[oindex].next || index!=oindex)
+ {
+ LogicalSuffix(SDL_joylist[oindex].logicalno, namebuf, 128);
+ }
+#endif
+ }
+ return name;
+}
+
+static int allocate_hatdata(SDL_Joystick *joystick)
+{
+ int i;
+
+ joystick->hwdata->hats = (struct hwdata_hat *)SDL_malloc(
+ joystick->nhats * sizeof(struct hwdata_hat));
+ if ( joystick->hwdata->hats == NULL ) {
+ return(-1);
+ }
+ for ( i=0; i<joystick->nhats; ++i ) {
+ joystick->hwdata->hats[i].axis[0] = 1;
+ joystick->hwdata->hats[i].axis[1] = 1;
+ }
+ return(0);
+}
+
+static int allocate_balldata(SDL_Joystick *joystick)
+{
+ int i;
+
+ joystick->hwdata->balls = (struct hwdata_ball *)SDL_malloc(
+ joystick->nballs * sizeof(struct hwdata_ball));
+ if ( joystick->hwdata->balls == NULL ) {
+ return(-1);
+ }
+ for ( i=0; i<joystick->nballs; ++i ) {
+ joystick->hwdata->balls[i].axis[0] = 0;
+ joystick->hwdata->balls[i].axis[1] = 0;
+ }
+ return(0);
+}
+
+static SDL_bool JS_ConfigJoystick(SDL_Joystick *joystick, int fd)
+{
+ SDL_bool handled;
+ unsigned char n;
+ int tmp_naxes, tmp_nhats, tmp_nballs;
+ const char *name;
+ char *env, env_name[128];
+ int i;
+
+ handled = SDL_FALSE;
+
+ /* Default joystick device settings */
+ if ( ioctl(fd, JSIOCGAXES, &n) < 0 ) {
+ joystick->naxes = 2;
+ } else {
+ joystick->naxes = n;
+ }
+ if ( ioctl(fd, JSIOCGBUTTONS, &n) < 0 ) {
+ joystick->nbuttons = 2;
+ } else {
+ joystick->nbuttons = n;
+ }
+
+ name = SDL_SYS_JoystickName(joystick->index);
+
+ /* Generic analog joystick support */
+ if ( SDL_strstr(name, "Analog") == name && SDL_strstr(name, "-hat") ) {
+ if ( SDL_sscanf(name,"Analog %d-axis %*d-button %d-hat",
+ &tmp_naxes, &tmp_nhats) == 2 ) {
+
+ joystick->naxes = tmp_naxes;
+ joystick->nhats = tmp_nhats;
+
+ handled = SDL_TRUE;
+ }
+ }
+
+ /* Special joystick support */
+ for ( i=0; i < SDL_arraysize(special_joysticks); ++i ) {
+ if ( SDL_strcmp(name, special_joysticks[i].name) == 0 ) {
+
+ joystick->naxes = special_joysticks[i].naxes;
+ joystick->nhats = special_joysticks[i].nhats;
+ joystick->nballs = special_joysticks[i].nballs;
+
+ handled = SDL_TRUE;
+ break;
+ }
+ }
+
+ /* User environment joystick support */
+ if ( (env = SDL_getenv("SDL_LINUX_JOYSTICK")) ) {
+ *env_name = '\0';
+ if ( *env == '\'' && SDL_sscanf(env, "'%[^']s'", env_name) == 1 )
+ env += SDL_strlen(env_name)+2;
+ else if ( SDL_sscanf(env, "%s", env_name) == 1 )
+ env += SDL_strlen(env_name);
+
+ if ( SDL_strcmp(name, env_name) == 0 ) {
+
+ if ( SDL_sscanf(env, "%d %d %d", &tmp_naxes, &tmp_nhats,
+ &tmp_nballs) == 3 ) {
+
+ joystick->naxes = tmp_naxes;
+ joystick->nhats = tmp_nhats;
+ joystick->nballs = tmp_nballs;
+
+ handled = SDL_TRUE;
+ }
+ }
+ }
+
+ /* Remap hats and balls */
+ if (handled) {
+ if ( joystick->nhats > 0 ) {
+ if ( allocate_hatdata(joystick) < 0 ) {
+ joystick->nhats = 0;
+ }
+ }
+ if ( joystick->nballs > 0 ) {
+ if ( allocate_balldata(joystick) < 0 ) {
+ joystick->nballs = 0;
+ }
+ }
+ }
+
+ return(handled);
+}
+
+#if SDL_INPUT_LINUXEV
+
+static SDL_bool EV_ConfigJoystick(SDL_Joystick *joystick, int fd)
+{
+ int i, t;
+ unsigned long keybit[NBITS(KEY_MAX)] = { 0 };
+ unsigned long absbit[NBITS(ABS_MAX)] = { 0 };
+ unsigned long relbit[NBITS(REL_MAX)] = { 0 };
+
+ /* See if this device uses the new unified event API */
+ if ( (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) >= 0) &&
+ (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) >= 0) &&
+ (ioctl(fd, EVIOCGBIT(EV_REL, sizeof(relbit)), relbit) >= 0) ) {
+ joystick->hwdata->is_hid = SDL_TRUE;
+
+ /* Get the number of buttons, axes, and other thingamajigs */
+ for ( i=BTN_JOYSTICK; i < KEY_MAX; ++i ) {
+ if ( test_bit(i, keybit) ) {
+#ifdef DEBUG_INPUT_EVENTS
+ printf("Joystick has button: 0x%x\n", i);
+#endif
+ joystick->hwdata->key_map[i-BTN_MISC] =
+ joystick->nbuttons;
+ ++joystick->nbuttons;
+ }
+ }
+ for ( i=BTN_MISC; i < BTN_JOYSTICK; ++i ) {
+ if ( test_bit(i, keybit) ) {
+#ifdef DEBUG_INPUT_EVENTS
+ printf("Joystick has button: 0x%x\n", i);
+#endif
+ joystick->hwdata->key_map[i-BTN_MISC] =
+ joystick->nbuttons;
+ ++joystick->nbuttons;
+ }
+ }
+ for ( i=0; i<ABS_MISC; ++i ) {
+ /* Skip hats */
+ if ( i == ABS_HAT0X ) {
+ i = ABS_HAT3Y;
+ continue;
+ }
+ if ( test_bit(i, absbit) ) {
+ struct input_absinfo absinfo;
+
+ if ( ioctl(fd, EVIOCGABS(i), &absinfo) < 0 )
+ continue;
+#ifdef DEBUG_INPUT_EVENTS
+ printf("Joystick has absolute axis: %x\n", i);
+ printf("Values = { %d, %d, %d, %d, %d }\n",
+ absinfo.value, absinfo.minimum,
+ absinfo.maximum, absinfo.fuzz, absinfo.flat);
+#endif /* DEBUG_INPUT_EVENTS */
+ joystick->hwdata->abs_map[i] = joystick->naxes;
+ if ( absinfo.minimum == absinfo.maximum ) {
+ joystick->hwdata->abs_correct[i].used = 0;
+ } else {
+ joystick->hwdata->abs_correct[i].used = 1;
+ joystick->hwdata->abs_correct[i].coef[0] =
+ (absinfo.maximum + absinfo.minimum) / 2 - absinfo.flat;
+ joystick->hwdata->abs_correct[i].coef[1] =
+ (absinfo.maximum + absinfo.minimum) / 2 + absinfo.flat;
+ t = ((absinfo.maximum - absinfo.minimum) / 2 - 2 * absinfo.flat);
+ if ( t != 0 ) {
+ joystick->hwdata->abs_correct[i].coef[2] = (1 << 29) / t;
+ } else {
+ joystick->hwdata->abs_correct[i].coef[2] = 0;
+ }
+ }
+ ++joystick->naxes;
+ }
+ }
+ for ( i=ABS_HAT0X; i <= ABS_HAT3Y; i += 2 ) {
+ if ( test_bit(i, absbit) || test_bit(i+1, absbit) ) {
+#ifdef DEBUG_INPUT_EVENTS
+ printf("Joystick has hat %d\n",(i-ABS_HAT0X)/2);
+#endif
+ ++joystick->nhats;
+ }
+ }
+ if ( test_bit(REL_X, relbit) || test_bit(REL_Y, relbit) ) {
+ ++joystick->nballs;
+ }
+
+ /* Allocate data to keep track of these thingamajigs */
+ if ( joystick->nhats > 0 ) {
+ if ( allocate_hatdata(joystick) < 0 ) {
+ joystick->nhats = 0;
+ }
+ }
+ if ( joystick->nballs > 0 ) {
+ if ( allocate_balldata(joystick) < 0 ) {
+ joystick->nballs = 0;
+ }
+ }
+ }
+ return(joystick->hwdata->is_hid);
+}
+
+#endif /* SDL_INPUT_LINUXEV */
+
+#ifndef NO_LOGICAL_JOYSTICKS
+static void ConfigLogicalJoystick(SDL_Joystick *joystick)
+{
+ struct joystick_logical_layout* layout;
+
+ layout = SDL_joylist[joystick->index].map->layout +
+ SDL_joylist[joystick->index].logicalno;
+
+ joystick->nbuttons = layout->nbuttons;
+ joystick->nhats = layout->nhats;
+ joystick->naxes = layout->naxes;
+ joystick->nballs = layout->nballs;
+}
+#endif
+
+
+/* Function to open a joystick for use.
+ The joystick to open is specified by the index field of the joystick.
+ This should fill the nbuttons and naxes fields of the joystick structure.
+ It returns 0, or -1 if there is an error.
+ */
+int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
+{
+ int fd;
+ SDL_logical_joydecl(int realindex);
+ SDL_logical_joydecl(SDL_Joystick *realjoy = NULL);
+
+ /* Open the joystick and set the joystick file descriptor */
+#ifndef NO_LOGICAL_JOYSTICKS
+ if (SDL_joylist[joystick->index].fname == NULL) {
+ SDL_joylist_head(realindex, joystick->index);
+ realjoy = SDL_JoystickOpen(realindex);
+
+ if (realjoy == NULL)
+ return(-1);
+
+ fd = realjoy->hwdata->fd;
+
+ } else {
+ fd = open(SDL_joylist[joystick->index].fname, O_RDONLY, 0);
+ }
+ SDL_joylist[joystick->index].joy = joystick;
+#else
+ fd = open(SDL_joylist[joystick->index].fname, O_RDONLY, 0);
+#endif
+
+ if ( fd < 0 ) {
+ SDL_SetError("Unable to open %s\n",
+ SDL_joylist[joystick->index]);
+ return(-1);
+ }
+ joystick->hwdata = (struct joystick_hwdata *)
+ SDL_malloc(sizeof(*joystick->hwdata));
+ if ( joystick->hwdata == NULL ) {
+ SDL_OutOfMemory();
+ close(fd);
+ return(-1);
+ }
+ SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
+ joystick->hwdata->fd = fd;
+
+ /* Set the joystick to non-blocking read mode */
+ fcntl(fd, F_SETFL, O_NONBLOCK);
+
+ /* Get the number of buttons and axes on the joystick */
+#ifndef NO_LOGICAL_JOYSTICKS
+ if (realjoy)
+ ConfigLogicalJoystick(joystick);
+ else
+#endif
+#if SDL_INPUT_LINUXEV
+ if ( ! EV_ConfigJoystick(joystick, fd) )
+#endif
+ JS_ConfigJoystick(joystick, fd);
+
+ return(0);
+}
+
+#ifndef NO_LOGICAL_JOYSTICKS
+
+static SDL_Joystick* FindLogicalJoystick(
+ SDL_Joystick *joystick, struct joystick_logical_mapping* v)
+{
+ SDL_Joystick *logicaljoy;
+ register int i;
+
+ i = joystick->index;
+ logicaljoy = NULL;
+
+ /* get the fake joystick that will receive the event
+ */
+ for(;;) {
+
+ if (SDL_joylist[i].logicalno == v->njoy) {
+ logicaljoy = SDL_joylist[i].joy;
+ break;
+ }
+
+ if (SDL_joylist[i].next == 0)
+ break;
+
+ i = SDL_joylist[i].next;
+
+ }
+
+ return logicaljoy;
+}
+
+static int LogicalJoystickButton(
+ SDL_Joystick *joystick, Uint8 button, Uint8 state){
+ struct joystick_logical_mapping* buttons;
+ SDL_Joystick *logicaljoy = NULL;
+
+ /* if there's no map then this is just a regular joystick
+ */
+ if (SDL_joylist[joystick->index].map == NULL)
+ return 0;
+
+ /* get the logical joystick that will receive the event
+ */
+ buttons = SDL_joylist[joystick->index].map->buttonmap+button;
+ logicaljoy = FindLogicalJoystick(joystick, buttons);
+
+ if (logicaljoy == NULL)
+ return 1;
+
+ SDL_PrivateJoystickButton(logicaljoy, buttons->nthing, state);
+
+ return 1;
+}
+
+static int LogicalJoystickAxis(
+ SDL_Joystick *joystick, Uint8 axis, Sint16 value)
+{
+ struct joystick_logical_mapping* axes;
+ SDL_Joystick *logicaljoy = NULL;
+
+ /* if there's no map then this is just a regular joystick
+ */
+ if (SDL_joylist[joystick->index].map == NULL)
+ return 0;
+
+ /* get the logical joystick that will receive the event
+ */
+ axes = SDL_joylist[joystick->index].map->axismap+axis;
+ logicaljoy = FindLogicalJoystick(joystick, axes);
+
+ if (logicaljoy == NULL)
+ return 1;
+
+ SDL_PrivateJoystickAxis(logicaljoy, axes->nthing, value);
+
+ return 1;
+}
+#endif /* USE_LOGICAL_JOYSTICKS */
+
+static __inline__
+void HandleHat(SDL_Joystick *stick, Uint8 hat, int axis, int value)
+{
+ struct hwdata_hat *the_hat;
+ const Uint8 position_map[3][3] = {
+ { SDL_HAT_LEFTUP, SDL_HAT_UP, SDL_HAT_RIGHTUP },
+ { SDL_HAT_LEFT, SDL_HAT_CENTERED, SDL_HAT_RIGHT },
+ { SDL_HAT_LEFTDOWN, SDL_HAT_DOWN, SDL_HAT_RIGHTDOWN }
+ };
+ SDL_logical_joydecl(SDL_Joystick *logicaljoy = NULL);
+ SDL_logical_joydecl(struct joystick_logical_mapping* hats = NULL);
+
+ if (stick->nhats <= hat) {
+ return; /* whoops, that shouldn't happen! */
+ }
+
+ the_hat = &stick->hwdata->hats[hat];
+ if ( value < 0 ) {
+ value = 0;
+ } else
+ if ( value == 0 ) {
+ value = 1;
+ } else
+ if ( value > 0 ) {
+ value = 2;
+ }
+ if ( value != the_hat->axis[axis] ) {
+ the_hat->axis[axis] = value;
+
+#ifndef NO_LOGICAL_JOYSTICKS
+ /* if there's no map then this is just a regular joystick
+ */
+ if (SDL_joylist[stick->index].map != NULL) {
+
+ /* get the fake joystick that will receive the event
+ */
+ hats = SDL_joylist[stick->index].map->hatmap+hat;
+ logicaljoy = FindLogicalJoystick(stick, hats);
+ }
+
+ if (logicaljoy) {
+ stick = logicaljoy;
+ hat = hats->nthing;
+ }
+#endif /* USE_LOGICAL_JOYSTICKS */
+
+ SDL_PrivateJoystickHat(stick, hat,
+ position_map[the_hat->axis[1]][the_hat->axis[0]]);
+ }
+}
+
+static __inline__
+void HandleBall(SDL_Joystick *stick, Uint8 ball, int axis, int value)
+{
+ if ((stick->nballs <= ball) || (axis >= 2)) {
+ return; /* whoops, that shouldn't happen! */
+ }
+ stick->hwdata->balls[ball].axis[axis] += value;
+}
+
+/* Function to update the state of a joystick - called as a device poll.
+ * This function shouldn't update the joystick structure directly,
+ * but instead should call SDL_PrivateJoystick*() to deliver events
+ * and update joystick device state.
+ */
+static __inline__ void JS_HandleEvents(SDL_Joystick *joystick)
+{
+ struct js_event events[32];
+ int i, len;
+ Uint8 other_axis;
+
+#ifndef NO_LOGICAL_JOYSTICKS
+ if (SDL_joylist[joystick->index].fname == NULL) {
+ SDL_joylist_head(i, joystick->index);
+ JS_HandleEvents(SDL_joylist[i].joy);
+ return;
+ }
+#endif
+
+ while ((len=read(joystick->hwdata->fd, events, (sizeof events))) > 0) {
+ len /= sizeof(events[0]);
+ for ( i=0; i<len; ++i ) {
+ switch (events[i].type & ~JS_EVENT_INIT) {
+ case JS_EVENT_AXIS:
+ if ( events[i].number < joystick->naxes ) {
+#ifndef NO_LOGICAL_JOYSTICKS
+ if (!LogicalJoystickAxis(joystick,
+ events[i].number, events[i].value))
+#endif
+ SDL_PrivateJoystickAxis(joystick,
+ events[i].number, events[i].value);
+ break;
+ }
+ events[i].number -= joystick->naxes;
+ other_axis = (events[i].number / 2);
+ if ( other_axis < joystick->nhats ) {
+ HandleHat(joystick, other_axis,
+ events[i].number%2,
+ events[i].value);
+ break;
+ }
+ events[i].number -= joystick->nhats*2;
+ other_axis = (events[i].number / 2);
+ if ( other_axis < joystick->nballs ) {
+ HandleBall(joystick, other_axis,
+ events[i].number%2,
+ events[i].value);
+ break;
+ }
+ break;
+ case JS_EVENT_BUTTON:
+#ifndef NO_LOGICAL_JOYSTICKS
+ if (!LogicalJoystickButton(joystick,
+ events[i].number, events[i].value))
+#endif
+ SDL_PrivateJoystickButton(joystick,
+ events[i].number, events[i].value);
+ break;
+ default:
+ /* ?? */
+ break;
+ }
+ }
+ }
+}
+#if SDL_INPUT_LINUXEV
+static __inline__ int EV_AxisCorrect(SDL_Joystick *joystick, int which, int value)
+{
+ struct axis_correct *correct;
+
+ correct = &joystick->hwdata->abs_correct[which];
+ if ( correct->used ) {
+ if ( value > correct->coef[0] ) {
+ if ( value < correct->coef[1] ) {
+ return 0;
+ }
+ value -= correct->coef[1];
+ } else {
+ value -= correct->coef[0];
+ }
+ value *= correct->coef[2];
+ value >>= 14;
+ }
+
+ /* Clamp and return */
+ if ( value < -32768 ) return -32768;
+ if ( value > 32767 ) return 32767;
+
+ return value;
+}
+
+static __inline__ void EV_HandleEvents(SDL_Joystick *joystick)
+{
+ struct input_event events[32];
+ int i, len;
+ int code;
+
+#ifndef NO_LOGICAL_JOYSTICKS
+ if (SDL_joylist[joystick->index].fname == NULL) {
+ SDL_joylist_head(i, joystick->index);
+ return EV_HandleEvents(SDL_joylist[i].joy);
+ }
+#endif
+
+ while ((len=read(joystick->hwdata->fd, events, (sizeof events))) > 0) {
+ len /= sizeof(events[0]);
+ for ( i=0; i<len; ++i ) {
+ code = events[i].code;
+ switch (events[i].type) {
+ case EV_KEY:
+ if ( code >= BTN_MISC ) {
+ code -= BTN_MISC;
+#ifndef NO_LOGICAL_JOYSTICKS
+ if (!LogicalJoystickButton(joystick,
+ joystick->hwdata->key_map[code],
+ events[i].value))
+#endif
+ SDL_PrivateJoystickButton(joystick,
+ joystick->hwdata->key_map[code],
+ events[i].value);
+ }
+ break;
+ case EV_ABS:
+ switch (code) {
+ case ABS_HAT0X:
+ case ABS_HAT0Y:
+ case ABS_HAT1X:
+ case ABS_HAT1Y:
+ case ABS_HAT2X:
+ case ABS_HAT2Y:
+ case ABS_HAT3X:
+ case ABS_HAT3Y:
+ code -= ABS_HAT0X;
+ HandleHat(joystick, code/2, code%2,
+ events[i].value);
+ break;
+ default:
+ events[i].value = EV_AxisCorrect(joystick, code, events[i].value);
+#ifndef NO_LOGICAL_JOYSTICKS
+ if (!LogicalJoystickAxis(joystick,
+ joystick->hwdata->abs_map[code],
+ events[i].value))
+#endif
+ SDL_PrivateJoystickAxis(joystick,
+ joystick->hwdata->abs_map[code],
+ events[i].value);
+ break;
+ }
+ break;
+ case EV_REL:
+ switch (code) {
+ case REL_X:
+ case REL_Y:
+ code -= REL_X;
+ HandleBall(joystick, code/2, code%2,
+ events[i].value);
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+}
+#endif /* SDL_INPUT_LINUXEV */
+
+void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
+{
+ int i;
+
+#if SDL_INPUT_LINUXEV
+ if ( joystick->hwdata->is_hid )
+ EV_HandleEvents(joystick);
+ else
+#endif
+ JS_HandleEvents(joystick);
+
+ /* Deliver ball motion updates */
+ for ( i=0; i<joystick->nballs; ++i ) {
+ int xrel, yrel;
+
+ xrel = joystick->hwdata->balls[i].axis[0];
+ yrel = joystick->hwdata->balls[i].axis[1];
+ if ( xrel || yrel ) {
+ joystick->hwdata->balls[i].axis[0] = 0;
+ joystick->hwdata->balls[i].axis[1] = 0;
+ SDL_PrivateJoystickBall(joystick, (Uint8)i, xrel, yrel);
+ }
+ }
+}
+
+/* Function to close a joystick after use */
+void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
+{
+#ifndef NO_LOGICAL_JOYSTICKS
+ register int i;
+ if (SDL_joylist[joystick->index].fname == NULL) {
+ SDL_joylist_head(i, joystick->index);
+ SDL_JoystickClose(SDL_joylist[i].joy);
+ }
+#endif
+
+ if ( joystick->hwdata ) {
+#ifndef NO_LOGICAL_JOYSTICKS
+ if (SDL_joylist[joystick->index].fname != NULL)
+#endif
+ close(joystick->hwdata->fd);
+ if ( joystick->hwdata->hats ) {
+ SDL_free(joystick->hwdata->hats);
+ }
+ if ( joystick->hwdata->balls ) {
+ SDL_free(joystick->hwdata->balls);
+ }
+ SDL_free(joystick->hwdata);
+ joystick->hwdata = NULL;
+ }
+}
+
+/* Function to perform any system-specific joystick related cleanup */
+void SDL_SYS_JoystickQuit(void)
+{
+ int i;
+
+ for ( i=0; SDL_joylist[i].fname; ++i ) {
+ SDL_free(SDL_joylist[i].fname);
+ SDL_joylist[i].fname = NULL;
+ }
+}
+
+#endif /* SDL_JOYSTICK_LINUX */
diff --git a/distrib/sdl-1.2.15/src/joystick/macos/SDL_sysjoystick.c b/distrib/sdl-1.2.15/src/joystick/macos/SDL_sysjoystick.c
new file mode 100644
index 0000000..3645dbd
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/joystick/macos/SDL_sysjoystick.c
@@ -0,0 +1,320 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_JOYSTICK_MACOS
+
+/* SDL stuff -- "SDL_sysjoystick.c"
+ MacOS joystick functions by Frederick Reitberger
+
+ The code that follows is meant for SDL. Use at your own risk.
+*/
+
+#include <InputSprocket.h>
+
+#include "SDL_joystick.h"
+#include "../SDL_sysjoystick.h"
+#include "../SDL_joystick_c.h"
+
+
+/* The max number of joysticks we will detect */
+#define MAX_JOYSTICKS 16
+/* Limit ourselves to 32 elements per device */
+#define kMaxReferences 32
+
+#define ISpSymmetricAxisToFloat(axis) ((((float) axis) - kISpAxisMiddle) / (kISpAxisMaximum-kISpAxisMiddle))
+#define ISpAsymmetricAxisToFloat(axis) (((float) axis) / (kISpAxisMaximum))
+
+
+static ISpDeviceReference SYS_Joysticks[MAX_JOYSTICKS];
+static ISpElementListReference SYS_Elements[MAX_JOYSTICKS];
+static ISpDeviceDefinition SYS_DevDef[MAX_JOYSTICKS];
+
+struct joystick_hwdata
+{
+ char name[64];
+/* Uint8 id;*/
+ ISpElementReference refs[kMaxReferences];
+ /* gonna need some sort of mapping info */
+};
+
+
+/* Function to scan the system for joysticks.
+ * Joystick 0 should be the system default joystick.
+ * This function should return the number of available joysticks, or -1
+ * on an unrecoverable fatal error.
+ */
+int SDL_SYS_JoystickInit(void)
+{
+ static ISpDeviceClass classes[4] = {
+ kISpDeviceClass_Joystick,
+ #if kISpDeviceClass_Gamepad
+ kISpDeviceClass_Gamepad,
+ #endif
+ kISpDeviceClass_Wheel,
+ 0
+ };
+ OSErr err;
+ int i;
+ UInt32 count, numJoysticks;
+
+ if ( (Ptr)0 == (Ptr)ISpStartup ) {
+ SDL_SetError("InputSprocket not installed");
+ return -1; // InputSprocket not installed
+ }
+
+ if( (Ptr)0 == (Ptr)ISpGetVersion ) {
+ SDL_SetError("InputSprocket not version 1.1 or newer");
+ return -1; // old version of ISp (not at least 1.1)
+ }
+
+ ISpStartup();
+
+ /* Get all the joysticks */
+ numJoysticks = 0;
+ for ( i=0; classes[i]; ++i ) {
+ count = 0;
+ err = ISpDevices_ExtractByClass(
+ classes[i],
+ MAX_JOYSTICKS-numJoysticks,
+ &count,
+ &SYS_Joysticks[numJoysticks]);
+ numJoysticks += count;
+ }
+
+ for(i = 0; i < numJoysticks; i++)
+ {
+ ISpDevice_GetDefinition(
+ SYS_Joysticks[i], sizeof(ISpDeviceDefinition),
+ &SYS_DevDef[i]);
+
+ err = ISpElementList_New(
+ 0, NULL,
+ &SYS_Elements[i], 0);
+
+ if (err) {
+ SDL_OutOfMemory();
+ return -1;
+ }
+
+ ISpDevice_GetElementList(
+ SYS_Joysticks[i],
+ &SYS_Elements[i]);
+ }
+
+ ISpDevices_Deactivate(numJoysticks, SYS_Joysticks);
+
+ return numJoysticks;
+}
+
+/* Function to get the device-dependent name of a joystick */
+const char *SDL_SYS_JoystickName(int index)
+{
+ static char name[64];
+ int len;
+
+ /* convert pascal string to c-string */
+ len = SYS_DevDef[index].deviceName[0];
+ if ( len >= sizeof(name) ) {
+ len = (sizeof(name) - 1);
+ }
+ SDL_memcpy(name, &SYS_DevDef[index].deviceName[1], len);
+ name[len] = '\0';
+
+ return name;
+}
+
+/* Function to open a joystick for use.
+ The joystick to open is specified by the index field of the joystick.
+ This should fill the nbuttons and naxes fields of the joystick structure.
+ It returns 0, or -1 if there is an error.
+ */
+int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
+{
+ int index;
+ UInt32 count, gotCount, count2;
+ long numAxis, numButtons, numHats, numBalls;
+
+ count = kMaxReferences;
+ count2 = 0;
+ numAxis = numButtons = numHats = numBalls = 0;
+
+ index = joystick->index;
+
+ /* allocate memory for system specific hardware data */
+ joystick->hwdata = (struct joystick_hwdata *) SDL_malloc(sizeof(*joystick->hwdata));
+ if (joystick->hwdata == NULL)
+ {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
+ SDL_strlcpy(joystick->hwdata->name, SDL_SYS_JoystickName(index), SDL_arraysize(joystick->hwdata->name));
+ joystick->name = joystick->hwdata->name;
+
+ ISpElementList_ExtractByKind(
+ SYS_Elements[index],
+ kISpElementKind_Axis,
+ count,
+ &gotCount,
+ joystick->hwdata->refs);
+
+ numAxis = gotCount;
+ count -= gotCount;
+ count2 += gotCount;
+
+ ISpElementList_ExtractByKind(
+ SYS_Elements[index],
+ kISpElementKind_DPad,
+ count,
+ &gotCount,
+ &(joystick->hwdata->refs[count2]));
+
+ numHats = gotCount;
+ count -= gotCount;
+ count2 += gotCount;
+
+ ISpElementList_ExtractByKind(
+ SYS_Elements[index],
+ kISpElementKind_Button,
+ count,
+ &gotCount,
+ &(joystick->hwdata->refs[count2]));
+
+ numButtons = gotCount;
+ count -= gotCount;
+ count2 += gotCount;
+
+ joystick->naxes = numAxis;
+ joystick->nhats = numHats;
+ joystick->nballs = numBalls;
+ joystick->nbuttons = numButtons;
+
+ ISpDevices_Activate(
+ 1,
+ &SYS_Joysticks[index]);
+
+ return 0;
+}
+
+/* Function to update the state of a joystick - called as a device poll.
+ * This function shouldn't update the joystick structure directly,
+ * but instead should call SDL_PrivateJoystick*() to deliver events
+ * and update joystick device state.
+ */
+void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
+{
+ int i, j;
+ ISpAxisData a;
+ ISpDPadData b;
+ //ISpDeltaData c;
+ ISpButtonData d;
+
+ for(i = 0, j = 0; i < joystick->naxes; i++, j++)
+ {
+ Sint16 value;
+
+ ISpElement_GetSimpleState(
+ joystick->hwdata->refs[j],
+ &a);
+ value = (ISpSymmetricAxisToFloat(a)* 32767.0);
+ if ( value != joystick->axes[i] ) {
+ SDL_PrivateJoystickAxis(joystick, i, value);
+ }
+ }
+
+ for(i = 0; i < joystick->nhats; i++, j++)
+ {
+ Uint8 pos;
+
+ ISpElement_GetSimpleState(
+ joystick->hwdata->refs[j],
+ &b);
+ switch(b) {
+ case kISpPadIdle:
+ pos = SDL_HAT_CENTERED;
+ break;
+ case kISpPadLeft:
+ pos = SDL_HAT_LEFT;
+ break;
+ case kISpPadUpLeft:
+ pos = SDL_HAT_LEFTUP;
+ break;
+ case kISpPadUp:
+ pos = SDL_HAT_UP;
+ break;
+ case kISpPadUpRight:
+ pos = SDL_HAT_RIGHTUP;
+ break;
+ case kISpPadRight:
+ pos = SDL_HAT_RIGHT;
+ break;
+ case kISpPadDownRight:
+ pos = SDL_HAT_RIGHTDOWN;
+ break;
+ case kISpPadDown:
+ pos = SDL_HAT_DOWN;
+ break;
+ case kISpPadDownLeft:
+ pos = SDL_HAT_LEFTDOWN;
+ break;
+ }
+ if ( pos != joystick->hats[i] ) {
+ SDL_PrivateJoystickHat(joystick, i, pos);
+ }
+ }
+
+ for(i = 0; i < joystick->nballs; i++, j++)
+ {
+ /* ignore balls right now */
+ }
+
+ for(i = 0; i < joystick->nbuttons; i++, j++)
+ {
+ ISpElement_GetSimpleState(
+ joystick->hwdata->refs[j],
+ &d);
+ if ( d != joystick->buttons[i] ) {
+ SDL_PrivateJoystickButton(joystick, i, d);
+ }
+ }
+}
+
+/* Function to close a joystick after use */
+void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
+{
+ int index;
+
+ index = joystick->index;
+
+ ISpDevices_Deactivate(
+ 1,
+ &SYS_Joysticks[index]);
+}
+
+/* Function to perform any system-specific joystick related cleanup */
+void SDL_SYS_JoystickQuit(void)
+{
+ ISpShutdown();
+}
+
+#endif /* SDL_JOYSTICK_MACOS */
diff --git a/distrib/sdl-1.2.15/src/joystick/mint/SDL_sysjoystick.c b/distrib/sdl-1.2.15/src/joystick/mint/SDL_sysjoystick.c
new file mode 100644
index 0000000..9a36152
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/joystick/mint/SDL_sysjoystick.c
@@ -0,0 +1,826 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_JOYSTICK_MINT
+
+/*
+ * Atari Joystick/Joypad drivers
+ *
+ * Patrice Mandin
+ */
+
+#include <mint/cookie.h>
+#include <mint/osbind.h>
+
+#include "SDL_events.h"
+#include "../SDL_sysjoystick.h"
+#include "../SDL_joystick_c.h"
+
+#include "../../video/ataricommon/SDL_ikbdinterrupt_s.h"
+#include "../../video/ataricommon/SDL_xbiosevents_c.h"
+#include "../../video/ataricommon/SDL_xbiosinterrupt_s.h"
+
+/*--- Const ---*/
+
+/* We can have:
+ 1 joystick on IKBD port 1, read via hardware I/O
+ or same joystick on IKBD port 1, read via xbios
+ 1 joypad on port A (up to 4 with teamtap)
+ or 2 joysticks on joypad port A
+ or 1 analog paddle on joypad port A
+ or 1 lightpen on joypad port A
+ 1 joypad on port B (up to 4 with teamtap)
+ or 2 joysticks on joypad port B
+ or 1 analog paddle on joypad port B
+ 2 joysticks on parallel port
+*/
+
+enum {
+ IKBD_JOY1=0,
+ XBIOS_JOY1,
+ PORTA_PAD0,
+ PORTA_PAD1,
+ PORTA_PAD2,
+ PORTA_PAD3,
+ PORTB_PAD0,
+ PORTB_PAD1,
+ PORTB_PAD2,
+ PORTB_PAD3,
+ PORTA_JOY0,
+ PORTA_JOY1,
+ PORTB_JOY0,
+ PORTB_JOY1,
+ PORTA_LP,
+ PORTA_ANPAD,
+ PORTB_ANPAD,
+#if 0
+ PARA_JOY0,
+ PARA_JOY1,
+#endif
+ MAX_JOYSTICKS
+};
+
+enum {
+ MCH_ST=0,
+ MCH_STE,
+ MCH_TT,
+ MCH_F30,
+ MCH_CLONE,
+ MCH_ARANYM
+};
+
+/* Joypad buttons
+ * Procontroller note:
+ * L,R are connected to 4,6
+ * X,Y,Z are connected to 7,8,9
+ */
+
+enum {
+ JP_UP=0, JP_DOWN, JP_LEFT, JP_RIGHT,
+ JP_KPMULT, JP_KP7, JP_KP4, JP_KP1,
+ JP_KP0, JP_KP8, JP_KP5, JP_KP2,
+ JP_KPNUM, JP_KP9, JP_KP6, JP_KP3,
+ JP_PAUSE, JP_FIRE0, JP_UNDEF0, JP_FIRE1,
+ JP_UNDEF1, JP_FIRE2, JP_UNDEF2, JP_OPTION
+};
+
+#define JP_NUM_BUTTONS 17
+
+#define PORT_JS_RIGHT (1<<0)
+#define PORT_JS_LEFT (1<<1)
+#define PORT_JS_DOWN (1<<2)
+#define PORT_JS_UP (1<<3)
+#define PORT_JS_FIRE (1<<4)
+
+enum {
+ TEAMTAP_MAYBE=0,
+ TEAMTAP_YES,
+ TEAMTAP_NO
+};
+
+/* Teamtap detection values */
+static const Uint32 teamtap_ghosts[20][4]={
+ {1<<JP_UP, /* for this event on joypad 0, port X */
+ (1<<JP_UP)|(1<<JP_KP0), /* we get this on joypad 1 */
+ (1<<JP_UP)|(1<<JP_KPNUM)|(1<<JP_KP0), /* this on joypad 2 */
+ (1<<JP_KPMULT)|(1<<JP_KP0)}, /* this on joypad 3 */
+ {1<<JP_DOWN,
+ (1<<JP_DOWN)|(1<<JP_KP8),
+ (1<<JP_DOWN)|(1<<JP_KP9)|(1<<JP_KP8),
+ (1<<JP_KP7)|(1<<JP_KP8)},
+ {1<<JP_LEFT,
+ (1<<JP_LEFT)|(1<<JP_KP5),
+ (1<<JP_LEFT)|(1<<JP_KP6)|(1<<JP_KP5),
+ (1<<JP_KP4)|(1<<JP_KP5)},
+ {1<<JP_RIGHT,
+ (1<<JP_RIGHT)|(1<<JP_KP2),
+ (1<<JP_RIGHT)|(1<<JP_KP3)|(1<<JP_KP2),
+ (1<<JP_KP1)|(1<<JP_KP2)},
+ {1<<JP_OPTION,
+ (1<<JP_OPTION)|(1<<JP_FIRE1)|(1<<JP_FIRE2),
+ (1<<JP_FIRE0)|(1<<JP_FIRE1)|(1<<JP_FIRE2),
+ 0},
+ {1<<JP_FIRE0,
+ (1<<JP_FIRE2)|(1<<JP_FIRE0),
+ (1<<JP_FIRE0)|(1<<JP_OPTION)|(1<<JP_FIRE2),
+ (1<<JP_FIRE1)|(1<<JP_FIRE2)},
+ {1<<JP_FIRE1,
+ (1<<JP_FIRE0),
+ (1<<JP_OPTION)|(1<<JP_FIRE0)|(1<<JP_FIRE1),
+ (1<<JP_FIRE0)|(1<<JP_FIRE2)},
+ {1<<JP_FIRE2,
+ (1<<JP_OPTION)|(1<<JP_FIRE0)|(1<<JP_FIRE1)|(1<<JP_FIRE2),
+ (1<<JP_OPTION),
+ (1<<JP_FIRE0)|(1<<JP_FIRE1)},
+ {1<<JP_KP1,
+ (1<<JP_RIGHT)|(1<<JP_KP1),
+ (1<<JP_RIGHT)|(1<<JP_KP1)|(1<<JP_KP3),
+ (1<<JP_RIGHT)|(1<<JP_KP2)},
+ {1<<JP_KP2,
+ (1<<JP_RIGHT)|(1<<JP_KP1)|(1<<JP_KP2)|(1<<JP_KP3),
+ (1<<JP_KP3),
+ (1<<JP_RIGHT)|(1<<JP_KP1)},
+ {1<<JP_KP3,
+ (1<<JP_RIGHT)|(1<<JP_KP1)|(1<<JP_KP2)|(1<<JP_KP3),
+ (1<<JP_RIGHT)|(1<<JP_KP1)|(1<<JP_KP2),
+ 0},
+ {1<<JP_KP4,
+ (1<<JP_LEFT)|(1<<JP_KP4),
+ (1<<JP_LEFT)|(1<<JP_KP4)|(1<<JP_KP6),
+ (1<<JP_LEFT)|(1<<JP_KP5)},
+ {1<<JP_KP5,
+ (1<<JP_LEFT)|(1<<JP_KP4)|(1<<JP_KP5)|(1<<JP_KP6),
+ (1<<JP_KP6),
+ (1<<JP_LEFT)|(1<<JP_KP4)},
+ {1<<JP_KP6,
+ (1<<JP_LEFT)|(1<<JP_KP4)|(1<<JP_KP5)|(1<<JP_KP6),
+ (1<<JP_LEFT)|(1<<JP_KP4)|(1<<JP_KP5),
+ 0},
+ {1<<JP_KP7,
+ (1<<JP_DOWN)|(1<<JP_KP7),
+ (1<<JP_DOWN)|(1<<JP_KP7)|(1<<JP_KP9),
+ (1<<JP_DOWN)|(1<<JP_KP8)},
+ {1<<JP_KP8,
+ (1<<JP_DOWN)|(1<<JP_KP7)|(1<<JP_KP8)|(1<<JP_KP9),
+ (1<<JP_KP9),
+ (1<<JP_DOWN)|(1<<JP_KP7)},
+ {1<<JP_KP9,
+ (1<<JP_DOWN)|(1<<JP_KP7)|(1<<JP_KP8)|(1<<JP_KP9),
+ (1<<JP_DOWN)|(1<<JP_KP7)|(1<<JP_KP8),
+ 0},
+ {1<<JP_KPMULT,
+ (1<<JP_UP)|(1<<JP_KPMULT),
+ (1<<JP_UP)|(1<<JP_KPNUM),
+ (1<<JP_UP)|(1<<JP_KP0)},
+ {1<<JP_KP0,
+ (1<<JP_UP)|(1<<JP_KPNUM)|(1<<JP_KPMULT)|(1<<JP_KP0),
+ 1<<JP_KPNUM,
+ (1<<JP_UP)|(1<<JP_KPMULT)},
+ {1<<JP_KPNUM,
+ (1<<JP_UP)|(1<<JP_KPNUM)|(1<<JP_KPMULT)|(1<<JP_KP0),
+ (1<<JP_UP)|(1<<JP_KPMULT)|(1<<JP_KP0),
+ 0},
+};
+
+/*--- Types ---*/
+
+typedef struct {
+ SDL_bool enabled;
+ char *name;
+ Uint32 prevstate;
+} atarijoy_t;
+
+/*--- Variables ---*/
+
+static atarijoy_t atarijoysticks[MAX_JOYSTICKS]={
+ {SDL_FALSE,"IKBD joystick port 1",0},
+ {SDL_FALSE,"Xbios joystick port 1",0},
+ {SDL_FALSE,"Joypad 0 port A",0},
+ {SDL_FALSE,"Joypad 1 port A",0},
+ {SDL_FALSE,"Joypad 2 port A",0},
+ {SDL_FALSE,"Joypad 3 port A",0},
+ {SDL_FALSE,"Joypad 0 port B",0},
+ {SDL_FALSE,"Joypad 1 port B",0},
+ {SDL_FALSE,"Joypad 2 port B",0},
+ {SDL_FALSE,"Joypad 3 port B",0},
+ {SDL_FALSE,"Joystick 0 port A",0},
+ {SDL_FALSE,"Joystick 1 port A",0},
+ {SDL_FALSE,"Joystick 0 port B",0},
+ {SDL_FALSE,"Joystick 1 port B",0},
+ {SDL_FALSE,"Lightpen port A",0},
+ {SDL_FALSE,"Analog paddle port A",0},
+ {SDL_FALSE,"Analog paddle port B",0}
+#if 0
+ ,{SDL_FALSE,"Joystick 0 parallel port",0},
+ {SDL_FALSE,"Joystick 1 parallel port",0}
+#endif
+};
+
+static const int jp_buttons[JP_NUM_BUTTONS]={
+ JP_FIRE0, JP_FIRE1, JP_FIRE2, JP_PAUSE,
+ JP_OPTION, JP_KPMULT, JP_KPNUM, JP_KP0,
+ JP_KP1, JP_KP2, JP_KP3, JP_KP4,
+ JP_KP5, JP_KP6, JP_KP7, JP_KP8,
+ JP_KP9
+};
+
+static SDL_bool joypad_ports_enabled=SDL_FALSE;
+static int has_teamtap[2]={TEAMTAP_MAYBE,TEAMTAP_MAYBE};
+
+/* Updated joypad ports */
+static Uint16 jp_paddles[4];
+static Uint16 jp_lightpens[2];
+static Uint16 jp_directions;
+static Uint16 jp_fires;
+static Uint32 jp_joypads[8];
+
+/*--- Functions prototypes ---*/
+
+static int GetEnabledAtariJoystick(int index);
+static void UpdateJoypads(void);
+
+/*--- Functions ---*/
+
+int SDL_SYS_JoystickInit(void)
+{
+ int i;
+ long cookie_mch;
+ const char *envr=SDL_getenv("SDL_JOYSTICK_ATARI");
+
+#define TEST_JOY_ENABLED(env,idstring,num) \
+ if (SDL_strstr(env,idstring"-off")) { \
+ atarijoysticks[num].enabled=SDL_FALSE; \
+ } \
+ if (SDL_strstr(env,idstring"-on")) { \
+ atarijoysticks[num].enabled=SDL_TRUE; \
+ }
+
+ /* Cookie _MCH present ? if not, assume ST machine */
+ if (Getcookie(C__MCH, &cookie_mch) != C_FOUND) {
+ cookie_mch = MCH_ST << 16;
+ }
+
+ /* Enable some default joysticks */
+ if ((cookie_mch == MCH_ST<<16) || ((cookie_mch>>16) == MCH_STE) ||
+ (cookie_mch == MCH_TT<<16) || (cookie_mch == MCH_F30<<16) ||
+ (cookie_mch == MCH_ARANYM<<16))
+ {
+ atarijoysticks[IKBD_JOY1].enabled=(SDL_AtariIkbd_enabled!=0);
+ }
+ if ((cookie_mch == MCH_STE<<16) || (cookie_mch == MCH_F30<<16) ||
+ (cookie_mch == MCH_ARANYM<<16))
+ {
+ atarijoysticks[PORTA_PAD0].enabled =
+ atarijoysticks[PORTA_PAD1].enabled =
+ atarijoysticks[PORTA_PAD2].enabled =
+ atarijoysticks[PORTA_PAD3].enabled =
+ atarijoysticks[PORTB_PAD0].enabled =
+ atarijoysticks[PORTB_PAD1].enabled =
+ atarijoysticks[PORTB_PAD2].enabled =
+ atarijoysticks[PORTB_PAD3].enabled = SDL_TRUE;
+ }
+ if (!atarijoysticks[IKBD_JOY1].enabled) {
+ atarijoysticks[XBIOS_JOY1].enabled=(SDL_AtariXbios_enabled!=0);
+ }
+
+ /* Read environment for joysticks to enable */
+ if (envr) {
+ /* IKBD on any Atari, maybe clones */
+ if ((cookie_mch == MCH_ST<<16) || ((cookie_mch>>16) == MCH_STE) ||
+ (cookie_mch == MCH_TT<<16) || (cookie_mch == MCH_F30<<16) ||
+ (cookie_mch == MCH_ARANYM<<16)) {
+ if (SDL_AtariIkbd_enabled!=0) {
+ TEST_JOY_ENABLED(envr, "ikbd-joy1", IKBD_JOY1);
+ }
+ }
+ /* Joypads ports on STE, Falcon and maybe others */
+ if ((cookie_mch == MCH_STE<<16) || (cookie_mch == MCH_F30<<16) ||
+ (cookie_mch == MCH_ARANYM<<16)) {
+ TEST_JOY_ENABLED(envr, "porta-pad", PORTA_PAD0);
+ if (!atarijoysticks[PORTA_PAD0].enabled) {
+ TEST_JOY_ENABLED(envr, "porta-joy0", PORTA_JOY0);
+ TEST_JOY_ENABLED(envr, "porta-joy1", PORTA_JOY1);
+ if (!(atarijoysticks[PORTA_JOY0].enabled) && !(atarijoysticks[PORTA_JOY1].enabled)) {
+ TEST_JOY_ENABLED(envr, "porta-lp", PORTA_LP);
+ if (!atarijoysticks[PORTA_LP].enabled) {
+ TEST_JOY_ENABLED(envr, "porta-anpad", PORTA_ANPAD);
+ }
+ }
+ }
+
+ TEST_JOY_ENABLED(envr, "portb-pad", PORTB_PAD0);
+ if (!atarijoysticks[PORTB_PAD0].enabled) {
+ TEST_JOY_ENABLED(envr, "portb-joy0", PORTB_JOY0);
+ TEST_JOY_ENABLED(envr, "portb-joy1", PORTB_JOY1);
+ if (!(atarijoysticks[PORTB_JOY0].enabled) && !(atarijoysticks[PORTB_JOY1].enabled)) {
+ TEST_JOY_ENABLED(envr, "portb-anpad", PORTB_ANPAD);
+ }
+ }
+ }
+
+ if (!atarijoysticks[IKBD_JOY1].enabled) {
+ if (SDL_AtariXbios_enabled!=0) {
+ TEST_JOY_ENABLED(envr, "xbios-joy1", XBIOS_JOY1);
+ }
+ }
+#if 0
+ /* Parallel port on any Atari, maybe clones */
+ if ((cookie_mch == MCH_ST<<16) || ((cookie_mch>>16) == MCH_STE) ||
+ (cookie_mch == MCH_TT<<16) || (cookie_mch == MCH_F30<<16)) {
+ TEST_JOY_ENABLED(envr, "para-joy0", PARA_JOY0);
+ TEST_JOY_ENABLED(envr, "para-joy1", PARA_JOY1);
+ }
+#endif
+ }
+
+ /* Need to update joypad ports ? */
+ joypad_ports_enabled=SDL_FALSE;
+ for (i=PORTA_PAD0;i<=PORTB_ANPAD;i++) {
+ if (atarijoysticks[i].enabled) {
+ joypad_ports_enabled=SDL_TRUE;
+ break;
+ }
+ }
+
+ SDL_numjoysticks = 0;
+ for (i=0;i<MAX_JOYSTICKS;i++) {
+ if (atarijoysticks[i].enabled) {
+ ++SDL_numjoysticks;
+ }
+ }
+
+ return(SDL_numjoysticks);
+}
+
+static int GetEnabledAtariJoystick(int index)
+{
+ int i,j;
+
+ /* Return the nth'index' enabled atari joystick */
+ j=0;
+ for (i=0;i<MAX_JOYSTICKS;i++) {
+ if (!atarijoysticks[i].enabled) {
+ continue;
+ }
+
+ if (j==index) {
+ break;
+ }
+
+ ++j;
+ }
+ if (i==MAX_JOYSTICKS)
+ return -1;
+
+ return i;
+}
+
+const char *SDL_SYS_JoystickName(int index)
+{
+ int numjoystick;
+
+ numjoystick=GetEnabledAtariJoystick(index);
+ if (numjoystick==-1)
+ return NULL;
+
+ return(atarijoysticks[numjoystick].name);
+}
+
+int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
+{
+ int numjoystick;
+
+ numjoystick=GetEnabledAtariJoystick(joystick->index);
+ if (numjoystick==-1)
+ return -1;
+
+ joystick->naxes=0;
+ joystick->nhats=0;
+ joystick->nballs=0;
+
+ switch(numjoystick) {
+ case PORTA_PAD0:
+ case PORTA_PAD1:
+ case PORTA_PAD2:
+ case PORTA_PAD3:
+ case PORTB_PAD0:
+ case PORTB_PAD1:
+ case PORTB_PAD2:
+ case PORTB_PAD3:
+ joystick->nhats=1;
+ joystick->nbuttons=JP_NUM_BUTTONS;
+ break;
+ case PORTA_LP:
+ case PORTA_ANPAD:
+ case PORTB_ANPAD:
+ joystick->naxes=2;
+ joystick->nbuttons=2;
+ break;
+ default:
+ joystick->nhats=1;
+ joystick->nbuttons=1;
+ break;
+ }
+
+ return(0);
+}
+
+/* Detect Teamtap using ghost events */
+static void detect_teamtap(int num_port)
+{
+ int i,j;
+
+ /* Check if joypad 1,2,3 triggered but not 0 */
+ for (i=1; i<4; i++) {
+ if (jp_joypads[num_port*4+i] && (jp_joypads[num_port*4]==0)) {
+ has_teamtap[num_port] = TEAMTAP_YES;
+ return;
+ }
+ }
+
+ /* Check if joypad 0 on a given port triggered ghost events for
+ * other joypads
+ */
+ for (i=0; i<20; i++) {
+ int with_teamtap=1;
+
+ if (jp_joypads[num_port*4]!=teamtap_ghosts[i][0])
+ continue;
+
+ /* If any button on first joypad pressed, check other pads */
+ for (j=1; j<4; j++) {
+ if ((jp_joypads[num_port*4+j] & teamtap_ghosts[i][j])
+ ==teamtap_ghosts[i][j])
+ {
+ with_teamtap = 0;
+ }
+ }
+
+ has_teamtap[num_port] = (with_teamtap ? TEAMTAP_YES : TEAMTAP_NO);
+ break;
+ }
+}
+
+void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
+{
+ int numjoystick;
+ Uint8 hatstate;
+ Uint32 curstate,prevstate;
+
+ numjoystick=GetEnabledAtariJoystick(joystick->index);
+ if (numjoystick==-1)
+ return;
+
+ prevstate = atarijoysticks[numjoystick].prevstate;
+
+ if (joypad_ports_enabled) {
+ Supexec(UpdateJoypads);
+ }
+
+ switch (numjoystick) {
+ case IKBD_JOY1:
+ case XBIOS_JOY1:
+ {
+ curstate = 0;
+
+ if (numjoystick==IKBD_JOY1) {
+ curstate = SDL_AtariIkbd_joystick & 0xff;
+ }
+ if (numjoystick==XBIOS_JOY1) {
+ curstate = SDL_AtariXbios_joystick & 0xff;
+ }
+
+ if (curstate != prevstate) {
+ hatstate = SDL_HAT_CENTERED;
+ if (curstate & IKBD_JOY_LEFT) {
+ hatstate |= SDL_HAT_LEFT;
+ }
+ if (curstate & IKBD_JOY_RIGHT) {
+ hatstate |= SDL_HAT_RIGHT;
+ }
+ if (curstate & IKBD_JOY_UP) {
+ hatstate |= SDL_HAT_UP;
+ }
+ if (curstate & IKBD_JOY_DOWN) {
+ hatstate |= SDL_HAT_DOWN;
+ }
+ SDL_PrivateJoystickHat(joystick, 0, hatstate);
+
+ /* Button */
+ if ((curstate & IKBD_JOY_FIRE) && !(prevstate & IKBD_JOY_FIRE)) {
+ SDL_PrivateJoystickButton(joystick,0,SDL_PRESSED);
+ }
+ if (!(curstate & IKBD_JOY_FIRE) && (prevstate & IKBD_JOY_FIRE)) {
+ SDL_PrivateJoystickButton(joystick,0,SDL_RELEASED);
+ }
+ }
+ atarijoysticks[numjoystick].prevstate = curstate;
+ }
+ break;
+ case PORTA_PAD0:
+ case PORTA_PAD1:
+ case PORTA_PAD2:
+ case PORTA_PAD3:
+ case PORTB_PAD0:
+ case PORTB_PAD1:
+ case PORTB_PAD2:
+ case PORTB_PAD3:
+ {
+ int numjoypad,i,numport;
+
+ numjoypad = numport = 0;
+ switch(numjoystick) {
+ case PORTA_PAD0:
+ numjoypad = 0; break;
+ case PORTA_PAD1:
+ numjoypad = 1; break;
+ case PORTA_PAD2:
+ numjoypad = 2; break;
+ case PORTA_PAD3:
+ numjoypad = 3; break;
+ case PORTB_PAD0:
+ numjoypad = 4; numport = 1; break;
+ case PORTB_PAD1:
+ numjoypad = 5; numport = 1; break;
+ case PORTB_PAD2:
+ numjoypad = 6; numport = 1; break;
+ case PORTB_PAD3:
+ numjoypad = 7; numport = 1; break;
+ }
+
+ jp_joypads[numjoypad] &= 0xabffff;
+
+ if (has_teamtap[numport]==TEAMTAP_MAYBE) {
+ detect_teamtap(numport);
+ }
+ /* No events for PORTX_PAD[1,2,3] if no teamtap detected */
+ if (has_teamtap[numport] == TEAMTAP_NO) {
+ if ((numjoypad & 3)!=0) {
+ return;
+ }
+ }
+
+ curstate=jp_joypads[numjoypad];
+ if (curstate!=prevstate) {
+ hatstate = SDL_HAT_CENTERED;
+ if (curstate & (1<<JP_LEFT)) {
+ hatstate |= SDL_HAT_LEFT;
+ }
+ if (curstate & (1<<JP_RIGHT)) {
+ hatstate |= SDL_HAT_RIGHT;
+ }
+ if (curstate & (1<<JP_UP)) {
+ hatstate |= SDL_HAT_UP;
+ }
+ if (curstate & (1<<JP_DOWN)) {
+ hatstate |= SDL_HAT_DOWN;
+ }
+ SDL_PrivateJoystickHat(joystick, 0, hatstate);
+
+ /* Buttons */
+ for (i=0;i<JP_NUM_BUTTONS;i++) {
+ int button;
+
+ button=1<<jp_buttons[i];
+
+ if ((curstate & button) && !(prevstate & button)) {
+ SDL_PrivateJoystickButton(joystick,i,SDL_PRESSED);
+ }
+ if (!(curstate & button) && (prevstate & button)) {
+ SDL_PrivateJoystickButton(joystick,i,SDL_RELEASED);
+ }
+ }
+ }
+ atarijoysticks[numjoystick].prevstate = curstate;
+ }
+ break;
+ case PORTA_JOY0:
+ case PORTA_JOY1:
+ case PORTB_JOY0:
+ case PORTB_JOY1:
+ {
+ int fire_shift=0,dir_shift=0;
+
+ if (numjoystick==PORTA_JOY0) { fire_shift=0; dir_shift=0; }
+ if (numjoystick==PORTA_JOY1) { fire_shift=1; dir_shift=4; }
+ if (numjoystick==PORTB_JOY0) { fire_shift=2; dir_shift=8; }
+ if (numjoystick==PORTB_JOY1) { fire_shift=3; dir_shift=12; }
+
+ curstate = (jp_directions>>dir_shift) & 15;
+ curstate |= ((jp_fires>>fire_shift) & 1)<<4;
+
+ if (curstate != prevstate) {
+ hatstate = SDL_HAT_CENTERED;
+ if (curstate & PORT_JS_LEFT) {
+ hatstate |= SDL_HAT_LEFT;
+ }
+ if (curstate & PORT_JS_RIGHT) {
+ hatstate |= SDL_HAT_RIGHT;
+ }
+ if (curstate & PORT_JS_UP) {
+ hatstate |= SDL_HAT_UP;
+ }
+ if (curstate & PORT_JS_DOWN) {
+ hatstate |= SDL_HAT_DOWN;
+ }
+ SDL_PrivateJoystickHat(joystick, 0, hatstate);
+
+ /* Button */
+ if ((curstate & PORT_JS_FIRE) && !(prevstate & PORT_JS_FIRE)) {
+ SDL_PrivateJoystickButton(joystick,0,SDL_PRESSED);
+ }
+ if (!(curstate & PORT_JS_FIRE) && (prevstate & PORT_JS_FIRE)) {
+ SDL_PrivateJoystickButton(joystick,0,SDL_RELEASED);
+ }
+ }
+ atarijoysticks[numjoystick].prevstate = curstate;
+ }
+ break;
+ case PORTA_LP:
+ {
+ int i;
+
+ curstate = jp_lightpens[0]>>1;
+ curstate |= (jp_lightpens[1]>>1)<<15;
+ curstate |= (jp_fires & 3)<<30;
+
+ if (curstate != prevstate) {
+ /* X axis */
+ SDL_PrivateJoystickAxis(joystick,0,jp_lightpens[0] ^ 0x8000);
+ /* Y axis */
+ SDL_PrivateJoystickAxis(joystick,1,jp_lightpens[1] ^ 0x8000);
+ /* Buttons */
+ for (i=0;i<2;i++) {
+ int button;
+
+ button=1<<(30+i);
+
+ if ((curstate & button) && !(prevstate & button)) {
+ SDL_PrivateJoystickButton(joystick,i,SDL_PRESSED);
+ }
+ if (!(curstate & button) && (prevstate & button)) {
+ SDL_PrivateJoystickButton(joystick,i,SDL_RELEASED);
+ }
+ }
+ }
+ atarijoysticks[numjoystick].prevstate = curstate;
+ }
+ break;
+ case PORTA_ANPAD:
+ case PORTB_ANPAD:
+ {
+ int numpaddle, i;
+
+ numpaddle=0<<1;
+ if (numjoystick==PORTB_ANPAD) numpaddle=1<<1;
+
+ curstate = jp_paddles[numpaddle]>>1;
+ curstate |= (jp_paddles[numpaddle+1]>>1)<<15;
+ curstate |= ((jp_fires>>numpaddle) & 3)<<30;
+
+ if (curstate != prevstate) {
+ /* X axis */
+ SDL_PrivateJoystickAxis(joystick,0,jp_paddles[numpaddle] ^ 0x8000);
+ /* Y axis */
+ SDL_PrivateJoystickAxis(joystick,1,jp_paddles[numpaddle+1] ^ 0x8000);
+ /* Buttons */
+ for (i=0;i<2;i++) {
+ int button;
+
+ button=1<<(30+i);
+
+ if ((curstate & button) && !(prevstate & button)) {
+ SDL_PrivateJoystickButton(joystick,i,SDL_PRESSED);
+ }
+ if (!(curstate & button) && (prevstate & button)) {
+ SDL_PrivateJoystickButton(joystick,i,SDL_RELEASED);
+ }
+ }
+ }
+ atarijoysticks[numjoystick].prevstate = curstate;
+ }
+ break;
+#if 0
+ case PARA_JOY0:
+ case PARA_JOY1:
+ break;
+#endif
+ };
+
+ return;
+}
+
+void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
+{
+ return;
+}
+
+void SDL_SYS_JoystickQuit(void)
+{
+ SDL_numjoysticks=0;
+ return;
+}
+
+/*--- Joypad I/O read/write interface ---*/
+
+#define JOYPAD_IO_BASE (0xffff9200)
+struct JOYPAD_IO_S {
+ Uint16 fires;
+ Uint16 directions;
+ Uint16 dummy1[6];
+ Uint16 paddles[4];
+ Uint16 dummy2[4];
+ Uint16 lightpens[2];
+};
+#define JOYPAD_IO ((*(volatile struct JOYPAD_IO_S *)JOYPAD_IO_BASE))
+
+static const Uint16 joypad_masks[8*4]={
+ 0xfffe, 0xfffd, 0xfffb, 0xfff7,
+ 0xfff0, 0xfff1, 0xfff2, 0xfff3,
+ 0xfff4, 0xfff5, 0xfff6, 0xfff8,
+ 0xfff9, 0xfffa, 0xfffc, 0xffff,
+ 0xffef, 0xffdf, 0xffbf, 0xff7f,
+ 0xff0f, 0xff1f, 0xff2f, 0xff3f,
+ 0xff4f, 0xff5f, 0xff6f, 0xff8f,
+ 0xff9f, 0xffaf, 0xffcf, 0xffff
+};
+
+static void UpdateJoypads(void)
+{
+ Uint16 tmp, i, j;
+ Uint32 cur_fire, cur_dir;
+
+ /*--- This function is called in supervisor mode ---*/
+
+ /* Update joysticks */
+ jp_fires = (~(JOYPAD_IO.fires)) & 15;
+ jp_directions = (~(JOYPAD_IO.directions));
+
+ /* Update lightpen */
+ tmp = JOYPAD_IO.lightpens[0] & 1023;
+ jp_lightpens[0] = (tmp<<6) | (tmp>>4);
+ tmp = JOYPAD_IO.lightpens[1] & 1023;
+ jp_lightpens[1] = (tmp<<6) | (tmp>>4);
+
+ /* Update paddles */
+ tmp = (JOYPAD_IO.paddles[0] & 255);
+ jp_paddles[0] = (tmp<<8) | tmp;
+ tmp = (JOYPAD_IO.paddles[1] & 255);
+ jp_paddles[1] = (tmp<<8) | tmp;
+ tmp = (JOYPAD_IO.paddles[2] & 255);
+ jp_paddles[2] = (tmp<<8) | tmp;
+ tmp = (JOYPAD_IO.paddles[3] & 255);
+ jp_paddles[3] = (tmp<<8) | tmp;
+
+ /* Update joypads on teamtap port A */
+ for (i=0; i<4; i++) {
+ jp_joypads[i] = 0;
+ for (j=0; j<4; j++) {
+ JOYPAD_IO.directions = joypad_masks[(i*4)+j];
+
+ cur_fire = (~(JOYPAD_IO.fires) & 3)<<16;
+ cur_dir = (~(JOYPAD_IO.directions)>>8) & 15;
+
+ jp_joypads[i] |= cur_fire<<(j*2);
+ jp_joypads[i] |= cur_dir<<(j*4);
+ }
+ }
+
+ /* Update joypads on teamtap port B */
+ for (i=4; i<8; i++) {
+ jp_joypads[i] = 0;
+ for (j=0; j<4; j++) {
+ JOYPAD_IO.directions = joypad_masks[(i*4)+j];
+
+ cur_fire = (~(JOYPAD_IO.fires) & 0xc)<<14;
+ cur_dir = (~(JOYPAD_IO.directions)>>12) & 15;
+
+ jp_joypads[i] |= cur_fire<<(j*2);
+ jp_joypads[i] |= cur_dir<<(j*4);
+ }
+ }
+
+ JOYPAD_IO.directions=0xffff;
+}
+
+#endif /* SDL_JOYSTICK_MINT */
diff --git a/distrib/sdl-1.2.15/src/joystick/nds/SDL_sysjoystick.c b/distrib/sdl-1.2.15/src/joystick/nds/SDL_sysjoystick.c
new file mode 100644
index 0000000..122f48d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/joystick/nds/SDL_sysjoystick.c
@@ -0,0 +1,150 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This is the system specific header for the SDL joystick API */
+#include <nds.h>
+//#include <nds/registers_alt.h>
+
+#include "SDL_error.h"
+#include "SDL_events.h"
+#include "SDL_joystick.h"
+#include "../SDL_sysjoystick.h"
+#include "../SDL_joystick_c.h"
+
+#include "../../video/nds/SDL_ndsevents_c.h"
+
+/* Function to scan the system for joysticks.
+ * This function should set SDL_numjoysticks to the number of available
+ * joysticks. Joystick 0 should be the system default joystick.
+ * It should return 0, or -1 on an unrecoverable fatal error.
+ */
+int SDL_SYS_JoystickInit(void)
+{
+ SDL_numjoysticks = 1;
+ //keysInit();
+
+ return(1);
+}
+
+/* Function to get the device-dependent name of a joystick */
+const char *SDL_SYS_JoystickName(int index)
+{
+ if(!index)
+ return "NDS builtin joypad";
+ SDL_SetError("No joystick available with that index");
+ return (NULL);
+}
+
+/* Function to open a joystick for use.
+ The joystick to open is specified by the index field of the joystick.
+ This should fill the nbuttons and naxes fields of the joystick structure.
+ It returns 0, or -1 if there is an error.
+ */
+int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
+{
+ joystick->nbuttons=8;
+ joystick->nhats=0;
+ joystick->nballs=0;
+ joystick->naxes=2;
+ return 0;
+}
+
+
+/* Function to update the state of a joystick - called as a device poll.
+ * This function shouldn't update the joystick structure directly,
+ * but instead should call SDL_PrivateJoystick*() to deliver events
+ * and update joystick device state.
+ */
+
+int prevbutton=0;
+int prevkey=0;
+
+int dc=0;int ldc=0;
+u32 keysd,keysu=0;
+void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
+{
+ //dc=keysd;
+ //if (dc)
+ //{
+ //fprintf(stderr,"heartbeat= %d\n",REG_VCOUNT);
+ //swiWaitForVBlank();
+ //scanKeys();
+ //keysd = keysDown();
+ //keysu = keysUp();
+ //ldc=keysd;
+
+ //}
+ /*if (prevkey && prevbutton)
+ {
+ scanKeys();
+ }
+ */
+
+ //scanKeys();
+ keysd = keysDown();
+ keysu = keysUp();
+
+
+ short ax=0,v=0,h=0;
+ if((keysd&KEY_UP)) {ax=1;v=-10;SDL_PrivateJoystickAxis(joystick,ax,v);prevkey=KEY_UP;}//fprintf(stderr,"KEY_UP\n");}
+ if((keysd&KEY_DOWN)) {ax=1;v=10;SDL_PrivateJoystickAxis(joystick,ax,v);prevkey=KEY_DOWN;}//fprintf(stderr,"KEY_DOWN\n");}
+ if((keysd&KEY_LEFT)) {ax=0;h=-10;SDL_PrivateJoystickAxis(joystick,ax,h);prevkey=KEY_LEFT;}//fprintf(stderr,"KEY_LEFT\n");}
+ if((keysd&KEY_RIGHT)) {ax=0;h=10;SDL_PrivateJoystickAxis(joystick,ax,h);prevkey=KEY_RIGHT;}//fprintf(stderr,"KEY_RIGHT\n");}
+
+ if((keysu&KEY_UP)) {ax=1;v=0;SDL_PrivateJoystickAxis(joystick,ax,v);prevkey=0;}//fprintf(stderr,"KEY_UP\n");}
+ if((keysu&KEY_DOWN)) {ax=1;v=0;SDL_PrivateJoystickAxis(joystick,ax,v);prevkey=0;}//fprintf(stderr,"KEY_DOWN\n");}
+ if((keysu&KEY_LEFT)) {ax=0;h=0;SDL_PrivateJoystickAxis(joystick,ax,h);prevkey=0;}//fprintf(stderr,"KEY_LEFT\n");}
+ if((keysu&KEY_RIGHT)) {ax=0;h=0;SDL_PrivateJoystickAxis(joystick,ax,h);prevkey=0;}//fprintf(stderr,"KEY_RIGHT\n");}
+
+ if((keysd&KEY_A)) {SDL_PrivateJoystickButton(joystick,0,SDL_PRESSED);prevbutton=KEY_A;}
+ if((keysd&KEY_B)) {SDL_PrivateJoystickButton(joystick,1,SDL_PRESSED);prevbutton=KEY_B;}
+ if((keysd&KEY_X)) {SDL_PrivateJoystickButton(joystick,2,SDL_PRESSED);prevbutton=KEY_X;}
+ if((keysd&KEY_Y)) {SDL_PrivateJoystickButton(joystick,3,SDL_PRESSED);prevbutton=KEY_Y;}
+ if((keysd&KEY_SELECT)) {SDL_PrivateJoystickButton(joystick,6,SDL_PRESSED);prevbutton=KEY_SELECT;}
+ if((keysd&KEY_START)) {SDL_PrivateJoystickButton(joystick,7,SDL_PRESSED);prevbutton=KEY_START;}
+ if((keysd&KEY_L)) {SDL_PrivateJoystickButton(joystick,4,SDL_PRESSED);prevbutton=KEY_L;}
+ if((keysd&KEY_R)) {SDL_PrivateJoystickButton(joystick,5,SDL_PRESSED);prevbutton=KEY_R;}
+
+ if((keysu&KEY_A)) {SDL_PrivateJoystickButton(joystick,0,SDL_RELEASED);prevbutton=0;}
+ if((keysu&KEY_B)) {SDL_PrivateJoystickButton(joystick,1,SDL_RELEASED);prevbutton=0;}
+ if((keysu&KEY_X)) {SDL_PrivateJoystickButton(joystick,2,SDL_RELEASED);prevbutton=0;}
+ if((keysu&KEY_Y)) {SDL_PrivateJoystickButton(joystick,3,SDL_RELEASED);prevbutton=0;}
+ if((keysu&KEY_SELECT)) {SDL_PrivateJoystickButton(joystick,6,SDL_RELEASED);prevbutton=0;}
+ if((keysu&KEY_START)) {SDL_PrivateJoystickButton(joystick,7,SDL_RELEASED);prevbutton=0;}
+ if((keysu&KEY_L)) {SDL_PrivateJoystickButton(joystick,4,SDL_RELEASED);prevbutton=0;}
+ if((keysu&KEY_R)) {SDL_PrivateJoystickButton(joystick,5,SDL_RELEASED);prevbutton=0;}
+
+
+
+}
+
+/* Function to close a joystick after use */
+void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
+{
+}
+
+/* Function to perform any system-specific joystick related cleanup */
+void SDL_SYS_JoystickQuit(void)
+{
+}
+
diff --git a/distrib/sdl-1.2.15/src/joystick/riscos/SDL_sysjoystick.c b/distrib/sdl-1.2.15/src/joystick/riscos/SDL_sysjoystick.c
new file mode 100644
index 0000000..214d4c7
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/joystick/riscos/SDL_sysjoystick.c
@@ -0,0 +1,176 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_JOYSTICK_RISCOS
+
+/*
+ RISC OS - Joystick support by Alan Buckley (alan_baa@hotmail.com) - 10 April 2003
+
+ Note: Currently assumes joystick is present if joystick module is loaded
+ and that there is one joystick with four buttons.
+*/
+
+/* This is the system specific header for the SDL joystick API */
+
+#include "SDL_events.h"
+#include "SDL_joystick.h"
+#include "../SDL_sysjoystick.h"
+#include "../SDL_joystick_c.h"
+
+#include "kernel.h"
+
+#define JOYSTICK_READ 0x43F40
+
+struct joystick_hwdata
+{
+ int joystate;
+};
+
+
+/* Function to scan the system for joysticks.
+ * This function should set SDL_numjoysticks to the number of available
+ * joysticks. Joystick 0 should be the system default joystick.
+ * It should return number of joysticks, or -1 on an unrecoverable fatal error.
+ */
+int SDL_SYS_JoystickInit(void)
+{
+ _kernel_swi_regs regs;
+
+ /* Try to read joystick 0 */
+ regs.r[0] = 0;
+ if (_kernel_swi(JOYSTICK_READ, &regs, &regs) == NULL)
+ {
+ /* Switch works so assume we've got a joystick */
+ return 1;
+ }
+ /* Switch fails so it looks like there's no joystick here */
+
+ return(0);
+}
+
+/* Function to get the device-dependent name of a joystick */
+const char *SDL_SYS_JoystickName(int index)
+{
+ if (index == 0)
+ {
+ return "RISC OS Joystick 0";
+ }
+
+ SDL_SetError("No joystick available with that index");
+ return(NULL);
+}
+
+/* Function to open a joystick for use.
+ The joystick to open is specified by the index field of the joystick.
+ This should fill the nbuttons and naxes fields of the joystick structure.
+ It returns 0, or -1 if there is an error.
+ */
+int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
+{
+ _kernel_swi_regs regs;
+
+ if(!(joystick->hwdata=SDL_malloc(sizeof(struct joystick_hwdata))))
+ return -1;
+
+ regs.r[0] = joystick->index;
+
+ /* Don't know how to get exact count of buttons so assume max of 4 for now */
+ joystick->nbuttons=4;
+
+ joystick->nhats=0;
+ joystick->nballs=0;
+ joystick->naxes=2;
+ joystick->hwdata->joystate=0;
+
+ return 0;
+
+}
+
+/* Function to update the state of a joystick - called as a device poll.
+ * This function shouldn't update the joystick structure directly,
+ * but instead should call SDL_PrivateJoystick*() to deliver events
+ * and update joystick device state.
+ */
+void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
+{
+ _kernel_swi_regs regs;
+ regs.r[0] = joystick->index;
+
+ if (_kernel_swi(JOYSTICK_READ, &regs, &regs) == NULL)
+ {
+ int newstate = regs.r[0];
+ int oldstate = joystick->hwdata->joystate;
+ if (newstate != oldstate)
+ {
+ if ((newstate & 0xFF) != (oldstate & 0xFF))
+ {
+ int y = regs.r[0] & 0xFF;
+ /* Convert to signed values */
+ if (y >= 128) y -= 256;
+ SDL_PrivateJoystickAxis(joystick,1,-y * 256); /* Up and down opposite to result in SDL */
+ }
+ if ((newstate & 0xFF00) != (oldstate & 0xFF00))
+ {
+ int x = (regs.r[0] & 0xFF00) >> 8;
+ if (x >= 128) x -= 256;
+ SDL_PrivateJoystickAxis(joystick,0,x * 256);
+ }
+
+ if ((newstate & 0xFF0000) != (oldstate & 0xFF0000))
+ {
+ int buttons = (regs.r[0] & 0xFF0000) >> 16;
+ int oldbuttons = (oldstate & 0xFF0000) >> 16;
+ int i;
+ for (i = 0; i < joystick->nbuttons; i++)
+ {
+ if ((buttons & (1<<i)) != (oldbuttons & (1<<i)))
+ {
+ if (buttons & (1<<i)) SDL_PrivateJoystickButton(joystick,i,SDL_PRESSED);
+ else SDL_PrivateJoystickButton(joystick,i,SDL_RELEASED);
+ }
+ }
+ }
+ joystick->hwdata->joystate = newstate;
+ }
+ }
+
+ return;
+}
+
+/* Function to close a joystick after use */
+void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
+{
+ if(joystick->hwdata)
+ SDL_free(joystick->hwdata);
+ return;
+}
+
+/* Function to perform any system-specific joystick related cleanup */
+void SDL_SYS_JoystickQuit(void)
+{
+ SDL_numjoysticks=0;
+
+ return;
+}
+
+#endif /* SDL_JOYSTICK_RISCOS */
diff --git a/distrib/sdl-1.2.15/src/joystick/win32/SDL_mmjoystick.c b/distrib/sdl-1.2.15/src/joystick/win32/SDL_mmjoystick.c
new file mode 100644
index 0000000..8c53f9e
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/joystick/win32/SDL_mmjoystick.c
@@ -0,0 +1,407 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_JOYSTICK_WINMM
+
+/* Win32 MultiMedia Joystick driver, contributed by Andrei de A. Formiga */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <mmsystem.h>
+#include <regstr.h>
+
+#include "SDL_events.h"
+#include "SDL_joystick.h"
+#include "../SDL_sysjoystick.h"
+#include "../SDL_joystick_c.h"
+
+#define MAX_JOYSTICKS 16
+#define MAX_AXES 6 /* each joystick can have up to 6 axes */
+#define MAX_BUTTONS 32 /* and 32 buttons */
+#define AXIS_MIN -32768 /* minimum value for axis coordinate */
+#define AXIS_MAX 32767 /* maximum value for axis coordinate */
+/* limit axis to 256 possible positions to filter out noise */
+#define JOY_AXIS_THRESHOLD (((AXIS_MAX)-(AXIS_MIN))/256)
+#define JOY_BUTTON_FLAG(n) (1<<n)
+
+
+/* array to hold joystick ID values */
+static UINT SYS_JoystickID[MAX_JOYSTICKS];
+static JOYCAPS SYS_Joystick[MAX_JOYSTICKS];
+static char *SYS_JoystickName[MAX_JOYSTICKS];
+
+/* The private structure used to keep track of a joystick */
+struct joystick_hwdata
+{
+ /* joystick ID */
+ UINT id;
+
+ /* values used to translate device-specific coordinates into
+ SDL-standard ranges */
+ struct _transaxis {
+ int offset;
+ float scale;
+ } transaxis[6];
+};
+
+/* Convert a win32 Multimedia API return code to a text message */
+static void SetMMerror(char *function, int code);
+
+
+static char *GetJoystickName(int index, const char *szRegKey)
+{
+ /* added 7/24/2004 by Eckhard Stolberg */
+ /*
+ see if there is a joystick for the current
+ index (1-16) listed in the registry
+ */
+ char *name = NULL;
+ HKEY hTopKey;
+ HKEY hKey;
+ DWORD regsize;
+ LONG regresult;
+ char regkey[256];
+ char regvalue[256];
+ char regname[256];
+
+ SDL_snprintf(regkey, SDL_arraysize(regkey), "%s\\%s\\%s",
+ REGSTR_PATH_JOYCONFIG, szRegKey, REGSTR_KEY_JOYCURR);
+ hTopKey = HKEY_LOCAL_MACHINE;
+ regresult = RegOpenKeyExA(hTopKey, regkey, 0, KEY_READ, &hKey);
+ if (regresult != ERROR_SUCCESS) {
+ hTopKey = HKEY_CURRENT_USER;
+ regresult = RegOpenKeyExA(hTopKey, regkey, 0, KEY_READ, &hKey);
+ }
+ if (regresult != ERROR_SUCCESS) {
+ return NULL;
+ }
+
+ /* find the registry key name for the joystick's properties */
+ regsize = sizeof(regname);
+ SDL_snprintf(regvalue, SDL_arraysize(regvalue), "Joystick%d%s", index+1, REGSTR_VAL_JOYOEMNAME);
+ regresult = RegQueryValueExA(hKey, regvalue, 0, 0, (LPBYTE)regname, &regsize);
+ RegCloseKey(hKey);
+
+ if (regresult != ERROR_SUCCESS) {
+ return NULL;
+ }
+
+ /* open that registry key */
+ SDL_snprintf(regkey, SDL_arraysize(regkey), "%s\\%s", REGSTR_PATH_JOYOEM, regname);
+ regresult = RegOpenKeyExA(hTopKey, regkey, 0, KEY_READ, &hKey);
+ if (regresult != ERROR_SUCCESS) {
+ return NULL;
+ }
+
+ /* find the size for the OEM name text */
+ regsize = sizeof(regvalue);
+ regresult = RegQueryValueExA(hKey, REGSTR_VAL_JOYOEMNAME, 0, 0, NULL, &regsize);
+ if (regresult == ERROR_SUCCESS) {
+ /* allocate enough memory for the OEM name text ... */
+ name = (char *) SDL_malloc(regsize);
+ if ( name ) {
+ /* ... and read it from the registry */
+ regresult = RegQueryValueExA(hKey,
+ REGSTR_VAL_JOYOEMNAME, 0, 0,
+ (LPBYTE) name, &regsize);
+ }
+ }
+ RegCloseKey(hKey);
+
+ return(name);
+}
+
+/* Function to scan the system for joysticks.
+ * This function should set SDL_numjoysticks to the number of available
+ * joysticks. Joystick 0 should be the system default joystick.
+ * It should return 0, or -1 on an unrecoverable fatal error.
+ */
+int SDL_SYS_JoystickInit(void)
+{
+ int i;
+ int maxdevs;
+ int numdevs;
+ JOYINFOEX joyinfo;
+ JOYCAPS joycaps;
+ MMRESULT result;
+
+ /* Reset the joystick ID & name mapping tables */
+ for ( i = 0; i < MAX_JOYSTICKS; ++i ) {
+ SYS_JoystickID[i] = 0;
+ SYS_JoystickName[i] = NULL;
+ }
+
+ /* Loop over all potential joystick devices */
+ numdevs = 0;
+ maxdevs = joyGetNumDevs();
+ for ( i = JOYSTICKID1; i < maxdevs && numdevs < MAX_JOYSTICKS; ++i ) {
+
+ joyinfo.dwSize = sizeof(joyinfo);
+ joyinfo.dwFlags = JOY_RETURNALL;
+ result = joyGetPosEx(i, &joyinfo);
+ if ( result == JOYERR_NOERROR ) {
+ result = joyGetDevCaps(i, &joycaps, sizeof(joycaps));
+ if ( result == JOYERR_NOERROR ) {
+ SYS_JoystickID[numdevs] = i;
+ SYS_Joystick[numdevs] = joycaps;
+ SYS_JoystickName[numdevs] = GetJoystickName(i, joycaps.szRegKey);
+ numdevs++;
+ }
+ }
+ }
+ return(numdevs);
+}
+
+/* Function to get the device-dependent name of a joystick */
+const char *SDL_SYS_JoystickName(int index)
+{
+ if ( SYS_JoystickName[index] != NULL ) {
+ return(SYS_JoystickName[index]);
+ } else {
+ return(SYS_Joystick[index].szPname);
+ }
+}
+
+/* Function to open a joystick for use.
+ The joystick to open is specified by the index field of the joystick.
+ This should fill the nbuttons and naxes fields of the joystick structure.
+ It returns 0, or -1 if there is an error.
+ */
+int SDL_SYS_JoystickOpen(SDL_Joystick *joystick)
+{
+ int index, i;
+ int caps_flags[MAX_AXES-2] =
+ { JOYCAPS_HASZ, JOYCAPS_HASR, JOYCAPS_HASU, JOYCAPS_HASV };
+ int axis_min[MAX_AXES], axis_max[MAX_AXES];
+
+
+ /* shortcut */
+ index = joystick->index;
+ axis_min[0] = SYS_Joystick[index].wXmin;
+ axis_max[0] = SYS_Joystick[index].wXmax;
+ axis_min[1] = SYS_Joystick[index].wYmin;
+ axis_max[1] = SYS_Joystick[index].wYmax;
+ axis_min[2] = SYS_Joystick[index].wZmin;
+ axis_max[2] = SYS_Joystick[index].wZmax;
+ axis_min[3] = SYS_Joystick[index].wRmin;
+ axis_max[3] = SYS_Joystick[index].wRmax;
+ axis_min[4] = SYS_Joystick[index].wUmin;
+ axis_max[4] = SYS_Joystick[index].wUmax;
+ axis_min[5] = SYS_Joystick[index].wVmin;
+ axis_max[5] = SYS_Joystick[index].wVmax;
+
+ /* allocate memory for system specific hardware data */
+ joystick->hwdata = (struct joystick_hwdata *) SDL_malloc(sizeof(*joystick->hwdata));
+ if (joystick->hwdata == NULL)
+ {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
+
+ /* set hardware data */
+ joystick->hwdata->id = SYS_JoystickID[index];
+ for ( i = 0; i < MAX_AXES; ++i ) {
+ if ( (i<2) || (SYS_Joystick[index].wCaps & caps_flags[i-2]) ) {
+ joystick->hwdata->transaxis[i].offset =
+ AXIS_MIN - axis_min[i];
+ joystick->hwdata->transaxis[i].scale =
+ (float)(AXIS_MAX - AXIS_MIN) / (axis_max[i] - axis_min[i]);
+ } else {
+ joystick->hwdata->transaxis[i].offset = 0;
+ joystick->hwdata->transaxis[i].scale = 1.0; /* Just in case */
+ }
+ }
+
+ /* fill nbuttons, naxes, and nhats fields */
+ joystick->nbuttons = SYS_Joystick[index].wNumButtons;
+ joystick->naxes = SYS_Joystick[index].wNumAxes;
+ if ( SYS_Joystick[index].wCaps & JOYCAPS_HASPOV ) {
+ joystick->nhats = 1;
+ } else {
+ joystick->nhats = 0;
+ }
+ return(0);
+}
+
+static Uint8 TranslatePOV(DWORD value)
+{
+ Uint8 pos;
+
+ pos = SDL_HAT_CENTERED;
+ if ( value != JOY_POVCENTERED ) {
+ if ( (value > JOY_POVLEFT) || (value < JOY_POVRIGHT) ) {
+ pos |= SDL_HAT_UP;
+ }
+ if ( (value > JOY_POVFORWARD) && (value < JOY_POVBACKWARD) ) {
+ pos |= SDL_HAT_RIGHT;
+ }
+ if ( (value > JOY_POVRIGHT) && (value < JOY_POVLEFT) ) {
+ pos |= SDL_HAT_DOWN;
+ }
+ if ( value > JOY_POVBACKWARD ) {
+ pos |= SDL_HAT_LEFT;
+ }
+ }
+ return(pos);
+}
+
+/* Function to update the state of a joystick - called as a device poll.
+ * This function shouldn't update the joystick structure directly,
+ * but instead should call SDL_PrivateJoystick*() to deliver events
+ * and update joystick device state.
+ */
+void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
+{
+ MMRESULT result;
+ int i;
+ DWORD flags[MAX_AXES] = { JOY_RETURNX, JOY_RETURNY, JOY_RETURNZ,
+ JOY_RETURNR, JOY_RETURNU, JOY_RETURNV };
+ DWORD pos[MAX_AXES];
+ struct _transaxis *transaxis;
+ int value, change;
+ JOYINFOEX joyinfo;
+
+ joyinfo.dwSize = sizeof(joyinfo);
+ joyinfo.dwFlags = JOY_RETURNALL|JOY_RETURNPOVCTS;
+ if ( ! joystick->hats ) {
+ joyinfo.dwFlags &= ~(JOY_RETURNPOV|JOY_RETURNPOVCTS);
+ }
+ result = joyGetPosEx(joystick->hwdata->id, &joyinfo);
+ if ( result != JOYERR_NOERROR ) {
+ SetMMerror("joyGetPosEx", result);
+ return;
+ }
+
+ /* joystick motion events */
+ pos[0] = joyinfo.dwXpos;
+ pos[1] = joyinfo.dwYpos;
+ pos[2] = joyinfo.dwZpos;
+ pos[3] = joyinfo.dwRpos;
+ pos[4] = joyinfo.dwUpos;
+ pos[5] = joyinfo.dwVpos;
+
+ transaxis = joystick->hwdata->transaxis;
+ for (i = 0; i < joystick->naxes; i++) {
+ if (joyinfo.dwFlags & flags[i]) {
+ value = (int)(((float)pos[i] + transaxis[i].offset) * transaxis[i].scale);
+ change = (value - joystick->axes[i]);
+ if ( (change < -JOY_AXIS_THRESHOLD) || (change > JOY_AXIS_THRESHOLD) ) {
+ SDL_PrivateJoystickAxis(joystick, (Uint8)i, (Sint16)value);
+ }
+ }
+ }
+
+ /* joystick button events */
+ if ( joyinfo.dwFlags & JOY_RETURNBUTTONS ) {
+ for ( i = 0; i < joystick->nbuttons; ++i ) {
+ if ( joyinfo.dwButtons & JOY_BUTTON_FLAG(i) ) {
+ if ( ! joystick->buttons[i] ) {
+ SDL_PrivateJoystickButton(joystick, (Uint8)i, SDL_PRESSED);
+ }
+ } else {
+ if ( joystick->buttons[i] ) {
+ SDL_PrivateJoystickButton(joystick, (Uint8)i, SDL_RELEASED);
+ }
+ }
+ }
+ }
+
+ /* joystick hat events */
+ if ( joyinfo.dwFlags & JOY_RETURNPOV ) {
+ Uint8 pos;
+
+ pos = TranslatePOV(joyinfo.dwPOV);
+ if ( pos != joystick->hats[0] ) {
+ SDL_PrivateJoystickHat(joystick, 0, pos);
+ }
+ }
+}
+
+/* Function to close a joystick after use */
+void SDL_SYS_JoystickClose(SDL_Joystick *joystick)
+{
+ if (joystick->hwdata != NULL) {
+ /* free system specific hardware data */
+ SDL_free(joystick->hwdata);
+ joystick->hwdata = NULL;
+ }
+}
+
+/* Function to perform any system-specific joystick related cleanup */
+void SDL_SYS_JoystickQuit(void)
+{
+ int i;
+ for (i = 0; i < MAX_JOYSTICKS; i++) {
+ if ( SYS_JoystickName[i] != NULL ) {
+ SDL_free(SYS_JoystickName[i]);
+ SYS_JoystickName[i] = NULL;
+ }
+ }
+}
+
+
+/* implementation functions */
+void SetMMerror(char *function, int code)
+{
+ static char *error;
+ static char errbuf[1024];
+
+ errbuf[0] = 0;
+ switch (code)
+ {
+ case MMSYSERR_NODRIVER:
+ error = "Joystick driver not present";
+ break;
+
+ case MMSYSERR_INVALPARAM:
+ case JOYERR_PARMS:
+ error = "Invalid parameter(s)";
+ break;
+
+ case MMSYSERR_BADDEVICEID:
+ error = "Bad device ID";
+ break;
+
+ case JOYERR_UNPLUGGED:
+ error = "Joystick not attached";
+ break;
+
+ case JOYERR_NOCANDO:
+ error = "Can't capture joystick input";
+ break;
+
+ default:
+ SDL_snprintf(errbuf, SDL_arraysize(errbuf),
+ "%s: Unknown Multimedia system error: 0x%x",
+ function, code);
+ break;
+ }
+
+ if ( ! errbuf[0] ) {
+ SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: %s", function, error);
+ }
+ SDL_SetError("%s", errbuf);
+}
+
+#endif /* SDL_JOYSTICK_WINMM */
diff --git a/distrib/sdl-1.2.15/src/loadso/beos/SDL_sysloadso.c b/distrib/sdl-1.2.15/src/loadso/beos/SDL_sysloadso.c
new file mode 100644
index 0000000..28267b7
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/loadso/beos/SDL_sysloadso.c
@@ -0,0 +1,72 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_LOADSO_BEOS
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/* System dependent library loading routines */
+
+#include <stdio.h>
+#include <be/kernel/image.h>
+
+#include "SDL_loadso.h"
+
+void *
+SDL_LoadObject(const char *sofile)
+{
+ void *handle = NULL;
+ image_id library_id = load_add_on(sofile);
+ if (library_id < 0) {
+ SDL_SetError(strerror((int) library_id));
+ } else {
+ handle = (void *) (library_id);
+ }
+ return (handle);
+}
+
+void *
+SDL_LoadFunction(void *handle, const char *name)
+{
+ void *sym = NULL;
+ image_id library_id = (image_id) handle;
+ status_t rc = get_image_symbol(library_id, name, B_SYMBOL_TYPE_TEXT, &sym);
+ if (rc != B_NO_ERROR) {
+ SDL_SetError(strerror(rc));
+ }
+ return (sym);
+}
+
+void
+SDL_UnloadObject(void *handle)
+{
+ image_id library_id;
+ if (handle != NULL) {
+ library_id = (image_id) handle;
+ unload_add_on(library_id);
+ }
+}
+
+#endif /* SDL_LOADSO_BEOS */
+
+/* vi: set ts=4 sw=4 expandtab: */
+
diff --git a/distrib/sdl-1.2.15/src/loadso/dlopen/SDL_sysloadso.c b/distrib/sdl-1.2.15/src/loadso/dlopen/SDL_sysloadso.c
new file mode 100644
index 0000000..7985ee7
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/loadso/dlopen/SDL_sysloadso.c
@@ -0,0 +1,69 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_LOADSO_DLOPEN
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/* System dependent library loading routines */
+
+#include <stdio.h>
+#include <dlfcn.h>
+
+#include "SDL_loadso.h"
+
+void *SDL_LoadObject(const char *sofile)
+{
+ void *handle = dlopen(sofile, RTLD_NOW);
+ const char *loaderror = (char *)dlerror();
+ if ( handle == NULL ) {
+ SDL_SetError("Failed loading %s: %s", sofile, loaderror);
+ }
+ return(handle);
+}
+
+void *SDL_LoadFunction(void *handle, const char *name)
+{
+ void *symbol = dlsym(handle, name);
+ if ( symbol == NULL ) {
+ /* append an underscore for platforms that need that. */
+ size_t len = 1+SDL_strlen(name)+1;
+ char *_name = SDL_stack_alloc(char, len);
+ _name[0] = '_';
+ SDL_strlcpy(&_name[1], name, len);
+ symbol = dlsym(handle, _name);
+ SDL_stack_free(_name);
+ if ( symbol == NULL ) {
+ SDL_SetError("Failed loading %s: %s", name, (const char *)dlerror());
+ }
+ }
+ return(symbol);
+}
+
+void SDL_UnloadObject(void *handle)
+{
+ if ( handle != NULL ) {
+ dlclose(handle);
+ }
+}
+
+#endif /* SDL_LOADSO_DLOPEN */
diff --git a/distrib/sdl-1.2.15/src/loadso/dummy/SDL_sysloadso.c b/distrib/sdl-1.2.15/src/loadso/dummy/SDL_sysloadso.c
new file mode 100644
index 0000000..f8c9af9
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/loadso/dummy/SDL_sysloadso.c
@@ -0,0 +1,50 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#if defined(SDL_LOADSO_DUMMY) || defined(SDL_LOADSO_DISABLED)
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/* System dependent library loading routines */
+
+#include "SDL_loadso.h"
+
+void *SDL_LoadObject(const char *sofile)
+{
+ const char *loaderror = "SDL_LoadObject() not implemented";
+ SDL_SetError("Failed loading %s: %s", sofile, loaderror);
+ return(NULL);
+}
+
+void *SDL_LoadFunction(void *handle, const char *name)
+{
+ const char *loaderror = "SDL_LoadFunction() not implemented";
+ SDL_SetError("Failed loading %s: %s", name, loaderror);
+ return(NULL);
+}
+
+void SDL_UnloadObject(void *handle)
+{
+ /* no-op. */
+}
+
+#endif /* SDL_LOADSO_DUMMY || SDL_LOADSO_DISABLED */
diff --git a/distrib/sdl-1.2.15/src/loadso/macos/SDL_sysloadso.c b/distrib/sdl-1.2.15/src/loadso/macos/SDL_sysloadso.c
new file mode 100644
index 0000000..c035b17
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/loadso/macos/SDL_sysloadso.c
@@ -0,0 +1,106 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_LOADSO_MACOS
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/* System dependent library loading routines */
+
+#include <stdio.h>
+#include <string.h>
+#define OLDP2C 1
+#include <Strings.h>
+#include <CodeFragments.h>
+#include <Errors.h>
+
+#include "SDL_loadso.h"
+
+void *SDL_LoadObject(const char *sofile)
+{
+ void *handle = NULL;
+ const char *loaderror = NULL;
+ CFragConnectionID library_id;
+ Ptr mainAddr;
+ Str255 errName;
+ OSErr error;
+ char psofile[512];
+
+ SDL_strlcpy(psofile, sofile, SDL_arraysize(psofile));
+ error = GetSharedLibrary(C2PStr(psofile), kCompiledCFragArch,
+ kLoadCFrag, &library_id, &mainAddr, errName);
+ switch (error) {
+ case noErr:
+ loaderror = NULL;
+ break;
+ case cfragNoLibraryErr:
+ loaderror = "Library not found";
+ break;
+ case cfragUnresolvedErr:
+ loaderror = "Unabled to resolve symbols";
+ break;
+ case cfragNoPrivateMemErr:
+ case cfragNoClientMemErr:
+ loaderror = "Out of memory";
+ break;
+ default:
+ loaderror = "Unknown Code Fragment Manager error";
+ break;
+ }
+ if ( loaderror == NULL ) {
+ handle = (void *)(library_id);
+ } else {
+ SDL_SetError("Failed loading %s: %s", sofile, loaderror);
+ }
+ return(handle);
+}
+
+void *SDL_LoadFunction(void *handle, const char *name)
+{
+ void *symbol = NULL;
+ const char *loaderror = NULL;
+ CFragSymbolClass class;
+ CFragConnectionID library_id = (CFragConnectionID)handle;
+ char pname[512];
+
+ SDL_strlcpy(pname, name, SDL_arraysize(pname));
+ if ( FindSymbol(library_id, C2PStr(pname),
+ (char **)&symbol, &class) != noErr ) {
+ loaderror = "Symbol not found";
+ }
+
+ if ( symbol == NULL ) {
+ SDL_SetError("Failed loading %s: %s", name, loaderror);
+ }
+ return(symbol);
+}
+
+void SDL_UnloadObject(void *handle)
+{
+ CFragConnectionID library_id;
+ if ( handle != NULL ) {
+ library_id = (CFragConnectionID)handle;
+ CloseConnection(&library_id);
+ }
+}
+
+#endif /* SDL_LOADSO_MACOS */
diff --git a/distrib/sdl-1.2.15/src/loadso/macosx/SDL_dlcompat.c b/distrib/sdl-1.2.15/src/loadso/macosx/SDL_dlcompat.c
new file mode 100644
index 0000000..091947f
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/loadso/macosx/SDL_dlcompat.c
@@ -0,0 +1,1407 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_LOADSO_DLCOMPAT
+
+/* Please note that dlcompat apparently ships in current Mac OS X versions
+ * as a system library that provides compatibility with the Unix "dlopen"
+ * interface. In order to allow SDL to work on older OS X releases and also
+ * not conflict with the system lib on newer versions, we include dlcompat
+ * in SDL and change the symbols to prevent symbol clash with any existing
+ * system libraries. --ryan.
+ */
+
+/* here is the dlcompat license: */
+
+/*
+Copyright (c) 2002 Jorge Acereda <jacereda@users.sourceforge.net> &
+ Peter O'Gorman <ogorman@users.sourceforge.net>
+
+Portions may be copyright others, see the AUTHORS file included with this
+distribution.
+
+Maintained by Peter O'Gorman <ogorman@users.sourceforge.net>
+
+Bug Reports and other queries should go to <ogorman@users.sourceforge.net>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#include <pthread.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdarg.h>
+#include <limits.h>
+#include <mach-o/dyld.h>
+#include <mach-o/nlist.h>
+#include <mach-o/getsect.h>
+
+#include "SDL_stdinc.h"
+
+/* Just playing to see if it would compile with the freebsd headers, it does,
+ * but because of the different values for RTLD_LOCAL etc, it would break binary
+ * compat... oh well
+ */
+#ifndef __BSD_VISIBLE
+#define __BSD_VISIBLE 1
+#endif
+
+/*include "dlfcn.h"*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined (__GNUC__) && __GNUC__ > 3
+#define dl_restrict __restrict
+#else
+#define dl_restrict
+#endif
+
+#if 0
+#ifndef _POSIX_SOURCE
+/*
+ * Structure filled in by dladdr().
+ */
+typedef struct SDL_OSX_dl_info {
+ const char *dli_fname; /* Pathname of shared object */
+ void *dli_fbase; /* Base address of shared object */
+ const char *dli_sname; /* Name of nearest symbol */
+ void *dli_saddr; /* Address of nearest symbol */
+} SDL_OSX_Dl_info;
+
+static int SDL_OSX_dladdr(const void * dl_restrict, SDL_OSX_Dl_info * dl_restrict);
+#endif /* ! _POSIX_SOURCE */
+#endif /* 0 */
+
+static int SDL_OSX_dlclose(void * handle);
+static const char * SDL_OSX_dlerror(void);
+static void * SDL_OSX_dlopen(const char *path, int mode);
+static void * SDL_OSX_dlsym(void * dl_restrict handle, const char * dl_restrict symbol);
+
+#define RTLD_LAZY 0x1
+#define RTLD_NOW 0x2
+#define RTLD_LOCAL 0x4
+#define RTLD_GLOBAL 0x8
+
+#ifndef _POSIX_SOURCE
+#define RTLD_NOLOAD 0x10
+#define RTLD_NODELETE 0x80
+
+/*
+ * Special handle arguments for SDL_OSX_dlsym().
+ */
+#define RTLD_NEXT ((void *) -1) /* Search subsequent objects. */
+#define RTLD_DEFAULT ((void *) -2) /* Use default search algorithm. */
+#endif /* ! _POSIX_SOURCE */
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifndef dl_restrict
+#define dl_restrict __restrict
+#endif
+/* This is not available on 10.1 */
+#ifndef LC_LOAD_WEAK_DYLIB
+#define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD)
+#endif
+
+/* With this stuff here, this thing may actually compile/run on 10.0 systems
+ * Not that I have a 10.0 system to test it on anylonger
+ */
+#ifndef LC_REQ_DYLD
+#define LC_REQ_DYLD 0x80000000
+#endif
+#ifndef NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED
+#define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 0x4
+#endif
+#ifndef NSADDIMAGE_OPTION_RETURN_ON_ERROR
+#define NSADDIMAGE_OPTION_RETURN_ON_ERROR 0x1
+#endif
+#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND
+#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0
+#endif
+#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR
+#define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4
+#endif
+/* These symbols will be looked for in dyld */
+static const struct mach_header *(*dyld_NSAddImage) (const char *, unsigned long) = 0;
+static int (*dyld_NSIsSymbolNameDefinedInImage) (const struct mach_header *, const char *) = 0;
+static NSSymbol(*dyld_NSLookupSymbolInImage)
+ (const struct mach_header *, const char *, unsigned long) = 0;
+
+/* Define this to make dlcompat reuse data block. This way in theory we save
+ * a little bit of overhead. However we then couldn't correctly catch excess
+ * calls to SDL_OSX_dlclose(). Hence we don't use this feature
+ */
+#undef REUSE_STATUS
+
+/* Size of the internal error message buffer (used by dlerror()) */
+#define ERR_STR_LEN 251
+
+/* Maximum number of search paths supported by getSearchPath */
+#define MAX_SEARCH_PATHS 32
+
+
+#define MAGIC_DYLIB_OFI ((NSObjectFileImage) 'DYOF')
+#define MAGIC_DYLIB_MOD ((NSModule) 'DYMO')
+
+/* internal flags */
+#define DL_IN_LIST 0x01
+
+/* our mutex */
+static pthread_mutex_t dlcompat_mutex;
+/* Our thread specific storage
+ */
+static pthread_key_t dlerror_key;
+
+struct dlthread
+{
+ int lockcnt;
+ unsigned char errset;
+ char errstr[ERR_STR_LEN];
+};
+
+/* This is our central data structure. Whenever a module is loaded via
+ * SDL_OSX_dlopen(), we create such a struct.
+ */
+struct dlstatus
+{
+ struct dlstatus *next; /* pointer to next element in the linked list */
+ NSModule module;
+ const struct mach_header *lib;
+ int refs; /* reference count */
+ int mode; /* mode in which this module was loaded */
+ dev_t device;
+ ino_t inode;
+ int flags; /* Any internal flags we may need */
+};
+
+/* Head node of the dlstatus list */
+static struct dlstatus mainStatus = { 0, MAGIC_DYLIB_MOD, NULL, -1, RTLD_GLOBAL, 0, 0, 0 };
+static struct dlstatus *stqueue = &mainStatus;
+
+
+/* Storage for the last error message (used by dlerror()) */
+/* static char err_str[ERR_STR_LEN]; */
+/* static int err_filled = 0; */
+
+/* Prototypes to internal functions */
+static void debug(const char *fmt, ...);
+static void error(const char *str, ...);
+static const char *safegetenv(const char *s);
+static const char *searchList(void);
+static const char *getSearchPath(int i);
+static const char *getFullPath(int i, const char *file);
+static const struct stat *findFile(const char *file, const char **fullPath);
+static int isValidStatus(struct dlstatus *status);
+static inline int isFlagSet(int mode, int flag);
+static struct dlstatus *lookupStatus(const struct stat *sbuf);
+static void insertStatus(struct dlstatus *dls, const struct stat *sbuf);
+static int promoteLocalToGlobal(struct dlstatus *dls);
+static void *reference(struct dlstatus *dls, int mode);
+static void *dlsymIntern(struct dlstatus *dls, const char *symbol, int canSetError);
+static struct dlstatus *allocStatus(void);
+static struct dlstatus *loadModule(const char *path, const struct stat *sbuf, int mode);
+static NSSymbol search_linked_libs(const struct mach_header *mh, const char *symbol);
+static const char *get_lib_name(const struct mach_header *mh);
+static const struct mach_header *get_mach_header_from_NSModule(NSModule mod);
+static void dlcompat_init_func(void);
+static inline void dlcompat_init_check(void);
+static inline void dolock(void);
+static inline void dounlock(void);
+static void dlerrorfree(void *data);
+static void resetdlerror(void);
+static const struct mach_header *my_find_image(const char *name);
+static const struct mach_header *image_for_address(const void *address);
+static inline char *dyld_error_str(void);
+
+#if FINK_BUILD
+/* Two Global Functions */
+static void *dlsym_prepend_underscore(void *handle, const char *symbol);
+static void *dlsym_auto_underscore(void *handle, const char *symbol);
+
+/* And their _intern counterparts */
+static void *dlsym_prepend_underscore_intern(void *handle, const char *symbol);
+static void *dlsym_auto_underscore_intern(void *handle, const char *symbol);
+#endif
+
+/* Functions */
+
+static void debug(const char *fmt, ...)
+{
+#if DEBUG > 1
+ va_list arg;
+ va_start(arg, fmt);
+ fprintf(stderr, "DLDEBUG: ");
+ vfprintf(stderr, fmt, arg);
+ fprintf(stderr, "\n");
+ fflush(stderr);
+ va_end(arg);
+#endif
+}
+
+static void error(const char *str, ...)
+{
+ va_list arg;
+ struct dlthread *tss;
+ char * err_str;
+ va_start(arg, str);
+ tss = pthread_getspecific(dlerror_key);
+ err_str = tss->errstr;
+ SDL_strlcpy(err_str, "dlcompat: ", ERR_STR_LEN);
+ vsnprintf(err_str + 10, ERR_STR_LEN - 10, str, arg);
+ va_end(arg);
+ debug("ERROR: %s\n", err_str);
+ tss->errset = 1;
+}
+
+static void warning(const char *str)
+{
+#if DEBUG > 0
+ fprintf(stderr, "WARNING: dlcompat: %s\n", str);
+#endif
+}
+
+static const char *safegetenv(const char *s)
+{
+ const char *ss = SDL_getenv(s);
+ return ss ? ss : "";
+}
+
+/* because this is only used for debugging and error reporting functions, we
+ * don't really care about how elegant it is... it could use the load
+ * commands to find the install name of the library, but...
+ */
+static const char *get_lib_name(const struct mach_header *mh)
+{
+ unsigned long count = _dyld_image_count();
+ unsigned long i;
+ const char *val = NULL;
+ if (mh)
+ {
+ for (i = 0; i < count; i++)
+ {
+ if (mh == _dyld_get_image_header(i))
+ {
+ val = _dyld_get_image_name(i);
+ break;
+ }
+ }
+ }
+ return val;
+}
+
+/* Returns the mach_header for the module bu going through all the loaded images
+ * and finding the one with the same name as the module. There really ought to be
+ * an api for doing this, would be faster, but there isn't one right now
+ */
+static const struct mach_header *get_mach_header_from_NSModule(NSModule mod)
+{
+ const char *mod_name = NSNameOfModule(mod);
+ const struct mach_header *mh = NULL;
+ unsigned long count = _dyld_image_count();
+ unsigned long i;
+ debug("Module name: %s", mod_name);
+ for (i = 0; i < count; i++)
+ {
+ if (!SDL_strcmp(mod_name, _dyld_get_image_name(i)))
+ {
+ mh = _dyld_get_image_header(i);
+ break;
+ }
+ }
+ return mh;
+}
+
+
+/* Compute and return a list of all directories that we should search when
+ * trying to locate a module. We first look at the values of LD_LIBRARY_PATH
+ * and DYLD_LIBRARY_PATH, and then finally fall back to looking into
+ * /usr/lib and /lib. Since both of the environments variables can contain a
+ * list of colon seperated paths, we simply concat them and the two other paths
+ * into one big string, which we then can easily parse.
+ * Splitting this string into the actual path list is done by getSearchPath()
+ */
+static const char *searchList()
+{
+ size_t buf_size;
+ static char *buf=NULL;
+ const char *ldlp = safegetenv("LD_LIBRARY_PATH");
+ const char *dyldlp = safegetenv("DYLD_LIBRARY_PATH");
+ const char *stdpath = SDL_getenv("DYLD_FALLBACK_LIBRARY_PATH");
+ if (!stdpath)
+ stdpath = "/usr/local/lib:/lib:/usr/lib";
+ if (!buf)
+ {
+ buf_size = SDL_strlen(ldlp) + SDL_strlen(dyldlp) + SDL_strlen(stdpath) + 4;
+ buf = SDL_malloc(buf_size);
+ SDL_snprintf(buf, buf_size, "%s%s%s%s%s%c", dyldlp, (dyldlp[0] ? ":" : ""), ldlp, (ldlp[0] ? ":" : ""),
+ stdpath, '\0');
+ }
+ return buf;
+}
+
+/* Returns the ith search path from the list as computed by searchList() */
+static const char *getSearchPath(int i)
+{
+ static const char *list = 0;
+ static char **path = (char **)0;
+ static int end = 0;
+ static int numsize = MAX_SEARCH_PATHS;
+ static char **tmp;
+ /* So we can call SDL_free() in the "destructor" we use i=-1 to return the alloc'd array */
+ if (i == -1)
+ {
+ return (const char*)path;
+ }
+ if (!path)
+ {
+ path = (char **)SDL_calloc(MAX_SEARCH_PATHS, sizeof(char **));
+ }
+ if (!list && !end)
+ list = searchList();
+ if (i >= (numsize))
+ {
+ debug("Increasing size for long PATH");
+ tmp = (char **)SDL_calloc((MAX_SEARCH_PATHS + numsize), sizeof(char **));
+ if (tmp)
+ {
+ SDL_memcpy(tmp, path, sizeof(char **) * numsize);
+ SDL_free(path);
+ path = tmp;
+ numsize += MAX_SEARCH_PATHS;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+ while (!path[i] && !end)
+ {
+ path[i] = strsep((char **)&list, ":");
+
+ if (path[i][0] == 0)
+ path[i] = 0;
+ end = (list == 0);
+ }
+ return path[i];
+}
+
+static const char *getFullPath(int i, const char *file)
+{
+ static char buf[PATH_MAX];
+ const char *path = getSearchPath(i);
+ if (path)
+ {
+ SDL_snprintf(buf, PATH_MAX, "%s/%s", path, file);
+ }
+ return path ? buf : 0;
+}
+
+/* Given a file name, try to determine the full path for that file. Starts
+ * its search in the current directory, and then tries all paths in the
+ * search list in the order they are specified there.
+ */
+static const struct stat *findFile(const char *file, const char **fullPath)
+{
+ int i = 0;
+ static struct stat sbuf;
+ char *fileName;
+ debug("finding file %s", file);
+ *fullPath = file;
+ if (0 == stat(file, &sbuf))
+ return &sbuf;
+ if (SDL_strchr(file, '/'))
+ return 0; /* If the path had a / we don't look in env var places */
+ fileName = NULL;
+ if (!fileName)
+ fileName = (char *)file;
+ while ((*fullPath = getFullPath(i++, fileName)))
+ {
+ if (0 == stat(*fullPath, &sbuf))
+ return &sbuf;
+ }
+ ;
+ return 0;
+}
+
+/* Determine whether a given dlstatus is valid or not */
+static int isValidStatus(struct dlstatus *status)
+{
+ /* Walk the list to verify status is contained in it */
+ struct dlstatus *dls = stqueue;
+ while (dls && status != dls)
+ dls = dls->next;
+ if (dls == 0)
+ error("invalid handle");
+ else if ((dls->module == 0) || (dls->refs == 0))
+ error("handle to closed library");
+ else
+ return TRUE;
+ return FALSE;
+}
+
+static inline int isFlagSet(int mode, int flag)
+{
+ return (mode & flag) == flag;
+}
+
+static struct dlstatus *lookupStatus(const struct stat *sbuf)
+{
+ struct dlstatus *dls = stqueue;
+ debug("looking for status");
+ while (dls && ( /* isFlagSet(dls->mode, RTLD_UNSHARED) */ 0
+ || sbuf->st_dev != dls->device || sbuf->st_ino != dls->inode))
+ dls = dls->next;
+ return dls;
+}
+
+static void insertStatus(struct dlstatus *dls, const struct stat *sbuf)
+{
+ debug("inserting status");
+ dls->inode = sbuf->st_ino;
+ dls->device = sbuf->st_dev;
+ dls->refs = 0;
+ dls->mode = 0;
+ if ((dls->flags & DL_IN_LIST) == 0)
+ {
+ dls->next = stqueue;
+ stqueue = dls;
+ dls->flags |= DL_IN_LIST;
+ }
+}
+
+static struct dlstatus *allocStatus()
+{
+ struct dlstatus *dls;
+#ifdef REUSE_STATUS
+ dls = stqueue;
+ while (dls && dls->module)
+ dls = dls->next;
+ if (!dls)
+#endif
+ dls = SDL_calloc(sizeof(*dls),1);
+ return dls;
+}
+
+static int promoteLocalToGlobal(struct dlstatus *dls)
+{
+ static int (*p) (NSModule module) = 0;
+ debug("promoting");
+ if (!p)
+ _dyld_func_lookup("__dyld_NSMakePrivateModulePublic", (void **)&p);
+ return (dls->module == MAGIC_DYLIB_MOD) || (p && p(dls->module));
+}
+
+static void *reference(struct dlstatus *dls, int mode)
+{
+ if (dls)
+ {
+ if (dls->module == MAGIC_DYLIB_MOD && isFlagSet(mode, RTLD_LOCAL))
+ {
+ warning("trying to open a .dylib with RTLD_LOCAL");
+ error("unable to open a .dylib with RTLD_LOCAL");
+ return NULL;
+ }
+ if (isFlagSet(mode, RTLD_GLOBAL) &&
+ !isFlagSet(dls->mode, RTLD_GLOBAL) && !promoteLocalToGlobal(dls))
+ {
+ error("unable to promote local module to global");
+ return NULL;
+ }
+ dls->mode |= mode;
+ dls->refs++;
+ }
+ else
+ debug("reference called with NULL argument");
+
+ return dls;
+}
+
+static const struct mach_header *my_find_image(const char *name)
+{
+ const struct mach_header *mh = 0;
+ const char *id = NULL;
+ int i = _dyld_image_count();
+ int j;
+ mh = (struct mach_header *)
+ dyld_NSAddImage(name, NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED |
+ NSADDIMAGE_OPTION_RETURN_ON_ERROR);
+ if (!mh)
+ {
+ for (j = 0; j < i; j++)
+ {
+ id = _dyld_get_image_name(j);
+ if (!SDL_strcmp(id, name))
+ {
+ mh = _dyld_get_image_header(j);
+ break;
+ }
+ }
+ }
+ return mh;
+}
+
+/*
+ * dyld adds libraries by first adding the directly dependant libraries in link order, and
+ * then adding the dependencies for those libraries, so we should do the same... but we don't
+ * bother adding the extra dependencies, if the symbols are neither in the loaded image nor
+ * any of it's direct dependencies, then it probably isn't there.
+ */
+static NSSymbol search_linked_libs(const struct mach_header * mh, const char *symbol)
+{
+ unsigned int n;
+ struct load_command *lc = 0;
+ struct mach_header *wh;
+ NSSymbol nssym = 0;
+ if (dyld_NSAddImage && dyld_NSIsSymbolNameDefinedInImage && dyld_NSLookupSymbolInImage)
+ {
+ lc = (struct load_command *)((char *)mh + sizeof(struct mach_header));
+ for (n = 0; n < mh->ncmds; n++, lc = (struct load_command *)((char *)lc + lc->cmdsize))
+ {
+ if ((LC_LOAD_DYLIB == lc->cmd) || (LC_LOAD_WEAK_DYLIB == lc->cmd))
+ {
+ if ((wh = (struct mach_header *)
+ my_find_image((char *)(((struct dylib_command *)lc)->dylib.name.offset +
+ (char *)lc))))
+ {
+ if (dyld_NSIsSymbolNameDefinedInImage(wh, symbol))
+ {
+ nssym = dyld_NSLookupSymbolInImage(wh,
+ symbol,
+ NSLOOKUPSYMBOLINIMAGE_OPTION_BIND |
+ NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR);
+ break;
+ }
+ }
+ }
+ }
+ if ((!nssym) && NSIsSymbolNameDefined(symbol))
+ {
+ /* I've never seen this debug message...*/
+ debug("Symbol \"%s\" is defined but was not found", symbol);
+ }
+ }
+ return nssym;
+}
+
+/* Up to the caller to SDL_free() returned string */
+static inline char *dyld_error_str()
+{
+ NSLinkEditErrors dylder;
+ int dylderno;
+ const char *dylderrstr;
+ const char *dyldfile;
+ char* retStr = NULL;
+ NSLinkEditError(&dylder, &dylderno, &dyldfile, &dylderrstr);
+ if (dylderrstr && *dylderrstr)
+ {
+ retStr = SDL_strdup(dylderrstr);
+ }
+ return retStr;
+}
+
+static void *dlsymIntern(struct dlstatus *dls, const char *symbol, int canSetError)
+{
+ NSSymbol nssym = 0;
+#ifdef __GCC__
+ void *caller = __builtin_return_address(1); /* Be *very* careful about inlining */
+#else
+ void *caller = NULL;
+#endif
+ const struct mach_header *caller_mh = 0;
+ char *savedErrorStr = NULL;
+ resetdlerror();
+#ifndef RTLD_SELF
+#define RTLD_SELF ((void *) -3)
+#endif
+ if (NULL == dls)
+ dls = RTLD_SELF;
+ if ((RTLD_NEXT == dls) || (RTLD_SELF == dls))
+ {
+ if (dyld_NSIsSymbolNameDefinedInImage && dyld_NSLookupSymbolInImage && caller)
+ {
+ caller_mh = image_for_address(caller);
+ if (RTLD_SELF == dls)
+ {
+ /* FIXME: We should be using the NSModule api, if SELF is an MH_BUNDLE
+ * But it appears to work anyway, and looking at the code in dyld_libfuncs.c
+ * this is acceptable.
+ */
+ if (dyld_NSIsSymbolNameDefinedInImage(caller_mh, symbol))
+ {
+ nssym = dyld_NSLookupSymbolInImage(caller_mh,
+ symbol,
+ NSLOOKUPSYMBOLINIMAGE_OPTION_BIND |
+ NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR);
+ }
+ }
+ if (!nssym)
+ {
+ if (RTLD_SELF == dls)
+ savedErrorStr = dyld_error_str();
+ nssym = search_linked_libs(caller_mh, symbol);
+ }
+ }
+ else
+ {
+ if (canSetError)
+ error("RTLD_SELF and RTLD_NEXT are not supported");
+ return NULL;
+ }
+ }
+ if (!nssym)
+ {
+
+ if (RTLD_DEFAULT == dls)
+ {
+ dls = &mainStatus;
+ }
+ if (!isValidStatus(dls))
+ return NULL;
+
+ if (dls->module != MAGIC_DYLIB_MOD)
+ {
+ nssym = NSLookupSymbolInModule(dls->module, symbol);
+ if (!nssym && NSIsSymbolNameDefined(symbol))
+ {
+ debug("Searching dependencies");
+ savedErrorStr = dyld_error_str();
+ nssym = search_linked_libs(get_mach_header_from_NSModule(dls->module), symbol);
+ }
+ }
+ else if (dls->lib && dyld_NSIsSymbolNameDefinedInImage && dyld_NSLookupSymbolInImage)
+ {
+ if (dyld_NSIsSymbolNameDefinedInImage(dls->lib, symbol))
+ {
+ nssym = dyld_NSLookupSymbolInImage(dls->lib,
+ symbol,
+ NSLOOKUPSYMBOLINIMAGE_OPTION_BIND |
+ NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR);
+ }
+ else if (NSIsSymbolNameDefined(symbol))
+ {
+ debug("Searching dependencies");
+ savedErrorStr = dyld_error_str();
+ nssym = search_linked_libs(dls->lib, symbol);
+ }
+ }
+ else if (dls->module == MAGIC_DYLIB_MOD)
+ {
+ /* Global context, use NSLookupAndBindSymbol */
+ if (NSIsSymbolNameDefined(symbol))
+ {
+ /* There doesn't seem to be a return on error option for this call???
+ this is potentially broken, if binding fails, it will improperly
+ exit the application. */
+ nssym = NSLookupAndBindSymbol(symbol);
+ }
+ else
+ {
+ if (savedErrorStr)
+ SDL_free(savedErrorStr);
+ savedErrorStr = SDL_malloc(256);
+ SDL_snprintf(savedErrorStr, 256, "Symbol \"%s\" not in global context",symbol);
+ }
+ }
+ }
+ /* Error reporting */
+ if (!nssym)
+ {
+ if (!savedErrorStr || !SDL_strlen(savedErrorStr))
+ {
+ if (savedErrorStr)
+ SDL_free(savedErrorStr);
+ savedErrorStr = SDL_malloc(256);
+ SDL_snprintf(savedErrorStr, 256,"Symbol \"%s\" not found",symbol);
+ }
+ if (canSetError)
+ {
+ error(savedErrorStr);
+ }
+ else
+ {
+ debug(savedErrorStr);
+ }
+ if (savedErrorStr)
+ SDL_free(savedErrorStr);
+ return NULL;
+ }
+ return NSAddressOfSymbol(nssym);
+}
+
+static struct dlstatus *loadModule(const char *path, const struct stat *sbuf, int mode)
+{
+ NSObjectFileImage ofi = 0;
+ NSObjectFileImageReturnCode ofirc;
+ struct dlstatus *dls;
+ NSLinkEditErrors ler;
+ int lerno;
+ const char *errstr;
+ const char *file;
+ void (*init) (void);
+
+ ofirc = NSCreateObjectFileImageFromFile(path, &ofi);
+ switch (ofirc)
+ {
+ case NSObjectFileImageSuccess:
+ break;
+ case NSObjectFileImageInappropriateFile:
+ if (dyld_NSAddImage && dyld_NSIsSymbolNameDefinedInImage && dyld_NSLookupSymbolInImage)
+ {
+ if (isFlagSet(mode, RTLD_LOCAL))
+ {
+ warning("trying to open a .dylib with RTLD_LOCAL");
+ error("unable to open this file with RTLD_LOCAL");
+ return NULL;
+ }
+ }
+ else
+ {
+ error("opening this file is unsupported on this system");
+ return NULL;
+ }
+ break;
+ case NSObjectFileImageFailure:
+ error("object file setup failure");
+ return NULL;
+ case NSObjectFileImageArch:
+ error("no object for this architecture");
+ return NULL;
+ case NSObjectFileImageFormat:
+ error("bad object file format");
+ return NULL;
+ case NSObjectFileImageAccess:
+ error("can't read object file");
+ return NULL;
+ default:
+ error("unknown error from NSCreateObjectFileImageFromFile()");
+ return NULL;
+ }
+ dls = lookupStatus(sbuf);
+ if (!dls)
+ {
+ dls = allocStatus();
+ }
+ if (!dls)
+ {
+ error("unable to allocate memory");
+ return NULL;
+ }
+ // dls->lib = 0;
+ if (ofirc == NSObjectFileImageInappropriateFile)
+ {
+ if ((dls->lib = dyld_NSAddImage(path, NSADDIMAGE_OPTION_RETURN_ON_ERROR)))
+ {
+ debug("Dynamic lib loaded at %ld", dls->lib);
+ ofi = MAGIC_DYLIB_OFI;
+ dls->module = MAGIC_DYLIB_MOD;
+ ofirc = NSObjectFileImageSuccess;
+ /* Although it is possible with a bit of work to modify this so it works and
+ functions with RTLD_NOW, I don't deem it necessary at the moment */
+ }
+ if (!(dls->module))
+ {
+ NSLinkEditError(&ler, &lerno, &file, &errstr);
+ if (!errstr || (!SDL_strlen(errstr)))
+ error("Can't open this file type");
+ else
+ error(errstr);
+ if ((dls->flags & DL_IN_LIST) == 0)
+ {
+ SDL_free(dls);
+ }
+ return NULL;
+ }
+ }
+ else
+ {
+ dls->module = NSLinkModule(ofi, path,
+ NSLINKMODULE_OPTION_RETURN_ON_ERROR |
+ NSLINKMODULE_OPTION_PRIVATE |
+ (isFlagSet(mode, RTLD_NOW) ? NSLINKMODULE_OPTION_BINDNOW : 0));
+ NSDestroyObjectFileImage(ofi);
+ if (dls->module)
+ {
+ dls->lib = get_mach_header_from_NSModule(dls->module);
+ }
+ }
+ if (!dls->module)
+ {
+ NSLinkEditError(&ler, &lerno, &file, &errstr);
+ if ((dls->flags & DL_IN_LIST) == 0)
+ {
+ SDL_free(dls);
+ }
+ error(errstr);
+ return NULL;
+ }
+
+ insertStatus(dls, sbuf);
+ dls = reference(dls, mode);
+ if ((init = dlsymIntern(dls, "__init", 0)))
+ {
+ debug("calling _init()");
+ init();
+ }
+ return dls;
+}
+
+inline static void dlcompat_init_check(void)
+{
+ static pthread_mutex_t l = PTHREAD_MUTEX_INITIALIZER;
+ static int init_done = 0;
+
+ pthread_mutex_lock(&l);
+ if (!init_done) {
+ dlcompat_init_func();
+ init_done = 1;
+ }
+ pthread_mutex_unlock(&l);
+}
+
+static void dlcompat_init_func(void)
+{
+ _dyld_func_lookup("__dyld_NSAddImage", (void **)&dyld_NSAddImage);
+ _dyld_func_lookup("__dyld_NSIsSymbolNameDefinedInImage",
+ (void **)&dyld_NSIsSymbolNameDefinedInImage);
+ _dyld_func_lookup("__dyld_NSLookupSymbolInImage", (void **)&dyld_NSLookupSymbolInImage);
+ if (pthread_mutex_init(&dlcompat_mutex, NULL))
+ exit(1);
+ if (pthread_key_create(&dlerror_key, &dlerrorfree))
+ exit(1);
+}
+
+static void resetdlerror()
+{
+ struct dlthread *tss;
+ tss = pthread_getspecific(dlerror_key);
+ tss->errset = 0;
+}
+
+static void dlerrorfree(void *data)
+{
+ SDL_free(data);
+}
+
+/* We kind of want a recursive lock here, but meet a little trouble
+ * because they are not available pre OS X 10.2, so we fake it
+ * using thread specific storage to keep a lock count
+ */
+static inline void dolock(void)
+{
+ int err = 0;
+ struct dlthread *tss;
+ dlcompat_init_check();
+ tss = pthread_getspecific(dlerror_key);
+ if (!tss)
+ {
+ tss = SDL_malloc(sizeof(struct dlthread));
+ tss->lockcnt = 0;
+ tss->errset = 0;
+ if (pthread_setspecific(dlerror_key, tss))
+ {
+ fprintf(stderr,"dlcompat: pthread_setspecific failed\n");
+ exit(1);
+ }
+ }
+ if (!tss->lockcnt)
+ err = pthread_mutex_lock(&dlcompat_mutex);
+ tss->lockcnt = tss->lockcnt +1;
+ if (err)
+ exit(err);
+}
+
+static inline void dounlock(void)
+{
+ int err = 0;
+ struct dlthread *tss;
+ tss = pthread_getspecific(dlerror_key);
+ tss->lockcnt = tss->lockcnt -1;
+ if (!tss->lockcnt)
+ err = pthread_mutex_unlock(&dlcompat_mutex);
+ if (err)
+ exit(err);
+}
+
+static void *SDL_OSX_dlopen(const char *path, int mode)
+{
+ const struct stat *sbuf;
+ struct dlstatus *dls;
+ const char *fullPath;
+
+ dolock();
+ resetdlerror();
+ if (!path)
+ {
+ dls = &mainStatus;
+ goto dlopenok;
+ }
+ if (!(sbuf = findFile(path, &fullPath)))
+ {
+ error("file \"%s\" not found", path);
+ goto dlopenerror;
+ }
+ /* Now checks that it hasn't been closed already */
+ if ((dls = lookupStatus(sbuf)) && (dls->refs > 0))
+ {
+ /* debug("status found"); */
+ dls = reference(dls, mode);
+ goto dlopenok;
+ }
+#ifdef RTLD_NOLOAD
+ if (isFlagSet(mode, RTLD_NOLOAD))
+ {
+ error("no existing handle and RTLD_NOLOAD specified");
+ goto dlopenerror;
+ }
+#endif
+ if (isFlagSet(mode, RTLD_LAZY) && isFlagSet(mode, RTLD_NOW))
+ {
+ error("how can I load something both RTLD_LAZY and RTLD_NOW?");
+ goto dlopenerror;
+ }
+ dls = loadModule(fullPath, sbuf, mode);
+
+ dlopenok:
+ dounlock();
+ return (void *)dls;
+ dlopenerror:
+ dounlock();
+ return NULL;
+}
+
+#if !FINK_BUILD
+static void *SDL_OSX_dlsym(void * dl_restrict handle, const char * dl_restrict symbol)
+{
+ int sym_len = SDL_strlen(symbol);
+ void *value = NULL;
+ char *malloc_sym = NULL;
+ dolock();
+ malloc_sym = SDL_malloc(sym_len + 2);
+ if (malloc_sym)
+ {
+ SDL_snprintf(malloc_sym, sym_len+2, "_%s", symbol);
+ value = dlsymIntern(handle, malloc_sym, 1);
+ SDL_free(malloc_sym);
+ }
+ else
+ {
+ error("Unable to allocate memory");
+ goto dlsymerror;
+ }
+ dounlock();
+ return value;
+ dlsymerror:
+ dounlock();
+ return NULL;
+}
+#endif
+
+#if FINK_BUILD
+
+static void *dlsym_prepend_underscore(void *handle, const char *symbol)
+{
+ void *answer;
+ dolock();
+ answer = dlsym_prepend_underscore_intern(handle, symbol);
+ dounlock();
+ return answer;
+}
+
+static void *dlsym_prepend_underscore_intern(void *handle, const char *symbol)
+{
+/*
+ * A quick and easy way for porting packages which call dlsym(handle,"sym")
+ * If the porter adds -Ddlsym=dlsym_prepend_underscore to the CFLAGS then
+ * this function will be called, and will add the required underscore.
+ *
+ * Note that I haven't figured out yet which should be "standard", prepend
+ * the underscore always, or not at all. These global functions need to go away
+ * for opendarwin.
+ */
+ int sym_len = SDL_strlen(symbol);
+ void *value = NULL;
+ char *malloc_sym = NULL;
+ malloc_sym = SDL_malloc(sym_len + 2);
+ if (malloc_sym)
+ {
+ SDL_snprintf(malloc_sym, sym_len+2, "_%s", symbol);
+ value = dlsymIntern(handle, malloc_sym, 1);
+ SDL_free(malloc_sym);
+ }
+ else
+ {
+ error("Unable to allocate memory");
+ }
+ return value;
+}
+
+static void *dlsym_auto_underscore(void *handle, const char *symbol)
+{
+ void *answer;
+ dolock();
+ answer = dlsym_auto_underscore_intern(handle, symbol);
+ dounlock();
+ return answer;
+
+}
+static void *dlsym_auto_underscore_intern(void *handle, const char *symbol)
+{
+ struct dlstatus *dls = handle;
+ void *addr = 0;
+ addr = dlsymIntern(dls, symbol, 0);
+ if (!addr)
+ addr = dlsym_prepend_underscore_intern(handle, symbol);
+ return addr;
+}
+
+
+static void *SDL_OSX_dlsym(void * dl_restrict handle, const char * dl_restrict symbol)
+{
+ struct dlstatus *dls = handle;
+ void *addr = 0;
+ dolock();
+ addr = dlsymIntern(dls, symbol, 1);
+ dounlock();
+ return addr;
+}
+#endif
+
+static int SDL_OSX_dlclose(void *handle)
+{
+ struct dlstatus *dls = handle;
+ dolock();
+ resetdlerror();
+ if (!isValidStatus(dls))
+ {
+ goto dlcloseerror;
+ }
+ if (dls->module == MAGIC_DYLIB_MOD)
+ {
+ const char *name;
+ if (!dls->lib)
+ {
+ name = "global context";
+ }
+ else
+ {
+ name = get_lib_name(dls->lib);
+ }
+ warning("trying to close a .dylib!");
+ error("Not closing \"%s\" - dynamic libraries cannot be closed", name);
+ goto dlcloseerror;
+ }
+ if (!dls->module)
+ {
+ error("module already closed");
+ goto dlcloseerror;
+ }
+
+ if (dls->refs == 1)
+ {
+ unsigned long options = 0;
+ void (*fini) (void);
+ if ((fini = dlsymIntern(dls, "__fini", 0)))
+ {
+ debug("calling _fini()");
+ fini();
+ }
+ options |= NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES;
+#ifdef RTLD_NODELETE
+ if (isFlagSet(dls->mode, RTLD_NODELETE))
+ options |= NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED;
+#endif
+ if (!NSUnLinkModule(dls->module, options))
+ {
+ error("unable to unlink module");
+ goto dlcloseerror;
+ }
+ dls->refs--;
+ dls->module = 0;
+ /* Note: the dlstatus struct dls is neither removed from the list
+ * nor is the memory it occupies freed. This shouldn't pose a
+ * problem in mostly all cases, though.
+ */
+ }
+ dounlock();
+ return 0;
+ dlcloseerror:
+ dounlock();
+ return 1;
+}
+
+static const char *SDL_OSX_dlerror(void)
+{
+ struct dlthread *tss;
+ const char * err_str = NULL;
+ dlcompat_init_check();
+ tss = pthread_getspecific(dlerror_key);
+ if (tss != NULL && tss->errset != 0) {
+ tss->errset = 0;
+ err_str = tss->errstr;
+ }
+ return (err_str);
+}
+
+/* Given an address, return the mach_header for the image containing it
+ * or zero if the given address is not contained in any loaded images.
+ */
+static const struct mach_header *image_for_address(const void *address)
+{
+ unsigned long i;
+ unsigned long j;
+ unsigned long count = _dyld_image_count();
+ const struct mach_header *mh = 0;
+ struct load_command *lc = 0;
+ unsigned long addr = 0;
+ for (i = 0; i < count; i++)
+ {
+ addr = (unsigned long)address - _dyld_get_image_vmaddr_slide(i);
+ mh = _dyld_get_image_header(i);
+ if (mh)
+ {
+ lc = (struct load_command *)((char *)mh + sizeof(struct mach_header));
+ for (j = 0; j < mh->ncmds; j++, lc = (struct load_command *)((char *)lc + lc->cmdsize))
+ {
+ if (LC_SEGMENT == lc->cmd &&
+ addr >= ((struct segment_command *)lc)->vmaddr &&
+ addr <
+ ((struct segment_command *)lc)->vmaddr + ((struct segment_command *)lc)->vmsize)
+ {
+ goto image_found;
+ }
+ }
+ }
+ mh = 0;
+ }
+ image_found:
+ return mh;
+}
+
+#if 0 /* unused */
+static int SDL_OSX_dladdr(const void * dl_restrict p, SDL_OSX_Dl_info * dl_restrict info)
+{
+/*
+ FIXME: USe the routine image_for_address.
+*/
+ unsigned long i;
+ unsigned long j;
+ unsigned long count = _dyld_image_count();
+ struct mach_header *mh = 0;
+ struct load_command *lc = 0;
+ unsigned long addr = NULL;
+ unsigned long table_off = (unsigned long)0;
+ int found = 0;
+ if (!info)
+ return 0;
+ dolock();
+ resetdlerror();
+ info->dli_fname = 0;
+ info->dli_fbase = 0;
+ info->dli_sname = 0;
+ info->dli_saddr = 0;
+/* Some of this was swiped from code posted by Douglas Davidson <ddavidso AT apple DOT com>
+ * to darwin-development AT lists DOT apple DOT com and slightly modified
+ */
+ for (i = 0; i < count; i++)
+ {
+ addr = (unsigned long)p - _dyld_get_image_vmaddr_slide(i);
+ mh = _dyld_get_image_header(i);
+ if (mh)
+ {
+ lc = (struct load_command *)((char *)mh + sizeof(struct mach_header));
+ for (j = 0; j < mh->ncmds; j++, lc = (struct load_command *)((char *)lc + lc->cmdsize))
+ {
+ if (LC_SEGMENT == lc->cmd &&
+ addr >= ((struct segment_command *)lc)->vmaddr &&
+ addr <
+ ((struct segment_command *)lc)->vmaddr + ((struct segment_command *)lc)->vmsize)
+ {
+ info->dli_fname = _dyld_get_image_name(i);
+ info->dli_fbase = (void *)mh;
+ found = 1;
+ break;
+ }
+ }
+ if (found)
+ break;
+ }
+ }
+ if (!found)
+ {
+ dounlock();
+ return 0;
+ }
+ lc = (struct load_command *)((char *)mh + sizeof(struct mach_header));
+ for (j = 0; j < mh->ncmds; j++, lc = (struct load_command *)((char *)lc + lc->cmdsize))
+ {
+ if (LC_SEGMENT == lc->cmd)
+ {
+ if (!SDL_strcmp(((struct segment_command *)lc)->segname, "__LINKEDIT"))
+ break;
+ }
+ }
+ table_off =
+ ((unsigned long)((struct segment_command *)lc)->vmaddr) -
+ ((unsigned long)((struct segment_command *)lc)->fileoff) + _dyld_get_image_vmaddr_slide(i);
+ debug("table off %x", table_off);
+
+ lc = (struct load_command *)((char *)mh + sizeof(struct mach_header));
+ for (j = 0; j < mh->ncmds; j++, lc = (struct load_command *)((char *)lc + lc->cmdsize))
+ {
+ if (LC_SYMTAB == lc->cmd)
+ {
+
+ struct nlist *symtable = (struct nlist *)(((struct symtab_command *)lc)->symoff + table_off);
+ unsigned long numsyms = ((struct symtab_command *)lc)->nsyms;
+ struct nlist *nearest = NULL;
+ unsigned long diff = 0xffffffff;
+ unsigned long strtable = (unsigned long)(((struct symtab_command *)lc)->stroff + table_off);
+ debug("symtable %x", symtable);
+ for (i = 0; i < numsyms; i++)
+ {
+ /* Ignore the following kinds of Symbols */
+ if ((!symtable->n_value) /* Undefined */
+ || (symtable->n_type >= N_PEXT) /* Debug symbol */
+ || (!(symtable->n_type & N_EXT)) /* Local Symbol */
+ )
+ {
+ symtable++;
+ continue;
+ }
+ if ((addr >= symtable->n_value) && (diff >= (symtable->n_value - addr)))
+ {
+ diff = (unsigned long)symtable->n_value - addr;
+ nearest = symtable;
+ }
+ symtable++;
+ }
+ if (nearest)
+ {
+ info->dli_saddr = nearest->n_value + ((void *)p - addr);
+ info->dli_sname = (char *)(strtable + nearest->n_un.n_strx);
+ }
+ }
+ }
+ dounlock();
+ return 1;
+}
+#endif
+
+/*
+ * Implement the dlfunc() interface, which behaves exactly the same as
+ * dlsym() except that it returns a function pointer instead of a data
+ * pointer. This can be used by applications to avoid compiler warnings
+ * about undefined behavior, and is intended as prior art for future
+ * POSIX standardization. This function requires that all pointer types
+ * have the same representation, which is true on all platforms FreeBSD
+ * runs on, but is not guaranteed by the C standard.
+ */
+#if 0
+static dlfunc_t SDL_OSX_dlfunc(void * dl_restrict handle, const char * dl_restrict symbol)
+{
+ union
+ {
+ void *d;
+ dlfunc_t f;
+ } rv;
+ int sym_len = SDL_strlen(symbol);
+ char *malloc_sym = NULL;
+ dolock();
+ malloc_sym = SDL_malloc(sym_len + 2);
+ if (malloc_sym)
+ {
+ SDL_snprintf(malloc_sym, sym_len+2, "_%s", symbol);
+ rv.d = dlsymIntern(handle, malloc_sym, 1);
+ SDL_free(malloc_sym);
+ }
+ else
+ {
+ error("Unable to allocate memory");
+ goto dlfuncerror;
+ }
+ dounlock();
+ return rv.f;
+ dlfuncerror:
+ dounlock();
+ return NULL;
+}
+#endif
+
+
+
+/* dlcompat ends, here's the SDL interface... --ryan. */
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/* System dependent library loading routines */
+
+#include "SDL_loadso.h"
+
+void *SDL_LoadObject(const char *sofile)
+{
+ void *handle = SDL_OSX_dlopen(sofile, RTLD_NOW);
+ const char *loaderror = SDL_OSX_dlerror();
+ if ( handle == NULL ) {
+ SDL_SetError("Failed loading %s: %s", sofile, loaderror);
+ }
+ return(handle);
+}
+
+void *SDL_LoadFunction(void *handle, const char *name)
+{
+ void *symbol = SDL_OSX_dlsym(handle, name);
+ if ( symbol == NULL ) {
+ SDL_SetError("Failed loading %s: %s", name, SDL_OSX_dlerror());
+ }
+ return(symbol);
+}
+
+void SDL_UnloadObject(void *handle)
+{
+ if ( handle != NULL ) {
+ SDL_OSX_dlclose(handle);
+ }
+}
+
+#endif /* SDL_LOADSO_DLCOMPAT */
diff --git a/distrib/sdl-1.2.15/src/loadso/mint/SDL_sysloadso.c b/distrib/sdl-1.2.15/src/loadso/mint/SDL_sysloadso.c
new file mode 100644
index 0000000..d6dd732
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/loadso/mint/SDL_sysloadso.c
@@ -0,0 +1,62 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_LOADSO_LDG
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/* System dependent library loading routines */
+
+#include <stdio.h>
+#include <gem.h>
+#include <ldg.h>
+
+#include "SDL_loadso.h"
+
+void *SDL_LoadObject(const char *sofile)
+{
+ const char *loaderror = "Unknown error";
+ void *handle = (void *)ldg_open((char *)sofile, ldg_global);
+ if ( handle == NULL ) {
+ SDL_SetError("Failed loading %s: %s", sofile, loaderror);
+ }
+ return(handle);
+}
+
+void *SDL_LoadFunction(void *handle, const char *name)
+{
+ const char *loaderror = "Unknown error";
+ void *symbol = (void *)ldg_find((char *)name, (LDG *)handle);
+ if ( symbol == NULL ) {
+ SDL_SetError("Failed loading %s: %s", name, loaderror);
+ }
+ return(symbol);
+}
+
+void SDL_UnloadObject(void *handle)
+{
+ if ( handle != NULL ) {
+ ldg_close((LDG *)handle, ldg_global);
+ }
+}
+
+#endif /* SDL_LOADSO_LDG */
diff --git a/distrib/sdl-1.2.15/src/loadso/os2/SDL_sysloadso.c b/distrib/sdl-1.2.15/src/loadso/os2/SDL_sysloadso.c
new file mode 100644
index 0000000..62ea536
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/loadso/os2/SDL_sysloadso.c
@@ -0,0 +1,71 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_LOADSO_OS2
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/* System dependent library loading routines */
+
+#include <stdio.h>
+#define INCL_DOSERRORS
+#define INCL_DOSMODULEMGR
+#include <os2.h>
+
+#include "SDL_loadso.h"
+
+void *SDL_LoadObject(const char *sofile)
+{
+ HMODULE handle = NULL;
+ char buf[512];
+ APIRET ulrc = DosLoadModule(buf, sizeof (buf), (char *) sofile, &handle);
+
+ /* Generate an error message if all loads failed */
+ if ((ulrc != NO_ERROR) || (handle == NULL))
+ SDL_SetError("Failed loading %s: %s", sofile, buf);
+
+ return((void *) handle);
+}
+
+void *SDL_LoadFunction(void *handle, const char *name)
+{
+ const char *loaderror = "Unknown error";
+ void *symbol = NULL;
+ APIRET ulrc = DosQueryProcAddr((HMODULE)handle, 0, (char *)name, &symbol);
+ if (ulrc == ERROR_INVALID_HANDLE)
+ loaderror = "Invalid module handle";
+ else if (ulrc == ERROR_INVALID_NAME)
+ loaderror = "Symbol not found";
+
+ if (symbol == NULL)
+ SDL_SetError("Failed loading %s: %s", name, loaderror);
+
+ return(symbol);
+}
+
+void SDL_UnloadObject(void *handle)
+{
+ if ( handle != NULL )
+ DosFreeModule((HMODULE) handle);
+}
+
+#endif /* SDL_LOADSO_OS2 */
diff --git a/distrib/sdl-1.2.15/src/loadso/win32/SDL_sysloadso.c b/distrib/sdl-1.2.15/src/loadso/win32/SDL_sysloadso.c
new file mode 100644
index 0000000..784c7e7
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/loadso/win32/SDL_sysloadso.c
@@ -0,0 +1,139 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_LOADSO_WIN32
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/* System dependent library loading routines */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include "SDL_loadso.h"
+
+void *SDL_LoadObject(const char *sofile)
+{
+ void *handle = NULL;
+ const char *loaderror = "Unknown error";
+
+#if defined(_WIN32_WCE)
+ char errbuf[512];
+
+ wchar_t *errbuf_t = SDL_malloc(512 * sizeof(wchar_t));
+ wchar_t *sofile_t = SDL_malloc((MAX_PATH+1) * sizeof(wchar_t));
+
+ MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, sofile, -1, sofile_t, MAX_PATH);
+ handle = (void *)LoadLibrary(sofile_t);
+
+ /* Generate an error message if all loads failed */
+ if ( handle == NULL ) {
+ FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS |
+ FORMAT_MESSAGE_FROM_SYSTEM),
+ NULL, GetLastError(),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ errbuf_t, SDL_arraysize(errbuf), NULL);
+ WideCharToMultiByte(CP_ACP, 0, errbuf_t, -1, errbuf, 511, NULL, NULL);
+ loaderror = errbuf;
+ }
+
+ SDL_free(sofile_t);
+ SDL_free(errbuf_t);
+
+#else /*if defined(__WIN32__)*/
+ char errbuf[512];
+
+ handle = (void *)LoadLibrary(sofile);
+
+ /* Generate an error message if all loads failed */
+ if ( handle == NULL ) {
+ FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS |
+ FORMAT_MESSAGE_FROM_SYSTEM),
+ NULL, GetLastError(),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ errbuf, SDL_arraysize(errbuf), NULL);
+ loaderror = errbuf;
+ }
+#endif
+
+ if ( handle == NULL ) {
+ SDL_SetError("Failed loading %s: %s", sofile, loaderror);
+ }
+ return(handle);
+}
+
+void *SDL_LoadFunction(void *handle, const char *name)
+{
+ void *symbol = NULL;
+ const char *loaderror = "Unknown error";
+
+#if defined(_WIN32_WCE)
+ char errbuf[512];
+ int length = SDL_strlen(name);
+
+ wchar_t *name_t = SDL_malloc((length + 1) * sizeof(wchar_t));
+ wchar_t *errbuf_t = SDL_malloc(512 * sizeof(wchar_t));
+
+ MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, name, -1, name_t, length+1);
+
+ symbol = (void *)GetProcAddress((HMODULE)handle, name_t);
+ if ( symbol == NULL ) {
+ FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS |
+ FORMAT_MESSAGE_FROM_SYSTEM),
+ NULL, GetLastError(),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ errbuf_t, SDL_arraysize(errbuf), NULL);
+ WideCharToMultiByte(CP_ACP, 0, errbuf_t, -1, errbuf, 511, NULL, NULL);
+ loaderror = errbuf;
+ }
+
+ SDL_free(name_t);
+ SDL_free(errbuf_t);
+
+#else /*if defined(WIN32)*/
+ char errbuf[512];
+
+ symbol = (void *)GetProcAddress((HMODULE)handle, name);
+ if ( symbol == NULL ) {
+ FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS |
+ FORMAT_MESSAGE_FROM_SYSTEM),
+ NULL, GetLastError(),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ errbuf, SDL_arraysize(errbuf), NULL);
+ loaderror = errbuf;
+ }
+#endif
+
+ if ( symbol == NULL ) {
+ SDL_SetError("Failed loading %s: %s", name, loaderror);
+ }
+ return(symbol);
+}
+
+void SDL_UnloadObject(void *handle)
+{
+ if ( handle != NULL ) {
+ FreeLibrary((HMODULE)handle);
+ }
+}
+
+#endif /* SDL_LOADSO_WIN32 */
diff --git a/distrib/sdl-1.2.15/src/main/beos/SDL_BeApp.cc b/distrib/sdl-1.2.15/src/main/beos/SDL_BeApp.cc
new file mode 100644
index 0000000..8b79377
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/main/beos/SDL_BeApp.cc
@@ -0,0 +1,111 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Handle the BeApp specific portions of the application */
+
+#include <AppKit.h>
+#include <storage/Path.h>
+#include <storage/Entry.h>
+#include <unistd.h>
+
+#include "SDL_BeApp.h"
+#include "SDL_thread.h"
+#include "SDL_timer.h"
+#include "SDL_error.h"
+
+/* Flag to tell whether or not the Be application is active or not */
+int SDL_BeAppActive = 0;
+static SDL_Thread *SDL_AppThread = NULL;
+
+static int StartBeApp(void *unused)
+{
+ if(!be_app) {
+ BApplication *App;
+
+ App = new BApplication("application/x-SDL-executable");
+
+ App->Run();
+ delete App;
+ }
+ return(0);
+}
+
+/* Initialize the Be Application, if it's not already started */
+int SDL_InitBeApp(void)
+{
+ /* Create the BApplication that handles appserver interaction */
+ if ( SDL_BeAppActive <= 0 ) {
+ SDL_AppThread = SDL_CreateThread(StartBeApp, NULL);
+ if ( SDL_AppThread == NULL ) {
+ SDL_SetError("Couldn't create BApplication thread");
+ return(-1);
+ }
+
+ /* Change working to directory to that of executable */
+ app_info info;
+ if (B_OK == be_app->GetAppInfo(&info)) {
+ entry_ref ref = info.ref;
+ BEntry entry;
+ if (B_OK == entry.SetTo(&ref)) {
+ BPath path;
+ if (B_OK == path.SetTo(&entry)) {
+ if (B_OK == path.GetParent(&path)) {
+ chdir(path.Path());
+ }
+ }
+ }
+ }
+
+ do {
+ SDL_Delay(10);
+ } while ( (be_app == NULL) || be_app->IsLaunching() );
+
+ /* Mark the application active */
+ SDL_BeAppActive = 0;
+ }
+
+ /* Increment the application reference count */
+ ++SDL_BeAppActive;
+
+ /* The app is running, and we're ready to go */
+ return(0);
+}
+
+/* Quit the Be Application, if there's nothing left to do */
+void SDL_QuitBeApp(void)
+{
+ /* Decrement the application reference count */
+ --SDL_BeAppActive;
+
+ /* If the reference count reached zero, clean up the app */
+ if ( SDL_BeAppActive == 0 ) {
+ if ( SDL_AppThread != NULL ) {
+ if ( be_app != NULL ) { /* Not tested */
+ be_app->PostMessage(B_QUIT_REQUESTED);
+ }
+ SDL_WaitThread(SDL_AppThread, NULL);
+ SDL_AppThread = NULL;
+ }
+ /* be_app should now be NULL since be_app has quit */
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/main/beos/SDL_BeApp.h b/distrib/sdl-1.2.15/src/main/beos/SDL_BeApp.h
new file mode 100644
index 0000000..9f88212
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/main/beos/SDL_BeApp.h
@@ -0,0 +1,33 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Handle the BeApp specific portions of the application */
+
+/* Initialize the Be Application, if it's not already started */
+extern int SDL_InitBeApp(void);
+
+/* Quit the Be Application, if there's nothing left to do */
+extern void SDL_QuitBeApp(void);
+
+/* Flag to tell whether the app is active or not */
+extern int SDL_BeAppActive;
diff --git a/distrib/sdl-1.2.12/src/main/dummy/SDL_dummy_main.c b/distrib/sdl-1.2.15/src/main/dummy/SDL_dummy_main.c
index da47d06..da47d06 100644
--- a/distrib/sdl-1.2.12/src/main/dummy/SDL_dummy_main.c
+++ b/distrib/sdl-1.2.15/src/main/dummy/SDL_dummy_main.c
diff --git a/distrib/sdl-1.2.15/src/main/macos/SDL.r b/distrib/sdl-1.2.15/src/main/macos/SDL.r
new file mode 100644
index 0000000..a8fceca
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/main/macos/SDL.r
@@ -0,0 +1 @@
+data 'DLOG' (1000) { $"0072 0040 00EA 01B3 0001 0100 0000 0000 0000 03E8 0C43 6F6D 6D61 6E64 204C 696E" /* .r.@.ê.³...........è.Command Lin */ $"6500 280A" /* e.( */ }; data 'DLOG' (1001) { $"0072 0040 00DB 01AC 0001 0100 0000 0000 0000 03E9 0C45 7272 6F72 2057 696E 646F" /* .r.@.Û.¬...........é.Error Windo */ $"7700 280A" /* w.( */ }; data 'DLOG' (1002) { $"00B8 00BE 0147 01D8 0005 0100 0000 0000 0000 03EA 1643 6F6E 6669 726D 2044 6973" /* .¸.¾.G.Ø...........ê.Confirm Dis */ $"706C 6179 2043 6861 6E67 6510 280A" /* play Change.( */ }; data 'DITL' (1000) { $"0005 0000 0000 0052 0113 0066 0158 0402 4F4B 0000 0000 0052 00C2 0066 0107 0406" /* .......R...f.X..OK.....R.Â.f.... */ $"4361 6E63 656C 0000 0000 000F 0084 001F 0155 1000 0000 0000 0054 0019 0066 007D" /* Cancel.......„...U.......T...f.} */ $"050E 4F75 7470 7574 2074 6F20 6669 6C65 0000 0000 000F 0018 001F 007F 080D 436F" /* ..Output to file..............Co */ $"6D6D 616E 6420 4C69 6E65 3A00 0000 0000 0030 0018 0040 0158 0702 0080" /* mmand Line:......0...@.X...€ */ }; data 'DITL' (1001) { $"0001 0000 0000 0046 0120 005A 015A 0402 4F4B 0000 0000 0010 000A 0038 0160 0800" /* .......F. .Z.Z..OK.......Â.8.`.. */ }; data 'DITL' (1002) { $"0002 0000 0000 006F 001E 0083 0058 0406 4361 6E63 656C 0000 0000 006E 00C0 0082" /* .......o...ƒ.X..Cancel.....n.À.‚ */ $"00FA 0402 4F4B 0000 0000 000E 000F 005F 010C 88B3 5468 6520 7365 7474 696E 6720" /* .ú..OK........._..ˆ³The setting */ $"666F 7220 796F 7572 206D 6F6E 6974 6F72 2068 6173 2062 6565 6E20 6368 616E 6765" /* for your monitor has been change */ $"642C 2061 6E64 2069 7420 6D61 7920 6E6F 7420 6265 2064 6973 706C 6179 6564 2063" /* d, and it may not be displayed c */ $"6F72 7265 6374 6C79 2E20 546F 2063 6F6E 6669 726D 2074 6865 2064 6973 706C 6179" /* orrectly. To confirm the display */ $"2069 7320 636F 7272 6563 742C 2063 6C69 636B 204F 4B2E 2054 6F20 7265 7475 726E" /* is correct, click OK. To return */ $"2074 6F20 7468 6520 6F72 6967 696E 616C 2073 6574 7469 6E67 2C20 636C 6963 6B20" /* to the original setting, click */ $"4361 6E63 656C 2E00" /* Cancel.. */ }; data 'MENU' (128, preload) { $"0080 0000 0000 0000 0000 FFFF FFFB 0114 0C41 626F 7574 2053 444C 2E2E 2E00 0000" /* .€........ÿÿÿû...About SDL...... */ $"0001 2D00 0000 0000" /* ..-..... */ }; data 'MENU' (129) { $"0081 0000 0000 0000 0000 FFFF FFFF 0C56 6964 656F 2044 7269 7665 7219 4472 6177" /* .........ÿÿÿÿ.Video Driver.Draw */ $"5370 726F 636B 6574 2028 4675 6C6C 7363 7265 656E 2900 0000 001E 546F 6F6C 426F" /* Sprocket (Fullscreen).....ToolBo */ $"7820 2028 4675 6C6C 7363 7265 656E 2F57 696E 646F 7765 6429 0000 0000 00" /* x (Fullscreen/Windowed)..... */ }; data 'CNTL' (128) { $"0000 0000 0010 0140 0000 0100 0064 0081 03F0 0000 0000 0D56 6964 656F 2044 7269" /* .......@.....d..ð.....Video Dri */ $"7665 723A" /* ver: */ }; data 'TMPL' (128, "CLne") { $"0C43 6F6D 6D61 6E64 204C 696E 6550 5354 520C 5669 6465 6F20 4472 6976 6572 5053" /* .Command LinePSTR.Video DriverPS */ $"5452 0C53 6176 6520 546F 2046 696C 6542 4F4F 4C" /* TR.Save To FileBOOL */ }; \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/src/main/macos/SDL.shlib.r b/distrib/sdl-1.2.15/src/main/macos/SDL.shlib.r
new file mode 100644
index 0000000..2523106
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/main/macos/SDL.shlib.r
@@ -0,0 +1 @@
+ #ifndef __TYPES_R__ #include "Types.r" #endif #ifndef __BALLOONS_R__ #include "Balloons.r" #endif #define VERSION_MAJOR 1 #define VERSION_MINOR 2 #define REVISION 13 #define STATE release /* development | alpha | beta | release */ #define RELEASE_NO 0 /* number after letter, or zero for release */ #define COUNTRY verUS #define VERSION_STRING "1.2.13" #define NAME "SDL" #define SHORT_DESCRIPTION "Simple DirectMedia Layer by Sam Lantinga" #define LONG_DESCRIPTION "A cross-platform multimedia library.\n\nhttp://www.libsdl.org" resource 'vers' (1) { VERSION_MAJOR, (VERSION_MINOR << 4) | REVISION, STATE, RELEASE_NO, COUNTRY, VERSION_STRING, VERSION_STRING }; resource 'vers' (2) { VERSION_MAJOR, (VERSION_MINOR << 4) | REVISION, STATE, RELEASE_NO, COUNTRY, VERSION_STRING, SHORT_DESCRIPTION }; /* Extension Manager info */ data 'CCI' (128) { NAME "\n\n" LONG_DESCRIPTION }; /* Finder help balloon */ resource 'hfdr' (kHMHelpID) { HelpMgrVersion, hmDefaultOptions, 0, 0, { HMStringItem { NAME "\n\n" LONG_DESCRIPTION } } }; \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/src/main/macos/SDL_main.c b/distrib/sdl-1.2.15/src/main/macos/SDL_main.c
new file mode 100644
index 0000000..ff1ffdc
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/main/macos/SDL_main.c
@@ -0,0 +1,610 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/* This file takes care of command line argument parsing, and stdio redirection
+ in the MacOS environment. (stdio/stderr is *not* directed for Mach-O builds)
+ */
+
+#if defined(__APPLE__) && defined(__MACH__)
+#include <Carbon/Carbon.h>
+#elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335)
+#include <Carbon.h>
+#else
+#include <Dialogs.h>
+#include <Fonts.h>
+#include <Events.h>
+#include <Resources.h>
+#include <Folders.h>
+#endif
+
+/* Include the SDL main definition header */
+#include "SDL.h"
+#include "SDL_main.h"
+#ifdef main
+#undef main
+#endif
+
+#if !(defined(__APPLE__) && defined(__MACH__))
+/* The standard output files */
+#define STDOUT_FILE "stdout.txt"
+#define STDERR_FILE "stderr.txt"
+#endif
+
+#if !defined(__MWERKS__) && !TARGET_API_MAC_CARBON
+ /* In MPW, the qd global has been removed from the libraries */
+ QDGlobals qd;
+#endif
+
+/* Structure for keeping prefs in 1 variable */
+typedef struct {
+ Str255 command_line;
+ Str255 video_driver_name;
+ Boolean output_to_file;
+} PrefsRecord;
+
+/* See if the command key is held down at startup */
+static Boolean CommandKeyIsDown(void)
+{
+ KeyMap theKeyMap;
+
+ GetKeys(theKeyMap);
+
+ if (((unsigned char *) theKeyMap)[6] & 0x80) {
+ return(true);
+ }
+ return(false);
+}
+
+#if !(defined(__APPLE__) && defined(__MACH__))
+
+/* Parse a command line buffer into arguments */
+static int ParseCommandLine(char *cmdline, char **argv)
+{
+ char *bufp;
+ int argc;
+
+ argc = 0;
+ for ( bufp = cmdline; *bufp; ) {
+ /* Skip leading whitespace */
+ while ( SDL_isspace(*bufp) ) {
+ ++bufp;
+ }
+ /* Skip over argument */
+ if ( *bufp == '"' ) {
+ ++bufp;
+ if ( *bufp ) {
+ if ( argv ) {
+ argv[argc] = bufp;
+ }
+ ++argc;
+ }
+ /* Skip over word */
+ while ( *bufp && (*bufp != '"') ) {
+ ++bufp;
+ }
+ } else {
+ if ( *bufp ) {
+ if ( argv ) {
+ argv[argc] = bufp;
+ }
+ ++argc;
+ }
+ /* Skip over word */
+ while ( *bufp && ! SDL_isspace(*bufp) ) {
+ ++bufp;
+ }
+ }
+ if ( *bufp ) {
+ if ( argv ) {
+ *bufp = '\0';
+ }
+ ++bufp;
+ }
+ }
+ if ( argv ) {
+ argv[argc] = NULL;
+ }
+ return(argc);
+}
+
+/* Remove the output files if there was no output written */
+static void cleanup_output(void)
+{
+ FILE *file;
+ int empty;
+
+ /* Flush the output in case anything is queued */
+ fclose(stdout);
+ fclose(stderr);
+
+ /* See if the files have any output in them */
+ file = fopen(STDOUT_FILE, "rb");
+ if ( file ) {
+ empty = (fgetc(file) == EOF) ? 1 : 0;
+ fclose(file);
+ if ( empty ) {
+ remove(STDOUT_FILE);
+ }
+ }
+ file = fopen(STDERR_FILE, "rb");
+ if ( file ) {
+ empty = (fgetc(file) == EOF) ? 1 : 0;
+ fclose(file);
+ if ( empty ) {
+ remove(STDERR_FILE);
+ }
+ }
+}
+
+#endif //!(defined(__APPLE__) && defined(__MACH__))
+
+static int getCurrentAppName (StrFileName name) {
+
+ ProcessSerialNumber process;
+ ProcessInfoRec process_info;
+ FSSpec process_fsp;
+
+ process.highLongOfPSN = 0;
+ process.lowLongOfPSN = kCurrentProcess;
+ process_info.processInfoLength = sizeof (process_info);
+ process_info.processName = NULL;
+ process_info.processAppSpec = &process_fsp;
+
+ if ( noErr != GetProcessInformation (&process, &process_info) )
+ return 0;
+
+ SDL_memcpy(name, process_fsp.name, process_fsp.name[0] + 1);
+ return 1;
+}
+
+static int getPrefsFile (FSSpec *prefs_fsp, int create) {
+
+ /* The prefs file name is the application name, possibly truncated, */
+ /* plus " Preferences */
+
+ #define SUFFIX " Preferences"
+ #define MAX_NAME 19 /* 31 - strlen (SUFFIX) */
+
+ short volume_ref_number;
+ long directory_id;
+ StrFileName prefs_name;
+ StrFileName app_name;
+
+ /* Get Preferences folder - works with Multiple Users */
+ if ( noErr != FindFolder ( kOnSystemDisk, kPreferencesFolderType, kDontCreateFolder,
+ &volume_ref_number, &directory_id) )
+ exit (-1);
+
+ if ( ! getCurrentAppName (app_name) )
+ exit (-1);
+
+ /* Truncate if name is too long */
+ if (app_name[0] > MAX_NAME )
+ app_name[0] = MAX_NAME;
+
+ SDL_memcpy(prefs_name + 1, app_name + 1, app_name[0]);
+ SDL_memcpy(prefs_name + app_name[0] + 1, SUFFIX, strlen (SUFFIX));
+ prefs_name[0] = app_name[0] + strlen (SUFFIX);
+
+ /* Make the file spec for prefs file */
+ if ( noErr != FSMakeFSSpec (volume_ref_number, directory_id, prefs_name, prefs_fsp) ) {
+ if ( !create )
+ return 0;
+ else {
+ /* Create the prefs file */
+ SDL_memcpy(prefs_fsp->name, prefs_name, prefs_name[0] + 1);
+ prefs_fsp->parID = directory_id;
+ prefs_fsp->vRefNum = volume_ref_number;
+
+ FSpCreateResFile (prefs_fsp, 0x3f3f3f3f, 'pref', 0); // '????' parsed as trigraph
+
+ if ( noErr != ResError () )
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static int readPrefsResource (PrefsRecord *prefs) {
+
+ Handle prefs_handle;
+
+ prefs_handle = Get1Resource( 'CLne', 128 );
+
+ if (prefs_handle != NULL) {
+ int offset = 0;
+// int j = 0;
+
+ HLock(prefs_handle);
+
+ /* Get command line string */
+ SDL_memcpy(prefs->command_line, *prefs_handle, (*prefs_handle)[0]+1);
+
+ /* Get video driver name */
+ offset += (*prefs_handle)[0] + 1;
+ SDL_memcpy(prefs->video_driver_name, *prefs_handle + offset, (*prefs_handle)[offset] + 1);
+
+ /* Get save-to-file option (1 or 0) */
+ offset += (*prefs_handle)[offset] + 1;
+ prefs->output_to_file = (*prefs_handle)[offset];
+
+ ReleaseResource( prefs_handle );
+
+ return ResError() == noErr;
+ }
+
+ return 0;
+}
+
+static int writePrefsResource (PrefsRecord *prefs, short resource_file) {
+
+ Handle prefs_handle;
+
+ UseResFile (resource_file);
+
+ prefs_handle = Get1Resource ( 'CLne', 128 );
+ if (prefs_handle != NULL)
+ RemoveResource (prefs_handle);
+
+ prefs_handle = NewHandle ( prefs->command_line[0] + prefs->video_driver_name[0] + 4 );
+ if (prefs_handle != NULL) {
+
+ int offset;
+
+ HLock (prefs_handle);
+
+ /* Command line text */
+ offset = 0;
+ SDL_memcpy(*prefs_handle, prefs->command_line, prefs->command_line[0] + 1);
+
+ /* Video driver name */
+ offset += prefs->command_line[0] + 1;
+ SDL_memcpy(*prefs_handle + offset, prefs->video_driver_name, prefs->video_driver_name[0] + 1);
+
+ /* Output-to-file option */
+ offset += prefs->video_driver_name[0] + 1;
+ *( *((char**)prefs_handle) + offset) = (char)prefs->output_to_file;
+ *( *((char**)prefs_handle) + offset + 1) = 0;
+
+ AddResource (prefs_handle, 'CLne', 128, "\pCommand Line");
+ WriteResource (prefs_handle);
+ UpdateResFile (resource_file);
+ DisposeHandle (prefs_handle);
+
+ return ResError() == noErr;
+ }
+
+ return 0;
+}
+
+static int readPreferences (PrefsRecord *prefs) {
+
+ int no_error = 1;
+ FSSpec prefs_fsp;
+
+ /* Check for prefs file first */
+ if ( getPrefsFile (&prefs_fsp, 0) ) {
+
+ short prefs_resource;
+
+ prefs_resource = FSpOpenResFile (&prefs_fsp, fsRdPerm);
+ if ( prefs_resource == -1 ) /* this shouldn't happen, but... */
+ return 0;
+
+ UseResFile (prefs_resource);
+ no_error = readPrefsResource (prefs);
+ CloseResFile (prefs_resource);
+ }
+
+ /* Fall back to application's resource fork (reading only, so this is safe) */
+ else {
+
+ no_error = readPrefsResource (prefs);
+ }
+
+ return no_error;
+}
+
+static int writePreferences (PrefsRecord *prefs) {
+
+ int no_error = 1;
+ FSSpec prefs_fsp;
+
+ /* Get prefs file, create if it doesn't exist */
+ if ( getPrefsFile (&prefs_fsp, 1) ) {
+
+ short prefs_resource;
+
+ prefs_resource = FSpOpenResFile (&prefs_fsp, fsRdWrPerm);
+ if (prefs_resource == -1)
+ return 0;
+ no_error = writePrefsResource (prefs, prefs_resource);
+ CloseResFile (prefs_resource);
+ }
+
+ return no_error;
+}
+
+/* This is where execution begins */
+int main(int argc, char *argv[])
+{
+
+#if !(defined(__APPLE__) && defined(__MACH__))
+#pragma unused(argc, argv)
+#endif
+
+#define DEFAULT_ARGS "\p" /* pascal string for default args */
+#define DEFAULT_VIDEO_DRIVER "\ptoolbox" /* pascal string for default video driver name */
+#define DEFAULT_OUTPUT_TO_FILE 1 /* 1 == output to file, 0 == no output */
+
+#define VIDEO_ID_DRAWSPROCKET 1 /* these correspond to popup menu choices */
+#define VIDEO_ID_TOOLBOX 2
+
+ PrefsRecord prefs = { DEFAULT_ARGS, DEFAULT_VIDEO_DRIVER, DEFAULT_OUTPUT_TO_FILE };
+
+#if !(defined(__APPLE__) && defined(__MACH__))
+ int nargs;
+ char **args;
+ char *commandLine;
+
+ StrFileName appNameText;
+#endif
+ int videodriver = VIDEO_ID_TOOLBOX;
+ int settingsChanged = 0;
+
+ long i;
+
+ /* Kyle's SDL command-line dialog code ... */
+#if !TARGET_API_MAC_CARBON
+ InitGraf (&qd.thePort);
+ InitFonts ();
+ InitWindows ();
+ InitMenus ();
+ InitDialogs (nil);
+#endif
+ InitCursor ();
+ FlushEvents(everyEvent,0);
+#if !TARGET_API_MAC_CARBON
+ MaxApplZone ();
+#endif
+ MoreMasters ();
+ MoreMasters ();
+#if 0
+ /* Intialize SDL, and put up a dialog if we fail */
+ if ( SDL_Init (0) < 0 ) {
+
+#define kErr_OK 1
+#define kErr_Text 2
+
+ DialogPtr errorDialog;
+ short dummyType;
+ Rect dummyRect;
+ Handle dummyHandle;
+ short itemHit;
+
+ errorDialog = GetNewDialog (1001, nil, (WindowPtr)-1);
+ if (errorDialog == NULL)
+ return -1;
+ DrawDialog (errorDialog);
+
+ GetDialogItem (errorDialog, kErr_Text, &dummyType, &dummyHandle, &dummyRect);
+ SetDialogItemText (dummyHandle, "\pError Initializing SDL");
+
+#if TARGET_API_MAC_CARBON
+ SetPort (GetDialogPort(errorDialog));
+#else
+ SetPort (errorDialog);
+#endif
+ do {
+ ModalDialog (nil, &itemHit);
+ } while (itemHit != kErr_OK);
+
+ DisposeDialog (errorDialog);
+ exit (-1);
+ }
+ atexit(cleanup_output);
+ atexit(SDL_Quit);
+#endif
+
+/* Set up SDL's QuickDraw environment */
+#if !TARGET_API_MAC_CARBON
+ SDL_InitQuickDraw(&qd);
+#endif
+
+ if ( readPreferences (&prefs) ) {
+
+ if (SDL_memcmp(prefs.video_driver_name+1, "DSp", 3) == 0)
+ videodriver = 1;
+ else if (SDL_memcmp(prefs.video_driver_name+1, "toolbox", 7) == 0)
+ videodriver = 2;
+ }
+
+ if ( CommandKeyIsDown() ) {
+
+#define kCL_OK 1
+#define kCL_Cancel 2
+#define kCL_Text 3
+#define kCL_File 4
+#define kCL_Video 6
+
+ DialogPtr commandDialog;
+ short dummyType;
+ Rect dummyRect;
+ Handle dummyHandle;
+ short itemHit;
+ #if TARGET_API_MAC_CARBON
+ ControlRef control;
+ #endif
+
+ /* Assume that they will change settings, rather than do exhaustive check */
+ settingsChanged = 1;
+
+ /* Create dialog and display it */
+ commandDialog = GetNewDialog (1000, nil, (WindowPtr)-1);
+ #if TARGET_API_MAC_CARBON
+ SetPort ( GetDialogPort(commandDialog) );
+ #else
+ SetPort (commandDialog);
+ #endif
+
+ /* Setup controls */
+ #if TARGET_API_MAC_CARBON
+ GetDialogItemAsControl(commandDialog, kCL_File, &control);
+ SetControlValue (control, prefs.output_to_file);
+ #else
+ GetDialogItem (commandDialog, kCL_File, &dummyType, &dummyHandle, &dummyRect); /* MJS */
+ SetControlValue ((ControlHandle)dummyHandle, prefs.output_to_file );
+ #endif
+
+ GetDialogItem (commandDialog, kCL_Text, &dummyType, &dummyHandle, &dummyRect);
+ SetDialogItemText (dummyHandle, prefs.command_line);
+
+ #if TARGET_API_MAC_CARBON
+ GetDialogItemAsControl(commandDialog, kCL_Video, &control);
+ SetControlValue (control, videodriver);
+ #else
+ GetDialogItem (commandDialog, kCL_Video, &dummyType, &dummyHandle, &dummyRect);
+ SetControlValue ((ControlRef)dummyHandle, videodriver);
+ #endif
+
+ SetDialogDefaultItem (commandDialog, kCL_OK);
+ SetDialogCancelItem (commandDialog, kCL_Cancel);
+
+ do {
+
+ ModalDialog(nil, &itemHit); /* wait for user response */
+
+ /* Toggle command-line output checkbox */
+ if ( itemHit == kCL_File ) {
+ #if TARGET_API_MAC_CARBON
+ GetDialogItemAsControl(commandDialog, kCL_File, &control);
+ SetControlValue (control, !GetControlValue(control));
+ #else
+ GetDialogItem(commandDialog, kCL_File, &dummyType, &dummyHandle, &dummyRect); /* MJS */
+ SetControlValue((ControlHandle)dummyHandle, !GetControlValue((ControlHandle)dummyHandle) );
+ #endif
+ }
+
+ } while (itemHit != kCL_OK && itemHit != kCL_Cancel);
+
+ /* Get control values, even if they did not change */
+ GetDialogItem (commandDialog, kCL_Text, &dummyType, &dummyHandle, &dummyRect); /* MJS */
+ GetDialogItemText (dummyHandle, prefs.command_line);
+
+ #if TARGET_API_MAC_CARBON
+ GetDialogItemAsControl(commandDialog, kCL_File, &control);
+ prefs.output_to_file = GetControlValue(control);
+ #else
+ GetDialogItem (commandDialog, kCL_File, &dummyType, &dummyHandle, &dummyRect); /* MJS */
+ prefs.output_to_file = GetControlValue ((ControlHandle)dummyHandle);
+ #endif
+
+ #if TARGET_API_MAC_CARBON
+ GetDialogItemAsControl(commandDialog, kCL_Video, &control);
+ videodriver = GetControlValue(control);
+ #else
+ GetDialogItem (commandDialog, kCL_Video, &dummyType, &dummyHandle, &dummyRect);
+ videodriver = GetControlValue ((ControlRef)dummyHandle);
+ #endif
+
+ DisposeDialog (commandDialog);
+
+ if (itemHit == kCL_Cancel ) {
+ exit (0);
+ }
+ }
+
+ /* Set pseudo-environment variables for video driver, update prefs */
+ switch ( videodriver ) {
+ case VIDEO_ID_DRAWSPROCKET:
+ SDL_putenv("SDL_VIDEODRIVER=DSp");
+ SDL_memcpy(prefs.video_driver_name, "\pDSp", 4);
+ break;
+ case VIDEO_ID_TOOLBOX:
+ SDL_putenv("SDL_VIDEODRIVER=toolbox");
+ SDL_memcpy(prefs.video_driver_name, "\ptoolbox", 8);
+ break;
+ }
+
+#if !(defined(__APPLE__) && defined(__MACH__))
+ /* Redirect standard I/O to files */
+ if ( prefs.output_to_file ) {
+ freopen (STDOUT_FILE, "w", stdout);
+ freopen (STDERR_FILE, "w", stderr);
+ } else {
+ fclose (stdout);
+ fclose (stderr);
+ }
+#endif
+
+ if (settingsChanged) {
+ /* Save the prefs, even if they might not have changed (but probably did) */
+ if ( ! writePreferences (&prefs) )
+ fprintf (stderr, "WARNING: Could not save preferences!\n");
+ }
+
+#if !(defined(__APPLE__) && defined(__MACH__))
+ appNameText[0] = 0;
+ getCurrentAppName (appNameText); /* check for error here ? */
+
+ commandLine = (char*) malloc (appNameText[0] + prefs.command_line[0] + 2);
+ if ( commandLine == NULL ) {
+ exit(-1);
+ }
+
+ /* Rather than rewrite ParseCommandLine method, let's replace */
+ /* any spaces in application name with underscores, */
+ /* so that the app name is only 1 argument */
+ for (i = 1; i < 1+appNameText[0]; i++)
+ if ( appNameText[i] == ' ' ) appNameText[i] = '_';
+
+ /* Copy app name & full command text to command-line C-string */
+ SDL_memcpy(commandLine, appNameText + 1, appNameText[0]);
+ commandLine[appNameText[0]] = ' ';
+ SDL_memcpy(commandLine + appNameText[0] + 1, prefs.command_line + 1, prefs.command_line[0]);
+ commandLine[ appNameText[0] + 1 + prefs.command_line[0] ] = '\0';
+
+ /* Parse C-string into argv and argc */
+ nargs = ParseCommandLine (commandLine, NULL);
+ args = (char **)malloc((nargs+1)*(sizeof *args));
+ if ( args == NULL ) {
+ exit(-1);
+ }
+ ParseCommandLine (commandLine, args);
+
+ /* Run the main application code */
+ SDL_main(nargs, args);
+ free (args);
+ free (commandLine);
+
+ /* Remove useless stdout.txt and stderr.txt */
+ cleanup_output ();
+#else // defined(__APPLE__) && defined(__MACH__)
+ SDL_main(argc, argv);
+#endif
+
+ /* Exit cleanly, calling atexit() functions */
+ exit (0);
+
+ /* Never reached, but keeps the compiler quiet */
+ return (0);
+}
diff --git a/distrib/sdl-1.2.15/src/main/macos/SIZE.r b/distrib/sdl-1.2.15/src/main/macos/SIZE.r
new file mode 100644
index 0000000..fe63e19
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/main/macos/SIZE.r
@@ -0,0 +1 @@
+ #include "Processes.r" resource 'SIZE' (-1) { reserved, acceptSuspendResumeEvents, reserved, canBackground, doesActivateOnFGSwitch, backgroundAndForeground, getFrontClicks, ignoreAppDiedEvents, is32BitCompatible, isHighLevelEventAware, onlyLocalHLEvents, notStationeryAware, useTextEditServices, reserved, reserved, reserved, 5242880, // 5 megs minimum 5242880 // 5 megs maximum }; \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/src/main/macos/exports/Makefile b/distrib/sdl-1.2.15/src/main/macos/exports/Makefile
new file mode 100644
index 0000000..5f37ae0
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/main/macos/exports/Makefile
@@ -0,0 +1,39 @@
+
+EXPORTS = SDL.x
+HEADERS = \
+ ../../../../include/SDL.h \
+ ../../../../include/SDL_active.h \
+ ../../../../include/SDL_audio.h \
+ ../../../../include/SDL_byteorder.h \
+ ../../../../include/SDL_cdrom.h \
+ ../../../../include/SDL_copying.h \
+ ../../../../include/SDL_cpuinfo.h \
+ ../../../../include/SDL_endian.h \
+ ../../../../include/SDL_error.h \
+ ../../../../include/SDL_events.h \
+ ../../../../include/SDL_getenv.h \
+ ../../../../include/SDL_joystick.h \
+ ../../../../include/SDL_keyboard.h \
+ ../../../../include/SDL_keysym.h \
+ ../../../../include/SDL_loadso.h \
+ ../../../../include/SDL_mouse.h \
+ ../../../../include/SDL_mutex.h \
+ ../../../../include/SDL_name.h \
+ ../../../../include/SDL_platform.h \
+ ../../../../include/SDL_quit.h \
+ ../../../../include/SDL_rwops.h \
+ ../../../../include/SDL_syswm.h \
+ ../../../../include/SDL_thread.h \
+ ../../../../include/SDL_timer.h \
+ ../../../../include/SDL_types.h \
+ ../../../../include/SDL_version.h \
+ ../../../../include/SDL_video.h
+
+
+all: $(EXPORTS)
+
+$(EXPORTS): Makefile gendef.pl $(HEADERS)
+ perl gendef.pl $(HEADERS) >$@ || rm $@
+
+clean:
+ rm -f $(EXPORTS)
diff --git a/distrib/sdl-1.2.15/src/main/macos/exports/SDL.x b/distrib/sdl-1.2.15/src/main/macos/exports/SDL.x
new file mode 100644
index 0000000..ce9e96e
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/main/macos/exports/SDL.x
@@ -0,0 +1 @@
+ SDL_Init SDL_InitSubSystem SDL_QuitSubSystem SDL_WasInit SDL_Quit SDL_GetAppState SDL_AudioInit SDL_AudioQuit SDL_AudioDriverName SDL_OpenAudio SDL_GetAudioStatus SDL_PauseAudio SDL_LoadWAV_RW SDL_FreeWAV SDL_BuildAudioCVT SDL_ConvertAudio SDL_MixAudio SDL_LockAudio SDL_UnlockAudio SDL_CloseAudio SDL_CDNumDrives SDL_CDName SDL_CDOpen SDL_CDStatus SDL_CDPlayTracks SDL_CDPlay SDL_CDPause SDL_CDResume SDL_CDStop SDL_CDEject SDL_CDClose SDL_HasRDTSC SDL_HasMMX SDL_HasMMXExt SDL_Has3DNow SDL_Has3DNowExt SDL_HasSSE SDL_HasSSE2 SDL_HasAltiVec SDL_SetError SDL_GetError SDL_ClearError SDL_Error SDL_PumpEvents SDL_PeepEvents SDL_PollEvent SDL_WaitEvent SDL_PushEvent SDL_SetEventFilter SDL_GetEventFilter SDL_EventState SDL_NumJoysticks SDL_JoystickName SDL_JoystickOpen SDL_JoystickOpened SDL_JoystickIndex SDL_JoystickNumAxes SDL_JoystickNumBalls SDL_JoystickNumHats SDL_JoystickNumButtons SDL_JoystickUpdate SDL_JoystickEventState SDL_JoystickGetAxis SDL_JoystickGetHat SDL_JoystickGetBall SDL_JoystickGetButton SDL_JoystickClose SDL_EnableUNICODE SDL_EnableKeyRepeat SDL_GetKeyRepeat SDL_GetKeyState SDL_GetModState SDL_SetModState SDL_GetKeyName SDL_LoadObject SDL_LoadFunction SDL_UnloadObject SDL_GetMouseState SDL_GetRelativeMouseState SDL_WarpMouse SDL_CreateCursor SDL_SetCursor SDL_GetCursor SDL_FreeCursor SDL_ShowCursor SDL_CreateMutex SDL_mutexP SDL_mutexV SDL_DestroyMutex SDL_CreateSemaphore SDL_DestroySemaphore SDL_SemWait SDL_SemTryWait SDL_SemWaitTimeout SDL_SemPost SDL_SemValue SDL_CreateCond SDL_DestroyCond SDL_CondSignal SDL_CondBroadcast SDL_CondWait SDL_CondWaitTimeout SDL_RWFromFile SDL_RWFromFP SDL_RWFromMem SDL_RWFromConstMem SDL_AllocRW SDL_FreeRW SDL_ReadLE16 SDL_ReadBE16 SDL_ReadLE32 SDL_ReadBE32 SDL_ReadLE64 SDL_ReadBE64 SDL_WriteLE16 SDL_WriteBE16 SDL_WriteLE32 SDL_WriteBE32 SDL_WriteLE64 SDL_WriteBE64 SDL_GetWMInfo SDL_CreateThread SDL_CreateThread SDL_ThreadID SDL_GetThreadID SDL_WaitThread SDL_KillThread SDL_GetTicks SDL_Delay SDL_SetTimer SDL_AddTimer SDL_RemoveTimer SDL_Linked_Version SDL_VideoInit SDL_VideoQuit SDL_VideoDriverName SDL_GetVideoSurface SDL_GetVideoInfo SDL_VideoModeOK SDL_ListModes SDL_SetVideoMode SDL_UpdateRects SDL_UpdateRect SDL_Flip SDL_SetGamma SDL_SetGammaRamp SDL_GetGammaRamp SDL_SetColors SDL_SetPalette SDL_MapRGB SDL_MapRGBA SDL_GetRGB SDL_GetRGBA SDL_CreateRGBSurface SDL_CreateRGBSurfaceFrom SDL_FreeSurface SDL_LockSurface SDL_UnlockSurface SDL_LoadBMP_RW SDL_SaveBMP_RW SDL_SetColorKey SDL_SetAlpha SDL_SetClipRect SDL_GetClipRect SDL_ConvertSurface SDL_UpperBlit SDL_LowerBlit SDL_FillRect SDL_DisplayFormat SDL_DisplayFormatAlpha SDL_CreateYUVOverlay SDL_LockYUVOverlay SDL_UnlockYUVOverlay SDL_DisplayYUVOverlay SDL_FreeYUVOverlay SDL_GL_LoadLibrary SDL_GL_GetProcAddress SDL_GL_SetAttribute SDL_GL_GetAttribute SDL_GL_SwapBuffers SDL_GL_UpdateRects SDL_GL_Lock SDL_GL_Unlock SDL_WM_SetCaption SDL_WM_GetCaption SDL_WM_SetIcon SDL_WM_IconifyWindow SDL_WM_ToggleFullScreen SDL_WM_GrabInput SDL_SoftStretch SDL_putenv SDL_getenv SDL_qsort SDL_revcpy SDL_strlcpy SDL_strlcat SDL_strdup SDL_strrev SDL_strupr SDL_strlwr SDL_ltoa SDL_ultoa SDL_strcasecmp SDL_strncasecmp SDL_snprintf SDL_vsnprintf SDL_iconv SDL_iconv_string SDL_InitQuickDraw \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/src/main/macos/exports/gendef.pl b/distrib/sdl-1.2.15/src/main/macos/exports/gendef.pl
new file mode 100644
index 0000000..9cffca9
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/main/macos/exports/gendef.pl
@@ -0,0 +1,43 @@
+#!/usr/bin/perl
+#
+# Program to take a set of header files and generate DLL export definitions
+
+# Special exports to ignore for this platform
+
+while ( ($file = shift(@ARGV)) ) {
+ if ( ! defined(open(FILE, $file)) ) {
+ warn "Couldn't open $file: $!\n";
+ next;
+ }
+ $printed_header = 0;
+ $file =~ s,.*/,,;
+ while (<FILE>) {
+ if ( / DECLSPEC.* SDLCALL ([^\s\(]+)/ ) {
+ if ( not $exclude{$1} ) {
+ print "\t$1\r";
+ }
+ }
+ }
+ close(FILE);
+}
+
+# Special exports to include for this platform
+print "\tSDL_putenv\r";
+print "\tSDL_getenv\r";
+print "\tSDL_qsort\r";
+print "\tSDL_revcpy\r";
+print "\tSDL_strlcpy\r";
+print "\tSDL_strlcat\r";
+print "\tSDL_strdup\r";
+print "\tSDL_strrev\r";
+print "\tSDL_strupr\r";
+print "\tSDL_strlwr\r";
+print "\tSDL_ltoa\r";
+print "\tSDL_ultoa\r";
+print "\tSDL_strcasecmp\r";
+print "\tSDL_strncasecmp\r";
+print "\tSDL_snprintf\r";
+print "\tSDL_vsnprintf\r";
+print "\tSDL_iconv\r";
+print "\tSDL_iconv_string\r";
+print "\tSDL_InitQuickDraw\r";
diff --git a/distrib/sdl-1.2.12/src/main/macosx/Info.plist.in b/distrib/sdl-1.2.15/src/main/macosx/Info.plist.in
index b3d69ab..b3d69ab 100644
--- a/distrib/sdl-1.2.12/src/main/macosx/Info.plist.in
+++ b/distrib/sdl-1.2.15/src/main/macosx/Info.plist.in
diff --git a/distrib/sdl-1.2.15/src/main/macosx/SDLMain.h b/distrib/sdl-1.2.15/src/main/macosx/SDLMain.h
new file mode 100644
index 0000000..c56d90c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/main/macosx/SDLMain.h
@@ -0,0 +1,16 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#ifndef _SDLMain_h_
+#define _SDLMain_h_
+
+#import <Cocoa/Cocoa.h>
+
+@interface SDLMain : NSObject
+@end
+
+#endif /* _SDLMain_h_ */
diff --git a/distrib/sdl-1.2.15/src/main/macosx/SDLMain.m b/distrib/sdl-1.2.15/src/main/macosx/SDLMain.m
new file mode 100644
index 0000000..7da74b6
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/main/macosx/SDLMain.m
@@ -0,0 +1,395 @@
+/* SDLMain.m - main entry point for our Cocoa-ized SDL app
+ Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
+ Non-NIB-Code & other changes: Max Horn <max@quendi.de>
+
+ Feel free to customize this file to suit your needs
+*/
+
+#include "SDL.h"
+#include "SDLMain.h"
+#include <sys/param.h> /* for MAXPATHLEN */
+#include <unistd.h>
+
+/* For some reaon, Apple removed setAppleMenu from the headers in 10.4,
+ but the method still is there and works. To avoid warnings, we declare
+ it ourselves here. */
+@interface NSApplication(SDL_Missing_Methods)
+- (void)setAppleMenu:(NSMenu *)menu;
+@end
+
+/* Use this flag to determine whether we use SDLMain.nib or not */
+#define SDL_USE_NIB_FILE 0
+
+/* Use this flag to determine whether we use CPS (docking) or not */
+#define SDL_USE_CPS 1
+#ifdef SDL_USE_CPS
+/* Portions of CPS.h */
+typedef struct CPSProcessSerNum
+{
+ UInt32 lo;
+ UInt32 hi;
+} CPSProcessSerNum;
+
+extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
+extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
+extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
+
+#endif /* SDL_USE_CPS */
+
+static int gArgc;
+static char **gArgv;
+static BOOL gFinderLaunch;
+static BOOL gCalledAppMainline = FALSE;
+
+static NSString *getApplicationName(void)
+{
+ const NSDictionary *dict;
+ NSString *appName = 0;
+
+ /* Determine the application name */
+ dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
+ if (dict)
+ appName = [dict objectForKey: @"CFBundleName"];
+
+ if (![appName length])
+ appName = [[NSProcessInfo processInfo] processName];
+
+ return appName;
+}
+
+#if SDL_USE_NIB_FILE
+/* A helper category for NSString */
+@interface NSString (ReplaceSubString)
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
+@end
+#endif
+
+@interface NSApplication (SDLApplication)
+@end
+
+@implementation NSApplication (SDLApplication)
+/* Invoked from the Quit menu item */
+- (void)terminate:(id)sender
+{
+ /* Post a SDL_QUIT event */
+ SDL_Event event;
+ event.type = SDL_QUIT;
+ SDL_PushEvent(&event);
+}
+@end
+
+/* The main class of the application, the application's delegate */
+@implementation SDLMain
+
+/* Set the working directory to the .app's parent directory */
+- (void) setupWorkingDirectory:(BOOL)shouldChdir
+{
+ if (shouldChdir)
+ {
+ char parentdir[MAXPATHLEN];
+ CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
+ CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
+ if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) {
+ chdir(parentdir); /* chdir to the binary app's parent */
+ }
+ CFRelease(url);
+ CFRelease(url2);
+ }
+}
+
+#if SDL_USE_NIB_FILE
+
+/* Fix menu to contain the real app name instead of "SDL App" */
+- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
+{
+ NSRange aRange;
+ NSEnumerator *enumerator;
+ NSMenuItem *menuItem;
+
+ aRange = [[aMenu title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
+
+ enumerator = [[aMenu itemArray] objectEnumerator];
+ while ((menuItem = [enumerator nextObject]))
+ {
+ aRange = [[menuItem title] rangeOfString:@"SDL App"];
+ if (aRange.length != 0)
+ [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
+ if ([menuItem hasSubmenu])
+ [self fixMenu:[menuItem submenu] withAppName:appName];
+ }
+}
+
+#else
+
+static void setApplicationMenu(void)
+{
+ /* warning: this code is very odd */
+ NSMenu *appleMenu;
+ NSMenuItem *menuItem;
+ NSString *title;
+ NSString *appName;
+
+ appName = getApplicationName();
+ appleMenu = [[NSMenu alloc] initWithTitle:@""];
+
+ /* Add menu items */
+ title = [@"About " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
+
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ title = [@"Hide " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
+
+ menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
+ [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
+
+ [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
+
+ [appleMenu addItem:[NSMenuItem separatorItem]];
+
+ title = [@"Quit " stringByAppendingString:appName];
+ [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
+
+
+ /* Put menu into the menubar */
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
+ [menuItem setSubmenu:appleMenu];
+ [[NSApp mainMenu] addItem:menuItem];
+
+ /* Tell the application object that this is now the application menu */
+ [NSApp setAppleMenu:appleMenu];
+
+ /* Finally give up our references to the objects */
+ [appleMenu release];
+ [menuItem release];
+}
+
+/* Create a window menu */
+static void setupWindowMenu(void)
+{
+ NSMenu *windowMenu;
+ NSMenuItem *windowMenuItem;
+ NSMenuItem *menuItem;
+
+ windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
+
+ /* "Minimize" item */
+ menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
+ [windowMenu addItem:menuItem];
+ [menuItem release];
+
+ /* Put menu into the menubar */
+ windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
+ [windowMenuItem setSubmenu:windowMenu];
+ [[NSApp mainMenu] addItem:windowMenuItem];
+
+ /* Tell the application object that this is now the window menu */
+ [NSApp setWindowsMenu:windowMenu];
+
+ /* Finally give up our references to the objects */
+ [windowMenu release];
+ [windowMenuItem release];
+}
+
+/* Replacement for NSApplicationMain */
+static void CustomApplicationMain (int argc, char **argv)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ SDLMain *sdlMain;
+
+ /* Ensure the application object is initialised */
+ [NSApplication sharedApplication];
+
+#ifdef SDL_USE_CPS
+ {
+ CPSProcessSerNum PSN;
+ /* Tell the dock about us */
+ if (!CPSGetCurrentProcess(&PSN))
+ if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
+ if (!CPSSetFrontProcess(&PSN))
+ [NSApplication sharedApplication];
+ }
+#endif /* SDL_USE_CPS */
+
+ /* Set up the menubar */
+ [NSApp setMainMenu:[[NSMenu alloc] init]];
+ setApplicationMenu();
+ setupWindowMenu();
+
+ /* Create SDLMain and make it the app delegate */
+ sdlMain = [[SDLMain alloc] init];
+ [NSApp setDelegate:sdlMain];
+
+ /* Start the main event loop */
+ [NSApp run];
+
+ [sdlMain release];
+ [pool release];
+}
+
+#endif
+
+
+/*
+ * Catch document open requests...this lets us notice files when the app
+ * was launched by double-clicking a document, or when a document was
+ * dragged/dropped on the app's icon. You need to have a
+ * CFBundleDocumentsType section in your Info.plist to get this message,
+ * apparently.
+ *
+ * Files are added to gArgv, so to the app, they'll look like command line
+ * arguments. Previously, apps launched from the finder had nothing but
+ * an argv[0].
+ *
+ * This message may be received multiple times to open several docs on launch.
+ *
+ * This message is ignored once the app's mainline has been called.
+ */
+- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
+{
+ const char *temparg;
+ size_t arglen;
+ char *arg;
+ char **newargv;
+
+ if (!gFinderLaunch) /* MacOS is passing command line args. */
+ return FALSE;
+
+ if (gCalledAppMainline) /* app has started, ignore this document. */
+ return FALSE;
+
+ temparg = [filename UTF8String];
+ arglen = SDL_strlen(temparg) + 1;
+ arg = (char *) SDL_malloc(arglen);
+ if (arg == NULL)
+ return FALSE;
+
+ newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
+ if (newargv == NULL)
+ {
+ SDL_free(arg);
+ return FALSE;
+ }
+ gArgv = newargv;
+
+ SDL_strlcpy(arg, temparg, arglen);
+ gArgv[gArgc++] = arg;
+ gArgv[gArgc] = NULL;
+ return TRUE;
+}
+
+
+/* Called when the internal event loop has just started running */
+- (void) applicationDidFinishLaunching: (NSNotification *) note
+{
+ int status;
+
+ /* Set the working directory to the .app's parent directory */
+ [self setupWorkingDirectory:gFinderLaunch];
+
+#if SDL_USE_NIB_FILE
+ /* Set the main menu to contain the real app name instead of "SDL App" */
+ [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
+#endif
+
+ /* Hand off to main application code */
+ gCalledAppMainline = TRUE;
+ status = SDL_main (gArgc, gArgv);
+
+ /* We're done, thank you for playing */
+ exit(status);
+}
+@end
+
+
+@implementation NSString (ReplaceSubString)
+
+- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
+{
+ unsigned int bufferSize;
+ unsigned int selfLen = [self length];
+ unsigned int aStringLen = [aString length];
+ unichar *buffer;
+ NSRange localRange;
+ NSString *result;
+
+ bufferSize = selfLen + aStringLen - aRange.length;
+ buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar));
+
+ /* Get first part into buffer */
+ localRange.location = 0;
+ localRange.length = aRange.location;
+ [self getCharacters:buffer range:localRange];
+
+ /* Get middle part into buffer */
+ localRange.location = 0;
+ localRange.length = aStringLen;
+ [aString getCharacters:(buffer+aRange.location) range:localRange];
+
+ /* Get last part into buffer */
+ localRange.location = aRange.location + aRange.length;
+ localRange.length = selfLen - localRange.location;
+ [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];
+
+ /* Build output string */
+ result = [NSString stringWithCharacters:buffer length:bufferSize];
+
+ NSDeallocateMemoryPages(buffer, bufferSize);
+
+ return result;
+}
+
+@end
+
+
+
+#ifdef main
+# undef main
+#endif
+
+
+/* Main entry point to executable - should *not* be SDL_main! */
+int main (int argc, char **argv)
+{
+ /* Copy the arguments into a global variable */
+ /* This is passed if we are launched by double-clicking */
+ if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
+ gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
+ gArgv[0] = argv[0];
+ gArgv[1] = NULL;
+ gArgc = 1;
+ gFinderLaunch = YES;
+ } else {
+ int i;
+ gArgc = argc;
+ gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
+ for (i = 0; i <= argc; i++)
+ gArgv[i] = argv[i];
+ gFinderLaunch = NO;
+ }
+
+/* ANDROID_BEGIN */
+ /* if -no-window is used, we don't want to launch a graphical
+ * application that creates a Menu bar and steals the focus.
+ */
+ {
+ int nn;
+ for (nn = 0; nn < argc; nn++) {
+ if ( !strcmp( argv[nn], "-no-window" ) ) {
+ return SDL_main (argc, argv);
+ }
+ }
+ }
+/* ANDROID_END */
+
+#if SDL_USE_NIB_FILE
+ NSApplicationMain (argc, argv);
+#else
+ CustomApplicationMain (argc, argv);
+#endif
+ return 0;
+}
+
diff --git a/distrib/sdl-1.2.12/src/main/macosx/SDLMain.nib/classes.nib b/distrib/sdl-1.2.15/src/main/macosx/SDLMain.nib/classes.nib
index f8f4e9a..f8f4e9a 100644
--- a/distrib/sdl-1.2.12/src/main/macosx/SDLMain.nib/classes.nib
+++ b/distrib/sdl-1.2.15/src/main/macosx/SDLMain.nib/classes.nib
diff --git a/distrib/sdl-1.2.12/src/main/macosx/SDLMain.nib/info.nib b/distrib/sdl-1.2.15/src/main/macosx/SDLMain.nib/info.nib
index 2211cf9..2211cf9 100644
--- a/distrib/sdl-1.2.12/src/main/macosx/SDLMain.nib/info.nib
+++ b/distrib/sdl-1.2.15/src/main/macosx/SDLMain.nib/info.nib
diff --git a/distrib/sdl-1.2.12/src/main/macosx/SDLMain.nib/objects.nib b/distrib/sdl-1.2.15/src/main/macosx/SDLMain.nib/objects.nib
index 9f697b0..9f697b0 100644
--- a/distrib/sdl-1.2.12/src/main/macosx/SDLMain.nib/objects.nib
+++ b/distrib/sdl-1.2.15/src/main/macosx/SDLMain.nib/objects.nib
Binary files differ
diff --git a/distrib/sdl-1.2.12/src/main/macosx/info.nib b/distrib/sdl-1.2.15/src/main/macosx/info.nib
index d13726f..d13726f 100644
--- a/distrib/sdl-1.2.12/src/main/macosx/info.nib
+++ b/distrib/sdl-1.2.15/src/main/macosx/info.nib
diff --git a/distrib/sdl-1.2.12/src/main/qtopia/SDL_qtopia_main.cc b/distrib/sdl-1.2.15/src/main/qtopia/SDL_qtopia_main.cc
index 46fd518..46fd518 100644
--- a/distrib/sdl-1.2.12/src/main/qtopia/SDL_qtopia_main.cc
+++ b/distrib/sdl-1.2.15/src/main/qtopia/SDL_qtopia_main.cc
diff --git a/distrib/sdl-1.2.15/src/main/symbian/EKA1/SDL_main.cpp b/distrib/sdl-1.2.15/src/main/symbian/EKA1/SDL_main.cpp
new file mode 100644
index 0000000..683db87
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/main/symbian/EKA1/SDL_main.cpp
@@ -0,0 +1,152 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@devolution.com
+*/
+
+/*
+ SDL_main.cpp
+ The Epoc executable startup functions
+
+ Epoc version by Hannu Viitala (hannu.j.viitala@mbnet.fi)
+*/
+
+#include <e32std.h>
+#include <e32def.h>
+#include <e32svr.h>
+#include <e32base.h>
+#include <estlib.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <w32std.h>
+#include <apgtask.h>
+
+#include "SDL_error.h"
+
+#if defined(__WINS__)
+#include <estw32.h>
+IMPORT_C void RegisterWsExe(const TDesC &aName);
+#endif
+
+/* The prototype for the application's main() function */
+#define main SDL_main
+extern "C" int main (int argc, char *argv[], char *envp[]);
+extern "C" void exit (int ret);
+
+
+/* Epoc main function */
+
+#ifdef __WINS__
+
+
+void GetCmdLine(int& aArgc, char**& aArgv)
+ {
+ RChunk chunk;
+
+ if(chunk.OpenGlobal(RThread().Name(), ETrue) != KErrNone)
+ return;
+
+ TUint* ptr = (TUint*) chunk.Base();
+ if(ptr != NULL)
+ {
+ aArgc = (int) *(ptr); // count
+ aArgv = (char**) *(ptr + 1);
+ }
+ chunk.Close();
+ }
+
+#endif
+
+
+TInt E32Main()
+ {
+ /* Get the clean-up stack */
+ CTrapCleanup* cleanup = CTrapCleanup::New();
+
+ /* Arrange for multi-threaded operation */
+ SpawnPosixServerThread();
+
+ /* Get args and environment */
+ int argc=0;
+ char** argv=0;
+ char** envp=0;
+
+#ifndef __WINS__
+ __crt0(argc,argv,envp);
+#else
+ GetCmdLine(argc, argv);
+#endif
+ /* Start the application! */
+
+ /* Create stdlib */
+ _REENT;
+
+ /* Set process and thread priority and name */
+
+ RThread currentThread;
+ RProcess thisProcess;
+ TParse exeName;
+ exeName.Set(thisProcess.FileName(), NULL, NULL);
+ currentThread.Rename(exeName.Name());
+ currentThread.SetProcessPriority(EPriorityLow);
+ currentThread.SetPriority(EPriorityMuchLess);
+
+ /* Call stdlib main */
+ int ret = main(argc, argv, envp); /* !! process exits here if there is "exit()" in main! */
+
+ /* Call exit */
+ //exit(ret); /* !! process exits here! */
+ //Markus: I do not understand above
+ //I commented it at let this function
+ //to return ret value - was it purpose
+ //that cleanup below is not called at all - why?
+
+ /* Free resources and return */
+
+ _cleanup(); //this is normally called at exit, I call it here, Markus
+
+ CloseSTDLIB();
+ delete cleanup;
+#ifdef __WINS__
+// User::Panic(_L("exit"), ret);
+ // RThread().Kill(ret); //Markus get rid of this thread
+ // RThread().RaiseException(EExcKill);
+#endif
+ return ret;//Markus, or exit(ret); ??
+ //return(KErrNone);
+ }
+
+
+#ifdef __WINS__
+EXPORT_C TInt WinsMain()
+ {
+ return E32Main();
+ // return WinsMain(0, 0, 0);
+ }
+#endif
+
+/* Epoc dll entry point */
+#if defined(__WINS__)
+GLDEF_C TInt E32Dll(TDllReason)
+ {
+ return(KErrNone);
+ }
+#endif
+
+
diff --git a/distrib/sdl-1.2.15/src/main/symbian/EKA2/SDL_main.cpp b/distrib/sdl-1.2.15/src/main/symbian/EKA2/SDL_main.cpp
new file mode 100644
index 0000000..3dc69d4
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/main/symbian/EKA2/SDL_main.cpp
@@ -0,0 +1,1035 @@
+/*
+ SDL_Main.cpp
+ Symbian OS services for SDL
+
+ Markus Mertama
+*/
+
+
+#include "epoc_sdl.h"
+
+#include"sdlepocapi.h"
+#include <e32base.h>
+#include <estlib.h>
+#include <stdio.h>
+#include <badesca.h>
+
+#include "vectorbuffer.h"
+#include <w32std.h>
+#include <aknappui.h>
+#include <aknapp.h>
+#include "SDL_epocevents_c.h"
+#include "SDL_keysym.h"
+#include "dsa.h"
+
+
+#ifdef SYMBIANC
+#include <reent.h>
+#endif
+
+//Markus Mertama
+
+
+extern SDLKey* KeyMap();
+extern void ResetKeyMap();
+
+class CCurrentAppUi;
+
+//const TUid KSDLUid = { 0xF01F3D69 };
+
+NONSHARABLE_CLASS(EnvUtils)
+ {
+ public:
+ static void DisableKeyBlocking();
+ static TBool Rendezvous(RThread& aThread, TRequestStatus& aStatus);
+ };
+
+TInt Panic(TInt aErr, TInt aLine)
+ {
+ TBuf<64> b;
+ b.Format(_L("Main at %d"), aLine);
+ User::Panic(b, aErr);
+ return 0;
+ }
+
+
+NONSHARABLE_CLASS(CCurrentAppUi) : public CAknAppUi
+ {
+ public:
+ static CCurrentAppUi* Cast(CEikAppUi* aUi);
+ void DisableKeyBlocking();
+ };
+
+
+CCurrentAppUi* CCurrentAppUi::Cast(CEikAppUi* aUi)
+ {
+ return static_cast<CCurrentAppUi*>(aUi);
+ }
+
+void CCurrentAppUi::DisableKeyBlocking()
+ {
+ SetKeyBlockMode(ENoKeyBlock);
+ }
+
+
+class CEventQueue : public CBase, public MEventQueue
+ {
+ public:
+ static CEventQueue* NewL();
+ ~CEventQueue();
+ public:
+ TInt Append(const TWsEvent& aEvent);
+ const TWsEvent& Shift();
+ void Lock();
+ void Unlock();
+ TBool HasData();
+ private:
+ TVector<TWsEvent, 64> iVector;
+ RCriticalSection iCS;
+ };
+
+ CEventQueue* CEventQueue::NewL()
+ {
+ CEventQueue* q = new (ELeave) CEventQueue();
+ CleanupStack::PushL(q);
+ User::LeaveIfError(q->iCS.CreateLocal());
+ CleanupStack::Pop();
+ return q;
+ }
+
+CEventQueue::~CEventQueue()
+ {
+ iCS.Close();
+ }
+
+TInt CEventQueue::Append(const TWsEvent& aEvent)
+ {
+ iCS.Wait();
+ const TInt err = iVector.Append(aEvent);
+ iCS.Signal();
+ return err;
+ }
+
+
+TBool CEventQueue::HasData()
+ {
+ return iVector.Size() > 0;
+ }
+
+
+void CEventQueue::Lock()
+ {
+ iCS.Wait();
+ }
+
+void CEventQueue::Unlock()
+ {
+ iCS.Signal();
+ }
+
+const TWsEvent& CEventQueue::Shift()
+ {
+ const TWsEvent& event = iVector.Shift();
+ return event;
+ }
+
+
+TSdlCleanupItem::TSdlCleanupItem(TSdlCleanupOperation aOperation, TAny* aItem) :
+iOperation(aOperation), iItem(aItem), iThread(RThread().Id())
+ {
+ }
+
+class CEikonEnv;
+class CSdlAppServ;
+
+
+NONSHARABLE_CLASS(EpocSdlEnvData)
+ {
+ public:
+ void Free();
+ CEventQueue* iEventQueue;
+ TMainFunc iMain;
+ TInt iEpocEnvFlags;
+ int iArgc;
+ char** iArgv;
+ CDsa* iDsa;
+ CSdlAppServ* iAppSrv;
+ TThreadId iId;
+ CArrayFix<TSdlCleanupItem>* iCleanupItems;
+ CEikAppUi* iAppUi;
+ CSDL* iSdl;
+ };
+
+
+EpocSdlEnvData* gEpocEnv;
+
+#define MAINFUNC(x) EXPORT_C TMainFunc::TMainFunc(mainfunc##x aFunc){Mem::FillZ(iMainFunc, sizeof(iMainFunc)); iMainFunc[x - 1] = (void*) aFunc;}
+
+MAINFUNC(1)
+MAINFUNC(2)
+MAINFUNC(3)
+MAINFUNC(4)
+MAINFUNC(5)
+MAINFUNC(6)
+
+EXPORT_C TMainFunc::TMainFunc()
+ {
+ Mem::FillZ(iMainFunc, sizeof(iMainFunc));
+ }
+
+
+const void* TMainFunc::operator[](TInt aIndex) const
+ {
+ return iMainFunc[aIndex];
+ }
+
+
+NONSHARABLE_CLASS(CSdlAppServ) : public CActive
+ {
+ public:
+ enum
+ {
+ EAppSrvNoop = CDsa::ELastDsaRequest,
+ EAppSrvWindowWidth,
+ EAppSrvWindowHeight,
+ EAppSrvWindowDisplayMode,
+ EAppSrvWindowPointerCursorMode,
+ EAppSrvDsaStatus,
+ EAppSrvStopThread,
+ EAppSrvWaitDsa
+ };
+ CSdlAppServ();
+ void ConstructL();
+ ~CSdlAppServ();
+ TInt Request(TInt aService);
+ TInt RequestValue(TInt aService);
+ void Init();
+ void PanicMain(TInt aReason);
+ void PanicMain(const TDesC& aInfo, TInt aReason);
+ void SetObserver(MSDLObserver* aObserver);
+ TInt ObserverEvent(TInt aEvent, TInt aParam);
+ void SetParam(TInt aParam);
+ void HandleObserverValue(TInt aService, TInt aReturnValue, TBool aMainThread);
+ MSDLObserver* Observer();
+ private:
+ void RunL();
+ void DoCancel();
+ private:
+ const TThreadId iMainId;
+ RThread iAppThread;
+ TInt iService;
+ TInt iReturnValue;
+ RSemaphore iSema;
+ MSDLObserver* iObserver;
+ TRequestStatus* iStatusPtr;
+ };
+
+CSdlAppServ::CSdlAppServ() : CActive(CActive::EPriorityHigh), iMainId(RThread().Id())
+ {
+ }
+
+
+
+MSDLObserver* CSdlAppServ::Observer()
+ {
+ return iObserver;
+ }
+
+
+void CSdlAppServ::SetObserver(MSDLObserver* aObserver)
+ {
+ iObserver = aObserver;
+ }
+
+TInt CSdlAppServ::ObserverEvent(TInt aEvent, TInt aParam)
+ {
+ if(iObserver != NULL)
+ {
+ if(RThread().Id() == gEpocEnv->iId)
+ {
+ return iObserver->SdlThreadEvent(aEvent, aParam);
+ }
+ else if(RThread().Id() == iMainId)
+ {
+ return iObserver->SdlEvent(aEvent, aParam);
+ }
+ PANIC(KErrNotSupported);
+ }
+ return 0;
+ }
+
+void CSdlAppServ::PanicMain(TInt aReason)
+ {
+ iAppThread.Panic(RThread().Name(), aReason);
+ }
+
+void CSdlAppServ::PanicMain(const TDesC& aInfo, TInt aReason)
+ {
+ iAppThread.Panic(aInfo, aReason);
+ }
+
+void CSdlAppServ::ConstructL()
+ {
+ CActiveScheduler::Add(this);
+ User::LeaveIfError(iSema.CreateLocal(1));
+ iStatus = KRequestPending;
+ iStatusPtr = &iStatus;
+ SetActive();
+ }
+
+ CSdlAppServ::~CSdlAppServ()
+ {
+ Cancel();
+ if(iSema.Handle() != NULL)
+ iSema.Signal();
+ iSema.Close();
+ iAppThread.Close();
+ }
+
+TInt CSdlAppServ::Request(TInt aService)
+ {
+ if(RThread().Id() != iAppThread.Id())
+ {
+ iSema.Wait();
+ iService = aService;
+ iAppThread.RequestComplete(iStatusPtr, KErrNone);
+ return KErrNone;
+ }
+ return KErrBadHandle;
+ }
+
+TInt CSdlAppServ::RequestValue(TInt aService)
+ {
+ Request(aService);
+ Request(EAppSrvNoop);
+ return iReturnValue;
+ }
+
+void CSdlAppServ::Init()
+ {
+ PANIC_IF_ERROR(iAppThread.Open(iMainId));
+ }
+
+void CSdlAppServ::SetParam(TInt aParam)
+ {
+ iReturnValue = aParam;
+ }
+
+void CSdlAppServ::HandleObserverValue(TInt aService, TInt aReturnValue, TBool aMainThread)
+ {
+ if(iObserver != NULL && aMainThread)
+ {
+ switch(aService)
+ {
+ case MSDLObserver::EEventScreenSizeChanged:
+ if(aReturnValue == MSDLObserver::EScreenSizeChangedDefaultPalette)
+ EpocSdlEnv::LockPalette(EFalse);
+ break;
+ }
+ }
+ if(!aMainThread && aService == MSDLObserver::EEventSuspend)
+ {
+ if(iObserver == NULL ||
+ (gEpocEnv->iDsa->Stopped() && aReturnValue != MSDLObserver::ESuspendNoSuspend))
+ {
+ EpocSdlEnv::Suspend();
+ }
+ }
+ }
+
+void CSdlAppServ::RunL()
+ {
+ if(iStatus == KErrNone)
+ {
+ switch(iService)
+ {
+ case CSdlAppServ::EAppSrvWaitDsa:
+ EpocSdlEnv::SetWaitDsa();
+ iReturnValue = EpocSdlEnv::IsDsaAvailable();
+ // }
+ // gEpocEnv->iDsa->Stop();
+ // gEpocEnv->iDsa->RestartL();
+ break;
+ case CSdlAppServ::EAppSrvStopThread:
+ gEpocEnv->iDsa->SetSuspend();
+ break;
+ case EpocSdlEnv::EDisableKeyBlocking:
+ EnvUtils::DisableKeyBlocking();
+ break;
+
+ case EAppSrvWindowPointerCursorMode:
+ iReturnValue = gEpocEnv->iDsa != NULL ?
+ gEpocEnv->iDsa->Session().PointerCursorMode() : KErrNotReady;
+ break;
+ case EAppSrvDsaStatus:
+ gEpocEnv->iDsa->Stop();
+ iReturnValue = KErrNone;
+ break;
+ case CDsa::ERequestUpdate:
+ gEpocEnv->iDsa->UnlockHWSurfaceRequestComplete();
+ break;
+ case EAppSrvNoop:
+ break;
+ case MSDLObserver::EEventResume:
+ case MSDLObserver::EEventSuspend:
+ case MSDLObserver::EEventScreenSizeChanged:
+ case MSDLObserver::EEventWindowReserved:
+ case MSDLObserver::EEventKeyMapInit:
+ case MSDLObserver::EEventWindowNotAvailable:
+ case MSDLObserver::EEventMainExit:
+ iReturnValue = ObserverEvent(iService, iReturnValue);
+ HandleObserverValue(iService, iReturnValue, ETrue);
+ break;
+ default:
+ PANIC(KErrNotSupported);
+ }
+ iStatus = KRequestPending;
+ iStatusPtr = &iStatus;
+ SetActive();
+ }
+ iSema.Signal();
+ }
+
+void CSdlAppServ::DoCancel()
+ {
+ iSema.Wait();
+ TRequestStatus* s = &iStatus;
+ iAppThread.RequestComplete(s, KErrCancel);
+ }
+
+
+
+MEventQueue& EpocSdlEnv::EventQueue()
+ {
+ __ASSERT_DEBUG(gEpocEnv != NULL, PANIC(KErrNotReady));
+ return *gEpocEnv->iEventQueue;
+ }
+
+
+TBool EpocSdlEnv::Flags(TInt aFlag)
+ {
+ const TInt flag = gEpocEnv->iEpocEnvFlags & aFlag;
+ return flag == aFlag;
+ }
+
+TInt EpocSdlEnv::Argc()
+ {
+ __ASSERT_DEBUG(gEpocEnv != NULL, PANIC(KErrNotReady));
+ return gEpocEnv->iArgc;
+ }
+
+
+char** EpocSdlEnv::Argv()
+ {
+ __ASSERT_DEBUG(gEpocEnv != NULL, PANIC(KErrNotReady));
+ return gEpocEnv->iArgv;
+ }
+
+
+TBool EpocSdlEnv::IsDsaAvailable()
+ {
+ __ASSERT_DEBUG(gEpocEnv != NULL, PANIC(KErrNotReady));
+ return gEpocEnv->iDsa != NULL && gEpocEnv->iDsa->IsDsaAvailable();
+ }
+
+
+void EpocSdlEnv::WaitDsaAvailable()
+ {
+ EpocSdlEnv::ObserverEvent(MSDLObserver::EEventWindowNotAvailable, 0);
+ gEpocEnv->iAppSrv->Request(CSdlAppServ::EAppSrvStopThread);
+ if(EpocSdlEnv::Flags(CSDL::EEnableFocusStop))
+ {
+ EpocSdlEnv::ObserverEvent(MSDLObserver::EEventSuspend, 0);
+ }
+ }
+
+void EpocSdlEnv::Suspend()
+ {
+ if(gEpocEnv->iDsa->Stopped() || EpocSdlEnv::Flags(CSDL::EEnableFocusStop))
+ {
+ // gEpocEnv->iDsa->ReleaseStop();
+ gEpocEnv->iDsa->SetSuspend();
+ RThread().Suspend();
+ EpocSdlEnv::ObserverEvent(MSDLObserver::EEventResume, 0);
+ }
+ }
+
+void EpocSdlEnv::SetWaitDsa()
+ {
+ if(!IsDsaAvailable())
+ {
+ RThread th;
+ th.Open(gEpocEnv->iId);
+ th.Suspend();
+ th.Close();
+ gEpocEnv->iDsa->SetSuspend();
+ }
+ }
+
+void EpocSdlEnv::Resume()
+ {
+ gEpocEnv->iDsa->Resume();
+ RThread th;
+ th.Open(gEpocEnv->iId);
+ th.Resume();
+ th.Close();
+
+ const TInt value = gEpocEnv->iAppSrv->ObserverEvent(MSDLObserver::EEventResume, 0);
+ gEpocEnv->iAppSrv->HandleObserverValue(MSDLObserver::EEventResume, value, ETrue);
+ }
+
+
+TInt EpocSdlEnv::AllocSwSurface(const TSize& aSize, TDisplayMode aMode)
+ {
+ return gEpocEnv->iDsa->AllocSurface(EFalse, aSize, aMode);
+ }
+
+TInt EpocSdlEnv::AllocHwSurface(const TSize& aSize, TDisplayMode aMode)
+ {
+ return gEpocEnv->iDsa->AllocSurface(ETrue, aSize, aMode);
+ }
+
+
+void EpocSdlEnv::UnlockHwSurface()
+ {
+ gEpocEnv->iDsa->UnlockHwSurface();
+ }
+
+TUint8* EpocSdlEnv::LockHwSurface()
+ {
+ return gEpocEnv->iDsa->LockHwSurface();
+ }
+
+
+void EpocSdlEnv::UpdateSwSurface()
+ {
+ gEpocEnv->iDsa->UpdateSwSurface();
+ }
+
+TBool EpocSdlEnv::AddUpdateRect(TUint8* aAddress, const TRect& aUpdateRect, const TRect& aRect)
+ {
+ return gEpocEnv->iDsa->AddUpdateRect(aAddress, aUpdateRect, aRect);
+ }
+
+void EpocSdlEnv::Request(TInt aService)
+ {
+ __ASSERT_DEBUG(gEpocEnv != NULL, PANIC(KErrNotReady));
+ gEpocEnv->iAppSrv->Request(aService);
+ }
+
+
+TSize EpocSdlEnv::WindowSize(const TSize& aRequestedSize)
+ {
+ __ASSERT_DEBUG(gEpocEnv != NULL, PANIC(KErrNotReady));
+ if(EpocSdlEnv::Flags(CSDL::EAllowImageResize) && gEpocEnv->iDsa->WindowSize() != aRequestedSize)
+ {
+ TRAP_IGNORE(gEpocEnv->iDsa->CreateZoomerL(aRequestedSize));
+ }
+ return gEpocEnv->iDsa->WindowSize();
+ }
+
+ TSize EpocSdlEnv::WindowSize()
+ {
+ __ASSERT_DEBUG(gEpocEnv != NULL, PANIC(KErrNotReady));
+ return gEpocEnv->iDsa->WindowSize();
+ }
+
+TDisplayMode EpocSdlEnv::DisplayMode()
+ {
+ return gEpocEnv->iDsa->DisplayMode();
+ }
+
+TPointerCursorMode EpocSdlEnv::PointerMode()
+ {
+ return static_cast<TPointerCursorMode>
+ (gEpocEnv->iAppSrv->RequestValue(CSdlAppServ::EAppSrvWindowPointerCursorMode));
+ }
+
+TInt EpocSdlEnv::SetPalette(TInt aFirstcolor, TInt aColorCount, TUint32* aPalette)
+ {
+ return gEpocEnv->iDsa->SetPalette(aFirstcolor, aColorCount, aPalette);
+ }
+
+void EpocSdlEnv::PanicMain(TInt aErr)
+ {
+ gEpocEnv->iAppSrv->PanicMain(aErr);
+ }
+
+
+TInt EpocSdlEnv::AppendCleanupItem(const TSdlCleanupItem& aItem)
+ {
+ TRAPD(err, gEpocEnv->iCleanupItems->AppendL(aItem));
+ return err;
+ }
+
+void EpocSdlEnv::RemoveCleanupItem(TAny* aItem)
+ {
+ for(TInt i = 0; i < gEpocEnv->iCleanupItems->Count(); i++)
+ {
+ if(gEpocEnv->iCleanupItems->At(i).iItem == aItem)
+ gEpocEnv->iCleanupItems->Delete(i);
+ }
+ }
+
+void EpocSdlEnv::CleanupItems()
+ {
+ const TThreadId id = RThread().Id();
+ TInt last = gEpocEnv->iCleanupItems->Count() - 1;
+ TInt i;
+ for(i = last; i >= 0 ; i--)
+ {
+ TSdlCleanupItem& item = gEpocEnv->iCleanupItems->At(i);
+ if(item.iThread == id)
+ {
+ item.iThread = TThreadId(0);
+ item.iOperation(item.iItem);
+ }
+ }
+ last = gEpocEnv->iCleanupItems->Count() - 1;
+ for(i = last; i >= 0 ; i--)
+ {
+ TSdlCleanupItem& item = gEpocEnv->iCleanupItems->At(i);
+ if(item.iThread == TThreadId(0))
+ {
+ gEpocEnv->iCleanupItems->Delete(i);
+ }
+ }
+ }
+
+void EpocSdlEnv::FreeSurface()
+ {
+ Request(CSdlAppServ::EAppSrvDsaStatus);
+ gEpocEnv->iDsa->Free();
+ }
+
+void EpocSdlEnv::LockPalette(TBool aLock)
+ {
+ gEpocEnv->iDsa->LockPalette(aLock);
+ }
+
+void EpocSdlEnv::ObserverEvent(TInt aService, TInt aParam)
+ {
+ const TBool sdlThread = RThread().Id() == gEpocEnv->iId;
+ const TInt valuea = gEpocEnv->iAppSrv->ObserverEvent(aService, aParam);
+ gEpocEnv->iAppSrv->HandleObserverValue(aService, valuea, !sdlThread);
+ if(sdlThread)
+ {
+ gEpocEnv->iAppSrv->SetParam(aParam);
+ const TInt valuet = gEpocEnv->iAppSrv->RequestValue(aService);
+ gEpocEnv->iAppSrv->HandleObserverValue(aService, valuet, EFalse);
+ }
+ }
+
+
+TPoint EpocSdlEnv::WindowCoordinates(const TPoint& aPoint)
+ {
+ return gEpocEnv->iDsa->WindowCoordinates(aPoint);
+ }
+
+void EpocSdlEnv::PanicMain(const TDesC& aInfo, TInt aErr)
+ {
+ gEpocEnv->iAppSrv->PanicMain(aInfo, aErr);
+ }
+//Dsa is a low priority ao, it has to wait if its pending event, but ws
+//event has been prioritized before it
+//this is not called from app thread!
+void EpocSdlEnv::WaitDeviceChange()
+ {
+ LockPalette(ETrue);
+ gEpocEnv->iAppSrv->RequestValue(CSdlAppServ::EAppSrvWaitDsa);
+ const TSize sz = WindowSize();
+ const TInt param = reinterpret_cast<TInt>(&sz);
+ ObserverEvent(MSDLObserver::EEventScreenSizeChanged, param);
+
+ // RThread().Suspend();
+ }
+
+LOCAL_C TBool CheckSdl()
+ {
+ TInt isExit = ETrue;
+ RThread sdl;
+ if(sdl.Open(gEpocEnv->iId) == KErrNone)
+ {
+ if(sdl.ExitType() == EExitPending)
+ {
+ isExit = EFalse;
+ }
+ sdl.Close();
+ }
+ return isExit;
+ }
+
+void EpocSdlEnvData::Free()
+ {
+ if(RThread().Id() == gEpocEnv->iId)
+ {
+ iDsa->Free();
+ return;
+ }
+
+ __ASSERT_ALWAYS(iArgv == NULL || CheckSdl(), PANIC(KErrNotReady));
+
+ for(TInt i = 0; i < iArgc; i++)
+ User::Free( iArgv[i] );
+
+ User::Free(iArgv);
+
+
+ delete iEventQueue;
+
+ if(iDsa != NULL)
+ iDsa->Free();
+
+ delete iDsa;
+ delete iAppSrv;
+ }
+
+_LIT(KSDLMain, "SDLMain");
+
+LOCAL_C int MainL()
+ {
+ gEpocEnv->iCleanupItems = new (ELeave) CArrayFixFlat<TSdlCleanupItem>(8);
+
+ char** envp=0;
+ /* !! process exits here if there is "exit()" in main! */
+ int ret = 0;
+ for(TInt i = 0; i < 6; i++)
+ {
+ void* f = (void*) gEpocEnv->iMain[i];
+ if(f != NULL)
+ {
+ switch(i)
+ {
+ case 0:
+ ret = ((mainfunc1)f)();
+ return ret;
+ case 3:
+ ((mainfunc1)f)();
+ return ret;
+ case 1:
+ ret = ((mainfunc2)f)(EpocSdlEnv::Argc(), EpocSdlEnv::Argv());
+ return ret;
+ case 4:
+ ((mainfunc2)f)(EpocSdlEnv::Argc(), EpocSdlEnv::Argv());
+ return ret;
+ case 2:
+ ret = ((mainfunc3)f)(EpocSdlEnv::Argc(), EpocSdlEnv::Argv(), envp);
+ return ret;
+ case 5:
+ ((mainfunc3)f)(EpocSdlEnv::Argc(), EpocSdlEnv::Argv(), envp);
+ return ret;
+ }
+ }
+ }
+ PANIC(KErrNotFound);
+ return 0;
+ }
+
+LOCAL_C TInt DoMain(TAny* /*aParam*/)
+ {
+
+
+ CTrapCleanup* cleanup = CTrapCleanup::New();
+
+ TBool fbsconnected = EFalse;
+ if(RFbsSession::GetSession() == NULL)
+ {
+ PANIC_IF_ERROR(RFbsSession::Connect());
+ fbsconnected = ETrue;
+ }
+
+ gEpocEnv->iAppSrv->Init();
+
+#ifdef SYMBIANC
+ // Create stdlib
+ _REENT;
+#endif
+
+ // Call stdlib main
+ int ret = 0;
+
+ //completes waiting rendesvous
+ RThread::Rendezvous(KErrNone);
+
+ TRAPD(err, err = MainL());
+
+ EpocSdlEnv::ObserverEvent(MSDLObserver::EEventMainExit, err);
+
+ // Free resources and return
+
+ EpocSdlEnv::CleanupItems();
+
+ gEpocEnv->iCleanupItems->Reset();
+ delete gEpocEnv->iCleanupItems;
+ gEpocEnv->iCleanupItems = NULL;
+
+ gEpocEnv->Free(); //free up in thread resources
+
+#ifdef SYMBIANC
+ _cleanup(); //this is normally called at exit, I call it here
+#endif
+
+ if(fbsconnected)
+ RFbsSession::Disconnect();
+
+#ifdef SYMBIANC
+ CloseSTDLIB();
+#endif
+
+ // delete as;
+ delete cleanup;
+
+ return err == KErrNone ? ret : err;;
+ }
+
+
+
+EXPORT_C CSDL::~CSDL()
+ {
+ gEpocEnv->Free();
+ User::Free(gEpocEnv);
+ gEpocEnv->iSdl = NULL;
+ }
+
+EXPORT_C CSDL* CSDL::NewL(TInt aFlags)
+ {
+ __ASSERT_ALWAYS(gEpocEnv == NULL, PANIC(KErrAlreadyExists));
+ gEpocEnv = (EpocSdlEnvData*) User::AllocL(sizeof(EpocSdlEnvData));
+ Mem::FillZ(gEpocEnv, sizeof(EpocSdlEnvData));
+
+ gEpocEnv->iEpocEnvFlags = aFlags;
+ gEpocEnv->iEventQueue = CEventQueue::NewL();
+
+ gEpocEnv->iAppSrv = new (ELeave) CSdlAppServ();
+ gEpocEnv->iAppSrv->ConstructL();
+
+ CSDL* sdl = new (ELeave) CSDL();
+
+ gEpocEnv->iSdl = sdl;
+
+ return sdl;
+ }
+
+ /*
+EXPORT_C void CSDL::ReInitL(TFlags aFlags)
+ {
+ const TFlags prevFlags = gEpocEnv->iEpocEnvFlags;
+ gEpocEnv->iEpocEnvFlags = aFlags;
+ TInt err = KErrNone;
+ if(((prevFlags & EDrawModeDSB) != (aFlags & EDrawModeDSB)) && gEpocEnv->iDsa)
+ {
+ delete gEpocEnv->iDsa;
+ gEpocEnv->iDsa = NULL;
+ gEpocEnv->iDsa = CDsa::RecreateL(EpocSdlEnv::Flags(CSDL::EDrawModeDSB));
+ }
+ }
+ */
+
+
+EXPORT_C void CSDL::SetContainerWindowL(RWindow& aWindow, RWsSession& aSession, CWsScreenDevice& aDevice)
+ {
+ if(gEpocEnv->iDsa == NULL)
+ gEpocEnv->iDsa = CDsa::CreateL(aSession);
+ gEpocEnv->iDsa->ConstructL(aWindow, aDevice);
+ }
+
+
+EXPORT_C TThreadId CSDL::CallMainL(const TMainFunc& aFunc, TRequestStatus* const aStatus, const CDesC8Array* const aArg, TInt aFlags, TInt aStackSize)
+ {
+ ASSERT(gEpocEnv != NULL);
+ gEpocEnv->iMain = aFunc;
+ const TBool args = aArg != NULL;
+
+ gEpocEnv->iArgc = aArg->Count() + 1;
+ gEpocEnv->iArgv = (char**) User::AllocL(sizeof(char*) * (gEpocEnv->iArgc + 1));
+
+ TInt k = 0;
+ const TFileName processName = RProcess().FileName();
+ const TInt len = processName.Length();
+ gEpocEnv->iArgv[k] = (char*) User::AllocL(len + 1);
+ Mem::Copy(gEpocEnv->iArgv[k], processName.Ptr(), len);
+ gEpocEnv->iArgv[k][len] = 0;
+
+ for(TInt i = 0; args && (i < aArg->Count()); i++)
+ {
+ k++;
+ const TInt len = aArg->MdcaPoint(i).Length();
+ gEpocEnv->iArgv[k] = (char*) User::AllocL(len + 1);
+ Mem::Copy(gEpocEnv->iArgv[k], aArg->MdcaPoint(i).Ptr(), len);
+ gEpocEnv->iArgv[k][len] = 0;
+ }
+
+ gEpocEnv->iArgv[gEpocEnv->iArgc] = NULL;
+
+ RThread thread;
+ User::LeaveIfError(thread.Create(KSDLMain, DoMain, aStackSize, NULL, NULL));
+
+ if(aStatus != NULL)
+ {
+ thread.Logon(*aStatus);
+ }
+
+ gEpocEnv->iId = thread.Id();
+ thread.SetPriority(EPriorityLess);
+ if((aFlags & CSDL::ERequestResume) == 0)
+ {
+ thread.Resume();
+ }
+ thread.Close();
+ return gEpocEnv->iId;
+ }
+
+EXPORT_C TInt CSDL::AppendWsEvent(const TWsEvent& aEvent)
+ {
+ return EpocSdlEnv::EventQueue().Append(aEvent);
+ }
+
+EXPORT_C void CSDL::SDLPanic(const TDesC& aInfo, TInt aErr)
+ {
+ EpocSdlEnv::PanicMain(aInfo, aErr);
+ }
+
+EXPORT_C TInt CSDL::GetSDLCode(TInt aScanCode)
+ {
+ if(aScanCode < 0)
+ return MAX_SCANCODE;
+ if(aScanCode >= MAX_SCANCODE)
+ return -1;
+ return KeyMap()[aScanCode];
+ }
+
+EXPORT_C TInt CSDL::SDLCodesCount() const
+ {
+ return MAX_SCANCODE;
+ }
+
+EXPORT_C void CSDL::ResetSDLCodes()
+ {
+ ResetKeyMap();
+ }
+
+EXPORT_C void CSDL::SetOrientation(TOrientationMode aMode)
+ {
+ gEpocEnv->iDsa->SetOrientation(aMode);
+ }
+
+EXPORT_C TInt CSDL::SetSDLCode(TInt aScanCode, TInt aSDLCode)
+ {
+ const TInt current = GetSDLCode(aScanCode);
+ if(aScanCode >= 0 && aScanCode < MAX_SCANCODE)
+ KeyMap()[aScanCode] = static_cast<SDLKey>(aSDLCode);
+ return current;
+ }
+
+
+EXPORT_C MSDLObserver* CSDL::Observer()
+ {
+ return gEpocEnv->iAppSrv->Observer();
+ }
+
+EXPORT_C void CSDL::SetObserver(MSDLObserver* aObserver)
+ {
+ gEpocEnv->iAppSrv->SetObserver(aObserver);
+ }
+
+EXPORT_C void CSDL::Resume()
+ {
+ EpocSdlEnv::Resume();
+ }
+
+EXPORT_C void CSDL::Suspend()
+ {
+ gEpocEnv->iDsa->DoStop();
+ }
+
+EXPORT_C CSDL::CSDL()
+ {
+ }
+
+EXPORT_C void CSDL::DisableKeyBlocking(CAknAppUi& aAppUi) const
+ {
+ gEpocEnv->iAppUi = &aAppUi;
+ EnvUtils::DisableKeyBlocking();
+ }
+
+EXPORT_C TInt CSDL::SetBlitter(MBlitter* aBlitter)
+ {
+ if(gEpocEnv && gEpocEnv->iDsa)
+ {
+ gEpocEnv->iDsa->SetBlitter(aBlitter);
+ return KErrNone;
+ }
+ return KErrNotReady;
+ }
+
+
+EXPORT_C TInt CSDL::AppendOverlay(MOverlay& aOverlay, TInt aPriority)
+ {
+ if(gEpocEnv && gEpocEnv->iDsa)
+ {
+ return gEpocEnv->iDsa->AppendOverlay(aOverlay, aPriority);
+ }
+ return KErrNotReady;
+ }
+
+EXPORT_C TInt CSDL::RemoveOverlay(MOverlay& aOverlay)
+ {
+ if(gEpocEnv && gEpocEnv->iDsa)
+ {
+ return gEpocEnv->iDsa->RemoveOverlay(aOverlay);
+ }
+ return KErrNotReady;
+ }
+
+EXPORT_C TInt CSDL::RedrawRequest()
+ {
+ if(gEpocEnv && gEpocEnv->iDsa)
+ {
+ return gEpocEnv->iDsa->RedrawRequest();
+ }
+ return KErrNotReady;
+ }
+
+/*
+EXPORT_C CSDL* CSDL::Current()
+ {
+ return gEpocEnv != NULL ? gEpocEnv->iSdl : NULL;
+ }
+
+
+EXPORT_C TInt CSDL::SetVolume(TInt aVolume)
+ {
+ return EpocSdlEnv::SetVolume(aVolume);
+ }
+
+EXPORT_C TInt CSDL::Volume() const
+ {
+ return EpocSdlEnv::Volume();
+ }
+
+EXPORT_C TInt CSDL::MaxVolume() const
+ {
+ return EpocSdlEnv::MaxVolume();
+ }
+*/
+
+void EnvUtils::DisableKeyBlocking()
+ {
+ if(gEpocEnv->iAppUi != NULL)
+ return CCurrentAppUi::Cast(gEpocEnv->iAppUi)->DisableKeyBlocking();
+ }
+
+TBool EnvUtils::Rendezvous(RThread& aThread, TRequestStatus& aStatus)
+ {
+ if(gEpocEnv->iId != TThreadId(0) &&
+ aThread.Open(gEpocEnv->iId) &&
+ aThread.ExitType() == EExitPending)
+ {
+ aThread.Rendezvous(aStatus);
+ return ETrue;
+ }
+ return EFalse;
+ }
+
+
+
diff --git a/distrib/sdl-1.2.15/src/main/symbian/EKA2/sdlexe.cpp b/distrib/sdl-1.2.15/src/main/symbian/EKA2/sdlexe.cpp
new file mode 100644
index 0000000..bb160c4
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/main/symbian/EKA2/sdlexe.cpp
@@ -0,0 +1,809 @@
+// INCLUDES
+#include <aknapp.h>
+#include <aknappui.h>
+#include <eikdoc.h>
+#include <sdlepocapi.h>
+#include <bautils.h>
+#include <eikstart.h>
+#include <badesca.h>
+#include <bautils.h>
+#include <apgcli.h>
+#include <sdlmain.h>
+#include <eikedwin.h>
+#include <eiklabel.h>
+#include <sdlexe.rsg>
+#include <aknglobalmsgquery.h>
+#include <apgwgnam.h>
+
+
+
+// FORWARD DECLARATIONS
+class CApaDocument;
+
+
+//const TUid KSDLUID = { 0xF01F605E };
+
+LOCAL_C void MakeCCmdLineL(const TDesC8& aParam, CDesC8Array& aArray)
+ {
+
+ const TChar dq('\"');
+
+ TLex8 lex(aParam);
+ TBool in = EFalse;
+
+ lex.SkipSpaceAndMark();
+
+ while(!lex.Eos())
+ {
+ TPtrC8 ptr;
+ if(in)
+ {
+ const TPtrC8 rem = lex.RemainderFromMark();
+ const TInt pos = rem.Locate(dq);
+ if(pos > 0)
+ {
+ lex.Inc(pos);
+ ptr.Set(lex.MarkedToken());
+ lex.SkipAndMark(1);
+ }
+ else
+ {
+ ptr.Set(rem);
+ }
+ in = EFalse;
+ }
+ else
+ {
+ ptr.Set(lex.NextToken());
+ const TInt pos = ptr.Locate(dq);
+ if(pos == 0)
+ {
+ lex.UnGetToMark();
+ lex.SkipAndMark(1);
+ in = ETrue;
+ continue; // back to in brace
+ }
+ else
+ lex.SkipSpaceAndMark();
+ }
+
+ aArray.AppendL(ptr);
+
+ }
+ }
+
+NONSHARABLE_CLASS(TVirtualCursor) : public MOverlay
+ {
+ public:
+ TVirtualCursor();
+ void Set(const TRect& aRect, CFbsBitmap* aBmp, CFbsBitmap* aAlpha);
+ void Move(TInt aX, TInt aY);
+ void MakeEvent(TWsEvent& aEvent, const TPoint& aBasePos) const;
+ void Toggle();
+ TBool IsOn() const;
+ private:
+ void Draw(CBitmapContext& aGc, const TRect& aTargetRect, const TSize& aSize);
+ private:
+ TRect iRect;
+ TPoint iInc;
+ TPoint iPos;
+ TBool iIsOn;
+ CFbsBitmap* iCBmp;
+ CFbsBitmap* iAlpha;
+ };
+
+
+TVirtualCursor::TVirtualCursor() : iInc(0, 0), iIsOn(EFalse), iCBmp(NULL)
+ {
+ }
+
+const TInt KMaxMove = 10;
+
+void TVirtualCursor::Move(TInt aX, TInt aY)
+ {
+ if(aX > 0 && iInc.iX > 0)
+ ++iInc.iX;
+ else if(aX < 0 && iInc.iX < 0)
+ --iInc.iX;
+ else
+ iInc.iX = aX;
+
+ if(aY > 0 && iInc.iY > 0)
+ ++iInc.iY;
+ else if(aY < 0 && iInc.iY < 0)
+ --iInc.iY;
+ else
+ iInc.iY = aY;
+
+ iInc.iX = Min(KMaxMove, iInc.iX);
+
+ iInc.iX = Max(-KMaxMove, iInc.iX);
+
+ iInc.iY = Min(KMaxMove, iInc.iY);
+
+ iInc.iY =Max(-KMaxMove, iInc.iY);
+
+ const TPoint pos = iPos + iInc;
+ if(iRect.Contains(pos))
+ {
+ iPos = pos;
+ }
+ else
+ {
+ iInc = TPoint(0, 0);
+ }
+ }
+
+
+void TVirtualCursor::Toggle()
+ {
+ iIsOn = !iIsOn;
+ }
+
+
+TBool TVirtualCursor::IsOn() const
+ {
+ return iIsOn;
+ }
+
+void TVirtualCursor::Set(const TRect& aRect, CFbsBitmap* aBmp, CFbsBitmap* aAlpha)
+ {
+ iRect = aRect;
+ iCBmp = aBmp;
+ iAlpha = aAlpha;
+ }
+
+
+void TVirtualCursor::MakeEvent(TWsEvent& aEvent, const TPoint& aBasePos) const
+ {
+ aEvent.SetType(EEventPointer),
+ aEvent.SetTimeNow();
+ TPointerEvent& pointer = *aEvent.Pointer();
+ pointer.iType = TPointerEvent::EButton1Down;
+ pointer.iPosition = iPos;
+ pointer.iParentPosition = aBasePos;
+ }
+
+
+void TVirtualCursor::Draw(CBitmapContext& aGc, const TRect& /*aTargetRect*/, const TSize& /*aSize*/)
+ {
+ if(iIsOn && iCBmp != NULL)
+ {
+ const TRect rect(TPoint(0, 0), iCBmp->SizeInPixels());
+ aGc.AlphaBlendBitmaps(iPos, iCBmp, rect, iAlpha, TPoint(0, 0));
+ }
+
+ }
+
+NONSHARABLE_CLASS(TSdlClass)
+ {
+ public:
+ TSdlClass();
+ void SetMain(const TMainFunc& aFunc, TInt aFlags, MSDLMainObs* aObs, TInt aExeFlags);
+ TInt SdlFlags() const;
+ const TMainFunc& Main() const;
+ void SendEvent(TInt aEvent, TInt aParam, CSDL* aSDL);
+ TInt AppFlags() const;
+ void AppFlags(TInt aFlags);
+ private:
+ TMainFunc iFunc;
+ TInt iSdlFlags;
+ TInt iExeFlags;
+ MSDLMainObs* iObs;
+ };
+
+
+void TSdlClass::AppFlags(TInt aFlags)
+ {
+ iExeFlags |= aFlags;
+ }
+
+void TSdlClass::SendEvent(TInt aEvent, TInt aParam, CSDL* aSDL)
+ {
+ if(iObs != NULL)
+ iObs->SDLMainEvent(aEvent, aParam, aSDL);
+ }
+
+TInt TSdlClass::AppFlags() const
+ {
+ return iExeFlags;
+ }
+
+void TSdlClass::SetMain(const TMainFunc& aFunc, TInt aFlags, MSDLMainObs* aObs, TInt aExeFlags)
+ {
+ iFunc = aFunc;
+ iSdlFlags = aFlags;
+ iExeFlags = aExeFlags;
+ iObs = aObs;
+ }
+
+const TMainFunc& TSdlClass::Main() const
+ {
+ return iFunc;
+ }
+
+
+ TInt TSdlClass::SdlFlags() const
+ {
+ return iSdlFlags;
+ }
+
+
+
+TSdlClass::TSdlClass()
+ {
+ Mem::FillZ(this, sizeof(this));
+ }
+
+TSdlClass gSDLClass;
+
+
+////////////////////////////////////////////////////////////////
+
+NONSHARABLE_CLASS(CSDLApplication) : public CAknApplication
+ {
+ public:
+ CSDLApplication();
+ private:
+ CApaDocument* CreateDocumentL();
+ TFileName ResourceFileName() const;
+ TUid AppDllUid() const;
+ void FindMeL();
+ TUid iUid;
+ };
+
+NONSHARABLE_CLASS(CSDLDocument) : public CEikDocument
+ {
+ public:
+ CSDLDocument(CEikApplication& aApp);
+ private:
+ CEikAppUi* CreateAppUiL();
+
+ };
+
+ ////////////////////////////////////////////////////////////////////
+
+
+NONSHARABLE_CLASS(MExitWait)
+ {
+ public:
+ virtual void DoExit(TInt aErr) = 0;
+ };
+
+/////////////////////////////////////////////////////////////////////////
+
+NONSHARABLE_CLASS(CExitWait) : public CActive
+ {
+ public:
+ CExitWait(MExitWait& aWait);
+ ~CExitWait();
+ private:
+ void RunL();
+ void DoCancel();
+ private:
+ MExitWait& iWait;
+ TRequestStatus* iStatusPtr;
+ };
+
+////////////////////////////////////////////////////////////////////////
+
+
+NONSHARABLE_CLASS(CSDLWin) : public CCoeControl
+ {
+ public:
+ void ConstructL(const TRect& aRect);
+ RWindow& GetWindow() const;
+ void SetNoDraw();
+ private:
+ void Draw(const TRect& aRect) const;
+ private:
+ TBool iNoDraw;
+ };
+
+
+////////////////////////////////////////////////////////////////////////////
+
+NONSHARABLE_CLASS(CSDLAppUi) : public CAknAppUi, public MExitWait, MSDLObserver
+ {
+ public:
+ ~CSDLAppUi();
+ private: // New functions
+ void ConstructL();
+ void HandleCommandL(TInt aCommand);
+ void HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination);
+ void HandleResourceChangeL(TInt aType);
+
+ void DoExit(TInt aErr);
+
+ TInt SdlEvent(TInt aEvent, TInt aParam);
+ TInt SdlThreadEvent(TInt aEvent, TInt aParam);
+
+ void StartL();
+ static TBool StartL(TAny* aThis);
+
+ TBool ParamEditorL(TDes& aCheat);
+
+ TBool ProcessCommandParametersL(CApaCommandLine &aCommandLine);
+
+ void PrepareToExit();
+ void HandleConsoleWindowL();
+ void HandleConsoleWindow();
+ void HandleForegroundEventL(TBool aForeground);
+
+ static TBool IdleRequestL(TAny* aThis);
+
+ TBool HandleKeyL(const TWsEvent& aEvent);
+
+
+ private:
+ CExitWait* iWait;
+ CSDLWin* iSDLWin;
+ CSDL* iSdl;
+ CIdle* iStarter;
+ TBool iExitRequest;
+ CDesC8Array* iParams;
+ TInt iResOffset;
+ CIdle* iIdle;
+ TInt iStdOut;
+ TVirtualCursor iCursor;
+ CFbsBitmap* iCBmp;
+ CFbsBitmap* iAlpha;
+ // TTime iLastPress;
+ // CSDL::TOrientationMode iOrientation;
+ };
+
+////////////////////////////////////////////////////////////////////////////////////////7
+
+CApaDocument* CSDLApplication::CreateDocumentL()
+ {
+ return new (ELeave) CSDLDocument(*this);
+ }
+
+TUid CSDLApplication::AppDllUid() const
+ {
+ return iUid;
+ }
+
+
+CSDLApplication::CSDLApplication()
+ {
+ TRAPD(err, FindMeL());
+ ASSERT(err == KErrNone);
+ }
+
+void CSDLApplication::FindMeL()
+ {
+ RApaLsSession apa;
+ User::LeaveIfError(apa.Connect());
+ CleanupClosePushL(apa);
+ User::LeaveIfError(apa.GetAllApps());
+ TFileName name = RProcess().FileName();
+ TApaAppInfo info;
+ while(apa.GetNextApp(info) == KErrNone)
+ {
+ if(info.iFullName.CompareF(name) == 0)
+ {
+ iUid = info.iUid;
+ break;
+ }
+ }
+ CleanupStack::PopAndDestroy();
+ }
+
+TFileName CSDLApplication::ResourceFileName() const
+ {
+ return KNullDesC();
+ }
+
+///////////////////////////////////////////////////////////////////////////////////////////
+
+CExitWait::CExitWait(MExitWait& aWait) : CActive(CActive::EPriorityStandard), iWait(aWait)
+ {
+ CActiveScheduler::Add(this);
+ SetActive();
+ iStatusPtr = &iStatus;
+ }
+
+CExitWait::~CExitWait()
+ {
+ Cancel();
+ }
+
+void CExitWait::RunL()
+ {
+ if(iStatusPtr != NULL )
+ iWait.DoExit(iStatus.Int());
+ }
+
+void CExitWait::DoCancel()
+ {
+ if(iStatusPtr != NULL )
+ User::RequestComplete(iStatusPtr , KErrCancel);
+ }
+
+
+//////////////////////////////////////////////////////////////////////////////////////////////
+
+CSDLDocument::CSDLDocument(CEikApplication& aApp) : CEikDocument(aApp)
+ {}
+
+CEikAppUi* CSDLDocument::CreateAppUiL()
+ {
+ return new (ELeave) CSDLAppUi;
+ }
+
+///////////////////////////////////////////////////////////////////////////
+
+void CSDLWin:: ConstructL(const TRect& aRect)
+ {
+ CreateWindowL();
+ SetRect(aRect);
+ ActivateL();
+ }
+
+
+RWindow& CSDLWin::GetWindow() const
+ {
+ return Window();
+ }
+
+
+void CSDLWin::Draw(const TRect& /*aRect*/) const
+ {
+ if(!iNoDraw)
+ {
+ CWindowGc& gc = SystemGc();
+ gc.SetPenStyle(CGraphicsContext::ESolidPen);
+ gc.SetPenColor(KRgbGray);
+ gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
+ gc.SetBrushColor(0xaaaaaa);
+ gc.DrawRect(Rect());
+ }
+ }
+
+void CSDLWin::SetNoDraw()
+ {
+ iNoDraw = ETrue;
+ }
+
+/////////////////////////////////////////////////////////////////////////
+
+CSDLAppUi::~CSDLAppUi()
+ {
+ if(iIdle)
+ iIdle->Cancel();
+ delete iIdle;
+ if(iStarter != NULL)
+ iStarter->Cancel();
+ delete iStarter;
+ delete iWait;
+ delete iSdl;
+ delete iSDLWin;
+ delete iParams;
+ delete iCBmp;
+ delete iAlpha;
+ }
+
+
+void CSDLAppUi::ConstructL()
+ {
+ BaseConstructL(ENoAppResourceFile | ENoScreenFurniture);
+
+
+ RLibrary lib;
+ User::LeaveIfError(lib.Load(_L("sdlexe.dll")));
+ TFileName name = lib.FileName();
+ lib.Close();
+ name.Replace(3, name.Length() - 3, _L("resource\\apps\\sdlexe.rsc"));
+ BaflUtils::NearestLanguageFile(iEikonEnv->FsSession(), name);
+ iResOffset = iCoeEnv->AddResourceFileL(name);
+
+ name.Replace(name.Length() - 3, 3, _L("mbm"));
+
+ TEntry e;
+ const TInt err = iEikonEnv->FsSession().Entry(name, e);
+
+ iCBmp = iEikonEnv->CreateBitmapL(name, 0);
+ iAlpha = iEikonEnv->CreateBitmapL(name, 1);
+
+ iIdle = CIdle::NewL(CActive::EPriorityIdle);
+
+ iSDLWin = new (ELeave) CSDLWin;
+ iSDLWin->ConstructL(ApplicationRect());
+
+ iSdl = CSDL::NewL(gSDLClass.SdlFlags());
+
+ gSDLClass.SendEvent(MSDLMainObs::ESDLCreated, 0, iSdl);
+
+ iSdl->SetObserver(this);
+ iSdl->DisableKeyBlocking(*this);
+ iSdl->SetContainerWindowL(
+ iSDLWin->GetWindow(),
+ iEikonEnv->WsSession(),
+ *iEikonEnv->ScreenDevice());
+ iSdl->AppendOverlay(iCursor, 0);
+
+ iCursor.Set(TRect(TPoint(0, 0), iSDLWin->Size()), iCBmp, iAlpha);
+
+ iStarter = CIdle::NewL(CActive::EPriorityLow);
+ iStarter->Start(TCallBack(StartL, this));
+
+
+ }
+
+
+
+TBool CSDLAppUi::StartL(TAny* aThis)
+ {
+ static_cast<CSDLAppUi*>(aThis)->StartL();
+ return EFalse;
+ }
+
+
+void CSDLAppUi::PrepareToExit()
+ {
+ CAknAppUiBase::PrepareToExit(); //aknappu::PrepareToExit crashes
+ iCoeEnv->DeleteResourceFile(iResOffset);
+ }
+
+TBool CSDLAppUi::ProcessCommandParametersL(CApaCommandLine &aCommandLine)
+ {
+ const TPtrC8 cmdLine = aCommandLine.TailEnd();
+ iParams = new (ELeave) CDesC8ArrayFlat(8);
+ MakeCCmdLineL(cmdLine, *iParams);
+ return EFalse;
+ }
+
+
+ TBool CSDLAppUi::ParamEditorL(TDes& aCheat)
+ {
+ CAknTextQueryDialog* query = CAknTextQueryDialog::NewL(aCheat);
+ CleanupStack::PushL(query);
+ query->SetPromptL(_L("Enter parameters"));
+ CleanupStack::Pop();
+ return query->ExecuteLD(R_PARAMEDITOR);
+ }
+
+ void CSDLAppUi::StartL()
+ {
+ if(gSDLClass.AppFlags() & SDLEnv::EParamQuery)
+ {
+ TBuf8<256> cmd;
+ RFile file;
+ TInt err = file.Open(iEikonEnv->FsSession(), _L("sdl_param.txt"),EFileRead);
+ if(err == KErrNone)
+ {
+ file.Read(cmd);
+ file.Close();
+ MakeCCmdLineL(cmd, *iParams);
+ }
+ if(err != KErrNone || gSDLClass.AppFlags() & (SDLEnv::EParamQueryDialog ^ SDLEnv::EParamQuery))
+ {
+ TBuf<256> buffer;
+ if(ParamEditorL(buffer))
+ {
+ cmd.Copy(buffer);
+ MakeCCmdLineL(cmd, *iParams);
+ }
+ }
+ }
+ iWait = new (ELeave) CExitWait(*this);
+ iSdl->CallMainL(gSDLClass.Main(), &iWait->iStatus, iParams, CSDL::ENoParamFlags, 0xA000);
+ }
+
+void CSDLAppUi::HandleCommandL(TInt aCommand)
+ {
+ switch(aCommand)
+ {
+ case EAknSoftkeyBack:
+ case EAknSoftkeyExit:
+ case EAknCmdExit:
+ case EEikCmdExit:
+ gSDLClass.AppFlags(SDLEnv::EAllowConsoleView);
+ if(iWait == NULL || !iWait->IsActive() || iSdl == NULL)
+ {
+ Exit();
+ }
+ else if(!iExitRequest)
+ {
+ iExitRequest = ETrue; //trick how SDL can be closed!
+ iSdl->Suspend();
+ }
+ break;
+ }
+ }
+
+
+
+TBool CSDLAppUi::HandleKeyL(const TWsEvent& aEvent)
+ {
+ const TInt type = aEvent.Type();
+ if(!(type == EEventKey || type == EEventKeyUp || type == EEventKeyDown))
+ {
+ return ETrue;
+ }
+ const TKeyEvent& key = *aEvent.Key();
+ if((key.iScanCode == EStdKeyYes) && (gSDLClass.AppFlags() & SDLEnv::EVirtualMouse))
+ {
+ if(type == EEventKeyUp)
+ {
+ iCursor.Toggle();
+ iSdl->RedrawRequest();
+ }
+ return EFalse;
+ }
+ if(iCursor.IsOn())
+ {
+ switch(key.iScanCode)
+ {
+ case EStdKeyUpArrow:
+ iCursor.Move(0, -1);
+ break;
+ case EStdKeyDownArrow:
+ iCursor.Move(0, 1);
+ break;
+ case EStdKeyLeftArrow:
+ iCursor.Move(-1, 0);
+ break;
+ case EStdKeyRightArrow:
+ iCursor.Move(1, 0);
+ break;
+ case EStdKeyDevice3:
+ if(type == EEventKeyUp)
+ {
+ TWsEvent event;
+ iCursor.MakeEvent(event, iSDLWin->Position());
+ iSdl->AppendWsEvent(event);
+ }
+ return EFalse;
+ default:
+ return ETrue;
+ }
+ iSdl->RedrawRequest();
+ return EFalse;
+ }
+ return ETrue;
+ }
+
+ void CSDLAppUi::HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination)
+ {
+ if(iSdl && iWait && HandleKeyL(aEvent))
+ iSdl->AppendWsEvent(aEvent);
+ CAknAppUi::HandleWsEventL(aEvent, aDestination);
+ }
+
+ void CSDLAppUi::HandleResourceChangeL(TInt aType)
+ {
+ CAknAppUi::HandleResourceChangeL(aType);
+ if(aType == KEikDynamicLayoutVariantSwitch)
+ {
+ iSDLWin->SetRect(ApplicationRect());
+ iSdl->SetContainerWindowL(
+ iSDLWin->GetWindow(),
+ iEikonEnv->WsSession(),
+ *iEikonEnv->ScreenDevice());
+ }
+ }
+
+
+void CSDLAppUi::DoExit(TInt/*Err*/)
+ {
+ iExitRequest = ETrue;
+ Exit();
+ }
+
+
+ TInt CSDLAppUi::SdlThreadEvent(TInt aEvent, TInt /*aParam*/)
+ {
+ switch(aEvent)
+ {
+ case MSDLObserver::EEventResume:
+ break;
+ case MSDLObserver::EEventSuspend:
+ if(iExitRequest)
+ return MSDLObserver::ESuspendNoSuspend;
+ break;
+ case MSDLObserver::EEventWindowReserved:
+ break;
+ case MSDLObserver::EEventWindowNotAvailable:
+ break;
+ case MSDLObserver::EEventScreenSizeChanged:
+ break;
+ }
+ return MSDLObserver::EParameterNone;
+ }
+
+TInt CSDLAppUi::SdlEvent(TInt aEvent, TInt /*aParam*/)
+ {
+ switch(aEvent)
+ {
+ case MSDLObserver::EEventResume:
+ break;
+ case MSDLObserver::EEventSuspend:
+ if(iExitRequest)
+ return MSDLObserver::ESuspendNoSuspend;
+ break;
+ case MSDLObserver::EEventWindowReserved:
+ break;
+ case MSDLObserver::EEventWindowNotAvailable:
+ {
+ TRAP_IGNORE(HandleConsoleWindowL());
+ }
+ break;
+ case MSDLObserver::EEventScreenSizeChanged:
+ break;
+ case MSDLObserver::EEventKeyMapInit:
+ break;
+ case MSDLObserver::EEventMainExit:
+ if(iStdOut != 0)
+ {
+ gSDLClass.AppFlags(SDLEnv::EAllowConsoleView);
+ iEikonEnv->WsSession().SetWindowGroupOrdinalPosition(iStdOut, 0);
+ }
+ break;
+ }
+ return MSDLObserver::EParameterNone;
+ }
+
+void CSDLAppUi::HandleForegroundEventL(TBool aForeground)
+ {
+ CAknAppUi::HandleForegroundEventL(aForeground);
+ if(!aForeground)
+ HandleConsoleWindow();
+ }
+
+void CSDLAppUi::HandleConsoleWindow()
+ {
+ if(!iIdle->IsActive())
+ iIdle->Start(TCallBack(IdleRequestL, this));
+ }
+
+TBool CSDLAppUi::IdleRequestL(TAny* aThis)
+ {
+ static_cast<CSDLAppUi*>(aThis)->HandleConsoleWindowL();
+ return EFalse;
+ }
+
+void CSDLAppUi::HandleConsoleWindowL()
+ {
+ if(gSDLClass.AppFlags() & SDLEnv::EAllowConsoleView)
+ {
+ return;
+ }
+ RWsSession& ses = iEikonEnv->WsSession();
+ const TInt focus = ses.GetFocusWindowGroup();
+ CApaWindowGroupName* name = CApaWindowGroupName::NewLC(ses, focus);
+ const TPtrC caption = name->Caption();
+ if(0 == caption.CompareF(_L("STDOUT")))
+ {
+ iStdOut = focus;
+ ses.SetWindowGroupOrdinalPosition(iEikonEnv->RootWin().Identifier(), 0);
+ }
+ CleanupStack::PopAndDestroy(); //name
+ }
+
+
+////////////////////////////////////////////////////////////////////////
+
+
+CApaApplication* NewApplication()
+ {
+ return new CSDLApplication();
+ }
+
+
+EXPORT_C TInt SDLEnv::SetMain(const TMainFunc& aFunc, TInt aSdlFlags, MSDLMainObs* aObs, TInt aSdlExeFlags)
+ {
+ gSDLClass.SetMain(aFunc, aSdlFlags, aObs, aSdlExeFlags);
+ return EikStart::RunApplication(NewApplication);
+ }
+
+//////////////////////////////////////////////////////////////////////
+
+TInt SDLUiPrint(const TDesC8& /*aInfo*/)
+ {
+ return KErrNotFound;
+ }
+
+
+
diff --git a/distrib/sdl-1.2.15/src/main/symbian/EKA2/sdllib.cpp b/distrib/sdl-1.2.15/src/main/symbian/EKA2/sdllib.cpp
new file mode 100644
index 0000000..7c09996
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/main/symbian/EKA2/sdllib.cpp
@@ -0,0 +1,12 @@
+#include<eikstart.h>
+#include<sdlmain.h>
+#include<sdlepocapi.h>
+
+
+GLREF_C TInt E32Main()
+ {
+ return SDLEnv::SetMain(SDL_main, CSDL::EEnableFocusStop | CSDL::EAllowImageResize,
+ NULL, SDLEnv::EParamQuery | SDLEnv::EVirtualMouse);
+ }
+
+ \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/src/main/symbian/EKA2/vectorbuffer.cpp b/distrib/sdl-1.2.15/src/main/symbian/EKA2/vectorbuffer.cpp
new file mode 100644
index 0000000..72c3b3e
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/main/symbian/EKA2/vectorbuffer.cpp
@@ -0,0 +1,62 @@
+/*
+ vectorbuffer.cpp
+ yet another circle buffer
+
+ Markus Mertama
+*/
+
+#include"vectorbuffer.h"
+
+
+
+void VectorPanic(TInt aErr, TInt aLine)
+ {
+ TBuf<64> b;
+ b.Format(_L("vector buffer at % d "), aLine);
+ User::Panic(b, aErr);
+ }
+
+void TNodeBuffer::TNode::Terminator(TNodeBuffer::TNode* aNode)
+ {
+ Mem::Copy(iSucc, &aNode, sizeof(TNode*));
+ }
+
+TInt TNodeBuffer::TNode::Size() const
+ {
+ return reinterpret_cast<const TUint8*>(iSucc) - Ptr();
+ }
+
+const TUint8* TNodeBuffer::TNode::Ptr() const
+ {
+ return reinterpret_cast<const TUint8*>(this) + sizeof(TNode);
+ }
+
+TNodeBuffer::TNode* TNodeBuffer::TNode::Empty(TUint8* aBuffer)
+ {
+ TNode* node = reinterpret_cast<TNode*>(aBuffer);
+ node->iSucc = node + 1;
+ return node;
+ }
+
+ TNodeBuffer::TNode* TNodeBuffer::TNode::New(TNode* aPred, const TDesC8& aData)
+ {
+ TNode* node = aPred->Size() == 0 ? aPred : aPred->iSucc;
+
+
+ TUint8* start = reinterpret_cast<TUint8*>(node) + sizeof(TNode);
+ node->iSucc = reinterpret_cast<TNode*>(start + aData.Size());
+ node->iSucc->iSucc = NULL; //terminator
+
+ __ASSERT_DEBUG(node->Size() == aData.Size(), VECPANIC(KErrCorrupt));
+
+ Mem::Copy(start, aData.Ptr(), aData.Size());
+ return node;
+ }
+
+
+
+
+
+
+
+ \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/src/main/symbian/EKA2/vectorbuffer.h b/distrib/sdl-1.2.15/src/main/symbian/EKA2/vectorbuffer.h
new file mode 100644
index 0000000..3d8be58
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/main/symbian/EKA2/vectorbuffer.h
@@ -0,0 +1,240 @@
+/*
+ vectorbuffer.cpp
+ yet another circle buffer
+
+ Markus Mertama
+*/
+
+#ifndef __VECTORBUFFER_H__
+#define __VECTORBUFFER_H__
+
+#include<e32std.h>
+#define VLOG(x)
+#define VECPANIC(x) VectorPanic(x, __LINE__)
+void VectorPanic(TInt, TInt);
+
+
+//int DEBUG_INT;
+
+NONSHARABLE_CLASS(TNodeBuffer)
+ {
+ public:
+ protected:
+ NONSHARABLE_CLASS(TNode)
+ {
+ public:
+ static TNode* Empty(TUint8* iBuffer);
+ static TNode* New(TNode* aPrev, const TDesC8& aData);
+ const TUint8* Ptr() const;
+ TInt Size() const;
+ inline TNode* Succ();
+ static void SetSucc(TNode*& aNode);
+ void Terminator(TNode* aNode);
+ private:
+ TNode* iSucc;
+ };
+ };
+
+inline TNodeBuffer::TNode* TNodeBuffer::TNode::Succ()
+ {
+ return iSucc;
+ }
+
+template <TInt C>
+NONSHARABLE_CLASS(TVectorBuffer) : public TNodeBuffer
+ {
+ public:
+ TVectorBuffer();
+ TInt Append(const TDesC8& aData);
+ // TInt AppendOverwrite(const TDesC8& aData);
+ TPtrC8 Shift();
+ TPtrC8 operator[](TInt aIndex) const;
+ TInt Size() const;
+ private:
+ TInt GetRoom(TInt aSize) const;
+ TInt Unreserved() const;
+ private:
+ TNode* iTop;
+ TNode* iBottom;
+ TInt iSize;
+ TUint8 iBuffer[C];
+ };
+
+template <TInt C>
+TVectorBuffer<C>::TVectorBuffer() : iSize(0)
+ {
+ Mem::FillZ(iBuffer, C);
+ iTop = TNode::Empty(iBuffer); //these points to buffer
+ iBottom = TNode::Empty(iBuffer);
+ }
+
+template<TInt C >
+TInt TVectorBuffer<C>::Unreserved() const
+ {
+ __ASSERT_DEBUG(iBottom < iBottom->Succ(), VECPANIC(KErrCorrupt));
+ const TInt bytesbetween =
+ reinterpret_cast<const TUint8*>(iBottom->Succ()) -
+ reinterpret_cast<const TUint8*>(iTop);
+ const TInt topsize = sizeof(TNode);
+ if(bytesbetween > 0) //bytesbetween is room between bottom and top
+ { //therefore free room is subracted from free space
+
+ const TInt room = C - bytesbetween - topsize;
+ return room;
+ }
+ if(bytesbetween == 0)
+ {
+
+ if(Size() > 0)
+ return 0;
+ else
+ return C - topsize;
+ }
+ const TInt room = -bytesbetween - topsize; //free is space between pointers
+ return room;
+ }
+
+template <TInt C>
+TInt TVectorBuffer<C>::GetRoom(TInt aSize) const
+ {
+ const TInt bytesnew = sizeof(TNode) + aSize;
+ const TInt room = Unreserved() - bytesnew;
+ return room;
+ }
+
+template <TInt C>
+TInt TVectorBuffer<C>::Append(const TDesC8& aData) //ei ole ok!
+ {
+ const TInt len = aData.Length();
+ if(GetRoom(len) < 0)
+ {
+ return KErrOverflow;
+ }
+ if(iBottom->Succ()->Ptr() - iBuffer > (C - (len + TInt(sizeof(TNode)))))
+ {
+ VLOG("rc");
+ // RDebug::Print(_L("vector: append"));
+ TNode* p = TNode::Empty(iBuffer);
+ iBottom->Terminator(p);
+ iBottom = p;
+ return Append(aData);
+ // Append();
+ // iBottom = TNode::New(p, aData); //just append something into end
+ }
+
+ //DEBUG_INT++;
+
+ iBottom = TNode::New(iBottom, aData);
+
+ iSize += len;
+ return KErrNone;
+ }
+
+/*
+template <TInt C>
+TInt TVectorBuffer<C>::AppendOverwrite(const TDesC8& aData) //ei ole ok!
+ {
+ while(Append(aData) == KErrOverflow)
+ {
+ if(iTop->Succ() == NULL)
+ {
+ return KErrUnderflow;
+ }
+ //Shift(); //data is lost
+ }
+ return KErrNone;
+ }
+*/
+template <TInt C>
+TPtrC8 TVectorBuffer<C>::Shift()
+ {
+ __ASSERT_ALWAYS(iTop->Succ() != NULL, VECPANIC(KErrUnderflow)); //can never pass-by bottom
+ TNode* node = iTop;
+ iTop = iTop->Succ();
+ if(iTop > node)
+ {
+ // DEBUG_INT--;
+ iSize -= node->Size();
+ return TPtrC8(node->Ptr(), node->Size());
+ }
+ else
+ {
+ // RDebug::Print(_L("vector: shift"));
+ return Shift(); //this happens when buffer is terminated, and data lies in next
+ }
+ }
+
+template <TInt C>
+TInt TVectorBuffer<C>::Size() const
+ {
+ return iSize;
+ }
+
+template <TInt C>
+TPtrC8 TVectorBuffer<C>::operator[](TInt aIndex) const
+ {
+ TInt index = 0;
+ TNode* t = iTop->Size() > 0 ? iTop : iTop->Succ(); //eliminate terminator
+ while(index < aIndex)
+ {
+ TNode* nt = t->Succ();
+ if(nt < t)
+ {
+ nt = nt->Succ();
+ }
+ t = nt;
+ if(t->Size() > 0)
+ index++;
+ __ASSERT_ALWAYS(t->Succ() != NULL, VECPANIC(KErrUnderflow)); //can never pass-by bottom
+ }
+ return t->Ptr();
+ }
+
+
+template <class T, TInt C>
+NONSHARABLE_CLASS(TVector) : public TVectorBuffer<C * sizeof(T)>
+ {
+ public:
+ TVector();
+ TInt Append(const T& aData);
+ const T& Shift();
+ TInt Size() const;
+ const T& operator[](TInt aIndex) const;
+ };
+
+template <class T, TInt C>
+TVector<T, C>::TVector() : TVectorBuffer<C * sizeof(T)>()
+ {
+ }
+
+template <class T, TInt C>
+TInt TVector<T, C>::Append(const T& aData)
+ {
+ const TPckgC<T> data(aData);
+ return TVectorBuffer<C * sizeof(T)>::Append(data);
+ }
+
+template <class T, TInt C>
+const T& TVector<T, C>::Shift()
+ {
+ const TPtrC8 ptr = TVectorBuffer<C * sizeof(T)>::Shift();
+ return *(reinterpret_cast<const T*>(ptr.Ptr()));
+ }
+
+
+template <class T, TInt C>
+TInt TVector<T, C>::Size() const
+ {
+ return TVectorBuffer<C * sizeof(T)>::Size() / sizeof(T);
+ }
+
+template <class T, TInt C>
+const T& TVector<T, C>::operator[](TInt aIndex) const
+ {
+ const TPtrC8 ptr = TVectorBuffer<C * sizeof(T)>::operator[](aIndex);
+ return *(reinterpret_cast<const T*>(ptr.Ptr()));
+ }
+
+#endif
+
+
diff --git a/distrib/sdl-1.2.15/src/main/win32/SDL_win32_main.c b/distrib/sdl-1.2.15/src/main/win32/SDL_win32_main.c
new file mode 100644
index 0000000..672b48c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/main/win32/SDL_win32_main.c
@@ -0,0 +1,402 @@
+/*
+ SDL_main.c, placed in the public domain by Sam Lantinga 4/13/98
+
+ The WinMain function -- calls your program's main() function
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#ifdef _WIN32_WCE
+# define DIR_SEPERATOR TEXT("\\")
+# undef _getcwd
+# define _getcwd(str,len) wcscpy(str,TEXT(""))
+# define setbuf(f,b)
+# define setvbuf(w,x,y,z)
+# define fopen _wfopen
+# define freopen _wfreopen
+# define remove(x) DeleteFile(x)
+#else
+# define DIR_SEPERATOR TEXT("/")
+# include <direct.h>
+#endif
+
+/* Include the SDL main definition header */
+#include "SDL.h"
+#include "SDL_main.h"
+
+#ifdef main
+# ifndef _WIN32_WCE_EMULATION
+# undef main
+# endif /* _WIN32_WCE_EMULATION */
+#endif /* main */
+
+/* The standard output files */
+#define STDOUT_FILE TEXT("stdout.txt")
+#define STDERR_FILE TEXT("stderr.txt")
+
+/* Set a variable to tell if the stdio redirect has been enabled. */
+static int stdioRedirectEnabled = 0;
+
+#ifdef _WIN32_WCE
+ static wchar_t stdoutPath[MAX_PATH];
+ static wchar_t stderrPath[MAX_PATH];
+#else
+ static char stdoutPath[MAX_PATH];
+ static char stderrPath[MAX_PATH];
+#endif
+
+#if defined(_WIN32_WCE) && _WIN32_WCE < 300
+/* seems to be undefined in Win CE although in online help */
+#define isspace(a) (((CHAR)a == ' ') || ((CHAR)a == '\t'))
+#endif /* _WIN32_WCE < 300 */
+
+static void UnEscapeQuotes( char *arg )
+{
+ char *last = NULL;
+
+ while( *arg ) {
+ if( *arg == '"' && *last == '\\' ) {
+ char *c_curr = arg;
+ char *c_last = last;
+
+ while( *c_curr ) {
+ *c_last = *c_curr;
+ c_last = c_curr;
+ c_curr++;
+ }
+ *c_last = '\0';
+ }
+ last = arg;
+ arg++;
+ }
+}
+
+/* Parse a command line buffer into arguments */
+static int ParseCommandLine(char *cmdline, char **argv)
+{
+ char *bufp;
+ char *lastp = NULL;
+ int argc, last_argc;
+
+ argc = last_argc = 0;
+ for ( bufp = cmdline; *bufp; ) {
+ /* Skip leading whitespace */
+ while ( isspace(*bufp) ) {
+ ++bufp;
+ }
+ /* Skip over argument */
+ if ( *bufp == '"' ) {
+ ++bufp;
+ if ( *bufp ) {
+ if ( argv ) {
+ argv[argc] = bufp;
+ }
+ ++argc;
+ }
+ /* Skip over word */
+ while ( *bufp && ( *bufp != '"' || (lastp && *lastp == '\\') ) ) {
+ lastp = bufp;
+ ++bufp;
+ }
+ } else {
+ if ( *bufp ) {
+ if ( argv ) {
+ argv[argc] = bufp;
+ }
+ ++argc;
+ }
+ /* Skip over word */
+ while ( *bufp && ! isspace(*bufp) ) {
+ ++bufp;
+ }
+ }
+ if ( *bufp ) {
+ if ( argv ) {
+ *bufp = '\0';
+ }
+ ++bufp;
+ }
+
+ /* Strip out \ from \" sequences */
+ if( argv && last_argc != argc ) {
+ UnEscapeQuotes( argv[last_argc] );
+ }
+ last_argc = argc;
+ }
+ if ( argv ) {
+ argv[argc] = NULL;
+ }
+ return(argc);
+}
+
+/* Show an error message */
+static void ShowError(const char *title, const char *message)
+{
+/* If USE_MESSAGEBOX is defined, you need to link with user32.lib */
+#ifdef USE_MESSAGEBOX
+ MessageBox(NULL, message, title, MB_ICONEXCLAMATION|MB_OK);
+#else
+ fprintf(stderr, "%s: %s\n", title, message);
+#endif
+}
+
+/* Pop up an out of memory message, returns to Windows */
+static BOOL OutOfMemory(void)
+{
+ ShowError("Fatal Error", "Out of memory - aborting");
+ return FALSE;
+}
+
+/* SDL_Quit() shouldn't be used with atexit() directly because
+ calling conventions may differ... */
+static void cleanup(void)
+{
+ SDL_Quit();
+}
+
+/* Remove the output files if there was no output written */
+static void cleanup_output(void) {
+ FILE *file;
+ int empty;
+
+ /* Flush the output in case anything is queued */
+ fclose(stdout);
+ fclose(stderr);
+
+ /* Without redirection we're done */
+ if (!stdioRedirectEnabled) {
+ return;
+ }
+
+ /* See if the files have any output in them */
+ if ( stdoutPath[0] ) {
+ file = fopen(stdoutPath, TEXT("rb"));
+ if ( file ) {
+ empty = (fgetc(file) == EOF) ? 1 : 0;
+ fclose(file);
+ if ( empty ) {
+ remove(stdoutPath);
+ }
+ }
+ }
+ if ( stderrPath[0] ) {
+ file = fopen(stderrPath, TEXT("rb"));
+ if ( file ) {
+ empty = (fgetc(file) == EOF) ? 1 : 0;
+ fclose(file);
+ if ( empty ) {
+ remove(stderrPath);
+ }
+ }
+ }
+}
+
+/* Redirect the output (stdout and stderr) to a file */
+static void redirect_output(void)
+{
+ DWORD pathlen;
+#ifdef _WIN32_WCE
+ wchar_t path[MAX_PATH];
+#else
+ char path[MAX_PATH];
+#endif
+ FILE *newfp;
+
+ pathlen = GetModuleFileName(NULL, path, SDL_arraysize(path));
+ while ( pathlen > 0 && path[pathlen] != '\\' ) {
+ --pathlen;
+ }
+ path[pathlen] = '\0';
+
+#ifdef _WIN32_WCE
+ wcsncpy( stdoutPath, path, SDL_arraysize(stdoutPath) );
+ wcsncat( stdoutPath, DIR_SEPERATOR STDOUT_FILE, SDL_arraysize(stdoutPath) );
+#else
+ SDL_strlcpy( stdoutPath, path, SDL_arraysize(stdoutPath) );
+ SDL_strlcat( stdoutPath, DIR_SEPERATOR STDOUT_FILE, SDL_arraysize(stdoutPath) );
+#endif
+
+ /* Redirect standard input and standard output */
+ newfp = freopen(stdoutPath, TEXT("w"), stdout);
+
+#ifndef _WIN32_WCE
+ if ( newfp == NULL ) { /* This happens on NT */
+#if !defined(stdout)
+ stdout = fopen(stdoutPath, TEXT("w"));
+#else
+ newfp = fopen(stdoutPath, TEXT("w"));
+ if ( newfp ) {
+ *stdout = *newfp;
+ }
+#endif
+ }
+#endif /* _WIN32_WCE */
+
+#ifdef _WIN32_WCE
+ wcsncpy( stderrPath, path, SDL_arraysize(stdoutPath) );
+ wcsncat( stderrPath, DIR_SEPERATOR STDOUT_FILE, SDL_arraysize(stdoutPath) );
+#else
+ SDL_strlcpy( stderrPath, path, SDL_arraysize(stderrPath) );
+ SDL_strlcat( stderrPath, DIR_SEPERATOR STDERR_FILE, SDL_arraysize(stderrPath) );
+#endif
+
+ newfp = freopen(stderrPath, TEXT("w"), stderr);
+#ifndef _WIN32_WCE
+ if ( newfp == NULL ) { /* This happens on NT */
+#if !defined(stderr)
+ stderr = fopen(stderrPath, TEXT("w"));
+#else
+ newfp = fopen(stderrPath, TEXT("w"));
+ if ( newfp ) {
+ *stderr = *newfp;
+ }
+#endif
+ }
+#endif /* _WIN32_WCE */
+
+ setvbuf(stdout, NULL, _IOLBF, BUFSIZ); /* Line buffered */
+ setbuf(stderr, NULL); /* No buffering */
+ stdioRedirectEnabled = 1;
+}
+
+#if defined(_MSC_VER) && !defined(_WIN32_WCE)
+/* The VC++ compiler needs main defined */
+#define console_main main
+#endif
+
+/* This is where execution begins [console apps] */
+int console_main(int argc, char *argv[])
+{
+ size_t n;
+ char *bufp, *appname;
+ int status;
+
+ /* Get the class name from argv[0] */
+ appname = argv[0];
+ if ( (bufp=SDL_strrchr(argv[0], '\\')) != NULL ) {
+ appname = bufp+1;
+ } else
+ if ( (bufp=SDL_strrchr(argv[0], '/')) != NULL ) {
+ appname = bufp+1;
+ }
+
+ if ( (bufp=SDL_strrchr(appname, '.')) == NULL )
+ n = SDL_strlen(appname);
+ else
+ n = (bufp-appname);
+
+ bufp = SDL_stack_alloc(char, n+1);
+ if ( bufp == NULL ) {
+ return OutOfMemory();
+ }
+ SDL_strlcpy(bufp, appname, n+1);
+ appname = bufp;
+
+ /* Load SDL dynamic link library */
+ if ( SDL_Init(SDL_INIT_NOPARACHUTE) < 0 ) {
+ ShowError("WinMain() error", SDL_GetError());
+ return(FALSE);
+ }
+ atexit(cleanup_output);
+ atexit(cleanup);
+
+ /* Sam:
+ We still need to pass in the application handle so that
+ DirectInput will initialize properly when SDL_RegisterApp()
+ is called later in the video initialization.
+ */
+ SDL_SetModuleHandle(GetModuleHandle(NULL));
+
+ /* Run the application main() code */
+ status = SDL_main(argc, argv);
+
+ /* Exit cleanly, calling atexit() functions */
+ exit(status);
+
+ /* Hush little compiler, don't you cry... */
+ return 0;
+}
+
+/* This is where execution begins [windowed apps] */
+#ifdef _WIN32_WCE
+int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPWSTR szCmdLine, int sw)
+#else
+int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
+#endif
+{
+ HMODULE handle;
+ char **argv;
+ int argc;
+ char *cmdline;
+ char *env_str;
+#ifdef _WIN32_WCE
+ wchar_t *bufp;
+ int nLen;
+#else
+ char *bufp;
+ size_t nLen;
+#endif
+
+ /* Start up DDHELP.EXE before opening any files, so DDHELP doesn't
+ keep them open. This is a hack.. hopefully it will be fixed
+ someday. DDHELP.EXE starts up the first time DDRAW.DLL is loaded.
+ */
+ handle = LoadLibrary(TEXT("DDRAW.DLL"));
+ if ( handle != NULL ) {
+ FreeLibrary(handle);
+ }
+
+ /* Check for stdio redirect settings and do the redirection */
+ if ((env_str = SDL_getenv("SDL_STDIO_REDIRECT"))) {
+ if (SDL_atoi(env_str)) {
+ redirect_output();
+ }
+ }
+#ifndef NO_STDIO_REDIRECT
+ else {
+ redirect_output();
+ }
+#endif
+
+#ifdef _WIN32_WCE
+ nLen = wcslen(szCmdLine)+128+1;
+ bufp = SDL_stack_alloc(wchar_t, nLen*2);
+ wcscpy (bufp, TEXT("\""));
+ GetModuleFileName(NULL, bufp+1, 128-3);
+ wcscpy (bufp+wcslen(bufp), TEXT("\" "));
+ wcsncpy(bufp+wcslen(bufp), szCmdLine,nLen-wcslen(bufp));
+ nLen = wcslen(bufp)+1;
+ cmdline = SDL_stack_alloc(char, nLen);
+ if ( cmdline == NULL ) {
+ return OutOfMemory();
+ }
+ WideCharToMultiByte(CP_ACP, 0, bufp, -1, cmdline, nLen, NULL, NULL);
+#else
+ /* Grab the command line */
+ bufp = GetCommandLine();
+ nLen = SDL_strlen(bufp)+1;
+ cmdline = SDL_stack_alloc(char, nLen);
+ if ( cmdline == NULL ) {
+ return OutOfMemory();
+ }
+ SDL_strlcpy(cmdline, bufp, nLen);
+#endif
+
+ /* Parse it into argv and argc */
+ argc = ParseCommandLine(cmdline, NULL);
+ argv = SDL_stack_alloc(char*, argc+1);
+ if ( argv == NULL ) {
+ return OutOfMemory();
+ }
+ ParseCommandLine(cmdline, argv);
+
+ /* Run the main program (after a little SDL initialization) */
+ console_main(argc, argv);
+
+ /* Hush little compiler, don't you cry... */
+ return 0;
+}
diff --git a/distrib/sdl-1.2.15/src/main/win32/version.rc b/distrib/sdl-1.2.15/src/main/win32/version.rc
new file mode 100644
index 0000000..38fb642
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/main/win32/version.rc
@@ -0,0 +1,38 @@
+
+#include "winresrc.h"
+
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,2,14,0
+ PRODUCTVERSION 1,2,14,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", "\0"
+ VALUE "FileDescription", "SDL\0"
+ VALUE "FileVersion", "1, 2, 14, 0\0"
+ VALUE "InternalName", "SDL\0"
+ VALUE "LegalCopyright", "Copyright © 2009 Sam Lantinga\0"
+ VALUE "OriginalFilename", "SDL.dll\0"
+ VALUE "ProductName", "Simple DirectMedia Layer\0"
+ VALUE "ProductVersion", "1, 2, 14, 0\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/distrib/sdl-1.2.15/src/stdlib/SDL_getenv.c b/distrib/sdl-1.2.15/src/stdlib/SDL_getenv.c
new file mode 100644
index 0000000..30aba12
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/stdlib/SDL_getenv.c
@@ -0,0 +1,247 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_stdinc.h"
+
+#ifndef HAVE_GETENV
+
+#if defined(__WIN32__) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__)
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+/* Note this isn't thread-safe! */
+
+static char *SDL_envmem = NULL; /* Ugh, memory leak */
+static size_t SDL_envmemlen = 0;
+
+/* Put a variable of the form "name=value" into the environment */
+int SDL_putenv(const char *variable)
+{
+ size_t bufferlen;
+ char *value;
+ const char *sep;
+
+ sep = SDL_strchr(variable, '=');
+ if ( sep == NULL ) {
+ return -1;
+ }
+ bufferlen = SDL_strlen(variable)+1;
+ if ( bufferlen > SDL_envmemlen ) {
+ char *newmem = (char *)SDL_realloc(SDL_envmem, bufferlen);
+ if ( newmem == NULL ) {
+ return -1;
+ }
+ SDL_envmem = newmem;
+ SDL_envmemlen = bufferlen;
+ }
+ SDL_strlcpy(SDL_envmem, variable, bufferlen);
+ value = SDL_envmem + (sep - variable);
+ *value++ = '\0';
+ if ( !SetEnvironmentVariable(SDL_envmem, *value ? value : NULL) ) {
+ return -1;
+ }
+ return 0;
+}
+
+/* Retrieve a variable named "name" from the environment */
+char *SDL_getenv(const char *name)
+{
+ size_t bufferlen;
+
+ bufferlen = GetEnvironmentVariable(name, SDL_envmem, (DWORD)SDL_envmemlen);
+ if ( bufferlen == 0 ) {
+ return NULL;
+ }
+ if ( bufferlen > SDL_envmemlen ) {
+ char *newmem = (char *)SDL_realloc(SDL_envmem, bufferlen);
+ if ( newmem == NULL ) {
+ return NULL;
+ }
+ SDL_envmem = newmem;
+ SDL_envmemlen = bufferlen;
+ GetEnvironmentVariable(name, SDL_envmem, (DWORD)SDL_envmemlen);
+ }
+ return SDL_envmem;
+}
+
+#else /* roll our own */
+
+static char **SDL_env = (char **)0;
+
+/* Put a variable of the form "name=value" into the environment */
+int SDL_putenv(const char *variable)
+{
+ const char *name, *value;
+ int added;
+ int len, i;
+ char **new_env;
+ char *new_variable;
+
+ /* A little error checking */
+ if ( ! variable ) {
+ return(-1);
+ }
+ name = variable;
+ for ( value=variable; *value && (*value != '='); ++value ) {
+ /* Keep looking for '=' */ ;
+ }
+ if ( *value ) {
+ ++value;
+ } else {
+ return(-1);
+ }
+
+ /* Allocate memory for the variable */
+ new_variable = SDL_strdup(variable);
+ if ( ! new_variable ) {
+ return(-1);
+ }
+
+ /* Actually put it into the environment */
+ added = 0;
+ i = 0;
+ if ( SDL_env ) {
+ /* Check to see if it's already there... */
+ len = (value - name);
+ for ( ; SDL_env[i]; ++i ) {
+ if ( SDL_strncmp(SDL_env[i], name, len) == 0 ) {
+ break;
+ }
+ }
+ /* If we found it, just replace the entry */
+ if ( SDL_env[i] ) {
+ SDL_free(SDL_env[i]);
+ SDL_env[i] = new_variable;
+ added = 1;
+ }
+ }
+
+ /* Didn't find it in the environment, expand and add */
+ if ( ! added ) {
+ new_env = SDL_realloc(SDL_env, (i+2)*sizeof(char *));
+ if ( new_env ) {
+ SDL_env = new_env;
+ SDL_env[i++] = new_variable;
+ SDL_env[i++] = (char *)0;
+ added = 1;
+ } else {
+ SDL_free(new_variable);
+ }
+ }
+ return (added ? 0 : -1);
+}
+
+/* Retrieve a variable named "name" from the environment */
+char *SDL_getenv(const char *name)
+{
+ int len, i;
+ char *value;
+
+ value = (char *)0;
+ if ( SDL_env ) {
+ len = SDL_strlen(name);
+ for ( i=0; SDL_env[i] && !value; ++i ) {
+ if ( (SDL_strncmp(SDL_env[i], name, len) == 0) &&
+ (SDL_env[i][len] == '=') ) {
+ value = &SDL_env[i][len+1];
+ }
+ }
+ }
+ return value;
+}
+
+#endif /* __WIN32__ */
+
+#endif /* !HAVE_GETENV */
+
+#ifdef TEST_MAIN
+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+ char *value;
+
+ printf("Checking for non-existent variable... ");
+ fflush(stdout);
+ if ( ! SDL_getenv("EXISTS") ) {
+ printf("okay\n");
+ } else {
+ printf("failed\n");
+ }
+ printf("Setting FIRST=VALUE1 in the environment... ");
+ fflush(stdout);
+ if ( SDL_putenv("FIRST=VALUE1") == 0 ) {
+ printf("okay\n");
+ } else {
+ printf("failed\n");
+ }
+ printf("Getting FIRST from the environment... ");
+ fflush(stdout);
+ value = SDL_getenv("FIRST");
+ if ( value && (SDL_strcmp(value, "VALUE1") == 0) ) {
+ printf("okay\n");
+ } else {
+ printf("failed\n");
+ }
+ printf("Setting SECOND=VALUE2 in the environment... ");
+ fflush(stdout);
+ if ( SDL_putenv("SECOND=VALUE2") == 0 ) {
+ printf("okay\n");
+ } else {
+ printf("failed\n");
+ }
+ printf("Getting SECOND from the environment... ");
+ fflush(stdout);
+ value = SDL_getenv("SECOND");
+ if ( value && (SDL_strcmp(value, "VALUE2") == 0) ) {
+ printf("okay\n");
+ } else {
+ printf("failed\n");
+ }
+ printf("Setting FIRST=NOVALUE in the environment... ");
+ fflush(stdout);
+ if ( SDL_putenv("FIRST=NOVALUE") == 0 ) {
+ printf("okay\n");
+ } else {
+ printf("failed\n");
+ }
+ printf("Getting FIRST from the environment... ");
+ fflush(stdout);
+ value = SDL_getenv("FIRST");
+ if ( value && (SDL_strcmp(value, "NOVALUE") == 0) ) {
+ printf("okay\n");
+ } else {
+ printf("failed\n");
+ }
+ printf("Checking for non-existent variable... ");
+ fflush(stdout);
+ if ( ! SDL_getenv("EXISTS") ) {
+ printf("okay\n");
+ } else {
+ printf("failed\n");
+ }
+ return(0);
+}
+#endif /* TEST_MAIN */
+
diff --git a/distrib/sdl-1.2.15/src/stdlib/SDL_iconv.c b/distrib/sdl-1.2.15/src/stdlib/SDL_iconv.c
new file mode 100644
index 0000000..fa56a99
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/stdlib/SDL_iconv.c
@@ -0,0 +1,881 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This file contains portable iconv functions for SDL */
+
+#include "SDL_stdinc.h"
+#include "SDL_endian.h"
+
+#ifdef HAVE_ICONV
+
+/* Depending on which standard the iconv() was implemented with,
+ iconv() may or may not use const char ** for the inbuf param.
+ If we get this wrong, it's just a warning, so no big deal.
+*/
+#if defined(_XGP6) || \
+ defined(__GLIBC__) && ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2))
+#define ICONV_INBUF_NONCONST
+#endif
+
+#include <errno.h>
+
+size_t SDL_iconv(SDL_iconv_t cd,
+ const char **inbuf, size_t *inbytesleft,
+ char **outbuf, size_t *outbytesleft)
+{
+ size_t retCode;
+#ifdef ICONV_INBUF_NONCONST
+ retCode = iconv(cd, (char **)inbuf, inbytesleft, outbuf, outbytesleft);
+#else
+ retCode = iconv(cd, inbuf, inbytesleft, outbuf, outbytesleft);
+#endif
+ if ( retCode == (size_t)-1 ) {
+ switch(errno) {
+ case E2BIG:
+ return SDL_ICONV_E2BIG;
+ case EILSEQ:
+ return SDL_ICONV_EILSEQ;
+ case EINVAL:
+ return SDL_ICONV_EINVAL;
+ default:
+ return SDL_ICONV_ERROR;
+ }
+ }
+ return retCode;
+}
+
+#else
+
+/* Lots of useful information on Unicode at:
+ http://www.cl.cam.ac.uk/~mgk25/unicode.html
+*/
+
+#define UNICODE_BOM 0xFEFF
+
+#define UNKNOWN_ASCII '?'
+#define UNKNOWN_UNICODE 0xFFFD
+
+enum {
+ ENCODING_UNKNOWN,
+ ENCODING_ASCII,
+ ENCODING_LATIN1,
+ ENCODING_UTF8,
+ ENCODING_UTF16, /* Needs byte order marker */
+ ENCODING_UTF16BE,
+ ENCODING_UTF16LE,
+ ENCODING_UTF32, /* Needs byte order marker */
+ ENCODING_UTF32BE,
+ ENCODING_UTF32LE,
+ ENCODING_UCS2, /* Native byte order assumed */
+ ENCODING_UCS4, /* Native byte order assumed */
+};
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+#define ENCODING_UTF16NATIVE ENCODING_UTF16BE
+#define ENCODING_UTF32NATIVE ENCODING_UTF32BE
+#else
+#define ENCODING_UTF16NATIVE ENCODING_UTF16LE
+#define ENCODING_UTF32NATIVE ENCODING_UTF32LE
+#endif
+
+struct _SDL_iconv_t
+{
+ int src_fmt;
+ int dst_fmt;
+};
+
+static struct {
+ const char *name;
+ int format;
+} encodings[] = {
+ { "ASCII", ENCODING_ASCII },
+ { "US-ASCII", ENCODING_ASCII },
+ { "8859-1", ENCODING_LATIN1 },
+ { "ISO-8859-1", ENCODING_LATIN1 },
+ { "UTF8", ENCODING_UTF8 },
+ { "UTF-8", ENCODING_UTF8 },
+ { "UTF16", ENCODING_UTF16 },
+ { "UTF-16", ENCODING_UTF16 },
+ { "UTF16BE", ENCODING_UTF16BE },
+ { "UTF-16BE", ENCODING_UTF16BE },
+ { "UTF16LE", ENCODING_UTF16LE },
+ { "UTF-16LE", ENCODING_UTF16LE },
+ { "UTF32", ENCODING_UTF32 },
+ { "UTF-32", ENCODING_UTF32 },
+ { "UTF32BE", ENCODING_UTF32BE },
+ { "UTF-32BE", ENCODING_UTF32BE },
+ { "UTF32LE", ENCODING_UTF32LE },
+ { "UTF-32LE", ENCODING_UTF32LE },
+ { "UCS2", ENCODING_UCS2 },
+ { "UCS-2", ENCODING_UCS2 },
+ { "UCS4", ENCODING_UCS4 },
+ { "UCS-4", ENCODING_UCS4 },
+};
+
+static const char *getlocale(char *buffer, size_t bufsize)
+{
+ const char *lang;
+ char *ptr;
+
+ lang = SDL_getenv("LC_ALL");
+ if ( !lang ) {
+ lang = SDL_getenv("LC_CTYPE");
+ }
+ if ( !lang ) {
+ lang = SDL_getenv("LC_MESSAGES");
+ }
+ if ( !lang ) {
+ lang = SDL_getenv("LANG");
+ }
+ if ( !lang || !*lang || SDL_strcmp(lang, "C") == 0 ) {
+ lang = "ASCII";
+ }
+
+ /* We need to trim down strings like "en_US.UTF-8@blah" to "UTF-8" */
+ ptr = SDL_strchr(lang, '.');
+ if (ptr != NULL) {
+ lang = ptr + 1;
+ }
+
+ SDL_strlcpy(buffer, lang, bufsize);
+ ptr = SDL_strchr(buffer, '@');
+ if (ptr != NULL) {
+ *ptr = '\0'; /* chop end of string. */
+ }
+
+ return buffer;
+}
+
+SDL_iconv_t SDL_iconv_open(const char *tocode, const char *fromcode)
+{
+ int src_fmt = ENCODING_UNKNOWN;
+ int dst_fmt = ENCODING_UNKNOWN;
+ int i;
+ char fromcode_buffer[64];
+ char tocode_buffer[64];
+
+ if ( !fromcode || !*fromcode ) {
+ fromcode = getlocale(fromcode_buffer, sizeof(fromcode_buffer));
+ }
+ if ( !tocode || !*tocode ) {
+ tocode = getlocale(tocode_buffer, sizeof(tocode_buffer));
+ }
+ for ( i = 0; i < SDL_arraysize(encodings); ++i ) {
+ if ( SDL_strcasecmp(fromcode, encodings[i].name) == 0 ) {
+ src_fmt = encodings[i].format;
+ if ( dst_fmt != ENCODING_UNKNOWN ) {
+ break;
+ }
+ }
+ if ( SDL_strcasecmp(tocode, encodings[i].name) == 0 ) {
+ dst_fmt = encodings[i].format;
+ if ( src_fmt != ENCODING_UNKNOWN ) {
+ break;
+ }
+ }
+ }
+ if ( src_fmt != ENCODING_UNKNOWN && dst_fmt != ENCODING_UNKNOWN ) {
+ SDL_iconv_t cd = (SDL_iconv_t)SDL_malloc(sizeof(*cd));
+ if ( cd ) {
+ cd->src_fmt = src_fmt;
+ cd->dst_fmt = dst_fmt;
+ return cd;
+ }
+ }
+ return (SDL_iconv_t)-1;
+}
+
+size_t SDL_iconv(SDL_iconv_t cd,
+ const char **inbuf, size_t *inbytesleft,
+ char **outbuf, size_t *outbytesleft)
+{
+ /* For simplicity, we'll convert everything to and from UCS-4 */
+ const char *src;
+ char *dst;
+ size_t srclen, dstlen;
+ Uint32 ch = 0;
+ size_t total;
+
+ if ( !inbuf || !*inbuf ) {
+ /* Reset the context */
+ return 0;
+ }
+ if ( !outbuf || !*outbuf || !outbytesleft || !*outbytesleft ) {
+ return SDL_ICONV_E2BIG;
+ }
+ src = *inbuf;
+ srclen = (inbytesleft ? *inbytesleft : 0);
+ dst = *outbuf;
+ dstlen = *outbytesleft;
+
+ switch ( cd->src_fmt ) {
+ case ENCODING_UTF16:
+ /* Scan for a byte order marker */
+ {
+ Uint8 *p = (Uint8 *)src;
+ size_t n = srclen / 2;
+ while ( n ) {
+ if ( p[0] == 0xFF && p[1] == 0xFE ) {
+ cd->src_fmt = ENCODING_UTF16BE;
+ break;
+ } else if ( p[0] == 0xFE && p[1] == 0xFF ) {
+ cd->src_fmt = ENCODING_UTF16LE;
+ break;
+ }
+ p += 2;
+ --n;
+ }
+ if ( n == 0 ) {
+ /* We can't tell, default to host order */
+ cd->src_fmt = ENCODING_UTF16NATIVE;
+ }
+ }
+ break;
+ case ENCODING_UTF32:
+ /* Scan for a byte order marker */
+ {
+ Uint8 *p = (Uint8 *)src;
+ size_t n = srclen / 4;
+ while ( n ) {
+ if ( p[0] == 0xFF && p[1] == 0xFE &&
+ p[2] == 0x00 && p[3] == 0x00 ) {
+ cd->src_fmt = ENCODING_UTF32BE;
+ break;
+ } else if ( p[0] == 0x00 && p[1] == 0x00 &&
+ p[2] == 0xFE && p[3] == 0xFF ) {
+ cd->src_fmt = ENCODING_UTF32LE;
+ break;
+ }
+ p += 4;
+ --n;
+ }
+ if ( n == 0 ) {
+ /* We can't tell, default to host order */
+ cd->src_fmt = ENCODING_UTF32NATIVE;
+ }
+ }
+ break;
+ }
+
+ switch ( cd->dst_fmt ) {
+ case ENCODING_UTF16:
+ /* Default to host order, need to add byte order marker */
+ if ( dstlen < 2 ) {
+ return SDL_ICONV_E2BIG;
+ }
+ *(Uint16 *)dst = UNICODE_BOM;
+ dst += 2;
+ dstlen -= 2;
+ cd->dst_fmt = ENCODING_UTF16NATIVE;
+ break;
+ case ENCODING_UTF32:
+ /* Default to host order, need to add byte order marker */
+ if ( dstlen < 4 ) {
+ return SDL_ICONV_E2BIG;
+ }
+ *(Uint32 *)dst = UNICODE_BOM;
+ dst += 4;
+ dstlen -= 4;
+ cd->dst_fmt = ENCODING_UTF32NATIVE;
+ break;
+ }
+
+ total = 0;
+ while ( srclen > 0 ) {
+ /* Decode a character */
+ switch ( cd->src_fmt ) {
+ case ENCODING_ASCII:
+ {
+ Uint8 *p = (Uint8 *)src;
+ ch = (Uint32)(p[0] & 0x7F);
+ ++src;
+ --srclen;
+ }
+ break;
+ case ENCODING_LATIN1:
+ {
+ Uint8 *p = (Uint8 *)src;
+ ch = (Uint32)p[0];
+ ++src;
+ --srclen;
+ }
+ break;
+ case ENCODING_UTF8: /* RFC 3629 */
+ {
+ Uint8 *p = (Uint8 *)src;
+ size_t left = 0;
+ SDL_bool overlong = SDL_FALSE;
+ if ( p[0] >= 0xFC ) {
+ if ( (p[0] & 0xFE) != 0xFC ) {
+ /* Skip illegal sequences
+ return SDL_ICONV_EILSEQ;
+ */
+ ch = UNKNOWN_UNICODE;
+ } else {
+ if ( p[0] == 0xFC ) {
+ overlong = SDL_TRUE;
+ }
+ ch = (Uint32)(p[0] & 0x01);
+ left = 5;
+ }
+ } else if ( p[0] >= 0xF8 ) {
+ if ( (p[0] & 0xFC) != 0xF8 ) {
+ /* Skip illegal sequences
+ return SDL_ICONV_EILSEQ;
+ */
+ ch = UNKNOWN_UNICODE;
+ } else {
+ if ( p[0] == 0xF8 ) {
+ overlong = SDL_TRUE;
+ }
+ ch = (Uint32)(p[0] & 0x03);
+ left = 4;
+ }
+ } else if ( p[0] >= 0xF0 ) {
+ if ( (p[0] & 0xF8) != 0xF0 ) {
+ /* Skip illegal sequences
+ return SDL_ICONV_EILSEQ;
+ */
+ ch = UNKNOWN_UNICODE;
+ } else {
+ if ( p[0] == 0xF0 ) {
+ overlong = SDL_TRUE;
+ }
+ ch = (Uint32)(p[0] & 0x07);
+ left = 3;
+ }
+ } else if ( p[0] >= 0xE0 ) {
+ if ( (p[0] & 0xF0) != 0xE0 ) {
+ /* Skip illegal sequences
+ return SDL_ICONV_EILSEQ;
+ */
+ ch = UNKNOWN_UNICODE;
+ } else {
+ if ( p[0] == 0xE0 ) {
+ overlong = SDL_TRUE;
+ }
+ ch = (Uint32)(p[0] & 0x0F);
+ left = 2;
+ }
+ } else if ( p[0] >= 0xC0 ) {
+ if ( (p[0] & 0xE0) != 0xC0 ) {
+ /* Skip illegal sequences
+ return SDL_ICONV_EILSEQ;
+ */
+ ch = UNKNOWN_UNICODE;
+ } else {
+ if ( (p[0] & 0xDE) == 0xC0 ) {
+ overlong = SDL_TRUE;
+ }
+ ch = (Uint32)(p[0] & 0x1F);
+ left = 1;
+ }
+ } else {
+ if ( (p[0] & 0x80) != 0x00 ) {
+ /* Skip illegal sequences
+ return SDL_ICONV_EILSEQ;
+ */
+ ch = UNKNOWN_UNICODE;
+ } else {
+ ch = (Uint32)p[0];
+ }
+ }
+ ++src;
+ --srclen;
+ if ( srclen < left ) {
+ return SDL_ICONV_EINVAL;
+ }
+ while ( left-- ) {
+ ++p;
+ if ( (p[0] & 0xC0) != 0x80 ) {
+ /* Skip illegal sequences
+ return SDL_ICONV_EILSEQ;
+ */
+ ch = UNKNOWN_UNICODE;
+ break;
+ }
+ ch <<= 6;
+ ch |= (p[0] & 0x3F);
+ ++src;
+ --srclen;
+ }
+ if ( overlong ) {
+ /* Potential security risk
+ return SDL_ICONV_EILSEQ;
+ */
+ ch = UNKNOWN_UNICODE;
+ }
+ if ( (ch >= 0xD800 && ch <= 0xDFFF) ||
+ (ch == 0xFFFE || ch == 0xFFFF) ||
+ ch > 0x10FFFF ) {
+ /* Skip illegal sequences
+ return SDL_ICONV_EILSEQ;
+ */
+ ch = UNKNOWN_UNICODE;
+ }
+ }
+ break;
+ case ENCODING_UTF16BE: /* RFC 2781 */
+ {
+ Uint8 *p = (Uint8 *)src;
+ Uint16 W1, W2;
+ if ( srclen < 2 ) {
+ return SDL_ICONV_EINVAL;
+ }
+ W1 = ((Uint16)p[0] << 8) |
+ (Uint16)p[1];
+ src += 2;
+ srclen -= 2;
+ if ( W1 < 0xD800 || W1 > 0xDFFF ) {
+ ch = (Uint32)W1;
+ break;
+ }
+ if ( W1 > 0xDBFF ) {
+ /* Skip illegal sequences
+ return SDL_ICONV_EILSEQ;
+ */
+ ch = UNKNOWN_UNICODE;
+ break;
+ }
+ if ( srclen < 2 ) {
+ return SDL_ICONV_EINVAL;
+ }
+ p = (Uint8 *)src;
+ W2 = ((Uint16)p[0] << 8) |
+ (Uint16)p[1];
+ src += 2;
+ srclen -= 2;
+ if ( W2 < 0xDC00 || W2 > 0xDFFF ) {
+ /* Skip illegal sequences
+ return SDL_ICONV_EILSEQ;
+ */
+ ch = UNKNOWN_UNICODE;
+ break;
+ }
+ ch = (((Uint32)(W1 & 0x3FF) << 10) |
+ (Uint32)(W2 & 0x3FF)) + 0x10000;
+ }
+ break;
+ case ENCODING_UTF16LE: /* RFC 2781 */
+ {
+ Uint8 *p = (Uint8 *)src;
+ Uint16 W1, W2;
+ if ( srclen < 2 ) {
+ return SDL_ICONV_EINVAL;
+ }
+ W1 = ((Uint16)p[1] << 8) |
+ (Uint16)p[0];
+ src += 2;
+ srclen -= 2;
+ if ( W1 < 0xD800 || W1 > 0xDFFF ) {
+ ch = (Uint32)W1;
+ break;
+ }
+ if ( W1 > 0xDBFF ) {
+ /* Skip illegal sequences
+ return SDL_ICONV_EILSEQ;
+ */
+ ch = UNKNOWN_UNICODE;
+ break;
+ }
+ if ( srclen < 2 ) {
+ return SDL_ICONV_EINVAL;
+ }
+ p = (Uint8 *)src;
+ W2 = ((Uint16)p[1] << 8) |
+ (Uint16)p[0];
+ src += 2;
+ srclen -= 2;
+ if ( W2 < 0xDC00 || W2 > 0xDFFF ) {
+ /* Skip illegal sequences
+ return SDL_ICONV_EILSEQ;
+ */
+ ch = UNKNOWN_UNICODE;
+ break;
+ }
+ ch = (((Uint32)(W1 & 0x3FF) << 10) |
+ (Uint32)(W2 & 0x3FF)) + 0x10000;
+ }
+ break;
+ case ENCODING_UTF32BE:
+ {
+ Uint8 *p = (Uint8 *)src;
+ if ( srclen < 4 ) {
+ return SDL_ICONV_EINVAL;
+ }
+ ch = ((Uint32)p[0] << 24) |
+ ((Uint32)p[1] << 16) |
+ ((Uint32)p[2] << 8) |
+ (Uint32)p[3];
+ src += 4;
+ srclen -= 4;
+ }
+ break;
+ case ENCODING_UTF32LE:
+ {
+ Uint8 *p = (Uint8 *)src;
+ if ( srclen < 4 ) {
+ return SDL_ICONV_EINVAL;
+ }
+ ch = ((Uint32)p[3] << 24) |
+ ((Uint32)p[2] << 16) |
+ ((Uint32)p[1] << 8) |
+ (Uint32)p[0];
+ src += 4;
+ srclen -= 4;
+ }
+ break;
+ case ENCODING_UCS2:
+ {
+ Uint16 *p = (Uint16 *)src;
+ if ( srclen < 2 ) {
+ return SDL_ICONV_EINVAL;
+ }
+ ch = *p;
+ src += 2;
+ srclen -= 2;
+ }
+ break;
+ case ENCODING_UCS4:
+ {
+ Uint32 *p = (Uint32 *)src;
+ if ( srclen < 4 ) {
+ return SDL_ICONV_EINVAL;
+ }
+ ch = *p;
+ src += 4;
+ srclen -= 4;
+ }
+ break;
+ }
+
+ /* Encode a character */
+ switch ( cd->dst_fmt ) {
+ case ENCODING_ASCII:
+ {
+ Uint8 *p = (Uint8 *)dst;
+ if ( dstlen < 1 ) {
+ return SDL_ICONV_E2BIG;
+ }
+ if ( ch > 0x7F ) {
+ *p = UNKNOWN_ASCII;
+ } else {
+ *p = (Uint8)ch;
+ }
+ ++dst;
+ --dstlen;
+ }
+ break;
+ case ENCODING_LATIN1:
+ {
+ Uint8 *p = (Uint8 *)dst;
+ if ( dstlen < 1 ) {
+ return SDL_ICONV_E2BIG;
+ }
+ if ( ch > 0xFF ) {
+ *p = UNKNOWN_ASCII;
+ } else {
+ *p = (Uint8)ch;
+ }
+ ++dst;
+ --dstlen;
+ }
+ break;
+ case ENCODING_UTF8: /* RFC 3629 */
+ {
+ Uint8 *p = (Uint8 *)dst;
+ if ( ch > 0x10FFFF ) {
+ ch = UNKNOWN_UNICODE;
+ }
+ if ( ch <= 0x7F ) {
+ if ( dstlen < 1 ) {
+ return SDL_ICONV_E2BIG;
+ }
+ *p = (Uint8)ch;
+ ++dst;
+ --dstlen;
+ } else if ( ch <= 0x7FF ) {
+ if ( dstlen < 2 ) {
+ return SDL_ICONV_E2BIG;
+ }
+ p[0] = 0xC0 | (Uint8)((ch >> 6) & 0x1F);
+ p[1] = 0x80 | (Uint8)(ch & 0x3F);
+ dst += 2;
+ dstlen -= 2;
+ } else if ( ch <= 0xFFFF ) {
+ if ( dstlen < 3 ) {
+ return SDL_ICONV_E2BIG;
+ }
+ p[0] = 0xE0 | (Uint8)((ch >> 12) & 0x0F);
+ p[1] = 0x80 | (Uint8)((ch >> 6) & 0x3F);
+ p[2] = 0x80 | (Uint8)(ch & 0x3F);
+ dst += 3;
+ dstlen -= 3;
+ } else if ( ch <= 0x1FFFFF ) {
+ if ( dstlen < 4 ) {
+ return SDL_ICONV_E2BIG;
+ }
+ p[0] = 0xF0 | (Uint8)((ch >> 18) & 0x07);
+ p[1] = 0x80 | (Uint8)((ch >> 12) & 0x3F);
+ p[2] = 0x80 | (Uint8)((ch >> 6) & 0x3F);
+ p[3] = 0x80 | (Uint8)(ch & 0x3F);
+ dst += 4;
+ dstlen -= 4;
+ } else if ( ch <= 0x3FFFFFF ) {
+ if ( dstlen < 5 ) {
+ return SDL_ICONV_E2BIG;
+ }
+ p[0] = 0xF8 | (Uint8)((ch >> 24) & 0x03);
+ p[1] = 0x80 | (Uint8)((ch >> 18) & 0x3F);
+ p[2] = 0x80 | (Uint8)((ch >> 12) & 0x3F);
+ p[3] = 0x80 | (Uint8)((ch >> 6) & 0x3F);
+ p[4] = 0x80 | (Uint8)(ch & 0x3F);
+ dst += 5;
+ dstlen -= 5;
+ } else {
+ if ( dstlen < 6 ) {
+ return SDL_ICONV_E2BIG;
+ }
+ p[0] = 0xFC | (Uint8)((ch >> 30) & 0x01);
+ p[1] = 0x80 | (Uint8)((ch >> 24) & 0x3F);
+ p[2] = 0x80 | (Uint8)((ch >> 18) & 0x3F);
+ p[3] = 0x80 | (Uint8)((ch >> 12) & 0x3F);
+ p[4] = 0x80 | (Uint8)((ch >> 6) & 0x3F);
+ p[5] = 0x80 | (Uint8)(ch & 0x3F);
+ dst += 6;
+ dstlen -= 6;
+ }
+ }
+ break;
+ case ENCODING_UTF16BE: /* RFC 2781 */
+ {
+ Uint8 *p = (Uint8 *)dst;
+ if ( ch > 0x10FFFF ) {
+ ch = UNKNOWN_UNICODE;
+ }
+ if ( ch < 0x10000 ) {
+ if ( dstlen < 2 ) {
+ return SDL_ICONV_E2BIG;
+ }
+ p[0] = (Uint8)(ch >> 8);
+ p[1] = (Uint8)ch;
+ dst += 2;
+ dstlen -= 2;
+ } else {
+ Uint16 W1, W2;
+ if ( dstlen < 4 ) {
+ return SDL_ICONV_E2BIG;
+ }
+ ch = ch - 0x10000;
+ W1 = 0xD800 | (Uint16)((ch >> 10) & 0x3FF);
+ W2 = 0xDC00 | (Uint16)(ch & 0x3FF);
+ p[0] = (Uint8)(W1 >> 8);
+ p[1] = (Uint8)W1;
+ p[2] = (Uint8)(W2 >> 8);
+ p[3] = (Uint8)W2;
+ dst += 4;
+ dstlen -= 4;
+ }
+ }
+ break;
+ case ENCODING_UTF16LE: /* RFC 2781 */
+ {
+ Uint8 *p = (Uint8 *)dst;
+ if ( ch > 0x10FFFF ) {
+ ch = UNKNOWN_UNICODE;
+ }
+ if ( ch < 0x10000 ) {
+ if ( dstlen < 2 ) {
+ return SDL_ICONV_E2BIG;
+ }
+ p[1] = (Uint8)(ch >> 8);
+ p[0] = (Uint8)ch;
+ dst += 2;
+ dstlen -= 2;
+ } else {
+ Uint16 W1, W2;
+ if ( dstlen < 4 ) {
+ return SDL_ICONV_E2BIG;
+ }
+ ch = ch - 0x10000;
+ W1 = 0xD800 | (Uint16)((ch >> 10) & 0x3FF);
+ W2 = 0xDC00 | (Uint16)(ch & 0x3FF);
+ p[1] = (Uint8)(W1 >> 8);
+ p[0] = (Uint8)W1;
+ p[3] = (Uint8)(W2 >> 8);
+ p[2] = (Uint8)W2;
+ dst += 4;
+ dstlen -= 4;
+ }
+ }
+ break;
+ case ENCODING_UTF32BE:
+ {
+ Uint8 *p = (Uint8 *)dst;
+ if ( ch > 0x10FFFF ) {
+ ch = UNKNOWN_UNICODE;
+ }
+ if ( dstlen < 4 ) {
+ return SDL_ICONV_E2BIG;
+ }
+ p[0] = (Uint8)(ch >> 24);
+ p[1] = (Uint8)(ch >> 16);
+ p[2] = (Uint8)(ch >> 8);
+ p[3] = (Uint8)ch;
+ dst += 4;
+ dstlen -= 4;
+ }
+ break;
+ case ENCODING_UTF32LE:
+ {
+ Uint8 *p = (Uint8 *)dst;
+ if ( ch > 0x10FFFF ) {
+ ch = UNKNOWN_UNICODE;
+ }
+ if ( dstlen < 4 ) {
+ return SDL_ICONV_E2BIG;
+ }
+ p[3] = (Uint8)(ch >> 24);
+ p[2] = (Uint8)(ch >> 16);
+ p[1] = (Uint8)(ch >> 8);
+ p[0] = (Uint8)ch;
+ dst += 4;
+ dstlen -= 4;
+ }
+ break;
+ case ENCODING_UCS2:
+ {
+ Uint16 *p = (Uint16 *)dst;
+ if ( ch > 0xFFFF ) {
+ ch = UNKNOWN_UNICODE;
+ }
+ if ( dstlen < 2 ) {
+ return SDL_ICONV_E2BIG;
+ }
+ *p = (Uint16)ch;
+ dst += 2;
+ dstlen -= 2;
+ }
+ break;
+ case ENCODING_UCS4:
+ {
+ Uint32 *p = (Uint32 *)dst;
+ if ( ch > 0x7FFFFFFF ) {
+ ch = UNKNOWN_UNICODE;
+ }
+ if ( dstlen < 4 ) {
+ return SDL_ICONV_E2BIG;
+ }
+ *p = ch;
+ dst += 4;
+ dstlen -= 4;
+ }
+ break;
+ }
+
+ /* Update state */
+ *inbuf = src;
+ *inbytesleft = srclen;
+ *outbuf = dst;
+ *outbytesleft = dstlen;
+ ++total;
+ }
+ return total;
+}
+
+int SDL_iconv_close(SDL_iconv_t cd)
+{
+ if ( cd && cd != (SDL_iconv_t)-1 ) {
+ SDL_free(cd);
+ }
+ return 0;
+}
+
+#endif /* !HAVE_ICONV */
+
+char *SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft)
+{
+ SDL_iconv_t cd;
+ char *string;
+ size_t stringsize;
+ char *outbuf;
+ size_t outbytesleft;
+ size_t retCode = 0;
+
+ cd = SDL_iconv_open(tocode, fromcode);
+ if ( cd == (SDL_iconv_t)-1 ) {
+ /* See if we can recover here (fixes iconv on Solaris 11) */
+ if ( !tocode || !*tocode ) {
+ tocode = "UTF-8";
+ }
+ if ( !fromcode || !*fromcode ) {
+ fromcode = "UTF-8";
+ }
+ cd = SDL_iconv_open(tocode, fromcode);
+ }
+ if ( cd == (SDL_iconv_t)-1 ) {
+ return NULL;
+ }
+
+ stringsize = inbytesleft > 4 ? inbytesleft : 4;
+ string = SDL_malloc(stringsize);
+ if ( !string ) {
+ SDL_iconv_close(cd);
+ return NULL;
+ }
+ outbuf = string;
+ outbytesleft = stringsize;
+ SDL_memset(outbuf, 0, 4);
+
+ while ( inbytesleft > 0 ) {
+ retCode = SDL_iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
+ switch (retCode) {
+ case SDL_ICONV_E2BIG:
+ {
+ char *oldstring = string;
+ stringsize *= 2;
+ string = SDL_realloc(string, stringsize);
+ if ( !string ) {
+ SDL_iconv_close(cd);
+ return NULL;
+ }
+ outbuf = string + (outbuf - oldstring);
+ outbytesleft = stringsize - (outbuf - string);
+ SDL_memset(outbuf, 0, 4);
+ }
+ break;
+ case SDL_ICONV_EILSEQ:
+ /* Try skipping some input data - not perfect, but... */
+ ++inbuf;
+ --inbytesleft;
+ break;
+ case SDL_ICONV_EINVAL:
+ case SDL_ICONV_ERROR:
+ /* We can't continue... */
+ inbytesleft = 0;
+ break;
+ }
+ }
+ SDL_iconv_close(cd);
+
+ return string;
+}
diff --git a/distrib/sdl-1.2.15/src/stdlib/SDL_malloc.c b/distrib/sdl-1.2.15/src/stdlib/SDL_malloc.c
new file mode 100644
index 0000000..f025e43
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/stdlib/SDL_malloc.c
@@ -0,0 +1,5111 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This file contains portable memory management functions for SDL */
+
+#include "SDL_stdinc.h"
+
+#ifndef HAVE_MALLOC
+
+#define LACKS_SYS_TYPES_H
+#define LACKS_STDIO_H
+#define LACKS_STRINGS_H
+#define LACKS_STRING_H
+#define LACKS_STDLIB_H
+#define ABORT
+
+/*
+ This is a version (aka dlmalloc) of malloc/free/realloc written by
+ Doug Lea and released to the public domain, as explained at
+ http://creativecommons.org/licenses/publicdomain. Send questions,
+ comments, complaints, performance data, etc to dl@cs.oswego.edu
+
+* Version 2.8.3 Thu Sep 22 11:16:15 2005 Doug Lea (dl at gee)
+
+ Note: There may be an updated version of this malloc obtainable at
+ ftp://gee.cs.oswego.edu/pub/misc/malloc.c
+ Check before installing!
+
+* Quickstart
+
+ This library is all in one file to simplify the most common usage:
+ ftp it, compile it (-O3), and link it into another program. All of
+ the compile-time options default to reasonable values for use on
+ most platforms. You might later want to step through various
+ compile-time and dynamic tuning options.
+
+ For convenience, an include file for code using this malloc is at:
+ ftp://gee.cs.oswego.edu/pub/misc/malloc-2.8.3.h
+ You don't really need this .h file unless you call functions not
+ defined in your system include files. The .h file contains only the
+ excerpts from this file needed for using this malloc on ANSI C/C++
+ systems, so long as you haven't changed compile-time options about
+ naming and tuning parameters. If you do, then you can create your
+ own malloc.h that does include all settings by cutting at the point
+ indicated below. Note that you may already by default be using a C
+ library containing a malloc that is based on some version of this
+ malloc (for example in linux). You might still want to use the one
+ in this file to customize settings or to avoid overheads associated
+ with library versions.
+
+* Vital statistics:
+
+ Supported pointer/size_t representation: 4 or 8 bytes
+ size_t MUST be an unsigned type of the same width as
+ pointers. (If you are using an ancient system that declares
+ size_t as a signed type, or need it to be a different width
+ than pointers, you can use a previous release of this malloc
+ (e.g. 2.7.2) supporting these.)
+
+ Alignment: 8 bytes (default)
+ This suffices for nearly all current machines and C compilers.
+ However, you can define MALLOC_ALIGNMENT to be wider than this
+ if necessary (up to 128bytes), at the expense of using more space.
+
+ Minimum overhead per allocated chunk: 4 or 8 bytes (if 4byte sizes)
+ 8 or 16 bytes (if 8byte sizes)
+ Each malloced chunk has a hidden word of overhead holding size
+ and status information, and additional cross-check word
+ if FOOTERS is defined.
+
+ Minimum allocated size: 4-byte ptrs: 16 bytes (including overhead)
+ 8-byte ptrs: 32 bytes (including overhead)
+
+ Even a request for zero bytes (i.e., malloc(0)) returns a
+ pointer to something of the minimum allocatable size.
+ The maximum overhead wastage (i.e., number of extra bytes
+ allocated than were requested in malloc) is less than or equal
+ to the minimum size, except for requests >= mmap_threshold that
+ are serviced via mmap(), where the worst case wastage is about
+ 32 bytes plus the remainder from a system page (the minimal
+ mmap unit); typically 4096 or 8192 bytes.
+
+ Security: static-safe; optionally more or less
+ The "security" of malloc refers to the ability of malicious
+ code to accentuate the effects of errors (for example, freeing
+ space that is not currently malloc'ed or overwriting past the
+ ends of chunks) in code that calls malloc. This malloc
+ guarantees not to modify any memory locations below the base of
+ heap, i.e., static variables, even in the presence of usage
+ errors. The routines additionally detect most improper frees
+ and reallocs. All this holds as long as the static bookkeeping
+ for malloc itself is not corrupted by some other means. This
+ is only one aspect of security -- these checks do not, and
+ cannot, detect all possible programming errors.
+
+ If FOOTERS is defined nonzero, then each allocated chunk
+ carries an additional check word to verify that it was malloced
+ from its space. These check words are the same within each
+ execution of a program using malloc, but differ across
+ executions, so externally crafted fake chunks cannot be
+ freed. This improves security by rejecting frees/reallocs that
+ could corrupt heap memory, in addition to the checks preventing
+ writes to statics that are always on. This may further improve
+ security at the expense of time and space overhead. (Note that
+ FOOTERS may also be worth using with MSPACES.)
+
+ By default detected errors cause the program to abort (calling
+ "abort()"). You can override this to instead proceed past
+ errors by defining PROCEED_ON_ERROR. In this case, a bad free
+ has no effect, and a malloc that encounters a bad address
+ caused by user overwrites will ignore the bad address by
+ dropping pointers and indices to all known memory. This may
+ be appropriate for programs that should continue if at all
+ possible in the face of programming errors, although they may
+ run out of memory because dropped memory is never reclaimed.
+
+ If you don't like either of these options, you can define
+ CORRUPTION_ERROR_ACTION and USAGE_ERROR_ACTION to do anything
+ else. And if if you are sure that your program using malloc has
+ no errors or vulnerabilities, you can define INSECURE to 1,
+ which might (or might not) provide a small performance improvement.
+
+ Thread-safety: NOT thread-safe unless USE_LOCKS defined
+ When USE_LOCKS is defined, each public call to malloc, free,
+ etc is surrounded with either a pthread mutex or a win32
+ spinlock (depending on WIN32). This is not especially fast, and
+ can be a major bottleneck. It is designed only to provide
+ minimal protection in concurrent environments, and to provide a
+ basis for extensions. If you are using malloc in a concurrent
+ program, consider instead using ptmalloc, which is derived from
+ a version of this malloc. (See http://www.malloc.de).
+
+ System requirements: Any combination of MORECORE and/or MMAP/MUNMAP
+ This malloc can use unix sbrk or any emulation (invoked using
+ the CALL_MORECORE macro) and/or mmap/munmap or any emulation
+ (invoked using CALL_MMAP/CALL_MUNMAP) to get and release system
+ memory. On most unix systems, it tends to work best if both
+ MORECORE and MMAP are enabled. On Win32, it uses emulations
+ based on VirtualAlloc. It also uses common C library functions
+ like memset.
+
+ Compliance: I believe it is compliant with the Single Unix Specification
+ (See http://www.unix.org). Also SVID/XPG, ANSI C, and probably
+ others as well.
+
+* Overview of algorithms
+
+ This is not the fastest, most space-conserving, most portable, or
+ most tunable malloc ever written. However it is among the fastest
+ while also being among the most space-conserving, portable and
+ tunable. Consistent balance across these factors results in a good
+ general-purpose allocator for malloc-intensive programs.
+
+ In most ways, this malloc is a best-fit allocator. Generally, it
+ chooses the best-fitting existing chunk for a request, with ties
+ broken in approximately least-recently-used order. (This strategy
+ normally maintains low fragmentation.) However, for requests less
+ than 256bytes, it deviates from best-fit when there is not an
+ exactly fitting available chunk by preferring to use space adjacent
+ to that used for the previous small request, as well as by breaking
+ ties in approximately most-recently-used order. (These enhance
+ locality of series of small allocations.) And for very large requests
+ (>= 256Kb by default), it relies on system memory mapping
+ facilities, if supported. (This helps avoid carrying around and
+ possibly fragmenting memory used only for large chunks.)
+
+ All operations (except malloc_stats and mallinfo) have execution
+ times that are bounded by a constant factor of the number of bits in
+ a size_t, not counting any clearing in calloc or copying in realloc,
+ or actions surrounding MORECORE and MMAP that have times
+ proportional to the number of non-contiguous regions returned by
+ system allocation routines, which is often just 1.
+
+ The implementation is not very modular and seriously overuses
+ macros. Perhaps someday all C compilers will do as good a job
+ inlining modular code as can now be done by brute-force expansion,
+ but now, enough of them seem not to.
+
+ Some compilers issue a lot of warnings about code that is
+ dead/unreachable only on some platforms, and also about intentional
+ uses of negation on unsigned types. All known cases of each can be
+ ignored.
+
+ For a longer but out of date high-level description, see
+ http://gee.cs.oswego.edu/dl/html/malloc.html
+
+* MSPACES
+ If MSPACES is defined, then in addition to malloc, free, etc.,
+ this file also defines mspace_malloc, mspace_free, etc. These
+ are versions of malloc routines that take an "mspace" argument
+ obtained using create_mspace, to control all internal bookkeeping.
+ If ONLY_MSPACES is defined, only these versions are compiled.
+ So if you would like to use this allocator for only some allocations,
+ and your system malloc for others, you can compile with
+ ONLY_MSPACES and then do something like...
+ static mspace mymspace = create_mspace(0,0); // for example
+ #define mymalloc(bytes) mspace_malloc(mymspace, bytes)
+
+ (Note: If you only need one instance of an mspace, you can instead
+ use "USE_DL_PREFIX" to relabel the global malloc.)
+
+ You can similarly create thread-local allocators by storing
+ mspaces as thread-locals. For example:
+ static __thread mspace tlms = 0;
+ void* tlmalloc(size_t bytes) {
+ if (tlms == 0) tlms = create_mspace(0, 0);
+ return mspace_malloc(tlms, bytes);
+ }
+ void tlfree(void* mem) { mspace_free(tlms, mem); }
+
+ Unless FOOTERS is defined, each mspace is completely independent.
+ You cannot allocate from one and free to another (although
+ conformance is only weakly checked, so usage errors are not always
+ caught). If FOOTERS is defined, then each chunk carries around a tag
+ indicating its originating mspace, and frees are directed to their
+ originating spaces.
+
+ ------------------------- Compile-time options ---------------------------
+
+Be careful in setting #define values for numerical constants of type
+size_t. On some systems, literal values are not automatically extended
+to size_t precision unless they are explicitly casted.
+
+WIN32 default: defined if _WIN32 defined
+ Defining WIN32 sets up defaults for MS environment and compilers.
+ Otherwise defaults are for unix.
+
+MALLOC_ALIGNMENT default: (size_t)8
+ Controls the minimum alignment for malloc'ed chunks. It must be a
+ power of two and at least 8, even on machines for which smaller
+ alignments would suffice. It may be defined as larger than this
+ though. Note however that code and data structures are optimized for
+ the case of 8-byte alignment.
+
+MSPACES default: 0 (false)
+ If true, compile in support for independent allocation spaces.
+ This is only supported if HAVE_MMAP is true.
+
+ONLY_MSPACES default: 0 (false)
+ If true, only compile in mspace versions, not regular versions.
+
+USE_LOCKS default: 0 (false)
+ Causes each call to each public routine to be surrounded with
+ pthread or WIN32 mutex lock/unlock. (If set true, this can be
+ overridden on a per-mspace basis for mspace versions.)
+
+FOOTERS default: 0
+ If true, provide extra checking and dispatching by placing
+ information in the footers of allocated chunks. This adds
+ space and time overhead.
+
+INSECURE default: 0
+ If true, omit checks for usage errors and heap space overwrites.
+
+USE_DL_PREFIX default: NOT defined
+ Causes compiler to prefix all public routines with the string 'dl'.
+ This can be useful when you only want to use this malloc in one part
+ of a program, using your regular system malloc elsewhere.
+
+ABORT default: defined as abort()
+ Defines how to abort on failed checks. On most systems, a failed
+ check cannot die with an "assert" or even print an informative
+ message, because the underlying print routines in turn call malloc,
+ which will fail again. Generally, the best policy is to simply call
+ abort(). It's not very useful to do more than this because many
+ errors due to overwriting will show up as address faults (null, odd
+ addresses etc) rather than malloc-triggered checks, so will also
+ abort. Also, most compilers know that abort() does not return, so
+ can better optimize code conditionally calling it.
+
+PROCEED_ON_ERROR default: defined as 0 (false)
+ Controls whether detected bad addresses cause them to bypassed
+ rather than aborting. If set, detected bad arguments to free and
+ realloc are ignored. And all bookkeeping information is zeroed out
+ upon a detected overwrite of freed heap space, thus losing the
+ ability to ever return it from malloc again, but enabling the
+ application to proceed. If PROCEED_ON_ERROR is defined, the
+ static variable malloc_corruption_error_count is compiled in
+ and can be examined to see if errors have occurred. This option
+ generates slower code than the default abort policy.
+
+DEBUG default: NOT defined
+ The DEBUG setting is mainly intended for people trying to modify
+ this code or diagnose problems when porting to new platforms.
+ However, it may also be able to better isolate user errors than just
+ using runtime checks. The assertions in the check routines spell
+ out in more detail the assumptions and invariants underlying the
+ algorithms. The checking is fairly extensive, and will slow down
+ execution noticeably. Calling malloc_stats or mallinfo with DEBUG
+ set will attempt to check every non-mmapped allocated and free chunk
+ in the course of computing the summaries.
+
+ABORT_ON_ASSERT_FAILURE default: defined as 1 (true)
+ Debugging assertion failures can be nearly impossible if your
+ version of the assert macro causes malloc to be called, which will
+ lead to a cascade of further failures, blowing the runtime stack.
+ ABORT_ON_ASSERT_FAILURE cause assertions failures to call abort(),
+ which will usually make debugging easier.
+
+MALLOC_FAILURE_ACTION default: sets errno to ENOMEM, or no-op on win32
+ The action to take before "return 0" when malloc fails to be able to
+ return memory because there is none available.
+
+HAVE_MORECORE default: 1 (true) unless win32 or ONLY_MSPACES
+ True if this system supports sbrk or an emulation of it.
+
+MORECORE default: sbrk
+ The name of the sbrk-style system routine to call to obtain more
+ memory. See below for guidance on writing custom MORECORE
+ functions. The type of the argument to sbrk/MORECORE varies across
+ systems. It cannot be size_t, because it supports negative
+ arguments, so it is normally the signed type of the same width as
+ size_t (sometimes declared as "intptr_t"). It doesn't much matter
+ though. Internally, we only call it with arguments less than half
+ the max value of a size_t, which should work across all reasonable
+ possibilities, although sometimes generating compiler warnings. See
+ near the end of this file for guidelines for creating a custom
+ version of MORECORE.
+
+MORECORE_CONTIGUOUS default: 1 (true)
+ If true, take advantage of fact that consecutive calls to MORECORE
+ with positive arguments always return contiguous increasing
+ addresses. This is true of unix sbrk. It does not hurt too much to
+ set it true anyway, since malloc copes with non-contiguities.
+ Setting it false when definitely non-contiguous saves time
+ and possibly wasted space it would take to discover this though.
+
+MORECORE_CANNOT_TRIM default: NOT defined
+ True if MORECORE cannot release space back to the system when given
+ negative arguments. This is generally necessary only if you are
+ using a hand-crafted MORECORE function that cannot handle negative
+ arguments.
+
+HAVE_MMAP default: 1 (true)
+ True if this system supports mmap or an emulation of it. If so, and
+ HAVE_MORECORE is not true, MMAP is used for all system
+ allocation. If set and HAVE_MORECORE is true as well, MMAP is
+ primarily used to directly allocate very large blocks. It is also
+ used as a backup strategy in cases where MORECORE fails to provide
+ space from system. Note: A single call to MUNMAP is assumed to be
+ able to unmap memory that may have be allocated using multiple calls
+ to MMAP, so long as they are adjacent.
+
+HAVE_MREMAP default: 1 on linux, else 0
+ If true realloc() uses mremap() to re-allocate large blocks and
+ extend or shrink allocation spaces.
+
+MMAP_CLEARS default: 1 on unix
+ True if mmap clears memory so calloc doesn't need to. This is true
+ for standard unix mmap using /dev/zero.
+
+USE_BUILTIN_FFS default: 0 (i.e., not used)
+ Causes malloc to use the builtin ffs() function to compute indices.
+ Some compilers may recognize and intrinsify ffs to be faster than the
+ supplied C version. Also, the case of x86 using gcc is special-cased
+ to an asm instruction, so is already as fast as it can be, and so
+ this setting has no effect. (On most x86s, the asm version is only
+ slightly faster than the C version.)
+
+malloc_getpagesize default: derive from system includes, or 4096.
+ The system page size. To the extent possible, this malloc manages
+ memory from the system in page-size units. This may be (and
+ usually is) a function rather than a constant. This is ignored
+ if WIN32, where page size is determined using getSystemInfo during
+ initialization.
+
+USE_DEV_RANDOM default: 0 (i.e., not used)
+ Causes malloc to use /dev/random to initialize secure magic seed for
+ stamping footers. Otherwise, the current time is used.
+
+NO_MALLINFO default: 0
+ If defined, don't compile "mallinfo". This can be a simple way
+ of dealing with mismatches between system declarations and
+ those in this file.
+
+MALLINFO_FIELD_TYPE default: size_t
+ The type of the fields in the mallinfo struct. This was originally
+ defined as "int" in SVID etc, but is more usefully defined as
+ 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
+ realloc(p, 0).
+
+LACKS_UNISTD_H, LACKS_FCNTL_H, LACKS_SYS_PARAM_H, LACKS_SYS_MMAN_H
+LACKS_STRINGS_H, LACKS_STRING_H, LACKS_SYS_TYPES_H, LACKS_ERRNO_H
+LACKS_STDLIB_H default: NOT defined unless on WIN32
+ Define these if your system does not have these header files.
+ You might need to manually insert some of the declarations they provide.
+
+DEFAULT_GRANULARITY default: page size if MORECORE_CONTIGUOUS,
+ system_info.dwAllocationGranularity in WIN32,
+ otherwise 64K.
+ Also settable using mallopt(M_GRANULARITY, x)
+ The unit for allocating and deallocating memory from the system. On
+ most systems with contiguous MORECORE, there is no reason to
+ make this more than a page. However, systems with MMAP tend to
+ either require or encourage larger granularities. You can increase
+ this value to prevent system allocation functions to be called so
+ often, especially if they are slow. The value must be at least one
+ page and must be a power of two. Setting to 0 causes initialization
+ to either page size or win32 region size. (Note: In previous
+ versions of malloc, the equivalent of this option was called
+ "TOP_PAD")
+
+DEFAULT_TRIM_THRESHOLD default: 2MB
+ Also settable using mallopt(M_TRIM_THRESHOLD, x)
+ The maximum amount of unused top-most memory to keep before
+ releasing via malloc_trim in free(). Automatic trimming is mainly
+ useful in long-lived programs using contiguous MORECORE. Because
+ trimming via sbrk can be slow on some systems, and can sometimes be
+ wasteful (in cases where programs immediately afterward allocate
+ more large chunks) the value should be high enough so that your
+ overall system performance would improve by releasing this much
+ memory. As a rough guide, you might set to a value close to the
+ average size of a process (program) running on your system.
+ Releasing this much memory would allow such a process to run in
+ memory. Generally, it is worth tuning trim thresholds when a
+ program undergoes phases where several large chunks are allocated
+ and released in ways that can reuse each other's storage, perhaps
+ mixed with phases where there are no such chunks at all. The trim
+ value must be greater than page size to have any useful effect. To
+ disable trimming completely, you can set to MAX_SIZE_T. Note that the trick
+ some people use of mallocing a huge space and then freeing it at
+ program startup, in an attempt to reserve system memory, doesn't
+ have the intended effect under automatic trimming, since that memory
+ will immediately be returned to the system.
+
+DEFAULT_MMAP_THRESHOLD default: 256K
+ Also settable using mallopt(M_MMAP_THRESHOLD, x)
+ The request size threshold for using MMAP to directly service a
+ request. Requests of at least this size that cannot be allocated
+ using already-existing space will be serviced via mmap. (If enough
+ normal freed space already exists it is used instead.) Using mmap
+ segregates relatively large chunks of memory so that they can be
+ individually obtained and released from the host system. A request
+ serviced through mmap is never reused by any other request (at least
+ not directly; the system may just so happen to remap successive
+ requests to the same locations). Segregating space in this way has
+ the benefits that: Mmapped space can always be individually released
+ back to the system, which helps keep the system level memory demands
+ of a long-lived program low. Also, mapped memory doesn't become
+ `locked' between other chunks, as can happen with normally allocated
+ chunks, which means that even trimming via malloc_trim would not
+ release them. However, it has the disadvantage that the space
+ cannot be reclaimed, consolidated, and then used to service later
+ requests, as happens with normal chunks. The advantages of mmap
+ nearly always outweigh disadvantages for "large" chunks, but the
+ value of "large" may vary across systems. The default is an
+ empirically derived value that works well in most systems. You can
+ disable mmap by setting to MAX_SIZE_T.
+
+*/
+
+#ifndef WIN32
+#ifdef _WIN32
+#define WIN32 1
+#endif /* _WIN32 */
+#endif /* WIN32 */
+#ifdef WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#define HAVE_MMAP 1
+#define HAVE_MORECORE 0
+#define LACKS_UNISTD_H
+#define LACKS_SYS_PARAM_H
+#define LACKS_SYS_MMAN_H
+#define LACKS_STRING_H
+#define LACKS_STRINGS_H
+#define LACKS_SYS_TYPES_H
+#define LACKS_ERRNO_H
+#define LACKS_FCNTL_H
+#define MALLOC_FAILURE_ACTION
+#define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */
+#endif /* WIN32 */
+
+#if defined(DARWIN) || defined(_DARWIN)
+/* Mac OSX docs advise not to use sbrk; it seems better to use mmap */
+#ifndef HAVE_MORECORE
+#define HAVE_MORECORE 0
+#define HAVE_MMAP 1
+#endif /* HAVE_MORECORE */
+#endif /* DARWIN */
+
+#ifndef LACKS_SYS_TYPES_H
+#include <sys/types.h> /* For size_t */
+#endif /* LACKS_SYS_TYPES_H */
+
+/* The maximum possible size_t value has all bits set */
+#define MAX_SIZE_T (~(size_t)0)
+
+#ifndef ONLY_MSPACES
+#define ONLY_MSPACES 0
+#endif /* ONLY_MSPACES */
+#ifndef MSPACES
+#if ONLY_MSPACES
+#define MSPACES 1
+#else /* ONLY_MSPACES */
+#define MSPACES 0
+#endif /* ONLY_MSPACES */
+#endif /* MSPACES */
+#ifndef MALLOC_ALIGNMENT
+#define MALLOC_ALIGNMENT ((size_t)8U)
+#endif /* MALLOC_ALIGNMENT */
+#ifndef FOOTERS
+#define FOOTERS 0
+#endif /* FOOTERS */
+#ifndef ABORT
+#define ABORT abort()
+#endif /* ABORT */
+#ifndef ABORT_ON_ASSERT_FAILURE
+#define ABORT_ON_ASSERT_FAILURE 1
+#endif /* ABORT_ON_ASSERT_FAILURE */
+#ifndef PROCEED_ON_ERROR
+#define PROCEED_ON_ERROR 0
+#endif /* PROCEED_ON_ERROR */
+#ifndef USE_LOCKS
+#define USE_LOCKS 0
+#endif /* USE_LOCKS */
+#ifndef INSECURE
+#define INSECURE 0
+#endif /* INSECURE */
+#ifndef HAVE_MMAP
+#define HAVE_MMAP 1
+#endif /* HAVE_MMAP */
+#ifndef MMAP_CLEARS
+#define MMAP_CLEARS 1
+#endif /* MMAP_CLEARS */
+#ifndef HAVE_MREMAP
+#ifdef linux
+#define HAVE_MREMAP 1
+#else /* linux */
+#define HAVE_MREMAP 0
+#endif /* linux */
+#endif /* HAVE_MREMAP */
+#ifndef MALLOC_FAILURE_ACTION
+#define MALLOC_FAILURE_ACTION errno = ENOMEM;
+#endif /* MALLOC_FAILURE_ACTION */
+#ifndef HAVE_MORECORE
+#if ONLY_MSPACES
+#define HAVE_MORECORE 0
+#else /* ONLY_MSPACES */
+#define HAVE_MORECORE 1
+#endif /* ONLY_MSPACES */
+#endif /* HAVE_MORECORE */
+#if !HAVE_MORECORE
+#define MORECORE_CONTIGUOUS 0
+#else /* !HAVE_MORECORE */
+#ifndef MORECORE
+#define MORECORE sbrk
+#endif /* MORECORE */
+#ifndef MORECORE_CONTIGUOUS
+#define MORECORE_CONTIGUOUS 1
+#endif /* MORECORE_CONTIGUOUS */
+#endif /* HAVE_MORECORE */
+#ifndef DEFAULT_GRANULARITY
+#if MORECORE_CONTIGUOUS
+#define DEFAULT_GRANULARITY (0) /* 0 means to compute in init_mparams */
+#else /* MORECORE_CONTIGUOUS */
+#define DEFAULT_GRANULARITY ((size_t)64U * (size_t)1024U)
+#endif /* MORECORE_CONTIGUOUS */
+#endif /* DEFAULT_GRANULARITY */
+#ifndef DEFAULT_TRIM_THRESHOLD
+#ifndef MORECORE_CANNOT_TRIM
+#define DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U)
+#else /* MORECORE_CANNOT_TRIM */
+#define DEFAULT_TRIM_THRESHOLD MAX_SIZE_T
+#endif /* MORECORE_CANNOT_TRIM */
+#endif /* DEFAULT_TRIM_THRESHOLD */
+#ifndef DEFAULT_MMAP_THRESHOLD
+#if HAVE_MMAP
+#define DEFAULT_MMAP_THRESHOLD ((size_t)256U * (size_t)1024U)
+#else /* HAVE_MMAP */
+#define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T
+#endif /* HAVE_MMAP */
+#endif /* DEFAULT_MMAP_THRESHOLD */
+#ifndef USE_BUILTIN_FFS
+#define USE_BUILTIN_FFS 0
+#endif /* USE_BUILTIN_FFS */
+#ifndef USE_DEV_RANDOM
+#define USE_DEV_RANDOM 0
+#endif /* USE_DEV_RANDOM */
+#ifndef NO_MALLINFO
+#define NO_MALLINFO 0
+#endif /* NO_MALLINFO */
+#ifndef MALLINFO_FIELD_TYPE
+#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
+
+/*
+ mallopt tuning options. SVID/XPG defines four standard parameter
+ numbers for mallopt, normally defined in malloc.h. None of these
+ are used in this malloc, so setting them has no effect. But this
+ malloc does support the following options.
+*/
+
+#define M_TRIM_THRESHOLD (-1)
+#define M_GRANULARITY (-2)
+#define M_MMAP_THRESHOLD (-3)
+
+/* ------------------------ Mallinfo declarations ------------------------ */
+
+#if !NO_MALLINFO
+/*
+ This version of malloc supports the standard SVID/XPG mallinfo
+ routine that returns a struct containing usage properties and
+ statistics. It should work on any system that has a
+ /usr/include/malloc.h defining struct mallinfo. The main
+ declaration needed is the mallinfo struct that is returned (by-copy)
+ by mallinfo(). The malloinfo struct contains a bunch of fields that
+ are not even meaningful in this version of malloc. These fields are
+ are instead filled by mallinfo() with other numbers that might be of
+ interest.
+
+ HAVE_USR_INCLUDE_MALLOC_H should be set if you have a
+ /usr/include/malloc.h file that includes a declaration of struct
+ mallinfo. If so, it is included; else a compliant version is
+ declared below. These must be precisely the same for mallinfo() to
+ work. The original SVID version of this struct, defined on most
+ systems with mallinfo, declares all fields as ints. But some others
+ define as unsigned long. If your system defines the fields using a
+ type of different width than listed here, you MUST #include your
+ system version and #define HAVE_USR_INCLUDE_MALLOC_H.
+*/
+
+/* #define HAVE_USR_INCLUDE_MALLOC_H */
+
+#ifdef HAVE_USR_INCLUDE_MALLOC_H
+#include "/usr/include/malloc.h"
+#else /* HAVE_USR_INCLUDE_MALLOC_H */
+
+struct mallinfo {
+ MALLINFO_FIELD_TYPE arena; /* non-mmapped space allocated from system */
+ MALLINFO_FIELD_TYPE ordblks; /* number of free chunks */
+ MALLINFO_FIELD_TYPE smblks; /* always 0 */
+ MALLINFO_FIELD_TYPE hblks; /* always 0 */
+ MALLINFO_FIELD_TYPE hblkhd; /* space in mmapped regions */
+ MALLINFO_FIELD_TYPE usmblks; /* maximum total allocated space */
+ MALLINFO_FIELD_TYPE fsmblks; /* always 0 */
+ MALLINFO_FIELD_TYPE uordblks; /* total allocated space */
+ MALLINFO_FIELD_TYPE fordblks; /* total free space */
+ MALLINFO_FIELD_TYPE keepcost; /* releasable (via malloc_trim) space */
+};
+
+#endif /* HAVE_USR_INCLUDE_MALLOC_H */
+#endif /* NO_MALLINFO */
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#if !ONLY_MSPACES
+
+/* ------------------- Declarations of public routines ------------------- */
+
+#ifndef USE_DL_PREFIX
+#define dlcalloc calloc
+#define dlfree free
+#define dlmalloc malloc
+#define dlmemalign memalign
+#define dlrealloc realloc
+#define dlvalloc valloc
+#define dlpvalloc pvalloc
+#define dlmallinfo mallinfo
+#define dlmallopt mallopt
+#define dlmalloc_trim malloc_trim
+#define dlmalloc_stats malloc_stats
+#define dlmalloc_usable_size malloc_usable_size
+#define dlmalloc_footprint malloc_footprint
+#define dlmalloc_max_footprint malloc_max_footprint
+#define dlindependent_calloc independent_calloc
+#define dlindependent_comalloc independent_comalloc
+#endif /* USE_DL_PREFIX */
+
+
+/*
+ malloc(size_t n)
+ Returns a pointer to a newly allocated chunk of at least n bytes, or
+ null if no space is available, in which case errno is set to ENOMEM
+ on ANSI C systems.
+
+ If n is zero, malloc returns a minimum-sized chunk. (The minimum
+ size is 16 bytes on most 32bit systems, and 32 bytes on 64bit
+ systems.) Note that size_t is an unsigned type, so calls with
+ arguments that would be negative if signed are interpreted as
+ requests for huge amounts of space, which will often fail. The
+ maximum supported value of n differs across systems, but is in all
+ cases less than the maximum representable value of a size_t.
+*/
+void* dlmalloc(size_t);
+
+/*
+ free(void* p)
+ Releases the chunk of memory pointed to by p, that had been previously
+ allocated using malloc or a related routine such as realloc.
+ It has no effect if p is null. If p was not malloced or already
+ freed, free(p) will by default cause the current program to abort.
+*/
+void dlfree(void*);
+
+/*
+ calloc(size_t n_elements, size_t element_size);
+ Returns a pointer to n_elements * element_size bytes, with all locations
+ set to zero.
+*/
+void* dlcalloc(size_t, size_t);
+
+/*
+ realloc(void* p, size_t n)
+ Returns a pointer to a chunk of size n that contains the same data
+ as does chunk p up to the minimum of (n, p's size) bytes, or null
+ if no space is available.
+
+ The returned pointer may or may not be the same as p. The algorithm
+ prefers extending p in most cases when possible, otherwise it
+ employs the equivalent of a malloc-copy-free sequence.
+
+ If p is null, realloc is equivalent to malloc.
+
+ If space is not available, realloc returns null, errno is set (if on
+ ANSI) and p is NOT freed.
+
+ if n is for fewer bytes than already held by p, the newly unused
+ space is lopped off and freed if possible. realloc with a size
+ argument of zero (re)allocates a minimum-sized chunk.
+
+ The old unix realloc convention of allowing the last-free'd chunk
+ to be used as an argument to realloc is not supported.
+*/
+
+void* dlrealloc(void*, size_t);
+
+/*
+ memalign(size_t alignment, size_t n);
+ Returns a pointer to a newly allocated chunk of n bytes, aligned
+ in accord with the alignment argument.
+
+ The alignment argument should be a power of two. If the argument is
+ not a power of two, the nearest greater power is used.
+ 8-byte alignment is guaranteed by normal malloc calls, so don't
+ bother calling memalign with an argument of 8 or less.
+
+ Overreliance on memalign is a sure way to fragment space.
+*/
+void* dlmemalign(size_t, size_t);
+
+/*
+ valloc(size_t n);
+ Equivalent to memalign(pagesize, n), where pagesize is the page
+ size of the system. If the pagesize is unknown, 4096 is used.
+*/
+void* dlvalloc(size_t);
+
+/*
+ mallopt(int parameter_number, int parameter_value)
+ Sets tunable parameters The format is to provide a
+ (parameter-number, parameter-value) pair. mallopt then sets the
+ corresponding parameter to the argument value if it can (i.e., so
+ long as the value is meaningful), and returns 1 if successful else
+ 0. SVID/XPG/ANSI defines four standard param numbers for mallopt,
+ normally defined in malloc.h. None of these are use in this malloc,
+ so setting them has no effect. But this malloc also supports other
+ options in mallopt. See below for details. Briefly, supported
+ parameters are as follows (listed defaults are for "typical"
+ configurations).
+
+ Symbol param # default allowed param values
+ M_TRIM_THRESHOLD -1 2*1024*1024 any (MAX_SIZE_T disables)
+ M_GRANULARITY -2 page size any power of 2 >= page size
+ M_MMAP_THRESHOLD -3 256*1024 any (or 0 if no MMAP support)
+*/
+int dlmallopt(int, int);
+
+/*
+ malloc_footprint();
+ Returns the number of bytes obtained from the system. The total
+ number of bytes allocated by malloc, realloc etc., is less than this
+ value. Unlike mallinfo, this function returns only a precomputed
+ result, so can be called frequently to monitor memory consumption.
+ Even if locks are otherwise defined, this function does not use them,
+ so results might not be up to date.
+*/
+size_t dlmalloc_footprint(void);
+
+/*
+ malloc_max_footprint();
+ Returns the maximum number of bytes obtained from the system. This
+ value will be greater than current footprint if deallocated space
+ has been reclaimed by the system. The peak number of bytes allocated
+ by malloc, realloc etc., is less than this value. Unlike mallinfo,
+ this function returns only a precomputed result, so can be called
+ frequently to monitor memory consumption. Even if locks are
+ otherwise defined, this function does not use them, so results might
+ not be up to date.
+*/
+size_t dlmalloc_max_footprint(void);
+
+#if !NO_MALLINFO
+/*
+ mallinfo()
+ Returns (by copy) a struct containing various summary statistics:
+
+ arena: current total non-mmapped bytes allocated from system
+ ordblks: the number of free chunks
+ smblks: always zero.
+ hblks: current number of mmapped regions
+ hblkhd: total bytes held in mmapped regions
+ usmblks: the maximum total allocated space. This will be greater
+ than current total if trimming has occurred.
+ fsmblks: always zero
+ uordblks: current total allocated space (normal or mmapped)
+ fordblks: total free space
+ keepcost: the maximum number of bytes that could ideally be released
+ back to system via malloc_trim. ("ideally" means that
+ it ignores page restrictions etc.)
+
+ Because these fields are ints, but internal bookkeeping may
+ be kept as longs, the reported values may wrap around zero and
+ thus be inaccurate.
+*/
+struct mallinfo dlmallinfo(void);
+#endif /* NO_MALLINFO */
+
+/*
+ independent_calloc(size_t n_elements, size_t element_size, void* chunks[]);
+
+ independent_calloc is similar to calloc, but instead of returning a
+ single cleared space, it returns an array of pointers to n_elements
+ independent elements that can hold contents of size elem_size, each
+ of which starts out cleared, and can be independently freed,
+ realloc'ed etc. The elements are guaranteed to be adjacently
+ allocated (this is not guaranteed to occur with multiple callocs or
+ mallocs), which may also improve cache locality in some
+ applications.
+
+ The "chunks" argument is optional (i.e., may be null, which is
+ probably the most typical usage). If it is null, the returned array
+ is itself dynamically allocated and should also be freed when it is
+ no longer needed. Otherwise, the chunks array must be of at least
+ n_elements in length. It is filled in with the pointers to the
+ chunks.
+
+ In either case, independent_calloc returns this pointer array, or
+ null if the allocation failed. If n_elements is zero and "chunks"
+ is null, it returns a chunk representing an array with zero elements
+ (which should be freed if not wanted).
+
+ Each element must be individually freed when it is no longer
+ needed. If you'd like to instead be able to free all at once, you
+ should instead use regular calloc and assign pointers into this
+ space to represent elements. (In this case though, you cannot
+ independently free elements.)
+
+ independent_calloc simplifies and speeds up implementations of many
+ kinds of pools. It may also be useful when constructing large data
+ structures that initially have a fixed number of fixed-sized nodes,
+ but the number is not known at compile time, and some of the nodes
+ may later need to be freed. For example:
+
+ struct Node { int item; struct Node* next; };
+
+ struct Node* build_list() {
+ struct Node** pool;
+ int n = read_number_of_nodes_needed();
+ if (n <= 0) return 0;
+ pool = (struct Node**)(independent_calloc(n, sizeof(struct Node), 0);
+ if (pool == 0) die();
+ // organize into a linked list...
+ struct Node* first = pool[0];
+ for (i = 0; i < n-1; ++i)
+ pool[i]->next = pool[i+1];
+ free(pool); // Can now free the array (or not, if it is needed later)
+ return first;
+ }
+*/
+void** dlindependent_calloc(size_t, size_t, void**);
+
+/*
+ independent_comalloc(size_t n_elements, size_t sizes[], void* chunks[]);
+
+ independent_comalloc allocates, all at once, a set of n_elements
+ chunks with sizes indicated in the "sizes" array. It returns
+ an array of pointers to these elements, each of which can be
+ independently freed, realloc'ed etc. The elements are guaranteed to
+ be adjacently allocated (this is not guaranteed to occur with
+ multiple callocs or mallocs), which may also improve cache locality
+ in some applications.
+
+ The "chunks" argument is optional (i.e., may be null). If it is null
+ the returned array is itself dynamically allocated and should also
+ be freed when it is no longer needed. Otherwise, the chunks array
+ must be of at least n_elements in length. It is filled in with the
+ pointers to the chunks.
+
+ In either case, independent_comalloc returns this pointer array, or
+ null if the allocation failed. If n_elements is zero and chunks is
+ null, it returns a chunk representing an array with zero elements
+ (which should be freed if not wanted).
+
+ Each element must be individually freed when it is no longer
+ needed. If you'd like to instead be able to free all at once, you
+ should instead use a single regular malloc, and assign pointers at
+ particular offsets in the aggregate space. (In this case though, you
+ cannot independently free elements.)
+
+ independent_comallac differs from independent_calloc in that each
+ element may have a different size, and also that it does not
+ automatically clear elements.
+
+ independent_comalloc can be used to speed up allocation in cases
+ where several structs or objects must always be allocated at the
+ same time. For example:
+
+ struct Head { ... }
+ struct Foot { ... }
+
+ void send_message(char* msg) {
+ int msglen = strlen(msg);
+ size_t sizes[3] = { sizeof(struct Head), msglen, sizeof(struct Foot) };
+ void* chunks[3];
+ if (independent_comalloc(3, sizes, chunks) == 0)
+ die();
+ struct Head* head = (struct Head*)(chunks[0]);
+ char* body = (char*)(chunks[1]);
+ struct Foot* foot = (struct Foot*)(chunks[2]);
+ // ...
+ }
+
+ In general though, independent_comalloc is worth using only for
+ larger values of n_elements. For small values, you probably won't
+ detect enough difference from series of malloc calls to bother.
+
+ Overuse of independent_comalloc can increase overall memory usage,
+ since it cannot reuse existing noncontiguous small chunks that
+ might be available for some of the elements.
+*/
+void** dlindependent_comalloc(size_t, size_t*, void**);
+
+
+/*
+ pvalloc(size_t n);
+ Equivalent to valloc(minimum-page-that-holds(n)), that is,
+ round up n to nearest pagesize.
+ */
+void* dlpvalloc(size_t);
+
+/*
+ malloc_trim(size_t pad);
+
+ If possible, gives memory back to the system (via negative arguments
+ to sbrk) if there is unused memory at the `high' end of the malloc
+ pool or in unused MMAP segments. You can call this after freeing
+ large blocks of memory to potentially reduce the system-level memory
+ requirements of a program. However, it cannot guarantee to reduce
+ memory. Under some allocation patterns, some large free blocks of
+ memory will be locked between two used chunks, so they cannot be
+ given back to the system.
+
+ The `pad' argument to malloc_trim represents the amount of free
+ trailing space to leave untrimmed. If this argument is zero, only
+ the minimum amount of memory to maintain internal data structures
+ will be left. Non-zero arguments can be supplied to maintain enough
+ trailing space to service future expected allocations without having
+ to re-obtain memory from the system.
+
+ Malloc_trim returns 1 if it actually released any memory, else 0.
+*/
+int dlmalloc_trim(size_t);
+
+/*
+ malloc_usable_size(void* p);
+
+ Returns the number of bytes you can actually use in
+ an allocated chunk, which may be more than you requested (although
+ often not) due to alignment and minimum size constraints.
+ You can use this many bytes without worrying about
+ overwriting other allocated objects. This is not a particularly great
+ programming practice. malloc_usable_size can be more useful in
+ debugging and assertions, for example:
+
+ p = malloc(n);
+ assert(malloc_usable_size(p) >= 256);
+*/
+size_t dlmalloc_usable_size(void*);
+
+/*
+ malloc_stats();
+ Prints on stderr the amount of space obtained from the system (both
+ via sbrk and mmap), the maximum amount (which may be more than
+ current if malloc_trim and/or munmap got called), and the current
+ number of bytes allocated via malloc (or realloc, etc) but not yet
+ freed. Note that this is the number of bytes allocated, not the
+ number requested. It will be larger than the number requested
+ because of alignment and bookkeeping overhead. Because it includes
+ alignment wastage as being in use, this figure may be greater than
+ zero even when no user-level chunks are allocated.
+
+ The reported current and maximum system memory can be inaccurate if
+ a program makes other calls to system memory allocation functions
+ (normally sbrk) outside of malloc.
+
+ malloc_stats prints only the most commonly interesting statistics.
+ More information can be obtained by calling mallinfo.
+*/
+void dlmalloc_stats(void);
+
+#endif /* ONLY_MSPACES */
+
+#if MSPACES
+
+/*
+ mspace is an opaque type representing an independent
+ region of space that supports mspace_malloc, etc.
+*/
+typedef void* mspace;
+
+/*
+ create_mspace creates and returns a new independent space with the
+ given initial capacity, or, if 0, the default granularity size. It
+ returns null if there is no system memory available to create the
+ space. If argument locked is non-zero, the space uses a separate
+ lock to control access. The capacity of the space will grow
+ dynamically as needed to service mspace_malloc requests. You can
+ control the sizes of incremental increases of this space by
+ compiling with a different DEFAULT_GRANULARITY or dynamically
+ setting with mallopt(M_GRANULARITY, value).
+*/
+mspace create_mspace(size_t capacity, int locked);
+
+/*
+ destroy_mspace destroys the given space, and attempts to return all
+ of its memory back to the system, returning the total number of
+ bytes freed. After destruction, the results of access to all memory
+ used by the space become undefined.
+*/
+size_t destroy_mspace(mspace msp);
+
+/*
+ create_mspace_with_base uses the memory supplied as the initial base
+ of a new mspace. Part (less than 128*sizeof(size_t) bytes) of this
+ space is used for bookkeeping, so the capacity must be at least this
+ large. (Otherwise 0 is returned.) When this initial space is
+ exhausted, additional memory will be obtained from the system.
+ Destroying this space will deallocate all additionally allocated
+ space (if possible) but not the initial base.
+*/
+mspace create_mspace_with_base(void* base, size_t capacity, int locked);
+
+/*
+ mspace_malloc behaves as malloc, but operates within
+ the given space.
+*/
+void* mspace_malloc(mspace msp, size_t bytes);
+
+/*
+ mspace_free behaves as free, but operates within
+ the given space.
+
+ If compiled with FOOTERS==1, mspace_free is not actually needed.
+ free may be called instead of mspace_free because freed chunks from
+ any space are handled by their originating spaces.
+*/
+void mspace_free(mspace msp, void* mem);
+
+/*
+ mspace_realloc behaves as realloc, but operates within
+ the given space.
+
+ If compiled with FOOTERS==1, mspace_realloc is not actually
+ needed. realloc may be called instead of mspace_realloc because
+ realloced chunks from any space are handled by their originating
+ spaces.
+*/
+void* mspace_realloc(mspace msp, void* mem, size_t newsize);
+
+/*
+ mspace_calloc behaves as calloc, but operates within
+ the given space.
+*/
+void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size);
+
+/*
+ mspace_memalign behaves as memalign, but operates within
+ the given space.
+*/
+void* mspace_memalign(mspace msp, size_t alignment, size_t bytes);
+
+/*
+ mspace_independent_calloc behaves as independent_calloc, but
+ operates within the given space.
+*/
+void** mspace_independent_calloc(mspace msp, size_t n_elements,
+ size_t elem_size, void* chunks[]);
+
+/*
+ mspace_independent_comalloc behaves as independent_comalloc, but
+ operates within the given space.
+*/
+void** mspace_independent_comalloc(mspace msp, size_t n_elements,
+ size_t sizes[], void* chunks[]);
+
+/*
+ mspace_footprint() returns the number of bytes obtained from the
+ system for this space.
+*/
+size_t mspace_footprint(mspace msp);
+
+/*
+ mspace_max_footprint() returns the peak number of bytes obtained from the
+ system for this space.
+*/
+size_t mspace_max_footprint(mspace msp);
+
+
+#if !NO_MALLINFO
+/*
+ mspace_mallinfo behaves as mallinfo, but reports properties of
+ the given space.
+*/
+struct mallinfo mspace_mallinfo(mspace msp);
+#endif /* NO_MALLINFO */
+
+/*
+ mspace_malloc_stats behaves as malloc_stats, but reports
+ properties of the given space.
+*/
+void mspace_malloc_stats(mspace msp);
+
+/*
+ mspace_trim behaves as malloc_trim, but
+ operates within the given space.
+*/
+int mspace_trim(mspace msp, size_t pad);
+
+/*
+ An alias for mallopt.
+*/
+int mspace_mallopt(int, int);
+
+#endif /* MSPACES */
+
+#ifdef __cplusplus
+}; /* end of extern "C" */
+#endif /* __cplusplus */
+
+/*
+ ========================================================================
+ To make a fully customizable malloc.h header file, cut everything
+ above this line, put into file malloc.h, edit to suit, and #include it
+ on the next line, as well as in programs that use this malloc.
+ ========================================================================
+*/
+
+/* #include "malloc.h" */
+
+/*------------------------------ internal #includes ---------------------- */
+
+#ifdef _MSC_VER
+#pragma warning( disable : 4146 ) /* no "unsigned" warnings */
+#endif /* _MSC_VER */
+
+#ifndef LACKS_STDIO_H
+#include <stdio.h> /* for printing in malloc_stats */
+#endif
+
+#ifndef LACKS_ERRNO_H
+#include <errno.h> /* for MALLOC_FAILURE_ACTION */
+#endif /* LACKS_ERRNO_H */
+#if FOOTERS
+#include <time.h> /* for magic initialization */
+#endif /* FOOTERS */
+#ifndef LACKS_STDLIB_H
+#include <stdlib.h> /* for abort() */
+#endif /* LACKS_STDLIB_H */
+#ifdef DEBUG
+#if ABORT_ON_ASSERT_FAILURE
+#define assert(x) if(!(x)) ABORT
+#else /* ABORT_ON_ASSERT_FAILURE */
+#include <assert.h>
+#endif /* ABORT_ON_ASSERT_FAILURE */
+#else /* DEBUG */
+#define assert(x)
+#endif /* DEBUG */
+#ifndef LACKS_STRING_H
+#include <string.h> /* for memset etc */
+#endif /* LACKS_STRING_H */
+#if USE_BUILTIN_FFS
+#ifndef LACKS_STRINGS_H
+#include <strings.h> /* for ffs */
+#endif /* LACKS_STRINGS_H */
+#endif /* USE_BUILTIN_FFS */
+#if HAVE_MMAP
+#ifndef LACKS_SYS_MMAN_H
+#include <sys/mman.h> /* for mmap */
+#endif /* LACKS_SYS_MMAN_H */
+#ifndef LACKS_FCNTL_H
+#include <fcntl.h>
+#endif /* LACKS_FCNTL_H */
+#endif /* HAVE_MMAP */
+#if HAVE_MORECORE
+#ifndef LACKS_UNISTD_H
+#include <unistd.h> /* for sbrk */
+#else /* LACKS_UNISTD_H */
+#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
+extern void* sbrk(ptrdiff_t);
+#endif /* FreeBSD etc */
+#endif /* LACKS_UNISTD_H */
+#endif /* HAVE_MMAP */
+
+#ifndef WIN32
+#ifndef malloc_getpagesize
+# ifdef _SC_PAGESIZE /* some SVR4 systems omit an underscore */
+# ifndef _SC_PAGE_SIZE
+# define _SC_PAGE_SIZE _SC_PAGESIZE
+# endif
+# endif
+# ifdef _SC_PAGE_SIZE
+# define malloc_getpagesize sysconf(_SC_PAGE_SIZE)
+# else
+# if defined(BSD) || defined(DGUX) || defined(HAVE_GETPAGESIZE)
+ extern size_t getpagesize();
+# define malloc_getpagesize getpagesize()
+# else
+# ifdef WIN32 /* use supplied emulation of getpagesize */
+# define malloc_getpagesize getpagesize()
+# else
+# ifndef LACKS_SYS_PARAM_H
+# include <sys/param.h>
+# endif
+# ifdef EXEC_PAGESIZE
+# define malloc_getpagesize EXEC_PAGESIZE
+# else
+# ifdef NBPG
+# ifndef CLSIZE
+# define malloc_getpagesize NBPG
+# else
+# define malloc_getpagesize (NBPG * CLSIZE)
+# endif
+# else
+# ifdef NBPC
+# define malloc_getpagesize NBPC
+# else
+# ifdef PAGESIZE
+# define malloc_getpagesize PAGESIZE
+# else /* just guess */
+# define malloc_getpagesize ((size_t)4096U)
+# endif
+# endif
+# endif
+# endif
+# endif
+# endif
+# endif
+#endif
+#endif
+
+/* ------------------- size_t and alignment properties -------------------- */
+
+/* The byte and bit size of a size_t */
+#define SIZE_T_SIZE (sizeof(size_t))
+#define SIZE_T_BITSIZE (sizeof(size_t) << 3)
+
+/* Some constants coerced to size_t */
+/* Annoying but necessary to avoid errors on some plaftorms */
+#define SIZE_T_ZERO ((size_t)0)
+#define SIZE_T_ONE ((size_t)1)
+#define SIZE_T_TWO ((size_t)2)
+#define TWO_SIZE_T_SIZES (SIZE_T_SIZE<<1)
+#define FOUR_SIZE_T_SIZES (SIZE_T_SIZE<<2)
+#define SIX_SIZE_T_SIZES (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES)
+#define HALF_MAX_SIZE_T (MAX_SIZE_T / 2U)
+
+/* The bit mask value corresponding to MALLOC_ALIGNMENT */
+#define CHUNK_ALIGN_MASK (MALLOC_ALIGNMENT - SIZE_T_ONE)
+
+/* True if address a has acceptable alignment */
+#define is_aligned(A) (((size_t)((A)) & (CHUNK_ALIGN_MASK)) == 0)
+
+/* the number of bytes to offset an address to align it */
+#define align_offset(A)\
+ ((((size_t)(A) & CHUNK_ALIGN_MASK) == 0)? 0 :\
+ ((MALLOC_ALIGNMENT - ((size_t)(A) & CHUNK_ALIGN_MASK)) & CHUNK_ALIGN_MASK))
+
+/* -------------------------- MMAP preliminaries ------------------------- */
+
+/*
+ If HAVE_MORECORE or HAVE_MMAP are false, we just define calls and
+ checks to fail so compiler optimizer can delete code rather than
+ using so many "#if"s.
+*/
+
+
+/* MORECORE and MMAP must return MFAIL on failure */
+#define MFAIL ((void*)(MAX_SIZE_T))
+#define CMFAIL ((char*)(MFAIL)) /* defined for convenience */
+
+#if !HAVE_MMAP
+#define IS_MMAPPED_BIT (SIZE_T_ZERO)
+#define USE_MMAP_BIT (SIZE_T_ZERO)
+#define CALL_MMAP(s) MFAIL
+#define CALL_MUNMAP(a, s) (-1)
+#define DIRECT_MMAP(s) MFAIL
+
+#else /* HAVE_MMAP */
+#define IS_MMAPPED_BIT (SIZE_T_ONE)
+#define USE_MMAP_BIT (SIZE_T_ONE)
+
+#ifndef WIN32
+#define CALL_MUNMAP(a, s) munmap((a), (s))
+#define MMAP_PROT (PROT_READ|PROT_WRITE)
+#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
+#define MAP_ANONYMOUS MAP_ANON
+#endif /* MAP_ANON */
+#ifdef MAP_ANONYMOUS
+#define MMAP_FLAGS (MAP_PRIVATE|MAP_ANONYMOUS)
+#define CALL_MMAP(s) mmap(0, (s), MMAP_PROT, MMAP_FLAGS, -1, 0)
+#else /* MAP_ANONYMOUS */
+/*
+ Nearly all versions of mmap support MAP_ANONYMOUS, so the following
+ is unlikely to be needed, but is supplied just in case.
+*/
+#define MMAP_FLAGS (MAP_PRIVATE)
+static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */
+#define CALL_MMAP(s) ((dev_zero_fd < 0) ? \
+ (dev_zero_fd = open("/dev/zero", O_RDWR), \
+ mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0)) : \
+ mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0))
+#endif /* MAP_ANONYMOUS */
+
+#define DIRECT_MMAP(s) CALL_MMAP(s)
+#else /* WIN32 */
+
+/* Win32 MMAP via VirtualAlloc */
+static void* win32mmap(size_t size) {
+ void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE);
+ return (ptr != 0)? ptr: MFAIL;
+}
+
+/* For direct MMAP, use MEM_TOP_DOWN to minimize interference */
+static void* win32direct_mmap(size_t size) {
+ void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN,
+ PAGE_READWRITE);
+ return (ptr != 0)? ptr: MFAIL;
+}
+
+/* This function supports releasing coalesed segments */
+static int win32munmap(void* ptr, size_t size) {
+ MEMORY_BASIC_INFORMATION minfo;
+ char* cptr = ptr;
+ while (size) {
+ if (VirtualQuery(cptr, &minfo, sizeof(minfo)) == 0)
+ return -1;
+ if (minfo.BaseAddress != cptr || minfo.AllocationBase != cptr ||
+ minfo.State != MEM_COMMIT || minfo.RegionSize > size)
+ return -1;
+ if (VirtualFree(cptr, 0, MEM_RELEASE) == 0)
+ return -1;
+ cptr += minfo.RegionSize;
+ size -= minfo.RegionSize;
+ }
+ return 0;
+}
+
+#define CALL_MMAP(s) win32mmap(s)
+#define CALL_MUNMAP(a, s) win32munmap((a), (s))
+#define DIRECT_MMAP(s) win32direct_mmap(s)
+#endif /* WIN32 */
+#endif /* HAVE_MMAP */
+
+#if HAVE_MMAP && HAVE_MREMAP
+#define CALL_MREMAP(addr, osz, nsz, mv) mremap((addr), (osz), (nsz), (mv))
+#else /* HAVE_MMAP && HAVE_MREMAP */
+#define CALL_MREMAP(addr, osz, nsz, mv) MFAIL
+#endif /* HAVE_MMAP && HAVE_MREMAP */
+
+#if HAVE_MORECORE
+#define CALL_MORECORE(S) MORECORE(S)
+#else /* HAVE_MORECORE */
+#define CALL_MORECORE(S) MFAIL
+#endif /* HAVE_MORECORE */
+
+/* mstate bit set if continguous morecore disabled or failed */
+#define USE_NONCONTIGUOUS_BIT (4U)
+
+/* segment bit set in create_mspace_with_base */
+#define EXTERN_BIT (8U)
+
+
+/* --------------------------- Lock preliminaries ------------------------ */
+
+#if USE_LOCKS
+
+/*
+ When locks are defined, there are up to two global locks:
+
+ * If HAVE_MORECORE, morecore_mutex protects sequences of calls to
+ MORECORE. In many cases sys_alloc requires two calls, that should
+ not be interleaved with calls by other threads. This does not
+ protect against direct calls to MORECORE by other threads not
+ using this lock, so there is still code to cope the best we can on
+ interference.
+
+ * magic_init_mutex ensures that mparams.magic and other
+ unique mparams values are initialized only once.
+*/
+
+#ifndef WIN32
+/* By default use posix locks */
+#include <pthread.h>
+#define MLOCK_T pthread_mutex_t
+#define INITIAL_LOCK(l) pthread_mutex_init(l, NULL)
+#define ACQUIRE_LOCK(l) pthread_mutex_lock(l)
+#define RELEASE_LOCK(l) pthread_mutex_unlock(l)
+
+#if HAVE_MORECORE
+static MLOCK_T morecore_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif /* HAVE_MORECORE */
+
+static MLOCK_T magic_init_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+#else /* WIN32 */
+/*
+ Because lock-protected regions have bounded times, and there
+ are no recursive lock calls, we can use simple spinlocks.
+*/
+
+#define MLOCK_T long
+static int win32_acquire_lock (MLOCK_T *sl) {
+ for (;;) {
+#ifdef InterlockedCompareExchangePointer
+ if (!InterlockedCompareExchange(sl, 1, 0))
+ return 0;
+#else /* Use older void* version */
+ if (!InterlockedCompareExchange((void**)sl, (void*)1, (void*)0))
+ return 0;
+#endif /* InterlockedCompareExchangePointer */
+ Sleep (0);
+ }
+}
+
+static void win32_release_lock (MLOCK_T *sl) {
+ InterlockedExchange (sl, 0);
+}
+
+#define INITIAL_LOCK(l) *(l)=0
+#define ACQUIRE_LOCK(l) win32_acquire_lock(l)
+#define RELEASE_LOCK(l) win32_release_lock(l)
+#if HAVE_MORECORE
+static MLOCK_T morecore_mutex;
+#endif /* HAVE_MORECORE */
+static MLOCK_T magic_init_mutex;
+#endif /* WIN32 */
+
+#define USE_LOCK_BIT (2U)
+#else /* USE_LOCKS */
+#define USE_LOCK_BIT (0U)
+#define INITIAL_LOCK(l)
+#endif /* USE_LOCKS */
+
+#if USE_LOCKS && HAVE_MORECORE
+#define ACQUIRE_MORECORE_LOCK() ACQUIRE_LOCK(&morecore_mutex);
+#define RELEASE_MORECORE_LOCK() RELEASE_LOCK(&morecore_mutex);
+#else /* USE_LOCKS && HAVE_MORECORE */
+#define ACQUIRE_MORECORE_LOCK()
+#define RELEASE_MORECORE_LOCK()
+#endif /* USE_LOCKS && HAVE_MORECORE */
+
+#if USE_LOCKS
+#define ACQUIRE_MAGIC_INIT_LOCK() ACQUIRE_LOCK(&magic_init_mutex);
+#define RELEASE_MAGIC_INIT_LOCK() RELEASE_LOCK(&magic_init_mutex);
+#else /* USE_LOCKS */
+#define ACQUIRE_MAGIC_INIT_LOCK()
+#define RELEASE_MAGIC_INIT_LOCK()
+#endif /* USE_LOCKS */
+
+
+/* ----------------------- Chunk representations ------------------------ */
+
+/*
+ (The following includes lightly edited explanations by Colin Plumb.)
+
+ The malloc_chunk declaration below is misleading (but accurate and
+ necessary). It declares a "view" into memory allowing access to
+ necessary fields at known offsets from a given base.
+
+ Chunks of memory are maintained using a `boundary tag' method as
+ originally described by Knuth. (See the paper by Paul Wilson
+ ftp://ftp.cs.utexas.edu/pub/garbage/allocsrv.ps for a survey of such
+ techniques.) Sizes of free chunks are stored both in the front of
+ each chunk and at the end. This makes consolidating fragmented
+ chunks into bigger chunks fast. The head fields also hold bits
+ representing whether chunks are free or in use.
+
+ Here are some pictures to make it clearer. They are "exploded" to
+ show that the state of a chunk can be thought of as extending from
+ the high 31 bits of the head field of its header through the
+ prev_foot and PINUSE_BIT bit of the following chunk header.
+
+ A chunk that's in use looks like:
+
+ chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Size of previous chunk (if P = 1) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P|
+ | Size of this chunk 1| +-+
+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | |
+ +- -+
+ | |
+ +- -+
+ | :
+ +- size - sizeof(size_t) available payload bytes -+
+ : |
+ chunk-> +- -+
+ | |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |1|
+ | Size of next chunk (may or may not be in use) | +-+
+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ And if it's free, it looks like this:
+
+ chunk-> +- -+
+ | User payload (must be in use, or we would have merged!) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P|
+ | Size of this chunk 0| +-+
+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Next pointer |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Prev pointer |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | :
+ +- size - sizeof(struct chunk) unused bytes -+
+ : |
+ chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Size of this chunk |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0|
+ | Size of next chunk (must be in use, or we would have merged)| +-+
+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | :
+ +- User payload -+
+ : |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ |0|
+ +-+
+ Note that since we always merge adjacent free chunks, the chunks
+ adjacent to a free chunk must be in use.
+
+ Given a pointer to a chunk (which can be derived trivially from the
+ payload pointer) we can, in O(1) time, find out whether the adjacent
+ chunks are free, and if so, unlink them from the lists that they
+ are on and merge them with the current chunk.
+
+ Chunks always begin on even word boundaries, so the mem portion
+ (which is returned to the user) is also on an even word boundary, and
+ thus at least double-word aligned.
+
+ The P (PINUSE_BIT) bit, stored in the unused low-order bit of the
+ chunk size (which is always a multiple of two words), is an in-use
+ bit for the *previous* chunk. If that bit is *clear*, then the
+ word before the current chunk size contains the previous chunk
+ size, and can be used to find the front of the previous chunk.
+ The very first chunk allocated always has this bit set, preventing
+ access to non-existent (or non-owned) memory. If pinuse is set for
+ any given chunk, then you CANNOT determine the size of the
+ previous chunk, and might even get a memory addressing fault when
+ trying to do so.
+
+ The C (CINUSE_BIT) bit, stored in the unused second-lowest bit of
+ the chunk size redundantly records whether the current chunk is
+ inuse. This redundancy enables usage checks within free and realloc,
+ and reduces indirection when freeing and consolidating chunks.
+
+ Each freshly allocated chunk must have both cinuse and pinuse set.
+ That is, each allocated chunk borders either a previously allocated
+ and still in-use chunk, or the base of its memory arena. This is
+ ensured by making all allocations from the the `lowest' part of any
+ found chunk. Further, no free chunk physically borders another one,
+ so each free chunk is known to be preceded and followed by either
+ inuse chunks or the ends of memory.
+
+ Note that the `foot' of the current chunk is actually represented
+ as the prev_foot of the NEXT chunk. This makes it easier to
+ deal with alignments etc but can be very confusing when trying
+ to extend or adapt this code.
+
+ The exceptions to all this are
+
+ 1. The special chunk `top' is the top-most available chunk (i.e.,
+ the one bordering the end of available memory). It is treated
+ specially. Top is never included in any bin, is used only if
+ no other chunk is available, and is released back to the
+ system if it is very large (see M_TRIM_THRESHOLD). In effect,
+ the top chunk is treated as larger (and thus less well
+ fitting) than any other available chunk. The top chunk
+ doesn't update its trailing size field since there is no next
+ contiguous chunk that would have to index off it. However,
+ space is still allocated for it (TOP_FOOT_SIZE) to enable
+ separation or merging when space is extended.
+
+ 3. Chunks allocated via mmap, which have the lowest-order bit
+ (IS_MMAPPED_BIT) set in their prev_foot fields, and do not set
+ PINUSE_BIT in their head fields. Because they are allocated
+ one-by-one, each must carry its own prev_foot field, which is
+ also used to hold the offset this chunk has within its mmapped
+ region, which is needed to preserve alignment. Each mmapped
+ chunk is trailed by the first two fields of a fake next-chunk
+ for sake of usage checks.
+
+*/
+
+struct malloc_chunk {
+ size_t prev_foot; /* Size of previous chunk (if free). */
+ size_t head; /* Size and inuse bits. */
+ struct malloc_chunk* fd; /* double links -- used only if free. */
+ struct malloc_chunk* bk;
+};
+
+typedef struct malloc_chunk mchunk;
+typedef struct malloc_chunk* mchunkptr;
+typedef struct malloc_chunk* sbinptr; /* The type of bins of chunks */
+typedef size_t bindex_t; /* Described below */
+typedef unsigned int binmap_t; /* Described below */
+typedef unsigned int flag_t; /* The type of various bit flag sets */
+
+/* ------------------- Chunks sizes and alignments ----------------------- */
+
+#define MCHUNK_SIZE (sizeof(mchunk))
+
+#if FOOTERS
+#define CHUNK_OVERHEAD (TWO_SIZE_T_SIZES)
+#else /* FOOTERS */
+#define CHUNK_OVERHEAD (SIZE_T_SIZE)
+#endif /* FOOTERS */
+
+/* MMapped chunks need a second word of overhead ... */
+#define MMAP_CHUNK_OVERHEAD (TWO_SIZE_T_SIZES)
+/* ... and additional padding for fake next-chunk at foot */
+#define MMAP_FOOT_PAD (FOUR_SIZE_T_SIZES)
+
+/* The smallest size we can malloc is an aligned minimal chunk */
+#define MIN_CHUNK_SIZE\
+ ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK)
+
+/* conversion from malloc headers to user pointers, and back */
+#define chunk2mem(p) ((void*)((char*)(p) + TWO_SIZE_T_SIZES))
+#define mem2chunk(mem) ((mchunkptr)((char*)(mem) - TWO_SIZE_T_SIZES))
+/* chunk associated with aligned address A */
+#define align_as_chunk(A) (mchunkptr)((A) + align_offset(chunk2mem(A)))
+
+/* Bounds on request (not chunk) sizes. */
+#define MAX_REQUEST ((-MIN_CHUNK_SIZE) << 2)
+#define MIN_REQUEST (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE)
+
+/* pad request bytes into a usable size */
+#define pad_request(req) \
+ (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK)
+
+/* pad request, checking for minimum (but not maximum) */
+#define request2size(req) \
+ (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req))
+
+
+/* ------------------ Operations on head and foot fields ----------------- */
+
+/*
+ The head field of a chunk is or'ed with PINUSE_BIT when previous
+ adjacent chunk in use, and or'ed with CINUSE_BIT if this chunk is in
+ use. If the chunk was obtained with mmap, the prev_foot field has
+ IS_MMAPPED_BIT set, otherwise holding the offset of the base of the
+ mmapped region to the base of the chunk.
+*/
+
+#define PINUSE_BIT (SIZE_T_ONE)
+#define CINUSE_BIT (SIZE_T_TWO)
+#define INUSE_BITS (PINUSE_BIT|CINUSE_BIT)
+
+/* Head value for fenceposts */
+#define FENCEPOST_HEAD (INUSE_BITS|SIZE_T_SIZE)
+
+/* extraction of fields from head words */
+#define cinuse(p) ((p)->head & CINUSE_BIT)
+#define pinuse(p) ((p)->head & PINUSE_BIT)
+#define chunksize(p) ((p)->head & ~(INUSE_BITS))
+
+#define clear_pinuse(p) ((p)->head &= ~PINUSE_BIT)
+#define clear_cinuse(p) ((p)->head &= ~CINUSE_BIT)
+
+/* Treat space at ptr +/- offset as a chunk */
+#define chunk_plus_offset(p, s) ((mchunkptr)(((char*)(p)) + (s)))
+#define chunk_minus_offset(p, s) ((mchunkptr)(((char*)(p)) - (s)))
+
+/* Ptr to next or previous physical malloc_chunk. */
+#define next_chunk(p) ((mchunkptr)( ((char*)(p)) + ((p)->head & ~INUSE_BITS)))
+#define prev_chunk(p) ((mchunkptr)( ((char*)(p)) - ((p)->prev_foot) ))
+
+/* extract next chunk's pinuse bit */
+#define next_pinuse(p) ((next_chunk(p)->head) & PINUSE_BIT)
+
+/* Get/set size at footer */
+#define get_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot)
+#define set_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot = (s))
+
+/* Set size, pinuse bit, and foot */
+#define set_size_and_pinuse_of_free_chunk(p, s)\
+ ((p)->head = (s|PINUSE_BIT), set_foot(p, s))
+
+/* Set size, pinuse bit, foot, and clear next pinuse */
+#define set_free_with_pinuse(p, s, n)\
+ (clear_pinuse(n), set_size_and_pinuse_of_free_chunk(p, s))
+
+#define is_mmapped(p)\
+ (!((p)->head & PINUSE_BIT) && ((p)->prev_foot & IS_MMAPPED_BIT))
+
+/* Get the internal overhead associated with chunk p */
+#define overhead_for(p)\
+ (is_mmapped(p)? MMAP_CHUNK_OVERHEAD : CHUNK_OVERHEAD)
+
+/* Return true if malloced space is not necessarily cleared */
+#if MMAP_CLEARS
+#define calloc_must_clear(p) (!is_mmapped(p))
+#else /* MMAP_CLEARS */
+#define calloc_must_clear(p) (1)
+#endif /* MMAP_CLEARS */
+
+/* ---------------------- Overlaid data structures ----------------------- */
+
+/*
+ When chunks are not in use, they are treated as nodes of either
+ lists or trees.
+
+ "Small" chunks are stored in circular doubly-linked lists, and look
+ like this:
+
+ chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Size of previous chunk |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ `head:' | Size of chunk, in bytes |P|
+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Forward pointer to next chunk in list |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Back pointer to previous chunk in list |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Unused space (may be 0 bytes long) .
+ . .
+ . |
+nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ `foot:' | Size of chunk, in bytes |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Larger chunks are kept in a form of bitwise digital trees (aka
+ tries) keyed on chunksizes. Because malloc_tree_chunks are only for
+ free chunks greater than 256 bytes, their size doesn't impose any
+ constraints on user chunk sizes. Each node looks like:
+
+ chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Size of previous chunk |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ `head:' | Size of chunk, in bytes |P|
+ mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Forward pointer to next chunk of same size |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Back pointer to previous chunk of same size |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Pointer to left child (child[0]) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Pointer to right child (child[1]) |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Pointer to parent |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | bin index of this chunk |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ | Unused space .
+ . |
+nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ `foot:' | Size of chunk, in bytes |
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
+ Each tree holding treenodes is a tree of unique chunk sizes. Chunks
+ of the same size are arranged in a circularly-linked list, with only
+ the oldest chunk (the next to be used, in our FIFO ordering)
+ actually in the tree. (Tree members are distinguished by a non-null
+ parent pointer.) If a chunk with the same size an an existing node
+ is inserted, it is linked off the existing node using pointers that
+ work in the same way as fd/bk pointers of small chunks.
+
+ Each tree contains a power of 2 sized range of chunk sizes (the
+ smallest is 0x100 <= x < 0x180), which is is divided in half at each
+ tree level, with the chunks in the smaller half of the range (0x100
+ <= x < 0x140 for the top nose) in the left subtree and the larger
+ half (0x140 <= x < 0x180) in the right subtree. This is, of course,
+ done by inspecting individual bits.
+
+ Using these rules, each node's left subtree contains all smaller
+ sizes than its right subtree. However, the node at the root of each
+ subtree has no particular ordering relationship to either. (The
+ dividing line between the subtree sizes is based on trie relation.)
+ If we remove the last chunk of a given size from the interior of the
+ tree, we need to replace it with a leaf node. The tree ordering
+ rules permit a node to be replaced by any leaf below it.
+
+ The smallest chunk in a tree (a common operation in a best-fit
+ allocator) can be found by walking a path to the leftmost leaf in
+ the tree. Unlike a usual binary tree, where we follow left child
+ pointers until we reach a null, here we follow the right child
+ pointer any time the left one is null, until we reach a leaf with
+ both child pointers null. The smallest chunk in the tree will be
+ somewhere along that path.
+
+ The worst case number of steps to add, find, or remove a node is
+ bounded by the number of bits differentiating chunks within
+ bins. Under current bin calculations, this ranges from 6 up to 21
+ (for 32 bit sizes) or up to 53 (for 64 bit sizes). The typical case
+ is of course much better.
+*/
+
+struct malloc_tree_chunk {
+ /* The first four fields must be compatible with malloc_chunk */
+ size_t prev_foot;
+ size_t head;
+ struct malloc_tree_chunk* fd;
+ struct malloc_tree_chunk* bk;
+
+ struct malloc_tree_chunk* child[2];
+ struct malloc_tree_chunk* parent;
+ bindex_t index;
+};
+
+typedef struct malloc_tree_chunk tchunk;
+typedef struct malloc_tree_chunk* tchunkptr;
+typedef struct malloc_tree_chunk* tbinptr; /* The type of bins of trees */
+
+/* A little helper macro for trees */
+#define leftmost_child(t) ((t)->child[0] != 0? (t)->child[0] : (t)->child[1])
+
+/* ----------------------------- Segments -------------------------------- */
+
+/*
+ Each malloc space may include non-contiguous segments, held in a
+ list headed by an embedded malloc_segment record representing the
+ top-most space. Segments also include flags holding properties of
+ the space. Large chunks that are directly allocated by mmap are not
+ included in this list. They are instead independently created and
+ destroyed without otherwise keeping track of them.
+
+ Segment management mainly comes into play for spaces allocated by
+ MMAP. Any call to MMAP might or might not return memory that is
+ adjacent to an existing segment. MORECORE normally contiguously
+ extends the current space, so this space is almost always adjacent,
+ which is simpler and faster to deal with. (This is why MORECORE is
+ used preferentially to MMAP when both are available -- see
+ sys_alloc.) When allocating using MMAP, we don't use any of the
+ hinting mechanisms (inconsistently) supported in various
+ implementations of unix mmap, or distinguish reserving from
+ committing memory. Instead, we just ask for space, and exploit
+ contiguity when we get it. It is probably possible to do
+ better than this on some systems, but no general scheme seems
+ to be significantly better.
+
+ Management entails a simpler variant of the consolidation scheme
+ used for chunks to reduce fragmentation -- new adjacent memory is
+ normally prepended or appended to an existing segment. However,
+ there are limitations compared to chunk consolidation that mostly
+ reflect the fact that segment processing is relatively infrequent
+ (occurring only when getting memory from system) and that we
+ don't expect to have huge numbers of segments:
+
+ * Segments are not indexed, so traversal requires linear scans. (It
+ would be possible to index these, but is not worth the extra
+ overhead and complexity for most programs on most platforms.)
+ * New segments are only appended to old ones when holding top-most
+ memory; if they cannot be prepended to others, they are held in
+ different segments.
+
+ Except for the top-most segment of an mstate, each segment record
+ is kept at the tail of its segment. Segments are added by pushing
+ segment records onto the list headed by &mstate.seg for the
+ containing mstate.
+
+ Segment flags control allocation/merge/deallocation policies:
+ * If EXTERN_BIT set, then we did not allocate this segment,
+ and so should not try to deallocate or merge with others.
+ (This currently holds only for the initial segment passed
+ into create_mspace_with_base.)
+ * If IS_MMAPPED_BIT set, the segment may be merged with
+ other surrounding mmapped segments and trimmed/de-allocated
+ using munmap.
+ * If neither bit is set, then the segment was obtained using
+ MORECORE so can be merged with surrounding MORECORE'd segments
+ and deallocated/trimmed using MORECORE with negative arguments.
+*/
+
+struct malloc_segment {
+ char* base; /* base address */
+ size_t size; /* allocated size */
+ struct malloc_segment* next; /* ptr to next segment */
+ flag_t sflags; /* mmap and extern flag */
+};
+
+#define is_mmapped_segment(S) ((S)->sflags & IS_MMAPPED_BIT)
+#define is_extern_segment(S) ((S)->sflags & EXTERN_BIT)
+
+typedef struct malloc_segment msegment;
+typedef struct malloc_segment* msegmentptr;
+
+/* ---------------------------- malloc_state ----------------------------- */
+
+/*
+ A malloc_state holds all of the bookkeeping for a space.
+ The main fields are:
+
+ Top
+ The topmost chunk of the currently active segment. Its size is
+ cached in topsize. The actual size of topmost space is
+ topsize+TOP_FOOT_SIZE, which includes space reserved for adding
+ fenceposts and segment records if necessary when getting more
+ space from the system. The size at which to autotrim top is
+ cached from mparams in trim_check, except that it is disabled if
+ an autotrim fails.
+
+ Designated victim (dv)
+ This is the preferred chunk for servicing small requests that
+ don't have exact fits. It is normally the chunk split off most
+ recently to service another small request. Its size is cached in
+ dvsize. The link fields of this chunk are not maintained since it
+ is not kept in a bin.
+
+ SmallBins
+ An array of bin headers for free chunks. These bins hold chunks
+ with sizes less than MIN_LARGE_SIZE bytes. Each bin contains
+ chunks of all the same size, spaced 8 bytes apart. To simplify
+ use in double-linked lists, each bin header acts as a malloc_chunk
+ pointing to the real first node, if it exists (else pointing to
+ itself). This avoids special-casing for headers. But to avoid
+ waste, we allocate only the fd/bk pointers of bins, and then use
+ repositioning tricks to treat these as the fields of a chunk.
+
+ TreeBins
+ Treebins are pointers to the roots of trees holding a range of
+ sizes. There are 2 equally spaced treebins for each power of two
+ from TREE_SHIFT to TREE_SHIFT+16. The last bin holds anything
+ larger.
+
+ Bin maps
+ There is one bit map for small bins ("smallmap") and one for
+ treebins ("treemap). Each bin sets its bit when non-empty, and
+ clears the bit when empty. Bit operations are then used to avoid
+ bin-by-bin searching -- nearly all "search" is done without ever
+ looking at bins that won't be selected. The bit maps
+ conservatively use 32 bits per map word, even if on 64bit system.
+ For a good description of some of the bit-based techniques used
+ here, see Henry S. Warren Jr's book "Hacker's Delight" (and
+ supplement at http://hackersdelight.org/). Many of these are
+ intended to reduce the branchiness of paths through malloc etc, as
+ well as to reduce the number of memory locations read or written.
+
+ Segments
+ A list of segments headed by an embedded malloc_segment record
+ representing the initial space.
+
+ Address check support
+ The least_addr field is the least address ever obtained from
+ MORECORE or MMAP. Attempted frees and reallocs of any address less
+ than this are trapped (unless INSECURE is defined).
+
+ Magic tag
+ A cross-check field that should always hold same value as mparams.magic.
+
+ Flags
+ Bits recording whether to use MMAP, locks, or contiguous MORECORE
+
+ Statistics
+ Each space keeps track of current and maximum system memory
+ obtained via MORECORE or MMAP.
+
+ Locking
+ If USE_LOCKS is defined, the "mutex" lock is acquired and released
+ around every public call using this mspace.
+*/
+
+/* Bin types, widths and sizes */
+#define NSMALLBINS (32U)
+#define NTREEBINS (32U)
+#define SMALLBIN_SHIFT (3U)
+#define SMALLBIN_WIDTH (SIZE_T_ONE << SMALLBIN_SHIFT)
+#define TREEBIN_SHIFT (8U)
+#define MIN_LARGE_SIZE (SIZE_T_ONE << TREEBIN_SHIFT)
+#define MAX_SMALL_SIZE (MIN_LARGE_SIZE - SIZE_T_ONE)
+#define MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD)
+
+struct malloc_state {
+ binmap_t smallmap;
+ binmap_t treemap;
+ size_t dvsize;
+ size_t topsize;
+ char* least_addr;
+ mchunkptr dv;
+ mchunkptr top;
+ size_t trim_check;
+ size_t magic;
+ mchunkptr smallbins[(NSMALLBINS+1)*2];
+ tbinptr treebins[NTREEBINS];
+ size_t footprint;
+ size_t max_footprint;
+ flag_t mflags;
+#if USE_LOCKS
+ MLOCK_T mutex; /* locate lock among fields that rarely change */
+#endif /* USE_LOCKS */
+ msegment seg;
+};
+
+typedef struct malloc_state* mstate;
+
+/* ------------- Global malloc_state and malloc_params ------------------- */
+
+/*
+ malloc_params holds global properties, including those that can be
+ dynamically set using mallopt. There is a single instance, mparams,
+ initialized in init_mparams.
+*/
+
+struct malloc_params {
+ size_t magic;
+ size_t page_size;
+ size_t granularity;
+ size_t mmap_threshold;
+ size_t trim_threshold;
+ flag_t default_mflags;
+};
+
+static struct malloc_params mparams;
+
+/* The global malloc_state used for all non-"mspace" calls */
+static struct malloc_state _gm_;
+#define gm (&_gm_)
+#define is_global(M) ((M) == &_gm_)
+#define is_initialized(M) ((M)->top != 0)
+
+/* -------------------------- system alloc setup ------------------------- */
+
+/* Operations on mflags */
+
+#define use_lock(M) ((M)->mflags & USE_LOCK_BIT)
+#define enable_lock(M) ((M)->mflags |= USE_LOCK_BIT)
+#define disable_lock(M) ((M)->mflags &= ~USE_LOCK_BIT)
+
+#define use_mmap(M) ((M)->mflags & USE_MMAP_BIT)
+#define enable_mmap(M) ((M)->mflags |= USE_MMAP_BIT)
+#define disable_mmap(M) ((M)->mflags &= ~USE_MMAP_BIT)
+
+#define use_noncontiguous(M) ((M)->mflags & USE_NONCONTIGUOUS_BIT)
+#define disable_contiguous(M) ((M)->mflags |= USE_NONCONTIGUOUS_BIT)
+
+#define set_lock(M,L)\
+ ((M)->mflags = (L)?\
+ ((M)->mflags | USE_LOCK_BIT) :\
+ ((M)->mflags & ~USE_LOCK_BIT))
+
+/* page-align a size */
+#define page_align(S)\
+ (((S) + (mparams.page_size)) & ~(mparams.page_size - SIZE_T_ONE))
+
+/* granularity-align a size */
+#define granularity_align(S)\
+ (((S) + (mparams.granularity)) & ~(mparams.granularity - SIZE_T_ONE))
+
+#define is_page_aligned(S)\
+ (((size_t)(S) & (mparams.page_size - SIZE_T_ONE)) == 0)
+#define is_granularity_aligned(S)\
+ (((size_t)(S) & (mparams.granularity - SIZE_T_ONE)) == 0)
+
+/* True if segment S holds address A */
+#define segment_holds(S, A)\
+ ((char*)(A) >= S->base && (char*)(A) < S->base + S->size)
+
+/* Return segment holding given address */
+static msegmentptr segment_holding(mstate m, char* addr) {
+ msegmentptr sp = &m->seg;
+ for (;;) {
+ if (addr >= sp->base && addr < sp->base + sp->size)
+ return sp;
+ if ((sp = sp->next) == 0)
+ return 0;
+ }
+}
+
+/* Return true if segment contains a segment link */
+static int has_segment_link(mstate m, msegmentptr ss) {
+ msegmentptr sp = &m->seg;
+ for (;;) {
+ if ((char*)sp >= ss->base && (char*)sp < ss->base + ss->size)
+ return 1;
+ if ((sp = sp->next) == 0)
+ return 0;
+ }
+}
+
+#ifndef MORECORE_CANNOT_TRIM
+#define should_trim(M,s) ((s) > (M)->trim_check)
+#else /* MORECORE_CANNOT_TRIM */
+#define should_trim(M,s) (0)
+#endif /* MORECORE_CANNOT_TRIM */
+
+/*
+ TOP_FOOT_SIZE is padding at the end of a segment, including space
+ that may be needed to place segment records and fenceposts when new
+ noncontiguous segments are added.
+*/
+#define TOP_FOOT_SIZE\
+ (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE)
+
+
+/* ------------------------------- Hooks -------------------------------- */
+
+/*
+ PREACTION should be defined to return 0 on success, and nonzero on
+ failure. If you are not using locking, you can redefine these to do
+ anything you like.
+*/
+
+#if USE_LOCKS
+
+/* Ensure locks are initialized */
+#define GLOBALLY_INITIALIZE() (mparams.page_size == 0 && init_mparams())
+
+#define PREACTION(M) ((GLOBALLY_INITIALIZE() || use_lock(M))? ACQUIRE_LOCK(&(M)->mutex) : 0)
+#define POSTACTION(M) { if (use_lock(M)) RELEASE_LOCK(&(M)->mutex); }
+#else /* USE_LOCKS */
+
+#ifndef PREACTION
+#define PREACTION(M) (0)
+#endif /* PREACTION */
+
+#ifndef POSTACTION
+#define POSTACTION(M)
+#endif /* POSTACTION */
+
+#endif /* USE_LOCKS */
+
+/*
+ CORRUPTION_ERROR_ACTION is triggered upon detected bad addresses.
+ USAGE_ERROR_ACTION is triggered on detected bad frees and
+ reallocs. The argument p is an address that might have triggered the
+ fault. It is ignored by the two predefined actions, but might be
+ useful in custom actions that try to help diagnose errors.
+*/
+
+#if PROCEED_ON_ERROR
+
+/* A count of the number of corruption errors causing resets */
+int malloc_corruption_error_count;
+
+/* default corruption action */
+static void reset_on_error(mstate m);
+
+#define CORRUPTION_ERROR_ACTION(m) reset_on_error(m)
+#define USAGE_ERROR_ACTION(m, p)
+
+#else /* PROCEED_ON_ERROR */
+
+#ifndef CORRUPTION_ERROR_ACTION
+#define CORRUPTION_ERROR_ACTION(m) ABORT
+#endif /* CORRUPTION_ERROR_ACTION */
+
+#ifndef USAGE_ERROR_ACTION
+#define USAGE_ERROR_ACTION(m,p) ABORT
+#endif /* USAGE_ERROR_ACTION */
+
+#endif /* PROCEED_ON_ERROR */
+
+/* -------------------------- Debugging setup ---------------------------- */
+
+#if ! DEBUG
+
+#define check_free_chunk(M,P)
+#define check_inuse_chunk(M,P)
+#define check_malloced_chunk(M,P,N)
+#define check_mmapped_chunk(M,P)
+#define check_malloc_state(M)
+#define check_top_chunk(M,P)
+
+#else /* DEBUG */
+#define check_free_chunk(M,P) do_check_free_chunk(M,P)
+#define check_inuse_chunk(M,P) do_check_inuse_chunk(M,P)
+#define check_top_chunk(M,P) do_check_top_chunk(M,P)
+#define check_malloced_chunk(M,P,N) do_check_malloced_chunk(M,P,N)
+#define check_mmapped_chunk(M,P) do_check_mmapped_chunk(M,P)
+#define check_malloc_state(M) do_check_malloc_state(M)
+
+static void do_check_any_chunk(mstate m, mchunkptr p);
+static void do_check_top_chunk(mstate m, mchunkptr p);
+static void do_check_mmapped_chunk(mstate m, mchunkptr p);
+static void do_check_inuse_chunk(mstate m, mchunkptr p);
+static void do_check_free_chunk(mstate m, mchunkptr p);
+static void do_check_malloced_chunk(mstate m, void* mem, size_t s);
+static void do_check_tree(mstate m, tchunkptr t);
+static void do_check_treebin(mstate m, bindex_t i);
+static void do_check_smallbin(mstate m, bindex_t i);
+static void do_check_malloc_state(mstate m);
+static int bin_find(mstate m, mchunkptr x);
+static size_t traverse_and_check(mstate m);
+#endif /* DEBUG */
+
+/* ---------------------------- Indexing Bins ---------------------------- */
+
+#define is_small(s) (((s) >> SMALLBIN_SHIFT) < NSMALLBINS)
+#define small_index(s) ((s) >> SMALLBIN_SHIFT)
+#define small_index2size(i) ((i) << SMALLBIN_SHIFT)
+#define MIN_SMALL_INDEX (small_index(MIN_CHUNK_SIZE))
+
+/* addressing by index. See above about smallbin repositioning */
+#define smallbin_at(M, i) ((sbinptr)((char*)&((M)->smallbins[(i)<<1])))
+#define treebin_at(M,i) (&((M)->treebins[i]))
+
+/* assign tree index for size S to variable I */
+#if defined(__GNUC__) && defined(i386)
+#define compute_tree_index(S, I)\
+{\
+ size_t X = S >> TREEBIN_SHIFT;\
+ if (X == 0)\
+ I = 0;\
+ else if (X > 0xFFFF)\
+ I = NTREEBINS-1;\
+ else {\
+ unsigned int K;\
+ __asm__("bsrl %1,%0\n\t" : "=r" (K) : "rm" (X));\
+ I = (bindex_t)((K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1)));\
+ }\
+}
+#else /* GNUC */
+#define compute_tree_index(S, I)\
+{\
+ size_t X = S >> TREEBIN_SHIFT;\
+ if (X == 0)\
+ I = 0;\
+ else if (X > 0xFFFF)\
+ I = NTREEBINS-1;\
+ else {\
+ unsigned int Y = (unsigned int)X;\
+ unsigned int N = ((Y - 0x100) >> 16) & 8;\
+ unsigned int K = (((Y <<= N) - 0x1000) >> 16) & 4;\
+ N += K;\
+ N += K = (((Y <<= K) - 0x4000) >> 16) & 2;\
+ K = 14 - N + ((Y <<= K) >> 15);\
+ I = (K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1));\
+ }\
+}
+#endif /* GNUC */
+
+/* Bit representing maximum resolved size in a treebin at i */
+#define bit_for_tree_index(i) \
+ (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2)
+
+/* Shift placing maximum resolved bit in a treebin at i as sign bit */
+#define leftshift_for_tree_index(i) \
+ ((i == NTREEBINS-1)? 0 : \
+ ((SIZE_T_BITSIZE-SIZE_T_ONE) - (((i) >> 1) + TREEBIN_SHIFT - 2)))
+
+/* The size of the smallest chunk held in bin with index i */
+#define minsize_for_tree_index(i) \
+ ((SIZE_T_ONE << (((i) >> 1) + TREEBIN_SHIFT)) | \
+ (((size_t)((i) & SIZE_T_ONE)) << (((i) >> 1) + TREEBIN_SHIFT - 1)))
+
+
+/* ------------------------ Operations on bin maps ----------------------- */
+
+/* bit corresponding to given index */
+#define idx2bit(i) ((binmap_t)(1) << (i))
+
+/* Mark/Clear bits with given index */
+#define mark_smallmap(M,i) ((M)->smallmap |= idx2bit(i))
+#define clear_smallmap(M,i) ((M)->smallmap &= ~idx2bit(i))
+#define smallmap_is_marked(M,i) ((M)->smallmap & idx2bit(i))
+
+#define mark_treemap(M,i) ((M)->treemap |= idx2bit(i))
+#define clear_treemap(M,i) ((M)->treemap &= ~idx2bit(i))
+#define treemap_is_marked(M,i) ((M)->treemap & idx2bit(i))
+
+/* index corresponding to given bit */
+
+#if defined(__GNUC__) && defined(i386)
+#define compute_bit2idx(X, I)\
+{\
+ unsigned int J;\
+ __asm__("bsfl %1,%0\n\t" : "=r" (J) : "rm" (X));\
+ I = (bindex_t)J;\
+}
+
+#else /* GNUC */
+#if USE_BUILTIN_FFS
+#define compute_bit2idx(X, I) I = ffs(X)-1
+
+#else /* USE_BUILTIN_FFS */
+#define compute_bit2idx(X, I)\
+{\
+ unsigned int Y = X - 1;\
+ unsigned int K = Y >> (16-4) & 16;\
+ unsigned int N = K; Y >>= K;\
+ N += K = Y >> (8-3) & 8; Y >>= K;\
+ N += K = Y >> (4-2) & 4; Y >>= K;\
+ N += K = Y >> (2-1) & 2; Y >>= K;\
+ N += K = Y >> (1-0) & 1; Y >>= K;\
+ I = (bindex_t)(N + Y);\
+}
+#endif /* USE_BUILTIN_FFS */
+#endif /* GNUC */
+
+/* isolate the least set bit of a bitmap */
+#define least_bit(x) ((x) & -(x))
+
+/* mask with all bits to left of least bit of x on */
+#define left_bits(x) ((x<<1) | -(x<<1))
+
+/* mask with all bits to left of or equal to least bit of x on */
+#define same_or_left_bits(x) ((x) | -(x))
+
+
+/* ----------------------- Runtime Check Support ------------------------- */
+
+/*
+ For security, the main invariant is that malloc/free/etc never
+ writes to a static address other than malloc_state, unless static
+ malloc_state itself has been corrupted, which cannot occur via
+ malloc (because of these checks). In essence this means that we
+ believe all pointers, sizes, maps etc held in malloc_state, but
+ check all of those linked or offsetted from other embedded data
+ structures. These checks are interspersed with main code in a way
+ that tends to minimize their run-time cost.
+
+ When FOOTERS is defined, in addition to range checking, we also
+ verify footer fields of inuse chunks, which can be used guarantee
+ that the mstate controlling malloc/free is intact. This is a
+ streamlined version of the approach described by William Robertson
+ et al in "Run-time Detection of Heap-based Overflows" LISA'03
+ http://www.usenix.org/events/lisa03/tech/robertson.html The footer
+ of an inuse chunk holds the xor of its mstate and a random seed,
+ that is checked upon calls to free() and realloc(). This is
+ (probablistically) unguessable from outside the program, but can be
+ computed by any code successfully malloc'ing any chunk, so does not
+ itself provide protection against code that has already broken
+ security through some other means. Unlike Robertson et al, we
+ always dynamically check addresses of all offset chunks (previous,
+ next, etc). This turns out to be cheaper than relying on hashes.
+*/
+
+#if !INSECURE
+/* Check if address a is at least as high as any from MORECORE or MMAP */
+#define ok_address(M, a) ((char*)(a) >= (M)->least_addr)
+/* Check if address of next chunk n is higher than base chunk p */
+#define ok_next(p, n) ((char*)(p) < (char*)(n))
+/* Check if p has its cinuse bit on */
+#define ok_cinuse(p) cinuse(p)
+/* Check if p has its pinuse bit on */
+#define ok_pinuse(p) pinuse(p)
+
+#else /* !INSECURE */
+#define ok_address(M, a) (1)
+#define ok_next(b, n) (1)
+#define ok_cinuse(p) (1)
+#define ok_pinuse(p) (1)
+#endif /* !INSECURE */
+
+#if (FOOTERS && !INSECURE)
+/* Check if (alleged) mstate m has expected magic field */
+#define ok_magic(M) ((M)->magic == mparams.magic)
+#else /* (FOOTERS && !INSECURE) */
+#define ok_magic(M) (1)
+#endif /* (FOOTERS && !INSECURE) */
+
+
+/* In gcc, use __builtin_expect to minimize impact of checks */
+#if !INSECURE
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define RTCHECK(e) __builtin_expect(e, 1)
+#else /* GNUC */
+#define RTCHECK(e) (e)
+#endif /* GNUC */
+#else /* !INSECURE */
+#define RTCHECK(e) (1)
+#endif /* !INSECURE */
+
+/* macros to set up inuse chunks with or without footers */
+
+#if !FOOTERS
+
+#define mark_inuse_foot(M,p,s)
+
+/* Set cinuse bit and pinuse bit of next chunk */
+#define set_inuse(M,p,s)\
+ ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\
+ ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)
+
+/* Set cinuse and pinuse of this chunk and pinuse of next chunk */
+#define set_inuse_and_pinuse(M,p,s)\
+ ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\
+ ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)
+
+/* Set size, cinuse and pinuse bit of this chunk */
+#define set_size_and_pinuse_of_inuse_chunk(M, p, s)\
+ ((p)->head = (s|PINUSE_BIT|CINUSE_BIT))
+
+#else /* FOOTERS */
+
+/* Set foot of inuse chunk to be xor of mstate and seed */
+#define mark_inuse_foot(M,p,s)\
+ (((mchunkptr)((char*)(p) + (s)))->prev_foot = ((size_t)(M) ^ mparams.magic))
+
+#define get_mstate_for(p)\
+ ((mstate)(((mchunkptr)((char*)(p) +\
+ (chunksize(p))))->prev_foot ^ mparams.magic))
+
+#define set_inuse(M,p,s)\
+ ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\
+ (((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT), \
+ mark_inuse_foot(M,p,s))
+
+#define set_inuse_and_pinuse(M,p,s)\
+ ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\
+ (((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT),\
+ mark_inuse_foot(M,p,s))
+
+#define set_size_and_pinuse_of_inuse_chunk(M, p, s)\
+ ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\
+ mark_inuse_foot(M, p, s))
+
+#endif /* !FOOTERS */
+
+/* ---------------------------- setting mparams -------------------------- */
+
+/* Initialize mparams */
+static int init_mparams(void) {
+ if (mparams.page_size == 0) {
+ size_t s;
+
+ mparams.mmap_threshold = DEFAULT_MMAP_THRESHOLD;
+ mparams.trim_threshold = DEFAULT_TRIM_THRESHOLD;
+#if MORECORE_CONTIGUOUS
+ mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT;
+#else /* MORECORE_CONTIGUOUS */
+ mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT|USE_NONCONTIGUOUS_BIT;
+#endif /* MORECORE_CONTIGUOUS */
+
+#if (FOOTERS && !INSECURE)
+ {
+#if USE_DEV_RANDOM
+ int fd;
+ unsigned char buf[sizeof(size_t)];
+ /* Try to use /dev/urandom, else fall back on using time */
+ if ((fd = open("/dev/urandom", O_RDONLY)) >= 0 &&
+ read(fd, buf, sizeof(buf)) == sizeof(buf)) {
+ s = *((size_t *) buf);
+ close(fd);
+ }
+ else
+#endif /* USE_DEV_RANDOM */
+ s = (size_t)(time(0) ^ (size_t)0x55555555U);
+
+ s |= (size_t)8U; /* ensure nonzero */
+ s &= ~(size_t)7U; /* improve chances of fault for bad values */
+
+ }
+#else /* (FOOTERS && !INSECURE) */
+ s = (size_t)0x58585858U;
+#endif /* (FOOTERS && !INSECURE) */
+ ACQUIRE_MAGIC_INIT_LOCK();
+ if (mparams.magic == 0) {
+ mparams.magic = s;
+ /* Set up lock for main malloc area */
+ INITIAL_LOCK(&gm->mutex);
+ gm->mflags = mparams.default_mflags;
+ }
+ RELEASE_MAGIC_INIT_LOCK();
+
+#ifndef WIN32
+ mparams.page_size = malloc_getpagesize;
+ mparams.granularity = ((DEFAULT_GRANULARITY != 0)?
+ DEFAULT_GRANULARITY : mparams.page_size);
+#else /* WIN32 */
+ {
+ SYSTEM_INFO system_info;
+ GetSystemInfo(&system_info);
+ mparams.page_size = system_info.dwPageSize;
+ mparams.granularity = system_info.dwAllocationGranularity;
+ }
+#endif /* WIN32 */
+
+ /* Sanity-check configuration:
+ size_t must be unsigned and as wide as pointer type.
+ ints must be at least 4 bytes.
+ alignment must be at least 8.
+ Alignment, min chunk size, and page size must all be powers of 2.
+ */
+ if ((sizeof(size_t) != sizeof(char*)) ||
+ (MAX_SIZE_T < MIN_CHUNK_SIZE) ||
+ (sizeof(int) < 4) ||
+ (MALLOC_ALIGNMENT < (size_t)8U) ||
+ ((MALLOC_ALIGNMENT & (MALLOC_ALIGNMENT-SIZE_T_ONE)) != 0) ||
+ ((MCHUNK_SIZE & (MCHUNK_SIZE-SIZE_T_ONE)) != 0) ||
+ ((mparams.granularity & (mparams.granularity-SIZE_T_ONE)) != 0) ||
+ ((mparams.page_size & (mparams.page_size-SIZE_T_ONE)) != 0))
+ ABORT;
+ }
+ return 0;
+}
+
+/* support for mallopt */
+static int change_mparam(int param_number, int value) {
+ size_t val = (size_t)value;
+ init_mparams();
+ switch(param_number) {
+ case M_TRIM_THRESHOLD:
+ mparams.trim_threshold = val;
+ return 1;
+ case M_GRANULARITY:
+ if (val >= mparams.page_size && ((val & (val-1)) == 0)) {
+ mparams.granularity = val;
+ return 1;
+ }
+ else
+ return 0;
+ case M_MMAP_THRESHOLD:
+ mparams.mmap_threshold = val;
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+#if DEBUG
+/* ------------------------- Debugging Support --------------------------- */
+
+/* Check properties of any chunk, whether free, inuse, mmapped etc */
+static void do_check_any_chunk(mstate m, mchunkptr p) {
+ assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD));
+ assert(ok_address(m, p));
+}
+
+/* Check properties of top chunk */
+static void do_check_top_chunk(mstate m, mchunkptr p) {
+ msegmentptr sp = segment_holding(m, (char*)p);
+ size_t sz = chunksize(p);
+ assert(sp != 0);
+ assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD));
+ assert(ok_address(m, p));
+ assert(sz == m->topsize);
+ assert(sz > 0);
+ assert(sz == ((sp->base + sp->size) - (char*)p) - TOP_FOOT_SIZE);
+ assert(pinuse(p));
+ assert(!next_pinuse(p));
+}
+
+/* Check properties of (inuse) mmapped chunks */
+static void do_check_mmapped_chunk(mstate m, mchunkptr p) {
+ size_t sz = chunksize(p);
+ size_t len = (sz + (p->prev_foot & ~IS_MMAPPED_BIT) + MMAP_FOOT_PAD);
+ assert(is_mmapped(p));
+ assert(use_mmap(m));
+ assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD));
+ assert(ok_address(m, p));
+ assert(!is_small(sz));
+ assert((len & (mparams.page_size-SIZE_T_ONE)) == 0);
+ assert(chunk_plus_offset(p, sz)->head == FENCEPOST_HEAD);
+ assert(chunk_plus_offset(p, sz+SIZE_T_SIZE)->head == 0);
+}
+
+/* Check properties of inuse chunks */
+static void do_check_inuse_chunk(mstate m, mchunkptr p) {
+ do_check_any_chunk(m, p);
+ assert(cinuse(p));
+ assert(next_pinuse(p));
+ /* If not pinuse and not mmapped, previous chunk has OK offset */
+ assert(is_mmapped(p) || pinuse(p) || next_chunk(prev_chunk(p)) == p);
+ if (is_mmapped(p))
+ do_check_mmapped_chunk(m, p);
+}
+
+/* Check properties of free chunks */
+static void do_check_free_chunk(mstate m, mchunkptr p) {
+ size_t sz = p->head & ~(PINUSE_BIT|CINUSE_BIT);
+ mchunkptr next = chunk_plus_offset(p, sz);
+ do_check_any_chunk(m, p);
+ assert(!cinuse(p));
+ assert(!next_pinuse(p));
+ assert (!is_mmapped(p));
+ if (p != m->dv && p != m->top) {
+ if (sz >= MIN_CHUNK_SIZE) {
+ assert((sz & CHUNK_ALIGN_MASK) == 0);
+ assert(is_aligned(chunk2mem(p)));
+ assert(next->prev_foot == sz);
+ assert(pinuse(p));
+ assert (next == m->top || cinuse(next));
+ assert(p->fd->bk == p);
+ assert(p->bk->fd == p);
+ }
+ else /* markers are always of size SIZE_T_SIZE */
+ assert(sz == SIZE_T_SIZE);
+ }
+}
+
+/* Check properties of malloced chunks at the point they are malloced */
+static void do_check_malloced_chunk(mstate m, void* mem, size_t s) {
+ if (mem != 0) {
+ mchunkptr p = mem2chunk(mem);
+ size_t sz = p->head & ~(PINUSE_BIT|CINUSE_BIT);
+ do_check_inuse_chunk(m, p);
+ assert((sz & CHUNK_ALIGN_MASK) == 0);
+ assert(sz >= MIN_CHUNK_SIZE);
+ assert(sz >= s);
+ /* unless mmapped, size is less than MIN_CHUNK_SIZE more than request */
+ assert(is_mmapped(p) || sz < (s + MIN_CHUNK_SIZE));
+ }
+}
+
+/* Check a tree and its subtrees. */
+static void do_check_tree(mstate m, tchunkptr t) {
+ tchunkptr head = 0;
+ tchunkptr u = t;
+ bindex_t tindex = t->index;
+ size_t tsize = chunksize(t);
+ bindex_t idx;
+ compute_tree_index(tsize, idx);
+ assert(tindex == idx);
+ assert(tsize >= MIN_LARGE_SIZE);
+ assert(tsize >= minsize_for_tree_index(idx));
+ assert((idx == NTREEBINS-1) || (tsize < minsize_for_tree_index((idx+1))));
+
+ do { /* traverse through chain of same-sized nodes */
+ do_check_any_chunk(m, ((mchunkptr)u));
+ assert(u->index == tindex);
+ assert(chunksize(u) == tsize);
+ assert(!cinuse(u));
+ assert(!next_pinuse(u));
+ assert(u->fd->bk == u);
+ assert(u->bk->fd == u);
+ if (u->parent == 0) {
+ assert(u->child[0] == 0);
+ assert(u->child[1] == 0);
+ }
+ else {
+ assert(head == 0); /* only one node on chain has parent */
+ head = u;
+ assert(u->parent != u);
+ assert (u->parent->child[0] == u ||
+ u->parent->child[1] == u ||
+ *((tbinptr*)(u->parent)) == u);
+ if (u->child[0] != 0) {
+ assert(u->child[0]->parent == u);
+ assert(u->child[0] != u);
+ do_check_tree(m, u->child[0]);
+ }
+ if (u->child[1] != 0) {
+ assert(u->child[1]->parent == u);
+ assert(u->child[1] != u);
+ do_check_tree(m, u->child[1]);
+ }
+ if (u->child[0] != 0 && u->child[1] != 0) {
+ assert(chunksize(u->child[0]) < chunksize(u->child[1]));
+ }
+ }
+ u = u->fd;
+ } while (u != t);
+ assert(head != 0);
+}
+
+/* Check all the chunks in a treebin. */
+static void do_check_treebin(mstate m, bindex_t i) {
+ tbinptr* tb = treebin_at(m, i);
+ tchunkptr t = *tb;
+ int empty = (m->treemap & (1U << i)) == 0;
+ if (t == 0)
+ assert(empty);
+ if (!empty)
+ do_check_tree(m, t);
+}
+
+/* Check all the chunks in a smallbin. */
+static void do_check_smallbin(mstate m, bindex_t i) {
+ sbinptr b = smallbin_at(m, i);
+ mchunkptr p = b->bk;
+ unsigned int empty = (m->smallmap & (1U << i)) == 0;
+ if (p == b)
+ assert(empty);
+ if (!empty) {
+ for (; p != b; p = p->bk) {
+ size_t size = chunksize(p);
+ mchunkptr q;
+ /* each chunk claims to be free */
+ do_check_free_chunk(m, p);
+ /* chunk belongs in bin */
+ assert(small_index(size) == i);
+ assert(p->bk == b || chunksize(p->bk) == chunksize(p));
+ /* chunk is followed by an inuse chunk */
+ q = next_chunk(p);
+ if (q->head != FENCEPOST_HEAD)
+ do_check_inuse_chunk(m, q);
+ }
+ }
+}
+
+/* Find x in a bin. Used in other check functions. */
+static int bin_find(mstate m, mchunkptr x) {
+ size_t size = chunksize(x);
+ if (is_small(size)) {
+ bindex_t sidx = small_index(size);
+ sbinptr b = smallbin_at(m, sidx);
+ if (smallmap_is_marked(m, sidx)) {
+ mchunkptr p = b;
+ do {
+ if (p == x)
+ return 1;
+ } while ((p = p->fd) != b);
+ }
+ }
+ else {
+ bindex_t tidx;
+ compute_tree_index(size, tidx);
+ if (treemap_is_marked(m, tidx)) {
+ tchunkptr t = *treebin_at(m, tidx);
+ size_t sizebits = size << leftshift_for_tree_index(tidx);
+ while (t != 0 && chunksize(t) != size) {
+ t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1];
+ sizebits <<= 1;
+ }
+ if (t != 0) {
+ tchunkptr u = t;
+ do {
+ if (u == (tchunkptr)x)
+ return 1;
+ } while ((u = u->fd) != t);
+ }
+ }
+ }
+ return 0;
+}
+
+/* Traverse each chunk and check it; return total */
+static size_t traverse_and_check(mstate m) {
+ size_t sum = 0;
+ if (is_initialized(m)) {
+ msegmentptr s = &m->seg;
+ sum += m->topsize + TOP_FOOT_SIZE;
+ while (s != 0) {
+ mchunkptr q = align_as_chunk(s->base);
+ mchunkptr lastq = 0;
+ assert(pinuse(q));
+ while (segment_holds(s, q) &&
+ q != m->top && q->head != FENCEPOST_HEAD) {
+ sum += chunksize(q);
+ if (cinuse(q)) {
+ assert(!bin_find(m, q));
+ do_check_inuse_chunk(m, q);
+ }
+ else {
+ assert(q == m->dv || bin_find(m, q));
+ assert(lastq == 0 || cinuse(lastq)); /* Not 2 consecutive free */
+ do_check_free_chunk(m, q);
+ }
+ lastq = q;
+ q = next_chunk(q);
+ }
+ s = s->next;
+ }
+ }
+ return sum;
+}
+
+/* Check all properties of malloc_state. */
+static void do_check_malloc_state(mstate m) {
+ bindex_t i;
+ size_t total;
+ /* check bins */
+ for (i = 0; i < NSMALLBINS; ++i)
+ do_check_smallbin(m, i);
+ for (i = 0; i < NTREEBINS; ++i)
+ do_check_treebin(m, i);
+
+ if (m->dvsize != 0) { /* check dv chunk */
+ do_check_any_chunk(m, m->dv);
+ assert(m->dvsize == chunksize(m->dv));
+ assert(m->dvsize >= MIN_CHUNK_SIZE);
+ assert(bin_find(m, m->dv) == 0);
+ }
+
+ if (m->top != 0) { /* check top chunk */
+ do_check_top_chunk(m, m->top);
+ assert(m->topsize == chunksize(m->top));
+ assert(m->topsize > 0);
+ assert(bin_find(m, m->top) == 0);
+ }
+
+ total = traverse_and_check(m);
+ assert(total <= m->footprint);
+ assert(m->footprint <= m->max_footprint);
+}
+#endif /* DEBUG */
+
+/* ----------------------------- statistics ------------------------------ */
+
+#if !NO_MALLINFO
+static struct mallinfo internal_mallinfo(mstate m) {
+ struct mallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ if (!PREACTION(m)) {
+ check_malloc_state(m);
+ if (is_initialized(m)) {
+ size_t nfree = SIZE_T_ONE; /* top always free */
+ size_t mfree = m->topsize + TOP_FOOT_SIZE;
+ size_t sum = mfree;
+ msegmentptr s = &m->seg;
+ while (s != 0) {
+ mchunkptr q = align_as_chunk(s->base);
+ while (segment_holds(s, q) &&
+ q != m->top && q->head != FENCEPOST_HEAD) {
+ size_t sz = chunksize(q);
+ sum += sz;
+ if (!cinuse(q)) {
+ mfree += sz;
+ ++nfree;
+ }
+ q = next_chunk(q);
+ }
+ s = s->next;
+ }
+
+ nm.arena = sum;
+ nm.ordblks = nfree;
+ nm.hblkhd = m->footprint - sum;
+ nm.usmblks = m->max_footprint;
+ nm.uordblks = m->footprint - mfree;
+ nm.fordblks = mfree;
+ nm.keepcost = m->topsize;
+ }
+
+ POSTACTION(m);
+ }
+ return nm;
+}
+#endif /* !NO_MALLINFO */
+
+static void internal_malloc_stats(mstate m) {
+ if (!PREACTION(m)) {
+ size_t maxfp = 0;
+ size_t fp = 0;
+ size_t used = 0;
+ check_malloc_state(m);
+ if (is_initialized(m)) {
+ msegmentptr s = &m->seg;
+ maxfp = m->max_footprint;
+ fp = m->footprint;
+ used = fp - (m->topsize + TOP_FOOT_SIZE);
+
+ while (s != 0) {
+ mchunkptr q = align_as_chunk(s->base);
+ while (segment_holds(s, q) &&
+ q != m->top && q->head != FENCEPOST_HEAD) {
+ if (!cinuse(q))
+ used -= chunksize(q);
+ q = next_chunk(q);
+ }
+ s = s->next;
+ }
+ }
+
+#ifndef LACKS_STDIO_H
+ fprintf(stderr, "max system bytes = %10lu\n", (unsigned long)(maxfp));
+ fprintf(stderr, "system bytes = %10lu\n", (unsigned long)(fp));
+ fprintf(stderr, "in use bytes = %10lu\n", (unsigned long)(used));
+#endif
+
+ POSTACTION(m);
+ }
+}
+
+/* ----------------------- Operations on smallbins ----------------------- */
+
+/*
+ Various forms of linking and unlinking are defined as macros. Even
+ the ones for trees, which are very long but have very short typical
+ paths. This is ugly but reduces reliance on inlining support of
+ compilers.
+*/
+
+/* Link a free chunk into a smallbin */
+#define insert_small_chunk(M, P, S) {\
+ bindex_t I = small_index(S);\
+ mchunkptr B = smallbin_at(M, I);\
+ mchunkptr F = B;\
+ assert(S >= MIN_CHUNK_SIZE);\
+ if (!smallmap_is_marked(M, I))\
+ mark_smallmap(M, I);\
+ else if (RTCHECK(ok_address(M, B->fd)))\
+ F = B->fd;\
+ else {\
+ CORRUPTION_ERROR_ACTION(M);\
+ }\
+ B->fd = P;\
+ F->bk = P;\
+ P->fd = F;\
+ P->bk = B;\
+}
+
+/* Unlink a chunk from a smallbin */
+#define unlink_small_chunk(M, P, S) {\
+ mchunkptr F = P->fd;\
+ mchunkptr B = P->bk;\
+ bindex_t I = small_index(S);\
+ assert(P != B);\
+ assert(P != F);\
+ assert(chunksize(P) == small_index2size(I));\
+ if (F == B)\
+ clear_smallmap(M, I);\
+ else if (RTCHECK((F == smallbin_at(M,I) || ok_address(M, F)) &&\
+ (B == smallbin_at(M,I) || ok_address(M, B)))) {\
+ F->bk = B;\
+ B->fd = F;\
+ }\
+ else {\
+ CORRUPTION_ERROR_ACTION(M);\
+ }\
+}
+
+/* Unlink the first chunk from a smallbin */
+#define unlink_first_small_chunk(M, B, P, I) {\
+ mchunkptr F = P->fd;\
+ assert(P != B);\
+ assert(P != F);\
+ assert(chunksize(P) == small_index2size(I));\
+ if (B == F)\
+ clear_smallmap(M, I);\
+ else if (RTCHECK(ok_address(M, F))) {\
+ B->fd = F;\
+ F->bk = B;\
+ }\
+ else {\
+ CORRUPTION_ERROR_ACTION(M);\
+ }\
+}
+
+/* Replace dv node, binning the old one */
+/* Used only when dvsize known to be small */
+#define replace_dv(M, P, S) {\
+ size_t DVS = M->dvsize;\
+ if (DVS != 0) {\
+ mchunkptr DV = M->dv;\
+ assert(is_small(DVS));\
+ insert_small_chunk(M, DV, DVS);\
+ }\
+ M->dvsize = S;\
+ M->dv = P;\
+}
+
+/* ------------------------- Operations on trees ------------------------- */
+
+/* Insert chunk into tree */
+#define insert_large_chunk(M, X, S) {\
+ tbinptr* H;\
+ bindex_t I;\
+ compute_tree_index(S, I);\
+ H = treebin_at(M, I);\
+ X->index = I;\
+ X->child[0] = X->child[1] = 0;\
+ if (!treemap_is_marked(M, I)) {\
+ mark_treemap(M, I);\
+ *H = X;\
+ X->parent = (tchunkptr)H;\
+ X->fd = X->bk = X;\
+ }\
+ else {\
+ tchunkptr T = *H;\
+ size_t K = S << leftshift_for_tree_index(I);\
+ for (;;) {\
+ if (chunksize(T) != S) {\
+ tchunkptr* C = &(T->child[(K >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]);\
+ K <<= 1;\
+ if (*C != 0)\
+ T = *C;\
+ else if (RTCHECK(ok_address(M, C))) {\
+ *C = X;\
+ X->parent = T;\
+ X->fd = X->bk = X;\
+ break;\
+ }\
+ else {\
+ CORRUPTION_ERROR_ACTION(M);\
+ break;\
+ }\
+ }\
+ else {\
+ tchunkptr F = T->fd;\
+ if (RTCHECK(ok_address(M, T) && ok_address(M, F))) {\
+ T->fd = F->bk = X;\
+ X->fd = F;\
+ X->bk = T;\
+ X->parent = 0;\
+ break;\
+ }\
+ else {\
+ CORRUPTION_ERROR_ACTION(M);\
+ break;\
+ }\
+ }\
+ }\
+ }\
+}
+
+/*
+ Unlink steps:
+
+ 1. If x is a chained node, unlink it from its same-sized fd/bk links
+ and choose its bk node as its replacement.
+ 2. If x was the last node of its size, but not a leaf node, it must
+ be replaced with a leaf node (not merely one with an open left or
+ right), to make sure that lefts and rights of descendents
+ correspond properly to bit masks. We use the rightmost descendent
+ of x. We could use any other leaf, but this is easy to locate and
+ tends to counteract removal of leftmosts elsewhere, and so keeps
+ paths shorter than minimally guaranteed. This doesn't loop much
+ because on average a node in a tree is near the bottom.
+ 3. If x is the base of a chain (i.e., has parent links) relink
+ x's parent and children to x's replacement (or null if none).
+*/
+
+#define unlink_large_chunk(M, X) {\
+ tchunkptr XP = X->parent;\
+ tchunkptr R;\
+ if (X->bk != X) {\
+ tchunkptr F = X->fd;\
+ R = X->bk;\
+ if (RTCHECK(ok_address(M, F))) {\
+ F->bk = R;\
+ R->fd = F;\
+ }\
+ else {\
+ CORRUPTION_ERROR_ACTION(M);\
+ }\
+ }\
+ else {\
+ tchunkptr* RP;\
+ if (((R = *(RP = &(X->child[1]))) != 0) ||\
+ ((R = *(RP = &(X->child[0]))) != 0)) {\
+ tchunkptr* CP;\
+ while ((*(CP = &(R->child[1])) != 0) ||\
+ (*(CP = &(R->child[0])) != 0)) {\
+ R = *(RP = CP);\
+ }\
+ if (RTCHECK(ok_address(M, RP)))\
+ *RP = 0;\
+ else {\
+ CORRUPTION_ERROR_ACTION(M);\
+ }\
+ }\
+ }\
+ if (XP != 0) {\
+ tbinptr* H = treebin_at(M, X->index);\
+ if (X == *H) {\
+ if ((*H = R) == 0) \
+ clear_treemap(M, X->index);\
+ }\
+ else if (RTCHECK(ok_address(M, XP))) {\
+ if (XP->child[0] == X) \
+ XP->child[0] = R;\
+ else \
+ XP->child[1] = R;\
+ }\
+ else\
+ CORRUPTION_ERROR_ACTION(M);\
+ if (R != 0) {\
+ if (RTCHECK(ok_address(M, R))) {\
+ tchunkptr C0, C1;\
+ R->parent = XP;\
+ if ((C0 = X->child[0]) != 0) {\
+ if (RTCHECK(ok_address(M, C0))) {\
+ R->child[0] = C0;\
+ C0->parent = R;\
+ }\
+ else\
+ CORRUPTION_ERROR_ACTION(M);\
+ }\
+ if ((C1 = X->child[1]) != 0) {\
+ if (RTCHECK(ok_address(M, C1))) {\
+ R->child[1] = C1;\
+ C1->parent = R;\
+ }\
+ else\
+ CORRUPTION_ERROR_ACTION(M);\
+ }\
+ }\
+ else\
+ CORRUPTION_ERROR_ACTION(M);\
+ }\
+ }\
+}
+
+/* Relays to large vs small bin operations */
+
+#define insert_chunk(M, P, S)\
+ if (is_small(S)) insert_small_chunk(M, P, S)\
+ else { tchunkptr TP = (tchunkptr)(P); insert_large_chunk(M, TP, S); }
+
+#define unlink_chunk(M, P, S)\
+ if (is_small(S)) unlink_small_chunk(M, P, S)\
+ else { tchunkptr TP = (tchunkptr)(P); unlink_large_chunk(M, TP); }
+
+
+/* Relays to internal calls to malloc/free from realloc, memalign etc */
+
+#if ONLY_MSPACES
+#define internal_malloc(m, b) mspace_malloc(m, b)
+#define internal_free(m, mem) mspace_free(m,mem);
+#else /* ONLY_MSPACES */
+#if MSPACES
+#define internal_malloc(m, b)\
+ (m == gm)? dlmalloc(b) : mspace_malloc(m, b)
+#define internal_free(m, mem)\
+ if (m == gm) dlfree(mem); else mspace_free(m,mem);
+#else /* MSPACES */
+#define internal_malloc(m, b) dlmalloc(b)
+#define internal_free(m, mem) dlfree(mem)
+#endif /* MSPACES */
+#endif /* ONLY_MSPACES */
+
+/* ----------------------- Direct-mmapping chunks ----------------------- */
+
+/*
+ Directly mmapped chunks are set up with an offset to the start of
+ the mmapped region stored in the prev_foot field of the chunk. This
+ allows reconstruction of the required argument to MUNMAP when freed,
+ and also allows adjustment of the returned chunk to meet alignment
+ requirements (especially in memalign). There is also enough space
+ allocated to hold a fake next chunk of size SIZE_T_SIZE to maintain
+ the PINUSE bit so frees can be checked.
+*/
+
+/* Malloc using mmap */
+static void* mmap_alloc(mstate m, size_t nb) {
+ size_t mmsize = granularity_align(nb + SIX_SIZE_T_SIZES + CHUNK_ALIGN_MASK);
+ if (mmsize > nb) { /* Check for wrap around 0 */
+ char* mm = (char*)(DIRECT_MMAP(mmsize));
+ if (mm != CMFAIL) {
+ size_t offset = align_offset(chunk2mem(mm));
+ size_t psize = mmsize - offset - MMAP_FOOT_PAD;
+ mchunkptr p = (mchunkptr)(mm + offset);
+ p->prev_foot = offset | IS_MMAPPED_BIT;
+ (p)->head = (psize|CINUSE_BIT);
+ mark_inuse_foot(m, p, psize);
+ chunk_plus_offset(p, psize)->head = FENCEPOST_HEAD;
+ chunk_plus_offset(p, psize+SIZE_T_SIZE)->head = 0;
+
+ if (mm < m->least_addr)
+ m->least_addr = mm;
+ if ((m->footprint += mmsize) > m->max_footprint)
+ m->max_footprint = m->footprint;
+ assert(is_aligned(chunk2mem(p)));
+ check_mmapped_chunk(m, p);
+ return chunk2mem(p);
+ }
+ }
+ return 0;
+}
+
+/* Realloc using mmap */
+static mchunkptr mmap_resize(mstate m, mchunkptr oldp, size_t nb) {
+ size_t oldsize = chunksize(oldp);
+ if (is_small(nb)) /* Can't shrink mmap regions below small size */
+ return 0;
+ /* Keep old chunk if big enough but not too big */
+ if (oldsize >= nb + SIZE_T_SIZE &&
+ (oldsize - nb) <= (mparams.granularity << 1))
+ return oldp;
+ else {
+ size_t offset = oldp->prev_foot & ~IS_MMAPPED_BIT;
+ size_t oldmmsize = oldsize + offset + MMAP_FOOT_PAD;
+ size_t newmmsize = granularity_align(nb + SIX_SIZE_T_SIZES +
+ CHUNK_ALIGN_MASK);
+ char* cp = (char*)CALL_MREMAP((char*)oldp - offset,
+ oldmmsize, newmmsize, 1);
+ if (cp != CMFAIL) {
+ mchunkptr newp = (mchunkptr)(cp + offset);
+ size_t psize = newmmsize - offset - MMAP_FOOT_PAD;
+ newp->head = (psize|CINUSE_BIT);
+ mark_inuse_foot(m, newp, psize);
+ chunk_plus_offset(newp, psize)->head = FENCEPOST_HEAD;
+ chunk_plus_offset(newp, psize+SIZE_T_SIZE)->head = 0;
+
+ if (cp < m->least_addr)
+ m->least_addr = cp;
+ if ((m->footprint += newmmsize - oldmmsize) > m->max_footprint)
+ m->max_footprint = m->footprint;
+ check_mmapped_chunk(m, newp);
+ return newp;
+ }
+ }
+ return 0;
+}
+
+/* -------------------------- mspace management -------------------------- */
+
+/* Initialize top chunk and its size */
+static void init_top(mstate m, mchunkptr p, size_t psize) {
+ /* Ensure alignment */
+ size_t offset = align_offset(chunk2mem(p));
+ p = (mchunkptr)((char*)p + offset);
+ psize -= offset;
+
+ m->top = p;
+ m->topsize = psize;
+ p->head = psize | PINUSE_BIT;
+ /* set size of fake trailing chunk holding overhead space only once */
+ chunk_plus_offset(p, psize)->head = TOP_FOOT_SIZE;
+ m->trim_check = mparams.trim_threshold; /* reset on each update */
+}
+
+/* Initialize bins for a new mstate that is otherwise zeroed out */
+static void init_bins(mstate m) {
+ /* Establish circular links for smallbins */
+ bindex_t i;
+ for (i = 0; i < NSMALLBINS; ++i) {
+ sbinptr bin = smallbin_at(m,i);
+ bin->fd = bin->bk = bin;
+ }
+}
+
+#if PROCEED_ON_ERROR
+
+/* default corruption action */
+static void reset_on_error(mstate m) {
+ int i;
+ ++malloc_corruption_error_count;
+ /* Reinitialize fields to forget about all memory */
+ m->smallbins = m->treebins = 0;
+ m->dvsize = m->topsize = 0;
+ m->seg.base = 0;
+ m->seg.size = 0;
+ m->seg.next = 0;
+ m->top = m->dv = 0;
+ for (i = 0; i < NTREEBINS; ++i)
+ *treebin_at(m, i) = 0;
+ init_bins(m);
+}
+#endif /* PROCEED_ON_ERROR */
+
+/* Allocate chunk and prepend remainder with chunk in successor base. */
+static void* prepend_alloc(mstate m, char* newbase, char* oldbase,
+ size_t nb) {
+ mchunkptr p = align_as_chunk(newbase);
+ mchunkptr oldfirst = align_as_chunk(oldbase);
+ size_t psize = (char*)oldfirst - (char*)p;
+ mchunkptr q = chunk_plus_offset(p, nb);
+ size_t qsize = psize - nb;
+ set_size_and_pinuse_of_inuse_chunk(m, p, nb);
+
+ assert((char*)oldfirst > (char*)q);
+ assert(pinuse(oldfirst));
+ assert(qsize >= MIN_CHUNK_SIZE);
+
+ /* consolidate remainder with first chunk of old base */
+ if (oldfirst == m->top) {
+ size_t tsize = m->topsize += qsize;
+ m->top = q;
+ q->head = tsize | PINUSE_BIT;
+ check_top_chunk(m, q);
+ }
+ else if (oldfirst == m->dv) {
+ size_t dsize = m->dvsize += qsize;
+ m->dv = q;
+ set_size_and_pinuse_of_free_chunk(q, dsize);
+ }
+ else {
+ if (!cinuse(oldfirst)) {
+ size_t nsize = chunksize(oldfirst);
+ unlink_chunk(m, oldfirst, nsize);
+ oldfirst = chunk_plus_offset(oldfirst, nsize);
+ qsize += nsize;
+ }
+ set_free_with_pinuse(q, qsize, oldfirst);
+ insert_chunk(m, q, qsize);
+ check_free_chunk(m, q);
+ }
+
+ check_malloced_chunk(m, chunk2mem(p), nb);
+ return chunk2mem(p);
+}
+
+
+/* Add a segment to hold a new noncontiguous region */
+static void add_segment(mstate m, char* tbase, size_t tsize, flag_t mmapped) {
+ /* Determine locations and sizes of segment, fenceposts, old top */
+ char* old_top = (char*)m->top;
+ msegmentptr oldsp = segment_holding(m, old_top);
+ char* old_end = oldsp->base + oldsp->size;
+ size_t ssize = pad_request(sizeof(struct malloc_segment));
+ char* rawsp = old_end - (ssize + FOUR_SIZE_T_SIZES + CHUNK_ALIGN_MASK);
+ size_t offset = align_offset(chunk2mem(rawsp));
+ char* asp = rawsp + offset;
+ char* csp = (asp < (old_top + MIN_CHUNK_SIZE))? old_top : asp;
+ mchunkptr sp = (mchunkptr)csp;
+ msegmentptr ss = (msegmentptr)(chunk2mem(sp));
+ mchunkptr tnext = chunk_plus_offset(sp, ssize);
+ mchunkptr p = tnext;
+ int nfences = 0;
+
+ /* reset top to new space */
+ init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE);
+
+ /* Set up segment record */
+ assert(is_aligned(ss));
+ set_size_and_pinuse_of_inuse_chunk(m, sp, ssize);
+ *ss = m->seg; /* Push current record */
+ m->seg.base = tbase;
+ m->seg.size = tsize;
+ m->seg.sflags = mmapped;
+ m->seg.next = ss;
+
+ /* Insert trailing fenceposts */
+ for (;;) {
+ mchunkptr nextp = chunk_plus_offset(p, SIZE_T_SIZE);
+ p->head = FENCEPOST_HEAD;
+ ++nfences;
+ if ((char*)(&(nextp->head)) < old_end)
+ p = nextp;
+ else
+ break;
+ }
+ assert(nfences >= 2);
+
+ /* Insert the rest of old top into a bin as an ordinary free chunk */
+ if (csp != old_top) {
+ mchunkptr q = (mchunkptr)old_top;
+ size_t psize = csp - old_top;
+ mchunkptr tn = chunk_plus_offset(q, psize);
+ set_free_with_pinuse(q, psize, tn);
+ insert_chunk(m, q, psize);
+ }
+
+ check_top_chunk(m, m->top);
+}
+
+/* -------------------------- System allocation -------------------------- */
+
+/* Get memory from system using MORECORE or MMAP */
+static void* sys_alloc(mstate m, size_t nb) {
+ char* tbase = CMFAIL;
+ size_t tsize = 0;
+ flag_t mmap_flag = 0;
+
+ init_mparams();
+
+ /* Directly map large chunks */
+ if (use_mmap(m) && nb >= mparams.mmap_threshold) {
+ void* mem = mmap_alloc(m, nb);
+ if (mem != 0)
+ return mem;
+ }
+
+ /*
+ Try getting memory in any of three ways (in most-preferred to
+ least-preferred order):
+ 1. A call to MORECORE that can normally contiguously extend memory.
+ (disabled if not MORECORE_CONTIGUOUS or not HAVE_MORECORE or
+ or main space is mmapped or a previous contiguous call failed)
+ 2. A call to MMAP new space (disabled if not HAVE_MMAP).
+ Note that under the default settings, if MORECORE is unable to
+ fulfill a request, and HAVE_MMAP is true, then mmap is
+ used as a noncontiguous system allocator. This is a useful backup
+ strategy for systems with holes in address spaces -- in this case
+ sbrk cannot contiguously expand the heap, but mmap may be able to
+ find space.
+ 3. A call to MORECORE that cannot usually contiguously extend memory.
+ (disabled if not HAVE_MORECORE)
+ */
+
+ if (MORECORE_CONTIGUOUS && !use_noncontiguous(m)) {
+ char* br = CMFAIL;
+ msegmentptr ss = (m->top == 0)? 0 : segment_holding(m, (char*)m->top);
+ size_t asize = 0;
+ ACQUIRE_MORECORE_LOCK();
+
+ if (ss == 0) { /* First time through or recovery */
+ char* base = (char*)CALL_MORECORE(0);
+ if (base != CMFAIL) {
+ asize = granularity_align(nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE);
+ /* Adjust to end on a page boundary */
+ if (!is_page_aligned(base))
+ asize += (page_align((size_t)base) - (size_t)base);
+ /* Can't call MORECORE if size is negative when treated as signed */
+ if (asize < HALF_MAX_SIZE_T &&
+ (br = (char*)(CALL_MORECORE(asize))) == base) {
+ tbase = base;
+ tsize = asize;
+ }
+ }
+ }
+ else {
+ /* Subtract out existing available top space from MORECORE request. */
+ asize = granularity_align(nb - m->topsize + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE);
+ /* Use mem here only if it did continuously extend old space */
+ if (asize < HALF_MAX_SIZE_T &&
+ (br = (char*)(CALL_MORECORE(asize))) == ss->base+ss->size) {
+ tbase = br;
+ tsize = asize;
+ }
+ }
+
+ if (tbase == CMFAIL) { /* Cope with partial failure */
+ if (br != CMFAIL) { /* Try to use/extend the space we did get */
+ if (asize < HALF_MAX_SIZE_T &&
+ asize < nb + TOP_FOOT_SIZE + SIZE_T_ONE) {
+ size_t esize = granularity_align(nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE - asize);
+ if (esize < HALF_MAX_SIZE_T) {
+ char* end = (char*)CALL_MORECORE(esize);
+ if (end != CMFAIL)
+ asize += esize;
+ else { /* Can't use; try to release */
+ end = (char*)CALL_MORECORE(-asize);
+ br = CMFAIL;
+ }
+ }
+ }
+ }
+ if (br != CMFAIL) { /* Use the space we did get */
+ tbase = br;
+ tsize = asize;
+ }
+ else
+ disable_contiguous(m); /* Don't try contiguous path in the future */
+ }
+
+ RELEASE_MORECORE_LOCK();
+ }
+
+ if (HAVE_MMAP && tbase == CMFAIL) { /* Try MMAP */
+ size_t req = nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE;
+ size_t rsize = granularity_align(req);
+ if (rsize > nb) { /* Fail if wraps around zero */
+ char* mp = (char*)(CALL_MMAP(rsize));
+ if (mp != CMFAIL) {
+ tbase = mp;
+ tsize = rsize;
+ mmap_flag = IS_MMAPPED_BIT;
+ }
+ }
+ }
+
+ if (HAVE_MORECORE && tbase == CMFAIL) { /* Try noncontiguous MORECORE */
+ size_t asize = granularity_align(nb + TOP_FOOT_SIZE + MALLOC_ALIGNMENT + SIZE_T_ONE);
+ if (asize < HALF_MAX_SIZE_T) {
+ char* br = CMFAIL;
+ char* end = CMFAIL;
+ ACQUIRE_MORECORE_LOCK();
+ br = (char*)(CALL_MORECORE(asize));
+ end = (char*)(CALL_MORECORE(0));
+ RELEASE_MORECORE_LOCK();
+ if (br != CMFAIL && end != CMFAIL && br < end) {
+ size_t ssize = end - br;
+ if (ssize > nb + TOP_FOOT_SIZE) {
+ tbase = br;
+ tsize = ssize;
+ }
+ }
+ }
+ }
+
+ if (tbase != CMFAIL) {
+
+ if ((m->footprint += tsize) > m->max_footprint)
+ m->max_footprint = m->footprint;
+
+ if (!is_initialized(m)) { /* first-time initialization */
+ m->seg.base = m->least_addr = tbase;
+ m->seg.size = tsize;
+ m->seg.sflags = mmap_flag;
+ m->magic = mparams.magic;
+ init_bins(m);
+ if (is_global(m))
+ init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE);
+ else {
+ /* Offset top by embedded malloc_state */
+ mchunkptr mn = next_chunk(mem2chunk(m));
+ init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) -TOP_FOOT_SIZE);
+ }
+ }
+
+ else {
+ /* Try to merge with an existing segment */
+ msegmentptr sp = &m->seg;
+ while (sp != 0 && tbase != sp->base + sp->size)
+ sp = sp->next;
+ if (sp != 0 &&
+ !is_extern_segment(sp) &&
+ (sp->sflags & IS_MMAPPED_BIT) == mmap_flag &&
+ segment_holds(sp, m->top)) { /* append */
+ sp->size += tsize;
+ init_top(m, m->top, m->topsize + tsize);
+ }
+ else {
+ if (tbase < m->least_addr)
+ m->least_addr = tbase;
+ sp = &m->seg;
+ while (sp != 0 && sp->base != tbase + tsize)
+ sp = sp->next;
+ if (sp != 0 &&
+ !is_extern_segment(sp) &&
+ (sp->sflags & IS_MMAPPED_BIT) == mmap_flag) {
+ char* oldbase = sp->base;
+ sp->base = tbase;
+ sp->size += tsize;
+ return prepend_alloc(m, tbase, oldbase, nb);
+ }
+ else
+ add_segment(m, tbase, tsize, mmap_flag);
+ }
+ }
+
+ if (nb < m->topsize) { /* Allocate from new or extended top space */
+ size_t rsize = m->topsize -= nb;
+ mchunkptr p = m->top;
+ mchunkptr r = m->top = chunk_plus_offset(p, nb);
+ r->head = rsize | PINUSE_BIT;
+ set_size_and_pinuse_of_inuse_chunk(m, p, nb);
+ check_top_chunk(m, m->top);
+ check_malloced_chunk(m, chunk2mem(p), nb);
+ return chunk2mem(p);
+ }
+ }
+
+ MALLOC_FAILURE_ACTION;
+ return 0;
+}
+
+/* ----------------------- system deallocation -------------------------- */
+
+/* Unmap and unlink any mmapped segments that don't contain used chunks */
+static size_t release_unused_segments(mstate m) {
+ size_t released = 0;
+ msegmentptr pred = &m->seg;
+ msegmentptr sp = pred->next;
+ while (sp != 0) {
+ char* base = sp->base;
+ size_t size = sp->size;
+ msegmentptr next = sp->next;
+ if (is_mmapped_segment(sp) && !is_extern_segment(sp)) {
+ mchunkptr p = align_as_chunk(base);
+ size_t psize = chunksize(p);
+ /* Can unmap if first chunk holds entire segment and not pinned */
+ if (!cinuse(p) && (char*)p + psize >= base + size - TOP_FOOT_SIZE) {
+ tchunkptr tp = (tchunkptr)p;
+ assert(segment_holds(sp, (char*)sp));
+ if (p == m->dv) {
+ m->dv = 0;
+ m->dvsize = 0;
+ }
+ else {
+ unlink_large_chunk(m, tp);
+ }
+ if (CALL_MUNMAP(base, size) == 0) {
+ released += size;
+ m->footprint -= size;
+ /* unlink obsoleted record */
+ sp = pred;
+ sp->next = next;
+ }
+ else { /* back out if cannot unmap */
+ insert_large_chunk(m, tp, psize);
+ }
+ }
+ }
+ pred = sp;
+ sp = next;
+ }
+ return released;
+}
+
+static int sys_trim(mstate m, size_t pad) {
+ size_t released = 0;
+ if (pad < MAX_REQUEST && is_initialized(m)) {
+ pad += TOP_FOOT_SIZE; /* ensure enough room for segment overhead */
+
+ if (m->topsize > pad) {
+ /* Shrink top space in granularity-size units, keeping at least one */
+ size_t unit = mparams.granularity;
+ size_t extra = ((m->topsize - pad + (unit - SIZE_T_ONE)) / unit -
+ SIZE_T_ONE) * unit;
+ msegmentptr sp = segment_holding(m, (char*)m->top);
+
+ if (!is_extern_segment(sp)) {
+ if (is_mmapped_segment(sp)) {
+ if (HAVE_MMAP &&
+ sp->size >= extra &&
+ !has_segment_link(m, sp)) { /* can't shrink if pinned */
+ size_t newsize = sp->size - extra;
+ /* Prefer mremap, fall back to munmap */
+ if ((CALL_MREMAP(sp->base, sp->size, newsize, 0) != MFAIL) ||
+ (CALL_MUNMAP(sp->base + newsize, extra) == 0)) {
+ released = extra;
+ }
+ }
+ }
+ else if (HAVE_MORECORE) {
+ if (extra >= HALF_MAX_SIZE_T) /* Avoid wrapping negative */
+ extra = (HALF_MAX_SIZE_T) + SIZE_T_ONE - unit;
+ ACQUIRE_MORECORE_LOCK();
+ {
+ /* Make sure end of memory is where we last set it. */
+ char* old_br = (char*)(CALL_MORECORE(0));
+ if (old_br == sp->base + sp->size) {
+ char* rel_br = (char*)(CALL_MORECORE(-extra));
+ char* new_br = (char*)(CALL_MORECORE(0));
+ if (rel_br != CMFAIL && new_br < old_br)
+ released = old_br - new_br;
+ }
+ }
+ RELEASE_MORECORE_LOCK();
+ }
+ }
+
+ if (released != 0) {
+ sp->size -= released;
+ m->footprint -= released;
+ init_top(m, m->top, m->topsize - released);
+ check_top_chunk(m, m->top);
+ }
+ }
+
+ /* Unmap any unused mmapped segments */
+ if (HAVE_MMAP)
+ released += release_unused_segments(m);
+
+ /* On failure, disable autotrim to avoid repeated failed future calls */
+ if (released == 0)
+ m->trim_check = MAX_SIZE_T;
+ }
+
+ return (released != 0)? 1 : 0;
+}
+
+/* ---------------------------- malloc support --------------------------- */
+
+/* allocate a large request from the best fitting chunk in a treebin */
+static void* tmalloc_large(mstate m, size_t nb) {
+ tchunkptr v = 0;
+ size_t rsize = -nb; /* Unsigned negation */
+ tchunkptr t;
+ bindex_t idx;
+ compute_tree_index(nb, idx);
+
+ if ((t = *treebin_at(m, idx)) != 0) {
+ /* Traverse tree for this bin looking for node with size == nb */
+ size_t sizebits = nb << leftshift_for_tree_index(idx);
+ tchunkptr rst = 0; /* The deepest untaken right subtree */
+ for (;;) {
+ tchunkptr rt;
+ size_t trem = chunksize(t) - nb;
+ if (trem < rsize) {
+ v = t;
+ if ((rsize = trem) == 0)
+ break;
+ }
+ rt = t->child[1];
+ t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1];
+ if (rt != 0 && rt != t)
+ rst = rt;
+ if (t == 0) {
+ t = rst; /* set t to least subtree holding sizes > nb */
+ break;
+ }
+ sizebits <<= 1;
+ }
+ }
+
+ if (t == 0 && v == 0) { /* set t to root of next non-empty treebin */
+ binmap_t leftbits = left_bits(idx2bit(idx)) & m->treemap;
+ if (leftbits != 0) {
+ bindex_t i;
+ binmap_t leastbit = least_bit(leftbits);
+ compute_bit2idx(leastbit, i);
+ t = *treebin_at(m, i);
+ }
+ }
+
+ while (t != 0) { /* find smallest of tree or subtree */
+ size_t trem = chunksize(t) - nb;
+ if (trem < rsize) {
+ rsize = trem;
+ v = t;
+ }
+ t = leftmost_child(t);
+ }
+
+ /* If dv is a better fit, return 0 so malloc will use it */
+ if (v != 0 && rsize < (size_t)(m->dvsize - nb)) {
+ if (RTCHECK(ok_address(m, v))) { /* split */
+ mchunkptr r = chunk_plus_offset(v, nb);
+ assert(chunksize(v) == rsize + nb);
+ if (RTCHECK(ok_next(v, r))) {
+ unlink_large_chunk(m, v);
+ if (rsize < MIN_CHUNK_SIZE)
+ set_inuse_and_pinuse(m, v, (rsize + nb));
+ else {
+ set_size_and_pinuse_of_inuse_chunk(m, v, nb);
+ set_size_and_pinuse_of_free_chunk(r, rsize);
+ insert_chunk(m, r, rsize);
+ }
+ return chunk2mem(v);
+ }
+ }
+ CORRUPTION_ERROR_ACTION(m);
+ }
+ return 0;
+}
+
+/* allocate a small request from the best fitting chunk in a treebin */
+static void* tmalloc_small(mstate m, size_t nb) {
+ tchunkptr t, v;
+ size_t rsize;
+ bindex_t i;
+ binmap_t leastbit = least_bit(m->treemap);
+ compute_bit2idx(leastbit, i);
+
+ v = t = *treebin_at(m, i);
+ rsize = chunksize(t) - nb;
+
+ while ((t = leftmost_child(t)) != 0) {
+ size_t trem = chunksize(t) - nb;
+ if (trem < rsize) {
+ rsize = trem;
+ v = t;
+ }
+ }
+
+ if (RTCHECK(ok_address(m, v))) {
+ mchunkptr r = chunk_plus_offset(v, nb);
+ assert(chunksize(v) == rsize + nb);
+ if (RTCHECK(ok_next(v, r))) {
+ unlink_large_chunk(m, v);
+ if (rsize < MIN_CHUNK_SIZE)
+ set_inuse_and_pinuse(m, v, (rsize + nb));
+ else {
+ set_size_and_pinuse_of_inuse_chunk(m, v, nb);
+ set_size_and_pinuse_of_free_chunk(r, rsize);
+ replace_dv(m, r, rsize);
+ }
+ return chunk2mem(v);
+ }
+ }
+
+ CORRUPTION_ERROR_ACTION(m);
+ return 0;
+}
+
+/* --------------------------- realloc support --------------------------- */
+
+static void* internal_realloc(mstate m, void* oldmem, size_t bytes) {
+ if (bytes >= MAX_REQUEST) {
+ MALLOC_FAILURE_ACTION;
+ return 0;
+ }
+ if (!PREACTION(m)) {
+ mchunkptr oldp = mem2chunk(oldmem);
+ size_t oldsize = chunksize(oldp);
+ mchunkptr next = chunk_plus_offset(oldp, oldsize);
+ mchunkptr newp = 0;
+ void* extra = 0;
+
+ /* Try to either shrink or extend into top. Else malloc-copy-free */
+
+ if (RTCHECK(ok_address(m, oldp) && ok_cinuse(oldp) &&
+ ok_next(oldp, next) && ok_pinuse(next))) {
+ size_t nb = request2size(bytes);
+ if (is_mmapped(oldp))
+ newp = mmap_resize(m, oldp, nb);
+ else if (oldsize >= nb) { /* already big enough */
+ size_t rsize = oldsize - nb;
+ newp = oldp;
+ if (rsize >= MIN_CHUNK_SIZE) {
+ mchunkptr remainder = chunk_plus_offset(newp, nb);
+ set_inuse(m, newp, nb);
+ set_inuse(m, remainder, rsize);
+ extra = chunk2mem(remainder);
+ }
+ }
+ else if (next == m->top && oldsize + m->topsize > nb) {
+ /* Expand into top */
+ size_t newsize = oldsize + m->topsize;
+ size_t newtopsize = newsize - nb;
+ mchunkptr newtop = chunk_plus_offset(oldp, nb);
+ set_inuse(m, oldp, nb);
+ newtop->head = newtopsize |PINUSE_BIT;
+ m->top = newtop;
+ m->topsize = newtopsize;
+ newp = oldp;
+ }
+ }
+ else {
+ USAGE_ERROR_ACTION(m, oldmem);
+ POSTACTION(m);
+ return 0;
+ }
+
+ POSTACTION(m);
+
+ if (newp != 0) {
+ if (extra != 0) {
+ internal_free(m, extra);
+ }
+ check_inuse_chunk(m, newp);
+ return chunk2mem(newp);
+ }
+ else {
+ void* newmem = internal_malloc(m, bytes);
+ if (newmem != 0) {
+ size_t oc = oldsize - overhead_for(oldp);
+ memcpy(newmem, oldmem, (oc < bytes)? oc : bytes);
+ internal_free(m, oldmem);
+ }
+ return newmem;
+ }
+ }
+ return 0;
+}
+
+/* --------------------------- memalign support -------------------------- */
+
+static void* internal_memalign(mstate m, size_t alignment, size_t bytes) {
+ if (alignment <= MALLOC_ALIGNMENT) /* Can just use malloc */
+ return internal_malloc(m, bytes);
+ if (alignment < MIN_CHUNK_SIZE) /* must be at least a minimum chunk size */
+ alignment = MIN_CHUNK_SIZE;
+ if ((alignment & (alignment-SIZE_T_ONE)) != 0) {/* Ensure a power of 2 */
+ size_t a = MALLOC_ALIGNMENT << 1;
+ while (a < alignment) a <<= 1;
+ alignment = a;
+ }
+
+ if (bytes >= MAX_REQUEST - alignment) {
+ if (m != 0) { /* Test isn't needed but avoids compiler warning */
+ MALLOC_FAILURE_ACTION;
+ }
+ }
+ else {
+ size_t nb = request2size(bytes);
+ size_t req = nb + alignment + MIN_CHUNK_SIZE - CHUNK_OVERHEAD;
+ char* mem = (char*)internal_malloc(m, req);
+ if (mem != 0) {
+ void* leader = 0;
+ void* trailer = 0;
+ mchunkptr p = mem2chunk(mem);
+
+ if (PREACTION(m)) return 0;
+ if ((((size_t)(mem)) % alignment) != 0) { /* misaligned */
+ /*
+ Find an aligned spot inside chunk. Since we need to give
+ back leading space in a chunk of at least MIN_CHUNK_SIZE, if
+ the first calculation places us at a spot with less than
+ MIN_CHUNK_SIZE leader, we can move to the next aligned spot.
+ We've allocated enough total room so that this is always
+ possible.
+ */
+ char* br = (char*)mem2chunk((size_t)(((size_t)(mem +
+ alignment -
+ SIZE_T_ONE)) &
+ -alignment));
+ char* pos = ((size_t)(br - (char*)(p)) >= MIN_CHUNK_SIZE)?
+ br : br+alignment;
+ mchunkptr newp = (mchunkptr)pos;
+ size_t leadsize = pos - (char*)(p);
+ size_t newsize = chunksize(p) - leadsize;
+
+ if (is_mmapped(p)) { /* For mmapped chunks, just adjust offset */
+ newp->prev_foot = p->prev_foot + leadsize;
+ newp->head = (newsize|CINUSE_BIT);
+ }
+ else { /* Otherwise, give back leader, use the rest */
+ set_inuse(m, newp, newsize);
+ set_inuse(m, p, leadsize);
+ leader = chunk2mem(p);
+ }
+ p = newp;
+ }
+
+ /* Give back spare room at the end */
+ if (!is_mmapped(p)) {
+ size_t size = chunksize(p);
+ if (size > nb + MIN_CHUNK_SIZE) {
+ size_t remainder_size = size - nb;
+ mchunkptr remainder = chunk_plus_offset(p, nb);
+ set_inuse(m, p, nb);
+ set_inuse(m, remainder, remainder_size);
+ trailer = chunk2mem(remainder);
+ }
+ }
+
+ assert (chunksize(p) >= nb);
+ assert((((size_t)(chunk2mem(p))) % alignment) == 0);
+ check_inuse_chunk(m, p);
+ POSTACTION(m);
+ if (leader != 0) {
+ internal_free(m, leader);
+ }
+ if (trailer != 0) {
+ internal_free(m, trailer);
+ }
+ return chunk2mem(p);
+ }
+ }
+ return 0;
+}
+
+/* ------------------------ comalloc/coalloc support --------------------- */
+
+static void** ialloc(mstate m,
+ size_t n_elements,
+ size_t* sizes,
+ int opts,
+ void* chunks[]) {
+ /*
+ This provides common support for independent_X routines, handling
+ all of the combinations that can result.
+
+ The opts arg has:
+ bit 0 set if all elements are same size (using sizes[0])
+ bit 1 set if elements should be zeroed
+ */
+
+ size_t element_size; /* chunksize of each element, if all same */
+ size_t contents_size; /* total size of elements */
+ size_t array_size; /* request size of pointer array */
+ void* mem; /* malloced aggregate space */
+ mchunkptr p; /* corresponding chunk */
+ size_t remainder_size; /* remaining bytes while splitting */
+ void** marray; /* either "chunks" or malloced ptr array */
+ mchunkptr array_chunk; /* chunk for malloced ptr array */
+ flag_t was_enabled; /* to disable mmap */
+ size_t size;
+ size_t i;
+
+ /* compute array length, if needed */
+ if (chunks != 0) {
+ if (n_elements == 0)
+ return chunks; /* nothing to do */
+ marray = chunks;
+ array_size = 0;
+ }
+ else {
+ /* if empty req, must still return chunk representing empty array */
+ if (n_elements == 0)
+ return (void**)internal_malloc(m, 0);
+ marray = 0;
+ array_size = request2size(n_elements * (sizeof(void*)));
+ }
+
+ /* compute total element size */
+ if (opts & 0x1) { /* all-same-size */
+ element_size = request2size(*sizes);
+ contents_size = n_elements * element_size;
+ }
+ else { /* add up all the sizes */
+ element_size = 0;
+ contents_size = 0;
+ for (i = 0; i != n_elements; ++i)
+ contents_size += request2size(sizes[i]);
+ }
+
+ size = contents_size + array_size;
+
+ /*
+ Allocate the aggregate chunk. First disable direct-mmapping so
+ malloc won't use it, since we would not be able to later
+ free/realloc space internal to a segregated mmap region.
+ */
+ was_enabled = use_mmap(m);
+ disable_mmap(m);
+ mem = internal_malloc(m, size - CHUNK_OVERHEAD);
+ if (was_enabled)
+ enable_mmap(m);
+ if (mem == 0)
+ return 0;
+
+ if (PREACTION(m)) return 0;
+ p = mem2chunk(mem);
+ remainder_size = chunksize(p);
+
+ assert(!is_mmapped(p));
+
+ if (opts & 0x2) { /* optionally clear the elements */
+ memset((size_t*)mem, 0, remainder_size - SIZE_T_SIZE - array_size);
+ }
+
+ /* If not provided, allocate the pointer array as final part of chunk */
+ if (marray == 0) {
+ size_t array_chunk_size;
+ array_chunk = chunk_plus_offset(p, contents_size);
+ array_chunk_size = remainder_size - contents_size;
+ marray = (void**) (chunk2mem(array_chunk));
+ set_size_and_pinuse_of_inuse_chunk(m, array_chunk, array_chunk_size);
+ remainder_size = contents_size;
+ }
+
+ /* split out elements */
+ for (i = 0; ; ++i) {
+ marray[i] = chunk2mem(p);
+ if (i != n_elements-1) {
+ if (element_size != 0)
+ size = element_size;
+ else
+ size = request2size(sizes[i]);
+ remainder_size -= size;
+ set_size_and_pinuse_of_inuse_chunk(m, p, size);
+ p = chunk_plus_offset(p, size);
+ }
+ else { /* the final element absorbs any overallocation slop */
+ set_size_and_pinuse_of_inuse_chunk(m, p, remainder_size);
+ break;
+ }
+ }
+
+#if DEBUG
+ if (marray != chunks) {
+ /* final element must have exactly exhausted chunk */
+ if (element_size != 0) {
+ assert(remainder_size == element_size);
+ }
+ else {
+ assert(remainder_size == request2size(sizes[i]));
+ }
+ check_inuse_chunk(m, mem2chunk(marray));
+ }
+ for (i = 0; i != n_elements; ++i)
+ check_inuse_chunk(m, mem2chunk(marray[i]));
+
+#endif /* DEBUG */
+
+ POSTACTION(m);
+ return marray;
+}
+
+
+/* -------------------------- public routines ---------------------------- */
+
+#if !ONLY_MSPACES
+
+void* dlmalloc(size_t bytes) {
+ /*
+ Basic algorithm:
+ If a small request (< 256 bytes minus per-chunk overhead):
+ 1. If one exists, use a remainderless chunk in associated smallbin.
+ (Remainderless means that there are too few excess bytes to
+ represent as a chunk.)
+ 2. If it is big enough, use the dv chunk, which is normally the
+ chunk adjacent to the one used for the most recent small request.
+ 3. If one exists, split the smallest available chunk in a bin,
+ saving remainder in dv.
+ 4. If it is big enough, use the top chunk.
+ 5. If available, get memory from system and use it
+ Otherwise, for a large request:
+ 1. Find the smallest available binned chunk that fits, and use it
+ if it is better fitting than dv chunk, splitting if necessary.
+ 2. If better fitting than any binned chunk, use the dv chunk.
+ 3. If it is big enough, use the top chunk.
+ 4. If request size >= mmap threshold, try to directly mmap this chunk.
+ 5. If available, get memory from system and use it
+
+ The ugly goto's here ensure that postaction occurs along all paths.
+ */
+
+ if (!PREACTION(gm)) {
+ void* mem;
+ size_t nb;
+ if (bytes <= MAX_SMALL_REQUEST) {
+ bindex_t idx;
+ binmap_t smallbits;
+ nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes);
+ idx = small_index(nb);
+ smallbits = gm->smallmap >> idx;
+
+ if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */
+ mchunkptr b, p;
+ idx += ~smallbits & 1; /* Uses next bin if idx empty */
+ b = smallbin_at(gm, idx);
+ p = b->fd;
+ assert(chunksize(p) == small_index2size(idx));
+ unlink_first_small_chunk(gm, b, p, idx);
+ set_inuse_and_pinuse(gm, p, small_index2size(idx));
+ mem = chunk2mem(p);
+ check_malloced_chunk(gm, mem, nb);
+ goto postaction;
+ }
+
+ else if (nb > gm->dvsize) {
+ if (smallbits != 0) { /* Use chunk in next nonempty smallbin */
+ mchunkptr b, p, r;
+ size_t rsize;
+ bindex_t i;
+ binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx));
+ binmap_t leastbit = least_bit(leftbits);
+ compute_bit2idx(leastbit, i);
+ b = smallbin_at(gm, i);
+ p = b->fd;
+ assert(chunksize(p) == small_index2size(i));
+ unlink_first_small_chunk(gm, b, p, i);
+ rsize = small_index2size(i) - nb;
+ /* Fit here cannot be remainderless if 4byte sizes */
+ if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE)
+ set_inuse_and_pinuse(gm, p, small_index2size(i));
+ else {
+ set_size_and_pinuse_of_inuse_chunk(gm, p, nb);
+ r = chunk_plus_offset(p, nb);
+ set_size_and_pinuse_of_free_chunk(r, rsize);
+ replace_dv(gm, r, rsize);
+ }
+ mem = chunk2mem(p);
+ check_malloced_chunk(gm, mem, nb);
+ goto postaction;
+ }
+
+ else if (gm->treemap != 0 && (mem = tmalloc_small(gm, nb)) != 0) {
+ check_malloced_chunk(gm, mem, nb);
+ goto postaction;
+ }
+ }
+ }
+ else if (bytes >= MAX_REQUEST)
+ nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */
+ else {
+ nb = pad_request(bytes);
+ if (gm->treemap != 0 && (mem = tmalloc_large(gm, nb)) != 0) {
+ check_malloced_chunk(gm, mem, nb);
+ goto postaction;
+ }
+ }
+
+ if (nb <= gm->dvsize) {
+ size_t rsize = gm->dvsize - nb;
+ mchunkptr p = gm->dv;
+ if (rsize >= MIN_CHUNK_SIZE) { /* split dv */
+ mchunkptr r = gm->dv = chunk_plus_offset(p, nb);
+ gm->dvsize = rsize;
+ set_size_and_pinuse_of_free_chunk(r, rsize);
+ set_size_and_pinuse_of_inuse_chunk(gm, p, nb);
+ }
+ else { /* exhaust dv */
+ size_t dvs = gm->dvsize;
+ gm->dvsize = 0;
+ gm->dv = 0;
+ set_inuse_and_pinuse(gm, p, dvs);
+ }
+ mem = chunk2mem(p);
+ check_malloced_chunk(gm, mem, nb);
+ goto postaction;
+ }
+
+ else if (nb < gm->topsize) { /* Split top */
+ size_t rsize = gm->topsize -= nb;
+ mchunkptr p = gm->top;
+ mchunkptr r = gm->top = chunk_plus_offset(p, nb);
+ r->head = rsize | PINUSE_BIT;
+ set_size_and_pinuse_of_inuse_chunk(gm, p, nb);
+ mem = chunk2mem(p);
+ check_top_chunk(gm, gm->top);
+ check_malloced_chunk(gm, mem, nb);
+ goto postaction;
+ }
+
+ mem = sys_alloc(gm, nb);
+
+ postaction:
+ POSTACTION(gm);
+ return mem;
+ }
+
+ return 0;
+}
+
+void dlfree(void* mem) {
+ /*
+ Consolidate freed chunks with preceeding or succeeding bordering
+ free chunks, if they exist, and then place in a bin. Intermixed
+ with special cases for top, dv, mmapped chunks, and usage errors.
+ */
+
+ if (mem != 0) {
+ mchunkptr p = mem2chunk(mem);
+#if FOOTERS
+ mstate fm = get_mstate_for(p);
+ if (!ok_magic(fm)) {
+ USAGE_ERROR_ACTION(fm, p);
+ return;
+ }
+#else /* FOOTERS */
+#define fm gm
+#endif /* FOOTERS */
+ if (!PREACTION(fm)) {
+ check_inuse_chunk(fm, p);
+ if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) {
+ size_t psize = chunksize(p);
+ mchunkptr next = chunk_plus_offset(p, psize);
+ if (!pinuse(p)) {
+ size_t prevsize = p->prev_foot;
+ if ((prevsize & IS_MMAPPED_BIT) != 0) {
+ prevsize &= ~IS_MMAPPED_BIT;
+ psize += prevsize + MMAP_FOOT_PAD;
+ if (CALL_MUNMAP((char*)p - prevsize, psize) == 0)
+ fm->footprint -= psize;
+ goto postaction;
+ }
+ else {
+ mchunkptr prev = chunk_minus_offset(p, prevsize);
+ psize += prevsize;
+ p = prev;
+ if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */
+ if (p != fm->dv) {
+ unlink_chunk(fm, p, prevsize);
+ }
+ else if ((next->head & INUSE_BITS) == INUSE_BITS) {
+ fm->dvsize = psize;
+ set_free_with_pinuse(p, psize, next);
+ goto postaction;
+ }
+ }
+ else
+ goto erroraction;
+ }
+ }
+
+ if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) {
+ if (!cinuse(next)) { /* consolidate forward */
+ if (next == fm->top) {
+ size_t tsize = fm->topsize += psize;
+ fm->top = p;
+ p->head = tsize | PINUSE_BIT;
+ if (p == fm->dv) {
+ fm->dv = 0;
+ fm->dvsize = 0;
+ }
+ if (should_trim(fm, tsize))
+ sys_trim(fm, 0);
+ goto postaction;
+ }
+ else if (next == fm->dv) {
+ size_t dsize = fm->dvsize += psize;
+ fm->dv = p;
+ set_size_and_pinuse_of_free_chunk(p, dsize);
+ goto postaction;
+ }
+ else {
+ size_t nsize = chunksize(next);
+ psize += nsize;
+ unlink_chunk(fm, next, nsize);
+ set_size_and_pinuse_of_free_chunk(p, psize);
+ if (p == fm->dv) {
+ fm->dvsize = psize;
+ goto postaction;
+ }
+ }
+ }
+ else
+ set_free_with_pinuse(p, psize, next);
+ insert_chunk(fm, p, psize);
+ check_free_chunk(fm, p);
+ goto postaction;
+ }
+ }
+ erroraction:
+ USAGE_ERROR_ACTION(fm, p);
+ postaction:
+ POSTACTION(fm);
+ }
+ }
+#if !FOOTERS
+#undef fm
+#endif /* FOOTERS */
+}
+
+void* dlcalloc(size_t n_elements, size_t elem_size) {
+ void* mem;
+ size_t req = 0;
+ if (n_elements != 0) {
+ req = n_elements * elem_size;
+ if (((n_elements | elem_size) & ~(size_t)0xffff) &&
+ (req / n_elements != elem_size))
+ req = MAX_SIZE_T; /* force downstream failure on overflow */
+ }
+ mem = dlmalloc(req);
+ if (mem != 0 && calloc_must_clear(mem2chunk(mem)))
+ memset(mem, 0, req);
+ return mem;
+}
+
+void* dlrealloc(void* oldmem, size_t bytes) {
+ if (oldmem == 0)
+ return dlmalloc(bytes);
+#ifdef REALLOC_ZERO_BYTES_FREES
+ if (bytes == 0) {
+ dlfree(oldmem);
+ return 0;
+ }
+#endif /* REALLOC_ZERO_BYTES_FREES */
+ else {
+#if ! FOOTERS
+ mstate m = gm;
+#else /* FOOTERS */
+ mstate m = get_mstate_for(mem2chunk(oldmem));
+ if (!ok_magic(m)) {
+ USAGE_ERROR_ACTION(m, oldmem);
+ return 0;
+ }
+#endif /* FOOTERS */
+ return internal_realloc(m, oldmem, bytes);
+ }
+}
+
+void* dlmemalign(size_t alignment, size_t bytes) {
+ return internal_memalign(gm, alignment, bytes);
+}
+
+void** dlindependent_calloc(size_t n_elements, size_t elem_size,
+ void* chunks[]) {
+ size_t sz = elem_size; /* serves as 1-element array */
+ return ialloc(gm, n_elements, &sz, 3, chunks);
+}
+
+void** dlindependent_comalloc(size_t n_elements, size_t sizes[],
+ void* chunks[]) {
+ return ialloc(gm, n_elements, sizes, 0, chunks);
+}
+
+void* dlvalloc(size_t bytes) {
+ size_t pagesz;
+ init_mparams();
+ pagesz = mparams.page_size;
+ return dlmemalign(pagesz, bytes);
+}
+
+void* dlpvalloc(size_t bytes) {
+ size_t pagesz;
+ init_mparams();
+ pagesz = mparams.page_size;
+ return dlmemalign(pagesz, (bytes + pagesz - SIZE_T_ONE) & ~(pagesz - SIZE_T_ONE));
+}
+
+int dlmalloc_trim(size_t pad) {
+ int result = 0;
+ if (!PREACTION(gm)) {
+ result = sys_trim(gm, pad);
+ POSTACTION(gm);
+ }
+ return result;
+}
+
+size_t dlmalloc_footprint(void) {
+ return gm->footprint;
+}
+
+size_t dlmalloc_max_footprint(void) {
+ return gm->max_footprint;
+}
+
+#if !NO_MALLINFO
+struct mallinfo dlmallinfo(void) {
+ return internal_mallinfo(gm);
+}
+#endif /* NO_MALLINFO */
+
+void dlmalloc_stats() {
+ internal_malloc_stats(gm);
+}
+
+size_t dlmalloc_usable_size(void* mem) {
+ if (mem != 0) {
+ mchunkptr p = mem2chunk(mem);
+ if (cinuse(p))
+ return chunksize(p) - overhead_for(p);
+ }
+ return 0;
+}
+
+int dlmallopt(int param_number, int value) {
+ return change_mparam(param_number, value);
+}
+
+#endif /* !ONLY_MSPACES */
+
+/* ----------------------------- user mspaces ---------------------------- */
+
+#if MSPACES
+
+static mstate init_user_mstate(char* tbase, size_t tsize) {
+ size_t msize = pad_request(sizeof(struct malloc_state));
+ mchunkptr mn;
+ mchunkptr msp = align_as_chunk(tbase);
+ mstate m = (mstate)(chunk2mem(msp));
+ memset(m, 0, msize);
+ INITIAL_LOCK(&m->mutex);
+ msp->head = (msize|PINUSE_BIT|CINUSE_BIT);
+ m->seg.base = m->least_addr = tbase;
+ m->seg.size = m->footprint = m->max_footprint = tsize;
+ m->magic = mparams.magic;
+ m->mflags = mparams.default_mflags;
+ disable_contiguous(m);
+ init_bins(m);
+ mn = next_chunk(mem2chunk(m));
+ init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) - TOP_FOOT_SIZE);
+ check_top_chunk(m, m->top);
+ return m;
+}
+
+mspace create_mspace(size_t capacity, int locked) {
+ mstate m = 0;
+ size_t msize = pad_request(sizeof(struct malloc_state));
+ init_mparams(); /* Ensure pagesize etc initialized */
+
+ if (capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) {
+ size_t rs = ((capacity == 0)? mparams.granularity :
+ (capacity + TOP_FOOT_SIZE + msize));
+ size_t tsize = granularity_align(rs);
+ char* tbase = (char*)(CALL_MMAP(tsize));
+ if (tbase != CMFAIL) {
+ m = init_user_mstate(tbase, tsize);
+ m->seg.sflags = IS_MMAPPED_BIT;
+ set_lock(m, locked);
+ }
+ }
+ return (mspace)m;
+}
+
+mspace create_mspace_with_base(void* base, size_t capacity, int locked) {
+ mstate m = 0;
+ size_t msize = pad_request(sizeof(struct malloc_state));
+ init_mparams(); /* Ensure pagesize etc initialized */
+
+ if (capacity > msize + TOP_FOOT_SIZE &&
+ capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) {
+ m = init_user_mstate((char*)base, capacity);
+ m->seg.sflags = EXTERN_BIT;
+ set_lock(m, locked);
+ }
+ return (mspace)m;
+}
+
+size_t destroy_mspace(mspace msp) {
+ size_t freed = 0;
+ mstate ms = (mstate)msp;
+ if (ok_magic(ms)) {
+ msegmentptr sp = &ms->seg;
+ while (sp != 0) {
+ char* base = sp->base;
+ size_t size = sp->size;
+ flag_t flag = sp->sflags;
+ sp = sp->next;
+ if ((flag & IS_MMAPPED_BIT) && !(flag & EXTERN_BIT) &&
+ CALL_MUNMAP(base, size) == 0)
+ freed += size;
+ }
+ }
+ else {
+ USAGE_ERROR_ACTION(ms,ms);
+ }
+ return freed;
+}
+
+/*
+ mspace versions of routines are near-clones of the global
+ versions. This is not so nice but better than the alternatives.
+*/
+
+
+void* mspace_malloc(mspace msp, size_t bytes) {
+ mstate ms = (mstate)msp;
+ if (!ok_magic(ms)) {
+ USAGE_ERROR_ACTION(ms,ms);
+ return 0;
+ }
+ if (!PREACTION(ms)) {
+ void* mem;
+ size_t nb;
+ if (bytes <= MAX_SMALL_REQUEST) {
+ bindex_t idx;
+ binmap_t smallbits;
+ nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes);
+ idx = small_index(nb);
+ smallbits = ms->smallmap >> idx;
+
+ if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */
+ mchunkptr b, p;
+ idx += ~smallbits & 1; /* Uses next bin if idx empty */
+ b = smallbin_at(ms, idx);
+ p = b->fd;
+ assert(chunksize(p) == small_index2size(idx));
+ unlink_first_small_chunk(ms, b, p, idx);
+ set_inuse_and_pinuse(ms, p, small_index2size(idx));
+ mem = chunk2mem(p);
+ check_malloced_chunk(ms, mem, nb);
+ goto postaction;
+ }
+
+ else if (nb > ms->dvsize) {
+ if (smallbits != 0) { /* Use chunk in next nonempty smallbin */
+ mchunkptr b, p, r;
+ size_t rsize;
+ bindex_t i;
+ binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx));
+ binmap_t leastbit = least_bit(leftbits);
+ compute_bit2idx(leastbit, i);
+ b = smallbin_at(ms, i);
+ p = b->fd;
+ assert(chunksize(p) == small_index2size(i));
+ unlink_first_small_chunk(ms, b, p, i);
+ rsize = small_index2size(i) - nb;
+ /* Fit here cannot be remainderless if 4byte sizes */
+ if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE)
+ set_inuse_and_pinuse(ms, p, small_index2size(i));
+ else {
+ set_size_and_pinuse_of_inuse_chunk(ms, p, nb);
+ r = chunk_plus_offset(p, nb);
+ set_size_and_pinuse_of_free_chunk(r, rsize);
+ replace_dv(ms, r, rsize);
+ }
+ mem = chunk2mem(p);
+ check_malloced_chunk(ms, mem, nb);
+ goto postaction;
+ }
+
+ else if (ms->treemap != 0 && (mem = tmalloc_small(ms, nb)) != 0) {
+ check_malloced_chunk(ms, mem, nb);
+ goto postaction;
+ }
+ }
+ }
+ else if (bytes >= MAX_REQUEST)
+ nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */
+ else {
+ nb = pad_request(bytes);
+ if (ms->treemap != 0 && (mem = tmalloc_large(ms, nb)) != 0) {
+ check_malloced_chunk(ms, mem, nb);
+ goto postaction;
+ }
+ }
+
+ if (nb <= ms->dvsize) {
+ size_t rsize = ms->dvsize - nb;
+ mchunkptr p = ms->dv;
+ if (rsize >= MIN_CHUNK_SIZE) { /* split dv */
+ mchunkptr r = ms->dv = chunk_plus_offset(p, nb);
+ ms->dvsize = rsize;
+ set_size_and_pinuse_of_free_chunk(r, rsize);
+ set_size_and_pinuse_of_inuse_chunk(ms, p, nb);
+ }
+ else { /* exhaust dv */
+ size_t dvs = ms->dvsize;
+ ms->dvsize = 0;
+ ms->dv = 0;
+ set_inuse_and_pinuse(ms, p, dvs);
+ }
+ mem = chunk2mem(p);
+ check_malloced_chunk(ms, mem, nb);
+ goto postaction;
+ }
+
+ else if (nb < ms->topsize) { /* Split top */
+ size_t rsize = ms->topsize -= nb;
+ mchunkptr p = ms->top;
+ mchunkptr r = ms->top = chunk_plus_offset(p, nb);
+ r->head = rsize | PINUSE_BIT;
+ set_size_and_pinuse_of_inuse_chunk(ms, p, nb);
+ mem = chunk2mem(p);
+ check_top_chunk(ms, ms->top);
+ check_malloced_chunk(ms, mem, nb);
+ goto postaction;
+ }
+
+ mem = sys_alloc(ms, nb);
+
+ postaction:
+ POSTACTION(ms);
+ return mem;
+ }
+
+ return 0;
+}
+
+void mspace_free(mspace msp, void* mem) {
+ if (mem != 0) {
+ mchunkptr p = mem2chunk(mem);
+#if FOOTERS
+ mstate fm = get_mstate_for(p);
+#else /* FOOTERS */
+ mstate fm = (mstate)msp;
+#endif /* FOOTERS */
+ if (!ok_magic(fm)) {
+ USAGE_ERROR_ACTION(fm, p);
+ return;
+ }
+ if (!PREACTION(fm)) {
+ check_inuse_chunk(fm, p);
+ if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) {
+ size_t psize = chunksize(p);
+ mchunkptr next = chunk_plus_offset(p, psize);
+ if (!pinuse(p)) {
+ size_t prevsize = p->prev_foot;
+ if ((prevsize & IS_MMAPPED_BIT) != 0) {
+ prevsize &= ~IS_MMAPPED_BIT;
+ psize += prevsize + MMAP_FOOT_PAD;
+ if (CALL_MUNMAP((char*)p - prevsize, psize) == 0)
+ fm->footprint -= psize;
+ goto postaction;
+ }
+ else {
+ mchunkptr prev = chunk_minus_offset(p, prevsize);
+ psize += prevsize;
+ p = prev;
+ if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */
+ if (p != fm->dv) {
+ unlink_chunk(fm, p, prevsize);
+ }
+ else if ((next->head & INUSE_BITS) == INUSE_BITS) {
+ fm->dvsize = psize;
+ set_free_with_pinuse(p, psize, next);
+ goto postaction;
+ }
+ }
+ else
+ goto erroraction;
+ }
+ }
+
+ if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) {
+ if (!cinuse(next)) { /* consolidate forward */
+ if (next == fm->top) {
+ size_t tsize = fm->topsize += psize;
+ fm->top = p;
+ p->head = tsize | PINUSE_BIT;
+ if (p == fm->dv) {
+ fm->dv = 0;
+ fm->dvsize = 0;
+ }
+ if (should_trim(fm, tsize))
+ sys_trim(fm, 0);
+ goto postaction;
+ }
+ else if (next == fm->dv) {
+ size_t dsize = fm->dvsize += psize;
+ fm->dv = p;
+ set_size_and_pinuse_of_free_chunk(p, dsize);
+ goto postaction;
+ }
+ else {
+ size_t nsize = chunksize(next);
+ psize += nsize;
+ unlink_chunk(fm, next, nsize);
+ set_size_and_pinuse_of_free_chunk(p, psize);
+ if (p == fm->dv) {
+ fm->dvsize = psize;
+ goto postaction;
+ }
+ }
+ }
+ else
+ set_free_with_pinuse(p, psize, next);
+ insert_chunk(fm, p, psize);
+ check_free_chunk(fm, p);
+ goto postaction;
+ }
+ }
+ erroraction:
+ USAGE_ERROR_ACTION(fm, p);
+ postaction:
+ POSTACTION(fm);
+ }
+ }
+}
+
+void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size) {
+ void* mem;
+ size_t req = 0;
+ mstate ms = (mstate)msp;
+ if (!ok_magic(ms)) {
+ USAGE_ERROR_ACTION(ms,ms);
+ return 0;
+ }
+ if (n_elements != 0) {
+ req = n_elements * elem_size;
+ if (((n_elements | elem_size) & ~(size_t)0xffff) &&
+ (req / n_elements != elem_size))
+ req = MAX_SIZE_T; /* force downstream failure on overflow */
+ }
+ mem = internal_malloc(ms, req);
+ if (mem != 0 && calloc_must_clear(mem2chunk(mem)))
+ memset(mem, 0, req);
+ return mem;
+}
+
+void* mspace_realloc(mspace msp, void* oldmem, size_t bytes) {
+ if (oldmem == 0)
+ return mspace_malloc(msp, bytes);
+#ifdef REALLOC_ZERO_BYTES_FREES
+ if (bytes == 0) {
+ mspace_free(msp, oldmem);
+ return 0;
+ }
+#endif /* REALLOC_ZERO_BYTES_FREES */
+ else {
+#if FOOTERS
+ mchunkptr p = mem2chunk(oldmem);
+ mstate ms = get_mstate_for(p);
+#else /* FOOTERS */
+ mstate ms = (mstate)msp;
+#endif /* FOOTERS */
+ if (!ok_magic(ms)) {
+ USAGE_ERROR_ACTION(ms,ms);
+ return 0;
+ }
+ return internal_realloc(ms, oldmem, bytes);
+ }
+}
+
+void* mspace_memalign(mspace msp, size_t alignment, size_t bytes) {
+ mstate ms = (mstate)msp;
+ if (!ok_magic(ms)) {
+ USAGE_ERROR_ACTION(ms,ms);
+ return 0;
+ }
+ return internal_memalign(ms, alignment, bytes);
+}
+
+void** mspace_independent_calloc(mspace msp, size_t n_elements,
+ size_t elem_size, void* chunks[]) {
+ size_t sz = elem_size; /* serves as 1-element array */
+ mstate ms = (mstate)msp;
+ if (!ok_magic(ms)) {
+ USAGE_ERROR_ACTION(ms,ms);
+ return 0;
+ }
+ return ialloc(ms, n_elements, &sz, 3, chunks);
+}
+
+void** mspace_independent_comalloc(mspace msp, size_t n_elements,
+ size_t sizes[], void* chunks[]) {
+ mstate ms = (mstate)msp;
+ if (!ok_magic(ms)) {
+ USAGE_ERROR_ACTION(ms,ms);
+ return 0;
+ }
+ return ialloc(ms, n_elements, sizes, 0, chunks);
+}
+
+int mspace_trim(mspace msp, size_t pad) {
+ int result = 0;
+ mstate ms = (mstate)msp;
+ if (ok_magic(ms)) {
+ if (!PREACTION(ms)) {
+ result = sys_trim(ms, pad);
+ POSTACTION(ms);
+ }
+ }
+ else {
+ USAGE_ERROR_ACTION(ms,ms);
+ }
+ return result;
+}
+
+void mspace_malloc_stats(mspace msp) {
+ mstate ms = (mstate)msp;
+ if (ok_magic(ms)) {
+ internal_malloc_stats(ms);
+ }
+ else {
+ USAGE_ERROR_ACTION(ms,ms);
+ }
+}
+
+size_t mspace_footprint(mspace msp) {
+ size_t result;
+ mstate ms = (mstate)msp;
+ if (ok_magic(ms)) {
+ result = ms->footprint;
+ }
+ USAGE_ERROR_ACTION(ms,ms);
+ return result;
+}
+
+
+size_t mspace_max_footprint(mspace msp) {
+ size_t result;
+ mstate ms = (mstate)msp;
+ if (ok_magic(ms)) {
+ result = ms->max_footprint;
+ }
+ USAGE_ERROR_ACTION(ms,ms);
+ return result;
+}
+
+
+#if !NO_MALLINFO
+struct mallinfo mspace_mallinfo(mspace msp) {
+ mstate ms = (mstate)msp;
+ if (!ok_magic(ms)) {
+ USAGE_ERROR_ACTION(ms,ms);
+ }
+ return internal_mallinfo(ms);
+}
+#endif /* NO_MALLINFO */
+
+int mspace_mallopt(int param_number, int value) {
+ return change_mparam(param_number, value);
+}
+
+#endif /* MSPACES */
+
+/* -------------------- Alternative MORECORE functions ------------------- */
+
+/*
+ Guidelines for creating a custom version of MORECORE:
+
+ * For best performance, MORECORE should allocate in multiples of pagesize.
+ * MORECORE may allocate more memory than requested. (Or even less,
+ but this will usually result in a malloc failure.)
+ * MORECORE must not allocate memory when given argument zero, but
+ instead return one past the end address of memory from previous
+ nonzero call.
+ * For best performance, consecutive calls to MORECORE with positive
+ arguments should return increasing addresses, indicating that
+ space has been contiguously extended.
+ * Even though consecutive calls to MORECORE need not return contiguous
+ addresses, it must be OK for malloc'ed chunks to span multiple
+ regions in those cases where they do happen to be contiguous.
+ * MORECORE need not handle negative arguments -- it may instead
+ just return MFAIL when given negative arguments.
+ Negative arguments are always multiples of pagesize. MORECORE
+ must not misinterpret negative args as large positive unsigned
+ args. You can suppress all such calls from even occurring by defining
+ MORECORE_CANNOT_TRIM,
+
+ As an example alternative MORECORE, here is a custom allocator
+ kindly contributed for pre-OSX macOS. It uses virtually but not
+ necessarily physically contiguous non-paged memory (locked in,
+ present and won't get swapped out). You can use it by uncommenting
+ this section, adding some #includes, and setting up the appropriate
+ defines above:
+
+ #define MORECORE osMoreCore
+
+ There is also a shutdown routine that should somehow be called for
+ cleanup upon program exit.
+
+ #define MAX_POOL_ENTRIES 100
+ #define MINIMUM_MORECORE_SIZE (64 * 1024U)
+ static int next_os_pool;
+ void *our_os_pools[MAX_POOL_ENTRIES];
+
+ void *osMoreCore(int size)
+ {
+ void *ptr = 0;
+ static void *sbrk_top = 0;
+
+ if (size > 0)
+ {
+ if (size < MINIMUM_MORECORE_SIZE)
+ size = MINIMUM_MORECORE_SIZE;
+ if (CurrentExecutionLevel() == kTaskLevel)
+ ptr = PoolAllocateResident(size + RM_PAGE_SIZE, 0);
+ if (ptr == 0)
+ {
+ return (void *) MFAIL;
+ }
+ // save ptrs so they can be freed during cleanup
+ our_os_pools[next_os_pool] = ptr;
+ next_os_pool++;
+ ptr = (void *) ((((size_t) ptr) + RM_PAGE_MASK) & ~RM_PAGE_MASK);
+ sbrk_top = (char *) ptr + size;
+ return ptr;
+ }
+ else if (size < 0)
+ {
+ // we don't currently support shrink behavior
+ return (void *) MFAIL;
+ }
+ else
+ {
+ return sbrk_top;
+ }
+ }
+
+ // cleanup any allocated memory pools
+ // called as last thing before shutting down driver
+
+ void osCleanupMem(void)
+ {
+ void **ptr;
+
+ for (ptr = our_os_pools; ptr < &our_os_pools[MAX_POOL_ENTRIES]; ptr++)
+ if (*ptr)
+ {
+ PoolDeallocate(*ptr);
+ *ptr = 0;
+ }
+ }
+
+*/
+
+
+/* -----------------------------------------------------------------------
+History:
+ V2.8.3 Thu Sep 22 11:16:32 2005 Doug Lea (dl at gee)
+ * Add max_footprint functions
+ * Ensure all appropriate literals are size_t
+ * Fix conditional compilation problem for some #define settings
+ * Avoid concatenating segments with the one provided
+ in create_mspace_with_base
+ * Rename some variables to avoid compiler shadowing warnings
+ * Use explicit lock initialization.
+ * Better handling of sbrk interference.
+ * Simplify and fix segment insertion, trimming and mspace_destroy
+ * Reinstate REALLOC_ZERO_BYTES_FREES option from 2.7.x
+ * Thanks especially to Dennis Flanagan for help on these.
+
+ V2.8.2 Sun Jun 12 16:01:10 2005 Doug Lea (dl at gee)
+ * Fix memalign brace error.
+
+ V2.8.1 Wed Jun 8 16:11:46 2005 Doug Lea (dl at gee)
+ * Fix improper #endif nesting in C++
+ * Add explicit casts needed for C++
+
+ V2.8.0 Mon May 30 14:09:02 2005 Doug Lea (dl at gee)
+ * Use trees for large bins
+ * Support mspaces
+ * Use segments to unify sbrk-based and mmap-based system allocation,
+ removing need for emulation on most platforms without sbrk.
+ * Default safety checks
+ * Optional footer checks. Thanks to William Robertson for the idea.
+ * Internal code refactoring
+ * Incorporate suggestions and platform-specific changes.
+ Thanks to Dennis Flanagan, Colin Plumb, Niall Douglas,
+ Aaron Bachmann, Emery Berger, and others.
+ * Speed up non-fastbin processing enough to remove fastbins.
+ * Remove useless cfree() to avoid conflicts with other apps.
+ * Remove internal memcpy, memset. Compilers handle builtins better.
+ * Remove some options that no one ever used and rename others.
+
+ V2.7.2 Sat Aug 17 09:07:30 2002 Doug Lea (dl at gee)
+ * Fix malloc_state bitmap array misdeclaration
+
+ V2.7.1 Thu Jul 25 10:58:03 2002 Doug Lea (dl at gee)
+ * Allow tuning of FIRST_SORTED_BIN_SIZE
+ * Use PTR_UINT as type for all ptr->int casts. Thanks to John Belmonte.
+ * Better detection and support for non-contiguousness of MORECORE.
+ Thanks to Andreas Mueller, Conal Walsh, and Wolfram Gloger
+ * Bypass most of malloc if no frees. Thanks To Emery Berger.
+ * Fix freeing of old top non-contiguous chunk im sysmalloc.
+ * Raised default trim and map thresholds to 256K.
+ * Fix mmap-related #defines. Thanks to Lubos Lunak.
+ * Fix copy macros; added LACKS_FCNTL_H. Thanks to Neal Walfield.
+ * Branch-free bin calculation
+ * Default trim and mmap thresholds now 256K.
+
+ V2.7.0 Sun Mar 11 14:14:06 2001 Doug Lea (dl at gee)
+ * Introduce independent_comalloc and independent_calloc.
+ Thanks to Michael Pachos for motivation and help.
+ * Make optional .h file available
+ * Allow > 2GB requests on 32bit systems.
+ * new WIN32 sbrk, mmap, munmap, lock code from <Walter@GeNeSys-e.de>.
+ Thanks also to Andreas Mueller <a.mueller at paradatec.de>,
+ and Anonymous.
+ * Allow override of MALLOC_ALIGNMENT (Thanks to Ruud Waij for
+ helping test this.)
+ * memalign: check alignment arg
+ * realloc: don't try to shift chunks backwards, since this
+ leads to more fragmentation in some programs and doesn't
+ seem to help in any others.
+ * Collect all cases in malloc requiring system memory into sysmalloc
+ * Use mmap as backup to sbrk
+ * Place all internal state in malloc_state
+ * Introduce fastbins (although similar to 2.5.1)
+ * Many minor tunings and cosmetic improvements
+ * Introduce USE_PUBLIC_MALLOC_WRAPPERS, USE_MALLOC_LOCK
+ * Introduce MALLOC_FAILURE_ACTION, MORECORE_CONTIGUOUS
+ Thanks to Tony E. Bennett <tbennett@nvidia.com> and others.
+ * Include errno.h to support default failure action.
+
+ V2.6.6 Sun Dec 5 07:42:19 1999 Doug Lea (dl at gee)
+ * return null for negative arguments
+ * Added Several WIN32 cleanups from Martin C. Fong <mcfong at yahoo.com>
+ * Add 'LACKS_SYS_PARAM_H' for those systems without 'sys/param.h'
+ (e.g. WIN32 platforms)
+ * Cleanup header file inclusion for WIN32 platforms
+ * Cleanup code to avoid Microsoft Visual C++ compiler complaints
+ * Add 'USE_DL_PREFIX' to quickly allow co-existence with existing
+ memory allocation routines
+ * Set 'malloc_getpagesize' for WIN32 platforms (needs more work)
+ * Use 'assert' rather than 'ASSERT' in WIN32 code to conform to
+ usage of 'assert' in non-WIN32 code
+ * Improve WIN32 'sbrk()' emulation's 'findRegion()' routine to
+ avoid infinite loop
+ * Always call 'fREe()' rather than 'free()'
+
+ V2.6.5 Wed Jun 17 15:57:31 1998 Doug Lea (dl at gee)
+ * Fixed ordering problem with boundary-stamping
+
+ V2.6.3 Sun May 19 08:17:58 1996 Doug Lea (dl at gee)
+ * Added pvalloc, as recommended by H.J. Liu
+ * Added 64bit pointer support mainly from Wolfram Gloger
+ * Added anonymously donated WIN32 sbrk emulation
+ * Malloc, calloc, getpagesize: add optimizations from Raymond Nijssen
+ * malloc_extend_top: fix mask error that caused wastage after
+ foreign sbrks
+ * Add linux mremap support code from HJ Liu
+
+ V2.6.2 Tue Dec 5 06:52:55 1995 Doug Lea (dl at gee)
+ * Integrated most documentation with the code.
+ * Add support for mmap, with help from
+ Wolfram Gloger (Gloger@lrz.uni-muenchen.de).
+ * Use last_remainder in more cases.
+ * Pack bins using idea from colin@nyx10.cs.du.edu
+ * Use ordered bins instead of best-fit threshhold
+ * Eliminate block-local decls to simplify tracing and debugging.
+ * Support another case of realloc via move into top
+ * Fix error occuring when initial sbrk_base not word-aligned.
+ * Rely on page size for units instead of SBRK_UNIT to
+ avoid surprises about sbrk alignment conventions.
+ * Add mallinfo, mallopt. Thanks to Raymond Nijssen
+ (raymond@es.ele.tue.nl) for the suggestion.
+ * Add `pad' argument to malloc_trim and top_pad mallopt parameter.
+ * More precautions for cases where other routines call sbrk,
+ courtesy of Wolfram Gloger (Gloger@lrz.uni-muenchen.de).
+ * Added macros etc., allowing use in linux libc from
+ H.J. Lu (hjl@gnu.ai.mit.edu)
+ * Inverted this history list
+
+ V2.6.1 Sat Dec 2 14:10:57 1995 Doug Lea (dl at gee)
+ * Re-tuned and fixed to behave more nicely with V2.6.0 changes.
+ * Removed all preallocation code since under current scheme
+ the work required to undo bad preallocations exceeds
+ the work saved in good cases for most test programs.
+ * No longer use return list or unconsolidated bins since
+ no scheme using them consistently outperforms those that don't
+ given above changes.
+ * Use best fit for very large chunks to prevent some worst-cases.
+ * Added some support for debugging
+
+ V2.6.0 Sat Nov 4 07:05:23 1995 Doug Lea (dl at gee)
+ * Removed footers when chunks are in use. Thanks to
+ Paul Wilson (wilson@cs.texas.edu) for the suggestion.
+
+ V2.5.4 Wed Nov 1 07:54:51 1995 Doug Lea (dl at gee)
+ * Added malloc_trim, with help from Wolfram Gloger
+ (wmglo@Dent.MED.Uni-Muenchen.DE).
+
+ V2.5.3 Tue Apr 26 10:16:01 1994 Doug Lea (dl at g)
+
+ V2.5.2 Tue Apr 5 16:20:40 1994 Doug Lea (dl at g)
+ * realloc: try to expand in both directions
+ * malloc: swap order of clean-bin strategy;
+ * realloc: only conditionally expand backwards
+ * Try not to scavenge used bins
+ * Use bin counts as a guide to preallocation
+ * Occasionally bin return list chunks in first scan
+ * Add a few optimizations from colin@nyx10.cs.du.edu
+
+ V2.5.1 Sat Aug 14 15:40:43 1993 Doug Lea (dl at g)
+ * faster bin computation & slightly different binning
+ * merged all consolidations to one part of malloc proper
+ (eliminating old malloc_find_space & malloc_clean_bin)
+ * Scan 2 returns chunks (not just 1)
+ * Propagate failure in realloc if malloc returns 0
+ * Add stuff to allow compilation on non-ANSI compilers
+ from kpv@research.att.com
+
+ V2.5 Sat Aug 7 07:41:59 1993 Doug Lea (dl at g.oswego.edu)
+ * removed potential for odd address access in prev_chunk
+ * removed dependency on getpagesize.h
+ * misc cosmetics and a bit more internal documentation
+ * anticosmetics: mangled names in macros to evade debugger strangeness
+ * tested on sparc, hp-700, dec-mips, rs6000
+ with gcc & native cc (hp, dec only) allowing
+ Detlefs & Zorn comparison study (in SIGPLAN Notices.)
+
+ 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/distrib/sdl-1.2.15/src/stdlib/SDL_qsort.c b/distrib/sdl-1.2.15/src/stdlib/SDL_qsort.c
new file mode 100644
index 0000000..2b5abea
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/stdlib/SDL_qsort.c
@@ -0,0 +1,443 @@
+/* qsort.c
+ * (c) 1998 Gareth McCaughan
+ *
+ * This is a drop-in replacement for the C library's |qsort()| routine.
+ *
+ * Features:
+ * - Median-of-three pivoting (and more)
+ * - Truncation and final polishing by a single insertion sort
+ * - Early truncation when no swaps needed in pivoting step
+ * - Explicit recursion, guaranteed not to overflow
+ * - A few little wrinkles stolen from the GNU |qsort()|.
+ * - separate code for non-aligned / aligned / word-size objects
+ *
+ * This code may be reproduced freely provided
+ * - this file is retained unaltered apart from minor
+ * changes for portability and efficiency
+ * - no changes are made to this comment
+ * - any changes that *are* made are clearly flagged
+ * - the _ID string below is altered by inserting, after
+ * the date, the string " altered" followed at your option
+ * by other material. (Exceptions: you may change the name
+ * of the exported routine without changing the ID string.
+ * You may change the values of the macros TRUNC_* and
+ * PIVOT_THRESHOLD without changing the ID string, provided
+ * they remain constants with TRUNC_nonaligned, TRUNC_aligned
+ * and TRUNC_words/WORD_BYTES between 8 and 24, and
+ * PIVOT_THRESHOLD between 32 and 200.)
+ *
+ * You may use it in anything you like; you may make money
+ * out of it; you may distribute it in object form or as
+ * part of an executable without including source code;
+ * you don't have to credit me. (But it would be nice if
+ * you did.)
+ *
+ * If you find problems with this code, or find ways of
+ * making it significantly faster, please let me know!
+ * My e-mail address, valid as of early 1998 and certainly
+ * OK for at least the next 18 months, is
+ * gjm11@dpmms.cam.ac.uk
+ * Thanks!
+ *
+ * Gareth McCaughan Peterhouse Cambridge 1998
+ */
+#include "SDL_config.h"
+
+/*
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+*/
+#include "SDL_stdinc.h"
+
+#ifdef assert
+#undef assert
+#endif
+#define assert(X)
+#ifdef malloc
+#undef malloc
+#endif
+#define malloc SDL_malloc
+#ifdef free
+#undef free
+#endif
+#define free SDL_free
+#ifdef memcpy
+#undef memcpy
+#endif
+#define memcpy SDL_memcpy
+#ifdef memmove
+#undef memmove
+#endif
+#define memmove SDL_memmove
+#ifdef qsort
+#undef qsort
+#endif
+#define qsort SDL_qsort
+
+
+#ifndef HAVE_QSORT
+
+static char _ID[]="<qsort.c gjm 1.12 1998-03-19>";
+
+/* How many bytes are there per word? (Must be a power of 2,
+ * and must in fact equal sizeof(int).)
+ */
+#define WORD_BYTES sizeof(int)
+
+/* How big does our stack need to be? Answer: one entry per
+ * bit in a |size_t|.
+ */
+#define STACK_SIZE (8*sizeof(size_t))
+
+/* Different situations have slightly different requirements,
+ * and we make life epsilon easier by using different truncation
+ * points for the three different cases.
+ * So far, I have tuned TRUNC_words and guessed that the same
+ * value might work well for the other two cases. Of course
+ * what works well on my machine might work badly on yours.
+ */
+#define TRUNC_nonaligned 12
+#define TRUNC_aligned 12
+#define TRUNC_words 12*WORD_BYTES /* nb different meaning */
+
+/* We use a simple pivoting algorithm for shortish sub-arrays
+ * and a more complicated one for larger ones. The threshold
+ * is PIVOT_THRESHOLD.
+ */
+#define PIVOT_THRESHOLD 40
+
+typedef struct { char * first; char * last; } stack_entry;
+#define pushLeft {stack[stacktop].first=ffirst;stack[stacktop++].last=last;}
+#define pushRight {stack[stacktop].first=first;stack[stacktop++].last=llast;}
+#define doLeft {first=ffirst;llast=last;continue;}
+#define doRight {ffirst=first;last=llast;continue;}
+#define pop {if (--stacktop<0) break;\
+ first=ffirst=stack[stacktop].first;\
+ last=llast=stack[stacktop].last;\
+ continue;}
+
+/* Some comments on the implementation.
+ * 1. When we finish partitioning the array into "low"
+ * and "high", we forget entirely about short subarrays,
+ * because they'll be done later by insertion sort.
+ * Doing lots of little insertion sorts might be a win
+ * on large datasets for locality-of-reference reasons,
+ * but it makes the code much nastier and increases
+ * bookkeeping overhead.
+ * 2. We always save the shorter and get to work on the
+ * longer. This guarantees that every time we push
+ * an item onto the stack its size is <= 1/2 of that
+ * of its parent; so the stack can't need more than
+ * log_2(max-array-size) entries.
+ * 3. We choose a pivot by looking at the first, last
+ * and middle elements. We arrange them into order
+ * because it's easy to do that in conjunction with
+ * choosing the pivot, and it makes things a little
+ * easier in the partitioning step. Anyway, the pivot
+ * is the middle of these three. It's still possible
+ * to construct datasets where the algorithm takes
+ * time of order n^2, but it simply never happens in
+ * practice.
+ * 3' Newsflash: On further investigation I find that
+ * it's easy to construct datasets where median-of-3
+ * simply isn't good enough. So on large-ish subarrays
+ * we do a more sophisticated pivoting: we take three
+ * sets of 3 elements, find their medians, and then
+ * take the median of those.
+ * 4. We copy the pivot element to a separate place
+ * because that way we can always do our comparisons
+ * directly against a pointer to that separate place,
+ * and don't have to wonder "did we move the pivot
+ * element?". This makes the inner loop better.
+ * 5. It's possible to make the pivoting even more
+ * reliable by looking at more candidates when n
+ * is larger. (Taking this to its logical conclusion
+ * results in a variant of quicksort that doesn't
+ * have that n^2 worst case.) However, the overhead
+ * from the extra bookkeeping means that it's just
+ * not worth while.
+ * 6. This is pretty clean and portable code. Here are
+ * all the potential portability pitfalls and problems
+ * I know of:
+ * - In one place (the insertion sort) I construct
+ * a pointer that points just past the end of the
+ * supplied array, and assume that (a) it won't
+ * compare equal to any pointer within the array,
+ * and (b) it will compare equal to a pointer
+ * obtained by stepping off the end of the array.
+ * These might fail on some segmented architectures.
+ * - I assume that there are 8 bits in a |char| when
+ * computing the size of stack needed. This would
+ * fail on machines with 9-bit or 16-bit bytes.
+ * - I assume that if |((int)base&(sizeof(int)-1))==0|
+ * and |(size&(sizeof(int)-1))==0| then it's safe to
+ * get at array elements via |int*|s, and that if
+ * actually |size==sizeof(int)| as well then it's
+ * safe to treat the elements as |int|s. This might
+ * fail on systems that convert pointers to integers
+ * in non-standard ways.
+ * - I assume that |8*sizeof(size_t)<=INT_MAX|. This
+ * would be false on a machine with 8-bit |char|s,
+ * 16-bit |int|s and 4096-bit |size_t|s. :-)
+ */
+
+/* The recursion logic is the same in each case: */
+#define Recurse(Trunc) \
+ { size_t l=last-ffirst,r=llast-first; \
+ if (l<Trunc) { \
+ if (r>=Trunc) doRight \
+ else pop \
+ } \
+ else if (l<=r) { pushLeft; doRight } \
+ else if (r>=Trunc) { pushRight; doLeft }\
+ else doLeft \
+ }
+
+/* and so is the pivoting logic: */
+#define Pivot(swapper,sz) \
+ if ((size_t)(last-first)>PIVOT_THRESHOLD*sz) mid=pivot_big(first,mid,last,sz,compare);\
+ else { \
+ if (compare(first,mid)<0) { \
+ if (compare(mid,last)>0) { \
+ swapper(mid,last); \
+ if (compare(first,mid)>0) swapper(first,mid);\
+ } \
+ } \
+ else { \
+ if (compare(mid,last)>0) swapper(first,last)\
+ else { \
+ swapper(first,mid); \
+ if (compare(mid,last)>0) swapper(mid,last);\
+ } \
+ } \
+ first+=sz; last-=sz; \
+ }
+
+#ifdef DEBUG_QSORT
+#include <stdio.h>
+#endif
+
+/* and so is the partitioning logic: */
+#define Partition(swapper,sz) { \
+ int swapped=0; \
+ do { \
+ while (compare(first,pivot)<0) first+=sz; \
+ while (compare(pivot,last)<0) last-=sz; \
+ if (first<last) { \
+ swapper(first,last); swapped=1; \
+ first+=sz; last-=sz; } \
+ else if (first==last) { first+=sz; last-=sz; break; }\
+ } while (first<=last); \
+ if (!swapped) pop \
+}
+
+/* and so is the pre-insertion-sort operation of putting
+ * the smallest element into place as a sentinel.
+ * Doing this makes the inner loop nicer. I got this
+ * idea from the GNU implementation of qsort().
+ */
+#define PreInsertion(swapper,limit,sz) \
+ first=base; \
+ last=first + (nmemb>limit ? limit : nmemb-1)*sz;\
+ while (last!=base) { \
+ if (compare(first,last)>0) first=last; \
+ last-=sz; } \
+ if (first!=base) swapper(first,(char*)base);
+
+/* and so is the insertion sort, in the first two cases: */
+#define Insertion(swapper) \
+ last=((char*)base)+nmemb*size; \
+ for (first=((char*)base)+size;first!=last;first+=size) { \
+ char *test; \
+ /* Find the right place for |first|. \
+ * My apologies for var reuse. */ \
+ for (test=first-size;compare(test,first)>0;test-=size) ; \
+ test+=size; \
+ if (test!=first) { \
+ /* Shift everything in [test,first) \
+ * up by one, and place |first| \
+ * where |test| is. */ \
+ memcpy(pivot,first,size); \
+ memmove(test+size,test,first-test); \
+ memcpy(test,pivot,size); \
+ } \
+ }
+
+#define SWAP_nonaligned(a,b) { \
+ register char *aa=(a),*bb=(b); \
+ register size_t sz=size; \
+ do { register char t=*aa; *aa++=*bb; *bb++=t; } while (--sz); }
+
+#define SWAP_aligned(a,b) { \
+ register int *aa=(int*)(a),*bb=(int*)(b); \
+ register size_t sz=size; \
+ do { register int t=*aa;*aa++=*bb; *bb++=t; } while (sz-=WORD_BYTES); }
+
+#define SWAP_words(a,b) { \
+ register int t=*((int*)a); *((int*)a)=*((int*)b); *((int*)b)=t; }
+
+/* ---------------------------------------------------------------------- */
+
+static char * pivot_big(char *first, char *mid, char *last, size_t size,
+ int compare(const void *, const void *)) {
+ size_t d=(((last-first)/size)>>3)*size;
+ char *m1,*m2,*m3;
+ { char *a=first, *b=first+d, *c=first+2*d;
+#ifdef DEBUG_QSORT
+fprintf(stderr,"< %d %d %d\n",*(int*)a,*(int*)b,*(int*)c);
+#endif
+ m1 = compare(a,b)<0 ?
+ (compare(b,c)<0 ? b : (compare(a,c)<0 ? c : a))
+ : (compare(a,c)<0 ? a : (compare(b,c)<0 ? c : b));
+ }
+ { char *a=mid-d, *b=mid, *c=mid+d;
+#ifdef DEBUG_QSORT
+fprintf(stderr,". %d %d %d\n",*(int*)a,*(int*)b,*(int*)c);
+#endif
+ m2 = compare(a,b)<0 ?
+ (compare(b,c)<0 ? b : (compare(a,c)<0 ? c : a))
+ : (compare(a,c)<0 ? a : (compare(b,c)<0 ? c : b));
+ }
+ { char *a=last-2*d, *b=last-d, *c=last;
+#ifdef DEBUG_QSORT
+fprintf(stderr,"> %d %d %d\n",*(int*)a,*(int*)b,*(int*)c);
+#endif
+ m3 = compare(a,b)<0 ?
+ (compare(b,c)<0 ? b : (compare(a,c)<0 ? c : a))
+ : (compare(a,c)<0 ? a : (compare(b,c)<0 ? c : b));
+ }
+#ifdef DEBUG_QSORT
+fprintf(stderr,"-> %d %d %d\n",*(int*)m1,*(int*)m2,*(int*)m3);
+#endif
+ return compare(m1,m2)<0 ?
+ (compare(m2,m3)<0 ? m2 : (compare(m1,m3)<0 ? m3 : m1))
+ : (compare(m1,m3)<0 ? m1 : (compare(m2,m3)<0 ? m3 : m2));
+}
+
+/* ---------------------------------------------------------------------- */
+
+static void qsort_nonaligned(void *base, size_t nmemb, size_t size,
+ int (*compare)(const void *, const void *)) {
+
+ stack_entry stack[STACK_SIZE];
+ int stacktop=0;
+ char *first,*last;
+ char *pivot=malloc(size);
+ size_t trunc=TRUNC_nonaligned*size;
+ assert(pivot!=0);
+
+ first=(char*)base; last=first+(nmemb-1)*size;
+
+ if ((size_t)(last-first)>trunc) {
+ char *ffirst=first, *llast=last;
+ while (1) {
+ /* Select pivot */
+ { char * mid=first+size*((last-first)/size >> 1);
+ Pivot(SWAP_nonaligned,size);
+ memcpy(pivot,mid,size);
+ }
+ /* Partition. */
+ Partition(SWAP_nonaligned,size);
+ /* Prepare to recurse/iterate. */
+ Recurse(trunc)
+ }
+ }
+ PreInsertion(SWAP_nonaligned,TRUNC_nonaligned,size);
+ Insertion(SWAP_nonaligned);
+ free(pivot);
+}
+
+static void qsort_aligned(void *base, size_t nmemb, size_t size,
+ int (*compare)(const void *, const void *)) {
+
+ stack_entry stack[STACK_SIZE];
+ int stacktop=0;
+ char *first,*last;
+ char *pivot=malloc(size);
+ size_t trunc=TRUNC_aligned*size;
+ assert(pivot!=0);
+
+ first=(char*)base; last=first+(nmemb-1)*size;
+
+ if ((size_t)(last-first)>trunc) {
+ char *ffirst=first,*llast=last;
+ while (1) {
+ /* Select pivot */
+ { char * mid=first+size*((last-first)/size >> 1);
+ Pivot(SWAP_aligned,size);
+ memcpy(pivot,mid,size);
+ }
+ /* Partition. */
+ Partition(SWAP_aligned,size);
+ /* Prepare to recurse/iterate. */
+ Recurse(trunc)
+ }
+ }
+ PreInsertion(SWAP_aligned,TRUNC_aligned,size);
+ Insertion(SWAP_aligned);
+ free(pivot);
+}
+
+static void qsort_words(void *base, size_t nmemb,
+ int (*compare)(const void *, const void *)) {
+
+ stack_entry stack[STACK_SIZE];
+ int stacktop=0;
+ char *first,*last;
+ char *pivot=malloc(WORD_BYTES);
+ assert(pivot!=0);
+
+ first=(char*)base; last=first+(nmemb-1)*WORD_BYTES;
+
+ if (last-first>TRUNC_words) {
+ char *ffirst=first, *llast=last;
+ while (1) {
+#ifdef DEBUG_QSORT
+fprintf(stderr,"Doing %d:%d: ",
+ (first-(char*)base)/WORD_BYTES,
+ (last-(char*)base)/WORD_BYTES);
+#endif
+ /* Select pivot */
+ { char * mid=first+WORD_BYTES*((last-first) / (2*WORD_BYTES));
+ Pivot(SWAP_words,WORD_BYTES);
+ *(int*)pivot=*(int*)mid;
+ }
+#ifdef DEBUG_QSORT
+fprintf(stderr,"pivot=%d\n",*(int*)pivot);
+#endif
+ /* Partition. */
+ Partition(SWAP_words,WORD_BYTES);
+ /* Prepare to recurse/iterate. */
+ Recurse(TRUNC_words)
+ }
+ }
+ PreInsertion(SWAP_words,(TRUNC_words/WORD_BYTES),WORD_BYTES);
+ /* Now do insertion sort. */
+ last=((char*)base)+nmemb*WORD_BYTES;
+ for (first=((char*)base)+WORD_BYTES;first!=last;first+=WORD_BYTES) {
+ /* Find the right place for |first|. My apologies for var reuse */
+ int *pl=(int*)(first-WORD_BYTES),*pr=(int*)first;
+ *(int*)pivot=*(int*)first;
+ for (;compare(pl,pivot)>0;pr=pl,--pl) {
+ *pr=*pl; }
+ if (pr!=(int*)first) *pr=*(int*)pivot;
+ }
+ free(pivot);
+}
+
+/* ---------------------------------------------------------------------- */
+
+void qsort(void *base, size_t nmemb, size_t size,
+ int (*compare)(const void *, const void *)) {
+
+ if (nmemb<=1) return;
+ if (((uintptr_t)base|size)&(WORD_BYTES-1))
+ qsort_nonaligned(base,nmemb,size,compare);
+ else if (size!=WORD_BYTES)
+ qsort_aligned(base,nmemb,size,compare);
+ else
+ qsort_words(base,nmemb,compare);
+}
+
+#endif /* !HAVE_QSORT */
diff --git a/distrib/sdl-1.2.15/src/stdlib/SDL_stdlib.c b/distrib/sdl-1.2.15/src/stdlib/SDL_stdlib.c
new file mode 100644
index 0000000..5c88fe7
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/stdlib/SDL_stdlib.c
@@ -0,0 +1,620 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This file contains portable stdlib functions for SDL */
+
+#include "SDL_stdinc.h"
+
+#ifndef HAVE_LIBC
+/* These are some C runtime intrinsics that need to be defined */
+
+#if defined(_MSC_VER)
+
+#ifndef __FLTUSED__
+#define __FLTUSED__
+#ifdef __cplusplus
+ extern "C"
+#endif
+ __declspec(selectany) int _fltused=1;
+#endif
+
+/* Float to long */
+void __declspec(naked) _ftol()
+{
+ __asm {
+ push ebp
+ mov ebp,esp
+ sub esp,20h
+ and esp,0FFFFFFF0h
+ fld st(0)
+ fst dword ptr [esp+18h]
+ fistp qword ptr [esp+10h]
+ fild qword ptr [esp+10h]
+ mov edx,dword ptr [esp+18h]
+ mov eax,dword ptr [esp+10h]
+ test eax,eax
+ je integer_QnaN_or_zero
+arg_is_not_integer_QnaN:
+ fsubp st(1),st
+ test edx,edx
+ jns positive
+ fstp dword ptr [esp]
+ mov ecx,dword ptr [esp]
+ xor ecx,80000000h
+ add ecx,7FFFFFFFh
+ adc eax,0
+ mov edx,dword ptr [esp+14h]
+ adc edx,0
+ jmp localexit
+positive:
+ fstp dword ptr [esp]
+ mov ecx,dword ptr [esp]
+ add ecx,7FFFFFFFh
+ sbb eax,0
+ mov edx,dword ptr [esp+14h]
+ sbb edx,0
+ jmp localexit
+integer_QnaN_or_zero:
+ mov edx,dword ptr [esp+14h]
+ test edx,7FFFFFFFh
+ jne arg_is_not_integer_QnaN
+ fstp dword ptr [esp+18h]
+ fstp dword ptr [esp+18h]
+localexit:
+ leave
+ ret
+ }
+}
+void __declspec(naked) _ftol2_sse()
+{
+ _ftol();
+}
+
+/* 64-bit math operators for 32-bit systems */
+void __declspec(naked) _allmul()
+{
+ __asm {
+ push ebp
+ mov ebp,esp
+ push edi
+ push esi
+ push ebx
+ sub esp,0Ch
+ mov eax,dword ptr [ebp+10h]
+ mov edi,dword ptr [ebp+8]
+ mov ebx,eax
+ mov esi,eax
+ sar esi,1Fh
+ mov eax,dword ptr [ebp+8]
+ mul ebx
+ imul edi,esi
+ mov ecx,edx
+ mov dword ptr [ebp-18h],eax
+ mov edx,dword ptr [ebp+0Ch]
+ add ecx,edi
+ imul ebx,edx
+ mov eax,dword ptr [ebp-18h]
+ lea ebx,[ebx+ecx]
+ mov dword ptr [ebp-14h],ebx
+ mov edx,dword ptr [ebp-14h]
+ add esp,0Ch
+ pop ebx
+ pop esi
+ pop edi
+ pop ebp
+ ret
+ }
+}
+void __declspec(naked) _alldiv()
+{
+ __asm {
+ push edi
+ push esi
+ push ebx
+ xor edi,edi
+ mov eax,dword ptr [esp+14h]
+ or eax,eax
+ jge L1
+ inc edi
+ mov edx,dword ptr [esp+10h]
+ neg eax
+ neg edx
+ sbb eax,0
+ mov dword ptr [esp+14h],eax
+ mov dword ptr [esp+10h],edx
+L1:
+ mov eax,dword ptr [esp+1Ch]
+ or eax,eax
+ jge L2
+ inc edi
+ mov edx,dword ptr [esp+18h]
+ neg eax
+ neg edx
+ sbb eax,0
+ mov dword ptr [esp+1Ch],eax
+ mov dword ptr [esp+18h],edx
+L2:
+ or eax,eax
+ jne L3
+ mov ecx,dword ptr [esp+18h]
+ mov eax,dword ptr [esp+14h]
+ xor edx,edx
+ div ecx
+ mov ebx,eax
+ mov eax,dword ptr [esp+10h]
+ div ecx
+ mov edx,ebx
+ jmp L4
+L3:
+ mov ebx,eax
+ mov ecx,dword ptr [esp+18h]
+ mov edx,dword ptr [esp+14h]
+ mov eax,dword ptr [esp+10h]
+L5:
+ shr ebx,1
+ rcr ecx,1
+ shr edx,1
+ rcr eax,1
+ or ebx,ebx
+ jne L5
+ div ecx
+ mov esi,eax
+ mul dword ptr [esp+1Ch]
+ mov ecx,eax
+ mov eax,dword ptr [esp+18h]
+ mul esi
+ add edx,ecx
+ jb L6
+ cmp edx,dword ptr [esp+14h]
+ ja L6
+ jb L7
+ cmp eax,dword ptr [esp+10h]
+ jbe L7
+L6:
+ dec esi
+L7:
+ xor edx,edx
+ mov eax,esi
+L4:
+ dec edi
+ jne L8
+ neg edx
+ neg eax
+ sbb edx,0
+L8:
+ pop ebx
+ pop esi
+ pop edi
+ ret 10h
+ }
+}
+void __declspec(naked) _aulldiv()
+{
+ __asm {
+ push ebx
+ push esi
+ mov eax,dword ptr [esp+18h]
+ or eax,eax
+ jne L1
+ mov ecx,dword ptr [esp+14h]
+ mov eax,dword ptr [esp+10h]
+ xor edx,edx
+ div ecx
+ mov ebx,eax
+ mov eax,dword ptr [esp+0Ch]
+ div ecx
+ mov edx,ebx
+ jmp L2
+L1:
+ mov ecx,eax
+ mov ebx,dword ptr [esp+14h]
+ mov edx,dword ptr [esp+10h]
+ mov eax,dword ptr [esp+0Ch]
+L3:
+ shr ecx,1
+ rcr ebx,1
+ shr edx,1
+ rcr eax,1
+ or ecx,ecx
+ jne L3
+ div ebx
+ mov esi,eax
+ mul dword ptr [esp+18h]
+ mov ecx,eax
+ mov eax,dword ptr [esp+14h]
+ mul esi
+ add edx,ecx
+ jb L4
+ cmp edx,dword ptr [esp+10h]
+ ja L4
+ jb L5
+ cmp eax,dword ptr [esp+0Ch]
+ jbe L5
+L4:
+ dec esi
+L5:
+ xor edx,edx
+ mov eax,esi
+L2:
+ pop esi
+ pop ebx
+ ret 10h
+ }
+}
+void __declspec(naked) _allrem()
+{
+ __asm {
+ push ebx
+ push edi
+ xor edi,edi
+ mov eax,dword ptr [esp+10h]
+ or eax,eax
+ jge L1
+ inc edi
+ mov edx,dword ptr [esp+0Ch]
+ neg eax
+ neg edx
+ sbb eax,0
+ mov dword ptr [esp+10h],eax
+ mov dword ptr [esp+0Ch],edx
+L1:
+ mov eax,dword ptr [esp+18h]
+ or eax,eax
+ jge L2
+ mov edx,dword ptr [esp+14h]
+ neg eax
+ neg edx
+ sbb eax,0
+ mov dword ptr [esp+18h],eax
+ mov dword ptr [esp+14h],edx
+L2:
+ or eax,eax
+ jne L3
+ mov ecx,dword ptr [esp+14h]
+ mov eax,dword ptr [esp+10h]
+ xor edx,edx
+ div ecx
+ mov eax,dword ptr [esp+0Ch]
+ div ecx
+ mov eax,edx
+ xor edx,edx
+ dec edi
+ jns L4
+ jmp L8
+L3:
+ mov ebx,eax
+ mov ecx,dword ptr [esp+14h]
+ mov edx,dword ptr [esp+10h]
+ mov eax,dword ptr [esp+0Ch]
+L5:
+ shr ebx,1
+ rcr ecx,1
+ shr edx,1
+ rcr eax,1
+ or ebx,ebx
+ jne L5
+ div ecx
+ mov ecx,eax
+ mul dword ptr [esp+18h]
+ xchg eax,ecx
+ mul dword ptr [esp+14h]
+ add edx,ecx
+ jb L6
+ cmp edx,dword ptr [esp+10h]
+ ja L6
+ jb L7
+ cmp eax,dword ptr [esp+0Ch]
+ jbe L7
+L6:
+ sub eax,dword ptr [esp+14h]
+ sbb edx,dword ptr [esp+18h]
+L7:
+ sub eax,dword ptr [esp+0Ch]
+ sbb edx,dword ptr [esp+10h]
+ dec edi
+ jns L8
+L4:
+ neg edx
+ neg eax
+ sbb edx,0
+L8:
+ pop edi
+ pop ebx
+ ret 10h
+ }
+}
+void __declspec(naked) _aullrem()
+{
+ __asm {
+ push ebx
+ mov eax,dword ptr [esp+14h]
+ or eax,eax
+ jne L1
+ mov ecx,dword ptr [esp+10h]
+ mov eax,dword ptr [esp+0Ch]
+ xor edx,edx
+ div ecx
+ mov eax,dword ptr [esp+8]
+ div ecx
+ mov eax,edx
+ xor edx,edx
+ jmp L2
+L1:
+ mov ecx,eax
+ mov ebx,dword ptr [esp+10h]
+ mov edx,dword ptr [esp+0Ch]
+ mov eax,dword ptr [esp+8]
+L3:
+ shr ecx,1
+ rcr ebx,1
+ shr edx,1
+ rcr eax,1
+ or ecx,ecx
+ jne L3
+ div ebx
+ mov ecx,eax
+ mul dword ptr [esp+14h]
+ xchg eax,ecx
+ mul dword ptr [esp+10h]
+ add edx,ecx
+ jb L4
+ cmp edx,dword ptr [esp+0Ch]
+ ja L4
+ jb L5
+ cmp eax,dword ptr [esp+8]
+ jbe L5
+L4:
+ sub eax,dword ptr [esp+10h]
+ sbb edx,dword ptr [esp+14h]
+L5:
+ sub eax,dword ptr [esp+8]
+ sbb edx,dword ptr [esp+0Ch]
+ neg edx
+ neg eax
+ sbb edx,0
+L2:
+ pop ebx
+ ret 10h
+ }
+}
+void __declspec(naked) _alldvrm()
+{
+ __asm {
+ push edi
+ push esi
+ push ebp
+ xor edi,edi
+ xor ebp,ebp
+ mov eax,dword ptr [esp+14h]
+ or eax,eax
+ jge L1
+ inc edi
+ inc ebp
+ mov edx,dword ptr [esp+10h]
+ neg eax
+ neg edx
+ sbb eax,0
+ mov dword ptr [esp+14h],eax
+ mov dword ptr [esp+10h],edx
+L1:
+ mov eax,dword ptr [esp+1Ch]
+ or eax,eax
+ jge L2
+ inc edi
+ mov edx,dword ptr [esp+18h]
+ neg eax
+ neg edx
+ sbb eax,0
+ mov dword ptr [esp+1Ch],eax
+ mov dword ptr [esp+18h],edx
+L2:
+ or eax,eax
+ jne L3
+ mov ecx,dword ptr [esp+18h]
+ mov eax,dword ptr [esp+14h]
+ xor edx,edx
+ div ecx
+ mov ebx,eax
+ mov eax,dword ptr [esp+10h]
+ div ecx
+ mov esi,eax
+ mov eax,ebx
+ mul dword ptr [esp+18h]
+ mov ecx,eax
+ mov eax,esi
+ mul dword ptr [esp+18h]
+ add edx,ecx
+ jmp L4
+L3:
+ mov ebx,eax
+ mov ecx,dword ptr [esp+18h]
+ mov edx,dword ptr [esp+14h]
+ mov eax,dword ptr [esp+10h]
+L5:
+ shr ebx,1
+ rcr ecx,1
+ shr edx,1
+ rcr eax,1
+ or ebx,ebx
+ jne L5
+ div ecx
+ mov esi,eax
+ mul dword ptr [esp+1Ch]
+ mov ecx,eax
+ mov eax,dword ptr [esp+18h]
+ mul esi
+ add edx,ecx
+ jb L6
+ cmp edx,dword ptr [esp+14h]
+ ja L6
+ jb L7
+ cmp eax,dword ptr [esp+10h]
+ jbe L7
+L6:
+ dec esi
+ sub eax,dword ptr [esp+18h]
+ sbb edx,dword ptr [esp+1Ch]
+L7:
+ xor ebx,ebx
+L4:
+ sub eax,dword ptr [esp+10h]
+ sbb edx,dword ptr [esp+14h]
+ dec ebp
+ jns L9
+ neg edx
+ neg eax
+ sbb edx,0
+L9:
+ mov ecx,edx
+ mov edx,ebx
+ mov ebx,ecx
+ mov ecx,eax
+ mov eax,esi
+ dec edi
+ jne L8
+ neg edx
+ neg eax
+ sbb edx,0
+L8:
+ pop ebp
+ pop esi
+ pop edi
+ ret 10h
+ }
+}
+void __declspec(naked) _aulldvrm()
+{
+ __asm {
+ push esi
+ mov eax,dword ptr [esp+14h]
+ or eax,eax
+ jne L1
+ mov ecx,dword ptr [esp+10h]
+ mov eax,dword ptr [esp+0Ch]
+ xor edx,edx
+ div ecx
+ mov ebx,eax
+ mov eax,dword ptr [esp+8]
+ div ecx
+ mov esi,eax
+ mov eax,ebx
+ mul dword ptr [esp+10h]
+ mov ecx,eax
+ mov eax,esi
+ mul dword ptr [esp+10h]
+ add edx,ecx
+ jmp L2
+L1:
+ mov ecx,eax
+ mov ebx,dword ptr [esp+10h]
+ mov edx,dword ptr [esp+0Ch]
+ mov eax,dword ptr [esp+8]
+L3:
+ shr ecx,1
+ rcr ebx,1
+ shr edx,1
+ rcr eax,1
+ or ecx,ecx
+ jne L3
+ div ebx
+ mov esi,eax
+ mul dword ptr [esp+14h]
+ mov ecx,eax
+ mov eax,dword ptr [esp+10h]
+ mul esi
+ add edx,ecx
+ jb L4
+ cmp edx,dword ptr [esp+0Ch]
+ ja L4
+ jb L5
+ cmp eax,dword ptr [esp+8]
+ jbe L5
+L4:
+ dec esi
+ sub eax,dword ptr [esp+10h]
+ sbb edx,dword ptr [esp+14h]
+L5:
+ xor ebx,ebx
+L2:
+ sub eax,dword ptr [esp+8]
+ sbb edx,dword ptr [esp+0Ch]
+ neg edx
+ neg eax
+ sbb edx,0
+ mov ecx,edx
+ mov edx,ebx
+ mov ebx,ecx
+ mov ecx,eax
+ mov eax,esi
+ pop esi
+ ret 10h
+ }
+}
+void __declspec(naked) _allshl()
+{
+ __asm {
+ cmp cl,40h
+ jae RETZERO
+ cmp cl,20h
+ jae MORE32
+ shld edx,eax,cl
+ shl eax,cl
+ ret
+MORE32:
+ mov edx,eax
+ xor eax,eax
+ and cl,1Fh
+ shl edx,cl
+ ret
+RETZERO:
+ xor eax,eax
+ xor edx,edx
+ ret
+ }
+}
+void __declspec(naked) _aullshr()
+{
+ __asm {
+ cmp cl,40h
+ jae RETZERO
+ cmp cl,20h
+ jae MORE32
+ shrd eax,edx,cl
+ shr edx,cl
+ ret
+MORE32:
+ mov eax,edx
+ xor edx,edx
+ and cl,1Fh
+ shr eax,cl
+ ret
+RETZERO:
+ xor eax,eax
+ xor edx,edx
+ ret
+ }
+}
+
+#endif /* MSC_VER */
+
+#endif /* !HAVE_LIBC */
diff --git a/distrib/sdl-1.2.15/src/stdlib/SDL_string.c b/distrib/sdl-1.2.15/src/stdlib/SDL_string.c
new file mode 100644
index 0000000..550a623
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/stdlib/SDL_string.c
@@ -0,0 +1,1248 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This file contains portable string manipulation functions for SDL */
+
+#include "SDL_stdinc.h"
+
+
+#define SDL_isupperhex(X) (((X) >= 'A') && ((X) <= 'F'))
+#define SDL_islowerhex(X) (((X) >= 'a') && ((X) <= 'f'))
+
+#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOL)
+static size_t SDL_ScanLong(const char *text, int radix, long *valuep)
+{
+ const char *textstart = text;
+ long value = 0;
+ SDL_bool negative = SDL_FALSE;
+
+ if ( *text == '-' ) {
+ negative = SDL_TRUE;
+ ++text;
+ }
+ if ( radix == 16 && SDL_strncmp(text, "0x", 2) == 0 ) {
+ text += 2;
+ }
+ for ( ; ; ) {
+ int v;
+ if ( SDL_isdigit((unsigned char) *text) ) {
+ v = *text - '0';
+ } else if ( radix == 16 && SDL_isupperhex(*text) ) {
+ v = 10 + (*text - 'A');
+ } else if ( radix == 16 && SDL_islowerhex(*text) ) {
+ v = 10 + (*text - 'a');
+ } else {
+ break;
+ }
+ value *= radix;
+ value += v;
+ ++text;
+ }
+ if ( valuep ) {
+ if ( negative && value ) {
+ *valuep = -value;
+ } else {
+ *valuep = value;
+ }
+ }
+ return (text - textstart);
+}
+#endif
+
+#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOUL) || !defined(HAVE_STRTOD)
+static size_t SDL_ScanUnsignedLong(const char *text, int radix, unsigned long *valuep)
+{
+ const char *textstart = text;
+ unsigned long value = 0;
+
+ if ( radix == 16 && SDL_strncmp(text, "0x", 2) == 0 ) {
+ text += 2;
+ }
+ for ( ; ; ) {
+ int v;
+ if ( SDL_isdigit((unsigned char) *text) ) {
+ v = *text - '0';
+ } else if ( radix == 16 && SDL_isupperhex(*text) ) {
+ v = 10 + (*text - 'A');
+ } else if ( radix == 16 && SDL_islowerhex(*text) ) {
+ v = 10 + (*text - 'a');
+ } else {
+ break;
+ }
+ value *= radix;
+ value += v;
+ ++text;
+ }
+ if ( valuep ) {
+ *valuep = value;
+ }
+ return (text - textstart);
+}
+#endif
+
+#ifndef HAVE_SSCANF
+static size_t SDL_ScanUintPtrT(const char *text, int radix, uintptr_t *valuep)
+{
+ const char *textstart = text;
+ uintptr_t value = 0;
+
+ if ( radix == 16 && SDL_strncmp(text, "0x", 2) == 0 ) {
+ text += 2;
+ }
+ for ( ; ; ) {
+ int v;
+ if ( SDL_isdigit((unsigned char) *text) ) {
+ v = *text - '0';
+ } else if ( radix == 16 && SDL_isupperhex(*text) ) {
+ v = 10 + (*text - 'A');
+ } else if ( radix == 16 && SDL_islowerhex(*text) ) {
+ v = 10 + (*text - 'a');
+ } else {
+ break;
+ }
+ value *= radix;
+ value += v;
+ ++text;
+ }
+ if ( valuep ) {
+ *valuep = value;
+ }
+ return (text - textstart);
+}
+#endif
+
+#ifdef SDL_HAS_64BIT_TYPE
+#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOLL)
+static size_t SDL_ScanLongLong(const char *text, int radix, Sint64 *valuep)
+{
+ const char *textstart = text;
+ Sint64 value = 0;
+ SDL_bool negative = SDL_FALSE;
+
+ if ( *text == '-' ) {
+ negative = SDL_TRUE;
+ ++text;
+ }
+ if ( radix == 16 && SDL_strncmp(text, "0x", 2) == 0 ) {
+ text += 2;
+ }
+ for ( ; ; ) {
+ int v;
+ if ( SDL_isdigit((unsigned char) *text) ) {
+ v = *text - '0';
+ } else if ( radix == 16 && SDL_isupperhex(*text) ) {
+ v = 10 + (*text - 'A');
+ } else if ( radix == 16 && SDL_islowerhex(*text) ) {
+ v = 10 + (*text - 'a');
+ } else {
+ break;
+ }
+ value *= radix;
+ value += v;
+ ++text;
+ }
+ if ( valuep ) {
+ if ( negative && value ) {
+ *valuep = -value;
+ } else {
+ *valuep = value;
+ }
+ }
+ return (text - textstart);
+}
+#endif
+
+#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOULL)
+static size_t SDL_ScanUnsignedLongLong(const char *text, int radix, Uint64 *valuep)
+{
+ const char *textstart = text;
+ Uint64 value = 0;
+
+ if ( radix == 16 && SDL_strncmp(text, "0x", 2) == 0 ) {
+ text += 2;
+ }
+ for ( ; ; ) {
+ int v;
+ if ( SDL_isdigit((unsigned char) *text) ) {
+ v = *text - '0';
+ } else if ( radix == 16 && SDL_isupperhex(*text) ) {
+ v = 10 + (*text - 'A');
+ } else if ( radix == 16 && SDL_islowerhex(*text) ) {
+ v = 10 + (*text - 'a');
+ } else {
+ break;
+ }
+ value *= radix;
+ value += v;
+ ++text;
+ }
+ if ( valuep ) {
+ *valuep = value;
+ }
+ return (text - textstart);
+}
+#endif
+#endif /* SDL_HAS_64BIT_TYPE */
+
+#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOD)
+static size_t SDL_ScanFloat(const char *text, double *valuep)
+{
+ const char *textstart = text;
+ unsigned long lvalue = 0;
+ double value = 0.0;
+ SDL_bool negative = SDL_FALSE;
+
+ if ( *text == '-' ) {
+ negative = SDL_TRUE;
+ ++text;
+ }
+ text += SDL_ScanUnsignedLong(text, 10, &lvalue);
+ value += lvalue;
+ if ( *text == '.' ) {
+ int mult = 10;
+ ++text;
+ while ( SDL_isdigit((unsigned char) *text) ) {
+ lvalue = *text - '0';
+ value += (double)lvalue / mult;
+ mult *= 10;
+ ++text;
+ }
+ }
+ if ( valuep ) {
+ if ( negative && value ) {
+ *valuep = -value;
+ } else {
+ *valuep = value;
+ }
+ }
+ return (text - textstart);
+}
+#endif
+
+#ifndef SDL_memset
+void *SDL_memset(void *dst, int c, size_t len)
+{
+ size_t left = (len % 4);
+ if ( len >= 4 ) {
+ Uint32 value = 0;
+ Uint32 *dstp = (Uint32 *)dst;
+ int i;
+ for (i = 0; i < 4; ++i) {
+ value <<= 8;
+ value |= c;
+ }
+ len /= 4;
+ while ( len-- ) {
+ *dstp++ = value;
+ }
+ }
+ if ( left > 0 ) {
+ Uint8 value = (Uint8)c;
+ Uint8 *dstp = (Uint8 *)dst;
+ switch(left) {
+ case 3:
+ *dstp++ = value;
+ case 2:
+ *dstp++ = value;
+ case 1:
+ *dstp++ = value;
+ }
+ }
+ return dst;
+}
+#endif
+
+#ifndef SDL_memcpy
+void *SDL_memcpy(void *dst, const void *src, size_t len)
+{
+ char *srcp = (char *)src;
+ char *dstp = (char *)dst;
+ while ( len-- ) {
+ *dstp++ = *srcp++;
+ }
+ return dst;
+}
+#endif
+
+#ifndef SDL_revcpy
+void *SDL_revcpy(void *dst, const void *src, size_t len)
+{
+ char *srcp = (char *)src;
+ char *dstp = (char *)dst;
+ srcp += len-1;
+ dstp += len-1;
+ while ( len-- ) {
+ *dstp-- = *srcp--;
+ }
+ return dst;
+}
+#endif
+
+#ifndef SDL_memcmp
+int SDL_memcmp(const void *s1, const void *s2, size_t len)
+{
+ char *s1p = (char *)s1;
+ char *s2p = (char *)s2;
+ while ( len-- ) {
+ if ( *s1p != *s2p ) {
+ return (*s1p - *s2p);
+ }
+ ++s1p;
+ ++s2p;
+ }
+ return 0;
+}
+#endif
+
+#ifndef HAVE_STRLEN
+size_t SDL_strlen(const char *string)
+{
+ size_t len = 0;
+ while ( *string++ ) {
+ ++len;
+ }
+ return len;
+}
+#endif
+
+#ifndef HAVE_STRLCPY
+size_t SDL_strlcpy(char *dst, const char *src, size_t maxlen)
+{
+ size_t srclen = SDL_strlen(src);
+ if ( maxlen > 0 ) {
+ size_t len = SDL_min(srclen, maxlen-1);
+ SDL_memcpy(dst, src, len);
+ dst[len] = '\0';
+ }
+ return srclen;
+}
+#endif
+
+#ifndef HAVE_STRLCAT
+size_t SDL_strlcat(char *dst, const char *src, size_t maxlen)
+{
+ 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
+
+#ifndef HAVE_STRDUP
+char *SDL_strdup(const char *string)
+{
+ size_t len = SDL_strlen(string)+1;
+ char *newstr = SDL_malloc(len);
+ if ( newstr ) {
+ SDL_strlcpy(newstr, string, len);
+ }
+ return newstr;
+}
+#endif
+
+#ifndef HAVE__STRREV
+char *SDL_strrev(char *string)
+{
+ size_t len = SDL_strlen(string);
+ char *a = &string[0];
+ char *b = &string[len-1];
+ len /= 2;
+ while ( len-- ) {
+ char c = *a;
+ *a++ = *b;
+ *b-- = c;
+ }
+ return string;
+}
+#endif
+
+#ifndef HAVE__STRUPR
+char *SDL_strupr(char *string)
+{
+ char *bufp = string;
+ while ( *bufp ) {
+ *bufp = SDL_toupper((unsigned char) *bufp);
+ ++bufp;
+ }
+ return string;
+}
+#endif
+
+#ifndef HAVE__STRLWR
+char *SDL_strlwr(char *string)
+{
+ char *bufp = string;
+ while ( *bufp ) {
+ *bufp = SDL_tolower((unsigned char) *bufp);
+ ++bufp;
+ }
+ return string;
+}
+#endif
+
+#ifndef HAVE_STRCHR
+char *SDL_strchr(const char *string, int c)
+{
+ while ( *string ) {
+ if ( *string == c ) {
+ return (char *)string;
+ }
+ ++string;
+ }
+ return NULL;
+}
+#endif
+
+#ifndef HAVE_STRRCHR
+char *SDL_strrchr(const char *string, int c)
+{
+ const char *bufp = string + SDL_strlen(string) - 1;
+ while ( bufp >= string ) {
+ if ( *bufp == c ) {
+ return (char *)bufp;
+ }
+ --bufp;
+ }
+ return NULL;
+}
+#endif
+
+#ifndef HAVE_STRSTR
+char *SDL_strstr(const char *haystack, const char *needle)
+{
+ size_t length = SDL_strlen(needle);
+ while ( *haystack ) {
+ if ( SDL_strncmp(haystack, needle, length) == 0 ) {
+ return (char *)haystack;
+ }
+ ++haystack;
+ }
+ return NULL;
+}
+#endif
+
+#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',
+ 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
+ 'U', 'V', 'W', 'X', 'Y', 'Z'
+};
+#endif /* ntoa() conversion table */
+
+#ifndef HAVE__LTOA
+char *SDL_ltoa(long 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
+
+#ifndef HAVE__ULTOA
+char *SDL_ultoa(unsigned long 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
+
+#ifndef HAVE_STRTOL
+long SDL_strtol(const char *string, char **endp, int base)
+{
+ size_t len;
+ long value;
+
+ if ( !base ) {
+ if ( (SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0) ) {
+ base = 16;
+ } else {
+ base = 10;
+ }
+ }
+
+ len = SDL_ScanLong(string, base, &value);
+ if ( endp ) {
+ *endp = (char *)string + len;
+ }
+ return value;
+}
+#endif
+
+#ifndef HAVE_STRTOUL
+unsigned long SDL_strtoul(const char *string, char **endp, int base)
+{
+ size_t len;
+ unsigned long value;
+
+ if ( !base ) {
+ if ( (SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0) ) {
+ base = 16;
+ } else {
+ base = 10;
+ }
+ }
+
+ len = SDL_ScanUnsignedLong(string, base, &value);
+ if ( endp ) {
+ *endp = (char *)string + len;
+ }
+ return value;
+}
+#endif
+
+#ifdef SDL_HAS_64BIT_TYPE
+
+#ifndef HAVE__I64TOA
+char *SDL_lltoa(Sint64 value, char *string, int radix)
+{
+ char *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
+
+#ifndef HAVE__UI64TOA
+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
+
+#ifndef HAVE_STRTOLL
+Sint64 SDL_strtoll(const char *string, char **endp, int base)
+{
+ size_t len;
+ Sint64 value;
+
+ if ( !base ) {
+ if ( (SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0) ) {
+ base = 16;
+ } else {
+ base = 10;
+ }
+ }
+
+ len = SDL_ScanLongLong(string, base, &value);
+ if ( endp ) {
+ *endp = (char *)string + len;
+ }
+ return value;
+}
+#endif
+
+#ifndef HAVE_STRTOULL
+Uint64 SDL_strtoull(const char *string, char **endp, int base)
+{
+ size_t len;
+ Uint64 value;
+
+ if ( !base ) {
+ if ( (SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0) ) {
+ base = 16;
+ } else {
+ base = 10;
+ }
+ }
+
+ len = SDL_ScanUnsignedLongLong(string, base, &value);
+ if ( endp ) {
+ *endp = (char *)string + len;
+ }
+ return value;
+}
+#endif
+
+#endif /* SDL_HAS_64BIT_TYPE */
+
+#ifndef HAVE_STRTOD
+double SDL_strtod(const char *string, char **endp)
+{
+ size_t len;
+ double value;
+
+ len = SDL_ScanFloat(string, &value);
+ if ( endp ) {
+ *endp = (char *)string + len;
+ }
+ return value;
+}
+#endif
+
+#ifndef HAVE_STRCMP
+int SDL_strcmp(const char *str1, const char *str2)
+{
+ while (*str1 && *str2) {
+ if ( *str1 != *str2 )
+ break;
+ ++str1;
+ ++str2;
+ }
+ return (int)((unsigned char)*str1 - (unsigned char)*str2);
+}
+#endif
+
+#ifndef HAVE_STRNCMP
+int SDL_strncmp(const char *str1, const char *str2, size_t maxlen)
+{
+ while ( *str1 && *str2 && maxlen ) {
+ if ( *str1 != *str2 )
+ break;
+ ++str1;
+ ++str2;
+ --maxlen;
+ }
+ if ( ! maxlen ) {
+ return 0;
+ }
+ return (int)((unsigned char)*str1 - (unsigned char)*str2);
+}
+#endif
+
+#if !defined(HAVE_STRCASECMP) && !defined(HAVE__STRICMP)
+int SDL_strcasecmp(const char *str1, const char *str2)
+{
+ char a = 0;
+ char b = 0;
+ while ( *str1 && *str2 ) {
+ a = SDL_tolower((unsigned char) *str1);
+ b = SDL_tolower((unsigned char) *str2);
+ if ( a != b )
+ break;
+ ++str1;
+ ++str2;
+ }
+ return (int)((unsigned char)a - (unsigned char)b);
+}
+#endif
+
+#if !defined(HAVE_STRNCASECMP) && !defined(HAVE__STRNICMP)
+int SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen)
+{
+ char a = 0;
+ char b = 0;
+ while ( *str1 && *str2 && maxlen ) {
+ a = SDL_tolower((unsigned char) *str1);
+ b = SDL_tolower((unsigned char) *str2);
+ if ( a != b )
+ break;
+ ++str1;
+ ++str2;
+ --maxlen;
+ }
+ return (int)((unsigned char)a - (unsigned char)b);
+}
+#endif
+
+#ifndef HAVE_SSCANF
+int SDL_sscanf(const char *text, const char *fmt, ...)
+{
+ va_list ap;
+ int retval = 0;
+
+ va_start(ap, fmt);
+ while ( *fmt ) {
+ if ( *fmt == ' ' ) {
+ while ( SDL_isspace((unsigned char) *text) ) {
+ ++text;
+ }
+ ++fmt;
+ continue;
+ }
+ if ( *fmt == '%' ) {
+ SDL_bool done = SDL_FALSE;
+ long count = 0;
+ int radix = 10;
+ enum {
+ DO_SHORT,
+ DO_INT,
+ DO_LONG,
+ DO_LONGLONG
+ } inttype = DO_INT;
+ SDL_bool suppress = SDL_FALSE;
+
+ ++fmt;
+ if ( *fmt == '%' ) {
+ if ( *text == '%' ) {
+ ++text;
+ ++fmt;
+ continue;
+ }
+ break;
+ }
+ if ( *fmt == '*' ) {
+ suppress = SDL_TRUE;
+ ++fmt;
+ }
+ fmt += SDL_ScanLong(fmt, 10, &count);
+
+ if ( *fmt == 'c' ) {
+ if ( ! count ) {
+ count = 1;
+ }
+ if ( suppress ) {
+ while ( count-- ) {
+ ++text;
+ }
+ } else {
+ char *valuep = va_arg(ap, char*);
+ while ( count-- ) {
+ *valuep++ = *text++;
+ }
+ ++retval;
+ }
+ continue;
+ }
+
+ while ( SDL_isspace((unsigned char) *text) ) {
+ ++text;
+ }
+
+ /* FIXME: implement more of the format specifiers */
+ while (!done) {
+ switch(*fmt) {
+ case '*':
+ suppress = SDL_TRUE;
+ break;
+ case 'h':
+ if ( inttype > DO_SHORT ) {
+ ++inttype;
+ }
+ break;
+ case 'l':
+ if ( inttype < DO_LONGLONG ) {
+ ++inttype;
+ }
+ break;
+ case 'I':
+ if ( SDL_strncmp(fmt, "I64", 3) == 0 ) {
+ fmt += 2;
+ inttype = DO_LONGLONG;
+ }
+ break;
+ case 'i':
+ {
+ int index = 0;
+ if ( text[index] == '-' ) {
+ ++index;
+ }
+ if ( text[index] == '0' ) {
+ if ( SDL_tolower((unsigned char) text[index+1]) == 'x' ) {
+ radix = 16;
+ } else {
+ radix = 8;
+ }
+ }
+ }
+ /* Fall through to %d handling */
+ case 'd':
+#ifdef SDL_HAS_64BIT_TYPE
+ if ( inttype == DO_LONGLONG ) {
+ Sint64 value;
+ text += SDL_ScanLongLong(text, radix, &value);
+ if ( ! suppress ) {
+ Sint64 *valuep = va_arg(ap, Sint64*);
+ *valuep = value;
+ ++retval;
+ }
+ }
+ else
+#endif /* SDL_HAS_64BIT_TYPE */
+ {
+ long value;
+ text += SDL_ScanLong(text, radix, &value);
+ if ( ! suppress ) {
+ switch (inttype) {
+ case DO_SHORT:
+ { short* valuep = va_arg(ap, short*);
+ *valuep = (short)value;
+ }
+ break;
+ case DO_INT:
+ { int* valuep = va_arg(ap, int*);
+ *valuep = (int)value;
+ }
+ break;
+ case DO_LONG:
+ { long* valuep = va_arg(ap, long*);
+ *valuep = value;
+ }
+ break;
+ case DO_LONGLONG:
+ /* Handled above */
+ break;
+ }
+ ++retval;
+ }
+ }
+ done = SDL_TRUE;
+ break;
+ case 'o':
+ if ( radix == 10 ) {
+ radix = 8;
+ }
+ /* Fall through to unsigned handling */
+ case 'x':
+ case 'X':
+ if ( radix == 10 ) {
+ radix = 16;
+ }
+ /* Fall through to unsigned handling */
+ case 'u':
+#ifdef SDL_HAS_64BIT_TYPE
+ if ( inttype == DO_LONGLONG ) {
+ Uint64 value;
+ text += SDL_ScanUnsignedLongLong(text, radix, &value);
+ if ( ! suppress ) {
+ Uint64 *valuep = va_arg(ap, Uint64*);
+ *valuep = value;
+ ++retval;
+ }
+ }
+ else
+#endif /* SDL_HAS_64BIT_TYPE */
+ {
+ unsigned long value;
+ text += SDL_ScanUnsignedLong(text, radix, &value);
+ if ( ! suppress ) {
+ switch (inttype) {
+ case DO_SHORT:
+ { short* valuep = va_arg(ap, short*);
+ *valuep = (short)value;
+ }
+ break;
+ case DO_INT:
+ { int* valuep = va_arg(ap, int*);
+ *valuep = (int)value;
+ }
+ break;
+ case DO_LONG:
+ { long* valuep = va_arg(ap, long*);
+ *valuep = value;
+ }
+ break;
+ case DO_LONGLONG:
+ /* Handled above */
+ break;
+ }
+ ++retval;
+ }
+ }
+ done = SDL_TRUE;
+ break;
+ case 'p':
+ {
+ uintptr_t value;
+ text += SDL_ScanUintPtrT(text, 16, &value);
+ if ( ! suppress ) {
+ void** valuep = va_arg(ap, void**);
+ *valuep = (void*)value;
+ ++retval;
+ }
+ }
+ done = SDL_TRUE;
+ break;
+ case 'f':
+ {
+ double value;
+ text += SDL_ScanFloat(text, &value);
+ if ( ! suppress ) {
+ float* valuep = va_arg(ap, float*);
+ *valuep = (float)value;
+ ++retval;
+ }
+ }
+ done = SDL_TRUE;
+ break;
+ case 's':
+ if ( suppress ) {
+ while ( !SDL_isspace((unsigned char) *text) ) {
+ ++text;
+ if ( count ) {
+ if ( --count == 0 ) {
+ break;
+ }
+ }
+ }
+ } else {
+ char *valuep = va_arg(ap, char*);
+ while ( !SDL_isspace((unsigned char) *text) ) {
+ *valuep++ = *text++;
+ if ( count ) {
+ if ( --count == 0 ) {
+ break;
+ }
+ }
+ }
+ *valuep = '\0';
+ ++retval;
+ }
+ done = SDL_TRUE;
+ break;
+ default:
+ done = SDL_TRUE;
+ break;
+ }
+ ++fmt;
+ }
+ continue;
+ }
+ if ( *text == *fmt ) {
+ ++text;
+ ++fmt;
+ continue;
+ }
+ /* Text didn't match format specifier */
+ break;
+ }
+ va_end(ap);
+
+ return retval;
+}
+#endif
+
+#ifndef HAVE_SNPRINTF
+int SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...)
+{
+ va_list ap;
+ int retval;
+
+ va_start(ap, fmt);
+ retval = SDL_vsnprintf(text, maxlen, fmt, ap);
+ va_end(ap);
+
+ return retval;
+}
+#endif
+
+#ifndef HAVE_VSNPRINTF
+static size_t SDL_PrintLong(char *text, long value, int radix, size_t maxlen)
+{
+ char num[130];
+ size_t size;
+
+ SDL_ltoa(value, num, radix);
+ size = SDL_strlen(num);
+ if ( size >= maxlen ) {
+ size = maxlen-1;
+ }
+ SDL_strlcpy(text, num, size+1);
+
+ return size;
+}
+static size_t SDL_PrintUnsignedLong(char *text, unsigned long value, int radix, size_t maxlen)
+{
+ 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;
+}
+#ifdef SDL_HAS_64BIT_TYPE
+static size_t SDL_PrintLongLong(char *text, Sint64 value, int radix, size_t maxlen)
+{
+ 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;
+}
+static size_t SDL_PrintUnsignedLongLong(char *text, Uint64 value, int radix, size_t maxlen)
+{
+ 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;
+}
+#endif /* SDL_HAS_64BIT_TYPE */
+static size_t SDL_PrintFloat(char *text, double arg, size_t 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;
+ arg = -arg;
+ }
+ value = (unsigned long)arg;
+ len = SDL_PrintUnsignedLong(text, value, 10, maxlen);
+ text += len;
+ maxlen -= len;
+ arg -= value;
+ if ( arg > precision && maxlen ) {
+ int mult = 10;
+ *text++ = '.';
+ while ( (arg > precision) && maxlen ) {
+ value = (unsigned long)(arg * mult);
+ len = SDL_PrintUnsignedLong(text, value, 10, maxlen);
+ text += len;
+ maxlen -= len;
+ arg -= (double)value / mult;
+ mult *= 10;
+ }
+ }
+ } else {
+ *text++ = '0';
+ }
+ return (text - textstart);
+}
+static size_t SDL_PrintString(char *text, const char *string, size_t maxlen)
+{
+ char *textstart = text;
+ while ( *string && maxlen-- ) {
+ *text++ = *string++;
+ }
+ return (text - textstart);
+}
+int SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap)
+{
+ char *textstart = text;
+ if ( maxlen <= 0 ) {
+ return 0;
+ }
+ --maxlen; /* For the trailing '\0' */
+ while ( *fmt && maxlen ) {
+ if ( *fmt == '%' ) {
+ SDL_bool done = SDL_FALSE;
+ size_t len = 0;
+ SDL_bool do_lowercase = SDL_FALSE;
+ int radix = 10;
+ enum {
+ DO_INT,
+ DO_LONG,
+ DO_LONGLONG
+ } inttype = DO_INT;
+
+ ++fmt;
+ /* FIXME: implement more of the format specifiers */
+ while ( *fmt == '.' || (*fmt >= '0' && *fmt <= '9') ) {
+ ++fmt;
+ }
+ while (!done) {
+ switch(*fmt) {
+ case '%':
+ *text = '%';
+ len = 1;
+ done = SDL_TRUE;
+ break;
+ case 'c':
+ /* char is promoted to int when passed through (...) */
+ *text = (char)va_arg(ap, int);
+ len = 1;
+ done = SDL_TRUE;
+ break;
+ case 'h':
+ /* short is promoted to int when passed through (...) */
+ break;
+ case 'l':
+ if ( inttype < DO_LONGLONG ) {
+ ++inttype;
+ }
+ break;
+ case 'I':
+ if ( SDL_strncmp(fmt, "I64", 3) == 0 ) {
+ fmt += 2;
+ inttype = DO_LONGLONG;
+ }
+ break;
+ case 'i':
+ case 'd':
+ switch (inttype) {
+ case DO_INT:
+ len = SDL_PrintLong(text, (long)va_arg(ap, int), radix, maxlen);
+ break;
+ case DO_LONG:
+ len = SDL_PrintLong(text, va_arg(ap, long), radix, maxlen);
+ break;
+ case DO_LONGLONG:
+#ifdef SDL_HAS_64BIT_TYPE
+ len = SDL_PrintLongLong(text, va_arg(ap, Sint64), radix, maxlen);
+#else
+ len = SDL_PrintLong(text, va_arg(ap, long), radix, maxlen);
+#endif
+ break;
+ }
+ done = SDL_TRUE;
+ break;
+ case 'p':
+ case 'x':
+ do_lowercase = SDL_TRUE;
+ /* Fall through to 'X' handling */
+ case 'X':
+ if ( radix == 10 ) {
+ radix = 16;
+ }
+ if ( *fmt == 'p' ) {
+ inttype = DO_LONG;
+ }
+ /* Fall through to unsigned handling */
+ case 'o':
+ if ( radix == 10 ) {
+ radix = 8;
+ }
+ /* Fall through to unsigned handling */
+ case 'u':
+ switch (inttype) {
+ case DO_INT:
+ len = SDL_PrintUnsignedLong(text, (unsigned long)va_arg(ap, unsigned int), radix, maxlen);
+ break;
+ case DO_LONG:
+ len = SDL_PrintUnsignedLong(text, va_arg(ap, unsigned long), radix, maxlen);
+ break;
+ case DO_LONGLONG:
+#ifdef SDL_HAS_64BIT_TYPE
+ len = SDL_PrintUnsignedLongLong(text, va_arg(ap, Uint64), radix, maxlen);
+#else
+ len = SDL_PrintUnsignedLong(text, va_arg(ap, unsigned long), radix, maxlen);
+#endif
+ break;
+ }
+ if ( do_lowercase ) {
+ SDL_strlwr(text);
+ }
+ done = SDL_TRUE;
+ break;
+ case 'f':
+ len = SDL_PrintFloat(text, va_arg(ap, double), maxlen);
+ done = SDL_TRUE;
+ break;
+ case 's':
+ len = SDL_PrintString(text, va_arg(ap, char*), maxlen);
+ done = SDL_TRUE;
+ break;
+ default:
+ done = SDL_TRUE;
+ break;
+ }
+ ++fmt;
+ }
+ text += len;
+ maxlen -= len;
+ } else {
+ *text++ = *fmt++;
+ --maxlen;
+ }
+ }
+ *text = '\0';
+
+ return (text - textstart);
+}
+#endif
diff --git a/distrib/sdl-1.2.15/src/thread/SDL_systhread.h b/distrib/sdl-1.2.15/src/thread/SDL_systhread.h
new file mode 100644
index 0000000..a59ac50
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/SDL_systhread.h
@@ -0,0 +1,52 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* These are functions that need to be implemented by a port of SDL */
+
+#ifndef _SDL_systhread_h
+#define _SDL_systhread_h
+
+#include "SDL_thread.h"
+
+/* This function creates a thread, passing args to SDL_RunThread(),
+ saves a system-dependent thread id in thread->id, and returns 0
+ on success.
+*/
+#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
+extern int SDL_SYS_CreateThread(SDL_Thread *thread, void *args, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread);
+#else
+extern int SDL_SYS_CreateThread(SDL_Thread *thread, void *args);
+#endif
+
+/* This function does any necessary setup in the child thread */
+extern void SDL_SYS_SetupThread(void);
+
+/* This function waits for the thread to finish and frees any data
+ allocated by SDL_SYS_CreateThread()
+ */
+extern void SDL_SYS_WaitThread(SDL_Thread *thread);
+
+/* This function kills the thread and returns */
+extern void SDL_SYS_KillThread(SDL_Thread *thread);
+
+#endif /* _SDL_systhread_h */
diff --git a/distrib/sdl-1.2.15/src/thread/SDL_thread.c b/distrib/sdl-1.2.15/src/thread/SDL_thread.c
new file mode 100644
index 0000000..250371d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/SDL_thread.c
@@ -0,0 +1,300 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* System independent thread management routines for SDL */
+
+#include "SDL_mutex.h"
+#include "SDL_thread.h"
+#include "SDL_thread_c.h"
+#include "SDL_systhread.h"
+
+#define ARRAY_CHUNKSIZE 32
+/* The array of threads currently active in the application
+ (except the main thread)
+ The manipulation of an array here is safer than using a linked list.
+*/
+static int SDL_maxthreads = 0;
+static int SDL_numthreads = 0;
+static SDL_Thread **SDL_Threads = NULL;
+static SDL_mutex *thread_lock = NULL;
+
+int SDL_ThreadsInit(void)
+{
+ int retval;
+
+ 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.
+ */
+void SDL_ThreadsQuit(void)
+{
+ SDL_mutex *mutex;
+
+ mutex = thread_lock;
+ thread_lock = NULL;
+ if ( mutex != NULL ) {
+ SDL_DestroyMutex(mutex);
+ }
+}
+
+/* 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;
+ }
+ }
+ SDL_mutexP(thread_lock);
+
+ /* Expand the list of threads, if necessary */
+#ifdef DEBUG_THREADS
+ printf("Adding thread (%d already - %d max)\n",
+ SDL_numthreads, SDL_maxthreads);
+#endif
+ if ( SDL_numthreads == SDL_maxthreads ) {
+ SDL_Thread **threads;
+ threads = (SDL_Thread **)SDL_realloc(SDL_Threads,
+ (SDL_maxthreads+ARRAY_CHUNKSIZE)*(sizeof *threads));
+ if ( threads == NULL ) {
+ SDL_OutOfMemory();
+ goto done;
+ }
+ SDL_maxthreads += ARRAY_CHUNKSIZE;
+ SDL_Threads = threads;
+ }
+ SDL_Threads[SDL_numthreads++] = thread;
+done:
+ SDL_mutexV(thread_lock);
+}
+
+static void SDL_DelThread(SDL_Thread *thread)
+{
+ int i;
+
+ if ( !thread_lock ) {
+ return;
+ }
+ SDL_mutexP(thread_lock);
+ for ( i=0; i<SDL_numthreads; ++i ) {
+ if ( thread == SDL_Threads[i] ) {
+ 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);
+
+#if 0 /* There could be memory corruption if another thread is starting */
+ if ( SDL_Threads == NULL ) {
+ SDL_ThreadsQuit();
+ }
+#endif
+}
+
+/* The default (non-thread-safe) global error variable */
+static SDL_error SDL_global_error;
+
+/* Routine to get the thread-specific error variable */
+SDL_error *SDL_GetErrBuf(void)
+{
+ SDL_error *errbuf;
+
+ errbuf = &SDL_global_error;
+ if ( SDL_Threads ) {
+ int i;
+ Uint32 this_thread;
+
+ this_thread = SDL_ThreadID();
+ SDL_mutexP(thread_lock);
+ for ( i=0; i<SDL_numthreads; ++i ) {
+ if ( this_thread == SDL_Threads[i]->threadid ) {
+ errbuf = &SDL_Threads[i]->errbuf;
+ break;
+ }
+ }
+ SDL_mutexV(thread_lock);
+ }
+ return(errbuf);
+}
+
+
+/* Arguments and callback to setup and run the user thread function */
+typedef struct {
+ int (SDLCALL *func)(void *);
+ void *data;
+ SDL_Thread *info;
+ SDL_sem *wait;
+} thread_args;
+
+void SDL_RunThread(void *data)
+{
+ thread_args *args;
+ int (SDLCALL *userfunc)(void *);
+ void *userdata;
+ int *statusloc;
+
+ /* Perform any system-dependent setup
+ - this function cannot fail, and cannot use SDL_SetError()
+ */
+ SDL_SYS_SetupThread();
+
+ /* Get the thread id */
+ args = (thread_args *)data;
+ args->info->threadid = SDL_ThreadID();
+
+ /* Figure out what function to run */
+ userfunc = args->func;
+ userdata = args->data;
+ statusloc = &args->info->status;
+
+ /* Wake up the parent thread */
+ SDL_SemPost(args->wait);
+
+ /* Run the function */
+ *statusloc = userfunc(userdata);
+}
+
+#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
+#undef SDL_CreateThread
+DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread)
+#else
+DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data)
+#endif
+{
+ SDL_Thread *thread;
+ thread_args *args;
+ int ret;
+
+ /* Allocate memory for the thread info structure */
+ thread = (SDL_Thread *)SDL_malloc(sizeof(*thread));
+ if ( thread == NULL ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ SDL_memset(thread, 0, (sizeof *thread));
+ thread->status = -1;
+
+ /* Set up the arguments for the thread */
+ args = (thread_args *)SDL_malloc(sizeof(*args));
+ if ( args == NULL ) {
+ SDL_OutOfMemory();
+ SDL_free(thread);
+ return(NULL);
+ }
+ args->func = fn;
+ args->data = data;
+ args->info = thread;
+ args->wait = SDL_CreateSemaphore(0);
+ if ( args->wait == NULL ) {
+ SDL_free(thread);
+ SDL_free(args);
+ return(NULL);
+ }
+
+ /* Add the thread to the list of available threads */
+ SDL_AddThread(thread);
+
+ /* Create the thread and go! */
+#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
+ ret = SDL_SYS_CreateThread(thread, args, pfnBeginThread, pfnEndThread);
+#else
+ ret = SDL_SYS_CreateThread(thread, args);
+#endif
+ if ( ret >= 0 ) {
+ /* Wait for the thread function to use arguments */
+ SDL_SemWait(args->wait);
+ } else {
+ /* Oops, failed. Gotta free everything */
+ SDL_DelThread(thread);
+ SDL_free(thread);
+ thread = NULL;
+ }
+ SDL_DestroySemaphore(args->wait);
+ SDL_free(args);
+
+ /* Everything is running now */
+ return(thread);
+}
+
+void SDL_WaitThread(SDL_Thread *thread, int *status)
+{
+ if ( thread ) {
+ SDL_SYS_WaitThread(thread);
+ if ( status ) {
+ *status = thread->status;
+ }
+ SDL_DelThread(thread);
+ SDL_free(thread);
+ }
+}
+
+Uint32 SDL_GetThreadID(SDL_Thread *thread)
+{
+ Uint32 id;
+
+ if ( thread ) {
+ id = thread->threadid;
+ } else {
+ id = SDL_ThreadID();
+ }
+ return(id);
+}
+
+void SDL_KillThread(SDL_Thread *thread)
+{
+ if ( thread ) {
+ SDL_SYS_KillThread(thread);
+ SDL_WaitThread(thread, NULL);
+ }
+}
+
diff --git a/distrib/sdl-1.2.15/src/thread/SDL_thread_c.h b/distrib/sdl-1.2.15/src/thread/SDL_thread_c.h
new file mode 100644
index 0000000..8af6e52
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/SDL_thread_c.h
@@ -0,0 +1,64 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_thread_c_h
+#define _SDL_thread_c_h
+
+/* Need the definitions of SYS_ThreadHandle */
+#if SDL_THREADS_DISABLED
+#include "generic/SDL_systhread_c.h"
+#elif SDL_THREAD_BEOS
+#include "beos/SDL_systhread_c.h"
+#elif SDL_THREAD_DC
+#include "dc/SDL_systhread_c.h"
+#elif SDL_THREAD_OS2
+#include "os2/SDL_systhread_c.h"
+#elif SDL_THREAD_PTH
+#include "pth/SDL_systhread_c.h"
+#elif SDL_THREAD_PTHREAD
+#include "pthread/SDL_systhread_c.h"
+#elif SDL_THREAD_SPROC
+#include "irix/SDL_systhread_c.h"
+#elif SDL_THREAD_WIN32
+#include "win32/SDL_systhread_c.h"
+#elif SDL_THREAD_SYMBIAN
+#include "symbian/SDL_systhread_c.h"
+#else
+#error Need thread implementation for this platform
+#include "generic/SDL_systhread_c.h"
+#endif
+#include "../SDL_error_c.h"
+
+/* This is the system-independent thread info structure */
+struct SDL_Thread {
+ Uint32 threadid;
+ SYS_ThreadHandle handle;
+ int status;
+ SDL_error errbuf;
+ void *data;
+};
+
+/* This is the function called to run a thread */
+extern void SDL_RunThread(void *data);
+
+#endif /* _SDL_thread_c_h */
diff --git a/distrib/sdl-1.2.15/src/thread/beos/SDL_syssem.c b/distrib/sdl-1.2.15/src/thread/beos/SDL_syssem.c
new file mode 100644
index 0000000..eba1944
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/beos/SDL_syssem.c
@@ -0,0 +1,142 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Semaphores in the BeOS environment */
+
+#include <be/kernel/OS.h>
+
+#include "SDL_thread.h"
+
+
+struct SDL_semaphore {
+ sem_id id;
+};
+
+/* Create a counting semaphore */
+SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
+{
+ SDL_sem *sem;
+
+ sem = (SDL_sem *)SDL_malloc(sizeof(*sem));
+ if ( sem ) {
+ sem->id = create_sem(initial_value, "SDL semaphore");
+ if ( sem->id < B_NO_ERROR ) {
+ SDL_SetError("create_sem() failed");
+ SDL_free(sem);
+ sem = NULL;
+ }
+ } else {
+ SDL_OutOfMemory();
+ }
+ return(sem);
+}
+
+/* Free the semaphore */
+void SDL_DestroySemaphore(SDL_sem *sem)
+{
+ if ( sem ) {
+ if ( sem->id >= B_NO_ERROR ) {
+ delete_sem(sem->id);
+ }
+ SDL_free(sem);
+ }
+}
+
+int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
+{
+ int32 val;
+ int retval;
+
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+
+ tryagain:
+ if ( timeout == SDL_MUTEX_MAXWAIT ) {
+ val = acquire_sem(sem->id);
+ } else {
+ timeout *= 1000; /* BeOS uses a timeout in microseconds */
+ val = acquire_sem_etc(sem->id, 1, B_RELATIVE_TIMEOUT, timeout);
+ }
+ switch (val) {
+ case B_INTERRUPTED:
+ goto tryagain;
+ case B_NO_ERROR:
+ retval = 0;
+ break;
+ case B_TIMED_OUT:
+ retval = SDL_MUTEX_TIMEDOUT;
+ break;
+ case B_WOULD_BLOCK:
+ retval = SDL_MUTEX_TIMEDOUT;
+ break;
+ default:
+ SDL_SetError("acquire_sem() failed");
+ retval = -1;
+ break;
+ }
+
+ return retval;
+}
+
+int SDL_SemTryWait(SDL_sem *sem)
+{
+ return SDL_SemWaitTimeout(sem, 0);
+}
+
+int SDL_SemWait(SDL_sem *sem)
+{
+ return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT);
+}
+
+/* Returns the current count of the semaphore */
+Uint32 SDL_SemValue(SDL_sem *sem)
+{
+ int32 count;
+ Uint32 value;
+
+ value = 0;
+ if ( sem ) {
+ get_sem_count(sem->id, &count);
+ if ( count > 0 ) {
+ value = (Uint32)count;
+ }
+ }
+ return value;
+}
+
+/* Atomically increases the semaphore's count (not blocking) */
+int SDL_SemPost(SDL_sem *sem)
+{
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+
+ if ( release_sem(sem->id) != B_NO_ERROR ) {
+ SDL_SetError("release_sem() failed");
+ return -1;
+ }
+ return 0;
+}
diff --git a/distrib/sdl-1.2.15/src/thread/beos/SDL_systhread.c b/distrib/sdl-1.2.15/src/thread/beos/SDL_systhread.c
new file mode 100644
index 0000000..63b5207
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/beos/SDL_systhread.c
@@ -0,0 +1,96 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* BeOS thread management routines for SDL */
+
+#include <stdio.h>
+#include <signal.h>
+#include <be/kernel/OS.h>
+
+#include "SDL_mutex.h"
+#include "SDL_thread.h"
+#include "../SDL_thread_c.h"
+#include "../SDL_systhread.h"
+
+
+static int sig_list[] = {
+ SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGWINCH, 0
+};
+
+void SDL_MaskSignals(sigset_t *omask)
+{
+ sigset_t mask;
+ int i;
+
+ sigemptyset(&mask);
+ for ( i=0; sig_list[i]; ++i ) {
+ sigaddset(&mask, sig_list[i]);
+ }
+ sigprocmask(SIG_BLOCK, &mask, omask);
+}
+void SDL_UnmaskSignals(sigset_t *omask)
+{
+ sigprocmask(SIG_SETMASK, omask, NULL);
+}
+
+static int32 RunThread(void *data)
+{
+ SDL_RunThread(data);
+ return(0);
+}
+
+int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
+{
+ /* Create the thread and go! */
+ thread->handle=spawn_thread(RunThread, "SDL", B_NORMAL_PRIORITY, args);
+ if ( (thread->handle == B_NO_MORE_THREADS) ||
+ (thread->handle == B_NO_MEMORY) ) {
+ SDL_SetError("Not enough resources to create thread");
+ return(-1);
+ }
+ resume_thread(thread->handle);
+ return(0);
+}
+
+void SDL_SYS_SetupThread(void)
+{
+ /* Mask asynchronous signals for this thread */
+ SDL_MaskSignals(NULL);
+}
+
+Uint32 SDL_ThreadID(void)
+{
+ return((Uint32)find_thread(NULL));
+}
+
+void SDL_SYS_WaitThread(SDL_Thread *thread)
+{
+ status_t the_status;
+
+ wait_for_thread(thread->handle, &the_status);
+}
+
+void SDL_SYS_KillThread(SDL_Thread *thread)
+{
+ kill_thread(thread->handle);
+}
diff --git a/distrib/sdl-1.2.15/src/thread/beos/SDL_systhread_c.h b/distrib/sdl-1.2.15/src/thread/beos/SDL_systhread_c.h
new file mode 100644
index 0000000..f82548e
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/beos/SDL_systhread_c.h
@@ -0,0 +1,31 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <signal.h>
+#include <be/kernel/OS.h>
+
+typedef thread_id SYS_ThreadHandle;
+
+/* Functions needed to work with system threads in other portions of SDL */
+extern void SDL_MaskSignals(sigset_t *omask);
+extern void SDL_UnmaskSignals(sigset_t *omask);
diff --git a/distrib/sdl-1.2.15/src/thread/dc/SDL_syscond.c b/distrib/sdl-1.2.15/src/thread/dc/SDL_syscond.c
new file mode 100644
index 0000000..f6e7223
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/dc/SDL_syscond.c
@@ -0,0 +1,215 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* An implementation of condition variables using semaphores and mutexes */
+/*
+ This implementation borrows heavily from the BeOS condition variable
+ implementation, written by Christopher Tate and Owen Smith. Thanks!
+ */
+
+#include "SDL_thread.h"
+
+struct SDL_cond
+{
+ SDL_mutex *lock;
+ int waiting;
+ int signals;
+ SDL_sem *wait_sem;
+ SDL_sem *wait_done;
+};
+
+/* Create a condition variable */
+SDL_cond * SDL_CreateCond(void)
+{
+ SDL_cond *cond;
+
+ cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond));
+ if ( cond ) {
+ cond->lock = SDL_CreateMutex();
+ cond->wait_sem = SDL_CreateSemaphore(0);
+ cond->wait_done = SDL_CreateSemaphore(0);
+ cond->waiting = cond->signals = 0;
+ if ( ! cond->lock || ! cond->wait_sem || ! cond->wait_done ) {
+ SDL_DestroyCond(cond);
+ cond = NULL;
+ }
+ } else {
+ SDL_OutOfMemory();
+ }
+ return(cond);
+}
+
+/* Destroy a condition variable */
+void SDL_DestroyCond(SDL_cond *cond)
+{
+ if ( cond ) {
+ if ( cond->wait_sem ) {
+ SDL_DestroySemaphore(cond->wait_sem);
+ }
+ if ( cond->wait_done ) {
+ SDL_DestroySemaphore(cond->wait_done);
+ }
+ if ( cond->lock ) {
+ SDL_DestroyMutex(cond->lock);
+ }
+ SDL_free(cond);
+ }
+}
+
+/* Restart one of the threads that are waiting on the condition variable */
+int SDL_CondSignal(SDL_cond *cond)
+{
+ if ( ! cond ) {
+ SDL_SetError("Passed a NULL condition variable");
+ return -1;
+ }
+
+ /* If there are waiting threads not already signalled, then
+ signal the condition and wait for the thread to respond.
+ */
+ SDL_LockMutex(cond->lock);
+ if ( cond->waiting > cond->signals ) {
+ ++cond->signals;
+ SDL_SemPost(cond->wait_sem);
+ SDL_UnlockMutex(cond->lock);
+ SDL_SemWait(cond->wait_done);
+ } else {
+ SDL_UnlockMutex(cond->lock);
+ }
+
+ return 0;
+}
+
+/* Restart all threads that are waiting on the condition variable */
+int SDL_CondBroadcast(SDL_cond *cond)
+{
+ if ( ! cond ) {
+ SDL_SetError("Passed a NULL condition variable");
+ return -1;
+ }
+
+ /* If there are waiting threads not already signalled, then
+ signal the condition and wait for the thread to respond.
+ */
+ SDL_LockMutex(cond->lock);
+ if ( cond->waiting > cond->signals ) {
+ int i, num_waiting;
+
+ num_waiting = (cond->waiting - cond->signals);
+ cond->signals = cond->waiting;
+ for ( i=0; i<num_waiting; ++i ) {
+ SDL_SemPost(cond->wait_sem);
+ }
+ /* Now all released threads are blocked here, waiting for us.
+ Collect them all (and win fabulous prizes!) :-)
+ */
+ SDL_UnlockMutex(cond->lock);
+ for ( i=0; i<num_waiting; ++i ) {
+ SDL_SemWait(cond->wait_done);
+ }
+ } else {
+ SDL_UnlockMutex(cond->lock);
+ }
+
+ return 0;
+}
+
+/* Wait on the condition variable for at most 'ms' milliseconds.
+ The mutex must be locked before entering this function!
+ The mutex is unlocked during the wait, and locked again after the wait.
+
+Typical use:
+
+Thread A:
+ SDL_LockMutex(lock);
+ while ( ! condition ) {
+ SDL_CondWait(cond);
+ }
+ SDL_UnlockMutex(lock);
+
+Thread B:
+ SDL_LockMutex(lock);
+ ...
+ condition = true;
+ ...
+ SDL_UnlockMutex(lock);
+ */
+int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms)
+{
+ int retval;
+
+ if ( ! cond ) {
+ SDL_SetError("Passed a NULL condition variable");
+ return -1;
+ }
+
+ /* Obtain the protection mutex, and increment the number of waiters.
+ This allows the signal mechanism to only perform a signal if there
+ are waiting threads.
+ */
+ SDL_LockMutex(cond->lock);
+ ++cond->waiting;
+ SDL_UnlockMutex(cond->lock);
+
+ /* Unlock the mutex, as is required by condition variable semantics */
+ SDL_UnlockMutex(mutex);
+
+ /* Wait for a signal */
+ if ( ms == SDL_MUTEX_MAXWAIT ) {
+ retval = SDL_SemWait(cond->wait_sem);
+ } else {
+ retval = SDL_SemWaitTimeout(cond->wait_sem, ms);
+ }
+
+ /* Let the signaler know we have completed the wait, otherwise
+ the signaler can race ahead and get the condition semaphore
+ if we are stopped between the mutex unlock and semaphore wait,
+ giving a deadlock. See the following URL for details:
+ http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html
+ */
+ SDL_LockMutex(cond->lock);
+ if ( cond->signals > 0 ) {
+ /* If we timed out, we need to eat a condition signal */
+ if ( retval > 0 ) {
+ SDL_SemWait(cond->wait_sem);
+ }
+ /* We always notify the signal thread that we are done */
+ SDL_SemPost(cond->wait_done);
+
+ /* Signal handshake complete */
+ --cond->signals;
+ }
+ --cond->waiting;
+ SDL_UnlockMutex(cond->lock);
+
+ /* Lock the mutex, as is required by condition variable semantics */
+ SDL_LockMutex(mutex);
+
+ return retval;
+}
+
+/* Wait on the condition variable forever */
+int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex)
+{
+ return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT);
+}
diff --git a/distrib/sdl-1.2.15/src/thread/dc/SDL_syscond_c.h b/distrib/sdl-1.2.15/src/thread/dc/SDL_syscond_c.h
new file mode 100644
index 0000000..1120b2d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/dc/SDL_syscond_c.h
@@ -0,0 +1,23 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
diff --git a/distrib/sdl-1.2.15/src/thread/dc/SDL_sysmutex.c b/distrib/sdl-1.2.15/src/thread/dc/SDL_sysmutex.c
new file mode 100644
index 0000000..c6c4651
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/dc/SDL_sysmutex.c
@@ -0,0 +1,122 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* An implementation of mutexes using semaphores */
+
+#include "SDL_thread.h"
+#include "SDL_systhread_c.h"
+
+#include <arch/spinlock.h>
+
+struct SDL_mutex {
+ int recursive;
+ Uint32 owner;
+ spinlock_t mutex;
+};
+
+/* Create a mutex */
+SDL_mutex *SDL_CreateMutex(void)
+{
+ SDL_mutex *mutex;
+
+ /* Allocate mutex memory */
+ mutex = (SDL_mutex *)SDL_malloc(sizeof(*mutex));
+ if ( mutex ) {
+ spinlock_init(&mutex->mutex);
+ mutex->recursive = 0;
+ mutex->owner = 0;
+ } else {
+ SDL_OutOfMemory();
+ }
+ return mutex;
+}
+
+/* Free the mutex */
+void SDL_DestroyMutex(SDL_mutex *mutex)
+{
+ if ( mutex ) {
+ SDL_free(mutex);
+ }
+}
+
+/* Lock the semaphore */
+int SDL_mutexP(SDL_mutex *mutex)
+{
+#if SDL_THREADS_DISABLED
+ return SDL_arraysize(return ),0;
+#else
+ Uint32 this_thread;
+
+ if ( mutex == NULL ) {
+ SDL_SetError("Passed a NULL mutex");
+ return -1;
+ }
+
+ this_thread = SDL_ThreadID();
+ if ( mutex->owner == this_thread ) {
+ ++mutex->recursive;
+ } else {
+ /* The order of operations is important.
+ We set the locking thread id after we obtain the lock
+ so unlocks from other threads will fail.
+ */
+ spinlock_lock(&mutex->mutex);
+ mutex->owner = this_thread;
+ mutex->recursive = 0;
+ }
+
+ return 0;
+#endif /* SDL_THREADS_DISABLED */
+}
+
+/* Unlock the mutex */
+int SDL_mutexV(SDL_mutex *mutex)
+{
+#if SDL_THREADS_DISABLED
+ return 0;
+#else
+ if ( mutex == NULL ) {
+ SDL_SetError("Passed a NULL mutex");
+ return -1;
+ }
+
+ /* If we don't own the mutex, we can't unlock it */
+ if ( SDL_ThreadID() != mutex->owner ) {
+ SDL_SetError("mutex not owned by this thread");
+ return -1;
+ }
+
+ if ( mutex->recursive ) {
+ --mutex->recursive;
+ } else {
+ /* The order of operations is important.
+ First reset the owner so another thread doesn't lock
+ the mutex and set the ownership before we reset it,
+ then release the lock semaphore.
+ */
+ mutex->owner = 0;
+ spinlock_unlock(&mutex->mutex);
+ }
+ return 0;
+#endif /* SDL_THREADS_DISABLED */
+}
diff --git a/distrib/sdl-1.2.15/src/thread/dc/SDL_sysmutex_c.h b/distrib/sdl-1.2.15/src/thread/dc/SDL_sysmutex_c.h
new file mode 100644
index 0000000..1120b2d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/dc/SDL_sysmutex_c.h
@@ -0,0 +1,23 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
diff --git a/distrib/sdl-1.2.15/src/thread/dc/SDL_syssem.c b/distrib/sdl-1.2.15/src/thread/dc/SDL_syssem.c
new file mode 100644
index 0000000..9831ccd
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/dc/SDL_syssem.c
@@ -0,0 +1,173 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#include <errno.h>
+
+#include "SDL_config.h"
+
+/* An implementation of semaphores using mutexes and condition variables */
+
+#include "SDL_timer.h"
+#include "SDL_thread.h"
+#include "SDL_systhread_c.h"
+
+
+#if SDL_THREADS_DISABLED
+
+SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
+{
+ SDL_SetError("SDL not configured with thread support");
+ return (SDL_sem *)0;
+}
+
+void SDL_DestroySemaphore(SDL_sem *sem)
+{
+ return;
+}
+
+int SDL_SemTryWait(SDL_sem *sem)
+{
+ SDL_SetError("SDL not configured with thread support");
+ return -1;
+}
+
+int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
+{
+ SDL_SetError("SDL not configured with thread support");
+ return -1;
+}
+
+int SDL_SemWait(SDL_sem *sem)
+{
+ SDL_SetError("SDL not configured with thread support");
+ return -1;
+}
+
+Uint32 SDL_SemValue(SDL_sem *sem)
+{
+ return 0;
+}
+
+int SDL_SemPost(SDL_sem *sem)
+{
+ SDL_SetError("SDL not configured with thread support");
+ return -1;
+}
+
+#else
+
+#include <kos/sem.h>
+
+struct SDL_semaphore
+{
+ semaphore_t sem;
+};
+
+SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
+{
+ return (SDL_sem *)sem_create(initial_value);
+}
+
+/* WARNING:
+ You cannot call this function when another thread is using the semaphore.
+*/
+void SDL_DestroySemaphore(SDL_sem *sem)
+{
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return;
+ }
+
+ sem_destroy(&sem->sem);
+}
+
+int SDL_SemTryWait(SDL_sem *sem)
+{
+ int retval;
+
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+
+ retval = sem_trywait(&sem->sem);
+ if (retval==0) return 0;
+ else return SDL_MUTEX_TIMEDOUT;
+
+ return retval;
+}
+
+int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
+{
+ int retval;
+
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+
+ /* A timeout of 0 is an easy case */
+ if ( timeout == 0 ) {
+ return SDL_SemTryWait(sem);
+ }
+
+ retval = sem_wait_timed(&sem->sem,timeout);
+ if (retval==-1) retval= SDL_MUTEX_TIMEDOUT;
+
+ return retval;
+}
+
+int SDL_SemWait(SDL_sem *sem)
+{
+ int retval;
+
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+
+ while ( ((retval = sem_wait(&sem->sem)) == -1) && (errno == EINTR) ) {}
+ return retval;
+}
+
+Uint32 SDL_SemValue(SDL_sem *sem)
+{
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+
+ return sem_count(&sem->sem);
+}
+
+int SDL_SemPost(SDL_sem *sem)
+{
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+
+ sem_signal(&sem->sem);
+ return 0;
+}
+
+#endif /* SDL_THREADS_DISABLED */
diff --git a/distrib/sdl-1.2.15/src/thread/dc/SDL_syssem_c.h b/distrib/sdl-1.2.15/src/thread/dc/SDL_syssem_c.h
new file mode 100644
index 0000000..1120b2d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/dc/SDL_syssem_c.h
@@ -0,0 +1,23 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
diff --git a/distrib/sdl-1.2.15/src/thread/dc/SDL_systhread.c b/distrib/sdl-1.2.15/src/thread/dc/SDL_systhread.c
new file mode 100644
index 0000000..dd26675
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/dc/SDL_systhread.c
@@ -0,0 +1,60 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Thread management routines for SDL */
+
+#include "SDL_thread.h"
+#include "../SDL_thread_c.h"
+#include "../SDL_systhread.h"
+
+#include <kos/thread.h>
+
+int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
+{
+ thread->handle = thd_create(SDL_RunThread,args);
+ if (thread->handle == NULL) {
+ SDL_SetError("Not enough resources to create thread");
+ return(-1);
+ }
+ return(0);
+}
+
+void SDL_SYS_SetupThread(void)
+{
+ return;
+}
+
+Uint32 SDL_ThreadID(void)
+{
+ return (Uint32)thd_get_current();
+}
+
+void SDL_SYS_WaitThread(SDL_Thread *thread)
+{
+ thd_wait(thread->handle);
+}
+
+void SDL_SYS_KillThread(SDL_Thread *thread)
+{
+ thd_destroy(thread->handle);
+}
diff --git a/distrib/sdl-1.2.15/src/thread/dc/SDL_systhread_c.h b/distrib/sdl-1.2.15/src/thread/dc/SDL_systhread_c.h
new file mode 100644
index 0000000..3cda1a4
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/dc/SDL_systhread_c.h
@@ -0,0 +1,24 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+typedef struct kthread* SYS_ThreadHandle;
diff --git a/distrib/sdl-1.2.15/src/thread/generic/SDL_syscond.c b/distrib/sdl-1.2.15/src/thread/generic/SDL_syscond.c
new file mode 100644
index 0000000..f6e7223
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/generic/SDL_syscond.c
@@ -0,0 +1,215 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* An implementation of condition variables using semaphores and mutexes */
+/*
+ This implementation borrows heavily from the BeOS condition variable
+ implementation, written by Christopher Tate and Owen Smith. Thanks!
+ */
+
+#include "SDL_thread.h"
+
+struct SDL_cond
+{
+ SDL_mutex *lock;
+ int waiting;
+ int signals;
+ SDL_sem *wait_sem;
+ SDL_sem *wait_done;
+};
+
+/* Create a condition variable */
+SDL_cond * SDL_CreateCond(void)
+{
+ SDL_cond *cond;
+
+ cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond));
+ if ( cond ) {
+ cond->lock = SDL_CreateMutex();
+ cond->wait_sem = SDL_CreateSemaphore(0);
+ cond->wait_done = SDL_CreateSemaphore(0);
+ cond->waiting = cond->signals = 0;
+ if ( ! cond->lock || ! cond->wait_sem || ! cond->wait_done ) {
+ SDL_DestroyCond(cond);
+ cond = NULL;
+ }
+ } else {
+ SDL_OutOfMemory();
+ }
+ return(cond);
+}
+
+/* Destroy a condition variable */
+void SDL_DestroyCond(SDL_cond *cond)
+{
+ if ( cond ) {
+ if ( cond->wait_sem ) {
+ SDL_DestroySemaphore(cond->wait_sem);
+ }
+ if ( cond->wait_done ) {
+ SDL_DestroySemaphore(cond->wait_done);
+ }
+ if ( cond->lock ) {
+ SDL_DestroyMutex(cond->lock);
+ }
+ SDL_free(cond);
+ }
+}
+
+/* Restart one of the threads that are waiting on the condition variable */
+int SDL_CondSignal(SDL_cond *cond)
+{
+ if ( ! cond ) {
+ SDL_SetError("Passed a NULL condition variable");
+ return -1;
+ }
+
+ /* If there are waiting threads not already signalled, then
+ signal the condition and wait for the thread to respond.
+ */
+ SDL_LockMutex(cond->lock);
+ if ( cond->waiting > cond->signals ) {
+ ++cond->signals;
+ SDL_SemPost(cond->wait_sem);
+ SDL_UnlockMutex(cond->lock);
+ SDL_SemWait(cond->wait_done);
+ } else {
+ SDL_UnlockMutex(cond->lock);
+ }
+
+ return 0;
+}
+
+/* Restart all threads that are waiting on the condition variable */
+int SDL_CondBroadcast(SDL_cond *cond)
+{
+ if ( ! cond ) {
+ SDL_SetError("Passed a NULL condition variable");
+ return -1;
+ }
+
+ /* If there are waiting threads not already signalled, then
+ signal the condition and wait for the thread to respond.
+ */
+ SDL_LockMutex(cond->lock);
+ if ( cond->waiting > cond->signals ) {
+ int i, num_waiting;
+
+ num_waiting = (cond->waiting - cond->signals);
+ cond->signals = cond->waiting;
+ for ( i=0; i<num_waiting; ++i ) {
+ SDL_SemPost(cond->wait_sem);
+ }
+ /* Now all released threads are blocked here, waiting for us.
+ Collect them all (and win fabulous prizes!) :-)
+ */
+ SDL_UnlockMutex(cond->lock);
+ for ( i=0; i<num_waiting; ++i ) {
+ SDL_SemWait(cond->wait_done);
+ }
+ } else {
+ SDL_UnlockMutex(cond->lock);
+ }
+
+ return 0;
+}
+
+/* Wait on the condition variable for at most 'ms' milliseconds.
+ The mutex must be locked before entering this function!
+ The mutex is unlocked during the wait, and locked again after the wait.
+
+Typical use:
+
+Thread A:
+ SDL_LockMutex(lock);
+ while ( ! condition ) {
+ SDL_CondWait(cond);
+ }
+ SDL_UnlockMutex(lock);
+
+Thread B:
+ SDL_LockMutex(lock);
+ ...
+ condition = true;
+ ...
+ SDL_UnlockMutex(lock);
+ */
+int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms)
+{
+ int retval;
+
+ if ( ! cond ) {
+ SDL_SetError("Passed a NULL condition variable");
+ return -1;
+ }
+
+ /* Obtain the protection mutex, and increment the number of waiters.
+ This allows the signal mechanism to only perform a signal if there
+ are waiting threads.
+ */
+ SDL_LockMutex(cond->lock);
+ ++cond->waiting;
+ SDL_UnlockMutex(cond->lock);
+
+ /* Unlock the mutex, as is required by condition variable semantics */
+ SDL_UnlockMutex(mutex);
+
+ /* Wait for a signal */
+ if ( ms == SDL_MUTEX_MAXWAIT ) {
+ retval = SDL_SemWait(cond->wait_sem);
+ } else {
+ retval = SDL_SemWaitTimeout(cond->wait_sem, ms);
+ }
+
+ /* Let the signaler know we have completed the wait, otherwise
+ the signaler can race ahead and get the condition semaphore
+ if we are stopped between the mutex unlock and semaphore wait,
+ giving a deadlock. See the following URL for details:
+ http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html
+ */
+ SDL_LockMutex(cond->lock);
+ if ( cond->signals > 0 ) {
+ /* If we timed out, we need to eat a condition signal */
+ if ( retval > 0 ) {
+ SDL_SemWait(cond->wait_sem);
+ }
+ /* We always notify the signal thread that we are done */
+ SDL_SemPost(cond->wait_done);
+
+ /* Signal handshake complete */
+ --cond->signals;
+ }
+ --cond->waiting;
+ SDL_UnlockMutex(cond->lock);
+
+ /* Lock the mutex, as is required by condition variable semantics */
+ SDL_LockMutex(mutex);
+
+ return retval;
+}
+
+/* Wait on the condition variable forever */
+int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex)
+{
+ return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT);
+}
diff --git a/distrib/sdl-1.2.15/src/thread/generic/SDL_sysmutex.c b/distrib/sdl-1.2.15/src/thread/generic/SDL_sysmutex.c
new file mode 100644
index 0000000..ecfea87
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/generic/SDL_sysmutex.c
@@ -0,0 +1,129 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* An implementation of mutexes using semaphores */
+
+#include "SDL_thread.h"
+#include "SDL_systhread_c.h"
+
+
+struct SDL_mutex {
+ int recursive;
+ Uint32 owner;
+ SDL_sem *sem;
+};
+
+/* Create a mutex */
+SDL_mutex *SDL_CreateMutex(void)
+{
+ SDL_mutex *mutex;
+
+ /* Allocate mutex memory */
+ mutex = (SDL_mutex *)SDL_malloc(sizeof(*mutex));
+ if ( mutex ) {
+ /* Create the mutex semaphore, with initial value 1 */
+ mutex->sem = SDL_CreateSemaphore(1);
+ mutex->recursive = 0;
+ mutex->owner = 0;
+ if ( ! mutex->sem ) {
+ SDL_free(mutex);
+ mutex = NULL;
+ }
+ } else {
+ SDL_OutOfMemory();
+ }
+ return mutex;
+}
+
+/* Free the mutex */
+void SDL_DestroyMutex(SDL_mutex *mutex)
+{
+ if ( mutex ) {
+ if ( mutex->sem ) {
+ SDL_DestroySemaphore(mutex->sem);
+ }
+ SDL_free(mutex);
+ }
+}
+
+/* Lock the semaphore */
+int SDL_mutexP(SDL_mutex *mutex)
+{
+#if SDL_THREADS_DISABLED
+ return 0;
+#else
+ Uint32 this_thread;
+
+ if ( mutex == NULL ) {
+ SDL_SetError("Passed a NULL mutex");
+ return -1;
+ }
+
+ this_thread = SDL_ThreadID();
+ if ( mutex->owner == this_thread ) {
+ ++mutex->recursive;
+ } else {
+ /* The order of operations is important.
+ We set the locking thread id after we obtain the lock
+ so unlocks from other threads will fail.
+ */
+ SDL_SemWait(mutex->sem);
+ mutex->owner = this_thread;
+ mutex->recursive = 0;
+ }
+
+ return 0;
+#endif /* SDL_THREADS_DISABLED */
+}
+
+/* Unlock the mutex */
+int SDL_mutexV(SDL_mutex *mutex)
+{
+#if SDL_THREADS_DISABLED
+ return 0;
+#else
+ if ( mutex == NULL ) {
+ SDL_SetError("Passed a NULL mutex");
+ return -1;
+ }
+
+ /* If we don't own the mutex, we can't unlock it */
+ if ( SDL_ThreadID() != mutex->owner ) {
+ SDL_SetError("mutex not owned by this thread");
+ return -1;
+ }
+
+ if ( mutex->recursive ) {
+ --mutex->recursive;
+ } else {
+ /* The order of operations is important.
+ First reset the owner so another thread doesn't lock
+ the mutex and set the ownership before we reset it,
+ then release the lock semaphore.
+ */
+ mutex->owner = 0;
+ SDL_SemPost(mutex->sem);
+ }
+ return 0;
+#endif /* SDL_THREADS_DISABLED */
+}
diff --git a/distrib/sdl-1.2.15/src/thread/generic/SDL_sysmutex_c.h b/distrib/sdl-1.2.15/src/thread/generic/SDL_sysmutex_c.h
new file mode 100644
index 0000000..1120b2d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/generic/SDL_sysmutex_c.h
@@ -0,0 +1,23 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
diff --git a/distrib/sdl-1.2.15/src/thread/generic/SDL_syssem.c b/distrib/sdl-1.2.15/src/thread/generic/SDL_syssem.c
new file mode 100644
index 0000000..1d289c0
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/generic/SDL_syssem.c
@@ -0,0 +1,211 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* An implementation of semaphores using mutexes and condition variables */
+
+#include "SDL_timer.h"
+#include "SDL_thread.h"
+#include "SDL_systhread_c.h"
+
+
+#if SDL_THREADS_DISABLED
+
+SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
+{
+ SDL_SetError("SDL not configured with thread support");
+ return (SDL_sem *)0;
+}
+
+void SDL_DestroySemaphore(SDL_sem *sem)
+{
+ return;
+}
+
+int SDL_SemTryWait(SDL_sem *sem)
+{
+ SDL_SetError("SDL not configured with thread support");
+ return -1;
+}
+
+int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
+{
+ SDL_SetError("SDL not configured with thread support");
+ return -1;
+}
+
+int SDL_SemWait(SDL_sem *sem)
+{
+ SDL_SetError("SDL not configured with thread support");
+ return -1;
+}
+
+Uint32 SDL_SemValue(SDL_sem *sem)
+{
+ return 0;
+}
+
+int SDL_SemPost(SDL_sem *sem)
+{
+ SDL_SetError("SDL not configured with thread support");
+ return -1;
+}
+
+#else
+
+struct SDL_semaphore
+{
+ Uint32 count;
+ Uint32 waiters_count;
+ SDL_mutex *count_lock;
+ SDL_cond *count_nonzero;
+};
+
+SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
+{
+ SDL_sem *sem;
+
+ sem = (SDL_sem *)SDL_malloc(sizeof(*sem));
+ if ( ! sem ) {
+ SDL_OutOfMemory();
+ return NULL;
+ }
+ sem->count = initial_value;
+ sem->waiters_count = 0;
+
+ sem->count_lock = SDL_CreateMutex();
+ sem->count_nonzero = SDL_CreateCond();
+ if ( ! sem->count_lock || ! sem->count_nonzero ) {
+ SDL_DestroySemaphore(sem);
+ return NULL;
+ }
+
+ return sem;
+}
+
+/* WARNING:
+ You cannot call this function when another thread is using the semaphore.
+*/
+void SDL_DestroySemaphore(SDL_sem *sem)
+{
+ if ( sem ) {
+ sem->count = 0xFFFFFFFF;
+ while ( sem->waiters_count > 0) {
+ SDL_CondSignal(sem->count_nonzero);
+ SDL_Delay(10);
+ }
+ SDL_DestroyCond(sem->count_nonzero);
+ if ( sem->count_lock ) {
+ SDL_mutexP(sem->count_lock);
+ SDL_mutexV(sem->count_lock);
+ SDL_DestroyMutex(sem->count_lock);
+ }
+ SDL_free(sem);
+ }
+}
+
+int SDL_SemTryWait(SDL_sem *sem)
+{
+ int retval;
+
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+
+ retval = SDL_MUTEX_TIMEDOUT;
+ SDL_LockMutex(sem->count_lock);
+ if ( sem->count > 0 ) {
+ --sem->count;
+ retval = 0;
+ }
+ SDL_UnlockMutex(sem->count_lock);
+
+ return retval;
+}
+
+int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
+{
+ int retval;
+
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+
+ /* A timeout of 0 is an easy case */
+ if ( timeout == 0 ) {
+ return SDL_SemTryWait(sem);
+ }
+
+ SDL_LockMutex(sem->count_lock);
+ ++sem->waiters_count;
+ retval = 0;
+ while ( (sem->count == 0) && (retval != SDL_MUTEX_TIMEDOUT) ) {
+ retval = SDL_CondWaitTimeout(sem->count_nonzero,
+ sem->count_lock, timeout);
+ }
+ --sem->waiters_count;
+ if (retval == 0) {
+ --sem->count;
+ }
+ SDL_UnlockMutex(sem->count_lock);
+
+ return retval;
+}
+
+int SDL_SemWait(SDL_sem *sem)
+{
+ return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT);
+}
+
+Uint32 SDL_SemValue(SDL_sem *sem)
+{
+ Uint32 value;
+
+ value = 0;
+ if ( sem ) {
+ SDL_LockMutex(sem->count_lock);
+ value = sem->count;
+ SDL_UnlockMutex(sem->count_lock);
+ }
+ return value;
+}
+
+int SDL_SemPost(SDL_sem *sem)
+{
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+
+ SDL_LockMutex(sem->count_lock);
+ if ( sem->waiters_count > 0 ) {
+ SDL_CondSignal(sem->count_nonzero);
+ }
+ ++sem->count;
+ SDL_UnlockMutex(sem->count_lock);
+
+ return 0;
+}
+
+#endif /* SDL_THREADS_DISABLED */
diff --git a/distrib/sdl-1.2.15/src/thread/generic/SDL_systhread.c b/distrib/sdl-1.2.15/src/thread/generic/SDL_systhread.c
new file mode 100644
index 0000000..c380121
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/generic/SDL_systhread.c
@@ -0,0 +1,54 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Thread management routines for SDL */
+
+#include "SDL_thread.h"
+#include "../SDL_systhread.h"
+
+int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
+{
+ SDL_SetError("Threads are not supported on this platform");
+ return(-1);
+}
+
+void SDL_SYS_SetupThread(void)
+{
+ return;
+}
+
+Uint32 SDL_ThreadID(void)
+{
+ return(0);
+}
+
+void SDL_SYS_WaitThread(SDL_Thread *thread)
+{
+ return;
+}
+
+void SDL_SYS_KillThread(SDL_Thread *thread)
+{
+ return;
+}
+
diff --git a/distrib/sdl-1.2.15/src/thread/generic/SDL_systhread_c.h b/distrib/sdl-1.2.15/src/thread/generic/SDL_systhread_c.h
new file mode 100644
index 0000000..1535b50
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/generic/SDL_systhread_c.h
@@ -0,0 +1,25 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Stub until we implement threads on this platform */
+typedef int SYS_ThreadHandle;
diff --git a/distrib/sdl-1.2.15/src/thread/irix/SDL_syssem.c b/distrib/sdl-1.2.15/src/thread/irix/SDL_syssem.c
new file mode 100644
index 0000000..208c379
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/irix/SDL_syssem.c
@@ -0,0 +1,219 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_thread.h"
+#include "SDL_timer.h"
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>
+#include <errno.h>
+
+#include "SDL_error.h"
+#include "SDL_thread.h"
+
+
+struct SDL_semaphore {
+ int id;
+};
+
+/* Not defined by many operating systems, use configure to detect */
+/*
+#if !defined(HAVE_SEMUN)
+union semun {
+ int val;
+ struct semid_ds *buf;
+ ushort *array;
+};
+#endif
+*/
+
+static struct sembuf op_trywait[2] = {
+ { 0, -1, (IPC_NOWAIT|SEM_UNDO) } /* Decrement semaphore, no block */
+};
+static struct sembuf op_wait[2] = {
+ { 0, -1, SEM_UNDO } /* Decrement semaphore */
+};
+static struct sembuf op_post[1] = {
+ { 0, 1, (IPC_NOWAIT|SEM_UNDO) } /* Increment semaphore */
+};
+
+/* Create a blockable semaphore */
+SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
+{
+ extern int _creating_thread_lock; /* SDL_threads.c */
+ SDL_sem *sem;
+ union semun init;
+
+ sem = (SDL_sem *)SDL_malloc(sizeof(*sem));
+ if ( sem == NULL ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ sem->id = semget(IPC_PRIVATE, 1, (0600|IPC_CREAT));
+ if ( sem->id < 0 ) {
+ SDL_SetError("Couldn't create semaphore");
+ SDL_free(sem);
+ return(NULL);
+ }
+ init.val = initial_value; /* Initialize semaphore */
+ semctl(sem->id, 0, SETVAL, init);
+ return(sem);
+}
+
+void SDL_DestroySemaphore(SDL_sem *sem)
+{
+ if ( sem ) {
+#ifdef __IRIX__
+ semctl(sem->id, 0, IPC_RMID);
+#else
+ union semun dummy;
+ dummy.val = 0;
+ semctl(sem->id, 0, IPC_RMID, dummy);
+#endif
+ SDL_free(sem);
+ }
+}
+
+int SDL_SemTryWait(SDL_sem *sem)
+{
+ int retval;
+
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+
+ retval = 0;
+ tryagain:
+ if ( semop(sem->id, op_trywait, 1) < 0 ) {
+ if ( errno == EINTR ) {
+ goto tryagain;
+ }
+ retval = SDL_MUTEX_TIMEDOUT;
+ }
+ return retval;
+}
+
+int SDL_SemWait(SDL_sem *sem)
+{
+ int retval;
+
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+
+ retval = 0;
+ tryagain:
+ if ( semop(sem->id, op_wait, 1) < 0 ) {
+ if ( errno == EINTR ) {
+ goto tryagain;
+ }
+ SDL_SetError("Semaphore operation error");
+ retval = -1;
+ }
+ return retval;
+}
+
+int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
+{
+ int retval;
+
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+
+ /* Try the easy cases first */
+ if ( timeout == 0 ) {
+ return SDL_SemTryWait(sem);
+ }
+ if ( timeout == SDL_MUTEX_MAXWAIT ) {
+ return SDL_SemWait(sem);
+ }
+
+ /* Ack! We have to busy wait... */
+ timeout += SDL_GetTicks();
+ do {
+ retval = SDL_SemTryWait(sem);
+ if ( retval == 0 ) {
+ break;
+ }
+ SDL_Delay(1);
+ } while ( SDL_GetTicks() < timeout );
+
+ return retval;
+}
+
+Uint32 SDL_SemValue(SDL_sem *sem)
+{
+ int semval;
+ Uint32 value;
+
+ value = 0;
+ if ( sem ) {
+ tryagain:
+#ifdef __IRIX__
+ semval = semctl(sem->id, 0, GETVAL);
+#else
+ {
+ union semun arg;
+ arg.val = 0;
+ semval = semctl(sem->id, 0, GETVAL, arg);
+ }
+#endif
+ if ( semval < 0 ) {
+ if ( errno == EINTR ) {
+ goto tryagain;
+ }
+ } else {
+ value = (Uint32)semval;
+ }
+ }
+ return value;
+}
+
+int SDL_SemPost(SDL_sem *sem)
+{
+ int retval;
+
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+
+ retval = 0;
+ tryagain:
+ if ( semop(sem->id, op_post, 1) < 0 ) {
+ if ( errno == EINTR ) {
+ goto tryagain;
+ }
+ SDL_SetError("Semaphore operation error");
+ retval = -1;
+ }
+ return retval;
+}
diff --git a/distrib/sdl-1.2.15/src/thread/irix/SDL_systhread.c b/distrib/sdl-1.2.15/src/thread/irix/SDL_systhread.c
new file mode 100644
index 0000000..7ae7fc6
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/irix/SDL_systhread.c
@@ -0,0 +1,85 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* IRIX thread management routines for SDL */
+
+#include <errno.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/prctl.h>
+
+#include "SDL_thread.h"
+#include "../SDL_systhread.h"
+
+
+static int sig_list[] = {
+ SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCLD, SIGWINCH,
+ SIGVTALRM, SIGPROF, 0
+};
+
+
+int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
+{
+ /* Create the thread and go! */
+ if ( sproc(SDL_RunThread, PR_SALL, args) < 0 ) {
+ SDL_SetError("Not enough resources to create thread");
+ return(-1);
+ }
+ return(0);
+}
+
+void SDL_SYS_SetupThread(void)
+{
+ int i;
+ sigset_t mask;
+
+ /* Mask asynchronous signals for this thread */
+ sigemptyset(&mask);
+ for ( i=0; sig_list[i]; ++i ) {
+ sigaddset(&mask, sig_list[i]);
+ }
+ sigprocmask(SIG_BLOCK, &mask, NULL);
+}
+
+/* WARNING: This may not work for systems with 64-bit pid_t */
+Uint32 SDL_ThreadID(void)
+{
+ return((Uint32)getpid());
+}
+
+/* WARNING: This may not work for systems with 64-bit pid_t */
+void SDL_WaitThread(SDL_Thread *thread, int *status)
+{
+ errno = 0;
+ while ( errno != ECHILD ) {
+ waitpid(thread->handle, NULL, 0);
+ }
+}
+
+/* WARNING: This may not work for systems with 64-bit pid_t */
+void SDL_KillThread(SDL_Thread *thread)
+{
+ kill(thread->handle, SIGKILL);
+}
+
diff --git a/distrib/sdl-1.2.15/src/thread/irix/SDL_systhread_c.h b/distrib/sdl-1.2.15/src/thread/irix/SDL_systhread_c.h
new file mode 100644
index 0000000..ee28634
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/irix/SDL_systhread_c.h
@@ -0,0 +1,27 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <sys/types.h>
+
+typedef pid_t SYS_ThreadHandle;
+
diff --git a/distrib/sdl-1.2.15/src/thread/os2/SDL_syscond.c b/distrib/sdl-1.2.15/src/thread/os2/SDL_syscond.c
new file mode 100644
index 0000000..3e80594
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/os2/SDL_syscond.c
@@ -0,0 +1,215 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* An implementation of condition variables using semaphores and mutexes */
+/*
+ This implementation borrows heavily from the BeOS condition variable
+ implementation, written by Christopher Tate and Owen Smith. Thanks!
+ */
+
+#include "SDL_thread.h"
+
+struct SDL_cond
+{
+ SDL_mutex *lock;
+ int waiting;
+ int signals;
+ SDL_sem *wait_sem;
+ SDL_sem *wait_done;
+};
+
+/* Create a condition variable */
+DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void)
+{
+ SDL_cond *cond;
+
+ cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond));
+ if ( cond ) {
+ cond->lock = SDL_CreateMutex();
+ cond->wait_sem = SDL_CreateSemaphore(0);
+ cond->wait_done = SDL_CreateSemaphore(0);
+ cond->waiting = cond->signals = 0;
+ if ( ! cond->lock || ! cond->wait_sem || ! cond->wait_done ) {
+ SDL_DestroyCond(cond);
+ cond = NULL;
+ }
+ } else {
+ SDL_OutOfMemory();
+ }
+ return(cond);
+}
+
+/* Destroy a condition variable */
+DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond)
+{
+ if ( cond ) {
+ if ( cond->wait_sem ) {
+ SDL_DestroySemaphore(cond->wait_sem);
+ }
+ if ( cond->wait_done ) {
+ SDL_DestroySemaphore(cond->wait_done);
+ }
+ if ( cond->lock ) {
+ SDL_DestroyMutex(cond->lock);
+ }
+ SDL_free(cond);
+ }
+}
+
+/* Restart one of the threads that are waiting on the condition variable */
+DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond)
+{
+ if ( ! cond ) {
+ SDL_SetError("Passed a NULL condition variable");
+ return -1;
+ }
+
+ /* If there are waiting threads not already signalled, then
+ signal the condition and wait for the thread to respond.
+ */
+ SDL_LockMutex(cond->lock);
+ if ( cond->waiting > cond->signals ) {
+ ++cond->signals;
+ SDL_SemPost(cond->wait_sem);
+ SDL_UnlockMutex(cond->lock);
+ SDL_SemWait(cond->wait_done);
+ } else {
+ SDL_UnlockMutex(cond->lock);
+ }
+
+ return 0;
+}
+
+/* Restart all threads that are waiting on the condition variable */
+DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond)
+{
+ if ( ! cond ) {
+ SDL_SetError("Passed a NULL condition variable");
+ return -1;
+ }
+
+ /* If there are waiting threads not already signalled, then
+ signal the condition and wait for the thread to respond.
+ */
+ SDL_LockMutex(cond->lock);
+ if ( cond->waiting > cond->signals ) {
+ int i, num_waiting;
+
+ num_waiting = (cond->waiting - cond->signals);
+ cond->signals = cond->waiting;
+ for ( i=0; i<num_waiting; ++i ) {
+ SDL_SemPost(cond->wait_sem);
+ }
+ /* Now all released threads are blocked here, waiting for us.
+ Collect them all (and win fabulous prizes!) :-)
+ */
+ SDL_UnlockMutex(cond->lock);
+ for ( i=0; i<num_waiting; ++i ) {
+ SDL_SemWait(cond->wait_done);
+ }
+ } else {
+ SDL_UnlockMutex(cond->lock);
+ }
+
+ return 0;
+}
+
+/* Wait on the condition variable for at most 'ms' milliseconds.
+ The mutex must be locked before entering this function!
+ The mutex is unlocked during the wait, and locked again after the wait.
+
+Typical use:
+
+Thread A:
+ SDL_LockMutex(lock);
+ while ( ! condition ) {
+ SDL_CondWait(cond);
+ }
+ SDL_UnlockMutex(lock);
+
+Thread B:
+ SDL_LockMutex(lock);
+ ...
+ condition = true;
+ ...
+ SDL_UnlockMutex(lock);
+ */
+DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms)
+{
+ int retval;
+
+ if ( ! cond ) {
+ SDL_SetError("Passed a NULL condition variable");
+ return -1;
+ }
+
+ /* Obtain the protection mutex, and increment the number of waiters.
+ This allows the signal mechanism to only perform a signal if there
+ are waiting threads.
+ */
+ SDL_LockMutex(cond->lock);
+ ++cond->waiting;
+ SDL_UnlockMutex(cond->lock);
+
+ /* Unlock the mutex, as is required by condition variable semantics */
+ SDL_UnlockMutex(mutex);
+
+ /* Wait for a signal */
+ if ( ms == SDL_MUTEX_MAXWAIT ) {
+ retval = SDL_SemWait(cond->wait_sem);
+ } else {
+ retval = SDL_SemWaitTimeout(cond->wait_sem, ms);
+ }
+
+ /* Let the signaler know we have completed the wait, otherwise
+ the signaler can race ahead and get the condition semaphore
+ if we are stopped between the mutex unlock and semaphore wait,
+ giving a deadlock. See the following URL for details:
+ http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html
+ */
+ SDL_LockMutex(cond->lock);
+ if ( cond->signals > 0 ) {
+ /* If we timed out, we need to eat a condition signal */
+ if ( retval > 0 ) {
+ SDL_SemWait(cond->wait_sem);
+ }
+ /* We always notify the signal thread that we are done */
+ SDL_SemPost(cond->wait_done);
+
+ /* Signal handshake complete */
+ --cond->signals;
+ }
+ --cond->waiting;
+ SDL_UnlockMutex(cond->lock);
+
+ /* Lock the mutex, as is required by condition variable semantics */
+ SDL_LockMutex(mutex);
+
+ return retval;
+}
+
+/* Wait on the condition variable forever */
+DECLSPEC int SDLCALL SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex)
+{
+ return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT);
+}
diff --git a/distrib/sdl-1.2.15/src/thread/os2/SDL_syscond_c.h b/distrib/sdl-1.2.15/src/thread/os2/SDL_syscond_c.h
new file mode 100644
index 0000000..1120b2d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/os2/SDL_syscond_c.h
@@ -0,0 +1,23 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
diff --git a/distrib/sdl-1.2.15/src/thread/os2/SDL_sysmutex.c b/distrib/sdl-1.2.15/src/thread/os2/SDL_sysmutex.c
new file mode 100644
index 0000000..1e21897
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/os2/SDL_sysmutex.c
@@ -0,0 +1,108 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Mutex functions using the OS/2 API */
+
+#define INCL_DOSERRORS
+#define INCL_DOSSEMAPHORES
+#include <os2.h>
+
+#include "SDL_mutex.h"
+
+
+struct SDL_mutex {
+ HMTX hmtxID;
+};
+
+/* Create a mutex */
+DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void)
+{
+ SDL_mutex *mutex;
+ APIRET ulrc;
+
+ /* Allocate mutex memory */
+ mutex = (SDL_mutex *)SDL_malloc(sizeof(*mutex));
+ if (mutex)
+ {
+ /* Create the mutex, with initial value signaled */
+ ulrc = DosCreateMutexSem(NULL, // Create unnamed semaphore
+ &(mutex->hmtxID), // Pointer to handle
+ 0L, // Flags: create it private (not shared)
+ FALSE); // Initial value: unowned
+ if (ulrc!=NO_ERROR)
+ {
+ SDL_SetError("Couldn't create mutex");
+ SDL_free(mutex);
+ mutex = NULL;
+ }
+ } else {
+ SDL_OutOfMemory();
+ }
+ return(mutex);
+}
+
+/* Free the mutex */
+DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex)
+{
+ if ( mutex )
+ {
+ if ( mutex->hmtxID )
+ {
+ DosCloseMutexSem(mutex->hmtxID);
+ mutex->hmtxID = 0;
+ }
+ SDL_free(mutex);
+ }
+}
+
+/* Lock the mutex */
+DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex)
+{
+ if ( mutex == NULL )
+ {
+ SDL_SetError("Passed a NULL mutex");
+ return -1;
+ }
+ if ( DosRequestMutexSem(mutex->hmtxID, SEM_INDEFINITE_WAIT) != NO_ERROR )
+ {
+ SDL_SetError("Couldn't wait on mutex");
+ return -1;
+ }
+ return(0);
+}
+
+/* Unlock the mutex */
+DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex)
+{
+ if ( mutex == NULL )
+ {
+ SDL_SetError("Passed a NULL mutex");
+ return -1;
+ }
+ if ( DosReleaseMutexSem(mutex->hmtxID) != NO_ERROR )
+ {
+ SDL_SetError("Couldn't release mutex");
+ return -1;
+ }
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/src/thread/os2/SDL_syssem.c b/distrib/sdl-1.2.15/src/thread/os2/SDL_syssem.c
new file mode 100644
index 0000000..d6dfba6
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/os2/SDL_syssem.c
@@ -0,0 +1,192 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Semaphore functions using the OS/2 API */
+
+#define INCL_DOS
+#define INCL_DOSERRORS
+#define INCL_DOSSEMAPHORES
+#include <os2.h>
+
+#include "SDL_thread.h"
+#include "SDL_timer.h"
+
+
+struct SDL_semaphore {
+ HMTX id;
+ HEV changed;
+ Uint32 value;
+};
+
+
+/* Create a semaphore */
+DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value)
+{
+ SDL_sem *sem;
+ ULONG ulrc;
+
+ /* Allocate sem memory */
+ sem = (SDL_sem *)SDL_malloc(sizeof(*sem));
+ if ( sem ) {
+ /* Create the mutex semaphore */
+ ulrc = DosCreateMutexSem(NULL,&(sem->id),0,TRUE);
+ if ( ulrc ) {
+ SDL_SetError("Couldn't create semaphore");
+ SDL_free(sem);
+ sem = NULL;
+ } else
+ {
+ DosCreateEventSem(NULL, &(sem->changed), 0, FALSE);
+ sem->value = initial_value;
+ DosReleaseMutexSem(sem->id);
+ }
+ } else {
+ SDL_OutOfMemory();
+ }
+ return(sem);
+}
+
+/* Free the semaphore */
+DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem)
+{
+ if ( sem ) {
+ if ( sem->id ) {
+ DosCloseEventSem(sem->changed);
+ DosCloseMutexSem(sem->id);
+ sem->id = 0;
+ }
+ SDL_free(sem);
+ }
+}
+
+DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
+{
+ ULONG ulrc;
+
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL sem");
+ return -1;
+ }
+
+ if ( timeout == SDL_MUTEX_MAXWAIT ) {
+ while (1) {
+ ulrc = DosRequestMutexSem(sem->id, SEM_INDEFINITE_WAIT);
+ if (ulrc) {
+ /* if error waiting mutex */
+ SDL_SetError("DosRequestMutexSem() failed");
+ return -1;
+ } else if (sem->value) {
+ sem->value--;
+ DosReleaseMutexSem(sem->id);
+ return 0;
+ } else {
+ ULONG ulPostCount;
+ DosResetEventSem(sem->changed, &ulPostCount);
+ DosReleaseMutexSem(sem->id);
+ /* continue waiting until somebody posts the semaphore */
+ DosWaitEventSem(sem->changed, SEM_INDEFINITE_WAIT);
+ }
+ }
+ } else
+ if ( timeout == 0 )
+ {
+ ulrc = DosRequestMutexSem(sem->id, SEM_INDEFINITE_WAIT);
+ if (ulrc==NO_ERROR)
+ {
+ if (sem->value)
+ {
+ sem->value--;
+ DosReleaseMutexSem(sem->id);
+ return 0;
+ } else
+ {
+ DosReleaseMutexSem(sem->id);
+ return SDL_MUTEX_TIMEDOUT;
+ }
+ } else
+ {
+ SDL_SetError("DosRequestMutexSem() failed");
+ return -1;
+ }
+ } else {
+ ulrc = DosRequestMutexSem(sem->id, SEM_INDEFINITE_WAIT);
+ if (ulrc) {
+ /* if error waiting mutex */
+ SDL_SetError("DosRequestMutexSem() failed");
+ return -1;
+ } else
+ if (sem->value) {
+ sem->value--;
+ DosReleaseMutexSem(sem->id);
+ return 0;
+ } else {
+ ULONG ulPostCount;
+ DosResetEventSem(sem->changed, &ulPostCount);
+ DosReleaseMutexSem(sem->id);
+ /* continue waiting until somebody posts the semaphore */
+ ulrc = DosWaitEventSem(sem->changed, timeout);
+ if (ulrc==NO_ERROR)
+ return 0;
+ else
+ return SDL_MUTEX_TIMEDOUT;
+ }
+ }
+ /* never reached */
+ return -1;
+}
+
+DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem *sem)
+{
+ return SDL_SemWaitTimeout(sem, 0);
+}
+
+DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem)
+{
+ return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT);
+}
+
+/* Returns the current count of the semaphore */
+DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem)
+{
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL sem");
+ return 0;
+ }
+ return sem->value;
+}
+
+DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem)
+{
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL sem");
+ return -1;
+ }
+ if ( DosRequestMutexSem(sem->id,SEM_INDEFINITE_WAIT) ) {
+ SDL_SetError("DosRequestMutexSem() failed");
+ return -1;
+ }
+ sem->value++;
+ DosPostEventSem(sem->changed);
+ DosReleaseMutexSem(sem->id);
+ return 0;
+}
diff --git a/distrib/sdl-1.2.15/src/thread/os2/SDL_systhread.c b/distrib/sdl-1.2.15/src/thread/os2/SDL_systhread.c
new file mode 100644
index 0000000..33f815a
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/os2/SDL_systhread.c
@@ -0,0 +1,108 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* OS/2 thread management routines for SDL */
+
+#include <process.h>
+#define INCL_DOSERRORS
+#define INCL_DOSPROCESS
+#include <os2.h>
+
+#include "SDL_thread.h"
+#include "../SDL_systhread.h"
+#include "../SDL_thread_c.h"
+
+typedef struct ThreadStartParms
+{
+ void *args;
+ pfnSDL_CurrentEndThread pfnCurrentEndThread;
+} tThreadStartParms, *pThreadStartParms;
+
+static void threadfunc(void *pparm)
+{
+ pThreadStartParms pThreadParms = pparm;
+ pfnSDL_CurrentEndThread pfnCurrentEndThread = NULL;
+
+ // Call the thread function!
+ SDL_RunThread(pThreadParms->args);
+
+ // Get the current endthread we have to use!
+ if (pThreadParms)
+ {
+ pfnCurrentEndThread = pThreadParms->pfnCurrentEndThread;
+ SDL_free(pThreadParms);
+ }
+ // Call endthread!
+ if (pfnCurrentEndThread)
+ (*pfnCurrentEndThread)();
+}
+
+int SDL_SYS_CreateThread(SDL_Thread *thread, void *args, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread)
+{
+ pThreadStartParms pThreadParms = SDL_malloc(sizeof(tThreadStartParms));
+ if (!pThreadParms)
+ {
+ SDL_SetError("Not enough memory to create thread");
+ return(-1);
+ }
+
+ // Save the function which we will have to call to clear the RTL of calling app!
+ pThreadParms->pfnCurrentEndThread = pfnEndThread;
+ // Also save the real parameters we have to pass to thread function
+ pThreadParms->args = args;
+ // Start the thread using the runtime library of calling app!
+ thread->threadid = thread->handle = (*pfnBeginThread)(threadfunc, NULL, 512*1024, pThreadParms);
+ if ((int)thread->threadid <= 0)
+ {
+ SDL_SetError("Not enough resources to create thread");
+ return(-1);
+ }
+ return(0);
+}
+
+void SDL_SYS_SetupThread(void)
+{
+ return;
+}
+
+DECLSPEC Uint32 SDLCALL SDL_ThreadID(void)
+{
+ PTIB tib;
+ DosGetInfoBlocks(&tib, NULL);
+ return((Uint32) (tib->tib_ptib2->tib2_ultid));
+}
+
+void SDL_SYS_WaitThread(SDL_Thread *thread)
+{
+ TID tid = thread->handle;
+ DosWaitThread(&tid, DCWW_WAIT);
+}
+
+/* WARNING: This function is really a last resort.
+ * Threads should be signaled and then exit by themselves.
+ * TerminateThread() doesn't perform stack and DLL cleanup.
+ */
+void SDL_SYS_KillThread(SDL_Thread *thread)
+{
+ DosKillThread(thread->handle);
+}
diff --git a/distrib/sdl-1.2.15/src/thread/os2/SDL_systhread_c.h b/distrib/sdl-1.2.15/src/thread/os2/SDL_systhread_c.h
new file mode 100644
index 0000000..3b94dfe
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/os2/SDL_systhread_c.h
@@ -0,0 +1,28 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#define INCL_DOSPROCESS
+#include <os2.h>
+
+typedef TID SYS_ThreadHandle;
+
diff --git a/distrib/sdl-1.2.15/src/thread/pth/SDL_syscond.c b/distrib/sdl-1.2.15/src/thread/pth/SDL_syscond.c
new file mode 100644
index 0000000..ede74aa
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/pth/SDL_syscond.c
@@ -0,0 +1,164 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * GNU pth conditions variables
+ *
+ * Patrice Mandin
+ */
+
+#include <pth.h>
+
+#include "SDL_thread.h"
+#include "SDL_sysmutex_c.h"
+
+struct SDL_cond
+{
+ pth_cond_t condpth_p;
+};
+
+/* Create a condition variable */
+SDL_cond * SDL_CreateCond(void)
+{
+ SDL_cond *cond;
+
+ cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond));
+ if ( cond ) {
+ if ( pth_cond_init(&(cond->condpth_p)) < 0 ) {
+ SDL_SetError("pthread_cond_init() failed");
+ SDL_free(cond);
+ cond = NULL;
+ }
+ } else {
+ SDL_OutOfMemory();
+ }
+ return(cond);
+}
+
+/* Destroy a condition variable */
+void SDL_DestroyCond(SDL_cond *cond)
+{
+ if ( cond ) {
+ SDL_free(cond);
+ }
+}
+
+/* Restart one of the threads that are waiting on the condition variable */
+int SDL_CondSignal(SDL_cond *cond)
+{
+ int retval;
+
+ if ( ! cond ) {
+ SDL_SetError("Passed a NULL condition variable");
+ return -1;
+ }
+
+ retval = 0;
+ if ( pth_cond_notify(&(cond->condpth_p), FALSE) != 0 ) {
+ SDL_SetError("pth_cond_notify() failed");
+ retval = -1;
+ }
+ return retval;
+}
+
+/* Restart all threads that are waiting on the condition variable */
+int SDL_CondBroadcast(SDL_cond *cond)
+{
+ int retval;
+
+ if ( ! cond ) {
+ SDL_SetError("Passed a NULL condition variable");
+ return -1;
+ }
+
+ retval = 0;
+ if ( pth_cond_notify(&(cond->condpth_p), TRUE) != 0 ) {
+ SDL_SetError("pth_cond_notify() failed");
+ retval = -1;
+ }
+ return retval;
+}
+
+/* Wait on the condition variable for at most 'ms' milliseconds.
+ The mutex must be locked before entering this function!
+ The mutex is unlocked during the wait, and locked again after the wait.
+
+Typical use:
+
+Thread A:
+ SDL_LockMutex(lock);
+ while ( ! condition ) {
+ SDL_CondWait(cond);
+ }
+ SDL_UnlockMutex(lock);
+
+Thread B:
+ SDL_LockMutex(lock);
+ ...
+ condition = true;
+ ...
+ SDL_UnlockMutex(lock);
+ */
+int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms)
+{
+ int retval;
+ pth_event_t ev;
+ int sec;
+
+ if ( ! cond ) {
+ SDL_SetError("Passed a NULL condition variable");
+ return -1;
+ }
+
+ retval = 0;
+
+ sec = ms/1000;
+ ev = pth_event(PTH_EVENT_TIME, pth_timeout(sec,(ms-sec*1000)*1000));
+
+ if ( pth_cond_await(&(cond->condpth_p), &(mutex->mutexpth_p), ev) != 0 ) {
+ SDL_SetError("pth_cond_await() failed");
+ retval = -1;
+ }
+
+ pth_event_free(ev, PTH_FREE_ALL);
+
+ return retval;
+}
+
+/* Wait on the condition variable forever */
+int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex)
+{
+ int retval;
+
+ if ( ! cond ) {
+ SDL_SetError("Passed a NULL condition variable");
+ return -1;
+ }
+
+ retval = 0;
+ if ( pth_cond_await(&(cond->condpth_p), &(mutex->mutexpth_p), NULL) != 0 ) {
+ SDL_SetError("pth_cond_await() failed");
+ retval = -1;
+ }
+ return retval;
+}
diff --git a/distrib/sdl-1.2.15/src/thread/pth/SDL_sysmutex.c b/distrib/sdl-1.2.15/src/thread/pth/SDL_sysmutex.c
new file mode 100644
index 0000000..ca83b92
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/pth/SDL_sysmutex.c
@@ -0,0 +1,87 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * GNU pth mutexes
+ *
+ * Patrice Mandin
+ */
+
+#include <pth.h>
+
+#include "SDL_mutex.h"
+#include "SDL_sysmutex_c.h"
+
+/* Create a mutex */
+SDL_mutex *SDL_CreateMutex(void)
+{
+ SDL_mutex *mutex;
+
+ /* Allocate mutex memory */
+ mutex = (SDL_mutex *)SDL_malloc(sizeof(*mutex));
+ if ( mutex ) {
+ /* Create the mutex, with initial value signaled */
+ if (!pth_mutex_init(&(mutex->mutexpth_p))) {
+ SDL_SetError("Couldn't create mutex");
+ SDL_free(mutex);
+ mutex = NULL;
+ }
+ } else {
+ SDL_OutOfMemory();
+ }
+ return(mutex);
+}
+
+/* Free the mutex */
+void SDL_DestroyMutex(SDL_mutex *mutex)
+{
+ if ( mutex ) {
+ SDL_free(mutex);
+ }
+}
+
+/* Lock the mutex */
+int SDL_mutexP(SDL_mutex *mutex)
+{
+ if ( mutex == NULL ) {
+ SDL_SetError("Passed a NULL mutex");
+ return -1;
+ }
+
+ pth_mutex_acquire(&(mutex->mutexpth_p), FALSE, NULL);
+
+ return(0);
+}
+
+/* Unlock the mutex */
+int SDL_mutexV(SDL_mutex *mutex)
+{
+ if ( mutex == NULL ) {
+ SDL_SetError("Passed a NULL mutex");
+ return -1;
+ }
+
+ pth_mutex_release(&(mutex->mutexpth_p));
+
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/src/thread/pth/SDL_sysmutex_c.h b/distrib/sdl-1.2.15/src/thread/pth/SDL_sysmutex_c.h
new file mode 100644
index 0000000..d29060e
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/pth/SDL_sysmutex_c.h
@@ -0,0 +1,31 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_SYSMUTEX_C_H_
+#define _SDL_SYSMUTEX_C_H_
+
+struct SDL_mutex {
+ pth_mutex_t mutexpth_p;
+};
+
+#endif /* _SDL_SYSMUTEX_C_H_ */
diff --git a/distrib/sdl-1.2.15/src/thread/pth/SDL_systhread.c b/distrib/sdl-1.2.15/src/thread/pth/SDL_systhread.c
new file mode 100644
index 0000000..bfccaf3
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/pth/SDL_systhread.c
@@ -0,0 +1,103 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * GNU pth threads
+ *
+ * Patrice Mandin
+ */
+
+#include <pth.h>
+#include <signal.h>
+
+#include "SDL_thread.h"
+#include "../SDL_thread_c.h"
+#include "../SDL_systhread.h"
+
+/* List of signals to mask in the subthreads */
+static int sig_list[] = {
+ SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH,
+ SIGVTALRM, SIGPROF, 0
+};
+
+static void *RunThread(void *data)
+{
+ SDL_RunThread(data);
+ pth_exit((void*)0);
+ return((void *)0); /* Prevent compiler warning */
+}
+
+int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
+{
+ pth_attr_t type;
+
+ /* Create a new attribute */
+ type = pth_attr_new();
+ if ( type == NULL ) {
+ SDL_SetError("Couldn't initialize pth attributes");
+ return(-1);
+ }
+ pth_attr_set(type, PTH_ATTR_JOINABLE, TRUE);
+
+ /* Create the thread and go! */
+ thread->handle = pth_spawn(type, RunThread, args);
+ if ( thread->handle == NULL ) {
+ SDL_SetError("Not enough resources to create thread");
+ return(-1);
+ }
+ return(0);
+}
+
+void SDL_SYS_SetupThread(void)
+{
+ int i;
+ sigset_t mask;
+ int oldstate;
+
+ /* Mask asynchronous signals for this thread */
+ sigemptyset(&mask);
+ for ( i=0; sig_list[i]; ++i ) {
+ sigaddset(&mask, sig_list[i]);
+ }
+ pth_sigmask(SIG_BLOCK, &mask, 0);
+
+ /* Allow ourselves to be asynchronously cancelled */
+ pth_cancel_state(PTH_CANCEL_ASYNCHRONOUS, &oldstate);
+}
+
+/* WARNING: This may not work for systems with 64-bit pid_t */
+Uint32 SDL_ThreadID(void)
+{
+ return((Uint32)pth_self());
+}
+
+void SDL_SYS_WaitThread(SDL_Thread *thread)
+{
+ pth_join(thread->handle, NULL);
+}
+
+void SDL_SYS_KillThread(SDL_Thread *thread)
+{
+ pth_cancel(thread->handle);
+ pth_join(thread->handle, NULL);
+}
diff --git a/distrib/sdl-1.2.15/src/thread/pth/SDL_systhread_c.h b/distrib/sdl-1.2.15/src/thread/pth/SDL_systhread_c.h
new file mode 100644
index 0000000..50bb26d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/pth/SDL_systhread_c.h
@@ -0,0 +1,31 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_SYSTHREAD_C_H_
+#define _SDL_SYSTHREAD_C_H_
+
+#include <pth.h>
+
+typedef pth_t SYS_ThreadHandle;
+
+#endif /* _SDL_SYSTHREAD_C_H_ */
diff --git a/distrib/sdl-1.2.15/src/thread/pthread/SDL_syscond.c b/distrib/sdl-1.2.15/src/thread/pthread/SDL_syscond.c
new file mode 100644
index 0000000..15bce96
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/pthread/SDL_syscond.c
@@ -0,0 +1,155 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <sys/time.h>
+#include <unistd.h>
+#include <errno.h>
+#include <pthread.h>
+
+#include "SDL_thread.h"
+#include "SDL_sysmutex_c.h"
+
+struct SDL_cond
+{
+ pthread_cond_t cond;
+};
+
+/* Create a condition variable */
+SDL_cond * SDL_CreateCond(void)
+{
+ SDL_cond *cond;
+
+ cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond));
+ if ( cond ) {
+ if ( pthread_cond_init(&cond->cond, NULL) < 0 ) {
+ SDL_SetError("pthread_cond_init() failed");
+ SDL_free(cond);
+ cond = NULL;
+ }
+ }
+ return(cond);
+}
+
+/* Destroy a condition variable */
+void SDL_DestroyCond(SDL_cond *cond)
+{
+ if ( cond ) {
+ pthread_cond_destroy(&cond->cond);
+ SDL_free(cond);
+ }
+}
+
+/* Restart one of the threads that are waiting on the condition variable */
+int SDL_CondSignal(SDL_cond *cond)
+{
+ int retval;
+
+ if ( ! cond ) {
+ SDL_SetError("Passed a NULL condition variable");
+ return -1;
+ }
+
+ retval = 0;
+ if ( pthread_cond_signal(&cond->cond) != 0 ) {
+ SDL_SetError("pthread_cond_signal() failed");
+ retval = -1;
+ }
+ return retval;
+}
+
+/* Restart all threads that are waiting on the condition variable */
+int SDL_CondBroadcast(SDL_cond *cond)
+{
+ int retval;
+
+ if ( ! cond ) {
+ SDL_SetError("Passed a NULL condition variable");
+ return -1;
+ }
+
+ retval = 0;
+ if ( pthread_cond_broadcast(&cond->cond) != 0 ) {
+ SDL_SetError("pthread_cond_broadcast() failed");
+ retval = -1;
+ }
+ return retval;
+}
+
+int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms)
+{
+ int retval;
+ struct timeval delta;
+ struct timespec abstime;
+
+ if ( ! cond ) {
+ SDL_SetError("Passed a NULL condition variable");
+ return -1;
+ }
+
+ gettimeofday(&delta, NULL);
+
+ abstime.tv_sec = delta.tv_sec + (ms/1000);
+ abstime.tv_nsec = (delta.tv_usec + (ms%1000) * 1000) * 1000;
+ if ( abstime.tv_nsec > 1000000000 ) {
+ abstime.tv_sec += 1;
+ abstime.tv_nsec -= 1000000000;
+ }
+
+ tryagain:
+ retval = pthread_cond_timedwait(&cond->cond, &mutex->id, &abstime);
+ switch (retval) {
+ case EINTR:
+ goto tryagain;
+ break;
+ case ETIMEDOUT:
+ retval = SDL_MUTEX_TIMEDOUT;
+ break;
+ case 0:
+ break;
+ default:
+ SDL_SetError("pthread_cond_timedwait() failed");
+ retval = -1;
+ break;
+ }
+ return retval;
+}
+
+/* Wait on the condition variable, unlocking the provided mutex.
+ The mutex must be locked before entering this function!
+ */
+int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex)
+{
+ int retval;
+
+ if ( ! cond ) {
+ SDL_SetError("Passed a NULL condition variable");
+ return -1;
+ }
+
+ retval = 0;
+ if ( pthread_cond_wait(&cond->cond, &mutex->id) != 0 ) {
+ SDL_SetError("pthread_cond_wait() failed");
+ retval = -1;
+ }
+ return retval;
+}
diff --git a/distrib/sdl-1.2.15/src/thread/pthread/SDL_sysmutex.c b/distrib/sdl-1.2.15/src/thread/pthread/SDL_sysmutex.c
new file mode 100644
index 0000000..c3b8ce2
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/pthread/SDL_sysmutex.c
@@ -0,0 +1,153 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <pthread.h>
+
+#include "SDL_thread.h"
+
+#if !SDL_THREAD_PTHREAD_RECURSIVE_MUTEX && \
+ !SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
+#define FAKE_RECURSIVE_MUTEX
+#endif
+
+struct SDL_mutex {
+ pthread_mutex_t id;
+#if FAKE_RECURSIVE_MUTEX
+ int recursive;
+ pthread_t owner;
+#endif
+};
+
+SDL_mutex *SDL_CreateMutex (void)
+{
+ SDL_mutex *mutex;
+ pthread_mutexattr_t attr;
+
+ /* Allocate the structure */
+ mutex = (SDL_mutex *)SDL_calloc(1, sizeof(*mutex));
+ if ( mutex ) {
+ pthread_mutexattr_init(&attr);
+#if SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+#elif SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
+ pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
+#else
+ /* No extra attributes necessary */
+#endif
+ if ( pthread_mutex_init(&mutex->id, &attr) != 0 ) {
+ SDL_SetError("pthread_mutex_init() failed");
+ SDL_free(mutex);
+ mutex = NULL;
+ }
+ } else {
+ SDL_OutOfMemory();
+ }
+ return(mutex);
+}
+
+void SDL_DestroyMutex(SDL_mutex *mutex)
+{
+ if ( mutex ) {
+ pthread_mutex_destroy(&mutex->id);
+ SDL_free(mutex);
+ }
+}
+
+/* Lock the mutex */
+int SDL_mutexP(SDL_mutex *mutex)
+{
+ int retval;
+#if FAKE_RECURSIVE_MUTEX
+ pthread_t this_thread;
+#endif
+
+ if ( mutex == NULL ) {
+ SDL_SetError("Passed a NULL mutex");
+ return -1;
+ }
+
+ retval = 0;
+#if FAKE_RECURSIVE_MUTEX
+ this_thread = pthread_self();
+ if ( mutex->owner == this_thread ) {
+ ++mutex->recursive;
+ } else {
+ /* The order of operations is important.
+ We set the locking thread id after we obtain the lock
+ so unlocks from other threads will fail.
+ */
+ if ( pthread_mutex_lock(&mutex->id) == 0 ) {
+ mutex->owner = this_thread;
+ mutex->recursive = 0;
+ } else {
+ SDL_SetError("pthread_mutex_lock() failed");
+ retval = -1;
+ }
+ }
+#else
+ if ( pthread_mutex_lock(&mutex->id) < 0 ) {
+ SDL_SetError("pthread_mutex_lock() failed");
+ retval = -1;
+ }
+#endif
+ return retval;
+}
+
+int SDL_mutexV(SDL_mutex *mutex)
+{
+ int retval;
+
+ if ( mutex == NULL ) {
+ SDL_SetError("Passed a NULL mutex");
+ return -1;
+ }
+
+ retval = 0;
+#if FAKE_RECURSIVE_MUTEX
+ /* We can only unlock the mutex if we own it */
+ if ( pthread_self() == mutex->owner ) {
+ if ( mutex->recursive ) {
+ --mutex->recursive;
+ } else {
+ /* The order of operations is important.
+ First reset the owner so another thread doesn't lock
+ the mutex and set the ownership before we reset it,
+ then release the lock semaphore.
+ */
+ mutex->owner = 0;
+ pthread_mutex_unlock(&mutex->id);
+ }
+ } else {
+ SDL_SetError("mutex not owned by this thread");
+ retval = -1;
+ }
+
+#else
+ if ( pthread_mutex_unlock(&mutex->id) < 0 ) {
+ SDL_SetError("pthread_mutex_unlock() failed");
+ retval = -1;
+ }
+#endif /* FAKE_RECURSIVE_MUTEX */
+
+ return retval;
+}
diff --git a/distrib/sdl-1.2.15/src/thread/pthread/SDL_sysmutex_c.h b/distrib/sdl-1.2.15/src/thread/pthread/SDL_sysmutex_c.h
new file mode 100644
index 0000000..5258890
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/pthread/SDL_sysmutex_c.h
@@ -0,0 +1,31 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_mutex_c_h
+#define _SDL_mutex_c_h
+
+struct SDL_mutex {
+ pthread_mutex_t id;
+};
+
+#endif /* _SDL_mutex_c_h */
diff --git a/distrib/sdl-1.2.15/src/thread/pthread/SDL_syssem.c b/distrib/sdl-1.2.15/src/thread/pthread/SDL_syssem.c
new file mode 100644
index 0000000..a03870f
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/pthread/SDL_syssem.c
@@ -0,0 +1,190 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <pthread.h>
+#include <semaphore.h>
+#include <errno.h>
+#include <sys/time.h>
+
+#include "SDL_thread.h"
+#include "SDL_timer.h"
+
+/* Wrapper around POSIX 1003.1b semaphores */
+
+#ifdef __MACOSX__
+/* Mac OS X doesn't support sem_getvalue() as of version 10.4 */
+#include "../generic/SDL_syssem.c"
+#else
+
+struct SDL_semaphore {
+ sem_t sem;
+};
+
+/* Create a semaphore, initialized with value */
+SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
+{
+ SDL_sem *sem = (SDL_sem *) SDL_malloc(sizeof(SDL_sem));
+ if ( sem ) {
+ if ( sem_init(&sem->sem, 0, initial_value) < 0 ) {
+ SDL_SetError("sem_init() failed");
+ SDL_free(sem);
+ sem = NULL;
+ }
+ } else {
+ SDL_OutOfMemory();
+ }
+ return sem;
+}
+
+void SDL_DestroySemaphore(SDL_sem *sem)
+{
+ if ( sem ) {
+ sem_destroy(&sem->sem);
+ SDL_free(sem);
+ }
+}
+
+int SDL_SemTryWait(SDL_sem *sem)
+{
+ int retval;
+
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+ retval = SDL_MUTEX_TIMEDOUT;
+ if ( sem_trywait(&sem->sem) == 0 ) {
+ retval = 0;
+ }
+ return retval;
+}
+
+int SDL_SemWait(SDL_sem *sem)
+{
+ int retval;
+
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+
+ while ( ((retval = sem_wait(&sem->sem)) == -1) && (errno == EINTR) ) {}
+ if ( retval < 0 ) {
+ SDL_SetError("sem_wait() failed");
+ }
+ return retval;
+}
+
+int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
+{
+ int retval;
+#ifdef HAVE_SEM_TIMEDWAIT
+ struct timeval now;
+ struct timespec ts_timeout;
+#else
+ Uint32 end;
+#endif
+
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+
+ /* Try the easy cases first */
+ if ( timeout == 0 ) {
+ return SDL_SemTryWait(sem);
+ }
+ if ( timeout == SDL_MUTEX_MAXWAIT ) {
+ return SDL_SemWait(sem);
+ }
+
+#ifdef HAVE_SEM_TIMEDWAIT
+ /* Setup the timeout. sem_timedwait doesn't wait for
+ * a lapse of time, but until we reach a certain time.
+ * This time is now plus the timeout.
+ */
+ gettimeofday(&now, NULL);
+
+ /* Add our timeout to current time */
+ now.tv_usec += (timeout % 1000) * 1000;
+ now.tv_sec += timeout / 1000;
+
+ /* Wrap the second if needed */
+ if ( now.tv_usec >= 1000000 ) {
+ now.tv_usec -= 1000000;
+ now.tv_sec ++;
+ }
+
+ /* Convert to timespec */
+ ts_timeout.tv_sec = now.tv_sec;
+ ts_timeout.tv_nsec = now.tv_usec * 1000;
+
+ /* Wait. */
+ do
+ retval = sem_timedwait(&sem->sem, &ts_timeout);
+ while (retval == -1 && errno == EINTR);
+
+ if (retval == -1)
+ SDL_SetError(strerror(errno));
+#else
+ end = SDL_GetTicks() + timeout;
+ while ((retval = SDL_SemTryWait(sem)) == SDL_MUTEX_TIMEDOUT) {
+ if ((SDL_GetTicks() - end) >= 0) {
+ break;
+ }
+ SDL_Delay(0);
+ }
+#endif /* HAVE_SEM_TIMEDWAIT */
+
+ return retval;
+}
+
+Uint32 SDL_SemValue(SDL_sem *sem)
+{
+ int ret = 0;
+ if ( sem ) {
+ sem_getvalue(&sem->sem, &ret);
+ if ( ret < 0 ) {
+ ret = 0;
+ }
+ }
+ return (Uint32)ret;
+}
+
+int SDL_SemPost(SDL_sem *sem)
+{
+ int retval;
+
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+
+ retval = sem_post(&sem->sem);
+ if ( retval < 0 ) {
+ SDL_SetError("sem_post() failed");
+ }
+ return retval;
+}
+
+#endif /* __MACOSX__ */
diff --git a/distrib/sdl-1.2.15/src/thread/pthread/SDL_systhread.c b/distrib/sdl-1.2.15/src/thread/pthread/SDL_systhread.c
new file mode 100644
index 0000000..40cc3b7
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/pthread/SDL_systhread.c
@@ -0,0 +1,120 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <pthread.h>
+#include <signal.h>
+
+#include "SDL_thread.h"
+#include "../SDL_thread_c.h"
+#include "../SDL_systhread.h"
+
+/* List of signals to mask in the subthreads */
+static int sig_list[] = {
+ SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH,
+ SIGVTALRM, SIGPROF, 0
+};
+
+#ifdef __RISCOS__
+/* RISC OS needs to know the main thread for
+ * it's timer and event processing. */
+int riscos_using_threads = 0;
+Uint32 riscos_main_thread = 0; /* Thread running events */
+#endif
+
+
+static void *RunThread(void *data)
+{
+ SDL_RunThread(data);
+ pthread_exit((void*)0);
+ return((void *)0); /* Prevent compiler warning */
+}
+
+int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
+{
+ pthread_attr_t type;
+
+ /* Set the thread attributes */
+ if ( pthread_attr_init(&type) != 0 ) {
+ SDL_SetError("Couldn't initialize pthread attributes");
+ return(-1);
+ }
+ pthread_attr_setdetachstate(&type, PTHREAD_CREATE_JOINABLE);
+
+ /* Create the thread and go! */
+ if ( pthread_create(&thread->handle, &type, RunThread, args) != 0 ) {
+ SDL_SetError("Not enough resources to create thread");
+ return(-1);
+ }
+
+#ifdef __RISCOS__
+ if (riscos_using_threads == 0) {
+ riscos_using_threads = 1;
+ riscos_main_thread = SDL_ThreadID();
+ }
+#endif
+
+ return(0);
+}
+
+void SDL_SYS_SetupThread(void)
+{
+ int i;
+ sigset_t mask;
+
+ /* Mask asynchronous signals for this thread */
+ sigemptyset(&mask);
+ for ( i=0; sig_list[i]; ++i ) {
+ sigaddset(&mask, sig_list[i]);
+ }
+ pthread_sigmask(SIG_BLOCK, &mask, 0);
+
+#ifdef PTHREAD_CANCEL_ASYNCHRONOUS
+ /* Allow ourselves to be asynchronously cancelled */
+ { int oldstate;
+ pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldstate);
+ }
+#endif
+}
+
+/* WARNING: This may not work for systems with 64-bit pid_t */
+Uint32 SDL_ThreadID(void)
+{
+ return((Uint32)((size_t)pthread_self()));
+}
+
+void SDL_SYS_WaitThread(SDL_Thread *thread)
+{
+ pthread_join(thread->handle, 0);
+}
+
+void SDL_SYS_KillThread(SDL_Thread *thread)
+{
+#ifdef PTHREAD_CANCEL_ASYNCHRONOUS
+ pthread_cancel(thread->handle);
+#else
+#ifdef __FREEBSD__
+#warning For some reason, this doesnt actually kill a thread - FreeBSD 3.2
+#endif
+ pthread_kill(thread->handle, SIGKILL);
+#endif
+}
diff --git a/distrib/sdl-1.2.15/src/thread/pthread/SDL_systhread_c.h b/distrib/sdl-1.2.15/src/thread/pthread/SDL_systhread_c.h
new file mode 100644
index 0000000..33ed750
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/pthread/SDL_systhread_c.h
@@ -0,0 +1,26 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <pthread.h>
+
+typedef pthread_t SYS_ThreadHandle;
diff --git a/distrib/sdl-1.2.15/src/thread/riscos/SDL_syscond.c b/distrib/sdl-1.2.15/src/thread/riscos/SDL_syscond.c
new file mode 100644
index 0000000..ee55666
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/riscos/SDL_syscond.c
@@ -0,0 +1,160 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* RISC OS implementations uses pthreads based on linux code */
+
+#if SDL_THREADS_DISABLED
+#include "../generic/SDL_syscond.c"
+#else
+#include <sys/time.h>
+#include <unistd.h>
+#include <pthread.h>
+
+#include "SDL_thread.h"
+#include "SDL_sysmutex_c.h"
+
+struct SDL_cond
+{
+ pthread_cond_t cond;
+};
+
+/* Create a condition variable */
+SDL_cond * SDL_CreateCond(void)
+{
+ SDL_cond *cond;
+
+ cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond));
+ if ( cond ) {
+ if ( pthread_cond_init(&cond->cond, NULL) < 0 ) {
+ SDL_SetError("pthread_cond_init() failed");
+ SDL_free(cond);
+ cond = NULL;
+ }
+ }
+ return(cond);
+}
+
+/* Destroy a condition variable */
+void SDL_DestroyCond(SDL_cond *cond)
+{
+ if ( cond ) {
+ pthread_cond_destroy(&cond->cond);
+ SDL_free(cond);
+ }
+}
+
+/* Restart one of the threads that are waiting on the condition variable */
+int SDL_CondSignal(SDL_cond *cond)
+{
+ int retval;
+
+ if ( ! cond ) {
+ SDL_SetError("Passed a NULL condition variable");
+ return -1;
+ }
+
+ retval = 0;
+ if ( pthread_cond_signal(&cond->cond) != 0 ) {
+ SDL_SetError("pthread_cond_signal() failed");
+ retval = -1;
+ }
+ return retval;
+}
+
+/* Restart all threads that are waiting on the condition variable */
+int SDL_CondBroadcast(SDL_cond *cond)
+{
+ int retval;
+
+ if ( ! cond ) {
+ SDL_SetError("Passed a NULL condition variable");
+ return -1;
+ }
+
+ retval = 0;
+ if ( pthread_cond_broadcast(&cond->cond) != 0 ) {
+ SDL_SetError("pthread_cond_broadcast() failed");
+ retval = -1;
+ }
+ return retval;
+}
+
+int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms)
+{
+ int retval;
+ struct timeval delta;
+ struct timespec abstime;
+
+ if ( ! cond ) {
+ SDL_SetError("Passed a NULL condition variable");
+ return -1;
+ }
+
+ gettimeofday(&delta, NULL);
+
+ abstime.tv_sec = delta.tv_sec + (ms/1000);
+ abstime.tv_nsec = (delta.tv_usec + (ms%1000) * 1000) * 1000;
+ if ( abstime.tv_nsec > 1000000000 ) {
+ abstime.tv_sec += 1;
+ abstime.tv_nsec -= 1000000000;
+ }
+
+ tryagain:
+ retval = pthread_cond_timedwait(&cond->cond, &mutex->id, &abstime);
+ switch (retval) {
+ case EINTR:
+ goto tryagain;
+ break;
+ case ETIMEDOUT:
+ retval = SDL_MUTEX_TIMEDOUT;
+ break;
+ case 0:
+ break;
+ default:
+ SDL_SetError("pthread_cond_timedwait() failed");
+ retval = -1;
+ break;
+ }
+ return retval;
+}
+
+/* Wait on the condition variable, unlocking the provided mutex.
+ The mutex must be locked before entering this function!
+ */
+int SDL_CondWait(SDL_cond *cond, SDL_mutex *mutex)
+{
+ int retval;
+
+ if ( ! cond ) {
+ SDL_SetError("Passed a NULL condition variable");
+ return -1;
+ }
+
+ retval = 0;
+ if ( pthread_cond_wait(&cond->cond, &mutex->id) != 0 ) {
+ SDL_SetError("pthread_cond_wait() failed");
+ retval = -1;
+ }
+ return retval;
+}
+#endif
diff --git a/distrib/sdl-1.2.15/src/thread/riscos/SDL_sysmutex.c b/distrib/sdl-1.2.15/src/thread/riscos/SDL_sysmutex.c
new file mode 100644
index 0000000..e9ac139
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/riscos/SDL_sysmutex.c
@@ -0,0 +1,153 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* RISC OS implementations uses pthreads based on linux code */
+
+#include "SDL_thread.h"
+
+#if SDL_THREADS_DISABLED
+#include "../generic/SDL_sysmutex.c"
+#else
+
+#include <pthread.h>
+
+struct SDL_mutex {
+ pthread_mutex_t id;
+#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX
+ int recursive;
+ pthread_t owner;
+#endif
+};
+
+SDL_mutex *SDL_CreateMutex (void)
+{
+ SDL_mutex *mutex;
+ pthread_mutexattr_t attr;
+
+ /* Allocate the structure */
+ mutex = (SDL_mutex *)SDL_calloc(1, sizeof(*mutex));
+ if ( mutex ) {
+ pthread_mutexattr_init(&attr);
+#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX
+ /* No extra attributes necessary */
+#else
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+#endif /* SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX */
+ if ( pthread_mutex_init(&mutex->id, &attr) != 0 ) {
+ SDL_SetError("pthread_mutex_init() failed");
+ SDL_free(mutex);
+ mutex = NULL;
+ }
+ } else {
+ SDL_OutOfMemory();
+ }
+ return(mutex);
+}
+
+void SDL_DestroyMutex(SDL_mutex *mutex)
+{
+ if ( mutex ) {
+ pthread_mutex_destroy(&mutex->id);
+ SDL_free(mutex);
+ }
+}
+
+/* Lock the mutex */
+int SDL_mutexP(SDL_mutex *mutex)
+{
+ int retval;
+#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX
+ pthread_t this_thread;
+#endif
+
+ if ( mutex == NULL ) {
+ SDL_SetError("Passed a NULL mutex");
+ return -1;
+ }
+
+ retval = 0;
+#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX
+ this_thread = pthread_self();
+ if ( mutex->owner == this_thread ) {
+ ++mutex->recursive;
+ } else {
+ /* The order of operations is important.
+ We set the locking thread id after we obtain the lock
+ so unlocks from other threads will fail.
+ */
+ if ( pthread_mutex_lock(&mutex->id) == 0 ) {
+ mutex->owner = this_thread;
+ mutex->recursive = 0;
+ } else {
+ SDL_SetError("pthread_mutex_lock() failed");
+ retval = -1;
+ }
+ }
+#else
+ if ( pthread_mutex_lock(&mutex->id) < 0 ) {
+ SDL_SetError("pthread_mutex_lock() failed");
+ retval = -1;
+ }
+#endif
+ return retval;
+}
+
+int SDL_mutexV(SDL_mutex *mutex)
+{
+ int retval;
+
+ if ( mutex == NULL ) {
+ SDL_SetError("Passed a NULL mutex");
+ return -1;
+ }
+
+ retval = 0;
+#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX
+ /* We can only unlock the mutex if we own it */
+ if ( pthread_self() == mutex->owner ) {
+ if ( mutex->recursive ) {
+ --mutex->recursive;
+ } else {
+ /* The order of operations is important.
+ First reset the owner so another thread doesn't lock
+ the mutex and set the ownership before we reset it,
+ then release the lock semaphore.
+ */
+ mutex->owner = 0;
+ pthread_mutex_unlock(&mutex->id);
+ }
+ } else {
+ SDL_SetError("mutex not owned by this thread");
+ retval = -1;
+ }
+
+#else
+ if ( pthread_mutex_unlock(&mutex->id) < 0 ) {
+ SDL_SetError("pthread_mutex_unlock() failed");
+ retval = -1;
+ }
+#endif /* SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX */
+
+ return retval;
+}
+#endif
diff --git a/distrib/sdl-1.2.15/src/thread/riscos/SDL_sysmutex_c.h b/distrib/sdl-1.2.15/src/thread/riscos/SDL_sysmutex_c.h
new file mode 100644
index 0000000..2391c3c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/riscos/SDL_sysmutex_c.h
@@ -0,0 +1,34 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_mutex_c_h
+#define _SDL_mutex_c_h
+
+#if !SDL_THREADS_DISABLED
+struct SDL_mutex {
+ pthread_mutex_t id;
+};
+#endif
+
+
+#endif /* _SDL_mutex_c_h */
diff --git a/distrib/sdl-1.2.15/src/thread/riscos/SDL_syssem.c b/distrib/sdl-1.2.15/src/thread/riscos/SDL_syssem.c
new file mode 100644
index 0000000..127211b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/riscos/SDL_syssem.c
@@ -0,0 +1,203 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#include <errno.h>
+
+#include "SDL_config.h"
+
+/* RISC OS semiphores based on linux code */
+
+
+#include "SDL_timer.h"
+#include "SDL_thread.h"
+#include "SDL_systhread_c.h"
+
+#if !SDL_THREADS_DISABLED
+
+SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
+{
+ SDL_SetError("SDL not configured with thread support");
+ return (SDL_sem *)0;
+}
+
+void SDL_DestroySemaphore(SDL_sem *sem)
+{
+ return;
+}
+
+int SDL_SemTryWait(SDL_sem *sem)
+{
+ SDL_SetError("SDL not configured with thread support");
+ return -1;
+}
+
+int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
+{
+ SDL_SetError("SDL not configured with thread support");
+ return -1;
+}
+
+int SDL_SemWait(SDL_sem *sem)
+{
+ SDL_SetError("SDL not configured with thread support");
+ return -1;
+}
+
+Uint32 SDL_SemValue(SDL_sem *sem)
+{
+ return 0;
+}
+
+int SDL_SemPost(SDL_sem *sem)
+{
+ SDL_SetError("SDL not configured with thread support");
+ return -1;
+}
+
+#else
+
+
+#include <unistd.h> /* For getpid() */
+#include <pthread.h>
+#include <semaphore.h>
+
+struct SDL_semaphore {
+ sem_t *sem;
+ sem_t sem_data;
+};
+
+/* Create a semaphore, initialized with value */
+SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
+{
+ SDL_sem *sem = (SDL_sem *) SDL_malloc(sizeof(SDL_sem));
+ if ( sem ) {
+ if ( sem_init(&sem->sem_data, 0, initial_value) < 0 ) {
+ SDL_SetError("sem_init() failed");
+ SDL_free(sem);
+ sem = NULL;
+ } else {
+ sem->sem = &sem->sem_data;
+ }
+ } else {
+ SDL_OutOfMemory();
+ }
+ return sem;
+}
+
+void SDL_DestroySemaphore(SDL_sem *sem)
+{
+ if ( sem ) {
+ sem_destroy(sem->sem);
+ SDL_free(sem);
+ }
+}
+
+int SDL_SemTryWait(SDL_sem *sem)
+{
+ int retval;
+
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+ retval = SDL_MUTEX_TIMEDOUT;
+ if ( sem_trywait(sem->sem) == 0 ) {
+ retval = 0;
+ }
+ return retval;
+}
+
+int SDL_SemWait(SDL_sem *sem)
+{
+ int retval;
+
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+
+ while ( ((retval = sem_wait(sem->sem)) == -1) && (errno == EINTR) ) {}
+ if ( retval < 0 ) {
+ SDL_SetError("sem_wait() failed");
+ }
+ return retval;
+}
+
+int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
+{
+ int retval;
+
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+
+ /* Try the easy cases first */
+ if ( timeout == 0 ) {
+ return SDL_SemTryWait(sem);
+ }
+ if ( timeout == SDL_MUTEX_MAXWAIT ) {
+ return SDL_SemWait(sem);
+ }
+
+ /* Ack! We have to busy wait... */
+ timeout += SDL_GetTicks();
+ do {
+ retval = SDL_SemTryWait(sem);
+ if ( retval == 0 ) {
+ break;
+ }
+ SDL_Delay(1);
+ } while ( SDL_GetTicks() < timeout );
+
+ return retval;
+}
+
+Uint32 SDL_SemValue(SDL_sem *sem)
+{
+ int ret = 0;
+ if ( sem ) {
+ sem_getvalue(sem->sem, &ret);
+ if ( ret < 0 ) {
+ ret = 0;
+ }
+ }
+ return (Uint32)ret;
+}
+
+int SDL_SemPost(SDL_sem *sem)
+{
+ int retval;
+
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL semaphore");
+ return -1;
+ }
+
+ retval = sem_post(sem->sem);
+ if ( retval < 0 ) {
+ SDL_SetError("sem_post() failed");
+ }
+ return retval;
+}
+
+#endif /* !SDL_THREADS_DISABLED */
diff --git a/distrib/sdl-1.2.15/src/thread/riscos/SDL_systhread.c b/distrib/sdl-1.2.15/src/thread/riscos/SDL_systhread.c
new file mode 100644
index 0000000..38fc333
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/riscos/SDL_systhread.c
@@ -0,0 +1,144 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* RISC OS version based on pthreads linux source */
+
+#include "SDL_thread.h"
+#include "../SDL_systhread.h"
+
+#if SDL_THREADS_DISABLED
+
+int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
+{
+ SDL_SetError("Threads have not been compiled into this version of the library");
+ return(-1);
+}
+
+void SDL_SYS_SetupThread(void)
+{
+ return;
+}
+
+Uint32 SDL_ThreadID(void)
+{
+ return(0);
+}
+
+void SDL_SYS_WaitThread(SDL_Thread *thread)
+{
+ return;
+}
+
+void SDL_SYS_KillThread(SDL_Thread *thread)
+{
+ return;
+}
+
+#else
+
+#include <signal.h>
+
+/* List of signals to mask in the subthreads */
+static int sig_list[] = {
+ SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH,
+ SIGVTALRM, SIGPROF, 0
+};
+
+#include <pthread.h>
+
+int riscos_using_threads = 0;
+Uint32 riscos_main_thread = 0; /* Thread running events */
+
+static void *RunThread(void *data)
+{
+ SDL_RunThread(data);
+ pthread_exit((void*)0);
+ return((void *)0); /* Prevent compiler warning */
+}
+
+int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
+{
+ pthread_attr_t type;
+
+ /* Set the thread attributes */
+ if ( pthread_attr_init(&type) != 0 ) {
+ SDL_SetError("Couldn't initialize pthread attributes");
+ return(-1);
+ }
+ pthread_attr_setdetachstate(&type, PTHREAD_CREATE_JOINABLE);
+
+ /* Create the thread and go! */
+ if ( pthread_create(&thread->handle, &type, RunThread, args) != 0 ) {
+ SDL_SetError("Not enough resources to create thread");
+ return(-1);
+ }
+
+ if (riscos_using_threads == 0)
+ {
+ riscos_using_threads = 1;
+ riscos_main_thread = SDL_ThreadID();
+ }
+
+ return(0);
+}
+
+void SDL_SYS_SetupThread(void)
+{
+ int i;
+ sigset_t mask;
+
+ /* Mask asynchronous signals for this thread */
+ sigemptyset(&mask);
+ for ( i=0; sig_list[i]; ++i ) {
+ sigaddset(&mask, sig_list[i]);
+ }
+ pthread_sigmask(SIG_BLOCK, &mask, 0);
+
+#ifdef PTHREAD_CANCEL_ASYNCHRONOUS
+ /* Allow ourselves to be asynchronously cancelled */
+ { int oldstate;
+ pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldstate);
+ }
+#endif
+}
+
+Uint32 SDL_ThreadID(void)
+{
+ return((Uint32)pthread_self());
+}
+
+void SDL_SYS_WaitThread(SDL_Thread *thread)
+{
+ pthread_join(thread->handle, 0);
+}
+
+void SDL_SYS_KillThread(SDL_Thread *thread)
+{
+#ifdef PTHREAD_CANCEL_ASYNCHRONOUS
+ pthread_cancel(thread->handle);
+#else
+ pthread_kill(thread->handle, SIGKILL);
+#endif
+}
+
+#endif
diff --git a/distrib/sdl-1.2.15/src/thread/riscos/SDL_systhread_c.h b/distrib/sdl-1.2.15/src/thread/riscos/SDL_systhread_c.h
new file mode 100644
index 0000000..9e1d2c8
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/riscos/SDL_systhread_c.h
@@ -0,0 +1,34 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#if SDL_THREADS_DISABLED
+
+typedef int SYS_ThreadHandle;
+
+#else
+
+#include <pthread.h>
+
+typedef pthread_t SYS_ThreadHandle;
+
+#endif
diff --git a/distrib/sdl-1.2.15/src/thread/symbian/SDL_sysmutex.cpp b/distrib/sdl-1.2.15/src/thread/symbian/SDL_sysmutex.cpp
new file mode 100644
index 0000000..f4b1aea
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/symbian/SDL_sysmutex.cpp
@@ -0,0 +1,130 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@devolution.com
+*/
+
+/*
+ SDL_sysmutex.cpp
+
+ Epoc version by Markus Mertama (w@iki.fi)
+*/
+
+
+#ifdef SAVE_RCSID
+static char rcsid =
+ "@(#) $Id: SDL_sysmutex.c,v 1.1.2.3 2000/06/22 15:25:23 hercules Exp $";
+#endif
+
+/* Mutex functions using the Win32 API */
+
+//#include <stdio.h>
+//#include <stdlib.h>
+
+#include <e32std.h>
+
+#include "epoc_sdl.h"
+
+#include "SDL_error.h"
+#include "SDL_mutex.h"
+
+
+#ifdef EKA2 //???
+struct SDL_mutex
+ {
+ TInt handle;
+ };
+#else
+struct _SDL_mutex
+ {
+ TInt handle;
+ };
+#endif
+
+extern TInt CreateUnique(TInt (*aFunc)(const TDesC& aName, TAny*, TAny*), TAny*, TAny*);
+
+TInt NewMutex(const TDesC& aName, TAny* aPtr1, TAny*)
+ {
+ return ((RMutex*)aPtr1)->CreateGlobal(aName);
+ }
+
+void DeleteMutex(TAny* aMutex)
+ {
+ SDL_DestroyMutex ((SDL_mutex*) aMutex);
+ }
+
+/* Create a mutex */
+SDL_mutex *SDL_CreateMutex(void)
+{
+ RMutex rmutex;
+
+ TInt status = CreateUnique(NewMutex, &rmutex, NULL);
+ if(status != KErrNone)
+ {
+ SDL_SetError("Couldn't create mutex");
+ }
+ SDL_mutex* mutex = new /*(ELeave)*/ SDL_mutex;
+ mutex->handle = rmutex.Handle();
+ EpocSdlEnv::AppendCleanupItem(TSdlCleanupItem(DeleteMutex, mutex));
+ return(mutex);
+}
+
+/* Free the mutex */
+void SDL_DestroyMutex(SDL_mutex *mutex)
+{
+ if ( mutex )
+ {
+ RMutex rmutex;
+ rmutex.SetHandle(mutex->handle);
+ if(rmutex.IsHeld())
+ {
+ rmutex.Signal();
+ }
+ rmutex.Close();
+ EpocSdlEnv::RemoveCleanupItem(mutex);
+ delete(mutex);
+ mutex = NULL;
+ }
+}
+
+/* Lock the mutex */
+int SDL_mutexP(SDL_mutex *mutex)
+{
+ if ( mutex == NULL ) {
+ SDL_SetError("Passed a NULL mutex");
+ return -1;
+ }
+ RMutex rmutex;
+ rmutex.SetHandle(mutex->handle);
+ rmutex.Wait();
+ return(0);
+}
+
+/* Unlock the mutex */
+int SDL_mutexV(SDL_mutex *mutex)
+{
+ if ( mutex == NULL ) {
+ SDL_SetError("Passed a NULL mutex");
+ return -1;
+ }
+ RMutex rmutex;
+ rmutex.SetHandle(mutex->handle);
+ rmutex.Signal();
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/src/thread/symbian/SDL_syssem.cpp b/distrib/sdl-1.2.15/src/thread/symbian/SDL_syssem.cpp
new file mode 100644
index 0000000..00f9901
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/symbian/SDL_syssem.cpp
@@ -0,0 +1,214 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@devolution.com
+*/
+
+/*
+ SDL_syssem.cpp
+
+ Epoc version by Markus Mertama (w@iki.fi)
+*/
+
+#ifdef SAVE_RCSID
+static char rcsid =
+ "@(#) $Id: SDL_syssem.c,v 1.1.2.4 2000/06/22 15:24:48 hercules Exp $";
+#endif
+
+/* Semaphore functions using the Win32 API */
+
+//#include <stdio.h>
+//#include <stdlib.h>
+#include <e32std.h>
+
+#include "SDL_error.h"
+#include "SDL_thread.h"
+
+
+#define SDL_MUTEX_TIMEOUT -2
+
+struct SDL_semaphore
+ {
+ TInt handle;
+ TInt count;
+ };
+
+
+extern TInt CreateUnique(TInt (*aFunc)(const TDesC& aName, TAny*, TAny*), TAny*, TAny*);
+#ifndef EKA2
+extern TInt NewThread(const TDesC& aName, TAny* aPtr1, TAny* aPtr2);
+#endif
+
+TInt NewSema(const TDesC& aName, TAny* aPtr1, TAny* aPtr2)
+ {
+ TInt value = *((TInt*) aPtr2);
+ return ((RSemaphore*)aPtr1)->CreateGlobal(aName, value);
+ }
+
+/* Create a semaphore */
+SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
+{
+ RSemaphore s;
+ TInt status = CreateUnique(NewSema, &s, &initial_value);
+ if(status != KErrNone)
+ {
+ SDL_SetError("Couldn't create semaphore");
+ }
+ SDL_semaphore* sem = new /*(ELeave)*/ SDL_semaphore;
+ sem->handle = s.Handle();
+ sem->count = initial_value;
+ return(sem);
+}
+
+/* Free the semaphore */
+void SDL_DestroySemaphore(SDL_sem *sem)
+{
+ if ( sem )
+ {
+ RSemaphore sema;
+ sema.SetHandle(sem->handle);
+ while(--sem->count)
+ sema.Signal();
+ sema.Close();
+ delete sem;
+ sem = NULL;
+ }
+}
+
+#ifndef EKA2
+
+ struct TInfo
+ {
+ TInfo(TInt aTime, TInt aHandle) :
+ iTime(aTime), iHandle(aHandle), iVal(0) {}
+ TInt iTime;
+ TInt iHandle;
+ TInt iVal;
+ };
+
+
+
+TBool ThreadRun(TAny* aInfo)
+ {
+ TInfo* info = STATIC_CAST(TInfo*, aInfo);
+ User::After(info->iTime);
+ RSemaphore sema;
+ sema.SetHandle(info->iHandle);
+ sema.Signal();
+ info->iVal = SDL_MUTEX_TIMEOUT;
+ return 0;
+ }
+
+#endif
+
+
+void _WaitAll(SDL_sem *sem)
+ {
+ //since SemTryWait may changed the counter.
+ //this may not be atomic, but hopes it works.
+ RSemaphore sema;
+ sema.SetHandle(sem->handle);
+ sema.Wait();
+ while(sem->count < 0)
+ {
+ sema.Wait();
+ }
+ }
+
+int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
+{
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL sem");
+ return -1;
+ }
+
+ if ( timeout == SDL_MUTEX_MAXWAIT )
+ {
+ _WaitAll(sem);
+ return SDL_MUTEX_MAXWAIT;
+ }
+
+#ifdef EKA2
+
+ RSemaphore sema;
+ sema.SetHandle(sem->handle);
+ if(KErrNone == sema.Wait(timeout))
+ return 0;
+ return -1;
+#else
+ RThread thread;
+
+ TInfo* info = new (ELeave)TInfo(timeout, sem->handle);
+
+ TInt status = CreateUnique(NewThread, &thread, info);
+
+ if(status != KErrNone)
+ return status;
+
+ thread.Resume();
+
+ _WaitAll(sem);
+
+ if(thread.ExitType() == EExitPending)
+ {
+ thread.Kill(SDL_MUTEX_TIMEOUT);
+ }
+
+ thread.Close();
+
+ return info->iVal;
+#endif
+}
+
+int SDL_SemTryWait(SDL_sem *sem)
+{
+ if(sem->count > 0)
+ {
+ sem->count--;
+ }
+ return SDL_MUTEX_TIMEOUT;
+}
+
+int SDL_SemWait(SDL_sem *sem)
+{
+ return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT);
+}
+
+/* Returns the current count of the semaphore */
+Uint32 SDL_SemValue(SDL_sem *sem)
+{
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL sem");
+ return 0;
+ }
+ return sem->count;
+}
+
+int SDL_SemPost(SDL_sem *sem)
+{
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL sem");
+ return -1;
+ }
+ sem->count++;
+ RSemaphore sema;
+ sema.SetHandle(sem->handle);
+ sema.Signal();
+ return 0;
+}
diff --git a/distrib/sdl-1.2.15/src/thread/symbian/SDL_systhread.cpp b/distrib/sdl-1.2.15/src/thread/symbian/SDL_systhread.cpp
new file mode 100644
index 0000000..5e7adc5
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/symbian/SDL_systhread.cpp
@@ -0,0 +1,146 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@devolution.com
+*/
+
+/*
+ SDL_systhread.cpp
+ Epoc thread management routines for SDL
+
+ Epoc version by Markus Mertama (w@iki.fi)
+*/
+
+#include "epoc_sdl.h"
+
+//#include <stdlib.h>
+//#include <stdio.h>
+
+
+
+extern "C" {
+#undef NULL
+#include "SDL_error.h"
+#include "SDL_thread.h"
+#include "SDL_systhread.h"
+#include "SDL_thread_c.h"
+ }
+
+#include <e32std.h>
+#include "epoc_sdl.h"
+
+
+static int object_count;
+
+int RunThread(TAny* data)
+{
+ CTrapCleanup* cleanup = CTrapCleanup::New();
+ TRAPD(err, SDL_RunThread(data));
+ EpocSdlEnv::CleanupItems();
+ delete cleanup;
+ return(err);
+}
+
+
+TInt NewThread(const TDesC& aName, TAny* aPtr1, TAny* aPtr2)
+ {
+ return ((RThread*)(aPtr1))->Create(aName,
+ RunThread,
+ KDefaultStackSize,
+ NULL,
+ aPtr2);
+ }
+
+int CreateUnique(TInt (*aFunc)(const TDesC& aName, TAny*, TAny*), TAny* aPtr1, TAny* aPtr2)
+ {
+ TBuf<16> name;
+ TInt status = KErrNone;
+ do
+ {
+ object_count++;
+ name.Format(_L("SDL_%x"), object_count);
+ status = aFunc(name, aPtr1, aPtr2);
+ }
+ while(status == KErrAlreadyExists);
+ return status;
+ }
+
+
+int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
+{
+ RThread rthread;
+
+ const TInt status = CreateUnique(NewThread, &rthread, args);
+ if (status != KErrNone)
+ {
+ delete(((RThread*)(thread->handle)));
+ thread->handle = NULL;
+ SDL_SetError("Not enough resources to create thread");
+ return(-1);
+ }
+ rthread.Resume();
+ thread->handle = rthread.Handle();
+ return(0);
+}
+
+void SDL_SYS_SetupThread(void)
+{
+ return;
+}
+
+Uint32 SDL_ThreadID(void)
+{
+ RThread current;
+ const TThreadId id = current.Id();
+ return id;
+}
+
+void SDL_SYS_WaitThread(SDL_Thread *thread)
+{
+ SDL_TRACE1("Close thread", thread);
+ RThread t;
+ const TInt err = t.Open(thread->threadid);
+ if(err == KErrNone && t.ExitType() == EExitPending)
+ {
+ TRequestStatus status;
+ t.Logon(status);
+ User::WaitForRequest(status);
+ }
+ t.Close();
+
+ /* RUndertaker taker;
+ taker.Create();
+ TRequestStatus status;
+ taker.Logon(status, thread->handle);
+ User::WaitForRequest(status);
+ taker.Close();*/
+ SDL_TRACE1("Closed thread", thread);
+}
+
+/* WARNING: This function is really a last resort.
+ * Threads should be signaled and then exit by themselves.
+ * TerminateThread() doesn't perform stack and DLL cleanup.
+ */
+void SDL_SYS_KillThread(SDL_Thread *thread)
+{
+ RThread rthread;
+ rthread.SetHandle(thread->handle);
+ rthread.Kill(0);
+ rthread.Close();
+}
diff --git a/distrib/sdl-1.2.15/src/thread/symbian/SDL_systhread_c.h b/distrib/sdl-1.2.15/src/thread/symbian/SDL_systhread_c.h
new file mode 100644
index 0000000..f5f1729
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/symbian/SDL_systhread_c.h
@@ -0,0 +1,30 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@devolution.com
+*/
+
+/*
+ SDL_systhread_c.h
+
+ Epoc version by Markus Mertama (w@iki.fi)
+*/
+
+typedef int SYS_ThreadHandle;
+
diff --git a/distrib/sdl-1.2.15/src/thread/win32/SDL_sysmutex.c b/distrib/sdl-1.2.15/src/thread/win32/SDL_sysmutex.c
new file mode 100644
index 0000000..1d7805c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/win32/SDL_sysmutex.c
@@ -0,0 +1,95 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Mutex functions using the Win32 API */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include "SDL_mutex.h"
+
+
+struct SDL_mutex {
+ HANDLE id;
+};
+
+/* Create a mutex */
+SDL_mutex *SDL_CreateMutex(void)
+{
+ SDL_mutex *mutex;
+
+ /* Allocate mutex memory */
+ mutex = (SDL_mutex *)SDL_malloc(sizeof(*mutex));
+ if ( mutex ) {
+ /* Create the mutex, with initial value signaled */
+ mutex->id = CreateMutex(NULL, FALSE, NULL);
+ if ( ! mutex->id ) {
+ SDL_SetError("Couldn't create mutex");
+ SDL_free(mutex);
+ mutex = NULL;
+ }
+ } else {
+ SDL_OutOfMemory();
+ }
+ return(mutex);
+}
+
+/* Free the mutex */
+void SDL_DestroyMutex(SDL_mutex *mutex)
+{
+ if ( mutex ) {
+ if ( mutex->id ) {
+ CloseHandle(mutex->id);
+ mutex->id = 0;
+ }
+ SDL_free(mutex);
+ }
+}
+
+/* Lock the mutex */
+int SDL_mutexP(SDL_mutex *mutex)
+{
+ if ( mutex == NULL ) {
+ SDL_SetError("Passed a NULL mutex");
+ return -1;
+ }
+ if ( WaitForSingleObject(mutex->id, INFINITE) == WAIT_FAILED ) {
+ SDL_SetError("Couldn't wait on mutex");
+ return -1;
+ }
+ return(0);
+}
+
+/* Unlock the mutex */
+int SDL_mutexV(SDL_mutex *mutex)
+{
+ if ( mutex == NULL ) {
+ SDL_SetError("Passed a NULL mutex");
+ return -1;
+ }
+ if ( ReleaseMutex(mutex->id) == FALSE ) {
+ SDL_SetError("Couldn't release mutex");
+ return -1;
+ }
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/src/thread/win32/SDL_syssem.c b/distrib/sdl-1.2.15/src/thread/win32/SDL_syssem.c
new file mode 100644
index 0000000..261d24c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/win32/SDL_syssem.c
@@ -0,0 +1,164 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Semaphore functions using the Win32 API */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include "SDL_thread.h"
+#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
+#include "win_ce_semaphore.h"
+#endif
+
+
+struct SDL_semaphore {
+#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
+ SYNCHHANDLE id;
+#else
+ HANDLE id;
+#endif
+ volatile LONG count;
+};
+
+
+/* Create a semaphore */
+SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
+{
+ SDL_sem *sem;
+
+ /* Allocate sem memory */
+ sem = (SDL_sem *)SDL_malloc(sizeof(*sem));
+ if ( sem ) {
+ /* Create the semaphore, with max value 32K */
+#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
+ sem->id = CreateSemaphoreCE(NULL, initial_value, 32*1024, NULL);
+#else
+ sem->id = CreateSemaphore(NULL, initial_value, 32*1024, NULL);
+#endif
+ sem->count = (LONG) initial_value;
+ if ( ! sem->id ) {
+ SDL_SetError("Couldn't create semaphore");
+ SDL_free(sem);
+ sem = NULL;
+ }
+ } else {
+ SDL_OutOfMemory();
+ }
+ return(sem);
+}
+
+/* Free the semaphore */
+void SDL_DestroySemaphore(SDL_sem *sem)
+{
+ if ( sem ) {
+ if ( sem->id ) {
+#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
+ CloseSynchHandle(sem->id);
+#else
+ CloseHandle(sem->id);
+#endif
+ sem->id = 0;
+ }
+ SDL_free(sem);
+ }
+}
+
+int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
+{
+ int retval;
+ DWORD dwMilliseconds;
+
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL sem");
+ return -1;
+ }
+
+ if ( timeout == SDL_MUTEX_MAXWAIT ) {
+ dwMilliseconds = INFINITE;
+ } else {
+ dwMilliseconds = (DWORD)timeout;
+ }
+#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
+ switch (WaitForSemaphoreCE(sem->id, dwMilliseconds)) {
+#else
+ switch (WaitForSingleObject(sem->id, dwMilliseconds)) {
+#endif
+ case WAIT_OBJECT_0:
+ InterlockedDecrement(&sem->count);
+ retval = 0;
+ break;
+ case WAIT_TIMEOUT:
+ retval = SDL_MUTEX_TIMEDOUT;
+ break;
+ default:
+ SDL_SetError("WaitForSingleObject() failed");
+ retval = -1;
+ break;
+ }
+ return retval;
+}
+
+int SDL_SemTryWait(SDL_sem *sem)
+{
+ return SDL_SemWaitTimeout(sem, 0);
+}
+
+int SDL_SemWait(SDL_sem *sem)
+{
+ return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT);
+}
+
+/* Returns the current count of the semaphore */
+Uint32 SDL_SemValue(SDL_sem *sem)
+{
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL sem");
+ return 0;
+ }
+ return (Uint32) sem->count;
+}
+
+int SDL_SemPost(SDL_sem *sem)
+{
+ if ( ! sem ) {
+ SDL_SetError("Passed a NULL sem");
+ return -1;
+ }
+ /* Increase the counter in the first place, because
+ * after a successful release the semaphore may
+ * immediately get destroyed by another thread which
+ * is waiting for this semaphore.
+ */
+ InterlockedIncrement(&sem->count);
+#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
+ if ( ReleaseSemaphoreCE(sem->id, 1, NULL) == FALSE ) {
+#else
+ if ( ReleaseSemaphore(sem->id, 1, NULL) == FALSE ) {
+#endif
+ InterlockedDecrement(&sem->count); /* restore */
+ SDL_SetError("ReleaseSemaphore() failed");
+ return -1;
+ }
+ return 0;
+}
diff --git a/distrib/sdl-1.2.15/src/thread/win32/SDL_systhread.c b/distrib/sdl-1.2.15/src/thread/win32/SDL_systhread.c
new file mode 100644
index 0000000..55cb88a
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/win32/SDL_systhread.c
@@ -0,0 +1,162 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Win32 thread management routines for SDL */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include "SDL_thread.h"
+#include "../SDL_thread_c.h"
+#include "../SDL_systhread.h"
+
+#ifndef SDL_PASSED_BEGINTHREAD_ENDTHREAD
+#ifndef _WIN32_WCE
+/* We'll use the C library from this DLL */
+#include <process.h>
+#endif
+
+#if defined(__WATCOMC__)
+/* This is for Watcom targets except OS2 */
+#if __WATCOMC__ < 1240
+#define __watcall
+#endif
+typedef unsigned long (__watcall *pfnSDL_CurrentBeginThread) (void *, unsigned,
+ unsigned (__stdcall *func)(void *), void *arg,
+ unsigned, unsigned *threadID);
+typedef void (__watcall *pfnSDL_CurrentEndThread)(unsigned code);
+#elif (defined(__MINGW32__) && (__GNUC__ < 4))
+typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
+ unsigned (__stdcall *func)(void *), void *arg,
+ unsigned, unsigned *threadID);
+typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
+#else
+typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
+ unsigned (__stdcall *func)(void *), void *arg,
+ unsigned, unsigned *threadID);
+typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
+#endif
+#endif /* !SDL_PASSED_BEGINTHREAD_ENDTHREAD */
+
+
+typedef struct ThreadStartParms
+{
+ void *args;
+ pfnSDL_CurrentEndThread pfnCurrentEndThread;
+} tThreadStartParms, *pThreadStartParms;
+
+static DWORD RunThread(void *data)
+{
+ pThreadStartParms pThreadParms = (pThreadStartParms)data;
+ pfnSDL_CurrentEndThread pfnCurrentEndThread = NULL;
+
+ // Call the thread function!
+ SDL_RunThread(pThreadParms->args);
+
+ // Get the current endthread we have to use!
+ if (pThreadParms)
+ {
+ pfnCurrentEndThread = pThreadParms->pfnCurrentEndThread;
+ SDL_free(pThreadParms);
+ }
+ // Call endthread!
+ if (pfnCurrentEndThread)
+ (*pfnCurrentEndThread)(0);
+ return(0);
+}
+
+static DWORD WINAPI RunThreadViaCreateThread(LPVOID data)
+{
+ return RunThread(data);
+}
+
+static unsigned __stdcall RunThreadViaBeginThreadEx(void *data)
+{
+ return (unsigned) RunThread(data);
+}
+
+#ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD
+int SDL_SYS_CreateThread(SDL_Thread *thread, void *args, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread)
+{
+#else
+int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
+{
+#ifdef _WIN32_WCE
+ pfnSDL_CurrentBeginThread pfnBeginThread = NULL;
+ pfnSDL_CurrentEndThread pfnEndThread = NULL;
+#else
+ pfnSDL_CurrentBeginThread pfnBeginThread = _beginthreadex;
+ pfnSDL_CurrentEndThread pfnEndThread = _endthreadex;
+#endif
+#endif /* SDL_PASSED_BEGINTHREAD_ENDTHREAD */
+ pThreadStartParms pThreadParms = (pThreadStartParms)SDL_malloc(sizeof(tThreadStartParms));
+ if (!pThreadParms) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+
+ // Save the function which we will have to call to clear the RTL of calling app!
+ pThreadParms->pfnCurrentEndThread = pfnEndThread;
+ // Also save the real parameters we have to pass to thread function
+ pThreadParms->args = args;
+
+ if (pfnBeginThread) {
+ unsigned threadid = 0;
+ thread->handle = (SYS_ThreadHandle)
+ ((size_t) pfnBeginThread(NULL, 0, RunThreadViaBeginThreadEx,
+ pThreadParms, 0, &threadid));
+ } else {
+ DWORD threadid = 0;
+ thread->handle = CreateThread(NULL, 0, RunThreadViaCreateThread, pThreadParms, 0, &threadid);
+ }
+ if (thread->handle == NULL) {
+ SDL_SetError("Not enough resources to create thread");
+ return(-1);
+ }
+ return(0);
+}
+
+void SDL_SYS_SetupThread(void)
+{
+ return;
+}
+
+Uint32 SDL_ThreadID(void)
+{
+ return((Uint32)GetCurrentThreadId());
+}
+
+void SDL_SYS_WaitThread(SDL_Thread *thread)
+{
+ WaitForSingleObject(thread->handle, INFINITE);
+ CloseHandle(thread->handle);
+}
+
+/* WARNING: This function is really a last resort.
+ * Threads should be signaled and then exit by themselves.
+ * TerminateThread() doesn't perform stack and DLL cleanup.
+ */
+void SDL_SYS_KillThread(SDL_Thread *thread)
+{
+ TerminateThread(thread->handle, FALSE);
+}
diff --git a/distrib/sdl-1.2.15/src/thread/win32/SDL_systhread_c.h b/distrib/sdl-1.2.15/src/thread/win32/SDL_systhread_c.h
new file mode 100644
index 0000000..10b0a7d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/thread/win32/SDL_systhread_c.h
@@ -0,0 +1,28 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+typedef HANDLE SYS_ThreadHandle;
+
diff --git a/distrib/sdl-1.2.12/src/thread/win32/win_ce_semaphore.c b/distrib/sdl-1.2.15/src/thread/win32/win_ce_semaphore.c
index 9db45c4..9db45c4 100644
--- a/distrib/sdl-1.2.12/src/thread/win32/win_ce_semaphore.c
+++ b/distrib/sdl-1.2.15/src/thread/win32/win_ce_semaphore.c
diff --git a/distrib/sdl-1.2.12/src/thread/win32/win_ce_semaphore.h b/distrib/sdl-1.2.15/src/thread/win32/win_ce_semaphore.h
index af2d7b6..af2d7b6 100644
--- a/distrib/sdl-1.2.12/src/thread/win32/win_ce_semaphore.h
+++ b/distrib/sdl-1.2.15/src/thread/win32/win_ce_semaphore.h
diff --git a/distrib/sdl-1.2.15/src/timer/SDL_systimer.h b/distrib/sdl-1.2.15/src/timer/SDL_systimer.h
new file mode 100644
index 0000000..d19b679
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/timer/SDL_systimer.h
@@ -0,0 +1,40 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* The system dependent timer handling functions */
+
+#include "SDL_timer.h"
+#include "SDL_timer_c.h"
+
+
+/* Initialize the system dependent timer subsystem */
+extern int SDL_SYS_TimerInit(void);
+
+/* Quit the system dependent timer subsystem */
+extern void SDL_SYS_TimerQuit(void);
+
+/* Start a timer set up by SDL_SetTimer() */
+extern int SDL_SYS_StartTimer(void);
+
+/* Stop a previously started timer */
+extern void SDL_SYS_StopTimer(void);
diff --git a/distrib/sdl-1.2.15/src/timer/SDL_timer.c b/distrib/sdl-1.2.15/src/timer/SDL_timer.c
new file mode 100644
index 0000000..8d137e1
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/timer/SDL_timer.c
@@ -0,0 +1,285 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_timer.h"
+#include "SDL_timer_c.h"
+#include "SDL_mutex.h"
+#include "SDL_systimer.h"
+
+/* #define DEBUG_TIMERS */
+
+int SDL_timer_started = 0;
+int SDL_timer_running = 0;
+
+/* Data to handle a single periodic alarm */
+Uint32 SDL_alarm_interval = 0;
+SDL_TimerCallback SDL_alarm_callback;
+
+/* Data used for a thread-based timer */
+static int SDL_timer_threaded = 0;
+
+struct _SDL_TimerID {
+ Uint32 interval;
+ SDL_NewTimerCallback cb;
+ void *param;
+ Uint32 last_alarm;
+ struct _SDL_TimerID *next;
+};
+
+static SDL_TimerID SDL_timers = NULL;
+static SDL_mutex *SDL_timer_mutex;
+static volatile SDL_bool list_changed = SDL_FALSE;
+
+/* Set whether or not the timer should use a thread.
+ This should not be called while the timer subsystem is running.
+*/
+int SDL_SetTimerThreaded(int value)
+{
+ int retval;
+
+ if ( SDL_timer_started ) {
+ SDL_SetError("Timer already initialized");
+ retval = -1;
+ } else {
+ retval = 0;
+ SDL_timer_threaded = value;
+ }
+ return retval;
+}
+
+int SDL_TimerInit(void)
+{
+ int retval;
+
+ retval = 0;
+ if ( SDL_timer_started ) {
+ SDL_TimerQuit();
+ }
+ if ( ! SDL_timer_threaded ) {
+ retval = SDL_SYS_TimerInit();
+ }
+ if ( SDL_timer_threaded ) {
+ SDL_timer_mutex = SDL_CreateMutex();
+ }
+ if ( retval == 0 ) {
+ SDL_timer_started = 1;
+ }
+ return(retval);
+}
+
+void SDL_TimerQuit(void)
+{
+ SDL_SetTimer(0, NULL);
+ if ( SDL_timer_threaded < 2 ) {
+ SDL_SYS_TimerQuit();
+ }
+ if ( SDL_timer_threaded ) {
+ SDL_DestroyMutex(SDL_timer_mutex);
+ SDL_timer_mutex = NULL;
+ }
+ SDL_timer_started = 0;
+ SDL_timer_threaded = 0;
+}
+
+void SDL_ThreadedTimerCheck(void)
+{
+ Uint32 now, ms;
+ SDL_TimerID t, prev, next;
+ SDL_bool removed;
+
+ SDL_mutexP(SDL_timer_mutex);
+ list_changed = SDL_FALSE;
+ now = SDL_GetTicks();
+ for ( prev = NULL, t = SDL_timers; t; t = next ) {
+ removed = SDL_FALSE;
+ ms = t->interval - SDL_TIMESLICE;
+ next = t->next;
+ if ( (int)(now - t->last_alarm) > (int)ms ) {
+ struct _SDL_TimerID timer;
+
+ if ( (now - t->last_alarm) < t->interval ) {
+ t->last_alarm += t->interval;
+ } else {
+ t->last_alarm = now;
+ }
+#ifdef DEBUG_TIMERS
+ printf("Executing timer %p (thread = %d)\n",
+ t, SDL_ThreadID());
+#endif
+ timer = *t;
+ SDL_mutexV(SDL_timer_mutex);
+ ms = timer.cb(timer.interval, timer.param);
+ SDL_mutexP(SDL_timer_mutex);
+ if ( list_changed ) {
+ /* Abort, list of timers modified */
+ /* FIXME: what if ms was changed? */
+ break;
+ }
+ if ( ms != t->interval ) {
+ if ( ms ) {
+ t->interval = ROUND_RESOLUTION(ms);
+ } else {
+ /* Remove timer from the list */
+#ifdef DEBUG_TIMERS
+ printf("SDL: Removing timer %p\n", t);
+#endif
+ if ( prev ) {
+ prev->next = next;
+ } else {
+ SDL_timers = next;
+ }
+ SDL_free(t);
+ --SDL_timer_running;
+ removed = SDL_TRUE;
+ }
+ }
+ }
+ /* Don't update prev if the timer has disappeared */
+ if ( ! removed ) {
+ prev = t;
+ }
+ }
+ SDL_mutexV(SDL_timer_mutex);
+}
+
+static SDL_TimerID SDL_AddTimerInternal(Uint32 interval, SDL_NewTimerCallback callback, void *param)
+{
+ SDL_TimerID t;
+ t = (SDL_TimerID) SDL_malloc(sizeof(struct _SDL_TimerID));
+ if ( t ) {
+ t->interval = ROUND_RESOLUTION(interval);
+ t->cb = callback;
+ t->param = param;
+ t->last_alarm = SDL_GetTicks();
+ t->next = SDL_timers;
+ SDL_timers = t;
+ ++SDL_timer_running;
+ list_changed = SDL_TRUE;
+ }
+#ifdef DEBUG_TIMERS
+ printf("SDL_AddTimer(%d) = %08x num_timers = %d\n", interval, (Uint32)t, SDL_timer_running);
+#endif
+ return t;
+}
+
+SDL_TimerID SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param)
+{
+ SDL_TimerID t;
+ if ( ! SDL_timer_mutex ) {
+ if ( SDL_timer_started ) {
+ SDL_SetError("This platform doesn't support multiple timers");
+ } else {
+ SDL_SetError("You must call SDL_Init(SDL_INIT_TIMER) first");
+ }
+ return NULL;
+ }
+ if ( ! SDL_timer_threaded ) {
+ SDL_SetError("Multiple timers require threaded events!");
+ return NULL;
+ }
+ SDL_mutexP(SDL_timer_mutex);
+ t = SDL_AddTimerInternal(interval, callback, param);
+ SDL_mutexV(SDL_timer_mutex);
+ return t;
+}
+
+SDL_bool SDL_RemoveTimer(SDL_TimerID id)
+{
+ SDL_TimerID t, prev = NULL;
+ SDL_bool removed;
+
+ removed = SDL_FALSE;
+ SDL_mutexP(SDL_timer_mutex);
+ /* Look for id in the linked list of timers */
+ for (t = SDL_timers; t; prev=t, t = t->next ) {
+ if ( t == id ) {
+ if(prev) {
+ prev->next = t->next;
+ } else {
+ SDL_timers = t->next;
+ }
+ SDL_free(t);
+ --SDL_timer_running;
+ removed = SDL_TRUE;
+ list_changed = SDL_TRUE;
+ break;
+ }
+ }
+#ifdef DEBUG_TIMERS
+ printf("SDL_RemoveTimer(%08x) = %d num_timers = %d thread = %d\n", (Uint32)id, removed, SDL_timer_running, SDL_ThreadID());
+#endif
+ SDL_mutexV(SDL_timer_mutex);
+ return removed;
+}
+
+/* Old style callback functions are wrapped through this */
+static Uint32 SDLCALL callback_wrapper(Uint32 ms, void *param)
+{
+ SDL_TimerCallback func = (SDL_TimerCallback) param;
+ return (*func)(ms);
+}
+
+int SDL_SetTimer(Uint32 ms, SDL_TimerCallback callback)
+{
+ int retval;
+
+#ifdef DEBUG_TIMERS
+ printf("SDL_SetTimer(%d)\n", ms);
+#endif
+ retval = 0;
+
+ if ( SDL_timer_threaded ) {
+ SDL_mutexP(SDL_timer_mutex);
+ }
+ if ( SDL_timer_running ) { /* Stop any currently running timer */
+ if ( SDL_timer_threaded ) {
+ while ( SDL_timers ) {
+ SDL_TimerID freeme = SDL_timers;
+ SDL_timers = SDL_timers->next;
+ SDL_free(freeme);
+ }
+ SDL_timer_running = 0;
+ list_changed = SDL_TRUE;
+ } else {
+ SDL_SYS_StopTimer();
+ SDL_timer_running = 0;
+ }
+ }
+ if ( ms ) {
+ if ( SDL_timer_threaded ) {
+ if ( SDL_AddTimerInternal(ms, callback_wrapper, (void *)callback) == NULL ) {
+ retval = -1;
+ }
+ } else {
+ SDL_timer_running = 1;
+ SDL_alarm_interval = ms;
+ SDL_alarm_callback = callback;
+ retval = SDL_SYS_StartTimer();
+ }
+ }
+ if ( SDL_timer_threaded ) {
+ SDL_mutexV(SDL_timer_mutex);
+ }
+
+ return retval;
+}
diff --git a/distrib/sdl-1.2.15/src/timer/SDL_timer_c.h b/distrib/sdl-1.2.15/src/timer/SDL_timer_c.h
new file mode 100644
index 0000000..9618108
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/timer/SDL_timer_c.h
@@ -0,0 +1,46 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Useful functions and variables from SDL_timer.c */
+#include "SDL_timer.h"
+
+#define ROUND_RESOLUTION(X) \
+ (((X+TIMER_RESOLUTION-1)/TIMER_RESOLUTION)*TIMER_RESOLUTION)
+
+extern int SDL_timer_started;
+extern int SDL_timer_running;
+
+/* Data to handle a single periodic alarm */
+extern Uint32 SDL_alarm_interval;
+extern SDL_TimerCallback SDL_alarm_callback;
+
+/* Set whether or not the timer should use a thread.
+ This should be called while the timer subsystem is running.
+*/
+extern int SDL_SetTimerThreaded(int value);
+
+extern int SDL_TimerInit(void);
+extern void SDL_TimerQuit(void);
+
+/* This function is called from the SDL event thread if it is available */
+extern void SDL_ThreadedTimerCheck(void);
diff --git a/distrib/sdl-1.2.15/src/timer/beos/SDL_systimer.c b/distrib/sdl-1.2.15/src/timer/beos/SDL_systimer.c
new file mode 100644
index 0000000..f4cf6c7
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/timer/beos/SDL_systimer.c
@@ -0,0 +1,95 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_TIMER_BEOS
+
+#include <be/kernel/OS.h>
+
+#include "SDL_thread.h"
+#include "SDL_timer.h"
+#include "../SDL_timer_c.h"
+
+static bigtime_t start;
+
+void SDL_StartTicks(void)
+{
+ /* Set first ticks value */
+ start = system_time();
+}
+
+Uint32 SDL_GetTicks(void)
+{
+ return((system_time()-start)/1000);
+}
+
+void SDL_Delay(Uint32 ms)
+{
+ snooze(ms*1000);
+}
+
+/* Data to handle a single periodic alarm */
+static int timer_alive = 0;
+static SDL_Thread *timer = NULL;
+
+static int RunTimer(void *unused)
+{
+ while ( timer_alive ) {
+ if ( SDL_timer_running ) {
+ SDL_ThreadedTimerCheck();
+ }
+ SDL_Delay(10);
+ }
+ return(0);
+}
+
+/* This is only called if the event thread is not running */
+int SDL_SYS_TimerInit(void)
+{
+ timer_alive = 1;
+ timer = SDL_CreateThread(RunTimer, NULL);
+ if ( timer == NULL )
+ return(-1);
+ return(SDL_SetTimerThreaded(1));
+}
+
+void SDL_SYS_TimerQuit(void)
+{
+ timer_alive = 0;
+ if ( timer ) {
+ SDL_WaitThread(timer, NULL);
+ timer = NULL;
+ }
+}
+
+int SDL_SYS_StartTimer(void)
+{
+ SDL_SetError("Internal logic error: BeOS uses threaded timer");
+ return(-1);
+}
+
+void SDL_SYS_StopTimer(void)
+{
+ return;
+}
+
+#endif /* SDL_TIMER_BEOS */
diff --git a/distrib/sdl-1.2.15/src/timer/dc/SDL_systimer.c b/distrib/sdl-1.2.15/src/timer/dc/SDL_systimer.c
new file mode 100644
index 0000000..386e158
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/timer/dc/SDL_systimer.c
@@ -0,0 +1,100 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_TIMER_DC
+
+#include <kos.h>
+
+#include "SDL_thread.h"
+#include "SDL_timer.h"
+#include "../SDL_timer_c.h"
+
+static unsigned start;
+
+/*
+ jif = ms * HZ /1000
+ ms = jif * 1000/HZ
+*/
+
+void SDL_StartTicks(void)
+{
+ /* Set first ticks value */
+ start = jiffies;
+}
+
+Uint32 SDL_GetTicks(void)
+{
+ return((jiffies-start)*1000/HZ);
+}
+
+void SDL_Delay(Uint32 ms)
+{
+ thd_sleep(ms);
+}
+
+/* Data to handle a single periodic alarm */
+static int timer_alive = 0;
+static SDL_Thread *timer = NULL;
+
+static int RunTimer(void *unused)
+{
+ while ( timer_alive ) {
+ if ( SDL_timer_running ) {
+ SDL_ThreadedTimerCheck();
+ }
+ SDL_Delay(10);
+ }
+ return(0);
+}
+
+/* This is only called if the event thread is not running */
+int SDL_SYS_TimerInit(void)
+{
+ timer_alive = 1;
+ timer = SDL_CreateThread(RunTimer, NULL);
+ if ( timer == NULL )
+ return(-1);
+ return(SDL_SetTimerThreaded(1));
+}
+
+void SDL_SYS_TimerQuit(void)
+{
+ timer_alive = 0;
+ if ( timer ) {
+ SDL_WaitThread(timer, NULL);
+ timer = NULL;
+ }
+}
+
+int SDL_SYS_StartTimer(void)
+{
+ SDL_SetError("Internal logic error: DC uses threaded timer");
+ return(-1);
+}
+
+void SDL_SYS_StopTimer(void)
+{
+ return;
+}
+
+#endif /* SDL_TIMER_DC */
diff --git a/distrib/sdl-1.2.15/src/timer/dummy/SDL_systimer.c b/distrib/sdl-1.2.15/src/timer/dummy/SDL_systimer.c
new file mode 100644
index 0000000..cc266bc
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/timer/dummy/SDL_systimer.c
@@ -0,0 +1,91 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#if defined(SDL_TIMER_DUMMY) || defined(SDL_TIMERS_DISABLED)
+
+#include "SDL_timer.h"
+#include "../SDL_timer_c.h"
+
+void SDL_StartTicks(void)
+{
+}
+
+Uint32 SDL_GetTicks (void)
+{
+ SDL_Unsupported();
+ return 0;
+}
+
+void SDL_Delay (Uint32 ms)
+{
+ SDL_Unsupported();
+}
+
+#include "SDL_thread.h"
+
+/* Data to handle a single periodic alarm */
+static int timer_alive = 0;
+static SDL_Thread *timer = NULL;
+
+static int RunTimer(void *unused)
+{
+ while ( timer_alive ) {
+ if ( SDL_timer_running ) {
+ SDL_ThreadedTimerCheck();
+ }
+ SDL_Delay(1);
+ }
+ return(0);
+}
+
+/* This is only called if the event thread is not running */
+int SDL_SYS_TimerInit(void)
+{
+ timer_alive = 1;
+ timer = SDL_CreateThread(RunTimer, NULL);
+ if ( timer == NULL )
+ return(-1);
+ return(SDL_SetTimerThreaded(1));
+}
+
+void SDL_SYS_TimerQuit(void)
+{
+ timer_alive = 0;
+ if ( timer ) {
+ SDL_WaitThread(timer, NULL);
+ timer = NULL;
+ }
+}
+
+int SDL_SYS_StartTimer(void)
+{
+ SDL_SetError("Internal logic error: threaded timer in use");
+ return(-1);
+}
+
+void SDL_SYS_StopTimer(void)
+{
+ return;
+}
+
+#endif /* SDL_TIMER_DUMMY || SDL_TIMERS_DISABLED */
diff --git a/distrib/sdl-1.2.15/src/timer/macos/FastTimes.c b/distrib/sdl-1.2.15/src/timer/macos/FastTimes.c
new file mode 100644
index 0000000..2da74b7
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/timer/macos/FastTimes.c
@@ -0,0 +1,352 @@
+/* File "FastTimes.c" - Original code by Matt Slot <fprefect@ambrosiasw.com> */
+/* Created 4/24/99 - This file is hereby placed in the public domain */
+/* Updated 5/21/99 - Calibrate to VIA, add TBR support, renamed functions */
+/* Updated 10/4/99 - Use AbsoluteToNanoseconds() in case Absolute = double */
+/* Updated 2/15/00 - Check for native Time Manager, no need to calibrate */
+/* Updated 2/19/00 - Fixed default value for gScale under native Time Mgr */
+/* Updated 3/21/00 - Fixed ns conversion, create 2 different scale factors */
+/* Updated 5/03/00 - Added copyright and placed into PD. No code changes */
+/* Updated 8/01/00 - Made "Carbon-compatible" by replacing LMGetTicks() */
+
+/* This file is Copyright (C) Matt Slot, 1999-2012. It is hereby placed into
+ the public domain. The author makes no warranty as to fitness or stability */
+
+#include <Gestalt.h>
+#include <LowMem.h>
+#include <CodeFragments.h>
+#include <DriverServices.h>
+#include <Timer.h>
+
+#include "FastTimes.h"
+
+#ifdef TARGET_CPU_PPC
+#undef GENERATINGPOWERPC /* stop whining */
+#define GENERATINGPOWERPC TARGET_CPU_PPC
+#endif
+
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+/*
+ On 680x0 machines, we just use Microseconds().
+
+ On PowerPC machines, we try several methods:
+ * DriverServicesLib is available on all PCI PowerMacs, and perhaps
+ some NuBus PowerMacs. If it is, we use UpTime() : Overhead = 2.1 µsec.
+ * The PowerPC 601 has a built-in "real time clock" RTC, and we fall
+ back to that, accessing it directly from asm. Overhead = 1.3 µsec.
+ * Later PowerPCs have an accurate "time base register" TBR, and we
+ fall back to that, access it from PowerPC asm. Overhead = 1.3 µsec.
+ * We can also try Microseconds() which is emulated : Overhead = 36 µsec.
+
+ On PowerPC machines, we avoid the following:
+ * OpenTransport is available on all PCI and some NuBus PowerMacs, but it
+ uses UpTime() if available and falls back to Microseconds() otherwise.
+ * InputSprocket is available on many PowerMacs, but again it uses
+ UpTime() if available and falls back to Microseconds() otherwise.
+
+ Another PowerPC note: certain configurations, especially 3rd party upgrade
+ cards, may return inaccurate timings for the CPU or memory bus -- causing
+ skew in various system routines (up to 20% drift!). The VIA chip is very
+ accurate, and it's the basis for the Time Manager and Microseconds().
+ Unfortunately, it's also very slow because the MacOS has to (a) switch to
+ 68K and (b) poll for a VIA event.
+
+ We compensate for the drift by calibrating a floating point scale factor
+ between our fast method and the accurate timer at startup, then convert
+ each sample quickly on the fly. I'd rather not have the initialization
+ overhead -- but it's simply necessary for accurate timing. You can drop
+ it down to 30 ticks if you prefer, but that's as low as I'd recommend.
+
+ Under MacOS 9, "new world" Macs (iMacs, B+W G3s and G+W G4s) have a native
+ Time Manager implementation: UpTime(), Microseconds(), and TickCount() are
+ all based on the same underlying counter. This makes it silly to calibrate
+ UpTime() against TickCount(). We now check for this feature using Gestalt(),
+ and skip the whole calibration step if possible.
+
+*/
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+
+#define RTCToNano(w) ((double) (w).hi * 1000000000.0 + (double) (w).lo)
+#define WideTo64bit(w) (*(UInt64 *) &(w))
+
+/* LMGetTicks() is not in Carbon and TickCount() has a fair bit of overhead,
+ so for speed we always read lowmem directly. This is a Mac OS X no-no, but
+ it always work on those systems that don't have a native Time Manager (ie,
+ anything before MacOS 9) -- regardless whether we are in Carbon or not! */
+#define MyLMGetTicks() (*(volatile UInt32 *) 0x16A)
+
+#if GENERATINGPOWERPC
+
+static asm UnsignedWide PollRTC(void);
+static asm UnsignedWide PollTBR(void);
+static Ptr FindFunctionInSharedLib(StringPtr libName, StringPtr funcName);
+
+static Boolean gInited = false;
+static Boolean gNative = false;
+static Boolean gUseRTC = false;
+static Boolean gUseTBR = false;
+static double gScaleUSec = 1.0 / 1000.0; /* 1 / ( nsec / usec) */
+static double gScaleMSec = 1.0 / 1000000.0; /* 1 / ( nsec / msec) */
+
+/* Functions loaded from DriverServicesLib */
+typedef AbsoluteTime (*UpTimeProcPtr)(void);
+typedef Nanoseconds (*A2NSProcPtr)(AbsoluteTime);
+static UpTimeProcPtr gUpTime = NULL;
+static A2NSProcPtr gA2NS = NULL;
+
+#endif /* GENERATINGPOWERPC */
+
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+
+void FastInitialize() {
+ SInt32 result;
+
+ if (!gInited) {
+
+#if GENERATINGPOWERPC
+
+ /* Initialize the feature flags */
+ gNative = gUseRTC = gUseTBR = false;
+
+ /* We use CFM to find and load needed symbols from shared libraries, so
+ the application doesn't have to weak-link them, for convenience. */
+ gUpTime = (UpTimeProcPtr) FindFunctionInSharedLib(
+ "\pDriverServicesLib", "\pUpTime");
+ if (gUpTime) gA2NS = (A2NSProcPtr) FindFunctionInSharedLib(
+ "\pDriverServicesLib", "\pAbsoluteToNanoseconds");
+ if (!gA2NS) gUpTime = nil; /* Pedantic but necessary */
+
+ if (gUpTime) {
+ /* If we loaded UpTime(), then we need to know if the system has
+ a native implementation of the Time Manager. If so, then it's
+ pointless to calculate a scale factor against the missing VIA */
+
+ /* gestaltNativeTimeMgr = 4 in some future version of the headers */
+ if (!Gestalt(gestaltTimeMgrVersion, &result) &&
+ (result > gestaltExtendedTimeMgr))
+ gNative = true;
+ }
+ else {
+ /* If no DriverServicesLib, use Gestalt() to get the processor type.
+ Only NuBus PowerMacs with old System Software won't have DSL, so
+ we know it should either be a 601 or 603. */
+
+ /* Use the processor gestalt to determine which register to use */
+ if (!Gestalt(gestaltNativeCPUtype, &result)) {
+ if (result == gestaltCPU601) gUseRTC = true;
+ else if (result > gestaltCPU601) gUseTBR = true;
+ }
+ }
+
+ /* Now calculate a scale factor to keep us accurate. */
+ if ((gUpTime && !gNative) || gUseRTC || gUseTBR) {
+ UInt64 tick, usec1, usec2;
+ UnsignedWide wide;
+
+ /* Wait for the beginning of the very next tick */
+ for(tick = MyLMGetTicks() + 1; tick > MyLMGetTicks(); );
+
+ /* Poll the selected timer and prepare it (since we have time) */
+ wide = (gUpTime) ? (*gA2NS)((*gUpTime)()) :
+ ((gUseRTC) ? PollRTC() : PollTBR());
+ usec1 = (gUseRTC) ? RTCToNano(wide) : WideTo64bit(wide);
+
+ /* Wait for the exact 60th tick to roll over */
+ while(tick + 60 > MyLMGetTicks());
+
+ /* Poll the selected timer again and prepare it */
+ wide = (gUpTime) ? (*gA2NS)((*gUpTime)()) :
+ ((gUseRTC) ? PollRTC() : PollTBR());
+ usec2 = (gUseRTC) ? RTCToNano(wide) : WideTo64bit(wide);
+
+ /* Calculate a scale value that will give microseconds per second.
+ Remember, there are actually 60.15 ticks in a second, not 60. */
+ gScaleUSec = (60.0 * 1000000.0) / ((usec2 - usec1) * 60.15);
+ gScaleMSec = gScaleUSec / 1000.0;
+ }
+
+#endif /* GENERATINGPOWERPC */
+
+ /* We've initialized our globals */
+ gInited = true;
+ }
+ }
+
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+
+UInt64 FastMicroseconds() {
+ UnsignedWide wide;
+ UInt64 usec;
+
+#if GENERATINGPOWERPC
+ /* Initialize globals the first time we are called */
+ if (!gInited) FastInitialize();
+
+ if (gNative) {
+ /* Use DriverServices if it's available -- it's fast and compatible */
+ wide = (*gA2NS)((*gUpTime)());
+ usec = (double) WideTo64bit(wide) * gScaleUSec + 0.5;
+ }
+ else if (gUpTime) {
+ /* Use DriverServices if it's available -- it's fast and compatible */
+ wide = (*gA2NS)((*gUpTime)());
+ usec = (double) WideTo64bit(wide) * gScaleUSec + 0.5;
+ }
+ else if (gUseTBR) {
+ /* On a recent PowerPC, we poll the TBR directly */
+ wide = PollTBR();
+ usec = (double) WideTo64bit(wide) * gScaleUSec + 0.5;
+ }
+ else if (gUseRTC) {
+ /* On a 601, we can poll the RTC instead */
+ wide = PollRTC();
+ usec = (double) RTCToNano(wide) * gScaleUSec + 0.5;
+ }
+ else
+#endif /* GENERATINGPOWERPC */
+ {
+ /* If all else fails, suffer the mixed mode overhead */
+ Microseconds(&wide);
+ usec = WideTo64bit(wide);
+ }
+
+ return(usec);
+ }
+
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+
+UInt64 FastMilliseconds() {
+ UnsignedWide wide;
+ UInt64 msec;
+
+#if GENERATINGPOWERPC
+ /* Initialize globals the first time we are called */
+ if (!gInited) FastInitialize();
+
+ if (gNative) {
+ /* Use DriverServices if it's available -- it's fast and compatible */
+ wide = (*gA2NS)((*gUpTime)());
+ msec = (double) WideTo64bit(wide) * gScaleMSec + 0.5;
+ }
+ else if (gUpTime) {
+ /* Use DriverServices if it's available -- it's fast and compatible */
+ wide = (*gA2NS)((*gUpTime)());
+ msec = (double) WideTo64bit(wide) * gScaleMSec + 0.5;
+ }
+ else if (gUseTBR) {
+ /* On a recent PowerPC, we poll the TBR directly */
+ wide = PollTBR();
+ msec = (double) WideTo64bit(wide) * gScaleMSec + 0.5;
+ }
+ else if (gUseRTC) {
+ /* On a 601, we can poll the RTC instead */
+ wide = PollRTC();
+ msec = (double) RTCToNano(wide) * gScaleMSec + 0.5;
+ }
+ else
+#endif /* GENERATINGPOWERPC */
+ {
+ /* If all else fails, suffer the mixed mode overhead */
+ Microseconds(&wide);
+ msec = ((double) WideTo64bit(wide) + 500.0) / 1000.0;
+ }
+
+ return(msec);
+ }
+
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+
+StringPtr FastMethod() {
+ StringPtr method = "\p<Unknown>";
+
+#if GENERATINGPOWERPC
+ /* Initialize globals the first time we are called */
+ if (!gInited) FastInitialize();
+
+ if (gNative) {
+ /* The Time Manager and UpTime() are entirely native on this machine */
+ method = "\pNative UpTime()";
+ }
+ else if (gUpTime) {
+ /* Use DriverServices if it's available -- it's fast and compatible */
+ method = "\pUpTime()";
+ }
+ else if (gUseTBR) {
+ /* On a recent PowerPC, we poll the TBR directly */
+ method = "\pPowerPC TBR";
+ }
+ else if (gUseRTC) {
+ /* On a 601, we can poll the RTC instead */
+ method = "\pPowerPC RTC";
+ }
+ else
+#endif /* GENERATINGPOWERPC */
+ {
+ /* If all else fails, suffer the mixed mode overhead */
+ method = "\pMicroseconds()";
+ }
+
+ return(method);
+ }
+
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+#pragma mark -
+
+#if GENERATINGPOWERPC
+asm static UnsignedWide PollRTC_() {
+entry PollRTC /* Avoid CodeWarrior glue */
+ machine 601
+@AGAIN:
+ mfrtcu r4 /* RTCU = SPR 4 */
+ mfrtcl r5 /* RTCL = SPR 5 */
+ mfrtcu r6
+ cmpw r4,r6
+ bne @AGAIN
+ stw r4,0(r3)
+ stw r5,4(r3)
+ blr
+ }
+
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+
+asm static UnsignedWide PollTBR_() {
+entry PollTBR /* Avoid CodeWarrior glue */
+ machine 604
+@AGAIN:
+ mftbu r4 /* TBRU = SPR 268 */
+ mftb r5 /* TBRL = SPR 269 */
+ mftbu r6
+ cmpw r4,r6
+ bne @AGAIN
+ stw r4,0(r3)
+ stw r5,4(r3)
+ blr
+ }
+
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+
+static Ptr FindFunctionInSharedLib(StringPtr libName, StringPtr funcName) {
+ OSErr error = noErr;
+ Str255 errorStr;
+ Ptr func = NULL;
+ Ptr entry = NULL;
+ CFragSymbolClass symClass;
+ CFragConnectionID connID;
+
+ /* Find CFM containers for the current archecture -- CFM-PPC or CFM-68K */
+ if (/* error = */ GetSharedLibrary(libName, kCompiledCFragArch,
+ kLoadCFrag, &connID, &entry, errorStr)) return(NULL);
+ if (/* error = */ FindSymbol(connID, funcName, &func, &symClass))
+ return(NULL);
+
+ return(func);
+ }
+#endif /* GENERATINGPOWERPC */
diff --git a/distrib/sdl-1.2.15/src/timer/macos/FastTimes.h b/distrib/sdl-1.2.15/src/timer/macos/FastTimes.h
new file mode 100644
index 0000000..d25744c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/timer/macos/FastTimes.h
@@ -0,0 +1,27 @@
+/* File "FastTimes.h" - Original code by Matt Slot <fprefect@ambrosiasw.com> */
+#include "SDL_config.h"
+/* Created 4/24/99 - This file is hereby placed in the public domain */
+/* Updated 5/21/99 - Calibrate to VIA, add TBR support, renamed functions */
+/* Updated 10/4/99 - Use AbsoluteToNanoseconds() in case Absolute = double */
+/* Updated 2/15/00 - Check for native Time Manager, no need to calibrate */
+/* Updated 3/21/00 - Fixed ns conversion, create 2 different scale factors */
+/* Updated 5/03/00 - Added copyright and placed into PD. No code changes */
+
+/* This file is Copyright (C) Matt Slot, 1999-2012. It is hereby placed into
+ the public domain. The author makes no warranty as to fitness or stability */
+
+#ifndef __FAST_TIMES_HEADER__
+#define __FAST_TIMES_HEADER__
+
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+
+extern void FastInitialize(void);
+extern UInt64 FastMicroseconds(void);
+extern UInt64 FastMilliseconds(void);
+extern StringPtr FastMethod(void);
+
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+/* **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** */
+
+#endif /* __FAST_TIMES_HEADER__ */
diff --git a/distrib/sdl-1.2.15/src/timer/macos/SDL_MPWtimer.c b/distrib/sdl-1.2.15/src/timer/macos/SDL_MPWtimer.c
new file mode 100644
index 0000000..114b6c7
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/timer/macos/SDL_MPWtimer.c
@@ -0,0 +1,152 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_TIMER_MACOS
+
+#include <Types.h>
+#include <Timer.h>
+#include <OSUtils.h>
+#include <Gestalt.h>
+#include <Processes.h>
+
+#include <LowMem.h>
+
+#include "SDL_timer.h"
+#include "../SDL_timer_c.h"
+
+#define MS_PER_TICK (1000/60) /* MacOS tick = 1/60 second */
+
+/* Note: This is only a step above the original 1/60s implementation.
+ * For a good implementation, see FastTimes.[ch], by Matt Slot.
+ */
+#define USE_MICROSECONDS
+#define WideTo64bit(w) (*(UInt64 *) &(w))
+
+UInt64 start;
+
+void SDL_StartTicks(void)
+{
+#ifdef USE_MICROSECONDS
+ UnsignedWide now;
+
+ Microseconds(&now);
+ start = WideTo64bit(now);
+#else
+ /* FIXME: Should we implement a wrapping algorithm, like Win32? */
+#endif
+}
+
+Uint32 SDL_GetTicks(void)
+{
+#ifdef USE_MICROSECONDS
+ UnsignedWide now;
+
+ Microseconds(&now);
+ return (Uint32)((WideTo64bit(now)-start)/1000);
+#else
+ return(LMGetTicks()*MS_PER_TICK);
+#endif
+}
+
+void SDL_Delay(Uint32 ms)
+{
+#ifdef USE_MICROSECONDS
+ Uint32 end_ms;
+
+ end_ms = SDL_GetTicks() + ms;
+ do {
+ /* FIXME: Yield CPU? */ ;
+ } while ( SDL_GetTicks() < end_ms );
+#else
+ UInt32 unused; /* MJS */
+ Delay(ms/MS_PER_TICK, &unused);
+#endif
+}
+
+
+/* Data to handle a single periodic alarm */
+typedef struct _ExtendedTimerRec
+{
+ TMTask tmTask;
+ ProcessSerialNumber taskPSN;
+} ExtendedTimerRec, *ExtendedTimerPtr;
+
+static ExtendedTimerRec gExtendedTimerRec;
+
+
+int SDL_SYS_TimerInit(void)
+{
+ /* We don't need a setup? */
+ return(0);
+}
+
+void SDL_SYS_TimerQuit(void)
+{
+ /* We don't need a cleanup? */
+ return;
+}
+
+/* Our Stub routine to set up and then call the real routine. */
+pascal void TimerCallbackProc(TMTaskPtr tmTaskPtr)
+{
+ Uint32 ms;
+
+ WakeUpProcess(&((ExtendedTimerPtr) tmTaskPtr)->taskPSN);
+
+ ms = SDL_alarm_callback(SDL_alarm_interval);
+ if ( ms ) {
+ SDL_alarm_interval = ROUND_RESOLUTION(ms);
+ PrimeTime((QElemPtr)&gExtendedTimerRec.tmTask,
+ SDL_alarm_interval);
+ } else {
+ SDL_alarm_interval = 0;
+ }
+}
+
+int SDL_SYS_StartTimer(void)
+{
+ /*
+ * Configure the global structure that stores the timing information.
+ */
+ gExtendedTimerRec.tmTask.qLink = NULL;
+ gExtendedTimerRec.tmTask.qType = 0;
+ gExtendedTimerRec.tmTask.tmAddr = NewTimerUPP(TimerCallbackProc);
+ gExtendedTimerRec.tmTask.tmCount = 0;
+ gExtendedTimerRec.tmTask.tmWakeUp = 0;
+ gExtendedTimerRec.tmTask.tmReserved = 0;
+ GetCurrentProcess(&gExtendedTimerRec.taskPSN);
+
+ /* Install the task record */
+ InsXTime((QElemPtr)&gExtendedTimerRec.tmTask);
+
+ /* Go! */
+ PrimeTime((QElemPtr)&gExtendedTimerRec.tmTask, SDL_alarm_interval);
+ return(0);
+}
+
+void SDL_SYS_StopTimer(void)
+{
+ RmvTime((QElemPtr)&gExtendedTimerRec.tmTask);
+}
+
+#endif /* SDL_TIMER_MACOS */
diff --git a/distrib/sdl-1.2.15/src/timer/macos/SDL_systimer.c b/distrib/sdl-1.2.15/src/timer/macos/SDL_systimer.c
new file mode 100644
index 0000000..7a8063e
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/timer/macos/SDL_systimer.c
@@ -0,0 +1,186 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_TIMER_MACOS
+
+#include <Types.h>
+#include <Timer.h>
+#include <OSUtils.h>
+#include <Gestalt.h>
+#include <Processes.h>
+
+#include <LowMem.h>
+
+#include "SDL_timer.h"
+#include "../SDL_timer_c.h"
+
+#include "FastTimes.h"
+
+#if TARGET_API_MAC_CARBON
+#define NewTimerProc NewTimerUPP
+#endif
+
+#define MS_PER_TICK (1000.0/60.0) /* MacOS tick = 1/60 second */
+
+
+#define kTwoPower32 (4294967296.0) /* 2^32 */
+
+static double start_tick;
+static int is_fast_inited = 0;
+
+void SDL_StartTicks(void)
+{
+ if ( ! is_fast_inited ) // important to check or FastTime may hang machine!
+ SDL_SYS_TimerInit();
+
+ start_tick = FastMicroseconds();
+}
+
+Uint32 SDL_GetTicks(void)
+{
+
+ if ( ! is_fast_inited )
+ SDL_SYS_TimerInit();
+
+ return FastMilliseconds();
+}
+
+void SDL_Delay(Uint32 ms)
+{
+ Uint32 stop, now;
+
+ stop = SDL_GetTicks() + ms;
+ do {
+ #if TARGET_API_MAC_CARBON
+ MPYield();
+ #else
+ SystemTask();
+ #endif
+
+ now = SDL_GetTicks();
+
+ } while ( stop > now );
+}
+
+/*
+void SDL_StartTicks(void)
+{
+ // FIXME: Should we implement a wrapping algorithm, like Win32?
+}
+
+Uint32 SDL_GetTicks(void)
+{
+ UnsignedWide ms;
+
+ Microseconds (&ms);
+
+ return ( ms.lo / 1000 );
+}
+
+void SDL_Delay(Uint32 ms)
+{
+
+ UnsignedWide microsecs;
+ UInt32 stop;
+
+ Microseconds (&microsecs);
+
+ stop = microsecs.lo + (ms * 1000);
+
+ while ( stop > microsecs.lo ) {
+
+ SystemTask ();
+
+ Microseconds (&microsecs);
+ }
+
+}*/
+
+/* Data to handle a single periodic alarm */
+typedef struct _ExtendedTimerRec
+{
+ TMTask tmTask;
+ ProcessSerialNumber taskPSN;
+} ExtendedTimerRec, *ExtendedTimerPtr;
+
+static ExtendedTimerRec gExtendedTimerRec;
+
+
+int SDL_SYS_TimerInit(void)
+{
+ FastInitialize ();
+ is_fast_inited = 1;
+
+ return(0);
+}
+
+void SDL_SYS_TimerQuit(void)
+{
+ /* We don't need a cleanup? */
+ return;
+}
+
+/* Our Stub routine to set up and then call the real routine. */
+pascal void TimerCallbackProc(TMTaskPtr tmTaskPtr)
+{
+ Uint32 ms;
+
+ WakeUpProcess(&((ExtendedTimerPtr) tmTaskPtr)->taskPSN);
+
+ ms = SDL_alarm_callback(SDL_alarm_interval);
+ if ( ms ) {
+ SDL_alarm_interval = ROUND_RESOLUTION(ms);
+ PrimeTime((QElemPtr)&gExtendedTimerRec.tmTask,
+ SDL_alarm_interval);
+ } else {
+ SDL_alarm_interval = 0;
+ }
+}
+
+int SDL_SYS_StartTimer(void)
+{
+ /*
+ * Configure the global structure that stores the timing information.
+ */
+ gExtendedTimerRec.tmTask.qLink = NULL;
+ gExtendedTimerRec.tmTask.qType = 0;
+ gExtendedTimerRec.tmTask.tmAddr = NewTimerProc(TimerCallbackProc);
+ gExtendedTimerRec.tmTask.tmCount = 0;
+ gExtendedTimerRec.tmTask.tmWakeUp = 0;
+ gExtendedTimerRec.tmTask.tmReserved = 0;
+ GetCurrentProcess(&gExtendedTimerRec.taskPSN);
+
+ /* Install the task record */
+ InsXTime((QElemPtr)&gExtendedTimerRec.tmTask);
+
+ /* Go! */
+ PrimeTime((QElemPtr)&gExtendedTimerRec.tmTask, SDL_alarm_interval);
+ return(0);
+}
+
+void SDL_SYS_StopTimer(void)
+{
+ RmvTime((QElemPtr)&gExtendedTimerRec.tmTask);
+}
+
+#endif /* SDL_TIMER_MACOS */
diff --git a/distrib/sdl-1.2.15/src/timer/mint/SDL_systimer.c b/distrib/sdl-1.2.15/src/timer/mint/SDL_systimer.c
new file mode 100644
index 0000000..01e7a41
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/timer/mint/SDL_systimer.c
@@ -0,0 +1,149 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_TIMER_MINT
+
+/*
+ * TOS/MiNT timer driver
+ * based on vbl vector
+ *
+ * Patrice Mandin
+ */
+
+#include <stdio.h>
+#include <sys/time.h>
+#include <signal.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+
+#include <mint/cookie.h>
+#include <mint/sysvars.h>
+#include <mint/osbind.h>
+#include <mint/mintbind.h>
+
+#include "SDL_timer.h"
+#include "../SDL_timer_c.h"
+#include "SDL_thread.h"
+
+#include "../../video/ataricommon/SDL_atarisuper.h"
+
+#include "SDL_vbltimer_s.h"
+
+/* from audio/mint */
+void SDL_MintAudio_CheckFpu(void);
+
+/* The first ticks value of the application */
+static Uint32 start;
+static SDL_bool read_hz200_from_vbl = SDL_FALSE;
+static int mint_present; /* can we use Syield() ? */
+
+void SDL_StartTicks(void)
+{
+ void *old_stack;
+ long dummy;
+
+ /* Set first ticks value */
+ old_stack = (void *)Super(0);
+ start = *((volatile long *)_hz_200);
+ SuperToUser(old_stack);
+
+ start *= 5; /* One _hz_200 tic is 5ms */
+
+ mint_present = (Getcookie(C_MiNT, &dummy) == C_FOUND);
+}
+
+Uint32 SDL_GetTicks (void)
+{
+ Uint32 now = start;
+
+ if (read_hz200_from_vbl) {
+ now = SDL_Atari_hz200;
+ } else {
+ void *old_stack = (void *)Super(0);
+ now = *((volatile long *)_hz_200);
+ SuperToUser(old_stack);
+ }
+
+ return((now*5)-start);
+}
+
+void SDL_Delay (Uint32 ms)
+{
+ Uint32 now;
+
+ now = SDL_GetTicks();
+ while ((SDL_GetTicks()-now)<ms){
+ if (mint_present) {
+ Syield();
+ }
+ }
+}
+
+/* Data to handle a single periodic alarm */
+static SDL_bool timer_installed=SDL_FALSE;
+
+/* This is only called if the event thread is not running */
+int SDL_SYS_TimerInit(void)
+{
+ void *old_stack;
+
+ SDL_MintAudio_CheckFpu();
+
+ /* Install RunTimer in vbl vector */
+ old_stack = (void *)Super(0);
+ timer_installed = !SDL_AtariVblInstall(SDL_ThreadedTimerCheck);
+ SuperToUser(old_stack);
+
+ if (!timer_installed) {
+ return(-1);
+ }
+
+ read_hz200_from_vbl = SDL_TRUE;
+ return(SDL_SetTimerThreaded(0));
+}
+
+void SDL_SYS_TimerQuit(void)
+{
+ /* Uninstall RunTimer vbl vector */
+ if (timer_installed) {
+ void *old_stack = (void *)Super(0);
+ SDL_AtariVblUninstall(SDL_ThreadedTimerCheck);
+ SuperToUser(old_stack);
+ timer_installed = SDL_FALSE;
+ }
+ read_hz200_from_vbl = SDL_FALSE;
+}
+
+int SDL_SYS_StartTimer(void)
+{
+ SDL_SetError("Internal logic error: MiNT uses vbl timer");
+ return(-1);
+}
+
+void SDL_SYS_StopTimer(void)
+{
+ return;
+}
+
+#endif /* SDL_TIMER_MINT */
diff --git a/distrib/sdl-1.2.15/src/timer/mint/SDL_vbltimer.S b/distrib/sdl-1.2.15/src/timer/mint/SDL_vbltimer.S
new file mode 100644
index 0000000..7837afc
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/timer/mint/SDL_vbltimer.S
@@ -0,0 +1,228 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/*
+ * VBL queue routine
+ *
+ * Patrice Mandin
+ */
+
+#define _vbl_queue 0x456
+#define _hz_200 0x4ba
+
+ .text
+
+ .globl _SDL_AtariVblInstall
+ .globl _SDL_AtariVblUninstall
+
+ .globl _SDL_MintAudio_hasfpu
+
+/*--- Save/restore FPU context ---*/
+
+#if defined(__mcoldfire__)
+
+#define SAVE_FPU_CONTEXT \
+ lea sp@(-216),sp; \
+ fsave sp@; \
+ fmovel fpiar,sp@-; \
+ lea sp@(-64),sp; \
+ fmovemd fp0-fp7,sp@
+
+#define RESTORE_FPU_CONTEXT \
+ fmovemd sp@,fp0-fp7; \
+ lea sp@(64),sp; \
+ fmovel sp@+,fpiar; \
+ frestore sp@; \
+ lea sp@(216),sp
+
+#else
+
+#define SAVE_FPU_CONTEXT \
+ .chip 68k/68881; \
+ fsave sp@-; \
+ fmoveml fpcr/fpsr/fpiar,sp@-; \
+ fmovemx fp0-fp7,sp@-; \
+ .chip 68k
+
+#define RESTORE_FPU_CONTEXT \
+ .chip 68k/68881; \
+ fmovemx sp@+,fp0-fp7; \
+ fmoveml sp@+,fpcr/fpsr/fpiar; \
+ frestore sp@+; \
+ .chip 68k
+
+#endif
+
+/*--- Vector installer ---*/
+
+_SDL_AtariVblInstall:
+#if defined(__mcoldfire__)
+ movel sp@(4),d0
+ movel d0,my_vector
+#else
+ movel sp@(4),my_vector
+#endif
+
+ lea _my_vbl,a0
+
+ clrw vbl_mutex
+#if defined(__mcoldfire__)
+ movel _hz_200.w,d0
+ movel d0, _SDL_Atari_hz200
+#else
+ movel _hz_200.w, _SDL_Atari_hz200
+#endif
+
+ /* Stop interrupts */
+
+ movew #0x2700,sr
+
+ /* Read vbl_queue pointer */
+ movel _vbl_queue.w,a1
+
+ /* Search a free place */
+ moveq #7,d0
+bcl_search_place:
+ movel (a1),d1
+ beqs place_found
+ addql #4,a1
+#if defined(__mcoldfire__)
+ subql #1,d0
+ bpls bcl_search_place
+#else
+ dbra d0,bcl_search_place
+#endif
+
+ /* Not found */
+ moveq #1,d0
+ bras exit_vbl_queue
+
+ /* Then install ourselves */
+place_found:
+ movel a0,(a1)
+ moveq #0,d0
+
+exit_vbl_queue:
+ /* Restart interrupts */
+ movew #0x2300,sr
+
+ rts
+
+/*--- Vector uninstaller ---*/
+
+_SDL_AtariVblUninstall:
+ movel sp@(4),d0
+ cmpl my_vector,d0
+ bnes badvector
+
+ movel #_my_vbl,d0
+
+ /* Stop interrupts */
+
+ movew #0x2700,sr
+
+ /* Read vbl_queue pointer */
+ movel _vbl_queue.w,a1
+
+ /* Search where we are */
+ moveq #7,d1
+bcl2_search_place:
+ cmpl (a1),d0
+ bnes next_place
+ clrl (a1)
+ moveq #0,d1
+next_place:
+ addql #4,a1
+#if defined(__mcoldfire__)
+ subql #1,d1
+ bpls bcl_search_place
+#else
+ dbra d1,bcl2_search_place
+#endif
+
+ /* Restart interrupts */
+ movew #0x2300,sr
+badvector:
+ rts
+
+/*--- Our vbl ---*/
+
+_my_vbl:
+#if defined(__mcoldfire__)
+ lea sp@(-60),sp
+ moveml d0-d7/a0-a6,sp@
+#else
+ moveml d0-d7/a0-a6,sp@-
+#endif
+
+ /* Update _hz_200 */
+#if defined(__mcoldfire__)
+ movel _hz_200.w,d0
+ movel d0, _SDL_Atari_hz200
+#else
+ movel _hz_200.w, _SDL_Atari_hz200
+#endif
+
+ /* Verify if this is not already running */
+
+ tstw vbl_mutex
+ bnes vbl_end
+#if defined(__mcoldfire__)
+ movew vbl_mutex,d0
+ notl d0
+ movew d0,vbl_mutex
+#else
+ notw vbl_mutex
+#endif
+
+ /* Save FPU if needed */
+ tstw _SDL_MintAudio_hasfpu
+ beqs SDL_AtariVbl_nofpu1
+ SAVE_FPU_CONTEXT
+SDL_AtariVbl_nofpu1:
+
+ movel my_vector,a0
+ jsr a0@
+
+ /* Restore FPU if needed */
+ tstw _SDL_MintAudio_hasfpu
+ beqs SDL_AtariVbl_Xbios_nofpu2
+ RESTORE_FPU_CONTEXT
+SDL_AtariVbl_Xbios_nofpu2:
+
+ clrw vbl_mutex
+vbl_end:
+#if defined(__mcoldfire__)
+ moveml sp@,d0-d7/a0-a6
+ lea sp@(60),sp
+#else
+ moveml sp@+,d0-d7/a0-a6
+#endif
+ rts
+
+ .data
+ .even
+ .comm _SDL_Atari_hz200,4*1
+ .even
+ .comm vbl_mutex,2*1
+ .even
+ .comm my_vector,4*1
diff --git a/distrib/sdl-1.2.15/src/timer/mint/SDL_vbltimer_s.h b/distrib/sdl-1.2.15/src/timer/mint/SDL_vbltimer_s.h
new file mode 100644
index 0000000..011c138
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/timer/mint/SDL_vbltimer_s.h
@@ -0,0 +1,35 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * TOS/MiNT timer driver
+ * based on vbl vector
+ *
+ * Patrice Mandin
+ */
+
+extern volatile long SDL_Atari_hz200;
+
+/* Functions prototypes */
+extern int SDL_AtariVblInstall(void *newvector);
+extern void SDL_AtariVblUninstall(void *newvector);
diff --git a/distrib/sdl-1.2.15/src/timer/nds/SDL_systimer.c b/distrib/sdl-1.2.15/src/timer/nds/SDL_systimer.c
new file mode 100644
index 0000000..bf54f42
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/timer/nds/SDL_systimer.c
@@ -0,0 +1,73 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_thread.h"
+#include "SDL_timer.h"
+#include "SDL_error.h"
+#include "../SDL_timer_c.h"
+
+#include <nds.h>
+
+#define timers2ms(tlow,thigh)(tlow | (thigh<<16)) >> 5
+
+
+void SDL_StartTicks(void)
+{
+ TIMER0_DATA=0;
+ TIMER1_DATA=0;
+ TIMER0_CR=TIMER_ENABLE|TIMER_DIV_1024;
+ TIMER1_CR=TIMER_ENABLE|TIMER_CASCADE;
+}
+
+Uint32 SDL_GetTicks(void)
+{
+ return timers2ms(TIMER0_DATA, TIMER1_DATA);
+}
+
+void SDL_Delay(Uint32 ms)
+{
+ Uint32 now;
+ now=timers2ms(TIMER0_DATA, TIMER1_DATA);
+ while((Uint32)timers2ms(TIMER0_DATA, TIMER1_DATA)<now+ms);
+
+}
+
+/* This is only called if the event thread is not running */
+int SDL_SYS_TimerInit(void)
+{
+ return 0;
+}
+
+void SDL_SYS_TimerQuit(void)
+{
+}
+
+int SDL_SYS_StartTimer(void)
+{
+ SDL_SetError("Timers not implemented on NDS");
+ return -1;
+}
+
+void SDL_SYS_StopTimer(void)
+{
+}
diff --git a/distrib/sdl-1.2.15/src/timer/os2/SDL_systimer.c b/distrib/sdl-1.2.15/src/timer/os2/SDL_systimer.c
new file mode 100644
index 0000000..c82d531
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/timer/os2/SDL_systimer.c
@@ -0,0 +1,227 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_TIMER_OS2
+
+#define INCL_DOSMISC
+#define INCL_DOSERRORS
+#define INCL_DOSSEMAPHORES
+#define INCL_DOSDATETIME
+#define INCL_DOSPROCESS
+#define INCL_DOSPROFILE
+#define INCL_DOSEXCEPTIONS
+#include <os2.h>
+
+#include "SDL_thread.h"
+#include "SDL_timer.h"
+#include "../SDL_timer_c.h"
+
+
+#define TIME_WRAP_VALUE (~(DWORD)0)
+
+/* The first high-resolution ticks value of the application */
+static long long hires_start_ticks;
+/* The number of ticks per second of the high-resolution performance counter */
+static ULONG hires_ticks_per_second;
+
+void SDL_StartTicks(void)
+{
+ DosTmrQueryFreq(&hires_ticks_per_second);
+ DosTmrQueryTime((PQWORD)&hires_start_ticks);
+}
+
+DECLSPEC Uint32 SDLCALL SDL_GetTicks(void)
+{
+ long long hires_now;
+ ULONG ticks = ticks;
+
+ DosTmrQueryTime((PQWORD)&hires_now);
+/*
+ hires_now -= hires_start_ticks;
+ hires_now *= 1000;
+ hires_now /= hires_ticks_per_second;
+*/
+ /* inline asm to avoid runtime inclusion */
+ _asm {
+ push edx
+ push eax
+ mov eax, dword ptr hires_now
+ mov edx, dword ptr hires_now+4
+ sub eax, dword ptr hires_start_ticks
+ sbb edx, dword ptr hires_start_ticks+4
+ mov ebx,1000
+ mov ecx,edx
+ mul ebx
+ push eax
+ push edx
+ mov eax,ecx
+ mul ebx
+ pop eax
+ add edx,eax
+ pop eax
+ mov ebx, dword ptr hires_ticks_per_second
+ div ebx
+ mov dword ptr ticks, eax
+ pop edx
+ pop eax
+ }
+
+ return ticks;
+
+}
+
+/* High resolution sleep, originally made by Ilya Zakharevich */
+DECLSPEC void SDLCALL SDL_Delay(Uint32 ms)
+{
+ /* This is similar to DosSleep(), but has 8ms granularity in time-critical
+ threads even on Warp3. */
+ HEV hevEvent1 = 0; /* Event semaphore handle */
+ HTIMER htimerEvent1 = 0; /* Timer handle */
+ APIRET rc = NO_ERROR; /* Return code */
+ int ret = 1;
+ ULONG priority = 0, nesting; /* Shut down the warnings */
+ PPIB pib;
+ PTIB tib;
+ char *e = NULL;
+ APIRET badrc;
+ int switch_priority = 50;
+
+ DosCreateEventSem(NULL, /* Unnamed */
+ &hevEvent1, /* Handle of semaphore returned */
+ DC_SEM_SHARED, /* Shared needed for DosAsyncTimer */
+ FALSE); /* Semaphore is in RESET state */
+
+ if (ms >= switch_priority)
+ switch_priority = 0;
+ if (switch_priority)
+ {
+ if (DosGetInfoBlocks(&tib, &pib)!=NO_ERROR)
+ switch_priority = 0;
+ else
+ {
+ /* In Warp3, to switch scheduling to 8ms step, one needs to do
+ DosAsyncTimer() in time-critical thread. On laters versions,
+ more and more cases of wait-for-something are covered.
+
+ It turns out that on Warp3fp42 it is the priority at the time
+ of DosAsyncTimer() which matters. Let's hope that this works
+ with later versions too... XXXX
+ */
+ priority = (tib->tib_ptib2->tib2_ulpri);
+ if ((priority & 0xFF00) == 0x0300) /* already time-critical */
+ switch_priority = 0;
+ /* Make us time-critical. Just modifying TIB is not enough... */
+ /* tib->tib_ptib2->tib2_ulpri = 0x0300;*/
+ /* We do not want to run at high priority if a signal causes us
+ to longjmp() out of this section... */
+ if (DosEnterMustComplete(&nesting))
+ switch_priority = 0;
+ else
+ DosSetPriority(PRTYS_THREAD, PRTYC_TIMECRITICAL, 0, 0);
+ }
+ }
+
+ if ((badrc = DosAsyncTimer(ms,
+ (HSEM) hevEvent1, /* Semaphore to post */
+ &htimerEvent1))) /* Timer handler (returned) */
+ e = "DosAsyncTimer";
+
+ if (switch_priority && tib->tib_ptib2->tib2_ulpri == 0x0300)
+ {
+ /* Nobody switched priority while we slept... Ignore errors... */
+ /* tib->tib_ptib2->tib2_ulpri = priority; */ /* Get back... */
+ if (!(rc = DosSetPriority(PRTYS_THREAD, (priority>>8) & 0xFF, 0, 0)))
+ rc = DosSetPriority(PRTYS_THREAD, 0, priority & 0xFF, 0);
+ }
+ if (switch_priority)
+ rc = DosExitMustComplete(&nesting); /* Ignore errors */
+
+ /* The actual blocking call is made with "normal" priority. This way we
+ should not bother with DosSleep(0) etc. to compensate for us interrupting
+ higher-priority threads. The goal is to prohibit the system spending too
+ much time halt()ing, not to run us "no matter what". */
+ if (!e) /* Wait for AsyncTimer event */
+ badrc = DosWaitEventSem(hevEvent1, SEM_INDEFINITE_WAIT);
+
+ if (e) ; /* Do nothing */
+ else if (badrc == ERROR_INTERRUPT)
+ ret = 0;
+ else if (badrc)
+ e = "DosWaitEventSem";
+ if ((rc = DosCloseEventSem(hevEvent1)) && !e) { /* Get rid of semaphore */
+ e = "DosCloseEventSem";
+ badrc = rc;
+ }
+ if (e)
+ {
+ SDL_SetError("[SDL_Delay] : Had error in %s(), rc is 0x%x\n", e, badrc);
+ }
+}
+
+/* Data to handle a single periodic alarm */
+static int timer_alive = 0;
+static SDL_Thread *timer = NULL;
+
+static int SDLCALL RunTimer(void *unused)
+{
+ DosSetPriority(PRTYS_THREAD, PRTYC_TIMECRITICAL, 0, 0);
+ while ( timer_alive ) {
+ if ( SDL_timer_running ) {
+ SDL_ThreadedTimerCheck();
+ }
+ SDL_Delay(10);
+ }
+ return(0);
+}
+
+/* This is only called if the event thread is not running */
+int SDL_SYS_TimerInit(void)
+{
+ timer_alive = 1;
+ timer = SDL_CreateThread(RunTimer, NULL);
+ if ( timer == NULL )
+ return(-1);
+ return(SDL_SetTimerThreaded(1));
+}
+
+void SDL_SYS_TimerQuit(void)
+{
+ timer_alive = 0;
+ if ( timer ) {
+ SDL_WaitThread(timer, NULL);
+ timer = NULL;
+ }
+}
+
+int SDL_SYS_StartTimer(void)
+{
+ SDL_SetError("Internal logic error: OS/2 uses threaded timer");
+ return(-1);
+}
+
+void SDL_SYS_StopTimer(void)
+{
+ return;
+}
+
+#endif /* SDL_TIMER_OS2 */
diff --git a/distrib/sdl-1.2.15/src/timer/riscos/SDL_systimer.c b/distrib/sdl-1.2.15/src/timer/riscos/SDL_systimer.c
new file mode 100644
index 0000000..25ba65f
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/timer/riscos/SDL_systimer.c
@@ -0,0 +1,233 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_TIMER_RISCOS
+
+#include <stdio.h>
+#include <time.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+
+#include "SDL_timer.h"
+#include "../SDL_timer_c.h"
+
+#if SDL_THREADS_DISABLED
+/* Timer SDL_arraysize(Timer ),start/reset time */
+static Uint32 timerStart;
+/* Timer running function */
+void RISCOS_CheckTimer();
+#else
+#include <pthread.h>
+extern Uint32 riscos_main_thread;
+extern int riscos_using_threads;
+extern Uint32 SDL_ThreadID();
+extern Uint32 SDL_EventThreadID(void);
+#endif
+
+
+extern void RISCOS_BackgroundTasks(void);
+
+/* The first ticks value of the application */
+clock_t start;
+
+void SDL_StartTicks(void)
+{
+ /* Set first ticks value */
+ start = clock();
+}
+
+Uint32 SDL_GetTicks (void)
+{
+ clock_t ticks;
+
+ ticks=clock()-start;
+
+
+#if CLOCKS_PER_SEC == 1000
+
+ return(ticks);
+
+#elif CLOCKS_PER_SEC == 100
+
+ return (ticks * 10);
+
+#else
+
+ return ticks*(1000/CLOCKS_PER_SEC);
+
+#endif
+
+}
+
+void SDL_Delay (Uint32 ms)
+{
+ Uint32 now,then,elapsed;
+#if !SDL_THREADS_DISABLED
+ int is_event_thread;
+ if (riscos_using_threads)
+ {
+ is_event_thread = 0;
+ if (SDL_EventThreadID())
+ {
+ if (SDL_EventThreadID() == SDL_ThreadID()) is_event_thread = 1;
+ } else if (SDL_ThreadID() == riscos_main_thread) is_event_thread = 1;
+ } else is_event_thread = 1;
+#endif
+
+ /*TODO: Next version of Unixlib may allow us to use usleep here */
+ /* for non event threads */
+
+ /* Set the timeout interval - Linux only needs to do this once */
+ then = SDL_GetTicks();
+
+ do {
+ /* Do background tasks required while sleeping as we are not multithreaded */
+#if SDL_THREADS_DISABLED
+ RISCOS_BackgroundTasks();
+#else
+ /* For threaded build only run background tasks in event thread */
+ if (is_event_thread) RISCOS_BackgroundTasks();
+#endif
+
+ /* Calculate the time interval left (in case of interrupt) */
+ now = SDL_GetTicks();
+ elapsed = (now-then);
+ then = now;
+ if ( elapsed >= ms ) {
+ break;
+ }
+ ms -= elapsed;
+#if !SDL_THREADS_DISABLED
+ /* Need to yield to let other threads have a go */
+ if (riscos_using_threads) pthread_yield();
+#endif
+
+ } while ( 1 );
+}
+
+#if SDL_THREADS_DISABLED
+
+/* Non-threaded version of timer */
+
+int SDL_SYS_TimerInit(void)
+{
+ return(0);
+}
+
+void SDL_SYS_TimerQuit(void)
+{
+ SDL_SetTimer(0, NULL);
+}
+
+int SDL_SYS_StartTimer(void)
+{
+ timerStart = SDL_GetTicks();
+
+ return(0);
+}
+
+void SDL_SYS_StopTimer(void)
+{
+ /* Don't need to do anything as we use SDL_timer_running
+ to detect if we need to check the timer */
+}
+
+
+void RISCOS_CheckTimer()
+{
+ if (SDL_timer_running && SDL_GetTicks() - timerStart >= SDL_alarm_interval)
+ {
+ Uint32 ms;
+
+ ms = SDL_alarm_callback(SDL_alarm_interval);
+ if ( ms != SDL_alarm_interval )
+ {
+ if ( ms )
+ {
+ SDL_alarm_interval = ROUND_RESOLUTION(ms);
+ } else
+ {
+ SDL_alarm_interval = 0;
+ SDL_timer_running = 0;
+ }
+ }
+ if (SDL_alarm_interval) timerStart = SDL_GetTicks();
+ }
+}
+
+#else
+
+/* Threaded version of timer - based on code for linux */
+
+#include "SDL_thread.h"
+
+/* Data to handle a single periodic alarm */
+static int timer_alive = 0;
+static SDL_Thread *timer = NULL;
+
+static int RunTimer(void *unused)
+{
+ while ( timer_alive ) {
+ if ( SDL_timer_running ) {
+ SDL_ThreadedTimerCheck();
+ }
+ SDL_Delay(1);
+ }
+ return(0);
+}
+
+/* This is only called if the event thread is not running */
+int SDL_SYS_TimerInit(void)
+{
+ timer_alive = 1;
+ timer = SDL_CreateThread(RunTimer, NULL);
+ if ( timer == NULL )
+ return(-1);
+ return(SDL_SetTimerThreaded(1));
+}
+
+void SDL_SYS_TimerQuit(void)
+{
+ timer_alive = 0;
+ if ( timer ) {
+ SDL_WaitThread(timer, NULL);
+ timer = NULL;
+ }
+}
+
+int SDL_SYS_StartTimer(void)
+{
+ SDL_SetError("Internal logic error: RISC OS uses threaded timer");
+ return(-1);
+}
+
+void SDL_SYS_StopTimer(void)
+{
+ return;
+}
+
+#endif /* SDL_THREADS_DISABLED */
+
+#endif /* SDL_TIMER_RISCOS */
diff --git a/distrib/sdl-1.2.15/src/timer/symbian/SDL_systimer.cpp b/distrib/sdl-1.2.15/src/timer/symbian/SDL_systimer.cpp
new file mode 100644
index 0000000..a5bb749
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/timer/symbian/SDL_systimer.cpp
@@ -0,0 +1,114 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@devolution.com
+*/
+
+/*
+ SDL_systimer.cpp
+
+ Epoc version by Hannu Viitala (hannu.j.viitala@mbnet.fi)
+ Markus Mertama
+*/
+
+#include <e32std.h>
+#include <e32hal.h>
+
+extern "C" {
+#include "SDL_error.h"
+#include "SDL_thread.h"
+#include "SDL_timer.h"
+#include "SDL_timer_c.h"
+
+static TUint start = 0;
+static TInt tickPeriodMilliSeconds;
+
+
+void SDL_StartTicks(void)
+ {
+ /* Set first ticks value */
+ start = User::TickCount();
+
+ TTimeIntervalMicroSeconds32 period;
+ TInt tmp = UserHal::TickPeriod(period);
+ tickPeriodMilliSeconds = period.Int() / 1000;
+ }
+
+Uint32 SDL_GetTicks(void)
+ {
+ TUint deltaTics = User::TickCount() - start;
+ return(deltaTics * tickPeriodMilliSeconds);
+ }
+
+void SDL_Delay(Uint32 ms)
+ {
+ User::After(TTimeIntervalMicroSeconds32(ms*1000));
+ }
+
+/* Data to handle a single periodic alarm */
+static int timer_alive = 0;
+static SDL_Thread *timer = NULL;
+
+static int RunTimer(void *unused)
+ {
+ while ( timer_alive )
+ {
+ if (SDL_timer_running)
+ {
+ SDL_ThreadedTimerCheck();
+ }
+ SDL_Delay(10);
+ }
+ return(0);
+ }
+
+/* This is only called if the event thread is not running */
+int SDL_SYS_TimerInit(void)
+ {
+ if(timer != NULL)
+ return (-1);
+ timer_alive = 1;
+ timer = SDL_CreateThread(RunTimer, NULL);
+ if ( timer == NULL )
+ return(-1);
+ return(SDL_SetTimerThreaded(1));
+ }
+
+void SDL_SYS_TimerQuit(void)
+ {
+ timer_alive = 0;
+ if ( timer )
+ {
+ SDL_WaitThread(timer, NULL);
+ timer = NULL;
+ }
+ }
+
+int SDL_SYS_StartTimer(void)
+ {
+ SDL_SetError("Internal logic error: Epoc uses threaded timer");
+ return(-1);
+ }
+
+void SDL_SYS_StopTimer(void)
+ {
+ return;
+ }
+
+} // extern "C"
diff --git a/distrib/sdl-1.2.15/src/timer/unix/SDL_systimer.c b/distrib/sdl-1.2.15/src/timer/unix/SDL_systimer.c
new file mode 100644
index 0000000..80b2228
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/timer/unix/SDL_systimer.c
@@ -0,0 +1,240 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_TIMER_UNIX
+
+#include <stdio.h>
+#include <sys/time.h>
+#include <signal.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+
+#include "SDL_timer.h"
+#include "../SDL_timer_c.h"
+
+/* The clock_gettime provides monotonous time, so we should use it if
+ it's available. The clock_gettime function is behind ifdef
+ for __USE_POSIX199309
+ Tommi Kyntola (tommi.kyntola@ray.fi) 27/09/2005
+*/
+#if HAVE_NANOSLEEP || HAVE_CLOCK_GETTIME
+#include <time.h>
+#endif
+
+#if SDL_THREAD_PTH
+#include <pth.h>
+#endif
+
+#if SDL_THREADS_DISABLED
+#define USE_ITIMER
+#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 */
+
+
+void SDL_StartTicks(void)
+{
+ /* Set first ticks value */
+#if HAVE_CLOCK_GETTIME
+ clock_gettime(CLOCK_MONOTONIC,&start);
+#else
+ gettimeofday(&start, NULL);
+#endif
+}
+
+Uint32 SDL_GetTicks (void)
+{
+#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);
+#endif
+}
+
+void SDL_Delay (Uint32 ms)
+{
+#if SDL_THREAD_PTH
+ pth_time_t tv;
+ tv.tv_sec = ms/1000;
+ tv.tv_usec = (ms%1000)*1000;
+ pth_nap(tv);
+#else
+ int was_error;
+
+#if HAVE_NANOSLEEP
+ struct timespec elapsed, tv;
+#else
+ struct timeval tv;
+ Uint32 then, now, elapsed;
+#endif
+
+ /* Set the timeout interval */
+#if HAVE_NANOSLEEP
+ elapsed.tv_sec = ms/1000;
+ elapsed.tv_nsec = (ms%1000)*1000000;
+#else
+ then = SDL_GetTicks();
+#endif
+ do {
+ errno = 0;
+
+#if HAVE_NANOSLEEP
+ tv.tv_sec = elapsed.tv_sec;
+ tv.tv_nsec = elapsed.tv_nsec;
+ was_error = nanosleep(&tv, &elapsed);
+#else
+ /* Calculate the time interval left (in case of interrupt) */
+ now = SDL_GetTicks();
+ elapsed = (now-then);
+ then = now;
+ if ( elapsed >= ms ) {
+ break;
+ }
+ ms -= elapsed;
+ tv.tv_sec = ms/1000;
+ tv.tv_usec = (ms%1000)*1000;
+
+ was_error = select(0, NULL, NULL, NULL, &tv);
+#endif /* HAVE_NANOSLEEP */
+ } while ( was_error && (errno == EINTR) );
+#endif /* SDL_THREAD_PTH */
+}
+
+#ifdef USE_ITIMER
+
+static void HandleAlarm(int sig)
+{
+ Uint32 ms;
+
+ if ( SDL_alarm_callback ) {
+ ms = (*SDL_alarm_callback)(SDL_alarm_interval);
+ if ( ms != SDL_alarm_interval ) {
+ SDL_SetTimer(ms, SDL_alarm_callback);
+ }
+ }
+}
+
+int SDL_SYS_TimerInit(void)
+{
+ struct sigaction action;
+
+ /* Set the alarm handler (Linux specific) */
+ SDL_memset(&action, 0, sizeof(action));
+ action.sa_handler = HandleAlarm;
+ action.sa_flags = SA_RESTART;
+ sigemptyset(&action.sa_mask);
+ sigaction(SIGALRM, &action, NULL);
+ return(0);
+}
+
+void SDL_SYS_TimerQuit(void)
+{
+ SDL_SetTimer(0, NULL);
+}
+
+int SDL_SYS_StartTimer(void)
+{
+ struct itimerval timer;
+
+ timer.it_value.tv_sec = (SDL_alarm_interval/1000);
+ timer.it_value.tv_usec = (SDL_alarm_interval%1000)*1000;
+ timer.it_interval.tv_sec = (SDL_alarm_interval/1000);
+ timer.it_interval.tv_usec = (SDL_alarm_interval%1000)*1000;
+ setitimer(ITIMER_REAL, &timer, NULL);
+ return(0);
+}
+
+void SDL_SYS_StopTimer(void)
+{
+ struct itimerval timer;
+
+ SDL_memset(&timer, 0, (sizeof timer));
+ setitimer(ITIMER_REAL, &timer, NULL);
+}
+
+#else /* USE_ITIMER */
+
+#include "SDL_thread.h"
+
+/* Data to handle a single periodic alarm */
+static int timer_alive = 0;
+static SDL_Thread *timer = NULL;
+
+static int RunTimer(void *unused)
+{
+ while ( timer_alive ) {
+ if ( SDL_timer_running ) {
+ SDL_ThreadedTimerCheck();
+ }
+ SDL_Delay(1);
+ }
+ return(0);
+}
+
+/* This is only called if the event thread is not running */
+int SDL_SYS_TimerInit(void)
+{
+ timer_alive = 1;
+ timer = SDL_CreateThread(RunTimer, NULL);
+ if ( timer == NULL )
+ return(-1);
+ return(SDL_SetTimerThreaded(1));
+}
+
+void SDL_SYS_TimerQuit(void)
+{
+ timer_alive = 0;
+ if ( timer ) {
+ SDL_WaitThread(timer, NULL);
+ timer = NULL;
+ }
+}
+
+int SDL_SYS_StartTimer(void)
+{
+ SDL_SetError("Internal logic error: Linux uses threaded timer");
+ return(-1);
+}
+
+void SDL_SYS_StopTimer(void)
+{
+ return;
+}
+
+#endif /* USE_ITIMER */
+
+#endif /* SDL_TIMER_UNIX */
diff --git a/distrib/sdl-1.2.15/src/timer/win32/SDL_systimer.c b/distrib/sdl-1.2.15/src/timer/win32/SDL_systimer.c
new file mode 100644
index 0000000..b025e2e
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/timer/win32/SDL_systimer.c
@@ -0,0 +1,160 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_TIMER_WIN32
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <mmsystem.h>
+
+#include "SDL_timer.h"
+#include "../SDL_timer_c.h"
+
+#ifdef _WIN32_WCE
+ #error This is WinCE. Please use src/timer/wince/SDL_systimer.c instead.
+#endif
+
+#define TIME_WRAP_VALUE (~(DWORD)0)
+
+/* The first (low-resolution) ticks value of the application */
+static DWORD start;
+
+#ifndef USE_GETTICKCOUNT
+/* Store if a high-resolution performance counter exists on the system */
+static BOOL hires_timer_available;
+/* The first high-resolution ticks value of the application */
+static LARGE_INTEGER hires_start_ticks;
+/* The number of ticks per second of the high-resolution performance counter */
+static LARGE_INTEGER hires_ticks_per_second;
+#endif
+
+void SDL_StartTicks(void)
+{
+ /* Set first ticks value */
+#ifdef USE_GETTICKCOUNT
+ start = GetTickCount();
+#else
+#if 0 /* Apparently there are problems with QPC on Win2K */
+ if (QueryPerformanceFrequency(&hires_ticks_per_second) == TRUE)
+ {
+ hires_timer_available = TRUE;
+ QueryPerformanceCounter(&hires_start_ticks);
+ }
+ else
+#endif
+ {
+ hires_timer_available = FALSE;
+ timeBeginPeriod(1); /* use 1 ms timer precision */
+ start = timeGetTime();
+ }
+#endif
+}
+
+Uint32 SDL_GetTicks(void)
+{
+ DWORD now, ticks;
+#ifndef USE_GETTICKCOUNT
+ LARGE_INTEGER hires_now;
+#endif
+
+#ifdef USE_GETTICKCOUNT
+ now = GetTickCount();
+#else
+ if (hires_timer_available)
+ {
+ QueryPerformanceCounter(&hires_now);
+
+ hires_now.QuadPart -= hires_start_ticks.QuadPart;
+ hires_now.QuadPart *= 1000;
+ hires_now.QuadPart /= hires_ticks_per_second.QuadPart;
+
+ return (DWORD)hires_now.QuadPart;
+ }
+ else
+ {
+ now = timeGetTime();
+ }
+#endif
+
+ if ( now < start ) {
+ ticks = (TIME_WRAP_VALUE-start) + now;
+ } else {
+ ticks = (now - start);
+ }
+ return(ticks);
+}
+
+void SDL_Delay(Uint32 ms)
+{
+ Sleep(ms);
+}
+
+/* Data to handle a single periodic alarm */
+static UINT timerID = 0;
+
+static void CALLBACK HandleAlarm(UINT uID, UINT uMsg, DWORD_PTR dwUser,
+ DWORD_PTR dw1, DWORD_PTR dw2)
+{
+ SDL_ThreadedTimerCheck();
+}
+
+
+int SDL_SYS_TimerInit(void)
+{
+ MMRESULT result;
+
+ /* Set timer resolution */
+ result = timeBeginPeriod(TIMER_RESOLUTION);
+ if ( result != TIMERR_NOERROR ) {
+ SDL_SetError("Warning: Can't set %d ms timer resolution",
+ TIMER_RESOLUTION);
+ }
+ /* Allow 10 ms of drift so we don't chew on CPU */
+ timerID = timeSetEvent(TIMER_RESOLUTION,1,HandleAlarm,0,TIME_PERIODIC);
+ if ( ! timerID ) {
+ SDL_SetError("timeSetEvent() failed");
+ return(-1);
+ }
+ return(SDL_SetTimerThreaded(1));
+}
+
+void SDL_SYS_TimerQuit(void)
+{
+ if ( timerID ) {
+ timeKillEvent(timerID);
+ }
+ timeEndPeriod(TIMER_RESOLUTION);
+}
+
+int SDL_SYS_StartTimer(void)
+{
+ SDL_SetError("Internal logic error: Win32 uses threaded timer");
+ return(-1);
+}
+
+void SDL_SYS_StopTimer(void)
+{
+ return;
+}
+
+#endif /* SDL_TIMER_WIN32 */
diff --git a/distrib/sdl-1.2.15/src/timer/wince/SDL_systimer.c b/distrib/sdl-1.2.15/src/timer/wince/SDL_systimer.c
new file mode 100644
index 0000000..2b018b0
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/timer/wince/SDL_systimer.c
@@ -0,0 +1,198 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifdef SDL_TIMER_WINCE
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <mmsystem.h>
+
+#include "SDL_thread.h"
+#include "SDL_timer.h"
+#include "../SDL_timer_c.h"
+
+static Uint64 start_date;
+static Uint64 start_ticks;
+
+static Uint64 wce_ticks(void)
+{
+ return((Uint64)GetTickCount());
+}
+
+static Uint64 wce_date(void)
+{
+ union
+ {
+ FILETIME ftime;
+ Uint64 itime;
+ } ftime;
+ SYSTEMTIME stime;
+
+ GetSystemTime(&stime);
+ SystemTimeToFileTime(&stime,&ftime.ftime);
+ ftime.itime/=10000; // Convert 100ns intervals to 1ms intervals
+ // Remove ms portion, which can't be relied on
+ ftime.itime -= (ftime.itime % 1000);
+ return(ftime.itime);
+}
+
+static Sint32 wce_rel_ticks(void)
+{
+ return((Sint32)(wce_ticks()-start_ticks));
+}
+
+static Sint32 wce_rel_date(void)
+{
+ return((Sint32)(wce_date()-start_date));
+}
+
+/* Return time in ms relative to when SDL was started */
+Uint32 SDL_GetTicks()
+{
+ Sint32 offset=wce_rel_date()-wce_rel_ticks();
+ if((offset < -1000) || (offset > 1000))
+ {
+// fprintf(stderr,"Time desync(%+d), resyncing\n",offset/1000);
+ start_ticks-=offset;
+ }
+
+ return((Uint32)wce_rel_ticks());
+}
+
+/* Give up approx. givem milliseconds to the OS. */
+void SDL_Delay(Uint32 ms)
+{
+ Sleep(ms);
+}
+
+/* Recard start-time of application for reference */
+void SDL_StartTicks(void)
+{
+ start_date=wce_date();
+ start_ticks=wce_ticks();
+}
+
+static UINT WIN_timer;
+
+#if ( _WIN32_WCE <= 420 )
+
+static HANDLE timersThread = 0;
+static HANDLE timersQuitEvent = 0;
+
+DWORD TimersThreadProc(void *data)
+{
+ while(WaitForSingleObject(timersQuitEvent, 10) == WAIT_TIMEOUT)
+ {
+ SDL_ThreadedTimerCheck();
+ }
+ return 0;
+}
+
+int SDL_SYS_TimerInit(void)
+{
+ // create a thread to process a threaded timers
+ // SetTimer does not suit the needs because
+ // TimerCallbackProc will be called only when WM_TIMER occured
+
+ timersQuitEvent = CreateEvent(0, TRUE, FALSE, 0);
+ if( !timersQuitEvent )
+ {
+ SDL_SetError("Cannot create event for timers thread");
+ return -1;
+ }
+ timersThread = CreateThread(NULL, 0, TimersThreadProc, 0, 0, 0);
+ if( !timersThread )
+ {
+ SDL_SetError("Cannot create timers thread, check amount of RAM available");
+ return -1;
+ }
+ SetThreadPriority(timersThread, THREAD_PRIORITY_HIGHEST);
+
+ return(SDL_SetTimerThreaded(1));
+}
+
+void SDL_SYS_TimerQuit(void)
+{
+ SetEvent(timersQuitEvent);
+ if( WaitForSingleObject(timersThread, 2000) == WAIT_TIMEOUT )
+ TerminateThread(timersThread, 0);
+ CloseHandle(timersThread);
+ CloseHandle(timersQuitEvent);
+ return;
+}
+
+#else
+
+#pragma comment(lib, "mmtimer.lib")
+
+/* Data to handle a single periodic alarm */
+static UINT timerID = 0;
+
+static void CALLBACK HandleAlarm(UINT uID, UINT uMsg, DWORD dwUser,
+ DWORD dw1, DWORD dw2)
+{
+ SDL_ThreadedTimerCheck();
+}
+
+
+int SDL_SYS_TimerInit(void)
+{
+ MMRESULT result;
+
+ /* Set timer resolution */
+ result = timeBeginPeriod(TIMER_RESOLUTION);
+ if ( result != TIMERR_NOERROR ) {
+ SDL_SetError("Warning: Can't set %d ms timer resolution",
+ TIMER_RESOLUTION);
+ }
+ /* Allow 10 ms of drift so we don't chew on CPU */
+ timerID = timeSetEvent(TIMER_RESOLUTION,1,HandleAlarm,0,TIME_PERIODIC);
+ if ( ! timerID ) {
+ SDL_SetError("timeSetEvent() failed");
+ return(-1);
+ }
+ return(SDL_SetTimerThreaded(1));
+}
+
+void SDL_SYS_TimerQuit(void)
+{
+ if ( timerID ) {
+ timeKillEvent(timerID);
+ }
+ timeEndPeriod(TIMER_RESOLUTION);
+}
+
+#endif
+
+int SDL_SYS_StartTimer(void)
+{
+ SDL_SetError("Internal logic error: WinCE uses threaded timer");
+ return(-1);
+}
+
+void SDL_SYS_StopTimer(void)
+{
+ return;
+}
+
+#endif /* SDL_TIMER_WINCE */
diff --git a/distrib/sdl-1.2.15/src/video/SDL_RLEaccel.c b/distrib/sdl-1.2.15/src/video/SDL_RLEaccel.c
new file mode 100644
index 0000000..d4b191c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_RLEaccel.c
@@ -0,0 +1,1941 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * RLE encoding for software colorkey and alpha-channel acceleration
+ *
+ * Original version by Sam Lantinga
+ *
+ * Mattias Engdegård (Yorick): Rewrite. New encoding format, encoder and
+ * decoder. Added per-surface alpha blitter. Added per-pixel alpha
+ * format, encoder and blitter.
+ *
+ * Many thanks to Xark and johns for hints, benchmarks and useful comments
+ * leading to this code.
+ *
+ * Welcome to Macro Mayhem.
+ */
+
+/*
+ * The encoding translates the image data to a stream of segments of the form
+ *
+ * <skip> <run> <data>
+ *
+ * where <skip> is the number of transparent pixels to skip,
+ * <run> is the number of opaque pixels to blit,
+ * and <data> are the pixels themselves.
+ *
+ * This basic structure is used both for colorkeyed surfaces, used for simple
+ * binary transparency and for per-surface alpha blending, and for surfaces
+ * with per-pixel alpha. The details differ, however:
+ *
+ * Encoding of colorkeyed surfaces:
+ *
+ * Encoded pixels always have the same format as the target surface.
+ * <skip> and <run> are unsigned 8 bit integers, except for 32 bit depth
+ * where they are 16 bit. This makes the pixel data aligned at all times.
+ * Segments never wrap around from one scan line to the next.
+ *
+ * The end of the sequence is marked by a zero <skip>,<run> pair at the *
+ * beginning of a line.
+ *
+ * Encoding of surfaces with per-pixel alpha:
+ *
+ * The sequence begins with a struct RLEDestFormat describing the target
+ * pixel format, to provide reliable un-encoding.
+ *
+ * Each scan line is encoded twice: First all completely opaque pixels,
+ * encoded in the target format as described above, and then all
+ * partially transparent (translucent) pixels (where 1 <= alpha <= 254),
+ * in the following 32-bit format:
+ *
+ * For 32-bit targets, each pixel has the target RGB format but with
+ * the alpha value occupying the highest 8 bits. The <skip> and <run>
+ * 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.
+ * i.e. if the target has the format rrrrrggggggbbbbb,
+ * the encoded pixel will be 00000gggggg00000rrrrr0aaaaabbbbb.
+ * The <skip> and <run> counts are 8 bit for the opaque lines, 16 bit
+ * for the translucent lines. Two padding bytes may be inserted
+ * before each translucent line to keep them 32-bit aligned.
+ *
+ * The end of the sequence is marked by a zero <skip>,<run> pair at the
+ * beginning of an opaque line.
+ */
+
+#include "SDL_video.h"
+#include "SDL_sysvideo.h"
+#include "SDL_blit.h"
+#include "SDL_RLEaccel_c.h"
+
+/* Force MMX to 0; this blows up on almost every major compiler now. --ryan. */
+#if 0 && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && SDL_ASSEMBLY_ROUTINES
+#define MMX_ASMBLIT
+#endif
+
+#ifdef MMX_ASMBLIT
+#include "mmx.h"
+#include "SDL_cpuinfo.h"
+#endif
+
+#ifndef MAX
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#endif
+#ifndef MIN
+#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)
+
+/*
+ * Various colorkey blit methods, for opaque and per-surface alpha
+ */
+
+#define OPAQUE_BLIT(to, from, length, bpp, alpha) \
+ PIXEL_COPY(to, from, length, bpp)
+
+#ifdef MMX_ASMBLIT
+
+#define ALPHA_BLIT32_888MMX(to, from, length, bpp, alpha) \
+ do { \
+ Uint32 *srcp = (Uint32 *)(from); \
+ Uint32 *dstp = (Uint32 *)(to); \
+ int i = 0x00FF00FF; \
+ movd_m2r(*(&i), mm3); \
+ punpckldq_r2r(mm3, mm3); \
+ i = 0xFF000000; \
+ movd_m2r(*(&i), mm7); \
+ punpckldq_r2r(mm7, mm7); \
+ i = alpha | alpha << 16; \
+ movd_m2r(*(&i), mm4); \
+ punpckldq_r2r(mm4, mm4); \
+ pcmpeqd_r2r(mm5,mm5); /* set mm5 to "1" */ \
+ pxor_r2r(mm7, mm5); /* make clear alpha mask */ \
+ i = length; \
+ if(i & 1) { \
+ movd_m2r((*srcp), mm1); /* src -> mm1 */ \
+ punpcklbw_r2r(mm1, mm1); \
+ pand_r2r(mm3, mm1); \
+ movd_m2r((*dstp), mm2); /* dst -> mm2 */ \
+ punpcklbw_r2r(mm2, mm2); \
+ pand_r2r(mm3, mm2); \
+ psubw_r2r(mm2, mm1); \
+ pmullw_r2r(mm4, mm1); \
+ psrlw_i2r(8, mm1); \
+ paddw_r2r(mm1, mm2); \
+ pand_r2r(mm3, mm2); \
+ packuswb_r2r(mm2, mm2); \
+ pand_r2r(mm5, mm2); /* 00000RGB -> mm2 */ \
+ movd_r2m(mm2, *dstp); \
+ ++srcp; \
+ ++dstp; \
+ i--; \
+ } \
+ for(; i > 0; --i) { \
+ movq_m2r((*srcp), mm0); \
+ movq_r2r(mm0, mm1); \
+ punpcklbw_r2r(mm0, mm0); \
+ movq_m2r((*dstp), mm2); \
+ punpckhbw_r2r(mm1, mm1); \
+ movq_r2r(mm2, mm6); \
+ pand_r2r(mm3, mm0); \
+ punpcklbw_r2r(mm2, mm2); \
+ pand_r2r(mm3, mm1); \
+ punpckhbw_r2r(mm6, mm6); \
+ pand_r2r(mm3, mm2); \
+ psubw_r2r(mm2, mm0); \
+ pmullw_r2r(mm4, mm0); \
+ pand_r2r(mm3, mm6); \
+ psubw_r2r(mm6, mm1); \
+ pmullw_r2r(mm4, mm1); \
+ psrlw_i2r(8, mm0); \
+ paddw_r2r(mm0, mm2); \
+ psrlw_i2r(8, mm1); \
+ paddw_r2r(mm1, mm6); \
+ pand_r2r(mm3, mm2); \
+ pand_r2r(mm3, mm6); \
+ packuswb_r2r(mm2, mm2); \
+ packuswb_r2r(mm6, mm6); \
+ psrlq_i2r(32, mm2); \
+ psllq_i2r(32, mm6); \
+ por_r2r(mm6, mm2); \
+ pand_r2r(mm5, mm2); /* 00000RGB -> mm2 */ \
+ movq_r2m(mm2, *dstp); \
+ srcp += 2; \
+ dstp += 2; \
+ i--; \
+ } \
+ emms(); \
+ } while(0)
+
+#define ALPHA_BLIT16_565MMX(to, from, length, bpp, alpha) \
+ do { \
+ int i, n = 0; \
+ Uint16 *srcp = (Uint16 *)(from); \
+ Uint16 *dstp = (Uint16 *)(to); \
+ Uint32 ALPHA = 0xF800; \
+ movd_m2r(*(&ALPHA), mm1); \
+ punpcklwd_r2r(mm1, mm1); \
+ punpcklwd_r2r(mm1, mm1); \
+ ALPHA = 0x07E0; \
+ movd_m2r(*(&ALPHA), mm4); \
+ punpcklwd_r2r(mm4, mm4); \
+ punpcklwd_r2r(mm4, mm4); \
+ ALPHA = 0x001F; \
+ movd_m2r(*(&ALPHA), mm7); \
+ punpcklwd_r2r(mm7, mm7); \
+ punpcklwd_r2r(mm7, mm7); \
+ alpha &= ~(1+2+4); \
+ i = (Uint32)alpha | (Uint32)alpha << 16; \
+ movd_m2r(*(&i), mm0); \
+ punpckldq_r2r(mm0, mm0); \
+ ALPHA = alpha >> 3; \
+ i = ((int)(length) & 3); \
+ for(; i > 0; --i) { \
+ Uint32 s = *srcp++; \
+ Uint32 d = *dstp; \
+ s = (s | s << 16) & 0x07e0f81f; \
+ d = (d | d << 16) & 0x07e0f81f; \
+ d += (s - d) * ALPHA >> 5; \
+ d &= 0x07e0f81f; \
+ *dstp++ = d | d >> 16; \
+ n++; \
+ } \
+ i = (int)(length) - n; \
+ for(; i > 0; --i) { \
+ movq_m2r((*dstp), mm3); \
+ movq_m2r((*srcp), mm2); \
+ movq_r2r(mm2, mm5); \
+ pand_r2r(mm1 , mm5); \
+ psrlq_i2r(11, mm5); \
+ movq_r2r(mm3, mm6); \
+ pand_r2r(mm1 , mm6); \
+ psrlq_i2r(11, mm6); \
+ psubw_r2r(mm6, mm5); \
+ pmullw_r2r(mm0, mm5); \
+ psrlw_i2r(8, mm5); \
+ paddw_r2r(mm5, mm6); \
+ psllq_i2r(11, mm6); \
+ pand_r2r(mm1, mm6); \
+ movq_r2r(mm4, mm5); \
+ por_r2r(mm7, mm5); \
+ pand_r2r(mm5, mm3); \
+ por_r2r(mm6, mm3); \
+ movq_r2r(mm2, mm5); \
+ pand_r2r(mm4 , mm5); \
+ psrlq_i2r(5, mm5); \
+ movq_r2r(mm3, mm6); \
+ pand_r2r(mm4 , mm6); \
+ psrlq_i2r(5, mm6); \
+ psubw_r2r(mm6, mm5); \
+ pmullw_r2r(mm0, mm5); \
+ psrlw_i2r(8, mm5); \
+ paddw_r2r(mm5, mm6); \
+ psllq_i2r(5, mm6); \
+ pand_r2r(mm4, mm6); \
+ movq_r2r(mm1, mm5); \
+ por_r2r(mm7, mm5); \
+ pand_r2r(mm5, mm3); \
+ por_r2r(mm6, mm3); \
+ movq_r2r(mm2, mm5); \
+ pand_r2r(mm7 , mm5); \
+ movq_r2r(mm3, mm6); \
+ pand_r2r(mm7 , mm6); \
+ psubw_r2r(mm6, mm5); \
+ pmullw_r2r(mm0, mm5); \
+ psrlw_i2r(8, mm5); \
+ paddw_r2r(mm5, mm6); \
+ pand_r2r(mm7, mm6); \
+ movq_r2r(mm1, mm5); \
+ por_r2r(mm4, mm5); \
+ pand_r2r(mm5, mm3); \
+ por_r2r(mm6, mm3); \
+ movq_r2m(mm3, *dstp); \
+ srcp += 4; \
+ dstp += 4; \
+ i -= 3; \
+ } \
+ emms(); \
+ } while(0)
+
+#define ALPHA_BLIT16_555MMX(to, from, length, bpp, alpha) \
+ do { \
+ int i, n = 0; \
+ Uint16 *srcp = (Uint16 *)(from); \
+ Uint16 *dstp = (Uint16 *)(to); \
+ Uint32 ALPHA = 0x7C00; \
+ movd_m2r(*(&ALPHA), mm1); \
+ punpcklwd_r2r(mm1, mm1); \
+ punpcklwd_r2r(mm1, mm1); \
+ ALPHA = 0x03E0; \
+ movd_m2r(*(&ALPHA), mm4); \
+ punpcklwd_r2r(mm4, mm4); \
+ punpcklwd_r2r(mm4, mm4); \
+ ALPHA = 0x001F; \
+ movd_m2r(*(&ALPHA), mm7); \
+ punpcklwd_r2r(mm7, mm7); \
+ punpcklwd_r2r(mm7, mm7); \
+ alpha &= ~(1+2+4); \
+ i = (Uint32)alpha | (Uint32)alpha << 16; \
+ movd_m2r(*(&i), mm0); \
+ punpckldq_r2r(mm0, mm0); \
+ i = ((int)(length) & 3); \
+ ALPHA = alpha >> 3; \
+ for(; i > 0; --i) { \
+ Uint32 s = *srcp++; \
+ Uint32 d = *dstp; \
+ s = (s | s << 16) & 0x03e07c1f; \
+ d = (d | d << 16) & 0x03e07c1f; \
+ d += (s - d) * ALPHA >> 5; \
+ d &= 0x03e07c1f; \
+ *dstp++ = d | d >> 16; \
+ n++; \
+ } \
+ i = (int)(length) - n; \
+ for(; i > 0; --i) { \
+ movq_m2r((*dstp), mm3); \
+ movq_m2r((*srcp), mm2); \
+ movq_r2r(mm2, mm5); \
+ pand_r2r(mm1 , mm5); \
+ psrlq_i2r(10, mm5); \
+ movq_r2r(mm3, mm6); \
+ pand_r2r(mm1 , mm6); \
+ psrlq_i2r(10, mm6); \
+ psubw_r2r(mm6, mm5); \
+ pmullw_r2r(mm0, mm5); \
+ psrlw_i2r(8, mm5); \
+ paddw_r2r(mm5, mm6); \
+ psllq_i2r(10, mm6); \
+ pand_r2r(mm1, mm6); \
+ movq_r2r(mm4, mm5); \
+ por_r2r(mm7, mm5); \
+ pand_r2r(mm5, mm3); \
+ por_r2r(mm6, mm3); \
+ movq_r2r(mm2, mm5); \
+ pand_r2r(mm4 , mm5); \
+ psrlq_i2r(5, mm5); \
+ movq_r2r(mm3, mm6); \
+ pand_r2r(mm4 , mm6); \
+ psrlq_i2r(5, mm6); \
+ psubw_r2r(mm6, mm5); \
+ pmullw_r2r(mm0, mm5); \
+ psrlw_i2r(8, mm5); \
+ paddw_r2r(mm5, mm6); \
+ psllq_i2r(5, mm6); \
+ pand_r2r(mm4, mm6); \
+ movq_r2r(mm1, mm5); \
+ por_r2r(mm7, mm5); \
+ pand_r2r(mm5, mm3); \
+ por_r2r(mm6, mm3); \
+ movq_r2r(mm2, mm5); \
+ pand_r2r(mm7 , mm5); \
+ movq_r2r(mm3, mm6); \
+ pand_r2r(mm7 , mm6); \
+ psubw_r2r(mm6, mm5); \
+ pmullw_r2r(mm0, mm5); \
+ psrlw_i2r(8, mm5); \
+ paddw_r2r(mm5, mm6); \
+ pand_r2r(mm7, mm6); \
+ movq_r2r(mm1, mm5); \
+ por_r2r(mm4, mm5); \
+ pand_r2r(mm5, mm3); \
+ por_r2r(mm6, mm3); \
+ movq_r2m(mm3, *dstp); \
+ srcp += 4; \
+ dstp += 4; \
+ i -= 3; \
+ } \
+ emms(); \
+ } while(0)
+
+#endif
+
+/*
+ * For 32bpp pixels on the form 0x00rrggbb:
+ * If we treat the middle component separately, we can process the two
+ * remaining in parallel. This is safe to do because of the gap to the left
+ * 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; \
+ } \
+ } while(0)
+
+/*
+ * For 16bpp pixels we can go a step further: put the middle component
+ * in the high 16 bits of a 32 bit word, and process all three RGB
+ * 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); \
+ } \
+ } 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); \
+ } \
+ } while(0)
+
+/*
+ * The general slow catch-all function, for remaining depths and formats
+ */
+#define ALPHA_BLIT_ANY(to, from, length, bpp, alpha) \
+ do { \
+ int i; \
+ Uint8 *src = from; \
+ Uint8 *dst = to; \
+ for(i = 0; i < (int)(length); i++) { \
+ Uint32 s, d; \
+ unsigned rs, gs, bs, rd, gd, bd; \
+ switch(bpp) { \
+ case 2: \
+ s = *(Uint16 *)src; \
+ d = *(Uint16 *)dst; \
+ break; \
+ case 3: \
+ if(SDL_BYTEORDER == SDL_BIG_ENDIAN) { \
+ s = (src[0] << 16) | (src[1] << 8) | src[2]; \
+ d = (dst[0] << 16) | (dst[1] << 8) | dst[2]; \
+ } else { \
+ s = (src[2] << 16) | (src[1] << 8) | src[0]; \
+ d = (dst[2] << 16) | (dst[1] << 8) | dst[0]; \
+ } \
+ break; \
+ case 4: \
+ s = *(Uint32 *)src; \
+ d = *(Uint32 *)dst; \
+ break; \
+ } \
+ RGB_FROM_PIXEL(s, fmt, rs, gs, bs); \
+ RGB_FROM_PIXEL(d, fmt, rd, gd, bd); \
+ rd += (rs - rd) * alpha >> 8; \
+ gd += (gs - gd) * alpha >> 8; \
+ bd += (bs - bd) * alpha >> 8; \
+ PIXEL_FROM_RGB(d, fmt, rd, gd, bd); \
+ switch(bpp) { \
+ case 2: \
+ *(Uint16 *)dst = (Uint16)d; \
+ break; \
+ case 3: \
+ if(SDL_BYTEORDER == SDL_BIG_ENDIAN) { \
+ dst[0] = (Uint8)(d >> 16); \
+ dst[1] = (Uint8)(d >> 8); \
+ dst[2] = (Uint8)(d); \
+ } else { \
+ dst[0] = (Uint8)d; \
+ dst[1] = (Uint8)(d >> 8); \
+ dst[2] = (Uint8)(d >> 16); \
+ } \
+ break; \
+ case 4: \
+ *(Uint32 *)dst = d; \
+ break; \
+ } \
+ src += bpp; \
+ dst += bpp; \
+ } \
+ } while(0)
+
+#ifdef MMX_ASMBLIT
+
+#define ALPHA_BLIT32_888_50MMX(to, from, length, bpp, alpha) \
+ do { \
+ Uint32 *srcp = (Uint32 *)(from); \
+ Uint32 *dstp = (Uint32 *)(to); \
+ int i = 0x00fefefe; \
+ movd_m2r(*(&i), mm4); \
+ punpckldq_r2r(mm4, mm4); \
+ i = 0x00010101; \
+ movd_m2r(*(&i), mm3); \
+ punpckldq_r2r(mm3, mm3); \
+ i = (int)(length); \
+ if( i & 1 ) { \
+ Uint32 s = *srcp++; \
+ Uint32 d = *dstp; \
+ *dstp++ = (((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1) \
+ + (s & d & 0x00010101); \
+ i--; \
+ } \
+ for(; i > 0; --i) { \
+ movq_m2r((*dstp), mm2); /* dst -> mm2 */ \
+ movq_r2r(mm2, mm6); /* dst -> mm6 */ \
+ movq_m2r((*srcp), mm1); /* src -> mm1 */ \
+ movq_r2r(mm1, mm5); /* src -> mm5 */ \
+ pand_r2r(mm4, mm6); /* dst & 0x00fefefe -> mm6 */ \
+ pand_r2r(mm4, mm5); /* src & 0x00fefefe -> mm5 */ \
+ paddd_r2r(mm6, mm5); /* (dst & 0x00fefefe) + (dst & 0x00fefefe) -> mm5 */ \
+ psrld_i2r(1, mm5); \
+ pand_r2r(mm1, mm2); /* s & d -> mm2 */ \
+ pand_r2r(mm3, mm2); /* s & d & 0x00010101 -> mm2 */ \
+ paddd_r2r(mm5, mm2); \
+ movq_r2m(mm2, (*dstp)); \
+ dstp += 2; \
+ srcp += 2; \
+ i--; \
+ } \
+ emms(); \
+ } while(0)
+
+#endif
+
+/*
+ * Special case: 50% alpha (alpha=128)
+ * This is treated specially because it can be optimized very well, and
+ * since it is good for many cases of semi-translucency.
+ * The theory is to do all three components at the same time:
+ * 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); \
+ } \
+ } while(0)
+
+/*
+ * For 16bpp, we can actually blend two pixels in parallel, if we take
+ * care to shift before we add, not after.
+ */
+
+/* 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))); \
+ } 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 */ \
+ } \
+ } while(0)
+
+#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) \
+ ALPHA_BLIT16_50(to, from, length, bpp, alpha, 0xfbde)
+
+#ifdef MMX_ASMBLIT
+
+#define CHOOSE_BLIT(blitter, alpha, fmt) \
+ do { \
+ if(alpha == 255) { \
+ switch(fmt->BytesPerPixel) { \
+ case 1: blitter(1, Uint8, OPAQUE_BLIT); break; \
+ case 2: blitter(2, Uint8, OPAQUE_BLIT); break; \
+ case 3: blitter(3, Uint8, OPAQUE_BLIT); break; \
+ case 4: blitter(4, Uint16, OPAQUE_BLIT); break; \
+ } \
+ } else { \
+ switch(fmt->BytesPerPixel) { \
+ case 1: \
+ /* No 8bpp alpha blitting */ \
+ break; \
+ \
+ case 2: \
+ switch(fmt->Rmask | fmt->Gmask | fmt->Bmask) { \
+ case 0xffff: \
+ if(fmt->Gmask == 0x07e0 \
+ || fmt->Rmask == 0x07e0 \
+ || fmt->Bmask == 0x07e0) { \
+ if(alpha == 128) \
+ blitter(2, Uint8, ALPHA_BLIT16_565_50); \
+ else { \
+ if(SDL_HasMMX()) \
+ blitter(2, Uint8, ALPHA_BLIT16_565MMX); \
+ else \
+ blitter(2, Uint8, ALPHA_BLIT16_565); \
+ } \
+ } else \
+ goto general16; \
+ break; \
+ \
+ case 0x7fff: \
+ if(fmt->Gmask == 0x03e0 \
+ || fmt->Rmask == 0x03e0 \
+ || fmt->Bmask == 0x03e0) { \
+ if(alpha == 128) \
+ blitter(2, Uint8, ALPHA_BLIT16_555_50); \
+ else { \
+ if(SDL_HasMMX()) \
+ blitter(2, Uint8, ALPHA_BLIT16_555MMX); \
+ else \
+ blitter(2, Uint8, ALPHA_BLIT16_555); \
+ } \
+ break; \
+ } \
+ /* fallthrough */ \
+ \
+ default: \
+ general16: \
+ blitter(2, Uint8, ALPHA_BLIT_ANY); \
+ } \
+ break; \
+ \
+ case 3: \
+ blitter(3, Uint8, ALPHA_BLIT_ANY); \
+ break; \
+ \
+ case 4: \
+ if((fmt->Rmask | fmt->Gmask | fmt->Bmask) == 0x00ffffff \
+ && (fmt->Gmask == 0xff00 || fmt->Rmask == 0xff00 \
+ || fmt->Bmask == 0xff00)) { \
+ if(alpha == 128) \
+ { \
+ if(SDL_HasMMX()) \
+ blitter(4, Uint16, ALPHA_BLIT32_888_50MMX);\
+ else \
+ blitter(4, Uint16, ALPHA_BLIT32_888_50);\
+ } \
+ else \
+ { \
+ if(SDL_HasMMX()) \
+ blitter(4, Uint16, ALPHA_BLIT32_888MMX);\
+ else \
+ blitter(4, Uint16, ALPHA_BLIT32_888); \
+ } \
+ } else \
+ blitter(4, Uint16, ALPHA_BLIT_ANY); \
+ break; \
+ } \
+ } \
+ } while(0)
+
+#else
+
+#define CHOOSE_BLIT(blitter, alpha, fmt) \
+ do { \
+ if(alpha == 255) { \
+ switch(fmt->BytesPerPixel) { \
+ case 1: blitter(1, Uint8, OPAQUE_BLIT); break; \
+ case 2: blitter(2, Uint8, OPAQUE_BLIT); break; \
+ case 3: blitter(3, Uint8, OPAQUE_BLIT); break; \
+ case 4: blitter(4, Uint16, OPAQUE_BLIT); break; \
+ } \
+ } else { \
+ switch(fmt->BytesPerPixel) { \
+ case 1: \
+ /* No 8bpp alpha blitting */ \
+ break; \
+ \
+ case 2: \
+ switch(fmt->Rmask | fmt->Gmask | fmt->Bmask) { \
+ case 0xffff: \
+ if(fmt->Gmask == 0x07e0 \
+ || fmt->Rmask == 0x07e0 \
+ || fmt->Bmask == 0x07e0) { \
+ if(alpha == 128) \
+ blitter(2, Uint8, ALPHA_BLIT16_565_50); \
+ else { \
+ blitter(2, Uint8, ALPHA_BLIT16_565); \
+ } \
+ } else \
+ goto general16; \
+ break; \
+ \
+ case 0x7fff: \
+ if(fmt->Gmask == 0x03e0 \
+ || fmt->Rmask == 0x03e0 \
+ || fmt->Bmask == 0x03e0) { \
+ if(alpha == 128) \
+ blitter(2, Uint8, ALPHA_BLIT16_555_50); \
+ else { \
+ blitter(2, Uint8, ALPHA_BLIT16_555); \
+ } \
+ break; \
+ } \
+ /* fallthrough */ \
+ \
+ default: \
+ general16: \
+ blitter(2, Uint8, ALPHA_BLIT_ANY); \
+ } \
+ break; \
+ \
+ case 3: \
+ blitter(3, Uint8, ALPHA_BLIT_ANY); \
+ break; \
+ \
+ case 4: \
+ if((fmt->Rmask | fmt->Gmask | fmt->Bmask) == 0x00ffffff \
+ && (fmt->Gmask == 0xff00 || fmt->Rmask == 0xff00 \
+ || fmt->Bmask == 0xff00)) { \
+ if(alpha == 128) \
+ blitter(4, Uint16, ALPHA_BLIT32_888_50); \
+ else \
+ blitter(4, Uint16, ALPHA_BLIT32_888); \
+ } else \
+ blitter(4, Uint16, ALPHA_BLIT_ANY); \
+ break; \
+ } \
+ } \
+ } while(0)
+
+#endif
+
+/*
+ * This takes care of the case when the surface is clipped on the left and/or
+ * right. Top clipping has already been taken care of.
+ */
+static void RLEClipBlit(int w, Uint8 *srcbuf, SDL_Surface *dst,
+ Uint8 *dstbuf, SDL_Rect *srcrect, unsigned alpha)
+{
+ 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; \
+ } \
+ } \
+ } while(0)
+
+ CHOOSE_BLIT(RLECLIPBLIT, alpha, fmt);
+
+#undef RLECLIPBLIT
+
+}
+
+
+/* blit a colorkeyed RLE surface */
+int SDL_RLEBlit(SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect)
+{
+ Uint8 *dstbuf;
+ Uint8 *srcbuf;
+ int x, y;
+ int w = src->w;
+ unsigned alpha;
+
+ /* Lock the destination if necessary */
+ if ( SDL_MUSTLOCK(dst) ) {
+ if ( SDL_LockSurface(dst) < 0 ) {
+ return(-1);
+ }
+ }
+
+ /* Set up the source and destination pointers */
+ x = dstrect->x;
+ y = dstrect->y;
+ dstbuf = (Uint8 *)dst->pixels
+ + y * dst->pitch + x * src->format->BytesPerPixel;
+ srcbuf = (Uint8 *)src->map->sw_data->aux_data;
+
+ {
+ /* skip lines at the top if neccessary */
+ int vskip = srcrect->y;
+ int ofs = 0;
+ if(vskip) {
+
+#define RLESKIP(bpp, Type) \
+ for(;;) { \
+ int run; \
+ ofs += *(Type *)srcbuf; \
+ run = ((Type *)srcbuf)[1]; \
+ srcbuf += sizeof(Type) * 2; \
+ if(run) { \
+ srcbuf += run * bpp; \
+ ofs += run; \
+ } else if(!ofs) \
+ goto done; \
+ if(ofs == w) { \
+ ofs = 0; \
+ if(!--vskip) \
+ break; \
+ } \
+ }
+
+ switch(src->format->BytesPerPixel) {
+ case 1: RLESKIP(1, Uint8); break;
+ case 2: RLESKIP(2, Uint8); break;
+ case 3: RLESKIP(3, Uint8); break;
+ case 4: RLESKIP(4, Uint16); break;
+ }
+
+#undef RLESKIP
+
+ }
+ }
+
+ alpha = (src->flags & SDL_SRCALPHA) == SDL_SRCALPHA
+ ? src->format->alpha : 255;
+ /* if left or right edge clipping needed, call clip blit */
+ if ( srcrect->x || srcrect->w != src->w ) {
+ RLEClipBlit(w, srcbuf, dst, dstbuf, srcrect, alpha);
+ } else {
+ SDL_PixelFormat *fmt = src->format;
+
+#define RLEBLIT(bpp, Type, do_blit) \
+ do { \
+ int linecount = srcrect->h; \
+ int ofs = 0; \
+ for(;;) { \
+ unsigned run; \
+ ofs += *(Type *)srcbuf; \
+ run = ((Type *)srcbuf)[1]; \
+ srcbuf += 2 * sizeof(Type); \
+ if(run) { \
+ do_blit(dstbuf + ofs * bpp, srcbuf, run, bpp, alpha); \
+ srcbuf += run * bpp; \
+ ofs += run; \
+ } else if(!ofs) \
+ break; \
+ if(ofs == w) { \
+ ofs = 0; \
+ dstbuf += dst->pitch; \
+ if(!--linecount) \
+ break; \
+ } \
+ } \
+ } while(0)
+
+ CHOOSE_BLIT(RLEBLIT, alpha, fmt);
+
+#undef RLEBLIT
+ }
+
+done:
+ /* Unlock the destination if necessary */
+ if ( SDL_MUSTLOCK(dst) ) {
+ SDL_UnlockSurface(dst);
+ }
+ return(0);
+}
+
+#undef OPAQUE_BLIT
+
+/*
+ * Per-pixel blitting macros for translucent pixels:
+ * These use the same techniques as the per-surface blitting macros
+ */
+
+/*
+ * 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; \
+ } 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); \
+ } 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); \
+ } while(0)
+
+/* used to save the destination format in the encoding. Designed to be
+ macro-compatible with SDL_PixelFormat but without the unneeded fields */
+typedef struct {
+ Uint8 BytesPerPixel;
+ Uint8 Rloss;
+ Uint8 Gloss;
+ Uint8 Bloss;
+ Uint8 Rshift;
+ Uint8 Gshift;
+ Uint8 Bshift;
+ Uint8 Ashift;
+ Uint32 Rmask;
+ Uint32 Gmask;
+ Uint32 Bmask;
+ Uint32 Amask;
+} RLEDestFormat;
+
+/* blit a pixel-alpha RLE surface clipped at the right and/or left edges */
+static void RLEAlphaClipBlit(int w, Uint8 *srcbuf, SDL_Surface *dst,
+ Uint8 *dstbuf, SDL_Rect *srcrect)
+{
+ SDL_PixelFormat *df = dst->format;
+ /*
+ * clipped blitter: Ptype is the destination pixel type,
+ * 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); \
+ } while(0)
+
+ switch(df->BytesPerPixel) {
+ case 2:
+ if(df->Gmask == 0x07e0 || df->Rmask == 0x07e0
+ || df->Bmask == 0x07e0)
+ RLEALPHACLIPBLIT(Uint16, Uint8, BLIT_TRANSL_565);
+ else
+ RLEALPHACLIPBLIT(Uint16, Uint8, BLIT_TRANSL_555);
+ break;
+ case 4:
+ RLEALPHACLIPBLIT(Uint32, Uint16, BLIT_TRANSL_888);
+ break;
+ }
+}
+
+/* blit a pixel-alpha RLE surface */
+int SDL_RLEAlphaBlit(SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect)
+{
+ int x, y;
+ int w = src->w;
+ Uint8 *srcbuf, *dstbuf;
+ SDL_PixelFormat *df = dst->format;
+
+ /* Lock the destination if necessary */
+ if ( SDL_MUSTLOCK(dst) ) {
+ if ( SDL_LockSurface(dst) < 0 ) {
+ return -1;
+ }
+ }
+
+ x = dstrect->x;
+ y = dstrect->y;
+ dstbuf = (Uint8 *)dst->pixels
+ + y * dst->pitch + x * df->BytesPerPixel;
+ srcbuf = (Uint8 *)src->map->sw_data->aux_data + sizeof(RLEDestFormat);
+
+ {
+ /* skip lines at the top if necessary */
+ int vskip = srcrect->y;
+ if(vskip) {
+ int ofs;
+ if(df->BytesPerPixel == 2) {
+ /* the 16/32 interleaved format */
+ do {
+ /* skip opaque line */
+ ofs = 0;
+ do {
+ int run;
+ ofs += srcbuf[0];
+ run = srcbuf[1];
+ srcbuf += 2;
+ if(run) {
+ srcbuf += 2 * run;
+ ofs += run;
+ } else if(!ofs)
+ goto done;
+ } while(ofs < w);
+
+ /* skip padding */
+ srcbuf += (uintptr_t)srcbuf & 2;
+
+ /* skip translucent line */
+ ofs = 0;
+ do {
+ int run;
+ ofs += ((Uint16 *)srcbuf)[0];
+ run = ((Uint16 *)srcbuf)[1];
+ srcbuf += 4 * (run + 1);
+ ofs += run;
+ } while(ofs < w);
+ } while(--vskip);
+ } else {
+ /* the 32/32 interleaved format */
+ vskip <<= 1; /* opaque and translucent have same format */
+ do {
+ ofs = 0;
+ do {
+ int run;
+ ofs += ((Uint16 *)srcbuf)[0];
+ run = ((Uint16 *)srcbuf)[1];
+ srcbuf += 4;
+ if(run) {
+ srcbuf += 4 * run;
+ ofs += run;
+ } else if(!ofs)
+ goto done;
+ } while(ofs < w);
+ } while(--vskip);
+ }
+ }
+ }
+
+ /* if left or right edge clipping needed, call clip blit */
+ if(srcrect->x || srcrect->w != src->w) {
+ RLEAlphaClipBlit(w, srcbuf, dst, dstbuf, srcrect);
+ } else {
+
+ /*
+ * non-clipped blitter. Ptype is the destination pixel type,
+ * Ctype the translucent count type, and do_blend the
+ * macro to blend one pixel.
+ */
+#define RLEALPHABLIT(Ptype, Ctype, do_blend) \
+ do { \
+ int linecount = srcrect->h; \
+ do { \
+ int ofs = 0; \
+ /* blit opaque pixels on one line */ \
+ do { \
+ unsigned run; \
+ ofs += ((Ctype *)srcbuf)[0]; \
+ run = ((Ctype *)srcbuf)[1]; \
+ srcbuf += 2 * sizeof(Ctype); \
+ if(run) { \
+ PIXEL_COPY(dstbuf + ofs * sizeof(Ptype), srcbuf, \
+ run, sizeof(Ptype)); \
+ srcbuf += run * sizeof(Ptype); \
+ ofs += run; \
+ } else if(!ofs) \
+ goto done; \
+ } while(ofs < w); \
+ /* skip padding if necessary */ \
+ if(sizeof(Ptype) == 2) \
+ srcbuf += (uintptr_t)srcbuf & 2; \
+ /* blit translucent pixels on the same line */ \
+ ofs = 0; \
+ do { \
+ unsigned run; \
+ ofs += ((Uint16 *)srcbuf)[0]; \
+ run = ((Uint16 *)srcbuf)[1]; \
+ srcbuf += 4; \
+ if(run) { \
+ Ptype *dst = (Ptype *)dstbuf + ofs; \
+ unsigned i; \
+ for(i = 0; i < run; i++) { \
+ Uint32 src = *(Uint32 *)srcbuf; \
+ do_blend(src, *dst); \
+ srcbuf += 4; \
+ dst++; \
+ } \
+ ofs += run; \
+ } \
+ } while(ofs < w); \
+ dstbuf += dst->pitch; \
+ } while(--linecount); \
+ } while(0)
+
+ switch(df->BytesPerPixel) {
+ case 2:
+ if(df->Gmask == 0x07e0 || df->Rmask == 0x07e0
+ || df->Bmask == 0x07e0)
+ RLEALPHABLIT(Uint16, Uint8, BLIT_TRANSL_565);
+ else
+ RLEALPHABLIT(Uint16, Uint8, BLIT_TRANSL_555);
+ break;
+ case 4:
+ RLEALPHABLIT(Uint32, Uint16, BLIT_TRANSL_888);
+ break;
+ }
+ }
+
+ done:
+ /* Unlock the destination if necessary */
+ if ( SDL_MUSTLOCK(dst) ) {
+ SDL_UnlockSurface(dst);
+ }
+ return 0;
+}
+
+/*
+ * Auxiliary functions:
+ * The encoding functions take 32bpp rgb + a, and
+ * return the number of bytes copied to the destination.
+ * The decoding functions copy to 32bpp rgb + a, and
+ * return the number of bytes copied from the source.
+ * These are only used in the encoder and un-RLE code and are therefore not
+ * highly optimised.
+ */
+
+/* encode 32bpp rgb + a into 16bpp rgb, losing alpha */
+static int copy_opaque_16(void *dst, Uint32 *src, int n,
+ SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt)
+{
+ int i;
+ Uint16 *d = dst;
+ for(i = 0; i < n; i++) {
+ unsigned r, g, b;
+ RGB_FROM_PIXEL(*src, sfmt, r, g, b);
+ PIXEL_FROM_RGB(*d, dfmt, r, g, b);
+ src++;
+ d++;
+ }
+ return n * 2;
+}
+
+/* decode opaque pixels from 16bpp to 32bpp rgb + a */
+static int uncopy_opaque_16(Uint32 *dst, void *src, int n,
+ RLEDestFormat *sfmt, SDL_PixelFormat *dfmt)
+{
+ int i;
+ Uint16 *s = src;
+ unsigned alpha = dfmt->Amask ? 255 : 0;
+ for(i = 0; i < n; i++) {
+ unsigned r, g, b;
+ RGB_FROM_PIXEL(*s, sfmt, r, g, b);
+ PIXEL_FROM_RGBA(*dst, dfmt, r, g, b, alpha);
+ s++;
+ dst++;
+ }
+ return n * 2;
+}
+
+
+
+/* encode 32bpp rgb + a into 32bpp G0RAB format for blitting into 565 */
+static int copy_transl_565(void *dst, Uint32 *src, int n,
+ SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt)
+{
+ int i;
+ Uint32 *d = dst;
+ for(i = 0; i < n; i++) {
+ unsigned r, g, b, a;
+ Uint16 pix;
+ RGBA_FROM_8888(*src, sfmt, r, g, b, a);
+ PIXEL_FROM_RGB(pix, dfmt, r, g, b);
+ *d = ((pix & 0x7e0) << 16) | (pix & 0xf81f) | ((a << 2) & 0x7e0);
+ src++;
+ d++;
+ }
+ return n * 4;
+}
+
+/* encode 32bpp rgb + a into 32bpp G0RAB format for blitting into 555 */
+static int copy_transl_555(void *dst, Uint32 *src, int n,
+ SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt)
+{
+ int i;
+ Uint32 *d = dst;
+ for(i = 0; i < n; i++) {
+ unsigned r, g, b, a;
+ Uint16 pix;
+ RGBA_FROM_8888(*src, sfmt, r, g, b, a);
+ PIXEL_FROM_RGB(pix, dfmt, r, g, b);
+ *d = ((pix & 0x3e0) << 16) | (pix & 0xfc1f) | ((a << 2) & 0x3e0);
+ src++;
+ d++;
+ }
+ return n * 4;
+}
+
+/* decode translucent pixels from 32bpp GORAB to 32bpp rgb + a */
+static int uncopy_transl_16(Uint32 *dst, void *src, int n,
+ RLEDestFormat *sfmt, SDL_PixelFormat *dfmt)
+{
+ int i;
+ Uint32 *s = src;
+ for(i = 0; i < n; i++) {
+ unsigned r, g, b, a;
+ Uint32 pix = *s++;
+ a = (pix & 0x3e0) >> 2;
+ pix = (pix & ~0x3e0) | pix >> 16;
+ RGB_FROM_PIXEL(pix, sfmt, r, g, b);
+ PIXEL_FROM_RGBA(*dst, dfmt, r, g, b, a);
+ dst++;
+ }
+ return n * 4;
+}
+
+/* encode 32bpp rgba into 32bpp rgba, keeping alpha (dual purpose) */
+static int copy_32(void *dst, Uint32 *src, int n,
+ SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt)
+{
+ int i;
+ Uint32 *d = dst;
+ for(i = 0; i < n; i++) {
+ unsigned r, g, b, a;
+ Uint32 pixel;
+ RGBA_FROM_8888(*src, sfmt, r, g, b, a);
+ PIXEL_FROM_RGB(pixel, dfmt, r, g, b);
+ *d++ = pixel | a << 24;
+ src++;
+ }
+ return n * 4;
+}
+
+/* decode 32bpp rgba into 32bpp rgba, keeping alpha (dual purpose) */
+static int uncopy_32(Uint32 *dst, void *src, int n,
+ RLEDestFormat *sfmt, SDL_PixelFormat *dfmt)
+{
+ int i;
+ Uint32 *s = src;
+ for(i = 0; i < n; i++) {
+ unsigned r, g, b, a;
+ Uint32 pixel = *s++;
+ RGB_FROM_PIXEL(pixel, sfmt, r, g, b);
+ a = pixel >> 24;
+ PIXEL_FROM_RGBA(*dst, dfmt, r, g, b, a);
+ dst++;
+ }
+ return n * 4;
+}
+
+#define ISOPAQUE(pixel, fmt) ((((pixel) & fmt->Amask) >> fmt->Ashift) == 255)
+
+#define ISTRANSL(pixel, fmt) \
+ ((unsigned)((((pixel) & fmt->Amask) >> fmt->Ashift) - 1U) < 254U)
+
+/* convert surface to be quickly alpha-blittable onto dest, if possible */
+static int RLEAlphaSurface(SDL_Surface *surface)
+{
+ SDL_Surface *dest;
+ SDL_PixelFormat *df;
+ int maxsize = 0;
+ int max_opaque_run;
+ int max_transl_run = 65535;
+ unsigned masksum;
+ Uint8 *rlebuf, *dst;
+ int (*copy_opaque)(void *, Uint32 *, int,
+ SDL_PixelFormat *, SDL_PixelFormat *);
+ int (*copy_transl)(void *, Uint32 *, int,
+ SDL_PixelFormat *, SDL_PixelFormat *);
+
+ dest = surface->map->dst;
+ if(!dest)
+ return -1;
+ df = dest->format;
+ if(surface->format->BitsPerPixel != 32)
+ return -1; /* only 32bpp source supported */
+
+ /* find out whether the destination is one we support,
+ and determine the max size of the encoded result */
+ masksum = df->Rmask | df->Gmask | df->Bmask;
+ switch(df->BytesPerPixel) {
+ case 2:
+ /* 16bpp: only support 565 and 555 formats */
+ switch(masksum) {
+ case 0xffff:
+ if(df->Gmask == 0x07e0
+ || df->Rmask == 0x07e0 || df->Bmask == 0x07e0) {
+ copy_opaque = copy_opaque_16;
+ copy_transl = copy_transl_565;
+ } else
+ return -1;
+ break;
+ case 0x7fff:
+ if(df->Gmask == 0x03e0
+ || df->Rmask == 0x03e0 || df->Bmask == 0x03e0) {
+ copy_opaque = copy_opaque_16;
+ copy_transl = copy_transl_555;
+ } else
+ return -1;
+ break;
+ default:
+ return -1;
+ }
+ max_opaque_run = 255; /* runs stored as bytes */
+
+ /* worst case is alternating opaque and translucent pixels,
+ with room for alignment padding between lines */
+ maxsize = surface->h * (2 + (4 + 2) * (surface->w + 1)) + 2;
+ break;
+ case 4:
+ if(masksum != 0x00ffffff)
+ return -1; /* requires unused high byte */
+ copy_opaque = copy_32;
+ copy_transl = copy_32;
+ max_opaque_run = 255; /* runs stored as short ints */
+
+ /* worst case is alternating opaque and translucent pixels */
+ maxsize = surface->h * 2 * 4 * (surface->w + 1) + 4;
+ break;
+ default:
+ return -1; /* anything else unsupported right now */
+ }
+
+ maxsize += sizeof(RLEDestFormat);
+ rlebuf = (Uint8 *)SDL_malloc(maxsize);
+ if(!rlebuf) {
+ SDL_OutOfMemory();
+ return -1;
+ }
+ {
+ /* save the destination format so we can undo the encoding later */
+ RLEDestFormat *r = (RLEDestFormat *)rlebuf;
+ r->BytesPerPixel = df->BytesPerPixel;
+ r->Rloss = df->Rloss;
+ r->Gloss = df->Gloss;
+ r->Bloss = df->Bloss;
+ r->Rshift = df->Rshift;
+ r->Gshift = df->Gshift;
+ r->Bshift = df->Bshift;
+ r->Ashift = df->Ashift;
+ r->Rmask = df->Rmask;
+ r->Gmask = df->Gmask;
+ r->Bmask = df->Bmask;
+ r->Amask = df->Amask;
+ }
+ dst = rlebuf + sizeof(RLEDestFormat);
+
+ /* Do the actual encoding */
+ {
+ int x, y;
+ int h = surface->h, w = surface->w;
+ SDL_PixelFormat *sf = surface->format;
+ Uint32 *src = (Uint32 *)surface->pixels;
+ Uint8 *lastline = dst; /* end of last non-blank line */
+
+ /* opaque counts are 8 or 16 bits, depending on target depth */
+#define ADD_OPAQUE_COUNTS(n, m) \
+ if(df->BytesPerPixel == 4) { \
+ ((Uint16 *)dst)[0] = n; \
+ ((Uint16 *)dst)[1] = m; \
+ dst += 4; \
+ } else { \
+ dst[0] = n; \
+ dst[1] = m; \
+ dst += 2; \
+ }
+
+ /* translucent counts are always 16 bit */
+#define ADD_TRANSL_COUNTS(n, m) \
+ (((Uint16 *)dst)[0] = n, ((Uint16 *)dst)[1] = m, dst += 4)
+
+ for(y = 0; y < h; y++) {
+ int runstart, skipstart;
+ int blankline = 0;
+ /* First encode all opaque pixels of a scan line */
+ x = 0;
+ do {
+ int run, skip, len;
+ skipstart = x;
+ while(x < w && !ISOPAQUE(src[x], sf))
+ x++;
+ runstart = x;
+ while(x < w && ISOPAQUE(src[x], sf))
+ x++;
+ skip = runstart - skipstart;
+ if(skip == w)
+ blankline = 1;
+ run = x - runstart;
+ while(skip > max_opaque_run) {
+ ADD_OPAQUE_COUNTS(max_opaque_run, 0);
+ skip -= max_opaque_run;
+ }
+ len = MIN(run, max_opaque_run);
+ ADD_OPAQUE_COUNTS(skip, len);
+ dst += copy_opaque(dst, src + runstart, len, sf, df);
+ runstart += len;
+ run -= len;
+ while(run) {
+ len = MIN(run, max_opaque_run);
+ ADD_OPAQUE_COUNTS(0, len);
+ dst += copy_opaque(dst, src + runstart, len, sf, df);
+ runstart += len;
+ run -= len;
+ }
+ } while(x < w);
+
+ /* Make sure the next output address is 32-bit aligned */
+ dst += (uintptr_t)dst & 2;
+
+ /* Next, encode all translucent pixels of the same scan line */
+ x = 0;
+ do {
+ int run, skip, len;
+ skipstart = x;
+ while(x < w && !ISTRANSL(src[x], sf))
+ x++;
+ runstart = x;
+ while(x < w && ISTRANSL(src[x], sf))
+ x++;
+ skip = runstart - skipstart;
+ blankline &= (skip == w);
+ run = x - runstart;
+ while(skip > max_transl_run) {
+ ADD_TRANSL_COUNTS(max_transl_run, 0);
+ skip -= max_transl_run;
+ }
+ len = MIN(run, max_transl_run);
+ ADD_TRANSL_COUNTS(skip, len);
+ dst += copy_transl(dst, src + runstart, len, sf, df);
+ runstart += len;
+ run -= len;
+ while(run) {
+ len = MIN(run, max_transl_run);
+ ADD_TRANSL_COUNTS(0, len);
+ dst += copy_transl(dst, src + runstart, len, sf, df);
+ runstart += len;
+ run -= len;
+ }
+ if(!blankline)
+ lastline = dst;
+ } while(x < w);
+
+ src += surface->pitch >> 2;
+ }
+ dst = lastline; /* back up past trailing blank lines */
+ ADD_OPAQUE_COUNTS(0, 0);
+ }
+
+#undef ADD_OPAQUE_COUNTS
+#undef ADD_TRANSL_COUNTS
+
+ /* Now that we have it encoded, release the original pixels */
+ if((surface->flags & SDL_PREALLOC) != SDL_PREALLOC
+ && (surface->flags & SDL_HWSURFACE) != SDL_HWSURFACE) {
+ SDL_free( surface->pixels );
+ surface->pixels = NULL;
+ }
+
+ /* realloc the buffer to release unused memory */
+ {
+ Uint8 *p = SDL_realloc(rlebuf, dst - rlebuf);
+ if(!p)
+ p = rlebuf;
+ surface->map->sw_data->aux_data = p;
+ }
+
+ return 0;
+}
+
+static Uint32 getpix_8(Uint8 *srcbuf)
+{
+ return *srcbuf;
+}
+
+static Uint32 getpix_16(Uint8 *srcbuf)
+{
+ return *(Uint16 *)srcbuf;
+}
+
+static Uint32 getpix_24(Uint8 *srcbuf)
+{
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+ return srcbuf[0] + (srcbuf[1] << 8) + (srcbuf[2] << 16);
+#else
+ return (srcbuf[0] << 16) + (srcbuf[1] << 8) + srcbuf[2];
+#endif
+}
+
+static Uint32 getpix_32(Uint8 *srcbuf)
+{
+ return *(Uint32 *)srcbuf;
+}
+
+typedef Uint32 (*getpix_func)(Uint8 *);
+
+static getpix_func getpixes[4] = {
+ getpix_8, getpix_16, getpix_24, getpix_32
+};
+
+static int RLEColorkeySurface(SDL_Surface *surface)
+{
+ Uint8 *rlebuf, *dst;
+ int maxn;
+ int y;
+ Uint8 *srcbuf, *lastline;
+ int maxsize = 0;
+ int bpp = surface->format->BytesPerPixel;
+ getpix_func getpix;
+ Uint32 ckey, rgbmask;
+ int w, h;
+
+ /* calculate the worst case size for the compressed surface */
+ switch(bpp) {
+ case 1:
+ /* worst case is alternating opaque and transparent pixels,
+ starting with an opaque pixel */
+ maxsize = surface->h * 3 * (surface->w / 2 + 1) + 2;
+ break;
+ case 2:
+ case 3:
+ /* worst case is solid runs, at most 255 pixels wide */
+ maxsize = surface->h * (2 * (surface->w / 255 + 1)
+ + surface->w * bpp) + 2;
+ break;
+ case 4:
+ /* worst case is solid runs, at most 65535 pixels wide */
+ maxsize = surface->h * (4 * (surface->w / 65535 + 1)
+ + surface->w * 4) + 4;
+ break;
+ }
+
+ rlebuf = (Uint8 *)SDL_malloc(maxsize);
+ if ( rlebuf == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+
+ /* Set up the conversion */
+ srcbuf = (Uint8 *)surface->pixels;
+ maxn = bpp == 4 ? 65535 : 255;
+ dst = rlebuf;
+ rgbmask = ~surface->format->Amask;
+ ckey = surface->format->colorkey & rgbmask;
+ lastline = dst;
+ getpix = getpixes[bpp - 1];
+ w = surface->w;
+ h = surface->h;
+
+#define ADD_COUNTS(n, m) \
+ if(bpp == 4) { \
+ ((Uint16 *)dst)[0] = n; \
+ ((Uint16 *)dst)[1] = m; \
+ dst += 4; \
+ } else { \
+ dst[0] = n; \
+ dst[1] = m; \
+ dst += 2; \
+ }
+
+ for(y = 0; y < h; y++) {
+ int x = 0;
+ int blankline = 0;
+ do {
+ int run, skip, len;
+ int runstart;
+ int skipstart = x;
+
+ /* find run of transparent, then opaque pixels */
+ while(x < w && (getpix(srcbuf + x * bpp) & rgbmask) == ckey)
+ x++;
+ runstart = x;
+ while(x < w && (getpix(srcbuf + x * bpp) & rgbmask) != ckey)
+ x++;
+ skip = runstart - skipstart;
+ if(skip == w)
+ blankline = 1;
+ run = x - runstart;
+
+ /* encode segment */
+ while(skip > maxn) {
+ ADD_COUNTS(maxn, 0);
+ skip -= maxn;
+ }
+ len = MIN(run, maxn);
+ ADD_COUNTS(skip, len);
+ SDL_memcpy(dst, srcbuf + runstart * bpp, len * bpp);
+ dst += len * bpp;
+ run -= len;
+ runstart += len;
+ while(run) {
+ len = MIN(run, maxn);
+ ADD_COUNTS(0, len);
+ SDL_memcpy(dst, srcbuf + runstart * bpp, len * bpp);
+ dst += len * bpp;
+ runstart += len;
+ run -= len;
+ }
+ if(!blankline)
+ lastline = dst;
+ } while(x < w);
+
+ srcbuf += surface->pitch;
+ }
+ dst = lastline; /* back up bast trailing blank lines */
+ ADD_COUNTS(0, 0);
+
+#undef ADD_COUNTS
+
+ /* Now that we have it encoded, release the original pixels */
+ if((surface->flags & SDL_PREALLOC) != SDL_PREALLOC
+ && (surface->flags & SDL_HWSURFACE) != SDL_HWSURFACE) {
+ SDL_free( surface->pixels );
+ surface->pixels = NULL;
+ }
+
+ /* realloc the buffer to release unused memory */
+ {
+ /* If realloc returns NULL, the original block is left intact */
+ Uint8 *p = SDL_realloc(rlebuf, dst - rlebuf);
+ if(!p)
+ p = rlebuf;
+ surface->map->sw_data->aux_data = p;
+ }
+
+ return(0);
+}
+
+int SDL_RLESurface(SDL_Surface *surface)
+{
+ int retcode;
+
+ /* Clear any previous RLE conversion */
+ if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) {
+ SDL_UnRLESurface(surface, 1);
+ }
+
+ /* We don't support RLE encoding of bitmaps */
+ if ( surface->format->BitsPerPixel < 8 ) {
+ return(-1);
+ }
+
+ /* Lock the surface if it's in hardware */
+ if ( SDL_MUSTLOCK(surface) ) {
+ if ( SDL_LockSurface(surface) < 0 ) {
+ return(-1);
+ }
+ }
+
+ /* Encode */
+ if((surface->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY) {
+ retcode = RLEColorkeySurface(surface);
+ } else {
+ if((surface->flags & SDL_SRCALPHA) == SDL_SRCALPHA
+ && surface->format->Amask != 0)
+ retcode = RLEAlphaSurface(surface);
+ else
+ retcode = -1; /* no RLE for per-surface alpha sans ckey */
+ }
+
+ /* Unlock the surface if it's in hardware */
+ if ( SDL_MUSTLOCK(surface) ) {
+ SDL_UnlockSurface(surface);
+ }
+
+ if(retcode < 0)
+ return -1;
+
+ /* The surface is now accelerated */
+ surface->flags |= SDL_RLEACCEL;
+
+ return(0);
+}
+
+/*
+ * 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
+ * may have been reduced (when encoding for 16bpp targets).
+ */
+static SDL_bool UnRLEAlpha(SDL_Surface *surface)
+{
+ Uint8 *srcbuf;
+ Uint32 *dst;
+ SDL_PixelFormat *sf = surface->format;
+ RLEDestFormat *df = surface->map->sw_data->aux_data;
+ int (*uncopy_opaque)(Uint32 *, void *, int,
+ RLEDestFormat *, SDL_PixelFormat *);
+ int (*uncopy_transl)(Uint32 *, void *, int,
+ RLEDestFormat *, SDL_PixelFormat *);
+ int w = surface->w;
+ int bpp = df->BytesPerPixel;
+
+ if(bpp == 2) {
+ uncopy_opaque = uncopy_opaque_16;
+ uncopy_transl = uncopy_transl_16;
+ } else {
+ uncopy_opaque = uncopy_transl = uncopy_32;
+ }
+
+ surface->pixels = SDL_malloc(surface->h * surface->pitch);
+ if ( !surface->pixels ) {
+ return(SDL_FALSE);
+ }
+ /* fill background with transparent pixels */
+ SDL_memset(surface->pixels, 0, surface->h * surface->pitch);
+
+ dst = surface->pixels;
+ srcbuf = (Uint8 *)(df + 1);
+ for(;;) {
+ /* copy opaque pixels */
+ int ofs = 0;
+ do {
+ unsigned run;
+ if(bpp == 2) {
+ ofs += srcbuf[0];
+ run = srcbuf[1];
+ srcbuf += 2;
+ } else {
+ ofs += ((Uint16 *)srcbuf)[0];
+ run = ((Uint16 *)srcbuf)[1];
+ srcbuf += 4;
+ }
+ if(run) {
+ srcbuf += uncopy_opaque(dst + ofs, srcbuf, run, df, sf);
+ ofs += run;
+ } else if(!ofs)
+ return(SDL_TRUE);
+ } while(ofs < w);
+
+ /* skip padding if needed */
+ if(bpp == 2)
+ srcbuf += (uintptr_t)srcbuf & 2;
+
+ /* copy translucent pixels */
+ ofs = 0;
+ do {
+ unsigned run;
+ ofs += ((Uint16 *)srcbuf)[0];
+ run = ((Uint16 *)srcbuf)[1];
+ srcbuf += 4;
+ if(run) {
+ srcbuf += uncopy_transl(dst + ofs, srcbuf, run, df, sf);
+ ofs += run;
+ }
+ } while(ofs < w);
+ dst += surface->pitch >> 2;
+ }
+ /* Make the compiler happy */
+ return(SDL_TRUE);
+}
+
+void SDL_UnRLESurface(SDL_Surface *surface, int recode)
+{
+ if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) {
+ surface->flags &= ~SDL_RLEACCEL;
+
+ if(recode && (surface->flags & SDL_PREALLOC) != SDL_PREALLOC
+ && (surface->flags & SDL_HWSURFACE) != SDL_HWSURFACE) {
+ if((surface->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY) {
+ SDL_Rect full;
+ unsigned alpha_flag;
+
+ /* re-create the original surface */
+ surface->pixels = SDL_malloc(surface->h * surface->pitch);
+ if ( !surface->pixels ) {
+ /* Oh crap... */
+ surface->flags |= SDL_RLEACCEL;
+ return;
+ }
+
+ /* fill it with the background colour */
+ SDL_FillRect(surface, NULL, surface->format->colorkey);
+
+ /* now render the encoded surface */
+ full.x = full.y = 0;
+ full.w = surface->w;
+ full.h = surface->h;
+ alpha_flag = surface->flags & SDL_SRCALPHA;
+ surface->flags &= ~SDL_SRCALPHA; /* opaque blit */
+ SDL_RLEBlit(surface, &full, surface, &full);
+ surface->flags |= alpha_flag;
+ } else {
+ if ( !UnRLEAlpha(surface) ) {
+ /* Oh crap... */
+ surface->flags |= SDL_RLEACCEL;
+ return;
+ }
+ }
+ }
+
+ if ( surface->map && surface->map->sw_data->aux_data ) {
+ SDL_free(surface->map->sw_data->aux_data);
+ surface->map->sw_data->aux_data = NULL;
+ }
+ }
+}
+
+
diff --git a/distrib/sdl-1.2.15/src/video/SDL_RLEaccel_c.h b/distrib/sdl-1.2.15/src/video/SDL_RLEaccel_c.h
new file mode 100644
index 0000000..daf0c53
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_RLEaccel_c.h
@@ -0,0 +1,31 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Useful functions and variables from SDL_RLEaccel.c */
+
+extern int SDL_RLESurface(SDL_Surface *surface);
+extern int SDL_RLEBlit(SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect);
+extern int SDL_RLEAlphaBlit(SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect);
+extern void SDL_UnRLESurface(SDL_Surface *surface, int recode);
diff --git a/distrib/sdl-1.2.15/src/video/SDL_blit.c b/distrib/sdl-1.2.15/src/video/SDL_blit.c
new file mode 100644
index 0000000..e3f194a
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_blit.c
@@ -0,0 +1,360 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_video.h"
+#include "SDL_sysvideo.h"
+#include "SDL_blit.h"
+#include "SDL_RLEaccel_c.h"
+#include "SDL_pixels_c.h"
+
+#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && SDL_ASSEMBLY_ROUTINES
+#define MMX_ASMBLIT
+#if (__GNUC__ > 2) /* SSE instructions aren't in GCC 2. */
+#define SSE_ASMBLIT
+#endif
+#endif
+
+#if defined(MMX_ASMBLIT)
+#include "SDL_cpuinfo.h"
+#include "mmx.h"
+#endif
+
+/* The general purpose software blit routine */
+static int SDL_SoftBlit(SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect)
+{
+ int okay;
+ int src_locked;
+ int dst_locked;
+
+ /* Everything is okay at the beginning... */
+ okay = 1;
+
+ /* Lock the destination if it's in hardware */
+ dst_locked = 0;
+ if ( SDL_MUSTLOCK(dst) ) {
+ if ( SDL_LockSurface(dst) < 0 ) {
+ okay = 0;
+ } else {
+ dst_locked = 1;
+ }
+ }
+ /* Lock the source if it's in hardware */
+ src_locked = 0;
+ if ( SDL_MUSTLOCK(src) ) {
+ if ( SDL_LockSurface(src) < 0 ) {
+ okay = 0;
+ } else {
+ src_locked = 1;
+ }
+ }
+
+ /* Set up source and destination buffer pointers, and BLIT! */
+ if ( okay && srcrect->w && srcrect->h ) {
+ SDL_BlitInfo info;
+ SDL_loblit RunBlit;
+
+ /* Set up the blit information */
+ info.s_pixels = (Uint8 *)src->pixels +
+ (Uint16)srcrect->y*src->pitch +
+ (Uint16)srcrect->x*src->format->BytesPerPixel;
+ info.s_width = srcrect->w;
+ info.s_height = srcrect->h;
+ info.s_skip=src->pitch-info.s_width*src->format->BytesPerPixel;
+ info.d_pixels = (Uint8 *)dst->pixels +
+ (Uint16)dstrect->y*dst->pitch +
+ (Uint16)dstrect->x*dst->format->BytesPerPixel;
+ info.d_width = dstrect->w;
+ info.d_height = dstrect->h;
+ info.d_skip=dst->pitch-info.d_width*dst->format->BytesPerPixel;
+ info.aux_data = src->map->sw_data->aux_data;
+ info.src = src->format;
+ info.table = src->map->table;
+ info.dst = dst->format;
+ RunBlit = src->map->sw_data->blit;
+
+ /* Run the actual software blit */
+ RunBlit(&info);
+ }
+
+ /* We need to unlock the surfaces if they're locked */
+ if ( dst_locked ) {
+ SDL_UnlockSurface(dst);
+ }
+ if ( src_locked ) {
+ SDL_UnlockSurface(src);
+ }
+ /* Blit is done! */
+ return(okay ? 0 : -1);
+}
+
+#ifdef MMX_ASMBLIT
+static __inline__ void SDL_memcpyMMX(Uint8 *to, const Uint8 *from, int len)
+{
+ int i;
+
+ for(i=0; i<len/8; i++) {
+ __asm__ __volatile__ (
+ " movq (%0), %%mm0\n"
+ " movq %%mm0, (%1)\n"
+ : : "r" (from), "r" (to) : "memory");
+ from+=8;
+ to+=8;
+ }
+ if (len&7)
+ SDL_memcpy(to, from, len&7);
+}
+
+#ifdef SSE_ASMBLIT
+static __inline__ void SDL_memcpySSE(Uint8 *to, const Uint8 *from, int len)
+{
+ int i;
+
+ __asm__ __volatile__ (
+ " prefetchnta (%0)\n"
+ " prefetchnta 64(%0)\n"
+ " prefetchnta 128(%0)\n"
+ " prefetchnta 192(%0)\n"
+ : : "r" (from) );
+
+ for(i=0; i<len/8; i++) {
+ __asm__ __volatile__ (
+ " prefetchnta 256(%0)\n"
+ " movq (%0), %%mm0\n"
+ " movntq %%mm0, (%1)\n"
+ : : "r" (from), "r" (to) : "memory");
+ from+=8;
+ to+=8;
+ }
+ if (len&7)
+ SDL_memcpy(to, from, len&7);
+}
+#endif
+#endif
+
+static void SDL_BlitCopy(SDL_BlitInfo *info)
+{
+ Uint8 *src, *dst;
+ int w, h;
+ int srcskip, dstskip;
+
+ w = info->d_width*info->dst->BytesPerPixel;
+ h = info->d_height;
+ src = info->s_pixels;
+ dst = info->d_pixels;
+ srcskip = w+info->s_skip;
+ dstskip = w+info->d_skip;
+
+#ifdef SSE_ASMBLIT
+ if(SDL_HasSSE())
+ {
+ while ( h-- ) {
+ SDL_memcpySSE(dst, src, w);
+ src += srcskip;
+ dst += dstskip;
+ }
+ __asm__ __volatile__ (
+ " emms\n"
+ ::);
+ }
+ else
+#endif
+#ifdef MMX_ASMBLIT
+ if(SDL_HasMMX())
+ {
+ while ( h-- ) {
+ SDL_memcpyMMX(dst, src, w);
+ src += srcskip;
+ dst += dstskip;
+ }
+ __asm__ __volatile__ (
+ " emms\n"
+ ::);
+ }
+ else
+#endif
+ while ( h-- ) {
+ SDL_memcpy(dst, src, w);
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+
+static void SDL_BlitCopyOverlap(SDL_BlitInfo *info)
+{
+ Uint8 *src, *dst;
+ int w, h;
+ int srcskip, dstskip;
+
+ w = info->d_width*info->dst->BytesPerPixel;
+ h = info->d_height;
+ src = info->s_pixels;
+ dst = info->d_pixels;
+ srcskip = w+info->s_skip;
+ dstskip = w+info->d_skip;
+ if ( dst < src ) {
+ while ( h-- ) {
+ SDL_memmove(dst, src, w);
+ src += srcskip;
+ dst += dstskip;
+ }
+ } else {
+ src += ((h-1) * srcskip);
+ dst += ((h-1) * dstskip);
+ while ( h-- ) {
+ SDL_revcpy(dst, src, w);
+ src -= srcskip;
+ dst -= dstskip;
+ }
+ }
+}
+
+/* Figure out which of many blit routines to set up on a surface */
+int SDL_CalculateBlit(SDL_Surface *surface)
+{
+ int blit_index;
+
+ /* Clean everything out to start */
+ if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) {
+ SDL_UnRLESurface(surface, 1);
+ }
+ surface->map->sw_blit = NULL;
+
+ /* Figure out if an accelerated hardware blit is possible */
+ surface->flags &= ~SDL_HWACCEL;
+ if ( surface->map->identity ) {
+ int hw_blit_ok;
+
+ if ( (surface->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
+ /* We only support accelerated blitting to hardware */
+ if ( surface->map->dst->flags & SDL_HWSURFACE ) {
+ hw_blit_ok = current_video->info.blit_hw;
+ } else {
+ hw_blit_ok = 0;
+ }
+ if (hw_blit_ok && (surface->flags & SDL_SRCCOLORKEY)) {
+ hw_blit_ok = current_video->info.blit_hw_CC;
+ }
+ if ( hw_blit_ok && (surface->flags & SDL_SRCALPHA) ) {
+ hw_blit_ok = current_video->info.blit_hw_A;
+ }
+ } else {
+ /* We only support accelerated blitting to hardware */
+ if ( surface->map->dst->flags & SDL_HWSURFACE ) {
+ hw_blit_ok = current_video->info.blit_sw;
+ } else {
+ hw_blit_ok = 0;
+ }
+ if (hw_blit_ok && (surface->flags & SDL_SRCCOLORKEY)) {
+ hw_blit_ok = current_video->info.blit_sw_CC;
+ }
+ if ( hw_blit_ok && (surface->flags & SDL_SRCALPHA) ) {
+ hw_blit_ok = current_video->info.blit_sw_A;
+ }
+ }
+ if ( hw_blit_ok ) {
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+ video->CheckHWBlit(this, surface, surface->map->dst);
+ }
+ }
+
+ /* if an alpha pixel format is specified, we can accelerate alpha blits */
+ if (((surface->flags & SDL_HWSURFACE) == SDL_HWSURFACE )&&(current_video->displayformatalphapixel))
+ {
+ if ( (surface->flags & SDL_SRCALPHA) )
+ if ( current_video->info.blit_hw_A ) {
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+ video->CheckHWBlit(this, surface, surface->map->dst);
+ }
+ }
+
+ /* Get the blit function index, based on surface mode */
+ /* { 0 = nothing, 1 = colorkey, 2 = alpha, 3 = colorkey+alpha } */
+ blit_index = 0;
+ blit_index |= (!!(surface->flags & SDL_SRCCOLORKEY)) << 0;
+ if ( surface->flags & SDL_SRCALPHA
+ && (surface->format->alpha != SDL_ALPHA_OPAQUE
+ || surface->format->Amask) ) {
+ blit_index |= 2;
+ }
+
+ /* Check for special "identity" case -- copy blit */
+ if ( surface->map->identity && blit_index == 0 ) {
+ surface->map->sw_data->blit = SDL_BlitCopy;
+
+ /* Handle overlapping blits on the same surface */
+ if ( surface == surface->map->dst ) {
+ surface->map->sw_data->blit = SDL_BlitCopyOverlap;
+ }
+ } else {
+ if ( surface->format->BitsPerPixel < 8 ) {
+ surface->map->sw_data->blit =
+ SDL_CalculateBlit0(surface, blit_index);
+ } else {
+ switch ( surface->format->BytesPerPixel ) {
+ case 1:
+ surface->map->sw_data->blit =
+ SDL_CalculateBlit1(surface, blit_index);
+ break;
+ case 2:
+ case 3:
+ case 4:
+ surface->map->sw_data->blit =
+ SDL_CalculateBlitN(surface, blit_index);
+ break;
+ default:
+ surface->map->sw_data->blit = NULL;
+ break;
+ }
+ }
+ }
+ /* Make sure we have a blit function */
+ if ( surface->map->sw_data->blit == NULL ) {
+ SDL_InvalidateMap(surface->map);
+ SDL_SetError("Blit combination not supported");
+ return(-1);
+ }
+
+ /* Choose software blitting function */
+ if(surface->flags & SDL_RLEACCELOK
+ && (surface->flags & SDL_HWACCEL) != SDL_HWACCEL) {
+
+ if(surface->map->identity
+ && (blit_index == 1
+ || (blit_index == 3 && !surface->format->Amask))) {
+ if ( SDL_RLESurface(surface) == 0 )
+ surface->map->sw_blit = SDL_RLEBlit;
+ } else if(blit_index == 2 && surface->format->Amask) {
+ if ( SDL_RLESurface(surface) == 0 )
+ surface->map->sw_blit = SDL_RLEAlphaBlit;
+ }
+ }
+
+ if ( surface->map->sw_blit == NULL ) {
+ surface->map->sw_blit = SDL_SoftBlit;
+ }
+ return(0);
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/SDL_blit.h b/distrib/sdl-1.2.15/src/video/SDL_blit.h
new file mode 100644
index 0000000..d64c1e5
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_blit.h
@@ -0,0 +1,528 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_blit_h
+#define _SDL_blit_h
+
+#include "SDL_endian.h"
+
+/* The structure passed to the low level blit functions */
+typedef struct {
+ Uint8 *s_pixels;
+ int s_width;
+ int s_height;
+ int s_skip;
+ Uint8 *d_pixels;
+ int d_width;
+ int d_height;
+ int d_skip;
+ void *aux_data;
+ SDL_PixelFormat *src;
+ Uint8 *table;
+ SDL_PixelFormat *dst;
+} SDL_BlitInfo;
+
+/* The type definition for the low level blit functions */
+typedef void (*SDL_loblit)(SDL_BlitInfo *info);
+
+/* This is the private info structure for software accelerated blits */
+struct private_swaccel {
+ SDL_loblit blit;
+ void *aux_data;
+};
+
+/* Blit mapping definition */
+typedef struct SDL_BlitMap {
+ SDL_Surface *dst;
+ int identity;
+ Uint8 *table;
+ SDL_blit hw_blit;
+ SDL_blit sw_blit;
+ struct private_hwaccel *hw_data;
+ struct private_swaccel *sw_data;
+
+ /* the version count matches the destination; mismatch indicates
+ an invalid mapping */
+ unsigned int format_version;
+} SDL_BlitMap;
+
+
+/* Functions found in SDL_blit.c */
+extern int SDL_CalculateBlit(SDL_Surface *surface);
+
+/* Functions found in SDL_blit_{0,1,N,A}.c */
+extern SDL_loblit SDL_CalculateBlit0(SDL_Surface *surface, int complex);
+extern SDL_loblit SDL_CalculateBlit1(SDL_Surface *surface, int complex);
+extern SDL_loblit SDL_CalculateBlitN(SDL_Surface *surface, int complex);
+extern SDL_loblit SDL_CalculateAlphaBlit(SDL_Surface *surface, int complex);
+
+/*
+ * Useful macros for blitting routines
+ */
+
+#define FORMAT_EQUAL(A, B) \
+ ((A)->BitsPerPixel == (B)->BitsPerPixel \
+ && ((A)->Rmask == (B)->Rmask) && ((A)->Amask == (B)->Amask))
+
+/* Load pixel of the specified format from a buffer and get its R-G-B values */
+/* FIXME: rescale values to 0..255 here? */
+#define RGB_FROM_PIXEL(Pixel, fmt, r, g, b) \
+{ \
+ r = (((Pixel&fmt->Rmask)>>fmt->Rshift)<<fmt->Rloss); \
+ g = (((Pixel&fmt->Gmask)>>fmt->Gshift)<<fmt->Gloss); \
+ b = (((Pixel&fmt->Bmask)>>fmt->Bshift)<<fmt->Bloss); \
+}
+#define RGB_FROM_RGB565(Pixel, r, g, b) \
+{ \
+ r = (((Pixel&0xF800)>>11)<<3); \
+ g = (((Pixel&0x07E0)>>5)<<2); \
+ b = ((Pixel&0x001F)<<3); \
+}
+#define RGB_FROM_RGB555(Pixel, r, g, b) \
+{ \
+ r = (((Pixel&0x7C00)>>10)<<3); \
+ g = (((Pixel&0x03E0)>>5)<<3); \
+ b = ((Pixel&0x001F)<<3); \
+}
+#define RGB_FROM_RGB888(Pixel, r, g, b) \
+{ \
+ r = ((Pixel&0xFF0000)>>16); \
+ g = ((Pixel&0xFF00)>>8); \
+ b = (Pixel&0xFF); \
+}
+#define RETRIEVE_RGB_PIXEL(buf, bpp, Pixel) \
+do { \
+ switch (bpp) { \
+ case 2: \
+ Pixel = *((Uint16 *)(buf)); \
+ break; \
+ \
+ case 3: { \
+ Uint8 *B = (Uint8 *)(buf); \
+ if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \
+ Pixel = B[0] + (B[1] << 8) + (B[2] << 16); \
+ } else { \
+ Pixel = (B[0] << 16) + (B[1] << 8) + B[2]; \
+ } \
+ } \
+ break; \
+ \
+ case 4: \
+ Pixel = *((Uint32 *)(buf)); \
+ break; \
+ \
+ default: \
+ Pixel = 0; /* appease gcc */ \
+ break; \
+ } \
+} while(0)
+
+#define DISEMBLE_RGB(buf, bpp, fmt, Pixel, r, g, b) \
+do { \
+ switch (bpp) { \
+ case 2: \
+ Pixel = *((Uint16 *)(buf)); \
+ break; \
+ \
+ case 3: { \
+ Uint8 *B = (Uint8 *)buf; \
+ if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \
+ Pixel = B[0] + (B[1] << 8) + (B[2] << 16); \
+ } else { \
+ Pixel = (B[0] << 16) + (B[1] << 8) + B[2]; \
+ } \
+ } \
+ break; \
+ \
+ case 4: \
+ Pixel = *((Uint32 *)(buf)); \
+ break; \
+ \
+ default: \
+ Pixel = 0; /* prevent gcc from complaining */ \
+ break; \
+ } \
+ RGB_FROM_PIXEL(Pixel, fmt, r, g, b); \
+} while(0)
+
+/* Assemble R-G-B values into a specified pixel format and store them */
+#ifdef __NDS__ /* FIXME */
+#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b) \
+{ \
+ Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)| \
+ ((g>>fmt->Gloss)<<fmt->Gshift)| \
+ ((b>>fmt->Bloss)<<fmt->Bshift) | (1<<15); \
+}
+#else
+#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b) \
+{ \
+ Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)| \
+ ((g>>fmt->Gloss)<<fmt->Gshift)| \
+ ((b>>fmt->Bloss)<<fmt->Bshift); \
+}
+#endif /* __NDS__ FIXME */
+#define RGB565_FROM_RGB(Pixel, r, g, b) \
+{ \
+ Pixel = ((r>>3)<<11)|((g>>2)<<5)|(b>>3); \
+}
+#define RGB555_FROM_RGB(Pixel, r, g, b) \
+{ \
+ Pixel = ((r>>3)<<10)|((g>>3)<<5)|(b>>3); \
+}
+#define RGB888_FROM_RGB(Pixel, r, g, b) \
+{ \
+ Pixel = (r<<16)|(g<<8)|b; \
+}
+#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 ASSEMBLE_RGB_AMASK(buf, bpp, fmt, r, g, b, Amask) \
+{ \
+ switch (bpp) { \
+ case 2: { \
+ Uint16 *bufp; \
+ Uint16 Pixel; \
+ \
+ bufp = (Uint16 *)buf; \
+ PIXEL_FROM_RGB(Pixel, fmt, r, g, b); \
+ *bufp = Pixel | (*bufp & Amask); \
+ } \
+ break; \
+ \
+ case 3: { \
+ if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \
+ *((buf)+fmt->Rshift/8) = r; \
+ *((buf)+fmt->Gshift/8) = g; \
+ *((buf)+fmt->Bshift/8) = b; \
+ } else { \
+ *((buf)+2-fmt->Rshift/8) = r; \
+ *((buf)+2-fmt->Gshift/8) = g; \
+ *((buf)+2-fmt->Bshift/8) = b; \
+ } \
+ } \
+ break; \
+ \
+ case 4: { \
+ Uint32 *bufp; \
+ Uint32 Pixel; \
+ \
+ bufp = (Uint32 *)buf; \
+ PIXEL_FROM_RGB(Pixel, fmt, r, g, b); \
+ *bufp = Pixel | (*bufp & Amask); \
+ } \
+ break; \
+ } \
+}
+
+/* FIXME: Should we rescale alpha into 0..255 here? */
+#define RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a) \
+{ \
+ r = ((Pixel&fmt->Rmask)>>fmt->Rshift)<<fmt->Rloss; \
+ g = ((Pixel&fmt->Gmask)>>fmt->Gshift)<<fmt->Gloss; \
+ b = ((Pixel&fmt->Bmask)>>fmt->Bshift)<<fmt->Bloss; \
+ a = ((Pixel&fmt->Amask)>>fmt->Ashift)<<fmt->Aloss; \
+}
+#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_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 DISEMBLE_RGBA(buf, bpp, fmt, Pixel, r, g, b, a) \
+do { \
+ switch (bpp) { \
+ case 2: \
+ Pixel = *((Uint16 *)(buf)); \
+ break; \
+ \
+ case 3: {/* FIXME: broken code (no alpha) */ \
+ Uint8 *b = (Uint8 *)buf; \
+ if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \
+ Pixel = b[0] + (b[1] << 8) + (b[2] << 16); \
+ } else { \
+ Pixel = (b[0] << 16) + (b[1] << 8) + b[2]; \
+ } \
+ } \
+ break; \
+ \
+ case 4: \
+ Pixel = *((Uint32 *)(buf)); \
+ break; \
+ \
+ default: \
+ Pixel = 0; /* stop gcc complaints */ \
+ break; \
+ } \
+ RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a); \
+ Pixel &= ~fmt->Amask; \
+} while(0)
+
+/* FIXME: this isn't correct, especially for Alpha (maximum != 255) */
+#ifdef __NDS__ /* FIXME */
+#define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \
+{ \
+ Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)| \
+ ((g>>fmt->Gloss)<<fmt->Gshift)| \
+ ((b>>fmt->Bloss)<<fmt->Bshift)| \
+ ((a>>fmt->Aloss)<<fmt->Ashift) | (1<<15); \
+}
+#else
+#define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \
+{ \
+ Pixel = ((r>>fmt->Rloss)<<fmt->Rshift)| \
+ ((g>>fmt->Gloss)<<fmt->Gshift)| \
+ ((b>>fmt->Bloss)<<fmt->Bshift)| \
+ ((a>>fmt->Aloss)<<fmt->Ashift); \
+}
+#endif /* __NDS__ FIXME */
+#define ASSEMBLE_RGBA(buf, bpp, fmt, r, g, b, a) \
+{ \
+ switch (bpp) { \
+ case 2: { \
+ Uint16 Pixel; \
+ \
+ PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a); \
+ *((Uint16 *)(buf)) = Pixel; \
+ } \
+ break; \
+ \
+ case 3: { /* FIXME: broken code (no alpha) */ \
+ if(SDL_BYTEORDER == SDL_LIL_ENDIAN) { \
+ *((buf)+fmt->Rshift/8) = r; \
+ *((buf)+fmt->Gshift/8) = g; \
+ *((buf)+fmt->Bshift/8) = b; \
+ } else { \
+ *((buf)+2-fmt->Rshift/8) = r; \
+ *((buf)+2-fmt->Gshift/8) = g; \
+ *((buf)+2-fmt->Bshift/8) = b; \
+ } \
+ } \
+ break; \
+ \
+ case 4: { \
+ Uint32 Pixel; \
+ \
+ PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a); \
+ *((Uint32 *)(buf)) = Pixel; \
+ } \
+ break; \
+ } \
+}
+
+/* Blend the RGB values of two Pixels based on a source alpha value */
+#define ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB) \
+do { \
+ dR = (((sR-dR)*(A)+255)>>8)+dR; \
+ dG = (((sG-dG)*(A)+255)>>8)+dG; \
+ dB = (((sB-dB)*(A)+255)>>8)+dB; \
+} while(0)
+
+
+/* This is a very useful loop for optimizing blitters */
+#if defined(_MSC_VER) && (_MSC_VER == 1300)
+/* There's a bug in the Visual C++ 7 optimizer when compiling this code */
+#else
+#define USE_DUFFS_LOOP
+#endif
+#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 ); \
+ } \
+}
+
+/* 4-times unrolled loop */
+#define DUFFS_LOOP4(pixel_copy_increment, width) \
+{ int n = (width+3)/4; \
+ switch (width & 3) { \
+ case 0: do { pixel_copy_increment; \
+ case 3: pixel_copy_increment; \
+ case 2: pixel_copy_increment; \
+ case 1: pixel_copy_increment; \
+ } while ( --n > 0 ); \
+ } \
+}
+
+/* 2 - times unrolled loop */
+#define DUFFS_LOOP_DOUBLE2(pixel_copy_increment, \
+ double_pixel_copy_increment, width) \
+{ int n, w = width; \
+ if( w & 1 ) { \
+ pixel_copy_increment; \
+ w--; \
+ } \
+ if ( w > 0 ) { \
+ n = ( w + 2) / 4; \
+ switch( w & 2 ) { \
+ case 0: do { double_pixel_copy_increment; \
+ case 2: double_pixel_copy_increment; \
+ } while ( --n > 0 ); \
+ } \
+ } \
+}
+
+/* 2 - times unrolled loop 4 pixels */
+#define DUFFS_LOOP_QUATRO2(pixel_copy_increment, \
+ double_pixel_copy_increment, \
+ quatro_pixel_copy_increment, width) \
+{ int n, w = width; \
+ if(w & 1) { \
+ pixel_copy_increment; \
+ w--; \
+ } \
+ if(w & 2) { \
+ double_pixel_copy_increment; \
+ w -= 2; \
+ } \
+ if ( w > 0 ) { \
+ n = ( w + 7 ) / 8; \
+ switch( w & 4 ) { \
+ case 0: do { quatro_pixel_copy_increment; \
+ case 4: quatro_pixel_copy_increment; \
+ } while ( --n > 0 ); \
+ } \
+ } \
+}
+
+/* Use the 8-times version of the loop by default */
+#define DUFFS_LOOP(pixel_copy_increment, width) \
+ DUFFS_LOOP8(pixel_copy_increment, width)
+
+#else
+
+/* Don't use Duff's device to unroll loops */
+#define DUFFS_LOOP_DOUBLE2(pixel_copy_increment, \
+ double_pixel_copy_increment, width) \
+{ int n = width; \
+ if( n & 1 ) { \
+ pixel_copy_increment; \
+ n--; \
+ } \
+ n=n>>1; \
+ for(; n > 0; --n) { \
+ double_pixel_copy_increment; \
+ } \
+}
+
+/* Don't use Duff's device to unroll loops */
+#define DUFFS_LOOP_QUATRO2(pixel_copy_increment, \
+ double_pixel_copy_increment, \
+ quatro_pixel_copy_increment, width) \
+{ int n = width; \
+ if(n & 1) { \
+ pixel_copy_increment; \
+ n--; \
+ } \
+ if(n & 2) { \
+ double_pixel_copy_increment; \
+ n -= 2; \
+ } \
+ n=n>>2; \
+ for(; n > 0; --n) { \
+ quatro_pixel_copy_increment; \
+ } \
+}
+
+/* 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_LOOP8(pixel_copy_increment, width) \
+ DUFFS_LOOP(pixel_copy_increment, width)
+#define DUFFS_LOOP4(pixel_copy_increment, width) \
+ DUFFS_LOOP(pixel_copy_increment, width)
+
+#endif /* USE_DUFFS_LOOP */
+
+/* Prevent Visual C++ 6.0 from printing out stupid warnings */
+#if defined(_MSC_VER) && (_MSC_VER >= 600)
+#pragma warning(disable: 4550)
+#endif
+
+#endif /* _SDL_blit_h */
diff --git a/distrib/sdl-1.2.15/src/video/SDL_blit_0.c b/distrib/sdl-1.2.15/src/video/SDL_blit_0.c
new file mode 100644
index 0000000..c1bc0eb
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_blit_0.c
@@ -0,0 +1,471 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_video.h"
+#include "SDL_blit.h"
+
+/* Functions to blit from bitmaps to other surfaces */
+
+static void BlitBto1(SDL_BlitInfo *info)
+{
+ int c;
+ int width, height;
+ Uint8 *src, *map, *dst;
+ int srcskip, dstskip;
+
+ /* Set up some basic variables */
+ width = info->d_width;
+ height = info->d_height;
+ src = info->s_pixels;
+ srcskip = info->s_skip;
+ dst = info->d_pixels;
+ dstskip = info->d_skip;
+ map = info->table;
+ srcskip += width-(width+7)/8;
+
+ if ( map ) {
+ while ( height-- ) {
+ Uint8 byte = 0, bit;
+ for ( c=0; c<width; ++c ) {
+ if ( (c&7) == 0 ) {
+ byte = *src++;
+ }
+ bit = (byte&0x80)>>7;
+ if ( 1 ) {
+ *dst = map[bit];
+ }
+ dst++;
+ byte <<= 1;
+ }
+ src += srcskip;
+ dst += dstskip;
+ }
+ } else {
+ while ( height-- ) {
+ Uint8 byte = 0, bit;
+ for ( c=0; c<width; ++c ) {
+ if ( (c&7) == 0 ) {
+ byte = *src++;
+ }
+ bit = (byte&0x80)>>7;
+ if ( 1 ) {
+ *dst = bit;
+ }
+ dst++;
+ byte <<= 1;
+ }
+ src += srcskip;
+ dst += dstskip;
+ }
+ }
+}
+static void BlitBto2(SDL_BlitInfo *info)
+{
+ int c;
+ int width, height;
+ Uint8 *src;
+ Uint16 *map, *dst;
+ int srcskip, dstskip;
+
+ /* Set up some basic variables */
+ width = info->d_width;
+ height = info->d_height;
+ src = info->s_pixels;
+ srcskip = info->s_skip;
+ dst = (Uint16 *)info->d_pixels;
+ dstskip = info->d_skip/2;
+ map = (Uint16 *)info->table;
+ srcskip += width-(width+7)/8;
+
+ while ( height-- ) {
+ Uint8 byte = 0, bit;
+ for ( c=0; c<width; ++c ) {
+ if ( (c&7) == 0 ) {
+ byte = *src++;
+ }
+ bit = (byte&0x80)>>7;
+ if ( 1 ) {
+ *dst = map[bit];
+ }
+ byte <<= 1;
+ dst++;
+ }
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+static void BlitBto3(SDL_BlitInfo *info)
+{
+ int c, o;
+ int width, height;
+ Uint8 *src, *map, *dst;
+ int srcskip, dstskip;
+
+ /* Set up some basic variables */
+ width = info->d_width;
+ height = info->d_height;
+ src = info->s_pixels;
+ srcskip = info->s_skip;
+ dst = info->d_pixels;
+ dstskip = info->d_skip;
+ map = info->table;
+ srcskip += width-(width+7)/8;
+
+ while ( height-- ) {
+ Uint8 byte = 0, bit;
+ for ( c=0; c<width; ++c ) {
+ if ( (c&7) == 0 ) {
+ byte = *src++;
+ }
+ bit = (byte&0x80)>>7;
+ if ( 1 ) {
+ o = bit * 4;
+ dst[0] = map[o++];
+ dst[1] = map[o++];
+ dst[2] = map[o++];
+ }
+ byte <<= 1;
+ dst += 3;
+ }
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+static void BlitBto4(SDL_BlitInfo *info)
+{
+ int width, height;
+ Uint8 *src;
+ Uint32 *map, *dst;
+ int srcskip, dstskip;
+ int c;
+
+ /* Set up some basic variables */
+ width = info->d_width;
+ height = info->d_height;
+ src = info->s_pixels;
+ srcskip = info->s_skip;
+ dst = (Uint32 *)info->d_pixels;
+ dstskip = info->d_skip/4;
+ map = (Uint32 *)info->table;
+ srcskip += width-(width+7)/8;
+
+ while ( height-- ) {
+ Uint8 byte = 0, bit;
+ for ( c=0; c<width; ++c ) {
+ if ( (c&7) == 0 ) {
+ byte = *src++;
+ }
+ bit = (byte&0x80)>>7;
+ if ( 1 ) {
+ *dst = map[bit];
+ }
+ byte <<= 1;
+ dst++;
+ }
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+
+static void BlitBto1Key(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ Uint8 *dst = info->d_pixels;
+ int srcskip = info->s_skip;
+ int dstskip = info->d_skip;
+ Uint32 ckey = info->src->colorkey;
+ Uint8 *palmap = info->table;
+ int c;
+
+ /* Set up some basic variables */
+ srcskip += width-(width+7)/8;
+
+ if ( palmap ) {
+ while ( height-- ) {
+ Uint8 byte = 0, bit;
+ for ( c=0; c<width; ++c ) {
+ if ( (c&7) == 0 ) {
+ byte = *src++;
+ }
+ bit = (byte&0x80)>>7;
+ if ( bit != ckey ) {
+ *dst = palmap[bit];
+ }
+ dst++;
+ byte <<= 1;
+ }
+ src += srcskip;
+ dst += dstskip;
+ }
+ } else {
+ while ( height-- ) {
+ Uint8 byte = 0, bit;
+ for ( c=0; c<width; ++c ) {
+ if ( (c&7) == 0 ) {
+ byte = *src++;
+ }
+ bit = (byte&0x80)>>7;
+ if ( bit != ckey ) {
+ *dst = bit;
+ }
+ dst++;
+ byte <<= 1;
+ }
+ src += srcskip;
+ dst += dstskip;
+ }
+ }
+}
+
+static void BlitBto2Key(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ Uint16 *dstp = (Uint16 *)info->d_pixels;
+ int srcskip = info->s_skip;
+ int dstskip = info->d_skip;
+ Uint32 ckey = info->src->colorkey;
+ Uint8 *palmap = info->table;
+ int c;
+
+ /* Set up some basic variables */
+ srcskip += width-(width+7)/8;
+ dstskip /= 2;
+
+ while ( height-- ) {
+ Uint8 byte = 0, bit;
+ for ( c=0; c<width; ++c ) {
+ if ( (c&7) == 0 ) {
+ byte = *src++;
+ }
+ bit = (byte&0x80)>>7;
+ if ( bit != ckey ) {
+ *dstp=((Uint16 *)palmap)[bit];
+ }
+ byte <<= 1;
+ dstp++;
+ }
+ src += srcskip;
+ dstp += dstskip;
+ }
+}
+
+static void BlitBto3Key(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ Uint8 *dst = info->d_pixels;
+ int srcskip = info->s_skip;
+ int dstskip = info->d_skip;
+ Uint32 ckey = info->src->colorkey;
+ Uint8 *palmap = info->table;
+ int c;
+
+ /* Set up some basic variables */
+ srcskip += width-(width+7)/8;
+
+ while ( height-- ) {
+ Uint8 byte = 0, bit;
+ for ( c=0; c<width; ++c ) {
+ if ( (c&7) == 0 ) {
+ byte = *src++;
+ }
+ bit = (byte&0x80)>>7;
+ if ( bit != ckey ) {
+ SDL_memcpy(dst, &palmap[bit*4], 3);
+ }
+ byte <<= 1;
+ dst += 3;
+ }
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+
+static void BlitBto4Key(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ Uint32 *dstp = (Uint32 *)info->d_pixels;
+ int srcskip = info->s_skip;
+ int dstskip = info->d_skip;
+ Uint32 ckey = info->src->colorkey;
+ Uint8 *palmap = info->table;
+ int c;
+
+ /* Set up some basic variables */
+ srcskip += width-(width+7)/8;
+ dstskip /= 4;
+
+ while ( height-- ) {
+ Uint8 byte = 0, bit;
+ for ( c=0; c<width; ++c ) {
+ if ( (c&7) == 0 ) {
+ byte = *src++;
+ }
+ bit = (byte&0x80)>>7;
+ if ( bit != ckey ) {
+ *dstp=((Uint32 *)palmap)[bit];
+ }
+ byte <<= 1;
+ dstp++;
+ }
+ src += srcskip;
+ dstp += dstskip;
+ }
+}
+
+static void BlitBtoNAlpha(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ Uint8 *dst = info->d_pixels;
+ int srcskip = info->s_skip;
+ int dstskip = info->d_skip;
+ const SDL_Color *srcpal = info->src->palette->colors;
+ SDL_PixelFormat *dstfmt = info->dst;
+ int dstbpp;
+ int c;
+ const int A = info->src->alpha;
+
+ /* Set up some basic variables */
+ dstbpp = dstfmt->BytesPerPixel;
+ srcskip += width-(width+7)/8;
+
+ while ( height-- ) {
+ Uint8 byte = 0, bit;
+ for ( c=0; c<width; ++c ) {
+ if ( (c&7) == 0 ) {
+ byte = *src++;
+ }
+ 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);
+ }
+ byte <<= 1;
+ dst += dstbpp;
+ }
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+
+static void BlitBtoNAlphaKey(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ Uint8 *dst = info->d_pixels;
+ int srcskip = info->s_skip;
+ int dstskip = info->d_skip;
+ SDL_PixelFormat *srcfmt = info->src;
+ SDL_PixelFormat *dstfmt = info->dst;
+ const SDL_Color *srcpal = srcfmt->palette->colors;
+ int dstbpp;
+ int c;
+ const int A = srcfmt->alpha;
+ Uint32 ckey = srcfmt->colorkey;
+
+ /* Set up some basic variables */
+ dstbpp = dstfmt->BytesPerPixel;
+ srcskip += width-(width+7)/8;
+
+ while ( height-- ) {
+ Uint8 byte = 0, bit;
+ for ( c=0; c<width; ++c ) {
+ if ( (c&7) == 0 ) {
+ byte = *src++;
+ }
+ 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);
+ }
+ byte <<= 1;
+ dst += dstbpp;
+ }
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+
+static SDL_loblit bitmap_blit[] = {
+ NULL, BlitBto1, BlitBto2, BlitBto3, BlitBto4
+};
+
+static SDL_loblit colorkey_blit[] = {
+ NULL, BlitBto1Key, BlitBto2Key, BlitBto3Key, BlitBto4Key
+};
+
+SDL_loblit SDL_CalculateBlit0(SDL_Surface *surface, int blit_index)
+{
+ int which;
+
+ if ( surface->format->BitsPerPixel != 1 ) {
+ /* We don't support sub 8-bit packed pixel modes */
+ return NULL;
+ }
+ if ( surface->map->dst->format->BitsPerPixel < 8 ) {
+ which = 0;
+ } else {
+ which = surface->map->dst->format->BytesPerPixel;
+ }
+ switch(blit_index) {
+ case 0: /* copy */
+ return bitmap_blit[which];
+
+ case 1: /* colorkey */
+ return colorkey_blit[which];
+
+ case 2: /* alpha */
+ return which >= 2 ? BlitBtoNAlpha : NULL;
+
+ case 4: /* alpha + colorkey */
+ return which >= 2 ? BlitBtoNAlphaKey : NULL;
+ }
+ return NULL;
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/SDL_blit_1.c b/distrib/sdl-1.2.15/src/video/SDL_blit_1.c
new file mode 100644
index 0000000..7f95f5b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_blit_1.c
@@ -0,0 +1,523 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_video.h"
+#include "SDL_blit.h"
+#include "SDL_sysvideo.h"
+#include "SDL_endian.h"
+
+/* Functions to blit from 8-bit surfaces to other surfaces */
+
+static void Blit1to1(SDL_BlitInfo *info)
+{
+#ifndef USE_DUFFS_LOOP
+ int c;
+#endif
+ int width, height;
+ Uint8 *src, *map, *dst;
+ int srcskip, dstskip;
+
+ /* Set up some basic variables */
+ width = info->d_width;
+ height = info->d_height;
+ src = info->s_pixels;
+ srcskip = info->s_skip;
+ dst = info->d_pixels;
+ dstskip = info->d_skip;
+ map = info->table;
+
+ while ( height-- ) {
+#ifdef USE_DUFFS_LOOP
+ DUFFS_LOOP(
+ {
+ *dst = map[*src];
+ }
+ dst++;
+ src++;
+ , width);
+#else
+ for ( c=width; c; --c ) {
+ *dst = map[*src];
+ dst++;
+ src++;
+ }
+#endif
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+/* This is now endian dependent */
+#if ( SDL_BYTEORDER == SDL_LIL_ENDIAN )
+#define HI 1
+#define LO 0
+#else /* ( SDL_BYTEORDER == SDL_BIG_ENDIAN ) */
+#define HI 0
+#define LO 1
+#endif
+static void Blit1to2(SDL_BlitInfo *info)
+{
+#ifndef USE_DUFFS_LOOP
+ int c;
+#endif
+ int width, height;
+ Uint8 *src, *dst;
+ Uint16 *map;
+ int srcskip, dstskip;
+
+ /* Set up some basic variables */
+ width = info->d_width;
+ height = info->d_height;
+ src = info->s_pixels;
+ srcskip = info->s_skip;
+ dst = info->d_pixels;
+ dstskip = info->d_skip;
+ map = (Uint16 *)info->table;
+
+#ifdef USE_DUFFS_LOOP
+ while ( height-- ) {
+ DUFFS_LOOP(
+ {
+ *(Uint16 *)dst = map[*src++];
+ dst += 2;
+ },
+ width);
+ src += srcskip;
+ dst += dstskip;
+ }
+#else
+ /* Memory align at 4-byte boundary, if necessary */
+ if ( (long)dst & 0x03 ) {
+ /* Don't do anything if width is 0 */
+ if ( width == 0 ) {
+ return;
+ }
+ --width;
+
+ while ( height-- ) {
+ /* Perform copy alignment */
+ *(Uint16 *)dst = map[*src++];
+ dst += 2;
+
+ /* Copy in 4 pixel chunks */
+ for ( c=width/4; c; --c ) {
+ *(Uint32 *)dst =
+ (map[src[HI]]<<16)|(map[src[LO]]);
+ src += 2;
+ dst += 4;
+ *(Uint32 *)dst =
+ (map[src[HI]]<<16)|(map[src[LO]]);
+ src += 2;
+ dst += 4;
+ }
+ /* Get any leftovers */
+ switch (width & 3) {
+ case 3:
+ *(Uint16 *)dst = map[*src++];
+ dst += 2;
+ case 2:
+ *(Uint32 *)dst =
+ (map[src[HI]]<<16)|(map[src[LO]]);
+ src += 2;
+ dst += 4;
+ break;
+ case 1:
+ *(Uint16 *)dst = map[*src++];
+ dst += 2;
+ break;
+ }
+ src += srcskip;
+ dst += dstskip;
+ }
+ } else {
+ while ( height-- ) {
+ /* Copy in 4 pixel chunks */
+ for ( c=width/4; c; --c ) {
+ *(Uint32 *)dst =
+ (map[src[HI]]<<16)|(map[src[LO]]);
+ src += 2;
+ dst += 4;
+ *(Uint32 *)dst =
+ (map[src[HI]]<<16)|(map[src[LO]]);
+ src += 2;
+ dst += 4;
+ }
+ /* Get any leftovers */
+ switch (width & 3) {
+ case 3:
+ *(Uint16 *)dst = map[*src++];
+ dst += 2;
+ case 2:
+ *(Uint32 *)dst =
+ (map[src[HI]]<<16)|(map[src[LO]]);
+ src += 2;
+ dst += 4;
+ break;
+ case 1:
+ *(Uint16 *)dst = map[*src++];
+ dst += 2;
+ break;
+ }
+ src += srcskip;
+ dst += dstskip;
+ }
+ }
+#endif /* USE_DUFFS_LOOP */
+}
+static void Blit1to3(SDL_BlitInfo *info)
+{
+#ifndef USE_DUFFS_LOOP
+ int c;
+#endif
+ int o;
+ int width, height;
+ Uint8 *src, *map, *dst;
+ int srcskip, dstskip;
+
+ /* Set up some basic variables */
+ width = info->d_width;
+ height = info->d_height;
+ src = info->s_pixels;
+ srcskip = info->s_skip;
+ dst = info->d_pixels;
+ dstskip = info->d_skip;
+ map = info->table;
+
+ while ( height-- ) {
+#ifdef USE_DUFFS_LOOP
+ DUFFS_LOOP(
+ {
+ o = *src * 4;
+ dst[0] = map[o++];
+ dst[1] = map[o++];
+ dst[2] = map[o++];
+ }
+ src++;
+ dst += 3;
+ , width);
+#else
+ for ( c=width; c; --c ) {
+ o = *src * 4;
+ dst[0] = map[o++];
+ dst[1] = map[o++];
+ dst[2] = map[o++];
+ src++;
+ dst += 3;
+ }
+#endif /* USE_DUFFS_LOOP */
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+static void Blit1to4(SDL_BlitInfo *info)
+{
+#ifndef USE_DUFFS_LOOP
+ int c;
+#endif
+ int width, height;
+ Uint8 *src;
+ Uint32 *map, *dst;
+ int srcskip, dstskip;
+
+ /* Set up some basic variables */
+ width = info->d_width;
+ height = info->d_height;
+ src = info->s_pixels;
+ srcskip = info->s_skip;
+ dst = (Uint32 *)info->d_pixels;
+ dstskip = info->d_skip/4;
+ map = (Uint32 *)info->table;
+
+ while ( height-- ) {
+#ifdef USE_DUFFS_LOOP
+ DUFFS_LOOP(
+ *dst++ = map[*src++];
+ , width);
+#else
+ for ( c=width/4; c; --c ) {
+ *dst++ = map[*src++];
+ *dst++ = map[*src++];
+ *dst++ = map[*src++];
+ *dst++ = map[*src++];
+ }
+ switch ( width & 3 ) {
+ case 3:
+ *dst++ = map[*src++];
+ case 2:
+ *dst++ = map[*src++];
+ case 1:
+ *dst++ = map[*src++];
+ }
+#endif /* USE_DUFFS_LOOP */
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+
+static void Blit1to1Key(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint8 *dst = info->d_pixels;
+ int dstskip = info->d_skip;
+ Uint8 *palmap = info->table;
+ Uint32 ckey = info->src->colorkey;
+
+ if ( palmap ) {
+ while ( height-- ) {
+ DUFFS_LOOP(
+ {
+ if ( *src != ckey ) {
+ *dst = palmap[*src];
+ }
+ dst++;
+ src++;
+ },
+ width);
+ src += srcskip;
+ dst += dstskip;
+ }
+ } else {
+ while ( height-- ) {
+ DUFFS_LOOP(
+ {
+ if ( *src != ckey ) {
+ *dst = *src;
+ }
+ dst++;
+ src++;
+ },
+ width);
+ src += srcskip;
+ dst += dstskip;
+ }
+ }
+}
+
+static void Blit1to2Key(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint16 *dstp = (Uint16 *)info->d_pixels;
+ int dstskip = info->d_skip;
+ Uint16 *palmap = (Uint16 *)info->table;
+ Uint32 ckey = info->src->colorkey;
+
+ /* Set up some basic variables */
+ dstskip /= 2;
+
+ while ( height-- ) {
+ DUFFS_LOOP(
+ {
+ if ( *src != ckey ) {
+ *dstp=palmap[*src];
+ }
+ src++;
+ dstp++;
+ },
+ width);
+ src += srcskip;
+ dstp += dstskip;
+ }
+}
+
+static void Blit1to3Key(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint8 *dst = info->d_pixels;
+ int dstskip = info->d_skip;
+ Uint8 *palmap = info->table;
+ Uint32 ckey = info->src->colorkey;
+ int o;
+
+ while ( height-- ) {
+ DUFFS_LOOP(
+ {
+ if ( *src != ckey ) {
+ o = *src * 4;
+ dst[0] = palmap[o++];
+ dst[1] = palmap[o++];
+ dst[2] = palmap[o++];
+ }
+ src++;
+ dst += 3;
+ },
+ width);
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+
+static void Blit1to4Key(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint32 *dstp = (Uint32 *)info->d_pixels;
+ int dstskip = info->d_skip;
+ Uint32 *palmap = (Uint32 *)info->table;
+ Uint32 ckey = info->src->colorkey;
+
+ /* Set up some basic variables */
+ dstskip /= 4;
+
+ while ( height-- ) {
+ DUFFS_LOOP(
+ {
+ if ( *src != ckey ) {
+ *dstp = palmap[*src];
+ }
+ src++;
+ dstp++;
+ },
+ width);
+ src += srcskip;
+ dstp += dstskip;
+ }
+}
+
+static void Blit1toNAlpha(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint8 *dst = info->d_pixels;
+ int dstskip = info->d_skip;
+ SDL_PixelFormat *dstfmt = info->dst;
+ const SDL_Color *srcpal = info->src->palette->colors;
+ int dstbpp;
+ const int A = info->src->alpha;
+
+ /* Set up some basic variables */
+ dstbpp = dstfmt->BytesPerPixel;
+
+ while ( height-- ) {
+ int sR, sG, sB;
+ int dR, dG, dB;
+ DUFFS_LOOP4(
+ {
+ Uint32 pixel;
+ sR = srcpal[*src].r;
+ sG = srcpal[*src].g;
+ sB = srcpal[*src].b;
+ DISEMBLE_RGB(dst, dstbpp, dstfmt,
+ pixel, dR, dG, dB);
+ ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB);
+ ASSEMBLE_RGB(dst, dstbpp, dstfmt, dR, dG, dB);
+ src++;
+ dst += dstbpp;
+ },
+ width);
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+
+static void Blit1toNAlphaKey(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint8 *dst = info->d_pixels;
+ int dstskip = info->d_skip;
+ SDL_PixelFormat *srcfmt = info->src;
+ SDL_PixelFormat *dstfmt = info->dst;
+ const SDL_Color *srcpal = info->src->palette->colors;
+ Uint32 ckey = srcfmt->colorkey;
+ int dstbpp;
+ const int A = srcfmt->alpha;
+
+ /* Set up some basic variables */
+ dstbpp = dstfmt->BytesPerPixel;
+
+ while ( height-- ) {
+ int sR, sG, sB;
+ int dR, dG, dB;
+ 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);
+ }
+ src++;
+ dst += dstbpp;
+ },
+ width);
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+
+static SDL_loblit one_blit[] = {
+ NULL, Blit1to1, Blit1to2, Blit1to3, Blit1to4
+};
+
+static SDL_loblit one_blitkey[] = {
+ NULL, Blit1to1Key, Blit1to2Key, Blit1to3Key, Blit1to4Key
+};
+
+SDL_loblit SDL_CalculateBlit1(SDL_Surface *surface, int blit_index)
+{
+ int which;
+ SDL_PixelFormat *dstfmt;
+
+ dstfmt = surface->map->dst->format;
+ if ( dstfmt->BitsPerPixel < 8 ) {
+ which = 0;
+ } else {
+ which = dstfmt->BytesPerPixel;
+ }
+ switch(blit_index) {
+ case 0: /* copy */
+ return one_blit[which];
+
+ case 1: /* colorkey */
+ return one_blitkey[which];
+
+ case 2: /* alpha */
+ /* Supporting 8bpp->8bpp alpha is doable but requires lots of
+ tables which consume space and takes time to precompute,
+ so is better left to the user */
+ return which >= 2 ? Blit1toNAlpha : NULL;
+
+ case 3: /* alpha + colorkey */
+ return which >= 2 ? Blit1toNAlphaKey : NULL;
+
+ }
+ return NULL;
+}
diff --git a/distrib/sdl-1.2.15/src/video/SDL_blit_A.c b/distrib/sdl-1.2.15/src/video/SDL_blit_A.c
new file mode 100644
index 0000000..219cdcc
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_blit_A.c
@@ -0,0 +1,2873 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_video.h"
+#include "SDL_blit.h"
+
+/*
+ In Visual C, VC6 has mmintrin.h in the "Processor Pack" add-on.
+ Checking if _mm_free is #defined in malloc.h is is the only way to
+ determine if the Processor Pack is installed, as far as I can tell.
+*/
+
+#if SDL_ASSEMBLY_ROUTINES
+# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
+ /* forced MMX to 0...it breaks on most compilers now. --ryan. */
+# define MMX_ASMBLIT 0
+# define GCC_ASMBLIT 0
+# elif defined(_MSC_VER) && defined(_M_IX86)
+# if (_MSC_VER <= 1200)
+# include <malloc.h>
+# if defined(_mm_free)
+# define HAVE_MMINTRIN_H 1
+# endif
+# else /* Visual Studio > VC6 always has mmintrin.h */
+# define HAVE_MMINTRIN_H 1
+# endif
+# if HAVE_MMINTRIN_H
+# define MMX_ASMBLIT 1
+# define MSVC_ASMBLIT 1
+# endif
+# endif
+#endif /* SDL_ASSEMBLY_ROUTINES */
+
+/* Function to check the CPU flags */
+#include "SDL_cpuinfo.h"
+#if GCC_ASMBLIT
+#include "mmx.h"
+#elif MSVC_ASMBLIT
+#include <mmintrin.h>
+#include <mm3dnow.h>
+#endif
+
+/* Functions to perform alpha blended blitting */
+
+/* N->1 blending with per-surface alpha */
+static void BlitNto1SurfaceAlpha(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint8 *dst = info->d_pixels;
+ int dstskip = info->d_skip;
+ Uint8 *palmap = info->table;
+ SDL_PixelFormat *srcfmt = info->src;
+ SDL_PixelFormat *dstfmt = info->dst;
+ int srcbpp = srcfmt->BytesPerPixel;
+
+ const unsigned A = srcfmt->alpha;
+
+ while ( height-- ) {
+ 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);
+ 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));
+ } else {
+ *dst = palmap[((dR>>5)<<(3+2))|
+ ((dG>>5)<<(2)) |
+ ((dB>>6)<<(0))];
+ }
+ dst++;
+ src += srcbpp;
+ },
+ width);
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+
+/* N->1 blending with pixel alpha */
+static void BlitNto1PixelAlpha(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint8 *dst = info->d_pixels;
+ int dstskip = info->d_skip;
+ Uint8 *palmap = info->table;
+ SDL_PixelFormat *srcfmt = info->src;
+ SDL_PixelFormat *dstfmt = info->dst;
+ int srcbpp = srcfmt->BytesPerPixel;
+
+ /* FIXME: fix alpha bit field expansion here too? */
+ while ( height-- ) {
+ 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);
+ 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));
+ } else {
+ *dst = palmap[((dR>>5)<<(3+2))|
+ ((dG>>5)<<(2)) |
+ ((dB>>6)<<(0)) ];
+ }
+ dst++;
+ src += srcbpp;
+ },
+ width);
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+
+/* colorkeyed N->1 blending with per-surface alpha */
+static void BlitNto1SurfaceAlphaKey(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint8 *dst = info->d_pixels;
+ int dstskip = info->d_skip;
+ Uint8 *palmap = info->table;
+ SDL_PixelFormat *srcfmt = info->src;
+ SDL_PixelFormat *dstfmt = info->dst;
+ int srcbpp = srcfmt->BytesPerPixel;
+ Uint32 ckey = srcfmt->colorkey;
+
+ const int A = srcfmt->alpha;
+
+ while ( height-- ) {
+ 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);
+ 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));
+ } else {
+ *dst = palmap[((dR>>5)<<(3+2))|
+ ((dG>>5)<<(2)) |
+ ((dB>>6)<<(0)) ];
+ }
+ }
+ dst++;
+ src += srcbpp;
+ },
+ width);
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+
+#if GCC_ASMBLIT
+/* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */
+static void BlitRGBtoRGBSurfaceAlpha128MMX(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint32 *srcp = (Uint32 *)info->s_pixels;
+ int srcskip = info->s_skip >> 2;
+ Uint32 *dstp = (Uint32 *)info->d_pixels;
+ int dstskip = info->d_skip >> 2;
+ Uint32 dalpha = info->dst->Amask;
+ Uint64 load;
+
+ load = 0x00fefefe00fefefeULL;/* alpha128 mask */
+ movq_m2r(load, mm4); /* alpha128 mask -> mm4 */
+ load = 0x0001010100010101ULL;/* !alpha128 mask */
+ movq_m2r(load, mm3); /* !alpha128 mask -> mm3 */
+ movd_m2r(dalpha, mm7); /* dst alpha mask */
+ punpckldq_r2r(mm7, mm7); /* dst alpha mask | dst alpha mask -> mm7 */
+ while(height--) {
+ DUFFS_LOOP_DOUBLE2(
+ {
+ Uint32 s = *srcp++;
+ Uint32 d = *dstp;
+ *dstp++ = ((((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1)
+ + (s & d & 0x00010101)) | dalpha;
+ },{
+ movq_m2r((*dstp), mm2);/* 2 x dst -> mm2(ARGBARGB) */
+ movq_r2r(mm2, mm6); /* 2 x dst -> mm6(ARGBARGB) */
+
+ movq_m2r((*srcp), mm1);/* 2 x src -> mm1(ARGBARGB) */
+ movq_r2r(mm1, mm5); /* 2 x src -> mm5(ARGBARGB) */
+
+ pand_r2r(mm4, mm6); /* dst & mask -> mm6 */
+ pand_r2r(mm4, mm5); /* src & mask -> mm5 */
+ paddd_r2r(mm6, mm5); /* mm6 + mm5 -> mm5 */
+ pand_r2r(mm1, mm2); /* src & dst -> mm2 */
+ psrld_i2r(1, mm5); /* mm5 >> 1 -> mm5 */
+ pand_r2r(mm3, mm2); /* mm2 & !mask -> mm2 */
+ paddd_r2r(mm5, mm2); /* mm5 + mm2 -> mm2 */
+
+ por_r2r(mm7, mm2); /* mm7(full alpha) | mm2 -> mm2 */
+ movq_r2m(mm2, (*dstp));/* mm2 -> 2 x dst pixels */
+ dstp += 2;
+ srcp += 2;
+ }, width);
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+ emms();
+}
+
+/* fast RGB888->(A)RGB888 blending with surface alpha */
+static void BlitRGBtoRGBSurfaceAlphaMMX(SDL_BlitInfo *info)
+{
+ SDL_PixelFormat* df = info->dst;
+ unsigned alpha = info->src->alpha;
+
+ if (alpha == 128 && (df->Rmask | df->Gmask | df->Bmask) == 0x00FFFFFF) {
+ /* only call a128 version when R,G,B occupy lower bits */
+ BlitRGBtoRGBSurfaceAlpha128MMX(info);
+ } else {
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint32 *srcp = (Uint32 *)info->s_pixels;
+ int srcskip = info->s_skip >> 2;
+ Uint32 *dstp = (Uint32 *)info->d_pixels;
+ int dstskip = info->d_skip >> 2;
+
+ pxor_r2r(mm5, mm5); /* 0 -> mm5 */
+ /* form the alpha mult */
+ movd_m2r(alpha, mm4); /* 0000000A -> mm4 */
+ punpcklwd_r2r(mm4, mm4); /* 00000A0A -> mm4 */
+ punpckldq_r2r(mm4, mm4); /* 0A0A0A0A -> mm4 */
+ alpha = (0xff << df->Rshift) | (0xff << df->Gshift) | (0xff << df->Bshift);
+ movd_m2r(alpha, mm0); /* 00000FFF -> mm0 */
+ punpcklbw_r2r(mm0, mm0); /* 00FFFFFF -> mm0 */
+ pand_r2r(mm0, mm4); /* 0A0A0A0A -> mm4, minus 1 chan */
+ /* at this point mm4 can be 000A0A0A or 0A0A0A00 or another combo */
+ movd_m2r(df->Amask, mm7); /* dst alpha mask */
+ punpckldq_r2r(mm7, mm7); /* dst alpha mask | dst alpha mask -> mm7 */
+
+ while(height--) {
+ DUFFS_LOOP_DOUBLE2({
+ /* One Pixel Blend */
+ movd_m2r((*srcp), mm1);/* src(ARGB) -> mm1 (0000ARGB)*/
+ movd_m2r((*dstp), mm2);/* dst(ARGB) -> mm2 (0000ARGB)*/
+ punpcklbw_r2r(mm5, mm1); /* 0A0R0G0B -> mm1(src) */
+ punpcklbw_r2r(mm5, mm2); /* 0A0R0G0B -> mm2(dst) */
+
+ psubw_r2r(mm2, mm1);/* src - dst -> mm1 */
+ pmullw_r2r(mm4, mm1); /* mm1 * alpha -> mm1 */
+ psrlw_i2r(8, mm1); /* mm1 >> 8 -> mm1 */
+ paddb_r2r(mm1, mm2); /* mm1 + mm2(dst) -> mm2 */
+
+ packuswb_r2r(mm5, mm2); /* ARGBARGB -> mm2 */
+ por_r2r(mm7, mm2); /* mm7(full alpha) | mm2 -> mm2 */
+ movd_r2m(mm2, *dstp);/* mm2 -> pixel */
+ ++srcp;
+ ++dstp;
+ },{
+ /* Two Pixels Blend */
+ movq_m2r((*srcp), mm0);/* 2 x src -> mm0(ARGBARGB)*/
+ movq_m2r((*dstp), mm2);/* 2 x dst -> mm2(ARGBARGB) */
+ movq_r2r(mm0, mm1); /* 2 x src -> mm1(ARGBARGB) */
+ movq_r2r(mm2, mm6); /* 2 x dst -> mm6(ARGBARGB) */
+
+ punpcklbw_r2r(mm5, mm0); /* low - 0A0R0G0B -> mm0(src1) */
+ punpckhbw_r2r(mm5, mm1); /* high - 0A0R0G0B -> mm1(src2) */
+ punpcklbw_r2r(mm5, mm2); /* low - 0A0R0G0B -> mm2(dst1) */
+ punpckhbw_r2r(mm5, mm6); /* high - 0A0R0G0B -> mm6(dst2) */
+
+ psubw_r2r(mm2, mm0);/* src1 - dst1 -> mm0 */
+ pmullw_r2r(mm4, mm0); /* mm0 * alpha -> mm0 */
+ psrlw_i2r(8, mm0); /* mm0 >> 8 -> mm1 */
+ paddb_r2r(mm0, mm2); /* mm0 + mm2(dst1) -> mm2 */
+
+ psubw_r2r(mm6, mm1);/* src2 - dst2 -> mm1 */
+ pmullw_r2r(mm4, mm1); /* mm1 * alpha -> mm1 */
+ psrlw_i2r(8, mm1); /* mm1 >> 8 -> mm1 */
+ paddb_r2r(mm1, mm6); /* mm1 + mm6(dst2) -> mm6 */
+
+ packuswb_r2r(mm6, mm2); /* ARGBARGB -> mm2 */
+ por_r2r(mm7, mm2); /* mm7(dst alpha) | mm2 -> mm2 */
+
+ movq_r2m(mm2, *dstp);/* mm2 -> 2 x pixel */
+
+ srcp += 2;
+ dstp += 2;
+ }, width);
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+ emms();
+ }
+}
+
+/* fast ARGB888->(A)RGB888 blending with pixel alpha */
+static void BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint32 *srcp = (Uint32 *)info->s_pixels;
+ int srcskip = info->s_skip >> 2;
+ Uint32 *dstp = (Uint32 *)info->d_pixels;
+ int dstskip = info->d_skip >> 2;
+ SDL_PixelFormat* sf = info->src;
+ Uint32 amask = sf->Amask;
+
+ pxor_r2r(mm6, mm6); /* 0 -> mm6 */
+ /* form multiplication mask */
+ movd_m2r(sf->Amask, mm7); /* 0000F000 -> mm7 */
+ punpcklbw_r2r(mm7, mm7); /* FF000000 -> mm7 */
+ pcmpeqb_r2r(mm0, mm0); /* FFFFFFFF -> mm0 */
+ movq_r2r(mm0, mm3); /* FFFFFFFF -> mm3 (for later) */
+ pxor_r2r(mm0, mm7); /* 00FFFFFF -> mm7 (mult mask) */
+ /* form channel masks */
+ movq_r2r(mm7, mm0); /* 00FFFFFF -> mm0 */
+ packsswb_r2r(mm6, mm0); /* 00000FFF -> mm0 (channel mask) */
+ packsswb_r2r(mm6, mm3); /* 0000FFFF -> mm3 */
+ pxor_r2r(mm0, mm3); /* 0000F000 -> mm3 (~channel mask) */
+ /* get alpha channel shift */
+ __asm__ __volatile__ (
+ "movd %0, %%mm5"
+ : : "rm" ((Uint32) sf->Ashift) ); /* Ashift -> mm5 */
+
+ while(height--) {
+ DUFFS_LOOP4({
+ Uint32 alpha = *srcp & amask;
+ /* FIXME: Here we special-case opaque alpha since the
+ compositioning used (>>8 instead of /255) doesn't handle
+ it correctly. Also special-case alpha=0 for speed?
+ Benchmark this! */
+ if(alpha == 0) {
+ /* do nothing */
+ } else if(alpha == amask) {
+ /* opaque alpha -- copy RGB, keep dst alpha */
+ /* using MMX here to free up regular registers for other things */
+ movd_m2r((*srcp), mm1);/* src(ARGB) -> mm1 (0000ARGB)*/
+ movd_m2r((*dstp), mm2);/* dst(ARGB) -> mm2 (0000ARGB)*/
+ pand_r2r(mm0, mm1); /* src & chanmask -> mm1 */
+ pand_r2r(mm3, mm2); /* dst & ~chanmask -> mm2 */
+ por_r2r(mm1, mm2); /* src | dst -> mm2 */
+ movd_r2m(mm2, (*dstp)); /* mm2 -> dst */
+ } else {
+ movd_m2r((*srcp), mm1);/* src(ARGB) -> mm1 (0000ARGB)*/
+ punpcklbw_r2r(mm6, mm1); /* 0A0R0G0B -> mm1 */
+
+ movd_m2r((*dstp), mm2);/* dst(ARGB) -> mm2 (0000ARGB)*/
+ punpcklbw_r2r(mm6, mm2); /* 0A0R0G0B -> mm2 */
+
+ __asm__ __volatile__ (
+ "movd %0, %%mm4"
+ : : "r" (alpha) ); /* 0000A000 -> mm4 */
+ psrld_r2r(mm5, mm4); /* mm4 >> mm5 -> mm4 (0000000A) */
+ punpcklwd_r2r(mm4, mm4); /* 00000A0A -> mm4 */
+ punpcklwd_r2r(mm4, mm4); /* 0A0A0A0A -> mm4 */
+ pand_r2r(mm7, mm4); /* 000A0A0A -> mm4, preserve dst alpha on add */
+
+ /* blend */
+ psubw_r2r(mm2, mm1);/* src - dst -> mm1 */
+ pmullw_r2r(mm4, mm1); /* mm1 * alpha -> mm1 */
+ psrlw_i2r(8, mm1); /* mm1 >> 8 -> mm1(000R0G0B) */
+ paddb_r2r(mm1, mm2); /* mm1 + mm2(dst) -> mm2 */
+
+ packuswb_r2r(mm6, mm2); /* 0000ARGB -> mm2 */
+ movd_r2m(mm2, *dstp);/* mm2 -> dst */
+ }
+ ++srcp;
+ ++dstp;
+ }, width);
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+ emms();
+}
+/* End GCC_ASMBLIT */
+
+#elif MSVC_ASMBLIT
+/* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */
+static void BlitRGBtoRGBSurfaceAlpha128MMX(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint32 *srcp = (Uint32 *)info->s_pixels;
+ int srcskip = info->s_skip >> 2;
+ Uint32 *dstp = (Uint32 *)info->d_pixels;
+ int dstskip = info->d_skip >> 2;
+ Uint32 dalpha = info->dst->Amask;
+
+ __m64 src1, src2, dst1, dst2, lmask, hmask, dsta;
+
+ hmask = _mm_set_pi32(0x00fefefe, 0x00fefefe); /* alpha128 mask -> hmask */
+ lmask = _mm_set_pi32(0x00010101, 0x00010101); /* !alpha128 mask -> lmask */
+ dsta = _mm_set_pi32(dalpha, dalpha); /* dst alpha mask -> dsta */
+
+ while (height--) {
+ int n = width;
+ if ( n & 1 ) {
+ Uint32 s = *srcp++;
+ Uint32 d = *dstp;
+ *dstp++ = ((((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1)
+ + (s & d & 0x00010101)) | dalpha;
+ n--;
+ }
+
+ for (n >>= 1; n > 0; --n) {
+ dst1 = *(__m64*)dstp; /* 2 x dst -> dst1(ARGBARGB) */
+ dst2 = dst1; /* 2 x dst -> dst2(ARGBARGB) */
+
+ src1 = *(__m64*)srcp; /* 2 x src -> src1(ARGBARGB) */
+ src2 = src1; /* 2 x src -> src2(ARGBARGB) */
+
+ dst2 = _mm_and_si64(dst2, hmask); /* dst & mask -> dst2 */
+ src2 = _mm_and_si64(src2, hmask); /* src & mask -> src2 */
+ src2 = _mm_add_pi32(src2, dst2); /* dst2 + src2 -> src2 */
+ src2 = _mm_srli_pi32(src2, 1); /* src2 >> 1 -> src2 */
+
+ dst1 = _mm_and_si64(dst1, src1); /* src & dst -> dst1 */
+ dst1 = _mm_and_si64(dst1, lmask); /* dst1 & !mask -> dst1 */
+ dst1 = _mm_add_pi32(dst1, src2); /* src2 + dst1 -> dst1 */
+ dst1 = _mm_or_si64(dst1, dsta); /* dsta(full alpha) | dst1 -> dst1 */
+
+ *(__m64*)dstp = dst1; /* dst1 -> 2 x dst pixels */
+ dstp += 2;
+ srcp += 2;
+ }
+
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+ _mm_empty();
+}
+
+/* fast RGB888->(A)RGB888 blending with surface alpha */
+static void BlitRGBtoRGBSurfaceAlphaMMX(SDL_BlitInfo *info)
+{
+ SDL_PixelFormat* df = info->dst;
+ Uint32 chanmask = df->Rmask | df->Gmask | df->Bmask;
+ unsigned alpha = info->src->alpha;
+
+ if (alpha == 128 && (df->Rmask | df->Gmask | df->Bmask) == 0x00FFFFFF) {
+ /* only call a128 version when R,G,B occupy lower bits */
+ BlitRGBtoRGBSurfaceAlpha128MMX(info);
+ } else {
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint32 *srcp = (Uint32 *)info->s_pixels;
+ int srcskip = info->s_skip >> 2;
+ Uint32 *dstp = (Uint32 *)info->d_pixels;
+ int dstskip = info->d_skip >> 2;
+ Uint32 dalpha = df->Amask;
+ Uint32 amult;
+
+ __m64 src1, src2, dst1, dst2, mm_alpha, mm_zero, dsta;
+
+ mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */
+ /* form the alpha mult */
+ amult = alpha | (alpha << 8);
+ amult = amult | (amult << 16);
+ chanmask = (0xff << df->Rshift) | (0xff << df->Gshift) | (0xff << df->Bshift);
+ mm_alpha = _mm_set_pi32(0, amult & chanmask); /* 0000AAAA -> mm_alpha, minus 1 chan */
+ mm_alpha = _mm_unpacklo_pi8(mm_alpha, mm_zero); /* 0A0A0A0A -> mm_alpha, minus 1 chan */
+ /* at this point mm_alpha can be 000A0A0A or 0A0A0A00 or another combo */
+ dsta = _mm_set_pi32(dalpha, dalpha); /* dst alpha mask -> dsta */
+
+ while (height--) {
+ int n = width;
+ if (n & 1) {
+ /* One Pixel Blend */
+ src2 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src2 (0000ARGB)*/
+ src2 = _mm_unpacklo_pi8(src2, mm_zero); /* 0A0R0G0B -> src2 */
+
+ dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB)*/
+ dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* 0A0R0G0B -> dst1 */
+
+ src2 = _mm_sub_pi16(src2, dst1); /* src2 - dst2 -> src2 */
+ src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
+ src2 = _mm_srli_pi16(src2, 8); /* src2 >> 8 -> src2 */
+ dst1 = _mm_add_pi8(src2, dst1); /* src2 + dst1 -> dst1 */
+
+ dst1 = _mm_packs_pu16(dst1, mm_zero); /* 0000ARGB -> dst1 */
+ dst1 = _mm_or_si64(dst1, dsta); /* dsta | dst1 -> dst1 */
+ *dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */
+
+ ++srcp;
+ ++dstp;
+
+ n--;
+ }
+
+ for (n >>= 1; n > 0; --n) {
+ /* Two Pixels Blend */
+ src1 = *(__m64*)srcp; /* 2 x src -> src1(ARGBARGB)*/
+ src2 = src1; /* 2 x src -> src2(ARGBARGB) */
+ src1 = _mm_unpacklo_pi8(src1, mm_zero); /* low - 0A0R0G0B -> src1 */
+ src2 = _mm_unpackhi_pi8(src2, mm_zero); /* high - 0A0R0G0B -> src2 */
+
+ dst1 = *(__m64*)dstp;/* 2 x dst -> dst1(ARGBARGB) */
+ dst2 = dst1; /* 2 x dst -> dst2(ARGBARGB) */
+ dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* low - 0A0R0G0B -> dst1 */
+ dst2 = _mm_unpackhi_pi8(dst2, mm_zero); /* high - 0A0R0G0B -> dst2 */
+
+ src1 = _mm_sub_pi16(src1, dst1);/* src1 - dst1 -> src1 */
+ src1 = _mm_mullo_pi16(src1, mm_alpha); /* src1 * alpha -> src1 */
+ src1 = _mm_srli_pi16(src1, 8); /* src1 >> 8 -> src1 */
+ dst1 = _mm_add_pi8(src1, dst1); /* src1 + dst1(dst1) -> dst1 */
+
+ src2 = _mm_sub_pi16(src2, dst2);/* src2 - dst2 -> src2 */
+ src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
+ src2 = _mm_srli_pi16(src2, 8); /* src2 >> 8 -> src2 */
+ dst2 = _mm_add_pi8(src2, dst2); /* src2 + dst2(dst2) -> dst2 */
+
+ dst1 = _mm_packs_pu16(dst1, dst2); /* 0A0R0G0B(res1), 0A0R0G0B(res2) -> dst1(ARGBARGB) */
+ dst1 = _mm_or_si64(dst1, dsta); /* dsta | dst1 -> dst1 */
+
+ *(__m64*)dstp = dst1; /* dst1 -> 2 x pixel */
+
+ srcp += 2;
+ dstp += 2;
+ }
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+ _mm_empty();
+ }
+}
+
+/* fast ARGB888->(A)RGB888 blending with pixel alpha */
+static void BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint32 *srcp = (Uint32 *)info->s_pixels;
+ int srcskip = info->s_skip >> 2;
+ Uint32 *dstp = (Uint32 *)info->d_pixels;
+ int dstskip = info->d_skip >> 2;
+ SDL_PixelFormat* sf = info->src;
+ Uint32 chanmask = sf->Rmask | sf->Gmask | sf->Bmask;
+ Uint32 amask = sf->Amask;
+ Uint32 ashift = sf->Ashift;
+ Uint64 multmask;
+
+ __m64 src1, dst1, mm_alpha, mm_zero, dmask;
+
+ mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */
+ multmask = ~(0xFFFFi64 << (ashift * 2));
+ dmask = *(__m64*) &multmask; /* dst alpha mask -> dmask */
+
+ while(height--) {
+ DUFFS_LOOP4({
+ Uint32 alpha = *srcp & amask;
+ if (alpha == 0) {
+ /* do nothing */
+ } else if (alpha == amask) {
+ /* opaque alpha -- copy RGB, keep dst alpha */
+ *dstp = (*srcp & chanmask) | (*dstp & ~chanmask);
+ } else {
+ src1 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src1 (0000ARGB)*/
+ src1 = _mm_unpacklo_pi8(src1, mm_zero); /* 0A0R0G0B -> src1 */
+
+ dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB)*/
+ dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* 0A0R0G0B -> dst1 */
+
+ mm_alpha = _mm_cvtsi32_si64(alpha); /* alpha -> mm_alpha (0000000A) */
+ mm_alpha = _mm_srli_si64(mm_alpha, ashift); /* mm_alpha >> ashift -> mm_alpha(0000000A) */
+ mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */
+ mm_alpha = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha */
+ mm_alpha = _mm_and_si64(mm_alpha, dmask); /* 000A0A0A -> mm_alpha, preserve dst alpha on add */
+
+ /* blend */
+ src1 = _mm_sub_pi16(src1, dst1);/* src1 - dst1 -> src1 */
+ src1 = _mm_mullo_pi16(src1, mm_alpha); /* (src1 - dst1) * alpha -> src1 */
+ src1 = _mm_srli_pi16(src1, 8); /* src1 >> 8 -> src1(000R0G0B) */
+ dst1 = _mm_add_pi8(src1, dst1); /* src1 + dst1 -> dst1(0A0R0G0B) */
+ dst1 = _mm_packs_pu16(dst1, mm_zero); /* 0000ARGB -> dst1 */
+
+ *dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */
+ }
+ ++srcp;
+ ++dstp;
+ }, width);
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+ _mm_empty();
+}
+/* End MSVC_ASMBLIT */
+
+#endif /* GCC_ASMBLIT, MSVC_ASMBLIT */
+
+#if SDL_ALTIVEC_BLITTERS
+#if __MWERKS__
+#pragma altivec_model on
+#endif
+#if HAVE_ALTIVEC_H
+#include <altivec.h>
+#endif
+#include <assert.h>
+
+#if (defined(__MACOSX__) && (__GNUC__ < 4))
+ #define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
+ (vector unsigned char) ( a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p )
+ #define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \
+ (vector unsigned short) ( a,b,c,d,e,f,g,h )
+#else
+ #define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
+ (vector unsigned char) { a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p }
+ #define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \
+ (vector unsigned short) { a,b,c,d,e,f,g,h }
+#endif
+
+#define UNALIGNED_PTR(x) (((size_t) x) & 0x0000000F)
+#define VECPRINT(msg, v) do { \
+ vector unsigned int tmpvec = (vector unsigned int)(v); \
+ unsigned int *vp = (unsigned int *)&tmpvec; \
+ printf("%s = %08X %08X %08X %08X\n", msg, vp[0], vp[1], vp[2], vp[3]); \
+} while (0)
+
+/* the permuation vector that takes the high bytes out of all the appropriate shorts
+ (vector unsigned char)(
+ 0x00, 0x10, 0x02, 0x12,
+ 0x04, 0x14, 0x06, 0x16,
+ 0x08, 0x18, 0x0A, 0x1A,
+ 0x0C, 0x1C, 0x0E, 0x1E );
+*/
+#define VEC_MERGE_PERMUTE() (vec_add(vec_lvsl(0, (int*)NULL), (vector unsigned char)vec_splat_u16(0x0F)))
+#define VEC_U32_24() (vec_add(vec_splat_u32(12), vec_splat_u32(12)))
+#define VEC_ALPHA_MASK() ((vector unsigned char)vec_sl((vector unsigned int)vec_splat_s8(-1), VEC_U32_24()))
+#define VEC_ALIGNER(src) ((UNALIGNED_PTR(src)) \
+ ? vec_lvsl(0, src) \
+ : vec_add(vec_lvsl(8, src), vec_splat_u8(8)))
+
+
+#define VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1_16, v8_16) do { \
+ /* vtemp1 contains source AAGGAAGGAAGGAAGG */ \
+ vector unsigned short vtemp1 = vec_mule(vs, valpha); \
+ /* vtemp2 contains source RRBBRRBBRRBBRRBB */ \
+ vector unsigned short vtemp2 = vec_mulo(vs, valpha); \
+ /* valpha2 is 255-alpha */ \
+ vector unsigned char valpha2 = vec_nor(valpha, valpha); \
+ /* vtemp3 contains dest AAGGAAGGAAGGAAGG */ \
+ vector unsigned short vtemp3 = vec_mule(vd, valpha2); \
+ /* vtemp4 contains dest RRBBRRBBRRBBRRBB */ \
+ vector unsigned short vtemp4 = vec_mulo(vd, valpha2); \
+ /* add source and dest */ \
+ vtemp1 = vec_add(vtemp1, vtemp3); \
+ vtemp2 = vec_add(vtemp2, vtemp4); \
+ /* vtemp1 = (vtemp1 + 1) + ((vtemp1 + 1) >> 8) */ \
+ vtemp1 = vec_add(vtemp1, v1_16); \
+ vtemp3 = vec_sr(vtemp1, v8_16); \
+ vtemp1 = vec_add(vtemp1, vtemp3); \
+ /* vtemp2 = (vtemp2 + 1) + ((vtemp2 + 1) >> 8) */ \
+ vtemp2 = vec_add(vtemp2, v1_16); \
+ vtemp4 = vec_sr(vtemp2, v8_16); \
+ vtemp2 = vec_add(vtemp2, vtemp4); \
+ /* (>>8) and get ARGBARGBARGBARGB */ \
+ vd = (vector unsigned char)vec_perm(vtemp1, vtemp2, mergePermute); \
+} while (0)
+
+/* Calculate the permute vector used for 32->32 swizzling */
+static vector unsigned char calc_swizzle32(const SDL_PixelFormat *srcfmt,
+ const SDL_PixelFormat *dstfmt)
+{
+ /*
+ * We have to assume that the bits that aren't used by other
+ * colors is alpha, and it's one complete byte, since some formats
+ * leave alpha with a zero mask, but we should still swizzle the bits.
+ */
+ /* ARGB */
+ const static struct SDL_PixelFormat default_pixel_format = {
+ NULL, 0, 0,
+ 0, 0, 0, 0,
+ 16, 8, 0, 24,
+ 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000,
+ 0, 0};
+ if (!srcfmt) {
+ srcfmt = &default_pixel_format;
+ }
+ if (!dstfmt) {
+ dstfmt = &default_pixel_format;
+ }
+ const vector unsigned char plus = VECUINT8_LITERAL
+ ( 0x00, 0x00, 0x00, 0x00,
+ 0x04, 0x04, 0x04, 0x04,
+ 0x08, 0x08, 0x08, 0x08,
+ 0x0C, 0x0C, 0x0C, 0x0C );
+ vector unsigned char vswiz;
+ vector unsigned int srcvec;
+#define RESHIFT(X) (3 - ((X) >> 3))
+ Uint32 rmask = RESHIFT(srcfmt->Rshift) << (dstfmt->Rshift);
+ Uint32 gmask = RESHIFT(srcfmt->Gshift) << (dstfmt->Gshift);
+ Uint32 bmask = RESHIFT(srcfmt->Bshift) << (dstfmt->Bshift);
+ Uint32 amask;
+ /* Use zero for alpha if either surface doesn't have alpha */
+ if (dstfmt->Amask) {
+ amask = ((srcfmt->Amask) ? RESHIFT(srcfmt->Ashift) : 0x10) << (dstfmt->Ashift);
+ } else {
+ amask = 0x10101010 & ((dstfmt->Rmask | dstfmt->Gmask | dstfmt->Bmask) ^ 0xFFFFFFFF);
+ }
+#undef RESHIFT
+ ((unsigned int *)(char*)&srcvec)[0] = (rmask | gmask | bmask | amask);
+ vswiz = vec_add(plus, (vector unsigned char)vec_splat(srcvec, 0));
+ return(vswiz);
+}
+
+static void Blit32to565PixelAlphaAltivec(SDL_BlitInfo *info)
+{
+ int height = info->d_height;
+ Uint8 *src = (Uint8 *)info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint8 *dst = (Uint8 *)info->d_pixels;
+ int dstskip = info->d_skip;
+ SDL_PixelFormat *srcfmt = info->src;
+
+ vector unsigned char v0 = vec_splat_u8(0);
+ vector unsigned short v8_16 = vec_splat_u16(8);
+ vector unsigned short v1_16 = vec_splat_u16(1);
+ vector unsigned short v2_16 = vec_splat_u16(2);
+ vector unsigned short v3_16 = vec_splat_u16(3);
+ vector unsigned int v8_32 = vec_splat_u32(8);
+ vector unsigned int v16_32 = vec_add(v8_32, v8_32);
+ vector unsigned short v3f = VECUINT16_LITERAL(
+ 0x003f, 0x003f, 0x003f, 0x003f,
+ 0x003f, 0x003f, 0x003f, 0x003f);
+ vector unsigned short vfc = VECUINT16_LITERAL(
+ 0x00fc, 0x00fc, 0x00fc, 0x00fc,
+ 0x00fc, 0x00fc, 0x00fc, 0x00fc);
+
+ /*
+ 0x10 - 0x1f is the alpha
+ 0x00 - 0x0e evens are the red
+ 0x01 - 0x0f odds are zero
+ */
+ vector unsigned char vredalpha1 = VECUINT8_LITERAL(
+ 0x10, 0x00, 0x01, 0x01,
+ 0x10, 0x02, 0x01, 0x01,
+ 0x10, 0x04, 0x01, 0x01,
+ 0x10, 0x06, 0x01, 0x01
+ );
+ vector unsigned char vredalpha2 = (vector unsigned char)(
+ vec_add((vector unsigned int)vredalpha1, vec_sl(v8_32, v16_32))
+ );
+ /*
+ 0x00 - 0x0f is ARxx ARxx ARxx ARxx
+ 0x11 - 0x0f odds are blue
+ */
+ vector unsigned char vblue1 = VECUINT8_LITERAL(
+ 0x00, 0x01, 0x02, 0x11,
+ 0x04, 0x05, 0x06, 0x13,
+ 0x08, 0x09, 0x0a, 0x15,
+ 0x0c, 0x0d, 0x0e, 0x17
+ );
+ vector unsigned char vblue2 = (vector unsigned char)(
+ vec_add((vector unsigned int)vblue1, v8_32)
+ );
+ /*
+ 0x00 - 0x0f is ARxB ARxB ARxB ARxB
+ 0x10 - 0x0e evens are green
+ */
+ vector unsigned char vgreen1 = VECUINT8_LITERAL(
+ 0x00, 0x01, 0x10, 0x03,
+ 0x04, 0x05, 0x12, 0x07,
+ 0x08, 0x09, 0x14, 0x0b,
+ 0x0c, 0x0d, 0x16, 0x0f
+ );
+ vector unsigned char vgreen2 = (vector unsigned char)(
+ vec_add((vector unsigned int)vgreen1, vec_sl(v8_32, v8_32))
+ );
+ vector unsigned char vgmerge = VECUINT8_LITERAL(
+ 0x00, 0x02, 0x00, 0x06,
+ 0x00, 0x0a, 0x00, 0x0e,
+ 0x00, 0x12, 0x00, 0x16,
+ 0x00, 0x1a, 0x00, 0x1e);
+ vector unsigned char mergePermute = VEC_MERGE_PERMUTE();
+ vector unsigned char vpermute = calc_swizzle32(srcfmt, NULL);
+ vector unsigned char valphaPermute = vec_and(vec_lvsl(0, (int *)NULL), vec_splat_u8(0xC));
+
+ vector unsigned short vf800 = (vector unsigned short)vec_splat_u8(-7);
+ vf800 = vec_sl(vf800, vec_splat_u16(8));
+
+ while(height--) {
+ int extrawidth;
+ vector unsigned char valigner;
+ vector unsigned char vsrc;
+ vector unsigned char voverflow;
+ int width = info->d_width;
+
+#define ONE_PIXEL_BLEND(condition, widthvar) \
+ while (condition) { \
+ Uint32 Pixel; \
+ unsigned sR, sG, sB, dR, dG, dB, sA; \
+ DISEMBLE_RGBA(src, 4, srcfmt, Pixel, sR, sG, sB, sA); \
+ if(sA) { \
+ unsigned short dstpixel = *((unsigned short *)dst); \
+ dR = (dstpixel >> 8) & 0xf8; \
+ dG = (dstpixel >> 3) & 0xfc; \
+ dB = (dstpixel << 3) & 0xf8; \
+ ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); \
+ *((unsigned short *)dst) = ( \
+ ((dR & 0xf8) << 8) | ((dG & 0xfc) << 3) | (dB >> 3) \
+ ); \
+ } \
+ src += 4; \
+ dst += 2; \
+ widthvar--; \
+ }
+ ONE_PIXEL_BLEND((UNALIGNED_PTR(dst)) && (width), width);
+ extrawidth = (width % 8);
+ valigner = VEC_ALIGNER(src);
+ vsrc = (vector unsigned char)vec_ld(0, src);
+ width -= extrawidth;
+ while (width) {
+ vector unsigned char valpha;
+ vector unsigned char vsrc1, vsrc2;
+ vector unsigned char vdst1, vdst2;
+ vector unsigned short vR, vG, vB;
+ vector unsigned short vpixel, vrpixel, vgpixel, vbpixel;
+
+ /* Load 8 pixels from src as ARGB */
+ voverflow = (vector unsigned char)vec_ld(15, src);
+ vsrc = vec_perm(vsrc, voverflow, valigner);
+ vsrc1 = vec_perm(vsrc, vsrc, vpermute);
+ src += 16;
+ vsrc = (vector unsigned char)vec_ld(15, src);
+ voverflow = vec_perm(voverflow, vsrc, valigner);
+ vsrc2 = vec_perm(voverflow, voverflow, vpermute);
+ src += 16;
+
+ /* Load 8 pixels from dst as XRGB */
+ voverflow = vec_ld(0, dst);
+ vR = vec_and((vector unsigned short)voverflow, vf800);
+ vB = vec_sl((vector unsigned short)voverflow, v3_16);
+ vG = vec_sl(vB, v2_16);
+ vdst1 = (vector unsigned char)vec_perm((vector unsigned char)vR, (vector unsigned char)vR, vredalpha1);
+ vdst1 = vec_perm(vdst1, (vector unsigned char)vB, vblue1);
+ vdst1 = vec_perm(vdst1, (vector unsigned char)vG, vgreen1);
+ vdst2 = (vector unsigned char)vec_perm((vector unsigned char)vR, (vector unsigned char)vR, vredalpha2);
+ vdst2 = vec_perm(vdst2, (vector unsigned char)vB, vblue2);
+ vdst2 = vec_perm(vdst2, (vector unsigned char)vG, vgreen2);
+
+ /* Alpha blend 8 pixels as ARGB */
+ valpha = vec_perm(vsrc1, v0, valphaPermute);
+ VEC_MULTIPLY_ALPHA(vsrc1, vdst1, valpha, mergePermute, v1_16, v8_16);
+ valpha = vec_perm(vsrc2, v0, valphaPermute);
+ VEC_MULTIPLY_ALPHA(vsrc2, vdst2, valpha, mergePermute, v1_16, v8_16);
+
+ /* Convert 8 pixels to 565 */
+ vpixel = (vector unsigned short)vec_packpx((vector unsigned int)vdst1, (vector unsigned int)vdst2);
+ vgpixel = (vector unsigned short)vec_perm(vdst1, vdst2, vgmerge);
+ vgpixel = vec_and(vgpixel, vfc);
+ vgpixel = vec_sl(vgpixel, v3_16);
+ vrpixel = vec_sl(vpixel, v1_16);
+ vrpixel = vec_and(vrpixel, vf800);
+ vbpixel = vec_and(vpixel, v3f);
+ vdst1 = vec_or((vector unsigned char)vrpixel, (vector unsigned char)vgpixel);
+ vdst1 = vec_or(vdst1, (vector unsigned char)vbpixel);
+
+ /* Store 8 pixels */
+ vec_st(vdst1, 0, dst);
+
+ width -= 8;
+ dst += 16;
+ }
+ ONE_PIXEL_BLEND((extrawidth), extrawidth);
+#undef ONE_PIXEL_BLEND
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+
+static void Blit32to32SurfaceAlphaKeyAltivec(SDL_BlitInfo *info)
+{
+ unsigned alpha = info->src->alpha;
+ int height = info->d_height;
+ Uint32 *srcp = (Uint32 *)info->s_pixels;
+ int srcskip = info->s_skip >> 2;
+ Uint32 *dstp = (Uint32 *)info->d_pixels;
+ int dstskip = info->d_skip >> 2;
+ SDL_PixelFormat *srcfmt = info->src;
+ SDL_PixelFormat *dstfmt = info->dst;
+ unsigned sA = srcfmt->alpha;
+ unsigned dA = dstfmt->Amask ? SDL_ALPHA_OPAQUE : 0;
+ Uint32 rgbmask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask;
+ Uint32 ckey = info->src->colorkey;
+ vector unsigned char mergePermute;
+ vector unsigned char vsrcPermute;
+ vector unsigned char vdstPermute;
+ vector unsigned char vsdstPermute;
+ vector unsigned char valpha;
+ vector unsigned char valphamask;
+ vector unsigned char vbits;
+ vector unsigned char v0;
+ vector unsigned short v1;
+ vector unsigned short v8;
+ vector unsigned int vckey;
+ vector unsigned int vrgbmask;
+
+ mergePermute = VEC_MERGE_PERMUTE();
+ v0 = vec_splat_u8(0);
+ v1 = vec_splat_u16(1);
+ v8 = vec_splat_u16(8);
+
+ /* set the alpha to 255 on the destination surf */
+ valphamask = VEC_ALPHA_MASK();
+
+ vsrcPermute = calc_swizzle32(srcfmt, NULL);
+ vdstPermute = calc_swizzle32(NULL, dstfmt);
+ vsdstPermute = calc_swizzle32(dstfmt, NULL);
+
+ /* set a vector full of alpha and 255-alpha */
+ ((unsigned char *)&valpha)[0] = alpha;
+ valpha = vec_splat(valpha, 0);
+ vbits = (vector unsigned char)vec_splat_s8(-1);
+
+ ckey &= rgbmask;
+ ((unsigned int *)(char*)&vckey)[0] = ckey;
+ vckey = vec_splat(vckey, 0);
+ ((unsigned int *)(char*)&vrgbmask)[0] = rgbmask;
+ vrgbmask = vec_splat(vrgbmask, 0);
+
+ while(height--) {
+ int width = info->d_width;
+#define ONE_PIXEL_BLEND(condition, widthvar) \
+ while (condition) { \
+ Uint32 Pixel; \
+ unsigned sR, sG, sB, dR, dG, dB; \
+ RETRIEVE_RGB_PIXEL(((Uint8 *)srcp), 4, Pixel); \
+ if(sA && Pixel != ckey) { \
+ RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB); \
+ DISEMBLE_RGB(((Uint8 *)dstp), 4, dstfmt, Pixel, dR, dG, dB); \
+ ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); \
+ ASSEMBLE_RGBA(((Uint8 *)dstp), 4, dstfmt, dR, dG, dB, dA); \
+ } \
+ dstp++; \
+ srcp++; \
+ widthvar--; \
+ }
+ ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width);
+ if (width > 0) {
+ int extrawidth = (width % 4);
+ vector unsigned char valigner = VEC_ALIGNER(srcp);
+ vector unsigned char vs = (vector unsigned char)vec_ld(0, srcp);
+ width -= extrawidth;
+ while (width) {
+ vector unsigned char vsel;
+ vector unsigned char voverflow;
+ vector unsigned char vd;
+ vector unsigned char vd_orig;
+
+ /* s = *srcp */
+ voverflow = (vector unsigned char)vec_ld(15, srcp);
+ vs = vec_perm(vs, voverflow, valigner);
+
+ /* vsel is set for items that match the key */
+ vsel = (vector unsigned char)vec_and((vector unsigned int)vs, vrgbmask);
+ vsel = (vector unsigned char)vec_cmpeq((vector unsigned int)vsel, vckey);
+
+ /* permute to source format */
+ vs = vec_perm(vs, valpha, vsrcPermute);
+
+ /* d = *dstp */
+ vd = (vector unsigned char)vec_ld(0, dstp);
+ vd_orig = vd = vec_perm(vd, v0, vsdstPermute);
+
+ VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1, v8);
+
+ /* set the alpha channel to full on */
+ vd = vec_or(vd, valphamask);
+
+ /* mask out color key */
+ vd = vec_sel(vd, vd_orig, vsel);
+
+ /* permute to dest format */
+ vd = vec_perm(vd, vbits, vdstPermute);
+
+ /* *dstp = res */
+ vec_st((vector unsigned int)vd, 0, dstp);
+
+ srcp += 4;
+ dstp += 4;
+ width -= 4;
+ vs = voverflow;
+ }
+ ONE_PIXEL_BLEND((extrawidth), extrawidth);
+ }
+#undef ONE_PIXEL_BLEND
+
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+}
+
+
+static void Blit32to32PixelAlphaAltivec(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint32 *srcp = (Uint32 *)info->s_pixels;
+ int srcskip = info->s_skip >> 2;
+ Uint32 *dstp = (Uint32 *)info->d_pixels;
+ int dstskip = info->d_skip >> 2;
+ SDL_PixelFormat *srcfmt = info->src;
+ SDL_PixelFormat *dstfmt = info->dst;
+ vector unsigned char mergePermute;
+ vector unsigned char valphaPermute;
+ vector unsigned char vsrcPermute;
+ vector unsigned char vdstPermute;
+ vector unsigned char vsdstPermute;
+ vector unsigned char valphamask;
+ vector unsigned char vpixelmask;
+ vector unsigned char v0;
+ vector unsigned short v1;
+ vector unsigned short v8;
+
+ v0 = vec_splat_u8(0);
+ v1 = vec_splat_u16(1);
+ v8 = vec_splat_u16(8);
+ mergePermute = VEC_MERGE_PERMUTE();
+ valphamask = VEC_ALPHA_MASK();
+ valphaPermute = vec_and(vec_lvsl(0, (int *)NULL), vec_splat_u8(0xC));
+ vpixelmask = vec_nor(valphamask, v0);
+ vsrcPermute = calc_swizzle32(srcfmt, NULL);
+ vdstPermute = calc_swizzle32(NULL, dstfmt);
+ vsdstPermute = calc_swizzle32(dstfmt, NULL);
+
+ while ( height-- ) {
+ width = info->d_width;
+#define ONE_PIXEL_BLEND(condition, widthvar) while ((condition)) { \
+ Uint32 Pixel; \
+ unsigned sR, sG, sB, dR, dG, dB, sA, dA; \
+ DISEMBLE_RGBA((Uint8 *)srcp, 4, srcfmt, Pixel, sR, sG, sB, sA); \
+ if(sA) { \
+ DISEMBLE_RGBA((Uint8 *)dstp, 4, dstfmt, Pixel, dR, dG, dB, dA); \
+ ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); \
+ ASSEMBLE_RGBA((Uint8 *)dstp, 4, dstfmt, dR, dG, dB, dA); \
+ } \
+ ++srcp; \
+ ++dstp; \
+ widthvar--; \
+ }
+ ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width);
+ if (width > 0) {
+ /* vsrcPermute */
+ /* vdstPermute */
+ int extrawidth = (width % 4);
+ vector unsigned char valigner = VEC_ALIGNER(srcp);
+ vector unsigned char vs = (vector unsigned char)vec_ld(0, srcp);
+ width -= extrawidth;
+ while (width) {
+ vector unsigned char voverflow;
+ vector unsigned char vd;
+ vector unsigned char valpha;
+ vector unsigned char vdstalpha;
+ /* s = *srcp */
+ voverflow = (vector unsigned char)vec_ld(15, srcp);
+ vs = vec_perm(vs, voverflow, valigner);
+ vs = vec_perm(vs, v0, vsrcPermute);
+
+ valpha = vec_perm(vs, v0, valphaPermute);
+
+ /* d = *dstp */
+ vd = (vector unsigned char)vec_ld(0, dstp);
+ vd = vec_perm(vd, v0, vsdstPermute);
+ vdstalpha = vec_and(vd, valphamask);
+
+ VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1, v8);
+
+ /* set the alpha to the dest alpha */
+ vd = vec_and(vd, vpixelmask);
+ vd = vec_or(vd, vdstalpha);
+ vd = vec_perm(vd, v0, vdstPermute);
+
+ /* *dstp = res */
+ vec_st((vector unsigned int)vd, 0, dstp);
+
+ srcp += 4;
+ dstp += 4;
+ width -= 4;
+ vs = voverflow;
+
+ }
+ ONE_PIXEL_BLEND((extrawidth), extrawidth);
+ }
+ srcp += srcskip;
+ dstp += dstskip;
+#undef ONE_PIXEL_BLEND
+ }
+}
+
+/* fast ARGB888->(A)RGB888 blending with pixel alpha */
+static void BlitRGBtoRGBPixelAlphaAltivec(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint32 *srcp = (Uint32 *)info->s_pixels;
+ int srcskip = info->s_skip >> 2;
+ Uint32 *dstp = (Uint32 *)info->d_pixels;
+ int dstskip = info->d_skip >> 2;
+ vector unsigned char mergePermute;
+ vector unsigned char valphaPermute;
+ vector unsigned char valphamask;
+ vector unsigned char vpixelmask;
+ vector unsigned char v0;
+ vector unsigned short v1;
+ vector unsigned short v8;
+ v0 = vec_splat_u8(0);
+ v1 = vec_splat_u16(1);
+ v8 = vec_splat_u16(8);
+ mergePermute = VEC_MERGE_PERMUTE();
+ valphamask = VEC_ALPHA_MASK();
+ valphaPermute = vec_and(vec_lvsl(0, (int *)NULL), vec_splat_u8(0xC));
+
+
+ vpixelmask = vec_nor(valphamask, v0);
+ while(height--) {
+ width = info->d_width;
+#define ONE_PIXEL_BLEND(condition, widthvar) \
+ while ((condition)) { \
+ Uint32 dalpha; \
+ Uint32 d; \
+ Uint32 s1; \
+ Uint32 d1; \
+ Uint32 s = *srcp; \
+ Uint32 alpha = s >> 24; \
+ if(alpha) { \
+ if(alpha == SDL_ALPHA_OPAQUE) { \
+ *dstp = (s & 0x00ffffff) | (*dstp & 0xff000000); \
+ } else { \
+ d = *dstp; \
+ dalpha = d & 0xff000000; \
+ s1 = s & 0xff00ff; \
+ d1 = d & 0xff00ff; \
+ d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff; \
+ s &= 0xff00; \
+ d &= 0xff00; \
+ d = (d + ((s - d) * alpha >> 8)) & 0xff00; \
+ *dstp = d1 | d | dalpha; \
+ } \
+ } \
+ ++srcp; \
+ ++dstp; \
+ widthvar--; \
+ }
+ ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width);
+ if (width > 0) {
+ int extrawidth = (width % 4);
+ vector unsigned char valigner = VEC_ALIGNER(srcp);
+ vector unsigned char vs = (vector unsigned char)vec_ld(0, srcp);
+ width -= extrawidth;
+ while (width) {
+ vector unsigned char voverflow;
+ vector unsigned char vd;
+ vector unsigned char valpha;
+ vector unsigned char vdstalpha;
+ /* s = *srcp */
+ voverflow = (vector unsigned char)vec_ld(15, srcp);
+ vs = vec_perm(vs, voverflow, valigner);
+
+ valpha = vec_perm(vs, v0, valphaPermute);
+
+ /* d = *dstp */
+ vd = (vector unsigned char)vec_ld(0, dstp);
+ vdstalpha = vec_and(vd, valphamask);
+
+ VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1, v8);
+
+ /* set the alpha to the dest alpha */
+ vd = vec_and(vd, vpixelmask);
+ vd = vec_or(vd, vdstalpha);
+
+ /* *dstp = res */
+ vec_st((vector unsigned int)vd, 0, dstp);
+
+ srcp += 4;
+ dstp += 4;
+ width -= 4;
+ vs = voverflow;
+ }
+ ONE_PIXEL_BLEND((extrawidth), extrawidth);
+ }
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+#undef ONE_PIXEL_BLEND
+}
+
+static void Blit32to32SurfaceAlphaAltivec(SDL_BlitInfo *info)
+{
+ /* XXX : 6 */
+ unsigned alpha = info->src->alpha;
+ int height = info->d_height;
+ Uint32 *srcp = (Uint32 *)info->s_pixels;
+ int srcskip = info->s_skip >> 2;
+ Uint32 *dstp = (Uint32 *)info->d_pixels;
+ int dstskip = info->d_skip >> 2;
+ SDL_PixelFormat *srcfmt = info->src;
+ SDL_PixelFormat *dstfmt = info->dst;
+ unsigned sA = srcfmt->alpha;
+ unsigned dA = dstfmt->Amask ? SDL_ALPHA_OPAQUE : 0;
+ vector unsigned char mergePermute;
+ vector unsigned char vsrcPermute;
+ vector unsigned char vdstPermute;
+ vector unsigned char vsdstPermute;
+ vector unsigned char valpha;
+ vector unsigned char valphamask;
+ vector unsigned char vbits;
+ vector unsigned short v1;
+ vector unsigned short v8;
+
+ mergePermute = VEC_MERGE_PERMUTE();
+ v1 = vec_splat_u16(1);
+ v8 = vec_splat_u16(8);
+
+ /* set the alpha to 255 on the destination surf */
+ valphamask = VEC_ALPHA_MASK();
+
+ vsrcPermute = calc_swizzle32(srcfmt, NULL);
+ vdstPermute = calc_swizzle32(NULL, dstfmt);
+ vsdstPermute = calc_swizzle32(dstfmt, NULL);
+
+ /* set a vector full of alpha and 255-alpha */
+ ((unsigned char *)&valpha)[0] = alpha;
+ valpha = vec_splat(valpha, 0);
+ vbits = (vector unsigned char)vec_splat_s8(-1);
+
+ while(height--) {
+ int width = info->d_width;
+#define ONE_PIXEL_BLEND(condition, widthvar) while ((condition)) { \
+ Uint32 Pixel; \
+ unsigned sR, sG, sB, dR, dG, dB; \
+ DISEMBLE_RGB(((Uint8 *)srcp), 4, srcfmt, Pixel, sR, sG, sB); \
+ DISEMBLE_RGB(((Uint8 *)dstp), 4, dstfmt, Pixel, dR, dG, dB); \
+ ALPHA_BLEND(sR, sG, sB, sA, dR, dG, dB); \
+ ASSEMBLE_RGBA(((Uint8 *)dstp), 4, dstfmt, dR, dG, dB, dA); \
+ ++srcp; \
+ ++dstp; \
+ widthvar--; \
+ }
+ ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width);
+ if (width > 0) {
+ int extrawidth = (width % 4);
+ vector unsigned char valigner = VEC_ALIGNER(srcp);
+ vector unsigned char vs = (vector unsigned char)vec_ld(0, srcp);
+ width -= extrawidth;
+ while (width) {
+ vector unsigned char voverflow;
+ vector unsigned char vd;
+
+ /* s = *srcp */
+ voverflow = (vector unsigned char)vec_ld(15, srcp);
+ vs = vec_perm(vs, voverflow, valigner);
+ vs = vec_perm(vs, valpha, vsrcPermute);
+
+ /* d = *dstp */
+ vd = (vector unsigned char)vec_ld(0, dstp);
+ vd = vec_perm(vd, vd, vsdstPermute);
+
+ VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1, v8);
+
+ /* set the alpha channel to full on */
+ vd = vec_or(vd, valphamask);
+ vd = vec_perm(vd, vbits, vdstPermute);
+
+ /* *dstp = res */
+ vec_st((vector unsigned int)vd, 0, dstp);
+
+ srcp += 4;
+ dstp += 4;
+ width -= 4;
+ vs = voverflow;
+ }
+ ONE_PIXEL_BLEND((extrawidth), extrawidth);
+ }
+#undef ONE_PIXEL_BLEND
+
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+
+}
+
+
+/* fast RGB888->(A)RGB888 blending */
+static void BlitRGBtoRGBSurfaceAlphaAltivec(SDL_BlitInfo *info)
+{
+ unsigned alpha = info->src->alpha;
+ int height = info->d_height;
+ Uint32 *srcp = (Uint32 *)info->s_pixels;
+ int srcskip = info->s_skip >> 2;
+ Uint32 *dstp = (Uint32 *)info->d_pixels;
+ int dstskip = info->d_skip >> 2;
+ vector unsigned char mergePermute;
+ vector unsigned char valpha;
+ vector unsigned char valphamask;
+ vector unsigned short v1;
+ vector unsigned short v8;
+
+ mergePermute = VEC_MERGE_PERMUTE();
+ v1 = vec_splat_u16(1);
+ v8 = vec_splat_u16(8);
+
+ /* set the alpha to 255 on the destination surf */
+ valphamask = VEC_ALPHA_MASK();
+
+ /* set a vector full of alpha and 255-alpha */
+ ((unsigned char *)&valpha)[0] = alpha;
+ valpha = vec_splat(valpha, 0);
+
+ while(height--) {
+ int width = info->d_width;
+#define ONE_PIXEL_BLEND(condition, widthvar) while ((condition)) { \
+ Uint32 s = *srcp; \
+ Uint32 d = *dstp; \
+ Uint32 s1 = s & 0xff00ff; \
+ Uint32 d1 = d & 0xff00ff; \
+ d1 = (d1 + ((s1 - d1) * alpha >> 8)) \
+ & 0xff00ff; \
+ s &= 0xff00; \
+ d &= 0xff00; \
+ d = (d + ((s - d) * alpha >> 8)) & 0xff00; \
+ *dstp = d1 | d | 0xff000000; \
+ ++srcp; \
+ ++dstp; \
+ widthvar--; \
+ }
+ ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width);
+ if (width > 0) {
+ int extrawidth = (width % 4);
+ vector unsigned char valigner = VEC_ALIGNER(srcp);
+ vector unsigned char vs = (vector unsigned char)vec_ld(0, srcp);
+ width -= extrawidth;
+ while (width) {
+ vector unsigned char voverflow;
+ vector unsigned char vd;
+
+ /* s = *srcp */
+ voverflow = (vector unsigned char)vec_ld(15, srcp);
+ vs = vec_perm(vs, voverflow, valigner);
+
+ /* d = *dstp */
+ vd = (vector unsigned char)vec_ld(0, dstp);
+
+ VEC_MULTIPLY_ALPHA(vs, vd, valpha, mergePermute, v1, v8);
+
+ /* set the alpha channel to full on */
+ vd = vec_or(vd, valphamask);
+
+ /* *dstp = res */
+ vec_st((vector unsigned int)vd, 0, dstp);
+
+ srcp += 4;
+ dstp += 4;
+ width -= 4;
+ vs = voverflow;
+ }
+ ONE_PIXEL_BLEND((extrawidth), extrawidth);
+ }
+#undef ONE_PIXEL_BLEND
+
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+}
+#if __MWERKS__
+#pragma altivec_model off
+#endif
+#endif /* SDL_ALTIVEC_BLITTERS */
+
+/* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */
+static void BlitRGBtoRGBSurfaceAlpha128(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint32 *srcp = (Uint32 *)info->s_pixels;
+ int srcskip = info->s_skip >> 2;
+ Uint32 *dstp = (Uint32 *)info->d_pixels;
+ int dstskip = info->d_skip >> 2;
+
+ while(height--) {
+ DUFFS_LOOP4({
+ Uint32 s = *srcp++;
+ Uint32 d = *dstp;
+ *dstp++ = ((((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1)
+ + (s & d & 0x00010101)) | 0xff000000;
+ }, width);
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+}
+
+/* fast RGB888->(A)RGB888 blending with surface alpha */
+static void BlitRGBtoRGBSurfaceAlpha(SDL_BlitInfo *info)
+{
+ unsigned alpha = info->src->alpha;
+ if(alpha == 128) {
+ BlitRGBtoRGBSurfaceAlpha128(info);
+ } else {
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint32 *srcp = (Uint32 *)info->s_pixels;
+ int srcskip = info->s_skip >> 2;
+ Uint32 *dstp = (Uint32 *)info->d_pixels;
+ int dstskip = info->d_skip >> 2;
+ Uint32 s;
+ Uint32 d;
+ Uint32 s1;
+ Uint32 d1;
+
+ while(height--) {
+ DUFFS_LOOP_DOUBLE2({
+ /* One Pixel Blend */
+ s = *srcp;
+ d = *dstp;
+ 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 | 0xff000000;
+ ++srcp;
+ ++dstp;
+ },{
+ /* Two Pixels Blend */
+ s = *srcp;
+ d = *dstp;
+ s1 = s & 0xff00ff;
+ d1 = d & 0xff00ff;
+ d1 += (s1 - d1) * alpha >> 8;
+ d1 &= 0xff00ff;
+
+ s = ((s & 0xff00) >> 8) |
+ ((srcp[1] & 0xff00) << 8);
+ d = ((d & 0xff00) >> 8) |
+ ((dstp[1] & 0xff00) << 8);
+ d += (s - d) * alpha >> 8;
+ d &= 0x00ff00ff;
+
+ *dstp++ = d1 | ((d << 8) & 0xff00) | 0xff000000;
+ ++srcp;
+
+ s1 = *srcp;
+ d1 = *dstp;
+ s1 &= 0xff00ff;
+ d1 &= 0xff00ff;
+ d1 += (s1 - d1) * alpha >> 8;
+ d1 &= 0xff00ff;
+
+ *dstp = d1 | ((d >> 8) & 0xff00) | 0xff000000;
+ ++srcp;
+ ++dstp;
+ }, width);
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+ }
+}
+
+/* fast ARGB888->(A)RGB888 blending with pixel alpha */
+static void BlitRGBtoRGBPixelAlpha(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint32 *srcp = (Uint32 *)info->s_pixels;
+ int srcskip = info->s_skip >> 2;
+ Uint32 *dstp = (Uint32 *)info->d_pixels;
+ int dstskip = info->d_skip >> 2;
+
+ while(height--) {
+ DUFFS_LOOP4({
+ Uint32 dalpha;
+ Uint32 d;
+ Uint32 s1;
+ Uint32 d1;
+ Uint32 s = *srcp;
+ Uint32 alpha = s >> 24;
+ /* FIXME: Here we special-case opaque alpha since the
+ compositioning used (>>8 instead of /255) doesn't handle
+ it correctly. Also special-case alpha=0 for speed?
+ Benchmark this! */
+ if(alpha) {
+ if(alpha == SDL_ALPHA_OPAQUE) {
+ *dstp = (s & 0x00ffffff) | (*dstp & 0xff000000);
+ } else {
+ /*
+ * take out the middle component (green), and process
+ * the other two in parallel. One multiply less.
+ */
+ 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;
+ }, width);
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+}
+
+#if GCC_ASMBLIT
+/* fast (as in MMX with prefetch) ARGB888->(A)RGB888 blending with pixel alpha */
+static void BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint32 *srcp = (Uint32 *)info->s_pixels;
+ int srcskip = info->s_skip >> 2;
+ Uint32 *dstp = (Uint32 *)info->d_pixels;
+ int dstskip = info->d_skip >> 2;
+ SDL_PixelFormat* sf = info->src;
+ Uint32 amask = sf->Amask;
+
+ __asm__ (
+ /* make mm6 all zeros. */
+ "pxor %%mm6, %%mm6\n"
+
+ /* Make a mask to preserve the alpha. */
+ "movd %0, %%mm7\n\t" /* 0000F000 -> mm7 */
+ "punpcklbw %%mm7, %%mm7\n\t" /* FF000000 -> mm7 */
+ "pcmpeqb %%mm4, %%mm4\n\t" /* FFFFFFFF -> mm4 */
+ "movq %%mm4, %%mm3\n\t" /* FFFFFFFF -> mm3 (for later) */
+ "pxor %%mm4, %%mm7\n\t" /* 00FFFFFF -> mm7 (mult mask) */
+
+ /* form channel masks */
+ "movq %%mm7, %%mm4\n\t" /* 00FFFFFF -> mm4 */
+ "packsswb %%mm6, %%mm4\n\t" /* 00000FFF -> mm4 (channel mask) */
+ "packsswb %%mm6, %%mm3\n\t" /* 0000FFFF -> mm3 */
+ "pxor %%mm4, %%mm3\n\t" /* 0000F000 -> mm3 (~channel mask) */
+
+ /* get alpha channel shift */
+ "movd %1, %%mm5\n\t" /* Ashift -> mm5 */
+
+ : /* nothing */ : "rm" (amask), "rm" ((Uint32) sf->Ashift) );
+
+ while(height--) {
+
+ DUFFS_LOOP4({
+ Uint32 alpha;
+
+ __asm__ (
+ "prefetch 64(%0)\n"
+ "prefetch 64(%1)\n"
+ : : "r" (srcp), "r" (dstp) );
+
+ alpha = *srcp & amask;
+ /* FIXME: Here we special-case opaque alpha since the
+ compositioning used (>>8 instead of /255) doesn't handle
+ it correctly. Also special-case alpha=0 for speed?
+ Benchmark this! */
+ if(alpha == 0) {
+ /* do nothing */
+ }
+ else if(alpha == amask) {
+ /* opaque alpha -- copy RGB, keep dst alpha */
+ /* using MMX here to free up regular registers for other things */
+ __asm__ (
+ "movd (%0), %%mm0\n\t" /* src(ARGB) -> mm0 (0000ARGB)*/
+ "movd (%1), %%mm1\n\t" /* dst(ARGB) -> mm1 (0000ARGB)*/
+ "pand %%mm4, %%mm0\n\t" /* src & chanmask -> mm0 */
+ "pand %%mm3, %%mm1\n\t" /* dst & ~chanmask -> mm2 */
+ "por %%mm0, %%mm1\n\t" /* src | dst -> mm1 */
+ "movd %%mm1, (%1) \n\t" /* mm1 -> dst */
+
+ : : "r" (srcp), "r" (dstp) );
+ }
+
+ else {
+ __asm__ (
+ /* load in the source, and dst. */
+ "movd (%0), %%mm0\n" /* mm0(s) = 0 0 0 0 | As Rs Gs Bs */
+ "movd (%1), %%mm1\n" /* mm1(d) = 0 0 0 0 | Ad Rd Gd Bd */
+
+ /* Move the src alpha into mm2 */
+
+ /* if supporting pshufw */
+ /*"pshufw $0x55, %%mm0, %%mm2\n" */ /* mm2 = 0 As 0 As | 0 As 0 As */
+ /*"psrlw $8, %%mm2\n" */
+
+ /* else: */
+ "movd %2, %%mm2\n"
+ "psrld %%mm5, %%mm2\n" /* mm2 = 0 0 0 0 | 0 0 0 As */
+ "punpcklwd %%mm2, %%mm2\n" /* mm2 = 0 0 0 0 | 0 As 0 As */
+ "punpckldq %%mm2, %%mm2\n" /* mm2 = 0 As 0 As | 0 As 0 As */
+ "pand %%mm7, %%mm2\n" /* to preserve dest alpha */
+
+ /* move the colors into words. */
+ "punpcklbw %%mm6, %%mm0\n" /* mm0 = 0 As 0 Rs | 0 Gs 0 Bs */
+ "punpcklbw %%mm6, %%mm1\n" /* mm0 = 0 Ad 0 Rd | 0 Gd 0 Bd */
+
+ /* src - dst */
+ "psubw %%mm1, %%mm0\n" /* mm0 = As-Ad Rs-Rd | Gs-Gd Bs-Bd */
+
+ /* A * (src-dst) */
+ "pmullw %%mm2, %%mm0\n" /* mm0 = 0*As-d As*Rs-d | As*Gs-d As*Bs-d */
+ "psrlw $8, %%mm0\n" /* mm0 = 0>>8 Rc>>8 | Gc>>8 Bc>>8 */
+ "paddb %%mm1, %%mm0\n" /* mm0 = 0+Ad Rc+Rd | Gc+Gd Bc+Bd */
+
+ "packuswb %%mm0, %%mm0\n" /* mm0 = | Ac Rc Gc Bc */
+
+ "movd %%mm0, (%1)\n" /* result in mm0 */
+
+ : : "r" (srcp), "r" (dstp), "r" (alpha) );
+
+ }
+ ++srcp;
+ ++dstp;
+ }, width);
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+
+ __asm__ (
+ "emms\n"
+ : );
+}
+/* End GCC_ASMBLIT*/
+
+#elif MSVC_ASMBLIT
+/* fast (as in MMX with prefetch) ARGB888->(A)RGB888 blending with pixel alpha */
+static void BlitRGBtoRGBPixelAlphaMMX3DNOW(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint32 *srcp = (Uint32 *)info->s_pixels;
+ int srcskip = info->s_skip >> 2;
+ Uint32 *dstp = (Uint32 *)info->d_pixels;
+ int dstskip = info->d_skip >> 2;
+ SDL_PixelFormat* sf = info->src;
+ Uint32 chanmask = sf->Rmask | sf->Gmask | sf->Bmask;
+ Uint32 amask = sf->Amask;
+ Uint32 ashift = sf->Ashift;
+ Uint64 multmask;
+
+ __m64 src1, dst1, mm_alpha, mm_zero, dmask;
+
+ mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */
+ multmask = ~(0xFFFFi64 << (ashift * 2));
+ dmask = *(__m64*) &multmask; /* dst alpha mask -> dmask */
+
+ while(height--) {
+ DUFFS_LOOP4({
+ Uint32 alpha;
+
+ _m_prefetch(srcp + 16);
+ _m_prefetch(dstp + 16);
+
+ alpha = *srcp & amask;
+ if (alpha == 0) {
+ /* do nothing */
+ } else if (alpha == amask) {
+ /* copy RGB, keep dst alpha */
+ *dstp = (*srcp & chanmask) | (*dstp & ~chanmask);
+ } else {
+ src1 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src1 (0000ARGB)*/
+ src1 = _mm_unpacklo_pi8(src1, mm_zero); /* 0A0R0G0B -> src1 */
+
+ dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB)*/
+ dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* 0A0R0G0B -> dst1 */
+
+ mm_alpha = _mm_cvtsi32_si64(alpha); /* alpha -> mm_alpha (0000000A) */
+ mm_alpha = _mm_srli_si64(mm_alpha, ashift); /* mm_alpha >> ashift -> mm_alpha(0000000A) */
+ mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */
+ mm_alpha = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha */
+ mm_alpha = _mm_and_si64(mm_alpha, dmask); /* 000A0A0A -> mm_alpha, preserve dst alpha on add */
+
+ /* blend */
+ src1 = _mm_sub_pi16(src1, dst1);/* src - dst -> src1 */
+ src1 = _mm_mullo_pi16(src1, mm_alpha); /* (src - dst) * alpha -> src1 */
+ src1 = _mm_srli_pi16(src1, 8); /* src1 >> 8 -> src1(000R0G0B) */
+ dst1 = _mm_add_pi8(src1, dst1); /* src1 + dst1(dst) -> dst1(0A0R0G0B) */
+ dst1 = _mm_packs_pu16(dst1, mm_zero); /* 0000ARGB -> dst1 */
+
+ *dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */
+ }
+ ++srcp;
+ ++dstp;
+ }, width);
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+ _mm_empty();
+}
+/* End MSVC_ASMBLIT */
+
+#endif /* GCC_ASMBLIT, MSVC_ASMBLIT */
+
+/* 16bpp special case for per-surface alpha=50%: blend 2 pixels in parallel */
+
+/* blend a single 16 bit pixel at 50% */
+#define BLEND16_50(d, s, mask) \
+ ((((s & mask) + (d & mask)) >> 1) + (s & d & (~mask & 0xffff)))
+
+/* blend two 16 bit pixels at 50% */
+#define BLEND2x16_50(d, s, mask) \
+ (((s & (mask | mask << 16)) >> 1) + ((d & (mask | mask << 16)) >> 1) \
+ + (s & d & (~(mask | mask << 16))))
+
+static void Blit16to16SurfaceAlpha128(SDL_BlitInfo *info, Uint16 mask)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint16 *srcp = (Uint16 *)info->s_pixels;
+ int srcskip = info->s_skip >> 1;
+ Uint16 *dstp = (Uint16 *)info->d_pixels;
+ int dstskip = info->d_skip >> 1;
+
+ while(height--) {
+ if(((uintptr_t)srcp ^ (uintptr_t)dstp) & 2) {
+ /*
+ * Source and destination not aligned, pipeline it.
+ * This is mostly a win for big blits but no loss for
+ * small ones
+ */
+ Uint32 prev_sw;
+ int w = width;
+
+ /* handle odd destination */
+ if((uintptr_t)dstp & 2) {
+ Uint16 d = *dstp, s = *srcp;
+ *dstp = BLEND16_50(d, s, mask);
+ dstp++;
+ srcp++;
+ w--;
+ }
+ srcp++; /* srcp is now 32-bit aligned */
+
+ /* bootstrap pipeline with first halfword */
+ prev_sw = ((Uint32 *)srcp)[-1];
+
+ while(w > 1) {
+ Uint32 sw, dw, s;
+ sw = *(Uint32 *)srcp;
+ dw = *(Uint32 *)dstp;
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+ s = (prev_sw << 16) + (sw >> 16);
+#else
+ s = (prev_sw >> 16) + (sw << 16);
+#endif
+ prev_sw = sw;
+ *(Uint32 *)dstp = BLEND2x16_50(dw, s, mask);
+ dstp += 2;
+ srcp += 2;
+ w -= 2;
+ }
+
+ /* final pixel if any */
+ if(w) {
+ Uint16 d = *dstp, s;
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+ s = (Uint16)prev_sw;
+#else
+ s = (Uint16)(prev_sw >> 16);
+#endif
+ *dstp = BLEND16_50(d, s, mask);
+ srcp++;
+ dstp++;
+ }
+ srcp += srcskip - 1;
+ dstp += dstskip;
+ } else {
+ /* source and destination are aligned */
+ int w = width;
+
+ /* first odd pixel? */
+ if((uintptr_t)srcp & 2) {
+ Uint16 d = *dstp, s = *srcp;
+ *dstp = BLEND16_50(d, s, mask);
+ srcp++;
+ dstp++;
+ w--;
+ }
+ /* srcp and dstp are now 32-bit aligned */
+
+ while(w > 1) {
+ Uint32 sw = *(Uint32 *)srcp;
+ Uint32 dw = *(Uint32 *)dstp;
+ *(Uint32 *)dstp = BLEND2x16_50(dw, sw, mask);
+ srcp += 2;
+ dstp += 2;
+ w -= 2;
+ }
+
+ /* last odd pixel? */
+ if(w) {
+ Uint16 d = *dstp, s = *srcp;
+ *dstp = BLEND16_50(d, s, mask);
+ srcp++;
+ dstp++;
+ }
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+ }
+}
+
+#if GCC_ASMBLIT
+/* fast RGB565->RGB565 blending with surface alpha */
+static void Blit565to565SurfaceAlphaMMX(SDL_BlitInfo *info)
+{
+ unsigned alpha = info->src->alpha; /* downscale alpha to 5 bits */
+ if(alpha == 128) {
+ Blit16to16SurfaceAlpha128(info, 0xf7de);
+ } else {
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint16 *srcp = (Uint16 *)info->s_pixels;
+ int srcskip = info->s_skip >> 1;
+ Uint16 *dstp = (Uint16 *)info->d_pixels;
+ int dstskip = info->d_skip >> 1;
+ Uint32 s, d;
+ Uint64 load;
+
+ alpha &= ~(1+2+4); /* cut alpha to get the exact same behaviour */
+ load = alpha;
+ alpha >>= 3; /* downscale alpha to 5 bits */
+
+ movq_m2r(load, mm0); /* alpha(0000000A) -> mm0 */
+ punpcklwd_r2r(mm0, mm0); /* 00000A0A -> mm0 */
+ punpcklwd_r2r(mm0, mm0); /* 0A0A0A0A -> mm0 */
+ /* position alpha to allow for mullo and mulhi on diff channels
+ to reduce the number of operations */
+ psllq_i2r(3, mm0);
+
+ /* Setup the 565 color channel masks */
+ load = 0x07E007E007E007E0ULL;
+ movq_m2r(load, mm4); /* MASKGREEN -> mm4 */
+ load = 0x001F001F001F001FULL;
+ movq_m2r(load, mm7); /* MASKBLUE -> mm7 */
+ while(height--) {
+ DUFFS_LOOP_QUATRO2(
+ {
+ s = *srcp++;
+ d = *dstp;
+ /*
+ * shift out the middle component (green) to
+ * the high 16 bits, and process all three RGB
+ * components at the same time.
+ */
+ s = (s | s << 16) & 0x07e0f81f;
+ d = (d | d << 16) & 0x07e0f81f;
+ d += (s - d) * alpha >> 5;
+ d &= 0x07e0f81f;
+ *dstp++ = d | d >> 16;
+ },{
+ s = *srcp++;
+ d = *dstp;
+ /*
+ * shift out the middle component (green) to
+ * the high 16 bits, and process all three RGB
+ * components at the same time.
+ */
+ s = (s | s << 16) & 0x07e0f81f;
+ d = (d | d << 16) & 0x07e0f81f;
+ d += (s - d) * alpha >> 5;
+ d &= 0x07e0f81f;
+ *dstp++ = d | d >> 16;
+ s = *srcp++;
+ d = *dstp;
+ /*
+ * shift out the middle component (green) to
+ * the high 16 bits, and process all three RGB
+ * components at the same time.
+ */
+ s = (s | s << 16) & 0x07e0f81f;
+ d = (d | d << 16) & 0x07e0f81f;
+ d += (s - d) * alpha >> 5;
+ d &= 0x07e0f81f;
+ *dstp++ = d | d >> 16;
+ },{
+ movq_m2r((*srcp), mm2);/* 4 src pixels -> mm2 */
+ movq_m2r((*dstp), mm3);/* 4 dst pixels -> mm3 */
+
+ /* red -- does not need a mask since the right shift clears
+ the uninteresting bits */
+ movq_r2r(mm2, mm5); /* src -> mm5 */
+ movq_r2r(mm3, mm6); /* dst -> mm6 */
+ psrlw_i2r(11, mm5); /* mm5 >> 11 -> mm5 [000r 000r 000r 000r] */
+ psrlw_i2r(11, mm6); /* mm6 >> 11 -> mm6 [000r 000r 000r 000r] */
+
+ /* blend */
+ psubw_r2r(mm6, mm5);/* src - dst -> mm5 */
+ pmullw_r2r(mm0, mm5); /* mm5 * alpha -> mm5 */
+ /* alpha used is actually 11 bits
+ 11 + 5 = 16 bits, so the sign bits are lost */
+ psrlw_i2r(11, mm5); /* mm5 >> 11 -> mm5 */
+ paddw_r2r(mm5, mm6); /* mm5 + mm6(dst) -> mm6 */
+ psllw_i2r(11, mm6); /* mm6 << 11 -> mm6 */
+
+ movq_r2r(mm6, mm1); /* save new reds in dsts */
+
+ /* green -- process the bits in place */
+ movq_r2r(mm2, mm5); /* src -> mm5 */
+ movq_r2r(mm3, mm6); /* dst -> mm6 */
+ pand_r2r(mm4, mm5); /* src & MASKGREEN -> mm5 */
+ pand_r2r(mm4, mm6); /* dst & MASKGREEN -> mm6 */
+
+ /* blend */
+ psubw_r2r(mm6, mm5);/* src - dst -> mm5 */
+ pmulhw_r2r(mm0, mm5); /* mm5 * alpha -> mm5 */
+ /* 11 + 11 - 16 = 6 bits, so all the lower uninteresting
+ bits are gone and the sign bits present */
+ psllw_i2r(5, mm5); /* mm5 << 5 -> mm5 */
+ paddw_r2r(mm5, mm6); /* mm5 + mm6(dst) -> mm6 */
+
+ por_r2r(mm6, mm1); /* save new greens in dsts */
+
+ /* blue */
+ movq_r2r(mm2, mm5); /* src -> mm5 */
+ movq_r2r(mm3, mm6); /* dst -> mm6 */
+ pand_r2r(mm7, mm5); /* src & MASKBLUE -> mm5[000b 000b 000b 000b] */
+ pand_r2r(mm7, mm6); /* dst & MASKBLUE -> mm6[000b 000b 000b 000b] */
+
+ /* blend */
+ psubw_r2r(mm6, mm5);/* src - dst -> mm5 */
+ pmullw_r2r(mm0, mm5); /* mm5 * alpha -> mm5 */
+ /* 11 + 5 = 16 bits, so the sign bits are lost and
+ the interesting bits will need to be MASKed */
+ psrlw_i2r(11, mm5); /* mm5 >> 11 -> mm5 */
+ paddw_r2r(mm5, mm6); /* mm5 + mm6(dst) -> mm6 */
+ pand_r2r(mm7, mm6); /* mm6 & MASKBLUE -> mm6[000b 000b 000b 000b] */
+
+ por_r2r(mm6, mm1); /* save new blues in dsts */
+
+ movq_r2m(mm1, *dstp); /* mm1 -> 4 dst pixels */
+
+ srcp += 4;
+ dstp += 4;
+ }, width);
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+ emms();
+ }
+}
+
+/* fast RGB555->RGB555 blending with surface alpha */
+static void Blit555to555SurfaceAlphaMMX(SDL_BlitInfo *info)
+{
+ unsigned alpha = info->src->alpha; /* downscale alpha to 5 bits */
+ if(alpha == 128) {
+ Blit16to16SurfaceAlpha128(info, 0xfbde);
+ } else {
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint16 *srcp = (Uint16 *)info->s_pixels;
+ int srcskip = info->s_skip >> 1;
+ Uint16 *dstp = (Uint16 *)info->d_pixels;
+ int dstskip = info->d_skip >> 1;
+ Uint32 s, d;
+ Uint64 load;
+
+ alpha &= ~(1+2+4); /* cut alpha to get the exact same behaviour */
+ load = alpha;
+ alpha >>= 3; /* downscale alpha to 5 bits */
+
+ movq_m2r(load, mm0); /* alpha(0000000A) -> mm0 */
+ punpcklwd_r2r(mm0, mm0); /* 00000A0A -> mm0 */
+ punpcklwd_r2r(mm0, mm0); /* 0A0A0A0A -> mm0 */
+ /* position alpha to allow for mullo and mulhi on diff channels
+ to reduce the number of operations */
+ psllq_i2r(3, mm0);
+
+ /* Setup the 555 color channel masks */
+ load = 0x03E003E003E003E0ULL;
+ movq_m2r(load, mm4); /* MASKGREEN -> mm4 */
+ load = 0x001F001F001F001FULL;
+ movq_m2r(load, mm7); /* MASKBLUE -> mm7 */
+ while(height--) {
+ DUFFS_LOOP_QUATRO2(
+ {
+ s = *srcp++;
+ d = *dstp;
+ /*
+ * shift out the middle component (green) to
+ * the high 16 bits, and process all three RGB
+ * components at the same time.
+ */
+ s = (s | s << 16) & 0x03e07c1f;
+ d = (d | d << 16) & 0x03e07c1f;
+ d += (s - d) * alpha >> 5;
+ d &= 0x03e07c1f;
+ *dstp++ = d | d >> 16;
+ },{
+ s = *srcp++;
+ d = *dstp;
+ /*
+ * shift out the middle component (green) to
+ * the high 16 bits, and process all three RGB
+ * components at the same time.
+ */
+ s = (s | s << 16) & 0x03e07c1f;
+ d = (d | d << 16) & 0x03e07c1f;
+ d += (s - d) * alpha >> 5;
+ d &= 0x03e07c1f;
+ *dstp++ = d | d >> 16;
+ s = *srcp++;
+ d = *dstp;
+ /*
+ * shift out the middle component (green) to
+ * the high 16 bits, and process all three RGB
+ * components at the same time.
+ */
+ s = (s | s << 16) & 0x03e07c1f;
+ d = (d | d << 16) & 0x03e07c1f;
+ d += (s - d) * alpha >> 5;
+ d &= 0x03e07c1f;
+ *dstp++ = d | d >> 16;
+ },{
+ movq_m2r((*srcp), mm2);/* 4 src pixels -> mm2 */
+ movq_m2r((*dstp), mm3);/* 4 dst pixels -> mm3 */
+
+ /* red -- process the bits in place */
+ psllq_i2r(5, mm4); /* turn MASKGREEN into MASKRED */
+ /* by reusing the GREEN mask we free up another mmx
+ register to accumulate the result */
+
+ movq_r2r(mm2, mm5); /* src -> mm5 */
+ movq_r2r(mm3, mm6); /* dst -> mm6 */
+ pand_r2r(mm4, mm5); /* src & MASKRED -> mm5 */
+ pand_r2r(mm4, mm6); /* dst & MASKRED -> mm6 */
+
+ /* blend */
+ psubw_r2r(mm6, mm5);/* src - dst -> mm5 */
+ pmulhw_r2r(mm0, mm5); /* mm5 * alpha -> mm5 */
+ /* 11 + 15 - 16 = 10 bits, uninteresting bits will be
+ cleared by a MASK below */
+ psllw_i2r(5, mm5); /* mm5 << 5 -> mm5 */
+ paddw_r2r(mm5, mm6); /* mm5 + mm6(dst) -> mm6 */
+ pand_r2r(mm4, mm6); /* mm6 & MASKRED -> mm6 */
+
+ psrlq_i2r(5, mm4); /* turn MASKRED back into MASKGREEN */
+
+ movq_r2r(mm6, mm1); /* save new reds in dsts */
+
+ /* green -- process the bits in place */
+ movq_r2r(mm2, mm5); /* src -> mm5 */
+ movq_r2r(mm3, mm6); /* dst -> mm6 */
+ pand_r2r(mm4, mm5); /* src & MASKGREEN -> mm5 */
+ pand_r2r(mm4, mm6); /* dst & MASKGREEN -> mm6 */
+
+ /* blend */
+ psubw_r2r(mm6, mm5);/* src - dst -> mm5 */
+ pmulhw_r2r(mm0, mm5); /* mm5 * alpha -> mm5 */
+ /* 11 + 10 - 16 = 5 bits, so all the lower uninteresting
+ bits are gone and the sign bits present */
+ psllw_i2r(5, mm5); /* mm5 << 5 -> mm5 */
+ paddw_r2r(mm5, mm6); /* mm5 + mm6(dst) -> mm6 */
+
+ por_r2r(mm6, mm1); /* save new greens in dsts */
+
+ /* blue */
+ movq_r2r(mm2, mm5); /* src -> mm5 */
+ movq_r2r(mm3, mm6); /* dst -> mm6 */
+ pand_r2r(mm7, mm5); /* src & MASKBLUE -> mm5[000b 000b 000b 000b] */
+ pand_r2r(mm7, mm6); /* dst & MASKBLUE -> mm6[000b 000b 000b 000b] */
+
+ /* blend */
+ psubw_r2r(mm6, mm5);/* src - dst -> mm5 */
+ pmullw_r2r(mm0, mm5); /* mm5 * alpha -> mm5 */
+ /* 11 + 5 = 16 bits, so the sign bits are lost and
+ the interesting bits will need to be MASKed */
+ psrlw_i2r(11, mm5); /* mm5 >> 11 -> mm5 */
+ paddw_r2r(mm5, mm6); /* mm5 + mm6(dst) -> mm6 */
+ pand_r2r(mm7, mm6); /* mm6 & MASKBLUE -> mm6[000b 000b 000b 000b] */
+
+ por_r2r(mm6, mm1); /* save new blues in dsts */
+
+ movq_r2m(mm1, *dstp);/* mm1 -> 4 dst pixels */
+
+ srcp += 4;
+ dstp += 4;
+ }, width);
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+ emms();
+ }
+}
+/* End GCC_ASMBLIT */
+
+#elif MSVC_ASMBLIT
+/* fast RGB565->RGB565 blending with surface alpha */
+static void Blit565to565SurfaceAlphaMMX(SDL_BlitInfo *info)
+{
+ unsigned alpha = info->src->alpha;
+ if(alpha == 128) {
+ Blit16to16SurfaceAlpha128(info, 0xf7de);
+ } else {
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint16 *srcp = (Uint16 *)info->s_pixels;
+ int srcskip = info->s_skip >> 1;
+ Uint16 *dstp = (Uint16 *)info->d_pixels;
+ int dstskip = info->d_skip >> 1;
+ Uint32 s, d;
+
+ __m64 src1, dst1, src2, dst2, gmask, bmask, mm_res, mm_alpha;
+
+ alpha &= ~(1+2+4); /* cut alpha to get the exact same behaviour */
+ mm_alpha = _mm_set_pi32(0, alpha); /* 0000000A -> mm_alpha */
+ alpha >>= 3; /* downscale alpha to 5 bits */
+
+ mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */
+ mm_alpha = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha */
+ /* position alpha to allow for mullo and mulhi on diff channels
+ to reduce the number of operations */
+ mm_alpha = _mm_slli_si64(mm_alpha, 3);
+
+ /* Setup the 565 color channel masks */
+ gmask = _mm_set_pi32(0x07E007E0, 0x07E007E0); /* MASKGREEN -> gmask */
+ bmask = _mm_set_pi32(0x001F001F, 0x001F001F); /* MASKBLUE -> bmask */
+
+ while(height--) {
+ DUFFS_LOOP_QUATRO2(
+ {
+ s = *srcp++;
+ d = *dstp;
+ /*
+ * shift out the middle component (green) to
+ * the high 16 bits, and process all three RGB
+ * components at the same time.
+ */
+ s = (s | s << 16) & 0x07e0f81f;
+ d = (d | d << 16) & 0x07e0f81f;
+ d += (s - d) * alpha >> 5;
+ d &= 0x07e0f81f;
+ *dstp++ = (Uint16)(d | d >> 16);
+ },{
+ s = *srcp++;
+ d = *dstp;
+ /*
+ * shift out the middle component (green) to
+ * the high 16 bits, and process all three RGB
+ * components at the same time.
+ */
+ s = (s | s << 16) & 0x07e0f81f;
+ d = (d | d << 16) & 0x07e0f81f;
+ d += (s - d) * alpha >> 5;
+ d &= 0x07e0f81f;
+ *dstp++ = (Uint16)(d | d >> 16);
+ s = *srcp++;
+ d = *dstp;
+ /*
+ * shift out the middle component (green) to
+ * the high 16 bits, and process all three RGB
+ * components at the same time.
+ */
+ s = (s | s << 16) & 0x07e0f81f;
+ d = (d | d << 16) & 0x07e0f81f;
+ d += (s - d) * alpha >> 5;
+ d &= 0x07e0f81f;
+ *dstp++ = (Uint16)(d | d >> 16);
+ },{
+ src1 = *(__m64*)srcp; /* 4 src pixels -> src1 */
+ dst1 = *(__m64*)dstp; /* 4 dst pixels -> dst1 */
+
+ /* red */
+ src2 = src1;
+ src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 [000r 000r 000r 000r] */
+
+ dst2 = dst1;
+ dst2 = _mm_srli_pi16(dst2, 11); /* dst2 >> 11 -> dst2 [000r 000r 000r 000r] */
+
+ /* blend */
+ src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
+ src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
+ src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 */
+ dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
+ dst2 = _mm_slli_pi16(dst2, 11); /* dst2 << 11 -> dst2 */
+
+ mm_res = dst2; /* RED -> mm_res */
+
+ /* green -- process the bits in place */
+ src2 = src1;
+ src2 = _mm_and_si64(src2, gmask); /* src & MASKGREEN -> src2 */
+
+ dst2 = dst1;
+ dst2 = _mm_and_si64(dst2, gmask); /* dst & MASKGREEN -> dst2 */
+
+ /* blend */
+ src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
+ src2 = _mm_mulhi_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
+ src2 = _mm_slli_pi16(src2, 5); /* src2 << 5 -> src2 */
+ dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
+
+ mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN -> mm_res */
+
+ /* blue */
+ src2 = src1;
+ src2 = _mm_and_si64(src2, bmask); /* src & MASKBLUE -> src2[000b 000b 000b 000b] */
+
+ dst2 = dst1;
+ dst2 = _mm_and_si64(dst2, bmask); /* dst & MASKBLUE -> dst2[000b 000b 000b 000b] */
+
+ /* blend */
+ src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
+ src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
+ src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 */
+ dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
+ dst2 = _mm_and_si64(dst2, bmask); /* dst2 & MASKBLUE -> dst2 */
+
+ mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN | BLUE -> mm_res */
+
+ *(__m64*)dstp = mm_res; /* mm_res -> 4 dst pixels */
+
+ srcp += 4;
+ dstp += 4;
+ }, width);
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+ _mm_empty();
+ }
+}
+
+/* fast RGB555->RGB555 blending with surface alpha */
+static void Blit555to555SurfaceAlphaMMX(SDL_BlitInfo *info)
+{
+ unsigned alpha = info->src->alpha;
+ if(alpha == 128) {
+ Blit16to16SurfaceAlpha128(info, 0xfbde);
+ } else {
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint16 *srcp = (Uint16 *)info->s_pixels;
+ int srcskip = info->s_skip >> 1;
+ Uint16 *dstp = (Uint16 *)info->d_pixels;
+ int dstskip = info->d_skip >> 1;
+ Uint32 s, d;
+
+ __m64 src1, dst1, src2, dst2, rmask, gmask, bmask, mm_res, mm_alpha;
+
+ alpha &= ~(1+2+4); /* cut alpha to get the exact same behaviour */
+ mm_alpha = _mm_set_pi32(0, alpha); /* 0000000A -> mm_alpha */
+ alpha >>= 3; /* downscale alpha to 5 bits */
+
+ mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */
+ mm_alpha = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha */
+ /* position alpha to allow for mullo and mulhi on diff channels
+ to reduce the number of operations */
+ mm_alpha = _mm_slli_si64(mm_alpha, 3);
+
+ /* Setup the 555 color channel masks */
+ rmask = _mm_set_pi32(0x7C007C00, 0x7C007C00); /* MASKRED -> rmask */
+ gmask = _mm_set_pi32(0x03E003E0, 0x03E003E0); /* MASKGREEN -> gmask */
+ bmask = _mm_set_pi32(0x001F001F, 0x001F001F); /* MASKBLUE -> bmask */
+
+ while(height--) {
+ DUFFS_LOOP_QUATRO2(
+ {
+ s = *srcp++;
+ d = *dstp;
+ /*
+ * shift out the middle component (green) to
+ * the high 16 bits, and process all three RGB
+ * components at the same time.
+ */
+ s = (s | s << 16) & 0x03e07c1f;
+ d = (d | d << 16) & 0x03e07c1f;
+ d += (s - d) * alpha >> 5;
+ d &= 0x03e07c1f;
+ *dstp++ = (Uint16)(d | d >> 16);
+ },{
+ s = *srcp++;
+ d = *dstp;
+ /*
+ * shift out the middle component (green) to
+ * the high 16 bits, and process all three RGB
+ * components at the same time.
+ */
+ s = (s | s << 16) & 0x03e07c1f;
+ d = (d | d << 16) & 0x03e07c1f;
+ d += (s - d) * alpha >> 5;
+ d &= 0x03e07c1f;
+ *dstp++ = (Uint16)(d | d >> 16);
+ s = *srcp++;
+ d = *dstp;
+ /*
+ * shift out the middle component (green) to
+ * the high 16 bits, and process all three RGB
+ * components at the same time.
+ */
+ s = (s | s << 16) & 0x03e07c1f;
+ d = (d | d << 16) & 0x03e07c1f;
+ d += (s - d) * alpha >> 5;
+ d &= 0x03e07c1f;
+ *dstp++ = (Uint16)(d | d >> 16);
+ },{
+ src1 = *(__m64*)srcp; /* 4 src pixels -> src1 */
+ dst1 = *(__m64*)dstp; /* 4 dst pixels -> dst1 */
+
+ /* red -- process the bits in place */
+ src2 = src1;
+ src2 = _mm_and_si64(src2, rmask); /* src & MASKRED -> src2 */
+
+ dst2 = dst1;
+ dst2 = _mm_and_si64(dst2, rmask); /* dst & MASKRED -> dst2 */
+
+ /* blend */
+ src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
+ src2 = _mm_mulhi_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
+ src2 = _mm_slli_pi16(src2, 5); /* src2 << 5 -> src2 */
+ dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
+ dst2 = _mm_and_si64(dst2, rmask); /* dst2 & MASKRED -> dst2 */
+
+ mm_res = dst2; /* RED -> mm_res */
+
+ /* green -- process the bits in place */
+ src2 = src1;
+ src2 = _mm_and_si64(src2, gmask); /* src & MASKGREEN -> src2 */
+
+ dst2 = dst1;
+ dst2 = _mm_and_si64(dst2, gmask); /* dst & MASKGREEN -> dst2 */
+
+ /* blend */
+ src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
+ src2 = _mm_mulhi_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
+ src2 = _mm_slli_pi16(src2, 5); /* src2 << 5 -> src2 */
+ dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
+
+ mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN -> mm_res */
+
+ /* blue */
+ src2 = src1; /* src -> src2 */
+ src2 = _mm_and_si64(src2, bmask); /* src & MASKBLUE -> src2[000b 000b 000b 000b] */
+
+ dst2 = dst1; /* dst -> dst2 */
+ dst2 = _mm_and_si64(dst2, bmask); /* dst & MASKBLUE -> dst2[000b 000b 000b 000b] */
+
+ /* blend */
+ src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
+ src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
+ src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 */
+ dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
+ dst2 = _mm_and_si64(dst2, bmask); /* dst2 & MASKBLUE -> dst2 */
+
+ mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN | BLUE -> mm_res */
+
+ *(__m64*)dstp = mm_res; /* mm_res -> 4 dst pixels */
+
+ srcp += 4;
+ dstp += 4;
+ }, width);
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+ _mm_empty();
+ }
+}
+#endif /* GCC_ASMBLIT, MSVC_ASMBLIT */
+
+/* fast RGB565->RGB565 blending with surface alpha */
+static void Blit565to565SurfaceAlpha(SDL_BlitInfo *info)
+{
+ unsigned alpha = info->src->alpha;
+ if(alpha == 128) {
+ Blit16to16SurfaceAlpha128(info, 0xf7de);
+ } else {
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint16 *srcp = (Uint16 *)info->s_pixels;
+ int srcskip = info->s_skip >> 1;
+ Uint16 *dstp = (Uint16 *)info->d_pixels;
+ int dstskip = info->d_skip >> 1;
+ alpha >>= 3; /* downscale alpha to 5 bits */
+
+ while(height--) {
+ DUFFS_LOOP4({
+ Uint32 s = *srcp++;
+ Uint32 d = *dstp;
+ /*
+ * shift out the middle component (green) to
+ * the high 16 bits, and process all three RGB
+ * components at the same time.
+ */
+ s = (s | s << 16) & 0x07e0f81f;
+ d = (d | d << 16) & 0x07e0f81f;
+ d += (s - d) * alpha >> 5;
+ d &= 0x07e0f81f;
+ *dstp++ = (Uint16)(d | d >> 16);
+ }, width);
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+ }
+}
+
+/* fast RGB555->RGB555 blending with surface alpha */
+static void Blit555to555SurfaceAlpha(SDL_BlitInfo *info)
+{
+ unsigned alpha = info->src->alpha; /* downscale alpha to 5 bits */
+ if(alpha == 128) {
+ Blit16to16SurfaceAlpha128(info, 0xfbde);
+ } else {
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint16 *srcp = (Uint16 *)info->s_pixels;
+ int srcskip = info->s_skip >> 1;
+ Uint16 *dstp = (Uint16 *)info->d_pixels;
+ int dstskip = info->d_skip >> 1;
+ alpha >>= 3; /* downscale alpha to 5 bits */
+
+ while(height--) {
+ DUFFS_LOOP4({
+ Uint32 s = *srcp++;
+ Uint32 d = *dstp;
+ /*
+ * shift out the middle component (green) to
+ * the high 16 bits, and process all three RGB
+ * components at the same time.
+ */
+ s = (s | s << 16) & 0x03e07c1f;
+ d = (d | d << 16) & 0x03e07c1f;
+ d += (s - d) * alpha >> 5;
+ d &= 0x03e07c1f;
+ *dstp++ = (Uint16)(d | d >> 16);
+ }, width);
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+ }
+}
+
+/* fast ARGB8888->RGB565 blending with pixel alpha */
+static void BlitARGBto565PixelAlpha(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint32 *srcp = (Uint32 *)info->s_pixels;
+ int srcskip = info->s_skip >> 2;
+ Uint16 *dstp = (Uint16 *)info->d_pixels;
+ int dstskip = info->d_skip >> 1;
+
+ while(height--) {
+ DUFFS_LOOP4({
+ Uint32 s = *srcp;
+ unsigned alpha = s >> 27; /* downscale alpha to 5 bits */
+ /* FIXME: Here we special-case opaque alpha since the
+ compositioning used (>>8 instead of /255) doesn't handle
+ it correctly. Also special-case alpha=0 for speed?
+ Benchmark this! */
+ if(alpha) {
+ if(alpha == (SDL_ALPHA_OPAQUE >> 3)) {
+ *dstp = (Uint16)((s >> 8 & 0xf800) + (s >> 5 & 0x7e0) + (s >> 3 & 0x1f));
+ } else {
+ Uint32 d = *dstp;
+ /*
+ * convert source and destination to G0RAB65565
+ * and blend all components at the same time
+ */
+ s = ((s & 0xfc00) << 11) + (s >> 8 & 0xf800)
+ + (s >> 3 & 0x1f);
+ d = (d | d << 16) & 0x07e0f81f;
+ d += (s - d) * alpha >> 5;
+ d &= 0x07e0f81f;
+ *dstp = (Uint16)(d | d >> 16);
+ }
+ }
+ srcp++;
+ dstp++;
+ }, width);
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+}
+
+/* fast ARGB8888->RGB555 blending with pixel alpha */
+static void BlitARGBto555PixelAlpha(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint32 *srcp = (Uint32 *)info->s_pixels;
+ int srcskip = info->s_skip >> 2;
+ Uint16 *dstp = (Uint16 *)info->d_pixels;
+ int dstskip = info->d_skip >> 1;
+
+ while(height--) {
+ DUFFS_LOOP4({
+ unsigned alpha;
+ Uint32 s = *srcp;
+ alpha = s >> 27; /* downscale alpha to 5 bits */
+ /* FIXME: Here we special-case opaque alpha since the
+ compositioning used (>>8 instead of /255) doesn't handle
+ it correctly. Also special-case alpha=0 for speed?
+ Benchmark this! */
+ if(alpha) {
+ if(alpha == (SDL_ALPHA_OPAQUE >> 3)) {
+ *dstp = (Uint16)((s >> 9 & 0x7c00) + (s >> 6 & 0x3e0) + (s >> 3 & 0x1f));
+ } else {
+ Uint32 d = *dstp;
+ /*
+ * convert source and destination to G0RAB65565
+ * and blend all components at the same time
+ */
+ s = ((s & 0xf800) << 10) + (s >> 9 & 0x7c00)
+ + (s >> 3 & 0x1f);
+ d = (d | d << 16) & 0x03e07c1f;
+ d += (s - d) * alpha >> 5;
+ d &= 0x03e07c1f;
+ *dstp = (Uint16)(d | d >> 16);
+ }
+ }
+ srcp++;
+ dstp++;
+ }, width);
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+}
+
+/* General (slow) N->N blending with per-surface alpha */
+static void BlitNtoNSurfaceAlpha(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint8 *dst = info->d_pixels;
+ int dstskip = info->d_skip;
+ SDL_PixelFormat *srcfmt = info->src;
+ SDL_PixelFormat *dstfmt = info->dst;
+ int srcbpp = srcfmt->BytesPerPixel;
+ int dstbpp = dstfmt->BytesPerPixel;
+ unsigned sA = srcfmt->alpha;
+ unsigned dA = dstfmt->Amask ? SDL_ALPHA_OPAQUE : 0;
+
+ if(sA) {
+ while ( height-- ) {
+ 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);
+ ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
+ src += srcbpp;
+ dst += dstbpp;
+ },
+ width);
+ src += srcskip;
+ dst += dstskip;
+ }
+ }
+}
+
+/* General (slow) colorkeyed N->N blending with per-surface alpha */
+static void BlitNtoNSurfaceAlphaKey(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint8 *dst = info->d_pixels;
+ int dstskip = info->d_skip;
+ SDL_PixelFormat *srcfmt = info->src;
+ SDL_PixelFormat *dstfmt = info->dst;
+ Uint32 ckey = srcfmt->colorkey;
+ int srcbpp = srcfmt->BytesPerPixel;
+ int dstbpp = dstfmt->BytesPerPixel;
+ unsigned sA = srcfmt->alpha;
+ unsigned dA = dstfmt->Amask ? SDL_ALPHA_OPAQUE : 0;
+
+ while ( height-- ) {
+ 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);
+ ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
+ }
+ src += srcbpp;
+ dst += dstbpp;
+ },
+ width);
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+
+/* General (slow) N->N blending with pixel alpha */
+static void BlitNtoNPixelAlpha(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint8 *dst = info->d_pixels;
+ int dstskip = info->d_skip;
+ SDL_PixelFormat *srcfmt = info->src;
+ SDL_PixelFormat *dstfmt = info->dst;
+
+ int srcbpp;
+ int dstbpp;
+
+ /* Set up some basic variables */
+ srcbpp = srcfmt->BytesPerPixel;
+ dstbpp = dstfmt->BytesPerPixel;
+
+ /* FIXME: for 8bpp source alpha, this doesn't get opaque values
+ quite right. for <8bpp source alpha, it gets them very wrong
+ (check all macros!)
+ It is unclear whether there is a good general solution that doesn't
+ need a branch (or a divide). */
+ while ( height-- ) {
+ 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);
+ }
+ src += srcbpp;
+ dst += dstbpp;
+ },
+ width);
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+
+
+SDL_loblit SDL_CalculateAlphaBlit(SDL_Surface *surface, int blit_index)
+{
+ SDL_PixelFormat *sf = surface->format;
+ SDL_PixelFormat *df = surface->map->dst->format;
+
+ if(sf->Amask == 0) {
+ if((surface->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY) {
+ if(df->BytesPerPixel == 1)
+ return BlitNto1SurfaceAlphaKey;
+ else
+#if SDL_ALTIVEC_BLITTERS
+ if (sf->BytesPerPixel == 4 && df->BytesPerPixel == 4 &&
+ !(surface->map->dst->flags & SDL_HWSURFACE) && SDL_HasAltiVec())
+ return Blit32to32SurfaceAlphaKeyAltivec;
+ else
+#endif
+ return BlitNtoNSurfaceAlphaKey;
+ } else {
+ /* Per-surface alpha blits */
+ switch(df->BytesPerPixel) {
+ case 1:
+ return BlitNto1SurfaceAlpha;
+
+ case 2:
+ if(surface->map->identity) {
+ if(df->Gmask == 0x7e0)
+ {
+#if MMX_ASMBLIT
+ if(SDL_HasMMX())
+ return Blit565to565SurfaceAlphaMMX;
+ else
+#endif
+ return Blit565to565SurfaceAlpha;
+ }
+ else if(df->Gmask == 0x3e0)
+ {
+#if MMX_ASMBLIT
+ if(SDL_HasMMX())
+ return Blit555to555SurfaceAlphaMMX;
+ else
+#endif
+ return Blit555to555SurfaceAlpha;
+ }
+ }
+ return BlitNtoNSurfaceAlpha;
+
+ case 4:
+ if(sf->Rmask == df->Rmask
+ && sf->Gmask == df->Gmask
+ && sf->Bmask == df->Bmask
+ && sf->BytesPerPixel == 4)
+ {
+#if MMX_ASMBLIT
+ if(sf->Rshift % 8 == 0
+ && sf->Gshift % 8 == 0
+ && sf->Bshift % 8 == 0
+ && SDL_HasMMX())
+ return BlitRGBtoRGBSurfaceAlphaMMX;
+#endif
+ if((sf->Rmask | sf->Gmask | sf->Bmask) == 0xffffff)
+ {
+#if SDL_ALTIVEC_BLITTERS
+ if(!(surface->map->dst->flags & SDL_HWSURFACE)
+ && SDL_HasAltiVec())
+ return BlitRGBtoRGBSurfaceAlphaAltivec;
+#endif
+ return BlitRGBtoRGBSurfaceAlpha;
+ }
+ }
+#if SDL_ALTIVEC_BLITTERS
+ if((sf->BytesPerPixel == 4) &&
+ !(surface->map->dst->flags & SDL_HWSURFACE) && SDL_HasAltiVec())
+ return Blit32to32SurfaceAlphaAltivec;
+ else
+#endif
+ return BlitNtoNSurfaceAlpha;
+
+ case 3:
+ default:
+ return BlitNtoNSurfaceAlpha;
+ }
+ }
+ } else {
+ /* Per-pixel alpha blits */
+ switch(df->BytesPerPixel) {
+ case 1:
+ return BlitNto1PixelAlpha;
+
+ case 2:
+#if SDL_ALTIVEC_BLITTERS
+ if(sf->BytesPerPixel == 4 && !(surface->map->dst->flags & SDL_HWSURFACE) &&
+ df->Gmask == 0x7e0 &&
+ df->Bmask == 0x1f && SDL_HasAltiVec())
+ return Blit32to565PixelAlphaAltivec;
+ else
+#endif
+ if(sf->BytesPerPixel == 4 && sf->Amask == 0xff000000
+ && sf->Gmask == 0xff00
+ && ((sf->Rmask == 0xff && df->Rmask == 0x1f)
+ || (sf->Bmask == 0xff && df->Bmask == 0x1f))) {
+ if(df->Gmask == 0x7e0)
+ return BlitARGBto565PixelAlpha;
+ else if(df->Gmask == 0x3e0)
+ return BlitARGBto555PixelAlpha;
+ }
+ return BlitNtoNPixelAlpha;
+
+ case 4:
+ if(sf->Rmask == df->Rmask
+ && sf->Gmask == df->Gmask
+ && sf->Bmask == df->Bmask
+ && sf->BytesPerPixel == 4)
+ {
+#if MMX_ASMBLIT
+ if(sf->Rshift % 8 == 0
+ && sf->Gshift % 8 == 0
+ && sf->Bshift % 8 == 0
+ && sf->Ashift % 8 == 0
+ && sf->Aloss == 0)
+ {
+ if(SDL_Has3DNow())
+ return BlitRGBtoRGBPixelAlphaMMX3DNOW;
+ if(SDL_HasMMX())
+ return BlitRGBtoRGBPixelAlphaMMX;
+ }
+#endif
+ if(sf->Amask == 0xff000000)
+ {
+#if SDL_ALTIVEC_BLITTERS
+ if(!(surface->map->dst->flags & SDL_HWSURFACE)
+ && SDL_HasAltiVec())
+ return BlitRGBtoRGBPixelAlphaAltivec;
+#endif
+ return BlitRGBtoRGBPixelAlpha;
+ }
+ }
+#if SDL_ALTIVEC_BLITTERS
+ if (sf->Amask && sf->BytesPerPixel == 4 &&
+ !(surface->map->dst->flags & SDL_HWSURFACE) && SDL_HasAltiVec())
+ return Blit32to32PixelAlphaAltivec;
+ else
+#endif
+ return BlitNtoNPixelAlpha;
+
+ case 3:
+ default:
+ return BlitNtoNPixelAlpha;
+ }
+ }
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/SDL_blit_N.c b/distrib/sdl-1.2.15/src/video/SDL_blit_N.c
new file mode 100644
index 0000000..858cee5
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_blit_N.c
@@ -0,0 +1,2492 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_video.h"
+#include "SDL_endian.h"
+#include "SDL_cpuinfo.h"
+#include "SDL_blit.h"
+
+/* Functions to blit from N-bit surfaces to other surfaces */
+
+#if SDL_ALTIVEC_BLITTERS
+#if __MWERKS__
+#pragma altivec_model on
+#endif
+#ifdef HAVE_ALTIVEC_H
+#include <altivec.h>
+#endif
+#define assert(X)
+#ifdef __MACOSX__
+#include <sys/sysctl.h>
+static size_t GetL3CacheSize( void )
+{
+ const char key[] = "hw.l3cachesize";
+ u_int64_t result = 0;
+ size_t typeSize = sizeof( result );
+
+
+ int err = sysctlbyname( key, &result, &typeSize, NULL, 0 );
+ if( 0 != err ) return 0;
+
+ return result;
+}
+#else
+static size_t GetL3CacheSize( void )
+{
+ /* XXX: Just guess G4 */
+ return 2097152;
+}
+#endif /* __MACOSX__ */
+
+#if (defined(__MACOSX__) && (__GNUC__ < 4))
+ #define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
+ (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 VSWIZZLE32(a,b,c,d) (vector unsigned char) \
+ ( 0x00+a, 0x00+b, 0x00+c, 0x00+d, \
+ 0x04+a, 0x04+b, 0x04+c, 0x04+d, \
+ 0x08+a, 0x08+b, 0x08+c, 0x08+d, \
+ 0x0C+a, 0x0C+b, 0x0C+c, 0x0C+d )
+
+#define MAKE8888(dstfmt, r, g, b, a) \
+ ( ((r<<dstfmt->Rshift)&dstfmt->Rmask) | \
+ ((g<<dstfmt->Gshift)&dstfmt->Gmask) | \
+ ((b<<dstfmt->Bshift)&dstfmt->Bmask) | \
+ ((a<<dstfmt->Ashift)&dstfmt->Amask) )
+
+/*
+ * Data Stream Touch...Altivec cache prefetching.
+ *
+ * Don't use this on a G5...however, the speed boost is very significant
+ * on a G4.
+ */
+#define DST_CHAN_SRC 1
+#define DST_CHAN_DEST 2
+
+/* macro to set DST control word value... */
+#define DST_CTRL(size, count, stride) \
+ (((size) << 24) | ((count) << 16) | (stride))
+
+#define VEC_ALIGNER(src) ((UNALIGNED_PTR(src)) \
+ ? vec_lvsl(0, src) \
+ : vec_add(vec_lvsl(8, src), vec_splat_u8(8)))
+
+/* Calculate the permute vector used for 32->32 swizzling */
+static vector unsigned char calc_swizzle32(const SDL_PixelFormat *srcfmt,
+ const SDL_PixelFormat *dstfmt)
+{
+ /*
+ * We have to assume that the bits that aren't used by other
+ * colors is alpha, and it's one complete byte, since some formats
+ * leave alpha with a zero mask, but we should still swizzle the bits.
+ */
+ /* ARGB */
+ const static struct SDL_PixelFormat default_pixel_format = {
+ NULL, 0, 0,
+ 0, 0, 0, 0,
+ 16, 8, 0, 24,
+ 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000,
+ 0, 0};
+ if (!srcfmt) {
+ srcfmt = &default_pixel_format;
+ }
+ if (!dstfmt) {
+ dstfmt = &default_pixel_format;
+ }
+ const vector unsigned char plus = VECUINT8_LITERAL(
+ 0x00, 0x00, 0x00, 0x00,
+ 0x04, 0x04, 0x04, 0x04,
+ 0x08, 0x08, 0x08, 0x08,
+ 0x0C, 0x0C, 0x0C, 0x0C );
+ vector unsigned char vswiz;
+ vector unsigned int srcvec;
+#define RESHIFT(X) (3 - ((X) >> 3))
+ Uint32 rmask = RESHIFT(srcfmt->Rshift) << (dstfmt->Rshift);
+ Uint32 gmask = RESHIFT(srcfmt->Gshift) << (dstfmt->Gshift);
+ Uint32 bmask = RESHIFT(srcfmt->Bshift) << (dstfmt->Bshift);
+ Uint32 amask;
+ /* Use zero for alpha if either surface doesn't have alpha */
+ if (dstfmt->Amask) {
+ amask = ((srcfmt->Amask) ? RESHIFT(srcfmt->Ashift) : 0x10) << (dstfmt->Ashift);
+ } else {
+ amask = 0x10101010 & ((dstfmt->Rmask | dstfmt->Gmask | dstfmt->Bmask) ^ 0xFFFFFFFF);
+ }
+#undef RESHIFT
+ ((unsigned int *)(char*)&srcvec)[0] = (rmask | gmask | bmask | amask);
+ vswiz = vec_add(plus, (vector unsigned char)vec_splat(srcvec, 0));
+ return(vswiz);
+}
+
+static void Blit_RGB888_RGB565(SDL_BlitInfo *info);
+static void Blit_RGB888_RGB565Altivec(SDL_BlitInfo *info) {
+ int height = info->d_height;
+ Uint8 *src = (Uint8 *) info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint8 *dst = (Uint8 *) info->d_pixels;
+ int dstskip = info->d_skip;
+ SDL_PixelFormat *srcfmt = info->src;
+ vector unsigned char valpha = vec_splat_u8(0);
+ vector unsigned char vpermute = calc_swizzle32(srcfmt, NULL);
+ vector unsigned char vgmerge = VECUINT8_LITERAL(
+ 0x00, 0x02, 0x00, 0x06,
+ 0x00, 0x0a, 0x00, 0x0e,
+ 0x00, 0x12, 0x00, 0x16,
+ 0x00, 0x1a, 0x00, 0x1e);
+ vector unsigned short v1 = vec_splat_u16(1);
+ vector unsigned short v3 = vec_splat_u16(3);
+ vector unsigned short v3f = VECUINT16_LITERAL(
+ 0x003f, 0x003f, 0x003f, 0x003f,
+ 0x003f, 0x003f, 0x003f, 0x003f);
+ vector unsigned short vfc = VECUINT16_LITERAL(
+ 0x00fc, 0x00fc, 0x00fc, 0x00fc,
+ 0x00fc, 0x00fc, 0x00fc, 0x00fc);
+ vector unsigned short vf800 = (vector unsigned short)vec_splat_u8(-7);
+ vf800 = vec_sl(vf800, vec_splat_u16(8));
+
+ while (height--) {
+ vector unsigned char valigner;
+ vector unsigned char voverflow;
+ vector unsigned char vsrc;
+
+ int width = info->d_width;
+ int extrawidth;
+
+ /* do scalar until we can align... */
+#define ONE_PIXEL_BLEND(condition, widthvar) \
+ while (condition) { \
+ Uint32 Pixel; \
+ unsigned sR, sG, sB, sA; \
+ DISEMBLE_RGBA((Uint8 *)src, 4, srcfmt, Pixel, \
+ sR, sG, sB, sA); \
+ *(Uint16 *)(dst) = (((sR << 8) & 0x0000F800) | \
+ ((sG << 3) & 0x000007E0) | \
+ ((sB >> 3) & 0x0000001F)); \
+ dst += 2; \
+ src += 4; \
+ widthvar--; \
+ }
+
+ ONE_PIXEL_BLEND(((UNALIGNED_PTR(dst)) && (width)), width);
+
+ /* After all that work, here's the vector part! */
+ extrawidth = (width % 8); /* trailing unaligned stores */
+ width -= extrawidth;
+ vsrc = vec_ld(0, src);
+ valigner = VEC_ALIGNER(src);
+
+ while (width) {
+ vector unsigned short vpixel, vrpixel, vgpixel, vbpixel;
+ vector unsigned int vsrc1, vsrc2;
+ vector unsigned char vdst;
+
+ voverflow = vec_ld(15, src);
+ vsrc = vec_perm(vsrc, voverflow, valigner);
+ vsrc1 = (vector unsigned int)vec_perm(vsrc, valpha, vpermute);
+ src += 16;
+ vsrc = voverflow;
+ voverflow = vec_ld(15, src);
+ vsrc = vec_perm(vsrc, voverflow, valigner);
+ vsrc2 = (vector unsigned int)vec_perm(vsrc, valpha, vpermute);
+ /* 1555 */
+ vpixel = (vector unsigned short)vec_packpx(vsrc1, vsrc2);
+ vgpixel = (vector unsigned short)vec_perm(vsrc1, vsrc2, vgmerge);
+ vgpixel = vec_and(vgpixel, vfc);
+ vgpixel = vec_sl(vgpixel, v3);
+ vrpixel = vec_sl(vpixel, v1);
+ vrpixel = vec_and(vrpixel, vf800);
+ vbpixel = vec_and(vpixel, v3f);
+ vdst = vec_or((vector unsigned char)vrpixel, (vector unsigned char)vgpixel);
+ /* 565 */
+ vdst = vec_or(vdst, (vector unsigned char)vbpixel);
+ vec_st(vdst, 0, dst);
+
+ width -= 8;
+ src += 16;
+ dst += 16;
+ vsrc = voverflow;
+ }
+
+ assert(width == 0);
+
+ /* do scalar until we can align... */
+ ONE_PIXEL_BLEND((extrawidth), extrawidth);
+#undef ONE_PIXEL_BLEND
+
+ src += srcskip; /* move to next row, accounting for pitch. */
+ dst += dstskip;
+ }
+
+
+}
+
+static void Blit_RGB565_32Altivec(SDL_BlitInfo *info) {
+ int height = info->d_height;
+ Uint8 *src = (Uint8 *) info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint8 *dst = (Uint8 *) info->d_pixels;
+ int dstskip = info->d_skip;
+ SDL_PixelFormat *srcfmt = info->src;
+ SDL_PixelFormat *dstfmt = info->dst;
+ unsigned alpha;
+ vector unsigned char valpha;
+ vector unsigned char vpermute;
+ vector unsigned short vf800;
+ vector unsigned int v8 = vec_splat_u32(8);
+ vector unsigned int v16 = vec_add(v8, v8);
+ vector unsigned short v2 = vec_splat_u16(2);
+ vector unsigned short v3 = vec_splat_u16(3);
+ /*
+ 0x10 - 0x1f is the alpha
+ 0x00 - 0x0e evens are the red
+ 0x01 - 0x0f odds are zero
+ */
+ vector unsigned char vredalpha1 = VECUINT8_LITERAL(
+ 0x10, 0x00, 0x01, 0x01,
+ 0x10, 0x02, 0x01, 0x01,
+ 0x10, 0x04, 0x01, 0x01,
+ 0x10, 0x06, 0x01, 0x01
+ );
+ vector unsigned char vredalpha2 = (vector unsigned char) (
+ vec_add((vector unsigned int)vredalpha1, vec_sl(v8, v16))
+ );
+ /*
+ 0x00 - 0x0f is ARxx ARxx ARxx ARxx
+ 0x11 - 0x0f odds are blue
+ */
+ vector unsigned char vblue1 = VECUINT8_LITERAL(
+ 0x00, 0x01, 0x02, 0x11,
+ 0x04, 0x05, 0x06, 0x13,
+ 0x08, 0x09, 0x0a, 0x15,
+ 0x0c, 0x0d, 0x0e, 0x17
+ );
+ vector unsigned char vblue2 = (vector unsigned char)(
+ vec_add((vector unsigned int)vblue1, v8)
+ );
+ /*
+ 0x00 - 0x0f is ARxB ARxB ARxB ARxB
+ 0x10 - 0x0e evens are green
+ */
+ vector unsigned char vgreen1 = VECUINT8_LITERAL(
+ 0x00, 0x01, 0x10, 0x03,
+ 0x04, 0x05, 0x12, 0x07,
+ 0x08, 0x09, 0x14, 0x0b,
+ 0x0c, 0x0d, 0x16, 0x0f
+ );
+ vector unsigned char vgreen2 = (vector unsigned char)(
+ vec_add((vector unsigned int)vgreen1, vec_sl(v8, v8))
+ );
+
+
+ assert(srcfmt->BytesPerPixel == 2);
+ assert(dstfmt->BytesPerPixel == 4);
+
+ vf800 = (vector unsigned short)vec_splat_u8(-7);
+ vf800 = vec_sl(vf800, vec_splat_u16(8));
+
+ if (dstfmt->Amask && srcfmt->alpha) {
+ ((unsigned char *)&valpha)[0] = alpha = srcfmt->alpha;
+ valpha = vec_splat(valpha, 0);
+ } else {
+ alpha = 0;
+ valpha = vec_splat_u8(0);
+ }
+
+ vpermute = calc_swizzle32(NULL, dstfmt);
+ while (height--) {
+ vector unsigned char valigner;
+ vector unsigned char voverflow;
+ vector unsigned char vsrc;
+
+ int width = info->d_width;
+ int extrawidth;
+
+ /* do scalar until we can align... */
+#define ONE_PIXEL_BLEND(condition, widthvar) \
+ while (condition) { \
+ unsigned sR, sG, sB; \
+ unsigned short Pixel = *((unsigned short *)src); \
+ sR = (Pixel >> 8) & 0xf8; \
+ sG = (Pixel >> 3) & 0xfc; \
+ sB = (Pixel << 3) & 0xf8; \
+ ASSEMBLE_RGBA(dst, 4, dstfmt, sR, sG, sB, alpha); \
+ src += 2; \
+ dst += 4; \
+ widthvar--; \
+ }
+ ONE_PIXEL_BLEND(((UNALIGNED_PTR(dst)) && (width)), width);
+
+ /* After all that work, here's the vector part! */
+ extrawidth = (width % 8); /* trailing unaligned stores */
+ width -= extrawidth;
+ vsrc = vec_ld(0, src);
+ valigner = VEC_ALIGNER(src);
+
+ while (width) {
+ vector unsigned short vR, vG, vB;
+ vector unsigned char vdst1, vdst2;
+
+ voverflow = vec_ld(15, src);
+ vsrc = vec_perm(vsrc, voverflow, valigner);
+
+ vR = vec_and((vector unsigned short)vsrc, vf800);
+ vB = vec_sl((vector unsigned short)vsrc, v3);
+ vG = vec_sl(vB, v2);
+
+ vdst1 = (vector unsigned char)vec_perm((vector unsigned char)vR, valpha, vredalpha1);
+ vdst1 = vec_perm(vdst1, (vector unsigned char)vB, vblue1);
+ vdst1 = vec_perm(vdst1, (vector unsigned char)vG, vgreen1);
+ vdst1 = vec_perm(vdst1, valpha, vpermute);
+ vec_st(vdst1, 0, dst);
+
+ vdst2 = (vector unsigned char)vec_perm((vector unsigned char)vR, valpha, vredalpha2);
+ vdst2 = vec_perm(vdst2, (vector unsigned char)vB, vblue2);
+ vdst2 = vec_perm(vdst2, (vector unsigned char)vG, vgreen2);
+ vdst2 = vec_perm(vdst2, valpha, vpermute);
+ vec_st(vdst2, 16, dst);
+
+ width -= 8;
+ dst += 32;
+ src += 16;
+ vsrc = voverflow;
+ }
+
+ assert(width == 0);
+
+
+ /* do scalar until we can align... */
+ ONE_PIXEL_BLEND((extrawidth), extrawidth);
+#undef ONE_PIXEL_BLEND
+
+ src += srcskip; /* move to next row, accounting for pitch. */
+ dst += dstskip;
+ }
+
+}
+
+
+static void Blit_RGB555_32Altivec(SDL_BlitInfo *info) {
+ int height = info->d_height;
+ Uint8 *src = (Uint8 *) info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint8 *dst = (Uint8 *) info->d_pixels;
+ int dstskip = info->d_skip;
+ SDL_PixelFormat *srcfmt = info->src;
+ SDL_PixelFormat *dstfmt = info->dst;
+ unsigned alpha;
+ vector unsigned char valpha;
+ vector unsigned char vpermute;
+ vector unsigned short vf800;
+ vector unsigned int v8 = vec_splat_u32(8);
+ vector unsigned int v16 = vec_add(v8, v8);
+ vector unsigned short v1 = vec_splat_u16(1);
+ vector unsigned short v3 = vec_splat_u16(3);
+ /*
+ 0x10 - 0x1f is the alpha
+ 0x00 - 0x0e evens are the red
+ 0x01 - 0x0f odds are zero
+ */
+ vector unsigned char vredalpha1 = VECUINT8_LITERAL(
+ 0x10, 0x00, 0x01, 0x01,
+ 0x10, 0x02, 0x01, 0x01,
+ 0x10, 0x04, 0x01, 0x01,
+ 0x10, 0x06, 0x01, 0x01
+ );
+ vector unsigned char vredalpha2 = (vector unsigned char)(
+ vec_add((vector unsigned int)vredalpha1, vec_sl(v8, v16))
+ );
+ /*
+ 0x00 - 0x0f is ARxx ARxx ARxx ARxx
+ 0x11 - 0x0f odds are blue
+ */
+ vector unsigned char vblue1 = VECUINT8_LITERAL(
+ 0x00, 0x01, 0x02, 0x11,
+ 0x04, 0x05, 0x06, 0x13,
+ 0x08, 0x09, 0x0a, 0x15,
+ 0x0c, 0x0d, 0x0e, 0x17
+ );
+ vector unsigned char vblue2 = (vector unsigned char)(
+ vec_add((vector unsigned int)vblue1, v8)
+ );
+ /*
+ 0x00 - 0x0f is ARxB ARxB ARxB ARxB
+ 0x10 - 0x0e evens are green
+ */
+ vector unsigned char vgreen1 = VECUINT8_LITERAL(
+ 0x00, 0x01, 0x10, 0x03,
+ 0x04, 0x05, 0x12, 0x07,
+ 0x08, 0x09, 0x14, 0x0b,
+ 0x0c, 0x0d, 0x16, 0x0f
+ );
+ vector unsigned char vgreen2 = (vector unsigned char)(
+ vec_add((vector unsigned int)vgreen1, vec_sl(v8, v8))
+ );
+
+
+ assert(srcfmt->BytesPerPixel == 2);
+ assert(dstfmt->BytesPerPixel == 4);
+
+ vf800 = (vector unsigned short)vec_splat_u8(-7);
+ vf800 = vec_sl(vf800, vec_splat_u16(8));
+
+ if (dstfmt->Amask && srcfmt->alpha) {
+ ((unsigned char *)&valpha)[0] = alpha = srcfmt->alpha;
+ valpha = vec_splat(valpha, 0);
+ } else {
+ alpha = 0;
+ valpha = vec_splat_u8(0);
+ }
+
+ vpermute = calc_swizzle32(NULL, dstfmt);
+ while (height--) {
+ vector unsigned char valigner;
+ vector unsigned char voverflow;
+ vector unsigned char vsrc;
+
+ int width = info->d_width;
+ int extrawidth;
+
+ /* do scalar until we can align... */
+#define ONE_PIXEL_BLEND(condition, widthvar) \
+ while (condition) { \
+ unsigned sR, sG, sB; \
+ unsigned short Pixel = *((unsigned short *)src); \
+ sR = (Pixel >> 7) & 0xf8; \
+ sG = (Pixel >> 2) & 0xf8; \
+ sB = (Pixel << 3) & 0xf8; \
+ ASSEMBLE_RGBA(dst, 4, dstfmt, sR, sG, sB, alpha); \
+ src += 2; \
+ dst += 4; \
+ widthvar--; \
+ }
+ ONE_PIXEL_BLEND(((UNALIGNED_PTR(dst)) && (width)), width);
+
+ /* After all that work, here's the vector part! */
+ extrawidth = (width % 8); /* trailing unaligned stores */
+ width -= extrawidth;
+ vsrc = vec_ld(0, src);
+ valigner = VEC_ALIGNER(src);
+
+ while (width) {
+ vector unsigned short vR, vG, vB;
+ vector unsigned char vdst1, vdst2;
+
+ voverflow = vec_ld(15, src);
+ vsrc = vec_perm(vsrc, voverflow, valigner);
+
+ vR = vec_and(vec_sl((vector unsigned short)vsrc,v1), vf800);
+ vB = vec_sl((vector unsigned short)vsrc, v3);
+ vG = vec_sl(vB, v3);
+
+ vdst1 = (vector unsigned char)vec_perm((vector unsigned char)vR, valpha, vredalpha1);
+ vdst1 = vec_perm(vdst1, (vector unsigned char)vB, vblue1);
+ vdst1 = vec_perm(vdst1, (vector unsigned char)vG, vgreen1);
+ vdst1 = vec_perm(vdst1, valpha, vpermute);
+ vec_st(vdst1, 0, dst);
+
+ vdst2 = (vector unsigned char)vec_perm((vector unsigned char)vR, valpha, vredalpha2);
+ vdst2 = vec_perm(vdst2, (vector unsigned char)vB, vblue2);
+ vdst2 = vec_perm(vdst2, (vector unsigned char)vG, vgreen2);
+ vdst2 = vec_perm(vdst2, valpha, vpermute);
+ vec_st(vdst2, 16, dst);
+
+ width -= 8;
+ dst += 32;
+ src += 16;
+ vsrc = voverflow;
+ }
+
+ assert(width == 0);
+
+
+ /* do scalar until we can align... */
+ ONE_PIXEL_BLEND((extrawidth), extrawidth);
+#undef ONE_PIXEL_BLEND
+
+ src += srcskip; /* move to next row, accounting for pitch. */
+ dst += dstskip;
+ }
+
+}
+
+static void BlitNtoNKey(SDL_BlitInfo *info);
+static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info);
+static void Blit32to32KeyAltivec(SDL_BlitInfo *info)
+{
+ int height = info->d_height;
+ Uint32 *srcp = (Uint32 *) info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint32 *dstp = (Uint32 *) info->d_pixels;
+ int dstskip = info->d_skip;
+ SDL_PixelFormat *srcfmt = info->src;
+ int srcbpp = srcfmt->BytesPerPixel;
+ SDL_PixelFormat *dstfmt = info->dst;
+ int dstbpp = dstfmt->BytesPerPixel;
+ int copy_alpha = (srcfmt->Amask && dstfmt->Amask);
+ unsigned alpha = dstfmt->Amask ? srcfmt->alpha : 0;
+ Uint32 rgbmask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask;
+ Uint32 ckey = info->src->colorkey;
+ vector unsigned int valpha;
+ vector unsigned char vpermute;
+ vector unsigned char vzero;
+ vector unsigned int vckey;
+ vector unsigned int vrgbmask;
+ vpermute = calc_swizzle32(srcfmt, dstfmt);
+ if (info->d_width < 16) {
+ if(copy_alpha) {
+ BlitNtoNKeyCopyAlpha(info);
+ } else {
+ BlitNtoNKey(info);
+ }
+ return;
+ }
+ vzero = vec_splat_u8(0);
+ if (alpha) {
+ ((unsigned char *)&valpha)[0] = (unsigned char)alpha;
+ valpha = (vector unsigned int)vec_splat((vector unsigned char)valpha, 0);
+ } else {
+ valpha = (vector unsigned int)vzero;
+ }
+ 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--) {
+#define ONE_PIXEL_BLEND(condition, widthvar) \
+ if (copy_alpha) { \
+ while (condition) { \
+ Uint32 Pixel; \
+ unsigned sR, sG, sB, sA; \
+ DISEMBLE_RGBA((Uint8 *)srcp, srcbpp, srcfmt, Pixel, \
+ sR, sG, sB, sA); \
+ if ( (Pixel & rgbmask) != ckey ) { \
+ ASSEMBLE_RGBA((Uint8 *)dstp, dstbpp, dstfmt, \
+ sR, sG, sB, sA); \
+ } \
+ dstp = (Uint32 *) (((Uint8 *) dstp) + dstbpp); \
+ srcp = (Uint32 *) (((Uint8 *) srcp) + srcbpp); \
+ widthvar--; \
+ } \
+ } else { \
+ while (condition) { \
+ Uint32 Pixel; \
+ unsigned sR, sG, sB; \
+ RETRIEVE_RGB_PIXEL((Uint8 *)srcp, srcbpp, Pixel); \
+ if ( Pixel != ckey ) { \
+ RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB); \
+ ASSEMBLE_RGBA((Uint8 *)dstp, dstbpp, dstfmt, \
+ sR, sG, sB, alpha); \
+ } \
+ dstp = (Uint32 *) (((Uint8 *)dstp) + dstbpp); \
+ srcp = (Uint32 *) (((Uint8 *)srcp) + srcbpp); \
+ widthvar--; \
+ } \
+ }
+ int width = info->d_width;
+ ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width);
+ assert(width > 0);
+ if (width > 0) {
+ int extrawidth = (width % 4);
+ vector unsigned char valigner = VEC_ALIGNER(srcp);
+ vector unsigned int vs = vec_ld(0, srcp);
+ width -= extrawidth;
+ assert(width >= 4);
+ while (width) {
+ vector unsigned char vsel;
+ vector unsigned int vd;
+ vector unsigned int voverflow = vec_ld(15, srcp);
+ /* load the source vec */
+ vs = vec_perm(vs, voverflow, valigner);
+ /* vsel is set for items that match the key */
+ vsel = (vector unsigned char)vec_and(vs, vrgbmask);
+ vsel = (vector unsigned char)vec_cmpeq(vs, vckey);
+ /* permute the src vec to the dest format */
+ vs = vec_perm(vs, valpha, vpermute);
+ /* load the destination vec */
+ vd = vec_ld(0, dstp);
+ /* select the source and dest into vs */
+ vd = (vector unsigned int)vec_sel((vector unsigned char)vs, (vector unsigned char)vd, vsel);
+
+ vec_st(vd, 0, dstp);
+ srcp += 4;
+ width -= 4;
+ dstp += 4;
+ vs = voverflow;
+ }
+ ONE_PIXEL_BLEND((extrawidth), extrawidth);
+#undef ONE_PIXEL_BLEND
+ srcp += srcskip >> 2;
+ dstp += dstskip >> 2;
+ }
+ }
+}
+
+/* Altivec code to swizzle one 32-bit surface to a different 32-bit format. */
+/* Use this on a G5 */
+static void ConvertAltivec32to32_noprefetch(SDL_BlitInfo *info)
+{
+ int height = info->d_height;
+ Uint32 *src = (Uint32 *) info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint32 *dst = (Uint32 *) info->d_pixels;
+ int dstskip = info->d_skip;
+ SDL_PixelFormat *srcfmt = info->src;
+ SDL_PixelFormat *dstfmt = info->dst;
+ vector unsigned int vzero = vec_splat_u32(0);
+ vector unsigned char vpermute = calc_swizzle32(srcfmt, dstfmt);
+ if (dstfmt->Amask && !srcfmt->Amask) {
+ if (srcfmt->alpha) {
+ vector unsigned char valpha;
+ ((unsigned char *)&valpha)[0] = srcfmt->alpha;
+ vzero = (vector unsigned int)vec_splat(valpha, 0);
+ }
+ }
+
+ assert(srcfmt->BytesPerPixel == 4);
+ assert(dstfmt->BytesPerPixel == 4);
+
+ while (height--) {
+ vector unsigned char valigner;
+ vector unsigned int vbits;
+ vector unsigned int voverflow;
+ Uint32 bits;
+ Uint8 r, g, b, a;
+
+ int width = info->d_width;
+ int extrawidth;
+
+ /* do scalar until we can align... */
+ while ((UNALIGNED_PTR(dst)) && (width)) {
+ bits = *(src++);
+ RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
+ *(dst++) = MAKE8888(dstfmt, r, g, b, a);
+ width--;
+ }
+
+ /* After all that work, here's the vector part! */
+ extrawidth = (width % 4);
+ width -= extrawidth;
+ valigner = VEC_ALIGNER(src);
+ vbits = vec_ld(0, src);
+
+ while (width) {
+ voverflow = vec_ld(15, src);
+ src += 4;
+ width -= 4;
+ vbits = vec_perm(vbits, voverflow, valigner); /* src is ready. */
+ vbits = vec_perm(vbits, vzero, vpermute); /* swizzle it. */
+ vec_st(vbits, 0, dst); /* store it back out. */
+ dst += 4;
+ vbits = voverflow;
+ }
+
+ assert(width == 0);
+
+ /* cover pixels at the end of the row that didn't fit in 16 bytes. */
+ while (extrawidth) {
+ bits = *(src++); /* max 7 pixels, don't bother with prefetch. */
+ RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
+ *(dst++) = MAKE8888(dstfmt, r, g, b, a);
+ extrawidth--;
+ }
+
+ src += srcskip >> 2; /* move to next row, accounting for pitch. */
+ dst += dstskip >> 2;
+ }
+
+}
+
+/* Altivec code to swizzle one 32-bit surface to a different 32-bit format. */
+/* Use this on a G4 */
+static void ConvertAltivec32to32_prefetch(SDL_BlitInfo *info)
+{
+ const int scalar_dst_lead = sizeof (Uint32) * 4;
+ const int vector_dst_lead = sizeof (Uint32) * 16;
+
+ int height = info->d_height;
+ Uint32 *src = (Uint32 *) info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint32 *dst = (Uint32 *) info->d_pixels;
+ int dstskip = info->d_skip;
+ SDL_PixelFormat *srcfmt = info->src;
+ SDL_PixelFormat *dstfmt = info->dst;
+ vector unsigned int vzero = vec_splat_u32(0);
+ vector unsigned char vpermute = calc_swizzle32(srcfmt, dstfmt);
+ if (dstfmt->Amask && !srcfmt->Amask) {
+ if (srcfmt->alpha) {
+ vector unsigned char valpha;
+ ((unsigned char *)&valpha)[0] = srcfmt->alpha;
+ vzero = (vector unsigned int)vec_splat(valpha, 0);
+ }
+ }
+
+ assert(srcfmt->BytesPerPixel == 4);
+ assert(dstfmt->BytesPerPixel == 4);
+
+ while (height--) {
+ vector unsigned char valigner;
+ vector unsigned int vbits;
+ vector unsigned int voverflow;
+ Uint32 bits;
+ Uint8 r, g, b, a;
+
+ int width = info->d_width;
+ int extrawidth;
+
+ /* do scalar until we can align... */
+ while ((UNALIGNED_PTR(dst)) && (width)) {
+ vec_dstt(src+scalar_dst_lead, DST_CTRL(2,32,1024), DST_CHAN_SRC);
+ vec_dstst(dst+scalar_dst_lead, DST_CTRL(2,32,1024), DST_CHAN_DEST);
+ bits = *(src++);
+ RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
+ *(dst++) = MAKE8888(dstfmt, r, g, b, a);
+ width--;
+ }
+
+ /* After all that work, here's the vector part! */
+ extrawidth = (width % 4);
+ width -= extrawidth;
+ valigner = VEC_ALIGNER(src);
+ vbits = vec_ld(0, src);
+
+ while (width) {
+ vec_dstt(src+vector_dst_lead, DST_CTRL(2,32,1024), DST_CHAN_SRC);
+ vec_dstst(dst+vector_dst_lead, DST_CTRL(2,32,1024), DST_CHAN_DEST);
+ voverflow = vec_ld(15, src);
+ src += 4;
+ width -= 4;
+ vbits = vec_perm(vbits, voverflow, valigner); /* src is ready. */
+ vbits = vec_perm(vbits, vzero, vpermute); /* swizzle it. */
+ vec_st(vbits, 0, dst); /* store it back out. */
+ dst += 4;
+ vbits = voverflow;
+ }
+
+ assert(width == 0);
+
+ /* cover pixels at the end of the row that didn't fit in 16 bytes. */
+ while (extrawidth) {
+ bits = *(src++); /* max 7 pixels, don't bother with prefetch. */
+ RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
+ *(dst++) = MAKE8888(dstfmt, r, g, b, a);
+ extrawidth--;
+ }
+
+ src += srcskip >> 2; /* move to next row, accounting for pitch. */
+ dst += dstskip >> 2;
+ }
+
+ vec_dss(DST_CHAN_SRC);
+ vec_dss(DST_CHAN_DEST);
+}
+
+static Uint32 GetBlitFeatures( void )
+{
+ static Uint32 features = 0xffffffff;
+ if (features == 0xffffffff) {
+ /* Provide an override for testing .. */
+ char *override = SDL_getenv("SDL_ALTIVEC_BLIT_FEATURES");
+ if (override) {
+ features = 0;
+ SDL_sscanf(override, "%u", &features);
+ } else {
+ features = ( 0
+ /* Feature 1 is has-MMX */
+ | ((SDL_HasMMX()) ? 1 : 0)
+ /* Feature 2 is has-AltiVec */
+ | ((SDL_HasAltiVec()) ? 2 : 0)
+ /* Feature 4 is dont-use-prefetch */
+ /* !!!! FIXME: Check for G5 or later, not the cache size! Always prefetch on a G4. */
+ | ((GetL3CacheSize() == 0) ? 4 : 0)
+ );
+ }
+ }
+ return features;
+}
+#if __MWERKS__
+#pragma altivec_model off
+#endif
+#else
+/* Feature 1 is has-MMX */
+#define GetBlitFeatures() ((Uint32)(SDL_HasMMX() ? 1 : 0))
+#endif
+
+/* This is now endian dependent */
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+#define HI 1
+#define LO 0
+#else /* SDL_BYTEORDER == SDL_BIG_ENDIAN */
+#define HI 0
+#define LO 1
+#endif
+
+#if SDL_HERMES_BLITTERS
+
+/* Heheheh, we coerce Hermes into using SDL blit information */
+#define X86_ASSEMBLER
+#define HermesConverterInterface SDL_BlitInfo
+#define HermesClearInterface void
+#define STACKCALL
+
+#include "../hermes/HeadMMX.h"
+#include "../hermes/HeadX86.h"
+
+#else
+
+/* Special optimized blit for RGB 8-8-8 --> RGB 3-3-2 */
+#define RGB888_RGB332(dst, src) { \
+ dst = (Uint8)((((src)&0x00E00000)>>16)| \
+ (((src)&0x0000E000)>>11)| \
+ (((src)&0x000000C0)>>6)); \
+}
+static void Blit_RGB888_index8(SDL_BlitInfo *info)
+{
+#ifndef USE_DUFFS_LOOP
+ int c;
+#endif
+ int width, height;
+ Uint32 *src;
+ const Uint8 *map;
+ Uint8 *dst;
+ int srcskip, dstskip;
+
+ /* Set up some basic variables */
+ width = info->d_width;
+ height = info->d_height;
+ src = (Uint32 *)info->s_pixels;
+ srcskip = info->s_skip/4;
+ dst = info->d_pixels;
+ dstskip = info->d_skip;
+ map = info->table;
+
+ if ( map == NULL ) {
+ while ( height-- ) {
+#ifdef USE_DUFFS_LOOP
+ DUFFS_LOOP(
+ RGB888_RGB332(*dst++, *src);
+ , width);
+#else
+ for ( c=width/4; c; --c ) {
+ /* Pack RGB into 8bit pixel */
+ ++src;
+ RGB888_RGB332(*dst++, *src);
+ ++src;
+ RGB888_RGB332(*dst++, *src);
+ ++src;
+ RGB888_RGB332(*dst++, *src);
+ ++src;
+ }
+ switch ( width & 3 ) {
+ case 3:
+ RGB888_RGB332(*dst++, *src);
+ ++src;
+ case 2:
+ RGB888_RGB332(*dst++, *src);
+ ++src;
+ case 1:
+ RGB888_RGB332(*dst++, *src);
+ ++src;
+ }
+#endif /* USE_DUFFS_LOOP */
+ src += srcskip;
+ dst += dstskip;
+ }
+ } else {
+ int Pixel;
+
+ while ( height-- ) {
+#ifdef USE_DUFFS_LOOP
+ DUFFS_LOOP(
+ RGB888_RGB332(Pixel, *src);
+ *dst++ = map[Pixel];
+ ++src;
+ , width);
+#else
+ for ( c=width/4; c; --c ) {
+ /* Pack RGB into 8bit pixel */
+ RGB888_RGB332(Pixel, *src);
+ *dst++ = map[Pixel];
+ ++src;
+ RGB888_RGB332(Pixel, *src);
+ *dst++ = map[Pixel];
+ ++src;
+ RGB888_RGB332(Pixel, *src);
+ *dst++ = map[Pixel];
+ ++src;
+ RGB888_RGB332(Pixel, *src);
+ *dst++ = map[Pixel];
+ ++src;
+ }
+ switch ( width & 3 ) {
+ case 3:
+ RGB888_RGB332(Pixel, *src);
+ *dst++ = map[Pixel];
+ ++src;
+ case 2:
+ RGB888_RGB332(Pixel, *src);
+ *dst++ = map[Pixel];
+ ++src;
+ case 1:
+ RGB888_RGB332(Pixel, *src);
+ *dst++ = map[Pixel];
+ ++src;
+ }
+#endif /* USE_DUFFS_LOOP */
+ src += srcskip;
+ dst += dstskip;
+ }
+ }
+}
+/* Special optimized blit for RGB 8-8-8 --> RGB 5-5-5 */
+#define RGB888_RGB555(dst, src) { \
+ *(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); \
+}
+static void Blit_RGB888_RGB555(SDL_BlitInfo *info)
+{
+#ifndef USE_DUFFS_LOOP
+ int c;
+#endif
+ int width, height;
+ Uint32 *src;
+ Uint16 *dst;
+ int srcskip, dstskip;
+
+ /* Set up some basic variables */
+ width = info->d_width;
+ height = info->d_height;
+ src = (Uint32 *)info->s_pixels;
+ srcskip = info->s_skip/4;
+ dst = (Uint16 *)info->d_pixels;
+ dstskip = info->d_skip/2;
+
+#ifdef USE_DUFFS_LOOP
+ while ( height-- ) {
+ DUFFS_LOOP(
+ RGB888_RGB555(dst, src);
+ ++src;
+ ++dst;
+ , width);
+ src += srcskip;
+ dst += dstskip;
+ }
+#else
+ /* Memory align at 4-byte boundary, if necessary */
+ if ( (long)dst & 0x03 ) {
+ /* Don't do anything if width is 0 */
+ if ( width == 0 ) {
+ return;
+ }
+ --width;
+
+ while ( height-- ) {
+ /* Perform copy alignment */
+ RGB888_RGB555(dst, src);
+ ++src;
+ ++dst;
+
+ /* Copy in 4 pixel chunks */
+ for ( c=width/4; c; --c ) {
+ RGB888_RGB555_TWO(dst, src);
+ src += 2;
+ dst += 2;
+ RGB888_RGB555_TWO(dst, src);
+ src += 2;
+ dst += 2;
+ }
+ /* Get any leftovers */
+ switch (width & 3) {
+ case 3:
+ RGB888_RGB555(dst, src);
+ ++src;
+ ++dst;
+ case 2:
+ RGB888_RGB555_TWO(dst, src);
+ src += 2;
+ dst += 2;
+ break;
+ case 1:
+ RGB888_RGB555(dst, src);
+ ++src;
+ ++dst;
+ break;
+ }
+ src += srcskip;
+ dst += dstskip;
+ }
+ } else {
+ while ( height-- ) {
+ /* Copy in 4 pixel chunks */
+ for ( c=width/4; c; --c ) {
+ RGB888_RGB555_TWO(dst, src);
+ src += 2;
+ dst += 2;
+ RGB888_RGB555_TWO(dst, src);
+ src += 2;
+ dst += 2;
+ }
+ /* Get any leftovers */
+ switch (width & 3) {
+ case 3:
+ RGB888_RGB555(dst, src);
+ ++src;
+ ++dst;
+ case 2:
+ RGB888_RGB555_TWO(dst, src);
+ src += 2;
+ dst += 2;
+ break;
+ case 1:
+ RGB888_RGB555(dst, src);
+ ++src;
+ ++dst;
+ break;
+ }
+ src += srcskip;
+ dst += dstskip;
+ }
+ }
+#endif /* USE_DUFFS_LOOP */
+}
+/* Special optimized blit for RGB 8-8-8 --> RGB 5-6-5 */
+#define RGB888_RGB565(dst, src) { \
+ *(Uint16 *)(dst) = (Uint16)((((*src)&0x00F80000)>>8)| \
+ (((*src)&0x0000FC00)>>5)| \
+ (((*src)&0x000000F8)>>3)); \
+}
+#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); \
+}
+static void Blit_RGB888_RGB565(SDL_BlitInfo *info)
+{
+#ifndef USE_DUFFS_LOOP
+ int c;
+#endif
+ int width, height;
+ Uint32 *src;
+ Uint16 *dst;
+ int srcskip, dstskip;
+
+ /* Set up some basic variables */
+ width = info->d_width;
+ height = info->d_height;
+ src = (Uint32 *)info->s_pixels;
+ srcskip = info->s_skip/4;
+ dst = (Uint16 *)info->d_pixels;
+ dstskip = info->d_skip/2;
+
+#ifdef USE_DUFFS_LOOP
+ while ( height-- ) {
+ DUFFS_LOOP(
+ RGB888_RGB565(dst, src);
+ ++src;
+ ++dst;
+ , width);
+ src += srcskip;
+ dst += dstskip;
+ }
+#else
+ /* Memory align at 4-byte boundary, if necessary */
+ if ( (long)dst & 0x03 ) {
+ /* Don't do anything if width is 0 */
+ if ( width == 0 ) {
+ return;
+ }
+ --width;
+
+ while ( height-- ) {
+ /* Perform copy alignment */
+ RGB888_RGB565(dst, src);
+ ++src;
+ ++dst;
+
+ /* Copy in 4 pixel chunks */
+ for ( c=width/4; c; --c ) {
+ RGB888_RGB565_TWO(dst, src);
+ src += 2;
+ dst += 2;
+ RGB888_RGB565_TWO(dst, src);
+ src += 2;
+ dst += 2;
+ }
+ /* Get any leftovers */
+ switch (width & 3) {
+ case 3:
+ RGB888_RGB565(dst, src);
+ ++src;
+ ++dst;
+ case 2:
+ RGB888_RGB565_TWO(dst, src);
+ src += 2;
+ dst += 2;
+ break;
+ case 1:
+ RGB888_RGB565(dst, src);
+ ++src;
+ ++dst;
+ break;
+ }
+ src += srcskip;
+ dst += dstskip;
+ }
+ } else {
+ while ( height-- ) {
+ /* Copy in 4 pixel chunks */
+ for ( c=width/4; c; --c ) {
+ RGB888_RGB565_TWO(dst, src);
+ src += 2;
+ dst += 2;
+ RGB888_RGB565_TWO(dst, src);
+ src += 2;
+ dst += 2;
+ }
+ /* Get any leftovers */
+ switch (width & 3) {
+ case 3:
+ RGB888_RGB565(dst, src);
+ ++src;
+ ++dst;
+ case 2:
+ RGB888_RGB565_TWO(dst, src);
+ src += 2;
+ dst += 2;
+ break;
+ case 1:
+ RGB888_RGB565(dst, src);
+ ++src;
+ ++dst;
+ break;
+ }
+ src += srcskip;
+ dst += dstskip;
+ }
+ }
+#endif /* USE_DUFFS_LOOP */
+}
+
+#endif /* SDL_HERMES_BLITTERS */
+
+
+/* Special optimized blit for RGB 5-6-5 --> 32-bit RGB surfaces */
+#define RGB565_32(dst, src, map) (map[src[LO]*2] + map[src[HI]*2+1])
+static void Blit_RGB565_32(SDL_BlitInfo *info, const Uint32 *map)
+{
+#ifndef USE_DUFFS_LOOP
+ int c;
+#endif
+ int width, height;
+ Uint8 *src;
+ Uint32 *dst;
+ int srcskip, dstskip;
+
+ /* Set up some basic variables */
+ width = info->d_width;
+ height = info->d_height;
+ src = (Uint8 *)info->s_pixels;
+ srcskip = info->s_skip;
+ dst = (Uint32 *)info->d_pixels;
+ dstskip = info->d_skip/4;
+
+#ifdef USE_DUFFS_LOOP
+ while ( height-- ) {
+ DUFFS_LOOP(
+ {
+ *dst++ = RGB565_32(dst, src, map);
+ src += 2;
+ },
+ width);
+ src += srcskip;
+ dst += dstskip;
+ }
+#else
+ while ( height-- ) {
+ /* Copy in 4 pixel chunks */
+ for ( c=width/4; c; --c ) {
+ *dst++ = RGB565_32(dst, src, map);
+ src += 2;
+ *dst++ = RGB565_32(dst, src, map);
+ src += 2;
+ *dst++ = RGB565_32(dst, src, map);
+ src += 2;
+ *dst++ = RGB565_32(dst, src, map);
+ src += 2;
+ }
+ /* Get any leftovers */
+ switch (width & 3) {
+ case 3:
+ *dst++ = RGB565_32(dst, src, map);
+ src += 2;
+ case 2:
+ *dst++ = RGB565_32(dst, src, map);
+ src += 2;
+ case 1:
+ *dst++ = RGB565_32(dst, src, map);
+ src += 2;
+ break;
+ }
+ src += srcskip;
+ dst += dstskip;
+ }
+#endif /* USE_DUFFS_LOOP */
+}
+
+/* Special optimized blit for RGB 5-6-5 --> ARGB 8-8-8-8 */
+static const Uint32 RGB565_ARGB8888_LUT[512] = {
+ 0x00000000, 0xff000000, 0x00000008, 0xff002000,
+ 0x00000010, 0xff004000, 0x00000018, 0xff006100,
+ 0x00000020, 0xff008100, 0x00000029, 0xff00a100,
+ 0x00000031, 0xff00c200, 0x00000039, 0xff00e200,
+ 0x00000041, 0xff080000, 0x0000004a, 0xff082000,
+ 0x00000052, 0xff084000, 0x0000005a, 0xff086100,
+ 0x00000062, 0xff088100, 0x0000006a, 0xff08a100,
+ 0x00000073, 0xff08c200, 0x0000007b, 0xff08e200,
+ 0x00000083, 0xff100000, 0x0000008b, 0xff102000,
+ 0x00000094, 0xff104000, 0x0000009c, 0xff106100,
+ 0x000000a4, 0xff108100, 0x000000ac, 0xff10a100,
+ 0x000000b4, 0xff10c200, 0x000000bd, 0xff10e200,
+ 0x000000c5, 0xff180000, 0x000000cd, 0xff182000,
+ 0x000000d5, 0xff184000, 0x000000de, 0xff186100,
+ 0x000000e6, 0xff188100, 0x000000ee, 0xff18a100,
+ 0x000000f6, 0xff18c200, 0x000000ff, 0xff18e200,
+ 0x00000400, 0xff200000, 0x00000408, 0xff202000,
+ 0x00000410, 0xff204000, 0x00000418, 0xff206100,
+ 0x00000420, 0xff208100, 0x00000429, 0xff20a100,
+ 0x00000431, 0xff20c200, 0x00000439, 0xff20e200,
+ 0x00000441, 0xff290000, 0x0000044a, 0xff292000,
+ 0x00000452, 0xff294000, 0x0000045a, 0xff296100,
+ 0x00000462, 0xff298100, 0x0000046a, 0xff29a100,
+ 0x00000473, 0xff29c200, 0x0000047b, 0xff29e200,
+ 0x00000483, 0xff310000, 0x0000048b, 0xff312000,
+ 0x00000494, 0xff314000, 0x0000049c, 0xff316100,
+ 0x000004a4, 0xff318100, 0x000004ac, 0xff31a100,
+ 0x000004b4, 0xff31c200, 0x000004bd, 0xff31e200,
+ 0x000004c5, 0xff390000, 0x000004cd, 0xff392000,
+ 0x000004d5, 0xff394000, 0x000004de, 0xff396100,
+ 0x000004e6, 0xff398100, 0x000004ee, 0xff39a100,
+ 0x000004f6, 0xff39c200, 0x000004ff, 0xff39e200,
+ 0x00000800, 0xff410000, 0x00000808, 0xff412000,
+ 0x00000810, 0xff414000, 0x00000818, 0xff416100,
+ 0x00000820, 0xff418100, 0x00000829, 0xff41a100,
+ 0x00000831, 0xff41c200, 0x00000839, 0xff41e200,
+ 0x00000841, 0xff4a0000, 0x0000084a, 0xff4a2000,
+ 0x00000852, 0xff4a4000, 0x0000085a, 0xff4a6100,
+ 0x00000862, 0xff4a8100, 0x0000086a, 0xff4aa100,
+ 0x00000873, 0xff4ac200, 0x0000087b, 0xff4ae200,
+ 0x00000883, 0xff520000, 0x0000088b, 0xff522000,
+ 0x00000894, 0xff524000, 0x0000089c, 0xff526100,
+ 0x000008a4, 0xff528100, 0x000008ac, 0xff52a100,
+ 0x000008b4, 0xff52c200, 0x000008bd, 0xff52e200,
+ 0x000008c5, 0xff5a0000, 0x000008cd, 0xff5a2000,
+ 0x000008d5, 0xff5a4000, 0x000008de, 0xff5a6100,
+ 0x000008e6, 0xff5a8100, 0x000008ee, 0xff5aa100,
+ 0x000008f6, 0xff5ac200, 0x000008ff, 0xff5ae200,
+ 0x00000c00, 0xff620000, 0x00000c08, 0xff622000,
+ 0x00000c10, 0xff624000, 0x00000c18, 0xff626100,
+ 0x00000c20, 0xff628100, 0x00000c29, 0xff62a100,
+ 0x00000c31, 0xff62c200, 0x00000c39, 0xff62e200,
+ 0x00000c41, 0xff6a0000, 0x00000c4a, 0xff6a2000,
+ 0x00000c52, 0xff6a4000, 0x00000c5a, 0xff6a6100,
+ 0x00000c62, 0xff6a8100, 0x00000c6a, 0xff6aa100,
+ 0x00000c73, 0xff6ac200, 0x00000c7b, 0xff6ae200,
+ 0x00000c83, 0xff730000, 0x00000c8b, 0xff732000,
+ 0x00000c94, 0xff734000, 0x00000c9c, 0xff736100,
+ 0x00000ca4, 0xff738100, 0x00000cac, 0xff73a100,
+ 0x00000cb4, 0xff73c200, 0x00000cbd, 0xff73e200,
+ 0x00000cc5, 0xff7b0000, 0x00000ccd, 0xff7b2000,
+ 0x00000cd5, 0xff7b4000, 0x00000cde, 0xff7b6100,
+ 0x00000ce6, 0xff7b8100, 0x00000cee, 0xff7ba100,
+ 0x00000cf6, 0xff7bc200, 0x00000cff, 0xff7be200,
+ 0x00001000, 0xff830000, 0x00001008, 0xff832000,
+ 0x00001010, 0xff834000, 0x00001018, 0xff836100,
+ 0x00001020, 0xff838100, 0x00001029, 0xff83a100,
+ 0x00001031, 0xff83c200, 0x00001039, 0xff83e200,
+ 0x00001041, 0xff8b0000, 0x0000104a, 0xff8b2000,
+ 0x00001052, 0xff8b4000, 0x0000105a, 0xff8b6100,
+ 0x00001062, 0xff8b8100, 0x0000106a, 0xff8ba100,
+ 0x00001073, 0xff8bc200, 0x0000107b, 0xff8be200,
+ 0x00001083, 0xff940000, 0x0000108b, 0xff942000,
+ 0x00001094, 0xff944000, 0x0000109c, 0xff946100,
+ 0x000010a4, 0xff948100, 0x000010ac, 0xff94a100,
+ 0x000010b4, 0xff94c200, 0x000010bd, 0xff94e200,
+ 0x000010c5, 0xff9c0000, 0x000010cd, 0xff9c2000,
+ 0x000010d5, 0xff9c4000, 0x000010de, 0xff9c6100,
+ 0x000010e6, 0xff9c8100, 0x000010ee, 0xff9ca100,
+ 0x000010f6, 0xff9cc200, 0x000010ff, 0xff9ce200,
+ 0x00001400, 0xffa40000, 0x00001408, 0xffa42000,
+ 0x00001410, 0xffa44000, 0x00001418, 0xffa46100,
+ 0x00001420, 0xffa48100, 0x00001429, 0xffa4a100,
+ 0x00001431, 0xffa4c200, 0x00001439, 0xffa4e200,
+ 0x00001441, 0xffac0000, 0x0000144a, 0xffac2000,
+ 0x00001452, 0xffac4000, 0x0000145a, 0xffac6100,
+ 0x00001462, 0xffac8100, 0x0000146a, 0xffaca100,
+ 0x00001473, 0xffacc200, 0x0000147b, 0xfface200,
+ 0x00001483, 0xffb40000, 0x0000148b, 0xffb42000,
+ 0x00001494, 0xffb44000, 0x0000149c, 0xffb46100,
+ 0x000014a4, 0xffb48100, 0x000014ac, 0xffb4a100,
+ 0x000014b4, 0xffb4c200, 0x000014bd, 0xffb4e200,
+ 0x000014c5, 0xffbd0000, 0x000014cd, 0xffbd2000,
+ 0x000014d5, 0xffbd4000, 0x000014de, 0xffbd6100,
+ 0x000014e6, 0xffbd8100, 0x000014ee, 0xffbda100,
+ 0x000014f6, 0xffbdc200, 0x000014ff, 0xffbde200,
+ 0x00001800, 0xffc50000, 0x00001808, 0xffc52000,
+ 0x00001810, 0xffc54000, 0x00001818, 0xffc56100,
+ 0x00001820, 0xffc58100, 0x00001829, 0xffc5a100,
+ 0x00001831, 0xffc5c200, 0x00001839, 0xffc5e200,
+ 0x00001841, 0xffcd0000, 0x0000184a, 0xffcd2000,
+ 0x00001852, 0xffcd4000, 0x0000185a, 0xffcd6100,
+ 0x00001862, 0xffcd8100, 0x0000186a, 0xffcda100,
+ 0x00001873, 0xffcdc200, 0x0000187b, 0xffcde200,
+ 0x00001883, 0xffd50000, 0x0000188b, 0xffd52000,
+ 0x00001894, 0xffd54000, 0x0000189c, 0xffd56100,
+ 0x000018a4, 0xffd58100, 0x000018ac, 0xffd5a100,
+ 0x000018b4, 0xffd5c200, 0x000018bd, 0xffd5e200,
+ 0x000018c5, 0xffde0000, 0x000018cd, 0xffde2000,
+ 0x000018d5, 0xffde4000, 0x000018de, 0xffde6100,
+ 0x000018e6, 0xffde8100, 0x000018ee, 0xffdea100,
+ 0x000018f6, 0xffdec200, 0x000018ff, 0xffdee200,
+ 0x00001c00, 0xffe60000, 0x00001c08, 0xffe62000,
+ 0x00001c10, 0xffe64000, 0x00001c18, 0xffe66100,
+ 0x00001c20, 0xffe68100, 0x00001c29, 0xffe6a100,
+ 0x00001c31, 0xffe6c200, 0x00001c39, 0xffe6e200,
+ 0x00001c41, 0xffee0000, 0x00001c4a, 0xffee2000,
+ 0x00001c52, 0xffee4000, 0x00001c5a, 0xffee6100,
+ 0x00001c62, 0xffee8100, 0x00001c6a, 0xffeea100,
+ 0x00001c73, 0xffeec200, 0x00001c7b, 0xffeee200,
+ 0x00001c83, 0xfff60000, 0x00001c8b, 0xfff62000,
+ 0x00001c94, 0xfff64000, 0x00001c9c, 0xfff66100,
+ 0x00001ca4, 0xfff68100, 0x00001cac, 0xfff6a100,
+ 0x00001cb4, 0xfff6c200, 0x00001cbd, 0xfff6e200,
+ 0x00001cc5, 0xffff0000, 0x00001ccd, 0xffff2000,
+ 0x00001cd5, 0xffff4000, 0x00001cde, 0xffff6100,
+ 0x00001ce6, 0xffff8100, 0x00001cee, 0xffffa100,
+ 0x00001cf6, 0xffffc200, 0x00001cff, 0xffffe200
+};
+static void Blit_RGB565_ARGB8888(SDL_BlitInfo *info)
+{
+ Blit_RGB565_32(info, RGB565_ARGB8888_LUT);
+}
+
+/* Special optimized blit for RGB 5-6-5 --> ABGR 8-8-8-8 */
+static const Uint32 RGB565_ABGR8888_LUT[512] = {
+ 0xff000000, 0x00000000, 0xff080000, 0x00002000,
+ 0xff100000, 0x00004000, 0xff180000, 0x00006100,
+ 0xff200000, 0x00008100, 0xff290000, 0x0000a100,
+ 0xff310000, 0x0000c200, 0xff390000, 0x0000e200,
+ 0xff410000, 0x00000008, 0xff4a0000, 0x00002008,
+ 0xff520000, 0x00004008, 0xff5a0000, 0x00006108,
+ 0xff620000, 0x00008108, 0xff6a0000, 0x0000a108,
+ 0xff730000, 0x0000c208, 0xff7b0000, 0x0000e208,
+ 0xff830000, 0x00000010, 0xff8b0000, 0x00002010,
+ 0xff940000, 0x00004010, 0xff9c0000, 0x00006110,
+ 0xffa40000, 0x00008110, 0xffac0000, 0x0000a110,
+ 0xffb40000, 0x0000c210, 0xffbd0000, 0x0000e210,
+ 0xffc50000, 0x00000018, 0xffcd0000, 0x00002018,
+ 0xffd50000, 0x00004018, 0xffde0000, 0x00006118,
+ 0xffe60000, 0x00008118, 0xffee0000, 0x0000a118,
+ 0xfff60000, 0x0000c218, 0xffff0000, 0x0000e218,
+ 0xff000400, 0x00000020, 0xff080400, 0x00002020,
+ 0xff100400, 0x00004020, 0xff180400, 0x00006120,
+ 0xff200400, 0x00008120, 0xff290400, 0x0000a120,
+ 0xff310400, 0x0000c220, 0xff390400, 0x0000e220,
+ 0xff410400, 0x00000029, 0xff4a0400, 0x00002029,
+ 0xff520400, 0x00004029, 0xff5a0400, 0x00006129,
+ 0xff620400, 0x00008129, 0xff6a0400, 0x0000a129,
+ 0xff730400, 0x0000c229, 0xff7b0400, 0x0000e229,
+ 0xff830400, 0x00000031, 0xff8b0400, 0x00002031,
+ 0xff940400, 0x00004031, 0xff9c0400, 0x00006131,
+ 0xffa40400, 0x00008131, 0xffac0400, 0x0000a131,
+ 0xffb40400, 0x0000c231, 0xffbd0400, 0x0000e231,
+ 0xffc50400, 0x00000039, 0xffcd0400, 0x00002039,
+ 0xffd50400, 0x00004039, 0xffde0400, 0x00006139,
+ 0xffe60400, 0x00008139, 0xffee0400, 0x0000a139,
+ 0xfff60400, 0x0000c239, 0xffff0400, 0x0000e239,
+ 0xff000800, 0x00000041, 0xff080800, 0x00002041,
+ 0xff100800, 0x00004041, 0xff180800, 0x00006141,
+ 0xff200800, 0x00008141, 0xff290800, 0x0000a141,
+ 0xff310800, 0x0000c241, 0xff390800, 0x0000e241,
+ 0xff410800, 0x0000004a, 0xff4a0800, 0x0000204a,
+ 0xff520800, 0x0000404a, 0xff5a0800, 0x0000614a,
+ 0xff620800, 0x0000814a, 0xff6a0800, 0x0000a14a,
+ 0xff730800, 0x0000c24a, 0xff7b0800, 0x0000e24a,
+ 0xff830800, 0x00000052, 0xff8b0800, 0x00002052,
+ 0xff940800, 0x00004052, 0xff9c0800, 0x00006152,
+ 0xffa40800, 0x00008152, 0xffac0800, 0x0000a152,
+ 0xffb40800, 0x0000c252, 0xffbd0800, 0x0000e252,
+ 0xffc50800, 0x0000005a, 0xffcd0800, 0x0000205a,
+ 0xffd50800, 0x0000405a, 0xffde0800, 0x0000615a,
+ 0xffe60800, 0x0000815a, 0xffee0800, 0x0000a15a,
+ 0xfff60800, 0x0000c25a, 0xffff0800, 0x0000e25a,
+ 0xff000c00, 0x00000062, 0xff080c00, 0x00002062,
+ 0xff100c00, 0x00004062, 0xff180c00, 0x00006162,
+ 0xff200c00, 0x00008162, 0xff290c00, 0x0000a162,
+ 0xff310c00, 0x0000c262, 0xff390c00, 0x0000e262,
+ 0xff410c00, 0x0000006a, 0xff4a0c00, 0x0000206a,
+ 0xff520c00, 0x0000406a, 0xff5a0c00, 0x0000616a,
+ 0xff620c00, 0x0000816a, 0xff6a0c00, 0x0000a16a,
+ 0xff730c00, 0x0000c26a, 0xff7b0c00, 0x0000e26a,
+ 0xff830c00, 0x00000073, 0xff8b0c00, 0x00002073,
+ 0xff940c00, 0x00004073, 0xff9c0c00, 0x00006173,
+ 0xffa40c00, 0x00008173, 0xffac0c00, 0x0000a173,
+ 0xffb40c00, 0x0000c273, 0xffbd0c00, 0x0000e273,
+ 0xffc50c00, 0x0000007b, 0xffcd0c00, 0x0000207b,
+ 0xffd50c00, 0x0000407b, 0xffde0c00, 0x0000617b,
+ 0xffe60c00, 0x0000817b, 0xffee0c00, 0x0000a17b,
+ 0xfff60c00, 0x0000c27b, 0xffff0c00, 0x0000e27b,
+ 0xff001000, 0x00000083, 0xff081000, 0x00002083,
+ 0xff101000, 0x00004083, 0xff181000, 0x00006183,
+ 0xff201000, 0x00008183, 0xff291000, 0x0000a183,
+ 0xff311000, 0x0000c283, 0xff391000, 0x0000e283,
+ 0xff411000, 0x0000008b, 0xff4a1000, 0x0000208b,
+ 0xff521000, 0x0000408b, 0xff5a1000, 0x0000618b,
+ 0xff621000, 0x0000818b, 0xff6a1000, 0x0000a18b,
+ 0xff731000, 0x0000c28b, 0xff7b1000, 0x0000e28b,
+ 0xff831000, 0x00000094, 0xff8b1000, 0x00002094,
+ 0xff941000, 0x00004094, 0xff9c1000, 0x00006194,
+ 0xffa41000, 0x00008194, 0xffac1000, 0x0000a194,
+ 0xffb41000, 0x0000c294, 0xffbd1000, 0x0000e294,
+ 0xffc51000, 0x0000009c, 0xffcd1000, 0x0000209c,
+ 0xffd51000, 0x0000409c, 0xffde1000, 0x0000619c,
+ 0xffe61000, 0x0000819c, 0xffee1000, 0x0000a19c,
+ 0xfff61000, 0x0000c29c, 0xffff1000, 0x0000e29c,
+ 0xff001400, 0x000000a4, 0xff081400, 0x000020a4,
+ 0xff101400, 0x000040a4, 0xff181400, 0x000061a4,
+ 0xff201400, 0x000081a4, 0xff291400, 0x0000a1a4,
+ 0xff311400, 0x0000c2a4, 0xff391400, 0x0000e2a4,
+ 0xff411400, 0x000000ac, 0xff4a1400, 0x000020ac,
+ 0xff521400, 0x000040ac, 0xff5a1400, 0x000061ac,
+ 0xff621400, 0x000081ac, 0xff6a1400, 0x0000a1ac,
+ 0xff731400, 0x0000c2ac, 0xff7b1400, 0x0000e2ac,
+ 0xff831400, 0x000000b4, 0xff8b1400, 0x000020b4,
+ 0xff941400, 0x000040b4, 0xff9c1400, 0x000061b4,
+ 0xffa41400, 0x000081b4, 0xffac1400, 0x0000a1b4,
+ 0xffb41400, 0x0000c2b4, 0xffbd1400, 0x0000e2b4,
+ 0xffc51400, 0x000000bd, 0xffcd1400, 0x000020bd,
+ 0xffd51400, 0x000040bd, 0xffde1400, 0x000061bd,
+ 0xffe61400, 0x000081bd, 0xffee1400, 0x0000a1bd,
+ 0xfff61400, 0x0000c2bd, 0xffff1400, 0x0000e2bd,
+ 0xff001800, 0x000000c5, 0xff081800, 0x000020c5,
+ 0xff101800, 0x000040c5, 0xff181800, 0x000061c5,
+ 0xff201800, 0x000081c5, 0xff291800, 0x0000a1c5,
+ 0xff311800, 0x0000c2c5, 0xff391800, 0x0000e2c5,
+ 0xff411800, 0x000000cd, 0xff4a1800, 0x000020cd,
+ 0xff521800, 0x000040cd, 0xff5a1800, 0x000061cd,
+ 0xff621800, 0x000081cd, 0xff6a1800, 0x0000a1cd,
+ 0xff731800, 0x0000c2cd, 0xff7b1800, 0x0000e2cd,
+ 0xff831800, 0x000000d5, 0xff8b1800, 0x000020d5,
+ 0xff941800, 0x000040d5, 0xff9c1800, 0x000061d5,
+ 0xffa41800, 0x000081d5, 0xffac1800, 0x0000a1d5,
+ 0xffb41800, 0x0000c2d5, 0xffbd1800, 0x0000e2d5,
+ 0xffc51800, 0x000000de, 0xffcd1800, 0x000020de,
+ 0xffd51800, 0x000040de, 0xffde1800, 0x000061de,
+ 0xffe61800, 0x000081de, 0xffee1800, 0x0000a1de,
+ 0xfff61800, 0x0000c2de, 0xffff1800, 0x0000e2de,
+ 0xff001c00, 0x000000e6, 0xff081c00, 0x000020e6,
+ 0xff101c00, 0x000040e6, 0xff181c00, 0x000061e6,
+ 0xff201c00, 0x000081e6, 0xff291c00, 0x0000a1e6,
+ 0xff311c00, 0x0000c2e6, 0xff391c00, 0x0000e2e6,
+ 0xff411c00, 0x000000ee, 0xff4a1c00, 0x000020ee,
+ 0xff521c00, 0x000040ee, 0xff5a1c00, 0x000061ee,
+ 0xff621c00, 0x000081ee, 0xff6a1c00, 0x0000a1ee,
+ 0xff731c00, 0x0000c2ee, 0xff7b1c00, 0x0000e2ee,
+ 0xff831c00, 0x000000f6, 0xff8b1c00, 0x000020f6,
+ 0xff941c00, 0x000040f6, 0xff9c1c00, 0x000061f6,
+ 0xffa41c00, 0x000081f6, 0xffac1c00, 0x0000a1f6,
+ 0xffb41c00, 0x0000c2f6, 0xffbd1c00, 0x0000e2f6,
+ 0xffc51c00, 0x000000ff, 0xffcd1c00, 0x000020ff,
+ 0xffd51c00, 0x000040ff, 0xffde1c00, 0x000061ff,
+ 0xffe61c00, 0x000081ff, 0xffee1c00, 0x0000a1ff,
+ 0xfff61c00, 0x0000c2ff, 0xffff1c00, 0x0000e2ff
+};
+static void Blit_RGB565_ABGR8888(SDL_BlitInfo *info)
+{
+ Blit_RGB565_32(info, RGB565_ABGR8888_LUT);
+}
+
+/* Special optimized blit for RGB 5-6-5 --> RGBA 8-8-8-8 */
+static const Uint32 RGB565_RGBA8888_LUT[512] = {
+ 0x000000ff, 0x00000000, 0x000008ff, 0x00200000,
+ 0x000010ff, 0x00400000, 0x000018ff, 0x00610000,
+ 0x000020ff, 0x00810000, 0x000029ff, 0x00a10000,
+ 0x000031ff, 0x00c20000, 0x000039ff, 0x00e20000,
+ 0x000041ff, 0x08000000, 0x00004aff, 0x08200000,
+ 0x000052ff, 0x08400000, 0x00005aff, 0x08610000,
+ 0x000062ff, 0x08810000, 0x00006aff, 0x08a10000,
+ 0x000073ff, 0x08c20000, 0x00007bff, 0x08e20000,
+ 0x000083ff, 0x10000000, 0x00008bff, 0x10200000,
+ 0x000094ff, 0x10400000, 0x00009cff, 0x10610000,
+ 0x0000a4ff, 0x10810000, 0x0000acff, 0x10a10000,
+ 0x0000b4ff, 0x10c20000, 0x0000bdff, 0x10e20000,
+ 0x0000c5ff, 0x18000000, 0x0000cdff, 0x18200000,
+ 0x0000d5ff, 0x18400000, 0x0000deff, 0x18610000,
+ 0x0000e6ff, 0x18810000, 0x0000eeff, 0x18a10000,
+ 0x0000f6ff, 0x18c20000, 0x0000ffff, 0x18e20000,
+ 0x000400ff, 0x20000000, 0x000408ff, 0x20200000,
+ 0x000410ff, 0x20400000, 0x000418ff, 0x20610000,
+ 0x000420ff, 0x20810000, 0x000429ff, 0x20a10000,
+ 0x000431ff, 0x20c20000, 0x000439ff, 0x20e20000,
+ 0x000441ff, 0x29000000, 0x00044aff, 0x29200000,
+ 0x000452ff, 0x29400000, 0x00045aff, 0x29610000,
+ 0x000462ff, 0x29810000, 0x00046aff, 0x29a10000,
+ 0x000473ff, 0x29c20000, 0x00047bff, 0x29e20000,
+ 0x000483ff, 0x31000000, 0x00048bff, 0x31200000,
+ 0x000494ff, 0x31400000, 0x00049cff, 0x31610000,
+ 0x0004a4ff, 0x31810000, 0x0004acff, 0x31a10000,
+ 0x0004b4ff, 0x31c20000, 0x0004bdff, 0x31e20000,
+ 0x0004c5ff, 0x39000000, 0x0004cdff, 0x39200000,
+ 0x0004d5ff, 0x39400000, 0x0004deff, 0x39610000,
+ 0x0004e6ff, 0x39810000, 0x0004eeff, 0x39a10000,
+ 0x0004f6ff, 0x39c20000, 0x0004ffff, 0x39e20000,
+ 0x000800ff, 0x41000000, 0x000808ff, 0x41200000,
+ 0x000810ff, 0x41400000, 0x000818ff, 0x41610000,
+ 0x000820ff, 0x41810000, 0x000829ff, 0x41a10000,
+ 0x000831ff, 0x41c20000, 0x000839ff, 0x41e20000,
+ 0x000841ff, 0x4a000000, 0x00084aff, 0x4a200000,
+ 0x000852ff, 0x4a400000, 0x00085aff, 0x4a610000,
+ 0x000862ff, 0x4a810000, 0x00086aff, 0x4aa10000,
+ 0x000873ff, 0x4ac20000, 0x00087bff, 0x4ae20000,
+ 0x000883ff, 0x52000000, 0x00088bff, 0x52200000,
+ 0x000894ff, 0x52400000, 0x00089cff, 0x52610000,
+ 0x0008a4ff, 0x52810000, 0x0008acff, 0x52a10000,
+ 0x0008b4ff, 0x52c20000, 0x0008bdff, 0x52e20000,
+ 0x0008c5ff, 0x5a000000, 0x0008cdff, 0x5a200000,
+ 0x0008d5ff, 0x5a400000, 0x0008deff, 0x5a610000,
+ 0x0008e6ff, 0x5a810000, 0x0008eeff, 0x5aa10000,
+ 0x0008f6ff, 0x5ac20000, 0x0008ffff, 0x5ae20000,
+ 0x000c00ff, 0x62000000, 0x000c08ff, 0x62200000,
+ 0x000c10ff, 0x62400000, 0x000c18ff, 0x62610000,
+ 0x000c20ff, 0x62810000, 0x000c29ff, 0x62a10000,
+ 0x000c31ff, 0x62c20000, 0x000c39ff, 0x62e20000,
+ 0x000c41ff, 0x6a000000, 0x000c4aff, 0x6a200000,
+ 0x000c52ff, 0x6a400000, 0x000c5aff, 0x6a610000,
+ 0x000c62ff, 0x6a810000, 0x000c6aff, 0x6aa10000,
+ 0x000c73ff, 0x6ac20000, 0x000c7bff, 0x6ae20000,
+ 0x000c83ff, 0x73000000, 0x000c8bff, 0x73200000,
+ 0x000c94ff, 0x73400000, 0x000c9cff, 0x73610000,
+ 0x000ca4ff, 0x73810000, 0x000cacff, 0x73a10000,
+ 0x000cb4ff, 0x73c20000, 0x000cbdff, 0x73e20000,
+ 0x000cc5ff, 0x7b000000, 0x000ccdff, 0x7b200000,
+ 0x000cd5ff, 0x7b400000, 0x000cdeff, 0x7b610000,
+ 0x000ce6ff, 0x7b810000, 0x000ceeff, 0x7ba10000,
+ 0x000cf6ff, 0x7bc20000, 0x000cffff, 0x7be20000,
+ 0x001000ff, 0x83000000, 0x001008ff, 0x83200000,
+ 0x001010ff, 0x83400000, 0x001018ff, 0x83610000,
+ 0x001020ff, 0x83810000, 0x001029ff, 0x83a10000,
+ 0x001031ff, 0x83c20000, 0x001039ff, 0x83e20000,
+ 0x001041ff, 0x8b000000, 0x00104aff, 0x8b200000,
+ 0x001052ff, 0x8b400000, 0x00105aff, 0x8b610000,
+ 0x001062ff, 0x8b810000, 0x00106aff, 0x8ba10000,
+ 0x001073ff, 0x8bc20000, 0x00107bff, 0x8be20000,
+ 0x001083ff, 0x94000000, 0x00108bff, 0x94200000,
+ 0x001094ff, 0x94400000, 0x00109cff, 0x94610000,
+ 0x0010a4ff, 0x94810000, 0x0010acff, 0x94a10000,
+ 0x0010b4ff, 0x94c20000, 0x0010bdff, 0x94e20000,
+ 0x0010c5ff, 0x9c000000, 0x0010cdff, 0x9c200000,
+ 0x0010d5ff, 0x9c400000, 0x0010deff, 0x9c610000,
+ 0x0010e6ff, 0x9c810000, 0x0010eeff, 0x9ca10000,
+ 0x0010f6ff, 0x9cc20000, 0x0010ffff, 0x9ce20000,
+ 0x001400ff, 0xa4000000, 0x001408ff, 0xa4200000,
+ 0x001410ff, 0xa4400000, 0x001418ff, 0xa4610000,
+ 0x001420ff, 0xa4810000, 0x001429ff, 0xa4a10000,
+ 0x001431ff, 0xa4c20000, 0x001439ff, 0xa4e20000,
+ 0x001441ff, 0xac000000, 0x00144aff, 0xac200000,
+ 0x001452ff, 0xac400000, 0x00145aff, 0xac610000,
+ 0x001462ff, 0xac810000, 0x00146aff, 0xaca10000,
+ 0x001473ff, 0xacc20000, 0x00147bff, 0xace20000,
+ 0x001483ff, 0xb4000000, 0x00148bff, 0xb4200000,
+ 0x001494ff, 0xb4400000, 0x00149cff, 0xb4610000,
+ 0x0014a4ff, 0xb4810000, 0x0014acff, 0xb4a10000,
+ 0x0014b4ff, 0xb4c20000, 0x0014bdff, 0xb4e20000,
+ 0x0014c5ff, 0xbd000000, 0x0014cdff, 0xbd200000,
+ 0x0014d5ff, 0xbd400000, 0x0014deff, 0xbd610000,
+ 0x0014e6ff, 0xbd810000, 0x0014eeff, 0xbda10000,
+ 0x0014f6ff, 0xbdc20000, 0x0014ffff, 0xbde20000,
+ 0x001800ff, 0xc5000000, 0x001808ff, 0xc5200000,
+ 0x001810ff, 0xc5400000, 0x001818ff, 0xc5610000,
+ 0x001820ff, 0xc5810000, 0x001829ff, 0xc5a10000,
+ 0x001831ff, 0xc5c20000, 0x001839ff, 0xc5e20000,
+ 0x001841ff, 0xcd000000, 0x00184aff, 0xcd200000,
+ 0x001852ff, 0xcd400000, 0x00185aff, 0xcd610000,
+ 0x001862ff, 0xcd810000, 0x00186aff, 0xcda10000,
+ 0x001873ff, 0xcdc20000, 0x00187bff, 0xcde20000,
+ 0x001883ff, 0xd5000000, 0x00188bff, 0xd5200000,
+ 0x001894ff, 0xd5400000, 0x00189cff, 0xd5610000,
+ 0x0018a4ff, 0xd5810000, 0x0018acff, 0xd5a10000,
+ 0x0018b4ff, 0xd5c20000, 0x0018bdff, 0xd5e20000,
+ 0x0018c5ff, 0xde000000, 0x0018cdff, 0xde200000,
+ 0x0018d5ff, 0xde400000, 0x0018deff, 0xde610000,
+ 0x0018e6ff, 0xde810000, 0x0018eeff, 0xdea10000,
+ 0x0018f6ff, 0xdec20000, 0x0018ffff, 0xdee20000,
+ 0x001c00ff, 0xe6000000, 0x001c08ff, 0xe6200000,
+ 0x001c10ff, 0xe6400000, 0x001c18ff, 0xe6610000,
+ 0x001c20ff, 0xe6810000, 0x001c29ff, 0xe6a10000,
+ 0x001c31ff, 0xe6c20000, 0x001c39ff, 0xe6e20000,
+ 0x001c41ff, 0xee000000, 0x001c4aff, 0xee200000,
+ 0x001c52ff, 0xee400000, 0x001c5aff, 0xee610000,
+ 0x001c62ff, 0xee810000, 0x001c6aff, 0xeea10000,
+ 0x001c73ff, 0xeec20000, 0x001c7bff, 0xeee20000,
+ 0x001c83ff, 0xf6000000, 0x001c8bff, 0xf6200000,
+ 0x001c94ff, 0xf6400000, 0x001c9cff, 0xf6610000,
+ 0x001ca4ff, 0xf6810000, 0x001cacff, 0xf6a10000,
+ 0x001cb4ff, 0xf6c20000, 0x001cbdff, 0xf6e20000,
+ 0x001cc5ff, 0xff000000, 0x001ccdff, 0xff200000,
+ 0x001cd5ff, 0xff400000, 0x001cdeff, 0xff610000,
+ 0x001ce6ff, 0xff810000, 0x001ceeff, 0xffa10000,
+ 0x001cf6ff, 0xffc20000, 0x001cffff, 0xffe20000,
+};
+static void Blit_RGB565_RGBA8888(SDL_BlitInfo *info)
+{
+ Blit_RGB565_32(info, RGB565_RGBA8888_LUT);
+}
+
+/* Special optimized blit for RGB 5-6-5 --> BGRA 8-8-8-8 */
+static const Uint32 RGB565_BGRA8888_LUT[512] = {
+ 0x00000000, 0x000000ff, 0x08000000, 0x002000ff,
+ 0x10000000, 0x004000ff, 0x18000000, 0x006100ff,
+ 0x20000000, 0x008100ff, 0x29000000, 0x00a100ff,
+ 0x31000000, 0x00c200ff, 0x39000000, 0x00e200ff,
+ 0x41000000, 0x000008ff, 0x4a000000, 0x002008ff,
+ 0x52000000, 0x004008ff, 0x5a000000, 0x006108ff,
+ 0x62000000, 0x008108ff, 0x6a000000, 0x00a108ff,
+ 0x73000000, 0x00c208ff, 0x7b000000, 0x00e208ff,
+ 0x83000000, 0x000010ff, 0x8b000000, 0x002010ff,
+ 0x94000000, 0x004010ff, 0x9c000000, 0x006110ff,
+ 0xa4000000, 0x008110ff, 0xac000000, 0x00a110ff,
+ 0xb4000000, 0x00c210ff, 0xbd000000, 0x00e210ff,
+ 0xc5000000, 0x000018ff, 0xcd000000, 0x002018ff,
+ 0xd5000000, 0x004018ff, 0xde000000, 0x006118ff,
+ 0xe6000000, 0x008118ff, 0xee000000, 0x00a118ff,
+ 0xf6000000, 0x00c218ff, 0xff000000, 0x00e218ff,
+ 0x00040000, 0x000020ff, 0x08040000, 0x002020ff,
+ 0x10040000, 0x004020ff, 0x18040000, 0x006120ff,
+ 0x20040000, 0x008120ff, 0x29040000, 0x00a120ff,
+ 0x31040000, 0x00c220ff, 0x39040000, 0x00e220ff,
+ 0x41040000, 0x000029ff, 0x4a040000, 0x002029ff,
+ 0x52040000, 0x004029ff, 0x5a040000, 0x006129ff,
+ 0x62040000, 0x008129ff, 0x6a040000, 0x00a129ff,
+ 0x73040000, 0x00c229ff, 0x7b040000, 0x00e229ff,
+ 0x83040000, 0x000031ff, 0x8b040000, 0x002031ff,
+ 0x94040000, 0x004031ff, 0x9c040000, 0x006131ff,
+ 0xa4040000, 0x008131ff, 0xac040000, 0x00a131ff,
+ 0xb4040000, 0x00c231ff, 0xbd040000, 0x00e231ff,
+ 0xc5040000, 0x000039ff, 0xcd040000, 0x002039ff,
+ 0xd5040000, 0x004039ff, 0xde040000, 0x006139ff,
+ 0xe6040000, 0x008139ff, 0xee040000, 0x00a139ff,
+ 0xf6040000, 0x00c239ff, 0xff040000, 0x00e239ff,
+ 0x00080000, 0x000041ff, 0x08080000, 0x002041ff,
+ 0x10080000, 0x004041ff, 0x18080000, 0x006141ff,
+ 0x20080000, 0x008141ff, 0x29080000, 0x00a141ff,
+ 0x31080000, 0x00c241ff, 0x39080000, 0x00e241ff,
+ 0x41080000, 0x00004aff, 0x4a080000, 0x00204aff,
+ 0x52080000, 0x00404aff, 0x5a080000, 0x00614aff,
+ 0x62080000, 0x00814aff, 0x6a080000, 0x00a14aff,
+ 0x73080000, 0x00c24aff, 0x7b080000, 0x00e24aff,
+ 0x83080000, 0x000052ff, 0x8b080000, 0x002052ff,
+ 0x94080000, 0x004052ff, 0x9c080000, 0x006152ff,
+ 0xa4080000, 0x008152ff, 0xac080000, 0x00a152ff,
+ 0xb4080000, 0x00c252ff, 0xbd080000, 0x00e252ff,
+ 0xc5080000, 0x00005aff, 0xcd080000, 0x00205aff,
+ 0xd5080000, 0x00405aff, 0xde080000, 0x00615aff,
+ 0xe6080000, 0x00815aff, 0xee080000, 0x00a15aff,
+ 0xf6080000, 0x00c25aff, 0xff080000, 0x00e25aff,
+ 0x000c0000, 0x000062ff, 0x080c0000, 0x002062ff,
+ 0x100c0000, 0x004062ff, 0x180c0000, 0x006162ff,
+ 0x200c0000, 0x008162ff, 0x290c0000, 0x00a162ff,
+ 0x310c0000, 0x00c262ff, 0x390c0000, 0x00e262ff,
+ 0x410c0000, 0x00006aff, 0x4a0c0000, 0x00206aff,
+ 0x520c0000, 0x00406aff, 0x5a0c0000, 0x00616aff,
+ 0x620c0000, 0x00816aff, 0x6a0c0000, 0x00a16aff,
+ 0x730c0000, 0x00c26aff, 0x7b0c0000, 0x00e26aff,
+ 0x830c0000, 0x000073ff, 0x8b0c0000, 0x002073ff,
+ 0x940c0000, 0x004073ff, 0x9c0c0000, 0x006173ff,
+ 0xa40c0000, 0x008173ff, 0xac0c0000, 0x00a173ff,
+ 0xb40c0000, 0x00c273ff, 0xbd0c0000, 0x00e273ff,
+ 0xc50c0000, 0x00007bff, 0xcd0c0000, 0x00207bff,
+ 0xd50c0000, 0x00407bff, 0xde0c0000, 0x00617bff,
+ 0xe60c0000, 0x00817bff, 0xee0c0000, 0x00a17bff,
+ 0xf60c0000, 0x00c27bff, 0xff0c0000, 0x00e27bff,
+ 0x00100000, 0x000083ff, 0x08100000, 0x002083ff,
+ 0x10100000, 0x004083ff, 0x18100000, 0x006183ff,
+ 0x20100000, 0x008183ff, 0x29100000, 0x00a183ff,
+ 0x31100000, 0x00c283ff, 0x39100000, 0x00e283ff,
+ 0x41100000, 0x00008bff, 0x4a100000, 0x00208bff,
+ 0x52100000, 0x00408bff, 0x5a100000, 0x00618bff,
+ 0x62100000, 0x00818bff, 0x6a100000, 0x00a18bff,
+ 0x73100000, 0x00c28bff, 0x7b100000, 0x00e28bff,
+ 0x83100000, 0x000094ff, 0x8b100000, 0x002094ff,
+ 0x94100000, 0x004094ff, 0x9c100000, 0x006194ff,
+ 0xa4100000, 0x008194ff, 0xac100000, 0x00a194ff,
+ 0xb4100000, 0x00c294ff, 0xbd100000, 0x00e294ff,
+ 0xc5100000, 0x00009cff, 0xcd100000, 0x00209cff,
+ 0xd5100000, 0x00409cff, 0xde100000, 0x00619cff,
+ 0xe6100000, 0x00819cff, 0xee100000, 0x00a19cff,
+ 0xf6100000, 0x00c29cff, 0xff100000, 0x00e29cff,
+ 0x00140000, 0x0000a4ff, 0x08140000, 0x0020a4ff,
+ 0x10140000, 0x0040a4ff, 0x18140000, 0x0061a4ff,
+ 0x20140000, 0x0081a4ff, 0x29140000, 0x00a1a4ff,
+ 0x31140000, 0x00c2a4ff, 0x39140000, 0x00e2a4ff,
+ 0x41140000, 0x0000acff, 0x4a140000, 0x0020acff,
+ 0x52140000, 0x0040acff, 0x5a140000, 0x0061acff,
+ 0x62140000, 0x0081acff, 0x6a140000, 0x00a1acff,
+ 0x73140000, 0x00c2acff, 0x7b140000, 0x00e2acff,
+ 0x83140000, 0x0000b4ff, 0x8b140000, 0x0020b4ff,
+ 0x94140000, 0x0040b4ff, 0x9c140000, 0x0061b4ff,
+ 0xa4140000, 0x0081b4ff, 0xac140000, 0x00a1b4ff,
+ 0xb4140000, 0x00c2b4ff, 0xbd140000, 0x00e2b4ff,
+ 0xc5140000, 0x0000bdff, 0xcd140000, 0x0020bdff,
+ 0xd5140000, 0x0040bdff, 0xde140000, 0x0061bdff,
+ 0xe6140000, 0x0081bdff, 0xee140000, 0x00a1bdff,
+ 0xf6140000, 0x00c2bdff, 0xff140000, 0x00e2bdff,
+ 0x00180000, 0x0000c5ff, 0x08180000, 0x0020c5ff,
+ 0x10180000, 0x0040c5ff, 0x18180000, 0x0061c5ff,
+ 0x20180000, 0x0081c5ff, 0x29180000, 0x00a1c5ff,
+ 0x31180000, 0x00c2c5ff, 0x39180000, 0x00e2c5ff,
+ 0x41180000, 0x0000cdff, 0x4a180000, 0x0020cdff,
+ 0x52180000, 0x0040cdff, 0x5a180000, 0x0061cdff,
+ 0x62180000, 0x0081cdff, 0x6a180000, 0x00a1cdff,
+ 0x73180000, 0x00c2cdff, 0x7b180000, 0x00e2cdff,
+ 0x83180000, 0x0000d5ff, 0x8b180000, 0x0020d5ff,
+ 0x94180000, 0x0040d5ff, 0x9c180000, 0x0061d5ff,
+ 0xa4180000, 0x0081d5ff, 0xac180000, 0x00a1d5ff,
+ 0xb4180000, 0x00c2d5ff, 0xbd180000, 0x00e2d5ff,
+ 0xc5180000, 0x0000deff, 0xcd180000, 0x0020deff,
+ 0xd5180000, 0x0040deff, 0xde180000, 0x0061deff,
+ 0xe6180000, 0x0081deff, 0xee180000, 0x00a1deff,
+ 0xf6180000, 0x00c2deff, 0xff180000, 0x00e2deff,
+ 0x001c0000, 0x0000e6ff, 0x081c0000, 0x0020e6ff,
+ 0x101c0000, 0x0040e6ff, 0x181c0000, 0x0061e6ff,
+ 0x201c0000, 0x0081e6ff, 0x291c0000, 0x00a1e6ff,
+ 0x311c0000, 0x00c2e6ff, 0x391c0000, 0x00e2e6ff,
+ 0x411c0000, 0x0000eeff, 0x4a1c0000, 0x0020eeff,
+ 0x521c0000, 0x0040eeff, 0x5a1c0000, 0x0061eeff,
+ 0x621c0000, 0x0081eeff, 0x6a1c0000, 0x00a1eeff,
+ 0x731c0000, 0x00c2eeff, 0x7b1c0000, 0x00e2eeff,
+ 0x831c0000, 0x0000f6ff, 0x8b1c0000, 0x0020f6ff,
+ 0x941c0000, 0x0040f6ff, 0x9c1c0000, 0x0061f6ff,
+ 0xa41c0000, 0x0081f6ff, 0xac1c0000, 0x00a1f6ff,
+ 0xb41c0000, 0x00c2f6ff, 0xbd1c0000, 0x00e2f6ff,
+ 0xc51c0000, 0x0000ffff, 0xcd1c0000, 0x0020ffff,
+ 0xd51c0000, 0x0040ffff, 0xde1c0000, 0x0061ffff,
+ 0xe61c0000, 0x0081ffff, 0xee1c0000, 0x00a1ffff,
+ 0xf61c0000, 0x00c2ffff, 0xff1c0000, 0x00e2ffff
+};
+static void Blit_RGB565_BGRA8888(SDL_BlitInfo *info)
+{
+ Blit_RGB565_32(info, RGB565_BGRA8888_LUT);
+}
+
+/* Special optimized blit for RGB 8-8-8 --> RGB 3-3-2 */
+#ifndef RGB888_RGB332
+#define RGB888_RGB332(dst, src) { \
+ dst = (((src)&0x00E00000)>>16)| \
+ (((src)&0x0000E000)>>11)| \
+ (((src)&0x000000C0)>>6); \
+}
+#endif
+static void Blit_RGB888_index8_map(SDL_BlitInfo *info)
+{
+#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->d_width;
+ height = info->d_height;
+ src = (Uint32 *)info->s_pixels;
+ srcskip = info->s_skip/4;
+ dst = info->d_pixels;
+ dstskip = info->d_skip;
+ map = info->table;
+
+#ifdef USE_DUFFS_LOOP
+ while ( height-- ) {
+ DUFFS_LOOP(
+ RGB888_RGB332(Pixel, *src);
+ *dst++ = map[Pixel];
+ ++src;
+ , width);
+ 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)
+{
+#ifndef USE_DUFFS_LOOP
+ int c;
+#endif
+ int width, height;
+ Uint8 *src;
+ const Uint8 *map;
+ Uint8 *dst;
+ int srcskip, dstskip;
+ int srcbpp;
+ Uint32 Pixel;
+ int sR, sG, sB;
+ SDL_PixelFormat *srcfmt;
+
+ /* Set up some basic variables */
+ width = info->d_width;
+ height = info->d_height;
+ src = info->s_pixels;
+ srcskip = info->s_skip;
+ dst = info->d_pixels;
+ dstskip = info->d_skip;
+ map = info->table;
+ srcfmt = info->src;
+ srcbpp = srcfmt->BytesPerPixel;
+
+ if ( map == NULL ) {
+ while ( height-- ) {
+#ifdef USE_DUFFS_LOOP
+ DUFFS_LOOP(
+ DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
+ sR, sG, sB);
+ if ( 1 ) {
+ /* Pack RGB into 8bit pixel */
+ *dst = ((sR>>5)<<(3+2))|
+ ((sG>>5)<<(2)) |
+ ((sB>>6)<<(0)) ;
+ }
+ dst++;
+ src += srcbpp;
+ , width);
+#else
+ for ( c=width; c; --c ) {
+ DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
+ sR, sG, sB);
+ if ( 1 ) {
+ /* Pack RGB into 8bit pixel */
+ *dst = ((sR>>5)<<(3+2))|
+ ((sG>>5)<<(2)) |
+ ((sB>>6)<<(0)) ;
+ }
+ dst++;
+ src += srcbpp;
+ }
+#endif
+ src += srcskip;
+ dst += dstskip;
+ }
+ } else {
+ while ( height-- ) {
+#ifdef USE_DUFFS_LOOP
+ DUFFS_LOOP(
+ DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
+ sR, sG, sB);
+ if ( 1 ) {
+ /* Pack RGB into 8bit pixel */
+ *dst = map[((sR>>5)<<(3+2))|
+ ((sG>>5)<<(2)) |
+ ((sB>>6)<<(0)) ];
+ }
+ dst++;
+ src += srcbpp;
+ , width);
+#else
+ for ( c=width; c; --c ) {
+ DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
+ sR, sG, sB);
+ if ( 1 ) {
+ /* Pack RGB into 8bit pixel */
+ *dst = map[((sR>>5)<<(3+2))|
+ ((sG>>5)<<(2)) |
+ ((sB>>6)<<(0)) ];
+ }
+ dst++;
+ src += srcbpp;
+ }
+#endif /* USE_DUFFS_LOOP */
+ src += srcskip;
+ dst += dstskip;
+ }
+ }
+}
+
+/* blits 32 bit RGB<->RGBA with both surfaces having the same R,G,B fields */
+static void Blit4to4MaskAlpha(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint32 *src = (Uint32 *)info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint32 *dst = (Uint32 *)info->d_pixels;
+ int dstskip = info->d_skip;
+ SDL_PixelFormat *srcfmt = info->src;
+ SDL_PixelFormat *dstfmt = info->dst;
+
+ if (dstfmt->Amask) {
+ /* RGB->RGBA, SET_ALPHA */
+ Uint32 mask = (srcfmt->alpha >> dstfmt->Aloss) << dstfmt->Ashift;
+
+ while ( height-- ) {
+ DUFFS_LOOP(
+ {
+ *dst = *src | mask;
+ ++dst;
+ ++src;
+ },
+ width);
+ src = (Uint32*)((Uint8*)src + srcskip);
+ dst = (Uint32*)((Uint8*)dst + dstskip);
+ }
+ } else {
+ /* RGBA->RGB, NO_ALPHA */
+ Uint32 mask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask;
+
+ while ( height-- ) {
+ DUFFS_LOOP(
+ {
+ *dst = *src & mask;
+ ++dst;
+ ++src;
+ },
+ width);
+ src = (Uint32*)((Uint8*)src + srcskip);
+ dst = (Uint32*)((Uint8*)dst + dstskip);
+ }
+ }
+}
+
+static void BlitNtoN(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint8 *dst = info->d_pixels;
+ int dstskip = info->d_skip;
+ SDL_PixelFormat *srcfmt = info->src;
+ int srcbpp = srcfmt->BytesPerPixel;
+ SDL_PixelFormat *dstfmt = info->dst;
+ int dstbpp = dstfmt->BytesPerPixel;
+ unsigned alpha = dstfmt->Amask ? srcfmt->alpha : 0;
+
+ while ( height-- ) {
+ DUFFS_LOOP(
+ {
+ Uint32 Pixel;
+ unsigned sR;
+ unsigned sG;
+ unsigned sB;
+ DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
+ ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, alpha);
+ dst += dstbpp;
+ src += srcbpp;
+ },
+ width);
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+
+static void BlitNtoNCopyAlpha(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint8 *dst = info->d_pixels;
+ int dstskip = info->d_skip;
+ SDL_PixelFormat *srcfmt = info->src;
+ int srcbpp = srcfmt->BytesPerPixel;
+ SDL_PixelFormat *dstfmt = info->dst;
+ int dstbpp = dstfmt->BytesPerPixel;
+ int c;
+
+ /* FIXME: should map alpha to [0..255] correctly! */
+ while ( height-- ) {
+ for ( c=width; c; --c ) {
+ Uint32 Pixel;
+ unsigned sR, sG, sB, sA;
+ DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel,
+ sR, sG, sB, sA);
+ ASSEMBLE_RGBA(dst, dstbpp, dstfmt,
+ sR, sG, sB, sA);
+ dst += dstbpp;
+ src += srcbpp;
+ }
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+
+static void BlitNto1Key(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint8 *dst = info->d_pixels;
+ int dstskip = info->d_skip;
+ SDL_PixelFormat *srcfmt = info->src;
+ const Uint8 *palmap = info->table;
+ Uint32 ckey = srcfmt->colorkey;
+ Uint32 rgbmask = ~srcfmt->Amask;
+ int srcbpp;
+ Uint32 Pixel;
+ unsigned sR, sG, sB;
+
+ /* Set up some basic variables */
+ srcbpp = srcfmt->BytesPerPixel;
+ ckey &= rgbmask;
+
+ if ( palmap == NULL ) {
+ while ( height-- ) {
+ DUFFS_LOOP(
+ {
+ DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
+ sR, sG, sB);
+ if ( (Pixel & rgbmask) != ckey ) {
+ /* Pack RGB into 8bit pixel */
+ *dst = (Uint8)(((sR>>5)<<(3+2))|
+ ((sG>>5)<<(2)) |
+ ((sB>>6)<<(0)));
+ }
+ dst++;
+ src += srcbpp;
+ },
+ width);
+ src += srcskip;
+ dst += dstskip;
+ }
+ } else {
+ while ( height-- ) {
+ DUFFS_LOOP(
+ {
+ DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
+ sR, sG, sB);
+ if ( (Pixel & rgbmask) != ckey ) {
+ /* Pack RGB into 8bit pixel */
+ *dst = (Uint8)palmap[((sR>>5)<<(3+2))|
+ ((sG>>5)<<(2)) |
+ ((sB>>6)<<(0)) ];
+ }
+ dst++;
+ src += srcbpp;
+ },
+ width);
+ src += srcskip;
+ dst += dstskip;
+ }
+ }
+}
+
+static void Blit2to2Key(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint16 *srcp = (Uint16 *)info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint16 *dstp = (Uint16 *)info->d_pixels;
+ int dstskip = info->d_skip;
+ Uint32 ckey = info->src->colorkey;
+ Uint32 rgbmask = ~info->src->Amask;
+
+ /* Set up some basic variables */
+ srcskip /= 2;
+ dstskip /= 2;
+ ckey &= rgbmask;
+
+ while ( height-- ) {
+ DUFFS_LOOP(
+ {
+ if ( (*srcp & rgbmask) != ckey ) {
+ *dstp = *srcp;
+ }
+ dstp++;
+ srcp++;
+ },
+ width);
+ srcp += srcskip;
+ dstp += dstskip;
+ }
+}
+
+static void BlitNtoNKey(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint8 *dst = info->d_pixels;
+ int dstskip = info->d_skip;
+ Uint32 ckey = info->src->colorkey;
+ SDL_PixelFormat *srcfmt = info->src;
+ SDL_PixelFormat *dstfmt = info->dst;
+ int srcbpp = srcfmt->BytesPerPixel;
+ int dstbpp = dstfmt->BytesPerPixel;
+ unsigned alpha = dstfmt->Amask ? srcfmt->alpha : 0;
+ Uint32 rgbmask = ~srcfmt->Amask;
+
+ /* Set up some basic variables */
+ ckey &= rgbmask;
+
+ while ( height-- ) {
+ DUFFS_LOOP(
+ {
+ Uint32 Pixel;
+ unsigned sR;
+ unsigned sG;
+ unsigned sB;
+ RETRIEVE_RGB_PIXEL(src, srcbpp, Pixel);
+ if ( (Pixel & rgbmask) != ckey ) {
+ RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB);
+ ASSEMBLE_RGBA(dst, dstbpp, dstfmt,
+ sR, sG, sB, alpha);
+ }
+ dst += dstbpp;
+ src += srcbpp;
+ },
+ width);
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+
+static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info)
+{
+ int width = info->d_width;
+ int height = info->d_height;
+ Uint8 *src = info->s_pixels;
+ int srcskip = info->s_skip;
+ Uint8 *dst = info->d_pixels;
+ int dstskip = info->d_skip;
+ Uint32 ckey = info->src->colorkey;
+ SDL_PixelFormat *srcfmt = info->src;
+ SDL_PixelFormat *dstfmt = info->dst;
+ Uint32 rgbmask = ~srcfmt->Amask;
+
+ Uint8 srcbpp;
+ Uint8 dstbpp;
+ Uint32 Pixel;
+ unsigned sR, sG, sB, sA;
+
+ /* Set up some basic variables */
+ srcbpp = srcfmt->BytesPerPixel;
+ dstbpp = dstfmt->BytesPerPixel;
+ ckey &= rgbmask;
+
+ /* FIXME: should map alpha to [0..255] correctly! */
+ while ( height-- ) {
+ DUFFS_LOOP(
+ {
+ DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel,
+ sR, sG, sB, sA);
+ if ( (Pixel & rgbmask) != ckey ) {
+ ASSEMBLE_RGBA(dst, dstbpp, dstfmt,
+ sR, sG, sB, sA);
+ }
+ dst += dstbpp;
+ src += srcbpp;
+ },
+ width);
+ src += srcskip;
+ dst += dstskip;
+ }
+}
+
+/* Normal N to N optimized blitters */
+struct blit_table {
+ Uint32 srcR, srcG, srcB;
+ int dstbpp;
+ Uint32 dstR, dstG, dstB;
+ Uint32 blit_features;
+ void *aux_data;
+ SDL_loblit blitfunc;
+ enum { NO_ALPHA=1, SET_ALPHA=2, COPY_ALPHA=4 } alpha;
+};
+static const struct blit_table normal_blit_1[] = {
+ /* Default for 8-bit RGB source, an invalid combination */
+ { 0,0,0, 0, 0,0,0, 0, NULL, NULL },
+};
+static const struct blit_table normal_blit_2[] = {
+#if SDL_HERMES_BLITTERS
+ { 0x0000F800,0x000007E0,0x0000001F, 2, 0x0000001F,0x000007E0,0x0000F800,
+ 0, ConvertX86p16_16BGR565, ConvertX86, NO_ALPHA },
+ { 0x0000F800,0x000007E0,0x0000001F, 2, 0x00007C00,0x000003E0,0x0000001F,
+ 0, ConvertX86p16_16RGB555, ConvertX86, NO_ALPHA },
+ { 0x0000F800,0x000007E0,0x0000001F, 2, 0x0000001F,0x000003E0,0x00007C00,
+ 0, ConvertX86p16_16BGR555, ConvertX86, NO_ALPHA },
+#elif SDL_ALTIVEC_BLITTERS
+ /* has-altivec */
+ { 0x0000F800,0x000007E0,0x0000001F, 4, 0x00000000,0x00000000,0x00000000,
+ 2, NULL, Blit_RGB565_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA },
+ { 0x00007C00,0x000003E0,0x0000001F, 4, 0x00000000,0x00000000,0x00000000,
+ 2, NULL, Blit_RGB555_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA },
+#endif
+ { 0x0000F800,0x000007E0,0x0000001F, 4, 0x00FF0000,0x0000FF00,0x000000FF,
+ 0, NULL, Blit_RGB565_ARGB8888, SET_ALPHA },
+ { 0x0000F800,0x000007E0,0x0000001F, 4, 0x000000FF,0x0000FF00,0x00FF0000,
+ 0, NULL, Blit_RGB565_ABGR8888, SET_ALPHA },
+ { 0x0000F800,0x000007E0,0x0000001F, 4, 0xFF000000,0x00FF0000,0x0000FF00,
+ 0, NULL, Blit_RGB565_RGBA8888, SET_ALPHA },
+ { 0x0000F800,0x000007E0,0x0000001F, 4, 0x0000FF00,0x00FF0000,0xFF000000,
+ 0, NULL, Blit_RGB565_BGRA8888, SET_ALPHA },
+
+ /* Default for 16-bit RGB source, used if no other blitter matches */
+ { 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
+};
+static const struct blit_table normal_blit_3[] = {
+ /* Default for 24-bit RGB source, never optimized */
+ { 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
+};
+static const struct blit_table normal_blit_4[] = {
+#if SDL_HERMES_BLITTERS
+ { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
+ 1, ConvertMMXpII32_16RGB565, ConvertMMX, NO_ALPHA },
+ { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
+ 0, ConvertX86p32_16RGB565, ConvertX86, NO_ALPHA },
+ { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000007E0,0x0000F800,
+ 1, ConvertMMXpII32_16BGR565, ConvertMMX, NO_ALPHA },
+ { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000007E0,0x0000F800,
+ 0, ConvertX86p32_16BGR565, ConvertX86, NO_ALPHA },
+ { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F,
+ 1, ConvertMMXpII32_16RGB555, ConvertMMX, NO_ALPHA },
+ { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F,
+ 0, ConvertX86p32_16RGB555, ConvertX86, NO_ALPHA },
+ { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000003E0,0x00007C00,
+ 1, ConvertMMXpII32_16BGR555, ConvertMMX, NO_ALPHA },
+ { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000003E0,0x00007C00,
+ 0, ConvertX86p32_16BGR555, ConvertX86, NO_ALPHA },
+ { 0x00FF0000,0x0000FF00,0x000000FF, 3, 0x00FF0000,0x0000FF00,0x000000FF,
+ 1, ConvertMMXpII32_24RGB888, ConvertMMX, NO_ALPHA },
+ { 0x00FF0000,0x0000FF00,0x000000FF, 3, 0x00FF0000,0x0000FF00,0x000000FF,
+ 0, ConvertX86p32_24RGB888, ConvertX86, NO_ALPHA },
+ { 0x00FF0000,0x0000FF00,0x000000FF, 3, 0x000000FF,0x0000FF00,0x00FF0000,
+ 0, ConvertX86p32_24BGR888, ConvertX86, NO_ALPHA },
+ { 0x00FF0000,0x0000FF00,0x000000FF, 4, 0x000000FF,0x0000FF00,0x00FF0000,
+ 0, ConvertX86p32_32BGR888, ConvertX86, NO_ALPHA },
+ { 0x00FF0000,0x0000FF00,0x000000FF, 4, 0xFF000000,0x00FF0000,0x0000FF00,
+ 0, ConvertX86p32_32RGBA888, ConvertX86, NO_ALPHA },
+ { 0x00FF0000,0x0000FF00,0x000000FF, 4, 0x0000FF00,0x00FF0000,0xFF000000,
+ 0, ConvertX86p32_32BGRA888, ConvertX86, NO_ALPHA },
+#else
+#if SDL_ALTIVEC_BLITTERS
+ /* has-altivec | dont-use-prefetch */
+ { 0x00000000,0x00000000,0x00000000, 4, 0x00000000,0x00000000,0x00000000,
+ 6, NULL, ConvertAltivec32to32_noprefetch, NO_ALPHA | COPY_ALPHA | SET_ALPHA },
+ /* has-altivec */
+ { 0x00000000,0x00000000,0x00000000, 4, 0x00000000,0x00000000,0x00000000,
+ 2, NULL, ConvertAltivec32to32_prefetch, NO_ALPHA | COPY_ALPHA | SET_ALPHA },
+ /* has-altivec */
+ { 0x00000000,0x00000000,0x00000000, 2, 0x0000F800,0x000007E0,0x0000001F,
+ 2, NULL, Blit_RGB888_RGB565Altivec, NO_ALPHA },
+#endif
+ { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
+ 0, NULL, Blit_RGB888_RGB565, NO_ALPHA },
+ { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F,
+ 0, NULL, Blit_RGB888_RGB555, NO_ALPHA },
+#endif
+ /* Default for 32-bit RGB source, used if no other blitter matches */
+ { 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
+};
+static const struct blit_table *normal_blit[] = {
+ normal_blit_1, normal_blit_2, normal_blit_3, normal_blit_4
+};
+
+/* Mask matches table, or table entry is zero */
+#define MASKOK(x, y) (((x) == (y)) || ((y) == 0x00000000))
+
+SDL_loblit SDL_CalculateBlitN(SDL_Surface *surface, int blit_index)
+{
+ struct private_swaccel *sdata;
+ SDL_PixelFormat *srcfmt;
+ SDL_PixelFormat *dstfmt;
+ const struct blit_table *table;
+ int which;
+ SDL_loblit blitfun;
+
+ /* Set up data for choosing the blit */
+ sdata = surface->map->sw_data;
+ srcfmt = surface->format;
+ dstfmt = surface->map->dst->format;
+
+ if ( blit_index & 2 ) {
+ /* alpha or alpha+colorkey */
+ return SDL_CalculateAlphaBlit(surface, blit_index);
+ }
+
+ /* We don't support destinations less than 8-bits */
+ if ( dstfmt->BitsPerPixel < 8 ) {
+ return(NULL);
+ }
+
+ if(blit_index == 1) {
+ /* colorkey blit: Here we don't have too many options, mostly
+ because RLE is the preferred fast way to deal with this.
+ If a particular case turns out to be useful we'll add it. */
+
+ if(srcfmt->BytesPerPixel == 2
+ && surface->map->identity)
+ return Blit2to2Key;
+ else if(dstfmt->BytesPerPixel == 1)
+ return BlitNto1Key;
+ else {
+#if SDL_ALTIVEC_BLITTERS
+ if((srcfmt->BytesPerPixel == 4) && (dstfmt->BytesPerPixel == 4) && SDL_HasAltiVec()) {
+ return Blit32to32KeyAltivec;
+ } else
+#endif
+
+ if(srcfmt->Amask && dstfmt->Amask)
+ return BlitNtoNKeyCopyAlpha;
+ else
+ return BlitNtoNKey;
+ }
+ }
+
+ blitfun = NULL;
+ if ( dstfmt->BitsPerPixel == 8 ) {
+ /* We assume 8-bit destinations are palettized */
+ if ( (srcfmt->BytesPerPixel == 4) &&
+ (srcfmt->Rmask == 0x00FF0000) &&
+ (srcfmt->Gmask == 0x0000FF00) &&
+ (srcfmt->Bmask == 0x000000FF) ) {
+ if ( surface->map->table ) {
+ blitfun = Blit_RGB888_index8_map;
+ } else {
+#if SDL_HERMES_BLITTERS
+ sdata->aux_data = ConvertX86p32_8RGB332;
+ blitfun = ConvertX86;
+#else
+ blitfun = Blit_RGB888_index8;
+#endif
+ }
+ } else {
+ blitfun = BlitNto1;
+ }
+ } else {
+ /* Now the meat, choose the blitter we want */
+ int a_need = NO_ALPHA;
+ if(dstfmt->Amask)
+ a_need = srcfmt->Amask ? COPY_ALPHA : SET_ALPHA;
+ table = normal_blit[srcfmt->BytesPerPixel-1];
+ for ( which=0; table[which].dstbpp; ++which ) {
+ if ( MASKOK(srcfmt->Rmask, table[which].srcR) &&
+ MASKOK(srcfmt->Gmask, table[which].srcG) &&
+ MASKOK(srcfmt->Bmask, table[which].srcB) &&
+ MASKOK(dstfmt->Rmask, table[which].dstR) &&
+ MASKOK(dstfmt->Gmask, table[which].dstG) &&
+ MASKOK(dstfmt->Bmask, table[which].dstB) &&
+ dstfmt->BytesPerPixel == table[which].dstbpp &&
+ (a_need & table[which].alpha) == a_need &&
+ ((table[which].blit_features & GetBlitFeatures()) == table[which].blit_features) )
+ break;
+ }
+ sdata->aux_data = table[which].aux_data;
+ blitfun = table[which].blitfunc;
+
+ if(blitfun == BlitNtoN) { /* default C fallback catch-all. Slow! */
+ /* Fastpath C fallback: 32bit RGB<->RGBA blit with matching RGB */
+ if ( srcfmt->BytesPerPixel == 4 && dstfmt->BytesPerPixel == 4 &&
+ srcfmt->Rmask == dstfmt->Rmask &&
+ srcfmt->Gmask == dstfmt->Gmask &&
+ srcfmt->Bmask == dstfmt->Bmask ) {
+ blitfun = Blit4to4MaskAlpha;
+ } else if ( a_need == COPY_ALPHA ) {
+ blitfun = BlitNtoNCopyAlpha;
+ }
+ }
+ }
+
+#ifdef DEBUG_ASM
+#if SDL_HERMES_BLITTERS
+ if ( blitfun == ConvertMMX )
+ fprintf(stderr, "Using mmx blit\n");
+ else
+ if ( blitfun == ConvertX86 )
+ fprintf(stderr, "Using asm blit\n");
+ else
+#endif
+ if ( (blitfun == BlitNtoN) || (blitfun == BlitNto1) )
+ fprintf(stderr, "Using C blit\n");
+ else
+ fprintf(stderr, "Using optimized C blit\n");
+#endif /* DEBUG_ASM */
+
+ return(blitfun);
+}
diff --git a/distrib/sdl-1.2.15/src/video/SDL_bmp.c b/distrib/sdl-1.2.15/src/video/SDL_bmp.c
new file mode 100644
index 0000000..d56cfd8
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_bmp.c
@@ -0,0 +1,549 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ 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.
+
+ This code currently supports Win32 DIBs in uncompressed 8 and 24 bpp.
+*/
+
+#include "SDL_video.h"
+#include "SDL_endian.h"
+
+/* Compression encodings for BMP files */
+#ifndef BI_RGB
+#define BI_RGB 0
+#define BI_RLE8 1
+#define BI_RLE4 2
+#define BI_BITFIELDS 3
+#endif
+
+
+SDL_Surface * SDL_LoadBMP_RW (SDL_RWops *src, int freesrc)
+{
+ SDL_bool was_error;
+ long fp_offset = 0;
+ int bmpPitch;
+ int i, pad;
+ SDL_Surface *surface;
+ Uint32 Rmask;
+ Uint32 Gmask;
+ Uint32 Bmask;
+ SDL_Palette *palette;
+ Uint8 *bits;
+ Uint8 *top, *end;
+ SDL_bool topDown;
+ int ExpandBMP;
+
+ /* The Win32 BMP file header (14 bytes) */
+ char magic[2];
+ Uint32 bfSize;
+ Uint16 bfReserved1;
+ Uint16 bfReserved2;
+ Uint32 bfOffBits;
+
+ /* The Win32 BITMAPINFOHEADER struct (40 bytes) */
+ Uint32 biSize;
+ Sint32 biWidth;
+ Sint32 biHeight;
+ Uint16 biPlanes;
+ Uint16 biBitCount;
+ Uint32 biCompression;
+ Uint32 biSizeImage;
+ Sint32 biXPelsPerMeter;
+ Sint32 biYPelsPerMeter;
+ Uint32 biClrUsed;
+ Uint32 biClrImportant;
+
+ /* Make sure we are passed a valid data source */
+ surface = NULL;
+ was_error = SDL_FALSE;
+ if ( src == NULL ) {
+ was_error = SDL_TRUE;
+ goto done;
+ }
+
+ /* Read in the BMP file header */
+ fp_offset = SDL_RWtell(src);
+ SDL_ClearError();
+ if ( SDL_RWread(src, magic, 1, 2) != 2 ) {
+ SDL_Error(SDL_EFREAD);
+ was_error = SDL_TRUE;
+ goto done;
+ }
+ if ( SDL_strncmp(magic, "BM", 2) != 0 ) {
+ SDL_SetError("File is not a Windows BMP file");
+ was_error = SDL_TRUE;
+ goto done;
+ }
+ bfSize = SDL_ReadLE32(src);
+ bfReserved1 = SDL_ReadLE16(src);
+ bfReserved2 = SDL_ReadLE16(src);
+ bfOffBits = SDL_ReadLE32(src);
+
+ /* Read the Win32 BITMAPINFOHEADER */
+ biSize = SDL_ReadLE32(src);
+ if ( biSize == 12 ) {
+ biWidth = (Uint32)SDL_ReadLE16(src);
+ biHeight = (Uint32)SDL_ReadLE16(src);
+ biPlanes = SDL_ReadLE16(src);
+ biBitCount = SDL_ReadLE16(src);
+ biCompression = BI_RGB;
+ biSizeImage = 0;
+ biXPelsPerMeter = 0;
+ biYPelsPerMeter = 0;
+ biClrUsed = 0;
+ biClrImportant = 0;
+ } else {
+ biWidth = SDL_ReadLE32(src);
+ biHeight = SDL_ReadLE32(src);
+ biPlanes = SDL_ReadLE16(src);
+ biBitCount = SDL_ReadLE16(src);
+ biCompression = SDL_ReadLE32(src);
+ biSizeImage = SDL_ReadLE32(src);
+ biXPelsPerMeter = SDL_ReadLE32(src);
+ biYPelsPerMeter = SDL_ReadLE32(src);
+ biClrUsed = SDL_ReadLE32(src);
+ biClrImportant = SDL_ReadLE32(src);
+ }
+
+ /* stop some compiler warnings. */
+ (void) bfSize;
+ (void) bfReserved1;
+ (void) bfReserved2;
+ (void) biPlanes;
+ (void) biSizeImage;
+ (void) biXPelsPerMeter;
+ (void) biYPelsPerMeter;
+ (void) biClrImportant;
+
+ if (biHeight < 0) {
+ topDown = SDL_TRUE;
+ biHeight = -biHeight;
+ } else {
+ topDown = SDL_FALSE;
+ }
+
+ /* Check for read error */
+ if ( SDL_strcmp(SDL_GetError(), "") != 0 ) {
+ was_error = SDL_TRUE;
+ goto done;
+ }
+
+ /* Expand 1 and 4 bit bitmaps to 8 bits per pixel */
+ switch (biBitCount) {
+ case 1:
+ case 4:
+ ExpandBMP = biBitCount;
+ biBitCount = 8;
+ break;
+ default:
+ ExpandBMP = 0;
+ break;
+ }
+
+ /* We don't support any BMP compression right now */
+ Rmask = Gmask = Bmask = 0;
+ switch (biCompression) {
+ case BI_RGB:
+ /* If there are no masks, use the defaults */
+ if ( bfOffBits == (14+biSize) ) {
+ /* Default values for the BMP format */
+ switch (biBitCount) {
+ case 15:
+ case 16:
+ Rmask = 0x7C00;
+ Gmask = 0x03E0;
+ Bmask = 0x001F;
+ break;
+ case 24:
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+ Rmask = 0x000000FF;
+ Gmask = 0x0000FF00;
+ Bmask = 0x00FF0000;
+ break;
+#endif
+ case 32:
+ Rmask = 0x00FF0000;
+ Gmask = 0x0000FF00;
+ Bmask = 0x000000FF;
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+ /* Fall through -- read the RGB masks */
+
+ case BI_BITFIELDS:
+ switch (biBitCount) {
+ case 15:
+ case 16:
+ case 32:
+ Rmask = SDL_ReadLE32(src);
+ Gmask = SDL_ReadLE32(src);
+ Bmask = SDL_ReadLE32(src);
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ SDL_SetError("Compressed BMP files not supported");
+ was_error = SDL_TRUE;
+ goto done;
+ }
+
+ /* Create a compatible surface, note that the colors are RGB ordered */
+ surface = SDL_CreateRGBSurface(SDL_SWSURFACE,
+ biWidth, biHeight, biBitCount, Rmask, Gmask, Bmask, 0);
+ if ( surface == NULL ) {
+ was_error = SDL_TRUE;
+ goto done;
+ }
+
+ /* Load the palette, if any */
+ palette = (surface->format)->palette;
+ if ( palette ) {
+ if ( biClrUsed == 0 ) {
+ biClrUsed = 1 << biBitCount;
+ }
+ if ( biSize == 12 ) {
+ for ( i = 0; i < (int)biClrUsed; ++i ) {
+ SDL_RWread(src, &palette->colors[i].b, 1, 1);
+ SDL_RWread(src, &palette->colors[i].g, 1, 1);
+ SDL_RWread(src, &palette->colors[i].r, 1, 1);
+ palette->colors[i].unused = 0;
+ }
+ } else {
+ for ( i = 0; i < (int)biClrUsed; ++i ) {
+ SDL_RWread(src, &palette->colors[i].b, 1, 1);
+ SDL_RWread(src, &palette->colors[i].g, 1, 1);
+ SDL_RWread(src, &palette->colors[i].r, 1, 1);
+ SDL_RWread(src, &palette->colors[i].unused, 1, 1);
+ }
+ }
+ palette->ncolors = biClrUsed;
+ }
+
+ /* Read the surface pixels. Note that the bmp image is upside down */
+ if ( SDL_RWseek(src, fp_offset+bfOffBits, RW_SEEK_SET) < 0 ) {
+ SDL_Error(SDL_EFSEEK);
+ was_error = SDL_TRUE;
+ goto done;
+ }
+ top = (Uint8 *)surface->pixels;
+ end = (Uint8 *)surface->pixels+(surface->h*surface->pitch);
+ switch (ExpandBMP) {
+ case 1:
+ bmpPitch = (biWidth + 7) >> 3;
+ pad = (((bmpPitch)%4) ? (4-((bmpPitch)%4)) : 0);
+ break;
+ case 4:
+ bmpPitch = (biWidth + 1) >> 1;
+ pad = (((bmpPitch)%4) ? (4-((bmpPitch)%4)) : 0);
+ break;
+ default:
+ pad = ((surface->pitch%4) ?
+ (4-(surface->pitch%4)) : 0);
+ break;
+ }
+ if ( topDown ) {
+ bits = top;
+ } else {
+ bits = end - surface->pitch;
+ }
+ while ( bits >= top && bits < end ) {
+ switch (ExpandBMP) {
+ case 1:
+ case 4: {
+ Uint8 pixel = 0;
+ int shift = (8-ExpandBMP);
+ for ( i=0; i<surface->w; ++i ) {
+ if ( i%(8/ExpandBMP) == 0 ) {
+ if ( !SDL_RWread(src, &pixel, 1, 1) ) {
+ SDL_SetError(
+ "Error reading from BMP");
+ was_error = SDL_TRUE;
+ goto done;
+ }
+ }
+ *(bits+i) = (pixel>>shift);
+ pixel <<= ExpandBMP;
+ } }
+ break;
+
+ default:
+ if ( SDL_RWread(src, bits, 1, surface->pitch)
+ != surface->pitch ) {
+ SDL_Error(SDL_EFREAD);
+ was_error = SDL_TRUE;
+ goto done;
+ }
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+ /* Byte-swap the pixels if needed. Note that the 24bpp
+ case has already been taken care of above. */
+ switch(biBitCount) {
+ case 15:
+ case 16: {
+ Uint16 *pix = (Uint16 *)bits;
+ for(i = 0; i < surface->w; i++)
+ pix[i] = SDL_Swap16(pix[i]);
+ break;
+ }
+
+ case 32: {
+ Uint32 *pix = (Uint32 *)bits;
+ for(i = 0; i < surface->w; i++)
+ pix[i] = SDL_Swap32(pix[i]);
+ break;
+ }
+ }
+#endif
+ break;
+ }
+ /* Skip padding bytes, ugh */
+ if ( pad ) {
+ Uint8 padbyte;
+ for ( i=0; i<pad; ++i ) {
+ SDL_RWread(src, &padbyte, 1, 1);
+ }
+ }
+ if ( topDown ) {
+ bits += surface->pitch;
+ } else {
+ bits -= surface->pitch;
+ }
+ }
+done:
+ if ( was_error ) {
+ if ( src ) {
+ SDL_RWseek(src, fp_offset, RW_SEEK_SET);
+ }
+ if ( surface ) {
+ SDL_FreeSurface(surface);
+ }
+ surface = NULL;
+ }
+ if ( freesrc && src ) {
+ SDL_RWclose(src);
+ }
+ return(surface);
+}
+
+int SDL_SaveBMP_RW (SDL_Surface *saveme, SDL_RWops *dst, int freedst)
+{
+ long fp_offset;
+ int i, pad;
+ SDL_Surface *surface;
+ Uint8 *bits;
+
+ /* The Win32 BMP file header (14 bytes) */
+ char magic[2] = { 'B', 'M' };
+ Uint32 bfSize;
+ Uint16 bfReserved1;
+ Uint16 bfReserved2;
+ Uint32 bfOffBits;
+
+ /* The Win32 BITMAPINFOHEADER struct (40 bytes) */
+ Uint32 biSize;
+ Sint32 biWidth;
+ Sint32 biHeight;
+ Uint16 biPlanes;
+ Uint16 biBitCount;
+ Uint32 biCompression;
+ Uint32 biSizeImage;
+ Sint32 biXPelsPerMeter;
+ Sint32 biYPelsPerMeter;
+ Uint32 biClrUsed;
+ Uint32 biClrImportant;
+
+ /* Make sure we have somewhere to save */
+ surface = NULL;
+ if ( dst ) {
+ if ( saveme->format->palette ) {
+ if ( saveme->format->BitsPerPixel == 8 ) {
+ surface = saveme;
+ } else {
+ SDL_SetError("%d bpp BMP files not supported",
+ saveme->format->BitsPerPixel);
+ }
+ }
+ else if ( (saveme->format->BitsPerPixel == 24) &&
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+ (saveme->format->Rmask == 0x00FF0000) &&
+ (saveme->format->Gmask == 0x0000FF00) &&
+ (saveme->format->Bmask == 0x000000FF)
+#else
+ (saveme->format->Rmask == 0x000000FF) &&
+ (saveme->format->Gmask == 0x0000FF00) &&
+ (saveme->format->Bmask == 0x00FF0000)
+#endif
+ ) {
+ surface = saveme;
+ } else {
+ SDL_Rect bounds;
+
+ /* Convert to 24 bits per pixel */
+ surface = SDL_CreateRGBSurface(SDL_SWSURFACE,
+ saveme->w, saveme->h, 24,
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+ 0x00FF0000, 0x0000FF00, 0x000000FF,
+#else
+ 0x000000FF, 0x0000FF00, 0x00FF0000,
+#endif
+ 0);
+ if ( surface != NULL ) {
+ bounds.x = 0;
+ bounds.y = 0;
+ bounds.w = saveme->w;
+ bounds.h = saveme->h;
+ if ( SDL_LowerBlit(saveme, &bounds, surface,
+ &bounds) < 0 ) {
+ SDL_FreeSurface(surface);
+ SDL_SetError(
+ "Couldn't convert image to 24 bpp");
+ surface = NULL;
+ }
+ }
+ }
+ }
+
+ if ( surface && (SDL_LockSurface(surface) == 0) ) {
+ const int bw = surface->w*surface->format->BytesPerPixel;
+
+ /* Set the BMP file header values */
+ bfSize = 0; /* We'll write this when we're done */
+ bfReserved1 = 0;
+ bfReserved2 = 0;
+ bfOffBits = 0; /* We'll write this when we're done */
+
+ /* Write the BMP file header values */
+ fp_offset = SDL_RWtell(dst);
+ SDL_ClearError();
+ SDL_RWwrite(dst, magic, 2, 1);
+ SDL_WriteLE32(dst, bfSize);
+ SDL_WriteLE16(dst, bfReserved1);
+ SDL_WriteLE16(dst, bfReserved2);
+ SDL_WriteLE32(dst, bfOffBits);
+
+ /* Set the BMP info values */
+ biSize = 40;
+ biWidth = surface->w;
+ biHeight = surface->h;
+ biPlanes = 1;
+ biBitCount = surface->format->BitsPerPixel;
+ biCompression = BI_RGB;
+ biSizeImage = surface->h*surface->pitch;
+ biXPelsPerMeter = 0;
+ biYPelsPerMeter = 0;
+ if ( surface->format->palette ) {
+ biClrUsed = surface->format->palette->ncolors;
+ } else {
+ biClrUsed = 0;
+ }
+ biClrImportant = 0;
+
+ /* Write the BMP info values */
+ SDL_WriteLE32(dst, biSize);
+ SDL_WriteLE32(dst, biWidth);
+ SDL_WriteLE32(dst, biHeight);
+ SDL_WriteLE16(dst, biPlanes);
+ SDL_WriteLE16(dst, biBitCount);
+ SDL_WriteLE32(dst, biCompression);
+ SDL_WriteLE32(dst, biSizeImage);
+ SDL_WriteLE32(dst, biXPelsPerMeter);
+ SDL_WriteLE32(dst, biYPelsPerMeter);
+ SDL_WriteLE32(dst, biClrUsed);
+ SDL_WriteLE32(dst, biClrImportant);
+
+ /* Write the palette (in BGR color order) */
+ if ( surface->format->palette ) {
+ SDL_Color *colors;
+ int ncolors;
+
+ colors = surface->format->palette->colors;
+ ncolors = surface->format->palette->ncolors;
+ for ( i=0; i<ncolors; ++i ) {
+ SDL_RWwrite(dst, &colors[i].b, 1, 1);
+ SDL_RWwrite(dst, &colors[i].g, 1, 1);
+ SDL_RWwrite(dst, &colors[i].r, 1, 1);
+ SDL_RWwrite(dst, &colors[i].unused, 1, 1);
+ }
+ }
+
+ /* Write the bitmap offset */
+ bfOffBits = SDL_RWtell(dst)-fp_offset;
+ if ( SDL_RWseek(dst, fp_offset+10, RW_SEEK_SET) < 0 ) {
+ SDL_Error(SDL_EFSEEK);
+ }
+ SDL_WriteLE32(dst, bfOffBits);
+ if ( SDL_RWseek(dst, fp_offset+bfOffBits, RW_SEEK_SET) < 0 ) {
+ SDL_Error(SDL_EFSEEK);
+ }
+
+ /* Write the bitmap image upside down */
+ bits = (Uint8 *)surface->pixels+(surface->h*surface->pitch);
+ pad = ((bw%4) ? (4-(bw%4)) : 0);
+ while ( bits > (Uint8 *)surface->pixels ) {
+ bits -= surface->pitch;
+ if ( SDL_RWwrite(dst, bits, 1, bw) != bw) {
+ SDL_Error(SDL_EFWRITE);
+ break;
+ }
+ if ( pad ) {
+ const Uint8 padbyte = 0;
+ for ( i=0; i<pad; ++i ) {
+ SDL_RWwrite(dst, &padbyte, 1, 1);
+ }
+ }
+ }
+
+ /* Write the BMP file size */
+ bfSize = SDL_RWtell(dst)-fp_offset;
+ if ( SDL_RWseek(dst, fp_offset+2, RW_SEEK_SET) < 0 ) {
+ SDL_Error(SDL_EFSEEK);
+ }
+ SDL_WriteLE32(dst, bfSize);
+ if ( SDL_RWseek(dst, fp_offset+bfSize, RW_SEEK_SET) < 0 ) {
+ SDL_Error(SDL_EFSEEK);
+ }
+
+ /* Close it up.. */
+ SDL_UnlockSurface(surface);
+ if ( surface != saveme ) {
+ SDL_FreeSurface(surface);
+ }
+ }
+
+ if ( freedst && dst ) {
+ SDL_RWclose(dst);
+ }
+ return((SDL_strcmp(SDL_GetError(), "") == 0) ? 0 : -1);
+}
diff --git a/distrib/sdl-1.2.15/src/video/SDL_cursor.c b/distrib/sdl-1.2.15/src/video/SDL_cursor.c
new file mode 100644
index 0000000..5d747d3
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_cursor.c
@@ -0,0 +1,758 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* General cursor handling code for SDL */
+
+#include "SDL_mutex.h"
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "SDL_blit.h"
+#include "SDL_sysvideo.h"
+#include "SDL_cursor_c.h"
+#include "SDL_pixels_c.h"
+#include "default_cursor.h"
+#include "../events/SDL_sysevents.h"
+#include "../events/SDL_events_c.h"
+
+/* These are static for our cursor handling code */
+volatile int SDL_cursorstate = CURSOR_VISIBLE;
+SDL_Cursor *SDL_cursor = NULL;
+static SDL_Cursor *SDL_defcursor = NULL;
+SDL_mutex *SDL_cursorlock = NULL;
+
+/* Public functions */
+void SDL_CursorQuit(void)
+{
+ if ( SDL_cursor != NULL ) {
+ SDL_Cursor *cursor;
+
+ SDL_cursorstate &= ~CURSOR_VISIBLE;
+ if ( SDL_cursor != SDL_defcursor ) {
+ SDL_FreeCursor(SDL_cursor);
+ }
+ SDL_cursor = NULL;
+ if ( SDL_defcursor != NULL ) {
+ cursor = SDL_defcursor;
+ SDL_defcursor = NULL;
+ SDL_FreeCursor(cursor);
+ }
+ }
+ if ( SDL_cursorlock != NULL ) {
+ SDL_DestroyMutex(SDL_cursorlock);
+ SDL_cursorlock = NULL;
+ }
+}
+int SDL_CursorInit(Uint32 multithreaded)
+{
+ /* We don't have mouse focus, and the cursor isn't drawn yet */
+#ifndef IPOD
+ SDL_cursorstate = CURSOR_VISIBLE;
+#endif
+
+ /* Create the default cursor */
+ if ( SDL_defcursor == NULL ) {
+ SDL_defcursor = SDL_CreateCursor(default_cdata, default_cmask,
+ DEFAULT_CWIDTH, DEFAULT_CHEIGHT,
+ DEFAULT_CHOTX, DEFAULT_CHOTY);
+ SDL_SetCursor(SDL_defcursor);
+ }
+
+ /* Create a lock if necessary */
+ if ( multithreaded ) {
+ SDL_cursorlock = SDL_CreateMutex();
+ }
+
+ /* That's it! */
+ return(0);
+}
+
+/* Multi-thread support for cursors */
+#ifndef SDL_LockCursor
+void SDL_LockCursor(void)
+{
+ if ( SDL_cursorlock ) {
+ SDL_mutexP(SDL_cursorlock);
+ }
+}
+#endif
+#ifndef SDL_UnlockCursor
+void SDL_UnlockCursor(void)
+{
+ if ( SDL_cursorlock ) {
+ SDL_mutexV(SDL_cursorlock);
+ }
+}
+#endif
+
+/* Software cursor drawing support */
+SDL_Cursor * SDL_CreateCursor (Uint8 *data, Uint8 *mask,
+ int w, int h, int hot_x, int hot_y)
+{
+ SDL_VideoDevice *video = current_video;
+ int savelen;
+ int i;
+ SDL_Cursor *cursor;
+
+ /* Make sure the width is a multiple of 8 */
+ w = ((w+7)&~7);
+
+ /* Sanity check the hot spot */
+ if ( (hot_x < 0) || (hot_y < 0) || (hot_x >= w) || (hot_y >= h) ) {
+ SDL_SetError("Cursor hot spot doesn't lie within cursor");
+ return(NULL);
+ }
+
+ /* Allocate memory for the cursor */
+ cursor = (SDL_Cursor *)SDL_malloc(sizeof *cursor);
+ if ( cursor == NULL ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ savelen = (w*4)*h;
+ cursor->area.x = 0;
+ cursor->area.y = 0;
+ cursor->area.w = w;
+ cursor->area.h = h;
+ cursor->hot_x = hot_x;
+ cursor->hot_y = hot_y;
+ cursor->data = (Uint8 *)SDL_malloc((w/8)*h*2);
+ cursor->mask = cursor->data+((w/8)*h);
+ cursor->save[0] = (Uint8 *)SDL_malloc(savelen*2);
+ cursor->save[1] = cursor->save[0] + savelen;
+ cursor->wm_cursor = NULL;
+ if ( ! cursor->data || ! cursor->save[0] ) {
+ SDL_FreeCursor(cursor);
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ for ( i=((w/8)*h)-1; i>=0; --i ) {
+ cursor->data[i] = data[i];
+ cursor->mask[i] = mask[i] | data[i];
+ }
+ SDL_memset(cursor->save[0], 0, savelen*2);
+
+ /* If the window manager gives us a good cursor, we're done! */
+ if ( video->CreateWMCursor ) {
+ cursor->wm_cursor = video->CreateWMCursor(video, data, mask,
+ w, h, hot_x, hot_y);
+ } else {
+ cursor->wm_cursor = NULL;
+ }
+ return(cursor);
+}
+
+/* SDL_SetCursor(NULL) can be used to force the cursor redraw,
+ if this is desired for any reason. This is used when setting
+ the video mode and when the SDL window gains the mouse focus.
+ */
+void SDL_SetCursor (SDL_Cursor *cursor)
+{
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+
+ /* Make sure that the video subsystem has been initialized */
+ if ( ! video ) {
+ return;
+ }
+
+ /* Prevent the event thread from moving the mouse */
+ SDL_LockCursor();
+
+ /* Set the new cursor */
+ if ( cursor && (cursor != SDL_cursor) ) {
+ /* Erase the current mouse position */
+ if ( SHOULD_DRAWCURSOR(SDL_cursorstate) ) {
+ SDL_EraseCursor(SDL_VideoSurface);
+ } else if ( video->MoveWMCursor ) {
+ /* If the video driver is moving the cursor directly,
+ it needs to hide the old cursor before (possibly)
+ showing the new one. (But don't erase NULL cursor)
+ */
+ if ( SDL_cursor && video->ShowWMCursor ) {
+ video->ShowWMCursor(this, NULL);
+ }
+ }
+ SDL_cursor = cursor;
+ }
+
+ /* Draw the new mouse cursor */
+ if ( SDL_cursor && (SDL_cursorstate&CURSOR_VISIBLE) ) {
+ /* Use window manager cursor if possible */
+ int show_wm_cursor = 0;
+ if ( SDL_cursor->wm_cursor && video->ShowWMCursor ) {
+ show_wm_cursor = video->ShowWMCursor(this, SDL_cursor->wm_cursor);
+ }
+ if ( show_wm_cursor ) {
+ SDL_cursorstate &= ~CURSOR_USINGSW;
+ } else {
+ SDL_cursorstate |= CURSOR_USINGSW;
+ if ( video->ShowWMCursor ) {
+ video->ShowWMCursor(this, NULL);
+ }
+ { int x, y;
+ SDL_GetMouseState(&x, &y);
+ SDL_cursor->area.x = (x - SDL_cursor->hot_x);
+ SDL_cursor->area.y = (y - SDL_cursor->hot_y);
+ }
+ SDL_DrawCursor(SDL_VideoSurface);
+ }
+ } else {
+ /* Erase window manager mouse (cursor not visible) */
+ if ( SDL_cursor && (SDL_cursorstate & CURSOR_USINGSW) ) {
+ SDL_EraseCursor(SDL_VideoSurface);
+ } else {
+ if ( video ) {
+ if ( video->ShowWMCursor ) {
+ video->ShowWMCursor(this, NULL);
+ }
+ }
+ }
+ }
+ SDL_UnlockCursor();
+}
+
+SDL_Cursor * SDL_GetCursor (void)
+{
+ return(SDL_cursor);
+}
+
+void SDL_FreeCursor (SDL_Cursor *cursor)
+{
+ if ( cursor ) {
+ if ( cursor == SDL_cursor ) {
+ SDL_SetCursor(SDL_defcursor);
+ }
+ if ( cursor != SDL_defcursor ) {
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+
+ if ( cursor->data ) {
+ SDL_free(cursor->data);
+ }
+ if ( cursor->save[0] ) {
+ SDL_free(cursor->save[0]);
+ }
+ if ( video && cursor->wm_cursor ) {
+ if ( video->FreeWMCursor ) {
+ video->FreeWMCursor(this, cursor->wm_cursor);
+ }
+ }
+ SDL_free(cursor);
+ }
+ }
+}
+
+int SDL_ShowCursor (int toggle)
+{
+ int showing;
+
+ showing = (SDL_cursorstate & CURSOR_VISIBLE);
+ if ( toggle >= 0 ) {
+ SDL_LockCursor();
+ if ( toggle ) {
+ SDL_cursorstate |= CURSOR_VISIBLE;
+ } else {
+ SDL_cursorstate &= ~CURSOR_VISIBLE;
+ }
+ SDL_UnlockCursor();
+ if ( (SDL_cursorstate & CURSOR_VISIBLE) != showing ) {
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+
+ SDL_SetCursor(NULL);
+ if ( video && video->CheckMouseMode ) {
+ video->CheckMouseMode(this);
+ }
+ }
+ } else {
+ /* Query current state */ ;
+ }
+ return(showing ? 1 : 0);
+}
+
+void SDL_WarpMouse (Uint16 x, Uint16 y)
+{
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+
+ if ( !video || !SDL_PublicSurface ) {
+ SDL_SetError("A video mode must be set before warping mouse");
+ return;
+ }
+
+ /* If we have an offset video mode, offset the mouse coordinates */
+ if (this->screen->pitch == 0) {
+ x += this->screen->offset / this->screen->format->BytesPerPixel;
+ y += this->screen->offset;
+ } else {
+ x += (this->screen->offset % this->screen->pitch) /
+ this->screen->format->BytesPerPixel;
+ y += (this->screen->offset / this->screen->pitch);
+ }
+
+ /* This generates a mouse motion event */
+ if ( video->WarpWMCursor ) {
+ video->WarpWMCursor(this, x, y);
+ } else {
+ SDL_PrivateMouseMotion(0, 0, x, y);
+ }
+}
+
+void SDL_MoveCursor(int x, int y)
+{
+ SDL_VideoDevice *video = current_video;
+
+ /* Erase and update the current mouse position */
+ if ( SHOULD_DRAWCURSOR(SDL_cursorstate) ) {
+ /* Erase and redraw mouse cursor in new position */
+ SDL_LockCursor();
+ SDL_EraseCursor(SDL_VideoSurface);
+ SDL_cursor->area.x = (x - SDL_cursor->hot_x);
+ SDL_cursor->area.y = (y - SDL_cursor->hot_y);
+ SDL_DrawCursor(SDL_VideoSurface);
+ SDL_UnlockCursor();
+ } else if ( video->MoveWMCursor ) {
+ video->MoveWMCursor(video, x, y);
+ }
+}
+
+/* Keep track of the current cursor colors */
+static int palette_changed = 1;
+static Uint8 pixels8[2];
+
+void SDL_CursorPaletteChanged(void)
+{
+ palette_changed = 1;
+}
+
+void SDL_MouseRect(SDL_Rect *area)
+{
+ int clip_diff;
+
+ *area = SDL_cursor->area;
+ if ( area->x < 0 ) {
+ area->w += area->x;
+ area->x = 0;
+ }
+ if ( area->y < 0 ) {
+ area->h += area->y;
+ area->y = 0;
+ }
+ clip_diff = (area->x+area->w)-SDL_VideoSurface->w;
+ if ( clip_diff > 0 ) {
+ area->w = area->w < clip_diff ? 0 : area->w-clip_diff;
+ }
+ clip_diff = (area->y+area->h)-SDL_VideoSurface->h;
+ if ( clip_diff > 0 ) {
+ area->h = area->h < clip_diff ? 0 : area->h-clip_diff;
+ }
+}
+
+static void SDL_DrawCursorFast(SDL_Surface *screen, SDL_Rect *area)
+{
+ const Uint32 pixels[2] = { 0xFFFFFFFF, 0x00000000 };
+ int i, w, h;
+ Uint8 *data, datab;
+ Uint8 *mask, maskb;
+
+ data = SDL_cursor->data + area->y * SDL_cursor->area.w/8;
+ mask = SDL_cursor->mask + area->y * SDL_cursor->area.w/8;
+ switch (screen->format->BytesPerPixel) {
+
+ case 1: {
+ Uint8 *dst;
+ int dstskip;
+
+ if ( palette_changed ) {
+ pixels8[0] = (Uint8)SDL_MapRGB(screen->format, 255, 255, 255);
+ pixels8[1] = (Uint8)SDL_MapRGB(screen->format, 0, 0, 0);
+ palette_changed = 0;
+ }
+ dst = (Uint8 *)screen->pixels +
+ (SDL_cursor->area.y+area->y)*screen->pitch +
+ SDL_cursor->area.x;
+ dstskip = screen->pitch-area->w;
+
+ for ( h=area->h; h; h-- ) {
+ for ( w=area->w/8; w; w-- ) {
+ maskb = *mask++;
+ datab = *data++;
+ for ( i=0; i<8; ++i ) {
+ if ( maskb & 0x80 ) {
+ *dst = pixels8[datab>>7];
+ }
+ maskb <<= 1;
+ datab <<= 1;
+ dst++;
+ }
+ }
+ dst += dstskip;
+ }
+ }
+ break;
+
+ case 2: {
+ Uint16 *dst;
+ int dstskip;
+
+ dst = (Uint16 *)screen->pixels +
+ (SDL_cursor->area.y+area->y)*screen->pitch/2 +
+ SDL_cursor->area.x;
+ dstskip = (screen->pitch/2)-area->w;
+
+ for ( h=area->h; h; h-- ) {
+ for ( w=area->w/8; w; w-- ) {
+ maskb = *mask++;
+ datab = *data++;
+ for ( i=0; i<8; ++i ) {
+ if ( maskb & 0x80 ) {
+ *dst = (Uint16)pixels[datab>>7];
+ }
+ maskb <<= 1;
+ datab <<= 1;
+ dst++;
+ }
+ }
+ dst += dstskip;
+ }
+ }
+ break;
+
+ case 3: {
+ Uint8 *dst;
+ int dstskip;
+
+ dst = (Uint8 *)screen->pixels +
+ (SDL_cursor->area.y+area->y)*screen->pitch +
+ SDL_cursor->area.x*3;
+ dstskip = screen->pitch-area->w*3;
+
+ for ( h=area->h; h; h-- ) {
+ for ( w=area->w/8; w; w-- ) {
+ maskb = *mask++;
+ datab = *data++;
+ for ( i=0; i<8; ++i ) {
+ if ( maskb & 0x80 ) {
+ SDL_memset(dst,pixels[datab>>7],3);
+ }
+ maskb <<= 1;
+ datab <<= 1;
+ dst += 3;
+ }
+ }
+ dst += dstskip;
+ }
+ }
+ break;
+
+ case 4: {
+ Uint32 *dst;
+ int dstskip;
+
+ dst = (Uint32 *)screen->pixels +
+ (SDL_cursor->area.y+area->y)*screen->pitch/4 +
+ SDL_cursor->area.x;
+ dstskip = (screen->pitch/4)-area->w;
+
+ for ( h=area->h; h; h-- ) {
+ for ( w=area->w/8; w; w-- ) {
+ maskb = *mask++;
+ datab = *data++;
+ for ( i=0; i<8; ++i ) {
+ if ( maskb & 0x80 ) {
+ *dst = pixels[datab>>7];
+ }
+ maskb <<= 1;
+ datab <<= 1;
+ dst++;
+ }
+ }
+ dst += dstskip;
+ }
+ }
+ break;
+ }
+}
+
+static void SDL_DrawCursorSlow(SDL_Surface *screen, SDL_Rect *area)
+{
+ const Uint32 pixels[2] = { 0xFFFFFF, 0x000000 };
+ int h;
+ int x, minx, maxx;
+ Uint8 *data, datab = 0;
+ Uint8 *mask, maskb = 0;
+ Uint8 *dst;
+ int dstbpp, dstskip;
+
+ data = SDL_cursor->data + area->y * SDL_cursor->area.w/8;
+ mask = SDL_cursor->mask + area->y * SDL_cursor->area.w/8;
+ dstbpp = screen->format->BytesPerPixel;
+ dst = (Uint8 *)screen->pixels +
+ (SDL_cursor->area.y+area->y)*screen->pitch +
+ SDL_cursor->area.x*dstbpp;
+ dstskip = screen->pitch-SDL_cursor->area.w*dstbpp;
+
+ minx = area->x;
+ maxx = area->x+area->w;
+ if ( screen->format->BytesPerPixel == 1 ) {
+ if ( palette_changed ) {
+ pixels8[0] = (Uint8)SDL_MapRGB(screen->format, 255, 255, 255);
+ pixels8[1] = (Uint8)SDL_MapRGB(screen->format, 0, 0, 0);
+ palette_changed = 0;
+ }
+ for ( h=area->h; h; h-- ) {
+ for ( x=0; x<SDL_cursor->area.w; ++x ) {
+ if ( (x%8) == 0 ) {
+ maskb = *mask++;
+ datab = *data++;
+ }
+ if ( (x >= minx) && (x < maxx) ) {
+ if ( maskb & 0x80 ) {
+ SDL_memset(dst, pixels8[datab>>7], dstbpp);
+ }
+ }
+ maskb <<= 1;
+ datab <<= 1;
+ dst += dstbpp;
+ }
+ dst += dstskip;
+ }
+ } else {
+ for ( h=area->h; h; h-- ) {
+ for ( x=0; x<SDL_cursor->area.w; ++x ) {
+ if ( (x%8) == 0 ) {
+ maskb = *mask++;
+ datab = *data++;
+ }
+ if ( (x >= minx) && (x < maxx) ) {
+ if ( maskb & 0x80 ) {
+ SDL_memset(dst, pixels[datab>>7], dstbpp);
+ }
+ }
+ maskb <<= 1;
+ datab <<= 1;
+ dst += dstbpp;
+ }
+ dst += dstskip;
+ }
+ }
+}
+
+/* This handles the ugly work of converting the saved cursor background from
+ the pixel format of the shadow surface to that of the video surface.
+ This is only necessary when blitting from a shadow surface of a different
+ pixel format than the video surface, and using a software rendered cursor.
+*/
+static void SDL_ConvertCursorSave(SDL_Surface *screen, int w, int h)
+{
+ SDL_BlitInfo info;
+ SDL_loblit RunBlit;
+
+ /* Make sure we can steal the blit mapping */
+ if ( screen->map->dst != SDL_VideoSurface ) {
+ return;
+ }
+
+ /* Set up the blit information */
+ info.s_pixels = SDL_cursor->save[1];
+ info.s_width = w;
+ info.s_height = h;
+ info.s_skip = 0;
+ info.d_pixels = SDL_cursor->save[0];
+ info.d_width = w;
+ info.d_height = h;
+ info.d_skip = 0;
+ info.aux_data = screen->map->sw_data->aux_data;
+ info.src = screen->format;
+ info.table = screen->map->table;
+ info.dst = SDL_VideoSurface->format;
+ RunBlit = screen->map->sw_data->blit;
+
+ /* Run the actual software blit */
+ RunBlit(&info);
+}
+
+void SDL_DrawCursorNoLock(SDL_Surface *screen)
+{
+ SDL_Rect area;
+
+ /* Get the mouse rectangle, clipped to the screen */
+ SDL_MouseRect(&area);
+ if ( (area.w == 0) || (area.h == 0) ) {
+ return;
+ }
+
+ /* Copy mouse background */
+ { int w, h, screenbpp;
+ Uint8 *src, *dst;
+
+ /* Set up the copy pointers */
+ screenbpp = screen->format->BytesPerPixel;
+ if ( (screen == SDL_VideoSurface) ||
+ FORMAT_EQUAL(screen->format, SDL_VideoSurface->format) ) {
+ dst = SDL_cursor->save[0];
+ } else {
+ dst = SDL_cursor->save[1];
+ }
+ src = (Uint8 *)screen->pixels + area.y * screen->pitch +
+ area.x * screenbpp;
+
+ /* Perform the copy */
+ w = area.w*screenbpp;
+ h = area.h;
+ while ( h-- ) {
+ SDL_memcpy(dst, src, w);
+ dst += w;
+ src += screen->pitch;
+ }
+ }
+
+ /* Draw the mouse cursor */
+ area.x -= SDL_cursor->area.x;
+ area.y -= SDL_cursor->area.y;
+ if ( (area.x == 0) && (area.w == SDL_cursor->area.w) ) {
+ SDL_DrawCursorFast(screen, &area);
+ } else {
+ SDL_DrawCursorSlow(screen, &area);
+ }
+}
+
+void SDL_DrawCursor(SDL_Surface *screen)
+{
+ /* Lock the screen if necessary */
+ if ( screen == NULL ) {
+ return;
+ }
+ if ( SDL_MUSTLOCK(screen) ) {
+ if ( SDL_LockSurface(screen) < 0 ) {
+ return;
+ }
+ }
+
+ SDL_DrawCursorNoLock(screen);
+
+ /* Unlock the screen and update if necessary */
+ if ( SDL_MUSTLOCK(screen) ) {
+ SDL_UnlockSurface(screen);
+ }
+ if ( (screen == SDL_VideoSurface) &&
+ ((screen->flags & SDL_HWSURFACE) != SDL_HWSURFACE) ) {
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+ SDL_Rect area;
+
+ SDL_MouseRect(&area);
+
+ /* This can be called before a video mode is set */
+ if ( video->UpdateRects ) {
+ video->UpdateRects(this, 1, &area);
+ }
+ }
+}
+
+void SDL_EraseCursorNoLock(SDL_Surface *screen)
+{
+ SDL_Rect area;
+
+ /* Get the mouse rectangle, clipped to the screen */
+ SDL_MouseRect(&area);
+ if ( (area.w == 0) || (area.h == 0) ) {
+ return;
+ }
+
+ /* Copy mouse background */
+ { int w, h, screenbpp;
+ Uint8 *src, *dst;
+
+ /* Set up the copy pointers */
+ screenbpp = screen->format->BytesPerPixel;
+ if ( (screen == SDL_VideoSurface) ||
+ FORMAT_EQUAL(screen->format, SDL_VideoSurface->format) ) {
+ src = SDL_cursor->save[0];
+ } else {
+ src = SDL_cursor->save[1];
+ }
+ dst = (Uint8 *)screen->pixels + area.y * screen->pitch +
+ area.x * screenbpp;
+
+ /* Perform the copy */
+ w = area.w*screenbpp;
+ h = area.h;
+ while ( h-- ) {
+ SDL_memcpy(dst, src, w);
+ src += w;
+ dst += screen->pitch;
+ }
+
+ /* Perform pixel conversion on cursor background */
+ if ( src > SDL_cursor->save[1] ) {
+ SDL_ConvertCursorSave(screen, area.w, area.h);
+ }
+ }
+}
+
+void SDL_EraseCursor(SDL_Surface *screen)
+{
+ /* Lock the screen if necessary */
+ if ( screen == NULL ) {
+ return;
+ }
+ if ( SDL_MUSTLOCK(screen) ) {
+ if ( SDL_LockSurface(screen) < 0 ) {
+ return;
+ }
+ }
+
+ SDL_EraseCursorNoLock(screen);
+
+ /* Unlock the screen and update if necessary */
+ if ( SDL_MUSTLOCK(screen) ) {
+ SDL_UnlockSurface(screen);
+ }
+ if ( (screen == SDL_VideoSurface) &&
+ ((screen->flags & SDL_HWSURFACE) != SDL_HWSURFACE) ) {
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+ SDL_Rect area;
+
+ SDL_MouseRect(&area);
+ if ( video->UpdateRects ) {
+ video->UpdateRects(this, 1, &area);
+ }
+ }
+}
+
+/* Reset the cursor on video mode change
+ FIXME: Keep track of all cursors, and reset them all.
+ */
+void SDL_ResetCursor(void)
+{
+ int savelen;
+
+ if ( SDL_cursor ) {
+ savelen = SDL_cursor->area.w*4*SDL_cursor->area.h;
+ SDL_cursor->area.x = 0;
+ SDL_cursor->area.y = 0;
+ SDL_memset(SDL_cursor->save[0], 0, savelen);
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/SDL_cursor_c.h b/distrib/sdl-1.2.15/src/video/SDL_cursor_c.h
new file mode 100644
index 0000000..8be8df9
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_cursor_c.h
@@ -0,0 +1,73 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Useful variables and functions from SDL_cursor.c */
+#include "SDL_mouse.h"
+
+extern int SDL_CursorInit(Uint32 flags);
+extern void SDL_CursorPaletteChanged(void);
+extern void SDL_DrawCursor(SDL_Surface *screen);
+extern void SDL_DrawCursorNoLock(SDL_Surface *screen);
+extern void SDL_EraseCursor(SDL_Surface *screen);
+extern void SDL_EraseCursorNoLock(SDL_Surface *screen);
+extern void SDL_UpdateCursor(SDL_Surface *screen);
+extern void SDL_ResetCursor(void);
+extern void SDL_MoveCursor(int x, int y);
+extern void SDL_CursorQuit(void);
+
+#define INLINE_MOUSELOCK
+#ifdef INLINE_MOUSELOCK
+/* Inline (macro) versions of the mouse lock functions */
+#include "SDL_mutex.h"
+
+extern SDL_mutex *SDL_cursorlock;
+
+#define SDL_LockCursor() \
+ do { \
+ if ( SDL_cursorlock ) { \
+ SDL_mutexP(SDL_cursorlock); \
+ } \
+ } while ( 0 )
+#define SDL_UnlockCursor() \
+ do { \
+ if ( SDL_cursorlock ) { \
+ SDL_mutexV(SDL_cursorlock); \
+ } \
+ } while ( 0 )
+#else
+extern void SDL_LockCursor(void);
+extern void SDL_UnlockCursor(void);
+#endif /* INLINE_MOUSELOCK */
+
+/* Only for low-level mouse cursor drawing */
+extern SDL_Cursor *SDL_cursor;
+extern void SDL_MouseRect(SDL_Rect *area);
+
+/* State definitions for the SDL cursor */
+#define CURSOR_VISIBLE 0x01
+#define CURSOR_USINGSW 0x10
+#define SHOULD_DRAWCURSOR(X) \
+ (((X)&(CURSOR_VISIBLE|CURSOR_USINGSW)) == \
+ (CURSOR_VISIBLE|CURSOR_USINGSW))
+
+extern volatile int SDL_cursorstate;
diff --git a/distrib/sdl-1.2.15/src/video/SDL_gamma.c b/distrib/sdl-1.2.15/src/video/SDL_gamma.c
new file mode 100644
index 0000000..4fd0370
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_gamma.c
@@ -0,0 +1,233 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Gamma correction support */
+
+#ifdef HAVE_MATH_H
+#include <math.h> /* Used for calculating gamma ramps */
+#else
+/* Math routines from uClibc: http://www.uclibc.org */
+#include "math_private.h"
+#include "e_sqrt.h"
+#include "e_pow.h"
+#include "e_log.h"
+#define pow(x, y) __ieee754_pow(x, y)
+#define log(x) __ieee754_log(x)
+#endif
+
+#include "SDL_sysvideo.h"
+
+
+static void CalculateGammaRamp(float gamma, Uint16 *ramp)
+{
+ int i;
+
+ /* 0.0 gamma is all black */
+ if ( gamma <= 0.0f ) {
+ for ( i=0; i<256; ++i ) {
+ ramp[i] = 0;
+ }
+ return;
+ } else
+ /* 1.0 gamma is identity */
+ if ( gamma == 1.0f ) {
+ for ( i=0; i<256; ++i ) {
+ ramp[i] = (i << 8) | i;
+ }
+ return;
+ } else
+ /* Calculate a real gamma ramp */
+ { int value;
+ gamma = 1.0f / gamma;
+ for ( i=0; i<256; ++i ) {
+ value = (int)(pow((double)i/256.0, gamma)*65535.0+0.5);
+ if ( value > 65535 ) {
+ value = 65535;
+ }
+ ramp[i] = (Uint16)value;
+ }
+ }
+}
+static void CalculateGammaFromRamp(float *gamma, Uint16 *ramp)
+{
+ /* The following is adapted from a post by Garrett Bass on OpenGL
+ Gamedev list, March 4, 2000.
+ */
+ float sum = 0.0f;
+ int i, count = 0;
+
+ *gamma = 1.0;
+ for ( i = 1; i < 256; ++i ) {
+ if ( (ramp[i] != 0) && (ramp[i] != 65535) ) {
+ double B = (double)i / 256.0;
+ double A = ramp[i] / 65535.0;
+ sum += (float) ( log(A) / log(B) );
+ count++;
+ }
+ }
+ if ( count && sum > 0.0f ) {
+ *gamma = 1.0f / (sum / count);
+ }
+}
+
+int SDL_SetGamma(float red, float green, float blue)
+{
+ int succeeded;
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+
+ succeeded = -1;
+ /* Prefer using SetGammaRamp(), as it's more flexible */
+ {
+ Uint16 ramp[3][256];
+
+ CalculateGammaRamp(red, ramp[0]);
+ CalculateGammaRamp(green, ramp[1]);
+ CalculateGammaRamp(blue, ramp[2]);
+ succeeded = SDL_SetGammaRamp(ramp[0], ramp[1], ramp[2]);
+ }
+ if ( (succeeded < 0) && video->SetGamma ) {
+ SDL_ClearError();
+ succeeded = video->SetGamma(this, red, green, blue);
+ }
+ return succeeded;
+}
+
+/* Calculating the gamma by integrating the gamma ramps isn't exact,
+ so this function isn't officially supported.
+*/
+int SDL_GetGamma(float *red, float *green, float *blue)
+{
+ int succeeded;
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+
+ succeeded = -1;
+ /* Prefer using GetGammaRamp(), as it's more flexible */
+ {
+ Uint16 ramp[3][256];
+
+ succeeded = SDL_GetGammaRamp(ramp[0], ramp[1], ramp[2]);
+ if ( succeeded >= 0 ) {
+ CalculateGammaFromRamp(red, ramp[0]);
+ CalculateGammaFromRamp(green, ramp[1]);
+ CalculateGammaFromRamp(blue, ramp[2]);
+ }
+ }
+ if ( (succeeded < 0) && video->GetGamma ) {
+ SDL_ClearError();
+ succeeded = video->GetGamma(this, red, green, blue);
+ }
+ return succeeded;
+}
+
+int SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue)
+{
+ int succeeded;
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+ SDL_Surface *screen = SDL_PublicSurface;
+
+ /* Verify the screen parameter */
+ if ( !screen ) {
+ SDL_SetError("No video mode has been set");
+ return -1;
+ }
+
+ /* Lazily allocate the gamma tables */
+ if ( ! video->gamma ) {
+ SDL_GetGammaRamp(0, 0, 0);
+ }
+
+ /* Fill the gamma table with the new values */
+ if ( red ) {
+ SDL_memcpy(&video->gamma[0*256], red, 256*sizeof(*video->gamma));
+ }
+ if ( green ) {
+ SDL_memcpy(&video->gamma[1*256], green, 256*sizeof(*video->gamma));
+ }
+ if ( blue ) {
+ SDL_memcpy(&video->gamma[2*256], blue, 256*sizeof(*video->gamma));
+ }
+
+ /* Gamma correction always possible on split palettes */
+ if ( (screen->flags & SDL_HWPALETTE) == SDL_HWPALETTE ) {
+ SDL_Palette *pal = screen->format->palette;
+
+ /* If physical palette has been set independently, use it */
+ if(video->physpal)
+ pal = video->physpal;
+
+ SDL_SetPalette(screen, SDL_PHYSPAL,
+ pal->colors, 0, pal->ncolors);
+ return 0;
+ }
+
+ /* Try to set the gamma ramp in the driver */
+ succeeded = -1;
+ if ( video->SetGammaRamp ) {
+ succeeded = video->SetGammaRamp(this, video->gamma);
+ } else {
+ SDL_SetError("Gamma ramp manipulation not supported");
+ }
+ return succeeded;
+}
+
+int SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue)
+{
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+
+ /* Lazily allocate the gamma table */
+ if ( ! video->gamma ) {
+ video->gamma = SDL_malloc(3*256*sizeof(*video->gamma));
+ if ( ! video->gamma ) {
+ SDL_OutOfMemory();
+ return -1;
+ }
+ if ( video->GetGammaRamp ) {
+ /* Get the real hardware gamma */
+ video->GetGammaRamp(this, video->gamma);
+ } else {
+ /* Assume an identity gamma */
+ int i;
+ for ( i=0; i<256; ++i ) {
+ video->gamma[0*256+i] = (i << 8) | i;
+ video->gamma[1*256+i] = (i << 8) | i;
+ video->gamma[2*256+i] = (i << 8) | i;
+ }
+ }
+ }
+
+ /* Just copy from our internal table */
+ if ( red ) {
+ SDL_memcpy(red, &video->gamma[0*256], 256*sizeof(*red));
+ }
+ if ( green ) {
+ SDL_memcpy(green, &video->gamma[1*256], 256*sizeof(*green));
+ }
+ if ( blue ) {
+ SDL_memcpy(blue, &video->gamma[2*256], 256*sizeof(*blue));
+ }
+ return 0;
+}
diff --git a/distrib/sdl-1.2.12/src/video/SDL_glfuncs.h b/distrib/sdl-1.2.15/src/video/SDL_glfuncs.h
index fb2d964..fb2d964 100644
--- a/distrib/sdl-1.2.12/src/video/SDL_glfuncs.h
+++ b/distrib/sdl-1.2.15/src/video/SDL_glfuncs.h
diff --git a/distrib/sdl-1.2.15/src/video/SDL_leaks.h b/distrib/sdl-1.2.15/src/video/SDL_leaks.h
new file mode 100644
index 0000000..74495c6
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_leaks.h
@@ -0,0 +1,31 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Define this if you want surface leak detection code enabled */
+/*#define CHECK_LEAKS*/
+
+/* Global variables used to check leaks in code using SDL */
+
+#ifdef CHECK_LEAKS
+extern int surfaces_allocated;
+#endif
diff --git a/distrib/sdl-1.2.15/src/video/SDL_pixels.c b/distrib/sdl-1.2.15/src/video/SDL_pixels.c
new file mode 100644
index 0000000..1a7fd51
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_pixels.c
@@ -0,0 +1,626 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* General (mostly internal) pixel/color manipulation routines for SDL */
+
+#include "SDL_endian.h"
+#include "SDL_video.h"
+#include "SDL_sysvideo.h"
+#include "SDL_blit.h"
+#include "SDL_pixels_c.h"
+#include "SDL_RLEaccel_c.h"
+
+/* Helper functions */
+/*
+ * Allocate a pixel format structure and fill it according to the given info.
+ */
+SDL_PixelFormat *SDL_AllocFormat(int bpp,
+ Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
+{
+ SDL_PixelFormat *format;
+ Uint32 mask;
+
+ /* Allocate an empty pixel format structure */
+ format = SDL_malloc(sizeof(*format));
+ if ( format == NULL ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ SDL_memset(format, 0, sizeof(*format));
+ format->alpha = SDL_ALPHA_OPAQUE;
+
+ /* Set up the format */
+ format->BitsPerPixel = bpp;
+ format->BytesPerPixel = (bpp+7)/8;
+ if ( Rmask || Bmask || Gmask ) { /* Packed pixels with custom mask */
+ format->palette = NULL;
+ format->Rshift = 0;
+ format->Rloss = 8;
+ if ( Rmask ) {
+ for ( mask = Rmask; !(mask&0x01); mask >>= 1 )
+ ++format->Rshift;
+ for ( ; (mask&0x01); mask >>= 1 )
+ --format->Rloss;
+ }
+ format->Gshift = 0;
+ format->Gloss = 8;
+ if ( Gmask ) {
+ for ( mask = Gmask; !(mask&0x01); mask >>= 1 )
+ ++format->Gshift;
+ for ( ; (mask&0x01); mask >>= 1 )
+ --format->Gloss;
+ }
+ format->Bshift = 0;
+ format->Bloss = 8;
+ if ( Bmask ) {
+ for ( mask = Bmask; !(mask&0x01); mask >>= 1 )
+ ++format->Bshift;
+ for ( ; (mask&0x01); mask >>= 1 )
+ --format->Bloss;
+ }
+ format->Ashift = 0;
+ format->Aloss = 8;
+ if ( Amask ) {
+ for ( mask = Amask; !(mask&0x01); mask >>= 1 )
+ ++format->Ashift;
+ for ( ; (mask&0x01); mask >>= 1 )
+ --format->Aloss;
+ }
+ format->Rmask = Rmask;
+ format->Gmask = Gmask;
+ format->Bmask = Bmask;
+ format->Amask = Amask;
+ } else if ( bpp > 8 ) { /* Packed pixels with standard mask */
+ /* R-G-B */
+ if ( bpp > 24 )
+ bpp = 24;
+ format->Rloss = 8-(bpp/3);
+ format->Gloss = 8-(bpp/3)-(bpp%3);
+ format->Bloss = 8-(bpp/3);
+ format->Rshift = ((bpp/3)+(bpp%3))+(bpp/3);
+ format->Gshift = (bpp/3);
+ format->Bshift = 0;
+ format->Rmask = ((0xFF>>format->Rloss)<<format->Rshift);
+ format->Gmask = ((0xFF>>format->Gloss)<<format->Gshift);
+ format->Bmask = ((0xFF>>format->Bloss)<<format->Bshift);
+ } else {
+ /* Palettized formats have no mask info */
+ format->Rloss = 8;
+ format->Gloss = 8;
+ format->Bloss = 8;
+ format->Aloss = 8;
+ format->Rshift = 0;
+ format->Gshift = 0;
+ format->Bshift = 0;
+ format->Ashift = 0;
+ format->Rmask = 0;
+ format->Gmask = 0;
+ format->Bmask = 0;
+ format->Amask = 0;
+ }
+ if ( bpp <= 8 ) { /* Palettized mode */
+ int ncolors = 1<<bpp;
+#ifdef DEBUG_PALETTE
+ fprintf(stderr,"bpp=%d ncolors=%d\n",bpp,ncolors);
+#endif
+ format->palette = (SDL_Palette *)SDL_malloc(sizeof(SDL_Palette));
+ if ( format->palette == NULL ) {
+ SDL_FreeFormat(format);
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ (format->palette)->ncolors = ncolors;
+ (format->palette)->colors = (SDL_Color *)SDL_malloc(
+ (format->palette)->ncolors*sizeof(SDL_Color));
+ if ( (format->palette)->colors == NULL ) {
+ SDL_FreeFormat(format);
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ if ( Rmask || Bmask || Gmask ) {
+ /* create palette according to masks */
+ int i;
+ int Rm=0,Gm=0,Bm=0;
+ int Rw=0,Gw=0,Bw=0;
+#ifdef ENABLE_PALETTE_ALPHA
+ int Am=0,Aw=0;
+#endif
+ if(Rmask)
+ {
+ Rw=8-format->Rloss;
+ for(i=format->Rloss;i>0;i-=Rw)
+ Rm|=1<<i;
+ }
+#ifdef DEBUG_PALETTE
+ fprintf(stderr,"Rw=%d Rm=0x%02X\n",Rw,Rm);
+#endif
+ if(Gmask)
+ {
+ Gw=8-format->Gloss;
+ for(i=format->Gloss;i>0;i-=Gw)
+ Gm|=1<<i;
+ }
+#ifdef DEBUG_PALETTE
+ fprintf(stderr,"Gw=%d Gm=0x%02X\n",Gw,Gm);
+#endif
+ if(Bmask)
+ {
+ Bw=8-format->Bloss;
+ for(i=format->Bloss;i>0;i-=Bw)
+ Bm|=1<<i;
+ }
+#ifdef DEBUG_PALETTE
+ fprintf(stderr,"Bw=%d Bm=0x%02X\n",Bw,Bm);
+#endif
+#ifdef ENABLE_PALETTE_ALPHA
+ if(Amask)
+ {
+ Aw=8-format->Aloss;
+ for(i=format->Aloss;i>0;i-=Aw)
+ Am|=1<<i;
+ }
+# ifdef DEBUG_PALETTE
+ fprintf(stderr,"Aw=%d Am=0x%02X\n",Aw,Am);
+# endif
+#endif
+ for(i=0; i < ncolors; ++i) {
+ int r,g,b;
+ r=(i&Rmask)>>format->Rshift;
+ r=(r<<format->Rloss)|((r*Rm)>>Rw);
+ format->palette->colors[i].r=r;
+
+ g=(i&Gmask)>>format->Gshift;
+ g=(g<<format->Gloss)|((g*Gm)>>Gw);
+ format->palette->colors[i].g=g;
+
+ b=(i&Bmask)>>format->Bshift;
+ b=(b<<format->Bloss)|((b*Bm)>>Bw);
+ format->palette->colors[i].b=b;
+
+#ifdef ENABLE_PALETTE_ALPHA
+ a=(i&Amask)>>format->Ashift;
+ a=(a<<format->Aloss)|((a*Am)>>Aw);
+ format->palette->colors[i].unused=a;
+#else
+ format->palette->colors[i].unused=0;
+#endif
+ }
+ } else if ( ncolors == 2 ) {
+ /* Create a black and white bitmap palette */
+ format->palette->colors[0].r = 0xFF;
+ format->palette->colors[0].g = 0xFF;
+ format->palette->colors[0].b = 0xFF;
+ format->palette->colors[1].r = 0x00;
+ format->palette->colors[1].g = 0x00;
+ format->palette->colors[1].b = 0x00;
+ } else {
+ /* Create an empty palette */
+ SDL_memset((format->palette)->colors, 0,
+ (format->palette)->ncolors*sizeof(SDL_Color));
+ }
+ }
+ return(format);
+}
+SDL_PixelFormat *SDL_ReallocFormat(SDL_Surface *surface, int bpp,
+ Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
+{
+ if ( surface->format ) {
+ SDL_FreeFormat(surface->format);
+ SDL_FormatChanged(surface);
+ }
+ surface->format = SDL_AllocFormat(bpp, Rmask, Gmask, Bmask, Amask);
+ return surface->format;
+}
+
+/*
+ * Change any previous mappings from/to the new surface format
+ */
+void SDL_FormatChanged(SDL_Surface *surface)
+{
+ static int format_version = 0;
+ ++format_version;
+ if ( format_version < 0 ) { /* It wrapped... */
+ format_version = 1;
+ }
+ surface->format_version = format_version;
+ SDL_InvalidateMap(surface->map);
+}
+/*
+ * Free a previously allocated format structure
+ */
+void SDL_FreeFormat(SDL_PixelFormat *format)
+{
+ if ( format ) {
+ if ( format->palette ) {
+ if ( format->palette->colors ) {
+ SDL_free(format->palette->colors);
+ }
+ SDL_free(format->palette);
+ }
+ SDL_free(format);
+ }
+}
+/*
+ * Calculate an 8-bit (3 red, 3 green, 2 blue) dithered palette of colors
+ */
+void SDL_DitherColors(SDL_Color *colors, int bpp)
+{
+ int i;
+ if(bpp != 8)
+ return; /* only 8bpp supported right now */
+
+ for(i = 0; i < 256; i++) {
+ int r, g, b;
+ /* map each bit field to the full [0, 255] interval,
+ so 0 is mapped to (0, 0, 0) and 255 to (255, 255, 255) */
+ r = i & 0xe0;
+ r |= r >> 3 | r >> 6;
+ colors[i].r = r;
+ g = (i << 3) & 0xe0;
+ g |= g >> 3 | g >> 6;
+ colors[i].g = g;
+ b = i & 0x3;
+ b |= b << 2;
+ b |= b << 4;
+ colors[i].b = b;
+ }
+}
+/*
+ * Calculate the pad-aligned scanline width of a surface
+ */
+Uint16 SDL_CalculatePitch(SDL_Surface *surface)
+{
+ Uint16 pitch;
+
+ /* Surface should be 4-byte aligned for speed */
+ pitch = surface->w*surface->format->BytesPerPixel;
+ switch (surface->format->BitsPerPixel) {
+ case 1:
+ pitch = (pitch+7)/8;
+ break;
+ case 4:
+ pitch = (pitch+1)/2;
+ break;
+ default:
+ break;
+ }
+ pitch = (pitch + 3) & ~3; /* 4-byte aligning */
+ return(pitch);
+}
+/*
+ * Match an RGB value to a particular palette index
+ */
+Uint8 SDL_FindColor(SDL_Palette *pal, Uint8 r, Uint8 g, Uint8 b)
+{
+ /* Do colorspace distance matching */
+ unsigned int smallest;
+ unsigned int distance;
+ int rd, gd, bd;
+ int i;
+ Uint8 pixel=0;
+
+ smallest = ~0;
+ for ( i=0; i<pal->ncolors; ++i ) {
+ rd = pal->colors[i].r - r;
+ gd = pal->colors[i].g - g;
+ bd = pal->colors[i].b - b;
+ distance = (rd*rd)+(gd*gd)+(bd*bd);
+ if ( distance < smallest ) {
+ pixel = i;
+ if ( distance == 0 ) { /* Perfect match! */
+ break;
+ }
+ smallest = distance;
+ }
+ }
+ return(pixel);
+}
+
+/* Find the opaque pixel value corresponding to an RGB triple */
+Uint32 SDL_MapRGB
+(const SDL_PixelFormat * const format,
+ const Uint8 r, const Uint8 g, const Uint8 b)
+{
+ if ( format->palette == NULL ) {
+ return (r >> format->Rloss) << format->Rshift
+ | (g >> format->Gloss) << format->Gshift
+ | (b >> format->Bloss) << format->Bshift
+ | format->Amask;
+ } else {
+ return SDL_FindColor(format->palette, r, g, b);
+ }
+}
+
+/* Find the pixel value corresponding to an RGBA quadruple */
+Uint32 SDL_MapRGBA
+(const SDL_PixelFormat * const format,
+ const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a)
+{
+ if ( format->palette == NULL ) {
+ return (r >> format->Rloss) << format->Rshift
+ | (g >> format->Gloss) << format->Gshift
+ | (b >> format->Bloss) << format->Bshift
+ | ((a >> format->Aloss) << format->Ashift & format->Amask);
+ } else {
+ return SDL_FindColor(format->palette, r, g, b);
+ }
+}
+
+void SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat * const fmt,
+ Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a)
+{
+ if ( fmt->palette == NULL ) {
+ /*
+ * This makes sure that the result is mapped to the
+ * interval [0..255], and the maximum value for each
+ * component is 255. This is important to make sure
+ * that white is indeed reported as (255, 255, 255),
+ * and that opaque alpha is 255.
+ * This only works for RGB bit fields at least 4 bit
+ * wide, which is almost always the case.
+ */
+ unsigned v;
+ v = (pixel & fmt->Rmask) >> fmt->Rshift;
+ *r = (v << fmt->Rloss) + (v >> (8 - (fmt->Rloss << 1)));
+ v = (pixel & fmt->Gmask) >> fmt->Gshift;
+ *g = (v << fmt->Gloss) + (v >> (8 - (fmt->Gloss << 1)));
+ v = (pixel & fmt->Bmask) >> fmt->Bshift;
+ *b = (v << fmt->Bloss) + (v >> (8 - (fmt->Bloss << 1)));
+ if(fmt->Amask) {
+ v = (pixel & fmt->Amask) >> fmt->Ashift;
+ *a = (v << fmt->Aloss) + (v >> (8 - (fmt->Aloss << 1)));
+ } else {
+ *a = SDL_ALPHA_OPAQUE;
+ }
+ } else {
+ *r = fmt->palette->colors[pixel].r;
+ *g = fmt->palette->colors[pixel].g;
+ *b = fmt->palette->colors[pixel].b;
+ *a = SDL_ALPHA_OPAQUE;
+ }
+}
+
+void SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat * const fmt,
+ Uint8 *r,Uint8 *g,Uint8 *b)
+{
+ if ( fmt->palette == NULL ) {
+ /* the note for SDL_GetRGBA above applies here too */
+ unsigned v;
+ v = (pixel & fmt->Rmask) >> fmt->Rshift;
+ *r = (v << fmt->Rloss) + (v >> (8 - (fmt->Rloss << 1)));
+ v = (pixel & fmt->Gmask) >> fmt->Gshift;
+ *g = (v << fmt->Gloss) + (v >> (8 - (fmt->Gloss << 1)));
+ v = (pixel & fmt->Bmask) >> fmt->Bshift;
+ *b = (v << fmt->Bloss) + (v >> (8 - (fmt->Bloss << 1)));
+ } else {
+ *r = fmt->palette->colors[pixel].r;
+ *g = fmt->palette->colors[pixel].g;
+ *b = fmt->palette->colors[pixel].b;
+ }
+}
+
+/* Apply gamma to a set of colors - this is easy. :) */
+void SDL_ApplyGamma(Uint16 *gamma, SDL_Color *colors, SDL_Color *output,
+ int ncolors)
+{
+ int i;
+
+ for ( i=0; i<ncolors; ++i ) {
+ output[i].r = gamma[0*256 + colors[i].r] >> 8;
+ output[i].g = gamma[1*256 + colors[i].g] >> 8;
+ output[i].b = gamma[2*256 + colors[i].b] >> 8;
+ }
+}
+
+/* Map from Palette to Palette */
+static Uint8 *Map1to1(SDL_Palette *src, SDL_Palette *dst, int *identical)
+{
+ Uint8 *map;
+ int i;
+
+ if ( identical ) {
+ if ( src->ncolors <= dst->ncolors ) {
+ /* If an identical palette, no need to map */
+ if ( SDL_memcmp(src->colors, dst->colors, src->ncolors*
+ sizeof(SDL_Color)) == 0 ) {
+ *identical = 1;
+ return(NULL);
+ }
+ }
+ *identical = 0;
+ }
+ map = (Uint8 *)SDL_malloc(src->ncolors);
+ if ( map == NULL ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ for ( i=0; i<src->ncolors; ++i ) {
+ map[i] = SDL_FindColor(dst,
+ src->colors[i].r, src->colors[i].g, src->colors[i].b);
+ }
+ return(map);
+}
+/* Map from Palette to BitField */
+static Uint8 *Map1toN(SDL_PixelFormat *src, SDL_PixelFormat *dst)
+{
+ Uint8 *map;
+ int i;
+ int bpp;
+ unsigned alpha;
+ SDL_Palette *pal = src->palette;
+
+ bpp = ((dst->BytesPerPixel == 3) ? 4 : dst->BytesPerPixel);
+ map = (Uint8 *)SDL_malloc(pal->ncolors*bpp);
+ if ( map == NULL ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+
+ alpha = dst->Amask ? src->alpha : 0;
+ /* We memory copy to the pixel map so the endianness is preserved */
+ for ( i=0; i<pal->ncolors; ++i ) {
+ ASSEMBLE_RGBA(&map[i*bpp], dst->BytesPerPixel, dst,
+ pal->colors[i].r, pal->colors[i].g,
+ pal->colors[i].b, alpha);
+ }
+ return(map);
+}
+/* Map from BitField to Dithered-Palette to Palette */
+static Uint8 *MapNto1(SDL_PixelFormat *src, SDL_PixelFormat *dst, int *identical)
+{
+ /* Generate a 256 color dither palette */
+ SDL_Palette dithered;
+ SDL_Color colors[256];
+ SDL_Palette *pal = dst->palette;
+
+ /* SDL_DitherColors does not initialize the 'unused' component of colors,
+ but Map1to1 compares it against pal, so we should initialize it. */
+ SDL_memset(colors, 0, sizeof(colors));
+
+ dithered.ncolors = 256;
+ SDL_DitherColors(colors, 8);
+ dithered.colors = colors;
+ return(Map1to1(&dithered, pal, identical));
+}
+
+SDL_BlitMap *SDL_AllocBlitMap(void)
+{
+ SDL_BlitMap *map;
+
+ /* Allocate the empty map */
+ map = (SDL_BlitMap *)SDL_malloc(sizeof(*map));
+ if ( map == NULL ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ SDL_memset(map, 0, sizeof(*map));
+
+ /* Allocate the software blit data */
+ map->sw_data = (struct private_swaccel *)SDL_malloc(sizeof(*map->sw_data));
+ if ( map->sw_data == NULL ) {
+ SDL_FreeBlitMap(map);
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ SDL_memset(map->sw_data, 0, sizeof(*map->sw_data));
+
+ /* It's ready to go */
+ return(map);
+}
+void SDL_InvalidateMap(SDL_BlitMap *map)
+{
+ if ( ! map ) {
+ return;
+ }
+ map->dst = NULL;
+ map->format_version = (unsigned int)-1;
+ if ( map->table ) {
+ SDL_free(map->table);
+ map->table = NULL;
+ }
+}
+int SDL_MapSurface (SDL_Surface *src, SDL_Surface *dst)
+{
+ SDL_PixelFormat *srcfmt;
+ SDL_PixelFormat *dstfmt;
+ SDL_BlitMap *map;
+
+ /* Clear out any previous mapping */
+ map = src->map;
+ if ( (src->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) {
+ SDL_UnRLESurface(src, 1);
+ }
+ SDL_InvalidateMap(map);
+
+ /* Figure out what kind of mapping we're doing */
+ map->identity = 0;
+ srcfmt = src->format;
+ dstfmt = dst->format;
+ switch (srcfmt->BytesPerPixel) {
+ case 1:
+ switch (dstfmt->BytesPerPixel) {
+ case 1:
+ /* Palette --> Palette */
+ /* If both SDL_HWSURFACE, assume have same palette */
+ if ( ((src->flags & SDL_HWSURFACE) == SDL_HWSURFACE) &&
+ ((dst->flags & SDL_HWSURFACE) == SDL_HWSURFACE) ) {
+ map->identity = 1;
+ } else {
+ map->table = Map1to1(srcfmt->palette,
+ dstfmt->palette, &map->identity);
+ }
+ if ( ! map->identity ) {
+ if ( map->table == NULL ) {
+ return(-1);
+ }
+ }
+ if (srcfmt->BitsPerPixel!=dstfmt->BitsPerPixel)
+ map->identity = 0;
+ break;
+
+ default:
+ /* Palette --> BitField */
+ map->table = Map1toN(srcfmt, dstfmt);
+ if ( map->table == NULL ) {
+ return(-1);
+ }
+ break;
+ }
+ break;
+ default:
+ switch (dstfmt->BytesPerPixel) {
+ case 1:
+ /* BitField --> Palette */
+ map->table = MapNto1(srcfmt, dstfmt, &map->identity);
+ if ( ! map->identity ) {
+ if ( map->table == NULL ) {
+ return(-1);
+ }
+ }
+ map->identity = 0; /* Don't optimize to copy */
+ break;
+ default:
+ /* BitField --> BitField */
+ if ( FORMAT_EQUAL(srcfmt, dstfmt) )
+ map->identity = 1;
+ break;
+ }
+ break;
+ }
+
+ map->dst = dst;
+ map->format_version = dst->format_version;
+
+ /* Choose your blitters wisely */
+ return(SDL_CalculateBlit(src));
+}
+void SDL_FreeBlitMap(SDL_BlitMap *map)
+{
+ if ( map ) {
+ SDL_InvalidateMap(map);
+ if ( map->sw_data != NULL ) {
+ SDL_free(map->sw_data);
+ }
+ SDL_free(map);
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/SDL_pixels_c.h b/distrib/sdl-1.2.15/src/video/SDL_pixels_c.h
new file mode 100644
index 0000000..76759e2
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_pixels_c.h
@@ -0,0 +1,46 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Useful functions and variables from SDL_pixel.c */
+
+#include "SDL_blit.h"
+
+/* Pixel format functions */
+extern SDL_PixelFormat *SDL_AllocFormat(int bpp,
+ Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
+extern SDL_PixelFormat *SDL_ReallocFormat(SDL_Surface *surface, int bpp,
+ Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
+extern void SDL_FormatChanged(SDL_Surface *surface);
+extern void SDL_FreeFormat(SDL_PixelFormat *format);
+
+/* Blit mapping functions */
+extern SDL_BlitMap *SDL_AllocBlitMap(void);
+extern void SDL_InvalidateMap(SDL_BlitMap *map);
+extern int SDL_MapSurface (SDL_Surface *src, SDL_Surface *dst);
+extern void SDL_FreeBlitMap(SDL_BlitMap *map);
+
+/* Miscellaneous functions */
+extern Uint16 SDL_CalculatePitch(SDL_Surface *surface);
+extern void SDL_DitherColors(SDL_Color *colors, int bpp);
+extern Uint8 SDL_FindColor(SDL_Palette *pal, Uint8 r, Uint8 g, Uint8 b);
+extern void SDL_ApplyGamma(Uint16 *gamma, SDL_Color *colors, SDL_Color *output, int ncolors);
diff --git a/distrib/sdl-1.2.15/src/video/SDL_stretch.c b/distrib/sdl-1.2.15/src/video/SDL_stretch.c
new file mode 100644
index 0000000..7ce401f
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_stretch.c
@@ -0,0 +1,358 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This a stretch blit implementation based on ideas given to me by
+ Tomasz Cejner - thanks! :)
+
+ April 27, 2000 - Sam Lantinga
+*/
+
+#include "SDL_video.h"
+#include "SDL_blit.h"
+
+/* This isn't ready for general consumption yet - it should be folded
+ into the general blitting mechanism.
+*/
+
+#if ((defined(_MFC_VER) && defined(_M_IX86)/* && !defined(_WIN32_WCE) still needed? */) || \
+ defined(__WATCOMC__) || \
+ (defined(__GNUC__) && defined(__i386__))) && SDL_ASSEMBLY_ROUTINES
+/* There's a bug with gcc 4.4.1 and -O2 where srcp doesn't get the correct
+ * value after the first scanline. FIXME? */
+/*#define USE_ASM_STRETCH*/
+#endif
+
+#ifdef USE_ASM_STRETCH
+
+#ifdef HAVE_MPROTECT
+#include <sys/types.h>
+#include <sys/mman.h>
+#endif
+#ifdef __GNUC__
+#define PAGE_ALIGNED __attribute__((__aligned__(4096)))
+#else
+#define PAGE_ALIGNED
+#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
+#else
+#error Need assembly opcodes for this architecture
+#endif
+
+static unsigned char copy_row[4096] PAGE_ALIGNED;
+
+static int generate_rowbytes(int src_w, int dst_w, int bpp)
+{
+ static struct {
+ int bpp;
+ int src_w;
+ int dst_w;
+ int status;
+ } last;
+
+ int i;
+ int pos, inc;
+ unsigned char *eip, *fence;
+ unsigned char load, store;
+
+ /* See if we need to regenerate the copy buffer */
+ if ( (src_w == last.src_w) &&
+ (dst_w == last.dst_w) && (bpp == last.bpp) ) {
+ return(last.status);
+ }
+ last.bpp = bpp;
+ last.src_w = src_w;
+ last.dst_w = dst_w;
+ last.status = -1;
+
+ switch (bpp) {
+ case 1:
+ load = LOAD_BYTE;
+ store = STORE_BYTE;
+ break;
+ case 2:
+ case 4:
+ load = LOAD_WORD;
+ store = STORE_WORD;
+ break;
+ default:
+ SDL_SetError("ASM stretch of %d bytes isn't supported\n", bpp);
+ return(-1);
+ }
+#ifdef HAVE_MPROTECT
+ /* Make the code writeable */
+ if ( mprotect(copy_row, sizeof(copy_row), PROT_READ|PROT_WRITE) < 0 ) {
+ SDL_SetError("Couldn't make copy buffer writeable");
+ return(-1);
+ }
+#endif
+ pos = 0x10000;
+ inc = (src_w << 16) / dst_w;
+ eip = copy_row;
+ fence = copy_row+sizeof(copy_row)-2;
+ for ( i=0; i<dst_w && eip < end; ++i ) {
+ while ( pos >= 0x10000L ) {
+ if ( eip == fence ) {
+ return -1;
+ }
+ if ( bpp == 2 ) {
+ *eip++ = PREFIX16;
+ }
+ *eip++ = load;
+ pos -= 0x10000L;
+ }
+ if ( eip == fence ) {
+ return -1;
+ }
+ if ( bpp == 2 ) {
+ *eip++ = PREFIX16;
+ }
+ *eip++ = store;
+ pos += inc;
+ }
+ *eip++ = RETURN;
+
+#ifdef HAVE_MPROTECT
+ /* Make the code executable but not writeable */
+ if ( mprotect(copy_row, sizeof(copy_row), PROT_READ|PROT_EXEC) < 0 ) {
+ SDL_SetError("Couldn't make copy buffer executable");
+ return(-1);
+ }
+#endif
+ last.status = 0;
+ return(0);
+}
+
+#endif /* USE_ASM_STRETCH */
+
+#define DEFINE_COPY_ROW(name, type) \
+void name(type *src, int src_w, type *dst, int dst_w) \
+{ \
+ int i; \
+ int pos, inc; \
+ type pixel = 0; \
+ \
+ pos = 0x10000; \
+ inc = (src_w << 16) / dst_w; \
+ for ( i=dst_w; i>0; --i ) { \
+ while ( pos >= 0x10000L ) { \
+ pixel = *src++; \
+ pos -= 0x10000L; \
+ } \
+ *dst++ = pixel; \
+ pos += inc; \
+ } \
+}
+DEFINE_COPY_ROW(copy_row1, Uint8)
+DEFINE_COPY_ROW(copy_row2, Uint16)
+DEFINE_COPY_ROW(copy_row4, Uint32)
+
+/* The ASM code doesn't handle 24-bpp stretch blits */
+void copy_row3(Uint8 *src, int src_w, Uint8 *dst, int dst_w)
+{
+ int i;
+ int pos, inc;
+ Uint8 pixel[3] = { 0, 0, 0 };
+
+ pos = 0x10000;
+ inc = (src_w << 16) / dst_w;
+ for ( i=dst_w; i>0; --i ) {
+ while ( pos >= 0x10000L ) {
+ pixel[0] = *src++;
+ pixel[1] = *src++;
+ pixel[2] = *src++;
+ pos -= 0x10000L;
+ }
+ *dst++ = pixel[0];
+ *dst++ = pixel[1];
+ *dst++ = pixel[2];
+ pos += inc;
+ }
+}
+
+/* Perform a stretch blit between two surfaces of the same format.
+ NOTE: This function is not safe to call from multiple threads!
+*/
+int SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect)
+{
+ int src_locked;
+ int dst_locked;
+ int pos, inc;
+ int dst_maxrow;
+ int src_row, dst_row;
+ Uint8 *srcp = NULL;
+ Uint8 *dstp;
+ SDL_Rect full_src;
+ SDL_Rect full_dst;
+#ifdef USE_ASM_STRETCH
+ SDL_bool use_asm = SDL_TRUE;
+#ifdef __GNUC__
+ int u1, u2;
+#endif
+#endif /* USE_ASM_STRETCH */
+ const int bpp = dst->format->BytesPerPixel;
+
+ if ( src->format->BitsPerPixel != dst->format->BitsPerPixel ) {
+ SDL_SetError("Only works with same format surfaces");
+ return(-1);
+ }
+
+ /* Verify the blit rectangles */
+ if ( srcrect ) {
+ if ( (srcrect->x < 0) || (srcrect->y < 0) ||
+ ((srcrect->x+srcrect->w) > src->w) ||
+ ((srcrect->y+srcrect->h) > src->h) ) {
+ SDL_SetError("Invalid source blit rectangle");
+ return(-1);
+ }
+ } else {
+ full_src.x = 0;
+ full_src.y = 0;
+ full_src.w = src->w;
+ full_src.h = src->h;
+ srcrect = &full_src;
+ }
+ if ( dstrect ) {
+ if ( (dstrect->x < 0) || (dstrect->y < 0) ||
+ ((dstrect->x+dstrect->w) > dst->w) ||
+ ((dstrect->y+dstrect->h) > dst->h) ) {
+ SDL_SetError("Invalid destination blit rectangle");
+ return(-1);
+ }
+ } else {
+ full_dst.x = 0;
+ full_dst.y = 0;
+ full_dst.w = dst->w;
+ full_dst.h = dst->h;
+ dstrect = &full_dst;
+ }
+
+ /* Lock the destination if it's in hardware */
+ dst_locked = 0;
+ if ( SDL_MUSTLOCK(dst) ) {
+ if ( SDL_LockSurface(dst) < 0 ) {
+ SDL_SetError("Unable to lock destination surface");
+ return(-1);
+ }
+ dst_locked = 1;
+ }
+ /* Lock the source if it's in hardware */
+ src_locked = 0;
+ if ( SDL_MUSTLOCK(src) ) {
+ if ( SDL_LockSurface(src) < 0 ) {
+ if ( dst_locked ) {
+ SDL_UnlockSurface(dst);
+ }
+ SDL_SetError("Unable to lock source surface");
+ return(-1);
+ }
+ src_locked = 1;
+ }
+
+ /* Set up the data... */
+ pos = 0x10000;
+ inc = (srcrect->h << 16) / dstrect->h;
+ src_row = srcrect->y;
+ dst_row = dstrect->y;
+
+#ifdef USE_ASM_STRETCH
+ /* Write the opcodes for this stretch */
+ if ( (bpp == 3) ||
+ (generate_rowbytes(srcrect->w, dstrect->w, bpp) < 0) ) {
+ use_asm = SDL_FALSE;
+ }
+#endif
+
+ /* Perform the stretch blit */
+ for ( dst_maxrow = dst_row+dstrect->h; dst_row<dst_maxrow; ++dst_row ) {
+ dstp = (Uint8 *)dst->pixels + (dst_row*dst->pitch)
+ + (dstrect->x*bpp);
+ while ( pos >= 0x10000L ) {
+ srcp = (Uint8 *)src->pixels + (src_row*src->pitch)
+ + (srcrect->x*bpp);
+ ++src_row;
+ pos -= 0x10000L;
+ }
+#ifdef USE_ASM_STRETCH
+ if (use_asm) {
+#ifdef __GNUC__
+ __asm__ __volatile__ (
+ "call *%4"
+ : "=&D" (u1), "=&S" (u2)
+ : "0" (dstp), "1" (srcp), "r" (copy_row)
+ : "memory" );
+#elif defined(_MSC_VER) || defined(__WATCOMC__)
+ { void *code = copy_row;
+ __asm {
+ push edi
+ push esi
+
+ mov edi, dstp
+ mov esi, srcp
+ call dword ptr code
+
+ pop esi
+ pop edi
+ }
+ }
+#else
+#error Need inline assembly for this compiler
+#endif
+ } else
+#endif
+ switch (bpp) {
+ case 1:
+ copy_row1(srcp, srcrect->w, dstp, dstrect->w);
+ break;
+ case 2:
+ copy_row2((Uint16 *)srcp, srcrect->w,
+ (Uint16 *)dstp, dstrect->w);
+ break;
+ case 3:
+ copy_row3(srcp, srcrect->w, dstp, dstrect->w);
+ break;
+ case 4:
+ copy_row4((Uint32 *)srcp, srcrect->w,
+ (Uint32 *)dstp, dstrect->w);
+ break;
+ }
+ pos += inc;
+ }
+
+ /* We need to unlock the surfaces if they're locked */
+ if ( dst_locked ) {
+ SDL_UnlockSurface(dst);
+ }
+ if ( src_locked ) {
+ SDL_UnlockSurface(src);
+ }
+ return(0);
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/SDL_stretch_c.h b/distrib/sdl-1.2.15/src/video/SDL_stretch_c.h
new file mode 100644
index 0000000..4cc6acb
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_stretch_c.h
@@ -0,0 +1,29 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Perform a stretch blit between two surfaces of the same format.
+ NOTE: This function is not safe to call from multiple threads!
+*/
+extern int SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect);
+
diff --git a/distrib/sdl-1.2.15/src/video/SDL_surface.c b/distrib/sdl-1.2.15/src/video/SDL_surface.c
new file mode 100644
index 0000000..0f3ad12
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_surface.c
@@ -0,0 +1,941 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_video.h"
+#include "SDL_sysvideo.h"
+#include "SDL_cursor_c.h"
+#include "SDL_blit.h"
+#include "SDL_RLEaccel_c.h"
+#include "SDL_pixels_c.h"
+#include "SDL_leaks.h"
+
+
+/* Public routines */
+/*
+ * Create an empty RGB surface of the appropriate depth
+ */
+SDL_Surface * SDL_CreateRGBSurface (Uint32 flags,
+ int width, int height, int depth,
+ Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
+{
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+ SDL_Surface *screen;
+ SDL_Surface *surface;
+
+ /* Make sure the size requested doesn't overflow our datatypes */
+ /* Next time I write a library like SDL, I'll use int for size. :) */
+ if ( width >= 16384 || height >= 65536 ) {
+ SDL_SetError("Width or height is too large");
+ return(NULL);
+ }
+
+ /* Check to see if we desire the surface in video memory */
+ if ( video ) {
+ screen = SDL_PublicSurface;
+ } else {
+ screen = NULL;
+ }
+ if ( screen && ((screen->flags&SDL_HWSURFACE) == SDL_HWSURFACE) ) {
+ if ( (flags&(SDL_SRCCOLORKEY|SDL_SRCALPHA)) != 0 ) {
+ flags |= SDL_HWSURFACE;
+ }
+ if ( (flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
+ if ( ! current_video->info.blit_hw_CC ) {
+ flags &= ~SDL_HWSURFACE;
+ }
+ }
+ if ( (flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
+ if ( ! current_video->info.blit_hw_A ) {
+ flags &= ~SDL_HWSURFACE;
+ }
+ }
+ } else {
+ flags &= ~SDL_HWSURFACE;
+ }
+
+ /* Allocate the surface */
+ surface = (SDL_Surface *)SDL_malloc(sizeof(*surface));
+ if ( surface == NULL ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ surface->flags = SDL_SWSURFACE;
+ if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
+ if ((Amask) && (video->displayformatalphapixel))
+ {
+ depth = video->displayformatalphapixel->BitsPerPixel;
+ Rmask = video->displayformatalphapixel->Rmask;
+ Gmask = video->displayformatalphapixel->Gmask;
+ Bmask = video->displayformatalphapixel->Bmask;
+ Amask = video->displayformatalphapixel->Amask;
+ }
+ else
+ {
+ depth = screen->format->BitsPerPixel;
+ Rmask = screen->format->Rmask;
+ Gmask = screen->format->Gmask;
+ Bmask = screen->format->Bmask;
+ Amask = screen->format->Amask;
+ }
+ }
+ surface->format = SDL_AllocFormat(depth, Rmask, Gmask, Bmask, Amask);
+ if ( surface->format == NULL ) {
+ SDL_free(surface);
+ return(NULL);
+ }
+ if ( Amask ) {
+ surface->flags |= SDL_SRCALPHA;
+ }
+ surface->w = width;
+ surface->h = height;
+ surface->pitch = SDL_CalculatePitch(surface);
+ surface->pixels = NULL;
+ surface->offset = 0;
+ surface->hwdata = NULL;
+ surface->locked = 0;
+ surface->map = NULL;
+ surface->unused1 = 0;
+ SDL_SetClipRect(surface, NULL);
+ SDL_FormatChanged(surface);
+
+ /* Get the pixels */
+ if ( ((flags&SDL_HWSURFACE) == SDL_SWSURFACE) ||
+ (video->AllocHWSurface(this, surface) < 0) ) {
+ if ( surface->w && surface->h ) {
+ surface->pixels = SDL_malloc(surface->h*surface->pitch);
+ if ( surface->pixels == NULL ) {
+ SDL_FreeSurface(surface);
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ /* This is important for bitmaps */
+ SDL_memset(surface->pixels, 0, surface->h*surface->pitch);
+ }
+ }
+
+ /* Allocate an empty mapping */
+ surface->map = SDL_AllocBlitMap();
+ if ( surface->map == NULL ) {
+ SDL_FreeSurface(surface);
+ return(NULL);
+ }
+
+ /* The surface is ready to go */
+ surface->refcount = 1;
+#ifdef CHECK_LEAKS
+ ++surfaces_allocated;
+#endif
+ return(surface);
+}
+/*
+ * Create an RGB surface from an existing memory buffer
+ */
+SDL_Surface * SDL_CreateRGBSurfaceFrom (void *pixels,
+ int width, int height, int depth, int pitch,
+ Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
+{
+ SDL_Surface *surface;
+
+ surface = SDL_CreateRGBSurface(SDL_SWSURFACE, 0, 0, depth,
+ Rmask, Gmask, Bmask, Amask);
+ if ( surface != NULL ) {
+ surface->flags |= SDL_PREALLOC;
+ surface->pixels = pixels;
+ surface->w = width;
+ surface->h = height;
+ surface->pitch = pitch;
+ SDL_SetClipRect(surface, NULL);
+ }
+ return(surface);
+}
+/*
+ * Set the color key in a blittable surface
+ */
+int SDL_SetColorKey (SDL_Surface *surface, Uint32 flag, Uint32 key)
+{
+ /* Sanity check the flag as it gets passed in */
+ if ( flag & SDL_SRCCOLORKEY ) {
+ if ( flag & (SDL_RLEACCEL|SDL_RLEACCELOK) ) {
+ flag = (SDL_SRCCOLORKEY | SDL_RLEACCELOK);
+ } else {
+ flag = SDL_SRCCOLORKEY;
+ }
+ } else {
+ flag = 0;
+ }
+
+ /* Optimize away operations that don't change anything */
+ if ( (flag == (surface->flags & (SDL_SRCCOLORKEY|SDL_RLEACCELOK))) &&
+ (key == surface->format->colorkey) ) {
+ return(0);
+ }
+
+ /* UnRLE surfaces before we change the colorkey */
+ if ( surface->flags & SDL_RLEACCEL ) {
+ SDL_UnRLESurface(surface, 1);
+ }
+
+ if ( flag ) {
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+
+
+ surface->flags |= SDL_SRCCOLORKEY;
+ surface->format->colorkey = key;
+ if ( (surface->flags & SDL_HWACCEL) == SDL_HWACCEL ) {
+ if ( (video->SetHWColorKey == NULL) ||
+ (video->SetHWColorKey(this, surface, key) < 0) ) {
+ surface->flags &= ~SDL_HWACCEL;
+ }
+ }
+ if ( flag & SDL_RLEACCELOK ) {
+ surface->flags |= SDL_RLEACCELOK;
+ } else {
+ surface->flags &= ~SDL_RLEACCELOK;
+ }
+ } else {
+ surface->flags &= ~(SDL_SRCCOLORKEY|SDL_RLEACCELOK);
+ surface->format->colorkey = 0;
+ }
+ SDL_InvalidateMap(surface->map);
+ return(0);
+}
+/* This function sets the alpha channel of a surface */
+int SDL_SetAlpha (SDL_Surface *surface, Uint32 flag, Uint8 value)
+{
+ Uint32 oldflags = surface->flags;
+ Uint32 oldalpha = surface->format->alpha;
+
+ /* Sanity check the flag as it gets passed in */
+ if ( flag & SDL_SRCALPHA ) {
+ if ( flag & (SDL_RLEACCEL|SDL_RLEACCELOK) ) {
+ flag = (SDL_SRCALPHA | SDL_RLEACCELOK);
+ } else {
+ flag = SDL_SRCALPHA;
+ }
+ } else {
+ flag = 0;
+ }
+
+ /* Optimize away operations that don't change anything */
+ if ( (flag == (surface->flags & (SDL_SRCALPHA|SDL_RLEACCELOK))) &&
+ (!flag || value == oldalpha) ) {
+ return(0);
+ }
+
+ if(!(flag & SDL_RLEACCELOK) && (surface->flags & SDL_RLEACCEL))
+ SDL_UnRLESurface(surface, 1);
+
+ if ( flag ) {
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+
+ surface->flags |= SDL_SRCALPHA;
+ surface->format->alpha = value;
+ if ( (surface->flags & SDL_HWACCEL) == SDL_HWACCEL ) {
+ if ( (video->SetHWAlpha == NULL) ||
+ (video->SetHWAlpha(this, surface, value) < 0) ) {
+ surface->flags &= ~SDL_HWACCEL;
+ }
+ }
+ if ( flag & SDL_RLEACCELOK ) {
+ surface->flags |= SDL_RLEACCELOK;
+ } else {
+ surface->flags &= ~SDL_RLEACCELOK;
+ }
+ } else {
+ surface->flags &= ~SDL_SRCALPHA;
+ surface->format->alpha = SDL_ALPHA_OPAQUE;
+ }
+ /*
+ * The representation for software surfaces is independent of
+ * per-surface alpha, so no need to invalidate the blit mapping
+ * if just the alpha value was changed. (If either is 255, we still
+ * need to invalidate.)
+ */
+ if((surface->flags & SDL_HWACCEL) == SDL_HWACCEL
+ || oldflags != surface->flags
+ || (((oldalpha + 1) ^ (value + 1)) & 0x100))
+ SDL_InvalidateMap(surface->map);
+ return(0);
+}
+int SDL_SetAlphaChannel(SDL_Surface *surface, Uint8 value)
+{
+ int row, col;
+ int offset;
+ Uint8 *buf;
+
+ if ( (surface->format->Amask != 0xFF000000) &&
+ (surface->format->Amask != 0x000000FF) ) {
+ SDL_SetError("Unsupported surface alpha mask format");
+ return -1;
+ }
+
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+ if ( surface->format->Amask == 0xFF000000 ) {
+ offset = 3;
+ } else {
+ offset = 0;
+ }
+#else
+ if ( surface->format->Amask == 0xFF000000 ) {
+ offset = 0;
+ } else {
+ offset = 3;
+ }
+#endif /* Byte ordering */
+
+ /* Quickly set the alpha channel of an RGBA or ARGB surface */
+ if ( SDL_MUSTLOCK(surface) ) {
+ if ( SDL_LockSurface(surface) < 0 ) {
+ return -1;
+ }
+ }
+ row = surface->h;
+ while (row--) {
+ col = surface->w;
+ buf = (Uint8 *)surface->pixels + row * surface->pitch + offset;
+ while(col--) {
+ *buf = value;
+ buf += 4;
+ }
+ }
+ if ( SDL_MUSTLOCK(surface) ) {
+ SDL_UnlockSurface(surface);
+ }
+ return 0;
+}
+
+/*
+ * A function to calculate the intersection of two rectangles:
+ * return true if the rectangles intersect, false otherwise
+ */
+static __inline__
+SDL_bool SDL_IntersectRect(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *intersection)
+{
+ int Amin, Amax, Bmin, Bmax;
+
+ /* Horizontal intersection */
+ Amin = A->x;
+ Amax = Amin + A->w;
+ Bmin = B->x;
+ Bmax = Bmin + B->w;
+ if(Bmin > Amin)
+ Amin = Bmin;
+ intersection->x = Amin;
+ if(Bmax < Amax)
+ Amax = Bmax;
+ intersection->w = Amax - Amin > 0 ? Amax - Amin : 0;
+
+ /* Vertical intersection */
+ Amin = A->y;
+ Amax = Amin + A->h;
+ Bmin = B->y;
+ Bmax = Bmin + B->h;
+ if(Bmin > Amin)
+ Amin = Bmin;
+ intersection->y = Amin;
+ if(Bmax < Amax)
+ Amax = Bmax;
+ intersection->h = Amax - Amin > 0 ? Amax - Amin : 0;
+
+ return (intersection->w && intersection->h);
+}
+/*
+ * Set the clipping rectangle for a blittable surface
+ */
+SDL_bool SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect)
+{
+ SDL_Rect full_rect;
+
+ /* Don't do anything if there's no surface to act on */
+ if ( ! surface ) {
+ return SDL_FALSE;
+ }
+
+ /* Set up the full surface rectangle */
+ full_rect.x = 0;
+ full_rect.y = 0;
+ full_rect.w = surface->w;
+ full_rect.h = surface->h;
+
+ /* Set the clipping rectangle */
+ if ( ! rect ) {
+ surface->clip_rect = full_rect;
+ return 1;
+ }
+ return SDL_IntersectRect(rect, &full_rect, &surface->clip_rect);
+}
+void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect)
+{
+ if ( surface && rect ) {
+ *rect = surface->clip_rect;
+ }
+}
+/*
+ * Set up a blit between two surfaces -- split into three parts:
+ * The upper part, SDL_UpperBlit(), performs clipping and rectangle
+ * 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
+ * library in the optimimum places. They are exported so that if
+ * you know exactly what you are doing, you can optimize your code
+ * by calling the one(s) you need.
+ */
+int SDL_LowerBlit (SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect)
+{
+ SDL_blit do_blit;
+ SDL_Rect hw_srcrect;
+ SDL_Rect hw_dstrect;
+
+ /* Check to make sure the blit mapping is valid */
+ if ( (src->map->dst != dst) ||
+ (src->map->dst->format_version != src->map->format_version) ) {
+ if ( SDL_MapSurface(src, dst) < 0 ) {
+ return(-1);
+ }
+ }
+
+ /* Figure out which blitter to use */
+ if ( (src->flags & SDL_HWACCEL) == SDL_HWACCEL ) {
+ if ( src == SDL_VideoSurface ) {
+ hw_srcrect = *srcrect;
+ hw_srcrect.x += current_video->offset_x;
+ hw_srcrect.y += current_video->offset_y;
+ srcrect = &hw_srcrect;
+ }
+ if ( dst == SDL_VideoSurface ) {
+ hw_dstrect = *dstrect;
+ hw_dstrect.x += current_video->offset_x;
+ hw_dstrect.y += current_video->offset_y;
+ dstrect = &hw_dstrect;
+ }
+ do_blit = src->map->hw_blit;
+ } else {
+ do_blit = src->map->sw_blit;
+ }
+ return(do_blit(src, srcrect, dst, dstrect));
+}
+
+
+int SDL_UpperBlit (SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect)
+{
+ SDL_Rect fulldst;
+ int srcx, srcy, w, h;
+
+ /* Make sure the surfaces aren't locked */
+ if ( ! src || ! dst ) {
+ SDL_SetError("SDL_UpperBlit: passed a NULL surface");
+ return(-1);
+ }
+ if ( src->locked || dst->locked ) {
+ SDL_SetError("Surfaces must not be locked during blit");
+ return(-1);
+ }
+
+ /* If the destination rectangle is NULL, use the entire dest surface */
+ if ( dstrect == NULL ) {
+ fulldst.x = fulldst.y = 0;
+ dstrect = &fulldst;
+ }
+
+ /* clip the source rectangle to the source surface */
+ if(srcrect) {
+ int maxw, maxh;
+
+ srcx = srcrect->x;
+ w = srcrect->w;
+ if(srcx < 0) {
+ w += srcx;
+ dstrect->x -= srcx;
+ srcx = 0;
+ }
+ maxw = src->w - srcx;
+ if(maxw < w)
+ w = maxw;
+
+ srcy = srcrect->y;
+ h = srcrect->h;
+ if(srcy < 0) {
+ h += srcy;
+ dstrect->y -= srcy;
+ srcy = 0;
+ }
+ maxh = src->h - srcy;
+ if(maxh < h)
+ h = maxh;
+
+ } else {
+ srcx = srcy = 0;
+ w = src->w;
+ h = src->h;
+ }
+
+ /* clip the destination rectangle against the clip rectangle */
+ {
+ SDL_Rect *clip = &dst->clip_rect;
+ int dx, dy;
+
+ dx = clip->x - dstrect->x;
+ if(dx > 0) {
+ w -= dx;
+ dstrect->x += dx;
+ srcx += dx;
+ }
+ dx = dstrect->x + w - clip->x - clip->w;
+ if(dx > 0)
+ w -= dx;
+
+ dy = clip->y - dstrect->y;
+ if(dy > 0) {
+ h -= dy;
+ dstrect->y += dy;
+ srcy += dy;
+ }
+ dy = dstrect->y + h - clip->y - clip->h;
+ if(dy > 0)
+ h -= dy;
+ }
+
+ if(w > 0 && h > 0) {
+ SDL_Rect sr;
+ sr.x = srcx;
+ sr.y = srcy;
+ sr.w = dstrect->w = w;
+ sr.h = dstrect->h = h;
+ return SDL_LowerBlit(src, &sr, dst, dstrect);
+ }
+ dstrect->w = dstrect->h = 0;
+ return 0;
+}
+
+static int SDL_FillRect1(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color)
+{
+ /* FIXME: We have to worry about packing order.. *sigh* */
+ SDL_SetError("1-bpp rect fill not yet implemented");
+ return -1;
+}
+
+static int SDL_FillRect4(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color)
+{
+ /* FIXME: We have to worry about packing order.. *sigh* */
+ SDL_SetError("4-bpp rect fill not yet implemented");
+ return -1;
+}
+
+/*
+ * This function performs a fast fill of the given rectangle with 'color'
+ */
+int SDL_FillRect(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color)
+{
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+ int x, y;
+ Uint8 *row;
+
+ /* This function doesn't work on surfaces < 8 bpp */
+ if ( dst->format->BitsPerPixel < 8 ) {
+ switch(dst->format->BitsPerPixel) {
+ case 1:
+ return SDL_FillRect1(dst, dstrect, color);
+ break;
+ case 4:
+ return SDL_FillRect4(dst, dstrect, color);
+ break;
+ default:
+ SDL_SetError("Fill rect on unsupported surface format");
+ return(-1);
+ break;
+ }
+ }
+
+ /* If 'dstrect' == NULL, then fill the whole surface */
+ if ( dstrect ) {
+ /* Perform clipping */
+ if ( !SDL_IntersectRect(dstrect, &dst->clip_rect, dstrect) ) {
+ return(0);
+ }
+ } else {
+ dstrect = &dst->clip_rect;
+ }
+
+ /* Check for hardware acceleration */
+ if ( ((dst->flags & SDL_HWSURFACE) == SDL_HWSURFACE) &&
+ video->info.blit_fill ) {
+ SDL_Rect hw_rect;
+ if ( dst == SDL_VideoSurface ) {
+ hw_rect = *dstrect;
+ hw_rect.x += current_video->offset_x;
+ hw_rect.y += current_video->offset_y;
+ dstrect = &hw_rect;
+ }
+ return(video->FillHWRect(this, dst, dstrect, color));
+ }
+
+ /* Perform software fill */
+ if ( SDL_LockSurface(dst) != 0 ) {
+ return(-1);
+ }
+ row = (Uint8 *)dst->pixels+dstrect->y*dst->pitch+
+ dstrect->x*dst->format->BytesPerPixel;
+ if ( dst->format->palette || (color == 0) ) {
+ x = dstrect->w*dst->format->BytesPerPixel;
+ if ( !color && !((uintptr_t)row&3) && !(x&3) && !(dst->pitch&3) ) {
+ int n = x >> 2;
+ for ( y=dstrect->h; y; --y ) {
+ SDL_memset4(row, 0, n);
+ row += dst->pitch;
+ }
+ } else {
+#ifdef __powerpc__
+ /*
+ * SDL_memset() on PPC (both glibc and codewarrior) uses
+ * the dcbz (Data Cache Block Zero) instruction, which
+ * causes an alignment exception if the destination is
+ * uncachable, so only use it on software surfaces
+ */
+ if((dst->flags & SDL_HWSURFACE) == SDL_HWSURFACE) {
+ if(dstrect->w >= 8) {
+ /*
+ * 64-bit stores are probably most
+ * efficient to uncached video memory
+ */
+ double fill;
+ SDL_memset(&fill, color, (sizeof fill));
+ for(y = dstrect->h; y; y--) {
+ Uint8 *d = row;
+ unsigned n = x;
+ unsigned nn;
+ Uint8 c = color;
+ double f = fill;
+ while((unsigned long)d
+ & (sizeof(double) - 1)) {
+ *d++ = c;
+ n--;
+ }
+ nn = n / (sizeof(double) * 4);
+ while(nn) {
+ ((double *)d)[0] = f;
+ ((double *)d)[1] = f;
+ ((double *)d)[2] = f;
+ ((double *)d)[3] = f;
+ d += 4*sizeof(double);
+ nn--;
+ }
+ n &= ~(sizeof(double) * 4 - 1);
+ nn = n / sizeof(double);
+ while(nn) {
+ *(double *)d = f;
+ d += sizeof(double);
+ nn--;
+ }
+ n &= ~(sizeof(double) - 1);
+ while(n) {
+ *d++ = c;
+ n--;
+ }
+ row += dst->pitch;
+ }
+ } else {
+ /* narrow boxes */
+ for(y = dstrect->h; y; y--) {
+ Uint8 *d = row;
+ Uint8 c = color;
+ int n = x;
+ while(n) {
+ *d++ = c;
+ n--;
+ }
+ row += dst->pitch;
+ }
+ }
+ } else
+#endif /* __powerpc__ */
+ {
+ for(y = dstrect->h; y; y--) {
+ SDL_memset(row, color, x);
+ row += dst->pitch;
+ }
+ }
+ }
+ } else {
+ switch (dst->format->BytesPerPixel) {
+ case 2:
+ for ( y=dstrect->h; y; --y ) {
+ Uint16 *pixels = (Uint16 *)row;
+ Uint16 c = (Uint16)color;
+ Uint32 cc = (Uint32)c << 16 | c;
+ int n = dstrect->w;
+ if((uintptr_t)pixels & 3) {
+ *pixels++ = c;
+ n--;
+ }
+ if(n >> 1)
+ SDL_memset4(pixels, cc, n >> 1);
+ if(n & 1)
+ pixels[n - 1] = c;
+ row += dst->pitch;
+ }
+ break;
+
+ case 3:
+ #if SDL_BYTEORDER == SDL_BIG_ENDIAN
+ color <<= 8;
+ #endif
+ for ( y=dstrect->h; y; --y ) {
+ Uint8 *pixels = row;
+ for ( x=dstrect->w; x; --x ) {
+ SDL_memcpy(pixels, &color, 3);
+ pixels += 3;
+ }
+ row += dst->pitch;
+ }
+ break;
+
+ case 4:
+ for(y = dstrect->h; y; --y) {
+ SDL_memset4(row, color, dstrect->w);
+ row += dst->pitch;
+ }
+ break;
+ }
+ }
+ SDL_UnlockSurface(dst);
+
+ /* We're done! */
+ return(0);
+}
+
+/*
+ * Lock a surface to directly access the pixels
+ */
+int SDL_LockSurface (SDL_Surface *surface)
+{
+ if ( ! surface->locked ) {
+ /* Perform the lock */
+ if ( surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT) ) {
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+ if ( video->LockHWSurface(this, surface) < 0 ) {
+ return(-1);
+ }
+ }
+ if ( surface->flags & SDL_RLEACCEL ) {
+ SDL_UnRLESurface(surface, 1);
+ surface->flags |= SDL_RLEACCEL; /* save accel'd state */
+ }
+ /* This needs to be done here in case pixels changes value */
+ surface->pixels = (Uint8 *)surface->pixels + surface->offset;
+ }
+
+ /* Increment the surface lock count, for recursive locks */
+ ++surface->locked;
+
+ /* Ready to go.. */
+ return(0);
+}
+/*
+ * Unlock a previously locked surface
+ */
+void SDL_UnlockSurface (SDL_Surface *surface)
+{
+ /* Only perform an unlock if we are locked */
+ if ( ! surface->locked || (--surface->locked > 0) ) {
+ return;
+ }
+
+ /* Perform the unlock */
+ surface->pixels = (Uint8 *)surface->pixels - surface->offset;
+
+ /* Unlock hardware or accelerated surfaces */
+ if ( surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT) ) {
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+ video->UnlockHWSurface(this, surface);
+ } else {
+ /* Update RLE encoded surface with new data */
+ if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) {
+ surface->flags &= ~SDL_RLEACCEL; /* stop lying */
+ SDL_RLESurface(surface);
+ }
+ }
+}
+
+/*
+ * Convert a surface into the specified pixel format.
+ */
+SDL_Surface * SDL_ConvertSurface (SDL_Surface *surface,
+ SDL_PixelFormat *format, Uint32 flags)
+{
+ SDL_Surface *convert;
+ Uint32 colorkey = 0;
+ Uint8 alpha = 0;
+ Uint32 surface_flags;
+ SDL_Rect bounds;
+
+ /* Check for empty destination palette! (results in empty image) */
+ if ( format->palette != NULL ) {
+ int i;
+ for ( i=0; i<format->palette->ncolors; ++i ) {
+ if ( (format->palette->colors[i].r != 0) ||
+ (format->palette->colors[i].g != 0) ||
+ (format->palette->colors[i].b != 0) )
+ break;
+ }
+ if ( i == format->palette->ncolors ) {
+ SDL_SetError("Empty destination palette");
+ return(NULL);
+ }
+ }
+
+ /* Only create hw surfaces with alpha channel if hw alpha blits
+ are supported */
+ if(format->Amask != 0 && (flags & SDL_HWSURFACE)) {
+ const SDL_VideoInfo *vi = SDL_GetVideoInfo();
+ if(!vi || !vi->blit_hw_A)
+ flags &= ~SDL_HWSURFACE;
+ }
+
+ /* Create a new surface with the desired format */
+ convert = SDL_CreateRGBSurface(flags,
+ surface->w, surface->h, format->BitsPerPixel,
+ format->Rmask, format->Gmask, format->Bmask, format->Amask);
+ if ( convert == NULL ) {
+ return(NULL);
+ }
+
+ /* Copy the palette if any */
+ if ( format->palette && convert->format->palette ) {
+ SDL_memcpy(convert->format->palette->colors,
+ format->palette->colors,
+ format->palette->ncolors*sizeof(SDL_Color));
+ convert->format->palette->ncolors = format->palette->ncolors;
+ }
+
+ /* Save the original surface color key and alpha */
+ surface_flags = surface->flags;
+ if ( (surface_flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
+ /* Convert colourkeyed surfaces to RGBA if requested */
+ if((flags & SDL_SRCCOLORKEY) != SDL_SRCCOLORKEY
+ && format->Amask) {
+ surface_flags &= ~SDL_SRCCOLORKEY;
+ } else {
+ colorkey = surface->format->colorkey;
+ SDL_SetColorKey(surface, 0, 0);
+ }
+ }
+ if ( (surface_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
+ /* Copy over the alpha channel to RGBA if requested */
+ if ( format->Amask ) {
+ surface->flags &= ~SDL_SRCALPHA;
+ } else {
+ alpha = surface->format->alpha;
+ SDL_SetAlpha(surface, 0, 0);
+ }
+ }
+
+ /* Copy over the image data */
+ bounds.x = 0;
+ bounds.y = 0;
+ bounds.w = surface->w;
+ bounds.h = surface->h;
+ SDL_LowerBlit(surface, &bounds, convert, &bounds);
+
+ /* Clean up the original surface, and update converted surface */
+ if ( convert != NULL ) {
+ SDL_SetClipRect(convert, &surface->clip_rect);
+ }
+ if ( (surface_flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
+ Uint32 cflags = surface_flags&(SDL_SRCCOLORKEY|SDL_RLEACCELOK);
+ if ( convert != NULL ) {
+ Uint8 keyR, keyG, keyB;
+
+ SDL_GetRGB(colorkey,surface->format,&keyR,&keyG,&keyB);
+ SDL_SetColorKey(convert, cflags|(flags&SDL_RLEACCELOK),
+ SDL_MapRGB(convert->format, keyR, keyG, keyB));
+ }
+ SDL_SetColorKey(surface, cflags, colorkey);
+ }
+ if ( (surface_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
+ Uint32 aflags = surface_flags&(SDL_SRCALPHA|SDL_RLEACCELOK);
+ if ( convert != NULL ) {
+ SDL_SetAlpha(convert, aflags|(flags&SDL_RLEACCELOK),
+ alpha);
+ }
+ if ( format->Amask ) {
+ surface->flags |= SDL_SRCALPHA;
+ } else {
+ SDL_SetAlpha(surface, aflags, alpha);
+ }
+ }
+
+ /* We're ready to go! */
+ return(convert);
+}
+
+/*
+ * Free a surface created by the above function.
+ */
+void SDL_FreeSurface (SDL_Surface *surface)
+{
+ /* Free anything that's not NULL, and not the screen surface */
+ if ((surface == NULL) ||
+ (current_video &&
+ ((surface == SDL_ShadowSurface)||(surface == SDL_VideoSurface)))) {
+ return;
+ }
+ if ( --surface->refcount > 0 ) {
+ return;
+ }
+ while ( surface->locked > 0 ) {
+ SDL_UnlockSurface(surface);
+ }
+ if ( (surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) {
+ SDL_UnRLESurface(surface, 0);
+ }
+ if ( surface->format ) {
+ SDL_FreeFormat(surface->format);
+ surface->format = NULL;
+ }
+ if ( surface->map != NULL ) {
+ SDL_FreeBlitMap(surface->map);
+ surface->map = NULL;
+ }
+ if ( surface->hwdata ) {
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+ video->FreeHWSurface(this, surface);
+ }
+ if ( surface->pixels &&
+ ((surface->flags & SDL_PREALLOC) != SDL_PREALLOC) ) {
+ SDL_free(surface->pixels);
+ }
+ SDL_free(surface);
+#ifdef CHECK_LEAKS
+ --surfaces_allocated;
+#endif
+}
diff --git a/distrib/sdl-1.2.15/src/video/SDL_sysvideo.h b/distrib/sdl-1.2.15/src/video/SDL_sysvideo.h
new file mode 100644
index 0000000..65287b4
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_sysvideo.h
@@ -0,0 +1,439 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_sysvideo_h
+#define _SDL_sysvideo_h
+
+#include "SDL_mouse.h"
+#define SDL_PROTOTYPES_ONLY
+#include "SDL_syswm.h"
+#undef SDL_PROTOTYPES_ONLY
+
+/* This file prototypes the video driver implementation.
+ This is designed to be easily converted to C++ in the future.
+ */
+
+#if SDL_VIDEO_OPENGL
+#include "SDL_opengl.h"
+#endif /* SDL_VIDEO_OPENGL */
+
+/* The SDL video driver */
+typedef struct SDL_VideoDevice SDL_VideoDevice;
+
+/* Define the SDL video driver structure */
+#define _THIS SDL_VideoDevice *_this
+#ifndef _STATUS
+#define _STATUS SDL_status *status
+#endif
+struct SDL_VideoDevice {
+ /* * * */
+ /* The name of this video driver */
+ const char *name;
+
+ /* * * */
+ /* Initialization/Query functions */
+
+ /* Initialize the native video subsystem, filling 'vformat' with the
+ "best" display pixel format, returning 0 or -1 if there's an error.
+ */
+ int (*VideoInit)(_THIS, SDL_PixelFormat *vformat);
+
+ /* List the available video modes for the given pixel format, sorted
+ from largest to smallest.
+ */
+ SDL_Rect **(*ListModes)(_THIS, SDL_PixelFormat *format, Uint32 flags);
+
+ /* Set the requested video mode, returning a surface which will be
+ set to the SDL_VideoSurface. The width and height will already
+ be verified by ListModes(), and the video subsystem is free to
+ set the mode to a supported bit depth different from the one
+ specified -- the desired bpp will be emulated with a shadow
+ surface if necessary. If a new mode is returned, this function
+ should take care of cleaning up the current mode.
+ */
+ SDL_Surface *(*SetVideoMode)(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags);
+
+ /* Toggle the fullscreen mode */
+ int (*ToggleFullScreen)(_THIS, int on);
+
+ /* This is called after the video mode has been set, to get the
+ initial mouse state. It should queue events as necessary to
+ properly represent the current mouse focus and position.
+ */
+ void (*UpdateMouse)(_THIS);
+
+ /* Create a YUV video surface (possibly overlay) of the given
+ format. The hardware should be able to perform at least 2x
+ scaling on display.
+ */
+ SDL_Overlay *(*CreateYUVOverlay)(_THIS, int width, int height,
+ Uint32 format, SDL_Surface *display);
+
+ /* Sets the color entries { firstcolor .. (firstcolor+ncolors-1) }
+ of the physical palette to those in 'colors'. If the device is
+ using a software palette (SDL_HWPALETTE not set), then the
+ changes are reflected in the logical palette of the screen
+ as well.
+ The return value is 1 if all entries could be set properly
+ or 0 otherwise.
+ */
+ int (*SetColors)(_THIS, int firstcolor, int ncolors,
+ SDL_Color *colors);
+
+ /* This pointer should exist in the native video subsystem and should
+ point to an appropriate update function for the current video mode
+ */
+ void (*UpdateRects)(_THIS, int numrects, SDL_Rect *rects);
+
+ /* Reverse the effects VideoInit() -- called if VideoInit() fails
+ or if the application is shutting down the video subsystem.
+ */
+ void (*VideoQuit)(_THIS);
+
+ /* * * */
+ /* Hardware acceleration functions */
+
+ /* Information about the video hardware */
+ SDL_VideoInfo info;
+
+ /* The pixel format used when SDL_CreateRGBSurface creates SDL_HWSURFACEs with alpha */
+ SDL_PixelFormat* displayformatalphapixel;
+
+ /* Allocates a surface in video memory */
+ int (*AllocHWSurface)(_THIS, SDL_Surface *surface);
+
+ /* Sets the hardware accelerated blit function, if any, based
+ on the current flags of the surface (colorkey, alpha, etc.)
+ */
+ int (*CheckHWBlit)(_THIS, SDL_Surface *src, SDL_Surface *dst);
+
+ /* Fills a surface rectangle with the given color */
+ int (*FillHWRect)(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color);
+
+ /* Sets video mem colorkey and accelerated blit function */
+ int (*SetHWColorKey)(_THIS, SDL_Surface *surface, Uint32 key);
+
+ /* Sets per surface hardware alpha value */
+ int (*SetHWAlpha)(_THIS, SDL_Surface *surface, Uint8 value);
+
+ /* Returns a readable/writable surface */
+ int (*LockHWSurface)(_THIS, SDL_Surface *surface);
+ void (*UnlockHWSurface)(_THIS, SDL_Surface *surface);
+
+ /* Performs hardware flipping */
+ int (*FlipHWSurface)(_THIS, SDL_Surface *surface);
+
+ /* Frees a previously allocated video surface */
+ void (*FreeHWSurface)(_THIS, SDL_Surface *surface);
+
+ /* * * */
+ /* Gamma support */
+
+ Uint16 *gamma;
+
+ /* Set the gamma correction directly (emulated with gamma ramps) */
+ int (*SetGamma)(_THIS, float red, float green, float blue);
+
+ /* Get the gamma correction directly (emulated with gamma ramps) */
+ int (*GetGamma)(_THIS, float *red, float *green, float *blue);
+
+ /* Set the gamma ramp */
+ int (*SetGammaRamp)(_THIS, Uint16 *ramp);
+
+ /* Get the gamma ramp */
+ int (*GetGammaRamp)(_THIS, Uint16 *ramp);
+
+ /* * * */
+ /* OpenGL support */
+
+ /* Sets the dll to use for OpenGL and loads it */
+ int (*GL_LoadLibrary)(_THIS, const char *path);
+
+ /* Retrieves the address of a function in the gl library */
+ void* (*GL_GetProcAddress)(_THIS, const char *proc);
+
+ /* Get attribute information from the windowing system. */
+ int (*GL_GetAttribute)(_THIS, SDL_GLattr attrib, int* value);
+
+ /* Make the context associated with this driver current */
+ int (*GL_MakeCurrent)(_THIS);
+
+ /* Swap the current buffers in double buffer mode. */
+ void (*GL_SwapBuffers)(_THIS);
+
+ /* OpenGL functions for SDL_OPENGLBLIT */
+#if SDL_VIDEO_OPENGL
+#if !defined(__WIN32__)
+#define WINAPI
+#endif
+#define SDL_PROC(ret,func,params) ret (WINAPI *func) params;
+#include "SDL_glfuncs.h"
+#undef SDL_PROC
+
+ /* Texture id */
+ GLuint texture;
+#endif
+ int is_32bit;
+
+ /* * * */
+ /* Window manager functions */
+
+ /* Set the title and icon text */
+ void (*SetCaption)(_THIS, const char *title, const char *icon);
+
+ /* Set the window icon image */
+ void (*SetIcon)(_THIS, SDL_Surface *icon, Uint8 *mask);
+
+ /* Iconify the window.
+ This function returns 1 if there is a window manager and the
+ window was actually iconified, it returns 0 otherwise.
+ */
+ int (*IconifyWindow)(_THIS);
+
+ /* Grab or ungrab keyboard and mouse input */
+ SDL_GrabMode (*GrabInput)(_THIS, SDL_GrabMode mode);
+
+ /* Get some platform dependent window information */
+ int (*GetWMInfo)(_THIS, SDL_SysWMinfo *info);
+
+ /* set window position */
+ void (*SetWindowPos)(_THIS, int x, int y);
+
+ /* get window position */
+ void (*GetWindowPos)(_THIS, int *px, int *py);
+
+ /* determine if the window is fully visible on screen */
+ int (*IsWindowVisible)(_THIS, int recenter);
+
+ /* get main monitor's resolution */
+ int (*GetMonitorDPI)(_THIS, int *xdpi, int *ydpi);
+
+ /* get nearest monitor's rectangle */
+ int (*GetMonitorRect)(_THIS, SDL_Rect* rect);
+
+ /* * * */
+ /* Cursor manager functions */
+
+ /* Free a window manager cursor
+ This function can be NULL if CreateWMCursor is also NULL.
+ */
+ void (*FreeWMCursor)(_THIS, WMcursor *cursor);
+
+ /* If not NULL, create a black/white window manager cursor */
+ WMcursor *(*CreateWMCursor)(_THIS,
+ Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
+
+ /* Show the specified cursor, or hide if cursor is NULL */
+ int (*ShowWMCursor)(_THIS, WMcursor *cursor);
+
+ /* Warp the window manager cursor to (x,y)
+ If NULL, a mouse motion event is posted internally.
+ */
+ void (*WarpWMCursor)(_THIS, Uint16 x, Uint16 y);
+
+ /* If not NULL, this is called when a mouse motion event occurs */
+ void (*MoveWMCursor)(_THIS, int x, int y);
+
+ /* Determine whether the mouse should be in relative mode or not.
+ This function is called when the input grab state or cursor
+ visibility state changes.
+ If the cursor is not visible, and the input is grabbed, the
+ driver can place the mouse in relative mode, which may result
+ in higher accuracy sampling of the pointer motion.
+ */
+ void (*CheckMouseMode)(_THIS);
+
+ /* * * */
+ /* Event manager functions */
+
+ /* Initialize keyboard mapping for this driver */
+ void (*InitOSKeymap)(_THIS);
+
+ /* Handle any queued OS events */
+ void (*PumpEvents)(_THIS);
+
+ /* * * */
+ /* Data common to all drivers */
+ SDL_Surface *screen;
+ SDL_Surface *shadow;
+ SDL_Surface *visible;
+ SDL_Palette *physpal; /* physical palette, if != logical palette */
+ SDL_Color *gammacols; /* gamma-corrected colours, or NULL */
+ char *wm_title;
+ char *wm_icon;
+ int offset_x;
+ int offset_y;
+ SDL_GrabMode input_grab;
+
+ /* Driver information flags */
+ int handles_any_size; /* Driver handles any size video mode */
+
+ /* * * */
+ /* Data used by the GL drivers */
+ struct {
+ int red_size;
+ int green_size;
+ int blue_size;
+ int alpha_size;
+ int depth_size;
+ int buffer_size;
+ int stencil_size;
+ int double_buffer;
+ int accum_red_size;
+ int accum_green_size;
+ int accum_blue_size;
+ int accum_alpha_size;
+ int stereo;
+ int multisamplebuffers;
+ int multisamplesamples;
+ int accelerated;
+ int swap_control;
+ int driver_loaded;
+ char driver_path[256];
+ void* dll_handle;
+ } gl_config;
+
+ /* * * */
+ /* Data private to this driver */
+ struct SDL_PrivateVideoData *hidden;
+ struct SDL_PrivateGLData *gl_data;
+
+ /* * * */
+ /* The function used to dispose of this structure */
+ void (*free)(_THIS);
+};
+#undef _THIS
+
+typedef struct VideoBootStrap {
+ const char *name;
+ const char *desc;
+ int (*available)(void);
+ SDL_VideoDevice *(*create)(int devindex);
+} VideoBootStrap;
+
+#if SDL_VIDEO_DRIVER_QUARTZ
+extern VideoBootStrap QZ_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_X11
+extern VideoBootStrap X11_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_DGA
+extern VideoBootStrap DGA_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_NANOX
+extern VideoBootStrap NX_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_IPOD
+extern VideoBootStrap iPod_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_QTOPIA
+extern VideoBootStrap Qtopia_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_WSCONS
+extern VideoBootStrap WSCONS_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_FBCON
+extern VideoBootStrap FBCON_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_DIRECTFB
+extern VideoBootStrap DirectFB_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_PS2GS
+extern VideoBootStrap PS2GS_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_PS3
+extern VideoBootStrap PS3_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_GGI
+extern VideoBootStrap GGI_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_VGL
+extern VideoBootStrap VGL_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_SVGALIB
+extern VideoBootStrap SVGALIB_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_GAPI
+extern VideoBootStrap GAPI_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_WINDIB
+extern VideoBootStrap WINDIB_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_DDRAW
+extern VideoBootStrap DIRECTX_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_BWINDOW
+extern VideoBootStrap BWINDOW_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_TOOLBOX
+extern VideoBootStrap TOOLBOX_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_DRAWSPROCKET
+extern VideoBootStrap DSp_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_PHOTON
+extern VideoBootStrap ph_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_EPOC
+extern VideoBootStrap EPOC_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_XBIOS
+extern VideoBootStrap XBIOS_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_GEM
+extern VideoBootStrap GEM_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_PICOGUI
+extern VideoBootStrap PG_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_DC
+extern VideoBootStrap DC_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_NDS
+extern VideoBootStrap NDS_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_RISCOS
+extern VideoBootStrap RISCOS_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_OS2FS
+extern VideoBootStrap OS2FSLib_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_AALIB
+extern VideoBootStrap AALIB_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_CACA
+extern VideoBootStrap CACA_bootstrap;
+#endif
+#if SDL_VIDEO_DRIVER_DUMMY
+extern VideoBootStrap DUMMY_bootstrap;
+#endif
+
+/* This is the current video device */
+extern SDL_VideoDevice *current_video;
+
+#define SDL_VideoSurface (current_video->screen)
+#define SDL_ShadowSurface (current_video->shadow)
+#define SDL_PublicSurface (current_video->visible)
+
+#endif /* _SDL_sysvideo_h */
diff --git a/distrib/sdl-1.2.15/src/video/SDL_video.c b/distrib/sdl-1.2.15/src/video/SDL_video.c
new file mode 100644
index 0000000..f4f4407
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_video.c
@@ -0,0 +1,2041 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* The high-level video driver subsystem */
+
+#include "SDL.h"
+#include "SDL_sysvideo.h"
+#include "SDL_blit.h"
+#include "SDL_pixels_c.h"
+#include "SDL_cursor_c.h"
+#include "../events/SDL_sysevents.h"
+#include "../events/SDL_events_c.h"
+
+/* Available video drivers */
+static VideoBootStrap *bootstrap[] = {
+#if SDL_VIDEO_DRIVER_QUARTZ
+ &QZ_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_X11
+ &X11_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_DGA
+ &DGA_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_NANOX
+ &NX_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_IPOD
+ &iPod_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_QTOPIA
+ &Qtopia_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_WSCONS
+ &WSCONS_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_FBCON
+ &FBCON_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_DIRECTFB
+ &DirectFB_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_PS2GS
+ &PS2GS_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_PS3
+ &PS3_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_GGI
+ &GGI_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_VGL
+ &VGL_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_SVGALIB
+ &SVGALIB_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_GAPI
+ &GAPI_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_WINDIB
+ &WINDIB_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_DDRAW
+ &DIRECTX_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_BWINDOW
+ &BWINDOW_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_TOOLBOX
+ &TOOLBOX_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_DRAWSPROCKET
+ &DSp_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_PHOTON
+ &ph_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_EPOC
+ &EPOC_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_XBIOS
+ &XBIOS_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_GEM
+ &GEM_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_PICOGUI
+ &PG_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_DC
+ &DC_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_NDS
+ &NDS_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_RISCOS
+ &RISCOS_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_OS2FS
+ &OS2FSLib_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_AALIB
+ &AALIB_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_CACA
+ &CACA_bootstrap,
+#endif
+#if SDL_VIDEO_DRIVER_DUMMY
+ &DUMMY_bootstrap,
+#endif
+ NULL
+};
+
+SDL_VideoDevice *current_video = NULL;
+
+/* Various local functions */
+int SDL_VideoInit(const char *driver_name, Uint32 flags);
+void SDL_VideoQuit(void);
+void SDL_GL_UpdateRectsLock(SDL_VideoDevice* this, int numrects, SDL_Rect* rects);
+
+static SDL_GrabMode SDL_WM_GrabInputOff(void);
+#if SDL_VIDEO_OPENGL
+static int lock_count = 0;
+#endif
+
+
+/*
+ * Initialize the video and event subsystems -- determine native pixel format
+ */
+int SDL_VideoInit (const char *driver_name, Uint32 flags)
+{
+ SDL_VideoDevice *video;
+ int index;
+ int i;
+ SDL_PixelFormat vformat;
+ Uint32 video_flags;
+
+ /* Toggle the event thread flags, based on OS requirements */
+#if defined(MUST_THREAD_EVENTS)
+ flags |= SDL_INIT_EVENTTHREAD;
+#elif defined(CANT_THREAD_EVENTS)
+ if ( (flags & SDL_INIT_EVENTTHREAD) == SDL_INIT_EVENTTHREAD ) {
+ SDL_SetError("OS doesn't support threaded events");
+ return(-1);
+ }
+#endif
+
+ /* Check to make sure we don't overwrite 'current_video' */
+ if ( current_video != NULL ) {
+ SDL_VideoQuit();
+ }
+
+ /* Select the proper video driver */
+ index = 0;
+ video = NULL;
+ if ( driver_name != NULL ) {
+#if 0 /* This will be replaced with a better driver selection API */
+ if ( SDL_strrchr(driver_name, ':') != NULL ) {
+ index = atoi(SDL_strrchr(driver_name, ':')+1);
+ }
+#endif
+ for ( i=0; bootstrap[i]; ++i ) {
+ if ( SDL_strcasecmp(bootstrap[i]->name, driver_name) == 0) {
+ if ( bootstrap[i]->available() ) {
+ video = bootstrap[i]->create(index);
+ break;
+ }
+ }
+ }
+ } else {
+ for ( i=0; bootstrap[i]; ++i ) {
+ if ( bootstrap[i]->available() ) {
+ video = bootstrap[i]->create(index);
+ if ( video != NULL ) {
+ break;
+ }
+ }
+ }
+ }
+ if ( video == NULL ) {
+ SDL_SetError("No available video device");
+ return(-1);
+ }
+ current_video = video;
+ current_video->name = bootstrap[i]->name;
+
+ /* Do some basic variable initialization */
+ video->screen = NULL;
+ video->shadow = NULL;
+ video->visible = NULL;
+ video->physpal = NULL;
+ video->gammacols = NULL;
+ video->gamma = NULL;
+ video->wm_title = NULL;
+ video->wm_icon = NULL;
+ video->offset_x = 0;
+ video->offset_y = 0;
+ SDL_memset(&video->info, 0, (sizeof video->info));
+
+ video->displayformatalphapixel = NULL;
+
+ /* Set some very sane GL defaults */
+ video->gl_config.driver_loaded = 0;
+ video->gl_config.dll_handle = NULL;
+ video->gl_config.red_size = 3;
+ video->gl_config.green_size = 3;
+ video->gl_config.blue_size = 2;
+ video->gl_config.alpha_size = 0;
+ video->gl_config.buffer_size = 0;
+ video->gl_config.depth_size = 16;
+ video->gl_config.stencil_size = 0;
+ video->gl_config.double_buffer = 1;
+ video->gl_config.accum_red_size = 0;
+ video->gl_config.accum_green_size = 0;
+ video->gl_config.accum_blue_size = 0;
+ video->gl_config.accum_alpha_size = 0;
+ video->gl_config.stereo = 0;
+ video->gl_config.multisamplebuffers = 0;
+ video->gl_config.multisamplesamples = 0;
+ video->gl_config.accelerated = -1; /* not known, don't set */
+ video->gl_config.swap_control = -1; /* not known, don't set */
+
+ /* Initialize the video subsystem */
+ SDL_memset(&vformat, 0, sizeof(vformat));
+ if ( video->VideoInit(video, &vformat) < 0 ) {
+ SDL_VideoQuit();
+ return(-1);
+ }
+
+ /* Create a zero sized video surface of the appropriate format */
+ video_flags = SDL_SWSURFACE;
+ SDL_VideoSurface = SDL_CreateRGBSurface(video_flags, 0, 0,
+ vformat.BitsPerPixel,
+ vformat.Rmask, vformat.Gmask, vformat.Bmask, 0);
+ if ( SDL_VideoSurface == NULL ) {
+ SDL_VideoQuit();
+ return(-1);
+ }
+ SDL_PublicSurface = NULL; /* Until SDL_SetVideoMode() */
+
+#if 0 /* Don't change the current palette - may be used by other programs.
+ * The application can't do anything with the display surface until
+ * a video mode has been set anyway. :)
+ */
+ /* If we have a palettized surface, create a default palette */
+ if ( SDL_VideoSurface->format->palette ) {
+ SDL_PixelFormat *vf = SDL_VideoSurface->format;
+ SDL_DitherColors(vf->palette->colors, vf->BitsPerPixel);
+ video->SetColors(video,
+ 0, vf->palette->ncolors, vf->palette->colors);
+ }
+#endif
+ video->info.vfmt = SDL_VideoSurface->format;
+
+ /* Start the event loop */
+ if ( SDL_StartEventLoop(flags) < 0 ) {
+ SDL_VideoQuit();
+ return(-1);
+ }
+ SDL_CursorInit(flags & SDL_INIT_EVENTTHREAD);
+
+ /* We're ready to go! */
+ return(0);
+}
+
+char *SDL_VideoDriverName(char *namebuf, int maxlen)
+{
+ if ( current_video != NULL ) {
+ SDL_strlcpy(namebuf, current_video->name, maxlen);
+ return(namebuf);
+ }
+ return(NULL);
+}
+
+/*
+ * Get the current display surface
+ */
+SDL_Surface *SDL_GetVideoSurface(void)
+{
+ SDL_Surface *visible;
+
+ visible = NULL;
+ if ( current_video ) {
+ visible = current_video->visible;
+ }
+ return(visible);
+}
+
+/*
+ * Get the current information about the video hardware
+ */
+const SDL_VideoInfo *SDL_GetVideoInfo(void)
+{
+ const SDL_VideoInfo *info;
+
+ info = NULL;
+ if ( current_video ) {
+ info = &current_video->info;
+ }
+ return(info);
+}
+
+/*
+ * Return a pointer to an array of available screen dimensions for the
+ * given format, sorted largest to smallest. Returns NULL if there are
+ * no dimensions available for a particular format, or (SDL_Rect **)-1
+ * if any dimension is okay for the given format. If 'format' is NULL,
+ * the mode list will be for the format given by SDL_GetVideoInfo()->vfmt
+ */
+SDL_Rect ** SDL_ListModes (SDL_PixelFormat *format, Uint32 flags)
+{
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+ SDL_Rect **modes;
+
+ modes = NULL;
+ if ( SDL_VideoSurface ) {
+ if ( format == NULL ) {
+ format = SDL_VideoSurface->format;
+ }
+ modes = video->ListModes(this, format, flags);
+ }
+ return(modes);
+}
+
+/*
+ * Check to see if a particular video mode is supported.
+ * It returns 0 if the requested mode is not supported under any bit depth,
+ * or returns the bits-per-pixel of the closest available mode with the
+ * given width and height. If this bits-per-pixel is different from the
+ * one used when setting the video mode, SDL_SetVideoMode() will succeed,
+ * but will emulate the requested bits-per-pixel with a shadow surface.
+ */
+static Uint8 SDL_closest_depths[4][8] = {
+ /* 8 bit closest depth ordering */
+ { 0, 8, 16, 15, 32, 24, 0, 0 },
+ /* 15,16 bit closest depth ordering */
+ { 0, 16, 15, 32, 24, 8, 0, 0 },
+ /* 24 bit closest depth ordering */
+ { 0, 24, 32, 16, 15, 8, 0, 0 },
+ /* 32 bit closest depth ordering */
+ { 0, 32, 16, 15, 24, 8, 0, 0 }
+};
+
+
+#ifdef __MACOS__ /* MPW optimization bug? */
+#define NEGATIVE_ONE 0xFFFFFFFF
+#else
+#define NEGATIVE_ONE -1
+#endif
+
+int SDL_VideoModeOK (int width, int height, int bpp, Uint32 flags)
+{
+ int table, b, i;
+ int supported;
+ SDL_PixelFormat format;
+ SDL_Rect **sizes;
+
+ /* Currently 1 and 4 bpp are not supported */
+ if ( bpp < 8 || bpp > 32 ) {
+ return(0);
+ }
+ if ( (width <= 0) || (height <= 0) ) {
+ return(0);
+ }
+
+ /* Search through the list valid of modes */
+ SDL_memset(&format, 0, sizeof(format));
+ supported = 0;
+ table = ((bpp+7)/8)-1;
+ SDL_closest_depths[table][0] = bpp;
+ SDL_closest_depths[table][7] = 0;
+ for ( b = 0; !supported && SDL_closest_depths[table][b]; ++b ) {
+ format.BitsPerPixel = SDL_closest_depths[table][b];
+ sizes = SDL_ListModes(&format, flags);
+ if ( sizes == (SDL_Rect **)0 ) {
+ /* No sizes supported at this bit-depth */
+ continue;
+ } else
+ if (sizes == (SDL_Rect **)NEGATIVE_ONE) {
+ /* Any size supported at this bit-depth */
+ supported = 1;
+ continue;
+ } else if (current_video->handles_any_size) {
+ /* Driver can center a smaller surface to simulate fullscreen */
+ for ( i=0; sizes[i]; ++i ) {
+ if ((sizes[i]->w >= width) && (sizes[i]->h >= height)) {
+ supported = 1; /* this mode can fit the centered window. */
+ break;
+ }
+ }
+ } else
+ for ( i=0; sizes[i]; ++i ) {
+ if ((sizes[i]->w == width) && (sizes[i]->h == height)) {
+ supported = 1;
+ break;
+ }
+ }
+ }
+ if ( supported ) {
+ --b;
+ return(SDL_closest_depths[table][b]);
+ } else {
+ return(0);
+ }
+}
+
+/*
+ * Get the closest non-emulated video mode to the one requested
+ */
+static int SDL_GetVideoMode (int *w, int *h, int *BitsPerPixel, Uint32 flags)
+{
+ int table, b, i;
+ int supported;
+ int native_bpp;
+ SDL_PixelFormat format;
+ SDL_Rect **sizes;
+
+ /* Check parameters */
+ if ( *BitsPerPixel < 8 || *BitsPerPixel > 32 ) {
+ SDL_SetError("Invalid bits per pixel (range is {8...32})");
+ return(0);
+ }
+ if ((*w <= 0) || (*h <= 0)) {
+ SDL_SetError("Invalid width or height");
+ return(0);
+ }
+
+ /* Try the original video mode, get the closest depth */
+ native_bpp = SDL_VideoModeOK(*w, *h, *BitsPerPixel, flags);
+ if ( native_bpp == *BitsPerPixel ) {
+ return(1);
+ }
+ if ( native_bpp > 0 ) {
+ *BitsPerPixel = native_bpp;
+ return(1);
+ }
+
+ /* No exact size match at any depth, look for closest match */
+ SDL_memset(&format, 0, sizeof(format));
+ supported = 0;
+ table = ((*BitsPerPixel+7)/8)-1;
+ SDL_closest_depths[table][0] = *BitsPerPixel;
+ SDL_closest_depths[table][7] = SDL_VideoSurface->format->BitsPerPixel;
+ for ( b = 0; !supported && SDL_closest_depths[table][b]; ++b ) {
+ int best;
+
+ format.BitsPerPixel = SDL_closest_depths[table][b];
+ sizes = SDL_ListModes(&format, flags);
+ if ( sizes == (SDL_Rect **)0 ) {
+ /* No sizes supported at this bit-depth */
+ continue;
+ }
+ best=0;
+ for ( i=0; sizes[i]; ++i ) {
+ /* Mode with both dimensions bigger or equal than asked ? */
+ if ((sizes[i]->w >= *w) && (sizes[i]->h >= *h)) {
+ /* Mode with any dimension smaller or equal than current best ? */
+ if ((sizes[i]->w <= sizes[best]->w) || (sizes[i]->h <= sizes[best]->h)) {
+ /* Now choose the mode that has less pixels */
+ if ((sizes[i]->w * sizes[i]->h) <= (sizes[best]->w * sizes[best]->h)) {
+ best=i;
+ supported = 1;
+ }
+ }
+ }
+ }
+ if (supported) {
+ *w=sizes[best]->w;
+ *h=sizes[best]->h;
+ *BitsPerPixel = SDL_closest_depths[table][b];
+ }
+ }
+ if ( ! supported ) {
+ SDL_SetError("No video mode large enough for %dx%d", *w, *h);
+ }
+ return(supported);
+}
+
+/* This should probably go somewhere else -- like SDL_surface.c */
+static void SDL_ClearSurface(SDL_Surface *surface)
+{
+ Uint32 black;
+
+ black = SDL_MapRGB(surface->format, 0, 0, 0);
+ SDL_FillRect(surface, NULL, black);
+ if ((surface->flags&SDL_HWSURFACE) && (surface->flags&SDL_DOUBLEBUF)) {
+ SDL_Flip(surface);
+ SDL_FillRect(surface, NULL, black);
+ }
+ if (surface->flags&SDL_FULLSCREEN) {
+ SDL_Flip(surface);
+ }
+}
+
+/*
+ * Create a shadow surface suitable for fooling the app. :-)
+ */
+static void SDL_CreateShadowSurface(int depth)
+{
+ Uint32 Rmask, Gmask, Bmask;
+
+ /* Allocate the shadow surface */
+ if ( depth == (SDL_VideoSurface->format)->BitsPerPixel ) {
+ Rmask = (SDL_VideoSurface->format)->Rmask;
+ Gmask = (SDL_VideoSurface->format)->Gmask;
+ Bmask = (SDL_VideoSurface->format)->Bmask;
+ } else {
+ Rmask = Gmask = Bmask = 0;
+ }
+ SDL_ShadowSurface = SDL_CreateRGBSurface(SDL_SWSURFACE,
+ SDL_VideoSurface->w, SDL_VideoSurface->h,
+ depth, Rmask, Gmask, Bmask, 0);
+ if ( SDL_ShadowSurface == NULL ) {
+ return;
+ }
+
+ /* 8-bit shadow surfaces report that they have exclusive palette */
+ if ( SDL_ShadowSurface->format->palette ) {
+ SDL_ShadowSurface->flags |= SDL_HWPALETTE;
+ if ( depth == (SDL_VideoSurface->format)->BitsPerPixel ) {
+ SDL_memcpy(SDL_ShadowSurface->format->palette->colors,
+ SDL_VideoSurface->format->palette->colors,
+ SDL_VideoSurface->format->palette->ncolors*
+ sizeof(SDL_Color));
+ } else {
+ SDL_DitherColors(
+ SDL_ShadowSurface->format->palette->colors, depth);
+ }
+ }
+
+ /* If the video surface is resizable, the shadow should say so */
+ if ( (SDL_VideoSurface->flags & SDL_RESIZABLE) == SDL_RESIZABLE ) {
+ SDL_ShadowSurface->flags |= SDL_RESIZABLE;
+ }
+ /* If the video surface has no frame, the shadow should say so */
+ if ( (SDL_VideoSurface->flags & SDL_NOFRAME) == SDL_NOFRAME ) {
+ SDL_ShadowSurface->flags |= SDL_NOFRAME;
+ }
+ /* If the video surface is fullscreen, the shadow should say so */
+ if ( (SDL_VideoSurface->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
+ SDL_ShadowSurface->flags |= SDL_FULLSCREEN;
+ }
+ /* If the video surface is flippable, the shadow should say so */
+ if ( (SDL_VideoSurface->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
+ SDL_ShadowSurface->flags |= SDL_DOUBLEBUF;
+ }
+ return;
+}
+
+#ifdef __QNXNTO__
+ #include <sys/neutrino.h>
+#endif /* __QNXNTO__ */
+
+#ifdef WIN32
+ extern int sysevents_mouse_pressed;
+#endif
+
+/*
+ * Set the requested video mode, allocating a shadow buffer if necessary.
+ */
+SDL_Surface * SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags)
+{
+ SDL_VideoDevice *video, *this;
+ SDL_Surface *prev_mode, *mode;
+ int video_w;
+ int video_h;
+ int video_bpp;
+ int is_opengl;
+ SDL_GrabMode saved_grab;
+
+ #ifdef WIN32
+ sysevents_mouse_pressed = 0;
+ #endif
+
+ /* Start up the video driver, if necessary..
+ WARNING: This is the only function protected this way!
+ */
+ if ( ! current_video ) {
+ if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE) < 0 ) {
+ return(NULL);
+ }
+ }
+ this = video = current_video;
+
+ /* Default to the current width and height */
+ if ( width == 0 ) {
+ width = video->info.current_w;
+ }
+ if ( height == 0 ) {
+ height = video->info.current_h;
+ }
+ /* Default to the current video bpp */
+ if ( bpp == 0 ) {
+ flags |= SDL_ANYFORMAT;
+ bpp = SDL_VideoSurface->format->BitsPerPixel;
+ }
+
+ /* Get a good video mode, the closest one possible */
+ video_w = width;
+ video_h = height;
+ video_bpp = bpp;
+ if ( ! SDL_GetVideoMode(&video_w, &video_h, &video_bpp, flags) ) {
+ return(NULL);
+ }
+
+ /* Check the requested flags */
+ /* There's no palette in > 8 bits-per-pixel mode */
+ if ( video_bpp > 8 ) {
+ flags &= ~SDL_HWPALETTE;
+ }
+#if 0
+ if ( (flags&SDL_FULLSCREEN) != SDL_FULLSCREEN ) {
+ /* There's no windowed double-buffering */
+ flags &= ~SDL_DOUBLEBUF;
+ }
+#endif
+ if ( (flags&SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
+ /* Use hardware surfaces when double-buffering */
+ flags |= SDL_HWSURFACE;
+ }
+
+ is_opengl = ( ( flags & SDL_OPENGL ) == SDL_OPENGL );
+ if ( is_opengl ) {
+ /* These flags are for 2D video modes only */
+ flags &= ~(SDL_HWSURFACE|SDL_DOUBLEBUF);
+ }
+
+ /* Reset the keyboard here so event callbacks can run */
+ SDL_ResetKeyboard();
+ SDL_ResetMouse();
+ SDL_SetMouseRange(width, height);
+ SDL_cursorstate &= ~CURSOR_USINGSW;
+
+ /* Clean up any previous video mode */
+ if ( SDL_PublicSurface != NULL ) {
+ SDL_PublicSurface = NULL;
+ }
+ if ( SDL_ShadowSurface != NULL ) {
+ SDL_Surface *ready_to_go;
+ ready_to_go = SDL_ShadowSurface;
+ SDL_ShadowSurface = NULL;
+ SDL_FreeSurface(ready_to_go);
+ }
+ if ( video->physpal ) {
+ SDL_free(video->physpal->colors);
+ SDL_free(video->physpal);
+ video->physpal = NULL;
+ }
+ if( video->gammacols) {
+ SDL_free(video->gammacols);
+ video->gammacols = NULL;
+ }
+
+ /* Save the previous grab state and turn off grab for mode switch */
+ saved_grab = SDL_WM_GrabInputOff();
+
+ /* Try to set the video mode, along with offset and clipping */
+ prev_mode = SDL_VideoSurface;
+ SDL_LockCursor();
+ SDL_VideoSurface = NULL; /* In case it's freed by driver */
+ mode = video->SetVideoMode(this, prev_mode,video_w,video_h,video_bpp,flags);
+ if ( mode ) { /* Prevent resize events from mode change */
+ /* But not on OS/2 */
+#ifndef __OS2__
+ SDL_PrivateResize(mode->w, mode->h);
+#endif
+
+ /* Sam - If we asked for OpenGL mode, and didn't get it, fail */
+ if ( is_opengl && !(mode->flags & SDL_OPENGL) ) {
+ mode = NULL;
+ SDL_SetError("OpenGL not available");
+ }
+ }
+ /*
+ * rcg11292000
+ * If you try to set an SDL_OPENGL surface, and fail to find a
+ * matching visual, then the next call to SDL_SetVideoMode()
+ * will segfault, since we no longer point to a dummy surface,
+ * but rather NULL.
+ * Sam 11/29/00
+ * WARNING, we need to make sure that the previous mode hasn't
+ * already been freed by the video driver. What do we do in
+ * that case? Should we call SDL_VideoInit() again?
+ */
+ SDL_VideoSurface = (mode != NULL) ? mode : prev_mode;
+
+ if ( (mode != NULL) && (!is_opengl) ) {
+ /* Sanity check */
+ if ( (mode->w < width) || (mode->h < height) ) {
+ SDL_SetError("Video mode smaller than requested");
+ return(NULL);
+ }
+
+ /* If we have a palettized surface, create a default palette */
+ if ( mode->format->palette ) {
+ SDL_PixelFormat *vf = mode->format;
+ SDL_DitherColors(vf->palette->colors, vf->BitsPerPixel);
+ video->SetColors(this, 0, vf->palette->ncolors,
+ vf->palette->colors);
+ }
+
+ /* Clear the surface to black */
+ video->offset_x = 0;
+ video->offset_y = 0;
+ mode->offset = 0;
+ SDL_SetClipRect(mode, NULL);
+ SDL_ClearSurface(mode);
+
+ /* Now adjust the offsets to match the desired mode */
+ video->offset_x = (mode->w-width)/2;
+ video->offset_y = (mode->h-height)/2;
+ mode->offset = video->offset_y*mode->pitch +
+ video->offset_x*mode->format->BytesPerPixel;
+#ifdef DEBUG_VIDEO
+ fprintf(stderr,
+ "Requested mode: %dx%dx%d, obtained mode %dx%dx%d (offset %d)\n",
+ width, height, bpp,
+ mode->w, mode->h, mode->format->BitsPerPixel, mode->offset);
+#endif
+ mode->w = width;
+ mode->h = height;
+ SDL_SetClipRect(mode, NULL);
+ }
+ SDL_ResetCursor();
+ SDL_UnlockCursor();
+
+ /* If we failed setting a video mode, return NULL... (Uh Oh!) */
+ if ( mode == NULL ) {
+ return(NULL);
+ }
+
+ /* If there is no window manager, set the SDL_NOFRAME flag */
+ if ( ! video->info.wm_available ) {
+ mode->flags |= SDL_NOFRAME;
+ }
+
+ /* Reset the mouse cursor and grab for new video mode */
+ SDL_SetCursor(NULL);
+ if ( video->UpdateMouse ) {
+ video->UpdateMouse(this);
+ }
+ SDL_WM_GrabInput(saved_grab);
+ SDL_GetRelativeMouseState(NULL, NULL); /* Clear first large delta */
+
+#if SDL_VIDEO_OPENGL
+ /* Load GL symbols (before MakeCurrent, where we need glGetString). */
+ if ( flags & (SDL_OPENGL | SDL_OPENGLBLIT) ) {
+
+#if defined(__QNXNTO__) && (_NTO_VERSION < 630)
+#define __SDL_NOGETPROCADDR__
+#elif defined(__MINT__)
+#define __SDL_NOGETPROCADDR__
+#endif
+#ifdef __SDL_NOGETPROCADDR__
+ #define SDL_PROC(ret,func,params) video->func=func;
+#else
+ #define SDL_PROC(ret,func,params) \
+ do { \
+ video->func = SDL_GL_GetProcAddress(#func); \
+ if ( ! video->func ) { \
+ SDL_SetError("Couldn't load GL function %s: %s\n", #func, SDL_GetError()); \
+ return(NULL); \
+ } \
+ } while ( 0 );
+
+#endif /* __SDL_NOGETPROCADDR__ */
+
+#include "SDL_glfuncs.h"
+#undef SDL_PROC
+ }
+#endif /* SDL_VIDEO_OPENGL */
+
+ /* If we're running OpenGL, make the context current */
+ if ( (video->screen->flags & SDL_OPENGL) &&
+ video->GL_MakeCurrent ) {
+ if ( video->GL_MakeCurrent(this) < 0 ) {
+ return(NULL);
+ }
+ }
+
+ /* Set up a fake SDL surface for OpenGL "blitting" */
+ if ( (flags & SDL_OPENGLBLIT) == SDL_OPENGLBLIT ) {
+ /* Load GL functions for performing the texture updates */
+#if SDL_VIDEO_OPENGL
+
+ /* Create a software surface for blitting */
+#ifdef GL_VERSION_1_2
+ /* If the implementation either supports the packed pixels
+ extension, or implements the core OpenGL 1.2 API, it will
+ support the GL_UNSIGNED_SHORT_5_6_5 texture format.
+ */
+ if ( (bpp == 16) &&
+ (SDL_strstr((const char *)video->glGetString(GL_EXTENSIONS), "GL_EXT_packed_pixels") ||
+ (SDL_atof((const char *)video->glGetString(GL_VERSION)) >= 1.2f))
+ ) {
+ video->is_32bit = 0;
+ SDL_VideoSurface = SDL_CreateRGBSurface(
+ flags,
+ width,
+ height,
+ 16,
+ 31 << 11,
+ 63 << 5,
+ 31,
+ 0
+ );
+ }
+ else
+#endif /* OpenGL 1.2 */
+ {
+ video->is_32bit = 1;
+ SDL_VideoSurface = SDL_CreateRGBSurface(
+ flags,
+ width,
+ height,
+ 32,
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+ 0x000000FF,
+ 0x0000FF00,
+ 0x00FF0000,
+ 0xFF000000
+#else
+ 0xFF000000,
+ 0x00FF0000,
+ 0x0000FF00,
+ 0x000000FF
+#endif
+ );
+ }
+ if ( ! SDL_VideoSurface ) {
+ return(NULL);
+ }
+ SDL_VideoSurface->flags = mode->flags | SDL_OPENGLBLIT;
+
+ /* Free the original video mode surface (is this safe?) */
+ SDL_FreeSurface(mode);
+
+ /* Set the surface completely opaque & white by default */
+ SDL_memset( SDL_VideoSurface->pixels, 255, SDL_VideoSurface->h * SDL_VideoSurface->pitch );
+ video->glGenTextures( 1, &video->texture );
+ video->glBindTexture( GL_TEXTURE_2D, video->texture );
+ video->glTexImage2D(
+ GL_TEXTURE_2D,
+ 0,
+ video->is_32bit ? GL_RGBA : GL_RGB,
+ 256,
+ 256,
+ 0,
+ video->is_32bit ? GL_RGBA : GL_RGB,
+#ifdef GL_VERSION_1_2
+ video->is_32bit ? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT_5_6_5,
+#else
+ GL_UNSIGNED_BYTE,
+#endif
+ NULL);
+
+ video->UpdateRects = SDL_GL_UpdateRectsLock;
+#else
+ SDL_SetError("Somebody forgot to #define SDL_VIDEO_OPENGL");
+ return(NULL);
+#endif
+ }
+
+ /* Create a shadow surface if necessary */
+ /* There are three conditions under which we create a shadow surface:
+ 1. We need a particular bits-per-pixel that we didn't get.
+ 2. We need a hardware palette and didn't get one.
+ 3. We need a software surface and got a hardware surface.
+ */
+ if ( !(SDL_VideoSurface->flags & SDL_OPENGL) &&
+ (
+ ( !(flags&SDL_ANYFORMAT) &&
+ (SDL_VideoSurface->format->BitsPerPixel != bpp)) ||
+ ( (flags&SDL_HWPALETTE) &&
+ !(SDL_VideoSurface->flags&SDL_HWPALETTE)) ||
+ /* If the surface is in hardware, video writes are visible
+ as soon as they are performed, so we need to buffer them
+ */
+ ( ((flags&SDL_HWSURFACE) == SDL_SWSURFACE) &&
+ (SDL_VideoSurface->flags&SDL_HWSURFACE)) ||
+ ( (flags&SDL_DOUBLEBUF) &&
+ (SDL_VideoSurface->flags&SDL_HWSURFACE) &&
+ !(SDL_VideoSurface->flags&SDL_DOUBLEBUF))
+ ) ) {
+ SDL_CreateShadowSurface(bpp);
+ if ( SDL_ShadowSurface == NULL ) {
+ SDL_SetError("Couldn't create shadow surface");
+ return(NULL);
+ }
+ SDL_PublicSurface = SDL_ShadowSurface;
+ } else {
+ SDL_PublicSurface = SDL_VideoSurface;
+ }
+ video->info.vfmt = SDL_VideoSurface->format;
+ video->info.current_w = SDL_VideoSurface->w;
+ video->info.current_h = SDL_VideoSurface->h;
+
+ /* We're done! */
+ return(SDL_PublicSurface);
+}
+
+/*
+ * Convert a surface into the video pixel format.
+ */
+SDL_Surface * SDL_DisplayFormat (SDL_Surface *surface)
+{
+ Uint32 flags;
+
+ if ( ! SDL_PublicSurface ) {
+ SDL_SetError("No video mode has been set");
+ return(NULL);
+ }
+ /* Set the flags appropriate for copying to display surface */
+ if (((SDL_PublicSurface->flags&SDL_HWSURFACE) == SDL_HWSURFACE) && current_video->info.blit_hw)
+ flags = SDL_HWSURFACE;
+ else
+ flags = SDL_SWSURFACE;
+#ifdef AUTORLE_DISPLAYFORMAT
+ flags |= (surface->flags & (SDL_SRCCOLORKEY|SDL_SRCALPHA));
+ flags |= SDL_RLEACCELOK;
+#else
+ flags |= surface->flags & (SDL_SRCCOLORKEY|SDL_SRCALPHA|SDL_RLEACCELOK);
+#endif
+ return(SDL_ConvertSurface(surface, SDL_PublicSurface->format, flags));
+}
+
+/*
+ * Convert a surface into a format that's suitable for blitting to
+ * the screen, but including an alpha channel.
+ */
+SDL_Surface *SDL_DisplayFormatAlpha(SDL_Surface *surface)
+{
+ SDL_PixelFormat *vf;
+ SDL_PixelFormat *format;
+ SDL_Surface *converted;
+ Uint32 flags;
+ /* default to ARGB8888 */
+ Uint32 amask = 0xff000000;
+ Uint32 rmask = 0x00ff0000;
+ Uint32 gmask = 0x0000ff00;
+ Uint32 bmask = 0x000000ff;
+
+ if ( ! SDL_PublicSurface ) {
+ SDL_SetError("No video mode has been set");
+ return(NULL);
+ }
+ vf = SDL_PublicSurface->format;
+
+ switch(vf->BytesPerPixel) {
+ case 2:
+ /* For XGY5[56]5, use, AXGY8888, where {X, Y} = {R, B}.
+ For anything else (like ARGB4444) it doesn't matter
+ since we have no special code for it anyway */
+ if ( (vf->Rmask == 0x1f) &&
+ (vf->Bmask == 0xf800 || vf->Bmask == 0x7c00)) {
+ rmask = 0xff;
+ bmask = 0xff0000;
+ }
+ break;
+
+ case 3:
+ case 4:
+ /* Keep the video format, as long as the high 8 bits are
+ unused or alpha */
+ if ( (vf->Rmask == 0xff) && (vf->Bmask == 0xff0000) ) {
+ rmask = 0xff;
+ bmask = 0xff0000;
+ } else if ( vf->Rmask == 0xFF00 && (vf->Bmask == 0xFF000000) ) {
+ amask = 0x000000FF;
+ rmask = 0x0000FF00;
+ gmask = 0x00FF0000;
+ bmask = 0xFF000000;
+ }
+ break;
+
+ default:
+ /* We have no other optimised formats right now. When/if a new
+ optimised alpha format is written, add the converter here */
+ break;
+ }
+ format = SDL_AllocFormat(32, rmask, gmask, bmask, amask);
+ flags = SDL_PublicSurface->flags & SDL_HWSURFACE;
+ flags |= surface->flags & (SDL_SRCALPHA | SDL_RLEACCELOK);
+ converted = SDL_ConvertSurface(surface, format, flags);
+ SDL_FreeFormat(format);
+ return(converted);
+}
+
+/*
+ * Update a specific portion of the physical screen
+ */
+void SDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h)
+{
+ if ( screen ) {
+ SDL_Rect rect;
+
+ /* Perform some checking */
+ if ( w == 0 )
+ w = screen->w;
+ if ( h == 0 )
+ h = screen->h;
+ if ( (int)(x+w) > screen->w )
+ return;
+ if ( (int)(y+h) > screen->h )
+ return;
+
+ /* Fill the rectangle */
+ rect.x = (Sint16)x;
+ rect.y = (Sint16)y;
+ rect.w = (Uint16)w;
+ rect.h = (Uint16)h;
+ SDL_UpdateRects(screen, 1, &rect);
+ }
+}
+void SDL_UpdateRects (SDL_Surface *screen, int numrects, SDL_Rect *rects)
+{
+ int i;
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+
+ if ( (screen->flags & (SDL_OPENGL | SDL_OPENGLBLIT)) == SDL_OPENGL ) {
+ SDL_SetError("OpenGL active, use SDL_GL_SwapBuffers()");
+ return;
+ }
+ if ( screen == SDL_ShadowSurface ) {
+ /* Blit the shadow surface using saved mapping */
+ SDL_Palette *pal = screen->format->palette;
+ SDL_Color *saved_colors = NULL;
+ if ( pal && !(SDL_VideoSurface->flags & SDL_HWPALETTE) ) {
+ /* simulated 8bpp, use correct physical palette */
+ saved_colors = pal->colors;
+ if ( video->gammacols ) {
+ /* gamma-corrected palette */
+ pal->colors = video->gammacols;
+ } else if ( video->physpal ) {
+ /* physical palette different from logical */
+ pal->colors = video->physpal->colors;
+ }
+ }
+ if ( SHOULD_DRAWCURSOR(SDL_cursorstate) ) {
+ SDL_LockCursor();
+ SDL_DrawCursor(SDL_ShadowSurface);
+ for ( i=0; i<numrects; ++i ) {
+ SDL_LowerBlit(SDL_ShadowSurface, &rects[i],
+ SDL_VideoSurface, &rects[i]);
+ }
+ SDL_EraseCursor(SDL_ShadowSurface);
+ SDL_UnlockCursor();
+ } else {
+ for ( i=0; i<numrects; ++i ) {
+ SDL_LowerBlit(SDL_ShadowSurface, &rects[i],
+ SDL_VideoSurface, &rects[i]);
+ }
+ }
+ if ( saved_colors ) {
+ pal->colors = saved_colors;
+ }
+
+ /* Fall through to video surface update */
+ screen = SDL_VideoSurface;
+ }
+ if ( screen == SDL_VideoSurface ) {
+ /* Update the video surface */
+ if ( screen->offset ) {
+ for ( i=0; i<numrects; ++i ) {
+ rects[i].x += video->offset_x;
+ rects[i].y += video->offset_y;
+ }
+ video->UpdateRects(this, numrects, rects);
+ for ( i=0; i<numrects; ++i ) {
+ rects[i].x -= video->offset_x;
+ rects[i].y -= video->offset_y;
+ }
+ } else {
+ video->UpdateRects(this, numrects, rects);
+ }
+ }
+}
+
+/*
+ * Performs hardware double buffering, if possible, or a full update if not.
+ */
+int SDL_Flip(SDL_Surface *screen)
+{
+ SDL_VideoDevice *video = current_video;
+ /* Copy the shadow surface to the video surface */
+ if ( screen == SDL_ShadowSurface ) {
+ SDL_Rect rect;
+ SDL_Palette *pal = screen->format->palette;
+ SDL_Color *saved_colors = NULL;
+ if ( pal && !(SDL_VideoSurface->flags & SDL_HWPALETTE) ) {
+ /* simulated 8bpp, use correct physical palette */
+ saved_colors = pal->colors;
+ if ( video->gammacols ) {
+ /* gamma-corrected palette */
+ pal->colors = video->gammacols;
+ } else if ( video->physpal ) {
+ /* physical palette different from logical */
+ pal->colors = video->physpal->colors;
+ }
+ }
+
+ rect.x = 0;
+ rect.y = 0;
+ rect.w = screen->w;
+ rect.h = screen->h;
+ if ( SHOULD_DRAWCURSOR(SDL_cursorstate) ) {
+ SDL_LockCursor();
+ SDL_DrawCursor(SDL_ShadowSurface);
+ SDL_LowerBlit(SDL_ShadowSurface, &rect,
+ SDL_VideoSurface, &rect);
+ SDL_EraseCursor(SDL_ShadowSurface);
+ SDL_UnlockCursor();
+ } else {
+ SDL_LowerBlit(SDL_ShadowSurface, &rect,
+ SDL_VideoSurface, &rect);
+ }
+ if ( saved_colors ) {
+ pal->colors = saved_colors;
+ }
+
+ /* Fall through to video surface update */
+ screen = SDL_VideoSurface;
+ }
+ if ( (screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
+ SDL_VideoDevice *this = current_video;
+ return(video->FlipHWSurface(this, SDL_VideoSurface));
+ } else {
+ SDL_UpdateRect(screen, 0, 0, 0, 0);
+ }
+ return(0);
+}
+
+static void SetPalette_logical(SDL_Surface *screen, SDL_Color *colors,
+ int firstcolor, int ncolors)
+{
+ SDL_Palette *pal = screen->format->palette;
+ SDL_Palette *vidpal;
+
+ if ( colors != (pal->colors + firstcolor) ) {
+ SDL_memcpy(pal->colors + firstcolor, colors,
+ ncolors * sizeof(*colors));
+ }
+
+ if ( current_video && SDL_VideoSurface ) {
+ vidpal = SDL_VideoSurface->format->palette;
+ if ( (screen == SDL_ShadowSurface) && vidpal ) {
+ /*
+ * This is a shadow surface, and the physical
+ * framebuffer is also indexed. Propagate the
+ * changes to its logical palette so that
+ * updates are always identity blits
+ */
+ SDL_memcpy(vidpal->colors + firstcolor, colors,
+ ncolors * sizeof(*colors));
+ }
+ }
+ SDL_FormatChanged(screen);
+}
+
+static int SetPalette_physical(SDL_Surface *screen,
+ SDL_Color *colors, int firstcolor, int ncolors)
+{
+ SDL_VideoDevice *video = current_video;
+ int gotall = 1;
+
+ if ( video->physpal ) {
+ /* We need to copy the new colors, since we haven't
+ * already done the copy in the logical set above.
+ */
+ SDL_memcpy(video->physpal->colors + firstcolor,
+ colors, ncolors * sizeof(*colors));
+ }
+ if ( screen == SDL_ShadowSurface ) {
+ if ( SDL_VideoSurface->flags & SDL_HWPALETTE ) {
+ /*
+ * The real screen is also indexed - set its physical
+ * palette. The physical palette does not include the
+ * gamma modification, we apply it directly instead,
+ * but this only happens if we have hardware palette.
+ */
+ screen = SDL_VideoSurface;
+ } else {
+ /*
+ * The video surface is not indexed - invalidate any
+ * active shadow-to-video blit mappings.
+ */
+ if ( screen->map->dst == SDL_VideoSurface ) {
+ SDL_InvalidateMap(screen->map);
+ }
+ if ( video->gamma ) {
+ if( ! video->gammacols ) {
+ SDL_Palette *pp = video->physpal;
+ if(!pp)
+ pp = screen->format->palette;
+ video->gammacols = SDL_malloc(pp->ncolors
+ * sizeof(SDL_Color));
+ SDL_ApplyGamma(video->gamma,
+ pp->colors,
+ video->gammacols,
+ pp->ncolors);
+ } else {
+ SDL_ApplyGamma(video->gamma, colors,
+ video->gammacols
+ + firstcolor,
+ ncolors);
+ }
+ }
+ SDL_UpdateRect(screen, 0, 0, 0, 0);
+ }
+ }
+
+ if ( screen == SDL_VideoSurface ) {
+ SDL_Color gcolors[256];
+
+ if ( video->gamma ) {
+ SDL_ApplyGamma(video->gamma, colors, gcolors, ncolors);
+ colors = gcolors;
+ }
+ gotall = video->SetColors(video, firstcolor, ncolors, colors);
+ if ( ! gotall ) {
+ /* The video flags shouldn't have SDL_HWPALETTE, and
+ the video driver is responsible for copying back the
+ correct colors into the video surface palette.
+ */
+ ;
+ }
+ SDL_CursorPaletteChanged();
+ }
+ return gotall;
+}
+
+/*
+ * Set the physical and/or logical colormap of a surface:
+ * Only the screen has a physical colormap. It determines what is actually
+ * sent to the display.
+ * The logical colormap is used to map blits to/from the surface.
+ * 'which' is one or both of SDL_LOGPAL, SDL_PHYSPAL
+ *
+ * Return nonzero if all colours were set as requested, or 0 otherwise.
+ */
+int SDL_SetPalette(SDL_Surface *screen, int which,
+ SDL_Color *colors, int firstcolor, int ncolors)
+{
+ SDL_Palette *pal;
+ int gotall;
+ int palsize;
+
+ if ( !screen ) {
+ return 0;
+ }
+ if ( !current_video || screen != SDL_PublicSurface ) {
+ /* only screens have physical palettes */
+ which &= ~SDL_PHYSPAL;
+ } else if ( (screen->flags & SDL_HWPALETTE) != SDL_HWPALETTE ) {
+ /* hardware palettes required for split colormaps */
+ which |= SDL_PHYSPAL | SDL_LOGPAL;
+ }
+
+ /* Verify the parameters */
+ pal = screen->format->palette;
+ if( !pal ) {
+ return 0; /* not a palettized surface */
+ }
+ gotall = 1;
+ palsize = 1 << screen->format->BitsPerPixel;
+ if ( ncolors > (palsize - firstcolor) ) {
+ ncolors = (palsize - firstcolor);
+ gotall = 0;
+ }
+
+ if ( which & SDL_LOGPAL ) {
+ /*
+ * Logical palette change: The actual screen isn't affected,
+ * but the internal colormap is altered so that the
+ * interpretation of the pixel values (for blits etc) is
+ * changed.
+ */
+ SetPalette_logical(screen, colors, firstcolor, ncolors);
+ }
+ if ( which & SDL_PHYSPAL ) {
+ SDL_VideoDevice *video = current_video;
+ /*
+ * Physical palette change: This doesn't affect the
+ * program's idea of what the screen looks like, but changes
+ * its actual appearance.
+ */
+ if ( !video->physpal && !(which & SDL_LOGPAL) ) {
+ /* Lazy physical palette allocation */
+ int size;
+ SDL_Palette *pp = SDL_malloc(sizeof(*pp));
+ if ( !pp ) {
+ return 0;
+ }
+ video->physpal = pp;
+ pp->ncolors = pal->ncolors;
+ size = pp->ncolors * sizeof(SDL_Color);
+ pp->colors = SDL_malloc(size);
+ if ( !pp->colors ) {
+ return 0;
+ }
+ SDL_memcpy(pp->colors, pal->colors, size);
+ }
+ if ( ! SetPalette_physical(screen,
+ colors, firstcolor, ncolors) ) {
+ gotall = 0;
+ }
+ }
+ return gotall;
+}
+
+int SDL_SetColors(SDL_Surface *screen, SDL_Color *colors, int firstcolor,
+ int ncolors)
+{
+ return SDL_SetPalette(screen, SDL_LOGPAL | SDL_PHYSPAL,
+ colors, firstcolor, ncolors);
+}
+
+/*
+ * Clean up the video subsystem
+ */
+void SDL_VideoQuit (void)
+{
+ SDL_Surface *ready_to_go;
+
+ if ( current_video ) {
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+
+ /* Halt event processing before doing anything else */
+ SDL_StopEventLoop();
+
+ /* Clean up allocated window manager items */
+ if ( SDL_PublicSurface ) {
+ SDL_PublicSurface = NULL;
+ }
+ SDL_CursorQuit();
+
+ /* Just in case... */
+ SDL_WM_GrabInputOff();
+
+ /* Clean up the system video */
+ video->VideoQuit(this);
+
+ /* Free any lingering surfaces */
+ ready_to_go = SDL_ShadowSurface;
+ SDL_ShadowSurface = NULL;
+ SDL_FreeSurface(ready_to_go);
+ if ( SDL_VideoSurface != NULL ) {
+ ready_to_go = SDL_VideoSurface;
+ SDL_VideoSurface = NULL;
+ SDL_FreeSurface(ready_to_go);
+ }
+ SDL_PublicSurface = NULL;
+
+ /* Clean up miscellaneous memory */
+ if ( video->physpal ) {
+ SDL_free(video->physpal->colors);
+ SDL_free(video->physpal);
+ video->physpal = NULL;
+ }
+ if ( video->gammacols ) {
+ SDL_free(video->gammacols);
+ video->gammacols = NULL;
+ }
+ if ( video->gamma ) {
+ SDL_free(video->gamma);
+ video->gamma = NULL;
+ }
+ if ( video->wm_title != NULL ) {
+ SDL_free(video->wm_title);
+ video->wm_title = NULL;
+ }
+ if ( video->wm_icon != NULL ) {
+ SDL_free(video->wm_icon);
+ video->wm_icon = NULL;
+ }
+
+ /* Finish cleaning up video subsystem */
+ video->free(this);
+ current_video = NULL;
+ }
+ return;
+}
+
+/* Load the GL driver library */
+int SDL_GL_LoadLibrary(const char *path)
+{
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+ int retval;
+
+ retval = -1;
+ if ( video == NULL ) {
+ SDL_SetError("Video subsystem has not been initialized");
+ } else {
+ if ( video->GL_LoadLibrary ) {
+ retval = video->GL_LoadLibrary(this, path);
+ } else {
+ SDL_SetError("No dynamic GL support in video driver");
+ }
+ }
+ return(retval);
+}
+
+void *SDL_GL_GetProcAddress(const char* proc)
+{
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+ void *func;
+
+ func = NULL;
+ if ( video->GL_GetProcAddress ) {
+ if ( video->gl_config.driver_loaded ) {
+ func = video->GL_GetProcAddress(this, proc);
+ } else {
+ SDL_SetError("No GL driver has been loaded");
+ }
+ } else {
+ SDL_SetError("No dynamic GL support in video driver");
+ }
+ return func;
+}
+
+/* Set the specified GL attribute for setting up a GL video mode */
+int SDL_GL_SetAttribute( SDL_GLattr attr, int value )
+{
+ int retval;
+ SDL_VideoDevice *video = current_video;
+
+ retval = 0;
+ switch (attr) {
+ case SDL_GL_RED_SIZE:
+ video->gl_config.red_size = value;
+ break;
+ case SDL_GL_GREEN_SIZE:
+ video->gl_config.green_size = value;
+ break;
+ case SDL_GL_BLUE_SIZE:
+ video->gl_config.blue_size = value;
+ break;
+ case SDL_GL_ALPHA_SIZE:
+ video->gl_config.alpha_size = value;
+ break;
+ case SDL_GL_DOUBLEBUFFER:
+ video->gl_config.double_buffer = value;
+ break;
+ case SDL_GL_BUFFER_SIZE:
+ video->gl_config.buffer_size = value;
+ break;
+ case SDL_GL_DEPTH_SIZE:
+ video->gl_config.depth_size = value;
+ break;
+ case SDL_GL_STENCIL_SIZE:
+ video->gl_config.stencil_size = value;
+ break;
+ case SDL_GL_ACCUM_RED_SIZE:
+ video->gl_config.accum_red_size = value;
+ break;
+ case SDL_GL_ACCUM_GREEN_SIZE:
+ video->gl_config.accum_green_size = value;
+ break;
+ case SDL_GL_ACCUM_BLUE_SIZE:
+ video->gl_config.accum_blue_size = value;
+ break;
+ case SDL_GL_ACCUM_ALPHA_SIZE:
+ video->gl_config.accum_alpha_size = value;
+ break;
+ case SDL_GL_STEREO:
+ video->gl_config.stereo = value;
+ break;
+ case SDL_GL_MULTISAMPLEBUFFERS:
+ video->gl_config.multisamplebuffers = value;
+ break;
+ case SDL_GL_MULTISAMPLESAMPLES:
+ video->gl_config.multisamplesamples = value;
+ break;
+ case SDL_GL_ACCELERATED_VISUAL:
+ video->gl_config.accelerated = value;
+ break;
+ case SDL_GL_SWAP_CONTROL:
+ video->gl_config.swap_control = value;
+ break;
+ default:
+ SDL_SetError("Unknown OpenGL attribute");
+ retval = -1;
+ break;
+ }
+ return(retval);
+}
+
+/* Retrieve an attribute value from the windowing system. */
+int SDL_GL_GetAttribute(SDL_GLattr attr, int* value)
+{
+ int retval = -1;
+ SDL_VideoDevice* video = current_video;
+ SDL_VideoDevice* this = current_video;
+
+ if ( video->GL_GetAttribute ) {
+ retval = this->GL_GetAttribute(this, attr, value);
+ } else {
+ *value = 0;
+ SDL_SetError("GL_GetAttribute not supported");
+ }
+ return retval;
+}
+
+/* Perform a GL buffer swap on the current GL context */
+void SDL_GL_SwapBuffers(void)
+{
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+
+ if ( video->screen->flags & SDL_OPENGL ) {
+ video->GL_SwapBuffers(this);
+ } else {
+ SDL_SetError("OpenGL video mode has not been set");
+ }
+}
+
+/* Update rects with locking */
+void SDL_GL_UpdateRectsLock(SDL_VideoDevice* this, int numrects, SDL_Rect *rects)
+{
+ SDL_GL_Lock();
+ SDL_GL_UpdateRects(numrects, rects);
+ SDL_GL_Unlock();
+}
+
+/* Update rects without state setting and changing (the caller is responsible for it) */
+void SDL_GL_UpdateRects(int numrects, SDL_Rect *rects)
+{
+#if SDL_VIDEO_OPENGL
+ SDL_VideoDevice *this = current_video;
+ SDL_Rect update, tmp;
+ int x, y, i;
+
+ for ( i = 0; i < numrects; i++ )
+ {
+ tmp.y = rects[i].y;
+ tmp.h = rects[i].h;
+ for ( y = 0; y <= rects[i].h / 256; y++ )
+ {
+ tmp.x = rects[i].x;
+ tmp.w = rects[i].w;
+ for ( x = 0; x <= rects[i].w / 256; x++ )
+ {
+ update.x = tmp.x;
+ update.y = tmp.y;
+ update.w = tmp.w;
+ update.h = tmp.h;
+
+ if ( update.w > 256 )
+ update.w = 256;
+
+ if ( update.h > 256 )
+ update.h = 256;
+
+ this->glFlush();
+ this->glTexSubImage2D(
+ GL_TEXTURE_2D,
+ 0,
+ 0,
+ 0,
+ update.w,
+ update.h,
+ this->is_32bit? GL_RGBA : GL_RGB,
+#ifdef GL_VERSION_1_2
+ this->is_32bit ? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT_5_6_5,
+#else
+ GL_UNSIGNED_BYTE,
+#endif
+ (Uint8 *)this->screen->pixels +
+ this->screen->format->BytesPerPixel * update.x +
+ update.y * this->screen->pitch );
+
+ this->glFlush();
+ /*
+ * Note the parens around the function name:
+ * This is because some OpenGL implementations define glTexCoord etc
+ * as macros, and we don't want them expanded here.
+ */
+ this->glBegin(GL_TRIANGLE_STRIP);
+ (this->glTexCoord2f)( 0.0, 0.0 );
+ (this->glVertex2i)( update.x, update.y );
+ (this->glTexCoord2f)( (float)(update.w / 256.0), 0.0 );
+ (this->glVertex2i)( update.x + update.w, update.y );
+ (this->glTexCoord2f)( 0.0, (float)(update.h / 256.0) );
+ (this->glVertex2i)( update.x, update.y + update.h );
+ (this->glTexCoord2f)( (float)(update.w / 256.0), (float)(update.h / 256.0) );
+ (this->glVertex2i)( update.x + update.w , update.y + update.h );
+ this->glEnd();
+
+ tmp.x += 256;
+ tmp.w -= 256;
+ }
+ tmp.y += 256;
+ tmp.h -= 256;
+ }
+ }
+#endif
+}
+
+/* Lock == save current state */
+void SDL_GL_Lock()
+{
+#if SDL_VIDEO_OPENGL
+ lock_count--;
+ if (lock_count==-1)
+ {
+ SDL_VideoDevice *this = current_video;
+
+ this->glPushAttrib( GL_ALL_ATTRIB_BITS ); /* TODO: narrow range of what is saved */
+#ifdef GL_CLIENT_PIXEL_STORE_BIT
+ this->glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT );
+#endif
+
+ this->glEnable(GL_TEXTURE_2D);
+ this->glEnable(GL_BLEND);
+ this->glDisable(GL_FOG);
+ this->glDisable(GL_ALPHA_TEST);
+ this->glDisable(GL_DEPTH_TEST);
+ this->glDisable(GL_SCISSOR_TEST);
+ this->glDisable(GL_STENCIL_TEST);
+ this->glDisable(GL_CULL_FACE);
+
+ this->glBindTexture( GL_TEXTURE_2D, this->texture );
+ this->glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
+ this->glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
+ this->glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
+ this->glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
+ this->glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
+
+ this->glPixelStorei( GL_UNPACK_ROW_LENGTH, this->screen->pitch / this->screen->format->BytesPerPixel );
+ this->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ (this->glColor4f)(1.0, 1.0, 1.0, 1.0); /* Solaris workaround */
+
+ this->glViewport(0, 0, this->screen->w, this->screen->h);
+ this->glMatrixMode(GL_PROJECTION);
+ this->glPushMatrix();
+ this->glLoadIdentity();
+
+ this->glOrtho(0.0, (GLdouble) this->screen->w, (GLdouble) this->screen->h, 0.0, 0.0, 1.0);
+
+ this->glMatrixMode(GL_MODELVIEW);
+ this->glPushMatrix();
+ this->glLoadIdentity();
+ }
+#endif
+}
+
+/* Unlock == restore saved state */
+void SDL_GL_Unlock()
+{
+#if SDL_VIDEO_OPENGL
+ lock_count++;
+ if (lock_count==0)
+ {
+ SDL_VideoDevice *this = current_video;
+
+ this->glPopMatrix();
+ this->glMatrixMode(GL_PROJECTION);
+ this->glPopMatrix();
+
+ this->glPopClientAttrib();
+ this->glPopAttrib();
+ }
+#endif
+}
+
+#if SDL_AUDIO_DRIVER_PULSE
+void SDL_Audio_SetCaption(const char *caption);
+#endif
+
+/*
+ * Sets/Gets the title and icon text of the display window, if any.
+ */
+void SDL_WM_SetCaption (const char *title, const char *icon)
+{
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+
+ if ( video ) {
+ if ( title ) {
+ if ( video->wm_title ) {
+ SDL_free(video->wm_title);
+ }
+ video->wm_title = SDL_strdup(title);
+ }
+ if ( icon ) {
+ if ( video->wm_icon ) {
+ SDL_free(video->wm_icon);
+ }
+ video->wm_icon = SDL_strdup(icon);
+ }
+ if ( (title || icon) && (video->SetCaption != NULL) ) {
+ video->SetCaption(this, video->wm_title,video->wm_icon);
+ }
+ }
+
+#if SDL_AUDIO_DRIVER_PULSE
+ /* PulseAudio can make use of this information. */
+ SDL_Audio_SetCaption(title);
+#endif
+}
+
+void SDL_WM_GetCaption (char **title, char **icon)
+{
+ SDL_VideoDevice *video = current_video;
+
+ if ( video ) {
+ if ( title ) {
+ *title = video->wm_title;
+ }
+ if ( icon ) {
+ *icon = video->wm_icon;
+ }
+ }
+}
+
+/* Utility function used by SDL_WM_SetIcon();
+ * flags & 1 for color key, flags & 2 for alpha channel. */
+static void CreateMaskFromColorKeyOrAlpha(SDL_Surface *icon, Uint8 *mask, int flags)
+{
+ int x, y;
+ Uint32 colorkey;
+#define SET_MASKBIT(icon, x, y, mask) \
+ mask[(y*((icon->w+7)/8))+(x/8)] &= ~(0x01<<(7-(x%8)))
+
+ colorkey = icon->format->colorkey;
+ switch (icon->format->BytesPerPixel) {
+ case 1: { Uint8 *pixels;
+ for ( y=0; y<icon->h; ++y ) {
+ pixels = (Uint8 *)icon->pixels + y*icon->pitch;
+ for ( x=0; x<icon->w; ++x ) {
+ if ( *pixels++ == colorkey ) {
+ SET_MASKBIT(icon, x, y, mask);
+ }
+ }
+ }
+ }
+ break;
+
+ case 2: { Uint16 *pixels;
+ for ( y=0; y<icon->h; ++y ) {
+ pixels = (Uint16 *)icon->pixels +
+ y*icon->pitch/2;
+ for ( x=0; x<icon->w; ++x ) {
+ if ( (flags & 1) && *pixels == colorkey ) {
+ SET_MASKBIT(icon, x, y, mask);
+ } else if((flags & 2) && (*pixels & icon->format->Amask) == 0) {
+ SET_MASKBIT(icon, x, y, mask);
+ }
+ pixels++;
+ }
+ }
+ }
+ break;
+
+ case 4: { Uint32 *pixels;
+ for ( y=0; y<icon->h; ++y ) {
+ pixels = (Uint32 *)icon->pixels +
+ y*icon->pitch/4;
+ for ( x=0; x<icon->w; ++x ) {
+ if ( (flags & 1) && *pixels == colorkey ) {
+ SET_MASKBIT(icon, x, y, mask);
+ } else if((flags & 2) && (*pixels & icon->format->Amask) == 0) {
+ SET_MASKBIT(icon, x, y, mask);
+ }
+ pixels++;
+ }
+ }
+ }
+ break;
+ }
+}
+
+/*
+ * Sets the window manager icon for the display window.
+ */
+void SDL_WM_SetIcon (SDL_Surface *icon, Uint8 *mask)
+{
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+
+ if ( icon && video->SetIcon ) {
+ /* Generate a mask if necessary, and create the icon! */
+ if ( mask == NULL ) {
+ int mask_len = icon->h*(icon->w+7)/8;
+ int flags = 0;
+ mask = (Uint8 *)SDL_malloc(mask_len);
+ if ( mask == NULL ) {
+ return;
+ }
+ SDL_memset(mask, ~0, mask_len);
+ if ( icon->flags & SDL_SRCCOLORKEY ) flags |= 1;
+ if ( icon->flags & SDL_SRCALPHA ) flags |= 2;
+ if( flags ) {
+ CreateMaskFromColorKeyOrAlpha(icon, mask, flags);
+ }
+ video->SetIcon(video, icon, mask);
+ SDL_free(mask);
+ } else {
+ video->SetIcon(this, icon, mask);
+ }
+ }
+}
+
+/*
+ * Grab or ungrab the keyboard and mouse input.
+ * This function returns the final grab mode after calling the
+ * driver dependent function.
+ */
+static SDL_GrabMode SDL_WM_GrabInputRaw(SDL_GrabMode mode)
+{
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+
+ /* Only do something if we have support for grabs */
+ if ( video->GrabInput == NULL ) {
+ return(video->input_grab);
+ }
+
+ /* If the final grab mode if off, only then do we actually grab */
+#ifdef DEBUG_GRAB
+ printf("SDL_WM_GrabInputRaw(%d) ... ", mode);
+#endif
+ if ( mode == SDL_GRAB_OFF ) {
+ if ( video->input_grab != SDL_GRAB_OFF ) {
+ mode = video->GrabInput(this, mode);
+ }
+ } else {
+ if ( video->input_grab == SDL_GRAB_OFF ) {
+ mode = video->GrabInput(this, mode);
+ }
+ }
+ if ( mode != video->input_grab ) {
+ video->input_grab = mode;
+ if ( video->CheckMouseMode ) {
+ video->CheckMouseMode(this);
+ }
+ }
+#ifdef DEBUG_GRAB
+ printf("Final mode %d\n", video->input_grab);
+#endif
+
+ /* Return the final grab state */
+ if ( mode >= SDL_GRAB_FULLSCREEN ) {
+ mode -= SDL_GRAB_FULLSCREEN;
+ }
+ return(mode);
+}
+SDL_GrabMode SDL_WM_GrabInput(SDL_GrabMode mode)
+{
+ SDL_VideoDevice *video = current_video;
+
+ /* If the video isn't initialized yet, we can't do anything */
+ if ( ! video ) {
+ return SDL_GRAB_OFF;
+ }
+
+ /* Return the current mode on query */
+ if ( mode == SDL_GRAB_QUERY ) {
+ mode = video->input_grab;
+ if ( mode >= SDL_GRAB_FULLSCREEN ) {
+ mode -= SDL_GRAB_FULLSCREEN;
+ }
+ return(mode);
+ }
+
+#ifdef DEBUG_GRAB
+ printf("SDL_WM_GrabInput(%d) ... ", mode);
+#endif
+ /* If the video surface is fullscreen, we always grab */
+ if ( mode >= SDL_GRAB_FULLSCREEN ) {
+ mode -= SDL_GRAB_FULLSCREEN;
+ }
+ if ( SDL_VideoSurface && (SDL_VideoSurface->flags & SDL_FULLSCREEN) ) {
+ mode += SDL_GRAB_FULLSCREEN;
+ }
+ return(SDL_WM_GrabInputRaw(mode));
+}
+static SDL_GrabMode SDL_WM_GrabInputOff(void)
+{
+ SDL_GrabMode mode;
+
+ /* First query the current grab state */
+ mode = SDL_WM_GrabInput(SDL_GRAB_QUERY);
+
+ /* Now explicitly turn off input grab */
+ SDL_WM_GrabInputRaw(SDL_GRAB_OFF);
+
+ /* Return the old state */
+ return(mode);
+}
+
+/*
+ * Iconify the window in window managed environments.
+ * A successful iconification will result in an SDL_APPACTIVE loss event.
+ */
+int SDL_WM_IconifyWindow(void)
+{
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+ int retval;
+
+ retval = 0;
+ if ( video->IconifyWindow ) {
+ retval = video->IconifyWindow(this);
+ }
+ return(retval);
+}
+
+/*
+ * Toggle fullscreen mode
+ */
+int SDL_WM_ToggleFullScreen(SDL_Surface *surface)
+{
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+ int toggled;
+
+ toggled = 0;
+ if ( SDL_PublicSurface && (surface == SDL_PublicSurface) &&
+ video->ToggleFullScreen ) {
+ if ( surface->flags & SDL_FULLSCREEN ) {
+ toggled = video->ToggleFullScreen(this, 0);
+ if ( toggled ) {
+ SDL_VideoSurface->flags &= ~SDL_FULLSCREEN;
+ SDL_PublicSurface->flags &= ~SDL_FULLSCREEN;
+ }
+ } else {
+ toggled = video->ToggleFullScreen(this, 1);
+ if ( toggled ) {
+ SDL_VideoSurface->flags |= SDL_FULLSCREEN;
+ SDL_PublicSurface->flags |= SDL_FULLSCREEN;
+ }
+ }
+ /* Double-check the grab state inside SDL_WM_GrabInput() */
+ if ( toggled ) {
+ SDL_WM_GrabInput(video->input_grab);
+ }
+ }
+ return(toggled);
+}
+
+/*
+ * Set window position
+ */
+void SDL_WM_SetPos(int x, int y)
+{
+ SDL_VideoDevice* video = current_video;
+
+ if (video && video->SetWindowPos)
+ video->SetWindowPos(video, x, y);
+}
+
+/*
+ * Get window position
+ */
+void SDL_WM_GetPos(int *px, int *py)
+{
+ SDL_VideoDevice* video = current_video;
+
+ if (video && video->GetWindowPos)
+ video->GetWindowPos(video, px, py);
+ else {
+ *px = 100;
+ *py = 100;
+ }
+}
+
+int SDL_WM_IsFullyVisible( int recenter )
+{
+ int result = 1;
+
+ SDL_VideoDevice* video = current_video;
+
+ if (video && video->IsWindowVisible) {
+ result = video->IsWindowVisible(video, recenter);
+ }
+ return result;
+}
+
+int SDL_WM_GetMonitorDPI( int *xDpi, int *yDpi )
+{
+ int result = -1;
+ SDL_VideoDevice* video = current_video;
+
+ if (video && video->GetMonitorDPI) {
+ result = video->GetMonitorDPI(video, xDpi, yDpi);
+ }
+ return result;
+}
+
+int SDL_WM_GetMonitorRect( SDL_Rect *rect )
+{
+ int result = -1;
+ SDL_VideoDevice* video = current_video;
+
+ if (video && video->GetMonitorRect) {
+ result = video->GetMonitorRect(video, rect);
+ }
+ return result;
+}
+
+/*
+ * Get some platform dependent window manager information
+ */
+int SDL_GetWMInfo (SDL_SysWMinfo *info)
+{
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+
+ if ( video && video->GetWMInfo ) {
+ return(video->GetWMInfo(this, info));
+ } else {
+ return(0);
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/SDL_yuv.c b/distrib/sdl-1.2.15/src/video/SDL_yuv.c
new file mode 100644
index 0000000..eea3347
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_yuv.c
@@ -0,0 +1,150 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This is the implementation of the YUV video surface support */
+
+#include "SDL_video.h"
+#include "SDL_sysvideo.h"
+#include "SDL_yuvfuncs.h"
+#include "SDL_yuv_sw_c.h"
+
+
+SDL_Overlay *SDL_CreateYUVOverlay(int w, int h, Uint32 format,
+ SDL_Surface *display)
+{
+ SDL_VideoDevice *video = current_video;
+ SDL_VideoDevice *this = current_video;
+ const char *yuv_hwaccel;
+ SDL_Overlay *overlay;
+
+ if ( (display->flags & SDL_OPENGL) == SDL_OPENGL ) {
+ SDL_SetError("YUV overlays are not supported in OpenGL mode");
+ return NULL;
+ }
+
+ /* Display directly on video surface, if possible */
+ if ( SDL_getenv("SDL_VIDEO_YUV_DIRECT") ) {
+ if ( (display == SDL_PublicSurface) &&
+ ((SDL_VideoSurface->format->BytesPerPixel == 2) ||
+ (SDL_VideoSurface->format->BytesPerPixel == 4)) ) {
+ display = SDL_VideoSurface;
+ }
+ }
+ overlay = NULL;
+ yuv_hwaccel = SDL_getenv("SDL_VIDEO_YUV_HWACCEL");
+ if ( ((display == SDL_VideoSurface) && video->CreateYUVOverlay) &&
+ (!yuv_hwaccel || (SDL_atoi(yuv_hwaccel) > 0)) ) {
+ overlay = video->CreateYUVOverlay(this, w, h, format, display);
+ }
+ /* If hardware YUV overlay failed ... */
+ if ( overlay == NULL ) {
+ overlay = SDL_CreateYUV_SW(this, w, h, format, display);
+ }
+ return overlay;
+}
+
+int SDL_LockYUVOverlay(SDL_Overlay *overlay)
+{
+ if ( overlay == NULL ) {
+ SDL_SetError("Passed NULL overlay");
+ return -1;
+ }
+ return overlay->hwfuncs->Lock(current_video, overlay);
+}
+
+void SDL_UnlockYUVOverlay(SDL_Overlay *overlay)
+{
+ if ( overlay == NULL ) {
+ return;
+ }
+ overlay->hwfuncs->Unlock(current_video, overlay);
+}
+
+int SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect)
+{
+ SDL_Rect src, dst;
+ int srcx, srcy, srcw, srch;
+ int dstx, dsty, dstw, dsth;
+
+ if ( overlay == NULL || dstrect == NULL ) {
+ SDL_SetError("Passed NULL overlay or dstrect");
+ return -1;
+ }
+
+ /* Clip the rectangle to the screen area */
+ srcx = 0;
+ srcy = 0;
+ srcw = overlay->w;
+ srch = overlay->h;
+ dstx = dstrect->x;
+ dsty = dstrect->y;
+ dstw = dstrect->w;
+ dsth = dstrect->h;
+ if ( dstx < 0 ) {
+ srcw += (dstx * overlay->w) / dstrect->w;
+ dstw += dstx;
+ srcx -= (dstx * overlay->w) / dstrect->w;
+ dstx = 0;
+ }
+ if ( (dstx+dstw) > current_video->screen->w ) {
+ int extra = (dstx+dstw - current_video->screen->w);
+ srcw -= (extra * overlay->w) / dstrect->w;
+ dstw -= extra;
+ }
+ if ( dsty < 0 ) {
+ srch += (dsty * overlay->h) / dstrect->h;
+ dsth += dsty;
+ srcy -= (dsty * overlay->h) / dstrect->h;
+ dsty = 0;
+ }
+ if ( (dsty+dsth) > current_video->screen->h ) {
+ int extra = (dsty+dsth - current_video->screen->h);
+ srch -= (extra * overlay->h) / dstrect->h;
+ dsth -= extra;
+ }
+ if ( srcw <= 0 || srch <= 0 ||
+ srch <= 0 || dsth <= 0 ) {
+ return 0;
+ }
+ /* Ugh, I can't wait for SDL_Rect to be int values */
+ src.x = srcx;
+ src.y = srcy;
+ src.w = srcw;
+ src.h = srch;
+ dst.x = dstx;
+ dst.y = dsty;
+ dst.w = dstw;
+ dst.h = dsth;
+ return overlay->hwfuncs->Display(current_video, overlay, &src, &dst);
+}
+
+void SDL_FreeYUVOverlay(SDL_Overlay *overlay)
+{
+ if ( overlay == NULL ) {
+ return;
+ }
+ if ( overlay->hwfuncs ) {
+ overlay->hwfuncs->FreeHW(current_video, overlay);
+ }
+ SDL_free(overlay);
+}
diff --git a/distrib/sdl-1.2.15/src/video/SDL_yuv_mmx.c b/distrib/sdl-1.2.15/src/video/SDL_yuv_mmx.c
new file mode 100644
index 0000000..f11c432
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_yuv_mmx.c
@@ -0,0 +1,428 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
+
+#include "SDL_stdinc.h"
+
+#include "mmx.h"
+
+/* *INDENT-OFF* */
+
+static mmx_t MMX_0080w = { .ud = {0x00800080, 0x00800080} };
+static mmx_t MMX_00FFw = { .ud = {0x00ff00ff, 0x00ff00ff} };
+static mmx_t MMX_FF00w = { .ud = {0xff00ff00, 0xff00ff00} };
+
+static mmx_t MMX_Ycoeff = { .uw = {0x004a, 0x004a, 0x004a, 0x004a} };
+
+static mmx_t MMX_UbluRGB = { .uw = {0x0072, 0x0072, 0x0072, 0x0072} };
+static mmx_t MMX_VredRGB = { .uw = {0x0059, 0x0059, 0x0059, 0x0059} };
+static mmx_t MMX_UgrnRGB = { .uw = {0xffea, 0xffea, 0xffea, 0xffea} };
+static mmx_t MMX_VgrnRGB = { .uw = {0xffd2, 0xffd2, 0xffd2, 0xffd2} };
+
+static mmx_t MMX_Ublu5x5 = { .uw = {0x0081, 0x0081, 0x0081, 0x0081} };
+static mmx_t MMX_Vred5x5 = { .uw = {0x0066, 0x0066, 0x0066, 0x0066} };
+static mmx_t MMX_Ugrn565 = { .uw = {0xffe8, 0xffe8, 0xffe8, 0xffe8} };
+static mmx_t MMX_Vgrn565 = { .uw = {0xffcd, 0xffcd, 0xffcd, 0xffcd} };
+
+static mmx_t MMX_red565 = { .uw = {0xf800, 0xf800, 0xf800, 0xf800} };
+static mmx_t MMX_grn565 = { .uw = {0x07e0, 0x07e0, 0x07e0, 0x07e0} };
+
+/**
+ This MMX assembler is my first assembler/MMX program ever.
+ Thus it maybe buggy.
+ Send patches to:
+ mvogt@rhrk.uni-kl.de
+
+ After it worked fine I have "obfuscated" the code a bit to have
+ more parallism in the MMX units. This means I moved
+ initilisation around and delayed other instruction.
+ Performance measurement did not show that this brought any advantage
+ but in theory it _should_ be faster this way.
+
+ The overall performanve gain to the C based dither was 30%-40%.
+ The MMX routine calculates 256bit=8RGB values in each cycle
+ (4 for row1 & 4 for row2)
+
+ The red/green/blue.. coefficents are taken from the mpeg_play
+ player. They look nice, but I dont know if you can have
+ better values, to avoid integer rounding errors.
+
+
+ IMPORTANT:
+ ==========
+
+ It is a requirement that the cr/cb/lum are 8 byte aligned and
+ the out are 16byte aligned or you will/may get segfaults
+
+*/
+
+void ColorRGBDitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix,
+ unsigned char *lum, unsigned char *cr,
+ unsigned char *cb, unsigned char *out,
+ int rows, int cols, int mod )
+{
+ Uint32 *row1;
+ Uint32 *row2;
+
+ unsigned char* y = lum +cols*rows; // Pointer to the end
+ int x = 0;
+ row1 = (Uint32 *)out; // 32 bit target
+ row2 = (Uint32 *)out+cols+mod; // start of second row
+ mod = (mod+cols+mod)*4; // increment for row1 in byte
+
+ __asm__ __volatile__ (
+ // tap dance to workaround the inability to use %%ebx at will...
+ // move one thing to the stack...
+ "pushl $0\n" // save a slot on the stack.
+ "pushl %%ebx\n" // save %%ebx.
+ "movl %0, %%ebx\n" // put the thing in ebx.
+ "movl %%ebx,4(%%esp)\n" // put the thing in the stack slot.
+ "popl %%ebx\n" // get back %%ebx (the PIC register).
+
+ ".align 8\n"
+ "1:\n"
+
+ // create Cr (result in mm1)
+ "pushl %%ebx\n"
+ "movl 4(%%esp),%%ebx\n"
+ "movd (%%ebx),%%mm1\n" // 0 0 0 0 v3 v2 v1 v0
+ "popl %%ebx\n"
+ "pxor %%mm7,%%mm7\n" // 00 00 00 00 00 00 00 00
+ "movd (%2), %%mm2\n" // 0 0 0 0 l3 l2 l1 l0
+ "punpcklbw %%mm7,%%mm1\n" // 0 v3 0 v2 00 v1 00 v0
+ "punpckldq %%mm1,%%mm1\n" // 00 v1 00 v0 00 v1 00 v0
+ "psubw %9,%%mm1\n" // mm1-128:r1 r1 r0 r0 r1 r1 r0 r0
+
+ // create Cr_g (result in mm0)
+ "movq %%mm1,%%mm0\n" // r1 r1 r0 r0 r1 r1 r0 r0
+ "pmullw %10,%%mm0\n" // red*-46dec=0.7136*64
+ "pmullw %11,%%mm1\n" // red*89dec=1.4013*64
+ "psraw $6, %%mm0\n" // red=red/64
+ "psraw $6, %%mm1\n" // red=red/64
+
+ // create L1 L2 (result in mm2,mm4)
+ // L2=lum+cols
+ "movq (%2,%4),%%mm3\n" // 0 0 0 0 L3 L2 L1 L0
+ "punpckldq %%mm3,%%mm2\n" // L3 L2 L1 L0 l3 l2 l1 l0
+ "movq %%mm2,%%mm4\n" // L3 L2 L1 L0 l3 l2 l1 l0
+ "pand %12,%%mm2\n" // L3 0 L1 0 l3 0 l1 0
+ "pand %13,%%mm4\n" // 0 L2 0 L0 0 l2 0 l0
+ "psrlw $8,%%mm2\n" // 0 L3 0 L1 0 l3 0 l1
+
+ // create R (result in mm6)
+ "movq %%mm2,%%mm5\n" // 0 L3 0 L1 0 l3 0 l1
+ "movq %%mm4,%%mm6\n" // 0 L2 0 L0 0 l2 0 l0
+ "paddsw %%mm1, %%mm5\n" // lum1+red:x R3 x R1 x r3 x r1
+ "paddsw %%mm1, %%mm6\n" // lum1+red:x R2 x R0 x r2 x r0
+ "packuswb %%mm5,%%mm5\n" // R3 R1 r3 r1 R3 R1 r3 r1
+ "packuswb %%mm6,%%mm6\n" // R2 R0 r2 r0 R2 R0 r2 r0
+ "pxor %%mm7,%%mm7\n" // 00 00 00 00 00 00 00 00
+ "punpcklbw %%mm5,%%mm6\n" // R3 R2 R1 R0 r3 r2 r1 r0
+
+ // create Cb (result in mm1)
+ "movd (%1), %%mm1\n" // 0 0 0 0 u3 u2 u1 u0
+ "punpcklbw %%mm7,%%mm1\n" // 0 u3 0 u2 00 u1 00 u0
+ "punpckldq %%mm1,%%mm1\n" // 00 u1 00 u0 00 u1 00 u0
+ "psubw %9,%%mm1\n" // mm1-128:u1 u1 u0 u0 u1 u1 u0 u0
+ // create Cb_g (result in mm5)
+ "movq %%mm1,%%mm5\n" // u1 u1 u0 u0 u1 u1 u0 u0
+ "pmullw %14,%%mm5\n" // blue*-109dec=1.7129*64
+ "pmullw %15,%%mm1\n" // blue*114dec=1.78125*64
+ "psraw $6, %%mm5\n" // blue=red/64
+ "psraw $6, %%mm1\n" // blue=blue/64
+
+ // create G (result in mm7)
+ "movq %%mm2,%%mm3\n" // 0 L3 0 L1 0 l3 0 l1
+ "movq %%mm4,%%mm7\n" // 0 L2 0 L0 0 l2 0 l1
+ "paddsw %%mm5, %%mm3\n" // lum1+Cb_g:x G3t x G1t x g3t x g1t
+ "paddsw %%mm5, %%mm7\n" // lum1+Cb_g:x G2t x G0t x g2t x g0t
+ "paddsw %%mm0, %%mm3\n" // lum1+Cr_g:x G3 x G1 x g3 x g1
+ "paddsw %%mm0, %%mm7\n" // lum1+blue:x G2 x G0 x g2 x g0
+ "packuswb %%mm3,%%mm3\n" // G3 G1 g3 g1 G3 G1 g3 g1
+ "packuswb %%mm7,%%mm7\n" // G2 G0 g2 g0 G2 G0 g2 g0
+ "punpcklbw %%mm3,%%mm7\n" // G3 G2 G1 G0 g3 g2 g1 g0
+
+ // create B (result in mm5)
+ "movq %%mm2,%%mm3\n" // 0 L3 0 L1 0 l3 0 l1
+ "movq %%mm4,%%mm5\n" // 0 L2 0 L0 0 l2 0 l1
+ "paddsw %%mm1, %%mm3\n" // lum1+blue:x B3 x B1 x b3 x b1
+ "paddsw %%mm1, %%mm5\n" // lum1+blue:x B2 x B0 x b2 x b0
+ "packuswb %%mm3,%%mm3\n" // B3 B1 b3 b1 B3 B1 b3 b1
+ "packuswb %%mm5,%%mm5\n" // B2 B0 b2 b0 B2 B0 b2 b0
+ "punpcklbw %%mm3,%%mm5\n" // B3 B2 B1 B0 b3 b2 b1 b0
+
+ // fill destination row1 (needed are mm6=Rr,mm7=Gg,mm5=Bb)
+
+ "pxor %%mm2,%%mm2\n" // 0 0 0 0 0 0 0 0
+ "pxor %%mm4,%%mm4\n" // 0 0 0 0 0 0 0 0
+ "movq %%mm6,%%mm1\n" // R3 R2 R1 R0 r3 r2 r1 r0
+ "movq %%mm5,%%mm3\n" // B3 B2 B1 B0 b3 b2 b1 b0
+ // process lower lum
+ "punpcklbw %%mm4,%%mm1\n" // 0 r3 0 r2 0 r1 0 r0
+ "punpcklbw %%mm4,%%mm3\n" // 0 b3 0 b2 0 b1 0 b0
+ "movq %%mm1,%%mm2\n" // 0 r3 0 r2 0 r1 0 r0
+ "movq %%mm3,%%mm0\n" // 0 b3 0 b2 0 b1 0 b0
+ "punpcklwd %%mm1,%%mm3\n" // 0 r1 0 b1 0 r0 0 b0
+ "punpckhwd %%mm2,%%mm0\n" // 0 r3 0 b3 0 r2 0 b2
+
+ "pxor %%mm2,%%mm2\n" // 0 0 0 0 0 0 0 0
+ "movq %%mm7,%%mm1\n" // G3 G2 G1 G0 g3 g2 g1 g0
+ "punpcklbw %%mm1,%%mm2\n" // g3 0 g2 0 g1 0 g0 0
+ "punpcklwd %%mm4,%%mm2\n" // 0 0 g1 0 0 0 g0 0
+ "por %%mm3, %%mm2\n" // 0 r1 g1 b1 0 r0 g0 b0
+ "movq %%mm2,(%3)\n" // wrote out ! row1
+
+ "pxor %%mm2,%%mm2\n" // 0 0 0 0 0 0 0 0
+ "punpcklbw %%mm1,%%mm4\n" // g3 0 g2 0 g1 0 g0 0
+ "punpckhwd %%mm2,%%mm4\n" // 0 0 g3 0 0 0 g2 0
+ "por %%mm0, %%mm4\n" // 0 r3 g3 b3 0 r2 g2 b2
+ "movq %%mm4,8(%3)\n" // wrote out ! row1
+
+ // fill destination row2 (needed are mm6=Rr,mm7=Gg,mm5=Bb)
+ // this can be done "destructive"
+ "pxor %%mm2,%%mm2\n" // 0 0 0 0 0 0 0 0
+ "punpckhbw %%mm2,%%mm6\n" // 0 R3 0 R2 0 R1 0 R0
+ "punpckhbw %%mm1,%%mm5\n" // G3 B3 G2 B2 G1 B1 G0 B0
+ "movq %%mm5,%%mm1\n" // G3 B3 G2 B2 G1 B1 G0 B0
+ "punpcklwd %%mm6,%%mm1\n" // 0 R1 G1 B1 0 R0 G0 B0
+ "movq %%mm1,(%5)\n" // wrote out ! row2
+ "punpckhwd %%mm6,%%mm5\n" // 0 R3 G3 B3 0 R2 G2 B2
+ "movq %%mm5,8(%5)\n" // wrote out ! row2
+
+ "addl $4,%2\n" // lum+4
+ "leal 16(%3),%3\n" // row1+16
+ "leal 16(%5),%5\n" // row2+16
+ "addl $2,(%%esp)\n" // cr+2
+ "addl $2,%1\n" // cb+2
+
+ "addl $4,%6\n" // x+4
+ "cmpl %4,%6\n"
+
+ "jl 1b\n"
+ "addl %4,%2\n" // lum += cols
+ "addl %8,%3\n" // row1+= mod
+ "addl %8,%5\n" // row2+= mod
+ "movl $0,%6\n" // x=0
+ "cmpl %7,%2\n"
+ "jl 1b\n"
+
+ "addl $4,%%esp\n" // get rid of the stack slot we reserved.
+ "emms\n" // reset MMX registers.
+ :
+ : "m" (cr), "r"(cb),"r"(lum),
+ "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod),
+ "m"(MMX_0080w),"m"(MMX_VgrnRGB),"m"(MMX_VredRGB),
+ "m"(MMX_FF00w),"m"(MMX_00FFw),"m"(MMX_UgrnRGB),
+ "m"(MMX_UbluRGB)
+ );
+}
+
+void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix,
+ unsigned char *lum, unsigned char *cr,
+ unsigned char *cb, unsigned char *out,
+ int rows, int cols, int mod )
+{
+ Uint16 *row1;
+ Uint16 *row2;
+
+ unsigned char* y = lum +cols*rows; /* Pointer to the end */
+ int x = 0;
+ row1 = (Uint16 *)out; /* 16 bit target */
+ row2 = (Uint16 *)out+cols+mod; /* start of second row */
+ mod = (mod+cols+mod)*2; /* increment for row1 in byte */
+
+ __asm__ __volatile__(
+ // tap dance to workaround the inability to use %%ebx at will...
+ // move one thing to the stack...
+ "pushl $0\n" // save a slot on the stack.
+ "pushl %%ebx\n" // save %%ebx.
+ "movl %0, %%ebx\n" // put the thing in ebx.
+ "movl %%ebx, 4(%%esp)\n" // put the thing in the stack slot.
+ "popl %%ebx\n" // get back %%ebx (the PIC register).
+
+ ".align 8\n"
+ "1:\n"
+ "movd (%1), %%mm0\n" // 4 Cb 0 0 0 0 u3 u2 u1 u0
+ "pxor %%mm7, %%mm7\n"
+ "pushl %%ebx\n"
+ "movl 4(%%esp), %%ebx\n"
+ "movd (%%ebx), %%mm1\n" // 4 Cr 0 0 0 0 v3 v2 v1 v0
+ "popl %%ebx\n"
+
+ "punpcklbw %%mm7, %%mm0\n" // 4 W cb 0 u3 0 u2 0 u1 0 u0
+ "punpcklbw %%mm7, %%mm1\n" // 4 W cr 0 v3 0 v2 0 v1 0 v0
+ "psubw %9, %%mm0\n"
+ "psubw %9, %%mm1\n"
+ "movq %%mm0, %%mm2\n" // Cb 0 u3 0 u2 0 u1 0 u0
+ "movq %%mm1, %%mm3\n" // Cr
+ "pmullw %10, %%mm2\n" // Cb2green 0 R3 0 R2 0 R1 0 R0
+ "movq (%2), %%mm6\n" // L1 l7 L6 L5 L4 L3 L2 L1 L0
+ "pmullw %11, %%mm0\n" // Cb2blue
+ "pand %12, %%mm6\n" // L1 00 L6 00 L4 00 L2 00 L0
+ "pmullw %13, %%mm3\n" // Cr2green
+ "movq (%2), %%mm7\n" // L2
+ "pmullw %14, %%mm1\n" // Cr2red
+ "psrlw $8, %%mm7\n" // L2 00 L7 00 L5 00 L3 00 L1
+ "pmullw %15, %%mm6\n" // lum1
+ "paddw %%mm3, %%mm2\n" // Cb2green + Cr2green == green
+ "pmullw %15, %%mm7\n" // lum2
+
+ "movq %%mm6, %%mm4\n" // lum1
+ "paddw %%mm0, %%mm6\n" // lum1 +blue 00 B6 00 B4 00 B2 00 B0
+ "movq %%mm4, %%mm5\n" // lum1
+ "paddw %%mm1, %%mm4\n" // lum1 +red 00 R6 00 R4 00 R2 00 R0
+ "paddw %%mm2, %%mm5\n" // lum1 +green 00 G6 00 G4 00 G2 00 G0
+ "psraw $6, %%mm4\n" // R1 0 .. 64
+ "movq %%mm7, %%mm3\n" // lum2 00 L7 00 L5 00 L3 00 L1
+ "psraw $6, %%mm5\n" // G1 - .. +
+ "paddw %%mm0, %%mm7\n" // Lum2 +blue 00 B7 00 B5 00 B3 00 B1
+ "psraw $6, %%mm6\n" // B1 0 .. 64
+ "packuswb %%mm4, %%mm4\n" // R1 R1
+ "packuswb %%mm5, %%mm5\n" // G1 G1
+ "packuswb %%mm6, %%mm6\n" // B1 B1
+ "punpcklbw %%mm4, %%mm4\n"
+ "punpcklbw %%mm5, %%mm5\n"
+
+ "pand %16, %%mm4\n"
+ "psllw $3, %%mm5\n" // GREEN 1
+ "punpcklbw %%mm6, %%mm6\n"
+ "pand %17, %%mm5\n"
+ "pand %16, %%mm6\n"
+ "por %%mm5, %%mm4\n" //
+ "psrlw $11, %%mm6\n" // BLUE 1
+ "movq %%mm3, %%mm5\n" // lum2
+ "paddw %%mm1, %%mm3\n" // lum2 +red 00 R7 00 R5 00 R3 00 R1
+ "paddw %%mm2, %%mm5\n" // lum2 +green 00 G7 00 G5 00 G3 00 G1
+ "psraw $6, %%mm3\n" // R2
+ "por %%mm6, %%mm4\n" // MM4
+ "psraw $6, %%mm5\n" // G2
+ "movq (%2, %4), %%mm6\n" // L3 load lum2
+ "psraw $6, %%mm7\n"
+ "packuswb %%mm3, %%mm3\n"
+ "packuswb %%mm5, %%mm5\n"
+ "packuswb %%mm7, %%mm7\n"
+ "pand %12, %%mm6\n" // L3
+ "punpcklbw %%mm3, %%mm3\n"
+ "punpcklbw %%mm5, %%mm5\n"
+ "pmullw %15, %%mm6\n" // lum3
+ "punpcklbw %%mm7, %%mm7\n"
+ "psllw $3, %%mm5\n" // GREEN 2
+ "pand %16, %%mm7\n"
+ "pand %16, %%mm3\n"
+ "psrlw $11, %%mm7\n" // BLUE 2
+ "pand %17, %%mm5\n"
+ "por %%mm7, %%mm3\n"
+ "movq (%2,%4), %%mm7\n" // L4 load lum2
+ "por %%mm5, %%mm3\n" //
+ "psrlw $8, %%mm7\n" // L4
+ "movq %%mm4, %%mm5\n"
+ "punpcklwd %%mm3, %%mm4\n"
+ "pmullw %15, %%mm7\n" // lum4
+ "punpckhwd %%mm3, %%mm5\n"
+
+ "movq %%mm4, (%3)\n" // write row1
+ "movq %%mm5, 8(%3)\n" // write row1
+
+ "movq %%mm6, %%mm4\n" // Lum3
+ "paddw %%mm0, %%mm6\n" // Lum3 +blue
+
+ "movq %%mm4, %%mm5\n" // Lum3
+ "paddw %%mm1, %%mm4\n" // Lum3 +red
+ "paddw %%mm2, %%mm5\n" // Lum3 +green
+ "psraw $6, %%mm4\n"
+ "movq %%mm7, %%mm3\n" // Lum4
+ "psraw $6, %%mm5\n"
+ "paddw %%mm0, %%mm7\n" // Lum4 +blue
+ "psraw $6, %%mm6\n" // Lum3 +blue
+ "movq %%mm3, %%mm0\n" // Lum4
+ "packuswb %%mm4, %%mm4\n"
+ "paddw %%mm1, %%mm3\n" // Lum4 +red
+ "packuswb %%mm5, %%mm5\n"
+ "paddw %%mm2, %%mm0\n" // Lum4 +green
+ "packuswb %%mm6, %%mm6\n"
+ "punpcklbw %%mm4, %%mm4\n"
+ "punpcklbw %%mm5, %%mm5\n"
+ "punpcklbw %%mm6, %%mm6\n"
+ "psllw $3, %%mm5\n" // GREEN 3
+ "pand %16, %%mm4\n"
+ "psraw $6, %%mm3\n" // psr 6
+ "psraw $6, %%mm0\n"
+ "pand %16, %%mm6\n" // BLUE
+ "pand %17, %%mm5\n"
+ "psrlw $11, %%mm6\n" // BLUE 3
+ "por %%mm5, %%mm4\n"
+ "psraw $6, %%mm7\n"
+ "por %%mm6, %%mm4\n"
+ "packuswb %%mm3, %%mm3\n"
+ "packuswb %%mm0, %%mm0\n"
+ "packuswb %%mm7, %%mm7\n"
+ "punpcklbw %%mm3, %%mm3\n"
+ "punpcklbw %%mm0, %%mm0\n"
+ "punpcklbw %%mm7, %%mm7\n"
+ "pand %16, %%mm3\n"
+ "pand %16, %%mm7\n" // BLUE
+ "psllw $3, %%mm0\n" // GREEN 4
+ "psrlw $11, %%mm7\n"
+ "pand %17, %%mm0\n"
+ "por %%mm7, %%mm3\n"
+ "por %%mm0, %%mm3\n"
+
+ "movq %%mm4, %%mm5\n"
+
+ "punpcklwd %%mm3, %%mm4\n"
+ "punpckhwd %%mm3, %%mm5\n"
+
+ "movq %%mm4, (%5)\n"
+ "movq %%mm5, 8(%5)\n"
+
+ "addl $8, %6\n"
+ "addl $8, %2\n"
+ "addl $4, (%%esp)\n"
+ "addl $4, %1\n"
+ "cmpl %4, %6\n"
+ "leal 16(%3), %3\n"
+ "leal 16(%5),%5\n" // row2+16
+
+ "jl 1b\n"
+ "addl %4, %2\n" // lum += cols
+ "addl %8, %3\n" // row1+= mod
+ "addl %8, %5\n" // row2+= mod
+ "movl $0, %6\n" // x=0
+ "cmpl %7, %2\n"
+ "jl 1b\n"
+ "addl $4, %%esp\n" // get rid of the stack slot we reserved.
+ "emms\n"
+ :
+ : "m" (cr), "r"(cb),"r"(lum),
+ "r"(row1),"r"(cols),"r"(row2),"m"(x),"m"(y),"m"(mod),
+ "m"(MMX_0080w),"m"(MMX_Ugrn565),"m"(MMX_Ublu5x5),
+ "m"(MMX_00FFw),"m"(MMX_Vgrn565),"m"(MMX_Vred5x5),
+ "m"(MMX_Ycoeff),"m"(MMX_red565),"m"(MMX_grn565)
+ );
+}
+
+/* *INDENT-ON* */
+
+#endif /* GCC3 i386 inline assembly */
+
diff --git a/distrib/sdl-1.2.15/src/video/SDL_yuv_sw.c b/distrib/sdl-1.2.15/src/video/SDL_yuv_sw.c
new file mode 100644
index 0000000..c555ce0
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_yuv_sw.c
@@ -0,0 +1,1299 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This is the software implementation of the YUV video overlay support */
+
+/* This code was derived from code carrying the following copyright notices:
+
+ * Copyright (c) 1995 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose, without fee, and without written agreement is
+ * hereby granted, provided that the above copyright notice and the following
+ * two paragraphs appear in all copies of this software.
+ *
+ * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+ * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
+ * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+ * Copyright (c) 1995 Erik Corry
+ * All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose, without fee, and without written agreement is
+ * hereby granted, provided that the above copyright notice and the following
+ * two paragraphs appear in all copies of this software.
+ *
+ * IN NO EVENT SHALL ERIK CORRY BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+ * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
+ * THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF ERIK CORRY HAS BEEN ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ERIK CORRY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
+ * BASIS, AND ERIK CORRY HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
+ * UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+ * Portions of this software Copyright (c) 1995 Brown University.
+ * All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose, without fee, and without written agreement
+ * is hereby granted, provided that the above copyright notice and the
+ * following two paragraphs appear in all copies of this software.
+ *
+ * IN NO EVENT SHALL BROWN UNIVERSITY BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+ * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF BROWN
+ * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * BROWN UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"
+ * BASIS, AND BROWN UNIVERSITY HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
+ * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ */
+
+#include "SDL_video.h"
+#include "SDL_cpuinfo.h"
+#include "SDL_stretch_c.h"
+#include "SDL_yuvfuncs.h"
+#include "SDL_yuv_sw_c.h"
+
+/* The functions used to manipulate software video overlays */
+static struct private_yuvhwfuncs sw_yuvfuncs = {
+ SDL_LockYUV_SW,
+ SDL_UnlockYUV_SW,
+ SDL_DisplayYUV_SW,
+ SDL_FreeYUV_SW
+};
+
+/* RGB conversion lookup tables */
+struct private_yuvhwdata {
+ SDL_Surface *stretch;
+ SDL_Surface *display;
+ Uint8 *pixels;
+ int *colortab;
+ Uint32 *rgb_2_pix;
+ void (*Display1X)(int *colortab, Uint32 *rgb_2_pix,
+ unsigned char *lum, unsigned char *cr,
+ unsigned char *cb, unsigned char *out,
+ int rows, int cols, int mod );
+ void (*Display2X)(int *colortab, Uint32 *rgb_2_pix,
+ unsigned char *lum, unsigned char *cr,
+ unsigned char *cb, unsigned char *out,
+ int rows, int cols, int mod );
+
+ /* These are just so we don't have to allocate them separately */
+ Uint16 pitches[3];
+ Uint8 *planes[3];
+};
+
+
+/* The colorspace conversion functions */
+
+#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
+extern void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix,
+ unsigned char *lum, unsigned char *cr,
+ unsigned char *cb, unsigned char *out,
+ int rows, int cols, int mod );
+extern void ColorRGBDitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix,
+ unsigned char *lum, unsigned char *cr,
+ unsigned char *cb, unsigned char *out,
+ int rows, int cols, int mod );
+#endif
+
+static void Color16DitherYV12Mod1X( int *colortab, Uint32 *rgb_2_pix,
+ unsigned char *lum, unsigned char *cr,
+ unsigned char *cb, unsigned char *out,
+ int rows, int cols, int mod )
+{
+ unsigned short* row1;
+ unsigned short* row2;
+ unsigned char* lum2;
+ int x, y;
+ int cr_r;
+ int crb_g;
+ int cb_b;
+ int cols_2 = cols / 2;
+
+ row1 = (unsigned short*) out;
+ row2 = row1 + cols + mod;
+ lum2 = lum + cols;
+
+ mod += cols + mod;
+
+ y = rows / 2;
+ while( y-- )
+ {
+ x = cols_2;
+ while( x-- )
+ {
+ register int L;
+
+ cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
+ crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
+ + colortab[ *cb + 2*256 ];
+ cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
+ ++cr; ++cb;
+
+ L = *lum++;
+ *row1++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+
+ L = *lum++;
+ *row1++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+
+
+ /* Now, do second row. */
+
+ L = *lum2++;
+ *row2++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+
+ L = *lum2++;
+ *row2++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ }
+
+ /*
+ * These values are at the start of the next line, (due
+ * to the ++'s above),but they need to be at the start
+ * of the line after that.
+ */
+ lum += cols;
+ lum2 += cols;
+ row1 += mod;
+ row2 += mod;
+ }
+}
+
+static void Color24DitherYV12Mod1X( int *colortab, Uint32 *rgb_2_pix,
+ unsigned char *lum, unsigned char *cr,
+ unsigned char *cb, unsigned char *out,
+ int rows, int cols, int mod )
+{
+ unsigned int value;
+ unsigned char* row1;
+ unsigned char* row2;
+ unsigned char* lum2;
+ int x, y;
+ int cr_r;
+ int crb_g;
+ int cb_b;
+ int cols_2 = cols / 2;
+
+ row1 = out;
+ row2 = row1 + cols*3 + mod*3;
+ lum2 = lum + cols;
+
+ mod += cols + mod;
+ mod *= 3;
+
+ y = rows / 2;
+ while( y-- )
+ {
+ x = cols_2;
+ while( x-- )
+ {
+ register int L;
+
+ cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
+ crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
+ + colortab[ *cb + 2*256 ];
+ cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
+ ++cr; ++cb;
+
+ L = *lum++;
+ value = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ *row1++ = (value ) & 0xFF;
+ *row1++ = (value >> 8) & 0xFF;
+ *row1++ = (value >> 16) & 0xFF;
+
+ L = *lum++;
+ value = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ *row1++ = (value ) & 0xFF;
+ *row1++ = (value >> 8) & 0xFF;
+ *row1++ = (value >> 16) & 0xFF;
+
+
+ /* Now, do second row. */
+
+ L = *lum2++;
+ value = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ *row2++ = (value ) & 0xFF;
+ *row2++ = (value >> 8) & 0xFF;
+ *row2++ = (value >> 16) & 0xFF;
+
+ L = *lum2++;
+ value = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ *row2++ = (value ) & 0xFF;
+ *row2++ = (value >> 8) & 0xFF;
+ *row2++ = (value >> 16) & 0xFF;
+ }
+
+ /*
+ * These values are at the start of the next line, (due
+ * to the ++'s above),but they need to be at the start
+ * of the line after that.
+ */
+ lum += cols;
+ lum2 += cols;
+ row1 += mod;
+ row2 += mod;
+ }
+}
+
+static void Color32DitherYV12Mod1X( int *colortab, Uint32 *rgb_2_pix,
+ unsigned char *lum, unsigned char *cr,
+ unsigned char *cb, unsigned char *out,
+ int rows, int cols, int mod )
+{
+ unsigned int* row1;
+ unsigned int* row2;
+ unsigned char* lum2;
+ int x, y;
+ int cr_r;
+ int crb_g;
+ int cb_b;
+ int cols_2 = cols / 2;
+
+ row1 = (unsigned int*) out;
+ row2 = row1 + cols + mod;
+ lum2 = lum + cols;
+
+ mod += cols + mod;
+
+ y = rows / 2;
+ while( y-- )
+ {
+ x = cols_2;
+ while( x-- )
+ {
+ register int L;
+
+ cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
+ crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
+ + colortab[ *cb + 2*256 ];
+ cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
+ ++cr; ++cb;
+
+ L = *lum++;
+ *row1++ = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+
+ L = *lum++;
+ *row1++ = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+
+
+ /* Now, do second row. */
+
+ L = *lum2++;
+ *row2++ = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+
+ L = *lum2++;
+ *row2++ = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ }
+
+ /*
+ * These values are at the start of the next line, (due
+ * to the ++'s above),but they need to be at the start
+ * of the line after that.
+ */
+ lum += cols;
+ lum2 += cols;
+ row1 += mod;
+ row2 += mod;
+ }
+}
+
+/*
+ * In this function I make use of a nasty trick. The tables have the lower
+ * 16 bits replicated in the upper 16. This means I can write ints and get
+ * the horisontal doubling for free (almost).
+ */
+static void Color16DitherYV12Mod2X( int *colortab, Uint32 *rgb_2_pix,
+ unsigned char *lum, unsigned char *cr,
+ unsigned char *cb, unsigned char *out,
+ int rows, int cols, int mod )
+{
+ unsigned int* row1 = (unsigned int*) out;
+ const int next_row = cols+(mod/2);
+ unsigned int* row2 = row1 + 2*next_row;
+ unsigned char* lum2;
+ int x, y;
+ int cr_r;
+ int crb_g;
+ int cb_b;
+ int cols_2 = cols / 2;
+
+ lum2 = lum + cols;
+
+ mod = (next_row * 3) + (mod/2);
+
+ y = rows / 2;
+ while( y-- )
+ {
+ x = cols_2;
+ while( x-- )
+ {
+ register int L;
+
+ cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
+ crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
+ + colortab[ *cb + 2*256 ];
+ cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
+ ++cr; ++cb;
+
+ L = *lum++;
+ row1[0] = row1[next_row] = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ row1++;
+
+ L = *lum++;
+ row1[0] = row1[next_row] = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ row1++;
+
+
+ /* Now, do second row. */
+
+ L = *lum2++;
+ row2[0] = row2[next_row] = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ row2++;
+
+ L = *lum2++;
+ row2[0] = row2[next_row] = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ row2++;
+ }
+
+ /*
+ * These values are at the start of the next line, (due
+ * to the ++'s above),but they need to be at the start
+ * of the line after that.
+ */
+ lum += cols;
+ lum2 += cols;
+ row1 += mod;
+ row2 += mod;
+ }
+}
+
+static void Color24DitherYV12Mod2X( int *colortab, Uint32 *rgb_2_pix,
+ unsigned char *lum, unsigned char *cr,
+ unsigned char *cb, unsigned char *out,
+ int rows, int cols, int mod )
+{
+ unsigned int value;
+ unsigned char* row1 = out;
+ const int next_row = (cols*2 + mod) * 3;
+ unsigned char* row2 = row1 + 2*next_row;
+ unsigned char* lum2;
+ int x, y;
+ int cr_r;
+ int crb_g;
+ int cb_b;
+ int cols_2 = cols / 2;
+
+ lum2 = lum + cols;
+
+ mod = next_row*3 + mod*3;
+
+ y = rows / 2;
+ while( y-- )
+ {
+ x = cols_2;
+ while( x-- )
+ {
+ register int L;
+
+ cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
+ crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
+ + colortab[ *cb + 2*256 ];
+ cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
+ ++cr; ++cb;
+
+ L = *lum++;
+ value = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ row1[0+0] = row1[3+0] = row1[next_row+0] = row1[next_row+3+0] =
+ (value ) & 0xFF;
+ row1[0+1] = row1[3+1] = row1[next_row+1] = row1[next_row+3+1] =
+ (value >> 8) & 0xFF;
+ row1[0+2] = row1[3+2] = row1[next_row+2] = row1[next_row+3+2] =
+ (value >> 16) & 0xFF;
+ row1 += 2*3;
+
+ L = *lum++;
+ value = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ row1[0+0] = row1[3+0] = row1[next_row+0] = row1[next_row+3+0] =
+ (value ) & 0xFF;
+ row1[0+1] = row1[3+1] = row1[next_row+1] = row1[next_row+3+1] =
+ (value >> 8) & 0xFF;
+ row1[0+2] = row1[3+2] = row1[next_row+2] = row1[next_row+3+2] =
+ (value >> 16) & 0xFF;
+ row1 += 2*3;
+
+
+ /* Now, do second row. */
+
+ L = *lum2++;
+ value = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ row2[0+0] = row2[3+0] = row2[next_row+0] = row2[next_row+3+0] =
+ (value ) & 0xFF;
+ row2[0+1] = row2[3+1] = row2[next_row+1] = row2[next_row+3+1] =
+ (value >> 8) & 0xFF;
+ row2[0+2] = row2[3+2] = row2[next_row+2] = row2[next_row+3+2] =
+ (value >> 16) & 0xFF;
+ row2 += 2*3;
+
+ L = *lum2++;
+ value = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ row2[0+0] = row2[3+0] = row2[next_row+0] = row2[next_row+3+0] =
+ (value ) & 0xFF;
+ row2[0+1] = row2[3+1] = row2[next_row+1] = row2[next_row+3+1] =
+ (value >> 8) & 0xFF;
+ row2[0+2] = row2[3+2] = row2[next_row+2] = row2[next_row+3+2] =
+ (value >> 16) & 0xFF;
+ row2 += 2*3;
+ }
+
+ /*
+ * These values are at the start of the next line, (due
+ * to the ++'s above),but they need to be at the start
+ * of the line after that.
+ */
+ lum += cols;
+ lum2 += cols;
+ row1 += mod;
+ row2 += mod;
+ }
+}
+
+static void Color32DitherYV12Mod2X( int *colortab, Uint32 *rgb_2_pix,
+ unsigned char *lum, unsigned char *cr,
+ unsigned char *cb, unsigned char *out,
+ int rows, int cols, int mod )
+{
+ unsigned int* row1 = (unsigned int*) out;
+ const int next_row = cols*2+mod;
+ unsigned int* row2 = row1 + 2*next_row;
+ unsigned char* lum2;
+ int x, y;
+ int cr_r;
+ int crb_g;
+ int cb_b;
+ int cols_2 = cols / 2;
+
+ lum2 = lum + cols;
+
+ mod = (next_row * 3) + mod;
+
+ y = rows / 2;
+ while( y-- )
+ {
+ x = cols_2;
+ while( x-- )
+ {
+ register int L;
+
+ cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
+ crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
+ + colortab[ *cb + 2*256 ];
+ cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
+ ++cr; ++cb;
+
+ L = *lum++;
+ row1[0] = row1[1] = row1[next_row] = row1[next_row+1] =
+ (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ row1 += 2;
+
+ L = *lum++;
+ row1[0] = row1[1] = row1[next_row] = row1[next_row+1] =
+ (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ row1 += 2;
+
+
+ /* Now, do second row. */
+
+ L = *lum2++;
+ row2[0] = row2[1] = row2[next_row] = row2[next_row+1] =
+ (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ row2 += 2;
+
+ L = *lum2++;
+ row2[0] = row2[1] = row2[next_row] = row2[next_row+1] =
+ (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ row2 += 2;
+ }
+
+ /*
+ * These values are at the start of the next line, (due
+ * to the ++'s above),but they need to be at the start
+ * of the line after that.
+ */
+ lum += cols;
+ lum2 += cols;
+ row1 += mod;
+ row2 += mod;
+ }
+}
+
+static void Color16DitherYUY2Mod1X( int *colortab, Uint32 *rgb_2_pix,
+ unsigned char *lum, unsigned char *cr,
+ unsigned char *cb, unsigned char *out,
+ int rows, int cols, int mod )
+{
+ unsigned short* row;
+ int x, y;
+ int cr_r;
+ int crb_g;
+ int cb_b;
+ int cols_2 = cols / 2;
+
+ row = (unsigned short*) out;
+
+ y = rows;
+ while( y-- )
+ {
+ x = cols_2;
+ while( x-- )
+ {
+ register int L;
+
+ cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
+ crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
+ + colortab[ *cb + 2*256 ];
+ cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
+ cr += 4; cb += 4;
+
+ L = *lum; lum += 2;
+ *row++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+
+ L = *lum; lum += 2;
+ *row++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+
+ }
+
+ row += mod;
+ }
+}
+
+static void Color24DitherYUY2Mod1X( int *colortab, Uint32 *rgb_2_pix,
+ unsigned char *lum, unsigned char *cr,
+ unsigned char *cb, unsigned char *out,
+ int rows, int cols, int mod )
+{
+ unsigned int value;
+ unsigned char* row;
+ int x, y;
+ int cr_r;
+ int crb_g;
+ int cb_b;
+ int cols_2 = cols / 2;
+
+ row = (unsigned char*) out;
+ mod *= 3;
+ y = rows;
+ while( y-- )
+ {
+ x = cols_2;
+ while( x-- )
+ {
+ register int L;
+
+ cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
+ crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
+ + colortab[ *cb + 2*256 ];
+ cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
+ cr += 4; cb += 4;
+
+ L = *lum; lum += 2;
+ value = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ *row++ = (value ) & 0xFF;
+ *row++ = (value >> 8) & 0xFF;
+ *row++ = (value >> 16) & 0xFF;
+
+ L = *lum; lum += 2;
+ value = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ *row++ = (value ) & 0xFF;
+ *row++ = (value >> 8) & 0xFF;
+ *row++ = (value >> 16) & 0xFF;
+
+ }
+ row += mod;
+ }
+}
+
+static void Color32DitherYUY2Mod1X( int *colortab, Uint32 *rgb_2_pix,
+ unsigned char *lum, unsigned char *cr,
+ unsigned char *cb, unsigned char *out,
+ int rows, int cols, int mod )
+{
+ unsigned int* row;
+ int x, y;
+ int cr_r;
+ int crb_g;
+ int cb_b;
+ int cols_2 = cols / 2;
+
+ row = (unsigned int*) out;
+ y = rows;
+ while( y-- )
+ {
+ x = cols_2;
+ while( x-- )
+ {
+ register int L;
+
+ cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
+ crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
+ + colortab[ *cb + 2*256 ];
+ cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
+ cr += 4; cb += 4;
+
+ L = *lum; lum += 2;
+ *row++ = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+
+ L = *lum; lum += 2;
+ *row++ = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+
+
+ }
+ row += mod;
+ }
+}
+
+/*
+ * In this function I make use of a nasty trick. The tables have the lower
+ * 16 bits replicated in the upper 16. This means I can write ints and get
+ * the horisontal doubling for free (almost).
+ */
+static void Color16DitherYUY2Mod2X( int *colortab, Uint32 *rgb_2_pix,
+ unsigned char *lum, unsigned char *cr,
+ unsigned char *cb, unsigned char *out,
+ int rows, int cols, int mod )
+{
+ unsigned int* row = (unsigned int*) out;
+ const int next_row = cols+(mod/2);
+ int x, y;
+ int cr_r;
+ int crb_g;
+ int cb_b;
+ int cols_2 = cols / 2;
+
+ y = rows;
+ while( y-- )
+ {
+ x = cols_2;
+ while( x-- )
+ {
+ register int L;
+
+ cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
+ crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
+ + colortab[ *cb + 2*256 ];
+ cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
+ cr += 4; cb += 4;
+
+ L = *lum; lum += 2;
+ row[0] = row[next_row] = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ row++;
+
+ L = *lum; lum += 2;
+ row[0] = row[next_row] = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ row++;
+
+ }
+ row += next_row;
+ }
+}
+
+static void Color24DitherYUY2Mod2X( int *colortab, Uint32 *rgb_2_pix,
+ unsigned char *lum, unsigned char *cr,
+ unsigned char *cb, unsigned char *out,
+ int rows, int cols, int mod )
+{
+ unsigned int value;
+ unsigned char* row = out;
+ const int next_row = (cols*2 + mod) * 3;
+ int x, y;
+ int cr_r;
+ int crb_g;
+ int cb_b;
+ int cols_2 = cols / 2;
+ y = rows;
+ while( y-- )
+ {
+ x = cols_2;
+ while( x-- )
+ {
+ register int L;
+
+ cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
+ crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
+ + colortab[ *cb + 2*256 ];
+ cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
+ cr += 4; cb += 4;
+
+ L = *lum; lum += 2;
+ value = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ row[0+0] = row[3+0] = row[next_row+0] = row[next_row+3+0] =
+ (value ) & 0xFF;
+ row[0+1] = row[3+1] = row[next_row+1] = row[next_row+3+1] =
+ (value >> 8) & 0xFF;
+ row[0+2] = row[3+2] = row[next_row+2] = row[next_row+3+2] =
+ (value >> 16) & 0xFF;
+ row += 2*3;
+
+ L = *lum; lum += 2;
+ value = (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ row[0+0] = row[3+0] = row[next_row+0] = row[next_row+3+0] =
+ (value ) & 0xFF;
+ row[0+1] = row[3+1] = row[next_row+1] = row[next_row+3+1] =
+ (value >> 8) & 0xFF;
+ row[0+2] = row[3+2] = row[next_row+2] = row[next_row+3+2] =
+ (value >> 16) & 0xFF;
+ row += 2*3;
+
+ }
+ row += next_row;
+ }
+}
+
+static void Color32DitherYUY2Mod2X( int *colortab, Uint32 *rgb_2_pix,
+ unsigned char *lum, unsigned char *cr,
+ unsigned char *cb, unsigned char *out,
+ int rows, int cols, int mod )
+{
+ unsigned int* row = (unsigned int*) out;
+ const int next_row = cols*2+mod;
+ int x, y;
+ int cr_r;
+ int crb_g;
+ int cb_b;
+ int cols_2 = cols / 2;
+ mod+=mod;
+ y = rows;
+ while( y-- )
+ {
+ x = cols_2;
+ while( x-- )
+ {
+ register int L;
+
+ cr_r = 0*768+256 + colortab[ *cr + 0*256 ];
+ crb_g = 1*768+256 + colortab[ *cr + 1*256 ]
+ + colortab[ *cb + 2*256 ];
+ cb_b = 2*768+256 + colortab[ *cb + 3*256 ];
+ cr += 4; cb += 4;
+
+ L = *lum; lum += 2;
+ row[0] = row[1] = row[next_row] = row[next_row+1] =
+ (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ row += 2;
+
+ L = *lum; lum += 2;
+ row[0] = row[1] = row[next_row] = row[next_row+1] =
+ (rgb_2_pix[ L + cr_r ] |
+ rgb_2_pix[ L + crb_g ] |
+ rgb_2_pix[ L + cb_b ]);
+ row += 2;
+
+
+ }
+
+ row += next_row;
+ }
+}
+
+/*
+ * How many 1 bits are there in the Uint32.
+ * Low performance, do not call often.
+ */
+static int number_of_bits_set( Uint32 a )
+{
+ if(!a) return 0;
+ if(a & 1) return 1 + number_of_bits_set(a >> 1);
+ return(number_of_bits_set(a >> 1));
+}
+
+/*
+ * How many 0 bits are there at least significant end of Uint32.
+ * Low performance, do not call often.
+ */
+static int free_bits_at_bottom( Uint32 a )
+{
+ /* assume char is 8 bits */
+ if(!a) return sizeof(Uint32) * 8;
+ if(((Sint32)a) & 1l) return 0;
+ return 1 + free_bits_at_bottom ( a >> 1);
+}
+
+
+SDL_Overlay *SDL_CreateYUV_SW(_THIS, int width, int height, Uint32 format, SDL_Surface *display)
+{
+ SDL_Overlay *overlay;
+ struct private_yuvhwdata *swdata;
+ int *Cr_r_tab;
+ int *Cr_g_tab;
+ int *Cb_g_tab;
+ int *Cb_b_tab;
+ Uint32 *r_2_pix_alloc;
+ Uint32 *g_2_pix_alloc;
+ Uint32 *b_2_pix_alloc;
+ int i;
+ int CR, CB;
+ Uint32 Rmask, Gmask, Bmask;
+
+ /* Only RGB packed pixel conversion supported */
+ if ( (display->format->BytesPerPixel != 2) &&
+ (display->format->BytesPerPixel != 3) &&
+ (display->format->BytesPerPixel != 4) ) {
+ SDL_SetError("Can't use YUV data on non 16/24/32 bit surfaces");
+ return(NULL);
+ }
+
+ /* Verify that we support the format */
+ switch (format) {
+ case SDL_YV12_OVERLAY:
+ case SDL_IYUV_OVERLAY:
+ case SDL_YUY2_OVERLAY:
+ case SDL_UYVY_OVERLAY:
+ case SDL_YVYU_OVERLAY:
+ break;
+ default:
+ SDL_SetError("Unsupported YUV format");
+ return(NULL);
+ }
+
+ /* Create the overlay structure */
+ overlay = (SDL_Overlay *)SDL_malloc(sizeof *overlay);
+ if ( overlay == NULL ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ SDL_memset(overlay, 0, (sizeof *overlay));
+
+ /* Fill in the basic members */
+ overlay->format = format;
+ overlay->w = width;
+ overlay->h = height;
+
+ /* Set up the YUV surface function structure */
+ overlay->hwfuncs = &sw_yuvfuncs;
+
+ /* Create the pixel data and lookup tables */
+ swdata = (struct private_yuvhwdata *)SDL_malloc(sizeof *swdata);
+ overlay->hwdata = swdata;
+ if ( swdata == NULL ) {
+ SDL_OutOfMemory();
+ SDL_FreeYUVOverlay(overlay);
+ return(NULL);
+ }
+ swdata->stretch = NULL;
+ swdata->display = display;
+ swdata->pixels = (Uint8 *) SDL_malloc(width*height*2);
+ swdata->colortab = (int *)SDL_malloc(4*256*sizeof(int));
+ Cr_r_tab = &swdata->colortab[0*256];
+ Cr_g_tab = &swdata->colortab[1*256];
+ Cb_g_tab = &swdata->colortab[2*256];
+ Cb_b_tab = &swdata->colortab[3*256];
+ swdata->rgb_2_pix = (Uint32 *)SDL_malloc(3*768*sizeof(Uint32));
+ r_2_pix_alloc = &swdata->rgb_2_pix[0*768];
+ g_2_pix_alloc = &swdata->rgb_2_pix[1*768];
+ b_2_pix_alloc = &swdata->rgb_2_pix[2*768];
+ if ( ! swdata->pixels || ! swdata->colortab || ! swdata->rgb_2_pix ) {
+ SDL_OutOfMemory();
+ SDL_FreeYUVOverlay(overlay);
+ return(NULL);
+ }
+
+ /* Generate the tables for the display surface */
+ for (i=0; i<256; i++) {
+ /* Gamma correction (luminescence table) and chroma correction
+ would be done here. See the Berkeley mpeg_play sources.
+ */
+ CB = CR = (i-128);
+ Cr_r_tab[i] = (int) ( (0.419/0.299) * CR);
+ Cr_g_tab[i] = (int) (-(0.299/0.419) * CR);
+ Cb_g_tab[i] = (int) (-(0.114/0.331) * CB);
+ Cb_b_tab[i] = (int) ( (0.587/0.331) * CB);
+ }
+
+ /*
+ * Set up entries 0-255 in rgb-to-pixel value tables.
+ */
+ Rmask = display->format->Rmask;
+ Gmask = display->format->Gmask;
+ Bmask = display->format->Bmask;
+ for ( i=0; i<256; ++i ) {
+ r_2_pix_alloc[i+256] = i >> (8 - number_of_bits_set(Rmask));
+ r_2_pix_alloc[i+256] <<= free_bits_at_bottom(Rmask);
+ g_2_pix_alloc[i+256] = i >> (8 - number_of_bits_set(Gmask));
+ g_2_pix_alloc[i+256] <<= free_bits_at_bottom(Gmask);
+ b_2_pix_alloc[i+256] = i >> (8 - number_of_bits_set(Bmask));
+ b_2_pix_alloc[i+256] <<= free_bits_at_bottom(Bmask);
+ }
+
+ /*
+ * If we have 16-bit output depth, then we double the value
+ * in the top word. This means that we can write out both
+ * pixels in the pixel doubling mode with one op. It is
+ * harmless in the normal case as storing a 32-bit value
+ * through a short pointer will lose the top bits anyway.
+ */
+ if( display->format->BytesPerPixel == 2 ) {
+ for ( i=0; i<256; ++i ) {
+ r_2_pix_alloc[i+256] |= (r_2_pix_alloc[i+256]) << 16;
+ g_2_pix_alloc[i+256] |= (g_2_pix_alloc[i+256]) << 16;
+ b_2_pix_alloc[i+256] |= (b_2_pix_alloc[i+256]) << 16;
+ }
+ }
+
+ /*
+ * Spread out the values we have to the rest of the array so that
+ * we do not need to check for overflow.
+ */
+ for ( i=0; i<256; ++i ) {
+ r_2_pix_alloc[i] = r_2_pix_alloc[256];
+ r_2_pix_alloc[i+512] = r_2_pix_alloc[511];
+ g_2_pix_alloc[i] = g_2_pix_alloc[256];
+ g_2_pix_alloc[i+512] = g_2_pix_alloc[511];
+ b_2_pix_alloc[i] = b_2_pix_alloc[256];
+ b_2_pix_alloc[i+512] = b_2_pix_alloc[511];
+ }
+
+ /* You have chosen wisely... */
+ switch (format) {
+ case SDL_YV12_OVERLAY:
+ case SDL_IYUV_OVERLAY:
+ if ( display->format->BytesPerPixel == 2 ) {
+#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
+ /* inline assembly functions */
+ if ( SDL_HasMMX() && (Rmask == 0xF800) &&
+ (Gmask == 0x07E0) &&
+ (Bmask == 0x001F) &&
+ (width & 15) == 0) {
+/*printf("Using MMX 16-bit 565 dither\n");*/
+ swdata->Display1X = Color565DitherYV12MMX1X;
+ } else {
+/*printf("Using C 16-bit dither\n");*/
+ swdata->Display1X = Color16DitherYV12Mod1X;
+ }
+#else
+ swdata->Display1X = Color16DitherYV12Mod1X;
+#endif
+ swdata->Display2X = Color16DitherYV12Mod2X;
+ }
+ if ( display->format->BytesPerPixel == 3 ) {
+ swdata->Display1X = Color24DitherYV12Mod1X;
+ swdata->Display2X = Color24DitherYV12Mod2X;
+ }
+ if ( display->format->BytesPerPixel == 4 ) {
+#if (__GNUC__ > 2) && defined(__i386__) && __OPTIMIZE__ && SDL_ASSEMBLY_ROUTINES
+ /* inline assembly functions */
+ if ( SDL_HasMMX() && (Rmask == 0x00FF0000) &&
+ (Gmask == 0x0000FF00) &&
+ (Bmask == 0x000000FF) &&
+ (width & 15) == 0) {
+/*printf("Using MMX 32-bit dither\n");*/
+ swdata->Display1X = ColorRGBDitherYV12MMX1X;
+ } else {
+/*printf("Using C 32-bit dither\n");*/
+ swdata->Display1X = Color32DitherYV12Mod1X;
+ }
+#else
+ swdata->Display1X = Color32DitherYV12Mod1X;
+#endif
+ swdata->Display2X = Color32DitherYV12Mod2X;
+ }
+ break;
+ case SDL_YUY2_OVERLAY:
+ case SDL_UYVY_OVERLAY:
+ case SDL_YVYU_OVERLAY:
+ if ( display->format->BytesPerPixel == 2 ) {
+ swdata->Display1X = Color16DitherYUY2Mod1X;
+ swdata->Display2X = Color16DitherYUY2Mod2X;
+ }
+ if ( display->format->BytesPerPixel == 3 ) {
+ swdata->Display1X = Color24DitherYUY2Mod1X;
+ swdata->Display2X = Color24DitherYUY2Mod2X;
+ }
+ if ( display->format->BytesPerPixel == 4 ) {
+ swdata->Display1X = Color32DitherYUY2Mod1X;
+ swdata->Display2X = Color32DitherYUY2Mod2X;
+ }
+ break;
+ default:
+ /* We should never get here (caught above) */
+ break;
+ }
+
+ /* Find the pitch and offset values for the overlay */
+ overlay->pitches = swdata->pitches;
+ overlay->pixels = swdata->planes;
+ switch (format) {
+ case SDL_YV12_OVERLAY:
+ case SDL_IYUV_OVERLAY:
+ overlay->pitches[0] = overlay->w;
+ overlay->pitches[1] = overlay->pitches[0] / 2;
+ overlay->pitches[2] = overlay->pitches[0] / 2;
+ overlay->pixels[0] = swdata->pixels;
+ overlay->pixels[1] = overlay->pixels[0] +
+ overlay->pitches[0] * overlay->h;
+ overlay->pixels[2] = overlay->pixels[1] +
+ overlay->pitches[1] * overlay->h / 2;
+ overlay->planes = 3;
+ break;
+ case SDL_YUY2_OVERLAY:
+ case SDL_UYVY_OVERLAY:
+ case SDL_YVYU_OVERLAY:
+ overlay->pitches[0] = overlay->w*2;
+ overlay->pixels[0] = swdata->pixels;
+ overlay->planes = 1;
+ break;
+ default:
+ /* We should never get here (caught above) */
+ break;
+ }
+
+ /* We're all done.. */
+ return(overlay);
+}
+
+int SDL_LockYUV_SW(_THIS, SDL_Overlay *overlay)
+{
+ return(0);
+}
+
+void SDL_UnlockYUV_SW(_THIS, SDL_Overlay *overlay)
+{
+ return;
+}
+
+int SDL_DisplayYUV_SW(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst)
+{
+ struct private_yuvhwdata *swdata;
+ int stretch;
+ int scale_2x;
+ SDL_Surface *display;
+ Uint8 *lum, *Cr, *Cb;
+ Uint8 *dstp;
+ int mod;
+
+ swdata = overlay->hwdata;
+ stretch = 0;
+ scale_2x = 0;
+ if ( src->x || src->y || src->w < overlay->w || src->h < overlay->h ) {
+ /* The source rectangle has been clipped.
+ Using a scratch surface is easier than adding clipped
+ source support to all the blitters, plus that would
+ slow them down in the general unclipped case.
+ */
+ stretch = 1;
+ } else if ( (src->w != dst->w) || (src->h != dst->h) ) {
+ if ( (dst->w == 2*src->w) &&
+ (dst->h == 2*src->h) ) {
+ scale_2x = 1;
+ } else {
+ stretch = 1;
+ }
+ }
+ if ( stretch ) {
+ if ( ! swdata->stretch ) {
+ display = swdata->display;
+ swdata->stretch = SDL_CreateRGBSurface(
+ SDL_SWSURFACE,
+ overlay->w, overlay->h,
+ display->format->BitsPerPixel,
+ display->format->Rmask,
+ display->format->Gmask,
+ display->format->Bmask, 0);
+ if ( ! swdata->stretch ) {
+ return(-1);
+ }
+ }
+ display = swdata->stretch;
+ } else {
+ display = swdata->display;
+ }
+ switch (overlay->format) {
+ case SDL_YV12_OVERLAY:
+ lum = overlay->pixels[0];
+ Cr = overlay->pixels[1];
+ Cb = overlay->pixels[2];
+ break;
+ case SDL_IYUV_OVERLAY:
+ lum = overlay->pixels[0];
+ Cr = overlay->pixels[2];
+ Cb = overlay->pixels[1];
+ break;
+ case SDL_YUY2_OVERLAY:
+ lum = overlay->pixels[0];
+ Cr = lum + 3;
+ Cb = lum + 1;
+ break;
+ case SDL_UYVY_OVERLAY:
+ lum = overlay->pixels[0]+1;
+ Cr = lum + 1;
+ Cb = lum - 1;
+ break;
+ case SDL_YVYU_OVERLAY:
+ lum = overlay->pixels[0];
+ Cr = lum + 1;
+ Cb = lum + 3;
+ break;
+ default:
+ SDL_SetError("Unsupported YUV format in blit");
+ return(-1);
+ }
+ if ( SDL_MUSTLOCK(display) ) {
+ if ( SDL_LockSurface(display) < 0 ) {
+ return(-1);
+ }
+ }
+ if ( stretch ) {
+ dstp = (Uint8 *)swdata->stretch->pixels;
+ } else {
+ dstp = (Uint8 *)display->pixels
+ + dst->x * display->format->BytesPerPixel
+ + dst->y * display->pitch;
+ }
+ mod = (display->pitch / display->format->BytesPerPixel);
+
+ if ( scale_2x ) {
+ mod -= (overlay->w * 2);
+ swdata->Display2X(swdata->colortab, swdata->rgb_2_pix,
+ lum, Cr, Cb, dstp, overlay->h, overlay->w, mod);
+ } else {
+ mod -= overlay->w;
+ swdata->Display1X(swdata->colortab, swdata->rgb_2_pix,
+ lum, Cr, Cb, dstp, overlay->h, overlay->w, mod);
+ }
+ if ( SDL_MUSTLOCK(display) ) {
+ SDL_UnlockSurface(display);
+ }
+ if ( stretch ) {
+ display = swdata->display;
+ SDL_SoftStretch(swdata->stretch, src, display, dst);
+ }
+ SDL_UpdateRects(display, 1, dst);
+
+ return(0);
+}
+
+void SDL_FreeYUV_SW(_THIS, SDL_Overlay *overlay)
+{
+ struct private_yuvhwdata *swdata;
+
+ swdata = overlay->hwdata;
+ if ( swdata ) {
+ if ( swdata->stretch ) {
+ SDL_FreeSurface(swdata->stretch);
+ }
+ if ( swdata->pixels ) {
+ SDL_free(swdata->pixels);
+ }
+ if ( swdata->colortab ) {
+ SDL_free(swdata->colortab);
+ }
+ if ( swdata->rgb_2_pix ) {
+ SDL_free(swdata->rgb_2_pix);
+ }
+ SDL_free(swdata);
+ overlay->hwdata = NULL;
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/SDL_yuv_sw_c.h b/distrib/sdl-1.2.15/src/video/SDL_yuv_sw_c.h
new file mode 100644
index 0000000..5aea3a5
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_yuv_sw_c.h
@@ -0,0 +1,37 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_video.h"
+#include "SDL_sysvideo.h"
+
+/* This is the software implementation of the YUV video overlay support */
+
+extern SDL_Overlay *SDL_CreateYUV_SW(_THIS, int width, int height, Uint32 format, SDL_Surface *display);
+
+extern int SDL_LockYUV_SW(_THIS, SDL_Overlay *overlay);
+
+extern void SDL_UnlockYUV_SW(_THIS, SDL_Overlay *overlay);
+
+extern int SDL_DisplayYUV_SW(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst);
+
+extern void SDL_FreeYUV_SW(_THIS, SDL_Overlay *overlay);
diff --git a/distrib/sdl-1.2.15/src/video/SDL_yuvfuncs.h b/distrib/sdl-1.2.15/src/video/SDL_yuvfuncs.h
new file mode 100644
index 0000000..cb496b6
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/SDL_yuvfuncs.h
@@ -0,0 +1,37 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This is the definition of the YUV video surface function structure */
+
+#include "SDL_video.h"
+#include "SDL_sysvideo.h"
+
+#ifndef _THIS
+#define _THIS SDL_VideoDevice *_this
+#endif
+struct private_yuvhwfuncs {
+ int (*Lock)(_THIS, SDL_Overlay *overlay);
+ void (*Unlock)(_THIS, SDL_Overlay *overlay);
+ int (*Display)(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst);
+ void (*FreeHW)(_THIS, SDL_Overlay *overlay);
+};
diff --git a/distrib/sdl-1.2.12/src/video/Xext/README b/distrib/sdl-1.2.15/src/video/Xext/README
index a16ea68..a16ea68 100644
--- a/distrib/sdl-1.2.12/src/video/Xext/README
+++ b/distrib/sdl-1.2.15/src/video/Xext/README
diff --git a/distrib/sdl-1.2.15/src/video/Xext/XME/xme.c b/distrib/sdl-1.2.15/src/video/Xext/XME/xme.c
new file mode 100644
index 0000000..2cead35
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/Xext/XME/xme.c
@@ -0,0 +1,410 @@
+/*
+ * Copyright 1993-2001 by Xi Graphics, Inc.
+ * All Rights Reserved.
+ *
+ * Please see the LICENSE file accompanying this distribution for licensing
+ * information.
+ *
+ * Please send any bug fixes and modifications to src@xig.com.
+ *
+ * $XiGId: xme.c,v 1.2 2001/11/30 21:56:59 jon Exp $
+ *
+ */
+
+#define NEED_EVENTS
+#define NEED_REPLIES
+
+/* Apparently some X11 systems can't include this multiple times... */
+#ifndef SDL_INCLUDED_XLIBINT_H
+#define SDL_INCLUDED_XLIBINT_H 1
+#include <X11/Xlibint.h>
+#endif
+
+#include <X11/Xthreads.h>
+#include <X11/Xmd.h>
+#include <X11/Xproto.h>
+#include "../extensions/Xext.h"
+#include "../extensions/extutil.h"
+
+/*****************************************************************************/
+
+
+#define XIGMISC_PROTOCOL_NAME "XiG-SUNDRY-NONSTANDARD"
+#define XIGMISC_MAJOR_VERSION 2
+#define XIGMISC_MINOR_VERSION 0
+
+#define XiGMiscNumberEvents 0
+
+#define X_XiGMiscQueryVersion 0
+#define X_XiGMiscQueryViews 1
+#define X_XiGMiscQueryResolutions 2
+#define X_XiGMiscChangeResolution 3
+#define X_XiGMiscFullScreen 4
+
+#define sz_xXiGMiscQueryVersionReq 8
+#define sz_xXiGMiscQueryViewsReq 8
+#define sz_xXiGMiscQueryResolutionsReq 8
+#define sz_xXiGMiscChangeResolutionReq 16
+#define sz_xXiGMiscFullScreenReq 16
+
+#define sz_xXiGMiscQueryVersionReply 32
+#define sz_xXiGMiscQueryViewsReply 32
+#define sz_xXiGMiscQueryResolutionsReply 32
+#define sz_xXiGMiscQueryFullScreenReply 32
+
+/*******************************************************************/
+
+typedef struct {
+ CARD8 reqType; /* always codes->major_opcode */
+ CARD8 xigmiscReqType; /* always X_XiGMiscQueryVersion */
+ CARD16 length;
+ CARD16 major;
+ CARD16 minor;
+} xXiGMiscQueryVersionReq;
+
+typedef struct {
+ CARD8 reqType; /* always codes->major_opcode */
+ CARD8 xigmiscReqType; /* always X_XiGMiscQueryViews */
+ CARD16 length;
+ CARD8 screen;
+ CARD8 pad0;
+ CARD16 pad1;
+} xXiGMiscQueryViewsReq;
+
+typedef struct {
+ CARD8 reqType; /* always codes->major_opcode */
+ CARD8 xigmiscReqType; /* always X_XiGMiscQueryResolutions */
+ CARD16 length;
+ CARD8 screen;
+ CARD8 view;
+ CARD16 pad0;
+} xXiGMiscQueryResolutionsReq;
+
+typedef struct {
+ CARD8 reqType; /* always codes->major_opcode */
+ CARD8 xigmiscReqType; /* always X_XiGMiscChangeResolution */
+ CARD16 length;
+ CARD8 screen;
+ CARD8 view;
+ CARD16 pad0;
+ CARD16 width;
+ CARD16 height;
+ INT32 refresh;
+} xXiGMiscChangeResolutionReq;
+
+typedef struct {
+ CARD8 reqType; /* always codes->major_opcode */
+ CARD8 xigmiscReqType; /* always X_XiGMiscFullScreen */
+ CARD16 length;
+ CARD8 screen;
+ CARD8 pad0;
+ CARD16 pad1;
+ CARD32 window;
+ CARD32 cmap;
+} xXiGMiscFullScreenReq;
+
+/*******************************************************************/
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 pad0;
+ CARD16 sequenceNumber;
+ CARD32 length;
+ CARD16 major;
+ CARD16 minor;
+ CARD32 pad1;
+ CARD32 pad2;
+ CARD32 pad3;
+ CARD32 pad4;
+ CARD32 pad5;
+} xXiGMiscQueryVersionReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 pad0;
+ CARD16 sequenceNumber;
+ CARD32 length;
+ CARD32 nviews;
+ CARD32 pad1;
+ CARD32 pad2;
+ CARD32 pad3;
+ CARD32 pad4;
+ CARD32 pad5;
+} xXiGMiscQueryViewsReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 pad0;
+ CARD16 sequenceNumber;
+ CARD32 length;
+ CARD16 active;
+ CARD16 nresolutions;
+ CARD32 pad1;
+ CARD32 pad2;
+ CARD32 pad3;
+ CARD32 pad4;
+ CARD32 pad5;
+} xXiGMiscQueryResolutionsReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL success;
+ CARD16 sequenceNumber;
+ CARD32 length;
+ CARD32 pad1;
+ CARD32 pad2;
+ CARD32 pad3;
+ CARD32 pad4;
+ CARD32 pad5;
+ CARD32 pad6;
+} xXiGMiscFullScreenReply;
+
+/*******************************************************************/
+
+typedef struct {
+ INT16 x;
+ INT16 y;
+ CARD16 w;
+ CARD16 h;
+} XiGMiscViewInfo;
+
+typedef struct {
+ CARD16 width;
+ CARD16 height;
+ INT32 refresh;
+} XiGMiscResolutionInfo;
+
+/*****************************************************************************/
+
+static XExtensionInfo *xigmisc_info = NULL;
+static char *xigmisc_extension_name = XIGMISC_PROTOCOL_NAME;
+
+#define XiGMiscCheckExtension(dpy,i,val) \
+ XextCheckExtension (dpy, i, xigmisc_extension_name, val)
+#define XiGMiscSimpleCheckExtension(dpy,i) \
+ XextSimpleCheckExtension (dpy, i, xigmisc_extension_name)
+
+#if defined(__STDC__) && !defined(UNIXCPP)
+#define XiGMiscGetReq(name,req,info) GetReq (name, req); \
+ req->reqType = info->codes->major_opcode; \
+ req->xigmiscReqType = X_##name;
+
+#define XiGMiscGetReqExtra(name,n,req,info) GetReqExtra (name, n, req); \
+ req->reqType = info->codes->major_opcode; \
+ req->xigmicReqType = X_##name;
+#else
+#define XiGMiscGetReq(name,req,info) GetReq (name, req); \
+ req->reqType = info->codes->major_opcode; \
+ req->xigmiscReqType = X_/**/name;
+#define XiGMiscGetReqExtra(name,n,req,info) GetReqExtra (name, n, req); \
+ req->reqType = info->codes->major_opcode; \
+ req->xigmiscReqType = X_/**/name;
+#endif
+
+
+
+/*
+ * find_display - locate the display info block
+ */
+static int XiGMiscCloseDisplay();
+
+static XExtensionHooks xigmisc_extension_hooks = {
+ NULL, /* create_gc */
+ NULL, /* copy_gc */
+ NULL, /* flush_gc */
+ NULL, /* free_gc */
+ NULL, /* create_font */
+ NULL, /* free_font */
+ XiGMiscCloseDisplay, /* close_display */
+ NULL, /* wire_to_event */
+ NULL, /* event_to_wire */
+ NULL, /* error */
+ NULL, /* error_string */
+};
+
+
+static XEXT_GENERATE_CLOSE_DISPLAY (XiGMiscCloseDisplay, xigmisc_info)
+
+static XEXT_GENERATE_FIND_DISPLAY (XiGMiscFindDisplay, xigmisc_info,
+ xigmisc_extension_name,
+ &xigmisc_extension_hooks, XiGMiscNumberEvents, NULL)
+
+
+/*****************************************************************************/
+
+Bool XiGMiscQueryVersion(Display *dpy, int *major, int *minor)
+{
+ int opcode, event, error;
+ xXiGMiscQueryVersionReq *req;
+ xXiGMiscQueryVersionReply rep;
+ XExtDisplayInfo *info = XiGMiscFindDisplay(dpy);
+
+ if (!XQueryExtension(dpy, XIGMISC_PROTOCOL_NAME, &opcode, &event, &error))
+ return xFalse;
+
+ XiGMiscCheckExtension(dpy, info, xFalse);
+
+ LockDisplay (dpy);
+ XiGMiscGetReq (XiGMiscQueryVersion, req, info);
+
+ req->major = XIGMISC_MAJOR_VERSION;
+ req->minor = XIGMISC_MINOR_VERSION;
+
+ if (!_XReply (dpy, (xReply *)&rep, 0, xTrue)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return xFalse;
+ }
+
+ *major = rep.major;
+ *minor = rep.minor;
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ return xTrue;
+}
+
+int XiGMiscQueryViews(Display *dpy, int screen, XiGMiscViewInfo **pviews)
+{
+ int n, size;
+ XiGMiscViewInfo *views;
+ xXiGMiscQueryViewsReq *req;
+ xXiGMiscQueryViewsReply rep;
+ XExtDisplayInfo *info = XiGMiscFindDisplay(dpy);
+ XiGMiscCheckExtension(dpy, info, 0);
+
+ LockDisplay (dpy);
+ XiGMiscGetReq (XiGMiscQueryViews, req, info);
+ req->screen = screen;
+
+ if (!_XReply (dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return 0;
+ }
+
+ n = rep.nviews;
+
+ if (n > 0) {
+ size = sizeof(XiGMiscViewInfo) * n;
+ views = (XiGMiscViewInfo*)Xmalloc(size);
+ if (!views) {
+ _XEatData(dpy, (unsigned long)size);
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return 0;
+ }
+
+ _XReadPad(dpy, (void*)views, size);
+
+ *pviews = views;
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ return n;
+}
+
+int XiGMiscQueryResolutions(Display *dpy, int screen, int view, int *pactive, XiGMiscResolutionInfo **presolutions)
+{
+ int n, size;
+ XiGMiscResolutionInfo *resolutions;
+ xXiGMiscQueryResolutionsReq *req;
+ xXiGMiscQueryResolutionsReply rep;
+ XExtDisplayInfo *info = XiGMiscFindDisplay(dpy);
+ XiGMiscCheckExtension(dpy, info, 0);
+
+ LockDisplay (dpy);
+ XiGMiscGetReq (XiGMiscQueryResolutions, req, info);
+ req->screen = screen;
+ req->view = view;
+
+ if (!_XReply (dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return 0;
+ }
+
+ n = rep.nresolutions;
+
+ if (n > 0) {
+ size = sizeof(XiGMiscResolutionInfo) * n;
+ resolutions = (XiGMiscResolutionInfo*)Xmalloc(size);
+ if (!resolutions) {
+ _XEatData(dpy, (unsigned long)size);
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return 0;
+ }
+
+ _XReadPad(dpy, (void*)resolutions, size);
+
+ *presolutions = resolutions;
+ *pactive = rep.active;
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ return n;
+}
+
+void XiGMiscChangeResolution(Display *dpy, int screen, int view, int width, int height, int refresh)
+{
+ xXiGMiscChangeResolutionReq *req;
+ XExtDisplayInfo *info = XiGMiscFindDisplay(dpy);
+
+ XiGMiscSimpleCheckExtension(dpy, info);
+
+ LockDisplay (dpy);
+ XiGMiscGetReq (XiGMiscChangeResolution, req, info);
+ req->screen = screen;
+ req->view = view;
+ req->width = width;
+ req->height = height;
+ req->refresh = refresh;
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+
+Bool XiGMiscFullScreen(Display *dpy, int screen, XID window, XID cmap)
+{
+ xXiGMiscFullScreenReq *req;
+ xXiGMiscFullScreenReply rep;
+ XExtDisplayInfo *info = XiGMiscFindDisplay(dpy);
+
+ XiGMiscCheckExtension(dpy, info, xFalse);
+
+ LockDisplay (dpy);
+ XiGMiscGetReq (XiGMiscFullScreen, req, info);
+ req->screen = screen;
+ req->pad0 = 0;
+ req->pad1 = 0;
+ req->window = window;
+ req->cmap = cmap;
+
+ if (!_XReply (dpy, (xReply *)&rep, 0, xTrue)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return xFalse;
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ return (rep.success ? xTrue : xFalse);
+}
+
+
+/* SDL addition from Ryan: free memory used by xme. */
+void XiGMiscDestroy(void)
+{
+ if (xigmisc_info) {
+ XextDestroyExtension(xigmisc_info);
+ xigmisc_info = NULL;
+ }
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/Xext/Xinerama/Xinerama.c b/distrib/sdl-1.2.15/src/video/Xext/Xinerama/Xinerama.c
new file mode 100644
index 0000000..4ff42eb
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/Xext/Xinerama/Xinerama.c
@@ -0,0 +1,324 @@
+/* $Xorg: XPanoramiX.c,v 1.4 2000/08/17 19:45:51 cpqbld Exp $ */
+/*****************************************************************
+Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
+BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of Digital Equipment Corporation
+shall not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from Digital
+Equipment Corporation.
+******************************************************************/
+/* $XFree86: xc/lib/Xinerama/Xinerama.c,v 1.2 2001/07/23 17:20:28 dawes Exp $ */
+
+#define NEED_EVENTS
+#define NEED_REPLIES
+
+/* Apparently some X11 systems can't include this multiple times... */
+#ifndef SDL_INCLUDED_XLIBINT_H
+#define SDL_INCLUDED_XLIBINT_H 1
+#include <X11/Xlibint.h>
+#endif
+
+#include <X11/Xutil.h>
+#include "../extensions/Xext.h"
+#include "../extensions/extutil.h" /* in ../include */
+#include "../extensions/panoramiXext.h"
+#include "../extensions/panoramiXproto.h" /* in ../include */
+#include "../extensions/Xinerama.h"
+
+static XExtensionInfo _panoramiX_ext_info_data;
+static XExtensionInfo *panoramiX_ext_info = &_panoramiX_ext_info_data;
+static /* const */ char *panoramiX_extension_name = PANORAMIX_PROTOCOL_NAME;
+
+#define PanoramiXCheckExtension(dpy,i,val) \
+ XextCheckExtension (dpy, i, panoramiX_extension_name, val)
+#define PanoramiXSimpleCheckExtension(dpy,i) \
+ XextSimpleCheckExtension (dpy, i, panoramiX_extension_name)
+
+static int close_display();
+static /* const */ XExtensionHooks panoramiX_extension_hooks = {
+ NULL, /* create_gc */
+ NULL, /* copy_gc */
+ NULL, /* flush_gc */
+ NULL, /* free_gc */
+ NULL, /* create_font */
+ NULL, /* free_font */
+ close_display, /* close_display */
+ NULL, /* wire_to_event */
+ NULL, /* event_to_wire */
+ NULL, /* error */
+ NULL, /* error_string */
+};
+
+static XEXT_GENERATE_FIND_DISPLAY (find_display, panoramiX_ext_info,
+ panoramiX_extension_name,
+ &panoramiX_extension_hooks,
+ 0, NULL)
+
+static XEXT_GENERATE_CLOSE_DISPLAY (close_display, panoramiX_ext_info)
+
+
+
+/****************************************************************************
+ * *
+ * PanoramiX public interfaces *
+ * *
+ ****************************************************************************/
+
+Bool SDL_NAME(XPanoramiXQueryExtension) (
+ Display *dpy,
+ int *event_basep,
+ int *error_basep
+)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+
+ if (XextHasExtension(info)) {
+ *event_basep = info->codes->first_event;
+ *error_basep = info->codes->first_error;
+ return True;
+ } else {
+ return False;
+ }
+}
+
+
+Status SDL_NAME(XPanoramiXQueryVersion)(
+ Display *dpy,
+ int *major_versionp,
+ int *minor_versionp
+)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xPanoramiXQueryVersionReply rep;
+ register xPanoramiXQueryVersionReq *req;
+
+ PanoramiXCheckExtension (dpy, info, 0);
+
+ LockDisplay (dpy);
+ GetReq (PanoramiXQueryVersion, req);
+ req->reqType = info->codes->major_opcode;
+ req->panoramiXReqType = X_PanoramiXQueryVersion;
+ req->clientMajor = PANORAMIX_MAJOR_VERSION;
+ req->clientMinor = PANORAMIX_MINOR_VERSION;
+ if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return 0;
+ }
+ *major_versionp = rep.majorVersion;
+ *minor_versionp = rep.minorVersion;
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return 1;
+}
+
+SDL_NAME(XPanoramiXInfo) *SDL_NAME(XPanoramiXAllocInfo)(void)
+{
+ return (SDL_NAME(XPanoramiXInfo) *) Xmalloc (sizeof (SDL_NAME(XPanoramiXInfo)));
+}
+
+Status SDL_NAME(XPanoramiXGetState) (
+ Display *dpy,
+ Drawable drawable,
+ SDL_NAME(XPanoramiXInfo) *panoramiX_info
+)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xPanoramiXGetStateReply rep;
+ register xPanoramiXGetStateReq *req;
+
+ PanoramiXCheckExtension (dpy, info, 0);
+
+ LockDisplay (dpy);
+ GetReq (PanoramiXGetState, req);
+ req->reqType = info->codes->major_opcode;
+ req->panoramiXReqType = X_PanoramiXGetState;
+ req->window = drawable;
+ if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return 0;
+ }
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ panoramiX_info->window = rep.window;
+ panoramiX_info->State = rep.state;
+ return 1;
+}
+
+Status SDL_NAME(XPanoramiXGetScreenCount) (
+ Display *dpy,
+ Drawable drawable,
+ SDL_NAME(XPanoramiXInfo) *panoramiX_info
+)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xPanoramiXGetScreenCountReply rep;
+ register xPanoramiXGetScreenCountReq *req;
+
+ PanoramiXCheckExtension (dpy, info, 0);
+
+ LockDisplay (dpy);
+ GetReq (PanoramiXGetScreenCount, req);
+ req->reqType = info->codes->major_opcode;
+ req->panoramiXReqType = X_PanoramiXGetScreenCount;
+ req->window = drawable;
+ if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return 0;
+ }
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ panoramiX_info->window = rep.window;
+ panoramiX_info->ScreenCount = rep.ScreenCount;
+ return 1;
+}
+
+Status SDL_NAME(XPanoramiXGetScreenSize) (
+ Display *dpy,
+ Drawable drawable,
+ int screen_num,
+ SDL_NAME(XPanoramiXInfo) *panoramiX_info
+)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xPanoramiXGetScreenSizeReply rep;
+ register xPanoramiXGetScreenSizeReq *req;
+
+ PanoramiXCheckExtension (dpy, info, 0);
+
+ LockDisplay (dpy);
+ GetReq (PanoramiXGetScreenSize, req);
+ req->reqType = info->codes->major_opcode;
+ req->panoramiXReqType = X_PanoramiXGetScreenSize;
+ req->window = drawable;
+ req->screen = screen_num; /* need to define */
+ if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return 0;
+ }
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ panoramiX_info->window = rep.window;
+ panoramiX_info->screen = rep.screen;
+ panoramiX_info->width = rep.width;
+ panoramiX_info->height = rep.height;
+ return 1;
+}
+
+/*******************************************************************\
+ Alternate interface to make up for shortcomings in the original,
+ namely, the omission of the screen origin. The new interface is
+ in the "Xinerama" namespace instead of "PanoramiX".
+\*******************************************************************/
+
+Bool SDL_NAME(XineramaQueryExtension) (
+ Display *dpy,
+ int *event_base,
+ int *error_base
+)
+{
+ return SDL_NAME(XPanoramiXQueryExtension)(dpy, event_base, error_base);
+}
+
+Status SDL_NAME(XineramaQueryVersion)(
+ Display *dpy,
+ int *major,
+ int *minor
+)
+{
+ return SDL_NAME(XPanoramiXQueryVersion)(dpy, major, minor);
+}
+
+Bool SDL_NAME(XineramaIsActive)(Display *dpy)
+{
+ xXineramaIsActiveReply rep;
+ xXineramaIsActiveReq *req;
+ XExtDisplayInfo *info = find_display (dpy);
+
+ if(!XextHasExtension(info))
+ return False; /* server doesn't even have the extension */
+
+ LockDisplay (dpy);
+ GetReq (XineramaIsActive, req);
+ req->reqType = info->codes->major_opcode;
+ req->panoramiXReqType = X_XineramaIsActive;
+ if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return False;
+ }
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return rep.state;
+}
+
+#include <stdio.h>
+
+SDL_NAME(XineramaScreenInfo) *
+SDL_NAME(XineramaQueryScreens)(
+ Display *dpy,
+ int *number
+)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXineramaQueryScreensReply rep;
+ xXineramaQueryScreensReq *req;
+ SDL_NAME(XineramaScreenInfo) *scrnInfo = NULL;
+
+ PanoramiXCheckExtension (dpy, info, 0);
+
+ LockDisplay (dpy);
+ GetReq (XineramaQueryScreens, req);
+ req->reqType = info->codes->major_opcode;
+ req->panoramiXReqType = X_XineramaQueryScreens;
+ if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return NULL;
+ }
+
+ if(rep.number) {
+ if((scrnInfo = Xmalloc(sizeof(SDL_NAME(XineramaScreenInfo)) * rep.number))) {
+ xXineramaScreenInfo scratch;
+ int i;
+
+ for(i = 0; i < rep.number; i++) {
+ _XRead(dpy, (char*)(&scratch), sz_XineramaScreenInfo);
+ scrnInfo[i].screen_number = i;
+ scrnInfo[i].x_org = scratch.x_org;
+ scrnInfo[i].y_org = scratch.y_org;
+ scrnInfo[i].width = scratch.width;
+ scrnInfo[i].height = scratch.height;
+ }
+
+ *number = rep.number;
+ } else
+ _XEatData(dpy, rep.length << 2);
+ }
+
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return scrnInfo;
+}
+
+
+
diff --git a/distrib/sdl-1.2.12/src/video/Xext/Xv/Xv.c b/distrib/sdl-1.2.15/src/video/Xext/Xv/Xv.c
index 7147b9e..7147b9e 100644
--- a/distrib/sdl-1.2.12/src/video/Xext/Xv/Xv.c
+++ b/distrib/sdl-1.2.15/src/video/Xext/Xv/Xv.c
diff --git a/distrib/sdl-1.2.15/src/video/Xext/Xv/Xvlibint.h b/distrib/sdl-1.2.15/src/video/Xext/Xv/Xvlibint.h
new file mode 100644
index 0000000..20df706
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/Xext/Xv/Xvlibint.h
@@ -0,0 +1,81 @@
+/***********************************************************
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
+and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the names of Digital or MIT not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+/* $XFree86: xc/lib/Xv/Xvlibint.h,v 1.5 2001/07/25 15:04:53 dawes Exp $ */
+
+#ifndef XVLIBINT_H
+#define XVLIBINT_H
+/*
+** File:
+**
+** Xvlibint.h --- Xv library internal header file
+**
+** Author:
+**
+** David Carver (Digital Workstation Engineering/Project Athena)
+**
+** Revisions:
+**
+** 01.24.91 Carver
+** - version 1.4 upgrade
+**
+*/
+
+#define NEED_REPLIES
+
+/* Apparently some X11 systems can't include this multiple times... */
+#ifndef SDL_INCLUDED_XLIBINT_H
+#define SDL_INCLUDED_XLIBINT_H 1
+#include <X11/Xlibint.h>
+#endif
+
+#include "../extensions/Xvproto.h"
+#include "../extensions/Xvlib.h"
+
+#if !defined(UNIXCPP)
+#define XvGetReq(name, req) \
+ WORD64ALIGN\
+ if ((dpy->bufptr + SIZEOF(xv##name##Req)) > dpy->bufmax)\
+ _XFlush(dpy);\
+ req = (xv##name##Req *)(dpy->last_req = dpy->bufptr);\
+ req->reqType = info->codes->major_opcode;\
+ req->xvReqType = xv_##name; \
+ req->length = (SIZEOF(xv##name##Req))>>2;\
+ dpy->bufptr += SIZEOF(xv##name##Req);\
+ dpy->request++
+
+#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */
+#define XvGetReq(name, req) \
+ WORD64ALIGN\
+ if ((dpy->bufptr + SIZEOF(xv/**/name/**/Req)) > dpy->bufmax)\
+ _XFlush(dpy);\
+ req = (xv/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\
+ req->reqType = info->codes->major_opcode;\
+ req->xvReqType = xv_/**/name;\
+ req->length = (SIZEOF(xv/**/name/**/Req))>>2;\
+ dpy->bufptr += SIZEOF(xv/**/name/**/Req);\
+ dpy->request++
+#endif
+
+
+#endif /* XVLIBINT_H */
diff --git a/distrib/sdl-1.2.15/src/video/Xext/Xxf86dga/XF86DGA.c b/distrib/sdl-1.2.15/src/video/Xext/Xxf86dga/XF86DGA.c
new file mode 100644
index 0000000..f2210e4
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/Xext/Xxf86dga/XF86DGA.c
@@ -0,0 +1,721 @@
+/* $XFree86: xc/lib/Xxf86dga/XF86DGA.c,v 3.19 2001/08/18 02:41:30 dawes Exp $ */
+/*
+
+Copyright (c) 1995 Jon Tombs
+Copyright (c) 1995,1996 The XFree86 Project, Inc
+
+*/
+
+/* THIS IS NOT AN X CONSORTIUM STANDARD */
+
+#ifdef __EMX__ /* needed here to override certain constants in X headers */
+#define INCL_DOS
+#define INCL_DOSIOCTL
+#include <os2.h>
+#endif
+
+#if defined(linux)
+#define HAS_MMAP_ANON
+#include <sys/types.h>
+#include <sys/mman.h>
+/*#include <asm/page.h>*/ /* PAGE_SIZE */
+#define HAS_SC_PAGESIZE /* _SC_PAGESIZE may be an enum for Linux */
+#define HAS_GETPAGESIZE
+#endif /* linux */
+
+#if defined(CSRG_BASED)
+#define HAS_MMAP_ANON
+#define HAS_GETPAGESIZE
+#include <sys/types.h>
+#include <sys/mman.h>
+#endif /* CSRG_BASED */
+
+#if defined(DGUX)
+#define HAS_GETPAGESIZE
+#define MMAP_DEV_ZERO
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#endif /* DGUX */
+
+#if defined(SVR4) && !defined(DGUX)
+#define MMAP_DEV_ZERO
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#endif /* SVR4 && !DGUX */
+
+#if defined(sun) && !defined(SVR4) /* SunOS */
+#define MMAP_DEV_ZERO /* doesn't SunOS have MAP_ANON ?? */
+#define HAS_GETPAGESIZE
+#include <sys/types.h>
+#include <sys/mman.h>
+#endif /* sun && !SVR4 */
+
+#ifdef XNO_SYSCONF
+#undef _SC_PAGESIZE
+#endif
+
+#define NEED_EVENTS
+#define NEED_REPLIES
+
+/* Apparently some X11 systems can't include this multiple times... */
+#ifndef SDL_INCLUDED_XLIBINT_H
+#define SDL_INCLUDED_XLIBINT_H 1
+#include <X11/Xlibint.h>
+#endif
+
+#include "../extensions/xf86dga.h"
+#include "../extensions/xf86dgastr.h"
+#include "../extensions/Xext.h"
+#include "../extensions/extutil.h"
+
+extern XExtDisplayInfo* SDL_NAME(xdga_find_display)(Display*);
+extern char *SDL_NAME(xdga_extension_name);
+
+#define XF86DGACheckExtension(dpy,i,val) \
+ XextCheckExtension (dpy, i, SDL_NAME(xdga_extension_name), val)
+
+/*****************************************************************************
+ * *
+ * public XFree86-DGA Extension routines *
+ * *
+ *****************************************************************************/
+
+Bool SDL_NAME(XF86DGAQueryExtension) (
+ Display *dpy,
+ int *event_basep,
+ int *error_basep
+){
+ return SDL_NAME(XDGAQueryExtension)(dpy, event_basep, error_basep);
+}
+
+Bool SDL_NAME(XF86DGAQueryVersion)(
+ Display* dpy,
+ int* majorVersion,
+ int* minorVersion
+){
+ return SDL_NAME(XDGAQueryVersion)(dpy, majorVersion, minorVersion);
+}
+
+Bool SDL_NAME(XF86DGAGetVideoLL)(
+ Display* dpy,
+ int screen,
+ int *offset,
+ int *width,
+ int *bank_size,
+ int *ram_size
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXF86DGAGetVideoLLReply rep;
+ xXF86DGAGetVideoLLReq *req;
+
+ XF86DGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86DGAGetVideoLL, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XF86DGAGetVideoLL;
+ req->screen = screen;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+
+ *offset = /*(char *)*/rep.offset;
+ *width = rep.width;
+ *bank_size = rep.bank_size;
+ *ram_size = rep.ram_size;
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+
+Bool SDL_NAME(XF86DGADirectVideoLL)(
+ Display* dpy,
+ int screen,
+ int enable
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXF86DGADirectVideoReq *req;
+
+ XF86DGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86DGADirectVideo, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XF86DGADirectVideo;
+ req->screen = screen;
+ req->enable = enable;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ XSync(dpy,False);
+ return True;
+}
+
+Bool SDL_NAME(XF86DGAGetViewPortSize)(
+ Display* dpy,
+ int screen,
+ int *width,
+ int *height
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXF86DGAGetViewPortSizeReply rep;
+ xXF86DGAGetViewPortSizeReq *req;
+
+ XF86DGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86DGAGetViewPortSize, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XF86DGAGetViewPortSize;
+ req->screen = screen;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+
+ *width = rep.width;
+ *height = rep.height;
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+
+Bool SDL_NAME(XF86DGASetViewPort)(
+ Display* dpy,
+ int screen,
+ int x,
+ int y
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXF86DGASetViewPortReq *req;
+
+ XF86DGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86DGASetViewPort, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XF86DGASetViewPort;
+ req->screen = screen;
+ req->x = x;
+ req->y = y;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ XSync(dpy,False);
+ return True;
+}
+
+
+Bool SDL_NAME(XF86DGAGetVidPage)(
+ Display* dpy,
+ int screen,
+ int *vpage
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXF86DGAGetVidPageReply rep;
+ xXF86DGAGetVidPageReq *req;
+
+ XF86DGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86DGAGetVidPage, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XF86DGAGetVidPage;
+ req->screen = screen;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+
+ *vpage = rep.vpage;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+
+Bool SDL_NAME(XF86DGASetVidPage)(
+ Display* dpy,
+ int screen,
+ int vpage
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXF86DGASetVidPageReq *req;
+
+ XF86DGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86DGASetVidPage, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XF86DGASetVidPage;
+ req->screen = screen;
+ req->vpage = vpage;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ XSync(dpy,False);
+ return True;
+}
+
+Bool SDL_NAME(XF86DGAInstallColormap)(
+ Display* dpy,
+ int screen,
+ Colormap cmap
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXF86DGAInstallColormapReq *req;
+
+ XF86DGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86DGAInstallColormap, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XF86DGAInstallColormap;
+ req->screen = screen;
+ req->id = cmap;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ XSync(dpy,False);
+ return True;
+}
+
+Bool SDL_NAME(XF86DGAQueryDirectVideo)(
+ Display *dpy,
+ int screen,
+ int *flags
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXF86DGAQueryDirectVideoReply rep;
+ xXF86DGAQueryDirectVideoReq *req;
+
+ XF86DGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86DGAQueryDirectVideo, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XF86DGAQueryDirectVideo;
+ req->screen = screen;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ *flags = rep.flags;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool SDL_NAME(XF86DGAViewPortChanged)(
+ Display *dpy,
+ int screen,
+ int n
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXF86DGAViewPortChangedReply rep;
+ xXF86DGAViewPortChangedReq *req;
+
+ XF86DGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86DGAViewPortChanged, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XF86DGAViewPortChanged;
+ req->screen = screen;
+ req->n = n;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return rep.result;
+}
+
+
+
+/* Helper functions */
+
+#include <X11/Xmd.h>
+#include "../extensions/xf86dga.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#if defined(ISC)
+# define HAS_SVR3_MMAP
+# include <sys/types.h>
+# include <errno.h>
+
+# include <sys/at_ansi.h>
+# include <sys/kd.h>
+
+# include <sys/sysmacros.h>
+# include <sys/immu.h>
+# include <sys/region.h>
+
+# include <sys/mmap.h>
+#else
+# if !defined(Lynx)
+# if !defined(__EMX__)
+# include <sys/mman.h>
+# endif
+# else
+# include <sys/types.h>
+# include <errno.h>
+# include <smem.h>
+# endif
+#endif
+#include <sys/wait.h>
+#include <signal.h>
+#include <unistd.h>
+
+#if defined(SVR4) && !defined(sun) && !defined(SCO325)
+#define DEV_MEM "/dev/pmem"
+#elif defined(SVR4) && defined(sun)
+#define DEV_MEM "/dev/xsvc"
+#else
+#define DEV_MEM "/dev/mem"
+#endif
+
+typedef struct {
+ unsigned long physaddr; /* actual requested physical address */
+ unsigned long size; /* actual requested map size */
+ unsigned long delta; /* delta to account for page alignment */
+ void * vaddr; /* mapped address, without the delta */
+ int refcount; /* reference count */
+} MapRec, *MapPtr;
+
+typedef struct {
+ Display * display;
+ int screen;
+ MapPtr map;
+} ScrRec, *ScrPtr;
+
+static int mapFd = -1;
+static int numMaps = 0;
+static int numScrs = 0;
+static MapPtr *mapList = NULL;
+static ScrPtr *scrList = NULL;
+
+static MapPtr
+AddMap(void)
+{
+ MapPtr *old;
+
+ old = mapList;
+ mapList = realloc(mapList, sizeof(MapPtr) * (numMaps + 1));
+ if (!mapList) {
+ mapList = old;
+ return NULL;
+ }
+ mapList[numMaps] = malloc(sizeof(MapRec));
+ if (!mapList[numMaps])
+ return NULL;
+ return mapList[numMaps++];
+}
+
+static ScrPtr
+AddScr(void)
+{
+ ScrPtr *old;
+
+ old = scrList;
+ scrList = realloc(scrList, sizeof(ScrPtr) * (numScrs + 1));
+ if (!scrList) {
+ scrList = old;
+ return NULL;
+ }
+ scrList[numScrs] = malloc(sizeof(ScrRec));
+ if (!scrList[numScrs])
+ return NULL;
+ return scrList[numScrs++];
+}
+
+static MapPtr
+FindMap(unsigned long address, unsigned long size)
+{
+ int i;
+
+ for (i = 0; i < numMaps; i++) {
+ if (mapList[i]->physaddr == address &&
+ mapList[i]->size == size)
+ return mapList[i];
+ }
+ return NULL;
+}
+
+static ScrPtr
+FindScr(Display *display, int screen)
+{
+ int i;
+
+ for (i = 0; i < numScrs; i++) {
+ if (scrList[i]->display == display &&
+ scrList[i]->screen == screen)
+ return scrList[i];
+ }
+ return NULL;
+}
+
+static void *
+MapPhysAddress(unsigned long address, unsigned long size)
+{
+ unsigned long offset, delta;
+ int pagesize = -1;
+ void *vaddr;
+ MapPtr mp;
+#if defined(ISC) && defined(HAS_SVR3_MMAP)
+ struct kd_memloc mloc;
+#elif defined(__EMX__)
+ APIRET rc;
+ ULONG action;
+ HFILE hfd;
+#endif
+
+ if ((mp = FindMap(address, size))) {
+ mp->refcount++;
+ return (void *)((unsigned long)mp->vaddr + mp->delta);
+ }
+
+#if defined(_SC_PAGESIZE) && defined(HAS_SC_PAGESIZE)
+ pagesize = sysconf(_SC_PAGESIZE);
+#endif
+#ifdef _SC_PAGE_SIZE
+ if (pagesize == -1)
+ pagesize = sysconf(_SC_PAGE_SIZE);
+#endif
+#ifdef HAS_GETPAGESIZE
+ if (pagesize == -1)
+ pagesize = getpagesize();
+#endif
+#ifdef PAGE_SIZE
+ if (pagesize == -1)
+ pagesize = PAGE_SIZE;
+#endif
+ if (pagesize == -1)
+ pagesize = 4096;
+
+ delta = address % pagesize;
+ offset = address - delta;
+
+#if defined(ISC) && defined(HAS_SVR3_MMAP)
+ if (mapFd < 0) {
+ if ((mapFd = open("/dev/mmap", O_RDWR)) < 0)
+ return NULL;
+ }
+ mloc.vaddr = (char *)0;
+ mloc.physaddr = (char *)offset;
+ mloc.length = size + delta;
+ mloc.ioflg=1;
+
+ if ((vaddr = (void *)ioctl(mapFd, MAP, &mloc)) == (void *)-1)
+ return NULL;
+#elif defined (__EMX__)
+ /*
+ * Dragon warning here! /dev/pmap$ is never closed, except on progam exit.
+ * Consecutive calling of this routine will make PMAP$ driver run out
+ * of memory handles. Some umap/close mechanism should be provided
+ */
+
+ rc = DosOpen("/dev/pmap$", &hfd, &action, 0, FILE_NORMAL, FILE_OPEN,
+ OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE, (PEAOP2)NULL);
+ if (rc != 0)
+ return NULL;
+ {
+ struct map_ioctl {
+ union {
+ ULONG phys;
+ void* user;
+ } a;
+ ULONG size;
+ } pmap,dmap;
+ ULONG plen,dlen;
+#define XFREE86_PMAP 0x76
+#define PMAP_MAP 0x44
+
+ pmap.a.phys = offset;
+ pmap.size = size + delta;
+ rc = DosDevIOCtl(hfd, XFREE86_PMAP, PMAP_MAP,
+ (PULONG)&pmap, sizeof(pmap), &plen,
+ (PULONG)&dmap, sizeof(dmap), &dlen);
+ if (rc == 0) {
+ vaddr = dmap.a.user;
+ }
+ }
+ if (rc != 0)
+ return NULL;
+#elif defined (Lynx)
+ vaddr = (void *)smem_create("XF86DGA", (char *)offset,
+ size + delta, SM_READ|SM_WRITE);
+#else
+#ifndef MAP_FILE
+#define MAP_FILE 0
+#endif
+ if (mapFd < 0) {
+ if ((mapFd = open(DEV_MEM, O_RDWR)) < 0)
+ return NULL;
+ }
+ vaddr = (void *)mmap(NULL, size + delta, PROT_READ | PROT_WRITE,
+ MAP_FILE | MAP_SHARED, mapFd, (off_t)offset);
+ if (vaddr == (void *)-1)
+ return NULL;
+#endif
+
+ if (!vaddr) {
+ if (!(mp = AddMap()))
+ return NULL;
+ mp->physaddr = address;
+ mp->size = size;
+ mp->delta = delta;
+ mp->vaddr = vaddr;
+ mp->refcount = 1;
+ }
+ return (void *)((unsigned long)vaddr + delta);
+}
+
+/*
+ * Still need to find a clean way of detecting the death of a DGA app
+ * and returning things to normal - Jon
+ * This is here to help debugging without rebooting... Also C-A-BS
+ * should restore text mode.
+ */
+
+int
+SDL_NAME(XF86DGAForkApp)(int screen)
+{
+ pid_t pid;
+ int status;
+ int i;
+
+ /* fork the app, parent hangs around to clean up */
+ if ((pid = fork()) > 0) {
+ ScrPtr sp;
+
+ waitpid(pid, &status, 0);
+ for (i = 0; i < numScrs; i++) {
+ sp = scrList[i];
+ SDL_NAME(XF86DGADirectVideoLL)(sp->display, sp->screen, 0);
+ XSync(sp->display, False);
+ }
+ if (WIFEXITED(status))
+ exit(0);
+ else
+ exit(-1);
+ }
+ return pid;
+}
+
+
+Bool
+SDL_NAME(XF86DGADirectVideo)(
+ Display *dis,
+ int screen,
+ int enable
+){
+ ScrPtr sp;
+ MapPtr mp = NULL;
+
+ if ((sp = FindScr(dis, screen)))
+ mp = sp->map;
+
+ if (enable & XF86DGADirectGraphics) {
+#if !defined(ISC) && !defined(HAS_SVR3_MMAP) && !defined(Lynx) \
+ && !defined(__EMX__)
+ if (mp && mp->vaddr)
+ mprotect(mp->vaddr, mp->size + mp->delta, PROT_READ | PROT_WRITE);
+#endif
+ } else {
+#if !defined(ISC) && !defined(HAS_SVR3_MMAP) && !defined(Lynx) \
+ && !defined(__EMX__)
+ if (mp && mp->vaddr)
+ mprotect(mp->vaddr, mp->size + mp->delta, PROT_READ);
+#elif defined(Lynx)
+ /* XXX this doesn't allow enable after disable */
+ smem_create(NULL, mp->vaddr, mp->size + mp->delta, SM_DETACH);
+ smem_remove("XF86DGA");
+#endif
+ }
+
+ SDL_NAME(XF86DGADirectVideoLL)(dis, screen, enable);
+ return 1;
+}
+
+
+static void
+XF86cleanup(int sig)
+{
+ ScrPtr sp;
+ int i;
+ static char beenhere = 0;
+
+ if (beenhere)
+ exit(3);
+ beenhere = 1;
+
+ for (i = 0; i < numScrs; i++) {
+ sp = scrList[i];
+ SDL_NAME(XF86DGADirectVideo)(sp->display, sp->screen, 0);
+ XSync(sp->display, False);
+ }
+ exit(3);
+}
+
+Bool
+SDL_NAME(XF86DGAGetVideo)(
+ Display *dis,
+ int screen,
+ char **addr,
+ int *width,
+ int *bank,
+ int *ram
+){
+ /*unsigned long*/ int offset;
+ static int beenHere = 0;
+ ScrPtr sp;
+ MapPtr mp;
+
+ if (!(sp = FindScr(dis, screen))) {
+ if (!(sp = AddScr())) {
+ fprintf(stderr, "XF86DGAGetVideo: malloc failure\n");
+ exit(-2);
+ }
+ sp->display = dis;
+ sp->screen = screen;
+ sp->map = NULL;
+ }
+
+ SDL_NAME(XF86DGAGetVideoLL)(dis, screen , &offset, width, bank, ram);
+
+ *addr = MapPhysAddress(offset, *bank);
+ if (*addr == NULL) {
+ fprintf(stderr, "XF86DGAGetVideo: failed to map video memory (%s)\n",
+ strerror(errno));
+ exit(-2);
+ }
+
+ if ((mp = FindMap(offset, *bank)))
+ sp->map = mp;
+
+ if (!beenHere) {
+ beenHere = 1;
+ atexit((void(*)(void))XF86cleanup);
+ /* one shot XF86cleanup attempts */
+ signal(SIGSEGV, XF86cleanup);
+#ifdef SIGBUS
+ signal(SIGBUS, XF86cleanup);
+#endif
+ signal(SIGHUP, XF86cleanup);
+ signal(SIGFPE, XF86cleanup);
+ }
+
+ return 1;
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/Xext/Xxf86dga/XF86DGA2.c b/distrib/sdl-1.2.15/src/video/Xext/Xxf86dga/XF86DGA2.c
new file mode 100644
index 0000000..11d4fdd
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/Xext/Xxf86dga/XF86DGA2.c
@@ -0,0 +1,993 @@
+/* $XFree86: xc/lib/Xxf86dga/XF86DGA2.c,v 1.18 2001/08/17 13:27:51 dawes Exp $ */
+/*
+
+Copyright (c) 1995 Jon Tombs
+Copyright (c) 1995,1996 The XFree86 Project, Inc
+
+*/
+
+/* THIS IS NOT AN X CONSORTIUM STANDARD */
+
+#ifdef __EMX__ /* needed here to override certain constants in X headers */
+#define INCL_DOS
+#define INCL_DOSIOCTL
+#include <os2.h>
+#endif
+
+#define NEED_EVENTS
+#define NEED_REPLIES
+
+/* Apparently some X11 systems can't include this multiple times... */
+#ifndef SDL_INCLUDED_XLIBINT_H
+#define SDL_INCLUDED_XLIBINT_H 1
+#include <X11/Xlibint.h>
+#endif
+
+#include "../extensions/xf86dga.h"
+#include "../extensions/xf86dgastr.h"
+#include "../extensions/Xext.h"
+#include "../extensions/extutil.h"
+#include <stdio.h>
+
+#if defined(ENABLE_FBCON) /* Needed for framebuffer console support */
+#include <sys/ioctl.h>
+#include <linux/fb.h>
+#endif
+
+/* If you change this, change the Bases[] array below as well */
+#define MAX_HEADS 16
+
+char *SDL_NAME(xdga_extension_name) = XF86DGANAME;
+
+static XExtensionInfo _xdga_info_data;
+static XExtensionInfo *xdga_info = &_xdga_info_data;
+
+
+Bool SDL_NAME(XDGAMapFramebuffer)(int, char *, unsigned char*, CARD32, CARD32, CARD32);
+void SDL_NAME(XDGAUnmapFramebuffer)(int);
+unsigned char* SDL_NAME(XDGAGetMappedMemory)(int);
+
+#define XDGACheckExtension(dpy,i,val) \
+ XextCheckExtension (dpy, i, SDL_NAME(xdga_extension_name), val)
+
+/*****************************************************************************
+ * *
+ * private utility routines *
+ * *
+ *****************************************************************************/
+
+static int xdga_close_display(Display *dpy, XExtCodes *codes);
+static Bool xdga_wire_to_event(Display *dpy, XEvent *event, xEvent *wire_ev);
+static Status xdga_event_to_wire(Display *dpy, XEvent *event, xEvent *wire_ev);
+
+static XExtensionHooks xdga_extension_hooks = {
+ NULL, /* create_gc */
+ NULL, /* copy_gc */
+ NULL, /* flush_gc */
+ NULL, /* free_gc */
+ NULL, /* create_font */
+ NULL, /* free_font */
+ xdga_close_display, /* close_display */
+ xdga_wire_to_event, /* wire_to_event */
+ xdga_event_to_wire, /* event_to_wire */
+ NULL, /* error */
+ NULL, /* error_string */
+};
+
+static XEXT_GENERATE_CLOSE_DISPLAY (xdga_close_display, xdga_info)
+
+
+XEXT_GENERATE_FIND_DISPLAY (SDL_NAME(xdga_find_display), xdga_info,
+ "XFree86-DGA",
+ &xdga_extension_hooks,
+ 0, NULL)
+
+
+static Status
+xdga_event_to_wire(
+ Display *dpy,
+ XEvent *event,
+ xEvent *wire_ev
+){
+ return True;
+}
+
+static Bool
+xdga_wire_to_event(
+ Display *dpy,
+ XEvent *event,
+ xEvent *wire_ev
+){
+ dgaEvent *wire = (dgaEvent *) wire_ev;
+ SDL_NAME(XDGAButtonEvent) *bevent;
+ SDL_NAME(XDGAKeyEvent) *kevent;
+ SDL_NAME(XDGAMotionEvent) *mevent;
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+
+ XDGACheckExtension (dpy, info, False);
+
+ switch((wire->u.u.type & 0x7f) - info->codes->first_event) {
+ case MotionNotify:
+ mevent = (SDL_NAME(XDGAMotionEvent)*)event;
+ mevent->type = wire->u.u.type & 0x7F;
+ mevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *)wire);
+ mevent->display = dpy;
+ mevent->screen = wire->u.event.screen;
+ mevent->time = wire->u.event.time;
+ mevent->state = wire->u.event.state;
+ mevent->dx = wire->u.event.dx;
+ mevent->dy = wire->u.event.dy;
+ return True;
+ case ButtonPress:
+ case ButtonRelease:
+ bevent = (SDL_NAME(XDGAButtonEvent)*)event;
+ bevent->type = wire->u.u.type & 0x7F;
+ bevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *)wire);
+ bevent->display = dpy;
+ bevent->screen = wire->u.event.screen;
+ bevent->time = wire->u.event.time;
+ bevent->state = wire->u.event.state;
+ bevent->button = wire->u.u.detail;
+ return True;
+ case KeyPress:
+ case KeyRelease:
+ kevent = (SDL_NAME(XDGAKeyEvent)*)event;
+ kevent->type = wire->u.u.type & 0x7F;
+ kevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *)wire);
+ kevent->display = dpy;
+ kevent->screen = wire->u.event.screen;
+ kevent->time = wire->u.event.time;
+ kevent->state = wire->u.event.state;
+ kevent->keycode = wire->u.u.detail;
+ return True;
+ }
+
+ return False;
+}
+
+
+Bool SDL_NAME(XDGAQueryExtension) (
+ Display *dpy,
+ int *event_basep,
+ int *error_basep
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+
+ if (XextHasExtension(info)) {
+ *event_basep = info->codes->first_event;
+ *error_basep = info->codes->first_error;
+ return True;
+ } else {
+ return False;
+ }
+}
+
+
+Bool SDL_NAME(XDGAQueryVersion)(
+ Display *dpy,
+ int *majorVersion,
+ int *minorVersion
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXDGAQueryVersionReply rep;
+ xXDGAQueryVersionReq *req;
+
+ XDGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XDGAQueryVersion, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGAQueryVersion;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ *majorVersion = rep.majorVersion;
+ *minorVersion = rep.minorVersion;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ if (*majorVersion >= 2)
+ {
+ int i, j;
+
+ for (i = 0, j = info->codes->first_event;
+ i < XF86DGANumberEvents;
+ i++, j++)
+ {
+ XESetWireToEvent(dpy, j, xdga_wire_to_event);
+ XESetEventToWire(dpy, j, xdga_event_to_wire);
+ }
+ SDL_NAME(XDGASetClientVersion)(dpy);
+ }
+ return True;
+}
+
+Bool SDL_NAME(XDGASetClientVersion)(
+ Display *dpy
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXDGASetClientVersionReq *req;
+
+ XDGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XDGASetClientVersion, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGASetClientVersion;
+ req->major = XDGA_MAJOR_VERSION;
+ req->minor = XDGA_MINOR_VERSION;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool SDL_NAME(XDGAOpenFramebuffer)(
+ Display *dpy,
+ int screen
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXDGAOpenFramebufferReply rep;
+ xXDGAOpenFramebufferReq *req;
+ char *deviceName = NULL;
+ Bool ret;
+
+ XDGACheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XDGAOpenFramebuffer, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGAOpenFramebuffer;
+ req->screen = screen;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+
+ if(rep.length) {
+ deviceName = Xmalloc(rep.length << 2);
+ _XRead(dpy, deviceName, rep.length << 2);
+ }
+
+ ret = SDL_NAME(XDGAMapFramebuffer)(screen, deviceName,
+ (unsigned char*)(long)rep.mem1,
+ rep.size, rep.offset, rep.extra);
+
+ if(deviceName)
+ Xfree(deviceName);
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return ret;
+}
+
+void SDL_NAME(XDGACloseFramebuffer)(
+ Display *dpy,
+ int screen
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXDGACloseFramebufferReq *req;
+
+ XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name));
+
+ SDL_NAME(XDGAUnmapFramebuffer)(screen);
+
+ LockDisplay(dpy);
+ GetReq(XDGACloseFramebuffer, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGACloseFramebuffer;
+ req->screen = screen;
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+
+
+SDL_NAME(XDGAMode)* SDL_NAME(XDGAQueryModes)(
+ Display *dpy,
+ int screen,
+ int *num
+){
+ XExtDisplayInfo *dinfo = SDL_NAME(xdga_find_display) (dpy);
+ xXDGAQueryModesReply rep;
+ xXDGAQueryModesReq *req;
+ SDL_NAME(XDGAMode) *modes = NULL;
+
+ *num = 0;
+
+ XDGACheckExtension (dpy, dinfo, NULL);
+
+ LockDisplay(dpy);
+ GetReq(XDGAQueryModes, req);
+ req->reqType = dinfo->codes->major_opcode;
+ req->dgaReqType = X_XDGAQueryModes;
+ req->screen = screen;
+
+ if (_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ if(rep.length) {
+ xXDGAModeInfo info;
+ int i, size;
+ char *offset;
+
+ size = rep.length << 2;
+ size -= rep.number * sz_xXDGAModeInfo; /* find text size */
+ modes = (SDL_NAME(XDGAMode)*)Xmalloc((rep.number * sizeof(SDL_NAME(XDGAMode))) + size);
+ offset = (char*)(&modes[rep.number]); /* start of text */
+
+
+ if(modes) {
+ for(i = 0; i < rep.number; i++) {
+ _XRead(dpy, (char*)(&info), sz_xXDGAModeInfo);
+
+ modes[i].num = info.num;
+ modes[i].verticalRefresh =
+ (float)info.vsync_num / (float)info.vsync_den;
+ modes[i].flags = info.flags;
+ modes[i].imageWidth = info.image_width;
+ modes[i].imageHeight = info.image_height;
+ modes[i].pixmapWidth = info.pixmap_width;
+ modes[i].pixmapHeight = info.pixmap_height;
+ modes[i].bytesPerScanline = info.bytes_per_scanline;
+ modes[i].byteOrder = info.byte_order;
+ modes[i].depth = info.depth;
+ modes[i].bitsPerPixel = info.bpp;
+ modes[i].redMask = info.red_mask;
+ modes[i].greenMask = info.green_mask;
+ modes[i].blueMask = info.blue_mask;
+ modes[i].visualClass = info.visual_class;
+ modes[i].viewportWidth = info.viewport_width;
+ modes[i].viewportHeight = info.viewport_height;
+ modes[i].xViewportStep = info.viewport_xstep;
+ modes[i].yViewportStep = info.viewport_ystep;
+ modes[i].maxViewportX = info.viewport_xmax;
+ modes[i].maxViewportY = info.viewport_ymax;
+ modes[i].viewportFlags = info.viewport_flags;
+ modes[i].reserved1 = info.reserved1;
+ modes[i].reserved2 = info.reserved2;
+
+ _XRead(dpy, offset, info.name_size);
+ modes[i].name = offset;
+ offset += info.name_size;
+ }
+ *num = rep.number;
+ } else
+ _XEatData(dpy, rep.length << 2);
+ }
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ return modes;
+}
+
+
+SDL_NAME(XDGADevice) *
+SDL_NAME(XDGASetMode)(
+ Display *dpy,
+ int screen,
+ int mode
+){
+ XExtDisplayInfo *dinfo = SDL_NAME(xdga_find_display) (dpy);
+ xXDGASetModeReply rep;
+ xXDGASetModeReq *req;
+ SDL_NAME(XDGADevice) *dev = NULL;
+ Pixmap pid;
+
+ XDGACheckExtension (dpy, dinfo, NULL);
+
+ LockDisplay(dpy);
+ GetReq(XDGASetMode, req);
+ req->reqType = dinfo->codes->major_opcode;
+ req->dgaReqType = X_XDGASetMode;
+ req->screen = screen;
+ req->mode = mode;
+ req->pid = pid = XAllocID(dpy);
+
+ if (_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ if(rep.length) {
+ xXDGAModeInfo info;
+ int size;
+
+ size = rep.length << 2;
+ size -= sz_xXDGAModeInfo; /* get text size */
+
+ dev = (SDL_NAME(XDGADevice)*)Xmalloc(sizeof(SDL_NAME(XDGADevice)) + size);
+
+ if(dev) {
+ _XRead(dpy, (char*)(&info), sz_xXDGAModeInfo);
+
+ dev->mode.num = info.num;
+ dev->mode.verticalRefresh =
+ (float)info.vsync_num / (float)info.vsync_den;
+ dev->mode.flags = info.flags;
+ dev->mode.imageWidth = info.image_width;
+ dev->mode.imageHeight = info.image_height;
+ dev->mode.pixmapWidth = info.pixmap_width;
+ dev->mode.pixmapHeight = info.pixmap_height;
+ dev->mode.bytesPerScanline = info.bytes_per_scanline;
+ dev->mode.byteOrder = info.byte_order;
+ dev->mode.depth = info.depth;
+ dev->mode.bitsPerPixel = info.bpp;
+ dev->mode.redMask = info.red_mask;
+ dev->mode.greenMask = info.green_mask;
+ dev->mode.blueMask = info.blue_mask;
+ dev->mode.visualClass = info.visual_class;
+ dev->mode.viewportWidth = info.viewport_width;
+ dev->mode.viewportHeight = info.viewport_height;
+ dev->mode.xViewportStep = info.viewport_xstep;
+ dev->mode.yViewportStep = info.viewport_ystep;
+ dev->mode.maxViewportX = info.viewport_xmax;
+ dev->mode.maxViewportY = info.viewport_ymax;
+ dev->mode.viewportFlags = info.viewport_flags;
+ dev->mode.reserved1 = info.reserved1;
+ dev->mode.reserved2 = info.reserved2;
+
+ dev->mode.name = (char*)(&dev[1]);
+ _XRead(dpy, dev->mode.name, info.name_size);
+
+ dev->pixmap = (rep.flags & XDGAPixmap) ? pid : 0;
+ dev->data = SDL_NAME(XDGAGetMappedMemory)(screen);
+
+ if(dev->data)
+ dev->data += rep.offset;
+ }
+ /* not sure what to do if the allocation fails */
+ }
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ return dev;
+}
+
+
+void SDL_NAME(XDGASetViewport)(
+ Display *dpy,
+ int screen,
+ int x,
+ int y,
+ int flags
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXDGASetViewportReq *req;
+
+ XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name));
+
+ LockDisplay(dpy);
+ GetReq(XDGASetViewport, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGASetViewport;
+ req->screen = screen;
+ req->x = x;
+ req->y = y;
+ req->flags = flags;
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+
+void SDL_NAME(XDGAInstallColormap)(
+ Display *dpy,
+ int screen,
+ Colormap cmap
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXDGAInstallColormapReq *req;
+
+ XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name));
+
+ LockDisplay(dpy);
+ GetReq(XDGAInstallColormap, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGAInstallColormap;
+ req->screen = screen;
+ req->cmap = cmap;
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+void SDL_NAME(XDGASelectInput)(
+ Display *dpy,
+ int screen,
+ long mask
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXDGASelectInputReq *req;
+
+ XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name));
+
+ LockDisplay(dpy);
+ GetReq(XDGASelectInput, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGASelectInput;
+ req->screen = screen;
+ req->mask = mask;
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+void SDL_NAME(XDGAFillRectangle)(
+ Display *dpy,
+ int screen,
+ int x,
+ int y,
+ unsigned int width,
+ unsigned int height,
+ unsigned long color
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXDGAFillRectangleReq *req;
+
+ XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name));
+
+ LockDisplay(dpy);
+ GetReq(XDGAFillRectangle, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGAFillRectangle;
+ req->screen = screen;
+ req->x = x;
+ req->y = y;
+ req->width = width;
+ req->height = height;
+ req->color = color;
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+void SDL_NAME(XDGACopyArea)(
+ Display *dpy,
+ int screen,
+ int srcx,
+ int srcy,
+ unsigned int width,
+ unsigned int height,
+ int dstx,
+ int dsty
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXDGACopyAreaReq *req;
+
+ XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name));
+
+ LockDisplay(dpy);
+ GetReq(XDGACopyArea, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGACopyArea;
+ req->screen = screen;
+ req->srcx = srcx;
+ req->srcy = srcy;
+ req->width = width;
+ req->height = height;
+ req->dstx = dstx;
+ req->dsty = dsty;
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+void SDL_NAME(XDGACopyTransparentArea)(
+ Display *dpy,
+ int screen,
+ int srcx,
+ int srcy,
+ unsigned int width,
+ unsigned int height,
+ int dstx,
+ int dsty,
+ unsigned long key
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXDGACopyTransparentAreaReq *req;
+
+ XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name));
+
+ LockDisplay(dpy);
+ GetReq(XDGACopyTransparentArea, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGACopyTransparentArea;
+ req->screen = screen;
+ req->srcx = srcx;
+ req->srcy = srcy;
+ req->width = width;
+ req->height = height;
+ req->dstx = dstx;
+ req->dsty = dsty;
+ req->key = key;
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+
+int SDL_NAME(XDGAGetViewportStatus)(
+ Display *dpy,
+ int screen
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXDGAGetViewportStatusReply rep;
+ xXDGAGetViewportStatusReq *req;
+ int status = 0;
+
+ XDGACheckExtension (dpy, info, 0);
+
+ LockDisplay(dpy);
+ GetReq(XDGAGetViewportStatus, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGAGetViewportStatus;
+ req->screen = screen;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse))
+ status = rep.status;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return status;
+}
+
+void SDL_NAME(XDGASync)(
+ Display *dpy,
+ int screen
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXDGASyncReply rep;
+ xXDGASyncReq *req;
+
+ XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name));
+
+ LockDisplay(dpy);
+ GetReq(XDGASync, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGASync;
+ req->screen = screen;
+ _XReply(dpy, (xReply *)&rep, 0, xFalse);
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+
+void SDL_NAME(XDGAChangePixmapMode)(
+ Display *dpy,
+ int screen,
+ int *x,
+ int *y,
+ int mode
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXDGAChangePixmapModeReq *req;
+ xXDGAChangePixmapModeReply rep;
+
+ XextSimpleCheckExtension (dpy, info, SDL_NAME(xdga_extension_name));
+
+ LockDisplay(dpy);
+ GetReq(XDGAChangePixmapMode, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGAChangePixmapMode;
+ req->screen = screen;
+ req->x = *x;
+ req->y = *y;
+ req->flags = mode;
+ _XReply(dpy, (xReply *)&rep, 0, xFalse);
+ *x = rep.x;
+ *y = rep.y;
+ UnlockDisplay(dpy);
+ SyncHandle();
+}
+
+Colormap SDL_NAME(XDGACreateColormap)(
+ Display *dpy,
+ int screen,
+ SDL_NAME(XDGADevice) *dev,
+ int alloc
+){
+ XExtDisplayInfo *info = SDL_NAME(xdga_find_display) (dpy);
+ xXDGACreateColormapReq *req;
+ Colormap cid;
+
+ XDGACheckExtension (dpy, info, -1);
+
+ LockDisplay(dpy);
+ GetReq(XDGACreateColormap, req);
+ req->reqType = info->codes->major_opcode;
+ req->dgaReqType = X_XDGACreateColormap;
+ req->screen = screen;
+ req->mode = dev->mode.num;
+ req->alloc = alloc;
+ cid = req->id = XAllocID(dpy);
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ return cid;
+}
+
+
+void SDL_NAME(XDGAKeyEventToXKeyEvent)(
+ SDL_NAME(XDGAKeyEvent)* dk,
+ XKeyEvent* xk
+){
+ xk->type = dk->type;
+ xk->serial = dk->serial;
+ xk->send_event = False;
+ xk->display = dk->display;
+ xk->window = RootWindow(dk->display, dk->screen);
+ xk->root = xk->window;
+ xk->subwindow = None;
+ xk->time = dk->time;
+ xk->x = xk->y = xk->x_root = xk->y_root = 0;
+ xk->state = dk->state;
+ xk->keycode = dk->keycode;
+ xk->same_screen = True;
+}
+
+#include <X11/Xmd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#if defined(ISC)
+# define HAS_SVR3_MMAP
+# include <sys/types.h>
+# include <errno.h>
+
+# include <sys/at_ansi.h>
+# include <sys/kd.h>
+
+# include <sys/sysmacros.h>
+# include <sys/immu.h>
+# include <sys/region.h>
+
+# include <sys/mmap.h>
+#else
+# if !defined(Lynx)
+# if !defined(__EMX__)
+# include <sys/mman.h>
+# endif
+# else
+# include <sys/types.h>
+# include <errno.h>
+# include <smem.h>
+# endif
+#endif
+#include <sys/wait.h>
+#include <signal.h>
+#include <unistd.h>
+
+#if defined(SVR4) && !defined(sun) && !defined(SCO325)
+#define DEV_MEM "/dev/pmem"
+#elif defined(SVR4) && defined(sun)
+#define DEV_MEM "/dev/xsvc"
+#else
+#define DEV_MEM "/dev/mem"
+#endif
+
+
+
+typedef struct _DGAMapRec{
+ unsigned char *physical;
+ unsigned char *virtual;
+ CARD32 size;
+ int fd;
+ int screen;
+ struct _DGAMapRec *next;
+} DGAMapRec, *DGAMapPtr;
+
+static Bool
+DGAMapPhysical(int, char*, unsigned char*, CARD32, CARD32, CARD32, DGAMapPtr);
+static void DGAUnmapPhysical(DGAMapPtr);
+
+static DGAMapPtr _Maps = NULL;
+
+
+unsigned char*
+SDL_NAME(XDGAGetMappedMemory)(int screen)
+{
+ DGAMapPtr pMap = _Maps;
+ unsigned char *pntr = NULL;
+
+ while(pMap != NULL) {
+ if(pMap->screen == screen) {
+ pntr = pMap->virtual;
+ break;
+ }
+ pMap = pMap->next;
+ }
+
+ return pntr;
+}
+
+Bool
+SDL_NAME(XDGAMapFramebuffer)(
+ int screen,
+ char *name, /* optional device name */
+ unsigned char* base, /* physical memory */
+ CARD32 size, /* size */
+ CARD32 offset, /* optional offset */
+ CARD32 extra /* optional extra data */
+){
+ DGAMapPtr pMap = _Maps;
+ Bool result;
+
+ /* is it already mapped ? */
+ while(pMap != NULL) {
+ if(pMap->screen == screen)
+ return True;
+ pMap = pMap->next;
+ }
+
+ if(extra & XDGANeedRoot) {
+ /* we should probably check if we have root permissions and
+ return False here */
+
+ }
+
+ pMap = (DGAMapPtr)Xmalloc(sizeof(DGAMapRec));
+
+ result = DGAMapPhysical(screen, name, base, size, offset, extra, pMap);
+
+ if(result) {
+ pMap->next = _Maps;
+ _Maps = pMap;
+ } else
+ Xfree(pMap);
+
+ return result;
+}
+
+void
+SDL_NAME(XDGAUnmapFramebuffer)(int screen)
+{
+ DGAMapPtr pMap = _Maps;
+ DGAMapPtr pPrev = NULL;
+
+ /* is it already mapped */
+ while(pMap != NULL) {
+ if(pMap->screen == screen)
+ break;
+ pPrev = pMap;
+ pMap = pMap->next;
+ }
+
+ if(!pMap)
+ return;
+
+ DGAUnmapPhysical(pMap);
+
+ if(!pPrev)
+ _Maps = pMap->next;
+ else
+ pPrev->next = pMap->next;
+
+ Xfree(pMap);
+}
+
+
+static Bool
+DGAMapPhysical(
+ int screen,
+ char *name, /* optional device name */
+ unsigned char* base, /* physical memory */
+ CARD32 size, /* size */
+ CARD32 offset, /* optional offset */
+ CARD32 extra, /* optional extra data */
+ DGAMapPtr pMap
+) {
+#if defined(ISC) && defined(HAS_SVR3_MMAP)
+ struct kd_memloc mloc;
+#elif defined(__EMX__)
+ APIRET rc;
+ ULONG action;
+ HFILE hfd;
+#endif
+
+ base += offset;
+
+ pMap->screen = screen;
+ pMap->physical = base;
+ pMap->size = size;
+
+#if defined(ISC) && defined(HAS_SVR3_MMAP)
+ if ((pMap->fd = open("/dev/mmap", O_RDWR)) < 0)
+ return False;
+ mloc.vaddr = (char *)0;
+ mloc.physaddr = (char *)base;
+ mloc.length = size;
+ mloc.ioflg=1;
+
+ if ((pMap->virtual = (void *)ioctl(pMap->fd, MAP, &mloc)) == (void *)-1)
+ return False;
+#elif defined (__EMX__)
+ /*
+ * Dragon warning here! /dev/pmap$ is never closed, except on progam exit.
+ * Consecutive calling of this routine will make PMAP$ driver run out
+ * of memory handles. Some umap/close mechanism should be provided
+ */
+
+ rc = DosOpen("/dev/pmap$", &hfd, &action, 0, FILE_NORMAL, FILE_OPEN,
+ OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE, (PEAOP2)NULL);
+ if (rc != 0)
+ return False;
+ {
+ struct map_ioctl {
+ union {
+ ULONG phys;
+ void* user;
+ } a;
+ ULONG size;
+ } pmap,dmap;
+ ULONG plen,dlen;
+#define XFREE86_PMAP 0x76
+#define PMAP_MAP 0x44
+
+ pmap.a.phys = base;
+ pmap.size = size;
+ rc = DosDevIOCtl(hfd, XFREE86_PMAP, PMAP_MAP,
+ (PULONG)&pmap, sizeof(pmap), &plen,
+ (PULONG)&dmap, sizeof(dmap), &dlen);
+ if (rc == 0) {
+ pMap->virtual = dmap.a.user;
+ }
+ }
+ if (rc != 0)
+ return False;
+#elif defined (Lynx)
+ pMap->virtual = smem_create("XF86DGA", (char*)base, size, SM_READ|SM_WRITE);
+#else
+#ifndef MAP_FILE
+#define MAP_FILE 0
+#endif
+ if (!name)
+ name = DEV_MEM;
+ if ((pMap->fd = open(name, O_RDWR)) < 0)
+#if defined(ENABLE_FBCON)
+ { /* /dev/fb0 fallback added by Sam Lantinga <hercules@lokigames.com> */
+ /* Try to fall back to /dev/fb on Linux - FIXME: verify the device */
+ struct fb_fix_screeninfo finfo;
+
+ if ((pMap->fd = open("/dev/fb0", O_RDWR)) < 0) {
+ return False;
+ }
+ /* The useable framebuffer console memory may not be the whole
+ framebuffer that X has access to. :-(
+ */
+ if ( ioctl(pMap->fd, FBIOGET_FSCREENINFO, &finfo) < 0 ) {
+ close(pMap->fd);
+ return False;
+ }
+ /* Warning: On PPC, the size and virtual need to be offset by:
+ (((long)finfo.smem_start) -
+ (((long)finfo.smem_start)&~(PAGE_SIZE-1)))
+ */
+ base = 0;
+ size = pMap->size = finfo.smem_len;
+ }
+#else
+ return False;
+#endif
+ pMap->virtual = mmap(NULL, size, PROT_READ | PROT_WRITE,
+ MAP_FILE | MAP_SHARED, pMap->fd, (off_t)((size_t)base));
+ if (pMap->virtual == (void *)-1)
+ return False;
+#endif
+
+#if !defined(ISC) && !defined(HAS_SVR3_MMAP) && !defined(Lynx) \
+ && !defined(__EMX__)
+ mprotect(pMap->virtual, size, PROT_READ | PROT_WRITE);
+#endif
+
+ return True;
+}
+
+
+
+static void
+DGAUnmapPhysical(DGAMapPtr pMap)
+{
+#if !defined(ISC) && !defined(HAS_SVR3_MMAP) && !defined(Lynx) \
+ && !defined(__EMX__)
+ mprotect(pMap->virtual,pMap->size, PROT_READ);
+#elif defined(Lynx)
+ /* XXX this doesn't allow enable after disable */
+ smem_create(NULL, pMap->virtual, pMap->size, SM_DETACH);
+ smem_remove("XF86DGA");
+#endif
+
+
+ /* We need to unmap and close too !!!!!!!!!!*/
+}
diff --git a/distrib/sdl-1.2.15/src/video/Xext/Xxf86vm/XF86VMode.c b/distrib/sdl-1.2.15/src/video/Xext/Xxf86vm/XF86VMode.c
new file mode 100644
index 0000000..5cb2190
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/Xext/Xxf86vm/XF86VMode.c
@@ -0,0 +1,1226 @@
+/* $XConsortium: XF86VMode.c /main/2 1995/11/14 18:17:58 kaleb $ */
+/* $XFree86: xc/lib/Xxf86vm/XF86VMode.c,v 3.32 2001/07/25 15:04:54 dawes Exp $ */
+/*
+
+Copyright (c) 1995 Kaleb S. KEITHLEY
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES
+OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of Kaleb S. KEITHLEY
+shall not be used in advertising or otherwise to promote the sale, use
+or other dealings in this Software without prior written authorization
+from Kaleb S. KEITHLEY.
+
+*/
+/* $XConsortium: XF86VMode.c /main/4 1996/01/16 07:52:25 kaleb CHECKEDOUT $ */
+
+/* THIS IS NOT AN X CONSORTIUM STANDARD */
+
+#define NEED_EVENTS
+#define NEED_REPLIES
+
+#ifndef XBUILD_IN_CLIENT
+/* Apparently some X11 systems can't include this multiple times... */
+#ifndef SDL_INCLUDED_XLIBINT_H
+#define SDL_INCLUDED_XLIBINT_H 1
+#include <X11/Xlibint.h>
+#endif
+#include "../extensions/xf86vmstr.h"
+#include "../extensions/Xext.h"
+#include "../extensions/extutil.h"
+#else
+#include "include/extensions/xf86vmstr.h"
+#include "include/extensions/Xext.h"
+#include "include/extensions/extutil.h"
+#endif
+
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+
+#ifndef MODE_BAD
+#define MODE_BAD 255
+#endif
+
+static XExtensionInfo _xf86vidmode_info_data;
+static XExtensionInfo *xf86vidmode_info = &_xf86vidmode_info_data;
+static char *xf86vidmode_extension_name = XF86VIDMODENAME;
+
+#define XF86VidModeCheckExtension(dpy,i,val) \
+ XextCheckExtension (dpy, i, xf86vidmode_extension_name, val)
+
+/*****************************************************************************
+ * *
+ * private utility routines *
+ * *
+ *****************************************************************************/
+
+static XEXT_CLOSE_DISPLAY_PROTO(close_display);
+static /* const */ XExtensionHooks xf86vidmode_extension_hooks = {
+ NULL, /* create_gc */
+ NULL, /* copy_gc */
+ NULL, /* flush_gc */
+ NULL, /* free_gc */
+ NULL, /* create_font */
+ NULL, /* free_font */
+ close_display, /* close_display */
+ NULL, /* wire_to_event */
+ NULL, /* event_to_wire */
+ NULL, /* error */
+ NULL, /* error_string */
+};
+
+static XEXT_GENERATE_FIND_DISPLAY (find_display, xf86vidmode_info,
+ xf86vidmode_extension_name,
+ &xf86vidmode_extension_hooks,
+ 0, NULL)
+
+static XEXT_GENERATE_CLOSE_DISPLAY (close_display, xf86vidmode_info)
+
+
+/*****************************************************************************
+ * *
+ * public XFree86-VidMode Extension routines *
+ * *
+ *****************************************************************************/
+
+Bool
+SDL_NAME(XF86VidModeQueryExtension) (dpy, event_basep, error_basep)
+ Display *dpy;
+ int *event_basep, *error_basep;
+{
+ XExtDisplayInfo *info = find_display (dpy);
+
+ if (XextHasExtension(info)) {
+ *event_basep = info->codes->first_event;
+ *error_basep = info->codes->first_error;
+ return True;
+ } else {
+ return False;
+ }
+}
+
+Bool
+SDL_NAME(XF86VidModeQueryVersion)(dpy, majorVersion, minorVersion)
+ Display* dpy;
+ int* majorVersion;
+ int* minorVersion;
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeQueryVersionReply rep;
+ xXF86VidModeQueryVersionReq *req;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeQueryVersion, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeQueryVersion;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ *majorVersion = rep.majorVersion;
+ *minorVersion = rep.minorVersion;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ if (*majorVersion >= 2)
+ SDL_NAME(XF86VidModeSetClientVersion)(dpy);
+ return True;
+}
+
+Bool
+SDL_NAME(XF86VidModeSetClientVersion)(Display *dpy)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ xXF86VidModeSetClientVersionReq *req;
+
+ XF86VidModeCheckExtension(dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeSetClientVersion, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeSetClientVersion;
+ req->major = XF86VIDMODE_MAJOR_VERSION;
+ req->minor = XF86VIDMODE_MINOR_VERSION;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+SDL_NAME(XF86VidModeSetGamma)(Display *dpy, int screen, SDL_NAME(XF86VidModeGamma) *Gamma)
+{
+ XExtDisplayInfo *info = find_display(dpy);
+ xXF86VidModeSetGammaReq *req;
+
+ XF86VidModeCheckExtension(dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeSetGamma, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeSetGamma;
+ req->screen = screen;
+ req->red = (CARD32)(Gamma->red * 10000.);
+ req->green = (CARD32)(Gamma->green * 10000.);
+ req->blue = (CARD32)(Gamma->blue * 10000.);
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+SDL_NAME(XF86VidModeGetGamma)(Display *dpy, int screen, SDL_NAME(XF86VidModeGamma) *Gamma)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeGetGammaReply rep;
+ xXF86VidModeGetGammaReq *req;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeGetGamma, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeGetGamma;
+ req->screen = screen;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ Gamma->red = ((float)rep.red) / 10000.;
+ Gamma->green = ((float)rep.green) / 10000.;
+ Gamma->blue = ((float)rep.blue) / 10000.;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+SDL_NAME(XF86VidModeGetModeLine)(dpy, screen, dotclock, modeline)
+ Display* dpy;
+ int screen;
+ int* dotclock;
+ SDL_NAME(XF86VidModeModeLine)* modeline;
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeGetModeLineReply rep;
+ xXF86OldVidModeGetModeLineReply oldrep;
+ xXF86VidModeGetModeLineReq *req;
+ int majorVersion, minorVersion;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+ SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeGetModeLine, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeGetModeLine;
+ req->screen = screen;
+
+ if (majorVersion < 2) {
+ if (!_XReply(dpy, (xReply *)&oldrep,
+ (SIZEOF(xXF86OldVidModeGetModeLineReply) - SIZEOF(xReply)) >> 2, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ *dotclock = oldrep.dotclock;
+ modeline->hdisplay = oldrep.hdisplay;
+ modeline->hsyncstart = oldrep.hsyncstart;
+ modeline->hsyncend = oldrep.hsyncend;
+ modeline->htotal = oldrep.htotal;
+ modeline->hskew = 0;
+ modeline->vdisplay = oldrep.vdisplay;
+ modeline->vsyncstart = oldrep.vsyncstart;
+ modeline->vsyncend = oldrep.vsyncend;
+ modeline->vtotal = oldrep.vtotal;
+ modeline->flags = oldrep.flags;
+ modeline->privsize = oldrep.privsize;
+ } else {
+ if (!_XReply(dpy, (xReply *)&rep,
+ (SIZEOF(xXF86VidModeGetModeLineReply) - SIZEOF(xReply)) >> 2, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ *dotclock = rep.dotclock;
+ modeline->hdisplay = rep.hdisplay;
+ modeline->hsyncstart = rep.hsyncstart;
+ modeline->hsyncend = rep.hsyncend;
+ modeline->htotal = rep.htotal;
+ modeline->hskew = rep.hskew;
+ modeline->vdisplay = rep.vdisplay;
+ modeline->vsyncstart = rep.vsyncstart;
+ modeline->vsyncend = rep.vsyncend;
+ modeline->vtotal = rep.vtotal;
+ modeline->flags = rep.flags;
+ modeline->privsize = rep.privsize;
+ }
+
+ if (modeline->privsize > 0) {
+ if (!(modeline->private = Xcalloc(modeline->privsize, sizeof(INT32)))) {
+ _XEatData(dpy, (modeline->privsize) * sizeof(INT32));
+ Xfree(modeline->private);
+ return False;
+ }
+ _XRead(dpy, (char*)modeline->private, modeline->privsize * sizeof(INT32));
+ } else {
+ modeline->private = NULL;
+ }
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+SDL_NAME(XF86VidModeGetAllModeLines)(dpy, screen, modecount, modelinesPtr)
+ Display* dpy;
+ int screen;
+ int* modecount;
+ SDL_NAME(XF86VidModeModeInfo) ***modelinesPtr;
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeGetAllModeLinesReply rep;
+ xXF86VidModeGetAllModeLinesReq *req;
+ SDL_NAME(XF86VidModeModeInfo) *mdinfptr, **modelines;
+ xXF86VidModeModeInfo xmdline;
+ xXF86OldVidModeModeInfo oldxmdline;
+ int i;
+ int majorVersion, minorVersion;
+ Bool protocolBug = False;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ /*
+ * Note: There was a bug in the protocol implementation in versions
+ * 0.x with x < 8 (the .private field wasn't being passed over the wire).
+ * Check the server's version, and accept the old format if appropriate.
+ */
+
+ SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion);
+ if (majorVersion == 0 && minorVersion < 8) {
+ protocolBug = True;
+#ifdef DEBUG
+ fprintf(stderr, "XF86VidModeGetAllModeLines: Warning: Xserver is"
+ "running an old version (%d.%d)\n", majorVersion,
+ minorVersion);
+#endif
+ }
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeGetAllModeLines, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeGetAllModeLines;
+ req->screen = screen;
+ if (!_XReply(dpy, (xReply *)&rep,
+ (SIZEOF(xXF86VidModeGetAllModeLinesReply) - SIZEOF(xReply)) >> 2, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+
+ *modecount = rep.modecount;
+
+ if (!(modelines = (SDL_NAME(XF86VidModeModeInfo) **) Xcalloc(rep.modecount,
+ sizeof(SDL_NAME(XF86VidModeModeInfo) *)
+ +sizeof(SDL_NAME(XF86VidModeModeInfo))))) {
+ if (majorVersion < 2)
+ _XEatData(dpy, (rep.modecount) * sizeof(xXF86OldVidModeModeInfo));
+ else
+ _XEatData(dpy, (rep.modecount) * sizeof(xXF86VidModeModeInfo));
+ Xfree(modelines);
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ mdinfptr = (SDL_NAME(XF86VidModeModeInfo) *) (
+ (char *) modelines
+ + rep.modecount*sizeof(SDL_NAME(XF86VidModeModeInfo) *)
+ );
+
+ for (i = 0; i < rep.modecount; i++) {
+ modelines[i] = mdinfptr++;
+ if (majorVersion < 2) {
+ _XRead(dpy, (char*)&oldxmdline, sizeof(xXF86OldVidModeModeInfo));
+ modelines[i]->dotclock = oldxmdline.dotclock;
+ modelines[i]->hdisplay = oldxmdline.hdisplay;
+ modelines[i]->hsyncstart = oldxmdline.hsyncstart;
+ modelines[i]->hsyncend = oldxmdline.hsyncend;
+ modelines[i]->htotal = oldxmdline.htotal;
+ modelines[i]->hskew = 0;
+ modelines[i]->vdisplay = oldxmdline.vdisplay;
+ modelines[i]->vsyncstart = oldxmdline.vsyncstart;
+ modelines[i]->vsyncend = oldxmdline.vsyncend;
+ modelines[i]->vtotal = oldxmdline.vtotal;
+ modelines[i]->flags = oldxmdline.flags;
+ if (protocolBug) {
+ modelines[i]->privsize = 0;
+ modelines[i]->private = NULL;
+ } else {
+ modelines[i]->privsize = oldxmdline.privsize;
+ if (oldxmdline.privsize > 0) {
+ if (!(modelines[i]->private =
+ Xcalloc(oldxmdline.privsize, sizeof(INT32)))) {
+ _XEatData(dpy, (oldxmdline.privsize) * sizeof(INT32));
+ Xfree(modelines[i]->private);
+ } else {
+ _XRead(dpy, (char*)modelines[i]->private,
+ oldxmdline.privsize * sizeof(INT32));
+ }
+ } else {
+ modelines[i]->private = NULL;
+ }
+ }
+ } else {
+ _XRead(dpy, (char*)&xmdline, sizeof(xXF86VidModeModeInfo));
+ modelines[i]->dotclock = xmdline.dotclock;
+ modelines[i]->hdisplay = xmdline.hdisplay;
+ modelines[i]->hsyncstart = xmdline.hsyncstart;
+ modelines[i]->hsyncend = xmdline.hsyncend;
+ modelines[i]->htotal = xmdline.htotal;
+ modelines[i]->hskew = xmdline.hskew;
+ modelines[i]->vdisplay = xmdline.vdisplay;
+ modelines[i]->vsyncstart = xmdline.vsyncstart;
+ modelines[i]->vsyncend = xmdline.vsyncend;
+ modelines[i]->vtotal = xmdline.vtotal;
+ modelines[i]->flags = xmdline.flags;
+ if (protocolBug) {
+ modelines[i]->privsize = 0;
+ modelines[i]->private = NULL;
+ } else {
+ modelines[i]->privsize = xmdline.privsize;
+ if (xmdline.privsize > 0) {
+ if (!(modelines[i]->private =
+ Xcalloc(xmdline.privsize, sizeof(INT32)))) {
+ _XEatData(dpy, (xmdline.privsize) * sizeof(INT32));
+ Xfree(modelines[i]->private);
+ } else {
+ _XRead(dpy, (char*)modelines[i]->private,
+ xmdline.privsize * sizeof(INT32));
+ }
+ } else {
+ modelines[i]->private = NULL;
+ }
+ }
+ }
+ }
+ *modelinesPtr = modelines;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+/*
+ * GetReq replacement for use with VidMode protocols earlier than 2.0
+ */
+#if !defined(UNIXCPP) || defined(ANSICPP)
+#define GetOldReq(name, oldname, req) \
+ WORD64ALIGN\
+ if ((dpy->bufptr + SIZEOF(x##oldname##Req)) > dpy->bufmax)\
+ _XFlush(dpy);\
+ req = (x##oldname##Req *)(dpy->last_req = dpy->bufptr);\
+ req->reqType = X_##name;\
+ req->length = (SIZEOF(x##oldname##Req))>>2;\
+ dpy->bufptr += SIZEOF(x##oldname##Req);\
+ dpy->request++
+
+#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */
+#define GetOldReq(name, oldname, req) \
+ WORD64ALIGN\
+ if ((dpy->bufptr + SIZEOF(x/**/oldname/**/Req)) > dpy->bufmax)\
+ _XFlush(dpy);\
+ req = (x/**/oldname/**/Req *)(dpy->last_req = dpy->bufptr);\
+ req->reqType = X_/**/name;\
+ req->length = (SIZEOF(x/**/oldname/**/Req))>>2;\
+ dpy->bufptr += SIZEOF(x/**/oldname/**/Req);\
+ dpy->request++
+#endif
+
+Bool
+SDL_NAME(XF86VidModeAddModeLine) (dpy, screen, newmodeline, aftermodeline)
+ Display *dpy;
+ int screen;
+ SDL_NAME(XF86VidModeModeInfo)* newmodeline;
+ SDL_NAME(XF86VidModeModeInfo)* aftermodeline;
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeAddModeLineReq *req;
+ xXF86OldVidModeAddModeLineReq *oldreq;
+ int majorVersion, minorVersion;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+ SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion);
+
+ LockDisplay(dpy);
+ if (majorVersion < 2) {
+ GetOldReq(XF86VidModeAddModeLine, XF86OldVidModeAddModeLine, oldreq);
+ oldreq->reqType = info->codes->major_opcode;
+ oldreq->xf86vidmodeReqType = X_XF86VidModeAddModeLine;
+ oldreq->screen = screen;
+ oldreq->dotclock = newmodeline->dotclock;
+ oldreq->hdisplay = newmodeline->hdisplay;
+ oldreq->hsyncstart = newmodeline->hsyncstart;
+ oldreq->hsyncend = newmodeline->hsyncend;
+ oldreq->htotal = newmodeline->htotal;
+ oldreq->vdisplay = newmodeline->vdisplay;
+ oldreq->vsyncstart = newmodeline->vsyncstart;
+ oldreq->vsyncend = newmodeline->vsyncend;
+ oldreq->vtotal = newmodeline->vtotal;
+ oldreq->flags = newmodeline->flags;
+ oldreq->privsize = newmodeline->privsize;
+ if (aftermodeline != NULL) {
+ oldreq->after_dotclock = aftermodeline->dotclock;
+ oldreq->after_hdisplay = aftermodeline->hdisplay;
+ oldreq->after_hsyncstart = aftermodeline->hsyncstart;
+ oldreq->after_hsyncend = aftermodeline->hsyncend;
+ oldreq->after_htotal = aftermodeline->htotal;
+ oldreq->after_vdisplay = aftermodeline->vdisplay;
+ oldreq->after_vsyncstart = aftermodeline->vsyncstart;
+ oldreq->after_vsyncend = aftermodeline->vsyncend;
+ oldreq->after_vtotal = aftermodeline->vtotal;
+ oldreq->after_flags = aftermodeline->flags;
+ } else {
+ oldreq->after_dotclock = 0;
+ oldreq->after_hdisplay = 0;
+ oldreq->after_hsyncstart = 0;
+ oldreq->after_hsyncend = 0;
+ oldreq->after_htotal = 0;
+ oldreq->after_vdisplay = 0;
+ oldreq->after_vsyncstart = 0;
+ oldreq->after_vsyncend = 0;
+ oldreq->after_vtotal = 0;
+ oldreq->after_flags = 0;
+ }
+ if (newmodeline->privsize) {
+ oldreq->length += newmodeline->privsize;
+ Data32(dpy, (long *) newmodeline->private,
+ newmodeline->privsize * sizeof(INT32));
+ }
+ } else {
+ GetReq(XF86VidModeAddModeLine, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeAddModeLine;
+ req->screen = screen;
+ req->dotclock = newmodeline->dotclock;
+ req->hdisplay = newmodeline->hdisplay;
+ req->hsyncstart = newmodeline->hsyncstart;
+ req->hsyncend = newmodeline->hsyncend;
+ req->htotal = newmodeline->htotal;
+ req->hskew = newmodeline->hskew;
+ req->vdisplay = newmodeline->vdisplay;
+ req->vsyncstart = newmodeline->vsyncstart;
+ req->vsyncend = newmodeline->vsyncend;
+ req->vtotal = newmodeline->vtotal;
+ req->flags = newmodeline->flags;
+ req->privsize = newmodeline->privsize;
+ if (aftermodeline != NULL) {
+ req->after_dotclock = aftermodeline->dotclock;
+ req->after_hdisplay = aftermodeline->hdisplay;
+ req->after_hsyncstart = aftermodeline->hsyncstart;
+ req->after_hsyncend = aftermodeline->hsyncend;
+ req->after_htotal = aftermodeline->htotal;
+ req->after_hskew = aftermodeline->hskew;
+ req->after_vdisplay = aftermodeline->vdisplay;
+ req->after_vsyncstart = aftermodeline->vsyncstart;
+ req->after_vsyncend = aftermodeline->vsyncend;
+ req->after_vtotal = aftermodeline->vtotal;
+ req->after_flags = aftermodeline->flags;
+ } else {
+ req->after_dotclock = 0;
+ req->after_hdisplay = 0;
+ req->after_hsyncstart = 0;
+ req->after_hsyncend = 0;
+ req->after_htotal = 0;
+ req->after_hskew = 0;
+ req->after_vdisplay = 0;
+ req->after_vsyncstart = 0;
+ req->after_vsyncend = 0;
+ req->after_vtotal = 0;
+ req->after_flags = 0;
+ }
+ if (newmodeline->privsize) {
+ req->length += newmodeline->privsize;
+ Data32(dpy, (long *) newmodeline->private,
+ newmodeline->privsize * sizeof(INT32));
+ }
+ }
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+SDL_NAME(XF86VidModeDeleteModeLine) (dpy, screen, modeline)
+ Display *dpy;
+ int screen;
+ SDL_NAME(XF86VidModeModeInfo)* modeline;
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeDeleteModeLineReq *req;
+ xXF86OldVidModeDeleteModeLineReq *oldreq;
+ int majorVersion, minorVersion;
+
+ XF86VidModeCheckExtension (dpy, info, 0);
+ SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion);
+
+ LockDisplay(dpy);
+ if (majorVersion < 2) {
+ GetOldReq(XF86VidModeDeleteModeLine, XF86OldVidModeDeleteModeLine, oldreq);
+ oldreq->reqType = info->codes->major_opcode;
+ oldreq->xf86vidmodeReqType = X_XF86VidModeDeleteModeLine;
+ oldreq->screen = screen;
+ oldreq->dotclock = modeline->dotclock;
+ oldreq->hdisplay = modeline->hdisplay;
+ oldreq->hsyncstart = modeline->hsyncstart;
+ oldreq->hsyncend = modeline->hsyncend;
+ oldreq->htotal = modeline->htotal;
+ oldreq->vdisplay = modeline->vdisplay;
+ oldreq->vsyncstart = modeline->vsyncstart;
+ oldreq->vsyncend = modeline->vsyncend;
+ oldreq->vtotal = modeline->vtotal;
+ oldreq->flags = modeline->flags;
+ oldreq->privsize = modeline->privsize;
+ if (modeline->privsize) {
+ oldreq->length += modeline->privsize;
+ Data32(dpy, (long *) modeline->private,
+ modeline->privsize * sizeof(INT32));
+ }
+ } else {
+ GetReq(XF86VidModeDeleteModeLine, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeDeleteModeLine;
+ req->screen = screen;
+ req->dotclock = modeline->dotclock;
+ req->hdisplay = modeline->hdisplay;
+ req->hsyncstart = modeline->hsyncstart;
+ req->hsyncend = modeline->hsyncend;
+ req->htotal = modeline->htotal;
+ req->hskew = modeline->hskew;
+ req->vdisplay = modeline->vdisplay;
+ req->vsyncstart = modeline->vsyncstart;
+ req->vsyncend = modeline->vsyncend;
+ req->vtotal = modeline->vtotal;
+ req->flags = modeline->flags;
+ req->privsize = modeline->privsize;
+ if (modeline->privsize) {
+ req->length += modeline->privsize;
+ Data32(dpy, (long *) modeline->private,
+ modeline->privsize * sizeof(INT32));
+ }
+ }
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+SDL_NAME(XF86VidModeModModeLine) (dpy, screen, modeline)
+ Display *dpy;
+ int screen;
+ SDL_NAME(XF86VidModeModeLine)* modeline;
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeModModeLineReq *req;
+ xXF86OldVidModeModModeLineReq *oldreq;
+ int majorVersion, minorVersion;
+
+ XF86VidModeCheckExtension (dpy, info, 0);
+ SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion);
+
+ LockDisplay(dpy);
+ if (majorVersion < 2) {
+ GetOldReq(XF86VidModeModModeLine, XF86OldVidModeModModeLine, oldreq);
+ oldreq->reqType = info->codes->major_opcode;
+ oldreq->xf86vidmodeReqType = X_XF86VidModeModModeLine;
+ oldreq->screen = screen;
+ oldreq->hdisplay = modeline->hdisplay;
+ oldreq->hsyncstart = modeline->hsyncstart;
+ oldreq->hsyncend = modeline->hsyncend;
+ oldreq->htotal = modeline->htotal;
+ oldreq->vdisplay = modeline->vdisplay;
+ oldreq->vsyncstart = modeline->vsyncstart;
+ oldreq->vsyncend = modeline->vsyncend;
+ oldreq->vtotal = modeline->vtotal;
+ oldreq->flags = modeline->flags;
+ oldreq->privsize = modeline->privsize;
+ if (modeline->privsize) {
+ oldreq->length += modeline->privsize;
+ Data32(dpy, (long *) modeline->private,
+ modeline->privsize * sizeof(INT32));
+ }
+ } else {
+ GetReq(XF86VidModeModModeLine, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeModModeLine;
+ req->screen = screen;
+ req->hdisplay = modeline->hdisplay;
+ req->hsyncstart = modeline->hsyncstart;
+ req->hsyncend = modeline->hsyncend;
+ req->htotal = modeline->htotal;
+ req->hskew = modeline->hskew;
+ req->vdisplay = modeline->vdisplay;
+ req->vsyncstart = modeline->vsyncstart;
+ req->vsyncend = modeline->vsyncend;
+ req->vtotal = modeline->vtotal;
+ req->flags = modeline->flags;
+ req->privsize = modeline->privsize;
+ if (modeline->privsize) {
+ req->length += modeline->privsize;
+ Data32(dpy, (long *) modeline->private,
+ modeline->privsize * sizeof(INT32));
+ }
+ }
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Status
+SDL_NAME(XF86VidModeValidateModeLine) (dpy, screen, modeline)
+ Display *dpy;
+ int screen;
+ SDL_NAME(XF86VidModeModeInfo)* modeline;
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeValidateModeLineReq *req;
+ xXF86OldVidModeValidateModeLineReq *oldreq;
+ xXF86VidModeValidateModeLineReply rep;
+ int majorVersion, minorVersion;
+
+ XF86VidModeCheckExtension (dpy, info, 0);
+ SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion);
+
+ LockDisplay(dpy);
+
+ if (majorVersion < 2) {
+ GetOldReq(XF86VidModeValidateModeLine, XF86OldVidModeValidateModeLine, oldreq);
+ oldreq->reqType = info->codes->major_opcode;
+ oldreq->xf86vidmodeReqType = X_XF86VidModeValidateModeLine;
+ oldreq->screen = screen;
+ oldreq->dotclock = modeline->dotclock;
+ oldreq->hdisplay = modeline->hdisplay;
+ oldreq->hsyncstart = modeline->hsyncstart;
+ oldreq->hsyncend = modeline->hsyncend;
+ oldreq->htotal = modeline->htotal;
+ oldreq->vdisplay = modeline->vdisplay;
+ oldreq->vsyncstart = modeline->vsyncstart;
+ oldreq->vsyncend = modeline->vsyncend;
+ oldreq->vtotal = modeline->vtotal;
+ oldreq->flags = modeline->flags;
+ oldreq->privsize = modeline->privsize;
+ if (modeline->privsize) {
+ oldreq->length += modeline->privsize;
+ Data32(dpy, (long *) modeline->private,
+ modeline->privsize * sizeof(INT32));
+ }
+ } else {
+ GetReq(XF86VidModeValidateModeLine, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeValidateModeLine;
+ req->screen = screen;
+ req->dotclock = modeline->dotclock;
+ req->hdisplay = modeline->hdisplay;
+ req->hsyncstart = modeline->hsyncstart;
+ req->hsyncend = modeline->hsyncend;
+ req->htotal = modeline->htotal;
+ req->hskew = modeline->hskew;
+ req->vdisplay = modeline->vdisplay;
+ req->vsyncstart = modeline->vsyncstart;
+ req->vsyncend = modeline->vsyncend;
+ req->vtotal = modeline->vtotal;
+ req->flags = modeline->flags;
+ req->privsize = modeline->privsize;
+ if (modeline->privsize) {
+ req->length += modeline->privsize;
+ Data32(dpy, (long *) modeline->private,
+ modeline->privsize * sizeof(INT32));
+ }
+ }
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return MODE_BAD;
+ }
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return rep.status;
+}
+
+Bool
+SDL_NAME(XF86VidModeSwitchMode)(dpy, screen, zoom)
+ Display* dpy;
+ int screen;
+ int zoom;
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeSwitchModeReq *req;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeSwitchMode, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeSwitchMode;
+ req->screen = screen;
+ req->zoom = zoom;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+SDL_NAME(XF86VidModeSwitchToMode)(dpy, screen, modeline)
+ Display* dpy;
+ int screen;
+ SDL_NAME(XF86VidModeModeInfo)* modeline;
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeSwitchToModeReq *req;
+ xXF86OldVidModeSwitchToModeReq *oldreq;
+ int majorVersion, minorVersion;
+ Bool protocolBug = False;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ /*
+ * Note: There was a bug in the protocol implementation in versions
+ * 0.x with x < 8 (the .private field wasn't expected to be sent over
+ * the wire). Check the server's version, and accept the old format
+ * if appropriate.
+ */
+
+ SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion);
+ if (majorVersion == 0 && minorVersion < 8) {
+ protocolBug = True;
+#ifdef DEBUG
+ fprintf(stderr, "XF86VidModeSwitchToMode: Warning: Xserver is"
+ "running an old version (%d.%d)\n", majorVersion,
+ minorVersion);
+#endif
+ }
+
+ LockDisplay(dpy);
+ if (majorVersion < 2) {
+ GetOldReq(XF86VidModeSwitchToMode, XF86OldVidModeSwitchToMode, oldreq);
+ oldreq->reqType = info->codes->major_opcode;
+ oldreq->xf86vidmodeReqType = X_XF86VidModeSwitchToMode;
+ oldreq->screen = screen;
+ oldreq->dotclock = modeline->dotclock;
+ oldreq->hdisplay = modeline->hdisplay;
+ oldreq->hsyncstart = modeline->hsyncstart;
+ oldreq->hsyncend = modeline->hsyncend;
+ oldreq->htotal = modeline->htotal;
+ oldreq->vdisplay = modeline->vdisplay;
+ oldreq->vsyncstart = modeline->vsyncstart;
+ oldreq->vsyncend = modeline->vsyncend;
+ oldreq->vtotal = modeline->vtotal;
+ oldreq->flags = modeline->flags;
+ if (protocolBug) {
+ oldreq->privsize = 0;
+ } else {
+ oldreq->privsize = modeline->privsize;
+ if (modeline->privsize) {
+ oldreq->length += modeline->privsize;
+ Data32(dpy, (long *) modeline->private,
+ modeline->privsize * sizeof(INT32));
+ }
+ }
+ } else {
+ GetReq(XF86VidModeSwitchToMode, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeSwitchToMode;
+ req->screen = screen;
+ req->dotclock = modeline->dotclock;
+ req->hdisplay = modeline->hdisplay;
+ req->hsyncstart = modeline->hsyncstart;
+ req->hsyncend = modeline->hsyncend;
+ req->htotal = modeline->htotal;
+ req->hskew = modeline->hskew;
+ req->vdisplay = modeline->vdisplay;
+ req->vsyncstart = modeline->vsyncstart;
+ req->vsyncend = modeline->vsyncend;
+ req->vtotal = modeline->vtotal;
+ req->flags = modeline->flags;
+ if (protocolBug) {
+ req->privsize = 0;
+ } else {
+ req->privsize = modeline->privsize;
+ if (modeline->privsize) {
+ req->length += modeline->privsize;
+ Data32(dpy, (long *) modeline->private,
+ modeline->privsize * sizeof(INT32));
+ }
+ }
+ }
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+SDL_NAME(XF86VidModeLockModeSwitch)(dpy, screen, lock)
+ Display* dpy;
+ int screen;
+ int lock;
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeLockModeSwitchReq *req;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeLockModeSwitch, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeLockModeSwitch;
+ req->screen = screen;
+ req->lock = lock;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+SDL_NAME(XF86VidModeGetMonitor)(dpy, screen, monitor)
+ Display* dpy;
+ int screen;
+ SDL_NAME(XF86VidModeMonitor)* monitor;
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeGetMonitorReply rep;
+ xXF86VidModeGetMonitorReq *req;
+ CARD32 syncrange;
+ int i;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeGetMonitor, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeGetMonitor;
+ req->screen = screen;
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ monitor->nhsync = rep.nhsync;
+ monitor->nvsync = rep.nvsync;
+#if 0
+ monitor->bandwidth = (float)rep.bandwidth / 1e6;
+#endif
+ if (rep.vendorLength) {
+ if (!(monitor->vendor = (char *)Xcalloc(rep.vendorLength + 1, 1))) {
+ _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
+ ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ } else {
+ monitor->vendor = NULL;
+ }
+ if (rep.modelLength) {
+ if (!(monitor->model = Xcalloc(rep.modelLength + 1, 1))) {
+ _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
+ ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
+ if (monitor->vendor)
+ Xfree(monitor->vendor);
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ } else {
+ monitor->model = NULL;
+ }
+ if (!(monitor->hsync = Xcalloc(rep.nhsync, sizeof(SDL_NAME(XF86VidModeSyncRange))))) {
+ _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
+ ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
+
+ if (monitor->vendor)
+ Xfree(monitor->vendor);
+ if (monitor->model)
+ Xfree(monitor->model);
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ if (!(monitor->vsync = Xcalloc(rep.nvsync, sizeof(SDL_NAME(XF86VidModeSyncRange))))) {
+ _XEatData(dpy, (rep.nhsync + rep.nvsync) * 4 +
+ ((rep.vendorLength+3) & ~3) + ((rep.modelLength+3) & ~3));
+ if (monitor->vendor)
+ Xfree(monitor->vendor);
+ if (monitor->model)
+ Xfree(monitor->model);
+ Xfree(monitor->hsync);
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ for (i = 0; i < rep.nhsync; i++) {
+ _XRead(dpy, (char *)&syncrange, 4);
+ monitor->hsync[i].lo = (float)(syncrange & 0xFFFF) / 100.0;
+ monitor->hsync[i].hi = (float)(syncrange >> 16) / 100.0;
+ }
+ for (i = 0; i < rep.nvsync; i++) {
+ _XRead(dpy, (char *)&syncrange, 4);
+ monitor->vsync[i].lo = (float)(syncrange & 0xFFFF) / 100.0;
+ monitor->vsync[i].hi = (float)(syncrange >> 16) / 100.0;
+ }
+ if (rep.vendorLength)
+ _XReadPad(dpy, monitor->vendor, rep.vendorLength);
+ else
+ monitor->vendor = "";
+ if (rep.modelLength)
+ _XReadPad(dpy, monitor->model, rep.modelLength);
+ else
+ monitor->model = "";
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+SDL_NAME(XF86VidModeGetViewPort)(dpy, screen, x, y)
+ Display* dpy;
+ int screen;
+ int *x, *y;
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeGetViewPortReply rep;
+ xXF86VidModeGetViewPortReq *req;
+ int majorVersion, minorVersion;
+ Bool protocolBug = False;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ /*
+ * Note: There was a bug in the protocol implementation in versions
+ * 0.x with x < 8 (no reply was sent, so the client would hang)
+ * Check the server's version, and don't wait for a reply with older
+ * versions.
+ */
+
+ SDL_NAME(XF86VidModeQueryVersion)(dpy, &majorVersion, &minorVersion);
+ if (majorVersion == 0 && minorVersion < 8) {
+ protocolBug = True;
+#ifdef DEBUG
+ fprintf(stderr, "XF86VidModeGetViewPort: Warning: Xserver is"
+ "running an old version (%d.%d)\n", majorVersion,
+ minorVersion);
+#endif
+ }
+ LockDisplay(dpy);
+ GetReq(XF86VidModeGetViewPort, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeGetViewPort;
+ req->screen = screen;
+ if (protocolBug) {
+ *x = 0;
+ *y = 0;
+ } else {
+ if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ *x = rep.x;
+ *y = rep.y;
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+SDL_NAME(XF86VidModeSetViewPort)(dpy, screen, x, y)
+ Display* dpy;
+ int screen;
+ int x, y;
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeSetViewPortReq *req;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeSetViewPort, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeSetViewPort;
+ req->screen = screen;
+ req->x = x;
+ req->y = y;
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+SDL_NAME(XF86VidModeGetDotClocks)(dpy, screen,
+ flagsPtr, numclocksPtr, maxclocksPtr, clocksPtr)
+ Display* dpy;
+ int screen;
+ int *flagsPtr, *numclocksPtr, *maxclocksPtr, *clocksPtr[];
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeGetDotClocksReply rep;
+ xXF86VidModeGetDotClocksReq *req;
+ int i, *dotclocks;
+ CARD32 dotclk;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeGetDotClocks, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeGetDotClocks;
+ req->screen = screen;
+ if (!_XReply(dpy, (xReply *)&rep,
+ (SIZEOF(xXF86VidModeGetDotClocksReply) - SIZEOF(xReply)) >> 2, xFalse))
+ {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+ *numclocksPtr = rep.clocks;
+ *maxclocksPtr = rep.maxclocks;
+ *flagsPtr = rep.flags;
+
+ if (!(dotclocks = (int*) Xcalloc(rep.clocks, sizeof(int)))) {
+ _XEatData(dpy, (rep.clocks) * 4);
+ Xfree(dotclocks);
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return False;
+ }
+
+ for (i = 0; i < rep.clocks; i++) {
+ _XRead(dpy, (char*)&dotclk, 4);
+ dotclocks[i] = dotclk;
+ }
+ *clocksPtr = dotclocks;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool
+SDL_NAME(XF86VidModeSetGammaRamp) (
+ Display *dpy,
+ int screen,
+ int size,
+ unsigned short *red,
+ unsigned short *green,
+ unsigned short *blue
+)
+{
+ int length = (size + 1) & ~1;
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeSetGammaRampReq *req;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+ LockDisplay(dpy);
+ GetReq(XF86VidModeSetGammaRamp, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeSetGammaRamp;
+ req->screen = screen;
+ req->length += (length >> 1) * 3;
+ req->size = size;
+ _XSend(dpy, (char*)red, size * 2);
+ _XSend(dpy, (char*)green, size * 2);
+ _XSend(dpy, (char*)blue, size * 2);
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+
+Bool
+SDL_NAME(XF86VidModeGetGammaRamp) (
+ Display *dpy,
+ int screen,
+ int size,
+ unsigned short *red,
+ unsigned short *green,
+ unsigned short *blue
+)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeGetGammaRampReq *req;
+ xXF86VidModeGetGammaRampReply rep;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeGetGammaRamp, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeGetGammaRamp;
+ req->screen = screen;
+ req->size = size;
+ if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return False;
+ }
+ if(rep.size) {
+ _XRead(dpy, (char*)red, rep.size << 1);
+ _XRead(dpy, (char*)green, rep.size << 1);
+ _XRead(dpy, (char*)blue, rep.size << 1);
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
+Bool SDL_NAME(XF86VidModeGetGammaRampSize)(
+ Display *dpy,
+ int screen,
+ int *size
+)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXF86VidModeGetGammaRampSizeReq *req;
+ xXF86VidModeGetGammaRampSizeReply rep;
+
+ *size = 0;
+
+ XF86VidModeCheckExtension (dpy, info, False);
+
+ LockDisplay(dpy);
+ GetReq(XF86VidModeGetGammaRampSize, req);
+ req->reqType = info->codes->major_opcode;
+ req->xf86vidmodeReqType = X_XF86VidModeGetGammaRampSize;
+ req->screen = screen;
+ if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return False;
+ }
+ *size = rep.size;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return True;
+}
+
diff --git a/distrib/sdl-1.2.12/src/video/Xext/extensions/Xext.h b/distrib/sdl-1.2.15/src/video/Xext/extensions/Xext.h
index 9edf319..9edf319 100644
--- a/distrib/sdl-1.2.12/src/video/Xext/extensions/Xext.h
+++ b/distrib/sdl-1.2.15/src/video/Xext/extensions/Xext.h
diff --git a/distrib/sdl-1.2.12/src/video/Xext/extensions/Xinerama.h b/distrib/sdl-1.2.15/src/video/Xext/extensions/Xinerama.h
index 54f2fe1..54f2fe1 100644
--- a/distrib/sdl-1.2.12/src/video/Xext/extensions/Xinerama.h
+++ b/distrib/sdl-1.2.15/src/video/Xext/extensions/Xinerama.h
diff --git a/distrib/sdl-1.2.12/src/video/Xext/extensions/Xv.h b/distrib/sdl-1.2.15/src/video/Xext/extensions/Xv.h
index a6a0271..a6a0271 100644
--- a/distrib/sdl-1.2.12/src/video/Xext/extensions/Xv.h
+++ b/distrib/sdl-1.2.15/src/video/Xext/extensions/Xv.h
diff --git a/distrib/sdl-1.2.12/src/video/Xext/extensions/Xvlib.h b/distrib/sdl-1.2.15/src/video/Xext/extensions/Xvlib.h
index 0d0a55d..0d0a55d 100644
--- a/distrib/sdl-1.2.12/src/video/Xext/extensions/Xvlib.h
+++ b/distrib/sdl-1.2.15/src/video/Xext/extensions/Xvlib.h
diff --git a/distrib/sdl-1.2.12/src/video/Xext/extensions/Xvproto.h b/distrib/sdl-1.2.15/src/video/Xext/extensions/Xvproto.h
index b4d8f22..b4d8f22 100644
--- a/distrib/sdl-1.2.12/src/video/Xext/extensions/Xvproto.h
+++ b/distrib/sdl-1.2.15/src/video/Xext/extensions/Xvproto.h
diff --git a/distrib/sdl-1.2.12/src/video/Xext/extensions/extutil.h b/distrib/sdl-1.2.15/src/video/Xext/extensions/extutil.h
index f3a741e..f3a741e 100644
--- a/distrib/sdl-1.2.12/src/video/Xext/extensions/extutil.h
+++ b/distrib/sdl-1.2.15/src/video/Xext/extensions/extutil.h
diff --git a/distrib/sdl-1.2.12/src/video/Xext/extensions/panoramiXext.h b/distrib/sdl-1.2.15/src/video/Xext/extensions/panoramiXext.h
index e89d891..e89d891 100644
--- a/distrib/sdl-1.2.12/src/video/Xext/extensions/panoramiXext.h
+++ b/distrib/sdl-1.2.15/src/video/Xext/extensions/panoramiXext.h
diff --git a/distrib/sdl-1.2.12/src/video/Xext/extensions/panoramiXproto.h b/distrib/sdl-1.2.15/src/video/Xext/extensions/panoramiXproto.h
index fe3826e..fe3826e 100644
--- a/distrib/sdl-1.2.12/src/video/Xext/extensions/panoramiXproto.h
+++ b/distrib/sdl-1.2.15/src/video/Xext/extensions/panoramiXproto.h
diff --git a/distrib/sdl-1.2.12/src/video/Xext/extensions/xf86dga.h b/distrib/sdl-1.2.15/src/video/Xext/extensions/xf86dga.h
index c71ef4b..c71ef4b 100644
--- a/distrib/sdl-1.2.12/src/video/Xext/extensions/xf86dga.h
+++ b/distrib/sdl-1.2.15/src/video/Xext/extensions/xf86dga.h
diff --git a/distrib/sdl-1.2.12/src/video/Xext/extensions/xf86dga1.h b/distrib/sdl-1.2.15/src/video/Xext/extensions/xf86dga1.h
index 4a49e9f..4a49e9f 100644
--- a/distrib/sdl-1.2.12/src/video/Xext/extensions/xf86dga1.h
+++ b/distrib/sdl-1.2.15/src/video/Xext/extensions/xf86dga1.h
diff --git a/distrib/sdl-1.2.12/src/video/Xext/extensions/xf86dga1str.h b/distrib/sdl-1.2.15/src/video/Xext/extensions/xf86dga1str.h
index 5695fbd..5695fbd 100644
--- a/distrib/sdl-1.2.12/src/video/Xext/extensions/xf86dga1str.h
+++ b/distrib/sdl-1.2.15/src/video/Xext/extensions/xf86dga1str.h
diff --git a/distrib/sdl-1.2.12/src/video/Xext/extensions/xf86dgastr.h b/distrib/sdl-1.2.15/src/video/Xext/extensions/xf86dgastr.h
index b249feb..b249feb 100644
--- a/distrib/sdl-1.2.12/src/video/Xext/extensions/xf86dgastr.h
+++ b/distrib/sdl-1.2.15/src/video/Xext/extensions/xf86dgastr.h
diff --git a/distrib/sdl-1.2.12/src/video/Xext/extensions/xf86vmode.h b/distrib/sdl-1.2.15/src/video/Xext/extensions/xf86vmode.h
index eb56c0e..eb56c0e 100644
--- a/distrib/sdl-1.2.12/src/video/Xext/extensions/xf86vmode.h
+++ b/distrib/sdl-1.2.15/src/video/Xext/extensions/xf86vmode.h
diff --git a/distrib/sdl-1.2.12/src/video/Xext/extensions/xf86vmstr.h b/distrib/sdl-1.2.15/src/video/Xext/extensions/xf86vmstr.h
index 0c3078d..0c3078d 100644
--- a/distrib/sdl-1.2.12/src/video/Xext/extensions/xf86vmstr.h
+++ b/distrib/sdl-1.2.15/src/video/Xext/extensions/xf86vmstr.h
diff --git a/distrib/sdl-1.2.12/src/video/Xext/extensions/xme.h b/distrib/sdl-1.2.15/src/video/Xext/extensions/xme.h
index f550623..f550623 100644
--- a/distrib/sdl-1.2.12/src/video/Xext/extensions/xme.h
+++ b/distrib/sdl-1.2.15/src/video/Xext/extensions/xme.h
diff --git a/distrib/sdl-1.2.15/src/video/aalib/SDL_aaevents.c b/distrib/sdl-1.2.15/src/video/aalib/SDL_aaevents.c
new file mode 100644
index 0000000..a26ab2d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/aalib/SDL_aaevents.c
@@ -0,0 +1,202 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Handle the event stream, converting AA events into SDL events */
+
+#include <stdio.h>
+
+#include <aalib.h>
+
+#include "SDL.h"
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_aavideo.h"
+#include "SDL_aaevents_c.h"
+
+/* The translation tables from a console scancode to a SDL keysym */
+static SDLKey keymap[401];
+
+static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym);
+
+
+void AA_PumpEvents(_THIS)
+{
+ int posted = 0;
+ int mouse_button, mouse_x, mouse_y;
+ int evt;
+ SDL_keysym keysym;
+
+ static int prev_button = -1, prev_x = -1, prev_y = -1;
+
+ if( ! this->screen ) /* Wait till we got the screen initialized */
+ return;
+
+ do {
+ posted = 0;
+ /* Gather events */
+
+ /* Get mouse status */
+ SDL_mutexP(AA_mutex);
+ aa_getmouse (AA_context, &mouse_x, &mouse_y, &mouse_button);
+ SDL_mutexV(AA_mutex);
+ mouse_x = mouse_x * this->screen->w / aa_scrwidth (AA_context);
+ mouse_y = mouse_y * this->screen->h / aa_scrheight (AA_context);
+
+ /* Compare against previous state and generate events */
+ if( prev_button != mouse_button ) {
+ if( mouse_button & AA_BUTTON1 ) {
+ if ( ! (prev_button & AA_BUTTON1) ) {
+ posted += SDL_PrivateMouseButton(SDL_PRESSED, 1, 0, 0);
+ }
+ } else {
+ if ( prev_button & AA_BUTTON1 ) {
+ posted += SDL_PrivateMouseButton(SDL_RELEASED, 1, 0, 0);
+ }
+ }
+ if( mouse_button & AA_BUTTON2 ) {
+ if ( ! (prev_button & AA_BUTTON2) ) {
+ posted += SDL_PrivateMouseButton(SDL_PRESSED, 2, 0, 0);
+ }
+ } else {
+ if ( prev_button & AA_BUTTON2 ) {
+ posted += SDL_PrivateMouseButton(SDL_RELEASED, 2, 0, 0);
+ }
+ }
+ if( mouse_button & AA_BUTTON3 ) {
+ if ( ! (prev_button & AA_BUTTON3) ) {
+ posted += SDL_PrivateMouseButton(SDL_PRESSED, 3, 0, 0);
+ }
+ } else {
+ if ( prev_button & AA_BUTTON3 ) {
+ posted += SDL_PrivateMouseButton(SDL_RELEASED, 3, 0, 0);
+ }
+ }
+ }
+ if ( prev_x != mouse_x || prev_y != mouse_y ) {
+ posted += SDL_PrivateMouseMotion(0, 0, mouse_x, mouse_y);
+ }
+
+ prev_button = mouse_button;
+ prev_x = mouse_x; prev_y = mouse_y;
+
+ /* Get keyboard event */
+ SDL_mutexP(AA_mutex);
+ evt = aa_getevent(AA_context, 0);
+ SDL_mutexV(AA_mutex);
+ if ( (evt > AA_NONE) && (evt < AA_RELEASE) && (evt != AA_MOUSE) && (evt != AA_RESIZE) ) {
+ /* Key pressed */
+/* printf("Key pressed: %d (%c)\n", evt, evt); */
+ posted += SDL_PrivateKeyboard(SDL_PRESSED, TranslateKey(evt, &keysym));
+ } else if ( evt >= AA_RELEASE ) {
+ /* Key released */
+ evt &= ~AA_RELEASE;
+/* printf("Key released: %d (%c)\n", evt, evt); */
+ posted += SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(evt, &keysym));
+ }
+ } while ( posted );
+}
+
+void AA_InitOSKeymap(_THIS)
+{
+ int i;
+ static const char *std_keys = " 01234567890&#'()_-|$*+-=/\\:;.,!?<>{}[]@~%^\x9";
+ const char *std;
+
+ /* Initialize the AAlib key translation table */
+ for ( i=0; i<SDL_arraysize(keymap); ++i )
+ keymap[i] = SDLK_UNKNOWN;
+
+ /* Alphabet keys */
+ for ( i = 0; i<26; ++i ){
+ keymap['a' + i] = SDLK_a+i;
+ keymap['A' + i] = SDLK_a+i;
+ }
+ /* Function keys */
+ for ( i = 0; i<12; ++i ){
+ keymap[334 + i] = SDLK_F1+i;
+ }
+ /* Keys that have the same symbols and don't have to be translated */
+ for( std = std_keys; *std; std ++ ) {
+ keymap[*std] = *std;
+ }
+
+ keymap[13] = SDLK_RETURN;
+ keymap[AA_BACKSPACE] = SDLK_BACKSPACE;
+
+ keymap[369] = SDLK_LSHIFT;
+ keymap[370] = SDLK_RSHIFT;
+ keymap[371] = SDLK_LCTRL;
+ keymap[372] = SDLK_RCTRL;
+ keymap[377] = SDLK_LALT;
+ keymap[270] = SDLK_RALT;
+ keymap[271] = SDLK_NUMLOCK;
+ keymap[373] = SDLK_CAPSLOCK;
+ keymap[164] = SDLK_SCROLLOCK;
+
+ keymap[243] = SDLK_INSERT;
+ keymap[304] = SDLK_DELETE;
+ keymap[224] = SDLK_HOME;
+ keymap[231] = SDLK_END;
+ keymap[229] = SDLK_PAGEUP;
+ keymap[230] = SDLK_PAGEDOWN;
+
+ keymap[241] = SDLK_PRINT;
+ keymap[163] = SDLK_BREAK;
+
+ keymap[302] = SDLK_KP0;
+ keymap[300] = SDLK_KP1;
+ keymap[297] = SDLK_KP2;
+ keymap[299] = SDLK_KP3;
+ keymap[294] = SDLK_KP4;
+ keymap[301] = SDLK_KP5;
+ keymap[296] = SDLK_KP6;
+ keymap[293] = SDLK_KP7;
+ keymap[295] = SDLK_KP8;
+ keymap[298] = SDLK_KP9;
+
+ keymap[AA_ESC] = SDLK_ESCAPE;
+ keymap[AA_UP] = SDLK_UP;
+ keymap[AA_DOWN] = SDLK_DOWN;
+ keymap[AA_LEFT] = SDLK_LEFT;
+ keymap[AA_RIGHT] = SDLK_RIGHT;
+}
+
+static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym)
+{
+ /* Sanity check */
+ if ( scancode >= SDL_arraysize(keymap) )
+ scancode = AA_UNKNOWN;
+
+ /* Set the keysym information */
+ keysym->scancode = scancode;
+ keysym->sym = keymap[scancode];
+ keysym->mod = KMOD_NONE;
+
+ /* If UNICODE is on, get the UNICODE value for the key */
+ keysym->unicode = 0;
+ if ( SDL_TranslateUNICODE ) {
+ /* Populate the unicode field with the ASCII value */
+ keysym->unicode = scancode;
+ }
+ return(keysym);
+}
diff --git a/distrib/sdl-1.2.15/src/video/aalib/SDL_aaevents_c.h b/distrib/sdl-1.2.15/src/video/aalib/SDL_aaevents_c.h
new file mode 100644
index 0000000..6dbc9f6
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/aalib/SDL_aaevents_c.h
@@ -0,0 +1,35 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_aavideo.h"
+
+/* Variables and functions exported by SDL_sysevents.c to other parts
+ of the native video subsystem (SDL_sysvideo.c)
+*/
+extern void AA_initkeymaps(int fd);
+extern void AA_mousecallback(int button, int dx, int dy,
+ int u1,int u2,int u3, int u4);
+extern void AA_keyboardcallback(int scancode, int pressed);
+
+extern void AA_InitOSKeymap(_THIS);
+extern void AA_PumpEvents(_THIS);
diff --git a/distrib/sdl-1.2.15/src/video/aalib/SDL_aamouse.c b/distrib/sdl-1.2.15/src/video/aalib/SDL_aamouse.c
new file mode 100644
index 0000000..dc784a5
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/aalib/SDL_aamouse.c
@@ -0,0 +1,35 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <stdio.h>
+
+#include "SDL_mouse.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_aamouse_c.h"
+
+
+/* The implementation dependent data for the window manager cursor */
+struct WMcursor {
+ int unused;
+};
diff --git a/distrib/sdl-1.2.15/src/video/aalib/SDL_aamouse_c.h b/distrib/sdl-1.2.15/src/video/aalib/SDL_aamouse_c.h
new file mode 100644
index 0000000..6ce3d98
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/aalib/SDL_aamouse_c.h
@@ -0,0 +1,26 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_aavideo.h"
+
+/* Functions to be exported */
diff --git a/distrib/sdl-1.2.15/src/video/aalib/SDL_aavideo.c b/distrib/sdl-1.2.15/src/video/aalib/SDL_aavideo.c
new file mode 100644
index 0000000..e6d5d3e
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/aalib/SDL_aavideo.c
@@ -0,0 +1,388 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* AAlib based SDL video driver implementation.
+*/
+
+#include <unistd.h>
+#include <sys/stat.h>
+
+
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_aavideo.h"
+#include "SDL_aaevents_c.h"
+#include "SDL_aamouse_c.h"
+
+#include <aalib.h>
+
+/* Initialization/Query functions */
+static int AA_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **AA_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *AA_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int AA_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
+static void AA_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int AA_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int AA_LockHWSurface(_THIS, SDL_Surface *surface);
+static int AA_FlipHWSurface(_THIS, SDL_Surface *surface);
+static void AA_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void AA_FreeHWSurface(_THIS, SDL_Surface *surface);
+
+/* Cache the VideoDevice struct */
+static struct SDL_VideoDevice *local_this;
+
+/* AAlib driver bootstrap functions */
+
+static int AA_Available(void)
+{
+ return 1; /* Always available ! */
+}
+
+static void AA_DeleteDevice(SDL_VideoDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_VideoDevice *AA_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device;
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *device->hidden));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( device ) {
+ SDL_free(device);
+ }
+ return(0);
+ }
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+
+ /* Set the function pointers */
+ device->VideoInit = AA_VideoInit;
+ device->ListModes = AA_ListModes;
+ device->SetVideoMode = AA_SetVideoMode;
+ device->CreateYUVOverlay = NULL;
+ device->SetColors = AA_SetColors;
+ device->UpdateRects = NULL;
+ device->VideoQuit = AA_VideoQuit;
+ device->AllocHWSurface = AA_AllocHWSurface;
+ device->CheckHWBlit = NULL;
+ device->FillHWRect = NULL;
+ device->SetHWColorKey = NULL;
+ device->SetHWAlpha = NULL;
+ device->LockHWSurface = AA_LockHWSurface;
+ device->UnlockHWSurface = AA_UnlockHWSurface;
+ device->FlipHWSurface = NULL;
+ device->FreeHWSurface = AA_FreeHWSurface;
+ device->SetCaption = NULL;
+ device->SetIcon = NULL;
+ device->IconifyWindow = NULL;
+ device->GrabInput = NULL;
+ device->GetWMInfo = NULL;
+ device->InitOSKeymap = AA_InitOSKeymap;
+ device->PumpEvents = AA_PumpEvents;
+
+ device->free = AA_DeleteDevice;
+
+ return device;
+}
+
+VideoBootStrap AALIB_bootstrap = {
+ "aalib", "ASCII Art Library",
+ AA_Available, AA_CreateDevice
+};
+
+static void AA_ResizeHandler(aa_context *);
+
+int AA_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ int keyboard;
+ int i;
+
+ /* Initialize all variables that we clean on shutdown */
+ for ( i=0; i<SDL_NUMMODES; ++i ) {
+ SDL_modelist[i] = SDL_malloc(sizeof(SDL_Rect));
+ SDL_modelist[i]->x = SDL_modelist[i]->y = 0;
+ }
+ /* Modes sorted largest to smallest */
+ SDL_modelist[0]->w = 1024; SDL_modelist[0]->h = 768;
+ SDL_modelist[1]->w = 800; SDL_modelist[1]->h = 600;
+ SDL_modelist[2]->w = 640; SDL_modelist[2]->h = 480;
+ SDL_modelist[3]->w = 320; SDL_modelist[3]->h = 400;
+ SDL_modelist[4]->w = 320; SDL_modelist[4]->h = 240;
+ SDL_modelist[5]->w = 320; SDL_modelist[5]->h = 200;
+ SDL_modelist[6] = NULL;
+
+ /* Initialize the library */
+
+ AA_mutex = SDL_CreateMutex();
+
+ aa_parseoptions (NULL, NULL, NULL, NULL);
+
+ AA_context = aa_autoinit(&aa_defparams);
+ if ( ! AA_context ) {
+ SDL_SetError("Unable to initialize AAlib");
+ return(-1);
+ }
+
+ /* Enable mouse and keyboard support */
+
+ if ( ! aa_autoinitkbd (AA_context, AA_SENDRELEASE) ) {
+ SDL_SetError("Unable to initialize AAlib keyboard");
+ return(-1);
+ }
+ if ( ! aa_autoinitmouse (AA_context, AA_SENDRELEASE) ) {
+ fprintf(stderr,"Warning: Unable to initialize AAlib mouse");
+ }
+ AA_rparams = aa_getrenderparams();
+
+ local_this = this;
+
+ aa_resizehandler(AA_context, AA_ResizeHandler);
+
+ fprintf(stderr,"Using AAlib driver: %s (%s)\n", AA_context->driver->name, AA_context->driver->shortname);
+
+ AA_in_x11 = (SDL_strcmp(AA_context->driver->shortname,"X11") == 0);
+ /* Determine the screen depth (use default 8-bit depth) */
+ vformat->BitsPerPixel = 8;
+ vformat->BytesPerPixel = 1;
+
+ /* We're done! */
+ return(0);
+}
+
+SDL_Rect **AA_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ if(format->BitsPerPixel != 8)
+ return NULL;
+
+ if ( flags & SDL_FULLSCREEN ) {
+ return SDL_modelist;
+ } else {
+ return (SDL_Rect **) -1;
+ }
+}
+
+/* From aavga.c
+ AAlib does not give us the choice of the actual resolution, thus we have to simulate additional
+ resolution by scaling down manually each frame
+*/
+static void fastscale (register char *b1, register char *b2, int x1, int x2, int y1, int y2)
+{
+ register int ex, spx = 0, ddx, ddx1;
+ int ddy1, ddy, spy = 0, ey;
+ int x;
+ char *bb1 = b1;
+ if (!x1 || !x2 || !y1 || !y2)
+ return;
+ ddx = x1 + x1;
+ ddx1 = x2 + x2;
+ if (ddx1 < ddx)
+ spx = ddx / ddx1, ddx %= ddx1;
+ ddy = y1 + y1;
+ ddy1 = y2 + y2;
+ if (ddy1 < ddy)
+ spy = (ddy / ddy1) * x1, ddy %= ddy1;
+ ey = -ddy1;
+ for (; y2; y2--) {
+ ex = -ddx1;
+ for (x = x2; x; x--) {
+ *b2 = *b1;
+ b2++;
+ b1 += spx;
+ ex += ddx;
+ if (ex > 0) {
+ b1++;
+ ex -= ddx1;
+ }
+ }
+ bb1 += spy;
+ ey += ddy;
+ if (ey > 0) {
+ bb1 += x1;
+ ey -= ddy1;
+ }
+ b1 = bb1;
+ }
+}
+
+/* Various screen update functions available */
+static void AA_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
+
+SDL_Surface *AA_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ int mode;
+
+ if ( AA_buffer ) {
+ SDL_free( AA_buffer );
+ }
+
+ AA_buffer = SDL_malloc(width * height);
+ if ( ! AA_buffer ) {
+ SDL_SetError("Couldn't allocate buffer for requested mode");
+ return(NULL);
+ }
+
+/* printf("Setting mode %dx%d\n", width, height); */
+
+ SDL_memset(aa_image(AA_context), 0, aa_imgwidth(AA_context) * aa_imgheight(AA_context));
+ SDL_memset(AA_buffer, 0, width * height);
+
+ /* Allocate the new pixel format for the screen */
+ if ( ! SDL_ReallocFormat(current, 8, 0, 0, 0, 0) ) {
+ return(NULL);
+ }
+
+ /* Set up the new mode framebuffer */
+ current->flags = SDL_FULLSCREEN;
+ AA_w = current->w = width;
+ AA_h = current->h = height;
+ current->pitch = current->w;
+ current->pixels = AA_buffer;
+
+ AA_x_ratio = ((double)aa_imgwidth(AA_context)) / ((double)width);
+ AA_y_ratio = ((double)aa_imgheight(AA_context)) / ((double)height);
+
+ /* Set the blit function */
+ this->UpdateRects = AA_DirectUpdate;
+
+ /* We're done */
+ return(current);
+}
+
+static void AA_ResizeHandler(aa_context *context)
+{
+ aa_resize(context);
+ local_this->hidden->x_ratio = ((double)aa_imgwidth(context)) / ((double)local_this->screen->w);
+ local_this->hidden->y_ratio = ((double)aa_imgheight(context)) / ((double)local_this->screen->h);
+
+ fastscale (local_this->hidden->buffer, aa_image(context), local_this->hidden->w, aa_imgwidth (context), local_this->hidden->h, aa_imgheight (context));
+ aa_renderpalette(context, local_this->hidden->palette, local_this->hidden->rparams, 0, 0, aa_scrwidth(context), aa_scrheight(context));
+ aa_flush(context);
+}
+
+/* We don't actually allow hardware surfaces other than the main one */
+static int AA_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(-1);
+}
+static void AA_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+/* We need to wait for vertical retrace on page flipped displays */
+static int AA_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ /* TODO ? */
+ return(0);
+}
+static void AA_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+/* FIXME: How is this done with AAlib? */
+static int AA_FlipHWSurface(_THIS, SDL_Surface *surface)
+{
+ SDL_mutexP(AA_mutex);
+ aa_flush(AA_context);
+ SDL_mutexV(AA_mutex);
+ return(0);
+}
+
+static void AA_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+ int i;
+ SDL_Rect *rect;
+
+ fastscale (AA_buffer, aa_image(AA_context), AA_w, aa_imgwidth (AA_context), AA_h, aa_imgheight (AA_context));
+#if 1
+ aa_renderpalette(AA_context, AA_palette, AA_rparams, 0, 0, aa_scrwidth(AA_context), aa_scrheight(AA_context));
+#else
+ /* Render only the rectangles in the list */
+ printf("Update rects : ");
+ for ( i=0; i < numrects; ++i ) {
+ rect = &rects[i];
+ printf("(%d,%d-%d,%d)", rect->x, rect->y, rect->w, rect->h);
+ aa_renderpalette(AA_context, AA_palette, AA_rparams, rect->x * AA_x_ratio, rect->y * AA_y_ratio, rect->w * AA_x_ratio, rect->h * AA_y_ratio);
+ }
+ printf("\n");
+#endif
+ SDL_mutexP(AA_mutex);
+ aa_flush(AA_context);
+ SDL_mutexV(AA_mutex);
+ return;
+}
+
+int AA_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ int i;
+
+ for ( i=0; i < ncolors; i++ ) {
+ aa_setpalette(AA_palette, firstcolor + i,
+ colors[i].r>>2,
+ colors[i].g>>2,
+ colors[i].b>>2);
+ }
+ return(1);
+}
+
+/* Note: If we are terminated, this could be called in the middle of
+ another SDL video routine -- notably UpdateRects.
+*/
+void AA_VideoQuit(_THIS)
+{
+ int i;
+
+ aa_uninitkbd(AA_context);
+ aa_uninitmouse(AA_context);
+
+ /* Free video mode lists */
+ for ( i=0; i<SDL_NUMMODES; ++i ) {
+ if ( SDL_modelist[i] != NULL ) {
+ SDL_free(SDL_modelist[i]);
+ SDL_modelist[i] = NULL;
+ }
+ }
+
+ aa_close(AA_context);
+
+ SDL_DestroyMutex(AA_mutex);
+
+ this->screen->pixels = NULL;
+}
diff --git a/distrib/sdl-1.2.15/src/video/aalib/SDL_aavideo.h b/distrib/sdl-1.2.15/src/video/aalib/SDL_aavideo.h
new file mode 100644
index 0000000..987edc9
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/aalib/SDL_aavideo.h
@@ -0,0 +1,66 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_aavideo_h
+#define _SDL_aavideo_h
+
+#include "SDL_mouse.h"
+#include "SDL_mutex.h"
+#include "../SDL_sysvideo.h"
+
+#include <aalib.h>
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+#define SDL_NUMMODES 6
+
+/* Private display data */
+struct SDL_PrivateVideoData {
+ SDL_Rect *SDL_modelist[SDL_NUMMODES+1];
+ aa_context *context;
+ aa_palette palette;
+ aa_renderparams *rparams;
+ double x_ratio, y_ratio;
+ int w, h;
+ SDL_mutex *mutex;
+ int in_x11;
+ void *buffer;
+};
+
+/* Old variable names */
+#define SDL_modelist (this->hidden->SDL_modelist)
+#define AA_context (this->hidden->context)
+#define AA_palette (this->hidden->palette)
+#define AA_rparams (this->hidden->rparams)
+#define AA_buffer (this->hidden->buffer)
+
+#define AA_x_ratio (this->hidden->x_ratio)
+#define AA_y_ratio (this->hidden->y_ratio)
+
+#define AA_mutex (this->hidden->mutex)
+#define AA_in_x11 (this->hidden->in_x11)
+#define AA_w (this->hidden->w)
+#define AA_h (this->hidden->h)
+
+#endif /* _SDL_aavideo_h */
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ataric2p.S b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ataric2p.S
new file mode 100644
index 0000000..3cd1961
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ataric2p.S
@@ -0,0 +1,452 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/*
+ Chunky to planar conversion routine
+ 1 byte/pixel -> 4 or 8 bit planes
+
+ Patrice Mandin
+ Xavier Joubert
+ Mikael Kalms
+*/
+
+ .globl _SDL_Atari_C2pConvert
+ .globl _SDL_Atari_C2pConvert8
+ .globl _SDL_Atari_C2pConvert4
+ .globl _SDL_Atari_C2pConvert4_pal
+
+/* ------------ Conversion C2P, 8 bits ------------ */
+
+ .text
+_SDL_Atari_C2pConvert8:
+#if !defined(__mcoldfire__)
+ movel sp@(4),c2p_source
+ movel sp@(8),c2p_dest
+ movel sp@(12),c2p_width
+ movel sp@(16),c2p_height
+ movel sp@(20),c2p_dblligne
+ movel sp@(24),c2p_srcpitch
+ movel sp@(28),c2p_dstpitch
+
+ moveml d2-d7/a2-a6,sp@-
+
+ movel c2p_source,c2p_cursrc
+ movel c2p_dest,c2p_curdst
+ movel #0x0f0f0f0f,d4
+ movel #0x00ff00ff,d5
+ movel #0x55555555,d6
+ movew c2p_height+2,c2p_row
+ movew c2p_width+2,d0
+ andw #-8,d0
+ movew d0,c2p_rowlen
+
+SDL_Atari_C2p8_rowloop:
+
+ movel c2p_cursrc,a0
+ movel c2p_curdst,a1
+
+ movel a0,a2
+ addw c2p_rowlen,a2
+
+ movel a0@+,d0
+ movel a0@+,d1
+ movel a0@+,d2
+ movel a0@+,d3
+/*
+ d0 = a7a6a5a4a3a2a1a0 b7b6b5b4b3b2b1b0 c7c6c5c4c3c2c1c0 d7d6d5d4d3d2d1d0
+ d1 = e7e6e5e4e3e2e1e0 f7f6f5f4f3f2f1f0 g7g6g5g4g3g2g1g0 h7h6h5h4h3h2h1h0
+ d2 = i7i6i5i4i3i2i1i0 j7j6j5j4j3j2j1j0 k7k6k5k4k3k2k1k0 l7l6l5l4l3l2l1l0
+ d3 = m7m6m5m4m3m2m1m0 n7n6n5n4n3n2n1n0 o7o6o5o4o3o2o1o0 p7p6p5p4p3p2p1p0
+*/
+ movel d1,d7
+ lsrl #4,d7
+ eorl d0,d7
+ andl d4,d7
+ eorl d7,d0
+ lsll #4,d7
+ eorl d7,d1
+
+ movel d3,d7
+ lsrl #4,d7
+ eorl d2,d7
+ andl d4,d7
+ eorl d7,d2
+ lsll #4,d7
+ eorl d7,d3
+
+ movel d2,d7
+ lsrl #8,d7
+ eorl d0,d7
+ andl d5,d7
+ eorl d7,d0
+ lsll #8,d7
+ eorl d7,d2
+
+ movel d3,d7
+ lsrl #8,d7
+ eorl d1,d7
+ andl d5,d7
+ eorl d7,d1
+ lsll #8,d7
+ eorl d7,d3
+/*
+ d0 = a7a6a5a4e7e6e5e4 i7i6i5i4m7m6m5m4 c7c6c5c4g7g6g5g4 k7k6k5k4o7o6o5o4
+ d1 = a3a2a1a0e3e2e1e0 i3i2i1i0m3m2m1m0 c3c2c1c0g3g2g1g0 k3k2k1k0o3o2o1o0
+ d2 = b7b6b5b4f7f6f5f4 j7j6j5j4n7n6n5n4 d7d6d5d4h7h6h5h4 l7l6l5l4p7p6p5p4
+ d3 = b3b2b1b0f3f2f1f0 j3j2j1j0n3n2n1n0 d3d2d1d0h3h2h1h0 l3l2l1l0p3p2p1p0
+*/
+ bras SDL_Atari_C2p8_start
+
+SDL_Atari_C2p8_pix16:
+
+ movel a0@+,d0
+ movel a0@+,d1
+ movel a0@+,d2
+ movel a0@+,d3
+/*
+ d0 = a7a6a5a4a3a2a1a0 b7b6b5b4b3b2b1b0 c7c6c5c4c3c2c1c0 d7d6d5d4d3d2d1d0
+ d1 = e7e6e5e4e3e2e1e0 f7f6f5f4f3f2f1f0 g7g6g5g4g3g2g1g0 h7h6h5h4h3h2h1h0
+ d2 = i7i6i5i4i3i2i1i0 j7j6j5j4j3j2j1j0 k7k6k5k4k3k2k1k0 l7l6l5l4l3l2l1l0
+ d3 = m7m6m5m4m3m2m1m0 n7n6n5n4n3n2n1n0 o7o6o5o4o3o2o1o0 p7p6p5p4p3p2p1p0
+*/
+ movel d1,d7
+ lsrl #4,d7
+ movel a3,a1@+
+ eorl d0,d7
+ andl d4,d7
+ eorl d7,d0
+ lsll #4,d7
+ eorl d7,d1
+
+ movel d3,d7
+ lsrl #4,d7
+ eorl d2,d7
+ andl d4,d7
+ eorl d7,d2
+ movel a4,a1@+
+ lsll #4,d7
+ eorl d7,d3
+
+ movel d2,d7
+ lsrl #8,d7
+ eorl d0,d7
+ andl d5,d7
+ eorl d7,d0
+ movel a5,a1@+
+ lsll #8,d7
+ eorl d7,d2
+
+ movel d3,d7
+ lsrl #8,d7
+ eorl d1,d7
+ andl d5,d7
+ eorl d7,d1
+ movel a6,a1@+
+ lsll #8,d7
+ eorl d7,d3
+/*
+ d0 = a7a6a5a4e7e6e5e4 i7i6i5i4m7m6m5m4 c7c6c5c4g7g6g5g4 k7k6k5k4o7o6o5o4
+ d1 = a3a2a1a0e3e2e1e0 i3i2i1i0m3m2m1m0 c3c2c1c0g3g2g1g0 k3k2k1k0o3o2o1o0
+ d2 = b7b6b5b4f7f6f5f4 j7j6j5j4n7n6n5n4 d7d6d5d4h7h6h5h4 l7l6l5l4p7p6p5p4
+ d3 = b3b2b1b0f3f2f1f0 j3j2j1j0n3n2n1n0 d3d2d1d0h3h2h1h0 l3l2l1l0p3p2p1p0
+*/
+
+SDL_Atari_C2p8_start:
+
+ movel d2,d7
+ lsrl #1,d7
+ eorl d0,d7
+ andl d6,d7
+ eorl d7,d0
+ addl d7,d7
+ eorl d7,d2
+
+ movel d3,d7
+ lsrl #1,d7
+ eorl d1,d7
+ andl d6,d7
+ eorl d7,d1
+ addl d7,d7
+ eorl d7,d3
+/*
+ d0 = a7b7a5b5e7f7e5f5 i7j7i5j5m7n7m5n5 c7d7c5d5g7h7g5h5 k7l7k5l5o7p7o5p5
+ d1 = a3b3a1b1e3f3e1f1 i3j3i1j1m3n3m1n1 c3d3c1d1g3h3g1h1 k3l3k1l1o3p3o1p1
+ d2 = a6b6a4b4e6f6e4f4 i6j6i4j4m6n6m4n4 c6d6c4d4g6h6g4h4 k6l6k4l4o6p6o4p4
+ d3 = a2b2a0b0e2f2e0f0 i2j2i0j0m2n2m0n0 c2d2c0d0g2h2g0h0 k2l2k0l0o2p2o0p0
+*/
+ movew d2,d7
+ movew d0,d2
+ swap d2
+ movew d2,d0
+ movew d7,d2
+
+ movew d3,d7
+ movew d1,d3
+ swap d3
+ movew d3,d1
+ movew d7,d3
+/*
+ d0 = a7b7a5b5e7f7e5f5 i7j7i5j5m7n7m5n5 a6b6a4b4e6f6e4f4 i6j6i4j4m6n6m4n4
+ d1 = a3b3a1b1e3f3e1f1 i3j3i1j1m3n3m1n1 a2b2a0b0e2f2e0f0 i2j2i0j0m2n2m0n0
+ d2 = c7d7c5d5g7h7g5h5 k7l7k5l5o7p7o5p5 c6d6c4d4g6h6g4h4 k6l6k4l4o6p6o4p4
+ d3 = c3d3c1d1g3h3g1h1 k3l3k1l1o3p3o1p1 c2d2c0d0g2h2g0h0 k2l2k0l0o2p2o0p0
+*/
+ movel d2,d7
+ lsrl #2,d7
+ eorl d0,d7
+ andl #0x33333333,d7
+ eorl d7,d0
+ lsll #2,d7
+ eorl d7,d2
+
+ movel d3,d7
+ lsrl #2,d7
+ eorl d1,d7
+ andl #0x33333333,d7
+ eorl d7,d1
+ lsll #2,d7
+ eorl d7,d3
+/*
+ d0 = a7b7c7d7e7f7g7h7 i7j7k7l7m7n7o7p7 a6b6c6d6e6f6g6h6 i6j6k6l6m6n6o6p6
+ d1 = a3b3c3d3e3f3g3h3 i3j3k3l3m3n3o3p3 a2b2c2d2e2f2g2h2 i2j2k2l2m2n2o2p2
+ d2 = a5b5c5d5e5f5g5h5 i5j5k5l5m5n5o5p5 a4b4c4d4e4f4g4h4 i4j4k4l4m4n4o4p4
+ d3 = a1b1c1d1e1f1g1h1 i1j1k1l1m1n1o1p1 a0b0c0d0e0f0g0h0 i0j0k0l0m0n0o0p0
+*/
+ swap d0
+ swap d1
+ swap d2
+ swap d3
+
+ movel d0,a6
+ movel d2,a5
+ movel d1,a4
+ movel d3,a3
+
+ cmpl a0,a2
+ bgt SDL_Atari_C2p8_pix16
+
+ movel a3,a1@+
+ movel a4,a1@+
+ movel a5,a1@+
+ movel a6,a1@+
+
+ /* Double the line ? */
+
+ movel c2p_srcpitch,d0
+ movel c2p_dstpitch,d1
+
+ tstl c2p_dblligne
+ beqs SDL_Atari_C2p8_nodblline
+
+ movel c2p_curdst,a0
+ movel a0,a1
+ addl d1,a1
+
+ movew c2p_width+2,d7
+ lsrw #4,d7
+ subql #1,d7
+SDL_Atari_C2p8_dblloop:
+ movel a0@+,a1@+
+ movel a0@+,a1@+
+ movel a0@+,a1@+
+ movel a0@+,a1@+
+ dbra d7,SDL_Atari_C2p8_dblloop
+
+ addl d1,c2p_curdst
+
+SDL_Atari_C2p8_nodblline:
+
+ /* Next line */
+
+ addl d0,c2p_cursrc
+ addl d1,c2p_curdst
+
+ subqw #1,c2p_row
+ bne SDL_Atari_C2p8_rowloop
+
+ moveml sp@+,d2-d7/a2-a6
+#endif
+ rts
+
+/* ------------ Conversion C2P, 4 bits ------------ */
+
+_SDL_Atari_C2pConvert4:
+#if !defined(__mcoldfire__)
+ movel sp@(4),c2p_source
+ movel sp@(8),c2p_dest
+ movel sp@(12),c2p_width
+ movel sp@(16),c2p_height
+ movel sp@(20),c2p_dblligne
+ movel sp@(24),c2p_srcpitch
+ movel sp@(28),c2p_dstpitch
+
+ moveml d2-d7/a2-a6,sp@-
+
+ movel c2p_source,a0
+ movel c2p_dest,a1
+ lea _SDL_Atari_table_c2p,a2
+ movel #0x00070001,d3
+#if defined(__mc68020__)
+ moveq #0,d0
+#endif
+
+ movel c2p_height,d7
+ subql #1,d7
+c2p4_bcly:
+ movel a0,a4 | Save start address of source
+ movel a1,a5 | Save start address of dest
+
+ | Conversion
+
+ movel c2p_width,d6
+ lsrw #4,d6
+ subql #1,d6
+c2p4_bclx:
+ | Octets 0-7
+
+ moveq #0,d1
+ moveq #7,d5
+c2p4_bcl07:
+#if defined(__mc68020__)
+ moveb a0@+,d0
+ lea a2@(0,d0:w:4),a3
+#else
+ moveq #0,d0
+ moveb a0@+,d0
+ lslw #2,d0
+ lea a2@(0,d0:w),a3
+#endif
+ lsll #1,d1
+ orl a3@,d1
+ dbra d5,c2p4_bcl07
+
+ movepl d1,a1@(0)
+ addw d3,a1
+ swap d3
+
+ | Octets 8-15
+
+ moveq #0,d1
+ moveq #7,d5
+c2p4_bcl815:
+#if defined(__mc68020__)
+ moveb a0@+,d0
+ lea a2@(0,d0:w:4),a3
+#else
+ moveq #0,d0
+ moveb a0@+,d0
+ lslw #2,d0
+ lea a2@(0,d0:w),a3
+#endif
+ lsll #1,d1
+ orl a3@,d1
+ dbra d5,c2p4_bcl815
+
+ movepl d1,a1@(0)
+ addw d3,a1
+ swap d3
+
+ dbra d6,c2p4_bclx
+
+ | Double line ?
+
+ tstl c2p_dblligne
+ beqs c2p4_nodblligne
+
+ movel a5,a6 | src line
+ movel a5,a1 | dest line
+ addl c2p_dstpitch,a1
+
+ movel c2p_width,d6
+ lsrw #3,d6
+ subql #1,d6
+c2p4_copydbl:
+ movel a6@+,a1@+
+ dbra d6,c2p4_copydbl
+
+ addl c2p_dstpitch,a5
+c2p4_nodblligne:
+
+ | Next line
+
+ movel a4,a0
+ addl c2p_srcpitch,a0
+ movel a5,a1
+ addl c2p_dstpitch,a1
+
+ dbra d7,c2p4_bcly
+
+ moveml sp@+,d2-d7/a2-a6
+#endif
+ rts
+
+/* ------------ Conversion of a light palette in 4 bits ------------ */
+
+_SDL_Atari_C2pConvert4_pal:
+#if !defined(__mcoldfire__)
+ /* a0 is a 256-word light palette */
+ movel sp@(4),a0
+
+ moveml d2-d3,sp@-
+
+ lea _SDL_Atari_table_c2p,a1
+ movew #255,d3
+c2p_pal_initbcl:
+ movew a0@+,d0
+ lsrw #4,d0
+ andw #15,d0
+
+ moveq #3,d1
+c2p_pal_initbyte:
+ btst d1,d0
+ sne d2
+ negw d2
+ moveb d2,a1@(0,d1:w)
+
+ dbra d1,c2p_pal_initbyte
+
+ addql #4,a1
+ dbra d3,c2p_pal_initbcl
+
+ moveml sp@+,d2-d3
+#endif
+ rts
+
+/* ------------ Buffers ------------ */
+
+ .bss
+
+ .even
+ .comm _SDL_Atari_C2pConvert,4
+ .comm _SDL_Atari_table_c2p,1024
+
+ .comm c2p_source,4 /* Source framebuffer */
+ .comm c2p_dest,4 /* Destination framebuffer */
+ .comm c2p_width,4 /* Width of zone to convert */
+ .comm c2p_height,4 /* Height of zone to convert */
+ .comm c2p_dblligne,4 /* Double the lines while converting ? */
+ .comm c2p_srcpitch,4 /* Source pitch */
+ .comm c2p_dstpitch,4 /* Destination pitch */
+ .comm c2p_cursrc,4 /* Current source line */
+ .comm c2p_curdst,4 /* Current destination line */
+ .comm c2p_rowlen,2 /* Line length in bytes */
+ .comm c2p_row,2 /* Current line number */
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ataric2p_s.h b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ataric2p_s.h
new file mode 100644
index 0000000..48bdae7
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ataric2p_s.h
@@ -0,0 +1,75 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _ATARI_C2P_h
+#define _ATARI_C2P_h
+
+#include "SDL_stdinc.h"
+
+/*--- Functions pointers ---*/
+
+/* Convert a chunky screen to bitplane screen */
+
+extern void (*SDL_Atari_C2pConvert)(
+ Uint8 *src, /* Source screen (one byte=one pixel) */
+ Uint8 *dest, /* Destination (4/8 bits planes) */
+ Uint32 width, /* Dimensions of screen to convert */
+ Uint32 height,
+ Uint32 dblligne, /* Double the lines when converting ? */
+ Uint32 srcpitch, /* Length of one source line in bytes */
+ Uint32 dstpitch /* Length of one destination line in bytes */
+);
+
+/*--- 8 bits functions ---*/
+
+/* Convert a chunky screen to bitplane screen */
+
+void SDL_Atari_C2pConvert8(
+ Uint8 *src, /* Source screen (one byte=one pixel) */
+ Uint8 *dest, /* Destination (8 bits planes) */
+ Uint32 width, /* Dimensions of screen to convert */
+ Uint32 height,
+ Uint32 dblligne, /* Double the lines when converting ? */
+ Uint32 srcpitch, /* Length of one source line in bytes */
+ Uint32 dstpitch /* Length of one destination line in bytes */
+);
+
+/*--- 4 bits functions ---*/
+
+/* Convert a chunky screen to bitplane screen */
+
+void SDL_Atari_C2pConvert4(
+ Uint8 *src, /* Source screen (one byte=one pixel) */
+ Uint8 *dest, /* Destination (4 bits planes) */
+ Uint32 width, /* Dimensions of screen to convert */
+ Uint32 height,
+ Uint32 dblligne, /* Double the lines when converting ? */
+ Uint32 srcpitch, /* Length of one source line in bytes */
+ Uint32 dstpitch /* Length of one destination line in bytes */
+);
+
+/* Conversion palette */
+
+void SDL_Atari_C2pConvert4_pal(Uint16 *lightpalette);
+
+#endif /* _ATARI_C2P_h */
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ataridevmouse.c b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ataridevmouse.c
new file mode 100644
index 0000000..0527380
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ataridevmouse.c
@@ -0,0 +1,159 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ MiNT /dev/mouse driver
+
+ Patrice Mandin
+*/
+
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "../../events/SDL_events_c.h"
+#include "SDL_ataridevmouse_c.h"
+
+/* Defines */
+
+#define DEVICE_NAME "/dev/mouse"
+
+/* Local variables */
+
+static int handle = -1;
+static int mouseb, prev_mouseb;
+
+/* Functions */
+
+int SDL_AtariDevMouse_Open(void)
+{
+ int r;
+ const char *mousedev;
+
+ /*
+ TODO: Fix the MiNT device driver, that locks mouse for other
+ applications, so this is disabled till fixed
+ */
+ return 0;
+
+ /* First, try SDL_MOUSEDEV device */
+ mousedev = SDL_getenv("SDL_MOUSEDEV");
+ if (!mousedev) {
+ handle = open(mousedev, 0);
+ }
+
+ /* Failed, try default device */
+ if (handle<0) {
+ handle = open(DEVICE_NAME, 0);
+ }
+
+ if (handle<0) {
+ handle = -1;
+ return 0;
+ }
+
+ /* Set non blocking mode */
+ r = fcntl(handle, F_GETFL, 0);
+ if (r<0) {
+ close(handle);
+ handle = -1;
+ return 0;
+ }
+
+ r |= O_NDELAY;
+
+ r = fcntl(handle, F_SETFL, r);
+ if (r<0) {
+ close(handle);
+ handle = -1;
+ return 0;
+ }
+
+ prev_mouseb = 7;
+ return 1;
+}
+
+void SDL_AtariDevMouse_Close(void)
+{
+ if (handle>0) {
+ close(handle);
+ handle = -1;
+ }
+}
+
+static int atari_GetButton(int button)
+{
+ switch(button)
+ {
+ case 0:
+ return SDL_BUTTON_RIGHT;
+ case 1:
+ return SDL_BUTTON_MIDDLE;
+ default:
+ break;
+ }
+
+ return SDL_BUTTON_LEFT;
+}
+
+void SDL_AtariDevMouse_PostMouseEvents(_THIS, SDL_bool buttonEvents)
+{
+ unsigned char buffer[3];
+ int mousex, mousey;
+
+ if (handle<0) {
+ return;
+ }
+
+ mousex = mousey = 0;
+ while (read(handle, buffer, sizeof(buffer))==sizeof(buffer)) {
+ mouseb = buffer[0] & 7;
+ mousex += (char) buffer[1];
+ mousey += (char) buffer[2];
+
+ /* Mouse button events */
+ if (buttonEvents && (mouseb != prev_mouseb)) {
+ int i;
+
+ for (i=0;i<3;i++) {
+ int curbutton, prevbutton;
+
+ curbutton = mouseb & (1<<i);
+ prevbutton = prev_mouseb & (1<<i);
+
+ if (curbutton && !prevbutton) {
+ SDL_PrivateMouseButton(SDL_RELEASED, atari_GetButton(i), 0, 0);
+ }
+ if (!curbutton && prevbutton) {
+ SDL_PrivateMouseButton(SDL_PRESSED, atari_GetButton(i), 0, 0);
+ }
+ }
+
+ prev_mouseb = mouseb;
+ }
+ }
+
+ /* Mouse motion event */
+ if (mousex || mousey) {
+ SDL_PrivateMouseMotion(0, 1, mousex, -mousey);
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ataridevmouse_c.h b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ataridevmouse_c.h
new file mode 100644
index 0000000..7cae022
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ataridevmouse_c.h
@@ -0,0 +1,42 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ MiNT /dev/mouse driver
+
+ Patrice Mandin
+*/
+
+#ifndef _SDL_ATARI_DEVMOUSE_H_
+#define _SDL_ATARI_DEVMOUSE_H_
+
+#include "../SDL_sysvideo.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+extern int SDL_AtariDevMouse_Open(void);
+extern void SDL_AtariDevMouse_Close(void);
+extern void SDL_AtariDevMouse_PostMouseEvents(_THIS, SDL_bool buttonEvents);
+
+#endif /* _SDL_ATARI_DEVMOUSE_H_ */
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarieddi.S b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarieddi.S
new file mode 100644
index 0000000..d8cbf48
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarieddi.S
@@ -0,0 +1,42 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/*
+ * Read EdDI version
+ *
+ * Patrice Mandin
+ */
+
+ .text
+
+ .globl _Atari_get_EdDI_version
+
+/*--- Vector installer ---*/
+
+_Atari_get_EdDI_version:
+ movel sp@(4),a0 /* Value of EdDI cookie */
+
+ /* Call EdDI function #0 */
+ clrw d0
+ jsr (a0)
+
+ rts
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarieddi_s.h b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarieddi_s.h
new file mode 100644
index 0000000..cd3e524
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarieddi_s.h
@@ -0,0 +1,54 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_Atari_eddi_s_h
+#define _SDL_Atari_eddi_s_h
+
+/*--- Defines ---*/
+
+/* EdDI versions */
+
+#define EDDI_10 (0x0100)
+#define EDDI_11 (0x0110)
+
+/* Screen format */
+
+enum {
+ VDI_FORMAT_UNKNOWN=-1,
+ VDI_FORMAT_INTER=0, /* Interleaved bitplanes */
+ VDI_FORMAT_VDI=1, /* VDI independent */
+ VDI_FORMAT_PACK=2 /* Packed pixels */
+};
+
+/* CLUT types */
+enum {
+ VDI_CLUT_NONE=0, /* Monochrome mode */
+ VDI_CLUT_HARDWARE, /* <256 colours mode */
+ VDI_CLUT_SOFTWARE /* True colour mode */
+};
+
+/*--- Functions ---*/
+
+unsigned long Atari_get_EdDI_version(void *function_pointer);
+
+#endif /* _SDL_Atari_eddi_s_h */
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarievents.c b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarievents.c
new file mode 100644
index 0000000..8831275
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarievents.c
@@ -0,0 +1,234 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * Atari keyboard events manager
+ *
+ * Patrice Mandin
+ *
+ * This routines choose what the final event manager will be
+ */
+
+#include <mint/cookie.h>
+#include <mint/osbind.h>
+
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_atarikeys.h"
+#include "SDL_atarievents_c.h"
+#include "SDL_biosevents_c.h"
+#include "SDL_gemdosevents_c.h"
+#include "SDL_ikbdevents_c.h"
+
+enum {
+ MCH_ST=0,
+ MCH_STE,
+ MCH_TT,
+ MCH_F30,
+ MCH_CLONE,
+ MCH_ARANYM
+};
+
+/* The translation tables from a console scancode to a SDL keysym */
+static SDLKey keymap[ATARIBIOS_MAXKEYS];
+static char *keytab_normal;
+
+void (*Atari_ShutdownEvents)(void);
+
+static void Atari_InitializeEvents(_THIS)
+{
+ const char *envr;
+ long cookie_mch;
+
+ /* Test if we are on an Atari machine or not */
+ if (Getcookie(C__MCH, &cookie_mch) == C_NOTFOUND) {
+ cookie_mch = 0;
+ }
+ cookie_mch >>= 16;
+
+ /* Default is Ikbd, the faster except for clones */
+ switch(cookie_mch) {
+ case MCH_ST:
+ case MCH_STE:
+ case MCH_TT:
+ case MCH_F30:
+ case MCH_ARANYM:
+ this->InitOSKeymap=AtariIkbd_InitOSKeymap;
+ this->PumpEvents=AtariIkbd_PumpEvents;
+ Atari_ShutdownEvents=AtariIkbd_ShutdownEvents;
+ break;
+ default:
+ this->InitOSKeymap=AtariGemdos_InitOSKeymap;
+ this->PumpEvents=AtariGemdos_PumpEvents;
+ Atari_ShutdownEvents=AtariGemdos_ShutdownEvents;
+ break;
+ }
+
+ envr = SDL_getenv("SDL_ATARI_EVENTSDRIVER");
+
+ if (!envr) {
+ return;
+ }
+
+ if (SDL_strcmp(envr, "ikbd") == 0) {
+ this->InitOSKeymap=AtariIkbd_InitOSKeymap;
+ this->PumpEvents=AtariIkbd_PumpEvents;
+ Atari_ShutdownEvents=AtariIkbd_ShutdownEvents;
+ }
+
+ if (SDL_strcmp(envr, "gemdos") == 0) {
+ this->InitOSKeymap=AtariGemdos_InitOSKeymap;
+ this->PumpEvents=AtariGemdos_PumpEvents;
+ Atari_ShutdownEvents=AtariGemdos_ShutdownEvents;
+ }
+
+ if (SDL_strcmp(envr, "bios") == 0) {
+ this->InitOSKeymap=AtariBios_InitOSKeymap;
+ this->PumpEvents=AtariBios_PumpEvents;
+ Atari_ShutdownEvents=AtariBios_ShutdownEvents;
+ }
+}
+
+void Atari_InitOSKeymap(_THIS)
+{
+ Atari_InitializeEvents(this);
+
+ SDL_Atari_InitInternalKeymap(this);
+
+ /* Call choosen routine */
+ this->InitOSKeymap(this);
+}
+
+void SDL_Atari_InitInternalKeymap(_THIS)
+{
+ int i;
+ _KEYTAB *key_tables;
+
+ /* Read system tables for scancode -> ascii translation */
+ key_tables = (_KEYTAB *) Keytbl(KT_NOCHANGE, KT_NOCHANGE, KT_NOCHANGE);
+ keytab_normal = key_tables->unshift;
+
+ /* Initialize keymap */
+ for ( i=0; i<ATARIBIOS_MAXKEYS; i++ )
+ keymap[i] = SDLK_UNKNOWN;
+
+ /* Functions keys */
+ for ( i = 0; i<10; i++ )
+ keymap[SCANCODE_F1 + i] = SDLK_F1+i;
+
+ /* Cursor keypad */
+ keymap[SCANCODE_HELP] = SDLK_HELP;
+ keymap[SCANCODE_UNDO] = SDLK_UNDO;
+ keymap[SCANCODE_INSERT] = SDLK_INSERT;
+ keymap[SCANCODE_CLRHOME] = SDLK_HOME;
+ keymap[SCANCODE_UP] = SDLK_UP;
+ keymap[SCANCODE_DOWN] = SDLK_DOWN;
+ keymap[SCANCODE_RIGHT] = SDLK_RIGHT;
+ keymap[SCANCODE_LEFT] = SDLK_LEFT;
+
+ /* Special keys */
+ keymap[SCANCODE_ESCAPE] = SDLK_ESCAPE;
+ keymap[SCANCODE_BACKSPACE] = SDLK_BACKSPACE;
+ keymap[SCANCODE_TAB] = SDLK_TAB;
+ keymap[SCANCODE_ENTER] = SDLK_RETURN;
+ keymap[SCANCODE_DELETE] = SDLK_DELETE;
+ keymap[SCANCODE_LEFTCONTROL] = SDLK_LCTRL;
+ keymap[SCANCODE_LEFTSHIFT] = SDLK_LSHIFT;
+ keymap[SCANCODE_RIGHTSHIFT] = SDLK_RSHIFT;
+ keymap[SCANCODE_LEFTALT] = SDLK_LALT;
+ keymap[SCANCODE_CAPSLOCK] = SDLK_CAPSLOCK;
+}
+
+void Atari_PumpEvents(_THIS)
+{
+ Atari_InitializeEvents(this);
+
+ /* Call choosen routine */
+ this->PumpEvents(this);
+}
+
+/* Atari to Unicode charset translation table */
+
+Uint16 SDL_AtariToUnicodeTable[256]={
+ /* Standard ASCII characters from 0x00 to 0x7e */
+ /* Unicode stuff from 0x7f to 0xff */
+
+ 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
+ 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
+ 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
+ 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
+ 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
+ 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
+ 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
+ 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
+
+ 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
+ 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
+ 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
+ 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
+ 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
+ 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
+ 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
+ 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x0394,
+
+ 0x00C7,0x00FC,0x00E9,0x00E2,0x00E4,0x00E0,0x00E5,0x00E7,
+ 0x00EA,0x00EB,0x00E8,0x00EF,0x00EE,0x00EC,0x00C4,0x00C5,
+ 0x00C9,0x00E6,0x00C6,0x00F4,0x00F6,0x00F2,0x00FB,0x00F9,
+ 0x00FF,0x00D6,0x00DC,0x00A2,0x00A3,0x00A5,0x00DF,0x0192,
+ 0x00E1,0x00ED,0x00F3,0x00FA,0x00F1,0x00D1,0x00AA,0x00BA,
+ 0x00BF,0x2310,0x00AC,0x00BD,0x00BC,0x00A1,0x00AB,0x00BB,
+ 0x00C3,0x00F5,0x00D8,0x00F8,0x0153,0x0152,0x00C0,0x00C3,
+ 0x00D5,0x00A8,0x00B4,0x2020,0x00B6,0x00A9,0x00AE,0x2122,
+
+ 0x0133,0x0132,0x05D0,0x05D1,0x05D2,0x05D3,0x05D4,0x05D5,
+ 0x05D6,0x05D7,0x05D8,0x05D9,0x05DB,0x05DC,0x05DE,0x05E0,
+ 0x05E1,0x05E2,0x05E4,0x05E6,0x05E7,0x05E8,0x05E9,0x05EA,
+ 0x05DF,0x05DA,0x05DD,0x05E3,0x05E5,0x00A7,0x2038,0x221E,
+ 0x03B1,0x03B2,0x0393,0x03C0,0x03A3,0x03C3,0x00B5,0x03C4,
+ 0x03A6,0x0398,0x03A9,0x03B4,0x222E,0x03C6,0x2208,0x2229,
+ 0x2261,0x00B1,0x2265,0x2264,0x2320,0x2321,0x00F7,0x2248,
+ 0x00B0,0x2022,0x00B7,0x221A,0x207F,0x00B2,0x00B3,0x00AF
+};
+
+SDL_keysym *SDL_Atari_TranslateKey(int scancode, SDL_keysym *keysym,
+ SDL_bool pressed)
+{
+ int asciicode = 0;
+
+ /* Set the keysym information */
+ keysym->scancode = scancode;
+ keysym->mod = KMOD_NONE;
+ keysym->sym = keymap[scancode];
+ keysym->unicode = 0;
+
+ if (keysym->sym == SDLK_UNKNOWN) {
+ keysym->sym = asciicode = keytab_normal[scancode];
+ }
+
+ if (SDL_TranslateUNICODE && pressed) {
+ keysym->unicode = SDL_AtariToUnicodeTable[asciicode];
+ }
+
+ return(keysym);
+}
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarievents_c.h b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarievents_c.h
new file mode 100644
index 0000000..a7dd882
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarievents_c.h
@@ -0,0 +1,52 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * Atari keyboard events manager
+ *
+ * Patrice Mandin
+ */
+
+#ifndef _SDL_ATARI_EVENTS_H_
+#define _SDL_ATARI_EVENTS_H_
+
+#include "../SDL_sysvideo.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+#define ATARIBIOS_MAXKEYS 128
+
+extern void (*Atari_ShutdownEvents)(void);
+
+extern void Atari_InitOSKeymap(_THIS);
+extern void Atari_PumpEvents(_THIS);
+
+extern void SDL_Atari_InitInternalKeymap(_THIS);
+
+/* Atari to Unicode charset translation table */
+extern Uint16 SDL_AtariToUnicodeTable[256];
+SDL_keysym *SDL_Atari_TranslateKey(int scancode, SDL_keysym *keysym,
+ SDL_bool pressed);
+
+#endif /* _SDL_ATARI_EVENTS_H_ */
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarigl.c b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarigl.c
new file mode 100644
index 0000000..1cf2689
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarigl.c
@@ -0,0 +1,1086 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Atari OSMesa.ldg implementation of SDL OpenGL support */
+
+/*--- Includes ---*/
+
+#if SDL_VIDEO_OPENGL
+#include <GL/osmesa.h>
+#endif
+
+#include <mint/osbind.h>
+
+#include "SDL_endian.h"
+#include "SDL_video.h"
+#include "SDL_atarigl_c.h"
+#if SDL_VIDEO_OPENGL_OSMESA_DYNAMIC
+#include "SDL_loadso.h"
+#endif
+
+/*--- Defines ---*/
+
+#define PATH_OSMESA_LDG "osmesa.ldg"
+#define PATH_MESAGL_LDG "mesa_gl.ldg"
+#define PATH_TINYGL_LDG "tiny_gl.ldg"
+
+#define VDI_RGB 0xf
+
+/*--- Functions prototypes ---*/
+
+#if SDL_VIDEO_OPENGL
+static void SDL_AtariGL_UnloadLibrary(_THIS);
+
+static void CopyShadowNull(_THIS, SDL_Surface *surface);
+static void CopyShadowDirect(_THIS, SDL_Surface *surface);
+static void CopyShadowRGBTo555(_THIS, SDL_Surface *surface);
+static void CopyShadowRGBTo565(_THIS, SDL_Surface *surface);
+static void CopyShadowRGBSwap(_THIS, SDL_Surface *surface);
+static void CopyShadowRGBToARGB(_THIS, SDL_Surface *surface);
+static void CopyShadowRGBToABGR(_THIS, SDL_Surface *surface);
+static void CopyShadowRGBToBGRA(_THIS, SDL_Surface *surface);
+static void CopyShadowRGBToRGBA(_THIS, SDL_Surface *surface);
+static void CopyShadow8888To555(_THIS, SDL_Surface *surface);
+static void CopyShadow8888To565(_THIS, SDL_Surface *surface);
+
+static void ConvertNull(_THIS, SDL_Surface *surface);
+static void Convert565To555be(_THIS, SDL_Surface *surface);
+static void Convert565To555le(_THIS, SDL_Surface *surface);
+static void Convert565le(_THIS, SDL_Surface *surface);
+static void ConvertBGRAToABGR(_THIS, SDL_Surface *surface);
+
+static int InitNew(_THIS, SDL_Surface *current);
+static int InitOld(_THIS, SDL_Surface *current);
+#endif
+
+/*--- Public functions ---*/
+
+int SDL_AtariGL_Init(_THIS, SDL_Surface *current)
+{
+#if SDL_VIDEO_OPENGL
+ if (gl_oldmesa) {
+ gl_active = InitOld(this, current);
+ } else {
+ gl_active = InitNew(this, current);
+ }
+#endif
+
+ return (gl_active);
+}
+
+void SDL_AtariGL_Quit(_THIS, SDL_bool unload)
+{
+#if SDL_VIDEO_OPENGL
+ if (gl_oldmesa) {
+ /* Old mesa implementations */
+ if (this->gl_data->OSMesaDestroyLDG) {
+ this->gl_data->OSMesaDestroyLDG();
+ }
+ if (gl_shadow) {
+ Mfree(gl_shadow);
+ gl_shadow = NULL;
+ }
+ } else {
+ /* New mesa implementation */
+ if (gl_ctx) {
+ if (this->gl_data->OSMesaDestroyContext) {
+ this->gl_data->OSMesaDestroyContext(gl_ctx);
+ }
+ gl_ctx = NULL;
+ }
+ }
+
+ if (unload) {
+ SDL_AtariGL_UnloadLibrary(this);
+ }
+
+#endif /* SDL_VIDEO_OPENGL */
+ gl_active = 0;
+}
+
+int SDL_AtariGL_LoadLibrary(_THIS, const char *path)
+{
+#if SDL_VIDEO_OPENGL
+
+#if SDL_VIDEO_OPENGL_OSMESA_DYNAMIC
+ void *handle;
+ SDL_bool cancel_load;
+
+ if (gl_active) {
+ SDL_SetError("OpenGL context already created");
+ return -1;
+ }
+
+ /* Unload previous driver */
+ SDL_AtariGL_UnloadLibrary(this);
+
+ /* Load library given by path */
+ handle = SDL_LoadObject(path);
+ if (handle == NULL) {
+ /* Try to load another one */
+ path = SDL_getenv("SDL_VIDEO_GL_DRIVER");
+ if ( path != NULL ) {
+ handle = SDL_LoadObject(path);
+ }
+
+ /* If it does not work, try some other */
+ if (handle == NULL) {
+ path = PATH_OSMESA_LDG;
+ handle = SDL_LoadObject(path);
+ }
+
+ if (handle == NULL) {
+ path = PATH_MESAGL_LDG;
+ handle = SDL_LoadObject(path);
+ }
+
+ if (handle == NULL) {
+ path = PATH_TINYGL_LDG;
+ handle = SDL_LoadObject(path);
+ }
+ }
+
+ if (handle == NULL) {
+ SDL_SetError("Could not load OpenGL library");
+ return -1;
+ }
+
+ this->gl_data->glGetIntegerv = SDL_LoadFunction(handle, "glGetIntegerv");
+ this->gl_data->glFinish = SDL_LoadFunction(handle, "glFinish");
+ this->gl_data->glFlush = SDL_LoadFunction(handle, "glFlush");
+
+ cancel_load = SDL_FALSE;
+ if (this->gl_data->glGetIntegerv == NULL) {
+ cancel_load = SDL_TRUE;
+ } else {
+ /* We need either glFinish (OSMesa) or glFlush (TinyGL) */
+ if ((this->gl_data->glFinish == NULL) &&
+ (this->gl_data->glFlush == NULL)) {
+ cancel_load = SDL_TRUE;
+ }
+ }
+ if (cancel_load) {
+ SDL_SetError("Could not retrieve OpenGL functions");
+ SDL_UnloadObject(handle);
+ /* Restore pointers to static library */
+ SDL_AtariGL_InitPointers(this);
+ return -1;
+ }
+
+ /* Load functions pointers (osmesa.ldg) */
+ this->gl_data->OSMesaCreateContextExt = SDL_LoadFunction(handle, "OSMesaCreateContextExt");
+ this->gl_data->OSMesaDestroyContext = SDL_LoadFunction(handle, "OSMesaDestroyContext");
+ this->gl_data->OSMesaMakeCurrent = SDL_LoadFunction(handle, "OSMesaMakeCurrent");
+ this->gl_data->OSMesaPixelStore = SDL_LoadFunction(handle, "OSMesaPixelStore");
+ this->gl_data->OSMesaGetProcAddress = SDL_LoadFunction(handle, "OSMesaGetProcAddress");
+
+ /* Load old functions pointers (mesa_gl.ldg, tiny_gl.ldg) */
+ this->gl_data->OSMesaCreateLDG = SDL_LoadFunction(handle, "OSMesaCreateLDG");
+ this->gl_data->OSMesaDestroyLDG = SDL_LoadFunction(handle, "OSMesaDestroyLDG");
+
+ gl_oldmesa = 0;
+
+ if ( (this->gl_data->OSMesaCreateContextExt == NULL) ||
+ (this->gl_data->OSMesaDestroyContext == NULL) ||
+ (this->gl_data->OSMesaMakeCurrent == NULL) ||
+ (this->gl_data->OSMesaPixelStore == NULL) ||
+ (this->gl_data->OSMesaGetProcAddress == NULL)) {
+ /* Hum, maybe old library ? */
+ if ( (this->gl_data->OSMesaCreateLDG == NULL) ||
+ (this->gl_data->OSMesaDestroyLDG == NULL)) {
+ SDL_SetError("Could not retrieve OSMesa functions");
+ SDL_UnloadObject(handle);
+ /* Restore pointers to static library */
+ SDL_AtariGL_InitPointers(this);
+ return -1;
+ } else {
+ gl_oldmesa = 1;
+ }
+ }
+
+ this->gl_config.dll_handle = handle;
+ if ( path ) {
+ SDL_strlcpy(this->gl_config.driver_path, path,
+ SDL_arraysize(this->gl_config.driver_path));
+ } else {
+ *this->gl_config.driver_path = '\0';
+ }
+
+#endif
+ this->gl_config.driver_loaded = 1;
+
+ return 0;
+#else
+ return -1;
+#endif
+}
+
+void *SDL_AtariGL_GetProcAddress(_THIS, const char *proc)
+{
+ void *func = NULL;
+#if SDL_VIDEO_OPENGL
+
+ if (this->gl_config.dll_handle) {
+ func = SDL_LoadFunction(this->gl_config.dll_handle, (void *)proc);
+ } else if (this->gl_data->OSMesaGetProcAddress) {
+ func = this->gl_data->OSMesaGetProcAddress(proc);
+ }
+
+#endif
+ return func;
+}
+
+int SDL_AtariGL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
+{
+#if SDL_VIDEO_OPENGL
+ GLenum mesa_attrib;
+ SDL_Surface *surface;
+
+ if (!gl_active) {
+ return -1;
+ }
+
+ switch(attrib) {
+ case SDL_GL_RED_SIZE:
+ mesa_attrib = GL_RED_BITS;
+ break;
+ case SDL_GL_GREEN_SIZE:
+ mesa_attrib = GL_GREEN_BITS;
+ break;
+ case SDL_GL_BLUE_SIZE:
+ mesa_attrib = GL_BLUE_BITS;
+ break;
+ case SDL_GL_ALPHA_SIZE:
+ mesa_attrib = GL_ALPHA_BITS;
+ break;
+ case SDL_GL_DOUBLEBUFFER:
+ surface = this->screen;
+ *value = ((surface->flags & SDL_DOUBLEBUF)==SDL_DOUBLEBUF);
+ return 0;
+ case SDL_GL_DEPTH_SIZE:
+ mesa_attrib = GL_DEPTH_BITS;
+ break;
+ case SDL_GL_STENCIL_SIZE:
+ mesa_attrib = GL_STENCIL_BITS;
+ break;
+ case SDL_GL_ACCUM_RED_SIZE:
+ mesa_attrib = GL_ACCUM_RED_BITS;
+ break;
+ case SDL_GL_ACCUM_GREEN_SIZE:
+ mesa_attrib = GL_ACCUM_GREEN_BITS;
+ break;
+ case SDL_GL_ACCUM_BLUE_SIZE:
+ mesa_attrib = GL_ACCUM_BLUE_BITS;
+ break;
+ case SDL_GL_ACCUM_ALPHA_SIZE:
+ mesa_attrib = GL_ACCUM_ALPHA_BITS;
+ break;
+ default :
+ return -1;
+ }
+
+ this->gl_data->glGetIntegerv(mesa_attrib, value);
+ return 0;
+#else
+ return -1;
+#endif
+}
+
+int SDL_AtariGL_MakeCurrent(_THIS)
+{
+#if SDL_VIDEO_OPENGL
+ SDL_Surface *surface;
+ GLenum type;
+
+ if (gl_oldmesa && gl_active) {
+ return 0;
+ }
+
+ if (this->gl_config.dll_handle) {
+ if ((this->gl_data->OSMesaMakeCurrent == NULL) ||
+ (this->gl_data->OSMesaPixelStore == NULL)) {
+ return -1;
+ }
+ }
+
+ if (!gl_active) {
+ SDL_SetError("Invalid OpenGL context");
+ return -1;
+ }
+
+ surface = this->screen;
+
+ if ((surface->format->BitsPerPixel == 15) || (surface->format->BitsPerPixel == 16)) {
+ type = GL_UNSIGNED_SHORT_5_6_5;
+ } else {
+ type = GL_UNSIGNED_BYTE;
+ }
+
+ if (!(this->gl_data->OSMesaMakeCurrent(gl_ctx, surface->pixels, type, surface->w, surface->h))) {
+ SDL_SetError("Can not make OpenGL context current");
+ return -1;
+ }
+
+ /* OSMesa draws upside down */
+ this->gl_data->OSMesaPixelStore(OSMESA_Y_UP, 0);
+
+ return 0;
+#else
+ return -1;
+#endif
+}
+
+void SDL_AtariGL_SwapBuffers(_THIS)
+{
+#if SDL_VIDEO_OPENGL
+ if (gl_active) {
+ if (this->gl_config.dll_handle) {
+ if (this->gl_data->glFinish) {
+ this->gl_data->glFinish();
+ } else if (this->gl_data->glFlush) {
+ this->gl_data->glFlush();
+ }
+ } else {
+ this->gl_data->glFinish();
+ }
+ gl_copyshadow(this, this->screen);
+ gl_convert(this, this->screen);
+ }
+#endif
+}
+
+void SDL_AtariGL_InitPointers(_THIS)
+{
+#if SDL_VIDEO_OPENGL
+ this->gl_data->OSMesaCreateContextExt = OSMesaCreateContextExt;
+ this->gl_data->OSMesaDestroyContext = OSMesaDestroyContext;
+ this->gl_data->OSMesaMakeCurrent = OSMesaMakeCurrent;
+ this->gl_data->OSMesaPixelStore = OSMesaPixelStore;
+ this->gl_data->OSMesaGetProcAddress = OSMesaGetProcAddress;
+
+ this->gl_data->glGetIntegerv = glGetIntegerv;
+ this->gl_data->glFinish = glFinish;
+ this->gl_data->glFlush = glFlush;
+
+ this->gl_data->OSMesaCreateLDG = NULL;
+ this->gl_data->OSMesaDestroyLDG = NULL;
+#endif
+}
+
+/*--- Private functions ---*/
+
+#if SDL_VIDEO_OPENGL
+static void SDL_AtariGL_UnloadLibrary(_THIS)
+{
+ if (this->gl_config.dll_handle) {
+ SDL_UnloadObject(this->gl_config.dll_handle);
+ this->gl_config.dll_handle = NULL;
+
+ /* Restore pointers to static library */
+ SDL_AtariGL_InitPointers(this);
+ }
+}
+
+/*--- Creation of an OpenGL context using new/old functions ---*/
+
+static int InitNew(_THIS, SDL_Surface *current)
+{
+ GLenum osmesa_format;
+ SDL_PixelFormat *pixel_format;
+ Uint32 redmask;
+ int recreatecontext;
+ GLint newaccumsize;
+
+ if (this->gl_config.dll_handle) {
+ if (this->gl_data->OSMesaCreateContextExt == NULL) {
+ return 0;
+ }
+ }
+
+ /* Init OpenGL context using OSMesa */
+ gl_convert = ConvertNull;
+ gl_copyshadow = CopyShadowNull;
+ gl_upsidedown = SDL_FALSE;
+
+ pixel_format = current->format;
+ redmask = pixel_format->Rmask;
+ switch (pixel_format->BitsPerPixel) {
+ case 15:
+ /* 1555, big and little endian, unsupported */
+ gl_pixelsize = 2;
+ osmesa_format = OSMESA_RGB_565;
+ if (redmask == 31<<10) {
+ gl_convert = Convert565To555be;
+ } else {
+ gl_convert = Convert565To555le;
+ }
+ break;
+ case 16:
+ gl_pixelsize = 2;
+ if (redmask == 31<<11) {
+ osmesa_format = OSMESA_RGB_565;
+ } else {
+ /* 565, little endian, unsupported */
+ osmesa_format = OSMESA_RGB_565;
+ gl_convert = Convert565le;
+ }
+ break;
+ case 24:
+ gl_pixelsize = 3;
+ if (redmask == 255<<16) {
+ osmesa_format = OSMESA_RGB;
+ } else {
+ osmesa_format = OSMESA_BGR;
+ }
+ break;
+ case 32:
+ gl_pixelsize = 4;
+ if (redmask == 255<<16) {
+ osmesa_format = OSMESA_ARGB;
+ } else if (redmask == 255<<8) {
+ osmesa_format = OSMESA_BGRA;
+ } else if (redmask == 255<<24) {
+ osmesa_format = OSMESA_RGBA;
+ } else {
+ /* ABGR format unsupported */
+ osmesa_format = OSMESA_BGRA;
+ gl_convert = ConvertBGRAToABGR;
+ }
+ break;
+ default:
+ gl_pixelsize = 1;
+ osmesa_format = OSMESA_COLOR_INDEX;
+ break;
+ }
+
+ /* Try to keep current context if possible */
+ newaccumsize =
+ this->gl_config.accum_red_size +
+ this->gl_config.accum_green_size +
+ this->gl_config.accum_blue_size +
+ this->gl_config.accum_alpha_size;
+ recreatecontext=1;
+ if (gl_ctx &&
+ (gl_curformat == osmesa_format) &&
+ (gl_curdepth == this->gl_config.depth_size) &&
+ (gl_curstencil == this->gl_config.stencil_size) &&
+ (gl_curaccum == newaccumsize)) {
+ recreatecontext = 0;
+ }
+ if (recreatecontext) {
+ SDL_AtariGL_Quit(this, SDL_FALSE);
+
+ gl_ctx = this->gl_data->OSMesaCreateContextExt(
+ osmesa_format, this->gl_config.depth_size,
+ this->gl_config.stencil_size, newaccumsize, NULL );
+
+ if (gl_ctx) {
+ gl_curformat = osmesa_format;
+ gl_curdepth = this->gl_config.depth_size;
+ gl_curstencil = this->gl_config.stencil_size;
+ gl_curaccum = newaccumsize;
+ } else {
+ gl_curformat = 0;
+ gl_curdepth = 0;
+ gl_curstencil = 0;
+ gl_curaccum = 0;
+ }
+ }
+
+ return (gl_ctx != NULL);
+}
+
+
+static int InitOld(_THIS, SDL_Surface *current)
+{
+ GLenum osmesa_format;
+ SDL_PixelFormat *pixel_format;
+ Uint32 redmask;
+ int recreatecontext, tinygl_present;
+
+ if (this->gl_config.dll_handle) {
+ if (this->gl_data->OSMesaCreateLDG == NULL) {
+ return 0;
+ }
+ }
+
+ /* TinyGL only supports VDI_RGB (OSMESA_RGB) */
+ tinygl_present=0;
+ if (this->gl_config.dll_handle) {
+ if (this->gl_data->glFinish == NULL) {
+ tinygl_present=1;
+ }
+ }
+
+ /* Init OpenGL context using OSMesa */
+ gl_convert = ConvertNull;
+ gl_copyshadow = CopyShadowNull;
+ gl_upsidedown = SDL_FALSE;
+
+ pixel_format = current->format;
+ redmask = pixel_format->Rmask;
+ switch (pixel_format->BitsPerPixel) {
+ case 15:
+ /* 15 bits unsupported */
+ if (tinygl_present) {
+ gl_pixelsize = 3;
+ osmesa_format = VDI_RGB;
+ if (redmask == 31<<10) {
+ gl_copyshadow = CopyShadowRGBTo555;
+ } else {
+ gl_copyshadow = CopyShadowRGBTo565;
+ gl_convert = Convert565To555le;
+ }
+ } else {
+ gl_pixelsize = 4;
+ gl_upsidedown = SDL_TRUE;
+ osmesa_format = OSMESA_ARGB;
+ if (redmask == 31<<10) {
+ gl_copyshadow = CopyShadow8888To555;
+ } else {
+ gl_copyshadow = CopyShadow8888To565;
+ gl_convert = Convert565To555le;
+ }
+ }
+ break;
+ case 16:
+ /* 16 bits unsupported */
+ if (tinygl_present) {
+ gl_pixelsize = 3;
+ osmesa_format = VDI_RGB;
+ gl_copyshadow = CopyShadowRGBTo565;
+ if (redmask != 31<<11) {
+ /* 565, little endian, unsupported */
+ gl_convert = Convert565le;
+ }
+ } else {
+ gl_pixelsize = 4;
+ gl_upsidedown = SDL_TRUE;
+ osmesa_format = OSMESA_ARGB;
+ gl_copyshadow = CopyShadow8888To565;
+ if (redmask != 31<<11) {
+ /* 565, little endian, unsupported */
+ gl_convert = Convert565le;
+ }
+ }
+ break;
+ case 24:
+ gl_pixelsize = 3;
+ if (tinygl_present) {
+ osmesa_format = VDI_RGB;
+ gl_copyshadow = CopyShadowDirect;
+ if (redmask != 255<<16) {
+ gl_copyshadow = CopyShadowRGBSwap;
+ }
+ } else {
+ gl_copyshadow = CopyShadowDirect;
+ gl_upsidedown = SDL_TRUE;
+ if (redmask == 255<<16) {
+ osmesa_format = OSMESA_RGB;
+ } else {
+ osmesa_format = OSMESA_BGR;
+ }
+ }
+ break;
+ case 32:
+ if (tinygl_present) {
+ gl_pixelsize = 3;
+ osmesa_format = VDI_RGB;
+ gl_copyshadow = CopyShadowRGBToARGB;
+ if (redmask == 255) {
+ gl_convert = CopyShadowRGBToABGR;
+ } else if (redmask == 255<<8) {
+ gl_convert = CopyShadowRGBToBGRA;
+ } else if (redmask == 255<<24) {
+ gl_convert = CopyShadowRGBToRGBA;
+ }
+ } else {
+ gl_pixelsize = 4;
+ gl_upsidedown = SDL_TRUE;
+ gl_copyshadow = CopyShadowDirect;
+ if (redmask == 255<<16) {
+ osmesa_format = OSMESA_ARGB;
+ } else if (redmask == 255<<8) {
+ osmesa_format = OSMESA_BGRA;
+ } else if (redmask == 255<<24) {
+ osmesa_format = OSMESA_RGBA;
+ } else {
+ /* ABGR format unsupported */
+ osmesa_format = OSMESA_BGRA;
+ gl_convert = ConvertBGRAToABGR;
+ }
+ }
+ break;
+ default:
+ if (tinygl_present) {
+ SDL_AtariGL_Quit(this, SDL_FALSE);
+ return 0;
+ }
+ gl_pixelsize = 1;
+ gl_copyshadow = CopyShadowDirect;
+ osmesa_format = OSMESA_COLOR_INDEX;
+ break;
+ }
+
+ /* Try to keep current context if possible */
+ recreatecontext=1;
+ if (gl_shadow &&
+ (gl_curformat == osmesa_format) &&
+ (gl_curwidth == current->w) &&
+ (gl_curheight == current->h)) {
+ recreatecontext = 0;
+ }
+ if (recreatecontext) {
+ SDL_AtariGL_Quit(this, SDL_FALSE);
+
+ gl_shadow = this->gl_data->OSMesaCreateLDG(
+ osmesa_format, GL_UNSIGNED_BYTE, current->w, current->h
+ );
+
+ if (gl_shadow) {
+ gl_curformat = osmesa_format;
+ gl_curwidth = current->w;
+ gl_curheight = current->h;
+ } else {
+ gl_curformat = 0;
+ gl_curwidth = 0;
+ gl_curheight = 0;
+ }
+ }
+
+ return (gl_shadow != NULL);
+}
+
+/*--- Conversions routines from shadow buffer to the screen ---*/
+
+static void CopyShadowNull(_THIS, SDL_Surface *surface)
+{
+}
+
+static void CopyShadowDirect(_THIS, SDL_Surface *surface)
+{
+ int y, srcpitch, dstpitch;
+ Uint8 *srcline, *dstline;
+
+ srcline = gl_shadow;
+ srcpitch = surface->w * gl_pixelsize;
+ dstline = surface->pixels;
+ dstpitch = surface->pitch;
+ if (gl_upsidedown) {
+ srcline += (surface->h-1)*srcpitch;
+ srcpitch = -srcpitch;
+ }
+
+ for (y=0; y<surface->h; y++) {
+ SDL_memcpy(dstline, srcline, srcpitch);
+
+ srcline += srcpitch;
+ dstline += dstpitch;
+ }
+}
+
+static void CopyShadowRGBTo555(_THIS, SDL_Surface *surface)
+{
+ int x,y, srcpitch, dstpitch;
+ Uint16 *dstline, *dstcol;
+ Uint8 *srcline, *srccol;
+
+ srcline = (Uint8 *)gl_shadow;
+ srcpitch = surface->w * gl_pixelsize;
+ dstline = surface->pixels;
+ dstpitch = surface->pitch >>1;
+ if (gl_upsidedown) {
+ srcline += (surface->h-1)*srcpitch;
+ srcpitch = -srcpitch;
+ }
+
+ for (y=0; y<surface->h; y++) {
+ srccol = srcline;
+ dstcol = dstline;
+ for (x=0; x<surface->w; x++) {
+ Uint16 dstcolor;
+
+ dstcolor = ((*srccol++)<<7) & (31<<10);
+ dstcolor |= ((*srccol++)<<2) & (31<<5);
+ dstcolor |= ((*srccol++)>>3) & 31;
+ *dstcol++ = dstcolor;
+ }
+
+ srcline += srcpitch;
+ dstline += dstpitch;
+ }
+}
+
+static void CopyShadowRGBTo565(_THIS, SDL_Surface *surface)
+{
+ int x,y, srcpitch, dstpitch;
+ Uint16 *dstline, *dstcol;
+ Uint8 *srcline, *srccol;
+
+ srcline = (Uint8 *)gl_shadow;
+ srcpitch = surface->w * gl_pixelsize;
+ dstline = surface->pixels;
+ dstpitch = surface->pitch >>1;
+ if (gl_upsidedown) {
+ srcline += (surface->h-1)*srcpitch;
+ srcpitch = -srcpitch;
+ }
+
+ for (y=0; y<surface->h; y++) {
+ srccol = srcline;
+ dstcol = dstline;
+
+ for (x=0; x<surface->w; x++) {
+ Uint16 dstcolor;
+
+ dstcolor = ((*srccol++)<<8) & (31<<11);
+ dstcolor |= ((*srccol++)<<3) & (63<<5);
+ dstcolor |= ((*srccol++)>>3) & 31;
+ *dstcol++ = dstcolor;
+ }
+
+ srcline += srcpitch;
+ dstline += dstpitch;
+ }
+}
+
+static void CopyShadowRGBSwap(_THIS, SDL_Surface *surface)
+{
+ int x,y, srcpitch, dstpitch;
+ Uint8 *dstline, *dstcol;
+ Uint8 *srcline, *srccol;
+
+ srcline = (Uint8 *)gl_shadow;
+ srcpitch = surface->w * gl_pixelsize;
+ dstline = surface->pixels;
+ dstpitch = surface->pitch;
+ if (gl_upsidedown) {
+ srcline += (surface->h-1)*srcpitch;
+ srcpitch = -srcpitch;
+ }
+
+ for (y=0; y<surface->h; y++) {
+ srccol = srcline;
+ dstcol = dstline;
+
+ for (x=0; x<surface->w; x++) {
+ *dstcol++ = srccol[2];
+ *dstcol++ = srccol[1];
+ *dstcol++ = srccol[0];
+ srccol += 3;
+ }
+
+ srcline += srcpitch;
+ dstline += dstpitch;
+ }
+}
+
+static void CopyShadowRGBToARGB(_THIS, SDL_Surface *surface)
+{
+ int x,y, srcpitch, dstpitch;
+ Uint32 *dstline, *dstcol;
+ Uint8 *srcline, *srccol;
+
+ srcline = (Uint8 *)gl_shadow;
+ srcpitch = surface->w * gl_pixelsize;
+ dstline = surface->pixels;
+ dstpitch = surface->pitch >>2;
+ if (gl_upsidedown) {
+ srcline += (surface->h-1)*srcpitch;
+ srcpitch = -srcpitch;
+ }
+
+ for (y=0; y<surface->h; y++) {
+ srccol = srcline;
+ dstcol = dstline;
+
+ for (x=0; x<surface->w; x++) {
+ Uint32 dstcolor;
+
+ dstcolor = (*srccol++)<<16;
+ dstcolor |= (*srccol++)<<8;
+ dstcolor |= *srccol++;
+
+ *dstcol++ = dstcolor;
+ }
+
+ srcline += srcpitch;
+ dstline += dstpitch;
+ }
+}
+
+static void CopyShadowRGBToABGR(_THIS, SDL_Surface *surface)
+{
+ int x,y, srcpitch, dstpitch;
+ Uint32 *dstline, *dstcol;
+ Uint8 *srcline, *srccol;
+
+ srcline = (Uint8 *)gl_shadow;
+ srcpitch = surface->w * gl_pixelsize;
+ dstline = surface->pixels;
+ dstpitch = surface->pitch >>2;
+ if (gl_upsidedown) {
+ srcline += (surface->h-1)*srcpitch;
+ srcpitch = -srcpitch;
+ }
+
+ for (y=0; y<surface->h; y++) {
+ srccol = srcline;
+ dstcol = dstline;
+
+ for (x=0; x<surface->w; x++) {
+ Uint32 dstcolor;
+
+ dstcolor = *srccol++;
+ dstcolor |= (*srccol++)<<8;
+ dstcolor |= (*srccol++)<<16;
+
+ *dstcol++ = dstcolor;
+ }
+
+ srcline += srcpitch;
+ dstline += dstpitch;
+ }
+}
+
+static void CopyShadowRGBToBGRA(_THIS, SDL_Surface *surface)
+{
+ int x,y, srcpitch, dstpitch;
+ Uint32 *dstline, *dstcol;
+ Uint8 *srcline, *srccol;
+
+ srcline = (Uint8 *)gl_shadow;
+ srcpitch = surface->w * gl_pixelsize;
+ dstline = surface->pixels;
+ dstpitch = surface->pitch >>2;
+ if (gl_upsidedown) {
+ srcline += (surface->h-1)*srcpitch;
+ srcpitch = -srcpitch;
+ }
+
+ for (y=0; y<surface->h; y++) {
+ srccol = srcline;
+ dstcol = dstline;
+
+ for (x=0; x<surface->w; x++) {
+ Uint32 dstcolor;
+
+ dstcolor = (*srccol++)<<8;
+ dstcolor |= (*srccol++)<<16;
+ dstcolor |= (*srccol++)<<24;
+
+ *dstcol++ = dstcolor;
+ }
+
+ srcline += srcpitch;
+ dstline += dstpitch;
+ }
+}
+
+static void CopyShadowRGBToRGBA(_THIS, SDL_Surface *surface)
+{
+ int x,y, srcpitch, dstpitch;
+ Uint32 *dstline, *dstcol;
+ Uint8 *srcline, *srccol;
+
+ srcline = (Uint8 *)gl_shadow;
+ srcpitch = surface->w * gl_pixelsize;
+ dstline = surface->pixels;
+ dstpitch = surface->pitch >>2;
+ if (gl_upsidedown) {
+ srcline += (surface->h-1)*srcpitch;
+ srcpitch = -srcpitch;
+ }
+
+ for (y=0; y<surface->h; y++) {
+ srccol = srcline;
+ dstcol = dstline;
+
+ for (x=0; x<surface->w; x++) {
+ Uint32 dstcolor;
+
+ dstcolor = (*srccol++)<<24;
+ dstcolor |= (*srccol++)<<16;
+ dstcolor |= (*srccol++)<<8;
+
+ *dstcol++ = dstcolor;
+ }
+
+ srcline += srcpitch;
+ dstline += dstpitch;
+ }
+}
+
+static void CopyShadow8888To555(_THIS, SDL_Surface *surface)
+{
+ int x,y, srcpitch, dstpitch;
+ Uint16 *dstline, *dstcol;
+ Uint32 *srcline, *srccol;
+
+ srcline = (Uint32 *)gl_shadow;
+ srcpitch = (surface->w * gl_pixelsize) >>2;
+ dstline = surface->pixels;
+ dstpitch = surface->pitch >>1;
+ if (gl_upsidedown) {
+ srcline += (surface->h-1)*srcpitch;
+ srcpitch = -srcpitch;
+ }
+
+ for (y=0; y<surface->h; y++) {
+ srccol = srcline;
+ dstcol = dstline;
+ for (x=0; x<surface->w; x++) {
+ Uint32 srccolor;
+ Uint16 dstcolor;
+
+ srccolor = *srccol++;
+ dstcolor = (srccolor>>9) & (31<<10);
+ dstcolor |= (srccolor>>6) & (31<<5);
+ dstcolor |= (srccolor>>3) & 31;
+ *dstcol++ = dstcolor;
+ }
+
+ srcline += srcpitch;
+ dstline += dstpitch;
+ }
+}
+
+static void CopyShadow8888To565(_THIS, SDL_Surface *surface)
+{
+ int x,y, srcpitch, dstpitch;
+ Uint16 *dstline, *dstcol;
+ Uint32 *srcline, *srccol;
+
+ srcline = (Uint32 *)gl_shadow;
+ srcpitch = (surface->w * gl_pixelsize) >> 2;
+ dstline = surface->pixels;
+ dstpitch = surface->pitch >>1;
+ if (gl_upsidedown) {
+ srcline += (surface->h-1)*srcpitch;
+ srcpitch = -srcpitch;
+ }
+
+ for (y=0; y<surface->h; y++) {
+ srccol = srcline;
+ dstcol = dstline;
+
+ for (x=0; x<surface->w; x++) {
+ Uint32 srccolor;
+ Uint16 dstcolor;
+
+ srccolor = *srccol++;
+ dstcolor = (srccolor>>8) & (31<<11);
+ dstcolor |= (srccolor>>5) & (63<<5);
+ dstcolor |= (srccolor>>3) & 31;
+ *dstcol++ = dstcolor;
+ }
+
+ srcline += srcpitch;
+ dstline += dstpitch;
+ }
+}
+
+/*--- Conversions routines in the screen ---*/
+
+static void ConvertNull(_THIS, SDL_Surface *surface)
+{
+}
+
+static void Convert565To555be(_THIS, SDL_Surface *surface)
+{
+ int x,y, pitch;
+ unsigned short *line, *pixel;
+
+ line = surface->pixels;
+ pitch = surface->pitch >> 1;
+ for (y=0; y<surface->h; y++) {
+ pixel = line;
+ for (x=0; x<surface->w; x++) {
+ unsigned short color = *pixel;
+
+ *pixel++ = (color & 0x1f)|((color>>1) & 0xffe0);
+ }
+
+ line += pitch;
+ }
+}
+
+static void Convert565To555le(_THIS, SDL_Surface *surface)
+{
+ int x,y, pitch;
+ unsigned short *line, *pixel;
+
+ line = surface->pixels;
+ pitch = surface->pitch >>1;
+ for (y=0; y<surface->h; y++) {
+ pixel = line;
+ for (x=0; x<surface->w; x++) {
+ unsigned short color = *pixel;
+
+ color = (color & 0x1f)|((color>>1) & 0xffe0);
+ *pixel++ = SDL_Swap16(color);
+ }
+
+ line += pitch;
+ }
+}
+
+static void Convert565le(_THIS, SDL_Surface *surface)
+{
+ int x,y, pitch;
+ unsigned short *line, *pixel;
+
+ line = surface->pixels;
+ pitch = surface->pitch >>1;
+ for (y=0; y<surface->h; y++) {
+ pixel = line;
+ for (x=0; x<surface->w; x++) {
+ unsigned short color = *pixel;
+
+ *pixel++ = SDL_Swap16(color);
+ }
+
+ line += pitch;
+ }
+}
+
+static void ConvertBGRAToABGR(_THIS, SDL_Surface *surface)
+{
+ int x,y, pitch;
+ unsigned long *line, *pixel;
+
+ line = surface->pixels;
+ pitch = surface->pitch >>2;
+ for (y=0; y<surface->h; y++) {
+ pixel = line;
+ for (x=0; x<surface->w; x++) {
+ unsigned long color = *pixel;
+
+ *pixel++ = (color<<24)|(color>>8);
+ }
+
+ line += pitch;
+ }
+}
+
+#endif /* SDL_VIDEO_OPENGL */
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarigl_c.h b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarigl_c.h
new file mode 100644
index 0000000..5adcf2a
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarigl_c.h
@@ -0,0 +1,109 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Atari OSMesa.ldg implementation of SDL OpenGL support */
+
+#ifndef _SDL_ATARIGL_H_
+#define _SDL_ATARIGL_H_
+
+#if SDL_VIDEO_OPENGL
+#include <GL/osmesa.h>
+#endif
+
+#include "../SDL_sysvideo.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+struct SDL_PrivateGLData {
+
+ int gl_active; /* to stop switching drivers while we have a valid context */
+
+ int gl_oldmesa; /* Old OpenGL support ? */
+
+ int gl_pixelsize; /* for CopyShadow functions */
+
+ SDL_bool gl_upsidedown; /* Some implementations draw upside down */
+
+ Uint8 *gl_shadow; /* Shadow buffer for old implementations */
+
+ /* for unsupported OSMesa buffer formats */
+ void (*ConvertSurface)(_THIS, SDL_Surface *surface);
+
+ /* to convert the shadow buffer to the screen format */
+ void (*CopyShadow)(_THIS, SDL_Surface *surface);
+
+#if SDL_VIDEO_OPENGL
+ OSMesaContext ctx;
+
+ /* OpenGL functions */
+ void (*glGetIntegerv)( GLenum pname, GLint *value );
+ void (*glFinish)(void);
+ void (*glFlush)(void);
+
+ /* osmesa.ldg */
+ OSMesaContext (*OSMesaCreateContextExt)( GLenum format, GLint depthBits, GLint stencilBits, GLint accumBits, OSMesaContext sharelist);
+ void (*OSMesaDestroyContext)( OSMesaContext ctx );
+ GLboolean (*OSMesaMakeCurrent)( OSMesaContext ctx, void *buffer, GLenum type, GLsizei width, GLsizei height );
+ void (*OSMesaPixelStore)( GLint pname, GLint value );
+ void * (*OSMesaGetProcAddress)( const char *funcName );
+
+ /* mesa_gl.ldg, tiny_gl.ldg */
+ void *(*OSMesaCreateLDG)( long format, long type, long width, long height );
+ void (*OSMesaDestroyLDG)(void);
+
+ /* Info needed to compare existing context with new asked one */
+ int width, height;
+ GLenum format;
+ GLint depth,stencil,accum;
+#endif
+};
+
+/* Variable names */
+#define gl_active (this->gl_data->gl_active)
+#define gl_ctx (this->gl_data->ctx)
+#define gl_oldmesa (this->gl_data->gl_oldmesa)
+#define gl_pixelsize (this->gl_data->gl_pixelsize)
+#define gl_upsidedown (this->gl_data->gl_upsidedown)
+#define gl_shadow (this->gl_data->gl_shadow)
+#define gl_convert (this->gl_data->ConvertSurface)
+#define gl_copyshadow (this->gl_data->CopyShadow)
+#define gl_curformat (this->gl_data->format)
+#define gl_curdepth (this->gl_data->depth)
+#define gl_curstencil (this->gl_data->stencil)
+#define gl_curaccum (this->gl_data->accum)
+#define gl_curwidth (this->gl_data->width)
+#define gl_curheight (this->gl_data->height)
+
+/* OpenGL functions */
+extern int SDL_AtariGL_Init(_THIS, SDL_Surface *current);
+extern void SDL_AtariGL_Quit(_THIS, SDL_bool unload);
+extern void SDL_AtariGL_InitPointers(_THIS);
+
+extern int SDL_AtariGL_LoadLibrary(_THIS, const char *path);
+extern void *SDL_AtariGL_GetProcAddress(_THIS, const char *proc);
+extern int SDL_AtariGL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
+extern int SDL_AtariGL_MakeCurrent(_THIS);
+extern void SDL_AtariGL_SwapBuffers(_THIS);
+
+#endif /* _SDL_ATARIGL_H_ */
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarikeys.h b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarikeys.h
new file mode 100644
index 0000000..a9f7cfd
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarikeys.h
@@ -0,0 +1,140 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/*
+ * Atari Scancode definitions
+ *
+ * Patrice Mandin
+ */
+
+#ifndef _SDL_ATARIKEYS_H_
+#define _SDL_ATARIKEYS_H_
+
+/* --- Keyboard scancodes --- */
+/* taken from svgalib/vgakeyboard.h */
+
+#define SCANCODE_ESCAPE 0x01
+#define SCANCODE_1 0x02
+#define SCANCODE_2 0x03
+#define SCANCODE_3 0x04
+#define SCANCODE_4 0x05
+#define SCANCODE_5 0x06
+#define SCANCODE_6 0x07
+#define SCANCODE_7 0x08
+#define SCANCODE_8 0x09
+#define SCANCODE_9 0x0a
+#define SCANCODE_0 0x0b
+#define SCANCODE_MINUS 0x0c
+#define SCANCODE_EQUAL 0x0d
+#define SCANCODE_BACKSPACE 0x0e
+
+#define SCANCODE_TAB 0x0f
+#define SCANCODE_Q 0x10
+#define SCANCODE_W 0x11
+#define SCANCODE_E 0x12
+#define SCANCODE_R 0x13
+#define SCANCODE_T 0x14
+#define SCANCODE_Y 0x15
+#define SCANCODE_U 0x16
+#define SCANCODE_I 0x17
+#define SCANCODE_O 0x18
+#define SCANCODE_P 0x19
+#define SCANCODE_BRACKET_LEFT 0x1a
+#define SCANCODE_BRACKET_RIGHT 0x1b
+#define SCANCODE_ENTER 0x1c
+#define SCANCODE_DELETE 0x53
+
+#define SCANCODE_LEFTCONTROL 0x1d
+#define SCANCODE_A 0x1e
+#define SCANCODE_S 0x1f
+#define SCANCODE_D 0x20
+#define SCANCODE_F 0x21
+#define SCANCODE_G 0x22
+#define SCANCODE_H 0x23
+#define SCANCODE_J 0x24
+#define SCANCODE_K 0x25
+#define SCANCODE_L 0x26
+#define SCANCODE_SEMICOLON 0x27
+#define SCANCODE_APOSTROPHE 0x28
+#define SCANCODE_GRAVE 0x29
+
+#define SCANCODE_LEFTSHIFT 0x2a
+#define SCANCODE_BACKSLASH 0x2b
+#define SCANCODE_Z 0x2c
+#define SCANCODE_X 0x2d
+#define SCANCODE_C 0x2e
+#define SCANCODE_V 0x2f
+#define SCANCODE_B 0x30
+#define SCANCODE_N 0x31
+#define SCANCODE_M 0x32
+#define SCANCODE_COMMA 0x33
+#define SCANCODE_PERIOD 0x34
+#define SCANCODE_SLASH 0x35
+#define SCANCODE_RIGHTSHIFT 0x36
+
+#define SCANCODE_LEFTALT 0x38
+#define SCANCODE_SPACE 0x39
+#define SCANCODE_CAPSLOCK 0x3a
+
+/* Functions keys */
+#define SCANCODE_F1 0x3b
+#define SCANCODE_F2 0x3c
+#define SCANCODE_F3 0x3d
+#define SCANCODE_F4 0x3e
+#define SCANCODE_F5 0x3f
+#define SCANCODE_F6 0x40
+#define SCANCODE_F7 0x41
+#define SCANCODE_F8 0x42
+#define SCANCODE_F9 0x43
+#define SCANCODE_F10 0x44
+
+/* Numeric keypad */
+#define SCANCODE_KP0 0x70
+#define SCANCODE_KP1 0x6d
+#define SCANCODE_KP2 0x6e
+#define SCANCODE_KP3 0x6f
+#define SCANCODE_KP4 0x6a
+#define SCANCODE_KP5 0x6b
+#define SCANCODE_KP6 0x6c
+#define SCANCODE_KP7 0x67
+#define SCANCODE_KP8 0x68
+#define SCANCODE_KP9 0x69
+#define SCANCODE_KP_PERIOD 0x71
+#define SCANCODE_KP_DIVIDE 0x65
+#define SCANCODE_KP_MULTIPLY 0x66
+#define SCANCODE_KP_MINUS 0x4a
+#define SCANCODE_KP_PLUS 0x4e
+#define SCANCODE_KP_ENTER 0x72
+#define SCANCODE_KP_LEFTPAREN 0x63
+#define SCANCODE_KP_RIGHTPAREN 0x64
+
+/* Cursor keypad */
+#define SCANCODE_HELP 0x62
+#define SCANCODE_UNDO 0x61
+#define SCANCODE_INSERT 0x52
+#define SCANCODE_CLRHOME 0x47
+#define SCANCODE_UP 0x48
+#define SCANCODE_DOWN 0x50
+#define SCANCODE_RIGHT 0x4d
+#define SCANCODE_LEFT 0x4b
+
+#endif /* _SDL_ATARIKEYS_H_ */
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarimxalloc.c b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarimxalloc.c
new file mode 100644
index 0000000..224baef
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarimxalloc.c
@@ -0,0 +1,52 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * Memory allocation
+ *
+ * Patrice Mandin
+ */
+
+#include <mint/osbind.h>
+
+#include "SDL_stdinc.h"
+
+/*--- Variables ---*/
+
+static int atari_mxalloc_avail=-1;
+
+/*--- Functions ---*/
+
+void *Atari_SysMalloc(Uint32 size, Uint16 alloc_type)
+{
+ /* Test if Mxalloc() available */
+ if (atari_mxalloc_avail<0) {
+ atari_mxalloc_avail = ((Sversion()&0xFF)>=0x01) | (Sversion()>=0x1900);
+ }
+
+ if (atari_mxalloc_avail) {
+ return (void *) Mxalloc(size, alloc_type);
+ } else {
+ return (void *) Malloc(size);
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarimxalloc_c.h b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarimxalloc_c.h
new file mode 100644
index 0000000..937408d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarimxalloc_c.h
@@ -0,0 +1,37 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * Memory allocation
+ *
+ * Patrice Mandin
+ */
+
+#ifndef _SDL_ATARI_MXALLOC_H_
+#define _SDL_ATARI_MXALLOC_H_
+
+/*--- Functions ---*/
+
+extern void *Atari_SysMalloc(Uint32 size, Uint16 alloc_type);
+
+#endif /* _SDL_ATARI_MXALLOC_H_ */
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarisuper.h b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarisuper.h
new file mode 100644
index 0000000..8f25c7e
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_atarisuper.h
@@ -0,0 +1,61 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _ATARI_SUPER_h
+#define _ATARI_SUPER_h
+
+#include "SDL_stdinc.h"
+
+#ifndef SuperToUser
+
+/*
+ * Safe binding to switch back from supervisor to user mode.
+ * On TOS or EmuTOS, if the stack pointer has changed between Super(0)
+ * and Super(oldssp), the resulting user stack pointer is wrong.
+ * This bug does not occur with FreeMiNT.
+ * So the safe way to return from supervisor to user mode is to backup
+ * the stack pointer then restore it after the trap.
+ * Sometimes, GCC optimizes the stack usage, so this matters.
+ */
+#define SuperToUser(ptr) \
+(void)__extension__ \
+({ \
+ register long retvalue __asm__("d0"); \
+ register long sp_backup; \
+ \
+ __asm__ volatile \
+ ( \
+ "movl sp,%1\n\t" \
+ "movl %2,sp@-\n\t" \
+ "movw #0x20,sp@-\n\t" \
+ "trap #1\n\t" \
+ "movl %1,sp\n\t" \
+ : "=r"(retvalue), "=&r"(sp_backup) /* outputs */ \
+ : "g"((long)(ptr)) /* inputs */ \
+ : "d1", "d2", "a0", "a1", "a2" \
+ ); \
+})
+
+#endif /* SuperToUser */
+
+#endif /* _ATARI_SUPER_h */
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_biosevents.c b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_biosevents.c
new file mode 100644
index 0000000..3d36b2b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_biosevents.c
@@ -0,0 +1,131 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * Atari keyboard events manager, using BIOS
+ *
+ * Patrice Mandin
+ */
+
+/* Mint includes */
+#include <mint/osbind.h>
+#include <mint/cookie.h>
+
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_atarikeys.h"
+#include "SDL_atarievents_c.h"
+#include "SDL_xbiosevents_c.h"
+#include "SDL_ataridevmouse_c.h"
+
+static unsigned char bios_currentkeyboard[ATARIBIOS_MAXKEYS];
+static unsigned char bios_previouskeyboard[ATARIBIOS_MAXKEYS];
+static SDL_bool use_dev_mouse = SDL_FALSE;
+
+static void UpdateSpecialKeys(int special_keys_state);
+
+void AtariBios_InitOSKeymap(_THIS)
+{
+ int vectors_mask;
+/* unsigned long dummy;*/
+
+ SDL_memset(bios_currentkeyboard, 0, sizeof(bios_currentkeyboard));
+ SDL_memset(bios_previouskeyboard, 0, sizeof(bios_previouskeyboard));
+
+ use_dev_mouse = (SDL_AtariDevMouse_Open()!=0) ? SDL_TRUE : SDL_FALSE;
+
+ vectors_mask = ATARI_XBIOS_JOYSTICKEVENTS; /* XBIOS joystick events */
+ if (!use_dev_mouse) {
+ vectors_mask |= ATARI_XBIOS_MOUSEEVENTS; /* XBIOS mouse events */
+ }
+/* if (Getcookie(C_MiNT, &dummy)==C_FOUND) {
+ vectors_mask = 0;
+ }*/
+
+ SDL_AtariXbios_InstallVectors(vectors_mask);
+}
+
+void AtariBios_PumpEvents(_THIS)
+{
+ int i;
+ SDL_keysym keysym;
+
+ /* Update pressed keys */
+ SDL_memset(bios_currentkeyboard, 0, ATARIBIOS_MAXKEYS);
+
+ while (Bconstat(_CON)) {
+ unsigned long key_pressed;
+ key_pressed=Bconin(_CON);
+ bios_currentkeyboard[(key_pressed>>16)&(ATARIBIOS_MAXKEYS-1)]=0xFF;
+ }
+
+ /* Read special keys */
+ UpdateSpecialKeys(Kbshift(-1));
+
+ /* Now generate events */
+ for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
+ /* Key pressed ? */
+ if (bios_currentkeyboard[i] && !bios_previouskeyboard[i])
+ SDL_PrivateKeyboard(SDL_PRESSED,
+ SDL_Atari_TranslateKey(i, &keysym, SDL_TRUE));
+
+ /* Key unpressed ? */
+ if (bios_previouskeyboard[i] && !bios_currentkeyboard[i])
+ SDL_PrivateKeyboard(SDL_RELEASED,
+ SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE));
+ }
+
+ if (use_dev_mouse) {
+ SDL_AtariDevMouse_PostMouseEvents(this, SDL_TRUE);
+ } else {
+ SDL_AtariXbios_PostMouseEvents(this, SDL_TRUE);
+ }
+
+ /* Will be previous table */
+ SDL_memcpy(bios_previouskeyboard, bios_currentkeyboard, sizeof(bios_previouskeyboard));
+}
+
+static void UpdateSpecialKeys(int special_keys_state)
+{
+#define UPDATE_SPECIAL_KEYS(numbit,scancode) \
+ { \
+ if (special_keys_state & (1<<(numbit))) { \
+ bios_currentkeyboard[scancode]=0xFF; \
+ } \
+ }
+
+ UPDATE_SPECIAL_KEYS(K_RSHIFT, SCANCODE_RIGHTSHIFT);
+ UPDATE_SPECIAL_KEYS(K_LSHIFT, SCANCODE_LEFTSHIFT);
+ UPDATE_SPECIAL_KEYS(K_CTRL, SCANCODE_LEFTCONTROL);
+ UPDATE_SPECIAL_KEYS(K_ALT, SCANCODE_LEFTALT);
+ UPDATE_SPECIAL_KEYS(K_CAPSLOCK, SCANCODE_CAPSLOCK);
+}
+
+void AtariBios_ShutdownEvents(void)
+{
+ SDL_AtariXbios_RestoreVectors();
+ if (use_dev_mouse) {
+ SDL_AtariDevMouse_Close();
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_biosevents_c.h b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_biosevents_c.h
new file mode 100644
index 0000000..f016e6a
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_biosevents_c.h
@@ -0,0 +1,42 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * Atari keyboard events manager, using BIOS
+ *
+ * Patrice Mandin
+ */
+
+#ifndef _SDL_ATARI_BIOSEVENTS_H_
+#define _SDL_ATARI_BIOSEVENTS_H_
+
+#include "../SDL_sysvideo.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+extern void AtariBios_InitOSKeymap(_THIS);
+extern void AtariBios_PumpEvents(_THIS);
+extern void AtariBios_ShutdownEvents(void);
+
+#endif /* _SDL_ATARI_BIOSEVENTS_H_ */
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_gemdosevents.c b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_gemdosevents.c
new file mode 100644
index 0000000..e1ebaa6
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_gemdosevents.c
@@ -0,0 +1,132 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * Atari keyboard events manager, using Gemdos
+ *
+ * Patrice Mandin
+ */
+
+/* Mint includes */
+#include <mint/osbind.h>
+#include <mint/cookie.h>
+
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_atarikeys.h"
+#include "SDL_atarievents_c.h"
+#include "SDL_xbiosevents_c.h"
+#include "SDL_ataridevmouse_c.h"
+
+/* To save state of keyboard */
+
+static unsigned char gemdos_currentkeyboard[ATARIBIOS_MAXKEYS];
+static unsigned char gemdos_previouskeyboard[ATARIBIOS_MAXKEYS];
+static SDL_bool use_dev_mouse = SDL_FALSE;
+
+static void UpdateSpecialKeys(int special_keys_state);
+
+void AtariGemdos_InitOSKeymap(_THIS)
+{
+ int vectors_mask;
+/* unsigned long dummy;*/
+
+ SDL_memset(gemdos_currentkeyboard, 0, sizeof(gemdos_currentkeyboard));
+ SDL_memset(gemdos_previouskeyboard, 0, sizeof(gemdos_previouskeyboard));
+
+ use_dev_mouse = (SDL_AtariDevMouse_Open()!=0) ? SDL_TRUE : SDL_FALSE;
+
+ vectors_mask = ATARI_XBIOS_JOYSTICKEVENTS; /* XBIOS joystick events */
+ if (!use_dev_mouse) {
+ vectors_mask |= ATARI_XBIOS_MOUSEEVENTS; /* XBIOS mouse events */
+ }
+/* if (Getcookie(C_MiNT, &dummy)==C_FOUND) {
+ vectors_mask = 0;
+ }*/
+ SDL_AtariXbios_InstallVectors(vectors_mask);
+}
+
+void AtariGemdos_PumpEvents(_THIS)
+{
+ int i;
+ SDL_keysym keysym;
+
+ /* Update pressed keys */
+ SDL_memset(gemdos_currentkeyboard, 0, ATARIBIOS_MAXKEYS);
+
+ while (Cconis()!=DEV_BUSY) {
+ unsigned long key_pressed;
+ key_pressed=Cnecin();
+ gemdos_currentkeyboard[(key_pressed>>16)&(ATARIBIOS_MAXKEYS-1)]=0xFF;
+ }
+
+ /* Read special keys */
+ UpdateSpecialKeys(Kbshift(-1));
+
+ /* Now generate events */
+ for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
+ /* Key pressed ? */
+ if (gemdos_currentkeyboard[i] && !gemdos_previouskeyboard[i])
+ SDL_PrivateKeyboard(SDL_PRESSED,
+ SDL_Atari_TranslateKey(i, &keysym, SDL_TRUE));
+
+ /* Key unpressed ? */
+ if (gemdos_previouskeyboard[i] && !gemdos_currentkeyboard[i])
+ SDL_PrivateKeyboard(SDL_RELEASED,
+ SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE));
+ }
+
+ if (use_dev_mouse) {
+ SDL_AtariDevMouse_PostMouseEvents(this, SDL_TRUE);
+ } else {
+ SDL_AtariXbios_PostMouseEvents(this, SDL_TRUE);
+ }
+
+ /* Will be previous table */
+ SDL_memcpy(gemdos_previouskeyboard, gemdos_currentkeyboard, sizeof(gemdos_previouskeyboard));
+}
+
+static void UpdateSpecialKeys(int special_keys_state)
+{
+#define UPDATE_SPECIAL_KEYS(numbit,scancode) \
+ { \
+ if (special_keys_state & (1<<(numbit))) { \
+ gemdos_currentkeyboard[scancode]=0xFF; \
+ } \
+ }
+
+ UPDATE_SPECIAL_KEYS(K_RSHIFT, SCANCODE_RIGHTSHIFT);
+ UPDATE_SPECIAL_KEYS(K_LSHIFT, SCANCODE_LEFTSHIFT);
+ UPDATE_SPECIAL_KEYS(K_CTRL, SCANCODE_LEFTCONTROL);
+ UPDATE_SPECIAL_KEYS(K_ALT, SCANCODE_LEFTALT);
+ UPDATE_SPECIAL_KEYS(K_CAPSLOCK, SCANCODE_CAPSLOCK);
+}
+
+void AtariGemdos_ShutdownEvents(void)
+{
+ SDL_AtariXbios_RestoreVectors();
+ if (use_dev_mouse) {
+ SDL_AtariDevMouse_Close();
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_gemdosevents_c.h b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_gemdosevents_c.h
new file mode 100644
index 0000000..b9924e6
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_gemdosevents_c.h
@@ -0,0 +1,42 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * Atari keyboard events manager, using Gemdos
+ *
+ * Patrice Mandin
+ */
+
+#ifndef _SDL_ATARI_GEMDOSEVENTS_H_
+#define _SDL_ATARI_GEMDOSEVENTS_H_
+
+#include "../SDL_sysvideo.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+extern void AtariGemdos_InitOSKeymap(_THIS);
+extern void AtariGemdos_PumpEvents(_THIS);
+extern void AtariGemdos_ShutdownEvents(void);
+
+#endif /* _SDL_ATARI_GEMDOSEVENTS_H_ */
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ikbdevents.c b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ikbdevents.c
new file mode 100644
index 0000000..35fc5cb
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ikbdevents.c
@@ -0,0 +1,124 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * Atari keyboard events manager, using hardware IKBD
+ *
+ * Patrice Mandin
+ */
+
+/* Mint includes */
+#include <mint/osbind.h>
+
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_atarikeys.h"
+#include "SDL_atarievents_c.h"
+#include "SDL_ikbdinterrupt_s.h"
+
+#define KEY_PRESSED 0xff
+#define KEY_UNDEFINED 0x80
+#define KEY_RELEASED 0x00
+
+static Uint16 atari_prevmouseb; /* save state of mouse buttons */
+
+void AtariIkbd_InitOSKeymap(_THIS)
+{
+ SDL_memset((void *) SDL_AtariIkbd_keyboard, KEY_UNDEFINED, sizeof(SDL_AtariIkbd_keyboard));
+
+ /* Now install our handler */
+ SDL_AtariIkbd_mouseb = SDL_AtariIkbd_mousex = SDL_AtariIkbd_mousey = 0;
+ atari_prevmouseb = 0;
+
+ Supexec(SDL_AtariIkbdInstall);
+}
+
+static int atari_GetButton(int button)
+{
+ switch(button)
+ {
+ case 0:
+ return SDL_BUTTON_RIGHT;
+ break;
+ case 1:
+ default:
+ return SDL_BUTTON_LEFT;
+ break;
+ }
+}
+
+void AtariIkbd_PumpEvents(_THIS)
+{
+ int i;
+ SDL_keysym keysym;
+
+ /*--- Send keyboard events ---*/
+
+ for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
+ /* Key pressed ? */
+ if (SDL_AtariIkbd_keyboard[i]==KEY_PRESSED) {
+ SDL_PrivateKeyboard(SDL_PRESSED,
+ SDL_Atari_TranslateKey(i, &keysym, SDL_TRUE));
+ SDL_AtariIkbd_keyboard[i]=KEY_UNDEFINED;
+ }
+
+ /* Key released ? */
+ if (SDL_AtariIkbd_keyboard[i]==KEY_RELEASED) {
+ SDL_PrivateKeyboard(SDL_RELEASED,
+ SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE));
+ SDL_AtariIkbd_keyboard[i]=KEY_UNDEFINED;
+ }
+ }
+
+ /*--- Send mouse events ---*/
+
+ /* Mouse motion ? */
+ if (SDL_AtariIkbd_mousex || SDL_AtariIkbd_mousey) {
+ SDL_PrivateMouseMotion(0, 1, SDL_AtariIkbd_mousex, SDL_AtariIkbd_mousey);
+ SDL_AtariIkbd_mousex = SDL_AtariIkbd_mousey = 0;
+ }
+
+ /* Mouse button ? */
+ if (SDL_AtariIkbd_mouseb != atari_prevmouseb) {
+ for (i=0;i<2;i++) {
+ int curbutton, prevbutton;
+
+ curbutton = SDL_AtariIkbd_mouseb & (1<<i);
+ prevbutton = atari_prevmouseb & (1<<i);
+
+ if (curbutton && !prevbutton) {
+ SDL_PrivateMouseButton(SDL_PRESSED, atari_GetButton(i), 0, 0);
+ }
+ if (!curbutton && prevbutton) {
+ SDL_PrivateMouseButton(SDL_RELEASED, atari_GetButton(i), 0, 0);
+ }
+ }
+ atari_prevmouseb = SDL_AtariIkbd_mouseb;
+ }
+}
+
+void AtariIkbd_ShutdownEvents(void)
+{
+ Supexec(SDL_AtariIkbdUninstall);
+}
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ikbdevents_c.h b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ikbdevents_c.h
new file mode 100644
index 0000000..753e777
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ikbdevents_c.h
@@ -0,0 +1,42 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * Atari keyboard events manager, using hardware IKBD
+ *
+ * Patrice Mandin
+ */
+
+#ifndef _SDL_ATARI_IKBDEVENTS_H_
+#define _SDL_ATARI_IKBDEVENTS_H_
+
+#include "../SDL_sysvideo.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+extern void AtariIkbd_InitOSKeymap(_THIS);
+extern void AtariIkbd_PumpEvents(_THIS);
+extern void AtariIkbd_ShutdownEvents(void);
+
+#endif /* _SDL_ATARI_IKBDEVENTS_H_ */
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ikbdinterrupt.S b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ikbdinterrupt.S
new file mode 100644
index 0000000..21facc8
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ikbdinterrupt.S
@@ -0,0 +1,404 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/*
+ * IKBD 6301 interrupt routine
+ *
+ * Patrice Mandin
+ */
+
+ .text
+
+ .globl _SDL_AtariIkbdInstall
+ .globl _SDL_AtariIkbdUninstall
+
+ .globl _SDL_AtariIkbd_keyboard
+ .globl _SDL_AtariIkbd_mouseb
+ .globl _SDL_AtariIkbd_mousex
+ .globl _SDL_AtariIkbd_mousey
+ .globl _SDL_AtariIkbd_joystick
+
+ .globl _SDL_AtariIkbd_enabled
+
+/*--- Install our IKBD vector ---*/
+
+_SDL_AtariIkbdInstall:
+#if defined(__mcoldfire__)
+ lea sp@(-16),sp
+ moveml d0-d1/a0-a1,sp@
+#else
+ moveml d0-d1/a0-a1,sp@-
+#endif
+
+ | Disable interrupts
+
+ movew #0x2700,sr
+
+ | Save MFP registers used for keyboard
+
+ lea 0xfffffa00:w,a0
+ btst #6,a0@(0x09)
+#if defined(__mcoldfire__)
+ sne d0
+ move.b d0,ikbd_ierb
+#else
+ sne ikbd_ierb
+#endif
+ btst #6,a0@(0x15)
+#if defined(__mcoldfire__)
+ sne d0
+ move.b d0,ikbd_imrb
+#else
+ sne ikbd_imrb
+#endif
+
+ | Set our routine
+
+#if defined(__mcoldfire__)
+ movel 0x118:w,d0
+ movel d0,old_ikbd
+ lea ikbd,a0
+ movel a0,0x118:w
+ moveql #6,d0
+ bset d0,0xfffffa09:w | IERB
+ bset d0,0xfffffa15:w | IMRB
+#else
+ movel 0x118:w,old_ikbd
+ movel #ikbd,0x118:w
+ bset #6,0xfffffa09:w | IERB
+ bset #6,0xfffffa15:w | IMRB
+#endif
+
+ | Set mouse relative mode
+
+#if defined(__mcoldfire__)
+ moveql #8,d0
+ moveb d0,0xfffffc02:w
+#else
+ moveb #8,0xfffffc02:w
+#endif
+
+ | Reenable interrupts
+
+ movew #0x2300,sr
+
+ | Interrupts done
+
+#if defined(__mcoldfire__)
+ movel #0xffff,d0
+ movew d0,_SDL_AtariIkbd_enabled
+
+ moveml sp@,d0-d1/a0-a1
+ lea sp@(16),sp
+#else
+ movew #0xffff,_SDL_AtariIkbd_enabled
+
+ moveml sp@+,d0-d1/a0-a1
+#endif
+ rts
+
+/*--- Uninstall our IKBD vector ---*/
+
+_SDL_AtariIkbdUninstall:
+ movel a0,sp@-
+
+ | Disable interrupts
+
+ movew #0x2700,sr
+
+ | Restore previous MFP registers
+
+ lea 0xfffffa00:w,a0
+
+ bclr #6,a0@(0x09)
+ tstb ikbd_ierb
+ beqs ikbd_restoreierb
+ bset #6,a0@(0x09)
+ikbd_restoreierb:
+
+ bclr #6,a0@(0x15)
+ tstb ikbd_imrb
+ beqs ikbd_restoreimrb
+ bset #6,a0@(0x15)
+ikbd_restoreimrb:
+
+#if defined(__mcoldfire__)
+ movel old_ikbd,a0
+ movel a0,0x118:w
+#else
+ movel old_ikbd,0x118:w
+#endif
+
+ | Clear keyboard buffer
+
+ lea 0xfffffc00:w,a0
+ikbd_videbuffer:
+ btst #0,a0@
+ beqs ikbd_finbuffer
+ tstb a0@(0x02)
+ bras ikbd_videbuffer
+ikbd_finbuffer:
+
+ | Reenable interrupts
+
+ movew #0x2300,sr
+
+ movel sp@+,a0
+ rts
+
+ .bss
+
+ .even
+ .comm ikbd_ierb,1
+ .comm ikbd_imrb,1
+
+/*--- Our custom IKBD vector ---*/
+
+ .text
+ .even
+ .ascii "XBRA"
+ .ascii "LSDL"
+ .comm old_ikbd,4*1
+ikbd:
+#if defined(__mcoldfire__)
+ lea sp@(-12),sp
+ moveml d0-d1/a0,sp@
+#else
+ moveml d0-d1/a0,sp@-
+#endif
+
+ | Check if source is IKBD or MIDI
+#if defined(__mcoldfire__)
+ moveql #0,d0
+ btst d0,0xfffffc00.w
+#else
+ btst #0,0xfffffc00.w
+#endif
+ beqs ikbd_oldmidi
+
+ moveb 0xfffffc02:w,d0
+
+ | Joystick packet ?
+
+ cmpb #0xff,d0
+ beqs ikbd_yes_joystick
+
+ | Mouse packet ?
+
+ cmpb #0xf8,d0
+ bmis ikbd_no_mouse
+ cmpb #0xfc,d0
+ bpls ikbd_no_mouse
+
+ | Mouse packet, byte #1
+
+ikbd_yes_mouse:
+#if defined(__mcoldfire__)
+ andl #3,d0
+#else
+ andw #3,d0
+#endif
+ movew d0,_SDL_AtariIkbd_mouseb
+
+#if defined(__mcoldfire__)
+ movel #ikbd_mousex,d0
+ movel d0,0x118:w
+#else
+ movel #ikbd_mousex,0x118:w
+#endif
+ bras ikbd_endit_stack
+
+ | Joystick packet, byte #1
+
+ikbd_yes_joystick:
+#if defined(__mcoldfire__)
+ movel #ikbd_joystick,d0
+ movel d0,0x118:w
+#else
+ movel #ikbd_joystick,0x118:w
+#endif
+ bras ikbd_endit_stack
+
+ | Keyboard press/release
+
+ikbd_no_mouse:
+ moveb d0,d1
+ lea _SDL_AtariIkbd_keyboard,a0
+#if defined(__mcoldfire__)
+ andl #0x7f,d1
+ btst #7,d0
+ spl d0
+ moveb d0,a0@(0,d1:l)
+#else
+ andw #0x7f,d1
+ tas d0
+ spl a0@(0,d1:w)
+#endif
+
+ | End of interrupt
+
+ikbd_endit_stack:
+#if defined(__mcoldfire__)
+ moveql #6,d0
+ bclr d0,0xfffffa11:w
+
+ moveml sp@,d0-d1/a0
+ lea sp@(12),sp
+#else
+ moveml sp@+,d0-d1/a0
+
+ bclr #6,0xfffffa11:w
+#endif
+ rte
+
+ | Call old MIDI interrupt
+
+ikbd_oldmidi:
+#if defined(__mcoldfire__)
+ moveml sp@,d0-d1/a0
+ lea sp@(12),sp
+#else
+ moveml sp@+,d0-d1/a0
+#endif
+
+ movel old_ikbd,sp@-
+ rts
+
+ | Mouse packet, byte #2
+
+ikbd_mousex:
+#if defined(__mcoldfire__)
+ lea sp@(-12),sp
+ moveml d0-d1/a0,sp@
+#else
+ moveml d0-d1/a0,sp@-
+#endif
+
+ | Check if source is IKBD or MIDI
+#if defined(__mcoldfire__)
+ moveql #0,d0
+ btst d0,0xfffffc00.w
+#else
+ btst #0,0xfffffc00.w
+#endif
+ beqs ikbd_oldmidi
+
+ moveb 0xfffffc02:w,d0
+ extw d0
+#if defined(__mcoldfire__)
+ movew _SDL_AtariIkbd_mousex,d1
+ addl d1,d0
+ movew d0,_SDL_AtariIkbd_mousex
+
+ movel #ikbd_mousey,d0
+ movel d0,0x118:w
+#else
+ addw d0,_SDL_AtariIkbd_mousex
+
+ movel #ikbd_mousey,0x118:w
+#endif
+ bras ikbd_endit_stack
+
+ | Mouse packet, byte #3
+
+ikbd_mousey:
+#if defined(__mcoldfire__)
+ lea sp@(-12),sp
+ moveml d0-d1/a0,sp@
+#else
+ moveml d0-d1/a0,sp@-
+#endif
+
+ | Check if source is IKBD or MIDI
+#if defined(__mcoldfire__)
+ moveql #0,d0
+ btst d0,0xfffffc00.w
+#else
+ btst #0,0xfffffc00.w
+#endif
+ beqs ikbd_oldmidi
+
+ moveb 0xfffffc02:w,d0
+ extw d0
+#if defined(__mcoldfire__)
+ movew _SDL_AtariIkbd_mousey,d1
+ addl d1,d0
+ movew d0,_SDL_AtariIkbd_mousey
+
+ movel #ikbd,d0
+ movel d0,0x118:w
+#else
+ addw d0,_SDL_AtariIkbd_mousey
+
+ movel #ikbd,0x118:w
+#endif
+ bras ikbd_endit_stack
+
+ | Joystick packet, byte #2
+
+ikbd_joystick:
+#if defined(__mcoldfire__)
+ lea sp@(-12),sp
+ moveml d0-d1/a0,sp@
+#else
+ moveml d0-d1/a0,sp@-
+#endif
+
+ | Check if source is IKBD or MIDI
+#if defined(__mcoldfire__)
+ moveql #0,d0
+ btst d0,0xfffffc00.w
+#else
+ btst #0,0xfffffc00.w
+#endif
+ beqs ikbd_oldmidi
+
+#if defined(__mcoldfire__)
+ moveb 0xfffffc02:w,d0
+ moveb d0,_SDL_AtariIkbd_joystick+1
+
+ movel #ikbd,d0
+ movel d0,0x118:w
+
+ bra ikbd_endit_stack
+#else
+ moveb 0xfffffc02:w,_SDL_AtariIkbd_joystick+1
+
+ movel #ikbd,0x118:w
+
+ bras ikbd_endit_stack
+#endif
+
+ .data
+
+ .even
+_SDL_AtariIkbd_enabled:
+ .word 0
+
+ .bss
+
+ .even
+ .comm _SDL_AtariIkbd_keyboard,128
+ .comm _SDL_AtariIkbd_mousex,2
+ .comm _SDL_AtariIkbd_mousey,2
+ .comm _SDL_AtariIkbd_mouseb,2
+ .comm _SDL_AtariIkbd_joystick,2
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ikbdinterrupt_s.h b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ikbdinterrupt_s.h
new file mode 100644
index 0000000..ea544bc
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_ikbdinterrupt_s.h
@@ -0,0 +1,61 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * Mouse vector
+ *
+ * Patrice Mandin
+ */
+
+#ifndef _SDL_IKBDINTERRUPT_S_H_
+#define _SDL_IKBDINTERRUPT_S_H_
+
+#include <mint/osbind.h>
+
+#include "SDL_stdinc.h"
+
+/* Const */
+
+#define IKBD_JOY_UP (1<<0)
+#define IKBD_JOY_DOWN (1<<1)
+#define IKBD_JOY_LEFT (1<<2)
+#define IKBD_JOY_RIGHT (1<<3)
+#define IKBD_JOY_FIRE (1<<7)
+
+/* Variables */
+
+extern volatile Uint8 SDL_AtariIkbd_keyboard[128]; /* Keyboard table */
+extern volatile Uint16 SDL_AtariIkbd_mouseb; /* Mouse on port 0, buttons */
+extern volatile Sint16 SDL_AtariIkbd_mousex; /* Mouse X relative motion */
+extern volatile Sint16 SDL_AtariIkbd_mousey; /* Mouse Y relative motion */
+extern volatile Uint16 SDL_AtariIkbd_joystick; /* Joystick on port 1 */
+
+/* For joystick driver to know if this is usable */
+extern Uint16 SDL_AtariIkbd_enabled;
+
+/* Functions */
+
+extern void SDL_AtariIkbdInstall(void);
+extern void SDL_AtariIkbdUninstall(void);
+
+#endif /* _SDL_IKBDINTERRUPT_S_H_ */
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_xbiosevents.c b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_xbiosevents.c
new file mode 100644
index 0000000..232500f
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_xbiosevents.c
@@ -0,0 +1,155 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * XBIOS mouse & joystick vectors
+ *
+ * Patrice Mandin
+ */
+
+#include <mint/osbind.h>
+
+#include "../../events/SDL_events_c.h"
+#include "SDL_atarisuper.h"
+#include "SDL_xbiosevents_c.h"
+#include "SDL_xbiosinterrupt_s.h"
+
+/* Variables */
+
+int SDL_AtariXbios_enabled=0;
+
+/* Local variables */
+
+static _KBDVECS *kbdvecs; /* Pointer to access system vectors */
+static Uint16 atari_prevmouseb; /* buttons */
+
+/* Functions */
+
+void SDL_AtariXbios_InstallVectors(int vectors_mask)
+{
+ void *oldpile;
+
+ /* Clear variables */
+ SDL_AtariXbios_mouselock =
+ SDL_AtariXbios_mouseb =
+ SDL_AtariXbios_mousex =
+ SDL_AtariXbios_mousey =
+ SDL_AtariXbios_joystick =
+ atari_prevmouseb = 0;
+
+ if (vectors_mask==0) {
+ SDL_AtariXbios_enabled=0;
+ return;
+ }
+
+ /* Read IKBD vectors base */
+ kbdvecs=Kbdvbase();
+
+ /* Go to supervisor mode */
+ oldpile=(void *)Super(0);
+
+ /* Install our vectors */
+ SDL_AtariXbios_Install(
+ kbdvecs,
+ (vectors_mask & ATARI_XBIOS_MOUSEEVENTS) ? SDL_AtariXbios_MouseVector : NULL,
+ (vectors_mask & ATARI_XBIOS_JOYSTICKEVENTS) ? SDL_AtariXbios_JoystickVector : NULL
+ );
+
+ /* Back to user mode */
+ SuperToUser(oldpile);
+
+ SDL_AtariXbios_enabled=1;
+}
+
+void SDL_AtariXbios_RestoreVectors(void)
+{
+ void *oldpile;
+
+ if (SDL_AtariXbios_enabled==0) {
+ return;
+ }
+
+ /* Read IKBD vectors base */
+ kbdvecs=Kbdvbase();
+
+ /* Go to supervisor mode */
+ oldpile=(void *)Super(NULL);
+
+ /* Reinstall system vector */
+ SDL_AtariXbios_Restore(kbdvecs);
+
+ /* Back to user mode */
+ SuperToUser(oldpile);
+}
+
+static int atari_GetButton(int button)
+{
+ switch(button)
+ {
+ case 0:
+ return SDL_BUTTON_RIGHT;
+ break;
+ case 1:
+ default:
+ return SDL_BUTTON_LEFT;
+ break;
+ }
+}
+
+void SDL_AtariXbios_PostMouseEvents(_THIS, SDL_bool buttonEvents)
+{
+ if (SDL_AtariXbios_enabled==0) {
+ return;
+ }
+
+ /* Mouse motion ? */
+ if (SDL_AtariXbios_mousex || SDL_AtariXbios_mousey) {
+ SDL_PrivateMouseMotion(0, 1, SDL_AtariXbios_mousex, SDL_AtariXbios_mousey);
+ SDL_AtariXbios_mousex = SDL_AtariXbios_mousey = 0;
+ }
+
+ /* Mouse button ? */
+ if (buttonEvents && (SDL_AtariXbios_mouseb != atari_prevmouseb)) {
+ int i;
+
+ for (i=0;i<2;i++) {
+ int curbutton, prevbutton;
+
+ curbutton = SDL_AtariXbios_mouseb & (1<<i);
+ prevbutton = atari_prevmouseb & (1<<i);
+
+ if (curbutton && !prevbutton) {
+ SDL_PrivateMouseButton(SDL_PRESSED, atari_GetButton(i), 0, 0);
+ }
+ if (!curbutton && prevbutton) {
+ SDL_PrivateMouseButton(SDL_RELEASED, atari_GetButton(i), 0, 0);
+ }
+ }
+ atari_prevmouseb = SDL_AtariXbios_mouseb;
+ }
+}
+
+void SDL_AtariXbios_LockMousePosition(SDL_bool lockPosition)
+{
+ SDL_AtariXbios_mouselock = lockPosition;
+}
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_xbiosevents_c.h b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_xbiosevents_c.h
new file mode 100644
index 0000000..374b062
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_xbiosevents_c.h
@@ -0,0 +1,48 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * Xbios mouse & joystick vectors
+ *
+ * Patrice Mandin
+ */
+
+#ifndef _SDL_ATARI_XBIOSEVENTS_H_
+#define _SDL_ATARI_XBIOSEVENTS_H_
+
+#include "../SDL_sysvideo.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+#define ATARI_XBIOS_MOUSEEVENTS (1<<0)
+#define ATARI_XBIOS_JOYSTICKEVENTS (1<<1)
+
+extern int SDL_AtariXbios_enabled;
+
+extern void SDL_AtariXbios_InstallVectors(int vectors_mask);
+extern void SDL_AtariXbios_RestoreVectors(void);
+extern void SDL_AtariXbios_PostMouseEvents(_THIS, SDL_bool buttonEvents);
+extern void SDL_AtariXbios_LockMousePosition(SDL_bool lockPosition);
+
+#endif /* _SDL_XBIOSEVENTS_H_ */
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_xbiosinterrupt.S b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_xbiosinterrupt.S
new file mode 100644
index 0000000..3fc1a60
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_xbiosinterrupt.S
@@ -0,0 +1,212 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/*
+ * XBIOS mouse & joystick vectors
+ *
+ * Patrice Mandin
+ */
+
+ .text
+
+ .globl _SDL_AtariXbios_Install
+ .globl _SDL_AtariXbios_Restore
+ .globl _SDL_AtariXbios_MouseVector
+ .globl _SDL_AtariXbios_JoystickVector
+
+ .globl _SDL_AtariXbios_mouselock
+ .globl _SDL_AtariXbios_mouseb
+ .globl _SDL_AtariXbios_mousex
+ .globl _SDL_AtariXbios_mousey
+ .globl _SDL_AtariXbios_joystick
+
+/*--- Vector installer ---*/
+
+_SDL_AtariXbios_Install:
+ movel sp@(4),a0
+
+ /* Stop interrupts */
+
+ movew #0x2700,sr
+
+ /* Save old mouse vector, set our routine */
+
+ clrl oldmousevector
+ movel sp@(8),d0
+ beqs no_new_mouse_vector
+#if defined(__mcoldfire__)
+ movel a0@(16),d1
+ movel d1,oldmousevector
+#else
+ movel a0@(16),oldmousevector
+#endif
+ movel d0,a0@(16)
+no_new_mouse_vector:
+
+ /* Save old joystick vector, set our routine */
+
+ clrl oldjoystickvector
+ movel sp@(12),d0
+ beqs no_new_joystick_vector
+#if defined(__mcoldfire__)
+ movel a0@(24),d1
+ movel d1,oldjoystickvector
+#else
+ movel a0@(24),oldjoystickvector
+#endif
+ movel d0,a0@(24)
+no_new_joystick_vector:
+
+ /* Restart interrupts */
+
+ movew #0x2300,sr
+
+ rts
+
+/*--- Vector restorer ---*/
+
+_SDL_AtariXbios_Restore:
+ movel sp@(4),a0
+
+ /* Stop interrupts */
+
+ movew #0x2700,sr
+
+ /* Restore mouse vector */
+
+ movel oldmousevector,d0
+ beqs no_restore_mouse
+ movel d0,a0@(16)
+no_restore_mouse:
+
+ /* Restore joystick vector */
+
+ movel oldjoystickvector,d0
+ beqs no_restore_joystick
+ movel d0,a0@(24)
+no_restore_joystick:
+
+ /* Restart interrupts */
+
+ movew #0x2300,sr
+
+ rts
+
+/*--- Our mouse vector ---*/
+
+ .text
+ .even
+ .ascii "XBRA"
+ .ascii "LSDL"
+ .comm oldmousevector,4*1
+_SDL_AtariXbios_MouseVector:
+#if defined(__mcoldfire__)
+ lea sp@(-8),sp
+ moveml d0-d1,sp@
+#else
+ movel d0,sp@-
+#endif
+
+ /* Mouse buttons */
+ moveb (a0),d0
+#if defined(__mcoldfire__)
+ andl #3,d0
+#else
+ andw #3,d0
+#endif
+ movew d0,_SDL_AtariXbios_mouseb
+
+ /* X movement */
+ moveb a0@(1),d0
+ extw d0
+#if defined(__mcoldfire__)
+ movew _SDL_AtariXbios_mousex,d1
+ addl d1,d0
+ movew d0,_SDL_AtariXbios_mousex
+#else
+ addw d0,_SDL_AtariXbios_mousex
+#endif
+
+ /* Y movement */
+ moveb a0@(2),d0
+ extw d0
+#if defined(__mcoldfire__)
+ movew _SDL_AtariXbios_mousey,d1
+ addl d1,d0
+ movew d0,_SDL_AtariXbios_mousey
+#else
+ addw d0,_SDL_AtariXbios_mousey
+#endif
+
+ /* Lock mouse position ? */
+ tstw _SDL_AtariXbios_mouselock
+ beq.s no_mouse_lock
+ clrb a0@(1)
+ clrb a0@(2)
+no_mouse_lock:
+
+ /* Jump through old vector */
+#if defined(__mcoldfire__)
+ moveml sp@,d0-d1
+ lea sp@(8),sp
+#else
+ movel sp@+,d0
+#endif
+
+ movel oldmousevector,sp@-
+ rts
+
+ .data
+ .even
+ .comm _SDL_AtariXbios_mouselock,2*1
+ .comm _SDL_AtariXbios_mousex,2*1
+ .comm _SDL_AtariXbios_mousey,2*1
+ .comm _SDL_AtariXbios_mouseb,2*1
+
+/*--- Our joystick vector ---*/
+
+ .text
+ .even
+ .ascii "XBRA"
+ .ascii "LSDL"
+ .comm oldjoystickvector,4*1
+_SDL_AtariXbios_JoystickVector:
+ movel d0,sp@-
+
+ /* New joystick state */
+ moveb a0@(2),d0
+#if defined(__mcoldfire__)
+ andl #0x8f,d0
+#else
+ andw #0x8f,d0
+#endif
+ movew d0,_SDL_AtariXbios_joystick
+
+ /* Jump through old vector */
+ movel sp@+,d0
+
+ movel oldjoystickvector,sp@-
+ rts
+
+ .data
+ .even
+ .comm _SDL_AtariXbios_joystick,2*1
diff --git a/distrib/sdl-1.2.15/src/video/ataricommon/SDL_xbiosinterrupt_s.h b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_xbiosinterrupt_s.h
new file mode 100644
index 0000000..dfb31c2
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ataricommon/SDL_xbiosinterrupt_s.h
@@ -0,0 +1,52 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * Mouse vector
+ *
+ * Patrice Mandin
+ */
+
+#ifndef _SDL_XBIOSINTERRUPT_S_H_
+#define _SDL_XBIOSINTERRUPT_S_H_
+
+#include <mint/osbind.h>
+
+#include "SDL_stdinc.h"
+
+/* Variables */
+
+extern volatile Uint16 SDL_AtariXbios_mouselock; /* mouse lock position */
+extern volatile Uint16 SDL_AtariXbios_mouseb; /* buttons */
+extern volatile Sint16 SDL_AtariXbios_mousex; /* X relative motion */
+extern volatile Sint16 SDL_AtariXbios_mousey; /* Y relative motion */
+extern volatile Uint16 SDL_AtariXbios_joystick; /* Joystick */
+
+/* Functions */
+
+extern void SDL_AtariXbios_Install(_KBDVECS *kbdvecs,void *newmousevector,void *newjoystickvector);
+extern void SDL_AtariXbios_Restore(_KBDVECS *kbdvecs);
+extern void SDL_AtariXbios_MouseVector(void *buf);
+extern void SDL_AtariXbios_JoystickVector(void *buf);
+
+#endif /* _SDL_XBIOSINTERRUPT_S_H_ */
diff --git a/distrib/sdl-1.2.15/src/video/blank_cursor.h b/distrib/sdl-1.2.15/src/video/blank_cursor.h
new file mode 100644
index 0000000..db69601
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/blank_cursor.h
@@ -0,0 +1,33 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * A default blank 8x8 cursor */
+
+#define BLANK_CWIDTH 8
+#define BLANK_CHEIGHT 8
+#define BLANK_CHOTX 0
+#define BLANK_CHOTY 0
+
+static unsigned char blank_cdata[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+static unsigned char blank_cmask[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+
diff --git a/distrib/sdl-1.2.15/src/video/bwindow/SDL_BView.h b/distrib/sdl-1.2.15/src/video/bwindow/SDL_BView.h
new file mode 100644
index 0000000..bfa2c89
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/bwindow/SDL_BView.h
@@ -0,0 +1,116 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_BView_h
+#define _SDL_BView_h
+
+/* This is the event handling and graphics update portion of SDL_BWin */
+
+extern "C" {
+#include "../../events/SDL_events_c.h"
+};
+
+class SDL_BView : public BView
+{
+public:
+ SDL_BView(BRect frame) :
+ BView(frame, "SDL View", B_FOLLOW_ALL_SIDES,
+ (B_WILL_DRAW|B_FRAME_EVENTS)) {
+ image = NULL;
+ xoff = yoff = 0;
+ SetViewColor(0,0,0,0);
+ SetHighColor(0,0,0,0);
+ }
+ virtual ~SDL_BView() {
+ SetBitmap(NULL);
+ }
+ /* Set drawing offsets for fullscreen mode */
+ virtual void SetXYOffset(int x, int y) {
+ xoff = x;
+ yoff = y;
+ }
+ virtual void GetXYOffset(int &x, int &y) {
+ x = xoff;
+ y = yoff;
+ }
+ virtual void GetXYOffset(float &x, float &y) {
+ x = (float)xoff;
+ y = (float)yoff;
+ }
+ /* The view changed size. If it means we're in fullscreen, we
+ * draw a nice black box in the entire view to get black borders.
+ */
+ virtual void FrameResized(float width, float height) {
+ BRect bounds;
+ bounds.top = bounds.left = 0;
+ bounds.right = width;
+ bounds.bottom = height;
+ /* Fill the entire view with black */
+ FillRect(bounds, B_SOLID_HIGH);
+ /* And if there's an image, redraw it. */
+ if( image ) {
+ bounds = image->Bounds();
+ Draw(bounds);
+ }
+ }
+
+ /* Drawing portion of this complete breakfast. :) */
+ virtual void SetBitmap(BBitmap *bitmap) {
+ if ( image ) {
+ delete image;
+ }
+ image = bitmap;
+ }
+ virtual void Draw(BRect updateRect) {
+ if ( image ) {
+ if(xoff || yoff) {
+ BRect dest;
+ dest.top = updateRect.top + yoff;
+ dest.left = updateRect.left + xoff;
+ dest.bottom = updateRect.bottom + yoff;
+ dest.right = updateRect.right + xoff;
+ DrawBitmap(image, updateRect, dest);
+ } else {
+ DrawBitmap(image, updateRect, updateRect);
+ }
+ }
+ }
+ virtual void DrawAsync(BRect updateRect) {
+ if(xoff || yoff) {
+ BRect dest;
+ dest.top = updateRect.top + yoff;
+ dest.left = updateRect.left + xoff;
+ dest.bottom = updateRect.bottom + yoff;
+ dest.right = updateRect.right + xoff;;
+ DrawBitmapAsync(image, updateRect, dest);
+ } else {
+ DrawBitmapAsync(image, updateRect, updateRect);
+ }
+ }
+
+private:
+ BBitmap *image;
+ int xoff, yoff;
+};
+
+#endif /* _SDL_BView_h */
diff --git a/distrib/sdl-1.2.15/src/video/bwindow/SDL_BWin.h b/distrib/sdl-1.2.15/src/video/bwindow/SDL_BWin.h
new file mode 100644
index 0000000..f2b19a2
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/bwindow/SDL_BWin.h
@@ -0,0 +1,290 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#ifndef _SDL_BWin_h
+#define _SDL_BWin_h
+
+#include "SDL_config.h"
+
+#include <stdio.h>
+#include <AppKit.h>
+#include <InterfaceKit.h>
+#include <be/game/DirectWindow.h>
+#if SDL_VIDEO_OPENGL
+#include "SDL_opengl.h"
+#include <be/opengl/GLView.h>
+#endif
+#include <support/UTF8.h>
+
+#include "../../main/beos/SDL_BeApp.h"
+#include "SDL_events.h"
+#include "SDL_BView.h"
+
+extern "C" {
+#include "../../events/SDL_events_c.h"
+
+extern int mouse_relative;
+};
+
+class SDL_BWin : public BDirectWindow
+{
+public:
+ SDL_BWin(BRect bounds) :
+ BDirectWindow(bounds, "Untitled", B_TITLED_WINDOW, 0) {
+ last_buttons = 0;
+ the_view = NULL;
+#if SDL_VIDEO_OPENGL
+ SDL_GLView = NULL;
+#endif
+ SDL_View = NULL;
+ Unlock();
+ shown = false;
+ inhibit_resize = false;
+ }
+
+ virtual ~SDL_BWin() {
+ Lock();
+ if ( the_view ) {
+#if SDL_VIDEO_OPENGL
+ if ( the_view == SDL_GLView ) {
+ SDL_GLView->UnlockGL();
+ }
+#endif
+ RemoveChild(the_view);
+ the_view = NULL;
+ }
+ Unlock();
+#if SDL_VIDEO_OPENGL
+ if ( SDL_GLView ) {
+ delete SDL_GLView;
+ }
+#endif
+ if ( SDL_View ) {
+ delete SDL_View;
+ }
+ }
+
+
+ /* Override the Show() method so we can tell when we've been shown */
+ virtual void Show(void) {
+ BWindow::Show();
+ shown = true;
+ }
+ virtual bool Shown(void) {
+ return (shown);
+ }
+ /* If called, the next resize event will not be forwarded to SDL. */
+ virtual void InhibitResize(void) {
+ inhibit_resize=true;
+ }
+ /* Handle resizing of the window */
+ virtual void FrameResized(float width, float height) {
+ if(inhibit_resize)
+ inhibit_resize = false;
+ else
+ SDL_PrivateResize((int)width, (int)height);
+ }
+ virtual int CreateView(Uint32 flags, Uint32 gl_flags) {
+ int retval;
+
+ retval = 0;
+ Lock();
+ if ( flags & SDL_OPENGL ) {
+#if SDL_VIDEO_OPENGL
+ if ( SDL_GLView == NULL ) {
+ SDL_GLView = new BGLView(Bounds(), "SDL GLView",
+ B_FOLLOW_ALL_SIDES, (B_WILL_DRAW|B_FRAME_EVENTS),
+ gl_flags|BGL_DOUBLE);
+ SDL_GLView->EnableDirectMode(true);
+ }
+ if ( the_view != SDL_GLView ) {
+ if ( the_view ) {
+ RemoveChild(the_view);
+ }
+ AddChild(SDL_GLView);
+ SDL_GLView->LockGL();
+ the_view = SDL_GLView;
+ }
+#else
+ SDL_SetError("OpenGL support not enabled");
+ retval = -1;
+#endif
+ } else {
+ if ( SDL_View == NULL ) {
+ SDL_View = new SDL_BView(Bounds());
+ }
+ if ( the_view != SDL_View ) {
+ if ( the_view ) {
+ RemoveChild(the_view);
+ }
+ AddChild(SDL_View);
+ the_view = SDL_View;
+ }
+ }
+#if SDL_VIDEO_OPENGL
+ if ( the_view == SDL_GLView ) {
+ SDL_GLView->UnlockGL();
+ }
+#endif
+ Unlock();
+ return(retval);
+ }
+ virtual void SetBitmap(BBitmap *bitmap) {
+ SDL_View->SetBitmap(bitmap);
+ }
+ virtual void SetXYOffset(int x, int y) {
+#if SDL_VIDEO_OPENGL
+ if ( the_view == SDL_GLView ) {
+ return;
+ }
+#endif
+ SDL_View->SetXYOffset(x, y);
+ }
+ virtual void GetXYOffset(int &x, int &y) {
+#if SDL_VIDEO_OPENGL
+ if ( the_view == SDL_GLView ) {
+ x = 0;
+ y = 0;
+ return;
+ }
+#endif
+ SDL_View->GetXYOffset(x, y);
+ }
+ virtual void GetXYOffset(float &x, float &y) {
+#if SDL_VIDEO_OPENGL
+ if ( the_view == SDL_GLView ) {
+ x = 0.0f;
+ y = 0.0f;
+ return;
+ }
+#endif
+ SDL_View->GetXYOffset(x, y);
+ }
+ virtual bool BeginDraw(void) {
+ return(Lock());
+ }
+ virtual void DrawAsync(BRect updateRect) {
+ SDL_View->DrawAsync(updateRect);
+ }
+ virtual void EndDraw(void) {
+ SDL_View->Sync();
+ Unlock();
+ }
+#if SDL_VIDEO_OPENGL
+ virtual void SwapBuffers(void) {
+ SDL_GLView->UnlockGL();
+ SDL_GLView->SwapBuffers();
+ SDL_GLView->LockGL();
+ }
+#endif
+ virtual BView *View(void) {
+ return(the_view);
+ }
+
+ /* Hook functions -- overridden */
+ virtual void Minimize(bool minimize) {
+ /* This is only called when mimimized, not when restored */
+ //SDL_PrivateAppActive(minimize, SDL_APPACTIVE);
+ BWindow::Minimize(minimize);
+ }
+ virtual void WindowActivated(bool active) {
+ SDL_PrivateAppActive(active, SDL_APPINPUTFOCUS);
+ }
+ virtual bool QuitRequested(void) {
+ if ( SDL_BeAppActive > 0 ) {
+ SDL_PrivateQuit();
+ /* We don't ever actually close the window here because
+ the application should respond to the quit request,
+ or ignore it as desired.
+ */
+#if SDL_VIDEO_OPENGL
+ if ( SDL_GLView != NULL ) {
+ SDL_GLView->EnableDirectMode(false);
+ }
+#endif
+ return(false);
+ }
+ return(true); /* Close the app window */
+ }
+ virtual void Quit() {
+ if (!IsLocked())
+ Lock();
+ BDirectWindow::Quit();
+ }
+
+ virtual int16 Translate2Unicode(const char *buf) {
+ int32 state, srclen, dstlen;
+ unsigned char destbuf[2];
+ Uint16 unicode = 0;
+
+ if ((uchar)buf[0] > 127) {
+ state = 0;
+ srclen = SDL_strlen(buf);
+ dstlen = sizeof(destbuf);
+ convert_from_utf8(B_UNICODE_CONVERSION, buf, &srclen, (char *)destbuf, &dstlen, &state);
+ unicode = destbuf[0];
+ unicode <<= 8;
+ unicode |= destbuf[1];
+ } else
+ unicode = buf[0];
+
+ /* For some reason function keys map to control characters */
+# define CTRL(X) ((X)-'@')
+ switch (unicode) {
+ case CTRL('A'):
+ case CTRL('B'):
+ case CTRL('C'):
+ case CTRL('D'):
+ case CTRL('E'):
+ case CTRL('K'):
+ case CTRL('L'):
+ case CTRL('P'):
+ if ( ! (SDL_GetModState() & KMOD_CTRL) )
+ unicode = 0;
+ break;
+ /* Keyboard input maps newline to carriage return */
+ case '\n':
+ unicode = '\r';
+ break;
+ default:
+ break;
+ }
+
+ return unicode;
+ }
+
+ virtual void DispatchMessage(BMessage *msg, BHandler *target);
+
+ virtual void DirectConnected(direct_buffer_info *info);
+
+private:
+#if SDL_VIDEO_OPENGL
+ BGLView *SDL_GLView;
+#endif
+ SDL_BView *SDL_View;
+ BView *the_view;
+ bool shown;
+ bool inhibit_resize;
+ int32 last_buttons;
+};
+
+#endif /* _SDL_BWin_h */
diff --git a/distrib/sdl-1.2.15/src/video/bwindow/SDL_lowvideo.h b/distrib/sdl-1.2.15/src/video/bwindow/SDL_lowvideo.h
new file mode 100644
index 0000000..0513b2d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/bwindow/SDL_lowvideo.h
@@ -0,0 +1,58 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_lowvideo_h
+#define _SDL_lowvideo_h
+
+#include "SDL_BWin.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *_this
+
+/* Private display data */
+struct SDL_PrivateVideoData {
+ /* The main window */
+ SDL_BWin *SDL_Win;
+
+ /* The fullscreen mode list */
+ display_mode saved_mode;
+#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
+ int SDL_nummodes[NUM_MODELISTS];
+ SDL_Rect **SDL_modelist[NUM_MODELISTS];
+
+ /* A completely clear cursor */
+ WMcursor *BlankCursor;
+
+ SDL_Overlay *overlay;
+};
+/* Old variable names */
+#define SDL_Win (_this->hidden->SDL_Win)
+#define saved_mode (_this->hidden->saved_mode)
+#define SDL_nummodes (_this->hidden->SDL_nummodes)
+#define SDL_modelist (_this->hidden->SDL_modelist)
+#define SDL_BlankCursor (_this->hidden->BlankCursor)
+#define current_overlay (_this->hidden->overlay)
+
+#endif /* _SDL_lowvideo_h */
diff --git a/distrib/sdl-1.2.15/src/video/bwindow/SDL_sysevents.cc b/distrib/sdl-1.2.15/src/video/bwindow/SDL_sysevents.cc
new file mode 100644
index 0000000..9e12750
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/bwindow/SDL_sysevents.cc
@@ -0,0 +1,415 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <support/UTF8.h>
+#include <stdio.h>
+#include <string.h>
+#include "SDL_error.h"
+#include "SDL_events.h"
+#include "SDL_BWin.h"
+#include "SDL_lowvideo.h"
+
+static SDLKey keymap[128];
+int mouse_relative = 0;
+extern "C" {
+
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_sysevents_c.h"
+#include "../SDL_cursor_c.h"
+
+void BE_PumpEvents(_THIS)
+{
+}
+
+void BE_InitOSKeymap(_THIS)
+{
+ for ( uint i=0; i<SDL_TABLESIZE(keymap); ++i )
+ keymap[i] = SDLK_UNKNOWN;
+
+ keymap[0x01] = SDLK_ESCAPE;
+ keymap[B_F1_KEY] = SDLK_F1;
+ keymap[B_F2_KEY] = SDLK_F2;
+ keymap[B_F3_KEY] = SDLK_F3;
+ keymap[B_F4_KEY] = SDLK_F4;
+ keymap[B_F5_KEY] = SDLK_F5;
+ keymap[B_F6_KEY] = SDLK_F6;
+ keymap[B_F7_KEY] = SDLK_F7;
+ keymap[B_F8_KEY] = SDLK_F8;
+ keymap[B_F9_KEY] = SDLK_F9;
+ keymap[B_F10_KEY] = SDLK_F10;
+ keymap[B_F11_KEY] = SDLK_F11;
+ keymap[B_F12_KEY] = SDLK_F12;
+ keymap[B_PRINT_KEY] = SDLK_PRINT;
+ keymap[B_SCROLL_KEY] = SDLK_SCROLLOCK;
+ keymap[B_PAUSE_KEY] = SDLK_PAUSE;
+ keymap[0x11] = SDLK_BACKQUOTE;
+ keymap[0x12] = SDLK_1;
+ keymap[0x13] = SDLK_2;
+ keymap[0x14] = SDLK_3;
+ keymap[0x15] = SDLK_4;
+ keymap[0x16] = SDLK_5;
+ keymap[0x17] = SDLK_6;
+ keymap[0x18] = SDLK_7;
+ keymap[0x19] = SDLK_8;
+ keymap[0x1a] = SDLK_9;
+ keymap[0x1b] = SDLK_0;
+ keymap[0x1c] = SDLK_MINUS;
+ keymap[0x1d] = SDLK_EQUALS;
+ keymap[0x1e] = SDLK_BACKSPACE;
+ keymap[0x1f] = SDLK_INSERT;
+ keymap[0x20] = SDLK_HOME;
+ keymap[0x21] = SDLK_PAGEUP;
+ keymap[0x22] = SDLK_NUMLOCK;
+ keymap[0x23] = SDLK_KP_DIVIDE;
+ keymap[0x24] = SDLK_KP_MULTIPLY;
+ keymap[0x25] = SDLK_KP_MINUS;
+ keymap[0x26] = SDLK_TAB;
+ keymap[0x27] = SDLK_q;
+ keymap[0x28] = SDLK_w;
+ keymap[0x29] = SDLK_e;
+ keymap[0x2a] = SDLK_r;
+ keymap[0x2b] = SDLK_t;
+ keymap[0x2c] = SDLK_y;
+ keymap[0x2d] = SDLK_u;
+ keymap[0x2e] = SDLK_i;
+ keymap[0x2f] = SDLK_o;
+ keymap[0x30] = SDLK_p;
+ keymap[0x31] = SDLK_LEFTBRACKET;
+ keymap[0x32] = SDLK_RIGHTBRACKET;
+ keymap[0x33] = SDLK_BACKSLASH;
+ keymap[0x34] = SDLK_DELETE;
+ keymap[0x35] = SDLK_END;
+ keymap[0x36] = SDLK_PAGEDOWN;
+ keymap[0x37] = SDLK_KP7;
+ keymap[0x38] = SDLK_KP8;
+ keymap[0x39] = SDLK_KP9;
+ keymap[0x3a] = SDLK_KP_PLUS;
+ keymap[0x3b] = SDLK_CAPSLOCK;
+ keymap[0x3c] = SDLK_a;
+ keymap[0x3d] = SDLK_s;
+ keymap[0x3e] = SDLK_d;
+ keymap[0x3f] = SDLK_f;
+ keymap[0x40] = SDLK_g;
+ keymap[0x41] = SDLK_h;
+ keymap[0x42] = SDLK_j;
+ keymap[0x43] = SDLK_k;
+ keymap[0x44] = SDLK_l;
+ keymap[0x45] = SDLK_SEMICOLON;
+ keymap[0x46] = SDLK_QUOTE;
+ keymap[0x47] = SDLK_RETURN;
+ keymap[0x48] = SDLK_KP4;
+ keymap[0x49] = SDLK_KP5;
+ keymap[0x4a] = SDLK_KP6;
+ keymap[0x4b] = SDLK_LSHIFT;
+ keymap[0x4c] = SDLK_z;
+ keymap[0x4d] = SDLK_x;
+ keymap[0x4e] = SDLK_c;
+ keymap[0x4f] = SDLK_v;
+ keymap[0x50] = SDLK_b;
+ keymap[0x51] = SDLK_n;
+ keymap[0x52] = SDLK_m;
+ keymap[0x53] = SDLK_COMMA;
+ keymap[0x54] = SDLK_PERIOD;
+ keymap[0x55] = SDLK_SLASH;
+ keymap[0x56] = SDLK_RSHIFT;
+ keymap[0x57] = SDLK_UP;
+ keymap[0x58] = SDLK_KP1;
+ keymap[0x59] = SDLK_KP2;
+ keymap[0x5a] = SDLK_KP3;
+ keymap[0x5b] = SDLK_KP_ENTER;
+ keymap[0x5c] = SDLK_LCTRL;
+ keymap[0x5d] = SDLK_LALT;
+ keymap[0x5e] = SDLK_SPACE;
+ keymap[0x5f] = SDLK_RALT;
+ keymap[0x60] = SDLK_RCTRL;
+ keymap[0x61] = SDLK_LEFT;
+ keymap[0x62] = SDLK_DOWN;
+ keymap[0x63] = SDLK_RIGHT;
+ keymap[0x64] = SDLK_KP0;
+ keymap[0x65] = SDLK_KP_PERIOD;
+ keymap[0x66] = SDLK_LMETA;
+ keymap[0x67] = SDLK_RMETA;
+ keymap[0x68] = SDLK_MENU;
+ keymap[0x69] = SDLK_EURO;
+ keymap[0x6a] = SDLK_KP_EQUALS;
+ keymap[0x6b] = SDLK_POWER;
+}
+
+}; /* Extern C */
+
+void SDL_BWin::DispatchMessage(BMessage *msg, BHandler *target)
+{
+ switch (msg->what) {
+ case B_MOUSE_MOVED:
+ {
+ SDL_VideoDevice *view = current_video;
+ BPoint where;
+ int32 transit;
+ if (msg->FindPoint("where", &where) == B_OK && msg->FindInt32("be:transit", &transit) == B_OK) {
+ int x, y;
+
+ GetXYOffset(x, y);
+ x = (int)where.x - x;
+ y = (int)where.y - y;
+
+ //BeSman: I need another method for cursor catching !!!
+ if (view->input_grab != SDL_GRAB_OFF)
+ {
+ bool clipped = false;
+ if ( x < 0 ) {
+ x = 0;
+ clipped = true;
+ } else if ( x >= SDL_VideoSurface->w ) {
+ x = (SDL_VideoSurface->w-1);
+ clipped = true;
+ }
+ if ( y < 0 ) {
+ y = 0;
+ clipped = true;
+ } else if ( y >= SDL_VideoSurface->h ) {
+ y = (SDL_VideoSurface->h-1);
+ clipped = true;
+ }
+ if ( clipped ) {
+ BPoint edge;
+ GetXYOffset(edge.x, edge.y);
+ edge.x += x;
+ edge.y += y;
+ ConvertToScreen(&edge);
+ set_mouse_position((int)edge.x, (int)edge.y);
+ }
+ transit = B_INSIDE_VIEW;
+ }
+ if (transit == B_EXITED_VIEW) {
+ if ( SDL_GetAppState() & SDL_APPMOUSEFOCUS ) {
+ SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
+#if SDL_VIDEO_OPENGL
+ // for some reason, SDL_EraseCursor fails for OpenGL
+ if (this->the_view != this->SDL_GLView)
+#endif
+ SDL_EraseCursor(SDL_VideoSurface);
+ be_app->SetCursor(B_HAND_CURSOR);
+ }
+ } else {
+ if ( !(SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
+ SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
+#if SDL_VIDEO_OPENGL
+ // for some reason, SDL_EraseCursor fails for OpenGL
+ if (this->the_view != this->SDL_GLView)
+#endif
+ SDL_EraseCursor(SDL_VideoSurface);
+ SDL_SetCursor(NULL);
+ }
+
+ if ( mouse_relative ) {
+ int half_w = (SDL_VideoSurface->w/2);
+ int half_h = (SDL_VideoSurface->h/2);
+ x -= half_w;
+ y -= half_h;
+ if ( x || y ) {
+ BPoint center;
+ GetXYOffset(center.x, center.y);
+ center.x += half_w;
+ center.y += half_h;
+ ConvertToScreen(&center);
+ set_mouse_position((int)center.x, (int)center.y);
+ SDL_PrivateMouseMotion(0, 1, x, y);
+ }
+ } else {
+ SDL_PrivateMouseMotion(0, 0, x, y);
+ }
+ }
+ }
+ break;
+ }
+
+ case B_MOUSE_DOWN:
+ {
+ /* it looks like mouse down is send only for first clicked
+ button, each next is not send while last one is holded */
+ int32 buttons;
+ int sdl_buttons = 0;
+ if (msg->FindInt32("buttons", &buttons) == B_OK) {
+ /* Add any mouse button events */
+ if (buttons & B_PRIMARY_MOUSE_BUTTON) {
+ sdl_buttons |= SDL_BUTTON_LEFT;
+ }
+ if (buttons & B_SECONDARY_MOUSE_BUTTON) {
+ sdl_buttons |= SDL_BUTTON_RIGHT;
+ }
+ if (buttons & B_TERTIARY_MOUSE_BUTTON) {
+ sdl_buttons |= SDL_BUTTON_MIDDLE;
+ }
+ SDL_PrivateMouseButton(SDL_PRESSED, sdl_buttons, 0, 0);
+
+ last_buttons = buttons;
+ }
+ break;
+ }
+
+ case B_MOUSE_UP:
+ {
+ /* mouse up doesn't give which button was released,
+ only state of buttons (after release, so it's always = 0),
+ which is not what we need ;]
+ So we need to store button in mouse down, and restore
+ in mouse up :(
+ mouse up is (similarly to mouse down) send only for
+ first button down (ie. it's no send if we click another button
+ without releasing previous one first) - but that's probably
+ because of how drivers are written?, not BeOS itself. */
+ int32 buttons;
+ int sdl_buttons = 0;
+ if (msg->FindInt32("buttons", &buttons) == B_OK) {
+ /* Add any mouse button events */
+ if ((buttons ^ B_PRIMARY_MOUSE_BUTTON) & last_buttons) {
+ sdl_buttons |= SDL_BUTTON_LEFT;
+ }
+ if ((buttons ^ B_SECONDARY_MOUSE_BUTTON) & last_buttons) {
+ sdl_buttons |= SDL_BUTTON_RIGHT;
+ }
+ if ((buttons ^ B_TERTIARY_MOUSE_BUTTON) & last_buttons) {
+ sdl_buttons |= SDL_BUTTON_MIDDLE;
+ }
+ SDL_PrivateMouseButton(SDL_RELEASED, sdl_buttons, 0, 0);
+
+ last_buttons = buttons;
+ }
+ break;
+ }
+
+ case B_MOUSE_WHEEL_CHANGED:
+ {
+ float x, y;
+ x = y = 0;
+ if (msg->FindFloat("be:wheel_delta_x", &x) == B_OK && msg->FindFloat("be:wheel_delta_y", &y) == B_OK) {
+ if (x < 0 || y < 0) {
+ SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELDOWN, 0, 0);
+ SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELDOWN, 0, 0);
+ } else if (x > 0 || y > 0) {
+ SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELUP, 0, 0);
+ SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELUP, 0, 0);
+ }
+ }
+ break;
+ }
+
+ case B_KEY_DOWN:
+ case B_UNMAPPED_KEY_DOWN: /* modifier keys are unmapped */
+ {
+ int32 key;
+ int32 modifiers;
+ int32 key_repeat;
+ /* Workaround for SDL message queue being filled too fast because of BeOS own key-repeat mechanism */
+ if (msg->FindInt32("be:key_repeat", &key_repeat) == B_OK && key_repeat > 0)
+ break;
+
+ if (msg->FindInt32("key", &key) == B_OK && msg->FindInt32("modifiers", &modifiers) == B_OK) {
+ SDL_keysym keysym;
+ keysym.scancode = key;
+ if (key < 128) {
+ keysym.sym = keymap[key];
+ } else {
+ keysym.sym = SDLK_UNKNOWN;
+ }
+ /* FIX THIS?
+ it seems SDL_PrivateKeyboard() changes mod value
+ anyway, and doesn't care about what we setup here */
+ keysym.mod = KMOD_NONE;
+ keysym.unicode = 0;
+ if (SDL_TranslateUNICODE) {
+ const char *bytes;
+ if (msg->FindString("bytes", &bytes) == B_OK) {
+ /* FIX THIS?
+ this cares only about first "letter",
+ so if someone maps some key to print
+ "BeOS rulez!" only "B" will be used. */
+ keysym.unicode = Translate2Unicode(bytes);
+ }
+ }
+ SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
+ }
+ break;
+ }
+
+ case B_KEY_UP:
+ case B_UNMAPPED_KEY_UP: /* modifier keys are unmapped */
+ {
+ int32 key;
+ int32 modifiers;
+ if (msg->FindInt32("key", &key) == B_OK && msg->FindInt32("modifiers", &modifiers) == B_OK) {
+ SDL_keysym keysym;
+ keysym.scancode = key;
+ if (key < 128) {
+ keysym.sym = keymap[key];
+ } else {
+ keysym.sym = SDLK_UNKNOWN;
+ }
+ keysym.mod = KMOD_NONE; /* FIX THIS? */
+ keysym.unicode = 0;
+ if (SDL_TranslateUNICODE) {
+ const char *bytes;
+ if (msg->FindString("bytes", &bytes) == B_OK) {
+ keysym.unicode = Translate2Unicode(bytes);
+ }
+ }
+ SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
+ }
+ break;
+ }
+
+ default:
+ /* move it after switch{} so it's always handled
+ that way we keep BeOS feautures like:
+ - CTRL+Q to close window (and other shortcuts)
+ - PrintScreen to make screenshot into /boot/home
+ - etc.. */
+ //BDirectWindow::DispatchMessage(msg, target);
+ break;
+ }
+ BDirectWindow::DispatchMessage(msg, target);
+}
+
+void SDL_BWin::DirectConnected(direct_buffer_info *info) {
+ switch (info->buffer_state & B_DIRECT_MODE_MASK) {
+ case B_DIRECT_START:
+ case B_DIRECT_MODIFY:
+ {
+ int32 width = info->window_bounds.right -
+ info->window_bounds.left;
+ int32 height = info->window_bounds.bottom -
+ info->window_bounds.top;
+ SDL_PrivateResize(width, height);
+ break;
+ }
+ default:
+ break;
+ }
+#if SDL_VIDEO_OPENGL
+ // If it is a BGLView, it is apparently required to
+ // call DirectConnected() on it as well
+ if (this->the_view == this->SDL_GLView)
+ this->SDL_GLView->DirectConnected(info);
+#endif
+}
diff --git a/distrib/sdl-1.2.15/src/video/bwindow/SDL_sysevents_c.h b/distrib/sdl-1.2.15/src/video/bwindow/SDL_sysevents_c.h
new file mode 100644
index 0000000..70c5535
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/bwindow/SDL_sysevents_c.h
@@ -0,0 +1,31 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_lowvideo.h"
+
+/* Variables and functions exported by SDL_sysevents.c to other parts
+ of the native video subsystem (SDL_sysvideo.c)
+*/
+
+extern void BE_InitOSKeymap(_THIS);
+extern void BE_PumpEvents(_THIS);
diff --git a/distrib/sdl-1.2.15/src/video/bwindow/SDL_sysmouse.cc b/distrib/sdl-1.2.15/src/video/bwindow/SDL_sysmouse.cc
new file mode 100644
index 0000000..9a557d6
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/bwindow/SDL_sysmouse.cc
@@ -0,0 +1,153 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <AppKit.h>
+#include <GameKit.h>
+
+#include "SDL_BWin.h"
+
+extern "C" {
+#include "../SDL_cursor_c.h"
+#include "SDL_sysmouse_c.h"
+
+/* Convert bits to padded bytes */
+#define PADDED_BITS(bits) ((bits+7)/8)
+
+/* The implementation dependent data for the window manager cursor */
+struct WMcursor {
+ char *bits;
+};
+
+/* Can this be done in the BeOS? */
+WMcursor *BE_CreateWMCursor(_THIS,
+ Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
+{
+ WMcursor *cursor;
+ int allowed_x;
+ int allowed_y;
+ int run, pad, i;
+ char *cptr;
+
+ allowed_x = 16; /* BeOS limitation */
+ allowed_y = 16; /* BeOS limitation */
+ if ( (w > allowed_x) || (h > allowed_y) ) {
+ SDL_SetError("Only cursors of dimension (%dx%d) are allowed",
+ allowed_x, allowed_y);
+ return(NULL);
+ }
+
+ /* Allocate the cursor */
+ cursor = (WMcursor *)SDL_malloc(sizeof(WMcursor));
+ if ( cursor == NULL ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ cursor->bits = (char *)SDL_malloc(4+2*((allowed_x/8)*allowed_y));
+ if ( cursor->bits == NULL ) {
+ SDL_free(cursor);
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ cursor->bits[0] = allowed_y; /* Size of the cursor */
+ cursor->bits[1] = 1; /* Bit depth of cursor */
+ cursor->bits[2] = hot_y;
+ cursor->bits[3] = hot_x;
+ cptr = &cursor->bits[4];
+
+ /* Pad out to the normal cursor size */
+ run = PADDED_BITS(w);
+ pad = PADDED_BITS(allowed_x)-run;
+ for ( i=0; i<h; ++i ) {
+ SDL_memcpy(cptr, data, run);
+ SDL_memset(cptr+run, 0, pad);
+ data += run;
+ cptr += (run+pad);
+ }
+ for ( ; i<allowed_y; ++i ) {
+ SDL_memset(cptr, 0, run+pad);
+ cptr += (run+pad);
+ }
+ for ( i=0; i<h; ++i ) {
+ /* FIXME: The mask should be OR'd with the data to turn
+ inverted color pixels black, since inverted color pixels
+ aren't supported under BeOS.
+ */
+ SDL_memcpy(cptr, mask, run);
+ SDL_memset(cptr+run, 0, pad);
+ mask += run;
+ cptr += (run+pad);
+ }
+ for ( ; i<allowed_y; ++i ) {
+ SDL_memset(cptr, 0, run+pad);
+ cptr += (run+pad);
+ }
+ return(cursor);
+}
+
+int BE_ShowWMCursor(_THIS, WMcursor *cursor)
+{
+ if ( be_app->Lock() ) {
+ if ( cursor == NULL ) {
+ if ( SDL_BlankCursor != NULL ) {
+ be_app->SetCursor(SDL_BlankCursor->bits);
+ }
+ } else {
+ be_app->SetCursor(cursor->bits);
+ }
+ be_app->Unlock();
+ }
+ return(1);
+}
+
+void BE_FreeWMCursor(_THIS, WMcursor *cursor)
+{
+ SDL_free(cursor->bits);
+ SDL_free(cursor);
+}
+
+/* Implementation by Christian Bauer <cbauer@student.physik.uni-mainz.de> */
+void BE_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
+{
+ BPoint pt;
+ SDL_Win->GetXYOffset(pt.x, pt.y);
+ pt.x += x;
+ pt.y += y;
+ SDL_Win->Lock();
+ SDL_Win->ConvertToScreen(&pt);
+ SDL_Win->Unlock();
+ set_mouse_position((int32)pt.x, (int32)pt.y);
+}
+
+/* Check to see if we need to enter or leave mouse relative mode */
+void BE_CheckMouseMode(_THIS)
+{
+ /* If the mouse is hidden and input is grabbed, we use relative mode */
+ if ( !(SDL_cursorstate & CURSOR_VISIBLE) &&
+ (_this->input_grab != SDL_GRAB_OFF) ) {
+ mouse_relative = 1;
+ } else {
+ mouse_relative = 0;
+ }
+}
+
+}; /* Extern C */
diff --git a/distrib/sdl-1.2.15/src/video/bwindow/SDL_sysmouse_c.h b/distrib/sdl-1.2.15/src/video/bwindow/SDL_sysmouse_c.h
new file mode 100644
index 0000000..70b3b2a
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/bwindow/SDL_sysmouse_c.h
@@ -0,0 +1,33 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_lowvideo.h"
+
+/* Functions to be exported */
+extern void BE_FreeWMCursor(_THIS, WMcursor *cursor);
+extern WMcursor *BE_CreateWMCursor(_THIS,
+ Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
+extern int BE_ShowWMCursor(_THIS, WMcursor *cursor);
+extern void BE_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
+extern void BE_CheckMouseMode(_THIS);
+
diff --git a/distrib/sdl-1.2.15/src/video/bwindow/SDL_sysvideo.cc b/distrib/sdl-1.2.15/src/video/bwindow/SDL_sysvideo.cc
new file mode 100644
index 0000000..c32b661
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/bwindow/SDL_sysvideo.cc
@@ -0,0 +1,841 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* BWindow based framebuffer implementation */
+
+#include <unistd.h>
+
+#include "SDL_BWin.h"
+#include "SDL_timer.h"
+
+extern "C" {
+
+#include "../SDL_sysvideo.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_sysevents_c.h"
+#include "SDL_sysmouse_c.h"
+#include "SDL_syswm_c.h"
+#include "SDL_lowvideo.h"
+#include "../SDL_yuvfuncs.h"
+#include "SDL_sysyuv.h"
+#include "../blank_cursor.h"
+
+#define BEOS_HIDDEN_SIZE 32 /* starting hidden window size */
+
+/* Initialization/Query functions */
+static int BE_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **BE_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *BE_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static void BE_UpdateMouse(_THIS);
+static int BE_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
+static void BE_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int BE_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int BE_LockHWSurface(_THIS, SDL_Surface *surface);
+static void BE_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void BE_FreeHWSurface(_THIS, SDL_Surface *surface);
+
+static int BE_ToggleFullScreen(_THIS, int fullscreen);
+
+/* OpenGL functions */
+#if SDL_VIDEO_OPENGL
+static int BE_GL_LoadLibrary(_THIS, const char *path);
+static void* BE_GL_GetProcAddress(_THIS, const char *proc);
+static int BE_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
+static int BE_GL_MakeCurrent(_THIS);
+static void BE_GL_SwapBuffers(_THIS);
+#endif
+
+/* FB driver bootstrap functions */
+
+static int BE_Available(void)
+{
+ return(1);
+}
+
+static void BE_DeleteDevice(SDL_VideoDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_VideoDevice *BE_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device;
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *device->hidden));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( device ) {
+ SDL_free(device);
+ }
+ return(0);
+ }
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+
+ /* Set the function pointers */
+ /* Initialization/Query functions */
+ device->VideoInit = BE_VideoInit;
+ device->ListModes = BE_ListModes;
+ device->SetVideoMode = BE_SetVideoMode;
+ device->ToggleFullScreen = BE_ToggleFullScreen;
+ device->UpdateMouse = BE_UpdateMouse;
+ device->CreateYUVOverlay = BE_CreateYUVOverlay;
+ device->SetColors = BE_SetColors;
+ device->UpdateRects = NULL;
+ device->VideoQuit = BE_VideoQuit;
+ /* Hardware acceleration functions */
+ device->AllocHWSurface = BE_AllocHWSurface;
+ device->CheckHWBlit = NULL;
+ device->FillHWRect = NULL;
+ device->SetHWColorKey = NULL;
+ device->SetHWAlpha = NULL;
+ device->LockHWSurface = BE_LockHWSurface;
+ device->UnlockHWSurface = BE_UnlockHWSurface;
+ device->FlipHWSurface = NULL;
+ device->FreeHWSurface = BE_FreeHWSurface;
+ /* Gamma support */
+#if SDL_VIDEO_OPENGL
+ /* OpenGL support */
+ device->GL_LoadLibrary = BE_GL_LoadLibrary;
+ device->GL_GetProcAddress = BE_GL_GetProcAddress;
+ device->GL_GetAttribute = BE_GL_GetAttribute;
+ device->GL_MakeCurrent = BE_GL_MakeCurrent;
+ device->GL_SwapBuffers = BE_GL_SwapBuffers;
+#endif
+ /* Window manager functions */
+ device->SetCaption = BE_SetWMCaption;
+ device->SetIcon = NULL;
+ device->IconifyWindow = BE_IconifyWindow;
+ device->GrabInput = BE_GrabInput;
+ device->GetWMInfo = BE_GetWMInfo;
+ /* Cursor manager functions */
+ device->FreeWMCursor = BE_FreeWMCursor;
+ device->CreateWMCursor = BE_CreateWMCursor;
+ device->ShowWMCursor = BE_ShowWMCursor;
+ device->WarpWMCursor = BE_WarpWMCursor;
+ device->MoveWMCursor = NULL;
+ device->CheckMouseMode = BE_CheckMouseMode;
+ /* Event manager functions */
+ device->InitOSKeymap = BE_InitOSKeymap;
+ device->PumpEvents = BE_PumpEvents;
+
+ device->free = BE_DeleteDevice;
+
+ /* Set the driver flags */
+ device->handles_any_size = 1;
+
+ return device;
+}
+
+VideoBootStrap BWINDOW_bootstrap = {
+ "bwindow", "BDirectWindow graphics",
+ BE_Available, BE_CreateDevice
+};
+
+static inline int ColorSpaceToBitsPerPixel(uint32 colorspace)
+{
+ int bitsperpixel;
+
+ bitsperpixel = 0;
+ switch (colorspace) {
+ case B_CMAP8:
+ bitsperpixel = 8;
+ break;
+ case B_RGB15:
+ case B_RGBA15:
+ case B_RGB15_BIG:
+ case B_RGBA15_BIG:
+ bitsperpixel = 15;
+ break;
+ case B_RGB16:
+ case B_RGB16_BIG:
+ bitsperpixel = 16;
+ break;
+ case B_RGB32:
+ case B_RGBA32:
+ case B_RGB32_BIG:
+ case B_RGBA32_BIG:
+ bitsperpixel = 32;
+ break;
+ default:
+ break;
+ }
+ return(bitsperpixel);
+}
+
+/* Function to sort the display_list in bscreen */
+static int CompareModes(const void *A, const void *B)
+{
+ const display_mode *a = (display_mode *)A;
+ const display_mode *b = (display_mode *)B;
+
+ if ( a->space == b->space ) {
+ return((b->virtual_width*b->virtual_height)-
+ (a->virtual_width*a->virtual_height));
+ } else {
+ return(ColorSpaceToBitsPerPixel(b->space)-
+ ColorSpaceToBitsPerPixel(a->space));
+ }
+}
+
+/* Yes, this isn't the fastest it could be, but it works nicely */
+static int BE_AddMode(_THIS, int index, unsigned int w, unsigned int h)
+{
+ SDL_Rect *mode;
+ int i;
+ int next_mode;
+
+ /* Check to see if we already have this mode */
+ if ( SDL_nummodes[index] > 0 ) {
+ for ( i=SDL_nummodes[index]-1; i >= 0; --i ) {
+ mode = SDL_modelist[index][i];
+ if ( (mode->w == w) && (mode->h == h) ) {
+#ifdef BWINDOW_DEBUG
+ fprintf(stderr, "We already have mode %dx%d at %d bytes per pixel\n", w, h, index+1);
+#endif
+ return(0);
+ }
+ }
+ }
+
+ /* Set up the new video mode rectangle */
+ mode = (SDL_Rect *)SDL_malloc(sizeof *mode);
+ if ( mode == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ mode->x = 0;
+ mode->y = 0;
+ mode->w = w;
+ mode->h = h;
+#ifdef BWINDOW_DEBUG
+ fprintf(stderr, "Adding mode %dx%d at %d bytes per pixel\n", w, h, index+1);
+#endif
+
+ /* Allocate the new list of modes, and fill in the new mode */
+ next_mode = SDL_nummodes[index];
+ SDL_modelist[index] = (SDL_Rect **)
+ SDL_realloc(SDL_modelist[index], (1+next_mode+1)*sizeof(SDL_Rect *));
+ if ( SDL_modelist[index] == NULL ) {
+ SDL_OutOfMemory();
+ SDL_nummodes[index] = 0;
+ SDL_free(mode);
+ return(-1);
+ }
+ SDL_modelist[index][next_mode] = mode;
+ SDL_modelist[index][next_mode+1] = NULL;
+ SDL_nummodes[index]++;
+
+ return(0);
+}
+
+int BE_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ display_mode *modes;
+ uint32 i, nmodes;
+ int bpp;
+ BRect bounds;
+
+ /* Initialize the Be Application for appserver interaction */
+ if ( SDL_InitBeApp() < 0 ) {
+ return(-1);
+ }
+
+ /* It is important that this be created after SDL_InitBeApp() */
+ BScreen bscreen;
+
+ /* Save the current display mode */
+ bscreen.GetMode(&saved_mode);
+ _this->info.current_w = saved_mode.virtual_width;
+ _this->info.current_h = saved_mode.virtual_height;
+
+ /* Determine the screen depth */
+ vformat->BitsPerPixel = ColorSpaceToBitsPerPixel(bscreen.ColorSpace());
+ if ( vformat->BitsPerPixel == 0 ) {
+ SDL_SetError("Unknown BScreen colorspace: 0x%x",
+ bscreen.ColorSpace());
+ return(-1);
+ }
+
+ /* Get the video modes we can switch to in fullscreen mode */
+ bscreen.GetModeList(&modes, &nmodes);
+ SDL_qsort(modes, nmodes, sizeof *modes, CompareModes);
+ for ( i=0; i<nmodes; ++i ) {
+ bpp = ColorSpaceToBitsPerPixel(modes[i].space);
+ //if ( bpp != 0 ) { // There are bugs in changing colorspace
+ if ( modes[i].space == saved_mode.space ) {
+ BE_AddMode(_this, ((bpp+7)/8)-1,
+ modes[i].virtual_width,
+ modes[i].virtual_height);
+ }
+ }
+
+ /* Create the window and view */
+ bounds.top = 0; bounds.left = 0;
+ bounds.right = BEOS_HIDDEN_SIZE;
+ bounds.bottom = BEOS_HIDDEN_SIZE;
+ SDL_Win = new SDL_BWin(bounds);
+
+#if SDL_VIDEO_OPENGL
+ /* testgl application doesn't load library, just tries to load symbols */
+ /* is it correct? if so we have to load library here */
+ BE_GL_LoadLibrary(_this, NULL);
+#endif
+
+ /* Create the clear cursor */
+ SDL_BlankCursor = BE_CreateWMCursor(_this, blank_cdata, blank_cmask,
+ BLANK_CWIDTH, BLANK_CHEIGHT, BLANK_CHOTX, BLANK_CHOTY);
+
+ /* Fill in some window manager capabilities */
+ _this->info.wm_available = 1;
+
+ /* We're done! */
+ return(0);
+}
+
+/* We support any dimension at our bit-depth */
+SDL_Rect **BE_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ SDL_Rect **modes;
+
+ modes = ((SDL_Rect **)0);
+ if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
+ modes = SDL_modelist[((format->BitsPerPixel+7)/8)-1];
+ } else {
+ if ( format->BitsPerPixel ==
+ _this->screen->format->BitsPerPixel ) {
+ modes = ((SDL_Rect **)-1);
+ }
+ }
+ return(modes);
+}
+
+/* Various screen update functions available */
+static void BE_NormalUpdate(_THIS, int numrects, SDL_Rect *rects);
+
+
+/* Find the closest display mode for fullscreen */
+static bool BE_FindClosestFSMode(_THIS, int width, int height, int bpp,
+ display_mode *mode)
+{
+ BScreen bscreen;
+ uint32 i, nmodes;
+ SDL_Rect **modes;
+ display_mode *dmodes;
+ display_mode current;
+ float current_refresh;
+ bscreen.GetMode(&current);
+ current_refresh = (1000 * current.timing.pixel_clock) /
+ (current.timing.h_total * current.timing.v_total);
+
+ modes = SDL_modelist[((bpp+7)/8)-1];
+
+ // find end of list (lowest-resolution mode; modes are ordered
+ // highest-to-lowest).
+ i = 0; while(modes[i]) i++;
+ if (!i) return false; // what? no modes at all?
+
+ // find first mode with resolution >= requested in both dimensions
+ for (--i; i >= 0; --i)
+ {
+ if (modes[i]->w >= width && modes[i]->h >= height)
+ break;
+ }
+
+ // unable to find any mode with that high a resolution!
+ if (i < 0)
+ return false;
+
+ width = modes[i]->w;
+ height = modes[i]->h;
+
+ bscreen.GetModeList(&dmodes, &nmodes);
+ for ( i = 0; i < nmodes; ++i ) {
+ if ( (bpp == ColorSpaceToBitsPerPixel(dmodes[i].space)) &&
+ (width == dmodes[i].virtual_width) &&
+ (height == dmodes[i].virtual_height) ) {
+ break;
+ }
+ }
+ if ( i != nmodes ) {
+ *mode = dmodes[i];
+ if ((mode->virtual_width <= current.virtual_width) &&
+ (mode->virtual_height <= current.virtual_height)) {
+ float new_refresh = (1000 * mode->timing.pixel_clock) /
+ (mode->timing.h_total * mode->timing.v_total);
+ if (new_refresh < current_refresh) {
+ mode->timing.pixel_clock = (uint32)((mode->timing.h_total * mode->timing.v_total)
+ * current_refresh / 1000);
+ }
+ }
+ return true;
+ } else {
+ return false;
+ }
+}
+
+static int BE_SetFullScreen(_THIS, SDL_Surface *screen, int fullscreen)
+{
+ // printf("SetFullScreen(%d)\n", fullscreen);
+ BScreen bscreen;
+
+ // SetFullSscreen() does not work as expected if called in a window
+ // that was never shown. This is probably a bug in the Haiku Game Kit that needs
+ // to be investigated.
+ if (SDL_Win->Lock()) {
+ // Show our window.
+ SDL_Win->Show();
+ }
+
+ if (SDL_Win->IsLocked()) {
+ // Unlock the window if it was locked. This is needed as only the
+ // first call to Show() unlocks the looper. All other calls to it
+ // will not.
+ SDL_Win->Unlock();
+ }
+
+ int width = screen->w;
+ int height = screen->h;
+
+ if (fullscreen) {
+ // Set resolution to the closest available one that matches the
+ // current SDL resolution.
+ display_mode mode;
+ bscreen.GetMode(&mode);
+
+ int bpp = screen->format->BitsPerPixel;
+ if (bpp != ColorSpaceToBitsPerPixel(mode.space) ||
+ width != mode.virtual_width || height != mode.virtual_height) {
+ if(BE_FindClosestFSMode(_this, width, height, bpp, &mode)) {
+ bscreen.SetMode(&mode);
+ } else {
+ // printf("Could not set new mode.\n");
+ return(0);
+ }
+ }
+ } else {
+ // Reset to the previous known resolution as we are now in window
+ // mode.
+ bscreen.SetMode(&saved_mode);
+ }
+
+ // Effectivelly set/reset full screen mode. If we are already in
+ // full screen mode, we reset back to windowed mode first so the
+ // window can resize when going fullscreen.
+ // if (fullscreen)
+ // printf("Going fullscreen\n");
+ // else
+ // printf("Going windowed\n");
+ SDL_Win->SetFullScreen(fullscreen);
+
+ // Calculate offsets for centering the window (in window mode) and for
+ // dentering the bitmap (in full screen mode).
+ BRect bounds = bscreen.Frame();
+ bounds.PrintToStream();
+ int32 cx = (bounds.IntegerWidth() - width)/2;
+ int32 cy = (bounds.IntegerHeight() - height)/2;
+
+ // printf ("cx = %d, cy = %d\n", cx, cy);
+ if (!SDL_Win->IsFullScreen()) {
+ // printf("Doing not fullscreen stuff.\n");
+ // We are not in full screen mode, so we want to change the window
+ // size to match the resolution in SDL.
+ SDL_Win->ResizeTo(width, height);
+
+ // And also center the window and reset the drawing offset.
+ SDL_Win->MoveTo(cx, cy);
+ SDL_Win->SetXYOffset(0, 0);
+ } else {
+ // printf("Doing fullscreen stuff.");
+ // Center the bitmap whenever we are in full screen mode.
+ SDL_Win->SetXYOffset(cx, cy);
+ }
+
+ // Set relevant internal SDL screen flags.
+ if (SDL_Win->IsFullScreen()) {
+ screen->flags |= SDL_FULLSCREEN;
+ } else {
+ screen->flags &= ~SDL_FULLSCREEN;
+ }
+
+ return(1);
+}
+
+static int BE_ToggleFullScreen(_THIS, int fullscreen)
+{
+ return BE_SetFullScreen(_this, _this->screen, fullscreen);
+}
+
+/* FIXME: check return values and cleanup here */
+SDL_Surface *BE_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ BScreen bscreen;
+ BBitmap *bbitmap;
+ BRect bounds;
+ Uint32 gl_flags = 0;
+
+ /* Only RGB works on r5 currently */
+ gl_flags = BGL_RGB;
+ if (_this->gl_config.double_buffer)
+ gl_flags |= BGL_DOUBLE;
+ else
+ gl_flags |= BGL_SINGLE;
+ if (_this->gl_config.alpha_size > 0 || bpp == 32)
+ gl_flags |= BGL_ALPHA;
+ if (_this->gl_config.depth_size > 0)
+ gl_flags |= BGL_DEPTH;
+ if (_this->gl_config.stencil_size > 0)
+ gl_flags |= BGL_STENCIL;
+ if (_this->gl_config.accum_red_size > 0
+ || _this->gl_config.accum_green_size > 0
+ || _this->gl_config.accum_blue_size > 0
+ || _this->gl_config.accum_alpha_size > 0)
+ gl_flags |= BGL_ACCUM;
+
+ /* Create the view for this window, using found flags */
+ if ( SDL_Win->CreateView(flags, gl_flags) < 0 ) {
+ return(NULL);
+ }
+
+ current->flags = 0; /* Clear flags */
+ current->w = width;
+ current->h = height;
+ SDL_Win->SetType(B_TITLED_WINDOW);
+ if ( flags & SDL_NOFRAME ) {
+ current->flags |= SDL_NOFRAME;
+ SDL_Win->SetLook(B_NO_BORDER_WINDOW_LOOK);
+ } else {
+ if ( (flags & SDL_RESIZABLE) && !(flags & SDL_OPENGL) ) {
+ current->flags |= SDL_RESIZABLE;
+ /* We don't want opaque resizing (TM). :-) */
+ SDL_Win->SetFlags(B_OUTLINE_RESIZE);
+ } else {
+ SDL_Win->SetFlags(B_NOT_RESIZABLE|B_NOT_ZOOMABLE);
+ }
+ }
+
+ if ( flags & SDL_OPENGL ) {
+ current->flags |= SDL_OPENGL;
+ current->pitch = 0;
+ current->pixels = NULL;
+ _this->UpdateRects = NULL;
+ } else {
+ /* Create the BBitmap framebuffer */
+ bounds.top = 0; bounds.left = 0;
+ bounds.right = width-1;
+ bounds.bottom = height-1;
+ bbitmap = new BBitmap(bounds, bscreen.ColorSpace());
+ if ( ! bbitmap->IsValid() ) {
+ SDL_SetError("Couldn't create screen bitmap");
+ delete bbitmap;
+ return(NULL);
+ }
+ current->pitch = bbitmap->BytesPerRow();
+ current->pixels = (void *)bbitmap->Bits();
+ SDL_Win->SetBitmap(bbitmap);
+ _this->UpdateRects = BE_NormalUpdate;
+ }
+
+ /* Set the correct fullscreen mode */
+ BE_SetFullScreen(_this, current, flags & SDL_FULLSCREEN ? 1 : 0);
+
+ /* We're done */
+ return(current);
+}
+
+/* Update the current mouse state and position */
+void BE_UpdateMouse(_THIS)
+{
+ BPoint point;
+ uint32 buttons;
+
+ if ( SDL_Win->Lock() ) {
+ /* Get new input state, if still active */
+ if ( SDL_Win->IsActive() ) {
+ (SDL_Win->View())->GetMouse(&point, &buttons, true);
+ } else {
+ point.x = -1;
+ point.y = -1;
+ }
+ SDL_Win->Unlock();
+
+ if ( (point.x >= 0) && (point.x < SDL_VideoSurface->w) &&
+ (point.y >= 0) && (point.y < SDL_VideoSurface->h) ) {
+ SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
+ SDL_PrivateMouseMotion(0, 0,
+ (Sint16)point.x, (Sint16)point.y);
+ } else {
+ SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
+ }
+ }
+}
+
+/* We don't actually allow hardware surfaces other than the main one */
+static int BE_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(-1);
+}
+static void BE_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+static int BE_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(0);
+}
+static void BE_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+static void BE_NormalUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+ if ( SDL_Win->BeginDraw() ) {
+ int i;
+
+ for ( i=0; i<numrects; ++i ) {
+ BRect rect;
+
+ rect.top = rects[i].y;
+ rect.left = rects[i].x;
+ rect.bottom = rect.top+rects[i].h-1;
+ rect.right = rect.left+rects[i].w-1;
+ SDL_Win->DrawAsync(rect);
+ }
+ SDL_Win->EndDraw();
+ }
+}
+
+#if SDL_VIDEO_OPENGL
+/* Passing a NULL path means load pointers from the application */
+int BE_GL_LoadLibrary(_THIS, const char *path)
+{
+ if (path == NULL) {
+ if (_this->gl_config.dll_handle == NULL) {
+ image_info info;
+ int32 cookie = 0;
+ while (get_next_image_info(0,&cookie,&info) == B_OK) {
+ void *location = NULL;
+#ifdef __HAIKU__
+ if (get_image_symbol(info.id,"glBegin",B_SYMBOL_TYPE_ANY,&location) == B_OK) { // This is how it actually works in Haiku
+#else
+ if (get_image_symbol((image_id)cookie,"glBegin",B_SYMBOL_TYPE_ANY,&location) == B_OK) { // I don't know if that *did* work in BeOS
+#endif
+ _this->gl_config.dll_handle = (void*)info.id;
+ _this->gl_config.driver_loaded = 1;
+ SDL_strlcpy(_this->gl_config.driver_path, "libGL.so", SDL_arraysize(_this->gl_config.driver_path));
+ }
+ }
+ }
+ } else {
+ /*
+ FIXME None of BeOS libGL.so implementations have exported functions
+ to load BGLView, which should be reloaded from new lib.
+ So for now just "load" linked libGL.so :(
+ */
+ if (_this->gl_config.dll_handle == NULL) {
+ return BE_GL_LoadLibrary(_this, NULL);
+ }
+
+ /* Unload old first */
+ /*if (_this->gl_config.dll_handle != NULL) {*/
+ /* Do not try to unload application itself (if LoadLibrary was called before with NULL ;) */
+ /* image_info info;
+ if (get_image_info((image_id)_this->gl_config.dll_handle, &info) == B_OK) {
+ if (info.type != B_APP_IMAGE) {
+ unload_add_on((image_id)_this->gl_config.dll_handle);
+ }
+ }
+
+ }
+
+ if ((_this->gl_config.dll_handle = (void*)load_add_on(path)) != (void*)B_ERROR) {
+ _this->gl_config.driver_loaded = 1;
+ SDL_strlcpy(_this->gl_config.driver_path, path, SDL_arraysize(_this->gl_config.driver_path));
+ }*/
+ }
+
+ if (_this->gl_config.dll_handle != NULL) {
+ return 0;
+ } else {
+ _this->gl_config.dll_handle = NULL;
+ _this->gl_config.driver_loaded = 0;
+ *_this->gl_config.driver_path = '\0';
+ return -1;
+ }
+}
+
+void* BE_GL_GetProcAddress(_THIS, const char *proc)
+{
+ if (_this->gl_config.dll_handle != NULL) {
+ void *location = NULL;
+ status_t err;
+ if ((err = get_image_symbol((image_id)_this->gl_config.dll_handle, proc, B_SYMBOL_TYPE_ANY, &location)) == B_OK) {
+ return location;
+ } else {
+ SDL_SetError("Couldn't find OpenGL symbol");
+ return NULL;
+ }
+ } else {
+ SDL_SetError("OpenGL library not loaded");
+ return NULL;
+ }
+}
+
+int BE_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
+{
+ /*
+ FIXME? Right now BE_GL_GetAttribute shouldn't be called between glBegin() and glEnd() - it doesn't use "cached" values
+ */
+ switch (attrib)
+ {
+ case SDL_GL_RED_SIZE:
+ glGetIntegerv(GL_RED_BITS, (GLint*)value);
+ break;
+ case SDL_GL_GREEN_SIZE:
+ glGetIntegerv(GL_GREEN_BITS, (GLint*)value);
+ break;
+ case SDL_GL_BLUE_SIZE:
+ glGetIntegerv(GL_BLUE_BITS, (GLint*)value);
+ break;
+ case SDL_GL_ALPHA_SIZE:
+ glGetIntegerv(GL_ALPHA_BITS, (GLint*)value);
+ break;
+ case SDL_GL_DOUBLEBUFFER:
+ glGetBooleanv(GL_DOUBLEBUFFER, (GLboolean*)value);
+ break;
+ case SDL_GL_BUFFER_SIZE:
+ int v;
+ glGetIntegerv(GL_RED_BITS, (GLint*)&v);
+ *value = v;
+ glGetIntegerv(GL_GREEN_BITS, (GLint*)&v);
+ *value += v;
+ glGetIntegerv(GL_BLUE_BITS, (GLint*)&v);
+ *value += v;
+ glGetIntegerv(GL_ALPHA_BITS, (GLint*)&v);
+ *value += v;
+ break;
+ case SDL_GL_DEPTH_SIZE:
+ glGetIntegerv(GL_DEPTH_BITS, (GLint*)value); /* Mesa creates 16 only? r5 always 32 */
+ break;
+ case SDL_GL_STENCIL_SIZE:
+ glGetIntegerv(GL_STENCIL_BITS, (GLint*)value);
+ break;
+ case SDL_GL_ACCUM_RED_SIZE:
+ glGetIntegerv(GL_ACCUM_RED_BITS, (GLint*)value);
+ break;
+ case SDL_GL_ACCUM_GREEN_SIZE:
+ glGetIntegerv(GL_ACCUM_GREEN_BITS, (GLint*)value);
+ break;
+ case SDL_GL_ACCUM_BLUE_SIZE:
+ glGetIntegerv(GL_ACCUM_BLUE_BITS, (GLint*)value);
+ break;
+ case SDL_GL_ACCUM_ALPHA_SIZE:
+ glGetIntegerv(GL_ACCUM_ALPHA_BITS, (GLint*)value);
+ break;
+ case SDL_GL_STEREO:
+ case SDL_GL_MULTISAMPLEBUFFERS:
+ case SDL_GL_MULTISAMPLESAMPLES:
+ default:
+ *value=0;
+ return(-1);
+ }
+ return 0;
+}
+
+int BE_GL_MakeCurrent(_THIS)
+{
+ /* FIXME: should we glview->unlock and then glview->lock()? */
+ return 0;
+}
+
+void BE_GL_SwapBuffers(_THIS)
+{
+ SDL_Win->SwapBuffers();
+}
+#endif
+
+/* Is the system palette settable? */
+int BE_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ int i;
+ SDL_Palette *palette;
+ const color_map *cmap = BScreen().ColorMap();
+
+ /* Get the screen colormap */
+ palette = _this->screen->format->palette;
+ for ( i=0; i<256; ++i ) {
+ palette->colors[i].r = cmap->color_list[i].red;
+ palette->colors[i].g = cmap->color_list[i].green;
+ palette->colors[i].b = cmap->color_list[i].blue;
+ }
+ return(0);
+}
+
+void BE_VideoQuit(_THIS)
+{
+ int i, j;
+
+ SDL_Win->Quit();
+ SDL_Win = NULL;
+
+ if ( SDL_BlankCursor != NULL ) {
+ BE_FreeWMCursor(_this, SDL_BlankCursor);
+ SDL_BlankCursor = NULL;
+ }
+ for ( i=0; i<NUM_MODELISTS; ++i ) {
+ if ( SDL_modelist[i] ) {
+ for ( j=0; SDL_modelist[i][j]; ++j ) {
+ SDL_free(SDL_modelist[i][j]);
+ }
+ SDL_free(SDL_modelist[i]);
+ SDL_modelist[i] = NULL;
+ }
+ }
+ /* Restore the original video mode */
+ if ( _this->screen ) {
+ if ( (_this->screen->flags&SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
+ BScreen bscreen;
+ bscreen.SetMode(&saved_mode);
+ }
+ _this->screen->pixels = NULL;
+ }
+
+#if SDL_VIDEO_OPENGL
+ if (_this->gl_config.dll_handle != NULL)
+ unload_add_on((image_id)_this->gl_config.dll_handle);
+#endif
+
+ SDL_QuitBeApp();
+}
+
+}; /* Extern C */
diff --git a/distrib/sdl-1.2.15/src/video/bwindow/SDL_syswm.cc b/distrib/sdl-1.2.15/src/video/bwindow/SDL_syswm.cc
new file mode 100644
index 0000000..df80100
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/bwindow/SDL_syswm.cc
@@ -0,0 +1,92 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_BWin.h"
+
+extern "C" {
+#include "SDL_syswm_c.h"
+#include "SDL_error.h"
+#include "../SDL_cursor_c.h"
+
+void BE_SetWMCaption(_THIS, const char *title, const char *icon)
+{
+ SDL_Win->SetTitle(title);
+}
+
+int BE_IconifyWindow(_THIS)
+{
+ SDL_Win->Minimize(true);
+ return 1;
+}
+
+SDL_GrabMode BE_GrabInput(_THIS, SDL_GrabMode mode)
+{
+ if ( mode == SDL_GRAB_OFF ) {
+// be_app->ShowCursor();
+ if ( !(SDL_cursorstate & CURSOR_VISIBLE) ) {
+ /* BeSman: Jan 2, 2006
+ must be leaving relative mode, move mouse from
+ center of window to where it belongs ... */
+ BPoint pt;
+ int x, y;
+ SDL_GetMouseState(&x,&y);
+ pt.x = x;
+ pt.y = y;
+ SDL_Win->Lock();
+ SDL_Win->ConvertToScreen(&pt);
+ SDL_Win->Unlock();
+ set_mouse_position((int)pt.x, (int)pt.y);
+ }
+ } else {
+// be_app->HideCursor();
+ if ( !(SDL_cursorstate & CURSOR_VISIBLE) ) {
+ /* BeSman: Jan 2, 2006
+ must be entering relative mode, get ready by
+ moving mouse to center of window ... */
+ BPoint pt;
+ pt.x = (SDL_VideoSurface->w/2);
+ pt.y = (SDL_VideoSurface->h/2);
+ SDL_Win->Lock();
+ SDL_Win->ConvertToScreen(&pt);
+ SDL_Win->Unlock();
+ set_mouse_position((int)pt.x, (int)pt.y);
+ }
+ }
+ return(mode);
+}
+
+int BE_GetWMInfo(_THIS, SDL_SysWMinfo *info)
+{
+ if (info->version.major <= SDL_MAJOR_VERSION)
+ {
+ return 1;
+ }
+ else
+ {
+ SDL_SetError("Application not compiled with SDL %d.%d\n",
+ SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
+ return -1;
+ }
+}
+
+}; /* Extern C */
diff --git a/distrib/sdl-1.2.15/src/video/bwindow/SDL_syswm_c.h b/distrib/sdl-1.2.15/src/video/bwindow/SDL_syswm_c.h
new file mode 100644
index 0000000..c1285c8
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/bwindow/SDL_syswm_c.h
@@ -0,0 +1,32 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_syswm.h"
+#include "SDL_lowvideo.h"
+
+
+/* Functions to be exported */
+extern void BE_SetWMCaption(_THIS, const char *title, const char *icon);
+extern int BE_IconifyWindow(_THIS);
+extern int BE_GetWMInfo(_THIS, SDL_SysWMinfo *info);
+extern SDL_GrabMode BE_GrabInput(_THIS, SDL_GrabMode mode);
diff --git a/distrib/sdl-1.2.15/src/video/bwindow/SDL_sysyuv.cc b/distrib/sdl-1.2.15/src/video/bwindow/SDL_sysyuv.cc
new file mode 100644
index 0000000..7c71b00
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/bwindow/SDL_sysyuv.cc
@@ -0,0 +1,314 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This is the BeOS version of SDL YUV video overlays */
+
+#include "SDL_video.h"
+#include "SDL_sysyuv.h"
+#include "../SDL_yuvfuncs.h"
+
+extern "C" {
+
+/* The functions used to manipulate software video overlays */
+static struct private_yuvhwfuncs be_yuvfuncs =
+{
+ BE_LockYUVOverlay,
+ BE_UnlockYUVOverlay,
+ BE_DisplayYUVOverlay,
+ BE_FreeYUVOverlay
+};
+
+BBitmap * BE_GetOverlayBitmap(BRect bounds, color_space cs) {
+ BBitmap *bbitmap;
+ bbitmap = new BBitmap(bounds,B_BITMAP_WILL_OVERLAY,cs);
+ if (!bbitmap || bbitmap->InitCheck() != B_OK) {
+ delete bbitmap;
+ return 0;
+ }
+ overlay_restrictions r;
+ bbitmap->GetOverlayRestrictions(&r);
+ uint32 width = bounds.IntegerWidth() + 1;
+ uint32 height = bounds.IntegerHeight() + 1;
+ uint32 width_padding = 0;
+ uint32 height_padding = 0;
+ if ((r.source.horizontal_alignment != 0) ||
+ (r.source.vertical_alignment != 0)) {
+ delete bbitmap;
+ return 0;
+ }
+ if (r.source.width_alignment != 0) {
+ uint32 aligned_width = r.source.width_alignment + 1;
+ if (width % aligned_width > 0) {
+ width_padding = aligned_width - width % aligned_width;
+ }
+ }
+ if (r.source.height_alignment != 0) {
+ uint32 aligned_height = r.source.height_alignment + 1;
+ if (height % aligned_height > 0) {
+ fprintf(stderr,"GetOverlayBitmap failed height alignment\n");
+ fprintf(stderr,"- height = %lu, aligned_height = %lu\n",height,aligned_height);
+ delete bbitmap;
+ return 0;
+ }
+ }
+ if ((r.source.min_width > width) ||
+ (r.source.min_height > height) ||
+ (r.source.max_width < width) ||
+ (r.source.max_height < height)) {
+ fprintf(stderr,"GetOverlayBitmap failed bounds tests\n");
+ delete bbitmap;
+ return 0;
+ }
+ if ((width_padding != 0) || (height_padding != 0)) {
+ delete bbitmap;
+ bounds.Set(bounds.left,bounds.top,bounds.right+width_padding,bounds.bottom+height_padding);
+ bbitmap = new BBitmap(bounds,B_BITMAP_WILL_OVERLAY,cs);
+ if (!bbitmap || bbitmap->InitCheck() != B_OK) {
+ fprintf(stderr,"GetOverlayBitmap failed late\n");
+ delete bbitmap;
+ return 0;
+ }
+ }
+ return bbitmap;
+}
+
+// See <GraphicsDefs.h> [btw: Cb=U, Cr=V]
+// See also http://www.fourcc.org/indexyuv.htm
+color_space convert_color_space(Uint32 format) {
+ switch (format) {
+ case SDL_YV12_OVERLAY:
+ return B_YUV9;
+ case SDL_IYUV_OVERLAY:
+ return B_YUV12;
+ case SDL_YUY2_OVERLAY:
+ return B_YCbCr422;
+ case SDL_UYVY_OVERLAY:
+ return B_YUV422;
+ case SDL_YVYU_OVERLAY: // not supported on beos?
+ return B_NO_COLOR_SPACE;
+ default:
+ return B_NO_COLOR_SPACE;
+ }
+}
+
+// See SDL_video.h
+int count_planes(Uint32 format) {
+ switch (format) {
+ case SDL_YV12_OVERLAY:
+ case SDL_IYUV_OVERLAY:
+ return 3;
+ case SDL_YUY2_OVERLAY:
+ case SDL_UYVY_OVERLAY:
+ case SDL_YVYU_OVERLAY:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+SDL_Overlay *BE_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display) {
+ SDL_Overlay* overlay;
+ struct private_yuvhwdata* hwdata;
+ BBitmap *bbitmap;
+ int planes;
+ BRect bounds;
+ color_space cs;
+
+ /* find the appropriate BeOS colorspace descriptor */
+ cs = convert_color_space(format);
+ if (cs == B_NO_COLOR_SPACE)
+ {
+ return NULL;
+ }
+
+ /* count planes */
+ planes = count_planes(format);
+ if (planes == 0)
+ {
+ return NULL;
+ }
+ /* TODO: figure out planar modes, if anyone cares */
+ if (planes == 3)
+ {
+ return NULL;
+ }
+
+ /* Create the overlay structure */
+ overlay = (SDL_Overlay*)SDL_calloc(1, sizeof(SDL_Overlay));
+
+ if (overlay == NULL)
+ {
+ SDL_OutOfMemory();
+ return NULL;
+ }
+
+ /* Fill in the basic members */
+ overlay->format = format;
+ overlay->w = width;
+ overlay->h = height;
+ overlay->hwdata = NULL;
+
+ /* Set up the YUV surface function structure */
+ overlay->hwfuncs = &be_yuvfuncs;
+
+ /* Create the pixel data and lookup tables */
+ hwdata = (struct private_yuvhwdata*)SDL_calloc(1, sizeof(struct private_yuvhwdata));
+
+ if (hwdata == NULL)
+ {
+ SDL_OutOfMemory();
+ SDL_FreeYUVOverlay(overlay);
+ return NULL;
+ }
+
+ overlay->hwdata = hwdata;
+ overlay->hwdata->display = display;
+ overlay->hwdata->bview = NULL;
+ overlay->hwdata->bbitmap = NULL;
+ overlay->hwdata->locked = 0;
+
+ /* Create the BBitmap framebuffer */
+ bounds.top = 0; bounds.left = 0;
+ bounds.right = width-1;
+ bounds.bottom = height-1;
+
+ BView * bview = new BView(bounds,"overlay",B_FOLLOW_NONE,B_WILL_DRAW);
+ if (!bview) {
+ SDL_OutOfMemory();
+ SDL_FreeYUVOverlay(overlay);
+ return NULL;
+ }
+ overlay->hwdata->bview = bview;
+ overlay->hwdata->first_display = true;
+ bview->Hide();
+
+ bbitmap = BE_GetOverlayBitmap(bounds,cs);
+ if (!bbitmap) {
+ overlay->hwdata->bbitmap = NULL;
+ SDL_FreeYUVOverlay(overlay);
+ return NULL;
+ }
+ overlay->hwdata->bbitmap = bbitmap;
+
+ overlay->planes = planes;
+ overlay->pitches = (Uint16*)SDL_calloc(overlay->planes, sizeof(Uint16));
+ overlay->pixels = (Uint8**)SDL_calloc(overlay->planes, sizeof(Uint8*));
+ if (!overlay->pitches || !overlay->pixels)
+ {
+ SDL_OutOfMemory();
+ SDL_FreeYUVOverlay(overlay);
+ return(NULL);
+ }
+
+ overlay->pitches[0] = bbitmap->BytesPerRow();
+ overlay->pixels[0] = (Uint8 *)bbitmap->Bits();
+ overlay->hw_overlay = 1;
+
+ if (SDL_Win->LockWithTimeout(1000000) != B_OK) {
+ SDL_FreeYUVOverlay(overlay);
+ return(NULL);
+ }
+ BView * view = SDL_Win->View();
+ view->AddChild(bview);
+ rgb_color key;
+ bview->SetViewOverlay(bbitmap,bounds,bview->Bounds(),&key,B_FOLLOW_ALL,
+ B_OVERLAY_FILTER_HORIZONTAL|B_OVERLAY_FILTER_VERTICAL);
+ bview->SetViewColor(key);
+ bview->Flush();
+ SDL_Win->Unlock();
+
+ current_overlay=overlay;
+
+ return overlay;
+}
+
+int BE_LockYUVOverlay(_THIS, SDL_Overlay* overlay)
+{
+ if (overlay == NULL)
+ {
+ return 0;
+ }
+
+ overlay->hwdata->locked = 1;
+ return 0;
+}
+
+void BE_UnlockYUVOverlay(_THIS, SDL_Overlay* overlay)
+{
+ if (overlay == NULL)
+ {
+ return;
+ }
+
+ overlay->hwdata->locked = 0;
+}
+
+int BE_DisplayYUVOverlay(_THIS, SDL_Overlay* overlay, SDL_Rect* src, SDL_Rect *dst)
+{
+ if ((overlay == NULL) || (overlay->hwdata==NULL)
+ || (overlay->hwdata->bview==NULL) || (SDL_Win->View() == NULL))
+ {
+ return -1;
+ }
+ if (SDL_Win->LockWithTimeout(50000) != B_OK) {
+ return 0;
+ }
+ BView * bview = overlay->hwdata->bview;
+ if (SDL_Win->IsFullScreen()) {
+ int left,top;
+ SDL_Win->GetXYOffset(left,top);
+ bview->MoveTo(left+dst->x,top+dst->y);
+ } else {
+ bview->MoveTo(dst->x,dst->y);
+ }
+ bview->ResizeTo(dst->w,dst->h);
+ bview->Flush();
+ if (overlay->hwdata->first_display) {
+ bview->Show();
+ overlay->hwdata->first_display = false;
+ }
+ SDL_Win->Unlock();
+
+ return 0;
+}
+
+void BE_FreeYUVOverlay(_THIS, SDL_Overlay *overlay)
+{
+ if (overlay == NULL)
+ {
+ return;
+ }
+
+ if (overlay->hwdata == NULL)
+ {
+ return;
+ }
+
+ current_overlay=NULL;
+
+ delete overlay->hwdata->bbitmap;
+
+ SDL_free(overlay->hwdata);
+}
+
+}; // extern "C"
diff --git a/distrib/sdl-1.2.15/src/video/bwindow/SDL_sysyuv.h b/distrib/sdl-1.2.15/src/video/bwindow/SDL_sysyuv.h
new file mode 100644
index 0000000..fb5961c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/bwindow/SDL_sysyuv.h
@@ -0,0 +1,73 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+
+#ifndef __SDL_SYS_YUV_H__
+#define __SDL_SYS_YUV_H__
+
+/* This is the BeOS implementation of YUV video overlays */
+
+#include "SDL_video.h"
+#include "SDL_lowvideo.h"
+
+extern "C" {
+
+struct private_yuvhwdata
+{
+/* FRAMEDATA* CurrentFrameData;
+ FRAMEDATA* FrameData0;
+ FRAMEDATA* FrameData1;
+ PgScalerProps_t props;
+ PgScalerCaps_t caps;
+ PgVideoChannel_t* channel;
+ PhArea_t CurrentViewPort;
+ PhPoint_t CurrentWindowPos;
+ long format;
+ int scaler_on;
+ int current;
+ long YStride;
+ long VStride;
+ long UStride;
+ int ischromakey;
+ long chromakey;
+ int forcedredraw;
+ unsigned long State;
+ long flags;
+*/
+ SDL_Surface *display;
+ BView *bview;
+ bool first_display;
+ BBitmap *bbitmap;
+ int locked;
+};
+
+extern BBitmap * BE_GetOverlayBitmap(BRect bounds, color_space cs);
+extern SDL_Overlay* BE_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface* display);
+extern int BE_LockYUVOverlay(_THIS, SDL_Overlay* overlay);
+extern void BE_UnlockYUVOverlay(_THIS, SDL_Overlay* overlay);
+extern int BE_DisplayYUVOverlay(_THIS, SDL_Overlay* overlay, SDL_Rect* src, SDL_Rect* dst);
+extern void BE_FreeYUVOverlay(_THIS, SDL_Overlay* overlay);
+
+};
+
+#endif /* __SDL_PH_YUV_H__ */
diff --git a/distrib/sdl-1.2.15/src/video/caca/SDL_cacaevents.c b/distrib/sdl-1.2.15/src/video/caca/SDL_cacaevents.c
new file mode 100644
index 0000000..723b1dd
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/caca/SDL_cacaevents.c
@@ -0,0 +1,101 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#ifdef SAVE_RCSID
+static char rcsid =
+ "@(#) $Id: libsdl-1.2.11-libcaca.patch,v 1.1 2006/09/18 16:06:06 mr_bones_ Exp $";
+#endif
+
+#include <stdio.h>
+
+#include <caca.h>
+#ifdef CACA_API_VERSION_1
+#include <caca0.h>
+#endif
+
+#include "SDL.h"
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_cacavideo.h"
+#include "SDL_cacaevents_c.h"
+
+void Caca_PumpEvents(_THIS)
+{
+ int posted = 0;
+ int event;
+ SDL_keysym keysym;
+
+ if( ! this->screen ) /* Wait till we got the screen initialised */
+ return;
+
+ do {
+ posted = 0;
+
+ /* Get libcaca event */
+ SDL_mutexP(Caca_mutex);
+ event = caca_get_event(CACA_EVENT_ANY);
+ SDL_mutexV(Caca_mutex);
+
+ if ( event & (CACA_EVENT_KEY_PRESS | CACA_EVENT_KEY_RELEASE)) {
+ int key;
+ switch ( event & 0xffffff )
+ {
+ case CACA_KEY_LEFT: key = SDLK_LEFT; break;
+ case CACA_KEY_RIGHT: key = SDLK_RIGHT; break;
+ case CACA_KEY_UP: key = SDLK_UP; break;
+ case CACA_KEY_DOWN: key = SDLK_DOWN; break;
+ default: key = event & 0xff; break;
+ }
+ /* Key pressed */
+/* printf("Key pressed: %d (%c)\n", key, key); */
+ keysym.scancode = key;
+ keysym.sym = key;
+ keysym.mod = KMOD_NONE;
+ keysym.unicode = 0;
+ if ( SDL_TranslateUNICODE ) {
+ keysym.unicode = key;
+ }
+ posted += SDL_PrivateKeyboard((event & CACA_EVENT_KEY_PRESS) ? SDL_PRESSED : SDL_RELEASED, &keysym);
+ }
+ else if ( event & (CACA_EVENT_MOUSE_PRESS | CACA_EVENT_MOUSE_RELEASE) ) {
+ /* FIXME: we currently ignore the button type! */
+ int button = event & 0x00ffffff;
+ if ( button > 3 ) {
+ button = 1;
+ }
+ posted += SDL_PrivateMouseButton((event & CACA_EVENT_MOUSE_PRESS) ? SDL_PRESSED : SDL_RELEASED, button, 0, 0);
+ }
+ else if ( event & CACA_EVENT_MOUSE_MOTION ) {
+ int new_x = 0, new_y = 0;
+ new_x = ((event & 0x00fff000) >> 12) * Caca_w / caca_get_width();
+ new_y = ((event & 0x00000fff) >> 0) * Caca_h / caca_get_height();
+ posted += SDL_PrivateMouseMotion(0, 0, new_x, new_y);
+ }
+ } while ( posted );
+}
+
+void Caca_InitOSKeymap(_THIS)
+{
+ return;
+}
+
+
diff --git a/distrib/sdl-1.2.15/src/video/caca/SDL_cacaevents_c.h b/distrib/sdl-1.2.15/src/video/caca/SDL_cacaevents_c.h
new file mode 100644
index 0000000..988c3b7
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/caca/SDL_cacaevents_c.h
@@ -0,0 +1,35 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#ifdef SAVE_RCSID
+static char rcsid =
+ "@(#) $Id: libsdl-1.2.11-libcaca.patch,v 1.1 2006/09/18 16:06:06 mr_bones_ Exp $";
+#endif
+
+#include "SDL_cacavideo.h"
+
+/* Variables and functions exported by SDL_sysevents.c to other parts.
+ of the native video subsystem (SDL_sysvideo.c)
+*/
+extern void Caca_PumpEvents(_THIS);
+extern void Caca_InitOSKeymap(_THIS);
+
diff --git a/distrib/sdl-1.2.15/src/video/caca/SDL_cacavideo.c b/distrib/sdl-1.2.15/src/video/caca/SDL_cacavideo.c
new file mode 100644
index 0000000..59a070c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/caca/SDL_cacavideo.c
@@ -0,0 +1,304 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 2003 Sam Hocevar
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Hocevar
+ sam@zoy.org
+*/
+
+#ifdef SAVE_RCSID
+static char rcsid =
+ "@(#) $Id: libsdl-1.2.11-libcaca.patch,v 1.1 2006/09/18 16:06:06 mr_bones_ Exp $";
+#endif
+
+/* libcaca based SDL video driver implementation.
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+
+#include "SDL.h"
+#include "SDL_error.h"
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_cacavideo.h"
+#include "SDL_cacaevents_c.h"
+
+#include <caca.h>
+#ifdef CACA_API_VERSION_1
+#include <caca0.h>
+#endif
+
+/* Initialization/Query functions */
+static int Caca_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **Caca_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *Caca_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static void Caca_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int Caca_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int Caca_LockHWSurface(_THIS, SDL_Surface *surface);
+static int Caca_FlipHWSurface(_THIS, SDL_Surface *surface);
+static void Caca_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void Caca_FreeHWSurface(_THIS, SDL_Surface *surface);
+
+/* Cache the VideoDevice struct */
+static struct SDL_VideoDevice *local_this;
+
+/* libcaca driver bootstrap functions */
+
+static int Caca_Available(void)
+{
+ return 1; /* Always available ! */
+}
+
+static void Caca_DeleteDevice(SDL_VideoDevice *device)
+{
+ free(device->hidden);
+ free(device);
+}
+static SDL_VideoDevice *Caca_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device;
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ malloc((sizeof *device->hidden));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( device ) {
+ free(device);
+ }
+ return(0);
+ }
+ memset(device->hidden, 0, (sizeof *device->hidden));
+
+ /* Set the function pointers */
+ device->VideoInit = Caca_VideoInit;
+ device->ListModes = Caca_ListModes;
+ device->SetVideoMode = Caca_SetVideoMode;
+ device->CreateYUVOverlay = NULL;
+ device->SetColors = NULL;
+ device->UpdateRects = NULL;
+ device->VideoQuit = Caca_VideoQuit;
+ device->AllocHWSurface = Caca_AllocHWSurface;
+ device->CheckHWBlit = NULL;
+ device->FillHWRect = NULL;
+ device->SetHWColorKey = NULL;
+ device->SetHWAlpha = NULL;
+ device->LockHWSurface = Caca_LockHWSurface;
+ device->UnlockHWSurface = Caca_UnlockHWSurface;
+ device->FlipHWSurface = NULL;
+ device->FreeHWSurface = Caca_FreeHWSurface;
+ device->SetCaption = NULL;
+ device->SetIcon = NULL;
+ device->IconifyWindow = NULL;
+ device->GrabInput = NULL;
+ device->GetWMInfo = NULL;
+ device->InitOSKeymap = Caca_InitOSKeymap;
+ device->PumpEvents = Caca_PumpEvents;
+
+ device->free = Caca_DeleteDevice;
+
+ return device;
+}
+
+VideoBootStrap CACA_bootstrap = {
+ "caca", "Color ASCII Art Library",
+ Caca_Available, Caca_CreateDevice
+};
+
+int Caca_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ int i;
+
+ /* Initialize all variables that we clean on shutdown */
+ for ( i=0; i<SDL_NUMMODES; ++i ) {
+ SDL_modelist[i] = malloc(sizeof(SDL_Rect));
+ SDL_modelist[i]->x = SDL_modelist[i]->y = 0;
+ }
+ /* Modes sorted largest to smallest */
+ SDL_modelist[0]->w = 1024; SDL_modelist[0]->h = 768;
+ SDL_modelist[1]->w = 800; SDL_modelist[1]->h = 600;
+ SDL_modelist[2]->w = 640; SDL_modelist[2]->h = 480;
+ SDL_modelist[3]->w = 320; SDL_modelist[3]->h = 400;
+ SDL_modelist[4]->w = 320; SDL_modelist[4]->h = 240;
+ SDL_modelist[5]->w = 320; SDL_modelist[5]->h = 200;
+ SDL_modelist[6] = NULL;
+
+ Caca_mutex = SDL_CreateMutex();
+
+ /* Initialize the library */
+ if ( caca_init() != 0 ) {
+ SDL_SetError("Unable to initialize libcaca");
+ return(-1);
+ }
+
+ /* Initialize private variables */
+ Caca_lastkey = 0;
+ Caca_bitmap = NULL;
+ Caca_buffer = NULL;
+
+ local_this = this;
+
+ /* Determine the screen depth (use default 8-bit depth) */
+ vformat->BitsPerPixel = 8;
+ vformat->BytesPerPixel = 1;
+
+ /* We're done! */
+ return(0);
+}
+
+SDL_Rect **Caca_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ if(format->BitsPerPixel != 8)
+ return NULL;
+
+ if ( flags & SDL_FULLSCREEN ) {
+ return SDL_modelist;
+ } else {
+ return (SDL_Rect **) -1;
+ }
+}
+
+/* Various screen update functions available */
+static void Caca_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
+
+SDL_Surface *Caca_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ if ( Caca_buffer ) {
+ free( Caca_buffer );
+ Caca_buffer = NULL;
+ }
+
+ if ( Caca_bitmap ) {
+ caca_free_bitmap( Caca_bitmap );
+ Caca_bitmap = NULL;
+ }
+
+ Caca_buffer = malloc(2 * ((width + 15) & ~15) * height);
+ if ( ! Caca_buffer ) {
+ SDL_SetError("Couldn't allocate buffer for requested mode");
+ return(NULL);
+ }
+
+ memset(Caca_buffer, 0, 2 * ((width + 15) & ~15) * height);
+
+ /* Allocate the new pixel format for the screen */
+ if ( ! SDL_ReallocFormat(current, 16, 0xf800, 0x07e0, 0x001f, 0) ) {
+ return(NULL);
+ }
+
+ /* Set up the new mode framebuffer */
+ current->flags = SDL_FULLSCREEN;
+ Caca_w = current->w = width;
+ Caca_h = current->h = height;
+ current->pitch = 2 * ((width + 15) & ~15);
+ current->pixels = Caca_buffer;
+
+ /* Create the libcaca bitmap */
+ Caca_bitmap = caca_create_bitmap( 16, width, height, current->pitch, 0xf800, 0x07e0, 0x001f, 0x0000 );
+ if ( ! Caca_bitmap ) {
+ SDL_SetError("Couldn't allocate libcaca bitmap");
+ return(NULL);
+ }
+
+ /* Set the blit function */
+ this->UpdateRects = Caca_DirectUpdate;
+
+ /* We're done */
+ return(current);
+}
+
+/* We don't actually allow hardware surfaces other than the main one */
+static int Caca_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(-1);
+}
+static void Caca_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+/* We need to wait for vertical retrace on page flipped displays */
+static int Caca_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ /* TODO ? */
+ return(0);
+}
+static void Caca_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+/* FIXME: How is this done with libcaca? */
+static int Caca_FlipHWSurface(_THIS, SDL_Surface *surface)
+{
+ SDL_mutexP(Caca_mutex);
+ caca_refresh();
+ SDL_mutexV(Caca_mutex);
+ return(0);
+}
+
+static void Caca_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+ SDL_mutexP(Caca_mutex);
+ caca_draw_bitmap( 0, 0, caca_get_width() - 1, caca_get_height() - 1,
+ Caca_bitmap, Caca_buffer );
+ caca_refresh();
+ SDL_mutexV(Caca_mutex);
+ return;
+}
+
+/* Note: If we are terminated, this could be called in the middle of
+ another SDL video routine -- notably UpdateRects.
+*/
+void Caca_VideoQuit(_THIS)
+{
+ int i;
+
+ /* Free video mode lists */
+ for ( i=0; i<SDL_NUMMODES; ++i ) {
+ if ( SDL_modelist[i] != NULL ) {
+ free(SDL_modelist[i]);
+ SDL_modelist[i] = NULL;
+ }
+ }
+
+ if ( Caca_bitmap ) {
+ caca_free_bitmap( Caca_bitmap );
+ Caca_bitmap = NULL;
+ }
+
+ caca_end();
+
+ SDL_DestroyMutex(Caca_mutex);
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/caca/SDL_cacavideo.h b/distrib/sdl-1.2.15/src/video/caca/SDL_cacavideo.h
new file mode 100644
index 0000000..91fcc81
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/caca/SDL_cacavideo.h
@@ -0,0 +1,76 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 2003 Sam Hocevar
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Hocevar
+ sam@zoy.org
+*/
+
+#ifdef SAVE_RCSID
+static char rcsid =
+ "@(#) $Id: libsdl-1.2.11-libcaca.patch,v 1.1 2006/09/18 16:06:06 mr_bones_ Exp $";
+#endif
+
+#ifndef _SDL_cacavideo_h
+#define _SDL_cacavideo_h
+
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "SDL_mutex.h"
+
+#include <sys/time.h>
+#include <time.h>
+
+#include <caca.h>
+#ifdef CACA_API_VERSION_1
+#include <caca0.h>
+#endif
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+#define SDL_NUMMODES 6
+
+/* Private display data */
+struct SDL_PrivateVideoData {
+ SDL_Rect *SDL_modelist[SDL_NUMMODES+1];
+ SDL_mutex *mutex;
+
+ struct caca_bitmap *bitmap;
+ void *buffer;
+ int w, h;
+
+ int lastkey;
+ struct timeval lasttime;
+};
+
+/* Old variable names */
+#define SDL_modelist (this->hidden->SDL_modelist)
+#define Caca_palette (this->hidden->palette)
+#define Caca_bitmap (this->hidden->bitmap)
+#define Caca_buffer (this->hidden->buffer)
+
+#define Caca_w (this->hidden->w)
+#define Caca_h (this->hidden->h)
+
+#define Caca_lastkey (this->hidden->lastkey)
+#define Caca_lasttime (this->hidden->lasttime)
+
+#define Caca_mutex (this->hidden->mutex)
+
+#endif /* _SDL_cacavideo_h */
+
diff --git a/distrib/sdl-1.2.15/src/video/dc/SDL_dcevents.c b/distrib/sdl-1.2.15/src/video/dc/SDL_dcevents.c
new file mode 100644
index 0000000..38dcca4
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/dc/SDL_dcevents.c
@@ -0,0 +1,152 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL.h"
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_dcvideo.h"
+#include "SDL_dcevents_c.h"
+
+#include <dc/maple.h>
+#include <dc/maple/mouse.h>
+#include <dc/maple/keyboard.h>
+
+const static unsigned short sdl_key[]= {
+ /*0*/ 0, 0, 0, 0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
+ 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
+ 'u', 'v', 'w', 'x', 'y', 'z',
+ /*1e*/ '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
+ /*28*/ SDLK_RETURN, SDLK_ESCAPE, SDLK_BACKSPACE, SDLK_TAB, SDLK_SPACE, SDLK_MINUS, SDLK_PLUS, SDLK_LEFTBRACKET,
+ SDLK_RIGHTBRACKET, SDLK_BACKSLASH , 0, SDLK_SEMICOLON, SDLK_QUOTE,
+ /*35*/ '~', SDLK_COMMA, SDLK_PERIOD, SDLK_SLASH, SDLK_CAPSLOCK,
+ SDLK_F1, SDLK_F2, SDLK_F3, SDLK_F4, SDLK_F5, SDLK_F6, SDLK_F7, SDLK_F8, SDLK_F9, SDLK_F10, SDLK_F11, SDLK_F12,
+ /*46*/ SDLK_PRINT, SDLK_SCROLLOCK, SDLK_PAUSE, SDLK_INSERT, SDLK_HOME, SDLK_PAGEUP, SDLK_DELETE, SDLK_END, SDLK_PAGEDOWN, SDLK_RIGHT, SDLK_LEFT, SDLK_DOWN, SDLK_UP,
+ /*53*/ SDLK_NUMLOCK, SDLK_KP_DIVIDE, SDLK_KP_MULTIPLY, SDLK_KP_MINUS, SDLK_KP_PLUS, SDLK_KP_ENTER,
+ SDLK_KP1, SDLK_KP2, SDLK_KP3, SDLK_KP4, SDLK_KP5, SDLK_KP6,
+ /*5f*/ SDLK_KP7, SDLK_KP8, SDLK_KP9, SDLK_KP0, SDLK_KP_PERIOD, 0 /* S3 */
+};
+
+const static unsigned short sdl_shift[] = {
+ SDLK_LCTRL,SDLK_LSHIFT,SDLK_LALT,0 /* S1 */,
+ SDLK_RCTRL,SDLK_RSHIFT,SDLK_RALT,0 /* S2 */,
+};
+
+#define MOUSE_WHEELUP (1<<4)
+#define MOUSE_WHEELDOWN (1<<5)
+
+static void mouse_update(void)
+{
+const static char sdl_mousebtn[] = {
+ MOUSE_LEFTBUTTON,
+ MOUSE_RIGHTBUTTON,
+ MOUSE_SIDEBUTTON,
+ MOUSE_WHEELUP,
+ MOUSE_WHEELDOWN
+};
+
+ uint8 addr;
+ mouse_cond_t cond;
+
+ static int prev_buttons;
+ int buttons,changed;
+ int i;
+
+ if ((addr = maple_first_mouse())==0 || mouse_get_cond(addr, &cond)<0) return;
+
+ buttons = cond.buttons^0xff;
+ if (cond.dz<0) buttons|=MOUSE_WHEELUP;
+ if (cond.dz>0) buttons|=MOUSE_WHEELDOWN;
+
+ if (cond.dx||cond.dy) SDL_PrivateMouseMotion(0,1,cond.dx,cond.dy);
+
+ changed = buttons^prev_buttons;
+ for(i=0;i<sizeof(sdl_mousebtn);i++) {
+ if (changed & sdl_mousebtn[i]) {
+ SDL_PrivateMouseButton((buttons & sdl_mousebtn[i])?SDL_PRESSED:SDL_RELEASED,i,0,0);
+ }
+ }
+ prev_buttons = buttons;
+}
+
+static void keyboard_update(void)
+{
+ static kbd_state_t old_state;
+ static uint8 old_addr;
+
+ kbd_state_t *state;
+ uint8 addr;
+ int port,unit;
+
+ int shiftkeys;
+ SDL_keysym keysym;
+
+ int i;
+
+ addr = maple_first_kb();
+
+ if (addr==0) return;
+
+ if (addr!=old_addr) {
+ old_addr = addr;
+ SDL_memset(&old_state,0,sizeof(old_state));
+ }
+
+ maple_raddr(addr,&port,&unit);
+
+ state = maple_dev_state(port,unit);
+ if (!state) return;
+
+ shiftkeys = state->shift_keys ^ old_state.shift_keys;
+ for(i=0;i<sizeof(sdl_shift);i++) {
+ if ((shiftkeys>>i)&1) {
+ keysym.sym = sdl_shift[i];
+ SDL_PrivateKeyboard(((state->shift_keys>>i)&1)?SDL_PRESSED:SDL_RELEASED,&keysym);
+ }
+ }
+
+ for(i=0;i<sizeof(sdl_key);i++) {
+ if (state->matrix[i]!=old_state.matrix[i]) {
+ int key = sdl_key[i];
+ if (key) {
+ keysym.sym = key;
+ SDL_PrivateKeyboard(state->matrix[i]?SDL_PRESSED:SDL_RELEASED,&keysym);
+ }
+ }
+ }
+
+ old_state = *state;
+}
+
+void DC_PumpEvents(_THIS)
+{
+ keyboard_update();
+ mouse_update();
+}
+
+void DC_InitOSKeymap(_THIS)
+{
+ /* do nothing. */
+}
+
+/* end of SDL_dcevents.c ... */
+
diff --git a/distrib/sdl-1.2.15/src/video/dc/SDL_dcevents_c.h b/distrib/sdl-1.2.15/src/video/dc/SDL_dcevents_c.h
new file mode 100644
index 0000000..3196eae
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/dc/SDL_dcevents_c.h
@@ -0,0 +1,33 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_dcvideo.h"
+
+/* Variables and functions exported by SDL_sysevents.c to other parts
+ of the native video subsystem (SDL_sysvideo.c)
+*/
+extern void DC_InitOSKeymap(_THIS);
+extern void DC_PumpEvents(_THIS);
+
+/* end of SDL_dcevents_c.h ... */
+
diff --git a/distrib/sdl-1.2.15/src/video/dc/SDL_dcmouse.c b/distrib/sdl-1.2.15/src/video/dc/SDL_dcmouse.c
new file mode 100644
index 0000000..61a0ba0
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/dc/SDL_dcmouse.c
@@ -0,0 +1,35 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <stdio.h>
+
+#include "SDL_mouse.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_dcmouse_c.h"
+
+
+/* The implementation dependent data for the window manager cursor */
+struct WMcursor {
+ int unused;
+};
diff --git a/distrib/sdl-1.2.15/src/video/dc/SDL_dcmouse_c.h b/distrib/sdl-1.2.15/src/video/dc/SDL_dcmouse_c.h
new file mode 100644
index 0000000..dc018bb
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/dc/SDL_dcmouse_c.h
@@ -0,0 +1,26 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_dcvideo.h"
+
+/* Functions to be exported */
diff --git a/distrib/sdl-1.2.15/src/video/dc/SDL_dcvideo.c b/distrib/sdl-1.2.15/src/video/dc/SDL_dcvideo.c
new file mode 100644
index 0000000..5838a49
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/dc/SDL_dcvideo.c
@@ -0,0 +1,445 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_dcvideo.h"
+#include "SDL_dcevents_c.h"
+#include "SDL_dcmouse_c.h"
+
+#include <dc/video.h>
+#include <dc/pvr.h>
+
+
+/* Initialization/Query functions */
+static int DC_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **DC_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *DC_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int DC_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
+static void DC_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int DC_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int DC_LockHWSurface(_THIS, SDL_Surface *surface);
+static void DC_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void DC_FreeHWSurface(_THIS, SDL_Surface *surface);
+static int DC_FlipHWSurface(_THIS, SDL_Surface *surface);
+
+/* etc. */
+static void DC_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
+
+/* OpenGL */
+#if SDL_VIDEO_OPENGL
+static void *DC_GL_GetProcAddress(_THIS, const char *proc);
+static int DC_GL_LoadLibrary(_THIS, const char *path);
+static int DC_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
+static void DC_GL_SwapBuffers(_THIS);
+#endif
+
+/* DC driver bootstrap functions */
+
+static int DC_Available(void)
+{
+ return 1;
+}
+
+static void DC_DeleteDevice(SDL_VideoDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_VideoDevice *DC_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device;
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *device->hidden));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( device ) {
+ SDL_free(device);
+ }
+ return(0);
+ }
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+
+ /* Set the function pointers */
+ device->VideoInit = DC_VideoInit;
+ device->ListModes = DC_ListModes;
+ device->SetVideoMode = DC_SetVideoMode;
+ device->CreateYUVOverlay = NULL;
+ device->SetColors = DC_SetColors;
+ device->UpdateRects = DC_UpdateRects;
+ device->VideoQuit = DC_VideoQuit;
+ device->AllocHWSurface = DC_AllocHWSurface;
+ device->CheckHWBlit = NULL;
+ device->FillHWRect = NULL;
+ device->SetHWColorKey = NULL;
+ device->SetHWAlpha = NULL;
+ device->LockHWSurface = DC_LockHWSurface;
+ device->UnlockHWSurface = DC_UnlockHWSurface;
+ device->FlipHWSurface = DC_FlipHWSurface;
+ device->FreeHWSurface = DC_FreeHWSurface;
+#if SDL_VIDEO_OPENGL
+ device->GL_LoadLibrary = DC_GL_LoadLibrary;
+ device->GL_GetProcAddress = DC_GL_GetProcAddress;
+ device->GL_GetAttribute = DC_GL_GetAttribute;
+ device->GL_MakeCurrent = NULL;
+ device->GL_SwapBuffers = DC_GL_SwapBuffers;
+#endif
+ device->SetCaption = NULL;
+ device->SetIcon = NULL;
+ device->IconifyWindow = NULL;
+ device->GrabInput = NULL;
+ device->GetWMInfo = NULL;
+ device->InitOSKeymap = DC_InitOSKeymap;
+ device->PumpEvents = DC_PumpEvents;
+
+ device->free = DC_DeleteDevice;
+
+ return device;
+}
+
+VideoBootStrap DC_bootstrap = {
+ "dcvideo", "Dreamcast Video",
+ DC_Available, DC_CreateDevice
+};
+
+
+int DC_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ /* Determine the screen depth (use default 16-bit depth) */
+ /* we change this during the SDL_SetVideoMode implementation... */
+ vformat->BitsPerPixel = 16;
+ vformat->Rmask = 0x0000f800;
+ vformat->Gmask = 0x000007e0;
+ vformat->Bmask = 0x0000001f;
+
+ /* We're done! */
+ return(0);
+}
+
+const static SDL_Rect
+ RECT_800x600 = {0,0,800,600},
+ RECT_640x480 = {0,0,640,480},
+ RECT_320x240 = {0,0,320,240};
+const static SDL_Rect *vid_modes[] = {
+ &RECT_800x600,
+ &RECT_640x480,
+ &RECT_320x240,
+ NULL
+};
+
+SDL_Rect **DC_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ switch(format->BitsPerPixel) {
+ case 15:
+ case 16:
+ return &vid_modes;
+ case 32:
+ if (!(flags & SDL_OPENGL))
+ return &vid_modes;
+ default:
+ return NULL;
+ }
+// return (SDL_Rect **) -1;
+}
+
+pvr_init_params_t params = {
+ /* Enable opaque and translucent polygons with size 16 */
+ { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16 },
+
+ /* Vertex buffer size */
+ 512*1024
+};
+
+#if SDL_VIDEO_OPENGL
+static int pvr_inited;
+#endif
+
+SDL_Surface *DC_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ int disp_mode,pixel_mode,pitch;
+ Uint32 Rmask, Gmask, Bmask;
+
+ if (width==320 && height==240) disp_mode=DM_320x240;
+ else if (width==640 && height==480) disp_mode=DM_640x480;
+ else if (width==800 && height==600) disp_mode=DM_800x608;
+ else {
+ SDL_SetError("Couldn't find requested mode in list");
+ return(NULL);
+ }
+
+ switch(bpp) {
+ case 15: pixel_mode = PM_RGB555; pitch = width*2;
+ /* 5-5-5 */
+ Rmask = 0x00007c00;
+ Gmask = 0x000003e0;
+ Bmask = 0x0000001f;
+ break;
+ case 16: pixel_mode = PM_RGB565; pitch = width*2;
+ /* 5-6-5 */
+ Rmask = 0x0000f800;
+ Gmask = 0x000007e0;
+ Bmask = 0x0000001f;
+ break;
+ case 24: bpp = 32;
+ case 32: pixel_mode = PM_RGB888; pitch = width*4;
+ Rmask = 0x00ff0000;
+ Gmask = 0x0000ff00;
+ Bmask = 0x000000ff;
+#if SDL_VIDEO_OPENGL
+ if (!(flags & SDL_OPENGL))
+#endif
+ break;
+ default:
+ SDL_SetError("Couldn't find requested mode in list");
+ return(NULL);
+ }
+
+// if ( bpp != current->format->BitsPerPixel ) {
+ if ( ! SDL_ReallocFormat(current, bpp, Rmask, Gmask, Bmask, 0) ) {
+ return(NULL);
+ }
+// }
+
+ /* Set up the new mode framebuffer */
+ current->flags = (SDL_FULLSCREEN|SDL_HWSURFACE);
+ current->w = width;
+ current->h = height;
+ current->pitch = pitch;
+
+#if SDL_VIDEO_OPENGL
+ if (pvr_inited) {
+ pvr_inited = 0;
+ pvr_shutdown();
+ }
+#endif
+
+ vid_set_mode(disp_mode,pixel_mode);
+
+ current->pixels = vram_s;
+
+#if SDL_VIDEO_OPENGL
+ if (flags & SDL_OPENGL) {
+ this->gl_config.driver_loaded = 1;
+ current->flags = SDL_FULLSCREEN | SDL_OPENGL;
+ current->pixels = NULL;
+ pvr_inited = 1;
+ pvr_init(&params);
+ glKosInit();
+ glKosBeginFrame();
+ } else
+#endif
+ if (flags | SDL_DOUBLEBUF) {
+ current->flags |= SDL_DOUBLEBUF;
+ current->pixels = (void*)((int)current->pixels | 0x400000);
+ }
+
+ /* We're done */
+ return(current);
+}
+
+/* We don't actually allow hardware surfaces other than the main one */
+static int DC_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(-1);
+}
+static void DC_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+/* We need to wait for vertical retrace on page flipped displays */
+static int DC_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(0);
+}
+
+static void DC_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+static int DC_FlipHWSurface(_THIS, SDL_Surface *surface)
+{
+ if (surface->flags & SDL_DOUBLEBUF) {
+ vid_set_start((int)surface->pixels & 0xffffff);
+ surface->pixels = (void*)((int)surface->pixels ^ 0x400000);
+ }
+ return(0);
+}
+
+static void DC_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
+{
+ /* do nothing. */
+}
+
+static int DC_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ /* do nothing of note. */
+ return(1);
+}
+
+/* Note: If we are terminated, this could be called in the middle of
+ another SDL video routine -- notably UpdateRects.
+*/
+static void DC_VideoQuit(_THIS)
+{
+#if SDL_VIDEO_OPENGL
+ if (pvr_inited) {
+ pvr_inited = 0;
+ pvr_shutdown();
+ }
+#endif
+}
+
+#if SDL_VIDEO_OPENGL
+
+void dmyfunc(void) {}
+
+typedef void (*funcptr)();
+const static struct {
+ char *name;
+ funcptr addr;
+} glfuncs[] = {
+#define DEF(func) {#func,&func}
+ DEF(glBegin),
+ DEF(glBindTexture),
+ DEF(glBlendFunc),
+ DEF(glColor4f),
+// DEF(glCopyImageID),
+ DEF(glDisable),
+ DEF(glEnable),
+ DEF(glEnd),
+ DEF(glFlush),
+ DEF(glGenTextures),
+ DEF(glGetString),
+ DEF(glLoadIdentity),
+ DEF(glMatrixMode),
+ DEF(glOrtho),
+ DEF(glPixelStorei),
+// DEF(glPopAttrib),
+// DEF(glPopClientAttrib),
+ {"glPopAttrib",&dmyfunc},
+ {"glPopClientAttrib",&dmyfunc},
+ DEF(glPopMatrix),
+// DEF(glPushAttrib),
+// DEF(glPushClientAttrib),
+ {"glPushAttrib",&dmyfunc},
+ {"glPushClientAttrib",&dmyfunc},
+ DEF(glPushMatrix),
+ DEF(glTexCoord2f),
+ DEF(glTexEnvf),
+ DEF(glTexImage2D),
+ DEF(glTexParameteri),
+ DEF(glTexSubImage2D),
+ DEF(glVertex2i),
+ DEF(glViewport),
+#undef DEF
+};
+
+static void *DC_GL_GetProcAddress(_THIS, const char *proc)
+{
+ void *ret;
+ int i;
+
+ ret = glKosGetProcAddress(proc);
+ if (ret) return ret;
+
+ for(i=0;i<sizeof(glfuncs)/sizeof(glfuncs[0]);i++) {
+ if (SDL_strcmp(proc,glfuncs[i].name)==0) return glfuncs[i].addr;
+ }
+
+ return NULL;
+}
+
+static int DC_GL_LoadLibrary(_THIS, const char *path)
+{
+ this->gl_config.driver_loaded = 1;
+
+ return 0;
+}
+
+static int DC_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
+{
+ GLenum mesa_attrib;
+ int val;
+
+ switch(attrib) {
+ case SDL_GL_RED_SIZE:
+ val = 5;
+ break;
+ case SDL_GL_GREEN_SIZE:
+ val = 6;
+ break;
+ case SDL_GL_BLUE_SIZE:
+ val = 5;
+ break;
+ case SDL_GL_ALPHA_SIZE:
+ val = 0;
+ break;
+ case SDL_GL_DOUBLEBUFFER:
+ val = 1;
+ break;
+ case SDL_GL_DEPTH_SIZE:
+ val = 16; /* or 32? */
+ break;
+ case SDL_GL_STENCIL_SIZE:
+ val = 0;
+ break;
+ case SDL_GL_ACCUM_RED_SIZE:
+ val = 0;
+ break;
+ case SDL_GL_ACCUM_GREEN_SIZE:
+ val = 0;
+ case SDL_GL_ACCUM_BLUE_SIZE:
+ val = 0;
+ break;
+ case SDL_GL_ACCUM_ALPHA_SIZE:
+ val = 0;
+ break;
+ default :
+ return -1;
+ }
+ *value = val;
+ return 0;
+}
+
+static void DC_GL_SwapBuffers(_THIS)
+{
+ glKosFinishFrame();
+ glKosBeginFrame();
+}
+#endif
diff --git a/distrib/sdl-1.2.15/src/video/dc/SDL_dcvideo.h b/distrib/sdl-1.2.15/src/video/dc/SDL_dcvideo.h
new file mode 100644
index 0000000..837f028
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/dc/SDL_dcvideo.h
@@ -0,0 +1,42 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_dcvideo_h
+#define _SDL_dcvideo_h
+
+#include "SDL_mouse.h"
+#include "SDL_mutex.h"
+#include "../SDL_sysvideo.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+
+/* Private display data */
+
+struct SDL_PrivateVideoData {
+ int w, h;
+ void *buffer;
+};
+
+#endif /* _SDL_dcvideo_h */
diff --git a/distrib/sdl-1.2.15/src/video/default_cursor.h b/distrib/sdl-1.2.15/src/video/default_cursor.h
new file mode 100644
index 0000000..d637223
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/default_cursor.h
@@ -0,0 +1,116 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Default cursor - it happens to be the Mac cursor, but could be anything */
+
+#define DEFAULT_CWIDTH 16
+#define DEFAULT_CHEIGHT 16
+#define DEFAULT_CHOTX 0
+#define DEFAULT_CHOTY 0
+
+/* Added a real MacOS cursor, at the request of Luc-Olivier de Charrière */
+#define USE_MACOS_CURSOR
+
+#ifdef USE_MACOS_CURSOR
+
+static unsigned char default_cdata[] =
+{
+ 0x00,0x00,
+ 0x40,0x00,
+ 0x60,0x00,
+ 0x70,0x00,
+ 0x78,0x00,
+ 0x7C,0x00,
+ 0x7E,0x00,
+ 0x7F,0x00,
+ 0x7F,0x80,
+ 0x7C,0x00,
+ 0x6C,0x00,
+ 0x46,0x00,
+ 0x06,0x00,
+ 0x03,0x00,
+ 0x03,0x00,
+ 0x00,0x00
+};
+static unsigned char default_cmask[] =
+{
+ 0xC0,0x00,
+ 0xE0,0x00,
+ 0xF0,0x00,
+ 0xF8,0x00,
+ 0xFC,0x00,
+ 0xFE,0x00,
+ 0xFF,0x00,
+ 0xFF,0x80,
+ 0xFF,0xC0,
+ 0xFF,0xE0,
+ 0xFE,0x00,
+ 0xEF,0x00,
+ 0xCF,0x00,
+ 0x87,0x80,
+ 0x07,0x80,
+ 0x03,0x00
+};
+
+#else
+
+static unsigned char default_cdata[] =
+{
+ 0x00,0x00,
+ 0x40,0x00,
+ 0x60,0x00,
+ 0x70,0x00,
+ 0x78,0x00,
+ 0x7C,0x00,
+ 0x7E,0x00,
+ 0x7F,0x00,
+ 0x7F,0x80,
+ 0x7C,0x00,
+ 0x6C,0x00,
+ 0x46,0x00,
+ 0x06,0x00,
+ 0x03,0x00,
+ 0x03,0x00,
+ 0x00,0x00
+};
+static unsigned char default_cmask[] =
+{
+ 0x40,0x00,
+ 0xE0,0x00,
+ 0xF0,0x00,
+ 0xF8,0x00,
+ 0xFC,0x00,
+ 0xFE,0x00,
+ 0xFF,0x00,
+ 0xFF,0x80,
+ 0xFF,0xC0,
+ 0xFF,0x80,
+ 0xFE,0x00,
+ 0xEF,0x00,
+ 0x4F,0x00,
+ 0x07,0x80,
+ 0x07,0x80,
+ 0x03,0x00
+};
+
+#endif /* TRUE_MACINTOSH_CURSOR */
diff --git a/distrib/sdl-1.2.15/src/video/dga/SDL_dgaevents.c b/distrib/sdl-1.2.15/src/video/dga/SDL_dgaevents.c
new file mode 100644
index 0000000..4e6d5f0
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/dga/SDL_dgaevents.c
@@ -0,0 +1,163 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Handle the event stream, converting DGA events into SDL events */
+
+#include <stdio.h>
+#include <X11/Xlib.h>
+#include "../Xext/extensions/xf86dga.h"
+
+#include "SDL_timer.h"
+#include "../SDL_sysvideo.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_dgavideo.h"
+#include "SDL_dgaevents_c.h"
+
+/* get function pointers... */
+#include "../x11/SDL_x11dyn.h"
+
+/* Heheh we're using X11 event code */
+extern int X11_Pending(Display *display);
+extern void X11_InitKeymap(void);
+extern SDLKey X11_TranslateKeycode(Display *display, KeyCode kc);
+
+static int DGA_DispatchEvent(_THIS)
+{
+ int posted;
+ SDL_NAME(XDGAEvent) xevent;
+
+ XNextEvent(DGA_Display, (XEvent *)&xevent);
+
+ posted = 0;
+ xevent.type -= DGA_event_base;
+ switch (xevent.type) {
+
+ /* Mouse motion? */
+ case MotionNotify: {
+ if ( SDL_VideoSurface ) {
+ posted = SDL_PrivateMouseMotion(0, 1,
+ xevent.xmotion.dx, xevent.xmotion.dy);
+ }
+ }
+ break;
+
+ /* Mouse button press? */
+ case ButtonPress: {
+ posted = SDL_PrivateMouseButton(SDL_PRESSED,
+ xevent.xbutton.button, 0, 0);
+ }
+ break;
+
+ /* Mouse button release? */
+ case ButtonRelease: {
+ posted = SDL_PrivateMouseButton(SDL_RELEASED,
+ xevent.xbutton.button, 0, 0);
+ }
+ break;
+
+ /* Key press? */
+ case KeyPress: {
+ SDL_keysym keysym;
+ KeyCode keycode;
+ XKeyEvent xkey;
+
+ SDL_NAME(XDGAKeyEventToXKeyEvent)(&xevent.xkey, &xkey);
+ keycode = xkey.keycode;
+#ifdef DEBUG_XEVENTS
+printf("KeyPress (X11 keycode = 0x%X)\n", xkey.keycode);
+#endif
+ /* Get the translated SDL virtual keysym */
+ keysym.scancode = keycode;
+ keysym.sym = X11_TranslateKeycode(DGA_Display, keycode);
+ keysym.mod = KMOD_NONE;
+ keysym.unicode = 0;
+
+ /* Look up the translated value for the key event */
+ if ( SDL_TranslateUNICODE ) {
+ static XComposeStatus state;
+ char keybuf[32];
+
+ if ( XLookupString(&xkey, keybuf, sizeof(keybuf), NULL, &state) ) {
+ /*
+ * FIXME: XLookupString() may yield more than one
+ * character, so we need a mechanism to allow for
+ * this (perhaps null keypress events with a
+ * unicode value)
+ */
+ keysym.unicode = (Uint8)keybuf[0];
+ }
+ }
+ posted = SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
+ }
+ break;
+
+ /* Key release? */
+ case KeyRelease: {
+ SDL_keysym keysym;
+ KeyCode keycode;
+ XKeyEvent xkey;
+
+ SDL_NAME(XDGAKeyEventToXKeyEvent)(&xevent.xkey, &xkey);
+ keycode = xkey.keycode;
+#ifdef DEBUG_XEVENTS
+printf("KeyRelease (X11 keycode = 0x%X)\n", xkey.keycode);
+#endif
+ /* Get the translated SDL virtual keysym */
+ keysym.scancode = keycode;
+ keysym.sym = X11_TranslateKeycode(DGA_Display, keycode);
+ keysym.mod = KMOD_NONE;
+ keysym.unicode = 0;
+ posted = SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
+ }
+ break;
+ }
+ return(posted);
+}
+
+void DGA_PumpEvents(_THIS)
+{
+ /* Keep processing pending events */
+ LOCK_DISPLAY();
+
+ /* Update activity every five seconds to prevent screensaver. --ryan. */
+ if (!allow_screensaver) {
+ static Uint32 screensaverTicks;
+ Uint32 nowTicks = SDL_GetTicks();
+ if ((nowTicks - screensaverTicks) > 5000) {
+ XResetScreenSaver(DGA_Display);
+ screensaverTicks = nowTicks;
+ }
+ }
+
+ while ( X11_Pending(DGA_Display) ) {
+ DGA_DispatchEvent(this);
+ }
+
+ UNLOCK_DISPLAY();
+}
+
+void DGA_InitOSKeymap(_THIS)
+{
+ X11_InitKeymap();
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/dga/SDL_dgaevents_c.h b/distrib/sdl-1.2.15/src/video/dga/SDL_dgaevents_c.h
new file mode 100644
index 0000000..45f8cc5
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/dga/SDL_dgaevents_c.h
@@ -0,0 +1,28 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_dgavideo.h"
+
+/* Functions to be exported */
+extern void DGA_PumpEvents(_THIS);
+extern void DGA_InitOSKeymap(_THIS);
diff --git a/distrib/sdl-1.2.15/src/video/dga/SDL_dgamouse.c b/distrib/sdl-1.2.15/src/video/dga/SDL_dgamouse.c
new file mode 100644
index 0000000..43bc5d6
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/dga/SDL_dgamouse.c
@@ -0,0 +1,35 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <stdio.h>
+
+#include "SDL_mouse.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_dgavideo.h"
+#include "SDL_dgamouse_c.h"
+
+
+/* The implementation dependent data for the window manager cursor */
+struct WMcursor {
+ int unused;
+};
diff --git a/distrib/sdl-1.2.15/src/video/dga/SDL_dgamouse_c.h b/distrib/sdl-1.2.15/src/video/dga/SDL_dgamouse_c.h
new file mode 100644
index 0000000..4ea8b21
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/dga/SDL_dgamouse_c.h
@@ -0,0 +1,26 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_dgavideo.h"
+
+/* Functions to be exported */
diff --git a/distrib/sdl-1.2.15/src/video/dga/SDL_dgavideo.c b/distrib/sdl-1.2.15/src/video/dga/SDL_dgavideo.c
new file mode 100644
index 0000000..267d5cc
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/dga/SDL_dgavideo.c
@@ -0,0 +1,1101 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* DGA 2.0 based SDL video driver implementation.
+*/
+
+#include <stdio.h>
+
+#include <X11/Xlib.h>
+#include "../Xext/extensions/xf86dga.h"
+
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_dgavideo.h"
+#include "SDL_dgamouse_c.h"
+#include "SDL_dgaevents_c.h"
+
+/* get function pointers... */
+#include "../x11/SDL_x11dyn.h"
+
+/*#define DGA_DEBUG*/
+
+/* Initialization/Query functions */
+static int DGA_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **DGA_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *DGA_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int DGA_SetColors(_THIS, int firstcolor, int ncolors,
+ SDL_Color *colors);
+static int DGA_SetGammaRamp(_THIS, Uint16 *ramp);
+static void DGA_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int DGA_InitHWSurfaces(_THIS, SDL_Surface *screen, Uint8 *base, int size);
+static void DGA_FreeHWSurfaces(_THIS);
+static int DGA_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int DGA_FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color);
+static int DGA_CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst);
+static int DGA_LockHWSurface(_THIS, SDL_Surface *surface);
+static void DGA_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void DGA_FreeHWSurface(_THIS, SDL_Surface *surface);
+static int DGA_FlipHWSurface(_THIS, SDL_Surface *surface);
+
+/* DGA driver bootstrap functions */
+
+static int DGA_Available(void)
+{
+ const char *display = NULL;
+ Display *dpy = NULL;
+ int available = 0;
+
+ /* The driver is available is available if the display is local
+ and the DGA 2.0+ extension is available, and we can map mem.
+ */
+ if ( SDL_X11_LoadSymbols() ) {
+ if ( (SDL_strncmp(XDisplayName(display), ":", 1) == 0) ||
+ (SDL_strncmp(XDisplayName(display), "unix:", 5) == 0) ) {
+ dpy = XOpenDisplay(display);
+ if ( dpy ) {
+ int events, errors, major, minor;
+
+ if ( SDL_NAME(XDGAQueryExtension)(dpy, &events, &errors) &&
+ SDL_NAME(XDGAQueryVersion)(dpy, &major, &minor) ) {
+ int screen;
+
+ screen = DefaultScreen(dpy);
+ if ( (major >= 2) &&
+ SDL_NAME(XDGAOpenFramebuffer)(dpy, screen) ) {
+ available = 1;
+ SDL_NAME(XDGACloseFramebuffer)(dpy, screen);
+ }
+ }
+ XCloseDisplay(dpy);
+ }
+ }
+ SDL_X11_UnloadSymbols();
+ }
+ return(available);
+}
+
+static void DGA_DeleteDevice(SDL_VideoDevice *device)
+{
+ if (device != NULL) {
+ SDL_free(device->hidden);
+ SDL_free(device);
+ SDL_X11_UnloadSymbols();
+ }
+}
+
+static SDL_VideoDevice *DGA_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device = NULL;
+
+ /* Initialize all variables that we clean on shutdown */
+ if (SDL_X11_LoadSymbols()) {
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *device->hidden));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( device ) {
+ SDL_free(device);
+ }
+ SDL_X11_UnloadSymbols();
+ return(0);
+ }
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+
+ /* Set the function pointers */
+ device->VideoInit = DGA_VideoInit;
+ device->ListModes = DGA_ListModes;
+ device->SetVideoMode = DGA_SetVideoMode;
+ device->SetColors = DGA_SetColors;
+ device->UpdateRects = NULL;
+ device->VideoQuit = DGA_VideoQuit;
+ device->AllocHWSurface = DGA_AllocHWSurface;
+ device->CheckHWBlit = DGA_CheckHWBlit;
+ device->FillHWRect = DGA_FillHWRect;
+ device->SetHWColorKey = NULL;
+ device->SetHWAlpha = NULL;
+ device->LockHWSurface = DGA_LockHWSurface;
+ device->UnlockHWSurface = DGA_UnlockHWSurface;
+ device->FlipHWSurface = DGA_FlipHWSurface;
+ device->FreeHWSurface = DGA_FreeHWSurface;
+ device->SetGammaRamp = DGA_SetGammaRamp;
+ device->GetGammaRamp = NULL;
+ device->SetCaption = NULL;
+ device->SetIcon = NULL;
+ device->IconifyWindow = NULL;
+ device->GrabInput = NULL;
+ device->GetWMInfo = NULL;
+ device->InitOSKeymap = DGA_InitOSKeymap;
+ device->PumpEvents = DGA_PumpEvents;
+
+ device->free = DGA_DeleteDevice;
+ }
+
+ return device;
+}
+
+VideoBootStrap DGA_bootstrap = {
+ "dga", "XFree86 DGA 2.0",
+ DGA_Available, DGA_CreateDevice
+};
+
+static int DGA_AddMode(_THIS, int bpp, int w, int h)
+{
+ SDL_Rect *mode;
+ int index;
+ int next_mode;
+
+ /* Check to see if we already have this mode */
+ if ( bpp < 8 ) { /* Not supported */
+ return(0);
+ }
+ index = ((bpp+7)/8)-1;
+ if ( SDL_nummodes[index] > 0 ) {
+ mode = SDL_modelist[index][SDL_nummodes[index]-1];
+ if ( (mode->w == w) && (mode->h == h) ) {
+ return(0);
+ }
+ }
+
+ /* Set up the new video mode rectangle */
+ mode = (SDL_Rect *)SDL_malloc(sizeof *mode);
+ if ( mode == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ mode->x = 0;
+ mode->y = 0;
+ mode->w = w;
+ mode->h = h;
+
+ /* Allocate the new list of modes, and fill in the new mode */
+ next_mode = SDL_nummodes[index];
+ SDL_modelist[index] = (SDL_Rect **)
+ SDL_realloc(SDL_modelist[index], (1+next_mode+1)*sizeof(SDL_Rect *));
+ if ( SDL_modelist[index] == NULL ) {
+ SDL_OutOfMemory();
+ SDL_nummodes[index] = 0;
+ SDL_free(mode);
+ return(-1);
+ }
+ SDL_modelist[index][next_mode] = mode;
+ SDL_modelist[index][next_mode+1] = NULL;
+ SDL_nummodes[index]++;
+
+ return(0);
+}
+
+/* This whole function is a hack. :) */
+static Uint32 get_video_size(_THIS)
+{
+ /* This is a non-exported function from libXxf86dga.a */
+ extern unsigned char *SDL_NAME(XDGAGetMappedMemory)(int screen);
+ FILE *proc;
+ unsigned long mem;
+ unsigned start, stop;
+ char line[BUFSIZ];
+ Uint32 size;
+
+ mem = (unsigned long)SDL_NAME(XDGAGetMappedMemory)(DGA_Screen);
+ size = 0;
+ proc = fopen("/proc/self/maps", "r");
+ if ( proc ) {
+ while ( fgets(line, sizeof(line)-1, proc) ) {
+ SDL_sscanf(line, "%x-%x", &start, &stop);
+ if ( start == mem ) {
+ size = (Uint32)((stop-start)/1024);
+ break;
+ }
+ }
+ fclose(proc);
+ }
+ return(size);
+}
+
+#ifdef DGA_DEBUG
+static void PrintMode(SDL_NAME(XDGAMode) *mode)
+{
+ printf("Mode: %s (%dx%d) at %d bpp (%f refresh, %d pitch) num: %d\n",
+ mode->name,
+ mode->viewportWidth, mode->viewportHeight,
+ mode->depth == 24 ? mode->bitsPerPixel : mode->depth,
+ mode->verticalRefresh, mode->bytesPerScanline, mode->num);
+ printf("\tRGB: 0x%8.8x 0x%8.8x 0x%8.8x (%d - %s)\n",
+ mode->redMask, mode->greenMask, mode->blueMask,
+ mode->visualClass,
+ mode->visualClass == TrueColor ? "truecolor" :
+ mode->visualClass == DirectColor ? "directcolor" :
+ mode->visualClass == PseudoColor ? "pseudocolor" : "unknown");
+ printf("\tFlags: ");
+ if ( mode->flags & XDGAConcurrentAccess )
+ printf(" XDGAConcurrentAccess");
+ if ( mode->flags & XDGASolidFillRect )
+ printf(" XDGASolidFillRect");
+ if ( mode->flags & XDGABlitRect )
+ printf(" XDGABlitRect");
+ if ( mode->flags & XDGABlitTransRect )
+ printf(" XDGABlitTransRect");
+ if ( mode->flags & XDGAPixmap )
+ printf(" XDGAPixmap");
+ if ( mode->flags & XDGAInterlaced )
+ printf(" XDGAInterlaced");
+ if ( mode->flags & XDGADoublescan )
+ printf(" XDGADoublescan");
+ if ( mode->viewportFlags & XDGAFlipRetrace )
+ printf(" XDGAFlipRetrace");
+ if ( mode->viewportFlags & XDGAFlipImmediate )
+ printf(" XDGAFlipImmediate");
+ printf("\n");
+}
+#endif /* DGA_DEBUG */
+
+static int cmpmodes(const void *va, const void *vb)
+{
+ const SDL_NAME(XDGAMode) *a = (const SDL_NAME(XDGAMode) *)va;
+ const SDL_NAME(XDGAMode) *b = (const SDL_NAME(XDGAMode) *)vb;
+
+ if ( (a->viewportWidth == b->viewportWidth) &&
+ (b->viewportHeight == a->viewportHeight) ) {
+ /* Prefer 32 bpp over 24 bpp, 16 bpp over 15 bpp */
+ int a_bpp = a->depth == 24 ? a->bitsPerPixel : a->depth;
+ int b_bpp = b->depth == 24 ? b->bitsPerPixel : b->depth;
+ if ( a_bpp != b_bpp ) {
+ return b_bpp - a_bpp;
+ }
+ /* Prefer DirectColor visuals, for gamma support */
+ if ( a->visualClass == DirectColor && b->visualClass != DirectColor )
+ return -1;
+ if ( b->visualClass == DirectColor && a->visualClass != DirectColor )
+ return 1;
+ /* Maintain server refresh rate sorting */
+ return a->num - b->num;
+ } else if ( a->viewportWidth == b->viewportWidth ) {
+ return b->viewportHeight - a->viewportHeight;
+ } else {
+ return b->viewportWidth - a->viewportWidth;
+ }
+}
+static void UpdateHWInfo(_THIS, SDL_NAME(XDGAMode) *mode)
+{
+ this->info.wm_available = 0;
+ this->info.hw_available = 1;
+ if ( mode->flags & XDGABlitRect ) {
+ this->info.blit_hw = 1;
+ } else {
+ this->info.blit_hw = 0;
+ }
+ if ( mode->flags & XDGABlitTransRect ) {
+ this->info.blit_hw_CC = 1;
+ } else {
+ this->info.blit_hw_CC = 0;
+ }
+ if ( mode->flags & XDGASolidFillRect ) {
+ this->info.blit_fill = 1;
+ } else {
+ this->info.blit_fill = 0;
+ }
+ this->info.video_mem = get_video_size(this);
+}
+
+static int DGA_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ const char *env;
+ const char *display;
+ int event_base, error_base;
+ int major_version, minor_version;
+ Visual *visual;
+ SDL_NAME(XDGAMode) *modes;
+ int i, num_modes;
+
+ /* Open the X11 display */
+ display = NULL; /* Get it from DISPLAY environment variable */
+
+ DGA_Display = XOpenDisplay(display);
+ if ( DGA_Display == NULL ) {
+ SDL_SetError("Couldn't open X11 display");
+ return(-1);
+ }
+
+ /* Check for the DGA extension */
+ if ( ! SDL_NAME(XDGAQueryExtension)(DGA_Display, &event_base, &error_base) ||
+ ! SDL_NAME(XDGAQueryVersion)(DGA_Display, &major_version, &minor_version) ) {
+ SDL_SetError("DGA extension not available");
+ XCloseDisplay(DGA_Display);
+ return(-1);
+ }
+ if ( major_version < 2 ) {
+ SDL_SetError("DGA driver requires DGA 2.0 or newer");
+ XCloseDisplay(DGA_Display);
+ return(-1);
+ }
+ DGA_event_base = event_base;
+
+ /* Determine the current screen size */
+ this->info.current_w = DisplayWidth(DGA_Display, DGA_Screen);
+ this->info.current_h = DisplayHeight(DGA_Display, DGA_Screen);
+
+ /* Determine the current screen depth */
+ visual = DefaultVisual(DGA_Display, DGA_Screen);
+ {
+ XPixmapFormatValues *pix_format;
+ int i, num_formats;
+
+ vformat->BitsPerPixel = DefaultDepth(DGA_Display, DGA_Screen);
+ pix_format = XListPixmapFormats(DGA_Display, &num_formats);
+ if ( pix_format == NULL ) {
+ SDL_SetError("Couldn't determine screen formats");
+ XCloseDisplay(DGA_Display);
+ return(-1);
+ }
+ for ( i=0; i<num_formats; ++i ) {
+ if ( vformat->BitsPerPixel == pix_format[i].depth )
+ break;
+ }
+ if ( i != num_formats )
+ vformat->BitsPerPixel = pix_format[i].bits_per_pixel;
+ XFree((char *)pix_format);
+ }
+ if ( vformat->BitsPerPixel > 8 ) {
+ vformat->Rmask = visual->red_mask;
+ vformat->Gmask = visual->green_mask;
+ vformat->Bmask = visual->blue_mask;
+ }
+
+ /* Open access to the framebuffer */
+ if ( ! SDL_NAME(XDGAOpenFramebuffer)(DGA_Display, DGA_Screen) ) {
+ SDL_SetError("Unable to map the video memory");
+ XCloseDisplay(DGA_Display);
+ return(-1);
+ }
+
+ /* Allow environment override of screensaver disable. */
+ env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
+ if ( env ) {
+ allow_screensaver = SDL_atoi(env);
+ } else {
+#ifdef SDL_VIDEO_DISABLE_SCREENSAVER
+ allow_screensaver = 0;
+#else
+ allow_screensaver = 1;
+#endif
+ }
+
+ /* Query for the list of available video modes */
+ modes = SDL_NAME(XDGAQueryModes)(DGA_Display, DGA_Screen, &num_modes);
+ SDL_qsort(modes, num_modes, sizeof *modes, cmpmodes);
+ for ( i=0; i<num_modes; ++i ) {
+ if ( ((modes[i].visualClass == PseudoColor) ||
+ (modes[i].visualClass == DirectColor) ||
+ (modes[i].visualClass == TrueColor)) &&
+ !(modes[i].flags & (XDGAInterlaced|XDGADoublescan)) ) {
+#ifdef DGA_DEBUG
+ PrintMode(&modes[i]);
+#endif
+ DGA_AddMode(this, modes[i].bitsPerPixel,
+ modes[i].viewportWidth,
+ modes[i].viewportHeight);
+ }
+ }
+ UpdateHWInfo(this, modes);
+ XFree(modes);
+
+ /* Create the hardware surface lock mutex */
+ hw_lock = SDL_CreateMutex();
+ if ( hw_lock == NULL ) {
+ SDL_SetError("Unable to create lock mutex");
+ DGA_VideoQuit(this);
+ return(-1);
+ }
+
+#ifdef LOCK_DGA_DISPLAY
+ /* Create the event lock so we're thread-safe.. :-/ */
+ event_lock = SDL_CreateMutex();
+#endif /* LOCK_DGA_DISPLAY */
+
+ /* We're done! */
+ return(0);
+}
+
+SDL_Rect **DGA_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ return(SDL_modelist[((format->BitsPerPixel+7)/8)-1]);
+}
+
+/* Various screen update functions available */
+static void DGA_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
+
+SDL_Surface *DGA_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ SDL_NAME(XDGAMode) *modes;
+ int i, num_modes;
+ SDL_NAME(XDGADevice) *mode;
+ int screen_len;
+ Uint8 *surfaces_mem;
+ int surfaces_len;
+
+ /* Free any previous colormap */
+ if ( DGA_colormap ) {
+ XFreeColormap(DGA_Display, DGA_colormap);
+ DGA_colormap = 0;
+ }
+
+ /* Search for a matching video mode */
+ modes = SDL_NAME(XDGAQueryModes)(DGA_Display, DGA_Screen, &num_modes);
+ SDL_qsort(modes, num_modes, sizeof *modes, cmpmodes);
+ for ( i=0; i<num_modes; ++i ) {
+ int depth;
+
+ depth = modes[i].depth;
+ if ( depth == 24 ) { /* Distinguish between 24 and 32 bpp */
+ depth = modes[i].bitsPerPixel;
+ }
+ if ( (depth == bpp) &&
+ (modes[i].viewportWidth == width) &&
+ (modes[i].viewportHeight == height) &&
+ ((modes[i].visualClass == PseudoColor) ||
+ (modes[i].visualClass == DirectColor) ||
+ (modes[i].visualClass == TrueColor)) &&
+ !(modes[i].flags & (XDGAInterlaced|XDGADoublescan)) ) {
+ break;
+ }
+ }
+ if ( i == num_modes ) {
+ SDL_SetError("No matching video mode found");
+ return(NULL);
+ }
+#ifdef DGA_DEBUG
+ PrintMode(&modes[i]);
+#endif
+
+ /* Set the video mode */
+ mode = SDL_NAME(XDGASetMode)(DGA_Display, DGA_Screen, modes[i].num);
+ XFree(modes);
+ if ( mode == NULL ) {
+ SDL_SetError("Unable to switch to requested mode");
+ return(NULL);
+ }
+ DGA_visualClass = mode->mode.visualClass;
+ memory_base = (Uint8 *)mode->data;
+ memory_pitch = mode->mode.bytesPerScanline;
+
+ /* Set up the new mode framebuffer */
+ current->flags = (SDL_FULLSCREEN|SDL_HWSURFACE);
+ current->w = mode->mode.viewportWidth;
+ current->h = mode->mode.viewportHeight;
+ current->pitch = memory_pitch;
+ current->pixels = memory_base;
+ if ( ! SDL_ReallocFormat(current, mode->mode.bitsPerPixel,
+ mode->mode.redMask,
+ mode->mode.greenMask,
+ mode->mode.blueMask, 0) ) {
+ return(NULL);
+ }
+ screen_len = current->h*current->pitch;
+
+ /* Create a colormap if necessary */
+ if ( (DGA_visualClass == PseudoColor) ||
+ (DGA_visualClass == DirectColor) ) {
+ DGA_colormap = SDL_NAME(XDGACreateColormap)(DGA_Display, DGA_Screen,
+ mode, AllocAll);
+ if ( DGA_visualClass == PseudoColor ) {
+ current->flags |= SDL_HWPALETTE;
+ } else {
+ /* Initialize the colormap to the identity mapping */
+ SDL_GetGammaRamp(0, 0, 0);
+ this->screen = current;
+ DGA_SetGammaRamp(this, this->gamma);
+ this->screen = NULL;
+ }
+ } else {
+ DGA_colormap = SDL_NAME(XDGACreateColormap)(DGA_Display, DGA_Screen,
+ mode, AllocNone);
+ }
+ SDL_NAME(XDGAInstallColormap)(DGA_Display, DGA_Screen, DGA_colormap);
+
+ /* Update the hardware capabilities */
+ UpdateHWInfo(this, &mode->mode);
+
+ /* Set up the information for hardware surfaces */
+ surfaces_mem = (Uint8 *)current->pixels + screen_len;
+ surfaces_len = (mode->mode.imageHeight*current->pitch - screen_len);
+
+ /* Update for double-buffering, if we can */
+ SDL_NAME(XDGASetViewport)(DGA_Display, DGA_Screen, 0, 0, XDGAFlipRetrace);
+ if ( flags & SDL_DOUBLEBUF ) {
+ if ( mode->mode.imageHeight >= (current->h*2) ) {
+ current->flags |= SDL_DOUBLEBUF;
+ flip_page = 0;
+ flip_yoffset[0] = 0;
+ flip_yoffset[1] = current->h;
+ flip_address[0] = memory_base;
+ flip_address[1] = memory_base+screen_len;
+ surfaces_mem += screen_len;
+ surfaces_len -= screen_len;
+ }
+ }
+
+ /* Allocate memory tracking for hardware surfaces */
+ DGA_FreeHWSurfaces(this);
+ if ( surfaces_len < 0 ) {
+ surfaces_len = 0;
+ }
+ DGA_InitHWSurfaces(this, current, surfaces_mem, surfaces_len);
+
+ /* Expose the back buffer as surface memory */
+ if ( current->flags & SDL_DOUBLEBUF ) {
+ this->screen = current;
+ DGA_FlipHWSurface(this, current);
+ this->screen = NULL;
+ }
+
+ /* Set the update rectangle function */
+ this->UpdateRects = DGA_DirectUpdate;
+
+ /* Enable mouse and keyboard support */
+ { long input_mask;
+ input_mask = (KeyPressMask | KeyReleaseMask);
+ input_mask |= (ButtonPressMask | ButtonReleaseMask);
+ input_mask |= PointerMotionMask;
+ SDL_NAME(XDGASelectInput)(DGA_Display, DGA_Screen, input_mask);
+ }
+
+ /* We're done */
+ return(current);
+}
+
+#ifdef DGA_DEBUG
+static void DGA_DumpHWSurfaces(_THIS)
+{
+ vidmem_bucket *bucket;
+
+ printf("Memory left: %d (%d total)\n", surfaces_memleft, surfaces_memtotal);
+ printf("\n");
+ printf(" Base Size\n");
+ for ( bucket=&surfaces; bucket; bucket=bucket->next ) {
+ printf("Bucket: %p, %d (%s)\n", bucket->base, bucket->size, bucket->used ? "used" : "free");
+ if ( bucket->prev ) {
+ if ( bucket->base != bucket->prev->base+bucket->prev->size ) {
+ printf("Warning, corrupt bucket list! (prev)\n");
+ }
+ } else {
+ if ( bucket != &surfaces ) {
+ printf("Warning, corrupt bucket list! (!prev)\n");
+ }
+ }
+ if ( bucket->next ) {
+ if ( bucket->next->base != bucket->base+bucket->size ) {
+ printf("Warning, corrupt bucket list! (next)\n");
+ }
+ }
+ }
+ printf("\n");
+}
+#endif
+
+static int DGA_InitHWSurfaces(_THIS, SDL_Surface *screen, Uint8 *base, int size)
+{
+ vidmem_bucket *bucket;
+
+ surfaces_memtotal = size;
+ surfaces_memleft = size;
+
+ if ( surfaces_memleft > 0 ) {
+ bucket = (vidmem_bucket *)SDL_malloc(sizeof(*bucket));
+ if ( bucket == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ bucket->prev = &surfaces;
+ bucket->used = 0;
+ bucket->dirty = 0;
+ bucket->base = base;
+ bucket->size = size;
+ bucket->next = NULL;
+ } else {
+ bucket = NULL;
+ }
+
+ surfaces.prev = NULL;
+ surfaces.used = 1;
+ surfaces.dirty = 0;
+ surfaces.base = screen->pixels;
+ surfaces.size = (unsigned int)((long)base - (long)surfaces.base);
+ surfaces.next = bucket;
+ screen->hwdata = (struct private_hwdata *)((char*)&surfaces);
+ return(0);
+}
+static void DGA_FreeHWSurfaces(_THIS)
+{
+ vidmem_bucket *bucket, *freeable;
+
+ bucket = surfaces.next;
+ while ( bucket ) {
+ freeable = bucket;
+ bucket = bucket->next;
+ SDL_free(freeable);
+ }
+ surfaces.next = NULL;
+}
+
+static __inline__ void DGA_AddBusySurface(SDL_Surface *surface)
+{
+ ((vidmem_bucket *)surface->hwdata)->dirty = 1;
+}
+
+static __inline__ int DGA_IsSurfaceBusy(SDL_Surface *surface)
+{
+ return ((vidmem_bucket *)surface->hwdata)->dirty;
+}
+
+static __inline__ void DGA_WaitBusySurfaces(_THIS)
+{
+ vidmem_bucket *bucket;
+
+ /* Wait for graphic operations to complete */
+ SDL_NAME(XDGASync)(DGA_Display, DGA_Screen);
+
+ /* Clear all surface dirty bits */
+ for ( bucket=&surfaces; bucket; bucket=bucket->next ) {
+ bucket->dirty = 0;
+ }
+}
+
+static int DGA_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ vidmem_bucket *bucket;
+ int size;
+ int extra;
+ int retval = 0;
+
+/* Temporarily, we only allow surfaces the same width as display.
+ Some blitters require the pitch between two hardware surfaces
+ to be the same. Others have interesting alignment restrictions.
+*/
+if ( surface->pitch > SDL_VideoSurface->pitch ) {
+ SDL_SetError("Surface requested wider than screen");
+ return(-1);
+}
+surface->pitch = SDL_VideoSurface->pitch;
+ size = surface->h * surface->pitch;
+#ifdef DGA_DEBUG
+ fprintf(stderr, "Allocating bucket of %d bytes\n", size);
+#endif
+ LOCK_DISPLAY();
+
+ /* Quick check for available mem */
+ if ( size > surfaces_memleft ) {
+ SDL_SetError("Not enough video memory");
+ retval = -1;
+ goto done;
+ }
+
+ /* Search for an empty bucket big enough */
+ for ( bucket=&surfaces; bucket; bucket=bucket->next ) {
+ if ( ! bucket->used && (size <= bucket->size) ) {
+ break;
+ }
+ }
+ if ( bucket == NULL ) {
+ SDL_SetError("Video memory too fragmented");
+ retval = -1;
+ goto done;
+ }
+
+ /* Create a new bucket for left-over memory */
+ extra = (bucket->size - size);
+ if ( extra ) {
+ vidmem_bucket *newbucket;
+
+#ifdef DGA_DEBUG
+ fprintf(stderr, "Adding new free bucket of %d bytes\n", extra);
+#endif
+ newbucket = (vidmem_bucket *)SDL_malloc(sizeof(*newbucket));
+ if ( newbucket == NULL ) {
+ SDL_OutOfMemory();
+ retval = -1;
+ goto done;
+ }
+ newbucket->prev = bucket;
+ newbucket->used = 0;
+ newbucket->base = bucket->base+size;
+ newbucket->size = extra;
+ newbucket->next = bucket->next;
+ if ( bucket->next ) {
+ bucket->next->prev = newbucket;
+ }
+ bucket->next = newbucket;
+ }
+
+ /* Set the current bucket values and return it! */
+ bucket->used = 1;
+ bucket->size = size;
+ bucket->dirty = 0;
+#ifdef DGA_DEBUG
+ fprintf(stderr, "Allocated %d bytes at %p\n", bucket->size, bucket->base);
+#endif
+ surfaces_memleft -= size;
+ surface->flags |= SDL_HWSURFACE;
+ surface->pixels = bucket->base;
+ surface->hwdata = (struct private_hwdata *)bucket;
+done:
+ UNLOCK_DISPLAY();
+ return(retval);
+}
+static void DGA_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ vidmem_bucket *bucket, *freeable;
+
+ /* Wait for any pending operations involving this surface */
+ if ( DGA_IsSurfaceBusy(surface) ) {
+ LOCK_DISPLAY();
+ DGA_WaitBusySurfaces(this);
+ UNLOCK_DISPLAY();
+ }
+
+ /* Look for the bucket in the current list */
+ for ( bucket=&surfaces; bucket; bucket=bucket->next ) {
+ if ( bucket == (vidmem_bucket *)surface->hwdata ) {
+ break;
+ }
+ }
+ if ( bucket && bucket->used ) {
+ /* Add the memory back to the total */
+#ifdef DGA_DEBUG
+ printf("Freeing bucket of %d bytes\n", bucket->size);
+#endif
+ surfaces_memleft += bucket->size;
+
+ /* Can we merge the space with surrounding buckets? */
+ bucket->used = 0;
+ if ( bucket->next && ! bucket->next->used ) {
+#ifdef DGA_DEBUG
+ printf("Merging with next bucket, for %d total bytes\n", bucket->size+bucket->next->size);
+#endif
+ freeable = bucket->next;
+ bucket->size += bucket->next->size;
+ bucket->next = bucket->next->next;
+ if ( bucket->next ) {
+ bucket->next->prev = bucket;
+ }
+ SDL_free(freeable);
+ }
+ if ( bucket->prev && ! bucket->prev->used ) {
+#ifdef DGA_DEBUG
+ printf("Merging with previous bucket, for %d total bytes\n", bucket->prev->size+bucket->size);
+#endif
+ freeable = bucket;
+ bucket->prev->size += bucket->size;
+ bucket->prev->next = bucket->next;
+ if ( bucket->next ) {
+ bucket->next->prev = bucket->prev;
+ }
+ SDL_free(freeable);
+ }
+ }
+ surface->pixels = NULL;
+ surface->hwdata = NULL;
+}
+
+static __inline__ void DGA_dst_to_xy(_THIS, SDL_Surface *dst, int *x, int *y)
+{
+ *x = (long)((Uint8 *)dst->pixels - memory_base)%memory_pitch;
+ *y = (long)((Uint8 *)dst->pixels - memory_base)/memory_pitch;
+}
+
+static int DGA_FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color)
+{
+ int x, y;
+ unsigned int w, h;
+
+ /* Don't fill the visible part of the screen, wait until flipped */
+ LOCK_DISPLAY();
+ if ( was_flipped && (dst == this->screen) ) {
+ while ( SDL_NAME(XDGAGetViewportStatus)(DGA_Display, DGA_Screen) )
+ /* Keep waiting for the hardware ... */ ;
+ was_flipped = 0;
+ }
+ DGA_dst_to_xy(this, dst, &x, &y);
+ x += rect->x;
+ y += rect->y;
+ w = rect->w;
+ h = rect->h;
+#if 0
+ printf("Hardware accelerated rectangle fill: %dx%d at %d,%d\n", w, h, x, y);
+#endif
+ SDL_NAME(XDGAFillRectangle)(DGA_Display, DGA_Screen, x, y, w, h, color);
+ if ( !(this->screen->flags & SDL_DOUBLEBUF) ) {
+ XFlush(DGA_Display);
+ }
+ DGA_AddBusySurface(dst);
+ UNLOCK_DISPLAY();
+ return(0);
+}
+
+static int HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect)
+{
+ SDL_VideoDevice *this;
+ int srcx, srcy;
+ int dstx, dsty;
+ unsigned int w, h;
+
+ this = current_video;
+ /* Don't blit to the visible part of the screen, wait until flipped */
+ LOCK_DISPLAY();
+ if ( was_flipped && (dst == this->screen) ) {
+ while ( SDL_NAME(XDGAGetViewportStatus)(DGA_Display, DGA_Screen) )
+ /* Keep waiting for the hardware ... */ ;
+ was_flipped = 0;
+ }
+ DGA_dst_to_xy(this, src, &srcx, &srcy);
+ srcx += srcrect->x;
+ srcy += srcrect->y;
+ DGA_dst_to_xy(this, dst, &dstx, &dsty);
+ dstx += dstrect->x;
+ dsty += dstrect->y;
+ w = srcrect->w;
+ h = srcrect->h;
+#if 0
+ printf("Blitting %dx%d from %d,%d to %d,%d\n", w, h, srcx, srcy, dstx, dsty);
+#endif
+ if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
+ SDL_NAME(XDGACopyTransparentArea)(DGA_Display, DGA_Screen,
+ srcx, srcy, w, h, dstx, dsty, src->format->colorkey);
+ } else {
+ SDL_NAME(XDGACopyArea)(DGA_Display, DGA_Screen,
+ srcx, srcy, w, h, dstx, dsty);
+ }
+ if ( !(this->screen->flags & SDL_DOUBLEBUF) ) {
+ XFlush(DGA_Display);
+ }
+ DGA_AddBusySurface(src);
+ DGA_AddBusySurface(dst);
+ UNLOCK_DISPLAY();
+ return(0);
+}
+
+static int DGA_CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst)
+{
+ int accelerated;
+
+ /* Set initial acceleration on */
+ src->flags |= SDL_HWACCEL;
+
+ /* Set the surface attributes */
+ if ( (src->flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
+ if ( ! this->info.blit_hw_A ) {
+ src->flags &= ~SDL_HWACCEL;
+ }
+ }
+ if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
+ if ( ! this->info.blit_hw_CC ) {
+ src->flags &= ~SDL_HWACCEL;
+ }
+ }
+
+ /* Check to see if final surface blit is accelerated */
+ accelerated = !!(src->flags & SDL_HWACCEL);
+ if ( accelerated ) {
+ src->map->hw_blit = HWAccelBlit;
+ }
+ return(accelerated);
+}
+
+static __inline__ void DGA_WaitFlip(_THIS)
+{
+ if ( was_flipped ) {
+ while ( SDL_NAME(XDGAGetViewportStatus)(DGA_Display, DGA_Screen) )
+ /* Keep waiting for the hardware ... */ ;
+ was_flipped = 0;
+ }
+}
+
+static int DGA_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ if ( surface == this->screen ) {
+ SDL_mutexP(hw_lock);
+ LOCK_DISPLAY();
+ if ( DGA_IsSurfaceBusy(surface) ) {
+ DGA_WaitBusySurfaces(this);
+ }
+ DGA_WaitFlip(this);
+ UNLOCK_DISPLAY();
+ } else {
+ if ( DGA_IsSurfaceBusy(surface) ) {
+ LOCK_DISPLAY();
+ DGA_WaitBusySurfaces(this);
+ UNLOCK_DISPLAY();
+ }
+ }
+ return(0);
+}
+static void DGA_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ if ( surface == this->screen ) {
+ SDL_mutexV(hw_lock);
+ }
+}
+
+static int DGA_FlipHWSurface(_THIS, SDL_Surface *surface)
+{
+ /* Wait for vertical retrace and then flip display */
+ LOCK_DISPLAY();
+ if ( DGA_IsSurfaceBusy(this->screen) ) {
+ DGA_WaitBusySurfaces(this);
+ }
+ DGA_WaitFlip(this);
+ SDL_NAME(XDGASetViewport)(DGA_Display, DGA_Screen,
+ 0, flip_yoffset[flip_page], XDGAFlipRetrace);
+ XFlush(DGA_Display);
+ UNLOCK_DISPLAY();
+ was_flipped = 1;
+ flip_page = !flip_page;
+
+ surface->pixels = flip_address[flip_page];
+ return(0);
+}
+
+static void DGA_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+ /* The application is already updating the visible video memory */
+ return;
+}
+
+static int DGA_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ int i;
+ XColor *xcmap;
+
+ /* This happens on initialization */
+ if ( ! DGA_colormap ) {
+ return(0);
+ }
+ xcmap = SDL_stack_alloc(XColor, ncolors);
+ for ( i=0; i<ncolors; ++i ) {
+ xcmap[i].pixel = firstcolor + i;
+ xcmap[i].red = (colors[i].r<<8)|colors[i].r;
+ xcmap[i].green = (colors[i].g<<8)|colors[i].g;
+ xcmap[i].blue = (colors[i].b<<8)|colors[i].b;
+ xcmap[i].flags = (DoRed|DoGreen|DoBlue);
+ }
+ LOCK_DISPLAY();
+ XStoreColors(DGA_Display, DGA_colormap, xcmap, ncolors);
+ XSync(DGA_Display, False);
+ UNLOCK_DISPLAY();
+ SDL_stack_free(xcmap);
+
+ /* That was easy. :) */
+ return(1);
+}
+
+int DGA_SetGammaRamp(_THIS, Uint16 *ramp)
+{
+ int i, ncolors;
+ XColor xcmap[256];
+
+ /* See if actually setting the gamma is supported */
+ if ( DGA_visualClass != DirectColor ) {
+ SDL_SetError("Gamma correction not supported on this visual");
+ return(-1);
+ }
+
+ /* Calculate the appropriate palette for the given gamma ramp */
+ if ( this->screen->format->BitsPerPixel <= 16 ) {
+ ncolors = 64; /* Is this right? */
+ } else {
+ ncolors = 256;
+ }
+ for ( i=0; i<ncolors; ++i ) {
+ Uint8 c = (256 * i / ncolors);
+ xcmap[i].pixel = SDL_MapRGB(this->screen->format, c, c, c);
+ xcmap[i].red = ramp[0*256+c];
+ xcmap[i].green = ramp[1*256+c];
+ xcmap[i].blue = ramp[2*256+c];
+ xcmap[i].flags = (DoRed|DoGreen|DoBlue);
+ }
+ LOCK_DISPLAY();
+ XStoreColors(DGA_Display, DGA_colormap, xcmap, ncolors);
+ XSync(DGA_Display, False);
+ UNLOCK_DISPLAY();
+ return(0);
+}
+
+void DGA_VideoQuit(_THIS)
+{
+ int i, j;
+
+ if ( DGA_Display ) {
+ /* Free colormap, if necessary */
+ if ( DGA_colormap ) {
+ XFreeColormap(DGA_Display, DGA_colormap);
+ DGA_colormap = 0;
+ }
+
+ /* Unmap memory and reset video mode */
+ SDL_NAME(XDGACloseFramebuffer)(DGA_Display, DGA_Screen);
+ if ( this->screen ) {
+ /* Tell SDL not to free the pixels */
+ DGA_FreeHWSurface(this, this->screen);
+ }
+ SDL_NAME(XDGASetMode)(DGA_Display, DGA_Screen, 0);
+
+ /* Clear the lock mutex */
+ if ( hw_lock != NULL ) {
+ SDL_DestroyMutex(hw_lock);
+ hw_lock = NULL;
+ }
+#ifdef LOCK_DGA_DISPLAY
+ if ( event_lock != NULL ) {
+ SDL_DestroyMutex(event_lock);
+ event_lock = NULL;
+ }
+#endif /* LOCK_DGA_DISPLAY */
+
+ /* Clean up defined video modes */
+ for ( i=0; i<NUM_MODELISTS; ++i ) {
+ if ( SDL_modelist[i] != NULL ) {
+ for ( j=0; SDL_modelist[i][j]; ++j ) {
+ SDL_free(SDL_modelist[i][j]);
+ }
+ SDL_free(SDL_modelist[i]);
+ SDL_modelist[i] = NULL;
+ }
+ }
+
+ /* Clean up the memory bucket list */
+ DGA_FreeHWSurfaces(this);
+
+ /* Close up the display */
+ XCloseDisplay(DGA_Display);
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/dga/SDL_dgavideo.h b/distrib/sdl-1.2.15/src/video/dga/SDL_dgavideo.h
new file mode 100644
index 0000000..bd2ecb8
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/dga/SDL_dgavideo.h
@@ -0,0 +1,124 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_dgavideo_h
+#define _SDL_dgavideo_h
+
+#include <X11/Xlib.h>
+
+/* Apparently some X11 systems can't include this multiple times... */
+#ifndef SDL_INCLUDED_XLIBINT_H
+#define SDL_INCLUDED_XLIBINT_H 1
+#include <X11/Xlibint.h>
+#endif
+
+#include <X11/Xproto.h>
+
+#include "SDL_mouse.h"
+#include "SDL_mutex.h"
+#include "../SDL_sysvideo.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+/* Define this if you need the DGA driver to be thread-safe */
+#define LOCK_DGA_DISPLAY
+#ifdef LOCK_DGA_DISPLAY
+#define LOCK_DISPLAY() SDL_mutexP(event_lock)
+#define UNLOCK_DISPLAY() SDL_mutexV(event_lock)
+#else
+#define LOCK_DISPLAY()
+#define UNLOCK_DISPLAY()
+#endif
+
+
+/* This is the structure we use to keep track of video memory */
+typedef struct vidmem_bucket {
+ struct vidmem_bucket *prev;
+ int used;
+ int dirty;
+ Uint8 *base;
+ unsigned int size;
+ struct vidmem_bucket *next;
+} vidmem_bucket;
+
+/* Private display data */
+struct SDL_PrivateVideoData {
+ Display *DGA_Display;
+ Colormap DGA_colormap;
+ int visualClass;
+
+#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
+ int SDL_nummodes[NUM_MODELISTS];
+ SDL_Rect **SDL_modelist[NUM_MODELISTS];
+
+ /* Information for the video surface */
+ Uint8 *memory_base;
+ int memory_pitch;
+ SDL_mutex *hw_lock;
+ int sync_needed;
+ int was_flipped;
+
+ /* Information for hardware surfaces */
+ vidmem_bucket surfaces;
+ int surfaces_memtotal;
+ int surfaces_memleft;
+
+ /* Information for double-buffering */
+ int flip_page;
+ int flip_yoffset[2];
+ Uint8 *flip_address[2];
+
+ /* Used to handle DGA events */
+ int event_base;
+#ifdef LOCK_DGA_DISPLAY
+ SDL_mutex *event_lock;
+#endif
+
+ /* Screensaver settings */
+ int allow_screensaver;
+};
+
+/* Old variable names */
+#define DGA_Display (this->hidden->DGA_Display)
+#define DGA_Screen DefaultScreen(DGA_Display)
+#define DGA_colormap (this->hidden->DGA_colormap)
+#define DGA_visualClass (this->hidden->visualClass)
+#define memory_base (this->hidden->memory_base)
+#define memory_pitch (this->hidden->memory_pitch)
+#define flip_page (this->hidden->flip_page)
+#define flip_yoffset (this->hidden->flip_yoffset)
+#define flip_address (this->hidden->flip_address)
+#define sync_needed (this->hidden->sync_needed)
+#define was_flipped (this->hidden->was_flipped)
+#define SDL_nummodes (this->hidden->SDL_nummodes)
+#define SDL_modelist (this->hidden->SDL_modelist)
+#define surfaces (this->hidden->surfaces)
+#define surfaces_memtotal (this->hidden->surfaces_memtotal)
+#define surfaces_memleft (this->hidden->surfaces_memleft)
+#define hw_lock (this->hidden->hw_lock)
+#define DGA_event_base (this->hidden->event_base)
+#define event_lock (this->hidden->event_lock)
+#define allow_screensaver (this->hidden->allow_screensaver)
+
+#endif /* _SDL_dgavideo_h */
diff --git a/distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_events.c b/distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_events.c
new file mode 100644
index 0000000..246b75b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_events.c
@@ -0,0 +1,219 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Handle the event stream, converting DirectFB input events into SDL events */
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <termios.h>
+
+#include <directfb.h>
+
+#include "SDL.h"
+#include "../SDL_sysvideo.h"
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_DirectFB_video.h"
+#include "SDL_DirectFB_events.h"
+
+/* The translation tables from a DirectFB keycode to a SDL keysym */
+static SDLKey keymap[256];
+static SDL_keysym *DirectFB_TranslateKey (DFBInputEvent *ev, SDL_keysym *keysym);
+static int DirectFB_TranslateButton (DFBInputEvent *ev);
+
+static int posted = 0;
+
+
+void DirectFB_PumpEvents (_THIS)
+{
+ DFBInputEvent evt;
+
+ while (HIDDEN->eventbuffer->GetEvent (HIDDEN->eventbuffer,
+ DFB_EVENT (&evt)) == DFB_OK)
+ {
+ SDL_keysym keysym;
+
+ switch (evt.type)
+ {
+ case DIET_BUTTONPRESS:
+ posted += SDL_PrivateMouseButton(SDL_PRESSED,
+ DirectFB_TranslateButton (&evt), 0, 0);
+ break;
+ case DIET_BUTTONRELEASE:
+ posted += SDL_PrivateMouseButton(SDL_RELEASED,
+ DirectFB_TranslateButton (&evt), 0, 0);
+ break;
+ case DIET_KEYPRESS:
+ posted += SDL_PrivateKeyboard(SDL_PRESSED, DirectFB_TranslateKey(&evt, &keysym));
+ break;
+ case DIET_KEYRELEASE:
+ posted += SDL_PrivateKeyboard(SDL_RELEASED, DirectFB_TranslateKey(&evt, &keysym));
+ break;
+ case DIET_AXISMOTION:
+ if (evt.flags & DIEF_AXISREL)
+ {
+ if (evt.axis == DIAI_X)
+ posted += SDL_PrivateMouseMotion(0, 1, evt.axisrel, 0);
+ else if (evt.axis == DIAI_Y)
+ posted += SDL_PrivateMouseMotion(0, 1, 0, evt.axisrel);
+ }
+ else if (evt.flags & DIEF_AXISABS)
+ {
+ static int last_x, last_y;
+ if (evt.axis == DIAI_X)
+ last_x = evt.axisabs;
+ else if (evt.axis == DIAI_Y)
+ last_y = evt.axisabs;
+ posted += SDL_PrivateMouseMotion(0, 0, last_x, last_y);
+ }
+ break;
+ default:
+ ;
+ }
+ }
+}
+
+void DirectFB_InitOSKeymap (_THIS)
+{
+ int i;
+
+ /* Initialize the DirectFB key translation table */
+ for (i=0; i<SDL_arraysize(keymap); ++i)
+ keymap[i] = SDLK_UNKNOWN;
+
+ keymap[DIKI_A - DIKI_UNKNOWN] = SDLK_a;
+ keymap[DIKI_B - DIKI_UNKNOWN] = SDLK_b;
+ keymap[DIKI_C - DIKI_UNKNOWN] = SDLK_c;
+ keymap[DIKI_D - DIKI_UNKNOWN] = SDLK_d;
+ keymap[DIKI_E - DIKI_UNKNOWN] = SDLK_e;
+ keymap[DIKI_F - DIKI_UNKNOWN] = SDLK_f;
+ keymap[DIKI_G - DIKI_UNKNOWN] = SDLK_g;
+ keymap[DIKI_H - DIKI_UNKNOWN] = SDLK_h;
+ keymap[DIKI_I - DIKI_UNKNOWN] = SDLK_i;
+ keymap[DIKI_J - DIKI_UNKNOWN] = SDLK_j;
+ keymap[DIKI_K - DIKI_UNKNOWN] = SDLK_k;
+ keymap[DIKI_L - DIKI_UNKNOWN] = SDLK_l;
+ keymap[DIKI_M - DIKI_UNKNOWN] = SDLK_m;
+ keymap[DIKI_N - DIKI_UNKNOWN] = SDLK_n;
+ keymap[DIKI_O - DIKI_UNKNOWN] = SDLK_o;
+ keymap[DIKI_P - DIKI_UNKNOWN] = SDLK_p;
+ keymap[DIKI_Q - DIKI_UNKNOWN] = SDLK_q;
+ keymap[DIKI_R - DIKI_UNKNOWN] = SDLK_r;
+ keymap[DIKI_S - DIKI_UNKNOWN] = SDLK_s;
+ keymap[DIKI_T - DIKI_UNKNOWN] = SDLK_t;
+ keymap[DIKI_U - DIKI_UNKNOWN] = SDLK_u;
+ keymap[DIKI_V - DIKI_UNKNOWN] = SDLK_v;
+ keymap[DIKI_W - DIKI_UNKNOWN] = SDLK_w;
+ keymap[DIKI_X - DIKI_UNKNOWN] = SDLK_x;
+ keymap[DIKI_Y - DIKI_UNKNOWN] = SDLK_y;
+ keymap[DIKI_Z - DIKI_UNKNOWN] = SDLK_z;
+
+ keymap[DIKI_0 - DIKI_UNKNOWN] = SDLK_0;
+ keymap[DIKI_1 - DIKI_UNKNOWN] = SDLK_1;
+ keymap[DIKI_2 - DIKI_UNKNOWN] = SDLK_2;
+ keymap[DIKI_3 - DIKI_UNKNOWN] = SDLK_3;
+ keymap[DIKI_4 - DIKI_UNKNOWN] = SDLK_4;
+ keymap[DIKI_5 - DIKI_UNKNOWN] = SDLK_5;
+ keymap[DIKI_6 - DIKI_UNKNOWN] = SDLK_6;
+ keymap[DIKI_7 - DIKI_UNKNOWN] = SDLK_7;
+ keymap[DIKI_8 - DIKI_UNKNOWN] = SDLK_8;
+ keymap[DIKI_9 - DIKI_UNKNOWN] = SDLK_9;
+
+ keymap[DIKI_F1 - DIKI_UNKNOWN] = SDLK_F1;
+ keymap[DIKI_F2 - DIKI_UNKNOWN] = SDLK_F2;
+ keymap[DIKI_F3 - DIKI_UNKNOWN] = SDLK_F3;
+ keymap[DIKI_F4 - DIKI_UNKNOWN] = SDLK_F4;
+ keymap[DIKI_F5 - DIKI_UNKNOWN] = SDLK_F5;
+ keymap[DIKI_F6 - DIKI_UNKNOWN] = SDLK_F6;
+ keymap[DIKI_F7 - DIKI_UNKNOWN] = SDLK_F7;
+ keymap[DIKI_F8 - DIKI_UNKNOWN] = SDLK_F8;
+ keymap[DIKI_F9 - DIKI_UNKNOWN] = SDLK_F9;
+ keymap[DIKI_F10 - DIKI_UNKNOWN] = SDLK_F10;
+ keymap[DIKI_F11 - DIKI_UNKNOWN] = SDLK_F11;
+ keymap[DIKI_F12 - DIKI_UNKNOWN] = SDLK_F12;
+
+ keymap[DIKI_ESCAPE - DIKI_UNKNOWN] = SDLK_ESCAPE;
+ keymap[DIKI_LEFT - DIKI_UNKNOWN] = SDLK_LEFT;
+ keymap[DIKI_RIGHT - DIKI_UNKNOWN] = SDLK_RIGHT;
+ keymap[DIKI_UP - DIKI_UNKNOWN] = SDLK_UP;
+ keymap[DIKI_DOWN - DIKI_UNKNOWN] = SDLK_DOWN;
+ keymap[DIKI_CONTROL_L - DIKI_UNKNOWN] = SDLK_LCTRL;
+ keymap[DIKI_CONTROL_R - DIKI_UNKNOWN] = SDLK_RCTRL;
+ keymap[DIKI_SHIFT_L - DIKI_UNKNOWN] = SDLK_LSHIFT;
+ keymap[DIKI_SHIFT_R - DIKI_UNKNOWN] = SDLK_RSHIFT;
+ keymap[DIKI_ALT_L - DIKI_UNKNOWN] = SDLK_LALT;
+ keymap[DIKI_ALT_R - DIKI_UNKNOWN] = SDLK_RALT;
+ keymap[DIKI_TAB - DIKI_UNKNOWN] = SDLK_TAB;
+ keymap[DIKI_ENTER - DIKI_UNKNOWN] = SDLK_RETURN;
+ keymap[DIKI_SPACE - DIKI_UNKNOWN] = SDLK_SPACE;
+ keymap[DIKI_BACKSPACE - DIKI_UNKNOWN] = SDLK_BACKSPACE;
+ keymap[DIKI_INSERT - DIKI_UNKNOWN] = SDLK_INSERT;
+ keymap[DIKI_DELETE - DIKI_UNKNOWN] = SDLK_DELETE;
+ keymap[DIKI_HOME - DIKI_UNKNOWN] = SDLK_HOME;
+ keymap[DIKI_END - DIKI_UNKNOWN] = SDLK_END;
+ keymap[DIKI_PAGE_UP - DIKI_UNKNOWN] = SDLK_PAGEUP;
+ keymap[DIKI_PAGE_DOWN - DIKI_UNKNOWN] = SDLK_PAGEDOWN;
+ keymap[DIKI_CAPS_LOCK - DIKI_UNKNOWN] = SDLK_CAPSLOCK;
+ keymap[DIKI_NUM_LOCK - DIKI_UNKNOWN] = SDLK_NUMLOCK;
+ keymap[DIKI_SCROLL_LOCK - DIKI_UNKNOWN] = SDLK_SCROLLOCK;
+ keymap[DIKI_PRINT - DIKI_UNKNOWN] = SDLK_PRINT;
+ keymap[DIKI_PAUSE - DIKI_UNKNOWN] = SDLK_PAUSE;
+ keymap[DIKI_KP_DIV - DIKI_UNKNOWN] = SDLK_KP_DIVIDE;
+ keymap[DIKI_KP_MULT - DIKI_UNKNOWN] = SDLK_KP_MULTIPLY;
+ keymap[DIKI_KP_MINUS - DIKI_UNKNOWN] = SDLK_KP_MINUS;
+ keymap[DIKI_KP_PLUS - DIKI_UNKNOWN] = SDLK_KP_PLUS;
+ keymap[DIKI_KP_ENTER - DIKI_UNKNOWN] = SDLK_KP_ENTER;
+}
+
+
+static SDL_keysym *DirectFB_TranslateKey (DFBInputEvent *ev, SDL_keysym *keysym)
+{
+ /* Set the keysym information */
+ keysym->scancode = ev->key_id;
+ keysym->mod = KMOD_NONE; /* FIXME */
+ keysym->unicode = (DFB_KEY_TYPE (ev->key_symbol) == DIKT_UNICODE) ? ev->key_symbol : 0;
+
+ if (ev->key_symbol > 0 && ev->key_symbol < 128)
+ keysym->sym = ev->key_symbol;
+ else
+ keysym->sym = keymap[ev->key_id - DIKI_UNKNOWN];
+
+ return keysym;
+}
+
+static int DirectFB_TranslateButton (DFBInputEvent *ev)
+{
+ switch (ev->button)
+ {
+ case DIBI_LEFT:
+ return 1;
+ case DIBI_MIDDLE:
+ return 2;
+ case DIBI_RIGHT:
+ return 3;
+ default:
+ return 0;
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_events.h b/distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_events.h
new file mode 100644
index 0000000..20f3967
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_events.h
@@ -0,0 +1,29 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_DirectFB_video.h"
+
+/* Functions to be exported */
+extern void DirectFB_InitOSKeymap(_THIS);
+extern void DirectFB_PumpEvents(_THIS);
+
diff --git a/distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_keys.h b/distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_keys.h
index 2868ee6..2868ee6 100644
--- a/distrib/sdl-1.2.12/src/video/directfb/SDL_DirectFB_keys.h
+++ b/distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_keys.h
diff --git a/distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_video.c b/distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_video.c
new file mode 100644
index 0000000..f665ec6
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_video.c
@@ -0,0 +1,1171 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ MGA CRTC2 support by Thomas Jarosch - tomj@simonv.com
+ CRTC2 support is inspired by mplayer's dfbmga driver
+ written by Ville Syrj��<syrjala@sci.fi>
+*/
+#include "SDL_config.h"
+
+/* DirectFB video driver implementation.
+*/
+
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/mman.h>
+
+#include <directfb.h>
+#include <directfb_version.h>
+
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_DirectFB_video.h"
+#include "SDL_DirectFB_events.h"
+#include "SDL_DirectFB_yuv.h"
+
+/* The implementation dependent data for the window manager cursor */
+struct WMcursor {
+ int unused;
+};
+
+
+/* Initialization/Query functions */
+static int DirectFB_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **DirectFB_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *DirectFB_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int DirectFB_SetColors(_THIS, int firstcolor, int ncolors,
+ SDL_Color *colors);
+static void DirectFB_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int DirectFB_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int DirectFB_FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);
+static int DirectFB_LockHWSurface(_THIS, SDL_Surface *surface);
+static void DirectFB_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void DirectFB_FreeHWSurface(_THIS, SDL_Surface *surface);
+static int DirectFB_CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst);
+static int DirectFB_HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect);
+static int DirectFB_SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key);
+static int DirectFB_SetHWAlpha(_THIS, SDL_Surface *surface, Uint8 alpha);
+static int DirectFB_FlipHWSurface(_THIS, SDL_Surface *surface);
+static int DirectFB_ShowWMCursor(_THIS, WMcursor *cursor);
+
+/* Various screen update functions available */
+static void DirectFB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
+static void DirectFB_WindowedUpdate(_THIS, int numrects, SDL_Rect *rects);
+
+/* This is the rect EnumModes2 uses */
+struct DirectFBEnumRect {
+ SDL_Rect r;
+ struct DirectFBEnumRect* next;
+};
+
+static struct DirectFBEnumRect *enumlist = NULL;
+
+
+/* DirectFB driver bootstrap functions */
+
+static int DirectFB_Available(void)
+{
+ return 1;
+}
+
+static void DirectFB_DeleteDevice(SDL_VideoDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_VideoDevice *DirectFB_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device;
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if (device)
+ {
+ SDL_memset (device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *) malloc (sizeof (*device->hidden));
+ }
+ if (device == NULL || device->hidden == NULL)
+ {
+ SDL_OutOfMemory();
+ if (device)
+ {
+ free (device);
+ }
+ return(0);
+ }
+ SDL_memset (device->hidden, 0, sizeof (*device->hidden));
+
+ /* Set the function pointers */
+ device->VideoInit = DirectFB_VideoInit;
+ device->ListModes = DirectFB_ListModes;
+ device->SetVideoMode = DirectFB_SetVideoMode;
+ device->SetColors = DirectFB_SetColors;
+ device->UpdateRects = NULL;
+ device->CreateYUVOverlay = DirectFB_CreateYUVOverlay;
+ device->VideoQuit = DirectFB_VideoQuit;
+ device->AllocHWSurface = DirectFB_AllocHWSurface;
+ device->CheckHWBlit = DirectFB_CheckHWBlit;
+ device->FillHWRect = DirectFB_FillHWRect;
+ device->SetHWColorKey = DirectFB_SetHWColorKey;
+ device->SetHWAlpha = DirectFB_SetHWAlpha;
+ device->LockHWSurface = DirectFB_LockHWSurface;
+ device->UnlockHWSurface = DirectFB_UnlockHWSurface;
+ device->FlipHWSurface = DirectFB_FlipHWSurface;
+ device->FreeHWSurface = DirectFB_FreeHWSurface;
+ device->ShowWMCursor = DirectFB_ShowWMCursor;
+ device->SetCaption = NULL;
+ device->SetIcon = NULL;
+ device->IconifyWindow = NULL;
+ device->GrabInput = NULL;
+ device->GetWMInfo = NULL;
+ device->InitOSKeymap = DirectFB_InitOSKeymap;
+ device->PumpEvents = DirectFB_PumpEvents;
+
+ device->free = DirectFB_DeleteDevice;
+
+ return device;
+}
+
+VideoBootStrap DirectFB_bootstrap = {
+ "directfb", "DirectFB",
+ DirectFB_Available, DirectFB_CreateDevice
+};
+
+static DFBSurfacePixelFormat GetFormatForBpp (int bpp, IDirectFBDisplayLayer *layer)
+{
+ DFBDisplayLayerConfig dlc;
+ int bytes = (bpp + 7) / 8;
+
+ layer->GetConfiguration (layer, &dlc);
+
+ if (bytes == DFB_BYTES_PER_PIXEL(dlc.pixelformat) && bytes > 1)
+ return dlc.pixelformat;
+
+ switch (bytes)
+ {
+ case 1:
+ return DSPF_LUT8;
+ case 2:
+ return DSPF_RGB16;
+ case 3:
+ return DSPF_RGB24;
+ case 4:
+ return DSPF_RGB32;
+ }
+
+ return DSPF_UNKNOWN;
+}
+
+static DFBEnumerationResult EnumModesCallback (int width,
+ int height,
+ int bpp,
+ void *data)
+{
+ SDL_VideoDevice *this = (SDL_VideoDevice *)data;
+ struct DirectFBEnumRect *enumrect;
+
+ HIDDEN->nummodes++;
+
+ if (enumlist && enumlist->r.w == width && enumlist->r.h == height)
+ return DFENUM_OK;
+
+ enumrect = SDL_calloc(1, sizeof(struct DirectFBEnumRect));
+ if (!enumrect)
+ {
+ SDL_OutOfMemory();
+ return DFENUM_CANCEL;
+ }
+
+ enumrect->r.w = (Uint16)width;
+ enumrect->r.h = (Uint16)height;
+ enumrect->next = enumlist;
+
+ enumlist = enumrect;
+
+ return DFENUM_OK;
+}
+
+struct private_hwdata {
+ IDirectFBSurface *surface;
+ IDirectFBPalette *palette;
+};
+
+void SetDirectFBerror (const char *function, DFBResult code)
+{
+ const char *error = DirectFBErrorString (code);
+
+ if (error)
+ SDL_SetError("%s: %s", function, error);
+ else
+ SDL_SetError("Unknown error code from %s", function);
+}
+
+static DFBSurfacePixelFormat SDLToDFBPixelFormat (SDL_PixelFormat *format)
+{
+ if (format->Rmask && format->Gmask && format->Bmask)
+ {
+ switch (format->BitsPerPixel)
+ {
+ case 8:
+ return DSPF_LUT8;
+
+ case 16:
+ if (format->Rmask == 0xF800 &&
+ format->Gmask == 0x07E0 &&
+ format->Bmask == 0x001F)
+ return DSPF_RGB16;
+ /* fall through */
+
+ case 15:
+ if (format->Rmask == 0x7C00 &&
+ format->Gmask == 0x03E0 &&
+ format->Bmask == 0x001F)
+ return DSPF_ARGB1555;
+ break;
+
+ case 24:
+ if (format->Rmask == 0xFF0000 &&
+ format->Gmask == 0x00FF00 &&
+ format->Bmask == 0x0000FF)
+ return DSPF_RGB24;
+ break;
+
+ case 32:
+ if (format->Rmask == 0xFF0000 &&
+ format->Gmask == 0x00FF00 &&
+ format->Bmask == 0x0000FF)
+ {
+ if (format->Amask == 0xFF000000)
+ return DSPF_ARGB;
+ else
+ return DSPF_RGB32;
+ }
+ break;
+ }
+ }
+ else
+ {
+ switch (format->BitsPerPixel)
+ {
+ case 8:
+ return DSPF_LUT8;
+ case 15:
+ return DSPF_ARGB1555;
+ case 16:
+ return DSPF_RGB16;
+ case 24:
+ return DSPF_RGB24;
+ case 32:
+ return DSPF_RGB32;
+ }
+ }
+
+ return DSPF_UNKNOWN;
+}
+
+static SDL_Palette *AllocatePalette(int size)
+{
+ SDL_Palette *palette;
+ SDL_Color *colors;
+
+ palette = SDL_calloc (1, sizeof(SDL_Palette));
+ if (!palette)
+ {
+ SDL_OutOfMemory();
+ return NULL;
+ }
+
+ colors = SDL_calloc (size, sizeof(SDL_Color));
+ if (!colors)
+ {
+ SDL_OutOfMemory();
+ return NULL;
+ }
+
+ palette->ncolors = size;
+ palette->colors = colors;
+
+ return palette;
+}
+
+static int DFBToSDLPixelFormat (DFBSurfacePixelFormat pixelformat, SDL_PixelFormat *format)
+{
+ format->Amask = format->Rmask = format->Gmask = format->Bmask = 0;
+ format->BitsPerPixel = format->BytesPerPixel = 0;
+
+ switch (pixelformat)
+ {
+ case DSPF_A8:
+ format->Amask = 0x000000FF;
+ break;
+
+ case DSPF_ARGB1555:
+ format->Rmask = 0x00007C00;
+ format->Gmask = 0x000003E0;
+ format->Bmask = 0x0000001F;
+ break;
+
+ case DSPF_RGB16:
+ format->Rmask = 0x0000F800;
+ format->Gmask = 0x000007E0;
+ format->Bmask = 0x0000001F;
+ break;
+
+ case DSPF_ARGB:
+ format->Amask = 0; /* apps don't seem to like that: 0xFF000000; */
+ /* fall through */
+ case DSPF_RGB24:
+ case DSPF_RGB32:
+ format->Rmask = 0x00FF0000;
+ format->Gmask = 0x0000FF00;
+ format->Bmask = 0x000000FF;
+ break;
+
+ case DSPF_LUT8:
+ format->Rmask = 0x000000FF;
+ format->Gmask = 0x000000FF;
+ format->Bmask = 0x000000FF;
+
+ if (!format->palette)
+ format->palette = AllocatePalette(256);
+ break;
+
+ default:
+ fprintf (stderr, "SDL_DirectFB: Unsupported pixelformat (0x%08x)!\n", pixelformat);
+ return -1;
+ }
+
+ format->BitsPerPixel = DFB_BYTES_PER_PIXEL(pixelformat) * 8;
+ format->BytesPerPixel = DFB_BYTES_PER_PIXEL(pixelformat);
+
+ return 0;
+}
+
+
+int DirectFB_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ int i;
+ DFBResult ret;
+#if (DIRECTFB_MAJOR_VERSION == 0) && (DIRECTFB_MINOR_VERSION == 9) && (DIRECTFB_MICRO_VERSION < 23)
+ DFBCardCapabilities caps;
+#else
+ DFBGraphicsDeviceDescription caps;
+#endif
+ DFBDisplayLayerConfig dlc;
+ struct DirectFBEnumRect *rect;
+ IDirectFB *dfb = NULL;
+ IDirectFBDisplayLayer *layer = NULL;
+ IDirectFBEventBuffer *events = NULL;
+
+ HIDDEN->c2layer = NULL, HIDDEN->c2frame = NULL;
+ HIDDEN->enable_mga_crtc2 = 0;
+ HIDDEN->mga_crtc2_stretch_overscan = 1;
+
+ ret = DirectFBInit (NULL, NULL);
+ if (ret)
+ {
+ SetDirectFBerror ("DirectFBInit", ret);
+ goto error;
+ }
+
+ ret = DirectFBCreate (&dfb);
+ if (ret)
+ {
+ SetDirectFBerror ("DirectFBCreate", ret);
+ goto error;
+ }
+
+ ret = dfb->GetDisplayLayer (dfb, DLID_PRIMARY, &layer);
+ if (ret)
+ {
+ SetDirectFBerror ("dfb->GetDisplayLayer", ret);
+ goto error;
+ }
+
+ ret = dfb->CreateInputEventBuffer (dfb, DICAPS_ALL, DFB_FALSE, &events);
+ if (ret)
+ {
+ SetDirectFBerror ("dfb->CreateEventBuffer", ret);
+ goto error;
+ }
+
+ layer->EnableCursor (layer, 1);
+
+ /* Query layer configuration to determine the current mode and pixelformat */
+ layer->GetConfiguration (layer, &dlc);
+
+ /* If current format is not supported use LUT8 as the default */
+ if (DFBToSDLPixelFormat (dlc.pixelformat, vformat))
+ DFBToSDLPixelFormat (DSPF_LUT8, vformat);
+
+ /* Enumerate the available fullscreen modes */
+ ret = dfb->EnumVideoModes (dfb, EnumModesCallback, this);
+ if (ret)
+ {
+ SetDirectFBerror ("dfb->EnumVideoModes", ret);
+ goto error;
+ }
+
+ HIDDEN->modelist = SDL_calloc (HIDDEN->nummodes + 1, sizeof(SDL_Rect *));
+ if (!HIDDEN->modelist)
+ {
+ SDL_OutOfMemory();
+ goto error;
+ }
+
+ for (i = 0, rect = enumlist; rect; ++i, rect = rect->next )
+ {
+ HIDDEN->modelist[i] = &rect->r;
+ }
+
+ HIDDEN->modelist[i] = NULL;
+
+
+ /* Query card capabilities to get the video memory size */
+#if (DIRECTFB_MAJOR_VERSION == 0) && (DIRECTFB_MINOR_VERSION == 9) && (DIRECTFB_MICRO_VERSION < 23)
+ dfb->GetCardCapabilities (dfb, &caps);
+#else
+ dfb->GetDeviceDescription (dfb, &caps);
+#endif
+
+ this->info.wm_available = 1;
+ this->info.hw_available = 1;
+ this->info.blit_hw = 1;
+ this->info.blit_hw_CC = 1;
+ this->info.blit_hw_A = 1;
+ this->info.blit_fill = 1;
+ this->info.video_mem = caps.video_memory / 1024;
+ this->info.current_w = dlc.width;
+ this->info.current_h = dlc.height;
+
+ HIDDEN->initialized = 1;
+ HIDDEN->dfb = dfb;
+ HIDDEN->layer = layer;
+ HIDDEN->eventbuffer = events;
+
+ if (SDL_getenv("SDL_DIRECTFB_MGA_CRTC2") != NULL)
+ HIDDEN->enable_mga_crtc2 = 1;
+
+ if (HIDDEN->enable_mga_crtc2)
+ {
+ DFBDisplayLayerConfig dlc;
+ DFBDisplayLayerConfigFlags failed;
+
+ ret = dfb->GetDisplayLayer (dfb, 2, &HIDDEN->c2layer);
+ if (ret)
+ {
+ SetDirectFBerror ("dfb->GetDisplayLayer(CRTC2)", ret);
+ goto error;
+ }
+
+ ret = HIDDEN->layer->SetCooperativeLevel(HIDDEN->layer, DLSCL_EXCLUSIVE);
+ if (ret)
+ {
+ SetDirectFBerror ("layer->SetCooperativeLevel(CRTC2, EXCLUSIVE)", ret);
+ goto error;
+ }
+
+ ret = HIDDEN->c2layer->SetCooperativeLevel(HIDDEN->c2layer, DLSCL_EXCLUSIVE);
+ if (ret)
+ {
+ SetDirectFBerror ("c2layer->SetCooperativeLevel(CRTC2, EXCLUSIVE)", ret);
+ goto error;
+ }
+
+ HIDDEN->c2layer->SetOpacity(HIDDEN->c2layer, 0x0);
+
+ /* Init the surface here as it got a fixed size */
+ dlc.flags = DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE;
+ dlc.buffermode = DLBM_BACKVIDEO;
+ dlc.pixelformat = DSPF_RGB32;
+
+ ret = HIDDEN->c2layer->TestConfiguration( HIDDEN->c2layer, &dlc, &failed );
+ if (ret)
+ {
+ SetDirectFBerror ("c2layer->TestConfiguration", ret);
+ goto error;
+ }
+
+ ret = HIDDEN->c2layer->SetConfiguration( HIDDEN->c2layer, &dlc );
+ if (ret)
+ {
+ SetDirectFBerror ("c2layer->SetConfiguration", ret);
+ goto error;
+ }
+
+ ret = HIDDEN->c2layer->GetSurface( HIDDEN->c2layer, &HIDDEN->c2frame );
+ if (ret)
+ {
+ SetDirectFBerror ("c2layer->GetSurface", ret);
+ goto error;
+ }
+
+ HIDDEN->c2framesize.x = 0;
+ HIDDEN->c2framesize.y = 0;
+ HIDDEN->c2frame->GetSize( HIDDEN->c2frame, &HIDDEN->c2framesize.w, &HIDDEN->c2framesize.h);
+
+ HIDDEN->c2frame->SetBlittingFlags( HIDDEN->c2frame, DSBLIT_NOFX );
+ HIDDEN->c2frame->SetColor( HIDDEN->c2frame, 0, 0, 0, 0xff );
+
+ /* Clear CRTC2 */
+ HIDDEN->c2frame->Clear(HIDDEN->c2frame, 0, 0, 0, 0xff );
+ HIDDEN->c2frame->Flip(HIDDEN->c2frame, NULL, 0 );
+ HIDDEN->c2frame->Clear(HIDDEN->c2frame, 0, 0, 0, 0xff );
+ HIDDEN->c2frame->Flip(HIDDEN->c2frame, NULL, 0 );
+ HIDDEN->c2frame->Clear(HIDDEN->c2frame, 0, 0, 0, 0xff );
+
+ HIDDEN->c2layer->SetOpacity(HIDDEN->c2layer, 0xFF );
+
+ /* Check if overscan is possibly set */
+ if (SDL_getenv("SDL_DIRECTFB_MGA_OVERSCAN") != NULL)
+ {
+ float overscan = 0;
+ if (SDL_sscanf(SDL_getenv("SDL_DIRECTFB_MGA_OVERSCAN"), "%f", &overscan) == 1)
+ if (overscan > 0 && overscan < 2)
+ HIDDEN->mga_crtc2_stretch_overscan = overscan;
+ }
+
+ #ifdef DIRECTFB_CRTC2_DEBUG
+ printf("CRTC2 overscan: %f\n", HIDDEN->mga_crtc2_stretch_overscan);
+ #endif
+ }
+
+ return 0;
+
+ error:
+ if (events)
+ events->Release (events);
+
+ if (HIDDEN->c2frame)
+ HIDDEN->c2frame->Release (HIDDEN->c2frame);
+
+ if (HIDDEN->c2layer)
+ HIDDEN->c2layer->Release (HIDDEN->c2layer);
+
+ if (layer)
+ layer->Release (layer);
+
+ if (dfb)
+ dfb->Release (dfb);
+
+ return -1;
+}
+
+static SDL_Rect **DirectFB_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ if (flags & SDL_FULLSCREEN)
+ return HIDDEN->modelist;
+ else
+ if (SDLToDFBPixelFormat (format) != DSPF_UNKNOWN)
+ return (SDL_Rect**) -1;
+
+ return NULL;
+}
+
+static SDL_Surface *DirectFB_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags)
+{
+ DFBResult ret;
+ DFBSurfaceDescription dsc;
+ DFBSurfacePixelFormat pixelformat;
+ IDirectFBSurface *surface;
+
+ fprintf (stderr, "SDL DirectFB_SetVideoMode: %dx%d@%d, flags: 0x%08x\n",
+ width, height, bpp, flags);
+
+ flags |= SDL_FULLSCREEN;
+
+ /* Release previous primary surface */
+ if (current->hwdata && current->hwdata->surface)
+ {
+ current->hwdata->surface->Release (current->hwdata->surface);
+ current->hwdata->surface = NULL;
+
+ /* And its palette if present */
+ if (current->hwdata->palette)
+ {
+ current->hwdata->palette->Release (current->hwdata->palette);
+ current->hwdata->palette = NULL;
+ }
+ }
+ else if (!current->hwdata)
+ {
+ /* Allocate the hardware acceleration data */
+ current->hwdata = (struct private_hwdata *) SDL_calloc (1, sizeof(*current->hwdata));
+ if (!current->hwdata)
+ {
+ SDL_OutOfMemory();
+ return NULL;
+ }
+ }
+
+ /* Set cooperative level depending on flag SDL_FULLSCREEN */
+ if (flags & SDL_FULLSCREEN)
+ {
+ ret = HIDDEN->dfb->SetCooperativeLevel (HIDDEN->dfb, DFSCL_FULLSCREEN);
+ if (ret && !HIDDEN->enable_mga_crtc2)
+ {
+ DirectFBError ("dfb->SetCooperativeLevel", ret);
+ flags &= ~SDL_FULLSCREEN;
+ }
+ }
+ else
+ HIDDEN->dfb->SetCooperativeLevel (HIDDEN->dfb, DFSCL_NORMAL);
+
+ /* Set video mode */
+ ret = HIDDEN->dfb->SetVideoMode (HIDDEN->dfb, width, height, bpp);
+ if (ret)
+ {
+ if (flags & SDL_FULLSCREEN)
+ {
+ flags &= ~SDL_FULLSCREEN;
+ HIDDEN->dfb->SetCooperativeLevel (HIDDEN->dfb, DFSCL_NORMAL);
+ ret = HIDDEN->dfb->SetVideoMode (HIDDEN->dfb, width, height, bpp);
+ }
+
+ if (ret)
+ {
+ SetDirectFBerror ("dfb->SetVideoMode", ret);
+ return NULL;
+ }
+ }
+
+ /* Create primary surface */
+ dsc.flags = DSDESC_CAPS | DSDESC_PIXELFORMAT;
+ dsc.caps = DSCAPS_PRIMARY | ((flags & SDL_DOUBLEBUF) ? DSCAPS_FLIPPING : 0);
+ dsc.pixelformat = GetFormatForBpp (bpp, HIDDEN->layer);
+
+ ret = HIDDEN->dfb->CreateSurface (HIDDEN->dfb, &dsc, &surface);
+ if (ret && (flags & SDL_DOUBLEBUF))
+ {
+ /* Try without double buffering */
+ dsc.caps &= ~DSCAPS_FLIPPING;
+ ret = HIDDEN->dfb->CreateSurface (HIDDEN->dfb, &dsc, &surface);
+ }
+ if (ret)
+ {
+ SetDirectFBerror ("dfb->CreateSurface", ret);
+ return NULL;
+ }
+
+ current->w = width;
+ current->h = height;
+ current->flags = SDL_HWSURFACE | SDL_PREALLOC;
+
+ if (flags & SDL_FULLSCREEN)
+ {
+ current->flags |= SDL_FULLSCREEN;
+ this->UpdateRects = DirectFB_DirectUpdate;
+ }
+ else
+ this->UpdateRects = DirectFB_WindowedUpdate;
+
+ if (dsc.caps & DSCAPS_FLIPPING)
+ current->flags |= SDL_DOUBLEBUF;
+
+ surface->GetPixelFormat (surface, &pixelformat);
+
+ DFBToSDLPixelFormat (pixelformat, current->format);
+
+ /* Get the surface palette (if supported) */
+ if (DFB_PIXELFORMAT_IS_INDEXED( pixelformat ))
+ {
+ surface->GetPalette (surface, &current->hwdata->palette);
+
+ current->flags |= SDL_HWPALETTE;
+ }
+
+ current->hwdata->surface = surface;
+
+ /* MGA CRTC2 stuff */
+ if (HIDDEN->enable_mga_crtc2)
+ {
+ /* no stretching if c2ssize == c2framesize */
+ HIDDEN->c2ssize.x = 0, HIDDEN->c2ssize.y = 0;
+ HIDDEN->c2ssize.w = width;
+ HIDDEN->c2ssize.h = height;
+
+ HIDDEN->c2dsize.x = 0, HIDDEN->c2dsize.y = 0;
+ HIDDEN->c2dsize.w = width;
+ HIDDEN->c2dsize.h = height;
+
+ HIDDEN->mga_crtc2_stretch = 0;
+
+ if (SDL_getenv("SDL_DIRECTFB_MGA_STRETCH") != NULL)
+ {
+ /* Normally assume a picture aspect ratio of 4:3 */
+ int zoom_aspect_x = 4, zoom_aspect_y = 3, i, j;
+
+ for (i = 1; i < 20; i++)
+ {
+ for (j = 1; j < 10; j++)
+ {
+ if ((float)width/(float)i*(float)j == height)
+ {
+ zoom_aspect_x = i;
+ zoom_aspect_y = j;
+
+ /* break the loop */
+ i = 21;
+ break;
+ }
+ }
+ }
+
+ #ifdef DIRECTFB_CRTC2_DEBUG
+ printf("Source resolution: X: %d, Y: %d, Aspect ratio: %d:%d\n", width, height, zoom_aspect_x, zoom_aspect_y);
+ printf("CRTC2 resolution: X: %d, Y: %d\n", HIDDEN->c2framesize.w, HIDDEN->c2framesize.h);
+ #endif
+
+ /* don't stretch only slightly smaller/larger images */
+ if ((float)width < (float)HIDDEN->c2framesize.w*0.95 || (float)height < (float)HIDDEN->c2framesize.h*0.95)
+ {
+ while ((float)HIDDEN->c2dsize.w < (float)HIDDEN->c2framesize.w*HIDDEN->mga_crtc2_stretch_overscan && (float)HIDDEN->c2dsize.h < (float)HIDDEN->c2framesize.h*HIDDEN->mga_crtc2_stretch_overscan)
+ {
+ HIDDEN->c2dsize.w+=zoom_aspect_x;
+ HIDDEN->c2dsize.h+=zoom_aspect_y;
+ }
+
+ /* one step down */
+ HIDDEN->c2dsize.w-=zoom_aspect_x;
+ HIDDEN->c2dsize.h-=zoom_aspect_y;
+
+ #ifdef DIRECTFB_CRTC2_DEBUG
+ printf("Stretched resolution: X: %d, Y: %d\n", HIDDEN->c2dsize.w, HIDDEN->c2dsize.h);
+ #endif
+
+ HIDDEN->mga_crtc2_stretch = 1;
+ }
+ else if ((float)width > (float)HIDDEN->c2framesize.w*0.95 || (float)height > (float)HIDDEN->c2framesize.h*0.95)
+ {
+ while ((float)HIDDEN->c2dsize.w > (float)HIDDEN->c2framesize.w*HIDDEN->mga_crtc2_stretch_overscan || (float)HIDDEN->c2dsize.h > (float)HIDDEN->c2framesize.h*HIDDEN->mga_crtc2_stretch_overscan)
+ {
+ HIDDEN->c2dsize.w-=zoom_aspect_x;
+ HIDDEN->c2dsize.h-=zoom_aspect_y;
+ }
+
+ #ifdef DIRECTFB_CRTC2_DEBUG
+ printf("Down-Stretched resolution: X: %d, Y: %d\n", HIDDEN->c2dsize.w, HIDDEN->c2dsize.h);
+ #endif
+
+ HIDDEN->mga_crtc2_stretch = 1;
+ } else {
+ #ifdef DIRECTFB_CRTC2_DEBUG
+ printf("Not stretching image\n");
+ #endif
+ }
+
+ /* Panning */
+ if (HIDDEN->c2framesize.w > HIDDEN->c2dsize.w)
+ HIDDEN->c2dsize.x = (HIDDEN->c2framesize.w - HIDDEN->c2dsize.w) / 2;
+ else
+ HIDDEN->c2dsize.x = (HIDDEN->c2dsize.w - HIDDEN->c2framesize.w) / 2;
+
+ if (HIDDEN->c2framesize.h > HIDDEN->c2dsize.h)
+ HIDDEN->c2dsize.y = (HIDDEN->c2framesize.h - HIDDEN->c2dsize.h) / 2;
+ else
+ HIDDEN->c2dsize.y = (HIDDEN->c2dsize.h - HIDDEN->c2framesize.h) / 2;
+
+ #ifdef DIRECTFB_CRTC2_DEBUG
+ printf("CRTC2 position X: %d, Y: %d\n", HIDDEN->c2dsize.x, HIDDEN->c2dsize.y);
+ #endif
+ }
+ }
+
+ return current;
+}
+
+static int DirectFB_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ DFBResult ret;
+ DFBSurfaceDescription dsc;
+
+ /* fprintf(stderr, "SDL: DirectFB_AllocHWSurface (%dx%d@%d, flags: 0x%08x)\n",
+ surface->w, surface->h, surface->format->BitsPerPixel, surface->flags);*/
+
+ if (surface->w < 8 || surface->h < 8)
+ return -1;
+
+ /* fill surface description */
+ dsc.flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT | DSDESC_CAPS;
+ dsc.width = surface->w;
+ dsc.height = surface->h;
+ dsc.caps = (surface->flags & SDL_DOUBLEBUF) ? DSCAPS_FLIPPING : 0;
+
+ /* find the right pixelformat */
+ dsc.pixelformat = SDLToDFBPixelFormat (surface->format);
+ if (dsc.pixelformat == DSPF_UNKNOWN)
+ return -1;
+
+ /* Allocate the hardware acceleration data */
+ surface->hwdata = (struct private_hwdata *) SDL_calloc (1, sizeof(*surface->hwdata));
+ if (surface->hwdata == NULL)
+ {
+ SDL_OutOfMemory();
+ return -1;
+ }
+
+ /* Create the surface */
+ ret = HIDDEN->dfb->CreateSurface (HIDDEN->dfb, &dsc, &surface->hwdata->surface);
+ if (ret)
+ {
+ SetDirectFBerror ("dfb->CreateSurface", ret);
+ free (surface->hwdata);
+ surface->hwdata = NULL;
+ return -1;
+ }
+
+ surface->flags |= SDL_HWSURFACE | SDL_PREALLOC;
+
+ return 0;
+}
+
+static void DirectFB_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ if (surface->hwdata && HIDDEN->initialized)
+ {
+ surface->hwdata->surface->Release (surface->hwdata->surface);
+ free (surface->hwdata);
+ surface->hwdata = NULL;
+ }
+}
+
+static int DirectFB_CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst)
+{
+ /* fprintf(stderr, "SDL: DirectFB_CheckHWBlit (src->hwdata: %p, dst->hwdata: %p)\n",
+ src->hwdata, dst->hwdata);*/
+
+ if (!src->hwdata || !dst->hwdata)
+ return 0;
+
+ src->flags |= SDL_HWACCEL;
+ src->map->hw_blit = DirectFB_HWAccelBlit;
+
+ return 1;
+}
+
+static int DirectFB_HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect)
+{
+ DFBSurfaceBlittingFlags flags = DSBLIT_NOFX;
+
+ DFBRectangle sr = { srcrect->x, srcrect->y, srcrect->w, srcrect->h };
+ DFBRectangle dr = { dstrect->x, dstrect->y, dstrect->w, dstrect->h };
+
+ IDirectFBSurface *surface = dst->hwdata->surface;
+
+ if (src->flags & SDL_SRCCOLORKEY)
+ {
+ flags |= DSBLIT_SRC_COLORKEY;
+ DirectFB_SetHWColorKey (NULL, src, src->format->colorkey);
+ }
+
+ if (src->flags & SDL_SRCALPHA)
+ {
+ flags |= DSBLIT_BLEND_COLORALPHA;
+ surface->SetColor (surface, 0xff, 0xff, 0xff, src->format->alpha);
+ }
+
+ surface->SetBlittingFlags (surface, flags);
+
+ if (sr.w == dr.w && sr.h == dr.h)
+ surface->Blit (surface, src->hwdata->surface, &sr, dr.x, dr.y);
+ else
+ surface->StretchBlit (surface, src->hwdata->surface, &sr, &dr);
+
+ return 0;
+}
+
+static int DirectFB_FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color)
+{
+ SDL_PixelFormat *fmt = dst->format;
+ IDirectFBSurface *surface = dst->hwdata->surface;
+
+ /* ugly */
+ surface->SetColor (surface,
+ (color & fmt->Rmask) >> (fmt->Rshift - fmt->Rloss),
+ (color & fmt->Gmask) >> (fmt->Gshift - fmt->Gloss),
+ (color & fmt->Bmask) << (fmt->Bloss - fmt->Bshift), 0xFF);
+ surface->FillRectangle (surface, dstrect->x, dstrect->y, dstrect->w, dstrect->h);
+
+ return 0;
+}
+
+static int DirectFB_SetHWColorKey(_THIS, SDL_Surface *src, Uint32 key)
+{
+ SDL_PixelFormat *fmt = src->format;
+ IDirectFBSurface *surface = src->hwdata->surface;
+
+ if (fmt->BitsPerPixel == 8)
+ surface->SetSrcColorKeyIndex (surface, key);
+ else
+ /* ugly */
+ surface->SetSrcColorKey (surface,
+ (key & fmt->Rmask) >> (fmt->Rshift - fmt->Rloss),
+ (key & fmt->Gmask) >> (fmt->Gshift - fmt->Gloss),
+ (key & fmt->Bmask) << (fmt->Bloss - fmt->Bshift));
+
+ return 0;
+}
+
+static int DirectFB_SetHWAlpha(_THIS, SDL_Surface *surface, Uint8 alpha)
+{
+ return 0;
+}
+
+static int DirectFB_FlipHWSurface(_THIS, SDL_Surface *surface)
+{
+ if (HIDDEN->enable_mga_crtc2)
+ {
+ int rtn = surface->hwdata->surface->Flip (surface->hwdata->surface, NULL, 0);
+ if (HIDDEN->mga_crtc2_stretch)
+ HIDDEN->c2frame->StretchBlit(HIDDEN->c2frame, surface->hwdata->surface, &HIDDEN->c2ssize, &HIDDEN->c2dsize);
+ else
+ HIDDEN->c2frame->Blit(HIDDEN->c2frame, surface->hwdata->surface, NULL, HIDDEN->c2dsize.x, HIDDEN->c2dsize.y);
+
+ HIDDEN->c2frame->Flip(HIDDEN->c2frame, NULL, DSFLIP_WAITFORSYNC);
+ return rtn;
+ }
+ else
+ return surface->hwdata->surface->Flip (surface->hwdata->surface, NULL, DSFLIP_WAITFORSYNC);
+}
+
+static int DirectFB_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ DFBResult ret;
+ void *data;
+ int pitch;
+
+ ret = surface->hwdata->surface->Lock (surface->hwdata->surface,
+ DSLF_WRITE, &data, &pitch);
+ if (ret)
+ {
+ SetDirectFBerror ("surface->Lock", ret);
+ return -1;
+ }
+
+ surface->pixels = data;
+ surface->pitch = pitch;
+
+ return 0;
+}
+
+static void DirectFB_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ surface->hwdata->surface->Unlock (surface->hwdata->surface);
+ surface->pixels = NULL;
+}
+
+static void DirectFB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+ if (HIDDEN->enable_mga_crtc2)
+ {
+ if (HIDDEN->mga_crtc2_stretch)
+ HIDDEN->c2frame->StretchBlit(HIDDEN->c2frame, this->screen->hwdata->surface, &HIDDEN->c2ssize, &HIDDEN->c2dsize);
+ else
+ HIDDEN->c2frame->Blit(HIDDEN->c2frame, this->screen->hwdata->surface, NULL, HIDDEN->c2dsize.x, HIDDEN->c2dsize.y);
+
+ HIDDEN->c2frame->Flip(HIDDEN->c2frame, NULL, DSFLIP_WAITFORSYNC);
+ }
+}
+
+static void DirectFB_WindowedUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+ DFBRegion region;
+ int i;
+ int region_valid = 0;
+ IDirectFBSurface *surface = this->screen->hwdata->surface;
+
+ for (i=0; i<numrects; ++i)
+ {
+ int x2, y2;
+
+ if ( ! rects[i].w ) /* Clipped? */
+ continue;
+
+ x2 = rects[i].x + rects[i].w - 1;
+ y2 = rects[i].y + rects[i].h - 1;
+
+ if (region_valid)
+ {
+ if (rects[i].x < region.x1)
+ region.x1 = rects[i].x;
+
+ if (rects[i].y < region.y1)
+ region.y1 = rects[i].y;
+
+ if (x2 > region.x2)
+ region.x2 = x2;
+
+ if (y2 > region.y2)
+ region.y2 = y2;
+ }
+ else
+ {
+ region.x1 = rects[i].x;
+ region.y1 = rects[i].y;
+ region.x2 = x2;
+ region.y2 = y2;
+
+ region_valid = 1;
+ }
+ }
+
+ if (region_valid)
+ {
+ if (HIDDEN->enable_mga_crtc2)
+ {
+ if (HIDDEN->mga_crtc2_stretch)
+ HIDDEN->c2frame->StretchBlit(HIDDEN->c2frame, surface, &HIDDEN->c2ssize, &HIDDEN->c2dsize);
+ else
+ HIDDEN->c2frame->Blit(HIDDEN->c2frame, surface, NULL, HIDDEN->c2dsize.x, HIDDEN->c2dsize.y);
+
+ HIDDEN->c2frame->Flip(HIDDEN->c2frame, NULL, DSFLIP_WAITFORSYNC);
+ }
+ else
+ surface->Flip (surface, &region, DSFLIP_WAITFORSYNC);
+ }
+}
+
+int DirectFB_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ IDirectFBPalette *palette = this->screen->hwdata->palette;
+
+ if (!palette)
+ return 0;
+
+ if (firstcolor > 255)
+ return 0;
+
+ if (firstcolor + ncolors > 256)
+ ncolors = 256 - firstcolor;
+
+ if (ncolors > 0)
+ {
+ int i;
+ DFBColor entries[ncolors];
+
+ for (i=0; i<ncolors; i++)
+ {
+ entries[i].a = 0xff;
+ entries[i].r = colors[i].r;
+ entries[i].g = colors[i].g;
+ entries[i].b = colors[i].b;
+ }
+
+ palette->SetEntries (palette, entries, ncolors, firstcolor);
+ }
+
+ return 1;
+}
+
+void DirectFB_VideoQuit(_THIS)
+{
+ struct DirectFBEnumRect *rect = enumlist;
+
+ if (this->screen && this->screen->hwdata)
+ {
+ IDirectFBSurface *surface = this->screen->hwdata->surface;
+ IDirectFBPalette *palette = this->screen->hwdata->palette;
+
+ if (palette)
+ palette->Release (palette);
+
+ if (surface)
+ surface->Release (surface);
+
+ this->screen->hwdata->surface = NULL;
+ this->screen->hwdata->palette = NULL;
+ }
+
+ if (HIDDEN->c2frame)
+ {
+ HIDDEN->c2frame->Release (HIDDEN->c2frame);
+ HIDDEN->c2frame = NULL;
+ }
+
+ if (HIDDEN->eventbuffer)
+ {
+ HIDDEN->eventbuffer->Release (HIDDEN->eventbuffer);
+ HIDDEN->eventbuffer = NULL;
+ }
+
+ if (HIDDEN->c2layer)
+ {
+ HIDDEN->c2layer->Release (HIDDEN->c2layer);
+ HIDDEN->c2layer = NULL;
+ }
+
+ if (HIDDEN->layer)
+ {
+ HIDDEN->layer->Release (HIDDEN->layer);
+ HIDDEN->layer = NULL;
+ }
+
+ if (HIDDEN->dfb)
+ {
+ HIDDEN->dfb->Release (HIDDEN->dfb);
+ HIDDEN->dfb = NULL;
+ }
+
+ /* Free video mode list */
+ if (HIDDEN->modelist)
+ {
+ free (HIDDEN->modelist);
+ HIDDEN->modelist = NULL;
+ }
+
+ /* Free mode enumeration list */
+ while (rect)
+ {
+ struct DirectFBEnumRect *next = rect->next;
+ free (rect);
+ rect = next;
+ }
+ enumlist = NULL;
+
+ HIDDEN->initialized = 0;
+}
+
+
+int DirectFB_ShowWMCursor(_THIS, WMcursor *cursor)
+{
+ /* We can only hide or show the default cursor */
+ if ( cursor == NULL )
+ {
+ HIDDEN->layer->SetCursorOpacity(HIDDEN->layer, 0x00);
+ }
+ else
+ {
+ HIDDEN->layer->SetCursorOpacity(HIDDEN->layer, 0xFF);
+ }
+ return 1;
+}
+
+void DirectFB_FinalQuit(void)
+{
+}
diff --git a/distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_video.h b/distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_video.h
new file mode 100644
index 0000000..e1fa12c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_video.h
@@ -0,0 +1,62 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_DirectFB_video_h
+#define _SDL_DirectFB_video_h
+
+#include <directfb.h>
+
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+
+#define _THIS SDL_VideoDevice *this
+
+/* Private display data */
+
+struct SDL_PrivateVideoData
+{
+ int initialized;
+
+ IDirectFB *dfb;
+ IDirectFBDisplayLayer *layer;
+ IDirectFBEventBuffer *eventbuffer;
+
+ int nummodes;
+ SDL_Rect **modelist;
+
+ /* MGA CRTC2 support */
+ int enable_mga_crtc2;
+ int mga_crtc2_stretch;
+ float mga_crtc2_stretch_overscan;
+ IDirectFBDisplayLayer *c2layer;
+ IDirectFBSurface *c2frame;
+ DFBRectangle c2ssize; /* Real screen size */
+ DFBRectangle c2dsize; /* Stretched screen size */
+ DFBRectangle c2framesize; /* CRTC2 screen size */
+};
+
+#define HIDDEN (this->hidden)
+
+void SetDirectFBerror (const char *function, DFBResult code);
+
+#endif /* _SDL_DirectFB_video_h */
diff --git a/distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_yuv.c b/distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_yuv.c
new file mode 100644
index 0000000..fd0cef1
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_yuv.c
@@ -0,0 +1,290 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This is the DirectFB implementation of YUV video overlays */
+
+#include "SDL_video.h"
+#include "SDL_DirectFB_yuv.h"
+#include "../SDL_yuvfuncs.h"
+
+
+/* The functions used to manipulate software video overlays */
+static struct private_yuvhwfuncs directfb_yuvfuncs = {
+ DirectFB_LockYUVOverlay,
+ DirectFB_UnlockYUVOverlay,
+ DirectFB_DisplayYUVOverlay,
+ DirectFB_FreeYUVOverlay
+};
+
+struct private_yuvhwdata {
+ DFBDisplayLayerID layer_id;
+
+ IDirectFBDisplayLayer *layer;
+ IDirectFBSurface *surface;
+
+ /* These are just so we don't have to allocate them separately */
+ Uint16 pitches[3];
+ Uint8 *planes[3];
+};
+
+static DFBEnumerationResult
+enum_layers_callback( DFBDisplayLayerID id,
+ DFBDisplayLayerDescription desc,
+ void *data )
+{
+ struct private_yuvhwdata *hwdata = (struct private_yuvhwdata *) data;
+
+ /* we don't want the primary */
+ if (id == DLID_PRIMARY)
+ return DFENUM_OK;
+
+ /* take the one with a surface for video */
+ if ((desc.caps & DLCAPS_SURFACE) && (desc.type & DLTF_VIDEO))
+ {
+ hwdata->layer_id = id;
+
+ return DFENUM_CANCEL;
+ }
+
+ return DFENUM_OK;
+}
+
+
+static DFBResult CreateYUVSurface(_THIS, struct private_yuvhwdata *hwdata,
+ int width, int height, Uint32 format)
+{
+ DFBResult ret;
+ IDirectFB *dfb = HIDDEN->dfb;
+ IDirectFBDisplayLayer *layer;
+ DFBDisplayLayerConfig conf;
+
+ ret = dfb->EnumDisplayLayers (dfb, enum_layers_callback, hwdata);
+ if (ret)
+ {
+ SetDirectFBerror("IDirectFB::EnumDisplayLayers", ret);
+ return ret;
+ }
+
+ if (!hwdata->layer_id)
+ return DFB_UNSUPPORTED;
+
+ ret = dfb->GetDisplayLayer (dfb, hwdata->layer_id, &layer);
+ if (ret)
+ {
+ SetDirectFBerror("IDirectFB::GetDisplayLayer", ret);
+ return ret;
+ }
+
+ conf.flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT;
+ conf.width = width;
+ conf.height = height;
+
+ switch (format)
+ {
+ case SDL_YV12_OVERLAY:
+ conf.pixelformat = DSPF_YV12;
+ break;
+ case SDL_IYUV_OVERLAY:
+ conf.pixelformat = DSPF_I420;
+ break;
+ case SDL_YUY2_OVERLAY:
+ conf.pixelformat = DSPF_YUY2;
+ break;
+ case SDL_UYVY_OVERLAY:
+ conf.pixelformat = DSPF_UYVY;
+ break;
+ default:
+ fprintf (stderr, "SDL_DirectFB: Unsupported YUV format (0x%08x)!\n", format);
+ break;
+ }
+
+ /* Need to set coop level or newer DirectFB versions will fail here. */
+ ret = layer->SetCooperativeLevel (layer, DLSCL_ADMINISTRATIVE);
+ if (ret)
+ {
+ SetDirectFBerror("IDirectFBDisplayLayer::SetCooperativeLevel() failed", ret);
+ layer->Release (layer);
+ return ret;
+ }
+
+ ret = layer->SetConfiguration (layer, &conf);
+ if (ret)
+ {
+ SetDirectFBerror("IDirectFBDisplayLayer::SetConfiguration", ret);
+ layer->Release (layer);
+ return ret;
+ }
+
+ ret = layer->GetSurface (layer, &hwdata->surface);
+ if (ret)
+ {
+ SetDirectFBerror("IDirectFBDisplayLayer::GetSurface", ret);
+ layer->Release (layer);
+ return ret;
+ }
+
+ hwdata->layer = layer;
+
+ return DFB_OK;
+}
+
+SDL_Overlay *DirectFB_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display)
+{
+ SDL_Overlay *overlay;
+ struct private_yuvhwdata *hwdata;
+
+ /* Create the overlay structure */
+ overlay = SDL_calloc (1, sizeof(SDL_Overlay));
+ if (!overlay)
+ {
+ SDL_OutOfMemory();
+ return NULL;
+ }
+
+ /* Fill in the basic members */
+ overlay->format = format;
+ overlay->w = width;
+ overlay->h = height;
+
+ /* Set up the YUV surface function structure */
+ overlay->hwfuncs = &directfb_yuvfuncs;
+
+ /* Create the pixel data and lookup tables */
+ hwdata = SDL_calloc(1, sizeof(struct private_yuvhwdata));
+ overlay->hwdata = hwdata;
+ if (!hwdata)
+ {
+ SDL_OutOfMemory();
+ SDL_FreeYUVOverlay (overlay);
+ return NULL;
+ }
+
+ if (CreateYUVSurface (this, hwdata, width, height, format))
+ {
+ SDL_FreeYUVOverlay (overlay);
+ return NULL;
+ }
+
+ overlay->hw_overlay = 1;
+
+ /* Set up the plane pointers */
+ overlay->pitches = hwdata->pitches;
+ overlay->pixels = hwdata->planes;
+ switch (format)
+ {
+ case SDL_YV12_OVERLAY:
+ case SDL_IYUV_OVERLAY:
+ overlay->planes = 3;
+ break;
+ default:
+ overlay->planes = 1;
+ break;
+ }
+
+ /* We're all done.. */
+ return overlay;
+}
+
+int DirectFB_LockYUVOverlay(_THIS, SDL_Overlay *overlay)
+{
+ DFBResult ret;
+ void *data;
+ int pitch;
+ IDirectFBSurface *surface = overlay->hwdata->surface;
+
+ ret = surface->Lock (surface, DSLF_READ | DSLF_WRITE, &data, &pitch);
+ if (ret)
+ {
+ SetDirectFBerror("IDirectFBSurface::Lock", ret);
+ return -1;
+ }
+
+ /* Find the pitch and offset values for the overlay */
+ overlay->pitches[0] = (Uint16) pitch;
+ overlay->pixels[0] = (Uint8*) data;
+
+ switch (overlay->format)
+ {
+ case SDL_YV12_OVERLAY:
+ case SDL_IYUV_OVERLAY:
+ /* Add the two extra planes */
+ overlay->pitches[1] = overlay->pitches[0] / 2;
+ overlay->pitches[2] = overlay->pitches[0] / 2;
+ overlay->pixels[1] = overlay->pixels[0] + overlay->pitches[0] * overlay->h;
+ overlay->pixels[2] = overlay->pixels[1] + overlay->pitches[1] * overlay->h / 2;
+ break;
+ default:
+ /* Only one plane, no worries */
+ break;
+ }
+
+ return 0;
+}
+
+void DirectFB_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay)
+{
+ IDirectFBSurface *surface = overlay->hwdata->surface;
+
+ overlay->pixels[0] = overlay->pixels[1] = overlay->pixels[2] = NULL;
+
+ surface->Unlock (surface);
+}
+
+int DirectFB_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst)
+{
+ DFBResult ret;
+ DFBDisplayLayerConfig conf;
+ IDirectFBDisplayLayer *primary = HIDDEN->layer;
+ IDirectFBDisplayLayer *layer = overlay->hwdata->layer;
+
+ primary->GetConfiguration (primary, &conf);
+
+ ret = layer->SetScreenLocation (layer,
+ dst->x / (float) conf.width, dst->y / (float) conf.height,
+ dst->w / (float) conf.width, dst->h / (float) conf.height );
+ if (ret)
+ {
+ SetDirectFBerror("IDirectFBDisplayLayer::SetScreenLocation", ret);
+ return -1;
+ }
+
+ return 0;
+}
+
+void DirectFB_FreeYUVOverlay(_THIS, SDL_Overlay *overlay)
+{
+ struct private_yuvhwdata *hwdata;
+
+ hwdata = overlay->hwdata;
+ if (hwdata)
+ {
+ if (hwdata->surface)
+ hwdata->surface->Release (hwdata->surface);
+
+ if (hwdata->layer)
+ hwdata->layer->Release (hwdata->layer);
+
+ free (hwdata);
+ }
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_yuv.h b/distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_yuv.h
new file mode 100644
index 0000000..64bc86f
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/directfb/SDL_DirectFB_yuv.h
@@ -0,0 +1,38 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This is the DirectFB implementation of YUV video overlays */
+
+#include "SDL_video.h"
+#include "SDL_DirectFB_video.h"
+
+extern SDL_Overlay *DirectFB_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display);
+
+extern int DirectFB_LockYUVOverlay(_THIS, SDL_Overlay *overlay);
+
+extern void DirectFB_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay);
+
+extern int DirectFB_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst);
+
+extern void DirectFB_FreeYUVOverlay(_THIS, SDL_Overlay *overlay);
+
diff --git a/distrib/sdl-1.2.15/src/video/dummy/SDL_nullevents.c b/distrib/sdl-1.2.15/src/video/dummy/SDL_nullevents.c
new file mode 100644
index 0000000..177fc3f
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/dummy/SDL_nullevents.c
@@ -0,0 +1,45 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Being a null driver, there's no event stream. We just define stubs for
+ most of the API. */
+
+#include "SDL.h"
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_nullvideo.h"
+#include "SDL_nullevents_c.h"
+
+void DUMMY_PumpEvents(_THIS)
+{
+ /* do nothing. */
+}
+
+void DUMMY_InitOSKeymap(_THIS)
+{
+ /* do nothing. */
+}
+
+/* end of SDL_nullevents.c ... */
+
diff --git a/distrib/sdl-1.2.15/src/video/dummy/SDL_nullevents_c.h b/distrib/sdl-1.2.15/src/video/dummy/SDL_nullevents_c.h
new file mode 100644
index 0000000..3b65794
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/dummy/SDL_nullevents_c.h
@@ -0,0 +1,33 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_nullvideo.h"
+
+/* Variables and functions exported by SDL_sysevents.c to other parts
+ of the native video subsystem (SDL_sysvideo.c)
+*/
+extern void DUMMY_InitOSKeymap(_THIS);
+extern void DUMMY_PumpEvents(_THIS);
+
+/* end of SDL_nullevents_c.h ... */
+
diff --git a/distrib/sdl-1.2.15/src/video/dummy/SDL_nullmouse.c b/distrib/sdl-1.2.15/src/video/dummy/SDL_nullmouse.c
new file mode 100644
index 0000000..47daea8
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/dummy/SDL_nullmouse.c
@@ -0,0 +1,33 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_mouse.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_nullmouse_c.h"
+
+
+/* The implementation dependent data for the window manager cursor */
+struct WMcursor {
+ int unused;
+};
diff --git a/distrib/sdl-1.2.15/src/video/dummy/SDL_nullmouse_c.h b/distrib/sdl-1.2.15/src/video/dummy/SDL_nullmouse_c.h
new file mode 100644
index 0000000..479eb0e
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/dummy/SDL_nullmouse_c.h
@@ -0,0 +1,26 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_nullvideo.h"
+
+/* Functions to be exported */
diff --git a/distrib/sdl-1.2.15/src/video/dummy/SDL_nullvideo.c b/distrib/sdl-1.2.15/src/video/dummy/SDL_nullvideo.c
new file mode 100644
index 0000000..7e096e2
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/dummy/SDL_nullvideo.c
@@ -0,0 +1,239 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Dummy SDL video driver implementation; this is just enough to make an
+ * SDL-based application THINK it's got a working video driver, for
+ * applications that call SDL_Init(SDL_INIT_VIDEO) when they don't need it,
+ * and also for use as a collection of stubs when porting SDL to a new
+ * platform for which you haven't yet written a valid video driver.
+ *
+ * This is also a great way to determine bottlenecks: if you think that SDL
+ * is a performance problem for a given platform, enable this driver, and
+ * then see if your application runs faster without video overhead.
+ *
+ * Initial work by Ryan C. Gordon (icculus@icculus.org). A good portion
+ * of this was cut-and-pasted from Stephane Peter's work in the AAlib
+ * SDL video driver. Renamed to "DUMMY" by Sam Lantinga.
+ */
+
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_nullvideo.h"
+#include "SDL_nullevents_c.h"
+#include "SDL_nullmouse_c.h"
+
+#define DUMMYVID_DRIVER_NAME "dummy"
+
+/* Initialization/Query functions */
+static int DUMMY_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **DUMMY_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *DUMMY_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int DUMMY_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
+static void DUMMY_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int DUMMY_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int DUMMY_LockHWSurface(_THIS, SDL_Surface *surface);
+static void DUMMY_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void DUMMY_FreeHWSurface(_THIS, SDL_Surface *surface);
+
+/* etc. */
+static void DUMMY_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
+
+/* DUMMY driver bootstrap functions */
+
+static int DUMMY_Available(void)
+{
+ const char *envr = SDL_getenv("SDL_VIDEODRIVER");
+ if ((envr) && (SDL_strcmp(envr, DUMMYVID_DRIVER_NAME) == 0)) {
+ return(1);
+ }
+
+ return(0);
+}
+
+static void DUMMY_DeleteDevice(SDL_VideoDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_VideoDevice *DUMMY_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device;
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *device->hidden));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( device ) {
+ SDL_free(device);
+ }
+ return(0);
+ }
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+
+ /* Set the function pointers */
+ device->VideoInit = DUMMY_VideoInit;
+ device->ListModes = DUMMY_ListModes;
+ device->SetVideoMode = DUMMY_SetVideoMode;
+ device->CreateYUVOverlay = NULL;
+ device->SetColors = DUMMY_SetColors;
+ device->UpdateRects = DUMMY_UpdateRects;
+ device->VideoQuit = DUMMY_VideoQuit;
+ device->AllocHWSurface = DUMMY_AllocHWSurface;
+ device->CheckHWBlit = NULL;
+ device->FillHWRect = NULL;
+ device->SetHWColorKey = NULL;
+ device->SetHWAlpha = NULL;
+ device->LockHWSurface = DUMMY_LockHWSurface;
+ device->UnlockHWSurface = DUMMY_UnlockHWSurface;
+ device->FlipHWSurface = NULL;
+ device->FreeHWSurface = DUMMY_FreeHWSurface;
+ device->SetCaption = NULL;
+ device->SetIcon = NULL;
+ device->IconifyWindow = NULL;
+ device->GrabInput = NULL;
+ device->GetWMInfo = NULL;
+ device->InitOSKeymap = DUMMY_InitOSKeymap;
+ device->PumpEvents = DUMMY_PumpEvents;
+
+ device->free = DUMMY_DeleteDevice;
+
+ return device;
+}
+
+VideoBootStrap DUMMY_bootstrap = {
+ DUMMYVID_DRIVER_NAME, "SDL dummy video driver",
+ DUMMY_Available, DUMMY_CreateDevice
+};
+
+
+int DUMMY_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ /*
+ fprintf(stderr, "WARNING: You are using the SDL dummy video driver!\n");
+ */
+
+ /* Determine the screen depth (use default 8-bit depth) */
+ /* we change this during the SDL_SetVideoMode implementation... */
+ vformat->BitsPerPixel = 8;
+ vformat->BytesPerPixel = 1;
+
+ /* We're done! */
+ return(0);
+}
+
+SDL_Rect **DUMMY_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ return (SDL_Rect **) -1;
+}
+
+SDL_Surface *DUMMY_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ if ( this->hidden->buffer ) {
+ SDL_free( this->hidden->buffer );
+ }
+
+ this->hidden->buffer = SDL_malloc(width * height * (bpp / 8));
+ if ( ! this->hidden->buffer ) {
+ SDL_SetError("Couldn't allocate buffer for requested mode");
+ return(NULL);
+ }
+
+/* printf("Setting mode %dx%d\n", width, height); */
+
+ SDL_memset(this->hidden->buffer, 0, width * height * (bpp / 8));
+
+ /* Allocate the new pixel format for the screen */
+ if ( ! SDL_ReallocFormat(current, bpp, 0, 0, 0, 0) ) {
+ SDL_free(this->hidden->buffer);
+ this->hidden->buffer = NULL;
+ SDL_SetError("Couldn't allocate new pixel format for requested mode");
+ return(NULL);
+ }
+
+ /* Set up the new mode framebuffer */
+ current->flags = flags & SDL_FULLSCREEN;
+ this->hidden->w = current->w = width;
+ this->hidden->h = current->h = height;
+ current->pitch = current->w * (bpp / 8);
+ current->pixels = this->hidden->buffer;
+
+ /* We're done */
+ return(current);
+}
+
+/* We don't actually allow hardware surfaces other than the main one */
+static int DUMMY_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(-1);
+}
+static void DUMMY_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+/* We need to wait for vertical retrace on page flipped displays */
+static int DUMMY_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(0);
+}
+
+static void DUMMY_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+static void DUMMY_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
+{
+ /* do nothing. */
+}
+
+int DUMMY_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ /* do nothing of note. */
+ return(1);
+}
+
+/* Note: If we are terminated, this could be called in the middle of
+ another SDL video routine -- notably UpdateRects.
+*/
+void DUMMY_VideoQuit(_THIS)
+{
+ if (this->screen->pixels != NULL)
+ {
+ SDL_free(this->screen->pixels);
+ this->screen->pixels = NULL;
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/dummy/SDL_nullvideo.h b/distrib/sdl-1.2.15/src/video/dummy/SDL_nullvideo.h
new file mode 100644
index 0000000..05c19e3
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/dummy/SDL_nullvideo.h
@@ -0,0 +1,40 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_nullvideo_h
+#define _SDL_nullvideo_h
+
+#include "../SDL_sysvideo.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+
+/* Private display data */
+
+struct SDL_PrivateVideoData {
+ int w, h;
+ void *buffer;
+};
+
+#endif /* _SDL_nullvideo_h */
diff --git a/distrib/sdl-1.2.12/src/video/e_log.h b/distrib/sdl-1.2.15/src/video/e_log.h
index 7f8bf71..7f8bf71 100644
--- a/distrib/sdl-1.2.12/src/video/e_log.h
+++ b/distrib/sdl-1.2.15/src/video/e_log.h
diff --git a/distrib/sdl-1.2.12/src/video/e_pow.h b/distrib/sdl-1.2.15/src/video/e_pow.h
index 0aa372a..0aa372a 100644
--- a/distrib/sdl-1.2.12/src/video/e_pow.h
+++ b/distrib/sdl-1.2.15/src/video/e_pow.h
diff --git a/distrib/sdl-1.2.12/src/video/e_sqrt.h b/distrib/sdl-1.2.15/src/video/e_sqrt.h
index 657380e..657380e 100644
--- a/distrib/sdl-1.2.12/src/video/e_sqrt.h
+++ b/distrib/sdl-1.2.15/src/video/e_sqrt.h
diff --git a/distrib/sdl-1.2.15/src/video/fbcon/3dfx_mmio.h b/distrib/sdl-1.2.15/src/video/fbcon/3dfx_mmio.h
new file mode 100644
index 0000000..b641454
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/fbcon/3dfx_mmio.h
@@ -0,0 +1,56 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* 3Dfx register definitions */
+
+#include "3dfx_regs.h"
+
+/* 3Dfx control macros */
+
+#define tdfx_in8(reg) *(volatile Uint8 *)(mapped_io + (reg))
+#define tdfx_in32(reg) *(volatile Uint32 *)(mapped_io + (reg))
+
+#define tdfx_out8(reg,v) *(volatile Uint8 *)(mapped_io + (reg)) = v;
+#define tdfx_out32(reg,v) *(volatile Uint32 *)(mapped_io + (reg)) = v;
+
+
+/* Wait for fifo space */
+#define tdfx_wait(space) \
+{ \
+ while ( (tdfx_in8(TDFX_STATUS) & 0x1F) < space ) \
+ ; \
+}
+
+
+/* Wait for idle accelerator */
+#define tdfx_waitidle() \
+{ \
+ int i = 0; \
+ \
+ tdfx_wait(1); \
+ tdfx_out32(COMMAND_3D, COMMAND_3D_NOP); \
+ do { \
+ i = (tdfx_in32(TDFX_STATUS) & STATUS_BUSY) ? 0 : i + 1; \
+ } while ( i != 3 ); \
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/fbcon/3dfx_regs.h b/distrib/sdl-1.2.15/src/video/fbcon/3dfx_regs.h
new file mode 100644
index 0000000..e86f727
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/fbcon/3dfx_regs.h
@@ -0,0 +1,83 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _3DFX_REGS_H
+#define _3DFX_REGS_H
+
+/* This information comes from the public 3Dfx specs for the Voodoo 3000 */
+
+/* mapped_io register offsets */
+#define TDFX_STATUS 0x00
+
+#define INTCTRL (0x00100000 + 0x04)
+#define CLIP0MIN (0x00100000 + 0x08)
+#define CLIP0MAX (0x00100000 + 0x0c)
+#define DSTBASE (0x00100000 + 0x10)
+#define DSTFORMAT (0x00100000 + 0x14)
+#define SRCCOLORKEYMIN (0x00100000 + 0x18)
+#define SRCCOLORKEYMAX (0x00100000 + 0x1c)
+#define DSTCOLORKEYMIN (0x00100000 + 0x20)
+#define DSTCOLORKEYMAX (0x00100000 + 0x24)
+#define BRESERROR0 (0x00100000 + 0x28)
+#define BRESERROR1 (0x00100000 + 0x2c)
+#define ROP_2D (0x00100000 + 0x30)
+#define SRCBASE (0x00100000 + 0x34)
+#define COMMANDEXTRA_2D (0x00100000 + 0x38)
+#define PATTERN0 (0x00100000 + 0x44)
+#define PATTERN1 (0x00100000 + 0x48)
+#define CLIP1MIN (0x00100000 + 0x4c)
+#define CLIP1MAX (0x00100000 + 0x50)
+#define SRCFORMAT (0x00100000 + 0x54)
+#define SRCSIZE (0x00100000 + 0x58)
+#define SRCXY (0x00100000 + 0x5c)
+#define COLORBACK (0x00100000 + 0x60)
+#define COLORFORE (0x00100000 + 0x64)
+#define DSTSIZE (0x00100000 + 0x68)
+#define DSTXY (0x00100000 + 0x6c)
+#define COMMAND_2D (0x00100000 + 0x70)
+#define LAUNCH_2D (0x00100000 + 0x80)
+#define PATTERNBASE (0x00100000 + 0x100)
+
+#define COMMAND_3D (0x00200000 + 0x120)
+
+/* register bitfields (not all, only as needed) */
+
+#define BIT(x) (1UL << (x))
+
+#define COMMAND_2D_BITBLT 0x01
+#define COMMAND_2D_FILLRECT 0x05
+#define COMMAND_2D_LINE 0x06
+#define COMMAND_2D_POLYGON_FILL 0x08
+#define COMMAND_2D_INITIATE BIT(8)
+#define COMMAND_2D_REVERSELINE BIT(9)
+#define COMMAND_2D_STIPPLELINE BIT(12)
+#define COMMAND_2D_MONOCHROME_PATT BIT(13)
+#define COMMAND_2D_MONOCHROME_TRANSP BIT(16)
+
+#define COMMAND_3D_NOP 0x00
+
+#define STATUS_RETRACE BIT(6)
+#define STATUS_BUSY BIT(9)
+
+#endif /* _3DFX_REGS_H */
+
diff --git a/distrib/sdl-1.2.15/src/video/fbcon/SDL_fb3dfx.c b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fb3dfx.c
new file mode 100644
index 0000000..eb083b8
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fb3dfx.c
@@ -0,0 +1,215 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_video.h"
+#include "../SDL_blit.h"
+#include "SDL_fb3dfx.h"
+#include "3dfx_mmio.h"
+
+
+/* Wait for vertical retrace */
+static void WaitVBL(_THIS)
+{
+ /* find start of retrace */
+ tdfx_waitidle();
+ while( (tdfx_in32(TDFX_STATUS) & STATUS_RETRACE) == STATUS_RETRACE )
+ ;
+ /* wait until we're past the start */
+ while( (tdfx_in32(TDFX_STATUS) & STATUS_RETRACE) == 0 )
+ ;
+}
+static void WaitIdle(_THIS)
+{
+ tdfx_waitidle();
+}
+
+/* Sets video mem colorkey and accelerated blit function */
+static int SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key)
+{
+ return(0);
+}
+
+static int FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color)
+{
+ int bpp;
+ Uint32 dst_base;
+ Uint32 format;
+ int dstX, dstY;
+
+ /* Don't blit to the display surface when switched away */
+ if ( switched_away ) {
+ return -2; /* no hardware access */
+ }
+ if ( dst == this->screen ) {
+ SDL_mutexP(hw_lock);
+ }
+
+ /* Set the destination pixel format */
+ dst_base = ((char *)dst->pixels - mapped_mem);
+ bpp = dst->format->BitsPerPixel;
+ format = dst->pitch | ((bpp+((bpp==8) ? 0 : 8)) << 13);
+
+ /* Calculate source and destination base coordinates */
+ dstX = rect->x;
+ dstY = rect->y;
+
+ /* Execute the fill command */
+ tdfx_wait(6);
+ tdfx_out32(DSTBASE, dst_base);
+ tdfx_out32(DSTFORMAT, format);
+ tdfx_out32(COLORFORE, color);
+ tdfx_out32(COMMAND_2D, COMMAND_2D_FILLRECT);
+ tdfx_out32(DSTSIZE, rect->w | (rect->h << 16));
+ tdfx_out32(LAUNCH_2D, dstX | (dstY << 16));
+
+ FB_AddBusySurface(dst);
+
+ if ( dst == this->screen ) {
+ SDL_mutexV(hw_lock);
+ }
+ return(0);
+}
+
+static int HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect)
+{
+ SDL_VideoDevice *this = current_video;
+ int bpp;
+ Uint32 src_format;
+ Uint32 src_base;
+ Uint32 dst_base;
+ int srcX, srcY;
+ int dstX, dstY;
+ Uint32 blitop;
+ Uint32 use_colorkey;
+
+ /* Don't blit to the display surface when switched away */
+ if ( switched_away ) {
+ return -2; /* no hardware access */
+ }
+ if ( dst == this->screen ) {
+ SDL_mutexP(hw_lock);
+ }
+
+ /* Set the source and destination pixel format */
+ src_base = ((char *)src->pixels - mapped_mem);
+ bpp = src->format->BitsPerPixel;
+ src_format = src->pitch | ((bpp+((bpp==8) ? 0 : 8)) << 13);
+ dst_base = ((char *)dst->pixels - mapped_mem);
+ bpp = dst->format->BitsPerPixel;
+
+ srcX = srcrect->x;
+ srcY = srcrect->y;
+ dstX = dstrect->x;
+ dstY = dstrect->y;
+
+ /* Assemble the blit operation */
+ blitop = COMMAND_2D_BITBLT | (0xCC << 24);
+ if ( srcX <= dstX ) {
+ blitop |= BIT(14);
+ srcX += (dstrect->w - 1);
+ dstX += (dstrect->w - 1);
+ }
+ if ( srcY <= dstY ) {
+ blitop |= BIT(15);
+ srcY += (dstrect->h - 1);
+ dstY += (dstrect->h - 1);
+ }
+
+ /* Perform the blit! */
+ if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
+ tdfx_wait(3);
+ tdfx_out32(SRCCOLORKEYMIN, src->format->colorkey);
+ tdfx_out32(SRCCOLORKEYMAX, src->format->colorkey);
+ tdfx_out32(ROP_2D, 0xAA00);
+ use_colorkey = 1;
+ } else {
+ use_colorkey = 0;
+ }
+ tdfx_wait(9);
+ tdfx_out32(SRCBASE, (Uint32)src_base);
+ tdfx_out32(SRCFORMAT, src_format);
+ tdfx_out32(DSTBASE, (Uint32)dst_base);
+ tdfx_out32(DSTFORMAT, src_format);
+ tdfx_out32(COMMAND_2D, blitop);
+ tdfx_out32(COMMANDEXTRA_2D, use_colorkey);
+ tdfx_out32(DSTSIZE, dstrect->w | (dstrect->h << 16));
+ tdfx_out32(DSTXY, dstX | (dstY << 16));
+ tdfx_out32(LAUNCH_2D, srcX | (srcY << 16));
+
+ FB_AddBusySurface(src);
+ FB_AddBusySurface(dst);
+
+ if ( dst == this->screen ) {
+ SDL_mutexV(hw_lock);
+ }
+ return(0);
+}
+
+static int CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst)
+{
+ int accelerated;
+
+ /* Set initial acceleration on */
+ src->flags |= SDL_HWACCEL;
+
+ /* Set the surface attributes */
+ if ( (src->flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
+ if ( ! this->info.blit_hw_A ) {
+ src->flags &= ~SDL_HWACCEL;
+ }
+ }
+ if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
+ if ( ! this->info.blit_hw_CC ) {
+ src->flags &= ~SDL_HWACCEL;
+ }
+ }
+
+ /* Check to see if final surface blit is accelerated */
+ accelerated = !!(src->flags & SDL_HWACCEL);
+ if ( accelerated ) {
+ src->map->hw_blit = HWAccelBlit;
+ }
+ return(accelerated);
+}
+
+void FB_3DfxAccel(_THIS, __u32 card)
+{
+ /* We have hardware accelerated surface functions */
+ this->CheckHWBlit = CheckHWBlit;
+ wait_vbl = WaitVBL;
+ wait_idle = WaitIdle;
+
+ /* Reset the 3Dfx controller */
+ tdfx_out32(BRESERROR0, 0);
+ tdfx_out32(BRESERROR1, 0);
+
+ /* The 3Dfx has an accelerated color fill */
+ this->info.blit_fill = 1;
+ this->FillHWRect = FillHWRect;
+
+ /* The 3Dfx has accelerated normal and colorkey blits */
+ this->info.blit_hw = 1;
+ this->info.blit_hw_CC = 1;
+ this->SetHWColorKey = SetHWColorKey;
+}
diff --git a/distrib/sdl-1.2.15/src/video/fbcon/SDL_fb3dfx.h b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fb3dfx.h
new file mode 100644
index 0000000..4a59de9
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fb3dfx.h
@@ -0,0 +1,29 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* 3Dfx hardware acceleration for the SDL framebuffer console driver */
+
+#include "SDL_fbvideo.h"
+
+/* Set up the driver for 3Dfx acceleration */
+extern void FB_3DfxAccel(_THIS, __u32 card);
diff --git a/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbelo.c b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbelo.c
new file mode 100644
index 0000000..63dff87
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbelo.c
@@ -0,0 +1,442 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <unistd.h>
+#include <sys/time.h>
+#include <ctype.h>
+
+#include "SDL_stdinc.h"
+#include "SDL_fbvideo.h"
+#include "SDL_fbelo.h"
+
+/*
+ calibration default values
+ values are read from the following environment variables:
+
+ SDL_ELO_MIN_X
+ SDL_ELO_MAX_X
+ SDL_ELO_MIN_Y
+ SDL_ELO_MAX_Y
+*/
+
+static int ELO_MIN_X = 400;
+static int ELO_MAX_X = 3670;
+static int ELO_MIN_Y = 500;
+static int ELO_MAX_Y = 3540;
+
+#define ELO_SNAP_SIZE 6
+#define ELO_TOUCH_BYTE 'T'
+#define ELO_ID 'I'
+#define ELO_MODE 'M'
+#define ELO_PARAMETER 'P'
+#define ELO_REPORT 'B'
+#define ELO_ACK 'A'
+
+#define ELO_INIT_CHECKSUM 0xAA
+
+#define ELO_BTN_PRESS 0x01
+#define ELO_STREAM 0x02
+#define ELO_BTN_RELEASE 0x04
+
+#define ELO_TOUCH_MODE 0x01
+#define ELO_STREAM_MODE 0x02
+#define ELO_UNTOUCH_MODE 0x04
+#define ELO_RANGE_CHECK_MODE 0x40
+#define ELO_TRIM_MODE 0x02
+#define ELO_CALIB_MODE 0x04
+#define ELO_SCALING_MODE 0x08
+#define ELO_TRACKING_MODE 0x40
+
+#define ELO_SERIAL_MASK 0xF8
+
+#define ELO_SERIAL_IO '0'
+
+#define ELO_MAX_TRIALS 3
+#define ELO_MAX_WAIT 100000
+#define ELO_UNTOUCH_DELAY 5
+#define ELO_REPORT_DELAY 1
+
+/* eloParsePacket
+*/
+int eloParsePacket(unsigned char* mousebuf, int* dx, int* dy, int* button_state) {
+ static int elo_button = 0;
+ static int last_x = 0;
+ static int last_y = 0;
+ int x,y;
+
+ /* Check if we have a touch packet */
+ if (mousebuf[1] != ELO_TOUCH_BYTE) {
+ return 0;
+ }
+
+ x = ((mousebuf[4] << 8) | mousebuf[3]);
+ y = ((mousebuf[6] << 8) | mousebuf[5]);
+
+ if((SDL_abs(x - last_x) > ELO_SNAP_SIZE) || (SDL_abs(y - last_y) > ELO_SNAP_SIZE)) {
+ *dx = ((mousebuf[4] << 8) | mousebuf[3]);
+ *dy = ((mousebuf[6] << 8) | mousebuf[5]);
+ }
+ else {
+ *dx = last_x;
+ *dy = last_y;
+ }
+
+ last_x = *dx;
+ last_y = *dy;
+
+ if ( (mousebuf[2] & 0x07) == ELO_BTN_PRESS ) {
+ elo_button = 1;
+ }
+ if ( (mousebuf[2] & 0x07) == ELO_BTN_RELEASE ) {
+ elo_button = 0;
+ }
+
+ *button_state = elo_button;
+ return 1;
+}
+
+/* Convert the raw coordinates from the ELO controller
+ to a screen position.
+*/
+void eloConvertXY(_THIS, int *dx, int *dy) {
+ int input_x = *dx;
+ int input_y = *dy;
+ int width = ELO_MAX_X - ELO_MIN_X;
+ int height = ELO_MAX_Y - ELO_MIN_Y;
+
+ *dx = ((int)cache_vinfo.xres - ((int)cache_vinfo.xres * (input_x - ELO_MIN_X)) / width);
+ *dy = (cache_vinfo.yres * (input_y - ELO_MIN_Y)) / height;
+}
+
+
+/* eloGetPacket
+*/
+int eloGetPacket(unsigned char* buffer, int* buffer_p, int* checksum, int fd) {
+ int num_bytes;
+ int ok;
+
+ if(fd == 0) {
+ num_bytes = ELO_PACKET_SIZE;
+ }
+ else {
+ num_bytes = read(fd,
+ (char *) (buffer + *buffer_p),
+ ELO_PACKET_SIZE - *buffer_p);
+ }
+
+ if (num_bytes < 0) {
+#ifdef DEBUG_MOUSE
+ fprintf(stderr, "System error while reading from Elographics touchscreen.\n");
+#endif
+ return 0;
+ }
+
+ while (num_bytes) {
+ if ((*buffer_p == 0) && (buffer[0] != ELO_START_BYTE)) {
+ SDL_memcpy(&buffer[0], &buffer[1], num_bytes-1);
+ }
+ else {
+ if (*buffer_p < ELO_PACKET_SIZE-1) {
+ *checksum = *checksum + buffer[*buffer_p];
+ *checksum = *checksum % 256;
+ }
+ (*buffer_p)++;
+ }
+ num_bytes--;
+ }
+
+ if (*buffer_p == ELO_PACKET_SIZE) {
+ ok = (*checksum == buffer[ELO_PACKET_SIZE-1]);
+ *checksum = ELO_INIT_CHECKSUM;
+ *buffer_p = 0;
+
+ if (!ok) {
+ return 0;
+ }
+
+ return 1;
+ }
+ else {
+ return 0;
+ }
+}
+
+/* eloSendPacket
+*/
+
+int eloSendPacket(unsigned char* packet, int fd)
+{
+ int i, result;
+ int sum = ELO_INIT_CHECKSUM;
+
+ packet[0] = ELO_START_BYTE;
+ for (i = 0; i < ELO_PACKET_SIZE-1; i++) {
+ sum += packet[i];
+ sum &= 0xFF;
+ }
+ packet[ELO_PACKET_SIZE-1] = sum;
+
+ result = write(fd, packet, ELO_PACKET_SIZE);
+
+ if (result != ELO_PACKET_SIZE) {
+#ifdef DEBUG_MOUSE
+ printf("System error while sending to Elographics touchscreen.\n");
+#endif
+ return 0;
+ }
+ else {
+ return 1;
+ }
+}
+
+
+/* eloWaitForInput
+ */
+int eloWaitForInput(int fd, int timeout)
+{
+ fd_set readfds;
+ struct timeval to;
+ int r;
+
+ FD_ZERO(&readfds);
+ FD_SET(fd, &readfds);
+ to.tv_sec = 0;
+ to.tv_usec = timeout;
+
+ r = select(FD_SETSIZE, &readfds, NULL, NULL, &to);
+ return r;
+}
+
+/* eloWaitReply
+ */
+int eloWaitReply(unsigned char type, unsigned char *reply, int fd) {
+ int ok;
+ int i, result;
+ int reply_p = 0;
+ int sum = ELO_INIT_CHECKSUM;
+
+ i = ELO_MAX_TRIALS;
+ do {
+ ok = 0;
+
+ result = eloWaitForInput(fd, ELO_MAX_WAIT);
+
+ if (result > 0) {
+ ok = eloGetPacket(reply, &reply_p, &sum, fd);
+
+ if (ok && reply[1] != type && type != ELO_PARAMETER) {
+#ifdef DEBUG_MOUSE
+ fprintf(stderr, "Wrong reply received\n");
+#endif
+ ok = 0;
+ }
+ }
+ else {
+#ifdef DEBUG_MOUSE
+ fprintf(stderr, "No input!\n");
+#endif
+ }
+
+ if (result == 0) {
+ i--;
+ }
+ } while(!ok && (i>0));
+
+ return ok;
+}
+
+
+/* eloWaitAck
+ */
+
+int eloWaitAck(int fd) {
+ unsigned char packet[ELO_PACKET_SIZE];
+ int i, nb_errors;
+
+ if (eloWaitReply(ELO_ACK, packet, fd)) {
+ for (i = 0, nb_errors = 0; i < 4; i++) {
+ if (packet[2 + i] != '0') {
+ nb_errors++;
+ }
+ }
+
+ if (nb_errors != 0) {
+#ifdef DEBUG_MOUSE
+ fprintf(stderr, "Elographics acknowledge packet reports %d errors\n", nb_errors);
+#endif
+ }
+ return 1;
+ }
+ else {
+ return 0;
+ }
+}
+
+
+/* eloSendQuery --
+*/
+int eloSendQuery(unsigned char *request, unsigned char* reply, int fd) {
+ int ok;
+
+ if (eloSendPacket(request, fd)) {
+ ok = eloWaitReply(toupper(request[1]), reply, fd);
+ if (ok) {
+ ok = eloWaitAck(fd);
+ }
+ return ok;
+ }
+ else {
+ return 0;
+ }
+}
+
+
+/* eloSendControl
+*/
+int eloSendControl(unsigned char* control, int fd) {
+ if (eloSendPacket(control, fd)) {
+ return eloWaitAck(fd);
+ }
+ else {
+ return 0;
+ }
+}
+
+/* eloInitController
+*/
+int eloInitController(int fd) {
+ unsigned char req[ELO_PACKET_SIZE];
+ unsigned char reply[ELO_PACKET_SIZE];
+ const char *buffer = NULL;
+ int result = 0;
+
+ struct termios mouse_termios;
+
+ /* try to read the calibration values */
+ buffer = SDL_getenv("SDL_ELO_MIN_X");
+ if(buffer) {
+ ELO_MIN_X = SDL_atoi(buffer);
+ }
+ buffer = SDL_getenv("SDL_ELO_MAX_X");
+ if(buffer) {
+ ELO_MAX_X = SDL_atoi(buffer);
+ }
+ buffer = SDL_getenv("SDL_ELO_MIN_Y");
+ if(buffer) {
+ ELO_MIN_Y = SDL_atoi(buffer);
+ }
+ buffer = SDL_getenv("SDL_ELO_MAX_Y");
+ if(buffer) {
+ ELO_MAX_Y = SDL_atoi(buffer);
+ }
+
+#ifdef DEBUG_MOUSE
+ fprintf( stderr, "ELO calibration values:\nmin_x: %i\nmax_x: %i\nmin_y: %i\nmax_y: %i\n",
+ ELO_MIN_X,
+ ELO_MAX_X,
+ ELO_MIN_Y,
+ ELO_MAX_Y);
+#endif
+
+ /* set comm params */
+ SDL_memset(&mouse_termios, 0, sizeof(mouse_termios));
+ mouse_termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
+ mouse_termios.c_cc[VMIN] = 1;
+ result = tcsetattr(fd, TCSANOW, &mouse_termios);
+
+ if (result < 0) {
+#ifdef DEBUG_MOUSE
+ fprintf( stderr, "Unable to configure Elographics touchscreen port\n");
+#endif
+ return 0;
+ }
+
+ SDL_memset(req, 0, ELO_PACKET_SIZE);
+ req[1] = tolower(ELO_PARAMETER);
+ if (!eloSendQuery(req, reply, fd)) {
+#ifdef DEBUG_MOUSE
+ fprintf( stderr, "Not at the specified rate or model 2310, will continue\n");
+#endif
+ }
+
+ SDL_memset(req, 0, ELO_PACKET_SIZE);
+ req[1] = tolower(ELO_ID);
+ if (eloSendQuery(req, reply, fd)) {
+#ifdef DEBUG_MOUSE
+ fprintf(stderr, "Ok, controller configured!\n");
+#endif
+ }
+ else {
+#ifdef DEBUG_MOUSE
+ fprintf( stderr, "Unable to ask Elographics touchscreen identification\n");
+#endif
+ return 0;
+ }
+
+ SDL_memset(req, 0, ELO_PACKET_SIZE);
+ req[1] = ELO_MODE;
+ req[3] = ELO_TOUCH_MODE | ELO_STREAM_MODE | ELO_UNTOUCH_MODE;
+ req[4] = ELO_TRACKING_MODE;
+ if (!eloSendControl(req, fd)) {
+#ifdef DEBUG_MOUSE
+ fprintf( stderr, "Unable to change Elographics touchscreen operating mode\n");
+#endif
+ return 0;
+ }
+
+ SDL_memset(req, 0, ELO_PACKET_SIZE);
+ req[1] = ELO_REPORT;
+ req[2] = ELO_UNTOUCH_DELAY;
+ req[3] = ELO_REPORT_DELAY;
+ if (!eloSendControl(req, fd)) {
+#ifdef DEBUG_MOUSE
+ fprintf( stderr, "Unable to change Elographics touchscreen reports timings\n");
+#endif
+ return 0;
+ }
+
+ return 1;
+}
+
+int eloReadPosition(_THIS, int fd, int* x, int* y, int* button_state, int* realx, int* realy) {
+ unsigned char buffer[ELO_PACKET_SIZE];
+ int pointer = 0;
+ int checksum = ELO_INIT_CHECKSUM;
+
+ while(pointer < ELO_PACKET_SIZE) {
+ if(eloGetPacket(buffer, &pointer, &checksum, fd)) {
+ break;
+ }
+ }
+
+ if(!eloParsePacket(buffer, realx, realy, button_state)) {
+ return 0;
+ }
+
+ *x = *realx;
+ *y = *realy;
+
+ eloConvertXY(this, x, y);
+
+ return 1;
+}
diff --git a/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbelo.h b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbelo.h
new file mode 100644
index 0000000..e7fde4f
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbelo.h
@@ -0,0 +1,55 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef SDL_fbelo_h
+#define SDL_fbelo_h
+
+#include "SDL_fbvideo.h"
+
+/* ELO */
+#define ELO_PACKET_SIZE 10
+#define ELO_START_BYTE 'U'
+
+/* eloConvertXY
+ Convert the raw coordinates from the ELO controller
+ to a screen position.
+*/
+void eloConvertXY(_THIS, int *dx, int *dy);
+
+/* eloInitController(int fd)
+ Initialize the ELO serial touchscreen controller
+*/
+int eloInitController(int fd);
+
+/* eloParsePacket
+ extract position and button state from a packet
+*/
+int eloParsePacket(unsigned char* mousebuf, int* dx, int* dy, int* button_state);
+
+/* eloReadPosition
+ read a packet and get the cursor position
+*/
+
+int eloReadPosition(_THIS, int fd, int* x, int* y, int* button_state, int* realx, int* realy);
+
+#endif /* SDL_fbelo_h */
diff --git a/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbevents.c b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbevents.c
new file mode 100644
index 0000000..5e369a4
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbevents.c
@@ -0,0 +1,1254 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Handle the event stream, converting console events into SDL events */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <limits.h>
+
+/* For parsing /proc */
+#include <dirent.h>
+#include <ctype.h>
+
+#include <linux/vt.h>
+#include <linux/kd.h>
+#include <linux/keyboard.h>
+
+#include "SDL_timer.h"
+#include "SDL_mutex.h"
+#include "../SDL_sysvideo.h"
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_fbvideo.h"
+#include "SDL_fbevents_c.h"
+#include "SDL_fbkeys.h"
+
+#include "SDL_fbelo.h"
+
+#ifndef GPM_NODE_FIFO
+#define GPM_NODE_FIFO "/dev/gpmdata"
+#endif
+
+/*#define DEBUG_KEYBOARD*/
+/*#define DEBUG_MOUSE*/
+
+/* The translation tables from a console scancode to a SDL keysym */
+#define NUM_VGAKEYMAPS (1<<KG_CAPSSHIFT)
+static Uint16 vga_keymap[NUM_VGAKEYMAPS][NR_KEYS];
+static SDLKey keymap[128];
+static Uint16 keymap_temp[128]; /* only used at startup */
+static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym);
+
+/* Ugh, we have to duplicate the kernel's keysym mapping code...
+ Oh, it's not so bad. :-)
+
+ FIXME: Add keyboard LED handling code
+ */
+static void FB_vgainitkeymaps(int fd)
+{
+ struct kbentry entry;
+ int map, i;
+
+ /* Don't do anything if we are passed a closed keyboard */
+ if ( fd < 0 ) {
+ return;
+ }
+
+ /* Load all the keysym mappings */
+ for ( map=0; map<NUM_VGAKEYMAPS; ++map ) {
+ SDL_memset(vga_keymap[map], 0, NR_KEYS*sizeof(Uint16));
+ for ( i=0; i<NR_KEYS; ++i ) {
+ entry.kb_table = map;
+ entry.kb_index = i;
+ if ( ioctl(fd, KDGKBENT, &entry) == 0 ) {
+ /* fill keytemp. This replaces SDL_fbkeys.h */
+ if ( (map == 0) && (i<128) ) {
+ keymap_temp[i] = entry.kb_value;
+ }
+ /* The "Enter" key is a special case */
+ if ( entry.kb_value == K_ENTER ) {
+ entry.kb_value = K(KT_ASCII,13);
+ }
+ /* Handle numpad specially as well */
+ if ( KTYP(entry.kb_value) == KT_PAD ) {
+ switch ( entry.kb_value ) {
+ case K_P0:
+ case K_P1:
+ case K_P2:
+ case K_P3:
+ case K_P4:
+ case K_P5:
+ case K_P6:
+ case K_P7:
+ case K_P8:
+ case K_P9:
+ vga_keymap[map][i]=entry.kb_value;
+ vga_keymap[map][i]+= '0';
+ break;
+ case K_PPLUS:
+ vga_keymap[map][i]=K(KT_ASCII,'+');
+ break;
+ case K_PMINUS:
+ vga_keymap[map][i]=K(KT_ASCII,'-');
+ break;
+ case K_PSTAR:
+ vga_keymap[map][i]=K(KT_ASCII,'*');
+ break;
+ case K_PSLASH:
+ vga_keymap[map][i]=K(KT_ASCII,'/');
+ break;
+ case K_PENTER:
+ vga_keymap[map][i]=K(KT_ASCII,'\r');
+ break;
+ case K_PCOMMA:
+ vga_keymap[map][i]=K(KT_ASCII,',');
+ break;
+ case K_PDOT:
+ vga_keymap[map][i]=K(KT_ASCII,'.');
+ break;
+ default:
+ break;
+ }
+ }
+ /* Do the normal key translation */
+ if ( (KTYP(entry.kb_value) == KT_LATIN) ||
+ (KTYP(entry.kb_value) == KT_ASCII) ||
+ (KTYP(entry.kb_value) == KT_LETTER) ) {
+ vga_keymap[map][i] = entry.kb_value;
+ }
+ }
+ }
+ }
+}
+
+int FB_InGraphicsMode(_THIS)
+{
+ return((keyboard_fd >= 0) && (saved_kbd_mode >= 0));
+}
+
+int FB_EnterGraphicsMode(_THIS)
+{
+ struct termios keyboard_termios;
+
+ /* Set medium-raw keyboard mode */
+ if ( (keyboard_fd >= 0) && !FB_InGraphicsMode(this) ) {
+
+ /* Switch to the correct virtual terminal */
+ if ( current_vt > 0 ) {
+ struct vt_stat vtstate;
+
+ if ( ioctl(keyboard_fd, VT_GETSTATE, &vtstate) == 0 ) {
+ saved_vt = vtstate.v_active;
+ }
+ if ( ioctl(keyboard_fd, VT_ACTIVATE, current_vt) == 0 ) {
+ ioctl(keyboard_fd, VT_WAITACTIVE, current_vt);
+ }
+ }
+
+ /* Set the terminal input mode */
+ if ( tcgetattr(keyboard_fd, &saved_kbd_termios) < 0 ) {
+ SDL_SetError("Unable to get terminal attributes");
+ if ( keyboard_fd > 0 ) {
+ close(keyboard_fd);
+ }
+ keyboard_fd = -1;
+ return(-1);
+ }
+ if ( ioctl(keyboard_fd, KDGKBMODE, &saved_kbd_mode) < 0 ) {
+ SDL_SetError("Unable to get current keyboard mode");
+ if ( keyboard_fd > 0 ) {
+ close(keyboard_fd);
+ }
+ keyboard_fd = -1;
+ return(-1);
+ }
+ keyboard_termios = saved_kbd_termios;
+ keyboard_termios.c_lflag &= ~(ICANON | ECHO | ISIG);
+ keyboard_termios.c_iflag &= ~(ISTRIP | IGNCR | ICRNL | INLCR | IXOFF | IXON);
+ keyboard_termios.c_cc[VMIN] = 0;
+ keyboard_termios.c_cc[VTIME] = 0;
+ if (tcsetattr(keyboard_fd, TCSAFLUSH, &keyboard_termios) < 0) {
+ FB_CloseKeyboard(this);
+ SDL_SetError("Unable to set terminal attributes");
+ return(-1);
+ }
+ /* This will fail if we aren't root or this isn't our tty */
+ if ( ioctl(keyboard_fd, KDSKBMODE, K_MEDIUMRAW) < 0 ) {
+ FB_CloseKeyboard(this);
+ SDL_SetError("Unable to set keyboard in raw mode");
+ return(-1);
+ }
+ if ( ioctl(keyboard_fd, KDSETMODE, KD_GRAPHICS) < 0 ) {
+ FB_CloseKeyboard(this);
+ SDL_SetError("Unable to set keyboard in graphics mode");
+ return(-1);
+ }
+ /* Prevent switching the virtual terminal */
+ ioctl(keyboard_fd, VT_LOCKSWITCH, 1);
+ }
+ return(keyboard_fd);
+}
+
+void FB_LeaveGraphicsMode(_THIS)
+{
+ if ( FB_InGraphicsMode(this) ) {
+ ioctl(keyboard_fd, KDSETMODE, KD_TEXT);
+ ioctl(keyboard_fd, KDSKBMODE, saved_kbd_mode);
+ tcsetattr(keyboard_fd, TCSAFLUSH, &saved_kbd_termios);
+ saved_kbd_mode = -1;
+
+ /* Head back over to the original virtual terminal */
+ ioctl(keyboard_fd, VT_UNLOCKSWITCH, 1);
+ if ( saved_vt > 0 ) {
+ ioctl(keyboard_fd, VT_ACTIVATE, saved_vt);
+ }
+ }
+}
+
+void FB_CloseKeyboard(_THIS)
+{
+ if ( keyboard_fd >= 0 ) {
+ FB_LeaveGraphicsMode(this);
+ if ( keyboard_fd > 0 ) {
+ close(keyboard_fd);
+ }
+ }
+ keyboard_fd = -1;
+}
+
+int FB_OpenKeyboard(_THIS)
+{
+ /* Open only if not already opened */
+ if ( keyboard_fd < 0 ) {
+ static const char * const tty0[] = { "/dev/tty0", "/dev/vc/0", NULL };
+ static const char * const vcs[] = { "/dev/vc/%d", "/dev/tty%d", NULL };
+ int i, tty0_fd;
+
+ /* Try to query for a free virtual terminal */
+ tty0_fd = -1;
+ for ( i=0; tty0[i] && (tty0_fd < 0); ++i ) {
+ tty0_fd = open(tty0[i], O_WRONLY, 0);
+ }
+ if ( tty0_fd < 0 ) {
+ tty0_fd = dup(0); /* Maybe stdin is a VT? */
+ }
+ ioctl(tty0_fd, VT_OPENQRY, &current_vt);
+ close(tty0_fd);
+ if ( (geteuid() == 0) && (current_vt > 0) ) {
+ for ( i=0; vcs[i] && (keyboard_fd < 0); ++i ) {
+ char vtpath[12];
+
+ SDL_snprintf(vtpath, SDL_arraysize(vtpath), vcs[i], current_vt);
+ keyboard_fd = open(vtpath, O_RDWR, 0);
+#ifdef DEBUG_KEYBOARD
+ fprintf(stderr, "vtpath = %s, fd = %d\n",
+ vtpath, keyboard_fd);
+#endif /* DEBUG_KEYBOARD */
+
+ /* This needs to be our controlling tty
+ so that the kernel ioctl() calls work
+ */
+ if ( keyboard_fd >= 0 ) {
+ tty0_fd = open("/dev/tty", O_RDWR, 0);
+ if ( tty0_fd >= 0 ) {
+ ioctl(tty0_fd, TIOCNOTTY, 0);
+ close(tty0_fd);
+ }
+ }
+ }
+ }
+ if ( keyboard_fd < 0 ) {
+ /* Last resort, maybe our tty is a usable VT */
+ struct vt_stat vtstate;
+
+ keyboard_fd = open("/dev/tty", O_RDWR);
+
+ if ( ioctl(keyboard_fd, VT_GETSTATE, &vtstate) == 0 ) {
+ current_vt = vtstate.v_active;
+ } else {
+ current_vt = 0;
+ }
+ }
+#ifdef DEBUG_KEYBOARD
+ fprintf(stderr, "Current VT: %d\n", current_vt);
+#endif
+ saved_kbd_mode = -1;
+
+ /* Make sure that our input is a console terminal */
+ { int dummy;
+ if ( ioctl(keyboard_fd, KDGKBMODE, &dummy) < 0 ) {
+ close(keyboard_fd);
+ keyboard_fd = -1;
+ SDL_SetError("Unable to open a console terminal");
+ }
+ }
+
+ /* Set up keymap */
+ FB_vgainitkeymaps(keyboard_fd);
+ }
+ return(keyboard_fd);
+}
+
+static enum {
+ MOUSE_NONE = -1,
+ MOUSE_MSC, /* Note: GPM uses the MSC protocol */
+ MOUSE_PS2,
+ MOUSE_IMPS2,
+ MOUSE_MS,
+ MOUSE_BM,
+ MOUSE_ELO,
+ MOUSE_TSLIB,
+ NUM_MOUSE_DRVS
+} mouse_drv = MOUSE_NONE;
+
+void FB_CloseMouse(_THIS)
+{
+#if SDL_INPUT_TSLIB
+ if (ts_dev != NULL) {
+ ts_close(ts_dev);
+ ts_dev = NULL;
+ mouse_fd = -1;
+ }
+#endif /* SDL_INPUT_TSLIB */
+ if ( mouse_fd > 0 ) {
+ close(mouse_fd);
+ }
+ mouse_fd = -1;
+}
+
+/* Returns processes listed in /proc with the desired name */
+static int find_pid(DIR *proc, const char *wanted_name)
+{
+ struct dirent *entry;
+ int pid;
+
+ /* First scan proc for the gpm process */
+ pid = 0;
+ while ( (pid == 0) && ((entry=readdir(proc)) != NULL) ) {
+ if ( isdigit(entry->d_name[0]) ) {
+ FILE *status;
+ char path[PATH_MAX];
+ char name[PATH_MAX];
+
+ SDL_snprintf(path, SDL_arraysize(path), "/proc/%s/status", entry->d_name);
+ status=fopen(path, "r");
+ if ( status ) {
+ int matches = 0;
+ name[0] = '\0';
+ matches = fscanf(status, "Name: %s", name);
+ if ( (matches == 1) && (SDL_strcmp(name, wanted_name) == 0) ) {
+ pid = SDL_atoi(entry->d_name);
+ }
+ fclose(status);
+ }
+ }
+ }
+ return pid;
+}
+
+/* Returns true if /dev/gpmdata is being written to by gpm */
+static int gpm_available(char *proto, size_t protolen)
+{
+ int available;
+ DIR *proc;
+ int pid;
+ int cmdline, len, arglen;
+ char path[PATH_MAX];
+ char args[PATH_MAX], *arg;
+
+ /* Don't bother looking if the fifo isn't there */
+#ifdef DEBUG_MOUSE
+ fprintf(stderr,"testing gpm\n");
+#endif
+ if ( access(GPM_NODE_FIFO, F_OK) < 0 ) {
+ return(0);
+ }
+
+ available = 0;
+ proc = opendir("/proc");
+ if ( proc ) {
+ char raw_proto[10] = { '\0' };
+ char repeat_proto[10] = { '\0' };
+ while ( !available && (pid=find_pid(proc, "gpm")) > 0 ) {
+ SDL_snprintf(path, SDL_arraysize(path), "/proc/%d/cmdline", pid);
+ cmdline = open(path, O_RDONLY, 0);
+ if ( cmdline >= 0 ) {
+ len = read(cmdline, args, sizeof(args));
+ arg = args;
+ while ( len > 0 ) {
+ arglen = SDL_strlen(arg)+1;
+#ifdef DEBUG_MOUSE
+ fprintf(stderr,"gpm arg %s len %d\n",arg,arglen);
+#endif
+ if ( SDL_strcmp(arg, "-t") == 0) {
+ /* protocol string, keep it for later */
+ char *t, *s;
+ t = arg + arglen;
+ s = SDL_strchr(t, ' ');
+ if (s) *s = 0;
+ SDL_strlcpy(raw_proto, t, SDL_arraysize(raw_proto));
+ if (s) *s = ' ';
+ }
+ if ( SDL_strncmp(arg, "-R", 2) == 0 ) {
+ char *t, *s;
+ available = 1;
+ t = arg + 2;
+ s = SDL_strchr(t, ' ');
+ if (s) *s = 0;
+ SDL_strlcpy(repeat_proto, t, SDL_arraysize(repeat_proto));
+ if (s) *s = ' ';
+ }
+ len -= arglen;
+ arg += arglen;
+ }
+ close(cmdline);
+ }
+ }
+ closedir(proc);
+
+ if ( available ) {
+ if ( SDL_strcmp(repeat_proto, "raw") == 0 ) {
+ SDL_strlcpy(proto, raw_proto, protolen);
+ } else if ( *repeat_proto ) {
+ SDL_strlcpy(proto, repeat_proto, protolen);
+ } else {
+ SDL_strlcpy(proto, "msc", protolen);
+ }
+ }
+ }
+ return available;
+}
+
+
+/* rcg06112001 Set up IMPS/2 mode, if possible. This gives
+ * us access to the mousewheel, etc. Returns zero if
+ * writes to device failed, but you still need to query the
+ * device to see which mode it's actually in.
+ */
+static int set_imps2_mode(int fd)
+{
+ /* If you wanted to control the mouse mode (and we do :) ) ...
+ Set IMPS/2 protocol:
+ {0xf3,200,0xf3,100,0xf3,80}
+ Reset mouse device:
+ {0xFF}
+ */
+ Uint8 set_imps2[] = {0xf3, 200, 0xf3, 100, 0xf3, 80};
+ /*Uint8 reset = 0xff;*/
+ fd_set fdset;
+ struct timeval tv;
+ int retval = 0;
+
+ if ( write(fd, &set_imps2, sizeof(set_imps2)) == sizeof(set_imps2) ) {
+ /* Don't reset it, that'll clear IMPS/2 mode on some mice
+ if (write(fd, &reset, sizeof (reset)) == sizeof (reset) ) {
+ retval = 1;
+ }
+ */
+ }
+
+ /* Get rid of any chatter from the above */
+ FD_ZERO(&fdset);
+ FD_SET(fd, &fdset);
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+ while ( select(fd+1, &fdset, 0, 0, &tv) > 0 ) {
+ char temp[32];
+ if (read(fd, temp, sizeof(temp)) <= 0) {
+ break;
+ }
+ }
+
+ return retval;
+}
+
+
+/* Returns true if the mouse uses the IMPS/2 protocol */
+static int detect_imps2(int fd)
+{
+ int imps2;
+
+ imps2 = 0;
+
+ if ( SDL_getenv("SDL_MOUSEDEV_IMPS2") ) {
+ imps2 = 1;
+ }
+ if ( ! imps2 ) {
+ Uint8 query_ps2 = 0xF2;
+ fd_set fdset;
+ struct timeval tv;
+
+ /* Get rid of any mouse motion noise */
+ FD_ZERO(&fdset);
+ FD_SET(fd, &fdset);
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+ while ( select(fd+1, &fdset, 0, 0, &tv) > 0 ) {
+ char temp[32];
+ if (read(fd, temp, sizeof(temp)) <= 0) {
+ break;
+ }
+ }
+
+ /* Query for the type of mouse protocol */
+ if ( write(fd, &query_ps2, sizeof (query_ps2)) == sizeof (query_ps2)) {
+ Uint8 ch = 0;
+
+ /* Get the mouse protocol response */
+ do {
+ FD_ZERO(&fdset);
+ FD_SET(fd, &fdset);
+ tv.tv_sec = 1;
+ tv.tv_usec = 0;
+ if ( select(fd+1, &fdset, 0, 0, &tv) < 1 ) {
+ break;
+ }
+ } while ( (read(fd, &ch, sizeof (ch)) == sizeof (ch)) &&
+ ((ch == 0xFA) || (ch == 0xAA)) );
+
+ /* Experimental values (Logitech wheelmouse) */
+#ifdef DEBUG_MOUSE
+fprintf(stderr, "Last mouse mode: 0x%x\n", ch);
+#endif
+ if ( (ch == 3) || (ch == 4) ) {
+ imps2 = 1;
+ }
+ }
+ }
+ return imps2;
+}
+
+int FB_OpenMouse(_THIS)
+{
+ int i;
+ const char *mousedev;
+ const char *mousedrv;
+
+ mousedrv = SDL_getenv("SDL_MOUSEDRV");
+ mousedev = SDL_getenv("SDL_MOUSEDEV");
+ mouse_fd = -1;
+
+#if SDL_INPUT_TSLIB
+ if ( mousedrv && (SDL_strcmp(mousedrv, "TSLIB") == 0) ) {
+ if (mousedev == NULL) mousedev = SDL_getenv("TSLIB_TSDEVICE");
+ if (mousedev != NULL) {
+ ts_dev = ts_open(mousedev, 1);
+ if ((ts_dev != NULL) && (ts_config(ts_dev) >= 0)) {
+#ifdef DEBUG_MOUSE
+ fprintf(stderr, "Using tslib touchscreen\n");
+#endif
+ mouse_drv = MOUSE_TSLIB;
+ mouse_fd = ts_fd(ts_dev);
+ return mouse_fd;
+ }
+ }
+ mouse_drv = MOUSE_NONE;
+ return mouse_fd;
+ }
+#endif /* SDL_INPUT_TSLIB */
+
+ /* ELO TOUCHSCREEN SUPPORT */
+
+ if ( mousedrv && (SDL_strcmp(mousedrv, "ELO") == 0) ) {
+ mouse_fd = open(mousedev, O_RDWR);
+ if ( mouse_fd >= 0 ) {
+ if(eloInitController(mouse_fd)) {
+#ifdef DEBUG_MOUSE
+fprintf(stderr, "Using ELO touchscreen\n");
+#endif
+ mouse_drv = MOUSE_ELO;
+ }
+
+ }
+ else if ( mouse_fd < 0 ) {
+ mouse_drv = MOUSE_NONE;
+ }
+
+ return(mouse_fd);
+ }
+
+ /* STD MICE */
+
+ if ( mousedev == NULL ) {
+ /* FIXME someday... allow multiple mice in this driver */
+ static const char *ps2mice[] = {
+ "/dev/input/mice", "/dev/usbmouse", "/dev/psaux", NULL
+ };
+ /* First try to use GPM in repeater mode */
+ if ( mouse_fd < 0 ) {
+ char proto[10];
+ if ( gpm_available(proto, SDL_arraysize(proto)) ) {
+ mouse_fd = open(GPM_NODE_FIFO, O_RDONLY, 0);
+ if ( mouse_fd >= 0 ) {
+ if ( SDL_strcmp(proto, "msc") == 0 ) {
+ mouse_drv = MOUSE_MSC;
+ } else if ( SDL_strcmp(proto, "ps2") == 0 ) {
+ mouse_drv = MOUSE_PS2;
+ } else if ( SDL_strcmp(proto, "imps2") == 0 ) {
+ mouse_drv = MOUSE_IMPS2;
+ } else if ( SDL_strcmp(proto, "ms") == 0 ||
+ SDL_strcmp(proto, "bare") == 0 ) {
+ mouse_drv = MOUSE_MS;
+ } else if ( SDL_strcmp(proto, "bm") == 0 ) {
+ mouse_drv = MOUSE_BM;
+ } else {
+ /* Unknown protocol... */
+#ifdef DEBUG_MOUSE
+ fprintf(stderr, "GPM mouse using unknown protocol = %s\n", proto);
+#endif
+ close(mouse_fd);
+ mouse_fd = -1;
+ }
+ }
+#ifdef DEBUG_MOUSE
+ if ( mouse_fd >= 0 ) {
+ fprintf(stderr, "Using GPM mouse, protocol = %s\n", proto);
+ }
+#endif /* DEBUG_MOUSE */
+ }
+ }
+ /* Now try to use a modern PS/2 mouse */
+ for ( i=0; (mouse_fd < 0) && ps2mice[i]; ++i ) {
+ mouse_fd = open(ps2mice[i], O_RDWR, 0);
+ if (mouse_fd < 0) {
+ mouse_fd = open(ps2mice[i], O_RDONLY, 0);
+ }
+ if (mouse_fd >= 0) {
+ /* rcg06112001 Attempt to set IMPS/2 mode */
+ set_imps2_mode(mouse_fd);
+ if (detect_imps2(mouse_fd)) {
+#ifdef DEBUG_MOUSE
+fprintf(stderr, "Using IMPS2 mouse\n");
+#endif
+ mouse_drv = MOUSE_IMPS2;
+ } else {
+#ifdef DEBUG_MOUSE
+fprintf(stderr, "Using PS2 mouse\n");
+#endif
+ mouse_drv = MOUSE_PS2;
+ }
+ }
+ }
+ /* Next try to use a PPC ADB port mouse */
+ if ( mouse_fd < 0 ) {
+ mouse_fd = open("/dev/adbmouse", O_RDONLY, 0);
+ if ( mouse_fd >= 0 ) {
+#ifdef DEBUG_MOUSE
+fprintf(stderr, "Using ADB mouse\n");
+#endif
+ mouse_drv = MOUSE_BM;
+ }
+ }
+ }
+ /* Default to a serial Microsoft mouse */
+ if ( mouse_fd < 0 ) {
+ if ( mousedev == NULL ) {
+ mousedev = "/dev/mouse";
+ }
+ mouse_fd = open(mousedev, O_RDONLY, 0);
+ if ( mouse_fd >= 0 ) {
+ struct termios mouse_termios;
+
+ /* Set the sampling speed to 1200 baud */
+ tcgetattr(mouse_fd, &mouse_termios);
+ mouse_termios.c_iflag = IGNBRK | IGNPAR;
+ mouse_termios.c_oflag = 0;
+ mouse_termios.c_lflag = 0;
+ mouse_termios.c_line = 0;
+ mouse_termios.c_cc[VTIME] = 0;
+ mouse_termios.c_cc[VMIN] = 1;
+ mouse_termios.c_cflag = CREAD | CLOCAL | HUPCL;
+ mouse_termios.c_cflag |= CS8;
+ mouse_termios.c_cflag |= B1200;
+ tcsetattr(mouse_fd, TCSAFLUSH, &mouse_termios);
+ if ( mousedrv && (SDL_strcmp(mousedrv, "PS2") == 0) ) {
+#ifdef DEBUG_MOUSE
+fprintf(stderr, "Using (user specified) PS2 mouse on %s\n", mousedev);
+#endif
+ mouse_drv = MOUSE_PS2;
+ } else {
+#ifdef DEBUG_MOUSE
+fprintf(stderr, "Using (default) MS mouse on %s\n", mousedev);
+#endif
+ mouse_drv = MOUSE_MS;
+ }
+ }
+ }
+ if ( mouse_fd < 0 ) {
+ mouse_drv = MOUSE_NONE;
+ }
+ return(mouse_fd);
+}
+
+static int posted = 0;
+
+void FB_vgamousecallback(int button, int relative, int dx, int dy)
+{
+ int button_1, button_3;
+ int button_state;
+ int state_changed;
+ int i;
+ Uint8 state;
+
+ if ( dx || dy ) {
+ posted += SDL_PrivateMouseMotion(0, relative, dx, dy);
+ }
+
+ /* Swap button 1 and 3 */
+ button_1 = (button & 0x04) >> 2;
+ button_3 = (button & 0x01) << 2;
+ button &= ~0x05;
+ button |= (button_1|button_3);
+
+ /* See what changed */
+ button_state = SDL_GetMouseState(NULL, NULL);
+ state_changed = button_state ^ button;
+ for ( i=0; i<8; ++i ) {
+ if ( state_changed & (1<<i) ) {
+ if ( button & (1<<i) ) {
+ state = SDL_PRESSED;
+ } else {
+ state = SDL_RELEASED;
+ }
+ posted += SDL_PrivateMouseButton(state, i+1, 0, 0);
+ }
+ }
+}
+
+/* Handle input from tslib */
+#if SDL_INPUT_TSLIB
+static void handle_tslib(_THIS)
+{
+ struct ts_sample sample;
+ int button;
+
+ while (ts_read(ts_dev, &sample, 1) > 0) {
+ button = (sample.pressure > 0) ? 1 : 0;
+ button <<= 2; /* must report it as button 3 */
+ FB_vgamousecallback(button, 0, sample.x, sample.y);
+ }
+ return;
+}
+#endif /* SDL_INPUT_TSLIB */
+
+/* For now, use MSC, PS/2, and MS protocols
+ Driver adapted from the SVGAlib mouse driver code (taken from gpm, etc.)
+ */
+static void handle_mouse(_THIS)
+{
+ static int start = 0;
+ static unsigned char mousebuf[BUFSIZ];
+ static int relative = 1;
+
+ int i, nread;
+ int button = 0;
+ int dx = 0, dy = 0;
+ int packetsize = 0;
+ int realx, realy;
+
+ /* Figure out the mouse packet size */
+ switch (mouse_drv) {
+ case MOUSE_NONE:
+ break; /* carry on to read from device and discard it. */
+ case MOUSE_MSC:
+ packetsize = 5;
+ break;
+ case MOUSE_IMPS2:
+ packetsize = 4;
+ break;
+ case MOUSE_PS2:
+ case MOUSE_MS:
+ case MOUSE_BM:
+ packetsize = 3;
+ break;
+ case MOUSE_ELO:
+ /* try to read the next packet */
+ if(eloReadPosition(this, mouse_fd, &dx, &dy, &button, &realx, &realy)) {
+ button = (button & 0x01) << 2;
+ FB_vgamousecallback(button, 0, dx, dy);
+ }
+ return; /* nothing left to do */
+ case MOUSE_TSLIB:
+#if SDL_INPUT_TSLIB
+ handle_tslib(this);
+#endif
+ return; /* nothing left to do */
+ default:
+ /* Uh oh.. */
+ packetsize = 0;
+ break;
+ }
+
+ /* Special handling for the quite sensitive ELO controller */
+ if (mouse_drv == MOUSE_ELO) {
+
+ }
+
+ /* Read as many packets as possible */
+ nread = read(mouse_fd, &mousebuf[start], BUFSIZ-start);
+ if ( nread < 0 ) {
+ return;
+ }
+
+ if (mouse_drv == MOUSE_NONE) {
+ return; /* we're done; just draining the input queue. */
+ }
+
+ nread += start;
+#ifdef DEBUG_MOUSE
+ fprintf(stderr, "Read %d bytes from mouse, start = %d\n", nread, start);
+#endif
+
+ for ( i=0; i<(nread-(packetsize-1)); i += packetsize ) {
+ switch (mouse_drv) {
+ case MOUSE_NONE: /* shouldn't actually hit this. */
+ break; /* just throw everything away. */
+ case MOUSE_MSC:
+ /* MSC protocol has 0x80 in high byte */
+ if ( (mousebuf[i] & 0xF8) != 0x80 ) {
+ /* Go to next byte */
+ i -= (packetsize-1);
+ continue;
+ }
+ /* Get current mouse state */
+ button = (~mousebuf[i]) & 0x07;
+ dx = (signed char)(mousebuf[i+1]) +
+ (signed char)(mousebuf[i+3]);
+ dy = -((signed char)(mousebuf[i+2]) +
+ (signed char)(mousebuf[i+4]));
+ break;
+ case MOUSE_PS2:
+ /* PS/2 protocol has nothing in high byte */
+ if ( (mousebuf[i] & 0xC0) != 0 ) {
+ /* Go to next byte */
+ i -= (packetsize-1);
+ continue;
+ }
+ /* Get current mouse state */
+ button = (mousebuf[i] & 0x04) >> 1 | /*Middle*/
+ (mousebuf[i] & 0x02) >> 1 | /*Right*/
+ (mousebuf[i] & 0x01) << 2; /*Left*/
+ dx = (mousebuf[i] & 0x10) ?
+ mousebuf[i+1] - 256 : mousebuf[i+1];
+ dy = (mousebuf[i] & 0x20) ?
+ -(mousebuf[i+2] - 256) : -mousebuf[i+2];
+ break;
+ case MOUSE_IMPS2:
+ /* Get current mouse state */
+ button = (mousebuf[i] & 0x04) >> 1 | /*Middle*/
+ (mousebuf[i] & 0x02) >> 1 | /*Right*/
+ (mousebuf[i] & 0x01) << 2 | /*Left*/
+ (mousebuf[i] & 0x40) >> 3 | /* 4 */
+ (mousebuf[i] & 0x80) >> 3; /* 5 */
+ dx = (mousebuf[i] & 0x10) ?
+ mousebuf[i+1] - 256 : mousebuf[i+1];
+ dy = (mousebuf[i] & 0x20) ?
+ -(mousebuf[i+2] - 256) : -mousebuf[i+2];
+ switch (mousebuf[i+3]&0x0F) {
+ case 0x0E: /* DX = +1 */
+ case 0x02: /* DX = -1 */
+ break;
+ case 0x0F: /* DY = +1 (map button 4) */
+ FB_vgamousecallback(button | (1<<3),
+ 1, 0, 0);
+ break;
+ case 0x01: /* DY = -1 (map button 5) */
+ FB_vgamousecallback(button | (1<<4),
+ 1, 0, 0);
+ break;
+ }
+ break;
+ case MOUSE_MS:
+ /* Microsoft protocol has 0x40 in high byte */
+ if ( (mousebuf[i] & 0x40) != 0x40 ) {
+ /* Go to next byte */
+ i -= (packetsize-1);
+ continue;
+ }
+ /* Get current mouse state */
+ button = ((mousebuf[i] & 0x20) >> 3) |
+ ((mousebuf[i] & 0x10) >> 4);
+ dx = (signed char)(((mousebuf[i] & 0x03) << 6) |
+ (mousebuf[i + 1] & 0x3F));
+ dy = (signed char)(((mousebuf[i] & 0x0C) << 4) |
+ (mousebuf[i + 2] & 0x3F));
+ break;
+ case MOUSE_BM:
+ /* BusMouse protocol has 0xF8 in high byte */
+ if ( (mousebuf[i] & 0xF8) != 0x80 ) {
+ /* Go to next byte */
+ i -= (packetsize-1);
+ continue;
+ }
+ /* Get current mouse state */
+ button = (~mousebuf[i]) & 0x07;
+ dx = (signed char)mousebuf[i+1];
+ dy = -(signed char)mousebuf[i+2];
+ break;
+ default:
+ /* Uh oh.. */
+ dx = 0;
+ dy = 0;
+ break;
+ }
+ FB_vgamousecallback(button, relative, dx, dy);
+ }
+ if ( i < nread ) {
+ SDL_memcpy(mousebuf, &mousebuf[i], (nread-i));
+ start = (nread-i);
+ } else {
+ start = 0;
+ }
+ return;
+}
+
+/* Handle switching to another VC, returns when our VC is back */
+static void switch_vt_prep(_THIS)
+{
+ SDL_Surface *screen = SDL_VideoSurface;
+
+ SDL_PrivateAppActive(0, (SDL_APPACTIVE|SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS));
+
+ /* Save the contents of the screen, and go to text mode */
+ wait_idle(this);
+ screen_arealen = ((screen->h + (2*this->offset_y)) * screen->pitch);
+ screen_contents = (Uint8 *)SDL_malloc(screen_arealen);
+ if ( screen_contents ) {
+ SDL_memcpy(screen_contents, screen->pixels, screen_arealen);
+ }
+ FB_SavePaletteTo(this, 256, screen_palette);
+ ioctl(console_fd, FBIOGET_VSCREENINFO, &screen_vinfo);
+ ioctl(keyboard_fd, KDSETMODE, KD_TEXT);
+ ioctl(keyboard_fd, VT_UNLOCKSWITCH, 1);
+}
+static void switch_vt_done(_THIS)
+{
+ SDL_Surface *screen = SDL_VideoSurface;
+
+ /* Restore graphics mode and the contents of the screen */
+ ioctl(keyboard_fd, VT_LOCKSWITCH, 1);
+ ioctl(keyboard_fd, KDSETMODE, KD_GRAPHICS);
+ ioctl(console_fd, FBIOPUT_VSCREENINFO, &screen_vinfo);
+ FB_RestorePaletteFrom(this, 256, screen_palette);
+ if ( screen_contents ) {
+ SDL_memcpy(screen->pixels, screen_contents, screen_arealen);
+ SDL_free(screen_contents);
+ screen_contents = NULL;
+ }
+
+ /* Get updates to the shadow surface while switched away */
+ if ( SDL_ShadowSurface ) {
+ SDL_UpdateRect(SDL_ShadowSurface, 0, 0, 0, 0);
+ }
+
+ SDL_PrivateAppActive(1, (SDL_APPACTIVE|SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS));
+}
+static void switch_vt(_THIS, unsigned short which)
+{
+ struct vt_stat vtstate;
+
+ /* Figure out whether or not we're switching to a new console */
+ if ( (ioctl(keyboard_fd, VT_GETSTATE, &vtstate) < 0) ||
+ (which == vtstate.v_active) ) {
+ return;
+ }
+
+ /* New console, switch to it */
+ SDL_mutexP(hw_lock);
+ switch_vt_prep(this);
+ if ( ioctl(keyboard_fd, VT_ACTIVATE, which) == 0 ) {
+ ioctl(keyboard_fd, VT_WAITACTIVE, which);
+ switched_away = 1;
+ } else {
+ switch_vt_done(this);
+ }
+ SDL_mutexV(hw_lock);
+}
+
+static void handle_keyboard(_THIS)
+{
+ unsigned char keybuf[BUFSIZ];
+ int i, nread;
+ int pressed;
+ int scancode;
+ SDL_keysym keysym;
+
+ nread = read(keyboard_fd, keybuf, BUFSIZ);
+ for ( i=0; i<nread; ++i ) {
+ scancode = keybuf[i] & 0x7F;
+ if ( keybuf[i] & 0x80 ) {
+ pressed = SDL_RELEASED;
+ } else {
+ pressed = SDL_PRESSED;
+ }
+ TranslateKey(scancode, &keysym);
+ /* Handle Ctrl-Alt-FN for vt switch */
+ switch (keysym.sym) {
+ case SDLK_F1:
+ case SDLK_F2:
+ case SDLK_F3:
+ case SDLK_F4:
+ case SDLK_F5:
+ case SDLK_F6:
+ case SDLK_F7:
+ case SDLK_F8:
+ case SDLK_F9:
+ case SDLK_F10:
+ case SDLK_F11:
+ case SDLK_F12:
+ if ( (SDL_GetModState() & KMOD_CTRL) &&
+ (SDL_GetModState() & KMOD_ALT) ) {
+ if ( pressed ) {
+ switch_vt(this, (keysym.sym-SDLK_F1)+1);
+ }
+ break;
+ }
+ /* Fall through to normal processing */
+ default:
+ posted += SDL_PrivateKeyboard(pressed, &keysym);
+ break;
+ }
+ }
+}
+
+void FB_PumpEvents(_THIS)
+{
+ fd_set fdset;
+ int max_fd;
+ static struct timeval zero;
+
+ do {
+ if ( switched_away ) {
+ struct vt_stat vtstate;
+
+ SDL_mutexP(hw_lock);
+ if ( (ioctl(keyboard_fd, VT_GETSTATE, &vtstate) == 0) &&
+ vtstate.v_active == current_vt ) {
+ switched_away = 0;
+ switch_vt_done(this);
+ }
+ SDL_mutexV(hw_lock);
+ }
+
+ posted = 0;
+
+ FD_ZERO(&fdset);
+ max_fd = 0;
+ if ( keyboard_fd >= 0 ) {
+ FD_SET(keyboard_fd, &fdset);
+ if ( max_fd < keyboard_fd ) {
+ max_fd = keyboard_fd;
+ }
+ }
+ if ( mouse_fd >= 0 ) {
+ FD_SET(mouse_fd, &fdset);
+ if ( max_fd < mouse_fd ) {
+ max_fd = mouse_fd;
+ }
+ }
+ if ( select(max_fd+1, &fdset, NULL, NULL, &zero) > 0 ) {
+ if ( keyboard_fd >= 0 ) {
+ if ( FD_ISSET(keyboard_fd, &fdset) ) {
+ handle_keyboard(this);
+ }
+ }
+ if ( mouse_fd >= 0 ) {
+ if ( FD_ISSET(mouse_fd, &fdset) ) {
+ handle_mouse(this);
+ }
+ }
+ }
+ } while ( posted );
+}
+
+void FB_InitOSKeymap(_THIS)
+{
+ int i;
+
+ /* Initialize the Linux key translation table */
+
+ /* First get the ascii keys and others not well handled */
+ for (i=0; i<SDL_arraysize(keymap); ++i) {
+ switch(i) {
+ /* These aren't handled by the x86 kernel keymapping (?) */
+ case SCANCODE_PRINTSCREEN:
+ keymap[i] = SDLK_PRINT;
+ break;
+ case SCANCODE_BREAK:
+ keymap[i] = SDLK_BREAK;
+ break;
+ case SCANCODE_BREAK_ALTERNATIVE:
+ keymap[i] = SDLK_PAUSE;
+ break;
+ case SCANCODE_LEFTSHIFT:
+ keymap[i] = SDLK_LSHIFT;
+ break;
+ case SCANCODE_RIGHTSHIFT:
+ keymap[i] = SDLK_RSHIFT;
+ break;
+ case SCANCODE_LEFTCONTROL:
+ keymap[i] = SDLK_LCTRL;
+ break;
+ case SCANCODE_RIGHTCONTROL:
+ keymap[i] = SDLK_RCTRL;
+ break;
+ case SCANCODE_RIGHTWIN:
+ keymap[i] = SDLK_RSUPER;
+ break;
+ case SCANCODE_LEFTWIN:
+ keymap[i] = SDLK_LSUPER;
+ break;
+ case SCANCODE_LEFTALT:
+ keymap[i] = SDLK_LALT;
+ break;
+ case SCANCODE_RIGHTALT:
+ keymap[i] = SDLK_RALT;
+ break;
+ case 127:
+ keymap[i] = SDLK_MENU;
+ break;
+ /* this should take care of all standard ascii keys */
+ default:
+ keymap[i] = KVAL(vga_keymap[0][i]);
+ break;
+ }
+ }
+ for (i=0; i<SDL_arraysize(keymap); ++i) {
+ switch(keymap_temp[i]) {
+ case K_F1: keymap[i] = SDLK_F1; break;
+ case K_F2: keymap[i] = SDLK_F2; break;
+ case K_F3: keymap[i] = SDLK_F3; break;
+ case K_F4: keymap[i] = SDLK_F4; break;
+ case K_F5: keymap[i] = SDLK_F5; break;
+ case K_F6: keymap[i] = SDLK_F6; break;
+ case K_F7: keymap[i] = SDLK_F7; break;
+ case K_F8: keymap[i] = SDLK_F8; break;
+ case K_F9: keymap[i] = SDLK_F9; break;
+ case K_F10: keymap[i] = SDLK_F10; break;
+ case K_F11: keymap[i] = SDLK_F11; break;
+ case K_F12: keymap[i] = SDLK_F12; break;
+
+ case K_DOWN: keymap[i] = SDLK_DOWN; break;
+ case K_LEFT: keymap[i] = SDLK_LEFT; break;
+ case K_RIGHT: keymap[i] = SDLK_RIGHT; break;
+ case K_UP: keymap[i] = SDLK_UP; break;
+
+ case K_P0: keymap[i] = SDLK_KP0; break;
+ case K_P1: keymap[i] = SDLK_KP1; break;
+ case K_P2: keymap[i] = SDLK_KP2; break;
+ case K_P3: keymap[i] = SDLK_KP3; break;
+ case K_P4: keymap[i] = SDLK_KP4; break;
+ case K_P5: keymap[i] = SDLK_KP5; break;
+ case K_P6: keymap[i] = SDLK_KP6; break;
+ case K_P7: keymap[i] = SDLK_KP7; break;
+ case K_P8: keymap[i] = SDLK_KP8; break;
+ case K_P9: keymap[i] = SDLK_KP9; break;
+ case K_PPLUS: keymap[i] = SDLK_KP_PLUS; break;
+ case K_PMINUS: keymap[i] = SDLK_KP_MINUS; break;
+ case K_PSTAR: keymap[i] = SDLK_KP_MULTIPLY; break;
+ case K_PSLASH: keymap[i] = SDLK_KP_DIVIDE; break;
+ case K_PENTER: keymap[i] = SDLK_KP_ENTER; break;
+ case K_PDOT: keymap[i] = SDLK_KP_PERIOD; break;
+
+ case K_SHIFT: if ( keymap[i] != SDLK_RSHIFT )
+ keymap[i] = SDLK_LSHIFT;
+ break;
+ case K_SHIFTL: keymap[i] = SDLK_LSHIFT; break;
+ case K_SHIFTR: keymap[i] = SDLK_RSHIFT; break;
+ case K_CTRL: if ( keymap[i] != SDLK_RCTRL )
+ keymap[i] = SDLK_LCTRL;
+ break;
+ case K_CTRLL: keymap[i] = SDLK_LCTRL; break;
+ case K_CTRLR: keymap[i] = SDLK_RCTRL; break;
+ case K_ALT: keymap[i] = SDLK_LALT; break;
+ case K_ALTGR: keymap[i] = SDLK_RALT; break;
+
+ case K_INSERT: keymap[i] = SDLK_INSERT; break;
+ case K_REMOVE: keymap[i] = SDLK_DELETE; break;
+ case K_PGUP: keymap[i] = SDLK_PAGEUP; break;
+ case K_PGDN: keymap[i] = SDLK_PAGEDOWN; break;
+ case K_FIND: keymap[i] = SDLK_HOME; break;
+ case K_SELECT: keymap[i] = SDLK_END; break;
+
+ case K_NUM: keymap[i] = SDLK_NUMLOCK; break;
+ case K_CAPS: keymap[i] = SDLK_CAPSLOCK; break;
+
+ case K_F13: keymap[i] = SDLK_PRINT; break;
+ case K_HOLD: keymap[i] = SDLK_SCROLLOCK; break;
+ case K_PAUSE: keymap[i] = SDLK_PAUSE; break;
+
+ case 127: keymap[i] = SDLK_BACKSPACE; break;
+
+ default: break;
+ }
+ }
+}
+
+static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym)
+{
+ /* Set the keysym information */
+ keysym->scancode = scancode;
+ keysym->sym = keymap[scancode];
+ keysym->mod = KMOD_NONE;
+
+ /* If UNICODE is on, get the UNICODE value for the key */
+ keysym->unicode = 0;
+ if ( SDL_TranslateUNICODE ) {
+ int map;
+ SDLMod modstate;
+
+ modstate = SDL_GetModState();
+ map = 0;
+ if ( modstate & KMOD_SHIFT ) {
+ map |= (1<<KG_SHIFT);
+ }
+ if ( modstate & KMOD_CTRL ) {
+ map |= (1<<KG_CTRL);
+ }
+ if ( modstate & KMOD_LALT ) {
+ map |= (1<<KG_ALT);
+ }
+ if ( modstate & KMOD_RALT ) {
+ map |= (1<<KG_ALTGR);
+ }
+ if ( KTYP(vga_keymap[map][scancode]) == KT_LETTER ) {
+ if ( modstate & KMOD_CAPS ) {
+ map ^= (1<<KG_SHIFT);
+ }
+ }
+ if ( KTYP(vga_keymap[map][scancode]) == KT_PAD ) {
+ if ( modstate & KMOD_NUM ) {
+ keysym->unicode=KVAL(vga_keymap[map][scancode]);
+ }
+ } else {
+ keysym->unicode = KVAL(vga_keymap[map][scancode]);
+ }
+ }
+ return(keysym);
+}
diff --git a/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbevents_c.h b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbevents_c.h
new file mode 100644
index 0000000..fe8b09c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbevents_c.h
@@ -0,0 +1,38 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_fbvideo.h"
+
+/* Variables and functions exported by SDL_sysevents.c to other parts
+ of the native video subsystem (SDL_sysvideo.c)
+*/
+extern int FB_OpenKeyboard(_THIS);
+extern void FB_CloseKeyboard(_THIS);
+extern int FB_OpenMouse(_THIS);
+extern void FB_CloseMouse(_THIS);
+extern int FB_EnterGraphicsMode(_THIS);
+extern int FB_InGraphicsMode(_THIS);
+extern void FB_LeaveGraphicsMode(_THIS);
+
+extern void FB_InitOSKeymap(_THIS);
+extern void FB_PumpEvents(_THIS);
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbkeys.h b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbkeys.h
index 2b01b6b..2b01b6b 100644
--- a/distrib/sdl-1.2.12/src/video/fbcon/SDL_fbkeys.h
+++ b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbkeys.h
diff --git a/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbmatrox.c b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbmatrox.c
new file mode 100644
index 0000000..04b90b0
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbmatrox.c
@@ -0,0 +1,280 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_video.h"
+#include "../SDL_blit.h"
+#include "SDL_fbmatrox.h"
+#include "matrox_mmio.h"
+
+
+/* Wait for vertical retrace - taken from the XFree86 Matrox driver */
+static void WaitVBL(_THIS)
+{
+ int count;
+
+ /* find start of retrace */
+ mga_waitidle();
+ while ( (mga_in8(0x1FDA) & 0x08) )
+ ;
+ while ( !(mga_in8(0x1FDA) & 0x08) )
+ ;
+ /* wait until we're past the start */
+ count = mga_in32(0x1E20) + 2;
+ while ( mga_in32(0x1E20) < count )
+ ;
+}
+static void WaitIdle(_THIS)
+{
+ mga_waitidle();
+}
+
+/* Sets video mem colorkey and accelerated blit function */
+static int SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key)
+{
+ return(0);
+}
+
+/* Sets per surface hardware alpha value */
+#if 0
+static int SetHWAlpha(_THIS, SDL_Surface *surface, Uint8 value)
+{
+ return(0);
+}
+#endif
+
+static int FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color)
+{
+ int dstX, dstY;
+ Uint32 fxbndry;
+ Uint32 ydstlen;
+ Uint32 fillop;
+
+ /* Don't blit to the display surface when switched away */
+ if ( switched_away ) {
+ return -2; /* no hardware access */
+ }
+ if ( dst == this->screen ) {
+ SDL_mutexP(hw_lock);
+ }
+
+ switch (dst->format->BytesPerPixel) {
+ case 1:
+ color |= (color<<8);
+ case 2:
+ color |= (color<<16);
+ break;
+ }
+
+ /* Set up the X/Y base coordinates */
+ FB_dst_to_xy(this, dst, &dstX, &dstY);
+
+ /* Adjust for the current rectangle */
+ dstX += rect->x;
+ dstY += rect->y;
+
+ /* Set up the X boundaries */
+ fxbndry = (dstX | ((dstX+rect->w) << 16));
+
+ /* Set up the Y boundaries */
+ ydstlen = (rect->h | (dstY << 16));
+
+ /* Set up for color fill operation */
+ fillop = MGADWG_TRAP | MGADWG_SOLID |
+ MGADWG_ARZERO | MGADWG_SGNZERO | MGADWG_SHIFTZERO;
+
+ /* Execute the operations! */
+ mga_wait(5);
+ mga_out32(MGAREG_DWGCTL, fillop | MGADWG_REPLACE);
+ mga_out32(MGAREG_FCOL, color);
+ mga_out32(MGAREG_FXBNDRY, fxbndry);
+ mga_out32(MGAREG_YDSTLEN + MGAREG_EXEC, ydstlen);
+
+ FB_AddBusySurface(dst);
+
+ if ( dst == this->screen ) {
+ SDL_mutexV(hw_lock);
+ }
+ return(0);
+}
+
+static int HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect)
+{
+ SDL_VideoDevice *this = current_video;
+ int pitch, w, h;
+ int srcX, srcY;
+ int dstX, dstY;
+ Uint32 sign;
+ Uint32 start, stop;
+ int skip;
+ Uint32 blitop;
+
+ /* FIXME: For now, only blit to display surface */
+ if ( dst->pitch != SDL_VideoSurface->pitch ) {
+ return(src->map->sw_blit(src, srcrect, dst, dstrect));
+ }
+
+ /* Don't blit to the display surface when switched away */
+ if ( switched_away ) {
+ return -2; /* no hardware access */
+ }
+ if ( dst == this->screen ) {
+ SDL_mutexP(hw_lock);
+ }
+
+ /* Calculate source and destination base coordinates (in pixels) */
+ w = dstrect->w;
+ h = dstrect->h;
+ FB_dst_to_xy(this, src, &srcX, &srcY);
+ FB_dst_to_xy(this, dst, &dstX, &dstY);
+
+ /* Adjust for the current blit rectangles */
+ srcX += srcrect->x;
+ srcY += srcrect->y;
+ dstX += dstrect->x;
+ dstY += dstrect->y;
+ pitch = dst->pitch/dst->format->BytesPerPixel;
+
+ /* Set up the blit direction (sign) flags */
+ sign = 0;
+ if ( srcX < dstX ) {
+ sign |= 1;
+ }
+ if ( srcY < dstY ) {
+ sign |= 4;
+ srcY += (h - 1);
+ dstY += (h - 1);
+ }
+
+ /* Set up the blit source row start, end, and skip (in pixels) */
+ stop = start = (srcY * pitch) + srcX;
+ if ( srcX < dstX ) {
+ start += (w - 1);
+ } else {
+ stop += (w - 1);
+ }
+ if ( srcY < dstY ) {
+ skip = -pitch;
+ } else {
+ skip = pitch;
+ }
+
+ /* Set up the blit operation */
+ if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
+ Uint32 colorkey;
+
+ blitop = MGADWG_BFCOL | MGADWG_BITBLT |
+ MGADWG_SHIFTZERO | MGADWG_RSTR | (0x0C << 16) |
+ MGADWG_TRANSC;
+
+ colorkey = src->format->colorkey;
+ switch (dst->format->BytesPerPixel) {
+ case 1:
+ colorkey |= (colorkey<<8);
+ case 2:
+ colorkey |= (colorkey<<16);
+ break;
+ }
+ mga_wait(2);
+ mga_out32(MGAREG_FCOL, colorkey);
+ mga_out32(MGAREG_BCOL, 0xFFFFFFFF);
+ } else {
+ blitop = MGADWG_BFCOL | MGADWG_BITBLT |
+ MGADWG_SHIFTZERO | MGADWG_RSTR | (0x0C << 16);
+ }
+ mga_wait(7);
+ mga_out32(MGAREG_SGN, sign);
+ mga_out32(MGAREG_AR3, start);
+ mga_out32(MGAREG_AR0, stop);
+ mga_out32(MGAREG_AR5, skip);
+ mga_out32(MGAREG_FXBNDRY, (dstX | ((dstX + w-1) << 16)));
+ mga_out32(MGAREG_YDSTLEN, (dstY << 16) | h);
+ mga_out32(MGAREG_DWGCTL + MGAREG_EXEC, blitop);
+
+ FB_AddBusySurface(src);
+ FB_AddBusySurface(dst);
+
+ if ( dst == this->screen ) {
+ SDL_mutexV(hw_lock);
+ }
+ return(0);
+}
+
+static int CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst)
+{
+ int accelerated;
+
+ /* Set initial acceleration on */
+ src->flags |= SDL_HWACCEL;
+
+ /* Set the surface attributes */
+ if ( (src->flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
+ if ( ! this->info.blit_hw_A ) {
+ src->flags &= ~SDL_HWACCEL;
+ }
+ }
+ if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
+ if ( ! this->info.blit_hw_CC ) {
+ src->flags &= ~SDL_HWACCEL;
+ }
+ }
+
+ /* Check to see if final surface blit is accelerated */
+ accelerated = !!(src->flags & SDL_HWACCEL);
+ if ( accelerated ) {
+ src->map->hw_blit = HWAccelBlit;
+ }
+ return(accelerated);
+}
+
+void FB_MatroxAccel(_THIS, __u32 card)
+{
+ /* We have hardware accelerated surface functions */
+ this->CheckHWBlit = CheckHWBlit;
+ wait_vbl = WaitVBL;
+ wait_idle = WaitIdle;
+
+ /* The Matrox has an accelerated color fill */
+ this->info.blit_fill = 1;
+ this->FillHWRect = FillHWRect;
+
+ /* The Matrox has accelerated normal and colorkey blits. */
+ this->info.blit_hw = 1;
+ /* The Millenium I appears to do the colorkey test a word
+ at a time, and the transparency is intverted. (?)
+ */
+ if ( card != FB_ACCEL_MATROX_MGA2064W ) {
+ this->info.blit_hw_CC = 1;
+ this->SetHWColorKey = SetHWColorKey;
+ }
+
+#if 0 /* Not yet implemented? */
+ /* The Matrox G200/G400 has an accelerated alpha blit */
+ if ( (card == FB_ACCEL_MATROX_MGAG200)
+ || (card == FB_ACCEL_MATROX_MGAG400)
+ ) {
+ this->info.blit_hw_A = 1;
+ this->SetHWAlpha = SetHWAlpha;
+ }
+#endif
+}
diff --git a/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbmatrox.h b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbmatrox.h
new file mode 100644
index 0000000..f7d41b0
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbmatrox.h
@@ -0,0 +1,29 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Matrox hardware acceleration for the SDL framebuffer console driver */
+
+#include "SDL_fbvideo.h"
+
+/* Set up the driver for Matrox acceleration */
+extern void FB_MatroxAccel(_THIS, __u32 card);
diff --git a/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbmouse.c b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbmouse.c
new file mode 100644
index 0000000..d65f27e
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbmouse.c
@@ -0,0 +1,33 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_mouse.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_fbvideo.h"
+#include "SDL_fbmouse_c.h"
+
+
+/* The implementation dependent data for the window manager cursor */
+struct WMcursor {
+ int unused;
+};
diff --git a/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbmouse_c.h b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbmouse_c.h
new file mode 100644
index 0000000..fbb031d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbmouse_c.h
@@ -0,0 +1,26 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_fbvideo.h"
+
+/* Functions to be exported */
diff --git a/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbriva.c b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbriva.c
new file mode 100644
index 0000000..eb4b71f
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbriva.c
@@ -0,0 +1,222 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_video.h"
+#include "../SDL_blit.h"
+#include "SDL_fbriva.h"
+#include "riva_mmio.h"
+#include "riva_regs.h"
+
+
+static int FifoEmptyCount = 0;
+static int FifoFreeCount = 0;
+
+/* Wait for vertical retrace */
+static void WaitVBL(_THIS)
+{
+ volatile Uint8 *port = (Uint8 *)(mapped_io + PCIO_OFFSET + 0x3DA);
+
+ while ( (*port & 0x08) )
+ ;
+ while ( !(*port & 0x08) )
+ ;
+}
+static void NV3WaitIdle(_THIS)
+{
+ RivaRop *Rop = (RivaRop *)(mapped_io + ROP_OFFSET);
+ while ( (Rop->FifoFree < FifoEmptyCount) ||
+ (*(mapped_io + PGRAPH_OFFSET + 0x000006B0) & 0x01) )
+ ;
+}
+static void NV4WaitIdle(_THIS)
+{
+ RivaRop *Rop = (RivaRop *)(mapped_io + ROP_OFFSET);
+ while ( (Rop->FifoFree < FifoEmptyCount) ||
+ (*(mapped_io + PGRAPH_OFFSET + 0x00000700) & 0x01) )
+ ;
+}
+
+#if 0 /* Not yet implemented? */
+/* Sets video mem colorkey and accelerated blit function */
+static int SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key)
+{
+ return(0);
+}
+
+/* Sets per surface hardware alpha value */
+static int SetHWAlpha(_THIS, SDL_Surface *surface, Uint8 value)
+{
+ return(0);
+}
+#endif /* Not yet implemented */
+
+static int FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color)
+{
+ int dstX, dstY;
+ int dstW, dstH;
+ RivaBitmap *Bitmap = (RivaBitmap *)(mapped_io + BITMAP_OFFSET);
+
+ /* Don't blit to the display surface when switched away */
+ if ( switched_away ) {
+ return -2; /* no hardware access */
+ }
+ if ( dst == this->screen ) {
+ SDL_mutexP(hw_lock);
+ }
+
+ /* Set up the X/Y base coordinates */
+ dstW = rect->w;
+ dstH = rect->h;
+ FB_dst_to_xy(this, dst, &dstX, &dstY);
+
+ /* Adjust for the current rectangle */
+ dstX += rect->x;
+ dstY += rect->y;
+
+ RIVA_FIFO_FREE(Bitmap, 1);
+ Bitmap->Color1A = color;
+
+ RIVA_FIFO_FREE(Bitmap, 2);
+ Bitmap->UnclippedRectangle[0].TopLeft = (dstX << 16) | dstY;
+ Bitmap->UnclippedRectangle[0].WidthHeight = (dstW << 16) | dstH;
+
+ FB_AddBusySurface(dst);
+
+ if ( dst == this->screen ) {
+ SDL_mutexV(hw_lock);
+ }
+ return(0);
+}
+
+static int HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect)
+{
+ SDL_VideoDevice *this = current_video;
+ int srcX, srcY;
+ int dstX, dstY;
+ int dstW, dstH;
+ RivaScreenBlt *Blt = (RivaScreenBlt *)(mapped_io + BLT_OFFSET);
+
+ /* FIXME: For now, only blit to display surface */
+ if ( dst->pitch != SDL_VideoSurface->pitch ) {
+ return(src->map->sw_blit(src, srcrect, dst, dstrect));
+ }
+
+ /* Don't blit to the display surface when switched away */
+ if ( switched_away ) {
+ return -2; /* no hardware access */
+ }
+ if ( dst == this->screen ) {
+ SDL_mutexP(hw_lock);
+ }
+
+ /* Calculate source and destination base coordinates (in pixels) */
+ dstW = dstrect->w;
+ dstH = dstrect->h;
+ FB_dst_to_xy(this, src, &srcX, &srcY);
+ FB_dst_to_xy(this, dst, &dstX, &dstY);
+
+ /* Adjust for the current blit rectangles */
+ srcX += srcrect->x;
+ srcY += srcrect->y;
+ dstX += dstrect->x;
+ dstY += dstrect->y;
+
+ RIVA_FIFO_FREE(Blt, 3);
+ Blt->TopLeftSrc = (srcY << 16) | srcX;
+ Blt->TopLeftDst = (dstY << 16) | dstX;
+ Blt->WidthHeight = (dstH << 16) | dstW;
+
+ FB_AddBusySurface(src);
+ FB_AddBusySurface(dst);
+
+ if ( dst == this->screen ) {
+ SDL_mutexV(hw_lock);
+ }
+ return(0);
+}
+
+static int CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst)
+{
+ int accelerated;
+
+ /* Set initial acceleration on */
+ src->flags |= SDL_HWACCEL;
+
+ /* Set the surface attributes */
+ if ( (src->flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
+ if ( ! this->info.blit_hw_A ) {
+ src->flags &= ~SDL_HWACCEL;
+ }
+ }
+ if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
+ if ( ! this->info.blit_hw_CC ) {
+ src->flags &= ~SDL_HWACCEL;
+ }
+ }
+
+ /* Check to see if final surface blit is accelerated */
+ accelerated = !!(src->flags & SDL_HWACCEL);
+ if ( accelerated ) {
+ src->map->hw_blit = HWAccelBlit;
+ }
+ return(accelerated);
+}
+
+void FB_RivaAccel(_THIS, __u32 card)
+{
+ RivaRop *Rop = (RivaRop *)(mapped_io + ROP_OFFSET);
+
+ /* We have hardware accelerated surface functions */
+ this->CheckHWBlit = CheckHWBlit;
+ wait_vbl = WaitVBL;
+ switch (card) {
+ case FB_ACCEL_NV3:
+ wait_idle = NV3WaitIdle;
+ break;
+ case FB_ACCEL_NV4:
+ wait_idle = NV4WaitIdle;
+ break;
+ default:
+ /* Hmm... FIXME */
+ break;
+ }
+ FifoEmptyCount = Rop->FifoFree;
+
+ /* The Riva has an accelerated color fill */
+ this->info.blit_fill = 1;
+ this->FillHWRect = FillHWRect;
+
+ /* The Riva has accelerated normal and colorkey blits. */
+ this->info.blit_hw = 1;
+#if 0 /* Not yet implemented? */
+ this->info.blit_hw_CC = 1;
+ this->SetHWColorKey = SetHWColorKey;
+#endif
+
+#if 0 /* Not yet implemented? */
+ /* The Riva has an accelerated alpha blit */
+ this->info.blit_hw_A = 1;
+ this->SetHWAlpha = SetHWAlpha;
+#endif
+}
diff --git a/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbriva.h b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbriva.h
new file mode 100644
index 0000000..c78682e
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbriva.h
@@ -0,0 +1,36 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Riva hardware acceleration for the SDL framebuffer console driver */
+
+#include "SDL_fbvideo.h"
+
+#ifndef FB_ACCEL_NV3
+#define FB_ACCEL_NV3 27
+#endif
+#ifndef FB_ACCEL_NV4
+#define FB_ACCEL_NV4 28
+#endif
+
+/* Set up the driver for Riva acceleration */
+extern void FB_RivaAccel(_THIS, __u32 card);
diff --git a/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbvideo.c b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbvideo.c
new file mode 100644
index 0000000..5e58809
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbvideo.c
@@ -0,0 +1,1982 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Framebuffer console based SDL video driver implementation.
+*/
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+
+#ifndef HAVE_GETPAGESIZE
+#include <asm/page.h> /* For definition of PAGE_SIZE */
+#endif
+
+#include <linux/vt.h>
+
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_fbvideo.h"
+#include "SDL_fbmouse_c.h"
+#include "SDL_fbevents_c.h"
+#include "SDL_fb3dfx.h"
+#include "SDL_fbmatrox.h"
+#include "SDL_fbriva.h"
+
+/*#define FBCON_DEBUG*/
+
+#if defined(i386) && defined(FB_TYPE_VGA_PLANES)
+#define VGA16_FBCON_SUPPORT
+#include <sys/io.h> /* For ioperm() */
+#ifndef FB_AUX_VGA_PLANES_VGA4
+#define FB_AUX_VGA_PLANES_VGA4 0
+#endif
+/*
+static inline void outb (unsigned char value, unsigned short port)
+{
+ __asm__ __volatile__ ("outb %b0,%w1"::"a" (value), "Nd" (port));
+}
+*/
+#endif /* FB_TYPE_VGA_PLANES */
+
+/* A list of video resolutions that we query for (sorted largest to smallest) */
+static const SDL_Rect checkres[] = {
+ { 0, 0, 1600, 1200 }, /* 16 bpp: 0x11E, or 286 */
+ { 0, 0, 1408, 1056 }, /* 16 bpp: 0x19A, or 410 */
+ { 0, 0, 1280, 1024 }, /* 16 bpp: 0x11A, or 282 */
+ { 0, 0, 1152, 864 }, /* 16 bpp: 0x192, or 402 */
+ { 0, 0, 1024, 768 }, /* 16 bpp: 0x117, or 279 */
+ { 0, 0, 960, 720 }, /* 16 bpp: 0x18A, or 394 */
+ { 0, 0, 800, 600 }, /* 16 bpp: 0x114, or 276 */
+ { 0, 0, 768, 576 }, /* 16 bpp: 0x182, or 386 */
+ { 0, 0, 720, 576 }, /* PAL */
+ { 0, 0, 720, 480 }, /* NTSC */
+ { 0, 0, 640, 480 }, /* 16 bpp: 0x111, or 273 */
+ { 0, 0, 640, 400 }, /* 8 bpp: 0x100, or 256 */
+ { 0, 0, 512, 384 },
+ { 0, 0, 320, 240 },
+ { 0, 0, 320, 200 }
+};
+static const struct {
+ int xres;
+ int yres;
+ int pixclock;
+ int left;
+ int right;
+ int upper;
+ int lower;
+ int hslen;
+ int vslen;
+ int sync;
+ int vmode;
+} vesa_timings[] = {
+#ifdef USE_VESA_TIMINGS /* Only tested on Matrox Millenium I */
+ { 640, 400, 39771, 48, 16, 39, 8, 96, 2, 2, 0 }, /* 70 Hz */
+ { 640, 480, 39683, 48, 16, 33, 10, 96, 2, 0, 0 }, /* 60 Hz */
+ { 768, 576, 26101, 144, 16, 28, 6, 112, 4, 0, 0 }, /* 60 Hz */
+ { 800, 600, 24038, 144, 24, 28, 8, 112, 6, 0, 0 }, /* 60 Hz */
+ { 960, 720, 17686, 144, 24, 28, 8, 112, 4, 0, 0 }, /* 60 Hz */
+ { 1024, 768, 15386, 160, 32, 30, 4, 128, 4, 0, 0 }, /* 60 Hz */
+ { 1152, 864, 12286, 192, 32, 30, 4, 128, 4, 0, 0 }, /* 60 Hz */
+ { 1280, 1024, 9369, 224, 32, 32, 4, 136, 4, 0, 0 }, /* 60 Hz */
+ { 1408, 1056, 8214, 256, 40, 32, 5, 144, 5, 0, 0 }, /* 60 Hz */
+ { 1600, 1200,/*?*/0, 272, 48, 32, 5, 152, 5, 0, 0 }, /* 60 Hz */
+#else
+ /* You can generate these timings from your XF86Config file using
+ the 'modeline2fb' perl script included with the fbset package.
+ These timings were generated for Matrox Millenium I, 15" monitor.
+ */
+ { 320, 200, 79440, 16, 16, 20, 4, 48, 1, 0, 2 }, /* 70 Hz */
+ { 320, 240, 63492, 16, 16, 16, 4, 48, 2, 0, 2 }, /* 72 Hz */
+ { 512, 384, 49603, 48, 16, 16, 1, 64, 3, 0, 0 }, /* 78 Hz */
+ { 640, 400, 31746, 96, 32, 41, 1, 64, 3, 2, 0 }, /* 85 Hz */
+ { 640, 480, 31746, 120, 16, 16, 1, 64, 3, 0, 0 }, /* 75 Hz */
+ { 768, 576, 26101, 144, 16, 28, 6, 112, 4, 0, 0 }, /* 60 Hz */
+ { 800, 600, 20000, 64, 56, 23, 37, 120, 6, 3, 0 }, /* 72 Hz */
+ { 960, 720, 17686, 144, 24, 28, 8, 112, 4, 0, 0 }, /* 60 Hz */
+ { 1024, 768, 13333, 144, 24, 29, 3, 136, 6, 0, 0 }, /* 70 Hz */
+ { 1152, 864, 12286, 192, 32, 30, 4, 128, 4, 0, 0 }, /* 60 Hz */
+ { 1280, 1024, 9369, 224, 32, 32, 4, 136, 4, 0, 0 }, /* 60 Hz */
+ { 1408, 1056, 8214, 256, 40, 32, 5, 144, 5, 0, 0 }, /* 60 Hz */
+ { 1600, 1200,/*?*/0, 272, 48, 32, 5, 152, 5, 0, 0 }, /* 60 Hz */
+#endif
+};
+enum {
+ FBCON_ROTATE_NONE = 0,
+ FBCON_ROTATE_CCW = 90,
+ FBCON_ROTATE_UD = 180,
+ FBCON_ROTATE_CW = 270
+};
+
+#define min(a,b) ((a)<(b)?(a):(b))
+
+/* Initialization/Query functions */
+static int FB_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **FB_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *FB_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+#ifdef VGA16_FBCON_SUPPORT
+static SDL_Surface *FB_SetVGA16Mode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+#endif
+static int FB_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
+static void FB_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int FB_InitHWSurfaces(_THIS, SDL_Surface *screen, char *base, int size);
+static void FB_FreeHWSurfaces(_THIS);
+static int FB_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int FB_LockHWSurface(_THIS, SDL_Surface *surface);
+static void FB_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void FB_FreeHWSurface(_THIS, SDL_Surface *surface);
+static void FB_WaitVBL(_THIS);
+static void FB_WaitIdle(_THIS);
+static int FB_FlipHWSurface(_THIS, SDL_Surface *surface);
+
+/* Internal palette functions */
+static void FB_SavePalette(_THIS, struct fb_fix_screeninfo *finfo,
+ struct fb_var_screeninfo *vinfo);
+static void FB_RestorePalette(_THIS);
+
+/* Shadow buffer functions */
+static FB_bitBlit FB_blit16;
+static FB_bitBlit FB_blit16blocked;
+
+static int SDL_getpagesize(void)
+{
+#ifdef HAVE_GETPAGESIZE
+ return getpagesize();
+#elif defined(PAGE_SIZE)
+ return PAGE_SIZE;
+#else
+#error Can not determine system page size.
+ return 4096; /* this is what it USED to be in Linux... */
+#endif
+}
+
+
+/* Small wrapper for mmap() so we can play nicely with no-mmu hosts
+ * (non-mmu hosts disallow the MAP_SHARED flag) */
+
+static void *do_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset)
+{
+ void *ret;
+ ret = mmap(start, length, prot, flags, fd, offset);
+ if ( ret == (char *)-1 && (flags & MAP_SHARED) ) {
+ ret = mmap(start, length, prot,
+ (flags & ~MAP_SHARED) | MAP_PRIVATE, fd, offset);
+ }
+ return ret;
+}
+
+/* FB driver bootstrap functions */
+
+static int FB_Available(void)
+{
+ int console = -1;
+ /* Added check for /fb/0 (devfs) */
+ /* but - use environment variable first... if it fails, still check defaults */
+ int idx = 0;
+ const char *SDL_fbdevs[4] = { NULL, "/dev/fb0", "/dev/fb/0", NULL };
+
+ SDL_fbdevs[0] = SDL_getenv("SDL_FBDEV");
+ if( !SDL_fbdevs[0] )
+ idx++;
+ for( ; SDL_fbdevs[idx]; idx++ )
+ {
+ console = open(SDL_fbdevs[idx], O_RDWR, 0);
+ if ( console >= 0 ) {
+ close(console);
+ break;
+ }
+ }
+ return(console >= 0);
+}
+
+static void FB_DeleteDevice(SDL_VideoDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_VideoDevice *FB_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+ wait_vbl = FB_WaitVBL;
+ wait_idle = FB_WaitIdle;
+ mouse_fd = -1;
+ keyboard_fd = -1;
+
+ /* Set the function pointers */
+ this->VideoInit = FB_VideoInit;
+ this->ListModes = FB_ListModes;
+ this->SetVideoMode = FB_SetVideoMode;
+ this->SetColors = FB_SetColors;
+ this->UpdateRects = NULL;
+ this->VideoQuit = FB_VideoQuit;
+ this->AllocHWSurface = FB_AllocHWSurface;
+ this->CheckHWBlit = NULL;
+ this->FillHWRect = NULL;
+ this->SetHWColorKey = NULL;
+ this->SetHWAlpha = NULL;
+ this->LockHWSurface = FB_LockHWSurface;
+ this->UnlockHWSurface = FB_UnlockHWSurface;
+ this->FlipHWSurface = FB_FlipHWSurface;
+ this->FreeHWSurface = FB_FreeHWSurface;
+ this->SetCaption = NULL;
+ this->SetIcon = NULL;
+ this->IconifyWindow = NULL;
+ this->GrabInput = NULL;
+ this->GetWMInfo = NULL;
+ this->InitOSKeymap = FB_InitOSKeymap;
+ this->PumpEvents = FB_PumpEvents;
+
+ this->free = FB_DeleteDevice;
+
+ return this;
+}
+
+VideoBootStrap FBCON_bootstrap = {
+ "fbcon", "Linux Framebuffer Console",
+ FB_Available, FB_CreateDevice
+};
+
+#define FB_MODES_DB "/etc/fb.modes"
+
+static int read_fbmodes_line(FILE*f, char* line, int length)
+{
+ int blank;
+ char* c;
+ int i;
+
+ blank=0;
+ /* find a relevant line */
+ do
+ {
+ if (!fgets(line,length,f))
+ return 0;
+ c=line;
+ while(((*c=='\t')||(*c==' '))&&(*c!=0))
+ c++;
+
+ if ((*c=='\n')||(*c=='#')||(*c==0))
+ blank=1;
+ else
+ blank=0;
+ }
+ while(blank);
+ /* remove whitespace at the begining of the string */
+ i=0;
+ do
+ {
+ line[i]=c[i];
+ i++;
+ }
+ while(c[i]!=0);
+ return 1;
+}
+
+static int read_fbmodes_mode(FILE *f, struct fb_var_screeninfo *vinfo)
+{
+ char line[1024];
+ char option[256];
+
+ /* Find a "geometry" */
+ do {
+ if (read_fbmodes_line(f, line, sizeof(line))==0)
+ return 0;
+ if (SDL_strncmp(line,"geometry",8)==0)
+ break;
+ }
+ while(1);
+
+ SDL_sscanf(line, "geometry %d %d %d %d %d", &vinfo->xres, &vinfo->yres,
+ &vinfo->xres_virtual, &vinfo->yres_virtual, &vinfo->bits_per_pixel);
+ if (read_fbmodes_line(f, line, sizeof(line))==0)
+ return 0;
+
+ SDL_sscanf(line, "timings %d %d %d %d %d %d %d", &vinfo->pixclock,
+ &vinfo->left_margin, &vinfo->right_margin, &vinfo->upper_margin,
+ &vinfo->lower_margin, &vinfo->hsync_len, &vinfo->vsync_len);
+
+ vinfo->sync=0;
+ vinfo->vmode=FB_VMODE_NONINTERLACED;
+
+ /* Parse misc options */
+ do {
+ if (read_fbmodes_line(f, line, sizeof(line))==0)
+ return 0;
+
+ if (SDL_strncmp(line,"hsync",5)==0) {
+ SDL_sscanf(line,"hsync %s",option);
+ if (SDL_strncmp(option,"high",4)==0)
+ vinfo->sync |= FB_SYNC_HOR_HIGH_ACT;
+ }
+ else if (SDL_strncmp(line,"vsync",5)==0) {
+ SDL_sscanf(line,"vsync %s",option);
+ if (SDL_strncmp(option,"high",4)==0)
+ vinfo->sync |= FB_SYNC_VERT_HIGH_ACT;
+ }
+ else if (SDL_strncmp(line,"csync",5)==0) {
+ SDL_sscanf(line,"csync %s",option);
+ if (SDL_strncmp(option,"high",4)==0)
+ vinfo->sync |= FB_SYNC_COMP_HIGH_ACT;
+ }
+ else if (SDL_strncmp(line,"extsync",5)==0) {
+ SDL_sscanf(line,"extsync %s",option);
+ if (SDL_strncmp(option,"true",4)==0)
+ vinfo->sync |= FB_SYNC_EXT;
+ }
+ else if (SDL_strncmp(line,"laced",5)==0) {
+ SDL_sscanf(line,"laced %s",option);
+ if (SDL_strncmp(option,"true",4)==0)
+ vinfo->vmode |= FB_VMODE_INTERLACED;
+ }
+ else if (SDL_strncmp(line,"double",6)==0) {
+ SDL_sscanf(line,"double %s",option);
+ if (SDL_strncmp(option,"true",4)==0)
+ vinfo->vmode |= FB_VMODE_DOUBLE;
+ }
+ }
+ while(SDL_strncmp(line,"endmode",7)!=0);
+
+ return 1;
+}
+
+static int FB_CheckMode(_THIS, struct fb_var_screeninfo *vinfo,
+ int index, unsigned int *w, unsigned int *h)
+{
+ int mode_okay;
+
+ mode_okay = 0;
+ vinfo->bits_per_pixel = (index+1)*8;
+ vinfo->xres = *w;
+ vinfo->xres_virtual = *w;
+ vinfo->yres = *h;
+ vinfo->yres_virtual = *h;
+ vinfo->activate = FB_ACTIVATE_TEST;
+ if ( ioctl(console_fd, FBIOPUT_VSCREENINFO, vinfo) == 0 ) {
+#ifdef FBCON_DEBUG
+ fprintf(stderr, "Checked mode %dx%d at %d bpp, got mode %dx%d at %d bpp\n", *w, *h, (index+1)*8, vinfo->xres, vinfo->yres, vinfo->bits_per_pixel);
+#endif
+ if ( (((vinfo->bits_per_pixel+7)/8)-1) == index ) {
+ *w = vinfo->xres;
+ *h = vinfo->yres;
+ mode_okay = 1;
+ }
+ }
+ return mode_okay;
+}
+
+static int FB_AddMode(_THIS, int index, unsigned int w, unsigned int h, int check_timings)
+{
+ SDL_Rect *mode;
+ int i;
+ int next_mode;
+
+ /* Check to see if we already have this mode */
+ if ( SDL_nummodes[index] > 0 ) {
+ mode = SDL_modelist[index][SDL_nummodes[index]-1];
+ if ( (mode->w == w) && (mode->h == h) ) {
+#ifdef FBCON_DEBUG
+ fprintf(stderr, "We already have mode %dx%d at %d bytes per pixel\n", w, h, index+1);
+#endif
+ return(0);
+ }
+ }
+
+ /* Only allow a mode if we have a valid timing for it */
+ if ( check_timings ) {
+ int found_timing = 0;
+ for ( i=0; i<(sizeof(vesa_timings)/sizeof(vesa_timings[0])); ++i ) {
+ if ( (w == vesa_timings[i].xres) &&
+ (h == vesa_timings[i].yres) && vesa_timings[i].pixclock ) {
+ found_timing = 1;
+ break;
+ }
+ }
+ if ( !found_timing ) {
+#ifdef FBCON_DEBUG
+ fprintf(stderr, "No valid timing line for mode %dx%d\n", w, h);
+#endif
+ return(0);
+ }
+ }
+
+ /* Set up the new video mode rectangle */
+ mode = (SDL_Rect *)SDL_malloc(sizeof *mode);
+ if ( mode == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ mode->x = 0;
+ mode->y = 0;
+ mode->w = w;
+ mode->h = h;
+#ifdef FBCON_DEBUG
+ fprintf(stderr, "Adding mode %dx%d at %d bytes per pixel\n", w, h, index+1);
+#endif
+
+ /* Allocate the new list of modes, and fill in the new mode */
+ next_mode = SDL_nummodes[index];
+ SDL_modelist[index] = (SDL_Rect **)
+ SDL_realloc(SDL_modelist[index], (1+next_mode+1)*sizeof(SDL_Rect *));
+ if ( SDL_modelist[index] == NULL ) {
+ SDL_OutOfMemory();
+ SDL_nummodes[index] = 0;
+ SDL_free(mode);
+ return(-1);
+ }
+ SDL_modelist[index][next_mode] = mode;
+ SDL_modelist[index][next_mode+1] = NULL;
+ SDL_nummodes[index]++;
+
+ return(0);
+}
+
+static int cmpmodes(const void *va, const void *vb)
+{
+ const SDL_Rect *a = *(const SDL_Rect**)va;
+ const SDL_Rect *b = *(const SDL_Rect**)vb;
+ if ( a->h == b->h )
+ return b->w - a->w;
+ else
+ return b->h - a->h;
+}
+
+static void FB_SortModes(_THIS)
+{
+ int i;
+ for ( i=0; i<NUM_MODELISTS; ++i ) {
+ if ( SDL_nummodes[i] > 0 ) {
+ SDL_qsort(SDL_modelist[i], SDL_nummodes[i], sizeof *SDL_modelist[i], cmpmodes);
+ }
+ }
+}
+
+static int FB_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ const int pagesize = SDL_getpagesize();
+ struct fb_fix_screeninfo finfo;
+ struct fb_var_screeninfo vinfo;
+ int i, j;
+ int current_index;
+ unsigned int current_w;
+ unsigned int current_h;
+ const char *SDL_fbdev;
+ const char *rotation;
+ FILE *modesdb;
+
+ /* Initialize the library */
+ SDL_fbdev = SDL_getenv("SDL_FBDEV");
+ if ( SDL_fbdev == NULL ) {
+ SDL_fbdev = "/dev/fb0";
+ }
+ console_fd = open(SDL_fbdev, O_RDWR, 0);
+ if ( console_fd < 0 ) {
+ SDL_SetError("Unable to open %s", SDL_fbdev);
+ return(-1);
+ }
+
+#if !SDL_THREADS_DISABLED
+ /* Create the hardware surface lock mutex */
+ hw_lock = SDL_CreateMutex();
+ if ( hw_lock == NULL ) {
+ SDL_SetError("Unable to create lock mutex");
+ FB_VideoQuit(this);
+ return(-1);
+ }
+#endif
+
+ /* Get the type of video hardware */
+ if ( ioctl(console_fd, FBIOGET_FSCREENINFO, &finfo) < 0 ) {
+ SDL_SetError("Couldn't get console hardware info");
+ FB_VideoQuit(this);
+ return(-1);
+ }
+ switch (finfo.type) {
+ case FB_TYPE_PACKED_PIXELS:
+ /* Supported, no worries.. */
+ break;
+#ifdef VGA16_FBCON_SUPPORT
+ case FB_TYPE_VGA_PLANES:
+ /* VGA16 is supported, but that's it */
+ if ( finfo.type_aux == FB_AUX_VGA_PLANES_VGA4 ) {
+ if ( ioperm(0x3b4, 0x3df - 0x3b4 + 1, 1) < 0 ) {
+ SDL_SetError("No I/O port permissions");
+ FB_VideoQuit(this);
+ return(-1);
+ }
+ this->SetVideoMode = FB_SetVGA16Mode;
+ break;
+ }
+ /* Fall through to unsupported case */
+#endif /* VGA16_FBCON_SUPPORT */
+ default:
+ SDL_SetError("Unsupported console hardware");
+ FB_VideoQuit(this);
+ return(-1);
+ }
+ switch (finfo.visual) {
+ case FB_VISUAL_TRUECOLOR:
+ case FB_VISUAL_PSEUDOCOLOR:
+ case FB_VISUAL_STATIC_PSEUDOCOLOR:
+ case FB_VISUAL_DIRECTCOLOR:
+ break;
+ default:
+ SDL_SetError("Unsupported console hardware");
+ FB_VideoQuit(this);
+ return(-1);
+ }
+
+ /* Check if the user wants to disable hardware acceleration */
+ { const char *fb_accel;
+ fb_accel = SDL_getenv("SDL_FBACCEL");
+ if ( fb_accel ) {
+ finfo.accel = SDL_atoi(fb_accel);
+ }
+ }
+
+ /* Memory map the device, compensating for buggy PPC mmap() */
+ mapped_offset = (((long)finfo.smem_start) -
+ (((long)finfo.smem_start)&~(pagesize-1)));
+ mapped_memlen = finfo.smem_len+mapped_offset;
+ mapped_mem = do_mmap(NULL, mapped_memlen,
+ PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0);
+ if ( mapped_mem == (char *)-1 ) {
+ SDL_SetError("Unable to memory map the video hardware");
+ mapped_mem = NULL;
+ FB_VideoQuit(this);
+ return(-1);
+ }
+
+ /* Determine the current screen depth */
+ if ( ioctl(console_fd, FBIOGET_VSCREENINFO, &vinfo) < 0 ) {
+ SDL_SetError("Couldn't get console pixel format");
+ FB_VideoQuit(this);
+ return(-1);
+ }
+ vformat->BitsPerPixel = vinfo.bits_per_pixel;
+ if ( vformat->BitsPerPixel < 8 ) {
+ /* Assuming VGA16, we handle this via a shadow framebuffer */
+ vformat->BitsPerPixel = 8;
+ }
+ for ( i=0; i<vinfo.red.length; ++i ) {
+ vformat->Rmask <<= 1;
+ vformat->Rmask |= (0x00000001<<vinfo.red.offset);
+ }
+ for ( i=0; i<vinfo.green.length; ++i ) {
+ vformat->Gmask <<= 1;
+ vformat->Gmask |= (0x00000001<<vinfo.green.offset);
+ }
+ for ( i=0; i<vinfo.blue.length; ++i ) {
+ vformat->Bmask <<= 1;
+ vformat->Bmask |= (0x00000001<<vinfo.blue.offset);
+ }
+ saved_vinfo = vinfo;
+
+ /* Save hardware palette, if needed */
+ FB_SavePalette(this, &finfo, &vinfo);
+
+ /* If the I/O registers are available, memory map them so we
+ can take advantage of any supported hardware acceleration.
+ */
+ vinfo.accel_flags = 0; /* Temporarily reserve registers */
+ ioctl(console_fd, FBIOPUT_VSCREENINFO, &vinfo);
+ if ( finfo.accel && finfo.mmio_len ) {
+ mapped_iolen = finfo.mmio_len;
+ mapped_io = do_mmap(NULL, mapped_iolen, PROT_READ|PROT_WRITE,
+ MAP_SHARED, console_fd, mapped_memlen);
+ if ( mapped_io == (char *)-1 ) {
+ /* Hmm, failed to memory map I/O registers */
+ mapped_io = NULL;
+ }
+ }
+
+ rotate = FBCON_ROTATE_NONE;
+ rotation = SDL_getenv("SDL_VIDEO_FBCON_ROTATION");
+ if (rotation != NULL) {
+ if (SDL_strlen(rotation) == 0) {
+ shadow_fb = 0;
+ rotate = FBCON_ROTATE_NONE;
+#ifdef FBCON_DEBUG
+ printf("Not rotating, no shadow\n");
+#endif
+ } else if (!SDL_strcmp(rotation, "NONE")) {
+ shadow_fb = 1;
+ rotate = FBCON_ROTATE_NONE;
+#ifdef FBCON_DEBUG
+ printf("Not rotating, but still using shadow\n");
+#endif
+ } else if (!SDL_strcmp(rotation, "CW")) {
+ shadow_fb = 1;
+ rotate = FBCON_ROTATE_CW;
+#ifdef FBCON_DEBUG
+ printf("Rotating screen clockwise\n");
+#endif
+ } else if (!SDL_strcmp(rotation, "CCW")) {
+ shadow_fb = 1;
+ rotate = FBCON_ROTATE_CCW;
+#ifdef FBCON_DEBUG
+ printf("Rotating screen counter clockwise\n");
+#endif
+ } else if (!SDL_strcmp(rotation, "UD")) {
+ shadow_fb = 1;
+ rotate = FBCON_ROTATE_UD;
+#ifdef FBCON_DEBUG
+ printf("Rotating screen upside down\n");
+#endif
+ } else {
+ SDL_SetError("\"%s\" is not a valid value for "
+ "SDL_VIDEO_FBCON_ROTATION", rotation);
+ return(-1);
+ }
+ }
+
+ if (rotate == FBCON_ROTATE_CW || rotate == FBCON_ROTATE_CCW) {
+ current_w = vinfo.yres;
+ current_h = vinfo.xres;
+ } else {
+ current_w = vinfo.xres;
+ current_h = vinfo.yres;
+ }
+
+ /* Query for the list of available video modes */
+ current_index = ((vinfo.bits_per_pixel+7)/8)-1;
+ modesdb = fopen(FB_MODES_DB, "r");
+ for ( i=0; i<NUM_MODELISTS; ++i ) {
+ SDL_nummodes[i] = 0;
+ SDL_modelist[i] = NULL;
+ }
+ if ( SDL_getenv("SDL_FB_BROKEN_MODES") != NULL ) {
+ FB_AddMode(this, current_index, current_w, current_h, 0);
+ } else if(modesdb) {
+ while ( read_fbmodes_mode(modesdb, &vinfo) ) {
+ for ( i=0; i<NUM_MODELISTS; ++i ) {
+ unsigned int w, h;
+
+ if (rotate == FBCON_ROTATE_CW || rotate == FBCON_ROTATE_CCW) {
+ w = vinfo.yres;
+ h = vinfo.xres;
+ } else {
+ w = vinfo.xres;
+ h = vinfo.yres;
+ }
+ /* See if we are querying for the current mode */
+ if ( i == current_index ) {
+ if ( (current_w > w) || (current_h > h) ) {
+ /* Only check once */
+ FB_AddMode(this, i, current_w, current_h, 0);
+ current_index = -1;
+ }
+ }
+ if ( FB_CheckMode(this, &vinfo, i, &w, &h) ) {
+ FB_AddMode(this, i, w, h, 0);
+ }
+ }
+ }
+ fclose(modesdb);
+ FB_SortModes(this);
+ } else {
+ for ( i=0; i<NUM_MODELISTS; ++i ) {
+ for ( j=0; j<(sizeof(checkres)/sizeof(checkres[0])); ++j ) {
+ unsigned int w, h;
+
+ if (rotate == FBCON_ROTATE_CW || rotate == FBCON_ROTATE_CCW) {
+ w = checkres[j].h;
+ h = checkres[j].w;
+ } else {
+ w = checkres[j].w;
+ h = checkres[j].h;
+ }
+ /* See if we are querying for the current mode */
+ if ( i == current_index ) {
+ if ( (current_w > w) || (current_h > h) ) {
+ /* Only check once */
+ FB_AddMode(this, i, current_w, current_h, 0);
+ current_index = -1;
+ }
+ }
+ if ( FB_CheckMode(this, &vinfo, i, &w, &h) ) {
+ FB_AddMode(this, i, w, h, 1);
+ }
+ }
+ }
+ }
+
+ this->info.current_w = current_w;
+ this->info.current_h = current_h;
+ this->info.wm_available = 0;
+ this->info.hw_available = !shadow_fb;
+ this->info.video_mem = shadow_fb ? 0 : finfo.smem_len/1024;
+ /* Fill in our hardware acceleration capabilities */
+ if ( mapped_io ) {
+ switch (finfo.accel) {
+ case FB_ACCEL_MATROX_MGA2064W:
+ case FB_ACCEL_MATROX_MGA1064SG:
+ case FB_ACCEL_MATROX_MGA2164W:
+ case FB_ACCEL_MATROX_MGA2164W_AGP:
+ case FB_ACCEL_MATROX_MGAG100:
+ /*case FB_ACCEL_MATROX_MGAG200: G200 acceleration broken! */
+ case FB_ACCEL_MATROX_MGAG400:
+#ifdef FBACCEL_DEBUG
+ printf("Matrox hardware accelerator!\n");
+#endif
+ FB_MatroxAccel(this, finfo.accel);
+ break;
+ case FB_ACCEL_3DFX_BANSHEE:
+#ifdef FBACCEL_DEBUG
+ printf("3DFX hardware accelerator!\n");
+#endif
+ FB_3DfxAccel(this, finfo.accel);
+ break;
+ case FB_ACCEL_NV3:
+ case FB_ACCEL_NV4:
+#ifdef FBACCEL_DEBUG
+ printf("NVidia hardware accelerator!\n");
+#endif
+ FB_RivaAccel(this, finfo.accel);
+ break;
+ default:
+#ifdef FBACCEL_DEBUG
+ printf("Unknown hardware accelerator.\n");
+#endif
+ break;
+ }
+ }
+
+ if (shadow_fb) {
+ shadow_mem = (char *)SDL_malloc(mapped_memlen);
+ if (shadow_mem == NULL) {
+ SDL_SetError("No memory for shadow");
+ return (-1);
+ }
+ }
+
+ /* Enable mouse and keyboard support */
+ if ( FB_OpenKeyboard(this) < 0 ) {
+ FB_VideoQuit(this);
+ return(-1);
+ }
+ if ( FB_OpenMouse(this) < 0 ) {
+ const char *sdl_nomouse;
+
+ sdl_nomouse = SDL_getenv("SDL_NOMOUSE");
+ if ( ! sdl_nomouse ) {
+ SDL_SetError("Unable to open mouse");
+ FB_VideoQuit(this);
+ return(-1);
+ }
+ }
+
+ /* We're done! */
+ return(0);
+}
+
+static SDL_Rect **FB_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ return(SDL_modelist[((format->BitsPerPixel+7)/8)-1]);
+}
+
+/* Various screen update functions available */
+static void FB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
+#ifdef VGA16_FBCON_SUPPORT
+static void FB_VGA16Update(_THIS, int numrects, SDL_Rect *rects);
+#endif
+
+#ifdef FBCON_DEBUG
+static void print_vinfo(struct fb_var_screeninfo *vinfo)
+{
+ fprintf(stderr, "Printing vinfo:\n");
+ fprintf(stderr, "\txres: %d\n", vinfo->xres);
+ fprintf(stderr, "\tyres: %d\n", vinfo->yres);
+ fprintf(stderr, "\txres_virtual: %d\n", vinfo->xres_virtual);
+ fprintf(stderr, "\tyres_virtual: %d\n", vinfo->yres_virtual);
+ fprintf(stderr, "\txoffset: %d\n", vinfo->xoffset);
+ fprintf(stderr, "\tyoffset: %d\n", vinfo->yoffset);
+ fprintf(stderr, "\tbits_per_pixel: %d\n", vinfo->bits_per_pixel);
+ fprintf(stderr, "\tgrayscale: %d\n", vinfo->grayscale);
+ fprintf(stderr, "\tnonstd: %d\n", vinfo->nonstd);
+ fprintf(stderr, "\tactivate: %d\n", vinfo->activate);
+ fprintf(stderr, "\theight: %d\n", vinfo->height);
+ fprintf(stderr, "\twidth: %d\n", vinfo->width);
+ fprintf(stderr, "\taccel_flags: %d\n", vinfo->accel_flags);
+ fprintf(stderr, "\tpixclock: %d\n", vinfo->pixclock);
+ fprintf(stderr, "\tleft_margin: %d\n", vinfo->left_margin);
+ fprintf(stderr, "\tright_margin: %d\n", vinfo->right_margin);
+ fprintf(stderr, "\tupper_margin: %d\n", vinfo->upper_margin);
+ fprintf(stderr, "\tlower_margin: %d\n", vinfo->lower_margin);
+ fprintf(stderr, "\thsync_len: %d\n", vinfo->hsync_len);
+ fprintf(stderr, "\tvsync_len: %d\n", vinfo->vsync_len);
+ fprintf(stderr, "\tsync: %d\n", vinfo->sync);
+ fprintf(stderr, "\tvmode: %d\n", vinfo->vmode);
+ fprintf(stderr, "\tred: %d/%d\n", vinfo->red.length, vinfo->red.offset);
+ fprintf(stderr, "\tgreen: %d/%d\n", vinfo->green.length, vinfo->green.offset);
+ fprintf(stderr, "\tblue: %d/%d\n", vinfo->blue.length, vinfo->blue.offset);
+ fprintf(stderr, "\talpha: %d/%d\n", vinfo->transp.length, vinfo->transp.offset);
+}
+static void print_finfo(struct fb_fix_screeninfo *finfo)
+{
+ fprintf(stderr, "Printing finfo:\n");
+ fprintf(stderr, "\tsmem_start = %p\n", (char *)finfo->smem_start);
+ fprintf(stderr, "\tsmem_len = %d\n", finfo->smem_len);
+ fprintf(stderr, "\ttype = %d\n", finfo->type);
+ fprintf(stderr, "\ttype_aux = %d\n", finfo->type_aux);
+ fprintf(stderr, "\tvisual = %d\n", finfo->visual);
+ fprintf(stderr, "\txpanstep = %d\n", finfo->xpanstep);
+ fprintf(stderr, "\typanstep = %d\n", finfo->ypanstep);
+ fprintf(stderr, "\tywrapstep = %d\n", finfo->ywrapstep);
+ fprintf(stderr, "\tline_length = %d\n", finfo->line_length);
+ fprintf(stderr, "\tmmio_start = %p\n", (char *)finfo->mmio_start);
+ fprintf(stderr, "\tmmio_len = %d\n", finfo->mmio_len);
+ fprintf(stderr, "\taccel = %d\n", finfo->accel);
+}
+#endif
+
+static int choose_fbmodes_mode(struct fb_var_screeninfo *vinfo)
+{
+ int matched;
+ FILE *modesdb;
+ struct fb_var_screeninfo cinfo;
+
+ matched = 0;
+ modesdb = fopen(FB_MODES_DB, "r");
+ if ( modesdb ) {
+ /* Parse the mode definition file */
+ while ( read_fbmodes_mode(modesdb, &cinfo) ) {
+ if ( (vinfo->xres == cinfo.xres && vinfo->yres == cinfo.yres) &&
+ (!matched || (vinfo->bits_per_pixel == cinfo.bits_per_pixel)) ) {
+ vinfo->pixclock = cinfo.pixclock;
+ vinfo->left_margin = cinfo.left_margin;
+ vinfo->right_margin = cinfo.right_margin;
+ vinfo->upper_margin = cinfo.upper_margin;
+ vinfo->lower_margin = cinfo.lower_margin;
+ vinfo->hsync_len = cinfo.hsync_len;
+ vinfo->vsync_len = cinfo.vsync_len;
+ if ( matched ) {
+ break;
+ }
+ matched = 1;
+ }
+ }
+ fclose(modesdb);
+ }
+ return(matched);
+}
+
+static int choose_vesa_mode(struct fb_var_screeninfo *vinfo)
+{
+ int matched;
+ int i;
+
+ /* Check for VESA timings */
+ matched = 0;
+ for ( i=0; i<(sizeof(vesa_timings)/sizeof(vesa_timings[0])); ++i ) {
+ if ( (vinfo->xres == vesa_timings[i].xres) &&
+ (vinfo->yres == vesa_timings[i].yres) ) {
+#ifdef FBCON_DEBUG
+ fprintf(stderr, "Using VESA timings for %dx%d\n",
+ vinfo->xres, vinfo->yres);
+#endif
+ if ( vesa_timings[i].pixclock ) {
+ vinfo->pixclock = vesa_timings[i].pixclock;
+ }
+ vinfo->left_margin = vesa_timings[i].left;
+ vinfo->right_margin = vesa_timings[i].right;
+ vinfo->upper_margin = vesa_timings[i].upper;
+ vinfo->lower_margin = vesa_timings[i].lower;
+ vinfo->hsync_len = vesa_timings[i].hslen;
+ vinfo->vsync_len = vesa_timings[i].vslen;
+ vinfo->sync = vesa_timings[i].sync;
+ vinfo->vmode = vesa_timings[i].vmode;
+ matched = 1;
+ break;
+ }
+ }
+ return(matched);
+}
+
+#ifdef VGA16_FBCON_SUPPORT
+static SDL_Surface *FB_SetVGA16Mode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ struct fb_fix_screeninfo finfo;
+ struct fb_var_screeninfo vinfo;
+
+ /* Set the terminal into graphics mode */
+ if ( FB_EnterGraphicsMode(this) < 0 ) {
+ return(NULL);
+ }
+
+ /* Restore the original palette */
+ FB_RestorePalette(this);
+
+ /* Set the video mode and get the final screen format */
+ if ( ioctl(console_fd, FBIOGET_VSCREENINFO, &vinfo) < 0 ) {
+ SDL_SetError("Couldn't get console screen info");
+ return(NULL);
+ }
+ cache_vinfo = vinfo;
+#ifdef FBCON_DEBUG
+ fprintf(stderr, "Printing actual vinfo:\n");
+ print_vinfo(&vinfo);
+#endif
+ if ( ! SDL_ReallocFormat(current, bpp, 0, 0, 0, 0) ) {
+ return(NULL);
+ }
+ current->format->palette->ncolors = 16;
+
+ /* Get the fixed information about the console hardware.
+ This is necessary since finfo.line_length changes.
+ */
+ if ( ioctl(console_fd, FBIOGET_FSCREENINFO, &finfo) < 0 ) {
+ SDL_SetError("Couldn't get console hardware info");
+ return(NULL);
+ }
+#ifdef FBCON_DEBUG
+ fprintf(stderr, "Printing actual finfo:\n");
+ print_finfo(&finfo);
+#endif
+
+ /* Save hardware palette, if needed */
+ FB_SavePalette(this, &finfo, &vinfo);
+
+ /* Set up the new mode framebuffer */
+ current->flags = SDL_FULLSCREEN;
+ current->w = vinfo.xres;
+ current->h = vinfo.yres;
+ current->pitch = current->w;
+ current->pixels = SDL_malloc(current->h*current->pitch);
+
+ /* Set the update rectangle function */
+ this->UpdateRects = FB_VGA16Update;
+
+ /* We're done */
+ return(current);
+}
+#endif /* VGA16_FBCON_SUPPORT */
+
+static SDL_Surface *FB_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ struct fb_fix_screeninfo finfo;
+ struct fb_var_screeninfo vinfo;
+ int i;
+ Uint32 Rmask;
+ Uint32 Gmask;
+ Uint32 Bmask;
+ char *surfaces_mem;
+ int surfaces_len;
+
+ /* Set the terminal into graphics mode */
+ if ( FB_EnterGraphicsMode(this) < 0 ) {
+ return(NULL);
+ }
+
+ /* Restore the original palette */
+ FB_RestorePalette(this);
+
+ /* Set the video mode and get the final screen format */
+ if ( ioctl(console_fd, FBIOGET_VSCREENINFO, &vinfo) < 0 ) {
+ SDL_SetError("Couldn't get console screen info");
+ return(NULL);
+ }
+#ifdef FBCON_DEBUG
+ fprintf(stderr, "Printing original vinfo:\n");
+ print_vinfo(&vinfo);
+#endif
+ /* Do not use double buffering with shadow buffer */
+ if (shadow_fb) {
+ flags &= ~SDL_DOUBLEBUF;
+ }
+
+ if ( (vinfo.xres != width) || (vinfo.yres != height) ||
+ (vinfo.bits_per_pixel != bpp) || (flags & SDL_DOUBLEBUF) ) {
+ vinfo.activate = FB_ACTIVATE_NOW;
+ vinfo.accel_flags = 0;
+ vinfo.bits_per_pixel = bpp;
+ vinfo.xres = width;
+ vinfo.xres_virtual = width;
+ vinfo.yres = height;
+ if ( flags & SDL_DOUBLEBUF ) {
+ vinfo.yres_virtual = height*2;
+ } else {
+ vinfo.yres_virtual = height;
+ }
+ vinfo.xoffset = 0;
+ vinfo.yoffset = 0;
+ vinfo.red.length = vinfo.red.offset = 0;
+ vinfo.green.length = vinfo.green.offset = 0;
+ vinfo.blue.length = vinfo.blue.offset = 0;
+ vinfo.transp.length = vinfo.transp.offset = 0;
+ if ( ! choose_fbmodes_mode(&vinfo) ) {
+ choose_vesa_mode(&vinfo);
+ }
+#ifdef FBCON_DEBUG
+ fprintf(stderr, "Printing wanted vinfo:\n");
+ print_vinfo(&vinfo);
+#endif
+ if ( !shadow_fb &&
+ ioctl(console_fd, FBIOPUT_VSCREENINFO, &vinfo) < 0 ) {
+ vinfo.yres_virtual = height;
+ if ( ioctl(console_fd, FBIOPUT_VSCREENINFO, &vinfo) < 0 ) {
+ SDL_SetError("Couldn't set console screen info");
+ return(NULL);
+ }
+ }
+ } else {
+ int maxheight;
+
+ /* Figure out how much video memory is available */
+ if ( flags & SDL_DOUBLEBUF ) {
+ maxheight = height*2;
+ } else {
+ maxheight = height;
+ }
+ if ( vinfo.yres_virtual > maxheight ) {
+ vinfo.yres_virtual = maxheight;
+ }
+ }
+ cache_vinfo = vinfo;
+#ifdef FBCON_DEBUG
+ fprintf(stderr, "Printing actual vinfo:\n");
+ print_vinfo(&vinfo);
+#endif
+ Rmask = 0;
+ for ( i=0; i<vinfo.red.length; ++i ) {
+ Rmask <<= 1;
+ Rmask |= (0x00000001<<vinfo.red.offset);
+ }
+ Gmask = 0;
+ for ( i=0; i<vinfo.green.length; ++i ) {
+ Gmask <<= 1;
+ Gmask |= (0x00000001<<vinfo.green.offset);
+ }
+ Bmask = 0;
+ for ( i=0; i<vinfo.blue.length; ++i ) {
+ Bmask <<= 1;
+ Bmask |= (0x00000001<<vinfo.blue.offset);
+ }
+ if ( ! SDL_ReallocFormat(current, vinfo.bits_per_pixel,
+ Rmask, Gmask, Bmask, 0) ) {
+ return(NULL);
+ }
+
+ /* Get the fixed information about the console hardware.
+ This is necessary since finfo.line_length changes.
+ */
+ if ( ioctl(console_fd, FBIOGET_FSCREENINFO, &finfo) < 0 ) {
+ SDL_SetError("Couldn't get console hardware info");
+ return(NULL);
+ }
+
+ /* Save hardware palette, if needed */
+ FB_SavePalette(this, &finfo, &vinfo);
+
+ if (shadow_fb) {
+ if (vinfo.bits_per_pixel == 16) {
+ blitFunc = (rotate == FBCON_ROTATE_NONE ||
+ rotate == FBCON_ROTATE_UD) ?
+ FB_blit16 : FB_blit16blocked;
+ } else {
+#ifdef FBCON_DEBUG
+ fprintf(stderr, "Init vinfo:\n");
+ print_vinfo(&vinfo);
+#endif
+ SDL_SetError("Using software buffer, but no blitter "
+ "function is available for %d bpp.",
+ vinfo.bits_per_pixel);
+ return(NULL);
+ }
+ }
+
+ /* Set up the new mode framebuffer */
+ current->flags &= SDL_FULLSCREEN;
+ if (shadow_fb) {
+ current->flags |= SDL_SWSURFACE;
+ } else {
+ current->flags |= SDL_HWSURFACE;
+ }
+ current->w = vinfo.xres;
+ current->h = vinfo.yres;
+ if (shadow_fb) {
+ current->pitch = current->w * ((vinfo.bits_per_pixel + 7) / 8);
+ current->pixels = shadow_mem;
+ physlinebytes = finfo.line_length;
+ } else {
+ current->pitch = finfo.line_length;
+ current->pixels = mapped_mem+mapped_offset;
+ }
+
+ /* Set up the information for hardware surfaces */
+ surfaces_mem = (char *)current->pixels +
+ vinfo.yres_virtual*current->pitch;
+ surfaces_len = (shadow_fb) ?
+ 0 : (mapped_memlen-(surfaces_mem-mapped_mem));
+
+ FB_FreeHWSurfaces(this);
+ FB_InitHWSurfaces(this, current, surfaces_mem, surfaces_len);
+
+ /* Let the application know we have a hardware palette */
+ switch (finfo.visual) {
+ case FB_VISUAL_PSEUDOCOLOR:
+ current->flags |= SDL_HWPALETTE;
+ break;
+ default:
+ break;
+ }
+
+ /* Update for double-buffering, if we can */
+ if ( flags & SDL_DOUBLEBUF ) {
+ if ( vinfo.yres_virtual == (height*2) ) {
+ current->flags |= SDL_DOUBLEBUF;
+ flip_page = 0;
+ flip_address[0] = (char *)current->pixels;
+ flip_address[1] = (char *)current->pixels+
+ current->h*current->pitch;
+ this->screen = current;
+ FB_FlipHWSurface(this, current);
+ this->screen = NULL;
+ }
+ }
+
+ /* Set the update rectangle function */
+ this->UpdateRects = FB_DirectUpdate;
+
+ /* We're done */
+ return(current);
+}
+
+#ifdef FBCON_DEBUG
+void FB_DumpHWSurfaces(_THIS)
+{
+ vidmem_bucket *bucket;
+
+ printf("Memory left: %d (%d total)\n", surfaces_memleft, surfaces_memtotal);
+ printf("\n");
+ printf(" Base Size\n");
+ for ( bucket=&surfaces; bucket; bucket=bucket->next ) {
+ printf("Bucket: %p, %d (%s)\n", bucket->base, bucket->size, bucket->used ? "used" : "free");
+ if ( bucket->prev ) {
+ if ( bucket->base != bucket->prev->base+bucket->prev->size ) {
+ printf("Warning, corrupt bucket list! (prev)\n");
+ }
+ } else {
+ if ( bucket != &surfaces ) {
+ printf("Warning, corrupt bucket list! (!prev)\n");
+ }
+ }
+ if ( bucket->next ) {
+ if ( bucket->next->base != bucket->base+bucket->size ) {
+ printf("Warning, corrupt bucket list! (next)\n");
+ }
+ }
+ }
+ printf("\n");
+}
+#endif
+
+static int FB_InitHWSurfaces(_THIS, SDL_Surface *screen, char *base, int size)
+{
+ vidmem_bucket *bucket;
+
+ surfaces_memtotal = size;
+ surfaces_memleft = size;
+
+ if ( surfaces_memleft > 0 ) {
+ bucket = (vidmem_bucket *)SDL_malloc(sizeof(*bucket));
+ if ( bucket == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ bucket->prev = &surfaces;
+ bucket->used = 0;
+ bucket->dirty = 0;
+ bucket->base = base;
+ bucket->size = size;
+ bucket->next = NULL;
+ } else {
+ bucket = NULL;
+ }
+
+ surfaces.prev = NULL;
+ surfaces.used = 1;
+ surfaces.dirty = 0;
+ surfaces.base = screen->pixels;
+ surfaces.size = (unsigned int)((long)base - (long)surfaces.base);
+ surfaces.next = bucket;
+ screen->hwdata = (struct private_hwdata *)&surfaces;
+ return(0);
+}
+static void FB_FreeHWSurfaces(_THIS)
+{
+ vidmem_bucket *bucket, *freeable;
+
+ bucket = surfaces.next;
+ while ( bucket ) {
+ freeable = bucket;
+ bucket = bucket->next;
+ SDL_free(freeable);
+ }
+ surfaces.next = NULL;
+}
+
+static int FB_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ vidmem_bucket *bucket;
+ int size;
+ int extra;
+
+/* Temporarily, we only allow surfaces the same width as display.
+ Some blitters require the pitch between two hardware surfaces
+ to be the same. Others have interesting alignment restrictions.
+ Until someone who knows these details looks at the code...
+*/
+if ( surface->pitch > SDL_VideoSurface->pitch ) {
+ SDL_SetError("Surface requested wider than screen");
+ return(-1);
+}
+surface->pitch = SDL_VideoSurface->pitch;
+ size = surface->h * surface->pitch;
+#ifdef FBCON_DEBUG
+ fprintf(stderr, "Allocating bucket of %d bytes\n", size);
+#endif
+
+ /* Quick check for available mem */
+ if ( size > surfaces_memleft ) {
+ SDL_SetError("Not enough video memory");
+ return(-1);
+ }
+
+ /* Search for an empty bucket big enough */
+ for ( bucket=&surfaces; bucket; bucket=bucket->next ) {
+ if ( ! bucket->used && (size <= bucket->size) ) {
+ break;
+ }
+ }
+ if ( bucket == NULL ) {
+ SDL_SetError("Video memory too fragmented");
+ return(-1);
+ }
+
+ /* Create a new bucket for left-over memory */
+ extra = (bucket->size - size);
+ if ( extra ) {
+ vidmem_bucket *newbucket;
+
+#ifdef FBCON_DEBUG
+ fprintf(stderr, "Adding new free bucket of %d bytes\n", extra);
+#endif
+ newbucket = (vidmem_bucket *)SDL_malloc(sizeof(*newbucket));
+ if ( newbucket == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ newbucket->prev = bucket;
+ newbucket->used = 0;
+ newbucket->base = bucket->base+size;
+ newbucket->size = extra;
+ newbucket->next = bucket->next;
+ if ( bucket->next ) {
+ bucket->next->prev = newbucket;
+ }
+ bucket->next = newbucket;
+ }
+
+ /* Set the current bucket values and return it! */
+ bucket->used = 1;
+ bucket->size = size;
+ bucket->dirty = 0;
+#ifdef FBCON_DEBUG
+ fprintf(stderr, "Allocated %d bytes at %p\n", bucket->size, bucket->base);
+#endif
+ surfaces_memleft -= size;
+ surface->flags |= SDL_HWSURFACE;
+ surface->pixels = bucket->base;
+ surface->hwdata = (struct private_hwdata *)bucket;
+ return(0);
+}
+static void FB_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ vidmem_bucket *bucket, *freeable;
+
+ /* Look for the bucket in the current list */
+ for ( bucket=&surfaces; bucket; bucket=bucket->next ) {
+ if ( bucket == (vidmem_bucket *)surface->hwdata ) {
+ break;
+ }
+ }
+ if ( bucket && bucket->used ) {
+ /* Add the memory back to the total */
+#ifdef DGA_DEBUG
+ printf("Freeing bucket of %d bytes\n", bucket->size);
+#endif
+ surfaces_memleft += bucket->size;
+
+ /* Can we merge the space with surrounding buckets? */
+ bucket->used = 0;
+ if ( bucket->next && ! bucket->next->used ) {
+#ifdef DGA_DEBUG
+ printf("Merging with next bucket, for %d total bytes\n", bucket->size+bucket->next->size);
+#endif
+ freeable = bucket->next;
+ bucket->size += bucket->next->size;
+ bucket->next = bucket->next->next;
+ if ( bucket->next ) {
+ bucket->next->prev = bucket;
+ }
+ SDL_free(freeable);
+ }
+ if ( bucket->prev && ! bucket->prev->used ) {
+#ifdef DGA_DEBUG
+ printf("Merging with previous bucket, for %d total bytes\n", bucket->prev->size+bucket->size);
+#endif
+ freeable = bucket;
+ bucket->prev->size += bucket->size;
+ bucket->prev->next = bucket->next;
+ if ( bucket->next ) {
+ bucket->next->prev = bucket->prev;
+ }
+ SDL_free(freeable);
+ }
+ }
+ surface->pixels = NULL;
+ surface->hwdata = NULL;
+}
+
+static int FB_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ if ( switched_away ) {
+ return -2; /* no hardware access */
+ }
+ if ( surface == this->screen ) {
+ SDL_mutexP(hw_lock);
+ if ( FB_IsSurfaceBusy(surface) ) {
+ FB_WaitBusySurfaces(this);
+ }
+ } else {
+ if ( FB_IsSurfaceBusy(surface) ) {
+ FB_WaitBusySurfaces(this);
+ }
+ }
+ return(0);
+}
+static void FB_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ if ( surface == this->screen ) {
+ SDL_mutexV(hw_lock);
+ }
+}
+
+static void FB_WaitVBL(_THIS)
+{
+#ifdef FBIOWAITRETRACE /* Heheh, this didn't make it into the main kernel */
+ ioctl(console_fd, FBIOWAITRETRACE, 0);
+#endif
+ return;
+}
+
+static void FB_WaitIdle(_THIS)
+{
+ return;
+}
+
+static int FB_FlipHWSurface(_THIS, SDL_Surface *surface)
+{
+ if ( switched_away ) {
+ return -2; /* no hardware access */
+ }
+
+ /* Wait for vertical retrace and then flip display */
+ cache_vinfo.yoffset = flip_page*surface->h;
+ if ( FB_IsSurfaceBusy(this->screen) ) {
+ FB_WaitBusySurfaces(this);
+ }
+ wait_vbl(this);
+ if ( ioctl(console_fd, FBIOPAN_DISPLAY, &cache_vinfo) < 0 ) {
+ SDL_SetError("ioctl(FBIOPAN_DISPLAY) failed");
+ return(-1);
+ }
+ flip_page = !flip_page;
+
+ surface->pixels = flip_address[flip_page];
+ return(0);
+}
+
+static void FB_blit16(Uint8 *byte_src_pos, int src_right_delta, int src_down_delta,
+ Uint8 *byte_dst_pos, int dst_linebytes, int width, int height)
+{
+ int w;
+ Uint16 *src_pos = (Uint16 *)byte_src_pos;
+ Uint16 *dst_pos = (Uint16 *)byte_dst_pos;
+
+ while (height) {
+ Uint16 *src = src_pos;
+ Uint16 *dst = dst_pos;
+ for (w = width; w != 0; w--) {
+ *dst = *src;
+ src += src_right_delta;
+ dst++;
+ }
+ dst_pos = (Uint16 *)((Uint8 *)dst_pos + dst_linebytes);
+ src_pos += src_down_delta;
+ height--;
+ }
+}
+
+#define BLOCKSIZE_W 32
+#define BLOCKSIZE_H 32
+
+static void FB_blit16blocked(Uint8 *byte_src_pos, int src_right_delta, int src_down_delta,
+ Uint8 *byte_dst_pos, int dst_linebytes, int width, int height)
+{
+ int w;
+ Uint16 *src_pos = (Uint16 *)byte_src_pos;
+ Uint16 *dst_pos = (Uint16 *)byte_dst_pos;
+
+ while (height > 0) {
+ Uint16 *src = src_pos;
+ Uint16 *dst = dst_pos;
+ for (w = width; w > 0; w -= BLOCKSIZE_W) {
+ FB_blit16((Uint8 *)src,
+ src_right_delta,
+ src_down_delta,
+ (Uint8 *)dst,
+ dst_linebytes,
+ min(w, BLOCKSIZE_W),
+ min(height, BLOCKSIZE_H));
+ src += src_right_delta * BLOCKSIZE_W;
+ dst += BLOCKSIZE_W;
+ }
+ dst_pos = (Uint16 *)((Uint8 *)dst_pos + dst_linebytes * BLOCKSIZE_H);
+ src_pos += src_down_delta * BLOCKSIZE_H;
+ height -= BLOCKSIZE_H;
+ }
+}
+
+static void FB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+ int width = cache_vinfo.xres;
+ int height = cache_vinfo.yres;
+ int bytes_per_pixel = (cache_vinfo.bits_per_pixel + 7) / 8;
+ int i;
+
+ if (!shadow_fb) {
+ /* The application is already updating the visible video memory */
+ return;
+ }
+
+ if (cache_vinfo.bits_per_pixel != 16) {
+ SDL_SetError("Shadow copy only implemented for 16 bpp");
+ return;
+ }
+
+ for (i = 0; i < numrects; i++) {
+ int x1, y1, x2, y2;
+ int scr_x1, scr_y1, scr_x2, scr_y2;
+ int sha_x1, sha_y1;
+ int shadow_right_delta; /* Address change when moving right in dest */
+ int shadow_down_delta; /* Address change when moving down in dest */
+ char *src_start;
+ char *dst_start;
+
+ x1 = rects[i].x;
+ y1 = rects[i].y;
+ x2 = x1 + rects[i].w;
+ y2 = y1 + rects[i].h;
+
+ if (x1 < 0) {
+ x1 = 0;
+ } else if (x1 > width) {
+ x1 = width;
+ }
+ if (x2 < 0) {
+ x2 = 0;
+ } else if (x2 > width) {
+ x2 = width;
+ }
+ if (y1 < 0) {
+ y1 = 0;
+ } else if (y1 > height) {
+ y1 = height;
+ }
+ if (y2 < 0) {
+ y2 = 0;
+ } else if (y2 > height) {
+ y2 = height;
+ }
+ if (x2 <= x1 || y2 <= y1) {
+ continue;
+ }
+
+ switch (rotate) {
+ case FBCON_ROTATE_NONE:
+ sha_x1 = scr_x1 = x1;
+ sha_y1 = scr_y1 = y1;
+ scr_x2 = x2;
+ scr_y2 = y2;
+ shadow_right_delta = 1;
+ shadow_down_delta = width;
+ break;
+ case FBCON_ROTATE_CCW:
+ scr_x1 = y1;
+ scr_y1 = width - x2;
+ scr_x2 = y2;
+ scr_y2 = width - x1;
+ sha_x1 = x2 - 1;
+ sha_y1 = y1;
+ shadow_right_delta = width;
+ shadow_down_delta = -1;
+ break;
+ case FBCON_ROTATE_UD:
+ scr_x1 = width - x2;
+ scr_y1 = height - y2;
+ scr_x2 = width - x1;
+ scr_y2 = height - y1;
+ sha_x1 = x2 - 1;
+ sha_y1 = y2 - 1;
+ shadow_right_delta = -1;
+ shadow_down_delta = -width;
+ break;
+ case FBCON_ROTATE_CW:
+ scr_x1 = height - y2;
+ scr_y1 = x1;
+ scr_x2 = height - y1;
+ scr_y2 = x2;
+ sha_x1 = x1;
+ sha_y1 = y2 - 1;
+ shadow_right_delta = -width;
+ shadow_down_delta = 1;
+ break;
+ default:
+ SDL_SetError("Unknown rotation");
+ return;
+ }
+
+ src_start = shadow_mem +
+ (sha_y1 * width + sha_x1) * bytes_per_pixel;
+ dst_start = mapped_mem + mapped_offset + scr_y1 * physlinebytes +
+ scr_x1 * bytes_per_pixel;
+
+ blitFunc((Uint8 *) src_start,
+ shadow_right_delta,
+ shadow_down_delta,
+ (Uint8 *) dst_start,
+ physlinebytes,
+ scr_x2 - scr_x1,
+ scr_y2 - scr_y1);
+ }
+}
+
+#ifdef VGA16_FBCON_SUPPORT
+/* Code adapted with thanks from the XFree86 VGA16 driver! :) */
+#define writeGr(index, value) \
+outb(index, 0x3CE); \
+outb(value, 0x3CF);
+#define writeSeq(index, value) \
+outb(index, 0x3C4); \
+outb(value, 0x3C5);
+
+static void FB_VGA16Update(_THIS, int numrects, SDL_Rect *rects)
+{
+ SDL_Surface *screen;
+ int width, height, FBPitch, left, i, j, SRCPitch, phase;
+ register Uint32 m;
+ Uint8 s1, s2, s3, s4;
+ Uint32 *src, *srcPtr;
+ Uint8 *dst, *dstPtr;
+
+ if ( switched_away ) {
+ return; /* no hardware access */
+ }
+
+ screen = this->screen;
+ FBPitch = screen->w >> 3;
+ SRCPitch = screen->pitch >> 2;
+
+ writeGr(0x03, 0x00);
+ writeGr(0x05, 0x00);
+ writeGr(0x01, 0x00);
+ writeGr(0x08, 0xFF);
+
+ while(numrects--) {
+ left = rects->x & ~7;
+ width = (rects->w + 7) >> 3;
+ height = rects->h;
+ src = (Uint32*)screen->pixels + (rects->y * SRCPitch) + (left >> 2);
+ dst = (Uint8*)mapped_mem + (rects->y * FBPitch) + (left >> 3);
+
+ if((phase = (long)dst & 3L)) {
+ phase = 4 - phase;
+ if(phase > width) phase = width;
+ width -= phase;
+ }
+
+ while(height--) {
+ writeSeq(0x02, 1 << 0);
+ dstPtr = dst;
+ srcPtr = src;
+ i = width;
+ j = phase;
+ while(j--) {
+ m = (srcPtr[1] & 0x01010101) | ((srcPtr[0] & 0x01010101) << 4);
+ *dstPtr++ = (m >> 24) | (m >> 15) | (m >> 6) | (m << 3);
+ srcPtr += 2;
+ }
+ while(i >= 4) {
+ m = (srcPtr[1] & 0x01010101) | ((srcPtr[0] & 0x01010101) << 4);
+ s1 = (m >> 24) | (m >> 15) | (m >> 6) | (m << 3);
+ m = (srcPtr[3] & 0x01010101) | ((srcPtr[2] & 0x01010101) << 4);
+ s2 = (m >> 24) | (m >> 15) | (m >> 6) | (m << 3);
+ m = (srcPtr[5] & 0x01010101) | ((srcPtr[4] & 0x01010101) << 4);
+ s3 = (m >> 24) | (m >> 15) | (m >> 6) | (m << 3);
+ m = (srcPtr[7] & 0x01010101) | ((srcPtr[6] & 0x01010101) << 4);
+ s4 = (m >> 24) | (m >> 15) | (m >> 6) | (m << 3);
+ *((Uint32*)dstPtr) = s1 | (s2 << 8) | (s3 << 16) | (s4 << 24);
+ srcPtr += 8;
+ dstPtr += 4;
+ i -= 4;
+ }
+ while(i--) {
+ m = (srcPtr[1] & 0x01010101) | ((srcPtr[0] & 0x01010101) << 4);
+ *dstPtr++ = (m >> 24) | (m >> 15) | (m >> 6) | (m << 3);
+ srcPtr += 2;
+ }
+
+ writeSeq(0x02, 1 << 1);
+ dstPtr = dst;
+ srcPtr = src;
+ i = width;
+ j = phase;
+ while(j--) {
+ m = (srcPtr[1] & 0x02020202) | ((srcPtr[0] & 0x02020202) << 4);
+ *dstPtr++ = (m >> 25) | (m >> 16) | (m >> 7) | (m << 2);
+ srcPtr += 2;
+ }
+ while(i >= 4) {
+ m = (srcPtr[1] & 0x02020202) | ((srcPtr[0] & 0x02020202) << 4);
+ s1 = (m >> 25) | (m >> 16) | (m >> 7) | (m << 2);
+ m = (srcPtr[3] & 0x02020202) | ((srcPtr[2] & 0x02020202) << 4);
+ s2 = (m >> 25) | (m >> 16) | (m >> 7) | (m << 2);
+ m = (srcPtr[5] & 0x02020202) | ((srcPtr[4] & 0x02020202) << 4);
+ s3 = (m >> 25) | (m >> 16) | (m >> 7) | (m << 2);
+ m = (srcPtr[7] & 0x02020202) | ((srcPtr[6] & 0x02020202) << 4);
+ s4 = (m >> 25) | (m >> 16) | (m >> 7) | (m << 2);
+ *((Uint32*)dstPtr) = s1 | (s2 << 8) | (s3 << 16) | (s4 << 24);
+ srcPtr += 8;
+ dstPtr += 4;
+ i -= 4;
+ }
+ while(i--) {
+ m = (srcPtr[1] & 0x02020202) | ((srcPtr[0] & 0x02020202) << 4);
+ *dstPtr++ = (m >> 25) | (m >> 16) | (m >> 7) | (m << 2);
+ srcPtr += 2;
+ }
+
+ writeSeq(0x02, 1 << 2);
+ dstPtr = dst;
+ srcPtr = src;
+ i = width;
+ j = phase;
+ while(j--) {
+ m = (srcPtr[1] & 0x04040404) | ((srcPtr[0] & 0x04040404) << 4);
+ *dstPtr++ = (m >> 26) | (m >> 17) | (m >> 8) | (m << 1);
+ srcPtr += 2;
+ }
+ while(i >= 4) {
+ m = (srcPtr[1] & 0x04040404) | ((srcPtr[0] & 0x04040404) << 4);
+ s1 = (m >> 26) | (m >> 17) | (m >> 8) | (m << 1);
+ m = (srcPtr[3] & 0x04040404) | ((srcPtr[2] & 0x04040404) << 4);
+ s2 = (m >> 26) | (m >> 17) | (m >> 8) | (m << 1);
+ m = (srcPtr[5] & 0x04040404) | ((srcPtr[4] & 0x04040404) << 4);
+ s3 = (m >> 26) | (m >> 17) | (m >> 8) | (m << 1);
+ m = (srcPtr[7] & 0x04040404) | ((srcPtr[6] & 0x04040404) << 4);
+ s4 = (m >> 26) | (m >> 17) | (m >> 8) | (m << 1);
+ *((Uint32*)dstPtr) = s1 | (s2 << 8) | (s3 << 16) | (s4 << 24);
+ srcPtr += 8;
+ dstPtr += 4;
+ i -= 4;
+ }
+ while(i--) {
+ m = (srcPtr[1] & 0x04040404) | ((srcPtr[0] & 0x04040404) << 4);
+ *dstPtr++ = (m >> 26) | (m >> 17) | (m >> 8) | (m << 1);
+ srcPtr += 2;
+ }
+
+ writeSeq(0x02, 1 << 3);
+ dstPtr = dst;
+ srcPtr = src;
+ i = width;
+ j = phase;
+ while(j--) {
+ m = (srcPtr[1] & 0x08080808) | ((srcPtr[0] & 0x08080808) << 4);
+ *dstPtr++ = (m >> 27) | (m >> 18) | (m >> 9) | m;
+ srcPtr += 2;
+ }
+ while(i >= 4) {
+ m = (srcPtr[1] & 0x08080808) | ((srcPtr[0] & 0x08080808) << 4);
+ s1 = (m >> 27) | (m >> 18) | (m >> 9) | m;
+ m = (srcPtr[3] & 0x08080808) | ((srcPtr[2] & 0x08080808) << 4);
+ s2 = (m >> 27) | (m >> 18) | (m >> 9) | m;
+ m = (srcPtr[5] & 0x08080808) | ((srcPtr[4] & 0x08080808) << 4);
+ s3 = (m >> 27) | (m >> 18) | (m >> 9) | m;
+ m = (srcPtr[7] & 0x08080808) | ((srcPtr[6] & 0x08080808) << 4);
+ s4 = (m >> 27) | (m >> 18) | (m >> 9) | m;
+ *((Uint32*)dstPtr) = s1 | (s2 << 8) | (s3 << 16) | (s4 << 24);
+ srcPtr += 8;
+ dstPtr += 4;
+ i -= 4;
+ }
+ while(i--) {
+ m = (srcPtr[1] & 0x08080808) | ((srcPtr[0] & 0x08080808) << 4);
+ *dstPtr++ = (m >> 27) | (m >> 18) | (m >> 9) | m;
+ srcPtr += 2;
+ }
+
+ dst += FBPitch;
+ src += SRCPitch;
+ }
+ rects++;
+ }
+}
+#endif /* VGA16_FBCON_SUPPORT */
+
+void FB_SavePaletteTo(_THIS, int palette_len, __u16 *area)
+{
+ struct fb_cmap cmap;
+
+ cmap.start = 0;
+ cmap.len = palette_len;
+ cmap.red = &area[0*palette_len];
+ cmap.green = &area[1*palette_len];
+ cmap.blue = &area[2*palette_len];
+ cmap.transp = NULL;
+ ioctl(console_fd, FBIOGETCMAP, &cmap);
+}
+
+void FB_RestorePaletteFrom(_THIS, int palette_len, __u16 *area)
+{
+ struct fb_cmap cmap;
+
+ cmap.start = 0;
+ cmap.len = palette_len;
+ cmap.red = &area[0*palette_len];
+ cmap.green = &area[1*palette_len];
+ cmap.blue = &area[2*palette_len];
+ cmap.transp = NULL;
+ ioctl(console_fd, FBIOPUTCMAP, &cmap);
+}
+
+static void FB_SavePalette(_THIS, struct fb_fix_screeninfo *finfo,
+ struct fb_var_screeninfo *vinfo)
+{
+ int i;
+
+ /* Save hardware palette, if needed */
+ if ( finfo->visual == FB_VISUAL_PSEUDOCOLOR ) {
+ saved_cmaplen = 1<<vinfo->bits_per_pixel;
+ saved_cmap=(__u16 *)SDL_malloc(3*saved_cmaplen*sizeof(*saved_cmap));
+ if ( saved_cmap != NULL ) {
+ FB_SavePaletteTo(this, saved_cmaplen, saved_cmap);
+ }
+ }
+
+ /* Added support for FB_VISUAL_DIRECTCOLOR.
+ With this mode pixel information is passed through the palette...
+ Neat fading and gamma correction effects can be had by simply
+ fooling around with the palette instead of changing the pixel
+ values themselves... Very neat!
+
+ Adam Meyerowitz 1/19/2000
+ ameyerow@optonline.com
+ */
+ if ( finfo->visual == FB_VISUAL_DIRECTCOLOR ) {
+ __u16 new_entries[3*256];
+
+ /* Save the colormap */
+ saved_cmaplen = 256;
+ saved_cmap=(__u16 *)SDL_malloc(3*saved_cmaplen*sizeof(*saved_cmap));
+ if ( saved_cmap != NULL ) {
+ FB_SavePaletteTo(this, saved_cmaplen, saved_cmap);
+ }
+
+ /* Allocate new identity colormap */
+ for ( i=0; i<256; ++i ) {
+ new_entries[(0*256)+i] =
+ new_entries[(1*256)+i] =
+ new_entries[(2*256)+i] = (i<<8)|i;
+ }
+ FB_RestorePaletteFrom(this, 256, new_entries);
+ }
+}
+
+static void FB_RestorePalette(_THIS)
+{
+ /* Restore the original palette */
+ if ( saved_cmap ) {
+ FB_RestorePaletteFrom(this, saved_cmaplen, saved_cmap);
+ SDL_free(saved_cmap);
+ saved_cmap = NULL;
+ }
+}
+
+static int FB_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ int i;
+ __u16 r[256];
+ __u16 g[256];
+ __u16 b[256];
+ struct fb_cmap cmap;
+
+ /* Set up the colormap */
+ for (i = 0; i < ncolors; i++) {
+ r[i] = colors[i].r << 8;
+ g[i] = colors[i].g << 8;
+ b[i] = colors[i].b << 8;
+ }
+ cmap.start = firstcolor;
+ cmap.len = ncolors;
+ cmap.red = r;
+ cmap.green = g;
+ cmap.blue = b;
+ cmap.transp = NULL;
+
+ if( (ioctl(console_fd, FBIOPUTCMAP, &cmap) < 0) ||
+ !(this->screen->flags & SDL_HWPALETTE) ) {
+ colors = this->screen->format->palette->colors;
+ ncolors = this->screen->format->palette->ncolors;
+ cmap.start = 0;
+ cmap.len = ncolors;
+ SDL_memset(r, 0, sizeof(r));
+ SDL_memset(g, 0, sizeof(g));
+ SDL_memset(b, 0, sizeof(b));
+ if ( ioctl(console_fd, FBIOGETCMAP, &cmap) == 0 ) {
+ for ( i=ncolors-1; i>=0; --i ) {
+ colors[i].r = (r[i]>>8);
+ colors[i].g = (g[i]>>8);
+ colors[i].b = (b[i]>>8);
+ }
+ }
+ return(0);
+ }
+ return(1);
+}
+
+/* Note: If we are terminated, this could be called in the middle of
+ another SDL video routine -- notably UpdateRects.
+*/
+static void FB_VideoQuit(_THIS)
+{
+ int i, j;
+
+ if ( this->screen ) {
+ /* Clear screen and tell SDL not to free the pixels */
+
+ const char *dontClearPixels = SDL_getenv("SDL_FBCON_DONT_CLEAR");
+
+ /* If the framebuffer is not to be cleared, make sure that we won't
+ * display the previous frame when disabling double buffering. */
+ if ( dontClearPixels && flip_page == 0 ) {
+ SDL_memcpy(flip_address[0], flip_address[1], this->screen->pitch * this->screen->h);
+ }
+
+ if ( !dontClearPixels && this->screen->pixels && FB_InGraphicsMode(this) ) {
+#if defined(__powerpc__) || defined(__ia64__) /* SIGBUS when using SDL_memset() ?? */
+ Uint8 *rowp = (Uint8 *)this->screen->pixels;
+ int left = this->screen->pitch*this->screen->h;
+ while ( left-- ) { *rowp++ = 0; }
+#else
+ SDL_memset(this->screen->pixels,0,this->screen->h*this->screen->pitch);
+#endif
+ }
+ /* This test fails when using the VGA16 shadow memory */
+ if ( ((char *)this->screen->pixels >= mapped_mem) &&
+ ((char *)this->screen->pixels < (mapped_mem+mapped_memlen)) ) {
+ this->screen->pixels = NULL;
+ }
+ }
+
+ /* Clear the lock mutex */
+ if ( hw_lock ) {
+ SDL_DestroyMutex(hw_lock);
+ hw_lock = NULL;
+ }
+
+ /* Clean up defined video modes */
+ for ( i=0; i<NUM_MODELISTS; ++i ) {
+ if ( SDL_modelist[i] != NULL ) {
+ for ( j=0; SDL_modelist[i][j]; ++j ) {
+ SDL_free(SDL_modelist[i][j]);
+ }
+ SDL_free(SDL_modelist[i]);
+ SDL_modelist[i] = NULL;
+ }
+ }
+
+ /* Clean up the memory bucket list */
+ FB_FreeHWSurfaces(this);
+
+ /* Close console and input file descriptors */
+ if ( console_fd > 0 ) {
+ /* Unmap the video framebuffer and I/O registers */
+ if ( mapped_mem ) {
+ munmap(mapped_mem, mapped_memlen);
+ mapped_mem = NULL;
+ }
+ if ( mapped_io ) {
+ munmap(mapped_io, mapped_iolen);
+ mapped_io = NULL;
+ }
+
+ /* Restore the original video mode and palette */
+ if ( FB_InGraphicsMode(this) ) {
+ FB_RestorePalette(this);
+ ioctl(console_fd, FBIOPUT_VSCREENINFO, &saved_vinfo);
+ }
+
+ /* We're all done with the framebuffer */
+ close(console_fd);
+ console_fd = -1;
+ }
+ FB_CloseMouse(this);
+ FB_CloseKeyboard(this);
+}
diff --git a/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbvideo.h b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbvideo.h
new file mode 100644
index 0000000..1443d2b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/fbcon/SDL_fbvideo.h
@@ -0,0 +1,200 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_fbvideo_h
+#define _SDL_fbvideo_h
+
+#include <sys/types.h>
+#include <termios.h>
+#include <linux/fb.h>
+
+#include "SDL_mouse.h"
+#include "SDL_mutex.h"
+#include "../SDL_sysvideo.h"
+#if SDL_INPUT_TSLIB
+#include "tslib.h"
+#endif
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+typedef void FB_bitBlit(
+ Uint8 *src_pos,
+ int src_right_delta, /* pixels, not bytes */
+ int src_down_delta, /* pixels, not bytes */
+ Uint8 *dst_pos,
+ int dst_linebytes,
+ int width,
+ int height);
+
+/* This is the structure we use to keep track of video memory */
+typedef struct vidmem_bucket {
+ struct vidmem_bucket *prev;
+ int used;
+ int dirty;
+ char *base;
+ unsigned int size;
+ struct vidmem_bucket *next;
+} vidmem_bucket;
+
+/* Private display data */
+struct SDL_PrivateVideoData {
+ int console_fd;
+ struct fb_var_screeninfo cache_vinfo;
+ struct fb_var_screeninfo saved_vinfo;
+ int saved_cmaplen;
+ __u16 *saved_cmap;
+
+ int current_vt;
+ int saved_vt;
+ int keyboard_fd;
+ int saved_kbd_mode;
+ struct termios saved_kbd_termios;
+
+ int mouse_fd;
+#if SDL_INPUT_TSLIB
+ struct tsdev *ts_dev;
+#endif
+
+ char *mapped_mem;
+ char *shadow_mem;
+ int mapped_memlen;
+ int mapped_offset;
+ char *mapped_io;
+ long mapped_iolen;
+ int flip_page;
+ char *flip_address[2];
+ int rotate;
+ int shadow_fb; /* Tells whether a shadow is being used. */
+ FB_bitBlit *blitFunc;
+ int physlinebytes; /* Length of a line in bytes in physical fb */
+
+#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
+ int SDL_nummodes[NUM_MODELISTS];
+ SDL_Rect **SDL_modelist[NUM_MODELISTS];
+
+ vidmem_bucket surfaces;
+ int surfaces_memtotal;
+ int surfaces_memleft;
+
+ SDL_mutex *hw_lock;
+ int switched_away;
+ struct fb_var_screeninfo screen_vinfo;
+ Uint32 screen_arealen;
+ Uint8 *screen_contents;
+ __u16 screen_palette[3*256];
+
+ void (*wait_vbl)(_THIS);
+ void (*wait_idle)(_THIS);
+};
+/* Old variable names */
+#define console_fd (this->hidden->console_fd)
+#define current_vt (this->hidden->current_vt)
+#define saved_vt (this->hidden->saved_vt)
+#define keyboard_fd (this->hidden->keyboard_fd)
+#define saved_kbd_mode (this->hidden->saved_kbd_mode)
+#define saved_kbd_termios (this->hidden->saved_kbd_termios)
+#define mouse_fd (this->hidden->mouse_fd)
+#if SDL_INPUT_TSLIB
+#define ts_dev (this->hidden->ts_dev)
+#endif
+#define cache_vinfo (this->hidden->cache_vinfo)
+#define saved_vinfo (this->hidden->saved_vinfo)
+#define saved_cmaplen (this->hidden->saved_cmaplen)
+#define saved_cmap (this->hidden->saved_cmap)
+#define mapped_mem (this->hidden->mapped_mem)
+#define shadow_mem (this->hidden->shadow_mem)
+#define mapped_memlen (this->hidden->mapped_memlen)
+#define mapped_offset (this->hidden->mapped_offset)
+#define mapped_io (this->hidden->mapped_io)
+#define mapped_iolen (this->hidden->mapped_iolen)
+#define flip_page (this->hidden->flip_page)
+#define flip_address (this->hidden->flip_address)
+#define rotate (this->hidden->rotate)
+#define shadow_fb (this->hidden->shadow_fb)
+#define blitFunc (this->hidden->blitFunc)
+#define physlinebytes (this->hidden->physlinebytes)
+#define SDL_nummodes (this->hidden->SDL_nummodes)
+#define SDL_modelist (this->hidden->SDL_modelist)
+#define surfaces (this->hidden->surfaces)
+#define surfaces_memtotal (this->hidden->surfaces_memtotal)
+#define surfaces_memleft (this->hidden->surfaces_memleft)
+#define hw_lock (this->hidden->hw_lock)
+#define switched_away (this->hidden->switched_away)
+#define screen_vinfo (this->hidden->screen_vinfo)
+#define screen_arealen (this->hidden->screen_arealen)
+#define screen_contents (this->hidden->screen_contents)
+#define screen_palette (this->hidden->screen_palette)
+#define wait_vbl (this->hidden->wait_vbl)
+#define wait_idle (this->hidden->wait_idle)
+
+/* Accelerator types that are supported by the driver, but are not
+ necessarily in the kernel headers on the system we compile on.
+*/
+#ifndef FB_ACCEL_MATROX_MGAG400
+#define FB_ACCEL_MATROX_MGAG400 26 /* Matrox G400 */
+#endif
+#ifndef FB_ACCEL_3DFX_BANSHEE
+#define FB_ACCEL_3DFX_BANSHEE 31 /* 3Dfx Banshee */
+#endif
+
+/* These functions are defined in SDL_fbvideo.c */
+extern void FB_SavePaletteTo(_THIS, int palette_len, __u16 *area);
+extern void FB_RestorePaletteFrom(_THIS, int palette_len, __u16 *area);
+
+/* These are utility functions for working with video surfaces */
+
+static __inline__ void FB_AddBusySurface(SDL_Surface *surface)
+{
+ ((vidmem_bucket *)surface->hwdata)->dirty = 1;
+}
+
+static __inline__ int FB_IsSurfaceBusy(SDL_Surface *surface)
+{
+ return ((vidmem_bucket *)surface->hwdata)->dirty;
+}
+
+static __inline__ void FB_WaitBusySurfaces(_THIS)
+{
+ vidmem_bucket *bucket;
+
+ /* Wait for graphic operations to complete */
+ wait_idle(this);
+
+ /* Clear all surface dirty bits */
+ for ( bucket=&surfaces; bucket; bucket=bucket->next ) {
+ bucket->dirty = 0;
+ }
+}
+
+static __inline__ void FB_dst_to_xy(_THIS, SDL_Surface *dst, int *x, int *y)
+{
+ *x = (long)((char *)dst->pixels - mapped_mem)%this->screen->pitch;
+ *y = (long)((char *)dst->pixels - mapped_mem)/this->screen->pitch;
+ if ( dst == this->screen ) {
+ *x += this->offset_x;
+ *y += this->offset_y;
+ }
+}
+
+#endif /* _SDL_fbvideo_h */
diff --git a/distrib/sdl-1.2.15/src/video/fbcon/matrox_mmio.h b/distrib/sdl-1.2.15/src/video/fbcon/matrox_mmio.h
new file mode 100644
index 0000000..a1cf203
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/fbcon/matrox_mmio.h
@@ -0,0 +1,51 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* MGA register definitions */
+
+#include "matrox_regs.h"
+
+/* MGA control macros */
+
+#define mga_in8(reg) *(volatile Uint8 *)(mapped_io + (reg))
+#define mga_in32(reg) *(volatile Uint32 *)(mapped_io + (reg))
+
+#define mga_out8(reg,v) *(volatile Uint8 *)(mapped_io + (reg)) = v;
+#define mga_out32(reg,v) *(volatile Uint32 *)(mapped_io + (reg)) = v;
+
+
+/* Wait for fifo space */
+#define mga_wait(space) \
+{ \
+ while ( mga_in8(MGAREG_FIFOSTATUS) < space ) \
+ ; \
+}
+
+
+/* Wait for idle accelerator */
+#define mga_waitidle() \
+{ \
+ while ( mga_in32(MGAREG_STATUS) & 0x10000 ) \
+ ; \
+}
+
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/matrox_regs.h b/distrib/sdl-1.2.15/src/video/fbcon/matrox_regs.h
index d570b0c..d570b0c 100644
--- a/distrib/sdl-1.2.12/src/video/fbcon/matrox_regs.h
+++ b/distrib/sdl-1.2.15/src/video/fbcon/matrox_regs.h
diff --git a/distrib/sdl-1.2.12/src/video/fbcon/riva_mmio.h b/distrib/sdl-1.2.15/src/video/fbcon/riva_mmio.h
index e926167..e926167 100644
--- a/distrib/sdl-1.2.12/src/video/fbcon/riva_mmio.h
+++ b/distrib/sdl-1.2.15/src/video/fbcon/riva_mmio.h
diff --git a/distrib/sdl-1.2.15/src/video/fbcon/riva_regs.h b/distrib/sdl-1.2.15/src/video/fbcon/riva_regs.h
new file mode 100644
index 0000000..5324562
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/fbcon/riva_regs.h
@@ -0,0 +1,43 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _RIVA_REGS_H
+#define _RIVA_REGS_H
+
+/* This information comes from the XFree86 NVidia hardware driver */
+
+/* mapped_io register offsets */
+#define PGRAPH_OFFSET 0x00400000
+#define FIFO_OFFSET 0x00800000
+#define ROP_OFFSET FIFO_OFFSET+0x00000000
+#define CLIP_OFFSET FIFO_OFFSET+0x00002000
+#define PATT_OFFSET FIFO_OFFSET+0x00004000
+#define PIXMAP_OFFSET FIFO_OFFSET+0x00006000
+#define BLT_OFFSET FIFO_OFFSET+0x00008000
+#define BITMAP_OFFSET FIFO_OFFSET+0x0000A000
+#define LINE_OFFSET FIFO_OFFSET+0x0000C000
+#define TRI03_OFFSET FIFO_OFFSET+0x0000E000
+#define PCIO_OFFSET 0x00601000
+
+#endif /* _RIVA_REGS_H */
+
diff --git a/distrib/sdl-1.2.15/src/video/gapi/SDL_gapivideo.c b/distrib/sdl-1.2.15/src/video/gapi/SDL_gapivideo.c
new file mode 100644
index 0000000..86deadc
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/gapi/SDL_gapivideo.c
@@ -0,0 +1,1287 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Pocket PC GAPI SDL video driver implementation;
+Implemented by Dmitry Yakimov - support@activekitten.com
+Inspired by http://arisme.free.fr/ports/SDL.php
+*/
+
+// TODO: copy surface on window when lost focus
+// TODO: test buttons rotation
+// TODO: test on be300 and HPC ( check WinDib fullscreen keys catching )
+// TODO: test on smartphones
+// TODO: windib on SH3 PPC2000 landscape test
+// TODO: optimize 8bpp landscape mode
+
+// there is some problems in runnings apps from a device landscape mode
+// due to WinCE bugs. Some works and some - does not.
+// TODO: finish Axim Dell X30 and user landscape mode, device landscape mode
+// TODO: finish Axim Dell X30 user portrait, device landscape stylus conversion
+// TODO: fix running GAPI apps from landscape mode -
+// wince goes to portrait mode, but does not update video memory
+
+
+#include "SDL.h"
+#include "SDL_error.h"
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+#include "../wincommon/SDL_syswm_c.h"
+#include "../wincommon/SDL_sysmouse_c.h"
+#include "../windib/SDL_dibevents_c.h"
+
+#include "../windib/SDL_gapidibvideo.h"
+#include "SDL_gapivideo.h"
+
+#define gapi this->hidden->gapiInfo
+
+#define GAPIVID_DRIVER_NAME "gapi"
+
+#if defined(DEBUG) || defined (_DEBUG) || defined(NDEBUG)
+#define REPORT_VIDEO_INFO 1
+#else
+#define REPORT_VIDEO_INFO 0
+#endif
+
+// for testing with GapiEmu
+#define USE_GAPI_EMU 0
+#define EMULATE_AXIM_X30 0
+#define WITHOUT_GAPI 0
+
+#if USE_GAPI_EMU && !REPORT_VIDEO_INFO
+#pragma message("Warning: Using GapiEmu in release build. I assume you'd like to set USE_GAPI_EMU to zero.")
+#endif
+
+#ifndef _T
+#define _T(x) L##x
+#endif
+
+#ifndef ASSERT
+#define ASSERT(x)
+#endif
+
+// defined and used in SDL_sysevents.c
+extern HINSTANCE aygshell;
+extern void SDL_UnregisterApp();
+extern int DIB_AddMode(_THIS, int bpp, int w, int h);
+
+/* Initialization/Query functions */
+static int GAPI_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **GAPI_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *GAPI_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int GAPI_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
+static void GAPI_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int GAPI_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int GAPI_LockHWSurface(_THIS, SDL_Surface *surface);
+static void GAPI_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void GAPI_FreeHWSurface(_THIS, SDL_Surface *surface);
+
+/* Windows message handling functions, will not be processed */
+static void GAPI_Activate(_THIS, BOOL active, BOOL minimized);
+static void GAPI_RealizePalette(_THIS);
+static void GAPI_PaletteChanged(_THIS, HWND window);
+static void GAPI_WinPAINT(_THIS, HDC hdc);
+
+/* etc. */
+static void GAPI_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
+
+static HMODULE g_hGapiLib = 0;
+#define LINK(type,name,import) \
+ if( g_hGapiLib ) \
+ name = (PFN##type)GetProcAddress( g_hGapiLib, _T(import) );
+
+static char g_bRawBufferAvailable = 0;
+
+/* GAPI driver bootstrap functions */
+
+/* hi res definitions */
+typedef struct _RawFrameBufferInfo
+{
+ WORD wFormat;
+ WORD wBPP;
+ VOID *pFramePointer;
+ int cxStride;
+ int cyStride;
+ int cxPixels;
+ int cyPixels;
+} RawFrameBufferInfo;
+
+static struct _RawFrameBufferInfo g_RawFrameBufferInfo = {0};
+
+#define GETRAWFRAMEBUFFER 0x00020001
+
+#define FORMAT_565 1
+#define FORMAT_555 2
+#define FORMAT_OTHER 3
+
+/* Dell Axim x30 hangs when we use GAPI from landscape,
+ so lets avoid using GxOpenDisplay there via GETGXINFO trick
+ It seems that GAPI subsystem use the same ExtEscape code.
+*/
+#define GETGXINFO 0x00020000
+
+typedef struct GXDeviceInfo
+{
+long Version; //00 (should filled with 100 before calling ExtEscape)
+void * pvFrameBuffer; //04
+unsigned long cbStride; //08
+unsigned long cxWidth; //0c
+unsigned long cyHeight; //10
+unsigned long cBPP; //14
+unsigned long ffFormat; //18
+char Unused[0x84-7*4];
+} GXDeviceInfo;
+
+static int GAPI_Available(void)
+{
+ // try to use VGA display, even on emulator
+ HDC hdc = GetDC(NULL);
+ int result = ExtEscape(hdc, GETRAWFRAMEBUFFER, 0, NULL, sizeof(RawFrameBufferInfo), (char *)&g_RawFrameBufferInfo);
+ ReleaseDC(NULL, hdc);
+ g_bRawBufferAvailable = result > 0;
+
+ //My Asus MyPAL 696 reports the RAWFRAMEBUFFER as available, but with a size of 0 x 0
+ if(g_RawFrameBufferInfo.cxPixels <= 0 || g_RawFrameBufferInfo.cyPixels <= 0){
+ g_bRawBufferAvailable = 0;
+ }
+
+#if WITHOUT_GAPI
+ return g_bRawBufferAvailable;
+#endif
+
+#if USE_GAPI_EMU
+ g_hGapiLib = LoadLibrary(_T("GAPI_Emu.dll"));
+ if( !g_hGapiLib )
+ {
+ SDL_SetError("Gapi Emu not found!");
+ }
+ return g_hGapiLib != 0;
+#endif
+
+ // try to find gx.dll
+ g_hGapiLib = LoadLibrary(_T("\\Windows\\gx.dll"));
+ if( !g_hGapiLib )
+ {
+ g_hGapiLib = LoadLibrary(_T("gx.dll"));
+ if( !g_hGapiLib ) return g_bRawBufferAvailable;
+ }
+
+ return(1);
+}
+
+static int cmpmodes(const void *va, const void *vb)
+{
+ SDL_Rect *a = *(SDL_Rect **)va;
+ SDL_Rect *b = *(SDL_Rect **)vb;
+ if ( a->w == b->w )
+ return b->h - a->h;
+ else
+ return b->w - a->w;
+}
+
+static int GAPI_AddMode(_THIS, int bpp, int w, int h)
+{
+ SDL_Rect *mode;
+ int i, index;
+ int next_mode;
+
+ /* Check to see if we already have this mode */
+ if ( bpp < 8 ) { /* Not supported */
+ return(0);
+ }
+ index = ((bpp+7)/8)-1;
+ for ( i=0; i<gapi->SDL_nummodes[index]; ++i ) {
+ mode = gapi->SDL_modelist[index][i];
+ if ( (mode->w == w) && (mode->h == h) ) {
+ return(0);
+ }
+ }
+
+ /* Set up the new video mode rectangle */
+ mode = (SDL_Rect *)SDL_malloc(sizeof *mode);
+ if ( mode == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ mode->x = 0;
+ mode->y = 0;
+ mode->w = w;
+ mode->h = h;
+
+ /* Allocate the new list of modes, and fill in the new mode */
+ next_mode = gapi->SDL_nummodes[index];
+ gapi->SDL_modelist[index] = (SDL_Rect **)
+ SDL_realloc(gapi->SDL_modelist[index], (1+next_mode+1)*sizeof(SDL_Rect *));
+ if ( gapi->SDL_modelist[index] == NULL ) {
+ SDL_OutOfMemory();
+ gapi->SDL_nummodes[index] = 0;
+ SDL_free(mode);
+ return(-1);
+ }
+ gapi->SDL_modelist[index][next_mode] = mode;
+ gapi->SDL_modelist[index][next_mode+1] = NULL;
+ gapi->SDL_nummodes[index]++;
+
+ return(0);
+}
+
+static void GAPI_DeleteDevice(SDL_VideoDevice *device)
+{
+ if( g_hGapiLib )
+ {
+ FreeLibrary(g_hGapiLib);
+ g_hGapiLib = 0;
+ }
+ SDL_free(device->hidden->gapiInfo);
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_VideoDevice *GAPI_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device;
+
+ if( !g_hGapiLib && !g_bRawBufferAvailable)
+ {
+ if( !GAPI_Available() )
+ {
+ SDL_SetError("GAPI dll is not found and VGA mode is not available!");
+ return 0;
+ }
+ }
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *device->hidden));
+ if(device->hidden){
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+ device->hidden->gapiInfo = (GapiInfo *)SDL_malloc((sizeof(GapiInfo)));
+ if(device->hidden->gapiInfo == NULL)
+ {
+ SDL_free(device->hidden);
+ device->hidden = NULL;
+ }
+ }
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( device ) {
+ SDL_free(device);
+ }
+ return(0);
+ }
+ SDL_memset(device->hidden->gapiInfo, 0, (sizeof *device->hidden->gapiInfo));
+
+ /* Set the function pointers */
+ device->VideoInit = GAPI_VideoInit;
+ device->ListModes = GAPI_ListModes;
+ device->SetVideoMode = GAPI_SetVideoMode;
+ device->UpdateMouse = WIN_UpdateMouse;
+ device->CreateYUVOverlay = NULL;
+ device->SetColors = GAPI_SetColors;
+ device->UpdateRects = GAPI_UpdateRects;
+ device->VideoQuit = GAPI_VideoQuit;
+ device->AllocHWSurface = GAPI_AllocHWSurface;
+ device->CheckHWBlit = NULL;
+ device->FillHWRect = NULL;
+ device->SetHWColorKey = NULL;
+ device->SetHWAlpha = NULL;
+ device->LockHWSurface = GAPI_LockHWSurface;
+ device->UnlockHWSurface = GAPI_UnlockHWSurface;
+ device->FlipHWSurface = NULL;
+ device->FreeHWSurface = GAPI_FreeHWSurface;
+ device->SetCaption = WIN_SetWMCaption;
+ device->SetIcon = WIN_SetWMIcon;
+ device->IconifyWindow = WIN_IconifyWindow;
+ device->GrabInput = WIN_GrabInput;
+ device->GetWMInfo = WIN_GetWMInfo;
+ device->FreeWMCursor = WIN_FreeWMCursor;
+ device->CreateWMCursor = WIN_CreateWMCursor;
+ device->ShowWMCursor = WIN_ShowWMCursor;
+ device->WarpWMCursor = WIN_WarpWMCursor;
+ device->CheckMouseMode = WIN_CheckMouseMode;
+ device->InitOSKeymap = DIB_InitOSKeymap;
+ device->PumpEvents = DIB_PumpEvents;
+
+ /* Set up the windows message handling functions */
+ WIN_Activate = GAPI_Activate;
+ WIN_RealizePalette = GAPI_RealizePalette;
+ WIN_PaletteChanged = GAPI_PaletteChanged;
+ WIN_WinPAINT = GAPI_WinPAINT;
+ HandleMessage = DIB_HandleMessage;
+
+ device->free = GAPI_DeleteDevice;
+
+ /* Load gapi library */
+#define gx device->hidden->gapiInfo->gxFunc
+
+ LINK( GXOpenDisplay, gx.GXOpenDisplay, "?GXOpenDisplay@@YAHPAUHWND__@@K@Z" )
+ LINK( GXCloseDisplay, gx.GXCloseDisplay, "?GXCloseDisplay@@YAHXZ" )
+ LINK( GXBeginDraw, gx.GXBeginDraw, "?GXBeginDraw@@YAPAXXZ" )
+ LINK( GXEndDraw, gx.GXEndDraw, "?GXEndDraw@@YAHXZ" )
+ LINK( GXOpenInput, gx.GXOpenInput, "?GXOpenInput@@YAHXZ" )
+ LINK( GXCloseInput, gx.GXCloseInput, "?GXCloseInput@@YAHXZ" )
+ LINK( GXGetDisplayProperties, gx.GXGetDisplayProperties,"?GXGetDisplayProperties@@YA?AUGXDisplayProperties@@XZ" )
+ LINK( GXGetDefaultKeys, gx.GXGetDefaultKeys, "?GXGetDefaultKeys@@YA?AUGXKeyList@@H@Z" )
+ LINK( GXSuspend, gx.GXSuspend, "?GXSuspend@@YAHXZ" )
+ LINK( GXResume, gx.GXResume, "?GXResume@@YAHXZ" )
+ LINK( GXSetViewport, gx.GXSetViewport, "?GXSetViewport@@YAHKKKK@Z" )
+ LINK( GXIsDisplayDRAMBuffer, gx.GXIsDisplayDRAMBuffer, "?GXIsDisplayDRAMBuffer@@YAHXZ" )
+
+ /* wrong gapi.dll */
+ if( !gx.GXOpenDisplay )
+ {
+ if( g_hGapiLib )
+ {
+ FreeLibrary(g_hGapiLib);
+ g_hGapiLib = 0;
+ }
+ }
+
+ if( !gx.GXOpenDisplay && !g_bRawBufferAvailable)
+ {
+ SDL_SetError("Error: damaged or unknown gapi.dll!\n");
+ GAPI_DeleteDevice(device);
+ return 0;
+ }
+
+ return device;
+}
+
+VideoBootStrap GAPI_bootstrap = {
+ GAPIVID_DRIVER_NAME, "WinCE GAPI video driver",
+ GAPI_Available, GAPI_CreateDevice
+};
+
+static void FillStructs(_THIS, BOOL useVga)
+{
+#ifdef _ARM_
+ WCHAR oemstr[100];
+#endif
+ /* fill a device properties */
+
+ if( !useVga )
+ {
+ gapi->gxProperties = gapi->gxFunc.GXGetDisplayProperties();
+ gapi->needUpdate = 1;
+ gapi->hiresFix = 0;
+ gapi->useVga = 0;
+ gapi->useGXOpenDisplay = 1;
+
+#ifdef _ARM_
+ /* check some devices and extract addition info */
+ SystemParametersInfo( SPI_GETOEMINFO, sizeof( oemstr ), oemstr, 0 );
+
+ // buggy iPaq38xx
+ if ((oemstr[12] == 'H') && (oemstr[13] == '3') && (oemstr[14] == '8') && (gapi->gxProperties.cbxPitch > 0))
+ {
+ gapi->videoMem = (PIXEL*)0xac0755a0;
+ gapi->gxProperties.cbxPitch = -640;
+ gapi->gxProperties.cbyPitch = 2;
+ gapi->needUpdate = 0;
+ }
+#if (EMULATE_AXIM_X30 == 0)
+ // buggy Dell Axim X30
+ if( _tcsncmp(oemstr, L"Dell Axim X30", 13) == 0 )
+#endif
+ {
+ GXDeviceInfo gxInfo = {0};
+ HDC hdc = GetDC(NULL);
+ int result;
+
+ gxInfo.Version = 100;
+ result = ExtEscape(hdc, GETGXINFO, 0, NULL, sizeof(gxInfo), (char *)&gxInfo);
+ if( result > 0 )
+ {
+ gapi->useGXOpenDisplay = 0;
+ gapi->videoMem = gxInfo.pvFrameBuffer;
+ gapi->needUpdate = 0;
+ gapi->gxProperties.cbxPitch = 2;
+ gapi->gxProperties.cbyPitch = 480;
+ gapi->gxProperties.cxWidth = gxInfo.cxWidth;
+ gapi->gxProperties.cyHeight = gxInfo.cyHeight;
+ gapi->gxProperties.ffFormat = gxInfo.ffFormat;
+ }
+ }
+#endif
+ } else
+ {
+ gapi->needUpdate = 0;
+ gapi->hiresFix = 0;
+ gapi->gxProperties.cBPP = g_RawFrameBufferInfo.wBPP;
+ gapi->gxProperties.cbxPitch = g_RawFrameBufferInfo.cxStride;
+ gapi->gxProperties.cbyPitch = g_RawFrameBufferInfo.cyStride;
+ gapi->gxProperties.cxWidth = g_RawFrameBufferInfo.cxPixels;
+ gapi->gxProperties.cyHeight = g_RawFrameBufferInfo.cyPixels;
+ gapi->videoMem = g_RawFrameBufferInfo.pFramePointer;
+ gapi->useVga = 1;
+
+ switch( g_RawFrameBufferInfo.wFormat )
+ {
+ case FORMAT_565:
+ gapi->gxProperties.ffFormat = kfDirect565;
+ break;
+ case FORMAT_555:
+ gapi->gxProperties.ffFormat = kfDirect555;
+ break;
+ default:
+ /* unknown pixel format, try define by BPP! */
+ switch( g_RawFrameBufferInfo.wBPP )
+ {
+ case 4:
+ case 8:
+ gapi->gxProperties.ffFormat = kfDirect;
+ case 16:
+ gapi->gxProperties.ffFormat = kfDirect565;
+ default:
+ gapi->gxProperties.ffFormat = kfDirect;
+ break;
+ }
+ }
+ }
+
+ if( gapi->gxProperties.cBPP != 16 )
+ {
+ gapi->gapiOrientation = SDL_ORIENTATION_UP;
+ } else
+ if( (gapi->gxProperties.cbxPitch > 0) && (gapi->gxProperties.cbyPitch > 0 ))
+ {
+ gapi->gapiOrientation = SDL_ORIENTATION_UP;
+ } else
+ if( (gapi->gxProperties.cbxPitch > 0) && (gapi->gxProperties.cbyPitch < 0 ))
+ {
+ gapi->gapiOrientation = SDL_ORIENTATION_RIGHT; // ipaq 3660
+ } else
+ if( (gapi->gxProperties.cbxPitch < 0) && (gapi->gxProperties.cbyPitch > 0 ))
+ {
+ gapi->gapiOrientation = SDL_ORIENTATION_LEFT; // ipaq 3800
+ }
+}
+
+static void GAPI_CreatePalette(int ncolors, SDL_Color *colors)
+{
+ // Setup a custom color palette
+ BYTE buffer[ sizeof(LOGPALETTE) + 255 * sizeof(PALETTEENTRY) ];
+ int i;
+ LOGPALETTE* pLogical = (LOGPALETTE*)buffer;
+ PALETTEENTRY* entries = pLogical->palPalEntry;
+ HPALETTE hPalette;
+ HDC hdc;
+
+ for (i = 0; i < ncolors; ++i)
+ {
+ // Find intensity by replicating the bit patterns over a byte
+ entries[i].peRed = colors[i].r;
+ entries[i].peGreen = colors[i].g;
+ entries[i].peBlue = colors[i].b;
+ entries[i].peFlags = 0;
+ }
+
+ // Create the GDI palette object
+ pLogical->palVersion = 0x0300;
+ pLogical->palNumEntries = ncolors;
+
+ hPalette = CreatePalette( pLogical );
+ ASSERT(hPalette);
+
+
+ // Realize the palette
+ hdc = GetDC(0);
+
+ SelectPalette( hdc, hPalette, FALSE );
+ RealizePalette( hdc );
+
+ ReleaseDC( 0, hdc );
+ DeleteObject( hPalette );
+}
+
+int GAPI_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ int i,bpp;
+
+ /* Create the window */
+ if ( DIB_CreateWindow(this) < 0 ) {
+ return(-1);
+ }
+
+ if( g_hGapiLib )
+ {
+ FillStructs(this, 0);
+
+ // SDL does not supports 2/4bpp mode, so use 16 bpp
+ bpp = gapi->gxProperties.cBPP < 8 ? 16 : gapi->gxProperties.cBPP;
+
+ /* set up normal and landscape mode */
+ GAPI_AddMode(this, bpp, gapi->gxProperties.cyHeight, gapi->gxProperties.cxWidth);
+ GAPI_AddMode(this, bpp, gapi->gxProperties.cxWidth, gapi->gxProperties.cyHeight);
+ }
+
+ /* add hi-res mode */
+ if( g_bRawBufferAvailable &&
+ !((gapi->gxProperties.cxWidth == (unsigned)g_RawFrameBufferInfo.cxPixels) && (gapi->gxProperties.cyHeight == (unsigned)g_RawFrameBufferInfo.cyPixels)))
+ {
+ FillStructs(this, 1);
+
+ // SDL does not supports 2/4bpp mode, so use 16 bpp
+ bpp = gapi->gxProperties.cBPP < 8 ? 16 : gapi->gxProperties.cBPP;
+
+ /* set up normal and landscape mode */
+ GAPI_AddMode(this, bpp, gapi->gxProperties.cyHeight, gapi->gxProperties.cxWidth);
+ GAPI_AddMode(this, bpp, gapi->gxProperties.cxWidth, gapi->gxProperties.cyHeight);
+ }
+
+ /* Determine the current screen size.
+ * This is NOT necessarily the size of the Framebuffer or GAPI, as they return
+ * the displaysize in ORIENTATION_UP */
+ this->info.current_w = GetSystemMetrics(SM_CXSCREEN);
+ this->info.current_h = GetSystemMetrics(SM_CYSCREEN);
+
+ /* Sort the mode lists */
+ for ( i=0; i<NUM_MODELISTS; ++i ) {
+ if ( gapi->SDL_nummodes[i] > 0 ) {
+ SDL_qsort(gapi->SDL_modelist[i], gapi->SDL_nummodes[i], sizeof *gapi->SDL_modelist[i], cmpmodes);
+ }
+ }
+
+ vformat->BitsPerPixel = gapi->gxProperties.cBPP < 8 ? 16 : (unsigned char)gapi->gxProperties.cBPP;
+
+ // Get color mask
+ if (gapi->gxProperties.ffFormat & kfDirect565) {
+ vformat->BitsPerPixel = 16;
+ vformat->Rmask = 0x0000f800;
+ vformat->Gmask = 0x000007e0;
+ vformat->Bmask = 0x0000001f;
+ gapi->videoMode = GAPI_DIRECT_565;
+ }
+ else
+ if (gapi->gxProperties.ffFormat & kfDirect555) {
+ vformat->BitsPerPixel = 16;
+ vformat->Rmask = 0x00007c00;
+ vformat->Gmask = 0x000003e0;
+ vformat->Bmask = 0x0000001f;
+ gapi->videoMode = GAPI_DIRECT_555;
+ }
+ else
+ if ((gapi->gxProperties.ffFormat & kfDirect) && (gapi->gxProperties.cBPP < 8)) {
+ // We'll perform the conversion
+ vformat->BitsPerPixel = 16;
+ vformat->Rmask = 0x0000f800; // 16 bit 565
+ vformat->Gmask = 0x000007e0;
+ vformat->Bmask = 0x0000001f;
+ if (gapi->gxProperties.ffFormat & kfDirectInverted)
+ gapi->invert = (1 << gapi->gxProperties.cBPP) - 1;
+ gapi->colorscale = gapi->gxProperties.cBPP < 8 ? 8 - gapi->gxProperties.cBPP : 0;
+ gapi->videoMode = GAPI_MONO;
+ }
+ else
+ if (gapi->gxProperties.ffFormat & kfPalette) {
+ gapi->videoMode = GAPI_PALETTE;
+ }
+
+ /* We're done! */
+ return(0);
+}
+
+SDL_Rect **GAPI_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ return(gapi->SDL_modelist[((format->BitsPerPixel+7)/8)-1]);
+// return (SDL_Rect **) -1;
+}
+
+SDL_Surface *GAPI_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ SDL_Surface *video;
+ Uint32 Rmask, Gmask, Bmask;
+ DWORD style;
+ SDL_Rect allScreen;
+
+ if( bpp < 4 )
+ {
+ SDL_SetError("1 bpp and 2 bpp modes is not implemented yet!");
+ return 0;
+ }
+
+ /* Recalculate bitmasks if necessary */
+ if (bpp == current->format->BitsPerPixel) {
+ video = current;
+ }
+ else {
+ switch(bpp) {
+ case 8:
+ Rmask = 0;
+ Gmask = 0;
+ Bmask = 0;
+ break;
+ case 15:
+ case 16:
+ /* Default is 565 unless the display is specifically 555 */
+ if (gapi->gxProperties.ffFormat & kfDirect555) {
+ Rmask = 0x00007c00;
+ Gmask = 0x000003e0;
+ Bmask = 0x0000001f;
+ }
+ else {
+ Rmask = 0x0000f800;
+ Gmask = 0x000007e0;
+ Bmask = 0x0000001f;
+ }
+ break;
+ case 24:
+ case 32:
+ Rmask = 0x00ff0000;
+ Gmask = 0x0000ff00;
+ Bmask = 0x000000ff;
+ break;
+ default:
+ SDL_SetError("Unsupported Bits Per Pixel format requested");
+ return NULL;
+ }
+ video = SDL_CreateRGBSurface(SDL_SWSURFACE,
+ 0, 0, bpp, Rmask, Gmask, Bmask, 0);
+ if ( video == NULL ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ }
+
+ gapi->userOrientation = SDL_ORIENTATION_UP;
+ gapi->systemOrientation = SDL_ORIENTATION_UP;
+ video->flags = SDL_FULLSCREEN; /* Clear flags, GAPI supports fullscreen only */
+
+ /* GAPI or VGA? */
+ if( g_hGapiLib )
+ {
+ FillStructs(this, 0);
+ if( (((unsigned)width != gapi->gxProperties.cxWidth) || ((unsigned)height != gapi->gxProperties.cyHeight))
+ && (((unsigned)width != gapi->gxProperties.cyHeight) || ((unsigned)height != gapi->gxProperties.cxWidth)))
+ FillStructs(this, 1); // gapi is found but we use VGA resolution
+ } else
+ FillStructs(this, 1);
+
+ if ( !gapi->needUpdate && !gapi->videoMem) {
+ SDL_SetError("Couldn't get address of video memory, may be unsupported device or bug");
+ return(NULL);
+ }
+
+ /* detect user landscape mode */
+ if( (width > height) && (gapi->gxProperties.cxWidth < gapi->gxProperties.cyHeight))
+ gapi->userOrientation = SDL_ORIENTATION_RIGHT;
+
+ if(GetSystemMetrics(SM_CYSCREEN) < GetSystemMetrics(SM_CXSCREEN))
+ gapi->systemOrientation = SDL_ORIENTATION_RIGHT;
+
+ gapi->hiresFix = 0;
+
+ /* check hires */
+ if(GetSystemMetrics(SM_CXSCREEN) < width && GetSystemMetrics(SM_CYSCREEN) < height)
+ {
+ gapi->hiresFix = 1;
+ }
+
+ switch( gapi->userOrientation )
+ {
+ case SDL_ORIENTATION_UP:
+ gapi->startOffset = 0;
+ gapi->dstLineStep = gapi->gxProperties.cbyPitch;
+ gapi->dstPixelStep = gapi->gxProperties.cbxPitch;
+ break;
+ case SDL_ORIENTATION_RIGHT:
+ switch( gapi->gapiOrientation )
+ {
+ case SDL_ORIENTATION_UP:
+ case SDL_ORIENTATION_RIGHT:
+ case SDL_ORIENTATION_LEFT:
+ if( (gapi->videoMode == GAPI_MONO) )
+ gapi->startOffset = -gapi->gxProperties.cbxPitch + 1; // monochrome mode
+ else
+ gapi->startOffset = gapi->gxProperties.cbyPitch * (gapi->gxProperties.cyHeight - 1);
+
+ gapi->dstLineStep = gapi->gxProperties.cbxPitch;
+ gapi->dstPixelStep = -gapi->gxProperties.cbyPitch;
+ break;
+ }
+ }
+
+ video->w = gapi->w = width;
+ video->h = gapi->h = height;
+ video->pitch = SDL_CalculatePitch(video);
+
+ /* Small fix for WinCE/Win32 - when activating window
+ SDL_VideoSurface is equal to zero, so activating code
+ is not called properly for fullscreen windows because
+ macros WINDIB_FULLSCREEN uses SDL_VideoSurface
+ */
+ SDL_VideoSurface = video;
+
+ /* GAPI is always fullscreen, title bar is useless */
+ style = 0;
+
+ if (!SDL_windowid)
+ SetWindowLong(SDL_Window, GWL_STYLE, style);
+
+ /* Allocate bitmap */
+ if( gapi->buffer )
+ {
+ SDL_free( gapi->buffer );
+ gapi->buffer = NULL;
+ }
+ gapi->buffer = SDL_malloc(video->h * video->pitch);
+ video->pixels = gapi->buffer;
+
+ if ( ! gapi->buffer ) {
+ SDL_SetError("Couldn't allocate buffer for requested mode");
+ return(NULL);
+ }
+
+ SDL_memset(gapi->buffer, 255, video->h * video->pitch);
+ MoveWindow(SDL_Window, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), FALSE);
+ ShowWindow(SDL_Window, SW_SHOW);
+ SetForegroundWindow(SDL_Window);
+
+ /* JC 14 Mar 2006
+ Flush the message loop or this can cause big problems later
+ Especially if the user decides to use dialog boxes or assert()!
+ */
+ WIN_FlushMessageQueue();
+
+ /* Open GAPI display */
+ if( !gapi->useVga && gapi->useGXOpenDisplay && !gapi->alreadyGXOpened )
+ {
+#if REPORT_VIDEO_INFO
+ printf("system display width (orig): %d\n", GetSystemMetrics(SM_CXSCREEN));
+ printf("system display height (orig): %d\n", GetSystemMetrics(SM_CYSCREEN));
+#endif
+ gapi->alreadyGXOpened = 1;
+ if( !gapi->gxFunc.GXOpenDisplay(SDL_Window, GX_FULLSCREEN) )
+ {
+ SDL_SetError("Couldn't initialize GAPI");
+ return(NULL);
+ }
+ }
+
+ if(gapi->useVga)
+ gapi->coordinateTransform = (4 - gapi->systemOrientation + gapi->userOrientation) % 4;
+ else
+ gapi->coordinateTransform = gapi->userOrientation;
+
+#if REPORT_VIDEO_INFO
+ printf("Video properties:\n");
+ printf("display bpp: %d\n", gapi->gxProperties.cBPP);
+ printf("display width: %d\n", gapi->gxProperties.cxWidth);
+ printf("display height: %d\n", gapi->gxProperties.cyHeight);
+ printf("system display width: %d\n", GetSystemMetrics(SM_CXSCREEN));
+ printf("system display height: %d\n", GetSystemMetrics(SM_CYSCREEN));
+ printf("x pitch: %d\n", gapi->gxProperties.cbxPitch);
+ printf("y pitch: %d\n", gapi->gxProperties.cbyPitch);
+ printf("gapi flags: 0x%x\n", gapi->gxProperties.ffFormat);
+ printf("user orientation: %d\n", gapi->userOrientation);
+ printf("system orientation: %d\n", gapi->systemOrientation);
+ printf("gapi orientation: %d\n", gapi->gapiOrientation);
+
+
+ if( !gapi->useVga && gapi->useGXOpenDisplay && gapi->needUpdate)
+ {
+ gapi->videoMem = gapi->gxFunc.GXBeginDraw();
+ gapi->gxFunc.GXEndDraw();
+ }
+
+ printf("video memory: 0x%x\n", gapi->videoMem);
+ printf("need update: %d\n", gapi->needUpdate);
+ printf("hi-res fix: %d\n", gapi->hiresFix);
+ printf("VGA is available on the device: %d\n", g_bRawBufferAvailable);
+ printf("use raw framebuffer: %d\n", gapi->useVga);
+ printf("video surface bpp: %d\n", video->format->BitsPerPixel);
+ printf("video surface width: %d\n", video->w);
+ printf("video surface height: %d\n", video->h);
+ printf("mouse/arrows transformation angle: %d\n", gapi->coordinateTransform);
+#endif
+
+
+ /* Blank screen */
+ allScreen.x = allScreen.y = 0;
+ allScreen.w = video->w - 1;
+ allScreen.h = video->h - 1;
+ GAPI_UpdateRects(this, 1, &allScreen);
+
+ /* We're done */
+ return(video);
+}
+
+/* We don't actually allow hardware surfaces other than the main one */
+static int GAPI_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(-1);
+}
+static void GAPI_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+/* We need to wait for vertical retrace on page flipped displays */
+static int GAPI_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(0);
+}
+
+static void GAPI_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+static int updateLine8to8(_THIS, unsigned char *srcPointer, unsigned char *destPointer, int width, int height, int lines)
+{
+ if( gapi->dstPixelStep == 1) /* optimized blitting on most devices */
+ {
+ SDL_memcpy(destPointer, srcPointer, width);
+ return 1;
+ } else
+ {
+ // TODO: read 4 pixels, write DWORD
+ int step = gapi->dstPixelStep;
+ while(width--)
+ {
+ *destPointer = *srcPointer++;
+ destPointer += step;
+ }
+ }
+ return 1;
+}
+
+/* Video memory is very slow so lets optimize as much as possible */
+static int updateLine16to16(_THIS, PIXEL *srcPointer, PIXEL *destPointer, int width, int height, int lines)
+{
+ PIXEL *line1, *line2;
+ int step = gapi->dstPixelStep / 2;
+
+ if( step == 1 ) /* optimized blitting on most devices */
+ {
+ SDL_memcpy(destPointer, srcPointer, width * sizeof(PIXEL));
+ return 1;
+ }
+ else
+ {
+ if( (gapi->gapiOrientation != SDL_ORIENTATION_UP) &&
+ (gapi->userOrientation == SDL_ORIENTATION_UP )) // iPaq 3660/3800 and user orientation up
+ {
+ // to prevent data misalignment copy only one line
+ if( ((((unsigned)destPointer & 3) != 0) && (gapi->gapiOrientation == SDL_ORIENTATION_LEFT))
+ || ((((unsigned)destPointer & 3) == 0) && (gapi->gapiOrientation != SDL_ORIENTATION_LEFT))
+ || (lines == 1) )
+ {
+ while(width--)
+ {
+ *destPointer = *srcPointer++;
+ destPointer += step;
+ }
+ return 1;
+ }
+
+ /* read two lines at the same time, write DWORD */
+ line1 = srcPointer;
+ line2 = srcPointer + SDL_VideoSurface->pitch / 2;
+
+ if( gapi->gapiOrientation == SDL_ORIENTATION_LEFT )
+ while(width--) // iPaq 3800
+ {
+ *(DWORD*)destPointer =(*line2++ << 16) | *line1++;
+ destPointer += step;
+ }
+ else
+ {
+ destPointer += gapi->gxProperties.cbyPitch / 2;
+
+ while(width--) // iPaq 3660
+ {
+ *(DWORD*)destPointer =(*line1++ << 16) | *line2++;
+ destPointer += step;
+ }
+ }
+ return 2;
+ } else
+ {
+ // iPaq 3800 and user orientation landscape
+ if( gapi->gapiOrientation == SDL_ORIENTATION_LEFT )
+ {
+ int w1;
+
+ // to prevent data misalignment copy only one pixel
+ if( (((unsigned)destPointer & 3) == 0) && (width > 0))
+ {
+ *destPointer-- = *srcPointer++;
+ width--;
+ }
+
+ destPointer--;
+
+ w1 = width / 2;
+
+ while(w1--)
+ {
+ DWORD p = *(DWORD*)srcPointer;
+ *((DWORD*)destPointer) = (p << 16) | (p >> 16);
+ destPointer -= 2;
+ srcPointer += 2;
+ }
+
+ if( width & 1 ) // copy the last pixel
+ {
+ destPointer++;
+ *destPointer = *srcPointer;
+ }
+
+ return 1;
+ }
+
+ // modern iPaqs and user orientation landscape
+ // read two pixels, write DWORD
+
+ line1 = srcPointer;
+ line2 = srcPointer + SDL_VideoSurface->pitch / 2;
+
+ if( (((unsigned)destPointer & 3) != 0) || (lines == 1) )
+ {
+ while(width--)
+ {
+ *destPointer = *srcPointer++;
+ destPointer += step;
+ }
+ return 1;
+ }
+
+ while(width--)
+ {
+ *(DWORD*)destPointer =(*line2++ << 16) | *line1++;
+ destPointer -= gapi->gxProperties.cbyPitch / 2;
+ }
+ return 2;
+ }
+ }
+}
+
+// Color component masks for 565
+#define REDMASK (31<<11)
+#define GREENMASK (63<<5)
+#define BLUEMASK (31)
+
+
+static int updateLine16to4(_THIS, PIXEL *srcPointer, unsigned char *destPointer, int width, int height, int lines, int yNibble, int xNibble)
+{
+ PIXEL *line1, *line2;
+ int step = gapi->dstPixelStep;
+
+ if( gapi->userOrientation == SDL_ORIENTATION_UP )
+ {
+ if( yNibble ) // copy bottom half of a line
+ {
+ while(width--)
+ {
+ PIXEL c1 = *srcPointer++;
+ c1 = ((c1 & REDMASK) >> 11) + ((c1 & GREENMASK) >> 5) + (c1 & BLUEMASK);
+ *destPointer = (*destPointer & 0x0F) | ((~(c1 >> 3) << 4));
+ destPointer += step;
+ }
+ return 1;
+ }
+
+ // either 1 pixel picture or tail, anyway this is the last line
+ if( lines == 1 )
+ {
+ while(width--)
+ {
+ PIXEL c1 = *srcPointer++;
+ c1 = ((c1 & REDMASK) >> 11) + ((c1 & GREENMASK) >> 5) + (c1 & BLUEMASK);
+ *destPointer = (*destPointer & 0xF0) | ((~(c1 >> 3) & 0xF));
+ destPointer += step;
+ }
+ return 1;
+ }
+
+ line1 = srcPointer;
+ line2 = srcPointer + SDL_VideoSurface->pitch / 2;
+
+ while(width--)
+ {
+ PIXEL c1 = *line1++;
+ PIXEL c2 = *line2++;
+ c1 = ((c1 & REDMASK) >> 11) + ((c1 & GREENMASK) >> 5) + (c1 & BLUEMASK);
+ c2 = ((c2 & REDMASK) >> 11) + ((c2 & GREENMASK) >> 5) + (c2 & BLUEMASK);
+ *destPointer = ~((c1 >> 3) + ((c2 >> 3) << 4));
+ destPointer += step;
+ }
+ return 2;
+ } else
+ {
+ int w1;
+ w1 = width / 2;
+
+ if( xNibble )
+ {
+ // copy one pixel
+ PIXEL c1 = *srcPointer++;
+ c1 = ((c1 & REDMASK) >> 11) + ((c1 & GREENMASK) >> 5) + (c1 & BLUEMASK);
+ *destPointer = (*destPointer & 0xF0) | ((~(c1 >> 3) & 0xF));
+ destPointer++;
+ }
+
+ while(w1--)
+ {
+ PIXEL c1 = *srcPointer;
+ PIXEL c2 = *(srcPointer + 1);
+ c1 = ((c1 & REDMASK) >> 11) + ((c1 & GREENMASK) >> 5) + (c1 & BLUEMASK);
+ c2 = ((c2 & REDMASK) >> 11) + ((c2 & GREENMASK) >> 5) + (c2 & BLUEMASK);
+ *destPointer++ = ~((c2 >> 3) + ((c1 >> 3) << 4));
+ srcPointer += 2;
+ }
+
+ // copy tail
+ if( (width & 1) && !xNibble )
+ {
+ PIXEL c1 = *srcPointer;
+ c1 = ((c1 & REDMASK) >> 11) + ((c1 & GREENMASK) >> 5) + (c1 & BLUEMASK);
+ *destPointer = (*destPointer & 0x0F) | ((~(c1 >> 3) << 4));
+ }
+
+ return 1;
+ }
+}
+
+static void GAPI_UpdateRectsMono(_THIS, int numrects, SDL_Rect *rects)
+{
+ int i, height;
+ int linesProcessed;
+ int xNibble, yNibble;
+
+ for (i=0; i<numrects; i++)
+ {
+ unsigned char *destPointer;
+ unsigned char *srcPointer;
+
+ if( gapi->userOrientation == SDL_ORIENTATION_UP )
+ destPointer = (unsigned char*) gapi->videoMem + gapi->startOffset - rects[i].y * gapi->gxProperties.cBPP / 8 + rects[i].x * gapi->dstPixelStep;
+ else
+ destPointer = (unsigned char*) gapi->videoMem + gapi->startOffset + rects[i].x * gapi->gxProperties.cBPP / 8 + rects[i].y * gapi->dstLineStep;
+
+ srcPointer = ((unsigned char*) SDL_VideoSurface->pixels) + rects[i].y * SDL_VideoSurface->pitch + rects[i].x * 2;
+ yNibble = rects[i].y & 1; // TODO: only for 4 bpp
+ xNibble = rects[i].x & 1;
+ height = rects[i].h;
+ while (height > 0)
+ {
+ switch(gapi->gxProperties.cBPP)
+ {
+ case 2: // TODO
+ case 4:
+ linesProcessed = updateLine16to4(this, (PIXEL*) srcPointer, destPointer, rects[i].w, rects[i].h, height, yNibble, xNibble);
+ yNibble = 0;
+ }
+ height -= linesProcessed;
+ if( gapi->userOrientation == SDL_ORIENTATION_UP )
+ destPointer--; // always fill 1 byte
+ else destPointer += gapi->dstLineStep;
+ srcPointer += SDL_VideoSurface->pitch * linesProcessed; // pitch in bytes
+ }
+ }
+}
+
+static void GAPI_UpdateRectsColor(_THIS, int numrects, SDL_Rect *rects)
+{
+ int i, height;
+ int bytesPerPixel = (gapi->gxProperties.cBPP + 1) / 8;
+ int linesProcessed;
+ for (i=0; i<numrects; i++) {
+ unsigned char *destPointer = (unsigned char*) gapi->videoMem + gapi->startOffset + rects[i].y * gapi->dstLineStep + rects[i].x * gapi->dstPixelStep;
+ unsigned char *srcPointer = ((unsigned char*) SDL_VideoSurface->pixels) + rects[i].y * SDL_VideoSurface->pitch + rects[i].x * bytesPerPixel;
+ height = rects[i].h;
+
+// fprintf(stderr, "Starting rect %dx%d, dst=0x%x, w = %d, h = %d\n", rects[i].w, rects[i].h,destPointer,rects[i].w,rects[i].h);
+// fflush(stderr);
+ linesProcessed = height;
+
+ while (height > 0) {
+ switch(bytesPerPixel)
+ {
+ case 1:
+ linesProcessed = updateLine8to8(this, srcPointer, (unsigned char *) destPointer, rects[i].w, rects[i].h, height);
+ break;
+ case 2:
+#pragma warning(disable: 4133)
+ linesProcessed = updateLine16to16(this, (PIXEL*) srcPointer, destPointer, rects[i].w, rects[i].h, height);
+ break;
+ }
+ height -= linesProcessed;
+ destPointer += gapi->dstLineStep * linesProcessed;
+ srcPointer += SDL_VideoSurface->pitch * linesProcessed; // pitch in bytes
+ }
+// fprintf(stderr, "End of rect\n");
+// fflush(stderr);
+ }
+}
+
+
+static void GAPI_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
+{
+ // we do not want to corrupt video memory
+ if( gapi->suspended ) return;
+
+ if( gapi->needUpdate )
+ gapi->videoMem = gapi->gxFunc.GXBeginDraw();
+
+ if( gapi->gxProperties.cBPP < 8 )
+ GAPI_UpdateRectsMono(this, numrects, rects);
+ else
+ GAPI_UpdateRectsColor(this, numrects, rects);
+
+ if( gapi->needUpdate )
+ gapi->gxFunc.GXEndDraw();
+}
+
+/* Note: If we are terminated, this could be called in the middle of
+ another SDL video routine -- notably UpdateRects.
+*/
+void GAPI_VideoQuit(_THIS)
+{
+ int i, j;
+ /* Destroy the window and everything associated with it */
+ if ( SDL_Window )
+ {
+ if ((g_hGapiLib != 0) && this && gapi && gapi->gxFunc.GXCloseDisplay && !gapi->useVga)
+ gapi->gxFunc.GXCloseDisplay();
+
+ if (this->screen->pixels != NULL)
+ {
+ SDL_free(this->screen->pixels);
+ this->screen->pixels = NULL;
+ }
+ if ( screen_icn ) {
+ DestroyIcon(screen_icn);
+ screen_icn = NULL;
+ }
+
+ DIB_DestroyWindow(this);
+ SDL_UnregisterApp();
+
+ SDL_Window = NULL;
+#if defined(_WIN32_WCE)
+
+// Unload wince aygshell library to prevent leak
+ if( aygshell )
+ {
+ FreeLibrary(aygshell);
+ aygshell = NULL;
+ }
+#endif
+
+ /* Free video mode lists */
+ for ( i=0; i<NUM_MODELISTS; ++i ) {
+ if ( gapi->SDL_modelist[i] != NULL ) {
+ for ( j=0; gapi->SDL_modelist[i][j]; ++j )
+ SDL_free(gapi->SDL_modelist[i][j]);
+ SDL_free(gapi->SDL_modelist[i]);
+ gapi->SDL_modelist[i] = NULL;
+ }
+ }
+
+ }
+
+}
+
+static void GAPI_Activate(_THIS, BOOL active, BOOL minimized)
+{
+ //Nothing to do here (as far as I know)
+}
+
+static void GAPI_RealizePalette(_THIS)
+{
+ OutputDebugString(TEXT("GAPI_RealizePalette NOT IMPLEMENTED !\r\n"));
+}
+
+static void GAPI_PaletteChanged(_THIS, HWND window)
+{
+ OutputDebugString(TEXT("GAPI_PaletteChanged NOT IMPLEMENTED !\r\n"));
+}
+
+static void GAPI_WinPAINT(_THIS, HDC hdc)
+{
+ // draw current offscreen buffer on hdc
+
+ int bpp = 16; // we always use either 8 or 16 bpp internally
+ HGDIOBJ prevObject;
+ unsigned short *bitmapData;
+ HBITMAP hb;
+ HDC srcDC;
+
+ // Create a DIB
+ BYTE buffer[sizeof(BITMAPINFOHEADER) + 3 * sizeof(RGBQUAD)] = {0};
+ BITMAPINFO* pBMI = (BITMAPINFO*)buffer;
+ BITMAPINFOHEADER* pHeader = &pBMI->bmiHeader;
+ DWORD* pColors = (DWORD*)&pBMI->bmiColors;
+
+ // CreateDIBSection does not support 332 pixel format on wce
+ if( gapi->gxProperties.cBPP == 8 ) return;
+
+ // DIB Header
+ pHeader->biSize = sizeof(BITMAPINFOHEADER);
+ pHeader->biWidth = gapi->w;
+ pHeader->biHeight = -gapi->h;
+ pHeader->biPlanes = 1;
+ pHeader->biBitCount = bpp;
+ pHeader->biCompression = BI_RGB;
+ pHeader->biSizeImage = (gapi->w * gapi->h * bpp) / 8;
+
+ // Color masks
+ if( bpp == 16 )
+ {
+ pColors[0] = REDMASK;
+ pColors[1] = GREENMASK;
+ pColors[2] = BLUEMASK;
+ pHeader->biCompression = BI_BITFIELDS;
+ }
+ // Create the DIB
+ hb = CreateDIBSection( 0, pBMI, DIB_RGB_COLORS, (void**)&bitmapData, 0, 0 );
+
+ // copy data
+ // FIXME: prevent misalignment, but I've never seen non aligned width of screen
+ memcpy(bitmapData, gapi->buffer, pHeader->biSizeImage);
+ srcDC = CreateCompatibleDC(hdc);
+ prevObject = SelectObject(srcDC, hb);
+
+ BitBlt(hdc, 0, 0, gapi->w, gapi->h, srcDC, 0, 0, SRCCOPY);
+
+ SelectObject(srcDC, prevObject);
+ DeleteObject(hb);
+ DeleteDC(srcDC);
+}
+
+int GAPI_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ GAPI_CreatePalette(ncolors, colors);
+ return 1;
+}
diff --git a/distrib/sdl-1.2.15/src/video/gapi/SDL_gapivideo.h b/distrib/sdl-1.2.15/src/video/gapi/SDL_gapivideo.h
new file mode 100644
index 0000000..842d098
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/gapi/SDL_gapivideo.h
@@ -0,0 +1,160 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_gapivideo_h
+#define _SDL_gapivideo_h
+
+#include "SDL_mouse.h"
+#include "SDL_mutex.h"
+#include "../SDL_sysvideo.h"
+#include "../windib/SDL_gapidibvideo.h"
+
+/* From gx.h, since it's not really C compliant */
+
+struct GXDisplayProperties {
+ DWORD cxWidth;
+ DWORD cyHeight; // notice lack of 'th' in the word height.
+ long cbxPitch; // number of bytes to move right one x pixel - can be negative.
+ long cbyPitch; // number of bytes to move down one y pixel - can be negative.
+ long cBPP; // # of bits in each pixel
+ DWORD ffFormat; // format flags.
+};
+
+struct GXKeyList {
+ short vkUp; // key for up
+ POINT ptUp; // x,y position of key/button. Not on screen but in screen coordinates.
+ short vkDown;
+ POINT ptDown;
+ short vkLeft;
+ POINT ptLeft;
+ short vkRight;
+ POINT ptRight;
+ short vkA;
+ POINT ptA;
+ short vkB;
+ POINT ptB;
+ short vkC;
+ POINT ptC;
+ short vkStart;
+ POINT ptStart;
+};
+
+typedef int (*PFNGXOpenDisplay)(HWND hWnd, DWORD dwFlags);
+typedef int (*PFNGXCloseDisplay)();
+typedef void* (*PFNGXBeginDraw)();
+typedef int (*PFNGXEndDraw)();
+typedef int (*PFNGXOpenInput)();
+typedef int (*PFNGXCloseInput)();
+typedef struct GXDisplayProperties (*PFNGXGetDisplayProperties)();
+typedef struct GXKeyList (*PFNGXGetDefaultKeys)(int iOptions);
+typedef int (*PFNGXSuspend)();
+typedef int (*PFNGXResume)();
+typedef int (*PFNGXSetViewport)( DWORD dwTop, DWORD dwHeight, DWORD dwReserved1, DWORD dwReserved2 );
+typedef BOOL (*PFNGXIsDisplayDRAMBuffer)();
+
+struct GapiFunc
+{
+ PFNGXOpenDisplay GXOpenDisplay;
+ PFNGXCloseDisplay GXCloseDisplay;
+ PFNGXBeginDraw GXBeginDraw;
+ PFNGXEndDraw GXEndDraw;
+ PFNGXOpenInput GXOpenInput;
+ PFNGXCloseInput GXCloseInput;
+ PFNGXGetDisplayProperties GXGetDisplayProperties;
+ PFNGXGetDefaultKeys GXGetDefaultKeys;
+ PFNGXSuspend GXSuspend;
+ PFNGXResume GXResume;
+ PFNGXSetViewport GXSetViewport;
+ PFNGXIsDisplayDRAMBuffer GXIsDisplayDRAMBuffer;
+};
+
+#define kfLandscape 0x8 // Screen is rotated 270 degrees
+#define kfPalette 0x10 // Pixel values are indexes into a palette
+#define kfDirect 0x20 // Pixel values contain actual level information
+#define kfDirect555 0x40 // 5 bits each for red, green and blue values in a pixel.
+#define kfDirect565 0x80 // 5 red bits, 6 green bits and 5 blue bits per pixel
+#define kfDirect888 0x100 // 8 bits each for red, green and blue values in a pixel.
+#define kfDirect444 0x200 // 4 red, 4 green, 4 blue
+#define kfDirectInverted 0x400
+
+#define GX_FULLSCREEN 0x01 // for OpenDisplay()
+#define GX_NORMALKEYS 0x02
+#define GX_LANDSCAPEKEYS 0x03
+
+
+/* GAPI video mode */
+typedef enum {
+ GAPI_NONE = 0,
+ GAPI_DIRECT_565,
+ GAPI_DIRECT_555,
+ GAPI_MONO,
+ GAPI_PALETTE
+} GAPIVideoMode;
+
+typedef unsigned short PIXEL;
+
+/* Private display data
+ begin with DIB private structure to allow DIB events code sharing
+*/
+struct GapiInfo {
+ /* Rotation which has to be applied to the key (arrow keys) and mouse events measured in quarters of a circle
+ * counter clockwise */
+ int coordinateTransform;
+ char hiresFix; /* using hires mode without defining hires resource */
+ int invert; //TODO this is only written but never read, so it should be removed
+
+#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
+ int SDL_nummodes[NUM_MODELISTS];
+ SDL_Rect **SDL_modelist[NUM_MODELISTS];
+
+
+ // The orientation of the video mode user wants to get
+ // Probably restricted to UP and RIGHT
+ SDL_ScreenOrientation userOrientation;
+ SDL_ScreenOrientation systemOrientation;
+// --------------
+ int useGXOpenDisplay; /* use GXOpenDispplay */
+ int alreadyGXOpened;
+ int w, h;
+ // The orientation of GAPI framebuffer.
+ // Never changes on the same device.
+ SDL_ScreenOrientation gapiOrientation;
+
+ void *buffer; // may be 8, 16, 24, 32 bpp
+ PIXEL *videoMem;
+ BOOL needUpdate;
+ struct GXKeyList keyList;
+ struct GapiFunc gxFunc;
+ struct GXDisplayProperties gxProperties;
+ GAPIVideoMode videoMode;
+ int colorscale;
+ int dstLineStep; // in bytes
+ int dstPixelStep; // in bytes
+ int startOffset; // in bytes
+ int useVga;
+ int suspended; // do not pu anything into video memory
+};
+
+
+
+#endif /* _SDL_gapivideo_h */
diff --git a/distrib/sdl-1.2.15/src/video/gem/SDL_gemevents.c b/distrib/sdl-1.2.15/src/video/gem/SDL_gemevents.c
new file mode 100644
index 0000000..c5a505d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/gem/SDL_gemevents.c
@@ -0,0 +1,375 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * GEM SDL video driver implementation
+ * inspired from the Dummy SDL driver
+ *
+ * Patrice Mandin
+ * and work from
+ * Olivier Landemarre, Johan Klockars, Xavier Joubert, Claude Attard
+ */
+
+#include <gem.h>
+
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_gemvideo.h"
+#include "SDL_gemevents_c.h"
+#include "SDL_gemmouse_c.h"
+#include "../ataricommon/SDL_atarikeys.h" /* for keyboard scancodes */
+#include "../ataricommon/SDL_atarievents_c.h"
+#include "../ataricommon/SDL_xbiosevents_c.h"
+#include "../ataricommon/SDL_ataridevmouse_c.h"
+
+/* Variables */
+
+static unsigned char gem_currentkeyboard[ATARIBIOS_MAXKEYS];
+static unsigned char gem_previouskeyboard[ATARIBIOS_MAXKEYS];
+
+/* Functions prototypes */
+
+static int do_messages(_THIS, short *message);
+static void do_keyboard(short kc, short ks);
+static void do_mouse(_THIS, short mx, short my, short mb, short ks);
+
+/* Functions */
+
+void GEM_InitOSKeymap(_THIS)
+{
+ SDL_memset(gem_currentkeyboard, 0, sizeof(gem_currentkeyboard));
+ SDL_memset(gem_previouskeyboard, 0, sizeof(gem_previouskeyboard));
+
+ /* Mouse init */
+ GEM_mouse_relative = SDL_FALSE;
+
+ SDL_Atari_InitInternalKeymap(this);
+}
+
+void GEM_PumpEvents(_THIS)
+{
+ short prevkc, prevks;
+ static short maskmouseb=0;
+ int i;
+ SDL_keysym keysym;
+
+ SDL_memset(gem_currentkeyboard,0,sizeof(gem_currentkeyboard));
+ prevkc = prevks = 0;
+
+ for (;;)
+ {
+ int quit, resultat, event_mask, mouse_event;
+ short buffer[8], kc;
+ short x2,y2,w2,h2;
+ short mousex, mousey, mouseb, dummy;
+ short kstate;
+
+ quit =
+ mouse_event =
+ x2=y2=w2=h2 = 0;
+
+ event_mask = MU_MESAG|MU_TIMER|MU_KEYBD|MU_BUTTON;
+ if (!GEM_fullscreen && (GEM_handle>=0)) {
+ wind_get (GEM_handle, WF_WORKXYWH, &x2, &y2, &w2, &h2);
+ event_mask |= MU_M1;
+ mouse_event = ( (SDL_GetAppState() & SDL_APPMOUSEFOCUS)
+ == SDL_APPMOUSEFOCUS) ? MO_LEAVE : MO_ENTER;
+ }
+
+ resultat = evnt_multi(
+ event_mask,
+ 0x101,7,maskmouseb,
+ mouse_event,x2,y2,w2,h2,
+ 0,0,0,0,0,
+ buffer,
+ 10,
+ &mousex,&mousey,&mouseb,&kstate,&kc,&dummy
+ );
+
+ /* Message event ? */
+ if (resultat & MU_MESAG)
+ quit = do_messages(this, buffer);
+
+ /* Keyboard event ? */
+ if (resultat & MU_KEYBD) {
+ if ((prevkc != kc) || (prevks != kstate)) {
+ do_keyboard(kc,kstate);
+ } else {
+ /* Avoid looping, if repeating same key */
+ break;
+ }
+ }
+
+ /* Mouse entering/leaving window */
+ if (resultat & MU_M1) {
+ if (this->input_grab == SDL_GRAB_OFF) {
+ /* Switch mouse focus state */
+ SDL_PrivateAppActive((mouse_event == MO_ENTER),
+ SDL_APPMOUSEFOCUS);
+ }
+ GEM_CheckMouseMode(this);
+ }
+
+ /* Mouse button event ? */
+ if (resultat & MU_BUTTON) {
+ do_mouse(this, mousex, mousey, mouseb, kstate);
+ maskmouseb = mouseb & 7;
+ }
+
+ /* Timer event ? */
+ if ((resultat & MU_TIMER) || quit)
+ break;
+ }
+
+ /* Now generate keyboard events */
+ for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
+ /* Key pressed ? */
+ if (gem_currentkeyboard[i] && !gem_previouskeyboard[i])
+ SDL_PrivateKeyboard(SDL_PRESSED,
+ SDL_Atari_TranslateKey(i, &keysym, SDL_TRUE));
+
+ /* Key unpressed ? */
+ if (gem_previouskeyboard[i] && !gem_currentkeyboard[i])
+ SDL_PrivateKeyboard(SDL_RELEASED,
+ SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE));
+ }
+
+ SDL_memcpy(gem_previouskeyboard,gem_currentkeyboard,sizeof(gem_previouskeyboard));
+
+ /* Refresh window name ? */
+ if (GEM_refresh_name) {
+ const char *window_name =
+ (SDL_GetAppState() & SDL_APPACTIVE)
+ ? GEM_title_name : GEM_icon_name;
+ if (window_name) {
+ wind_set(GEM_handle,WF_NAME,
+ (short)(((unsigned long)window_name)>>16),
+ (short)(((unsigned long)window_name) & 0xffff),
+ 0,0);
+ }
+ GEM_refresh_name = SDL_FALSE;
+ }
+}
+
+static int do_messages(_THIS, short *message)
+{
+ int quit, check_mouse_mode;
+ short x2,y2,w2,h2;
+
+ quit = check_mouse_mode = 0;
+ switch (message[0]) {
+ case WM_CLOSED:
+ case AP_TERM:
+ SDL_PrivateQuit();
+ quit=1;
+ break;
+ case WM_MOVED:
+ wind_set(message[3],WF_CURRXYWH,message[4],message[5],message[6],message[7]);
+ break;
+ case WM_TOPPED:
+ wind_set(message[3],WF_TOP,message[4],0,0,0);
+ /* Continue with TOP event processing */
+ case WM_ONTOP:
+ SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
+ if (VDI_setpalette) {
+ VDI_setpalette(this, VDI_curpalette);
+ }
+ check_mouse_mode = 1;
+ break;
+ case WM_REDRAW:
+ if (!GEM_lock_redraw) {
+ GEM_wind_redraw(this, message[3],&message[4]);
+ }
+ break;
+ case WM_ICONIFY:
+ case WM_ALLICONIFY:
+ wind_set(message[3],WF_ICONIFY,message[4],message[5],message[6],message[7]);
+ /* If we're active, make ourselves inactive */
+ if ( SDL_GetAppState() & SDL_APPACTIVE ) {
+ /* Send an internal deactivate event */
+ SDL_PrivateAppActive(0, SDL_APPACTIVE);
+ }
+ /* Update window title */
+ if (GEM_refresh_name && GEM_icon_name) {
+ wind_set(GEM_handle,WF_NAME,(short)(((unsigned long)GEM_icon_name)>>16),(short)(((unsigned long)GEM_icon_name) & 0xffff),0,0);
+ GEM_refresh_name = SDL_FALSE;
+ }
+ check_mouse_mode = 1;
+ break;
+ case WM_UNICONIFY:
+ wind_set(message[3],WF_UNICONIFY,message[4],message[5],message[6],message[7]);
+ /* If we're not active, make ourselves active */
+ if ( !(SDL_GetAppState() & SDL_APPACTIVE) ) {
+ /* Send an internal activate event */
+ SDL_PrivateAppActive(1, SDL_APPACTIVE);
+ }
+ if (GEM_refresh_name && GEM_title_name) {
+ wind_set(GEM_handle,WF_NAME,(short)(((unsigned long)GEM_title_name)>>16),(short)(((unsigned long)GEM_title_name) & 0xffff),0,0);
+ GEM_refresh_name = SDL_FALSE;
+ }
+ check_mouse_mode = 1;
+ break;
+ case WM_SIZED:
+ wind_set (message[3], WF_CURRXYWH, message[4], message[5], message[6], message[7]);
+ wind_get (message[3], WF_WORKXYWH, &x2, &y2, &w2, &h2);
+ GEM_win_fulled = SDL_FALSE; /* Cancel maximized flag */
+ GEM_lock_redraw = SDL_TRUE; /* Prevent redraw till buffers resized */
+ SDL_PrivateResize(w2, h2);
+ break;
+ case WM_FULLED:
+ {
+ short x,y,w,h;
+
+ if (GEM_win_fulled) {
+ wind_get (message[3], WF_PREVXYWH, &x, &y, &w, &h);
+ GEM_win_fulled = SDL_FALSE;
+ } else {
+ x = GEM_desk_x;
+ y = GEM_desk_y;
+ w = GEM_desk_w;
+ h = GEM_desk_h;
+ GEM_win_fulled = SDL_TRUE;
+ }
+ wind_set (message[3], WF_CURRXYWH, x, y, w, h);
+ wind_get (message[3], WF_WORKXYWH, &x2, &y2, &w2, &h2);
+ GEM_lock_redraw = SDL_TRUE; /* Prevent redraw till buffers resized */
+ SDL_PrivateResize(w2, h2);
+ }
+ break;
+ case WM_BOTTOMED:
+ wind_set(message[3],WF_BOTTOM,0,0,0,0);
+ /* Continue with BOTTOM event processing */
+ case WM_UNTOPPED:
+ SDL_PrivateAppActive(0, SDL_APPINPUTFOCUS);
+ if (VDI_setpalette) {
+ VDI_setpalette(this, VDI_oldpalette);
+ }
+ check_mouse_mode = 1;
+ break;
+ }
+
+ if (check_mouse_mode) {
+ GEM_CheckMouseMode(this);
+ }
+
+ return quit;
+}
+
+static void do_keyboard(short kc, short ks)
+{
+ int scancode;
+
+ if (kc) {
+ scancode=(kc>>8) & (ATARIBIOS_MAXKEYS-1);
+ gem_currentkeyboard[scancode]=0xFF;
+ }
+
+ /* Read special keys */
+ if (ks & K_RSHIFT)
+ gem_currentkeyboard[SCANCODE_RIGHTSHIFT]=0xFF;
+ if (ks & K_LSHIFT)
+ gem_currentkeyboard[SCANCODE_LEFTSHIFT]=0xFF;
+ if (ks & K_CTRL)
+ gem_currentkeyboard[SCANCODE_LEFTCONTROL]=0xFF;
+ if (ks & K_ALT)
+ gem_currentkeyboard[SCANCODE_LEFTALT]=0xFF;
+}
+
+static void do_mouse(_THIS, short mx, short my, short mb, short ks)
+{
+ static short prevmousex=0, prevmousey=0, prevmouseb=0;
+ short x2, y2, w2, h2;
+
+ /* Don't return mouse events if out of window */
+ if ((SDL_GetAppState() & SDL_APPMOUSEFOCUS)==0) {
+ return;
+ }
+
+ /* Retrieve window coords, and generate mouse events accordingly */
+ x2 = y2 = 0;
+ w2 = VDI_w;
+ h2 = VDI_h;
+ if ((!GEM_fullscreen) && (GEM_handle>=0)) {
+ wind_get (GEM_handle, WF_WORKXYWH, &x2, &y2, &w2, &h2);
+
+ /* Do not generate mouse button event if out of window working area */
+ if ((mx<x2) || (mx>=x2+w2) || (my<y2) || (my>=y2+h2)) {
+ mb=prevmouseb;
+ }
+ }
+
+ /* Mouse motion ? */
+ if (GEM_mouse_relative) {
+ if (GEM_usedevmouse) {
+ SDL_AtariDevMouse_PostMouseEvents(this, SDL_FALSE);
+ } else {
+ SDL_AtariXbios_PostMouseEvents(this, SDL_FALSE);
+ }
+ } else {
+ if ((prevmousex!=mx) || (prevmousey!=my)) {
+ int posx, posy;
+
+ /* Give mouse position relative to window position */
+ posx = mx - x2;
+ if (posx<0) posx = 0;
+ if (posx>w2) posx = w2-1;
+ posy = my - y2;
+ if (posy<0) posy = 0;
+ if (posy>h2) posy = h2-1;
+
+ SDL_PrivateMouseMotion(0, 0, posx, posy);
+ }
+ prevmousex = mx;
+ prevmousey = my;
+ }
+
+ /* Mouse button ? */
+ if (prevmouseb!=mb) {
+ int i;
+
+ for (i=0;i<3;i++) {
+ int curbutton, prevbutton;
+
+ curbutton = mb & (1<<i);
+ prevbutton = prevmouseb & (1<<i);
+
+ if (curbutton && !prevbutton) {
+ SDL_PrivateMouseButton(SDL_PRESSED, i+1, 0, 0);
+ }
+ if (!curbutton && prevbutton) {
+ SDL_PrivateMouseButton(SDL_RELEASED, i+1, 0, 0);
+ }
+ }
+ prevmouseb = mb;
+ }
+
+ /* Read special keys */
+ if (ks & K_RSHIFT)
+ gem_currentkeyboard[SCANCODE_RIGHTSHIFT]=0xFF;
+ if (ks & K_LSHIFT)
+ gem_currentkeyboard[SCANCODE_LEFTSHIFT]=0xFF;
+ if (ks & K_CTRL)
+ gem_currentkeyboard[SCANCODE_LEFTCONTROL]=0xFF;
+ if (ks & K_ALT)
+ gem_currentkeyboard[SCANCODE_LEFTALT]=0xFF;
+}
diff --git a/distrib/sdl-1.2.15/src/video/gem/SDL_gemevents_c.h b/distrib/sdl-1.2.15/src/video/gem/SDL_gemevents_c.h
new file mode 100644
index 0000000..7d5d9b3
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/gem/SDL_gemevents_c.h
@@ -0,0 +1,33 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_gemvideo.h"
+
+/* Variables and functions exported by SDL_sysevents.c to other parts
+ of the native video subsystem (SDL_sysvideo.c) */
+
+extern void GEM_InitOSKeymap(_THIS);
+extern void GEM_PumpEvents(_THIS);
+
+/* end of SDL_gemevents_c.h */
+
diff --git a/distrib/sdl-1.2.15/src/video/gem/SDL_gemmouse.c b/distrib/sdl-1.2.15/src/video/gem/SDL_gemmouse.c
new file mode 100644
index 0000000..c876cff
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/gem/SDL_gemmouse.c
@@ -0,0 +1,205 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * GEM Mouse manager
+ *
+ * Patrice Mandin
+ */
+
+#include <gem.h>
+
+#include "SDL_mouse.h"
+#include "../../events/SDL_events_c.h"
+#include "../SDL_cursor_c.h"
+#include "SDL_gemmouse_c.h"
+#include "SDL_gemvideo.h"
+#include "../ataricommon/SDL_xbiosevents_c.h"
+
+/* Defines */
+
+/*#define DEBUG_VIDEO_GEM 1*/
+
+#define MAXCURWIDTH 16
+#define MAXCURHEIGHT 16
+
+void GEM_FreeWMCursor(_THIS, WMcursor *cursor)
+{
+#ifdef DEBUG_VIDEO_GEM
+ printf("sdl:video:gem: free cursor\n");
+#endif
+
+ if (cursor == NULL)
+ return;
+
+ graf_mouse(ARROW, NULL);
+
+ if (cursor->mform_p != NULL)
+ SDL_free(cursor->mform_p);
+
+ SDL_free(cursor);
+}
+
+WMcursor *GEM_CreateWMCursor(_THIS,
+ Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
+{
+ WMcursor *cursor;
+ MFORM *new_mform;
+ int i;
+
+#ifdef DEBUG_VIDEO_GEM
+ Uint16 *data1, *mask1;
+
+ printf("sdl:video:gem: create cursor\n");
+#endif
+
+ /* Check the size */
+ if ( (w > MAXCURWIDTH) || (h > MAXCURHEIGHT) ) {
+ SDL_SetError("Only cursors of dimension (%dx%d) are allowed",
+ MAXCURWIDTH, MAXCURHEIGHT);
+ return(NULL);
+ }
+
+ /* Allocate the cursor memory */
+ cursor = (WMcursor *)SDL_malloc(sizeof(WMcursor));
+ if ( cursor == NULL ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+
+ /* Allocate mform */
+ new_mform = (MFORM *)SDL_malloc(sizeof(MFORM));
+ if (new_mform == NULL) {
+ SDL_free(cursor);
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+
+ cursor->mform_p = new_mform;
+
+ new_mform->mf_xhot = hot_x;
+ new_mform->mf_yhot = hot_y;
+ new_mform->mf_nplanes = 1;
+ new_mform->mf_fg = 0;
+ new_mform->mf_bg = 1;
+
+ for (i=0;i<MAXCURHEIGHT;i++) {
+ new_mform->mf_mask[i]=0;
+ new_mform->mf_data[i]=0;
+#ifdef DEBUG_VIDEO_GEM
+ data1 = (Uint16 *) &data[i<<1];
+ mask1 = (Uint16 *) &mask[i<<1];
+ printf("sdl:video:gem: source: line %d: data=0x%04x, mask=0x%04x\n",
+ i, data1[i], mask1[i]);
+#endif
+ }
+
+ if (w<=8) {
+ for (i=0;i<h;i++) {
+ new_mform->mf_mask[i]= mask[i]<<8;
+ new_mform->mf_data[i]= data[i]<<8;
+ }
+ } else {
+ for (i=0;i<h;i++) {
+ new_mform->mf_mask[i]= (mask[i<<1]<<8) | mask[(i<<1)+1];
+ new_mform->mf_data[i]= (data[i<<1]<<8) | data[(i<<1)+1];
+ }
+ }
+
+#ifdef DEBUG_VIDEO_GEM
+ for (i=0; i<h ;i++) {
+ printf("sdl:video:gem: cursor: line %d: data=0x%04x, mask=0x%04x\n",
+ i, new_mform->mf_data[i], new_mform->mf_mask[i]);
+ }
+
+ printf("sdl:video:gem: CreateWMCursor(): done\n");
+#endif
+
+ return cursor;
+}
+
+int GEM_ShowWMCursor(_THIS, WMcursor *cursor)
+{
+ GEM_cursor = cursor;
+
+ GEM_CheckMouseMode(this);
+
+#ifdef DEBUG_VIDEO_GEM
+ printf("sdl:video:gem: ShowWMCursor(0x%08x)\n", (long) cursor);
+#endif
+
+ return 1;
+}
+
+#if 0
+void GEM_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
+{
+ /* This seems to work only on AES 3.4 (Falcon) */
+
+ EVNTREC warpevent;
+
+ warpevent.ap_event = APPEVNT_MOUSE;
+ warpevent.ap_value = (x << 16) | y;
+
+ appl_tplay(&warpevent, 1, 1000);
+}
+#endif
+
+void GEM_CheckMouseMode(_THIS)
+{
+ const Uint8 full_focus = (SDL_APPACTIVE|SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS);
+ int set_system_cursor = 1, show_system_cursor = 1;
+
+#ifdef DEBUG_VIDEO_GEM
+ printf("sdl:video:gem: check mouse mode\n");
+#endif
+
+ /* If the mouse is hidden and input is grabbed, we use relative mode */
+ GEM_mouse_relative = (!(SDL_cursorstate & CURSOR_VISIBLE))
+ && (this->input_grab != SDL_GRAB_OFF)
+ && (SDL_GetAppState() & SDL_APPACTIVE);
+ SDL_AtariXbios_LockMousePosition(GEM_mouse_relative);
+
+ if (SDL_cursorstate & CURSOR_VISIBLE) {
+ /* Application defined cursor only over the application window */
+ if ((SDL_GetAppState() & full_focus) == full_focus) {
+ if (GEM_cursor) {
+ graf_mouse(USER_DEF, GEM_cursor->mform_p);
+ set_system_cursor = 0;
+ } else {
+ show_system_cursor = 0;
+ }
+ }
+ } else {
+ /* Mouse cursor hidden only over the application window */
+ if ((SDL_GetAppState() & full_focus) == full_focus) {
+ set_system_cursor = 0;
+ show_system_cursor = 0;
+ }
+ }
+
+ graf_mouse(show_system_cursor ? M_ON : M_OFF, NULL);
+ if (set_system_cursor) {
+ graf_mouse(ARROW, NULL);
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/gem/SDL_gemmouse_c.h b/distrib/sdl-1.2.15/src/video/gem/SDL_gemmouse_c.h
new file mode 100644
index 0000000..06f90ba
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/gem/SDL_gemmouse_c.h
@@ -0,0 +1,34 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_gemvideo.h"
+
+/* Functions to be exported */
+extern void GEM_FreeWMCursor(_THIS, WMcursor *cursor);
+extern WMcursor *GEM_CreateWMCursor(_THIS,
+ Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
+extern int GEM_ShowWMCursor(_THIS, WMcursor *cursor);
+#if 0
+extern void GEM_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
+#endif
+extern void GEM_CheckMouseMode(_THIS);
diff --git a/distrib/sdl-1.2.15/src/video/gem/SDL_gemvideo.c b/distrib/sdl-1.2.15/src/video/gem/SDL_gemvideo.c
new file mode 100644
index 0000000..2ce9151
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/gem/SDL_gemvideo.c
@@ -0,0 +1,1337 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ GEM video driver
+
+ Patrice Mandin
+ and work from
+ Olivier Landemarre, Johan Klockars, Xavier Joubert, Claude Attard
+*/
+
+/* Mint includes */
+#include <gem.h>
+#include <gemx.h>
+#include <mint/osbind.h>
+#include <mint/cookie.h>
+
+#include "SDL_endian.h"
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+#include "../SDL_cursor_c.h"
+
+#include "../ataricommon/SDL_ataric2p_s.h"
+#include "../ataricommon/SDL_atarieddi_s.h"
+#include "../ataricommon/SDL_atarimxalloc_c.h"
+#include "../ataricommon/SDL_atarigl_c.h"
+
+#include "SDL_gemvideo.h"
+#include "SDL_gemevents_c.h"
+#include "SDL_gemmouse_c.h"
+#include "SDL_gemwm_c.h"
+#include "../ataricommon/SDL_xbiosevents_c.h"
+#include "../ataricommon/SDL_ataridevmouse_c.h"
+
+/* Defines */
+
+/*#define DEBUG_VIDEO_GEM 1*/
+
+#define GEM_VID_DRIVER_NAME "gem"
+
+#undef MIN
+#define MIN(a,b) (((a)<(b)) ? (a) : (b))
+#undef MAX
+#define MAX(a,b) (((a)>(b)) ? (a) : (b))
+
+/* Variables */
+
+static unsigned char vdi_index[256] = {
+ 0, 2, 3, 6, 4, 7, 5, 8,
+ 9, 10, 11, 14, 12, 15, 13, 255
+};
+
+static const char empty_name[]="";
+
+/* Initialization/Query functions */
+static int GEM_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **GEM_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *GEM_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int GEM_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
+static void GEM_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int GEM_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int GEM_LockHWSurface(_THIS, SDL_Surface *surface);
+static int GEM_FlipHWSurface(_THIS, SDL_Surface *surface);
+static void GEM_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void GEM_FreeHWSurface(_THIS, SDL_Surface *surface);
+static void GEM_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
+#if 0
+static int GEM_ToggleFullScreen(_THIS, int on);
+#endif
+
+/* Internal functions */
+static void GEM_FreeBuffers(_THIS);
+static void GEM_ClearScreen(_THIS);
+static void GEM_ClearRect(_THIS, short *rect);
+static void GEM_SetNewPalette(_THIS, Uint16 newpal[256][3]);
+static void GEM_LockScreen(_THIS);
+static void GEM_UnlockScreen(_THIS);
+static void refresh_window(_THIS, int winhandle, short *rect);
+
+#if SDL_VIDEO_OPENGL
+/* OpenGL functions */
+static void GEM_GL_SwapBuffers(_THIS);
+#endif
+
+/* GEM driver bootstrap functions */
+
+static int GEM_Available(void)
+{
+ /* Test if AES available */
+ if (appl_init() == -1)
+ return 0;
+
+ appl_exit();
+ return 1;
+}
+
+static void GEM_DeleteDevice(SDL_VideoDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_VideoDevice *GEM_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device;
+ int vectors_mask;
+/* unsigned long dummy;*/
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *device->hidden));
+ device->gl_data = (struct SDL_PrivateGLData *)
+ SDL_malloc((sizeof *device->gl_data));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( device ) {
+ SDL_free(device);
+ }
+ return(0);
+ }
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+ SDL_memset(device->gl_data, 0, sizeof(*device->gl_data));
+
+ /* Set the function pointers */
+ device->VideoInit = GEM_VideoInit;
+ device->ListModes = GEM_ListModes;
+ device->SetVideoMode = GEM_SetVideoMode;
+ device->SetColors = GEM_SetColors;
+ device->UpdateRects = NULL /*GEM_UpdateRects*/;
+ device->VideoQuit = GEM_VideoQuit;
+ device->AllocHWSurface = GEM_AllocHWSurface;
+ device->LockHWSurface = GEM_LockHWSurface;
+ device->UnlockHWSurface = GEM_UnlockHWSurface;
+ device->FlipHWSurface = GEM_FlipHWSurface;
+ device->FreeHWSurface = GEM_FreeHWSurface;
+ device->ToggleFullScreen = NULL /*GEM_ToggleFullScreen*/;
+
+ /* Window manager */
+ device->SetCaption = GEM_SetCaption;
+ device->SetIcon = GEM_SetIcon;
+ device->IconifyWindow = GEM_IconifyWindow;
+ device->GrabInput = GEM_GrabInput;
+
+ /* Events */
+ device->InitOSKeymap = GEM_InitOSKeymap;
+ device->PumpEvents = GEM_PumpEvents;
+
+ /* Mouse */
+ device->FreeWMCursor = GEM_FreeWMCursor;
+ device->CreateWMCursor = GEM_CreateWMCursor;
+ device->ShowWMCursor = GEM_ShowWMCursor;
+ device->WarpWMCursor = NULL /*GEM_WarpWMCursor*/;
+ device->CheckMouseMode = GEM_CheckMouseMode;
+
+#if SDL_VIDEO_OPENGL
+ /* OpenGL functions */
+ device->GL_LoadLibrary = SDL_AtariGL_LoadLibrary;
+ device->GL_GetProcAddress = SDL_AtariGL_GetProcAddress;
+ device->GL_GetAttribute = SDL_AtariGL_GetAttribute;
+ device->GL_MakeCurrent = SDL_AtariGL_MakeCurrent;
+ device->GL_SwapBuffers = GEM_GL_SwapBuffers;
+#endif
+
+ device->hidden->use_dev_mouse =
+ (SDL_AtariDevMouse_Open()!=0) ? SDL_TRUE : SDL_FALSE;
+
+ vectors_mask = ATARI_XBIOS_JOYSTICKEVENTS; /* XBIOS joystick events */
+ if (!(device->hidden->use_dev_mouse)) {
+ vectors_mask |= ATARI_XBIOS_MOUSEEVENTS; /* XBIOS mouse events */
+ }
+/* if (Getcookie(C_MiNT, &dummy)==C_FOUND) {
+ vectors_mask = 0;
+ }*/
+
+ SDL_AtariXbios_InstallVectors(vectors_mask);
+
+ device->free = GEM_DeleteDevice;
+
+ return device;
+}
+
+VideoBootStrap GEM_bootstrap = {
+ GEM_VID_DRIVER_NAME, "Atari GEM video driver",
+ GEM_Available, GEM_CreateDevice
+};
+
+static void VDI_ReadExtInfo(_THIS, short *work_out)
+{
+ unsigned long EdDI_version;
+ long cookie_EdDI;
+ Uint16 clut_type;
+
+ /* Read EdDI informations */
+ if (Getcookie(C_EdDI, &cookie_EdDI) == C_NOTFOUND) {
+ return;
+ }
+
+ EdDI_version = Atari_get_EdDI_version( (void *)cookie_EdDI);
+
+ vq_scrninfo(VDI_handle, work_out);
+
+ VDI_format = work_out[0];
+ clut_type = work_out[1];
+
+ /* With EdDI>=1.1, we can have screen pitch, address and format
+ * so we can directly write to screen without using vro_cpyfm
+ */
+ if (EdDI_version >= EDDI_11) {
+ VDI_pitch = work_out[5];
+ VDI_screen = (void *) *((unsigned long *) &work_out[6]);
+ }
+
+ switch(clut_type) {
+ case VDI_CLUT_HARDWARE:
+ {
+ int i;
+ Uint16 *tmp_p;
+
+ tmp_p = (Uint16 *)&work_out[16];
+
+ for (i=0;i<256;i++) {
+ vdi_index[*tmp_p++] = i;
+ }
+ }
+ break;
+ case VDI_CLUT_SOFTWARE:
+ {
+ int component; /* red, green, blue, alpha, overlay */
+ int num_bit;
+ unsigned short *tmp_p;
+
+ /* We can build masks with info here */
+ tmp_p = (unsigned short *) &work_out[16];
+ for (component=0;component<5;component++) {
+ for (num_bit=0;num_bit<16;num_bit++) {
+ unsigned short valeur;
+
+ valeur = *tmp_p++;
+
+ if (valeur == 0xffff) {
+ continue;
+ }
+
+ switch(component) {
+ case 0:
+ VDI_redmask |= 1<< valeur;
+ break;
+ case 1:
+ VDI_greenmask |= 1<< valeur;
+ break;
+ case 2:
+ VDI_bluemask |= 1<< valeur;
+ break;
+ case 3:
+ VDI_alphamask |= 1<< valeur;
+ break;
+ }
+ }
+ }
+ }
+
+ /* Remove lower green bits for Intel endian screen */
+ if ((VDI_greenmask == ((7<<13)|3)) || (VDI_greenmask == ((7<<13)|7))) {
+ VDI_greenmask &= ~(7<<13);
+ }
+ break;
+ case VDI_CLUT_NONE:
+ break;
+ }
+}
+
+int GEM_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ int i, menubar_size;
+ short work_in[12], work_out[272], dummy;
+
+ /* Open AES (Application Environment Services) */
+ if (appl_init() == -1) {
+ fprintf(stderr,"Can not open AES\n");
+ return 1;
+ }
+
+ /* Read version and features */
+ GEM_version = aes_global[0];
+ if (GEM_version >= 0x0410) {
+ short ap_gout[4], errorcode;
+
+ GEM_wfeatures=0;
+ errorcode=appl_getinfo(AES_WINDOW, &ap_gout[0], &ap_gout[1], &ap_gout[2], &ap_gout[3]);
+
+ if (errorcode==0) {
+ GEM_wfeatures=ap_gout[0];
+ }
+ }
+
+ /* Ask VDI physical workstation handle opened by AES */
+ VDI_handle = graf_handle(&dummy, &dummy, &dummy, &dummy);
+ if (VDI_handle<1) {
+ fprintf(stderr,"Wrong VDI handle %d returned by AES\n",VDI_handle);
+ return 1;
+ }
+
+ /* Open virtual VDI workstation */
+ work_in[0]=Getrez()+2;
+ for(i = 1; i < 10; i++)
+ work_in[i] = 1;
+ work_in[10] = 2;
+
+ v_opnvwk(work_in, &VDI_handle, work_out);
+ if (VDI_handle == 0) {
+ fprintf(stderr,"Can not open VDI virtual workstation\n");
+ return 1;
+ }
+
+ /* Read fullscreen size */
+ VDI_w = work_out[0] + 1;
+ VDI_h = work_out[1] + 1;
+
+ /* Read desktop size and position */
+ if (!wind_get(DESKTOP_HANDLE, WF_WORKXYWH, &GEM_desk_x, &GEM_desk_y, &GEM_desk_w, &GEM_desk_h)) {
+ fprintf(stderr,"Can not read desktop properties\n");
+ return 1;
+ }
+
+ /* Read bit depth */
+ vq_extnd(VDI_handle, 1, work_out);
+ VDI_bpp = work_out[4];
+ VDI_oldnumcolors=0;
+
+ switch(VDI_bpp) {
+ case 8:
+ VDI_pixelsize=1;
+ break;
+ case 15:
+ case 16:
+ VDI_pixelsize=2;
+ break;
+ case 24:
+ VDI_pixelsize=3;
+ break;
+ case 32:
+ VDI_pixelsize=4;
+ break;
+ default:
+ fprintf(stderr,"%d bits colour depth not supported\n",VDI_bpp);
+ return 1;
+ }
+
+ /* Setup hardware -> VDI palette mapping */
+ for(i = 16; i < 255; i++) {
+ vdi_index[i] = i;
+ }
+ vdi_index[255] = 1;
+
+ /* Save current palette */
+ if (VDI_bpp>8) {
+ VDI_oldnumcolors=1<<8;
+ } else {
+ VDI_oldnumcolors=1<<VDI_bpp;
+ }
+
+ for(i = 0; i < VDI_oldnumcolors; i++) {
+ short rgb[3];
+
+ vq_color(VDI_handle, i, 0, rgb);
+
+ VDI_oldpalette[i][0] = rgb[0];
+ VDI_oldpalette[i][1] = rgb[1];
+ VDI_oldpalette[i][2] = rgb[2];
+ }
+ VDI_setpalette = GEM_SetNewPalette;
+ SDL_memcpy(VDI_curpalette,VDI_oldpalette,sizeof(VDI_curpalette));
+
+ /* Setup screen info */
+ GEM_title_name = empty_name;
+ GEM_icon_name = empty_name;
+
+ GEM_handle = -1;
+ GEM_locked = SDL_FALSE;
+ GEM_win_fulled = SDL_FALSE;
+ GEM_fullscreen = SDL_FALSE;
+ GEM_lock_redraw = SDL_TRUE; /* Prevent redraw till buffers are setup */
+
+ VDI_screen = NULL;
+ VDI_pitch = VDI_w * VDI_pixelsize;
+ VDI_format = ( (VDI_bpp <= 8) ? VDI_FORMAT_INTER : VDI_FORMAT_PACK);
+ VDI_redmask = VDI_greenmask = VDI_bluemask = VDI_alphamask = 0;
+ VDI_ReadExtInfo(this, work_out);
+
+#ifdef DEBUG_VIDEO_GEM
+ printf("sdl:video:gem: screen: address=0x%08x, pitch=%d\n", VDI_screen, VDI_pitch);
+ printf("sdl:video:gem: format=%d\n", VDI_format);
+ printf("sdl:video:gem: masks: 0x%08x, 0x%08x, 0x%08x, 0x%08x\n",
+ VDI_alphamask, VDI_redmask, VDI_greenmask, VDI_bluemask
+ );
+#endif
+
+ /* Setup destination mfdb */
+ VDI_dst_mfdb.fd_addr = NULL;
+
+ /* Determine the current screen size */
+ this->info.current_w = VDI_w;
+ this->info.current_h = VDI_h;
+
+ /* Determine the screen depth */
+ /* we change this during the SDL_SetVideoMode implementation... */
+ vformat->BitsPerPixel = VDI_bpp;
+
+ /* Set mouse cursor to arrow */
+ graf_mouse(ARROW, NULL);
+ GEM_cursor = NULL;
+
+ /* Init chunky to planar routine */
+ SDL_Atari_C2pConvert = SDL_Atari_C2pConvert8;
+
+ /* Setup VDI fill functions */
+ vsf_color(VDI_handle,0);
+ vsf_interior(VDI_handle,1);
+ vsf_perimeter(VDI_handle,0);
+
+ /* Menu bar save buffer */
+ menubar_size = GEM_desk_w * GEM_desk_y * VDI_pixelsize;
+ GEM_menubar=Atari_SysMalloc(menubar_size,MX_PREFTTRAM);
+
+ /* Fill video modes list */
+ SDL_modelist[0] = SDL_malloc(sizeof(SDL_Rect));
+ SDL_modelist[0]->x = 0;
+ SDL_modelist[0]->y = 0;
+ SDL_modelist[0]->w = VDI_w;
+ SDL_modelist[0]->h = VDI_h;
+
+ SDL_modelist[1] = NULL;
+
+#if SDL_VIDEO_OPENGL
+ SDL_AtariGL_InitPointers(this);
+#endif
+
+ this->info.wm_available = 1;
+
+ /* We're done! */
+ return(0);
+}
+
+SDL_Rect **GEM_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ if (format->BitsPerPixel != VDI_bpp) {
+ return ((SDL_Rect **)NULL);
+ }
+
+ if (flags & SDL_FULLSCREEN) {
+ return (SDL_modelist);
+ }
+
+ return((SDL_Rect **)-1);
+}
+
+static void GEM_FreeBuffers(_THIS)
+{
+ /* Release buffer */
+ if ( GEM_buffer2 ) {
+ Mfree( GEM_buffer2 );
+ GEM_buffer2=NULL;
+ }
+
+ if ( GEM_buffer1 ) {
+ Mfree( GEM_buffer1 );
+ GEM_buffer1=NULL;
+ }
+}
+
+static void GEM_ClearRect(_THIS, short *rect)
+{
+ short oldrgb[3], rgb[3]={0,0,0};
+
+ vq_color(VDI_handle, vdi_index[0], 0, oldrgb);
+ vs_color(VDI_handle, vdi_index[0], rgb);
+
+ vsf_color(VDI_handle,0);
+ vsf_interior(VDI_handle,1);
+ vsf_perimeter(VDI_handle,0);
+ v_bar(VDI_handle, rect);
+
+ vs_color(VDI_handle, vdi_index[0], oldrgb);
+}
+
+static void GEM_ClearScreen(_THIS)
+{
+ short pxy[4];
+
+ v_hide_c(VDI_handle);
+
+ pxy[0] = pxy[1] = 0;
+ pxy[2] = VDI_w - 1;
+ pxy[3] = VDI_h - 1;
+ GEM_ClearRect(this, pxy);
+
+ v_show_c(VDI_handle, 1);
+}
+
+static void GEM_SetNewPalette(_THIS, Uint16 newpal[256][3])
+{
+ int i;
+ short rgb[3];
+
+ if (VDI_oldnumcolors==0)
+ return;
+
+ for(i = 0; i < VDI_oldnumcolors; i++) {
+ rgb[0] = newpal[i][0];
+ rgb[1] = newpal[i][1];
+ rgb[2] = newpal[i][2];
+
+ vs_color(VDI_handle, i, rgb);
+ }
+}
+
+static void GEM_LockScreen(_THIS)
+{
+ if (!GEM_locked) {
+ /* Lock AES */
+ wind_update(BEG_UPDATE);
+ wind_update(BEG_MCTRL);
+ /* Reserve memory space, used to be sure of compatibility */
+ form_dial( FMD_START, 0,0,0,0, 0,0,VDI_w,VDI_h);
+
+ /* Save menu bar */
+ if (GEM_menubar) {
+ MFDB mfdb_src;
+ short blitcoords[8];
+
+ mfdb_src.fd_addr=GEM_menubar;
+ mfdb_src.fd_w=GEM_desk_w;
+ mfdb_src.fd_h=GEM_desk_y;
+ mfdb_src.fd_wdwidth=GEM_desk_w>>4;
+ mfdb_src.fd_nplanes=VDI_bpp;
+ mfdb_src.fd_stand=
+ mfdb_src.fd_r1=
+ mfdb_src.fd_r2=
+ mfdb_src.fd_r3= 0;
+
+ blitcoords[0] = blitcoords[4] = 0;
+ blitcoords[1] = blitcoords[5] = 0;
+ blitcoords[2] = blitcoords[6] = GEM_desk_w-1;
+ blitcoords[3] = blitcoords[7] = GEM_desk_y-1;
+
+ vro_cpyfm(VDI_handle, S_ONLY, blitcoords, &VDI_dst_mfdb, &mfdb_src);
+ }
+
+ GEM_locked=SDL_TRUE;
+ }
+}
+
+static void GEM_UnlockScreen(_THIS)
+{
+ if (GEM_locked) {
+ /* Restore menu bar */
+ if (GEM_menubar) {
+ MFDB mfdb_src;
+ short blitcoords[8];
+
+ mfdb_src.fd_addr=GEM_menubar;
+ mfdb_src.fd_w=GEM_desk_w;
+ mfdb_src.fd_h=GEM_desk_y;
+ mfdb_src.fd_wdwidth=GEM_desk_w>>4;
+ mfdb_src.fd_nplanes=VDI_bpp;
+ mfdb_src.fd_stand=
+ mfdb_src.fd_r1=
+ mfdb_src.fd_r2=
+ mfdb_src.fd_r3= 0;
+
+ blitcoords[0] = blitcoords[4] = 0;
+ blitcoords[1] = blitcoords[5] = 0;
+ blitcoords[2] = blitcoords[6] = GEM_desk_w-1;
+ blitcoords[3] = blitcoords[7] = GEM_desk_y-1;
+
+ vro_cpyfm(VDI_handle, S_ONLY, blitcoords, &mfdb_src, &VDI_dst_mfdb);
+ }
+
+ /* Restore screen memory, and send REDRAW to all apps */
+ form_dial( FMD_FINISH, 0,0,0,0, 0,0,VDI_w,VDI_h);
+ /* Unlock AES */
+ wind_update(END_MCTRL);
+ wind_update(END_UPDATE);
+
+ GEM_locked=SDL_FALSE;
+ }
+}
+
+SDL_Surface *GEM_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ Uint32 modeflags, screensize;
+ SDL_bool use_shadow1, use_shadow2;
+
+ /* width must be multiple of 16, for vro_cpyfm() and c2p_convert() */
+ if ((width & 15) != 0) {
+ width = (width | 15) +1;
+ }
+
+ /*--- Verify if asked mode can be used ---*/
+ if (VDI_bpp != bpp) {
+ SDL_SetError("%d bpp mode not supported", bpp);
+ return(NULL);
+ }
+
+ if (flags & SDL_FULLSCREEN) {
+ if ((VDI_w < width) || (VDI_h < height)) {
+ SDL_SetError("%dx%d mode is too large", width, height);
+ return(NULL);
+ }
+ }
+
+ /*--- Allocate the new pixel format for the screen ---*/
+ if ( ! SDL_ReallocFormat(current, VDI_bpp, VDI_redmask, VDI_greenmask, VDI_bluemask, VDI_alphamask) ) {
+ SDL_SetError("Couldn't allocate new pixel format for requested mode");
+ return(NULL);
+ }
+
+ screensize = width * height * VDI_pixelsize;
+
+#ifdef DEBUG_VIDEO_GEM
+ printf("sdl:video:gem: setvideomode(): %dx%dx%d = %d\n", width, height, bpp, screensize);
+#endif
+
+ /*--- Allocate shadow buffers if needed, and conversion operations ---*/
+ GEM_FreeBuffers(this);
+
+ GEM_bufops=0;
+ use_shadow1=use_shadow2=SDL_FALSE;
+ if (VDI_screen && (flags & SDL_FULLSCREEN)) {
+ if (VDI_format==VDI_FORMAT_INTER) {
+ use_shadow1=SDL_TRUE;
+ GEM_bufops = B2S_C2P_1TOS;
+ }
+ } else {
+ use_shadow1=SDL_TRUE;
+ if (VDI_format==VDI_FORMAT_PACK) {
+ GEM_bufops = B2S_VROCPYFM_1TOS;
+ } else {
+ use_shadow2=SDL_TRUE;
+ GEM_bufops = B2S_C2P_1TO2|B2S_VROCPYFM_2TOS;
+ }
+ }
+
+ if (use_shadow1) {
+ GEM_buffer1 = Atari_SysMalloc(screensize, MX_PREFTTRAM);
+ if (GEM_buffer1==NULL) {
+ SDL_SetError("Can not allocate %d KB for frame buffer", screensize>>10);
+ return NULL;
+ }
+ SDL_memset(GEM_buffer1, 0, screensize);
+#ifdef DEBUG_VIDEO_GEM
+ printf("sdl:video:gem: setvideomode(): allocated buffer 1\n");
+#endif
+ }
+
+ if (use_shadow2) {
+ GEM_buffer2 = Atari_SysMalloc(screensize, MX_PREFTTRAM);
+ if (GEM_buffer2==NULL) {
+ SDL_SetError("Can not allocate %d KB for shadow buffer", screensize>>10);
+ return NULL;
+ }
+ SDL_memset(GEM_buffer2, 0, screensize);
+#ifdef DEBUG_VIDEO_GEM
+ printf("sdl:video:gem: setvideomode(): allocated buffer 2\n");
+#endif
+ }
+
+ /*--- Initialize screen ---*/
+ modeflags = SDL_PREALLOC;
+ if (VDI_bpp == 8) {
+ modeflags |= SDL_HWPALETTE;
+ }
+
+ if (flags & SDL_FULLSCREEN) {
+ GEM_LockScreen(this);
+
+ GEM_ClearScreen(this);
+
+ modeflags |= SDL_FULLSCREEN;
+ if (VDI_screen && (VDI_format==VDI_FORMAT_PACK) && !use_shadow1) {
+ modeflags |= SDL_HWSURFACE;
+ } else {
+ modeflags |= SDL_SWSURFACE;
+ }
+
+ GEM_fullscreen = SDL_TRUE;
+ } else {
+ int old_win_type;
+ short x2,y2,w2,h2;
+
+ GEM_UnlockScreen(this);
+
+ /* Set window gadgets */
+ old_win_type = GEM_win_type;
+ if (!(flags & SDL_NOFRAME)) {
+ GEM_win_type=NAME|MOVER|CLOSER|SMALLER;
+ if (flags & SDL_RESIZABLE) {
+ GEM_win_type |= FULLER|SIZER;
+ modeflags |= SDL_RESIZABLE;
+ }
+ } else {
+ GEM_win_type=0;
+ modeflags |= SDL_NOFRAME;
+ }
+ modeflags |= SDL_SWSURFACE;
+
+ /* Recreate window ? only for different widget or non-created window */
+ if ((old_win_type != GEM_win_type) || (GEM_handle < 0)) {
+ /* Calculate window size */
+ if (!wind_calc(WC_BORDER, GEM_win_type, 0,0,width,height, &x2,&y2,&w2,&h2)) {
+ GEM_FreeBuffers(this);
+ SDL_SetError("Can not calculate window attributes");
+ return NULL;
+ }
+
+ /* Center window */
+ x2 = (GEM_desk_w-w2)>>1;
+ y2 = (GEM_desk_h-h2)>>1;
+ if (x2<0) {
+ x2 = 0;
+ }
+ if (y2<0) {
+ y2 = 0;
+ }
+ x2 += GEM_desk_x;
+ y2 += GEM_desk_y;
+
+ /* Destroy existing window */
+ if (GEM_handle >= 0) {
+ wind_close(GEM_handle);
+ wind_delete(GEM_handle);
+ }
+
+ /* Create window */
+ GEM_handle=wind_create(GEM_win_type, x2,y2,w2,h2);
+ if (GEM_handle<0) {
+ GEM_FreeBuffers(this);
+ SDL_SetError("Can not create window");
+ return NULL;
+ }
+
+#ifdef DEBUG_VIDEO_GEM
+ printf("sdl:video:gem: handle=%d\n", GEM_handle);
+#endif
+
+ /* Setup window name */
+ wind_set(GEM_handle,WF_NAME,(short)(((unsigned long)GEM_title_name)>>16),(short)(((unsigned long)GEM_title_name) & 0xffff),0,0);
+ GEM_refresh_name = SDL_FALSE;
+
+ /* Open the window */
+ wind_open(GEM_handle,x2,y2,w2,h2);
+ } else {
+ /* Resize window to fit asked video mode */
+ wind_get (GEM_handle, WF_WORKXYWH, &x2,&y2,&w2,&h2);
+ if (wind_calc(WC_BORDER, GEM_win_type, x2,y2,width,height, &x2,&y2,&w2,&h2)) {
+ wind_set (GEM_handle, WF_CURRXYWH, x2,y2,w2,h2);
+ }
+ }
+
+ GEM_fullscreen = SDL_FALSE;
+ }
+
+ /* Set up the new mode framebuffer */
+ current->w = width;
+ current->h = height;
+ if (use_shadow1) {
+ current->pixels = GEM_buffer1;
+ current->pitch = width * VDI_pixelsize;
+ } else {
+ current->pixels = VDI_screen;
+ current->pitch = VDI_pitch;
+ }
+
+#if SDL_VIDEO_OPENGL
+ if (flags & SDL_OPENGL) {
+ if (!SDL_AtariGL_Init(this, current)) {
+ GEM_FreeBuffers(this);
+ SDL_SetError("Can not create OpenGL context");
+ return NULL;
+ }
+
+ modeflags |= SDL_OPENGL;
+ }
+#endif
+
+ current->flags = modeflags;
+
+#ifdef DEBUG_VIDEO_GEM
+ printf("sdl:video:gem: surface: %dx%d\n", current->w, current->h);
+#endif
+
+ this->UpdateRects = GEM_UpdateRects;
+ GEM_lock_redraw = SDL_FALSE; /* Enable redraw */
+
+ /* We're done */
+ return(current);
+}
+
+static int GEM_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ return -1;
+}
+
+static void GEM_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+static int GEM_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(0);
+}
+
+static void GEM_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+static void GEM_UpdateRectsFullscreen(_THIS, int numrects, SDL_Rect *rects)
+{
+ SDL_Surface *surface;
+ int i, surf_width;
+
+ surface = this->screen;
+ /* Need to be a multiple of 16 pixels */
+ surf_width=surface->w;
+ if ((surf_width & 15) != 0) {
+ surf_width = (surf_width | 15) + 1;
+ }
+
+ if (GEM_bufops & (B2S_C2P_1TO2|B2S_C2P_1TOS)) {
+ void *destscr;
+ int destpitch;
+
+ if (GEM_bufops & B2S_C2P_1TOS) {
+ destscr = VDI_screen;
+ destpitch = VDI_pitch;
+ } else {
+ destscr = GEM_buffer2;
+ destpitch = surface->pitch;
+ }
+
+ for (i=0;i<numrects;i++) {
+ void *source,*destination;
+ int x1,x2;
+
+ x1 = rects[i].x & ~15;
+ x2 = rects[i].x+rects[i].w;
+ if (x2 & 15) {
+ x2 = (x2 | 15) +1;
+ }
+
+ source = surface->pixels;
+ source += surface->pitch * rects[i].y;
+ source += x1;
+
+ destination = destscr;
+ destination += destpitch * rects[i].y;
+ destination += x1;
+
+ SDL_Atari_C2pConvert(
+ source, destination,
+ x2-x1, rects[i].h,
+ SDL_FALSE,
+ surface->pitch, destpitch
+ );
+ }
+ }
+
+ if (GEM_bufops & (B2S_VROCPYFM_1TOS|B2S_VROCPYFM_2TOS)) {
+ MFDB mfdb_src;
+ short blitcoords[8];
+
+ mfdb_src.fd_addr=surface->pixels;
+ mfdb_src.fd_w=surf_width;
+ mfdb_src.fd_h=surface->h;
+ mfdb_src.fd_wdwidth= (surface->pitch/VDI_pixelsize) >> 4;
+ mfdb_src.fd_nplanes=surface->format->BitsPerPixel;
+ mfdb_src.fd_stand=
+ mfdb_src.fd_r1=
+ mfdb_src.fd_r2=
+ mfdb_src.fd_r3= 0;
+ if (GEM_bufops & B2S_VROCPYFM_2TOS) {
+ mfdb_src.fd_addr=GEM_buffer2;
+ }
+
+ for ( i=0; i<numrects; ++i ) {
+ blitcoords[0] = blitcoords[4] = rects[i].x;
+ blitcoords[1] = blitcoords[5] = rects[i].y;
+ blitcoords[2] = blitcoords[6] = rects[i].x + rects[i].w - 1;
+ blitcoords[3] = blitcoords[7] = rects[i].y + rects[i].h - 1;
+
+ vro_cpyfm(VDI_handle, S_ONLY, blitcoords, &mfdb_src, &VDI_dst_mfdb);
+ }
+ }
+}
+
+static void GEM_UpdateRectsWindowed(_THIS, int numrects, SDL_Rect *rects)
+{
+ short pxy[4], wind_pxy[4];
+ int i;
+
+ if (wind_get(GEM_handle, WF_WORKXYWH, &wind_pxy[0], &wind_pxy[1], &wind_pxy[2], &wind_pxy[3])==0) {
+ return;
+ }
+
+ for ( i=0; i<numrects; ++i ) {
+ pxy[0] = wind_pxy[0] + rects[i].x;
+ pxy[1] = wind_pxy[1] + rects[i].y;
+ pxy[2] = rects[i].w;
+ pxy[3] = rects[i].h;
+
+ GEM_wind_redraw(this, GEM_handle, pxy);
+ }
+}
+
+static void GEM_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
+{
+ SDL_Surface *surface;
+
+ if (GEM_lock_redraw) {
+ return;
+ }
+
+ surface = this->screen;
+
+ if (surface->flags & SDL_FULLSCREEN) {
+ GEM_UpdateRectsFullscreen(this, numrects, rects);
+ } else {
+ GEM_UpdateRectsWindowed(this, numrects, rects);
+ }
+}
+
+static int GEM_FlipHWSurfaceFullscreen(_THIS, SDL_Surface *surface)
+{
+ int surf_width;
+
+ /* Need to be a multiple of 16 pixels */
+ surf_width=surface->w;
+ if ((surf_width & 15) != 0) {
+ surf_width = (surf_width | 15) + 1;
+ }
+
+ if (GEM_bufops & (B2S_C2P_1TO2|B2S_C2P_1TOS)) {
+ void *destscr;
+ int destpitch;
+
+ if (GEM_bufops & B2S_C2P_1TOS) {
+ destscr = VDI_screen;
+ destpitch = VDI_pitch;
+ } else {
+ destscr = GEM_buffer2;
+ destpitch = surface->pitch;
+ }
+
+ SDL_Atari_C2pConvert(
+ surface->pixels, destscr,
+ surf_width, surface->h,
+ SDL_FALSE,
+ surface->pitch, destpitch
+ );
+ }
+
+ if (GEM_bufops & (B2S_VROCPYFM_1TOS|B2S_VROCPYFM_2TOS)) {
+ MFDB mfdb_src;
+ short blitcoords[8];
+
+ mfdb_src.fd_w=surf_width;
+ mfdb_src.fd_h=surface->h;
+ mfdb_src.fd_wdwidth=mfdb_src.fd_w >> 4;
+ mfdb_src.fd_nplanes=surface->format->BitsPerPixel;
+ mfdb_src.fd_stand=
+ mfdb_src.fd_r1=
+ mfdb_src.fd_r2=
+ mfdb_src.fd_r3= 0;
+ if (GEM_bufops & B2S_VROCPYFM_1TOS) {
+ mfdb_src.fd_addr=surface->pixels;
+ } else {
+ mfdb_src.fd_addr=GEM_buffer2;
+ }
+
+ blitcoords[0] = blitcoords[4] = 0;
+ blitcoords[1] = blitcoords[5] = 0;
+ blitcoords[2] = blitcoords[6] = surface->w - 1;
+ blitcoords[3] = blitcoords[7] = surface->h - 1;
+
+ vro_cpyfm(VDI_handle, S_ONLY, blitcoords, &mfdb_src, &VDI_dst_mfdb);
+ }
+
+ return(0);
+}
+
+static int GEM_FlipHWSurfaceWindowed(_THIS, SDL_Surface *surface)
+{
+ short pxy[8];
+
+ /* Update the whole window */
+ wind_get(GEM_handle, WF_WORKXYWH, &pxy[0], &pxy[1], &pxy[2], &pxy[3]);
+
+ GEM_wind_redraw(this, GEM_handle, pxy);
+
+ return(0);
+}
+
+static int GEM_FlipHWSurface(_THIS, SDL_Surface *surface)
+{
+ if (GEM_lock_redraw) {
+ return(0);
+ }
+
+ if (surface->flags & SDL_FULLSCREEN) {
+ return GEM_FlipHWSurfaceFullscreen(this, surface);
+ } else {
+ return GEM_FlipHWSurfaceWindowed(this, surface);
+ }
+}
+
+static int GEM_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ int i;
+ SDL_Surface *surface;
+
+#ifdef DEBUG_VIDEO_GEM
+ printf("sdl:video:gem: setcolors()\n");
+#endif
+
+ /* Do not change palette in True Colour */
+ surface = this->screen;
+ if (surface->format->BitsPerPixel > 8) {
+ return 1;
+ }
+
+ for(i = 0; i < ncolors; i++)
+ {
+ int r, g, b;
+ short rgb[3];
+
+ r = colors[i].r;
+ g = colors[i].g;
+ b = colors[i].b;
+
+ rgb[0] = VDI_curpalette[i][0] = (1000 * r) / 255;
+ rgb[1] = VDI_curpalette[i][1] =(1000 * g) / 255;
+ rgb[2] = VDI_curpalette[i][2] =(1000 * b) / 255;
+
+ vs_color(VDI_handle, vdi_index[firstcolor+i], rgb);
+ }
+
+ return(1);
+}
+
+#if 0
+static int GEM_ToggleFullScreen(_THIS, int on)
+{
+ if (on) {
+ GEM_LockScreen(this);
+ } else {
+ GEM_UnlockScreen(this);
+ }
+
+ return(1);
+}
+#endif
+
+/* Note: If we are terminated, this could be called in the middle of
+ another SDL video routine -- notably UpdateRects.
+*/
+void GEM_VideoQuit(_THIS)
+{
+ SDL_AtariXbios_RestoreVectors();
+ if (GEM_usedevmouse) {
+ SDL_AtariDevMouse_Close();
+ }
+
+ GEM_FreeBuffers(this);
+
+#if SDL_VIDEO_OPENGL
+ if (gl_active) {
+ SDL_AtariGL_Quit(this, SDL_TRUE);
+ }
+#endif
+
+ /* Destroy window */
+ if (GEM_handle>=0) {
+ wind_close(GEM_handle);
+ wind_delete(GEM_handle);
+ GEM_handle=-1;
+ }
+
+ GEM_UnlockScreen(this);
+ if (GEM_menubar) {
+ Mfree(GEM_menubar);
+ GEM_menubar=NULL;
+ }
+
+ appl_exit();
+
+ GEM_SetNewPalette(this, VDI_oldpalette);
+
+ /* Close VDI workstation */
+ if (VDI_handle) {
+ v_clsvwk(VDI_handle);
+ }
+
+ /* Free mode list */
+ if (SDL_modelist[0]) {
+ SDL_free(SDL_modelist[0]);
+ SDL_modelist[0]=NULL;
+ }
+
+ this->screen->pixels = NULL;
+}
+
+void GEM_wind_redraw(_THIS, int winhandle, short *inside)
+{
+ short todo[4];
+
+ /* Tell AES we are going to update */
+ wind_update(BEG_UPDATE);
+
+ v_hide_c(VDI_handle);
+
+ /* Browse the rectangle list to redraw */
+ if (wind_get(winhandle, WF_FIRSTXYWH, &todo[0], &todo[1], &todo[2], &todo[3])!=0) {
+
+ while (todo[2] && todo[3]) {
+
+ if (rc_intersect((GRECT *)inside,(GRECT *)todo)) {
+ todo[2] += todo[0]-1;
+ todo[3] += todo[1]-1;
+ refresh_window(this, winhandle, todo);
+ }
+
+ if (wind_get(winhandle, WF_NEXTXYWH, &todo[0], &todo[1], &todo[2], &todo[3])==0) {
+ break;
+ }
+ }
+
+ }
+
+ /* Update finished */
+ wind_update(END_UPDATE);
+
+ v_show_c(VDI_handle,1);
+}
+
+static void refresh_window(_THIS, int winhandle, short *rect)
+{
+ MFDB mfdb_src;
+ short pxy[8],wind_pxy[8];
+ SDL_Surface *surface;
+ int iconified;
+
+ /* Is window iconified ? */
+ iconified = 0;
+/* if (GEM_wfeatures & (1<<WF_ICONIFY))*/ {
+ if (wind_get(winhandle, WF_ICONIFY, &wind_pxy[0], &wind_pxy[1], &wind_pxy[2], &wind_pxy[3])!=0) {
+ iconified = wind_pxy[0];
+ }
+ }
+
+ if (wind_get(winhandle, WF_WORKXYWH, &wind_pxy[0], &wind_pxy[1], &wind_pxy[2], &wind_pxy[3])==0) {
+ return;
+ }
+
+ if (iconified && GEM_icon) {
+ short icon_rect[4], dst_rect[4];
+ short iconx,icony;
+
+ surface = GEM_icon;
+
+ GEM_ClearRect(this, rect);
+
+ /* Calculate centered icon(x,y,w,h) relative to window */
+ iconx = (wind_pxy[2]-surface->w)>>1;
+ icony = (wind_pxy[3]-surface->h)>>1;
+
+ icon_rect[0] = iconx;
+ icon_rect[1] = icony;
+ icon_rect[2] = surface->w;
+ icon_rect[3] = surface->h;
+
+ /* Calculate redraw rectangle(x,y,w,h) relative to window */
+ dst_rect[0] = rect[0]-wind_pxy[0];
+ dst_rect[1] = rect[1]-wind_pxy[1];
+ dst_rect[2] = rect[2]-rect[0]+1;
+ dst_rect[3] = rect[3]-rect[1]+1;
+
+ /* Does the icon rectangle must be redrawn ? */
+ if (!rc_intersect((GRECT *)icon_rect, (GRECT *)dst_rect)) {
+ return;
+ }
+
+#if DEBUG_VIDEO_GEM
+ printf("sdl:video:gem: clip(0,0,%d,%d) to (%d,%d,%d,%d)\n",
+ surface->w-1,surface->h-1, dst_rect[0],dst_rect[1],dst_rect[2],dst_rect[3]);
+ printf("sdl:video:gem: icon(%d,%d,%d,%d)\n",
+ icon_rect[0], icon_rect[1], icon_rect[2], icon_rect[3]);
+ printf("sdl:video:gem: refresh_window(): draw icon\n");
+#endif
+
+ /* Calculate icon(x1,y1,x2,y2) relative to screen */
+ icon_rect[0] += wind_pxy[0];
+ icon_rect[1] += wind_pxy[1];
+ icon_rect[2] += icon_rect[0]-1;
+ icon_rect[3] += icon_rect[1]-1;
+
+ /* Calculate intersection rectangle to redraw */
+ pxy[4]=pxy[0]=MAX(icon_rect[0],rect[0]);
+ pxy[5]=pxy[1]=MAX(icon_rect[1],rect[1]);
+ pxy[6]=pxy[2]=MIN(icon_rect[2],rect[2]);
+ pxy[7]=pxy[3]=MIN(icon_rect[3],rect[3]);
+
+ /* Calculate icon source image pos relative to window */
+ pxy[0] -= wind_pxy[0]+iconx;
+ pxy[1] -= wind_pxy[1]+icony;
+ pxy[2] -= wind_pxy[0]+iconx;
+ pxy[3] -= wind_pxy[1]+icony;
+
+ } else {
+ surface = this->screen;
+
+#if DEBUG_VIDEO_GEM
+ printf("sdl:video:gem: refresh_window(): draw frame buffer\n");
+#endif
+
+ /* Redraw all window content */
+ pxy[0] = rect[0]-wind_pxy[0];
+ pxy[1] = rect[1]-wind_pxy[1];
+ pxy[2] = rect[2]-wind_pxy[0];
+ pxy[3] = rect[3]-wind_pxy[1];
+
+ pxy[4] = rect[0];
+ pxy[5] = rect[1];
+ pxy[6] = rect[2];
+ pxy[7] = rect[3];
+ }
+
+ if (GEM_bufops & B2S_C2P_1TO2) {
+ void *src, *dest;
+ int x1,x2;
+
+ x1 = (rect[0]-wind_pxy[0]) & ~15;
+ x2 = rect[2]-wind_pxy[0];
+ if (x2 & 15) {
+ x2 = (x2 | 15) +1;
+ }
+
+ src = surface->pixels;
+ src += surface->pitch * (rect[1]-wind_pxy[1]);
+ src += x1;
+
+ dest = GEM_buffer2;
+ dest += surface->pitch * (rect[1]-wind_pxy[1]);
+ dest += x1;
+
+ SDL_Atari_C2pConvert(
+ src, dest,
+ x2-x1, rect[3]-rect[1]+1,
+ SDL_FALSE,
+ surface->pitch, surface->pitch
+ );
+ }
+
+ mfdb_src.fd_addr=surface->pixels;
+ {
+ int width;
+
+ /* Need to be a multiple of 16 pixels */
+ width=surface->w;
+ if ((width & 15) != 0) {
+ width = (width | 15) + 1;
+ }
+ mfdb_src.fd_w=width;
+ }
+ mfdb_src.fd_h=surface->h;
+ mfdb_src.fd_nplanes=surface->format->BitsPerPixel;
+ mfdb_src.fd_wdwidth=mfdb_src.fd_w>>4;
+ mfdb_src.fd_stand=
+ mfdb_src.fd_r1=
+ mfdb_src.fd_r2=
+ mfdb_src.fd_r3= 0;
+
+ if (GEM_bufops & B2S_VROCPYFM_2TOS) {
+ mfdb_src.fd_addr=GEM_buffer2;
+ }
+
+#if DEBUG_VIDEO_GEM
+ printf("sdl:video:gem: redraw %dx%d: (%d,%d,%d,%d) to (%d,%d,%d,%d)\n",
+ surface->w, surface->h,
+ pxy[0],pxy[1],pxy[2],pxy[3],
+ pxy[4],pxy[5],pxy[6],pxy[7]
+ );
+#endif
+
+ vro_cpyfm( VDI_handle, S_ONLY, pxy, &mfdb_src, &VDI_dst_mfdb);
+}
+
+#if SDL_VIDEO_OPENGL
+
+static void GEM_GL_SwapBuffers(_THIS)
+{
+ SDL_AtariGL_SwapBuffers(this);
+ GEM_FlipHWSurface(this, this->screen);
+}
+
+#endif
diff --git a/distrib/sdl-1.2.15/src/video/gem/SDL_gemvideo.h b/distrib/sdl-1.2.15/src/video/gem/SDL_gemvideo.h
new file mode 100644
index 0000000..f3a1954
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/gem/SDL_gemvideo.h
@@ -0,0 +1,191 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_gemvideo_h
+#define _SDL_gemvideo_h
+
+#include "SDL_mutex.h"
+#include "../SDL_sysvideo.h"
+
+/* The implementation dependent data for the window manager cursor */
+struct WMcursor {
+ MFORM *mform_p;
+};
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+/* Functions prototypes */
+void GEM_wind_redraw(_THIS, int winhandle, short *inside);
+
+/* Private display data */
+
+#define B2S_C2P_1TO2 (1<<0) /* C2P convert buffer 1 to buffer 2 */
+#define B2S_C2P_1TOS (1<<1) /* C2P convert buffer 1 to screen */
+#define B2S_VROCPYFM_1TOS (1<<2) /* vro_cpyfm() buffer 1 to screen */
+#define B2S_VROCPYFM_2TOS (1<<3) /* vro_cpyfm() buffer 2 to screen */
+
+#define SDL_NUMMODES 1 /* Fullscreen */
+
+struct SDL_PrivateVideoData {
+ Uint16 buf2scr_ops; /* Operations to get buffer to screen */
+ void *buffer1; /* Our shadow buffers */
+ void *buffer2;
+
+ /* VDI infos */
+ short vdi_handle; /* VDI handle */
+ short full_w, full_h; /* Fullscreen size */
+ short bpp; /* Colour depth */
+ short pixelsize; /* Bytes per pixel */
+ short old_numcolors; /* Number of colors in saved palette */
+ Uint16 pitch; /* Line length */
+ Uint16 format; /* Screen format */
+ void *screen; /* Screen address */
+ Uint32 red, green, blue, alpha; /* Screen components */
+ Uint32 screensize;
+ short blit_coords[8]; /* Coordinates for bitblt */
+ MFDB src_mfdb, dst_mfdb; /* VDI MFDB for bitblt */
+ Uint16 old_palette[256][3]; /* Saved current palette */
+ Uint16 cur_palette[256][3]; /* SDL application palette */
+ /* Function to set/restore palette */
+ void (*setpalette)(_THIS, Uint16 newpal[256][3]);
+
+ /* GEM infos */
+ short desk_x, desk_y; /* Desktop properties */
+ short desk_w, desk_h;
+ short win_handle; /* Our window handle */
+ int window_type; /* Window type */
+ const char *title_name; /* Window title */
+ const char *icon_name; /* Icon title */
+ short version; /* AES version */
+ short wfeatures; /* AES window features */
+ SDL_bool refresh_name; /* Change window title ? */
+ SDL_bool window_fulled; /* Window maximized ? */
+ SDL_bool mouse_relative; /* Report relative mouse movement */
+ SDL_bool locked; /* AES locked for fullscreen ? */
+ SDL_bool lock_redraw; /* Prevent redraw till buffers are setup */
+ short message[8]; /* To self-send an AES message */
+ void *menubar; /* Menu bar save buffer when going fullscreen */
+ SDL_bool use_dev_mouse; /* Use /dev/mouse ? */
+ WMcursor *cursor; /* To restore cursor when leaving/entering window */
+
+ SDL_bool fullscreen; /* Fullscreen or windowed mode ? */
+ SDL_Rect *SDL_modelist[SDL_NUMMODES+1]; /* Mode list */
+ SDL_Surface *icon; /* The icon */
+};
+
+/* Hidden structure -> variables names */
+#define VDI_handle (this->hidden->vdi_handle)
+#define VDI_w (this->hidden->full_w)
+#define VDI_h (this->hidden->full_h)
+#define VDI_bpp (this->hidden->bpp)
+#define VDI_pixelsize (this->hidden->pixelsize)
+#define VDI_oldnumcolors (this->hidden->old_numcolors)
+#define VDI_oldpalette (this->hidden->old_palette)
+#define VDI_curpalette (this->hidden->cur_palette)
+#define VDI_setpalette (this->hidden->setpalette)
+#define VDI_pitch (this->hidden->pitch)
+#define VDI_format (this->hidden->format)
+#define VDI_screen (this->hidden->screen)
+#define VDI_redmask (this->hidden->red)
+#define VDI_greenmask (this->hidden->green)
+#define VDI_bluemask (this->hidden->blue)
+#define VDI_alphamask (this->hidden->alpha)
+#define VDI_screensize (this->hidden->screensize)
+#define VDI_src_mfdb (this->hidden->src_mfdb)
+#define VDI_dst_mfdb (this->hidden->dst_mfdb)
+#define VDI_blit_coords (this->hidden->blit_coords)
+
+#define GEM_desk_x (this->hidden->desk_x)
+#define GEM_desk_y (this->hidden->desk_y)
+#define GEM_desk_w (this->hidden->desk_w)
+#define GEM_desk_h (this->hidden->desk_h)
+#define GEM_handle (this->hidden->win_handle)
+#define GEM_win_type (this->hidden->window_type)
+#define GEM_title_name (this->hidden->title_name)
+#define GEM_icon_name (this->hidden->icon_name)
+#define GEM_refresh_name (this->hidden->refresh_name)
+#define GEM_version (this->hidden->version)
+#define GEM_wfeatures (this->hidden->wfeatures)
+#define GEM_win_fulled (this->hidden->window_fulled)
+#define GEM_mouse_relative (this->hidden->mouse_relative)
+#define GEM_locked (this->hidden->locked)
+#define GEM_lock_redraw (this->hidden->lock_redraw)
+#define GEM_message (this->hidden->message)
+#define SDL_modelist (this->hidden->SDL_modelist)
+#define GEM_icon (this->hidden->icon)
+#define GEM_fullscreen (this->hidden->fullscreen)
+#define GEM_menubar (this->hidden->menubar)
+#define GEM_usedevmouse (this->hidden->use_dev_mouse)
+#define GEM_cursor (this->hidden->cursor)
+
+#define GEM_buffer1 (this->hidden->buffer1)
+#define GEM_buffer2 (this->hidden->buffer2)
+#define GEM_bufops (this->hidden->buf2scr_ops)
+
+#define VDI_FBMASK(amask, rmask, gmask, bmask) \
+ VDI_alphamask = (amask); \
+ VDI_redmask = (rmask); \
+ VDI_greenmask = (gmask); \
+ VDI_bluemask = (bmask);
+
+/*
+ Possible buffer to screen operations:
+
+ TC: 8 (chunky),15,16,24,32 bpp
+ 8I: 8 bpp planes
+ FB: screen framebuffer address available
+ FS: fullscreen
+
+ TC, FB, FS:
+ - draw to screen
+ 8I, FB, FS:
+ - draw to buffer 1
+ - C2P from buffer 1 to screen
+
+ TC, !FB, FS:
+ - draw to buffer 1
+ - vro_cpyfm() from buffer 1 to screen
+ 8I, !FB, FS:
+ - draw to buffer 1
+ - C2P from buffer 1 to buffer 2
+ - vro_cpyfm() from buffer 2 to screen
+
+ TC, FB, !FS:
+ - draw to buffer 1
+ - vro_cpyfm() from buffer 1 to screen
+ 8I, FB, !FS:
+ - draw to buffer 1
+ - C2P from buffer 1 to buffer 2
+ - vro_cpyfm() from buffer 2 to screen
+
+ TC, !FB, !FS:
+ - draw to buffer 1
+ - vro_cpyfm() from buffer 1 to screen
+ 8I, !FB, !FS:
+ - draw to buffer 1
+ - C2P from buffer 1 to buffer 2
+ - vro_cpyfm() from buffer 2 to screen
+*/
+
+#endif /* _SDL_gemvideo_h */
diff --git a/distrib/sdl-1.2.15/src/video/gem/SDL_gemwm.c b/distrib/sdl-1.2.15/src/video/gem/SDL_gemwm.c
new file mode 100644
index 0000000..10776fd
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/gem/SDL_gemwm.c
@@ -0,0 +1,116 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ GEM SDL video driver
+ Window manager functions
+
+ Patrice Mandin
+*/
+
+/* Mint includes */
+#include <gem.h>
+
+#include "SDL_gemwm_c.h"
+
+/* Defines */
+
+#define ICONWIDTH 64
+#define ICONHEIGHT 64
+
+/* Functions */
+
+void GEM_SetCaption(_THIS, const char *title, const char *icon)
+{
+ if (title) {
+ GEM_title_name = title;
+ GEM_refresh_name = SDL_TRUE;
+ }
+
+ if (icon) {
+ GEM_icon_name = icon;
+ GEM_refresh_name = SDL_TRUE;
+ }
+}
+
+void GEM_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask)
+{
+ SDL_Surface *sicon;
+ SDL_Rect bounds;
+
+#if 0
+ if ((GEM_wfeatures & (1<<WF_ICONIFY))==0) {
+ return;
+ }
+#endif
+
+ if (icon == NULL) {
+ return;
+ }
+
+ /* Convert icon to the screen format */
+ sicon = SDL_CreateRGBSurface(SDL_SWSURFACE, icon->w, icon->h,
+ VDI_bpp, VDI_redmask, VDI_greenmask, VDI_bluemask, 0);
+ if ( sicon == NULL ) {
+ return;
+ }
+
+ bounds.x = 0;
+ bounds.y = 0;
+ bounds.w = icon->w;
+ bounds.h = icon->h;
+ if ( SDL_LowerBlit(icon, &bounds, sicon, &bounds) < 0 ) {
+ SDL_FreeSurface(sicon);
+ return;
+ }
+
+ GEM_icon = sicon;
+}
+
+int GEM_IconifyWindow(_THIS)
+{
+ if ((GEM_wfeatures & (1<<WF_ICONIFY))==0)
+ return 0;
+
+ GEM_message[0] = WM_ICONIFY;
+ GEM_message[1] = gl_apid;
+ GEM_message[2] = 0;
+ GEM_message[3] = GEM_handle;
+ GEM_message[4] = 0;
+ GEM_message[5] = GEM_desk_h-ICONHEIGHT;
+ GEM_message[6] = ICONWIDTH;
+ GEM_message[7] = ICONHEIGHT;
+
+ appl_write(gl_apid, sizeof(GEM_message), GEM_message);
+
+ return 1;
+}
+
+SDL_GrabMode GEM_GrabInput(_THIS, SDL_GrabMode mode)
+{
+ if (this->screen == NULL) {
+ return SDL_GRAB_OFF;
+ }
+
+ return mode;
+}
diff --git a/distrib/sdl-1.2.15/src/video/gem/SDL_gemwm_c.h b/distrib/sdl-1.2.15/src/video/gem/SDL_gemwm_c.h
new file mode 100644
index 0000000..59828b7
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/gem/SDL_gemwm_c.h
@@ -0,0 +1,37 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * GEM SDL video driver implementation
+ * Window manager functions
+ *
+ * Patrice Mandin
+ */
+
+#include "SDL_gemvideo.h"
+
+/* Functions prototypes */
+extern void GEM_SetCaption(_THIS, const char *title, const char *icon);
+extern void GEM_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask);
+extern int GEM_IconifyWindow(_THIS);
+extern SDL_GrabMode GEM_GrabInput(_THIS, SDL_GrabMode mode);
diff --git a/distrib/sdl-1.2.15/src/video/ggi/SDL_ggievents.c b/distrib/sdl-1.2.15/src/video/ggi/SDL_ggievents.c
new file mode 100644
index 0000000..d963fe1
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ggi/SDL_ggievents.c
@@ -0,0 +1,264 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Handle the event stream, converting GGI events into SDL events */
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <termios.h>
+
+#include <ggi/keyboard.h>
+
+#include "SDL_ggikeys.h"
+
+#include "SDL.h"
+#include "../SDL_sysvideo.h"
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_ggivideo.h"
+#include "SDL_ggievents_c.h"
+
+/* The translation tables from a GGI keycode to a SDL keysym */
+static SDLKey keymap[128];
+static SDL_keysym *GGI_TranslateKey(ggi_event *ev, SDL_keysym *keysym);
+
+static int posted = 0;
+
+void GGI_PumpEvents(_THIS)
+{
+ struct timeval *tvp, tv = { 0, 0 };
+ ggi_event ev;
+
+ tvp = &tv;
+
+/* ggiFlush(VIS); */
+
+ while (ggiEventPoll(VIS, emAll, tvp))
+/* while (ggiEventPoll(VIS, (emKeyboard | emPointer | emCommand), tvp)) */
+ {
+ int queueevent_mouse = 0, queueevent_kbd = 0;
+ static int buttons = 0;
+ static int mouse_x = 0, mouse_y = 0, mouse_z = 0;
+ int x = 0, y = 0, z = 0, rx = 0, ry = 0, rz = 0;
+ int pressed_mouse, pressed_kbd;
+ SDL_keysym keysym;
+
+ posted = 0;
+
+ /* FIXME: We do not actually want all events, only
+ * mouse and keyboard events. Having to handle all
+ * events will slow things down. */
+
+ ggiEventRead(VIS, &ev, emAll);
+/* ggiEventRead(VIS, &ev, (emKeyboard | emPointer | emCommand)); */
+
+ switch (ev.any.type)
+ {
+ case evPtrRelative:
+ x = ev.pmove.x;
+ y = ev.pmove.y;
+ z = ev.pmove.wheel;
+ posted += SDL_PrivateMouseMotion(0, 1, x, y);
+ break;
+ case evPtrAbsolute:
+ if (mouse_x != ev.pmove.x || mouse_y != ev.pmove.y || mouse_z != ev.pmove.wheel)
+ {
+ x = ev.pmove.x - mouse_x;
+ y = ev.pmove.y - mouse_y;
+ z = ev.pmove.wheel - mouse_z;
+ mouse_x = ev.pmove.x;
+ mouse_y = ev.pmove.y;
+ mouse_z = ev.pmove.wheel;
+ posted += SDL_PrivateMouseMotion(0, 1, x, y);
+ }
+ break;
+ case evPtrButtonPress:
+ posted += SDL_PrivateMouseButton(SDL_PRESSED, ev.pbutton.button, 0, 0);
+ break;
+ case evPtrButtonRelease:
+ posted += SDL_PrivateMouseButton(SDL_RELEASED, ev.pbutton.button, 0, 0);
+ break;
+ case evKeyPress:
+ case evKeyRepeat:
+ posted += SDL_PrivateKeyboard(SDL_PRESSED, GGI_TranslateKey(&ev, &keysym));
+ break;
+ case evKeyRelease:
+ posted += SDL_PrivateKeyboard(SDL_RELEASED, GGI_TranslateKey(&ev, &keysym));
+ break;
+ case evCommand:
+ fprintf(stderr, "Command event %x recieved\n", ev.cmd.code);
+ break;
+ default:
+ fprintf(stderr, "Unhandled event type %d\n", ev.any.type);
+ break;
+ }
+ }
+
+}
+
+void GGI_InitOSKeymap(_THIS)
+{
+ int i;
+
+ /* Initialize the GGI key translation table */
+ for ( i=0; i<SDL_arraysize(keymap); ++i )
+ keymap[i] = SDLK_UNKNOWN;
+
+ keymap[SCANCODE_ESCAPE] = SDLK_ESCAPE;
+ keymap[SCANCODE_1] = SDLK_1;
+ keymap[SCANCODE_2] = SDLK_2;
+ keymap[SCANCODE_3] = SDLK_3;
+ keymap[SCANCODE_4] = SDLK_4;
+ keymap[SCANCODE_5] = SDLK_5;
+ keymap[SCANCODE_6] = SDLK_6;
+ keymap[SCANCODE_7] = SDLK_7;
+ keymap[SCANCODE_8] = SDLK_8;
+ keymap[SCANCODE_9] = SDLK_9;
+ keymap[SCANCODE_0] = SDLK_0;
+ keymap[SCANCODE_MINUS] = SDLK_MINUS;
+ keymap[SCANCODE_EQUAL] = SDLK_EQUALS;
+ keymap[SCANCODE_BACKSPACE] = SDLK_BACKSPACE;
+ keymap[SCANCODE_TAB] = SDLK_TAB;
+ keymap[SCANCODE_Q] = SDLK_q;
+ keymap[SCANCODE_W] = SDLK_w;
+ keymap[SCANCODE_E] = SDLK_e;
+ keymap[SCANCODE_R] = SDLK_r;
+ keymap[SCANCODE_T] = SDLK_t;
+ keymap[SCANCODE_Y] = SDLK_y;
+ keymap[SCANCODE_U] = SDLK_u;
+ keymap[SCANCODE_I] = SDLK_i;
+ keymap[SCANCODE_O] = SDLK_o;
+ keymap[SCANCODE_P] = SDLK_p;
+ keymap[SCANCODE_BRACKET_LEFT] = SDLK_LEFTBRACKET;
+ keymap[SCANCODE_BRACKET_RIGHT] = SDLK_RIGHTBRACKET;
+ keymap[SCANCODE_ENTER] = SDLK_RETURN;
+ keymap[SCANCODE_LEFTCONTROL] = SDLK_LCTRL;
+ keymap[SCANCODE_A] = SDLK_a;
+ keymap[SCANCODE_S] = SDLK_s;
+ keymap[SCANCODE_D] = SDLK_d;
+ keymap[SCANCODE_F] = SDLK_f;
+ keymap[SCANCODE_G] = SDLK_g;
+ keymap[SCANCODE_H] = SDLK_h;
+ keymap[SCANCODE_J] = SDLK_j;
+ keymap[SCANCODE_K] = SDLK_k;
+ keymap[SCANCODE_L] = SDLK_l;
+ keymap[SCANCODE_SEMICOLON] = SDLK_SEMICOLON;
+ keymap[SCANCODE_APOSTROPHE] = SDLK_QUOTE;
+ keymap[SCANCODE_GRAVE] = SDLK_BACKQUOTE;
+ keymap[SCANCODE_LEFTSHIFT] = SDLK_LSHIFT;
+ keymap[SCANCODE_BACKSLASH] = SDLK_BACKSLASH;
+ keymap[SCANCODE_Z] = SDLK_z;
+ keymap[SCANCODE_X] = SDLK_x;
+ keymap[SCANCODE_C] = SDLK_c;
+ keymap[SCANCODE_V] = SDLK_v;
+ keymap[SCANCODE_B] = SDLK_b;
+ keymap[SCANCODE_N] = SDLK_n;
+ keymap[SCANCODE_M] = SDLK_m;
+ keymap[SCANCODE_COMMA] = SDLK_COMMA;
+ keymap[SCANCODE_PERIOD] = SDLK_PERIOD;
+ keymap[SCANCODE_SLASH] = SDLK_SLASH;
+ keymap[SCANCODE_RIGHTSHIFT] = SDLK_RSHIFT;
+ keymap[SCANCODE_KEYPADMULTIPLY] = SDLK_KP_MULTIPLY;
+ keymap[SCANCODE_LEFTALT] = SDLK_LALT;
+ keymap[SCANCODE_SPACE] = SDLK_SPACE;
+ keymap[SCANCODE_CAPSLOCK] = SDLK_CAPSLOCK;
+ keymap[SCANCODE_F1] = SDLK_F1;
+ keymap[SCANCODE_F2] = SDLK_F2;
+ keymap[SCANCODE_F3] = SDLK_F3;
+ keymap[SCANCODE_F4] = SDLK_F4;
+ keymap[SCANCODE_F5] = SDLK_F5;
+ keymap[SCANCODE_F6] = SDLK_F6;
+ keymap[SCANCODE_F7] = SDLK_F7;
+ keymap[SCANCODE_F8] = SDLK_F8;
+ keymap[SCANCODE_F9] = SDLK_F9;
+ keymap[SCANCODE_F10] = SDLK_F10;
+ keymap[SCANCODE_NUMLOCK] = SDLK_NUMLOCK;
+ keymap[SCANCODE_SCROLLLOCK] = SDLK_SCROLLOCK;
+ keymap[SCANCODE_KEYPAD7] = SDLK_KP7;
+ keymap[SCANCODE_CURSORUPLEFT] = SDLK_KP7;
+ keymap[SCANCODE_KEYPAD8] = SDLK_KP8;
+ keymap[SCANCODE_CURSORUP] = SDLK_KP8;
+ keymap[SCANCODE_KEYPAD9] = SDLK_KP9;
+ keymap[SCANCODE_CURSORUPRIGHT] = SDLK_KP9;
+ keymap[SCANCODE_KEYPADMINUS] = SDLK_KP_MINUS;
+ keymap[SCANCODE_KEYPAD4] = SDLK_KP4;
+ keymap[SCANCODE_CURSORLEFT] = SDLK_KP4;
+ keymap[SCANCODE_KEYPAD5] = SDLK_KP5;
+ keymap[SCANCODE_KEYPAD6] = SDLK_KP6;
+ keymap[SCANCODE_CURSORRIGHT] = SDLK_KP6;
+ keymap[SCANCODE_KEYPADPLUS] = SDLK_KP_PLUS;
+ keymap[SCANCODE_KEYPAD1] = SDLK_KP1;
+ keymap[SCANCODE_CURSORDOWNLEFT] = SDLK_KP1;
+ keymap[SCANCODE_KEYPAD2] = SDLK_KP2;
+ keymap[SCANCODE_CURSORDOWN] = SDLK_KP2;
+ keymap[SCANCODE_KEYPAD3] = SDLK_KP3;
+ keymap[SCANCODE_CURSORDOWNRIGHT] = SDLK_KP3;
+ keymap[SCANCODE_KEYPAD0] = SDLK_KP0;
+ keymap[SCANCODE_KEYPADPERIOD] = SDLK_KP_PERIOD;
+ keymap[SCANCODE_LESS] = SDLK_LESS;
+ keymap[SCANCODE_F11] = SDLK_F11;
+ keymap[SCANCODE_F12] = SDLK_F12;
+ keymap[SCANCODE_KEYPADENTER] = SDLK_KP_ENTER;
+ keymap[SCANCODE_RIGHTCONTROL] = SDLK_RCTRL;
+ keymap[SCANCODE_CONTROL] = SDLK_RCTRL;
+ keymap[SCANCODE_KEYPADDIVIDE] = SDLK_KP_DIVIDE;
+ keymap[SCANCODE_PRINTSCREEN] = SDLK_PRINT;
+ keymap[SCANCODE_RIGHTALT] = SDLK_RALT;
+ keymap[SCANCODE_BREAK] = SDLK_BREAK;
+ keymap[SCANCODE_BREAK_ALTERNATIVE] = SDLK_UNKNOWN;
+ keymap[SCANCODE_HOME] = SDLK_HOME;
+ keymap[SCANCODE_CURSORBLOCKUP] = SDLK_UP;
+ keymap[SCANCODE_PAGEUP] = SDLK_PAGEUP;
+ keymap[SCANCODE_CURSORBLOCKLEFT] = SDLK_LEFT;
+ keymap[SCANCODE_CURSORBLOCKRIGHT] = SDLK_RIGHT;
+ keymap[SCANCODE_END] = SDLK_END;
+ keymap[SCANCODE_CURSORBLOCKDOWN] = SDLK_DOWN;
+ keymap[SCANCODE_PAGEDOWN] = SDLK_PAGEDOWN;
+ keymap[SCANCODE_INSERT] = SDLK_INSERT;
+ keymap[SCANCODE_REMOVE] = SDLK_DELETE;
+ keymap[119] = SDLK_PAUSE;
+ keymap[SCANCODE_RIGHTWIN] = SDLK_RSUPER;
+ keymap[SCANCODE_LEFTWIN] = SDLK_LSUPER;
+ keymap[127] = SDLK_MENU;
+}
+
+
+
+static SDL_keysym *GGI_TranslateKey(gii_event *ev, SDL_keysym *keysym)
+{
+ /* Set the keysym information */
+ keysym->scancode = ev->key.button;
+ keysym->sym = keymap[ev->key.button];
+ keysym->mod = KMOD_NONE;
+
+ /* If UNICODE is on, get the UNICODE value for the key */
+ keysym->unicode = 0;
+ if (SDL_TranslateUNICODE)
+ {
+ keysym->unicode = GII_UNICODE(ev->key.sym);
+ }
+
+ return keysym;
+}
diff --git a/distrib/sdl-1.2.15/src/video/ggi/SDL_ggievents_c.h b/distrib/sdl-1.2.15/src/video/ggi/SDL_ggievents_c.h
new file mode 100755
index 0000000..2c66106
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ggi/SDL_ggievents_c.h
@@ -0,0 +1,29 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_ggivideo.h"
+
+/* Functions to be exported */
+extern void GGI_InitOSKeymap(_THIS);
+extern void GGI_PumpEvents(_THIS);
+
diff --git a/distrib/sdl-1.2.12/src/video/ggi/SDL_ggikeys.h b/distrib/sdl-1.2.15/src/video/ggi/SDL_ggikeys.h
index 2868ee6..2868ee6 100644
--- a/distrib/sdl-1.2.12/src/video/ggi/SDL_ggikeys.h
+++ b/distrib/sdl-1.2.15/src/video/ggi/SDL_ggikeys.h
diff --git a/distrib/sdl-1.2.15/src/video/ggi/SDL_ggimouse.c b/distrib/sdl-1.2.15/src/video/ggi/SDL_ggimouse.c
new file mode 100644
index 0000000..52c5337
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ggi/SDL_ggimouse.c
@@ -0,0 +1,32 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_mouse.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_ggimouse_c.h"
+
+
+/* The implementation dependent data for the window manager cursor */
+struct WMcursor {
+ int unused;
+};
diff --git a/distrib/sdl-1.2.15/src/video/ggi/SDL_ggimouse_c.h b/distrib/sdl-1.2.15/src/video/ggi/SDL_ggimouse_c.h
new file mode 100755
index 0000000..c0ce295
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ggi/SDL_ggimouse_c.h
@@ -0,0 +1,26 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_ggivideo.h"
+
+/* Functions to be exported */
diff --git a/distrib/sdl-1.2.15/src/video/ggi/SDL_ggivideo.c b/distrib/sdl-1.2.15/src/video/ggi/SDL_ggivideo.c
new file mode 100644
index 0000000..face495
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ggi/SDL_ggivideo.c
@@ -0,0 +1,378 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* GGI-based SDL video driver implementation.
+*/
+
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/mman.h>
+
+#include <ggi/ggi.h>
+#include <ggi/gii.h>
+
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_ggivideo.h"
+#include "SDL_ggimouse_c.h"
+#include "SDL_ggievents_c.h"
+
+
+struct private_hwdata
+{
+ ggi_visual_t vis;
+};
+
+ggi_visual_t VIS;
+
+/* Initialization/Query functions */
+static int GGI_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **GGI_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *GGI_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int GGI_SetColors(_THIS, int firstcolor, int ncolors,
+ SDL_Color *colors);
+static void GGI_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int GGI_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int GGI_LockHWSurface(_THIS, SDL_Surface *surface);
+static void GGI_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void GGI_FreeHWSurface(_THIS, SDL_Surface *surface);
+
+/* GGI driver bootstrap functions */
+
+static int GGI_Available(void)
+{
+ ggi_visual_t *vis;
+
+ vis = NULL;
+ if (ggiInit() == 0) {
+ vis = ggiOpen(NULL);
+ if (vis != NULL) {
+ ggiClose(vis);
+ }
+ }
+ return (vis != NULL);
+}
+
+static void GGI_DeleteDevice(SDL_VideoDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_VideoDevice *GGI_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device;
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *device->hidden));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( device ) {
+ SDL_free(device);
+ }
+ return(0);
+ }
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+
+ /* Set the function pointers */
+ device->VideoInit = GGI_VideoInit;
+ device->ListModes = GGI_ListModes;
+ device->SetVideoMode = GGI_SetVideoMode;
+ device->SetColors = GGI_SetColors;
+ device->UpdateRects = NULL;
+ device->VideoQuit = GGI_VideoQuit;
+ device->AllocHWSurface = GGI_AllocHWSurface;
+ device->CheckHWBlit = NULL;
+ device->FillHWRect = NULL;
+ device->SetHWColorKey = NULL;
+ device->SetHWAlpha = NULL;
+ device->LockHWSurface = GGI_LockHWSurface;
+ device->UnlockHWSurface = GGI_UnlockHWSurface;
+ device->FlipHWSurface = NULL;
+ device->FreeHWSurface = GGI_FreeHWSurface;
+ device->SetCaption = NULL;
+ device->SetIcon = NULL;
+ device->IconifyWindow = NULL;
+ device->GrabInput = NULL;
+ device->GetWMInfo = NULL;
+ device->InitOSKeymap = GGI_InitOSKeymap;
+ device->PumpEvents = GGI_PumpEvents;
+
+ device->free = GGI_DeleteDevice;
+
+ return device;
+}
+
+VideoBootStrap GGI_bootstrap = {
+ "ggi", "General Graphics Interface (GGI)",
+ GGI_Available, GGI_CreateDevice
+};
+
+
+static SDL_Rect video_mode;
+static SDL_Rect *SDL_modelist[4] = { NULL, NULL, NULL, NULL };
+
+int GGI_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ ggi_mode mode =
+ {
+ 1,
+ { GGI_AUTO, GGI_AUTO },
+ { GGI_AUTO, GGI_AUTO },
+ { 0, 0 },
+ GT_AUTO,
+ { GGI_AUTO, GGI_AUTO }
+ };
+ struct private_hwdata *priv;
+ ggi_color pal[256], map[256];
+ const ggi_directbuffer *db;
+ int err, num_bufs;
+ ggi_pixel white, black;
+
+ priv = SDL_malloc(sizeof(struct private_hwdata));
+ if (priv == NULL)
+ {
+ SDL_SetError("Unhandled GGI mode type!\n");
+ GGI_VideoQuit(NULL);
+ }
+
+ if (ggiInit() != 0)
+ {
+ SDL_SetError("Unable to initialize GGI!\n");
+ GGI_VideoQuit(NULL);
+ }
+
+ VIS = ggiOpen(NULL);
+ if (VIS == NULL)
+ {
+ SDL_SetError("Unable to open default GGI visual!\n");
+ ggiExit();
+ GGI_VideoQuit(NULL);
+ }
+
+ ggiSetFlags(VIS, GGIFLAG_ASYNC);
+
+ /* Validate mode, autodetecting any GGI_AUTO or GT_AUTO fields */
+ ggiCheckMode(VIS, &mode);
+
+ /* At this point we should have a valid mode - try to set it */
+ err = ggiSetMode(VIS, &mode);
+
+ /* If we couldn't set _any_ modes, something is very wrong */
+ if (err)
+ {
+ SDL_SetError("Can't set a mode!\n");
+ ggiClose(VIS);
+ ggiExit();
+ GGI_VideoQuit(NULL);
+ }
+
+ /* Determine the current screen size */
+ this->info.current_w = mode.virt.x;
+ this->info.current_h = mode.virt.y;
+
+ /* Set a palette for palletized modes */
+ if (GT_SCHEME(mode.graphtype) == GT_PALETTE)
+ {
+ ggiSetColorfulPalette(VIS);
+ ggiGetPalette(VIS, 0, 1 << vformat->BitsPerPixel, pal);
+ }
+
+ /* Now we try to get the DirectBuffer info, which determines whether
+ * SDL can access hardware surfaces directly. */
+
+ num_bufs = ggiDBGetNumBuffers(VIS);
+
+ if (num_bufs > 0)
+ {
+ db = ggiDBGetBuffer(VIS, 0); /* Only handle one DB for now */
+
+ vformat->BitsPerPixel = db->buffer.plb.pixelformat->depth;
+
+ vformat->Rmask = db->buffer.plb.pixelformat->red_mask;
+ vformat->Gmask = db->buffer.plb.pixelformat->green_mask;
+ vformat->Bmask = db->buffer.plb.pixelformat->blue_mask;
+
+ /* Fill in our hardware acceleration capabilities */
+
+ this->info.wm_available = 0;
+ this->info.hw_available = 1;
+ this->info.video_mem = db->buffer.plb.stride * mode.virt.y;
+ }
+
+ video_mode.x = 0;
+ video_mode.y = 0;
+ video_mode.w = mode.virt.x;
+ video_mode.h = mode.virt.y;
+ SDL_modelist[((vformat->BitsPerPixel + 7) / 8) - 1] = &video_mode;
+
+ /* We're done! */
+ return(0);
+}
+
+static SDL_Rect **GGI_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ return(&SDL_modelist[((format->BitsPerPixel + 7) / 8) - 1]);
+}
+
+/* Various screen update functions available */
+static void GGI_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
+
+SDL_Surface *GGI_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags)
+{
+ ggi_mode mode =
+ {
+ 1,
+ { GGI_AUTO, GGI_AUTO },
+ { GGI_AUTO, GGI_AUTO },
+ { 0, 0 },
+ GT_AUTO,
+ { GGI_AUTO, GGI_AUTO }
+ };
+ const ggi_directbuffer *db;
+ ggi_color pal[256];
+ int err;
+
+ fprintf(stderr, "GGI_SetVideoMode()\n");
+
+ mode.visible.x = mode.virt.x = width;
+ mode.visible.y = mode.virt.y = height;
+
+ /* Translate requested SDL bit depth into a GGI mode */
+ switch (bpp)
+ {
+ case 1: mode.graphtype = GT_1BIT; break;
+ case 2: mode.graphtype = GT_2BIT; break;
+ case 4: mode.graphtype = GT_4BIT; break;
+ case 8: mode.graphtype = GT_8BIT; break;
+ case 15: mode.graphtype = GT_15BIT; break;
+ case 16: mode.graphtype = GT_16BIT; break;
+ case 24: mode.graphtype = GT_24BIT; break;
+ case 32: mode.graphtype = GT_32BIT; break;
+ default:
+ SDL_SetError("Unknown SDL bit depth, using GT_AUTO....\n");
+ mode.graphtype = GT_AUTO;
+ }
+
+ /* Validate mode, autodetecting any GGI_AUTO or GT_AUTO fields */
+ ggiCheckMode(VIS, &mode);
+
+ /* At this point we should have a valid mode - try to set it */
+ err = ggiSetMode(VIS, &mode);
+
+ /* If we couldn't set _any_ modes, something is very wrong */
+ if (err)
+ {
+ SDL_SetError("Can't set a mode!\n");
+ ggiClose(VIS);
+ ggiExit();
+ GGI_VideoQuit(NULL);
+ }
+
+ /* Set a palette for palletized modes */
+ if (GT_SCHEME(mode.graphtype) == GT_PALETTE)
+ {
+ ggiSetColorfulPalette(VIS);
+ ggiGetPalette(VIS, 0, 1 << bpp, pal);
+ }
+
+ db = ggiDBGetBuffer(VIS, 0);
+
+ /* Set up the new mode framebuffer */
+ current->flags = (SDL_FULLSCREEN | SDL_HWSURFACE);
+ current->w = mode.virt.x;
+ current->h = mode.virt.y;
+ current->pitch = db->buffer.plb.stride;
+ current->pixels = db->read;
+
+ /* Set the blit function */
+ this->UpdateRects = GGI_DirectUpdate;
+
+ /* We're done */
+ return(current);
+}
+
+static int GGI_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(-1);
+}
+static void GGI_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+static int GGI_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(0);
+}
+static void GGI_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+static void GGI_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+ int i;
+
+/* ggiFlush(VIS); */
+
+ for (i = 0; i < numrects; i++)
+ {
+ ggiFlushRegion(VIS, rects[i].x, rects[i].y, rects[i].w, rects[i].h);
+ }
+ return;
+}
+
+int GGI_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ int i;
+ ggi_color pal[256];
+
+ /* Set up the colormap */
+ for (i = 0; i < ncolors; i++)
+ {
+ pal[i].r = (colors[i].r << 8) | colors[i].r;
+ pal[i].g = (colors[i].g << 8) | colors[i].g;
+ pal[i].b = (colors[i].b << 8) | colors[i].b;
+ }
+
+ ggiSetPalette(VIS, firstcolor, ncolors, pal);
+
+ return 1;
+}
+
+void GGI_VideoQuit(_THIS)
+{
+}
+void GGI_FinalQuit(void)
+{
+}
diff --git a/distrib/sdl-1.2.15/src/video/ggi/SDL_ggivideo.h b/distrib/sdl-1.2.15/src/video/ggi/SDL_ggivideo.h
new file mode 100644
index 0000000..014dd09
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ggi/SDL_ggivideo.h
@@ -0,0 +1,48 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_ggivideo_h
+#define _SDL_ggivideo_h
+
+#include <ggi/ggi.h>
+
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+
+#define _THIS SDL_VideoDevice *this
+
+/* Private display data */
+
+struct SDL_PrivateVideoData
+{
+ ggi_visual_t *ggivis;
+};
+
+extern ggi_visual_t VIS; /* FIXME: use the private data struct */
+
+extern int SDL_OpenKeyboard(void);
+extern void SDL_CloseKeyboard(void);
+extern int SDL_OpenMouse(void);
+extern void SDL_CloseMouse(void);
+
+#endif /* _SDL_ggivideo_h */
diff --git a/distrib/sdl-1.2.15/src/video/ipod/SDL_ipodvideo.c b/distrib/sdl-1.2.15/src/video/ipod/SDL_ipodvideo.c
new file mode 100644
index 0000000..a2f3db3
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ipod/SDL_ipodvideo.c
@@ -0,0 +1,733 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+#include <termios.h>
+#include <ctype.h>
+
+#include <linux/vt.h>
+#include <linux/kd.h>
+#include <linux/keyboard.h>
+#include <linux/fb.h>
+
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_sysevents.h"
+#include "SDL_ipodvideo.h"
+
+#define _THIS SDL_VideoDevice *this
+
+static int iPod_VideoInit (_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **iPod_ListModes (_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *iPod_SetVideoMode (_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int iPod_SetColors (_THIS, int firstcolor, int ncolors, SDL_Color *colors);
+static void iPod_UpdateRects (_THIS, int nrects, SDL_Rect *rects);
+static void iPod_VideoQuit (_THIS);
+static void iPod_PumpEvents (_THIS);
+
+static long iPod_GetGeneration();
+
+static int initd = 0;
+static int kbfd = -1;
+static int fbfd = -1;
+static int oldvt = -1;
+static int curvt = -1;
+static int old_kbmode = -1;
+static long generation = 0;
+static struct termios old_termios, cur_termios;
+
+FILE *dbgout;
+
+#define LCD_DATA 0x10
+#define LCD_CMD 0x08
+#define IPOD_OLD_LCD_BASE 0xc0001000
+#define IPOD_OLD_LCD_RTC 0xcf001110
+#define IPOD_NEW_LCD_BASE 0x70003000
+#define IPOD_NEW_LCD_RTC 0x60005010
+
+static unsigned long lcd_base, lcd_rtc, lcd_width, lcd_height;
+
+static long iPod_GetGeneration()
+{
+ int i;
+ char cpuinfo[256];
+ char *ptr;
+ FILE *file;
+
+ if ((file = fopen("/proc/cpuinfo", "r")) != NULL) {
+ while (fgets(cpuinfo, sizeof(cpuinfo), file) != NULL)
+ if (SDL_strncmp(cpuinfo, "Revision", 8) == 0)
+ break;
+ fclose(file);
+ }
+ for (i = 0; !isspace(cpuinfo[i]); i++);
+ for (; isspace(cpuinfo[i]); i++);
+ ptr = cpuinfo + i + 2;
+
+ return SDL_strtol(ptr, NULL, 10);
+}
+
+static int iPod_Available()
+{
+ return 1;
+}
+
+static void iPod_DeleteDevice (SDL_VideoDevice *device)
+{
+ free (device->hidden);
+ free (device);
+}
+
+void iPod_InitOSKeymap (_THIS) {}
+
+static SDL_VideoDevice *iPod_CreateDevice (int devindex)
+{
+ SDL_VideoDevice *this;
+
+ this = (SDL_VideoDevice *)SDL_malloc (sizeof(SDL_VideoDevice));
+ if (this) {
+ memset (this, 0, sizeof *this);
+ this->hidden = (struct SDL_PrivateVideoData *) SDL_malloc (sizeof(struct SDL_PrivateVideoData));
+ }
+ if (!this || !this->hidden) {
+ SDL_OutOfMemory();
+ if (this)
+ SDL_free (this);
+ return 0;
+ }
+ memset (this->hidden, 0, sizeof(struct SDL_PrivateVideoData));
+
+ generation = iPod_GetGeneration();
+
+ this->VideoInit = iPod_VideoInit;
+ this->ListModes = iPod_ListModes;
+ this->SetVideoMode = iPod_SetVideoMode;
+ this->SetColors = iPod_SetColors;
+ this->UpdateRects = iPod_UpdateRects;
+ this->VideoQuit = iPod_VideoQuit;
+ this->AllocHWSurface = 0;
+ this->CheckHWBlit = 0;
+ this->FillHWRect = 0;
+ this->SetHWColorKey = 0;
+ this->SetHWAlpha = 0;
+ this->LockHWSurface = 0;
+ this->UnlockHWSurface = 0;
+ this->FlipHWSurface = 0;
+ this->FreeHWSurface = 0;
+ this->SetCaption = 0;
+ this->SetIcon = 0;
+ this->IconifyWindow = 0;
+ this->GrabInput = 0;
+ this->GetWMInfo = 0;
+ this->InitOSKeymap = iPod_InitOSKeymap;
+ this->PumpEvents = iPod_PumpEvents;
+ this->free = iPod_DeleteDevice;
+
+ return this;
+}
+
+VideoBootStrap iPod_bootstrap = {
+ "ipod", "iPod Framebuffer Driver",
+ iPod_Available, iPod_CreateDevice
+};
+
+//--//
+
+static int iPod_VideoInit (_THIS, SDL_PixelFormat *vformat)
+{
+ if (!initd) {
+ /*** Code adapted/copied from SDL fbcon driver. ***/
+
+ static const char * const tty0[] = { "/dev/tty0", "/dev/vc/0", 0 };
+ static const char * const vcs[] = { "/dev/vc/%d", "/dev/tty%d", 0 };
+ int i, tty0_fd;
+
+ dbgout = fdopen (open ("/etc/sdlpod.log", O_WRONLY | O_SYNC | O_APPEND), "a");
+ if (dbgout) {
+ setbuf (dbgout, 0);
+ fprintf (dbgout, "--> Started SDL <--\n");
+ }
+
+ // Try to query for a free VT
+ tty0_fd = -1;
+ for ( i=0; tty0[i] && (tty0_fd < 0); ++i ) {
+ tty0_fd = open(tty0[i], O_WRONLY, 0);
+ }
+ if ( tty0_fd < 0 ) {
+ tty0_fd = dup(0); /* Maybe stdin is a VT? */
+ }
+ ioctl(tty0_fd, VT_OPENQRY, &curvt);
+ close(tty0_fd);
+
+ tty0_fd = open("/dev/tty", O_RDWR, 0);
+ if ( tty0_fd >= 0 ) {
+ ioctl(tty0_fd, TIOCNOTTY, 0);
+ close(tty0_fd);
+ }
+
+ if ( (geteuid() == 0) && (curvt > 0) ) {
+ for ( i=0; vcs[i] && (kbfd < 0); ++i ) {
+ char vtpath[12];
+
+ SDL_snprintf(vtpath, SDL_arraysize(vtpath), vcs[i], curvt);
+ kbfd = open(vtpath, O_RDWR);
+ }
+ }
+ if ( kbfd < 0 ) {
+ if (dbgout) fprintf (dbgout, "Couldn't open any VC\n");
+ return -1;
+ }
+ if (dbgout) fprintf (stderr, "Current VT: %d\n", curvt);
+
+ if (kbfd >= 0) {
+ /* Switch to the correct virtual terminal */
+ if ( curvt > 0 ) {
+ struct vt_stat vtstate;
+
+ if ( ioctl(kbfd, VT_GETSTATE, &vtstate) == 0 ) {
+ oldvt = vtstate.v_active;
+ }
+ if ( ioctl(kbfd, VT_ACTIVATE, curvt) == 0 ) {
+ if (dbgout) fprintf (dbgout, "Waiting for switch to this VT... ");
+ ioctl(kbfd, VT_WAITACTIVE, curvt);
+ if (dbgout) fprintf (dbgout, "done!\n");
+ }
+ }
+
+ // Set terminal input mode
+ if (tcgetattr (kbfd, &old_termios) < 0) {
+ if (dbgout) fprintf (dbgout, "Can't get termios\n");
+ return -1;
+ }
+ cur_termios = old_termios;
+ // cur_termios.c_iflag &= ~(ICRNL | INPCK | ISTRIP | IXON);
+ // cur_termios.c_iflag |= (BRKINT);
+ // cur_termios.c_lflag &= ~(ICANON | ECHO | ISIG | IEXTEN);
+ // cur_termios.c_oflag &= ~(OPOST);
+ // cur_termios.c_oflag |= (ONOCR | ONLRET);
+ cur_termios.c_lflag &= ~(ICANON | ECHO | ISIG);
+ cur_termios.c_iflag &= ~(ISTRIP | IGNCR | ICRNL | INLCR | IXOFF | IXON);
+ cur_termios.c_cc[VMIN] = 0;
+ cur_termios.c_cc[VTIME] = 0;
+
+ if (tcsetattr (kbfd, TCSAFLUSH, &cur_termios) < 0) {
+ if (dbgout) fprintf (dbgout, "Can't set termios\n");
+ return -1;
+ }
+ if (ioctl (kbfd, KDSKBMODE, K_MEDIUMRAW) < 0) {
+ if (dbgout) fprintf (dbgout, "Can't set medium-raw mode\n");
+ return -1;
+ }
+ if (ioctl (kbfd, KDSETMODE, KD_GRAPHICS) < 0) {
+ if (dbgout) fprintf (dbgout, "Can't set graphics\n");
+ return -1;
+ }
+ }
+
+ // Open the framebuffer
+ if ((fbfd = open ("/dev/fb0", O_RDWR)) < 0) {
+ if (dbgout) fprintf (dbgout, "Can't open framebuffer\n");
+ return -1;
+ } else {
+ struct fb_var_screeninfo vinfo;
+
+ if (dbgout) fprintf (dbgout, "Generation: %ld\n", generation);
+
+ if (generation >= 40000) {
+ lcd_base = IPOD_NEW_LCD_BASE;
+ } else {
+ lcd_base = IPOD_OLD_LCD_BASE;
+ }
+
+ ioctl (fbfd, FBIOGET_VSCREENINFO, &vinfo);
+ close (fbfd);
+
+ if (lcd_base == IPOD_OLD_LCD_BASE)
+ lcd_rtc = IPOD_OLD_LCD_RTC;
+ else if (lcd_base == IPOD_NEW_LCD_BASE)
+ lcd_rtc = IPOD_NEW_LCD_RTC;
+ else {
+ SDL_SetError ("Unknown iPod version");
+ return -1;
+ }
+
+ lcd_width = vinfo.xres;
+ lcd_height = vinfo.yres;
+
+ if (dbgout) fprintf (dbgout, "LCD is %dx%d\n", lcd_width, lcd_height);
+ }
+
+ fcntl (kbfd, F_SETFL, O_RDWR | O_NONBLOCK);
+
+ /* Determine the current screen size */
+ this->info.current_w = lcd_width;
+ this->info.current_h = lcd_height;
+
+ if ((generation >= 60000) && (generation < 70000)) {
+ vformat->BitsPerPixel = 16;
+ vformat->Rmask = 0xF800;
+ vformat->Gmask = 0x07E0;
+ vformat->Bmask = 0x001F;
+ } else {
+ vformat->BitsPerPixel = 8;
+ vformat->Rmask = vformat->Gmask = vformat->Bmask = 0;
+ }
+
+ initd = 1;
+ if (dbgout) fprintf (dbgout, "Initialized.\n\n");
+ }
+ return 0;
+}
+
+static SDL_Rect **iPod_ListModes (_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ int width, height, fd;
+ static SDL_Rect r;
+ static SDL_Rect *rs[2] = { &r, 0 };
+
+ if ((fd = open ("/dev/fb0", O_RDWR)) < 0) {
+ return 0;
+ } else {
+ struct fb_var_screeninfo vinfo;
+
+ ioctl (fbfd, FBIOGET_VSCREENINFO, &vinfo);
+ close (fbfd);
+
+ width = vinfo.xres;
+ height = vinfo.yres;
+ }
+ r.x = r.y = 0;
+ r.w = width;
+ r.h = height;
+ return rs;
+}
+
+
+static SDL_Surface *iPod_SetVideoMode (_THIS, SDL_Surface *current, int width, int height, int bpp,
+ Uint32 flags)
+{
+ Uint32 Rmask, Gmask, Bmask;
+ if (bpp > 8) {
+ Rmask = 0xF800;
+ Gmask = 0x07E0;
+ Bmask = 0x001F;
+ } else {
+ Rmask = Gmask = Bmask = 0;
+ }
+
+ if (this->hidden->buffer) SDL_free (this->hidden->buffer);
+ this->hidden->buffer = SDL_malloc (width * height * (bpp / 8));
+ if (!this->hidden->buffer) {
+ SDL_SetError ("Couldn't allocate buffer for requested mode");
+ return 0;
+ }
+
+ memset (this->hidden->buffer, 0, width * height * (bpp / 8));
+
+ if (!SDL_ReallocFormat (current, bpp, Rmask, Gmask, Bmask, 0)) {
+ SDL_SetError ("Couldn't allocate new pixel format");
+ SDL_free (this->hidden->buffer);
+ this->hidden->buffer = 0;
+ return 0;
+ }
+
+ if (bpp <= 8) {
+ int i, j;
+ for (i = 0; i < 256; i += 4) {
+ for (j = 0; j < 4; j++) {
+ current->format->palette->colors[i+j].r = 85 * j;
+ current->format->palette->colors[i+j].g = 85 * j;
+ current->format->palette->colors[i+j].b = 85 * j;
+ }
+ }
+ }
+
+ current->flags = flags & SDL_FULLSCREEN;
+ this->hidden->w = current->w = width;
+ this->hidden->h = current->h = height;
+ current->pitch = current->w * (bpp / 8);
+ current->pixels = this->hidden->buffer;
+
+ return current;
+}
+
+static int iPod_SetColors (_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ if (SDL_VideoSurface && SDL_VideoSurface->format && SDL_VideoSurface->format->palette) {
+ int i, j;
+ for (i = 0; i < 256; i += 4) {
+ for (j = 0; j < 4; j++) {
+ SDL_VideoSurface->format->palette->colors[i+j].r = 85 * j;
+ SDL_VideoSurface->format->palette->colors[i+j].g = 85 * j;
+ SDL_VideoSurface->format->palette->colors[i+j].b = 85 * j;
+ }
+ }
+ }
+ return 0;
+}
+
+static void iPod_VideoQuit (_THIS)
+{
+ ioctl (kbfd, KDSETMODE, KD_TEXT);
+ tcsetattr (kbfd, TCSAFLUSH, &old_termios);
+ old_kbmode = -1;
+
+ if (oldvt > 0)
+ ioctl (kbfd, VT_ACTIVATE, oldvt);
+
+ if (kbfd > 0)
+ close (kbfd);
+
+ if (dbgout) {
+ fprintf (dbgout, "<-- Ended SDL -->\n");
+ fclose (dbgout);
+ }
+
+ kbfd = -1;
+}
+
+static char iPod_SC_keymap[] = {
+ 0, /* 0 - no key */
+ '[' - 0x40, /* ESC (Ctrl+[) */
+ '1', '2', '3', '4', '5', '6', '7', '8', '9',
+ '-', '=',
+ '\b', '\t', /* Backspace, Tab (Ctrl+H,Ctrl+I) */
+ 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']',
+ '\n', 0, /* Enter, Left CTRL */
+ 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '`',
+ 0, '\\', /* left shift, backslash */
+ 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/',
+ 0, '*', 0, ' ', 0, /* right shift, KP mul, left alt, space, capslock */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* F1-10 */
+ 0, 0, /* numlock, scrollock */
+ '7', '8', '9', '-', '4', '5', '6', '+', '1', '2', '3', '0', '.', /* numeric keypad */
+ 0, 0, /* padding */
+ 0, 0, 0, /* "less" (?), F11, F12 */
+ 0, 0, 0, 0, 0, 0, 0, /* padding */
+ '\n', 0, '/', 0, 0, /* KP enter, Rctrl, Ctrl, KP div, PrtSc, RAlt */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, /* Break, Home, Up, PgUp, Left, Right, End, Down, PgDn */
+ 0, 0, /* Ins, Del */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* padding */
+ 0, 0, /* RWin, LWin */
+ 0 /* no key */
+};
+
+
+static void iPod_keyboard()
+{
+ unsigned char keybuf[128];
+ int i, nread;
+ SDL_keysym keysym;
+ SDL_Event ev;
+
+ keysym.mod = 0;
+ keysym.scancode = 0xff;
+ memset (&ev, 0, sizeof(SDL_Event));
+
+ nread = read (kbfd, keybuf, 128);
+ for (i = 0; i < nread; i++) {
+ char ascii = iPod_SC_keymap[keybuf[i] & 0x7f];
+
+ if (dbgout) fprintf (dbgout, "Key! %02x is %c %s", keybuf[i], ascii, (keybuf[i] & 0x80)? "up" : "down");
+
+ keysym.sym = keysym.unicode = ascii;
+ ev.type = (keybuf[i] & 0x80)? SDL_KEYUP : SDL_KEYDOWN;
+ ev.key.state = 0;
+ ev.key.keysym = keysym;
+ SDL_PushEvent (&ev);
+ }
+}
+
+static void iPod_PumpEvents (_THIS)
+{
+ fd_set fdset;
+ int max_fd = 0;
+ static struct timeval zero;
+ int posted;
+
+ do {
+ posted = 0;
+
+ FD_ZERO (&fdset);
+ if (kbfd >= 0) {
+ FD_SET (kbfd, &fdset);
+ max_fd = kbfd;
+ }
+ if (dbgout) fprintf (dbgout, "Selecting");
+ if (select (max_fd + 1, &fdset, 0, 0, &zero) > 0) {
+ if (dbgout) fprintf (dbgout, " -> match!\n");
+ iPod_keyboard();
+ posted++;
+ }
+ if (dbgout) fprintf (dbgout, "\n");
+ } while (posted);
+}
+
+// enough space for 160x128x2
+static char ipod_scr[160 * (128/4)];
+
+#define outl(datum,addr) (*(volatile unsigned long *)(addr) = (datum))
+#define inl(addr) (*(volatile unsigned long *)(addr))
+
+/*** The following LCD code is taken from Linux kernel uclinux-2.4.24-uc0-ipod2,
+ file arch/armnommu/mach-ipod/fb.c. A few modifications have been made. ***/
+
+/* get current usec counter */
+static int M_timer_get_current(void)
+{
+ return inl(lcd_rtc);
+}
+
+/* check if number of useconds has past */
+static int M_timer_check(int clock_start, int usecs)
+{
+ unsigned long clock;
+ clock = inl(lcd_rtc);
+
+ if ( (clock - clock_start) >= usecs ) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+/* wait for LCD with timeout */
+static void M_lcd_wait_write(void)
+{
+ if ( (inl(lcd_base) & 0x8000) != 0 ) {
+ int start = M_timer_get_current();
+
+ do {
+ if ( (inl(lcd_base) & (unsigned int)0x8000) == 0 )
+ break;
+ } while ( M_timer_check(start, 1000) == 0 );
+ }
+}
+
+
+/* send LCD data */
+static void M_lcd_send_data(int data_lo, int data_hi)
+{
+ M_lcd_wait_write();
+
+ outl(data_lo, lcd_base + LCD_DATA);
+
+ M_lcd_wait_write();
+
+ outl(data_hi, lcd_base + LCD_DATA);
+
+}
+
+/* send LCD command */
+static void
+M_lcd_prepare_cmd(int cmd)
+{
+ M_lcd_wait_write();
+
+ outl(0x0, lcd_base + LCD_CMD);
+
+ M_lcd_wait_write();
+
+ outl(cmd, lcd_base + LCD_CMD);
+
+}
+
+/* send LCD command and data */
+static void M_lcd_cmd_and_data(int cmd, int data_lo, int data_hi)
+{
+ M_lcd_prepare_cmd(cmd);
+
+ M_lcd_send_data(data_lo, data_hi);
+}
+
+// Copied from uW
+static void M_update_display(int sx, int sy, int mx, int my)
+{
+ int y;
+ unsigned short cursor_pos;
+
+ sx >>= 3;
+ mx >>= 3;
+
+ cursor_pos = sx + (sy << 5);
+
+ for ( y = sy; y <= my; y++ ) {
+ unsigned char *img_data;
+ int x;
+
+ /* move the cursor */
+ M_lcd_cmd_and_data(0x11, cursor_pos >> 8, cursor_pos & 0xff);
+
+ /* setup for printing */
+ M_lcd_prepare_cmd(0x12);
+
+ img_data = ipod_scr + (sx << 1) + (y * (lcd_width/4));
+
+ /* loops up to 160 times */
+ for ( x = sx; x <= mx; x++ ) {
+ /* display eight pixels */
+ M_lcd_send_data(*(img_data + 1), *img_data);
+
+ img_data += 2;
+ }
+
+ /* update cursor pos counter */
+ cursor_pos += 0x20;
+ }
+}
+
+/* get current usec counter */
+static int C_timer_get_current(void)
+{
+ return inl(0x60005010);
+}
+
+/* check if number of useconds has past */
+static int C_timer_check(int clock_start, int usecs)
+{
+ unsigned long clock;
+ clock = inl(0x60005010);
+
+ if ( (clock - clock_start) >= usecs ) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+/* wait for LCD with timeout */
+static void C_lcd_wait_write(void)
+{
+ if ((inl(0x70008A0C) & 0x80000000) != 0) {
+ int start = C_timer_get_current();
+
+ do {
+ if ((inl(0x70008A0C) & 0x80000000) == 0)
+ break;
+ } while (C_timer_check(start, 1000) == 0);
+ }
+}
+static void C_lcd_cmd_data(int cmd, int data)
+{
+ C_lcd_wait_write();
+ outl(cmd | 0x80000000, 0x70008A0C);
+
+ C_lcd_wait_write();
+ outl(data | 0x80000000, 0x70008A0C);
+}
+
+static void C_update_display(int sx, int sy, int mx, int my)
+{
+ int height = (my - sy) + 1;
+ int width = (mx - sx) + 1;
+
+ char *addr = SDL_VideoSurface->pixels;
+
+ if (width & 1) width++;
+
+ /* start X and Y */
+ C_lcd_cmd_data(0x12, (sy & 0xff));
+ C_lcd_cmd_data(0x13, (((SDL_VideoSurface->w - 1) - sx) & 0xff));
+
+ /* max X and Y */
+ C_lcd_cmd_data(0x15, (((sy + height) - 1) & 0xff));
+ C_lcd_cmd_data(0x16, (((((SDL_VideoSurface->w - 1) - sx) - width) + 1) & 0xff));
+
+ addr += sx + sy * SDL_VideoSurface->pitch;
+
+ while (height > 0) {
+ int h, x, y, pixels_to_write;
+
+ pixels_to_write = (width * height) * 2;
+
+ /* calculate how much we can do in one go */
+ h = height;
+ if (pixels_to_write > 64000) {
+ h = (64000/2) / width;
+ pixels_to_write = (width * h) * 2;
+ }
+
+ outl(0x10000080, 0x70008A20);
+ outl((pixels_to_write - 1) | 0xC0010000, 0x70008A24);
+ outl(0x34000000, 0x70008A20);
+
+ /* for each row */
+ for (x = 0; x < h; x++)
+ {
+ /* for each column */
+ for (y = 0; y < width; y += 2) {
+ unsigned two_pixels;
+
+ two_pixels = addr[0] | (addr[1] << 16);
+ addr += 2;
+
+ while ((inl(0x70008A20) & 0x1000000) == 0);
+
+ /* output 2 pixels */
+ outl(two_pixels, 0x70008B00);
+ }
+
+ addr += SDL_VideoSurface->w - width;
+ }
+
+ while ((inl(0x70008A20) & 0x4000000) == 0);
+
+ outl(0x0, 0x70008A24);
+
+ height = height - h;
+ }
+}
+
+// Should work with photo. However, I don't have one, so I'm not sure.
+static void iPod_UpdateRects (_THIS, int nrects, SDL_Rect *rects)
+{
+ if (SDL_VideoSurface->format->BitsPerPixel == 16) {
+ C_update_display (0, 0, lcd_width, lcd_height);
+ } else {
+ int i, y, x;
+ for (i = 0; i < nrects; i++) {
+ SDL_Rect *r = rects + i;
+ if (!r) {
+ continue;
+ }
+
+ for (y = r->y; (y < r->y + r->h) && y < lcd_height; y++) {
+ for (x = r->x; (x < r->x + r->w) && x < lcd_width; x++) {
+ ipod_scr[y*(lcd_width/4) + x/4] &= ~(3 << (2 * (x%4)));
+ ipod_scr[y*(lcd_width/4) + x/4] |=
+ (((Uint8*)(SDL_VideoSurface->pixels))[ y*SDL_VideoSurface->pitch + x ] & 3) << (2 * (x%4));
+ }
+ }
+ }
+
+ M_update_display (0, 0, lcd_width, lcd_height);
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/ipod/SDL_ipodvideo.h b/distrib/sdl-1.2.15/src/video/ipod/SDL_ipodvideo.h
new file mode 100644
index 0000000..921eee8
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ipod/SDL_ipodvideo.h
@@ -0,0 +1,38 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* iPod SDL framebuffer driver
+ * Joshua Oreman
+ * Main header file
+ */
+
+#ifndef _SDL_ipodvideo_h
+#define _SDL_ipodvideo_h
+
+struct SDL_PrivateVideoData {
+ char *buffer;
+ int w, h;
+};
+
+
+#endif
diff --git a/distrib/sdl-1.2.15/src/video/maccommon/SDL_lowvideo.h b/distrib/sdl-1.2.15/src/video/maccommon/SDL_lowvideo.h
new file mode 100644
index 0000000..f3dac29
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/maccommon/SDL_lowvideo.h
@@ -0,0 +1,102 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_lowvideo_h
+#define _SDL_lowvideo_h
+
+#if defined(__APPLE__) && defined(__MACH__)
+#include <Carbon/Carbon.h>
+#elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335)
+#include <Carbon.h>
+#else
+#include <Quickdraw.h>
+#include <Palettes.h>
+#include <Menus.h>
+#include <DrawSprocket.h>
+#endif
+
+#if SDL_VIDEO_OPENGL
+typedef struct __AGLContextRec *AGLContext;
+#endif
+
+#include "SDL_video.h"
+#include "../SDL_sysvideo.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+#if !TARGET_API_MAC_CARBON /* not available in OS X (or more accurately, Carbon) */
+/* Global QuickDraw data */
+extern QDGlobals *theQD;
+#endif
+
+/* Private display data */
+struct SDL_PrivateVideoData {
+ GDevice **SDL_Display;
+ WindowRef SDL_Window;
+ SDL_Rect **SDL_modelist;
+ CTabHandle SDL_CTab;
+ PaletteHandle SDL_CPal;
+
+#if TARGET_API_MAC_CARBON
+ /* For entering and leaving fullscreen mode */
+ Ptr fullscreen_ctx;
+#endif
+
+ /* The current window document style */
+ int current_style;
+
+ /* Information about the last cursor position */
+ Point last_where;
+
+ /* Information about the last keys down */
+ EventModifiers last_mods;
+ KeyMap last_keys;
+
+ /* A handle to the Apple Menu */
+ MenuRef apple_menu;
+
+ /* Information used by DrawSprocket driver */
+ struct DSpInfo *dspinfo;
+
+#if SDL_VIDEO_OPENGL
+ AGLContext appleGLContext;
+
+ void *libraryHandle;
+#endif
+};
+/* Old variable names */
+#define SDL_Display (this->hidden->SDL_Display)
+#define SDL_Window (this->hidden->SDL_Window)
+#define SDL_modelist (this->hidden->SDL_modelist)
+#define SDL_CTab (this->hidden->SDL_CTab)
+#define SDL_CPal (this->hidden->SDL_CPal)
+#define fullscreen_ctx (this->hidden->fullscreen_ctx)
+#define current_style (this->hidden->current_style)
+#define last_where (this->hidden->last_where)
+#define last_mods (this->hidden->last_mods)
+#define last_keys (this->hidden->last_keys)
+#define apple_menu (this->hidden->apple_menu)
+#define glContext (this->hidden->appleGLContext)
+
+#endif /* _SDL_lowvideo_h */
diff --git a/distrib/sdl-1.2.15/src/video/maccommon/SDL_macevents.c b/distrib/sdl-1.2.15/src/video/maccommon/SDL_macevents.c
new file mode 100644
index 0000000..6e3fef2
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/maccommon/SDL_macevents.c
@@ -0,0 +1,746 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <stdio.h>
+
+#if defined(__APPLE__) && defined(__MACH__)
+#include <Carbon/Carbon.h>
+#elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335)
+#include <Carbon.h>
+#else
+#include <Script.h>
+#include <LowMem.h>
+#include <Devices.h>
+#include <DiskInit.h>
+#include <ToolUtils.h>
+#endif
+
+#include "SDL_events.h"
+#include "SDL_video.h"
+#include "SDL_syswm.h"
+#include "../../events/SDL_events_c.h"
+#include "../../events/SDL_sysevents.h"
+#include "../SDL_cursor_c.h"
+#include "SDL_macevents_c.h"
+#include "SDL_mackeys.h"
+#include "SDL_macmouse_c.h"
+
+/* Define this to be able to collapse SDL windows.
+#define USE_APPEARANCE_MANAGER
+ */
+
+/* Macintosh resource constants */
+#define mApple 128 /* Apple menu resource */
+#define iAbout 1 /* About menu item */
+
+/* Functions to handle the About menu */
+static void Mac_DoAppleMenu(_THIS, long item);
+
+/* The translation table from a macintosh key scancode to a SDL keysym */
+static SDLKey MAC_keymap[256];
+static SDL_keysym *TranslateKey(int scancode, int modifiers,
+ SDL_keysym *keysym, int pressed);
+
+/* Handle activation and deactivation -- returns whether an event was posted */
+static int Mac_HandleActivate(int activate)
+{
+ if ( activate ) {
+ /* Show the current SDL application cursor */
+ SDL_SetCursor(NULL);
+
+ /* put our mask back case it changed during context switch */
+ SetEventMask(everyEvent & ~autoKeyMask);
+ } else {
+#if TARGET_API_MAC_CARBON
+ { Cursor cursor;
+ SetCursor(GetQDGlobalsArrow(&cursor));
+ }
+#else
+ SetCursor(&theQD->arrow);
+#endif
+ if ( ! Mac_cursor_showing ) {
+ ShowCursor();
+ Mac_cursor_showing = 1;
+ }
+ }
+ return(SDL_PrivateAppActive(activate, SDL_APPINPUTFOCUS));
+}
+
+static void myGlobalToLocal(_THIS, Point *pt)
+{
+ if ( SDL_VideoSurface && !(SDL_VideoSurface->flags&SDL_FULLSCREEN) ) {
+ GrafPtr saveport;
+ GetPort(&saveport);
+#if TARGET_API_MAC_CARBON
+ SetPort(GetWindowPort(SDL_Window));
+#else
+ SetPort(SDL_Window);
+#endif
+ GlobalToLocal(pt);
+ SetPort(saveport);
+ }
+}
+
+/* The main MacOS event handler */
+static int Mac_HandleEvents(_THIS, int wait4it)
+{
+ static int mouse_button = 1;
+ int i;
+ EventRecord event;
+
+#if TARGET_API_MAC_CARBON
+ /* There's no GetOSEvent() in the Carbon API. *sigh* */
+#define cooperative_multitasking 1
+#else
+ int cooperative_multitasking;
+ /* If we're running fullscreen, we can hog the MacOS events,
+ otherwise we had better play nicely with the other apps.
+ */
+ if ( this->screen && (this->screen->flags & SDL_FULLSCREEN) ) {
+ cooperative_multitasking = 0;
+ } else {
+ cooperative_multitasking = 1;
+ }
+#endif
+
+ /* If we call WaitNextEvent(), MacOS will check other processes
+ * and allow them to run, and perform other high-level processing.
+ */
+ if ( cooperative_multitasking || wait4it ) {
+ UInt32 wait_time;
+
+ /* Are we polling or not? */
+ if ( wait4it ) {
+ wait_time = 2147483647;
+ } else {
+ wait_time = 0;
+ }
+ WaitNextEvent(everyEvent, &event, wait_time, nil);
+ } else {
+#if ! TARGET_API_MAC_CARBON
+ GetOSEvent(everyEvent, &event);
+#endif
+ }
+
+#if TARGET_API_MAC_CARBON
+ /* for some reason, event.where isn't set ? */
+ GetGlobalMouse ( &event.where );
+#endif
+
+ /* Check for mouse motion */
+ if ( (event.where.h != last_where.h) ||
+ (event.where.v != last_where.v) ) {
+ Point pt;
+ pt = last_where = event.where;
+ myGlobalToLocal(this, &pt);
+ SDL_PrivateMouseMotion(0, 0, pt.h, pt.v);
+ }
+
+ /* Check the current state of the keyboard */
+ if ( SDL_GetAppState() & SDL_APPINPUTFOCUS ) {
+ KeyMap keys;
+ const Uint32 *keysptr = (Uint32 *) &keys;
+ const Uint32 *last_keysptr = (Uint32 *) &last_keys;
+
+ /* Check for special non-event keys */
+ if ( event.modifiers != last_mods ) {
+ static struct {
+ EventModifiers mask;
+ SDLKey key;
+ } mods[] = {
+ { alphaLock, SDLK_CAPSLOCK },
+#if 0 /* These are handled below in the GetKeys() code */
+ { cmdKey, SDLK_LMETA },
+ { shiftKey, SDLK_LSHIFT },
+ { rightShiftKey, SDLK_RSHIFT },
+ { optionKey, SDLK_LALT },
+ { rightOptionKey, SDLK_RALT },
+ { controlKey, SDLK_LCTRL },
+ { rightControlKey, SDLK_RCTRL },
+#endif /* 0 */
+ { 0, 0 }
+ };
+ SDL_keysym keysym;
+ Uint8 mode;
+ EventModifiers mod, mask;
+
+
+ /* Set up the keyboard event */
+ keysym.scancode = 0;
+ keysym.sym = SDLK_UNKNOWN;
+ keysym.mod = KMOD_NONE;
+ keysym.unicode = 0;
+
+ /* See what has changed, and generate events */
+ mod = event.modifiers;
+ for ( i=0; mods[i].mask; ++i ) {
+ mask = mods[i].mask;
+ if ( (mod&mask) != (last_mods&mask) ) {
+ keysym.sym = mods[i].key;
+ if ( (mod&mask) ||
+ (mods[i].key == SDLK_CAPSLOCK) ) {
+ mode = SDL_PRESSED;
+ } else {
+ mode = SDL_RELEASED;
+ }
+ SDL_PrivateKeyboard(mode, &keysym);
+ }
+ }
+
+ /* Save state for next time */
+ last_mods = mod;
+ }
+
+ /* Check for normal event keys, but we have to scan the
+ actual keyboard state because on Mac OS X a keydown event
+ is immediately followed by a keyup event.
+ */
+ GetKeys(keys);
+ if ( (keysptr[0] != last_keysptr[0]) ||
+ (keysptr[1] != last_keysptr[1]) ||
+ (keysptr[2] != last_keysptr[2]) ||
+ (keysptr[3] != last_keysptr[3]) ) {
+ SDL_keysym keysym;
+ int old_bit, new_bit;
+
+#ifdef DEBUG_KEYBOARD
+ fprintf(sterr, "New keys: 0x%x 0x%x 0x%x 0x%x\n",
+ new_keys[0], new_keys[1],
+ new_keys[2], new_keys[3]);
+#endif
+ for ( i=0; i<128; ++i ) {
+ old_bit = (((Uint8 *)last_keys)[i/8]>>(i%8)) & 0x01;
+ new_bit = (((Uint8 *)keys)[i/8]>>(i%8)) & 0x01;
+ if ( old_bit != new_bit ) {
+ /* Post the keyboard event */
+#ifdef DEBUG_KEYBOARD
+ fprintf(stderr,"Scancode: 0x%2.2X\n",i);
+#endif
+ SDL_PrivateKeyboard(new_bit,
+ TranslateKey(i, event.modifiers,
+ &keysym, new_bit));
+ }
+ }
+
+ /* Save state for next time */
+ last_keys[0] = keys[0];
+ last_keys[1] = keys[1];
+ last_keys[2] = keys[2];
+ last_keys[3] = keys[3];
+ }
+ }
+
+ /* Handle normal events */
+ switch (event.what) {
+ case mouseDown: {
+ WindowRef win;
+ short area;
+
+ area = FindWindow(event.where, &win);
+ /* Support switching between the SIOUX console
+ and SDL_Window by clicking in the window.
+ */
+ if ( win && (win != FrontWindow()) ) {
+ SelectWindow(win);
+ }
+ switch (area) {
+ case inMenuBar: /* Only the apple menu exists */
+ Mac_DoAppleMenu(this, MenuSelect(event.where));
+ HiliteMenu(0);
+ break;
+ case inDrag:
+#if TARGET_API_MAC_CARBON
+ DragWindow(win, event.where, NULL);
+#else
+ DragWindow(win, event.where, &theQD->screenBits.bounds);
+#endif
+ break;
+ case inGoAway:
+ if ( TrackGoAway(win, event.where) ) {
+ SDL_PrivateQuit();
+ }
+ break;
+ case inContent:
+ myGlobalToLocal(this, &event.where);
+ /* Treat command-click as right mouse button */
+ if ( event.modifiers & optionKey ) {
+ mouse_button = 2;
+ } else if ( event.modifiers & cmdKey ) {
+ mouse_button = 3;
+ } else {
+ mouse_button = 1;
+ }
+ SDL_PrivateMouseButton(SDL_PRESSED,
+ mouse_button, event.where.h, event.where.v);
+ break;
+ case inGrow: {
+ int newSize;
+
+ /* Don't allow resize if video mode isn't resizable */
+ if ( ! SDL_PublicSurface ||
+ ! (SDL_PublicSurface->flags & SDL_RESIZABLE) ) {
+ break;
+ }
+#if TARGET_API_MAC_CARBON
+ newSize = GrowWindow(win, event.where, NULL);
+#else
+ newSize = GrowWindow(win, event.where, &theQD->screenBits.bounds);
+#endif
+ if ( newSize ) {
+#if !TARGET_API_MAC_CARBON
+ EraseRect ( &theQD->screenBits.bounds );
+#endif
+ SizeWindow ( win, LoWord (newSize), HiWord (newSize), 1 );
+ SDL_PrivateResize ( LoWord (newSize), HiWord (newSize) );
+ }
+ } break;
+ case inZoomIn:
+ case inZoomOut:
+ if ( TrackBox (win, event.where, area )) {
+ Rect rect;
+#if !TARGET_API_MAC_CARBON
+ EraseRect ( &theQD->screenBits.bounds );
+#endif
+ ZoomWindow ( win, area, 0);
+ if ( area == inZoomIn ) {
+ GetWindowUserState(SDL_Window, &rect);
+ } else {
+ GetWindowStandardState(SDL_Window, &rect);
+ }
+ SDL_PrivateResize (rect.right-rect.left,
+ rect.bottom-rect.top);
+ }
+ break;
+#if TARGET_API_MAC_CARBON
+ case inCollapseBox:
+ if ( TrackBox (win, event.where, area )) {
+ if ( IsWindowCollapsable(win) ) {
+ CollapseWindow (win, !IsWindowCollapsed(win));
+ /* There should be something done like in inGrow case, but... */
+ }
+ }
+ break;
+#endif /* TARGET_API_MAC_CARBON */
+ case inSysWindow:
+#if TARGET_API_MAC_CARBON
+ /* Never happens in Carbon? */
+#else
+ SystemClick(&event, win);
+#endif
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+ case mouseUp: {
+ myGlobalToLocal(this, &event.where);
+ /* Release the mouse button we simulated in the last press.
+ The drawback of this methos is we cannot press more than
+ one button. However, this doesn't matter, since there is
+ only a single logical mouse button, even if you have a
+ multi-button mouse, this doesn't matter at all.
+ */
+ SDL_PrivateMouseButton(SDL_RELEASED,
+ mouse_button, event.where.h, event.where.v);
+ }
+ break;
+#if 0 /* Handled above the switch statement */
+ case keyDown: {
+ SDL_keysym keysym;
+
+ SDL_PrivateKeyboard(SDL_PRESSED,
+ TranslateKey((event.message&keyCodeMask)>>8
+ event.modifiers, &keysym, 1));
+ }
+ break;
+ case keyUp: {
+ SDL_keysym keysym;
+
+ SDL_PrivateKeyboard(SDL_RELEASED,
+ TranslateKey((event.message&keyCodeMask)>>8
+ event.modifiers, &keysym, 0));
+ }
+ break;
+#endif
+ case updateEvt: {
+ BeginUpdate(SDL_Window);
+ #if SDL_VIDEO_OPENGL
+ if (SDL_VideoSurface->flags & SDL_OPENGL)
+ SDL_GL_SwapBuffers();
+ else
+ #endif
+ if ( (SDL_VideoSurface->flags & SDL_HWSURFACE) ==
+ SDL_SWSURFACE ) {
+ SDL_UpdateRect(SDL_VideoSurface, 0, 0, 0, 0);
+ }
+ EndUpdate(SDL_Window);
+ }
+ /* If this was an update event for the SIOUX console, we return 0
+ in order to stop an endless series of updates being triggered.
+ */
+ if ( (WindowRef) event.message != SDL_Window ) {
+ return 0;
+ }
+ break;
+ case activateEvt: {
+ Mac_HandleActivate(!!(event.modifiers & activeFlag));
+ }
+ break;
+ case diskEvt: {
+#if TARGET_API_MAC_CARBON
+ /* What are we supposed to do? */;
+#else
+ if ( ((event.message>>16)&0xFFFF) != noErr ) {
+ Point spot;
+ SetPt(&spot, 0x0070, 0x0050);
+ DIBadMount(spot, event.message);
+ }
+#endif
+ }
+ break;
+ case osEvt: {
+ switch ((event.message>>24) & 0xFF) {
+#if 0 /* Handled above the switch statement */
+ case mouseMovedMessage: {
+ myGlobalToLocal(this, &event.where);
+ SDL_PrivateMouseMotion(0, 0,
+ event.where.h, event.where.v);
+ }
+ break;
+#endif /* 0 */
+ case suspendResumeMessage: {
+ Mac_HandleActivate(!!(event.message & resumeFlag));
+ }
+ break;
+ }
+ }
+ break;
+ default: {
+ ;
+ }
+ break;
+ }
+ return (event.what != nullEvent);
+}
+
+
+void Mac_PumpEvents(_THIS)
+{
+ /* Process pending MacOS events */
+ while ( Mac_HandleEvents(this, 0) ) {
+ /* Loop and check again */;
+ }
+}
+
+void Mac_InitOSKeymap(_THIS)
+{
+ const void *KCHRPtr;
+ UInt32 state;
+ UInt32 value;
+ int i;
+ int world = SDLK_WORLD_0;
+
+ /* Map the MAC keysyms */
+ for ( i=0; i<SDL_arraysize(MAC_keymap); ++i )
+ MAC_keymap[i] = SDLK_UNKNOWN;
+
+ /* Defined MAC_* constants */
+ MAC_keymap[MK_ESCAPE] = SDLK_ESCAPE;
+ MAC_keymap[MK_F1] = SDLK_F1;
+ MAC_keymap[MK_F2] = SDLK_F2;
+ MAC_keymap[MK_F3] = SDLK_F3;
+ MAC_keymap[MK_F4] = SDLK_F4;
+ MAC_keymap[MK_F5] = SDLK_F5;
+ MAC_keymap[MK_F6] = SDLK_F6;
+ MAC_keymap[MK_F7] = SDLK_F7;
+ MAC_keymap[MK_F8] = SDLK_F8;
+ MAC_keymap[MK_F9] = SDLK_F9;
+ MAC_keymap[MK_F10] = SDLK_F10;
+ MAC_keymap[MK_F11] = SDLK_F11;
+ MAC_keymap[MK_F12] = SDLK_F12;
+ MAC_keymap[MK_PRINT] = SDLK_PRINT;
+ MAC_keymap[MK_SCROLLOCK] = SDLK_SCROLLOCK;
+ MAC_keymap[MK_PAUSE] = SDLK_PAUSE;
+ MAC_keymap[MK_POWER] = SDLK_POWER;
+ MAC_keymap[MK_BACKQUOTE] = SDLK_BACKQUOTE;
+ MAC_keymap[MK_1] = SDLK_1;
+ MAC_keymap[MK_2] = SDLK_2;
+ MAC_keymap[MK_3] = SDLK_3;
+ MAC_keymap[MK_4] = SDLK_4;
+ MAC_keymap[MK_5] = SDLK_5;
+ MAC_keymap[MK_6] = SDLK_6;
+ MAC_keymap[MK_7] = SDLK_7;
+ MAC_keymap[MK_8] = SDLK_8;
+ MAC_keymap[MK_9] = SDLK_9;
+ MAC_keymap[MK_0] = SDLK_0;
+ MAC_keymap[MK_MINUS] = SDLK_MINUS;
+ MAC_keymap[MK_EQUALS] = SDLK_EQUALS;
+ MAC_keymap[MK_BACKSPACE] = SDLK_BACKSPACE;
+ MAC_keymap[MK_INSERT] = SDLK_INSERT;
+ MAC_keymap[MK_HOME] = SDLK_HOME;
+ MAC_keymap[MK_PAGEUP] = SDLK_PAGEUP;
+ MAC_keymap[MK_NUMLOCK] = SDLK_NUMLOCK;
+ MAC_keymap[MK_KP_EQUALS] = SDLK_KP_EQUALS;
+ MAC_keymap[MK_KP_DIVIDE] = SDLK_KP_DIVIDE;
+ MAC_keymap[MK_KP_MULTIPLY] = SDLK_KP_MULTIPLY;
+ MAC_keymap[MK_TAB] = SDLK_TAB;
+ MAC_keymap[MK_q] = SDLK_q;
+ MAC_keymap[MK_w] = SDLK_w;
+ MAC_keymap[MK_e] = SDLK_e;
+ MAC_keymap[MK_r] = SDLK_r;
+ MAC_keymap[MK_t] = SDLK_t;
+ MAC_keymap[MK_y] = SDLK_y;
+ MAC_keymap[MK_u] = SDLK_u;
+ MAC_keymap[MK_i] = SDLK_i;
+ MAC_keymap[MK_o] = SDLK_o;
+ MAC_keymap[MK_p] = SDLK_p;
+ MAC_keymap[MK_LEFTBRACKET] = SDLK_LEFTBRACKET;
+ MAC_keymap[MK_RIGHTBRACKET] = SDLK_RIGHTBRACKET;
+ MAC_keymap[MK_BACKSLASH] = SDLK_BACKSLASH;
+ MAC_keymap[MK_DELETE] = SDLK_DELETE;
+ MAC_keymap[MK_END] = SDLK_END;
+ MAC_keymap[MK_PAGEDOWN] = SDLK_PAGEDOWN;
+ MAC_keymap[MK_KP7] = SDLK_KP7;
+ MAC_keymap[MK_KP8] = SDLK_KP8;
+ MAC_keymap[MK_KP9] = SDLK_KP9;
+ MAC_keymap[MK_KP_MINUS] = SDLK_KP_MINUS;
+ MAC_keymap[MK_CAPSLOCK] = SDLK_CAPSLOCK;
+ MAC_keymap[MK_a] = SDLK_a;
+ MAC_keymap[MK_s] = SDLK_s;
+ MAC_keymap[MK_d] = SDLK_d;
+ MAC_keymap[MK_f] = SDLK_f;
+ MAC_keymap[MK_g] = SDLK_g;
+ MAC_keymap[MK_h] = SDLK_h;
+ MAC_keymap[MK_j] = SDLK_j;
+ MAC_keymap[MK_k] = SDLK_k;
+ MAC_keymap[MK_l] = SDLK_l;
+ MAC_keymap[MK_SEMICOLON] = SDLK_SEMICOLON;
+ MAC_keymap[MK_QUOTE] = SDLK_QUOTE;
+ MAC_keymap[MK_RETURN] = SDLK_RETURN;
+ MAC_keymap[MK_KP4] = SDLK_KP4;
+ MAC_keymap[MK_KP5] = SDLK_KP5;
+ MAC_keymap[MK_KP6] = SDLK_KP6;
+ MAC_keymap[MK_KP_PLUS] = SDLK_KP_PLUS;
+ MAC_keymap[MK_LSHIFT] = SDLK_LSHIFT;
+ MAC_keymap[MK_z] = SDLK_z;
+ MAC_keymap[MK_x] = SDLK_x;
+ MAC_keymap[MK_c] = SDLK_c;
+ MAC_keymap[MK_v] = SDLK_v;
+ MAC_keymap[MK_b] = SDLK_b;
+ MAC_keymap[MK_n] = SDLK_n;
+ MAC_keymap[MK_m] = SDLK_m;
+ MAC_keymap[MK_COMMA] = SDLK_COMMA;
+ MAC_keymap[MK_PERIOD] = SDLK_PERIOD;
+ MAC_keymap[MK_SLASH] = SDLK_SLASH;
+#if 0 /* These are the same as the left versions - use left by default */
+ MAC_keymap[MK_RSHIFT] = SDLK_RSHIFT;
+#endif
+ MAC_keymap[MK_UP] = SDLK_UP;
+ MAC_keymap[MK_KP1] = SDLK_KP1;
+ MAC_keymap[MK_KP2] = SDLK_KP2;
+ MAC_keymap[MK_KP3] = SDLK_KP3;
+ MAC_keymap[MK_KP_ENTER] = SDLK_KP_ENTER;
+ MAC_keymap[MK_LCTRL] = SDLK_LCTRL;
+ MAC_keymap[MK_LALT] = SDLK_LALT;
+ MAC_keymap[MK_LMETA] = SDLK_LMETA;
+ MAC_keymap[MK_SPACE] = SDLK_SPACE;
+#if 0 /* These are the same as the left versions - use left by default */
+ MAC_keymap[MK_RMETA] = SDLK_RMETA;
+ MAC_keymap[MK_RALT] = SDLK_RALT;
+ MAC_keymap[MK_RCTRL] = SDLK_RCTRL;
+#endif
+ MAC_keymap[MK_LEFT] = SDLK_LEFT;
+ MAC_keymap[MK_DOWN] = SDLK_DOWN;
+ MAC_keymap[MK_RIGHT] = SDLK_RIGHT;
+ MAC_keymap[MK_KP0] = SDLK_KP0;
+ MAC_keymap[MK_KP_PERIOD] = SDLK_KP_PERIOD;
+
+#if defined(__APPLE__) && defined(__MACH__)
+ /* Wierd, these keys are on my iBook under Mac OS X
+ Note that the left arrow keysym is the same as left ctrl!?
+ */
+ MAC_keymap[MK_IBOOK_ENTER] = SDLK_KP_ENTER;
+ MAC_keymap[MK_IBOOK_RIGHT] = SDLK_RIGHT;
+ MAC_keymap[MK_IBOOK_DOWN] = SDLK_DOWN;
+ MAC_keymap[MK_IBOOK_UP] = SDLK_UP;
+ MAC_keymap[MK_IBOOK_LEFT] = SDLK_LEFT;
+#endif /* Mac OS X */
+
+ /* Up there we setup a static scancode->keysym map. However, it will not
+ * work very well on international keyboard. Hence we now query MacOS
+ * for its own keymap to adjust our own mapping table. However, this is
+ * bascially only useful for ascii char keys. This is also the reason
+ * why we keep the static table, too.
+ */
+
+ /* Get a pointer to the systems cached KCHR */
+ KCHRPtr = (void *)GetScriptManagerVariable(smKCHRCache);
+ if (KCHRPtr)
+ {
+ /* Loop over all 127 possible scan codes */
+ for (i = 0; i < 0x7F; i++)
+ {
+ /* We pretend a clean start to begin with (i.e. no dead keys active */
+ state = 0;
+
+ /* Now translate the key code to a key value */
+ value = KeyTranslate(KCHRPtr, i, &state) & 0xff;
+
+ /* If the state become 0, it was a dead key. We need to translate again,
+ passing in the new state, to get the actual key value */
+ if (state != 0)
+ value = KeyTranslate(KCHRPtr, i, &state) & 0xff;
+
+ /* Now we should have an ascii value, or 0. Try to figure out to which SDL symbol it maps */
+ if (value >= 128) /* Some non-ASCII char, map it to SDLK_WORLD_* */
+ MAC_keymap[i] = world++;
+ else if (value >= 32) /* non-control ASCII char */
+ MAC_keymap[i] = value;
+ }
+ }
+
+ /* The keypad codes are re-setup here, because the loop above cannot
+ * distinguish between a key on the keypad and a regular key. We maybe
+ * could get around this problem in another fashion: NSEvent's flags
+ * include a "NSNumericPadKeyMask" bit; we could check that and modify
+ * the symbol we return on the fly. However, this flag seems to exhibit
+ * some weird behaviour related to the num lock key
+ */
+ MAC_keymap[MK_KP0] = SDLK_KP0;
+ MAC_keymap[MK_KP1] = SDLK_KP1;
+ MAC_keymap[MK_KP2] = SDLK_KP2;
+ MAC_keymap[MK_KP3] = SDLK_KP3;
+ MAC_keymap[MK_KP4] = SDLK_KP4;
+ MAC_keymap[MK_KP5] = SDLK_KP5;
+ MAC_keymap[MK_KP6] = SDLK_KP6;
+ MAC_keymap[MK_KP7] = SDLK_KP7;
+ MAC_keymap[MK_KP8] = SDLK_KP8;
+ MAC_keymap[MK_KP9] = SDLK_KP9;
+ MAC_keymap[MK_KP_MINUS] = SDLK_KP_MINUS;
+ MAC_keymap[MK_KP_PLUS] = SDLK_KP_PLUS;
+ MAC_keymap[MK_KP_PERIOD] = SDLK_KP_PERIOD;
+ MAC_keymap[MK_KP_EQUALS] = SDLK_KP_EQUALS;
+ MAC_keymap[MK_KP_DIVIDE] = SDLK_KP_DIVIDE;
+ MAC_keymap[MK_KP_MULTIPLY] = SDLK_KP_MULTIPLY;
+ MAC_keymap[MK_KP_ENTER] = SDLK_KP_ENTER;
+}
+
+static SDL_keysym *TranslateKey(int scancode, int modifiers,
+ SDL_keysym *keysym, int pressed)
+{
+ /* Set the keysym information */
+ keysym->scancode = scancode;
+ keysym->sym = MAC_keymap[keysym->scancode];
+ keysym->mod = KMOD_NONE;
+ keysym->unicode = 0;
+ if ( pressed && SDL_TranslateUNICODE ) {
+ static unsigned long state = 0;
+ static Ptr keymap = nil;
+ Ptr new_keymap;
+
+ /* Get the current keyboard map resource */
+ new_keymap = (Ptr)GetScriptManagerVariable(smKCHRCache);
+ if ( new_keymap != keymap ) {
+ keymap = new_keymap;
+ state = 0;
+ }
+ keysym->unicode = KeyTranslate(keymap,
+ keysym->scancode|modifiers, &state) & 0xFFFF;
+ }
+ return(keysym);
+}
+
+void Mac_InitEvents(_THIS)
+{
+ /* Create apple menu bar */
+ apple_menu = GetMenu(mApple);
+ if ( apple_menu != nil ) {
+ AppendResMenu(apple_menu, 'DRVR');
+ InsertMenu(apple_menu, 0);
+ }
+ DrawMenuBar();
+
+ /* Get rid of spurious events at startup */
+ FlushEvents(everyEvent, 0);
+
+ /* Allow every event but keyrepeat */
+ SetEventMask(everyEvent & ~autoKeyMask);
+}
+
+void Mac_QuitEvents(_THIS)
+{
+ ClearMenuBar();
+ if ( apple_menu != nil ) {
+ ReleaseResource((char **)apple_menu);
+ }
+
+ /* Clean up pending events */
+ FlushEvents(everyEvent, 0);
+}
+
+static void Mac_DoAppleMenu(_THIS, long choice)
+{
+#if !TARGET_API_MAC_CARBON /* No Apple menu in OS X */
+ short menu, item;
+
+ item = (choice&0xFFFF);
+ choice >>= 16;
+ menu = (choice&0xFFFF);
+
+ switch (menu) {
+ case mApple: {
+ switch (item) {
+ case iAbout: {
+ /* Run the about box */;
+ }
+ break;
+ default: {
+ Str255 name;
+
+ GetMenuItemText(apple_menu, item, name);
+ OpenDeskAcc(name);
+ }
+ break;
+ }
+ }
+ break;
+ default: {
+ /* Ignore other menus */;
+ }
+ }
+#endif /* !TARGET_API_MAC_CARBON */
+}
+
+#if !TARGET_API_MAC_CARBON
+/* Since we don't initialize QuickDraw, we need to get a pointer to qd */
+struct QDGlobals *theQD = NULL;
+#endif
+
+/* Exported to the macmain code */
+void SDL_InitQuickDraw(struct QDGlobals *the_qd)
+{
+#if !TARGET_API_MAC_CARBON
+ theQD = the_qd;
+#endif
+}
diff --git a/distrib/sdl-1.2.15/src/video/maccommon/SDL_macevents_c.h b/distrib/sdl-1.2.15/src/video/maccommon/SDL_macevents_c.h
new file mode 100644
index 0000000..f9a983b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/maccommon/SDL_macevents_c.h
@@ -0,0 +1,32 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "../macrom/SDL_romvideo.h"
+
+/* Functions exported by SDL_macevents.c for the video subsystem
+*/
+extern void Mac_InitEvents(_THIS);
+extern void Mac_QuitEvents(_THIS);
+
+extern void Mac_InitOSKeymap(_THIS);
+extern void Mac_PumpEvents(_THIS);
diff --git a/distrib/sdl-1.2.15/src/video/maccommon/SDL_macgl.c b/distrib/sdl-1.2.15/src/video/maccommon/SDL_macgl.c
new file mode 100644
index 0000000..b7ded9b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/maccommon/SDL_macgl.c
@@ -0,0 +1,197 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* AGL implementation of SDL OpenGL support */
+
+#include "SDL_lowvideo.h"
+#include "SDL_macgl_c.h"
+#include "SDL_loadso.h"
+
+
+/* krat: adding OpenGL support */
+int Mac_GL_Init(_THIS)
+{
+#if SDL_VIDEO_OPENGL
+ AGLPixelFormat format;
+ int i = 0;
+ GLint attributes [ 26 ]; /* 26 is max possible in this setup */
+ GLboolean noerr;
+
+ /* load the gl driver from a default path */
+ if ( ! this->gl_config.driver_loaded ) {
+ /* no driver has been loaded, use default (ourselves) */
+ if ( Mac_GL_LoadLibrary(this, NULL) < 0 ) {
+ return(-1);
+ }
+ }
+
+ attributes[i++] = AGL_RGBA;
+ if ( this->gl_config.red_size != 0 &&
+ this->gl_config.blue_size != 0 &&
+ this->gl_config.green_size != 0 ) {
+ attributes[i++] = AGL_RED_SIZE;
+ attributes[i++] = this->gl_config.red_size;
+ attributes[i++] = AGL_GREEN_SIZE;
+ attributes[i++] = this->gl_config.green_size;
+ attributes[i++] = AGL_BLUE_SIZE;
+ attributes[i++] = this->gl_config.blue_size;
+ attributes[i++] = AGL_ALPHA_SIZE;
+ attributes[i++] = this->gl_config.alpha_size;
+ }
+ if ( this->gl_config.double_buffer ) {
+ attributes[i++] = AGL_DOUBLEBUFFER;
+ }
+ if ( this->gl_config.depth_size != 0 ) {
+ attributes[i++] = AGL_DEPTH_SIZE;
+ attributes[i++] = this->gl_config.depth_size;
+ }
+ if ( this->gl_config.stencil_size != 0 ) {
+ attributes[i++] = AGL_STENCIL_SIZE;
+ attributes[i++] = this->gl_config.stencil_size;
+ }
+ if ( this->gl_config.accum_red_size != 0 &&
+ this->gl_config.accum_blue_size != 0 &&
+ this->gl_config.accum_green_size != 0 ) {
+
+ attributes[i++] = AGL_ACCUM_RED_SIZE;
+ attributes[i++] = this->gl_config.accum_red_size;
+ attributes[i++] = AGL_ACCUM_GREEN_SIZE;
+ attributes[i++] = this->gl_config.accum_green_size;
+ attributes[i++] = AGL_ACCUM_BLUE_SIZE;
+ attributes[i++] = this->gl_config.accum_blue_size;
+ attributes[i++] = AGL_ACCUM_ALPHA_SIZE;
+ attributes[i++] = this->gl_config.accum_alpha_size;
+ }
+ if ( this->gl_config.stereo ) {
+ attributes[i++] = AGL_STEREO;
+ }
+#if defined(AGL_SAMPLE_BUFFERS_ARB) && defined(AGL_SAMPLES_ARB)
+ if ( this->gl_config.multisamplebuffers != 0 ) {
+ attributes[i++] = AGL_SAMPLE_BUFFERS_ARB;
+ attributes[i++] = this->gl_config.multisamplebuffers;
+ }
+ if ( this->gl_config.multisamplesamples != 0 ) {
+ attributes[i++] = AGL_SAMPLES_ARB;
+ attributes[i++] = this->gl_config.multisamplesamples;
+ }
+#endif
+ if ( this->gl_config.accelerated > 0 ) {
+ attributes[i++] = AGL_ACCELERATED;
+ attributes[i++] = AGL_NO_RECOVERY;
+ }
+
+ attributes[i++] = AGL_ALL_RENDERERS;
+ attributes[i] = AGL_NONE;
+
+ format = aglChoosePixelFormat(NULL, 0, attributes);
+ if ( format == NULL ) {
+ SDL_SetError("Couldn't match OpenGL desired format");
+ return(-1);
+ }
+
+ glContext = aglCreateContext(format, NULL);
+ if ( glContext == NULL ) {
+ SDL_SetError("Couldn't create OpenGL context");
+ return(-1);
+ }
+ aglDestroyPixelFormat(format);
+
+ #if TARGET_API_MAC_CARBON
+ noerr = aglSetDrawable(glContext, GetWindowPort(SDL_Window));
+ #else
+ noerr = aglSetDrawable(glContext, (AGLDrawable)SDL_Window);
+ #endif
+
+ if(!noerr) {
+ SDL_SetError("Unable to bind GL context to window");
+ return(-1);
+ }
+ return(0);
+#else
+ SDL_SetError("OpenGL support not configured");
+ return(-1);
+#endif
+}
+
+void Mac_GL_Quit(_THIS)
+{
+#if SDL_VIDEO_OPENGL
+ if ( glContext != NULL ) {
+ aglSetCurrentContext(NULL);
+ aglSetDrawable(glContext, NULL);
+ aglDestroyContext(glContext);
+ glContext = NULL;
+ }
+#endif
+}
+
+#if SDL_VIDEO_OPENGL
+
+/* Make the current context active */
+int Mac_GL_MakeCurrent(_THIS)
+{
+ int retval;
+
+ retval = 0;
+ if( ! aglSetCurrentContext(glContext) ) {
+ SDL_SetError("Unable to make GL context current");
+ retval = -1;
+ }
+ return(retval);
+}
+
+void Mac_GL_SwapBuffers(_THIS)
+{
+ aglSwapBuffers(glContext);
+}
+
+int Mac_GL_LoadLibrary(_THIS, const char *location)
+{
+ if (location == NULL)
+#if __MACH__
+ location = "/System/Library/Frameworks/OpenGL.framework/OpenGL";
+#else
+ location = "OpenGLLibrary";
+#endif
+
+ this->hidden->libraryHandle = SDL_LoadObject(location);
+
+ this->gl_config.driver_loaded = 1;
+ return (this->hidden->libraryHandle != NULL) ? 0 : -1;
+}
+
+void Mac_GL_UnloadLibrary(_THIS)
+{
+ SDL_UnloadObject(this->hidden->libraryHandle);
+
+ this->hidden->libraryHandle = NULL;
+ this->gl_config.driver_loaded = 0;
+}
+
+void* Mac_GL_GetProcAddress(_THIS, const char *proc)
+{
+ return SDL_LoadFunction( this->hidden->libraryHandle, proc );
+}
+
+#endif /* SDL_VIDEO_OPENGL */
+
diff --git a/distrib/sdl-1.2.15/src/video/maccommon/SDL_macgl_c.h b/distrib/sdl-1.2.15/src/video/maccommon/SDL_macgl_c.h
new file mode 100644
index 0000000..42cd70f
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/maccommon/SDL_macgl_c.h
@@ -0,0 +1,47 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/* AGL implementation of SDL OpenGL support */
+
+#include "SDL_config.h"
+
+#if SDL_VIDEO_OPENGL
+#include "SDL_opengl.h"
+#if __MACOSX__
+#include <AGL/agl.h> /* AGL.framework */
+#else
+#include <agl.h>
+#endif
+#endif /* SDL_VIDEO_OPENGL */
+
+/* OpenGL functions */
+extern int Mac_GL_Init(_THIS);
+extern void Mac_GL_Quit(_THIS);
+#if SDL_VIDEO_OPENGL
+extern int Mac_GL_MakeCurrent(_THIS);
+extern int Mac_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
+extern void Mac_GL_SwapBuffers(_THIS);
+extern int Mac_GL_LoadLibrary(_THIS, const char *location);
+extern void Mac_GL_UnloadLibrary(_THIS);
+extern void* Mac_GL_GetProcAddress(_THIS, const char *proc);
+#endif
+
diff --git a/distrib/sdl-1.2.15/src/video/maccommon/SDL_mackeys.h b/distrib/sdl-1.2.15/src/video/maccommon/SDL_mackeys.h
new file mode 100644
index 0000000..dfed30d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/maccommon/SDL_mackeys.h
@@ -0,0 +1,140 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+/* These are the Macintosh key scancode constants -- from Inside Macintosh */
+
+#define MK_ESCAPE 0x35
+#define MK_F1 0x7A
+#define MK_F2 0x78
+#define MK_F3 0x63
+#define MK_F4 0x76
+#define MK_F5 0x60
+#define MK_F6 0x61
+#define MK_F7 0x62
+#define MK_F8 0x64
+#define MK_F9 0x65
+#define MK_F10 0x6D
+#define MK_F11 0x67
+#define MK_F12 0x6F
+#define MK_PRINT 0x69
+#define MK_SCROLLOCK 0x6B
+#define MK_PAUSE 0x71
+#define MK_POWER 0x7F
+#define MK_BACKQUOTE 0x32
+#define MK_1 0x12
+#define MK_2 0x13
+#define MK_3 0x14
+#define MK_4 0x15
+#define MK_5 0x17
+#define MK_6 0x16
+#define MK_7 0x1A
+#define MK_8 0x1C
+#define MK_9 0x19
+#define MK_0 0x1D
+#define MK_MINUS 0x1B
+#define MK_EQUALS 0x18
+#define MK_BACKSPACE 0x33
+#define MK_INSERT 0x72
+#define MK_HOME 0x73
+#define MK_PAGEUP 0x74
+#define MK_NUMLOCK 0x47
+#define MK_KP_EQUALS 0x51
+#define MK_KP_DIVIDE 0x4B
+#define MK_KP_MULTIPLY 0x43
+#define MK_TAB 0x30
+#define MK_q 0x0C
+#define MK_w 0x0D
+#define MK_e 0x0E
+#define MK_r 0x0F
+#define MK_t 0x11
+#define MK_y 0x10
+#define MK_u 0x20
+#define MK_i 0x22
+#define MK_o 0x1F
+#define MK_p 0x23
+#define MK_LEFTBRACKET 0x21
+#define MK_RIGHTBRACKET 0x1E
+#define MK_BACKSLASH 0x2A
+#define MK_DELETE 0x75
+#define MK_END 0x77
+#define MK_PAGEDOWN 0x79
+#define MK_KP7 0x59
+#define MK_KP8 0x5B
+#define MK_KP9 0x5C
+#define MK_KP_MINUS 0x4E
+#define MK_CAPSLOCK 0x39
+#define MK_a 0x00
+#define MK_s 0x01
+#define MK_d 0x02
+#define MK_f 0x03
+#define MK_g 0x05
+#define MK_h 0x04
+#define MK_j 0x26
+#define MK_k 0x28
+#define MK_l 0x25
+#define MK_SEMICOLON 0x29
+#define MK_QUOTE 0x27
+#define MK_RETURN 0x24
+#define MK_KP4 0x56
+#define MK_KP5 0x57
+#define MK_KP6 0x58
+#define MK_KP_PLUS 0x45
+#define MK_LSHIFT 0x38
+#define MK_z 0x06
+#define MK_x 0x07
+#define MK_c 0x08
+#define MK_v 0x09
+#define MK_b 0x0B
+#define MK_n 0x2D
+#define MK_m 0x2E
+#define MK_COMMA 0x2B
+#define MK_PERIOD 0x2F
+#define MK_SLASH 0x2C
+#if 0 /* These are the same as the left versions - use left by default */
+#define MK_RSHIFT 0x38
+#endif
+#define MK_UP 0x7E
+#define MK_KP1 0x53
+#define MK_KP2 0x54
+#define MK_KP3 0x55
+#define MK_KP_ENTER 0x4C
+#define MK_LCTRL 0x3B
+#define MK_LALT 0x3A
+#define MK_LMETA 0x37
+#define MK_SPACE 0x31
+#if 0 /* These are the same as the left versions - use left by default */
+#define MK_RMETA 0x37
+#define MK_RALT 0x3A
+#define MK_RCTRL 0x3B
+#endif
+#define MK_LEFT 0x7B
+#define MK_DOWN 0x7D
+#define MK_RIGHT 0x7C
+#define MK_KP0 0x52
+#define MK_KP_PERIOD 0x41
+
+/* Wierd, these keys are on my iBook under Mac OS X */
+#define MK_IBOOK_ENTER 0x34
+#define MK_IBOOK_LEFT 0x3B
+#define MK_IBOOK_RIGHT 0x3C
+#define MK_IBOOK_DOWN 0x3D
+#define MK_IBOOK_UP 0x3E
diff --git a/distrib/sdl-1.2.15/src/video/maccommon/SDL_macmouse.c b/distrib/sdl-1.2.15/src/video/maccommon/SDL_macmouse.c
new file mode 100644
index 0000000..f19ad1b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/maccommon/SDL_macmouse.c
@@ -0,0 +1,129 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#if defined(__APPLE__) && defined(__MACH__)
+#include <Carbon/Carbon.h>
+#elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335)
+#include <Carbon.h>
+#else
+#include <Quickdraw.h>
+#endif
+
+/* Routines that are not supported by the Carbon API... */
+#if !TARGET_API_MAC_CARBON
+#include <CursorDevices.h>
+#endif
+
+#include "SDL_mouse.h"
+#include "SDL_macmouse_c.h"
+
+
+/* The implementation dependent data for the window manager cursor */
+struct WMcursor {
+ Cursor curs;
+};
+
+
+void Mac_FreeWMCursor(_THIS, WMcursor *cursor)
+{
+ SDL_free(cursor);
+}
+
+WMcursor *Mac_CreateWMCursor(_THIS,
+ Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
+{
+ WMcursor *cursor;
+ int row, bytes;
+
+ /* Allocate the cursor memory */
+ cursor = (WMcursor *)SDL_malloc(sizeof(WMcursor));
+ if ( cursor == NULL ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ SDL_memset(cursor, 0, sizeof(*cursor));
+
+ if (w > 16)
+ w = 16;
+
+ if (h > 16)
+ h = 16;
+
+ bytes = (w+7)/8;
+
+ for ( row=0; row<h; ++row ) {
+ SDL_memcpy(&cursor->curs.data[row], data, bytes);
+ data += bytes;
+ }
+ for ( row=0; row<h; ++row ) {
+ SDL_memcpy(&cursor->curs.mask[row], mask, bytes);
+ mask += bytes;
+ }
+ cursor->curs.hotSpot.h = hot_x;
+ cursor->curs.hotSpot.v = hot_y;
+
+ /* That was easy. :) */
+ return(cursor);
+}
+
+int Mac_cursor_showing = 1;
+
+int Mac_ShowWMCursor(_THIS, WMcursor *cursor)
+{
+ if ( cursor == NULL ) {
+ if ( Mac_cursor_showing ) {
+ HideCursor();
+ Mac_cursor_showing = 0;
+ }
+ } else {
+ SetCursor(&cursor->curs);
+ if ( ! Mac_cursor_showing ) {
+ ShowCursor();
+ Mac_cursor_showing = 1;
+ }
+ }
+ return(1);
+}
+
+void Mac_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
+{
+#if !TARGET_API_MAC_CARBON
+ CursorDevice *cursordevice;
+
+ cursordevice = nil;
+ CursorDeviceNextDevice(&cursordevice);
+ if ( cursordevice != nil ) {
+ WindowPtr saveport;
+ Point where;
+
+ GetPort(&saveport);
+ SetPort(SDL_Window);
+ where.h = x;
+ where.v = y;
+ LocalToGlobal(&where);
+ SetPort(saveport);
+ CursorDeviceMoveTo(cursordevice, where.h, where.v);
+ }
+#endif /* !TARGET_API_MAC_CARBON */
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/maccommon/SDL_macmouse_c.h b/distrib/sdl-1.2.15/src/video/maccommon/SDL_macmouse_c.h
new file mode 100644
index 0000000..18fb438
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/maccommon/SDL_macmouse_c.h
@@ -0,0 +1,34 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "../macrom/SDL_romvideo.h"
+
+/* Functions to be exported */
+extern void Mac_FreeWMCursor(_THIS, WMcursor *cursor);
+extern WMcursor *Mac_CreateWMCursor(_THIS,
+ Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
+extern int Mac_ShowWMCursor(_THIS, WMcursor *cursor);
+extern void Mac_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
+
+/* Data to be exported */
+extern int Mac_cursor_showing;
diff --git a/distrib/sdl-1.2.15/src/video/maccommon/SDL_macwm.c b/distrib/sdl-1.2.15/src/video/maccommon/SDL_macwm.c
new file mode 100644
index 0000000..6f485a3
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/maccommon/SDL_macwm.c
@@ -0,0 +1,442 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#if defined(__APPLE__) && defined(__MACH__)
+#include <Carbon/Carbon.h>
+#elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335)
+#include <Carbon.h>
+#else
+#include <Windows.h>
+#include <Strings.h>
+#endif
+
+#if SDL_MACCLASSIC_GAMMA_SUPPORT
+#include <Devices.h>
+#include <Files.h>
+#include <MacTypes.h>
+#include <QDOffscreen.h>
+#include <Quickdraw.h>
+#include <Video.h>
+#endif
+
+#include "SDL_stdinc.h"
+#include "SDL_macwm_c.h"
+
+void Mac_SetCaption(_THIS, const char *title, const char *icon)
+{
+ /* Don't convert C to P string in place, because it may be read-only */
+ Str255 ptitle; /* MJS */
+ ptitle[0] = strlen (title);
+ SDL_memcpy(ptitle+1, title, ptitle[0]); /* MJS */
+ if (SDL_Window)
+ SetWTitle(SDL_Window, ptitle); /* MJS */
+}
+
+#if SDL_MACCLASSIC_GAMMA_SUPPORT
+/*
+ * ADC Gamma Ramp support...
+ *
+ * Mac Gamma Ramp code was originally from sample code provided by
+ * Apple Developer Connection, and not written specifically for SDL:
+ * "Contains: Functions to enable Mac OS device gamma adjustments using 3 channel 256 element 8 bit gamma ramps
+ * Written by: Geoff Stahl (ggs)
+ * Copyright: Copyright (c) 1999 Apple Computer, Inc., All Rights Reserved
+ * Disclaimer: You may incorporate this sample code into your applications without
+ * restriction, though the sample code has been provided "AS IS" and the
+ * responsibility for its operation is 100% yours. However, what you are
+ * not permitted to do is to redistribute the source as "DSC Sample Code"
+ * after having made changes. If you're going to re-distribute the source,
+ * we require that you make it clear in the source that the code was
+ * descended from Apple Sample Code, but that you've made changes."
+ * (The sample code has been integrated into this file, and thus is modified from the original Apple sources.)
+ */
+
+typedef struct recDeviceGamma /* storage for device handle and gamma table */
+{
+ GDHandle hGD; /* handle to device */
+ GammaTblPtr pDeviceGamma; /* pointer to device gamma table */
+} recDeviceGamma;
+typedef recDeviceGamma * precDeviceGamma;
+
+typedef struct recSystemGamma /* storage for system devices and gamma tables */
+{
+ short numDevices; /* number of devices */
+ precDeviceGamma * devGamma; /* array of pointers to device gamma records */
+} recSystemGamma;
+typedef recSystemGamma * precSystemGamma;
+
+static Ptr CopyGammaTable (GammaTblPtr pTableGammaIn)
+{
+ GammaTblPtr pTableGammaOut = NULL;
+ short tableSize, dataWidth;
+
+ if (pTableGammaIn) /* if there is a table to copy */
+ {
+ dataWidth = (pTableGammaIn->gDataWidth + 7) / 8; /* number of bytes per entry */
+ tableSize = sizeof (GammaTbl) + pTableGammaIn->gFormulaSize +
+ (pTableGammaIn->gChanCnt * pTableGammaIn->gDataCnt * dataWidth);
+ pTableGammaOut = (GammaTblPtr) NewPtr (tableSize); /* allocate new table */
+ if (pTableGammaOut)
+ BlockMove( (Ptr)pTableGammaIn, (Ptr)pTableGammaOut, tableSize); /* move everything */
+ }
+ return (Ptr)pTableGammaOut; /* return whatever we allocated, could be NULL */
+}
+
+static OSErr GetGammaTable (GDHandle hGD, GammaTblPtr * ppTableGammaOut)
+{
+ VDGammaRecord DeviceGammaRec;
+ CntrlParam cParam;
+ OSErr err;
+
+ cParam.ioCompletion = NULL; /* set up control params */
+ cParam.ioNamePtr = NULL;
+ cParam.ioVRefNum = 0;
+ cParam.ioCRefNum = (**hGD).gdRefNum;
+ cParam.csCode = cscGetGamma; /* Get Gamma commnd to device */
+ *(Ptr *)cParam.csParam = (Ptr) &DeviceGammaRec; /* record for gamma */
+
+ err = PBStatusSync( (ParmBlkPtr)&cParam ); /* get gamma */
+
+ *ppTableGammaOut = (GammaTblPtr)(DeviceGammaRec.csGTable); /* pull table out of record */
+
+ return err;
+}
+
+static Ptr GetDeviceGamma (GDHandle hGD)
+{
+ GammaTblPtr pTableGammaDevice = NULL;
+ GammaTblPtr pTableGammaReturn = NULL;
+ OSErr err;
+
+ err = GetGammaTable (hGD, &pTableGammaDevice); /* get a pointer to the devices table */
+ if ((noErr == err) && pTableGammaDevice) /* if succesful */
+ pTableGammaReturn = (GammaTblPtr) CopyGammaTable (pTableGammaDevice); /* copy to global */
+
+ return (Ptr) pTableGammaReturn;
+}
+
+static void DisposeGammaTable (Ptr pGamma)
+{
+ if (pGamma)
+ DisposePtr((Ptr) pGamma); /* get rid of it */
+}
+
+static void DisposeSystemGammas (Ptr* ppSystemGammas)
+{
+ precSystemGamma pSysGammaIn;
+ if (ppSystemGammas)
+ {
+ pSysGammaIn = (precSystemGamma) *ppSystemGammas;
+ if (pSysGammaIn)
+ {
+ short i;
+ for (i = 0; i < pSysGammaIn->numDevices; i++) /* for all devices */
+ if (pSysGammaIn->devGamma [i]) /* if pointer is valid */
+ {
+ DisposeGammaTable ((Ptr) pSysGammaIn->devGamma [i]->pDeviceGamma); /* dump gamma table */
+ DisposePtr ((Ptr) pSysGammaIn->devGamma [i]); /* dump device info */
+ }
+ DisposePtr ((Ptr) pSysGammaIn->devGamma); /* dump device pointer array */
+ DisposePtr ((Ptr) pSysGammaIn); /* dump system structure */
+ *ppSystemGammas = NULL;
+ }
+ }
+}
+
+static Boolean GetDeviceGammaRampGD (GDHandle hGD, Ptr pRamp)
+{
+ GammaTblPtr pTableGammaTemp = NULL;
+ long indexChan, indexEntry;
+ OSErr err;
+
+ if (pRamp) /* ensure pRamp is allocated */
+ {
+ err = GetGammaTable (hGD, &pTableGammaTemp); /* get a pointer to the current gamma */
+ if ((noErr == err) && pTableGammaTemp) /* if successful */
+ {
+ /* fill ramp */
+ unsigned char * pEntry = (unsigned char *) &pTableGammaTemp->gFormulaData + pTableGammaTemp->gFormulaSize; /* base of table */
+ short bytesPerEntry = (pTableGammaTemp->gDataWidth + 7) / 8; /* size, in bytes, of the device table entries */
+ short shiftRightValue = pTableGammaTemp->gDataWidth - 8; /* number of right shifts device -> ramp */
+ short channels = pTableGammaTemp->gChanCnt;
+ short entries = pTableGammaTemp->gDataCnt;
+ if (3 == channels) /* RGB format */
+ { /* note, this will create runs of entries if dest. is bigger (not linear interpolate) */
+ for (indexChan = 0; indexChan < channels; indexChan++)
+ for (indexEntry = 0; indexEntry < 256; indexEntry++)
+ *((unsigned char *) pRamp + (indexChan * 256) + indexEntry) =
+ *(pEntry + indexChan * entries * bytesPerEntry + indexEntry * entries * bytesPerEntry / 256) >> shiftRightValue;
+ }
+ else /* single channel format */
+ {
+ for (indexChan = 0; indexChan < 768; indexChan += 256) /* repeat for all 3 channels (step by ramp size) */
+ for (indexEntry = 0; indexEntry < 256; indexEntry++) /* for all entries set vramp value */
+ *((unsigned char *) pRamp + indexChan + indexEntry) =
+ *(pEntry + indexEntry * entries * bytesPerEntry / 256) >> shiftRightValue;
+ }
+ return true;
+ }
+ }
+ return false;
+}
+
+static Ptr GetSystemGammas (void)
+{
+ precSystemGamma pSysGammaOut; /* return pointer to system device gamma info */
+ short devCount = 0; /* number of devices attached */
+ Boolean fail = false;
+ GDHandle hGDevice;
+
+ pSysGammaOut = (precSystemGamma) NewPtr (sizeof (recSystemGamma)); /* allocate for structure */
+
+ hGDevice = GetDeviceList (); /* top of device list */
+ do /* iterate */
+ {
+ devCount++; /* count devices */
+ hGDevice = GetNextDevice (hGDevice); /* next device */
+ } while (hGDevice);
+
+ pSysGammaOut->devGamma = (precDeviceGamma *) NewPtr (sizeof (precDeviceGamma) * devCount); /* allocate for array of pointers to device records */
+ if (pSysGammaOut)
+ {
+ pSysGammaOut->numDevices = devCount; /* stuff count */
+
+ devCount = 0; /* reset iteration */
+ hGDevice = GetDeviceList ();
+ do
+ {
+ pSysGammaOut->devGamma [devCount] = (precDeviceGamma) NewPtr (sizeof (recDeviceGamma)); /* new device record */
+ if (pSysGammaOut->devGamma [devCount]) /* if we actually allocated memory */
+ {
+ pSysGammaOut->devGamma [devCount]->hGD = hGDevice; /* stuff handle */
+ pSysGammaOut->devGamma [devCount]->pDeviceGamma = (GammaTblPtr)GetDeviceGamma (hGDevice); /* copy gamma table */
+ }
+ else /* otherwise dump record on exit */
+ fail = true;
+ devCount++; /* next device */
+ hGDevice = GetNextDevice (hGDevice);
+ } while (hGDevice);
+ }
+ if (!fail) /* if we did not fail */
+ return (Ptr) pSysGammaOut; /* return pointer to structure */
+ else
+ {
+ DisposeSystemGammas ((Ptr *) &pSysGammaOut); /* otherwise dump the current structures (dispose does error checking) */
+ return NULL; /* could not complete */
+ }
+}
+
+static void RestoreDeviceGamma (GDHandle hGD, Ptr pGammaTable)
+{
+ VDSetEntryRecord setEntriesRec;
+ VDGammaRecord gameRecRestore;
+ CTabHandle hCTabDeviceColors;
+ Ptr csPtr;
+ OSErr err = noErr;
+
+ if (pGammaTable) /* if we have a table to restore */
+ {
+ gameRecRestore.csGTable = pGammaTable; /* setup restore record */
+ csPtr = (Ptr) &gameRecRestore;
+ err = Control((**hGD).gdRefNum, cscSetGamma, (Ptr) &csPtr); /* restore gamma */
+
+ if ((noErr == err) && (8 == (**(**hGD).gdPMap).pixelSize)) /* if successful and on an 8 bit device */
+ {
+ hCTabDeviceColors = (**(**hGD).gdPMap).pmTable; /* do SetEntries to force CLUT update */
+ setEntriesRec.csTable = (ColorSpec *) &(**hCTabDeviceColors).ctTable;
+ setEntriesRec.csStart = 0;
+ setEntriesRec.csCount = (**hCTabDeviceColors).ctSize;
+ csPtr = (Ptr) &setEntriesRec;
+
+ err = Control((**hGD).gdRefNum, cscSetEntries, (Ptr) &csPtr); /* SetEntries in CLUT */
+ }
+ }
+}
+
+static void RestoreSystemGammas (Ptr pSystemGammas)
+{
+ short i;
+ precSystemGamma pSysGammaIn = (precSystemGamma) pSystemGammas;
+ if (pSysGammaIn)
+ for (i = 0; i < pSysGammaIn->numDevices; i++) /* for all devices */
+ RestoreDeviceGamma (pSysGammaIn->devGamma [i]->hGD, (Ptr) pSysGammaIn->devGamma [i]->pDeviceGamma); /* restore gamma */
+}
+
+static Ptr CreateEmptyGammaTable (short channels, short entries, short bits)
+{
+ GammaTblPtr pTableGammaOut = NULL;
+ short tableSize, dataWidth;
+
+ dataWidth = (bits + 7) / 8; /* number of bytes per entry */
+ tableSize = sizeof (GammaTbl) + (channels * entries * dataWidth);
+ pTableGammaOut = (GammaTblPtr) NewPtrClear (tableSize); /* allocate new tabel */
+
+ if (pTableGammaOut) /* if we successfully allocated */
+ {
+ pTableGammaOut->gVersion = 0; /* set parameters based on input */
+ pTableGammaOut->gType = 0;
+ pTableGammaOut->gFormulaSize = 0;
+ pTableGammaOut->gChanCnt = channels;
+ pTableGammaOut->gDataCnt = entries;
+ pTableGammaOut->gDataWidth = bits;
+ }
+ return (Ptr)pTableGammaOut; /* return whatever we allocated */
+}
+
+static Boolean SetDeviceGammaRampGD (GDHandle hGD, Ptr pRamp)
+{
+ VDSetEntryRecord setEntriesRec;
+ VDGammaRecord gameRecRestore;
+ GammaTblPtr pTableGammaNew;
+ GammaTblPtr pTableGammaCurrent = NULL;
+ CTabHandle hCTabDeviceColors;
+ Ptr csPtr;
+ OSErr err;
+ short dataBits, entries, channels = 3; /* force three channels in the gamma table */
+
+ if (pRamp) /* ensure pRamp is allocated */
+ {
+ err= GetGammaTable (hGD, &pTableGammaCurrent); /* get pointer to current table */
+ if ((noErr == err) && pTableGammaCurrent)
+ {
+ dataBits = pTableGammaCurrent->gDataWidth; /* table must have same data width */
+ entries = pTableGammaCurrent->gDataCnt; /* table must be same size */
+ pTableGammaNew = (GammaTblPtr) CreateEmptyGammaTable (channels, entries, dataBits); /* our new table */
+ if (pTableGammaNew) /* if successful fill table */
+ {
+ unsigned char * pGammaBase = (unsigned char *) &pTableGammaNew->gFormulaData + pTableGammaNew->gFormulaSize; /* base of table */
+ if ((256 == entries) && (8 == dataBits)) /* simple case: direct mapping */
+ BlockMove ((Ptr)pRamp, (Ptr)pGammaBase, channels * entries); /* move everything */
+ else /* tough case handle entry, channel and data size disparities */
+ {
+ short indexChan, indexEntry;
+ short bytesPerEntry = (dataBits + 7) / 8; /* size, in bytes, of the device table entries */
+ short shiftRightValue = 8 - dataBits; /* number of right shifts ramp -> device */
+ shiftRightValue += ((bytesPerEntry - 1) * 8); /* multibyte entries and the need to map a byte at a time most sig. to least sig. */
+ for (indexChan = 0; indexChan < channels; indexChan++) /* for all the channels */
+ for (indexEntry = 0; indexEntry < entries; indexEntry++) /* for all the entries */
+ {
+ short currentShift = shiftRightValue; /* reset current bit shift */
+ long temp = *((unsigned char *)pRamp + (indexChan << 8) + (indexEntry << 8) / entries); /* get data from ramp */
+ short indexByte;
+ for (indexByte = 0; indexByte < bytesPerEntry; indexByte++) /* for all bytes */
+ {
+ if (currentShift < 0) /* shift data correctly for current byte */
+ *(pGammaBase++) = temp << -currentShift;
+ else
+ *(pGammaBase++) = temp >> currentShift;
+ currentShift -= 8; /* increment shift to align to next less sig. byte */
+ }
+ }
+ }
+
+ /* set gamma */
+ gameRecRestore.csGTable = (Ptr) pTableGammaNew; /* setup restore record */
+ csPtr = (Ptr) &gameRecRestore;
+ err = Control((**hGD).gdRefNum, cscSetGamma, (Ptr) &csPtr); /* restore gamma (note, display drivers may delay returning from this until VBL) */
+
+ if ((8 == (**(**hGD).gdPMap).pixelSize) && (noErr == err)) /* if successful and on an 8 bit device */
+ {
+ hCTabDeviceColors = (**(**hGD).gdPMap).pmTable; /* do SetEntries to force CLUT update */
+ setEntriesRec.csTable = (ColorSpec *) &(**hCTabDeviceColors).ctTable;
+ setEntriesRec.csStart = 0;
+ setEntriesRec.csCount = (**hCTabDeviceColors).ctSize;
+ csPtr = (Ptr) &setEntriesRec;
+ err = Control((**hGD).gdRefNum, cscSetEntries, (Ptr) &csPtr); /* SetEntries in CLUT */
+ }
+ DisposeGammaTable ((Ptr) pTableGammaNew); /* dump table */
+ if (noErr == err)
+ return true;
+ }
+ }
+ }
+ else /* set NULL gamma -> results in linear map */
+ {
+ gameRecRestore.csGTable = (Ptr) NULL; /* setup restore record */
+ csPtr = (Ptr) &gameRecRestore;
+ err = Control((**hGD).gdRefNum, cscSetGamma, (Ptr) &csPtr); /* restore gamma */
+
+ if ((8 == (**(**hGD).gdPMap).pixelSize) && (noErr == err)) /* if successful and on an 8 bit device */
+ {
+ hCTabDeviceColors = (**(**hGD).gdPMap).pmTable; /* do SetEntries to force CLUT update */
+ setEntriesRec.csTable = (ColorSpec *) &(**hCTabDeviceColors).ctTable;
+ setEntriesRec.csStart = 0;
+ setEntriesRec.csCount = (**hCTabDeviceColors).ctSize;
+ csPtr = (Ptr) &setEntriesRec;
+ err = Control((**hGD).gdRefNum, cscSetEntries, (Ptr) &csPtr); /* SetEntries in CLUT */
+ }
+ if (noErr == err)
+ return true;
+ }
+ return false; /* memory allocation or device control failed if we get here */
+}
+
+/* end of ADC Gamma Ramp support code... */
+
+static Ptr systemGammaPtr;
+
+void Mac_QuitGamma(_THIS)
+{
+ if (systemGammaPtr)
+ {
+ RestoreSystemGammas(systemGammaPtr);
+ DisposeSystemGammas(&systemGammaPtr);
+ }
+}
+
+static unsigned char shiftedRamp[3 * 256];
+
+int Mac_SetGammaRamp(_THIS, Uint16 *ramp)
+{
+ int i;
+ if (!systemGammaPtr)
+ systemGammaPtr = GetSystemGammas();
+ for (i = 0; i < 3 * 256; i++)
+ {
+ shiftedRamp[i] = ramp[i] >> 8;
+ }
+
+ if (SetDeviceGammaRampGD(GetMainDevice(), (Ptr) shiftedRamp))
+ return 0;
+ else
+ return -1;
+}
+
+int Mac_GetGammaRamp(_THIS, Uint16 *ramp)
+{
+ if (GetDeviceGammaRampGD(GetMainDevice(), (Ptr) shiftedRamp))
+ {
+ int i;
+ for (i = 0; i < 3 * 256; i++)
+ {
+ ramp[i] = shiftedRamp[i] << 8;
+ }
+ return 0;
+ }
+ else
+ return -1;
+}
+
+#endif /* SDL_MACCLASSIC_GAMMA_SUPPORT */
+
+
diff --git a/distrib/sdl-1.2.15/src/video/maccommon/SDL_macwm_c.h b/distrib/sdl-1.2.15/src/video/maccommon/SDL_macwm_c.h
new file mode 100644
index 0000000..a0554d1
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/maccommon/SDL_macwm_c.h
@@ -0,0 +1,41 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "../macrom/SDL_romvideo.h"
+
+/* Functions to be exported */
+extern void Mac_SetCaption(_THIS, const char *title, const char *icon);
+
+/*
+ * There's no Carbonized gamma support in Mac OS X, since PBStatusSync() and
+ * Control() aren't supported in OS X's Carbonlib. Use the Quartz driver
+ * instead.
+ */
+#define SDL_MACCLASSIC_GAMMA_SUPPORT ((defined(__APPLE__) && defined(__MACH__)) == 0)
+
+#if SDL_MACCLASSIC_GAMMA_SUPPORT
+extern void Mac_QuitGamma(_THIS);
+extern int Mac_SetGammaRamp(_THIS, Uint16 *ramp);
+extern int Mac_GetGammaRamp(_THIS, Uint16 *ramp);
+#endif
+
diff --git a/distrib/sdl-1.2.15/src/video/macdsp/SDL_dspvideo.c b/distrib/sdl-1.2.15/src/video/macdsp/SDL_dspvideo.c
new file mode 100644
index 0000000..aa31127
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/macdsp/SDL_dspvideo.c
@@ -0,0 +1,1422 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ Written by Darrell Walisser <dwaliss1@purdue.edu>
+
+ Implementation notes ----------------------------------------------------------------------
+
+ A bit on GWorlds in VRAM from technote 1182:
+
+ There are two important things to note about GWorld's allocated in
+ VRAM. First, the base address retrieved through GetPixBaseAddr or
+ read directly from the PixMap structure can become invalid anytime
+ memory is allocated in VRAM. This can occur either by explicit
+ allocations, such as calls to NewGWorld, or by implicit ones, such as
+ those associated with the internal texture allocation of OpenGL. The
+ stored pixel images themselves will still be valid but may have been
+ moved in VRAM, thus rendering any stored base addresses invalid.
+ You should never store an image's base address for longer than is
+ necessary and especially never across calls to NewGWorld or
+ texture-creation routines.
+
+ Secondly, an offscreen pixel image allocated in VRAM can be
+ purged at system task time by the display driver. This means any
+ time your application yields time such by calling WaitNextEvent or
+ SystemTask you can lose your VRAM GWorld contents. While this
+ happens infrequently, usually associated with display resolution or
+ pixel depth changes you must code for this eventuality. This purge
+ can occur whether or not the GWorld is locked or not. A return value
+ of false from LockPixels, a NULL return value from GetPixBaseAddr
+ or NULL in the baseAddr field of the PixMap mean that the pixel
+ image has been purged. To reallocate it you can either call
+ UpdateGWorld or Dispose your current GWorld through
+ DisposeGWorld and reallocate it via NewGWorld. Either way you must
+ then rebuild the pixel image.
+
+------------------------------------------------------------------------------------
+
+ Currently, I don't account for (1). In my testing, NewGWorld never invalidated
+ other existing GWorlds in VRAM. However, I do have protection for (2).
+ Namely, I am using GetOSEvent() instead of WaitNextEvent() so that there are no
+ context switches (the app hogs the CPU). Eventually a book-keeping system should
+ be coded to take care of (1) and (2).
+
+------------------------------------------------------------------------------------
+
+ System requirements (* denotes optional):
+
+ 1. DrawSprocket 1.7.3
+ 2. *MacOS 9 or later (but *not* Mac OS X) for hardware accelerated blit / fill
+ 3. *May also require certain graphics hardware for (2). I trust that all Apple OEM
+ hardware will work. Third party accelerators may work if they have QuickDraw
+ acceleration in the drivers and the drivers have been updated for OS 9. The current
+ Voodoo 3 drivers (1.0b12) do not work.
+
+ Coding suggestions:
+
+ 1. Use SDL_UpdateRects !
+
+ If no QuickDraw acceleration is present, double-buffered surfaces will use a back buffer
+ in System memory. I recommend you use SDL_UpdateRects with double-buffered surfaces
+ for best performance on these cards, since the overhead is nearly zero for VRAM back buffer.
+
+ 2. Load most-resident surfaces first.
+
+ If you fill up VRAM or AGP memory, there is no contingency for purging to make room for the next one.
+ Therefore, you should load the surfaces you plan to use the most frequently first.
+ Sooner or later, I will code LRU replacement to help this.
+
+ TODO:
+ Some kind of posterized mode for resolutions < 640x480.
+ Window support / fullscreen toggle.
+ Figure out how much VRAM is available. Put in video->info->video_mem.
+ Track VRAM usage.
+
+ BUGS:
+ I can't create a hardware surface the same size as the screen?! How to fix?
+
+
+
+ COMPILE OPTIONS:
+
+ DSP_TRY_CC_AND_AA - Define if you want to try HWA color-key and alpha blitters
+ HW color-key blitting gives substantial improvements,
+ but hw alpha is neck-and-neck with SDL's soft bitter.
+
+ DSP_NO_SYNC_VBL - Define for HWA double-buffered surfaces: don't sync
+ pseudo-flip to monitor redraw.
+
+ DSP_NO_SYNC_OPENGL - Define for OpenGL surfaces: don't sync buffer swap. Synching buffer
+ swap may result in reduced performance, but can eliminate some
+ tearing artifacts.
+ CHANGELOG:
+ 09/17/00 Lots of little tweaks. Build modelist in reverse order so largest contexts
+ list first. Compared various methods with ROM methods and fixed rez switch
+ crashing bug in GL Tron. (Woohoo!)
+*/
+
+#define DSP_TRY_CC_AND_AA
+
+/* #define DSP_NO_SYNC_VBL */
+
+#define DSP_NO_SYNC_OPENGL
+
+
+#if defined(__APPLE__) && defined(__MACH__)
+#include <Carbon/Carbon.h>
+#include <DrawSprocket/DrawSprocket.h>
+#elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335)
+#include <Carbon.h>
+#include <DrawSprocket.h>
+#else
+#include <LowMem.h>
+#include <Gestalt.h>
+#include <Devices.h>
+#include <DiskInit.h>
+#include <QDOffscreen.h>
+#include <DrawSprocket.h>
+#endif
+
+#include "SDL_video.h"
+#include "SDL_syswm.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_blit.h"
+#include "../SDL_pixels_c.h"
+#include "SDL_dspvideo.h"
+#include "../maccommon/SDL_macgl_c.h"
+#include "../maccommon/SDL_macwm_c.h"
+#include "../maccommon/SDL_macmouse_c.h"
+#include "../maccommon/SDL_macevents_c.h"
+
+/* Initialization/Query functions */
+static int DSp_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **DSp_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *DSp_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int DSp_SetColors(_THIS, int firstcolor, int ncolors,
+ SDL_Color *colors);
+static int DSp_CreatePalette(_THIS);
+static int DSp_DestroyPalette(_THIS);
+static void DSp_VideoQuit(_THIS);
+
+static int DSp_GetMainDevice (_THIS, GDHandle *device);
+static void DSp_IsHWAvailable (_THIS, SDL_PixelFormat *vformat);
+static void DSp_DSpUpdate(_THIS, int numrects, SDL_Rect *sdl_rects);
+static void DSp_DirectUpdate(_THIS, int numrects, SDL_Rect *sdl_rects);
+
+/* Hardware surface functions */
+static int DSp_SetHWAlpha(_THIS, SDL_Surface *surface, UInt8 alpha);
+static int DSp_SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key);
+static int DSp_NewHWSurface(_THIS, CGrafPtr *port, int depth, int width, int height);
+static int DSp_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int DSp_LockHWSurface(_THIS, SDL_Surface *surface);
+static void DSp_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void DSp_FreeHWSurface(_THIS, SDL_Surface *surface);
+static int DSp_FlipHWSurface(_THIS, SDL_Surface *surface);
+static int DSp_CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dest);
+static int DSp_HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect);
+static int DSp_FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color);
+
+#if SDL_VIDEO_OPENGL
+ static void DSp_GL_SwapBuffers (_THIS);
+#endif
+
+#if ! TARGET_API_MAC_CARBON
+
+ #define GetPortPixRowBytes(x) ( (*(x->portPixMap))->rowBytes )
+ #define GetGDevPixMap(x) ((**(x)).gdPMap)
+ #define GetPortPixMap(x) ((*(x)).portPixMap)
+
+ #define GetPixDepth(y) ((**(y)).pixelSize)
+ //#define GetPixRowBytes(y) ((**(y)).rowBytes)
+ //#define GetPixBaseAddr(y) ((**(y)).baseAddr)
+ #define GetPixCTab(y) ((**(y)).pmTable)
+ #define GetPortBitMapForCopyBits(x) (&(((GrafPtr)(x))->portBits))
+
+#else
+ #define GetPortPixRowBytes(x) (GetPixRowBytes(GetPortPixMap(x)) )
+ #define GetGDevPixMap(x) ((**(x)).gdPMap)
+
+#endif
+
+typedef struct private_hwdata {
+
+ GWorldPtr offscreen; // offscreen gworld in VRAM or AGP
+
+ #ifdef DSP_TRY_CC_AND_AA
+ GWorldPtr mask; // transparent mask
+ RGBColor alpha; // alpha color
+ RGBColor trans; // transparent color
+ #endif
+
+} private_hwdata;
+
+typedef private_hwdata private_swdata ; /* have same fields */
+
+/* Macintosh toolbox driver bootstrap functions */
+
+static int DSp_Available(void)
+{
+ /* Check for DrawSprocket */
+#if ! TARGET_API_MAC_OSX
+ /* This check is only meaningful if you weak-link DrawSprocketLib */
+ return ((Ptr)DSpStartup != (Ptr)kUnresolvedCFragSymbolAddress);
+#else
+ return 1; // DrawSprocket.framework doesn't have it all, but it's there
+#endif
+}
+
+static void DSp_DeleteDevice(SDL_VideoDevice *device)
+{
+ /* -dw- taking no chances with null pointers */
+ if (device) {
+
+ if (device->hidden) {
+
+ if (device->hidden->dspinfo)
+ SDL_free(device->hidden->dspinfo);
+
+ SDL_free(device->hidden);
+ }
+ SDL_free(device);
+ }
+}
+
+static SDL_VideoDevice *DSp_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device;
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ SDL_memset(device, 0, sizeof (*device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *device->hidden));
+ if (device->hidden)
+ SDL_memset(device->hidden, 0, sizeof ( *(device->hidden) ) );
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ) {
+ SDL_OutOfMemory();
+
+ if ( device ) {
+
+ if (device->hidden)
+ SDL_free(device->hidden);
+
+ SDL_free(device);
+ }
+
+ return(NULL);
+ }
+
+ /* Allocate DrawSprocket information */
+ device->hidden->dspinfo = (struct DSpInfo *)SDL_malloc(
+ (sizeof *device->hidden->dspinfo));
+ if ( device->hidden->dspinfo == NULL ) {
+ SDL_OutOfMemory();
+ SDL_free(device->hidden);
+ SDL_free(device);
+ return(0);
+ }
+ SDL_memset(device->hidden->dspinfo, 0, (sizeof *device->hidden->dspinfo));
+
+ /* Set the function pointers */
+ device->VideoInit = DSp_VideoInit;
+ device->ListModes = DSp_ListModes;
+ device->SetVideoMode = DSp_SetVideoMode;
+ device->SetColors = DSp_SetColors;
+ device->UpdateRects = NULL;
+ device->VideoQuit = DSp_VideoQuit;
+ device->AllocHWSurface = DSp_AllocHWSurface;
+ device->CheckHWBlit = NULL;
+ device->FillHWRect = NULL;
+ device->SetHWColorKey = NULL;
+ device->SetHWAlpha = NULL;
+ device->LockHWSurface = DSp_LockHWSurface;
+ device->UnlockHWSurface = DSp_UnlockHWSurface;
+ device->FlipHWSurface = DSp_FlipHWSurface;
+ device->FreeHWSurface = DSp_FreeHWSurface;
+#if SDL_MACCLASSIC_GAMMA_SUPPORT
+ device->SetGammaRamp = Mac_SetGammaRamp;
+ device->GetGammaRamp = Mac_GetGammaRamp;
+#endif
+#if SDL_VIDEO_OPENGL
+ device->GL_MakeCurrent = Mac_GL_MakeCurrent;
+ device->GL_SwapBuffers = DSp_GL_SwapBuffers;
+ device->GL_LoadLibrary = Mac_GL_LoadLibrary;
+ device->GL_GetProcAddress = Mac_GL_GetProcAddress;
+#endif
+ device->SetCaption = NULL;
+ device->SetIcon = NULL;
+ device->IconifyWindow = NULL;
+ device->GrabInput = NULL;
+ device->GetWMInfo = NULL;
+ device->FreeWMCursor = Mac_FreeWMCursor;
+ device->CreateWMCursor = Mac_CreateWMCursor;
+ device->ShowWMCursor = Mac_ShowWMCursor;
+ device->WarpWMCursor = Mac_WarpWMCursor;
+ device->InitOSKeymap = Mac_InitOSKeymap;
+ device->PumpEvents = Mac_PumpEvents;
+
+ device->GrabInput = NULL;
+ device->CheckMouseMode = NULL;
+
+ device->free = DSp_DeleteDevice;
+
+ return device;
+}
+
+VideoBootStrap DSp_bootstrap = {
+ "DSp", "MacOS DrawSprocket",
+ DSp_Available, DSp_CreateDevice
+};
+
+/* Use DSp/Display Manager to build mode list for given screen */
+static SDL_Rect** DSp_BuildModeList (const GDHandle gDevice, int *displayWidth, int *displayHeight)
+{
+ DSpContextAttributes attributes;
+ DSpContextReference context;
+ DisplayIDType displayID;
+ SDL_Rect temp_list [16];
+ SDL_Rect **mode_list;
+ int width, height, i, j;
+
+ #if TARGET_API_MAC_OSX
+
+ displayID = 0;
+
+ #else
+ /* Ask Display Manager for integer id of screen device */
+ if ( DMGetDisplayIDByGDevice (gDevice, &displayID, SDL_TRUE) != noErr ) {
+ return NULL;
+ }
+ #endif
+ /* Get the first possible DSp context on this device */
+ if ( DSpGetFirstContext (displayID, &context) != noErr ) {
+ return NULL;
+ }
+
+ if ( DSpContext_GetAttributes (context, &attributes) != noErr )
+ return NULL;
+
+ *displayWidth = attributes.displayWidth;
+ *displayHeight = attributes.displayHeight;
+
+ for ( i = 0; i < SDL_arraysize(temp_list); i++ ) {
+ width = attributes.displayWidth;
+ height = attributes.displayHeight;
+
+ temp_list [i].x = 0 | attributes.displayBestDepth;
+ temp_list [i].y = 0;
+ temp_list [i].w = width;
+ temp_list [i].h = height;
+
+ /* DSp will report many different contexts with the same width and height. */
+ /* They will differ in bit depth and refresh rate. */
+ /* We will ignore them until we reach one with a different width/height */
+ /* When there are no more contexts to look at, we will quit building the list*/
+ while ( width == attributes.displayWidth && height == attributes.displayHeight ) {
+
+ OSStatus err = DSpGetNextContext (context, &context);
+ if (err != noErr)
+ if (err == kDSpContextNotFoundErr)
+ goto done;
+ else
+ return NULL;
+
+ if ( DSpContext_GetAttributes (context, &attributes) != noErr )
+ return NULL;
+
+ temp_list [i].x |= attributes.displayBestDepth;
+ }
+ }
+done:
+ i++; /* i was not incremented before kicking out of the loop */
+
+ mode_list = (SDL_Rect**) SDL_malloc (sizeof (SDL_Rect*) * (i+1));
+ if (mode_list) {
+
+ /* -dw- new stuff: build in reverse order so largest sizes list first */
+ for (j = i-1; j >= 0; j--) {
+ mode_list [j] = (SDL_Rect*) SDL_malloc (sizeof (SDL_Rect));
+ if (mode_list [j])
+ SDL_memcpy (mode_list [j], &(temp_list [j]), sizeof (SDL_Rect));
+ else {
+ SDL_OutOfMemory ();
+ return NULL;
+ }
+ }
+ mode_list [i] = NULL; /* append null to the end */
+ }
+ else {
+ SDL_OutOfMemory ();
+ return NULL;
+ }
+
+ return mode_list;
+}
+
+static void DSp_IsHWAvailable (_THIS, SDL_PixelFormat *vformat)
+{
+ /*
+ VRAM GWorlds are only available on OS 9 or later.
+ Even with OS 9, some display drivers won't support it,
+ so we create a test GWorld and check for errors.
+ */
+
+ long versionSystem;
+
+ dsp_vram_available = SDL_FALSE;
+ dsp_agp_available = SDL_FALSE;
+
+ Gestalt ('sysv', &versionSystem);
+ if (0x00000860 < (versionSystem & 0x0000FFFF)) {
+
+ GWorldPtr offscreen;
+ OSStatus err;
+ Rect bounds;
+
+ SetRect (&bounds, 0, 0, 320, 240);
+
+#if useDistantHdwrMem && useLocalHdwrMem
+ err = NewGWorld (&offscreen, vformat->BitsPerPixel, &bounds, NULL, SDL_Display, useDistantHdwrMem | noNewDevice);
+ if (err == noErr) {
+ dsp_vram_available = SDL_TRUE;
+ DisposeGWorld (offscreen);
+ }
+
+ err = NewGWorld (&offscreen, vformat->BitsPerPixel, &bounds, NULL, SDL_Display, useLocalHdwrMem | noNewDevice);
+ if (err == noErr) {
+ DisposeGWorld (offscreen);
+ dsp_agp_available = SDL_TRUE;
+ }
+#endif
+ }
+}
+
+static int DSp_GetMainDevice (_THIS, GDHandle *device)
+{
+
+#if TARGET_API_MAC_OSX
+ /* DSpUserSelectContext not available on OS X */
+ *device = GetMainDevice();
+ return 0;
+#else
+
+ DSpContextAttributes attrib;
+ DSpContextReference context;
+ DisplayIDType display_id;
+ GDHandle main_device;
+ GDHandle device_list;
+
+ device_list = GetDeviceList ();
+ main_device = GetMainDevice ();
+
+ /* Quick check to avoid slower method when only one display exists */
+ if ( (**device_list).gdNextGD == NULL ) {
+ *device = main_device;
+ return 0;
+ }
+
+ SDL_memset (&attrib, 0, sizeof (DSpContextAttributes));
+
+ /* These attributes are hopefully supported on all devices...*/
+ attrib.displayWidth = 640;
+ attrib.displayHeight = 480;
+ attrib.displayBestDepth = 8;
+ attrib.backBufferBestDepth = 8;
+ attrib.displayDepthMask = kDSpDepthMask_All;
+ attrib.backBufferDepthMask = kDSpDepthMask_All;
+ attrib.colorNeeds = kDSpColorNeeds_Require;
+ attrib.pageCount = 1;
+
+ if (noErr != DMGetDisplayIDByGDevice (main_device, &display_id, SDL_FALSE)) {
+ SDL_SetError ("Display Manager couldn't associate GDevice with a Display ID");
+ return (-1);
+ }
+
+ /* Put up dialog on main display to select which display to use */
+ if (noErr != DSpUserSelectContext (&attrib, display_id, NULL, &context)) {
+ SDL_SetError ("DrawSprocket couldn't create a context");
+ return (-1);
+ }
+
+ if (noErr != DSpContext_GetDisplayID (context, &display_id)) {
+ SDL_SetError ("DrawSprocket couldn't get display ID");
+ return (-1);
+ }
+
+ if (noErr != DMGetGDeviceByDisplayID (display_id, &main_device, SDL_FALSE)) {
+ SDL_SetError ("Display Manager couldn't associate Display ID with GDevice");
+ return (-1);
+ }
+
+ *device = main_device;
+ return (0);
+#endif
+}
+
+static int DSp_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ NumVersion dsp_version = { 0x01, 0x00, 0x00, 0x00 };
+
+#if UNIVERSAL_INTERFACES_VERSION > 0x0320
+ dsp_version = DSpGetVersion ();
+#endif
+
+ if ( (dsp_version.majorRev == 1 && dsp_version.minorAndBugRev < 0x73) ||
+ (dsp_version.majorRev < 1) ) {
+
+ /* StandardAlert (kAlertStopAlert, "\pError!",
+ "\pI need DrawSprocket 1.7.3 or later!\n"
+ "You can find a newer version at http://www.apple.com/swupdates.",
+ NULL, NULL);
+ */
+ SDL_SetError ("DrawSprocket version is too old. Need 1.7.3 or later.");
+ return (-1);
+ }
+
+ if ( DSpStartup () != noErr ) {
+ SDL_SetError ("DrawSprocket couldn't startup");
+ return(-1);
+ }
+
+ /* Start DSpintosh events */
+ Mac_InitEvents(this);
+
+ /* Get a handle to the main monitor, or choose one on multiple monitor setups */
+ if ( DSp_GetMainDevice(this, &SDL_Display) < 0)
+ return (-1);
+
+ /* Determine pixel format */
+ vformat->BitsPerPixel = GetPixDepth ( (**SDL_Display).gdPMap );
+ dsp_old_depth = vformat->BitsPerPixel;
+
+ switch (vformat->BitsPerPixel) {
+ case 16:
+ vformat->Rmask = 0x00007c00;
+ vformat->Gmask = 0x000003e0;
+ vformat->Bmask = 0x0000001f;
+ break;
+ default:
+ break;
+ }
+
+ if ( DSp_CreatePalette (this) < 0 ) {
+ SDL_SetError ("Could not create palette");
+ return (-1);
+ }
+
+ /* Get a list of available fullscreen modes */
+ SDL_modelist = DSp_BuildModeList (SDL_Display,
+ &this->info.current_w, &this->info.current_h);
+ if (SDL_modelist == NULL) {
+ SDL_SetError ("DrawSprocket could not build a mode list");
+ return (-1);
+ }
+
+ /* Check for VRAM and AGP GWorlds for HW Blitting */
+ DSp_IsHWAvailable (this, vformat);
+
+ this->info.wm_available = 0;
+
+ if (dsp_vram_available || dsp_agp_available) {
+
+ this->info.hw_available = SDL_TRUE;
+
+ this->CheckHWBlit = DSp_CheckHWBlit;
+ this->info.blit_hw = SDL_TRUE;
+
+ this->FillHWRect = DSp_FillHWRect;
+ this->info.blit_fill = SDL_TRUE;
+
+ #ifdef DSP_TRY_CC_AND_AA
+ this->SetHWColorKey = DSp_SetHWColorKey;
+ this->info.blit_hw_CC = SDL_TRUE;
+
+ this->SetHWAlpha = DSp_SetHWAlpha;
+ this->info.blit_hw_A = SDL_TRUE;
+ #endif
+
+ }
+
+ return(0);
+}
+
+static SDL_Rect **DSp_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ static SDL_Rect *dsp_modes[16];
+ int i = 0, j = 0;
+
+ if ( format->BitsPerPixel == 0 )
+ return ( (SDL_Rect**) NULL );
+
+ while (SDL_modelist[i] != NULL) {
+
+ if (SDL_modelist[i]->x & format->BitsPerPixel) {
+ dsp_modes[j] = SDL_modelist[i];
+ j++;
+ }
+ i++;
+ }
+
+ dsp_modes[j] = NULL;
+
+ return dsp_modes;
+}
+
+/* Various screen update functions available */
+static void DSp_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
+
+#if ! TARGET_API_MAC_OSX
+
+static volatile unsigned int retrace_count = 0; /* -dw- need volatile because it updates asychronously */
+
+Boolean DSp_VBLProc ( DSpContextReference context, void *ref_con )
+{
+ retrace_count++;
+
+ return 1; /* Darrell, is this right? */
+}
+
+static void DSp_SetHWError (OSStatus err, int is_agp)
+{
+ char message[1024];
+ const char *fmt, *mem;
+
+ if ( is_agp ) {
+ mem = "AGP Memory";
+ } else {
+ mem = "VRAM";
+ }
+ switch(err) {
+ case memFullErr:
+ fmt = "Hardware surface possible but not enough %s available";
+ break;
+ case cDepthErr:
+ fmt = "Hardware surface possible but invalid color depth";
+ break;
+ default:
+ fmt = "Hardware surface could not be allocated in %s - unknown error";
+ break;
+ }
+ SDL_snprintf(message, SDL_arraysize(message), fmt, mem);
+ SDL_SetError(message);
+}
+#endif // TARGET_API_MAC_OSX
+
+/* put up a dialog to verify display change */
+static int DSp_ConfirmSwitch () {
+
+ /* resource id's for dialog */
+ const int rDialog = 1002;
+ const int bCancel = 1;
+ const int bOK = 2;
+
+ DialogPtr dialog;
+ OSStatus err;
+ SInt32 response;
+ DialogItemIndex item = 0;
+ GrafPtr savePort;
+
+ GetPort (&savePort);
+
+ dialog = GetNewDialog (rDialog, NULL, (WindowPtr) -1);
+ if (dialog == NULL)
+ return (0);
+
+#if TARGET_API_MAC_CARBON
+ SetPort (GetDialogPort(dialog));
+#else
+ SetPort ((WindowPtr) dialog);
+#endif
+
+ SetDialogDefaultItem (dialog, bCancel);
+ SetDialogCancelItem (dialog, bCancel);
+
+ SetEventMask (everyEvent);
+ FlushEvents (everyEvent, 0);
+
+ /* On MacOS 8.5 or later, we can make the dialog go away after 15 seconds */
+ /* This is good since it's possible user can't even see the dialog! */
+ /* Requires linking to DialogsLib */
+ err = Gestalt(gestaltSystemVersion,&response);
+ if (err == noErr && response >= 0x00000850) {
+ SetDialogTimeout(dialog, bCancel, 15);
+ }
+
+ do {
+
+ ModalDialog ( NULL, &item );
+
+ } while ( item != bCancel && item != bOK && err != noErr);
+
+
+ DisposeDialog (dialog);
+ SetPort (savePort);
+
+ SetEventMask(everyEvent - autoKeyMask);
+ FlushEvents(everyEvent, 0);
+
+ return (item - 1);
+}
+
+static void DSp_UnsetVideoMode(_THIS, SDL_Surface *current)
+{
+
+
+ if ( current->flags & SDL_OPENGL ) {
+ Mac_GL_Quit (this);
+ }
+
+ if (dsp_context != NULL) {
+
+ GWorldPtr front;
+ DSpContext_GetFrontBuffer (dsp_context, &front);
+
+ if (front != dsp_back_buffer)
+ DisposeGWorld (dsp_back_buffer);
+
+ if (current->hwdata)
+ SDL_free(current->hwdata);
+
+ DSpContext_SetState (dsp_context, kDSpContextState_Inactive );
+ DSpContext_Release (dsp_context);
+
+ dsp_context = NULL;
+ }
+
+ if (SDL_Window != NULL) {
+ DisposeWindow (SDL_Window);
+ SDL_Window = NULL;
+ }
+
+ current->pixels = NULL;
+ current->flags = 0;
+}
+
+static SDL_Surface *DSp_SetVideoMode(_THIS,
+ SDL_Surface *current, int width, int height, int bpp, Uint32 flags)
+{
+
+#if !TARGET_API_MAC_OSX
+ DisplayIDType display_id;
+ Fixed freq;
+#endif
+ DSpContextAttributes attrib;
+ OSStatus err;
+ UInt32 rmask = 0, gmask = 0, bmask = 0;
+
+ int page_count;
+ int double_buf;
+ int hw_surface;
+ int use_dsp_back_buffer;
+
+ DSp_UnsetVideoMode (this, current);
+
+ if (bpp != dsp_old_depth)
+ DSp_DestroyPalette (this);
+
+ double_buf = (flags & SDL_DOUBLEBUF) != 0;
+ hw_surface = (flags & SDL_HWSURFACE) != 0;
+ use_dsp_back_buffer = !dsp_vram_available || !hw_surface ;
+
+ current->flags |= SDL_FULLSCREEN;
+
+rebuild:
+
+ if ( double_buf && use_dsp_back_buffer ) {
+ page_count = 2;
+ } else {
+ page_count = 1;
+ }
+
+ SDL_memset (&attrib, 0, sizeof (DSpContextAttributes));
+ attrib.displayWidth = width;
+ attrib.displayHeight = height;
+ attrib.displayBestDepth = bpp;
+ attrib.backBufferBestDepth = bpp;
+ attrib.displayDepthMask = kDSpDepthMask_All;
+ attrib.backBufferDepthMask = kDSpDepthMask_All;
+ attrib.colorNeeds = kDSpColorNeeds_Require;
+ attrib.colorTable = 0;
+ attrib.pageCount = page_count;
+ #if TARGET_API_MAC_OSX || UNIVERSAL_INTERFACES_VERSION == 0x0320
+
+ if ( DSpFindBestContext (&attrib, &dsp_context) != noErr ) {
+ SDL_SetError ("DrawSprocket couldn't find a context");
+ return NULL;
+ }
+
+ #else
+ if ( noErr != DMGetDisplayIDByGDevice (SDL_Display, &display_id, SDL_FALSE) ) {
+ SDL_SetError ("Display Manager couldn't associate GDevice with display_id");
+ return NULL;
+ }
+ if ( DSpFindBestContextOnDisplayID(&attrib, &dsp_context, display_id) != noErr ) {
+ SDL_SetError ("DrawSprocket couldn't find a suitable context on given display");
+ return NULL;
+ }
+
+ #endif
+ if ( DSpContext_Reserve (dsp_context, &attrib) != noErr ) {
+ SDL_SetError ("DrawSprocket couldn't get the needed resources to build the display");
+ return NULL;
+ }
+
+ if ( (err = DSpContext_SetState (dsp_context, kDSpContextState_Active)) != noErr ) {
+
+ if (err == kDSpConfirmSwitchWarning) {
+
+ if ( ! DSp_ConfirmSwitch () ) {
+
+ DSpContext_Release (dsp_context);
+ dsp_context = NULL;
+ SDL_SetError ("User cancelled display switch");
+ return NULL;
+ }
+ else
+ /* Have to reactivate context. Why? */
+ DSpContext_SetState (dsp_context, kDSpContextState_Active);
+
+ }
+ else {
+ SDL_SetError ("DrawSprocket couldn't activate the context");
+ return NULL;
+ }
+ }
+
+
+ if (bpp != dsp_old_depth) {
+
+ DSp_CreatePalette (this);
+
+ /* update format if display depth changed */
+ if (bpp == 16) {
+
+ rmask = 0x00007c00;
+ gmask = 0x000003e0;
+ bmask = 0x0000001f;
+ }
+ if ( ! SDL_ReallocFormat (current, bpp, rmask, gmask, bmask, 0 ) ) {
+
+ SDL_SetError ("Could not reallocate video format.");
+ return(NULL);
+ }
+ }
+
+ if (!double_buf) {
+
+ /* single-buffer context */
+ DSpContext_GetFrontBuffer (dsp_context, &dsp_back_buffer);
+
+ current->hwdata = (private_hwdata*) SDL_malloc (sizeof (private_hwdata));
+ if (current ->hwdata == NULL) {
+ SDL_OutOfMemory ();
+ return NULL;
+ }
+ current->hwdata->offscreen = dsp_back_buffer;
+ current->flags |= SDL_HWSURFACE;
+ this->UpdateRects = DSp_DirectUpdate;
+ }
+ else if ( use_dsp_back_buffer ) {
+
+ DSpContext_GetBackBuffer (dsp_context, kDSpBufferKind_Normal, &dsp_back_buffer);
+
+ current->flags |= SDL_DOUBLEBUF | SDL_SWSURFACE; /* only front buffer is in VRAM */
+ this->UpdateRects = DSp_DSpUpdate;
+ }
+ else if ( DSp_NewHWSurface(this, &dsp_back_buffer, bpp, width-1, height-1) == 0 ) {
+
+ current->hwdata = (private_hwdata*) SDL_malloc (sizeof (private_hwdata));
+ if (current ->hwdata == NULL) {
+ SDL_OutOfMemory ();
+ return NULL;
+ }
+
+ SDL_memset (current->hwdata, 0, sizeof (private_hwdata));
+ current->hwdata->offscreen = dsp_back_buffer;
+ current->flags |= SDL_DOUBLEBUF | SDL_HWSURFACE;
+ this->UpdateRects = DSp_DirectUpdate; /* hardware doesn't do update rects, must be page-flipped */
+ }
+ else {
+
+ DSpContext_Release (dsp_context);
+ use_dsp_back_buffer = SDL_TRUE;
+ goto rebuild;
+ }
+
+ current->pitch = GetPortPixRowBytes(dsp_back_buffer) & 0x3FFF;
+ current->pixels = GetPixBaseAddr(GetPortPixMap(dsp_back_buffer));
+
+ current->w = width;
+ current->h = height;
+
+ #if ! TARGET_API_MAC_OSX
+
+ if (use_dsp_back_buffer) {
+
+ DSpContext_GetMonitorFrequency (dsp_context, &freq);
+ DSpContext_SetMaxFrameRate (dsp_context, freq >> 16);
+ }
+
+
+ if ( (current->flags & SDL_HWSURFACE) || (current->flags & SDL_OPENGL) )
+ DSpContext_SetVBLProc (dsp_context, DSp_VBLProc, NULL);
+ #endif
+
+ if (bpp == 8)
+ current->flags |= SDL_HWPALETTE;
+
+ if (flags & SDL_OPENGL) {
+
+ Rect rect;
+ RGBColor rgb = { 0.0, 0.0, 0.0 };
+ GrafPtr save_port;
+
+ SetRect (&rect, 0, 0, width, height);
+ SDL_Window = NewCWindow(nil, &( (**SDL_Display).gdRect), "\p", SDL_TRUE, plainDBox, (WindowPtr)-1, SDL_FALSE, 0);
+
+ if (SDL_Window == NULL) {
+
+ SDL_SetError ("DSp_SetVideoMode : OpenGL window could not be created.");
+ return NULL;
+ }
+
+ /* Set window color to black to avoid white flash*/
+ GetPort (&save_port);
+#if TARGET_API_MAC_CARBON
+ SetPort (GetWindowPort(SDL_Window));
+#else
+ SetPort (SDL_Window);
+#endif
+ RGBForeColor (&rgb);
+ PaintRect (&rect);
+ SetPort (save_port);
+
+ SetPortWindowPort (SDL_Window);
+ SelectWindow (SDL_Window);
+
+ if ( Mac_GL_Init (this) < 0 ) {
+
+ SDL_SetError ("DSp_SetVideoMode : could not create OpenGL context.");
+ return NULL;
+ }
+
+ current->flags |= SDL_OPENGL;
+ }
+
+ return current;
+}
+
+#ifdef DSP_TRY_CC_AND_AA
+
+static int DSp_MakeHWMask (_THIS, SDL_Surface *surface)
+{
+ GDHandle save_device;
+ CGrafPtr save_port;
+ GWorldPtr temp;
+ RGBColor black = { 0, 0, 0 };
+ RGBColor white = { 0xFFFF, 0xFFFF, 0xFFFF };
+ Rect rect;
+
+ Uint32 depth = GetPixDepth ( GetGDevPixMap (SDL_Display) );
+
+ SetRect (&rect, 0, 0, surface->w, surface->h);
+
+ if ( noErr != NewGWorld (&(surface->hwdata->mask), depth, &rect, 0, SDL_Display, 0 ) < 0 ) {
+
+ SDL_OutOfMemory ();
+ return (-1);
+ }
+
+ if ( noErr != NewGWorld (&temp, depth, &rect, 0 , SDL_Display, 0 ) ) {
+
+ SDL_OutOfMemory ();
+ return (-1);
+ }
+
+
+ GetGWorld (&save_port, &save_device);
+ SetGWorld (surface->hwdata->mask, SDL_Display);
+
+ RGBForeColor (&white);
+ PaintRect (&rect);
+
+ RGBBackColor (&(surface->hwdata->trans));
+
+ CopyBits ( GetPortBitMapForCopyBits(surface->hwdata->offscreen),
+ GetPortBitMapForCopyBits(surface->hwdata->mask),
+ &rect, &rect, transparent, NULL );
+
+ SetGWorld (surface->hwdata->mask, SDL_Display);
+ SetGWorld (save_port, save_device);
+ return (0);
+}
+
+static int DSp_SetHWAlpha(_THIS, SDL_Surface *surface, UInt8 alpha)
+{
+ surface->hwdata->alpha.red = (alpha / 255.0) * 65535;
+ surface->hwdata->alpha.blue = (alpha / 255.0) * 65535;
+ surface->hwdata->alpha.green = (alpha / 255.0) * 65535;
+
+ surface->flags |= SDL_SRCALPHA;
+
+ if (surface->flags & SDL_SRCCOLORKEY) {
+ return(DSp_MakeHWMask (this, surface));
+ }
+ return(0);
+}
+
+static int DSp_SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key)
+{
+ CGrafPtr save_port;
+ GDHandle save_device;
+
+ GetGWorld (&save_port, &save_device);
+ SetGWorld (surface->hwdata->offscreen, NULL);
+
+ Index2Color (key, &(surface->hwdata->trans));
+ surface->flags |= SDL_SRCCOLORKEY;
+
+ SetGWorld (save_port, save_device);
+
+ if ( surface->flags & SDL_SRCALPHA ) {
+ return(DSp_MakeHWMask (this, surface));
+ }
+ return(0);
+}
+
+#endif /* DSP_TRY_CC_AND_AA */
+
+static int DSp_NewHWSurface(_THIS, CGrafPtr *port, int depth, int width, int height) {
+
+ OSStatus err;
+ Rect bounds;
+
+ SetRect (&bounds, 0, 0, width, height);
+
+ #if useDistantHdwrMem && useLocalHdwrMem
+ if (dsp_vram_available) {
+ /* try VRAM */
+ err = NewGWorld (port, depth, &bounds, 0 , SDL_Display, useDistantHdwrMem | noNewDevice );
+ if (err != noErr)
+ DSp_SetHWError (err, SDL_FALSE);
+ else
+ return (0);
+ }
+
+ if (dsp_agp_available) {
+ /* try AGP */
+ err = NewGWorld (port, depth, &bounds, 0 , SDL_Display, useLocalHdwrMem | noNewDevice );
+
+ if (err != noErr)
+ DSp_SetHWError (err, SDL_TRUE);
+ else
+ return (0);
+ }
+#endif
+
+ return (-1);
+}
+
+static int DSp_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ GWorldPtr temp;
+
+ if ( DSp_NewHWSurface (this, &temp, surface->format->BitsPerPixel, surface->w, surface->h) < 0 )
+ return (-1);
+
+ surface->hwdata = (private_hwdata*) SDL_malloc (sizeof (private_hwdata));
+ if (surface->hwdata == NULL) {
+ SDL_OutOfMemory ();
+ return -1;
+ }
+
+ SDL_memset (surface->hwdata, 0, sizeof(private_hwdata));
+ surface->hwdata->offscreen = temp;
+ surface->pitch = GetPixRowBytes (GetPortPixMap (temp)) & 0x3FFF;
+ surface->pixels = GetPixBaseAddr (GetPortPixMap (temp));
+ surface->flags |= SDL_HWSURFACE;
+#ifdef DSP_TRY_CC_AND_AA
+ surface->flags |= SDL_HWACCEL;
+#endif
+ return 0;
+}
+
+static void DSp_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ if (surface->hwdata->offscreen != NULL)
+ DisposeGWorld (surface->hwdata->offscreen);
+ SDL_free(surface->hwdata);
+
+ surface->pixels = NULL;
+}
+
+static int DSp_CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dest)
+{
+ int accelerated;
+
+ /* Set initial acceleration on */
+ src->flags |= SDL_HWACCEL;
+
+ /* Set the surface attributes */
+ if ( (src->flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
+ if ( ! this->info.blit_hw_A ) {
+ src->flags &= ~SDL_HWACCEL;
+ }
+ }
+ if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
+ if ( ! this->info.blit_hw_CC ) {
+ src->flags &= ~SDL_HWACCEL;
+ }
+ }
+
+ /* Check to see if final surface blit is accelerated */
+ accelerated = !!(src->flags & SDL_HWACCEL);
+ if ( accelerated ) {
+ src->map->hw_blit = DSp_HWAccelBlit;
+ }
+ return(accelerated);
+}
+
+static int DSp_HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect)
+{
+ CGrafPtr save_port;
+ GDHandle save_device;
+ Rect src_rect, dst_rect;
+ RGBColor black = { 0, 0, 0 };
+ RGBColor white = { 0xFFFF, 0xFFFF, 0xFFFF };
+
+#ifdef DSP_TRY_CC_AND_AA
+ UInt32 mode;
+#endif
+
+ SetRect (&src_rect, srcrect->x, srcrect->y, srcrect->x + srcrect->w, srcrect->y + srcrect->h);
+ SetRect (&dst_rect, dstrect->x, dstrect->y, dstrect->x + dstrect->w, dstrect->y + dstrect->h);
+
+ GetGWorld (&save_port, &save_device);
+ SetGWorld (dst->hwdata->offscreen, NULL);
+
+ RGBForeColor (&black);
+ RGBBackColor (&white);
+
+#ifdef DSP_TRY_CC_AND_AA
+
+ if ( (src->flags & SDL_SRCCOLORKEY) &&
+ (src->flags & SDL_SRCALPHA) ) {
+
+ OpColor (&(src->hwdata->alpha));
+
+ CopyDeepMask ( GetPortBitMapForCopyBits(src->hwdata->offscreen),
+ GetPortBitMapForCopyBits(src->hwdata->mask),
+ GetPortBitMapForCopyBits(dst->hwdata->offscreen),
+ &src_rect, &src_rect, &dst_rect,
+ blend,
+ NULL );
+ }
+ else {
+
+ if ( src->flags & SDL_SRCCOLORKEY) {
+ RGBBackColor (&(src->hwdata->trans) );
+ mode = transparent;
+ }
+ else if (src->flags & SDL_SRCALPHA) {
+
+ OpColor (&(src->hwdata->alpha));
+ mode = blend;
+ }
+ else {
+
+ mode = srcCopy;
+ }
+
+ CopyBits ( GetPortBitMapForCopyBits(src->hwdata->offscreen),
+ GetPortBitMapForCopyBits(dst->hwdata->offscreen),
+ &src_rect, &dst_rect, mode, NULL );
+ }
+#else
+
+ CopyBits ( &(((GrafPtr)(src->hwdata->offscreen))->portBits),
+ &(((GrafPtr)(dst->hwdata->offscreen))->portBits),
+ &src_rect, &dst_rect, srcCopy, NULL );
+
+#endif /* DSP_TRY_CC_AND_AA */
+
+ SetGWorld (save_port, save_device);
+
+ return(0);
+}
+
+static int DSp_FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color)
+{
+ CGrafPtr save_port;
+ GDHandle save_device;
+ Rect fill_rect;
+ RGBColor rgb;
+
+ SetRect (&fill_rect, rect->x, rect->y, rect->x + rect->w, rect->y + rect->h);
+
+ GetGWorld (&save_port, &save_device);
+ SetGWorld (dst->hwdata->offscreen, NULL);
+
+ Index2Color (color, &rgb);
+
+ RGBForeColor (&rgb);
+ PaintRect (&fill_rect);
+
+ SetGWorld (save_port, save_device);
+
+ return(0);
+}
+
+static int DSp_FlipHWSurface(_THIS, SDL_Surface *surface)
+{
+ if ( (surface->flags & SDL_HWSURFACE) ) {
+ CGrafPtr dsp_front_buffer, save_port;
+ Rect rect;
+
+ #if ! TARGET_API_MAC_OSX
+ unsigned int old_count;
+ #endif
+
+ /* pseudo page flipping for VRAM back buffer*/
+ DSpContext_GetFrontBuffer (dsp_context, &dsp_front_buffer);
+ SetRect (&rect, 0, 0, surface->w-1, surface->h-1);
+
+ GetPort ((GrafPtr *)&save_port);
+ SetPort ((GrafPtr)dsp_front_buffer);
+
+ /* wait for retrace */
+ /* I have tried doing the swap in interrupt routine (VBL Proc) to do */
+ /* it asynchronously, but apparently CopyBits isn't interrupt safe */
+
+ #if ! TARGET_API_MAC_OSX
+ #ifndef DSP_NO_SYNC_VBL
+ old_count = retrace_count;
+ while (old_count == retrace_count)
+ ;
+ #endif
+ #endif
+
+ CopyBits ( GetPortBitMapForCopyBits(dsp_back_buffer),
+ GetPortBitMapForCopyBits(dsp_front_buffer),
+ &rect, &rect, srcCopy, NULL );
+
+ SetPort ((GrafPtr)save_port);
+
+ } else {
+ /* not really page flipping at all: DSp just blits the dirty rectangles from DSp_UpdateRects */
+ Boolean busy_flag;
+ DSpContext_SwapBuffers (dsp_context, NULL, &busy_flag); /* this waits for VBL */
+ DSpContext_GetBackBuffer (dsp_context, kDSpBufferKind_Normal, &dsp_back_buffer);
+ surface->pixels = GetPixBaseAddr( GetPortPixMap(dsp_back_buffer) );
+ }
+ return(0);
+}
+
+static int DSp_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ if ( LockPixels (GetGWorldPixMap (surface->hwdata->offscreen)) )
+ return 0;
+ else
+ return -1;
+}
+
+static void DSp_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ UnlockPixels (GetGWorldPixMap (surface->hwdata->offscreen));
+}
+
+static void DSp_DirectUpdate(_THIS, int numrects, SDL_Rect *sdl_rects)
+{
+ return;
+}
+
+static void DSp_DSpUpdate(_THIS, int numrects, SDL_Rect *sdl_rects)
+{
+#if ! TARGET_API_MAC_OSX /* Unsupported DSp in here */
+ int i;
+ Rect rect;
+
+ for (i = 0; i < numrects; i++) {
+
+ rect.top = sdl_rects[i].y;
+ rect.left = sdl_rects[i].x;
+ rect.bottom = sdl_rects[i].h + sdl_rects[i].y;
+ rect.right = sdl_rects[i].w + sdl_rects[i].x;
+
+ DSpContext_InvalBackBufferRect (dsp_context, &rect);
+ }
+#endif
+}
+
+static int DSp_CreatePalette(_THIS) {
+
+
+ /* Create our palette */
+ SDL_CTab = (CTabHandle)NewHandle(sizeof(ColorSpec)*256 + 8);
+ if ( SDL_CTab == nil ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ (**SDL_CTab).ctSeed = GetCTSeed();
+ (**SDL_CTab).ctFlags = 0;
+ (**SDL_CTab).ctSize = 255;
+ CTabChanged(SDL_CTab);
+ SDL_CPal = NewPalette(256, SDL_CTab, pmExplicit+pmTolerant, 0);
+
+ return 0;
+}
+
+static int DSp_DestroyPalette(_THIS) {
+
+ /* Free palette and restore original one */
+ if ( SDL_CTab != nil ) {
+ DisposeHandle((Handle)SDL_CTab);
+ SDL_CTab = nil;
+ }
+ if ( SDL_CPal != nil ) {
+ DisposePalette(SDL_CPal);
+ SDL_CPal = nil;
+ }
+ RestoreDeviceClut(SDL_Display);
+
+ return (0);
+}
+
+static int DSp_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ CTabHandle cTab;
+
+ int i;
+
+ cTab = SDL_CTab;
+
+ /* Verify the range of colors */
+ if ( (firstcolor+ncolors) > ((**cTab).ctSize+1) ) {
+ return(0);
+ }
+
+ /* Set the screen palette and update the display */
+ for(i = 0; i < ncolors; i++) {
+ int j = firstcolor + i;
+ (**cTab).ctTable[j].value = j;
+ (**cTab).ctTable[j].rgb.red = colors[i].r << 8 | colors[i].r;
+ (**cTab).ctTable[j].rgb.green = colors[i].g << 8 | colors[i].g;
+ (**cTab).ctTable[j].rgb.blue = colors[i].b << 8 | colors[i].b;
+ }
+
+ SetGDevice(SDL_Display);
+ SetEntries(0, (**cTab).ctSize, (ColorSpec *)&(**cTab).ctTable);
+
+ return(1);
+}
+
+void DSp_VideoQuit(_THIS)
+{
+ int i;
+
+ /* Free current video mode */
+ DSp_UnsetVideoMode(this, this->screen);
+
+ /* Free Palette and restore original */
+ DSp_DestroyPalette (this);
+
+#if SDL_MACCLASSIC_GAMMA_SUPPORT
+ Mac_QuitGamma(this);
+#endif
+
+ /* Free list of video modes */
+ if ( SDL_modelist != NULL ) {
+ for ( i=0; SDL_modelist[i]; i++ ) {
+ SDL_free(SDL_modelist[i]);
+ }
+ SDL_free(SDL_modelist);
+ SDL_modelist = NULL;
+ }
+
+ /* Unload DrawSprocket */
+ DSpShutdown ();
+}
+
+#if SDL_VIDEO_OPENGL
+
+/* swap buffers with v-sync */
+static void DSp_GL_SwapBuffers (_THIS) {
+
+ #ifndef DSP_NO_SYNC_OPENGL
+
+ unsigned int old_count;
+
+ old_count = retrace_count;
+ while (old_count == retrace_count)
+ ;
+ #endif
+
+ aglSwapBuffers (glContext);
+}
+
+#endif
diff --git a/distrib/sdl-1.2.15/src/video/macdsp/SDL_dspvideo.h b/distrib/sdl-1.2.15/src/video/macdsp/SDL_dspvideo.h
new file mode 100644
index 0000000..7fc0896
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/macdsp/SDL_dspvideo.h
@@ -0,0 +1,54 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_dspvideo_h
+#define _SDL_dspvideo_h
+
+#if TARGET_API_MAC_OSX
+# include <DrawSprocket/DrawSprocket.h> /* Drawsprocket.framework */
+#else
+#include <DrawSprocket.h>
+#endif
+
+#include "../maccommon/SDL_lowvideo.h"
+
+/* DrawSprocket specific information */
+struct DSpInfo {
+ DSpContextReference dsp_context;
+ CGrafPtr dsp_back_buffer;
+ int dsp_old_depth;
+
+ /* Flags for hw acceleration */
+ int dsp_vram_available;
+ int dsp_agp_available;
+
+
+};
+/* Old variable names */
+#define dsp_context (this->hidden->dspinfo->dsp_context)
+#define dsp_back_buffer (this->hidden->dspinfo->dsp_back_buffer)
+#define dsp_old_depth (this->hidden->dspinfo->dsp_old_depth)
+#define dsp_vram_available (this->hidden->dspinfo->dsp_vram_available)
+#define dsp_agp_available (this->hidden->dspinfo->dsp_agp_available)
+
+#endif /* _SDL_dspvideo_h */
diff --git a/distrib/sdl-1.2.15/src/video/macrom/SDL_romvideo.c b/distrib/sdl-1.2.15/src/video/macrom/SDL_romvideo.c
new file mode 100644
index 0000000..4c48881
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/macrom/SDL_romvideo.c
@@ -0,0 +1,745 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#if defined(__APPLE__) && defined(__MACH__)
+#include <Carbon/Carbon.h>
+#if USE_QUICKTIME
+#include <QuickTime/Movies.h>
+#endif
+#elif TARGET_API_MAC_CARBON && (UNIVERSAL_INTERFACES_VERSION > 0x0335)
+#include <Carbon.h>
+/* The fullscreen code requires the QuickTime framework, and the window
+ is still at the back on Mac OS X, which is where this code is needed.
+ */
+#if USE_QUICKTIME
+#include <Movies.h>
+#endif
+#else
+#include <Quickdraw.h>
+#include <LowMem.h>
+#include <Gestalt.h>
+#include <Devices.h>
+#include <DiskInit.h>
+#include <QDOffscreen.h>
+#endif
+
+#include "SDL_video.h"
+#include "SDL_syswm.h"
+#include "../SDL_sysvideo.h"
+#include "SDL_romvideo.h"
+#include "../maccommon/SDL_macgl_c.h"
+#include "../maccommon/SDL_macwm_c.h"
+#include "../maccommon/SDL_macmouse_c.h"
+#include "../maccommon/SDL_macevents_c.h"
+
+/* Initialization/Query functions */
+static int ROM_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **ROM_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *ROM_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int ROM_SetColors(_THIS, int firstcolor, int ncolors,
+ SDL_Color *colors);
+static void ROM_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int ROM_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int ROM_LockHWSurface(_THIS, SDL_Surface *surface);
+static void ROM_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void ROM_FreeHWSurface(_THIS, SDL_Surface *surface);
+
+#if !TARGET_API_MAC_CARBON /* This seems not to be available? -sts Aug 2000 */
+/* Saved state for the menu bar */
+static RgnHandle gSaveGrayRgn = nil;
+static short gSaveMenuBar = 0;
+static Boolean gSaveCSVis = true;
+
+#if powerc
+/* Mixed mode glue to activate the 68K emulator and twiddle a register */
+#define ONEWORDSTUB(p1) \
+ { 0x41FA, 0x0010, 0x209F, (p1), 0x41FA, \
+ 0x0008, 0x2F10, 0x4E75, 0x0000, 0x0000, 0x0000 }
+
+#define TWOWORDSTUB(p1,p2) \
+ { 0x41FA, 0x0012, 0x209F, (p1), (p2), 0x41FA, \
+ 0x0008, 0x2F10, 0x4E75, 0x0000, 0x0000, 0x0000 }
+
+#define THREEWORDSTUB(p1,p2,p3) \
+ { 0x41FA, 0x0014, 0x209F, (p1), (p2), (p3), 0x41FA, \
+ 0x0008, 0x2F10, 0x4E75, 0x0000, 0x0000, 0x0000 }
+
+/* ControlStrip inline glue for PowerPC */
+static pascal Boolean SBIsControlStripVisible(void)
+{
+ static short procData[] = TWOWORDSTUB(0x7000, 0xAAF2);
+ ProcInfoType procInfo = kD0DispatchedPascalStackBased
+ | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
+ | DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE(kFourByteCode);
+
+ return((Boolean) CallUniversalProc((UniversalProcPtr) procData, procInfo, 0x00));
+}
+
+static pascal void SBShowHideControlStrip(Boolean showIt)
+{
+ static short procData[] = THREEWORDSTUB(0x303C, 0x0101, 0xAAF2);
+ ProcInfoType procInfo = kD0DispatchedPascalStackBased
+ | DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE(kFourByteCode)
+ | DISPATCHED_STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Boolean)));
+
+ CallUniversalProc((UniversalProcPtr) procData, procInfo, 0x01, showIt);
+}
+#endif /* powerc */
+#endif /* !TARGET_API_MAC_CARBON */
+
+/* Macintosh toolbox driver bootstrap functions */
+
+static int ROM_Available(void)
+{
+ return(1);
+}
+
+static void ROM_DeleteDevice(SDL_VideoDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_VideoDevice *ROM_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device;
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *device->hidden));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( device ) {
+ SDL_free(device);
+ }
+ return(0);
+ }
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+
+ /* Set the function pointers */
+ device->VideoInit = ROM_VideoInit;
+ device->ListModes = ROM_ListModes;
+ device->SetVideoMode = ROM_SetVideoMode;
+ device->SetColors = ROM_SetColors;
+ device->UpdateRects = NULL;
+ device->VideoQuit = ROM_VideoQuit;
+ device->AllocHWSurface = ROM_AllocHWSurface;
+ device->CheckHWBlit = NULL;
+ device->FillHWRect = NULL;
+ device->SetHWColorKey = NULL;
+ device->SetHWAlpha = NULL;
+ device->LockHWSurface = ROM_LockHWSurface;
+ device->UnlockHWSurface = ROM_UnlockHWSurface;
+ device->FlipHWSurface = NULL;
+ device->FreeHWSurface = ROM_FreeHWSurface;
+#if SDL_MACCLASSIC_GAMMA_SUPPORT
+ device->SetGammaRamp = Mac_SetGammaRamp;
+ device->GetGammaRamp = Mac_GetGammaRamp;
+#endif
+#if SDL_VIDEO_OPENGL
+ device->GL_MakeCurrent = Mac_GL_MakeCurrent;
+ device->GL_SwapBuffers = Mac_GL_SwapBuffers;
+ device->GL_LoadLibrary = Mac_GL_LoadLibrary;
+ device->GL_GetProcAddress = Mac_GL_GetProcAddress;
+#endif /* Have OpenGL */
+ device->SetCaption = Mac_SetCaption;
+ device->SetIcon = NULL;
+ device->IconifyWindow = NULL;
+ device->GrabInput = NULL;
+ device->GetWMInfo = NULL;
+ device->FreeWMCursor = Mac_FreeWMCursor;
+ device->CreateWMCursor = Mac_CreateWMCursor;
+ device->ShowWMCursor = Mac_ShowWMCursor;
+ device->WarpWMCursor = Mac_WarpWMCursor;
+ device->InitOSKeymap = Mac_InitOSKeymap;
+ device->PumpEvents = Mac_PumpEvents;
+
+ device->free = ROM_DeleteDevice;
+
+ return device;
+}
+
+VideoBootStrap TOOLBOX_bootstrap = {
+ "toolbox", "MacOS ROM Toolbox",
+ ROM_Available, ROM_CreateDevice
+};
+
+
+static int ROM_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ long info;
+
+ /* Check out some things about the system */
+ Gestalt(gestaltQuickdrawVersion, &info);
+ if ( info == gestaltOriginalQD ) {
+ SDL_SetError("Color Quickdraw not available");
+ return(-1);
+ }
+
+ /* Start ROMintosh events */
+ Mac_InitEvents(this);
+
+ /* Get a handle to the main monitor */
+ SDL_Display = GetMainDevice();
+
+ /* Determine the current screen size */
+ this->info.current_w = (**SDL_Display).gdRect.right;
+ this->info.current_h = (**SDL_Display).gdRect.bottom;
+
+ /* Determine pixel format */
+ vformat->BitsPerPixel = (**(**SDL_Display).gdPMap).pixelSize;
+ switch (vformat->BitsPerPixel) {
+ case 16: /* 5-5-5 RGB */
+ vformat->Rmask = 0x00007c00;
+ vformat->Gmask = 0x000003e0;
+ vformat->Bmask = 0x0000001f;
+ break;
+ default:
+ break;
+ }
+
+ /* Create our palette */
+ SDL_CTab = (CTabHandle)NewHandle(sizeof(ColorSpec)*256 + 8);
+ if ( SDL_CTab == nil ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ (**SDL_CTab).ctSeed = GetCTSeed();
+ (**SDL_CTab).ctFlags = 0;
+ (**SDL_CTab).ctSize = 255;
+ CTabChanged(SDL_CTab);
+ SDL_CPal = NewPalette(256, SDL_CTab, pmExplicit+pmTolerant, 0);
+
+ /* Get a list of available fullscreen modes */
+ SDL_modelist = (SDL_Rect **)SDL_malloc((1+1)*sizeof(SDL_Rect *));
+ if ( SDL_modelist ) {
+ SDL_modelist[0] = (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
+ if ( SDL_modelist[0] ) {
+ SDL_modelist[0]->x = 0;
+ SDL_modelist[0]->y = 0;
+ SDL_modelist[0]->w = (**SDL_Display).gdRect.right;
+ SDL_modelist[0]->h = (**SDL_Display).gdRect.bottom;
+ }
+ SDL_modelist[1] = NULL;
+ }
+
+ /* Fill in some window manager capabilities */
+ this->info.wm_available = 1;
+
+ /* We're done! */
+ return(0);
+}
+
+static SDL_Rect **ROM_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ if ( this->screen->format->BitsPerPixel == format->BitsPerPixel ) {
+ if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
+ return(SDL_modelist);
+ } else {
+ return((SDL_Rect **)-1);
+ }
+ } else {
+ return((SDL_Rect **)0);
+ }
+}
+
+static void ROM_HideMenuBar(_THIS)
+{
+#if !TARGET_API_MAC_CARBON /* This seems not to be available? -sts Aug 2000 */
+ RgnHandle drawRgn = nil;
+ RgnHandle tempRgn = nil;
+ RgnHandle grayRgn = nil;
+ WindowPtr window = nil;
+ GDHandle gd = nil;
+ GrafPtr savePort;
+ long response;
+ short height;
+ EventRecord theEvent;
+
+ height = GetMBarHeight();
+
+ if ( height > 0 ) {
+ tempRgn = NewRgn();
+ drawRgn = NewRgn();
+ gSaveGrayRgn = NewRgn();
+ if ( ! tempRgn || ! drawRgn || ! gSaveGrayRgn ) {
+ goto CLEANUP;
+ }
+ grayRgn = GetGrayRgn(); /* No need to check for this */
+
+ GetPort(&savePort);
+
+ /* Hide the control strip if it's present, and record its
+ previous position into the dirty region for redrawing.
+ This isn't necessary, but may help catch stray bits. */
+ CopyRgn(grayRgn, tempRgn);
+ if (!Gestalt(gestaltControlStripAttr, &response) &&
+ (response & (1L << gestaltControlStripExists))) {
+ gSaveCSVis = SBIsControlStripVisible();
+ if (gSaveCSVis)
+ SBShowHideControlStrip(false);
+ }
+ DiffRgn(grayRgn, tempRgn, drawRgn);
+
+ /* Save the gray region once the control strip is hidden*/
+ CopyRgn(grayRgn, gSaveGrayRgn);
+
+ /* Change the menu height in lowmem */
+ gSaveMenuBar = height;
+ LMSetMBarHeight(0);
+
+ /* Walk the monitor rectangles, and combine any pieces that
+ aren't in GrayRgn: menubar, round corners, fake floaters. */
+ for(gd = GetDeviceList(); gd; gd = GetNextDevice(gd))
+ {
+ if (!TestDeviceAttribute(gd, screenDevice)) continue;
+ if (!TestDeviceAttribute(gd, screenActive)) continue;
+
+ RectRgn(tempRgn, &(*gd)->gdRect); /* Get the whole screen */
+ DiffRgn(tempRgn, grayRgn, tempRgn); /* Subtract out GrayRgn */
+ UnionRgn(tempRgn, drawRgn, drawRgn);/* Combine all the bits */
+ }
+
+ /* Add the bits into the GrayRgn */
+ UnionRgn(drawRgn, grayRgn, grayRgn);
+
+ /* Modify the vis regions of exposed windows */
+ window = (FrontWindow()) ? FrontWindow() : (WindowPtr) -1L;
+ PaintBehind(window, drawRgn);
+ CalcVisBehind(window, drawRgn);
+
+ SetPort(savePort);
+
+ /* Yield time so that floaters can catch up */
+ EventAvail(0, &theEvent);
+ EventAvail(0, &theEvent);
+ EventAvail(0, &theEvent);
+ EventAvail(0, &theEvent);
+ }
+
+CLEANUP:
+
+ if (tempRgn) DisposeRgn(tempRgn);
+ if (drawRgn) DisposeRgn(drawRgn);
+#endif /* !TARGET_API_MAC_CARBON */
+}
+
+static void ROM_ShowMenuBar(_THIS)
+{
+#if !TARGET_API_MAC_CARBON /* This seems not to be available? -sts Aug 2000 */
+ RgnHandle drawRgn = nil;
+ RgnHandle menuRgn = nil;
+ RgnHandle tempRgn = nil;
+ RgnHandle grayRgn = nil;
+ WindowPtr window = nil;
+ GrafPtr wMgrPort;
+ GrafPtr savePort;
+ Rect menuRect;
+ long response;
+ short height;
+ EventRecord theEvent;
+ RGBColor saveRGB;
+ RGBColor blackRGB = { 0, 0, 0 };
+
+ height = GetMBarHeight();
+
+ if ((height <= 0) && (gSaveMenuBar > 0)) {
+ drawRgn = NewRgn();
+ menuRgn = NewRgn();
+ tempRgn = NewRgn();
+ if ( ! tempRgn || ! drawRgn || ! gSaveGrayRgn ) {
+ goto CLEANUP;
+ }
+ grayRgn = GetGrayRgn(); /* No need to check for this */
+
+ GetPort(&savePort);
+ GetWMgrPort(&wMgrPort);
+
+ /* Set the height properly */
+ LMSetMBarHeight(gSaveMenuBar);
+
+ /* Restore the old GrayRgn: rounded corners, etc, but not
+ the menubar -- subtract that out first! */
+ if (gSaveGrayRgn)
+ {
+ menuRect = (*GetMainDevice())->gdRect;
+ menuRect.bottom = menuRect.top + gSaveMenuBar;
+ RectRgn(menuRgn, &menuRect);
+
+ DiffRgn(grayRgn, gSaveGrayRgn, drawRgn); /* What do we inval? */
+ DiffRgn(drawRgn, menuRgn, drawRgn); /* Clip out the menu */
+
+ /* Now redraw the corners and other bits black */
+ SetPort(wMgrPort);
+ GetClip(tempRgn);
+ SetClip(drawRgn);
+ GetForeColor(&saveRGB);
+ RGBForeColor(&blackRGB);
+ PaintRgn(drawRgn);
+ RGBForeColor(&saveRGB);
+ SetClip(tempRgn);
+ SetPort(savePort);
+
+ UnionRgn(drawRgn, menuRgn, drawRgn); /* Put back the menu */
+
+ /* Now actually restore the GrayRgn */
+ CopyRgn(gSaveGrayRgn, grayRgn);
+ DisposeRgn(gSaveGrayRgn);
+ gSaveGrayRgn = nil;
+ }
+
+ /* Modify the vis regions of exposed windows and draw menubar */
+ window = (FrontWindow()) ? FrontWindow() : (WindowPtr) -1L;
+ PaintBehind(window, drawRgn);
+ CalcVisBehind(window, drawRgn);
+ DrawMenuBar();
+
+ SetPort(savePort);
+ gSaveMenuBar = 0;
+
+ /* Now show the control strip if it's present */
+ if (!Gestalt(gestaltControlStripAttr, &response) &&
+ (response & (1L << gestaltControlStripExists)))
+ {
+ if (gSaveCSVis && !SBIsControlStripVisible())
+ SBShowHideControlStrip(true);
+ gSaveCSVis = true;
+ }
+
+ /* Yield time so that floaters can catch up */
+ EventAvail(0, &theEvent);
+ EventAvail(0, &theEvent);
+ EventAvail(0, &theEvent);
+ EventAvail(0, &theEvent);
+ }
+
+CLEANUP:
+
+ if (drawRgn) DisposeRgn(drawRgn);
+ if (menuRgn) DisposeRgn(menuRgn);
+ if (tempRgn) DisposeRgn(tempRgn);
+#endif /* !TARGET_API_MAC_CARBON */
+}
+
+/* Various screen update functions available */
+static void ROM_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
+static void ROM_WindowUpdate(_THIS, int numrects, SDL_Rect *rects);
+
+static void ROM_UnsetVideoMode(_THIS, SDL_Surface *current)
+{
+ /* Free the current window, if any */
+ if ( SDL_Window != nil ) {
+ GWorldPtr memworld;
+
+ /* Handle OpenGL support */
+ Mac_GL_Quit(this);
+
+ memworld = (GWorldPtr)GetWRefCon(SDL_Window);
+ if ( memworld != nil ) {
+ UnlockPixels(GetGWorldPixMap(memworld));
+ DisposeGWorld(memworld);
+ }
+ if ( (current->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
+#if USE_QUICKTIME
+ EndFullScreen(fullscreen_ctx, nil);
+ SDL_Window = nil;
+#else
+ ROM_ShowMenuBar(this);
+#endif
+ }
+ }
+ current->pixels = NULL;
+ current->flags &= ~(SDL_HWSURFACE|SDL_FULLSCREEN);
+}
+
+static SDL_Surface *ROM_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ Rect wrect, orect;
+#if TARGET_API_MAC_CARBON
+ Rect tmprect;
+#endif
+
+ /* Free any previous video mode */
+ ROM_UnsetVideoMode(this, current);
+
+ /* Create the ROM window and SDL video surface */
+ current->flags = 0; /* Clear flags */
+ current->w = width;
+ current->h = height;
+ SetRect(&wrect, 0, 0, width, height);
+ if ( SDL_Window ) {
+ /* If we recreate the window, don't move it around */
+#if TARGET_API_MAC_CARBON
+ orect = *GetWindowPortBounds(SDL_Window, &tmprect);
+#else
+ orect = SDL_Window->portRect;
+#endif
+ OffsetRect(&wrect, orect.left, orect.top);
+ } else {
+ /* Center the window the first time we show it */
+ OffsetRect(&wrect,
+ (SDL_modelist[0]->w-width)/2, (SDL_modelist[0]->h-height)/2);
+ }
+
+#if defined(__MACOSX__) && !USE_QUICKTIME
+ /* Hum.. fullscreen mode is broken */
+ flags &= ~SDL_FULLSCREEN;
+#endif
+ if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
+ /* Create the fullscreen window and use screen bits */
+ current->flags |= SDL_HWSURFACE|SDL_FULLSCREEN;
+ if ( SDL_Window ) {
+ DisposeWindow(SDL_Window);
+ }
+#if USE_QUICKTIME
+ BeginFullScreen(&fullscreen_ctx, nil, 0,0, &SDL_Window, nil, 0);
+#else
+ SDL_Window = NewCWindow(nil, &wrect, "\p", true, plainDBox,
+ (WindowPtr)-1, false, 0);
+ ROM_HideMenuBar(this);
+#endif
+ current->pitch = (**(**SDL_Display).gdPMap).rowBytes & 0x3FFF;
+ current->pixels = (**(**SDL_Display).gdPMap).baseAddr;
+ this->UpdateRects = ROM_DirectUpdate;
+ } else {
+ GWorldPtr memworld;
+ PixMapHandle pixmap;
+ int style;
+
+ style = noGrowDocProc;
+ if ( flags & SDL_NOFRAME ) {
+ style = plainDBox;
+ current->flags |= SDL_NOFRAME;
+ } else
+ if ( flags & SDL_RESIZABLE ) {
+ style = zoomDocProc;
+ current->flags |= SDL_RESIZABLE;
+ }
+ if ( SDL_Window && (style == current_style) ) {
+ /* Resize existing window, if necessary */
+ if ( ((orect.right-orect.left) != width) ||
+ ((orect.bottom-orect.top) != height) ) {
+ SizeWindow(SDL_Window, width, height, false);
+ }
+ } else {
+ /* Recreate the window in the new style */
+ if ( SDL_Window ) {
+ DisposeWindow(SDL_Window);
+ }
+ SDL_Window = NewCWindow(nil, &wrect, "\p", true,
+ style, (WindowPtr)-1, true, 0);
+
+ /* Set the window title, if any */
+ { char *title;
+ SDL_WM_GetCaption(&title, NULL);
+ if ( title ) {
+ Mac_SetCaption(this, title, NULL);
+ }
+ }
+ }
+ current_style = style;
+ SetPalette(SDL_Window, SDL_CPal, false);
+ ActivatePalette(SDL_Window);
+ if ( NewGWorld(&memworld, 0,
+#if TARGET_API_MAC_CARBON
+ GetWindowPortBounds(SDL_Window, &tmprect),
+#else
+ &SDL_Window->portRect,
+#endif
+ SDL_CTab, nil, 0) != noErr ) {
+ SDL_SetError("NewGWorld() failed");
+ return(NULL);
+ }
+ SetWRefCon(SDL_Window, (long)memworld);
+ pixmap = GetGWorldPixMap(memworld);
+ LockPixels(pixmap);
+ current->pitch = (**pixmap).rowBytes & 0x3FFF;
+ current->pixels = GetPixBaseAddr(pixmap);
+ this->UpdateRects = ROM_WindowUpdate;
+ }
+ SetPortWindowPort(SDL_Window);
+ SelectWindow(SDL_Window);
+
+ /* Handle OpenGL support */
+ if ( flags & SDL_OPENGL ) {
+ if ( Mac_GL_Init(this) == 0 ) {
+ current->flags |= SDL_OPENGL;
+ } else {
+ current = NULL;
+ }
+ }
+
+ if ( (flags & SDL_HWPALETTE) && (flags & SDL_FULLSCREEN) )
+ current->flags |= SDL_HWPALETTE;
+
+ /* We're live! */
+ return(current);
+}
+
+/* We don't actually allow hardware surfaces other than the main one */
+static int ROM_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(-1);
+}
+static void ROM_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+static int ROM_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(0);
+}
+static void ROM_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+static void ROM_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+ /* The application is already updating the visible video memory */
+ return;
+}
+
+static void ROM_WindowUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+ GWorldPtr memworld;
+ GrafPtr saveport;
+ CGrafPtr thePort;
+ const BitMap *memBits;
+ const BitMap *winBits;
+ int i;
+ Rect update;
+
+ /* Copy from the offscreen GWorld to the window port */
+ GetPort(&saveport);
+ SetPortWindowPort(SDL_Window);
+ thePort = GetWindowPort(SDL_Window);
+ memworld = (GWorldPtr)GetWRefCon(SDL_Window);
+#if TARGET_API_MAC_CARBON && ACCESSOR_CALLS_ARE_FUNCTIONS
+ memBits = GetPortBitMapForCopyBits((CGrafPtr) memworld);
+#else
+ memBits = &((GrafPtr)memworld)->portBits;
+#endif
+#if TARGET_API_MAC_CARBON && ACCESSOR_CALLS_ARE_FUNCTIONS
+ winBits = GetPortBitMapForCopyBits(thePort);
+#else
+ winBits = &SDL_Window->portBits;
+#endif
+ for ( i=0; i<numrects; ++i ) {
+ update.left = rects[i].x;
+ update.right = rects[i].x+rects[i].w;
+ update.top = rects[i].y;
+ update.bottom = rects[i].y+rects[i].h;
+ CopyBits(memBits, winBits,
+ &update, &update, srcCopy, nil);
+ }
+#if TARGET_API_MAC_CARBON
+ if ( QDIsPortBuffered(thePort) ) {
+ QDFlushPortBuffer(thePort, NULL);
+ }
+#endif
+ SetPort(saveport);
+}
+
+static int ROM_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ CTabHandle cTab;
+ int i;
+
+ /* Get the colortable from the either the display or window */
+ if ( (this->screen->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
+ cTab = (**(**SDL_Display).gdPMap).pmTable;
+ } else {
+ cTab = SDL_CTab;
+ }
+
+ /* Verify the range of colors */
+ if ( (firstcolor+ncolors) > ((**cTab).ctSize+1) ) {
+ return(0);
+ }
+
+ /* Set the screen palette and update the display */
+ for ( i=0; i< ncolors; ++i ) {
+ int j = firstcolor + i;
+ (**cTab).ctTable[j].value = j;
+ (**cTab).ctTable[j].rgb.red = colors[i].r << 8 | colors[i].r;
+ (**cTab).ctTable[j].rgb.green = colors[i].g << 8 | colors[i].g;
+ (**cTab).ctTable[j].rgb.blue = colors[i].b << 8 | colors[i].b;
+ }
+
+#if 0
+ if ( (this->screen->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN )
+#endif
+ {
+ GDevice **odisplay;
+ odisplay = GetGDevice();
+ SetGDevice(SDL_Display);
+ SetEntries(0, (**cTab).ctSize, (ColorSpec *)&(**cTab).ctTable);
+ SetGDevice(odisplay);
+ }
+ return(1);
+}
+
+void ROM_VideoQuit(_THIS)
+{
+ int i;
+
+ /* Free current video mode */
+ ROM_UnsetVideoMode(this, this->screen);
+ if ( SDL_Window ) {
+ DisposeWindow(SDL_Window);
+ SDL_Window = nil;
+ }
+
+ /* Free palette and restore original one */
+ if ( SDL_CTab != nil ) {
+ DisposeHandle((Handle)SDL_CTab);
+ SDL_CTab = nil;
+ }
+ if ( SDL_CPal != nil ) {
+ DisposePalette(SDL_CPal);
+ SDL_CPal = nil;
+ }
+ RestoreDeviceClut(GetMainDevice());
+
+#if SDL_MACCLASSIC_GAMMA_SUPPORT
+ Mac_QuitGamma(this);
+#endif
+
+ /* Free list of video modes */
+ if ( SDL_modelist != NULL ) {
+ for ( i=0; SDL_modelist[i]; ++i ) {
+ SDL_free(SDL_modelist[i]);
+ }
+ SDL_free(SDL_modelist);
+ SDL_modelist = NULL;
+ }
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/macrom/SDL_romvideo.h b/distrib/sdl-1.2.15/src/video/macrom/SDL_romvideo.h
new file mode 100644
index 0000000..0380f91
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/macrom/SDL_romvideo.h
@@ -0,0 +1,29 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_romvideo_h
+#define _SDL_romvideo_h
+
+#include "../maccommon/SDL_lowvideo.h"
+
+#endif /* _SDL_romvideo_h */
diff --git a/distrib/sdl-1.2.15/src/video/math_private.h b/distrib/sdl-1.2.15/src/video/math_private.h
new file mode 100644
index 0000000..1087d7d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/math_private.h
@@ -0,0 +1,173 @@
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * from: @(#)fdlibm.h 5.1 93/09/24
+ * $Id$
+ */
+
+#ifndef _MATH_PRIVATE_H_
+#define _MATH_PRIVATE_H_
+
+#include "SDL_name.h"
+#include "SDL_endian.h"
+
+#define huge really_big /* huge is a reserved keyword in VC++ 6.0 */
+#define u_int32_t uint32_t
+
+/* The original fdlibm code used statements like:
+ n0 = ((*(int*)&one)>>29)^1; * index of high word *
+ ix0 = *(n0+(int*)&x); * high word of x *
+ ix1 = *((1-n0)+(int*)&x); * low word of x *
+ to dig two 32 bit words out of the 64 bit IEEE floating point
+ value. That is non-ANSI, and, moreover, the gcc instruction
+ scheduler gets it wrong. We instead use the following macros.
+ Unlike the original code, we determine the endianness at compile
+ time, not at run time; I don't see much benefit to selecting
+ endianness at run time. */
+
+/* A union which permits us to convert between a double and two 32 bit
+ ints. */
+
+/*
+ * Math on arm is special:
+ * For FPA, float words are always big-endian.
+ * For VFP, floats words follow the memory system mode.
+ */
+
+#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) || \
+ (!defined(__VFP_FP__) && (defined(__arm__) || defined(__thumb__)))
+
+typedef union
+{
+ double value;
+ struct
+ {
+ u_int32_t msw;
+ u_int32_t lsw;
+ } parts;
+} ieee_double_shape_type;
+
+#else
+
+typedef union
+{
+ double value;
+ struct
+ {
+ u_int32_t lsw;
+ u_int32_t msw;
+ } parts;
+} ieee_double_shape_type;
+
+#endif
+
+/* Get two 32 bit ints from a double. */
+
+#define EXTRACT_WORDS(ix0,ix1,d) \
+do { \
+ ieee_double_shape_type ew_u; \
+ ew_u.value = (d); \
+ (ix0) = ew_u.parts.msw; \
+ (ix1) = ew_u.parts.lsw; \
+} while (0)
+
+/* Get the more significant 32 bit int from a double. */
+
+#define GET_HIGH_WORD(i,d) \
+do { \
+ ieee_double_shape_type gh_u; \
+ gh_u.value = (d); \
+ (i) = gh_u.parts.msw; \
+} while (0)
+
+/* Get the less significant 32 bit int from a double. */
+
+#define GET_LOW_WORD(i,d) \
+do { \
+ ieee_double_shape_type gl_u; \
+ gl_u.value = (d); \
+ (i) = gl_u.parts.lsw; \
+} while (0)
+
+/* Set a double from two 32 bit ints. */
+
+#define INSERT_WORDS(d,ix0,ix1) \
+do { \
+ ieee_double_shape_type iw_u; \
+ iw_u.parts.msw = (ix0); \
+ iw_u.parts.lsw = (ix1); \
+ (d) = iw_u.value; \
+} while (0)
+
+/* Set the more significant 32 bits of a double from an int. */
+
+#define SET_HIGH_WORD(d,v) \
+do { \
+ ieee_double_shape_type sh_u; \
+ sh_u.value = (d); \
+ sh_u.parts.msw = (v); \
+ (d) = sh_u.value; \
+} while (0)
+
+/* Set the less significant 32 bits of a double from an int. */
+
+#define SET_LOW_WORD(d,v) \
+do { \
+ ieee_double_shape_type sl_u; \
+ sl_u.value = (d); \
+ sl_u.parts.lsw = (v); \
+ (d) = sl_u.value; \
+} while (0)
+
+/* A union which permits us to convert between a float and a 32 bit
+ int. */
+
+typedef union
+{
+ float value;
+ u_int32_t word;
+} ieee_float_shape_type;
+
+/* Get a 32 bit int from a float. */
+
+#define GET_FLOAT_WORD(i,d) \
+do { \
+ ieee_float_shape_type gf_u; \
+ gf_u.value = (d); \
+ (i) = gf_u.word; \
+} while (0)
+
+/* Set a float from a 32 bit int. */
+
+#define SET_FLOAT_WORD(d,i) \
+do { \
+ ieee_float_shape_type sf_u; \
+ sf_u.word = (i); \
+ (d) = sf_u.value; \
+} while (0)
+
+
+#ifdef __STDC__
+static const double
+#else
+static double
+#endif
+zero = 0.0,
+one = 1.0,
+two = 2.0,
+two53 = 9007199254740992.0, /* 0x43400000, 0x00000000 */
+two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
+twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
+huge = 1.0e+300,
+tiny = 1.0e-300;
+
+#endif /* _MATH_PRIVATE_H_ */
diff --git a/distrib/sdl-1.2.15/src/video/mmx.h b/distrib/sdl-1.2.15/src/video/mmx.h
new file mode 100644
index 0000000..dcee7b0
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/mmx.h
@@ -0,0 +1,704 @@
+/* mmx.h
+
+ MultiMedia eXtensions GCC interface library for IA32.
+
+ To use this library, simply include this header file
+ and compile with GCC. You MUST have inlining enabled
+ in order for mmx_ok() to work; this can be done by
+ simply using -O on the GCC command line.
+
+ Compiling with -DMMX_TRACE will cause detailed trace
+ output to be sent to stderr for each mmx operation.
+ This adds lots of code, and obviously slows execution to
+ a crawl, but can be very useful for debugging.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
+ LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR ANY PARTICULAR PURPOSE.
+
+ 1997-99 by H. Dietz and R. Fisher
+
+ Notes:
+ It appears that the latest gas has the pand problem fixed, therefore
+ I'll undefine BROKEN_PAND by default.
+*/
+
+#ifndef _MMX_H
+#define _MMX_H
+
+
+/* Warning: at this writing, the version of GAS packaged
+ with most Linux distributions does not handle the
+ parallel AND operation mnemonic correctly. If the
+ symbol BROKEN_PAND is defined, a slower alternative
+ coding will be used. If execution of mmxtest results
+ in an illegal instruction fault, define this symbol.
+*/
+#undef BROKEN_PAND
+
+
+/* The type of an value that fits in an MMX register
+ (note that long long constant values MUST be suffixed
+ by LL and unsigned long long values by ULL, lest
+ they be truncated by the compiler)
+*/
+typedef union {
+ long long q; /* Quadword (64-bit) value */
+ unsigned long long uq; /* Unsigned Quadword */
+ int d[2]; /* 2 Doubleword (32-bit) values */
+ unsigned int ud[2]; /* 2 Unsigned Doubleword */
+ short w[4]; /* 4 Word (16-bit) values */
+ unsigned short uw[4]; /* 4 Unsigned Word */
+ char b[8]; /* 8 Byte (8-bit) values */
+ unsigned char ub[8]; /* 8 Unsigned Byte */
+ float s[2]; /* Single-precision (32-bit) value */
+} __attribute__ ((aligned (8))) mmx_t; /* On an 8-byte (64-bit) boundary */
+
+
+#if 0
+/* Function to test if multimedia instructions are supported...
+*/
+inline extern int
+mm_support(void)
+{
+ /* Returns 1 if MMX instructions are supported,
+ 3 if Cyrix MMX and Extended MMX instructions are supported
+ 5 if AMD MMX and 3DNow! instructions are supported
+ 0 if hardware does not support any of these
+ */
+ register int rval = 0;
+
+ __asm__ __volatile__ (
+ /* See if CPUID instruction is supported ... */
+ /* ... Get copies of EFLAGS into eax and ecx */
+ "pushf\n\t"
+ "popl %%eax\n\t"
+ "movl %%eax, %%ecx\n\t"
+
+ /* ... Toggle the ID bit in one copy and store */
+ /* to the EFLAGS reg */
+ "xorl $0x200000, %%eax\n\t"
+ "push %%eax\n\t"
+ "popf\n\t"
+
+ /* ... Get the (hopefully modified) EFLAGS */
+ "pushf\n\t"
+ "popl %%eax\n\t"
+
+ /* ... Compare and test result */
+ "xorl %%eax, %%ecx\n\t"
+ "testl $0x200000, %%ecx\n\t"
+ "jz NotSupported1\n\t" /* CPUID not supported */
+
+
+ /* Get standard CPUID information, and
+ go to a specific vendor section */
+ "movl $0, %%eax\n\t"
+ "cpuid\n\t"
+
+ /* Check for Intel */
+ "cmpl $0x756e6547, %%ebx\n\t"
+ "jne TryAMD\n\t"
+ "cmpl $0x49656e69, %%edx\n\t"
+ "jne TryAMD\n\t"
+ "cmpl $0x6c65746e, %%ecx\n"
+ "jne TryAMD\n\t"
+ "jmp Intel\n\t"
+
+ /* Check for AMD */
+ "\nTryAMD:\n\t"
+ "cmpl $0x68747541, %%ebx\n\t"
+ "jne TryCyrix\n\t"
+ "cmpl $0x69746e65, %%edx\n\t"
+ "jne TryCyrix\n\t"
+ "cmpl $0x444d4163, %%ecx\n"
+ "jne TryCyrix\n\t"
+ "jmp AMD\n\t"
+
+ /* Check for Cyrix */
+ "\nTryCyrix:\n\t"
+ "cmpl $0x69727943, %%ebx\n\t"
+ "jne NotSupported2\n\t"
+ "cmpl $0x736e4978, %%edx\n\t"
+ "jne NotSupported3\n\t"
+ "cmpl $0x64616574, %%ecx\n\t"
+ "jne NotSupported4\n\t"
+ /* Drop through to Cyrix... */
+
+
+ /* Cyrix Section */
+ /* See if extended CPUID level 80000001 is supported */
+ /* The value of CPUID/80000001 for the 6x86MX is undefined
+ according to the Cyrix CPU Detection Guide (Preliminary
+ Rev. 1.01 table 1), so we'll check the value of eax for
+ CPUID/0 to see if standard CPUID level 2 is supported.
+ According to the table, the only CPU which supports level
+ 2 is also the only one which supports extended CPUID levels.
+ */
+ "cmpl $0x2, %%eax\n\t"
+ "jne MMXtest\n\t" /* Use standard CPUID instead */
+
+ /* Extended CPUID supported (in theory), so get extended
+ features */
+ "movl $0x80000001, %%eax\n\t"
+ "cpuid\n\t"
+ "testl $0x00800000, %%eax\n\t" /* Test for MMX */
+ "jz NotSupported5\n\t" /* MMX not supported */
+ "testl $0x01000000, %%eax\n\t" /* Test for Ext'd MMX */
+ "jnz EMMXSupported\n\t"
+ "movl $1, %0:\n\n\t" /* MMX Supported */
+ "jmp Return\n\n"
+ "EMMXSupported:\n\t"
+ "movl $3, %0:\n\n\t" /* EMMX and MMX Supported */
+ "jmp Return\n\t"
+
+
+ /* AMD Section */
+ "AMD:\n\t"
+
+ /* See if extended CPUID is supported */
+ "movl $0x80000000, %%eax\n\t"
+ "cpuid\n\t"
+ "cmpl $0x80000000, %%eax\n\t"
+ "jl MMXtest\n\t" /* Use standard CPUID instead */
+
+ /* Extended CPUID supported, so get extended features */
+ "movl $0x80000001, %%eax\n\t"
+ "cpuid\n\t"
+ "testl $0x00800000, %%edx\n\t" /* Test for MMX */
+ "jz NotSupported6\n\t" /* MMX not supported */
+ "testl $0x80000000, %%edx\n\t" /* Test for 3DNow! */
+ "jnz ThreeDNowSupported\n\t"
+ "movl $1, %0:\n\n\t" /* MMX Supported */
+ "jmp Return\n\n"
+ "ThreeDNowSupported:\n\t"
+ "movl $5, %0:\n\n\t" /* 3DNow! and MMX Supported */
+ "jmp Return\n\t"
+
+
+ /* Intel Section */
+ "Intel:\n\t"
+
+ /* Check for MMX */
+ "MMXtest:\n\t"
+ "movl $1, %%eax\n\t"
+ "cpuid\n\t"
+ "testl $0x00800000, %%edx\n\t" /* Test for MMX */
+ "jz NotSupported7\n\t" /* MMX Not supported */
+ "movl $1, %0:\n\n\t" /* MMX Supported */
+ "jmp Return\n\t"
+
+ /* Nothing supported */
+ "\nNotSupported1:\n\t"
+ "#movl $101, %0:\n\n\t"
+ "\nNotSupported2:\n\t"
+ "#movl $102, %0:\n\n\t"
+ "\nNotSupported3:\n\t"
+ "#movl $103, %0:\n\n\t"
+ "\nNotSupported4:\n\t"
+ "#movl $104, %0:\n\n\t"
+ "\nNotSupported5:\n\t"
+ "#movl $105, %0:\n\n\t"
+ "\nNotSupported6:\n\t"
+ "#movl $106, %0:\n\n\t"
+ "\nNotSupported7:\n\t"
+ "#movl $107, %0:\n\n\t"
+ "movl $0, %0:\n\n\t"
+
+ "Return:\n\t"
+ : "=a" (rval)
+ : /* no input */
+ : "eax", "ebx", "ecx", "edx"
+ );
+
+ /* Return */
+ return(rval);
+}
+
+/* Function to test if mmx instructions are supported...
+*/
+inline extern int
+mmx_ok(void)
+{
+ /* Returns 1 if MMX instructions are supported, 0 otherwise */
+ return ( mm_support() & 0x1 );
+}
+#endif
+
+/* Helper functions for the instruction macros that follow...
+ (note that memory-to-register, m2r, instructions are nearly
+ as efficient as register-to-register, r2r, instructions;
+ however, memory-to-memory instructions are really simulated
+ as a convenience, and are only 1/3 as efficient)
+*/
+#ifdef MMX_TRACE
+
+/* Include the stuff for printing a trace to stderr...
+*/
+
+#define mmx_i2r(op, imm, reg) \
+ { \
+ mmx_t mmx_trace; \
+ mmx_trace.uq = (imm); \
+ printf(#op "_i2r(" #imm "=0x%08x%08x, ", \
+ mmx_trace.d[1], mmx_trace.d[0]); \
+ __asm__ __volatile__ ("movq %%" #reg ", %0" \
+ : "=y" (mmx_trace) \
+ : /* nothing */ ); \
+ printf(#reg "=0x%08x%08x) => ", \
+ mmx_trace.d[1], mmx_trace.d[0]); \
+ __asm__ __volatile__ (#op " %0, %%" #reg \
+ : /* nothing */ \
+ : "y" (imm)); \
+ __asm__ __volatile__ ("movq %%" #reg ", %0" \
+ : "=y" (mmx_trace) \
+ : /* nothing */ ); \
+ printf(#reg "=0x%08x%08x\n", \
+ mmx_trace.d[1], mmx_trace.d[0]); \
+ }
+
+#define mmx_m2r(op, mem, reg) \
+ { \
+ mmx_t mmx_trace; \
+ mmx_trace = (mem); \
+ printf(#op "_m2r(" #mem "=0x%08x%08x, ", \
+ mmx_trace.d[1], mmx_trace.d[0]); \
+ __asm__ __volatile__ ("movq %%" #reg ", %0" \
+ : "=y" (mmx_trace) \
+ : /* nothing */ ); \
+ printf(#reg "=0x%08x%08x) => ", \
+ mmx_trace.d[1], mmx_trace.d[0]); \
+ __asm__ __volatile__ (#op " %0, %%" #reg \
+ : /* nothing */ \
+ : "y" (mem)); \
+ __asm__ __volatile__ ("movq %%" #reg ", %0" \
+ : "=y" (mmx_trace) \
+ : /* nothing */ ); \
+ printf(#reg "=0x%08x%08x\n", \
+ mmx_trace.d[1], mmx_trace.d[0]); \
+ }
+
+#define mmx_r2m(op, reg, mem) \
+ { \
+ mmx_t mmx_trace; \
+ __asm__ __volatile__ ("movq %%" #reg ", %0" \
+ : "=y" (mmx_trace) \
+ : /* nothing */ ); \
+ printf(#op "_r2m(" #reg "=0x%08x%08x, ", \
+ mmx_trace.d[1], mmx_trace.d[0]); \
+ mmx_trace = (mem); \
+ printf(#mem "=0x%08x%08x) => ", \
+ mmx_trace.d[1], mmx_trace.d[0]); \
+ __asm__ __volatile__ (#op " %%" #reg ", %0" \
+ : "=y" (mem) \
+ : /* nothing */ ); \
+ mmx_trace = (mem); \
+ printf(#mem "=0x%08x%08x\n", \
+ mmx_trace.d[1], mmx_trace.d[0]); \
+ }
+
+#define mmx_r2r(op, regs, regd) \
+ { \
+ mmx_t mmx_trace; \
+ __asm__ __volatile__ ("movq %%" #regs ", %0" \
+ : "=y" (mmx_trace) \
+ : /* nothing */ ); \
+ printf(#op "_r2r(" #regs "=0x%08x%08x, ", \
+ mmx_trace.d[1], mmx_trace.d[0]); \
+ __asm__ __volatile__ ("movq %%" #regd ", %0" \
+ : "=y" (mmx_trace) \
+ : /* nothing */ ); \
+ printf(#regd "=0x%08x%08x) => ", \
+ mmx_trace.d[1], mmx_trace.d[0]); \
+ __asm__ __volatile__ (#op " %" #regs ", %" #regd); \
+ __asm__ __volatile__ ("movq %%" #regd ", %0" \
+ : "=y" (mmx_trace) \
+ : /* nothing */ ); \
+ printf(#regd "=0x%08x%08x\n", \
+ mmx_trace.d[1], mmx_trace.d[0]); \
+ }
+
+#define mmx_m2m(op, mems, memd) \
+ { \
+ mmx_t mmx_trace; \
+ mmx_trace = (mems); \
+ printf(#op "_m2m(" #mems "=0x%08x%08x, ", \
+ mmx_trace.d[1], mmx_trace.d[0]); \
+ mmx_trace = (memd); \
+ printf(#memd "=0x%08x%08x) => ", \
+ mmx_trace.d[1], mmx_trace.d[0]); \
+ __asm__ __volatile__ ("movq %0, %%mm0\n\t" \
+ #op " %1, %%mm0\n\t" \
+ "movq %%mm0, %0" \
+ : "=y" (memd) \
+ : "y" (mems)); \
+ mmx_trace = (memd); \
+ printf(#memd "=0x%08x%08x\n", \
+ mmx_trace.d[1], mmx_trace.d[0]); \
+ }
+
+#else
+
+/* These macros are a lot simpler without the tracing...
+*/
+
+#define mmx_i2r(op, imm, reg) \
+ __asm__ __volatile__ (#op " %0, %%" #reg \
+ : /* nothing */ \
+ : "y" (imm) )
+
+#define mmx_m2r(op, mem, reg) \
+ __asm__ __volatile__ (#op " %0, %%" #reg \
+ : /* nothing */ \
+ : "m" (mem))
+
+#define mmx_r2m(op, reg, mem) \
+ __asm__ __volatile__ (#op " %%" #reg ", %0" \
+ : "=m" (mem) \
+ : /* nothing */ )
+
+#define mmx_r2r(op, regs, regd) \
+ __asm__ __volatile__ (#op " %" #regs ", %" #regd)
+
+#define mmx_m2m(op, mems, memd) \
+ __asm__ __volatile__ ("movq %0, %%mm0\n\t" \
+ #op " %1, %%mm0\n\t" \
+ "movq %%mm0, %0" \
+ : "=y" (memd) \
+ : "y" (mems))
+
+#endif
+
+
+/* 1x64 MOVe Quadword
+ (this is both a load and a store...
+ in fact, it is the only way to store)
+*/
+#define movq_m2r(var, reg) mmx_m2r(movq, var, reg)
+#define movq_r2m(reg, var) mmx_r2m(movq, reg, var)
+#define movq_r2r(regs, regd) mmx_r2r(movq, regs, regd)
+#define movq(vars, vard) \
+ __asm__ __volatile__ ("movq %1, %%mm0\n\t" \
+ "movq %%mm0, %0" \
+ : "=y" (vard) \
+ : "y" (vars))
+
+
+/* 1x32 MOVe Doubleword
+ (like movq, this is both load and store...
+ but is most useful for moving things between
+ mmx registers and ordinary registers)
+*/
+#define movd_m2r(var, reg) mmx_m2r(movd, var, reg)
+#define movd_r2m(reg, var) mmx_r2m(movd, reg, var)
+#define movd_r2r(regs, regd) mmx_r2r(movd, regs, regd)
+#define movd(vars, vard) \
+ __asm__ __volatile__ ("movd %1, %%mm0\n\t" \
+ "movd %%mm0, %0" \
+ : "=y" (vard) \
+ : "y" (vars))
+
+
+/* 2x32, 4x16, and 8x8 Parallel ADDs
+*/
+#define paddd_m2r(var, reg) mmx_m2r(paddd, var, reg)
+#define paddd_r2r(regs, regd) mmx_r2r(paddd, regs, regd)
+#define paddd(vars, vard) mmx_m2m(paddd, vars, vard)
+
+#define paddw_m2r(var, reg) mmx_m2r(paddw, var, reg)
+#define paddw_r2r(regs, regd) mmx_r2r(paddw, regs, regd)
+#define paddw(vars, vard) mmx_m2m(paddw, vars, vard)
+
+#define paddb_m2r(var, reg) mmx_m2r(paddb, var, reg)
+#define paddb_r2r(regs, regd) mmx_r2r(paddb, regs, regd)
+#define paddb(vars, vard) mmx_m2m(paddb, vars, vard)
+
+
+/* 4x16 and 8x8 Parallel ADDs using Saturation arithmetic
+*/
+#define paddsw_m2r(var, reg) mmx_m2r(paddsw, var, reg)
+#define paddsw_r2r(regs, regd) mmx_r2r(paddsw, regs, regd)
+#define paddsw(vars, vard) mmx_m2m(paddsw, vars, vard)
+
+#define paddsb_m2r(var, reg) mmx_m2r(paddsb, var, reg)
+#define paddsb_r2r(regs, regd) mmx_r2r(paddsb, regs, regd)
+#define paddsb(vars, vard) mmx_m2m(paddsb, vars, vard)
+
+
+/* 4x16 and 8x8 Parallel ADDs using Unsigned Saturation arithmetic
+*/
+#define paddusw_m2r(var, reg) mmx_m2r(paddusw, var, reg)
+#define paddusw_r2r(regs, regd) mmx_r2r(paddusw, regs, regd)
+#define paddusw(vars, vard) mmx_m2m(paddusw, vars, vard)
+
+#define paddusb_m2r(var, reg) mmx_m2r(paddusb, var, reg)
+#define paddusb_r2r(regs, regd) mmx_r2r(paddusb, regs, regd)
+#define paddusb(vars, vard) mmx_m2m(paddusb, vars, vard)
+
+
+/* 2x32, 4x16, and 8x8 Parallel SUBs
+*/
+#define psubd_m2r(var, reg) mmx_m2r(psubd, var, reg)
+#define psubd_r2r(regs, regd) mmx_r2r(psubd, regs, regd)
+#define psubd(vars, vard) mmx_m2m(psubd, vars, vard)
+
+#define psubw_m2r(var, reg) mmx_m2r(psubw, var, reg)
+#define psubw_r2r(regs, regd) mmx_r2r(psubw, regs, regd)
+#define psubw(vars, vard) mmx_m2m(psubw, vars, vard)
+
+#define psubb_m2r(var, reg) mmx_m2r(psubb, var, reg)
+#define psubb_r2r(regs, regd) mmx_r2r(psubb, regs, regd)
+#define psubb(vars, vard) mmx_m2m(psubb, vars, vard)
+
+
+/* 4x16 and 8x8 Parallel SUBs using Saturation arithmetic
+*/
+#define psubsw_m2r(var, reg) mmx_m2r(psubsw, var, reg)
+#define psubsw_r2r(regs, regd) mmx_r2r(psubsw, regs, regd)
+#define psubsw(vars, vard) mmx_m2m(psubsw, vars, vard)
+
+#define psubsb_m2r(var, reg) mmx_m2r(psubsb, var, reg)
+#define psubsb_r2r(regs, regd) mmx_r2r(psubsb, regs, regd)
+#define psubsb(vars, vard) mmx_m2m(psubsb, vars, vard)
+
+
+/* 4x16 and 8x8 Parallel SUBs using Unsigned Saturation arithmetic
+*/
+#define psubusw_m2r(var, reg) mmx_m2r(psubusw, var, reg)
+#define psubusw_r2r(regs, regd) mmx_r2r(psubusw, regs, regd)
+#define psubusw(vars, vard) mmx_m2m(psubusw, vars, vard)
+
+#define psubusb_m2r(var, reg) mmx_m2r(psubusb, var, reg)
+#define psubusb_r2r(regs, regd) mmx_r2r(psubusb, regs, regd)
+#define psubusb(vars, vard) mmx_m2m(psubusb, vars, vard)
+
+
+/* 4x16 Parallel MULs giving Low 4x16 portions of results
+*/
+#define pmullw_m2r(var, reg) mmx_m2r(pmullw, var, reg)
+#define pmullw_r2r(regs, regd) mmx_r2r(pmullw, regs, regd)
+#define pmullw(vars, vard) mmx_m2m(pmullw, vars, vard)
+
+
+/* 4x16 Parallel MULs giving High 4x16 portions of results
+*/
+#define pmulhw_m2r(var, reg) mmx_m2r(pmulhw, var, reg)
+#define pmulhw_r2r(regs, regd) mmx_r2r(pmulhw, regs, regd)
+#define pmulhw(vars, vard) mmx_m2m(pmulhw, vars, vard)
+
+
+/* 4x16->2x32 Parallel Mul-ADD
+ (muls like pmullw, then adds adjacent 16-bit fields
+ in the multiply result to make the final 2x32 result)
+*/
+#define pmaddwd_m2r(var, reg) mmx_m2r(pmaddwd, var, reg)
+#define pmaddwd_r2r(regs, regd) mmx_r2r(pmaddwd, regs, regd)
+#define pmaddwd(vars, vard) mmx_m2m(pmaddwd, vars, vard)
+
+
+/* 1x64 bitwise AND
+*/
+#ifdef BROKEN_PAND
+#define pand_m2r(var, reg) \
+ { \
+ mmx_m2r(pandn, (mmx_t) -1LL, reg); \
+ mmx_m2r(pandn, var, reg); \
+ }
+#define pand_r2r(regs, regd) \
+ { \
+ mmx_m2r(pandn, (mmx_t) -1LL, regd); \
+ mmx_r2r(pandn, regs, regd) \
+ }
+#define pand(vars, vard) \
+ { \
+ movq_m2r(vard, mm0); \
+ mmx_m2r(pandn, (mmx_t) -1LL, mm0); \
+ mmx_m2r(pandn, vars, mm0); \
+ movq_r2m(mm0, vard); \
+ }
+#else
+#define pand_m2r(var, reg) mmx_m2r(pand, var, reg)
+#define pand_r2r(regs, regd) mmx_r2r(pand, regs, regd)
+#define pand(vars, vard) mmx_m2m(pand, vars, vard)
+#endif
+
+
+/* 1x64 bitwise AND with Not the destination
+*/
+#define pandn_m2r(var, reg) mmx_m2r(pandn, var, reg)
+#define pandn_r2r(regs, regd) mmx_r2r(pandn, regs, regd)
+#define pandn(vars, vard) mmx_m2m(pandn, vars, vard)
+
+
+/* 1x64 bitwise OR
+*/
+#define por_m2r(var, reg) mmx_m2r(por, var, reg)
+#define por_r2r(regs, regd) mmx_r2r(por, regs, regd)
+#define por(vars, vard) mmx_m2m(por, vars, vard)
+
+
+/* 1x64 bitwise eXclusive OR
+*/
+#define pxor_m2r(var, reg) mmx_m2r(pxor, var, reg)
+#define pxor_r2r(regs, regd) mmx_r2r(pxor, regs, regd)
+#define pxor(vars, vard) mmx_m2m(pxor, vars, vard)
+
+
+/* 2x32, 4x16, and 8x8 Parallel CoMPare for EQuality
+ (resulting fields are either 0 or -1)
+*/
+#define pcmpeqd_m2r(var, reg) mmx_m2r(pcmpeqd, var, reg)
+#define pcmpeqd_r2r(regs, regd) mmx_r2r(pcmpeqd, regs, regd)
+#define pcmpeqd(vars, vard) mmx_m2m(pcmpeqd, vars, vard)
+
+#define pcmpeqw_m2r(var, reg) mmx_m2r(pcmpeqw, var, reg)
+#define pcmpeqw_r2r(regs, regd) mmx_r2r(pcmpeqw, regs, regd)
+#define pcmpeqw(vars, vard) mmx_m2m(pcmpeqw, vars, vard)
+
+#define pcmpeqb_m2r(var, reg) mmx_m2r(pcmpeqb, var, reg)
+#define pcmpeqb_r2r(regs, regd) mmx_r2r(pcmpeqb, regs, regd)
+#define pcmpeqb(vars, vard) mmx_m2m(pcmpeqb, vars, vard)
+
+
+/* 2x32, 4x16, and 8x8 Parallel CoMPare for Greater Than
+ (resulting fields are either 0 or -1)
+*/
+#define pcmpgtd_m2r(var, reg) mmx_m2r(pcmpgtd, var, reg)
+#define pcmpgtd_r2r(regs, regd) mmx_r2r(pcmpgtd, regs, regd)
+#define pcmpgtd(vars, vard) mmx_m2m(pcmpgtd, vars, vard)
+
+#define pcmpgtw_m2r(var, reg) mmx_m2r(pcmpgtw, var, reg)
+#define pcmpgtw_r2r(regs, regd) mmx_r2r(pcmpgtw, regs, regd)
+#define pcmpgtw(vars, vard) mmx_m2m(pcmpgtw, vars, vard)
+
+#define pcmpgtb_m2r(var, reg) mmx_m2r(pcmpgtb, var, reg)
+#define pcmpgtb_r2r(regs, regd) mmx_r2r(pcmpgtb, regs, regd)
+#define pcmpgtb(vars, vard) mmx_m2m(pcmpgtb, vars, vard)
+
+
+/* 1x64, 2x32, and 4x16 Parallel Shift Left Logical
+*/
+#define psllq_i2r(imm, reg) mmx_i2r(psllq, imm, reg)
+#define psllq_m2r(var, reg) mmx_m2r(psllq, var, reg)
+#define psllq_r2r(regs, regd) mmx_r2r(psllq, regs, regd)
+#define psllq(vars, vard) mmx_m2m(psllq, vars, vard)
+
+#define pslld_i2r(imm, reg) mmx_i2r(pslld, imm, reg)
+#define pslld_m2r(var, reg) mmx_m2r(pslld, var, reg)
+#define pslld_r2r(regs, regd) mmx_r2r(pslld, regs, regd)
+#define pslld(vars, vard) mmx_m2m(pslld, vars, vard)
+
+#define psllw_i2r(imm, reg) mmx_i2r(psllw, imm, reg)
+#define psllw_m2r(var, reg) mmx_m2r(psllw, var, reg)
+#define psllw_r2r(regs, regd) mmx_r2r(psllw, regs, regd)
+#define psllw(vars, vard) mmx_m2m(psllw, vars, vard)
+
+
+/* 1x64, 2x32, and 4x16 Parallel Shift Right Logical
+*/
+#define psrlq_i2r(imm, reg) mmx_i2r(psrlq, imm, reg)
+#define psrlq_m2r(var, reg) mmx_m2r(psrlq, var, reg)
+#define psrlq_r2r(regs, regd) mmx_r2r(psrlq, regs, regd)
+#define psrlq(vars, vard) mmx_m2m(psrlq, vars, vard)
+
+#define psrld_i2r(imm, reg) mmx_i2r(psrld, imm, reg)
+#define psrld_m2r(var, reg) mmx_m2r(psrld, var, reg)
+#define psrld_r2r(regs, regd) mmx_r2r(psrld, regs, regd)
+#define psrld(vars, vard) mmx_m2m(psrld, vars, vard)
+
+#define psrlw_i2r(imm, reg) mmx_i2r(psrlw, imm, reg)
+#define psrlw_m2r(var, reg) mmx_m2r(psrlw, var, reg)
+#define psrlw_r2r(regs, regd) mmx_r2r(psrlw, regs, regd)
+#define psrlw(vars, vard) mmx_m2m(psrlw, vars, vard)
+
+
+/* 2x32 and 4x16 Parallel Shift Right Arithmetic
+*/
+#define psrad_i2r(imm, reg) mmx_i2r(psrad, imm, reg)
+#define psrad_m2r(var, reg) mmx_m2r(psrad, var, reg)
+#define psrad_r2r(regs, regd) mmx_r2r(psrad, regs, regd)
+#define psrad(vars, vard) mmx_m2m(psrad, vars, vard)
+
+#define psraw_i2r(imm, reg) mmx_i2r(psraw, imm, reg)
+#define psraw_m2r(var, reg) mmx_m2r(psraw, var, reg)
+#define psraw_r2r(regs, regd) mmx_r2r(psraw, regs, regd)
+#define psraw(vars, vard) mmx_m2m(psraw, vars, vard)
+
+
+/* 2x32->4x16 and 4x16->8x8 PACK and Signed Saturate
+ (packs source and dest fields into dest in that order)
+*/
+#define packssdw_m2r(var, reg) mmx_m2r(packssdw, var, reg)
+#define packssdw_r2r(regs, regd) mmx_r2r(packssdw, regs, regd)
+#define packssdw(vars, vard) mmx_m2m(packssdw, vars, vard)
+
+#define packsswb_m2r(var, reg) mmx_m2r(packsswb, var, reg)
+#define packsswb_r2r(regs, regd) mmx_r2r(packsswb, regs, regd)
+#define packsswb(vars, vard) mmx_m2m(packsswb, vars, vard)
+
+
+/* 4x16->8x8 PACK and Unsigned Saturate
+ (packs source and dest fields into dest in that order)
+*/
+#define packuswb_m2r(var, reg) mmx_m2r(packuswb, var, reg)
+#define packuswb_r2r(regs, regd) mmx_r2r(packuswb, regs, regd)
+#define packuswb(vars, vard) mmx_m2m(packuswb, vars, vard)
+
+
+/* 2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK Low
+ (interleaves low half of dest with low half of source
+ as padding in each result field)
+*/
+#define punpckldq_m2r(var, reg) mmx_m2r(punpckldq, var, reg)
+#define punpckldq_r2r(regs, regd) mmx_r2r(punpckldq, regs, regd)
+#define punpckldq(vars, vard) mmx_m2m(punpckldq, vars, vard)
+
+#define punpcklwd_m2r(var, reg) mmx_m2r(punpcklwd, var, reg)
+#define punpcklwd_r2r(regs, regd) mmx_r2r(punpcklwd, regs, regd)
+#define punpcklwd(vars, vard) mmx_m2m(punpcklwd, vars, vard)
+
+#define punpcklbw_m2r(var, reg) mmx_m2r(punpcklbw, var, reg)
+#define punpcklbw_r2r(regs, regd) mmx_r2r(punpcklbw, regs, regd)
+#define punpcklbw(vars, vard) mmx_m2m(punpcklbw, vars, vard)
+
+
+/* 2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK High
+ (interleaves high half of dest with high half of source
+ as padding in each result field)
+*/
+#define punpckhdq_m2r(var, reg) mmx_m2r(punpckhdq, var, reg)
+#define punpckhdq_r2r(regs, regd) mmx_r2r(punpckhdq, regs, regd)
+#define punpckhdq(vars, vard) mmx_m2m(punpckhdq, vars, vard)
+
+#define punpckhwd_m2r(var, reg) mmx_m2r(punpckhwd, var, reg)
+#define punpckhwd_r2r(regs, regd) mmx_r2r(punpckhwd, regs, regd)
+#define punpckhwd(vars, vard) mmx_m2m(punpckhwd, vars, vard)
+
+#define punpckhbw_m2r(var, reg) mmx_m2r(punpckhbw, var, reg)
+#define punpckhbw_r2r(regs, regd) mmx_r2r(punpckhbw, regs, regd)
+#define punpckhbw(vars, vard) mmx_m2m(punpckhbw, vars, vard)
+
+
+/* Empty MMx State
+ (used to clean-up when going from mmx to float use
+ of the registers that are shared by both; note that
+ there is no float-to-mmx operation needed, because
+ only the float tag word info is corruptible)
+*/
+#ifdef MMX_TRACE
+
+#define emms() \
+ { \
+ printf("emms()\n"); \
+ __asm__ __volatile__ ("emms"); \
+ }
+
+#else
+
+#define emms() __asm__ __volatile__ ("emms")
+
+#endif
+
+#endif
+
diff --git a/distrib/sdl-1.2.15/src/video/nanox/SDL_nxevents.c b/distrib/sdl-1.2.15/src/video/nanox/SDL_nxevents.c
new file mode 100644
index 0000000..788c794
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/nanox/SDL_nxevents.c
@@ -0,0 +1,382 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+ Copyright (C) 2001 Hsieh-Fu Tsai
+ Copyright (C) 2002 Greg Haerr <greg@censoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ Hsieh-Fu Tsai
+ clare@setabox.com
+*/
+#include "SDL_config.h"
+
+#include "SDL_keysym.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_nxevents_c.h"
+#include "SDL_nximage_c.h"
+
+// The translation tables from a nanox keysym to a SDL keysym
+static SDLKey NX_NONASCII_keymap [MWKEY_LAST + 1] ;
+
+void NX_InitOSKeymap (_THIS)
+{
+ int i ;
+
+ Dprintf ("enter NX_InitOSKeymap\n") ;
+
+ // Map the nanox scancodes to SDL keysyms
+ for (i = 0; i < SDL_arraysize (NX_NONASCII_keymap); ++ i)
+ NX_NONASCII_keymap [i] = SDLK_UNKNOWN ;
+
+ NX_NONASCII_keymap [MWKEY_LEFT & 0xFF] = SDLK_LEFT ;
+ NX_NONASCII_keymap [MWKEY_RIGHT & 0xFF] = SDLK_RIGHT ;
+ NX_NONASCII_keymap [MWKEY_UP & 0xFF] = SDLK_UP ;
+ NX_NONASCII_keymap [MWKEY_DOWN & 0xFF] = SDLK_DOWN ;
+ NX_NONASCII_keymap [MWKEY_INSERT & 0xFF] = SDLK_INSERT ;
+ NX_NONASCII_keymap [MWKEY_DELETE & 0xFF] = SDLK_DELETE ;
+ NX_NONASCII_keymap [MWKEY_HOME & 0xFF] = SDLK_HOME ;
+ NX_NONASCII_keymap [MWKEY_END & 0xFF] = SDLK_END ;
+ NX_NONASCII_keymap [MWKEY_PAGEUP & 0xFF] = SDLK_PAGEUP ;
+ NX_NONASCII_keymap [MWKEY_PAGEDOWN & 0xFF] = SDLK_PAGEDOWN ;
+
+ NX_NONASCII_keymap [MWKEY_KP0 & 0xFF] = SDLK_KP0 ;
+ NX_NONASCII_keymap [MWKEY_KP1 & 0xFF] = SDLK_KP1 ;
+ NX_NONASCII_keymap [MWKEY_KP2 & 0xFF] = SDLK_KP2 ;
+ NX_NONASCII_keymap [MWKEY_KP3 & 0xFF] = SDLK_KP3 ;
+ NX_NONASCII_keymap [MWKEY_KP4 & 0xFF] = SDLK_KP4 ;
+ NX_NONASCII_keymap [MWKEY_KP5 & 0xFF] = SDLK_KP5 ;
+ NX_NONASCII_keymap [MWKEY_KP6 & 0xFF] = SDLK_KP6 ;
+ NX_NONASCII_keymap [MWKEY_KP7 & 0xFF] = SDLK_KP7 ;
+ NX_NONASCII_keymap [MWKEY_KP8 & 0xFF] = SDLK_KP8 ;
+ NX_NONASCII_keymap [MWKEY_KP9 & 0xFF] = SDLK_KP9 ;
+ NX_NONASCII_keymap [MWKEY_KP_PERIOD & 0xFF] = SDLK_KP_PERIOD ;
+ NX_NONASCII_keymap [MWKEY_KP_DIVIDE & 0xFF] = SDLK_KP_DIVIDE ;
+ NX_NONASCII_keymap [MWKEY_KP_MULTIPLY & 0xFF] = SDLK_KP_MULTIPLY ;
+ NX_NONASCII_keymap [MWKEY_KP_MINUS & 0xFF] = SDLK_KP_MINUS ;
+ NX_NONASCII_keymap [MWKEY_KP_PLUS & 0xFF] = SDLK_KP_PLUS ;
+ NX_NONASCII_keymap [MWKEY_KP_ENTER & 0xFF] = SDLK_KP_ENTER ;
+ NX_NONASCII_keymap [MWKEY_KP_EQUALS & 0xFF] = SDLK_KP_EQUALS ;
+
+ NX_NONASCII_keymap [MWKEY_F1 & 0xFF] = SDLK_F1 ;
+ NX_NONASCII_keymap [MWKEY_F2 & 0xFF] = SDLK_F2 ;
+ NX_NONASCII_keymap [MWKEY_F3 & 0xFF] = SDLK_F3 ;
+ NX_NONASCII_keymap [MWKEY_F4 & 0xFF] = SDLK_F4 ;
+ NX_NONASCII_keymap [MWKEY_F5 & 0xFF] = SDLK_F5 ;
+ NX_NONASCII_keymap [MWKEY_F6 & 0xFF] = SDLK_F6 ;
+ NX_NONASCII_keymap [MWKEY_F7 & 0xFF] = SDLK_F7 ;
+ NX_NONASCII_keymap [MWKEY_F8 & 0xFF] = SDLK_F8 ;
+ NX_NONASCII_keymap [MWKEY_F9 & 0xFF] = SDLK_F9 ;
+ NX_NONASCII_keymap [MWKEY_F10 & 0xFF] = SDLK_F10 ;
+ NX_NONASCII_keymap [MWKEY_F11 & 0xFF] = SDLK_F11 ;
+ NX_NONASCII_keymap [MWKEY_F12 & 0xFF] = SDLK_F12 ;
+
+ NX_NONASCII_keymap [MWKEY_NUMLOCK & 0xFF] = SDLK_NUMLOCK ;
+ NX_NONASCII_keymap [MWKEY_CAPSLOCK & 0xFF] = SDLK_CAPSLOCK ;
+ NX_NONASCII_keymap [MWKEY_SCROLLOCK & 0xFF] = SDLK_SCROLLOCK ;
+ NX_NONASCII_keymap [MWKEY_LSHIFT & 0xFF] = SDLK_LSHIFT ;
+ NX_NONASCII_keymap [MWKEY_RSHIFT & 0xFF] = SDLK_RSHIFT ;
+ NX_NONASCII_keymap [MWKEY_LCTRL & 0xFF] = SDLK_LCTRL ;
+ NX_NONASCII_keymap [MWKEY_RCTRL & 0xFF] = SDLK_RCTRL ;
+ NX_NONASCII_keymap [MWKEY_LALT & 0xFF] = SDLK_LALT ;
+ NX_NONASCII_keymap [MWKEY_RALT & 0xFF] = SDLK_RALT ;
+ NX_NONASCII_keymap [MWKEY_LMETA & 0xFF] = SDLK_LMETA ;
+ NX_NONASCII_keymap [MWKEY_RMETA & 0xFF] = SDLK_RMETA ;
+ NX_NONASCII_keymap [MWKEY_ALTGR & 0xFF] = SDLK_MODE ;
+
+ NX_NONASCII_keymap [MWKEY_PRINT & 0xFF] = SDLK_PRINT ;
+ NX_NONASCII_keymap [MWKEY_SYSREQ & 0xFF] = SDLK_SYSREQ ;
+ NX_NONASCII_keymap [MWKEY_PAUSE & 0xFF] = SDLK_PAUSE ;
+ NX_NONASCII_keymap [MWKEY_BREAK & 0xFF] = SDLK_BREAK ;
+ NX_NONASCII_keymap [MWKEY_MENU & 0xFF] = SDLK_MENU ;
+
+ Dprintf ("leave NX_InitOSKeymap\n") ;
+}
+
+SDL_keysym * NX_TranslateKey (GR_EVENT_KEYSTROKE * keystroke, SDL_keysym * keysym)
+{
+ GR_KEY ch = keystroke -> ch ;
+
+ Dprintf ("enter NX_TranslateKey\n") ;
+
+ keysym -> scancode = keystroke -> scancode ;
+ keysym -> sym = SDLK_UNKNOWN ;
+
+ if (ch & MWKEY_NONASCII_MASK) {
+ keysym -> sym = NX_NONASCII_keymap [ch & 0xFF] ;
+ } else {
+ keysym -> sym = ch & 0x7F ;
+ }
+
+ keysym -> mod = KMOD_NONE ;
+
+#if 1 // Retrieve more mode information
+ {
+ GR_KEYMOD mod = keystroke -> modifiers ;
+
+ if (mod & MWKMOD_LSHIFT)
+ keysym -> mod |= KMOD_LSHIFT ;
+ if (mod & MWKMOD_RSHIFT)
+ keysym -> mod |= KMOD_RSHIFT ;
+ if (mod & MWKMOD_LCTRL)
+ keysym -> mod |= KMOD_LCTRL ;
+ if (mod & MWKMOD_RCTRL)
+ keysym -> mod |= KMOD_RCTRL ;
+ if (mod & MWKMOD_LALT)
+ keysym -> mod |= KMOD_LALT ;
+ if (mod & MWKMOD_RALT)
+ keysym -> mod |= KMOD_RALT ;
+ if (mod & MWKMOD_LMETA)
+ keysym -> mod |= KMOD_LMETA ;
+ if (mod & MWKMOD_RMETA)
+ keysym -> mod |= KMOD_RMETA ;
+ if (mod & MWKMOD_NUM)
+ keysym -> mod |= KMOD_NUM ;
+ if (mod & MWKMOD_CAPS)
+ keysym -> mod |= KMOD_CAPS ;
+ if (mod & MWKMOD_ALTGR)
+ keysym -> mod |= KMOD_MODE ;
+ }
+#endif
+
+ keysym -> unicode = ch ;
+
+ Dprintf ("leave NX_TranslateKey\n") ;
+ return keysym ;
+}
+
+static int check_boundary (_THIS, int x, int y)
+{
+ if (x < OffsetX || y < OffsetY || x > OffsetX + this -> screen -> w ||
+ y > OffsetY + this -> screen -> h)
+ return 0 ;
+
+ return 1 ;
+}
+
+void NX_PumpEvents (_THIS)
+{
+ GR_EVENT event ;
+ static GR_BUTTON last_button_down = 0 ;
+
+ GrCheckNextEvent (& event) ;
+ while (event.type != GR_EVENT_TYPE_NONE) {
+
+ // dispatch event
+ switch (event.type) {
+ case GR_EVENT_TYPE_MOUSE_ENTER :
+ {
+ Dprintf ("mouse enter\n") ;
+ SDL_PrivateAppActive (1, SDL_APPMOUSEFOCUS) ;
+ break ;
+ }
+
+ case GR_EVENT_TYPE_MOUSE_EXIT :
+ {
+ Dprintf ("mouse exit\n") ;
+ SDL_PrivateAppActive (0, SDL_APPMOUSEFOCUS) ;
+ break ;
+ }
+
+ case GR_EVENT_TYPE_FOCUS_IN :
+ {
+ Dprintf ("focus in\n") ;
+ SDL_PrivateAppActive (1, SDL_APPINPUTFOCUS) ;
+ break ;
+ }
+
+ case GR_EVENT_TYPE_FOCUS_OUT :
+ {
+ Dprintf ("focus out\n") ;
+ SDL_PrivateAppActive (0, SDL_APPINPUTFOCUS) ;
+ break ;
+ }
+
+ case GR_EVENT_TYPE_MOUSE_MOTION :
+ {
+ Dprintf ("mouse motion\n") ;
+
+ if (SDL_VideoSurface) {
+ if (currently_fullscreen) {
+ if (check_boundary (this, event.button.x, event.button.y)) {
+ SDL_PrivateMouseMotion (0, 0, event.button.x - OffsetX,
+ event.button.y - OffsetY) ;
+ }
+ } else {
+ SDL_PrivateMouseMotion (0, 0, event.button.x, event.button.y) ;
+ }
+ }
+ break ;
+ }
+
+ case GR_EVENT_TYPE_BUTTON_DOWN :
+ {
+ int button = event.button.buttons ;
+
+ Dprintf ("button down\n") ;
+
+ switch (button) {
+ case MWBUTTON_L :
+ button = 1 ;
+ break ;
+ case MWBUTTON_M :
+ button = 2 ;
+ break ;
+ case MWBUTTON_R :
+ button = 3 ;
+ break ;
+ default :
+ button = 0 ;
+ }
+ last_button_down = button ;
+
+ if (currently_fullscreen) {
+ if (check_boundary (this, event.button.x, event.button.y)) {
+ SDL_PrivateMouseButton (SDL_PRESSED, button,
+ event.button.x - OffsetX, event.button.y - OffsetY) ;
+ }
+ } else {
+ SDL_PrivateMouseButton (SDL_PRESSED, button,
+ event.button.x, event.button.y) ;
+ }
+ break ;
+ }
+
+ // do not konw which button is released
+ case GR_EVENT_TYPE_BUTTON_UP :
+ {
+ Dprintf ("button up\n") ;
+
+ if (currently_fullscreen) {
+ if (check_boundary (this, event.button.x, event.button.y)) {
+ SDL_PrivateMouseButton (SDL_RELEASED, last_button_down,
+ event.button.x - OffsetX, event.button.y - OffsetY) ;
+ }
+ } else {
+ SDL_PrivateMouseButton (SDL_RELEASED, last_button_down,
+ event.button.x, event.button.y) ;
+ }
+ last_button_down = 0 ;
+ break ;
+ }
+
+ case GR_EVENT_TYPE_KEY_DOWN :
+ {
+ SDL_keysym keysym ;
+
+ Dprintf ("key down\n") ;
+ SDL_PrivateKeyboard (SDL_PRESSED,
+ NX_TranslateKey (& event.keystroke, & keysym)) ;
+ break ;
+ }
+
+ case GR_EVENT_TYPE_KEY_UP :
+ {
+ SDL_keysym keysym ;
+
+ Dprintf ("key up\n") ;
+ SDL_PrivateKeyboard (SDL_RELEASED,
+ NX_TranslateKey (& event.keystroke, & keysym)) ;
+ break ;
+ }
+
+ case GR_EVENT_TYPE_CLOSE_REQ :
+ {
+ Dprintf ("close require\n") ;
+ SDL_PrivateQuit () ;
+ break ;
+ }
+
+ case GR_EVENT_TYPE_EXPOSURE :
+ {
+ Dprintf ("event_type_exposure\n") ;
+ if (SDL_VideoSurface) {
+ NX_RefreshDisplay (this) ;//, & event.exposure) ;
+ }
+ break ;
+ }
+
+ case GR_EVENT_TYPE_UPDATE :
+ {
+ switch (event.update.utype) {
+ case GR_UPDATE_MAP :
+ {
+ Dprintf ("GR_UPDATE_MAP\n") ;
+ // If we're not active, make ourselves active
+ if (!(SDL_GetAppState () & SDL_APPACTIVE)) {
+ // Send an internal activate event
+ SDL_PrivateAppActive (1, SDL_APPACTIVE) ;
+ }
+ if (SDL_VideoSurface) {
+ NX_RefreshDisplay (this) ;
+ }
+ break ;
+ }
+
+ case GR_UPDATE_UNMAP :
+ case GR_UPDATE_UNMAPTEMP :
+ {
+ Dprintf ("GR_UPDATE_UNMAP or GR_UPDATE_UNMAPTEMP\n") ;
+ // If we're active, make ourselves inactive
+ if (SDL_GetAppState () & SDL_APPACTIVE) {
+ // Send an internal deactivate event
+ SDL_PrivateAppActive (0, SDL_APPACTIVE | SDL_APPINPUTFOCUS) ;
+ }
+ break ;
+ }
+
+ case GR_UPDATE_SIZE :
+ {
+ Dprintf ("GR_UPDATE_SIZE\n") ;
+ SDL_PrivateResize (event.update.width, event.update.height) ;
+ break ;
+ }
+
+ case GR_UPDATE_MOVE :
+ case GR_UPDATE_REPARENT :
+ {
+ Dprintf ("GR_UPDATE_MOVE or GR_UPDATE_REPARENT\n") ;
+#ifdef ENABLE_NANOX_DIRECT_FB
+ if (Clientfb) {
+ /* Get current window position and fb pointer*/
+ if (currently_fullscreen)
+ GrGetWindowFBInfo(FSwindow, &fbinfo);
+ else
+ GrGetWindowFBInfo(SDL_Window, &fbinfo);
+ }
+#endif
+ break ;
+ }
+
+ default :
+ Dprintf ("unknown GR_EVENT_TYPE_UPDATE\n") ;
+ break ;
+ }
+ break ;
+ }
+
+ default :
+ {
+ Dprintf ("pump event default\n") ;
+ }
+ }
+
+ GrCheckNextEvent (& event) ;
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/nanox/SDL_nxevents_c.h b/distrib/sdl-1.2.15/src/video/nanox/SDL_nxevents_c.h
new file mode 100644
index 0000000..b3b4f97
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/nanox/SDL_nxevents_c.h
@@ -0,0 +1,32 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+ Copyright (C) 2001 Hsieh-Fu Tsai
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ Hsieh-Fu Tsai
+ clare@setabox.com
+*/
+#include "SDL_config.h"
+
+#include "SDL_nxvideo.h"
+
+// Functions to be exported
+extern void NX_InitOSKeymap (_THIS) ;
+extern void NX_PumpEvents (_THIS) ;
diff --git a/distrib/sdl-1.2.15/src/video/nanox/SDL_nximage.c b/distrib/sdl-1.2.15/src/video/nanox/SDL_nximage.c
new file mode 100644
index 0000000..23d3157
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/nanox/SDL_nximage.c
@@ -0,0 +1,230 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+ Copyright (C) 2001 Hsieh-Fu Tsai
+ Copyright (C) 2002 Greg Haerr <greg@censoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ Hsieh-Fu Tsai
+ clare@setabox.com
+*/
+#include "SDL_config.h"
+
+#include "SDL_nximage_c.h"
+
+void NX_NormalUpdate (_THIS, int numrects, SDL_Rect * rects)
+{
+ int i, j, xinc, yinc, destinc, rowinc ;
+ int x, y, w, h ;
+ unsigned char * src = NULL, * dest = NULL ;
+
+ Dprintf ("enter NX_NormalUpdate\n") ;
+
+ /* These are the values for the incoming image */
+ xinc = this -> screen -> format -> BytesPerPixel ;
+ yinc = this -> screen -> pitch ;
+
+ for (i = 0; i < numrects; ++ i) {
+ x = rects [i].x, y = rects [i].y ;
+ w = rects [i].w, h = rects [i].h ;
+ src = SDL_Image + y * yinc + x * xinc ;
+#ifdef ENABLE_NANOX_DIRECT_FB
+ if (Clientfb) {
+ if (currently_fullscreen)
+ dest = fbinfo.winpixels + (((y+OffsetY) * fbinfo.pitch) +
+ ((x+OffsetX) * fbinfo.bytespp));
+ else
+ dest = fbinfo.winpixels + ((y * fbinfo.pitch) + (x * fbinfo.bytespp));
+ destinc = fbinfo.pitch;
+ }
+ else
+#endif
+ {
+ dest = Image_buff ;
+ destinc = w * xinc ;
+ }
+ rowinc = w * xinc;
+
+ // apply GammaRamp table
+ if ((pixel_type == MWPF_TRUECOLOR0888 || pixel_type == MWPF_TRUECOLOR888)
+ && GammaRamp_R && GammaRamp_G && GammaRamp_B) {
+ Uint8 * ptrsrc ;
+ Uint8 * ptrdst ;
+ int k ;
+
+ for (j = h; j > 0; -- j, src += yinc, dest += destinc) {
+ ptrsrc = src ;
+ ptrdst = dest ;
+ for (k = w; k > 0; -- k) {
+ *ptrdst++ = GammaRamp_B [*ptrsrc++] >> 8;
+ *ptrdst++ = GammaRamp_G [*ptrsrc++] >> 8;
+ *ptrdst++ = GammaRamp_R [*ptrsrc++] >> 8;
+ *ptrdst++ = 0;
+ ++ptrsrc;
+ }
+ }
+ }
+#if 1 /* This is needed for microwindows 0.90 or older */
+ else if (pixel_type == MWPF_TRUECOLOR0888 || pixel_type == MWPF_TRUECOLOR888) {
+ Uint8 * ptrsrc ;
+ Uint8 * ptrdst ;
+ int k ;
+
+ for (j = h; j > 0; -- j, src += yinc, dest += destinc) {
+ ptrsrc = src ;
+ ptrdst = dest ;
+ for (k = w; k > 0; -- k) {
+ *ptrdst++ = *ptrsrc++;
+ *ptrdst++ = *ptrsrc++;
+ *ptrdst++ = *ptrsrc++;
+ *ptrdst++ = 0;
+ ++ptrsrc;
+ }
+ }
+ }
+#endif
+ else
+ {
+ for (j = h; j > 0; -- j, src += yinc, dest += destinc)
+ SDL_memcpy (dest, src, rowinc) ;
+ }
+ if (!Clientfb) {
+ if (currently_fullscreen) {
+ GrArea (FSwindow, SDL_GC, x + OffsetX, y + OffsetY, w, h, Image_buff,
+ pixel_type) ;
+ } else {
+ GrArea (SDL_Window, SDL_GC, x, y, w, h, Image_buff, pixel_type) ;
+ }
+ }
+ }
+ GrFlush();
+
+ Dprintf ("leave NX_NormalUpdate\n") ;
+}
+
+int NX_SetupImage (_THIS, SDL_Surface * screen)
+{
+ int size = screen -> h * screen -> pitch ;
+
+ Dprintf ("enter NX_SetupImage\n") ;
+
+ screen -> pixels = (void *) SDL_malloc (size) ;
+
+ if (!Clientfb) {
+ Image_buff = (unsigned char *) SDL_malloc (size) ;
+ if (screen -> pixels == NULL || Image_buff == NULL) {
+ SDL_free (screen -> pixels) ;
+ SDL_free (Image_buff) ;
+ SDL_OutOfMemory () ;
+ return -1 ;
+ }
+ }
+
+ SDL_Image = (unsigned char *) screen -> pixels ;
+
+ this -> UpdateRects = NX_NormalUpdate ;
+
+ Dprintf ("leave NX_SetupImage\n") ;
+ return 0 ;
+}
+
+void NX_DestroyImage (_THIS, SDL_Surface * screen)
+{
+ Dprintf ("enter NX_DestroyImage\n") ;
+
+ if (SDL_Image) SDL_free (SDL_Image) ;
+ if (Image_buff) SDL_free (Image_buff) ;
+ if (screen) screen -> pixels = NULL ;
+
+ Dprintf ("leave NX_DestroyImage\n") ;
+}
+
+int NX_ResizeImage (_THIS, SDL_Surface * screen, Uint32 flags)
+{
+ int retval ;
+ GR_SCREEN_INFO si ;
+
+ Dprintf ("enter NX_ResizeImage\n") ;
+
+ NX_DestroyImage (this, screen) ;
+ retval = NX_SetupImage (this, screen) ;
+
+ GrGetScreenInfo (& si) ;
+ OffsetX = (si.cols - screen -> w) / 2 ;
+ OffsetY = (si.rows - screen -> h) / 2 ;
+
+#ifdef ENABLE_NANOX_DIRECT_FB
+ if (Clientfb) {
+ /* Get current window position and fb pointer*/
+ if (currently_fullscreen)
+ GrGetWindowFBInfo(FSwindow, &fbinfo);
+ else
+ GrGetWindowFBInfo(SDL_Window, &fbinfo);
+ }
+#endif
+ Dprintf ("leave NX_ResizeImage\n") ;
+ return retval ;
+}
+
+void NX_RefreshDisplay (_THIS)
+{
+ Dprintf ("enter NX_RefreshDisplay\n") ;
+
+ // Don't refresh a display that doesn't have an image (like GL)
+ if (! SDL_Image) {
+ return;
+ }
+
+#ifdef ENABLE_NANOX_DIRECT_FB
+ if (Clientfb) {
+ int j;
+ char *src, *dest = NULL;
+ int xinc, yinc, rowinc;
+
+ GrGetWindowFBInfo(SDL_Window, &fbinfo);
+
+ xinc = this -> screen -> format -> BytesPerPixel ;
+ yinc = this -> screen -> pitch ;
+
+ src = SDL_Image;
+ if (currently_fullscreen)
+ dest = fbinfo.winpixels + ((OffsetY * fbinfo.pitch) +
+ (OffsetX * fbinfo.bytespp));
+ else
+ dest = fbinfo.winpixels;
+ rowinc = xinc * this -> screen -> w;
+
+ for (j = this -> screen -> h; j > 0; -- j, src += yinc, dest += fbinfo.pitch)
+ SDL_memcpy (dest, src, rowinc) ;
+ }
+ else
+#endif
+ {
+ if (currently_fullscreen) {
+ GrArea (FSwindow, SDL_GC, OffsetX, OffsetY, this -> screen -> w,
+ this -> screen -> h, SDL_Image, pixel_type) ;
+ } else {
+ GrArea (SDL_Window, SDL_GC, 0, 0, this -> screen -> w,
+ this -> screen -> h, SDL_Image, pixel_type) ;
+ }
+ }
+ GrFlush();
+
+ Dprintf ("leave NX_RefreshDisplay\n") ;
+}
diff --git a/distrib/sdl-1.2.15/src/video/nanox/SDL_nximage_c.h b/distrib/sdl-1.2.15/src/video/nanox/SDL_nximage_c.h
new file mode 100644
index 0000000..0bf29e5
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/nanox/SDL_nximage_c.h
@@ -0,0 +1,35 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+ Copyright (C) 2001 Hsieh-Fu Tsai
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ Hsieh-Fu Tsai
+ clare@setabox.com
+*/
+#include "SDL_config.h"
+
+#include "SDL_nxvideo.h"
+
+extern int NX_SetupImage (_THIS, SDL_Surface * screen) ;
+extern void NX_DestroyImage (_THIS, SDL_Surface * screen) ;
+extern int NX_ResizeImage (_THIS, SDL_Surface * screen, Uint32 flags) ;
+
+extern void NX_NormalUpdate (_THIS, int numrects, SDL_Rect * rects) ;
+extern void NX_RefreshDisplay (_THIS) ;
diff --git a/distrib/sdl-1.2.15/src/video/nanox/SDL_nxmodes.c b/distrib/sdl-1.2.15/src/video/nanox/SDL_nxmodes.c
new file mode 100644
index 0000000..bcf74e5
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/nanox/SDL_nxmodes.c
@@ -0,0 +1,84 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+ Copyright (C) 2001 Hsieh-Fu Tsai
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ Hsieh-Fu Tsai
+ clare@setabox.com
+*/
+#include "SDL_config.h"
+
+#include "SDL_stdinc.h"
+#include "SDL_nxmodes_c.h"
+
+SDL_Rect ** NX_ListModes (_THIS, SDL_PixelFormat * format, Uint32 flags)
+{
+ if (flags & SDL_FULLSCREEN)
+ return SDL_modelist ;
+
+ if (SDL_Visual.bpp == format -> BitsPerPixel) {
+ return ((SDL_Rect **) -1) ;
+ } else {
+ return ((SDL_Rect **) 0) ;
+ }
+}
+
+void NX_FreeVideoModes (_THIS)
+{
+ int i ;
+
+ if (SDL_modelist) {
+ for (i = 0; SDL_modelist [i]; ++ i) {
+ SDL_free (SDL_modelist [i]) ;
+ }
+ SDL_free (SDL_modelist) ;
+ SDL_modelist = NULL;
+ }
+}
+
+int NX_EnterFullScreen (_THIS)
+{
+ if (! currently_fullscreen) {
+ GR_SCREEN_INFO si ;
+
+ GrGetScreenInfo (& si) ;
+ GrResizeWindow (FSwindow, si.cols, si.rows) ;
+ GrUnmapWindow (SDL_Window) ;
+ GrMapWindow (FSwindow) ;
+ GrRaiseWindow (FSwindow) ;
+ GrSetFocus (FSwindow) ;
+ currently_fullscreen = 1 ;
+ }
+
+ return 1 ;
+}
+
+int NX_LeaveFullScreen (_THIS)
+{
+ if (currently_fullscreen) {
+ GrUnmapWindow (FSwindow) ;
+ GrMapWindow (SDL_Window) ;
+ GrRaiseWindow (SDL_Window) ;
+ GrSetFocus (SDL_Window) ;
+ currently_fullscreen = 0 ;
+ }
+
+ return 0 ;
+}
diff --git a/distrib/sdl-1.2.15/src/video/nanox/SDL_nxmodes_c.h b/distrib/sdl-1.2.15/src/video/nanox/SDL_nxmodes_c.h
new file mode 100644
index 0000000..fe2e655
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/nanox/SDL_nxmodes_c.h
@@ -0,0 +1,34 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+ Copyright (C) 2001 Hsieh-Fu Tsai
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ Hsieh-Fu Tsai
+ clare@setabox.com
+*/
+#include "SDL_config.h"
+
+#include "SDL_nxvideo.h"
+#include <SDL.h>
+
+extern SDL_Rect ** NX_ListModes (_THIS, SDL_PixelFormat * format, Uint32 flags) ;
+extern void NX_FreeVideoModes (_THIS) ;
+extern int NX_EnterFullScreen (_THIS) ;
+extern int NX_LeaveFullScreen (_THIS) ;
diff --git a/distrib/sdl-1.2.15/src/video/nanox/SDL_nxmouse.c b/distrib/sdl-1.2.15/src/video/nanox/SDL_nxmouse.c
new file mode 100644
index 0000000..9c8f382
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/nanox/SDL_nxmouse.c
@@ -0,0 +1,79 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+ Copyright (C) 2001 Hsieh-Fu Tsai
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ Hsieh-Fu Tsai
+ clare@setabox.com
+*/
+#include "SDL_config.h"
+
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_nxmouse_c.h"
+
+// The implementation dependent data for the window manager cursor
+struct WMcursor {
+ int unused ;
+} ;
+
+WMcursor * NX_CreateWMCursor (_THIS,
+ Uint8 * data, Uint8 * mask, int w, int h, int hot_x, int hot_y)
+{
+ WMcursor * cursor ;
+
+ Dprintf ("enter NX_CreateWMCursor\n") ;
+
+ cursor = (WMcursor *) SDL_malloc (sizeof (WMcursor)) ;
+ if (cursor == NULL) {
+ SDL_OutOfMemory () ;
+ return NULL ;
+ }
+
+ Dprintf ("leave NX_CreateWMCursor\n") ;
+ return cursor ;
+}
+
+void NX_FreeWMCursor (_THIS, WMcursor * cursor)
+{
+ Dprintf ("NX_FreeWMCursor\n") ;
+ SDL_free (cursor) ;
+ return ;
+}
+
+void NX_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
+{
+ GR_WINDOW_INFO info ;
+
+ Dprintf ("enter NX_WarpWMCursor\n") ;
+ SDL_Lock_EventThread () ;
+
+ GrGetWindowInfo (SDL_Window, & info) ;
+ GrMoveCursor (info.x + x, info.y + y) ;
+
+ SDL_Unlock_EventThread () ;
+ Dprintf ("leave NX_WarpWMCursor\n") ;
+}
+
+int NX_ShowWMCursor (_THIS, WMcursor * cursor)
+{
+ Dprintf ("NX_ShowWMCursor\n") ;
+ return 1 ;
+}
diff --git a/distrib/sdl-1.2.15/src/video/nanox/SDL_nxmouse_c.h b/distrib/sdl-1.2.15/src/video/nanox/SDL_nxmouse_c.h
new file mode 100644
index 0000000..d7fedb5
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/nanox/SDL_nxmouse_c.h
@@ -0,0 +1,29 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_nxvideo.h"
+
+extern WMcursor * NX_CreateWMCursor (_THIS, Uint8 * data, Uint8 * mask, int w, int h, int hot_x, int hot_y) ;
+void NX_FreeWMCursor (_THIS, WMcursor * cursor) ;
+extern void NX_WarpWMCursor (_THIS, Uint16 x, Uint16 y) ;
+extern int NX_ShowWMCursor (_THIS, WMcursor * cursor) ;
diff --git a/distrib/sdl-1.2.15/src/video/nanox/SDL_nxvideo.c b/distrib/sdl-1.2.15/src/video/nanox/SDL_nxvideo.c
new file mode 100644
index 0000000..b188e09
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/nanox/SDL_nxvideo.c
@@ -0,0 +1,544 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+ Copyright (C) 2001 Hsieh-Fu Tsai
+ Copyright (C) 2002 Greg Haerr <greg@censoft.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ Hsieh-Fu Tsai
+ clare@setabox.com
+*/
+#include "SDL_config.h"
+
+#include "SDL_thread.h"
+#include "SDL_video.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+
+#define MWINCLUDECOLORS
+#include "SDL_nxvideo.h"
+#include "SDL_nxmodes_c.h"
+#include "SDL_nxwm_c.h"
+#include "SDL_nxmouse_c.h"
+#include "SDL_nximage_c.h"
+#include "SDL_nxevents_c.h"
+
+// Initialization/Query functions
+static int NX_VideoInit (_THIS, SDL_PixelFormat * vformat) ;
+static SDL_Surface * NX_SetVideoMode (_THIS, SDL_Surface * current, int width, int height, int bpp, Uint32 flags) ;
+static int NX_SetColors (_THIS, int firstcolor, int ncolors, SDL_Color * colors) ;
+static void NX_VideoQuit (_THIS) ;
+static void NX_DestroyWindow (_THIS, SDL_Surface * screen) ;
+static int NX_ToggleFullScreen (_THIS, int on) ;
+static void NX_UpdateMouse (_THIS) ;
+static int NX_SetGammaRamp (_THIS, Uint16 * ramp) ;
+static int NX_GetGammaRamp (_THIS, Uint16 * ramp) ;
+
+// Microwin driver bootstrap functions
+static int NX_Available ()
+{
+ Dprintf ("enter NX_Available\n") ;
+
+ if (GrOpen () < 0) return 0 ;
+ GrClose () ;
+
+ Dprintf ("leave NX_Available\n") ;
+ return 1 ;
+}
+
+static void NX_DeleteDevice (SDL_VideoDevice * device)
+{
+ Dprintf ("enter NX_DeleteDevice\n") ;
+
+ if (device) {
+ if (device -> hidden) SDL_free (device -> hidden) ;
+ if (device -> gl_data) SDL_free (device -> gl_data) ;
+ SDL_free (device) ;
+ }
+
+ Dprintf ("leave NX_DeleteDevice\n") ;
+}
+
+static SDL_VideoDevice * NX_CreateDevice (int devindex)
+{
+ SDL_VideoDevice * device ;
+
+ Dprintf ("enter NX_CreateDevice\n") ;
+
+ // Initialize all variables that we clean on shutdown
+ device = (SDL_VideoDevice *) SDL_malloc (sizeof (SDL_VideoDevice)) ;
+ if (device) {
+ SDL_memset (device, 0, (sizeof * device)) ;
+ device -> hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc ((sizeof * device -> hidden)) ;
+ device -> gl_data = NULL ;
+ }
+ if ((device == NULL) || (device -> hidden == NULL)) {
+ SDL_OutOfMemory () ;
+ NX_DeleteDevice (device) ;
+ return 0 ;
+ }
+ SDL_memset (device -> hidden, 0, (sizeof * device -> hidden)) ;
+
+ // Set the function pointers
+ device -> VideoInit = NX_VideoInit ;
+ device -> ListModes = NX_ListModes ;
+ device -> SetVideoMode = NX_SetVideoMode ;
+ device -> ToggleFullScreen = NX_ToggleFullScreen ;
+ device -> UpdateMouse = NX_UpdateMouse ;
+ device -> CreateYUVOverlay = NULL ;
+ device -> SetColors = NX_SetColors ;
+ device -> UpdateRects = NULL ;
+ device -> VideoQuit = NX_VideoQuit;
+ device -> AllocHWSurface = NULL ;
+ device -> CheckHWBlit = NULL ;
+ device -> FillHWRect = NULL ;
+ device -> SetHWColorKey = NULL ;
+ device -> SetHWAlpha = NULL ;
+ device -> LockHWSurface = NULL ;
+ device -> UnlockHWSurface = NULL ;
+ device -> FlipHWSurface = NULL ;
+ device -> FreeHWSurface = NULL ;
+ device -> SetGamma = NULL ;
+ device -> GetGamma = NULL ;
+ device -> SetGammaRamp = NX_SetGammaRamp ;
+ device -> GetGammaRamp = NX_GetGammaRamp ;
+
+#if SDL_VIDEO_OPENGL
+ device -> GL_LoadLibrary = NULL ;
+ device -> GL_GetProcAddress = NULL ;
+ device -> GL_GetAttribute = NULL ;
+ device -> GL_MakeCurrent = NULL ;
+ device -> GL_SwapBuffers = NULL ;
+#endif
+
+ device -> SetIcon = NULL ;
+ device -> SetCaption = NX_SetCaption;
+ device -> IconifyWindow = NULL ;
+ device -> GrabInput = NULL ;
+ device -> GetWMInfo = NX_GetWMInfo ;
+ device -> FreeWMCursor = NX_FreeWMCursor ;
+ device -> CreateWMCursor = NX_CreateWMCursor ;
+ device -> ShowWMCursor = NX_ShowWMCursor ;
+ device -> WarpWMCursor = NX_WarpWMCursor ;
+ device -> CheckMouseMode = NULL ;
+ device -> InitOSKeymap = NX_InitOSKeymap ;
+ device -> PumpEvents = NX_PumpEvents ;
+
+ device -> free = NX_DeleteDevice ;
+
+ Dprintf ("leave NX_CreateDevice\n") ;
+ return device ;
+}
+
+VideoBootStrap NX_bootstrap = {
+ "nanox", "nanox", NX_Available, NX_CreateDevice
+} ;
+
+static void create_aux_windows (_THIS)
+{
+ GR_WM_PROPERTIES props ;
+
+ Dprintf ("enter create_aux_windows\n") ;
+
+ // Don't create any extra windows if we are being managed
+ if (SDL_windowid) {
+ FSwindow = 0 ;
+ return ;
+ }
+
+ if (FSwindow && FSwindow != GR_ROOT_WINDOW_ID) {
+ GrDestroyWindow (FSwindow) ;
+ }
+
+ FSwindow = GrNewWindow (GR_ROOT_WINDOW_ID, 0, 0, 1, 1, 0, BLACK, BLACK) ;
+ props.flags = GR_WM_FLAGS_PROPS ;
+ props.props = GR_WM_PROPS_NODECORATE ;
+ GrSetWMProperties (FSwindow, & props) ;
+
+ GrSelectEvents (FSwindow, (GR_EVENT_MASK_EXPOSURE |
+ GR_EVENT_MASK_BUTTON_DOWN | GR_EVENT_MASK_BUTTON_UP |
+ GR_EVENT_MASK_FOCUS_IN | GR_EVENT_MASK_FOCUS_OUT |
+ GR_EVENT_MASK_KEY_DOWN | GR_EVENT_MASK_KEY_UP |
+ GR_EVENT_MASK_MOUSE_ENTER | GR_EVENT_MASK_MOUSE_EXIT |
+ GR_EVENT_MASK_MOUSE_MOTION | GR_EVENT_MASK_UPDATE |
+ GR_EVENT_MASK_CLOSE_REQ)) ;
+
+ Dprintf ("leave create_aux_windows\n") ;
+}
+
+int NX_VideoInit (_THIS, SDL_PixelFormat * vformat)
+{
+ GR_SCREEN_INFO si ;
+
+ Dprintf ("enter NX_VideoInit\n") ;
+
+ if (GrOpen () < 0) {
+ SDL_SetError ("GrOpen() fail") ;
+ return -1 ;
+ }
+
+ // use share memory to speed up
+#ifdef NANOX_SHARE_MEMORY
+ GrReqShmCmds (0xFFFF);
+#endif
+
+ SDL_Window = 0 ;
+ FSwindow = 0 ;
+
+ GammaRamp_R = NULL ;
+ GammaRamp_G = NULL ;
+ GammaRamp_B = NULL ;
+
+ GrGetScreenInfo (& si) ;
+ SDL_Visual.bpp = si.bpp ;
+
+ /* Determine the current screen size */
+ this->info.current_w = si.cols ;
+ this->info.current_h = si.rows ;
+
+ // GetVideoMode
+ SDL_modelist = (SDL_Rect **) SDL_malloc (sizeof (SDL_Rect *) * 2) ;
+ if (SDL_modelist) {
+ SDL_modelist [0] = (SDL_Rect *) SDL_malloc (sizeof(SDL_Rect)) ;
+ if (SDL_modelist [0]) {
+ SDL_modelist [0] -> x = 0 ;
+ SDL_modelist [0] -> y = 0 ;
+ SDL_modelist [0] -> w = si.cols ;
+ SDL_modelist [0] -> h = si.rows ;
+ }
+ SDL_modelist [1] = NULL ;
+ }
+
+ pixel_type = si.pixtype;
+ SDL_Visual.red_mask = si.rmask;
+ SDL_Visual.green_mask = si.gmask;
+ SDL_Visual.blue_mask = si.bmask;
+
+ vformat -> BitsPerPixel = SDL_Visual.bpp ;
+ if (vformat -> BitsPerPixel > 8) {
+ vformat -> Rmask = SDL_Visual.red_mask ;
+ vformat -> Gmask = SDL_Visual.green_mask ;
+ vformat -> Bmask = SDL_Visual.blue_mask ;
+ }
+
+ // See if we have been passed a window to use
+ SDL_windowid = getenv ("SDL_WINDOWID") ;
+
+ // Create the fullscreen (and managed windows : no implement)
+ create_aux_windows (this) ;
+
+ Dprintf ("leave NX_VideoInit\n") ;
+ return 0 ;
+}
+
+void NX_VideoQuit (_THIS)
+{
+ Dprintf ("enter NX_VideoQuit\n") ;
+
+ // Start shutting down the windows
+ NX_DestroyImage (this, this -> screen) ;
+ NX_DestroyWindow (this, this -> screen) ;
+ if (FSwindow && FSwindow != GR_ROOT_WINDOW_ID) {
+ GrDestroyWindow (FSwindow) ;
+ }
+ NX_FreeVideoModes (this) ;
+ SDL_free (GammaRamp_R) ;
+ SDL_free (GammaRamp_G) ;
+ SDL_free (GammaRamp_B) ;
+
+#ifdef ENABLE_NANOX_DIRECT_FB
+ if (Clientfb)
+ GrCloseClientFramebuffer();
+#endif
+ GrClose () ;
+
+ Dprintf ("leave NX_VideoQuit\n") ;
+}
+
+static void NX_DestroyWindow (_THIS, SDL_Surface * screen)
+{
+ Dprintf ("enter NX_DestroyWindow\n") ;
+
+ if (! SDL_windowid) {
+ if (screen && (screen -> flags & SDL_FULLSCREEN)) {
+ screen -> flags &= ~ SDL_FULLSCREEN ;
+ NX_LeaveFullScreen (this) ;
+ }
+
+ // Destroy the output window
+ if (SDL_Window && SDL_Window != GR_ROOT_WINDOW_ID) {
+ GrDestroyWindow (SDL_Window) ;
+ }
+ }
+
+ // Free the graphics context
+ if (! SDL_GC) {
+ GrDestroyGC (SDL_GC) ;
+ SDL_GC = 0;
+ }
+
+ Dprintf ("leave NX_DestroyWindow\n") ;
+}
+
+static int NX_CreateWindow (_THIS, SDL_Surface * screen,
+ int w, int h, int bpp, Uint32 flags)
+{
+ Dprintf ("enter NX_CreateWindow\n") ;
+
+ // If a window is already present, destroy it and start fresh
+ if (SDL_Window && SDL_Window != GR_ROOT_WINDOW_ID) {
+ NX_DestroyWindow (this, screen) ;
+ }
+
+ // See if we have been given a window id
+ if (SDL_windowid) {
+ SDL_Window = SDL_strtol (SDL_windowid, NULL, 0) ;
+ } else {
+ SDL_Window = 0 ;
+ }
+
+ if ( ! SDL_ReallocFormat (screen, bpp, SDL_Visual.red_mask,
+ SDL_Visual.green_mask, SDL_Visual.blue_mask, 0))
+ return -1;
+
+ // Create (or use) the nanox display window
+ if (! SDL_windowid) {
+
+ SDL_Window = GrNewWindow (GR_ROOT_WINDOW_ID, 0, 0, w, h, 0, BLACK, WHITE) ;
+
+ GrSelectEvents (SDL_Window, (GR_EVENT_MASK_EXPOSURE |
+ GR_EVENT_MASK_BUTTON_DOWN | GR_EVENT_MASK_BUTTON_UP |
+ GR_EVENT_MASK_FOCUS_IN | GR_EVENT_MASK_FOCUS_OUT |
+ GR_EVENT_MASK_KEY_DOWN | GR_EVENT_MASK_KEY_UP |
+ GR_EVENT_MASK_MOUSE_ENTER | GR_EVENT_MASK_MOUSE_EXIT |
+ GR_EVENT_MASK_MOUSE_MOTION | GR_EVENT_MASK_UPDATE |
+ GR_EVENT_MASK_CLOSE_REQ)) ;
+ }
+
+ /* Create the graphics context here, once we have a window */
+ SDL_GC = GrNewGC () ;
+ if (SDL_GC == 0) {
+ SDL_SetError("Couldn't create graphics context");
+ return(-1);
+ }
+
+ // Map them both and go fullscreen, if requested
+ if (! SDL_windowid) {
+ GrMapWindow (SDL_Window) ;
+ if (flags & SDL_FULLSCREEN) {
+ screen -> flags |= SDL_FULLSCREEN ;
+ NX_EnterFullScreen (this) ;
+ } else {
+ screen -> flags &= ~ SDL_FULLSCREEN ;
+ }
+ }
+
+#ifdef ENABLE_NANOX_DIRECT_FB
+ /* attempt allocating the client side framebuffer */
+ Clientfb = GrOpenClientFramebuffer();
+ /* NULL return will default to using GrArea()*/
+#endif
+
+ Dprintf ("leave NX_CreateWindow\n") ;
+ return 0 ;
+}
+
+SDL_Surface * NX_SetVideoMode (_THIS, SDL_Surface * current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ Dprintf ("enter NX_SetVideoMode\n") ;
+
+ // Lock the event thread, in multi-threading environments
+ SDL_Lock_EventThread () ;
+
+ bpp = SDL_Visual.bpp ;
+ if (NX_CreateWindow (this, current, width, height, bpp, flags) < 0) {
+ current = NULL;
+ goto done;
+ }
+
+ if (current -> w != width || current -> h != height) {
+ current -> w = width ;
+ current -> h = height ;
+ current -> pitch = SDL_CalculatePitch (current) ;
+ NX_ResizeImage (this, current, flags) ;
+ }
+
+ /* Clear these flags and set them only if they are in the new set. */
+ current -> flags &= ~(SDL_RESIZABLE|SDL_NOFRAME);
+ current -> flags |= (flags & (SDL_RESIZABLE | SDL_NOFRAME)) ;
+
+ done:
+ SDL_Unlock_EventThread () ;
+
+ Dprintf ("leave NX_SetVideoMode\n") ;
+
+ // We're done!
+ return current ;
+}
+
+// ncolors <= 256
+int NX_SetColors (_THIS, int firstcolor, int ncolors, SDL_Color * colors)
+{
+ int i ;
+ GR_PALETTE pal ;
+
+ Dprintf ("enter NX_SetColors\n") ;
+
+ if (ncolors > 256) return 0 ;
+
+ pal.count = ncolors ;
+ for (i = 0; i < ncolors; ++ i) {
+ pal.palette [i].r = colors [i].r ;
+ pal.palette [i].g = colors [i].g ;
+ pal.palette [i].b = colors [i].b ;
+ }
+ GrSetSystemPalette (firstcolor, & pal) ;
+
+ Dprintf ("leave NX_SetColors\n") ;
+ return 1 ;
+}
+
+static int NX_ToggleFullScreen (_THIS, int on)
+{
+ SDL_Rect rect ;
+ Uint32 event_thread ;
+
+ Dprintf ("enter NX_ToggleFullScreen\n") ;
+
+ // Don't switch if we don't own the window
+ if (SDL_windowid) return 0 ;
+
+ // Don't lock if we are the event thread
+ event_thread = SDL_EventThreadID () ;
+ if (event_thread && (SDL_ThreadID () == event_thread)) {
+ event_thread = 0 ;
+ }
+ if (event_thread) {
+ SDL_Lock_EventThread() ;
+ }
+
+ if (on) {
+ NX_EnterFullScreen (this) ;
+ } else {
+ this -> screen -> flags &= ~ SDL_FULLSCREEN ;
+ NX_LeaveFullScreen (this) ;
+ }
+
+ rect.x = rect.y = 0 ;
+ rect.w = this -> screen -> w, rect.h = this -> screen -> h ;
+ NX_NormalUpdate (this, 1, & rect) ;
+
+ if (event_thread) {
+ SDL_Unlock_EventThread () ;
+ }
+
+ Dprintf ("leave NX_ToggleFullScreen\n") ;
+ return 1 ;
+}
+
+// Update the current mouse state and position
+static void NX_UpdateMouse (_THIS)
+{
+ int x, y ;
+ GR_WINDOW_INFO info ;
+ GR_SCREEN_INFO si ;
+
+
+ Dprintf ("enter NX_UpdateMouse\n") ;
+
+ // Lock the event thread, in multi-threading environments
+ SDL_Lock_EventThread () ;
+
+ GrGetScreenInfo (& si) ;
+ GrGetWindowInfo (SDL_Window, & info) ;
+ x = si.xpos - info.x ;
+ y = si.ypos - info.y ;
+ if (x >= 0 && x <= info.width && y >= 0 && y <= info.height) {
+ SDL_PrivateAppActive (1, SDL_APPMOUSEFOCUS) ;
+ SDL_PrivateMouseMotion (0, 0, x, y);
+ } else {
+ SDL_PrivateAppActive (0, SDL_APPMOUSEFOCUS) ;
+ }
+
+ SDL_Unlock_EventThread () ;
+ Dprintf ("leave NX_UpdateMouse\n") ;
+}
+
+static int NX_SetGammaRamp (_THIS, Uint16 * ramp)
+{
+ int i ;
+ Uint16 * red, * green, * blue ;
+
+ Dprintf ("enter NX_SetGammaRamp\n") ;
+
+ if (SDL_Visual.bpp != 32 && SDL_Visual.bpp != 24) return -1 ;
+
+ if (! GammaRamp_R) GammaRamp_R = (Uint16 *) SDL_malloc (sizeof (Uint16) * CI_SIZE) ;
+ if (! GammaRamp_G) GammaRamp_G = (Uint16 *) SDL_malloc (sizeof (Uint16) * CI_SIZE) ;
+ if (! GammaRamp_B) GammaRamp_B = (Uint16 *) SDL_malloc (sizeof (Uint16) * CI_SIZE) ;
+ if ((! GammaRamp_R) || (! GammaRamp_G) || (! GammaRamp_B)) {
+ SDL_OutOfMemory () ;
+ return -1 ;
+ }
+
+ for (i = 0; i < CI_SIZE; ++ i)
+ GammaRamp_R [i] = GammaRamp_G [i] = GammaRamp_B [i] = i ;
+
+ red = ramp ;
+ green = ramp + CI_SIZE ;
+ blue = green + CI_SIZE ;
+
+ for (i = 0; i < CI_SIZE; ++ i) {
+ GammaRamp_R [i] = red [i] ;
+ GammaRamp_G [i] = green [i] ;
+ GammaRamp_B [i] = blue [i] ;
+ }
+ SDL_UpdateRect(this->screen, 0, 0, 0, 0);
+
+ Dprintf ("leave NX_SetGammaRamp\n") ;
+ return 0 ;
+}
+
+static int NX_GetGammaRamp (_THIS, Uint16 * ramp)
+{
+ int i ;
+ Uint16 * red, * green, * blue ;
+
+ Dprintf ("enter NX_GetGammaRamp\n") ;
+
+ if (SDL_Visual.bpp != 32 && SDL_Visual.bpp != 24) return -1 ;
+ red = ramp ;
+ green = ramp + CI_SIZE ;
+ blue = green + CI_SIZE ;
+ if (GammaRamp_R && GammaRamp_G && GammaRamp_B) {
+ for (i = 0; i < CI_SIZE; ++ i) {
+ red [i] = GammaRamp_R [i] ;
+ green [i] = GammaRamp_G [i] ;
+ blue [i] = GammaRamp_B [i] ;
+ }
+ } else {
+ for (i = 0; i < CI_SIZE; ++ i)
+ red [i] = green [i] = blue [i] = i ;
+ }
+
+ Dprintf ("leave NX_GetGammaRamp\n") ;
+ return 0 ;
+}
diff --git a/distrib/sdl-1.2.15/src/video/nanox/SDL_nxvideo.h b/distrib/sdl-1.2.15/src/video/nanox/SDL_nxvideo.h
new file mode 100644
index 0000000..1d858d9
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/nanox/SDL_nxvideo.h
@@ -0,0 +1,96 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+ Copyright (C) 2001 Hsieh-Fu Tsai
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ Hsieh-Fu Tsai
+ clare@setabox.com
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_nxvideo_h
+#define _SDL_nxvideo_h
+
+#include <microwin/nano-X.h>
+
+#include "../SDL_sysvideo.h"
+
+#ifdef ENABLE_NANOX_DEBUG
+#define Dprintf printf
+#else
+#define Dprintf(ignore...)
+#endif
+
+// Hidden "this" pointer for the video functions
+#define _THIS SDL_VideoDevice * this
+
+// Private display data
+typedef struct NX_SDL_VISUAL {
+ int bpp ;
+ Uint32 red_mask ;
+ Uint32 green_mask ;
+ Uint32 blue_mask ;
+} nx_sdl_visual_t ;
+
+struct SDL_PrivateVideoData {
+ GR_WINDOW_ID SDL_Window ;
+ GR_WINDOW_ID FSwindow ;
+ // Flag: true if we have been passed a window
+ char * SDL_windowid ;
+ GR_GC_ID GC ;
+ unsigned char * Image ;
+ unsigned char * Image_buff ; /* for GrArea*/
+ unsigned char * Clientfb; /* for DirectFB*/
+ nx_sdl_visual_t SDL_Visual ;
+ // The current list of available video modes
+ SDL_Rect ** modelist ;
+ int currently_fullscreen ;
+ // for fullscreen
+ int OffsetX, OffsetY ;
+ // for GammaRamp
+ Uint16 * GammaRamp_R, * GammaRamp_G, * GammaRamp_B ;
+ // for GrArea, r_mask, g_mask, b_mask
+ int pixel_type ;
+#ifdef ENABLE_NANOX_DIRECT_FB
+ GR_WINDOW_FB_INFO fbinfo;
+#endif
+} ;
+
+#define SDL_Window (this -> hidden -> SDL_Window)
+#define FSwindow (this -> hidden -> FSwindow)
+#define SDL_windowid (this -> hidden -> SDL_windowid)
+#define SDL_GC (this -> hidden -> GC)
+#define SDL_Image (this -> hidden -> Image)
+#define Image_buff (this -> hidden -> Image_buff)
+#define Clientfb (this -> hidden -> Clientfb)
+#define SDL_Visual (this -> hidden -> SDL_Visual)
+#define SDL_modelist (this -> hidden -> modelist)
+#define currently_fullscreen (this -> hidden -> currently_fullscreen)
+#define OffsetX (this -> hidden -> OffsetX)
+#define OffsetY (this -> hidden -> OffsetY)
+#define GammaRamp_R (this -> hidden -> GammaRamp_R)
+#define GammaRamp_G (this -> hidden -> GammaRamp_G)
+#define GammaRamp_B (this -> hidden -> GammaRamp_B)
+#define pixel_type (this -> hidden -> pixel_type)
+#define fbinfo (this -> hidden -> fbinfo)
+
+#define CI_SIZE 256 // color index size
+
+#endif // _SDL_nxvideo_h
diff --git a/distrib/sdl-1.2.15/src/video/nanox/SDL_nxwm.c b/distrib/sdl-1.2.15/src/video/nanox/SDL_nxwm.c
new file mode 100644
index 0000000..c60ebb0
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/nanox/SDL_nxwm.c
@@ -0,0 +1,61 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+ Copyright (C) 2001 Hsieh-Fu Tsai
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ Hsieh-Fu Tsai
+ clare@setabox.com
+*/
+#include "SDL_config.h"
+
+#include "SDL_syswm.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_nxwm_c.h"
+
+void NX_SetCaption (_THIS, const char * title, const char * icon)
+{
+ Dprintf ("enter NX_SetCaption\n") ;
+
+ // Lock the event thread, in multi-threading environments
+ SDL_Lock_EventThread () ;
+
+ if (SDL_Window)
+ GrSetWindowTitle (SDL_Window, title) ;
+
+ SDL_Unlock_EventThread () ;
+ Dprintf ("leave NX_SetCaption\n") ;
+}
+
+int NX_GetWMInfo (_THIS, SDL_SysWMinfo * info)
+{
+ Dprintf ("enter NX_GetWMInfo\n") ;
+
+ if (info -> version.major <= SDL_MAJOR_VERSION) {
+ info -> window = SDL_Window ;
+ return 1 ;
+ } else {
+ SDL_SetError("Application not compiled with SDL %d.%d\n",
+ SDL_MAJOR_VERSION, SDL_MINOR_VERSION) ;
+ return -1 ;
+ }
+
+ Dprintf ("leave NX_GetWMInfo\n") ;
+}
diff --git a/distrib/sdl-1.2.15/src/video/nanox/SDL_nxwm_c.h b/distrib/sdl-1.2.15/src/video/nanox/SDL_nxwm_c.h
new file mode 100644
index 0000000..77be794
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/nanox/SDL_nxwm_c.h
@@ -0,0 +1,32 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+ Copyright (C) 2001 Hsieh-Fu Tsai
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ Hsieh-Fu Tsai
+ clare@setabox.com
+*/
+#include "SDL_config.h"
+
+#include "SDL_nxvideo.h"
+
+// Functions to be exported
+extern void NX_SetCaption (_THIS, const char * title, const char * icon) ;
+extern int NX_GetWMInfo (_THIS, SDL_SysWMinfo * info) ;
diff --git a/distrib/sdl-1.2.15/src/video/nds/SDL_ndsevents.c b/distrib/sdl-1.2.15/src/video/nds/SDL_ndsevents.c
new file mode 100644
index 0000000..a4f0fbe
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/nds/SDL_ndsevents.c
@@ -0,0 +1,83 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Being a nds driver, there's no event stream. We just define stubs for
+ most of the API. */
+#include <nds.h>
+#include "SDL.h"
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_ndsvideo.h"
+#include "SDL_ndsevents_c.h"
+
+static SDLKey keymap[NDS_NUMKEYS];
+char keymem[NDS_NUMKEYS]; /* memorize states of buttons */
+
+void NDS_PumpEvents(_THIS)
+{
+ scanKeys();
+ int i;
+ SDL_keysym keysym;
+ keysym.mod=KMOD_NONE;
+ for(i=0;i<NDS_NUMKEYS;i++)
+ {
+ keysym.scancode=i;
+ keysym.sym=keymap[i];
+ if(keysHeld()&(1<<i) && !keymem[i])
+ {
+ keymem[i]=1;
+ //printf("key released %d\n",i);
+ SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
+ }
+ if(!(keysHeld()&(1<<i)) && keymem[i])
+ {
+ keymem[i]=0;
+ //printf("key pressed %d\n",i);
+ SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
+ }
+ }
+ //touchPosition touch;
+ //touch=touchReadXY();
+ //if (touch.px!=0 || touch.py!=0)
+ // SDL_PrivateMouseMotion(SDL_PRESSED, 0, touch.px, touch.py);
+}
+
+void NDS_InitOSKeymap(_THIS)
+{
+ SDL_memset(keymem,1,NDS_NUMKEYS);
+ keymap[KEY_A]=SDLK_a;
+ keymap[KEY_B]=SDLK_s;
+ keymap[KEY_X]=SDLK_w;
+ keymap[KEY_Y]=SDLK_d;
+ keymap[KEY_L]=SDLK_q;
+ keymap[KEY_R]=SDLK_e;
+ keymap[KEY_UP]=SDLK_UP;
+ keymap[KEY_DOWN]=SDLK_DOWN;
+ keymap[KEY_LEFT]=SDLK_LEFT;
+ keymap[KEY_RIGHT]=SDLK_RIGHT;
+ keymap[KEY_SELECT]=SDLK_SPACE;
+ keymap[KEY_START]=SDLK_RETURN;
+}
+
+/* end of SDL_gbaevents.c ... */
+
diff --git a/distrib/sdl-1.2.15/src/video/nds/SDL_ndsevents_c.h b/distrib/sdl-1.2.15/src/video/nds/SDL_ndsevents_c.h
new file mode 100644
index 0000000..fcd0ef2
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/nds/SDL_ndsevents_c.h
@@ -0,0 +1,51 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_ndsvideo.h"
+
+/* Variables and functions exported by SDL_sysevents.c to other parts
+ of the native video subsystem (SDL_sysvideo.c)
+*/
+extern void NDS_InitOSKeymap(_THIS);
+extern void NDS_PumpEvents(_THIS);
+
+#define NDS_NUMKEYS 12
+
+/*
+#define NDS_JOYPADREG 0x4000130
+#define NDS_JOYPAD (*(volatile Uint16*)NDS_JOYPADREG)
+
+#define NDS_NUMKEYS 10
+#define NDS_KEYA (0)
+#define NDS_KEYB (1)
+#define NDS_KEYSEL (2)
+#define NDS_KEYSTART (3)
+#define NDS_KEYRIGHT (4)
+#define NDS_KEYLEFT (5)
+#define NDS_KEYUP (6)
+#define NDS_KEYDOWN (7)
+#define NDS_KEYR (8)
+#define NDS_KEYL (9)
+*/
+/* end of SDL_NDSevents_c.h ... */
+
diff --git a/distrib/sdl-1.2.15/src/video/nds/SDL_ndsmouse.c b/distrib/sdl-1.2.15/src/video/nds/SDL_ndsmouse.c
new file mode 100644
index 0000000..bba1417
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/nds/SDL_ndsmouse.c
@@ -0,0 +1,34 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_error.h"
+#include "SDL_mouse.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_ndsmouse_c.h"
+
+
+/* The implementation dependent data for the window manager cursor */
+struct WMcursor {
+ int unused;
+};
diff --git a/distrib/sdl-1.2.15/src/video/nds/SDL_ndsmouse_c.h b/distrib/sdl-1.2.15/src/video/nds/SDL_ndsmouse_c.h
new file mode 100644
index 0000000..76adf02
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/nds/SDL_ndsmouse_c.h
@@ -0,0 +1,26 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_ndsvideo.h"
+
+/* Functions to be exported */
diff --git a/distrib/sdl-1.2.15/src/video/nds/SDL_ndsvideo.c b/distrib/sdl-1.2.15/src/video/nds/SDL_ndsvideo.c
new file mode 100644
index 0000000..d0ee8bf
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/nds/SDL_ndsvideo.c
@@ -0,0 +1,500 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <nds.h>
+#include <nds/registers_alt.h>
+#include "SDL.h"
+#include "SDL_error.h"
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_ndsvideo.h"
+#include "SDL_ndsevents_c.h"
+#include "SDL_ndsmouse_c.h"
+
+#define NDSVID_DRIVER_NAME "nds"
+
+/* Initialization/Query functions */
+static int NDS_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **NDS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *NDS_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int NDS_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
+static void NDS_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int NDS_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int NDS_LockHWSurface(_THIS, SDL_Surface *surface);
+static int NDS_FlipHWSurface(_THIS, SDL_Surface *surface);
+static void NDS_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void NDS_FreeHWSurface(_THIS, SDL_Surface *surface);
+
+/* etc. */
+static void NDS_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
+
+/* NDS driver bootstrap functions */
+
+static int NDS_Available(void)
+{
+ return(1);
+}
+
+static void NDS_DeleteDevice(SDL_VideoDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+void on_irq_vblank()
+{
+ // Disable interrupts
+ //REG_IME = 0;
+ scanKeys();
+
+ // VBLANK_INTR_WAIT_FLAGS |= IRQ_VBLANK;
+ // REG_IF |= IRQ_VBLANK;
+ //REG_IF = REG_IF;
+
+ // Enable interrupts
+ //REG_IME = 1;
+}
+
+static int HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect)
+ {
+ return 0;
+ }
+
+static int CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst)
+{
+ if (src->flags & SDL_SRCALPHA) return false;
+ if (src->flags & SDL_SRCCOLORKEY) return false;
+ if (src->flags & SDL_HWPALETTE ) return false;
+ if (dst->flags & SDL_SRCALPHA) return false;
+ if (dst->flags & SDL_SRCCOLORKEY) return false;
+ if (dst->flags & SDL_HWPALETTE ) return false;
+
+ if (src->format->BitsPerPixel != dst->format->BitsPerPixel) return false;
+ if (src->format->BytesPerPixel != dst->format->BytesPerPixel) return false;
+
+ src->map->hw_blit = HWAccelBlit;
+ return true;
+}
+
+static SDL_VideoDevice *NDS_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device=0;
+
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *device->hidden));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( device ) {
+ SDL_free(device);
+ }
+ return(0);
+ }
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+
+ /* Set the function pointers */
+ device->VideoInit = NDS_VideoInit;
+ device->ListModes = NDS_ListModes;
+ device->SetVideoMode = NDS_SetVideoMode;
+ device->CreateYUVOverlay = NULL;
+ device->SetColors = NDS_SetColors;
+ device->UpdateRects = NDS_UpdateRects;
+ device->VideoQuit = NDS_VideoQuit;
+ device->AllocHWSurface = NDS_AllocHWSurface;
+ device->CheckHWBlit = CheckHWBlit;
+ device->FillHWRect = NULL;
+ device->SetHWColorKey = NULL;
+ device->SetHWAlpha = NULL;
+ device->LockHWSurface = NDS_LockHWSurface;
+ device->UnlockHWSurface = NDS_UnlockHWSurface;
+ device->FlipHWSurface = NDS_FlipHWSurface;
+ device->FreeHWSurface = NDS_FreeHWSurface;
+ device->SetCaption = NULL;
+ device->SetIcon = NULL;
+ device->IconifyWindow = NULL;
+ device->GrabInput = NULL;
+ device->GetWMInfo = NULL;
+ device->InitOSKeymap = NDS_InitOSKeymap;
+ device->PumpEvents = NDS_PumpEvents;
+ device->info.blit_hw=1;
+
+ device->free = NDS_DeleteDevice;
+ return device;
+}
+
+VideoBootStrap NDS_bootstrap = {
+ NDSVID_DRIVER_NAME, "SDL NDS video driver",
+ NDS_Available, NDS_CreateDevice
+};
+
+ u16* frontBuffer;// = (u16*)(0x06000000);
+ u16* backBuffer;// = (u16*)(0x06000000 + 256 * 256 * 2);
+int NDS_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ //printf("WARNING: You are using the SDL NDS video driver!\n");
+
+ /* Determine the screen depth (use default 8-bit depth) */
+ /* we change this during the SDL_SetVideoMode implementation... */
+ vformat->BitsPerPixel = 16; // mode 3
+ vformat->BytesPerPixel = 2;
+ vformat->Rmask = 0x0000f800;
+ vformat->Gmask = 0x000007e0;
+ vformat->Bmask = 0x0000001f;
+ powerON(POWER_ALL);
+ irqInit();
+ irqSet(IRQ_VBLANK, on_irq_vblank);
+ irqEnable(IRQ_VBLANK);
+
+ //set the mode for 2 text layers and two extended background layers
+ //videoSetMode(MODE_5_2D | DISPLAY_BG3_ACTIVE);
+ videoSetMode(MODE_6_2D| DISPLAY_BG2_ACTIVE);
+
+ //set the sub background up for text display (we could just print to one
+ //of the main display text backgrounds just as easily
+ videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE); //sub bg 0 will be used to print text
+
+ //set the first two banks as background memory and the third as sub background memory
+ //D is not used..if you need a bigger background then you will need to map
+ //more vram banks consecutivly (VRAM A-D are all 0x20000 bytes in size)
+ //vramSetMainBanks(VRAM_A_MAIN_BG_0x6000000, VRAM_B_MAIN_BG_0x6020000,VRAM_C_SUB_BG , VRAM_D_LCD);
+ vramSetMainBanks(VRAM_A_MAIN_BG,VRAM_B_MAIN_BG,VRAM_C_MAIN_BG,VRAM_D_MAIN_BG);
+ //vramSetBankA(VRAM_A_MAIN_BG);
+ //vramSetBankB(VRAM_B_MAIN_BG);
+ //vramSetBankC(VRAM_C_MAIN_BG);
+ //vramSetBankD(VRAM_D_MAIN_BG);
+ //vramSetBankE(VRAM_E_MAIN_BG);
+ //vramSetBankF(VRAM_F_MAIN_BG);
+ //vramSetBankG(VRAM_G_MAIN_BG);
+ vramSetBankH(VRAM_H_SUB_BG);
+ vramSetBankI(VRAM_I_LCD);
+
+ ////////////////set up text background for text/////////////////////
+ SUB_BG0_CR = BG_MAP_BASE(8);
+
+ BG_PALETTE_SUB[255] = RGB15(31,31,31);//by default font will be rendered with color 255
+ ///////////////set up our bitmap background///////////////////////
+
+ //BG3_CR = BG_BMP16_512x512;
+
+ //these are rotation backgrounds so you must set the rotation attributes:
+ //these are fixed point numbers with the low 8 bits the fractional part
+ //this basicaly gives it a 1:1 translation in x and y so you get a nice flat bitmap
+ /* BG3_XDX = 1<<8;
+ BG3_XDY = 0;
+ BG3_YDX = 0;
+ BG3_YDY = 1<<8;
+ //our bitmap looks a bit better if we center it so scroll down (256 - 192) / 2
+ BG3_CX = 0;
+ BG3_CY = 0;
+ */
+ //consoleInit() is a lot more flexible but this gets you up and running quick
+ consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(8), (u16*)CHAR_BASE_BLOCK_SUB(0), 16);
+
+
+ frontBuffer =(u16*)(0x06000000);
+ //backBuffer =(u16*)(0x06000000 + 1024 * 512*2);
+
+ //lcdSwap();
+ /* We're done! */
+ return(0);
+}
+
+SDL_Rect **NDS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ return (SDL_Rect **) -1;
+}
+
+SDL_Surface *NDS_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ Uint32 Rmask, Gmask, Bmask, Amask;
+
+ //if(width > 1024 || height > 512 || bpp > 16)
+ // return(NULL);
+
+ if(bpp >8) {
+ bpp=16;
+ Rmask = 0x0000001F;
+ Gmask = 0x000003E0;
+ Bmask = 0x00007C00;
+ Amask = 0x00008000;
+
+ videoSetMode(MODE_5_2D| DISPLAY_BG2_ACTIVE);
+
+ vramSetMainBanks(VRAM_A_MAIN_BG,VRAM_B_MAIN_BG,VRAM_C_MAIN_BG,VRAM_D_MAIN_BG);
+
+ BG2_CR = BG_BMP16_512x512;
+ BG2_XDX = ((width / 256) << 8) | (width % 256) ;
+ BG2_XDY = 0;
+ BG2_YDX = 0;
+ BG2_YDY = ((height / 192) << 8) | ((height % 192) + (height % 192) / 3) ;
+ BG2_CX = 0;
+ BG2_CY = 0;
+// for (i=0;i<256*192;i++)
+// frontBuffer[i] = RGB15(31,0,0)|BIT(15);
+ }
+ else
+ if(bpp <= 8) {
+ bpp=8;
+ Rmask = 0x00000000;
+ Gmask = 0x00000000;
+ Bmask = 0x00000000;
+ BG2_CR = BG_BMP8_1024x512;
+ BG2_XDX = ((width / 256) << 8) | (width % 256) ;
+ BG2_XDY = 0;
+ BG2_YDX = 0;
+ BG2_YDY = ((height / 192) << 8) | ((height % 192) + (height % 192) / 3) ;
+
+ }
+ else
+ if(bpp < 15) bpp=15;
+ if(width<=256) width=256;
+ else
+ if(width<256) width=256;
+ if(height<=192) height=192;
+ else
+ if(height<192) height=192;
+
+ if(bpp==8)
+ {
+ if(width<256) width=256;
+ if(height<192) height=192;
+ this->hidden->ndsmode=4;
+ }
+
+ if(bpp==15)
+ {
+ if(width<256) this->hidden->ndsmode=5;
+ else this->hidden->ndsmode=3;
+ }
+
+ this->hidden->buffer= frontBuffer;//NDS_VRAM_BASE;
+
+ //NDS_DISPCNT = NDS_DISP_MODE(this->hidden->ndsmode)|NDS_DISP_BG2;
+
+ //fprintf(stderr,"Setting mode %dx%d (ndsmode %d)\n", width, height,this->hidden->ndsmode);
+
+ // FIXME: How do I tell that 15 bits mode is 555?
+
+ SDL_memset(this->hidden->buffer, 0, 1024 * 512* ((this->hidden->ndsmode==4 || this->hidden->ndsmode==5) ? 2 : 1 ) * ((bpp+7) / 8));
+
+ /* Allocate the new pixel format for the screen */
+ if ( ! SDL_ReallocFormat(current, bpp, Rmask, Gmask, Bmask, Amask) ) {
+ this->hidden->buffer = NULL;
+ SDL_SetError("Couldn't allocate new pixel format for requested mode");
+ return(NULL);
+ }
+
+ /* Set up the new mode framebuffer */
+ current->flags = flags | SDL_FULLSCREEN | SDL_HWSURFACE | (this->hidden->ndsmode > 0 ? SDL_DOUBLEBUF : 0);
+ this->hidden->w = current->w = width;
+ this->hidden->h = current->h = height;
+ current->pixels = frontBuffer;
+
+ if (flags & SDL_DOUBLEBUF) {
+ this->hidden->secondbufferallocd=1;
+ backBuffer=(u16*)SDL_malloc(1024*512*2);
+ current->pixels = backBuffer;
+ }
+ if(bpp==8)
+ current->pitch =1024;
+ else
+ current->pitch =512*2;
+
+ /* We're done */
+ return(current);
+}
+
+static int NDS_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ if(this->hidden->secondbufferallocd) {
+ //printf("double double buffer alloc\n");
+ return -1;
+ }
+ //if(this->hidden->ndsmode==3)
+ //{
+ // printf("no 2nd buffer in mode3\n");
+ // return -1;
+ //}
+ //printf("second buffer\n");
+ //this->hidden->secondbufferallocd=1;
+ //backBuffer=(u16*)malloc(1024*512*2);
+ //surface->pixels = backBuffer;
+
+ return(0);
+}
+static void NDS_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ //free(backBuffer);
+ this->hidden->secondbufferallocd=0;
+}
+int z=0;
+/* We need to wait for vertical retrace on page flipped displays */
+static int NDS_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+/*
+ uint8* a = surface->pixels;
+ int i,j;
+ a += 5 * SCREEN_WIDTH + 5;
+ for( i = 0; i < 195; ++i) {
+ uint16* line = a + (SCREEN_WIDTH * i);
+ for( j = 0; j < 158; ++j) {
+ *line++ = RGB15(155,155,25);
+ }
+ }
+*/
+ //if (z <256)
+ // BG_PALETTE[z++]=RGB15(255-z,z,255-z);
+
+
+ return(0);
+}
+
+static void NDS_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+static int NDS_FlipHWSurface(_THIS, SDL_Surface *surface)
+{
+ if(this->hidden->secondbufferallocd){
+ while(DISP_Y!=192);
+ while(DISP_Y==192);
+ //printf("flip");
+
+ dmaCopyAsynch(backBuffer,frontBuffer,1024*512);
+ }
+ //printf("flip\n");
+ //u16* temp = surface->pixels;
+ //surface->pixels = frontBuffer;
+ //frontBuffer = temp;
+ /* u8* vram=BG_GFX;
+ int x,y;
+ for(y = 0; y < 512; y++)
+ dmaCopy(&frontBuffer[y*rects->w], &vram[y*512],512);
+ //unsigned char buf;
+
+ //printf("NDS_FlipHWSurface\n");
+ //printf("ptr now: 0x%x\n",surface->pixels);
+
+ while(DISP_Y!=192);
+ while(DISP_Y==192);
+ //swap
+ u16* temp = frontBuffer;
+ frontBuffer = backBuffer;
+ backBuffer = temp;
+
+ //flip
+ //base is 16KB and screen size is 256x256x2 (128KB)
+ BG2_CR ^= BG_BMP_BASE( 512 / 16 ); */
+/*
+ if(surface->pixels == frontBuffer)//NDS_VRAM_BASE)
+ {
+ while(DISP_Y!=192);
+ while(DISP_Y==192);
+ //swap
+ u16* temp = backBuffer;
+ backBuffer = frontBuffer;
+ frontBuffer = temp;
+
+ //flip
+ //base is 16KB and screen size is 256x256x2 (128KB)
+ BG3_CR ^= BG_BMP_BASE( 128 / 16 );
+ }
+ else
+ {
+
+ while(DISP_Y!=192);
+ while(DISP_Y==192);
+ //swap
+ u16* temp = frontBuffer;
+ frontBuffer = backBuffer;
+ backBuffer = temp;
+
+ //flip
+ //base is 16KB and screen size is 256x256x2 (128KB)
+ BG3_CR ^= BG_BMP_BASE( 128 / 16 );
+
+ }
+ */
+ //printf("ptr then: 0x%x\n",surface->pixels);
+
+ //printf("setting dispcnt to 0x%x\n",NDS_DISPCNT = NDS_DISP_MODE(this->hidden->ndsmode)|NDS_DISP_BG2| buf);
+ return(0);
+}
+
+static void NDS_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
+{
+ //fprintf(stderr,"update\n");
+ /* do nothing. */
+ //dmaCopy(frontBuffer,BG_GFX,512*512);
+ /*
+ u8* vram=(u8*)BG_GFX;
+ int x,y;
+ for(y = 0; y < 512; y++)
+ dmaCopy(&frontBuffer[y*rects->w], &vram[y*512],512);
+ */
+
+}
+
+int NDS_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ //printf("SetColors\n");
+ short r,g,b;
+
+ if(this->hidden->ndsmode != 4)
+ {
+ printf("This is not a palettized mode\n");
+ return -1;
+ }
+
+ int i,j=firstcolor+ncolors;
+ for(i=firstcolor;i<j;i++)
+ {
+ r=colors[i].r>>3;
+ g=colors[i].g>>3;
+ b=colors[i].b>>3;
+ BG_PALETTE[i]=RGB15(r, g, b);
+ }
+
+ return(0);
+}
+
+/* Note: If we are terminated, this could be called in the middle of
+ another SDL video routine -- notably UpdateRects.
+*/
+void NDS_VideoQuit(_THIS)
+{
+}
diff --git a/distrib/sdl-1.2.15/src/video/nds/SDL_ndsvideo.h b/distrib/sdl-1.2.15/src/video/nds/SDL_ndsvideo.h
new file mode 100644
index 0000000..015f655
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/nds/SDL_ndsvideo.h
@@ -0,0 +1,61 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_ndsvideo_h
+#define _SDL_ndsvideo_h
+
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+
+/* Private display data */
+
+struct SDL_PrivateVideoData {
+ int w, h;
+ void *buffer;
+ short ndsmode;
+ short secondbufferallocd;
+};
+
+/*
+#define NDS_VIDC_BASE 0x4000000
+#define NDS_DISPCNT (*(volatile Uint32*)(NDS_VIDC_BASE))
+#define NDS_VIDC_SCANLINE (NDS_VIDC_BASE+6)
+#define NDS_SCANLINE (*(volatile Uint8*)(NDS_VIDC_SCANLINE))
+
+#define NDS_DISP_MODE(n) (n&7)
+#define NDS_DISP_BG2 0x400
+#define NDS_DISP_FB 0x10
+
+#define NDS_PAL_BASE 0x5000000
+#define NDS_BGPAL ((volatile Uint16*)(NDS_PAL_BASE))
+#define NDS_OBJPAL ((volatile Uint16*)(NDS_PAL_BASE+0x200))
+
+#define NDS_VRAM_BASE 0x6000000
+#define NDS_VRAM_2NDBUF 0x600a000
+#define NDS_VRAM = ((volatile Uint16* )NDS_VRAM_BASE)
+*/
+#endif /* _SDL_ndsvideo_h */
diff --git a/distrib/sdl-1.2.15/src/video/os2fslib/SDL_os2fslib.c b/distrib/sdl-1.2.15/src/video/os2fslib/SDL_os2fslib.c
new file mode 100644
index 0000000..a902d1f
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/os2fslib/SDL_os2fslib.c
@@ -0,0 +1,3018 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#define _ULS_CALLCONV_
+#define CALLCONV _System
+#include <unidef.h> // Unicode API
+#include <uconv.h> // Unicode API (codepage conversion)
+
+#include <process.h>
+#include <time.h>
+
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_os2fslib.h"
+
+static ULONG ulFCFToUse =
+ FCF_TITLEBAR |
+ FCF_SYSMENU |
+ FCF_MINBUTTON |
+ FCF_MAXBUTTON |
+ FCF_NOBYTEALIGN |
+ FCF_SIZEBORDER |
+ FCF_TASKLIST;
+
+static int bMouseCaptured = 0;
+static int bMouseCapturable = 0;
+static HPOINTER hptrGlobalPointer = NULL;
+static HPOINTER hptrCurrentIcon = NULL;
+static int iWindowSizeX = 320;
+static int iWindowSizeY = 200;
+static int bWindowResized = 0;
+
+#pragma pack(1)
+typedef struct BMPINFO
+{
+ BITMAPINFO;
+ RGB clr;
+} BMPINFO, *PBMPINFO;
+#pragma pack()
+
+
+// Backdoors:
+DECLSPEC void SDLCALL SDL_OS2FSLIB_SetFCFToUse(ULONG ulFCF)
+{
+ ulFCFToUse = ulFCF;
+}
+
+// Configuration defines:
+
+// We have to report empty alpha mask, otherwise SDL will select
+// alpha blitters, and this will have unwanted results, as we don't
+// support alpha channel in FSLib yet.
+#define REPORT_EMPTY_ALPHA_MASK
+
+// Experimental: Move every FSLib_BitBlt() call into window message
+// processing function.
+// This may fix dirt left on desktop. Or not.
+//#define BITBLT_IN_WINMESSAGEPROC
+
+// Experimental-2: Use WinLockWindowUpdate() in around bitblts!
+// This is not enabled, because it seems to cause more problems
+// than good.
+//#define USE_WINLOCKWINDOWUPDATE_AROUND_BITBLTS
+
+// Use the following to show resized image instead of black stuff
+// even if the surface is resizable.
+//#define RESIZE_EVEN_IF_RESIZABLE
+
+/* The translation table from a VK keysym to a SDL keysym */
+static SDLKey HWScanKeyMap[256];
+static SDL_keysym *TranslateKey(int vkey, int chcode, int scancode, SDL_keysym *keysym, int iPressed);
+static int iShiftIsPressed;
+
+#ifdef BITBLT_IN_WINMESSAGEPROC
+#define WM_UPDATERECTSREQUEST WM_USER+50
+#endif
+
+#ifdef USE_WINLOCKWINDOWUPDATE_AROUND_BITBLTS
+#define FSLIB_BITBLT(hwnd, buffer, top, left, width, height) \
+ { \
+ WinLockWindowUpdate(HWND_DESKTOP, HWND_DESKTOP); \
+ FSLib_BitBlt(hwnd, buffer, top, left, width, height); \
+ WinLockWindowUpdate(HWND_DESKTOP, NULL); \
+ }
+#else
+#define FSLIB_BITBLT(hwnd, buffer, top, left, width, height) \
+ FSLib_BitBlt(hwnd, buffer, top, left, width, height);
+#endif
+
+/////////////////////////////////////////////////////////////////////
+//
+// SetAccessableWindowPos
+//
+// Same as WinSetWindowPos(), but takes care for the window to be
+// always on the screen, the titlebar will be accessable everytime.
+//
+/////////////////////////////////////////////////////////////////////
+static BOOL SetAccessableWindowPos(HWND hwnd, HWND hwndInsertBehind,
+ LONG x, LONG y,
+ LONG cx, LONG cy,
+ ULONG fl)
+{
+ SWP swpDesktop, swp;
+ // Get desktop area
+ WinQueryWindowPos(HWND_DESKTOP, &swpDesktop);
+
+ if ((fl & SWP_MOVE) && (fl & SWP_SIZE))
+ {
+ // If both moving and sizing, then change size and pos now!!
+ if (x+cx>swpDesktop.cx)
+ x = swpDesktop.cx - cx;
+ if (x<0)
+ x = 0;
+ if (y<0)
+ y = 0;
+ if (y+cy>swpDesktop.cy)
+ y = swpDesktop.cy - cy;
+ return WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl);
+ } else
+ if (fl & SWP_MOVE)
+ {
+ // Just moving
+ WinQueryWindowPos(hwnd, &swp);
+ if (x+swp.cx>swpDesktop.cx)
+ x = swpDesktop.cx - swp.cx;
+ if (x<0)
+ x = 0;
+ if (y<0)
+ y = 0;
+ if (y+swp.cy>swpDesktop.cy)
+ y = swpDesktop.cy - swp.cy;
+ return WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl);
+ } else
+ if (fl & SWP_SIZE)
+ {
+ // Just sizing
+ WinQueryWindowPos(hwnd, &swp);
+ x = swp.x;
+ y = swp.y;
+ if (x+cx>swpDesktop.cx)
+ x = swpDesktop.cx - cx;
+ if (x<0)
+ x = 0;
+ if (y<0)
+ y = 0;
+ if (y+cy>swpDesktop.cy)
+ y = swpDesktop.cy - cy;
+ return WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl | SWP_MOVE);
+ } else
+ return WinSetWindowPos(hwnd, hwndInsertBehind, x, y, cx, cy, fl);
+}
+
+static UniChar NativeCharToUniChar(int chcode)
+{
+ UniChar ucResult = (UniChar) chcode;
+ int rc;
+ UconvObject ucoTemp;
+ char achFrom[2];
+ char *pchFrom;
+ size_t iFromCount;
+ UniChar aucTo[10];
+ UniChar *pucTo;
+ size_t iToCount;
+ size_t iNonIdentical;
+
+ // Create unicode convert object
+ rc = UniCreateUconvObject(L"", &ucoTemp);
+ if (rc!=ULS_SUCCESS)
+ {
+ // Could not create convert object!
+ return ucResult;
+ }
+
+ // Convert language code string to unicode string
+ achFrom[0] = (char) chcode;
+ achFrom[1] = 0;
+ iFromCount = sizeof(char) * 2;
+ iToCount = sizeof(UniChar) * 2;
+ pucTo = &(aucTo[0]);
+ pchFrom = &(achFrom[0]);
+
+ rc = UniUconvToUcs(ucoTemp,
+ &pchFrom,
+ &iFromCount,
+ &pucTo,
+ &iToCount,
+ &iNonIdentical);
+
+ if (rc!=ULS_SUCCESS)
+ {
+ // Could not convert language code to UCS string!
+ UniFreeUconvObject(ucoTemp);
+ return ucResult;
+ }
+
+ UniFreeUconvObject(ucoTemp);
+
+#ifdef DEBUG_BUILD
+ printf("%02x converted to %02x\n", (int) chcode, (int) (aucTo[0]));
+#endif
+
+ return aucTo[0];
+}
+
+/////////////////////////////////////////////////////////////////////
+//
+// TranslateKey
+//
+// This creates SDL Keycodes from VK_ and hardware scan codes
+//
+/////////////////////////////////////////////////////////////////////
+static SDL_keysym *TranslateKey(int vkey, int chcode, int scancode, SDL_keysym *keysym, int iPressed)
+{
+ keysym->scancode = (unsigned char) scancode;
+ keysym->mod = KMOD_NONE;
+ keysym->unicode = 0;
+
+ if (iPressed && SDL_TranslateUNICODE)
+ {
+ if (chcode)
+ keysym->unicode = NativeCharToUniChar(chcode);
+ else
+ keysym->unicode = vkey;
+ }
+
+ keysym->sym = HWScanKeyMap[scancode];
+
+ // Now stuffs based on state of shift key(s)!
+ if (vkey == VK_SHIFT)
+ {
+ iShiftIsPressed = iPressed;
+ }
+
+ if ((iShiftIsPressed) && (SDL_TranslateUNICODE))
+ {
+ // Change syms, if Unicode stuff is required
+ // I think it's silly, but it's SDL...
+ switch (keysym->sym)
+ {
+ case SDLK_BACKQUOTE:
+ keysym->sym = '~';
+ break;
+ case SDLK_1:
+ keysym->sym = SDLK_EXCLAIM;
+ break;
+ case SDLK_2:
+ keysym->sym = SDLK_AT;
+ break;
+ case SDLK_3:
+ keysym->sym = SDLK_HASH;
+ break;
+ case SDLK_4:
+ keysym->sym = SDLK_DOLLAR;
+ break;
+ case SDLK_5:
+ keysym->sym = '%';
+ break;
+ case SDLK_6:
+ keysym->sym = SDLK_CARET;
+ break;
+ case SDLK_7:
+ keysym->sym = SDLK_AMPERSAND;
+ break;
+ case SDLK_8:
+ keysym->sym = SDLK_ASTERISK;
+ break;
+ case SDLK_9:
+ keysym->sym = SDLK_LEFTPAREN;
+ break;
+ case SDLK_0:
+ keysym->sym = SDLK_RIGHTPAREN;
+ break;
+ case SDLK_MINUS:
+ keysym->sym = SDLK_UNDERSCORE;
+ break;
+ case SDLK_PLUS:
+ keysym->sym = SDLK_EQUALS;
+ break;
+
+ case SDLK_LEFTBRACKET:
+ keysym->sym = '{';
+ break;
+ case SDLK_RIGHTBRACKET:
+ keysym->sym = '}';
+ break;
+
+ case SDLK_SEMICOLON:
+ keysym->sym = SDLK_COLON;
+ break;
+ case SDLK_QUOTE:
+ keysym->sym = SDLK_QUOTEDBL;
+ break;
+ case SDLK_BACKSLASH:
+ keysym->sym = '|';
+ break;
+
+ case SDLK_COMMA:
+ keysym->sym = SDLK_LESS;
+ break;
+ case SDLK_PERIOD:
+ keysym->sym = SDLK_GREATER;
+ break;
+ case SDLK_SLASH:
+ keysym->sym = SDLK_QUESTION;
+ break;
+
+ default:
+ break;
+ }
+ }
+ return keysym;
+}
+
+#define CONVERTMOUSEPOSITION() \
+ /* We have to inverse the mouse position, because every non-os/2 system */ \
+ /* has a coordinate system where the (0;0) is the top-left corner, */ \
+ /* while on os/2 it's the bottom left corner! */ \
+ if (FSLib_QueryFSMode(hwnd)) \
+ { \
+ /* We're in FS mode! */ \
+ /* In FS mode our window is as big as fullscreen mode, but not necessary as */ \
+ /* big as the source buffer (can be bigger) */ \
+ /* So, limit mouse pos to source buffer size! */ \
+ if (ppts->x<0) ppts->x = 0; \
+ if (ppts->y<0) ppts->y = 0; \
+ if (ppts->x>=pVideo->hidden->SrcBufferDesc.uiXResolution) ppts->x = pVideo->hidden->SrcBufferDesc.uiXResolution-1; \
+ if (ppts->y>=pVideo->hidden->SrcBufferDesc.uiYResolution) ppts->y = pVideo->hidden->SrcBufferDesc.uiYResolution-1; \
+ pVideo->hidden->iSkipWMMOUSEMOVE++; /* Don't take next WM_MOUSEMOVE into account! */ \
+ ptl.x = ppts->x; ptl.y = ppts->y; \
+ WinMapWindowPoints(pVideo->hidden->hwndClient, HWND_DESKTOP, &ptl, 1); \
+ WinSetPointerPos(HWND_DESKTOP, ptl.x, ptl.y); \
+ /* Then convert OS/2 position to SDL position */ \
+ ppts->y = pVideo->hidden->SrcBufferDesc.uiYResolution - ppts->y - 1; \
+ } else \
+ { \
+ SWP swpClient; \
+ /* We're in windowed mode! */ \
+ WinQueryWindowPos(pVideo->hidden->hwndClient, &swpClient); \
+ /* Convert OS/2 mouse position to SDL position, and also scale it! */ \
+ (ppts->x) = (ppts->x) * pVideo->hidden->SrcBufferDesc.uiXResolution / swpClient.cx; \
+ (ppts->y) = (ppts->y) * pVideo->hidden->SrcBufferDesc.uiYResolution / swpClient.cy; \
+ (ppts->y) = pVideo->hidden->SrcBufferDesc.uiYResolution - (ppts->y) - 1; \
+ }
+
+
+
+/////////////////////////////////////////////////////////////////////
+//
+// WndProc
+//
+// This is the message processing window procedure for the
+// SDLWindowClass, which is the client window in our application.
+// It handles switching back and away from the app (taking care of
+// going out and back to and from fullscreen mode), sending keystrokes
+// and mouse events to where it has to be sent, etc...
+//
+/////////////////////////////////////////////////////////////////////
+static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
+{
+ HPS ps;
+ RECTL rcl;
+ SDL_VideoDevice *pVideo = NULL;
+
+ switch (msg)
+ {
+ case WM_CHAR: // Keypress notification
+#ifdef DEBUG_BUILD
+// printf("WM_CHAR\n"); fflush(stdout);
+#endif
+ pVideo = WinQueryWindowPtr(hwnd, 0);
+ if (pVideo)
+ {
+ /*
+ // We skip repeated keys:
+ if (CHARMSG(&msg)->cRepeat>1)
+ {
+#ifdef DEBUG_BUILD
+// printf("Repeated key (%d), skipping...\n", CHARMSG(&msg)->cRepeat); fflush(stdout);
+#endif
+ return (MRESULT) TRUE;
+ }
+ */
+
+ // If it's not repeated, then let's see if its pressed or released!
+ if (SHORT1FROMMP(mp1) & KC_KEYUP)
+ {
+ // A key has been released
+ SDL_keysym keysym;
+
+#ifdef DEBUG_BUILD
+// printf("WM_CHAR, keyup, code is [0x%0x]\n", CHAR4FROMMP(mp1)); // HW scan code
+#endif
+
+ // One problem is with F1, which gets only the keyup message because
+ // it is a system key.
+ // So, when we get keyup message, we simulate keydown too!
+ // UPDATE:
+ // This problem should be solved now, that the accelerator keys are
+ // disabled for this window!
+ /*
+ if (SHORT2FROMMP(mp2)==VK_F1)
+ {
+ SDL_PrivateKeyboard(SDL_PRESSED, TranslateKey(SHORT2FROMMP(mp2), // VK_ code
+ SHORT1FROMMP(mp2), // Character code
+ CHAR4FROMMP(mp1), // HW Scan code
+ &keysym,0));
+ }*/
+
+ SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(SHORT2FROMMP(mp2), // VK_ code
+ SHORT1FROMMP(mp2), // Character code
+ CHAR4FROMMP(mp1), // HW Scan code
+ &keysym,0));
+
+ } else
+ {
+ // A key has been pressed
+ SDL_keysym keysym;
+
+#ifdef DEBUG_BUILD
+// printf("WM_CHAR, keydown, code is [0x%0x]\n", CHAR4FROMMP(mp1)); // HW scan code
+#endif
+ // Check for fastkeys: ALT+HOME to toggle FS mode
+ // ALT+END to close app
+ if ((SHORT1FROMMP(mp1) & KC_ALT) &&
+ (SHORT2FROMMP(mp2) == VK_HOME))
+ {
+#ifdef DEBUG_BUILD
+ printf(" Pressed ALT+HOME!\n"); fflush(stdout);
+#endif
+ // Only switch between fullscreen and back if it's not
+ // a resizable mode!
+ if (
+ (!pVideo->hidden->pSDLSurface) ||
+ ((pVideo->hidden->pSDLSurface)
+ && ((pVideo->hidden->pSDLSurface->flags & SDL_RESIZABLE)==0)
+ )
+ )
+ FSLib_ToggleFSMode(hwnd, !FSLib_QueryFSMode(hwnd));
+#ifdef DEBUG_BUILD
+ else
+ printf(" Resizable mode, so discarding ALT+HOME!\n"); fflush(stdout);
+#endif
+ } else
+ if ((SHORT1FROMMP(mp1) & KC_ALT) &&
+ (SHORT2FROMMP(mp2) == VK_END))
+ {
+#ifdef DEBUG_BUILD
+ printf(" Pressed ALT+END!\n"); fflush(stdout);
+#endif
+ // Close window, and get out of loop!
+ // Also send event to SDL application, but we won't
+ // wait for it to be processed!
+ SDL_PrivateQuit();
+ WinPostMsg(hwnd, WM_QUIT, 0, 0);
+ } else
+ {
+
+ SDL_PrivateKeyboard(SDL_PRESSED, TranslateKey(SHORT2FROMMP(mp2), // VK_ code
+ SHORT1FROMMP(mp2), // Character code
+ CHAR4FROMMP(mp1), // HW Scan code
+ &keysym,1));
+
+ }
+ }
+ }
+ return (MRESULT) TRUE;
+
+ case WM_TRANSLATEACCEL:
+ {
+ PQMSG pqmsg;
+ pqmsg = (PQMSG) mp1;
+ if (mp1)
+ {
+ if (pqmsg->msg == WM_CHAR)
+ {
+ // WM_CHAR message!
+ // Let's filter the ALT keypress and all other acceleration keys!
+ return (MRESULT) FALSE;
+ }
+ }
+ break; // Default processing (pass to parent until frame control)
+ }
+
+ case WM_PAINT: // Window redraw!
+#ifdef DEBUG_BUILD
+ printf("WM_PAINT (0x%x)\n", hwnd); fflush(stdout);
+#endif
+ ps = WinBeginPaint(hwnd,0,&rcl);
+ pVideo = FSLib_GetUserParm(hwnd);
+ if (pVideo)
+ {
+ if (!pVideo->hidden->pSDLSurface)
+ {
+ RECTL rclRect;
+ // So, don't blit now!
+#ifdef DEBUG_BUILD
+ printf("WM_PAINT : Skipping blit while resizing (Pre!)!\n"); fflush(stdout);
+#endif
+ WinQueryWindowRect(hwnd, &rclRect);
+ // Fill with black
+ WinFillRect(ps, &rclRect, CLR_BLACK);
+ } else
+ {
+ if (DosRequestMutexSem(pVideo->hidden->hmtxUseSrcBuffer, 1000)==NO_ERROR)
+ {
+ int iTop, iLeft, iWidth, iHeight;
+ int iXScaleError, iYScaleError;
+ int iXScaleError2, iYScaleError2;
+ SWP swp;
+
+ // Re-blit the modified area!
+ // For this, we have to calculate the points, scaled!
+ WinQueryWindowPos(hwnd, &swp);
+#ifdef DEBUG_BUILD
+ printf("WM_PAINT : WinSize: %d %d, BufSize: %d %d\n",
+ swp.cx,
+ swp.cy,
+ pVideo->hidden->SrcBufferDesc.uiXResolution,
+ pVideo->hidden->SrcBufferDesc.uiYResolution
+ );
+ fflush(stdout);
+#endif
+
+#ifndef RESIZE_EVEN_IF_RESIZABLE
+ // But only blit if the window is not resizable, or if
+ // the window is resizable and the source buffer size is the
+ // same as the destination buffer size!
+ if ((!pVideo->hidden->pSDLSurface) ||
+ ((pVideo->hidden->pSDLSurface) &&
+ (pVideo->hidden->pSDLSurface->flags & SDL_RESIZABLE) &&
+ ((swp.cx != pVideo->hidden->SrcBufferDesc.uiXResolution) ||
+ (swp.cy != pVideo->hidden->SrcBufferDesc.uiYResolution)
+ ) &&
+ (!FSLib_QueryFSMode(hwnd))
+ )
+ )
+ {
+ RECTL rclRect;
+ // Resizable surface and in resizing!
+ // So, don't blit now!
+#ifdef DEBUG_BUILD
+ printf("WM_PAINT : Skipping blit while resizing!\n"); fflush(stdout);
+#endif
+ WinQueryWindowRect(hwnd, &rclRect);
+ // Fill with black
+ WinFillRect(ps, &rclRect, CLR_BLACK);
+ } else
+#endif
+ {
+
+ iXScaleError = (pVideo->hidden->SrcBufferDesc.uiXResolution-1) / swp.cx;
+ iYScaleError = (pVideo->hidden->SrcBufferDesc.uiYResolution-1) / swp.cy;
+ if (iXScaleError<0) iXScaleError = 0;
+ if (iYScaleError<0) iYScaleError = 0;
+ iXScaleError2 = (swp.cx-1)/(pVideo->hidden->SrcBufferDesc.uiXResolution);
+ iYScaleError2 = (swp.cy-1)/(pVideo->hidden->SrcBufferDesc.uiYResolution);
+ if (iXScaleError2<0) iXScaleError2 = 0;
+ if (iYScaleError2<0) iYScaleError2 = 0;
+
+ iTop = (swp.cy - rcl.yTop) * pVideo->hidden->SrcBufferDesc.uiYResolution / swp.cy - iYScaleError;
+ iLeft = rcl.xLeft * pVideo->hidden->SrcBufferDesc.uiXResolution / swp.cx - iXScaleError;
+ iWidth = ((rcl.xRight-rcl.xLeft) * pVideo->hidden->SrcBufferDesc.uiXResolution + swp.cx-1)
+ / swp.cx + 2*iXScaleError;
+ iHeight = ((rcl.yTop-rcl.yBottom) * pVideo->hidden->SrcBufferDesc.uiYResolution + swp.cy-1)
+ / swp.cy + 2*iYScaleError;
+
+ iWidth+=iXScaleError2;
+ iHeight+=iYScaleError2;
+
+ if (iTop<0) iTop = 0;
+ if (iLeft<0) iLeft = 0;
+ if (iTop+iHeight>pVideo->hidden->SrcBufferDesc.uiYResolution) iHeight = pVideo->hidden->SrcBufferDesc.uiYResolution-iTop;
+ if (iLeft+iWidth>pVideo->hidden->SrcBufferDesc.uiXResolution) iWidth = pVideo->hidden->SrcBufferDesc.uiXResolution-iLeft;
+
+#ifdef DEBUG_BUILD
+ printf("WM_PAINT : BitBlt: %d %d -> %d %d (Buf %d x %d)\n",
+ iTop, iLeft, iWidth, iHeight,
+ pVideo->hidden->SrcBufferDesc.uiXResolution,
+ pVideo->hidden->SrcBufferDesc.uiYResolution
+ );
+ fflush(stdout);
+#endif
+
+ FSLIB_BITBLT(hwnd, pVideo->hidden->pchSrcBuffer, iTop, iLeft, iWidth, iHeight);
+ }
+
+ DosReleaseMutexSem(pVideo->hidden->hmtxUseSrcBuffer);
+ }
+ }
+ }
+#ifdef DEBUG_BUILD
+ else
+ {
+ printf("WM_PAINT : No pVideo!\n"); fflush(stdout);
+ }
+#endif
+ WinEndPaint(ps);
+#ifdef DEBUG_BUILD
+ printf("WM_PAINT : Done.\n");
+ fflush(stdout);
+#endif
+ return 0;
+
+ case WM_SIZE:
+ {
+#ifdef DEBUG_BUILD
+ printf("WM_SIZE : (%d %d)\n",
+ SHORT1FROMMP(mp2), SHORT2FROMMP(mp2)); fflush(stdout);
+#endif
+ iWindowSizeX = SHORT1FROMMP(mp2);
+ iWindowSizeY = SHORT2FROMMP(mp2);
+ bWindowResized = 1;
+
+ // Make sure the window will be redrawn
+ WinInvalidateRegion(hwnd, NULL, TRUE);
+ }
+ break;
+
+ case WM_FSLIBNOTIFICATION:
+#ifdef DEBUG_BUILD
+ printf("WM_FSLIBNOTIFICATION\n"); fflush(stdout);
+#endif
+ if ((int)mp1 == FSLN_TOGGLEFSMODE)
+ {
+ // FS mode changed, reblit image!
+ pVideo = FSLib_GetUserParm(hwnd);
+ if (pVideo)
+ {
+ if (!pVideo->hidden->pSDLSurface)
+ {
+ // Resizable surface and in resizing!
+ // So, don't blit now!
+#ifdef DEBUG_BUILD
+ printf("WM_FSLIBNOTIFICATION : Can not blit if there is no surface, doing nothing.\n"); fflush(stdout);
+#endif
+ } else
+ {
+ if (DosRequestMutexSem(pVideo->hidden->hmtxUseSrcBuffer, 1000)==NO_ERROR)
+ {
+ if (pVideo->hidden->pSDLSurface)
+ {
+#ifndef RESIZE_EVEN_IF_RESIZABLE
+ SWP swp;
+
+ // But only blit if the window is not resizable, or if
+ // the window is resizable and the source buffer size is the
+ // same as the destination buffer size!
+ WinQueryWindowPos(hwnd, &swp);
+ if ((!pVideo->hidden->pSDLSurface) ||
+ (
+ (pVideo->hidden->pSDLSurface) &&
+ (pVideo->hidden->pSDLSurface->flags & SDL_RESIZABLE) &&
+ ((swp.cx != pVideo->hidden->SrcBufferDesc.uiXResolution) ||
+ (swp.cy != pVideo->hidden->SrcBufferDesc.uiYResolution)
+ ) &&
+ (!FSLib_QueryFSMode(hwnd))
+ )
+ )
+ {
+ // Resizable surface and in resizing!
+ // So, don't blit now!
+#ifdef DEBUG_BUILD
+ printf("WM_FSLIBNOTIFICATION : Cannot blit while resizing, doing nothing.\n"); fflush(stdout);
+#endif
+ } else
+#endif
+ {
+#ifdef DEBUG_BUILD
+ printf("WM_FSLIBNOTIFICATION : Blitting!\n"); fflush(stdout);
+#endif
+ FSLIB_BITBLT(hwnd, pVideo->hidden->pchSrcBuffer,
+ 0, 0,
+ pVideo->hidden->SrcBufferDesc.uiXResolution,
+ pVideo->hidden->SrcBufferDesc.uiYResolution);
+ }
+ }
+#ifdef DEBUG_BUILD
+ else
+ printf("WM_FSLIBNOTIFICATION : No public surface!\n"); fflush(stdout);
+#endif
+
+ DosReleaseMutexSem(pVideo->hidden->hmtxUseSrcBuffer);
+ }
+ }
+ }
+ }
+ return (MPARAM) 1;
+
+ case WM_ACTIVATE:
+#ifdef DEBUG_BUILD
+ printf("WM_ACTIVATE\n"); fflush(stdout);
+#endif
+
+ pVideo = FSLib_GetUserParm(hwnd);
+ if (pVideo)
+ {
+ pVideo->hidden->fInFocus = (int) mp1;
+ if (pVideo->hidden->fInFocus)
+ {
+ // Went into focus
+ if ((pVideo->hidden->iMouseVisible) && (!bMouseCaptured))
+ WinSetPointer(HWND_DESKTOP, WinQuerySysPointer(HWND_DESKTOP, SPTR_ARROW, FALSE));
+ else
+ WinSetPointer(HWND_DESKTOP, NULL);
+
+ if (bMouseCapturable)
+ {
+ // Re-capture the mouse, if we captured it before!
+ WinSetCapture(HWND_DESKTOP, hwnd);
+ bMouseCaptured = 1;
+ {
+ SWP swpClient;
+ POINTL ptl;
+ // Center the mouse to the middle of the window!
+ WinQueryWindowPos(pVideo->hidden->hwndClient, &swpClient);
+ ptl.x = 0; ptl.y = 0;
+ WinMapWindowPoints(pVideo->hidden->hwndClient, HWND_DESKTOP, &ptl, 1);
+ pVideo->hidden->iSkipWMMOUSEMOVE++; /* Don't take next WM_MOUSEMOVE into account! */
+ WinSetPointerPos(HWND_DESKTOP,
+ ptl.x + swpClient.cx/2,
+ ptl.y + swpClient.cy/2);
+ }
+ }
+ } else
+ {
+ // Went out of focus
+ WinSetPointer(HWND_DESKTOP, WinQuerySysPointer(HWND_DESKTOP, SPTR_ARROW, FALSE));
+
+ if (bMouseCaptured)
+ {
+ // Release the mouse
+ WinSetCapture(HWND_DESKTOP, hwnd);
+ bMouseCaptured = 0;
+ }
+ }
+ }
+#ifdef DEBUG_BUILD
+ printf("WM_ACTIVATE done\n"); fflush(stdout);
+#endif
+
+ break;
+
+ case WM_BUTTON1DOWN:
+#ifdef DEBUG_BUILD
+ printf("WM_BUTTON1DOWN\n"); fflush(stdout);
+#endif
+
+ pVideo = FSLib_GetUserParm(hwnd);
+ if (pVideo)
+ {
+ SDL_PrivateMouseButton(SDL_PRESSED,
+ SDL_BUTTON_LEFT,
+ 0, 0); // Don't report mouse movement!
+
+ if (bMouseCapturable)
+ {
+ // We should capture the mouse!
+ if (!bMouseCaptured)
+ {
+ WinSetCapture(HWND_DESKTOP, hwnd);
+ WinSetPointer(HWND_DESKTOP, NULL);
+ bMouseCaptured = 1;
+ {
+ SWP swpClient;
+ POINTL ptl;
+ // Center the mouse to the middle of the window!
+ WinQueryWindowPos(pVideo->hidden->hwndClient, &swpClient);
+ ptl.x = 0; ptl.y = 0;
+ WinMapWindowPoints(pVideo->hidden->hwndClient, HWND_DESKTOP, &ptl, 1);
+ pVideo->hidden->iSkipWMMOUSEMOVE++; /* Don't take next WM_MOUSEMOVE into account! */
+ WinSetPointerPos(HWND_DESKTOP,
+ ptl.x + swpClient.cx/2,
+ ptl.y + swpClient.cy/2);
+ }
+ }
+ }
+ }
+ break;
+ case WM_BUTTON1UP:
+#ifdef DEBUG_BUILD
+ printf("WM_BUTTON1UP\n"); fflush(stdout);
+#endif
+ SDL_PrivateMouseButton(SDL_RELEASED,
+ SDL_BUTTON_LEFT,
+ 0, 0); // Don't report mouse movement!
+ break;
+ case WM_BUTTON2DOWN:
+#ifdef DEBUG_BUILD
+ printf("WM_BUTTON2DOWN\n"); fflush(stdout);
+#endif
+
+ pVideo = FSLib_GetUserParm(hwnd);
+ if (pVideo)
+ {
+ SDL_PrivateMouseButton(SDL_PRESSED,
+ SDL_BUTTON_RIGHT,
+ 0, 0); // Don't report mouse movement!
+
+ if (bMouseCapturable)
+ {
+ // We should capture the mouse!
+ if (!bMouseCaptured)
+ {
+ WinSetCapture(HWND_DESKTOP, hwnd);
+ WinSetPointer(HWND_DESKTOP, NULL);
+ bMouseCaptured = 1;
+ {
+ SWP swpClient;
+ POINTL ptl;
+ // Center the mouse to the middle of the window!
+ WinQueryWindowPos(pVideo->hidden->hwndClient, &swpClient);
+ ptl.x = 0; ptl.y = 0;
+ WinMapWindowPoints(pVideo->hidden->hwndClient, HWND_DESKTOP, &ptl, 1);
+ pVideo->hidden->iSkipWMMOUSEMOVE++; /* Don't take next WM_MOUSEMOVE into account! */
+ WinSetPointerPos(HWND_DESKTOP,
+ ptl.x + swpClient.cx/2,
+ ptl.y + swpClient.cy/2);
+ }
+ }
+ }
+
+ }
+ break;
+ case WM_BUTTON2UP:
+#ifdef DEBUG_BUILD
+ printf("WM_BUTTON2UP\n"); fflush(stdout);
+#endif
+ SDL_PrivateMouseButton(SDL_RELEASED,
+ SDL_BUTTON_RIGHT,
+ 0, 0); // Don't report mouse movement!
+ break;
+ case WM_BUTTON3DOWN:
+#ifdef DEBUG_BUILD
+ printf("WM_BUTTON3DOWN\n"); fflush(stdout);
+#endif
+
+ pVideo = FSLib_GetUserParm(hwnd);
+ if (pVideo)
+ {
+ SDL_PrivateMouseButton(SDL_PRESSED,
+ SDL_BUTTON_MIDDLE,
+ 0, 0); // Don't report mouse movement!
+
+ if (bMouseCapturable)
+ {
+ // We should capture the mouse!
+ if (!bMouseCaptured)
+ {
+ WinSetCapture(HWND_DESKTOP, hwnd);
+ WinSetPointer(HWND_DESKTOP, NULL);
+ bMouseCaptured = 1;
+ {
+ SWP swpClient;
+ POINTL ptl;
+ // Center the mouse to the middle of the window!
+ WinQueryWindowPos(pVideo->hidden->hwndClient, &swpClient);
+ ptl.x = 0; ptl.y = 0;
+ WinMapWindowPoints(pVideo->hidden->hwndClient, HWND_DESKTOP, &ptl, 1);
+ pVideo->hidden->iSkipWMMOUSEMOVE++; /* Don't take next WM_MOUSEMOVE into account! */
+ WinSetPointerPos(HWND_DESKTOP,
+ ptl.x + swpClient.cx/2,
+ ptl.y + swpClient.cy/2);
+ }
+ }
+ }
+ }
+ break;
+ case WM_BUTTON3UP:
+#ifdef DEBUG_BUILD
+ printf("WM_BUTTON3UP\n"); fflush(stdout);
+#endif
+ SDL_PrivateMouseButton(SDL_RELEASED,
+ SDL_BUTTON_MIDDLE,
+ 0, 0); // Don't report mouse movement!
+ break;
+ case WM_MOUSEMOVE:
+#ifdef DEBUG_BUILD
+// printf("WM_MOUSEMOVE\n"); fflush(stdout);
+#endif
+
+ pVideo = FSLib_GetUserParm(hwnd);
+ if (pVideo)
+ {
+ if (pVideo->hidden->iSkipWMMOUSEMOVE)
+ {
+ pVideo->hidden->iSkipWMMOUSEMOVE--;
+ } else
+ {
+ POINTS *ppts = (POINTS *) (&mp1);
+ POINTL ptl;
+
+ if (bMouseCaptured)
+ {
+ SWP swpClient;
+
+ WinQueryWindowPos(pVideo->hidden->hwndClient, &swpClient);
+
+ // Send relative mouse position, and re-center the mouse
+ // Reposition the mouse to the center of the screen/window
+ SDL_PrivateMouseMotion(0, // Buttons not changed
+ 1, // Relative position
+ ppts->x - (swpClient.cx/2),
+ (swpClient.cy/2) - ppts->y);
+
+ ptl.x = 0; ptl.y = 0;
+ WinMapWindowPoints(pVideo->hidden->hwndClient, HWND_DESKTOP, &ptl, 1);
+ pVideo->hidden->iSkipWMMOUSEMOVE++; /* Don't take next WM_MOUSEMOVE into account! */
+ // Center the mouse to the middle of the window!
+ WinSetPointerPos(HWND_DESKTOP,
+ ptl.x + swpClient.cx/2,
+ ptl.y + swpClient.cy/2);
+ } else
+ {
+ CONVERTMOUSEPOSITION();
+
+ // Send absolute mouse position
+ SDL_PrivateMouseMotion(0, // Buttons not changed
+ 0, // Absolute position
+ ppts->x,
+ ppts->y);
+ }
+ }
+ if ((pVideo->hidden->iMouseVisible) && (!bMouseCaptured))
+ {
+#ifdef DEBUG_BUILD
+// printf("WM_MOUSEMOVE : ptr = %p\n", hptrGlobalPointer); fflush(stdout);
+#endif
+
+ if (hptrGlobalPointer)
+ WinSetPointer(HWND_DESKTOP, hptrGlobalPointer);
+ else
+ WinSetPointer(HWND_DESKTOP, WinQuerySysPointer(HWND_DESKTOP, SPTR_ARROW, FALSE));
+ }
+ else
+ {
+ WinSetPointer(HWND_DESKTOP, NULL);
+ }
+ }
+#ifdef DEBUG_BUILD
+// printf("WM_MOUSEMOVE done\n"); fflush(stdout);
+#endif
+
+ return (MRESULT) FALSE;
+ case WM_CLOSE: // Window close
+#ifdef DEBUG_BUILD
+ printf("WM_CLOSE\n"); fflush(stdout);
+#endif
+
+ pVideo = FSLib_GetUserParm(hwnd);
+ if (pVideo)
+ {
+ // Send Quit message to the SDL application!
+ SDL_PrivateQuit();
+ return 0;
+ }
+ break;
+
+#ifdef BITBLT_IN_WINMESSAGEPROC
+ case WM_UPDATERECTSREQUEST:
+ pVideo = FSLib_GetUserParm(hwnd);
+ if ((pVideo) && (pVideo->hidden->pSDLSurface))
+ {
+ if (DosRequestMutexSem(pVideo->hidden->hmtxUseSrcBuffer, SEM_INDEFINITE_WAIT)==NO_ERROR)
+ {
+ int numrects;
+ SDL_Rect *rects;
+ int i;
+ SWP swp;
+
+ numrects = (int) mp1;
+ rects = (SDL_Rect *) mp2;
+
+ WinQueryWindowPos(hwnd, &swp);
+#ifndef RESIZE_EVEN_IF_RESIZABLE
+ if ((!pVideo->hidden->pSDLSurface) ||
+ (
+ (pVideo->hidden->pSDLSurface) &&
+ (pVideo->hidden->pSDLSurface->flags & SDL_RESIZABLE) &&
+ ((swp.cx != pVideo->hidden->SrcBufferDesc.uiXResolution) ||
+ (swp.cy != pVideo->hidden->SrcBufferDesc.uiYResolution)
+ ) &&
+ (!FSLib_QueryFSMode(hwnd))
+ )
+ )
+ {
+ // Resizable surface and in resizing!
+ // So, don't blit now!
+#ifdef DEBUG_BUILD
+ printf("[WM_UPDATERECTSREQUEST] : Skipping blit while resizing!\n"); fflush(stdout);
+#endif
+ } else
+#endif
+ {
+#ifdef DEBUG_BUILD
+ printf("[WM_UPDATERECTSREQUEST] : Blitting!\n"); fflush(stdout);
+#endif
+
+ // Blit the changed areas
+ for (i=0; i<numrects; i++)
+ FSLIB_BITBLT(hwnd, pVideo->hidden->pchSrcBuffer,
+ rects[i].y, rects[i].x, rects[i].w, rects[i].h);
+ }
+ DosReleaseMutexSem(pVideo->hidden->hmtxUseSrcBuffer);
+ }
+ }
+ return 0;
+#endif
+
+ default:
+#ifdef DEBUG_BUILD
+ printf("Unhandled: %x\n", msg); fflush(stdout);
+#endif
+
+ break;
+ }
+ // Run the default window procedure for unhandled stuffs
+ return WinDefWindowProc(hwnd, msg, mp1, mp2);
+}
+
+/////////////////////////////////////////////////////////////////////
+//
+// FrameWndProc
+//
+// This is the message processing window procedure for the
+// frame window of SDLWindowClass.
+//
+/////////////////////////////////////////////////////////////////////
+static MRESULT EXPENTRY FrameWndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
+{
+ PFNWP pOldFrameProc;
+ MRESULT result;
+ PTRACKINFO ti;
+ int cx, cy, ncx, ncy;
+ RECTL rclTemp;
+ PSWP pswpTemp;
+
+ SDL_VideoDevice *pVideo = NULL;
+
+ pVideo = (SDL_VideoDevice *) WinQueryWindowULong(hwnd, QWL_USER);
+
+ pOldFrameProc = pVideo->hidden->pfnOldFrameProc;
+
+ if ((pVideo->hidden->bProportionalResize) &&
+ (msg==WM_ADJUSTWINDOWPOS) &&
+ (!FSLib_QueryFSMode(pVideo->hidden->hwndClient))
+ )
+ {
+ pswpTemp = (PSWP) mp1;
+
+ /* Resizing? */
+ if (pswpTemp->fl & SWP_SIZE)
+ {
+ /* Calculate client size */
+ rclTemp.xLeft = pswpTemp->x;
+ rclTemp.xRight = pswpTemp->x + pswpTemp->cx;
+ rclTemp.yBottom = pswpTemp->y;
+ rclTemp.yTop = pswpTemp->y + pswpTemp->cy;
+ WinCalcFrameRect(hwnd, &rclTemp, TRUE);
+
+ ncx = cx = rclTemp.xRight - rclTemp.xLeft;
+ ncy = cy = rclTemp.yTop - rclTemp.yBottom;
+
+ /* Calculate new size to keep it proportional */
+
+ if ((pVideo->hidden->ulResizingFlag & TF_LEFT) || (pVideo->hidden->ulResizingFlag & TF_RIGHT))
+ {
+ /* The window is resized horizontally */
+ ncy = pVideo->hidden->SrcBufferDesc.uiYResolution * cx / pVideo->hidden->SrcBufferDesc.uiXResolution;
+ } else
+ if ((pVideo->hidden->ulResizingFlag & TF_TOP) || (pVideo->hidden->ulResizingFlag & TF_BOTTOM))
+ {
+ /* The window is resized vertically */
+ ncx = pVideo->hidden->SrcBufferDesc.uiXResolution * cy / pVideo->hidden->SrcBufferDesc.uiYResolution;
+ }
+
+ /* Calculate back frame coordinates */
+ rclTemp.xLeft = pswpTemp->x;
+ rclTemp.xRight = pswpTemp->x + ncx;
+ rclTemp.yBottom = pswpTemp->y;
+ rclTemp.yTop = pswpTemp->y + ncy;
+ WinCalcFrameRect(hwnd, &rclTemp, FALSE);
+
+ /* Store new size/position info */
+ pswpTemp->cx = rclTemp.xRight - rclTemp.xLeft;
+
+ if (!(pVideo->hidden->ulResizingFlag & TF_TOP))
+ {
+ pswpTemp->y = pswpTemp->y + pswpTemp->cy - (rclTemp.yTop - rclTemp.yBottom);
+ pswpTemp->cy = rclTemp.yTop - rclTemp.yBottom;
+ } else
+ {
+ pswpTemp->cy = rclTemp.yTop - rclTemp.yBottom;
+ }
+ }
+ }
+
+ result = (*pOldFrameProc)(hwnd, msg, mp1, mp2);
+
+ if ((pVideo->hidden->bProportionalResize) && (msg==WM_QUERYTRACKINFO))
+ {
+ ti = (PTRACKINFO) mp2;
+
+ /* Store the direction of resizing */
+ if ((ti->fs & TF_LEFT) || (ti->fs & TF_RIGHT) ||
+ (ti->fs & TF_TOP) || (ti->fs & TF_BOTTOM))
+ pVideo->hidden->ulResizingFlag = ti->fs;
+ }
+
+ return result;
+}
+
+/////////////////////////////////////////////////////////////////////
+//
+// PMThreadFunc
+//
+// This function implements the PM-Thread, which initializes the
+// application window itself, the DIVE, and start message processing.
+//
+/////////////////////////////////////////////////////////////////////
+int iNumOfPMThreadInstances = 0; // Global!
+static void PMThreadFunc(void *pParm)
+{
+ SDL_VideoDevice *pVideo = pParm;
+ HAB hab;
+ HMQ hmq;
+ QMSG msg;
+ ULONG fcf;
+
+#ifdef DEBUG_BUILD
+ printf("[PMThreadFunc] : Starting\n"); fflush(stdout);
+#endif
+
+ iNumOfPMThreadInstances++;
+
+ // Initialize PM, create a message queue.
+
+ hab=WinInitialize(0);
+ hmq=WinCreateMsgQueue(hab,0);
+ if (hmq==0)
+ {
+#ifdef DEBUG_BUILD
+ printf("[PMThreadFunc] : Could not create message queue!\n");
+ printf(" It might be that the application using SDL is not a PM app!\n");
+ fflush(stdout);
+#endif
+ pVideo->hidden->iPMThreadStatus = 2;
+ } else
+ {
+ int rc;
+ RECTL rectl;
+
+ fcf = ulFCFToUse; // Get from global setting
+
+#ifdef DEBUG_BUILD
+ printf("[PMThreadFunc] : FSLib_CreateWindow()!\n");
+ fflush(stdout);
+#endif
+
+ rc = FSLib_CreateWindow(HWND_DESKTOP, 0, &fcf,
+ "SDL Application",
+ NULLHANDLE, 0,
+ &(pVideo->hidden->SrcBufferDesc),
+ WndProc,
+ &(pVideo->hidden->hwndClient),
+ &(pVideo->hidden->hwndFrame));
+
+#ifdef DEBUG_BUILD
+ printf("[PMThreadFunc] : FSLib_CreateWindow() rc = %d\n", rc);
+ fflush(stdout);
+#endif
+
+ if (!rc)
+ {
+#ifdef DEBUG_BUILD
+ printf("[PMThreadFunc] : Could not create FSLib window!\n");
+ fflush(stdout);
+#endif
+ pVideo->hidden->iPMThreadStatus = 3;
+ } else
+ {
+#ifdef DEBUG_BUILD
+ printf("[PMThreadFunc] : FSLib_AddUserParm()!\n");
+ fflush(stdout);
+#endif
+
+ // Store pVideo pointer in window data for client window, so
+ // it will know the instance to which it belongs to.
+ FSLib_AddUserParm(pVideo->hidden->hwndClient, pVideo);
+
+ // Now set default image width height and fourcc!
+#ifdef DEBUG_BUILD
+ printf("[PMThreadFunc] : SetWindowPos()!\n");
+ fflush(stdout);
+#endif
+
+ // Set the position and size of the main window,
+ // and make it visible!
+ // Calculate frame window size from client window size
+ rectl.xLeft = 0;
+ rectl.yBottom = 0;
+ rectl.xRight = pVideo->hidden->SrcBufferDesc.uiXResolution; // Noninclusive
+ rectl.yTop = pVideo->hidden->SrcBufferDesc.uiYResolution; // Noninclusive
+ WinCalcFrameRect(pVideo->hidden->hwndFrame, &rectl, FALSE);
+
+ SetAccessableWindowPos(pVideo->hidden->hwndFrame,
+ HWND_TOP,
+ (WinQuerySysValue (HWND_DESKTOP, SV_CXSCREEN) - (rectl.xRight-rectl.xLeft)) / 2,
+ (WinQuerySysValue (HWND_DESKTOP, SV_CYSCREEN) - (rectl.yTop-rectl.yBottom)) / 2,
+ (rectl.xRight-rectl.xLeft),
+ (rectl.yTop-rectl.yBottom),
+ SWP_SIZE | SWP_ACTIVATE | SWP_SHOW | SWP_MOVE);
+
+ // Subclass frame procedure and store old window proc address
+ pVideo->hidden->pfnOldFrameProc =
+ WinSubclassWindow(pVideo->hidden->hwndFrame, FrameWndProc);
+ WinSetWindowULong(pVideo->hidden->hwndFrame, QWL_USER, (ULONG) pVideo);
+
+#ifdef DEBUG_BUILD
+ printf("[PMThreadFunc] : Entering message loop\n"); fflush(stdout);
+#endif
+ pVideo->hidden->iPMThreadStatus = 1;
+
+ while (WinGetMsg(hab, (PQMSG)&msg, 0, 0, 0))
+ WinDispatchMsg(hab, (PQMSG) &msg);
+
+#ifdef DEBUG_BUILD
+ printf("[PMThreadFunc] : Leaving message loop\n"); fflush(stdout);
+#endif
+ // We should release the captured the mouse!
+ if (bMouseCaptured)
+ {
+ WinSetCapture(HWND_DESKTOP, NULLHANDLE);
+ bMouseCaptured = 0;
+ }
+ // Destroy our window
+ WinDestroyWindow(pVideo->hidden->hwndFrame); pVideo->hidden->hwndFrame=NULL;
+ // Show pointer to make sure it will not be left hidden.
+ WinSetPointer(HWND_DESKTOP, WinQuerySysPointer(HWND_DESKTOP, SPTR_ARROW, FALSE));
+ WinShowPointer(HWND_DESKTOP, TRUE);
+ }
+ // Uninitialize PM
+ WinDestroyMsgQueue(hmq);
+ // All done!
+ pVideo->hidden->iPMThreadStatus = 0;
+ }
+ WinTerminate(hab);
+ /* Commented out, should not be needed anymore, because we send it
+ from WM_CLOSE.
+ // Notify SDL that it should really die now...
+ SDL_PrivateQuit(); SDL_PrivateQuit(); SDL_PrivateQuit(); //... :))
+ */
+#ifdef DEBUG_BUILD
+ printf("[PMThreadFunc] : End, status is %d!\n", pVideo->hidden->iPMThreadStatus); fflush(stdout);
+#endif
+
+ iNumOfPMThreadInstances--;
+
+ // HACK to prevent zombie and hanging SDL applications, which does not take
+ // care of closing the window for some reason:
+ // There are some apps which do not process messages, so do a lot of things
+ // without noticing that the application should close. To close these,
+ // I've thought about the following:
+ // If the window is closed (the execution came here), I wait a bit to
+ // give time to the app to finish its execution. If it does not, I kill it
+ // using DosExit(). Brute force, but should work.
+ if (pVideo->hidden->iPMThreadStatus==0)
+ {
+ DosSleep(5000); // Wait 5 secs
+ // If a new PM thread has been spawned (reinitializing video mode), then all right.
+ // Otherwise, we have a problem, the app doesn't want to stop. Kill!
+ if (iNumOfPMThreadInstances==0)
+ {
+#ifdef DEBUG_BUILD
+ printf("[PMThreadFunc] : It seems that the application haven't terminated itself\n"); fflush(stdout);
+ printf("[PMThreadFunc] : in the last 5 seconds, so we go berserk.\n"); fflush(stdout);
+ printf("[PMThreadFunc] : Brute force mode. :) Killing process! Dieeeee...\n"); fflush(stdout);
+#endif
+ DosExit(EXIT_PROCESS, -1);
+ }
+ }
+ _endthread();
+}
+
+struct WMcursor
+{
+ HBITMAP hbm;
+ HPOINTER hptr;
+ char *pchData;
+};
+
+/* Free a window manager cursor */
+void os2fslib_FreeWMCursor(_THIS, WMcursor *cursor)
+{
+ if (cursor)
+ {
+ GpiDeleteBitmap(cursor->hbm);
+ WinDestroyPointer(cursor->hptr);
+ SDL_free(cursor->pchData);
+ SDL_free(cursor);
+ }
+}
+
+/* Local functions to convert the SDL cursor mask into OS/2 format */
+static void memnot(Uint8 *dst, Uint8 *src, int len)
+{
+ while ( len-- > 0 )
+ *dst++ = ~*src++;
+}
+static void memxor(Uint8 *dst, Uint8 *src1, Uint8 *src2, int len)
+{
+ while ( len-- > 0 )
+ *dst++ = (*src1++)^(*src2++);
+}
+
+/* Create a black/white window manager cursor */
+WMcursor *os2fslib_CreateWMCursor_Win(_THIS, Uint8 *data, Uint8 *mask,
+ int w, int h, int hot_x, int hot_y)
+{
+ HPOINTER hptr;
+ HBITMAP hbm;
+ BITMAPINFOHEADER bmih;
+ BMPINFO bmi;
+ HPS hps;
+ char *pchTemp;
+ char *xptr, *aptr;
+ int maxx, maxy;
+ int i, run, pad;
+ WMcursor *pResult;
+
+ maxx = WinQuerySysValue(HWND_DESKTOP, SV_CXPOINTER);
+ maxy = WinQuerySysValue(HWND_DESKTOP, SV_CYPOINTER);
+
+ // Check for max size!
+ if ((w>maxx) || (h>maxy))
+ return (WMcursor *) NULL;
+
+ pResult = (WMcursor *) SDL_malloc(sizeof(WMcursor));
+ if (!pResult) return (WMcursor *) NULL;
+
+ pchTemp = (char *) SDL_malloc((maxx + 7)/8 * maxy*2);
+ if (!pchTemp)
+ {
+ SDL_free(pResult);
+ return (WMcursor *) NULL;
+ }
+
+ SDL_memset(pchTemp, 0, (maxx + 7)/8 * maxy*2);
+
+ hps = WinGetPS(_this->hidden->hwndClient);
+
+ bmi.cbFix = sizeof(BITMAPINFOHEADER);
+ bmi.cx = maxx;
+ bmi.cy = 2*maxy;
+ bmi.cPlanes = 1;
+ bmi.cBitCount = 1;
+ bmi.argbColor[0].bBlue = 0x00;
+ bmi.argbColor[0].bGreen = 0x00;
+ bmi.argbColor[0].bRed = 0x00;
+ bmi.argbColor[1].bBlue = 0x00;
+ bmi.argbColor[1].bGreen = 0x00;
+ bmi.argbColor[1].bRed = 0xff;
+
+ SDL_memset(&bmih, 0, sizeof(BITMAPINFOHEADER));
+ bmih.cbFix = sizeof(BITMAPINFOHEADER);
+ bmih.cx = maxx;
+ bmih.cy = 2*maxy;
+ bmih.cPlanes = 1;
+ bmih.cBitCount = 1;
+
+ run = (w+7)/8;
+ pad = (maxx+7)/8 - run;
+
+ for (i=0; i<h; i++)
+ {
+ xptr = pchTemp + (maxx+7)/8 * (maxy-1-i);
+ aptr = pchTemp + (maxx+7)/8 * (maxy+maxy-1-i);
+ memxor(xptr, data, mask, run);
+ xptr += run;
+ data += run;
+ memnot(aptr, mask, run);
+ mask += run;
+ aptr += run;
+ SDL_memset(xptr, 0, pad);
+ xptr += pad;
+ SDL_memset(aptr, ~0, pad);
+ aptr += pad;
+ }
+ pad += run;
+ for (i=h ; i<maxy; i++ )
+ {
+ xptr = pchTemp + (maxx+7)/8 * (maxy-1-i);
+ aptr = pchTemp + (maxx+7)/8 * (maxy+maxy-1-i);
+
+ SDL_memset(xptr, 0, (maxx+7)/8);
+ xptr += (maxx+7)/8;
+ SDL_memset(aptr, ~0, (maxx+7)/8);
+ aptr += (maxx+7)/8;
+ }
+
+ hbm = GpiCreateBitmap(hps, (PBITMAPINFOHEADER2)&bmih, CBM_INIT, (PBYTE) pchTemp, (PBITMAPINFO2)&bmi);
+ hptr = WinCreatePointer(HWND_DESKTOP, hbm, TRUE, hot_x, maxy - hot_y - 1);
+
+#ifdef DEBUG_BUILD
+ printf("HotSpot : %d ; %d\n", hot_x, hot_y);
+ printf("HPS returned : %x\n", (ULONG)hps);
+ printf("HBITMAP returned : %x\n", (ULONG)hbm);
+ printf("HPOINTER returned: %x\n", (ULONG)hptr);
+#endif
+
+ WinReleasePS(hps);
+
+#ifdef DEBUG_BUILD
+ printf("[CreateWMCursor] : ptr = %p\n", hptr); fflush(stdout);
+#endif
+
+ pResult->hptr = hptr;
+ pResult->hbm = hbm;
+ pResult->pchData = pchTemp;
+
+#ifdef DEBUG_BUILD
+ printf("[CreateWMCursor] : ptr = %p return.\n", hptr); fflush(stdout);
+#endif
+
+ return (WMcursor *) pResult;
+}
+
+WMcursor *os2fslib_CreateWMCursor_FS(_THIS, Uint8 *data, Uint8 *mask,
+ int w, int h, int hot_x, int hot_y)
+{
+#ifdef DEBUG_BUILD
+ printf("[CreateWMCursor_FS] : returning pointer NULL\n"); fflush(stdout);
+#endif
+
+ // In FS mode we'll use software cursor
+ return (WMcursor *) NULL;
+}
+
+/* Show the specified cursor, or hide if cursor is NULL */
+int os2fslib_ShowWMCursor(_THIS, WMcursor *cursor)
+{
+#ifdef DEBUG_BUILD
+ printf("[ShowWMCursor] : ptr = %p\n", cursor); fflush(stdout);
+#endif
+
+ if (cursor)
+ {
+ WinSetPointer(HWND_DESKTOP, cursor->hptr);
+ hptrGlobalPointer = cursor->hptr;
+ _this->hidden->iMouseVisible = 1;
+ }
+ else
+ {
+ WinSetPointer(HWND_DESKTOP, FALSE);
+ hptrGlobalPointer = NULL;
+ _this->hidden->iMouseVisible = 0;
+ }
+
+#ifdef DEBUG_BUILD
+ printf("[ShowWMCursor] : ptr = %p, DONE\n", cursor); fflush(stdout);
+#endif
+
+ return 1;
+}
+
+/* Warp the window manager cursor to (x,y)
+ If NULL, a mouse motion event is posted internally.
+ */
+void os2fslib_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
+{
+ LONG lx, ly;
+ SWP swpClient;
+ POINTL ptlPoints;
+ WinQueryWindowPos(_this->hidden->hwndClient, &swpClient);
+ ptlPoints.x = swpClient.x;
+ ptlPoints.y = swpClient.y;
+ WinMapWindowPoints(_this->hidden->hwndFrame, HWND_DESKTOP, &ptlPoints, 1);
+ lx = ptlPoints.x + (x*swpClient.cx) / _this->hidden->SrcBufferDesc.uiXResolution;
+ ly = ptlPoints.y + swpClient.cy - ((y*swpClient.cy) / _this->hidden->SrcBufferDesc.uiYResolution) - 1;
+
+ SDL_PrivateMouseMotion(0, // Buttons not changed
+ 0, // Absolute position
+ x,
+ y);
+
+ WinSetPointerPos(HWND_DESKTOP, lx, ly);
+
+}
+
+/* If not NULL, this is called when a mouse motion event occurs */
+void os2fslib_MoveWMCursor(_THIS, int x, int y)
+{
+ /*
+ SDL_Rect rect;
+
+#ifdef DEBUG_BUILD
+ printf("[MoveWMCursor] : at %d ; %d\n", x, y); fflush(stdout);
+#endif
+
+ rect.x = x;
+ rect.y = y;
+ rect.w = 32;
+ rect.h = 32;
+ os2fslib_UpdateRects(_this, 1, &rect);
+ // TODO!
+ */
+}
+
+/* Determine whether the mouse should be in relative mode or not.
+ This function is called when the input grab state or cursor
+ visibility state changes.
+ If the cursor is not visible, and the input is grabbed, the
+ driver can place the mouse in relative mode, which may result
+ in higher accuracy sampling of the pointer motion.
+ */
+void os2fslib_CheckMouseMode(_THIS)
+{
+}
+
+static void os2fslib_PumpEvents(_THIS)
+{
+ // Notify SDL that if window has been resized!
+ if (
+ (_this->hidden->pSDLSurface) &&
+ (_this->hidden->pSDLSurface->flags & SDL_RESIZABLE) &&
+ (
+ (_this->hidden->SrcBufferDesc.uiXResolution!=iWindowSizeX) ||
+ (_this->hidden->SrcBufferDesc.uiYResolution!=iWindowSizeY)
+ ) &&
+ (iWindowSizeX>0) &&
+ (iWindowSizeY>0)
+ )
+ {
+ static time_t prev_time;
+ time_t curr_time;
+
+ curr_time = time(NULL);
+ if ((difftime(curr_time, prev_time)>=0.25) ||
+ (bWindowResized))
+ {
+ // Make sure we won't flood the event queue with resize events,
+ // only send them at 250 msecs!
+ // (or when the window is resized)
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_PumpEvents] : Calling PrivateResize (%d %d).\n",
+ iWindowSizeX, iWindowSizeY);
+ fflush(stdout);
+#endif
+ // Tell SDL the new size
+ SDL_PrivateResize(iWindowSizeX, iWindowSizeY);
+ prev_time = curr_time;
+ bWindowResized = 0;
+ }
+ }
+}
+
+/* We don't actually allow hardware surfaces other than the main one */
+static int os2fslib_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(-1);
+}
+static void os2fslib_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+/* We need to wait for vertical retrace on page flipped displays */
+static int os2fslib_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(0);
+}
+
+static void os2fslib_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+static int os2fslib_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ printf("[os2fslib_SetColors] : TODO!\n"); fflush(stdout);
+ // TODO: Implement paletted modes
+ return(1);
+}
+
+static void os2fslib_DestroyIcon(HWND hwndFrame)
+{
+ if (hptrCurrentIcon)
+ {
+ WinDestroyPointer(hptrCurrentIcon);
+ hptrCurrentIcon = NULL;
+
+ WinSendMsg(hwndFrame,
+ WM_SETICON,
+ NULL,
+ NULL);
+ }
+
+}
+
+/* Set the window icon image */
+void os2fslib_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask)
+{
+ HWND hwndFrame;
+ SDL_Surface *icon_rgb;
+ HPOINTER hptrIcon;
+ HBITMAP hbm;
+ BITMAPINFOHEADER bmih;
+ BMPINFO bmi;
+ HPS hps;
+ char *pchTemp;
+ char *pptr, *mptr, *dptr, *dmptr;
+ int maxx, maxy, w, h, x, y;
+ SDL_Rect bounds;
+
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_SetIcon] : Creating and setting new icon\n"); fflush(stdout);
+#endif
+
+ hwndFrame = WinQueryWindow(_this->hidden->hwndClient, QW_PARENT);
+
+ // Make sure the old icon resource will be free'd!
+ os2fslib_DestroyIcon(hwndFrame);
+
+ if ((!icon) || (!mask))
+ return;
+
+ w = icon->w;
+ h = icon->h;
+
+ maxx = WinQuerySysValue(HWND_DESKTOP, SV_CXICON);
+ maxy = WinQuerySysValue(HWND_DESKTOP, SV_CYICON);
+
+ // Check for max size!
+ if ((w>maxx) || (h>maxy))
+ return;
+
+ pchTemp = (char *) SDL_malloc(w * h*2 * 4);
+ if (!pchTemp)
+ return;
+
+ SDL_memset(pchTemp, 0, w * h*2 * 4);
+
+ // Convert surface to RGB, if it's not RGB yet!
+ icon_rgb = SDL_CreateRGBSurface(SDL_SWSURFACE, icon->w, icon->h,
+ 32, 0, 0, 0, 0);
+ if ( icon_rgb == NULL )
+ {
+ SDL_free(pchTemp);
+ return;
+ }
+ bounds.x = 0;
+ bounds.y = 0;
+ bounds.w = icon->w;
+ bounds.h = icon->h;
+ if ( SDL_LowerBlit(icon, &bounds, icon_rgb, &bounds) < 0 )
+ {
+ SDL_FreeSurface(icon_rgb);
+ SDL_free(pchTemp);
+ return;
+ }
+
+ /* Copy pixels upside-down from RGB surface into BMP, masked with the icon mask */
+
+ // Pixels
+ pptr = (char *) (icon_rgb->pixels);
+ // Mask
+ mptr = mask;
+
+ for (y=0; y<h; y++)
+ {
+ unsigned char uchMaskByte;
+
+ // Destination
+ dptr = pchTemp + w*4 * (h-y-1);
+ // Destination mask
+ dmptr = pchTemp + w*h*4 + w*4 * (h-y-1);
+
+ for (x=0; x<w; x++)
+ {
+ if (x%8==0)
+ {
+ uchMaskByte = (unsigned char) (*mptr);
+ mptr++;
+ } else
+ uchMaskByte <<= 1;
+
+ if (uchMaskByte & 0x80)
+ {
+ // Copy RGB
+ *dptr++ = *pptr++;
+ *dptr++ = *pptr++;
+ *dptr++ = *pptr++;
+ *dptr++ = *pptr++;
+
+ *dmptr++ = 0;
+ *dmptr++ = 0;
+ *dmptr++ = 0;
+ *dmptr++ = 0;
+ } else
+ {
+ // Set pixels to fully transparent
+ *dptr++ = 0; pptr++;
+ *dptr++ = 0; pptr++;
+ *dptr++ = 0; pptr++;
+ *dptr++ = 0; pptr++;
+
+ *dmptr++ = 255;
+ *dmptr++ = 255;
+ *dmptr++ = 255;
+ *dmptr++ = 255;
+ }
+ }
+ }
+
+ // There is no more need for the RGB surface
+ SDL_FreeSurface(icon_rgb);
+
+ hps = WinGetPS(_this->hidden->hwndClient);
+
+ bmi.cbFix = sizeof(BITMAPINFOHEADER);
+ bmi.cx = w;
+ bmi.cy = 2*h;
+ bmi.cPlanes = 1;
+ bmi.cBitCount = 32;
+
+ SDL_memset(&bmih, 0, sizeof(BITMAPINFOHEADER));
+ bmih.cbFix = sizeof(BITMAPINFOHEADER);
+ bmih.cx = w;
+ bmih.cy = 2*h;
+ bmih.cPlanes = 1;
+ bmih.cBitCount = 32;
+
+ hbm = GpiCreateBitmap(hps, (PBITMAPINFOHEADER2)&bmih, CBM_INIT, (PBYTE) pchTemp, (PBITMAPINFO2)&bmi);
+ hptrIcon = WinCreatePointer(HWND_DESKTOP, hbm, FALSE, 0, 0);
+
+ WinReleasePS(hps);
+
+ // Free pixel array
+ SDL_free(pchTemp);
+
+ // Change icon in frame window
+ WinSendMsg(hwndFrame,
+ WM_SETICON,
+ (MPARAM) hptrIcon,
+ NULL);
+
+ /*
+ // Change icon in switchlist
+ // Seems like it's not needed, the WM_SETICON already does it.
+ {
+ PID pidFrame;
+ HSWITCH hswitchFrame;
+ SWCNTRL swctl;
+
+ WinQueryWindowProcess(hwndFrame, &pidFrame, NULL);
+ hswitchFrame = WinQuerySwitchHandle(hwndFrame, pidFrame);
+ WinQuerySwitchEntry(hswitchFrame, &swctl);
+
+ swctl.hwndIcon = hptrIcon;
+
+ WinChangeSwitchEntry(hswitchFrame, &swctl);
+ }
+ */
+
+ // Store icon handle in global variable
+ hptrCurrentIcon = hptrIcon;
+}
+
+// ------------------------ REAL FUNCTIONS -----------------
+
+
+static void os2fslib_SetCursorManagementFunctions(_THIS, int iForWindowedMode)
+{
+ if (iForWindowedMode)
+ {
+ _this->FreeWMCursor = os2fslib_FreeWMCursor;
+ _this->CreateWMCursor = os2fslib_CreateWMCursor_Win;
+ _this->ShowWMCursor = os2fslib_ShowWMCursor;
+ _this->WarpWMCursor = os2fslib_WarpWMCursor;
+ _this->MoveWMCursor = os2fslib_MoveWMCursor;
+ _this->CheckMouseMode = NULL;//os2fslib_CheckMouseMode;
+ } else
+ {
+ // We'll have software mouse cursor in FS mode!
+ _this->FreeWMCursor = os2fslib_FreeWMCursor;
+ _this->CreateWMCursor = os2fslib_CreateWMCursor_FS;
+ _this->ShowWMCursor = os2fslib_ShowWMCursor;
+ _this->WarpWMCursor = os2fslib_WarpWMCursor;
+ _this->MoveWMCursor = os2fslib_MoveWMCursor;
+ _this->CheckMouseMode = NULL;//os2fslib_CheckMouseMode;
+ }
+}
+
+static void os2fslib_InitOSKeymap(_THIS)
+{
+ int i;
+
+ iShiftIsPressed = 0;
+
+ /* Map the VK and CH keysyms */
+ for ( i=0; i<=255; ++i )
+ HWScanKeyMap[i] = SDLK_UNKNOWN;
+
+ // First line of keyboard:
+ HWScanKeyMap[0x1] = SDLK_ESCAPE;
+ HWScanKeyMap[0x3b] = SDLK_F1;
+ HWScanKeyMap[0x3c] = SDLK_F2;
+ HWScanKeyMap[0x3d] = SDLK_F3;
+ HWScanKeyMap[0x3e] = SDLK_F4;
+ HWScanKeyMap[0x3f] = SDLK_F5;
+ HWScanKeyMap[0x40] = SDLK_F6;
+ HWScanKeyMap[0x41] = SDLK_F7;
+ HWScanKeyMap[0x42] = SDLK_F8;
+ HWScanKeyMap[0x43] = SDLK_F9;
+ HWScanKeyMap[0x44] = SDLK_F10;
+ HWScanKeyMap[0x57] = SDLK_F11;
+ HWScanKeyMap[0x58] = SDLK_F12;
+ HWScanKeyMap[0x5d] = SDLK_PRINT;
+ HWScanKeyMap[0x46] = SDLK_SCROLLOCK;
+ HWScanKeyMap[0x5f] = SDLK_PAUSE;
+
+ // Second line of keyboard:
+ HWScanKeyMap[0x29] = SDLK_BACKQUOTE;
+ HWScanKeyMap[0x2] = SDLK_1;
+ HWScanKeyMap[0x3] = SDLK_2;
+ HWScanKeyMap[0x4] = SDLK_3;
+ HWScanKeyMap[0x5] = SDLK_4;
+ HWScanKeyMap[0x6] = SDLK_5;
+ HWScanKeyMap[0x7] = SDLK_6;
+ HWScanKeyMap[0x8] = SDLK_7;
+ HWScanKeyMap[0x9] = SDLK_8;
+ HWScanKeyMap[0xa] = SDLK_9;
+ HWScanKeyMap[0xb] = SDLK_0;
+ HWScanKeyMap[0xc] = SDLK_MINUS;
+ HWScanKeyMap[0xd] = SDLK_EQUALS;
+ HWScanKeyMap[0xe] = SDLK_BACKSPACE;
+ HWScanKeyMap[0x68] = SDLK_INSERT;
+ HWScanKeyMap[0x60] = SDLK_HOME;
+ HWScanKeyMap[0x62] = SDLK_PAGEUP;
+ HWScanKeyMap[0x45] = SDLK_NUMLOCK;
+ HWScanKeyMap[0x5c] = SDLK_KP_DIVIDE;
+ HWScanKeyMap[0x37] = SDLK_KP_MULTIPLY;
+ HWScanKeyMap[0x4a] = SDLK_KP_MINUS;
+
+ // Third line of keyboard:
+ HWScanKeyMap[0xf] = SDLK_TAB;
+ HWScanKeyMap[0x10] = SDLK_q;
+ HWScanKeyMap[0x11] = SDLK_w;
+ HWScanKeyMap[0x12] = SDLK_e;
+ HWScanKeyMap[0x13] = SDLK_r;
+ HWScanKeyMap[0x14] = SDLK_t;
+ HWScanKeyMap[0x15] = SDLK_y;
+ HWScanKeyMap[0x16] = SDLK_u;
+ HWScanKeyMap[0x17] = SDLK_i;
+ HWScanKeyMap[0x18] = SDLK_o;
+ HWScanKeyMap[0x19] = SDLK_p;
+ HWScanKeyMap[0x1a] = SDLK_LEFTBRACKET;
+ HWScanKeyMap[0x1b] = SDLK_RIGHTBRACKET;
+ HWScanKeyMap[0x1c] = SDLK_RETURN;
+ HWScanKeyMap[0x69] = SDLK_DELETE;
+ HWScanKeyMap[0x65] = SDLK_END;
+ HWScanKeyMap[0x67] = SDLK_PAGEDOWN;
+ HWScanKeyMap[0x47] = SDLK_KP7;
+ HWScanKeyMap[0x48] = SDLK_KP8;
+ HWScanKeyMap[0x49] = SDLK_KP9;
+ HWScanKeyMap[0x4e] = SDLK_KP_PLUS;
+
+ // Fourth line of keyboard:
+ HWScanKeyMap[0x3a] = SDLK_CAPSLOCK;
+ HWScanKeyMap[0x1e] = SDLK_a;
+ HWScanKeyMap[0x1f] = SDLK_s;
+ HWScanKeyMap[0x20] = SDLK_d;
+ HWScanKeyMap[0x21] = SDLK_f;
+ HWScanKeyMap[0x22] = SDLK_g;
+ HWScanKeyMap[0x23] = SDLK_h;
+ HWScanKeyMap[0x24] = SDLK_j;
+ HWScanKeyMap[0x25] = SDLK_k;
+ HWScanKeyMap[0x26] = SDLK_l;
+ HWScanKeyMap[0x27] = SDLK_SEMICOLON;
+ HWScanKeyMap[0x28] = SDLK_QUOTE;
+ HWScanKeyMap[0x2b] = SDLK_BACKSLASH;
+ HWScanKeyMap[0x4b] = SDLK_KP4;
+ HWScanKeyMap[0x4c] = SDLK_KP5;
+ HWScanKeyMap[0x4d] = SDLK_KP6;
+
+ // Fifth line of keyboard:
+ HWScanKeyMap[0x2a] = SDLK_LSHIFT;
+ HWScanKeyMap[0x56] = SDLK_WORLD_1; // Code 161, letter i' on hungarian keyboard
+ HWScanKeyMap[0x2c] = SDLK_z;
+ HWScanKeyMap[0x2d] = SDLK_x;
+ HWScanKeyMap[0x2e] = SDLK_c;
+ HWScanKeyMap[0x2f] = SDLK_v;
+ HWScanKeyMap[0x30] = SDLK_b;
+ HWScanKeyMap[0x31] = SDLK_n;
+ HWScanKeyMap[0x32] = SDLK_m;
+ HWScanKeyMap[0x33] = SDLK_COMMA;
+ HWScanKeyMap[0x34] = SDLK_PERIOD;
+ HWScanKeyMap[0x35] = SDLK_SLASH;
+ HWScanKeyMap[0x36] = SDLK_RSHIFT;
+ HWScanKeyMap[0x61] = SDLK_UP;
+ HWScanKeyMap[0x4f] = SDLK_KP1;
+ HWScanKeyMap[0x50] = SDLK_KP2;
+ HWScanKeyMap[0x51] = SDLK_KP3;
+ HWScanKeyMap[0x5a] = SDLK_KP_ENTER;
+
+ // Sixth line of keyboard:
+ HWScanKeyMap[0x1d] = SDLK_LCTRL;
+ HWScanKeyMap[0x7e] = SDLK_LSUPER; // Windows key
+ HWScanKeyMap[0x38] = SDLK_LALT;
+ HWScanKeyMap[0x39] = SDLK_SPACE;
+ HWScanKeyMap[0x5e] = SDLK_RALT;// Actually, altgr on my keyboard...
+ HWScanKeyMap[0x7f] = SDLK_RSUPER;
+ HWScanKeyMap[0x7c] = SDLK_MENU;
+ HWScanKeyMap[0x5b] = SDLK_RCTRL;
+ HWScanKeyMap[0x63] = SDLK_LEFT;
+ HWScanKeyMap[0x66] = SDLK_DOWN;
+ HWScanKeyMap[0x64] = SDLK_RIGHT;
+ HWScanKeyMap[0x52] = SDLK_KP0;
+ HWScanKeyMap[0x53] = SDLK_KP_PERIOD;
+}
+
+
+/* Iconify the window.
+ This function returns 1 if there is a window manager and the
+ window was actually iconified, it returns 0 otherwise.
+ */
+int os2fslib_IconifyWindow(_THIS)
+{
+ HAB hab;
+ HMQ hmq;
+ ERRORID hmqerror;
+
+ // If there is no more window, nothing we can do!
+ if (_this->hidden->iPMThreadStatus!=1) return 0;
+
+ // Cannot do anything in fullscreen mode!
+ if (FSLib_QueryFSMode(_this->hidden->hwndClient))
+ return 0;
+
+ // Make sure this thread is prepared for using the Presentation Manager!
+ hab = WinInitialize(0);
+ hmq = WinCreateMsgQueue(hab,0);
+ // Remember if there was an error at WinCreateMsgQueue(), because we don't
+ // want to destroy somebody else's queue later. :)
+ hmqerror = WinGetLastError(hab);
+
+ WinSetWindowPos(_this->hidden->hwndFrame, HWND_TOP,
+ 0, 0, 0, 0, SWP_MINIMIZE);
+
+ // Now destroy the message queue, if we've created it!
+ if (ERRORIDERROR(hmqerror)==0)
+ WinDestroyMsgQueue(hmq);
+
+ return 1;
+}
+
+static SDL_GrabMode os2fslib_GrabInput(_THIS, SDL_GrabMode mode)
+{
+ HAB hab;
+ HMQ hmq;
+ ERRORID hmqerror;
+
+
+ // If there is no more window, nothing we can do!
+ if (_this->hidden->iPMThreadStatus!=1)
+ return SDL_GRAB_OFF;
+
+ // Make sure this thread is prepared for using the Presentation Manager!
+ hab = WinInitialize(0);
+ hmq = WinCreateMsgQueue(hab,0);
+ // Remember if there was an error at WinCreateMsgQueue(), because we don't
+ // want to destroy somebody else's queue later. :)
+ hmqerror = WinGetLastError(hab);
+
+
+ if (mode == SDL_GRAB_OFF)
+ {
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_GrabInput] : Releasing mouse\n"); fflush(stdout);
+#endif
+
+ // Release the mouse
+ bMouseCapturable = 0;
+ if (bMouseCaptured)
+ {
+ WinSetCapture(HWND_DESKTOP, NULLHANDLE);
+ bMouseCaptured = 0;
+ }
+ } else
+ {
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_GrabInput] : Capturing mouse\n"); fflush(stdout);
+#endif
+
+ // Capture the mouse
+ bMouseCapturable = 1;
+ if (WinQueryFocus(HWND_DESKTOP) == _this->hidden->hwndClient)
+ {
+ WinSetCapture(HWND_DESKTOP, _this->hidden->hwndClient);
+ bMouseCaptured = 1;
+ {
+ SWP swpClient;
+ POINTL ptl;
+ // Center the mouse to the middle of the window!
+ WinQueryWindowPos(_this->hidden->hwndClient, &swpClient);
+ ptl.x = 0; ptl.y = 0;
+ WinMapWindowPoints(_this->hidden->hwndClient, HWND_DESKTOP, &ptl, 1);
+ _this->hidden->iSkipWMMOUSEMOVE++; /* Don't take next WM_MOUSEMOVE into account! */
+ WinSetPointerPos(HWND_DESKTOP,
+ ptl.x + swpClient.cx/2,
+ ptl.y + swpClient.cy/2);
+ }
+ }
+ }
+
+ // Now destroy the message queue, if we've created it!
+ if (ERRORIDERROR(hmqerror)==0)
+ WinDestroyMsgQueue(hmq);
+
+ return mode;
+}
+
+/* Set the title and icon text */
+static void os2fslib_SetCaption(_THIS, const char *title, const char *icon)
+{
+ HAB hab;
+ HMQ hmq;
+ ERRORID hmqerror;
+
+ // If there is no more window, nothing we can do!
+ if (_this->hidden->iPMThreadStatus!=1) return;
+
+ // Make sure this thread is prepared for using the Presentation Manager!
+ hab = WinInitialize(0);
+ hmq = WinCreateMsgQueue(hab,0);
+ // Remember if there was an error at WinCreateMsgQueue(), because we don't
+ // want to destroy somebody else's queue later. :)
+ hmqerror = WinGetLastError(hab);
+
+ WinSetWindowText(_this->hidden->hwndFrame, (char *) title);
+
+ // Now destroy the message queue, if we've created it!
+ if (ERRORIDERROR(hmqerror)==0)
+ WinDestroyMsgQueue(hmq);
+}
+
+static int os2fslib_ToggleFullScreen(_THIS, int on)
+{
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_ToggleFullScreen] : %d\n", on); fflush(stdout);
+#endif
+ // If there is no more window, nothing we can do!
+ if (_this->hidden->iPMThreadStatus!=1) return 0;
+
+ FSLib_ToggleFSMode(_this->hidden->hwndClient, on);
+ /* Cursor manager functions to Windowed/FS mode*/
+ os2fslib_SetCursorManagementFunctions(_this, !on);
+ return 1;
+}
+
+/* This is called after the video mode has been set, to get the
+ initial mouse state. It should queue events as necessary to
+ properly represent the current mouse focus and position.
+ */
+static void os2fslib_UpdateMouse(_THIS)
+{
+ POINTL ptl;
+ HAB hab;
+ HMQ hmq;
+ ERRORID hmqerror;
+ SWP swpClient;
+
+ // If there is no more window, nothing we can do!
+ if (_this->hidden->iPMThreadStatus!=1) return;
+
+
+ // Make sure this thread is prepared for using the Presentation Manager!
+ hab = WinInitialize(0);
+ hmq = WinCreateMsgQueue(hab,0);
+ // Remember if there was an error at WinCreateMsgQueue(), because we don't
+ // want to destroy somebody else's queue later. :)
+ hmqerror = WinGetLastError(hab);
+
+
+
+ if (_this->hidden->fInFocus)
+ {
+ // If our app is in focus
+ SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
+ SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
+ SDL_PrivateAppActive(1, SDL_APPACTIVE);
+ WinQueryPointerPos(HWND_DESKTOP, &ptl);
+ WinMapWindowPoints(HWND_DESKTOP, _this->hidden->hwndClient, &ptl, 1);
+ WinQueryWindowPos(_this->hidden->hwndClient, &swpClient);
+ // Convert OS/2 mouse position to SDL position, and also scale it!
+ ptl.x = ptl.x * _this->hidden->SrcBufferDesc.uiXResolution / swpClient.cx;
+ ptl.y = ptl.y * _this->hidden->SrcBufferDesc.uiYResolution / swpClient.cy;
+ ptl.y = _this->hidden->SrcBufferDesc.uiYResolution - ptl.y - 1;
+ SDL_PrivateMouseMotion(0, 0, (Sint16) (ptl.x), (Sint16) (ptl.y));
+ } else
+ {
+ // If we're not in focus
+ SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
+ SDL_PrivateAppActive(0, SDL_APPINPUTFOCUS);
+ SDL_PrivateAppActive(0, SDL_APPACTIVE);
+ SDL_PrivateMouseMotion(0, 0, (Sint16) -1, (Sint16) -1);
+ }
+
+ // Now destroy the message queue, if we've created it!
+ if (ERRORIDERROR(hmqerror)==0)
+ WinDestroyMsgQueue(hmq);
+
+}
+
+/* This pointer should exist in the native video subsystem and should
+ point to an appropriate update function for the current video mode
+ */
+static void os2fslib_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
+{
+ // If there is no more window, nothing we can do!
+ if (_this->hidden->iPMThreadStatus!=1) return;
+
+#ifdef BITBLT_IN_WINMESSAGEPROC
+ WinSendMsg(_this->hidden->hwndClient,
+ WM_UPDATERECTSREQUEST,
+ (MPARAM) numrects,
+ (MPARAM) rects);
+#else
+ if (DosRequestMutexSem(_this->hidden->hmtxUseSrcBuffer, SEM_INDEFINITE_WAIT)==NO_ERROR)
+ {
+ int i;
+
+ if (_this->hidden->pSDLSurface)
+ {
+#ifndef RESIZE_EVEN_IF_RESIZABLE
+ SWP swp;
+ // But only blit if the window is not resizable, or if
+ // the window is resizable and the source buffer size is the
+ // same as the destination buffer size!
+ WinQueryWindowPos(_this->hidden->hwndClient, &swp);
+ if ((_this->hidden->pSDLSurface) &&
+ (_this->hidden->pSDLSurface->flags & SDL_RESIZABLE) &&
+ ((swp.cx != _this->hidden->SrcBufferDesc.uiXResolution) ||
+ (swp.cy != _this->hidden->SrcBufferDesc.uiYResolution)
+ ) &&
+ (!FSLib_QueryFSMode(_this->hidden->hwndClient))
+ )
+ {
+ // Resizable surface and in resizing!
+ // So, don't blit now!
+#ifdef DEBUG_BUILD
+ printf("[UpdateRects] : Skipping blit while resizing!\n"); fflush(stdout);
+#endif
+ } else
+#endif
+ {
+ /*
+ // Blit the whole window
+ FSLIB_BITBLT(_this->hidden->hwndClient, _this->hidden->pchSrcBuffer,
+ 0, 0,
+ _this->hidden->SrcBufferDesc.uiXResolution,
+ _this->hidden->SrcBufferDesc.uiYResolution);
+ */
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_UpdateRects] : Blitting!\n"); fflush(stdout);
+#endif
+
+ // Blit the changed areas
+ for (i=0; i<numrects; i++)
+ FSLIB_BITBLT(_this->hidden->hwndClient, _this->hidden->pchSrcBuffer,
+ rects[i].y, rects[i].x, rects[i].w, rects[i].h);
+ }
+ }
+#ifdef DEBUG_BUILD
+ else
+ printf("[os2fslib_UpdateRects] : No public surface!\n"); fflush(stdout);
+#endif
+ DosReleaseMutexSem(_this->hidden->hmtxUseSrcBuffer);
+ }
+#ifdef DEBUG_BUILD
+ else
+ printf("[os2fslib_UpdateRects] : Error in mutex!\n"); fflush(stdout);
+#endif
+#endif
+}
+
+
+/* Reverse the effects VideoInit() -- called if VideoInit() fails
+ or if the application is shutting down the video subsystem.
+ */
+static void os2fslib_VideoQuit(_THIS)
+{
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_VideoQuit]\n"); fflush(stdout);
+#endif
+ // Close PM stuff if running!
+ if (_this->hidden->iPMThreadStatus == 1)
+ {
+ int iTimeout;
+ WinPostMsg(_this->hidden->hwndFrame, WM_QUIT, (MPARAM) 0, (MPARAM) 0);
+ // HACK: We had this line before:
+ //DosWaitThread((TID *) &(_this->hidden->tidPMThread), DCWW_WAIT);
+ // We don't use it, because the PMThread will never stop, or if it stops,
+ // it will kill the whole process as a emergency fallback.
+ // So, we only check for the iPMThreadStatus stuff!
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_VideoQuit] : Waiting for PM thread to die\n"); fflush(stdout);
+#endif
+
+ iTimeout=0;
+ while ((_this->hidden->iPMThreadStatus == 1) && (iTimeout<100))
+ {
+ iTimeout++;
+ DosSleep(64);
+ }
+
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_VideoQuit] : End of wait.\n"); fflush(stdout);
+#endif
+
+ if (_this->hidden->iPMThreadStatus == 1)
+ {
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_VideoQuit] : Killing PM thread!\n"); fflush(stdout);
+#endif
+
+ _this->hidden->iPMThreadStatus = 0;
+ DosKillThread(_this->hidden->tidPMThread);
+
+ if (_this->hidden->hwndFrame)
+ {
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_VideoQuit] : Destroying PM window!\n"); fflush(stdout);
+#endif
+
+ WinDestroyWindow(_this->hidden->hwndFrame); _this->hidden->hwndFrame=NULL;
+ }
+ }
+
+ }
+
+ // Free result of an old ListModes() call, because there is
+ // no FreeListModes() call in SDL!
+ if (_this->hidden->pListModesResult)
+ {
+ SDL_free(_this->hidden->pListModesResult); _this->hidden->pListModesResult = NULL;
+ }
+
+ // Free list of available fullscreen modes
+ if (_this->hidden->pAvailableFSLibVideoModes)
+ {
+ FSLib_FreeVideoModeList(_this->hidden->pAvailableFSLibVideoModes);
+ _this->hidden->pAvailableFSLibVideoModes = NULL;
+ }
+
+ // Free application icon if we had one
+ if (hptrCurrentIcon)
+ {
+ WinDestroyPointer(hptrCurrentIcon);
+ hptrCurrentIcon = NULL;
+ }
+}
+
+/* Set the requested video mode, returning a surface which will be
+ set to the SDL_VideoSurface. The width and height will already
+ be verified by ListModes(), and the video subsystem is free to
+ set the mode to a supported bit depth different from the one
+ specified -- the desired bpp will be emulated with a shadow
+ surface if necessary. If a new mode is returned, this function
+ should take care of cleaning up the current mode.
+ */
+static SDL_Surface *os2fslib_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ static int bFirstCall = 1;
+ FSLib_VideoMode_p pModeInfo, pModeInfoFound;
+ FSLib_VideoMode TempModeInfo;
+ HAB hab;
+ HMQ hmq;
+ ERRORID hmqerror;
+ RECTL rectl;
+ SDL_Surface *pResult;
+
+ // If there is no more window, nothing we can do!
+ if (_this->hidden->iPMThreadStatus!=1) return NULL;
+
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_SetVideoMode] : Request for %dx%d @ %dBPP, flags=0x%x\n", width, height, bpp, flags); fflush(stdout);
+#endif
+
+ // We don't support palette modes!
+ if (bpp==8) bpp=32;
+
+ // Also, we don't support resizable modes in fullscreen mode.
+ if (flags & SDL_RESIZABLE)
+ flags &= ~SDL_FULLSCREEN;
+
+ // No double buffered mode
+ if (flags & SDL_DOUBLEBUF)
+ flags &= ~SDL_DOUBLEBUF;
+
+ // And, we don't support HWSURFACE yet.
+ if (flags & SDL_HWSURFACE)
+ {
+ flags &= ~SDL_HWSURFACE;
+ flags |= SDL_SWSURFACE;
+ }
+
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_SetVideoMode] : Changed request to %dx%d @ %dBPP, flags=0x%x\n", width, height, bpp, flags); fflush(stdout);
+#endif
+
+ // First check if there is such a video mode they want!
+ pModeInfoFound = NULL;
+
+ // For fullscreen mode we don't support every resolution!
+ // So, go through the video modes, and check for such a resolution!
+ pModeInfoFound = NULL;
+ pModeInfo = _this->hidden->pAvailableFSLibVideoModes;
+
+ while (pModeInfo)
+ {
+ // Check all available fullscreen modes for this resolution
+ if ((pModeInfo->uiXResolution == width) &&
+ (pModeInfo->uiYResolution == height) &&
+ (pModeInfo->uiBPP!=8)) // palettized modes not yet supported
+ {
+ // If good resolution, try to find the exact BPP, or at least
+ // something similar...
+ if (!pModeInfoFound)
+ pModeInfoFound = pModeInfo;
+ else
+ if ((pModeInfoFound->uiBPP!=bpp) &&
+ (pModeInfoFound->uiBPP<pModeInfo->uiBPP))
+ pModeInfoFound = pModeInfo;
+ }
+ pModeInfo = pModeInfo->pNext;
+ }
+
+ // If we did not find a good fullscreen mode, then try a similar
+ if (!pModeInfoFound)
+ {
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_SetVideoMode] : Requested video mode not found, looking for a similar one!\n"); fflush(stdout);
+#endif
+ // Go through the video modes again, and find a similar resolution!
+ pModeInfo = _this->hidden->pAvailableFSLibVideoModes;
+ while (pModeInfo)
+ {
+ // Check all available fullscreen modes for this resolution
+ if ((pModeInfo->uiXResolution >= width) &&
+ (pModeInfo->uiYResolution >= height) &&
+ (pModeInfo->uiBPP == bpp))
+ {
+ if (!pModeInfoFound)
+ pModeInfoFound = pModeInfo;
+ else
+ if (((pModeInfoFound->uiXResolution-width)*(pModeInfoFound->uiYResolution-height))>
+ ((pModeInfo->uiXResolution-width)*(pModeInfo->uiYResolution-height)))
+ {
+ // Found a mode which is closer than the current one
+ pModeInfoFound = pModeInfo;
+ }
+ }
+ pModeInfo = pModeInfo->pNext;
+ }
+ }
+
+ // If we did not find a good fullscreen mode, then return NULL
+ if (!pModeInfoFound)
+ {
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_SetVideoMode] : Requested video mode not found!\n"); fflush(stdout);
+#endif
+ return NULL;
+ }
+
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_SetVideoMode] : Found mode!\n"); fflush(stdout);
+#endif
+
+ // We'll possibly adjust the structure, so copy out the values
+ // into TempModeInfo!
+ SDL_memcpy(&TempModeInfo, pModeInfoFound, sizeof(TempModeInfo));
+ pModeInfoFound = &TempModeInfo;
+
+ if (flags & SDL_RESIZABLE)
+ {
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_SetVideoMode] : Requested mode is resizable, changing width/height\n"); fflush(stdout);
+#endif
+ // Change width and height to requested one!
+ TempModeInfo.uiXResolution = width;
+ TempModeInfo.uiYResolution = height;
+ TempModeInfo.uiScanLineSize = width * ((TempModeInfo.uiBPP+7)/8);
+ }
+
+ // We can try create new surface!
+
+ // Make sure this thread is prepared for using the Presentation Manager!
+ hab = WinInitialize(0);
+ hmq = WinCreateMsgQueue(hab,0);
+ // Remember if there was an error at WinCreateMsgQueue(), because we don't
+ // want to destroy somebody else's queue later. :)
+ hmqerror = WinGetLastError(hab);
+
+
+
+ if (DosRequestMutexSem(_this->hidden->hmtxUseSrcBuffer, SEM_INDEFINITE_WAIT)==NO_ERROR)
+ {
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_SetVideoMode] : Creating new SW surface\n"); fflush(stdout);
+#endif
+
+ // Create new software surface!
+ pResult = SDL_CreateRGBSurface(SDL_SWSURFACE,
+ pModeInfoFound->uiXResolution,
+ pModeInfoFound->uiYResolution,
+ pModeInfoFound->uiBPP,
+ ((unsigned int) pModeInfoFound->PixelFormat.ucRedMask) << pModeInfoFound->PixelFormat.ucRedPosition,
+ ((unsigned int) pModeInfoFound->PixelFormat.ucGreenMask) << pModeInfoFound->PixelFormat.ucGreenPosition,
+ ((unsigned int) pModeInfoFound->PixelFormat.ucBlueMask) << pModeInfoFound->PixelFormat.ucBluePosition,
+ ((unsigned int) pModeInfoFound->PixelFormat.ucAlphaMask) << pModeInfoFound->PixelFormat.ucAlphaPosition);
+
+ if (pResult == NULL)
+ {
+ DosReleaseMutexSem(_this->hidden->hmtxUseSrcBuffer);
+ SDL_OutOfMemory();
+ return NULL;
+ }
+
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_SetVideoMode] : Adjusting pixel format\n"); fflush(stdout);
+#endif
+
+ // Adjust pixel format mask!
+ pResult->format->Rmask = ((unsigned int) pModeInfoFound->PixelFormat.ucRedMask) << pModeInfoFound->PixelFormat.ucRedPosition;
+ pResult->format->Rshift = pModeInfoFound->PixelFormat.ucRedPosition;
+ pResult->format->Rloss = pModeInfoFound->PixelFormat.ucRedAdjust;
+ pResult->format->Gmask = ((unsigned int) pModeInfoFound->PixelFormat.ucGreenMask) << pModeInfoFound->PixelFormat.ucGreenPosition;
+ pResult->format->Gshift = pModeInfoFound->PixelFormat.ucGreenPosition;
+ pResult->format->Gloss = pModeInfoFound->PixelFormat.ucGreenAdjust;
+ pResult->format->Bmask = ((unsigned int) pModeInfoFound->PixelFormat.ucBlueMask) << pModeInfoFound->PixelFormat.ucBluePosition;
+ pResult->format->Bshift = pModeInfoFound->PixelFormat.ucBluePosition;
+ pResult->format->Bloss = pModeInfoFound->PixelFormat.ucBlueAdjust;
+ pResult->format->Amask = ((unsigned int) pModeInfoFound->PixelFormat.ucAlphaMask) << pModeInfoFound->PixelFormat.ucAlphaPosition;
+ pResult->format->Ashift = pModeInfoFound->PixelFormat.ucAlphaPosition;
+ pResult->format->Aloss = pModeInfoFound->PixelFormat.ucAlphaAdjust;
+
+#ifdef REPORT_EMPTY_ALPHA_MASK
+ pResult->format->Amask =
+ pResult->format->Ashift =
+ pResult->format->Aloss = 0;
+#endif
+
+ // Adjust surface flags
+ pResult->flags |= (flags & SDL_FULLSCREEN);
+ pResult->flags |= (flags & SDL_RESIZABLE);
+
+ // It might be that the software surface pitch is not the same as
+ // the pitch we have, so adjust that!
+ pModeInfoFound->uiScanLineSize = pResult->pitch;
+
+ // Store new source buffer parameters!
+ SDL_memcpy(&(_this->hidden->SrcBufferDesc), pModeInfoFound, sizeof(*pModeInfoFound));
+ _this->hidden->pchSrcBuffer = pResult->pixels;
+
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_SetVideoMode] : Telling FSLib the stuffs\n"); fflush(stdout);
+#endif
+
+ // Tell the FSLib window the new source image format
+ FSLib_SetSrcBufferDesc(_this->hidden->hwndClient, &(_this->hidden->SrcBufferDesc));
+
+ if (
+ ((flags & SDL_RESIZABLE)==0) ||
+ (bFirstCall)
+ )
+ {
+ bFirstCall = 0;
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_SetVideoMode] : Modifying window size\n"); fflush(stdout);
+#endif
+
+ // Calculate frame window size from client window size
+ rectl.xLeft = 0;
+ rectl.yBottom = 0;
+ rectl.xRight = pModeInfoFound->uiXResolution; // Noninclusive
+ rectl.yTop = pModeInfoFound->uiYResolution; // Noninclusive
+ WinCalcFrameRect(_this->hidden->hwndFrame, &rectl, FALSE);
+
+ // Set the new size of the main window
+ SetAccessableWindowPos(_this->hidden->hwndFrame,
+ HWND_TOP,
+ 0, 0,
+ (rectl.xRight-rectl.xLeft),
+ (rectl.yTop-rectl.yBottom),
+ SWP_SIZE | SWP_ACTIVATE | SWP_SHOW);
+ }
+
+ // Set fullscreen mode flag, and switch to fullscreen if needed!
+ if (flags & SDL_FULLSCREEN)
+ {
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_SetVideoMode] : Also trying to switch to fullscreen\n");
+ fflush(stdout);
+#endif
+ FSLib_ToggleFSMode(_this->hidden->hwndClient, 1);
+ /* Cursor manager functions to FS mode*/
+ os2fslib_SetCursorManagementFunctions(_this, 0);
+ } else
+ {
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_SetVideoMode] : Also trying to switch to desktop mode\n");
+ fflush(stdout);
+#endif
+ FSLib_ToggleFSMode(_this->hidden->hwndClient, 0);
+ /* Cursor manager functions to Windowed mode*/
+ os2fslib_SetCursorManagementFunctions(_this, 1);
+ }
+
+ _this->hidden->pSDLSurface = pResult;
+
+ DosReleaseMutexSem(_this->hidden->hmtxUseSrcBuffer);
+ } else
+ {
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_SetVideoMode] : Could not get hmtxUseSrcBuffer!\n"); fflush(stdout);
+#endif
+
+ pResult = NULL;
+ }
+
+ // As we have the new surface, we don't need the current one anymore!
+ if ((pResult) && (current))
+ {
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_SetVideoMode] : Freeing old surface\n"); fflush(stdout);
+#endif
+ SDL_FreeSurface(current);
+ }
+
+ // Redraw window
+ WinInvalidateRegion(_this->hidden->hwndClient, NULL, TRUE);
+
+ // Now destroy the message queue, if we've created it!
+ if (ERRORIDERROR(hmqerror)==0)
+ {
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_SetVideoMode] : Destroying message queue\n"); fflush(stdout);
+#endif
+ WinDestroyMsgQueue(hmq);
+ }
+
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_SetVideoMode] : Done\n"); fflush(stdout);
+#endif
+
+ /* We're done */
+
+ // Return with the new surface!
+ return pResult;
+}
+
+/* List the available video modes for the given pixel format, sorted
+ from largest to smallest.
+ */
+static SDL_Rect **os2fslib_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_ListModes] : ListModes of %d Bpp\n", format->BitsPerPixel);
+#endif
+ // Destroy result of previous call, if there is any
+ if (_this->hidden->pListModesResult)
+ {
+ SDL_free(_this->hidden->pListModesResult); _this->hidden->pListModesResult = NULL;
+ }
+
+ // For resizable and windowed mode we support every resolution!
+ if ((flags & SDL_RESIZABLE) && ((flags & SDL_FULLSCREEN) == 0))
+ return (SDL_Rect **)-1;
+
+ // Check if they need fullscreen or non-fullscreen video modes!
+ if ((flags & SDL_FULLSCREEN) == 0)
+
+ {
+ // For windowed mode we support every resolution!
+ return (SDL_Rect **)-1;
+ } else
+ {
+ FSLib_VideoMode_p pFSMode;
+ // For fullscreen mode we don't support every resolution!
+ // Now create a new list
+ pFSMode = _this->hidden->pAvailableFSLibVideoModes;
+ while (pFSMode)
+ {
+ if (pFSMode->uiBPP == format->BitsPerPixel)
+ {
+ SDL_Rect *pRect = (SDL_Rect *) SDL_malloc(sizeof(SDL_Rect));
+ if (pRect)
+ {
+ // Fill description
+ pRect->x = 0;
+ pRect->y = 0;
+ pRect->w = pFSMode->uiXResolution;
+ pRect->h = pFSMode->uiYResolution;
+#ifdef DEBUG_BUILD
+// printf("!!! Seems to be good!\n");
+// printf("F: %dx%d\n", pRect->w, pRect->h);
+#endif
+ // And insert into list of pRects
+ if (!(_this->hidden->pListModesResult))
+ {
+#ifdef DEBUG_BUILD
+// printf("!!! Inserting to beginning\n");
+#endif
+
+ // We're the first one to be inserted!
+ _this->hidden->pListModesResult = (SDL_Rect**) SDL_malloc(2*sizeof(SDL_Rect*));
+ if (_this->hidden->pListModesResult)
+ {
+ _this->hidden->pListModesResult[0] = pRect;
+ _this->hidden->pListModesResult[1] = NULL;
+ } else
+ {
+ SDL_free(pRect);
+ }
+ } else
+ {
+ // We're not the first ones, so find the place where we
+ // have to insert ourselves
+ SDL_Rect **pNewList;
+ int iPlace, iNumOfSlots, i;
+
+#ifdef DEBUG_BUILD
+// printf("!!! Searching where to insert\n");
+#endif
+
+ iPlace = -1; iNumOfSlots = 1; // Count the last NULL too!
+ for (i=0; _this->hidden->pListModesResult[i]; i++)
+ {
+ iNumOfSlots++;
+ if (iPlace==-1)
+ {
+ if ((_this->hidden->pListModesResult[i]->w*_this->hidden->pListModesResult[i]->h)<
+ (pRect->w*pRect->h))
+ {
+ iPlace = i;
+ }
+ }
+ }
+ if (iPlace==-1) iPlace = iNumOfSlots-1;
+
+#ifdef DEBUG_BUILD
+// printf("!!! From %d slots, it will be at %d\n", iNumOfSlots, iPlace);
+#endif
+
+ pNewList = (SDL_Rect**) SDL_realloc(_this->hidden->pListModesResult, (iNumOfSlots+1)*sizeof(SDL_Rect*));
+ if (pNewList)
+ {
+ for (i=iNumOfSlots;i>iPlace;i--)
+ pNewList[i] = pNewList[i-1];
+ pNewList[iPlace] = pRect;
+ _this->hidden->pListModesResult = pNewList;
+ } else
+ {
+ SDL_free(pRect);
+ }
+ }
+ }
+ }
+ pFSMode = pFSMode->pNext;
+ }
+ }
+#ifdef DEBUG_BUILD
+// printf("Returning list\n");
+#endif
+ return _this->hidden->pListModesResult;
+}
+
+/* Initialize the native video subsystem, filling 'vformat' with the
+ "best" display pixel format, returning 0 or -1 if there's an error.
+ */
+static int os2fslib_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ FSLib_VideoMode_p pDesktopMode;
+
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_VideoInit] : Enter\n"); fflush(stdout);
+#endif
+
+ // Report the best pixel format. For this,
+ // we'll use the current desktop format.
+ pDesktopMode = FSLib_GetDesktopVideoMode();
+ if (!pDesktopMode)
+ {
+ SDL_SetError("Could not query desktop video mode!");
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_VideoInit] : Could not query desktop video mode!\n");
+#endif
+ return -1;
+ }
+
+ /* Determine the current screen size */
+ _this->info.current_w = pDesktopMode->uiXResolution;
+ _this->info.current_h = pDesktopMode->uiYResolution;
+
+ /* Determine the screen depth */
+ vformat->BitsPerPixel = pDesktopMode->uiBPP;
+ vformat->BytesPerPixel = (vformat->BitsPerPixel+7)/8;
+
+ vformat->Rmask = ((unsigned int) pDesktopMode->PixelFormat.ucRedMask) << pDesktopMode->PixelFormat.ucRedPosition;
+ vformat->Rshift = pDesktopMode->PixelFormat.ucRedPosition;
+ vformat->Rloss = pDesktopMode->PixelFormat.ucRedAdjust;
+ vformat->Gmask = ((unsigned int) pDesktopMode->PixelFormat.ucGreenMask) << pDesktopMode->PixelFormat.ucGreenPosition;
+ vformat->Gshift = pDesktopMode->PixelFormat.ucGreenPosition;
+ vformat->Gloss = pDesktopMode->PixelFormat.ucGreenAdjust;
+ vformat->Bmask = ((unsigned int) pDesktopMode->PixelFormat.ucBlueMask) << pDesktopMode->PixelFormat.ucBluePosition;
+ vformat->Bshift = pDesktopMode->PixelFormat.ucBluePosition;
+ vformat->Bloss = pDesktopMode->PixelFormat.ucBlueAdjust;
+ vformat->Amask = ((unsigned int) pDesktopMode->PixelFormat.ucAlphaMask) << pDesktopMode->PixelFormat.ucAlphaPosition;
+ vformat->Ashift = pDesktopMode->PixelFormat.ucAlphaPosition;
+ vformat->Aloss = pDesktopMode->PixelFormat.ucAlphaAdjust;
+
+#ifdef REPORT_EMPTY_ALPHA_MASK
+ vformat->Amask =
+ vformat->Ashift =
+ vformat->Aloss = 0;
+#endif
+
+ // Fill in some window manager capabilities
+ _this->info.wm_available = 1;
+
+ // Initialize some internal variables
+ _this->hidden->pListModesResult = NULL;
+ _this->hidden->fInFocus = 0;
+ _this->hidden->iSkipWMMOUSEMOVE = 0;
+ _this->hidden->iMouseVisible = 1;
+
+ if (getenv("SDL_USE_PROPORTIONAL_WINDOW"))
+ _this->hidden->bProportionalResize = 1;
+ else
+ {
+ PPIB pib;
+ PTIB tib;
+ char *pchFileName, *pchTemp;
+ char achConfigFile[CCHMAXPATH];
+ FILE *hFile;
+
+ /* No environment variable to have proportional window.
+ * Ok, let's check if this executable is in config file!
+ */
+ _this->hidden->bProportionalResize = 0;
+
+ DosGetInfoBlocks(&tib, &pib);
+ pchTemp = pchFileName = pib->pib_pchcmd;
+ while (*pchTemp)
+ {
+ if (*pchTemp=='\\')
+ pchFileName = pchTemp+1;
+ pchTemp++;
+ }
+ if (getenv("HOME"))
+ {
+ sprintf(achConfigFile, "%s\\.sdl.proportionals", getenv("HOME"));
+ hFile = fopen(achConfigFile, "rt");
+ if (!hFile)
+ {
+ /* Seems like the file cannot be opened or does not exist.
+ * Let's try to create it with defaults!
+ */
+ hFile = fopen(achConfigFile, "wt");
+ if (hFile)
+ {
+ fprintf(hFile, "; This file is a config file of SDL/2, containing\n");
+ fprintf(hFile, "; the list of executables that must have proportional\n");
+ fprintf(hFile, "; windows.\n");
+ fprintf(hFile, ";\n");
+ fprintf(hFile, "; You can add executable filenames into this file,\n");
+ fprintf(hFile, "; one under the other. If SDL finds that a given\n");
+ fprintf(hFile, "; program is in this list, then that application\n");
+ fprintf(hFile, "; will have proportional windows, just like if\n");
+ fprintf(hFile, "; the SET SDL_USE_PROPORTIONAL_WINDOW env. variable\n");
+ fprintf(hFile, "; would have been set for that process.\n");
+ fprintf(hFile, ";\n");
+ fprintf(hFile, "\n");
+ fprintf(hFile, "dosbox.exe\n");
+ fclose(hFile);
+ }
+
+ hFile = fopen(achConfigFile, "rt");
+ }
+
+ if (hFile)
+ {
+ while (fgets(achConfigFile, sizeof(achConfigFile), hFile))
+ {
+ /* Cut \n from end of string */
+
+ while (achConfigFile[strlen(achConfigFile)-1] == '\n')
+ achConfigFile[strlen(achConfigFile)-1] = 0;
+
+ /* Compare... */
+ if (stricmp(achConfigFile, pchFileName)==0)
+ {
+ /* Found it in config file! */
+ _this->hidden->bProportionalResize = 1;
+ break;
+ }
+ }
+ fclose(hFile);
+ }
+ }
+ }
+
+ DosCreateMutexSem(NULL, &(_this->hidden->hmtxUseSrcBuffer), 0, FALSE);
+
+ // Now create our window with a default size
+
+ // For this, we select the first available fullscreen mode as
+ // current window size!
+ SDL_memcpy(&(_this->hidden->SrcBufferDesc), _this->hidden->pAvailableFSLibVideoModes, sizeof(_this->hidden->SrcBufferDesc));
+ // Allocate new video buffer!
+ _this->hidden->pchSrcBuffer = (char *) SDL_malloc(_this->hidden->pAvailableFSLibVideoModes->uiScanLineSize * _this->hidden->pAvailableFSLibVideoModes->uiYResolution);
+ if (!_this->hidden->pchSrcBuffer)
+ {
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_VideoInit] : Yikes, not enough memory for new video buffer!\n"); fflush(stdout);
+#endif
+ SDL_SetError("Not enough memory for new video buffer!\n");
+ return -1;
+ }
+
+ // For this, we need a message processing thread.
+ // We'll create a new thread for this, which will do everything
+ // what is related to PM
+ _this->hidden->iPMThreadStatus = 0;
+ _this->hidden->tidPMThread = _beginthread(PMThreadFunc, NULL, 65536, (void *) _this);
+ if (_this->hidden->tidPMThread <= 0)
+ {
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_VideoInit] : Could not create PM thread!\n");
+#endif
+ SDL_SetError("Could not create PM thread");
+ return -1;
+ }
+#ifdef USE_DOSSETPRIORITY
+ // Burst the priority of PM Thread!
+ DosSetPriority(PRTYS_THREAD, PRTYC_TIMECRITICAL, 0, _this->hidden->tidPMThread);
+#endif
+ // Wait for the PM thread to initialize!
+ while (_this->hidden->iPMThreadStatus==0)
+ DosSleep(32);
+ // If the PM thread could not set up everything, then
+ // report an error!
+ if (_this->hidden->iPMThreadStatus!=1)
+ {
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_VideoInit] : PMThread reported an error : %d\n", _this->hidden->iPMThreadStatus);
+#endif
+ SDL_SetError("Error initializing PM thread");
+ return -1;
+ }
+
+ return 0;
+}
+
+
+static void os2fslib_DeleteDevice(_THIS)
+{
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_DeleteDevice]\n"); fflush(stdout);
+#endif
+ // Free used memory
+ FSLib_FreeVideoModeList(_this->hidden->pAvailableFSLibVideoModes);
+ if (_this->hidden->pListModesResult)
+ SDL_free(_this->hidden->pListModesResult);
+ if (_this->hidden->pchSrcBuffer)
+ SDL_free(_this->hidden->pchSrcBuffer);
+ DosCloseMutexSem(_this->hidden->hmtxUseSrcBuffer);
+ SDL_free(_this->hidden);
+ SDL_free(_this);
+ FSLib_Uninitialize();
+}
+
+static int os2fslib_Available(void)
+{
+
+ // If we can run, it means that we could load FSLib,
+ // so we assume that it's available then!
+ return 1;
+}
+
+static void os2fslib_MorphToPM()
+{
+ PPIB pib;
+ PTIB tib;
+
+ DosGetInfoBlocks(&tib, &pib);
+
+ // Change flag from VIO to PM:
+ if (pib->pib_ultype==2) pib->pib_ultype = 3;
+}
+
+static SDL_VideoDevice *os2fslib_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device;
+
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_CreateDevice] : Enter\n"); fflush(stdout);
+#endif
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( device )
+ {
+ SDL_memset(device, 0, (sizeof *device));
+ // Also allocate memory for private data
+ device->hidden = (struct SDL_PrivateVideoData *) SDL_malloc((sizeof(struct SDL_PrivateVideoData)));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) )
+ {
+ SDL_OutOfMemory();
+ if ( device )
+ SDL_free(device);
+ return NULL;
+ }
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+
+ /* Set the function pointers */
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_CreateDevice] : VideoInit is %p\n", os2fslib_VideoInit); fflush(stdout);
+#endif
+
+ /* Initialization/Query functions */
+ device->VideoInit = os2fslib_VideoInit;
+ device->ListModes = os2fslib_ListModes;
+ device->SetVideoMode = os2fslib_SetVideoMode;
+ device->ToggleFullScreen = os2fslib_ToggleFullScreen;
+ device->UpdateMouse = os2fslib_UpdateMouse;
+ device->CreateYUVOverlay = NULL;
+ device->SetColors = os2fslib_SetColors;
+ device->UpdateRects = os2fslib_UpdateRects;
+ device->VideoQuit = os2fslib_VideoQuit;
+ /* Hardware acceleration functions */
+ device->AllocHWSurface = os2fslib_AllocHWSurface;
+ device->CheckHWBlit = NULL;
+ device->FillHWRect = NULL;
+ device->SetHWColorKey = NULL;
+ device->SetHWAlpha = NULL;
+ device->LockHWSurface = os2fslib_LockHWSurface;
+ device->UnlockHWSurface = os2fslib_UnlockHWSurface;
+ device->FlipHWSurface = NULL;
+ device->FreeHWSurface = os2fslib_FreeHWSurface;
+ /* Window manager functions */
+ device->SetCaption = os2fslib_SetCaption;
+ device->SetIcon = os2fslib_SetIcon;
+ device->IconifyWindow = os2fslib_IconifyWindow;
+ device->GrabInput = os2fslib_GrabInput;
+ device->GetWMInfo = NULL;
+ /* Cursor manager functions to Windowed mode*/
+ os2fslib_SetCursorManagementFunctions(device, 1);
+ /* Event manager functions */
+ device->InitOSKeymap = os2fslib_InitOSKeymap;
+ device->PumpEvents = os2fslib_PumpEvents;
+ /* The function used to dispose of this structure */
+ device->free = os2fslib_DeleteDevice;
+
+ // Make sure we'll be able to use Win* API even if the application
+ // was linked to be a VIO application!
+ os2fslib_MorphToPM();
+
+ // Now initialize FSLib, and query available video modes!
+ if (!FSLib_Initialize())
+ {
+ // Could not initialize FSLib!
+#ifdef DEBUG_BUILD
+ printf("[os2fslib_CreateDevice] : Could not initialize FSLib!\n");
+#endif
+ SDL_SetError("Could not initialize FSLib!");
+ SDL_free(device->hidden);
+ SDL_free(device);
+ return NULL;
+ }
+ device->hidden->pAvailableFSLibVideoModes =
+ FSLib_GetVideoModeList();
+
+ return device;
+}
+
+VideoBootStrap OS2FSLib_bootstrap = {
+ "os2fslib", "OS/2 Video Output using FSLib",
+ os2fslib_Available, os2fslib_CreateDevice
+};
+
diff --git a/distrib/sdl-1.2.15/src/video/os2fslib/SDL_os2fslib.h b/distrib/sdl-1.2.15/src/video/os2fslib/SDL_os2fslib.h
new file mode 100644
index 0000000..6d58baf
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/os2fslib/SDL_os2fslib.h
@@ -0,0 +1,71 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_os2fslib_h
+#define _SDL_os2fslib_h
+
+
+// OS2 specific includes
+#define INCL_TYPES
+#define INCL_DOS
+#define INCL_DOSERRORS
+#define INCL_DOSPROCESS
+#define INCL_WIN
+#define INCL_GPI
+#include <os2.h>
+
+#include <FSLib.h>
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *_this
+
+/* Private display data */
+struct SDL_PrivateVideoData
+{
+ FSLib_VideoMode_p pAvailableFSLibVideoModes;
+ SDL_Rect **pListModesResult; // Allocated memory to return list of modes for os2fslib_ListModes() API
+
+ FSLib_VideoMode SrcBufferDesc; // Description of current source image buffer
+ char *pchSrcBuffer; // The source image buffer itself
+ SDL_Surface *pSDLSurface; // The SDL surface describing the buffer
+ HMTX hmtxUseSrcBuffer; // Mutex semaphore to manipulate src buffer
+ HWND hwndFrame, hwndClient; // Window handle of frame and client
+ int iPMThreadStatus; // 0: Not running
+ // 1: Running
+ // Other: Not running, had an error
+ int tidPMThread; // Thread ID of PM Thread
+ int fInFocus; // True if we're in focus!
+ int iSkipWMMOUSEMOVE; // Number of WM_MOUSEMOVE messages to skip!
+ int iMouseVisible; //
+
+ PFNWP pfnOldFrameProc; // Old window frame procedure
+ int bProportionalResize; // 0: No proportional resizing
+ // 1: Do proportional resizing
+ ULONG ulResizingFlag; // First resizing flag value
+};
+
+/* OS/2 specific backdoor function to be able to set FrameControlFlags of */
+/* the SDL window before creating it. */
+extern DECLSPEC void SDLCALL SDL_OS2FSLIB_SetFCFToUse(ULONG ulFCF);
+
+#endif /* _SDL_os2fslib_h */
diff --git a/distrib/sdl-1.2.15/src/video/os2fslib/SDL_vkeys.h b/distrib/sdl-1.2.15/src/video/os2fslib/SDL_vkeys.h
new file mode 100644
index 0000000..79380d5
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/os2fslib/SDL_vkeys.h
@@ -0,0 +1,74 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#ifndef 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'
+#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
diff --git a/distrib/sdl-1.2.15/src/video/photon/SDL_ph_events.c b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_events.c
new file mode 100644
index 0000000..9b7538c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_events.c
@@ -0,0 +1,624 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Handle the event stream, converting photon events into SDL events */
+
+#include <stdio.h>
+#include <setjmp.h>
+#include <sys/time.h>
+
+#include <Ph.h>
+#include <photon/PkKeyDef.h>
+
+#include "SDL.h"
+#include "SDL_syswm.h"
+#include "../SDL_sysvideo.h"
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_ph_video.h"
+#include "SDL_ph_modes_c.h"
+#include "SDL_ph_image_c.h"
+#include "SDL_ph_events_c.h"
+#include "SDL_phyuv_c.h"
+
+/* The translation tables from a photon keysym to a SDL keysym */
+static SDLKey ODD_keymap[256];
+static SDLKey MISC_keymap[0xFF + 1];
+SDL_keysym *ph_TranslateKey(PhKeyEvent_t *key, SDL_keysym *keysym);
+
+/* Check to see if this is a repeated key.
+ (idea shamelessly lifted from GII -- thanks guys! :) */
+static int ph_WarpedMotion(_THIS, PhEvent_t *winEvent)
+{
+ PhRect_t *rect = PhGetRects( winEvent );
+
+ int centre_x, centre_y;
+ int dx, dy;
+ short abs_x, abs_y;
+ int posted;
+
+ centre_x = SDL_VideoSurface->w / 2;
+ centre_y = SDL_VideoSurface->h / 2;
+
+ dx = rect->ul.x - centre_x;
+ dy = rect->ul.y - centre_y;
+
+ posted = SDL_PrivateMouseMotion( 0, 1, dx, dy );
+
+ /* Move mouse cursor to middle of the window */
+ PtGetAbsPosition( window, &abs_x, &abs_y );
+ PhMoveCursorAbs(PhInputGroup(NULL), abs_x + centre_x, abs_y + centre_y);
+
+ return (posted);
+}
+
+/* Control which motion flags the window has set, a flags value of -1 sets
+ * MOTION_BUTTON and MOTION_NOBUTTON */
+
+static void set_motion_sensitivity(_THIS, unsigned int flags)
+{
+ int rid;
+ int fields = Ph_EV_PTR_MOTION_BUTTON | Ph_EV_PTR_MOTION_NOBUTTON;
+ PhRegion_t region;
+
+ if( window )
+ {
+ rid = PtWidgetRid(window);
+ if( rid != 0 && PhRegionQuery(rid, &region, NULL, NULL, 0) == 0 )
+ {
+ region.events_sense=(region.events_sense & ~fields)|(flags & fields);
+ PhRegionChange(Ph_REGION_EV_SENSE, 0, &region, NULL, NULL);
+ }
+ }
+}
+
+/* Convert the photon button state value to an SDL value */
+static Uint8 ph2sdl_mousebutton(unsigned short button_state)
+{
+ Uint8 mouse_button = 0;
+
+ if (button_state & Ph_BUTTON_SELECT)
+ mouse_button |= SDL_BUTTON_LEFT;
+ if (button_state & Ph_BUTTON_MENU)
+ mouse_button |= SDL_BUTTON_RIGHT;
+ if (button_state & Ph_BUTTON_ADJUST)
+ mouse_button |= SDL_BUTTON_MIDDLE;
+
+ return (mouse_button);
+}
+
+static int ph_DispatchEvent(_THIS)
+{
+ int posted;
+ PhRect_t* rect;
+ PhPointerEvent_t* pointerEvent;
+ PhKeyEvent_t* keyEvent;
+ PhWindowEvent_t* winEvent;
+ int i, buttons;
+ SDL_Rect sdlrects[PH_SDL_MAX_RECTS];
+
+ posted = 0;
+
+ switch (phevent->type)
+ {
+ case Ph_EV_BOUNDARY:
+ {
+ if (phevent->subtype == Ph_EV_PTR_ENTER)
+ {
+ posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
+ }
+ else if (phevent->subtype ==Ph_EV_PTR_LEAVE)
+ {
+ posted = SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
+ }
+ }
+ break;
+
+ case Ph_EV_PTR_MOTION_BUTTON:
+ case Ph_EV_PTR_MOTION_NOBUTTON:
+ {
+ if (SDL_VideoSurface)
+ {
+ pointerEvent = PhGetData(phevent);
+ rect = PhGetRects(phevent);
+
+ if (mouse_relative)
+ {
+ posted = ph_WarpedMotion(this, phevent);
+ }
+ else
+ {
+ posted = SDL_PrivateMouseMotion(0, 0, rect->ul.x, rect->ul.y);
+ }
+ }
+ }
+ break;
+
+ case Ph_EV_BUT_PRESS:
+ {
+ pointerEvent = PhGetData(phevent);
+ buttons = ph2sdl_mousebutton(pointerEvent->buttons);
+ if (buttons != 0)
+ {
+ posted = SDL_PrivateMouseButton(SDL_PRESSED, buttons, 0, 0);
+ }
+ }
+ break;
+
+ case Ph_EV_BUT_RELEASE:
+ {
+ pointerEvent = PhGetData(phevent);
+ buttons = ph2sdl_mousebutton(pointerEvent->buttons);
+ if (phevent->subtype == Ph_EV_RELEASE_REAL && buttons != 0)
+ {
+ posted = SDL_PrivateMouseButton(SDL_RELEASED, buttons, 0, 0);
+ }
+ else if(phevent->subtype == Ph_EV_RELEASE_PHANTOM)
+ {
+ /* If the mouse is outside the window,
+ * only a phantom release event is sent, so
+ * check if the window doesn't have mouse focus.
+ * Not perfect, maybe checking the mouse button
+ * state for Ph_EV_BOUNDARY events would be
+ * better. */
+ if ((SDL_GetAppState() & SDL_APPMOUSEFOCUS) == 0)
+ {
+ posted = SDL_PrivateMouseButton(SDL_RELEASED, buttons, 0, 0);
+ }
+ }
+ }
+ break;
+
+ case Ph_EV_WM:
+ {
+ winEvent = PhGetData(phevent);
+
+ /* losing focus */
+ if ((winEvent->event_f==Ph_WM_FOCUS) && (winEvent->event_state==Ph_WM_EVSTATE_FOCUSLOST))
+ {
+ set_motion_sensitivity(this, Ph_EV_PTR_MOTION_BUTTON);
+ posted = SDL_PrivateAppActive(0, SDL_APPINPUTFOCUS);
+ }
+ /* gaining focus */
+ else if ((winEvent->event_f==Ph_WM_FOCUS) && (winEvent->event_state==Ph_WM_EVSTATE_FOCUS))
+ {
+ set_motion_sensitivity(this, -1);
+ posted = SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
+ }
+ /* request quit */
+ else if (winEvent->event_f==Ph_WM_CLOSE)
+ {
+ posted = SDL_PrivateQuit();
+ }
+ /* request hide/unhide */
+ else if (winEvent->event_f==Ph_WM_HIDE)
+ {
+ if (currently_hided)
+ {
+ /* got unhide window event */
+ /* TODO: restore application's palette if in palette mode */
+ currently_hided=0;
+ }
+ else
+ {
+ /* got hide window event */
+ /* TODO: restore original palette if in palette mode */
+ currently_hided=1;
+ }
+ }
+ /* request to resize */
+ else if (winEvent->event_f==Ph_WM_RESIZE)
+ {
+ currently_maximized=0;
+ #if (_NTO_VERSION < 630)
+ SDL_PrivateResize(winEvent->size.w+1, winEvent->size.h+1);
+ #else
+ /* QNX 6.3.0 have this bug fixed */
+ SDL_PrivateResize(winEvent->size.w, winEvent->size.h);
+ #endif /* _NTO_VERSION */
+ }
+ /* request to move */
+ else if (winEvent->event_f==Ph_WM_MOVE)
+ {
+ if (current_overlay!=NULL)
+ {
+ int lockedstate=current_overlay->hwdata->locked;
+ int chromastate=current_overlay->hwdata->ischromakey;
+ int error;
+ SDL_Rect src, dst;
+
+ current_overlay->hwdata->locked=1;
+ src.x = 0;
+ src.y = 0;
+ src.w = current_overlay->w;
+ src.y = current_overlay->h;
+ dst.x=current_overlay->hwdata->CurrentViewPort.pos.x;
+ dst.y=current_overlay->hwdata->CurrentViewPort.pos.y;
+ dst.w=current_overlay->hwdata->CurrentViewPort.size.w;
+ dst.h=current_overlay->hwdata->CurrentViewPort.size.h;
+ current_overlay->hwdata->ischromakey=0;
+ error=ph_DisplayYUVOverlay(this, current_overlay, &src, &dst);
+ if (!error)
+ {
+ current_overlay->hwdata->ischromakey=chromastate;
+ current_overlay->hwdata->locked=lockedstate;
+ }
+ }
+ }
+ /* maximize request */
+ else if (winEvent->event_f==Ph_WM_MAX)
+ {
+ /* window already moved and resized here */
+ currently_maximized=1;
+ }
+ /* restore request */
+ else if (winEvent->event_f==Ph_WM_RESTORE)
+ {
+ /* window already moved and resized here */
+ currently_maximized=0;
+ }
+ }
+ break;
+
+ /* window has been resized, moved or removed */
+ case Ph_EV_EXPOSE:
+ {
+ if (phevent->num_rects!=0)
+ {
+ int numrects;
+
+ if (SDL_VideoSurface)
+ {
+ rect = PhGetRects(phevent);
+ if (phevent->num_rects>PH_SDL_MAX_RECTS)
+ {
+ /* sorry, buffers underrun, we'll update only first PH_SDL_MAX_RECTS rects */
+ numrects=PH_SDL_MAX_RECTS;
+ }
+
+ for(i=0; i<phevent->num_rects; i++)
+ {
+ sdlrects[i].x = rect[i].ul.x;
+ sdlrects[i].y = rect[i].ul.y;
+ sdlrects[i].w = rect[i].lr.x - rect[i].ul.x + 1;
+ sdlrects[i].h = rect[i].lr.y - rect[i].ul.y + 1;
+ }
+
+ this->UpdateRects(this, phevent->num_rects, sdlrects);
+
+ if (current_overlay!=NULL)
+ {
+ int lockedstate=current_overlay->hwdata->locked;
+ int error;
+ SDL_Rect src, dst;
+
+ current_overlay->hwdata->locked=1;
+ src.x = 0;
+ src.y = 0;
+ src.w = current_overlay->w;
+ src.y = current_overlay->h;
+ dst.x=current_overlay->hwdata->CurrentViewPort.pos.x;
+ dst.y=current_overlay->hwdata->CurrentViewPort.pos.y;
+ dst.w=current_overlay->hwdata->CurrentViewPort.size.w;
+ dst.h=current_overlay->hwdata->CurrentViewPort.size.h;
+ current_overlay->hwdata->forcedredraw=1;
+ error=ph_DisplayYUVOverlay(this, current_overlay, &src, &dst);
+ if (!error)
+ {
+ current_overlay->hwdata->forcedredraw=0;
+ current_overlay->hwdata->locked=lockedstate;
+ }
+ }
+ }
+ }
+ }
+ break;
+
+ case Ph_EV_KEY:
+ {
+ SDL_keysym keysym;
+
+ posted = 0;
+
+ keyEvent = PhGetData(phevent);
+
+ if (Pk_KF_Key_Down & keyEvent->key_flags)
+ {
+ /* split the wheel events from real key events */
+ if ((keyEvent->key_cap==Pk_Up) && (keyEvent->key_scan==0) && ((keyEvent->key_flags & Pk_KF_Scan_Valid)==Pk_KF_Scan_Valid))
+ {
+ posted = SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELUP, 0, 0);
+ break;
+ }
+ if ((keyEvent->key_cap==Pk_Down) && (keyEvent->key_scan==0) && ((keyEvent->key_flags & Pk_KF_Scan_Valid)==Pk_KF_Scan_Valid))
+ {
+ posted = SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_WHEELDOWN, 0, 0);
+ break;
+ }
+ posted = SDL_PrivateKeyboard(SDL_PRESSED, ph_TranslateKey(keyEvent, &keysym));
+ }
+ else /* must be key release */
+ {
+ /* split the wheel events from real key events */
+ if ((keyEvent->key_cap==Pk_Up) && (keyEvent->key_scan==0) && ((keyEvent->key_flags & Pk_KF_Scan_Valid)==Pk_KF_Scan_Valid))
+ {
+ posted = SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELUP, 0, 0);
+ break;
+ }
+ if ((keyEvent->key_cap==Pk_Down) && (keyEvent->key_scan==0) && ((keyEvent->key_flags & Pk_KF_Scan_Valid)==Pk_KF_Scan_Valid))
+ {
+ posted = SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_WHEELDOWN, 0, 0);
+ break;
+ }
+ posted = SDL_PrivateKeyboard(SDL_RELEASED, ph_TranslateKey( keyEvent, &keysym));
+ }
+ }
+ break;
+
+ case Ph_EV_INFO:
+ {
+ if (phevent->subtype==Ph_OFFSCREEN_INVALID)
+ {
+ unsigned long* EvInfoData;
+
+ EvInfoData=(unsigned long*)PhGetData(phevent);
+
+ switch (*EvInfoData)
+ {
+ case Pg_VIDEO_MODE_SWITCHED:
+ {
+ }
+ break;
+ case Pg_ENTERED_DIRECT:
+ {
+ }
+ break;
+ case Pg_EXITED_DIRECT:
+ {
+ }
+ break;
+ case Pg_DRIVER_STARTED:
+ {
+ }
+ break;
+ }
+ }
+ }
+ break;
+ }
+
+ return(posted);
+}
+
+/* perform a blocking read if no events available */
+int ph_Pending(_THIS)
+{
+ /* Flush the display connection and look to see if events are queued */
+ PgFlush();
+
+ while (1)
+ {
+ switch(PhEventPeek(phevent, EVENT_SIZE))
+ {
+ case Ph_EVENT_MSG:
+ return 1;
+ case -1:
+ SDL_SetError("ph_Pending(): PhEventNext failed.\n");
+ return 0;
+ default:
+ return 0;
+ }
+ }
+
+ /* Oh well, nothing is ready .. */
+ return(0);
+}
+
+void ph_PumpEvents(_THIS)
+{
+ /* Flush the display connection and look to see if events are queued */
+ PgFlush();
+
+ while (ph_Pending(this))
+ {
+ PtEventHandler(phevent);
+ ph_DispatchEvent(this);
+ }
+}
+
+void ph_InitKeymap(void)
+{
+ int i;
+
+ /* Odd keys used in international keyboards */
+ for (i=0; i<SDL_arraysize(ODD_keymap); ++i)
+ {
+ ODD_keymap[i] = SDLK_UNKNOWN;
+ }
+
+ /* Map the miscellaneous keys */
+ for (i=0; i<SDL_arraysize(MISC_keymap); ++i)
+ {
+ MISC_keymap[i] = SDLK_UNKNOWN;
+ }
+
+ MISC_keymap[Pk_BackSpace&0xFF] = SDLK_BACKSPACE;
+ MISC_keymap[Pk_Tab&0xFF] = SDLK_TAB;
+ MISC_keymap[Pk_Clear&0xFF] = SDLK_CLEAR;
+ MISC_keymap[Pk_Return&0xFF] = SDLK_RETURN;
+ MISC_keymap[Pk_Pause&0xFF] = SDLK_PAUSE;
+ MISC_keymap[Pk_Escape&0xFF] = SDLK_ESCAPE;
+ MISC_keymap[Pk_Delete&0xFF] = SDLK_DELETE;
+
+ MISC_keymap[Pk_KP_0&0xFF] = SDLK_KP0;
+ MISC_keymap[Pk_KP_1&0xFF] = SDLK_KP1;
+ MISC_keymap[Pk_KP_2&0xFF] = SDLK_KP2;
+ MISC_keymap[Pk_KP_3&0xFF] = SDLK_KP3;
+ MISC_keymap[Pk_KP_4&0xFF] = SDLK_KP4;
+ MISC_keymap[Pk_KP_5&0xFF] = SDLK_KP5;
+ MISC_keymap[Pk_KP_6&0xFF] = SDLK_KP6;
+ MISC_keymap[Pk_KP_7&0xFF] = SDLK_KP7;
+ MISC_keymap[Pk_KP_8&0xFF] = SDLK_KP8;
+ MISC_keymap[Pk_KP_9&0xFF] = SDLK_KP9;
+
+ MISC_keymap[Pk_KP_Decimal&0xFF] = SDLK_KP_PERIOD;
+ MISC_keymap[Pk_KP_Divide&0xFF] = SDLK_KP_DIVIDE;
+ MISC_keymap[Pk_KP_Multiply&0xFF] = SDLK_KP_MULTIPLY;
+ MISC_keymap[Pk_KP_Subtract&0xFF] = SDLK_KP_MINUS;
+ MISC_keymap[Pk_KP_Add&0xFF] = SDLK_KP_PLUS;
+ MISC_keymap[Pk_KP_Enter&0xFF] = SDLK_KP_ENTER;
+ MISC_keymap[Pk_KP_Equal&0xFF] = SDLK_KP_EQUALS;
+
+ MISC_keymap[Pk_Up&0xFF] = SDLK_UP;
+ MISC_keymap[Pk_Down&0xFF] = SDLK_DOWN;
+ MISC_keymap[Pk_Right&0xFF] = SDLK_RIGHT;
+ MISC_keymap[Pk_Left&0xFF] = SDLK_LEFT;
+ MISC_keymap[Pk_Insert&0xFF] = SDLK_INSERT;
+ MISC_keymap[Pk_Home&0xFF] = SDLK_HOME;
+ MISC_keymap[Pk_End&0xFF] = SDLK_END;
+ MISC_keymap[Pk_Pg_Up&0xFF] = SDLK_PAGEUP;
+ MISC_keymap[Pk_Pg_Down&0xFF] = SDLK_PAGEDOWN;
+
+ MISC_keymap[Pk_F1&0xFF] = SDLK_F1;
+ MISC_keymap[Pk_F2&0xFF] = SDLK_F2;
+ MISC_keymap[Pk_F3&0xFF] = SDLK_F3;
+ MISC_keymap[Pk_F4&0xFF] = SDLK_F4;
+ MISC_keymap[Pk_F5&0xFF] = SDLK_F5;
+ MISC_keymap[Pk_F6&0xFF] = SDLK_F6;
+ MISC_keymap[Pk_F7&0xFF] = SDLK_F7;
+ MISC_keymap[Pk_F8&0xFF] = SDLK_F8;
+ MISC_keymap[Pk_F9&0xFF] = SDLK_F9;
+ MISC_keymap[Pk_F10&0xFF] = SDLK_F10;
+ MISC_keymap[Pk_F11&0xFF] = SDLK_F11;
+ MISC_keymap[Pk_F12&0xFF] = SDLK_F12;
+ MISC_keymap[Pk_F13&0xFF] = SDLK_F13;
+ MISC_keymap[Pk_F14&0xFF] = SDLK_F14;
+ MISC_keymap[Pk_F15&0xFF] = SDLK_F15;
+
+ MISC_keymap[Pk_Num_Lock&0xFF] = SDLK_NUMLOCK;
+ MISC_keymap[Pk_Caps_Lock&0xFF] = SDLK_CAPSLOCK;
+ MISC_keymap[Pk_Scroll_Lock&0xFF] = SDLK_SCROLLOCK;
+ MISC_keymap[Pk_Shift_R&0xFF] = SDLK_RSHIFT;
+ MISC_keymap[Pk_Shift_L&0xFF] = SDLK_LSHIFT;
+ MISC_keymap[Pk_Control_R&0xFF] = SDLK_RCTRL;
+ MISC_keymap[Pk_Control_L&0xFF] = SDLK_LCTRL;
+ MISC_keymap[Pk_Alt_R&0xFF] = SDLK_RALT;
+ MISC_keymap[Pk_Alt_L&0xFF] = SDLK_LALT;
+ MISC_keymap[Pk_Meta_R&0xFF] = SDLK_RMETA;
+ MISC_keymap[Pk_Meta_L&0xFF] = SDLK_LMETA;
+ MISC_keymap[Pk_Super_L&0xFF] = SDLK_LSUPER;
+ MISC_keymap[Pk_Super_R&0xFF] = SDLK_RSUPER;
+ MISC_keymap[Pk_Mode_switch&0xFF] = SDLK_MODE; /* "Alt Gr" key */
+
+ MISC_keymap[Pk_Help&0xFF] = SDLK_HELP;
+ MISC_keymap[Pk_Print&0xFF] = SDLK_PRINT;
+ MISC_keymap[Pk_Break&0xFF] = SDLK_BREAK;
+ MISC_keymap[Pk_Menu&0xFF] = SDLK_MENU; /* Windows "Menu" key */
+
+ MISC_keymap[Pk_Hyper_R&0xFF] = SDLK_RSUPER; /* Right "Windows" */
+
+ /* Left "Windows" key, but it can't be catched by application */
+ MISC_keymap[Pk_Hyper_L&0xFF] = SDLK_LSUPER;
+}
+
+static unsigned long cap;
+
+SDL_keysym *ph_TranslateKey(PhKeyEvent_t *key, SDL_keysym *keysym)
+{
+ /* 'sym' is set to the value of the key with modifiers applied to it.
+ This member is valid only if Pk_KF_Sym_Valid is set in the key_flags.
+ We will assume it is valid. */
+
+ /* FIXME: This needs to check whether the cap & scancode is valid */
+
+ cap = key->key_cap;
+
+ switch (cap>>8)
+ {
+ case 0x00: /* Latin 1 */
+ case 0x01: /* Latin 2 */
+ case 0x02: /* Latin 3 */
+ case 0x03: /* Latin 4 */
+ case 0x04: /* Katakana */
+ case 0x05: /* Arabic */
+ case 0x06: /* Cyrillic */
+ case 0x07: /* Greek */
+ case 0x08: /* Technical */
+ case 0x0A: /* Publishing */
+ case 0x0C: /* Hebrew */
+ case 0x0D: /* Thai */
+ keysym->sym = (SDLKey)(cap&0xFF);
+ /* Map capital letter syms to lowercase */
+ if ((keysym->sym >= 'A')&&(keysym->sym <= 'Z'))
+ keysym->sym += ('a'-'A');
+ break;
+ case 0xF0:
+ keysym->sym = MISC_keymap[cap&0xFF];
+ break;
+ default:
+ keysym->sym = SDLK_UNKNOWN;
+ break;
+ }
+
+ keysym->scancode = key->key_scan;
+ keysym->unicode = 0;
+
+ if (SDL_TranslateUNICODE)
+ {
+ char utf8[MB_CUR_MAX];
+ int utf8len;
+ wchar_t unicode;
+
+ switch (keysym->scancode)
+ {
+ /* Esc key */
+ case 0x01: keysym->unicode = 27;
+ break;
+ /* BackSpace key */
+ case 0x0E: keysym->unicode = 127;
+ break;
+ /* Enter key */
+ case 0x1C: keysym->unicode = 10;
+ break;
+ default:
+ utf8len = PhKeyToMb(utf8, key);
+ if (utf8len > 0)
+ {
+ utf8len = mbtowc(&unicode, utf8, utf8len);
+ if (utf8len > 0)
+ {
+ keysym->unicode = unicode;
+ }
+ }
+ break;
+ }
+
+ }
+
+ return (keysym);
+}
+
+void ph_InitOSKeymap(_THIS)
+{
+ ph_InitKeymap();
+}
diff --git a/distrib/sdl-1.2.15/src/video/photon/SDL_ph_events_c.h b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_events_c.h
new file mode 100644
index 0000000..4aa939b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_events_c.h
@@ -0,0 +1,37 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef __SDL_PH_EVENTS_H__
+#define __SDL_PH_EVENTS_H__
+
+#include "SDL_ph_video.h"
+
+#define PH_SDL_MAX_RECTS 256
+#define PH_EVENT_SAFETY_POOL 512
+#define EVENT_SIZE (sizeof(PhEvent_t) + 1000 + PH_EVENT_SAFETY_POOL)
+
+/* Functions to be exported */
+extern void ph_InitOSKeymap(_THIS);
+extern void ph_PumpEvents(_THIS);
+
+#endif /* __SDL_PH_EVENTS_H__ */
diff --git a/distrib/sdl-1.2.15/src/video/photon/SDL_ph_gl.c b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_gl.c
new file mode 100644
index 0000000..3121777
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_gl.c
@@ -0,0 +1,406 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <dlfcn.h>
+#include "SDL.h"
+#include "SDL_ph_gl.h"
+
+#if SDL_VIDEO_OPENGL
+
+#if (_NTO_VERSION >= 630)
+ /* PhotonGL functions */
+ GLPH_DECLARE_FUNCS;
+#endif /* 6.3.0 */
+
+#if (_NTO_VERSION < 630)
+void ph_GL_SwapBuffers(_THIS)
+{
+ PgSetRegion(PtWidgetRid(window));
+ PdOpenGLContextSwapBuffers(oglctx);
+}
+#else
+void ph_GL_SwapBuffers(_THIS)
+{
+ qnxgl_swap_buffers(oglbuffers);
+}
+#endif /* 6.3.0 */
+
+int ph_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
+{
+ switch (attrib)
+ {
+ case SDL_GL_DOUBLEBUFFER:
+ *value=this->gl_config.double_buffer;
+ break;
+ case SDL_GL_STENCIL_SIZE:
+ *value=this->gl_config.stencil_size;
+ break;
+ case SDL_GL_DEPTH_SIZE:
+ *value=this->gl_config.depth_size;
+ break;
+#if (_NTO_VERSION >= 630)
+ case SDL_GL_RED_SIZE:
+ *value=this->gl_config.red_size;
+ break;
+ case SDL_GL_GREEN_SIZE:
+ *value=this->gl_config.green_size;
+ break;
+ case SDL_GL_BLUE_SIZE:
+ *value=this->gl_config.blue_size;
+ break;
+ case SDL_GL_ALPHA_SIZE:
+ *value=this->gl_config.alpha_size;
+ break;
+ case SDL_GL_ACCUM_RED_SIZE:
+ *value=this->gl_config.accum_red_size;
+ break;
+ case SDL_GL_ACCUM_GREEN_SIZE:
+ *value=this->gl_config.accum_green_size;
+ break;
+ case SDL_GL_ACCUM_BLUE_SIZE:
+ *value=this->gl_config.accum_blue_size;
+ break;
+ case SDL_GL_ACCUM_ALPHA_SIZE:
+ *value=this->gl_config.accum_alpha_size;
+ break;
+ case SDL_GL_STEREO:
+ *value=this->gl_config.stereo;
+ break;
+#endif /* 6.3.0 */
+ default:
+ *value=0;
+ return(-1);
+ }
+ return 0;
+}
+
+#if (_NTO_VERSION < 630)
+int ph_GL_LoadLibrary(_THIS, const char* path)
+{
+ /* if code compiled with SDL_VIDEO_OPENGL, that mean that library already linked */
+ this->gl_config.driver_loaded = 1;
+
+ return 0;
+}
+#else
+int ph_GL_LoadLibrary(_THIS, const char* path)
+{
+ void* handle;
+ int dlopen_flags=RTLD_WORLD | RTLD_GROUP;
+
+ if (this->gl_config.dll_handle!=NULL)
+ {
+ return 0;
+ }
+
+ handle = dlopen(path, dlopen_flags);
+
+ if (handle==NULL)
+ {
+ SDL_SetError("ph_GL_LoadLibrary(): Could not load OpenGL library");
+ return -1;
+ }
+
+ this->gl_config.dll_handle = handle;
+ this->gl_config.driver_loaded = 1;
+
+ SDL_strlcpy(this->gl_config.driver_path, path, SDL_arraysize(this->gl_config.driver_path));
+
+ return 0;
+}
+#endif /* 6.3.0 */
+
+#if (_NTO_VERSION < 630)
+void* ph_GL_GetProcAddress(_THIS, const char* proc)
+{
+ return NULL;
+}
+#else
+void* ph_GL_GetProcAddress(_THIS, const char* proc)
+{
+ void* function;
+
+ if (this->gl_config.dll_handle==NULL)
+ {
+ ph_GL_LoadLibrary(this, DEFAULT_OPENGL);
+ if (this->gl_config.dll_handle==NULL)
+ {
+ return NULL;
+ }
+ }
+
+ function=qnxgl_get_func(proc, oglctx, 0);
+ if (function==NULL)
+ {
+ function=dlsym(this->gl_config.dll_handle, proc);
+ }
+
+ return function;
+}
+#endif /* 6.3.0 */
+
+#if (_NTO_VERSION < 630)
+int ph_GL_MakeCurrent(_THIS)
+{
+ PgSetRegion(PtWidgetRid(window));
+
+ if (oglctx!=NULL)
+ {
+ PhDCSetCurrent(oglctx);
+ }
+
+ return 0;
+}
+#else
+int ph_GL_MakeCurrent(_THIS)
+{
+ PgSetRegion(PtWidgetRid(window));
+
+ if (oglctx!=NULL)
+ {
+ if (qnxgl_set_current(oglctx) == -1)
+ {
+ return -1;
+ }
+ }
+
+ return 0;
+}
+#endif /* 6.3.0 */
+
+#if (_NTO_VERSION < 630)
+
+/* This code is actual for the Photon3D Runtime which was available prior to 6.3 only */
+
+int ph_SetupOpenGLContext(_THIS, int width, int height, int bpp, Uint32 flags)
+{
+ PhDim_t dim;
+ uint64_t OGLAttrib[PH_OGL_MAX_ATTRIBS];
+ int exposepost=0;
+ int OGLargc;
+
+ dim.w=width;
+ dim.h=height;
+
+ if ((oglctx!=NULL) && (oglflags==flags) && (oglbpp==bpp))
+ {
+ PdOpenGLContextResize(oglctx, &dim);
+ PhDCSetCurrent(oglctx);
+ return 0;
+ }
+ else
+ {
+ if (oglctx!=NULL)
+ {
+ PhDCSetCurrent(NULL);
+ PhDCRelease(oglctx);
+ oglctx=NULL;
+ exposepost=1;
+ }
+ }
+
+ OGLargc=0;
+ if (this->gl_config.depth_size)
+ {
+ OGLAttrib[OGLargc++]=PHOGL_ATTRIB_DEPTH_BITS;
+ OGLAttrib[OGLargc++]=this->gl_config.depth_size;
+ }
+ if (this->gl_config.stencil_size)
+ {
+ OGLAttrib[OGLargc++]=PHOGL_ATTRIB_STENCIL_BITS;
+ OGLAttrib[OGLargc++]=this->gl_config.stencil_size;
+ }
+ OGLAttrib[OGLargc++]=PHOGL_ATTRIB_FORCE_SW;
+ if (flags & SDL_FULLSCREEN)
+ {
+ OGLAttrib[OGLargc++]=PHOGL_ATTRIB_FULLSCREEN;
+ OGLAttrib[OGLargc++]=PHOGL_ATTRIB_DIRECT;
+ OGLAttrib[OGLargc++]=PHOGL_ATTRIB_FULLSCREEN_BEST;
+ OGLAttrib[OGLargc++]=PHOGL_ATTRIB_FULLSCREEN_CENTER;
+ }
+ OGLAttrib[OGLargc++]=PHOGL_ATTRIB_NONE;
+
+ if (this->gl_config.double_buffer)
+ {
+ oglctx=PdCreateOpenGLContext(2, &dim, 0, OGLAttrib);
+ }
+ else
+ {
+ oglctx=PdCreateOpenGLContext(1, &dim, 0, OGLAttrib);
+ }
+
+ if (oglctx==NULL)
+ {
+ SDL_SetError("ph_SetupOpenGLContext(): cannot create OpenGL context !\n");
+ return -1;
+ }
+
+ PhDCSetCurrent(oglctx);
+
+ PtFlush();
+
+ oglflags=flags;
+ oglbpp=bpp;
+
+ if (exposepost!=0)
+ {
+ /* OpenGL context has been recreated, so report about this fact */
+ SDL_PrivateExpose();
+ }
+
+ return 0;
+}
+
+#else /* _NTO_VERSION */
+
+/* This code is actual for the built-in PhGL support, which became available since 6.3 */
+
+int ph_SetupOpenGLContext(_THIS, int width, int height, int bpp, Uint32 flags)
+{
+ qnxgl_buf_attrib_t qnxgl_attribs[PH_OGL_MAX_ATTRIBS];
+ qnxgl_buf_attrib_t* qnxgl_attribs_slide;
+ int num_interfaces = 0;
+ int num_buffers = 0;
+
+ /* Initialize the OpenGL subsystem */
+
+ num_interfaces = qnxgl_init(NULL, NULL, 0);
+
+ if (num_interfaces < 0)
+ {
+ SDL_SetError("ph_SetupOpenGLContext(): cannot initialize OpenGL subsystem !\n");
+ return -1;
+ }
+ if (num_interfaces == 0)
+ {
+ SDL_SetError("ph_SetupOpenGLContext(): there are no available OpenGL renderers was found !\n");
+ return -1;
+ }
+
+ /* Driver is linked */
+ this->gl_config.driver_loaded=1;
+
+ /* Initialize the OpenGL context attributes */
+ qnxgl_attribs_slide=qnxgl_attribs;
+
+ /* Depth size */
+ if (this->gl_config.depth_size)
+ {
+ fprintf(stderr, "setted depth size %d\n", this->gl_config.depth_size);
+ qnxgl_attribs_slide = qnxgl_attrib_set_depth(qnxgl_attribs_slide, this->gl_config.depth_size);
+ }
+
+ /* Stencil size */
+ if (this->gl_config.stencil_size)
+ {
+ qnxgl_attribs_slide = qnxgl_attrib_set_stencil(qnxgl_attribs_slide, this->gl_config.stencil_size);
+ }
+
+ /* The sum of the accum bits of each channel */
+ if ((this->gl_config.accum_red_size != 0) && (this->gl_config.accum_blue_size != 0) &&
+ (this->gl_config.accum_green_size != 0))
+ {
+ qnxgl_attribs_slide = qnxgl_attrib_set_accum(qnxgl_attribs_slide,
+ this->gl_config.accum_red_size + this->gl_config.accum_blue_size +
+ this->gl_config.accum_green_size + this->gl_config.accum_alpha_size);
+ }
+
+ /* Stereo mode */
+ if (this->gl_config.stereo)
+ {
+ qnxgl_attribs_slide = qnxgl_attrib_set_stereo(qnxgl_attribs_slide);
+ }
+
+ /* Fullscreen mode */
+ if ((flags & SDL_FULLSCREEN) == SDL_FULLSCREEN)
+ {
+ qnxgl_attribs_slide = qnxgl_attrib_set_hint_fullscreen(qnxgl_attribs_slide);
+ }
+
+ /* Double buffering mode */
+ if (this->gl_config.double_buffer)
+ {
+ num_buffers=2;
+ }
+ else
+ {
+ num_buffers=1;
+ }
+
+ /* Loading the function pointers so we can use the extensions */
+ GLPH_LOAD_FUNCS_GC(oglctx);
+
+ /* Set the buffers region to be that of our window's region */
+ qnxgl_attribs_slide = glph_attrib_set_region(qnxgl_attribs_slide, PtWidgetRid(window));
+
+ /* End of the attributes array */
+ qnxgl_attribs_slide = qnxgl_attrib_set_end(qnxgl_attribs_slide);
+
+ /* Create the buffers with the specified color model */
+ fprintf(stderr, "ARGB: %d, %d, %d, %d\n", this->gl_config.alpha_size, this->gl_config.red_size, this->gl_config.green_size, this->gl_config.blue_size);
+ oglbuffers = qnxgl_buffers_create(
+ QNXGL_FORMAT_BEST_RGB,
+/* __QNXGL_BUILD_FORMAT(0, __QNXGL_COLOR_MODEL_RGB, this->gl_config.alpha_size,
+ this->gl_config.red_size, this->gl_config.green_size, this->gl_config.blue_size), */
+ num_buffers, width, height, qnxgl_attribs, -1);
+
+
+ if (oglbuffers == NULL)
+ {
+ SDL_SetError("ph_SetupOpenGLContext(): failed to create OpenGL buffers !\n");
+ qnxgl_finish();
+ return -1;
+ }
+
+ /* Create a QNXGL context for the previously created buffer */
+ oglctx = qnxgl_context_create(oglbuffers, NULL);
+
+ if (oglctx == NULL)
+ {
+ SDL_SetError("ph_SetupOpenGLContext(): failed to create OpenGL context !\n");
+ qnxgl_buffers_destroy(oglbuffers);
+ qnxgl_finish();
+ return -1;
+ }
+
+ /* Attempt to make the context current so we can use OpenGL commands */
+ if (qnxgl_set_current(oglctx) == -1)
+ {
+ SDL_SetError("ph_SetupOpenGLContext(): failed to make the OpenGL context current !\n");
+ qnxgl_context_destroy(oglctx);
+ qnxgl_buffers_destroy(oglbuffers);
+ qnxgl_finish();
+ return -1;
+ }
+
+ PtFlush();
+
+ oglflags=flags;
+ oglbpp=bpp;
+
+ return 0;
+}
+
+#endif /* _NTO_VERSION */
+
+#endif /* SDL_VIDEO_OPENGL */
diff --git a/distrib/sdl-1.2.15/src/video/photon/SDL_ph_gl.h b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_gl.h
new file mode 100644
index 0000000..1fb134a
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_gl.h
@@ -0,0 +1,41 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef __SDL_PH_GL_H__
+#define __SDL_PH_GL_H__
+
+#include "SDL_ph_video.h"
+
+#define DEFAULT_OPENGL "/usr/lib/libGL.so"
+
+#if SDL_VIDEO_OPENGL
+ void ph_GL_SwapBuffers(_THIS);
+ int ph_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
+ int ph_GL_LoadLibrary(_THIS, const char* path);
+ void* ph_GL_GetProcAddress(_THIS, const char* proc);
+ int ph_GL_MakeCurrent(_THIS);
+
+ int ph_SetupOpenGLContext(_THIS, int width, int height, int bpp, Uint32 flags);
+#endif /* SDL_VIDEO_OPENGL */
+
+#endif /* __SDL_PH_GL_H__ */
diff --git a/distrib/sdl-1.2.15/src/video/photon/SDL_ph_image.c b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_image.c
new file mode 100644
index 0000000..7d64970
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_image.c
@@ -0,0 +1,1059 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <Ph.h>
+#include <photon/Pg.h>
+
+#include "SDL_endian.h"
+#include "SDL_video.h"
+#include "../SDL_pixels_c.h"
+#include "SDL_ph_video.h"
+#include "SDL_ph_image_c.h"
+#include "SDL_ph_modes_c.h"
+#include "SDL_ph_gl.h"
+
+int ph_SetupImage(_THIS, SDL_Surface *screen)
+{
+ PgColor_t* palette=NULL;
+ int type=0;
+ int bpp;
+
+ bpp=screen->format->BitsPerPixel;
+
+ /* Determine image type */
+ switch(bpp)
+ {
+ case 8:{
+ type = Pg_IMAGE_PALETTE_BYTE;
+ }
+ break;
+ case 15:{
+ type = Pg_IMAGE_DIRECT_555;
+ }
+ break;
+ case 16:{
+ type = Pg_IMAGE_DIRECT_565;
+ }
+ break;
+ case 24:{
+ type = Pg_IMAGE_DIRECT_888;
+ }
+ break;
+ case 32:{
+ type = Pg_IMAGE_DIRECT_8888;
+ }
+ break;
+ default:{
+ SDL_SetError("ph_SetupImage(): unsupported bpp=%d !\n", bpp);
+ return -1;
+ }
+ break;
+ }
+
+ /* palette emulation code */
+ if ((bpp==8) && (desktoppal==SDLPH_PAL_EMULATE))
+ {
+ /* creating image palette */
+ palette=SDL_malloc(_Pg_MAX_PALETTE*sizeof(PgColor_t));
+ if (palette==NULL)
+ {
+ SDL_SetError("ph_SetupImage(): can't allocate memory for palette !\n");
+ return -1;
+ }
+ PgGetPalette(palette);
+
+ /* using shared memory for speed (set last param to 1) */
+ if ((SDL_Image = PhCreateImage(NULL, screen->w, screen->h, type, palette, _Pg_MAX_PALETTE, 1)) == NULL)
+ {
+ SDL_SetError("ph_SetupImage(): PhCreateImage() failed for bpp=8 !\n");
+ SDL_free(palette);
+ return -1;
+ }
+ }
+ else
+ {
+ /* using shared memory for speed (set last param to 1) */
+ if ((SDL_Image = PhCreateImage(NULL, screen->w, screen->h, type, NULL, 0, 1)) == NULL)
+ {
+ SDL_SetError("ph_SetupImage(): PhCreateImage() failed for bpp=%d !\n", bpp);
+ return -1;
+ }
+ }
+
+ screen->pixels = SDL_Image->image;
+ screen->pitch = SDL_Image->bpl;
+
+ this->UpdateRects = ph_NormalUpdate;
+
+ return 0;
+}
+
+int ph_SetupOCImage(_THIS, SDL_Surface *screen)
+{
+ int type = 0;
+ int bpp;
+
+ OCImage.flags = screen->flags;
+
+ bpp=screen->format->BitsPerPixel;
+
+ /* Determine image type */
+ switch(bpp)
+ {
+ case 8: {
+ type = Pg_IMAGE_PALETTE_BYTE;
+ }
+ break;
+ case 15:{
+ type = Pg_IMAGE_DIRECT_555;
+ }
+ break;
+ case 16:{
+ type = Pg_IMAGE_DIRECT_565;
+ }
+ break;
+ case 24:{
+ type = Pg_IMAGE_DIRECT_888;
+ }
+ break;
+ case 32:{
+ type = Pg_IMAGE_DIRECT_8888;
+ }
+ break;
+ default:{
+ SDL_SetError("ph_SetupOCImage(): unsupported bpp=%d !\n", bpp);
+ return -1;
+ }
+ break;
+ }
+
+ /* Currently offscreen contexts with the same bit depth as display bpp only can be created */
+ OCImage.offscreen_context = PdCreateOffscreenContext(0, screen->w, screen->h, Pg_OSC_MEM_PAGE_ALIGN);
+
+ if (OCImage.offscreen_context == NULL)
+ {
+ SDL_SetError("ph_SetupOCImage(): PdCreateOffscreenContext() function failed !\n");
+ return -1;
+ }
+
+ screen->pitch = OCImage.offscreen_context->pitch;
+
+ OCImage.dc_ptr = (unsigned char *)PdGetOffscreenContextPtr(OCImage.offscreen_context);
+
+ if (OCImage.dc_ptr == NULL)
+ {
+ SDL_SetError("ph_SetupOCImage(): PdGetOffscreenContextPtr function failed !\n");
+ PhDCRelease(OCImage.offscreen_context);
+ return -1;
+ }
+
+ OCImage.FrameData0 = OCImage.dc_ptr;
+ OCImage.CurrentFrameData = OCImage.FrameData0;
+ OCImage.current = 0;
+
+ PhDCSetCurrent(OCImage.offscreen_context);
+
+ screen->pixels = OCImage.CurrentFrameData;
+
+ this->UpdateRects = ph_OCUpdate;
+
+ return 0;
+}
+
+int ph_SetupFullScreenImage(_THIS, SDL_Surface* screen)
+{
+ OCImage.flags = screen->flags;
+
+ /* Begin direct and fullscreen mode */
+ if (!ph_EnterFullScreen(this, screen, PH_ENTER_DIRECTMODE))
+ {
+ return -1;
+ }
+
+ /* store palette for fullscreen */
+ if ((screen->format->BitsPerPixel==8) && (desktopbpp!=8))
+ {
+ PgGetPalette(savedpal);
+ PgGetPalette(syspalph);
+ }
+
+ OCImage.offscreen_context = PdCreateOffscreenContext(0, 0, 0, Pg_OSC_MAIN_DISPLAY | Pg_OSC_MEM_PAGE_ALIGN | Pg_OSC_CRTC_SAFE);
+ if (OCImage.offscreen_context == NULL)
+ {
+ SDL_SetError("ph_SetupFullScreenImage(): PdCreateOffscreenContext() function failed !\n");
+ return -1;
+ }
+
+ if ((screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF)
+ {
+ OCImage.offscreen_backcontext = PdDupOffscreenContext(OCImage.offscreen_context, Pg_OSC_MEM_PAGE_ALIGN | Pg_OSC_CRTC_SAFE);
+ if (OCImage.offscreen_backcontext == NULL)
+ {
+ SDL_SetError("ph_SetupFullScreenImage(): PdCreateOffscreenContext(back) function failed !\n");
+ return -1;
+ }
+ }
+
+ OCImage.FrameData0 = (unsigned char *)PdGetOffscreenContextPtr(OCImage.offscreen_context);
+ if (OCImage.FrameData0 == NULL)
+ {
+ SDL_SetError("ph_SetupFullScreenImage(): PdGetOffscreenContextPtr() function failed !\n");
+ ph_DestroyImage(this, screen);
+ return -1;
+ }
+
+ if ((screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF)
+ {
+ OCImage.FrameData1 = (unsigned char *)PdGetOffscreenContextPtr(OCImage.offscreen_backcontext);
+ if (OCImage.FrameData1 == NULL)
+ {
+ SDL_SetError("ph_SetupFullScreenImage(back): PdGetOffscreenContextPtr() function failed !\n");
+ ph_DestroyImage(this, screen);
+ return -1;
+ }
+ }
+
+ /* wait for the hardware */
+ PgFlush();
+ PgWaitHWIdle();
+
+ if ((screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF)
+ {
+ OCImage.current = 0;
+ PhDCSetCurrent(OCImage.offscreen_context);
+ screen->pitch = OCImage.offscreen_context->pitch;
+ screen->pixels = OCImage.FrameData0;
+
+ /* emulate 640x400 videomode */
+ if (videomode_emulatemode==1)
+ {
+ int i;
+
+ for (i=0; i<40; i++)
+ {
+ SDL_memset(screen->pixels+screen->pitch*i, 0x00, screen->pitch);
+ }
+ for (i=440; i<480; i++)
+ {
+ SDL_memset(screen->pixels+screen->pitch*i, 0x00, screen->pitch);
+ }
+ screen->pixels+=screen->pitch*40;
+ }
+ PgSwapDisplay(OCImage.offscreen_backcontext, 0);
+ }
+ else
+ {
+ OCImage.current = 0;
+ PhDCSetCurrent(OCImage.offscreen_context);
+ screen->pitch = OCImage.offscreen_context->pitch;
+ screen->pixels = OCImage.FrameData0;
+
+ /* emulate 640x400 videomode */
+ if (videomode_emulatemode==1)
+ {
+ int i;
+
+ for (i=0; i<40; i++)
+ {
+ SDL_memset(screen->pixels+screen->pitch*i, 0x00, screen->pitch);
+ }
+ for (i=440; i<480; i++)
+ {
+ SDL_memset(screen->pixels+screen->pitch*i, 0x00, screen->pitch);
+ }
+ screen->pixels+=screen->pitch*40;
+ }
+ }
+
+ this->UpdateRects = ph_OCDCUpdate;
+
+ /* wait for the hardware */
+ PgFlush();
+ PgWaitHWIdle();
+
+ return 0;
+}
+
+#if SDL_VIDEO_OPENGL
+
+int ph_SetupOpenGLImage(_THIS, SDL_Surface* screen)
+{
+ this->UpdateRects = ph_OpenGLUpdate;
+ screen->pixels=NULL;
+ screen->pitch=NULL;
+
+ #if (_NTO_VERSION >= 630)
+ if ((screen->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN)
+ {
+ if (!ph_EnterFullScreen(this, screen, PH_IGNORE_DIRECTMODE))
+ {
+ screen->flags &= ~SDL_FULLSCREEN;
+ return -1;
+ }
+ }
+ #endif /* 6.3.0 */
+
+ if (ph_SetupOpenGLContext(this, screen->w, screen->h, screen->format->BitsPerPixel, screen->flags)!=0)
+ {
+ screen->flags &= ~SDL_OPENGL;
+ return -1;
+ }
+
+ return 0;
+}
+
+#endif /* SDL_VIDEO_OPENGL */
+
+void ph_DestroyImage(_THIS, SDL_Surface* screen)
+{
+
+#if SDL_VIDEO_OPENGL
+ if ((screen->flags & SDL_OPENGL)==SDL_OPENGL)
+ {
+ if (oglctx)
+ {
+ #if (_NTO_VERSION < 630)
+ PhDCSetCurrent(NULL);
+ PhDCRelease(oglctx);
+ #else
+ qnxgl_context_destroy(oglctx);
+ qnxgl_buffers_destroy(oglbuffers);
+ qnxgl_finish();
+ #endif /* 6.3.0 */
+ oglctx=NULL;
+ oglbuffers=NULL;
+ oglflags=0;
+ oglbpp=0;
+ }
+
+ #if (_NTO_VERSION >= 630)
+ if (currently_fullscreen)
+ {
+ ph_LeaveFullScreen(this);
+ }
+ #endif /* 6.3.0 */
+
+ return;
+ }
+#endif /* SDL_VIDEO_OPENGL */
+
+ if (currently_fullscreen)
+ {
+ /* if we right now in 8bpp fullscreen we must release palette */
+ if ((screen->format->BitsPerPixel==8) && (desktopbpp!=8))
+ {
+ PgSetPalette(syspalph, 0, -1, 0, 0, 0);
+ PgSetPalette(savedpal, 0, 0, _Pg_MAX_PALETTE, Pg_PALSET_GLOBAL | Pg_PALSET_FORCE_EXPOSE, 0);
+ PgFlush();
+ }
+ ph_LeaveFullScreen(this);
+ }
+
+ if (OCImage.offscreen_context != NULL)
+ {
+ PhDCRelease(OCImage.offscreen_context);
+ OCImage.offscreen_context = NULL;
+ OCImage.FrameData0 = NULL;
+ }
+ if (OCImage.offscreen_backcontext != NULL)
+ {
+ PhDCRelease(OCImage.offscreen_backcontext);
+ OCImage.offscreen_backcontext = NULL;
+ OCImage.FrameData1 = NULL;
+ }
+ OCImage.CurrentFrameData = NULL;
+
+ if (SDL_Image)
+ {
+ /* if palette allocated, free it */
+ if (SDL_Image->palette)
+ {
+ SDL_free(SDL_Image->palette);
+ }
+ PgShmemDestroy(SDL_Image->image);
+ SDL_free(SDL_Image);
+ }
+
+ /* Must be zeroed everytime */
+ SDL_Image = NULL;
+
+ if (screen)
+ {
+ screen->pixels = NULL;
+ }
+}
+
+int ph_UpdateHWInfo(_THIS)
+{
+ PgVideoModeInfo_t vmode;
+ PgHWCaps_t hwcaps;
+
+ /* Update video ram amount */
+ if (PgGetGraphicsHWCaps(&hwcaps) < 0)
+ {
+ SDL_SetError("ph_UpdateHWInfo(): GetGraphicsHWCaps() function failed !\n");
+ return -1;
+ }
+ this->info.video_mem=hwcaps.currently_available_video_ram/1024;
+
+ /* obtain current mode capabilities */
+ if (PgGetVideoModeInfo(hwcaps.current_video_mode, &vmode) < 0)
+ {
+ SDL_SetError("ph_UpdateHWInfo(): GetVideoModeInfo() function failed !\n");
+ return -1;
+ }
+
+ if ((vmode.mode_capabilities1 & PgVM_MODE_CAP1_OFFSCREEN) == PgVM_MODE_CAP1_OFFSCREEN)
+ {
+ /* this is a special test for drivers which tries to lie about offscreen capability */
+ if (hwcaps.currently_available_video_ram!=0)
+ {
+ this->info.hw_available = 1;
+ }
+ else
+ {
+ this->info.hw_available = 0;
+ }
+ }
+ else
+ {
+ this->info.hw_available = 0;
+ }
+
+ if ((vmode.mode_capabilities2 & PgVM_MODE_CAP2_RECTANGLE) == PgVM_MODE_CAP2_RECTANGLE)
+ {
+ this->info.blit_fill = 1;
+ }
+ else
+ {
+ this->info.blit_fill = 0;
+ }
+
+ if ((vmode.mode_capabilities2 & PgVM_MODE_CAP2_BITBLT) == PgVM_MODE_CAP2_BITBLT)
+ {
+ this->info.blit_hw = 1;
+ }
+ else
+ {
+ this->info.blit_hw = 0;
+ }
+
+ if ((vmode.mode_capabilities2 & PgVM_MODE_CAP2_ALPHA_BLEND) == PgVM_MODE_CAP2_ALPHA_BLEND)
+ {
+ this->info.blit_hw_A = 1;
+ }
+ else
+ {
+ this->info.blit_hw_A = 0;
+ }
+
+ if ((vmode.mode_capabilities2 & PgVM_MODE_CAP2_CHROMA) == PgVM_MODE_CAP2_CHROMA)
+ {
+ this->info.blit_hw_CC = 1;
+ }
+ else
+ {
+ this->info.blit_hw_CC = 0;
+ }
+
+ return 0;
+}
+
+int ph_SetupUpdateFunction(_THIS, SDL_Surface* screen, Uint32 flags)
+{
+ int setupresult=-1;
+
+ ph_DestroyImage(this, screen);
+
+#if SDL_VIDEO_OPENGL
+ if ((flags & SDL_OPENGL)==SDL_OPENGL)
+ {
+ setupresult=ph_SetupOpenGLImage(this, screen);
+ }
+ else
+ {
+#endif
+ if ((flags & SDL_FULLSCREEN)==SDL_FULLSCREEN)
+ {
+ setupresult=ph_SetupFullScreenImage(this, screen);
+ }
+ else
+ {
+ if ((flags & SDL_HWSURFACE)==SDL_HWSURFACE)
+ {
+ setupresult=ph_SetupOCImage(this, screen);
+ }
+ else
+ {
+ setupresult=ph_SetupImage(this, screen);
+ }
+ }
+#if SDL_VIDEO_OPENGL
+ }
+#endif
+ if (setupresult!=-1)
+ {
+ ph_UpdateHWInfo(this);
+ }
+
+ return setupresult;
+}
+
+int ph_AllocHWSurface(_THIS, SDL_Surface* surface)
+{
+ PgHWCaps_t hwcaps;
+
+ if (surface->hwdata!=NULL)
+ {
+ SDL_SetError("ph_AllocHWSurface(): hwdata already exists!\n");
+ return -1;
+ }
+ surface->hwdata=SDL_malloc(sizeof(struct private_hwdata));
+ SDL_memset(surface->hwdata, 0x00, sizeof(struct private_hwdata));
+ surface->hwdata->offscreenctx=PdCreateOffscreenContext(0, surface->w, surface->h, Pg_OSC_MEM_PAGE_ALIGN);
+ if (surface->hwdata->offscreenctx == NULL)
+ {
+ SDL_SetError("ph_AllocHWSurface(): PdCreateOffscreenContext() function failed !\n");
+ return -1;
+ }
+ surface->pixels=PdGetOffscreenContextPtr(surface->hwdata->offscreenctx);
+ if (surface->pixels==NULL)
+ {
+ PhDCRelease(surface->hwdata->offscreenctx);
+ SDL_SetError("ph_AllocHWSurface(): PdGetOffscreenContextPtr() function failed !\n");
+ return -1;
+ }
+ surface->pitch=surface->hwdata->offscreenctx->pitch;
+ surface->flags|=SDL_HWSURFACE;
+ surface->flags|=SDL_PREALLOC;
+
+#if 0 /* FIXME */
+ /* create simple offscreen lock */
+ surface->hwdata->crlockparam.flags=0;
+ if (PdCreateOffscreenLock(surface->hwdata->offscreenctx, &surface->hwdata->crlockparam)!=EOK)
+ {
+ PhDCRelease(surface->hwdata->offscreenctx);
+ SDL_SetError("ph_AllocHWSurface(): Can't create offscreen lock !\n");
+ return -1;
+ }
+#endif /* 0 */
+
+ /* Update video ram amount */
+ if (PgGetGraphicsHWCaps(&hwcaps) < 0)
+ {
+ PdDestroyOffscreenLock(surface->hwdata->offscreenctx);
+ PhDCRelease(surface->hwdata->offscreenctx);
+ SDL_SetError("ph_AllocHWSurface(): GetGraphicsHWCaps() function failed !\n");
+ return -1;
+ }
+ this->info.video_mem=hwcaps.currently_available_video_ram/1024;
+
+ return 0;
+}
+
+void ph_FreeHWSurface(_THIS, SDL_Surface* surface)
+{
+ PgHWCaps_t hwcaps;
+
+ if (surface->hwdata==NULL)
+ {
+ SDL_SetError("ph_FreeHWSurface(): no hwdata!\n");
+ return;
+ }
+ if (surface->hwdata->offscreenctx == NULL)
+ {
+ SDL_SetError("ph_FreeHWSurface(): no offscreen context to delete!\n");
+ return;
+ }
+
+#if 0 /* FIXME */
+ /* unlock the offscreen context if it has been locked before destroy it */
+ if (PdIsOffscreenLocked(surface->hwdata->offscreenctx)==Pg_OSC_LOCKED)
+ {
+ PdUnlockOffscreen(surface->hwdata->offscreenctx);
+ }
+
+ PdDestroyOffscreenLock(surface->hwdata->offscreenctx);
+#endif /* 0 */
+
+ PhDCRelease(surface->hwdata->offscreenctx);
+
+ SDL_free(surface->hwdata);
+ surface->hwdata=NULL;
+
+ /* Update video ram amount */
+ if (PgGetGraphicsHWCaps(&hwcaps) < 0)
+ {
+ SDL_SetError("ph_FreeHWSurface(): GetGraphicsHWCaps() function failed !\n");
+ return;
+ }
+ this->info.video_mem=hwcaps.currently_available_video_ram/1024;
+
+ return;
+}
+
+int ph_CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst)
+{
+ if ((src->hwdata==NULL) && (src != this->screen))
+ {
+ SDL_SetError("ph_CheckHWBlit(): Source surface haven't hardware specific data.\n");
+ src->flags&=~SDL_HWACCEL;
+ return -1;
+ }
+ if ((src->flags & SDL_HWSURFACE) != SDL_HWSURFACE)
+ {
+ SDL_SetError("ph_CheckHWBlit(): Source surface isn't a hardware surface.\n");
+ src->flags&=~SDL_HWACCEL;
+ return -1;
+ }
+
+ if ((src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY)
+ {
+ if (this->info.blit_hw_CC!=1)
+ {
+ src->flags&=~SDL_HWACCEL;
+ src->map->hw_blit=NULL;
+ return -1;
+ }
+ }
+
+ if ((src->flags & SDL_SRCALPHA) == SDL_SRCALPHA)
+ {
+ if (this->info.blit_hw_A!=1)
+ {
+ src->flags&=~SDL_HWACCEL;
+ src->map->hw_blit=NULL;
+ return -1;
+ }
+ }
+
+ src->flags|=SDL_HWACCEL;
+ src->map->hw_blit = ph_HWAccelBlit;
+
+ return 1;
+}
+
+PgColor_t ph_ExpandColor(_THIS, SDL_Surface* surface, Uint32 color)
+{
+ Uint32 truecolor;
+
+ /* Photon API accepts true colors only during hw filling operations */
+ switch(surface->format->BitsPerPixel)
+ {
+ case 8:
+ {
+ if ((surface->format->palette) && (color<=surface->format->palette->ncolors))
+ {
+ truecolor=PgRGB(surface->format->palette->colors[color].r,
+ surface->format->palette->colors[color].g,
+ surface->format->palette->colors[color].b);
+ }
+ else
+ {
+ SDL_SetError("ph_ExpandColor(): Color out of range for the 8bpp mode !\n");
+ return 0xFFFFFFFFUL;
+ }
+ }
+ break;
+ case 15:
+ {
+ truecolor = ((color & 0x00007C00UL) << 9) | /* R */
+ ((color & 0x000003E0UL) << 6) | /* G */
+ ((color & 0x0000001FUL) << 3) | /* B */
+ ((color & 0x00007000UL) << 4) | /* R compensation */
+ ((color & 0x00000380UL) << 1) | /* G compensation */
+ ((color & 0x0000001CUL) >> 2); /* B compensation */
+ }
+ break;
+ case 16:
+ {
+ truecolor = ((color & 0x0000F800UL) << 8) | /* R */
+ ((color & 0x000007E0UL) << 5) | /* G */
+ ((color & 0x0000001FUL) << 3) | /* B */
+ ((color & 0x0000E000UL) << 3) | /* R compensation */
+ ((color & 0x00000600UL) >> 1) | /* G compensation */
+ ((color & 0x0000001CUL) >> 2); /* B compensation */
+
+ }
+ break;
+ case 24:
+ {
+ truecolor=color & 0x00FFFFFFUL;
+ }
+ break;
+ case 32:
+ {
+ truecolor=color;
+ }
+ break;
+ default:
+ {
+ SDL_SetError("ph_ExpandColor(): Unsupported depth for the hardware operations !\n");
+ return 0xFFFFFFFFUL;
+ }
+ }
+
+ return truecolor;
+}
+
+int ph_FillHWRect(_THIS, SDL_Surface* surface, SDL_Rect* rect, Uint32 color)
+{
+ PgColor_t oldcolor;
+ Uint32 truecolor;
+ int ydisp=0;
+
+ if (this->info.blit_fill!=1)
+ {
+ return -1;
+ }
+
+ truecolor=ph_ExpandColor(this, surface, color);
+ if (truecolor==0xFFFFFFFFUL)
+ {
+ return -1;
+ }
+
+ oldcolor=PgSetFillColor(truecolor);
+
+ /* 640x400 videomode emulation */
+ if (videomode_emulatemode==1)
+ {
+ ydisp+=40;
+ }
+
+ PgDrawIRect(rect->x, rect->y+ydisp, rect->w+rect->x-1, rect->h+rect->y+ydisp-1, Pg_DRAW_FILL);
+ PgSetFillColor(oldcolor);
+ PgFlush();
+ PgWaitHWIdle();
+
+ return 0;
+}
+
+int ph_FlipHWSurface(_THIS, SDL_Surface* screen)
+{
+ PhArea_t farea;
+
+ if ((screen->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN)
+ {
+ /* flush all drawing ops before blitting */
+ PgFlush();
+ PgWaitHWIdle();
+
+ farea.pos.x=0;
+ farea.pos.y=0;
+ farea.size.w=screen->w;
+ farea.size.h=screen->h;
+
+ /* emulate 640x400 videomode */
+ if (videomode_emulatemode==1)
+ {
+ farea.pos.y+=40;
+ }
+
+ PgContextBlitArea(OCImage.offscreen_context, &farea, OCImage.offscreen_backcontext, &farea);
+
+ /* flush the blitting */
+ PgFlush();
+ PgWaitHWIdle();
+ }
+ return 0;
+}
+
+int ph_LockHWSurface(_THIS, SDL_Surface* surface)
+{
+
+#if 0 /* FIXME */
+ int lockresult;
+
+ if (surface->hwdata == NULL)
+ {
+ return;
+ }
+
+ surface->hwdata->lockparam.flags=0;
+ surface->hwdata->lockparam.time_out=NULL;
+ lockresult=PdLockOffscreen(surface->hwdata->offscreenctx, &surface->hwdata->lockparam);
+
+ switch (lockresult)
+ {
+ case EOK:
+ break;
+ case Pg_OSC_LOCK_DEADLOCK:
+ SDL_SetError("ph_LockHWSurface(): Deadlock detected !\n");
+ return -1;
+ case Pg_OSC_LOCK_INVALID:
+ SDL_SetError("ph_LockHWSurface(): Lock invalid !\n");
+ return -1;
+ default:
+ SDL_SetError("ph_LockHWSurface(): Can't lock the surface !\n");
+ return -1;
+ }
+#endif /* 0 */
+
+ return 0;
+}
+
+void ph_UnlockHWSurface(_THIS, SDL_Surface* surface)
+{
+
+#if 0 /* FIXME */
+ int unlockresult;
+
+ if ((surface == NULL) || (surface->hwdata == NULL))
+ {
+ return;
+ }
+
+ if (PdIsOffscreenLocked(surface->hwdata->offscreenctx)==Pg_OSC_LOCKED)
+ {
+ unlockresult=PdUnlockOffscreen(surface->hwdata->offscreenctx);
+ }
+#endif /* 0 */
+
+ return;
+}
+
+int ph_HWAccelBlit(SDL_Surface* src, SDL_Rect* srcrect, SDL_Surface* dst, SDL_Rect* dstrect)
+{
+ SDL_VideoDevice* this=current_video;
+ PhArea_t srcarea;
+ PhArea_t dstarea;
+ int ydisp=0;
+
+ /* 640x400 videomode emulation */
+ if (videomode_emulatemode==1)
+ {
+ ydisp+=40;
+ }
+
+ srcarea.pos.x=srcrect->x;
+ srcarea.pos.y=srcrect->y;
+ srcarea.size.w=srcrect->w;
+ srcarea.size.h=srcrect->h;
+
+ dstarea.pos.x=dstrect->x;
+ dstarea.pos.y=dstrect->y;
+ dstarea.size.w=dstrect->w;
+ dstarea.size.h=dstrect->h;
+
+ if (((src == this->screen) || (src->hwdata!=NULL)) && ((dst == this->screen) || (dst->hwdata!=NULL)))
+ {
+ if ((src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY)
+ {
+ ph_SetHWColorKey(this, src, src->format->colorkey);
+ PgChromaOn();
+ }
+
+ if ((src->flags & SDL_SRCALPHA) == SDL_SRCALPHA)
+ {
+ ph_SetHWAlpha(this, src, src->format->alpha);
+ PgAlphaOn();
+ }
+
+ if (dst == this->screen)
+ {
+ if (src == this->screen)
+ {
+ /* blitting from main screen to main screen */
+ dstarea.pos.y+=ydisp;
+ srcarea.pos.y+=ydisp;
+ PgContextBlitArea(OCImage.offscreen_context, &srcarea, OCImage.offscreen_context, &dstarea);
+ }
+ else
+ {
+ /* blitting from offscreen to main screen */
+ dstarea.pos.y+=ydisp;
+ PgContextBlitArea(src->hwdata->offscreenctx, &srcarea, OCImage.offscreen_context, &dstarea);
+ }
+ }
+ else
+ {
+ if (src == this->screen)
+ {
+ /* blitting from main screen to offscreen */
+ srcarea.pos.y+=ydisp;
+ PgContextBlitArea(OCImage.offscreen_context, &srcarea, dst->hwdata->offscreenctx, &dstarea);
+ }
+ else
+ {
+ /* blitting offscreen to offscreen */
+ PgContextBlitArea(src->hwdata->offscreenctx, &srcarea, dst->hwdata->offscreenctx, &dstarea);
+ }
+ }
+
+ if ((src->flags & SDL_SRCALPHA) == SDL_SRCALPHA)
+ {
+ PgAlphaOff();
+ }
+
+ if ((src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY)
+ {
+ PgChromaOff();
+ }
+ }
+ else
+ {
+ SDL_SetError("ph_HWAccelBlit(): Source or target surface is not a hardware surface !\n");
+ return -1;
+ }
+
+ PgFlush();
+ PgWaitHWIdle();
+
+ return 0;
+}
+
+int ph_SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key)
+{
+ if (this->info.blit_hw_CC!=1)
+ {
+ return -1;
+ }
+
+ if (surface->hwdata!=NULL)
+ {
+ surface->hwdata->colorkey=ph_ExpandColor(this, surface, key);
+ if (surface->hwdata->colorkey==0xFFFFFFFFUL)
+ {
+ return -1;
+ }
+ }
+ PgSetChroma(surface->hwdata->colorkey, Pg_CHROMA_SRC_MATCH | Pg_CHROMA_NODRAW);
+
+ return 0;
+}
+
+int ph_SetHWAlpha(_THIS, SDL_Surface* surface, Uint8 alpha)
+{
+ if (this->info.blit_hw_A!=1)
+ {
+ return -1;
+ }
+
+ PgSetAlphaBlend(NULL, alpha);
+
+ return 0;
+}
+
+#if SDL_VIDEO_OPENGL
+void ph_OpenGLUpdate(_THIS, int numrects, SDL_Rect* rects)
+{
+ this->GL_SwapBuffers(this);
+
+ return;
+}
+#endif /* SDL_VIDEO_OPENGL */
+
+void ph_NormalUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+ PhPoint_t ph_pos;
+ PhRect_t ph_rect;
+ int i;
+
+ for (i=0; i<numrects; ++i)
+ {
+ if (rects[i].w==0) /* Clipped? dunno why but this occurs sometime. */
+ {
+ continue;
+ }
+
+ if (rects[i].h==0) /* Clipped? dunno why but this occurs sometime. */
+ {
+ continue;
+ }
+
+ ph_pos.x = rects[i].x;
+ ph_pos.y = rects[i].y;
+ ph_rect.ul.x = rects[i].x;
+ ph_rect.ul.y = rects[i].y;
+ ph_rect.lr.x = rects[i].x + rects[i].w;
+ ph_rect.lr.y = rects[i].y + rects[i].h;
+
+ if (PgDrawPhImageRectmx(&ph_pos, SDL_Image, &ph_rect, 0) < 0)
+ {
+ SDL_SetError("ph_NormalUpdate(): PgDrawPhImageRectmx failed!\n");
+ return;
+ }
+ }
+
+ if (PgFlush() < 0)
+ {
+ SDL_SetError("ph_NormalUpdate(): PgFlush() function failed!\n");
+ }
+}
+
+void ph_OCUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+ int i;
+
+ PhPoint_t zero = {0, 0};
+ PhArea_t src_rect;
+ PhArea_t dest_rect;
+
+ PgSetTranslation(&zero, 0);
+ PgSetRegion(PtWidgetRid(window));
+ PgSetClipping(0, NULL);
+
+ PgFlush();
+ PgWaitHWIdle();
+
+ for (i=0; i<numrects; ++i)
+ {
+ if (rects[i].w == 0) /* Clipped? */
+ {
+ continue;
+ }
+
+ if (rects[i].h == 0) /* Clipped? */
+ {
+ continue;
+ }
+
+ src_rect.pos.x=rects[i].x;
+ src_rect.pos.y=rects[i].y;
+ dest_rect.pos.x=rects[i].x;
+ dest_rect.pos.y=rects[i].y;
+
+ src_rect.size.w=rects[i].w;
+ src_rect.size.h=rects[i].h;
+ dest_rect.size.w=rects[i].w;
+ dest_rect.size.h=rects[i].h;
+
+ PgContextBlitArea(OCImage.offscreen_context, &src_rect, NULL, &dest_rect);
+ }
+
+ if (PgFlush() < 0)
+ {
+ SDL_SetError("ph_OCUpdate(): PgFlush failed.\n");
+ }
+}
+
+void ph_OCDCUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+ PgWaitHWIdle();
+
+ if (PgFlush() < 0)
+ {
+ SDL_SetError("ph_OCDCUpdate(): PgFlush failed.\n");
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/photon/SDL_ph_image_c.h b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_image_c.h
new file mode 100644
index 0000000..cfd9669
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_image_c.h
@@ -0,0 +1,59 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef __SDL_PH_IMAGE_H__
+#define __SDL_PH_IMAGE_H__
+
+#include "../../events/SDL_events_c.h"
+#include "SDL_ph_video.h"
+
+struct private_hwdata
+{
+ PdOffscreenContext_t* offscreenctx;
+ PdOSCCreateLockParams_t crlockparam;
+ PdOSCLockParams_t lockparam;
+ Uint32 colorkey;
+};
+
+extern int ph_SetupImage(_THIS, SDL_Surface* screen);
+extern void ph_DestroyImage(_THIS, SDL_Surface* screen);
+extern int ph_SetupUpdateFunction(_THIS, SDL_Surface* screen, Uint32 flags);
+
+extern int ph_AllocHWSurface(_THIS, SDL_Surface* surface);
+extern void ph_FreeHWSurface(_THIS, SDL_Surface* surface);
+extern int ph_CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst);
+extern int ph_FillHWRect(_THIS, SDL_Surface* surface, SDL_Rect* rect, Uint32 color);
+extern int ph_LockHWSurface(_THIS, SDL_Surface* surface);
+extern void ph_UnlockHWSurface(_THIS, SDL_Surface* surface);
+extern int ph_FlipHWSurface(_THIS, SDL_Surface* surface);
+extern int ph_SetHWColorKey(_THIS, SDL_Surface* surface, Uint32 key);
+extern int ph_SetHWAlpha(_THIS, SDL_Surface* surface, Uint8 alpha);
+extern int ph_HWAccelBlit(SDL_Surface* src, SDL_Rect *srcrect, SDL_Surface* dst, SDL_Rect* dstrect);
+extern int ph_UpdateHWInfo(_THIS);
+
+extern void ph_NormalUpdate(_THIS, int numrects, SDL_Rect* rects);
+extern void ph_OCUpdate(_THIS, int numrects, SDL_Rect* rects);
+extern void ph_OCDCUpdate(_THIS, int numrects, SDL_Rect* rects);
+extern void ph_OpenGLUpdate(_THIS, int numrects, SDL_Rect* rects);
+
+#endif /* __SDL_PH_IMAGE_H__ */
diff --git a/distrib/sdl-1.2.15/src/video/photon/SDL_ph_modes.c b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_modes.c
new file mode 100644
index 0000000..8c2bf7e
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_modes.c
@@ -0,0 +1,390 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_ph_modes_c.h"
+
+static PgVideoModeInfo_t mode_info;
+static PgVideoModes_t mode_list;
+
+/* The current list of available video modes */
+SDL_Rect SDL_modelist[PH_MAX_VIDEOMODES];
+SDL_Rect* SDL_modearray[PH_MAX_VIDEOMODES];
+
+static int compare_modes_by_res(const void* mode1, const void* mode2)
+{
+ PgVideoModeInfo_t mode1_info;
+ PgVideoModeInfo_t mode2_info;
+
+ if (PgGetVideoModeInfo(*(unsigned short*)mode1, &mode1_info) < 0)
+ {
+ return 0;
+ }
+
+ if (PgGetVideoModeInfo(*(unsigned short*)mode2, &mode2_info) < 0)
+ {
+ return 0;
+ }
+
+ if (mode1_info.width == mode2_info.width)
+ {
+ return mode2_info.height - mode1_info.height;
+ }
+ else
+ {
+ return mode2_info.width - mode1_info.width;
+ }
+}
+
+SDL_Rect **ph_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ int i = 0;
+ int j = 0;
+ SDL_Rect Amodelist[PH_MAX_VIDEOMODES];
+
+ for (i=0; i<PH_MAX_VIDEOMODES; i++)
+ {
+ SDL_modearray[i]=&SDL_modelist[i];
+ }
+
+ if (PgGetVideoModeList(&mode_list) < 0)
+ {
+ SDL_SetError("ph_ListModes(): PgGetVideoModeList() function failed !\n");
+ return NULL;
+ }
+
+ mode_info.bits_per_pixel = 0;
+
+ for (i=0; i < mode_list.num_modes; i++)
+ {
+ if (PgGetVideoModeInfo(mode_list.modes[i], &mode_info) < 0)
+ {
+ SDL_SetError("ph_ListModes(): PgGetVideoModeInfo() function failed on mode: 0x%X.\n", mode_list.modes[i]);
+ return NULL;
+ }
+ if(mode_info.bits_per_pixel == format->BitsPerPixel)
+ {
+ Amodelist[j].w = mode_info.width;
+ Amodelist[j].h = mode_info.height;
+ Amodelist[j].x = 0;
+ Amodelist[j].y = 0;
+ j++;
+ }
+ }
+
+ /* reorder biggest for smallest, assume width dominates */
+
+ for(i=0; i<j; i++)
+ {
+ SDL_modelist[i].w = Amodelist[j - i - 1].w;
+ SDL_modelist[i].h = Amodelist[j - i - 1].h;
+ SDL_modelist[i].x = Amodelist[j - i - 1].x;
+ SDL_modelist[i].y = Amodelist[j - i - 1].y;
+ }
+ SDL_modearray[j]=NULL;
+
+ return SDL_modearray;
+}
+
+void ph_FreeVideoModes(_THIS)
+{
+ return;
+}
+
+/* return the mode associated with width, height and bpp */
+/* if there is no mode then zero is returned */
+int ph_GetVideoMode(int width, int height, int bpp)
+{
+ int i;
+ int modestage=0;
+ int closestmode=0;
+
+ if (PgGetVideoModeList(&mode_list) < 0)
+ {
+ return -1;
+ }
+
+ /* special case for the double-sized 320x200 mode */
+ if ((width==640) && (height==400))
+ {
+ modestage=1;
+ }
+
+ /* search list for exact match */
+ for (i=0; i<mode_list.num_modes; i++)
+ {
+ if (PgGetVideoModeInfo(mode_list.modes[i], &mode_info) < 0)
+ {
+ return 0;
+ }
+
+ if ((mode_info.width == width) && (mode_info.height == height) &&
+ (mode_info.bits_per_pixel == bpp))
+ {
+ return mode_list.modes[i];
+ }
+ else
+ {
+ if ((modestage) && (mode_info.width == width) && (mode_info.height == height+80) &&
+ (mode_info.bits_per_pixel == bpp))
+ {
+ modestage=2;
+ closestmode=mode_list.modes[i];
+ }
+ }
+ }
+
+ /* if we are here, then no 640x400xbpp mode found and we'll emulate it via 640x480xbpp mode */
+ if (modestage==2)
+ {
+ return closestmode;
+ }
+
+ return (i == mode_list.num_modes) ? 0 : mode_list.modes[i];
+}
+
+/* return the mode associated with width, height and bpp */
+/* if requested bpp is not found the mode with closest bpp is returned */
+int get_mode_any_format(int width, int height, int bpp)
+{
+ int i, closest, delta, min_delta;
+
+ if (PgGetVideoModeList(&mode_list) < 0)
+ {
+ return -1;
+ }
+
+ SDL_qsort(mode_list.modes, mode_list.num_modes, sizeof(unsigned short), compare_modes_by_res);
+
+ for(i=0;i<mode_list.num_modes;i++)
+ {
+ if (PgGetVideoModeInfo(mode_list.modes[i], &mode_info) < 0)
+ {
+ return 0;
+ }
+ if ((mode_info.width == width) && (mode_info.height == height))
+ {
+ break;
+ }
+ }
+
+ if (i<mode_list.num_modes)
+ {
+ /* get closest bpp */
+ closest = i++;
+ if (mode_info.bits_per_pixel == bpp)
+ {
+ return mode_list.modes[closest];
+ }
+
+ min_delta = abs(mode_info.bits_per_pixel - bpp);
+
+ while(1)
+ {
+ if (PgGetVideoModeInfo(mode_list.modes[i], &mode_info) < 0)
+ {
+ return 0;
+ }
+
+ if ((mode_info.width != width) || (mode_info.height != height))
+ {
+ break;
+ }
+ else
+ {
+ if (mode_info.bits_per_pixel == bpp)
+ {
+ closest = i;
+ break;
+ }
+ else
+ {
+ delta = abs(mode_info.bits_per_pixel - bpp);
+ if (delta < min_delta)
+ {
+ closest = i;
+ min_delta = delta;
+ }
+ i++;
+ }
+ }
+ }
+ return mode_list.modes[closest];
+ }
+
+ return 0;
+}
+
+int ph_ToggleFullScreen(_THIS, int on)
+{
+ return -1;
+}
+
+int ph_EnterFullScreen(_THIS, SDL_Surface* screen, int fmode)
+{
+ PgDisplaySettings_t settings;
+ int mode;
+ char* refreshrate;
+ int refreshratenum;
+
+ if (!currently_fullscreen)
+ {
+ /* Get the video mode and set it */
+ if (screen->flags & SDL_ANYFORMAT)
+ {
+ if ((mode = get_mode_any_format(screen->w, screen->h, screen->format->BitsPerPixel)) == 0)
+ {
+ SDL_SetError("ph_EnterFullScreen(): can't find appropriate video mode !\n");
+ return 0;
+ }
+ }
+ else
+ {
+ if ((mode = ph_GetVideoMode(screen->w, screen->h, screen->format->BitsPerPixel)) == 0)
+ {
+ SDL_SetError("ph_EnterFullScreen(): can't find appropriate video mode !\n");
+ return 0;
+ }
+ if (PgGetVideoModeInfo(mode, &mode_info) < 0)
+ {
+ SDL_SetError("ph_EnterFullScreen(): can't get video mode capabilities !\n");
+ return 0;
+ }
+ if (mode_info.height != screen->h)
+ {
+ if ((mode_info.height==480) && (screen->h==400))
+ {
+ videomode_emulatemode=1;
+ }
+ }
+ else
+ {
+ videomode_emulatemode=0;
+ }
+ }
+
+ /* save old video mode caps */
+ PgGetVideoMode(&settings);
+ old_video_mode=settings.mode;
+ old_refresh_rate=settings.refresh;
+
+ /* setup new video mode */
+ settings.mode = mode;
+ settings.refresh = 0;
+ settings.flags = 0;
+
+ refreshrate=SDL_getenv("SDL_PHOTON_FULLSCREEN_REFRESH");
+ if (refreshrate!=NULL)
+ {
+ if (SDL_sscanf(refreshrate, "%d", &refreshratenum)==1)
+ {
+ settings.refresh = refreshratenum;
+ }
+ }
+
+ if (PgSetVideoMode(&settings) < 0)
+ {
+ SDL_SetError("ph_EnterFullScreen(): PgSetVideoMode() call failed !\n");
+ return 0;
+ }
+
+ if (this->screen)
+ {
+ if ((this->screen->flags & SDL_OPENGL)==SDL_OPENGL)
+ {
+#if !SDL_VIDEO_OPENGL || (_NTO_VERSION < 630)
+ return 0; /* 6.3.0 */
+#endif
+ }
+ }
+
+ if (fmode==0)
+ {
+ if (OCImage.direct_context==NULL)
+ {
+ OCImage.direct_context=(PdDirectContext_t*)PdCreateDirectContext();
+ if (!OCImage.direct_context)
+ {
+ SDL_SetError("ph_EnterFullScreen(): Can't create direct context !\n");
+ ph_LeaveFullScreen(this);
+ return 0;
+ }
+ }
+ OCImage.oldDC=PdDirectStart(OCImage.direct_context);
+ }
+
+ currently_fullscreen = 1;
+ }
+ PgFlush();
+
+ return 1;
+}
+
+int ph_LeaveFullScreen(_THIS)
+{
+ PgDisplaySettings_t oldmode_settings;
+
+ if (currently_fullscreen)
+ {
+ if ((this->screen) && ((this->screen->flags & SDL_OPENGL)==SDL_OPENGL))
+ {
+#if !SDL_VIDEO_OPENGL || (_NTO_VERSION < 630)
+ return 0;
+#endif
+ }
+
+ /* release routines starts here */
+ {
+ if (OCImage.direct_context)
+ {
+ PdDirectStop(OCImage.direct_context);
+ PdReleaseDirectContext(OCImage.direct_context);
+ OCImage.direct_context=NULL;
+ }
+ if (OCImage.oldDC)
+ {
+ PhDCSetCurrent(OCImage.oldDC);
+ OCImage.oldDC=NULL;
+ }
+
+ currently_fullscreen=0;
+
+ /* Restore old video mode */
+ if (old_video_mode != -1)
+ {
+ oldmode_settings.mode = (unsigned short) old_video_mode;
+ oldmode_settings.refresh = (unsigned short) old_refresh_rate;
+ oldmode_settings.flags = 0;
+
+ if (PgSetVideoMode(&oldmode_settings) < 0)
+ {
+ SDL_SetError("Ph_LeaveFullScreen(): PgSetVideoMode() function failed !\n");
+ return 0;
+ }
+ }
+
+ old_video_mode=-1;
+ old_refresh_rate=-1;
+ }
+ }
+ return 1;
+}
diff --git a/distrib/sdl-1.2.15/src/video/photon/SDL_ph_modes_c.h b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_modes_c.h
new file mode 100644
index 0000000..117c5a3
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_modes_c.h
@@ -0,0 +1,43 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef __SDL_PH_MODES_H__
+#define __SDL_PH_MODES_H__
+
+#include "SDL_ph_video.h"
+
+#define PH_MAX_VIDEOMODES 127
+
+#define PH_ENTER_DIRECTMODE 0
+#define PH_IGNORE_DIRECTMODE 1
+
+extern SDL_Rect **ph_ListModes(_THIS,SDL_PixelFormat *format, Uint32 flags);
+extern void ph_FreeVideoModes(_THIS);
+extern int ph_ResizeFullScreen(_THIS);
+extern int ph_EnterFullScreen(_THIS, SDL_Surface* screen, int fmode);
+extern int ph_LeaveFullScreen(_THIS);
+extern int ph_GetVideoMode(int width, int height, int bpp);
+extern int get_mode_any_format(int width, int height, int bpp);
+extern int ph_ToggleFullScreen(_THIS, int on);
+
+#endif /* __SDL_PH_MODES_H__ */
diff --git a/distrib/sdl-1.2.15/src/video/photon/SDL_ph_mouse.c b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_mouse.c
new file mode 100644
index 0000000..a25aa1f
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_mouse.c
@@ -0,0 +1,220 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_mouse.h"
+#include "../../events/SDL_events_c.h"
+#include "../SDL_cursor_c.h"
+#include "SDL_ph_mouse_c.h"
+
+struct WMcursor
+{
+ PhCursorDef_t *ph_cursor ;
+};
+
+void ph_FreeWMCursor(_THIS, WMcursor *cursor)
+{
+ if (window != NULL)
+ {
+ SDL_Lock_EventThread();
+
+ if (PtSetResource(window, Pt_ARG_CURSOR_TYPE, Ph_CURSOR_INHERIT, 0) < 0)
+ {
+ /* TODO: output error msg */
+ }
+
+ SDL_Unlock_EventThread();
+ }
+
+ SDL_free(cursor);
+}
+
+WMcursor *ph_CreateWMCursor(_THIS, Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
+{
+ WMcursor* cursor;
+ int clen, i;
+ unsigned char bit, databit, maskbit;
+
+ /* Allocate and initialize the cursor memory */
+ if ((cursor = (WMcursor*)SDL_malloc(sizeof(WMcursor))) == NULL)
+ {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ SDL_memset(cursor,0,sizeof(WMcursor));
+
+ cursor->ph_cursor = (PhCursorDef_t *) SDL_malloc(sizeof(PhCursorDef_t) + 32*4*2);
+
+ if (cursor->ph_cursor == NULL)
+ {
+ SDL_SetError("ph_CreateWMCursor(): cursor malloc failed !\n");
+ return NULL;
+ }
+
+ SDL_memset(cursor->ph_cursor,0,(sizeof(PhCursorDef_t) + 32*4*2));
+
+ cursor->ph_cursor->hdr.type =Ph_RDATA_CURSOR;
+ cursor->ph_cursor->size1.x = (short)w;
+ cursor->ph_cursor->size1.y = (short)h;
+ cursor->ph_cursor->offset1.x = (short)hot_x;
+ cursor->ph_cursor->offset1.y = (short)hot_y;
+ cursor->ph_cursor->bytesperline1 = (char)w/8;
+ cursor->ph_cursor->color1 = Pg_WHITE;
+ cursor->ph_cursor->size2.x = (short)w;
+ cursor->ph_cursor->size2.y = (short)h;
+ cursor->ph_cursor->offset2.x = (short)hot_x;
+ cursor->ph_cursor->offset2.y = (short)hot_y;
+ cursor->ph_cursor->bytesperline2 = (char)w/8;
+ cursor->ph_cursor->color2 = Pg_BLACK;
+
+ clen = (w/8)*h;
+
+ /* Copy the mask and the data to different bitmap planes */
+ for (i=0; i<clen; ++i)
+ {
+ for (bit = 0; bit < 8; bit++)
+ {
+ databit = data[i] & (1 << bit);
+ maskbit = mask[i] & (1 << bit);
+
+ cursor->ph_cursor->images[i] |= (databit == 0) ? maskbit : 0;
+ /* If the databit != 0, treat it as a black pixel and
+ * ignore the maskbit (can't do an inverted color) */
+ cursor->ph_cursor->images[i+clen] |= databit;
+ }
+ }
+
+ /* #bytes following the hdr struct */
+ cursor->ph_cursor->hdr.len =sizeof(PhCursorDef_t) + clen*2 - sizeof(PhRegionDataHdr_t);
+
+ return (cursor);
+}
+
+PhCursorDef_t ph_GetWMPhCursor(WMcursor *cursor)
+{
+ return (*cursor->ph_cursor);
+}
+
+int ph_ShowWMCursor(_THIS, WMcursor* cursor)
+{
+ PtArg_t args[3];
+ int nargs = 0;
+
+ /* Don't do anything if the display is gone */
+ if (window == NULL)
+ {
+ return (0);
+ }
+
+ /* looks like photon can't draw mouse cursor in direct mode */
+ if ((this->screen->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN)
+ {
+ /* disable the fake mouse in the fullscreen OpenGL mode */
+ if ((this->screen->flags & SDL_OPENGL) == SDL_OPENGL)
+ {
+ cursor=NULL;
+ }
+ else
+ {
+ return (0);
+ }
+ }
+
+ /* Set the photon cursor, or blank if cursor is NULL */
+ if (cursor!=NULL)
+ {
+ PtSetArg(&args[0], Pt_ARG_CURSOR_TYPE, Ph_CURSOR_BITMAP, 0);
+ /* Could set next to any PgColor_t value */
+ PtSetArg(&args[1], Pt_ARG_CURSOR_COLOR, Ph_CURSOR_DEFAULT_COLOR , 0);
+ PtSetArg(&args[2], Pt_ARG_BITMAP_CURSOR, cursor->ph_cursor, (cursor->ph_cursor->hdr.len + sizeof(PhRegionDataHdr_t)));
+ nargs = 3;
+ }
+ else /* Ph_CURSOR_NONE */
+ {
+ PtSetArg(&args[0], Pt_ARG_CURSOR_TYPE, Ph_CURSOR_NONE, 0);
+ nargs = 1;
+ }
+
+ SDL_Lock_EventThread();
+
+ if (PtSetResources(window, nargs, args) < 0 )
+ {
+ return (0);
+ }
+
+ SDL_Unlock_EventThread();
+
+ return (1);
+}
+
+
+void ph_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
+{
+ short abs_x, abs_y;
+
+ SDL_Lock_EventThread();
+ PtGetAbsPosition( window, &abs_x, &abs_y );
+ PhMoveCursorAbs( PhInputGroup(NULL), x + abs_x, y + abs_y );
+ SDL_Unlock_EventThread();
+}
+
+
+void ph_CheckMouseMode(_THIS)
+{
+ /* If the mouse is hidden and input is grabbed, we use relative mode */
+ if ( !(SDL_cursorstate & CURSOR_VISIBLE) && (this->input_grab != SDL_GRAB_OFF))
+ {
+ mouse_relative = 1;
+ }
+ else
+ {
+ mouse_relative = 0;
+ }
+}
+
+
+void ph_UpdateMouse(_THIS)
+{
+ PhCursorInfo_t phcursor;
+ short abs_x;
+ short abs_y;
+
+ /* Lock the event thread, in multi-threading environments */
+ SDL_Lock_EventThread();
+
+ /* synchronizing photon mouse cursor position and SDL mouse position, if cursor appears over window. */
+ PtGetAbsPosition(window, &abs_x, &abs_y);
+ PhQueryCursor(PhInputGroup(NULL), &phcursor);
+ if (((phcursor.pos.x >= abs_x) && (phcursor.pos.x <= abs_x + this->screen->w)) &&
+ ((phcursor.pos.y >= abs_y) && (phcursor.pos.y <= abs_y + this->screen->h)))
+ {
+ SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
+ SDL_PrivateMouseMotion(0, 0, phcursor.pos.x-abs_x, phcursor.pos.y-abs_y);
+ }
+ else
+ {
+ SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
+ }
+
+ /* Unlock the event thread, in multi-threading environments */
+ SDL_Unlock_EventThread();
+}
diff --git a/distrib/sdl-1.2.15/src/video/photon/SDL_ph_mouse_c.h b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_mouse_c.h
new file mode 100644
index 0000000..55a92b6
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_mouse_c.h
@@ -0,0 +1,39 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef __SDL_PH_MOUSE_H__
+#define __SDL_PH_MOUSE_H__
+
+#include "SDL_ph_video.h"
+
+/* Functions to be exported */
+extern void ph_FreeWMCursor(_THIS, WMcursor *cursor);
+extern WMcursor *ph_CreateWMCursor(_THIS,
+ Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
+extern PhCursorDef_t ph_GetWMPhCursor(WMcursor *cursor);
+extern int ph_ShowWMCursor(_THIS, WMcursor *cursor);
+extern void ph_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
+extern void ph_CheckMouseMode(_THIS);
+extern void ph_UpdateMouse(_THIS);
+
+#endif /* __SDL_PH_MOUSE_H__ */
diff --git a/distrib/sdl-1.2.15/src/video/photon/SDL_ph_video.c b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_video.c
new file mode 100644
index 0000000..5e1a82b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_video.c
@@ -0,0 +1,648 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <unistd.h>
+#include <sys/ioctl.h>
+
+#include "SDL_endian.h"
+#include "SDL_timer.h"
+#include "SDL_thread.h"
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_ph_video.h"
+#include "SDL_ph_modes_c.h"
+#include "SDL_ph_image_c.h"
+#include "SDL_ph_events_c.h"
+#include "SDL_ph_mouse_c.h"
+#include "SDL_ph_wm_c.h"
+#include "SDL_ph_gl.h"
+#include "SDL_phyuv_c.h"
+#include "../blank_cursor.h"
+
+static int ph_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Surface *ph_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int ph_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
+static void ph_VideoQuit(_THIS);
+static void ph_DeleteDevice(SDL_VideoDevice *device);
+
+static int phstatus=-1;
+
+static int ph_Available(void)
+{
+ if (phstatus!=0)
+ {
+ phstatus=PtInit(NULL);
+ if (phstatus==0)
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static SDL_VideoDevice* ph_CreateDevice(int devindex)
+{
+ SDL_VideoDevice* device;
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if (device)
+ {
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData*)SDL_malloc((sizeof *device->hidden));
+ device->gl_data = NULL;
+ }
+ if ((device == NULL) || (device->hidden == NULL))
+ {
+ SDL_OutOfMemory();
+ ph_DeleteDevice(device);
+ return NULL;
+ }
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+
+ /* Set the driver flags */
+ device->handles_any_size = 1;
+
+ /* Set the function pointers */
+ device->CreateYUVOverlay = ph_CreateYUVOverlay;
+ device->VideoInit = ph_VideoInit;
+ device->ListModes = ph_ListModes;
+ device->SetVideoMode = ph_SetVideoMode;
+ device->ToggleFullScreen = ph_ToggleFullScreen;
+ device->UpdateMouse = ph_UpdateMouse;
+ device->SetColors = ph_SetColors;
+ device->UpdateRects = NULL; /* set up in ph_SetupUpdateFunction */
+ device->VideoQuit = ph_VideoQuit;
+ device->AllocHWSurface = ph_AllocHWSurface;
+ device->CheckHWBlit = ph_CheckHWBlit;
+ device->FillHWRect = ph_FillHWRect;
+ device->SetHWColorKey = ph_SetHWColorKey;
+ device->SetHWAlpha = ph_SetHWAlpha;
+ device->LockHWSurface = ph_LockHWSurface;
+ device->UnlockHWSurface = ph_UnlockHWSurface;
+ device->FlipHWSurface = ph_FlipHWSurface;
+ device->FreeHWSurface = ph_FreeHWSurface;
+ device->SetCaption = ph_SetCaption;
+ device->SetIcon = NULL;
+ device->IconifyWindow = ph_IconifyWindow;
+ device->GrabInput = ph_GrabInput;
+ device->GetWMInfo = ph_GetWMInfo;
+ device->FreeWMCursor = ph_FreeWMCursor;
+ device->CreateWMCursor = ph_CreateWMCursor;
+ device->ShowWMCursor = ph_ShowWMCursor;
+ device->WarpWMCursor = ph_WarpWMCursor;
+ device->MoveWMCursor = NULL;
+ device->CheckMouseMode = ph_CheckMouseMode;
+ device->InitOSKeymap = ph_InitOSKeymap;
+ device->PumpEvents = ph_PumpEvents;
+
+ /* OpenGL support. */
+#if SDL_VIDEO_OPENGL
+ device->GL_MakeCurrent = ph_GL_MakeCurrent;
+ device->GL_SwapBuffers = ph_GL_SwapBuffers;
+ device->GL_GetAttribute = ph_GL_GetAttribute;
+ device->GL_LoadLibrary = ph_GL_LoadLibrary;
+ device->GL_GetProcAddress = ph_GL_GetProcAddress;
+#endif /* SDL_VIDEO_OPENGL */
+
+ device->free = ph_DeleteDevice;
+
+ return device;
+}
+
+VideoBootStrap ph_bootstrap = {
+ "photon", "QNX Photon video output",
+ ph_Available, ph_CreateDevice
+};
+
+static void ph_DeleteDevice(SDL_VideoDevice *device)
+{
+ if (device)
+ {
+ if (device->hidden)
+ {
+ SDL_free(device->hidden);
+ device->hidden = NULL;
+ }
+ if (device->gl_data)
+ {
+ SDL_free(device->gl_data);
+ device->gl_data = NULL;
+ }
+ SDL_free(device);
+ device = NULL;
+ }
+}
+
+static PtWidget_t *ph_CreateWindow(_THIS)
+{
+ PtWidget_t *widget;
+
+ widget = PtCreateWidget(PtWindow, NULL, 0, NULL);
+
+ return widget;
+}
+
+static int ph_SetupWindow(_THIS, int w, int h, int flags)
+{
+ PtArg_t args[32];
+ PhPoint_t pos = {0, 0};
+ PhDim_t* olddim;
+ PhDim_t dim = {w, h};
+ PhRect_t desktopextent;
+ int nargs = 0;
+ const char* windowpos;
+ const char* iscentered;
+ int x, y;
+
+ /* check if window size has been changed by Window Manager */
+ PtGetResource(window, Pt_ARG_DIM, &olddim, 0);
+ if ((olddim->w!=w) || (olddim->h!=h))
+ {
+ PtSetArg(&args[nargs++], Pt_ARG_DIM, &dim, 0);
+ }
+
+ if ((flags & SDL_RESIZABLE) == SDL_RESIZABLE)
+ {
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_FALSE, Ph_WM_CLOSE);
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_TRUE, Ph_WM_MAX | Ph_WM_RESTORE | Ph_WM_RESIZE);
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_NOTIFY_FLAGS, Pt_TRUE, Ph_WM_RESIZE | Ph_WM_MOVE | Ph_WM_CLOSE | Ph_WM_MAX | Ph_WM_RESTORE);
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_RENDER_FLAGS, Pt_TRUE, Ph_WM_RENDER_RESIZE | Ph_WM_RENDER_MAX | Ph_WM_RENDER_COLLAPSE | Ph_WM_RENDER_RETURN);
+ PtSetArg(&args[nargs++], Pt_ARG_RESIZE_FLAGS, Pt_TRUE, Pt_RESIZE_XY_AS_REQUIRED);
+ }
+ else
+ {
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_FALSE, Ph_WM_RESIZE | Ph_WM_MAX | Ph_WM_RESTORE | Ph_WM_CLOSE);
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_NOTIFY_FLAGS, Pt_FALSE, Ph_WM_RESIZE | Ph_WM_MAX | Ph_WM_RESTORE);
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_NOTIFY_FLAGS, Pt_TRUE, Ph_WM_MOVE | Ph_WM_CLOSE);
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_RENDER_FLAGS, Pt_FALSE, Ph_WM_RENDER_RESIZE | Ph_WM_RENDER_MAX | Ph_WM_RENDER_COLLAPSE | Ph_WM_RENDER_RETURN);
+ PtSetArg(&args[nargs++], Pt_ARG_RESIZE_FLAGS, Pt_FALSE, Pt_RESIZE_XY_AS_REQUIRED);
+ }
+
+ if (((flags & SDL_NOFRAME)==SDL_NOFRAME) || ((flags & SDL_FULLSCREEN)==SDL_FULLSCREEN))
+ {
+ if ((flags & SDL_RESIZABLE) != SDL_RESIZABLE)
+ {
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_RENDER_FLAGS, Pt_FALSE, Pt_TRUE);
+ }
+ else
+ {
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_RENDER_FLAGS, Pt_FALSE, Pt_TRUE);
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_RENDER_FLAGS, Pt_TRUE, Ph_WM_RENDER_RESIZE | Ph_WM_RENDER_BORDER);
+ }
+ }
+ else
+ {
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_RENDER_FLAGS, Pt_TRUE, Ph_WM_RENDER_BORDER | Ph_WM_RENDER_TITLE |
+ Ph_WM_RENDER_CLOSE | Ph_WM_RENDER_MENU | Ph_WM_RENDER_MIN);
+ }
+
+ if ((flags & SDL_FULLSCREEN) == SDL_FULLSCREEN)
+ {
+ PtSetArg(&args[nargs++], Pt_ARG_POS, &pos, 0);
+ PtSetArg(&args[nargs++], Pt_ARG_BASIC_FLAGS, Pt_TRUE, Pt_BASIC_PREVENT_FILL);
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_TRUE, Ph_WM_FFRONT | Ph_WM_MAX | Ph_WM_TOFRONT | Ph_WM_CONSWITCH);
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_STATE, Pt_TRUE, Ph_WM_STATE_ISFRONT | Ph_WM_STATE_ISFOCUS | Ph_WM_STATE_ISALTKEY);
+ }
+ else
+ {
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_FALSE, Ph_WM_FFRONT | Ph_WM_CONSWITCH);
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_STATE, Pt_FALSE, Ph_WM_STATE_ISFRONT);
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_STATE, Pt_TRUE, Ph_WM_STATE_ISALTKEY);
+
+ if ((flags & SDL_HWSURFACE) == SDL_HWSURFACE)
+ {
+ PtSetArg(&args[nargs++], Pt_ARG_BASIC_FLAGS, Pt_TRUE, Pt_BASIC_PREVENT_FILL);
+ }
+ else
+ {
+ PtSetArg(&args[nargs++], Pt_ARG_FILL_COLOR, Pg_BLACK, 0);
+ }
+ if (!currently_maximized)
+ {
+ windowpos = SDL_getenv("SDL_VIDEO_WINDOW_POS");
+ iscentered = SDL_getenv("SDL_VIDEO_CENTERED");
+
+ if ((iscentered) || ((windowpos) && (SDL_strcmp(windowpos, "center")==0)))
+ {
+ PhWindowQueryVisible(Ph_QUERY_CONSOLE, 0, 0, &desktopextent);
+ if (desktop_mode.width>w)
+ {
+ pos.x = (desktop_mode.width - w)/2;
+ }
+ if (desktop_mode.height>h)
+ {
+ pos.y = (desktop_mode.height - h)/2;
+ }
+
+ pos.x+=desktopextent.ul.x;
+ pos.y+=desktopextent.ul.y;
+ PtSetArg(&args[nargs++], Pt_ARG_POS, &pos, 0);
+ }
+ else
+ {
+ if (windowpos)
+ {
+ if (SDL_sscanf(windowpos, "%d,%d", &x, &y) == 2)
+ {
+ if ((x<desktop_mode.width) && (y<desktop_mode.height))
+ {
+ PhWindowQueryVisible(Ph_QUERY_CONSOLE, 0, 0, &desktopextent);
+ pos.x=x+desktopextent.ul.x;
+ pos.y=y+desktopextent.ul.y;
+ }
+ PtSetArg(&args[nargs++], Pt_ARG_POS, &pos, 0);
+ }
+ }
+ }
+ }
+
+ /* if window is maximized render it as maximized */
+ if (currently_maximized)
+ {
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_STATE, Pt_TRUE, Ph_WM_STATE_ISMAX);
+ }
+ else
+ {
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_STATE, Pt_FALSE, Ph_WM_STATE_ISMAX);
+ }
+
+ /* do not grab the keyboard by default */
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_STATE, Pt_FALSE, Ph_WM_STATE_ISALTKEY);
+
+ /* bring the focus to the window */
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_STATE, Pt_TRUE, Ph_WM_STATE_ISFOCUS);
+
+ /* allow to catch hide event */
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_TRUE, Ph_WM_HIDE);
+ PtSetArg(&args[nargs++], Pt_ARG_WINDOW_NOTIFY_FLAGS, Pt_TRUE, Ph_WM_HIDE);
+ }
+
+ PtSetResources(window, nargs, args);
+ PtRealizeWidget(window);
+ PtWindowToFront(window);
+
+#if 0 /* FIXME */
+ PtGetResource(window, Pt_ARG_POS, &olddim, 0);
+ fprintf(stderr, "POSITION: %d, %d\n", olddim->w, olddim->h);
+#endif
+
+ return 0;
+}
+
+static const struct ColourMasks* ph_GetColourMasks(int bpp)
+{
+ /* The alpha mask doesn't appears to be needed */
+ static const struct ColourMasks phColorMasks[5] = {
+ /* 8 bit */ {0, 0, 0, 0, 8},
+ /* 15 bit ARGB */ {0x7C00, 0x03E0, 0x001F, 0x8000, 15},
+ /* 16 bit RGB */ {0xF800, 0x07E0, 0x001F, 0x0000, 16},
+ /* 24 bit RGB */ {0xFF0000, 0x00FF00, 0x0000FF, 0x000000, 24},
+ /* 32 bit ARGB */ {0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000, 32},
+ };
+
+ switch (bpp)
+ {
+ case 8:
+ return &phColorMasks[0];
+ case 15:
+ return &phColorMasks[1];
+ case 16:
+ return &phColorMasks[2];
+ case 24:
+ return &phColorMasks[3];
+ case 32:
+ return &phColorMasks[4];
+ }
+ return NULL;
+}
+
+static int ph_VideoInit(_THIS, SDL_PixelFormat* vformat)
+{
+ PgHWCaps_t hwcaps;
+ int i;
+
+ window=NULL;
+ desktoppal=SDLPH_PAL_NONE;
+
+#if SDL_VIDEO_OPENGL
+ oglctx=NULL;
+ oglbuffers=NULL;
+ oglflags=0;
+ oglbpp=0;
+#endif
+
+ old_video_mode=-1;
+ old_refresh_rate=-1;
+
+ if (NULL == (phevent = SDL_malloc(EVENT_SIZE)))
+ {
+ SDL_OutOfMemory();
+ return -1;
+ }
+ SDL_memset(phevent, 0x00, EVENT_SIZE);
+
+ window = ph_CreateWindow(this);
+ if (window == NULL)
+ {
+ SDL_SetError("ph_VideoInit(): Couldn't create video window !\n");
+ return -1;
+ }
+
+ /* Create the blank cursor */
+ SDL_BlankCursor = this->CreateWMCursor(this, blank_cdata, blank_cmask,
+ (int)BLANK_CWIDTH, (int)BLANK_CHEIGHT,
+ (int)BLANK_CHOTX, (int)BLANK_CHOTY);
+
+ if (SDL_BlankCursor == NULL)
+ {
+ return -1;
+ }
+
+ if (PgGetGraphicsHWCaps(&hwcaps) < 0)
+ {
+ SDL_SetError("ph_VideoInit(): GetGraphicsHWCaps function failed !\n");
+ this->FreeWMCursor(this, SDL_BlankCursor);
+ return -1;
+ }
+
+ if (PgGetVideoModeInfo(hwcaps.current_video_mode, &desktop_mode) < 0)
+ {
+ SDL_SetError("ph_VideoInit(): PgGetVideoModeInfo function failed !\n");
+ this->FreeWMCursor(this, SDL_BlankCursor);
+ return -1;
+ }
+
+ /* Determine the current screen size */
+ this->info.current_w = desktop_mode.width;
+ this->info.current_h = desktop_mode.height;
+
+ /* We need to return BytesPerPixel as it in used by CreateRGBsurface */
+ vformat->BitsPerPixel = desktop_mode.bits_per_pixel;
+ vformat->BytesPerPixel = desktop_mode.bytes_per_scanline/desktop_mode.width;
+ desktopbpp = desktop_mode.bits_per_pixel;
+
+ /* save current palette */
+ if (desktopbpp==8)
+ {
+ PgGetPalette(savedpal);
+ PgGetPalette(syspalph);
+ }
+ else
+ {
+ for(i=0; i<_Pg_MAX_PALETTE; i++)
+ {
+ savedpal[i]=PgRGB(0, 0, 0);
+ syspalph[i]=PgRGB(0, 0, 0);
+ }
+ }
+
+ currently_fullscreen = 0;
+ currently_hided = 0;
+ currently_maximized = 0;
+ current_overlay = NULL;
+
+ OCImage.direct_context = NULL;
+ OCImage.offscreen_context = NULL;
+ OCImage.offscreen_backcontext = NULL;
+ OCImage.oldDC = NULL;
+ OCImage.CurrentFrameData = NULL;
+ OCImage.FrameData0 = NULL;
+ OCImage.FrameData1 = NULL;
+ videomode_emulatemode = 0;
+
+ this->info.wm_available = 1;
+
+ ph_UpdateHWInfo(this);
+
+ return 0;
+}
+
+static SDL_Surface* ph_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags)
+{
+ const struct ColourMasks* mask;
+
+ /* Lock the event thread, in multi-threading environments */
+ SDL_Lock_EventThread();
+
+ current->flags = flags;
+
+ /* if we do not have desired fullscreen mode, then fallback into window mode */
+ if (((current->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) && (ph_GetVideoMode(width, height, bpp)==0))
+ {
+ current->flags &= ~SDL_FULLSCREEN;
+ current->flags &= ~SDL_NOFRAME;
+ current->flags &= ~SDL_RESIZABLE;
+ }
+
+ ph_SetupWindow(this, width, height, current->flags);
+
+ mask = ph_GetColourMasks(bpp);
+ if (mask != NULL)
+ {
+ SDL_ReallocFormat(current, mask->bpp, mask->red, mask->green, mask->blue, 0);
+ }
+ else
+ {
+ SDL_SetError("ph_SetVideoMode(): desired bpp is not supported by photon !\n");
+ return NULL;
+ }
+
+ if ((current->flags & SDL_OPENGL)==SDL_OPENGL)
+ {
+#if !SDL_VIDEO_OPENGL
+ /* if no built-in OpenGL support */
+ SDL_SetError("ph_SetVideoMode(): no OpenGL support, you need to recompile SDL.\n");
+ current->flags &= ~SDL_OPENGL;
+ return NULL;
+#endif /* SDL_VIDEO_OPENGL */
+ }
+ else
+ {
+ /* Initialize internal variables */
+ if ((current->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN)
+ {
+ if (bpp==8)
+ {
+ desktoppal=SDLPH_PAL_SYSTEM;
+ }
+
+ current->flags &= ~SDL_RESIZABLE; /* no resize for Direct Context */
+ current->flags |= SDL_HWSURFACE;
+ }
+ else
+ {
+ /* remove this if we'll have support for the non-fullscreen sw/hw+doublebuf one day */
+ current->flags &= ~SDL_DOUBLEBUF;
+
+ /* Use offscreen memory if SDL_HWSURFACE flag is set */
+ if ((current->flags & SDL_HWSURFACE) == SDL_HWSURFACE)
+ {
+ if (desktopbpp!=bpp)
+ {
+ current->flags &= ~SDL_HWSURFACE;
+ }
+ }
+
+ /* using palette emulation code in window mode */
+ if (bpp==8)
+ {
+ if (desktopbpp>=15)
+ {
+ desktoppal = SDLPH_PAL_EMULATE;
+ }
+ else
+ {
+ desktoppal = SDLPH_PAL_SYSTEM;
+ }
+ }
+ else
+ {
+ desktoppal = SDLPH_PAL_NONE;
+ }
+ }
+ }
+
+ current->w = width;
+ current->h = height;
+
+ if (desktoppal==SDLPH_PAL_SYSTEM)
+ {
+ current->flags|=SDL_HWPALETTE;
+ }
+
+ /* Must call at least once for setup image planes */
+ if (ph_SetupUpdateFunction(this, current, current->flags)==-1)
+ {
+ /* Error string was filled in the ph_SetupUpdateFunction() */
+ return NULL;
+ }
+
+ /* finish window drawing, if we are not in fullscreen, of course */
+ if ((current->flags & SDL_FULLSCREEN) != SDL_FULLSCREEN)
+ {
+ PtFlush();
+ }
+ else
+ {
+ PgFlush();
+ }
+
+ visualbpp=bpp;
+
+ ph_UpdateHWInfo(this);
+
+ SDL_Unlock_EventThread();
+
+ /* We've done! */
+ return (current);
+}
+
+static void ph_VideoQuit(_THIS)
+{
+ /* restore palette */
+ if (desktopbpp==8)
+ {
+ PgSetPalette(syspalph, 0, -1, 0, 0, 0);
+ PgSetPalette(savedpal, 0, 0, _Pg_MAX_PALETTE, Pg_PALSET_GLOBAL | Pg_PALSET_FORCE_EXPOSE, 0);
+ PgFlush();
+ }
+
+ ph_DestroyImage(this, SDL_VideoSurface);
+
+ if (window)
+ {
+ PtUnrealizeWidget(window);
+ PtDestroyWidget(window);
+ window=NULL;
+ }
+
+ if (phevent!=NULL)
+ {
+ SDL_free(phevent);
+ phevent=NULL;
+ }
+}
+
+static int ph_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ int i;
+ SDL_Rect updaterect;
+
+ updaterect.x = updaterect.y = 0;
+ updaterect.w = this->screen->w;
+ updaterect.h = this->screen->h;
+
+ /* palette emulation code, using palette of the PhImage_t struct */
+ if (desktoppal==SDLPH_PAL_EMULATE)
+ {
+ if ((SDL_Image) && (SDL_Image->palette))
+ {
+ for (i=firstcolor; i<firstcolor+ncolors; i++)
+ {
+ syspalph[i] = PgRGB(colors[i-firstcolor].r, colors[i-firstcolor].g, colors[i-firstcolor].b);
+ SDL_Image->palette[i] = syspalph[i];
+ }
+
+ /* image needs to be redrawn */
+ this->UpdateRects(this, 1, &updaterect);
+ }
+ }
+ else
+ {
+ if (desktoppal==SDLPH_PAL_SYSTEM)
+ {
+ for (i=firstcolor; i<firstcolor+ncolors; i++)
+ {
+ syspalph[i] = PgRGB(colors[i-firstcolor].r, colors[i-firstcolor].g, colors[i-firstcolor].b);
+ }
+
+ if ((this->screen->flags & SDL_FULLSCREEN) != SDL_FULLSCREEN)
+ {
+ /* window mode must use soft palette */
+ PgSetPalette(&syspalph[firstcolor], 0, firstcolor, ncolors, Pg_PALSET_GLOBAL, 0);
+ /* image needs to be redrawn */
+ this->UpdateRects(this, 1, &updaterect);
+ }
+ else
+ {
+ /* fullscreen mode must use hardware palette */
+ PgSetPalette(&syspalph[firstcolor], 0, firstcolor, ncolors, Pg_PALSET_GLOBAL, 0);
+ }
+ }
+ else
+ {
+ /* SDLPH_PAL_NONE do nothing */
+ }
+ }
+
+ return 1;
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/photon/SDL_ph_video.h b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_video.h
new file mode 100644
index 0000000..3995d35
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_video.h
@@ -0,0 +1,157 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef __SDL_PH_VIDEO_H__
+#define __SDL_PH_VIDEO_H__
+
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+
+#include <sys/neutrino.h>
+
+#include <Ph.h>
+#include <Pt.h>
+#include <photon/Pg.h>
+#include <photon/PdDirect.h>
+
+#if SDL_VIDEO_OPENGL
+ #if (_NTO_VERSION < 630)
+ #include <photon/PdGL.h>
+ #else
+ #include <GL/qnxgl.h>
+ #include <GL/GLPh.h>
+ #endif /* 6.3.0 */
+#endif /* SDL_VIDEO_OPENGL */
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice* this
+
+#define PH_OGL_MAX_ATTRIBS 32
+
+#define SDLPH_PAL_NONE 0x00000000L
+#define SDLPH_PAL_EMULATE 0x00000001L
+#define SDLPH_PAL_SYSTEM 0x00000002L
+
+typedef struct
+{
+ unsigned char* Y;
+ unsigned char* V;
+ unsigned char* U;
+} FRAMEDATA;
+
+/* Mask values for SDL_ReallocFormat() */
+struct ColourMasks
+{
+ Uint32 red;
+ Uint32 green;
+ Uint32 blue;
+ Uint32 alpha;
+ Uint32 bpp;
+};
+
+/* Private display data */
+struct SDL_PrivateVideoData
+{
+ PgDisplaySettings_t mode_settings;
+ PtWidget_t *Window; /* used to handle input events */
+ PhImage_t *image; /* used to display image */
+#if SDL_VIDEO_OPENGL
+ #if (_NTO_VERSION < 630)
+ PdOpenGLContext_t* OGLContext; /* OpenGL context */
+ void* OGLBuffers; /* OpenGL buffers (unused) */
+ #else
+ qnxglc_t* OGLContext; /* OpenGL context for the 6.3 */
+ qnxgl_bufs_t* OGLBuffers; /* OpenGL buffers for the 6.3 */
+ #endif /* 630 */
+
+ Uint32 OGLFlags; /* OpenGL flags */
+ Uint32 OGLBPP; /* OpenGL bpp */
+#endif /* SDL_VIDEO_OPENGL */
+ PgColor_t savedpal[_Pg_MAX_PALETTE];
+ PgColor_t syspalph[_Pg_MAX_PALETTE];
+
+ struct
+ {
+ PdDirectContext_t* direct_context;
+ PdOffscreenContext_t* offscreen_context;
+ PdOffscreenContext_t* offscreen_backcontext;
+ PhDrawContext_t* oldDC;
+ uint8_t* dc_ptr;
+ unsigned char* CurrentFrameData;
+ unsigned char* FrameData0;
+ unsigned char* FrameData1;
+ Uint32 current;
+ Uint32 flags;
+ } ocimage;
+
+ PgHWCaps_t graphics_card_caps; /* Graphics card caps at the moment of start */
+ PgVideoModeInfo_t desktop_mode; /* Current desktop video mode information */
+ int old_video_mode; /* Stored mode before fullscreen switch */
+ int old_refresh_rate; /* Stored refresh rate befor fullscreen switch */
+
+ int mouse_relative;
+ WMcursor* BlankCursor;
+ uint32_t videomode_emulatemode;
+
+ Uint32 visualbpp; /* current visual bpp */
+ Uint32 desktopbpp; /* bpp of desktop at the moment of start */
+ Uint32 desktoppal; /* palette mode emulation or system */
+
+ int currently_fullscreen;
+ int currently_hided; /* 1 - window hided (minimazed), 0 - normal */
+ int currently_maximized; /* 1 - window hided (minimazed), 0 - normal */
+
+ PhEvent_t* event;
+ SDL_Overlay* overlay;
+};
+
+#define mode_settings (this->hidden->mode_settings)
+#define window (this->hidden->Window)
+#define SDL_Image (this->hidden->image)
+#define OCImage (this->hidden->ocimage)
+#define old_video_mode (this->hidden->old_video_mode)
+#define old_refresh_rate (this->hidden->old_refresh_rate)
+#define graphics_card_caps (this->hidden->graphics_card_caps)
+#define desktopbpp (this->hidden->desktopbpp)
+#define visualbpp (this->hidden->visualbpp)
+#define desktoppal (this->hidden->desktoppal)
+#define savedpal (this->hidden->savedpal)
+#define syspalph (this->hidden->syspalph)
+#define currently_fullscreen (this->hidden->currently_fullscreen)
+#define currently_hided (this->hidden->currently_hided)
+#define currently_maximized (this->hidden->currently_maximized)
+#define phevent (this->hidden->event)
+#define current_overlay (this->hidden->overlay)
+#define desktop_mode (this->hidden->desktop_mode)
+#define mouse_relative (this->hidden->mouse_relative)
+#define SDL_BlankCursor (this->hidden->BlankCursor)
+#define videomode_emulatemode (this->hidden->videomode_emulatemode)
+
+#if SDL_VIDEO_OPENGL
+ #define oglctx (this->hidden->OGLContext)
+ #define oglbuffers (this->hidden->OGLBuffers)
+ #define oglflags (this->hidden->OGLFlags)
+ #define oglbpp (this->hidden->OGLBPP)
+#endif /* SDL_VIDEO_OPENGL */
+
+#endif /* __SDL_PH_VIDEO_H__ */
diff --git a/distrib/sdl-1.2.15/src/video/photon/SDL_ph_wm.c b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_wm.c
new file mode 100644
index 0000000..8e75d0b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_wm.c
@@ -0,0 +1,118 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <Ph.h>
+#include <photon/PpProto.h>
+#include <photon/PhWm.h>
+#include <photon/wmapi.h>
+
+#include "SDL_version.h"
+#include "SDL_timer.h"
+#include "SDL_video.h"
+#include "SDL_syswm.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_ph_modes_c.h"
+#include "SDL_ph_wm_c.h"
+
+void ph_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask)
+{
+ return;
+}
+
+/* Set window caption */
+void ph_SetCaption(_THIS, const char *title, const char *icon)
+{
+ SDL_Lock_EventThread();
+
+ /* sanity check for set caption call before window init */
+ if (window!=NULL)
+ {
+ PtSetResource(window, Pt_ARG_WINDOW_TITLE, title, 0);
+ }
+
+ SDL_Unlock_EventThread();
+}
+
+/* Iconify current window */
+int ph_IconifyWindow(_THIS)
+{
+ PhWindowEvent_t windowevent;
+
+ SDL_Lock_EventThread();
+
+ SDL_memset(&windowevent, 0, sizeof(windowevent));
+ windowevent.event_f = Ph_WM_HIDE;
+ windowevent.event_state = Ph_WM_EVSTATE_HIDE;
+ windowevent.rid = PtWidgetRid(window);
+ PtForwardWindowEvent(&windowevent);
+
+ SDL_Unlock_EventThread();
+
+ return 0;
+}
+
+SDL_GrabMode ph_GrabInputNoLock(_THIS, SDL_GrabMode mode)
+{
+ short abs_x, abs_y;
+
+ if( mode == SDL_GRAB_OFF )
+ {
+ PtSetResource(window, Pt_ARG_WINDOW_STATE, Pt_FALSE, Ph_WM_STATE_ISALTKEY);
+ }
+ else
+ {
+ PtSetResource(window, Pt_ARG_WINDOW_STATE, Pt_TRUE, Ph_WM_STATE_ISALTKEY);
+
+ PtGetAbsPosition(window, &abs_x, &abs_y);
+ PhMoveCursorAbs(PhInputGroup(NULL), abs_x + SDL_VideoSurface->w/2, abs_y + SDL_VideoSurface->h/2);
+ }
+
+ SDL_Unlock_EventThread();
+
+ return(mode);
+}
+
+SDL_GrabMode ph_GrabInput(_THIS, SDL_GrabMode mode)
+{
+ SDL_Lock_EventThread();
+ mode = ph_GrabInputNoLock(this, mode);
+ SDL_Unlock_EventThread();
+
+ return(mode);
+}
+
+
+int ph_GetWMInfo(_THIS, SDL_SysWMinfo *info)
+{
+ if (info->version.major <= SDL_MAJOR_VERSION)
+ {
+ return 1;
+ }
+ else
+ {
+ SDL_SetError("Application not compiled with SDL %d.%d\n",
+ SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
+ return -1;
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/photon/SDL_ph_wm_c.h b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_wm_c.h
new file mode 100644
index 0000000..72bbfd2
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/photon/SDL_ph_wm_c.h
@@ -0,0 +1,37 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef __SDL_PH_WM_H__
+#define __SDL_PH_WM_H__
+
+#include "SDL_ph_video.h"
+
+/* Functions to be exported */
+extern void ph_SetCaption(_THIS, const char *title, const char *icon);
+extern void ph_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask);
+extern int ph_IconifyWindow(_THIS);
+extern SDL_GrabMode ph_GrabInputNoLock(_THIS, SDL_GrabMode mode);
+extern SDL_GrabMode ph_GrabInput(_THIS, SDL_GrabMode mode);
+extern int ph_GetWMInfo(_THIS, SDL_SysWMinfo *info);
+
+#endif /* __SDL_PH_WM_H__ */
diff --git a/distrib/sdl-1.2.15/src/video/photon/SDL_phyuv.c b/distrib/sdl-1.2.15/src/video/photon/SDL_phyuv.c
new file mode 100644
index 0000000..06c72fd
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/photon/SDL_phyuv.c
@@ -0,0 +1,504 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This is the QNX Realtime Platform version of SDL YUV video overlays */
+
+#include <errno.h>
+
+#include <Ph.h>
+#include <Pt.h>
+
+#include "SDL_video.h"
+#include "SDL_phyuv_c.h"
+#include "../SDL_yuvfuncs.h"
+
+#define OVERLAY_STATE_UNINIT 0
+#define OVERLAY_STATE_ACTIVE 1
+
+/* The functions are used to manipulate software video overlays */
+static struct private_yuvhwfuncs ph_yuvfuncs =
+{
+ ph_LockYUVOverlay,
+ ph_UnlockYUVOverlay,
+ ph_DisplayYUVOverlay,
+ ph_FreeYUVOverlay
+};
+
+int grab_ptrs2(PgVideoChannel_t* channel, FRAMEDATA* Frame0, FRAMEDATA* Frame1)
+{
+ int planes = 0;
+
+ /* Buffers have moved; re-obtain the pointers */
+ Frame0->Y = (unsigned char *)PdGetOffscreenContextPtr(channel->yplane1);
+ Frame1->Y = (unsigned char *)PdGetOffscreenContextPtr(channel->yplane2);
+ Frame0->U = (unsigned char *)PdGetOffscreenContextPtr(channel->vplane1);
+ Frame1->U = (unsigned char *)PdGetOffscreenContextPtr(channel->vplane2);
+ Frame0->V = (unsigned char *)PdGetOffscreenContextPtr(channel->uplane1);
+ Frame1->V = (unsigned char *)PdGetOffscreenContextPtr(channel->uplane2);
+
+ if (Frame0->Y)
+ planes++;
+
+ if (Frame0->U)
+ planes++;
+
+ if (Frame0->V)
+ planes++;
+
+ return planes;
+}
+
+SDL_Overlay* ph_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface* display)
+{
+ SDL_Overlay* overlay;
+ struct private_yuvhwdata* hwdata;
+ int vidport;
+ int rtncode;
+ int planes;
+ int i=0;
+ PhPoint_t pos;
+
+ /* Create the overlay structure */
+ overlay = SDL_calloc(1, sizeof(SDL_Overlay));
+
+ if (overlay == NULL)
+ {
+ SDL_OutOfMemory();
+ return NULL;
+ }
+
+ /* Fill in the basic members */
+ overlay->format = format;
+ overlay->w = width;
+ overlay->h = height;
+ overlay->hwdata = NULL;
+
+ /* Set up the YUV surface function structure */
+ overlay->hwfuncs = &ph_yuvfuncs;
+
+ /* Create the pixel data and lookup tables */
+ hwdata = SDL_calloc(1, sizeof(struct private_yuvhwdata));
+
+ if (hwdata == NULL)
+ {
+ SDL_OutOfMemory();
+ SDL_FreeYUVOverlay(overlay);
+ return NULL;
+ }
+
+ overlay->hwdata = hwdata;
+
+ PhDCSetCurrent(0);
+ if (overlay->hwdata->channel == NULL)
+ {
+ if ((overlay->hwdata->channel = PgCreateVideoChannel(Pg_VIDEO_CHANNEL_SCALER, 0)) == NULL)
+ {
+ SDL_SetError("ph_CreateYUVOverlay(): Create channel failed: %s\n", strerror(errno));
+ SDL_FreeYUVOverlay(overlay);
+ return NULL;
+
+ }
+ }
+
+ overlay->hwdata->forcedredraw=0;
+
+ PtGetAbsPosition(window, &pos.x, &pos.y);
+ overlay->hwdata->CurrentWindowPos.x = pos.x;
+ overlay->hwdata->CurrentWindowPos.y = pos.y;
+ overlay->hwdata->CurrentViewPort.pos.x = 0;
+ overlay->hwdata->CurrentViewPort.pos.y = 0;
+ overlay->hwdata->CurrentViewPort.size.w = width;
+ overlay->hwdata->CurrentViewPort.size.h = height;
+ overlay->hwdata->State = OVERLAY_STATE_UNINIT;
+ overlay->hwdata->FrameData0 = (FRAMEDATA *) SDL_calloc(1, sizeof(FRAMEDATA));
+ overlay->hwdata->FrameData1 = (FRAMEDATA *) SDL_calloc(1, sizeof(FRAMEDATA));
+
+ vidport = -1;
+ i=0;
+
+ overlay->hwdata->ischromakey=0;
+
+ do {
+ SDL_memset(&overlay->hwdata->caps, 0x00, sizeof(PgScalerCaps_t));
+ overlay->hwdata->caps.size = sizeof(PgScalerCaps_t);
+ rtncode = PgGetScalerCapabilities(overlay->hwdata->channel, i, &overlay->hwdata->caps);
+ if (rtncode==0)
+ {
+ if (overlay->hwdata->caps.format==format)
+ {
+ if ((overlay->hwdata->caps.flags & Pg_SCALER_CAP_DST_CHROMA_KEY) == Pg_SCALER_CAP_DST_CHROMA_KEY)
+ {
+ overlay->hwdata->ischromakey=1;
+ }
+ vidport=1;
+ break;
+ }
+ }
+ else
+ {
+ break;
+ }
+ i++;
+ } while(1);
+
+
+ if (vidport == -1)
+ {
+ SDL_SetError("No available video ports for requested format\n");
+ SDL_FreeYUVOverlay(overlay);
+ return NULL;
+ }
+
+ overlay->hwdata->format = format;
+ overlay->hwdata->props.format = format;
+ overlay->hwdata->props.size = sizeof(PgScalerProps_t);
+ overlay->hwdata->props.src_dim.w = width;
+ overlay->hwdata->props.src_dim.h = height;
+
+ /* overlay->hwdata->chromakey = PgGetOverlayChromaColor(); */
+ overlay->hwdata->chromakey = PgRGB(12, 6, 12); /* very dark pink color */
+ overlay->hwdata->props.color_key = overlay->hwdata->chromakey;
+
+ PhAreaToRect(&overlay->hwdata->CurrentViewPort, &overlay->hwdata->props.viewport);
+
+ overlay->hwdata->props.flags = Pg_SCALER_PROP_DOUBLE_BUFFER;
+
+ if ((overlay->hwdata->ischromakey)&&(overlay->hwdata->chromakey))
+ {
+ overlay->hwdata->props.flags |= Pg_SCALER_PROP_CHROMA_ENABLE;
+ overlay->hwdata->props.flags |= Pg_SCALER_PROP_CHROMA_SPECIFY_KEY_MASK;
+ }
+ else
+ {
+ overlay->hwdata->props.flags &= ~Pg_SCALER_PROP_CHROMA_ENABLE;
+ }
+
+ rtncode = PgConfigScalerChannel(overlay->hwdata->channel, &overlay->hwdata->props);
+
+ switch(rtncode)
+ {
+ case -1: SDL_SetError("PgConfigScalerChannel failed\n");
+ SDL_FreeYUVOverlay(overlay);
+ return NULL;
+ case 1:
+ case 0:
+ default:
+ break;
+ }
+
+ planes = grab_ptrs2(overlay->hwdata->channel, overlay->hwdata->FrameData0, overlay->hwdata->FrameData1);
+
+ if(overlay->hwdata->channel->yplane1 != NULL)
+ overlay->hwdata->YStride = overlay->hwdata->channel->yplane1->pitch;
+ if(overlay->hwdata->channel->vplane1 != NULL)
+ overlay->hwdata->UStride = overlay->hwdata->channel->vplane1->pitch;
+ if(overlay->hwdata->channel->uplane1 != NULL)
+ overlay->hwdata->VStride = overlay->hwdata->channel->uplane1->pitch;
+
+ /* check for the validness of all planes */
+ if ((overlay->hwdata->channel->yplane1 == NULL) &&
+ (overlay->hwdata->channel->uplane1 == NULL) &&
+ (overlay->hwdata->channel->vplane1 == NULL))
+ {
+ SDL_FreeYUVOverlay(overlay);
+ SDL_SetError("PgConfigScaler() returns all planes equal NULL\n");
+ return NULL;
+ }
+/*
+ overlay->hwdata->current = PgNextVideoFrame(overlay->hwdata->channel);
+
+ if (overlay->hwdata->current==0)
+ {
+ overlay->hwdata->CurrentFrameData = overlay->hwdata->FrameData0;
+ }
+ else
+ {
+ overlay->hwdata->CurrentFrameData = overlay->hwdata->FrameData1;
+ }
+*/
+ overlay->hwdata->CurrentFrameData = overlay->hwdata->FrameData0;
+
+/*
+ overlay->hwdata->locked = 1;
+*/
+
+ /* Find the pitch and offset values for the overlay */
+ overlay->planes = planes;
+ overlay->pitches = SDL_calloc(overlay->planes, sizeof(Uint16));
+ overlay->pixels = SDL_calloc(overlay->planes, sizeof(Uint8*));
+ if (!overlay->pitches || !overlay->pixels)
+ {
+ SDL_OutOfMemory();
+ SDL_FreeYUVOverlay(overlay);
+ return(NULL);
+ }
+
+ if (overlay->planes > 0)
+ {
+ overlay->pitches[0] = overlay->hwdata->channel->yplane1->pitch;
+ overlay->pixels[0] = overlay->hwdata->CurrentFrameData->Y;
+ }
+ if (overlay->planes > 1)
+ {
+ overlay->pitches[1] = overlay->hwdata->channel->vplane1->pitch;
+ overlay->pixels[1] = overlay->hwdata->CurrentFrameData->U;
+ }
+ if (overlay->planes > 2)
+ {
+ overlay->pitches[2] = overlay->hwdata->channel->uplane1->pitch;
+ overlay->pixels[2] = overlay->hwdata->CurrentFrameData->V;
+ }
+
+ overlay->hwdata->State = OVERLAY_STATE_ACTIVE;
+ overlay->hwdata->scaler_on = 0;
+ overlay->hw_overlay = 1;
+
+ current_overlay=overlay;
+
+ return overlay;
+}
+
+int ph_LockYUVOverlay(_THIS, SDL_Overlay* overlay)
+{
+ if (overlay == NULL)
+ {
+ return -1;
+ }
+
+ overlay->hwdata->locked = 1;
+
+/* overlay->hwdata->current = PgNextVideoFrame(overlay->hwdata->channel);
+ if (overlay->hwdata->current == -1)
+ {
+ SDL_SetError("ph_LockYUVOverlay: PgNextFrame() failed, bailing out\n");
+ SDL_FreeYUVOverlay(overlay);
+ return 0;
+ }
+
+ if (overlay->hwdata->current == 0)
+ {
+ overlay->hwdata->CurrentFrameData = overlay->hwdata->FrameData0;
+ }
+ else
+ {
+ overlay->hwdata->CurrentFrameData = overlay->hwdata->FrameData1;
+ }
+
+ if (overlay->planes > 0)
+ {
+ overlay->pitches[0] = overlay->hwdata->channel->yplane1->pitch;
+ overlay->pixels[0] = overlay->hwdata->CurrentFrameData->Y;
+ }
+ if (overlay->planes > 1)
+ {
+ overlay->pitches[1] = overlay->hwdata->channel->uplane1->pitch;
+ overlay->pixels[1] = overlay->hwdata->CurrentFrameData->U;
+ }
+ if (overlay->planes > 2)
+ {
+ overlay->pitches[2] = overlay->hwdata->channel->vplane1->pitch;
+ overlay->pixels[2] = overlay->hwdata->CurrentFrameData->V;
+ }
+*/
+
+ return(0);
+}
+
+void ph_UnlockYUVOverlay(_THIS, SDL_Overlay* overlay)
+{
+ if (overlay == NULL)
+ {
+ return;
+ }
+
+ overlay->hwdata->locked = 0;
+}
+
+int ph_DisplayYUVOverlay(_THIS, SDL_Overlay* overlay, SDL_Rect* src, SDL_Rect* dst)
+{
+ int rtncode;
+ PhPoint_t pos;
+ SDL_Rect backrect;
+ PhRect_t windowextent;
+ int winchanged=0;
+
+ if ((overlay == NULL) || (overlay->hwdata==NULL))
+ {
+ return -1;
+ }
+
+ if (overlay->hwdata->State == OVERLAY_STATE_UNINIT)
+ {
+ return -1;
+ }
+
+ PtGetAbsPosition(window, &pos.x, &pos.y);
+ if ((pos.x!=overlay->hwdata->CurrentWindowPos.x) ||
+ (pos.y!=overlay->hwdata->CurrentWindowPos.y))
+ {
+ winchanged=1;
+ overlay->hwdata->CurrentWindowPos.x=pos.x;
+ overlay->hwdata->CurrentWindowPos.y=pos.y;
+ }
+
+ /* If CurrentViewPort position/size has been changed, then move/resize the viewport */
+ if ((overlay->hwdata->CurrentViewPort.pos.x != dst->x) ||
+ (overlay->hwdata->CurrentViewPort.pos.y != dst->y) ||
+ (overlay->hwdata->CurrentViewPort.size.w != dst->w) ||
+ (overlay->hwdata->CurrentViewPort.size.h != dst->h) ||
+ (overlay->hwdata->scaler_on==0) || (winchanged==1) ||
+ (overlay->hwdata->forcedredraw==1))
+ {
+
+ if (overlay->hwdata->ischromakey==1)
+ {
+ /* restore screen behind the overlay/chroma color. */
+ backrect.x=overlay->hwdata->CurrentViewPort.pos.x;
+ backrect.y=overlay->hwdata->CurrentViewPort.pos.y;
+ backrect.w=overlay->hwdata->CurrentViewPort.size.w;
+ backrect.h=overlay->hwdata->CurrentViewPort.size.h;
+ this->UpdateRects(this, 1, &backrect);
+
+ /* Draw the new rectangle of the chroma color at the viewport position */
+ PgSetFillColor(overlay->hwdata->chromakey);
+ PgDrawIRect(dst->x, dst->y, dst->x+dst->w-1, dst->y+dst->h-1, Pg_DRAW_FILL);
+ PgFlush();
+ }
+
+ overlay->hwdata->props.flags |= Pg_SCALER_PROP_SCALER_ENABLE;
+ overlay->hwdata->scaler_on = 1;
+
+ PhWindowQueryVisible(Ph_QUERY_CONSOLE, 0, PtWidgetRid(window), &windowextent);
+ overlay->hwdata->CurrentViewPort.pos.x = pos.x-windowextent.ul.x+dst->x;
+ overlay->hwdata->CurrentViewPort.pos.y = pos.y-windowextent.ul.y+dst->y;
+ overlay->hwdata->CurrentViewPort.size.w = dst->w;
+ overlay->hwdata->CurrentViewPort.size.h = dst->h;
+ PhAreaToRect(&overlay->hwdata->CurrentViewPort, &overlay->hwdata->props.viewport);
+ overlay->hwdata->CurrentViewPort.pos.x = dst->x;
+ overlay->hwdata->CurrentViewPort.pos.y = dst->y;
+
+ rtncode = PgConfigScalerChannel(overlay->hwdata->channel, &(overlay->hwdata->props));
+
+ switch(rtncode)
+ {
+ case -1:
+ SDL_SetError("PgConfigScalerChannel() function failed\n");
+ SDL_FreeYUVOverlay(overlay);
+ return -1;
+ case 1:
+ grab_ptrs2(overlay->hwdata->channel, overlay->hwdata->FrameData0, overlay->hwdata->FrameData1);
+ break;
+ case 0:
+ default:
+ break;
+ }
+ }
+
+
+/*
+ if (overlay->hwdata->locked==0)
+ {
+ overlay->hwdata->current = PgNextVideoFrame(overlay->hwdata->channel);
+ if (overlay->hwdata->current == -1)
+ {
+ SDL_SetError("ph_LockYUVOverlay: PgNextFrame() failed, bailing out\n");
+ SDL_FreeYUVOverlay(overlay);
+ return 0;
+ }
+
+ if (overlay->hwdata->current == 0)
+ {
+ overlay->hwdata->CurrentFrameData = overlay->hwdata->FrameData0;
+ }
+ else
+ {
+ overlay->hwdata->CurrentFrameData = overlay->hwdata->FrameData1;
+ }
+
+ if (overlay->planes > 0)
+ {
+ overlay->pitches[0] = overlay->hwdata->channel->yplane1->pitch;
+ overlay->pixels[0] = overlay->hwdata->CurrentFrameData->Y;
+ }
+ if (overlay->planes > 1)
+ {
+ overlay->pitches[1] = overlay->hwdata->channel->uplane1->pitch;
+ overlay->pixels[1] = overlay->hwdata->CurrentFrameData->U;
+ }
+ if (overlay->planes > 2)
+ {
+ overlay->pitches[2] = overlay->hwdata->channel->vplane1->pitch;
+ overlay->pixels[2] = overlay->hwdata->CurrentFrameData->V;
+ }
+ }
+*/
+
+ return 0;
+}
+
+void ph_FreeYUVOverlay(_THIS, SDL_Overlay *overlay)
+{
+ SDL_Rect backrect;
+
+ if (overlay == NULL)
+ {
+ return;
+ }
+
+ if (overlay->hwdata == NULL)
+ {
+ return;
+ }
+
+ current_overlay=NULL;
+
+ /* restore screen behind the overlay/chroma color. */
+ backrect.x=overlay->hwdata->CurrentViewPort.pos.x;
+ backrect.y=overlay->hwdata->CurrentViewPort.pos.y;
+ backrect.w=overlay->hwdata->CurrentViewPort.size.w;
+ backrect.h=overlay->hwdata->CurrentViewPort.size.h;
+ this->UpdateRects(this, 1, &backrect);
+
+ /* it is need for some buggy drivers, that can't hide overlay before */
+ /* freeing buffer, so we got trash on the srceen */
+ overlay->hwdata->props.flags &= ~Pg_SCALER_PROP_SCALER_ENABLE;
+ PgConfigScalerChannel(overlay->hwdata->channel, &(overlay->hwdata->props));
+
+ overlay->hwdata->scaler_on = 0;
+ overlay->hwdata->State = OVERLAY_STATE_UNINIT;
+
+ if (overlay->hwdata->channel != NULL)
+ {
+ PgDestroyVideoChannel(overlay->hwdata->channel);
+ overlay->hwdata->channel = NULL;
+ return;
+ }
+
+ overlay->hwdata->CurrentFrameData = NULL;
+
+ SDL_free(overlay->hwdata->FrameData0);
+ SDL_free(overlay->hwdata->FrameData1);
+ overlay->hwdata->FrameData0 = NULL;
+ overlay->hwdata->FrameData1 = NULL;
+ SDL_free(overlay->hwdata);
+}
diff --git a/distrib/sdl-1.2.15/src/video/photon/SDL_phyuv_c.h b/distrib/sdl-1.2.15/src/video/photon/SDL_phyuv_c.h
new file mode 100644
index 0000000..c6f73fe
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/photon/SDL_phyuv_c.h
@@ -0,0 +1,62 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef __SDL_PH_YUV_H__
+#define __SDL_PH_YUV_H__
+
+/* This is the photon implementation of YUV video overlays */
+
+#include "SDL_video.h"
+#include "SDL_ph_video.h"
+
+struct private_yuvhwdata
+{
+ FRAMEDATA* CurrentFrameData;
+ FRAMEDATA* FrameData0;
+ FRAMEDATA* FrameData1;
+ PgScalerProps_t props;
+ PgScalerCaps_t caps;
+ PgVideoChannel_t* channel;
+ PhArea_t CurrentViewPort;
+ PhPoint_t CurrentWindowPos;
+ long format;
+ int scaler_on;
+ int current;
+ long YStride;
+ long VStride;
+ long UStride;
+ int ischromakey;
+ long chromakey;
+ int forcedredraw;
+ unsigned long State;
+ long flags;
+ int locked;
+};
+
+extern SDL_Overlay* ph_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface* display);
+extern int ph_LockYUVOverlay(_THIS, SDL_Overlay* overlay);
+extern void ph_UnlockYUVOverlay(_THIS, SDL_Overlay* overlay);
+extern int ph_DisplayYUVOverlay(_THIS, SDL_Overlay* overlay, SDL_Rect* src, SDL_Rect* dst);
+extern void ph_FreeYUVOverlay(_THIS, SDL_Overlay* overlay);
+
+#endif /* __SDL_PH_YUV_H__ */
diff --git a/distrib/sdl-1.2.15/src/video/picogui/SDL_pgevents.c b/distrib/sdl-1.2.15/src/video/picogui/SDL_pgevents.c
new file mode 100644
index 0000000..5006c07
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/picogui/SDL_pgevents.c
@@ -0,0 +1,117 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ Micah Dowty
+ micahjd@users.sourceforge.net
+*/
+#include "SDL_config.h"
+
+#include "SDL.h"
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_pgvideo.h"
+#include "SDL_pgevents_c.h"
+
+int PG_HandleClose(struct pgEvent *evt)
+{
+ SDL_PrivateQuit();
+ return 1; /* Intercept the event's normal quit handling */
+}
+
+int PG_HandleResize(struct pgEvent *evt)
+{
+ SDL_PrivateResize(evt->e.size.w, evt->e.size.h);
+ return 0;
+}
+
+int PG_HandleKey(struct pgEvent *evt)
+{
+ SDL_keysym sym;
+ SDL_memset(&sym,0,sizeof(sym));
+ sym.sym = evt->e.kbd.key;
+ sym.mod = evt->e.kbd.mods;
+ SDL_PrivateKeyboard(evt->type == PG_WE_KBD_KEYDOWN, &sym);
+ return 0;
+}
+
+int PG_HandleChar(struct pgEvent *evt)
+{
+ SDL_keysym sym;
+ SDL_memset(&sym,0,sizeof(sym));
+ sym.unicode = evt->e.kbd.key;
+ sym.mod = evt->e.kbd.mods;
+ SDL_PrivateKeyboard(evt->type == PG_WE_KBD_KEYDOWN, &sym);
+ return 0;
+}
+
+int PG_HandleMouseButton(struct pgEvent *evt)
+{
+ /* We need to focus the canvas when it's clicked */
+ if (evt->extra) {
+ SDL_VideoDevice *this = (SDL_VideoDevice *) evt->extra;
+ pgFocus(this->hidden->wCanvas);
+ }
+ SDL_PrivateMouseButton(evt->type == PG_WE_PNTR_DOWN, evt->e.pntr.chbtn,
+ evt->e.pntr.x, evt->e.pntr.y);
+ return 0;
+}
+
+int PG_HandleMouseMotion(struct pgEvent *evt)
+{
+ SDL_PrivateMouseMotion(evt->e.pntr.btn,0,evt->e.pntr.x, evt->e.pntr.y);
+ return 0;
+}
+
+void PG_PumpEvents(_THIS)
+{
+ /* Process all pending events */
+ pgEventPoll();
+}
+
+void PG_InitOSKeymap(_THIS)
+{
+ /* We need no keymap */
+}
+
+void PG_InitEvents(_THIS)
+{
+ /* Turn on all the mouse and keyboard triggers for our canvas, normally less important
+ * events like mouse movement are ignored to save bandwidth. */
+ pgSetWidget(this->hidden->wCanvas, PG_WP_TRIGGERMASK,
+ pgGetWidget(this->hidden->wCanvas, PG_WP_TRIGGERMASK) |
+ PG_TRIGGER_UP | PG_TRIGGER_DOWN | PG_TRIGGER_MOVE |
+ PG_TRIGGER_KEYUP | PG_TRIGGER_KEYDOWN | PG_TRIGGER_CHAR,0);
+
+ /* Start our canvas out focused, so we get keyboard input */
+ pgFocus(this->hidden->wCanvas);
+
+ /* Set up bindings for all the above event handlers */
+ pgBind(this->hidden->wApp, PG_WE_CLOSE, &PG_HandleClose, NULL);
+ pgBind(this->hidden->wCanvas, PG_WE_BUILD, &PG_HandleResize, NULL);
+ pgBind(this->hidden->wCanvas, PG_WE_KBD_CHAR, &PG_HandleChar, NULL);
+ pgBind(this->hidden->wCanvas, PG_WE_KBD_KEYUP, &PG_HandleKey, NULL);
+ pgBind(this->hidden->wCanvas, PG_WE_KBD_KEYDOWN, &PG_HandleKey, NULL);
+ pgBind(this->hidden->wCanvas, PG_WE_PNTR_MOVE, &PG_HandleMouseMotion, NULL);
+ pgBind(this->hidden->wCanvas, PG_WE_PNTR_UP, &PG_HandleMouseButton, NULL);
+ pgBind(this->hidden->wCanvas, PG_WE_PNTR_DOWN, &PG_HandleMouseButton, this);
+}
+
+/* end of SDL_pgevents.c ... */
diff --git a/distrib/sdl-1.2.15/src/video/picogui/SDL_pgevents_c.h b/distrib/sdl-1.2.15/src/video/picogui/SDL_pgevents_c.h
new file mode 100644
index 0000000..a54e225
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/picogui/SDL_pgevents_c.h
@@ -0,0 +1,37 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ Micah Dowty
+ micahjd@users.sourceforge.net
+*/
+#include "SDL_config.h"
+
+#include "SDL_pgvideo.h"
+
+/* Variables and functions exported by SDL_sysevents.c to other parts
+ of the native video subsystem (SDL_sysvideo.c)
+*/
+extern void PG_PumpEvents(_THIS);
+extern void PG_InitEvents(_THIS);
+extern void PG_InitOSKeymap(_THIS);
+
+/* end of SDL_pgevents_c.h ... */
+
diff --git a/distrib/sdl-1.2.15/src/video/picogui/SDL_pgvideo.c b/distrib/sdl-1.2.15/src/video/picogui/SDL_pgvideo.c
new file mode 100644
index 0000000..18b3fe4
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/picogui/SDL_pgvideo.c
@@ -0,0 +1,364 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ Micah Dowty
+ micahjd@users.sourceforge.net
+*/
+#include "SDL_config.h"
+
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_pgvideo.h"
+#include "SDL_pgevents_c.h"
+
+#define PGVID_DRIVER_NAME "picogui"
+
+/* Initialization/Query functions */
+static int PG_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **PG_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *PG_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int PG_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
+static void PG_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int PG_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int PG_LockHWSurface(_THIS, SDL_Surface *surface);
+static void PG_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void PG_FreeHWSurface(_THIS, SDL_Surface *surface);
+
+/* etc. */
+static void PG_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
+
+// The implementation dependent data for the window manager cursor
+struct WMcursor {
+ /* Our cursor is a PicoGUI theme */
+ pghandle theme;
+} ;
+
+/* WM functions */
+void PG_SetCaption(_THIS, const char *title, const char *icon);
+WMcursor * PG_CreateWMCursor (_THIS,Uint8 * data, Uint8 * mask,
+ int w, int h, int hot_x, int hot_y);
+void PG_FreeWMCursor (_THIS, WMcursor * cursor);
+void PG_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
+int PG_ShowWMCursor (_THIS, WMcursor * cursor);
+
+/* PicoGUI driver bootstrap functions */
+
+static int PG_Available(void)
+{
+ /* FIXME: The current client lib doesn't give a way to see if the picogui
+ * server is reachable without causing a fatal error if it isn't.
+ * This should be fixed in cli_c2, but until then assume we can
+ * connect. Since more common drivers like X11 are probed first anyway,
+ * this shouldn't be a huge problem.
+ */
+ return(1);
+}
+
+static void PG_DeleteDevice(SDL_VideoDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_VideoDevice *PG_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device;
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *device->hidden));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( device ) {
+ SDL_free(device);
+ }
+ return(0);
+ }
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+
+ /* Set the function pointers */
+ device->VideoInit = PG_VideoInit;
+ device->ListModes = PG_ListModes;
+ device->SetVideoMode = PG_SetVideoMode;
+ device->CreateYUVOverlay = NULL;
+ device->SetColors = PG_SetColors;
+ device->UpdateRects = PG_UpdateRects;
+ device->VideoQuit = PG_VideoQuit;
+ device->AllocHWSurface = PG_AllocHWSurface;
+ device->CheckHWBlit = NULL;
+ device->FillHWRect = NULL;
+ device->SetHWColorKey = NULL;
+ device->SetHWAlpha = NULL;
+ device->LockHWSurface = PG_LockHWSurface;
+ device->UnlockHWSurface = PG_UnlockHWSurface;
+ device->FlipHWSurface = NULL;
+ device->FreeHWSurface = PG_FreeHWSurface;
+ device->SetCaption = PG_SetCaption;
+ device->SetIcon = NULL;
+ device->IconifyWindow = NULL;
+ device->GrabInput = NULL;
+
+ device->PumpEvents = PG_PumpEvents;
+ device->InitOSKeymap = PG_InitOSKeymap;
+
+ device->ShowWMCursor = PG_ShowWMCursor;
+ device->CreateWMCursor = PG_CreateWMCursor;
+ device->FreeWMCursor = PG_FreeWMCursor;
+ device->WarpWMCursor = PG_WarpWMCursor;
+
+ device->free = PG_DeleteDevice;
+
+ return device;
+}
+
+VideoBootStrap PG_bootstrap = {
+ PGVID_DRIVER_NAME, "PicoGUI SDL driver",
+ PG_Available, PG_CreateDevice
+};
+
+
+int PG_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ /* Connect to the PicoGUI server. No way to process command line args yet,
+ * but since this is based on SHM it's not important to be able to specify
+ * a remote PicoGUI server.
+ *
+ * FIXME: Another nitpick about the current client lib is there's no
+ * clean way to indicate that command line args are not available.
+ */
+ pgInit(0,(char**)"");
+ this->hidden->mi = *pgGetVideoMode();
+
+ /* Create a picogui application and canvas. We'll populate the canvas later. */
+ this->hidden->wApp = pgRegisterApp(PG_APP_NORMAL,"SDL",0);
+ this->hidden->wCanvas = pgNewWidget(PG_WIDGET_CANVAS,0,0);
+ pgSetWidget(PGDEFAULT,
+ PG_WP_SIDE, PG_S_ALL,
+ 0);
+
+ PG_InitEvents(this);
+
+ /* Determine the current screen size */
+ this->info.current_w = this->hidden->mi.lxres;
+ this->info.current_h = this->hidden->mi.lyres;
+
+ /* Determine the screen depth.
+ * We change this during the SDL_SetVideoMode implementation...
+ * Round up to the nearest Bytes per pixel
+ */
+ vformat->BitsPerPixel = this->hidden->mi.bpp;
+ vformat->BytesPerPixel = this->hidden->mi.bpp >> 3;
+ if (this->hidden->mi.bpp & 7)
+ vformat->BytesPerPixel++;
+
+ /* We're done! */
+ return(0);
+}
+
+SDL_Rect **PG_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ return (SDL_Rect **) -1;
+}
+
+SDL_Surface *PG_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ if ( this->hidden->bitmap ) {
+ /* Free old bitmap */
+ if (current->pixels) {
+ shmdt(current->pixels);
+ current->pixels = NULL;
+ }
+ pgDelete(this->hidden->bitmap);
+ }
+
+ /* Allocate the new pixel format for the screen */
+ if ( ! SDL_ReallocFormat(current, bpp, 0, 0, 0, 0) ) {
+ SDL_SetError("Couldn't allocate new pixel format for requested mode");
+ return(NULL);
+ }
+
+ /* Create a new picogui bitmap */
+ this->hidden->bitmap = pgCreateBitmap(width,height);
+ this->hidden->shm = *pgMakeSHMBitmap(this->hidden->bitmap);
+ current->pixels = shmat(shmget(this->hidden->shm.shm_key,
+ this->hidden->shm.shm_length,0),NULL,0);
+
+ /* Reset the canvas, and draw persistent and incremental grops.
+ * Use mapping and offsets to center it.
+ */
+
+ pgWriteCmd(this->hidden->wCanvas, PGCANVAS_NUKE, 0);
+
+ /* 0. Set the source position during incremental rendering
+ */
+ pgWriteCmd(this->hidden->wCanvas, PGCANVAS_GROP, 5, PG_GROP_SETSRC,0,0,0,0);
+ pgWriteCmd(this->hidden->wCanvas, PGCANVAS_GROPFLAGS, 1, PG_GROPF_INCREMENTAL);
+
+ /* 1. Incremental bitmap rendering
+ */
+ pgWriteCmd(this->hidden->wCanvas, PGCANVAS_GROP, 6, PG_GROP_BITMAP,
+ 0,0,0,0,this->hidden->bitmap);
+ pgWriteCmd(this->hidden->wCanvas, PGCANVAS_GROPFLAGS, 1, PG_GROPF_INCREMENTAL);
+
+ /* 2. Normal bitmap rendering
+ */
+ pgWriteCmd(this->hidden->wCanvas, PGCANVAS_GROP, 6, PG_GROP_BITMAP,
+ 0,0,this->hidden->shm.width,this->hidden->shm.height,this->hidden->bitmap);
+
+ /* Set up the new mode framebuffer */
+ current->flags = 0;
+ current->w = this->hidden->shm.width;
+ current->h = this->hidden->shm.height;
+ current->pitch = this->hidden->shm.pitch;
+
+ /* Set up pixel format */
+ current->format->BitsPerPixel = this->hidden->shm.bpp;
+ current->format->BytesPerPixel = this->hidden->shm.bpp >> 3;
+ if (this->hidden->shm.bpp & 7)
+ current->format->BytesPerPixel++;
+ current->format->palette = NULL;
+ current->format->Rmask = this->hidden->shm.red_mask;
+ current->format->Gmask = this->hidden->shm.green_mask;
+ current->format->Bmask = this->hidden->shm.blue_mask;
+ current->format->Amask = this->hidden->shm.alpha_mask;
+ current->format->Rshift = this->hidden->shm.red_shift;
+ current->format->Gshift = this->hidden->shm.green_shift;
+ current->format->Bshift = this->hidden->shm.blue_shift;
+ current->format->Ashift = this->hidden->shm.alpha_shift;
+ current->format->Rloss = 8 - this->hidden->shm.red_length;
+ current->format->Gloss = 8 - this->hidden->shm.green_length;
+ current->format->Bloss = 8 - this->hidden->shm.blue_length;
+ current->format->Aloss = 8 - this->hidden->shm.alpha_length;
+
+ /* Draw the app */
+ pgUpdate();
+
+ /* We're done */
+ return(current);
+}
+
+/* We don't actually allow hardware surfaces other than the main one */
+static int PG_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(-1);
+}
+static void PG_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+/* We need to wait for vertical retrace on page flipped displays */
+static int PG_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(0);
+}
+
+static void PG_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+static void PG_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
+{
+ int i;
+
+ for (i = 0; i < numrects; i++) {
+ if (rects[i].w <= 0 || rects[i].h <= 0)
+ continue;
+
+ /* Schedule an incremental update for this rectangle, using
+ * the canvas gropnodes we've loaded beforehand.
+ */
+ pgWriteCmd(this->hidden->wCanvas, PGCANVAS_FINDGROP, 1, 0);
+ pgWriteCmd(this->hidden->wCanvas, PGCANVAS_MOVEGROP, 4,
+ rects[i].x, rects[i].y,
+ rects[i].w, rects[i].h);
+ pgWriteCmd(this->hidden->wCanvas, PGCANVAS_FINDGROP, 1, 1);
+ pgWriteCmd(this->hidden->wCanvas, PGCANVAS_MOVEGROP, 4,
+ rects[i].x, rects[i].y,
+ rects[i].w, rects[i].h);
+
+ /* Go perform the update */
+ pgWriteCmd(this->hidden->wCanvas, PGCANVAS_INCREMENTAL, 0);
+ pgSubUpdate(this->hidden->wCanvas);
+ }
+}
+
+int PG_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ /* do nothing of note. */
+ return(1);
+}
+
+/* Note: If we are terminated, this could be called in the middle of
+ another SDL video routine -- notably UpdateRects.
+*/
+void PG_VideoQuit(_THIS)
+{
+ if (this->screen->pixels != NULL)
+ {
+ shmdt(this->screen->pixels);
+ this->screen->pixels = NULL;
+ pgDelete(this->hidden->bitmap);
+ }
+ pgDelete(this->hidden->wCanvas);
+ pgDelete(this->hidden->wApp);
+}
+
+void PG_SetCaption(_THIS, const char *title, const char *icon)
+{
+ if (title != NULL)
+ pgReplaceText(this->hidden->wApp, title);
+ pgUpdate();
+}
+
+/* FIXME: The cursor stuff isn't implemented yet! */
+
+WMcursor * PG_CreateWMCursor (_THIS,Uint8 * data, Uint8 * mask,
+ int w, int h, int hot_x, int hot_y)
+{
+ static WMcursor dummy;
+ return &dummy;
+}
+
+void PG_FreeWMCursor (_THIS, WMcursor * cursor)
+{
+}
+
+void PG_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
+{
+}
+
+int PG_ShowWMCursor (_THIS, WMcursor * cursor)
+{
+ return 1;
+}
diff --git a/distrib/sdl-1.2.15/src/video/picogui/SDL_pgvideo.h b/distrib/sdl-1.2.15/src/video/picogui/SDL_pgvideo.h
new file mode 100644
index 0000000..155f86b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/picogui/SDL_pgvideo.h
@@ -0,0 +1,50 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+
+ Micah Dowty
+ micahjd@users.sourceforge.net
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_pgvideo_h
+#define _SDL_pgvideo_h
+
+#include "SDL_mouse.h"
+#include "SDL_mutex.h"
+#include "../SDL_sysvideo.h"
+
+#include <picogui.h>
+#include <sys/shm.h>
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+
+/* Private display data */
+
+struct SDL_PrivateVideoData {
+ pghandle wApp, wCanvas; /* PicoGUI widgets */
+ pghandle bitmap;
+ struct pgshmbitmap shm; /* shared memory info */
+ struct pgmodeinfo mi; /* PicoGUI video mode info structure */
+};
+
+#endif /* _SDL_pgvideo_h */
diff --git a/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsevents.c b/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsevents.c
new file mode 100644
index 0000000..1b842af
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsevents.c
@@ -0,0 +1,977 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Handle the event stream, converting console events into SDL events */
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <limits.h>
+
+/* For parsing /proc */
+#include <dirent.h>
+#include <ctype.h>
+
+#include <linux/vt.h>
+#include <linux/kd.h>
+#include <linux/keyboard.h>
+
+#include "SDL_mutex.h"
+#include "../SDL_sysvideo.h"
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_gsvideo.h"
+#include "SDL_gsevents_c.h"
+#include "SDL_gskeys.h"
+
+#ifndef GPM_NODE_FIFO
+#define GPM_NODE_FIFO "/dev/gpmdata"
+#endif
+
+/* The translation tables from a console scancode to a SDL keysym */
+#define NUM_VGAKEYMAPS (1<<KG_CAPSSHIFT)
+static Uint16 vga_keymap[NUM_VGAKEYMAPS][NR_KEYS];
+static SDLKey keymap[128];
+static Uint16 keymap_temp[128]; /* only used at startup */
+static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym);
+
+/* Ugh, we have to duplicate the kernel's keysym mapping code...
+ Oh, it's not so bad. :-)
+
+ FIXME: Add keyboard LED handling code
+ */
+static void GS_vgainitkeymaps(int fd)
+{
+ struct kbentry entry;
+ int map, i;
+
+ /* Don't do anything if we are passed a closed keyboard */
+ if ( fd < 0 ) {
+ return;
+ }
+
+ /* Load all the keysym mappings */
+ for ( map=0; map<NUM_VGAKEYMAPS; ++map ) {
+ SDL_memset(vga_keymap[map], 0, NR_KEYS*sizeof(Uint16));
+ for ( i=0; i<NR_KEYS; ++i ) {
+ entry.kb_table = map;
+ entry.kb_index = i;
+ if ( ioctl(fd, KDGKBENT, &entry) == 0 ) {
+ /* fill keytemp. This replaces SDL_fbkeys.h */
+ if ( (map == 0) && (i<128) ) {
+ keymap_temp[i] = entry.kb_value;
+ }
+ /* The "Enter" key is a special case */
+ if ( entry.kb_value == K_ENTER ) {
+ entry.kb_value = K(KT_ASCII,13);
+ }
+ /* Handle numpad specially as well */
+ if ( KTYP(entry.kb_value) == KT_PAD ) {
+ switch ( entry.kb_value ) {
+ case K_P0:
+ case K_P1:
+ case K_P2:
+ case K_P3:
+ case K_P4:
+ case K_P5:
+ case K_P6:
+ case K_P7:
+ case K_P8:
+ case K_P9:
+ vga_keymap[map][i]=entry.kb_value;
+ vga_keymap[map][i]+= '0';
+ break;
+ case K_PPLUS:
+ vga_keymap[map][i]=K(KT_ASCII,'+');
+ break;
+ case K_PMINUS:
+ vga_keymap[map][i]=K(KT_ASCII,'-');
+ break;
+ case K_PSTAR:
+ vga_keymap[map][i]=K(KT_ASCII,'*');
+ break;
+ case K_PSLASH:
+ vga_keymap[map][i]=K(KT_ASCII,'/');
+ break;
+ case K_PENTER:
+ vga_keymap[map][i]=K(KT_ASCII,'\r');
+ break;
+ case K_PCOMMA:
+ vga_keymap[map][i]=K(KT_ASCII,',');
+ break;
+ case K_PDOT:
+ vga_keymap[map][i]=K(KT_ASCII,'.');
+ break;
+ default:
+ break;
+ }
+ }
+ /* Do the normal key translation */
+ if ( (KTYP(entry.kb_value) == KT_LATIN) ||
+ (KTYP(entry.kb_value) == KT_ASCII) ||
+ (KTYP(entry.kb_value) == KT_LETTER) ) {
+ vga_keymap[map][i] = entry.kb_value;
+ }
+ }
+ }
+ }
+}
+
+int GS_InGraphicsMode(_THIS)
+{
+ return((keyboard_fd >= 0) && (saved_kbd_mode >= 0));
+}
+
+int GS_EnterGraphicsMode(_THIS)
+{
+ struct termios keyboard_termios;
+
+ /* Set medium-raw keyboard mode */
+ if ( (keyboard_fd >= 0) && !GS_InGraphicsMode(this) ) {
+
+ /* Switch to the correct virtual terminal */
+ if ( current_vt > 0 ) {
+ struct vt_stat vtstate;
+
+ if ( ioctl(keyboard_fd, VT_GETSTATE, &vtstate) == 0 ) {
+ saved_vt = vtstate.v_active;
+ }
+ if ( ioctl(keyboard_fd, VT_ACTIVATE, current_vt) == 0 ) {
+ ioctl(keyboard_fd, VT_WAITACTIVE, current_vt);
+ }
+ }
+
+ /* Set the terminal input mode */
+ if ( tcgetattr(keyboard_fd, &saved_kbd_termios) < 0 ) {
+ SDL_SetError("Unable to get terminal attributes");
+ if ( keyboard_fd > 0 ) {
+ close(keyboard_fd);
+ }
+ keyboard_fd = -1;
+ return(-1);
+ }
+ if ( ioctl(keyboard_fd, KDGKBMODE, &saved_kbd_mode) < 0 ) {
+ SDL_SetError("Unable to get current keyboard mode");
+ if ( keyboard_fd > 0 ) {
+ close(keyboard_fd);
+ }
+ keyboard_fd = -1;
+ return(-1);
+ }
+ keyboard_termios = saved_kbd_termios;
+ keyboard_termios.c_lflag &= ~(ICANON | ECHO | ISIG);
+ keyboard_termios.c_iflag &= ~(ISTRIP | IGNCR | ICRNL | INLCR | IXOFF | IXON);
+ keyboard_termios.c_cc[VMIN] = 0;
+ keyboard_termios.c_cc[VTIME] = 0;
+ if (tcsetattr(keyboard_fd, TCSAFLUSH, &keyboard_termios) < 0) {
+ GS_CloseKeyboard(this);
+ SDL_SetError("Unable to set terminal attributes");
+ return(-1);
+ }
+ /* This will fail if we aren't root or this isn't our tty */
+ if ( ioctl(keyboard_fd, KDSKBMODE, K_MEDIUMRAW) < 0 ) {
+ GS_CloseKeyboard(this);
+ SDL_SetError("Unable to set keyboard in raw mode");
+ return(-1);
+ }
+ if ( ioctl(keyboard_fd, KDSETMODE, KD_GRAPHICS) < 0 ) {
+ GS_CloseKeyboard(this);
+ SDL_SetError("Unable to set keyboard in graphics mode");
+ return(-1);
+ }
+ }
+ return(keyboard_fd);
+}
+
+void GS_LeaveGraphicsMode(_THIS)
+{
+ if ( GS_InGraphicsMode(this) ) {
+ ioctl(keyboard_fd, KDSETMODE, KD_TEXT);
+ ioctl(keyboard_fd, KDSKBMODE, saved_kbd_mode);
+ tcsetattr(keyboard_fd, TCSAFLUSH, &saved_kbd_termios);
+ saved_kbd_mode = -1;
+
+ /* Head back over to the original virtual terminal */
+ if ( saved_vt > 0 ) {
+ ioctl(keyboard_fd, VT_ACTIVATE, saved_vt);
+ }
+ }
+}
+
+void GS_CloseKeyboard(_THIS)
+{
+ if ( keyboard_fd >= 0 ) {
+ GS_LeaveGraphicsMode(this);
+ if ( keyboard_fd > 0 ) {
+ close(keyboard_fd);
+ }
+ }
+ keyboard_fd = -1;
+}
+
+int GS_OpenKeyboard(_THIS)
+{
+ /* Open only if not already opened */
+ if ( keyboard_fd < 0 ) {
+ char *tty0[] = { "/dev/tty0", "/dev/vc/0", NULL };
+ char *vcs[] = { "/dev/vc/%d", "/dev/tty%d", NULL };
+ int i, tty0_fd;
+
+ /* Try to query for a free virtual terminal */
+ tty0_fd = -1;
+ for ( i=0; tty0[i] && (tty0_fd < 0); ++i ) {
+ tty0_fd = open(tty0[i], O_WRONLY, 0);
+ }
+ if ( tty0_fd < 0 ) {
+ tty0_fd = dup(0); /* Maybe stdin is a VT? */
+ }
+ ioctl(tty0_fd, VT_OPENQRY, &current_vt);
+ close(tty0_fd);
+ if ( (geteuid() == 0) && (current_vt > 0) ) {
+ for ( i=0; vcs[i] && (keyboard_fd < 0); ++i ) {
+ char vtpath[12];
+
+ SDL_snprintf(vtpath, SDL_arraysize(vtpath), vcs[i], current_vt);
+ keyboard_fd = open(vtpath, O_RDWR, 0);
+#ifdef DEBUG_KEYBOARD
+ fprintf(stderr, "vtpath = %s, fd = %d\n",
+ vtpath, keyboard_fd);
+#endif /* DEBUG_KEYBOARD */
+
+ /* This needs to be our controlling tty
+ so that the kernel ioctl() calls work
+ */
+ if ( keyboard_fd >= 0 ) {
+ tty0_fd = open("/dev/tty", O_RDWR, 0);
+ if ( tty0_fd >= 0 ) {
+ ioctl(tty0_fd, TIOCNOTTY, 0);
+ close(tty0_fd);
+ }
+ }
+ }
+ }
+ if ( keyboard_fd < 0 ) {
+ /* Last resort, maybe our tty is a usable VT */
+ current_vt = 0;
+ keyboard_fd = open("/dev/tty", O_RDWR);
+ }
+#ifdef DEBUG_KEYBOARD
+ fprintf(stderr, "Current VT: %d\n", current_vt);
+#endif
+ saved_kbd_mode = -1;
+
+ /* Make sure that our input is a console terminal */
+ { int dummy;
+ if ( ioctl(keyboard_fd, KDGKBMODE, &dummy) < 0 ) {
+ close(keyboard_fd);
+ keyboard_fd = -1;
+ SDL_SetError("Unable to open a console terminal");
+ }
+ }
+
+ /* Set up keymap */
+ GS_vgainitkeymaps(keyboard_fd);
+ }
+ return(keyboard_fd);
+}
+
+static enum {
+ MOUSE_NONE = -1,
+ MOUSE_GPM, /* Note: GPM uses the MSC protocol */
+ MOUSE_PS2,
+ MOUSE_IMPS2,
+ MOUSE_MS,
+ MOUSE_BM,
+ NUM_MOUSE_DRVS
+} mouse_drv = MOUSE_NONE;
+
+void GS_CloseMouse(_THIS)
+{
+ if ( mouse_fd > 0 ) {
+ close(mouse_fd);
+ }
+ mouse_fd = -1;
+}
+
+/* Returns processes listed in /proc with the desired name */
+static int find_pid(DIR *proc, const char *wanted_name)
+{
+ struct dirent *entry;
+ int pid;
+
+ /* First scan proc for the gpm process */
+ pid = 0;
+ while ( (pid == 0) && ((entry=readdir(proc)) != NULL) ) {
+ if ( isdigit(entry->d_name[0]) ) {
+ FILE *status;
+ char path[PATH_MAX];
+ char name[PATH_MAX];
+
+ SDL_snprintf(path, SDL_arraysize(path), "/proc/%s/status", entry->d_name);
+ status=fopen(path, "r");
+ if ( status ) {
+ name[0] = '\0';
+ fscanf(status, "Name: %s", name);
+ if ( SDL_strcmp(name, wanted_name) == 0 ) {
+ pid = atoi(entry->d_name);
+ }
+ fclose(status);
+ }
+ }
+ }
+ return pid;
+}
+
+/* Returns true if /dev/gpmdata is being written to by gpm */
+static int gpm_available(void)
+{
+ int available;
+ DIR *proc;
+ int pid;
+ int cmdline, len, arglen;
+ char path[PATH_MAX];
+ char args[PATH_MAX], *arg;
+
+ /* Don't bother looking if the fifo isn't there */
+ if ( access(GPM_NODE_FIFO, F_OK) < 0 ) {
+ return(0);
+ }
+
+ available = 0;
+ proc = opendir("/proc");
+ if ( proc ) {
+ while ( (pid=find_pid(proc, "gpm")) > 0 ) {
+ SDL_snprintf(path, SDL_arraysize(path), "/proc/%d/cmdline", pid);
+ cmdline = open(path, O_RDONLY, 0);
+ if ( cmdline >= 0 ) {
+ len = read(cmdline, args, sizeof(args));
+ arg = args;
+ while ( len > 0 ) {
+ if ( SDL_strcmp(arg, "-R") == 0 ) {
+ available = 1;
+ }
+ arglen = SDL_strlen(arg)+1;
+ len -= arglen;
+ arg += arglen;
+ }
+ close(cmdline);
+ }
+ }
+ closedir(proc);
+ }
+ return available;
+}
+
+
+/* rcg06112001 Set up IMPS/2 mode, if possible. This gives
+ * us access to the mousewheel, etc. Returns zero if
+ * writes to device failed, but you still need to query the
+ * device to see which mode it's actually in.
+ */
+static int set_imps2_mode(int fd)
+{
+ /* If you wanted to control the mouse mode (and we do :) ) ...
+ Set IMPS/2 protocol:
+ {0xf3,200,0xf3,100,0xf3,80}
+ Reset mouse device:
+ {0xFF}
+ */
+ Uint8 set_imps2[] = {0xf3, 200, 0xf3, 100, 0xf3, 80};
+ Uint8 reset = 0xff;
+ fd_set fdset;
+ struct timeval tv;
+ int retval = 0;
+
+ if ( write(fd, &set_imps2, sizeof(set_imps2)) == sizeof(set_imps2) ) {
+ if (write(fd, &reset, sizeof (reset)) == sizeof (reset) ) {
+ retval = 1;
+ }
+ }
+
+ /* Get rid of any chatter from the above */
+ FD_ZERO(&fdset);
+ FD_SET(fd, &fdset);
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+ while ( select(fd+1, &fdset, 0, 0, &tv) > 0 ) {
+ char temp[32];
+ read(fd, temp, sizeof(temp));
+ }
+
+ return retval;
+}
+
+
+/* Returns true if the mouse uses the IMPS/2 protocol */
+static int detect_imps2(int fd)
+{
+ int imps2;
+
+ imps2 = 0;
+
+ if ( SDL_getenv("SDL_MOUSEDEV_IMPS2") ) {
+ imps2 = 1;
+ }
+ if ( ! imps2 ) {
+ Uint8 query_ps2 = 0xF2;
+ fd_set fdset;
+ struct timeval tv;
+
+ /* Get rid of any mouse motion noise */
+ FD_ZERO(&fdset);
+ FD_SET(fd, &fdset);
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+ while ( select(fd+1, &fdset, 0, 0, &tv) > 0 ) {
+ char temp[32];
+ read(fd, temp, sizeof(temp));
+ }
+
+ /* Query for the type of mouse protocol */
+ if ( write(fd, &query_ps2, sizeof (query_ps2)) == sizeof (query_ps2)) {
+ Uint8 ch = 0;
+
+ /* Get the mouse protocol response */
+ do {
+ FD_ZERO(&fdset);
+ FD_SET(fd, &fdset);
+ tv.tv_sec = 1;
+ tv.tv_usec = 0;
+ if ( select(fd+1, &fdset, 0, 0, &tv) < 1 ) {
+ break;
+ }
+ } while ( (read(fd, &ch, sizeof (ch)) == sizeof (ch)) &&
+ ((ch == 0xFA) || (ch == 0xAA)) );
+
+ /* Experimental values (Logitech wheelmouse) */
+#ifdef DEBUG_MOUSE
+fprintf(stderr, "Last mouse mode: 0x%x\n", ch);
+#endif
+ if ( ch == 3 ) {
+ imps2 = 1;
+ }
+ }
+ }
+ return imps2;
+}
+
+int GS_OpenMouse(_THIS)
+{
+ int i;
+ const char *mousedev;
+ const char *mousedrv;
+
+ mousedrv = SDL_getenv("SDL_MOUSEDRV");
+ mousedev = SDL_getenv("SDL_MOUSEDEV");
+ mouse_fd = -1;
+
+ /* STD MICE */
+
+ if ( mousedev == NULL ) {
+ /* FIXME someday... allow multiple mice in this driver */
+ char *ps2mice[] = {
+ "/dev/input/mice", "/dev/usbmouse", "/dev/psaux", NULL
+ };
+ /* First try to use GPM in repeater mode */
+ if ( mouse_fd < 0 ) {
+ if ( gpm_available() ) {
+ mouse_fd = open(GPM_NODE_FIFO, O_RDONLY, 0);
+ if ( mouse_fd >= 0 ) {
+#ifdef DEBUG_MOUSE
+fprintf(stderr, "Using GPM mouse\n");
+#endif
+ mouse_drv = MOUSE_GPM;
+ }
+ }
+ }
+ /* Now try to use a modern PS/2 mouse */
+ for ( i=0; (mouse_fd < 0) && ps2mice[i]; ++i ) {
+ mouse_fd = open(ps2mice[i], O_RDWR, 0);
+ if (mouse_fd < 0) {
+ mouse_fd = open(ps2mice[i], O_RDONLY, 0);
+ }
+ if (mouse_fd >= 0) {
+ /* rcg06112001 Attempt to set IMPS/2 mode */
+ if ( i == 0 ) {
+ set_imps2_mode(mouse_fd);
+ }
+ if (detect_imps2(mouse_fd)) {
+#ifdef DEBUG_MOUSE
+fprintf(stderr, "Using IMPS2 mouse\n");
+#endif
+ mouse_drv = MOUSE_IMPS2;
+ } else {
+ mouse_drv = MOUSE_PS2;
+#ifdef DEBUG_MOUSE
+fprintf(stderr, "Using PS2 mouse\n");
+#endif
+ }
+ }
+ }
+ /* Next try to use a PPC ADB port mouse */
+ if ( mouse_fd < 0 ) {
+ mouse_fd = open("/dev/adbmouse", O_RDONLY, 0);
+ if ( mouse_fd >= 0 ) {
+#ifdef DEBUG_MOUSE
+fprintf(stderr, "Using ADB mouse\n");
+#endif
+ mouse_drv = MOUSE_BM;
+ }
+ }
+ }
+ /* Default to a serial Microsoft mouse */
+ if ( mouse_fd < 0 ) {
+ if ( mousedev == NULL ) {
+ mousedev = "/dev/mouse";
+ }
+ mouse_fd = open(mousedev, O_RDONLY, 0);
+ if ( mouse_fd >= 0 ) {
+ struct termios mouse_termios;
+
+ /* Set the sampling speed to 1200 baud */
+ tcgetattr(mouse_fd, &mouse_termios);
+ mouse_termios.c_iflag = IGNBRK | IGNPAR;
+ mouse_termios.c_oflag = 0;
+ mouse_termios.c_lflag = 0;
+ mouse_termios.c_line = 0;
+ mouse_termios.c_cc[VTIME] = 0;
+ mouse_termios.c_cc[VMIN] = 1;
+ mouse_termios.c_cflag = CREAD | CLOCAL | HUPCL;
+ mouse_termios.c_cflag |= CS8;
+ mouse_termios.c_cflag |= B1200;
+ tcsetattr(mouse_fd, TCSAFLUSH, &mouse_termios);
+#ifdef DEBUG_MOUSE
+fprintf(stderr, "Using Microsoft mouse on %s\n", mousedev);
+#endif
+ mouse_drv = MOUSE_MS;
+ }
+ }
+ if ( mouse_fd < 0 ) {
+ mouse_drv = MOUSE_NONE;
+ }
+ return(mouse_fd);
+}
+
+static int posted = 0;
+
+void GS_vgamousecallback(int button, int dx, int dy)
+{
+ int button_1, button_3;
+ int button_state;
+ int state_changed;
+ int i;
+ Uint8 state;
+
+ if ( dx || dy ) {
+ posted += SDL_PrivateMouseMotion(0, 1, dx, dy);
+ }
+
+ /* Swap button 1 and 3 */
+ button_1 = (button & 0x04) >> 2;
+ button_3 = (button & 0x01) << 2;
+ button &= ~0x05;
+ button |= (button_1|button_3);
+
+ /* See what changed */
+ button_state = SDL_GetMouseState(NULL, NULL);
+ state_changed = button_state ^ button;
+ for ( i=0; i<8; ++i ) {
+ if ( state_changed & (1<<i) ) {
+ if ( button & (1<<i) ) {
+ state = SDL_PRESSED;
+ } else {
+ state = SDL_RELEASED;
+ }
+ posted += SDL_PrivateMouseButton(state, i+1, 0, 0);
+ }
+ }
+}
+
+/* For now, use GPM, PS/2, and MS protocols
+ Driver adapted from the SVGAlib mouse driver code (taken from gpm, etc.)
+ */
+static void handle_mouse(_THIS)
+{
+ static int start = 0;
+ static unsigned char mousebuf[BUFSIZ];
+ int i, nread;
+ int button = 0;
+ int dx = 0, dy = 0;
+ int packetsize = 0;
+
+ /* Figure out the mouse packet size */
+ switch (mouse_drv) {
+ case MOUSE_NONE:
+ /* Ack! */
+ read(mouse_fd, mousebuf, BUFSIZ);
+ return;
+ case MOUSE_GPM:
+ packetsize = 5;
+ break;
+ case MOUSE_IMPS2:
+ packetsize = 4;
+ break;
+ case MOUSE_PS2:
+ case MOUSE_MS:
+ case MOUSE_BM:
+ packetsize = 3;
+ break;
+ case NUM_MOUSE_DRVS:
+ /* Uh oh.. */
+ packetsize = 0;
+ break;
+ }
+
+ /* Read as many packets as possible */
+ nread = read(mouse_fd, &mousebuf[start], BUFSIZ-start);
+ if ( nread < 0 ) {
+ return;
+ }
+ nread += start;
+#ifdef DEBUG_MOUSE
+ fprintf(stderr, "Read %d bytes from mouse, start = %d\n", nread, start);
+#endif
+ for ( i=0; i<(nread-(packetsize-1)); i += packetsize ) {
+ switch (mouse_drv) {
+ case MOUSE_NONE:
+ break;
+ case MOUSE_GPM:
+ /* GPM protocol has 0x80 in high byte */
+ if ( (mousebuf[i] & 0xF8) != 0x80 ) {
+ /* Go to next byte */
+ i -= (packetsize-1);
+ continue;
+ }
+ /* Get current mouse state */
+ button = (~mousebuf[i]) & 0x07;
+ dx = (signed char)(mousebuf[i+1]) +
+ (signed char)(mousebuf[i+3]);
+ dy = -((signed char)(mousebuf[i+2]) +
+ (signed char)(mousebuf[i+4]));
+ break;
+ case MOUSE_PS2:
+ /* PS/2 protocol has nothing in high byte */
+ if ( (mousebuf[i] & 0xC0) != 0 ) {
+ /* Go to next byte */
+ i -= (packetsize-1);
+ continue;
+ }
+ /* Get current mouse state */
+ button = (mousebuf[i] & 0x04) >> 1 | /*Middle*/
+ (mousebuf[i] & 0x02) >> 1 | /*Right*/
+ (mousebuf[i] & 0x01) << 2; /*Left*/
+ dx = (mousebuf[i] & 0x10) ?
+ mousebuf[i+1] - 256 : mousebuf[i+1];
+ dy = (mousebuf[i] & 0x20) ?
+ -(mousebuf[i+2] - 256) : -mousebuf[i+2];
+ break;
+ case MOUSE_IMPS2:
+ /* Get current mouse state */
+ button = (mousebuf[i] & 0x04) >> 1 | /*Middle*/
+ (mousebuf[i] & 0x02) >> 1 | /*Right*/
+ (mousebuf[i] & 0x01) << 2 | /*Left*/
+ (mousebuf[i] & 0x40) >> 3 | /* 4 */
+ (mousebuf[i] & 0x80) >> 3; /* 5 */
+ dx = (mousebuf[i] & 0x10) ?
+ mousebuf[i+1] - 256 : mousebuf[i+1];
+ dy = (mousebuf[i] & 0x20) ?
+ -(mousebuf[i+2] - 256) : -mousebuf[i+2];
+ switch (mousebuf[i+3]&0x0F) {
+ case 0x0E: /* DX = +1 */
+ case 0x02: /* DX = -1 */
+ break;
+ case 0x0F: /* DY = +1 (map button 4) */
+ FB_vgamousecallback(button | (1<<3),
+ 1, 0, 0);
+ break;
+ case 0x01: /* DY = -1 (map button 5) */
+ FB_vgamousecallback(button | (1<<4),
+ 1, 0, 0);
+ break;
+ }
+ break;
+ case MOUSE_MS:
+ /* Microsoft protocol has 0x40 in high byte */
+ if ( (mousebuf[i] & 0x40) != 0x40 ) {
+ /* Go to next byte */
+ i -= (packetsize-1);
+ continue;
+ }
+ /* Get current mouse state */
+ button = ((mousebuf[i] & 0x20) >> 3) |
+ ((mousebuf[i] & 0x10) >> 4);
+ dx = (signed char)(((mousebuf[i] & 0x03) << 6) |
+ (mousebuf[i + 1] & 0x3F));
+ dy = (signed char)(((mousebuf[i] & 0x0C) << 4) |
+ (mousebuf[i + 2] & 0x3F));
+ break;
+ case MOUSE_BM:
+ /* BusMouse protocol has 0xF8 in high byte */
+ if ( (mousebuf[i] & 0xF8) != 0x80 ) {
+ /* Go to next byte */
+ i -= (packetsize-1);
+ continue;
+ }
+ /* Get current mouse state */
+ button = (~mousebuf[i]) & 0x07;
+ dx = (signed char)mousebuf[i+1];
+ dy = -(signed char)mousebuf[i+2];
+ break;
+ case NUM_MOUSE_DRVS:
+ /* Uh oh.. */
+ dx = 0;
+ dy = 0;
+ break;
+ }
+ GS_vgamousecallback(button, dx, dy);
+ }
+ if ( i < nread ) {
+ SDL_memcpy(mousebuf, &mousebuf[i], (nread-i));
+ start = (nread-i);
+ } else {
+ start = 0;
+ }
+ return;
+}
+
+static void handle_keyboard(_THIS)
+{
+ unsigned char keybuf[BUFSIZ];
+ int i, nread;
+ int pressed;
+ int scancode;
+ SDL_keysym keysym;
+
+ nread = read(keyboard_fd, keybuf, BUFSIZ);
+ for ( i=0; i<nread; ++i ) {
+ scancode = keybuf[i] & 0x7F;
+ if ( keybuf[i] & 0x80 ) {
+ pressed = SDL_RELEASED;
+ } else {
+ pressed = SDL_PRESSED;
+ }
+ TranslateKey(scancode, &keysym);
+ posted += SDL_PrivateKeyboard(pressed, &keysym);
+ }
+}
+
+void GS_PumpEvents(_THIS)
+{
+ fd_set fdset;
+ int max_fd;
+ static struct timeval zero;
+
+ do {
+ posted = 0;
+
+ FD_ZERO(&fdset);
+ max_fd = 0;
+ if ( keyboard_fd >= 0 ) {
+ FD_SET(keyboard_fd, &fdset);
+ if ( max_fd < keyboard_fd ) {
+ max_fd = keyboard_fd;
+ }
+ }
+ if ( mouse_fd >= 0 ) {
+ FD_SET(mouse_fd, &fdset);
+ if ( max_fd < mouse_fd ) {
+ max_fd = mouse_fd;
+ }
+ }
+ if ( select(max_fd+1, &fdset, NULL, NULL, &zero) > 0 ) {
+ if ( keyboard_fd >= 0 ) {
+ if ( FD_ISSET(keyboard_fd, &fdset) ) {
+ handle_keyboard(this);
+ }
+ }
+ if ( mouse_fd >= 0 ) {
+ if ( FD_ISSET(mouse_fd, &fdset) ) {
+ handle_mouse(this);
+ }
+ }
+ }
+ } while ( posted );
+}
+
+void GS_InitOSKeymap(_THIS)
+{
+ int i;
+
+ /* Initialize the Linux key translation table */
+
+ /* First get the ascii keys and others not well handled */
+ for (i=0; i<SDL_arraysize(keymap); ++i) {
+ switch(i) {
+ /* These aren't handled by the x86 kernel keymapping (?) */
+ case SCANCODE_PRINTSCREEN:
+ keymap[i] = SDLK_PRINT;
+ break;
+ case SCANCODE_BREAK:
+ keymap[i] = SDLK_BREAK;
+ break;
+ case SCANCODE_BREAK_ALTERNATIVE:
+ keymap[i] = SDLK_PAUSE;
+ break;
+ case SCANCODE_LEFTSHIFT:
+ keymap[i] = SDLK_LSHIFT;
+ break;
+ case SCANCODE_RIGHTSHIFT:
+ keymap[i] = SDLK_RSHIFT;
+ break;
+ case SCANCODE_LEFTCONTROL:
+ keymap[i] = SDLK_LCTRL;
+ break;
+ case SCANCODE_RIGHTCONTROL:
+ keymap[i] = SDLK_RCTRL;
+ break;
+ case SCANCODE_RIGHTWIN:
+ keymap[i] = SDLK_RSUPER;
+ break;
+ case SCANCODE_LEFTWIN:
+ keymap[i] = SDLK_LSUPER;
+ break;
+ case 127:
+ keymap[i] = SDLK_MENU;
+ break;
+ /* this should take care of all standard ascii keys */
+ default:
+ keymap[i] = KVAL(vga_keymap[0][i]);
+ break;
+ }
+ }
+ for (i=0; i<SDL_arraysize(keymap); ++i) {
+ switch(keymap_temp[i]) {
+ case K_F1: keymap[i] = SDLK_F1; break;
+ case K_F2: keymap[i] = SDLK_F2; break;
+ case K_F3: keymap[i] = SDLK_F3; break;
+ case K_F4: keymap[i] = SDLK_F4; break;
+ case K_F5: keymap[i] = SDLK_F5; break;
+ case K_F6: keymap[i] = SDLK_F6; break;
+ case K_F7: keymap[i] = SDLK_F7; break;
+ case K_F8: keymap[i] = SDLK_F8; break;
+ case K_F9: keymap[i] = SDLK_F9; break;
+ case K_F10: keymap[i] = SDLK_F10; break;
+ case K_F11: keymap[i] = SDLK_F11; break;
+ case K_F12: keymap[i] = SDLK_F12; break;
+
+ case K_DOWN: keymap[i] = SDLK_DOWN; break;
+ case K_LEFT: keymap[i] = SDLK_LEFT; break;
+ case K_RIGHT: keymap[i] = SDLK_RIGHT; break;
+ case K_UP: keymap[i] = SDLK_UP; break;
+
+ case K_P0: keymap[i] = SDLK_KP0; break;
+ case K_P1: keymap[i] = SDLK_KP1; break;
+ case K_P2: keymap[i] = SDLK_KP2; break;
+ case K_P3: keymap[i] = SDLK_KP3; break;
+ case K_P4: keymap[i] = SDLK_KP4; break;
+ case K_P5: keymap[i] = SDLK_KP5; break;
+ case K_P6: keymap[i] = SDLK_KP6; break;
+ case K_P7: keymap[i] = SDLK_KP7; break;
+ case K_P8: keymap[i] = SDLK_KP8; break;
+ case K_P9: keymap[i] = SDLK_KP9; break;
+ case K_PPLUS: keymap[i] = SDLK_KP_PLUS; break;
+ case K_PMINUS: keymap[i] = SDLK_KP_MINUS; break;
+ case K_PSTAR: keymap[i] = SDLK_KP_MULTIPLY; break;
+ case K_PSLASH: keymap[i] = SDLK_KP_DIVIDE; break;
+ case K_PENTER: keymap[i] = SDLK_KP_ENTER; break;
+ case K_PDOT: keymap[i] = SDLK_KP_PERIOD; break;
+
+ case K_SHIFT: if ( keymap[i] != SDLK_RSHIFT )
+ keymap[i] = SDLK_LSHIFT;
+ break;
+ case K_SHIFTL: keymap[i] = SDLK_LSHIFT; break;
+ case K_SHIFTR: keymap[i] = SDLK_RSHIFT; break;
+ case K_CTRL: if ( keymap[i] != SDLK_RCTRL )
+ keymap[i] = SDLK_LCTRL;
+ break;
+ case K_CTRLL: keymap[i] = SDLK_LCTRL; break;
+ case K_CTRLR: keymap[i] = SDLK_RCTRL; break;
+ case K_ALT: keymap[i] = SDLK_LALT; break;
+ case K_ALTGR: keymap[i] = SDLK_RALT; break;
+
+ case K_INSERT: keymap[i] = SDLK_INSERT; break;
+ case K_REMOVE: keymap[i] = SDLK_DELETE; break;
+ case K_PGUP: keymap[i] = SDLK_PAGEUP; break;
+ case K_PGDN: keymap[i] = SDLK_PAGEDOWN; break;
+ case K_FIND: keymap[i] = SDLK_HOME; break;
+ case K_SELECT: keymap[i] = SDLK_END; break;
+
+ case K_NUM: keymap[i] = SDLK_NUMLOCK; break;
+ case K_CAPS: keymap[i] = SDLK_CAPSLOCK; break;
+
+ case K_F13: keymap[i] = SDLK_PRINT; break;
+ case K_HOLD: keymap[i] = SDLK_SCROLLOCK; break;
+ case K_PAUSE: keymap[i] = SDLK_PAUSE; break;
+
+ case 127: keymap[i] = SDLK_BACKSPACE; break;
+
+ default: break;
+ }
+ }
+}
+
+static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym)
+{
+ /* Set the keysym information */
+ keysym->scancode = scancode;
+ keysym->sym = keymap[scancode];
+ keysym->mod = KMOD_NONE;
+
+ /* If UNICODE is on, get the UNICODE value for the key */
+ keysym->unicode = 0;
+ if ( SDL_TranslateUNICODE ) {
+ int map;
+ SDLMod modstate;
+
+ modstate = SDL_GetModState();
+ map = 0;
+ if ( modstate & KMOD_SHIFT ) {
+ map |= (1<<KG_SHIFT);
+ }
+ if ( modstate & KMOD_CTRL ) {
+ map |= (1<<KG_CTRL);
+ }
+ if ( modstate & KMOD_ALT ) {
+ map |= (1<<KG_ALT);
+ }
+ if ( modstate & KMOD_MODE ) {
+ map |= (1<<KG_ALTGR);
+ }
+ if ( KTYP(vga_keymap[map][scancode]) == KT_LETTER ) {
+ if ( modstate & KMOD_CAPS ) {
+ map ^= (1<<KG_SHIFT);
+ }
+ }
+ if ( KTYP(vga_keymap[map][scancode]) == KT_PAD ) {
+ if ( modstate & KMOD_NUM ) {
+ keysym->unicode=KVAL(vga_keymap[map][scancode]);
+ }
+ } else {
+ keysym->unicode = KVAL(vga_keymap[map][scancode]);
+ }
+ }
+ return(keysym);
+}
diff --git a/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsevents_c.h b/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsevents_c.h
new file mode 100644
index 0000000..6758ab3
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsevents_c.h
@@ -0,0 +1,38 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_gsvideo.h"
+
+/* Variables and functions exported by SDL_sysevents.c to other parts
+ of the native video subsystem (SDL_sysvideo.c)
+*/
+extern int GS_OpenKeyboard(_THIS);
+extern void GS_CloseKeyboard(_THIS);
+extern int GS_OpenMouse(_THIS);
+extern void GS_CloseMouse(_THIS);
+extern int GS_EnterGraphicsMode(_THIS);
+extern int GS_InGraphicsMode(_THIS);
+extern void GS_LeaveGraphicsMode(_THIS);
+
+extern void GS_InitOSKeymap(_THIS);
+extern void GS_PumpEvents(_THIS);
diff --git a/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gskeys.h b/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gskeys.h
index 2b01b6b..2b01b6b 100644
--- a/distrib/sdl-1.2.12/src/video/ps2gs/SDL_gskeys.h
+++ b/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gskeys.h
diff --git a/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsmouse.c b/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsmouse.c
new file mode 100644
index 0000000..e0d320d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsmouse.c
@@ -0,0 +1,146 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <sys/ioctl.h>
+
+#include "SDL_mouse.h"
+#include "../../events/SDL_events_c.h"
+#include "../SDL_cursor_c.h"
+#include "SDL_gsvideo.h"
+#include "SDL_gsmouse_c.h"
+
+
+/* The implementation dependent data for the window manager cursor */
+struct WMcursor {
+ int unused;
+};
+
+/* There isn't any implementation dependent data */
+void GS_FreeWMCursor(_THIS, WMcursor *cursor)
+{
+ return;
+}
+
+/* There isn't any implementation dependent data */
+WMcursor *GS_CreateWMCursor(_THIS,
+ Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
+{
+ return((WMcursor *)0x01);
+}
+
+static void GS_MoveCursor(_THIS, SDL_Cursor *cursor, int x, int y)
+{
+ SDL_Surface *screen;
+ struct ps2_image image;
+ SDL_Rect area;
+ int mouse_y1, mouse_y2;
+ void *saved_pixels;
+ int screen_updated;
+
+ /* Lock so we don't interrupt an update with mouse motion */
+ SDL_LockCursor();
+
+ /* Make sure any pending DMA has completed */
+ if ( dma_pending ) {
+ ioctl(console_fd, PS2IOC_SENDQCT, 1);
+ dma_pending = 0;
+ }
+
+ /* Remove the cursor image from the DMA area */
+ screen = this->screen;
+ saved_pixels = screen->pixels;
+ screen->pixels = mapped_mem + screen->offset;
+ screen_updated = 0;
+ if ( cursor_drawn ) {
+ SDL_EraseCursorNoLock(screen);
+ cursor_drawn = 0;
+ screen_updated = 1;
+ }
+
+ /* Save the current mouse area */
+ SDL_MouseRect(&area);
+ mouse_y1 = area.y;
+ mouse_y2 = area.y+area.h;
+
+ /* Only draw the new cursor if there was one passed in */
+ if ( cursor ) {
+ /* Set the new location */
+ cursor->area.x = (x - cursor->hot_x);
+ cursor->area.y = (y - cursor->hot_y);
+
+ /* Draw the cursor at the new location */
+ if ( (SDL_cursorstate & CURSOR_VISIBLE) && screen->pixels ) {
+ SDL_DrawCursorNoLock(screen);
+ cursor_drawn = 1;
+ screen_updated = 1;
+ }
+ }
+ screen->pixels = saved_pixels;
+
+ /* Update the affected area of the screen */
+ if ( screen_updated ) {
+ SDL_MouseRect(&area);
+ if ( area.y < mouse_y1 ) {
+ mouse_y1 = area.y;
+ }
+ if ( (area.y+area.h) > mouse_y2 ) {
+ mouse_y2 = area.y+area.h;
+ }
+ image = screen_image;
+ image.y += screen->offset / screen->pitch + mouse_y1;
+ image.h = mouse_y2 - mouse_y1;
+ image.ptr = mapped_mem +
+ (image.y - screen_image.y) * screen->pitch;
+ ioctl(console_fd, PS2IOC_LOADIMAGE, &image);
+
+ /* Need to scale offscreen image to TV output */
+ if ( image.y > 0 ) {
+ scaleimage_nonblock(console_fd,
+ tex_tags_mem, scale_tags_mem);
+ }
+ }
+
+ /* We're finished */
+ SDL_UnlockCursor();
+}
+
+void GS_MoveWMCursor(_THIS, int x, int y)
+{
+ GS_MoveCursor(this, SDL_cursor, x, y);
+}
+
+int GS_ShowWMCursor(_THIS, WMcursor *wmcursor)
+{
+ SDL_Cursor *cursor;
+ int x, y;
+
+ /* Draw the cursor at the appropriate location */
+ SDL_GetMouseState(&x, &y);
+ if ( wmcursor ) {
+ cursor = SDL_cursor;
+ } else {
+ cursor = NULL;
+ }
+ GS_MoveCursor(this, cursor, x, y);
+ return(1);
+}
diff --git a/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsmouse_c.h b/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsmouse_c.h
new file mode 100644
index 0000000..c507ed4
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsmouse_c.h
@@ -0,0 +1,37 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_gsvideo.h"
+
+/* This is the maximum size of the cursor sprite */
+#define CURSOR_W 32
+#define CURSOR_H 32
+#define CURSOR_W_POW 5 /* 32 = 2^5 */
+#define CURSOR_H_POW 5 /* 32 = 2^5 */
+
+/* Functions to be exported */
+extern void GS_FreeWMCursor(_THIS, WMcursor *cursor);
+extern WMcursor *GS_CreateWMCursor(_THIS,
+ Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
+extern void GS_MoveWMCursor(_THIS, int x, int y);
+extern int GS_ShowWMCursor(_THIS, WMcursor *cursor);
diff --git a/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsvideo.c b/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsvideo.c
new file mode 100644
index 0000000..e172c60
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsvideo.c
@@ -0,0 +1,689 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Framebuffer console based SDL video driver implementation.
+*/
+
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+#include "../SDL_cursor_c.h"
+#include "SDL_gsvideo.h"
+#include "SDL_gsmouse_c.h"
+#include "SDL_gsevents_c.h"
+#include "SDL_gsyuv_c.h"
+
+
+/* Initialization/Query functions */
+static int GS_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **GS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *GS_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int GS_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
+static void GS_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int GS_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int GS_LockHWSurface(_THIS, SDL_Surface *surface);
+static void GS_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void GS_FreeHWSurface(_THIS, SDL_Surface *surface);
+
+/* GS driver bootstrap functions */
+
+static int GS_Available(void)
+{
+ int console, memory;
+
+ console = open(PS2_DEV_GS, O_RDWR, 0);
+ if ( console >= 0 ) {
+ close(console);
+ }
+ memory = open(PS2_DEV_MEM, O_RDWR, 0);
+ if ( memory >= 0 ) {
+ close(memory);
+ }
+ return((console >= 0) && (memory >= 0));
+}
+
+static void GS_DeleteDevice(SDL_VideoDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_VideoDevice *GS_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *this;
+
+ /* Initialize all variables that we clean on shutdown */
+ this = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( this ) {
+ SDL_memset(this, 0, (sizeof *this));
+ this->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *this->hidden));
+ }
+ if ( (this == NULL) || (this->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( this ) {
+ SDL_free(this);
+ }
+ return(0);
+ }
+ SDL_memset(this->hidden, 0, (sizeof *this->hidden));
+ mouse_fd = -1;
+ keyboard_fd = -1;
+
+ /* Set the function pointers */
+ this->VideoInit = GS_VideoInit;
+ this->ListModes = GS_ListModes;
+ this->SetVideoMode = GS_SetVideoMode;
+ this->CreateYUVOverlay = GS_CreateYUVOverlay;
+ this->SetColors = GS_SetColors;
+ this->UpdateRects = NULL;
+ this->VideoQuit = GS_VideoQuit;
+ this->AllocHWSurface = GS_AllocHWSurface;
+ this->CheckHWBlit = NULL;
+ this->FillHWRect = NULL;
+ this->SetHWColorKey = NULL;
+ this->SetHWAlpha = NULL;
+ this->LockHWSurface = GS_LockHWSurface;
+ this->UnlockHWSurface = GS_UnlockHWSurface;
+ this->FlipHWSurface = NULL;
+ this->FreeHWSurface = GS_FreeHWSurface;
+ this->SetIcon = NULL;
+ this->SetCaption = NULL;
+ this->GetWMInfo = NULL;
+ this->FreeWMCursor = GS_FreeWMCursor;
+ this->CreateWMCursor = GS_CreateWMCursor;
+ this->ShowWMCursor = GS_ShowWMCursor;
+ this->MoveWMCursor = GS_MoveWMCursor;
+ this->InitOSKeymap = GS_InitOSKeymap;
+ this->PumpEvents = GS_PumpEvents;
+
+ this->free = GS_DeleteDevice;
+
+ return this;
+}
+
+VideoBootStrap PS2GS_bootstrap = {
+ "ps2gs", "PlayStation 2 Graphics Synthesizer",
+ GS_Available, GS_CreateDevice
+};
+
+/* These are the pixel formats for the 32, 24, and 16 bit video modes */
+static struct {
+ int bpp;
+ Uint32 r;
+ Uint32 g;
+ Uint32 b;
+} GS_pixelmasks[] = {
+ { 32, 0x000000FF, /* RGB little-endian */
+ 0x0000FF00,
+ 0x00FF0000 },
+ { 24, 0x000000FF, /* RGB little-endian */
+ 0x0000FF00,
+ 0x00FF0000 },
+ { 16, 0x0000001f, /* RGB little-endian */
+ 0x000003e0,
+ 0x00007c00 },
+};
+/* This is a mapping from SDL bytes-per-pixel to GS pixel format */
+static int GS_formatmap[] = {
+ -1, /* 0 bpp, not a legal value */
+ -1, /* 8 bpp, not supported (yet?) */
+ PS2_GS_PSMCT16, /* 16 bpp */
+ PS2_GS_PSMCT24, /* 24 bpp */
+ PS2_GS_PSMCT32 /* 32 bpp */
+};
+
+static unsigned long long head_tags[] __attribute__((aligned(16))) = {
+ 4 | (1LL << 60), /* GIFtag */
+ 0x0e, /* A+D */
+ 0, /* 2 */
+ PS2_GS_BITBLTBUF,
+ 0, /* 4 */
+ PS2_GS_TRXPOS,
+ 0, /* 6 */
+ PS2_GS_TRXREG,
+ 0, /* 8 */
+ PS2_GS_TRXDIR
+};
+
+#define MAXIMG (32767 * 16)
+#define MAXTAGS 8
+
+static inline int loadimage_nonblock(int fd, struct ps2_image *image, int size,
+ unsigned long long *hm,
+ unsigned long long *im)
+{
+ struct ps2_plist plist;
+ struct ps2_packet packet[1 + MAXTAGS * 2];
+ int isize;
+ int pnum, it, eop;
+ char *data;
+
+ /* initialize the variables */
+ data = (char *)image->ptr;
+ pnum = it = eop = 0;
+ plist.packet = packet;
+
+ /* make BITBLT packet */
+ packet[pnum].ptr = hm;
+ packet[pnum].len = sizeof(head_tags);
+ pnum++;
+ hm[2] = ((unsigned long long)image->fbp << 32) |
+ ((unsigned long long)image->fbw << 48) |
+ ((unsigned long long)image->psm << 56);
+ hm[4] = ((unsigned long long)image->x << 32) |
+ ((unsigned long long)image->y << 48);
+ hm[6] = (unsigned long long)image->w |
+ ((unsigned long long)image->h << 32);
+
+ /* make image mode tags */
+ while (!eop) {
+ isize = size > MAXIMG ? MAXIMG : size;
+ size -= isize;
+ eop = (size == 0);
+
+ packet[pnum].ptr = &im[it];
+ packet[pnum].len = sizeof(unsigned long long) * 2;
+ pnum++;
+ im[it++] = (isize >> 4) | (eop ? (1 << 15) : 0) | (2LL << 58);
+ im[it++] = 0;
+
+ packet[pnum].ptr = (void *)data;
+ packet[pnum].len = isize;
+ pnum++;
+ data += isize;
+ }
+ plist.num = pnum;
+
+ return ioctl(fd, PS2IOC_SENDL, &plist);
+}
+
+static unsigned long long tex_tags[] __attribute__((aligned(16))) = {
+ 3 | (1LL << 60), /* GIFtag */
+ 0x0e, /* A+D */
+ 0, /* 2 */
+ PS2_GS_TEX0_1,
+ (1 << 5) + (1 << 6),
+ PS2_GS_TEX1_1,
+ 0,
+ PS2_GS_TEXFLUSH
+};
+static unsigned long long scale_tags[] __attribute__((aligned(16))) = {
+ 5 | (1LL << 60), /* GIFtag */
+ 0x0e, /* A+D */
+ 6 + (1 << 4) + (1 << 8),
+ PS2_GS_PRIM,
+ ((unsigned long long)0 * 16) + (((unsigned long long)0 * 16) << 16),
+ PS2_GS_UV,
+ ((unsigned long long)0 * 16) + (((unsigned long long)0 * 16) << 16),
+ PS2_GS_XYZ2,
+ 0, /* 8 */
+ PS2_GS_UV,
+ 0, /* 10 */
+ PS2_GS_XYZ2
+};
+
+
+int scaleimage_nonblock(int fd, unsigned long long *tm, unsigned long long *sm)
+{
+ struct ps2_plist plist;
+ struct ps2_packet packet[2];
+
+ /* initialize the variables */
+ plist.num = 2;
+ plist.packet = packet;
+
+ packet[0].ptr = tm;
+ packet[0].len = sizeof(tex_tags);
+ packet[1].ptr = sm;
+ packet[1].len = sizeof(scale_tags);
+
+ return ioctl(fd, PS2IOC_SENDL, &plist);
+}
+
+static int power_of_2(int value)
+{
+ int shift;
+
+ for ( shift = 0; (1<<shift) < value; ++shift ) {
+ /* Keep looking */ ;
+ }
+ return(shift);
+}
+
+static int GS_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ struct ps2_screeninfo vinfo;
+
+ /* Initialize the library */
+ console_fd = open(PS2_DEV_GS, O_RDWR, 0);
+ if ( console_fd < 0 ) {
+ SDL_SetError("Unable to open %s", PS2_DEV_GS);
+ return(-1);
+ }
+ memory_fd = open(PS2_DEV_MEM, O_RDWR, 0);
+ if ( memory_fd < 0 ) {
+ close(console_fd);
+ console_fd = -1;
+ SDL_SetError("Unable to open %s", PS2_DEV_MEM);
+ return(-1);
+ }
+
+ if ( ioctl(console_fd, PS2IOC_GSCREENINFO, &vinfo) < 0 ) {
+ close(memory_fd);
+ close(console_fd);
+ console_fd = -1;
+ SDL_SetError("Couldn't get console pixel format");
+ return(-1);
+ }
+
+ /* Determine the current screen size */
+ this->info.current_w = vinfo.w;
+ this->info.current_h = vinfo.h;
+
+ /* Determine the current screen depth */
+ switch (vinfo.psm) {
+ /* Supported pixel formats */
+ case PS2_GS_PSMCT32:
+ case PS2_GS_PSMCT24:
+ case PS2_GS_PSMCT16:
+ break;
+ default:
+ GS_VideoQuit(this);
+ SDL_SetError("Unknown console pixel format: %d", vinfo.psm);
+ return(-1);
+ }
+ vformat->BitsPerPixel = GS_pixelmasks[vinfo.psm].bpp;
+ vformat->Rmask = GS_pixelmasks[vinfo.psm].r;
+ vformat->Gmask = GS_pixelmasks[vinfo.psm].g;
+ vformat->Bmask = GS_pixelmasks[vinfo.psm].b;
+ saved_vinfo = vinfo;
+
+ /* Enable mouse and keyboard support */
+ if ( GS_OpenKeyboard(this) < 0 ) {
+ GS_VideoQuit(this);
+ SDL_SetError("Unable to open keyboard");
+ return(-1);
+ }
+ if ( GS_OpenMouse(this) < 0 ) {
+ const char *sdl_nomouse;
+
+ sdl_nomouse = SDL_getenv("SDL_NOMOUSE");
+ if ( ! sdl_nomouse ) {
+ GS_VideoQuit(this);
+ SDL_SetError("Unable to open mouse");
+ return(-1);
+ }
+ }
+
+ /* We're done! */
+ return(0);
+}
+
+static SDL_Rect **GS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ static SDL_Rect GS_vesa_mode_list[] = {
+ { 0, 0, 1280, 1024 },
+ { 0, 0, 1024, 768 },
+ { 0, 0, 800, 600 },
+ { 0, 0, 640, 480 }
+ };
+ static SDL_Rect *GS_vesa_modes[] = {
+ &GS_vesa_mode_list[0],
+ &GS_vesa_mode_list[1],
+ &GS_vesa_mode_list[2],
+ &GS_vesa_mode_list[3],
+ NULL
+ };
+ static SDL_Rect GS_tvout_stretch;
+ static SDL_Rect GS_tvout_mode;
+ static SDL_Rect *GS_tvout_modes[3];
+ SDL_Rect **modes = NULL;
+
+ switch (format->BitsPerPixel) {
+ case 16:
+ case 24:
+ case 32:
+ if ( saved_vinfo.mode == PS2_GS_VESA ) {
+ modes = GS_vesa_modes;
+ } else {
+ int i, j = 0;
+
+// FIXME - what's wrong with the stretch code at 16 bpp?
+if ( format->BitsPerPixel != 32 ) break;
+ /* Add a mode that we could possibly stretch to */
+ for ( i=0; GS_vesa_modes[i]; ++i ) {
+ if ( (GS_vesa_modes[i]->w == saved_vinfo.w) &&
+ (GS_vesa_modes[i]->h != saved_vinfo.h) ) {
+ GS_tvout_stretch.w=GS_vesa_modes[i]->w;
+ GS_tvout_stretch.h=GS_vesa_modes[i]->h;
+ GS_tvout_modes[j++] = &GS_tvout_stretch;
+ break;
+ }
+ }
+ /* Add the current TV video mode */
+ GS_tvout_mode.w = saved_vinfo.w;
+ GS_tvout_mode.h = saved_vinfo.h;
+ GS_tvout_modes[j++] = &GS_tvout_mode;
+ GS_tvout_modes[j++] = NULL;
+
+ /* Return the created list of modes */
+ modes = GS_tvout_modes;
+ }
+ break;
+ default:
+ break;
+ }
+ return(modes);
+}
+
+/* Various screen update functions available */
+static void GS_DMAFullUpdate(_THIS, int numrects, SDL_Rect *rects);
+
+static SDL_Surface *GS_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ struct ps2_screeninfo vinfo;
+
+ /* Set the terminal into graphics mode */
+ if ( GS_EnterGraphicsMode(this) < 0 ) {
+ return(NULL);
+ }
+
+ /* Set the video mode and get the final screen format */
+ if ( ioctl(console_fd, PS2IOC_GSCREENINFO, &vinfo) < 0 ) {
+ SDL_SetError("Couldn't get console screen info");
+ return(NULL);
+ }
+ if ( (vinfo.w != width) || (vinfo.h != height) ||
+ (GS_pixelmasks[vinfo.psm].bpp != bpp) ) {
+ /* If we're not in VESA mode, we have to scale resolution */
+ if ( saved_vinfo.mode == PS2_GS_VESA ) {
+ switch (width) {
+ case 640:
+ vinfo.res = PS2_GS_640x480;
+ break;
+ case 800:
+ vinfo.res = PS2_GS_800x600;
+ break;
+ case 1024:
+ vinfo.res = PS2_GS_1024x768;
+ break;
+ case 1280:
+ vinfo.res = PS2_GS_1280x1024;
+ break;
+ default:
+ SDL_SetError("Unsupported resolution: %dx%d\n",
+ width, height);
+ return(NULL);
+ }
+ vinfo.res |= (PS2_GS_75Hz << 8);
+ vinfo.w = width;
+ vinfo.h = height;
+ }
+ vinfo.fbp = 0;
+ vinfo.psm = GS_formatmap[bpp/8];
+ if ( vinfo.psm < 0 ) {
+ SDL_SetError("Unsupported depth: %d bpp\n", bpp);
+ return(NULL);
+ }
+ if ( ioctl(console_fd, PS2IOC_SSCREENINFO, &vinfo) < 0 ) {
+ SDL_SetError("Couldn't set console screen info");
+ return(NULL);
+ }
+
+ /* Unmap the previous DMA buffer */
+ if ( mapped_mem ) {
+ munmap(mapped_mem, mapped_len);
+ mapped_mem = NULL;
+ }
+ }
+ if ( ! SDL_ReallocFormat(current, GS_pixelmasks[vinfo.psm].bpp,
+ GS_pixelmasks[vinfo.psm].r,
+ GS_pixelmasks[vinfo.psm].g,
+ GS_pixelmasks[vinfo.psm].b, 0) ) {
+ return(NULL);
+ }
+
+ /* Set up the new mode framebuffer */
+ current->flags = SDL_FULLSCREEN;
+ current->w = width;
+ current->h = height;
+ current->pitch = SDL_CalculatePitch(current);
+
+ /* Memory map the DMA area for block memory transfer */
+ if ( ! mapped_mem ) {
+ pixels_len = height * current->pitch;
+ mapped_len = pixels_len +
+ /* Screen update DMA command area */
+ sizeof(head_tags) + ((2 * MAXTAGS) * 16);
+ if ( saved_vinfo.mode != PS2_GS_VESA ) {
+ mapped_len += sizeof(tex_tags) + sizeof(scale_tags);
+ }
+ mapped_mem = mmap(0, mapped_len, PROT_READ|PROT_WRITE,
+ MAP_SHARED, memory_fd, 0);
+ if ( mapped_mem == MAP_FAILED ) {
+ SDL_SetError("Unable to map %d bytes for DMA",
+ mapped_len);
+ mapped_mem = NULL;
+ return(NULL);
+ }
+
+ /* Set up the entire screen for DMA transfer */
+ screen_image.ptr = mapped_mem;
+ screen_image.fbp = 0;
+ screen_image.fbw = (vinfo.w + 63) / 64;
+ screen_image.psm = vinfo.psm;
+ screen_image.x = 0;
+ if ( vinfo.h == height ) {
+ screen_image.y = 0;
+ } else {
+ /* Put image offscreen and scale to screen height */
+ screen_image.y = vinfo.h;
+ }
+ screen_image.w = current->w;
+ screen_image.h = current->h;
+
+ /* get screen image data size (qword aligned) */
+ screen_image_size = (screen_image.w * screen_image.h);
+ switch (screen_image.psm) {
+ case PS2_GS_PSMCT32:
+ screen_image_size *= 4;
+ break;
+ case PS2_GS_PSMCT24:
+ screen_image_size *= 3;
+ break;
+ case PS2_GS_PSMCT16:
+ screen_image_size *= 2;
+ break;
+ }
+ screen_image_size = (screen_image_size + 15) & ~15;
+
+ /* Set up the memory for screen update DMA commands */
+ head_tags_mem = (unsigned long long *)
+ (mapped_mem + pixels_len);
+ image_tags_mem = (unsigned long long *)
+ ((caddr_t)head_tags_mem + sizeof(head_tags));
+ SDL_memcpy(head_tags_mem, head_tags, sizeof(head_tags));
+ if ( saved_vinfo.mode != PS2_GS_VESA ) {
+ tex_tags_mem = (unsigned long long *)
+ ((caddr_t)image_tags_mem + ((2*MAXTAGS)*16));
+ scale_tags_mem = (unsigned long long *)
+ ((caddr_t)tex_tags_mem + sizeof(tex_tags));
+ SDL_memcpy(tex_tags_mem, tex_tags, sizeof(tex_tags));
+ tex_tags_mem[2] =
+ (vinfo.h * vinfo.w) / 64 +
+ ((unsigned long long)screen_image.fbw << 14) +
+ ((unsigned long long)screen_image.psm << 20) +
+ ((unsigned long long)power_of_2(screen_image.w) << 26) +
+ ((unsigned long long)power_of_2(screen_image.h) << 30) +
+ ((unsigned long long)1 << 34) +
+ ((unsigned long long)1 << 35);
+ SDL_memcpy(scale_tags_mem, scale_tags, sizeof(scale_tags));
+ scale_tags_mem[8] =
+ ((unsigned long long)screen_image.w * 16) +
+ (((unsigned long long)screen_image.h * 16) << 16);
+ scale_tags_mem[10] =
+ ((unsigned long long)vinfo.w * 16) +
+ (((unsigned long long)vinfo.h * 16) << 16);
+ }
+ }
+ current->pixels = NULL;
+ if ( SDL_getenv("SDL_FULLSCREEN_UPDATE") ) {
+ /* Correct semantics */
+ current->flags |= SDL_ASYNCBLIT;
+ } else {
+ /* We lie here - the screen memory isn't really the visible
+ display memory and still requires an update, but this
+ has the desired effect for most applications.
+ */
+ current->flags |= SDL_HWSURFACE;
+ }
+
+ /* Set the update rectangle function */
+ this->UpdateRects = GS_DMAFullUpdate;
+
+ /* We're done */
+ return(current);
+}
+
+/* We don't support hardware surfaces yet */
+static int GS_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(-1);
+}
+static void GS_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+static int GS_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ if ( surface == this->screen ) {
+ /* Since mouse motion affects 'pixels', lock it */
+ SDL_LockCursor();
+
+ /* Make sure any pending DMA has completed */
+ if ( dma_pending ) {
+ ioctl(console_fd, PS2IOC_SENDQCT, 1);
+ dma_pending = 0;
+ }
+
+ /* If the cursor is drawn on the DMA area, remove it */
+ if ( cursor_drawn ) {
+ surface->pixels = mapped_mem + surface->offset;
+ SDL_EraseCursorNoLock(this->screen);
+ cursor_drawn = 0;
+ }
+
+ /* Set the surface pixels to the base of the DMA area */
+ surface->pixels = mapped_mem;
+
+ /* We're finished! */
+ SDL_UnlockCursor();
+ }
+ return(0);
+}
+static void GS_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ if ( surface == this->screen ) {
+ /* Since mouse motion affects 'pixels', lock it */
+ SDL_LockCursor();
+ surface->pixels = NULL;
+ SDL_UnlockCursor();
+ }
+}
+
+static void GS_DMAFullUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+ /* Lock so we aren't interrupted by a mouse update */
+ SDL_LockCursor();
+
+ /* Make sure any pending DMA has completed */
+ if ( dma_pending ) {
+ ioctl(console_fd, PS2IOC_SENDQCT, 1);
+ dma_pending = 0;
+ }
+
+ /* If the mouse is visible, draw it on the DMA area */
+ if ( (SDL_cursorstate & CURSOR_VISIBLE) && !cursor_drawn ) {
+ this->screen->pixels = mapped_mem + this->screen->offset;
+ SDL_DrawCursorNoLock(this->screen);
+ this->screen->pixels = NULL;
+ cursor_drawn = 1;
+ }
+
+ /* Put the image onto the screen */
+ loadimage_nonblock(console_fd,
+ &screen_image, screen_image_size,
+ head_tags_mem, image_tags_mem);
+ if ( screen_image.y > 0 ) {
+ /* Need to scale offscreen image to TV output */
+ ioctl(console_fd, PS2IOC_SENDQCT, 1);
+ dma_pending = 0;
+ scaleimage_nonblock(console_fd, tex_tags_mem, scale_tags_mem);
+ } else {
+ dma_pending = 1;
+ }
+
+ /* We're finished! */
+ SDL_UnlockCursor();
+}
+
+static int GS_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ return(0);
+}
+
+static void GS_VideoQuit(_THIS)
+{
+ /* Close console and input file descriptors */
+ if ( console_fd > 0 ) {
+ /* Unmap the video framebuffer */
+ if ( mapped_mem ) {
+ /* Unmap the video framebuffer */
+ munmap(mapped_mem, mapped_len);
+ mapped_mem = NULL;
+ }
+ close(memory_fd);
+
+ /* Restore the original video mode */
+ if ( GS_InGraphicsMode(this) ) {
+ ioctl(console_fd, PS2IOC_SSCREENINFO, &saved_vinfo);
+ }
+
+ /* We're all done with the graphics device */
+ close(console_fd);
+ console_fd = -1;
+ }
+ GS_CloseMouse(this);
+ GS_CloseKeyboard(this);
+}
diff --git a/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsvideo.h b/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsvideo.h
new file mode 100644
index 0000000..8972d70
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsvideo.h
@@ -0,0 +1,95 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_gsvideo_h
+#define _SDL_gsvideo_h
+
+#include <sys/types.h>
+#include <termios.h>
+#include <linux/ps2/dev.h>
+#include <linux/ps2/gs.h>
+
+#include "SDL_mouse.h"
+#include "SDL_mutex.h"
+#include "../SDL_sysvideo.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+
+/* Private display data */
+struct SDL_PrivateVideoData {
+ /* Gotta love that simple PS2 graphics interface. :) */
+ int console_fd;
+ int memory_fd;
+ struct ps2_screeninfo saved_vinfo;
+
+ /* Ye olde linux keyboard code */
+ int current_vt;
+ int saved_vt;
+ int keyboard_fd;
+ int saved_kbd_mode;
+ struct termios saved_kbd_termios;
+
+ /* Ye olde linux mouse code */
+ int mouse_fd;
+ int cursor_drawn;
+
+ /* The memory mapped DMA area and associated variables */
+ caddr_t mapped_mem;
+ int pixels_len;
+ int mapped_len;
+ struct ps2_image screen_image;
+ int screen_image_size;
+ unsigned long long *head_tags_mem;
+ unsigned long long *image_tags_mem;
+ unsigned long long *tex_tags_mem;
+ unsigned long long *scale_tags_mem;
+ int dma_pending;
+};
+/* Old variable names */
+#define console_fd (this->hidden->console_fd)
+#define memory_fd (this->hidden->memory_fd)
+#define saved_vinfo (this->hidden->saved_vinfo)
+#define current_vt (this->hidden->current_vt)
+#define saved_vt (this->hidden->saved_vt)
+#define keyboard_fd (this->hidden->keyboard_fd)
+#define saved_kbd_mode (this->hidden->saved_kbd_mode)
+#define saved_kbd_termios (this->hidden->saved_kbd_termios)
+#define mouse_fd (this->hidden->mouse_fd)
+#define cursor_drawn (this->hidden->cursor_drawn)
+#define mapped_mem (this->hidden->mapped_mem)
+#define pixels_len (this->hidden->pixels_len)
+#define mapped_len (this->hidden->mapped_len)
+#define screen_image (this->hidden->screen_image)
+#define screen_image_size (this->hidden->screen_image_size)
+#define head_tags_mem (this->hidden->head_tags_mem)
+#define image_tags_mem (this->hidden->image_tags_mem)
+#define tex_tags_mem (this->hidden->tex_tags_mem)
+#define scale_tags_mem (this->hidden->scale_tags_mem)
+#define dma_pending (this->hidden->dma_pending)
+
+/* Shared between the mouse and video code for screen update scaling */
+extern int scaleimage_nonblock(int fd,
+ unsigned long long *tm, unsigned long long *sm);
+#endif /* _SDL_gsvideo_h */
diff --git a/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsyuv.c b/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsyuv.c
new file mode 100644
index 0000000..ec52a69
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsyuv.c
@@ -0,0 +1,461 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This is the Playstation 2 implementation of YUV video overlays */
+
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <asm/page.h> /* For definition of PAGE_SIZE */
+
+#include "SDL_video.h"
+#include "SDL_gsyuv_c.h"
+#include "../SDL_yuvfuncs.h"
+
+/* The maximum number of 16x16 pixel block converted at once */
+#define MAX_MACROBLOCKS 1024 /* 2^10 macroblocks at once */
+
+/* The functions used to manipulate video overlays */
+static struct private_yuvhwfuncs gs_yuvfuncs = {
+ GS_LockYUVOverlay,
+ GS_UnlockYUVOverlay,
+ GS_DisplayYUVOverlay,
+ GS_FreeYUVOverlay
+};
+
+struct private_yuvhwdata {
+ int ipu_fd;
+ Uint8 *pixels;
+ int macroblocks;
+ int dma_len;
+ caddr_t dma_mem;
+ caddr_t ipu_imem;
+ caddr_t ipu_omem;
+ caddr_t dma_tags;
+ unsigned long long *stretch_x1y1;
+ unsigned long long *stretch_x2y2;
+ struct ps2_plist plist;
+
+ /* These are just so we don't have to allocate them separately */
+ Uint16 pitches[3];
+ Uint8 *planes[3];
+};
+
+static int power_of_2(int value)
+{
+ int shift;
+
+ for ( shift = 0; (1<<shift) < value; ++shift ) {
+ /* Keep looking */ ;
+ }
+ return(shift);
+}
+
+SDL_Overlay *GS_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display)
+{
+ SDL_Overlay *overlay;
+ struct private_yuvhwdata *hwdata;
+ int map_offset;
+ unsigned long long *tags;
+ caddr_t base;
+ int bpp;
+ int fbp, fbw, psm;
+ int x, y, w, h;
+ int pnum;
+ struct ps2_packet *packet;
+ struct ps2_packet tex_packet;
+
+ /* We can only decode blocks of 16x16 pixels */
+ if ( (width & 15) || (height & 15) ) {
+ SDL_SetError("Overlay width/height must be multiples of 16");
+ return(NULL);
+ }
+ /* Make sure the image isn't too large for a single DMA transfer */
+ if ( ((width/16) * (height/16)) > MAX_MACROBLOCKS ) {
+ SDL_SetError("Overlay too large (maximum size: %d pixels)",
+ MAX_MACROBLOCKS * 16 * 16);
+ return(NULL);
+ }
+
+ /* Double-check the requested format. For simplicity, we'll only
+ support planar YUV formats.
+ */
+ switch (format) {
+ case SDL_YV12_OVERLAY:
+ case SDL_IYUV_OVERLAY:
+ /* Supported planar YUV format */
+ break;
+ default:
+ SDL_SetError("Unsupported YUV format");
+ return(NULL);
+ }
+
+ /* Create the overlay structure */
+ overlay = (SDL_Overlay *)SDL_malloc(sizeof *overlay);
+ if ( overlay == NULL ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ SDL_memset(overlay, 0, (sizeof *overlay));
+
+ /* Fill in the basic members */
+ overlay->format = format;
+ overlay->w = width;
+ overlay->h = height;
+
+ /* Set up the YUV surface function structure */
+ overlay->hwfuncs = &gs_yuvfuncs;
+ overlay->hw_overlay = 1;
+
+ /* Create the pixel data */
+ hwdata = (struct private_yuvhwdata *)SDL_malloc(sizeof *hwdata);
+ overlay->hwdata = hwdata;
+ if ( hwdata == NULL ) {
+ SDL_FreeYUVOverlay(overlay);
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ hwdata->ipu_fd = -1;
+ hwdata->pixels = (Uint8 *)SDL_malloc(width*height*2);
+ if ( hwdata->pixels == NULL ) {
+ SDL_FreeYUVOverlay(overlay);
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ hwdata->macroblocks = (width/16) * (height/16);
+
+ /* Find the pitch and offset values for the overlay */
+ overlay->pitches = hwdata->pitches;
+ overlay->pixels = hwdata->planes;
+ switch (format) {
+ case SDL_YV12_OVERLAY:
+ case SDL_IYUV_OVERLAY:
+ overlay->pitches[0] = overlay->w;
+ overlay->pitches[1] = overlay->pitches[0] / 2;
+ overlay->pitches[2] = overlay->pitches[0] / 2;
+ overlay->pixels[0] = hwdata->pixels;
+ overlay->pixels[1] = overlay->pixels[0] +
+ overlay->pitches[0] * overlay->h;
+ overlay->pixels[2] = overlay->pixels[1] +
+ overlay->pitches[1] * overlay->h / 2;
+ overlay->planes = 3;
+ break;
+ default:
+ /* We should never get here (caught above) */
+ break;
+ }
+
+ /* Theoretically we could support several concurrent decode
+ streams queueing up on the same file descriptor, but for
+ simplicity we'll support only one. Opening the IPU more
+ than once will fail with EBUSY.
+ */
+ hwdata->ipu_fd = open("/dev/ps2ipu", O_RDWR);
+ if ( hwdata->ipu_fd < 0 ) {
+ SDL_FreeYUVOverlay(overlay);
+ SDL_SetError("Playstation 2 IPU busy");
+ return(NULL);
+ }
+
+ /* Allocate a DMA area for pixel conversion */
+ bpp = this->screen->format->BytesPerPixel;
+ map_offset = (mapped_len + (sysconf(_SC_PAGESIZE) - 1)) & ~(sysconf(_SC_PAGESIZE) - 1);
+ hwdata->dma_len = hwdata->macroblocks * (16 * 16 + 8 * 8 + 8 * 8) +
+ width * height * bpp +
+ hwdata->macroblocks * (16 * sizeof(long long)) +
+ 12 * sizeof(long long);
+ hwdata->dma_mem = mmap(0, hwdata->dma_len, PROT_READ|PROT_WRITE,
+ MAP_SHARED, memory_fd, map_offset);
+ if ( hwdata->dma_mem == MAP_FAILED ) {
+ hwdata->ipu_imem = (caddr_t)0;
+ SDL_FreeYUVOverlay(overlay);
+ SDL_SetError("Unable to map %d bytes for DMA", hwdata->dma_len);
+ return(NULL);
+ }
+ hwdata->ipu_imem = hwdata->dma_mem;
+ hwdata->ipu_omem = hwdata->ipu_imem +
+ hwdata->macroblocks * (16 * 16 + 8 * 8 + 8 * 8);
+ hwdata->dma_tags = hwdata->ipu_omem + width * height * bpp;
+
+ /* Allocate memory for the DMA packets */
+ hwdata->plist.num = hwdata->macroblocks * 4 + 1;
+ hwdata->plist.packet = (struct ps2_packet *)SDL_malloc(
+ hwdata->plist.num*sizeof(struct ps2_packet));
+ if ( ! hwdata->plist.packet ) {
+ SDL_FreeYUVOverlay(overlay);
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ pnum = 0;
+ packet = hwdata->plist.packet;
+
+ /* Set up the tags to send the image to the screen */
+ tags = (unsigned long long *)hwdata->dma_tags;
+ base = hwdata->ipu_omem;
+ fbp = screen_image.fbp;
+ fbw = screen_image.fbw;
+ psm = screen_image.psm;
+ y = screen_image.y + screen_image.h; /* Offscreen video memory */
+ for ( h=height/16; h; --h ) {
+ x = 0; /* Visible video memory */
+ for ( w=width/16; w; --w ) {
+ /* The head tag */
+ packet[pnum].ptr = &tags[0];
+ packet[pnum].len = 10 * sizeof(*tags);
+ ++pnum;
+ tags[0] = 4 | (1LL << 60); /* GIFtag */
+ tags[1] = 0x0e; /* A+D */
+ tags[2] = ((unsigned long long)fbp << 32) |
+ ((unsigned long long)fbw << 48) |
+ ((unsigned long long)psm << 56);
+ tags[3] = PS2_GS_BITBLTBUF;
+ tags[4] = ((unsigned long long)x << 32) |
+ ((unsigned long long)y << 48);
+ tags[5] = PS2_GS_TRXPOS;
+ tags[6] = (unsigned long long)16 |
+ ((unsigned long long)16 << 32);
+ tags[7] = PS2_GS_TRXREG;
+ tags[8] = 0;
+ tags[9] = PS2_GS_TRXDIR;
+ /* Now the actual image data */
+ packet[pnum].ptr = &tags[10];
+ packet[pnum].len = 2 * sizeof(*tags);
+ ++pnum;
+ tags[10] = ((16*16*bpp) >> 4) | (2LL << 58);
+ tags[11] = 0;
+ packet[pnum].ptr = (void *)base;
+ packet[pnum].len = 16 * 16 * bpp;
+ ++pnum;
+ packet[pnum].ptr = &tags[12];
+ packet[pnum].len = 2 * sizeof(*tags);
+ ++pnum;
+ tags[12] = (0 >> 4) | (1 << 15) | (2LL << 58);
+ tags[13] = 0;
+
+ tags += 16;
+ base += 16 * 16 * bpp;
+
+ x += 16;
+ }
+ y += 16;
+ }
+
+ /* Set up the texture memory area for the video */
+ tex_packet.ptr = tags;
+ tex_packet.len = 8 * sizeof(*tags);
+ tags[0] = 3 | (1LL << 60); /* GIFtag */
+ tags[1] = 0x0e; /* A+D */
+ tags[2] = ((screen_image.y + screen_image.h) * screen_image.w) / 64 +
+ ((unsigned long long)fbw << 14) +
+ ((unsigned long long)psm << 20) +
+ ((unsigned long long)power_of_2(width) << 26) +
+ ((unsigned long long)power_of_2(height) << 30) +
+ ((unsigned long long)1 << 34) +
+ ((unsigned long long)1 << 35);
+ tags[3] = PS2_GS_TEX0_1;
+ tags[4] = (1 << 5) + (1 << 6);
+ tags[5] = PS2_GS_TEX1_1;
+ tags[6] = 0;
+ tags[7] = PS2_GS_TEXFLUSH;
+ ioctl(console_fd, PS2IOC_SEND, &tex_packet);
+
+ /* Set up the tags for scaling the image */
+ packet[pnum].ptr = tags;
+ packet[pnum].len = 12 * sizeof(*tags);
+ ++pnum;
+ tags[0] = 5 | (1LL << 60); /* GIFtag */
+ tags[1] = 0x0e; /* A+D */
+ tags[2] = 6 + (1 << 4) + (1 << 8);
+ tags[3] = PS2_GS_PRIM;
+ tags[4] = ((unsigned long long)0 * 16) +
+ (((unsigned long long)0 * 16) << 16);
+ tags[5] = PS2_GS_UV;
+ tags[6] = 0; /* X1, Y1 */
+ tags[7] = PS2_GS_XYZ2;
+ hwdata->stretch_x1y1 = &tags[6];
+ tags[8] = ((unsigned long long)overlay->w * 16) +
+ (((unsigned long long)overlay->h * 16) << 16);
+ tags[9] = PS2_GS_UV;
+ tags[10] = 0; /* X2, Y2 */
+ tags[11] = PS2_GS_XYZ2;
+ hwdata->stretch_x2y2 = &tags[10];
+
+ /* We're all done.. */
+ return(overlay);
+}
+
+int GS_LockYUVOverlay(_THIS, SDL_Overlay *overlay)
+{
+ return(0);
+}
+
+void GS_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay)
+{
+ return;
+}
+
+int GS_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst)
+{
+ struct private_yuvhwdata *hwdata;
+ __u32 cmd;
+ struct ps2_packet packet;
+ int h, w, i;
+ Uint32 *lum, *Cr, *Cb;
+ int lum_pitch;
+ int crb_pitch;
+ Uint32 *lum_src, *Cr_src, *Cb_src;
+ Uint32 *srcp, *dstp;
+ unsigned int x, y;
+ SDL_Surface *screen;
+
+ /* Find out where the various portions of the image are */
+ hwdata = overlay->hwdata;
+ switch (overlay->format) {
+ case SDL_YV12_OVERLAY:
+ lum = (Uint32 *)overlay->pixels[0];
+ Cr = (Uint32 *)overlay->pixels[1];
+ Cb = (Uint32 *)overlay->pixels[2];
+ break;
+ case SDL_IYUV_OVERLAY:
+ lum = (Uint32 *)overlay->pixels[0];
+ Cr = (Uint32 *)overlay->pixels[2];
+ Cb = (Uint32 *)overlay->pixels[1];
+ default:
+ SDL_SetError("Unsupported YUV format in blit (?)");
+ return(-1);
+ }
+ dstp = (Uint32 *)hwdata->ipu_imem;
+ lum_pitch = overlay->w/4;
+ crb_pitch = (overlay->w/2)/4;
+
+ /* Copy blocks of 16x16 pixels to the DMA area */
+ for ( h=overlay->h/16; h; --h ) {
+ lum_src = lum;
+ Cr_src = Cr;
+ Cb_src = Cb;
+ for ( w=overlay->w/16; w; --w ) {
+ srcp = lum_src;
+ for ( i=0; i<16; ++i ) {
+ dstp[0] = srcp[0];
+ dstp[1] = srcp[1];
+ dstp[2] = srcp[2];
+ dstp[3] = srcp[3];
+ srcp += lum_pitch;
+ dstp += 4;
+ }
+ srcp = Cb_src;
+ for ( i=0; i<8; ++i ) {
+ dstp[0] = srcp[0];
+ dstp[1] = srcp[1];
+ srcp += crb_pitch;
+ dstp += 2;
+ }
+ srcp = Cr_src;
+ for ( i=0; i<8; ++i ) {
+ dstp[0] = srcp[0];
+ dstp[1] = srcp[1];
+ srcp += crb_pitch;
+ dstp += 2;
+ }
+ lum_src += 16 / 4;
+ Cb_src += 8 / 4;
+ Cr_src += 8 / 4;
+ }
+ lum += lum_pitch * 16;
+ Cr += crb_pitch * 8;
+ Cb += crb_pitch * 8;
+ }
+
+ /* Send the macroblock data to the IPU */
+#ifdef DEBUG_YUV
+ fprintf(stderr, "Sending data to IPU..\n");
+#endif
+ packet.ptr = hwdata->ipu_imem;
+ packet.len = hwdata->macroblocks * (16 * 16 + 8 * 8 + 8 * 8);
+ ioctl(hwdata->ipu_fd, PS2IOC_SENDA, &packet);
+
+ /* Trigger the DMA to the IPU for conversion */
+#ifdef DEBUG_YUV
+ fprintf(stderr, "Trigging conversion command\n");
+#endif
+ cmd = (7 << 28) + hwdata->macroblocks;
+ if ( screen_image.psm == PS2_GS_PSMCT16 ) {
+ cmd += (1 << 27) + /* Output RGB 555 */
+ (1 << 26); /* Dither output */
+ }
+ ioctl(hwdata->ipu_fd, PS2IOC_SIPUCMD, &cmd);
+
+ /* Retrieve the converted image from the IPU */
+#ifdef DEBUG_YUV
+ fprintf(stderr, "Retrieving data from IPU..\n");
+#endif
+ packet.ptr = hwdata->ipu_omem;
+ packet.len = overlay->w * overlay->h *
+ this->screen->format->BytesPerPixel;
+ ioctl(hwdata->ipu_fd, PS2IOC_RECV, &packet);
+
+#ifdef DEBUG_YUV
+ fprintf(stderr, "Copying image to screen..\n");
+#endif
+ /* Wait for previous DMA to complete */
+ ioctl(console_fd, PS2IOC_SENDQCT, 1);
+
+ /* Send the current image to the screen and scale it */
+ screen = this->screen;
+ x = (unsigned int)dst->x;
+ y = (unsigned int)dst->y;
+ if ( screen->offset ) {
+ x += (screen->offset % screen->pitch) /
+ screen->format->BytesPerPixel;
+ y += (screen->offset / screen->pitch);
+ }
+ y += screen_image.y;
+ *hwdata->stretch_x1y1 = (x * 16) + ((y * 16) << 16);
+ x += (unsigned int)dst->w;
+ y += (unsigned int)dst->h;
+ *hwdata->stretch_x2y2 = (x * 16) + ((y * 16) << 16);
+ return ioctl(console_fd, PS2IOC_SENDL, &hwdata->plist);
+}
+
+void GS_FreeYUVOverlay(_THIS, SDL_Overlay *overlay)
+{
+ struct private_yuvhwdata *hwdata;
+
+ hwdata = overlay->hwdata;
+ if ( hwdata ) {
+ if ( hwdata->ipu_fd >= 0 ) {
+ close(hwdata->ipu_fd);
+ }
+ if ( hwdata->dma_mem ) {
+ munmap(hwdata->dma_mem, hwdata->dma_len);
+ }
+ if ( hwdata->plist.packet ) {
+ SDL_free(hwdata->plist.packet);
+ }
+ if ( hwdata->pixels ) {
+ SDL_free(hwdata->pixels);
+ }
+ SDL_free(hwdata);
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsyuv_c.h b/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsyuv_c.h
new file mode 100644
index 0000000..d9ffad6
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ps2gs/SDL_gsyuv_c.h
@@ -0,0 +1,37 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This is the Playstation 2 implementation of YUV video overlays */
+
+#include "SDL_video.h"
+#include "SDL_gsvideo.h"
+
+extern SDL_Overlay *GS_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display);
+
+extern int GS_LockYUVOverlay(_THIS, SDL_Overlay *overlay);
+
+extern void GS_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay);
+
+extern int GS_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst);
+
+extern void GS_FreeYUVOverlay(_THIS, SDL_Overlay *overlay);
diff --git a/distrib/sdl-1.2.15/src/video/ps3/SDL_ps3events.c b/distrib/sdl-1.2.15/src/video/ps3/SDL_ps3events.c
new file mode 100644
index 0000000..e39efcc
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ps3/SDL_ps3events.c
@@ -0,0 +1,44 @@
+/*
+ * SDL - Simple DirectMedia Layer
+ * CELL BE Support for PS3 Framebuffer
+ * Copyright (C) 2008, 2009 International Business Machines Corporation
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * Martin Lowinski <lowinski [at] de [dot] ibm [ibm] com>
+ * Dirk Herrendoerfer <d.herrendoerfer [at] de [dot] ibm [dot] com>
+ * SPE code based on research by:
+ * Rene Becker
+ * Thimo Emmerich
+ */
+
+#include "SDL_config.h"
+
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_ps3video.h"
+#include "SDL_ps3events_c.h"
+
+void PS3_PumpEvents(_THIS)
+{
+ return;
+}
+
+void PS3_InitOSKeymap(_THIS)
+{
+ return;
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/ps3/SDL_ps3events_c.h b/distrib/sdl-1.2.15/src/video/ps3/SDL_ps3events_c.h
new file mode 100644
index 0000000..fd11209
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ps3/SDL_ps3events_c.h
@@ -0,0 +1,41 @@
+/*
+ * SDL - Simple DirectMedia Layer
+ * CELL BE Support for PS3 Framebuffer
+ * Copyright (C) 2008, 2009 International Business Machines Corporation
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * Martin Lowinski <lowinski [at] de [dot] ibm [ibm] com>
+ * Dirk Herrendoerfer <d.herrendoerfer [at] de [dot] ibm [dot] com>
+ * SPE code based on research by:
+ * Rene Becker
+ * Thimo Emmerich
+ */
+
+#include "SDL_config.h"
+
+#ifndef _SDL_ps3events_h
+#define _SDL_ps3events_h
+
+#include "SDL_ps3video.h"
+
+extern void PS3_InitOSKeymap(_THIS);
+extern void PS3_PumpEvents(_THIS);
+
+extern void enable_cursor(int enable);
+
+#endif /* _SDL_ps3events_h */
+
diff --git a/distrib/sdl-1.2.15/src/video/ps3/SDL_ps3video.c b/distrib/sdl-1.2.15/src/video/ps3/SDL_ps3video.c
new file mode 100644
index 0000000..d5519e0
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ps3/SDL_ps3video.c
@@ -0,0 +1,621 @@
+/*
+ * SDL - Simple DirectMedia Layer
+ * CELL BE Support for PS3 Framebuffer
+ * Copyright (C) 2008, 2009 International Business Machines Corporation
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * Martin Lowinski <lowinski [at] de [dot] ibm [ibm] com>
+ * Dirk Herrendoerfer <d.herrendoerfer [at] de [dot] ibm [dot] com>
+ * SPE code based on research by:
+ * Rene Becker
+ * Thimo Emmerich
+ */
+
+#include "SDL_config.h"
+
+#include "SDL_video.h"
+#include "../SDL_sysvideo.h"
+#include "SDL_ps3events_c.h"
+#include "SDL_ps3video.h"
+#include "SDL_ps3yuv_c.h"
+#include "spulibs/spu_common.h"
+
+#include <fcntl.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <linux/kd.h>
+#include <sys/mman.h>
+
+#include <linux/fb.h>
+#include <asm/ps3fb.h>
+#include <libspe2.h>
+#include <malloc.h>
+
+/* SDL_VideoDevice functions */
+static int PS3_Available();
+static SDL_VideoDevice *PS3_CreateDevice(int devindex);
+static int PS3_VideoInit(_THIS, SDL_PixelFormat * vformat);
+static void PS3_VideoQuit(_THIS);
+static void PS3_DeleteDevice(SDL_VideoDevice * device);
+static SDL_Surface *PS3_SetVideoMode(_THIS, SDL_Surface * current, int width, int height, int bpp, Uint32 flags);
+static SDL_Rect **PS3_ListModes(_THIS, SDL_PixelFormat * format, Uint32 flags);
+
+/* Hardware surface functions */
+static int PS3_AllocHWSurface(_THIS, SDL_Surface * surface);
+static void PS3_FreeHWSurface(_THIS, SDL_Surface * surface);
+static int PS3_LockHWSurface(_THIS, SDL_Surface * surface);
+static void PS3_UnlockHWSurface(_THIS, SDL_Surface * surface);
+static int PS3_FlipDoubleBuffer(_THIS, SDL_Surface * surface);
+static void PS3_DoubleBufferUpdate(_THIS, int numrects, SDL_Rect * rects);
+
+/* SPU specific functions */
+int SPE_Start(_THIS, spu_data_t * spe_data);
+int SPE_Stop(_THIS, spu_data_t * spe_data);
+int SPE_Boot(_THIS, spu_data_t * spe_data);
+int SPE_Shutdown(_THIS, spu_data_t * spe_data);
+int SPE_SendMsg(_THIS, spu_data_t * spe_data, unsigned int msg);
+int SPE_WaitForMsg(_THIS, spu_data_t * spe_data, unsigned int msg);
+void SPE_RunContext(void *thread_argp);
+
+/* Helpers */
+void enable_cursor(int enable);
+
+/* Stores the SPE executable name of fb_writer_spu */
+extern spe_program_handle_t fb_writer_spu;
+
+/* SDL PS3 bootstrap function for checking availability */
+static int PS3_Available()
+{
+ return 1;
+}
+
+/* SDL PS3 bootstrap function for creating the device */
+static SDL_VideoDevice *PS3_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *this;
+
+ /* Initialise SDL_VideoDevice */
+ this = (SDL_VideoDevice *) SDL_malloc(sizeof(SDL_VideoDevice));
+ if (this) {
+ memset(this, 0, sizeof *this);
+ this->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc(sizeof(struct SDL_PrivateVideoData));
+ }
+ /* Error handling */
+ if ((this == NULL) || (this->hidden == NULL)) {
+ SDL_OutOfMemory();
+ if (this)
+ SDL_free(this);
+ return 0;
+ }
+ memset(this->hidden, 0, sizeof(struct SDL_PrivateVideoData));
+
+ /* Set the function pointers */
+ this->VideoInit = PS3_VideoInit;
+ this->ListModes = PS3_ListModes;
+ this->SetVideoMode = PS3_SetVideoMode;
+ this->SetColors = 0;
+ this->CreateYUVOverlay = PS3_CreateYUVOverlay;
+ this->UpdateRects = 0;
+ this->VideoQuit = PS3_VideoQuit;
+ this->AllocHWSurface = PS3_AllocHWSurface;
+ this->CheckHWBlit = 0;
+ this->FillHWRect = 0;
+ this->SetHWColorKey = 0;
+ this->SetHWAlpha = 0;
+ this->LockHWSurface = PS3_LockHWSurface;
+ this->UnlockHWSurface = PS3_UnlockHWSurface;
+ this->FlipHWSurface = PS3_FlipDoubleBuffer;
+ this->FreeHWSurface = PS3_FreeHWSurface;
+ this->SetCaption = 0;
+ this->SetIcon = 0;
+ this->IconifyWindow = 0;
+ this->GrabInput = 0;
+ this->GetWMInfo = 0;
+ this->InitOSKeymap = PS3_InitOSKeymap;
+ this->PumpEvents = PS3_PumpEvents;
+
+ this->free = PS3_DeleteDevice;
+
+ return this;
+}
+
+
+/* Bootstraping (see SDL_sysvideo.h) */
+VideoBootStrap PS3_bootstrap = {
+ "ps3", "PS3 Cell SPU Driver",
+ PS3_Available, PS3_CreateDevice
+};
+
+
+/* Delete the device */
+static void PS3_DeleteDevice(SDL_VideoDevice * device)
+{
+ free(device->hidden);
+ free(device);
+}
+
+
+/* Initialise the PS3 video device */
+static int PS3_VideoInit(_THIS, SDL_PixelFormat * vformat)
+{
+ /* Hide the cursor */
+ enable_cursor(0);
+
+ /* Create SPU fb_parms and thread structure */
+ fb_parms = (struct fb_writer_parms_t *)
+ memalign(16, sizeof(struct fb_writer_parms_t));
+ fb_thread_data = (spu_data_t *) malloc(sizeof(spu_data_t));
+ if (fb_parms == NULL || fb_thread_data == NULL) {
+ SDL_OutOfMemory();
+ return -1;
+ }
+ fb_thread_data->program = fb_writer_spu;
+ fb_thread_data->program_name = "fb_writer_spu";
+ fb_thread_data->argp = (void *)fb_parms;
+ fb_thread_data->keepalive = 1;
+ fb_thread_data->booted = 0;
+
+ SPE_Start(this, fb_thread_data);
+
+ /* Open the device */
+ fb_dev_fd = open(PS3_DEV_FB, O_RDWR);
+ if (fb_dev_fd < 0) {
+ SDL_SetError("[PS3] Unable to open device %s", PS3_DEV_FB);
+ return -1;
+ }
+
+ /* Get vscreeninfo */
+ if (ioctl(fb_dev_fd, FBIOGET_VSCREENINFO, &fb_vinfo)) {
+ SDL_SetError("[PS3] Can't get VSCREENINFO");
+ if (fb_dev_fd >= 0)
+ close(fb_dev_fd);
+ fb_dev_fd = -1;
+ return -1;
+ }
+
+ /* Fill in our hardware acceleration capabilities */
+ this->info.current_w = fb_vinfo.xres;
+ this->info.current_h = fb_vinfo.yres;
+ this->info.wm_available = 0;
+ this->info.hw_available = 1;
+
+ /* Backup the original vinfo to restore later */
+ fb_orig_vinfo = fb_vinfo;
+
+ /* 16 and 15 bpp is reported as 16 bpp */
+ fb_bits_per_pixel = fb_vinfo.bits_per_pixel;
+ if (fb_bits_per_pixel == 16)
+ fb_bits_per_pixel =
+ fb_vinfo.red.length + fb_vinfo.green.length +
+ fb_vinfo.blue.length;
+
+ /* Set SDL_PixelFormat */
+ vformat->BitsPerPixel = fb_vinfo.bits_per_pixel;
+
+ fb_vinfo.xres_virtual = fb_vinfo.xres;
+ fb_vinfo.yres_virtual = fb_vinfo.yres;
+
+ /* Put vscreeninfo */
+ if (ioctl(fb_dev_fd, FBIOPUT_VSCREENINFO, &fb_vinfo)) {
+ SDL_SetError("[PS3] Can't put VSCREENINFO");
+ if (fb_dev_fd >= 0)
+ close(fb_dev_fd);
+ fb_dev_fd = -1;
+ return -1;
+ }
+
+ s_fb_pixel_size = fb_vinfo.bits_per_pixel / 8;
+
+ s_writeable_width = fb_vinfo.xres;
+ s_writeable_height = fb_vinfo.yres;
+
+ /* Get ps3 screeninfo */
+ if (ioctl(fb_dev_fd, PS3FB_IOCTL_SCREENINFO, (unsigned long)&res) < 0) {
+ SDL_SetError("[PS3] PS3FB_IOCTL_SCREENINFO failed");
+ }
+ deprintf(1, "[PS3] xres:%d yres:%d xoff:%d yoff:%d\n", res.xres, res.yres, res.xoff, res.yoff);
+
+ /* Only use double buffering if enough fb memory is available */
+ if (res.num_frames < 2) {
+ double_buffering = 0;
+ } else {
+ double_buffering = 1;
+ }
+
+ real_width = res.xres;
+ real_height = res.yres;
+
+ /*
+ * Take control of frame buffer from kernel, for details see
+ * http://felter.org/wesley/files/ps3/linux-20061110-docs/ApplicationProgrammingEnvironment.html
+ * kernel will no longer flip the screen itself
+ */
+ ioctl(fb_dev_fd, PS3FB_IOCTL_ON, 0);
+
+ /* Unblank screen */
+ ioctl(fb_dev_fd, FBIOBLANK, 0);
+
+ return 0;
+}
+
+
+/* List available PS3 resolutions */
+static SDL_Rect **PS3_ListModes(_THIS, SDL_PixelFormat * format, Uint32 flags)
+{
+ /* A list of video resolutions that we query for (sorted largest to
+ * smallest)
+ */
+ static SDL_Rect PS3_resolutions[] = {
+ {0, 0, 1920, 1080}, // 1080p 16:9 HD
+ {0, 0, 1600, 1200}, // WUXGA
+ {0, 0, 1280, 1024}, // SXGA
+ {0, 0, 1280, 720}, // 720p 16:9 HD
+ {0, 0, 1024, 768}, // WXGA
+ {0, 0, 1024, 576}, // 576p 16:9
+ {0, 0, 853, 480}, // 480p 16:9
+ {0, 0, 720, 576}, // 576p 4:3 (PAL)
+ {0, 0, 720, 480}, // 480p 16:9 (NTSC)
+ };
+ static SDL_Rect *PS3_modes[] = {
+ &PS3_resolutions[0],
+ &PS3_resolutions[1],
+ &PS3_resolutions[2],
+ &PS3_resolutions[3],
+ &PS3_resolutions[4],
+ &PS3_resolutions[5],
+ &PS3_resolutions[6],
+ &PS3_resolutions[7],
+ &PS3_resolutions[8],
+ NULL
+ };
+ SDL_Rect **modes = PS3_modes;
+
+ return modes;
+}
+
+
+/* Get a list of the available display modes */
+static SDL_Surface *PS3_SetVideoMode(_THIS, SDL_Surface * current, int width, int height, int bpp, Uint32 flags)
+{
+ s_bounded_input_width = width < s_writeable_width ? width : s_writeable_width;
+ s_bounded_input_height = height < s_writeable_height ? height : s_writeable_height;
+ s_bounded_input_width_offset = (s_writeable_width - s_bounded_input_width) >> 1;
+ s_bounded_input_height_offset = (s_writeable_height - s_bounded_input_height) >> 1;
+ s_input_line_length = width * s_fb_pixel_size;
+
+ current->flags |= flags;
+
+ if (ioctl(fb_dev_fd, FBIOGET_FSCREENINFO, &fb_finfo)) {
+ SDL_SetError("[PS3] Can't get fixed screeninfo");
+ return NULL;
+ }
+
+ if (fb_finfo.type != FB_TYPE_PACKED_PIXELS) {
+ SDL_SetError("[PS3] type %s not supported",
+ fb_finfo.type);
+ return NULL;
+ }
+
+ /* Note: on PS3, fb_finfo.smem_len is enough for double buffering */
+ if ((frame_buffer =
+ (uint8_t *) mmap(0, fb_finfo.smem_len,
+ PROT_READ | PROT_WRITE, MAP_SHARED,
+ fb_dev_fd, 0)) == (uint8_t *) - 1) {
+ SDL_SetError("[PS3] Can't mmap for %s", PS3_DEV_FB);
+ return NULL;
+ } else {
+ current->flags |= SDL_DOUBLEBUF;
+ }
+ if (!SDL_ReallocFormat(current, fb_bits_per_pixel, 0, 0, 0, 0)) {
+ return (NULL);
+ }
+
+ /* Blank screen */
+ memset(frame_buffer, 0x00, fb_finfo.smem_len);
+
+ /* Centering */
+ s_center[0] =
+ frame_buffer + s_bounded_input_width_offset * s_fb_pixel_size +
+ s_bounded_input_height_offset * fb_finfo.line_length;
+ s_center[1] = s_center[0] + real_height * fb_finfo.line_length;
+ s_center_index = 0;
+
+ current->flags |= SDL_FULLSCREEN;
+ current->w = width;
+ current->h = height;
+ current->pitch = SDL_CalculatePitch(current);
+
+ /* Alloc aligned mem for current->pixels */
+ s_pixels = memalign(16, current->h * current->pitch);
+ current->pixels = (void *)s_pixels;
+ if (!current->pixels) {
+ SDL_OutOfMemory();
+ return NULL;
+ }
+
+ /* Set the update rectangle function */
+ this->UpdateRects = PS3_DoubleBufferUpdate;
+
+ return current;
+}
+
+
+/* Copy screen to framebuffer and flip */
+void PS3_DoubleBufferUpdate(_THIS, int numrects, SDL_Rect * rects)
+{
+ if (converter_thread_data && converter_thread_data->booted)
+ SPE_WaitForMsg(this, converter_thread_data, SPU_FIN);
+
+ /* Adjust centering */
+ s_bounded_input_width_offset = (s_writeable_width - s_bounded_input_width) >> 1;
+ s_bounded_input_height_offset = (s_writeable_height - s_bounded_input_height) >> 1;
+ s_center[0] = frame_buffer + s_bounded_input_width_offset * s_fb_pixel_size +
+ s_bounded_input_height_offset * fb_finfo.line_length;
+ s_center[1] = s_center[0] + real_height * fb_finfo.line_length;
+
+ /* Set SPU parms for copying the surface to framebuffer */
+ fb_parms->data = (unsigned char *)s_pixels;
+ fb_parms->center = s_center[s_center_index];
+ fb_parms->out_line_stride = fb_finfo.line_length;
+ fb_parms->in_line_stride = s_input_line_length;
+ fb_parms->bounded_input_height = s_bounded_input_height;
+ fb_parms->bounded_input_width = s_bounded_input_width;
+ fb_parms->fb_pixel_size = s_fb_pixel_size;
+
+ deprintf(3, "[PS3->SPU] fb_thread_data->argp = 0x%x\n", fb_thread_data->argp);
+
+ /* Copying.. */
+ SPE_SendMsg(this, fb_thread_data, SPU_START);
+ SPE_SendMsg(this, fb_thread_data, (unsigned int)fb_thread_data->argp);
+
+ SPE_WaitForMsg(this, fb_thread_data, SPU_FIN);
+
+ /* Flip the pages */
+ if (double_buffering)
+ s_center_index = s_center_index ^ 0x01;
+ PS3_FlipDoubleBuffer(this, this->screen);
+}
+
+
+/* Enable/Disable cursor */
+void enable_cursor(int enable)
+{
+ int fd = open("/dev/console", O_RDWR | O_NONBLOCK);
+ if (fd >= 0) {
+ ioctl(fd, KDSETMODE, enable ? KD_TEXT : KD_GRAPHICS);
+ close(fd);
+ }
+}
+
+
+static int PS3_AllocHWSurface(_THIS, SDL_Surface * surface)
+{
+ return -1;
+}
+
+
+static void PS3_FreeHWSurface(_THIS, SDL_Surface * surface)
+{
+ return;
+}
+
+
+static int PS3_LockHWSurface(_THIS, SDL_Surface * surface)
+{
+ return 0;
+}
+
+
+static void PS3_UnlockHWSurface(_THIS, SDL_Surface * surface)
+{
+ return;
+}
+
+
+/* Blit/Flip buffer to the screen. Must be called after each frame! */
+int PS3_FlipDoubleBuffer(_THIS, SDL_Surface * surface)
+{
+ unsigned long crt = 0;
+ /* Wait for vsync */
+ deprintf(1, "[PS3] Wait for vsync\n");
+ ioctl(fb_dev_fd, FBIO_WAITFORVSYNC, &crt);
+ /* Page flip */
+ deprintf(1, "[PS3] Page flip to buffer #%u 0x%x\n", s_center_index, s_center[s_center_index]);
+ ioctl(fb_dev_fd, PS3FB_IOCTL_FSEL, (unsigned long)&s_center_index);
+ return 1;
+}
+
+
+/* Start the SPE thread */
+int SPE_Start(_THIS, spu_data_t * spe_data)
+{
+ deprintf(2, "[PS3->SPU] Start SPE: %s\n", spe_data->program_name);
+ if (!(spe_data->booted))
+ SPE_Boot(this, spe_data);
+
+ /* To allow re-running of context, spe_ctx_entry has to be set before each call */
+ spe_data->entry = SPE_DEFAULT_ENTRY;
+ spe_data->error_code = 0;
+
+ /* Create SPE thread and run */
+ deprintf(2, "[PS3->SPU] Create Thread: %s\n", spe_data->program_name);
+ if (pthread_create
+ (&spe_data->thread, NULL, (void *)&SPE_RunContext, (void *)spe_data)) {
+ deprintf(2, "[PS3->SPU] Could not create pthread for spe: %s\n", spe_data->program_name);
+ SDL_SetError("[PS3->SPU] Could not create pthread for spe");
+ return -1;
+ }
+
+ if (spe_data->keepalive)
+ SPE_WaitForMsg(this, spe_data, SPU_READY);
+}
+
+
+/* Stop the SPE thread */
+int SPE_Stop(_THIS, spu_data_t * spe_data)
+{
+ deprintf(2, "[PS3->SPU] Stop SPE: %s\n", spe_data->program_name);
+ /* Wait for SPE thread to complete */
+ deprintf(2, "[PS3->SPU] Wait for SPE thread to complete: %s\n", spe_data->program_name);
+ if (pthread_join(spe_data->thread, NULL)) {
+ deprintf(2, "[PS3->SPU] Failed joining the thread: %s\n", spe_data->program_name);
+ SDL_SetError("[PS3->SPU] Failed joining the thread");
+ return -1;
+ }
+
+ return 0;
+}
+
+
+/* Create SPE context and load program */
+int SPE_Boot(_THIS, spu_data_t * spe_data)
+{
+ /* Create SPE context */
+ deprintf(2, "[PS3->SPU] Create SPE Context: %s\n", spe_data->program_name);
+ spe_data->ctx = spe_context_create(0, NULL);
+ if (spe_data->ctx == NULL) {
+ deprintf(2, "[PS3->SPU] Failed creating SPE context: %s\n", spe_data->program_name);
+ SDL_SetError("[PS3->SPU] Failed creating SPE context");
+ return -1;
+ }
+
+ /* Load SPE object into SPE local store */
+ deprintf(2, "[PS3->SPU] Load Program into SPE: %s\n", spe_data->program_name);
+ if (spe_program_load(spe_data->ctx, &spe_data->program)) {
+ deprintf(2, "[PS3->SPU] Failed loading program into SPE context: %s\n", spe_data->program_name);
+ SDL_SetError
+ ("[PS3->SPU] Failed loading program into SPE context");
+ return -1;
+ }
+ spe_data->booted = 1;
+ deprintf(2, "[PS3->SPU] SPE boot successful\n");
+
+ return 0;
+}
+
+/* (Stop and) shutdown the SPE */
+int SPE_Shutdown(_THIS, spu_data_t * spe_data)
+{
+ if (spe_data->keepalive && spe_data->booted) {
+ SPE_SendMsg(this, spe_data, SPU_EXIT);
+ SPE_Stop(this, spe_data);
+ }
+
+ /* Destroy SPE context */
+ deprintf(2, "[PS3->SPU] Destroy SPE context: %s\n", spe_data->program_name);
+ if (spe_context_destroy(spe_data->ctx)) {
+ deprintf(2, "[PS3->SPU] Failed destroying context: %s\n", spe_data->program_name);
+ SDL_SetError("[PS3->SPU] Failed destroying context");
+ return -1;
+ }
+ deprintf(2, "[PS3->SPU] SPE shutdown successful: %s\n", spe_data->program_name);
+ return 0;
+}
+
+
+/* Send message to the SPE via mailboxe */
+int SPE_SendMsg(_THIS, spu_data_t * spe_data, unsigned int msg)
+{
+ deprintf(2, "[PS3->SPU] Sending message %u to %s\n", msg, spe_data->program_name);
+ /* Send one message, block until message was sent */
+ unsigned int spe_in_mbox_msgs[1];
+ spe_in_mbox_msgs[0] = msg;
+ int in_mbox_write = spe_in_mbox_write(spe_data->ctx, spe_in_mbox_msgs, 1, SPE_MBOX_ALL_BLOCKING);
+
+ if (1 > in_mbox_write) {
+ deprintf(2, "[PS3->SPU] No message could be written to %s\n", spe_data->program_name);
+ SDL_SetError("[PS3->SPU] No message could be written");
+ return -1;
+ }
+ return 0;
+}
+
+
+/* Read 1 message from SPE, block until at least 1 message was received */
+int SPE_WaitForMsg(_THIS, spu_data_t * spe_data, unsigned int msg)
+{
+ deprintf(2, "[PS3->SPU] Waiting for message from %s\n", spe_data->program_name);
+ unsigned int out_messages[1];
+ while (!spe_out_mbox_status(spe_data->ctx));
+ int mbox_read = spe_out_mbox_read(spe_data->ctx, out_messages, 1);
+ deprintf(2, "[PS3->SPU] Got message from %s, message was %u\n", spe_data->program_name, out_messages[0]);
+ if (out_messages[0] == msg)
+ return 0;
+ else
+ return -1;
+}
+
+
+/* Re-runnable invocation of the spe_context_run call */
+void SPE_RunContext(void *thread_argp)
+{
+ /* argp is the pointer to argument to be passed to the SPE program */
+ spu_data_t *args = (spu_data_t *) thread_argp;
+ deprintf(3, "[PS3->SPU] void* argp=0x%x\n", (unsigned int)args->argp);
+
+ /* Run it.. */
+ deprintf(2, "[PS3->SPU] Run SPE program: %s\n", args->program_name);
+ if (spe_context_run
+ (args->ctx, &args->entry, 0, (void *)args->argp, NULL,
+ NULL) < 0) {
+ deprintf(2, "[PS3->SPU] Failed running SPE context: %s\n", args->program_name);
+ SDL_SetError("[PS3->SPU] Failed running SPE context: %s", args->program_name);
+ exit(1);
+ }
+
+ pthread_exit(NULL);
+}
+
+
+/* Quits the video driver */
+static void PS3_VideoQuit(_THIS)
+{
+ if (fb_dev_fd > 0) {
+ /* Restore the original video mode */
+ if (ioctl(fb_dev_fd, FBIOPUT_VSCREENINFO, &fb_orig_vinfo))
+ SDL_SetError("[PS3] Can't restore original fb_var_screeninfo");
+
+ /* Give control of frame buffer to kernel */
+ ioctl(fb_dev_fd, PS3FB_IOCTL_OFF, 0);
+ close(fb_dev_fd);
+ fb_dev_fd = -1;
+ }
+
+ if (frame_buffer) {
+ munmap(frame_buffer, fb_finfo.smem_len);
+ frame_buffer = 0;
+ }
+
+ if (fb_parms)
+ free((void *)fb_parms);
+ if (fb_thread_data) {
+ SPE_Shutdown(this, fb_thread_data);
+ free((void *)fb_thread_data);
+ }
+
+ if (this->screen) {
+ if (double_buffering && this->screen->pixels) {
+ free(this->screen->pixels);
+ }
+ this->screen->pixels = NULL;
+ }
+
+ enable_cursor(1);
+ deprintf(1, "[PS3] VideoQuit\n");
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/ps3/SDL_ps3video.h b/distrib/sdl-1.2.15/src/video/ps3/SDL_ps3video.h
new file mode 100644
index 0000000..4fe5a2b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ps3/SDL_ps3video.h
@@ -0,0 +1,165 @@
+/*
+ * SDL - Simple DirectMedia Layer
+ * CELL BE Support for PS3 Framebuffer
+ * Copyright (C) 2008, 2009 International Business Machines Corporation
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * Martin Lowinski <lowinski [at] de [dot] ibm [ibm] com>
+ * Dirk Herrendoerfer <d.herrendoerfer [at] de [dot] ibm [dot] com>
+ * SPE code based on research by:
+ * Rene Becker
+ * Thimo Emmerich
+ */
+
+#include "SDL_config.h"
+#include "../SDL_sysvideo.h"
+#include "SDL_mouse.h"
+#include "SDL_mutex.h"
+#include "spulibs/spu_common.h"
+
+#include <libspe2.h>
+#include <pthread.h>
+#include <linux/types.h>
+#include <linux/fb.h>
+#include <asm/ps3fb.h>
+#include <linux/vt.h>
+#include <termios.h>
+
+#ifndef _SDL_ps3video_h
+#define _SDL_ps3video_h
+
+/* Debugging
+ * 0: No debug messages
+ * 1: Video debug messages
+ * 2: SPE debug messages
+ * 3: Memory adresses
+ */
+#define DEBUG_LEVEL 0
+
+#ifdef DEBUG_LEVEL
+#define deprintf( level, fmt, args... ) \
+ do \
+{ \
+ if ( (unsigned)(level) <= DEBUG_LEVEL ) \
+ { \
+ fprintf( stdout, fmt, ##args ); \
+ fflush( stdout ); \
+ } \
+} while ( 0 )
+#else
+#define deprintf( level, fmt, args... )
+#endif
+
+/* Framebuffer device */
+#define PS3_DEV_FB "/dev/fb0"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice * this
+
+/* SPU thread data */
+typedef struct spu_data {
+ spe_context_ptr_t ctx;
+ pthread_t thread;
+ spe_program_handle_t program;
+ char * program_name;
+ unsigned int booted;
+ unsigned int keepalive;
+ unsigned int entry;
+ int error_code;
+ void * argp;
+} spu_data_t;
+
+/* Private video driver data needed for Cell support */
+struct SDL_PrivateVideoData
+{
+ const char * const fb_dev_name; /* FB-device name */
+ int fb_dev_fd; /* Descriptor-handle for fb_dev_name */
+ uint8_t * frame_buffer; /* mmap'd access to fbdev */
+
+ /* SPE threading stuff */
+ spu_data_t * fb_thread_data;
+ spu_data_t * scaler_thread_data;
+ spu_data_t * converter_thread_data;
+
+ /* screeninfo (from linux/fb.h) */
+ struct fb_fix_screeninfo fb_finfo;
+ struct fb_var_screeninfo fb_vinfo;
+ struct fb_var_screeninfo fb_orig_vinfo;
+
+ /* screeninfo (from asm/ps3fb.h) */
+ struct ps3fb_ioctl_res res;
+
+ unsigned int double_buffering;
+ uint32_t real_width; // real width of screen
+ uint32_t real_height; // real height of screen
+
+ uint32_t s_fb_pixel_size; // 32: 4 24: 3 16: 2 15: 2
+ uint32_t fb_bits_per_pixel; // 32: 32 24: 24 16: 16 15: 15
+
+ uint32_t config_count;
+
+ uint32_t s_input_line_length; // precalculated: input_width * fb_pixel_size
+ uint32_t s_bounded_input_width; // width of input (bounded by writeable width)
+ uint32_t s_bounded_input_height;// height of input (bounded by writeable height)
+ uint32_t s_bounded_input_width_offset; // offset from the left side (used for centering)
+ uint32_t s_bounded_input_height_offset; // offset from the upper side (used for centering)
+ uint32_t s_writeable_width; // width of screen which is writeable
+ uint32_t s_writeable_height; // height of screen which is writeable
+
+ uint8_t * s_center[2]; // where to begin writing our image (centered?)
+ uint32_t s_center_index;
+
+ volatile void * s_pixels __attribute__((aligned(128)));
+
+ /* Framebuffer data */
+ volatile struct fb_writer_parms_t * fb_parms __attribute__((aligned(128)));
+};
+
+#define fb_dev_name (this->hidden->fb_dev_name)
+#define fb_dev_fd (this->hidden->fb_dev_fd)
+#define frame_buffer (this->hidden->frame_buffer)
+#define fb_thread_data (this->hidden->fb_thread_data)
+#define scaler_thread_data (this->hidden->scaler_thread_data)
+#define converter_thread_data (this->hidden->converter_thread_data)
+#define fb_parms (this->hidden->fb_parms)
+#define SDL_nummodes (this->hidden->SDL_nummodes)
+#define SDL_modelist (this->hidden->SDL_modelist)
+#define SDL_videomode (this->hidden->SDL_videomode)
+#define fb_finfo (this->hidden->fb_finfo)
+#define fb_vinfo (this->hidden->fb_vinfo)
+#define fb_orig_vinfo (this->hidden->fb_orig_vinfo)
+#define res (this->hidden->res)
+#define double_buffering (this->hidden->double_buffering)
+#define real_width (this->hidden->real_width)
+#define real_height (this->hidden->real_height)
+#define s_fb_pixel_size (this->hidden->s_fb_pixel_size)
+#define fb_bits_per_pixel (this->hidden->fb_bits_per_pixel)
+#define config_count (this->hidden->config_count)
+#define s_input_line_length (this->hidden->s_input_line_length)
+#define s_bounded_input_width (this->hidden->s_bounded_input_width)
+#define s_bounded_input_height (this->hidden->s_bounded_input_height)
+#define s_bounded_input_width_offset (this->hidden->s_bounded_input_width_offset)
+#define s_bounded_input_height_offset (this->hidden->s_bounded_input_height_offset)
+#define s_writeable_width (this->hidden->s_writeable_width)
+#define s_writeable_height (this->hidden->s_writeable_height)
+#define s_center (this->hidden->s_center)
+#define s_center_index (this->hidden->s_center_index)
+#define s_pixels (this->hidden->s_pixels)
+
+#endif /* _SDL_ps3video_h */
+
+
diff --git a/distrib/sdl-1.2.15/src/video/ps3/SDL_ps3yuv.c b/distrib/sdl-1.2.15/src/video/ps3/SDL_ps3yuv.c
new file mode 100644
index 0000000..b1e17da
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ps3/SDL_ps3yuv.c
@@ -0,0 +1,340 @@
+/*
+ * SDL - Simple DirectMedia Layer
+ * CELL BE Support for PS3 Framebuffer
+ * Copyright (C) 2008, 2009 International Business Machines Corporation
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * Martin Lowinski <lowinski [at] de [dot] ibm [ibm] com>
+ * Dirk Herrendoerfer <d.herrendoerfer [at] de [dot] ibm [dot] com>
+ * SPE code based on research by:
+ * Rene Becker
+ * Thimo Emmerich
+ */
+
+#include "SDL_config.h"
+
+#include "SDL_video.h"
+#include "SDL_ps3video.h"
+#include "SDL_ps3yuv_c.h"
+#include "../SDL_yuvfuncs.h"
+#include "spulibs/spu_common.h"
+
+/* Stores the executable name */
+extern spe_program_handle_t yuv2rgb_spu;
+extern spe_program_handle_t bilin_scaler_spu;
+
+int SPE_Start(_THIS, spu_data_t * spe_data);
+int SPE_Stop(_THIS, spu_data_t * spe_data);
+int SPE_Boot(_THIS, spu_data_t * spe_data);
+int SPE_Shutdown(_THIS, spu_data_t * spe_data);
+int SPE_SendMsg(_THIS, spu_data_t * spe_data, unsigned int msg);
+int SPE_WaitForMsg(_THIS, spu_data_t * spe_data, unsigned int msg);
+void SPE_RunContext(void *thread_argp);
+
+
+/* The functions used to manipulate software video overlays */
+static struct private_yuvhwfuncs ps3_yuvfuncs = {
+ PS3_LockYUVOverlay,
+ PS3_UnlockYUVOverlay,
+ PS3_DisplayYUVOverlay,
+ PS3_FreeYUVOverlay
+};
+
+
+struct private_yuvhwdata {
+ SDL_Surface *display;
+ SDL_Surface *stretch;
+ volatile void * pixels __attribute__((aligned(128)));
+
+ /* These are just so we don't have to allocate them separately */
+ Uint16 pitches[3];
+ Uint8 * planes[3];
+
+ unsigned int scale;
+
+ /* Scaled YUV picture */
+ Uint8 * scaler_out __attribute__((aligned(128)));
+
+ /* YUV2RGB converter data */
+ volatile struct yuv2rgb_parms_t * converter_parms __attribute__((aligned(128)));
+
+ /* Scaler data */
+ volatile struct scale_parms_t * scaler_parms __attribute__((aligned(128)));
+
+ Uint8 locked;
+};
+
+
+SDL_Overlay *PS3_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display) {
+ /* Only RGB packed pixel conversion supported */
+ if ((display->format->BytesPerPixel != 2) &&
+ (display->format->BytesPerPixel != 3) &&
+ (display->format->BytesPerPixel != 4))
+ {
+ SDL_SetError ("Can't use YUV data on non 16/24/32 bit surfaces");
+ return NULL;
+ }
+
+ /* Double-check the requested format. We'll only support YV12 */
+ switch (format) {
+ case SDL_IYUV_OVERLAY:
+ case SDL_YV12_OVERLAY:
+ /* Supported YUV format */
+ break;
+ default:
+ SDL_SetError("Unsupported YUV format");
+ return NULL;
+ }
+
+ SDL_Overlay* overlay;
+ struct private_yuvhwdata* hwdata;
+
+ /* Create the overlay structure */
+ overlay = (SDL_Overlay *) SDL_calloc(1, sizeof(SDL_Overlay));
+ if (overlay == NULL) {
+ SDL_OutOfMemory();
+ return NULL;
+ }
+ SDL_memset(overlay, 0, (sizeof *overlay));
+
+ /* Set the basic attributes */
+ overlay->format = format;
+ overlay->w = width;
+ overlay->h = height;
+ overlay->hwdata = NULL;
+
+ /* Set up the PS3 YUV surface function structure */
+ overlay->hwfuncs = &ps3_yuvfuncs;
+
+ /* Create the pixel data and lookup tables */
+ hwdata = (struct private_yuvhwdata *) SDL_calloc(1, sizeof(struct private_yuvhwdata));
+ if (hwdata == NULL) {
+ SDL_OutOfMemory();
+ SDL_FreeYUVOverlay(overlay);
+ return NULL;
+ }
+ overlay->hwdata = hwdata;
+
+ hwdata->stretch = NULL;
+ hwdata->display = display;
+
+ /* Create SPU parms structure */
+ hwdata->converter_parms = (struct yuv2rgb_parms_t *) memalign(16, sizeof(struct yuv2rgb_parms_t));
+ hwdata->scaler_parms = (struct scale_parms_t *) memalign(16, sizeof(struct scale_parms_t));
+ if (hwdata->converter_parms == NULL || hwdata->scaler_parms == NULL) {
+ SDL_FreeYUVOverlay(overlay);
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+
+ /* Set up the SPEs */
+ scaler_thread_data = (spu_data_t *) malloc(sizeof(spu_data_t));
+ converter_thread_data = (spu_data_t *) malloc(sizeof(spu_data_t));
+ if (converter_thread_data == NULL || scaler_thread_data == NULL) {
+ SDL_FreeYUVOverlay(overlay);
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+
+ scaler_thread_data->program = bilin_scaler_spu;
+ scaler_thread_data->program_name = "bilin_scaler_spu";
+ scaler_thread_data->keepalive = 0;
+ scaler_thread_data->booted = 0;
+
+ converter_thread_data->program = yuv2rgb_spu;
+ converter_thread_data->program_name = "yuv2rgb_spu";
+ converter_thread_data->keepalive = 1;
+ converter_thread_data->booted = 0;
+
+ SPE_Start(this, converter_thread_data);
+
+ hwdata->pixels = (Uint8 *) memalign(16, width * height + ((width * height) >> 1));
+ if (hwdata->pixels == NULL) {
+ SDL_FreeYUVOverlay(overlay);
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+
+ /* Find the pitch and offset values for the overlay */
+ overlay->pitches = hwdata->pitches;
+ overlay->pixels = hwdata->planes;
+ switch (format) {
+ case SDL_YV12_OVERLAY:
+ case SDL_IYUV_OVERLAY:
+ overlay->pitches[0] = overlay->w;
+ overlay->pitches[1] = overlay->pitches[0] / 2;
+ overlay->pitches[2] = overlay->pitches[0] / 2;
+ overlay->pixels[0] = (Uint8 *)hwdata->pixels;
+ overlay->pixels[1] = overlay->pixels[0] +
+ overlay->pitches[0] * overlay->h;
+ overlay->pixels[2] = overlay->pixels[1] +
+ overlay->pitches[1] * overlay->h / 2;
+ overlay->planes = 3;
+ break;
+ default:
+ /* We should never get here (caught above) */
+ break;
+ }
+
+ /* We're all done.. */
+ return overlay;
+}
+
+
+int PS3_LockYUVOverlay(_THIS, SDL_Overlay *overlay) {
+ if (overlay == NULL) {
+ return -1;
+ }
+ overlay->hwdata->locked = 1;
+
+ return 0;
+}
+
+
+void PS3_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay) {
+ if (overlay == NULL) {
+ return;
+ }
+ overlay->hwdata->locked = 0;
+
+ return;
+}
+
+
+int PS3_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst) {
+ if ((overlay == NULL) || (overlay->hwdata == NULL)) {
+ return -1;
+ }
+
+ Uint8 *lum, *Cr, *Cb;
+ struct private_yuvhwdata *hwdata;
+ SDL_Surface *display;
+
+ hwdata = overlay->hwdata;
+ display = hwdata->display;
+
+ /* Do we have to scale? */
+ if ((src->w != dst->w) || (src->h != dst->h) ) {
+ hwdata->scale = 1;
+ deprintf(1, "[PS3] We need to scale\n");
+ } else {
+ hwdata->scale = 0;
+ deprintf(1, "[PS3] No scaling\n");
+ }
+
+ /* Find out where the various portions of the image are */
+ switch (overlay->format) {
+ case SDL_YV12_OVERLAY:
+ lum = (Uint8 *)overlay->pixels[0];
+ Cr = (Uint8 *)overlay->pixels[1];
+ Cb = (Uint8 *)overlay->pixels[2];
+ break;
+ case SDL_IYUV_OVERLAY:
+ lum = (Uint8 *)overlay->pixels[0];
+ Cr = (Uint8 *)overlay->pixels[2];
+ Cb = (Uint8 *)overlay->pixels[1];
+ break;
+ default:
+ SDL_SetError("Unsupported YUV format in blit");
+ return -1;
+ }
+
+ if (hwdata->scale) {
+ /* Alloc mem for scaled YUV picture */
+ hwdata->scaler_out = (Uint8 *) memalign(16, dst->w * dst->h + ((dst->w * dst->h) >> 1));
+ if (hwdata->scaler_out == NULL) {
+ SDL_FreeYUVOverlay(overlay);
+ SDL_OutOfMemory();
+ return -1;
+ }
+
+ /* Set parms for scaling */
+ hwdata->scaler_parms->src_pixel_width = src->w;
+ hwdata->scaler_parms->src_pixel_height = src->h;
+ hwdata->scaler_parms->dst_pixel_width = dst->w;
+ hwdata->scaler_parms->dst_pixel_height = dst->h;
+ hwdata->scaler_parms->y_plane = lum;
+ hwdata->scaler_parms->v_plane = Cr;
+ hwdata->scaler_parms->u_plane = Cb;
+ hwdata->scaler_parms->dstBuffer = hwdata->scaler_out;
+ scaler_thread_data->argp = (void *)hwdata->scaler_parms;
+
+ /* Scale the YUV overlay to given size */
+ SPE_Start(this, scaler_thread_data);
+ SPE_Stop(this, scaler_thread_data);
+
+ /* Set parms for converting after scaling */
+ hwdata->converter_parms->y_plane = hwdata->scaler_out;
+ hwdata->converter_parms->v_plane = hwdata->scaler_out + dst->w * dst->h;
+ hwdata->converter_parms->u_plane = hwdata->scaler_out + dst->w * dst->h + ((dst->w * dst->h) >> 2);
+ } else {
+ /* Set parms for converting */
+ hwdata->converter_parms->y_plane = lum;
+ hwdata->converter_parms->v_plane = Cr;
+ hwdata->converter_parms->u_plane = Cb;
+ }
+
+ hwdata->converter_parms->src_pixel_width = dst->w;
+ hwdata->converter_parms->src_pixel_height = dst->h;
+ hwdata->converter_parms->dstBuffer = (Uint8 *) s_pixels;
+ converter_thread_data->argp = (void *)hwdata->converter_parms;
+
+ /* Convert YUV overlay to RGB */
+ SPE_SendMsg(this, converter_thread_data, SPU_START);
+ SPE_SendMsg(this, converter_thread_data, (unsigned int)converter_thread_data->argp);
+
+ /* Centering */
+ s_bounded_input_width = dst->w;
+ s_bounded_input_height = dst->h;
+
+ /* UpdateRects() will do the rest.. */
+ SDL_UpdateRects(display, 1, dst);
+
+ if (hwdata->scale)
+ SDL_free((void *)hwdata->scaler_out);
+
+ return 0;
+}
+
+
+void PS3_FreeYUVOverlay(_THIS, SDL_Overlay *overlay) {
+ if (overlay == NULL) {
+ return;
+ }
+
+ if (overlay->hwdata == NULL) {
+ return;
+ }
+
+ struct private_yuvhwdata * hwdata;
+ hwdata = overlay->hwdata;
+
+ if (scaler_thread_data)
+ SDL_free(scaler_thread_data);
+ if (converter_thread_data) {
+ SPE_Shutdown(this, converter_thread_data);
+ SDL_free(converter_thread_data);
+ }
+
+ if (hwdata) {
+ if (hwdata->pixels)
+ SDL_free((void *)hwdata->pixels);
+ SDL_free(hwdata);
+ }
+ return;
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/ps3/SDL_ps3yuv_c.h b/distrib/sdl-1.2.15/src/video/ps3/SDL_ps3yuv_c.h
new file mode 100644
index 0000000..49f9d70
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ps3/SDL_ps3yuv_c.h
@@ -0,0 +1,44 @@
+/*
+ * SDL - Simple DirectMedia Layer
+ * CELL BE Support for PS3 Framebuffer
+ * Copyright (C) 2008, 2009 International Business Machines Corporation
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * Martin Lowinski <lowinski [at] de [dot] ibm [ibm] com>
+ * Dirk Herrendoerfer <d.herrendoerfer [at] de [dot] ibm [dot] com>
+ * SPE code based on research by:
+ * Rene Becker
+ * Thimo Emmerich
+ */
+
+#include "SDL_config.h"
+
+#ifndef _SDL_ps3yuv_h
+#define _SDL_ps3yuv_h
+
+/* This is the PS3 implementation of YUV video overlays */
+
+#include "SDL_video.h"
+
+extern SDL_Overlay *PS3_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display);
+extern int PS3_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst);
+extern int PS3_LockYUVOverlay(_THIS, SDL_Overlay *overlay);
+extern void PS3_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay);
+extern void PS3_FreeYUVOverlay(_THIS, SDL_Overlay *overlay);
+
+#endif /* _SDL_ps3yuv_h */
+
diff --git a/distrib/sdl-1.2.15/src/video/ps3/spulibs/Makefile b/distrib/sdl-1.2.15/src/video/ps3/spulibs/Makefile
new file mode 100644
index 0000000..dc580d9
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ps3/spulibs/Makefile
@@ -0,0 +1,83 @@
+# This Makefile is for building the CELL BE SPU libs
+# libfb_writer_spu.so, libyuv2rgb_spu.so, libbilin_scaler_spu.so
+
+# Toolchain
+SPU_GCC=/usr/bin/spu-gcc
+PPU_GCC=/usr/bin/gcc
+PPU_EMBEDSPU=/usr/bin/embedspu
+PPU_AR=/usr/bin/ar
+PPU_LD=/usr/bin/ld
+INSTALL=/usr/bin/install
+
+SPU_CFLAGS=-W -Wall -Winline -Wno-main -I. -I /usr/spu/include -I /opt/cell/sdk/usr/spu/include -finline-limit=10000 -Winline -ftree-vectorize -funroll-loops -fmodulo-sched -ffast-math -fPIC -O2
+
+# Usually /usr/lib, depending on your distribution
+PREFIX=/usr/lib
+
+
+all: libfb_writer_spu.a libfb_writer_spu.so \
+ libyuv2rgb_spu.so libyuv2rgb_spu.a \
+ libbilin_scaler_spu.so libbilin_scaler_spu.a
+
+
+# fb_writer
+fb_writer_spu-embed.o: fb_writer.c spu_common.h
+ $(SPU_GCC) $(SPU_CFLAGS) -o fb_writer_spu fb_writer.c -lm
+ $(PPU_EMBEDSPU) -m32 fb_writer_spu fb_writer_spu fb_writer_spu-embed.o
+
+libfb_writer_spu.so: fb_writer_spu-embed.o
+ $(PPU_LD) -o libfb_writer_spu.so -shared -soname=libfb_writer_spu.so fb_writer_spu-embed.o
+
+libfb_writer_spu.a: fb_writer_spu-embed.o
+ $(PPU_AR) -qcs libfb_writer_spu.a fb_writer_spu-embed.o
+
+
+# yuv2rgb_converter
+yuv2rgb_spu-embed.o: yuv2rgb_converter.c spu_common.h
+ $(SPU_GCC) $(SPU_CFLAGS) -o yuv2rgb_spu yuv2rgb_converter.c -lm
+ $(PPU_EMBEDSPU) -m32 yuv2rgb_spu yuv2rgb_spu yuv2rgb_spu-embed.o
+
+libyuv2rgb_spu.a: yuv2rgb_spu-embed.o
+ $(PPU_AR) -qcs libyuv2rgb_spu.a yuv2rgb_spu-embed.o
+
+libyuv2rgb_spu.so: yuv2rgb_spu-embed.o
+ $(PPU_LD) -o libyuv2rgb_spu.so -shared -soname=libyuv2rgb_spu.so yuv2rgb_spu-embed.o
+
+
+# bilin_scaler
+bilin_scaler_spu-embed.o: bilin_scaler.c spu_common.h
+ $(SPU_GCC) $(SPU_CFLAGS) -o bilin_scaler_spu bilin_scaler.c -lm
+ $(PPU_EMBEDSPU) -m32 bilin_scaler_spu bilin_scaler_spu bilin_scaler_spu-embed.o
+
+libbilin_scaler_spu.a: bilin_scaler_spu-embed.o
+ $(PPU_AR) -qcs libbilin_scaler_spu.a bilin_scaler_spu-embed.o
+
+libbilin_scaler_spu.so: bilin_scaler_spu-embed.o
+ $(PPU_LD) -o libbilin_scaler_spu.so -shared -soname=libbilin_scaler_spu.so bilin_scaler_spu-embed.o
+
+install: libfb_writer_spu.a libfb_writer_spu.so \
+ libyuv2rgb_spu.so libyuv2rgb_spu.a \
+ libbilin_scaler_spu.so libbilin_scaler_spu.a
+ $(INSTALL) -c -m 0755 libfb_writer_spu.so $(PREFIX)/.
+ $(INSTALL) -c -m 0655 libfb_writer_spu.a $(PREFIX)/.
+ $(INSTALL) -c -m 0755 libyuv2rgb_spu.so $(PREFIX)/.
+ $(INSTALL) -c -m 0655 libyuv2rgb_spu.a $(PREFIX)/.
+ $(INSTALL) -c -m 0755 libbilin_scaler_spu.so $(PREFIX)/.
+ $(INSTALL) -c -m 0655 libbilin_scaler_spu.a $(PREFIX)/.
+
+
+uninstall: $(PREFIX)/libfb_writer_spu.so $(PREFIX)/libfb_writer_spu.a \
+ $(PREFIX)/libyuv2rgb_spu.so $(PREFIX)/libyuv2rgb_spu.a \
+ $(PREFIX)/libbilin_scaler_spu.so $(PREFIX)/libbilin_scaler_spu.a
+ rm -f $(PREFIX)/libfb_writer_spu.a
+ rm -f $(PREFIX)/libfb_writer_spu.so
+ rm -f $(PREFIX)/libyuv2rgb_spu.so
+ rm -f $(PREFIX)/libyuv2rgb_spu.a
+ rm -f $(PREFIX)/libbilin_scaler_spu.so
+ rm -f $(PREFIX)/libbilin_scaler_spu.a
+
+
+clean:
+ rm -f bilin_scaler_spu-embed.o libbilin_scaler_spu.so libbilin_scaler_spu.a bilin_scaler_spu
+ rm -f yuv2rgb_spu-embed.o libyuv2rgb_spu.so libyuv2rgb_spu.a yuv2rgb_spu
+ rm -f fb_writer_spu-embed.o libfb_writer_spu.so libfb_writer_spu.a fb_writer_spu
diff --git a/distrib/sdl-1.2.15/src/video/ps3/spulibs/bilin_scaler.c b/distrib/sdl-1.2.15/src/video/ps3/spulibs/bilin_scaler.c
new file mode 100644
index 0000000..be9b5c6
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ps3/spulibs/bilin_scaler.c
@@ -0,0 +1,2050 @@
+/*
+ * SDL - Simple DirectMedia Layer
+ * CELL BE Support for PS3 Framebuffer
+ * Copyright (C) 2008, 2009 International Business Machines Corporation
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * Martin Lowinski <lowinski [at] de [dot] ibm [ibm] com>
+ * Dirk Herrendoerfer <d.herrendoerfer [at] de [dot] ibm [dot] com>
+ * SPE code based on research by:
+ * Rene Becker
+ * Thimo Emmerich
+ */
+
+#include "spu_common.h"
+
+#include <spu_intrinsics.h>
+#include <spu_mfcio.h>
+
+// Debugging
+//#define DEBUG
+
+#ifdef DEBUG
+#define deprintf(fmt, args... ) \
+ fprintf( stdout, fmt, ##args ); \
+ fflush( stdout );
+#else
+#define deprintf( fmt, args... )
+#endif
+
+struct scale_parms_t parms __attribute__((aligned(128)));
+
+/* A maximum of 8 lines Y, therefore 4 lines V, 4 lines U are stored
+ * there might be the need to retrieve misaligned data, adjust
+ * incoming v and u plane to be able to handle this (add 128)
+ */
+unsigned char y_plane[2][(MAX_HDTV_WIDTH+128)*4] __attribute__((aligned(128)));
+unsigned char v_plane[2][(MAX_HDTV_WIDTH+128)*2] __attribute__((aligned(128)));
+unsigned char u_plane[2][(MAX_HDTV_WIDTH+128)*2] __attribute__((aligned(128)));
+
+/* temp-buffer for scaling: 4 lines Y, therefore 2 lines V, 2 lines U */
+unsigned char scaled_y_plane[2][MAX_HDTV_WIDTH*2] __attribute__((aligned(128)));
+unsigned char scaled_v_plane[2][MAX_HDTV_WIDTH/2] __attribute__((aligned(128)));
+unsigned char scaled_u_plane[2][MAX_HDTV_WIDTH/2] __attribute__((aligned(128)));
+
+/* some vectors needed by the float to int conversion */
+static const vector float vec_255 = { 255.0f, 255.0f, 255.0f, 255.0f };
+static const vector float vec_0_1 = { 0.1f, 0.1f, 0.1f, 0.1f };
+
+void bilinear_scale_line_w8(unsigned char* src, unsigned char* dst_, unsigned int dst_width, vector float vf_x_scale, vector float vf_NSweight, unsigned int src_linestride);
+void bilinear_scale_line_w16(unsigned char* src, unsigned char* dst_, unsigned int dst_width, vector float vf_x_scale, vector float vf_NSweight, unsigned int src_linestride);
+
+void scale_srcw16_dstw16();
+void scale_srcw16_dstw32();
+void scale_srcw32_dstw16();
+void scale_srcw32_dstw32();
+
+int main( unsigned long long spe_id __attribute__((unused)), unsigned long long argp )
+{
+ deprintf("[SPU] bilin_scaler_spu is up... (on SPE #%llu)\n", spe_id);
+ /* DMA transfer for the input parameters */
+ spu_mfcdma32(&parms, (unsigned int)argp, sizeof(struct scale_parms_t), TAG_INIT, MFC_GET_CMD);
+ DMA_WAIT_TAG(TAG_INIT);
+
+ deprintf("[SPU] Scale %ux%u to %ux%u\n", parms.src_pixel_width, parms.src_pixel_height,
+ parms.dst_pixel_width, parms.dst_pixel_height);
+
+ if(parms.src_pixel_width & 0x1f) {
+ if(parms.dst_pixel_width & 0x1F) {
+ deprintf("[SPU] Using scale_srcw16_dstw16\n");
+ scale_srcw16_dstw16();
+ } else {
+ deprintf("[SPU] Using scale_srcw16_dstw32\n");
+ scale_srcw16_dstw32();
+ }
+ } else {
+ if(parms.dst_pixel_width & 0x1F) {
+ deprintf("[SPU] Using scale_srcw32_dstw16\n");
+ scale_srcw32_dstw16();
+ } else {
+ deprintf("[SPU] Using scale_srcw32_dstw32\n");
+ scale_srcw32_dstw32();
+ }
+ }
+ deprintf("[SPU] bilin_scaler_spu... done!\n");
+
+ return 0;
+}
+
+
+/*
+ * vfloat_to_vuint()
+ *
+ * converts a float vector to an unsinged int vector using saturated
+ * arithmetic
+ *
+ * @param vec_s float vector for conversion
+ * @returns converted unsigned int vector
+ */
+inline static vector unsigned int vfloat_to_vuint(vector float vec_s) {
+ vector unsigned int select_1 = spu_cmpgt(vec_0_1, vec_s);
+ vec_s = spu_sel(vec_s, vec_0_1, select_1);
+
+ vector unsigned int select_2 = spu_cmpgt(vec_s, vec_255);
+ vec_s = spu_sel(vec_s, vec_255, select_2);
+ return spu_convtu(vec_s,0);
+}
+
+
+/*
+ * scale_srcw16_dstw16()
+ *
+ * processes an input image of width 16
+ * scaling is done to a width 16
+ * result stored in RAM
+ */
+void scale_srcw16_dstw16() {
+ // extract parameters
+ unsigned char* dst_addr = (unsigned char *)parms.dstBuffer;
+
+ unsigned int src_width = parms.src_pixel_width;
+ unsigned int src_height = parms.src_pixel_height;
+ unsigned int dst_width = parms.dst_pixel_width;
+ unsigned int dst_height = parms.dst_pixel_height;
+
+ // YVU
+ unsigned int src_linestride_y = src_width;
+ unsigned int src_dbl_linestride_y = src_width<<1;
+ unsigned int src_linestride_vu = src_width>>1;
+ unsigned int src_dbl_linestride_vu = src_width;
+
+ // scaled YVU
+ unsigned int scaled_src_linestride_y = dst_width;
+
+ // ram addresses
+ unsigned char* src_addr_y = parms.y_plane;
+ unsigned char* src_addr_v = parms.v_plane;
+ unsigned char* src_addr_u = parms.u_plane;
+
+ // for handling misalignment, addresses are precalculated
+ unsigned char* precalc_src_addr_v = src_addr_v;
+ unsigned char* precalc_src_addr_u = src_addr_u;
+
+ unsigned int dst_picture_size = dst_width*dst_height;
+
+ // Sizes for destination
+ unsigned int dst_dbl_linestride_y = dst_width<<1;
+ unsigned int dst_dbl_linestride_vu = dst_width>>1;
+
+ // Perform address calculation for Y, V and U in main memory with dst_addr as base
+ unsigned char* dst_addr_main_memory_y = dst_addr;
+ unsigned char* dst_addr_main_memory_v = dst_addr + dst_picture_size;
+ unsigned char* dst_addr_main_memory_u = dst_addr_main_memory_v +(dst_picture_size>>2);
+
+ // calculate scale factors
+ vector float vf_x_scale = spu_splats( (float)src_width/(float)dst_width );
+ float y_scale = (float)src_height/(float)dst_height;
+
+ // double buffered processing
+ // buffer switching
+ unsigned int curr_src_idx = 0;
+ unsigned int curr_dst_idx = 0;
+ unsigned int next_src_idx, next_dst_idx;
+
+ // 2 lines y as output, upper and lowerline
+ unsigned int curr_interpl_y_upper = 0;
+ unsigned int next_interpl_y_upper;
+ unsigned int curr_interpl_y_lower, next_interpl_y_lower;
+ // only 1 line v/u output, both planes have the same dimension
+ unsigned int curr_interpl_vu = 0;
+ unsigned int next_interpl_vu;
+
+ // weights, calculated in every loop iteration
+ vector float vf_curr_NSweight_y_upper = { 0.0f, 0.0f, 0.0f, 0.0f };
+ vector float vf_next_NSweight_y_upper;
+ vector float vf_curr_NSweight_y_lower, vf_next_NSweight_y_lower;
+ vector float vf_curr_NSweight_vu = { 0.0f, 0.0f, 0.0f, 0.0f };
+ vector float vf_next_NSweight_vu;
+
+ // line indices for the src picture
+ float curr_src_y_upper = 0.0f, next_src_y_upper;
+ float curr_src_y_lower, next_src_y_lower;
+ float curr_src_vu = 0.0f, next_src_vu;
+
+ // line indices for the dst picture
+ unsigned int dst_y=0, dst_vu=0;
+
+ // offset for the v and u plane to handle misalignement
+ unsigned int curr_lsoff_v = 0, next_lsoff_v;
+ unsigned int curr_lsoff_u = 0, next_lsoff_u;
+
+ // calculate lower line indices
+ curr_src_y_lower = ((float)curr_interpl_y_upper+1)*y_scale;
+ curr_interpl_y_lower = (unsigned int)curr_src_y_lower;
+ // lower line weight
+ vf_curr_NSweight_y_lower = spu_splats( curr_src_y_lower-(float)curr_interpl_y_lower );
+
+
+ // start partially double buffered processing
+ // get initial data, 2 sets of y, 1 set v, 1 set u
+ mfc_get( y_plane[curr_src_idx], (unsigned int) src_addr_y, src_dbl_linestride_y, RETR_BUF, 0, 0 );
+ mfc_get( y_plane[curr_src_idx]+src_dbl_linestride_y,
+ (unsigned int) src_addr_y+(curr_interpl_y_lower*src_linestride_y),
+ src_dbl_linestride_y,
+ RETR_BUF,
+ 0, 0 );
+ mfc_get( v_plane[curr_src_idx], (unsigned int) src_addr_v, src_dbl_linestride_vu, RETR_BUF, 0, 0 );
+ mfc_get( u_plane[curr_src_idx], (unsigned int) src_addr_u, src_dbl_linestride_vu, RETR_BUF, 0, 0 );
+
+ /* iteration loop
+ * within each iteration 4 lines y, 2 lines v, 2 lines u are retrieved
+ * the scaled output is 2 lines y, 1 line v, 1 line u
+ * the yuv2rgb-converted output is stored to RAM
+ */
+ for( dst_vu=0; dst_vu<(dst_height>>1)-1; dst_vu++ ) {
+ dst_y = dst_vu<<1;
+
+ // calculate next indices
+ next_src_vu = ((float)dst_vu+1)*y_scale;
+ next_src_y_upper = ((float)dst_y+2)*y_scale;
+ next_src_y_lower = ((float)dst_y+3)*y_scale;
+
+ next_interpl_vu = (unsigned int) next_src_vu;
+ next_interpl_y_upper = (unsigned int) next_src_y_upper;
+ next_interpl_y_lower = (unsigned int) next_src_y_lower;
+
+ // calculate weight NORTH-SOUTH
+ vf_next_NSweight_vu = spu_splats( next_src_vu-(float)next_interpl_vu );
+ vf_next_NSweight_y_upper = spu_splats( next_src_y_upper-(float)next_interpl_y_upper );
+ vf_next_NSweight_y_lower = spu_splats( next_src_y_lower-(float)next_interpl_y_lower );
+
+ // get next lines
+ next_src_idx = curr_src_idx^1;
+ next_dst_idx = curr_dst_idx^1;
+
+ // 4 lines y
+ mfc_get( y_plane[next_src_idx],
+ (unsigned int) src_addr_y+(next_interpl_y_upper*src_linestride_y),
+ src_dbl_linestride_y,
+ RETR_BUF+next_src_idx,
+ 0, 0 );
+ mfc_get( y_plane[next_src_idx]+src_dbl_linestride_y,
+ (unsigned int) src_addr_y+(next_interpl_y_lower*src_linestride_y),
+ src_dbl_linestride_y,
+ RETR_BUF+next_src_idx,
+ 0, 0 );
+
+ // 2 lines v
+ precalc_src_addr_v = src_addr_v+(next_interpl_vu*src_linestride_vu);
+ next_lsoff_v = ((unsigned int)precalc_src_addr_v)&0x0F;
+ mfc_get( v_plane[next_src_idx],
+ ((unsigned int) precalc_src_addr_v)&0xFFFFFFF0,
+ src_dbl_linestride_vu+(next_lsoff_v<<1),
+ RETR_BUF+next_src_idx,
+ 0, 0 );
+ // 2 lines u
+ precalc_src_addr_u = src_addr_u+(next_interpl_vu*src_linestride_vu);
+ next_lsoff_u = ((unsigned int)precalc_src_addr_u)&0x0F;
+ mfc_get( u_plane[next_src_idx],
+ ((unsigned int) precalc_src_addr_u)&0xFFFFFFF0,
+ src_dbl_linestride_vu+(next_lsoff_v<<1),
+ RETR_BUF+next_src_idx,
+ 0, 0 );
+
+ DMA_WAIT_TAG( (RETR_BUF+curr_src_idx) );
+
+ // scaling
+ // work line y_upper
+ bilinear_scale_line_w16( y_plane[curr_src_idx],
+ scaled_y_plane[curr_src_idx],
+ dst_width,
+ vf_x_scale,
+ vf_curr_NSweight_y_upper,
+ src_linestride_y );
+ // work line y_lower
+ bilinear_scale_line_w16( y_plane[curr_src_idx]+src_dbl_linestride_y,
+ scaled_y_plane[curr_src_idx]+scaled_src_linestride_y,
+ dst_width,
+ vf_x_scale,
+ vf_curr_NSweight_y_lower,
+ src_linestride_y );
+ // work line v
+ bilinear_scale_line_w8( v_plane[curr_src_idx]+curr_lsoff_v,
+ scaled_v_plane[curr_src_idx],
+ dst_width>>1,
+ vf_x_scale,
+ vf_curr_NSweight_vu,
+ src_linestride_vu );
+ // work line u
+ bilinear_scale_line_w8( u_plane[curr_src_idx]+curr_lsoff_u,
+ scaled_u_plane[curr_src_idx],
+ dst_width>>1,
+ vf_x_scale,
+ vf_curr_NSweight_vu,
+ src_linestride_vu );
+
+
+ // Store the result back to main memory into a destination buffer in YUV format
+ //---------------------------------------------------------------------------------------------
+ DMA_WAIT_TAG( (STR_BUF+curr_dst_idx) );
+
+ // Perform three DMA transfers to 3 different locations in the main memory!
+ // dst_width: Pixel width of destination image
+ // dst_addr: Destination address in main memory
+ // dst_vu: Counter which is incremented one by one
+ // dst_y: Counter which is twice larger than dst_vu (dst_y = 2*dst_vu)
+ mfc_put( scaled_y_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int)dst_addr_main_memory_y + (dst_vu*dst_dbl_linestride_y), // Destination in main memory (addr)
+ dst_dbl_linestride_y, // Two Y lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+
+ mfc_put( scaled_v_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int)dst_addr_main_memory_v + (dst_vu*dst_dbl_linestride_vu), // Destination in main memory (addr)
+ dst_dbl_linestride_vu, // Two V lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+
+ mfc_put( scaled_u_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int)dst_addr_main_memory_u + (dst_vu*dst_dbl_linestride_vu), // Destination in main memory (addr)
+ dst_dbl_linestride_vu, // Two U lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+ //---------------------------------------------------------------------------------------------
+
+
+ // update for next cycle
+ curr_src_idx = next_src_idx;
+ curr_dst_idx = next_dst_idx;
+
+ curr_interpl_y_upper = next_interpl_y_upper;
+ curr_interpl_y_lower = next_interpl_y_lower;
+ curr_interpl_vu = next_interpl_vu;
+
+ vf_curr_NSweight_y_upper = vf_curr_NSweight_y_upper;
+ vf_curr_NSweight_y_lower = vf_curr_NSweight_y_lower;
+ vf_curr_NSweight_vu = vf_next_NSweight_vu;
+
+ curr_src_y_upper = next_src_y_upper;
+ curr_src_y_lower = next_src_y_lower;
+ curr_src_vu = next_src_vu;
+
+ curr_lsoff_v = next_lsoff_v;
+ curr_lsoff_u = next_lsoff_u;
+ }
+
+
+
+ DMA_WAIT_TAG( (RETR_BUF+curr_src_idx) );
+
+ // scaling
+ // work line y_upper
+ bilinear_scale_line_w16( y_plane[curr_src_idx],
+ scaled_y_plane[curr_src_idx],
+ dst_width,
+ vf_x_scale,
+ vf_curr_NSweight_y_upper,
+ src_linestride_y );
+ // work line y_lower
+ bilinear_scale_line_w16( y_plane[curr_src_idx]+src_dbl_linestride_y,
+ scaled_y_plane[curr_src_idx]+scaled_src_linestride_y,
+ dst_width,
+ vf_x_scale,
+ vf_curr_NSweight_y_lower,
+ src_linestride_y );
+ // work line v
+ bilinear_scale_line_w8( v_plane[curr_src_idx]+curr_lsoff_v,
+ scaled_v_plane[curr_src_idx],
+ dst_width>>1,
+ vf_x_scale,
+ vf_curr_NSweight_vu,
+ src_linestride_vu );
+ // work line u
+ bilinear_scale_line_w8( u_plane[curr_src_idx]+curr_lsoff_u,
+ scaled_u_plane[curr_src_idx],
+ dst_width>>1,
+ vf_x_scale,
+ vf_curr_NSweight_vu,
+ src_linestride_vu );
+
+
+ // Store the result back to main memory into a destination buffer in YUV format
+ //---------------------------------------------------------------------------------------------
+ DMA_WAIT_TAG( (STR_BUF+curr_dst_idx) );
+
+ // Perform three DMA transfers to 3 different locations in the main memory!
+ // dst_width: Pixel width of destination image
+ // dst_addr: Destination address in main memory
+ // dst_vu: Counter which is incremented one by one
+ // dst_y: Counter which is twice larger than dst_vu (dst_y = 2*dst_vu)
+ mfc_put( scaled_y_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int)dst_addr_main_memory_y + (dst_vu*dst_dbl_linestride_y), // Destination in main memory (addr)
+ dst_dbl_linestride_y, // Two Y lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+
+ mfc_put( scaled_v_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int)dst_addr_main_memory_v + (dst_vu*dst_dbl_linestride_vu), // Destination in main memory (addr)
+ dst_dbl_linestride_vu, // Two V lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+
+ mfc_put( scaled_u_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int)dst_addr_main_memory_u + (dst_vu*dst_dbl_linestride_vu), // Destination in main memory (addr)
+ dst_dbl_linestride_vu, // Two U lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+
+ // wait for completion
+ DMA_WAIT_TAG( (STR_BUF+curr_dst_idx) );
+ //---------------------------------------------------------------------------------------------
+}
+
+
+/*
+ * scale_srcw16_dstw32()
+ *
+ * processes an input image of width 16
+ * scaling is done to a width 32
+ * yuv2rgb conversion on a width of 32
+ * result stored in RAM
+ */
+void scale_srcw16_dstw32() {
+ // extract parameters
+ unsigned char* dst_addr = (unsigned char *)parms.dstBuffer;
+
+ unsigned int src_width = parms.src_pixel_width;
+ unsigned int src_height = parms.src_pixel_height;
+ unsigned int dst_width = parms.dst_pixel_width;
+ unsigned int dst_height = parms.dst_pixel_height;
+
+ // YVU
+ unsigned int src_linestride_y = src_width;
+ unsigned int src_dbl_linestride_y = src_width<<1;
+ unsigned int src_linestride_vu = src_width>>1;
+ unsigned int src_dbl_linestride_vu = src_width;
+ // scaled YVU
+ unsigned int scaled_src_linestride_y = dst_width;
+
+ // ram addresses
+ unsigned char* src_addr_y = parms.y_plane;
+ unsigned char* src_addr_v = parms.v_plane;
+ unsigned char* src_addr_u = parms.u_plane;
+
+ unsigned int dst_picture_size = dst_width*dst_height;
+
+ // Sizes for destination
+ unsigned int dst_dbl_linestride_y = dst_width<<1;
+ unsigned int dst_dbl_linestride_vu = dst_width>>1;
+
+ // Perform address calculation for Y, V and U in main memory with dst_addr as base
+ unsigned char* dst_addr_main_memory_y = dst_addr;
+ unsigned char* dst_addr_main_memory_v = dst_addr + dst_picture_size;
+ unsigned char* dst_addr_main_memory_u = dst_addr_main_memory_v +(dst_picture_size>>2);
+
+
+ // for handling misalignment, addresses are precalculated
+ unsigned char* precalc_src_addr_v = src_addr_v;
+ unsigned char* precalc_src_addr_u = src_addr_u;
+
+ // calculate scale factors
+ vector float vf_x_scale = spu_splats( (float)src_width/(float)dst_width );
+ float y_scale = (float)src_height/(float)dst_height;
+
+ // double buffered processing
+ // buffer switching
+ unsigned int curr_src_idx = 0;
+ unsigned int curr_dst_idx = 0;
+ unsigned int next_src_idx, next_dst_idx;
+
+ // 2 lines y as output, upper and lowerline
+ unsigned int curr_interpl_y_upper = 0;
+ unsigned int next_interpl_y_upper;
+ unsigned int curr_interpl_y_lower, next_interpl_y_lower;
+ // only 1 line v/u output, both planes have the same dimension
+ unsigned int curr_interpl_vu = 0;
+ unsigned int next_interpl_vu;
+
+ // weights, calculated in every loop iteration
+ vector float vf_curr_NSweight_y_upper = { 0.0f, 0.0f, 0.0f, 0.0f };
+ vector float vf_next_NSweight_y_upper;
+ vector float vf_curr_NSweight_y_lower, vf_next_NSweight_y_lower;
+ vector float vf_curr_NSweight_vu = { 0.0f, 0.0f, 0.0f, 0.0f };
+ vector float vf_next_NSweight_vu;
+
+ // line indices for the src picture
+ float curr_src_y_upper = 0.0f, next_src_y_upper;
+ float curr_src_y_lower, next_src_y_lower;
+ float curr_src_vu = 0.0f, next_src_vu;
+
+ // line indices for the dst picture
+ unsigned int dst_y=0, dst_vu=0;
+
+ // offset for the v and u plane to handle misalignement
+ unsigned int curr_lsoff_v = 0, next_lsoff_v;
+ unsigned int curr_lsoff_u = 0, next_lsoff_u;
+
+ // calculate lower line idices
+ curr_src_y_lower = ((float)curr_interpl_y_upper+1)*y_scale;
+ curr_interpl_y_lower = (unsigned int)curr_src_y_lower;
+ // lower line weight
+ vf_curr_NSweight_y_lower = spu_splats( curr_src_y_lower-(float)curr_interpl_y_lower );
+
+
+ // start partially double buffered processing
+ // get initial data, 2 sets of y, 1 set v, 1 set u
+ mfc_get( y_plane[curr_src_idx], (unsigned int) src_addr_y, src_dbl_linestride_y, RETR_BUF, 0, 0 );
+ mfc_get( y_plane[curr_src_idx]+src_dbl_linestride_y,
+ (unsigned int) src_addr_y+(curr_interpl_y_lower*src_linestride_y),
+ src_dbl_linestride_y,
+ RETR_BUF,
+ 0, 0 );
+ mfc_get( v_plane[curr_src_idx], (unsigned int) src_addr_v, src_dbl_linestride_vu, RETR_BUF, 0, 0 );
+ mfc_get( u_plane[curr_src_idx], (unsigned int) src_addr_u, src_dbl_linestride_vu, RETR_BUF, 0, 0 );
+
+ // iteration loop
+ // within each iteration 4 lines y, 2 lines v, 2 lines u are retrieved
+ // the scaled output is 2 lines y, 1 line v, 1 line u
+ // the yuv2rgb-converted output is stored to RAM
+ for( dst_vu=0; dst_vu<(dst_height>>1)-1; dst_vu++ ) {
+ dst_y = dst_vu<<1;
+
+ // calculate next indices
+ next_src_vu = ((float)dst_vu+1)*y_scale;
+ next_src_y_upper = ((float)dst_y+2)*y_scale;
+ next_src_y_lower = ((float)dst_y+3)*y_scale;
+
+ next_interpl_vu = (unsigned int) next_src_vu;
+ next_interpl_y_upper = (unsigned int) next_src_y_upper;
+ next_interpl_y_lower = (unsigned int) next_src_y_lower;
+
+ // calculate weight NORTH-SOUTH
+ vf_next_NSweight_vu = spu_splats( next_src_vu-(float)next_interpl_vu );
+ vf_next_NSweight_y_upper = spu_splats( next_src_y_upper-(float)next_interpl_y_upper );
+ vf_next_NSweight_y_lower = spu_splats( next_src_y_lower-(float)next_interpl_y_lower );
+
+ // get next lines
+ next_src_idx = curr_src_idx^1;
+ next_dst_idx = curr_dst_idx^1;
+
+ // 4 lines y
+ mfc_get( y_plane[next_src_idx],
+ (unsigned int) src_addr_y+(next_interpl_y_upper*src_linestride_y),
+ src_dbl_linestride_y,
+ RETR_BUF+next_src_idx,
+ 0, 0 );
+ mfc_get( y_plane[next_src_idx]+src_dbl_linestride_y,
+ (unsigned int) src_addr_y+(next_interpl_y_lower*src_linestride_y),
+ src_dbl_linestride_y,
+ RETR_BUF+next_src_idx,
+ 0, 0 );
+
+ // 2 lines v
+ precalc_src_addr_v = src_addr_v+(next_interpl_vu*src_linestride_vu);
+ next_lsoff_v = ((unsigned int)precalc_src_addr_v)&0x0F;
+ mfc_get( v_plane[next_src_idx],
+ ((unsigned int) precalc_src_addr_v)&0xFFFFFFF0,
+ src_dbl_linestride_vu+(next_lsoff_v<<1),
+ RETR_BUF+next_src_idx,
+ 0, 0 );
+ // 2 lines u
+ precalc_src_addr_u = src_addr_u+(next_interpl_vu*src_linestride_vu);
+ next_lsoff_u = ((unsigned int)precalc_src_addr_u)&0x0F;
+ mfc_get( u_plane[next_src_idx],
+ ((unsigned int) precalc_src_addr_u)&0xFFFFFFF0,
+ src_dbl_linestride_vu+(next_lsoff_v<<1),
+ RETR_BUF+next_src_idx,
+ 0, 0 );
+
+ DMA_WAIT_TAG( (RETR_BUF+curr_src_idx) );
+
+ // scaling
+ // work line y_upper
+ bilinear_scale_line_w16( y_plane[curr_src_idx],
+ scaled_y_plane[curr_src_idx],
+ dst_width,
+ vf_x_scale,
+ vf_curr_NSweight_y_upper,
+ src_linestride_y );
+ // work line y_lower
+ bilinear_scale_line_w16( y_plane[curr_src_idx]+src_dbl_linestride_y,
+ scaled_y_plane[curr_src_idx]+scaled_src_linestride_y,
+ dst_width,
+ vf_x_scale,
+ vf_curr_NSweight_y_lower,
+ src_linestride_y );
+ // work line v
+ bilinear_scale_line_w8( v_plane[curr_src_idx]+curr_lsoff_v,
+ scaled_v_plane[curr_src_idx],
+ dst_width>>1,
+ vf_x_scale,
+ vf_curr_NSweight_vu,
+ src_linestride_vu );
+ // work line u
+ bilinear_scale_line_w8( u_plane[curr_src_idx]+curr_lsoff_u,
+ scaled_u_plane[curr_src_idx],
+ dst_width>>1,
+ vf_x_scale,
+ vf_curr_NSweight_vu,
+ src_linestride_vu );
+
+ //---------------------------------------------------------------------------------------------
+ DMA_WAIT_TAG( (STR_BUF+curr_dst_idx) );
+
+ // Perform three DMA transfers to 3 different locations in the main memory!
+ // dst_width: Pixel width of destination image
+ // dst_addr: Destination address in main memory
+ // dst_vu: Counter which is incremented one by one
+ // dst_y: Counter which is twice larger than dst_vu (dst_y = 2*dst_vu)
+
+ mfc_put( scaled_y_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int) dst_addr_main_memory_y + (dst_vu*dst_dbl_linestride_y), // Destination in main memory (addr)
+ dst_dbl_linestride_y, // Two Y lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+
+ mfc_put( scaled_v_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int) dst_addr_main_memory_v + (dst_vu*dst_dbl_linestride_vu), // Destination in main memory (addr)
+ dst_dbl_linestride_vu, // Two V lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+
+ mfc_put( scaled_u_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int) dst_addr_main_memory_u + (dst_vu*dst_dbl_linestride_vu), // Destination in main memory (addr)
+ dst_dbl_linestride_vu, // Two U lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+ //---------------------------------------------------------------------------------------------
+
+
+ // update for next cycle
+ curr_src_idx = next_src_idx;
+ curr_dst_idx = next_dst_idx;
+
+ curr_interpl_y_upper = next_interpl_y_upper;
+ curr_interpl_y_lower = next_interpl_y_lower;
+ curr_interpl_vu = next_interpl_vu;
+
+ vf_curr_NSweight_y_upper = vf_curr_NSweight_y_upper;
+ vf_curr_NSweight_y_lower = vf_curr_NSweight_y_lower;
+ vf_curr_NSweight_vu = vf_next_NSweight_vu;
+
+ curr_src_y_upper = next_src_y_upper;
+ curr_src_y_lower = next_src_y_lower;
+ curr_src_vu = next_src_vu;
+
+ curr_lsoff_v = next_lsoff_v;
+ curr_lsoff_u = next_lsoff_u;
+ }
+
+
+
+ DMA_WAIT_TAG( (RETR_BUF+curr_src_idx) );
+
+ // scaling
+ // work line y_upper
+ bilinear_scale_line_w16( y_plane[curr_src_idx],
+ scaled_y_plane[curr_src_idx],
+ dst_width,
+ vf_x_scale,
+ vf_curr_NSweight_y_upper,
+ src_linestride_y );
+ // work line y_lower
+ bilinear_scale_line_w16( y_plane[curr_src_idx]+src_dbl_linestride_y,
+ scaled_y_plane[curr_src_idx]+scaled_src_linestride_y,
+ dst_width,
+ vf_x_scale,
+ vf_curr_NSweight_y_lower,
+ src_linestride_y );
+ // work line v
+ bilinear_scale_line_w8( v_plane[curr_src_idx]+curr_lsoff_v,
+ scaled_v_plane[curr_src_idx],
+ dst_width>>1,
+ vf_x_scale,
+ vf_curr_NSweight_vu,
+ src_linestride_vu );
+ // work line u
+ bilinear_scale_line_w8( u_plane[curr_src_idx]+curr_lsoff_u,
+ scaled_u_plane[curr_src_idx],
+ dst_width>>1,
+ vf_x_scale,
+ vf_curr_NSweight_vu,
+ src_linestride_vu );
+
+ //---------------------------------------------------------------------------------------------
+ DMA_WAIT_TAG( (STR_BUF+curr_dst_idx) );
+
+ // Perform three DMA transfers to 3 different locations in the main memory!
+ // dst_width: Pixel width of destination image
+ // dst_addr: Destination address in main memory
+ // dst_vu: Counter which is incremented one by one
+ // dst_y: Counter which is twice larger than dst_vu (dst_y = 2*dst_vu)
+
+ mfc_put( scaled_y_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int) dst_addr_main_memory_y + (dst_vu*dst_dbl_linestride_y), // Destination in main memory (addr)
+ dst_dbl_linestride_y, // Two Y lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+
+ mfc_put( scaled_v_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int) dst_addr_main_memory_v + (dst_vu*dst_dbl_linestride_vu), // Destination in main memory (addr)
+ dst_dbl_linestride_vu, // Two V lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+
+ mfc_put( scaled_u_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int) dst_addr_main_memory_u + (dst_vu*dst_dbl_linestride_vu), // Destination in main memory (addr)
+ dst_dbl_linestride_vu, // Two U lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+
+ // wait for completion
+ DMA_WAIT_TAG( (STR_BUF+curr_dst_idx) );
+ //---------------------------------------------------------------------------------------------
+}
+
+
+/*
+ * scale_srcw32_dstw16()
+ *
+ * processes an input image of width 32
+ * scaling is done to a width 16
+ * yuv2rgb conversion on a width of 16
+ * result stored in RAM
+ */
+void scale_srcw32_dstw16() {
+ // extract parameters
+ unsigned char* dst_addr = (unsigned char *)parms.dstBuffer;
+
+ unsigned int src_width = parms.src_pixel_width;
+ unsigned int src_height = parms.src_pixel_height;
+ unsigned int dst_width = parms.dst_pixel_width;
+ unsigned int dst_height = parms.dst_pixel_height;
+
+ // YVU
+ unsigned int src_linestride_y = src_width;
+ unsigned int src_dbl_linestride_y = src_width<<1;
+ unsigned int src_linestride_vu = src_width>>1;
+ unsigned int src_dbl_linestride_vu = src_width;
+ // scaled YVU
+ unsigned int scaled_src_linestride_y = dst_width;
+
+ // ram addresses
+ unsigned char* src_addr_y = parms.y_plane;
+ unsigned char* src_addr_v = parms.v_plane;
+ unsigned char* src_addr_u = parms.u_plane;
+
+ unsigned int dst_picture_size = dst_width*dst_height;
+
+ // Sizes for destination
+ unsigned int dst_dbl_linestride_y = dst_width<<1;
+ unsigned int dst_dbl_linestride_vu = dst_width>>1;
+
+ // Perform address calculation for Y, V and U in main memory with dst_addr as base
+ unsigned char* dst_addr_main_memory_y = dst_addr;
+ unsigned char* dst_addr_main_memory_v = dst_addr + dst_picture_size;
+ unsigned char* dst_addr_main_memory_u = dst_addr_main_memory_v +(dst_picture_size>>2);
+
+ // calculate scale factors
+ vector float vf_x_scale = spu_splats( (float)src_width/(float)dst_width );
+ float y_scale = (float)src_height/(float)dst_height;
+
+ // double buffered processing
+ // buffer switching
+ unsigned int curr_src_idx = 0;
+ unsigned int curr_dst_idx = 0;
+ unsigned int next_src_idx, next_dst_idx;
+
+ // 2 lines y as output, upper and lowerline
+ unsigned int curr_interpl_y_upper = 0;
+ unsigned int next_interpl_y_upper;
+ unsigned int curr_interpl_y_lower, next_interpl_y_lower;
+ // only 1 line v/u output, both planes have the same dimension
+ unsigned int curr_interpl_vu = 0;
+ unsigned int next_interpl_vu;
+
+ // weights, calculated in every loop iteration
+ vector float vf_curr_NSweight_y_upper = { 0.0f, 0.0f, 0.0f, 0.0f };
+ vector float vf_next_NSweight_y_upper;
+ vector float vf_curr_NSweight_y_lower, vf_next_NSweight_y_lower;
+ vector float vf_curr_NSweight_vu = { 0.0f, 0.0f, 0.0f, 0.0f };
+ vector float vf_next_NSweight_vu;
+
+ // line indices for the src picture
+ float curr_src_y_upper = 0.0f, next_src_y_upper;
+ float curr_src_y_lower, next_src_y_lower;
+ float curr_src_vu = 0.0f, next_src_vu;
+
+ // line indices for the dst picture
+ unsigned int dst_y=0, dst_vu=0;
+
+ // calculate lower line idices
+ curr_src_y_lower = ((float)curr_interpl_y_upper+1)*y_scale;
+ curr_interpl_y_lower = (unsigned int)curr_src_y_lower;
+ // lower line weight
+ vf_curr_NSweight_y_lower = spu_splats( curr_src_y_lower-(float)curr_interpl_y_lower );
+
+
+ // start partially double buffered processing
+ // get initial data, 2 sets of y, 1 set v, 1 set u
+ mfc_get( y_plane[curr_src_idx], (unsigned int) src_addr_y, src_dbl_linestride_y, RETR_BUF, 0, 0 );
+ mfc_get( y_plane[curr_src_idx]+src_dbl_linestride_y,
+ (unsigned int) src_addr_y+(curr_interpl_y_lower*src_linestride_y),
+ src_dbl_linestride_y,
+ RETR_BUF,
+ 0, 0 );
+ mfc_get( v_plane[curr_src_idx], (unsigned int) src_addr_v, src_dbl_linestride_vu, RETR_BUF, 0, 0 );
+ mfc_get( u_plane[curr_src_idx], (unsigned int) src_addr_u, src_dbl_linestride_vu, RETR_BUF, 0, 0 );
+
+ // iteration loop
+ // within each iteration 4 lines y, 2 lines v, 2 lines u are retrieved
+ // the scaled output is 2 lines y, 1 line v, 1 line u
+ // the yuv2rgb-converted output is stored to RAM
+ for( dst_vu=0; dst_vu<(dst_height>>1)-1; dst_vu++ ) {
+ dst_y = dst_vu<<1;
+
+ // calculate next indices
+ next_src_vu = ((float)dst_vu+1)*y_scale;
+ next_src_y_upper = ((float)dst_y+2)*y_scale;
+ next_src_y_lower = ((float)dst_y+3)*y_scale;
+
+ next_interpl_vu = (unsigned int) next_src_vu;
+ next_interpl_y_upper = (unsigned int) next_src_y_upper;
+ next_interpl_y_lower = (unsigned int) next_src_y_lower;
+
+ // calculate weight NORTH-SOUTH
+ vf_next_NSweight_vu = spu_splats( next_src_vu-(float)next_interpl_vu );
+ vf_next_NSweight_y_upper = spu_splats( next_src_y_upper-(float)next_interpl_y_upper );
+ vf_next_NSweight_y_lower = spu_splats( next_src_y_lower-(float)next_interpl_y_lower );
+
+ // get next lines
+ next_src_idx = curr_src_idx^1;
+ next_dst_idx = curr_dst_idx^1;
+
+ // 4 lines y
+ mfc_get( y_plane[next_src_idx],
+ (unsigned int) src_addr_y+(next_interpl_y_upper*src_linestride_y),
+ src_dbl_linestride_y,
+ RETR_BUF+next_src_idx,
+ 0, 0 );
+ mfc_get( y_plane[next_src_idx]+src_dbl_linestride_y,
+ (unsigned int) src_addr_y+(next_interpl_y_lower*src_linestride_y),
+ src_dbl_linestride_y,
+ RETR_BUF+next_src_idx,
+ 0, 0 );
+
+ // 2 lines v
+ mfc_get( v_plane[next_src_idx],
+ (unsigned int) src_addr_v+(next_interpl_vu*src_linestride_vu),
+ src_dbl_linestride_vu,
+ RETR_BUF+next_src_idx,
+ 0, 0 );
+ // 2 lines u
+ mfc_get( u_plane[next_src_idx],
+ (unsigned int) src_addr_u+(next_interpl_vu*src_linestride_vu),
+ src_dbl_linestride_vu,
+ RETR_BUF+next_src_idx,
+ 0, 0 );
+
+ DMA_WAIT_TAG( (RETR_BUF+curr_src_idx) );
+
+ // scaling
+ // work line y_upper
+ bilinear_scale_line_w16( y_plane[curr_src_idx],
+ scaled_y_plane[curr_src_idx],
+ dst_width,
+ vf_x_scale,
+ vf_curr_NSweight_y_upper,
+ src_linestride_y );
+ // work line y_lower
+ bilinear_scale_line_w16( y_plane[curr_src_idx]+src_dbl_linestride_y,
+ scaled_y_plane[curr_src_idx]+scaled_src_linestride_y,
+ dst_width,
+ vf_x_scale,
+ vf_curr_NSweight_y_lower,
+ src_linestride_y );
+ // work line v
+ bilinear_scale_line_w16( v_plane[curr_src_idx],
+ scaled_v_plane[curr_src_idx],
+ dst_width>>1,
+ vf_x_scale,
+ vf_curr_NSweight_vu,
+ src_linestride_vu );
+ // work line u
+ bilinear_scale_line_w16( u_plane[curr_src_idx],
+ scaled_u_plane[curr_src_idx],
+ dst_width>>1,
+ vf_x_scale,
+ vf_curr_NSweight_vu,
+ src_linestride_vu );
+
+ //---------------------------------------------------------------------------------------------
+ DMA_WAIT_TAG( (STR_BUF+curr_dst_idx) );
+
+ // Perform three DMA transfers to 3 different locations in the main memory!
+ // dst_width: Pixel width of destination image
+ // dst_addr: Destination address in main memory
+ // dst_vu: Counter which is incremented one by one
+ // dst_y: Counter which is twice larger than dst_vu (dst_y = 2*dst_vu)
+
+ mfc_put( scaled_y_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int) dst_addr_main_memory_y + (dst_vu*dst_dbl_linestride_y), // Destination in main memory (addr)
+ dst_dbl_linestride_y, // Two Y lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+
+ mfc_put( scaled_v_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int) dst_addr_main_memory_v + (dst_vu*dst_dbl_linestride_vu), // Destination in main memory (addr)
+ dst_dbl_linestride_vu, // Two V lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+
+ mfc_put( scaled_u_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int) dst_addr_main_memory_u + (dst_vu*dst_dbl_linestride_vu), // Destination in main memory (addr)
+ dst_dbl_linestride_vu, // Two U lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+ //---------------------------------------------------------------------------------------------
+
+
+ // update for next cycle
+ curr_src_idx = next_src_idx;
+ curr_dst_idx = next_dst_idx;
+
+ curr_interpl_y_upper = next_interpl_y_upper;
+ curr_interpl_y_lower = next_interpl_y_lower;
+ curr_interpl_vu = next_interpl_vu;
+
+ vf_curr_NSweight_y_upper = vf_curr_NSweight_y_upper;
+ vf_curr_NSweight_y_lower = vf_curr_NSweight_y_lower;
+ vf_curr_NSweight_vu = vf_next_NSweight_vu;
+
+ curr_src_y_upper = next_src_y_upper;
+ curr_src_y_lower = next_src_y_lower;
+ curr_src_vu = next_src_vu;
+ }
+
+
+
+ DMA_WAIT_TAG( (RETR_BUF+curr_src_idx) );
+
+ // scaling
+ // work line y_upper
+ bilinear_scale_line_w16( y_plane[curr_src_idx],
+ scaled_y_plane[curr_src_idx],
+ dst_width,
+ vf_x_scale,
+ vf_curr_NSweight_y_upper,
+ src_linestride_y );
+ // work line y_lower
+ bilinear_scale_line_w16( y_plane[curr_src_idx]+src_dbl_linestride_y,
+ scaled_y_plane[curr_src_idx]+scaled_src_linestride_y,
+ dst_width,
+ vf_x_scale,
+ vf_curr_NSweight_y_lower,
+ src_linestride_y );
+ // work line v
+ bilinear_scale_line_w16( v_plane[curr_src_idx],
+ scaled_v_plane[curr_src_idx],
+ dst_width>>1,
+ vf_x_scale,
+ vf_curr_NSweight_vu,
+ src_linestride_vu );
+ // work line u
+ bilinear_scale_line_w16( u_plane[curr_src_idx],
+ scaled_u_plane[curr_src_idx],
+ dst_width>>1,
+ vf_x_scale,
+ vf_curr_NSweight_vu,
+ src_linestride_vu );
+
+
+ //---------------------------------------------------------------------------------------------
+ DMA_WAIT_TAG( (STR_BUF+curr_dst_idx) );
+
+ // Perform three DMA transfers to 3 different locations in the main memory!
+ // dst_width: Pixel width of destination image
+ // dst_addr: Destination address in main memory
+ // dst_vu: Counter which is incremented one by one
+ // dst_y: Counter which is twice larger than dst_vu (dst_y = 2*dst_vu)
+
+ mfc_put( scaled_y_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int) dst_addr_main_memory_y + (dst_vu*dst_dbl_linestride_y), // Destination in main memory (addr)
+ dst_dbl_linestride_y, // Two Y lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+
+ mfc_put( scaled_v_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int) dst_addr_main_memory_v + (dst_vu*dst_dbl_linestride_vu), // Destination in main memory (addr)
+ dst_dbl_linestride_vu, // Two V lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+
+ mfc_put( scaled_u_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int) dst_addr_main_memory_u + (dst_vu*dst_dbl_linestride_vu), // Destination in main memory (addr)
+ dst_dbl_linestride_vu, // Two U lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+
+ // wait for completion
+ DMA_WAIT_TAG( (STR_BUF+curr_dst_idx) );
+ //---------------------------------------------------------------------------------------------
+}
+
+
+/**
+ * scale_srcw32_dstw32()
+ *
+ * processes an input image of width 32
+ * scaling is done to a width 32
+ * yuv2rgb conversion on a width of 32
+ * result stored in RAM
+ */
+void scale_srcw32_dstw32() {
+ // extract parameters
+ unsigned char* dst_addr = (unsigned char *)parms.dstBuffer;
+
+ unsigned int src_width = parms.src_pixel_width;
+ unsigned int src_height = parms.src_pixel_height;
+ unsigned int dst_width = parms.dst_pixel_width;
+ unsigned int dst_height = parms.dst_pixel_height;
+
+ // YVU
+ unsigned int src_linestride_y = src_width;
+ unsigned int src_dbl_linestride_y = src_width<<1;
+ unsigned int src_linestride_vu = src_width>>1;
+ unsigned int src_dbl_linestride_vu = src_width;
+
+ // scaled YVU
+ unsigned int scaled_src_linestride_y = dst_width;
+
+ // ram addresses
+ unsigned char* src_addr_y = parms.y_plane;
+ unsigned char* src_addr_v = parms.v_plane;
+ unsigned char* src_addr_u = parms.u_plane;
+
+ unsigned int dst_picture_size = dst_width*dst_height;
+
+ // Sizes for destination
+ unsigned int dst_dbl_linestride_y = dst_width<<1;
+ unsigned int dst_dbl_linestride_vu = dst_width>>1;
+
+ // Perform address calculation for Y, V and U in main memory with dst_addr as base
+ unsigned char* dst_addr_main_memory_y = dst_addr;
+ unsigned char* dst_addr_main_memory_v = dst_addr + dst_picture_size;
+ unsigned char* dst_addr_main_memory_u = dst_addr_main_memory_v +(dst_picture_size>>2);
+
+ // calculate scale factors
+ vector float vf_x_scale = spu_splats( (float)src_width/(float)dst_width );
+ float y_scale = (float)src_height/(float)dst_height;
+
+ // double buffered processing
+ // buffer switching
+ unsigned int curr_src_idx = 0;
+ unsigned int curr_dst_idx = 0;
+ unsigned int next_src_idx, next_dst_idx;
+
+ // 2 lines y as output, upper and lowerline
+ unsigned int curr_interpl_y_upper = 0;
+ unsigned int next_interpl_y_upper;
+ unsigned int curr_interpl_y_lower, next_interpl_y_lower;
+ // only 1 line v/u output, both planes have the same dimension
+ unsigned int curr_interpl_vu = 0;
+ unsigned int next_interpl_vu;
+
+ // weights, calculated in every loop iteration
+ vector float vf_curr_NSweight_y_upper = { 0.0f, 0.0f, 0.0f, 0.0f };
+ vector float vf_next_NSweight_y_upper;
+ vector float vf_curr_NSweight_y_lower, vf_next_NSweight_y_lower;
+ vector float vf_curr_NSweight_vu = { 0.0f, 0.0f, 0.0f, 0.0f };
+ vector float vf_next_NSweight_vu;
+
+ // line indices for the src picture
+ float curr_src_y_upper = 0.0f, next_src_y_upper;
+ float curr_src_y_lower, next_src_y_lower;
+ float curr_src_vu = 0.0f, next_src_vu;
+
+ // line indices for the dst picture
+ unsigned int dst_y=0, dst_vu=0;
+
+ // calculate lower line idices
+ curr_src_y_lower = ((float)curr_interpl_y_upper+1)*y_scale;
+ curr_interpl_y_lower = (unsigned int)curr_src_y_lower;
+ // lower line weight
+ vf_curr_NSweight_y_lower = spu_splats( curr_src_y_lower-(float)curr_interpl_y_lower );
+
+
+ // start partially double buffered processing
+ // get initial data, 2 sets of y, 1 set v, 1 set u
+ mfc_get( y_plane[curr_src_idx], (unsigned int) src_addr_y, src_dbl_linestride_y, RETR_BUF, 0, 0 );
+ mfc_get( y_plane[curr_src_idx]+src_dbl_linestride_y,
+ (unsigned int) src_addr_y+(curr_interpl_y_lower*src_linestride_y),
+ src_dbl_linestride_y,
+ RETR_BUF,
+ 0, 0 );
+ mfc_get( v_plane[curr_src_idx], (unsigned int) src_addr_v, src_dbl_linestride_vu, RETR_BUF, 0, 0 );
+ mfc_get( u_plane[curr_src_idx], (unsigned int) src_addr_u, src_dbl_linestride_vu, RETR_BUF, 0, 0 );
+
+ // iteration loop
+ // within each iteration 4 lines y, 2 lines v, 2 lines u are retrieved
+ // the scaled output is 2 lines y, 1 line v, 1 line u
+ // the yuv2rgb-converted output is stored to RAM
+ for( dst_vu=0; dst_vu<(dst_height>>1)-1; dst_vu++ ) {
+ dst_y = dst_vu<<1;
+
+ // calculate next indices
+ next_src_vu = ((float)dst_vu+1)*y_scale;
+ next_src_y_upper = ((float)dst_y+2)*y_scale;
+ next_src_y_lower = ((float)dst_y+3)*y_scale;
+
+ next_interpl_vu = (unsigned int) next_src_vu;
+ next_interpl_y_upper = (unsigned int) next_src_y_upper;
+ next_interpl_y_lower = (unsigned int) next_src_y_lower;
+
+ // calculate weight NORTH-SOUTH
+ vf_next_NSweight_vu = spu_splats( next_src_vu-(float)next_interpl_vu );
+ vf_next_NSweight_y_upper = spu_splats( next_src_y_upper-(float)next_interpl_y_upper );
+ vf_next_NSweight_y_lower = spu_splats( next_src_y_lower-(float)next_interpl_y_lower );
+
+ // get next lines
+ next_src_idx = curr_src_idx^1;
+ next_dst_idx = curr_dst_idx^1;
+
+ // 4 lines y
+ mfc_get( y_plane[next_src_idx],
+ (unsigned int) src_addr_y+(next_interpl_y_upper*src_linestride_y),
+ src_dbl_linestride_y,
+ RETR_BUF+next_src_idx,
+ 0, 0 );
+ mfc_get( y_plane[next_src_idx]+src_dbl_linestride_y,
+ (unsigned int) src_addr_y+(next_interpl_y_lower*src_linestride_y),
+ src_dbl_linestride_y,
+ RETR_BUF+next_src_idx,
+ 0, 0 );
+
+ // 2 lines v
+ mfc_get( v_plane[next_src_idx],
+ (unsigned int) src_addr_v+(next_interpl_vu*src_linestride_vu),
+ src_dbl_linestride_vu,
+ RETR_BUF+next_src_idx,
+ 0, 0 );
+ // 2 lines u
+ mfc_get( u_plane[next_src_idx],
+ (unsigned int) src_addr_u+(next_interpl_vu*src_linestride_vu),
+ src_dbl_linestride_vu,
+ RETR_BUF+next_src_idx,
+ 0, 0 );
+
+ DMA_WAIT_TAG( (RETR_BUF+curr_src_idx) );
+
+ // scaling
+ // work line y_upper
+ bilinear_scale_line_w16( y_plane[curr_src_idx],
+ scaled_y_plane[curr_src_idx],
+ dst_width,
+ vf_x_scale,
+ vf_curr_NSweight_y_upper,
+ src_linestride_y );
+ // work line y_lower
+ bilinear_scale_line_w16( y_plane[curr_src_idx]+src_dbl_linestride_y,
+ scaled_y_plane[curr_src_idx]+scaled_src_linestride_y,
+ dst_width,
+ vf_x_scale,
+ vf_curr_NSweight_y_lower,
+ src_linestride_y );
+ // work line v
+ bilinear_scale_line_w16( v_plane[curr_src_idx],
+ scaled_v_plane[curr_src_idx],
+ dst_width>>1,
+ vf_x_scale,
+ vf_curr_NSweight_vu,
+ src_linestride_vu );
+ // work line u
+ bilinear_scale_line_w16( u_plane[curr_src_idx],
+ scaled_u_plane[curr_src_idx],
+ dst_width>>1,
+ vf_x_scale,
+ vf_curr_NSweight_vu,
+ src_linestride_vu );
+
+
+
+ // Store the result back to main memory into a destination buffer in YUV format
+ //---------------------------------------------------------------------------------------------
+ DMA_WAIT_TAG( (STR_BUF+curr_dst_idx) );
+
+ // Perform three DMA transfers to 3 different locations in the main memory!
+ // dst_width: Pixel width of destination image
+ // dst_addr: Destination address in main memory
+ // dst_vu: Counter which is incremented one by one
+ // dst_y: Counter which is twice larger than dst_vu (dst_y = 2*dst_vu)
+
+ mfc_put( scaled_y_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int) dst_addr_main_memory_y + (dst_vu*dst_dbl_linestride_y), // Destination in main memory (addr)
+ dst_dbl_linestride_y, // Two Y lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+
+ mfc_put( scaled_v_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int) dst_addr_main_memory_v + (dst_vu*dst_dbl_linestride_vu), // Destination in main memory (addr)
+ dst_dbl_linestride_vu, // Two V lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+
+ mfc_put( scaled_u_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int) dst_addr_main_memory_u + (dst_vu*dst_dbl_linestride_vu), // Destination in main memory (addr)
+ dst_dbl_linestride_vu, // Two U lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+ //---------------------------------------------------------------------------------------------
+
+
+ // update for next cycle
+ curr_src_idx = next_src_idx;
+ curr_dst_idx = next_dst_idx;
+
+ curr_interpl_y_upper = next_interpl_y_upper;
+ curr_interpl_y_lower = next_interpl_y_lower;
+ curr_interpl_vu = next_interpl_vu;
+
+ vf_curr_NSweight_y_upper = vf_curr_NSweight_y_upper;
+ vf_curr_NSweight_y_lower = vf_curr_NSweight_y_lower;
+ vf_curr_NSweight_vu = vf_next_NSweight_vu;
+
+ curr_src_y_upper = next_src_y_upper;
+ curr_src_y_lower = next_src_y_lower;
+ curr_src_vu = next_src_vu;
+ }
+
+
+
+ DMA_WAIT_TAG( (RETR_BUF+curr_src_idx) );
+
+ // scaling
+ // work line y_upper
+ bilinear_scale_line_w16( y_plane[curr_src_idx],
+ scaled_y_plane[curr_src_idx],
+ dst_width,
+ vf_x_scale,
+ vf_curr_NSweight_y_upper,
+ src_linestride_y );
+ // work line y_lower
+ bilinear_scale_line_w16( y_plane[curr_src_idx]+src_dbl_linestride_y,
+ scaled_y_plane[curr_src_idx]+scaled_src_linestride_y,
+ dst_width,
+ vf_x_scale,
+ vf_curr_NSweight_y_lower,
+ src_linestride_y );
+ // work line v
+ bilinear_scale_line_w16( v_plane[curr_src_idx],
+ scaled_v_plane[curr_src_idx],
+ dst_width>>1,
+ vf_x_scale,
+ vf_curr_NSweight_vu,
+ src_linestride_vu );
+ // work line u
+ bilinear_scale_line_w16( u_plane[curr_src_idx],
+ scaled_u_plane[curr_src_idx],
+ dst_width>>1,
+ vf_x_scale,
+ vf_curr_NSweight_vu,
+ src_linestride_vu );
+
+
+ // Store the result back to main memory into a destination buffer in YUV format
+ //---------------------------------------------------------------------------------------------
+ DMA_WAIT_TAG( (STR_BUF+curr_dst_idx) );
+
+ // Perform three DMA transfers to 3 different locations in the main memory!
+ // dst_width: Pixel width of destination image
+ // dst_addr: Destination address in main memory
+ // dst_vu: Counter which is incremented one by one
+ // dst_y: Counter which is twice larger than dst_vu (dst_y = 2*dst_vu)
+
+ mfc_put( scaled_y_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int) dst_addr_main_memory_y + (dst_vu*dst_dbl_linestride_y), // Destination in main memory (addr)
+ dst_dbl_linestride_y, // Two Y lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+
+ mfc_put( scaled_v_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int) dst_addr_main_memory_v + (dst_vu*dst_dbl_linestride_vu), // Destination in main memory (addr)
+ dst_dbl_linestride_vu, // Two V lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+
+ mfc_put( scaled_u_plane[curr_src_idx], // What from local store (addr)
+ (unsigned int) dst_addr_main_memory_u + (dst_vu*dst_dbl_linestride_vu), // Destination in main memory (addr)
+ dst_dbl_linestride_vu, // Two U lines (depending on the widht of the destination resolution)
+ STR_BUF+curr_dst_idx, // Tag
+ 0, 0 );
+
+ // wait for completion
+ DMA_WAIT_TAG( (STR_BUF+curr_dst_idx) );
+ //---------------------------------------------------------------------------------------------
+}
+
+
+/*
+ * bilinear_scale_line_w8()
+ *
+ * processes a line of yuv-input, width has to be a multiple of 8
+ * scaled yuv-output is written to local store buffer
+ *
+ * @param src buffer for 2 lines input
+ * @param dst_ buffer for 1 line output
+ * @param dst_width the width of the destination line
+ * @param vf_x_scale a float vector, at each entry is the x_scale-factor
+ * @param vf_NSweight a float vector, at each position is the weight NORTH/SOUTH for the current line
+ * @param src_linestride the stride of the srcline
+ */
+void bilinear_scale_line_w8( unsigned char* src, unsigned char* dst_, unsigned int dst_width, vector float vf_x_scale, vector float vf_NSweight, unsigned int src_linestride ) {
+
+ unsigned char* dst = dst_;
+
+ unsigned int dst_x;
+ for( dst_x=0; dst_x<dst_width; dst_x+=8) {
+ // address calculation for loading the 4 surrounding pixel of each calculated
+ // destination pixel
+ vector unsigned int vui_dst_x_tmp = spu_splats( dst_x );
+ // lower range->first 4 pixel
+ // upper range->next 4 pixel
+ vector unsigned int vui_inc_dst_x_lower_range = { 0, 1, 2, 3 };
+ vector unsigned int vui_inc_dst_x_upper_range = { 4, 5, 6, 7 };
+ vector unsigned int vui_dst_x_lower_range = spu_add( vui_dst_x_tmp, vui_inc_dst_x_lower_range );
+ vector unsigned int vui_dst_x_upper_range = spu_add( vui_dst_x_tmp, vui_inc_dst_x_upper_range );
+
+ // calculate weight EAST-WEST
+ vector float vf_dst_x_lower_range = spu_convtf( vui_dst_x_lower_range, 0 );
+ vector float vf_dst_x_upper_range = spu_convtf( vui_dst_x_upper_range, 0 );
+ vector float vf_src_x_lower_range = spu_mul( vf_dst_x_lower_range, vf_x_scale );
+ vector float vf_src_x_upper_range = spu_mul( vf_dst_x_upper_range, vf_x_scale );
+ vector unsigned int vui_interpl_x_lower_range = spu_convtu( vf_src_x_lower_range, 0 );
+ vector unsigned int vui_interpl_x_upper_range = spu_convtu( vf_src_x_upper_range, 0 );
+ vector float vf_interpl_x_lower_range = spu_convtf( vui_interpl_x_lower_range, 0 );
+ vector float vf_interpl_x_upper_range = spu_convtf( vui_interpl_x_upper_range, 0 );
+ vector float vf_EWweight_lower_range = spu_sub( vf_src_x_lower_range, vf_interpl_x_lower_range );
+ vector float vf_EWweight_upper_range = spu_sub( vf_src_x_upper_range, vf_interpl_x_upper_range );
+
+ // calculate address offset
+ //
+ // pixel NORTH WEST
+ vector unsigned int vui_off_pixelNW_lower_range = vui_interpl_x_lower_range;
+ vector unsigned int vui_off_pixelNW_upper_range = vui_interpl_x_upper_range;
+
+ // pixel NORTH EAST-->(offpixelNW+1)
+ vector unsigned int vui_add_1 = { 1, 1, 1, 1 };
+ vector unsigned int vui_off_pixelNE_lower_range = spu_add( vui_off_pixelNW_lower_range, vui_add_1 );
+ vector unsigned int vui_off_pixelNE_upper_range = spu_add( vui_off_pixelNW_upper_range, vui_add_1 );
+
+ // SOUTH-WEST-->(offpixelNW+src_linestride)
+ vector unsigned int vui_srclinestride = spu_splats( src_linestride );
+ vector unsigned int vui_off_pixelSW_lower_range = spu_add( vui_srclinestride, vui_off_pixelNW_lower_range );
+ vector unsigned int vui_off_pixelSW_upper_range = spu_add( vui_srclinestride, vui_off_pixelNW_upper_range );
+
+ // SOUTH-EAST-->(offpixelNW+src_linestride+1)
+ vector unsigned int vui_off_pixelSE_lower_range = spu_add( vui_srclinestride, vui_off_pixelNE_lower_range );
+ vector unsigned int vui_off_pixelSE_upper_range = spu_add( vui_srclinestride, vui_off_pixelNE_upper_range );
+
+ // calculate each address
+ vector unsigned int vui_src_ls = spu_splats( (unsigned int) src );
+ vector unsigned int vui_addr_pixelNW_lower_range = spu_add( vui_src_ls, vui_off_pixelNW_lower_range );
+ vector unsigned int vui_addr_pixelNW_upper_range = spu_add( vui_src_ls, vui_off_pixelNW_upper_range );
+ vector unsigned int vui_addr_pixelNE_lower_range = spu_add( vui_src_ls, vui_off_pixelNE_lower_range );
+ vector unsigned int vui_addr_pixelNE_upper_range = spu_add( vui_src_ls, vui_off_pixelNE_upper_range );
+
+ vector unsigned int vui_addr_pixelSW_lower_range = spu_add( vui_src_ls, vui_off_pixelSW_lower_range );
+ vector unsigned int vui_addr_pixelSW_upper_range = spu_add( vui_src_ls, vui_off_pixelSW_upper_range );
+ vector unsigned int vui_addr_pixelSE_lower_range = spu_add( vui_src_ls, vui_off_pixelSE_lower_range );
+ vector unsigned int vui_addr_pixelSE_upper_range = spu_add( vui_src_ls, vui_off_pixelSE_upper_range );
+
+ // get each pixel
+ //
+ // scalar load, afterwards insertion into the right position
+ // NORTH WEST
+ vector unsigned char null_vector = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+ vector unsigned char vuc_pixel_NW_lower_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_lower_range, 0 )), null_vector, 3 );
+ vuc_pixel_NW_lower_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_lower_range, 1 )),
+ vuc_pixel_NW_lower_range, 7 );
+ vuc_pixel_NW_lower_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_lower_range, 2 )),
+ vuc_pixel_NW_lower_range, 11 );
+ vuc_pixel_NW_lower_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_lower_range, 3 )),
+ vuc_pixel_NW_lower_range, 15 );
+
+ vector unsigned char vuc_pixel_NW_upper_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_upper_range, 0 )), null_vector, 3 );
+ vuc_pixel_NW_upper_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_upper_range, 1 )),
+ vuc_pixel_NW_upper_range, 7 );
+ vuc_pixel_NW_upper_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_upper_range, 2 )),
+ vuc_pixel_NW_upper_range, 11 );
+ vuc_pixel_NW_upper_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_upper_range, 3 )),
+ vuc_pixel_NW_upper_range, 15 );
+
+ // NORTH EAST
+ vector unsigned char vuc_pixel_NE_lower_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_lower_range, 0 )), null_vector, 3 );
+ vuc_pixel_NE_lower_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_lower_range, 1 )),
+ vuc_pixel_NE_lower_range, 7 );
+ vuc_pixel_NE_lower_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_lower_range, 2 )),
+ vuc_pixel_NE_lower_range, 11 );
+ vuc_pixel_NE_lower_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_lower_range, 3 )),
+ vuc_pixel_NE_lower_range, 15 );
+
+ vector unsigned char vuc_pixel_NE_upper_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_upper_range, 0 )), null_vector, 3 );
+ vuc_pixel_NE_upper_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_upper_range, 1 )),
+ vuc_pixel_NE_upper_range, 7 );
+ vuc_pixel_NE_upper_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_upper_range, 2 )),
+ vuc_pixel_NE_upper_range, 11 );
+ vuc_pixel_NE_upper_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_upper_range, 3 )),
+ vuc_pixel_NE_upper_range, 15 );
+
+
+ // SOUTH WEST
+ vector unsigned char vuc_pixel_SW_lower_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_lower_range, 0 )), null_vector, 3 );
+ vuc_pixel_SW_lower_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_lower_range, 1 )),
+ vuc_pixel_SW_lower_range, 7 );
+ vuc_pixel_SW_lower_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_lower_range, 2 )),
+ vuc_pixel_SW_lower_range, 11 );
+ vuc_pixel_SW_lower_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_lower_range, 3 )),
+ vuc_pixel_SW_lower_range, 15 );
+
+ vector unsigned char vuc_pixel_SW_upper_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_upper_range, 0 )), null_vector, 3 );
+ vuc_pixel_SW_upper_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_upper_range, 1 )),
+ vuc_pixel_SW_upper_range, 7 );
+ vuc_pixel_SW_upper_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_upper_range, 2 )),
+ vuc_pixel_SW_upper_range, 11 );
+ vuc_pixel_SW_upper_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_upper_range, 3 )),
+ vuc_pixel_SW_upper_range, 15 );
+
+ // SOUTH EAST
+ vector unsigned char vuc_pixel_SE_lower_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_lower_range, 0 )), null_vector, 3 );
+ vuc_pixel_SE_lower_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_lower_range, 1 )),
+ vuc_pixel_SE_lower_range, 7 );
+ vuc_pixel_SE_lower_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_lower_range, 2 )),
+ vuc_pixel_SE_lower_range, 11 );
+ vuc_pixel_SE_lower_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_lower_range, 3 )),
+ vuc_pixel_SE_lower_range, 15 );
+
+ vector unsigned char vuc_pixel_SE_upper_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_upper_range, 0 )), null_vector, 3 );
+ vuc_pixel_SE_upper_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_upper_range, 1 )),
+ vuc_pixel_SE_upper_range, 7 );
+ vuc_pixel_SE_upper_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_upper_range, 2 )),
+ vuc_pixel_SE_upper_range, 11 );
+ vuc_pixel_SE_upper_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_upper_range, 3 )),
+ vuc_pixel_SE_upper_range, 15 );
+
+
+ // convert to float
+ vector float vf_pixel_NW_lower_range = spu_convtf( (vector unsigned int) vuc_pixel_NW_lower_range, 0 );
+ vector float vf_pixel_NW_upper_range = spu_convtf( (vector unsigned int) vuc_pixel_NW_upper_range, 0 );
+
+ vector float vf_pixel_SW_lower_range = spu_convtf( (vector unsigned int) vuc_pixel_SW_lower_range, 0 );
+ vector float vf_pixel_SW_upper_range = spu_convtf( (vector unsigned int) vuc_pixel_SW_upper_range, 0 );
+
+ vector float vf_pixel_NE_lower_range = spu_convtf( (vector unsigned int) vuc_pixel_NE_lower_range, 0 );
+ vector float vf_pixel_NE_upper_range = spu_convtf( (vector unsigned int) vuc_pixel_NE_upper_range, 0 );
+
+ vector float vf_pixel_SE_lower_range = spu_convtf( (vector unsigned int) vuc_pixel_SE_lower_range, 0 );
+ vector float vf_pixel_SE_upper_range = spu_convtf( (vector unsigned int) vuc_pixel_SE_upper_range, 0 );
+
+
+
+ // first linear interpolation: EWtop
+ // EWtop = NW + EWweight*(NE-NW)
+ //
+ // lower range
+ vector float vf_EWtop_lower_range_tmp = spu_sub( vf_pixel_NE_lower_range, vf_pixel_NW_lower_range );
+ vector float vf_EWtop_lower_range = spu_madd( vf_EWweight_lower_range,
+ vf_EWtop_lower_range_tmp,
+ vf_pixel_NW_lower_range );
+
+ // upper range
+ vector float vf_EWtop_upper_range_tmp = spu_sub( vf_pixel_NE_upper_range, vf_pixel_NW_upper_range );
+ vector float vf_EWtop_upper_range = spu_madd( vf_EWweight_upper_range,
+ vf_EWtop_upper_range_tmp,
+ vf_pixel_NW_upper_range );
+
+
+
+ // second linear interpolation: EWbottom
+ // EWbottom = SW + EWweight*(SE-SW)
+ //
+ // lower range
+ vector float vf_EWbottom_lower_range_tmp = spu_sub( vf_pixel_SE_lower_range, vf_pixel_SW_lower_range );
+ vector float vf_EWbottom_lower_range = spu_madd( vf_EWweight_lower_range,
+ vf_EWbottom_lower_range_tmp,
+ vf_pixel_SW_lower_range );
+
+ // upper range
+ vector float vf_EWbottom_upper_range_tmp = spu_sub( vf_pixel_SE_upper_range, vf_pixel_SW_upper_range );
+ vector float vf_EWbottom_upper_range = spu_madd( vf_EWweight_upper_range,
+ vf_EWbottom_upper_range_tmp,
+ vf_pixel_SW_upper_range );
+
+
+
+ // third linear interpolation: the bilinear interpolated value
+ // result = EWtop + NSweight*(EWbottom-EWtop);
+ //
+ // lower range
+ vector float vf_result_lower_range_tmp = spu_sub( vf_EWbottom_lower_range, vf_EWtop_lower_range );
+ vector float vf_result_lower_range = spu_madd( vf_NSweight,
+ vf_result_lower_range_tmp,
+ vf_EWtop_lower_range );
+
+ // upper range
+ vector float vf_result_upper_range_tmp = spu_sub( vf_EWbottom_upper_range, vf_EWtop_upper_range );
+ vector float vf_result_upper_range = spu_madd( vf_NSweight,
+ vf_result_upper_range_tmp,
+ vf_EWtop_upper_range );
+
+
+ // convert back: using saturated arithmetic
+ vector unsigned int vui_result_lower_range = vfloat_to_vuint( vf_result_lower_range );
+ vector unsigned int vui_result_upper_range = vfloat_to_vuint( vf_result_upper_range );
+
+ // merge results->lower,upper
+ vector unsigned char vuc_mask_merge_result = { 0x03, 0x07, 0x0B, 0x0F,
+ 0x13, 0x17, 0x1B, 0x1F,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00 };
+
+ vector unsigned char vuc_result = spu_shuffle( (vector unsigned char) vui_result_lower_range,
+ (vector unsigned char) vui_result_upper_range,
+ vuc_mask_merge_result );
+
+ // partial storing
+ vector unsigned char vuc_mask_out = { 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF };
+
+
+ // get currently stored data
+ vector unsigned char vuc_orig = *((vector unsigned char*)dst);
+
+ // clear currently stored data
+ vuc_orig = spu_and( vuc_orig,
+ spu_rlqwbyte( vuc_mask_out, ((unsigned int)dst)&0x0F) );
+
+ // rotate result according to storing address
+ vuc_result = spu_rlqwbyte( vuc_result, ((unsigned int)dst)&0x0F );
+
+ // store result
+ *((vector unsigned char*)dst) = spu_or( vuc_result,
+ vuc_orig );
+ dst += 8;
+ }
+}
+
+
+/*
+ * bilinear_scale_line_w16()
+ *
+ * processes a line of yuv-input, width has to be a multiple of 16
+ * scaled yuv-output is written to local store buffer
+ *
+ * @param src buffer for 2 lines input
+ * @param dst_ buffer for 1 line output
+ * @param dst_width the width of the destination line
+ * @param vf_x_scale a float vector, at each entry is the x_scale-factor
+ * @param vf_NSweight a float vector, at each position is the weight NORTH/SOUTH for the current line
+ * @param src_linestride the stride of the srcline
+ */
+void bilinear_scale_line_w16( unsigned char* src, unsigned char* dst_, unsigned int dst_width, vector float vf_x_scale, vector float vf_NSweight, unsigned int src_linestride ) {
+
+ unsigned char* dst = dst_;
+
+ unsigned int dst_x;
+ for( dst_x=0; dst_x<dst_width; dst_x+=16) {
+ // address calculation for loading the 4 surrounding pixel of each calculated
+ // destination pixel
+ vector unsigned int vui_dst_x_tmp = spu_splats( dst_x );
+ // parallelised processing
+ // first range->pixel 1 2 3 4
+ // second range->pixel 5 6 7 8
+ // third range->pixel 9 10 11 12
+ // fourth range->pixel 13 14 15 16
+ vector unsigned int vui_inc_dst_x_first_range = { 0, 1, 2, 3 };
+ vector unsigned int vui_inc_dst_x_second_range = { 4, 5, 6, 7 };
+ vector unsigned int vui_inc_dst_x_third_range = { 8, 9, 10, 11 };
+ vector unsigned int vui_inc_dst_x_fourth_range = { 12, 13, 14, 15 };
+ vector unsigned int vui_dst_x_first_range = spu_add( vui_dst_x_tmp, vui_inc_dst_x_first_range );
+ vector unsigned int vui_dst_x_second_range = spu_add( vui_dst_x_tmp, vui_inc_dst_x_second_range );
+ vector unsigned int vui_dst_x_third_range = spu_add( vui_dst_x_tmp, vui_inc_dst_x_third_range );
+ vector unsigned int vui_dst_x_fourth_range = spu_add( vui_dst_x_tmp, vui_inc_dst_x_fourth_range );
+
+ // calculate weight EAST-WEST
+ vector float vf_dst_x_first_range = spu_convtf( vui_dst_x_first_range, 0 );
+ vector float vf_dst_x_second_range = spu_convtf( vui_dst_x_second_range, 0 );
+ vector float vf_dst_x_third_range = spu_convtf( vui_dst_x_third_range, 0 );
+ vector float vf_dst_x_fourth_range = spu_convtf( vui_dst_x_fourth_range, 0 );
+ vector float vf_src_x_first_range = spu_mul( vf_dst_x_first_range, vf_x_scale );
+ vector float vf_src_x_second_range = spu_mul( vf_dst_x_second_range, vf_x_scale );
+ vector float vf_src_x_third_range = spu_mul( vf_dst_x_third_range, vf_x_scale );
+ vector float vf_src_x_fourth_range = spu_mul( vf_dst_x_fourth_range, vf_x_scale );
+ vector unsigned int vui_interpl_x_first_range = spu_convtu( vf_src_x_first_range, 0 );
+ vector unsigned int vui_interpl_x_second_range = spu_convtu( vf_src_x_second_range, 0 );
+ vector unsigned int vui_interpl_x_third_range = spu_convtu( vf_src_x_third_range, 0 );
+ vector unsigned int vui_interpl_x_fourth_range = spu_convtu( vf_src_x_fourth_range, 0 );
+ vector float vf_interpl_x_first_range = spu_convtf( vui_interpl_x_first_range, 0 );
+ vector float vf_interpl_x_second_range = spu_convtf( vui_interpl_x_second_range, 0 );
+ vector float vf_interpl_x_third_range = spu_convtf( vui_interpl_x_third_range, 0 );
+ vector float vf_interpl_x_fourth_range = spu_convtf( vui_interpl_x_fourth_range, 0 );
+ vector float vf_EWweight_first_range = spu_sub( vf_src_x_first_range, vf_interpl_x_first_range );
+ vector float vf_EWweight_second_range = spu_sub( vf_src_x_second_range, vf_interpl_x_second_range );
+ vector float vf_EWweight_third_range = spu_sub( vf_src_x_third_range, vf_interpl_x_third_range );
+ vector float vf_EWweight_fourth_range = spu_sub( vf_src_x_fourth_range, vf_interpl_x_fourth_range );
+
+ // calculate address offset
+ //
+ // pixel NORTH WEST
+ vector unsigned int vui_off_pixelNW_first_range = vui_interpl_x_first_range;
+ vector unsigned int vui_off_pixelNW_second_range = vui_interpl_x_second_range;
+ vector unsigned int vui_off_pixelNW_third_range = vui_interpl_x_third_range;
+ vector unsigned int vui_off_pixelNW_fourth_range = vui_interpl_x_fourth_range;
+
+ // pixel NORTH EAST-->(offpixelNW+1)
+ vector unsigned int vui_add_1 = { 1, 1, 1, 1 };
+ vector unsigned int vui_off_pixelNE_first_range = spu_add( vui_off_pixelNW_first_range, vui_add_1 );
+ vector unsigned int vui_off_pixelNE_second_range = spu_add( vui_off_pixelNW_second_range, vui_add_1 );
+ vector unsigned int vui_off_pixelNE_third_range = spu_add( vui_off_pixelNW_third_range, vui_add_1 );
+ vector unsigned int vui_off_pixelNE_fourth_range = spu_add( vui_off_pixelNW_fourth_range, vui_add_1 );
+
+ // SOUTH-WEST-->(offpixelNW+src_linestride)
+ vector unsigned int vui_srclinestride = spu_splats( src_linestride );
+ vector unsigned int vui_off_pixelSW_first_range = spu_add( vui_srclinestride, vui_off_pixelNW_first_range );
+ vector unsigned int vui_off_pixelSW_second_range = spu_add( vui_srclinestride, vui_off_pixelNW_second_range );
+ vector unsigned int vui_off_pixelSW_third_range = spu_add( vui_srclinestride, vui_off_pixelNW_third_range );
+ vector unsigned int vui_off_pixelSW_fourth_range = spu_add( vui_srclinestride, vui_off_pixelNW_fourth_range );
+
+ // SOUTH-EAST-->(offpixelNW+src_linestride+1)
+ vector unsigned int vui_off_pixelSE_first_range = spu_add( vui_srclinestride, vui_off_pixelNE_first_range );
+ vector unsigned int vui_off_pixelSE_second_range = spu_add( vui_srclinestride, vui_off_pixelNE_second_range );
+ vector unsigned int vui_off_pixelSE_third_range = spu_add( vui_srclinestride, vui_off_pixelNE_third_range );
+ vector unsigned int vui_off_pixelSE_fourth_range = spu_add( vui_srclinestride, vui_off_pixelNE_fourth_range );
+
+ // calculate each address
+ vector unsigned int vui_src_ls = spu_splats( (unsigned int) src );
+ vector unsigned int vui_addr_pixelNW_first_range = spu_add( vui_src_ls, vui_off_pixelNW_first_range );
+ vector unsigned int vui_addr_pixelNW_second_range = spu_add( vui_src_ls, vui_off_pixelNW_second_range );
+ vector unsigned int vui_addr_pixelNW_third_range = spu_add( vui_src_ls, vui_off_pixelNW_third_range );
+ vector unsigned int vui_addr_pixelNW_fourth_range = spu_add( vui_src_ls, vui_off_pixelNW_fourth_range );
+
+ vector unsigned int vui_addr_pixelNE_first_range = spu_add( vui_src_ls, vui_off_pixelNE_first_range );
+ vector unsigned int vui_addr_pixelNE_second_range = spu_add( vui_src_ls, vui_off_pixelNE_second_range );
+ vector unsigned int vui_addr_pixelNE_third_range = spu_add( vui_src_ls, vui_off_pixelNE_third_range );
+ vector unsigned int vui_addr_pixelNE_fourth_range = spu_add( vui_src_ls, vui_off_pixelNE_fourth_range );
+
+ vector unsigned int vui_addr_pixelSW_first_range = spu_add( vui_src_ls, vui_off_pixelSW_first_range );
+ vector unsigned int vui_addr_pixelSW_second_range = spu_add( vui_src_ls, vui_off_pixelSW_second_range );
+ vector unsigned int vui_addr_pixelSW_third_range = spu_add( vui_src_ls, vui_off_pixelSW_third_range );
+ vector unsigned int vui_addr_pixelSW_fourth_range = spu_add( vui_src_ls, vui_off_pixelSW_fourth_range );
+
+ vector unsigned int vui_addr_pixelSE_first_range = spu_add( vui_src_ls, vui_off_pixelSE_first_range );
+ vector unsigned int vui_addr_pixelSE_second_range = spu_add( vui_src_ls, vui_off_pixelSE_second_range );
+ vector unsigned int vui_addr_pixelSE_third_range = spu_add( vui_src_ls, vui_off_pixelSE_third_range );
+ vector unsigned int vui_addr_pixelSE_fourth_range = spu_add( vui_src_ls, vui_off_pixelSE_fourth_range );
+
+
+ // get each pixel
+ //
+ // scalar load, afterwards insertion into the right position
+ // NORTH WEST
+ // first range
+ vector unsigned char null_vector = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+ vector unsigned char vuc_pixel_NW_first_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_first_range, 0 )), null_vector, 3 );
+ vuc_pixel_NW_first_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_first_range, 1 )),
+ vuc_pixel_NW_first_range, 7 );
+ vuc_pixel_NW_first_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_first_range, 2 )),
+ vuc_pixel_NW_first_range, 11 );
+ vuc_pixel_NW_first_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_first_range, 3 )),
+ vuc_pixel_NW_first_range, 15 );
+ // second range
+ vector unsigned char vuc_pixel_NW_second_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_second_range, 0 )), null_vector, 3 );
+ vuc_pixel_NW_second_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_second_range, 1 )),
+ vuc_pixel_NW_second_range, 7 );
+ vuc_pixel_NW_second_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_second_range, 2 )),
+ vuc_pixel_NW_second_range, 11 );
+ vuc_pixel_NW_second_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_second_range, 3 )),
+ vuc_pixel_NW_second_range, 15 );
+ // third range
+ vector unsigned char vuc_pixel_NW_third_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_third_range, 0 )), null_vector, 3 );
+ vuc_pixel_NW_third_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_third_range, 1 )),
+ vuc_pixel_NW_third_range, 7 );
+ vuc_pixel_NW_third_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_third_range, 2 )),
+ vuc_pixel_NW_third_range, 11 );
+ vuc_pixel_NW_third_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_third_range, 3 )),
+ vuc_pixel_NW_third_range, 15 );
+ // fourth range
+ vector unsigned char vuc_pixel_NW_fourth_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_fourth_range, 0 )), null_vector, 3 );
+ vuc_pixel_NW_fourth_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_fourth_range, 1 )),
+ vuc_pixel_NW_fourth_range, 7 );
+ vuc_pixel_NW_fourth_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_fourth_range, 2 )),
+ vuc_pixel_NW_fourth_range, 11 );
+ vuc_pixel_NW_fourth_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNW_fourth_range, 3 )),
+ vuc_pixel_NW_fourth_range, 15 );
+
+ // NORTH EAST
+ // first range
+ vector unsigned char vuc_pixel_NE_first_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_first_range, 0 )), null_vector, 3 );
+ vuc_pixel_NE_first_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_first_range, 1 )),
+ vuc_pixel_NE_first_range, 7 );
+ vuc_pixel_NE_first_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_first_range, 2 )),
+ vuc_pixel_NE_first_range, 11 );
+ vuc_pixel_NE_first_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_first_range, 3 )),
+ vuc_pixel_NE_first_range, 15 );
+ // second range
+ vector unsigned char vuc_pixel_NE_second_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_second_range, 0 )), null_vector, 3 );
+ vuc_pixel_NE_second_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_second_range, 1 )),
+ vuc_pixel_NE_second_range, 7 );
+ vuc_pixel_NE_second_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_second_range, 2 )),
+ vuc_pixel_NE_second_range, 11 );
+ vuc_pixel_NE_second_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_second_range, 3 )),
+ vuc_pixel_NE_second_range, 15 );
+ // third range
+ vector unsigned char vuc_pixel_NE_third_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_third_range, 0 )), null_vector, 3 );
+ vuc_pixel_NE_third_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_third_range, 1 )),
+ vuc_pixel_NE_third_range, 7 );
+ vuc_pixel_NE_third_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_third_range, 2 )),
+ vuc_pixel_NE_third_range, 11 );
+ vuc_pixel_NE_third_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_third_range, 3 )),
+ vuc_pixel_NE_third_range, 15 );
+ // fourth range
+ vector unsigned char vuc_pixel_NE_fourth_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_fourth_range, 0 )), null_vector, 3 );
+ vuc_pixel_NE_fourth_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_fourth_range, 1 )),
+ vuc_pixel_NE_fourth_range, 7 );
+ vuc_pixel_NE_fourth_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_fourth_range, 2 )),
+ vuc_pixel_NE_fourth_range, 11 );
+ vuc_pixel_NE_fourth_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelNE_fourth_range, 3 )),
+ vuc_pixel_NE_fourth_range, 15 );
+
+ // SOUTH WEST
+ // first range
+ vector unsigned char vuc_pixel_SW_first_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_first_range, 0 )), null_vector, 3 );
+ vuc_pixel_SW_first_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_first_range, 1 )),
+ vuc_pixel_SW_first_range, 7 );
+ vuc_pixel_SW_first_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_first_range, 2 )),
+ vuc_pixel_SW_first_range, 11 );
+ vuc_pixel_SW_first_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_first_range, 3 )),
+ vuc_pixel_SW_first_range, 15 );
+ // second range
+ vector unsigned char vuc_pixel_SW_second_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_second_range, 0 )), null_vector, 3 );
+ vuc_pixel_SW_second_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_second_range, 1 )),
+ vuc_pixel_SW_second_range, 7 );
+ vuc_pixel_SW_second_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_second_range, 2 )),
+ vuc_pixel_SW_second_range, 11 );
+ vuc_pixel_SW_second_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_second_range, 3 )),
+ vuc_pixel_SW_second_range, 15 );
+ // third range
+ vector unsigned char vuc_pixel_SW_third_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_third_range, 0 )), null_vector, 3 );
+ vuc_pixel_SW_third_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_third_range, 1 )),
+ vuc_pixel_SW_third_range, 7 );
+ vuc_pixel_SW_third_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_third_range, 2 )),
+ vuc_pixel_SW_third_range, 11 );
+ vuc_pixel_SW_third_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_third_range, 3 )),
+ vuc_pixel_SW_third_range, 15 );
+ // fourth range
+ vector unsigned char vuc_pixel_SW_fourth_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_fourth_range, 0 )), null_vector, 3 );
+ vuc_pixel_SW_fourth_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_fourth_range, 1 )),
+ vuc_pixel_SW_fourth_range, 7 );
+ vuc_pixel_SW_fourth_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_fourth_range, 2 )),
+ vuc_pixel_SW_fourth_range, 11 );
+ vuc_pixel_SW_fourth_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSW_fourth_range, 3 )),
+ vuc_pixel_SW_fourth_range, 15 );
+
+ // NORTH EAST
+ // first range
+ vector unsigned char vuc_pixel_SE_first_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_first_range, 0 )), null_vector, 3 );
+ vuc_pixel_SE_first_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_first_range, 1 )),
+ vuc_pixel_SE_first_range, 7 );
+ vuc_pixel_SE_first_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_first_range, 2 )),
+ vuc_pixel_SE_first_range, 11 );
+ vuc_pixel_SE_first_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_first_range, 3 )),
+ vuc_pixel_SE_first_range, 15 );
+ // second range
+ vector unsigned char vuc_pixel_SE_second_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_second_range, 0 )), null_vector, 3 );
+ vuc_pixel_SE_second_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_second_range, 1 )),
+ vuc_pixel_SE_second_range, 7 );
+ vuc_pixel_SE_second_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_second_range, 2 )),
+ vuc_pixel_SE_second_range, 11 );
+ vuc_pixel_SE_second_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_second_range, 3 )),
+ vuc_pixel_SE_second_range, 15 );
+ // third range
+ vector unsigned char vuc_pixel_SE_third_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_third_range, 0 )), null_vector, 3 );
+ vuc_pixel_SE_third_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_third_range, 1 )),
+ vuc_pixel_SE_third_range, 7 );
+ vuc_pixel_SE_third_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_third_range, 2 )),
+ vuc_pixel_SE_third_range, 11 );
+ vuc_pixel_SE_third_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_third_range, 3 )),
+ vuc_pixel_SE_third_range, 15 );
+ // fourth range
+ vector unsigned char vuc_pixel_SE_fourth_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_fourth_range, 0 )), null_vector, 3 );
+ vuc_pixel_SE_fourth_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_fourth_range, 1 )),
+ vuc_pixel_SE_fourth_range, 7 );
+ vuc_pixel_SE_fourth_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_fourth_range, 2 )),
+ vuc_pixel_SE_fourth_range, 11 );
+ vuc_pixel_SE_fourth_range = spu_insert(
+ *((unsigned char*) spu_extract( vui_addr_pixelSE_fourth_range, 3 )),
+ vuc_pixel_SE_fourth_range, 15 );
+
+
+
+ // convert to float
+ vector float vf_pixel_NW_first_range = spu_convtf( (vector unsigned int) vuc_pixel_NW_first_range, 0 );
+ vector float vf_pixel_NW_second_range = spu_convtf( (vector unsigned int) vuc_pixel_NW_second_range, 0 );
+ vector float vf_pixel_NW_third_range = spu_convtf( (vector unsigned int) vuc_pixel_NW_third_range, 0 );
+ vector float vf_pixel_NW_fourth_range = spu_convtf( (vector unsigned int) vuc_pixel_NW_fourth_range, 0 );
+
+ vector float vf_pixel_NE_first_range = spu_convtf( (vector unsigned int) vuc_pixel_NE_first_range, 0 );
+ vector float vf_pixel_NE_second_range = spu_convtf( (vector unsigned int) vuc_pixel_NE_second_range, 0 );
+ vector float vf_pixel_NE_third_range = spu_convtf( (vector unsigned int) vuc_pixel_NE_third_range, 0 );
+ vector float vf_pixel_NE_fourth_range = spu_convtf( (vector unsigned int) vuc_pixel_NE_fourth_range, 0 );
+
+ vector float vf_pixel_SW_first_range = spu_convtf( (vector unsigned int) vuc_pixel_SW_first_range, 0 );
+ vector float vf_pixel_SW_second_range = spu_convtf( (vector unsigned int) vuc_pixel_SW_second_range, 0 );
+ vector float vf_pixel_SW_third_range = spu_convtf( (vector unsigned int) vuc_pixel_SW_third_range, 0 );
+ vector float vf_pixel_SW_fourth_range = spu_convtf( (vector unsigned int) vuc_pixel_SW_fourth_range, 0 );
+
+ vector float vf_pixel_SE_first_range = spu_convtf( (vector unsigned int) vuc_pixel_SE_first_range, 0 );
+ vector float vf_pixel_SE_second_range = spu_convtf( (vector unsigned int) vuc_pixel_SE_second_range, 0 );
+ vector float vf_pixel_SE_third_range = spu_convtf( (vector unsigned int) vuc_pixel_SE_third_range, 0 );
+ vector float vf_pixel_SE_fourth_range = spu_convtf( (vector unsigned int) vuc_pixel_SE_fourth_range, 0 );
+
+ // first linear interpolation: EWtop
+ // EWtop = NW + EWweight*(NE-NW)
+ //
+ // first range
+ vector float vf_EWtop_first_range_tmp = spu_sub( vf_pixel_NE_first_range, vf_pixel_NW_first_range );
+ vector float vf_EWtop_first_range = spu_madd( vf_EWweight_first_range,
+ vf_EWtop_first_range_tmp,
+ vf_pixel_NW_first_range );
+
+ // second range
+ vector float vf_EWtop_second_range_tmp = spu_sub( vf_pixel_NE_second_range, vf_pixel_NW_second_range );
+ vector float vf_EWtop_second_range = spu_madd( vf_EWweight_second_range,
+ vf_EWtop_second_range_tmp,
+ vf_pixel_NW_second_range );
+
+ // third range
+ vector float vf_EWtop_third_range_tmp = spu_sub( vf_pixel_NE_third_range, vf_pixel_NW_third_range );
+ vector float vf_EWtop_third_range = spu_madd( vf_EWweight_third_range,
+ vf_EWtop_third_range_tmp,
+ vf_pixel_NW_third_range );
+
+ // fourth range
+ vector float vf_EWtop_fourth_range_tmp = spu_sub( vf_pixel_NE_fourth_range, vf_pixel_NW_fourth_range );
+ vector float vf_EWtop_fourth_range = spu_madd( vf_EWweight_fourth_range,
+ vf_EWtop_fourth_range_tmp,
+ vf_pixel_NW_fourth_range );
+
+
+
+ // second linear interpolation: EWbottom
+ // EWbottom = SW + EWweight*(SE-SW)
+ //
+ // first range
+ vector float vf_EWbottom_first_range_tmp = spu_sub( vf_pixel_SE_first_range, vf_pixel_SW_first_range );
+ vector float vf_EWbottom_first_range = spu_madd( vf_EWweight_first_range,
+ vf_EWbottom_first_range_tmp,
+ vf_pixel_SW_first_range );
+
+ // second range
+ vector float vf_EWbottom_second_range_tmp = spu_sub( vf_pixel_SE_second_range, vf_pixel_SW_second_range );
+ vector float vf_EWbottom_second_range = spu_madd( vf_EWweight_second_range,
+ vf_EWbottom_second_range_tmp,
+ vf_pixel_SW_second_range );
+ // first range
+ vector float vf_EWbottom_third_range_tmp = spu_sub( vf_pixel_SE_third_range, vf_pixel_SW_third_range );
+ vector float vf_EWbottom_third_range = spu_madd( vf_EWweight_third_range,
+ vf_EWbottom_third_range_tmp,
+ vf_pixel_SW_third_range );
+
+ // first range
+ vector float vf_EWbottom_fourth_range_tmp = spu_sub( vf_pixel_SE_fourth_range, vf_pixel_SW_fourth_range );
+ vector float vf_EWbottom_fourth_range = spu_madd( vf_EWweight_fourth_range,
+ vf_EWbottom_fourth_range_tmp,
+ vf_pixel_SW_fourth_range );
+
+
+
+ // third linear interpolation: the bilinear interpolated value
+ // result = EWtop + NSweight*(EWbottom-EWtop);
+ //
+ // first range
+ vector float vf_result_first_range_tmp = spu_sub( vf_EWbottom_first_range, vf_EWtop_first_range );
+ vector float vf_result_first_range = spu_madd( vf_NSweight,
+ vf_result_first_range_tmp,
+ vf_EWtop_first_range );
+
+ // second range
+ vector float vf_result_second_range_tmp = spu_sub( vf_EWbottom_second_range, vf_EWtop_second_range );
+ vector float vf_result_second_range = spu_madd( vf_NSweight,
+ vf_result_second_range_tmp,
+ vf_EWtop_second_range );
+
+ // third range
+ vector float vf_result_third_range_tmp = spu_sub( vf_EWbottom_third_range, vf_EWtop_third_range );
+ vector float vf_result_third_range = spu_madd( vf_NSweight,
+ vf_result_third_range_tmp,
+ vf_EWtop_third_range );
+
+ // fourth range
+ vector float vf_result_fourth_range_tmp = spu_sub( vf_EWbottom_fourth_range, vf_EWtop_fourth_range );
+ vector float vf_result_fourth_range = spu_madd( vf_NSweight,
+ vf_result_fourth_range_tmp,
+ vf_EWtop_fourth_range );
+
+
+
+ // convert back: using saturated arithmetic
+ vector unsigned int vui_result_first_range = vfloat_to_vuint( vf_result_first_range );
+ vector unsigned int vui_result_second_range = vfloat_to_vuint( vf_result_second_range );
+ vector unsigned int vui_result_third_range = vfloat_to_vuint( vf_result_third_range );
+ vector unsigned int vui_result_fourth_range = vfloat_to_vuint( vf_result_fourth_range );
+
+ // merge results->lower,upper
+ vector unsigned char vuc_mask_merge_result_first_second = { 0x03, 0x07, 0x0B, 0x0F,
+ 0x13, 0x17, 0x1B, 0x1F,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00 };
+
+ vector unsigned char vuc_mask_merge_result_third_fourth = { 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x03, 0x07, 0x0B, 0x0F,
+ 0x13, 0x17, 0x1B, 0x1F };
+
+ vector unsigned char vuc_result_first_second =
+ spu_shuffle( (vector unsigned char) vui_result_first_range,
+ (vector unsigned char) vui_result_second_range,
+ vuc_mask_merge_result_first_second );
+
+ vector unsigned char vuc_result_third_fourth =
+ spu_shuffle( (vector unsigned char) vui_result_third_range,
+ (vector unsigned char) vui_result_fourth_range,
+ vuc_mask_merge_result_third_fourth );
+
+ // store result
+ *((vector unsigned char*)dst) = spu_or( vuc_result_first_second,
+ vuc_result_third_fourth );
+ dst += 16;
+ }
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/ps3/spulibs/fb_writer.c b/distrib/sdl-1.2.15/src/video/ps3/spulibs/fb_writer.c
new file mode 100644
index 0000000..0eb51cc
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ps3/spulibs/fb_writer.c
@@ -0,0 +1,193 @@
+/*
+ * SDL - Simple DirectMedia Layer
+ * CELL BE Support for PS3 Framebuffer
+ * Copyright (C) 2008, 2009 International Business Machines Corporation
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * Martin Lowinski <lowinski [at] de [dot] ibm [ibm] com>
+ * Dirk Herrendoerfer <d.herrendoerfer [at] de [dot] ibm [dot] com>
+ * SPE code based on research by:
+ * Rene Becker
+ * Thimo Emmerich
+ */
+
+#include "spu_common.h"
+
+#include <spu_intrinsics.h>
+#include <spu_mfcio.h>
+#include <stdio.h>
+#include <string.h>
+
+// Debugging
+//#define DEBUG
+
+#ifdef DEBUG
+#define deprintf(fmt, args... ) \
+ fprintf( stdout, fmt, ##args ); \
+ fflush( stdout );
+#else
+#define deprintf( fmt, args... )
+#endif
+
+void cpy_to_fb(unsigned int);
+
+/* fb_writer_spu parms */
+static volatile struct fb_writer_parms_t parms __attribute__ ((aligned(128)));
+
+/* Code running on SPU */
+int main(unsigned long long spe_id __attribute__ ((unused)), unsigned long long argp __attribute__ ((unused)))
+{
+ deprintf("[SPU] fb_writer_spu is up... (on SPE #%llu)\n", spe_id);
+ uint32_t ea_mfc, mbox;
+ // send ready message
+ spu_write_out_mbox(SPU_READY);
+
+ while (1) {
+ /* Check mailbox */
+ mbox = spu_read_in_mbox();
+ deprintf("[SPU] Message is %u\n", mbox);
+ switch (mbox) {
+ case SPU_EXIT:
+ deprintf("[SPU] fb_writer goes down...\n");
+ return 0;
+ case SPU_START:
+ break;
+ default:
+ deprintf("[SPU] Cannot handle message\n");
+ continue;
+ }
+
+ /* Tag Manager setup */
+ unsigned int tags;
+ tags = mfc_multi_tag_reserve(5);
+ if (tags == MFC_TAG_INVALID) {
+ deprintf("[SPU] Failed to reserve mfc tags on fb_writer\n");
+ return 0;
+ }
+
+ /* Framebuffer parms */
+ ea_mfc = spu_read_in_mbox();
+ deprintf("[SPU] Message on fb_writer is %u\n", ea_mfc);
+ spu_mfcdma32(&parms, (unsigned int)ea_mfc,
+ sizeof(struct fb_writer_parms_t), tags,
+ MFC_GET_CMD);
+ deprintf("[SPU] argp = %u\n", (unsigned int)argp);
+ DMA_WAIT_TAG(tags);
+
+ /* Copy parms->data to framebuffer */
+ deprintf("[SPU] Copying to framebuffer started\n");
+ cpy_to_fb(tags);
+ deprintf("[SPU] Copying to framebuffer done!\n");
+
+ mfc_multi_tag_release(tags, 5);
+ deprintf("[SPU] fb_writer_spu... done!\n");
+ /* Send FIN msg */
+ spu_write_out_mbox(SPU_FIN);
+ }
+
+ return 0;
+}
+
+void cpy_to_fb(unsigned int tag_id_base)
+{
+ unsigned int i;
+ unsigned char current_buf;
+ uint8_t *in = parms.data;
+
+ /* Align fb pointer which was centered before */
+ uint8_t *fb =
+ (unsigned char *)((unsigned int)parms.center & 0xFFFFFFF0);
+
+ uint32_t bounded_input_height = parms.bounded_input_height;
+ uint32_t bounded_input_width = parms.bounded_input_width;
+ uint32_t fb_pixel_size = parms.fb_pixel_size;
+
+ uint32_t out_line_stride = parms.out_line_stride;
+ uint32_t in_line_stride = parms.in_line_stride;
+ uint32_t in_line_size = bounded_input_width * fb_pixel_size;
+
+ current_buf = 0;
+
+ /* Local store buffer */
+ static volatile uint8_t buf[4][BUFFER_SIZE]
+ __attribute__ ((aligned(128)));
+ /* do 4-times multibuffering using DMA list, process in two steps */
+ for (i = 0; i < bounded_input_height >> 2; i++) {
+ /* first buffer */
+ DMA_WAIT_TAG(tag_id_base + 1);
+ // retrieve buffer
+ spu_mfcdma32(buf[0], (unsigned int)in, in_line_size,
+ tag_id_base + 1, MFC_GETB_CMD);
+ DMA_WAIT_TAG(tag_id_base + 1);
+ // store buffer
+ spu_mfcdma32(buf[0], (unsigned int)fb, in_line_size,
+ tag_id_base + 1, MFC_PUTB_CMD);
+ in += in_line_stride;
+ fb += out_line_stride;
+ deprintf("[SPU] 1st buffer copied in=0x%x, fb=0x%x\n", in,
+ fb);
+
+ /* second buffer */
+ DMA_WAIT_TAG(tag_id_base + 2);
+ // retrieve buffer
+ spu_mfcdma32(buf[1], (unsigned int)in, in_line_size,
+ tag_id_base + 2, MFC_GETB_CMD);
+ DMA_WAIT_TAG(tag_id_base + 2);
+ // store buffer
+ spu_mfcdma32(buf[1], (unsigned int)fb, in_line_size,
+ tag_id_base + 2, MFC_PUTB_CMD);
+ in += in_line_stride;
+ fb += out_line_stride;
+ deprintf("[SPU] 2nd buffer copied in=0x%x, fb=0x%x\n", in,
+ fb);
+
+ /* third buffer */
+ DMA_WAIT_TAG(tag_id_base + 3);
+ // retrieve buffer
+ spu_mfcdma32(buf[2], (unsigned int)in, in_line_size,
+ tag_id_base + 3, MFC_GETB_CMD);
+ DMA_WAIT_TAG(tag_id_base + 3);
+ // store buffer
+ spu_mfcdma32(buf[2], (unsigned int)fb, in_line_size,
+ tag_id_base + 3, MFC_PUTB_CMD);
+ in += in_line_stride;
+ fb += out_line_stride;
+ deprintf("[SPU] 3rd buffer copied in=0x%x, fb=0x%x\n", in,
+ fb);
+
+ /* fourth buffer */
+ DMA_WAIT_TAG(tag_id_base + 4);
+ // retrieve buffer
+ spu_mfcdma32(buf[3], (unsigned int)in, in_line_size,
+ tag_id_base + 4, MFC_GETB_CMD);
+ DMA_WAIT_TAG(tag_id_base + 4);
+ // store buffer
+ spu_mfcdma32(buf[3], (unsigned int)fb, in_line_size,
+ tag_id_base + 4, MFC_PUTB_CMD);
+ in += in_line_stride;
+ fb += out_line_stride;
+ deprintf("[SPU] 4th buffer copied in=0x%x, fb=0x%x\n", in,
+ fb);
+ deprintf("[SPU] Loop #%i, bounded_input_height=%i\n", i,
+ bounded_input_height >> 2);
+ }
+ DMA_WAIT_TAG(tag_id_base + 2);
+ DMA_WAIT_TAG(tag_id_base + 3);
+ DMA_WAIT_TAG(tag_id_base + 4);
+}
+
+
diff --git a/distrib/sdl-1.2.15/src/video/ps3/spulibs/spu_common.h b/distrib/sdl-1.2.15/src/video/ps3/spulibs/spu_common.h
new file mode 100644
index 0000000..42c328c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ps3/spulibs/spu_common.h
@@ -0,0 +1,108 @@
+/*
+ * SDL - Simple DirectMedia Layer
+ * CELL BE Support for PS3 Framebuffer
+ * Copyright (C) 2008, 2009 International Business Machines Corporation
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * Martin Lowinski <lowinski [at] de [dot] ibm [ibm] com>
+ * Dirk Herrendoerfer <d.herrendoerfer [at] de [dot] ibm [dot] com>
+ * SPE code based on research by:
+ * Rene Becker
+ * Thimo Emmerich
+ */
+
+/* Common definitions/makros for SPUs */
+
+#ifndef _SPU_COMMON_H
+#define _SPU_COMMON_H
+
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+
+/* Tag management */
+#define DMA_WAIT_TAG(_tag) \
+ mfc_write_tag_mask(1<<(_tag)); \
+ mfc_read_tag_status_all();
+
+/* SPU mailbox messages */
+#define SPU_READY 0
+#define SPU_START 1
+#define SPU_FIN 2
+#define SPU_EXIT 3
+
+/* Tags */
+#define RETR_BUF 0
+#define STR_BUF 1
+#define TAG_INIT 2
+
+/* Buffersizes */
+#define MAX_HDTV_WIDTH 1920
+#define MAX_HDTV_HEIGHT 1080
+/* One stride of HDTV */
+#define BUFFER_SIZE 7680
+
+/* fb_writer ppu/spu exchange parms */
+struct fb_writer_parms_t {
+ uint8_t *data;
+ uint8_t *center;
+ uint32_t out_line_stride;
+ uint32_t in_line_stride;
+ uint32_t bounded_input_height;
+ uint32_t bounded_input_width;
+ uint32_t fb_pixel_size;
+
+ /* This padding is to fulfill the need for 16 byte alignment. On parm change, update! */
+ char padding[4];
+} __attribute__((aligned(128)));
+
+/* yuv2rgb ppu/spu exchange parms */
+struct yuv2rgb_parms_t {
+ uint8_t* y_plane;
+ uint8_t* v_plane;
+ uint8_t* u_plane;
+
+ uint8_t* dstBuffer;
+
+ unsigned int src_pixel_width;
+ unsigned int src_pixel_height;
+
+ /* This padding is to fulfill the need for 16 byte alignment. On parm change, update! */
+ char padding[128 - ((4 * sizeof(uint8_t *) + 2 * sizeof(unsigned int)) & 0x7F)];
+} __attribute__((aligned(128)));
+
+/* bilin_scaler ppu/spu exchange parms */
+struct scale_parms_t {
+ uint8_t* y_plane;
+ uint8_t* v_plane;
+ uint8_t* u_plane;
+
+ uint8_t* dstBuffer;
+
+ unsigned int src_pixel_width;
+ unsigned int src_pixel_height;
+
+ unsigned int dst_pixel_width;
+ unsigned int dst_pixel_height;
+
+ /* This padding is to fulfill the need for 16 byte alignment. On parm change, update! */
+ char padding[128 - ((4 * sizeof(uint8_t *) + 4 * sizeof(unsigned int)) & 0x7F)];
+} __attribute__((aligned(128)));
+
+#endif /* _SPU_COMMON_H */
+
+
diff --git a/distrib/sdl-1.2.15/src/video/ps3/spulibs/yuv2rgb_converter.c b/distrib/sdl-1.2.15/src/video/ps3/spulibs/yuv2rgb_converter.c
new file mode 100644
index 0000000..5e16691
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/ps3/spulibs/yuv2rgb_converter.c
@@ -0,0 +1,629 @@
+/*
+ * SDL - Simple DirectMedia Layer
+ * CELL BE Support for PS3 Framebuffer
+ * Copyright (C) 2008, 2009 International Business Machines Corporation
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * Martin Lowinski <lowinski [at] de [dot] ibm [ibm] com>
+ * Dirk Herrendoerfer <d.herrendoerfer [at] de [dot] ibm [dot] com>
+ * SPE code based on research by:
+ * Rene Becker
+ * Thimo Emmerich
+ */
+
+#include "spu_common.h"
+
+#include <spu_intrinsics.h>
+#include <spu_mfcio.h>
+
+// Debugging
+//#define DEBUG
+
+#ifdef DEBUG
+#define deprintf(fmt, args... ) \
+ fprintf( stdout, fmt, ##args ); \
+ fflush( stdout );
+#else
+#define deprintf( fmt, args... )
+#endif
+
+struct yuv2rgb_parms_t parms_converter __attribute__((aligned(128)));
+
+/* A maximum of 8 lines Y, therefore 4 lines V, 4 lines U are stored
+ * there might be the need to retrieve misaligned data, adjust
+ * incoming v and u plane to be able to handle this (add 128)
+ */
+unsigned char y_plane[2][(MAX_HDTV_WIDTH + 128) * 4] __attribute__((aligned(128)));
+unsigned char v_plane[2][(MAX_HDTV_WIDTH + 128) * 2] __attribute__((aligned(128)));
+unsigned char u_plane[2][(MAX_HDTV_WIDTH + 128) * 2] __attribute__((aligned(128)));
+
+/* A maximum of 4 lines BGRA are stored, 4 byte per pixel */
+unsigned char bgra[4 * MAX_HDTV_WIDTH * 4] __attribute__((aligned(128)));
+
+/* some vectors needed by the float to int conversion */
+static const vector float vec_255 = { 255.0f, 255.0f, 255.0f, 255.0f };
+static const vector float vec_0_1 = { 0.1f, 0.1f, 0.1f, 0.1f };
+
+void yuv_to_rgb_w16();
+void yuv_to_rgb_w32();
+
+void yuv_to_rgb_w16_line(unsigned char* y_addr, unsigned char* v_addr, unsigned char* u_addr, unsigned char* bgra_addr, unsigned int width);
+void yuv_to_rgb_w32_line(unsigned char* y_addr, unsigned char* v_addr, unsigned char* u_addr, unsigned char* bgra_addr_, unsigned int width);
+
+
+int main(unsigned long long spe_id __attribute__((unused)), unsigned long long argp __attribute__ ((unused)))
+{
+ deprintf("[SPU] yuv2rgb_spu is up... (on SPE #%llu)\n", spe_id);
+ uint32_t ea_mfc, mbox;
+ // send ready message
+ spu_write_out_mbox(SPU_READY);
+
+ while (1) {
+ /* Check mailbox */
+ mbox = spu_read_in_mbox();
+ deprintf("[SPU] Message is %u\n", mbox);
+ switch (mbox) {
+ case SPU_EXIT:
+ deprintf("[SPU] fb_writer goes down...\n");
+ return 0;
+ case SPU_START:
+ break;
+ default:
+ deprintf("[SPU] Cannot handle message\n");
+ continue;
+ }
+
+ /* Tag Manager setup */
+ unsigned int tag_id;
+ tag_id = mfc_multi_tag_reserve(1);
+ if (tag_id == MFC_TAG_INVALID) {
+ deprintf("[SPU] Failed to reserve mfc tags on yuv2rgb_converter\n");
+ return 0;
+ }
+
+ /* DMA transfer for the input parameters */
+ ea_mfc = spu_read_in_mbox();
+ deprintf("[SPU] Message on yuv2rgb_converter is %u\n", ea_mfc);
+ spu_mfcdma32(&parms_converter, (unsigned int)ea_mfc, sizeof(struct yuv2rgb_parms_t), tag_id, MFC_GET_CMD);
+ DMA_WAIT_TAG(tag_id);
+
+ /* There are alignment issues that involve handling of special cases
+ * a width of 32 results in a width of 16 in the chrominance
+ * --> choose the proper handling to optimize the performance
+ */
+ deprintf("[SPU] Convert %ix%i from YUV to RGB\n", parms_converter.src_pixel_width, parms_converter.src_pixel_height);
+ if (parms_converter.src_pixel_width & 0x1f) {
+ deprintf("[SPU] Using yuv_to_rgb_w16\n");
+ yuv_to_rgb_w16();
+ } else {
+ deprintf("[SPU] Using yuv_to_rgb_w32\n");
+ yuv_to_rgb_w32();
+ }
+
+ mfc_multi_tag_release(tag_id, 1);
+ deprintf("[SPU] yuv2rgb_spu... done!\n");
+ /* Send FIN message */
+ spu_write_out_mbox(SPU_FIN);
+ }
+
+ return 0;
+}
+
+
+/*
+ * float_to_char()
+ *
+ * converts a float to a character using saturated
+ * arithmetic
+ *
+ * @param s float for conversion
+ * @returns converted character
+ */
+inline static unsigned char float_to_char(float s) {
+ vector float vec_s = spu_splats(s);
+ vector unsigned int select_1 = spu_cmpgt(vec_0_1, vec_s);
+ vec_s = spu_sel(vec_s, vec_0_1, select_1);
+
+ vector unsigned int select_2 = spu_cmpgt(vec_s, vec_255);
+ vec_s = spu_sel(vec_s, vec_255, select_2);
+ return (unsigned char) spu_extract(vec_s,0);
+}
+
+
+/*
+ * vfloat_to_vuint()
+ *
+ * converts a float vector to an unsinged int vector using saturated
+ * arithmetic
+ *
+ * @param vec_s float vector for conversion
+ * @returns converted unsigned int vector
+ */
+inline static vector unsigned int vfloat_to_vuint(vector float vec_s) {
+ vector unsigned int select_1 = spu_cmpgt(vec_0_1, vec_s);
+ vec_s = spu_sel(vec_s, vec_0_1, select_1);
+
+ vector unsigned int select_2 = spu_cmpgt(vec_s, vec_255);
+ vec_s = spu_sel(vec_s, vec_255, select_2);
+ return spu_convtu(vec_s,0);
+}
+
+
+void yuv_to_rgb_w16() {
+ // Pixel dimensions of the picture
+ uint32_t width, height;
+
+ // Extract parameters
+ width = parms_converter.src_pixel_width;
+ height = parms_converter.src_pixel_height;
+
+ // Plane data management
+ // Y
+ unsigned char* ram_addr_y = parms_converter.y_plane;
+ // V
+ unsigned char* ram_addr_v = parms_converter.v_plane;
+ // U
+ unsigned char* ram_addr_u = parms_converter.u_plane;
+
+ // BGRA
+ unsigned char* ram_addr_bgra = parms_converter.dstBuffer;
+
+ // Strides
+ unsigned int stride_y = width;
+ unsigned int stride_vu = width>>1;
+
+ // Buffer management
+ unsigned int buf_idx = 0;
+ unsigned int size_4lines_y = stride_y<<2;
+ unsigned int size_2lines_y = stride_y<<1;
+ unsigned int size_2lines_vu = stride_vu<<1;
+
+ // 2*width*4byte_per_pixel
+ unsigned int size_2lines_bgra = width<<3;
+
+
+ // start double-buffered processing
+ // 4 lines y
+ spu_mfcdma32(y_plane[buf_idx], (unsigned int) ram_addr_y, size_4lines_y, RETR_BUF+buf_idx, MFC_GET_CMD);
+
+ // 2 lines v
+ spu_mfcdma32(v_plane[buf_idx], (unsigned int) ram_addr_v, size_2lines_vu, RETR_BUF+buf_idx, MFC_GET_CMD);
+
+ // 2 lines u
+ spu_mfcdma32(u_plane[buf_idx], (unsigned int) ram_addr_u, size_2lines_vu, RETR_BUF+buf_idx, MFC_GET_CMD);
+
+ // Wait for these transfers to be completed
+ DMA_WAIT_TAG((RETR_BUF + buf_idx));
+
+ unsigned int i;
+ for(i=0; i<(height>>2)-1; i++) {
+
+ buf_idx^=1;
+
+ // 4 lines y
+ spu_mfcdma32(y_plane[buf_idx], (unsigned int) ram_addr_y+size_4lines_y, size_4lines_y, RETR_BUF+buf_idx, MFC_GET_CMD);
+
+ // 2 lines v
+ spu_mfcdma32(v_plane[buf_idx], (unsigned int) ram_addr_v+size_2lines_vu, size_2lines_vu, RETR_BUF+buf_idx, MFC_GET_CMD);
+
+ // 2 lines u
+ spu_mfcdma32(u_plane[buf_idx], (unsigned int) ram_addr_u+size_2lines_vu, size_2lines_vu, RETR_BUF+buf_idx, MFC_GET_CMD);
+
+ DMA_WAIT_TAG((RETR_BUF + buf_idx));
+
+ buf_idx^=1;
+
+
+ // Convert YUV to BGRA, store it back (first two lines)
+ yuv_to_rgb_w16_line(y_plane[buf_idx], v_plane[buf_idx], u_plane[buf_idx], bgra, width);
+
+ // Next two lines
+ yuv_to_rgb_w16_line(y_plane[buf_idx] + size_2lines_y,
+ v_plane[buf_idx] + stride_vu,
+ u_plane[buf_idx] + stride_vu,
+ bgra + size_2lines_bgra,
+ width);
+
+ // Wait for previous storing transfer to be completed
+ DMA_WAIT_TAG(STR_BUF);
+
+ // Store converted lines in two steps->max transfer size 16384
+ spu_mfcdma32(bgra, (unsigned int) ram_addr_bgra, size_2lines_bgra, STR_BUF, MFC_PUT_CMD);
+ ram_addr_bgra += size_2lines_bgra;
+ spu_mfcdma32(bgra+size_2lines_bgra, (unsigned int) ram_addr_bgra, size_2lines_bgra, STR_BUF, MFC_PUT_CMD);
+ ram_addr_bgra += size_2lines_bgra;
+
+ // Move 4 lines
+ ram_addr_y += size_4lines_y;
+ ram_addr_v += size_2lines_vu;
+ ram_addr_u += size_2lines_vu;
+
+ buf_idx^=1;
+ }
+
+ // Convert YUV to BGRA, store it back (first two lines)
+ yuv_to_rgb_w16_line(y_plane[buf_idx], v_plane[buf_idx], u_plane[buf_idx], bgra, width);
+
+ // Next two lines
+ yuv_to_rgb_w16_line(y_plane[buf_idx] + size_2lines_y,
+ v_plane[buf_idx] + stride_vu,
+ u_plane[buf_idx] + stride_vu,
+ bgra + size_2lines_bgra,
+ width);
+
+ // Wait for previous storing transfer to be completed
+ DMA_WAIT_TAG(STR_BUF);
+ spu_mfcdma32(bgra, (unsigned int) ram_addr_bgra, size_2lines_bgra, STR_BUF, MFC_PUT_CMD);
+ ram_addr_bgra += size_2lines_bgra;
+ spu_mfcdma32(bgra+size_2lines_bgra, (unsigned int) ram_addr_bgra, size_2lines_bgra, STR_BUF, MFC_PUT_CMD);
+
+ // wait for previous storing transfer to be completed
+ DMA_WAIT_TAG(STR_BUF);
+
+}
+
+
+void yuv_to_rgb_w32() {
+ // Pixel dimensions of the picture
+ uint32_t width, height;
+
+ // Extract parameters
+ width = parms_converter.src_pixel_width;
+ height = parms_converter.src_pixel_height;
+
+ // Plane data management
+ // Y
+ unsigned char* ram_addr_y = parms_converter.y_plane;
+ // V
+ unsigned char* ram_addr_v = parms_converter.v_plane;
+ // U
+ unsigned char* ram_addr_u = parms_converter.u_plane;
+
+ // BGRA
+ unsigned char* ram_addr_bgra = parms_converter.dstBuffer;
+
+ // Strides
+ unsigned int stride_y = width;
+ unsigned int stride_vu = width>>1;
+
+ // Buffer management
+ unsigned int buf_idx = 0;
+ unsigned int size_4lines_y = stride_y<<2;
+ unsigned int size_2lines_y = stride_y<<1;
+ unsigned int size_2lines_vu = stride_vu<<1;
+
+ // 2*width*4byte_per_pixel
+ unsigned int size_2lines_bgra = width<<3;
+
+ // start double-buffered processing
+ // 4 lines y
+ spu_mfcdma32(y_plane[buf_idx], (unsigned int) ram_addr_y, size_4lines_y, RETR_BUF + buf_idx, MFC_GET_CMD);
+ // 2 lines v
+ spu_mfcdma32(v_plane[buf_idx], (unsigned int) ram_addr_v, size_2lines_vu, RETR_BUF + buf_idx, MFC_GET_CMD);
+ // 2 lines u
+ spu_mfcdma32(u_plane[buf_idx], (unsigned int) ram_addr_u, size_2lines_vu, RETR_BUF + buf_idx, MFC_GET_CMD);
+
+ // Wait for these transfers to be completed
+ DMA_WAIT_TAG((RETR_BUF + buf_idx));
+
+ unsigned int i;
+ for(i=0; i < (height>>2)-1; i++) {
+ buf_idx^=1;
+ // 4 lines y
+ spu_mfcdma32(y_plane[buf_idx], (unsigned int) ram_addr_y+size_4lines_y, size_4lines_y, RETR_BUF + buf_idx, MFC_GET_CMD);
+ deprintf("4lines = %d\n", size_4lines_y);
+ // 2 lines v
+ spu_mfcdma32(v_plane[buf_idx], (unsigned int) ram_addr_v+size_2lines_vu, size_2lines_vu, RETR_BUF + buf_idx, MFC_GET_CMD);
+ deprintf("2lines = %d\n", size_2lines_vu);
+ // 2 lines u
+ spu_mfcdma32(u_plane[buf_idx], (unsigned int) ram_addr_u+size_2lines_vu, size_2lines_vu, RETR_BUF + buf_idx, MFC_GET_CMD);
+ deprintf("2lines = %d\n", size_2lines_vu);
+
+ DMA_WAIT_TAG((RETR_BUF + buf_idx));
+
+ buf_idx^=1;
+
+ // Convert YUV to BGRA, store it back (first two lines)
+ yuv_to_rgb_w32_line(y_plane[buf_idx], v_plane[buf_idx], u_plane[buf_idx], bgra, width);
+
+ // Next two lines
+ yuv_to_rgb_w32_line(y_plane[buf_idx] + size_2lines_y,
+ v_plane[buf_idx] + stride_vu,
+ u_plane[buf_idx] + stride_vu,
+ bgra + size_2lines_bgra,
+ width);
+
+ // Wait for previous storing transfer to be completed
+ DMA_WAIT_TAG(STR_BUF);
+
+ // Store converted lines in two steps->max transfer size 16384
+ spu_mfcdma32(bgra, (unsigned int)ram_addr_bgra, size_2lines_bgra, STR_BUF, MFC_PUT_CMD);
+ ram_addr_bgra += size_2lines_bgra;
+ spu_mfcdma32(bgra + size_2lines_bgra, (unsigned int)ram_addr_bgra, size_2lines_bgra, STR_BUF, MFC_PUT_CMD);
+ ram_addr_bgra += size_2lines_bgra;
+
+ // Move 4 lines
+ ram_addr_y += size_4lines_y;
+ ram_addr_v += size_2lines_vu;
+ ram_addr_u += size_2lines_vu;
+
+ buf_idx^=1;
+ }
+
+ // Convert YUV to BGRA, store it back (first two lines)
+ yuv_to_rgb_w32_line(y_plane[buf_idx], v_plane[buf_idx], u_plane[buf_idx], bgra, width);
+
+ // Next two lines
+ yuv_to_rgb_w32_line(y_plane[buf_idx] + size_2lines_y,
+ v_plane[buf_idx] + stride_vu,
+ u_plane[buf_idx] + stride_vu,
+ bgra + size_2lines_bgra,
+ width);
+
+ // Wait for previous storing transfer to be completed
+ DMA_WAIT_TAG(STR_BUF);
+ spu_mfcdma32(bgra, (unsigned int) ram_addr_bgra, size_2lines_bgra, STR_BUF, MFC_PUT_CMD);
+ ram_addr_bgra += size_2lines_bgra;
+ spu_mfcdma32(bgra + size_2lines_bgra, (unsigned int) ram_addr_bgra, size_2lines_bgra, STR_BUF, MFC_PUT_CMD);
+
+ // Wait for previous storing transfer to be completed
+ DMA_WAIT_TAG(STR_BUF);
+}
+
+
+/* Some vectors needed by the yuv 2 rgb conversion algorithm */
+const vector float vec_minus_128 = { -128.0f, -128.0f, -128.0f, -128.0f };
+const vector unsigned char vec_null = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+const vector unsigned char vec_char2int_first = { 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x13 };
+const vector unsigned char vec_char2int_second = { 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x17 };
+const vector unsigned char vec_char2int_third = { 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x1B };
+const vector unsigned char vec_char2int_fourth = { 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x1F };
+
+const vector float vec_R_precalc_coeff = {1.403f, 1.403f, 1.403f, 1.403f};
+const vector float vec_Gu_precalc_coeff = {-0.344f, -0.344f, -0.344f, -0.344f};
+const vector float vec_Gv_precalc_coeff = {-0.714f, -0.714f, -0.714f, -0.714f};
+const vector float vec_B_precalc_coeff = {1.773f, 1.773f, 1.773f, 1.773f};
+
+const vector unsigned int vec_alpha = { 255 << 24, 255 << 24, 255 << 24, 255 << 24 };
+
+const vector unsigned char vec_select_floats_upper = { 0x00, 0x01, 0x02, 0x03, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x04, 0x05, 0x06, 0x07 };
+const vector unsigned char vec_select_floats_lower = { 0x08, 0x09, 0x0A, 0x0B, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x0C, 0x0D, 0x0E, 0x0F };
+
+
+/*
+ * yuv_to_rgb_w16()
+ *
+ * processes to line of yuv-input, width has to be a multiple of 16
+ * two lines of yuv are taken as input
+ *
+ * @param y_addr address of the y plane in local store
+ * @param v_addr address of the v plane in local store
+ * @param u_addr address of the u plane in local store
+ * @param bgra_addr_ address of the bgra output buffer
+ * @param width the width in pixel
+ */
+void yuv_to_rgb_w16_line(unsigned char* y_addr, unsigned char* v_addr, unsigned char* u_addr, unsigned char* bgra_addr_, unsigned int width) {
+ // each pixel is stored as an integer
+ unsigned int* bgra_addr = (unsigned int*) bgra_addr_;
+
+ unsigned int x;
+ for(x = 0; x < width; x+=2) {
+ // Gehe zweischrittig durch die zeile, da jeder u und v wert fuer 4 pixel(zwei hoch, zwei breit) gilt
+ const unsigned char Y_1 = *(y_addr + x);
+ const unsigned char Y_2 = *(y_addr + x + 1);
+ const unsigned char Y_3 = *(y_addr + x + width);
+ const unsigned char Y_4 = *(y_addr + x + width + 1);
+ const unsigned char U = *(u_addr + (x >> 1));
+ const unsigned char V = *(v_addr + (x >> 1));
+
+ float V_minus_128 = (float)((float)V - 128.0f);
+ float U_minus_128 = (float)((float)U - 128.0f);
+
+ float R_precalculate = 1.403f * V_minus_128;
+ float G_precalculate = -(0.344f * U_minus_128 + 0.714f * V_minus_128);
+ float B_precalculate = 1.773f * U_minus_128;
+
+ const unsigned char R_1 = float_to_char((Y_1 + R_precalculate));
+ const unsigned char R_2 = float_to_char((Y_2 + R_precalculate));
+ const unsigned char R_3 = float_to_char((Y_3 + R_precalculate));
+ const unsigned char R_4 = float_to_char((Y_4 + R_precalculate));
+ const unsigned char G_1 = float_to_char((Y_1 + G_precalculate));
+ const unsigned char G_2 = float_to_char((Y_2 + G_precalculate));
+ const unsigned char G_3 = float_to_char((Y_3 + G_precalculate));
+ const unsigned char G_4 = float_to_char((Y_4 + G_precalculate));
+ const unsigned char B_1 = float_to_char((Y_1 + B_precalculate));
+ const unsigned char B_2 = float_to_char((Y_2 + B_precalculate));
+ const unsigned char B_3 = float_to_char((Y_3 + B_precalculate));
+ const unsigned char B_4 = float_to_char((Y_4 + B_precalculate));
+
+ *(bgra_addr + x) = (B_1 << 0)| (G_1 << 8) | (R_1 << 16) | (255 << 24);
+ *(bgra_addr + x + 1) = (B_2 << 0)| (G_2 << 8) | (R_2 << 16) | (255 << 24);
+ *(bgra_addr + x + width) = (B_3 << 0)| (G_3 << 8) | (R_3 << 16) | (255 << 24);
+ *(bgra_addr + x + width + 1) = (B_4 << 0)| (G_4 << 8) | (R_4 << 16) | (255 << 24);
+ }
+}
+
+
+/*
+ * yuv_to_rgb_w32()
+ *
+ * processes to line of yuv-input, width has to be a multiple of 32
+ * two lines of yuv are taken as input
+ *
+ * @param y_addr address of the y plane in local store
+ * @param v_addr address of the v plane in local store
+ * @param u_addr address of the u plane in local store
+ * @param bgra_addr_ address of the bgra output buffer
+ * @param width the width in pixel
+ */
+void yuv_to_rgb_w32_line(unsigned char* y_addr, unsigned char* v_addr, unsigned char* u_addr, unsigned char* bgra_addr_, unsigned int width) {
+ // each pixel is stored as an integer
+ unsigned int* bgra_addr = (unsigned int*) bgra_addr_;
+
+ unsigned int x;
+ for(x = 0; x < width; x+=32) {
+ // Gehe zweischrittig durch die zeile, da jeder u und v wert fuer 4 pixel(zwei hoch, zwei breit) gilt
+
+ const vector unsigned char vchar_Y_1 = *((vector unsigned char*)(y_addr + x));
+ const vector unsigned char vchar_Y_2 = *((vector unsigned char*)(y_addr + x + 16));
+ const vector unsigned char vchar_Y_3 = *((vector unsigned char*)(y_addr + x + width));
+ const vector unsigned char vchar_Y_4 = *((vector unsigned char*)(y_addr + x + width + 16));
+ const vector unsigned char vchar_U = *((vector unsigned char*)(u_addr + (x >> 1)));
+ const vector unsigned char vchar_V = *((vector unsigned char*)(v_addr + (x >> 1)));
+
+ const vector float vfloat_U_1 = spu_add(spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_U, vec_char2int_first), 0),vec_minus_128);
+ const vector float vfloat_U_2 = spu_add(spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_U, vec_char2int_second), 0),vec_minus_128);
+ const vector float vfloat_U_3 = spu_add(spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_U, vec_char2int_third), 0),vec_minus_128);
+ const vector float vfloat_U_4 = spu_add(spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_U, vec_char2int_fourth), 0),vec_minus_128);
+
+ const vector float vfloat_V_1 = spu_add(spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_V, vec_char2int_first), 0),vec_minus_128);
+ const vector float vfloat_V_2 = spu_add(spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_V, vec_char2int_second), 0),vec_minus_128);
+ const vector float vfloat_V_3 = spu_add(spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_V, vec_char2int_third), 0),vec_minus_128);
+ const vector float vfloat_V_4 = spu_add(spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_V, vec_char2int_fourth), 0),vec_minus_128);
+
+ vector float Y_1 = spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_Y_1, vec_char2int_first), 0);
+ vector float Y_2 = spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_Y_1, vec_char2int_second), 0);
+ vector float Y_3 = spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_Y_1, vec_char2int_third), 0);
+ vector float Y_4 = spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_Y_1, vec_char2int_fourth), 0);
+ vector float Y_5 = spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_Y_2, vec_char2int_first), 0);
+ vector float Y_6 = spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_Y_2, vec_char2int_second), 0);
+ vector float Y_7 = spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_Y_2, vec_char2int_third), 0);
+ vector float Y_8 = spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_Y_2, vec_char2int_fourth), 0);
+ vector float Y_9 = spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_Y_3, vec_char2int_first), 0);
+ vector float Y_10 = spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_Y_3, vec_char2int_second), 0);
+ vector float Y_11 = spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_Y_3, vec_char2int_third), 0);
+ vector float Y_12 = spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_Y_3, vec_char2int_fourth), 0);
+ vector float Y_13 = spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_Y_4, vec_char2int_first), 0);
+ vector float Y_14 = spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_Y_4, vec_char2int_second), 0);
+ vector float Y_15 = spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_Y_4, vec_char2int_third), 0);
+ vector float Y_16 = spu_convtf((vector unsigned int)spu_shuffle(vec_null, vchar_Y_4, vec_char2int_fourth), 0);
+
+ const vector float R1a_precalculate = spu_mul(vec_R_precalc_coeff, vfloat_V_1);
+ const vector float R2a_precalculate = spu_mul(vec_R_precalc_coeff, vfloat_V_2);
+ const vector float R3a_precalculate = spu_mul(vec_R_precalc_coeff, vfloat_V_3);
+ const vector float R4a_precalculate = spu_mul(vec_R_precalc_coeff, vfloat_V_4);
+
+ const vector float R1_precalculate = spu_shuffle(R1a_precalculate, R1a_precalculate, vec_select_floats_upper);
+ const vector float R2_precalculate = spu_shuffle(R1a_precalculate, R1a_precalculate, vec_select_floats_lower);
+ const vector float R3_precalculate = spu_shuffle(R2a_precalculate, R2a_precalculate, vec_select_floats_upper);
+ const vector float R4_precalculate = spu_shuffle(R2a_precalculate, R2a_precalculate, vec_select_floats_lower);
+ const vector float R5_precalculate = spu_shuffle(R3a_precalculate, R3a_precalculate, vec_select_floats_upper);
+ const vector float R6_precalculate = spu_shuffle(R3a_precalculate, R3a_precalculate, vec_select_floats_lower);
+ const vector float R7_precalculate = spu_shuffle(R4a_precalculate, R4a_precalculate, vec_select_floats_upper);
+ const vector float R8_precalculate = spu_shuffle(R4a_precalculate, R4a_precalculate, vec_select_floats_lower);
+
+
+ const vector float G1a_precalculate = spu_madd(vec_Gu_precalc_coeff, vfloat_U_1, spu_mul(vfloat_V_1, vec_Gv_precalc_coeff));
+ const vector float G2a_precalculate = spu_madd(vec_Gu_precalc_coeff, vfloat_U_2, spu_mul(vfloat_V_2, vec_Gv_precalc_coeff));
+ const vector float G3a_precalculate = spu_madd(vec_Gu_precalc_coeff, vfloat_U_3, spu_mul(vfloat_V_3, vec_Gv_precalc_coeff));
+ const vector float G4a_precalculate = spu_madd(vec_Gu_precalc_coeff, vfloat_U_4, spu_mul(vfloat_V_4, vec_Gv_precalc_coeff));
+
+ const vector float G1_precalculate = spu_shuffle(G1a_precalculate, G1a_precalculate, vec_select_floats_upper);
+ const vector float G2_precalculate = spu_shuffle(G1a_precalculate, G1a_precalculate, vec_select_floats_lower);
+ const vector float G3_precalculate = spu_shuffle(G2a_precalculate, G2a_precalculate, vec_select_floats_upper);
+ const vector float G4_precalculate = spu_shuffle(G2a_precalculate, G2a_precalculate, vec_select_floats_lower);
+ const vector float G5_precalculate = spu_shuffle(G3a_precalculate, G3a_precalculate, vec_select_floats_upper);
+ const vector float G6_precalculate = spu_shuffle(G3a_precalculate, G3a_precalculate, vec_select_floats_lower);
+ const vector float G7_precalculate = spu_shuffle(G4a_precalculate, G4a_precalculate, vec_select_floats_upper);
+ const vector float G8_precalculate = spu_shuffle(G4a_precalculate, G4a_precalculate, vec_select_floats_lower);
+
+
+ const vector float B1a_precalculate = spu_mul(vec_B_precalc_coeff, vfloat_U_1);
+ const vector float B2a_precalculate = spu_mul(vec_B_precalc_coeff, vfloat_U_2);
+ const vector float B3a_precalculate = spu_mul(vec_B_precalc_coeff, vfloat_U_3);
+ const vector float B4a_precalculate = spu_mul(vec_B_precalc_coeff, vfloat_U_4);
+
+ const vector float B1_precalculate = spu_shuffle(B1a_precalculate, B1a_precalculate, vec_select_floats_upper);
+ const vector float B2_precalculate = spu_shuffle(B1a_precalculate, B1a_precalculate, vec_select_floats_lower);
+ const vector float B3_precalculate = spu_shuffle(B2a_precalculate, B2a_precalculate, vec_select_floats_upper);
+ const vector float B4_precalculate = spu_shuffle(B2a_precalculate, B2a_precalculate, vec_select_floats_lower);
+ const vector float B5_precalculate = spu_shuffle(B3a_precalculate, B3a_precalculate, vec_select_floats_upper);
+ const vector float B6_precalculate = spu_shuffle(B3a_precalculate, B3a_precalculate, vec_select_floats_lower);
+ const vector float B7_precalculate = spu_shuffle(B4a_precalculate, B4a_precalculate, vec_select_floats_upper);
+ const vector float B8_precalculate = spu_shuffle(B4a_precalculate, B4a_precalculate, vec_select_floats_lower);
+
+
+ const vector unsigned int R_1 = vfloat_to_vuint(spu_add( Y_1, R1_precalculate));
+ const vector unsigned int R_2 = vfloat_to_vuint(spu_add( Y_2, R2_precalculate));
+ const vector unsigned int R_3 = vfloat_to_vuint(spu_add( Y_3, R3_precalculate));
+ const vector unsigned int R_4 = vfloat_to_vuint(spu_add( Y_4, R4_precalculate));
+ const vector unsigned int R_5 = vfloat_to_vuint(spu_add( Y_5, R5_precalculate));
+ const vector unsigned int R_6 = vfloat_to_vuint(spu_add( Y_6, R6_precalculate));
+ const vector unsigned int R_7 = vfloat_to_vuint(spu_add( Y_7, R7_precalculate));
+ const vector unsigned int R_8 = vfloat_to_vuint(spu_add( Y_8, R8_precalculate));
+ const vector unsigned int R_9 = vfloat_to_vuint(spu_add( Y_9, R1_precalculate));
+ const vector unsigned int R_10 = vfloat_to_vuint(spu_add(Y_10, R2_precalculate));
+ const vector unsigned int R_11 = vfloat_to_vuint(spu_add(Y_11, R3_precalculate));
+ const vector unsigned int R_12 = vfloat_to_vuint(spu_add(Y_12, R4_precalculate));
+ const vector unsigned int R_13 = vfloat_to_vuint(spu_add(Y_13, R5_precalculate));
+ const vector unsigned int R_14 = vfloat_to_vuint(spu_add(Y_14, R6_precalculate));
+ const vector unsigned int R_15 = vfloat_to_vuint(spu_add(Y_15, R7_precalculate));
+ const vector unsigned int R_16 = vfloat_to_vuint(spu_add(Y_16, R8_precalculate));
+
+ const vector unsigned int G_1 = vfloat_to_vuint(spu_add( Y_1, G1_precalculate));
+ const vector unsigned int G_2 = vfloat_to_vuint(spu_add( Y_2, G2_precalculate));
+ const vector unsigned int G_3 = vfloat_to_vuint(spu_add( Y_3, G3_precalculate));
+ const vector unsigned int G_4 = vfloat_to_vuint(spu_add( Y_4, G4_precalculate));
+ const vector unsigned int G_5 = vfloat_to_vuint(spu_add( Y_5, G5_precalculate));
+ const vector unsigned int G_6 = vfloat_to_vuint(spu_add( Y_6, G6_precalculate));
+ const vector unsigned int G_7 = vfloat_to_vuint(spu_add( Y_7, G7_precalculate));
+ const vector unsigned int G_8 = vfloat_to_vuint(spu_add( Y_8, G8_precalculate));
+ const vector unsigned int G_9 = vfloat_to_vuint(spu_add( Y_9, G1_precalculate));
+ const vector unsigned int G_10 = vfloat_to_vuint(spu_add(Y_10, G2_precalculate));
+ const vector unsigned int G_11 = vfloat_to_vuint(spu_add(Y_11, G3_precalculate));
+ const vector unsigned int G_12 = vfloat_to_vuint(spu_add(Y_12, G4_precalculate));
+ const vector unsigned int G_13 = vfloat_to_vuint(spu_add(Y_13, G5_precalculate));
+ const vector unsigned int G_14 = vfloat_to_vuint(spu_add(Y_14, G6_precalculate));
+ const vector unsigned int G_15 = vfloat_to_vuint(spu_add(Y_15, G7_precalculate));
+ const vector unsigned int G_16 = vfloat_to_vuint(spu_add(Y_16, G8_precalculate));
+
+ const vector unsigned int B_1 = vfloat_to_vuint(spu_add( Y_1, B1_precalculate));
+ const vector unsigned int B_2 = vfloat_to_vuint(spu_add( Y_2, B2_precalculate));
+ const vector unsigned int B_3 = vfloat_to_vuint(spu_add( Y_3, B3_precalculate));
+ const vector unsigned int B_4 = vfloat_to_vuint(spu_add( Y_4, B4_precalculate));
+ const vector unsigned int B_5 = vfloat_to_vuint(spu_add( Y_5, B5_precalculate));
+ const vector unsigned int B_6 = vfloat_to_vuint(spu_add( Y_6, B6_precalculate));
+ const vector unsigned int B_7 = vfloat_to_vuint(spu_add( Y_7, B7_precalculate));
+ const vector unsigned int B_8 = vfloat_to_vuint(spu_add( Y_8, B8_precalculate));
+ const vector unsigned int B_9 = vfloat_to_vuint(spu_add( Y_9, B1_precalculate));
+ const vector unsigned int B_10 = vfloat_to_vuint(spu_add(Y_10, B2_precalculate));
+ const vector unsigned int B_11 = vfloat_to_vuint(spu_add(Y_11, B3_precalculate));
+ const vector unsigned int B_12 = vfloat_to_vuint(spu_add(Y_12, B4_precalculate));
+ const vector unsigned int B_13 = vfloat_to_vuint(spu_add(Y_13, B5_precalculate));
+ const vector unsigned int B_14 = vfloat_to_vuint(spu_add(Y_14, B6_precalculate));
+ const vector unsigned int B_15 = vfloat_to_vuint(spu_add(Y_15, B7_precalculate));
+ const vector unsigned int B_16 = vfloat_to_vuint(spu_add(Y_16, B8_precalculate));
+
+ *((vector unsigned int*)(bgra_addr + x)) = spu_or(spu_or(vec_alpha, B_1), spu_or(spu_slqwbyte( R_1, 2),spu_slqwbyte(G_1, 1)));
+ *((vector unsigned int*)(bgra_addr + x + 4)) = spu_or(spu_or(vec_alpha, B_2), spu_or(spu_slqwbyte( R_2, 2),spu_slqwbyte(G_2, 1)));
+ *((vector unsigned int*)(bgra_addr + x + 8)) = spu_or(spu_or(vec_alpha, B_3), spu_or(spu_slqwbyte( R_3, 2),spu_slqwbyte(G_3, 1)));
+ *((vector unsigned int*)(bgra_addr + x + 12)) = spu_or(spu_or(vec_alpha, B_4), spu_or(spu_slqwbyte( R_4, 2),spu_slqwbyte(G_4, 1)));
+ *((vector unsigned int*)(bgra_addr + x + 16)) = spu_or(spu_or(vec_alpha, B_5), spu_or(spu_slqwbyte( R_5, 2),spu_slqwbyte(G_5, 1)));
+ *((vector unsigned int*)(bgra_addr + x + 20)) = spu_or(spu_or(vec_alpha, B_6), spu_or(spu_slqwbyte( R_6, 2),spu_slqwbyte(G_6, 1)));
+ *((vector unsigned int*)(bgra_addr + x + 24)) = spu_or(spu_or(vec_alpha, B_7), spu_or(spu_slqwbyte( R_7, 2),spu_slqwbyte(G_7, 1)));
+ *((vector unsigned int*)(bgra_addr + x + 28)) = spu_or(spu_or(vec_alpha, B_8), spu_or(spu_slqwbyte( R_8, 2),spu_slqwbyte(G_8, 1)));
+ *((vector unsigned int*)(bgra_addr + x + width)) = spu_or(spu_or(vec_alpha, B_9), spu_or(spu_slqwbyte( R_9, 2),spu_slqwbyte(G_9, 1)));
+ *((vector unsigned int*)(bgra_addr + x + width + 4)) = spu_or(spu_or(vec_alpha, B_10), spu_or(spu_slqwbyte(R_10, 2),spu_slqwbyte(G_10, 1)));
+ *((vector unsigned int*)(bgra_addr + x + width + 8)) = spu_or(spu_or(vec_alpha, B_11), spu_or(spu_slqwbyte(R_11, 2),spu_slqwbyte(G_11, 1)));
+ *((vector unsigned int*)(bgra_addr + x + width + 12)) = spu_or(spu_or(vec_alpha, B_12), spu_or(spu_slqwbyte(R_12, 2),spu_slqwbyte(G_12, 1)));
+ *((vector unsigned int*)(bgra_addr + x + width + 16)) = spu_or(spu_or(vec_alpha, B_13), spu_or(spu_slqwbyte(R_13, 2),spu_slqwbyte(G_13, 1)));
+ *((vector unsigned int*)(bgra_addr + x + width + 20)) = spu_or(spu_or(vec_alpha, B_14), spu_or(spu_slqwbyte(R_14, 2),spu_slqwbyte(G_14, 1)));
+ *((vector unsigned int*)(bgra_addr + x + width + 24)) = spu_or(spu_or(vec_alpha, B_15), spu_or(spu_slqwbyte(R_15, 2),spu_slqwbyte(G_15, 1)));
+ *((vector unsigned int*)(bgra_addr + x + width + 28)) = spu_or(spu_or(vec_alpha, B_16), spu_or(spu_slqwbyte(R_16, 2),spu_slqwbyte(G_16, 1)));
+ }
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/qtopia/SDL_QPEApp.cc b/distrib/sdl-1.2.15/src/video/qtopia/SDL_QPEApp.cc
new file mode 100644
index 0000000..8daf1c5
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/qtopia/SDL_QPEApp.cc
@@ -0,0 +1,63 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <qpe/qpeapplication.h>
+#include <qapplication.h>
+#include <qevent.h>
+
+#include "SDL_thread.h"
+#include "SDL_timer.h"
+#include "SDL_error.h"
+
+/* Flag to tell whether or not the Be application is active or not */
+int SDL_QPEAppActive = 0;
+static QPEApplication *app;
+
+int SDL_InitQPEApp() {
+ if(SDL_QPEAppActive <= 0) {
+ if(!qApp) {
+ int argc = 1;
+ char *argv[] = { { "SDLApp" } };
+ app = new QPEApplication(argc, argv);
+ QWidget dummy;
+ app->showMainWidget(&dummy);
+ } else {
+ app = (QPEApplication*)qApp;
+ }
+ SDL_QPEAppActive++;
+ }
+ return 0;
+}
+
+/* Quit the QPE Application, if there's nothing left to do */
+void SDL_QuitQPEApp(void)
+{
+ /* Decrement the application reference count */
+ SDL_QPEAppActive--;
+ /* If the reference count reached zero, clean up the app */
+ if ( SDL_QPEAppActive == 0 && app) {
+ delete app;
+ app = 0;
+ qApp = 0;
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/qtopia/SDL_QPEApp.h b/distrib/sdl-1.2.15/src/video/qtopia/SDL_QPEApp.h
new file mode 100644
index 0000000..8a9ab77
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/qtopia/SDL_QPEApp.h
@@ -0,0 +1,33 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Handle the QPE application loop */
+
+/* Initialize the QPE Application, if it's not already started */
+extern int SDL_InitQPEApp(void);
+
+/* Quit the QPE Application, if there's nothing left to do */
+extern void SDL_QuitQPEApp(void);
+
+/* Flag to tell whether the app is active or not */
+extern int SDL_QPEAppActive;
diff --git a/distrib/sdl-1.2.15/src/video/qtopia/SDL_QWin.cc b/distrib/sdl-1.2.15/src/video/qtopia/SDL_QWin.cc
new file mode 100644
index 0000000..04474ed
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/qtopia/SDL_QWin.cc
@@ -0,0 +1,527 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_QWin.h"
+#include <qapplication.h>
+#include <qdirectpainter_qws.h>
+
+screenRotationT screenRotation = SDL_QT_NO_ROTATION;
+
+SDL_QWin::SDL_QWin(const QSize& size)
+ : QWidget(0, "SDL_main"), my_painter(0), my_image(0),
+ my_inhibit_resize(false), my_mouse_pos(-1,-1), my_flags(0),
+ my_has_fullscreen(false), my_locked(0)
+{
+ setBackgroundMode(NoBackground);
+}
+
+SDL_QWin::~SDL_QWin() {
+ // Nothing to do yet.
+ if(my_image) {
+ delete my_image;
+ }
+}
+
+void SDL_QWin::setImage(QImage *image) {
+ if ( my_image ) {
+ delete my_image;
+ }
+ my_image = image;
+ // setFixedSize(image->size());
+}
+
+void SDL_QWin::resizeEvent(QResizeEvent *e) {
+ if(size() != qApp->desktop()->size()) {
+ // Widget is not the correct size, so do the fullscreen magic
+ my_has_fullscreen = false;
+ enableFullscreen();
+ }
+ if(my_inhibit_resize) {
+ my_inhibit_resize = false;
+ } else {
+ SDL_PrivateResize(e->size().width(), e->size().height());
+ }
+}
+
+void SDL_QWin::focusInEvent(QFocusEvent *) {
+ // Always do it here, no matter the size.
+ enableFullscreen();
+ SDL_PrivateAppActive(true, SDL_APPINPUTFOCUS);
+}
+
+void SDL_QWin::focusOutEvent(QFocusEvent *) {
+ my_has_fullscreen = false;
+ SDL_PrivateAppActive(false, SDL_APPINPUTFOCUS);
+}
+
+void SDL_QWin::closeEvent(QCloseEvent *e) {
+ SDL_PrivateQuit();
+ e->ignore();
+}
+
+void SDL_QWin::setMousePos(const QPoint &pos) {
+ if(my_image->width() == height()) {
+ if (screenRotation == SDL_QT_ROTATION_90)
+ my_mouse_pos = QPoint(height()-pos.y(), pos.x());
+ else if (screenRotation == SDL_QT_ROTATION_270)
+ my_mouse_pos = QPoint(pos.y(), width()-pos.x());
+ } else {
+ my_mouse_pos = pos;
+ }
+}
+
+void SDL_QWin::mouseMoveEvent(QMouseEvent *e) {
+ Qt::ButtonState button = e->button();
+ int sdlstate = 0;
+ if( (button & Qt::LeftButton)) {
+ sdlstate |= SDL_BUTTON_LMASK;
+ }
+ if( (button & Qt::RightButton)) {
+ sdlstate |= SDL_BUTTON_RMASK;
+ }
+ if( (button & Qt::MidButton)) {
+ sdlstate |= SDL_BUTTON_MMASK;
+ }
+ setMousePos(e->pos());
+ SDL_PrivateMouseMotion(sdlstate, 0, my_mouse_pos.x(), my_mouse_pos.y());
+}
+
+void SDL_QWin::mousePressEvent(QMouseEvent *e) {
+ mouseMoveEvent(e);
+ Qt::ButtonState button = e->button();
+ SDL_PrivateMouseButton(SDL_PRESSED,
+ (button & Qt::LeftButton) ? 1 :
+ ((button & Qt::RightButton) ? 2 : 3),
+ my_mouse_pos.x(), my_mouse_pos.y());
+}
+
+void SDL_QWin::mouseReleaseEvent(QMouseEvent *e) {
+ setMousePos(e->pos());
+ Qt::ButtonState button = e->button();
+ SDL_PrivateMouseButton(SDL_RELEASED,
+ (button & Qt::LeftButton) ? 1 :
+ ((button & Qt::RightButton) ? 2 : 3),
+ my_mouse_pos.x(), my_mouse_pos.y());
+ my_mouse_pos = QPoint(-1, -1);
+}
+
+static inline void
+gs_fastRotateBlit_3 ( unsigned short *fb,
+ unsigned short *bits,
+ const QRect& rect )
+{
+ // FIXME: this only works correctly for 240x320 displays
+ int startx, starty;
+ int width, height;
+
+ startx = rect.left() >> 1;
+ starty = rect.top() >> 1;
+ width = ((rect.right() - rect.left()) >> 1) + 2;
+ height = ((rect.bottom() - rect.top()) >> 1) + 2;
+
+ if((startx+width) > 120) {
+ width = 120 - startx; // avoid horizontal overflow
+ }
+ if((starty+height) > 160) {
+ height = 160 - starty; // avoid vertical overflow
+ }
+
+ ulong *sp1, *sp2, *dp1, *dp2;
+ ulong stop, sbot, dtop, dbot;
+
+ sp1 = (ulong*)bits + startx + starty*240;
+ sp2 = sp1 + 120;
+ dp1 = (ulong *)fb + (159 - starty) + startx*320;
+ dp2 = dp1 + 160;
+ int rowadd = (-320*width) - 1;
+ int rowadd2 = 240 - width;
+ // transfer in cells of 2x2 pixels in words
+ for (int y=0; y<height; y++) {
+ for (int x=0; x<width; x++) {
+ // read source pixels
+ stop = *sp1;
+ sbot = *sp2;
+ // rotate pixels
+ dtop = (sbot & 0xffff) + ((stop & 0xffff)<<16);
+ dbot = ((sbot & 0xffff0000)>>16) + (stop & 0xffff0000);
+ // write to framebuffer
+ *dp1 = dtop;
+ *dp2 = dbot;
+ // update source ptrs
+ sp1++; sp2++;
+ // update dest ptrs - 2 pix at a time
+ dp1 += 320;
+ dp2 += 320;
+ }
+ // adjust src ptrs - skip a row as we work in pairs
+ sp1 += rowadd2;
+ sp2 += rowadd2;
+ // adjust dest ptrs for rotation
+ dp1 += rowadd;
+ dp2 += rowadd;
+ }
+}
+
+static inline void
+gs_fastRotateBlit_1 ( unsigned short *fb,
+ unsigned short *bits,
+ const QRect& rect ) {
+ // FIXME: this only works correctly for 240x320 displays
+ int startx, starty;
+ int width, height;
+
+ startx = rect.left() >> 1;
+ starty = rect.top() >> 1;
+ width = ((rect.right() - rect.left()) >> 1) + 2;
+ height = ((rect.bottom() - rect.top()) >> 1) + 2;
+
+ if((startx+width) > 120) {
+ width = 120 - startx; // avoid horizontal overflow
+ }
+ if((starty+height) > 160) {
+ height = 160 - starty; // avoid vertical overflow
+ }
+
+ ulong *sp1, *sp2, *dp1, *dp2;
+ ulong stop, sbot, dtop, dbot;
+ fb += 320*239; // Move "fb" to top left corner
+ sp1 = (ulong*)bits + startx + starty*240;
+ sp2 = sp1 + 120;
+ dp1 = (ulong*)fb - startx * 320 - starty;
+ dp2 = dp1 - 160;
+ int rowadd = (320*width) + 1;
+ int rowadd2 = 240 - width;
+ // transfer in cells of 2x2 pixels in words
+ for (int y=0; y<height; y++) {
+ for (int x=0; x<width; x++) {
+ // read
+ stop = *sp1;
+ sbot = *sp2;
+ // rotate
+ dtop = (stop & 0xffff) + ((sbot & 0xffff)<<16);
+ dbot = ((stop & 0xffff0000)>>16) + (sbot & 0xffff0000);
+ // write
+ *dp1 = dtop;
+ *dp2 = dbot;
+ // update source ptrs
+ sp1++; sp2++;
+ // update dest ptrs - 2 pix at a time
+ dp1 -= 320;
+ dp2 -= 320;
+ }
+ // adjust src ptrs - skip a row as we work in pairs
+ sp1 += rowadd2;
+ sp2 += rowadd2;
+ // adjust dest ptrs for rotation
+ dp1 += rowadd;
+ dp2 += rowadd;
+ }
+}
+
+// desktop, SL-A300 etc
+bool SDL_QWin::repaintRotation0(const QRect& rect) {
+ if(my_image->width() == width()) {
+ uchar *fb = (uchar*)my_painter->frameBuffer();
+ uchar *buf = (uchar*)my_image->bits();
+ if(rect == my_image->rect()) {
+ SDL_memcpy(fb, buf, width()*height()*2);
+ } else {
+ int h = rect.height();
+ int wd = rect.width()<<1;
+ int fblineadd = my_painter->lineStep();
+ int buflineadd = my_image->bytesPerLine();
+ fb += (rect.left()<<1) + rect.top() * my_painter->lineStep();
+ buf += (rect.left()<<1) + rect.top() * my_image->bytesPerLine();
+ while(h--) {
+ SDL_memcpy(fb, buf, wd);
+ fb += fblineadd;
+ buf += buflineadd;
+ }
+ }
+ } else {
+ return false; // FIXME: Landscape
+ }
+#ifdef __i386__
+ my_painter->fillRect( rect, QBrush( Qt::NoBrush ) );
+#endif
+ return true;
+}
+
+
+// Sharp Zaurus SL-5500 etc
+bool SDL_QWin::repaintRotation3(const QRect& rect) {
+ if(my_image->width() == width()) {
+ ushort *fb = (ushort*)my_painter->frameBuffer();
+ ushort *buf = (ushort*)my_image->bits();
+ gs_fastRotateBlit_3(fb, buf, rect);
+ } else {
+ // landscape mode
+ if (screenRotation == SDL_QT_ROTATION_90) {
+ uchar *fb = (uchar*)my_painter->frameBuffer();
+ uchar *buf = (uchar*)my_image->bits();
+ if(rect == my_image->rect()) {
+ SDL_memcpy(fb, buf, width()*height()*2);
+ } else {
+ int h = rect.height();
+ int wd = rect.width()<<1;
+ int fblineadd = my_painter->lineStep();
+ int buflineadd = my_image->bytesPerLine();
+ fb += (rect.left()<<1) + rect.top() * my_painter->lineStep();
+ buf += (rect.left()<<1) + rect.top() * my_image->bytesPerLine();
+ while(h--) {
+ SDL_memcpy(fb, buf, wd);
+ fb += fblineadd;
+ buf += buflineadd;
+ }
+ }
+ } else if (screenRotation == SDL_QT_ROTATION_270) {
+ int h = rect.height();
+ int wd = rect.width();
+ int fblineadd = my_painter->lineStep() - (rect.width() << 1);
+ int buflineadd = my_image->bytesPerLine() - (rect.width() << 1);
+ int w;
+
+ uchar *fb = (uchar*)my_painter->frameBuffer();
+ uchar *buf = (uchar*)my_image->bits();
+
+ fb += ((my_painter->width() - (rect.top() + rect.height())) *
+ my_painter->lineStep()) + ((my_painter->height() - ((rect.left() +
+ rect.width()))) << 1);
+
+ buf += my_image->bytesPerLine() * (rect.top() + rect.height()) -
+ (((my_image->width() - (rect.left() + rect.width())) << 1) + 2);
+
+ while(h--) {
+ w = wd;
+ while(w--) *((unsigned short*)fb)++ = *((unsigned short*)buf)--;
+ fb += fblineadd;
+ buf -= buflineadd;
+ }
+ }
+ }
+ return true;
+}
+
+// ipaq 3800...
+bool SDL_QWin::repaintRotation1(const QRect& rect) {
+ if(my_image->width() == width()) {
+ ushort *fb = (ushort*)my_painter->frameBuffer();
+ ushort *buf = (ushort*)my_image->bits();
+ gs_fastRotateBlit_1(fb, buf, rect);
+ } else {
+ return false; // FIXME: landscape mode
+ }
+ return true;
+}
+
+void SDL_QWin::repaintRect(const QRect& rect) {
+ if(!my_painter || !rect.width() || !rect.height()) {
+ return;
+ }
+
+ if(QPixmap::defaultDepth() == 16) {
+ switch(my_painter->transformOrientation()) {
+ case 3:
+ if(repaintRotation3(rect)) { return; }
+ break;
+ case 1:
+ if(repaintRotation1(rect)) { return; }
+ break;
+ case 0:
+ if(repaintRotation0(rect)) { return; }
+ break;
+ }
+ }
+ my_painter->drawImage(rect.topLeft(), *my_image, rect);
+}
+
+// This paints the current buffer to the screen, when desired.
+void SDL_QWin::paintEvent(QPaintEvent *ev) {
+ if(my_image) {
+ lockScreen(true);
+ repaintRect(ev->rect());
+ unlockScreen();
+ }
+}
+
+/* Function to translate a keyboard transition and queue the key event
+ * This should probably be a table although this method isn't exactly
+ * slow.
+ */
+void SDL_QWin::QueueKey(QKeyEvent *e, int pressed)
+{
+ SDL_keysym keysym;
+ int scancode = e->key();
+ /* Set the keysym information */
+ if(scancode >= 'A' && scancode <= 'Z') {
+ // Qt sends uppercase, SDL wants lowercase
+ keysym.sym = static_cast<SDLKey>(scancode + 32);
+ } else if(scancode >= 0x1000) {
+ // Special keys
+ switch(scancode) {
+ case Qt::Key_Escape: scancode = SDLK_ESCAPE; break;
+ case Qt::Key_Tab: scancode = SDLK_TAB; break;
+ case Qt::Key_Backspace: scancode = SDLK_BACKSPACE; break;
+ case Qt::Key_Return: scancode = SDLK_RETURN; break;
+ case Qt::Key_Enter: scancode = SDLK_KP_ENTER; break;
+ case Qt::Key_Insert: scancode = SDLK_INSERT; break;
+ case Qt::Key_Delete: scancode = SDLK_DELETE; break;
+ case Qt::Key_Pause: scancode = SDLK_PAUSE; break;
+ case Qt::Key_Print: scancode = SDLK_PRINT; break;
+ case Qt::Key_SysReq: scancode = SDLK_SYSREQ; break;
+ case Qt::Key_Home: scancode = SDLK_HOME; break;
+ case Qt::Key_End: scancode = SDLK_END; break;
+ // We want the control keys to rotate with the screen
+ case Qt::Key_Left:
+ if (screenRotation == SDL_QT_ROTATION_90) scancode = SDLK_UP;
+ else if (screenRotation == SDL_QT_ROTATION_270) scancode = SDLK_DOWN;
+ else scancode = SDLK_LEFT;
+ break;
+ case Qt::Key_Up:
+ if (screenRotation == SDL_QT_ROTATION_90) scancode = SDLK_RIGHT;
+ else if (screenRotation == SDL_QT_ROTATION_270) scancode = SDLK_LEFT;
+ else scancode = SDLK_UP;
+ break;
+ case Qt::Key_Right:
+ if (screenRotation == SDL_QT_ROTATION_90) scancode = SDLK_DOWN;
+ else if (screenRotation == SDL_QT_ROTATION_270) scancode = SDLK_UP;
+ else scancode = SDLK_RIGHT;
+ break;
+ case Qt::Key_Down:
+ if (screenRotation == SDL_QT_ROTATION_90) scancode = SDLK_LEFT;
+ else if (screenRotation == SDL_QT_ROTATION_270) scancode = SDLK_RIGHT;
+ else scancode = SDLK_DOWN;
+ break;
+ case Qt::Key_Prior: scancode = SDLK_PAGEUP; break;
+ case Qt::Key_Next: scancode = SDLK_PAGEDOWN; break;
+ case Qt::Key_Shift: scancode = SDLK_LSHIFT; break;
+ case Qt::Key_Control: scancode = SDLK_LCTRL; break;
+ case Qt::Key_Meta: scancode = SDLK_LMETA; break;
+ case Qt::Key_Alt: scancode = SDLK_LALT; break;
+ case Qt::Key_CapsLock: scancode = SDLK_CAPSLOCK; break;
+ case Qt::Key_NumLock: scancode = SDLK_NUMLOCK; break;
+ case Qt::Key_ScrollLock: scancode = SDLK_SCROLLOCK; break;
+ case Qt::Key_F1: scancode = SDLK_F1; break;
+ case Qt::Key_F2: scancode = SDLK_F2; break;
+ case Qt::Key_F3: scancode = SDLK_F3; break;
+ case Qt::Key_F4: scancode = SDLK_F4; break;
+ case Qt::Key_F5: scancode = SDLK_F5; break;
+ case Qt::Key_F6: scancode = SDLK_F6; break;
+ case Qt::Key_F7: scancode = SDLK_F7; break;
+ case Qt::Key_F8: scancode = SDLK_F8; break;
+ case Qt::Key_F9: scancode = SDLK_F9; break;
+ case Qt::Key_F10: scancode = SDLK_F10; break;
+ case Qt::Key_F11: scancode = SDLK_F11; break;
+ case Qt::Key_F12: scancode = SDLK_F12; break;
+ case Qt::Key_F13: scancode = SDLK_F13; break;
+ case Qt::Key_F14: scancode = SDLK_F14; break;
+ case Qt::Key_F15: scancode = SDLK_F15; break;
+ case Qt::Key_Super_L: scancode = SDLK_LSUPER; break;
+ case Qt::Key_Super_R: scancode = SDLK_RSUPER; break;
+ case Qt::Key_Menu: scancode = SDLK_MENU; break;
+ case Qt::Key_Help: scancode = SDLK_HELP; break;
+
+ case Qt::Key_F33:
+ // FIXME: This is a hack to enable the OK key on
+ // Zaurii devices. SDLK_RETURN is a suitable key to use
+ // since it often is used as such.
+ // david@hedbor.org
+ scancode = SDLK_RETURN;
+ break;
+ default:
+ scancode = SDLK_UNKNOWN;
+ break;
+ }
+ keysym.sym = static_cast<SDLKey>(scancode);
+ } else {
+ keysym.sym = static_cast<SDLKey>(scancode);
+ }
+ keysym.scancode = scancode;
+ keysym.mod = KMOD_NONE;
+ ButtonState st = e->state();
+ if( (st & ShiftButton) ) { keysym.mod = static_cast<SDLMod>(keysym.mod | KMOD_LSHIFT); }
+ if( (st & ControlButton) ) { keysym.mod = static_cast<SDLMod>(keysym.mod | KMOD_LCTRL); }
+ if( (st & AltButton) ) { keysym.mod = static_cast<SDLMod>(keysym.mod | KMOD_LALT); }
+ if ( SDL_TranslateUNICODE ) {
+ QChar qchar = e->text()[0];
+ keysym.unicode = qchar.unicode();
+ } else {
+ keysym.unicode = 0;
+ }
+
+ /* NUMLOCK and CAPSLOCK are implemented as double-presses in reality */
+ // if ( (keysym.sym == SDLK_NUMLOCK) || (keysym.sym == SDLK_CAPSLOCK) ) {
+ // pressed = 1;
+ // }
+
+ /* Queue the key event */
+ if ( pressed ) {
+ SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
+ } else {
+ SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
+ }
+}
+
+void SDL_QWin::setFullscreen(bool fs_on) {
+ my_has_fullscreen = false;
+ enableFullscreen();
+}
+
+void SDL_QWin::enableFullscreen() {
+ // Make sure size is correct
+ if(!my_has_fullscreen) {
+ setFixedSize(qApp->desktop()->size());
+ // This call is needed because showFullScreen won't work
+ // correctly if the widget already considers itself to be fullscreen.
+ showNormal();
+ // This is needed because showNormal() forcefully changes the window
+ // style to WSTyle_TopLevel.
+ setWFlags(WStyle_Customize | WStyle_NoBorder);
+ // Enable fullscreen.
+ showFullScreen();
+ my_has_fullscreen = true;
+ }
+}
+
+bool SDL_QWin::lockScreen(bool force) {
+ if(!my_painter) {
+ if(force || (isVisible() && isActiveWindow())) {
+ my_painter = new QDirectPainter(this);
+ } else {
+ return false;
+ }
+ }
+ my_locked++; // Increate lock refcount
+ return true;
+}
+
+void SDL_QWin::unlockScreen() {
+ if(my_locked > 0) {
+ my_locked--; // decrease lock refcount;
+ }
+ if(!my_locked && my_painter) {
+ my_painter->end();
+ delete my_painter;
+ my_painter = 0;
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/qtopia/SDL_QWin.h b/distrib/sdl-1.2.15/src/video/qtopia/SDL_QWin.h
new file mode 100644
index 0000000..2531834
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/qtopia/SDL_QWin.h
@@ -0,0 +1,110 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_QWin_h
+#define _SDL_QWin_h
+
+#include <stdio.h>
+
+#include <qimage.h>
+#include <qpixmap.h>
+#include <qwidget.h>
+#include <qpainter.h>
+#include <qdirectpainter_qws.h>
+
+#include "SDL_events.h"
+
+extern "C" {
+#include "../../events/SDL_events_c.h"
+};
+
+typedef enum {
+ SDL_QT_NO_ROTATION = 0,
+ SDL_QT_ROTATION_90,
+ SDL_QT_ROTATION_270
+} screenRotationT;
+
+extern screenRotationT screenRotation;
+
+class SDL_QWin : public QWidget
+{
+ void QueueKey(QKeyEvent *e, int pressed);
+ public:
+ SDL_QWin(const QSize& size);
+ virtual ~SDL_QWin();
+ virtual bool shown(void) {
+ return isVisible();
+ }
+ /* If called, the next resize event will not be forwarded to SDL. */
+ virtual void inhibitResize(void) {
+ my_inhibit_resize = true;
+ }
+ void setImage(QImage *image);
+ void setOffset(int x, int y) {
+ my_offset = QPoint(x, y);
+ }
+ void GetXYOffset(int &x, int &y) {
+ x = my_offset.x();
+ y = my_offset.y();
+ }
+ QImage *image(void) { return my_image; }
+
+ void setWFlags(WFlags flags) {
+ QWidget::setWFlags(flags);
+ my_flags = flags;
+ }
+ const QPoint& mousePos() const { return my_mouse_pos; }
+ void setMousePos(const QPoint& newpos);
+ void setFullscreen(bool);
+
+ bool lockScreen(bool force=false);
+ void unlockScreen();
+ void repaintRect(const QRect& rect);
+ protected:
+ /* Handle resizing of the window */
+ virtual void resizeEvent(QResizeEvent *e);
+ void focusInEvent(QFocusEvent *);
+ void focusOutEvent(QFocusEvent *);
+ void closeEvent(QCloseEvent *e);
+ void mouseMoveEvent(QMouseEvent *e);
+ void mousePressEvent(QMouseEvent *e);
+ void mouseReleaseEvent(QMouseEvent *e);
+ void paintEvent(QPaintEvent *ev);
+ void keyPressEvent(QKeyEvent *e) { QueueKey(e, 1); }
+ void keyReleaseEvent(QKeyEvent *e) { QueueKey(e, 0); }
+ private:
+ bool repaintRotation0(const QRect& rect);
+ bool repaintRotation1(const QRect& rect);
+ bool repaintRotation3(const QRect& rect);
+ void enableFullscreen();
+ QDirectPainter *my_painter;
+ QImage *my_image;
+ bool my_inhibit_resize;
+ QPoint my_offset;
+ QPoint my_mouse_pos;
+ WFlags my_flags;
+ WFlags my_has_fullscreen;
+ unsigned int my_locked;
+};
+
+#endif /* _SDL_QWin_h */
diff --git a/distrib/sdl-1.2.15/src/video/qtopia/SDL_lowvideo.h b/distrib/sdl-1.2.15/src/video/qtopia/SDL_lowvideo.h
new file mode 100644
index 0000000..1d05c72
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/qtopia/SDL_lowvideo.h
@@ -0,0 +1,65 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_lowvideo_h
+#define _SDL_lowvideo_h
+
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *_this
+
+/* Private display data */
+struct SDL_PrivateVideoData {
+ /* The main window */
+ SDL_QWin *SDL_Win;
+
+ /* The fullscreen mode list */
+#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
+ int SDL_nummodes[NUM_MODELISTS];
+ SDL_Rect **SDL_modelist[NUM_MODELISTS];
+
+ /* A completely clear cursor */
+ WMcursor *BlankCursor;
+
+ /* Mouse state variables */
+ Uint32 last_buttons;
+ QPoint last_point;
+
+ /* Keyboard state variables */
+ int key_flip;
+ //struct key_info keyinfo[2];
+};
+/* Old variable names */
+#define SDL_Win (_this->hidden->SDL_Win)
+#define saved_mode (_this->hidden->saved_mode)
+#define SDL_nummodes (_this->hidden->SDL_nummodes)
+#define SDL_modelist (_this->hidden->SDL_modelist)
+#define SDL_BlankCursor (_this->hidden->BlankCursor)
+#define last_buttons (_this->hidden->last_buttons)
+#define last_point (_this->hidden->last_point)
+#define key_flip (_this->hidden->key_flip)
+#define keyinfo (_this->hidden->keyinfo)
+
+#endif /* _SDL_lowvideo_h */
diff --git a/distrib/sdl-1.2.15/src/video/qtopia/SDL_sysevents.cc b/distrib/sdl-1.2.15/src/video/qtopia/SDL_sysevents.cc
new file mode 100644
index 0000000..4aaf814
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/qtopia/SDL_sysevents.cc
@@ -0,0 +1,269 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <qpe/qpeapplication.h>
+
+#include <stdio.h>
+#include <string.h>
+#include "SDL_error.h"
+#include "SDL_events.h"
+#include "SDL_QWin.h"
+#include "SDL_lowvideo.h"
+#include "SDL_timer.h"
+
+extern "C" {
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_sysevents_c.h"
+
+ // static SDLKey keymap[128];
+/* This is special because we know it will be run in a loop in a separate
+ thread. Normally this function should loop as long as there are input
+ states changing, i.e. new events arriving.
+*/
+void QT_PumpEvents(_THIS)
+{
+ if(!qApp) {
+ return;
+ }
+ // printf("processing events: %p\n", qApp);
+ //qApp->processOneEvent(); // wait for a event
+ qApp->processEvents(); // and process all outstanding ones
+#if 0
+ BView *view;
+ BRect bounds;
+ BPoint point;
+ uint32 buttons;
+ const uint32 button_masks[3] = {
+ B_PRIMARY_MOUSE_BUTTON,
+ B_TERTIARY_MOUSE_BUTTON,
+ B_SECONDARY_MOUSE_BUTTON,
+ };
+ unsigned int i, j;
+
+ /* Check out the mouse buttons and position (slight race condition) */
+ if ( SDL_Win->Lock() ) {
+ /* Don't do anything if we have no view */
+ view = SDL_Win->View();
+ if ( ! view ) {
+ SDL_Win->Unlock();
+ return;
+ }
+ bounds = view->Bounds();
+ /* Get new input state, if still active */
+ if ( SDL_Win->IsActive() ) {
+ key_flip = !key_flip;
+ get_key_info(&keyinfo[key_flip]);
+ view->GetMouse(&point, &buttons, true);
+ } else {
+ key_flip = key_flip;
+ point = last_point;
+ buttons = last_buttons;
+ }
+ SDL_Win->Unlock();
+ } else {
+ return;
+ }
+
+ /* If our view is active, we'll find key changes here */
+ if ( SDL_memcmp(keyinfo[0].key_states, keyinfo[1].key_states, 16) != 0 ) {
+ for ( i=0; i<16; ++i ) {
+ Uint8 new_state, transition;
+
+ new_state = keyinfo[key_flip].key_states[i];
+ transition = keyinfo[!key_flip].key_states[i] ^
+ keyinfo[ key_flip].key_states[i];
+ for ( j=0; j<8; ++j ) {
+ if ( transition&0x80 )
+ QueueKey(i*8+j, new_state&0x80);
+ transition <<= 1;
+ new_state <<= 1;
+ }
+ }
+ }
+
+ /* We check keyboard, but not mouse if mouse isn't in window */
+ if ( ! bounds.Contains(point) ) {
+ /* Mouse moved outside our view? */
+ if ( SDL_GetAppState() & SDL_APPMOUSEFOCUS ) {
+ SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
+ be_app->SetCursor(B_HAND_CURSOR);
+ }
+ return;
+ }
+ /* Has the mouse moved back into our view? */
+ if ( ! (SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
+ /* Reset the B_HAND_CURSOR to our own */
+ SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
+ SDL_SetCursor(NULL);
+ }
+
+ /* Check for mouse motion */
+ if ( point != last_point ) {
+ int x, y;
+
+ SDL_Win->GetXYOffset(x, y);
+ x = (int)point.x - x;
+ y = (int)point.y - y;
+ SDL_PrivateMouseMotion(0, 0, x, y);
+ }
+ last_point = point;
+
+ /* Add any mouse button events */
+ for ( i=0; i<SDL_TABLESIZE(button_masks); ++i ) {
+ if ( (buttons ^ last_buttons) & button_masks[i] ) {
+ if ( buttons & button_masks[i] ) {
+ SDL_PrivateMouseButton(SDL_PRESSED, 1+i, 0, 0);
+ } else {
+ SDL_PrivateMouseButton(SDL_RELEASED, 1+i, 0, 0);
+ }
+ }
+ }
+ last_buttons = buttons;
+#endif
+}
+
+void QT_InitOSKeymap(_THIS)
+{
+#if 0
+ unsigned int i;
+
+ /* Initialize all the key states as "up" */
+ key_flip = 0;
+ SDL_memset(keyinfo[key_flip].key_states, 0, 16);
+
+ /* Initialize the key translation table */
+ for ( i=0; i<SDL_TABLESIZE(keymap); ++i )
+ keymap[i] = SDLK_UNKNOWN;
+
+ // keymap[0x01] = SDLK_ESCAPE;
+ // keymap[B_F1_KEY] = SDLK_F1;
+ // keymap[B_F2_KEY] = SDLK_F2;
+ // keymap[B_F3_KEY] = SDLK_F3;
+ // keymap[B_F4_KEY] = SDLK_F4;
+ // keymap[B_F5_KEY] = SDLK_F5;
+ // keymap[B_F6_KEY] = SDLK_F6;
+ // keymap[B_F7_KEY] = SDLK_F7;
+ // keymap[B_F8_KEY] = SDLK_F8;
+ // keymap[B_F9_KEY] = SDLK_F9;
+ // keymap[B_F10_KEY] = SDLK_F10;
+ // keymap[B_F11_KEY] = SDLK_F11;
+ // keymap[B_F12_KEY] = SDLK_F12;
+ // keymap[B_PRINT_KEY] = SDLK_PRINT;
+ //keymap[B_SCROLL_KEY] = SDLK_SCROLLOCK;
+ // keymap[B_PAUSE_KEY] = SDLK_PAUSE;
+ keymap[0x11] = SDLK_BACKQUOTE;
+ keymap[0x12] = SDLK_1;
+ keymap[0x13] = SDLK_2;
+ keymap[0x14] = SDLK_3;
+ keymap[0x15] = SDLK_4;
+ keymap[0x16] = SDLK_5;
+ keymap[0x17] = SDLK_6;
+ keymap[0x18] = SDLK_7;
+ keymap[0x19] = SDLK_8;
+ keymap[0x1a] = SDLK_9;
+ keymap[0x1b] = SDLK_0;
+ keymap[0x1c] = SDLK_MINUS;
+ keymap[0x1d] = SDLK_EQUALS;
+ keymap[0x1e] = SDLK_BACKSPACE;
+ keymap[0x1f] = SDLK_INSERT;
+ keymap[0x20] = SDLK_HOME;
+ keymap[0x21] = SDLK_PAGEUP;
+ //keymap[0x22] = SDLK_NUMLOCK;
+ keymap[0x23] = SDLK_KP_DIVIDE;
+ keymap[0x24] = SDLK_KP_MULTIPLY;
+ keymap[0x25] = SDLK_KP_MINUS;
+ keymap[0x26] = SDLK_TAB;
+ keymap[0x27] = SDLK_q;
+ keymap[0x28] = SDLK_w;
+ keymap[0x29] = SDLK_e;
+ keymap[0x2a] = SDLK_r;
+ keymap[0x2b] = SDLK_t;
+ keymap[0x2c] = SDLK_y;
+ keymap[0x2d] = SDLK_u;
+ keymap[0x2e] = SDLK_i;
+ keymap[0x2f] = SDLK_o;
+ keymap[0x30] = SDLK_p;
+ keymap[0x31] = SDLK_LEFTBRACKET;
+ keymap[0x32] = SDLK_RIGHTBRACKET;
+ keymap[0x33] = SDLK_BACKSLASH;
+ keymap[0x34] = SDLK_DELETE;
+ keymap[0x35] = SDLK_END;
+ keymap[0x36] = SDLK_PAGEDOWN;
+ keymap[0x37] = SDLK_KP7;
+ keymap[0x38] = SDLK_KP8;
+ keymap[0x39] = SDLK_KP9;
+ keymap[0x3a] = SDLK_KP_PLUS;
+ //keymap[0x3b] = SDLK_CAPSLOCK;
+ keymap[0x3c] = SDLK_a;
+ keymap[0x3d] = SDLK_s;
+ keymap[0x3e] = SDLK_d;
+ keymap[0x3f] = SDLK_f;
+ keymap[0x40] = SDLK_g;
+ keymap[0x41] = SDLK_h;
+ keymap[0x42] = SDLK_j;
+ keymap[0x43] = SDLK_k;
+ keymap[0x44] = SDLK_l;
+ keymap[0x45] = SDLK_SEMICOLON;
+ keymap[0x46] = SDLK_QUOTE;
+ keymap[0x47] = SDLK_RETURN;
+ keymap[0x48] = SDLK_KP4;
+ keymap[0x49] = SDLK_KP5;
+ keymap[0x4a] = SDLK_KP6;
+ keymap[0x4b] = SDLK_LSHIFT;
+ keymap[0x4c] = SDLK_z;
+ keymap[0x4d] = SDLK_x;
+ keymap[0x4e] = SDLK_c;
+ keymap[0x4f] = SDLK_v;
+ keymap[0x50] = SDLK_b;
+ keymap[0x51] = SDLK_n;
+ keymap[0x52] = SDLK_m;
+ keymap[0x53] = SDLK_COMMA;
+ keymap[0x54] = SDLK_PERIOD;
+ keymap[0x55] = SDLK_SLASH;
+ keymap[0x56] = SDLK_RSHIFT;
+ keymap[0x57] = SDLK_UP;
+ keymap[0x58] = SDLK_KP1;
+ keymap[0x59] = SDLK_KP2;
+ keymap[0x5a] = SDLK_KP3;
+ keymap[0x5b] = SDLK_KP_ENTER;
+ //keymap[0x5c] = SDLK_LCTRL;
+ //keymap[0x5d] = SDLK_LALT;
+ keymap[0x5e] = SDLK_SPACE;
+ //keymap[0x5f] = SDLK_RALT;
+ //keymap[0x60] = SDLK_RCTRL;
+ keymap[0x61] = SDLK_LEFT;
+ keymap[0x62] = SDLK_DOWN;
+ keymap[0x63] = SDLK_RIGHT;
+ keymap[0x64] = SDLK_KP0;
+ keymap[0x65] = SDLK_KP_PERIOD;
+ //keymap[0x66] = SDLK_LMETA;
+ //keymap[0x67] = SDLK_RMETA;
+ //keymap[0x68] = SDLK_MENU;
+ keymap[0x69] = SDLK_EURO;
+ keymap[0x6a] = SDLK_KP_EQUALS;
+ keymap[0x6b] = SDLK_POWER;
+#endif
+}
+
+}; /* Extern C */
diff --git a/distrib/sdl-1.2.15/src/video/qtopia/SDL_sysevents_c.h b/distrib/sdl-1.2.15/src/video/qtopia/SDL_sysevents_c.h
new file mode 100644
index 0000000..5e26759
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/qtopia/SDL_sysevents_c.h
@@ -0,0 +1,31 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_lowvideo.h"
+
+/* Variables and functions exported by SDL_sysevents.c to other parts
+ of the native video subsystem (SDL_sysvideo.c)
+*/
+
+extern void QT_InitOSKeymap(_THIS);
+extern void QT_PumpEvents(_THIS);
diff --git a/distrib/sdl-1.2.15/src/video/qtopia/SDL_sysmouse.cc b/distrib/sdl-1.2.15/src/video/qtopia/SDL_sysmouse.cc
new file mode 100644
index 0000000..1a655b6
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/qtopia/SDL_sysmouse.cc
@@ -0,0 +1,56 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_QWin.h"
+
+extern "C" {
+
+#include "SDL_sysmouse_c.h"
+
+/* The implementation dependent data for the window manager cursor */
+struct WMcursor {
+ char *bits;
+};
+WMcursor *QT_CreateWMCursor(_THIS,
+ Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
+{
+ static WMcursor dummy;
+ dummy.bits = 0;
+ return &dummy;
+}
+
+int QT_ShowWMCursor(_THIS, WMcursor *cursor)
+{
+ return 1;
+}
+
+void QT_FreeWMCursor(_THIS, WMcursor *cursor)
+{
+}
+
+void QT_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
+{
+ SDL_Win->setMousePos(QPoint(x, y));
+}
+
+}; /* Extern C */
diff --git a/distrib/sdl-1.2.15/src/video/qtopia/SDL_sysmouse_c.h b/distrib/sdl-1.2.15/src/video/qtopia/SDL_sysmouse_c.h
new file mode 100644
index 0000000..98e4cf5
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/qtopia/SDL_sysmouse_c.h
@@ -0,0 +1,32 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_lowvideo.h"
+
+/* Functions to be exported */
+extern void QT_FreeWMCursor(_THIS, WMcursor *cursor);
+extern WMcursor *QT_CreateWMCursor(_THIS,
+ Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
+extern int QT_ShowWMCursor(_THIS, WMcursor *cursor);
+extern void QT_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
+
diff --git a/distrib/sdl-1.2.15/src/video/qtopia/SDL_sysvideo.cc b/distrib/sdl-1.2.15/src/video/qtopia/SDL_sysvideo.cc
new file mode 100644
index 0000000..0e07874
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/qtopia/SDL_sysvideo.cc
@@ -0,0 +1,403 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Qtopia based framebuffer implementation */
+
+#include <unistd.h>
+
+#include <qapplication.h>
+#include <qpe/qpeapplication.h>
+
+#include "SDL_timer.h"
+
+#include "SDL_QWin.h"
+
+extern "C" {
+
+#include "../SDL_sysvideo.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_sysevents_c.h"
+#include "SDL_sysmouse_c.h"
+#include "SDL_syswm_c.h"
+#include "SDL_lowvideo.h"
+
+ //#define QTOPIA_DEBUG
+#define QT_HIDDEN_SIZE 32 /* starting hidden window size */
+
+ /* Name of the environment variable used to invert the screen rotation or not:
+ Possible values:
+ !=0 : Screen is 270° rotated
+ 0: Screen is 90° rotated*/
+#define SDL_QT_ROTATION_ENV_NAME "SDL_QT_INVERT_ROTATION"
+
+ /* Initialization/Query functions */
+ static int QT_VideoInit(_THIS, SDL_PixelFormat *vformat);
+ static SDL_Rect **QT_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+ static SDL_Surface *QT_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+ static void QT_UpdateMouse(_THIS);
+ static int QT_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
+ static void QT_VideoQuit(_THIS);
+
+ /* Hardware surface functions */
+ static int QT_AllocHWSurface(_THIS, SDL_Surface *surface);
+ static int QT_LockHWSurface(_THIS, SDL_Surface *surface);
+ static void QT_UnlockHWSurface(_THIS, SDL_Surface *surface);
+ static void QT_FreeHWSurface(_THIS, SDL_Surface *surface);
+
+ static int QT_ToggleFullScreen(_THIS, int fullscreen);
+
+ static int QT_IconifyWindow(_THIS);
+ static SDL_GrabMode QT_GrabInput(_THIS, SDL_GrabMode mode);
+
+ /* FB driver bootstrap functions */
+
+ static int QT_Available(void)
+ {
+ return(1);
+ }
+
+ static void QT_DeleteDevice(SDL_VideoDevice *device)
+ {
+ SDL_free(device->hidden);
+ SDL_free(device);
+ }
+
+ static SDL_VideoDevice *QT_CreateDevice(int devindex)
+ {
+ SDL_VideoDevice *device;
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *device->hidden));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( device ) {
+ SDL_free(device);
+ }
+ return(0);
+ }
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+
+ /* Set the function pointers */
+ device->VideoInit = QT_VideoInit;
+ device->ListModes = QT_ListModes;
+ device->SetVideoMode = QT_SetVideoMode;
+ device->UpdateMouse = QT_UpdateMouse;
+ device->SetColors = QT_SetColors;
+ device->UpdateRects = NULL;
+ device->VideoQuit = QT_VideoQuit;
+ device->AllocHWSurface = QT_AllocHWSurface;
+ device->CheckHWBlit = NULL;
+ device->FillHWRect = NULL;
+ device->SetHWColorKey = NULL;
+ device->SetHWAlpha = NULL;
+ device->LockHWSurface = QT_LockHWSurface;
+ device->UnlockHWSurface = QT_UnlockHWSurface;
+ device->FlipHWSurface = NULL;
+ device->FreeHWSurface = QT_FreeHWSurface;
+ device->SetIcon = NULL;
+ device->SetCaption = QT_SetWMCaption;
+ device->IconifyWindow = QT_IconifyWindow;
+ device->GrabInput = QT_GrabInput;
+ device->GetWMInfo = NULL;
+ device->FreeWMCursor = QT_FreeWMCursor;
+ device->CreateWMCursor = QT_CreateWMCursor;
+ device->ShowWMCursor = QT_ShowWMCursor;
+ device->WarpWMCursor = QT_WarpWMCursor;
+ device->InitOSKeymap = QT_InitOSKeymap;
+ device->PumpEvents = QT_PumpEvents;
+
+ device->free = QT_DeleteDevice;
+ device->ToggleFullScreen = QT_ToggleFullScreen;
+
+ /* Set the driver flags */
+ device->handles_any_size = 0;
+
+ return device;
+ }
+
+ VideoBootStrap Qtopia_bootstrap = {
+ "qtopia", "Qtopia / QPE graphics",
+ QT_Available, QT_CreateDevice
+ };
+
+ /* Function to sort the display_list */
+ static int CompareModes(const void *A, const void *B)
+ {
+#if 0
+ const display_mode *a = (display_mode *)A;
+ const display_mode *b = (display_mode *)B;
+
+ if ( a->space == b->space ) {
+ return((b->virtual_width*b->virtual_height)-
+ (a->virtual_width*a->virtual_height));
+ } else {
+ return(ColorSpaceToBitsPerPixel(b->space)-
+ ColorSpaceToBitsPerPixel(a->space));
+ }
+#endif
+ return 0;
+ }
+
+ /* Yes, this isn't the fastest it could be, but it works nicely */
+ static int QT_AddMode(_THIS, int index, unsigned int w, unsigned int h)
+ {
+ SDL_Rect *mode;
+ int i;
+ int next_mode;
+
+ /* Check to see if we already have this mode */
+ if ( SDL_nummodes[index] > 0 ) {
+ for ( i=SDL_nummodes[index]-1; i >= 0; --i ) {
+ mode = SDL_modelist[index][i];
+ if ( (mode->w == w) && (mode->h == h) ) {
+ return(0);
+ }
+ }
+ }
+
+ /* Set up the new video mode rectangle */
+ mode = (SDL_Rect *)SDL_malloc(sizeof *mode);
+ if ( mode == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ mode->x = 0;
+ mode->y = 0;
+ mode->w = w;
+ mode->h = h;
+#ifdef QTOPIA_DEBUG
+ fprintf(stderr, "Adding mode %dx%d at %d bytes per pixel\n", w, h, index+1);
+#endif
+
+ /* Allocate the new list of modes, and fill in the new mode */
+ next_mode = SDL_nummodes[index];
+ SDL_modelist[index] = (SDL_Rect **)
+ SDL_realloc(SDL_modelist[index], (1+next_mode+1)*sizeof(SDL_Rect *));
+ if ( SDL_modelist[index] == NULL ) {
+ SDL_OutOfMemory();
+ SDL_nummodes[index] = 0;
+ SDL_free(mode);
+ return(-1);
+ }
+ SDL_modelist[index][next_mode] = mode;
+ SDL_modelist[index][next_mode+1] = NULL;
+ SDL_nummodes[index]++;
+
+ return(0);
+ }
+
+ int QT_VideoInit(_THIS, SDL_PixelFormat *vformat)
+ {
+ /* Initialize the QPE Application */
+ /* Determine the screen depth */
+ vformat->BitsPerPixel = QPixmap::defaultDepth();
+
+ // For now we hardcode the current depth because anything else
+ // might as well be emulated by SDL rather than by Qtopia.
+
+ QSize desktop_size = qApp->desktop()->size();
+ QT_AddMode(_this, ((vformat->BitsPerPixel+7)/8)-1,
+ desktop_size.width(), desktop_size.height());
+ QT_AddMode(_this, ((vformat->BitsPerPixel+7)/8)-1,
+ desktop_size.height(), desktop_size.width());
+
+ /* Determine the current screen size */
+ _this->info.current_w = desktop_size.width();
+ _this->info.current_h = desktop_size.height();
+
+ /* Create the window / widget */
+ SDL_Win = new SDL_QWin(QSize(QT_HIDDEN_SIZE, QT_HIDDEN_SIZE));
+ ((QPEApplication*)qApp)->showMainWidget(SDL_Win);
+ /* Fill in some window manager capabilities */
+ _this->info.wm_available = 0;
+
+ /* We're done! */
+ return(0);
+ }
+
+ /* We support any dimension at our bit-depth */
+ SDL_Rect **QT_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+ {
+ SDL_Rect **modes;
+
+ modes = ((SDL_Rect **)0);
+ if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
+ modes = SDL_modelist[((format->BitsPerPixel+7)/8)-1];
+ } else {
+ if ( format->BitsPerPixel ==
+ _this->screen->format->BitsPerPixel ) {
+ modes = ((SDL_Rect **)-1);
+ }
+ }
+ return(modes);
+ }
+
+ /* Various screen update functions available */
+ static void QT_NormalUpdate(_THIS, int numrects, SDL_Rect *rects);
+
+
+ static int QT_SetFullScreen(_THIS, SDL_Surface *screen, int fullscreen)
+ {
+ return -1;
+ }
+
+ static int QT_ToggleFullScreen(_THIS, int fullscreen)
+ {
+ return -1;
+ }
+
+ /* FIXME: check return values and cleanup here */
+ SDL_Surface *QT_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+ {
+
+ QImage *qimage;
+ QSize desktop_size = qApp->desktop()->size();
+
+
+ current->flags = 0; //SDL_FULLSCREEN; // We always run fullscreen.
+
+ if(width <= desktop_size.width()
+ && height <= desktop_size.height()) {
+ current->w = desktop_size.width();
+ current->h = desktop_size.height();
+ } else if(width <= desktop_size.height() && height <= desktop_size.width()) {
+ // Landscape mode
+ char * envString = SDL_getenv(SDL_QT_ROTATION_ENV_NAME);
+ int envValue = envString ? atoi(envString) : 0;
+ screenRotation = envValue ? SDL_QT_ROTATION_270 : SDL_QT_ROTATION_90;
+ current->h = desktop_size.width();
+ current->w = desktop_size.height();
+ } else {
+ SDL_SetError("Unsupported resolution, %dx%d\n", width, height);
+ }
+ if ( flags & SDL_OPENGL ) {
+ SDL_SetError("OpenGL not supported");
+ return(NULL);
+ }
+ /* Create the QImage framebuffer */
+ qimage = new QImage(current->w, current->h, bpp);
+ if (qimage->isNull()) {
+ SDL_SetError("Couldn't create screen bitmap");
+ delete qimage;
+ return(NULL);
+ }
+ current->pitch = qimage->bytesPerLine();
+ current->pixels = (void *)qimage->bits();
+ SDL_Win->setImage(qimage);
+ _this->UpdateRects = QT_NormalUpdate;
+ SDL_Win->setFullscreen(true);
+ /* We're done */
+ return(current);
+ }
+
+ /* Update the current mouse state and position */
+ void QT_UpdateMouse(_THIS)
+ {
+ QPoint point(-1, -1);
+ if ( SDL_Win->isActiveWindow() ) {
+ point = SDL_Win->mousePos();
+ }
+
+ if ( (point.x() >= 0) && (point.x() < SDL_VideoSurface->w) &&
+ (point.y() >= 0) && (point.y() < SDL_VideoSurface->h) ) {
+ SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
+ SDL_PrivateMouseMotion(0, 0,
+ (Sint16)point.x(), (Sint16)point.y());
+ } else {
+ SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
+ }
+ }
+
+ /* We don't actually allow hardware surfaces other than the main one */
+ static int QT_AllocHWSurface(_THIS, SDL_Surface *surface)
+ {
+ return(-1);
+ }
+ static void QT_FreeHWSurface(_THIS, SDL_Surface *surface)
+ {
+ return;
+ }
+ static int QT_LockHWSurface(_THIS, SDL_Surface *surface)
+ {
+ return(0);
+ }
+ static void QT_UnlockHWSurface(_THIS, SDL_Surface *surface)
+ {
+ return;
+ }
+
+ static void QT_NormalUpdate(_THIS, int numrects, SDL_Rect *rects)
+ {
+ if(SDL_Win->lockScreen()) {
+ for(int i=0; i<numrects; ++i ) {
+ QRect rect(rects[i].x, rects[i].y,
+ rects[i].w, rects[i].h);
+ SDL_Win->repaintRect(rect);
+ }
+ SDL_Win->unlockScreen();
+ }
+ }
+ /* Is the system palette settable? */
+ int QT_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+ {
+ return -1;
+ }
+
+ void QT_VideoQuit(_THIS)
+ {
+ // This is dumb, but if I free this, the app doesn't exit correctly.
+ // Of course, this will leak memory if init video is done more than once.
+ // Sucks but such is life.
+
+ // -- David Hedbor
+ // delete SDL_Win;
+ // SDL_Win = 0;
+ _this->screen->pixels = NULL;
+ QT_GrabInput(_this, SDL_GRAB_OFF);
+ }
+
+ static int QT_IconifyWindow(_THIS) {
+ SDL_Win->hide();
+
+ return true;
+ }
+
+ static SDL_GrabMode QT_GrabInput(_THIS, SDL_GrabMode mode) {
+ if(mode == SDL_GRAB_OFF) {
+ QPEApplication::grabKeyboard();
+ qApp->processEvents();
+ QPEApplication::ungrabKeyboard();
+ } else {
+ QPEApplication::grabKeyboard();
+ }
+ qApp->processEvents();
+ return mode;
+ }
+
+}; /* Extern C */
diff --git a/distrib/sdl-1.2.15/src/video/qtopia/SDL_syswm.cc b/distrib/sdl-1.2.15/src/video/qtopia/SDL_syswm.cc
new file mode 100644
index 0000000..47f988f
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/qtopia/SDL_syswm.cc
@@ -0,0 +1,35 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_QWin.h"
+
+extern "C" {
+
+#include "SDL_syswm_c.h"
+
+void QT_SetWMCaption(_THIS, const char *title, const char *icon)
+{
+ SDL_Win->setCaption(title);
+}
+
+}; /* Extern C */
diff --git a/distrib/sdl-1.2.15/src/video/qtopia/SDL_syswm_c.h b/distrib/sdl-1.2.15/src/video/qtopia/SDL_syswm_c.h
new file mode 100644
index 0000000..4e4326b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/qtopia/SDL_syswm_c.h
@@ -0,0 +1,28 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_lowvideo.h"
+
+/* Functions to be exported */
+extern void QT_SetWMCaption(_THIS, const char *title, const char *icon);
+
diff --git a/distrib/sdl-1.2.15/src/video/quartz/CGS.h b/distrib/sdl-1.2.15/src/video/quartz/CGS.h
new file mode 100644
index 0000000..abe47f7
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/quartz/CGS.h
@@ -0,0 +1,84 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ Obscuring code: maximum number of windows above ours (inclusive)
+
+ Note: this doesn't work too well in practice and should be
+ phased out when we add OpenGL 2D acceleration. It was never
+ enabled in the first place, so this shouldn't be a problem ;-)
+*/
+#define kMaxWindows 256
+
+/* Some of the Core Graphics Server API for obscuring code */
+#define kCGSWindowLevelTop 2147483632
+#define kCGSWindowLevelDockIconDrag 500
+#define kCGSWindowLevelDockMenu 101
+#define kCGSWindowLevelMenuIgnore 21
+#define kCGSWindowLevelMenu 20
+#define kCGSWindowLevelDockLabel 12
+#define kCGSWindowLevelDockIcon 11
+#define kCGSWindowLevelDock 10
+#define kCGSWindowLevelUtility 3
+#define kCGSWindowLevelNormal 0
+
+/*
+ For completeness; We never use these window levels, they are always below us
+ #define kCGSWindowLevelMBarShadow -20
+ #define kCGSWindowLevelDesktopPicture -2147483647
+ #define kCGSWindowLevelDesktop -2147483648
+*/
+
+typedef CGError CGSError;
+typedef long CGSWindowCount;
+typedef void * CGSConnectionID;
+typedef int CGSWindowID;
+typedef CGSWindowID* CGSWindowIDList;
+typedef CGWindowLevel CGSWindowLevel;
+typedef NSRect CGSRect;
+
+extern CGSConnectionID _CGSDefaultConnection ();
+
+extern CGSError CGSGetOnScreenWindowList (CGSConnectionID cid,
+ CGSConnectionID owner,
+ CGSWindowCount listCapacity,
+ CGSWindowIDList list,
+ CGSWindowCount *listCount);
+
+extern CGSError CGSGetScreenRectForWindow (CGSConnectionID cid,
+ CGSWindowID wid,
+ CGSRect *rect);
+
+extern CGWindowLevel CGSGetWindowLevel (CGSConnectionID cid,
+ CGSWindowID wid,
+ CGSWindowLevel *level);
+
+extern CGSError CGSDisplayHWFill (CGDirectDisplayID id, unsigned int x, unsigned int y,
+ unsigned int w, unsigned int h, unsigned int color);
+
+extern CGSError CGSDisplayCanHWFill (CGDirectDisplayID id);
+
+extern CGSError CGSGetMouseEnabledFlags (CGSConnectionID cid, CGSWindowID wid, int *flags);
+
+int CGSDisplayHWSync (CGDirectDisplayID id);
+
diff --git a/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzEvents.m b/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzEvents.m
new file mode 100644
index 0000000..773eb01
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzEvents.m
@@ -0,0 +1,1063 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_QuartzVideo.h"
+#include "SDL_QuartzWM.h"
+
+#include <IOKit/IOMessage.h> /* For wake from sleep detection */
+#include <IOKit/pwr_mgt/IOPMLib.h> /* For wake from sleep detection */
+#include "SDL_QuartzKeys.h"
+
+/*
+ * On Leopard, this is missing from the 64-bit headers
+ */
+#if defined(__LP64__) && !defined(__POWER__)
+/*
+ * Workaround for a bug in the 10.5 SDK: By accident, OSService.h does
+ * not include Power.h at all when compiling in 64bit mode. This has
+ * been fixed in 10.6, but for 10.5, we manually define UsrActivity
+ * to ensure compilation works.
+ */
+#define UsrActivity 1
+#endif
+
+/*
+ * In Panther, this header defines device dependent masks for
+ * right side keys. These definitions only exist in Panther, but
+ * the header seems to exist at least in Jaguar and probably earlier
+ * versions of the OS, so this should't break anything.
+ */
+#include <IOKit/hidsystem/IOLLEvent.h>
+/*
+ * These are not defined before Panther. To keep the code compiling
+ * on systems without these, I will define if they don't exist.
+ */
+#ifndef NX_DEVICERCTLKEYMASK
+ #define NX_DEVICELCTLKEYMASK 0x00000001
+#endif
+#ifndef NX_DEVICELSHIFTKEYMASK
+ #define NX_DEVICELSHIFTKEYMASK 0x00000002
+#endif
+#ifndef NX_DEVICERSHIFTKEYMASK
+ #define NX_DEVICERSHIFTKEYMASK 0x00000004
+#endif
+#ifndef NX_DEVICELCMDKEYMASK
+ #define NX_DEVICELCMDKEYMASK 0x00000008
+#endif
+#ifndef NX_DEVICERCMDKEYMASK
+ #define NX_DEVICERCMDKEYMASK 0x00000010
+#endif
+#ifndef NX_DEVICELALTKEYMASK
+ #define NX_DEVICELALTKEYMASK 0x00000020
+#endif
+#ifndef NX_DEVICERALTKEYMASK
+ #define NX_DEVICERALTKEYMASK 0x00000040
+#endif
+#ifndef NX_DEVICERCTLKEYMASK
+ #define NX_DEVICERCTLKEYMASK 0x00002000
+#endif
+
+void QZ_InitOSKeymap (_THIS) {
+ BOOL saw_layout = NO;
+ UInt32 state;
+ UInt32 value;
+ Uint16 i;
+ int world = SDLK_WORLD_0;
+
+ for ( i=0; i<SDL_TABLESIZE(keymap); ++i )
+ keymap[i] = SDLK_UNKNOWN;
+
+ /* This keymap is almost exactly the same as the OS 9 one */
+ keymap[QZ_ESCAPE] = SDLK_ESCAPE;
+ keymap[QZ_F1] = SDLK_F1;
+ keymap[QZ_F2] = SDLK_F2;
+ keymap[QZ_F3] = SDLK_F3;
+ keymap[QZ_F4] = SDLK_F4;
+ keymap[QZ_F5] = SDLK_F5;
+ keymap[QZ_F6] = SDLK_F6;
+ keymap[QZ_F7] = SDLK_F7;
+ keymap[QZ_F8] = SDLK_F8;
+ keymap[QZ_F9] = SDLK_F9;
+ keymap[QZ_F10] = SDLK_F10;
+ keymap[QZ_F11] = SDLK_F11;
+ keymap[QZ_F12] = SDLK_F12;
+ keymap[QZ_F13] = SDLK_F13;
+ keymap[QZ_F14] = SDLK_F14;
+ keymap[QZ_F15] = SDLK_F15;
+/*
+ keymap[QZ_PRINT] = SDLK_PRINT;
+ keymap[QZ_SCROLLOCK] = SDLK_SCROLLOCK;
+ keymap[QZ_PAUSE] = SDLK_PAUSE;
+*/
+ keymap[QZ_POWER] = SDLK_POWER;
+ keymap[QZ_BACKQUOTE] = SDLK_BACKQUOTE;
+ keymap[QZ_1] = SDLK_1;
+ keymap[QZ_2] = SDLK_2;
+ keymap[QZ_3] = SDLK_3;
+ keymap[QZ_4] = SDLK_4;
+ keymap[QZ_5] = SDLK_5;
+ keymap[QZ_6] = SDLK_6;
+ keymap[QZ_7] = SDLK_7;
+ keymap[QZ_8] = SDLK_8;
+ keymap[QZ_9] = SDLK_9;
+ keymap[QZ_0] = SDLK_0;
+ keymap[QZ_MINUS] = SDLK_MINUS;
+ keymap[QZ_EQUALS] = SDLK_EQUALS;
+ keymap[QZ_BACKSPACE] = SDLK_BACKSPACE;
+ keymap[QZ_INSERT] = SDLK_INSERT;
+ keymap[QZ_HOME] = SDLK_HOME;
+ keymap[QZ_PAGEUP] = SDLK_PAGEUP;
+ keymap[QZ_NUMLOCK] = SDLK_NUMLOCK;
+ keymap[QZ_KP_EQUALS] = SDLK_KP_EQUALS;
+ keymap[QZ_KP_DIVIDE] = SDLK_KP_DIVIDE;
+ keymap[QZ_KP_MULTIPLY] = SDLK_KP_MULTIPLY;
+ keymap[QZ_TAB] = SDLK_TAB;
+ keymap[QZ_q] = SDLK_q;
+ keymap[QZ_w] = SDLK_w;
+ keymap[QZ_e] = SDLK_e;
+ keymap[QZ_r] = SDLK_r;
+ keymap[QZ_t] = SDLK_t;
+ keymap[QZ_y] = SDLK_y;
+ keymap[QZ_u] = SDLK_u;
+ keymap[QZ_i] = SDLK_i;
+ keymap[QZ_o] = SDLK_o;
+ keymap[QZ_p] = SDLK_p;
+ keymap[QZ_LEFTBRACKET] = SDLK_LEFTBRACKET;
+ keymap[QZ_RIGHTBRACKET] = SDLK_RIGHTBRACKET;
+ keymap[QZ_BACKSLASH] = SDLK_BACKSLASH;
+ keymap[QZ_DELETE] = SDLK_DELETE;
+ keymap[QZ_END] = SDLK_END;
+ keymap[QZ_PAGEDOWN] = SDLK_PAGEDOWN;
+ keymap[QZ_KP7] = SDLK_KP7;
+ keymap[QZ_KP8] = SDLK_KP8;
+ keymap[QZ_KP9] = SDLK_KP9;
+ keymap[QZ_KP_MINUS] = SDLK_KP_MINUS;
+ keymap[QZ_CAPSLOCK] = SDLK_CAPSLOCK;
+ keymap[QZ_a] = SDLK_a;
+ keymap[QZ_s] = SDLK_s;
+ keymap[QZ_d] = SDLK_d;
+ keymap[QZ_f] = SDLK_f;
+ keymap[QZ_g] = SDLK_g;
+ keymap[QZ_h] = SDLK_h;
+ keymap[QZ_j] = SDLK_j;
+ keymap[QZ_k] = SDLK_k;
+ keymap[QZ_l] = SDLK_l;
+ keymap[QZ_SEMICOLON] = SDLK_SEMICOLON;
+ keymap[QZ_QUOTE] = SDLK_QUOTE;
+ keymap[QZ_RETURN] = SDLK_RETURN;
+ keymap[QZ_KP4] = SDLK_KP4;
+ keymap[QZ_KP5] = SDLK_KP5;
+ keymap[QZ_KP6] = SDLK_KP6;
+ keymap[QZ_KP_PLUS] = SDLK_KP_PLUS;
+ keymap[QZ_LSHIFT] = SDLK_LSHIFT;
+ keymap[QZ_RSHIFT] = SDLK_RSHIFT;
+ keymap[QZ_z] = SDLK_z;
+ keymap[QZ_x] = SDLK_x;
+ keymap[QZ_c] = SDLK_c;
+ keymap[QZ_v] = SDLK_v;
+ keymap[QZ_b] = SDLK_b;
+ keymap[QZ_n] = SDLK_n;
+ keymap[QZ_m] = SDLK_m;
+ keymap[QZ_COMMA] = SDLK_COMMA;
+ keymap[QZ_PERIOD] = SDLK_PERIOD;
+ keymap[QZ_SLASH] = SDLK_SLASH;
+ keymap[QZ_UP] = SDLK_UP;
+ keymap[QZ_KP1] = SDLK_KP1;
+ keymap[QZ_KP2] = SDLK_KP2;
+ keymap[QZ_KP3] = SDLK_KP3;
+ keymap[QZ_KP_ENTER] = SDLK_KP_ENTER;
+ keymap[QZ_LCTRL] = SDLK_LCTRL;
+ keymap[QZ_LALT] = SDLK_LALT;
+ keymap[QZ_LMETA] = SDLK_LMETA;
+ keymap[QZ_RCTRL] = SDLK_RCTRL;
+ keymap[QZ_RALT] = SDLK_RALT;
+ keymap[QZ_RMETA] = SDLK_RMETA;
+ keymap[QZ_SPACE] = SDLK_SPACE;
+ keymap[QZ_LEFT] = SDLK_LEFT;
+ keymap[QZ_DOWN] = SDLK_DOWN;
+ keymap[QZ_RIGHT] = SDLK_RIGHT;
+ keymap[QZ_KP0] = SDLK_KP0;
+ keymap[QZ_KP_PERIOD] = SDLK_KP_PERIOD;
+ keymap[QZ_IBOOK_ENTER] = SDLK_KP_ENTER;
+ keymap[QZ_IBOOK_RIGHT] = SDLK_RIGHT;
+ keymap[QZ_IBOOK_DOWN] = SDLK_DOWN;
+ keymap[QZ_IBOOK_UP] = SDLK_UP;
+ keymap[QZ_IBOOK_LEFT] = SDLK_LEFT;
+
+ /*
+ Up there we setup a static scancode->keysym map. However, it will not
+ work very well on international keyboard. Hence we now query MacOS
+ for its own keymap to adjust our own mapping table. However, this is
+ basically only useful for ascii char keys. This is also the reason
+ why we keep the static table, too.
+ */
+
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
+ if (TISCopyCurrentKeyboardLayoutInputSource != NULL) {
+ TISInputSourceRef src = TISCopyCurrentKeyboardLayoutInputSource();
+ if (src != NULL) {
+ CFDataRef data = (CFDataRef)
+ TISGetInputSourceProperty(src,
+ kTISPropertyUnicodeKeyLayoutData);
+ if (data != NULL) {
+ const UCKeyboardLayout *layout = (const UCKeyboardLayout *)
+ CFDataGetBytePtr(data);
+ if (layout != NULL) {
+ const UInt32 kbdtype = LMGetKbdType();
+ saw_layout = YES;
+
+ /* Loop over all 127 possible scan codes */
+ for (i = 0; i < 0x7F; i++) {
+ UniChar buf[16];
+ UniCharCount count = 0;
+
+ /* We pretend a clean start to begin with (i.e. no dead keys active */
+ state = 0;
+
+ if (UCKeyTranslate(layout, i, kUCKeyActionDown, 0, kbdtype,
+ 0, &state, 16, &count, buf) != noErr) {
+ continue;
+ }
+
+ /* If the state become 0, it was a dead key. We need to
+ translate again, passing in the new state, to get
+ the actual key value */
+ if (state != 0) {
+ if (UCKeyTranslate(layout, i, kUCKeyActionDown, 0, kbdtype,
+ 0, &state, 16, &count, buf) != noErr) {
+ continue;
+ }
+ }
+
+ if (count != 1) {
+ continue; /* no multi-char. Use SDL 1.3 instead. :) */
+ }
+
+ value = (UInt32) buf[0];
+ if (value >= 128) {
+ /* Some non-ASCII char, map it to SDLK_WORLD_* */
+ if (world < 0xFF) {
+ keymap[i] = world++;
+ }
+ } else if (value >= 32) { /* non-control ASCII char */
+ keymap[i] = value;
+ }
+ }
+ }
+ }
+ CFRelease(src);
+ }
+ }
+#endif
+
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1050)
+ if (!saw_layout) {
+ /* Get a pointer to the systems cached KCHR */
+ const void *KCHRPtr = (const void *)GetScriptManagerVariable(smKCHRCache);
+ if (KCHRPtr)
+ {
+ /* Loop over all 127 possible scan codes */
+ for (i = 0; i < 0x7F; i++)
+ {
+ /* We pretend a clean start to begin with (i.e. no dead keys active */
+ state = 0;
+
+ /* Now translate the key code to a key value */
+ value = KeyTranslate(KCHRPtr, i, &state) & 0xff;
+
+ /* If the state become 0, it was a dead key. We need to translate again,
+ passing in the new state, to get the actual key value */
+ if (state != 0)
+ value = KeyTranslate(KCHRPtr, i, &state) & 0xff;
+
+ /* Now we should have an ascii value, or 0. Try to figure out to which SDL symbol it maps */
+ if (value >= 128) { /* Some non-ASCII char, map it to SDLK_WORLD_* */
+ if (world < 0xFF) {
+ keymap[i] = world++;
+ }
+ } else if (value >= 32) { /* non-control ASCII char */
+ keymap[i] = value;
+ }
+ }
+ }
+ }
+#endif
+
+ /*
+ The keypad codes are re-setup here, because the loop above cannot
+ distinguish between a key on the keypad and a regular key. We maybe
+ could get around this problem in another fashion: NSEvent's flags
+ include a "NSNumericPadKeyMask" bit; we could check that and modify
+ the symbol we return on the fly. However, this flag seems to exhibit
+ some weird behaviour related to the num lock key
+ */
+ keymap[QZ_KP0] = SDLK_KP0;
+ keymap[QZ_KP1] = SDLK_KP1;
+ keymap[QZ_KP2] = SDLK_KP2;
+ keymap[QZ_KP3] = SDLK_KP3;
+ keymap[QZ_KP4] = SDLK_KP4;
+ keymap[QZ_KP5] = SDLK_KP5;
+ keymap[QZ_KP6] = SDLK_KP6;
+ keymap[QZ_KP7] = SDLK_KP7;
+ keymap[QZ_KP8] = SDLK_KP8;
+ keymap[QZ_KP9] = SDLK_KP9;
+ keymap[QZ_KP_MINUS] = SDLK_KP_MINUS;
+ keymap[QZ_KP_PLUS] = SDLK_KP_PLUS;
+ keymap[QZ_KP_PERIOD] = SDLK_KP_PERIOD;
+ keymap[QZ_KP_EQUALS] = SDLK_KP_EQUALS;
+ keymap[QZ_KP_DIVIDE] = SDLK_KP_DIVIDE;
+ keymap[QZ_KP_MULTIPLY] = SDLK_KP_MULTIPLY;
+ keymap[QZ_KP_ENTER] = SDLK_KP_ENTER;
+}
+
+static void QZ_DoKey (_THIS, int state, NSEvent *event) {
+
+ NSString *chars = NULL;
+ unsigned int i, numChars;
+ SDL_keysym key;
+
+ /*
+ A key event can contain multiple characters,
+ or no characters at all. In most cases, it
+ will contain a single character. If it contains
+ 0 characters, we'll use 0 as the unicode. If it
+ contains multiple characters, we'll use 0 as
+ the scancode/keysym.
+ */
+ if (SDL_TranslateUNICODE && state == SDL_PRESSED) {
+ [field_edit interpretKeyEvents:[NSArray arrayWithObject:event]];
+ chars = [ event characters ];
+ numChars = [ chars length ];
+ if (numChars > 0)
+ [field_edit setString:@""];
+ } else {
+ numChars = 0;
+ }
+
+ if (numChars == 0) {
+
+ key.scancode = [ event keyCode ];
+ key.sym = keymap [ key.scancode ];
+ key.unicode = 0;
+ key.mod = KMOD_NONE;
+
+ SDL_PrivateKeyboard (state, &key);
+ }
+ else if (numChars >= 1) {
+
+ key.scancode = [ event keyCode ];
+ key.sym = keymap [ key.scancode ];
+ key.unicode = [ chars characterAtIndex:0 ];
+ key.mod = KMOD_NONE;
+
+ SDL_PrivateKeyboard (state, &key);
+
+ for (i = 1; i < numChars; i++) {
+
+ key.scancode = 0;
+ key.sym = 0;
+ key.unicode = [ chars characterAtIndex:i];
+ key.mod = KMOD_NONE;
+
+ SDL_PrivateKeyboard (state, &key);
+ }
+ }
+
+ if (SDL_getenv ("SDL_ENABLEAPPEVENTS"))
+ [ NSApp sendEvent:event ];
+}
+
+/* This is the original behavior, before support was added for
+ * differentiating between left and right versions of the keys.
+ */
+static void QZ_DoUnsidedModifiers (_THIS, unsigned int newMods) {
+
+ const int mapping[] = { SDLK_CAPSLOCK, SDLK_LSHIFT, SDLK_LCTRL, SDLK_LALT, SDLK_LMETA };
+
+ int i;
+ int bit;
+ SDL_keysym key;
+
+ key.scancode = 0;
+ key.sym = SDLK_UNKNOWN;
+ key.unicode = 0;
+ key.mod = KMOD_NONE;
+
+ /* Iterate through the bits, testing each against the current modifiers */
+ for (i = 0, bit = NSAlphaShiftKeyMask; bit <= NSCommandKeyMask; bit <<= 1, ++i) {
+
+ unsigned int currentMask, newMask;
+
+ currentMask = current_mods & bit;
+ newMask = newMods & bit;
+
+ if ( currentMask &&
+ currentMask != newMask ) { /* modifier up event */
+
+ key.sym = mapping[i];
+ /* If this was Caps Lock, we need some additional voodoo to make SDL happy */
+ if (bit == NSAlphaShiftKeyMask)
+ SDL_PrivateKeyboard (SDL_PRESSED, &key);
+ SDL_PrivateKeyboard (SDL_RELEASED, &key);
+ }
+ else if ( newMask &&
+ currentMask != newMask ) { /* modifier down event */
+
+ key.sym = mapping[i];
+ SDL_PrivateKeyboard (SDL_PRESSED, &key);
+ /* If this was Caps Lock, we need some additional voodoo to make SDL happy */
+ if (bit == NSAlphaShiftKeyMask)
+ SDL_PrivateKeyboard (SDL_RELEASED, &key);
+ }
+ }
+}
+
+/* This is a helper function for QZ_HandleModifierSide. This
+ * function reverts back to behavior before the distinction between
+ * sides was made.
+ */
+static void QZ_HandleNonDeviceModifier ( _THIS, unsigned int device_independent_mask, unsigned int newMods, unsigned int key_sym) {
+ unsigned int currentMask, newMask;
+ SDL_keysym key;
+
+ key.scancode = 0;
+ key.sym = key_sym;
+ key.unicode = 0;
+ key.mod = KMOD_NONE;
+
+ /* Isolate just the bits we care about in the depedent bits so we can
+ * figure out what changed
+ */
+ currentMask = current_mods & device_independent_mask;
+ newMask = newMods & device_independent_mask;
+
+ if ( currentMask &&
+ currentMask != newMask ) { /* modifier up event */
+ SDL_PrivateKeyboard (SDL_RELEASED, &key);
+ }
+ else if ( newMask &&
+ currentMask != newMask ) { /* modifier down event */
+ SDL_PrivateKeyboard (SDL_PRESSED, &key);
+ }
+}
+
+/* This is a helper function for QZ_HandleModifierSide.
+ * This function sets the actual SDL_PrivateKeyboard event.
+ */
+static void QZ_HandleModifierOneSide ( _THIS, unsigned int newMods,
+ unsigned int key_sym,
+ unsigned int sided_device_dependent_mask ) {
+
+ SDL_keysym key;
+ unsigned int current_dep_mask, new_dep_mask;
+
+ key.scancode = 0;
+ key.sym = key_sym;
+ key.unicode = 0;
+ key.mod = KMOD_NONE;
+
+ /* Isolate just the bits we care about in the depedent bits so we can
+ * figure out what changed
+ */
+ current_dep_mask = current_mods & 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
+ * find out which it is.
+ */
+ if( new_dep_mask &&
+ current_dep_mask != new_dep_mask ) {
+ /* Modifier down event */
+ SDL_PrivateKeyboard (SDL_PRESSED, &key);
+ }
+ else /* Modifier up event */ {
+ SDL_PrivateKeyboard (SDL_RELEASED, &key);
+ }
+}
+
+/* This is a helper function for QZ_DoSidedModifiers.
+ * This function will figure out if the modifier key is the left or right side,
+ * e.g. left-shift vs right-shift.
+ */
+static void QZ_HandleModifierSide ( _THIS, int device_independent_mask,
+ unsigned int newMods,
+ unsigned int left_key_sym,
+ unsigned int right_key_sym,
+ unsigned int left_device_dependent_mask,
+ unsigned int right_device_dependent_mask ) {
+ unsigned int device_dependent_mask = 0;
+ unsigned int diff_mod = 0;
+
+ 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
+ * keyboard and revert to the unsided behavior.
+ */
+ if ( (device_dependent_mask & newMods) == 0 ) {
+ /* Revert to the old behavior */
+ QZ_HandleNonDeviceModifier ( this, device_independent_mask, newMods, left_key_sym );
+ return;
+ }
+
+ /* XOR the previous state against the new state to see if there's a change */
+ diff_mod = (device_dependent_mask & current_mods)
+ ^ (device_dependent_mask & newMods);
+
+ if ( diff_mod ) {
+ /* 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.
+ */
+ if ( left_device_dependent_mask & diff_mod ) {
+ QZ_HandleModifierOneSide ( this, newMods, left_key_sym, left_device_dependent_mask );
+ }
+ if ( right_device_dependent_mask & diff_mod ) {
+ QZ_HandleModifierOneSide ( this, newMods, right_key_sym, right_device_dependent_mask );
+ }
+ }
+}
+
+/* This is a helper function for QZ_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
+ * can't still be down).
+ */
+static void QZ_ReleaseModifierSide ( _THIS,
+ unsigned int device_independent_mask,
+ unsigned int newMods,
+ unsigned int left_key_sym,
+ unsigned int right_key_sym,
+ unsigned int left_device_dependent_mask,
+ unsigned int right_device_dependent_mask ) {
+ unsigned int device_dependent_mask = 0;
+ SDL_keysym key;
+
+ key.scancode = 0;
+ key.sym = SDLK_UNKNOWN;
+ key.unicode = 0;
+ key.mod = KMOD_NONE;
+
+ 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
+ * keyboard and revert to the unsided behavior.
+ */
+ if ( (device_dependent_mask & current_mods) == 0 ) {
+ /* In this case, we can't detect the keyboard, so use the left side
+ * to represent both, and release it.
+ */
+ key.sym = left_key_sym;
+ SDL_PrivateKeyboard (SDL_RELEASED, &key);
+
+ 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.
+ * But I'm being paranoid so I want to handle each separately,
+ * so I hope this doesn't cause other problems.
+ */
+ if ( left_device_dependent_mask & current_mods ) {
+ key.sym = left_key_sym;
+ SDL_PrivateKeyboard (SDL_RELEASED, &key);
+ }
+ if ( right_device_dependent_mask & current_mods ) {
+ key.sym = right_key_sym;
+ SDL_PrivateKeyboard (SDL_RELEASED, &key);
+ }
+}
+
+/* This is a helper function for QZ_DoSidedModifiers.
+ * This function handles the CapsLock case.
+ */
+static void QZ_HandleCapsLock (_THIS, unsigned int newMods) {
+ unsigned int currentMask, newMask;
+ SDL_keysym key;
+
+ key.scancode = 0;
+ key.sym = SDLK_CAPSLOCK;
+ key.unicode = 0;
+ key.mod = KMOD_NONE;
+
+ currentMask = current_mods & NSAlphaShiftKeyMask;
+ newMask = newMods & NSAlphaShiftKeyMask;
+
+ if ( currentMask &&
+ currentMask != newMask ) { /* modifier up event */
+ /* If this was Caps Lock, we need some additional voodoo to make SDL happy */
+ SDL_PrivateKeyboard (SDL_PRESSED, &key);
+ SDL_PrivateKeyboard (SDL_RELEASED, &key);
+ }
+ else if ( newMask &&
+ currentMask != newMask ) { /* modifier down event */
+ /* If this was Caps Lock, we need some additional voodoo to make SDL happy */
+ SDL_PrivateKeyboard (SDL_PRESSED, &key);
+ SDL_PrivateKeyboard (SDL_RELEASED, &key);
+ }
+}
+
+/* This function will handle the modifier keys and also determine the
+ * correct side of the key.
+ */
+static void QZ_DoSidedModifiers (_THIS, unsigned int newMods) {
+ /* Set up arrays for the key syms for the left and right side. */
+ const unsigned int left_mapping[] = { SDLK_LSHIFT, SDLK_LCTRL, SDLK_LALT, SDLK_LMETA };
+ const unsigned int right_mapping[] = { SDLK_RSHIFT, SDLK_RCTRL, SDLK_RALT, SDLK_RMETA };
+ /* 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 };
+
+ unsigned int i;
+ unsigned int bit;
+
+ /* Handle CAPSLOCK separately because it doesn't have a left/right side */
+ QZ_HandleCapsLock ( this, newMods );
+
+ /* Iterate through the bits, testing each against the current modifiers */
+ for (i = 0, bit = NSShiftKeyMask; bit <= NSCommandKeyMask; bit <<= 1, ++i) {
+
+ unsigned int currentMask, newMask;
+
+ currentMask = current_mods & 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.
+ */
+ if ( newMask ) {
+ QZ_HandleModifierSide ( this, bit, newMods,
+ left_mapping[i],
+ right_mapping[i],
+ left_device_mapping[i],
+ right_device_mapping[i] );
+ }
+ /* If the state changed from pressed to unpressed, we must examine
+ * the device dependent bits to release the correct keys.
+ */
+ else if ( currentMask &&
+ currentMask != newMask ) { /* modifier up event */
+ QZ_ReleaseModifierSide ( this, bit, newMods,
+ left_mapping[i],
+ right_mapping[i],
+ left_device_mapping[i],
+ right_device_mapping[i] );
+ }
+ }
+}
+
+/* This function is called to handle the modifiers.
+ * It will try to distinguish between the left side and right side
+ * of the keyboard for those modifiers that qualify if the
+ * operating system version supports it. Otherwise, the code
+ * will not try to make the distinction.
+ */
+static void QZ_DoModifiers (_THIS, unsigned int newMods) {
+
+ if (current_mods == newMods)
+ return;
+
+ /*
+ * Starting with Panther (10.3.0), the ability to distinguish between
+ * left side and right side modifiers is available.
+ */
+ if( system_version >= 0x1030 ) {
+ QZ_DoSidedModifiers (this, newMods);
+ }
+ else {
+ QZ_DoUnsidedModifiers (this, newMods);
+ }
+
+ current_mods = newMods;
+}
+
+static void QZ_GetMouseLocation (_THIS, NSPoint *p) {
+ *p = [ NSEvent mouseLocation ]; /* global coordinates */
+ if (qz_window)
+ QZ_PrivateGlobalToLocal (this, p);
+ QZ_PrivateCocoaToSDL (this, p);
+}
+
+void QZ_DoActivate (_THIS) {
+
+ SDL_PrivateAppActive (1, SDL_APPINPUTFOCUS | (QZ_IsMouseInWindow (this) ? SDL_APPMOUSEFOCUS : 0));
+
+ QZ_UpdateCursor(this);
+
+ /* Regrab input, only if it was previously grabbed */
+ if ( current_grab_mode == SDL_GRAB_ON ) {
+
+ /* Restore cursor location if input was grabbed */
+ QZ_PrivateWarpCursor (this, cursor_loc.x, cursor_loc.y);
+ QZ_ChangeGrabState (this, QZ_ENABLE_GRAB);
+ }
+ else {
+ /* Update SDL's mouse location */
+ NSPoint p;
+ QZ_GetMouseLocation (this, &p);
+ SDL_PrivateMouseMotion (0, 0, p.x, p.y);
+ }
+
+ QZ_UpdateCursor(this);
+}
+
+void QZ_DoDeactivate (_THIS) {
+
+ SDL_PrivateAppActive (0, SDL_APPINPUTFOCUS | SDL_APPMOUSEFOCUS);
+
+ /* Get the current cursor location, for restore on activate */
+ QZ_GetMouseLocation (this, &cursor_loc);
+
+ /* Reassociate mouse and cursor */
+ CGAssociateMouseAndMouseCursorPosition (1);
+
+ QZ_UpdateCursor(this);
+}
+
+void QZ_SleepNotificationHandler (void * refcon,
+ io_service_t service,
+ natural_t messageType,
+ void * messageArgument )
+{
+ SDL_VideoDevice *this = (SDL_VideoDevice*)refcon;
+
+ switch(messageType)
+ {
+ case kIOMessageSystemWillSleep:
+ IOAllowPowerChange(power_connection, (long) messageArgument);
+ break;
+ case kIOMessageCanSystemSleep:
+ IOAllowPowerChange(power_connection, (long) messageArgument);
+ break;
+ case kIOMessageSystemHasPoweredOn:
+ /* awake */
+ SDL_PrivateExpose();
+ break;
+ }
+}
+
+void QZ_RegisterForSleepNotifications (_THIS)
+{
+ CFRunLoopSourceRef rls;
+ IONotificationPortRef thePortRef;
+ io_object_t notifier;
+
+ power_connection = IORegisterForSystemPower (this, &thePortRef, QZ_SleepNotificationHandler, &notifier);
+
+ if (power_connection == 0)
+ NSLog(@"SDL: QZ_SleepNotificationHandler() IORegisterForSystemPower failed.");
+
+ rls = IONotificationPortGetRunLoopSource (thePortRef);
+ CFRunLoopAddSource (CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode);
+ CFRelease (rls);
+}
+
+
+/* Try to map Quartz mouse buttons to SDL's lingo... */
+static int QZ_OtherMouseButtonToSDL(int button)
+{
+ switch (button)
+ {
+ case 0:
+ return(SDL_BUTTON_LEFT); /* 1 */
+ case 1:
+ return(SDL_BUTTON_RIGHT); /* 3 */
+ case 2:
+ return(SDL_BUTTON_MIDDLE); /* 2 */
+ }
+
+ /* >= 3: skip 4 & 5, since those are the SDL mousewheel buttons. */
+ return(button + 3);
+}
+
+
+void QZ_PumpEvents (_THIS)
+{
+ int32_t dx, dy;
+
+ NSDate *distantPast;
+ NSEvent *event;
+ NSRect winRect;
+ NSAutoreleasePool *pool;
+
+ if (!SDL_VideoSurface)
+ return; /* don't do anything if there's no screen surface. */
+
+ /* Update activity every five seconds to prevent screensaver. --ryan. */
+ if (!allow_screensaver) {
+ static Uint32 screensaverTicks;
+ Uint32 nowTicks = SDL_GetTicks();
+ if ((nowTicks - screensaverTicks) > 5000)
+ {
+ UpdateSystemActivity(UsrActivity);
+ screensaverTicks = nowTicks;
+ }
+ }
+
+ pool = [ [ NSAutoreleasePool alloc ] init ];
+ distantPast = [ NSDate distantPast ];
+
+ winRect = NSMakeRect (0, 0, SDL_VideoSurface->w, SDL_VideoSurface->h);
+
+ /* while grabbed, accumulate all mouse moved events into one SDL mouse event */
+ dx = 0;
+ dy = 0;
+
+ do {
+
+ /* Poll for an event. This will not block */
+ event = [ NSApp nextEventMatchingMask:NSAnyEventMask
+ untilDate:distantPast
+ inMode: NSDefaultRunLoopMode dequeue:YES ];
+ if (event != nil) {
+
+ int button;
+ unsigned int type;
+ BOOL isInGameWin;
+
+ #define DO_MOUSE_DOWN(button) do { \
+ if ( SDL_GetAppState() & SDL_APPMOUSEFOCUS ) { \
+ SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0); \
+ expect_mouse_up |= 1<<button; \
+ } \
+ [ NSApp sendEvent:event ]; \
+ } while(0)
+
+ #define DO_MOUSE_UP(button) do { \
+ if ( expect_mouse_up & (1<<button) ) { \
+ SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0); \
+ expect_mouse_up &= ~(1<<button); \
+ } \
+ [ NSApp sendEvent:event ]; \
+ } while(0)
+
+ type = [ event type ];
+ isInGameWin = QZ_IsMouseInWindow (this);
+
+ QZ_DoModifiers(this, [ event modifierFlags ] );
+
+ switch (type) {
+ case NSLeftMouseDown:
+ if ( SDL_getenv("SDL_HAS3BUTTONMOUSE") ) {
+ DO_MOUSE_DOWN (SDL_BUTTON_LEFT);
+ } else {
+ if ( NSCommandKeyMask & current_mods ) {
+ last_virtual_button = SDL_BUTTON_RIGHT;
+ DO_MOUSE_DOWN (SDL_BUTTON_RIGHT);
+ }
+ else if ( NSAlternateKeyMask & current_mods ) {
+ last_virtual_button = SDL_BUTTON_MIDDLE;
+ DO_MOUSE_DOWN (SDL_BUTTON_MIDDLE);
+ }
+ else {
+ DO_MOUSE_DOWN (SDL_BUTTON_LEFT);
+ }
+ }
+ break;
+
+ case NSLeftMouseUp:
+ if ( last_virtual_button != 0 ) {
+ DO_MOUSE_UP (last_virtual_button);
+ last_virtual_button = 0;
+ }
+ else {
+ DO_MOUSE_UP (SDL_BUTTON_LEFT);
+ }
+ break;
+
+ case NSOtherMouseDown:
+ case NSRightMouseDown:
+ button = QZ_OtherMouseButtonToSDL([ event buttonNumber ]);
+ DO_MOUSE_DOWN (button);
+ break;
+
+ case NSOtherMouseUp:
+ case NSRightMouseUp:
+ button = QZ_OtherMouseButtonToSDL([ event buttonNumber ]);
+ DO_MOUSE_UP (button);
+ break;
+
+ case NSSystemDefined:
+ /*
+ Future: up to 32 "mouse" buttons can be handled.
+ if ([event subtype] == 7) {
+ unsigned int buttons;
+ buttons = [ event data2 ];
+ */
+ break;
+ case NSLeftMouseDragged:
+ case NSRightMouseDragged:
+ case NSOtherMouseDragged: /* usually middle mouse dragged */
+ case NSMouseMoved:
+ if ( grab_state == QZ_INVISIBLE_GRAB ) {
+
+ /*
+ If input is grabbed+hidden, the cursor doesn't move,
+ so we have to call the lowlevel window server
+ function. This is less accurate but works OK.
+ */
+ int32_t dx1, dy1;
+ CGGetLastMouseDelta (&dx1, &dy1);
+ dx += dx1;
+ dy += dy1;
+ }
+ else {
+
+ /*
+ Get the absolute mouse location. This is not the
+ mouse location after the currently processed event,
+ but the *current* mouse location, i.e. after all
+ pending events. This means that if there are
+ multiple mouse moved events in the queue, we make
+ multiple identical calls to SDL_PrivateMouseMotion(),
+ but that's no problem since the latter only
+ generates SDL events for nonzero movements. In my
+ experience on PBG4/10.4.8, this rarely happens anyway.
+ */
+ NSPoint p;
+ QZ_GetMouseLocation (this, &p);
+ SDL_PrivateMouseMotion (0, 0, p.x, p.y);
+ }
+
+ /*
+ Handle grab input+cursor visible by warping the cursor back
+ into the game window. This still generates a mouse moved event,
+ but not as a result of the warp (so it's in the right direction).
+ */
+ if ( grab_state == QZ_VISIBLE_GRAB && !isInGameWin ) {
+
+ NSPoint p;
+ QZ_GetMouseLocation (this, &p);
+
+ if ( p.x < 0.0 )
+ p.x = 0.0;
+
+ if ( p.y < 0.0 )
+ p.y = 0.0;
+
+ if ( p.x >= winRect.size.width )
+ p.x = winRect.size.width-1;
+
+ if ( p.y >= winRect.size.height )
+ p.y = winRect.size.height-1;
+
+ QZ_PrivateWarpCursor (this, p.x, p.y);
+ }
+ else
+ if ( !isInGameWin && (SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
+
+ SDL_PrivateAppActive (0, SDL_APPMOUSEFOCUS);
+
+ if (grab_state == QZ_INVISIBLE_GRAB)
+ /*The cursor has left the window even though it is
+ disassociated from the mouse (and therefore
+ shouldn't move): this can happen with Wacom
+ tablets, and it effectively breaks the grab, since
+ mouse down events now go to background
+ applications. The only possibility to avoid this
+ seems to be talking to the tablet driver
+ (AppleEvents) to constrain its mapped area to the
+ window, which may not be worth the effort. For
+ now, handle the condition more gracefully than
+ before by reassociating cursor and mouse until the
+ cursor enters the window again, making it obvious
+ to the user that the grab is broken.*/
+ CGAssociateMouseAndMouseCursorPosition (1);
+
+ QZ_UpdateCursor(this);
+ }
+ else
+ if ( isInGameWin && (SDL_GetAppState() & (SDL_APPMOUSEFOCUS | SDL_APPINPUTFOCUS)) == SDL_APPINPUTFOCUS ) {
+
+ SDL_PrivateAppActive (1, SDL_APPMOUSEFOCUS);
+
+ QZ_UpdateCursor(this);
+
+ if (grab_state == QZ_INVISIBLE_GRAB) { /*see comment above*/
+ QZ_PrivateWarpCursor (this, SDL_VideoSurface->w / 2, SDL_VideoSurface->h / 2);
+ CGAssociateMouseAndMouseCursorPosition (0);
+ }
+ }
+ break;
+ case NSScrollWheel:
+ if ( isInGameWin ) {
+ float dy, dx;
+ Uint8 button;
+ dy = [ event deltaY ];
+ dx = [ event deltaX ];
+ if ( dy > 0.0 ) /* Scroll up */
+ button = SDL_BUTTON_WHEELUP;
+ else if ( dy < 0.0 ) /* Scroll down */
+ button = SDL_BUTTON_WHEELDOWN;
+ else
+ break; /* Horizontal scroll */
+ /* For now, wheel is sent as a quick down+up */
+ SDL_PrivateMouseButton (SDL_PRESSED, button, 0, 0);
+ SDL_PrivateMouseButton (SDL_RELEASED, button, 0, 0);
+ }
+ break;
+ case NSKeyUp:
+ QZ_DoKey (this, SDL_RELEASED, event);
+ break;
+ case NSKeyDown:
+ QZ_DoKey (this, SDL_PRESSED, event);
+ break;
+ case NSFlagsChanged:
+ break;
+ case NSAppKitDefined:
+ [ NSApp sendEvent:event ];
+ if ([ event subtype ] == NSApplicationActivatedEventType && (mode_flags & SDL_FULLSCREEN)) {
+ /* the default handling of this event seems to reset any cursor set by [NSCursor set] (used by SDL_SetCursor() in fullscreen mode) to the default system arrow cursor */
+ SDL_Cursor *sdlc = SDL_GetCursor();
+ if (sdlc != NULL && sdlc->wm_cursor != NULL) {
+ [ sdlc->wm_cursor->nscursor set ];
+ }
+ }
+ break;
+ /* case NSApplicationDefined: break; */
+ /* case NSPeriodic: break; */
+ /* case NSCursorUpdate: break; */
+ default:
+ [ NSApp sendEvent:event ];
+ }
+ }
+ } while (event != nil);
+
+ /* handle accumulated mouse moved events */
+ if (dx != 0 || dy != 0)
+ SDL_PrivateMouseMotion (0, 1, dx, dy);
+
+ [ pool release ];
+}
+
+void QZ_UpdateMouse (_THIS)
+{
+ NSPoint p;
+ QZ_GetMouseLocation (this, &p);
+ SDL_PrivateAppActive (QZ_IsMouseInWindow (this), SDL_APPMOUSEFOCUS);
+ SDL_PrivateMouseMotion (0, 0, p.x, p.y);
+}
diff --git a/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzGL.m b/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzGL.m
new file mode 100644
index 0000000..d38dceb
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzGL.m
@@ -0,0 +1,292 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_QuartzVideo.h"
+
+/*
+ * GL_ARB_Multisample is supposed to be available in 10.1, according to Apple:
+ *
+ * http://developer.apple.com/graphicsimaging/opengl/extensions.html#GL_ARB_multisample
+ *
+ * ...but it isn't in the system headers, according to Sam:
+ *
+ * http://lists.libsdl.org/pipermail/sdl-libsdl.org/2003-December/039794.html
+ *
+ * These are normally enums and not #defines in the system headers.
+ *
+ * --ryan.
+ */
+#if (MAC_OS_X_VERSION_MAX_ALLOWED < 1020)
+#define NSOpenGLPFASampleBuffers ((NSOpenGLPixelFormatAttribute) 55)
+#define NSOpenGLPFASamples ((NSOpenGLPixelFormatAttribute) 56)
+#endif
+
+#ifdef __powerpc__ /* we lost this in 10.6, which has no PPC support. */
+@implementation NSOpenGLContext (CGLContextAccess)
+- (CGLContextObj) cglContext;
+{
+ return _contextAuxiliary;
+}
+@end
+CGLContextObj QZ_GetCGLContextObj(NSOpenGLContext *nsctx)
+{
+ return [nsctx cglContext];
+}
+#else
+CGLContextObj QZ_GetCGLContextObj(NSOpenGLContext *nsctx)
+{
+ return (CGLContextObj) [nsctx CGLContextObj];
+}
+#endif
+
+
+/* OpenGL helper functions (used internally) */
+
+int QZ_SetupOpenGL (_THIS, int bpp, Uint32 flags) {
+
+ NSOpenGLPixelFormatAttribute attr[32];
+ NSOpenGLPixelFormat *fmt;
+ int i = 0;
+ int colorBits = bpp;
+
+ /* if a GL library hasn't been loaded at this point, load the default. */
+ if (!this->gl_config.driver_loaded) {
+ if (QZ_GL_LoadLibrary(this, NULL) == -1)
+ return 0;
+ }
+
+ if ( flags & SDL_FULLSCREEN ) {
+
+ attr[i++] = NSOpenGLPFAFullScreen;
+ }
+ /* In windowed mode, the OpenGL pixel depth must match device pixel depth */
+ else if ( colorBits != device_bpp ) {
+
+ colorBits = device_bpp;
+ }
+
+ attr[i++] = NSOpenGLPFAColorSize;
+ attr[i++] = colorBits;
+
+ attr[i++] = NSOpenGLPFADepthSize;
+ attr[i++] = this->gl_config.depth_size;
+
+ if ( this->gl_config.double_buffer ) {
+ attr[i++] = NSOpenGLPFADoubleBuffer;
+ }
+
+ if ( this->gl_config.stereo ) {
+ attr[i++] = NSOpenGLPFAStereo;
+ }
+
+ if ( this->gl_config.stencil_size != 0 ) {
+ attr[i++] = NSOpenGLPFAStencilSize;
+ attr[i++] = this->gl_config.stencil_size;
+ }
+
+ if ( (this->gl_config.accum_red_size +
+ this->gl_config.accum_green_size +
+ this->gl_config.accum_blue_size +
+ this->gl_config.accum_alpha_size) > 0 ) {
+ attr[i++] = NSOpenGLPFAAccumSize;
+ attr[i++] = this->gl_config.accum_red_size + this->gl_config.accum_green_size + this->gl_config.accum_blue_size + this->gl_config.accum_alpha_size;
+ }
+
+ if ( this->gl_config.multisamplebuffers != 0 ) {
+ attr[i++] = NSOpenGLPFASampleBuffers;
+ attr[i++] = this->gl_config.multisamplebuffers;
+ }
+
+ if ( this->gl_config.multisamplesamples != 0 ) {
+ attr[i++] = NSOpenGLPFASamples;
+ attr[i++] = this->gl_config.multisamplesamples;
+ attr[i++] = NSOpenGLPFANoRecovery;
+ }
+
+ if ( this->gl_config.accelerated > 0 ) {
+ attr[i++] = NSOpenGLPFAAccelerated;
+ }
+
+ attr[i++] = NSOpenGLPFAScreenMask;
+ attr[i++] = CGDisplayIDToOpenGLDisplayMask (display_id);
+ attr[i] = 0;
+
+ fmt = [ [ NSOpenGLPixelFormat alloc ] initWithAttributes:attr ];
+ if (fmt == nil) {
+ SDL_SetError ("Failed creating OpenGL pixel format");
+ return 0;
+ }
+
+ gl_context = [ [ NSOpenGLContext alloc ] initWithFormat:fmt
+ shareContext:nil];
+
+ [ fmt release ];
+
+ if (gl_context == nil) {
+ SDL_SetError ("Failed creating OpenGL context");
+ return 0;
+ }
+
+ /* Synchronize QZ_GL_SwapBuffers() to vertical retrace.
+ * (Apple's documentation is not completely clear about what this setting
+ * exactly does, IMHO - for a detailed explanation see
+ * http://lists.apple.com/archives/mac-opengl/2006/Jan/msg00080.html )
+ */
+ if ( this->gl_config.swap_control >= 0 ) {
+ GLint value;
+ value = this->gl_config.swap_control;
+ [ gl_context setValues: &value forParameter: NSOpenGLCPSwapInterval ];
+ }
+
+ /*
+ * 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 = QZ_GetCGLContextObj(gl_context);
+ 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. */
+
+ return 1;
+}
+
+void QZ_TearDownOpenGL (_THIS) {
+
+ [ NSOpenGLContext clearCurrentContext ];
+ [ gl_context clearDrawable ];
+ [ gl_context release ];
+}
+
+
+/* SDL OpenGL functions */
+static const char *DEFAULT_OPENGL_LIB_NAME =
+ "/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib";
+
+int QZ_GL_LoadLibrary (_THIS, const char *location) {
+ if ( gl_context != NULL ) {
+ SDL_SetError("OpenGL context already created");
+ return -1;
+ }
+
+ if (opengl_library != NULL)
+ SDL_UnloadObject(opengl_library);
+
+ if (location == NULL)
+ location = DEFAULT_OPENGL_LIB_NAME;
+
+ opengl_library = SDL_LoadObject(location);
+ if (opengl_library != NULL) {
+ this->gl_config.driver_loaded = 1;
+ return 0;
+ }
+
+ this->gl_config.driver_loaded = 0;
+ return -1;
+}
+
+void* QZ_GL_GetProcAddress (_THIS, const char *proc) {
+ return SDL_LoadFunction(opengl_library, proc);
+}
+
+int QZ_GL_GetAttribute (_THIS, SDL_GLattr attrib, int* value) {
+
+ GLenum attr = 0;
+
+ QZ_GL_MakeCurrent (this);
+
+ switch (attrib) {
+ case SDL_GL_RED_SIZE: attr = GL_RED_BITS; break;
+ case SDL_GL_BLUE_SIZE: attr = GL_BLUE_BITS; break;
+ case SDL_GL_GREEN_SIZE: attr = GL_GREEN_BITS; break;
+ case SDL_GL_ALPHA_SIZE: attr = GL_ALPHA_BITS; break;
+ case SDL_GL_DOUBLEBUFFER: attr = GL_DOUBLEBUFFER; break;
+ case SDL_GL_DEPTH_SIZE: attr = GL_DEPTH_BITS; break;
+ case SDL_GL_STENCIL_SIZE: attr = GL_STENCIL_BITS; break;
+ case SDL_GL_ACCUM_RED_SIZE: attr = GL_ACCUM_RED_BITS; break;
+ case SDL_GL_ACCUM_GREEN_SIZE: attr = GL_ACCUM_GREEN_BITS; break;
+ case SDL_GL_ACCUM_BLUE_SIZE: attr = GL_ACCUM_BLUE_BITS; break;
+ case SDL_GL_ACCUM_ALPHA_SIZE: attr = GL_ACCUM_ALPHA_BITS; break;
+ case SDL_GL_STEREO: attr = GL_STEREO; break;
+ case SDL_GL_MULTISAMPLEBUFFERS: attr = GL_SAMPLE_BUFFERS_ARB; break;
+ case SDL_GL_MULTISAMPLESAMPLES: attr = GL_SAMPLES_ARB; break;
+ case SDL_GL_BUFFER_SIZE:
+ {
+ GLint bits = 0;
+ GLint component;
+
+ /* there doesn't seem to be a single flag in OpenGL for this! */
+ glGetIntegerv (GL_RED_BITS, &component); bits += component;
+ glGetIntegerv (GL_GREEN_BITS,&component); bits += component;
+ glGetIntegerv (GL_BLUE_BITS, &component); bits += component;
+ glGetIntegerv (GL_ALPHA_BITS, &component); bits += component;
+
+ *value = bits;
+ return 0;
+ }
+ case SDL_GL_ACCELERATED_VISUAL:
+ {
+ GLint val;
+ /* FIXME: How do we get this information here?
+ [fmt getValues: &val forAttribute: NSOpenGLPFAAccelerated attr forVirtualScreen: 0];
+ */
+ val = (this->gl_config.accelerated != 0);;
+ *value = val;
+ return 0;
+ }
+ case SDL_GL_SWAP_CONTROL:
+ {
+ GLint val;
+ [ gl_context getValues: &val forParameter: NSOpenGLCPSwapInterval ];
+ *value = val;
+ return 0;
+ }
+ }
+
+ glGetIntegerv (attr, (GLint *)value);
+ return 0;
+}
+
+int QZ_GL_MakeCurrent (_THIS) {
+ [ gl_context makeCurrentContext ];
+ return 0;
+}
+
+void QZ_GL_SwapBuffers (_THIS) {
+ [ gl_context flushBuffer ];
+}
diff --git a/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzKeys.h b/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzKeys.h
new file mode 100644
index 0000000..82b7859
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzKeys.h
@@ -0,0 +1,146 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* These are the Macintosh key scancode constants -- from Inside Macintosh */
+
+#define QZ_ESCAPE 0x35
+#define QZ_F1 0x7A
+#define QZ_F2 0x78
+#define QZ_F3 0x63
+#define QZ_F4 0x76
+#define QZ_F5 0x60
+#define QZ_F6 0x61
+#define QZ_F7 0x62
+#define QZ_F8 0x64
+#define QZ_F9 0x65
+#define QZ_F10 0x6D
+#define QZ_F11 0x67
+#define QZ_F12 0x6F
+#define QZ_F13 0x69
+#define QZ_F14 0x6B
+#define QZ_F15 0x71
+/*
+#define QZ_PRINT 0x69
+#define QZ_SCROLLOCK 0x6B
+#define QZ_PAUSE 0x71
+*/
+#define QZ_POWER 0x7F
+#define QZ_BACKQUOTE 0x32
+#define QZ_1 0x12
+#define QZ_2 0x13
+#define QZ_3 0x14
+#define QZ_4 0x15
+#define QZ_5 0x17
+#define QZ_6 0x16
+#define QZ_7 0x1A
+#define QZ_8 0x1C
+#define QZ_9 0x19
+#define QZ_0 0x1D
+#define QZ_MINUS 0x1B
+#define QZ_EQUALS 0x18
+#define QZ_BACKSPACE 0x33
+#define QZ_INSERT 0x72
+#define QZ_HOME 0x73
+#define QZ_PAGEUP 0x74
+#define QZ_NUMLOCK 0x47
+#define QZ_KP_EQUALS 0x51
+#define QZ_KP_DIVIDE 0x4B
+#define QZ_KP_MULTIPLY 0x43
+#define QZ_TAB 0x30
+#define QZ_q 0x0C
+#define QZ_w 0x0D
+#define QZ_e 0x0E
+#define QZ_r 0x0F
+#define QZ_t 0x11
+#define QZ_y 0x10
+#define QZ_u 0x20
+#define QZ_i 0x22
+#define QZ_o 0x1F
+#define QZ_p 0x23
+#define QZ_LEFTBRACKET 0x21
+#define QZ_RIGHTBRACKET 0x1E
+#define QZ_BACKSLASH 0x2A
+#define QZ_DELETE 0x75
+#define QZ_END 0x77
+#define QZ_PAGEDOWN 0x79
+#define QZ_KP7 0x59
+#define QZ_KP8 0x5B
+#define QZ_KP9 0x5C
+#define QZ_KP_MINUS 0x4E
+#define QZ_CAPSLOCK 0x39
+#define QZ_a 0x00
+#define QZ_s 0x01
+#define QZ_d 0x02
+#define QZ_f 0x03
+#define QZ_g 0x05
+#define QZ_h 0x04
+#define QZ_j 0x26
+#define QZ_k 0x28
+#define QZ_l 0x25
+#define QZ_SEMICOLON 0x29
+#define QZ_QUOTE 0x27
+#define QZ_RETURN 0x24
+#define QZ_KP4 0x56
+#define QZ_KP5 0x57
+#define QZ_KP6 0x58
+#define QZ_KP_PLUS 0x45
+#define QZ_LSHIFT 0x38
+#define QZ_z 0x06
+#define QZ_x 0x07
+#define QZ_c 0x08
+#define QZ_v 0x09
+#define QZ_b 0x0B
+#define QZ_n 0x2D
+#define QZ_m 0x2E
+#define QZ_COMMA 0x2B
+#define QZ_PERIOD 0x2F
+#define QZ_SLASH 0x2C
+#if 1 /* Panther now defines right side keys */
+#define QZ_RSHIFT 0x3C
+#endif
+#define QZ_UP 0x7E
+#define QZ_KP1 0x53
+#define QZ_KP2 0x54
+#define QZ_KP3 0x55
+#define QZ_KP_ENTER 0x4C
+#define QZ_LCTRL 0x3B
+#define QZ_LALT 0x3A
+#define QZ_LMETA 0x37
+#define QZ_SPACE 0x31
+#if 1 /* Panther now defines right side keys */
+#define QZ_RMETA 0x36
+#define QZ_RALT 0x3D
+#define QZ_RCTRL 0x3E
+#endif
+#define QZ_LEFT 0x7B
+#define QZ_DOWN 0x7D
+#define QZ_RIGHT 0x7C
+#define QZ_KP0 0x52
+#define QZ_KP_PERIOD 0x41
+
+/* Wierd, these keys are on my iBook under Mac OS X */
+#define QZ_IBOOK_ENTER 0x34
+#define QZ_IBOOK_LEFT 0x3B
+#define QZ_IBOOK_RIGHT 0x3C
+#define QZ_IBOOK_DOWN 0x3D
+#define QZ_IBOOK_UP 0x3E
diff --git a/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzVideo.h b/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzVideo.h
new file mode 100644
index 0000000..d00e496
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzVideo.h
@@ -0,0 +1,235 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ @file SDL_QuartzVideo.h
+ @author Darrell Walisser, Max Horn, et al.
+
+ @abstract SDL video driver for Mac OS X.
+
+ @discussion
+
+ TODO
+ - Hardware Cursor support with NSCursor instead of Carbon
+ - Keyboard repeat/mouse speed adjust (if needed)
+ - Multiple monitor support (currently only main display)
+ - Accelerated blitting support
+ - Fix white OpenGL window on minimize (fixed) (update: broken again on 10.2)
+ - Find out what events should be sent/ignored if window is minimized
+ - Find a way to deal with external resolution/depth switch while app is running
+ - Check accuracy of QZ_SetGamma()
+ Problems:
+ - OGL not working in full screen with software renderer
+ - SetColors sets palette correctly but clears framebuffer
+ - Crash in CG after several mode switches (I think this has been fixed)
+ - Retained windows don't draw their title bar quite right (OS Bug) (not using retained windows)
+ - Cursor in 8 bit modes is screwy (might just be Radeon PCI bug) (update: not just Radeon)
+ - Warping cursor delays mouse events for a fraction of a second,
+ there is a hack around this that helps a bit
+*/
+
+/* Needs to be first, so QuickTime.h doesn't include glext.h (10.4) */
+#include "SDL_opengl.h"
+
+#include <Cocoa/Cocoa.h>
+#include <Carbon/Carbon.h>
+#include <OpenGL/OpenGL.h> /* For CGL functions and types */
+#include <IOKit/IOKitLib.h> /* For powersave handling */
+#include <pthread.h>
+
+#include "SDL_thread.h"
+#include "SDL_video.h"
+#include "SDL_error.h"
+#include "SDL_timer.h"
+#include "SDL_loadso.h"
+#include "SDL_syswm.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+
+
+#ifdef __powerpc__
+/*
+ This is a workaround to directly access NSOpenGLContext's CGL context
+ We need this to check for errors NSOpenGLContext doesn't support
+ Please note this is only used on PowerPC (Intel Macs are guaranteed to
+ have a better API for this, since it showed up in Mac OS X 10.3).
+*/
+@interface NSOpenGLContext (CGLContextAccess)
+- (CGLContextObj) cglContext;
+@end
+#endif
+
+/* use this to get the CGLContext; it handles Cocoa interface changes. */
+CGLContextObj QZ_GetCGLContextObj(NSOpenGLContext *nsctx);
+
+
+/* Main driver structure to store required state information */
+typedef struct SDL_PrivateVideoData {
+ BOOL use_new_mode_apis; /* 1 == >= 10.6 APIs available */
+ BOOL allow_screensaver; /* 0 == disable screensaver */
+ CGDirectDisplayID display; /* 0 == main display (only support single display) */
+ const void *mode; /* current mode of the display */
+ const void *save_mode; /* original mode of the display */
+ CGDirectPaletteRef palette; /* palette of an 8-bit display */
+ NSOpenGLContext *gl_context; /* OpenGL rendering context */
+ NSGraphicsContext *nsgfx_context; /* Cocoa graphics context */
+ Uint32 width, height, bpp; /* frequently used data about the display */
+ Uint32 flags; /* flags for current mode, for teardown purposes */
+ Uint32 video_set; /* boolean; indicates if video was set correctly */
+ Uint32 warp_flag; /* boolean; notify to event loop that a warp just occured */
+ Uint32 warp_ticks; /* timestamp when the warp occured */
+ NSWindow *window; /* Cocoa window to implement the SDL window */
+ NSView *view; /* the window's view; draw 2D and OpenGL into this view */
+ CGContextRef cg_context; /* CoreGraphics rendering context */
+ SDL_Surface *resize_icon; /* icon for the resize badge, we have to draw it by hand */
+ SDL_GrabMode current_grab_mode; /* default value is SDL_GRAB_OFF */
+ SDL_Rect **client_mode_list; /* resolution list to pass back to client */
+ SDLKey keymap[256]; /* Mac OS X to SDL key mapping */
+ Uint32 current_mods; /* current keyboard modifiers, to track modifier state */
+ NSText *field_edit; /* a field editor for keyboard composition processing */
+ Uint32 last_virtual_button;/* last virtual mouse button pressed */
+ io_connect_t power_connection; /* used with IOKit to detect wake from sleep */
+ Uint8 expect_mouse_up; /* used to determine when to send mouse up events */
+ Uint8 grab_state; /* used to manage grab behavior */
+ NSPoint cursor_loc; /* saved cursor coords, for activate/deactivate when grabbed */
+ BOOL cursor_should_be_visible; /* tells if cursor is supposed to be visible (SDL_ShowCursor) */
+ BOOL cursor_visible; /* tells if cursor is *actually* visible or not */
+ Uint8* sw_buffers[2]; /* pointers to the two software buffers for double-buffer emulation */
+ SDL_Thread *thread; /* thread for async updates to the screen */
+ SDL_sem *sem1, *sem2; /* synchronization for async screen updates */
+ Uint8 *current_buffer; /* the buffer being copied to the screen */
+ BOOL quit_thread; /* used to quit the async blitting thread */
+ SInt32 system_version; /* used to dis-/enable workarounds depending on the system version */
+
+ void *opengl_library; /* dynamically loaded OpenGL library. */
+} SDL_PrivateVideoData;
+
+#define _THIS SDL_VideoDevice *this
+#define display_id (this->hidden->display)
+#define mode (this->hidden->mode)
+#define save_mode (this->hidden->save_mode)
+#define use_new_mode_apis (this->hidden->use_new_mode_apis)
+#define allow_screensaver (this->hidden->allow_screensaver)
+#define palette (this->hidden->palette)
+#define gl_context (this->hidden->gl_context)
+#define nsgfx_context (this->hidden->nsgfx_context)
+#define device_width (this->hidden->width)
+#define device_height (this->hidden->height)
+#define device_bpp (this->hidden->bpp)
+#define mode_flags (this->hidden->flags)
+#define qz_window (this->hidden->window)
+#define window_view (this->hidden->view)
+#define cg_context (this->hidden->cg_context)
+#define video_set (this->hidden->video_set)
+#define warp_ticks (this->hidden->warp_ticks)
+#define warp_flag (this->hidden->warp_flag)
+#define resize_icon (this->hidden->resize_icon)
+#define current_grab_mode (this->hidden->current_grab_mode)
+#define client_mode_list (this->hidden->client_mode_list)
+#define keymap (this->hidden->keymap)
+#define current_mods (this->hidden->current_mods)
+#define field_edit (this->hidden->field_edit)
+#define last_virtual_button (this->hidden->last_virtual_button)
+#define power_connection (this->hidden->power_connection)
+#define expect_mouse_up (this->hidden->expect_mouse_up)
+#define grab_state (this->hidden->grab_state)
+#define cursor_loc (this->hidden->cursor_loc)
+#define cursor_should_be_visible (this->hidden->cursor_should_be_visible)
+#define cursor_visible (this->hidden->cursor_visible)
+#define sw_buffers (this->hidden->sw_buffers)
+#define sw_contexts (this->hidden->sw_contexts)
+#define thread (this->hidden->thread)
+#define sem1 (this->hidden->sem1)
+#define sem2 (this->hidden->sem2)
+#define current_buffer (this->hidden->current_buffer)
+#define quit_thread (this->hidden->quit_thread)
+#define system_version (this->hidden->system_version)
+#define opengl_library (this->hidden->opengl_library)
+
+/* grab states - the input is in one of these states */
+enum {
+ QZ_UNGRABBED = 0,
+ QZ_VISIBLE_GRAB,
+ QZ_INVISIBLE_GRAB
+};
+
+/* grab actions - these can change the grabbed state */
+enum {
+ QZ_ENABLE_GRAB = 0,
+ QZ_DISABLE_GRAB,
+ QZ_HIDECURSOR,
+ QZ_SHOWCURSOR
+};
+
+/* Gamma Functions */
+int QZ_SetGamma (_THIS, float red, float green, float blue);
+int QZ_GetGamma (_THIS, float *red, float *green, float *blue);
+int QZ_SetGammaRamp (_THIS, Uint16 *ramp);
+int QZ_GetGammaRamp (_THIS, Uint16 *ramp);
+
+/* OpenGL functions */
+int QZ_SetupOpenGL (_THIS, int bpp, Uint32 flags);
+void QZ_TearDownOpenGL (_THIS);
+void* QZ_GL_GetProcAddress (_THIS, const char *proc);
+int QZ_GL_GetAttribute (_THIS, SDL_GLattr attrib, int* value);
+int QZ_GL_MakeCurrent (_THIS);
+void QZ_GL_SwapBuffers (_THIS);
+int QZ_GL_LoadLibrary (_THIS, const char *location);
+
+/* Cursor and Mouse functions */
+void QZ_FreeWMCursor (_THIS, WMcursor *cursor);
+WMcursor* QZ_CreateWMCursor (_THIS, Uint8 *data, Uint8 *mask,
+ int w, int h, int hot_x, int hot_y);
+int QZ_ShowWMCursor (_THIS, WMcursor *cursor);
+void QZ_WarpWMCursor (_THIS, Uint16 x, Uint16 y);
+void QZ_MoveWMCursor (_THIS, int x, int y);
+void QZ_CheckMouseMode (_THIS);
+void QZ_UpdateMouse (_THIS);
+
+/* Event functions */
+void QZ_InitOSKeymap (_THIS);
+void QZ_PumpEvents (_THIS);
+
+/* Window Manager functions */
+void QZ_SetCaption (_THIS, const char *title, const char *icon);
+void QZ_SetIcon (_THIS, SDL_Surface *icon, Uint8 *mask);
+int QZ_IconifyWindow (_THIS);
+void QZ_SetWindowPos (_THIS, int x, int y);
+void QZ_GetWindowPos (_THIS, int *px, int *py);
+int QZ_IsWindowVisible (_THIS, int recenter);
+int QZ_GetMonitorDPI (_THIS, int *xDpi, int *yDpi);
+int QZ_GetMonitorRect (_THIS, SDL_Rect *rect);
+
+SDL_GrabMode QZ_GrabInput (_THIS, SDL_GrabMode grab_mode);
+/*int QZ_GetWMInfo (_THIS, SDL_SysWMinfo *info);*/
+
+/* Private functions (used internally) */
+void QZ_PrivateWarpCursor (_THIS, int x, int y);
+void QZ_ChangeGrabState (_THIS, int action);
+void QZ_RegisterForSleepNotifications (_THIS);
+void QZ_PrivateGlobalToLocal (_THIS, NSPoint *p);
+void QZ_PrivateCocoaToSDL (_THIS, NSPoint *p);
+BOOL QZ_IsMouseInWindow (_THIS);
+void QZ_DoActivate (_THIS);
+void QZ_DoDeactivate (_THIS);
diff --git a/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzVideo.m b/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzVideo.m
new file mode 100644
index 0000000..bb20172
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzVideo.m
@@ -0,0 +1,1695 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_QuartzVideo.h"
+#include "SDL_QuartzWindow.h"
+#include "SDL_QuartzWM.h"
+
+/* These APIs aren't just deprecated; they're gone from the headers in the
+ 10.7 SDK. If we're using a >= 10.7 SDK, but targeting < 10.7, then we
+ force these function declarations. */
+#if ((MAC_OS_X_VERSION_MIN_REQUIRED < 1070) && (MAC_OS_X_VERSION_MAX_ALLOWED >= 1070))
+CG_EXTERN void *CGDisplayBaseAddress(CGDirectDisplayID display)
+ CG_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6,
+ __IPHONE_NA, __IPHONE_NA);
+CG_EXTERN size_t CGDisplayBytesPerRow(CGDirectDisplayID display)
+ CG_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_6,
+ __IPHONE_NA, __IPHONE_NA);
+#endif
+
+
+static inline BOOL IS_LION_OR_LATER(_THIS)
+{
+ return (system_version >= 0x1070);
+}
+
+static inline BOOL IS_SNOW_LEOPARD_OR_LATER(_THIS)
+{
+ return (system_version >= 0x1060);
+}
+
+#if (MAC_OS_X_VERSION_MAX_ALLOWED < 1060) && !defined(__LP64__) /* Fixed in Snow Leopard */
+/*
+ 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
+static inline void QZ_SetFrame(_THIS, NSScreen *nsscreen, NSRect frame)
+{
+ if (!IS_SNOW_LEOPARD_OR_LATER(this)) {
+ [nsscreen setFrame:frame];
+ }
+}
+#else
+static inline void QZ_SetFrame(_THIS, NSScreen *nsscreen, NSRect frame)
+{
+}
+#endif
+
+@interface SDLTranslatorResponder : NSTextView
+{
+}
+- (void) doCommandBySelector:(SEL)myselector;
+@end
+
+@implementation SDLTranslatorResponder
+- (void) doCommandBySelector:(SEL) myselector {}
+@end
+
+/* absent in 10.3.9. */
+CG_EXTERN CGImageRef CGBitmapContextCreateImage (CGContextRef);
+
+/* Bootstrap functions */
+static int QZ_Available ();
+static SDL_VideoDevice* QZ_CreateDevice (int device_index);
+static void QZ_DeleteDevice (SDL_VideoDevice *device);
+
+/* Initialization, Query, Setup, and Redrawing functions */
+static int QZ_VideoInit (_THIS, SDL_PixelFormat *video_format);
+
+static SDL_Rect** QZ_ListModes (_THIS, SDL_PixelFormat *format,
+ Uint32 flags);
+static void QZ_UnsetVideoMode (_THIS, BOOL to_desktop, BOOL save_gl);
+
+static SDL_Surface* QZ_SetVideoMode (_THIS, SDL_Surface *current,
+ int width, int height, int bpp,
+ Uint32 flags);
+static int QZ_ToggleFullScreen (_THIS, int on);
+static int QZ_SetColors (_THIS, int first_color,
+ int num_colors, SDL_Color *colors);
+
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
+static int QZ_LockDoubleBuffer (_THIS, SDL_Surface *surface);
+static void QZ_UnlockDoubleBuffer (_THIS, SDL_Surface *surface);
+static int QZ_ThreadFlip (_THIS);
+static int QZ_FlipDoubleBuffer (_THIS, SDL_Surface *surface);
+static void QZ_DoubleBufferUpdate (_THIS, int num_rects, SDL_Rect *rects);
+static void QZ_DirectUpdate (_THIS, int num_rects, SDL_Rect *rects);
+#endif
+
+static void QZ_UpdateRects (_THIS, int num_rects, SDL_Rect *rects);
+static void QZ_VideoQuit (_THIS);
+
+static int QZ_LockHWSurface(_THIS, SDL_Surface *surface);
+static void QZ_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static int QZ_AllocHWSurface(_THIS, SDL_Surface *surface);
+static void QZ_FreeHWSurface (_THIS, SDL_Surface *surface);
+
+/* Bootstrap binding, enables entry point into the driver */
+VideoBootStrap QZ_bootstrap = {
+ "Quartz", "Mac OS X CoreGraphics", QZ_Available, QZ_CreateDevice
+};
+
+/* Disable compiler warnings we can't avoid. */
+#if (defined(__GNUC__) && (__GNUC__ >= 4))
+# if (MAC_OS_X_VERSION_MAX_ALLOWED <= 1070)
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+# endif
+#endif
+
+static void QZ_ReleaseDisplayMode(_THIS, const void *moderef)
+{
+ /* we only own these references in the 10.6+ API. */
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
+ if (use_new_mode_apis) {
+ CGDisplayModeRelease((CGDisplayModeRef) moderef);
+ }
+#endif
+}
+
+static void QZ_ReleaseDisplayModeList(_THIS, CFArrayRef mode_list)
+{
+ /* we only own these references in the 10.6+ API. */
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
+ if (use_new_mode_apis) {
+ CFRelease(mode_list);
+ }
+#endif
+}
+
+
+/* Bootstrap functions */
+static int QZ_Available ()
+{
+ return 1;
+}
+
+static SDL_VideoDevice* QZ_CreateDevice (int device_index)
+{
+#pragma unused (device_index)
+
+ SDL_VideoDevice *device;
+ SDL_PrivateVideoData *hidden;
+
+ device = (SDL_VideoDevice*) SDL_malloc (sizeof (*device) );
+ hidden = (SDL_PrivateVideoData*) SDL_malloc (sizeof (*hidden) );
+
+ if (device == NULL || hidden == NULL)
+ SDL_OutOfMemory ();
+
+ SDL_memset (device, 0, sizeof (*device) );
+ SDL_memset (hidden, 0, sizeof (*hidden) );
+
+ device->hidden = hidden;
+
+ device->VideoInit = QZ_VideoInit;
+ device->ListModes = QZ_ListModes;
+ device->SetVideoMode = QZ_SetVideoMode;
+ device->ToggleFullScreen = QZ_ToggleFullScreen;
+ device->UpdateMouse = QZ_UpdateMouse;
+ device->SetColors = QZ_SetColors;
+ /* device->UpdateRects = QZ_UpdateRects; this is determined by SetVideoMode() */
+ device->VideoQuit = QZ_VideoQuit;
+
+ device->LockHWSurface = QZ_LockHWSurface;
+ device->UnlockHWSurface = QZ_UnlockHWSurface;
+ device->AllocHWSurface = QZ_AllocHWSurface;
+ device->FreeHWSurface = QZ_FreeHWSurface;
+
+ device->SetGamma = QZ_SetGamma;
+ device->GetGamma = QZ_GetGamma;
+ device->SetGammaRamp = QZ_SetGammaRamp;
+ device->GetGammaRamp = QZ_GetGammaRamp;
+
+ device->GL_GetProcAddress = QZ_GL_GetProcAddress;
+ device->GL_GetAttribute = QZ_GL_GetAttribute;
+ device->GL_MakeCurrent = QZ_GL_MakeCurrent;
+ device->GL_SwapBuffers = QZ_GL_SwapBuffers;
+ device->GL_LoadLibrary = QZ_GL_LoadLibrary;
+
+ device->FreeWMCursor = QZ_FreeWMCursor;
+ device->CreateWMCursor = QZ_CreateWMCursor;
+ device->ShowWMCursor = QZ_ShowWMCursor;
+ device->WarpWMCursor = QZ_WarpWMCursor;
+ device->MoveWMCursor = QZ_MoveWMCursor;
+ device->CheckMouseMode = QZ_CheckMouseMode;
+ device->InitOSKeymap = QZ_InitOSKeymap;
+ device->PumpEvents = QZ_PumpEvents;
+
+ device->SetCaption = QZ_SetCaption;
+ device->SetIcon = QZ_SetIcon;
+ device->IconifyWindow = QZ_IconifyWindow;
+ device->SetWindowPos = QZ_SetWindowPos;
+ device->GetWindowPos = QZ_GetWindowPos;
+ device->IsWindowVisible = QZ_IsWindowVisible;
+ device->GetMonitorDPI = QZ_GetMonitorDPI;
+ device->GetMonitorRect = QZ_GetMonitorRect;
+ device->GetWMInfo = QZ_GetWMInfo;
+ device->GrabInput = QZ_GrabInput;
+
+ /*
+ * This is a big hassle, needing QuickDraw and QuickTime on older
+ * systems, and god knows what on 10.6, so we immediately fail here,
+ * which causes SDL to make an RGB surface and manage the YUV overlay
+ * in software. Sorry. Use SDL 1.3 if you want YUV rendering in a pixel
+ * shader. :)
+ */
+ /*device->CreateYUVOverlay = QZ_CreateYUVOverlay;*/
+
+ device->free = QZ_DeleteDevice;
+
+ return device;
+}
+
+static void QZ_DeleteDevice (SDL_VideoDevice *device)
+{
+ _THIS = device;
+ QZ_ReleaseDisplayMode(this, save_mode);
+ QZ_ReleaseDisplayMode(this, mode);
+ SDL_free (device->hidden);
+ SDL_free (device);
+}
+
+static void QZ_GetModeInfo(_THIS, const void *_mode, Uint32 *w, Uint32 *h, Uint32 *bpp)
+{
+ *w = *h = *bpp = 0;
+ if (_mode == NULL) {
+ return;
+ }
+
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
+ if (use_new_mode_apis) {
+ CGDisplayModeRef vidmode = (CGDisplayModeRef) _mode;
+ CFStringRef fmt = CGDisplayModeCopyPixelEncoding(vidmode);
+
+ *w = (Uint32) CGDisplayModeGetWidth(vidmode);
+ *h = (Uint32) CGDisplayModeGetHeight(vidmode);
+
+ /* we only care about the 32-bit modes... */
+ if (CFStringCompare(fmt, CFSTR(IO32BitDirectPixels),
+ kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
+ *bpp = 32;
+ }
+
+ CFRelease(fmt);
+ }
+#endif
+
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1060)
+ if (!use_new_mode_apis) {
+ CFDictionaryRef vidmode = (CFDictionaryRef) _mode;
+ CFNumberGetValue (
+ CFDictionaryGetValue (vidmode, kCGDisplayBitsPerPixel),
+ kCFNumberSInt32Type, bpp);
+
+ CFNumberGetValue (
+ CFDictionaryGetValue (vidmode, kCGDisplayWidth),
+ kCFNumberSInt32Type, w);
+
+ CFNumberGetValue (
+ CFDictionaryGetValue (vidmode, kCGDisplayHeight),
+ kCFNumberSInt32Type, h);
+ }
+#endif
+
+ /* we only care about the 32-bit modes... */
+ if (*bpp != 32) {
+ *bpp = 0;
+ }
+}
+
+static int QZ_VideoInit (_THIS, SDL_PixelFormat *video_format)
+{
+ NSRect r = NSMakeRect(0.0, 0.0, 0.0, 0.0);
+ const char *env = NULL;
+
+ if ( Gestalt(gestaltSystemVersion, &system_version) != noErr )
+ system_version = 0;
+
+ use_new_mode_apis = NO;
+
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
+ use_new_mode_apis = IS_SNOW_LEOPARD_OR_LATER(this);
+#endif
+
+ /* Initialize the video settings; this data persists between mode switches */
+ display_id = kCGDirectMainDisplay;
+
+#if 0 /* The mouse event code needs to take this into account... */
+ env = getenv("SDL_VIDEO_FULLSCREEN_DISPLAY");
+ if ( env ) {
+ int monitor = SDL_atoi(env);
+ CGDirectDisplayID activeDspys [3];
+ CGDisplayCount dspyCnt;
+ CGGetActiveDisplayList (3, activeDspys, &dspyCnt);
+ if ( monitor >= 0 && monitor < dspyCnt ) {
+ display_id = activeDspys[monitor];
+ }
+ }
+#endif
+
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
+ if (use_new_mode_apis) {
+ save_mode = CGDisplayCopyDisplayMode(display_id);
+ }
+#endif
+
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1060)
+ if (!use_new_mode_apis) {
+ save_mode = CGDisplayCurrentMode(display_id);
+ }
+#endif
+
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
+ if (!IS_LION_OR_LATER(this)) {
+ palette = CGPaletteCreateDefaultColorPalette();
+ }
+#endif
+
+ if (save_mode == NULL) {
+ SDL_SetError("Couldn't figure out current display mode.");
+ return -1;
+ }
+
+ /* Allow environment override of screensaver disable. */
+ env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
+ if ( env ) {
+ allow_screensaver = SDL_atoi(env);
+ } else {
+#ifdef SDL_VIDEO_DISABLE_SCREENSAVER
+ allow_screensaver = 0;
+#else
+ allow_screensaver = 1;
+#endif
+ }
+
+ /* Gather some information that is useful to know about the display */
+ QZ_GetModeInfo(this, save_mode, &device_width, &device_height, &device_bpp);
+ if (device_bpp == 0) {
+ QZ_ReleaseDisplayMode(this, save_mode);
+ save_mode = NULL;
+ SDL_SetError("Unsupported display mode");
+ return -1;
+ }
+
+ /* Determine the current screen size */
+ this->info.current_w = device_width;
+ this->info.current_h = device_height;
+
+ /* Determine the default screen depth */
+ video_format->BitsPerPixel = device_bpp;
+
+ /* Set misc globals */
+ current_grab_mode = SDL_GRAB_OFF;
+ cursor_should_be_visible = YES;
+ cursor_visible = YES;
+ current_mods = 0;
+ field_edit = [[SDLTranslatorResponder alloc] initWithFrame:r];
+
+ /* register for sleep notifications so wake from sleep generates SDL_VIDEOEXPOSE */
+ QZ_RegisterForSleepNotifications (this);
+
+ /* Fill in some window manager capabilities */
+ this->info.wm_available = 1;
+
+ return 0;
+}
+
+static SDL_Rect** QZ_ListModes (_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ CFArrayRef mode_list = NULL; /* list of available fullscreen modes */
+ CFIndex num_modes;
+ CFIndex i;
+
+ int list_size = 0;
+
+ /* Any windowed mode is acceptable */
+ if ( (flags & SDL_FULLSCREEN) == 0 )
+ return (SDL_Rect**)-1;
+
+ /* Free memory from previous call, if any */
+ if ( client_mode_list != NULL ) {
+ int i;
+
+ for (i = 0; client_mode_list[i] != NULL; i++)
+ SDL_free (client_mode_list[i]);
+
+ SDL_free (client_mode_list);
+ client_mode_list = NULL;
+ }
+
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
+ if (use_new_mode_apis) {
+ mode_list = CGDisplayCopyAllDisplayModes(display_id, NULL);
+ }
+#endif
+
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1060)
+ if (!use_new_mode_apis) {
+ mode_list = CGDisplayAvailableModes(display_id);
+ }
+#endif
+
+ num_modes = CFArrayGetCount (mode_list);
+
+ /* Build list of modes with the requested bpp */
+ for (i = 0; i < num_modes; i++) {
+ Uint32 width, height, bpp;
+ const void *onemode = CFArrayGetValueAtIndex(mode_list, i);
+
+ QZ_GetModeInfo(this, onemode, &width, &height, &bpp);
+
+ if (bpp && (bpp == format->BitsPerPixel)) {
+ int hasMode = SDL_FALSE;
+ int i;
+
+ /* Check if mode is already in the list */
+ for (i = 0; i < list_size; i++) {
+ if (client_mode_list[i]->w == width &&
+ client_mode_list[i]->h == height) {
+ hasMode = SDL_TRUE;
+ break;
+ }
+ }
+
+ /* Grow the list and add mode to the list */
+ if ( ! hasMode ) {
+ SDL_Rect *rect;
+
+ list_size++;
+
+ if (client_mode_list == NULL)
+ client_mode_list = (SDL_Rect**)
+ SDL_malloc (sizeof(*client_mode_list) * (list_size+1) );
+ else {
+ /* !!! FIXME: this leaks memory if SDL_realloc() fails! */
+ client_mode_list = (SDL_Rect**)
+ SDL_realloc (client_mode_list, sizeof(*client_mode_list) * (list_size+1));
+ }
+
+ rect = (SDL_Rect*) SDL_malloc (sizeof(**client_mode_list));
+
+ if (client_mode_list == NULL || rect == NULL) {
+ QZ_ReleaseDisplayModeList(this, mode_list);
+ SDL_OutOfMemory ();
+ return NULL;
+ }
+
+ rect->x = rect->y = 0;
+ rect->w = width;
+ rect->h = height;
+
+ client_mode_list[list_size-1] = rect;
+ client_mode_list[list_size] = NULL;
+ }
+ }
+ }
+
+ QZ_ReleaseDisplayModeList(this, mode_list);
+
+ /* Sort list largest to smallest (by area) */
+ {
+ int i, j;
+ for (i = 0; i < list_size; i++) {
+ for (j = 0; j < list_size-1; j++) {
+
+ int area1, area2;
+ area1 = client_mode_list[j]->w * client_mode_list[j]->h;
+ area2 = client_mode_list[j+1]->w * client_mode_list[j+1]->h;
+
+ if (area1 < area2) {
+ SDL_Rect *tmp = client_mode_list[j];
+ client_mode_list[j] = client_mode_list[j+1];
+ client_mode_list[j+1] = tmp;
+ }
+ }
+ }
+ }
+
+ return client_mode_list;
+}
+
+static SDL_bool QZ_WindowPosition(_THIS, int *x, int *y)
+{
+ const char *window = getenv("SDL_VIDEO_WINDOW_POS");
+ if ( window ) {
+ if ( sscanf(window, "%d,%d", x, y) == 2 ) {
+ return SDL_TRUE;
+ }
+ }
+ return SDL_FALSE;
+}
+
+static CGError QZ_SetDisplayMode(_THIS, const void *vidmode)
+{
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
+ if (use_new_mode_apis) {
+ return CGDisplaySetDisplayMode(display_id, (CGDisplayModeRef) vidmode, NULL);
+ }
+#endif
+
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1060)
+ if (!use_new_mode_apis) {
+ return CGDisplaySwitchToMode(display_id, (CFDictionaryRef) vidmode);
+ }
+#endif
+
+ return kCGErrorFailure;
+}
+
+static inline CGError QZ_RestoreDisplayMode(_THIS)
+{
+ return QZ_SetDisplayMode(this, save_mode);
+}
+
+static void QZ_UnsetVideoMode (_THIS, BOOL to_desktop, BOOL save_gl)
+{
+ /* Reset values that may change between switches */
+ this->info.blit_fill = 0;
+ this->FillHWRect = NULL;
+ this->UpdateRects = NULL;
+ this->LockHWSurface = NULL;
+ this->UnlockHWSurface = NULL;
+
+ if (cg_context) {
+ CGContextFlush (cg_context);
+ CGContextRelease (cg_context);
+ cg_context = nil;
+ }
+
+ /* Release fullscreen resources */
+ if ( mode_flags & SDL_FULLSCREEN ) {
+
+ NSRect screen_rect;
+
+ /* Release double buffer stuff */
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
+ if ( !IS_LION_OR_LATER(this) && (mode_flags & SDL_DOUBLEBUF) ) {
+ quit_thread = YES;
+ SDL_SemPost (sem1);
+ SDL_WaitThread (thread, NULL);
+ SDL_DestroySemaphore (sem1);
+ SDL_DestroySemaphore (sem2);
+ SDL_free (sw_buffers[0]);
+ }
+#endif
+
+ /* If we still have a valid window, close it. */
+ if ( qz_window ) {
+ NSCAssert([ qz_window delegate ] == nil, @"full screen window shouldn't have a delegate"); /* if that should ever change, we'd have to release it here */
+ [ qz_window close ]; /* includes release because [qz_window isReleasedWhenClosed] */
+ qz_window = nil;
+ window_view = nil;
+ }
+ /*
+ Release the OpenGL context
+ Do this first to avoid trash on the display before fade
+ */
+ if ( mode_flags & SDL_OPENGL ) {
+ if (!save_gl) {
+ QZ_TearDownOpenGL (this);
+ }
+
+ #ifdef __powerpc__ /* we only use this for pre-10.3 compatibility. */
+ CGLSetFullScreen (NULL);
+ #endif
+ }
+ if (to_desktop) {
+ /* !!! FIXME: keep an eye on this.
+ * This API is officially unavailable for 64-bit binaries.
+ * It happens to work, as of 10.7, but we're going to see if
+ * we can just simply do without it on newer OSes...
+ */
+ #if (MAC_OS_X_VERSION_MIN_REQUIRED < 1070) && !defined(__LP64__)
+ if ( !IS_LION_OR_LATER(this) ) {
+ ShowMenuBar ();
+ }
+ #endif
+
+ /* Restore original screen resolution/bpp */
+ QZ_RestoreDisplayMode (this);
+ CGReleaseAllDisplays ();
+ /*
+ Reset the main screen's rectangle
+ See comment in QZ_SetVideoFullscreen for why we do this
+ */
+ screen_rect = NSMakeRect(0,0,device_width,device_height);
+ QZ_SetFrame(this, [ NSScreen mainScreen ], screen_rect);
+ }
+ }
+ /* Release window mode resources */
+ else {
+ id delegate = [ qz_window delegate ];
+ [ qz_window close ]; /* includes release because [qz_window isReleasedWhenClosed] */
+ if (delegate != nil) [ delegate release ];
+ qz_window = nil;
+ window_view = nil;
+
+ /* Release the OpenGL context */
+ if ( mode_flags & SDL_OPENGL ) {
+ if (!save_gl) {
+ QZ_TearDownOpenGL (this);
+ }
+ }
+ }
+
+ /* Signal successful teardown */
+ video_set = SDL_FALSE;
+}
+
+static const void *QZ_BestMode(_THIS, const int bpp, const int w, const int h)
+{
+ const void *best = NULL;
+
+ if (bpp == 0) {
+ return NULL;
+ }
+
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
+ if (use_new_mode_apis) {
+ /* apparently, we have to roll our own now. :/ */
+ CFArrayRef mode_list = CGDisplayCopyAllDisplayModes(display_id, NULL);
+ if (mode_list != NULL) {
+ const CFIndex num_modes = CFArrayGetCount(mode_list);
+ CFIndex i;
+ for (i = 0; i < num_modes; i++) {
+ const void *vidmode = CFArrayGetValueAtIndex(mode_list, i);
+ Uint32 thisw, thish, thisbpp;
+ QZ_GetModeInfo(this, vidmode, &thisw, &thish, &thisbpp);
+
+ /* We only care about exact matches, apparently. */
+ if ((thisbpp == bpp) && (thisw == w) && (thish == h)) {
+ best = vidmode;
+ break; /* got it! */
+ }
+ }
+ CGDisplayModeRetain((CGDisplayModeRef) best); /* NULL is ok */
+ CFRelease(mode_list);
+ }
+ }
+#endif
+
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1060)
+ if (!use_new_mode_apis) {
+ boolean_t exact = 0;
+ best = CGDisplayBestModeForParameters(display_id, bpp, w, h, &exact);
+ if (!exact) {
+ best = NULL;
+ }
+ }
+#endif
+
+ return best;
+}
+
+static SDL_Surface* QZ_SetVideoFullScreen (_THIS, SDL_Surface *current, int width,
+ int height, int bpp, Uint32 flags,
+ const BOOL save_gl)
+{
+ const BOOL isLion = IS_LION_OR_LATER(this);
+ NSRect screen_rect;
+ CGError error;
+ NSRect contentRect;
+ CGDisplayFadeReservationToken fade_token = kCGDisplayFadeReservationInvalidToken;
+
+ current->flags = SDL_FULLSCREEN;
+ current->w = width;
+ current->h = height;
+
+ contentRect = NSMakeRect (0, 0, width, height);
+
+ /* Fade to black to hide resolution-switching flicker (and garbage
+ that is displayed by a destroyed OpenGL context, if applicable) */
+ if ( CGAcquireDisplayFadeReservation (5, &fade_token) == kCGErrorSuccess ) {
+ CGDisplayFade (fade_token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, TRUE);
+ }
+
+ /* Destroy any previous mode */
+ if (video_set == SDL_TRUE)
+ QZ_UnsetVideoMode (this, FALSE, save_gl);
+
+ /* Sorry, QuickDraw was ripped out. */
+ if (getenv("SDL_NSWindowPointer") || getenv("SDL_NSQuickDrawViewPointer")) {
+ SDL_SetError ("Embedded QuickDraw windows are no longer supported");
+ goto ERR_NO_MATCH;
+ }
+
+ QZ_ReleaseDisplayMode(this, mode); /* NULL is okay. */
+
+ /* See if requested mode exists */
+ mode = QZ_BestMode(this, bpp, width, height);
+
+ /* Require an exact match to the requested mode */
+ if ( mode == NULL ) {
+ SDL_SetError ("Failed to find display resolution: %dx%dx%d", width, height, bpp);
+ goto ERR_NO_MATCH;
+ }
+
+ /* Put up the blanking window (a window above all other windows) */
+ if (getenv ("SDL_SINGLEDISPLAY"))
+ error = CGDisplayCapture (display_id);
+ else
+ error = CGCaptureAllDisplays ();
+
+ if ( CGDisplayNoErr != error ) {
+ SDL_SetError ("Failed capturing display");
+ goto ERR_NO_CAPTURE;
+ }
+
+ /* Do the physical switch */
+ if ( CGDisplayNoErr != QZ_SetDisplayMode(this, mode) ) {
+ SDL_SetError ("Failed switching display resolution");
+ goto ERR_NO_SWITCH;
+ }
+
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
+ if ( !isLion ) {
+ current->pixels = (Uint32*) CGDisplayBaseAddress (display_id);
+ current->pitch = CGDisplayBytesPerRow (display_id);
+
+ current->flags |= SDL_HWSURFACE;
+ current->flags |= SDL_PREALLOC;
+ /* current->hwdata = (void *) CGDisplayGetDrawingContext (display_id); */
+
+ this->UpdateRects = QZ_DirectUpdate;
+ this->LockHWSurface = QZ_LockHWSurface;
+ this->UnlockHWSurface = QZ_UnlockHWSurface;
+
+ /* Setup double-buffer emulation */
+ if ( flags & SDL_DOUBLEBUF ) {
+
+ /*
+ Setup a software backing store for reasonable results when
+ double buffering is requested (since a single-buffered hardware
+ surface looks hideous).
+
+ The actual screen blit occurs in a separate thread to allow
+ other blitting while waiting on the VBL (and hence results in higher framerates).
+ */
+ this->LockHWSurface = NULL;
+ this->UnlockHWSurface = NULL;
+ this->UpdateRects = NULL;
+
+ current->flags |= (SDL_HWSURFACE|SDL_DOUBLEBUF);
+ this->UpdateRects = QZ_DoubleBufferUpdate;
+ this->LockHWSurface = QZ_LockDoubleBuffer;
+ this->UnlockHWSurface = QZ_UnlockDoubleBuffer;
+ this->FlipHWSurface = QZ_FlipDoubleBuffer;
+
+ current->pixels = SDL_malloc (current->pitch * current->h * 2);
+ if (current->pixels == NULL) {
+ SDL_OutOfMemory ();
+ goto ERR_DOUBLEBUF;
+ }
+
+ sw_buffers[0] = current->pixels;
+ sw_buffers[1] = (Uint8*)current->pixels + current->pitch * current->h;
+
+ quit_thread = NO;
+ sem1 = SDL_CreateSemaphore (0);
+ sem2 = SDL_CreateSemaphore (1);
+ thread = SDL_CreateThread ((int (*)(void *))QZ_ThreadFlip, this);
+ }
+
+ if ( CGDisplayCanSetPalette (display_id) )
+ current->flags |= SDL_HWPALETTE;
+ }
+#endif
+
+ /* Check if we should recreate the window */
+ if (qz_window == nil) {
+ /* Manually create a window, avoids having a nib file resource */
+ qz_window = [ [ SDL_QuartzWindow alloc ]
+ initWithContentRect:contentRect
+ styleMask:(isLion ? NSBorderlessWindowMask : 0)
+ backing:NSBackingStoreBuffered
+ defer:NO ];
+
+ if (qz_window != nil) {
+ [ qz_window setAcceptsMouseMovedEvents:YES ];
+ [ qz_window setViewsNeedDisplay:NO ];
+ if (isLion) {
+ [ qz_window setContentView: [ [ [ SDL_QuartzView alloc ] init ] autorelease ] ];
+ }
+ }
+ }
+ /* We already have a window, just change its size */
+ else {
+ [ qz_window setContentSize:contentRect.size ];
+ current->flags |= (SDL_NOFRAME|SDL_RESIZABLE) & mode_flags;
+ [ window_view setFrameSize:contentRect.size ];
+ }
+
+ /* Setup OpenGL for a fullscreen context */
+ if (flags & SDL_OPENGL) {
+
+ if ( ! save_gl ) {
+ if ( ! QZ_SetupOpenGL (this, bpp, flags) ) {
+ goto ERR_NO_GL;
+ }
+ }
+
+ /* Initialize the NSView and add it to our window. The presence of a valid window and
+ view allow the cursor to be changed whilst in fullscreen.*/
+ window_view = [ [ NSView alloc ] initWithFrame:contentRect ];
+
+ if ( isLion ) {
+ [ window_view setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable ];
+ }
+
+ [ [ qz_window contentView ] addSubview:window_view ];
+
+ /* Apparently Lion checks some version flag set by the linker
+ and changes API behavior. Annoying. */
+ if ( isLion ) {
+ [ qz_window setLevel:CGShieldingWindowLevel() ];
+ [ gl_context setView: window_view ];
+ //[ gl_context setFullScreen ];
+ [ gl_context update ];
+ }
+
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
+ if ( !isLion ) {
+ CGLError err;
+ CGLContextObj ctx;
+
+ [ qz_window setLevel:NSNormalWindowLevel ];
+ ctx = QZ_GetCGLContextObj (gl_context);
+ err = CGLSetFullScreen (ctx);
+
+ if (err) {
+ SDL_SetError ("Error setting OpenGL fullscreen: %s", CGLErrorString(err));
+ goto ERR_NO_GL;
+ }
+ }
+#endif
+
+ [ window_view release ];
+ [ gl_context makeCurrentContext];
+
+ glClear (GL_COLOR_BUFFER_BIT);
+
+ [ gl_context flushBuffer ];
+
+ current->flags |= SDL_OPENGL;
+ } else if (isLion) { /* For 2D, we build a CGBitmapContext */
+ CGColorSpaceRef cgColorspace;
+
+ /* Only recreate the view if it doesn't already exist */
+ if (window_view == nil) {
+ window_view = [ [ NSView alloc ] initWithFrame:contentRect ];
+ [ window_view setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable ];
+ [ [ qz_window contentView ] addSubview:window_view ];
+ [ window_view release ];
+ }
+
+ cgColorspace = CGColorSpaceCreateDeviceRGB();
+ current->pitch = 4 * current->w;
+ current->pixels = SDL_malloc (current->h * current->pitch);
+
+ cg_context = CGBitmapContextCreate (current->pixels, current->w, current->h,
+ 8, current->pitch, cgColorspace,
+ kCGImageAlphaNoneSkipFirst);
+ CGColorSpaceRelease (cgColorspace);
+
+ current->flags |= SDL_SWSURFACE;
+ current->flags |= SDL_ASYNCBLIT;
+ current->hwdata = (void *) cg_context;
+
+ /* Force this window to draw above _everything_. */
+ [ qz_window setLevel:CGShieldingWindowLevel() ];
+
+ this->UpdateRects = QZ_UpdateRects;
+ this->LockHWSurface = QZ_LockHWSurface;
+ this->UnlockHWSurface = QZ_UnlockHWSurface;
+ }
+
+ if (isLion) {
+ [ qz_window setHasShadow:NO];
+ [ qz_window setOpaque:YES];
+ [ qz_window makeKeyAndOrderFront:nil ];
+ }
+
+ /* !!! FIXME: keep an eye on this.
+ * This API is officially unavailable for 64-bit binaries.
+ * It happens to work, as of 10.7, but we're going to see if
+ * we can just simply do without it on newer OSes...
+ */
+ #if (MAC_OS_X_VERSION_MIN_REQUIRED < 1070) && !defined(__LP64__)
+ if ( !isLion ) {
+ /* If we don't hide menu bar, it will get events and interrupt the program */
+ HideMenuBar ();
+ }
+ #endif
+
+ /* Fade in again (asynchronously) */
+ if ( fade_token != kCGDisplayFadeReservationInvalidToken ) {
+ CGDisplayFade (fade_token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE);
+ CGReleaseDisplayFadeReservation(fade_token);
+ }
+
+ /*
+ There is a bug in Cocoa where NSScreen doesn't synchronize
+ with CGDirectDisplay, so the main screen's frame is wrong.
+ As a result, coordinate translation produces incorrect results.
+ We can hack around this bug by setting the screen rect
+ ourselves. This hack should be removed if/when the bug is fixed.
+ */
+ screen_rect = NSMakeRect(0,0,width,height);
+ QZ_SetFrame(this, [ NSScreen mainScreen ], screen_rect);
+
+ /* Save the flags to ensure correct tear-down */
+ mode_flags = current->flags;
+
+ /* Set app state, hide cursor if necessary, ... */
+ QZ_DoActivate(this);
+
+ return current;
+
+ /* Since the blanking window covers *all* windows (even force quit) correct recovery is crucial */
+ERR_NO_GL: goto ERR_DOUBLEBUF; /* this goto is to stop a compiler warning on newer SDKs. */
+ERR_DOUBLEBUF: QZ_RestoreDisplayMode(this);
+ERR_NO_SWITCH: CGReleaseAllDisplays ();
+ERR_NO_CAPTURE:
+ERR_NO_MATCH: if ( fade_token != kCGDisplayFadeReservationInvalidToken ) {
+ CGDisplayFade (fade_token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE);
+ CGReleaseDisplayFadeReservation (fade_token);
+ }
+ return NULL;
+}
+
+static SDL_Surface* QZ_SetVideoWindowed (_THIS, SDL_Surface *current, int width,
+ int height, int *bpp, Uint32 flags,
+ const BOOL save_gl)
+{
+ unsigned int style;
+ NSRect contentRect;
+ int center_window = 1;
+ int origin_x, origin_y;
+ CGDisplayFadeReservationToken fade_token = kCGDisplayFadeReservationInvalidToken;
+
+ current->flags = 0;
+ current->w = width;
+ current->h = height;
+
+ contentRect = NSMakeRect (0, 0, width, height);
+
+ /*
+ Check if we should completely destroy the previous mode
+ - If it is fullscreen
+ - If it has different noframe or resizable attribute
+ - If it is OpenGL (since gl attributes could be different)
+ - If new mode is OpenGL, but previous mode wasn't
+ */
+ if (video_set == SDL_TRUE) {
+ if (mode_flags & SDL_FULLSCREEN) {
+ /* Fade to black to hide resolution-switching flicker (and garbage
+ that is displayed by a destroyed OpenGL context, if applicable) */
+ if (CGAcquireDisplayFadeReservation (5, &fade_token) == kCGErrorSuccess) {
+ CGDisplayFade (fade_token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, TRUE);
+ }
+ QZ_UnsetVideoMode (this, TRUE, save_gl);
+ }
+ else if ( ((mode_flags ^ flags) & (SDL_NOFRAME|SDL_RESIZABLE)) ||
+ (mode_flags & SDL_OPENGL) ||
+ (flags & SDL_OPENGL) ) {
+ QZ_UnsetVideoMode (this, TRUE, save_gl);
+ }
+ }
+
+ /* Sorry, QuickDraw was ripped out. */
+ if (getenv("SDL_NSWindowPointer") || getenv("SDL_NSQuickDrawViewPointer")) {
+ SDL_SetError ("Embedded QuickDraw windows are no longer supported");
+ if (fade_token != kCGDisplayFadeReservationInvalidToken) {
+ CGDisplayFade (fade_token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE);
+ CGReleaseDisplayFadeReservation (fade_token);
+ }
+ return NULL;
+ }
+
+ /* Check if we should recreate the window */
+ if (qz_window == nil) {
+
+ /* Set the window style based on input flags */
+ if ( flags & SDL_NOFRAME ) {
+ style = NSBorderlessWindowMask;
+ current->flags |= SDL_NOFRAME;
+ } else {
+ style = NSTitledWindowMask;
+ style |= (NSMiniaturizableWindowMask | NSClosableWindowMask);
+ if ( flags & SDL_RESIZABLE ) {
+ style |= NSResizableWindowMask;
+ current->flags |= SDL_RESIZABLE;
+ }
+ }
+
+ /* Manually create a window, avoids having a nib file resource */
+ qz_window = [ [ SDL_QuartzWindow alloc ]
+ initWithContentRect:contentRect
+ styleMask:style
+ backing:NSBackingStoreBuffered
+ defer:NO ];
+
+ if (qz_window == nil) {
+ SDL_SetError ("Could not create the Cocoa window");
+ if (fade_token != kCGDisplayFadeReservationInvalidToken) {
+ CGDisplayFade (fade_token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE);
+ CGReleaseDisplayFadeReservation (fade_token);
+ }
+ return NULL;
+ }
+
+ /*[ qz_window setReleasedWhenClosed:YES ];*/ /* no need to set this as it's the default for NSWindows */
+ QZ_SetCaption(this, this->wm_title, this->wm_icon);
+ [ qz_window setAcceptsMouseMovedEvents:YES ];
+ [ qz_window setViewsNeedDisplay:NO ];
+
+ if ( QZ_WindowPosition(this, &origin_x, &origin_y) ) {
+ /* have to flip the Y value (NSPoint is lower left corner origin) */
+ [ qz_window setFrameTopLeftPoint:NSMakePoint((float) origin_x, (float) (this->info.current_h - origin_y))];
+ center_window = 0;
+ } else if ( center_window ) {
+ [ qz_window center ];
+ }
+
+ [ qz_window setDelegate:
+ [ [ SDL_QuartzWindowDelegate alloc ] init ] ];
+ [ qz_window setContentView: [ [ [ SDL_QuartzView alloc ] init ] autorelease ] ];
+ }
+ /* We already have a window, just change its size */
+ else {
+ [ qz_window setContentSize:contentRect.size ];
+ current->flags |= (SDL_NOFRAME|SDL_RESIZABLE) & mode_flags;
+ [ window_view setFrameSize:contentRect.size ];
+ }
+
+ /* For OpenGL, we bind the context to a subview */
+ if ( flags & SDL_OPENGL ) {
+
+ if ( ! save_gl ) {
+ if ( ! QZ_SetupOpenGL (this, *bpp, flags) ) {
+ if (fade_token != kCGDisplayFadeReservationInvalidToken) {
+ CGDisplayFade (fade_token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE);
+ CGReleaseDisplayFadeReservation (fade_token);
+ }
+ return NULL;
+ }
+ }
+
+ window_view = [ [ NSView alloc ] initWithFrame:contentRect ];
+ [ window_view setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable ];
+ [ [ qz_window contentView ] addSubview:window_view ];
+ [ gl_context setView: window_view ];
+ [ window_view release ];
+ [ gl_context makeCurrentContext];
+ [ qz_window makeKeyAndOrderFront:nil ];
+ current->flags |= SDL_OPENGL;
+ }
+ /* For 2D, we build a CGBitmapContext */
+ else {
+ CGColorSpaceRef cgColorspace;
+
+ /* Only recreate the view if it doesn't already exist */
+ if (window_view == nil) {
+
+ window_view = [ [ NSView alloc ] initWithFrame:contentRect ];
+ [ window_view setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable ];
+ [ [ qz_window contentView ] addSubview:window_view ];
+ [ window_view release ];
+ [ qz_window makeKeyAndOrderFront:nil ];
+ }
+
+ cgColorspace = CGColorSpaceCreateDeviceRGB();
+ current->pitch = 4 * current->w;
+ current->pixels = SDL_malloc (current->h * current->pitch);
+
+ cg_context = CGBitmapContextCreate (current->pixels, current->w, current->h,
+ 8, current->pitch, cgColorspace,
+ kCGImageAlphaNoneSkipFirst);
+ CGColorSpaceRelease (cgColorspace);
+
+ current->flags |= SDL_SWSURFACE;
+ current->flags |= SDL_ASYNCBLIT;
+ current->hwdata = (void *) cg_context;
+
+ this->UpdateRects = QZ_UpdateRects;
+ this->LockHWSurface = QZ_LockHWSurface;
+ this->UnlockHWSurface = QZ_UnlockHWSurface;
+ }
+
+ /* Save flags to ensure correct teardown */
+ mode_flags = current->flags;
+
+ /* Fade in again (asynchronously) if we came from a fullscreen mode and faded to black */
+ if (fade_token != kCGDisplayFadeReservationInvalidToken) {
+ CGDisplayFade (fade_token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE);
+ CGReleaseDisplayFadeReservation (fade_token);
+ }
+
+ return current;
+}
+
+
+static SDL_Surface* QZ_SetVideoModeInternal (_THIS, SDL_Surface *current,
+ int width, int height, int bpp,
+ Uint32 flags, BOOL save_gl)
+{
+ const BOOL isLion = IS_LION_OR_LATER(this);
+
+ current->flags = 0;
+ current->pixels = NULL;
+
+ /* Setup full screen video */
+ if ( flags & SDL_FULLSCREEN ) {
+ if ( isLion ) {
+ bpp = 32;
+ }
+ current = QZ_SetVideoFullScreen (this, current, width, height, bpp, flags, save_gl );
+ if (current == NULL)
+ return NULL;
+ }
+ /* Setup windowed video */
+ else {
+ /* Force bpp to 32 */
+ bpp = 32;
+ current = QZ_SetVideoWindowed (this, current, width, height, &bpp, flags, save_gl );
+ if (current == NULL)
+ return NULL;
+ }
+
+ if (qz_window != nil) {
+ nsgfx_context = [NSGraphicsContext graphicsContextWithWindow:qz_window];
+ [NSGraphicsContext setCurrentContext:nsgfx_context];
+ }
+
+ /* Setup the new pixel format */
+ {
+ int amask = 0,
+ rmask = 0,
+ gmask = 0,
+ bmask = 0;
+
+ switch (bpp) {
+ case 16: /* (1)-5-5-5 RGB */
+ amask = 0;
+ rmask = 0x7C00;
+ gmask = 0x03E0;
+ bmask = 0x001F;
+ break;
+ case 24:
+ SDL_SetError ("24bpp is not available");
+ return NULL;
+ case 32: /* (8)-8-8-8 ARGB */
+ amask = 0x00000000;
+ if ( (!isLion) && (flags & SDL_FULLSCREEN) ) {
+ rmask = 0x00FF0000;
+ gmask = 0x0000FF00;
+ bmask = 0x000000FF;
+ } else {
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+ rmask = 0x0000FF00;
+ gmask = 0x00FF0000;
+ bmask = 0xFF000000;
+#else
+ rmask = 0x00FF0000;
+ gmask = 0x0000FF00;
+ bmask = 0x000000FF;
+#endif
+ break;
+ }
+ }
+
+ if ( ! SDL_ReallocFormat (current, bpp,
+ rmask, gmask, bmask, amask ) ) {
+ SDL_SetError ("Couldn't reallocate pixel format");
+ return NULL;
+ }
+ }
+
+ /* Signal successful completion (used internally) */
+ video_set = SDL_TRUE;
+
+ return current;
+}
+
+static SDL_Surface* QZ_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp,
+ Uint32 flags)
+{
+ /* Don't throw away the GL context if we can just resize the current one. */
+#if 0 /* !!! FIXME: half-finished side project. Reenable this if you ever debug the corner cases. */
+ const BOOL save_gl = ( (video_set == SDL_TRUE) && ((flags & SDL_OPENGL) == (current->flags & SDL_OPENGL)) && (bpp == current->format->BitsPerPixel) );
+#else
+ const BOOL save_gl = NO;
+#endif
+
+ NSOpenGLContext *glctx = gl_context;
+ SDL_Surface* retval = NULL;
+
+ if (save_gl) {
+ [glctx retain]; /* just so we don't lose this when killing old views, etc */
+ }
+
+ retval = QZ_SetVideoModeInternal (this, current, width, height, bpp, flags, save_gl);
+
+ if (save_gl) {
+ [glctx release]; /* something else should own this now, or we legitimately release it. */
+ }
+
+ return retval;
+}
+
+
+static int QZ_ToggleFullScreen (_THIS, int on)
+{
+ return 0;
+}
+
+static int QZ_SetColors (_THIS, int first_color, int num_colors,
+ SDL_Color *colors)
+{
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
+ /* we shouldn't have an 8-bit mode on Lion! */
+ if (!IS_LION_OR_LATER(this)) {
+ CGTableCount index;
+ CGDeviceColor color;
+
+ for (index = first_color; index < first_color+num_colors; index++) {
+
+ /* Clamp colors between 0.0 and 1.0 */
+ color.red = colors->r / 255.0;
+ color.blue = colors->b / 255.0;
+ color.green = colors->g / 255.0;
+
+ colors++;
+
+ CGPaletteSetColorAtIndex (palette, color, index);
+ }
+
+ return ( CGDisplayNoErr == CGDisplaySetPalette (display_id, palette) );
+ }
+#endif
+
+ return 0;
+}
+
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
+static int QZ_LockDoubleBuffer (_THIS, SDL_Surface *surface)
+{
+ return 1;
+}
+
+static void QZ_UnlockDoubleBuffer (_THIS, SDL_Surface *surface)
+{
+}
+
+/* The VBL delay is based on code by Ian R Ollmann's RezLib <iano@cco.caltech.edu> */
+static AbsoluteTime QZ_SecondsToAbsolute ( double seconds )
+{
+ union
+ {
+ UInt64 i;
+ Nanoseconds ns;
+ } temp;
+
+ temp.i = seconds * 1000000000.0;
+
+ return NanosecondsToAbsolute ( temp.ns );
+}
+
+static int QZ_ThreadFlip (_THIS)
+{
+ Uint8 *src, *dst;
+ int skip, len, h;
+
+ /*
+ Give this thread the highest scheduling priority possible,
+ in the hopes that it will immediately run after the VBL delay
+ */
+ {
+ pthread_t current_thread;
+ int policy;
+ struct sched_param param;
+
+ current_thread = pthread_self ();
+ pthread_getschedparam (current_thread, &policy, &param);
+ policy = SCHED_RR;
+ param.sched_priority = sched_get_priority_max (policy);
+ pthread_setschedparam (current_thread, policy, &param);
+ }
+
+ while (1) {
+
+ SDL_SemWait (sem1);
+ if (quit_thread)
+ return 0;
+
+ /*
+ * We have to add SDL_VideoSurface->offset here, since we might be a
+ * smaller surface in the center of the framebuffer (you asked for
+ * a fullscreen resolution smaller than the hardware could supply
+ * so SDL is centering it in a bigger resolution)...
+ */
+ dst = ((Uint8 *)((size_t)CGDisplayBaseAddress (display_id))) + SDL_VideoSurface->offset;
+ src = current_buffer + SDL_VideoSurface->offset;
+ len = SDL_VideoSurface->w * SDL_VideoSurface->format->BytesPerPixel;
+ h = SDL_VideoSurface->h;
+ skip = SDL_VideoSurface->pitch;
+
+ /* Wait for the VBL to occur (estimated since we don't have a hardware interrupt) */
+ {
+
+ /* The VBL delay is based on Ian Ollmann's RezLib <iano@cco.caltech.edu> */
+ double refreshRate;
+ double linesPerSecond;
+ double target;
+ double position;
+ double adjustment;
+ AbsoluteTime nextTime;
+ CFNumberRef refreshRateCFNumber;
+
+ refreshRateCFNumber = CFDictionaryGetValue (mode, kCGDisplayRefreshRate);
+ if ( NULL == refreshRateCFNumber ) {
+ SDL_SetError ("Mode has no refresh rate");
+ goto ERROR;
+ }
+
+ if ( 0 == CFNumberGetValue (refreshRateCFNumber, kCFNumberDoubleType, &refreshRate) ) {
+ SDL_SetError ("Error getting refresh rate");
+ goto ERROR;
+ }
+
+ if ( 0 == refreshRate ) {
+
+ SDL_SetError ("Display has no refresh rate, using 60hz");
+
+ /* ok, for LCD's we'll emulate a 60hz refresh, which may or may not look right */
+ refreshRate = 60.0;
+ }
+
+ linesPerSecond = refreshRate * h;
+ target = h;
+
+ /* Figure out the first delay so we start off about right */
+ position = CGDisplayBeamPosition (display_id);
+ if (position > target)
+ position = 0;
+
+ adjustment = (target - position) / linesPerSecond;
+
+ nextTime = AddAbsoluteToAbsolute (UpTime (), QZ_SecondsToAbsolute (adjustment));
+
+ MPDelayUntil (&nextTime);
+ }
+
+
+ /* On error, skip VBL delay */
+ ERROR:
+
+ /* TODO: use CGContextDrawImage here too! Create two CGContextRefs the same way we
+ create two buffers, replace current_buffer with current_context and set it
+ appropriately in QZ_FlipDoubleBuffer. */
+ while ( h-- ) {
+
+ SDL_memcpy (dst, src, len);
+ src += skip;
+ dst += skip;
+ }
+
+ /* signal flip completion */
+ SDL_SemPost (sem2);
+ }
+
+ return 0;
+}
+
+static int QZ_FlipDoubleBuffer (_THIS, SDL_Surface *surface)
+{
+ /* wait for previous flip to complete */
+ SDL_SemWait (sem2);
+
+ current_buffer = surface->pixels;
+
+ if (surface->pixels == sw_buffers[0])
+ surface->pixels = sw_buffers[1];
+ else
+ surface->pixels = sw_buffers[0];
+
+ /* signal worker thread to do the flip */
+ SDL_SemPost (sem1);
+
+ return 0;
+}
+
+static void QZ_DoubleBufferUpdate (_THIS, int num_rects, SDL_Rect *rects)
+{
+ /* perform a flip if someone calls updaterects on a doublebuferred surface */
+ this->FlipHWSurface (this, SDL_VideoSurface);
+}
+
+static void QZ_DirectUpdate (_THIS, int num_rects, SDL_Rect *rects)
+{
+#pragma unused(this,num_rects,rects)
+}
+#endif
+
+/* Resize icon, BMP format */
+static const unsigned char QZ_ResizeIcon[] = {
+ 0x42,0x4d,0x31,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x00,0x00,0x00,0x28,0x00,
+ 0x00,0x00,0x0d,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x01,0x00,0x18,0x00,0x00,0x00,
+ 0x00,0x00,0xfb,0x01,0x00,0x00,0x13,0x0b,0x00,0x00,0x13,0x0b,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0b,0xff,0xff,
+ 0xff,0xda,0xda,0xda,0x87,0x87,0x87,0xe8,0xe8,0xe8,0xff,0xff,0xff,0xda,0xda,0xda,
+ 0x87,0x87,0x87,0xe8,0xe8,0xe8,0xff,0xff,0xff,0xda,0xda,0xda,0x87,0x87,0x87,0xe8,
+ 0xe8,0xe8,0xff,0xff,0xff,0x0b,0xff,0xff,0xff,0xff,0xff,0xff,0xda,0xda,0xda,0x87,
+ 0x87,0x87,0xe8,0xe8,0xe8,0xff,0xff,0xff,0xda,0xda,0xda,0x87,0x87,0x87,0xe8,0xe8,
+ 0xe8,0xff,0xff,0xff,0xda,0xda,0xda,0x87,0x87,0x87,0xff,0xff,0xff,0x0b,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xd5,0xd5,0xd5,0x87,0x87,0x87,0xe8,0xe8,0xe8,
+ 0xff,0xff,0xff,0xda,0xda,0xda,0x87,0x87,0x87,0xe8,0xe8,0xe8,0xff,0xff,0xff,0xda,
+ 0xda,0xda,0xff,0xff,0xff,0x0b,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xd7,0xd7,0xd7,0x87,0x87,0x87,0xe8,0xe8,0xe8,0xff,0xff,0xff,0xda,0xda,
+ 0xda,0x87,0x87,0x87,0xe8,0xe8,0xe8,0xff,0xff,0xff,0xff,0xff,0xff,0x0b,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xd7,0xd7,0xd7,
+ 0x87,0x87,0x87,0xe8,0xe8,0xe8,0xff,0xff,0xff,0xda,0xda,0xda,0x87,0x87,0x87,0xe8,
+ 0xe8,0xe8,0xff,0xff,0xff,0x0b,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xd7,0xd7,0xd7,0x87,0x87,0x87,0xe8,0xe8,
+ 0xe8,0xff,0xff,0xff,0xdc,0xdc,0xdc,0x87,0x87,0x87,0xff,0xff,0xff,0x0b,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xd9,0xd9,0xd9,0x87,0x87,0x87,0xe8,0xe8,0xe8,0xff,0xff,0xff,0xdc,
+ 0xdc,0xdc,0xff,0xff,0xff,0x0b,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdb,0xdb,
+ 0xdb,0x87,0x87,0x87,0xe8,0xe8,0xe8,0xff,0xff,0xff,0xff,0xff,0xff,0x0b,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdb,0xdb,0xdb,0x87,0x87,0x87,0xe8,
+ 0xe8,0xe8,0xff,0xff,0xff,0x0b,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xdc,0xdc,0xdc,0x87,0x87,0x87,0xff,0xff,0xff,0x0b,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdc,
+ 0xdc,0xdc,0xff,0xff,0xff,0x0b,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0b
+};
+
+static void QZ_DrawResizeIcon (_THIS)
+{
+ /* Check if we should draw the resize icon */
+ if (SDL_VideoSurface->flags & SDL_RESIZABLE) {
+
+ SDL_Rect icon_rect;
+
+ /* Create the icon image */
+ if (resize_icon == NULL) {
+
+ SDL_RWops *rw;
+ SDL_Surface *tmp;
+
+ rw = SDL_RWFromConstMem (QZ_ResizeIcon, sizeof(QZ_ResizeIcon));
+ tmp = SDL_LoadBMP_RW (rw, SDL_TRUE);
+
+ resize_icon = SDL_ConvertSurface (tmp, SDL_VideoSurface->format, SDL_SRCCOLORKEY);
+ SDL_SetColorKey (resize_icon, SDL_SRCCOLORKEY, 0xFFFFFF);
+
+ SDL_FreeSurface (tmp);
+ }
+
+ icon_rect.x = SDL_VideoSurface->w - 13;
+ icon_rect.y = SDL_VideoSurface->h - 13;
+ icon_rect.w = 13;
+ icon_rect.h = 13;
+
+ SDL_BlitSurface (resize_icon, NULL, SDL_VideoSurface, &icon_rect);
+ }
+}
+
+static void QZ_UpdateRects (_THIS, int numRects, SDL_Rect *rects)
+{
+ if (SDL_VideoSurface->flags & SDL_OPENGLBLIT) {
+ QZ_GL_SwapBuffers (this);
+ }
+ else if ( [ qz_window isMiniaturized ] ) {
+
+ /* Do nothing if miniaturized */
+ }
+
+ else {
+ NSGraphicsContext *ctx = [NSGraphicsContext currentContext];
+ if (ctx != nsgfx_context) { /* uhoh, you might be rendering from another thread... */
+ [NSGraphicsContext setCurrentContext:nsgfx_context];
+ ctx = nsgfx_context;
+ }
+ CGContextRef cgc = (CGContextRef) [ctx graphicsPort];
+ QZ_DrawResizeIcon (this);
+ CGContextFlush (cg_context);
+ CGImageRef image = CGBitmapContextCreateImage (cg_context);
+ CGRect rectangle = CGRectMake (0,0,[window_view frame].size.width,[window_view frame].size.height);
+
+ CGContextDrawImage (cgc, rectangle, image);
+ CGImageRelease(image);
+ CGContextFlush (cgc);
+ }
+}
+
+static void QZ_VideoQuit (_THIS)
+{
+ CGDisplayFadeReservationToken fade_token = kCGDisplayFadeReservationInvalidToken;
+
+ /* Restore gamma settings */
+ CGDisplayRestoreColorSyncSettings ();
+
+ /* Ensure the cursor will be visible and working when we quit */
+ CGDisplayShowCursor (display_id);
+ CGAssociateMouseAndMouseCursorPosition (1);
+
+ if (mode_flags & SDL_FULLSCREEN) {
+ /* Fade to black to hide resolution-switching flicker (and garbage
+ that is displayed by a destroyed OpenGL context, if applicable) */
+ if (CGAcquireDisplayFadeReservation (5, &fade_token) == kCGErrorSuccess) {
+ CGDisplayFade (fade_token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, TRUE);
+ }
+ QZ_UnsetVideoMode (this, TRUE, FALSE);
+ if (fade_token != kCGDisplayFadeReservationInvalidToken) {
+ CGDisplayFade (fade_token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE);
+ CGReleaseDisplayFadeReservation (fade_token);
+ }
+ }
+ else
+ QZ_UnsetVideoMode (this, TRUE, FALSE);
+
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
+ if (!IS_LION_OR_LATER(this)) {
+ CGPaletteRelease(palette);
+ }
+#endif
+
+ if (opengl_library) {
+ SDL_UnloadObject(opengl_library);
+ opengl_library = NULL;
+ }
+ this->gl_config.driver_loaded = 0;
+
+ if (field_edit) {
+ [field_edit release];
+ field_edit = NULL;
+ }
+}
+
+static int QZ_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return 1;
+}
+
+static void QZ_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+}
+
+static int QZ_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(-1); /* unallowed (no HWSURFACE support here). */
+}
+
+static void QZ_FreeHWSurface (_THIS, SDL_Surface *surface)
+{
+}
+
+/* Gamma functions */
+int QZ_SetGamma (_THIS, float red, float green, float blue)
+{
+ const CGGammaValue min = 0.0, max = 1.0;
+
+ if (red == 0.0)
+ red = FLT_MAX;
+ else
+ red = 1.0 / red;
+
+ if (green == 0.0)
+ green = FLT_MAX;
+ else
+ green = 1.0 / green;
+
+ if (blue == 0.0)
+ blue = FLT_MAX;
+ else
+ blue = 1.0 / blue;
+
+ if ( CGDisplayNoErr == CGSetDisplayTransferByFormula
+ (display_id, min, max, red, min, max, green, min, max, blue) ) {
+
+ return 0;
+ }
+ else {
+
+ return -1;
+ }
+}
+
+int QZ_GetGamma (_THIS, float *red, float *green, float *blue)
+{
+ CGGammaValue dummy;
+ if ( CGDisplayNoErr == CGGetDisplayTransferByFormula
+ (display_id, &dummy, &dummy, red,
+ &dummy, &dummy, green, &dummy, &dummy, blue) )
+
+ return 0;
+ else
+ return -1;
+}
+
+int QZ_SetGammaRamp (_THIS, Uint16 *ramp)
+{
+ const uint32_t tableSize = 255;
+ CGGammaValue redTable[tableSize];
+ CGGammaValue greenTable[tableSize];
+ CGGammaValue blueTable[tableSize];
+
+ int i;
+
+ /* Extract gamma values into separate tables, convert to floats between 0.0 and 1.0 */
+ for (i = 0; i < 256; i++)
+ redTable[i % 256] = ramp[i] / 65535.0;
+
+ for (i=256; i < 512; i++)
+ greenTable[i % 256] = ramp[i] / 65535.0;
+
+ for (i=512; i < 768; i++)
+ blueTable[i % 256] = ramp[i] / 65535.0;
+
+ if ( CGDisplayNoErr == CGSetDisplayTransferByTable
+ (display_id, tableSize, redTable, greenTable, blueTable) )
+ return 0;
+ else
+ return -1;
+}
+
+int QZ_GetGammaRamp (_THIS, Uint16 *ramp)
+{
+ const uint32_t tableSize = 255;
+ CGGammaValue redTable[tableSize];
+ CGGammaValue greenTable[tableSize];
+ CGGammaValue blueTable[tableSize];
+ uint32_t actual;
+ int i;
+
+ if ( CGDisplayNoErr != CGGetDisplayTransferByTable
+ (display_id, tableSize, redTable, greenTable, blueTable, &actual) ||
+ actual != tableSize)
+
+ return -1;
+
+ /* Pack tables into one array, with values from 0 to 65535 */
+ for (i = 0; i < 256; i++)
+ ramp[i] = redTable[i % 256] * 65535.0;
+
+ for (i=256; i < 512; i++)
+ ramp[i] = greenTable[i % 256] * 65535.0;
+
+ for (i=512; i < 768; i++)
+ ramp[i] = blueTable[i % 256] * 65535.0;
+
+ return 0;
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzWM.h b/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzWM.h
new file mode 100644
index 0000000..5219a59
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzWM.h
@@ -0,0 +1,28 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+struct WMcursor {
+ NSCursor *nscursor;
+};
+
+void QZ_UpdateCursor(_THIS);
+int QZ_GetWMInfo (_THIS, SDL_SysWMinfo *info);
diff --git a/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzWM.m b/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzWM.m
new file mode 100644
index 0000000..b40abf8
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzWM.m
@@ -0,0 +1,574 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_QuartzVideo.h"
+#include "SDL_QuartzWM.h"
+
+
+void QZ_FreeWMCursor (_THIS, WMcursor *cursor) {
+
+ if ( cursor != NULL ) {
+ [ cursor->nscursor release ];
+ free (cursor);
+ }
+}
+
+WMcursor* QZ_CreateWMCursor (_THIS, Uint8 *data, Uint8 *mask,
+ int w, int h, int hot_x, int hot_y) {
+ WMcursor *cursor;
+ NSBitmapImageRep *imgrep;
+ NSImage *img;
+ unsigned char *planes[5];
+ int i;
+ NSAutoreleasePool *pool;
+
+ pool = [ [ NSAutoreleasePool alloc ] init ];
+
+ /* Allocate the cursor memory */
+ cursor = (WMcursor *)SDL_malloc(sizeof(WMcursor));
+ if (cursor == NULL) goto outOfMemory;
+
+ /* create the image representation and get the pointers to its storage */
+ imgrep = [ [ [ NSBitmapImageRep alloc ] initWithBitmapDataPlanes: NULL pixelsWide: w pixelsHigh: h bitsPerSample: 1 samplesPerPixel: 2 hasAlpha: YES isPlanar: YES colorSpaceName: NSDeviceWhiteColorSpace bytesPerRow: (w+7)/8 bitsPerPixel: 0 ] autorelease ];
+ if (imgrep == nil) goto outOfMemory;
+ [ imgrep getBitmapDataPlanes: planes ];
+
+ /* copy data and mask, extending the mask to all black pixels because the inversion effect doesn't work with Cocoa's alpha-blended cursors */
+ for (i = 0; i < (w+7)/8*h; i++) {
+ planes[0][i] = data[i] ^ 0xFF;
+ planes[1][i] = mask[i] | data[i];
+ }
+
+ /* create image and cursor */
+ img = [ [ [ NSImage alloc ] initWithSize: NSMakeSize(w, h) ] autorelease ];
+ if (img == nil) goto outOfMemory;
+ [ img addRepresentation: imgrep ];
+ if (system_version < 0x1030) { /* on 10.2, cursors must be 16*16 */
+ if (w > 16 || h > 16) { /* too big: scale it down */
+ [ img setScalesWhenResized: YES ];
+ hot_x = hot_x*16/w;
+ hot_y = hot_y*16/h;
+ }
+ else { /* too small (or just right): extend it (from the bottom left corner, so hot_y must be adjusted) */
+ hot_y += 16 - h;
+ }
+ [ img setSize: NSMakeSize(16, 16) ];
+ }
+ cursor->nscursor = [ [ NSCursor alloc ] initWithImage: img hotSpot: NSMakePoint(hot_x, hot_y) ];
+ if (cursor->nscursor == nil) goto outOfMemory;
+
+ [ pool release ];
+ return(cursor);
+
+outOfMemory:
+ [ pool release ];
+ if (cursor != NULL) SDL_free(cursor);
+ SDL_OutOfMemory();
+ return(NULL);
+}
+
+void QZ_UpdateCursor (_THIS) {
+ BOOL state;
+
+ if (cursor_should_be_visible || !(SDL_GetAppState() & SDL_APPMOUSEFOCUS)) {
+ state = YES;
+ } else {
+ state = NO;
+ }
+ if (state != cursor_visible) {
+ if (state) {
+ [ NSCursor unhide ];
+ } else {
+ [ NSCursor hide ];
+ }
+ cursor_visible = state;
+ }
+}
+
+BOOL QZ_IsMouseInWindow (_THIS) {
+ if (qz_window == nil || (mode_flags & SDL_FULLSCREEN)) return YES; /*fullscreen*/
+ else {
+ NSPoint p = [ qz_window mouseLocationOutsideOfEventStream ];
+ p.y -= 1.0f; /* Apparently y goes from 1 to h, not from 0 to h-1 (i.e. the "location of the mouse" seems to be defined as "the location of the top left corner of the mouse pointer's hot pixel" */
+ return NSPointInRect(p, [ window_view frame ]);
+ }
+}
+
+int QZ_ShowWMCursor (_THIS, WMcursor *cursor) {
+
+ if ( cursor == NULL) {
+ if ( cursor_should_be_visible ) {
+ cursor_should_be_visible = NO;
+ QZ_ChangeGrabState (this, QZ_HIDECURSOR);
+ }
+ QZ_UpdateCursor(this);
+ }
+ else {
+ if ( qz_window != nil && !(mode_flags & SDL_FULLSCREEN) ) {
+ [ qz_window invalidateCursorRectsForView: [ qz_window contentView ] ];
+ }
+ if ( ! cursor_should_be_visible ) {
+ cursor_should_be_visible = YES;
+ QZ_ChangeGrabState (this, QZ_SHOWCURSOR);
+ }
+ [ cursor->nscursor performSelectorOnMainThread:@selector(set) withObject:nil waitUntilDone:NO ];
+ QZ_UpdateCursor(this);
+ }
+
+ return 1;
+}
+
+/*
+ Coordinate conversion functions, for convenience
+ Cocoa sets the origin at the lower left corner of the window/screen
+ SDL, CoreGraphics/WindowServer, and QuickDraw use the origin at the upper left corner
+ The routines were written so they could be called before SetVideoMode() has finished;
+ this might have limited usefulness at the moment, but the extra cost is trivial.
+*/
+
+/* Convert Cocoa screen coordinate to Cocoa window coordinate */
+void QZ_PrivateGlobalToLocal (_THIS, NSPoint *p) {
+
+ if ( ! CGDisplayIsCaptured (display_id) )
+ *p = [ qz_window convertScreenToBase:*p ];
+}
+
+
+/* Convert Cocoa window coordinate to Cocoa screen coordinate */
+void QZ_PrivateLocalToGlobal (_THIS, NSPoint *p) {
+
+ if ( ! CGDisplayIsCaptured (display_id) )
+ *p = [ qz_window convertBaseToScreen:*p ];
+}
+
+/* Convert SDL coordinate to Cocoa coordinate */
+void QZ_PrivateSDLToCocoa (_THIS, NSPoint *p) {
+
+ if ( CGDisplayIsCaptured (display_id) ) { /* capture signals fullscreen */
+
+ p->y = CGDisplayPixelsHigh (display_id) - p->y;
+ }
+ else {
+
+ *p = [ window_view convertPoint:*p toView: nil ];
+ p->y = [window_view frame].size.height - p->y;
+ }
+}
+
+/* Convert Cocoa coordinate to SDL coordinate */
+void QZ_PrivateCocoaToSDL (_THIS, NSPoint *p) {
+
+ if ( CGDisplayIsCaptured (display_id) ) { /* capture signals fullscreen */
+
+ p->y = CGDisplayPixelsHigh (display_id) - p->y;
+ }
+ else {
+
+ *p = [ window_view convertPoint:*p fromView: nil ];
+ p->y = [window_view frame].size.height - p->y;
+ }
+}
+
+/* Convert SDL coordinate to window server (CoreGraphics) coordinate */
+CGPoint QZ_PrivateSDLToCG (_THIS, NSPoint *p) {
+
+ CGPoint cgp;
+
+ if ( ! CGDisplayIsCaptured (display_id) ) { /* not captured => not fullscreen => local coord */
+
+ int height;
+
+ QZ_PrivateSDLToCocoa (this, p);
+ QZ_PrivateLocalToGlobal (this, p);
+
+ height = CGDisplayPixelsHigh (display_id);
+ p->y = height - p->y;
+ }
+
+ cgp.x = p->x;
+ cgp.y = p->y;
+
+ return cgp;
+}
+
+#if 0 /* Dead code */
+/* Convert window server (CoreGraphics) coordinate to SDL coordinate */
+void QZ_PrivateCGToSDL (_THIS, NSPoint *p) {
+
+ if ( ! CGDisplayIsCaptured (display_id) ) { /* not captured => not fullscreen => local coord */
+
+ int height;
+
+ /* Convert CG Global to Cocoa Global */
+ height = CGDisplayPixelsHigh (display_id);
+ p->y = height - p->y;
+
+ QZ_PrivateGlobalToLocal (this, p);
+ QZ_PrivateCocoaToSDL (this, p);
+ }
+}
+#endif /* Dead code */
+
+void QZ_PrivateWarpCursor (_THIS, int x, int y) {
+ NSPoint p;
+ CGPoint cgp;
+
+ p = NSMakePoint (x, y);
+ cgp = QZ_PrivateSDLToCG (this, &p);
+
+ /* this is the magic call that fixes cursor "freezing" after warp */
+ CGAssociateMouseAndMouseCursorPosition (0);
+ CGWarpMouseCursorPosition (cgp);
+ if (grab_state != QZ_INVISIBLE_GRAB) { /* can't leave it disassociated? */
+ CGAssociateMouseAndMouseCursorPosition (1);
+ }
+ SDL_PrivateAppActive (QZ_IsMouseInWindow (this), SDL_APPMOUSEFOCUS);
+}
+
+void QZ_WarpWMCursor (_THIS, Uint16 x, Uint16 y) {
+
+ /* Only allow warping when in foreground */
+ if ( ! [ NSApp isActive ] )
+ return;
+
+ /* Do the actual warp */
+ if (grab_state != QZ_INVISIBLE_GRAB) QZ_PrivateWarpCursor (this, x, y);
+
+ /* Generate the mouse moved event */
+ SDL_PrivateMouseMotion (0, 0, x, y);
+}
+
+void QZ_MoveWMCursor (_THIS, int x, int y) { }
+void QZ_CheckMouseMode (_THIS) { }
+
+void QZ_SetCaption (_THIS, const char *title, const char *icon) {
+
+ if ( qz_window != nil ) {
+ NSString *string;
+ if ( title != NULL ) {
+ string = [ [ NSString alloc ] initWithUTF8String:title ];
+ [ qz_window setTitle:string ];
+ [ string release ];
+ }
+ if ( icon != NULL ) {
+ string = [ [ NSString alloc ] initWithUTF8String:icon ];
+ [ qz_window setMiniwindowTitle:string ];
+ [ string release ];
+ }
+ }
+}
+
+void QZ_SetWindowPos (_THIS, int x, int y)
+{
+ if ( qz_window == nil ) {
+ //printf( "%s(%d,%d): called for NULL window\n", __FUNCTION__, x, y );
+ return;
+ }
+
+ [ qz_window setFrameTopLeftPoint:NSMakePoint( x, this->hidden->height - y ) ];
+ //printf( "%s(%d,%d): done\n", __FUNCTION__, x, y );
+}
+
+void QZ_GetWindowPos(_THIS, int *px, int *py)
+{
+ NSPoint pt;
+
+ *px = *py = 0;
+
+ if ( qz_window == NULL ) {
+ //printf( "%s: called on NULL window\n", __FUNCTION__ );
+ }
+
+ if ( qz_window != nil ) {
+ NSRect rect = [ qz_window frame ];
+ *px = rect.origin.x;
+ *py = this->hidden->height - rect.origin.y - rect.size.height;
+ //printf( "%s: returning (%d,%d)\n", __FUNCTION__, *px, *py );
+ }
+}
+
+/* determine if the window is fully visible on the current screen configuration */
+int QZ_IsWindowVisible(_THIS, int recenter)
+{
+ int result = 0;
+
+ //printf( "... enter %s\n", __FUNCTION__ );
+
+ if ( qz_window != NULL ) {
+ NSRect frame = [ qz_window frame ];
+ NSArray* screens = [ NSScreen screens ];
+ unsigned int count = [ screens count ];
+ unsigned int n;
+ //printf( "window frame (%d,%d) (%d,%d)\n", frame.origin.x, frame.origin.y,
+ // frame.size.width, frame.size.height );
+ for (n = 0; n < count; n++) {
+ NSScreen* screen = [ screens objectAtIndex: n ];
+ NSRect vis = [ screen visibleFrame ];
+
+ //printf( "screen %d/%d frame (%d,%d) (%d,%d)\n", n+1, count,
+ // vis.origin.x, vis.origin.y, vis.size.width, vis.size.height );
+
+ if (frame.origin.x >= vis.origin.x &&
+ frame.origin.x + frame.size.width <= vis.origin.x + vis.size.width &&
+ frame.origin.y >= vis.origin.y &&
+ frame.origin.y + frame.size.height <= vis.origin.y + vis.size.height )
+ {
+ result = 1;
+ break;
+ }
+ }
+ }
+ //printf ( "... exit %s, result = %d\n", __FUNCTION__, result );
+ if ( !result && recenter ) {
+ [ qz_window center ] ;
+ }
+ return result;
+}
+
+int QZ_GetMonitorDPI(_THIS, int *xDpi, int *yDpi)
+{
+ /* FIXME: how to get this information from Cocoa ? */
+ return -1;
+}
+
+int QZ_GetMonitorRect (_THIS, SDL_Rect *rect)
+{
+ NSWindow* window = qz_window;
+ NSRect frame = [ window frame ];
+ int fx1 = frame.origin.x;
+ int fy1 = frame.origin.y;
+ int fx2 = frame.size.width + fx1;
+ int fy2 = frame.size.height + fy1;
+ NSArray* screens = [ NSScreen screens ];
+ unsigned int count = [ screens count ];
+ int bestScreen = -1;
+ int bestArea = 0;
+
+ unsigned int n;
+
+ /* we need to compute which screen has the most window pixels */
+ for (n = 0; n < count; n++) {
+ NSScreen* screen = [ screens objectAtIndex: n ];
+ NSRect vis = [ screen visibleFrame ];
+ int vx1 = vis.origin.x;
+ int vy1 = vis.origin.y;
+ int vx2 = vis.size.width + vx1;
+ int vy2 = vis.size.height + vy1;
+ int cx1, cx2, cy1, cy2, cArea;
+
+ if (fx1 >= vx2 || vx1 >= fx2 || fy1 >= vy2 || vy1 >= fy2)
+ continue;
+
+ cx1 = (fx1 < vx1) ? vx1 : fx1;
+ cx2 = (fx2 > vx2) ? vx2 : fx2;
+ cy1 = (fy1 < vy1) ? vy1 : fy1;
+ cy2 = (fy2 > vy2) ? vy2 : fy2;
+
+ if (cx1 >= cx2 || cy1 >= cy2)
+ continue;
+
+ cArea = (cx2-cx1)*(cy2-cy1);
+
+ if (bestScreen < 0 || cArea > bestArea) {
+ bestScreen = n;
+ bestArea = cArea;
+ }
+ }
+ if (bestScreen < 0)
+ bestScreen = 0;
+
+ {
+ NSScreen* screen = [ screens objectAtIndex: bestScreen ];
+ NSRect vis = [ screen visibleFrame ];
+
+ rect->x = vis.origin.x;
+ rect->y = vis.origin.y;
+ rect->w = vis.size.width;
+ rect->h = vis.size.height;
+ }
+ return 0;
+}
+
+void QZ_SetIcon (_THIS, SDL_Surface *icon, Uint8 *mask)
+{
+ NSBitmapImageRep *imgrep;
+ NSImage *img;
+ SDL_Surface *mergedSurface;
+ NSAutoreleasePool *pool;
+ Uint8 *pixels;
+ SDL_bool iconSrcAlpha;
+ Uint8 iconAlphaValue;
+ int i, j, maskPitch, index;
+
+ pool = [ [ NSAutoreleasePool alloc ] init ];
+
+ imgrep = [ [ [ NSBitmapImageRep alloc ] initWithBitmapDataPlanes: NULL pixelsWide: icon->w pixelsHigh: icon->h bitsPerSample: 8 samplesPerPixel: 4 hasAlpha: YES isPlanar: NO colorSpaceName: NSDeviceRGBColorSpace bytesPerRow: 4*icon->w bitsPerPixel: 32 ] autorelease ];
+ if (imgrep == nil) goto freePool;
+ pixels = [ imgrep bitmapData ];
+ SDL_memset(pixels, 0, 4*icon->w*icon->h); /* make the background, which will survive in colorkeyed areas, completely transparent */
+
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+#define BYTEORDER_DEPENDENT_RGBA_MASKS 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF
+#else
+#define BYTEORDER_DEPENDENT_RGBA_MASKS 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000
+#endif
+ mergedSurface = SDL_CreateRGBSurfaceFrom(pixels, icon->w, icon->h, 32, 4*icon->w, BYTEORDER_DEPENDENT_RGBA_MASKS);
+ if (mergedSurface == NULL) goto freePool;
+
+ /* blit, with temporarily cleared SRCALPHA flag because we want to copy, not alpha-blend */
+ iconSrcAlpha = ((icon->flags & SDL_SRCALPHA) != 0);
+ iconAlphaValue = icon->format->alpha;
+ SDL_SetAlpha(icon, 0, 255);
+ SDL_BlitSurface(icon, NULL, mergedSurface, NULL);
+ if (iconSrcAlpha) SDL_SetAlpha(icon, SDL_SRCALPHA, iconAlphaValue);
+
+ SDL_FreeSurface(mergedSurface);
+
+ /* apply mask, source alpha, and premultiply color values by alpha */
+ maskPitch = (icon->w+7)/8;
+ for (i = 0; i < icon->h; i++) {
+ for (j = 0; j < icon->w; j++) {
+ index = i*4*icon->w + j*4;
+ if (!(mask[i*maskPitch + j/8] & (128 >> j%8))) {
+ pixels[index + 3] = 0;
+ }
+ else {
+ if (iconSrcAlpha) {
+ if (icon->format->Amask == 0) pixels[index + 3] = icon->format->alpha;
+ }
+ else {
+ pixels[index + 3] = 255;
+ }
+ }
+ if (pixels[index + 3] < 255) {
+ pixels[index + 0] = (Uint16)pixels[index + 0]*pixels[index + 3]/255;
+ pixels[index + 1] = (Uint16)pixels[index + 1]*pixels[index + 3]/255;
+ pixels[index + 2] = (Uint16)pixels[index + 2]*pixels[index + 3]/255;
+ }
+ }
+ }
+
+ img = [ [ [ NSImage alloc ] initWithSize: NSMakeSize(icon->w, icon->h) ] autorelease ];
+ if (img == nil) goto freePool;
+ [ img addRepresentation: imgrep ];
+ [ NSApp setApplicationIconImage:img ];
+
+freePool:
+ [ pool release ];
+}
+
+int QZ_IconifyWindow (_THIS) {
+
+ if ( ! [ qz_window isMiniaturized ] ) {
+ [ qz_window miniaturize:nil ];
+ if ( ! [ qz_window isMiniaturized ] ) {
+ SDL_SetError ("window iconification failed");
+ return 0;
+ }
+ return 1;
+ }
+ else {
+ SDL_SetError ("window already iconified");
+ return 0;
+ }
+}
+
+int QZ_GetWMInfo (_THIS, SDL_SysWMinfo *info) {
+ info->nsWindowPtr = qz_window;
+ return 0;
+}
+
+void QZ_ChangeGrabState (_THIS, int action) {
+
+ /*
+ Figure out what the next state should be based on the action.
+ Ignore actions that can't change the current state.
+ */
+ if ( grab_state == QZ_UNGRABBED ) {
+ if ( action == QZ_ENABLE_GRAB ) {
+ if ( cursor_should_be_visible )
+ grab_state = QZ_VISIBLE_GRAB;
+ else
+ grab_state = QZ_INVISIBLE_GRAB;
+ }
+ }
+ else if ( grab_state == QZ_VISIBLE_GRAB ) {
+ if ( action == QZ_DISABLE_GRAB )
+ grab_state = QZ_UNGRABBED;
+ else if ( action == QZ_HIDECURSOR )
+ grab_state = QZ_INVISIBLE_GRAB;
+ }
+ else {
+ assert( grab_state == QZ_INVISIBLE_GRAB );
+
+ if ( action == QZ_DISABLE_GRAB )
+ grab_state = QZ_UNGRABBED;
+ else if ( action == QZ_SHOWCURSOR )
+ grab_state = QZ_VISIBLE_GRAB;
+ }
+
+ /* now apply the new state */
+ if (grab_state == QZ_UNGRABBED) {
+
+ CGAssociateMouseAndMouseCursorPosition (1);
+ }
+ else if (grab_state == QZ_VISIBLE_GRAB) {
+
+ CGAssociateMouseAndMouseCursorPosition (1);
+ }
+ else {
+ assert( grab_state == QZ_INVISIBLE_GRAB );
+
+ QZ_PrivateWarpCursor (this, SDL_VideoSurface->w / 2, SDL_VideoSurface->h / 2);
+ CGAssociateMouseAndMouseCursorPosition (0);
+ }
+}
+
+SDL_GrabMode QZ_GrabInput (_THIS, SDL_GrabMode grab_mode) {
+
+ int doGrab = grab_mode & SDL_GRAB_ON;
+ /*int fullscreen = grab_mode & SDL_GRAB_FULLSCREEN;*/
+
+ if ( this->screen == NULL ) {
+ SDL_SetError ("QZ_GrabInput: screen is NULL");
+ return SDL_GRAB_OFF;
+ }
+
+ if ( ! video_set ) {
+ /*SDL_SetError ("QZ_GrabInput: video is not set, grab will take effect on mode switch"); */
+ current_grab_mode = grab_mode;
+ return grab_mode; /* Will be set later on mode switch */
+ }
+
+ if ( grab_mode != SDL_GRAB_QUERY ) {
+ if ( doGrab )
+ QZ_ChangeGrabState (this, QZ_ENABLE_GRAB);
+ else
+ QZ_ChangeGrabState (this, QZ_DISABLE_GRAB);
+
+ current_grab_mode = doGrab ? SDL_GRAB_ON : SDL_GRAB_OFF;
+ QZ_UpdateCursor(this);
+ }
+
+ return current_grab_mode;
+}
diff --git a/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzWindow.h b/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzWindow.h
new file mode 100644
index 0000000..d19375b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzWindow.h
@@ -0,0 +1,51 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#if (MAC_OS_X_VERSION_MAX_ALLOWED < 1050)
+typedef unsigned int NSUInteger;
+#endif
+
+/* Subclass of NSWindow to fix genie effect and support resize events */
+@interface SDL_QuartzWindow : NSWindow
+{
+ BOOL watchForMouseUp;
+}
+
+- (void)miniaturize:(id)sender;
+- (void)display;
+- (void)setFrame:(NSRect)frameRect display:(BOOL)flag;
+- (void)appDidHide:(NSNotification*)note;
+- (void)appWillUnhide:(NSNotification*)note;
+- (void)appDidUnhide:(NSNotification*)note;
+- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag;
+@end
+
+/* Delegate for our NSWindow to send SDLQuit() on close */
+@interface SDL_QuartzWindowDelegate : NSObject
+- (BOOL)windowShouldClose:(id)sender;
+@end
+
+/* Subclass of NSView to set cursor rectangle */
+@interface SDL_QuartzView : NSView
+- (void)resetCursorRects;
+@end
diff --git a/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzWindow.m b/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzWindow.m
new file mode 100644
index 0000000..375833f
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/quartz/SDL_QuartzWindow.m
@@ -0,0 +1,231 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_QuartzVideo.h"
+#include "SDL_QuartzWM.h"
+#include "SDL_QuartzWindow.h"
+
+/*
+ This function makes the *SDL region* of the window 100% opaque.
+ The genie effect uses the alpha component. Otherwise,
+ it doesn't seem to matter what value it has.
+*/
+static void QZ_SetPortAlphaOpaque () {
+
+ SDL_Surface *surface = current_video->screen;
+ int bpp;
+
+ bpp = surface->format->BitsPerPixel;
+
+ if (bpp == 32) {
+
+ Uint32 *pixels = (Uint32*) surface->pixels;
+ Uint32 rowPixels = surface->pitch / 4;
+ Uint32 i, j;
+
+ for (i = 0; i < surface->h; i++)
+ for (j = 0; j < surface->w; j++) {
+
+ pixels[ (i * rowPixels) + j ] |= 0xFF000000;
+ }
+ }
+}
+
+@implementation SDL_QuartzWindow
+
+/* we override these methods to fix the miniaturize animation/dock icon bug */
+- (void)miniaturize:(id)sender
+{
+ if (SDL_VideoSurface->flags & SDL_OPENGL) {
+
+ /*
+ Future: Grab framebuffer and put into NSImage
+ [ qz_window setMiniwindowImage:image ];
+ */
+ }
+ else {
+
+ /* make the alpha channel opaque so anim won't have holes in it */
+ QZ_SetPortAlphaOpaque ();
+ }
+
+ /* window is hidden now */
+ SDL_PrivateAppActive (0, SDL_APPACTIVE);
+
+ [ super miniaturize:sender ];
+}
+
+- (void)display
+{
+ /*
+ This method fires just before the window deminaturizes from the Dock.
+
+ We'll save the current visible surface, let the window manager redraw any
+ UI elements, and restore the SDL surface. This way, no expose event
+ is required, and the deminiaturize works perfectly.
+ */
+ SDL_VideoDevice *this = (SDL_VideoDevice*)current_video;
+
+ /* make sure pixels are fully opaque */
+ if (! ( SDL_VideoSurface->flags & SDL_OPENGL ) )
+ QZ_SetPortAlphaOpaque ();
+
+ /* save current visible SDL surface */
+ [ self cacheImageInRect:[ window_view frame ] ];
+
+ /* let the window manager redraw controls, border, etc */
+ [ super display ];
+
+ /* restore visible SDL surface */
+ [ self restoreCachedImage ];
+
+ /* window is visible again */
+ SDL_PrivateAppActive (1, SDL_APPACTIVE);
+}
+
+- (void)setFrame:(NSRect)frameRect display:(BOOL)flag
+{
+
+ /*
+ If the video surface is NULL, this originated from QZ_SetVideoMode,
+ so don't send the resize event.
+ */
+ SDL_VideoDevice *this = (SDL_VideoDevice*)current_video;
+
+ if (this && SDL_VideoSurface == NULL) {
+
+ [ super setFrame:frameRect display:flag ];
+ }
+ else if (this && qz_window) {
+
+ NSRect newViewFrame;
+
+ [ super setFrame:frameRect display:flag ];
+
+ newViewFrame = [ window_view frame ];
+
+ SDL_PrivateResize (newViewFrame.size.width, newViewFrame.size.height);
+ }
+}
+
+/* QZ_DoActivate() calls a low-level CoreGraphics routine to adjust
+ the cursor position, if input is being grabbed. If app activation is
+ triggered by a mouse click in the title bar, then the window manager
+ gets confused and thinks we're dragging the window. The solution
+ below postpones the activate event to avoid this scenario. */
+- (void)becomeKeyWindow
+{
+ NSEvent *event = [self currentEvent];
+ if ([event type] == NSLeftMouseDown && [event window] == self)
+ watchForMouseUp = YES;
+ else
+ [super becomeKeyWindow];
+}
+
+- (void)sendEvent:(NSEvent *)event
+{
+ [super sendEvent:event];
+ if (watchForMouseUp && [event type] == NSLeftMouseUp)
+ {
+ watchForMouseUp = NO;
+ [super becomeKeyWindow];
+ }
+}
+
+- (void)appDidHide:(NSNotification*)note
+{
+ SDL_PrivateAppActive (0, SDL_APPACTIVE);
+}
+
+- (void)appWillUnhide:(NSNotification*)note
+{
+ SDL_VideoDevice *this = (SDL_VideoDevice*)current_video;
+
+ if ( this ) {
+
+ /* make sure pixels are fully opaque */
+ if (! ( SDL_VideoSurface->flags & SDL_OPENGL ) )
+ QZ_SetPortAlphaOpaque ();
+
+ /* save current visible SDL surface */
+ [ self cacheImageInRect:[ window_view frame ] ];
+ }
+}
+
+- (void)appDidUnhide:(NSNotification*)note
+{
+ /* restore cached image, since it may not be current, post expose event too */
+ [ self restoreCachedImage ];
+
+ /*SDL_PrivateExpose ();*/
+
+ SDL_PrivateAppActive (1, SDL_APPACTIVE);
+}
+
+- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask backing:(NSBackingStoreType)backingType defer:(BOOL)flag
+{
+ /* Make our window subclass receive these application notifications */
+ [ [ NSNotificationCenter defaultCenter ] addObserver:self
+ selector:@selector(appDidHide:) name:NSApplicationDidHideNotification object:NSApp ];
+
+ [ [ NSNotificationCenter defaultCenter ] addObserver:self
+ selector:@selector(appDidUnhide:) name:NSApplicationDidUnhideNotification object:NSApp ];
+
+ [ [ NSNotificationCenter defaultCenter ] addObserver:self
+ selector:@selector(appWillUnhide:) name:NSApplicationWillUnhideNotification object:NSApp ];
+
+ return [ super initWithContentRect:contentRect styleMask:styleMask backing:backingType defer:flag ];
+}
+
+@end
+
+@implementation SDL_QuartzWindowDelegate
+- (BOOL)windowShouldClose:(id)sender
+{
+ SDL_PrivateQuit();
+ return NO;
+}
+
+- (void)windowDidBecomeKey:(NSNotification *)aNotification
+{
+ QZ_DoActivate (current_video);
+}
+
+- (void)windowDidResignKey:(NSNotification *)aNotification
+{
+ QZ_DoDeactivate (current_video);
+}
+
+@end
+
+@implementation SDL_QuartzView
+
+- (void)resetCursorRects
+{
+ SDL_Cursor *sdlc = SDL_GetCursor();
+ if (sdlc != NULL && sdlc->wm_cursor != NULL) {
+ [self addCursorRect: [self visibleRect] cursor: sdlc->wm_cursor->nscursor];
+ }
+}
+
+@end
diff --git a/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosASM.S b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosASM.S
new file mode 100644
index 0000000..fae32f8
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosASM.S
@@ -0,0 +1,116 @@
+;
+; SDL - Simple DirectMedia Layer
+; Copyright (C) 1997-2012 Sam Lantinga
+;
+; This library is free software; you can redistribute it and/or
+; modify it under the terms of the GNU Library General Public
+; License as published by the Free Software Foundation; either
+; version 2 of the License, or (at your option) any later version.
+;
+; This library is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+; Library General Public License for more details.
+;
+; You should have received a copy of the GNU Library General Public
+; License along with this library; if not, write to the Free
+; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+;
+; Sam Lantinga
+; slouken@libsdl.org
+;
+; Assembler routines for RISC OS display
+;
+
+ AREA |C$$CODE|
+
+ EXPORT |RISCOS_Put32|
+
+; Display 32bpp to 32bpp, 1:1
+;
+; Code provided by Adrain Lees
+;
+; entry a1 -> destination
+; a2 = dest width in pixels
+; a3 = dest line length in bytes
+; a4 = dest height in scanlines
+; arg5 -> source
+; arg6 = byte offset from end of source line to start of next
+
+Arg5 * 10*4
+Arg6 * Arg5+4
+
+RISCOS_Put32 ROUT
+ STMFD sp!,{a2,v1-v6,sl,fp,lr}
+ LDR ip,[sp,#Arg5]
+ MOV lr,a1
+ B ucp64lp
+
+00 ;tail strip of 1-15 pixels
+
+ LDR v1,[ip],#4
+01 SUBS a2,a2,#1
+ STR v1,[lr],#4
+ LDRHI v1,[ip],#4
+ BHI %01
+ B %02
+
+ucp64end ADDS a2,a2,#16
+ BNE %00
+
+02 SUBS a4,a4,#1 ;height--
+ LDRHI v1,[sp,#Arg6]
+ LDRHI a2,[sp] ;reload width
+ BLS %03
+
+ ;move to start of next scanline
+
+ ADD lr,a1,a3
+ ADD a1,a1,a3
+ ADD ip,ip,v1
+
+ucp64lp SUBS a2,a2,#16
+ BLO ucp64end
+
+ PLD [ip,#64]
+
+ LDR v1,[ip],#4
+ LDR v2,[ip],#4
+ LDR v3,[ip],#4
+ LDR v4,[ip],#4
+ LDR v5,[ip],#4
+ LDR v6,[ip],#4
+ LDR sl,[ip],#4
+ LDR fp,[ip],#4
+ STR v1,[lr],#4
+ STR v2,[lr],#4
+ STR v3,[lr],#4
+ STR v4,[lr],#4
+ STR v5,[lr],#4
+ STR v6,[lr],#4
+ STR sl,[lr],#4
+ STR fp,[lr],#4
+
+ PLD [ip,#64]
+
+ LDR v1,[ip],#4
+ LDR v2,[ip],#4
+ LDR v3,[ip],#4
+ LDR v4,[ip],#4
+ LDR v5,[ip],#4
+ LDR v6,[ip],#4
+ LDR sl,[ip],#4
+ LDR fp,[ip],#4
+ STR v1,[lr],#4
+ STR v2,[lr],#4
+ STR v3,[lr],#4
+ STR v4,[lr],#4
+ STR v5,[lr],#4
+ STR v6,[lr],#4
+ STR sl,[lr],#4
+ STR fp,[lr],#4
+
+ B ucp64lp
+
+03 LDMFD sp!,{a2,v1-v6,sl,fp,pc}
+
diff --git a/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosFullScreenVideo.c b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosFullScreenVideo.c
new file mode 100644
index 0000000..b8c3cf7
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosFullScreenVideo.c
@@ -0,0 +1,777 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ File added by Alan Buckley (alan_baa@hotmail.com) for RISC OS compatability
+ 27 March 2003
+
+ Implements RISC OS full screen display.
+*/
+
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_riscostask.h"
+#include "SDL_riscosvideo.h"
+#include "SDL_riscosevents_c.h"
+#include "SDL_riscosmouse_c.h"
+
+#include "kernel.h"
+#include "swis.h"
+#include "unixlib/os.h"
+#include "unixlib/local.h"
+
+/* Private structures */
+typedef struct tagScreenModeBlock
+{
+ int flags; // mode selector flags, bit 0 = 1, bit 1-7 format specifier, 8-31 reserved
+ int x_pixels;
+ int y_pixels;
+ int pixel_depth; // 2^pixel_depth = bpp,i.e. 0 = 1, 1 = 2, 4 = 16, 5 = 32
+ int frame_rate; // -1 use first match
+ int mode_vars[5]; // array of index, value pairs terminated by -1
+} SCREENMODEBLOCK;
+
+
+/* Helper functions */
+void FULLSCREEN_SetDeviceMode(_THIS);
+int FULLSCREEN_SetMode(int width, int height, int bpp);
+void FULLSCREEN_SetupBanks(_THIS);
+
+/* SDL video device functions for fullscreen mode */
+static int FULLSCREEN_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
+static int FULLSCREEN_FlipHWSurface(_THIS, SDL_Surface *surface);
+void FULLSCREEN_SetWMCaption(_THIS, const char *title, const char *icon);
+extern int RISCOS_GetWmInfo(_THIS, SDL_SysWMinfo *info);
+
+/* UpdateRects variants */
+static void FULLSCREEN_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
+static void FULLSCREEN_UpdateRectsMemCpy(_THIS, int numrects, SDL_Rect *rects);
+static void FULLSCREEN_UpdateRects8bpp(_THIS, int numrects, SDL_Rect *rects);
+static void FULLSCREEN_UpdateRects16bpp(_THIS, int numrects, SDL_Rect *rects);
+static void FULLSCREEN_UpdateRects32bpp(_THIS, int numrects, SDL_Rect *rects);
+static void FULLSCREEN_UpdateRectsOS(_THIS, int numrects, SDL_Rect *rects);
+
+/* Local helper functions */
+static int cmpmodes(const void *va, const void *vb);
+static int FULLSCREEN_AddMode(_THIS, int bpp, int w, int h);
+void FULLSCREEN_SetWriteBank(int bank);
+void FULLSCREEN_SetDisplayBank(int bank);
+static void FULLSCREEN_DisableEscape();
+static void FULLSCREEN_EnableEscape();
+void FULLSCREEN_BuildModeList(_THIS);
+
+/* Following variable is set up in riskosTask.c */
+extern int riscos_backbuffer; /* Create a back buffer in system memory for full screen mode */
+
+/* Following is used to create a sprite back buffer */
+extern unsigned char *WIMP_CreateBuffer(int width, int height, int bpp);
+
+/* Fast assembler copy */
+extern void RISCOS_Put32(void *to, int pixels, int pitch, int rows, void *from, int src_skip_bytes);
+
+SDL_Surface *FULLSCREEN_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ _kernel_swi_regs regs;
+ Uint32 Rmask = 0;
+ Uint32 Gmask = 0;
+ Uint32 Bmask = 0;
+ int create_back_buffer = riscos_backbuffer;
+
+ switch(bpp)
+ {
+ case 8:
+ flags |= SDL_HWPALETTE;
+ break;
+
+ case 15:
+ case 16:
+ Bmask = 0x00007c00;
+ Gmask = 0x000003e0;
+ Rmask = 0x0000001f;
+ break;
+
+ case 32:
+ Bmask = 0x00ff0000;
+ Gmask = 0x0000ff00;
+ Rmask = 0x000000ff;
+ break;
+
+ default:
+ SDL_SetError("Pixel depth not supported");
+ return NULL;
+ break;
+ }
+
+ if (FULLSCREEN_SetMode(width, height, bpp) == 0)
+ {
+ SDL_SetError("Couldn't set requested mode");
+ return (NULL);
+ }
+
+/* printf("Setting mode %dx%d\n", width, height); */
+
+ /* Allocate the new pixel format for the screen */
+ if ( ! SDL_ReallocFormat(current, bpp, Rmask, Gmask, Bmask, 0) ) {
+ RISCOS_RestoreWimpMode();
+ SDL_SetError("Couldn't allocate new pixel format for requested mode");
+ return(NULL);
+ }
+
+ /* Set up the new mode framebuffer */
+ current->w = width;
+ this->hidden->height = current->h = height;
+
+ regs.r[0] = -1; /* -1 for current screen mode */
+
+ /* Get screen width in bytes */
+ regs.r[1] = 6; // Screen Width in bytes
+ _kernel_swi(OS_ReadModeVariable, &regs, &regs);
+
+ current->pitch = regs.r[2];
+
+ if (flags & SDL_DOUBLEBUF)
+ {
+ regs.r[0] = 2; /* Screen area */
+ _kernel_swi(OS_ReadDynamicArea, &regs, &regs);
+
+ /* Reg 1 has amount of memory currently used for display */
+ regs.r[0] = 2; /* Screen area */
+ regs.r[1] = (current->pitch * height * 2) - regs.r[1];
+ if (_kernel_swi(OS_ChangeDynamicArea, &regs, &regs) != NULL)
+ {
+ /* Can't allocate enough screen memory for double buffer */
+ flags &= ~SDL_DOUBLEBUF;
+ }
+ }
+
+ current->flags = flags | SDL_FULLSCREEN | SDL_HWSURFACE | SDL_PREALLOC;
+
+
+ /* Need to set display banks here for double buffering */
+ if (flags & SDL_DOUBLEBUF)
+ {
+ FULLSCREEN_SetWriteBank(0);
+ FULLSCREEN_SetDisplayBank(1);
+
+ create_back_buffer = 0; /* Don't need a back buffer for a double buffered display */
+ }
+
+ FULLSCREEN_SetupBanks(this);
+
+ if (create_back_buffer)
+ {
+ /* If not double buffered we may need to create a memory
+ ** back buffer to simulate processing on other OSes.
+ ** This is turned on by setting the enviromental variable
+ ** SDL$<name>$BackBuffer >= 1
+ */
+ if (riscos_backbuffer == 3)
+ this->hidden->bank[0] = WIMP_CreateBuffer(width, height, bpp);
+ else
+ this->hidden->bank[0] = SDL_malloc(height * current->pitch);
+ if (this->hidden->bank[0] == 0)
+ {
+ RISCOS_RestoreWimpMode();
+ SDL_SetError("Couldnt allocate memory for back buffer");
+ return (NULL);
+ }
+ /* Surface updated in programs is now a software surface */
+ current->flags &= ~SDL_HWSURFACE;
+ }
+
+ /* Store address of allocated screen bank to be freed later */
+ if (this->hidden->alloc_bank) SDL_free(this->hidden->alloc_bank);
+ if (create_back_buffer)
+ {
+ this->hidden->alloc_bank = this->hidden->bank[0];
+ if (riscos_backbuffer == 3)
+ {
+ this->hidden->bank[0] += 60; /* Start of sprite data */
+ if (bpp == 8) this->hidden->bank[0] += 2048; /* 8bpp sprite have palette first */
+ }
+ } else
+ this->hidden->alloc_bank = 0;
+
+ // Clear both banks to black
+ SDL_memset(this->hidden->bank[0], 0, height * current->pitch);
+ SDL_memset(this->hidden->bank[1], 0, height * current->pitch);
+
+ this->hidden->current_bank = 0;
+ current->pixels = this->hidden->bank[0];
+
+ /* Have to set the screen here, so SetDeviceMode will pick it up */
+ this->screen = current;
+
+ /* Reset device functions for the wimp */
+ FULLSCREEN_SetDeviceMode(this);
+
+/* FULLSCREEN_DisableEscape(); */
+
+ /* We're done */
+ return(current);
+}
+
+/* Reset any device functions that have been changed because we have run in WIMP mode */
+void FULLSCREEN_SetDeviceMode(_THIS)
+{
+ /* Update rects is different if we have a backbuffer */
+
+ if (riscos_backbuffer && (this->screen->flags & SDL_DOUBLEBUF) == 0)
+ {
+ switch(riscos_backbuffer)
+ {
+ case 2: /* ARM code full word copy */
+ switch(this->screen->format->BytesPerPixel)
+ {
+ case 1: /* 8bpp modes */
+ this->UpdateRects = FULLSCREEN_UpdateRects8bpp;
+ break;
+ case 2: /* 15/16bpp modes */
+ this->UpdateRects = FULLSCREEN_UpdateRects16bpp;
+ break;
+ case 4: /* 32 bpp modes */
+ this->UpdateRects = FULLSCREEN_UpdateRects32bpp;
+ break;
+
+ default: /* Just default to the memcpy routine */
+ this->UpdateRects = FULLSCREEN_UpdateRectsMemCpy;
+ break;
+ }
+ break;
+
+ case 3: /* Use OS sprite plot routine */
+ this->UpdateRects = FULLSCREEN_UpdateRectsOS;
+ break;
+
+ default: /* Old but safe memcpy */
+ this->UpdateRects = FULLSCREEN_UpdateRectsMemCpy;
+ break;
+ }
+ } else
+ this->UpdateRects = FULLSCREEN_UpdateRects; /* Default do nothing implementation */
+
+ this->SetColors = FULLSCREEN_SetColors;
+
+ this->FlipHWSurface = FULLSCREEN_FlipHWSurface;
+
+ this->SetCaption = FULLSCREEN_SetWMCaption;
+ this->SetIcon = NULL;
+ this->IconifyWindow = NULL;
+
+ this->ShowWMCursor = RISCOS_ShowWMCursor;
+ this->WarpWMCursor = FULLSCREEN_WarpWMCursor;
+
+ this->PumpEvents = FULLSCREEN_PumpEvents;
+}
+
+/* Query for the list of available video modes */
+void FULLSCREEN_BuildModeList(_THIS)
+{
+ _kernel_swi_regs regs;
+ char *enumInfo = NULL;
+ char *enum_ptr;
+ int *blockInfo;
+ int j;
+ int num_modes;
+
+ /* Find out how much space we need */
+ regs.r[0] = 2; /* Reason code */
+ regs.r[2] = 0; /* Number of modes to skip */
+ regs.r[6] = 0; /* pointer to block or 0 for count */
+ regs.r[7] = 0; /* Size of block in bytes */
+ _kernel_swi(OS_ScreenMode, &regs, &regs);
+
+ num_modes = -regs.r[2];
+
+ /* Video memory should be in r[5] */
+ this->info.video_mem = regs.r[5]/1024;
+
+ enumInfo = (unsigned char *)SDL_malloc(-regs.r[7]);
+ if (enumInfo == NULL)
+ {
+ SDL_OutOfMemory();
+ return;
+ }
+ /* Read mode information into block */
+ regs.r[2] = 0;
+ regs.r[6] = (int)enumInfo;
+ regs.r[7] = -regs.r[7];
+ _kernel_swi(OS_ScreenMode, &regs, &regs);
+
+ enum_ptr = enumInfo;
+
+ for (j =0; j < num_modes;j++)
+ {
+ blockInfo = (int *)enum_ptr;
+ if ((blockInfo[1] & 255) == 1) /* We understand this format */
+ {
+ switch(blockInfo[4])
+ {
+ case 3: /* 8 bits per pixel */
+ FULLSCREEN_AddMode(this, 8, blockInfo[2], blockInfo[3]);
+ break;
+ case 4: /* 15 bits per pixel */
+ FULLSCREEN_AddMode(this, 15, blockInfo[2], blockInfo[3]);
+ break;
+ case 5: /* 32 bits per pixel */
+ FULLSCREEN_AddMode(this, 32, blockInfo[2], blockInfo[3]);
+ break;
+ }
+ }
+
+ enum_ptr += blockInfo[0];
+ }
+
+ SDL_free(enumInfo);
+
+ /* Sort the mode lists */
+ for ( j=0; j<NUM_MODELISTS; ++j ) {
+ if ( SDL_nummodes[j] > 0 ) {
+ SDL_qsort(SDL_modelist[j], SDL_nummodes[j], sizeof *SDL_modelist[j], cmpmodes);
+ }
+ }
+}
+
+static int FULLSCREEN_FlipHWSurface(_THIS, SDL_Surface *surface)
+{
+ _kernel_swi_regs regs;
+ regs.r[0] = 19;
+
+ FULLSCREEN_SetDisplayBank(this->hidden->current_bank);
+ this->hidden->current_bank ^= 1;
+ FULLSCREEN_SetWriteBank(this->hidden->current_bank);
+ surface->pixels = this->hidden->bank[this->hidden->current_bank];
+
+ /* Wait for Vsync */
+ _kernel_swi(OS_Byte, &regs, &regs);
+
+ return(0);
+}
+
+/* Nothing to do if we are writing direct to hardware */
+static void FULLSCREEN_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
+{
+}
+
+/* Safe but slower Memory copy from our allocated back buffer */
+static void FULLSCREEN_UpdateRectsMemCpy(_THIS, int numrects, SDL_Rect *rects)
+{
+ int j;
+ char *to, *from;
+ int pitch = this->screen->pitch;
+ int row;
+ int xmult = this->screen->format->BytesPerPixel;
+ for (j = 0; j < numrects; j++)
+ {
+ from = this->hidden->bank[0] + rects->x * xmult + rects->y * pitch;
+ to = this->hidden->bank[1] + rects->x * xmult + rects->y * pitch;
+ for (row = 0; row < rects->h; row++)
+ {
+ SDL_memcpy(to, from, rects->w * xmult);
+ from += pitch;
+ to += pitch;
+ }
+ rects++;
+ }
+}
+
+/* Use optimized assembler memory copy. Deliberately copies extra columns if
+ necessary to ensure the rectangle is word aligned. */
+static void FULLSCREEN_UpdateRects8bpp(_THIS, int numrects, SDL_Rect *rects)
+{
+ int j;
+ char *to, *from;
+ int pitch = this->screen->pitch;
+ int width_bytes;
+ int src_skip_bytes;
+
+ for (j = 0; j < numrects; j++)
+ {
+ from = this->hidden->bank[0] + rects->x + rects->y * pitch;
+ to = this->hidden->bank[1] + rects->x + rects->y * pitch;
+ width_bytes = rects->w;
+ if ((int)from & 3)
+ {
+ int extra = ((int)from & 3);
+ from -= extra;
+ to -= extra;
+ width_bytes += extra;
+ }
+ if (width_bytes & 3) width_bytes += 4 - (width_bytes & 3);
+ src_skip_bytes = pitch - width_bytes;
+
+ RISCOS_Put32(to, (width_bytes >> 2), pitch, (int)rects->h, from, src_skip_bytes);
+ rects++;
+ }
+}
+
+/* Use optimized assembler memory copy. Deliberately copies extra columns if
+ necessary to ensure the rectangle is word aligned. */
+static void FULLSCREEN_UpdateRects16bpp(_THIS, int numrects, SDL_Rect *rects)
+{
+ int j;
+ char *to, *from;
+ int pitch = this->screen->pitch;
+ int width_bytes;
+ int src_skip_bytes;
+
+ for (j = 0; j < numrects; j++)
+ {
+ from = this->hidden->bank[0] + (rects->x << 1) + rects->y * pitch;
+ to = this->hidden->bank[1] + (rects->x << 1) + rects->y * pitch;
+ width_bytes = (((int)rects->w) << 1);
+ if ((int)from & 3)
+ {
+ from -= 2;
+ to -= 2;
+ width_bytes += 2;
+ }
+ if (width_bytes & 3) width_bytes += 2;
+ src_skip_bytes = pitch - width_bytes;
+
+ RISCOS_Put32(to, (width_bytes >> 2), pitch, (int)rects->h, from, src_skip_bytes);
+ rects++;
+ }
+}
+
+/* Use optimized assembler memory copy. 32 bpp modes are always word aligned */
+static void FULLSCREEN_UpdateRects32bpp(_THIS, int numrects, SDL_Rect *rects)
+{
+ int j;
+ char *to, *from;
+ int pitch = this->screen->pitch;
+ int width;
+
+ for (j = 0; j < numrects; j++)
+ {
+ from = this->hidden->bank[0] + (rects->x << 2) + rects->y * pitch;
+ to = this->hidden->bank[1] + (rects->x << 2) + rects->y * pitch;
+ width = (int)rects->w ;
+
+ RISCOS_Put32(to, width, pitch, (int)rects->h, from, pitch - (width << 2));
+ rects++;
+ }
+}
+
+/* Use operating system sprite plots. Currently this is much slower than the
+ other variants however accelerated sprite plotting can be seen on the horizon
+ so this prepares for it. */
+static void FULLSCREEN_UpdateRectsOS(_THIS, int numrects, SDL_Rect *rects)
+{
+ _kernel_swi_regs regs;
+ _kernel_oserror *err;
+ int j;
+ int y;
+
+ regs.r[0] = 28 + 512;
+ regs.r[1] = (unsigned int)this->hidden->alloc_bank;
+ regs.r[2] = (unsigned int)this->hidden->alloc_bank+16;
+ regs.r[5] = 0;
+
+ for (j = 0; j < numrects; j++)
+ {
+ y = this->screen->h - rects->y; /* top of clipping region */
+ _kernel_oswrch(24); /* Set graphics clip region */
+ _kernel_oswrch((rects->x << this->hidden->xeig) & 0xFF); /* left */
+ _kernel_oswrch(((rects->x << this->hidden->xeig) >> 8) & 0xFF);
+ _kernel_oswrch(((y - rects->h) << this->hidden->yeig) & 0xFF); /* bottom */
+ _kernel_oswrch((((y - rects->h) << this->hidden->yeig)>> 8) & 0xFF);
+ _kernel_oswrch(((rects->x + rects->w - 1) << this->hidden->xeig) & 0xFF); /* right */
+ _kernel_oswrch((((rects->x + rects->w - 1)<< this->hidden->xeig) >> 8) & 0xFF);
+ _kernel_oswrch(((y-1) << this->hidden->yeig) & 0xFF); /* top */
+ _kernel_oswrch((((y-1) << this->hidden->yeig) >> 8) & 0xFF);
+
+ regs.r[3] = 0;
+ regs.r[4] = 0;
+
+ if ((err = _kernel_swi(OS_SpriteOp, &regs, &regs)) != 0)
+ {
+ printf("OS_SpriteOp failed \n%s\n",err->errmess);
+ }
+
+ rects++;
+
+ /* Reset to full screen clipping */
+ _kernel_oswrch(24); /* Set graphics clip region */
+ _kernel_oswrch(0); /* left */
+ _kernel_oswrch(0);
+ _kernel_oswrch(0); /* bottom */
+ _kernel_oswrch(0);
+ _kernel_oswrch(((this->screen->w-1) << this->hidden->xeig) & 0xFF); /* right */
+ _kernel_oswrch((((this->screen->w-1) << this->hidden->xeig) >> 8) & 0xFF);
+ _kernel_oswrch(((this->screen->h-1) << this->hidden->yeig) & 0xFF); /* top */
+ _kernel_oswrch((((this->screen->h-1) << this->hidden->yeig) >> 8) & 0xFF);
+ }
+}
+
+
+int FULLSCREEN_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ _kernel_swi_regs regs;
+ int palette[256];
+
+ regs.r[0] = -1;
+ regs.r[1] = -1;
+ regs.r[2] = (int)palette;
+ regs.r[3] = 1024;
+ regs.r[4] = 0;
+ _kernel_swi(ColourTrans_ReadPalette, &regs, &regs);
+
+ while(ncolors--)
+ {
+ palette[firstcolor] = ((colors->b) << 24) | ((colors->g) << 16) | ((colors->r) << 8);
+ firstcolor++;
+ colors++;
+ }
+
+ regs.r[0] = -1;
+ regs.r[1] = -1;
+ regs.r[2] = (int)palette;
+ regs.r[3] = 0;
+ regs.r[4] = 0;
+ _kernel_swi(ColourTrans_WritePalette, &regs, &regs);
+
+ return(1);
+}
+
+
+static int cmpmodes(const void *va, const void *vb)
+{
+ SDL_Rect *a = *(SDL_Rect **)va;
+ SDL_Rect *b = *(SDL_Rect **)vb;
+ if(a->w == b->w)
+ return b->h - a->h;
+ else
+ return b->w - a->w;
+}
+
+static int FULLSCREEN_AddMode(_THIS, int bpp, int w, int h)
+{
+ SDL_Rect *mode;
+ int i, index;
+ int next_mode;
+
+ /* Check to see if we already have this mode */
+ if ( bpp < 8 ) { /* Not supported */
+ return(0);
+ }
+ index = ((bpp+7)/8)-1;
+ for ( i=0; i<SDL_nummodes[index]; ++i ) {
+ mode = SDL_modelist[index][i];
+ if ( (mode->w == w) && (mode->h == h) ) {
+ return(0);
+ }
+ }
+
+ /* Set up the new video mode rectangle */
+ mode = (SDL_Rect *)SDL_malloc(sizeof *mode);
+ if ( mode == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ mode->x = 0;
+ mode->y = 0;
+ mode->w = w;
+ mode->h = h;
+
+ /* Allocate the new list of modes, and fill in the new mode */
+ next_mode = SDL_nummodes[index];
+ SDL_modelist[index] = (SDL_Rect **)
+ SDL_realloc(SDL_modelist[index], (1+next_mode+1)*sizeof(SDL_Rect *));
+ if ( SDL_modelist[index] == NULL ) {
+ SDL_OutOfMemory();
+ SDL_nummodes[index] = 0;
+ SDL_free(mode);
+ return(-1);
+ }
+ SDL_modelist[index][next_mode] = mode;
+ SDL_modelist[index][next_mode+1] = NULL;
+ SDL_nummodes[index]++;
+
+ return(0);
+}
+
+void FULLSCREEN_SetWriteBank(int bank)
+{
+ _kernel_swi_regs regs;
+ regs.r[0] = 112;
+ regs.r[1] = bank+1;
+ _kernel_swi(OS_Byte, &regs, &regs);
+}
+
+void FULLSCREEN_SetDisplayBank(int bank)
+{
+ _kernel_swi_regs regs;
+ regs.r[0] = 113;
+ regs.r[1] = bank+1;
+ _kernel_swi(OS_Byte, &regs, &regs);
+}
+
+
+/** Disable special escape key processing */
+static void FULLSCREEN_DisableEscape()
+{
+ _kernel_swi_regs regs;
+ regs.r[0] = 229;
+ regs.r[1] = 1;
+ regs.r[2] = 0;
+ _kernel_swi(OS_Byte, &regs, &regs);
+
+}
+
+/** Enable special escape key processing */
+static void FULLSCREEN_EnableEscape()
+{
+ _kernel_swi_regs regs;
+ regs.r[0] = 229;
+ regs.r[1] = 0;
+ regs.r[2] = 0;
+ _kernel_swi(OS_Byte, &regs, &regs);
+
+}
+
+/** Store caption in case this is called before we create a window */
+void FULLSCREEN_SetWMCaption(_THIS, const char *title, const char *icon)
+{
+ SDL_strlcpy(this->hidden->title, title, SDL_arraysize(this->hidden->title));
+}
+
+/* Set screen mode
+*
+* Returns 1 if mode is set ok, otherwise 0
+*/
+
+int FULLSCREEN_SetMode(int width, int height, int bpp)
+{
+ SCREENMODEBLOCK smb;
+ _kernel_swi_regs regs;
+
+ smb.flags = 1;
+ smb.x_pixels = width;
+ smb.y_pixels = height;
+ smb.mode_vars[0] = -1;
+
+ switch(bpp)
+ {
+ case 8:
+ smb.pixel_depth = 3;
+ /* Note: Need to set ModeFlags to 128 and NColour variables to 255 get full 8 bit palette */
+ smb.mode_vars[0] = 0; smb.mode_vars[1] = 128; /* Mode flags */
+ smb.mode_vars[2] = 3; smb.mode_vars[3] = 255; /* NColour (number of colours -1) */
+ smb.mode_vars[4] = -1; /* End of list */
+ break;
+
+ case 15:
+ case 16:
+ smb.pixel_depth = 4;
+ break;
+
+ case 32:
+ smb.pixel_depth = 5;
+ break;
+
+ default:
+ SDL_SetError("Pixel depth not supported");
+ return 0;
+ break;
+ }
+
+ smb.frame_rate = -1;
+
+ regs.r[0] = 0;
+ regs.r[1] = (int)&smb;
+
+ if (_kernel_swi(OS_ScreenMode, &regs, &regs) != 0)
+ {
+ SDL_SetError("Couldn't set requested mode");
+ return 0;
+ }
+
+ /* Turn cursor off*/
+ _kernel_oswrch(23);_kernel_oswrch(1);_kernel_oswrch(0);
+ _kernel_oswrch(0);_kernel_oswrch(0);_kernel_oswrch(0);
+ _kernel_oswrch(0);_kernel_oswrch(0);_kernel_oswrch(0);
+ _kernel_oswrch(0);_kernel_oswrch(0);
+
+ return 1;
+}
+
+/* Get Start addresses for the screen banks */
+void FULLSCREEN_SetupBanks(_THIS)
+{
+ _kernel_swi_regs regs;
+ int block[5];
+ block[0] = 148; /* Write screen start */
+ block[1] = 149; /* Display screen start */
+ block[2] = 4; /* X eig factor */
+ block[3] = 5; /* Y eig factor */
+ block[4] = -1; /* End of list of variables to request */
+
+ regs.r[0] = (int)block;
+ regs.r[1] = (int)block;
+ _kernel_swi(OS_ReadVduVariables, &regs, &regs);
+
+ this->hidden->bank[0] = (void *)block[0];
+ this->hidden->bank[1] = (void *)block[1];
+ this->hidden->xeig = block[2];
+ this->hidden->yeig = block[3];
+}
+
+/* Toggle to full screen mode from the WIMP */
+
+int FULLSCREEN_ToggleFromWimp(_THIS)
+{
+ int width = this->screen->w;
+ int height = this->screen->h;
+ int bpp = this->screen->format->BitsPerPixel;
+
+ RISCOS_StoreWimpMode();
+ if (FULLSCREEN_SetMode(width, height, bpp))
+ {
+ char *buffer = this->hidden->alloc_bank; /* This is start of sprite data */
+ /* Support back buffer mode only */
+ if (riscos_backbuffer == 0) riscos_backbuffer = 1;
+
+ FULLSCREEN_SetupBanks(this);
+
+ this->hidden->bank[0] = buffer + 60; /* Start of sprite data */
+ if (bpp == 8) this->hidden->bank[0] += 2048; /* 8bpp sprite have palette first */
+
+ this->hidden->current_bank = 0;
+ this->screen->pixels = this->hidden->bank[0];
+
+ /* Copy back buffer to screen memory */
+ SDL_memcpy(this->hidden->bank[1], this->hidden->bank[0], width * height * this->screen->format->BytesPerPixel);
+
+ FULLSCREEN_SetDeviceMode(this);
+ return 1;
+ } else
+ RISCOS_RestoreWimpMode();
+
+ return 0;
+}
diff --git a/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosevents.c b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosevents.c
new file mode 100644
index 0000000..5487507
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosevents.c
@@ -0,0 +1,549 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ File added by Alan Buckley (alan_baa@hotmail.com) for RISC OS compatability
+ 27 March 2003
+
+ Implements keyboard setup, event pump and keyboard and mouse polling
+*/
+
+
+#include "SDL.h"
+#include "../../timer/SDL_timer_c.h"
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "../SDL_cursor_c.h"
+#include "SDL_riscosvideo.h"
+#include "SDL_riscosevents_c.h"
+
+#include "memory.h"
+#include "stdlib.h"
+#include "ctype.h"
+
+#include "kernel.h"
+#include "swis.h"
+
+/* The translation table from a RISC OS internal key numbers to a SDL keysym */
+static SDLKey RO_keymap[SDLK_LAST];
+
+/* RISC OS Key codes */
+#define ROKEY_SHIFT 0
+#define ROKEY_CTRL 1
+#define ROKEY_ALT 2
+/* Left shift is first key we will check for */
+#define ROKEY_LEFT_SHIFT 3
+
+/* Need to ignore mouse buttons as they are processed separately */
+#define ROKEY_LEFT_MOUSE 9
+#define ROKEY_CENTRE_MOUSE 10
+#define ROKEY_RIGHT_MOUSE 11
+
+/* No key has been pressed return value*/
+#define ROKEY_NONE 255
+
+/* Id of last key in keyboard */
+#define ROKEY_LAST_KEY 124
+
+/* Size of array for all keys */
+#define ROKEYBD_ARRAYSIZE 125
+
+static char RO_pressed[ROKEYBD_ARRAYSIZE];
+
+static SDL_keysym *TranslateKey(int intkey, SDL_keysym *keysym, int pressed);
+
+void RISCOS_PollMouse(_THIS);
+void RISCOS_PollKeyboard();
+
+void RISCOS_PollMouseHelper(_THIS, int fullscreen);
+
+#if SDL_THREADS_DISABLED
+extern void DRenderer_FillBuffers();
+
+/* Timer running function */
+extern void RISCOS_CheckTimer();
+
+#endif
+
+void FULLSCREEN_PumpEvents(_THIS)
+{
+ /* Current implementation requires keyboard and mouse polling */
+ RISCOS_PollKeyboard();
+ RISCOS_PollMouse(this);
+#if SDL_THREADS_DISABLED
+// DRenderer_FillBuffers();
+ if (SDL_timer_running) RISCOS_CheckTimer();
+#endif
+}
+
+
+void RISCOS_InitOSKeymap(_THIS)
+{
+ int i;
+
+ /* Map the VK keysyms */
+ for ( i=0; i<SDL_arraysize(RO_keymap); ++i )
+ RO_keymap[i] = SDLK_UNKNOWN;
+
+ RO_keymap[3] = SDLK_LSHIFT;
+ RO_keymap[4] = SDLK_LCTRL;
+ RO_keymap[5] = SDLK_LALT;
+ RO_keymap[6] = SDLK_RSHIFT;
+ RO_keymap[7] = SDLK_RCTRL;
+ RO_keymap[8] = SDLK_RALT;
+ RO_keymap[16] = SDLK_q;
+ RO_keymap[17] = SDLK_3;
+ RO_keymap[18] = SDLK_4;
+ RO_keymap[19] = SDLK_5;
+ RO_keymap[20] = SDLK_F4;
+ RO_keymap[21] = SDLK_8;
+ RO_keymap[22] = SDLK_F7;
+ RO_keymap[23] = SDLK_MINUS,
+ RO_keymap[25] = SDLK_LEFT;
+ RO_keymap[26] = SDLK_KP6;
+ RO_keymap[27] = SDLK_KP7;
+ RO_keymap[28] = SDLK_F11;
+ RO_keymap[29] = SDLK_F12;
+ RO_keymap[30] = SDLK_F10;
+ RO_keymap[31] = SDLK_SCROLLOCK;
+ RO_keymap[32] = SDLK_PRINT;
+ RO_keymap[33] = SDLK_w;
+ RO_keymap[34] = SDLK_e;
+ RO_keymap[35] = SDLK_t;
+ RO_keymap[36] = SDLK_7;
+ RO_keymap[37] = SDLK_i;
+ RO_keymap[38] = SDLK_9;
+ RO_keymap[39] = SDLK_0;
+ RO_keymap[41] = SDLK_DOWN;
+ RO_keymap[42] = SDLK_KP8;
+ RO_keymap[43] = SDLK_KP9;
+ RO_keymap[44] = SDLK_BREAK;
+ RO_keymap[45] = SDLK_BACKQUOTE;
+/* RO_keymap[46] = SDLK_currency; TODO: Figure out if this has a value */
+ RO_keymap[47] = SDLK_BACKSPACE;
+ RO_keymap[48] = SDLK_1;
+ RO_keymap[49] = SDLK_2;
+ RO_keymap[50] = SDLK_d;
+ RO_keymap[51] = SDLK_r;
+ RO_keymap[52] = SDLK_6;
+ RO_keymap[53] = SDLK_u;
+ RO_keymap[54] = SDLK_o;
+ RO_keymap[55] = SDLK_p;
+ RO_keymap[56] = SDLK_LEFTBRACKET;
+ RO_keymap[57] = SDLK_UP;
+ RO_keymap[58] = SDLK_KP_PLUS;
+ RO_keymap[59] = SDLK_KP_MINUS;
+ RO_keymap[60] = SDLK_KP_ENTER;
+ RO_keymap[61] = SDLK_INSERT;
+ RO_keymap[62] = SDLK_HOME;
+ RO_keymap[63] = SDLK_PAGEUP;
+ RO_keymap[64] = SDLK_CAPSLOCK;
+ RO_keymap[65] = SDLK_a;
+ RO_keymap[66] = SDLK_x;
+ RO_keymap[67] = SDLK_f;
+ RO_keymap[68] = SDLK_y;
+ RO_keymap[69] = SDLK_j;
+ RO_keymap[70] = SDLK_k;
+ RO_keymap[72] = SDLK_SEMICOLON;
+ RO_keymap[73] = SDLK_RETURN;
+ RO_keymap[74] = SDLK_KP_DIVIDE;
+ RO_keymap[76] = SDLK_KP_PERIOD;
+ RO_keymap[77] = SDLK_NUMLOCK;
+ RO_keymap[78] = SDLK_PAGEDOWN;
+ RO_keymap[79] = SDLK_QUOTE;
+ RO_keymap[81] = SDLK_s;
+ RO_keymap[82] = SDLK_c;
+ RO_keymap[83] = SDLK_g;
+ RO_keymap[84] = SDLK_h;
+ RO_keymap[85] = SDLK_n;
+ RO_keymap[86] = SDLK_l;
+ RO_keymap[87] = SDLK_SEMICOLON;
+ RO_keymap[88] = SDLK_RIGHTBRACKET;
+ RO_keymap[89] = SDLK_DELETE;
+ RO_keymap[90] = SDLK_KP_MINUS;
+ RO_keymap[91] = SDLK_KP_MULTIPLY;
+ RO_keymap[93] = SDLK_EQUALS;
+ RO_keymap[94] = SDLK_BACKSLASH;
+ RO_keymap[96] = SDLK_TAB;
+ RO_keymap[97] = SDLK_z;
+ RO_keymap[98] = SDLK_SPACE;
+ RO_keymap[99] = SDLK_v;
+ RO_keymap[100] = SDLK_b;
+ RO_keymap[101] = SDLK_m;
+ RO_keymap[102] = SDLK_COMMA;
+ RO_keymap[103] = SDLK_PERIOD;
+ RO_keymap[104] = SDLK_SLASH;
+ RO_keymap[105] = SDLK_END;
+ RO_keymap[106] = SDLK_KP0;
+ RO_keymap[107] = SDLK_KP1;
+ RO_keymap[108] = SDLK_KP3;
+ RO_keymap[112] = SDLK_ESCAPE;
+ RO_keymap[113] = SDLK_F1;
+ RO_keymap[114] = SDLK_F2;
+ RO_keymap[115] = SDLK_F3;
+ RO_keymap[116] = SDLK_F5;
+ RO_keymap[117] = SDLK_F6;
+ RO_keymap[118] = SDLK_F8;
+ RO_keymap[119] = SDLK_F9;
+ RO_keymap[120] = SDLK_HASH;
+ RO_keymap[121] = SDLK_RIGHT;
+ RO_keymap[122] = SDLK_KP4;
+ RO_keymap[123] = SDLK_KP5;
+ RO_keymap[124] = SDLK_KP2;
+
+ SDL_memset(RO_pressed, 0, ROKEYBD_ARRAYSIZE);
+}
+
+
+/* Variable for mouse relative processing */
+int mouse_relative = 0;
+
+/* Check to see if we need to enter or leave mouse relative mode */
+
+void RISCOS_CheckMouseMode(_THIS)
+{
+ /* If the mouse is hidden and input is grabbed, we use relative mode */
+ if ( !(SDL_cursorstate & CURSOR_VISIBLE) &&
+ (this->input_grab != SDL_GRAB_OFF) ) {
+ mouse_relative = 1;
+ } else {
+ mouse_relative = 0;
+ }
+}
+
+
+void RISCOS_PollMouse(_THIS)
+{
+ RISCOS_PollMouseHelper(this, 1);
+}
+
+extern int mouseInWindow;
+
+void WIMP_PollMouse(_THIS)
+{
+ /* Only poll when mouse is over the window */
+ if (!mouseInWindow) return;
+
+ RISCOS_PollMouseHelper(this, 0);
+}
+
+/* Static variables so only changes are reported */
+static Sint16 last_x = -1, last_y = -1;
+static int last_buttons = 0;
+
+/* Share routine between WIMP and FULLSCREEN for polling mouse and
+ passing on events */
+void RISCOS_PollMouseHelper(_THIS, int fullscreen)
+{
+ _kernel_swi_regs regs;
+ static int starting = 1;
+
+ if (_kernel_swi(OS_Mouse, &regs, &regs) == NULL)
+ {
+ Sint16 new_x = regs.r[0]; /* Initialy get as OS units */
+ Sint16 new_y = regs.r[1];
+
+ /* Discard mouse events until they let go of the mouse after starting */
+ if (starting && regs.r[2] != 0)
+ return;
+ else
+ starting = 0;
+
+ if (new_x != last_x || new_y != last_y || last_buttons != regs.r[2])
+ {
+ /* Something changed so generate appropriate events */
+ int topLeftX, topLeftY; /* Top left OS units */
+ int x, y; /* Mouse position in SDL pixels */
+
+ if (fullscreen)
+ {
+ topLeftX = 0;
+ topLeftY = (this->hidden->height << this->hidden->yeig) - 1;
+ } else
+ {
+ int window_state[9];
+
+ /* Get current window state */
+ window_state[0] = this->hidden->window_handle;
+ regs.r[1] = (unsigned int)window_state;
+ _kernel_swi(Wimp_GetWindowState, &regs, &regs);
+
+ topLeftX = window_state[1];
+ topLeftY = window_state[4];
+ }
+
+ /* Convert co-ordinates to workspace */
+ x = new_x - topLeftX;
+ y = topLeftY - new_y; /* Y goes from top of window/screen */
+
+ /* Convert OS units to pixels */
+ x >>= this->hidden->xeig;
+ y >>= this->hidden->yeig;
+
+ if (last_x != new_x || last_y != new_y)
+ {
+ if (mouse_relative)
+ {
+ int centre_x = SDL_VideoSurface->w/2;
+ int centre_y = SDL_VideoSurface->h/2;
+
+ if (centre_x != x || centre_y != y)
+ {
+ if (SDL_VideoSurface) SDL_PrivateMouseMotion(0,1,x - centre_x, y - centre_y);
+ last_x = topLeftX + (centre_x << this->hidden->xeig);
+ last_y = topLeftY - (centre_y << this->hidden->yeig);
+
+ /* Re-centre the mouse pointer, so we still get relative
+ movement when the mouse is at the edge of the window
+ or screen.
+ */
+ {
+ unsigned char block[5];
+
+ block[0] = 3; /* OSWORD move pointer sub-reason code */
+ block[1] = last_x & 0xFF;
+ block[2] = (last_x >> 8) & 0xFF;
+ block[3] = last_y & 0xFF;
+ block[4] = (last_y >> 8) & 0xFF;
+
+ regs.r[0] = 21; /* OSWORD pointer stuff code */
+ regs.r[1] = (int)block;
+ _kernel_swi(OS_Word, &regs, &regs);
+ }
+ }
+ } else
+ {
+ last_x = new_x;
+ last_y = new_y;
+ SDL_PrivateMouseMotion(0,0,x,y);
+ }
+ }
+
+ if (last_buttons != regs.r[2])
+ {
+ int changed = last_buttons ^ regs.r[2];
+ last_buttons = regs.r[2];
+ if (changed & 4) SDL_PrivateMouseButton((last_buttons & 4) ? SDL_PRESSED : SDL_RELEASED, SDL_BUTTON_LEFT, 0, 0);
+ if (changed & 2) SDL_PrivateMouseButton((last_buttons & 2) ? SDL_PRESSED : SDL_RELEASED, SDL_BUTTON_MIDDLE, 0, 0);
+ if (changed & 1) SDL_PrivateMouseButton((last_buttons & 1) ? SDL_PRESSED : SDL_RELEASED, SDL_BUTTON_RIGHT, 0, 0);
+ }
+ }
+ }
+}
+
+void RISCOS_PollKeyboard()
+{
+ int which_key = ROKEY_LEFT_SHIFT;
+ int j;
+ int min_key, max_key;
+ SDL_keysym key;
+
+ /* Scan the keyboard to see what is pressed */
+ while (which_key <= ROKEY_LAST_KEY)
+ {
+ which_key = (_kernel_osbyte(121, which_key, 0) & 0xFF);
+ if (which_key != ROKEY_NONE)
+ {
+ switch(which_key)
+ {
+ /* Skip over mouse keys */
+ case ROKEY_LEFT_MOUSE:
+ case ROKEY_CENTRE_MOUSE:
+ case ROKEY_RIGHT_MOUSE:
+ which_key = ROKEY_RIGHT_MOUSE;
+ break;
+
+ /* Ignore keys that cause 2 internal number to be generated */
+ case 71: case 24: case 87: case 40:
+ break;
+
+ /* Ignore break as it can be latched on */
+ case 44:
+ break;
+
+ default:
+ RO_pressed[which_key] += 2;
+ break;
+ }
+ which_key++;
+ }
+ }
+
+ /* Generate key released messages */
+ min_key = ROKEY_LAST_KEY+1;
+ max_key = ROKEY_LEFT_SHIFT;
+
+ for (j = ROKEY_LEFT_SHIFT; j <= ROKEY_LAST_KEY; j++)
+ {
+ if (RO_pressed[j])
+ {
+ if (RO_pressed[j] == 1)
+ {
+ RO_pressed[j] = 0;
+ SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(j,&key,0));
+ } else
+ {
+ if (j < min_key) min_key = j;
+ if (j > max_key) max_key = j;
+ }
+ }
+ }
+
+ /* Generate key pressed messages */
+ for (j = min_key; j <= max_key; j++)
+ {
+ if (RO_pressed[j])
+ {
+ if (RO_pressed[j] == 2)
+ {
+ SDL_PrivateKeyboard(SDL_PRESSED,TranslateKey(j,&key,1));
+ }
+ RO_pressed[j] = 1;
+ }
+ }
+}
+
+static SDL_keysym *TranslateKey(int intkey, SDL_keysym *keysym, int pressed)
+{
+ /* Set the keysym information */
+ keysym->scancode = (unsigned char) intkey;
+ keysym->sym = RO_keymap[intkey];
+ keysym->mod = KMOD_NONE;
+ keysym->unicode = 0;
+ if ( pressed && SDL_TranslateUNICODE )
+ {
+ int state;
+ int ch;
+
+ state = (_kernel_osbyte(202, 0, 255) & 0xFF);
+
+ /*TODO: Take into account other keyboard layouts */
+
+ ch = keysym->sym; /* This should handle most unshifted keys */
+
+ if (intkey < 9 || ch == SDLK_UNKNOWN)
+ {
+ ch = 0;
+
+ } else if (state & 64) /* Control on */
+ {
+ ch = ch & 31;
+
+ } else
+ {
+ int topOfKey = 0;
+ if (state & 8) /* Shift on */
+ {
+ topOfKey = 1;
+ }
+
+ if ((state & 16) == 0) /* Caps lock is on */
+ {
+ if (ch >= SDLK_a && ch <= SDLK_z)
+ {
+ if ((state & 128) == 0) /* Shift Enable off */
+ {
+ /* All letter become upper case */
+ topOfKey = 1;
+ } else
+ {
+ /* Shift+Letters gives lower case */
+ topOfKey = 1 - topOfKey;
+ }
+ }
+ }
+
+ if (topOfKey)
+ {
+ /* Key produced with shift held down */
+
+ /* Letters just give upper case version */
+ if (ch >= SDLK_a && ch <= SDLK_z) ch = toupper(ch);
+ else
+ {
+ switch(ch)
+ {
+ case SDLK_HASH: ch = '~'; break;
+ case SDLK_QUOTE: ch = '@'; break;
+ case SDLK_COMMA: ch = '<'; break;
+ case SDLK_MINUS: ch = '_'; break;
+ case SDLK_PERIOD: ch = '>'; break;
+ case SDLK_SLASH: ch = '?'; break;
+
+ case SDLK_0: ch = ')'; break;
+ case SDLK_1: ch = '!'; break;
+ case SDLK_2: ch = '"'; break;
+ case SDLK_3: ch = '£'; break;
+ case SDLK_4: ch = '$'; break;
+ case SDLK_5: ch = '%'; break;
+ case SDLK_6: ch = '^'; break;
+ case SDLK_7: ch = '&'; break;
+ case SDLK_8: ch = '*'; break;
+ case SDLK_9: ch = '('; break;
+
+ case SDLK_SEMICOLON: ch = ':'; break;
+ case SDLK_EQUALS: ch = '+'; break;
+ case SDLK_LEFTBRACKET: ch = '{'; break;
+ case SDLK_BACKSLASH: ch = '|'; break;
+ case SDLK_RIGHTBRACKET: ch = '}'; break;
+ case SDLK_BACKQUOTE: ch = '¬'; break;
+
+ default:
+ ch = 0; /* Map to zero character if we don't understand it */
+ break;
+ }
+ }
+
+ } else if (ch > 126)
+ {
+ /* SDL key code < 126 map directly onto their Unicode equivalents */
+ /* Keypad 0 to 9 maps to numeric equivalent */
+ if (ch >= SDLK_KP0 && ch <= SDLK_KP9) ch = ch - SDLK_KP0 + '0';
+ else
+ {
+ /* Following switch maps other keys that produce an Ascii value */
+ switch(ch)
+ {
+ case SDLK_KP_PERIOD: ch = '.'; break;
+ case SDLK_KP_DIVIDE: ch = '/'; break;
+ case SDLK_KP_MULTIPLY: ch = '*'; break;
+ case SDLK_KP_MINUS: ch = '-'; break;
+ case SDLK_KP_PLUS: ch = '+'; break;
+ case SDLK_KP_EQUALS: ch = '='; break;
+
+ default:
+ /* If we don't know what it is set the Unicode to 0 */
+ ch = 0;
+ break;
+ }
+ }
+ }
+ }
+
+ keysym->unicode = ch;
+ }
+ return(keysym);
+}
+
+/* end of SDL_riscosevents.c ... */
+
diff --git a/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosevents_c.h b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosevents_c.h
new file mode 100644
index 0000000..189b3c0
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosevents_c.h
@@ -0,0 +1,34 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_riscosvideo.h"
+
+/* Variables and functions exported by SDL_sysevents.c to other parts
+ of the native video subsystem (SDL_sysvideo.c)
+*/
+extern void RISCOS_InitOSKeymap(_THIS);
+extern void FULLSCREEN_PumpEvents(_THIS);
+extern void WIMP_PumpEvents(_THIS);
+
+/* end of SDL_nullevents_c.h ... */
+
diff --git a/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosmouse.c b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosmouse.c
new file mode 100644
index 0000000..b4a0bff
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosmouse.c
@@ -0,0 +1,371 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ File added by Alan Buckley (alan_baa@hotmail.com) for RISC OS compatability
+ 27 March 2003
+
+ Implements mouse cursor shape definitions and positioning
+*/
+
+#include "SDL_mouse.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_riscosmouse_c.h"
+
+#include "kernel.h"
+#include "swis.h"
+
+static WMcursor *current_cursor = NULL;
+static WMcursor *defined_cursor = NULL;
+
+extern int mouseInWindow;
+
+/* Area to save cursor palette colours changed by SDL.
+ Actual values will be read before we change to the SDL cursor */
+static Uint8 wimp_cursor_palette[2][5] = {
+ {1, 25, 255, 255, 255},
+ {3, 25, 255, 255, 255}
+};
+
+static int cursor_palette_saved = 0;
+
+void WIMP_SaveCursorPalette();
+void WIMP_RestoreWimpCursor();
+void WIMP_SetSDLCursorPalette();
+
+
+void RISCOS_FreeWMCursor(_THIS, WMcursor *cursor)
+{
+ SDL_free(cursor->data);
+ SDL_free(cursor);
+}
+
+WMcursor *RISCOS_CreateWMCursor(_THIS,
+ Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
+{
+ WMcursor *cursor;
+ Uint8 *cursor_data;
+ Uint8 *ptr;
+ int i,j,k;
+ int data_byte, mask_byte;
+
+ /* Check to make sure the cursor size is okay */
+ if ( (w > 32) || (h > 32) ) {
+ SDL_SetError("Only with width and height <= 32 pixels are allowed");
+ return(NULL);
+ }
+
+ /* Allocate the cursor */
+ cursor = (WMcursor *)SDL_malloc(sizeof(*cursor));
+ if ( cursor == NULL ) {
+ SDL_SetError("Out of memory");
+ return(NULL);
+ }
+
+ /* Note: SDL says width must be a multiple of 8 */
+ cursor_data = SDL_malloc(w/4 * h);
+ if (cursor_data == NULL)
+ {
+ SDL_free(cursor);
+ SDL_SetError("Out of memory");
+ return(NULL);
+ }
+
+ cursor->w = w;
+ cursor->h = h;
+ cursor->hot_x = hot_x;
+ cursor->hot_y = hot_y;
+ cursor->data = cursor_data;
+
+
+/* Data / Mask Resulting pixel on screen
+ 0 / 1 White
+ 1 / 1 Black
+ 0 / 0 Transparent
+ 1 / 0 Inverted color if possible, black if not.
+*/
+ ptr = cursor_data;
+
+ for ( i=0; i<h; ++i )
+ {
+ for (j = 0; j < w/8; ++j)
+ {
+ data_byte = *data;
+ mask_byte = *mask;
+ *ptr++ = 0; /* Sets whole byte transparent */
+ *ptr = 0;
+ for (k = 0; k < 8; k++)
+ {
+ (*ptr) <<= 2;
+ if (data_byte & 1) *ptr |= 3; /* Black or inverted */
+ else if(mask_byte & 1) *ptr |= 1; /* White */
+ if ((k&3) == 3) ptr--;
+ data_byte >>= 1;
+ mask_byte >>= 1;
+ }
+
+ ptr+=3;
+ data++;
+ mask++;
+ }
+ }
+
+ return(cursor);
+}
+
+int RISCOS_ShowWMCursor(_THIS, WMcursor *cursor)
+{
+ current_cursor = cursor;
+
+ if (cursor == NULL)
+ {
+ _kernel_osbyte(106,0,0);
+ defined_cursor = NULL;
+ } else
+ {
+ WMcursor *old_cursor = defined_cursor;
+
+ if (cursor != defined_cursor)
+ {
+ Uint8 cursor_def[10];
+
+ cursor_def[0] = 0;
+ cursor_def[1] = 2; /* Use shape number 2 */
+ cursor_def[2] = cursor->w/4; /* Width in bytes */
+ cursor_def[3] = cursor->h; /* Height (h) in pixels */
+ cursor_def[4] = cursor->hot_x; /* ActiveX in pixels from left */
+ cursor_def[5] = cursor->hot_y; /* ActiveY in pixels from top */
+ cursor_def[6] = ((int)(cursor->data) & 0xFF); /* Least significant byte of pointer to data */
+ cursor_def[7] = ((int)(cursor->data) >> 8) & 0xFF; /* ... */
+ cursor_def[8] = ((int)(cursor->data) >> 16) & 0xFF; /* ... */
+ cursor_def[9] = ((int)(cursor->data) >> 24) & 0xFF; /* Most significant byte of pointer to data */
+
+ if (_kernel_osword(21, (int *)cursor_def) != 0)
+ {
+ SDL_SetError("RISCOS couldn't create the cursor to show");
+ return(0);
+ }
+ defined_cursor = cursor;
+ }
+
+ if (old_cursor == NULL)
+ {
+ /* First time or reshow in window, so save/setup palette */
+ if (!cursor_palette_saved)
+ {
+ WIMP_SaveCursorPalette();
+ }
+ WIMP_SetSDLCursorPalette();
+ }
+
+ _kernel_osbyte(106, 2, 0);
+ }
+
+ return(1);
+}
+
+void FULLSCREEN_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
+{
+ Uint8 move_block[5];
+ int eig_block[3];
+ _kernel_swi_regs regs;
+ int os_x, os_y;
+
+ eig_block[0] = 4; /* X eig factor */
+ eig_block[1] = 5; /* Y eig factor */
+ eig_block[2] = -1; /* End of list of variables to request */
+
+ regs.r[0] = (int)eig_block;
+ regs.r[1] = (int)eig_block;
+ _kernel_swi(OS_ReadVduVariables, &regs, &regs);
+
+ os_x = x << eig_block[0];
+ os_y = y << eig_block[1];
+
+ move_block[0] = 3; /* Move cursor */
+ move_block[1] = os_x & 0xFF;
+ move_block[2] = (os_x >> 8) & 0xFF;
+ move_block[3] = os_y & 0xFF;
+ move_block[4] = (os_y >> 8) & 0xFF;
+
+ _kernel_osword(21, (int *)move_block);
+ SDL_PrivateMouseMotion(0, 0, x, y);
+}
+
+
+/* Reshow cursor when mouse re-enters the window */
+void WIMP_ReshowCursor(_THIS)
+{
+ defined_cursor = NULL;
+ cursor_palette_saved = 0;
+ RISCOS_ShowWMCursor(this, current_cursor);
+}
+
+void WIMP_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
+{
+ _kernel_swi_regs regs;
+ int window_state[9];
+ char block[5];
+ int osX, osY;
+
+ window_state[0] = this->hidden->window_handle;
+ regs.r[1] = (unsigned int)window_state;
+ _kernel_swi(Wimp_GetWindowState, &regs, &regs);
+
+ osX = (x << this->hidden->xeig) + window_state[1];
+ osY = window_state[4] - (y << this->hidden->yeig);
+
+ block[0] = 3;
+ block[1] = osX & 0xFF;
+ block[2] = (osX >> 8) & 0xFF;
+ block[3] = osY & 0xFF;
+ block[4] = (osY >> 8) & 0xFF;
+
+ regs.r[0] = 21;
+ regs.r[1] = (int)block;
+ _kernel_swi(OS_Word, &regs, &regs);
+ SDL_PrivateMouseMotion(0, 0, x, y);
+}
+
+int WIMP_ShowWMCursor(_THIS, WMcursor *cursor)
+{
+ if (mouseInWindow) return RISCOS_ShowWMCursor(this, cursor);
+ else current_cursor = cursor;
+
+ return 1;
+}
+
+SDL_GrabMode RISCOS_GrabInput(_THIS, SDL_GrabMode mode)
+{
+ /* In fullscreen mode we don't need to do anything */
+ if (mode < SDL_GRAB_FULLSCREEN)
+ {
+ _kernel_swi_regs regs;
+ unsigned char block[9];
+ block[0] = 1; /* Define mouse cursor bounding block */
+
+ if ( mode == SDL_GRAB_OFF )
+ {
+ /* Clip to whole screen */
+
+ int r = (this->hidden->screen_width << this->hidden->xeig) - 1;
+ int t = (this->hidden->screen_height << this->hidden->yeig) - 1;
+
+ block[1] = 0; block[2] = 0; /* Left*/
+ block[3] = 0; block[4] = 0; /* Bottom */
+ block[5] = r & 0xFF; block[6] = (r >> 8) & 0xFF; /* Right */
+ block[7] = t & 0xFF; block[8] = (t >> 8) & 0xFF; /* Top */
+ } else
+ {
+ /* Clip to window */
+ unsigned char window_state[36];
+
+ *((int *)window_state) = this->hidden->window_handle;
+ regs.r[1] = (unsigned int)window_state;
+ _kernel_swi(Wimp_GetWindowState, &regs, &regs);
+
+ block[1] = window_state[4];
+ block[2] = window_state[5];
+ block[3] = window_state[8];
+ block[4] = window_state[9];
+ block[5] = window_state[12];
+ block[6] = window_state[13];
+ block[7] = window_state[16];
+ block[8] = window_state[17];
+
+ }
+
+ regs.r[0] = 21; /* OS word code */
+ regs.r[1] = (int)block;
+ _kernel_swi(OS_Word, &regs, &regs);
+ }
+
+ return mode;
+}
+
+/* Save mouse cursor palette to be restore when we are no longer
+ defining a cursor */
+
+void WIMP_SaveCursorPalette()
+{
+ _kernel_swi_regs regs;
+ int colour;
+
+ for (colour = 0; colour < 2; colour++)
+ {
+ regs.r[0] = (int)wimp_cursor_palette[colour][0];
+ regs.r[1] = 25;
+ /* Read settings with OS_ReadPalette */
+ if (_kernel_swi(0x2f, &regs, &regs) == NULL)
+ {
+ wimp_cursor_palette[colour][2] = (unsigned char)((regs.r[2] >> 8) & 0xFF);
+ wimp_cursor_palette[colour][3] = (unsigned char)((regs.r[2] >> 16) & 0xFF);
+ wimp_cursor_palette[colour][4] = (unsigned char)((regs.r[2] >> 24) & 0xFF);
+ }
+ }
+
+ cursor_palette_saved = 1;
+}
+
+/* Restore the WIMP's cursor when we leave the SDL window */
+void WIMP_RestoreWimpCursor()
+{
+ int colour;
+
+ /* Reset to pointer shape 1 */
+ _kernel_osbyte(106, 1, 0);
+
+ /* Reset pointer colours */
+ if (cursor_palette_saved)
+ {
+ for (colour = 0; colour < 2; colour++)
+ {
+ _kernel_osword(12, (int *)wimp_cursor_palette[colour]);
+ }
+ }
+ cursor_palette_saved = 0;
+}
+
+/* Set palette used for SDL mouse cursors */
+void WIMP_SetSDLCursorPalette()
+{
+ /* First time set up the mouse colours */
+ Uint8 block[5];
+
+ /* Set up colour 1 as white */
+ block[0] = 1; /* Colour to change 1 - 3 */
+ block[1] = 25; /* Set pointer colour */
+ block[2] = 255; /* red component*/
+ block[3] = 255; /* green component */
+ block[4] = 255; /* blue component*/
+ _kernel_osword(12, (int *)block);
+
+ /* Set colour 3 to back */
+ block[0] = 3; /* Colour to change 1 - 3 */
+ block[1] = 25; /* Set pointer colour*/
+ block[2] = 0; /* red component*/
+ block[3] = 0; /* green component */
+ block[4] = 0; /* blue component*/
+ _kernel_osword(12, (int *)block);
+}
diff --git a/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosmouse_c.h b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosmouse_c.h
new file mode 100644
index 0000000..9019cb4
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosmouse_c.h
@@ -0,0 +1,44 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_riscosvideo.h"
+
+/* The implementation dependent data for the window manager cursor */
+struct WMcursor {
+ int w;
+ int h;
+ int hot_x;
+ int hot_y;
+ Uint8 *data;
+};
+
+/* Functions to be exported */
+void RISCOS_FreeWMCursor(_THIS, WMcursor *cursor);
+WMcursor *RISCOS_CreateWMCursor(_THIS, Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
+
+int RISCOS_ShowWMCursor(_THIS, WMcursor *cursor);
+void FULLSCREEN_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
+
+int WIMP_ShowWMCursor(_THIS, WMcursor *cursor);
+void WIMP_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
+
diff --git a/distrib/sdl-1.2.15/src/video/riscos/SDL_riscossprite.c b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscossprite.c
new file mode 100644
index 0000000..70b2f91
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscossprite.c
@@ -0,0 +1,265 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ File added by Alan Buckley (alan_baa@hotmail.com) for RISC OS compatability
+ 27 March 2003
+
+ Implements Sprite plotting code for wimp display.window
+*/
+
+#include "kernel.h"
+#include "swis.h"
+
+#include "SDL_stdinc.h"
+#include "SDL_riscosvideo.h"
+
+extern void WIMP_ReadModeInfo(_THIS);
+
+void WIMP_PaletteChanged(_THIS);
+
+
+/* Create sprite buffer for screen */
+
+unsigned char *WIMP_CreateBuffer(int width, int height, int bpp)
+{
+ int size;
+ char sprite_name[12] = "display";
+ unsigned char *buffer;
+ _kernel_swi_regs regs;
+ int bytesPerPixel;
+ int bytesPerRow;
+ int offsetToSpriteData = 60;
+
+ switch(bpp)
+ {
+ case 32: bytesPerPixel = 4; break;
+ case 16: bytesPerPixel = 2; break;
+ case 8:
+ bytesPerPixel = 1;
+ offsetToSpriteData += 2048; /* Add in size of palette */
+ break;
+ default:
+ return NULL;
+ break;
+ }
+
+ bytesPerRow = bytesPerPixel * width;
+
+ if ((bytesPerRow & 3) != 0)
+ {
+ bytesPerRow += 4 - (bytesPerRow & 3);
+ }
+ size = bytesPerRow * height;
+
+ buffer = SDL_malloc( (size_t) size + offsetToSpriteData );
+ if (!buffer) return NULL;
+
+ /* Initialise a sprite area */
+
+ *(unsigned int *)buffer = size + offsetToSpriteData;
+ *(unsigned int *)(buffer + 8) = 16;
+
+ regs.r[0] = 256+9;
+ regs.r[1] = (unsigned int)buffer;
+ _kernel_swi(OS_SpriteOp, &regs, &regs);
+
+ regs.r[0] = 256+15;
+ regs.r[1] = (unsigned int)buffer;
+ regs.r[2] = (unsigned int)&sprite_name;
+ regs.r[3] = 0; /* Palette flag: 0 = no palette */
+ regs.r[4] = width;
+ regs.r[5] = height;
+ if (bpp == 8)
+ {
+ /* Use old style mode number */
+ regs.r[6] = 28; /* 8bpp 90x90dpi */
+ } else
+ {
+ regs.r[6] = (((bpp == 16) ? 5 : 6) << 27) /* Type 6 = 32bpp sprite, 5 = 16bpp sprite */
+ | (90 << 14) /* Vertical dpi */
+ | (90 << 1) /* Horizontal dpi */
+ | 1; /* Marker to distinguish between mode selectors and sprite modes */
+ }
+ if (_kernel_swi(OS_SpriteOp, &regs, &regs) == NULL)
+ {
+ if (bpp == 8)
+ {
+ /* Modify sprite to take into account 256 colour palette */
+ int *sprite = (int *)(buffer + 16);
+ /* Adjust sprite offsets */
+ sprite[0] += 2048;
+ sprite[8] += 2048;
+ sprite[9] += 2048;
+ /* Adjust sprite area next free pointer */
+ (*(int *)(buffer+12)) += 2048;
+
+ /* Don't need to set up palette as SDL sets up the default
+ 256 colour palette */
+/* {
+ int *pal = sprite + 11;
+ unsigned int j;
+ unsigned int entry;
+ for (j = 0; j < 255; j++)
+ {
+ entry = (j << 24) | (j << 16) | (j << 8);
+ *pal++ = entry;
+ *pal++ = entry;
+ }
+ }
+*/
+ }
+ } else
+ {
+ SDL_free(buffer);
+ buffer = NULL;
+ }
+
+ return buffer;
+}
+
+
+/* Setup translation buffers for the sprite plotting */
+
+void WIMP_SetupPlotInfo(_THIS)
+{
+ _kernel_swi_regs regs;
+ int *sprite = ((int *)this->hidden->bank[1])+4;
+
+ regs.r[0] = (unsigned int)this->hidden->bank[1];
+ regs.r[1] = (unsigned int)sprite;
+ regs.r[2] = -1; /* Current mode */
+ regs.r[3] = -1; /* Current palette */
+ regs.r[4] = 0; /* Get size of buffer */
+ regs.r[5] = 1|2|16; /* R1 - pointer to sprite and can use full palette words */
+ regs.r[6] = 0;
+ regs.r[7] = 0;
+
+ if (this->hidden->pixtrans) SDL_free(this->hidden->pixtrans);
+ this->hidden->pixtrans = 0;
+
+ /* Get the size required for the buffer */
+ _kernel_swi(ColourTrans_GenerateTable, &regs, &regs);
+ if (regs.r[4])
+ {
+ this->hidden->pixtrans = SDL_malloc(regs.r[4]);
+
+ regs.r[4] = (unsigned int)this->hidden->pixtrans;
+ /* Actually read the buffer */
+ _kernel_swi(ColourTrans_GenerateTable, &regs, &regs);
+ }
+}
+
+/* Plot the sprite in the given context */
+void WIMP_PlotSprite(_THIS, int x, int y)
+{
+ _kernel_swi_regs regs;
+ _kernel_oserror *err;
+
+ regs.r[0] = 52 + 512;
+ regs.r[1] = (unsigned int)this->hidden->bank[1];
+ regs.r[2] = (unsigned int)this->hidden->bank[1]+16;
+ regs.r[3] = x;
+ regs.r[4] = y;
+ regs.r[5] = 0|32; /* Overwrite screen and pixtrans contains wide colour entries */
+ regs.r[6] = 0; /* No scale factors i.e. 1:1 */
+ regs.r[7] = (int)this->hidden->pixtrans;
+
+ if ((err = _kernel_swi(OS_SpriteOp, &regs, &regs)) != 0)
+ {
+ int *p = (int *)this->hidden->pixtrans;
+ printf("OS_SpriteOp failed \n%s\n",err->errmess);
+ printf("pixtrans %d\n", (int)this->hidden->pixtrans);
+ printf("%x %x %x\n", p[0], p[1], p[2]);
+ }
+}
+
+
+/* Wimp mode has changes so update colour mapping and pixel sizes
+ of windows and the sprites they plot */
+
+void WIMP_ModeChanged(_THIS)
+{
+ int oldXeig = this->hidden->xeig;
+ int oldYeig = this->hidden->yeig;
+
+ WIMP_ReadModeInfo(this);
+
+ if (oldXeig == this->hidden->xeig && oldYeig == this->hidden->yeig)
+ {
+ /* Only need to update the palette */
+ WIMP_PaletteChanged(this);
+ } else
+ {
+ _kernel_swi_regs regs;
+ int window_state[9];
+ int extent[4];
+ int currWidth, currHeight;
+ int newWidth, newHeight;
+
+ /* Need to resize windows and update the palette */
+ WIMP_SetupPlotInfo(this);
+
+
+ window_state[0] = this->hidden->window_handle;
+ regs.r[1] = (unsigned int)window_state;
+ _kernel_swi(Wimp_GetWindowState, &regs, &regs);
+
+ currWidth = window_state[3] - window_state[1];
+ currHeight = window_state[4] - window_state[2];
+
+ newWidth = (currWidth >> oldXeig) << this->hidden->xeig;
+ newHeight = (currHeight >> oldYeig) << this->hidden->yeig;
+ /* Need to avoid extent getting too small for visible part
+ of window */
+ extent[0] = 0;
+ if (currHeight <= newHeight)
+ {
+ extent[1] = -newHeight;
+ } else
+ {
+ extent[1] = -currHeight;
+ }
+ if (currWidth <= newWidth)
+ {
+ extent[2] = newWidth;
+ } else
+ {
+ extent[2] = currWidth;
+ }
+ extent[3] = 0;
+
+ regs.r[0] = this->hidden->window_handle;
+ regs.r[1] = (int)extent;
+ _kernel_swi(Wimp_SetExtent, &regs, &regs);
+
+ /*TODO: May need to set flag to resize window on next open */
+ }
+}
+
+/* Palette has changed so update palettes used for windows sprites */
+
+void WIMP_PaletteChanged(_THIS)
+{
+ WIMP_SetupPlotInfo(this);
+}
diff --git a/distrib/sdl-1.2.15/src/video/riscos/SDL_riscostask.c b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscostask.c
new file mode 100644
index 0000000..67dc3e2
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscostask.c
@@ -0,0 +1,350 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ This file added by Alan Buckley (alan_baa@hotmail.com) to support RISC OS
+ 26 March 2003
+
+ File includes routines for:
+ Setting up as a WIMP Task
+ Reading information about the current desktop
+ Storing information before a switch to full screen
+ Restoring desktop after switching to full screen
+*/
+
+#include "kernel.h"
+#include "swis.h"
+
+#include "SDL_stdinc.h"
+#include "SDL_riscostask.h"
+
+#if !SDL_THREADS_DISABLED
+#include <pthread.h>
+pthread_t main_thread;
+#endif
+
+/* RISC OS variables */
+
+static int task_handle = 0;
+static int wimp_version = 0;
+
+/* RISC OS variables to help compatability with certain programs */
+int riscos_backbuffer = 0; /* Create a back buffer in system memory for full screen mode */
+int riscos_closeaction = 1; /* Close icon action */
+
+static int stored_mode = -1; /* -1 when in desktop, mode number or pointer when full screen */
+
+extern int mouseInWindow; /* Mouse is in WIMP window */
+
+/* Local function */
+
+static int RISCOS_GetTaskName(char *task_name, size_t maxlen);
+
+/* Uncomment next line to copy mode changes/restores to stderr */
+/* #define DUMP_MODE */
+#ifdef DUMP_MODE
+#include "stdio.h"
+static void dump_mode()
+{
+ fprintf(stderr, "mode %d\n", stored_mode);
+ if (stored_mode < -1 || stored_mode >= 256)
+ {
+ int blockSize = 0;
+ int *storeBlock = (int *)stored_mode;
+
+ while(blockSize < 5 || storeBlock[blockSize] != -1)
+ {
+ fprintf(stderr, " %d\n", storeBlock[blockSize++]);
+ }
+ }
+}
+#endif
+
+/******************************************************************
+
+ Initialise as RISC OS Wimp task
+
+*******************************************************************/
+
+int RISCOS_InitTask()
+{
+ char task_name[32];
+ _kernel_swi_regs regs;
+ int messages[4];
+
+ if (RISCOS_GetTaskName(task_name, SDL_arraysize(task_name)) == 0) return 0;
+
+ messages[0] = 9; /* Palette changed */
+ messages[1] = 0x400c1; /* Mode changed */
+ messages[2] = 8; /* Pre quit */
+ messages[2] = 0;
+
+ regs.r[0] = (unsigned int)360; /* Minimum version 3.6 */
+ regs.r[1] = (unsigned int)0x4b534154;
+ regs.r[2] = (unsigned int)task_name;
+ regs.r[3] = (unsigned int)messages;
+
+ if (_kernel_swi(Wimp_Initialise, &regs, &regs) == 0)
+ {
+ wimp_version = regs.r[0];
+ task_handle = regs.r[1];
+ return 1;
+ }
+
+#if !SDL_THREADS_DISABLED
+ main_thread = pthread_self();
+#endif
+
+ return 0;
+}
+
+/*********************************************************************
+
+ Close down application on exit.
+
+**********************************************************************/
+
+void RISCOS_ExitTask()
+{
+ _kernel_swi_regs regs;
+
+ if (stored_mode == -1)
+ {
+ /* Ensure cursor is put back to standard pointer shape if
+ we have been running in a window */
+ _kernel_osbyte(106,1,0);
+ }
+
+ /* Ensure we end up back in the wimp */
+ RISCOS_RestoreWimpMode();
+
+ /* Neatly exit the task */
+ regs.r[0] = task_handle;
+ regs.r[1] = (unsigned int)0x4b534154;
+ _kernel_swi(Wimp_CloseDown, &regs, &regs);
+ task_handle = 0;
+}
+
+/**************************************************************************
+
+ Get the name of the task for the desktop.
+
+ Param: task_name - name of task 32 characters.
+
+ Returns: 1 is successful, otherwise 0
+
+ Notes: Works by getting using OS_GetEnv to get the command line
+ used to run the program and then parsing a name from it
+ as follows.
+
+ 1. Use name after final period if not !RunImage
+ 2. If name is !RunImage then process item before the period
+ in front of !RunImage.
+ 3. If directory name use that
+ 4. if in form <XXX$Dir> use the XXX.
+
+ Finally once this value has been retrieved use it unless
+ there is a variable set up in the form SDL$<name>$TaskName
+ in which case the value of this variable will be used.
+
+ Now also gets other RISC OS configuration varibles
+ SDL$<name>$BackBuffer - set to 1 to use a system memory backbuffer in fullscreen mode
+ so updates wait until a call to SDL_UpdateRects. (default 0)
+ This is required for programmes where they have assumed this is
+ always the case which is contrary to the documentation.
+ SDL$<name>$CloseAction
+ 0 Don't show close icon
+ 1 Show close icon
+
+***************************************************************************/
+
+int RISCOS_GetTaskName(char *task_name, size_t maxlen)
+{
+ _kernel_swi_regs regs;
+
+ task_name[0] = 0;
+
+ /* Figure out a sensible task name */
+ if (_kernel_swi(OS_GetEnv, &regs, &regs) == 0)
+ {
+ char *command_line = (char *)regs.r[0];
+ size_t len = SDL_strlen(command_line)+1;
+ char *buffer = SDL_stack_alloc(char, len);
+ char *env_var;
+ char *p;
+
+ SDL_strlcpy(buffer, command_line, len);
+ p = SDL_strchr(buffer, ' ');
+ if (p) *p = 0;
+ p = SDL_strrchr(buffer, '.');
+ if (p == 0) p = buffer;
+ if (stricmp(p+1,"!RunImage") == 0)
+ {
+ *p = 0;
+ p = SDL_strrchr(buffer, '.');
+ if (p == 0) p = buffer;
+ }
+ if (*p == '.') p++;
+ if (*p == '!') p++; /* Skip "!" at beginning of application directories */
+
+ if (*p == '<')
+ {
+ // Probably in the form <appname$Dir>
+ char *q = SDL_strchr(p, '$');
+ if (q == 0) q = SDL_strchr(p,'>'); /* Use variable name if not */
+ if (q) *q = 0;
+ p++; /* Move over the < */
+ }
+
+ if (*p)
+ {
+ /* Read variables that effect the RISC OS SDL engine for this task */
+ len = SDL_strlen(p) + 18; /* 18 is larger than the biggest variable name */
+ env_var = SDL_stack_alloc(char, len);
+ if (env_var)
+ {
+ char *env_val;
+
+ /* See if a variable of form SDL$<dirname>$TaskName exists */
+
+ SDL_strlcpy(env_var, "SDL$", len);
+ SDL_strlcat(env_var, p, len);
+ SDL_strlcat(env_var, "$TaskName", len);
+
+ env_val = SDL_getenv(env_var);
+ if (env_val) SDL_strlcpy(task_name, env_val, maxlen);
+
+ SDL_strlcpy(env_var, "SDL$", len);
+ SDL_strlcat(env_var, p, len);
+ SDL_strlcat(env_var, "$BackBuffer", len);
+
+ env_val = SDL_getenv(env_var);
+ if (env_val) riscos_backbuffer = atoi(env_val);
+
+ SDL_strlcpy(env_var, "SDL$", len);
+ SDL_strlcat(env_var, p, len);
+ SDL_strlcat(env_var, "$CloseAction", len);
+
+ env_val = SDL_getenv(env_var);
+ if (env_val && SDL_strcmp(env_val,"0") == 0) riscos_closeaction = 0;
+
+ SDL_stack_free(env_var);
+ }
+
+ if (!*task_name) SDL_strlcpy(task_name, p, maxlen);
+ }
+
+ SDL_stack_free(buffer);
+ }
+
+ if (task_name[0] == 0) SDL_strlcpy(task_name, "SDL Task", maxlen);
+
+ return 1;
+}
+
+/*****************************************************************
+
+ Store the current desktop screen mode if we are in the desktop.
+
+******************************************************************/
+
+void RISCOS_StoreWimpMode()
+{
+ _kernel_swi_regs regs;
+
+ /* Don't store if in full screen mode */
+ if (stored_mode != -1) return;
+
+ regs.r[0] = 1;
+ _kernel_swi(OS_ScreenMode, &regs, &regs);
+ if (regs.r[1] >= 0 && regs.r[1] < 256) stored_mode = regs.r[1];
+ else
+ {
+ int blockSize = 0;
+ int *retBlock = (int *)regs.r[1];
+ int *storeBlock;
+ int j;
+
+ while(blockSize < 5 || retBlock[blockSize] != -1) blockSize++;
+ blockSize++;
+ storeBlock = (int *)SDL_malloc(blockSize * sizeof(int));
+ retBlock = (int *)regs.r[1];
+ for ( j = 0; j < blockSize; j++)
+ storeBlock[j] = retBlock[j];
+
+ stored_mode = (int)storeBlock;
+ }
+#if DUMP_MODE
+ fprintf(stderr, "Stored "); dump_mode();
+#endif
+}
+
+/*****************************************************************
+
+ Restore desktop screen mode if we are in full screen mode.
+
+*****************************************************************/
+
+void RISCOS_RestoreWimpMode()
+{
+ _kernel_swi_regs regs;
+
+ /* Only need to restore if we are in full screen mode */
+ if (stored_mode == -1) return;
+
+#if DUMP_MODE
+ fprintf(stderr, "Restored"); dump_mode();
+#endif
+
+ regs.r[0] = stored_mode;
+ _kernel_swi(Wimp_SetMode, &regs, &regs);
+ if (stored_mode < 0 || stored_mode > 256)
+ {
+ SDL_free((int *)stored_mode);
+ }
+ stored_mode = -1;
+
+ /* Flush keyboard buffer to dump the keystrokes we've already polled */
+ regs.r[0] = 21;
+ regs.r[1] = 0; /* Keyboard buffer number */
+ _kernel_swi(OS_Byte, &regs, &regs);
+
+ mouseInWindow = 0;
+
+}
+
+/*********************************************************************
+
+ Get version of Wimp running when task was initialised.
+
+*********************************************************************/
+
+int RISCOS_GetWimpVersion()
+{
+ return wimp_version;
+}
+
+int RISCOS_GetTaskHandle()
+{
+ return task_handle;
+}
diff --git a/distrib/sdl-1.2.15/src/video/riscos/SDL_riscostask.h b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscostask.h
new file mode 100644
index 0000000..5744afa
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscostask.h
@@ -0,0 +1,39 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ This file added by Alan Buckley (alan_baa@hotmail.com) to support RISC OS
+ 26 March 2003
+*/
+
+/* Task initialisation/Clean up */
+
+extern int RISCOS_InitTask();
+extern void RISCOS_ExitTask();
+extern int RISCOS_GetWimpVersion();
+extern int RISCOS_GetTaskHandle();
+
+
+/* Wimp mode saveing/restoring */
+extern void RISCOS_StoreWimpMode();
+extern void RISCOS_RestoreWimpMode();
diff --git a/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosvideo.c b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosvideo.c
new file mode 100644
index 0000000..bae5e37
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosvideo.c
@@ -0,0 +1,316 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ File added by Alan Buckley (alan_baa@hotmail.com) for RISC OS compatability
+ 23 March 2003
+
+ Implements RISC OS display device management.
+ Routines for full screen and wimp modes are split
+ into other source files.
+*/
+
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "SDL_syswm.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_riscostask.h"
+#include "SDL_riscosvideo.h"
+#include "SDL_riscosevents_c.h"
+#include "SDL_riscosmouse_c.h"
+
+#include "kernel.h"
+#include "swis.h"
+
+#define RISCOSVID_DRIVER_NAME "riscos"
+
+/* Initialization/Query functions */
+static int RISCOS_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static void RISCOS_VideoQuit(_THIS);
+
+static SDL_Rect **RISCOS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *RISCOS_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+
+int RISCOS_GetWmInfo(_THIS, SDL_SysWMinfo *info);
+
+int RISCOS_ToggleFullScreen(_THIS, int fullscreen);
+/* Mouse checking */
+void RISCOS_CheckMouseMode(_THIS);
+extern SDL_GrabMode RISCOS_GrabInput(_THIS, SDL_GrabMode mode);
+
+/* Fullscreen mode functions */
+extern SDL_Surface *FULLSCREEN_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+extern void FULLSCREEN_BuildModeList(_THIS);
+extern void FULLSCREEN_SetDeviceMode(_THIS);
+extern int FULLSCREEN_ToggleFromWimp(_THIS);
+
+/* Wimp mode functions */
+extern SDL_Surface *WIMP_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+extern void WIMP_DeleteWindow(_THIS);
+extern int WIMP_ToggleFromFullScreen(_THIS);
+
+/* Hardware surface functions - common to WIMP and FULLSCREEN */
+static int RISCOS_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int RISCOS_LockHWSurface(_THIS, SDL_Surface *surface);
+static void RISCOS_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void RISCOS_FreeHWSurface(_THIS, SDL_Surface *surface);
+
+/* RISC OS driver bootstrap functions */
+
+static int RISCOS_Available(void)
+{
+ return(1);
+}
+
+static void RISCOS_DeleteDevice(SDL_VideoDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_VideoDevice *RISCOS_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device;
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *device->hidden));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( device ) {
+ SDL_free(device);
+ }
+ return(0);
+ }
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+
+ /* Set the function pointers */
+ device->VideoInit = RISCOS_VideoInit;
+ device->VideoQuit = RISCOS_VideoQuit;
+
+ device->ListModes = RISCOS_ListModes;
+ device->SetVideoMode = RISCOS_SetVideoMode;
+ device->CreateYUVOverlay = NULL;
+ device->AllocHWSurface = RISCOS_AllocHWSurface;
+ device->CheckHWBlit = NULL;
+ device->FillHWRect = NULL;
+ device->SetHWColorKey = NULL;
+ device->SetHWAlpha = NULL;
+ device->LockHWSurface = RISCOS_LockHWSurface;
+ device->UnlockHWSurface = RISCOS_UnlockHWSurface;
+ device->FreeHWSurface = RISCOS_FreeHWSurface;
+
+ device->FreeWMCursor = RISCOS_FreeWMCursor;
+ device->CreateWMCursor = RISCOS_CreateWMCursor;
+ device->CheckMouseMode = RISCOS_CheckMouseMode;
+ device->GrabInput = RISCOS_GrabInput;
+
+ device->InitOSKeymap = RISCOS_InitOSKeymap;
+
+ device->GetWMInfo = RISCOS_GetWmInfo;
+
+ device->free = RISCOS_DeleteDevice;
+
+/* Can't get Toggle screen to work if program starts up in Full screen mode so
+ disable it here and re-enable it when a wimp screen is chosen */
+ device->ToggleFullScreen = NULL; /*RISCOS_ToggleFullScreen;*/
+
+ /* Set other entries for fullscreen mode */
+ FULLSCREEN_SetDeviceMode(device);
+
+ /* Mouse pointer needs to use the WIMP ShowCursor version so
+ that it doesn't modify the pointer until the SDL Window is
+ entered or the application goes full screen */
+ device->ShowWMCursor = WIMP_ShowWMCursor;
+
+ return device;
+}
+
+VideoBootStrap RISCOS_bootstrap = {
+ RISCOSVID_DRIVER_NAME, "RISC OS video driver",
+ RISCOS_Available, RISCOS_CreateDevice
+};
+
+
+int RISCOS_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ _kernel_swi_regs regs;
+ int vars[4], vals[3];
+
+ if (RISCOS_InitTask() == 0)
+ {
+ SDL_SetError("Unable to start task");
+ return 0;
+ }
+
+ vars[0] = 9; /* Log base 2 bpp */
+ vars[1] = 11; /* XWndLimit - num x pixels -1 */
+ vars[2] = 12; /* YWndLimit - num y pixels -1 */
+ vars[3] = -1; /* Terminate list */
+ regs.r[0] = (int)vars;
+ regs.r[1] = (int)vals;
+
+ _kernel_swi(OS_ReadVduVariables, &regs, &regs);
+ vformat->BitsPerPixel = (1 << vals[0]);
+
+ /* Determine the current screen size */
+ this->info.current_w = vals[1] + 1;
+ this->info.current_h = vals[2] + 1;
+
+ /* Minimum bpp for SDL is 8 */
+ if (vformat->BitsPerPixel < 8) vformat->BitsPerPixel = 8;
+
+
+ switch (vformat->BitsPerPixel)
+ {
+ case 15:
+ case 16:
+ vformat->Bmask = 0x00007c00;
+ vformat->Gmask = 0x000003e0;
+ vformat->Rmask = 0x0000001f;
+ vformat->BitsPerPixel = 16; /* SDL wants actual number of bits used */
+ vformat->BytesPerPixel = 2;
+ break;
+
+ case 24:
+ case 32:
+ vformat->Bmask = 0x00ff0000;
+ vformat->Gmask = 0x0000ff00;
+ vformat->Rmask = 0x000000ff;
+ vformat->BytesPerPixel = 4;
+ break;
+
+ default:
+ vformat->Bmask = 0;
+ vformat->Gmask = 0;
+ vformat->Rmask = 0;
+ vformat->BytesPerPixel = 1;
+ break;
+ }
+
+ /* Fill in some window manager capabilities */
+ this->info.wm_available = 1;
+
+ /* We're done! */
+ return(0);
+}
+
+/* Note: If we are terminated, this could be called in the middle of
+ another SDL video routine -- notably UpdateRects.
+*/
+void RISCOS_VideoQuit(_THIS)
+{
+ RISCOS_ExitTask();
+
+ if (this->hidden->alloc_bank) SDL_free(this->hidden->alloc_bank);
+ this->hidden->alloc_bank = 0;
+}
+
+
+SDL_Rect **RISCOS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ if (flags & SDL_FULLSCREEN)
+ {
+ /* Build mode list when first required. */
+ if (SDL_nummodes[0] == 0) FULLSCREEN_BuildModeList(this);
+
+ return(SDL_modelist[((format->BitsPerPixel+7)/8)-1]);
+ } else
+ return (SDL_Rect **)-1;
+}
+
+
+/* Set up video mode */
+SDL_Surface *RISCOS_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ if (flags & SDL_FULLSCREEN)
+ {
+ RISCOS_StoreWimpMode();
+ /* Dump wimp window on switch to full screen */
+ if (this->hidden->window_handle) WIMP_DeleteWindow(this);
+
+ return FULLSCREEN_SetVideoMode(this, current, width, height, bpp, flags);
+ } else
+ {
+ RISCOS_RestoreWimpMode();
+ return WIMP_SetVideoMode(this, current, width, height, bpp, flags);
+ }
+}
+
+
+/* We don't actually allow hardware surfaces other than the main one */
+static int RISCOS_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(-1);
+}
+static void RISCOS_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+/* We need to wait for vertical retrace on page flipped displays */
+static int RISCOS_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(0);
+}
+
+static void RISCOS_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+
+int RISCOS_GetWmInfo(_THIS, SDL_SysWMinfo *info)
+{
+ SDL_VERSION(&(info->version));
+ info->wimpVersion = RISCOS_GetWimpVersion();
+ info->taskHandle = RISCOS_GetTaskHandle();
+ info->window = this->hidden->window_handle;
+
+ return 1;
+}
+/* Toggle full screen mode.
+ Returns 1 if successful otherwise 0
+*/
+
+int RISCOS_ToggleFullScreen(_THIS, int fullscreen)
+{
+ if (fullscreen)
+ {
+ return FULLSCREEN_ToggleFromWimp(this);
+ } else
+ {
+ return WIMP_ToggleFromFullScreen(this);
+ }
+
+ return 0;
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosvideo.h b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosvideo.h
new file mode 100644
index 0000000..7c717ad
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/riscos/SDL_riscosvideo.h
@@ -0,0 +1,62 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_riscosvideo_h
+#define _SDL_riscosvideo_h
+
+#include "SDL_mouse.h"
+#include "SDL_mutex.h"
+#include "../SDL_sysvideo.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+
+/* Private display data */
+
+struct SDL_PrivateVideoData {
+ unsigned char *bank[2];
+ int current_bank;
+ unsigned char *alloc_bank;
+ int height;
+ int xeig;
+ int yeig;
+ int screen_bpp;
+ int screen_width;
+ int screen_height;
+ char *pixtrans;
+
+ /* Wimp variables */
+ unsigned int window_handle;
+ char title[256];
+
+#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
+ int SDL_nummodes[NUM_MODELISTS];
+ SDL_Rect **SDL_modelist[NUM_MODELISTS];
+};
+
+/* Old variable names */
+#define SDL_nummodes (this->hidden->SDL_nummodes)
+#define SDL_modelist (this->hidden->SDL_modelist)
+
+#endif /* _SDL_risosvideo_h */
diff --git a/distrib/sdl-1.2.15/src/video/riscos/SDL_wimppoll.c b/distrib/sdl-1.2.15/src/video/riscos/SDL_wimppoll.c
new file mode 100644
index 0000000..4999664
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/riscos/SDL_wimppoll.c
@@ -0,0 +1,330 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ File added by Alan Buckley (alan_baa@hotmail.com) for RISC OS compatability
+ 27 March 2003
+
+ Implements Pumping of events and WIMP polling
+*/
+
+#include "SDL.h"
+#include "SDL_syswm.h"
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_riscosvideo.h"
+#include "SDL_riscosevents_c.h"
+#include "SDL_riscosmouse_c.h"
+#include "../../timer/SDL_timer_c.h"
+
+#include "memory.h"
+#include "stdlib.h"
+#include "ctype.h"
+
+#include "kernel.h"
+#include "swis.h"
+#include "unixlib/os.h"
+
+#if !SDL_THREADS_DISABLED
+#include <pthread.h>
+#endif
+
+/* Local functions */
+void WIMP_Poll(_THIS, int waitTime);
+void WIMP_SetFocus(int win);
+
+/* SDL_riscossprite functions */
+void WIMP_PlotSprite(_THIS, int x, int y);
+void WIMP_ModeChanged(_THIS);
+void WIMP_PaletteChanged(_THIS);
+
+
+extern void WIMP_PollMouse(_THIS);
+extern void RISCOS_PollKeyboard();
+
+#if SDL_THREADS_DISABLED
+/* Timer running function */
+extern void RISCOS_CheckTimer();
+#else
+extern int riscos_using_threads;
+#endif
+
+/* Mouse cursor handling */
+extern void WIMP_ReshowCursor(_THIS);
+extern void WIMP_RestoreWimpCursor();
+
+int hasFocus = 0;
+int mouseInWindow = 0;
+
+/* Flag to ensure window is correct size after a mode change */
+static int resizeOnOpen = 0;
+
+void WIMP_PumpEvents(_THIS)
+{
+ WIMP_Poll(this, 0);
+ if (hasFocus) RISCOS_PollKeyboard();
+ if (mouseInWindow) WIMP_PollMouse(this);
+#if SDL_THREADS_DISABLED
+ if (SDL_timer_running) RISCOS_CheckTimer();
+#endif
+}
+
+
+void WIMP_Poll(_THIS, int waitTime)
+{
+ _kernel_swi_regs regs;
+ int message[64];
+ unsigned int code;
+ int pollMask = 0;
+ int doPoll = 1;
+ int sysEvent;
+ int sdlWindow = this->hidden->window_handle;
+
+ if (this->PumpEvents != WIMP_PumpEvents) return;
+
+ if (waitTime > 0)
+ {
+ _kernel_swi(OS_ReadMonotonicTime, &regs, &regs);
+ waitTime += regs.r[0];
+ }
+
+ while (doPoll)
+ {
+#if !SDL_THREADS_DISABLED
+ /* Stop thread callbacks while program is paged out */
+ if (riscos_using_threads) __pthread_stop_ticker();
+#endif
+
+ if (waitTime <= 0)
+ {
+ regs.r[0] = pollMask; /* Poll Mask */
+ /* For no wait time mask out null event so we wait until something happens */
+ if (waitTime < 0) regs.r[0] |= 1;
+ regs.r[1] = (int)message;
+ _kernel_swi(Wimp_Poll, &regs, &regs);
+ } else
+ {
+ regs.r[0] = pollMask;
+ regs.r[1] = (int)message;
+ regs.r[2] = waitTime;
+ _kernel_swi(Wimp_PollIdle, &regs, &regs);
+ }
+
+ /* Flag to specify if we post a SDL_SysWMEvent */
+ sysEvent = 0;
+
+ code = (unsigned int)regs.r[0];
+
+ switch(code)
+ {
+ case 0: /* Null Event - drop out for standard processing*/
+ doPoll = 0;
+ break;
+
+ case 1: /* Redraw window */
+ _kernel_swi(Wimp_RedrawWindow, &regs,&regs);
+ if (message[0] == sdlWindow)
+ {
+ while (regs.r[0])
+ {
+ WIMP_PlotSprite(this, message[1], message[2]);
+ _kernel_swi(Wimp_GetRectangle, &regs, &regs);
+ }
+ } else
+ {
+ /* TODO: Currently we just eat them - we may need to pass them on */
+ while (regs.r[0])
+ {
+ _kernel_swi(Wimp_GetRectangle, &regs, &regs);
+ }
+ }
+ break;
+
+ case 2: /* Open window */
+ if ( resizeOnOpen && message[0] == sdlWindow)
+ {
+ /* Ensure window is correct size */
+ resizeOnOpen = 0;
+ message[3] = message[1] + (this->screen->w << this->hidden->xeig);
+ message[4] = message[2] + (this->screen->h << this->hidden->yeig);
+ }
+ _kernel_swi(Wimp_OpenWindow, &regs, &regs);
+ break;
+
+ case 3: /* Close window */
+ if (message[0] == sdlWindow)
+ {
+ /* Documentation makes it looks as if the following line is correct:
+ ** if (SDL_PrivateQuit() == 1) _kernel_swi(Wimp_CloseWindow, &regs, &regs);
+ ** However some programs don't process this message and so sit there invisibly
+ ** in the background so I just post the quit message and hope the application
+ ** does the correct thing.
+ */
+ SDL_PrivateQuit();
+ } else
+ sysEvent = 1;
+ doPoll = 0;
+ break;
+
+ case 4: /* Pointer_Leaving_Window */
+ if (message[0] == sdlWindow)
+ {
+ mouseInWindow = 0;
+ //TODO: Lose buttons / dragging
+ /* Reset to default pointer */
+ WIMP_RestoreWimpCursor();
+ SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
+ } else
+ sysEvent = 1;
+ break;
+
+ case 5: /* Pointer_Entering_Window */
+ if (message[0] == sdlWindow)
+ {
+ mouseInWindow = 1;
+ WIMP_ReshowCursor(this);
+ SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
+ } else sysEvent = 1;
+ break;
+
+ case 6: /* Mouse_Click */
+ if (hasFocus == 0)
+ {
+ /* First click gives focus if it's not a menu */
+ /* we only count non-menu clicks on a window that has the focus */
+ WIMP_SetFocus(message[3]);
+ } else
+ doPoll = 0; // So PollMouse gets a chance to pick it up
+ break;
+
+ case 7: /* User_Drag_Box - Used for mouse release */
+ //TODO: May need to implement this in the future
+ sysEvent = 1;
+ break;
+
+ case 8: /* Keypressed */
+ doPoll = 0; /* PollKeyboard should pick it up */
+ if (message[0] != sdlWindow) sysEvent = 1;
+ /*TODO: May want to always pass F12 etc to the wimp
+ {
+ regs.r[0] = message[6];
+ _kernel_swi(Wimp_ProcessKey, &regs, &regs);
+ }
+ */
+ break;
+
+ case 11: /* Lose Caret */
+ hasFocus = 0;
+ if (message[0] == sdlWindow) SDL_PrivateAppActive(0, SDL_APPINPUTFOCUS);
+ else sysEvent = 1;
+ break;
+
+ case 12: /* Gain Caret */
+ hasFocus = 1;
+ if (message[0] == sdlWindow) SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
+ else sysEvent = 1;
+ break;
+
+ case 17:
+ case 18:
+ sysEvent = 1; /* All messages are passed on */
+
+ switch(message[4])
+ {
+ case 0: /* Quit Event */
+ /* No choice - have to quit */
+ SDL_Quit();
+ exit(0);
+ break;
+
+ case 8: /* Pre Quit */
+ SDL_PrivateQuit();
+ break;
+
+ case 0x400c1: /* Mode change */
+ WIMP_ModeChanged(this);
+ resizeOnOpen = 1;
+ break;
+
+ case 9: /* Palette changed */
+ WIMP_PaletteChanged(this);
+ break;
+ }
+ break;
+
+ default:
+ /* Pass unknown events on */
+ sysEvent = 1;
+ break;
+ }
+
+ if (sysEvent)
+ {
+ SDL_SysWMmsg wmmsg;
+
+ SDL_VERSION(&wmmsg.version);
+ wmmsg.eventCode = code;
+ SDL_memcpy(wmmsg.pollBlock, message, 64 * sizeof(int));
+
+ /* Fall out of polling loop if message is successfully posted */
+ if (SDL_PrivateSysWMEvent(&wmmsg)) doPoll = 0;
+ }
+#if !SDL_THREADS_DISABLED
+ if (riscos_using_threads)
+ {
+ /* Restart ticker here so other thread can not interfere
+ with the Redraw processing */
+ if (riscos_using_threads) __pthread_start_ticker();
+ /* Give other threads a better chance of running */
+ pthread_yield();
+ }
+#endif
+ }
+}
+
+/* Set focus to specified window */
+void WIMP_SetFocus(int win)
+{
+ _kernel_swi_regs regs;
+
+ regs.r[0] = win;
+ regs.r[1] = -1; /* Icon handle */
+ regs.r[2] = 0; /* X-offset we just put it at position 0 */
+ regs.r[3] = 0; /* Y-offset as above */
+ regs.r[4] = 1 << 25; /* Caret is invisible */
+ regs.r[5] = 0; /* index into string */
+
+ _kernel_swi(Wimp_SetCaretPosition, &regs, &regs);
+}
+
+/** Run background task while in a sleep command */
+void RISCOS_BackgroundTasks(void)
+{
+ if (current_video && current_video->hidden->window_handle)
+ {
+ WIMP_Poll(current_video, 0);
+ }
+#if SDL_THREADS_DISABLED
+ if (SDL_timer_running) RISCOS_CheckTimer();
+#endif
+}
diff --git a/distrib/sdl-1.2.15/src/video/riscos/SDL_wimpvideo.c b/distrib/sdl-1.2.15/src/video/riscos/SDL_wimpvideo.c
new file mode 100644
index 0000000..0f9c545
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/riscos/SDL_wimpvideo.c
@@ -0,0 +1,501 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ File added by Alan Buckley (alan_baa@hotmail.com) for RISC OS compatability
+ 27 March 2003
+
+ Implements RISC OS Wimp display.
+*/
+
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_riscostask.h"
+#include "SDL_riscosvideo.h"
+#include "SDL_riscosevents_c.h"
+#include "SDL_riscosmouse_c.h"
+
+#include "kernel.h"
+#include "swis.h"
+
+/* Initialization/Query functions */
+SDL_Rect **WIMP_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+SDL_Surface *WIMP_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+int WIMP_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
+void WIMP_SetWMCaption(_THIS, const char *title, const char *icon);
+
+
+extern unsigned char *WIMP_CreateBuffer(int width, int height, int bpp);
+extern void WIMP_PumpEvents(_THIS);
+extern void WIMP_PlotSprite(_THIS, int x, int y);
+extern void WIMP_SetupPlotInfo(_THIS);
+extern void WIMP_SetFocus(int win);
+
+/* etc. */
+static void WIMP_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
+
+/* RISC OS Wimp handling helpers */
+void WIMP_ReadModeInfo(_THIS);
+unsigned int WIMP_SetupWindow(_THIS, SDL_Surface *surface);
+void WIMP_SetDeviceMode(_THIS);
+void WIMP_DeleteWindow(_THIS);
+
+/* FULLSCREEN function required for wimp/fullscreen toggling */
+extern int FULLSCREEN_SetMode(int width, int height, int bpp);
+
+/* Currently need to set this up here as it only works if you
+ start up in a Wimp mode */
+extern int RISCOS_ToggleFullScreen(_THIS, int fullscreen);
+
+extern int riscos_backbuffer;
+extern int mouseInWindow;
+extern int riscos_closeaction;
+
+/* Following needed to ensure window is shown immediately */
+extern int hasFocus;
+extern void WIMP_Poll(_THIS, int waitTime);
+
+SDL_Surface *WIMP_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ Uint32 Rmask = 0;
+ Uint32 Gmask = 0;
+ Uint32 Bmask = 0;
+ char *buffer = NULL;
+ int bytesPerPixel = 1;
+
+ /* Don't support double buffering in Wimp mode */
+ flags &= ~SDL_DOUBLEBUF;
+ flags &= ~SDL_HWSURFACE;
+
+ switch(bpp)
+ {
+ case 8:
+ /* Emulated palette using ColourTrans */
+ flags |= SDL_HWPALETTE;
+ break;
+
+ case 15:
+ case 16:
+ Bmask = 0x00007c00;
+ Gmask = 0x000003e0;
+ Rmask = 0x0000001f;
+ bytesPerPixel = 2;
+ break;
+
+ case 32:
+ Bmask = 0x00ff0000;
+ Gmask = 0x0000ff00;
+ Rmask = 0x000000ff;
+ bytesPerPixel = 4;
+ break;
+
+ default:
+ SDL_SetError("Pixel depth not supported");
+ return NULL;
+ break;
+ }
+
+/* printf("Setting mode %dx%d\n", width, height);*/
+
+ /* Allocate the new pixel format for the screen */
+ if ( ! SDL_ReallocFormat(current, bpp, Rmask, Gmask, Bmask, 0) ) {
+ SDL_SetError("Couldn't allocate new pixel format for requested mode");
+ return(NULL);
+ }
+
+ /* Set up the new mode framebuffer */
+ current->w = width;
+ this->hidden->height = current->h = height;
+
+ if (bpp == 15) bpp = 16;
+ buffer = WIMP_CreateBuffer(width, height, bpp);
+ if (buffer == NULL)
+ {
+ SDL_SetError("Couldn't create sprite for video memory");
+ return (NULL);
+ }
+
+ this->hidden->bank[0] = buffer + 60; /* Start of sprite data */
+ if (bpp == 8) this->hidden->bank[0] += 2048; /* 8bpp sprite have palette first */
+
+ this->hidden->bank[1] = buffer; /* Start of buffer */
+
+ /* Remember sprite buffer so it can be freed later */
+ if (this->hidden->alloc_bank) SDL_free(this->hidden->alloc_bank);
+ this->hidden->alloc_bank = buffer;
+
+ current->pitch = width * bytesPerPixel;
+ if ((current->pitch & 3))
+ {
+ /* Sprites are 32bit word aligned */
+ current->pitch += (4 - (current->pitch & 3));
+ }
+
+ current->flags = flags | SDL_PREALLOC;
+
+ WIMP_ReadModeInfo(this);
+
+ SDL_memset(this->hidden->bank[0], 0, height * current->pitch);
+
+ this->hidden->current_bank = 0;
+ current->pixels = this->hidden->bank[0];
+
+
+ if (WIMP_SetupWindow(this, current) == 0)
+ {
+ SDL_SetError("Unable to create window to display surface");
+ return NULL;
+ }
+
+ /* Reset device functions for the wimp */
+ WIMP_SetDeviceMode(this);
+
+ /* Needs to set up plot info after window has been created */
+ /* Not sure why, but plots don't work if I do it earlier */
+ WIMP_SetupPlotInfo(this);
+
+ /* Poll until window is shown */
+ {
+ /* We wait until it gets the focus, but give up after 5 seconds
+ in case the focus is prevented in any way.
+ */
+ Uint32 now = SDL_GetTicks();
+ while (!hasFocus && SDL_GetTicks() - now < 5000)
+ {
+ WIMP_Poll(this, 0);
+ }
+ }
+
+ /* We're done */
+ return(current);
+}
+
+
+void WIMP_ReadModeInfo(_THIS)
+{
+ _kernel_swi_regs regs;
+ int vars[6];
+ int vals[5];
+
+ vars[0] = 4; /* XEig */
+ vars[1] = 5; /* YEig */
+ vars[2] = 9; /* Log base 2 bpp */
+ vars[3] = 11; /* Screen Width - 1 */
+ vars[4] = 12; /* Screen Depth - 1 */
+ vars[5] = -1; /* Terminate list */
+
+ regs.r[0] = (int)vars;
+ regs.r[1] = (int)vals;
+ _kernel_swi(OS_ReadVduVariables, &regs, &regs);
+ this->hidden->xeig = vals[0];
+ this->hidden->yeig = vals[1];
+ this->hidden->screen_bpp = 1 << vals[2];
+ this->hidden->screen_width = vals[3] + 1;
+ this->hidden->screen_height = vals[4] + 1;
+}
+
+/* Set device function to call the correct versions for running
+ in a wimp window */
+
+void WIMP_SetDeviceMode(_THIS)
+{
+ if (this->UpdateRects == WIMP_UpdateRects) return; /* Already set up */
+
+ this->SetColors = WIMP_SetColors;
+ this->UpdateRects = WIMP_UpdateRects;
+
+ this->FlipHWSurface = NULL;
+
+ this->SetCaption = WIMP_SetWMCaption;
+ this->SetIcon = NULL;
+ this->IconifyWindow = NULL;
+
+ this->ShowWMCursor = WIMP_ShowWMCursor;
+ this->WarpWMCursor = WIMP_WarpWMCursor;
+
+ this->ToggleFullScreen = RISCOS_ToggleFullScreen;
+
+ this->PumpEvents = WIMP_PumpEvents;
+}
+
+/* Setup the Window to display the surface */
+unsigned int WIMP_SetupWindow(_THIS, SDL_Surface *surface)
+{
+ _kernel_swi_regs regs;
+ int window_data[23];
+ int *window_block = window_data+1;
+ int x = (this->hidden->screen_width - surface->w) / 2;
+ int y = (this->hidden->screen_height - surface->h) / 2;
+ int xeig = this->hidden->xeig;
+ int yeig = this->hidden->yeig;
+
+ mouseInWindow = 0;
+
+ /* Always delete the window and recreate on a change */
+ if (this->hidden->window_handle) WIMP_DeleteWindow(this);
+
+ /* Setup window co-ordinates */
+ window_block[0] = x << xeig;
+ window_block[1] = y << yeig;
+ window_block[2] = window_block[0] + (surface->w << xeig);
+ window_block[3] = window_block[1] + (surface->h << yeig);
+
+
+ window_block[4] = 0; /* Scroll offsets */
+ window_block[5] = 0;
+ window_block[6] = -1; /* Open on top of window stack */
+
+ window_block[7] = 0x85040042; /* Window flags */
+ if (riscos_closeaction != 0) window_block[7] |= 0x2000000;
+
+ /* TODO: Take into account surface->flags */
+
+ window_block[8] = 0xff070207; /* Window colours */
+ window_block[9] = 0x000c0103;
+ window_block[10] = 0; /* Work area minimum */
+ window_block[11] = -surface->h << yeig;
+ window_block[12] = surface->w << xeig; /* Work area maximum */
+ window_block[13] = 0;
+ window_block[14] = 0x2700013d; /* Title icon flags */
+ window_block[15] = 0x00003000; /* Work area flags - Mouse click down reported */
+ window_block[16] = 1; /* Sprite area control block pointer */
+ window_block[17] = 0x00100010; /* Minimum window size (width & height) (16x16)*/
+ window_block[18] = (int)this->hidden->title; /* Title data */
+ window_block[19] = -1;
+ window_block[20] = 256;
+ window_block[21] = 0; /* Number of icons */
+
+ regs.r[1] = (unsigned int)(window_block);
+
+ /* Create the window */
+ if (_kernel_swi(Wimp_CreateWindow, &regs, &regs) == NULL)
+ {
+ this->hidden->window_handle = window_data[0] = regs.r[0];
+
+ /* Show the window on the screen */
+ regs.r[1] = (unsigned int)window_data;
+ if (_kernel_swi(Wimp_OpenWindow, &regs, &regs) == NULL)
+ {
+ WIMP_SetFocus(this->hidden->window_handle);
+ } else
+ {
+ WIMP_DeleteWindow(this);
+ }
+ }
+
+ return this->hidden->window_handle;
+}
+
+/* Destroy the Window */
+
+void WIMP_DeleteWindow(_THIS)
+{
+ _kernel_swi_regs regs;
+ regs.r[1] = (unsigned int)&(this->hidden->window_handle);
+ _kernel_swi(Wimp_DeleteWindow, &regs, &regs);
+ this->hidden->window_handle = 0;
+}
+
+
+void WIMP_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
+{
+ _kernel_swi_regs regs;
+ int update_block[12];
+ int xeig = this->hidden->xeig;
+ int yeig = this->hidden->yeig;
+ int j;
+ update_block[0] = this->hidden->window_handle;
+
+ for (j = 0; j < numrects; j++)
+ {
+ update_block[1] = rects[j].x << xeig; /* Min X */
+ update_block[4] = -(rects[j].y << yeig);
+ update_block[3] = update_block[1] + (rects[j].w << xeig);
+ update_block[2] = update_block[4] - (rects[j].h << yeig);
+
+ regs.r[1] = (int)update_block;
+ /* Update window can fail if called before first poll */
+ if (_kernel_swi(Wimp_UpdateWindow, &regs, &regs) == 0)
+ {
+ while (regs.r[0])
+ {
+ WIMP_PlotSprite(this, update_block[1], update_block[2]);
+ _kernel_swi(Wimp_GetRectangle, &regs, &regs);
+ }
+ }
+ }
+}
+
+
+int WIMP_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ unsigned int *pal = (unsigned int *)(this->hidden->bank[1]+60);
+ int j;
+ SDL_Rect update;
+
+ pal += firstcolor*2;
+ for (j = 0; j < ncolors; j++)
+ {
+ *pal = (((unsigned int)colors->r) << 8)
+ + (((unsigned int)colors->g) << 16)
+ + (((unsigned int)colors->b) << 24);
+ pal[1] = *pal;
+ pal += 2;
+ colors++;
+ }
+
+ WIMP_SetupPlotInfo(this);
+
+ /* Need to refresh the window */
+ update.x = 0;
+ update.y = 0;
+ update.w = SDL_VideoSurface->w;
+ update.h = SDL_VideoSurface->h;
+ WIMP_UpdateRects(this, 1, &update);
+
+ return 1;
+}
+
+void WIMP_SetWMCaption(_THIS, const char *title, const char *icon)
+{
+ _kernel_swi_regs regs;
+
+ SDL_strlcpy(this->hidden->title, title, SDL_arraysize(this->hidden->title));
+
+ if (RISCOS_GetWimpVersion() < 380)
+ {
+ int block[6];
+
+ regs.r[1] = (int)block;
+ _kernel_swi(Wimp_GetCaretPosition, &regs, &regs);
+ if (block[0] == (int)this->hidden->window_handle)
+ {
+ regs.r[0] = -1;
+ _kernel_swi(Wimp_SetCaretPosition, &regs,&regs);
+ } else
+ {
+ regs.r[0] = this->hidden->window_handle;
+ regs.r[1] = -1;
+ regs.r[2] = -1;
+ regs.r[3] = -1;
+ _kernel_swi(Wimp_SetCaretPosition, &regs,&regs);
+ }
+ regs.r[0] = block[0];
+ regs.r[1] = block[1];
+ regs.r[2] = block[2];
+ regs.r[3] = block[3];
+ regs.r[4] = block[4];
+ regs.r[5] = block[5];
+ _kernel_swi(Wimp_SetCaretPosition, &regs,&regs);
+ } else
+ {
+ regs.r[0] = this->hidden->window_handle;
+ regs.r[1] = 0x4b534154; /* "TASK" */
+ regs.r[2] = 3; /* Redraw title */
+ _kernel_swi(Wimp_ForceRedraw, &regs, &regs);
+ }
+}
+
+void WIMP_RefreshDesktop(_THIS)
+{
+ int width = this->hidden->screen_width << this->hidden->xeig;
+ int height = this->hidden->screen_height << this->hidden->yeig;
+ _kernel_swi_regs regs;
+ regs.r[0] = -1; /* Whole screen */
+ regs.r[1] = 0;
+ regs.r[2] = 0;
+ regs.r[3] = width;
+ regs.r[4] = height;
+ _kernel_swi(Wimp_ForceRedraw, &regs, &regs);
+}
+
+/* Toggle to window from full screen */
+int WIMP_ToggleFromFullScreen(_THIS)
+{
+ int width = this->screen->w;
+ int height = this->screen->h;
+ int bpp = this->screen->format->BitsPerPixel;
+ char *buffer = NULL;
+ char *old_bank[2];
+ char *old_alloc_bank;
+
+ /* Ensure flags are OK */
+ this->screen->flags &= ~(SDL_DOUBLEBUF|SDL_HWSURFACE);
+
+ if (this->hidden->bank[0] == this->hidden->alloc_bank || riscos_backbuffer == 0)
+ {
+ /* Need to create a sprite for the screen and copy the data to it */
+ char *data;
+ buffer = WIMP_CreateBuffer(width, height, bpp);
+ data = buffer + 60; /* Start of sprite data */
+ if (bpp == 8) data += 2048; /* 8bpp sprite have palette first */
+
+ if (buffer == NULL) return 0;
+ SDL_memcpy(data, this->hidden->bank[0], width * height * this->screen->format->BytesPerPixel);
+ }
+ /* else We've switch to full screen before so we already have a sprite */
+
+ old_bank[0] = this->hidden->bank[0];
+ old_bank[1] = this->hidden->bank[1];
+ old_alloc_bank = this->hidden->alloc_bank;
+
+ if (buffer != NULL) this->hidden->alloc_bank = buffer;
+
+ this->hidden->bank[1] = this->hidden->alloc_bank;
+ this->hidden->bank[0] = this->hidden->bank[1] + 60; /* Start of sprite data */
+ if (bpp == 8) this->hidden->bank[0] += 2048; /* 8bpp sprite have palette first */
+
+ this->hidden->current_bank = 0;
+ this->screen->pixels = this->hidden->bank[0];
+
+ RISCOS_RestoreWimpMode();
+ WIMP_ReadModeInfo(this);
+ if (WIMP_SetupWindow(this, this->screen))
+ {
+ WIMP_SetDeviceMode(this);
+ WIMP_SetupPlotInfo(this);
+
+ if (riscos_backbuffer == 0) riscos_backbuffer = 1;
+
+ if (buffer && old_alloc_bank) SDL_free(old_alloc_bank);
+
+ return 1;
+ } else
+ {
+ /* Drop back to full screen mode on failure */
+ this->hidden->bank[0] = old_bank[0];
+ this->hidden->bank[1] = old_bank[1];
+ this->hidden->alloc_bank = old_alloc_bank;
+ if (buffer) SDL_free(buffer);
+
+ RISCOS_StoreWimpMode();
+ FULLSCREEN_SetMode(width, height, bpp);
+ }
+
+ return 0;
+}
diff --git a/distrib/sdl-1.2.15/src/video/svga/SDL_svgaevents.c b/distrib/sdl-1.2.15/src/video/svga/SDL_svgaevents.c
new file mode 100644
index 0000000..107a702
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/svga/SDL_svgaevents.c
@@ -0,0 +1,412 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Handle the event stream, converting X11 events into SDL events */
+
+#include <vga.h>
+#include <vgamouse.h>
+#include <vgakeyboard.h>
+#if defined(__LINUX__)
+#include <linux/kd.h>
+#include <linux/keyboard.h>
+#elif defined(__FREEBSD__)
+#include <sys/kbio.h>
+#else
+#error You must choose your operating system here
+#endif
+
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_svgavideo.h"
+#include "SDL_svgaevents_c.h"
+
+/* The translation tables from a console scancode to a SDL keysym */
+#if defined(linux)
+#define NUM_VGAKEYMAPS (1<<KG_CAPSSHIFT)
+static Uint16 vga_keymap[NUM_VGAKEYMAPS][NR_KEYS];
+#elif defined(__FREEBSD__)
+/* FIXME: Free the keymap when we shut down the video mode */
+static keymap_t *vga_keymap = NULL;
+#else
+#error You must choose your operating system here
+#endif
+static SDLKey keymap[128];
+static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym);
+
+/* Ugh, we have to duplicate the kernel's keysym mapping code...
+ Oh, it's not so bad. :-)
+
+ FIXME: Add keyboard LED handling code
+ */
+#if defined(linux)
+int SVGA_initkeymaps(int fd)
+{
+ struct kbentry entry;
+ int map, i;
+
+ /* Load all the keysym mappings */
+ for ( map=0; map<NUM_VGAKEYMAPS; ++map ) {
+ SDL_memset(vga_keymap[map], 0, NR_KEYS*sizeof(Uint16));
+ for ( i=0; i<NR_KEYS; ++i ) {
+ entry.kb_table = map;
+ entry.kb_index = i;
+ if ( ioctl(fd, KDGKBENT, &entry) == 0 ) {
+ /* The "Enter" key is a special case */
+ if ( entry.kb_value == K_ENTER ) {
+ entry.kb_value = K(KT_ASCII,13);
+ }
+ /* Handle numpad specially as well */
+ if ( KTYP(entry.kb_value) == KT_PAD ) {
+ switch ( entry.kb_value ) {
+ case K_P0:
+ case K_P1:
+ case K_P2:
+ case K_P3:
+ case K_P4:
+ case K_P5:
+ case K_P6:
+ case K_P7:
+ case K_P8:
+ case K_P9:
+ vga_keymap[map][i]=entry.kb_value;
+ vga_keymap[map][i]+= '0';
+ break;
+ case K_PPLUS:
+ vga_keymap[map][i]=K(KT_ASCII,'+');
+ break;
+ case K_PMINUS:
+ vga_keymap[map][i]=K(KT_ASCII,'-');
+ break;
+ case K_PSTAR:
+ vga_keymap[map][i]=K(KT_ASCII,'*');
+ break;
+ case K_PSLASH:
+ vga_keymap[map][i]=K(KT_ASCII,'/');
+ break;
+ case K_PENTER:
+ vga_keymap[map][i]=K(KT_ASCII,'\r');
+ break;
+ case K_PCOMMA:
+ vga_keymap[map][i]=K(KT_ASCII,',');
+ break;
+ case K_PDOT:
+ vga_keymap[map][i]=K(KT_ASCII,'.');
+ break;
+ default:
+ break;
+ }
+ }
+ /* Do the normal key translation */
+ if ( (KTYP(entry.kb_value) == KT_LATIN) ||
+ (KTYP(entry.kb_value) == KT_ASCII) ||
+ (KTYP(entry.kb_value) == KT_LETTER) ) {
+ vga_keymap[map][i] = entry.kb_value;
+ }
+ }
+ }
+ }
+ return(0);
+}
+#elif defined(__FREEBSD__)
+int SVGA_initkeymaps(int fd)
+{
+ vga_keymap = SDL_malloc(sizeof(keymap_t));
+ if ( ! vga_keymap ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ if (ioctl(fd, GIO_KEYMAP, vga_keymap) == -1) {
+ SDL_free(vga_keymap);
+ vga_keymap = NULL;
+ SDL_SetError("Unable to get keyboard map");
+ return(-1);
+ }
+ return(0);
+}
+#else
+#error You must choose your operating system here
+#endif
+
+int posted = 0;
+
+void SVGA_mousecallback(int button, int dx, int dy,
+ int u1,int u2,int u3, int u4)
+{
+ if ( dx || dy ) {
+ posted += SDL_PrivateMouseMotion(0, 1, dx, dy);
+ }
+ if ( button & MOUSE_LEFTBUTTON ) {
+ if ( !(SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(1)) ) {
+ posted += SDL_PrivateMouseButton(SDL_PRESSED, 1, 0, 0);
+ }
+ } else {
+ if ( (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(1)) ) {
+ posted += SDL_PrivateMouseButton(SDL_RELEASED, 1, 0, 0);
+ }
+ }
+ if ( button & MOUSE_MIDDLEBUTTON ) {
+ if ( !(SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(2)) ) {
+ posted += SDL_PrivateMouseButton(SDL_PRESSED, 2, 0, 0);
+ }
+ } else {
+ if ( (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(2)) ) {
+ posted += SDL_PrivateMouseButton(SDL_RELEASED, 2, 0, 0);
+ }
+ }
+ if ( button & MOUSE_RIGHTBUTTON ) {
+ if ( !(SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(3)) ) {
+ posted += SDL_PrivateMouseButton(SDL_PRESSED, 3, 0, 0);
+ }
+ } else {
+ if ( (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(3)) ) {
+ posted += SDL_PrivateMouseButton(SDL_RELEASED, 3, 0, 0);
+ }
+ }
+}
+
+void SVGA_keyboardcallback(int scancode, int pressed)
+{
+ SDL_keysym keysym;
+
+ if ( pressed ) {
+ posted += SDL_PrivateKeyboard(SDL_PRESSED,
+ TranslateKey(scancode, &keysym));
+ } else {
+ posted += SDL_PrivateKeyboard(SDL_RELEASED,
+ TranslateKey(scancode, &keysym));
+ }
+}
+
+void SVGA_PumpEvents(_THIS)
+{
+ do {
+ posted = 0;
+ mouse_update();
+ keyboard_update();
+ } while ( posted );
+}
+
+void SVGA_InitOSKeymap(_THIS)
+{
+ int i;
+
+ /* Initialize the BeOS key translation table */
+ for ( i=0; i<SDL_arraysize(keymap); ++i )
+ keymap[i] = SDLK_UNKNOWN;
+
+ keymap[SCANCODE_ESCAPE] = SDLK_ESCAPE;
+ keymap[SCANCODE_1] = SDLK_1;
+ keymap[SCANCODE_2] = SDLK_2;
+ keymap[SCANCODE_3] = SDLK_3;
+ keymap[SCANCODE_4] = SDLK_4;
+ keymap[SCANCODE_5] = SDLK_5;
+ keymap[SCANCODE_6] = SDLK_6;
+ keymap[SCANCODE_7] = SDLK_7;
+ keymap[SCANCODE_8] = SDLK_8;
+ keymap[SCANCODE_9] = SDLK_9;
+ keymap[SCANCODE_0] = SDLK_0;
+ keymap[SCANCODE_MINUS] = SDLK_MINUS;
+ keymap[SCANCODE_EQUAL] = SDLK_EQUALS;
+ keymap[SCANCODE_BACKSPACE] = SDLK_BACKSPACE;
+ keymap[SCANCODE_TAB] = SDLK_TAB;
+ keymap[SCANCODE_Q] = SDLK_q;
+ keymap[SCANCODE_W] = SDLK_w;
+ keymap[SCANCODE_E] = SDLK_e;
+ keymap[SCANCODE_R] = SDLK_r;
+ keymap[SCANCODE_T] = SDLK_t;
+ keymap[SCANCODE_Y] = SDLK_y;
+ keymap[SCANCODE_U] = SDLK_u;
+ keymap[SCANCODE_I] = SDLK_i;
+ keymap[SCANCODE_O] = SDLK_o;
+ keymap[SCANCODE_P] = SDLK_p;
+ keymap[SCANCODE_BRACKET_LEFT] = SDLK_LEFTBRACKET;
+ keymap[SCANCODE_BRACKET_RIGHT] = SDLK_RIGHTBRACKET;
+ keymap[SCANCODE_ENTER] = SDLK_RETURN;
+ keymap[SCANCODE_LEFTCONTROL] = SDLK_LCTRL;
+ keymap[SCANCODE_A] = SDLK_a;
+ keymap[SCANCODE_S] = SDLK_s;
+ keymap[SCANCODE_D] = SDLK_d;
+ keymap[SCANCODE_F] = SDLK_f;
+ keymap[SCANCODE_G] = SDLK_g;
+ keymap[SCANCODE_H] = SDLK_h;
+ keymap[SCANCODE_J] = SDLK_j;
+ keymap[SCANCODE_K] = SDLK_k;
+ keymap[SCANCODE_L] = SDLK_l;
+ keymap[SCANCODE_SEMICOLON] = SDLK_SEMICOLON;
+ keymap[SCANCODE_APOSTROPHE] = SDLK_QUOTE;
+ keymap[SCANCODE_GRAVE] = SDLK_BACKQUOTE;
+ keymap[SCANCODE_LEFTSHIFT] = SDLK_LSHIFT;
+ keymap[SCANCODE_BACKSLASH] = SDLK_BACKSLASH;
+ keymap[SCANCODE_Z] = SDLK_z;
+ keymap[SCANCODE_X] = SDLK_x;
+ keymap[SCANCODE_C] = SDLK_c;
+ keymap[SCANCODE_V] = SDLK_v;
+ keymap[SCANCODE_B] = SDLK_b;
+ keymap[SCANCODE_N] = SDLK_n;
+ keymap[SCANCODE_M] = SDLK_m;
+ keymap[SCANCODE_COMMA] = SDLK_COMMA;
+ keymap[SCANCODE_PERIOD] = SDLK_PERIOD;
+ keymap[SCANCODE_SLASH] = SDLK_SLASH;
+ keymap[SCANCODE_RIGHTSHIFT] = SDLK_RSHIFT;
+ keymap[SCANCODE_KEYPADMULTIPLY] = SDLK_KP_MULTIPLY;
+ keymap[SCANCODE_LEFTALT] = SDLK_LALT;
+ keymap[SCANCODE_SPACE] = SDLK_SPACE;
+ keymap[SCANCODE_CAPSLOCK] = SDLK_CAPSLOCK;
+ keymap[SCANCODE_F1] = SDLK_F1;
+ keymap[SCANCODE_F2] = SDLK_F2;
+ keymap[SCANCODE_F3] = SDLK_F3;
+ keymap[SCANCODE_F4] = SDLK_F4;
+ keymap[SCANCODE_F5] = SDLK_F5;
+ keymap[SCANCODE_F6] = SDLK_F6;
+ keymap[SCANCODE_F7] = SDLK_F7;
+ keymap[SCANCODE_F8] = SDLK_F8;
+ keymap[SCANCODE_F9] = SDLK_F9;
+ keymap[SCANCODE_F10] = SDLK_F10;
+ keymap[SCANCODE_NUMLOCK] = SDLK_NUMLOCK;
+ keymap[SCANCODE_SCROLLLOCK] = SDLK_SCROLLOCK;
+ keymap[SCANCODE_KEYPAD7] = SDLK_KP7;
+ keymap[SCANCODE_CURSORUPLEFT] = SDLK_KP7;
+ keymap[SCANCODE_KEYPAD8] = SDLK_KP8;
+ keymap[SCANCODE_CURSORUP] = SDLK_KP8;
+ keymap[SCANCODE_KEYPAD9] = SDLK_KP9;
+ keymap[SCANCODE_CURSORUPRIGHT] = SDLK_KP9;
+ keymap[SCANCODE_KEYPADMINUS] = SDLK_KP_MINUS;
+ keymap[SCANCODE_KEYPAD4] = SDLK_KP4;
+ keymap[SCANCODE_CURSORLEFT] = SDLK_KP4;
+ keymap[SCANCODE_KEYPAD5] = SDLK_KP5;
+ keymap[SCANCODE_KEYPAD6] = SDLK_KP6;
+ keymap[SCANCODE_CURSORRIGHT] = SDLK_KP6;
+ keymap[SCANCODE_KEYPADPLUS] = SDLK_KP_PLUS;
+ keymap[SCANCODE_KEYPAD1] = SDLK_KP1;
+ keymap[SCANCODE_CURSORDOWNLEFT] = SDLK_KP1;
+ keymap[SCANCODE_KEYPAD2] = SDLK_KP2;
+ keymap[SCANCODE_CURSORDOWN] = SDLK_KP2;
+ keymap[SCANCODE_KEYPAD3] = SDLK_KP3;
+ keymap[SCANCODE_CURSORDOWNRIGHT] = SDLK_KP3;
+ keymap[SCANCODE_KEYPAD0] = SDLK_KP0;
+ keymap[SCANCODE_KEYPADPERIOD] = SDLK_KP_PERIOD;
+ keymap[SCANCODE_LESS] = SDLK_LESS;
+ keymap[SCANCODE_F11] = SDLK_F11;
+ keymap[SCANCODE_F12] = SDLK_F12;
+ keymap[SCANCODE_KEYPADENTER] = SDLK_KP_ENTER;
+ keymap[SCANCODE_RIGHTCONTROL] = SDLK_RCTRL;
+ keymap[SCANCODE_CONTROL] = SDLK_RCTRL;
+ keymap[SCANCODE_KEYPADDIVIDE] = SDLK_KP_DIVIDE;
+ keymap[SCANCODE_PRINTSCREEN] = SDLK_PRINT;
+ keymap[SCANCODE_RIGHTALT] = SDLK_RALT;
+ keymap[SCANCODE_BREAK] = SDLK_BREAK;
+ keymap[SCANCODE_BREAK_ALTERNATIVE] = SDLK_UNKNOWN;
+ keymap[SCANCODE_HOME] = SDLK_HOME;
+ keymap[SCANCODE_CURSORBLOCKUP] = SDLK_UP;
+ keymap[SCANCODE_PAGEUP] = SDLK_PAGEUP;
+ keymap[SCANCODE_CURSORBLOCKLEFT] = SDLK_LEFT;
+ keymap[SCANCODE_CURSORBLOCKRIGHT] = SDLK_RIGHT;
+ keymap[SCANCODE_END] = SDLK_END;
+ keymap[SCANCODE_CURSORBLOCKDOWN] = SDLK_DOWN;
+ keymap[SCANCODE_PAGEDOWN] = SDLK_PAGEDOWN;
+ keymap[SCANCODE_INSERT] = SDLK_INSERT;
+ keymap[SCANCODE_REMOVE] = SDLK_DELETE;
+ keymap[119] = SDLK_PAUSE;
+ keymap[SCANCODE_RIGHTWIN] = SDLK_RSUPER;
+ keymap[SCANCODE_LEFTWIN] = SDLK_LSUPER;
+ keymap[127] = SDLK_MENU;
+}
+
+#if defined(linux)
+static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym)
+{
+ /* Set the keysym information */
+ keysym->scancode = scancode;
+ keysym->sym = keymap[scancode];
+ keysym->mod = KMOD_NONE;
+
+ /* If UNICODE is on, get the UNICODE value for the key */
+ keysym->unicode = 0;
+ if ( SDL_TranslateUNICODE ) {
+ int map;
+ SDLMod modstate;
+
+ modstate = SDL_GetModState();
+ map = 0;
+ if ( modstate & KMOD_SHIFT ) {
+ map |= (1<<KG_SHIFT);
+ }
+ if ( modstate & KMOD_CTRL ) {
+ map |= (1<<KG_CTRL);
+ }
+ if ( modstate & KMOD_ALT ) {
+ map |= (1<<KG_ALT);
+ }
+ if ( modstate & KMOD_MODE ) {
+ map |= (1<<KG_ALTGR);
+ }
+ if ( KTYP(vga_keymap[map][scancode]) == KT_LETTER ) {
+ if ( modstate & KMOD_CAPS ) {
+ map ^= (1<<KG_SHIFT);
+ }
+ }
+ if ( KTYP(vga_keymap[map][scancode]) == KT_PAD ) {
+ if ( modstate & KMOD_NUM ) {
+ keysym->unicode=KVAL(vga_keymap[map][scancode]);
+ }
+ } else {
+ keysym->unicode = KVAL(vga_keymap[map][scancode]);
+ }
+ }
+ return(keysym);
+}
+#elif defined(__FREEBSD__)
+static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym)
+{
+ /* Set the keysym information */
+ keysym->scancode = scancode;
+ keysym->sym = keymap[scancode];
+ keysym->mod = KMOD_NONE;
+
+ /* If UNICODE is on, get the UNICODE value for the key */
+ keysym->unicode = 0;
+ if ( SDL_TranslateUNICODE && vga_keymap ) {
+ int map;
+ SDLMod modstate;
+
+ modstate = SDL_GetModState();
+ map = 0;
+ if ( modstate & KMOD_SHIFT ) {
+ map += 1;
+ }
+ if ( modstate & KMOD_CTRL ) {
+ map += 2;
+ }
+ if ( modstate & KMOD_ALT ) {
+ map += 4;
+ }
+ if ( !(vga_keymap->key[scancode].spcl & (0x80 >> map)) ) {
+ keysym->unicode = vga_keymap->key[scancode].map[map];
+ }
+
+ }
+ return(keysym);
+}
+#else
+#error You must choose your operating system here
+#endif
diff --git a/distrib/sdl-1.2.15/src/video/svga/SDL_svgaevents_c.h b/distrib/sdl-1.2.15/src/video/svga/SDL_svgaevents_c.h
new file mode 100644
index 0000000..cd9f888
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/svga/SDL_svgaevents_c.h
@@ -0,0 +1,35 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_svgavideo.h"
+
+/* Variables and functions exported by SDL_sysevents.c to other parts
+ of the native video subsystem (SDL_sysvideo.c)
+*/
+extern int SVGA_initkeymaps(int fd);
+extern void SVGA_mousecallback(int button, int dx, int dy,
+ int u1,int u2,int u3, int u4);
+extern void SVGA_keyboardcallback(int scancode, int pressed);
+
+extern void SVGA_InitOSKeymap(_THIS);
+extern void SVGA_PumpEvents(_THIS);
diff --git a/distrib/sdl-1.2.15/src/video/svga/SDL_svgamouse.c b/distrib/sdl-1.2.15/src/video/svga/SDL_svgamouse.c
new file mode 100644
index 0000000..a82dbfd
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/svga/SDL_svgamouse.c
@@ -0,0 +1,33 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_mouse.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_svgavideo.h"
+#include "SDL_svgamouse_c.h"
+
+
+/* The implementation dependent data for the window manager cursor */
+struct WMcursor {
+ int unused;
+};
diff --git a/distrib/sdl-1.2.15/src/video/svga/SDL_svgamouse_c.h b/distrib/sdl-1.2.15/src/video/svga/SDL_svgamouse_c.h
new file mode 100644
index 0000000..78fe8ab
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/svga/SDL_svgamouse_c.h
@@ -0,0 +1,26 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_svgavideo.h"
+
+/* Functions to be exported */
diff --git a/distrib/sdl-1.2.15/src/video/svga/SDL_svgavideo.c b/distrib/sdl-1.2.15/src/video/svga/SDL_svgavideo.c
new file mode 100644
index 0000000..58ea800
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/svga/SDL_svgavideo.c
@@ -0,0 +1,584 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* SVGAlib based SDL video driver implementation.
+*/
+
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+
+#if defined(__LINUX__)
+#include <linux/vt.h>
+#elif defined(__FREEBSD__)
+#include <sys/consio.h>
+#else
+#error You must choose your operating system here
+#endif
+#include <vga.h>
+#include <vgamouse.h>
+#include <vgakeyboard.h>
+
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_svgavideo.h"
+#include "SDL_svgaevents_c.h"
+#include "SDL_svgamouse_c.h"
+
+/* Initialization/Query functions */
+static int SVGA_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **SVGA_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *SVGA_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int SVGA_SetColors(_THIS, int firstcolor, int ncolors,
+ SDL_Color *colors);
+static void SVGA_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int SVGA_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int SVGA_LockHWSurface(_THIS, SDL_Surface *surface);
+static int SVGA_FlipHWSurface(_THIS, SDL_Surface *surface);
+static void SVGA_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void SVGA_FreeHWSurface(_THIS, SDL_Surface *surface);
+
+/* SVGAlib driver bootstrap functions */
+
+static int SVGA_Available(void)
+{
+ /* Check to see if we are root and stdin is a virtual console */
+ int console;
+
+ /* SVGALib 1.9.x+ doesn't require root (via /dev/svga) */
+ int svgalib2 = -1;
+
+ /* See if we are connected to a virtual terminal */
+ console = STDIN_FILENO;
+#if 0 /* This is no longer needed, SVGAlib can switch consoles for us */
+ if ( console >= 0 ) {
+ struct stat sb;
+ struct vt_mode dummy;
+
+ if ( (fstat(console, &sb) < 0) ||
+ (ioctl(console, VT_GETMODE, &dummy) < 0) ) {
+ console = -1;
+ }
+ }
+#endif /* 0 */
+
+ /* See if SVGAlib 2.0 is available */
+ svgalib2 = open("/dev/svga", O_RDONLY);
+ if (svgalib2 != -1) {
+ close(svgalib2);
+ }
+
+ return(((svgalib2 != -1) || (geteuid() == 0)) && (console >= 0));
+}
+
+static void SVGA_DeleteDevice(SDL_VideoDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_VideoDevice *SVGA_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device;
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *device->hidden));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( device ) {
+ SDL_free(device);
+ }
+ return(0);
+ }
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+
+ /* Set the function pointers */
+ device->VideoInit = SVGA_VideoInit;
+ device->ListModes = SVGA_ListModes;
+ device->SetVideoMode = SVGA_SetVideoMode;
+ device->SetColors = SVGA_SetColors;
+ device->UpdateRects = NULL;
+ device->VideoQuit = SVGA_VideoQuit;
+ device->AllocHWSurface = SVGA_AllocHWSurface;
+ device->CheckHWBlit = NULL;
+ device->FillHWRect = NULL;
+ device->SetHWColorKey = NULL;
+ device->SetHWAlpha = NULL;
+ device->LockHWSurface = SVGA_LockHWSurface;
+ device->UnlockHWSurface = SVGA_UnlockHWSurface;
+ device->FlipHWSurface = SVGA_FlipHWSurface;
+ device->FreeHWSurface = SVGA_FreeHWSurface;
+ device->SetCaption = NULL;
+ device->SetIcon = NULL;
+ device->IconifyWindow = NULL;
+ device->GrabInput = NULL;
+ device->GetWMInfo = NULL;
+ device->InitOSKeymap = SVGA_InitOSKeymap;
+ device->PumpEvents = SVGA_PumpEvents;
+
+ device->free = SVGA_DeleteDevice;
+
+ return device;
+}
+
+VideoBootStrap SVGALIB_bootstrap = {
+ "svgalib", "SVGAlib",
+ SVGA_Available, SVGA_CreateDevice
+};
+
+static int SVGA_AddMode(_THIS, int mode, int actually_add)
+{
+ int i, j;
+ vga_modeinfo *modeinfo;
+
+ modeinfo = vga_getmodeinfo(mode);
+
+ i = modeinfo->bytesperpixel-1;
+ if ( i < 0 ) {
+ return 0;
+ }
+ if ( actually_add ) {
+ SDL_Rect saved_rect[2];
+ int saved_mode[2];
+ int b;
+
+ /* Add the mode, sorted largest to smallest */
+ b = 0;
+ j = 0;
+ while ( (SDL_modelist[i][j]->w > modeinfo->width) ||
+ (SDL_modelist[i][j]->h > modeinfo->height) ) {
+ ++j;
+ }
+ /* Skip modes that are already in our list */
+ if ( (SDL_modelist[i][j]->w == modeinfo->width) &&
+ (SDL_modelist[i][j]->h == modeinfo->height) ) {
+ return(0);
+ }
+ /* Insert the new mode */
+ saved_rect[b] = *SDL_modelist[i][j];
+ saved_mode[b] = SDL_vgamode[i][j];
+ SDL_modelist[i][j]->w = modeinfo->width;
+ SDL_modelist[i][j]->h = modeinfo->height;
+ SDL_vgamode[i][j] = mode;
+ /* Everybody scoot down! */
+ if ( saved_rect[b].w && saved_rect[b].h ) {
+ for ( ++j; SDL_modelist[i][j]->w; ++j ) {
+ saved_rect[!b] = *SDL_modelist[i][j];
+ saved_mode[!b] = SDL_vgamode[i][j];
+ *SDL_modelist[i][j] = saved_rect[b];
+ SDL_vgamode[i][j] = saved_mode[b];
+ b = !b;
+ }
+ *SDL_modelist[i][j] = saved_rect[b];
+ SDL_vgamode[i][j] = saved_mode[b];
+ }
+ } else {
+ ++SDL_nummodes[i];
+ }
+ return(1);
+}
+
+static void SVGA_UpdateVideoInfo(_THIS)
+{
+ vga_modeinfo *modeinfo;
+
+ this->info.wm_available = 0;
+ this->info.hw_available = (banked ? 0 : 1);
+ modeinfo = vga_getmodeinfo(vga_getcurrentmode());
+ this->info.video_mem = modeinfo->memory;
+ /* FIXME: Add hardware accelerated blit information */
+#ifdef SVGALIB_DEBUG
+ printf("Hardware accelerated blit: %savailable\n", modeinfo->haveblit ? "" : "not ");
+#endif
+}
+
+int SVGA_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ int keyboard;
+ int i, j;
+ int mode, total_modes;
+
+ /* Initialize all variables that we clean on shutdown */
+ for ( i=0; i<NUM_MODELISTS; ++i ) {
+ SDL_nummodes[i] = 0;
+ SDL_modelist[i] = NULL;
+ SDL_vgamode[i] = NULL;
+ }
+
+ /* Initialize the library */
+ vga_disabledriverreport();
+ if ( vga_init() < 0 ) {
+ SDL_SetError("Unable to initialize SVGAlib");
+ return(-1);
+ }
+ vga_setmode(TEXT);
+
+ /* Enable mouse and keyboard support */
+ vga_setmousesupport(1);
+ keyboard = keyboard_init_return_fd();
+ if ( keyboard < 0 ) {
+ SDL_SetError("Unable to initialize keyboard");
+ return(-1);
+ }
+ if ( SVGA_initkeymaps(keyboard) < 0 ) {
+ return(-1);
+ }
+ keyboard_seteventhandler(SVGA_keyboardcallback);
+
+ /* Determine the current screen size */
+ this->info.current_w = 0;
+ this->info.current_h = 0;
+
+ /* Determine the screen depth (use default 8-bit depth) */
+ vformat->BitsPerPixel = 8;
+
+ /* Enumerate the available fullscreen modes */
+ total_modes = 0;
+ for ( mode=vga_lastmodenumber(); mode; --mode ) {
+ if ( vga_hasmode(mode) ) {
+ if ( SVGA_AddMode(this, mode, 0) ) {
+ ++total_modes;
+ }
+ }
+ }
+ if ( SVGA_AddMode(this, G320x200x256, 0) ) ++total_modes;
+ if ( total_modes == 0 ) {
+ SDL_SetError("No linear video modes available");
+ return(-1);
+ }
+ for ( i=0; i<NUM_MODELISTS; ++i ) {
+ SDL_vgamode[i] = (int *)SDL_malloc(SDL_nummodes[i]*sizeof(int));
+ if ( SDL_vgamode[i] == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ SDL_modelist[i] = (SDL_Rect **)
+ SDL_malloc((SDL_nummodes[i]+1)*sizeof(SDL_Rect *));
+ if ( SDL_modelist[i] == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ for ( j=0; j<SDL_nummodes[i]; ++j ) {
+ SDL_modelist[i][j]=(SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
+ if ( SDL_modelist[i][j] == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ SDL_memset(SDL_modelist[i][j], 0, sizeof(SDL_Rect));
+ }
+ SDL_modelist[i][j] = NULL;
+ }
+ for ( mode=vga_lastmodenumber(); mode; --mode ) {
+ if ( vga_hasmode(mode) ) {
+ SVGA_AddMode(this, mode, 1);
+ }
+ }
+ SVGA_AddMode(this, G320x200x256, 1);
+
+ /* Free extra (duplicated) modes */
+ for ( i=0; i<NUM_MODELISTS; ++i ) {
+ j = 0;
+ while ( SDL_modelist[i][j] && SDL_modelist[i][j]->w ) {
+ j++;
+ }
+ while ( SDL_modelist[i][j] ) {
+ SDL_free(SDL_modelist[i][j]);
+ SDL_modelist[i][j] = NULL;
+ j++;
+ }
+ }
+
+ /* Fill in our hardware acceleration capabilities */
+ SVGA_UpdateVideoInfo(this);
+
+ /* We're done! */
+ return(0);
+}
+
+SDL_Rect **SVGA_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ return(SDL_modelist[((format->BitsPerPixel+7)/8)-1]);
+}
+
+/* Various screen update functions available */
+static void SVGA_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
+static void SVGA_BankedUpdate(_THIS, int numrects, SDL_Rect *rects);
+
+SDL_Surface *SVGA_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ int mode;
+ int vgamode;
+ vga_modeinfo *modeinfo;
+ int screenpage_len;
+
+ /* Free old pixels if we were in banked mode */
+ if ( banked && current->pixels ) {
+ free(current->pixels);
+ current->pixels = NULL;
+ }
+
+ /* Try to set the requested linear video mode */
+ bpp = (bpp+7)/8-1;
+ for ( mode=0; SDL_modelist[bpp][mode]; ++mode ) {
+ if ( (SDL_modelist[bpp][mode]->w == width) &&
+ (SDL_modelist[bpp][mode]->h == height) ) {
+ break;
+ }
+ }
+ if ( SDL_modelist[bpp][mode] == NULL ) {
+ SDL_SetError("Couldn't find requested mode in list");
+ return(NULL);
+ }
+ vgamode = SDL_vgamode[bpp][mode];
+ vga_setmode(vgamode);
+ vga_setpage(0);
+
+ if ( (vga_setlinearaddressing() < 0) && (vgamode != G320x200x256) ) {
+ banked = 1;
+ } else {
+ banked = 0;
+ }
+
+ modeinfo = vga_getmodeinfo(SDL_vgamode[bpp][mode]);
+
+ /* Update hardware acceleration info */
+ SVGA_UpdateVideoInfo(this);
+
+ /* Allocate the new pixel format for the screen */
+ bpp = (bpp+1)*8;
+ if ( (bpp == 16) && (modeinfo->colors == 32768) ) {
+ bpp = 15;
+ }
+ if ( ! SDL_ReallocFormat(current, bpp, 0, 0, 0, 0) ) {
+ return(NULL);
+ }
+
+ /* Set up the new mode framebuffer */
+ current->flags = SDL_FULLSCREEN;
+ if ( !banked ) {
+ current->flags |= SDL_HWSURFACE;
+ }
+ if ( bpp == 8 ) {
+ /* FIXME: What about DirectColor? */
+ current->flags |= SDL_HWPALETTE;
+ }
+ current->w = width;
+ current->h = height;
+ current->pitch = modeinfo->linewidth;
+ if ( banked ) {
+ current->pixels = SDL_malloc(current->h * current->pitch);
+ if ( !current->pixels ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ } else {
+ current->pixels = vga_getgraphmem();
+ }
+
+ /* set double-buffering */
+ if ( (flags & SDL_DOUBLEBUF) && !banked )
+ {
+ /* length of one screen page in bytes */
+ screenpage_len=current->h*modeinfo->linewidth;
+
+ /* if start address should be aligned */
+ if ( modeinfo->linewidth_unit )
+ {
+ if ( screenpage_len % modeinfo->linewidth_unit )
+ {
+ screenpage_len += modeinfo->linewidth_unit - ( screenpage_len % modeinfo->linewidth_unit );
+ }
+ }
+
+ /* if we heve enough videomemory = ak je dost videopamete */
+ if ( modeinfo->memory > ( screenpage_len * 2 / 1024 ) )
+ {
+ current->flags |= SDL_DOUBLEBUF;
+ flip_page = 0;
+ flip_offset[0] = 0;
+ flip_offset[1] = screenpage_len;
+ flip_address[0] = vga_getgraphmem();
+ flip_address[1] = flip_address[0]+screenpage_len;
+ SVGA_FlipHWSurface(this,current);
+ }
+ }
+
+ /* Set the blit function */
+ if ( banked ) {
+ this->UpdateRects = SVGA_BankedUpdate;
+ } else {
+ this->UpdateRects = SVGA_DirectUpdate;
+ }
+
+ /* Set up the mouse handler again (buggy SVGAlib 1.40) */
+ mouse_seteventhandler(SVGA_mousecallback);
+
+ /* We're done */
+ return(current);
+}
+
+/* We don't actually allow hardware surfaces other than the main one */
+static int SVGA_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(-1);
+}
+static void SVGA_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+/* We need to wait for vertical retrace on page flipped displays */
+static int SVGA_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ /* The waiting is done in SVGA_FlipHWSurface() */
+ return(0);
+}
+static void SVGA_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+static int SVGA_FlipHWSurface(_THIS, SDL_Surface *surface)
+{
+ if ( !banked ) {
+ vga_setdisplaystart(flip_offset[flip_page]);
+ flip_page=!flip_page;
+ surface->pixels=flip_address[flip_page];
+ vga_waitretrace();
+ }
+ return(0);
+}
+
+static void SVGA_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+ return;
+}
+
+static void SVGA_BankedUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+ int i, j;
+ SDL_Rect *rect;
+ int page, vp;
+ int x, y, w, h;
+ unsigned char *src;
+ unsigned char *dst;
+ int bpp = this->screen->format->BytesPerPixel;
+ int pitch = this->screen->pitch;
+
+ dst = vga_getgraphmem();
+ for ( i=0; i < numrects; ++i ) {
+ rect = &rects[i];
+ x = rect->x;
+ y = rect->y;
+ w = rect->w * bpp;
+ h = rect->h;
+
+ vp = y * pitch + x * bpp;
+ src = (unsigned char *)this->screen->pixels + vp;
+ page = vp >> 16;
+ vp &= 0xffff;
+ vga_setpage(page);
+ for (j = 0; j < h; j++) {
+ if (vp + w > 0x10000) {
+ if (vp >= 0x10000) {
+ page++;
+ vga_setpage(page);
+ vp &= 0xffff;
+ } else {
+ SDL_memcpy(dst + vp, src, 0x10000 - vp);
+ page++;
+ vga_setpage(page);
+ SDL_memcpy(dst, src + 0x10000 - vp,
+ (vp + w) & 0xffff);
+ vp = (vp + pitch) & 0xffff;
+ src += pitch;
+ continue;
+ }
+ }
+ SDL_memcpy(dst + vp, src, w);
+ src += pitch;
+ vp += pitch;
+ }
+ }
+}
+
+int SVGA_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ int i;
+
+ for(i = 0; i < ncolors; i++) {
+ vga_setpalette(firstcolor + i,
+ colors[i].r>>2,
+ colors[i].g>>2,
+ colors[i].b>>2);
+ }
+ return(1);
+}
+
+/* Note: If we are terminated, this could be called in the middle of
+ another SDL video routine -- notably UpdateRects.
+*/
+void SVGA_VideoQuit(_THIS)
+{
+ int i, j;
+
+ /* Reset the console video mode */
+ if ( this->screen && (this->screen->w && this->screen->h) ) {
+ vga_setmode(TEXT);
+ }
+ keyboard_close();
+
+ /* Free video mode lists */
+ for ( i=0; i<NUM_MODELISTS; ++i ) {
+ if ( SDL_modelist[i] != NULL ) {
+ for ( j=0; SDL_modelist[i][j]; ++j )
+ SDL_free(SDL_modelist[i][j]);
+ SDL_free(SDL_modelist[i]);
+ SDL_modelist[i] = NULL;
+ }
+ if ( SDL_vgamode[i] != NULL ) {
+ SDL_free(SDL_vgamode[i]);
+ SDL_vgamode[i] = NULL;
+ }
+ }
+ if ( this->screen ) {
+ if ( banked && this->screen->pixels ) {
+ SDL_free(this->screen->pixels);
+ }
+ this->screen->pixels = NULL;
+ }
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/svga/SDL_svgavideo.h b/distrib/sdl-1.2.15/src/video/svga/SDL_svgavideo.h
new file mode 100644
index 0000000..7fb86cb
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/svga/SDL_svgavideo.h
@@ -0,0 +1,58 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_svgavideo_h
+#define _SDL_svgavideo_h
+
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+/* Private display data */
+struct SDL_PrivateVideoData {
+#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
+ int SDL_nummodes[NUM_MODELISTS];
+ SDL_Rect **SDL_modelist[NUM_MODELISTS];
+ int *SDL_vgamode[NUM_MODELISTS];
+
+ /* information for double-buffering */
+ int flip_page;
+ int flip_offset[2];
+ Uint8 *flip_address[2];
+
+ /* Set to 1 if we're in banked video mode */
+ int banked;
+};
+/* Old variable names */
+#define SDL_nummodes (this->hidden->SDL_nummodes)
+#define SDL_modelist (this->hidden->SDL_modelist)
+#define SDL_vgamode (this->hidden->SDL_vgamode)
+#define flip_page (this->hidden->flip_page)
+#define flip_offset (this->hidden->flip_offset)
+#define flip_address (this->hidden->flip_address)
+#define banked (this->hidden->banked)
+
+#endif /* _SDL_svgavideo_h */
+
diff --git a/distrib/sdl-1.2.15/src/video/symbian/EKA1/SDL_epocevents.cpp b/distrib/sdl-1.2.15/src/video/symbian/EKA1/SDL_epocevents.cpp
new file mode 100644
index 0000000..5ceed5f
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/symbian/EKA1/SDL_epocevents.cpp
@@ -0,0 +1,626 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@devolution.com
+*/
+
+/*
+ SDL_epocevents.cpp
+ Handle the event stream, converting Epoc events into SDL events
+
+ Epoc version by Hannu Viitala (hannu.j.viitala@mbnet.fi)
+*/
+
+
+#include <stdio.h>
+#undef NULL
+extern "C" {
+//#define DEBUG_TRACE_ENABLED
+#include "SDL_error.h"
+#include "SDL_video.h"
+#include "SDL_keysym.h"
+#include "SDL_keyboard.h"
+#include "SDL_events_c.h"
+#include "SDL_timer.h"
+}; /* extern "C" */
+
+#include "SDL_epocvideo.h"
+#include "SDL_epocevents_c.h"
+
+#include<linereader.h>
+#include<bautils.h>
+
+
+#include <hal.h>
+
+extern "C" {
+/* The translation tables from a console scancode to a SDL keysym */
+static SDLKey keymap[MAX_SCANCODE];
+static SDL_keysym *TranslateKey(_THIS, int scancode, SDL_keysym *keysym);
+void DisableKeyBlocking(_THIS);
+}; /* extern "C" */
+
+TBool isCursorVisible = EFalse;
+
+int EPOC_HandleWsEvent(_THIS, const TWsEvent& aWsEvent)
+{
+ int posted = 0;
+ SDL_keysym keysym;
+
+// SDL_TRACE1("hws %d", aWsEvent.Type());
+
+ switch (aWsEvent.Type())
+ {
+ case EEventPointer: /* Mouse pointer events */
+ {
+
+ const TPointerCursorMode mode = Private->EPOC_WsSession.PointerCursorMode();
+
+ if(mode == EPointerCursorNone)
+ {
+ return 0; //TODO: Find out why events are get despite of cursor should be off
+ }
+
+ const TPointerEvent* pointerEvent = aWsEvent.Pointer();
+ TPoint mousePos = pointerEvent->iPosition;
+
+ /*!! TODO Pointer do not yet work properly
+ //SDL_TRACE1("SDL: EPOC_HandleWsEvent, pointerEvent->iType=%d", pointerEvent->iType); //!!
+
+ if (Private->EPOC_ShrinkedHeight) {
+ mousePos.iY <<= 1; // Scale y coordinate to shrinked screen height
+ }
+ if (Private->EPOC_ShrinkedWidth) {
+ mousePos.iX <<= 1; // Scale x coordinate to shrinked screen width
+ }
+ */
+
+ posted += SDL_PrivateMouseMotion(0, 0, mousePos.iX, mousePos.iY); /* Absolute position on screen */
+
+ switch (pointerEvent->iType)
+ {
+ case TPointerEvent::EButton1Down:
+ posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_LEFT, 0, 0);
+ break;
+ case TPointerEvent::EButton1Up:
+ posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_LEFT, 0, 0);
+ break;
+ case TPointerEvent::EButton2Down:
+ posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_RIGHT, 0, 0);
+ break;
+ case TPointerEvent::EButton2Up:
+ posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_RIGHT, 0, 0);
+ break;
+ case TPointerEvent::EButton3Down:
+ posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_MIDDLE, 0, 0);
+ break;
+ case TPointerEvent::EButton3Up:
+ posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_MIDDLE, 0, 0);
+ break;
+ } // switch
+ break;
+ }
+
+ case EEventKeyDown: /* Key events */
+ {
+#ifdef SYMBIAN_CRYSTAL
+ // special case: 9300/9500 rocker down, simulate left mouse button
+ if (aWsEvent.Key()->iScanCode == EStdKeyDeviceA)
+ {
+ const TPointerCursorMode mode = Private->EPOC_WsSession.PointerCursorMode();
+ if(mode != EPointerCursorNone)
+ posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_LEFT, 0, 0);
+ }
+#endif
+ (void*)TranslateKey(_this, aWsEvent.Key()->iScanCode, &keysym);
+
+#ifndef DISABLE_JOYSTICK
+ /* Special handling */
+ switch((int)keysym.sym) {
+ case SDLK_CAPSLOCK:
+ if (!isCursorVisible) {
+ /* Enable virtual cursor */
+ HAL::Set(HAL::EMouseState, HAL::EMouseState_Visible);
+ }
+ else {
+ /* Disable virtual cursor */
+ HAL::Set(HAL::EMouseState, HAL::EMouseState_Invisible);
+ }
+ isCursorVisible = !isCursorVisible;
+ break;
+ }
+#endif
+ posted += SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
+ break;
+ }
+
+ case EEventKeyUp: /* Key events */
+ {
+#ifdef SYMBIAN_CRYSTAL
+ // special case: 9300/9500 rocker up, simulate left mouse button
+ if (aWsEvent.Key()->iScanCode == EStdKeyDeviceA)
+ {
+ posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_LEFT, 0, 0);
+ }
+#endif
+ posted += SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(_this, aWsEvent.Key()->iScanCode, &keysym));
+ break;
+ }
+
+ case EEventFocusGained: /* SDL window got focus */
+ {
+ Private->EPOC_IsWindowFocused = ETrue;
+ posted += SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS);
+ /* Draw window background and screen buffer */
+ DisableKeyBlocking(_this); //Markus: guess why:-)
+
+ RedrawWindowL(_this);
+ break;
+ }
+
+ case EEventFocusLost: /* SDL window lost focus */
+ {
+/*
+ CFbsBitmap* bmp = new (ELeave) CFbsBitmap();
+ bmp->Create(Private->EPOC_ScreenSize, Private->EPOC_DisplayMode);
+ Private->EPOC_WsScreen->CopyScreenToBitmap(bmp);
+ Private->EPOC_WindowGc->Activate(Private->EPOC_WsWindow);
+ Private->EPOC_WsWindow.BeginRedraw(TRect(Private->EPOC_WsWindow.Size()));
+ Private->EPOC_WindowGc->BitBlt(TPoint(0, 0), bmp);
+ Private->EPOC_WsWindow.EndRedraw();
+ Private->EPOC_WindowGc->Deactivate();
+ bmp->Save(_L("C:\\scr.mbm"));
+ delete bmp;
+*/
+
+ Private->EPOC_IsWindowFocused = EFalse;
+
+ posted += SDL_PrivateAppActive(0, SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS);
+
+ RWsSession s;
+ s.Connect();
+ RWindowGroup g(s);
+ g.Construct(TUint32(&g), EFalse);
+ g.EnableReceiptOfFocus(EFalse);
+ RWindow w(s);
+ w.Construct(g, TUint32(&w));
+ w.SetExtent(TPoint(0, 0), Private->EPOC_WsWindow.Size());
+ w.SetOrdinalPosition(0);
+ w.Activate();
+ w.Close();
+ g.Close();
+ s.Close();
+
+/*
+ Private->EPOC_WsSession.SetWindowGroupOrdinalPosition(Private->EPOC_WsWindowGroupID, -1);
+
+
+ SDL_Delay(500);
+ TInt focus = -1;
+ while(focus < 0)
+ {
+ const TInt curr = Private->EPOC_WsSession.GetFocusWindowGroup();
+ if(curr != Private->EPOC_WsWindowGroupID)
+ focus = curr;
+ else
+ SDL_Delay(500);
+ }
+
+ if(1 < Private->EPOC_WsSession.GetWindowGroupOrdinalPriority(Private->EPOC_WsWindowGroupID))
+ {
+ Private->EPOC_WsSession.SetWindowGroupOrdinalPosition(focus, -1);
+ SDL_Delay(500);
+ Private->EPOC_WsSession.SetWindowGroupOrdinalPosition(focus, 0);
+ }
+*/
+ /*//and the request redraw
+ TRawEvent redrawEvent;
+ redrawEvent.Set(TRawEvent::ERedraw);
+ Private->EPOC_WsSession.SimulateRawEvent(redrawEvent);
+ Private->EPOC_WsSession.Flush();*/
+#if 0
+ //!! Not used
+ // Wait and eat events until focus is gained again
+ while (ETrue) {
+ Private->EPOC_WsSession.EventReady(&Private->EPOC_WsEventStatus);
+ User::WaitForRequest(Private->EPOC_WsEventStatus);
+ Private->EPOC_WsSession.GetEvent(Private->EPOC_WsEvent);
+ TInt eventType = Private->EPOC_WsEvent.Type();
+ Private->EPOC_WsEventStatus = KRequestPending;
+ //Private->EPOC_WsSession.EventReady(&Private->EPOC_WsEventStatus);
+ if (eventType == EEventFocusGained) {
+ RedrawWindowL(_this);
+ break;
+ }
+ }
+#endif
+ break;
+ }
+
+ case EEventModifiersChanged:
+ {
+ TModifiersChangedEvent* modEvent = aWsEvent.ModifiersChanged();
+ TUint modstate = KMOD_NONE;
+ if (modEvent->iModifiers == EModifierLeftShift)
+ modstate |= KMOD_LSHIFT;
+ if (modEvent->iModifiers == EModifierRightShift)
+ modstate |= KMOD_RSHIFT;
+ if (modEvent->iModifiers == EModifierLeftCtrl)
+ modstate |= KMOD_LCTRL;
+ if (modEvent->iModifiers == EModifierRightCtrl)
+ modstate |= KMOD_RCTRL;
+ if (modEvent->iModifiers == EModifierLeftAlt)
+ modstate |= KMOD_LALT;
+ if (modEvent->iModifiers == EModifierRightAlt)
+ modstate |= KMOD_RALT;
+ if (modEvent->iModifiers == EModifierLeftFunc)
+ modstate |= KMOD_LMETA;
+ if (modEvent->iModifiers == EModifierRightFunc)
+ modstate |= KMOD_RMETA;
+ if (modEvent->iModifiers == EModifierCapsLock)
+ modstate |= KMOD_CAPS;
+ SDL_SetModState(STATIC_CAST(SDLMod,(modstate | KMOD_LSHIFT)));
+ break;
+ }
+ default:
+ break;
+ }
+
+ return posted;
+}
+
+extern "C" {
+
+void EPOC_PumpEvents(_THIS)
+{
+ int posted = 0; // !! Do we need this?
+ //Private->EPOC_WsSession.EventReady(&Private->EPOC_WsEventStatus);
+ while (Private->EPOC_WsEventStatus != KRequestPending) {
+
+ Private->EPOC_WsSession.GetEvent(Private->EPOC_WsEvent);
+ posted = EPOC_HandleWsEvent(_this, Private->EPOC_WsEvent);
+ Private->EPOC_WsEventStatus = KRequestPending;
+ Private->EPOC_WsSession.EventReady(&Private->EPOC_WsEventStatus);
+ }
+}
+
+
+_LIT(KMapFileName, "C:\\sdl_info\\sdlkeymap.cfg");
+LOCAL_C void ReadL(RFs& aFs, RArray<TInt>& aArray)
+ {
+ TInt drive = -1;
+ TFileName name(KMapFileName);
+ for(TInt i = 'z'; drive < 0 && i >= 'a'; i--)
+ {
+ name[0] = (TUint16)i;
+ if(BaflUtils::FileExists(aFs, name))
+ drive = i;
+ }
+ if(drive < 0)
+ return;
+ CLineReader* reader = CLineReader::NewLC(aFs, name);
+ while(reader->NextL())
+ {
+ TPtrC ln = reader->Current();
+ TLex line(ln);
+ TInt n = 0;
+ for(;;)
+ {
+ const TPtrC token = line.NextToken();
+ if(token.Length() == 0)
+ break;
+ if((n & 1) != 0)
+ {
+ TInt value;
+ TLex lex(token);
+ User::LeaveIfError(lex.Val(value));
+ User::LeaveIfError(aArray.Append(value));
+ }
+ n++;
+ }
+ }
+ CleanupStack::PopAndDestroy();
+ }
+
+
+void EPOC_InitOSKeymap(_THIS)
+{
+ int i;
+
+ /* Initialize the key translation table */
+ for ( i=0; i<SDL_TABLESIZE(keymap); ++i )
+ keymap[i] = SDLK_UNKNOWN;
+
+
+ /* Numbers */
+ for ( i = 0; i<32; ++i ){
+ keymap[' ' + i] = (SDLKey)(SDLK_SPACE+i);
+ }
+ /* e.g. Alphabet keys */
+ for ( i = 0; i<32; ++i ){
+ keymap['A' + i] = (SDLKey)(SDLK_a+i);
+ }
+
+ keymap[EStdKeyBackspace] = SDLK_BACKSPACE;
+ keymap[EStdKeyTab] = SDLK_TAB;
+ keymap[EStdKeyEnter] = SDLK_RETURN;
+ keymap[EStdKeyEscape] = SDLK_ESCAPE;
+ keymap[EStdKeySpace] = SDLK_SPACE;
+ keymap[EStdKeyPause] = SDLK_PAUSE;
+ keymap[EStdKeyHome] = SDLK_HOME;
+ keymap[EStdKeyEnd] = SDLK_END;
+ keymap[EStdKeyPageUp] = SDLK_PAGEUP;
+ keymap[EStdKeyPageDown] = SDLK_PAGEDOWN;
+ keymap[EStdKeyDelete] = SDLK_DELETE;
+ keymap[EStdKeyUpArrow] = SDLK_UP;
+ keymap[EStdKeyDownArrow] = SDLK_DOWN;
+ keymap[EStdKeyLeftArrow] = SDLK_LEFT;
+ keymap[EStdKeyRightArrow] = SDLK_RIGHT;
+ keymap[EStdKeyCapsLock] = SDLK_CAPSLOCK;
+ keymap[EStdKeyLeftShift] = SDLK_LSHIFT;
+ keymap[EStdKeyRightShift] = SDLK_RSHIFT;
+ keymap[EStdKeyLeftAlt] = SDLK_LALT;
+ keymap[EStdKeyRightAlt] = SDLK_RALT;
+ keymap[EStdKeyLeftCtrl] = SDLK_LCTRL;
+ keymap[EStdKeyRightCtrl] = SDLK_RCTRL;
+ keymap[EStdKeyLeftFunc] = SDLK_LMETA;
+ keymap[EStdKeyRightFunc] = SDLK_RMETA;
+ keymap[EStdKeyInsert] = SDLK_INSERT;
+ keymap[EStdKeyComma] = SDLK_COMMA;
+ keymap[EStdKeyFullStop] = SDLK_PERIOD;
+ keymap[EStdKeyForwardSlash] = SDLK_SLASH;
+ keymap[EStdKeyBackSlash] = SDLK_BACKSLASH;
+ keymap[EStdKeySemiColon] = SDLK_SEMICOLON;
+ keymap[EStdKeySingleQuote] = SDLK_QUOTE;
+ keymap[EStdKeyHash] = SDLK_HASH;
+ keymap[EStdKeySquareBracketLeft] = SDLK_LEFTBRACKET;
+ keymap[EStdKeySquareBracketRight] = SDLK_RIGHTBRACKET;
+ keymap[EStdKeyMinus] = SDLK_MINUS;
+ keymap[EStdKeyEquals] = SDLK_EQUALS;
+
+ keymap[EStdKeyF1] = SDLK_F1; /* chr + q */
+ keymap[EStdKeyF2] = SDLK_F2; /* chr + w */
+ keymap[EStdKeyF3] = SDLK_F3; /* chr + e */
+ keymap[EStdKeyF4] = SDLK_F4; /* chr + r */
+ keymap[EStdKeyF5] = SDLK_F5; /* chr + t */
+ keymap[EStdKeyF6] = SDLK_F6; /* chr + y */
+ keymap[EStdKeyF7] = SDLK_F7; /* chr + i */
+ keymap[EStdKeyF8] = SDLK_F8; /* chr + o */
+
+ keymap[EStdKeyF9] = SDLK_F9; /* chr + a */
+ keymap[EStdKeyF10] = SDLK_F10; /* chr + s */
+ keymap[EStdKeyF11] = SDLK_F11; /* chr + d */
+ keymap[EStdKeyF12] = SDLK_F12; /* chr + f */
+
+ #ifndef SYMBIAN_CRYSTAL
+ //!!7650 additions
+ #ifdef __WINS__
+ keymap[EStdKeyXXX] = SDLK_RETURN; /* "fire" key */
+ #else
+ keymap[EStdKeyDevice3] = SDLK_RETURN; /* "fire" key */
+ #endif
+ keymap[EStdKeyNkpAsterisk] = SDLK_ASTERISK;
+ keymap[EStdKeyYes] = SDLK_HOME; /* "call" key */
+ keymap[EStdKeyNo] = SDLK_END; /* "end call" key */
+ keymap[EStdKeyDevice0] = SDLK_SPACE; /* right menu key */
+ keymap[EStdKeyDevice1] = SDLK_ESCAPE; /* left menu key */
+ keymap[EStdKeyDevice2] = SDLK_POWER; /* power key */
+ #endif
+
+ #ifdef SYMBIAN_CRYSTAL
+ keymap[EStdKeyMenu] = SDLK_ESCAPE; // menu key
+ keymap[EStdKeyDevice6] = SDLK_LEFT; // Rocker (joystick) left
+ keymap[EStdKeyDevice7] = SDLK_RIGHT; // Rocker (joystick) right
+ keymap[EStdKeyDevice8] = SDLK_UP; // Rocker (joystick) up
+ keymap[EStdKeyDevice9] = SDLK_DOWN; // Rocker (joystick) down
+ keymap[EStdKeyLeftFunc] = SDLK_LALT; //chr?
+ keymap[EStdKeyRightFunc] = SDLK_RALT;
+ keymap[EStdKeyDeviceA] = SDLK_RETURN; /* "fire" key */
+#endif
+
+ ///////////////////////////////////////////////////////////
+
+ RFs fs;
+ if(KErrNone == fs.Connect())
+ {
+ RArray<TInt> array;
+ TRAPD(err, ReadL(fs, array));
+ if(err == KErrNone && array.Count() > 0)
+ {
+
+ SDLKey temp[MAX_SCANCODE];
+ Mem::Copy(temp, keymap, MAX_SCANCODE * sizeof(SDLKey));
+
+ for(TInt k = 0; k < array.Count(); k+= 2)
+ {
+ const TInt oldval = array[k];
+ const TInt newval = array[k + 1];
+ if(oldval >= 0 && oldval < MAX_SCANCODE && newval >= 0 && newval < MAX_SCANCODE)
+ {
+ keymap[oldval] = temp[newval];
+ }
+ }
+ }
+ array.Close();
+ }
+
+ fs.Close();
+ ///////////////////////////////////////////////////////////
+
+ /* !!TODO
+ EStdKeyNumLock=0x1b,
+ EStdKeyScrollLock=0x1c,
+
+ EStdKeyNkpForwardSlash=0x84,
+ EStdKeyNkpAsterisk=0x85,
+ EStdKeyNkpMinus=0x86,
+ EStdKeyNkpPlus=0x87,
+ EStdKeyNkpEnter=0x88,
+ EStdKeyNkp1=0x89,
+ EStdKeyNkp2=0x8a,
+ EStdKeyNkp3=0x8b,
+ EStdKeyNkp4=0x8c,
+ EStdKeyNkp5=0x8d,
+ EStdKeyNkp6=0x8e,
+ EStdKeyNkp7=0x8f,
+ EStdKeyNkp8=0x90,
+ EStdKeyNkp9=0x91,
+ EStdKeyNkp0=0x92,
+ EStdKeyNkpFullStop=0x93,
+ EStdKeyMenu=0x94,
+ EStdKeyBacklightOn=0x95,
+ EStdKeyBacklightOff=0x96,
+ EStdKeyBacklightToggle=0x97,
+ EStdKeyIncContrast=0x98,
+ EStdKeyDecContrast=0x99,
+ EStdKeySliderDown=0x9a,
+ EStdKeySliderUp=0x9b,
+ EStdKeyDictaphonePlay=0x9c,
+ EStdKeyDictaphoneStop=0x9d,
+ EStdKeyDictaphoneRecord=0x9e,
+ EStdKeyHelp=0x9f,
+ EStdKeyOff=0xa0,
+ EStdKeyDial=0xa1,
+ EStdKeyIncVolume=0xa2,
+ EStdKeyDecVolume=0xa3,
+ EStdKeyDevice0=0xa4,
+ EStdKeyDevice1=0xa5,
+ EStdKeyDevice2=0xa6,
+ EStdKeyDevice3=0xa7,
+ EStdKeyDevice4=0xa8,
+ EStdKeyDevice5=0xa9,
+ EStdKeyDevice6=0xaa,
+ EStdKeyDevice7=0xab,
+ EStdKeyDevice8=0xac,
+ EStdKeyDevice9=0xad,
+ EStdKeyDeviceA=0xae,
+ EStdKeyDeviceB=0xaf,
+ EStdKeyDeviceC=0xb0,
+ EStdKeyDeviceD=0xb1,
+ EStdKeyDeviceE=0xb2,
+ EStdKeyDeviceF=0xb3,
+ EStdKeyApplication0=0xb4,
+ EStdKeyApplication1=0xb5,
+ EStdKeyApplication2=0xb6,
+ EStdKeyApplication3=0xb7,
+ EStdKeyApplication4=0xb8,
+ EStdKeyApplication5=0xb9,
+ EStdKeyApplication6=0xba,
+ EStdKeyApplication7=0xbb,
+ EStdKeyApplication8=0xbc,
+ EStdKeyApplication9=0xbd,
+ EStdKeyApplicationA=0xbe,
+ EStdKeyApplicationB=0xbf,
+ EStdKeyApplicationC=0xc0,
+ EStdKeyApplicationD=0xc1,
+ EStdKeyApplicationE=0xc2,
+ EStdKeyApplicationF=0xc3,
+ EStdKeyYes=0xc4,
+ EStdKeyNo=0xc5,
+ EStdKeyIncBrightness=0xc6,
+ EStdKeyDecBrightness=0xc7,
+ EStdKeyCaseOpen=0xc8,
+ EStdKeyCaseClose=0xc9
+ */
+
+}
+
+
+
+static SDL_keysym *TranslateKey(_THIS, int scancode, SDL_keysym *keysym)
+{
+// char debug[256];
+ //SDL_TRACE1("SDL: TranslateKey, scancode=%d", scancode); //!!
+
+ /* Set the keysym information */
+
+ keysym->scancode = scancode;
+
+ if ((scancode >= MAX_SCANCODE) &&
+ ((scancode - ENonCharacterKeyBase + 0x0081) >= MAX_SCANCODE)) {
+ SDL_SetError("Too big scancode");
+ keysym->scancode = SDLK_UNKNOWN;
+ keysym->mod = KMOD_NONE;
+ return keysym;
+ }
+
+ keysym->mod = SDL_GetModState();
+
+ /* Handle function keys: F1, F2, F3 ... */
+ if (keysym->mod & KMOD_META) {
+ if (scancode >= 'A' && scancode < ('A' + 24)) { /* first 32 alphabet keys */
+ switch(scancode) {
+ case 'Q': scancode = EStdKeyF1; break;
+ case 'W': scancode = EStdKeyF2; break;
+ case 'E': scancode = EStdKeyF3; break;
+ case 'R': scancode = EStdKeyF4; break;
+ case 'T': scancode = EStdKeyF5; break;
+ case 'Y': scancode = EStdKeyF6; break;
+ case 'U': scancode = EStdKeyF7; break;
+ case 'I': scancode = EStdKeyF8; break;
+ case 'A': scancode = EStdKeyF9; break;
+ case 'S': scancode = EStdKeyF10; break;
+ case 'D': scancode = EStdKeyF11; break;
+ case 'F': scancode = EStdKeyF12; break;
+ }
+ keysym->sym = keymap[scancode];
+ }
+ }
+
+ if (scancode >= ENonCharacterKeyBase) {
+ // Non character keys
+ keysym->sym = keymap[scancode -
+ ENonCharacterKeyBase + 0x0081]; // !!hard coded
+ } else {
+ keysym->sym = keymap[scancode];
+ }
+
+ /* Remap the arrow keys if the device is rotated */
+ if (Private->EPOC_ScreenOrientation == CFbsBitGc::EGraphicsOrientationRotated270) {
+ switch(keysym->sym) {
+ case SDLK_UP: keysym->sym = SDLK_LEFT; break;
+ case SDLK_DOWN: keysym->sym = SDLK_RIGHT; break;
+ case SDLK_LEFT: keysym->sym = SDLK_DOWN; break;
+ case SDLK_RIGHT:keysym->sym = SDLK_UP; break;
+ }
+ }
+
+ /* If UNICODE is on, get the UNICODE value for the key */
+ keysym->unicode = 0;
+
+#if 0 // !!TODO:unicode
+
+ if ( SDL_TranslateUNICODE )
+ {
+ /* Populate the unicode field with the ASCII value */
+ keysym->unicode = scancode;
+ }
+#endif
+
+ //!!
+ //sprintf(debug, "SDL: TranslateKey: keysym->scancode=%d, keysym->sym=%d, keysym->mod=%d",
+ // keysym->scancode, keysym->sym, keysym->mod);
+ //SDL_TRACE(debug); //!!
+
+ return(keysym);
+}
+
+}; /* extern "C" */
+
+
diff --git a/distrib/sdl-1.2.15/src/video/symbian/EKA1/SDL_epocvideo.cpp b/distrib/sdl-1.2.15/src/video/symbian/EKA1/SDL_epocvideo.cpp
new file mode 100644
index 0000000..06874d5
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/symbian/EKA1/SDL_epocvideo.cpp
@@ -0,0 +1,1356 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@devolution.com
+*/
+
+/*
+ SDL_epocvideo.cpp
+ Epoc based SDL video driver implementation
+
+ Thanks to Peter van Sebille, the author of EMame. It is a great example of
+ low level graphics coding in Epoc.
+
+ Epoc version by Hannu Viitala (hannu.j.viitala@mbnet.fi)
+ Assembler routines by Kimmo Kinnunen
+*/
+
+
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+extern "C" {
+#include "SDL_error.h"
+#include "SDL_timer.h"
+#include "SDL_video.h"
+#undef NULL
+#include "SDL_pixels_c.h"
+#include "SDL.h"
+};
+
+#include "SDL_epocvideo.h"
+#include "SDL_epocevents_c.h"
+
+#include "sdl_epocruntime.h"
+
+#include <hal.h>
+#include <coedef.h>
+#include <flogger.h>
+
+#ifdef SYMBIAN_QUARTZ
+SDL_VideoDevice* _thisDevice;
+#endif
+
+_LIT(KLibName, "SDL");
+
+/* For debugging */
+
+//if old SOS, from 7.x this is public!
+class CLockable : public CFbsBitmap
+ {
+ public:
+ static CLockable* Lockable(CFbsBitmap* aBmp) {return static_cast<CLockable*>(aBmp);}
+ void Lock() {LockHeap();}
+ void Unlock() {UnlockHeap();}
+ };
+#define LockHeap(x) CLockable::Lockable(x)->Lock()
+#define UnlockHeap(x) CLockable::Lockable(x)->Unlock()
+
+void RDebug_Print_b(char* error_str, void* param)
+ {
+ TBuf8<128> error8((TUint8*)error_str);
+ TBuf<128> error;
+ error.Copy(error8);
+
+#ifndef TRACE_TO_FILE
+ if (param) //!! Do not work if the parameter is really 0!!
+ RDebug::Print(error, param);
+ else
+ RDebug::Print(error);
+#else
+ if (param) //!! Do not work if the parameter is really 0!!
+ RFileLogger::WriteFormat(KLibName, _L("SDL.txt"), EFileLoggingModeAppend, error, param);
+ else
+ RFileLogger::Write(KLibName, _L("SDL.txt"), EFileLoggingModeAppend, error);
+#endif
+
+ }
+
+extern "C" void RDebug_Print(char* error_str, void* param)
+ {
+ RDebug_Print_b(error_str, param);
+ }
+
+
+int Debug_AvailMem2()
+ {
+ //User::CompressAllHeaps();
+ TMemoryInfoV1Buf membuf;
+ User::LeaveIfError(UserHal::MemoryInfo(membuf));
+ TMemoryInfoV1 minfo = membuf();
+ return(minfo.iFreeRamInBytes);
+ }
+
+extern "C" int Debug_AvailMem()
+ {
+ return(Debug_AvailMem2());
+ }
+
+
+extern "C" {
+
+/* Initialization/Query functions */
+
+static int EPOC_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **EPOC_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *EPOC_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int EPOC_SetColors(_THIS, int firstcolor, int ncolors,
+ SDL_Color *colors);
+static void EPOC_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+
+static int EPOC_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int EPOC_LockHWSurface(_THIS, SDL_Surface *surface);
+static int EPOC_FlipHWSurface(_THIS, SDL_Surface *surface);
+static void EPOC_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void EPOC_FreeHWSurface(_THIS, SDL_Surface *surface);
+static void EPOC_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
+
+static int EPOC_Available(void);
+static SDL_VideoDevice *EPOC_CreateDevice(int devindex);
+
+void DrawBackground(_THIS);
+void DirectDraw(_THIS, int numrects, SDL_Rect *rects, TUint16* screenBuffer);
+void DirectDrawRotated(_THIS, int numrects, SDL_Rect *rects, TUint16* screenBuffer);
+
+/* Mouse functions */
+
+static WMcursor *EPOC_CreateWMCursor(_THIS, Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
+static void EPOC_FreeWMCursor(_THIS, WMcursor *cursor);
+static int EPOC_ShowWMCursor(_THIS, WMcursor *cursor);
+
+
+
+/* !!For 12 bit screen HW. Table for fast conversion from 8 bit to 12 bit */
+// TUint16 is enough, but using TUint32 so we can use better instruction selection on ARMI
+static TUint32 EPOC_HWPalette_256_to_Screen[256];
+
+VideoBootStrap EPOC_bootstrap = {
+ "epoc", "EPOC system",
+ EPOC_Available, EPOC_CreateDevice
+};
+
+const TUint32 WindowClientHandle = 9210; //!! const
+
+/* Epoc video driver bootstrap functions */
+
+static int EPOC_Available(void)
+{
+ return 1; /* Always available */
+}
+
+static void EPOC_DeleteDevice(SDL_VideoDevice *device)
+{
+ free(device->hidden);
+ free(device);
+}
+
+static SDL_VideoDevice *EPOC_CreateDevice(int /*devindex*/)
+{
+ SDL_VideoDevice *device;
+
+ SDL_TRACE("SDL:EPOC_CreateDevice");
+
+ /* Allocate all variables that we free on delete */
+ device = (SDL_VideoDevice *)malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ malloc((sizeof *device->hidden));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( device ) {
+ free(device);
+ }
+ return(0);
+ }
+ memset(device->hidden, 0, (sizeof *device->hidden));
+
+ /* Set the function pointers */
+ device->VideoInit = EPOC_VideoInit;
+ device->ListModes = EPOC_ListModes;
+ device->SetVideoMode = EPOC_SetVideoMode;
+ device->SetColors = EPOC_SetColors;
+ device->UpdateRects = NULL;
+ device->VideoQuit = EPOC_VideoQuit;
+ device->AllocHWSurface = EPOC_AllocHWSurface;
+ device->CheckHWBlit = NULL;
+ device->FillHWRect = NULL;
+ device->SetHWColorKey = NULL;
+ device->SetHWAlpha = NULL;
+ device->LockHWSurface = EPOC_LockHWSurface;
+ device->UnlockHWSurface = EPOC_UnlockHWSurface;
+ device->FlipHWSurface = EPOC_FlipHWSurface;
+ device->FreeHWSurface = EPOC_FreeHWSurface;
+ device->SetIcon = NULL;
+ device->SetCaption = NULL;
+ device->GetWMInfo = NULL;
+ device->FreeWMCursor = EPOC_FreeWMCursor;
+ device->CreateWMCursor = EPOC_CreateWMCursor;
+ device->ShowWMCursor = EPOC_ShowWMCursor;
+ device->WarpWMCursor = NULL;
+ device->InitOSKeymap = EPOC_InitOSKeymap;
+ device->PumpEvents = EPOC_PumpEvents;
+ device->free = EPOC_DeleteDevice;
+
+ return device;
+}
+
+
+int GetBpp(TDisplayMode displaymode)
+{
+ /*TInt numColors = TDisplayModeUtils::NumDisplayModeColors(displaymode);
+ TInt bitsPerPixel = 1;
+ for (TInt32 i = 2; i < numColors; i <<= 1, bitsPerPixel++);
+ return bitsPerPixel;*/
+ return TDisplayModeUtils::NumDisplayModeBitsPerPixel(displaymode);
+}
+
+
+void DisableKeyBlocking(_THIS)
+ {
+ // Disable key blocking
+ TRawEvent event;
+ event.Set((TRawEvent::TType)/*EDisableKeyBlock*/51); // !!EDisableKeyBlock not found in epoc32\include!
+ Private->EPOC_WsSession.SimulateRawEvent(event);
+ }
+
+void ConstructWindowL(_THIS)
+{
+ TInt error;
+
+ SDL_TRACE("SDL:ConstructWindowL");
+ error = Private->EPOC_WsSession.Connect();
+ User::LeaveIfError(error);
+ Private->EPOC_WsScreen=new(ELeave) CWsScreenDevice(Private->EPOC_WsSession);
+ User::LeaveIfError(Private->EPOC_WsScreen->Construct());
+ User::LeaveIfError(Private->EPOC_WsScreen->CreateContext(Private->EPOC_WindowGc));
+
+ Private->EPOC_WsWindowGroup=RWindowGroup(Private->EPOC_WsSession);
+ User::LeaveIfError(Private->EPOC_WsWindowGroup.Construct(WindowClientHandle));
+ Private->EPOC_WsWindowGroup.SetOrdinalPosition(0);
+
+ // Set window group name (the same as process name)) !!Gives always "EPOC" in WINS
+ RProcess thisProcess;
+ TParse exeName;
+ exeName.Set(thisProcess.FileName(), NULL, NULL);
+ TBuf<32> winGroupName;
+ winGroupName.Append(0);
+ winGroupName.Append(0);
+ winGroupName.Append(0);// uid
+ winGroupName.Append(0);
+ winGroupName.Append(exeName.Name()); // caption
+ winGroupName.Append(0);
+ winGroupName.Append(0); //doc name
+ Private->EPOC_WsWindowGroup.SetName(winGroupName);
+
+ Private->EPOC_WsWindow=RWindow(Private->EPOC_WsSession);
+ // Markus, it was:
+ // User::LeaveIfError(Private->EPOC_WsWindow.Construct(Private->EPOC_WsWindowGroup,WindowClientHandle ));
+ // but SOS 7.0s debug does not accept same window handle twice
+ User::LeaveIfError(Private->EPOC_WsWindow.Construct(Private->EPOC_WsWindowGroup,WindowClientHandle - 1));
+ Private->EPOC_WsWindow.SetBackgroundColor(KRgbWhite);
+ Private->EPOC_WsWindow.Activate();
+ Private->EPOC_WsWindow.SetSize(Private->EPOC_WsScreen->SizeInPixels());
+ Private->EPOC_WsWindow.SetVisible(ETrue);
+
+ Private->EPOC_WsWindowGroupID = Private->EPOC_WsWindowGroup.Identifier();
+ Private->EPOC_IsWindowFocused = EFalse;
+
+ DisableKeyBlocking(_this); //disable key blocking
+}
+
+int EPOC_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ // !!TODO:handle leave functions!
+
+ int i;
+
+ SDL_TRACE("SDL:EPOC_VideoInit");
+
+ /* Initialize all variables that we clean on shutdown */
+
+ for ( i=0; i<SDL_NUMMODES; ++i ) {
+ Private->SDL_modelist[i] = (SDL_Rect *)malloc(sizeof(SDL_Rect));
+ Private->SDL_modelist[i]->x = Private->SDL_modelist[i]->y = 0;
+ }
+
+ /* Modes sorted largest to smallest */
+ Private->SDL_modelist[0]->w = 800; Private->SDL_modelist[0]->h = 250;
+ Private->SDL_modelist[1]->w = 640; Private->SDL_modelist[1]->h = 480;
+ Private->SDL_modelist[2]->w = 480; Private->SDL_modelist[2]->h = 600;
+ Private->SDL_modelist[3]->w = 640; Private->SDL_modelist[3]->h = 400;
+ Private->SDL_modelist[4]->w = 352; Private->SDL_modelist[4]->h = 416;
+ Private->SDL_modelist[5]->w = 416; Private->SDL_modelist[5]->h = 352;
+ Private->SDL_modelist[6]->w = 416; Private->SDL_modelist[6]->h = 312;
+ Private->SDL_modelist[7]->w = 352; Private->SDL_modelist[7]->h = 264;
+ Private->SDL_modelist[8]->w = 800; Private->SDL_modelist[8]->h = 240; //for doom all these..
+ Private->SDL_modelist[9]->w = 640; Private->SDL_modelist[9]->h = 240;
+ Private->SDL_modelist[10]->w = 480; Private->SDL_modelist[10]->h = 240;
+ Private->SDL_modelist[11]->w = 640; Private->SDL_modelist[11]->h = 240;
+ Private->SDL_modelist[12]->w = 352; Private->SDL_modelist[12]->h = 240;
+ Private->SDL_modelist[13]->w = 416; Private->SDL_modelist[13]->h = 240;
+ Private->SDL_modelist[14]->w = 416; Private->SDL_modelist[14]->h = 240;
+ Private->SDL_modelist[15]->w = 352; Private->SDL_modelist[15]->h = 240;
+ Private->SDL_modelist[16]->w = 640; Private->SDL_modelist[16]->h = 200;
+ Private->SDL_modelist[17]->w = 320; Private->SDL_modelist[17]->h = 240; //...for doom, currently engine renders no-higher windows :-(, propably should get fixed
+ Private->SDL_modelist[18]->w = 320; Private->SDL_modelist[18]->h = 200;
+ Private->SDL_modelist[19]->w = 256; Private->SDL_modelist[19]->h = 192;
+ Private->SDL_modelist[20]->w = 176; Private->SDL_modelist[20]->h = 208;
+ Private->SDL_modelist[21]->w = 208; Private->SDL_modelist[21]->h = 176; // Rotated
+ Private->SDL_modelist[22]->w = 160; Private->SDL_modelist[22]->h = 144;
+
+ Private->SDL_modelist[23]->w = 640; Private->SDL_modelist[2]->h = 200; //s80 some new modes
+ Private->SDL_modelist[24]->w = 640; Private->SDL_modelist[2]->h = 320; //s90 modes are added
+ Private->SDL_modelist[25]->w = 640; Private->SDL_modelist[2]->h = 240; //here
+ Private->SDL_modelist[26]->w = 640; Private->SDL_modelist[4]->h = 200; //now
+
+ Private->SDL_modelist[27] = NULL;
+
+ /* Construct Epoc window */
+
+ ConstructWindowL(_this);
+
+ /* Initialise Epoc frame buffer */
+
+ TDisplayMode displayMode = Private->EPOC_WsScreen->DisplayMode();
+
+#if !defined(__WINS__) && !defined(TEST_BM_DRAW)
+
+ TScreenInfoV01 screenInfo;
+ TPckg<TScreenInfoV01> sInfo(screenInfo);
+ UserSvr::ScreenInfo(sInfo);
+
+ Private->EPOC_ScreenSize = screenInfo.iScreenSize;
+ Private->EPOC_DisplayMode = displayMode;
+ Private->EPOC_HasFrameBuffer = screenInfo.iScreenAddressValid;
+ Private->EPOC_FrameBuffer = Private->EPOC_HasFrameBuffer ? (TUint8*) screenInfo.iScreenAddress : NULL;
+ Private->EPOC_BytesPerPixel = ((GetBpp(displayMode)-1) / 8) + 1;
+
+ Private->EPOC_BytesPerScanLine = screenInfo.iScreenSize.iWidth * Private->EPOC_BytesPerPixel;
+ Private->EPOC_BytesPerScreen = Private->EPOC_BytesPerScanLine * Private->EPOC_ScreenSize.iHeight;
+
+ SDL_TRACE1("Screen width %d", screenInfo.iScreenSize.iWidth);
+ SDL_TRACE1("Screen height %d", screenInfo.iScreenSize.iHeight);
+ SDL_TRACE1("Screen dmode %d", displayMode);
+ SDL_TRACE1("Screen valid %d", screenInfo.iScreenAddressValid);
+
+ SDL_TRACE1("bpp %d", Private->EPOC_BytesPerPixel);
+ SDL_TRACE1("bpsl %d", Private->EPOC_BytesPerScanLine);
+ SDL_TRACE1("bps %d", Private->EPOC_BytesPerScreen);
+
+
+ /* It seems that in SA1100 machines for 8bpp displays there is a 512 palette table at the
+ * beginning of the frame buffer. E.g. Series 7 and Netbook.
+ * In 12 bpp machines the table has 16 entries.
+ */
+ if (Private->EPOC_HasFrameBuffer && GetBpp(displayMode) == 8)
+ {
+ Private->EPOC_FrameBuffer += 512;
+ }
+ else
+ {
+ Private->EPOC_FrameBuffer += 32;
+ }
+ /*if (Private->EPOC_HasFrameBuffer && GetBpp(displayMode) == 12)
+ Private->EPOC_FrameBuffer += 16 * 2;
+ if (Private->EPOC_HasFrameBuffer && GetBpp(displayMode) == 16)
+ Private->EPOC_FrameBuffer += 16 * 2;
+ */
+#else /* defined __WINS__ */
+
+ /* Create bitmap, device and context for screen drawing */
+ Private->EPOC_ScreenSize = Private->EPOC_WsScreen->SizeInPixels();
+
+ Private->EPOC_Bitmap = new (ELeave) CWsBitmap(Private->EPOC_WsSession);
+ Private->EPOC_Bitmap->Create(Private->EPOC_ScreenSize, displayMode);
+
+ Private->EPOC_DisplayMode = displayMode;
+ Private->EPOC_HasFrameBuffer = ETrue;
+ Private->EPOC_FrameBuffer = NULL; /* Private->EPOC_Bitmap->DataAddress() can change any time */
+ Private->EPOC_BytesPerPixel = ((GetBpp(displayMode)-1) / 8) + 1;
+ Private->EPOC_BytesPerScanLine = Private->EPOC_WsScreen->SizeInPixels().iWidth * Private->EPOC_BytesPerPixel;
+
+#endif /* __WINS__ */
+
+#ifndef SYMBIAN_CRYSTAL
+ // Get draw device for updating the screen
+ TScreenInfoV01 screenInfo2;
+
+ Epoc_Runtime::GetScreenInfo(screenInfo2);
+
+ TRAPD(status, Private->EPOC_DrawDevice = CFbsDrawDevice::NewScreenDeviceL(screenInfo2, displayMode));
+ User::LeaveIfError(status);
+#endif
+
+ /* The "best" video format should be returned to caller. */
+
+ vformat->BitsPerPixel = /*!!GetBpp(displayMode) */ 8;
+ vformat->BytesPerPixel = /*!!Private->EPOC_BytesPerPixel*/ 1;
+
+ /* Activate events for me */
+
+ Private->EPOC_WsEventStatus = KRequestPending;
+ Private->EPOC_WsSession.EventReady(&Private->EPOC_WsEventStatus);
+
+ SDL_TRACE("SDL:WsEventStatus");
+ User::WaitForRequest(Private->EPOC_WsEventStatus); //Markus: I added this and ...
+
+ Private->EPOC_RedrawEventStatus = KRequestPending;
+ Private->EPOC_WsSession.RedrawReady(&Private->EPOC_RedrawEventStatus);
+
+ SDL_TRACE("SDL:RedrawEventStatus");
+ User::WaitForRequest(Private->EPOC_RedrawEventStatus); //...this, if not catches a stray event is risen
+ //if there are active objects used, or confucing
+ //actions with User::WaitForAnyRequest
+ Private->EPOC_WsWindow.PointerFilter(EPointerFilterDrag, 0);
+
+ Private->EPOC_ScreenOffset = TPoint(0, 0);
+
+#if defined(__WINS__) || defined(TEST_BM_DRAW)
+ LockHeap(Private->EPOC_Bitmap); // Lock bitmap heap
+#endif
+
+ SDL_TRACE("SDL:DrawBackground");
+ DrawBackground(_this); // Clear screen
+
+#if defined(__WINS__) || defined(TEST_BM_DRAW)
+ UnlockHeap(Private->EPOC_Bitmap); // Unlock bitmap heap
+#endif
+ //!! TODO: error handling
+ //if (ret != KErrNone)
+ // return(-1);
+ //else
+ return(0);
+}
+
+
+SDL_Rect **EPOC_ListModes(_THIS, SDL_PixelFormat *format, Uint32 /*flags*/)
+{
+ if (format->BitsPerPixel == 12 || format->BitsPerPixel == 8)
+ return Private->SDL_modelist;
+ return NULL;
+}
+
+int EPOC_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ if ((firstcolor+ncolors) > 256)
+ return -1;
+// SDL_TRACE1("colors %d", (TDisplayModeUtils::NumDisplayModeColors(Private->EPOC_DisplayMode)));
+ if(TDisplayModeUtils::NumDisplayModeColors(Private->EPOC_DisplayMode) == 4096)
+ {
+ // Set 12 bit palette
+ for(int i = firstcolor; i < ncolors; i++)
+ {
+ // 4k value: 0000 rrrr gggg bbbb
+ TUint32 color4K = (colors[i].r & 0x0000f0) << 4;
+ color4K |= (colors[i].g & 0x0000f0);
+ color4K |= (colors[i].b & 0x0000f0) >> 4;
+ EPOC_HWPalette_256_to_Screen[i] = color4K;
+ }
+ }
+ else if(TDisplayModeUtils::NumDisplayModeColors(Private->EPOC_DisplayMode) == 65536)
+ {
+ for(int i = firstcolor; i < ncolors; i++)
+ {
+ // 64k-colour displays effectively support RGB values
+ // with 5 bits allocated to red, 6 to green and 5 to blue
+ // 64k value: rrrr rggg gggb bbbb
+ TUint32 color64K = (colors[i].r & 0x0000f8) << 8;
+ color64K |= (colors[i].g & 0x0000fc) << 3;
+ color64K |= (colors[i].b & 0x0000f8) >> 3;
+ EPOC_HWPalette_256_to_Screen[i] = color64K;
+ }
+ }
+ else if(TDisplayModeUtils::NumDisplayModeColors(Private->EPOC_DisplayMode) == 16777216)
+ {
+ for(int i = firstcolor; i < ncolors; i++)
+ {
+ // 16M-colour
+ //0000 0000 rrrr rrrr gggg gggg bbbb bbbb
+ TUint32 color16M = colors[i].r << 16;
+ color16M |= colors[i].g << 8;
+ color16M |= colors[i].b;
+ EPOC_HWPalette_256_to_Screen[i] = color16M;
+ }
+ }
+ else
+ {
+ return -2;
+ }
+ return(0);
+}
+
+
+SDL_Surface *EPOC_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 /*flags*/)
+{
+ SDL_TRACE("SDL:EPOC_SetVideoMode");
+ /* Check parameters */
+#ifdef SYMBIAN_CRYSTAL
+ if (! (bpp == 8 || bpp == 12 || bpp == 16) &&
+ (
+ (width == 640 && height == 200) ||
+ (width == 640 && height == 400) ||
+ (width == 640 && height == 480) ||
+ (width == 320 && height == 200) ||
+ (width == 320 && height == 240)
+ )) {
+ SDL_SetError("Requested video mode is not supported");
+ return NULL;
+ }
+#else // SYMBIAN_SERIES60
+ if (! (bpp == 8 || bpp == 12 || bpp == 16) &&
+ (
+ (width == 320 && height == 200) ||
+ (width == 320 && height == 240) ||
+ (width == 256 && height == 192) ||
+ (width == 176 && height == 208) ||
+ (width == 208 && height == 176) || // Rotated
+ (width == 160 && height == 144)
+ )) {
+ SDL_SetError("Requested video mode is not supported");
+ return NULL;
+ }
+#endif
+
+ if (current && current->pixels) {
+ free(current->pixels);
+ current->pixels = NULL;
+ }
+ if ( ! SDL_ReallocFormat(current, bpp, 0, 0, 0, 0) ) {
+ return(NULL);
+ }
+
+ /* Set up the new mode framebuffer */
+ if (bpp == 8)
+ current->flags = (SDL_FULLSCREEN|SDL_SWSURFACE|SDL_PREALLOC|SDL_HWPALETTE);
+ else // 12 bpp, 16 bpp
+ current->flags = (SDL_FULLSCREEN|SDL_SWSURFACE|SDL_PREALLOC);
+ current->w = width;
+ current->h = height;
+ int numBytesPerPixel = ((bpp-1)>>3) + 1;
+ current->pitch = numBytesPerPixel * width; // Number of bytes in scanline
+ current->pixels = malloc(width * height * numBytesPerPixel);
+ memset(current->pixels, 0, width * height * numBytesPerPixel);
+
+ /* Set the blit function */
+ _this->UpdateRects = EPOC_DirectUpdate;
+
+ /*
+ * Logic for getting suitable screen dimensions, offset, scaling and orientation
+ */
+
+ int w = current->w;
+ int h = current->h;
+
+ // Rotate, if the screen does not fit horizontally and it is landscape screen
+/*
+ if ((width>Private->EPOC_ScreenSize.iWidth) && (width>height)) {
+ Private->EPOC_ScreenOrientation = CFbsBitGc::EGraphicsOrientationRotated270;
+ w = current->h;
+ h = current->w;
+ }
+*/
+ // Get nearest stepwise scale values for width and height. The smallest supported scaled screen is 1/2.
+ TInt scaleValue = 0;
+ Private->EPOC_ScreenXScaleValue = 1;
+ Private->EPOC_ScreenYScaleValue = 1;
+ if (w > Private->EPOC_ScreenSize.iWidth) {
+ // Find the biggest scale value that result the width that fits in the screen HW
+ for (scaleValue = 2; scaleValue++;) {
+ TInt scaledWidth = (w * (scaleValue-1))/scaleValue;
+ if (scaledWidth > Private->EPOC_ScreenSize.iWidth)
+ break;
+ }
+ Private->EPOC_ScreenXScaleValue = Max(2, scaleValue - 1);
+ w = (w * (Private->EPOC_ScreenXScaleValue-1))/Private->EPOC_ScreenXScaleValue;
+ }
+ if (h > Private->EPOC_ScreenSize.iHeight) {
+ // Find the biggest scale value that result the height that fits in the screen HW
+ for (scaleValue = 2; scaleValue++;) {
+ TInt scaledHeight = (h * (scaleValue-1))/scaleValue;
+ if (scaledHeight > Private->EPOC_ScreenSize.iHeight)
+ break;
+ }
+ Private->EPOC_ScreenYScaleValue = Max(2, scaleValue - 1);
+ h = (h * (Private->EPOC_ScreenYScaleValue-1))/Private->EPOC_ScreenYScaleValue;
+ }
+
+ /* Centralize game window on device screen */
+ Private->EPOC_ScreenOffset.iX = (Private->EPOC_ScreenSize.iWidth - w) / 2;
+ if (Private->EPOC_ScreenOffset.iX < 0)
+ Private->EPOC_ScreenOffset.iX = 0;
+ Private->EPOC_ScreenOffset.iY = (Private->EPOC_ScreenSize.iHeight - h) / 2;
+ if (Private->EPOC_ScreenOffset.iY < 0)
+ Private->EPOC_ScreenOffset.iY = 0;
+
+
+ SDL_TRACE1("View width %d", w);
+ SDL_TRACE1("View height %d", h);
+ SDL_TRACE1("View bmode %d", bpp);
+ SDL_TRACE1("View s %d", scaleValue);
+ SDL_TRACE1("View x %d", Private->EPOC_ScreenOffset.iX);
+ SDL_TRACE1("View y %d", Private->EPOC_ScreenOffset.iY);
+
+ /* We're done */
+ return(current);
+}
+
+
+void RedrawWindowL(_THIS)
+{
+
+#if defined(__WINS__) || defined(TEST_BM_DRAW)
+ LockHeap(Private->EPOC_Bitmap); // Lock bitmap heap
+ Private->EPOC_WindowGc->Activate(Private->EPOC_WsWindow);
+#endif
+
+ int w = _this->screen->w;
+ int h = _this->screen->h;
+ if (Private->EPOC_ScreenOrientation == CFbsBitGc::EGraphicsOrientationRotated270) {
+ w = _this->screen->h;
+ h = _this->screen->w;
+ }
+ if ((w < Private->EPOC_ScreenSize.iWidth)
+ || (h < Private->EPOC_ScreenSize.iHeight)) {
+ DrawBackground(_this);
+ }
+
+ /* Tell the system that something has been drawn */
+ TRect rect = TRect(Private->EPOC_WsWindow.Size());
+ Private->EPOC_WsWindow.Invalidate(rect);
+
+#if defined(__WINS__) || defined(TEST_BM_DRAW)
+ Private->EPOC_WsWindow.BeginRedraw(rect);
+ Private->EPOC_WindowGc->BitBlt(TPoint(), Private->EPOC_Bitmap);
+ Private->EPOC_WsWindow.EndRedraw();
+ Private->EPOC_WindowGc->Deactivate();
+ UnlockHeap(Private->EPOC_Bitmap);; // Unlock bitmap heap
+ Private->EPOC_WsSession.Flush();
+#endif
+
+ /* Draw current buffer */
+ SDL_Rect fullScreen;
+ fullScreen.x = 0;
+ fullScreen.y = 0;
+ fullScreen.w = _this->screen->w;
+ fullScreen.h = _this->screen->h;
+ EPOC_DirectUpdate(_this, 1, &fullScreen);
+}
+
+
+void DrawBackground(_THIS)
+{
+ /* Draw background */
+#if defined(__WINS__) || defined(TEST_BM_DRAW)
+ //warning heap is not locked! - a function calling must ensure that it's ok
+ TUint16* screenBuffer = (TUint16*)Private->EPOC_Bitmap->DataAddress();
+#else
+ TUint16* screenBuffer = (TUint16*)Private->EPOC_FrameBuffer;
+#endif
+ // Draw black background
+ Mem::FillZ(screenBuffer, Private->EPOC_BytesPerScreen);
+
+#if 0
+ for (int y = 0; y < Private->EPOC_ScreenSize.iHeight; y++) {
+ for (int x = 0; x < Private->EPOC_ScreenSize.iWidth; x++) {
+#ifdef SYMBIAN_CRYSTAL
+ const TUint16 color = 0; // ((x+y)>>1) & 0xf; /* Draw blue stripes pattern, because in e.g. 320x200 mode there is a big background area*/
+#else // SYMBIAN_SERIES60
+ const TUint16 color = 0; /* Draw black background */
+#endif
+ *screenBuffer++ = color;
+ }
+ }
+#endif
+}
+
+
+/* We don't actually allow hardware surfaces other than the main one */
+static int EPOC_AllocHWSurface(_THIS, SDL_Surface* /*surface*/)
+{
+ return(-1);
+}
+static void EPOC_FreeHWSurface(_THIS, SDL_Surface* /*surface*/)
+{
+ return;
+}
+
+static int EPOC_LockHWSurface(_THIS, SDL_Surface* /*surface*/)
+{
+ return(0);
+}
+static void EPOC_UnlockHWSurface(_THIS, SDL_Surface* /*surface*/)
+{
+ return;
+}
+
+static int EPOC_FlipHWSurface(_THIS, SDL_Surface* /*surface*/)
+{
+ return(0);
+}
+
+static void EPOC_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+ //TInt focusWindowGroupId = Private->EPOC_WsSession.GetFocusWindowGroup();//these are async services
+ // if (focusWindowGroupId != Private->EPOC_WsWindowGroupID) { //for that cannot be called from
+ //SDL threads ???
+ if (!Private->EPOC_IsWindowFocused)
+ {
+ /* Force focus window to redraw again for cleaning away SDL screen graphics */
+/*
+ TInt pos = Private->EPOC_WsWindowGroup.OrdinalPosition();
+ Private->EPOC_WsWindowGroup.SetOrdinalPosition(0, KMaxTInt);
+ TRect rect = TRect(Private->EPOC_WsWindow.Size());
+ Private->EPOC_WsWindow.Invalidate(rect);
+ Private->EPOC_WsWindowGroup.SetOrdinalPosition(pos, ECoeWinPriorityNormal);
+ */ /* If this is not the topmost window, wait here! Sleep for 1 second to give cpu time to
+ multitasking and poll for being the topmost window.
+ */
+ // if (Private->EPOC_WsSession.GetFocusWindowGroup() != Private->EPOC_WsWindowGroupID) {
+
+ /* !!TODO: Could call GetRedraw() etc. for WsSession and redraw the screen if needed. That might be
+ needed if a small dialog comes in front of Game screen.
+ */
+ // while (Private->EPOC_WsSession.GetFocusWindowGroup() != Private->EPOC_WsWindowGroupID)
+
+ SDL_PauseAudio(1);
+ SDL_Delay(1000);
+ return;
+ // }
+
+ // RedrawWindowL(_this);
+ }
+
+ SDL_PauseAudio(0);
+
+ // if we are not focused, do not draw
+// if (!Private->EPOC_IsWindowFocused)
+// return;
+#if defined(__WINS__) || defined(TEST_BM_DRAW)
+ TBitmapUtil lock(Private->EPOC_Bitmap);
+ lock.Begin(TPoint(0,0)); // Lock bitmap heap
+ Private->EPOC_WindowGc->Activate(Private->EPOC_WsWindow);
+ TUint16* screenBuffer = (TUint16*)Private->EPOC_Bitmap->DataAddress();
+#else
+ TUint16* screenBuffer = (TUint16*)Private->EPOC_FrameBuffer;
+#endif
+
+ if (Private->EPOC_ScreenOrientation == CFbsBitGc::EGraphicsOrientationRotated270)
+ DirectDrawRotated(_this, numrects, rects, screenBuffer);
+ else
+ DirectDraw(_this, numrects, rects, screenBuffer);
+
+
+#if defined(__WINS__) || defined(TEST_BM_DRAW)
+
+ TRect rect = TRect(Private->EPOC_WsWindow.Size());
+ Private->EPOC_WsWindow.Invalidate(rect);
+ Private->EPOC_WsWindow.BeginRedraw(rect);
+ Private->EPOC_WindowGc->BitBlt(TPoint(), Private->EPOC_Bitmap);
+ Private->EPOC_WsWindow.EndRedraw();
+ Private->EPOC_WindowGc->Deactivate();
+ lock.End(); // Unlock bitmap heap
+ Private->EPOC_WsSession.Flush();
+#else
+#ifndef SYMBIAN_CRYSTAL
+ // This is not needed in Crystal. What is the performance penalty in SERIES60?
+ TRect rect2 = TRect(Private->EPOC_WsWindow.Size());
+
+ Private->EPOC_DrawDevice->UpdateRegion(rect2); // Should we update rects parameter area only??
+ Private->EPOC_DrawDevice->Update();
+#endif
+#endif
+
+ /* Update virtual cursor. !!Do not yet work properly
+ Private->EPOC_WsSession.SetPointerCursorPosition(Private->EPOC_WsSession.PointerCursorPosition());
+ */
+
+ /*static int foo = 1;
+
+ for ( int i=0; i < numrects; ++i ) {
+ const SDL_Rect& currentRect = rects[i];
+ SDL_Rect rect2;
+ rect2.x = currentRect.x;
+ rect2.y = currentRect.y;
+ rect2.w = currentRect.w;
+ rect2.h = currentRect.h;
+
+ if (rect2.w <= 0 || rect2.h <= 0)
+ continue;
+
+
+ foo++;
+ if((foo % 200) == 0)
+ {
+ SDL_TRACE1("foo %d", foo);
+ CFbsBitmap* b = new (ELeave) CFbsBitmap;
+ SDL_TRACE1("bee %d", (int)b);
+ int e = b->Create(TSize(currentRect.w, currentRect.h), Private->EPOC_DisplayMode);
+
+ SDL_TRACE1("err %d", e);
+ if(e != KErrNone)
+ User::Panic(_L("damn"), e);
+
+ TBitmapUtil u(b);
+ u.Begin(TPoint(0, 0));
+ TUint32* d = b->DataAddress();
+
+ SDL_TRACE1("addr %d", (int)d);
+
+ for(TInt o = 0; o < currentRect.h; o++)
+ for(TInt p = 0; p < currentRect.w; p++)
+ {
+ u.SetPos(TPoint(p, o));
+ u.SetPixel(0xFFFF);
+ }
+
+ SDL_TRACE1("w %d", (int)currentRect.w);
+ SDL_TRACE1("h %d", (int)currentRect.h);
+
+ SDL_TRACE1("addr %d", (int)Private->EPOC_DisplayMode);
+
+
+ const TUint f = (TUint)Private->EPOC_FrameBuffer;
+ const TUint y = (TUint)Private->EPOC_BytesPerScreen;
+
+
+ SDL_TRACE1("frame %u", f);
+ SDL_TRACE1("bytes %u", y);
+
+ Mem::Copy(d, Private->EPOC_FrameBuffer, Private->EPOC_BytesPerScreen);
+
+ SDL_TRACE("kopied");
+
+ u.End();
+ TBuf<32> name;
+ name.Format(_L("C:\\nokia\\images\\doom%d.mbm"), (foo / 200));
+ e= b->Save(name);
+ if(e != KErrNone)
+ User::Panic(_L("damned"), e);
+ delete b;
+ }}*/
+}
+
+
+void DirectDraw(_THIS, int numrects, SDL_Rect *rects, TUint16* screenBuffer)
+{
+ TInt i;
+
+ const TInt sourceNumBytesPerPixel = ((_this->screen->format->BitsPerPixel-1)>>3) + 1;
+ const TPoint fixedOffset = Private->EPOC_ScreenOffset;
+ const TInt screenW = _this->screen->w;
+ const TInt screenH = _this->screen->h;
+ const TInt sourceScanlineLength = screenW;
+ const TInt targetScanlineLength = Private->EPOC_ScreenSize.iWidth;
+
+ /* Render the rectangles in the list */
+
+ for ( i=0; i < numrects; ++i ) {
+ const SDL_Rect& currentRect = rects[i];
+ SDL_Rect rect2;
+ rect2.x = currentRect.x;
+ rect2.y = currentRect.y;
+ rect2.w = currentRect.w;
+ rect2.h = currentRect.h;
+
+ if (rect2.w <= 0 || rect2.h <= 0) /* sanity check */
+ continue;
+
+ /* All variables are measured in pixels */
+
+ /* Check rects validity, i.e. upper and lower bounds */
+ TInt maxX = Min(screenW - 1, rect2.x + rect2.w - 1);
+ TInt maxY = Min(screenH - 1, rect2.y + rect2.h - 1);
+ if (maxX < 0 || maxY < 0) /* sanity check */
+ continue;
+ /* Clip from bottom */
+ maxY = Min(maxY, Private->EPOC_ScreenSize.iHeight-1);
+ /* TODO: Clip from the right side */
+
+ const TInt sourceRectWidth = maxX - rect2.x + 1;
+ const TInt sourceRectWidthInBytes = sourceRectWidth * sourceNumBytesPerPixel;
+ const TInt sourceRectHeight = maxY - rect2.y + 1;
+ const TInt sourceStartOffset = rect2.x + rect2.y * sourceScanlineLength;
+ const TUint skipValue = 1; // no skip
+
+ TInt targetStartOffset = fixedOffset.iX + rect2.x + (fixedOffset.iY +rect2.y) * targetScanlineLength;
+
+ // Nokia7650 native mode: 12 bpp --> 12 bpp
+ //
+
+ switch (_this->screen->format->BitsPerPixel)
+ {
+ case 12:
+ {
+ TUint16* bitmapLine = (TUint16*)_this->screen->pixels + sourceStartOffset;
+ TUint16* screenMemory = screenBuffer + targetStartOffset;
+ if (skipValue == 1)
+ {
+ for(TInt y = 0 ; y < sourceRectHeight ; y++)
+ {
+ Mem::Copy(screenMemory, bitmapLine, sourceRectWidthInBytes);
+ }
+ bitmapLine += sourceScanlineLength;
+ screenMemory += targetScanlineLength;
+ }
+ else
+ {
+ for(TInt y = 0 ; y < sourceRectHeight ; y++)
+ {
+ //TODO: optimize: separate loops for 1, 2 and n skip. Mem::Copy() can be used in unscaled case.
+ TUint16* bitmapPos = bitmapLine; /* 2 bytes per pixel */
+ TUint16* screenMemoryLinePos = screenMemory; /* 2 bytes per pixel */
+ for(TInt x = 0 ; x < sourceRectWidth ; x++)
+ {
+ __ASSERT_DEBUG(screenMemory < (screenBuffer + Private->EPOC_ScreenSize.iWidth * Private->EPOC_ScreenSize.iHeight), User::Panic(_L("SDL"), KErrCorrupt));
+ __ASSERT_DEBUG(screenMemory >= screenBuffer, User::Panic(_L("SDL"), KErrCorrupt));
+ __ASSERT_DEBUG(bitmapLine < ((TUint16*)_this->screen->pixels + (_this->screen->w * _this->screen->h)), User::Panic(_L("SDL"), KErrCorrupt));
+ __ASSERT_DEBUG(bitmapLine >= (TUint16*)_this->screen->pixels, User::Panic(_L("SDL"), KErrCorrupt));
+
+ *screenMemoryLinePos++ = *bitmapPos;
+ bitmapPos+=skipValue;
+ }
+ bitmapLine += sourceScanlineLength;
+ screenMemory += targetScanlineLength;
+ }
+ }
+ }
+ break;
+ // 256 color paletted mode: 8 bpp --> 12 bpp
+ //
+ default:
+ {
+ if(Private->EPOC_BytesPerPixel <= 2)
+ {
+ TUint8* bitmapLine = (TUint8*)_this->screen->pixels + sourceStartOffset;
+ TUint16* screenMemory = screenBuffer + targetStartOffset;
+ for(TInt y = 0 ; y < sourceRectHeight ; y++)
+ {
+ TUint8* bitmapPos = bitmapLine; /* 1 byte per pixel */
+ TUint16* screenMemoryLinePos = screenMemory; /* 2 bytes per pixel */
+ /* Convert each pixel from 256 palette to 4k color values */
+ for(TInt x = 0 ; x < sourceRectWidth ; x++)
+ {
+ __ASSERT_DEBUG(screenMemoryLinePos < (screenBuffer + (Private->EPOC_ScreenSize.iWidth * Private->EPOC_ScreenSize.iHeight)), User::Panic(_L("SDL"), KErrCorrupt));
+ __ASSERT_DEBUG(screenMemoryLinePos >= screenBuffer, User::Panic(_L("SDL"), KErrCorrupt));
+ __ASSERT_DEBUG(bitmapPos < ((TUint8*)_this->screen->pixels + (_this->screen->w * _this->screen->h)), User::Panic(_L("SDL"), KErrCorrupt));
+ __ASSERT_DEBUG(bitmapPos >= (TUint8*)_this->screen->pixels, User::Panic(_L("SDL"), KErrCorrupt));
+ *screenMemoryLinePos++ = EPOC_HWPalette_256_to_Screen[*bitmapPos++];
+ // bitmapPos+=skipValue; //TODO: optimize: separate loops for 1, 2 and n skip
+ }
+ bitmapLine += sourceScanlineLength;
+ screenMemory += targetScanlineLength;
+ }
+ }
+ else
+ {
+ TUint8* bitmapLine = (TUint8*)_this->screen->pixels + sourceStartOffset;
+ TUint32* screenMemory = reinterpret_cast<TUint32*>(screenBuffer + targetStartOffset);
+ for(TInt y = 0 ; y < sourceRectHeight ; y++)
+ {
+ TUint8* bitmapPos = bitmapLine; /* 1 byte per pixel */
+ TUint32* screenMemoryLinePos = screenMemory; /* 2 bytes per pixel */
+ /* Convert each pixel from 256 palette to 4k color values */
+ for(TInt x = 0 ; x < sourceRectWidth ; x++)
+ {
+ __ASSERT_DEBUG(screenMemoryLinePos < (reinterpret_cast<TUint32*>(screenBuffer) + (Private->EPOC_ScreenSize.iWidth * Private->EPOC_ScreenSize.iHeight)), User::Panic(_L("SDL"), KErrCorrupt));
+ __ASSERT_DEBUG(screenMemoryLinePos >= reinterpret_cast<TUint32*>(screenBuffer), User::Panic(_L("SDL"), KErrCorrupt));
+ __ASSERT_DEBUG(bitmapPos < ((TUint8*)_this->screen->pixels + (_this->screen->w * _this->screen->h)), User::Panic(_L("SDL"), KErrCorrupt));
+ __ASSERT_DEBUG(bitmapPos >= (TUint8*)_this->screen->pixels, User::Panic(_L("SDL"), KErrCorrupt));
+ *screenMemoryLinePos++ = EPOC_HWPalette_256_to_Screen[*bitmapPos++];
+ // bitmapPos+=skipValue; //TODO: optimize: separate loops for 1, 2 and n skip
+ }
+ bitmapLine += sourceScanlineLength;
+ screenMemory += targetScanlineLength;
+ }
+ }
+ }
+ } // switch
+ } // for
+}
+
+/*
+void DirectDraw(_THIS, int numrects, SDL_Rect *rects, TUint16* screenBuffer)
+{
+ TInt i;
+ const TInt sourceNumBytesPerPixel = ((_this->screen->format->BitsPerPixel-1)>>3) + 1;
+ const TPoint fixedOffset = Private->EPOC_ScreenOffset;
+ const TInt screenW = _this->screen->w;
+ const TInt screenH = _this->screen->h;
+ const TInt sourceScanlineLength = screenW;
+ const TInt targetScanlineLength = Private->EPOC_ScreenSize.iWidth;
+
+ /* Render the rectangles in the list */
+
+/* for ( i=0; i < numrects; ++i ) {
+ const SDL_Rect& currentRect = rects[i];
+ SDL_Rect rect2;
+ rect2.x = currentRect.x;
+ rect2.y = currentRect.y;
+ rect2.w = currentRect.w;
+ rect2.h = currentRect.h;
+
+ if (rect2.w <= 0 || rect2.h <= 0) /* sanity check */
+/* continue;
+
+ /* All variables are measured in pixels */
+
+ /* Check rects validity, i.e. upper and lower bounds */
+/* TInt maxX = Min(screenW - 1, rect2.x + rect2.w - 1);
+ TInt maxY = Min(screenH - 1, rect2.y + rect2.h - 1);
+ if (maxX < 0 || maxY < 0) /* sanity check */
+/* continue;
+ /* Clip from bottom */
+/* maxY = Min(maxY, Private->EPOC_ScreenSize.iHeight-1);
+ /* TODO: Clip from the right side */
+
+/* TInt sourceRectWidth = maxX - rect2.x + 1;
+ const TInt sourceRectWidthInBytes = sourceRectWidth * sourceNumBytesPerPixel;
+ const TInt sourceRectHeight = maxY - rect2.y + 1;
+ const TInt sourceStartOffset = rect2.x + rect2.y * sourceScanlineLength;
+ const TUint skipValue = Private->EPOC_ScreenXScaleValue; //1; // no skip
+
+ const TInt targetStartOffset = // = (fixedOffset.iX + (rect2.x / skipValue) + (fixedOffset.iY + rect2.y) * targetScanlineLength ) ;
+ (skipValue > 1 ?
+ (fixedOffset.iX + (rect2.x / skipValue) + (fixedOffset.iY + rect2.y) * targetScanlineLength ) :
+ (fixedOffset.iX + rect2.x + (fixedOffset.iY + rect2.y) * targetScanlineLength ));
+
+ __ASSERT_DEBUG(skipValue >= 1, User::Panic(KLibName, KErrArgument));
+
+ // Nokia7650 native mode: 12 bpp --> 12 bpp
+ //
+ switch (_this->screen->format->BitsPerPixel)
+ {
+ case 12:
+ {
+ TUint16* bitmapLine = (TUint16*)_this->screen->pixels + sourceStartOffset;
+ TUint16* screenMemory = screenBuffer + targetStartOffset;
+ if (skipValue == 1)
+ {
+ for(TInt y = 0 ; y < sourceRectHeight ; y++)
+ {
+ Mem::Copy(screenMemory, bitmapLine, sourceRectWidthInBytes);
+ }
+ bitmapLine += sourceScanlineLength;
+ screenMemory += targetScanlineLength;
+ }
+ else
+ {
+ for(TInt y = 0 ; y < sourceRectHeight ; y++)
+ {
+ //TODO: optimize: separate loops for 1, 2 and n skip. Mem::Copy() can be used in unscaled case.
+ TUint16* bitmapPos = bitmapLine; /* 2 bytes per pixel */
+/* TUint16* screenMemoryLinePos = screenMemory; /* 2 bytes per pixel */
+/* for(TInt x = 0 ; x < sourceRectWidth ; x++)
+ {
+ __ASSERT_DEBUG(screenMemory < (screenBuffer + Private->EPOC_ScreenSize.iWidth * Private->EPOC_ScreenSize.iHeight), User::Panic(KLibName, KErrCorrupt));
+ __ASSERT_DEBUG(screenMemory >= screenBuffer, User::Panic(KLibName, KErrCorrupt));
+ __ASSERT_DEBUG(bitmapLine < ((TUint16*)_this->screen->pixels + (_this->screen->w * _this->screen->h)), User::Panic(KLibName, KErrCorrupt));
+ __ASSERT_DEBUG(bitmapLine >= (TUint16*)_this->screen->pixels, User::Panic(KLibName, KErrCorrupt));
+
+ *screenMemoryLinePos++ = *bitmapPos;
+ bitmapPos+=skipValue;
+ }
+ bitmapLine += sourceScanlineLength;
+ screenMemory += targetScanlineLength;
+ }
+ }
+ }
+ break;
+ // 256 color paletted mode: 8 bpp --> 12 bpp
+ //
+ default:
+ {
+ TUint8* bitmapLine = (TUint8*)_this->screen->pixels + sourceStartOffset;
+ TUint16* screenMemory = screenBuffer + targetStartOffset;
+ if (skipValue > 1)
+ sourceRectWidth /= skipValue;
+#if defined __MARM_ARMI__
+ __asm volatile("
+ mov %4, %4, lsl #1 @ targetScanLineLength is in pixels, we need it in bytes
+ 1:
+ mov r6, %0 @ bitmapLine
+ mov r7, %2 @ screenMemory
+ mov r8, %6 @ sourceRectWidth
+ 2:
+ ldrb r4, [%0], %7 @ r4 = *bitmapPos; bitmapPos += skipValue
+ ldr r5, [%1, r4, lsl #2] @ only 16 lower bits actually used
+ subs r8, r8, #1 @ x--
+ strh r5, [%2], #2 @ *screenMemoryLinePos++ = r4
+ bne 2b
+
+ add %0, r6, %3 @ bitmapLine += sourceScanlineLength
+ add %2, r7, %4 @ screenMemory += targetScanlineLength
+ subs %5, %5, #1 @ sourceRectHeight--
+ bne 1b
+ "
+ : // no output
+ // %0 %1 %2 %3 %4 %5 %6 %7
+ : "r" (bitmapLine), "r" (&EPOC_HWPalette_256_to_Screen[0]), "r" (screenMemory), "r" (sourceScanlineLength), "r" (targetScanlineLength), "r" (sourceRectHeight), "r" (sourceRectWidth), "r" (skipValue)
+ : "r4", "r5", "r6", "r7", "r8"
+ );
+#else
+ for(TInt y = 0 ; y < sourceRectHeight ; y++)
+ {
+ TUint8* bitmapPos = bitmapLine; /* 1 byte per pixel */
+/* TUint16* screenMemoryLinePos = screenMemory; /* 2 bytes per pixel */
+ /* Convert each pixel from 256 palette to 4k color values */
+/* for (TInt x = 0 ; x < sourceRectWidth ; x++)
+ {
+ //__ASSERT_DEBUG(screenMemoryLinePos < (screenBuffer + (Private->EPOC_ScreenSize.iWidth * Private->EPOC_ScreenSize.iHeight)), User::Panic(KLibName, KErrCorrupt));
+ //__ASSERT_DEBUG(screenMemoryLinePos >= screenBuffer, User::Panic(KLibName, KErrCorrupt));
+ //__ASSERT_DEBUG(bitmapPos < ((TUint8*)_this->screen->pixels + (_this->screen->w * _this->screen->h)), User::Panic(KLibName, KErrCorrupt));
+ //__ASSERT_DEBUG(bitmapPos >= (TUint8*)_this->screen->pixels, User::Panic(KLibName, KErrCorrupt));
+
+ *screenMemoryLinePos++ = EPOC_HWPalette_256_to_Screen[*bitmapPos];
+ bitmapPos += skipValue;
+ }
+ bitmapLine += sourceScanlineLength;
+ screenMemory += targetScanlineLength;
+ }
+//#endif
+ }
+ } // switch
+ } // for
+}
+*/
+
+void DirectDrawRotated(_THIS, int numrects, SDL_Rect *rects, TUint16* screenBuffer)
+{
+ TInt i;
+// TInt sourceNumBytesPerPixel = ((_this->screen->format->BitsPerPixel-1)>>3) + 1;
+ TPoint fixedScreenOffset = Private->EPOC_ScreenOffset;
+ TInt bufferW = _this->screen->w;
+ TInt bufferH = _this->screen->h;
+ TInt ScreenW = Private->EPOC_ScreenSize.iWidth;
+// TInt ScreenH = Private->EPOC_ScreenSize.iWidth;
+ TInt sourceW = bufferW;
+ TInt sourceH = bufferH;
+ TInt targetW = ScreenW - fixedScreenOffset.iX * 2;
+// TInt targetH = ScreenH - fixedScreenOffset.iY * 2;
+ TInt sourceScanlineLength = bufferW;
+ TInt targetScanlineLength = Private->EPOC_ScreenSize.iWidth;
+
+ /* Render the rectangles in the list */
+
+ for ( i=0; i < numrects; ++i ) {
+ SDL_Rect rect2;
+ const SDL_Rect& currentRect = rects[i];
+ rect2.x = currentRect.x;
+ rect2.y = currentRect.y;
+ rect2.w = currentRect.w;
+ rect2.h = currentRect.h;
+
+ if (rect2.w <= 0 || rect2.h <= 0) /* sanity check */
+ continue;
+
+ /* All variables are measured in pixels */
+
+ /* Check rects validity, i.e. upper and lower bounds */
+ TInt maxX = Min(sourceW - 1, rect2.x + rect2.w - 1);
+ TInt maxY = Min(sourceH - 1, rect2.y + rect2.h - 1);
+ if (maxX < 0 || maxY < 0) /* sanity check */
+ continue;
+ /* Clip from bottom */
+ //maxX = Min(maxX, Private->EPOC_ScreenSize.iHeight-1);
+ /* TODO: Clip from the right side */
+
+ TInt sourceRectWidth = maxX - rect2.x + 1;
+// TInt sourceRectWidthInBytes = sourceRectWidth * sourceNumBytesPerPixel;
+ TInt sourceRectHeight = maxY - rect2.y + 1;
+ TInt sourceStartOffset = rect2.x + rect2.y * sourceScanlineLength;
+ TInt targetStartOffset = fixedScreenOffset.iX + (targetW-1 - rect2.y) + (fixedScreenOffset.iY +rect2.x) * targetScanlineLength;
+
+ // Nokia7650 native mode: 12 bpp --> 12 bpp
+ if (_this->screen->format->BitsPerPixel == 12) {
+
+ /* !!TODO: not yet implemented
+
+ TUint16* bitmapLine = (TUint16*)_this->screen->pixels + sourceStartOffset;
+ TUint16* screenMemory = screenBuffer + targetStartOffset;
+ for(TInt y = 0 ; y < sourceRectHeight ; y++) {
+ //TODO: optimize: separate loops for 1, 2 and n skip
+ //Mem::Copy(screenMemory, bitmapLine, sourceRectWidthInBytes);
+ TUint16* bitmapPos = bitmapLine; // 2 bytes per pixel
+ TUint16* screenMemoryLinePos = screenMemory; // 2 bytes per pixel
+ for(TInt x = 0 ; x < sourceRectWidth ; x++) {
+
+ __ASSERT_DEBUG(screenMemory < (screenBuffer + Private->EPOC_ScreenSize.iWidth * Private->EPOC_ScreenSize.iHeight), User::Panic(KLibName, KErrCorrupt));
+ __ASSERT_DEBUG(screenMemory >= screenBuffer, User::Panic(KLibName, KErrCorrupt));
+ __ASSERT_DEBUG(bitmapLine < ((TUint16*)_this->screen->pixels + (_this->screen->w * _this->screen->h)), User::Panic(KLibName, KErrCorrupt));
+ __ASSERT_DEBUG(bitmapLine >= (TUint16*)_this->screen->pixels, User::Panic(KLibName, KErrCorrupt));
+
+ *screenMemoryLinePos = *bitmapPos;
+ bitmapPos++;
+ screenMemoryLinePos += targetScanlineLength;
+ }
+ bitmapLine += sourceScanlineLength;
+ screenMemory--;
+ }
+
+ */
+ }
+ // 256 color paletted mode: 8 bpp --> 12 bpp
+ else {
+ TUint8* bitmapLine = (TUint8*)_this->screen->pixels + sourceStartOffset;
+ TUint16* screenMemory = screenBuffer + targetStartOffset;
+ TInt screenXScaleValue = Private->EPOC_ScreenXScaleValue;
+ TInt debug_ycount=0;
+ for(TInt y = 0 ; y < sourceRectHeight ; y++) {
+ if(--screenXScaleValue) {
+ TUint8* bitmapPos = bitmapLine; /* 1 byte per pixel */
+ TUint16* screenMemoryLinePos = screenMemory; /* 2 bytes per pixel */
+ TInt screenYScaleValue = Private->EPOC_ScreenYScaleValue;
+ TInt debug_xcount=0;
+ /* Convert each pixel from 256 palette to 4k color values */
+ for(TInt x = 0 ; x < sourceRectWidth ; x++) {
+ if(--screenYScaleValue) {
+
+ __ASSERT_DEBUG(screenMemoryLinePos < (screenBuffer + (Private->EPOC_ScreenSize.iWidth * Private->EPOC_ScreenSize.iHeight)), User::Panic(KLibName, KErrCorrupt));
+ __ASSERT_DEBUG(screenMemoryLinePos >= screenBuffer, User::Panic(KLibName, KErrCorrupt));
+ __ASSERT_DEBUG(bitmapPos < ((TUint8*)_this->screen->pixels + (_this->screen->w * _this->screen->h)), User::Panic(KLibName, KErrCorrupt));
+ __ASSERT_DEBUG(bitmapPos >= (TUint8*)_this->screen->pixels, User::Panic(KLibName, KErrCorrupt));
+
+ *screenMemoryLinePos = TUint16(EPOC_HWPalette_256_to_Screen[*bitmapPos]);
+ screenMemoryLinePos += targetScanlineLength; debug_xcount++;
+ }
+ else
+ screenYScaleValue = Private->EPOC_ScreenYScaleValue;
+ bitmapPos++;
+ }
+ screenMemory--; debug_ycount++;
+ } // endif
+ else
+ screenXScaleValue = Private->EPOC_ScreenXScaleValue;
+ bitmapLine += sourceScanlineLength;
+ }
+ }
+ }
+}
+
+
+/* Note: If we are terminated, this could be called in the middle of
+ another SDL video routine -- notably UpdateRects.
+*/
+void EPOC_VideoQuit(_THIS)
+{
+ int i;
+
+ /* Free video mode lists */
+ for ( i=0; i<SDL_NUMMODES; ++i ) {
+ if ( Private->SDL_modelist[i] != NULL ) {
+ free(Private->SDL_modelist[i]);
+ Private->SDL_modelist[i] = NULL;
+ }
+ }
+
+ if ( _this->screen && (_this->screen->flags & SDL_HWSURFACE) ) {
+ /* Direct screen access, no memory buffer */
+ _this->screen->pixels = NULL;
+ }
+
+ if (_this->screen && _this->screen->pixels) {
+ free(_this->screen->pixels);
+ _this->screen->pixels = NULL;
+ }
+
+ /* Free Epoc resources */
+
+ /* Disable events for me */
+ if (Private->EPOC_WsEventStatus != KRequestPending)
+ Private->EPOC_WsSession.EventReadyCancel();
+ if (Private->EPOC_RedrawEventStatus != KRequestPending)
+ Private->EPOC_WsSession.RedrawReadyCancel();
+
+ #if defined(__WINS__) || defined(TEST_BM_DRAW)
+ delete Private->EPOC_Bitmap;
+ Private->EPOC_Bitmap = NULL;
+ #else
+ #endif
+
+#ifndef SYMBIAN_CRYSTAL
+ free(Private->EPOC_DrawDevice);
+#endif
+
+ if (Private->EPOC_WsWindow.WsHandle())
+ Private->EPOC_WsWindow.Close();
+
+ if (Private->EPOC_WsWindowGroup.WsHandle())
+ Private->EPOC_WsWindowGroup.Close();
+
+ delete Private->EPOC_WindowGc;
+ Private->EPOC_WindowGc = NULL;
+
+ delete Private->EPOC_WsScreen;
+ Private->EPOC_WsScreen = NULL;
+
+ if (Private->EPOC_WsSession.WsHandle())
+ Private->EPOC_WsSession.Close();
+}
+
+
+WMcursor *EPOC_CreateWMCursor(_THIS, Uint8* /*data*/, Uint8* /*mask*/, int /*w*/, int /*h*/, int /*hot_x*/, int /*hot_y*/)
+{
+ return (WMcursor *) 9210; // it's ok to return something unuseful but true
+}
+
+void EPOC_FreeWMCursor(_THIS, WMcursor* /*cursor*/)
+{
+ /* Disable virtual cursor */
+ HAL::Set(HAL::EMouseState, HAL::EMouseState_Invisible);
+ Private->EPOC_WsSession.SetPointerCursorMode(EPointerCursorNone);
+}
+
+int EPOC_ShowWMCursor(_THIS, WMcursor *cursor)
+{
+
+ if (cursor == (WMcursor *)9210) {
+ /* Enable virtual cursor */
+ Private->EPOC_WsSession.SetPointerCursorMode(EPointerCursorNormal);
+ if (isCursorVisible)
+ HAL::Set(HAL::EMouseState, HAL::EMouseState_Visible);
+ else
+ Private->EPOC_WsSession.SetPointerCursorMode(EPointerCursorNone);
+ }
+ else {
+ /* Disable virtual cursor */
+ HAL::Set(HAL::EMouseState, HAL::EMouseState_Invisible);
+ Private->EPOC_WsSession.SetPointerCursorMode(EPointerCursorNone);
+ }
+
+ return(1);
+}
+
+}; // extern "C"
diff --git a/distrib/sdl-1.2.15/src/video/symbian/EKA1/SDL_epocvideo.h b/distrib/sdl-1.2.15/src/video/symbian/EKA1/SDL_epocvideo.h
new file mode 100644
index 0000000..bd0b0e2
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/symbian/EKA1/SDL_epocvideo.h
@@ -0,0 +1,34 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@devolution.com
+*/
+
+#ifndef _SDL_epocvideo_h
+#define _SDL_epocvideo_h
+
+#ifndef EKA2
+#include"SDL_epocvideo_org.h"
+#else
+#include"SDL_epocvideo2.h"
+#endif
+
+
+#endif
+
diff --git a/distrib/sdl-1.2.15/src/video/symbian/EKA2/SDL_epocevents.cpp b/distrib/sdl-1.2.15/src/video/symbian/EKA2/SDL_epocevents.cpp
new file mode 100644
index 0000000..2452dae
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/symbian/EKA2/SDL_epocevents.cpp
@@ -0,0 +1,521 @@
+#include "epoc_sdl.h"
+
+#include <stdio.h>
+#undef NULL
+extern "C" {
+//#define DEBUG_TRACE_ENABLED
+#include "SDL_error.h"
+#include "SDL_video.h"
+#include "SDL_keysym.h"
+#include "SDL_keyboard.h"
+#include "SDL_events_c.h"
+#include "SDL_timer.h"
+} /* extern "C" */
+
+#include "SDL_epocvideo.h"
+#include "SDL_epocevents_c.h"
+
+#include "sdlepocapi.h"
+
+#include <eikenv.h>
+
+#include<bautils.h>
+
+
+extern "C"
+ {
+ static SDL_keysym *TranslateKey(_THIS, int scancode, SDL_keysym *keysym);
+ }
+
+//extern "C" {
+/* The translation tables from a console scancode to a SDL keysym */
+static SDLKey keymap[MAX_SCANCODE];
+static SDL_keysym *TranslateKey(_THIS, int scancode, SDL_keysym *keysym);
+void DisableKeyBlocking(_THIS);
+//} /* extern "C" */
+
+SDLKey* KeyMap()
+ {
+ return keymap;
+ }
+
+TBool isCursorVisible = EFalse;
+
+void ResetKeyMap()
+ {
+ int i;
+
+ /* Initialize the key translation table */
+ for ( i=0; i<SDL_TABLESIZE(keymap); ++i )
+ keymap[i] = SDLK_UNKNOWN;
+
+
+ /* Numbers */
+ for ( i = 0; i<32; ++i ){
+ keymap[' ' + i] = (SDLKey)(SDLK_SPACE+i);
+ }
+ /* e.g. Alphabet keys */
+ for ( i = 0; i<32; ++i ){
+ keymap['A' + i] = (SDLKey)(SDLK_a+i);
+ }
+
+ keymap[EStdKeyBackspace] = SDLK_BACKSPACE;
+ keymap[EStdKeyTab] = SDLK_TAB;
+ keymap[EStdKeyEnter] = SDLK_RETURN;
+ keymap[EStdKeyEscape] = SDLK_ESCAPE;
+ keymap[EStdKeySpace] = SDLK_SPACE;
+ keymap[EStdKeyPause] = SDLK_PAUSE;
+ keymap[EStdKeyHome] = SDLK_HOME;
+ keymap[EStdKeyEnd] = SDLK_END;
+ keymap[EStdKeyPageUp] = SDLK_PAGEUP;
+ keymap[EStdKeyPageDown] = SDLK_PAGEDOWN;
+ keymap[EStdKeyDelete] = SDLK_DELETE;
+ keymap[EStdKeyUpArrow] = SDLK_UP;
+ keymap[EStdKeyDownArrow] = SDLK_DOWN;
+ keymap[EStdKeyLeftArrow] = SDLK_LEFT;
+ keymap[EStdKeyRightArrow] = SDLK_RIGHT;
+ keymap[EStdKeyCapsLock] = SDLK_CAPSLOCK;
+ keymap[EStdKeyLeftShift] = SDLK_LSHIFT;
+ keymap[EStdKeyRightShift] = SDLK_RSHIFT;
+ keymap[EStdKeyLeftAlt] = SDLK_LALT;
+ keymap[EStdKeyRightAlt] = SDLK_RALT;
+ keymap[EStdKeyLeftCtrl] = SDLK_LCTRL;
+ keymap[EStdKeyRightCtrl] = SDLK_RCTRL;
+ keymap[EStdKeyLeftFunc] = SDLK_LMETA;
+ keymap[EStdKeyRightFunc] = SDLK_RMETA;
+ keymap[EStdKeyInsert] = SDLK_INSERT;
+ keymap[EStdKeyComma] = SDLK_COMMA;
+ keymap[EStdKeyFullStop] = SDLK_PERIOD;
+ keymap[EStdKeyForwardSlash] = SDLK_SLASH;
+ keymap[EStdKeyBackSlash] = SDLK_BACKSLASH;
+ keymap[EStdKeySemiColon] = SDLK_SEMICOLON;
+ keymap[EStdKeySingleQuote] = SDLK_QUOTE;
+ keymap[EStdKeyHash] = SDLK_HASH;
+ keymap[EStdKeySquareBracketLeft] = SDLK_LEFTBRACKET;
+ keymap[EStdKeySquareBracketRight] = SDLK_RIGHTBRACKET;
+ keymap[EStdKeyMinus] = SDLK_MINUS;
+ keymap[EStdKeyEquals] = SDLK_EQUALS;
+
+ keymap[EStdKeyF1] = SDLK_F1;
+ keymap[EStdKeyF2] = SDLK_F2;
+ keymap[EStdKeyF3] = SDLK_F3;
+ keymap[EStdKeyF4] = SDLK_F4;
+ keymap[EStdKeyF5] = SDLK_F5;
+ keymap[EStdKeyF6] = SDLK_F6;
+ keymap[EStdKeyF7] = SDLK_F7;
+ keymap[EStdKeyF8] = SDLK_F8;
+
+ keymap[EStdKeyF9] = SDLK_F9;
+ keymap[EStdKeyF10] = SDLK_F10;
+ keymap[EStdKeyF11] = SDLK_F11;
+ keymap[EStdKeyF12] = SDLK_F12;
+
+
+ keymap[EStdKeyXXX] = SDLK_RETURN; /* "fire" key */
+
+ keymap[EStdKeyDevice3] = SDLK_RETURN; /* "fire" key */
+ keymap[EStdKeyNkpAsterisk] = SDLK_ASTERISK;
+ keymap[EStdKeyYes] = SDLK_HOME; /* "call" key */
+ keymap[EStdKeyNo] = SDLK_END; /* "end call" key */
+ keymap[EStdKeyDevice0] = SDLK_SPACE; /* right menu key */
+ keymap[EStdKeyDevice1] = SDLK_ESCAPE; /* left menu key */
+ keymap[EStdKeyDevice2] = SDLK_POWER; /* power key */
+
+ keymap[EStdKeyMenu] = SDLK_MENU; // menu key
+ keymap[EStdKeyDevice6] = SDLK_LEFT; // Rocker (joystick) left
+ keymap[EStdKeyDevice7] = SDLK_RIGHT; // Rocker (joystick) right
+ keymap[EStdKeyDevice8] = SDLK_UP; // Rocker (joystick) up
+ keymap[EStdKeyDevice9] = SDLK_DOWN; // Rocker (joystick) down
+ keymap[EStdKeyLeftFunc] = SDLK_LALT; //chr?
+ keymap[EStdKeyRightFunc] = SDLK_RALT;
+ keymap[EStdKeyDeviceA] = SDLK_RETURN; /* "fire" key */
+
+
+
+
+
+ ///////////////////////////////////////////////////////////
+ /*
+ RFs fs;
+ if(KErrNone == fs.Connect())
+ {
+ RArray<TInt> array;
+ TRAPD(err, ReadL(fs, array));
+ if(err == KErrNone && array.Count() > 0)
+ {
+
+ SDLKey temp[MAX_SCANCODE];
+ Mem::Copy(temp, keymap, MAX_SCANCODE * sizeof(SDLKey));
+
+ for(TInt k = 0; k < array.Count(); k+= 2)
+ {
+ const TInt oldval = array[k];
+ const TInt newval = array[k + 1];
+ if(oldval >= 0 && oldval < MAX_SCANCODE && newval >= 0 && newval < MAX_SCANCODE)
+ {
+ keymap[oldval] = temp[newval];
+ }
+ }
+ }
+ array.Close();
+ }
+
+ fs.Close();*/
+ ///////////////////////////////////////////////////////////
+
+
+ keymap[EStdKeyNumLock] = SDLK_NUMLOCK;
+ keymap[EStdKeyScrollLock] = SDLK_SCROLLOCK;
+
+ keymap[EStdKeyNkpForwardSlash] = SDLK_KP_DIVIDE;
+ keymap[EStdKeyNkpAsterisk] = SDLK_KP_MULTIPLY;
+ keymap[EStdKeyNkpMinus] = SDLK_KP_MINUS;
+ keymap[EStdKeyNkpPlus] = SDLK_KP_PLUS;
+ keymap[EStdKeyNkpEnter] = SDLK_KP_ENTER;
+ keymap[EStdKeyNkp1] = SDLK_KP1;
+ keymap[EStdKeyNkp2] = SDLK_KP2;
+ keymap[EStdKeyNkp3] = SDLK_KP3;
+ keymap[EStdKeyNkp4] = SDLK_KP4;
+ keymap[EStdKeyNkp5] = SDLK_KP5;
+ keymap[EStdKeyNkp6] = SDLK_KP6;
+ keymap[EStdKeyNkp7] = SDLK_KP7;
+ keymap[EStdKeyNkp8] = SDLK_KP8;
+ keymap[EStdKeyNkp9] = SDLK_KP9;
+ keymap[EStdKeyNkp0] = SDLK_KP0;
+ keymap[EStdKeyNkpFullStop] = SDLK_KP_PERIOD;
+ /*
+ keymap[EStdKeyMenu] = SDLK_MENU; should be, but not yet
+ keymap[EStdKeyBacklightOn] =
+ keymap[EStdKeyBacklightOff] =
+ keymap[EStdKeyBacklightToggle] =
+ keymap[EStdKeyIncContrast] =
+ keymap[EStdKeyDecContrast] =
+ keymap[EStdKeySliderDown] =
+ keymap[EStdKeySliderUp] =
+ keymap[EStdKeyDictaphonePlay] =
+ keymap[EStdKeyDictaphoneStop] =
+ keymap[EStdKeyDictaphoneRecord] =
+ keymap[EStdKeyHelp] =
+ keymap[EStdKeyOff] =
+ keymap[EStdKeyDial] =
+ keymap[EStdKeyIncVolume] =
+ keymap[EStdKeyDecVolume] =
+ keymap[EStdKeyDevice0] =
+ keymap[EStdKeyDevice1] =
+ keymap[EStdKeyDevice2] =
+ keymap[EStdKeyDevice3] =
+ keymap[EStdKeyDevice4] =
+ keymap[EStdKeyDevice5] =
+ keymap[EStdKeyDevice6] =
+ keymap[EStdKeyDevice7] =
+ keymap[EStdKeyDevice8] =
+ keymap[EStdKeyDevice9] =
+ keymap[EStdKeyDeviceA] =
+ keymap[EStdKeyDeviceB] =
+ keymap[EStdKeyDeviceC] =
+ keymap[EStdKeyDeviceD] =
+ keymap[EStdKeyDeviceE] =
+ keymap[EStdKeyDeviceF] =
+ keymap[EStdKeyApplication0] =
+ keymap[EStdKeyApplication1] =
+ keymap[EStdKeyApplication2] =
+ keymap[EStdKeyApplication3] =
+ keymap[EStdKeyApplication4] =
+ keymap[EStdKeyApplication5] =
+ keymap[EStdKeyApplication6] =
+ keymap[EStdKeyApplication7] =
+ keymap[EStdKeyApplication8] =
+ keymap[EStdKeyApplication9] =
+ keymap[EStdKeyApplicationA] =
+ keymap[EStdKeyApplicationB] =
+ keymap[EStdKeyApplicationC] =
+ keymap[EStdKeyApplicationD] =
+ keymap[EStdKeyApplicationE] =
+ keymap[EStdKeyApplicationF] =
+ keymap[EStdKeyYes] =
+ keymap[EStdKeyNo] =
+ keymap[EStdKeyIncBrightness] =
+ keymap[EStdKeyDecBrightness] =
+ keymap[EStdKeyCaseOpen] =
+ keymap[EStdKeyCaseClose] = */
+
+
+
+}
+
+
+int EPOC_HandleWsEvent(_THIS, const TWsEvent& aWsEvent)
+{
+ int posted = 0;
+ SDL_keysym keysym;
+
+// SDL_TRACE1("hws %d", aWsEvent.Type());
+
+ switch (aWsEvent.Type())
+ {
+ case EEventPointer: /* Mouse pointer events */
+ {
+/* const TPointerCursorMode mode = EpocSdlEnv::PointerMode();
+
+
+ if(mode == EPointerCursorNone)
+ {
+ return 0; //TODO: Find out why events are get despite of cursor should be off
+ }
+*/
+ const TPointerEvent* pointerEvent = aWsEvent.Pointer();
+ const TPoint mousePos = EpocSdlEnv::WindowCoordinates(pointerEvent->iPosition);
+
+ /*!! TODO Pointer do not yet work properly
+ //SDL_TRACE1("SDL: EPOC_HandleWsEvent, pointerEvent->iType=%d", pointerEvent->iType); //!!
+
+ if (Private->EPOC_ShrinkedHeight) {
+ mousePos.iY <<= 1; // Scale y coordinate to shrinked screen height
+ }
+ if (Private->EPOC_ShrinkedWidth) {
+ mousePos.iX <<= 1; // Scale x coordinate to shrinked screen width
+ }
+ */
+
+ posted += SDL_PrivateMouseMotion(0, 0, mousePos.iX, mousePos.iY); /* Absolute position on screen */
+
+ switch (pointerEvent->iType)
+ {
+ case TPointerEvent::EButton1Down:
+ posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_LEFT, 0, 0);
+ break;
+ case TPointerEvent::EButton1Up:
+ posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_LEFT, 0, 0);
+ break;
+ case TPointerEvent::EButton2Down:
+ posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_RIGHT, 0, 0);
+ break;
+ case TPointerEvent::EButton2Up:
+ posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_RIGHT, 0, 0);
+ break;
+ case TPointerEvent::EButton3Down:
+ posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_MIDDLE, 0, 0);
+ break;
+ case TPointerEvent::EButton3Up:
+ posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_MIDDLE, 0, 0);
+ break;
+ } // switch
+ break;
+ }
+
+ case EEventKeyDown: /* Key events */
+ {
+#ifdef SYMBIAN_CRYSTAL
+ // special case: 9300/9500 rocker down, simulate left mouse button
+ if (aWsEvent.Key()->iScanCode == EStdKeyDeviceA)
+ {
+ const TPointerCursorMode mode = Private->EPOC_WsSession.PointerCursorMode();
+ if(mode != EPointerCursorNone)
+ posted += SDL_PrivateMouseButton(SDL_PRESSED, SDL_BUTTON_LEFT, 0, 0);
+ }
+#endif
+ (void*)TranslateKey(_this, aWsEvent.Key()->iScanCode, &keysym);
+
+#ifndef DISABLE_JOYSTICK
+ /* Special handling */
+ switch((int)keysym.sym) {
+ case SDLK_CAPSLOCK:
+ if (!isCursorVisible) {
+ /* Enable virtual cursor */
+ HAL::Set(HAL::EMouseState, HAL::EMouseState_Visible);
+ }
+ else {
+ /* Disable virtual cursor */
+ HAL::Set(HAL::EMouseState, HAL::EMouseState_Invisible);
+ }
+ isCursorVisible = !isCursorVisible;
+ break;
+ }
+#endif
+ posted += SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
+ break;
+ }
+
+ case EEventKeyUp: /* Key events */
+ {
+#ifdef SYMBIAN_CRYSTAL
+ // special case: 9300/9500 rocker up, simulate left mouse button
+ if (aWsEvent.Key()->iScanCode == EStdKeyDeviceA)
+ {
+ posted += SDL_PrivateMouseButton(SDL_RELEASED, SDL_BUTTON_LEFT, 0, 0);
+ }
+#endif
+ posted += SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(_this, aWsEvent.Key()->iScanCode, &keysym));
+ break;
+ }
+
+ case EEventFocusGained: /* SDL window got focus */
+ {
+ Private->iIsWindowFocused = ETrue;
+ posted += SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS);
+ /* Draw window background and screen buffer */
+ DisableKeyBlocking(_this); //Markus: guess why:-)
+
+ //RedrawWindowL(_this);
+ break;
+ }
+
+ case EEventFocusLost: /* SDL window lost focus */
+ {
+
+ Private->iIsWindowFocused = EFalse;
+
+ posted += SDL_PrivateAppActive(0, SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS);
+
+
+ break;
+ }
+
+ case EEventModifiersChanged:
+ {
+ TModifiersChangedEvent* modEvent = aWsEvent.ModifiersChanged();
+ TUint modstate = KMOD_NONE;
+ if (modEvent->iModifiers == EModifierLeftShift)
+ modstate |= KMOD_LSHIFT;
+ if (modEvent->iModifiers == EModifierRightShift)
+ modstate |= KMOD_RSHIFT;
+ if (modEvent->iModifiers == EModifierLeftCtrl)
+ modstate |= KMOD_LCTRL;
+ if (modEvent->iModifiers == EModifierRightCtrl)
+ modstate |= KMOD_RCTRL;
+ if (modEvent->iModifiers == EModifierLeftAlt)
+ modstate |= KMOD_LALT;
+ if (modEvent->iModifiers == EModifierRightAlt)
+ modstate |= KMOD_RALT;
+ if (modEvent->iModifiers == EModifierLeftFunc)
+ modstate |= KMOD_LMETA;
+ if (modEvent->iModifiers == EModifierRightFunc)
+ modstate |= KMOD_RMETA;
+ if (modEvent->iModifiers == EModifierCapsLock)
+ modstate |= KMOD_CAPS;
+ SDL_SetModState(STATIC_CAST(SDLMod,(modstate | KMOD_LSHIFT)));
+ break;
+ }
+ case EEventScreenDeviceChanged:
+ {
+ EpocSdlEnv::WaitDeviceChange();
+ }
+ break;
+ default:
+ break;
+ }
+
+ return posted;
+}
+
+extern "C" {
+
+void EPOC_PumpEvents(_THIS)
+ {
+ MEventQueue& events = EpocSdlEnv::EventQueue();
+ while(events.HasData())
+ {
+ events.Lock();
+
+ //there have to be a copy, so we can release
+ //lock immediately. HandleWsEvent may cause
+ //deadlock otherwise.
+
+ const TWsEvent event = events.Shift();
+ events.Unlock();
+// const TWsEvent& event = events.Top();
+ EPOC_HandleWsEvent(_this, event);
+// events.Shift();
+ }
+ }
+
+
+
+void EPOC_InitOSKeymap(_THIS)
+ {
+ ResetKeyMap();
+ EpocSdlEnv::ObserverEvent(MSDLObserver::EEventKeyMapInit ,0);
+ }
+
+static SDL_keysym *TranslateKey(_THIS, int scancode, SDL_keysym *keysym)
+{
+// char debug[256];
+ //SDL_TRACE1("SDL: TranslateKey, scancode=%d", scancode); //!!
+
+ /* Set the keysym information */
+
+ keysym->scancode = scancode;
+
+ if ((scancode >= MAX_SCANCODE) &&
+ ((scancode - ENonCharacterKeyBase + 0x0081) >= MAX_SCANCODE)) {
+ SDL_SetError("Too big scancode");
+ keysym->scancode = SDLK_UNKNOWN;
+ keysym->mod = KMOD_NONE;
+ return keysym;
+ }
+
+ keysym->mod = SDL_GetModState();
+
+ /* Handle function keys: F1, F2, F3 ... */
+ if (keysym->mod & KMOD_META) {
+ if (scancode >= 'A' && scancode < ('A' + 24)) { /* first 32 alphabet keys */
+ switch(scancode) {
+ case 'Q': scancode = EStdKeyF1; break;
+ case 'W': scancode = EStdKeyF2; break;
+ case 'E': scancode = EStdKeyF3; break;
+ case 'R': scancode = EStdKeyF4; break;
+ case 'T': scancode = EStdKeyF5; break;
+ case 'Y': scancode = EStdKeyF6; break;
+ case 'U': scancode = EStdKeyF7; break;
+ case 'I': scancode = EStdKeyF8; break;
+ case 'A': scancode = EStdKeyF9; break;
+ case 'S': scancode = EStdKeyF10; break;
+ case 'D': scancode = EStdKeyF11; break;
+ case 'F': scancode = EStdKeyF12; break;
+ }
+ keysym->sym = keymap[scancode];
+ }
+ }
+
+ if (scancode >= ENonCharacterKeyBase) {
+ // Non character keys
+ keysym->sym = keymap[scancode -
+ ENonCharacterKeyBase + 0x0081]; // !!hard coded
+ } else {
+ keysym->sym = keymap[scancode];
+ }
+
+ /* Remap the arrow keys if the device is rotated */
+/*
+ if (Private->EPOC_ScreenOrientation == CFbsBitGc::EGraphicsOrientationRotated270) {
+ switch(keysym->sym) {
+ case SDLK_UP: keysym->sym = SDLK_LEFT; break;
+ case SDLK_DOWN: keysym->sym = SDLK_RIGHT; break;
+ case SDLK_LEFT: keysym->sym = SDLK_DOWN; break;
+ case SDLK_RIGHT:keysym->sym = SDLK_UP; break;
+ }
+ }
+*/
+ /* If UNICODE is on, get the UNICODE value for the key */
+ keysym->unicode = 0;
+
+#if 0 // !!TODO:unicode
+
+ if ( SDL_TranslateUNICODE )
+ {
+ /* Populate the unicode field with the ASCII value */
+ keysym->unicode = scancode;
+ }
+#endif
+
+ //!!
+ //sprintf(debug, "SDL: TranslateKey: keysym->scancode=%d, keysym->sym=%d, keysym->mod=%d",
+ // keysym->scancode, keysym->sym, keysym->mod);
+ //SDL_TRACE(debug); //!!
+
+ return(keysym);
+}
+
+} /* extern "C" */
+
+
diff --git a/distrib/sdl-1.2.15/src/video/symbian/EKA2/SDL_epocvideo.cpp b/distrib/sdl-1.2.15/src/video/symbian/EKA2/SDL_epocvideo.cpp
new file mode 100644
index 0000000..c15506d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/symbian/EKA2/SDL_epocvideo.cpp
@@ -0,0 +1,594 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@devolution.com
+*/
+
+/*
+ SDL_epocvideo.cpp
+ Epoc based SDL video driver implementation
+
+ Markus Mertama
+*/
+
+
+
+#include "epoc_sdl.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+extern "C" {
+#include "SDL_error.h"
+#include "SDL_timer.h"
+#include "SDL_video.h"
+#undef NULL
+#include "SDL_pixels_c.h"
+#include "SDL.h"
+#include "SDL_mouse.h"
+}
+
+#include "SDL_epocvideo.h"
+#include "SDL_epocevents_c.h"
+
+
+
+#include <coedef.h>
+#include <flogger.h>
+
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include "sdlepocapi.h"
+
+
+////////////////////////////////////////////////////////////////
+
+
+
+
+_LIT(KLibName, "SDL");
+
+void RDebug_Print_b(char* error_str, void* param)
+ {
+ TBuf8<128> error8((TUint8*)error_str);
+ TBuf<128> error;
+ error.Copy(error8);
+
+#ifndef TRACE_TO_FILE
+ if (param) //!! Do not work if the parameter is really 0!!
+ RDebug::Print(error, param);
+ else
+ RDebug::Print(error);
+#else
+ if (param) //!! Do not work if the parameter is really 0!!
+ RFileLogger::WriteFormat(KLibName, _L("SDL.txt"), EFileLoggingModeAppend, error, param);
+ else
+ RFileLogger::Write(KLibName, _L("SDL.txt"), EFileLoggingModeAppend, error);
+#endif
+
+ }
+
+extern "C" void RDebug_Print(char* error_str, void* param)
+ {
+ RDebug_Print_b(error_str, param);
+ }
+
+/*
+int Debug_AvailMem2()
+ {
+ //User::CompressAllHeaps();
+ TMemoryInfoV1Buf membuf;
+ User::LeaveIfError(UserHal::MemoryInfo(membuf));
+ TMemoryInfoV1 minfo = membuf();
+ return(minfo.iFreeRamInBytes);
+ }
+
+extern "C" int Debug_AvailMem()
+ {
+ return(Debug_AvailMem2());
+ }
+
+*/
+
+extern "C" {
+
+/* Initialization/Query functions */
+
+static int EPOC_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **EPOC_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *EPOC_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int EPOC_SetColors(_THIS, int firstcolor, int ncolors,
+ SDL_Color *colors);
+static void EPOC_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+
+static int EPOC_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int EPOC_LockHWSurface(_THIS, SDL_Surface *surface);
+static int EPOC_FlipHWSurface(_THIS, SDL_Surface *surface);
+static void EPOC_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void EPOC_FreeHWSurface(_THIS, SDL_Surface *surface);
+static void EPOC_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
+
+static int EPOC_Available(void);
+static SDL_VideoDevice *EPOC_CreateDevice(int devindex);
+
+void DrawBackground(_THIS);
+void DirectDraw(_THIS, int numrects, SDL_Rect *rects, TUint16* screenBuffer);
+void DirectDrawRotated(_THIS, int numrects, SDL_Rect *rects, TUint16* screenBuffer);
+
+/* Mouse functions */
+
+static WMcursor *EPOC_CreateWMCursor(_THIS, Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
+static void EPOC_FreeWMCursor(_THIS, WMcursor *cursor);
+static int EPOC_ShowWMCursor(_THIS, WMcursor *cursor);
+}
+
+
+extern "C"
+ {
+ struct WMcursor
+ {
+ };
+ }
+
+/* Epoc video driver bootstrap functions */
+
+
+static int EPOC_Available(void)
+ {
+ return 1; /* Always available */
+ }
+
+static void EPOC_DeleteDevice(SDL_VideoDevice *device)
+ {
+ User::Free(device->hidden);
+ User::Free(device);
+ }
+
+static SDL_VideoDevice *EPOC_CreateDevice(int /*devindex*/)
+ {
+ SDL_VideoDevice *device;
+
+ SDL_TRACE("SDL:EPOC_CreateDevice");
+
+ /* Allocate all variables that we free on delete */
+ device = static_cast<SDL_VideoDevice*>(User::Alloc(sizeof(SDL_VideoDevice)));
+ if ( device )
+ {
+ Mem::FillZ(device, (sizeof *device));
+ device->hidden = static_cast<struct SDL_PrivateVideoData*>
+ (User::Alloc((sizeof *device->hidden)));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) )
+ {
+ SDL_OutOfMemory();
+ if ( device ) {
+ User::Free(device);
+ }
+ return(0);
+ }
+ Mem::FillZ(device->hidden, (sizeof *device->hidden));
+
+ /* Set the function pointers */
+ device->VideoInit = EPOC_VideoInit;
+ device->ListModes = EPOC_ListModes;
+ device->SetVideoMode = EPOC_SetVideoMode;
+ device->SetColors = EPOC_SetColors;
+ device->UpdateRects = NULL;
+ device->VideoQuit = EPOC_VideoQuit;
+ device->AllocHWSurface = EPOC_AllocHWSurface;
+ device->CheckHWBlit = NULL;
+ device->FillHWRect = NULL;
+ device->SetHWColorKey = NULL;
+ device->SetHWAlpha = NULL;
+ device->LockHWSurface = EPOC_LockHWSurface;
+ device->UnlockHWSurface = EPOC_UnlockHWSurface;
+ device->FlipHWSurface = EPOC_FlipHWSurface;
+ device->FreeHWSurface = EPOC_FreeHWSurface;
+ device->SetIcon = NULL;
+ device->SetCaption = NULL;
+ device->GetWMInfo = NULL;
+ device->FreeWMCursor = EPOC_FreeWMCursor;
+ device->CreateWMCursor = EPOC_CreateWMCursor;
+ device->ShowWMCursor = EPOC_ShowWMCursor;
+ device->WarpWMCursor = NULL;
+ device->InitOSKeymap = EPOC_InitOSKeymap;
+ device->PumpEvents = EPOC_PumpEvents;
+ device->free = EPOC_DeleteDevice;
+
+ return device;
+}
+
+
+VideoBootStrap EPOC_bootstrap = {
+ "epoc\0\0\0", "EPOC system",
+ EPOC_Available, EPOC_CreateDevice
+};
+
+
+
+void DisableKeyBlocking(_THIS)
+ {
+ EpocSdlEnv::Request(EpocSdlEnv::EDisableKeyBlocking);
+ }
+
+void ConstructWindowL(_THIS)
+ {
+ SDL_TRACE("SDL:ConstructWindowL");
+ DisableKeyBlocking(_this); //disable key blocking
+ }
+
+
+int EPOC_VideoInit(_THIS, SDL_PixelFormat *vformat)
+ {
+ /* Construct Epoc window */
+
+ ConstructWindowL(_this);
+
+ /* Initialise Epoc frame buffer */
+
+
+ const TDisplayMode displayMode = EpocSdlEnv::DisplayMode();
+
+ /* The "best" video format should be returned to caller. */
+
+ vformat->BitsPerPixel = TDisplayModeUtils::NumDisplayModeBitsPerPixel(displayMode);
+ vformat->BytesPerPixel = TDisplayModeUtils::NumDisplayModeBitsPerPixel(displayMode) / 8;
+
+
+ //?? Private->iWindow->PointerFilter(EPointerFilterDrag, 0);
+
+ Private->iScreenPos = TPoint(0, 0);
+
+ Private->iRect.x = Private->iScreenPos.iX;
+ Private->iRect.y = Private->iScreenPos.iY;
+
+ const TSize sz = EpocSdlEnv::WindowSize();
+
+ Private->iRect.w = sz.iWidth;
+ Private->iRect.h = sz.iHeight;
+ Private->iRectPtr = &Private->iRect;
+
+ return(0);
+ }
+
+
+SDL_Rect **EPOC_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+ {
+ if(flags & SDL_HWSURFACE)
+ {
+ if(format->BytesPerPixel != 4) //in HW only full color is supported
+ return NULL;
+ }
+ if(flags & SDL_FULLSCREEN)
+ {
+ return &Private->iRectPtr;
+ }
+ return (SDL_Rect **)(-1); //everythingisok, unless too small shoes
+ }
+
+
+int EPOC_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+ {
+ if ((firstcolor+ncolors) > 256)
+ return -1;
+ TUint32 palette[256];
+ const TDisplayMode mode = EpocSdlEnv::DisplayMode();
+ if(TDisplayModeUtils::NumDisplayModeColors(mode) == 4096)
+ {
+ // Set 12 bit palette
+ for(int i = firstcolor; i < ncolors; i++)
+ {
+ // 4k value: 0000 rrrr gggg bbbb
+ TUint32 color4K = (colors[i].r & 0x0000f0) << 4;
+ color4K |= (colors[i].g & 0x0000f0);
+ color4K |= (colors[i].b & 0x0000f0) >> 4;
+ palette[i] = color4K;
+ }
+ }
+ else if(TDisplayModeUtils::NumDisplayModeColors(mode) == 65536)
+ {
+ for(int i = firstcolor; i < ncolors; i++)
+ {
+ // 64k-colour displays effectively support RGB values
+ // with 5 bits allocated to red, 6 to green and 5 to blue
+ // 64k value: rrrr rggg gggb bbbb
+ TUint32 color64K = (colors[i].r & 0x0000f8) << 8;
+ color64K |= (colors[i].g & 0x0000fc) << 3;
+ color64K |= (colors[i].b & 0x0000f8) >> 3;
+ palette[i] = color64K;
+ }
+ }
+ else if(TDisplayModeUtils::NumDisplayModeColors(mode) == 16777216)
+ {
+ for(int i = firstcolor; i < ncolors; i++)
+ {
+ // 16M-colour
+ //0000 0000 rrrr rrrr gggg gggg bbbb bbbb
+ TUint32 color16M = colors[i].r << 16;
+ color16M |= colors[i].g << 8;
+ color16M |= colors[i].b;
+ palette[i] = color16M;
+ }
+ }
+ else
+ {
+ return -2;
+ }
+ if(EpocSdlEnv::SetPalette(firstcolor, ncolors, palette) == KErrNone)
+ return 0;
+ return -1;
+ }
+
+
+/*
+void AllocHWSurfaceL(CFbsBitmap*& aBitmap, const TDisplayMode& aMode, const TSize& aSize)
+ {
+ aBitmap = new (ELeave) CFbsBitmap();
+ if(KErrNone != aBitmap->CreateHardwareBitmap(aSize, aMode,
+ EpocSdlEnv::EikonEnv().EikAppUi()->Application()->AppDllUid()))
+ //...if it fails - should we use wsbitmaps???
+ {//the good reason to use hw bitmaps is that they wont need lock heap
+ PANIC_IF_ERROR(aBitmap->Create(aSize, aMode));
+ }
+ }
+
+int CreateSurfaceL(_THIS, SDL_Surface* surface)
+ {
+ __ASSERT_ALWAYS(Private->iFrame == NULL, PANIC(KErrAlreadyExists));
+;
+ TInt dmode = EColorLast;
+
+ TDisplayMode displayMode;
+ EpocSdlEnv::GetDiplayMode(displayMode);
+
+ if(
+ TDisplayModeUtils::NumDisplayModeBitsPerPixel(displayMode)
+ == surface->format->BitsPerPixel)
+ {
+ dmode = displayMode;
+ }
+ else
+ {
+ --dmode;
+ while(TDisplayModeUtils::IsDisplayModeColor(TDisplayMode(dmode)) &&
+ TDisplayModeUtils::NumDisplayModeBitsPerPixel(TDisplayMode(dmode)) !=
+ surface->format->BitsPerPixel)
+ --dmode;
+ }
+
+ __ASSERT_ALWAYS(TDisplayModeUtils::IsDisplayModeColor(TDisplayMode(dmode)), PANIC(KErrNotSupported));
+ TRAPD(err, AllocHWSurfaceL(Private->iFrame, TDisplayMode(dmode), TSize(surface->w, surface->h)));
+ return err == KErrNone ? 0 : -1;
+ }
+*/
+
+TDisplayMode GetDisplayMode(TInt aBitsPerPixel)
+ {
+ const TDisplayMode displayMode = EpocSdlEnv::DisplayMode();
+ TInt dmode = EColorLast;
+ if(
+ TDisplayModeUtils::NumDisplayModeBitsPerPixel(displayMode)
+ == aBitsPerPixel)
+ {
+ dmode = displayMode;
+ }
+ else
+ {
+ --dmode;
+ while(TDisplayModeUtils::IsDisplayModeColor(TDisplayMode(dmode)) &&
+ TDisplayModeUtils::NumDisplayModeBitsPerPixel(TDisplayMode(dmode)) !=
+ aBitsPerPixel)
+ --dmode;
+ }
+ return TDisplayMode(dmode);
+ }
+
+SDL_Surface *EPOC_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+ {
+ const TSize screenSize = EpocSdlEnv::WindowSize(TSize(width, height));
+ if(width > screenSize.iWidth || height > screenSize.iHeight)
+ {
+ if(flags & SDL_FULLSCREEN)
+ {
+ width = screenSize.iWidth;
+ height = screenSize.iHeight;
+ }
+ else
+ return NULL;
+ }
+
+ if(current && current->pixels)
+ {
+ // free(current->pixels);
+ current->pixels = NULL;
+ }
+
+ if(!SDL_ReallocFormat(current, bpp, 0, 0, 0, 0))
+ {
+ return(NULL);
+ }
+
+ current->flags = 0;
+ if(width == screenSize.iWidth && height == screenSize.iHeight)
+ current->flags |= SDL_FULLSCREEN;
+
+ const int numBytesPerPixel = ((bpp-1)>>3) + 1;
+ current->pitch = numBytesPerPixel * width; // Number of bytes in scanline
+
+ /* Set up the new mode framebuffer */
+ current->flags |= SDL_PREALLOC;
+
+ if(bpp <= 8)
+ current->flags |= SDL_HWPALETTE;
+
+ User::Free(Private->iSwSurface);
+ current->pixels = NULL;
+ Private->iSwSurface = NULL;
+
+ if(flags & SDL_HWSURFACE)
+ {
+ current->flags |= SDL_HWSURFACE;
+ // current->pixels = NULL;
+ // Private->iSwSurface = NULL;
+ }
+ else
+ {
+ current->flags |= SDL_SWSURFACE;
+ const TInt surfacesize = width * height * numBytesPerPixel;
+ Private->iSwSurfaceSize = TSize(width, height);
+ delete Private->iSwSurface;
+ Private->iSwSurface = NULL;
+ current->pixels = (TUint8*) User::AllocL(surfacesize);
+ Private->iSwSurface = (TUint8*) current->pixels;
+ const TInt err = EpocSdlEnv::AllocSwSurface
+ (TSize(width, height), GetDisplayMode(current->format->BitsPerPixel));
+ if(err != KErrNone)
+ return NULL;
+ }
+
+ current->w = width;
+ current->h = height;
+
+
+
+ /* Set the blit function */
+ _this->UpdateRects = EPOC_DirectUpdate;
+
+ /*
+ * Logic for getting suitable screen dimensions, offset, scaling and orientation
+ */
+
+
+ /* Centralize game window on device screen */
+
+
+ Private->iScreenPos.iX = Max(0, (screenSize.iWidth - width) / 2);
+ Private->iScreenPos.iY = Max(0, (screenSize.iHeight - height) / 2);
+
+ // delete (Private->iFrame);
+// Private->iFrame = NULL;
+
+ // TRAPD(err, CreateSurfaceL(_this, current));
+ // PANIC_IF_ERROR(err);
+
+ SDL_TRACE1("View width %d", width);
+ SDL_TRACE1("View height %d", height);
+ SDL_TRACE1("View bmode %d", bpp);
+ SDL_TRACE1("View x %d", Private->iScreenPos.iX);
+ SDL_TRACE1("View y %d", Private->iScreenPos.iY);
+
+ EpocSdlEnv::LockPalette(EFalse);
+ /* We're done */
+ return(current);
+}
+
+
+
+static int EPOC_AllocHWSurface(_THIS, SDL_Surface* surface)
+ {
+ return KErrNone == EpocSdlEnv::AllocHwSurface(TSize(surface->w, surface->h), GetDisplayMode(surface->format->BitsPerPixel));
+ }
+
+static void EPOC_FreeHWSurface(_THIS, SDL_Surface* /*surface*/)
+ {
+ }
+
+static int EPOC_LockHWSurface(_THIS, SDL_Surface* surface)
+ {
+ if(EpocSdlEnv::IsDsaAvailable())
+ {
+ TUint8* address = EpocSdlEnv::LockHwSurface();
+ if(address != NULL)
+ {
+ surface->pixels = address;
+ return 1;
+ }
+ }
+ return 0;
+ }
+static void EPOC_UnlockHWSurface(_THIS, SDL_Surface* /*surface*/)
+ {
+ EpocSdlEnv::UnlockHwSurface();
+ }
+
+static int EPOC_FlipHWSurface(_THIS, SDL_Surface* /*surface*/)
+ {
+ return(0);
+ }
+
+static void EPOC_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
+ {
+ if(EpocSdlEnv::IsDsaAvailable())
+ {
+ if(Private->iSwSurface)
+ {
+ const TRect target(Private->iScreenPos, Private->iSwSurfaceSize);
+ for(TInt i = 0; i < numrects ;i++)
+ {
+ const TRect rect(TPoint(rects[i].x, rects[i].y),
+ TSize(rects[i].w, rects[i].h));
+ if(!EpocSdlEnv::AddUpdateRect(Private->iSwSurface, rect, target))
+ return; //not succesful
+ }
+ EpocSdlEnv::UpdateSwSurface();
+ }
+ SDL_PauseAudio(0);
+ }
+ else
+ {
+ SDL_PauseAudio(1);
+ EpocSdlEnv::WaitDsaAvailable();
+ }
+ }
+
+
+/* Note: If we are terminated, this could be called in the middle of
+ another SDL video routine -- notably UpdateRects.
+*/
+void EPOC_VideoQuit(_THIS)
+ {
+// delete Private->iFrame;
+// Private->iFrame = NULL;
+ User::Free(Private->iSwSurface);
+ Private->iSwSurface = NULL;
+ EpocSdlEnv::FreeSurface();
+ }
+
+
+
+
+WMcursor *EPOC_CreateWMCursor(_THIS, Uint8* /*data*/, Uint8* /*mask*/, int /*w*/, int /*h*/, int /*hot_x*/, int /*hot_y*/)
+ {
+ return (WMcursor*) 1; //hii! prevents SDL to view a std cursor
+ }
+
+void EPOC_FreeWMCursor(_THIS, WMcursor* /*cursor*/)
+ {
+ }
+
+int EPOC_ShowWMCursor(_THIS, WMcursor *cursor)
+ {
+ return true;
+ }
+
diff --git a/distrib/sdl-1.2.15/src/video/symbian/EKA2/SDL_epocvideo.h b/distrib/sdl-1.2.15/src/video/symbian/EKA2/SDL_epocvideo.h
new file mode 100644
index 0000000..5aa3a20
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/symbian/EKA2/SDL_epocvideo.h
@@ -0,0 +1,51 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@devolution.com
+*/
+
+#ifndef EPOCVIDEO_H
+#define EPOCVIDEO_H
+
+#include<w32std.h>
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *_this
+#define Private _this->hidden
+
+class CFbsBitmap;
+
+struct SDL_VideoDevice;
+void DisableKeyBlocking(SDL_VideoDevice*);
+
+struct SDL_PrivateVideoData
+ {
+ TPoint iScreenPos;
+ TBool iIsWindowFocused;
+ TSize iSwSurfaceSize;
+ TUint8* iSwSurface;
+ SDL_Rect iRect; //same info in SDL format
+ SDL_Rect* iRectPtr;
+ };
+
+#endif
+
+
+
+
diff --git a/distrib/sdl-1.2.15/src/video/symbian/EKA2/dsa.cpp b/distrib/sdl-1.2.15/src/video/symbian/EKA2/dsa.cpp
new file mode 100644
index 0000000..07b1ab4
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/symbian/EKA2/dsa.cpp
@@ -0,0 +1,1505 @@
+#include "dsa.h"
+#include "sdlepocapi.h"
+#include <cdsb.h>
+
+
+LOCAL_C TInt BytesPerPixel(TDisplayMode aMode)
+ {
+ return ((TDisplayModeUtils::NumDisplayModeBitsPerPixel(aMode) - 1) >> 3) + 1;
+ }
+
+
+
+
+template<class T>
+NONSHARABLE_CLASS(CBitmapSurface) : public T
+ {
+public:
+ CBitmapSurface(RWsSession& aSession);
+private:
+ void ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice);
+ ~CBitmapSurface();
+ TUint8* LockSurface();
+ void UnlockHwSurface();
+ void CreateSurfaceL();
+ void Wipe(TInt aLength);
+ void Free();
+ void Update(CFbsBitmap& aBmp);
+ TInt ExternalUpdate();
+private:
+ CFbsBitmap* iBmp;
+ CFbsBitmap* iCopyBmp;
+ };
+
+
+template<class T>
+void CBitmapSurface<T>::ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice)
+ {
+ delete iCopyBmp;
+ iCopyBmp = NULL;
+ iCopyBmp = new (ELeave) CFbsBitmap();
+ T::ConstructL(aWindow, aDevice);
+ }
+
+template<class T>
+CBitmapSurface<T>::CBitmapSurface(RWsSession& aSession) : T(aSession)
+ {
+ }
+
+template<class T>
+void CBitmapSurface<T>::Free()
+ {
+ delete iBmp;
+ iBmp = NULL;
+ T::Free();
+ }
+
+template<class T>
+CBitmapSurface<T>::~CBitmapSurface()
+ {
+ __ASSERT_DEBUG(iBmp == NULL, PANIC(KErrNotReady));
+ delete iCopyBmp;
+ }
+
+template<class T>
+TUint8* CBitmapSurface<T>::LockSurface()
+ {
+ iBmp->LockHeap();
+ return reinterpret_cast<TUint8*>(iBmp->DataAddress());
+ }
+
+
+template<class T>
+void CBitmapSurface<T>::UnlockHwSurface()
+ {
+ iBmp->UnlockHeap();
+ T::SetUpdating(EFalse);
+ Update(*iBmp);
+ }
+
+
+template<class T>
+void CBitmapSurface<T>::Update(CFbsBitmap& aBmp)
+ {
+ if(!T::Blitter(aBmp))
+ {
+ if(T::SwSize() == T::HwRect().Size())
+ T::Gc().BitBlt(T::HwRect().iTl, &aBmp);
+ else
+ T::Gc().DrawBitmap(T::HwRect(), &aBmp);
+ }
+ T::DrawOverlays();
+ T::CompleteUpdate();
+ }
+
+template<class T>
+void CBitmapSurface<T>::CreateSurfaceL()
+ {
+ Free();
+ iBmp = new (ELeave) CFbsBitmap();
+ User::LeaveIfError(iBmp->Create(T::SwSize(), T::DisplayMode()));
+ T::CreateSurfaceL(*iBmp);
+ }
+
+template<class T>
+void CBitmapSurface<T>::Wipe(TInt aLength) //dont call in drawing
+ {
+ iBmp->LockHeap();
+ Mem::FillZ(iBmp->DataAddress(), aLength);
+ iBmp->UnlockHeap();
+ }
+
+template<class T>
+TInt CBitmapSurface<T>::ExternalUpdate()
+ {
+ if(iCopyBmp->Handle() == 0)
+ {
+ const TInt err = iCopyBmp->Duplicate(iBmp->Handle());
+ if(err != KErrNone)
+ return err;
+ }
+ Update(*iCopyBmp);
+ return KErrNone;
+ }
+
+
+//////////////////////////////////////////////////////////////////////
+
+
+
+NONSHARABLE_CLASS(CDsaBitgdi) : public CDsa
+ {
+public:
+ CDsaBitgdi(RWsSession& aSession);
+protected:
+ void ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice);
+ CBitmapContext& Gc();
+ void CompleteUpdate();
+ ~CDsaBitgdi();
+ void CreateSurfaceL(CFbsBitmap& aBmp);
+ void Free();
+ void UnlockHWSurfaceRequestComplete();
+private:
+ void Resume();
+
+ CFbsBitGc* iGc;
+ CFbsDevice* iDevice;
+ CFbsBitmap* iBitGdiBmp;
+ CWindowGc* iWinGc;
+ RWindow* iWindow;
+ TInt iHandle;
+ };
+
+
+CDsaBitgdi::CDsaBitgdi(RWsSession& aSession) : CDsa(aSession)
+ {
+ }
+
+CDsaBitgdi::~CDsaBitgdi()
+ {
+ delete iWinGc;
+ delete iBitGdiBmp;
+ }
+
+void CDsaBitgdi::CompleteUpdate()
+ {
+ EpocSdlEnv::Request(CDsa::ERequestUpdate);
+ }
+
+
+void CDsaBitgdi::UnlockHWSurfaceRequestComplete()
+ {
+ if(iHandle == 0)
+ return;
+
+ if(iBitGdiBmp == NULL)
+ {
+ iBitGdiBmp = new CFbsBitmap();
+ if(iBitGdiBmp == NULL)
+ return;
+ iBitGdiBmp->Duplicate(iHandle);
+ }
+
+ iWindow->Invalidate();
+
+ iWindow->BeginRedraw();
+ iWinGc->Activate(*iWindow);
+ iWinGc->BitBlt(TPoint(0, 0), iBitGdiBmp);
+ iWinGc->Deactivate();
+ iWindow->EndRedraw();
+ }
+
+void CDsaBitgdi::Resume()
+ {
+ Start();
+ }
+
+CBitmapContext& CDsaBitgdi::Gc()
+ {
+ return *iGc;
+ }
+
+ void CDsaBitgdi::ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice)
+ {
+
+ delete iBitGdiBmp;
+ iBitGdiBmp = NULL;
+ delete iWinGc;
+ iWinGc = NULL;
+ iHandle = 0;
+
+ iWindow = &aWindow;
+ User::LeaveIfError(aDevice.CreateContext(iWinGc));
+ CDsa::ConstructL(aWindow, aDevice);
+ Start();
+ }
+
+void CDsaBitgdi::CreateSurfaceL(CFbsBitmap& aBmp)
+ {
+ iDevice = CFbsBitmapDevice::NewL(&aBmp);
+ User::LeaveIfError(iDevice->CreateContext(iGc));
+ iHandle = aBmp.Handle();
+ }
+
+void CDsaBitgdi::Free()
+ {
+ delete iGc;
+ iGc = NULL;
+ delete iDevice;
+ iDevice = NULL;
+ }
+
+////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////
+
+NONSHARABLE_CLASS(CDsaBase) : public CDsa, public MDirectScreenAccess
+ {
+protected:
+ inline CDirectScreenAccess& Dsa() const;
+ CDsaBase(RWsSession& aSession);
+ ~CDsaBase();
+ void ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice);
+ void Stop();
+ void Resume();
+ CBitmapContext& Gc();
+protected:
+ CDirectScreenAccess* iDsa;
+private:
+ void AbortNow(RDirectScreenAccess::TTerminationReasons aReason);
+ void Restart(RDirectScreenAccess::TTerminationReasons aReason);
+private:
+ void RestartL();
+ };
+
+
+inline CDirectScreenAccess& CDsaBase::Dsa() const
+ {
+ return *iDsa;
+ }
+
+
+CDsaBase::CDsaBase(RWsSession& aSession) : CDsa(aSession)
+ {
+ }
+
+CBitmapContext& CDsaBase::Gc()
+ {
+ return *Dsa().Gc();
+ }
+
+void CDsaBase::ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice)
+ {
+ CDsa::ConstructL(aWindow, aDevice);
+ if(iDsa != NULL)
+ {
+ iDsa->Cancel();
+ delete iDsa;
+ iDsa = NULL;
+ }
+
+ iDsa = CDirectScreenAccess::NewL(
+ Session(),
+ aDevice,
+ aWindow,
+ *this);
+ RestartL();
+ }
+
+void CDsaBase::Resume()
+ {
+ if(Stopped())
+ Restart(RDirectScreenAccess::ETerminateRegion);
+ }
+
+CDsaBase::~CDsaBase()
+ {
+ if(iDsa != NULL)
+ {
+ iDsa->Cancel();
+ }
+ delete iDsa;
+ }
+
+
+void CDsaBase::RestartL()
+ {
+
+
+ iDsa->StartL();
+
+ const RRegion* r = iDsa->DrawingRegion();
+ const TRect rect = r->BoundingRect();
+ iDsa->Gc()->SetClippingRegion(r);
+
+ if(rect != ScreenRect())
+ {
+ return ;
+ }
+
+
+ SetTargetRect();
+ RecreateL();
+
+ Start();
+
+
+ }
+
+void CDsaBase::AbortNow(RDirectScreenAccess::TTerminationReasons /*aReason*/)
+ {
+ Stop();
+ }
+
+void CDsaBase::Restart(RDirectScreenAccess::TTerminationReasons aReason)
+ {
+ if(aReason == RDirectScreenAccess::ETerminateRegion) //auto restart
+ {
+ TRAPD(err, RestartL());
+ PANIC_IF_ERROR(err);
+ }
+ }
+
+
+void CDsaBase::Stop()
+ {
+ CDsa::Stop();
+ iDsa->Cancel();
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+NONSHARABLE_CLASS(TDsa)
+ {
+ public:
+ inline TDsa(const CDsa& aDsa);
+ inline TBool IsFlip() const;
+ inline TBool IsTurn() const;
+ inline const TSize& SwSize() const;
+ inline void Copy(TUint32* aTarget, const TUint8* aSrc, TInt aBytes, TInt aHeight) const;
+ private:
+ const CDsa& iDsa;
+ };
+
+
+
+
+inline TDsa::TDsa(const CDsa& aDsa) : iDsa(aDsa)
+ {
+ }
+
+inline TBool TDsa::IsTurn() const
+ {
+ return iDsa.iStateFlags & CDsa::EOrientation90;
+ }
+
+inline TBool TDsa::IsFlip() const
+ {
+ return iDsa.iStateFlags & CDsa::EOrientation180;
+ }
+
+inline const TSize& TDsa::SwSize() const
+ {
+ return iDsa.SwSize();
+ }
+
+inline void TDsa::Copy(TUint32* aTarget, const TUint8* aSrc, TInt aBytes, TInt aHeight) const
+ {
+ iDsa.iCopyFunction(iDsa, aTarget, aSrc, aBytes, aHeight);
+ }
+
+template<class T, class S>
+void ClipCopy(const TDsa& iDsa, TUint8* aTarget,
+ const TUint8* aSource,
+ const TRect& aUpdateRect,
+ const TRect& aSourceRect)
+ {
+ const S* source = reinterpret_cast<const S*>(aSource);
+ const TInt lineWidth = aSourceRect.Width();
+
+ source += (aUpdateRect.iTl.iY * lineWidth);
+ const TInt sourceStartOffset = aUpdateRect.iTl.iX;
+ source += sourceStartOffset;
+
+ T* targetPtr = reinterpret_cast<T*>(aTarget);
+
+ const TInt scanLineWidth = iDsa.SwSize().iWidth;
+
+ targetPtr += (aSourceRect.iTl.iY + aUpdateRect.iTl.iY ) * scanLineWidth;
+ const TInt targetStartOffset = (aUpdateRect.iTl.iX + aSourceRect.iTl.iX);
+
+ targetPtr += targetStartOffset;
+
+
+ const TInt height = aUpdateRect.Height();
+
+ const TInt lineMove = iDsa.IsTurn() ? 1 : lineWidth;
+ const TInt copyLen = aUpdateRect.Width();
+
+
+ if(iDsa.IsFlip())
+ {
+
+ targetPtr += scanLineWidth * (height - 1);
+
+ for(TInt i = 0; i < height; i++) //source is always smaller
+ {
+ iDsa.Copy(reinterpret_cast<TUint32*>(targetPtr), reinterpret_cast<const TUint8*>(source), copyLen, height);
+ source += lineMove;
+ targetPtr -= scanLineWidth;
+ }
+ }
+ else
+ {
+
+
+ for(TInt i = 0; i < height; i++) //source is always smaller
+ {
+ iDsa.Copy(reinterpret_cast<TUint32*>(targetPtr), reinterpret_cast<const TUint8*>(source), copyLen, height);
+ source += lineMove;
+ targetPtr += scanLineWidth; // >> 2;
+ }
+ }
+
+ }
+
+
+
+NONSHARABLE_CLASS(CDsaA) : public CDsaBase
+ {
+ public:
+ CDsaA(RWsSession& aSession);
+ protected:
+ void ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice);
+ void CompleteUpdate();
+ void CreateSurfaceL(CFbsBitmap& aBmp);
+ void Free();
+ void UnlockHWSurfaceRequestComplete();
+ };
+
+
+CDsaA::CDsaA(RWsSession& aSession) : CDsaBase(aSession)
+ {
+ }
+
+
+void CDsaA::ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice)
+ {
+ CDsaBase::ConstructL(aWindow, aDevice);
+ }
+
+void CDsaA::CompleteUpdate()
+ {
+ iDsa->ScreenDevice()->Update();
+ }
+
+void CDsaA::CreateSurfaceL(CFbsBitmap& /*aBmp*/)
+ {
+ }
+
+void CDsaA::Free()
+ {
+
+ }
+
+void CDsaA::UnlockHWSurfaceRequestComplete()
+ {
+ PANIC(KErrNotSupported);
+ }
+
+
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+NONSHARABLE_CLASS(MDsbObs)
+ {
+ public:
+ virtual void SurfaceReady() = 0;
+ virtual CDirectScreenBitmap& Dsb() = 0;
+ };
+
+NONSHARABLE_CLASS(CDsbSurface) : public CActive
+ {
+ public:
+ CDsbSurface(MDsbObs& aDsb);
+ TUint8* Address();
+ void Complete();
+ ~CDsbSurface();
+ private:
+ void RunL();
+ void DoCancel();
+ private:
+ MDsbObs& iDsb;
+ TUint8* iAddress;
+ };
+
+CDsbSurface::CDsbSurface(MDsbObs& aDsb) : CActive(CActive::EPriorityHigh) , iDsb(aDsb)
+ {
+ CActiveScheduler::Add(this);
+ }
+
+CDsbSurface::~CDsbSurface()
+ {
+ Cancel();
+ }
+
+void CDsbSurface::Complete()
+ {
+ if(iAddress != NULL && !IsActive())
+ {
+ iAddress = NULL;
+ SetActive();
+ iDsb.Dsb().EndUpdate(iStatus);
+ }
+ }
+
+TUint8* CDsbSurface::Address()
+ {
+ if(iAddress == NULL && !IsActive())
+ {
+ TAcceleratedBitmapInfo info;
+ if(KErrNone == iDsb.Dsb().BeginUpdate(info))
+ iAddress = info.iAddress;
+ }
+ return iAddress;
+ }
+
+void CDsbSurface::RunL()
+ {
+ iDsb.SurfaceReady();
+ }
+
+void CDsbSurface::DoCancel()
+ {
+ //empty
+ }
+
+NONSHARABLE_CLASS(CDsaB) : public CDsaBase,
+ public MDsbObs
+ {
+ public:
+ CDsaB(RWsSession& aSession, TInt aFlags);
+ private:
+ ~CDsaB();
+ TUint8* LockSurface();
+ void UnlockHWSurfaceRequestComplete();
+ void UnlockHwSurface();
+ void CreateSurfaceL();
+ void Wipe(TInt aLength);
+ void RecreateL();
+ void ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice);
+ CDirectScreenBitmap& Dsb();
+ void SurfaceReady();
+ TInt ExternalUpdate();
+ private:
+ CDsbSurface* iSurface1;
+ CDsbSurface* iSurface2;
+ CDirectScreenBitmap* iDsb;
+ TInt iType;
+ };
+
+CDsaB::CDsaB(RWsSession& aSession, TInt aFlags) : CDsaBase(aSession), iType(aFlags)
+ {
+ }
+
+
+
+void CDsaB::UnlockHWSurfaceRequestComplete()
+ {
+ iSurface1->Complete();
+ if(iSurface2 != NULL)
+ iSurface2->Complete();
+ }
+
+void CDsaB::CreateSurfaceL()
+ {
+ __ASSERT_ALWAYS(SwSize() == HwRect().Size(), PANIC(KErrNotSupported));
+ }
+
+void CDsaB::Wipe(TInt aLength) //dont call in drawing
+ {
+ TUint8* addr = LockSurface();
+ if(addr != NULL)
+ {
+ Mem::FillZ(addr, aLength);
+ UnlockHwSurface();
+ }
+ }
+
+
+void CDsaB::UnlockHwSurface()
+ {
+ EpocSdlEnv::Request(CDsa::ERequestUpdate);
+ }
+
+TUint8* CDsaB::LockSurface()
+ {
+ TUint8* addr = iSurface1->Address();
+ if(addr == NULL && iSurface2 != NULL)
+ addr = iSurface2->Address();
+ SetUpdating(addr == NULL);
+ return addr;
+ }
+
+void CDsaB::SurfaceReady()
+ {
+ SetUpdating(EFalse);
+ }
+
+CDirectScreenBitmap& CDsaB::Dsb()
+ {
+ return *iDsb;
+ }
+
+void CDsaB::ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice)
+ {
+ if(iDsb == NULL)
+ iDsb = CDirectScreenBitmap::NewL();
+ CDsaBase::ConstructL(aWindow, aDevice);
+ if(iSurface1 == NULL)
+ iSurface1 = new (ELeave) CDsbSurface(*this);
+ if(iSurface2 == NULL && iType & CDirectScreenBitmap::EDoubleBuffer)
+ iSurface2 = new (ELeave) CDsbSurface(*this);
+ }
+
+CDsaB::~CDsaB()
+ {
+ delete iSurface1;
+ delete iSurface2;
+ delete iDsb;
+ }
+
+void CDsaB::RecreateL()
+ {
+ iDsb->Close();
+ iDsb->Create(HwRect(), CDirectScreenBitmap::TSettingsFlags(iType));
+ }
+
+TInt CDsaB::ExternalUpdate()
+ {
+ if(LockSurface())
+ {
+ UnlockHWSurfaceRequestComplete();
+ return KErrNone;
+ }
+ return KErrNotReady;
+ }
+
+
+/////////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+
+CDsa* CDsa::CreateL(RWsSession& aSession)
+ {
+ if(EpocSdlEnv::Flags(CSDL::EDrawModeDSB))
+ {
+ TInt flags = CDirectScreenBitmap::ENone;
+ if(EpocSdlEnv::Flags(CSDL::EDrawModeDSBDoubleBuffer))
+ flags |= CDirectScreenBitmap::EDoubleBuffer;
+ if(EpocSdlEnv::Flags(CSDL::EDrawModeDSBIncrementalUpdate))
+ flags |= CDirectScreenBitmap::EIncrementalUpdate;
+ return new (ELeave) CDsaB(aSession, flags);
+ }
+ else if(EpocSdlEnv::Flags(CSDL::EDrawModeGdi))
+ {
+ return new (ELeave) CBitmapSurface<CDsaBitgdi>(aSession);
+ }
+ else
+ {
+ return new (ELeave) CBitmapSurface<CDsaA>(aSession);
+ }
+ }
+
+
+void CDsa::RecreateL()
+ {
+ }
+
+void CDsa::Free()
+ {
+ }
+
+TSize CDsa::WindowSize() const
+ {
+ TSize size = iSwSize;
+ if(iStateFlags & EOrientation90)
+ {
+ const TInt tmp = size.iWidth;
+ size.iWidth = size.iHeight;
+ size.iHeight = tmp;
+ }
+ return size;
+ }
+
+void CDsa::SetSuspend()
+ {
+ iStateFlags |= ESdlThreadSuspend;
+ }
+
+
+void CDsa::SetUpdating(TBool aUpdate)
+ {
+ if(aUpdate)
+ iStateFlags |= EUpdating;
+ else
+ iStateFlags &= ~EUpdating;
+ }
+
+
+TBool CDsa::Stopped() const
+ {
+ return (iStateFlags & ESdlThreadExplicitStop);
+ }
+
+void CDsa::SetOrientation(CSDL::TOrientationMode aOrientation)
+ {
+ TInt flags = 0;
+ switch(aOrientation)
+ {
+ case CSDL::EOrientation90:
+ flags = EOrientation90;
+ break;
+ case CSDL::EOrientation180:
+ flags = EOrientation180;
+ break;
+ case CSDL::EOrientation270:
+ flags = EOrientation90 | EOrientation180;
+ break;
+ case CSDL::EOrientation0:
+ flags = 0;
+ break;
+ }
+ if(flags != (iStateFlags & EOrientationFlags))
+ {
+ iStateFlags |= EOrientationChanged;
+ iNewFlags = flags; //cannot be set during drawing...
+ }
+ }
+
+CDsa::~CDsa()
+ {
+ iOverlays.Close();
+ User::Free(iLut256);
+ }
+
+void CDsa::ConstructL(RWindow& aWindow, CWsScreenDevice& /*aDevice*/)
+ {
+ if(iLut256 == NULL)
+ iLut256 = (TUint32*) User::AllocL(256 * sizeof(TUint32));
+ iTargetMode = aWindow.DisplayMode();
+ iTargetBpp = BytesPerPixel(DisplayMode());
+ iScreenRect = TRect(aWindow.Position(), aWindow.Size());
+ SetTargetRect();
+ }
+
+void CDsa::DrawOverlays()
+ {
+ const TInt last = iOverlays.Count() - 1;
+ for(TInt i = last; i >= 0 ; i--)
+ iOverlays[i].iOverlay->Draw(Gc(), HwRect(), SwSize());
+ }
+
+TInt CDsa::AppendOverlay(MOverlay& aOverlay, TInt aPriority)
+ {
+ TInt i;
+ for(i = 0; i < iOverlays.Count() && iOverlays[i].iPriority < aPriority; i++)
+ {}
+ const TOverlay overlay = {&aOverlay, aPriority};
+ return iOverlays.Insert(overlay, i);
+ }
+
+TInt CDsa::RemoveOverlay(MOverlay& aOverlay)
+ {
+ for(TInt i = 0; i < iOverlays.Count(); i++)
+ {
+ if(iOverlays[i].iOverlay == &aOverlay)
+ {
+ iOverlays.Remove(i);
+ return KErrNone;
+ }
+ }
+ return KErrNotFound;
+ }
+
+void CDsa::LockPalette(TBool aLock)
+ {
+ if(aLock)
+ iStateFlags |= EPaletteLocked;
+ else
+ iStateFlags &= ~EPaletteLocked;
+ }
+TInt CDsa::SetPalette(TInt aFirst, TInt aCount, TUint32* aPalette)
+ {
+ if(iLut256 == NULL)
+ return KErrNotFound;
+ const TInt count = aCount - aFirst;
+ if(count > 256)
+ return KErrArgument;
+ if(iStateFlags & EPaletteLocked)
+ return KErrNone;
+ for(TInt i = aFirst; i < count; i++) //not so busy here:-)
+ {
+ iLut256[i] = aPalette[i];
+ }
+ return KErrNone;
+ }
+
+
+
+
+
+CDsa::CDsa(RWsSession& aSession) :
+ iStateFlags(0),
+ iSession(aSession)
+
+ {
+// CActiveScheduler::Add(this);
+ iCFTable[0] = CopyMem;
+ iCFTable[1] = CopyMemFlipReversed;
+ iCFTable[2] = CopyMemReversed;
+ iCFTable[3] = CopyMemFlip;
+
+ iCFTable[4] = Copy256;
+ iCFTable[5] = Copy256FlipReversed;
+ iCFTable[6] = Copy256Reversed;
+ iCFTable[7] = Copy256Flip;
+
+
+ iCFTable[8] = CopySlow;
+ iCFTable[9] = CopySlowFlipReversed;
+ iCFTable[10] = CopySlowReversed;
+ iCFTable[11] = CopySlowFlip;
+ }
+
+RWsSession& CDsa::Session()
+ {
+ return iSession;
+ }
+
+TInt CDsa::RedrawRequest()
+ {
+ if(!(iStateFlags & (EUpdating) && (iStateFlags & ERunning)))
+ {
+ return ExternalUpdate();
+ }
+ return KErrNotReady;
+ }
+
+TUint8* CDsa::LockHwSurface()
+ {
+ if((iStateFlags & EUpdating) == 0) //else frame is skipped
+ {
+ return LockSurface();
+ }
+ return NULL;
+ }
+
+/*
+void CDsa::RunL()
+ {
+ iStateFlags &= ~EUpdating;
+ }
+
+
+void CDsa::DoCancel()
+ {
+ iStateFlags &= ~EUpdating;
+ //nothing can do, just wait?
+ }
+*/
+
+
+TInt CDsa::AllocSurface(TBool aHwSurface, const TSize& aSize, TDisplayMode aMode)
+ {
+ if(aHwSurface && aMode != DisplayMode())
+ return KErrArgument;
+
+ iSourceMode = aMode;
+
+ iSourceBpp = BytesPerPixel(aMode);
+
+ const TSize size = WindowSize();
+ if(aSize.iWidth > size.iWidth)
+ return KErrTooBig;
+ if(aSize.iHeight > size.iHeight)
+ return KErrTooBig;
+
+ TRAPD(err, CreateSurfaceL());
+ if(err != KErrNone)
+ return err;
+
+ SetCopyFunction();
+
+ return KErrNone;
+ }
+
+
+void CDsa::CreateZoomerL(const TSize& aSize)
+ {
+ iSwSize = aSize;
+ iStateFlags |= EResizeRequest;
+ CreateSurfaceL();
+ SetTargetRect();
+ }
+
+
+/*
+void SaveBmp(const TDesC& aName, const TAny* aData, TInt aLength, const TSize& aSz, TDisplayMode aMode)
+ {
+ CFbsBitmap* s = new CFbsBitmap();
+ s->Create(aSz, aMode);
+ s->LockHeap();
+ TUint32* addr = s->DataAddress();
+ Mem::Copy(addr, aData, aLength);
+ s->UnlockHeap();
+ s->Save(aName);
+ s->Reset();
+ delete s;
+ }
+
+void SaveBmp(const TDesC& aName, const TUint32* aData, const TSize& aSz)
+ {
+ CFbsBitmap* s = new CFbsBitmap();
+ s->Create(aSz, EColor64K);
+ TBitmapUtil bmp(s);
+ bmp.Begin(TPoint(0, 0));
+ for(TInt j = 0; j < aSz.iHeight; j++)
+ {
+ bmp.SetPos(TPoint(0, j));
+ for(TInt i = 0; i < aSz.iWidth; i++)
+ {
+ bmp.SetPixel(*aData);
+ aData++;
+ bmp.IncXPos();
+ }
+ }
+ bmp.End();
+ s->Save(aName);
+ s->Reset();
+ delete s;
+ }
+
+TBuf<16> FooName(TInt aFoo)
+ {
+ TBuf<16> b;
+ b.Format(_L("C:\\pic%d.mbm"), aFoo);
+ return b;
+ }
+
+*/
+
+
+void CDsa::ClipCopy(TUint8* aTarget,
+ const TUint8* aSource,
+ const TRect& aUpdateRect,
+ const TRect& aSourceRect) const
+ {
+ const TDsa dsa(*this);
+ switch(iSourceBpp)
+ {
+ case 1:
+ ::ClipCopy<TUint32, TUint8>(dsa, aTarget, aSource, aUpdateRect, aSourceRect);
+ break;
+ case 2:
+ ::ClipCopy<TUint32, TUint16>(dsa, aTarget, aSource, aUpdateRect, aSourceRect);
+ break;
+ case 4:
+ ::ClipCopy<TUint32, TUint32>(dsa, aTarget, aSource, aUpdateRect, aSourceRect);
+ break;
+ }
+ }
+
+
+void CDsa::Wipe() //dont call in drawing
+ {
+ if(IsDsaAvailable())
+ Wipe(iTargetBpp * SwSize().iWidth * SwSize().iHeight);
+ }
+
+void CDsa::SetCopyFunction()
+ {
+ //calculate offset to correct function in iCFTable according to given parameters
+ TInt function = 0;
+ const TInt KCopyFunctions = 4;
+ const TInt KOffsetToNative = 0;
+ const TInt KOffsetTo256 = KOffsetToNative + KCopyFunctions;
+ const TInt KOffsetToOtherModes = KOffsetTo256 + KCopyFunctions;
+ const TInt KOffsetTo90Functions = 1;
+ const TInt KOffsetTo180Functions = 2;
+
+ if(iSourceMode == DisplayMode())
+ function = KOffsetToNative; //0
+ else if(iSourceMode == EColor256)
+ function = KOffsetTo256; //4
+ else
+ function = KOffsetToOtherModes; //8
+
+ if(iStateFlags & EOrientation90)
+ function += KOffsetTo90Functions; // + 1
+ if(iStateFlags & EOrientation180)
+ function += KOffsetTo180Functions; //+ 2
+
+ iCopyFunction = iCFTable[function];
+
+ Wipe();
+ }
+
+inline void Rotate(TRect& aRect)
+ {
+ const TInt dx = aRect.iBr.iX - aRect.iTl.iX;
+ const TInt dy = aRect.iBr.iY - aRect.iTl.iY;
+
+ aRect.iBr.iX = aRect.iTl.iX + dy;
+ aRect.iBr.iY = aRect.iTl.iY + dx;
+
+ const TInt tmp = aRect.iTl.iX;
+ aRect.iTl.iX = aRect.iTl.iY;
+ aRect.iTl.iY = tmp;
+ }
+
+/*
+int bar = 0;
+*/
+
+TBool CDsa::AddUpdateRect(const TUint8* aBits, const TRect& aUpdateRect, const TRect& aRect)
+ {
+
+ if(iStateFlags & EOrientationChanged)
+ {
+ iStateFlags &= ~EOrientationFlags;
+ iStateFlags |= iNewFlags;
+ SetCopyFunction();
+ iStateFlags &= ~EOrientationChanged;
+ EpocSdlEnv::WaitDeviceChange();
+ return EFalse; //skip this frame as data is may be changed
+ }
+
+ if(iTargetAddr == NULL)
+ {
+ iTargetAddr = LockHwSurface();
+ }
+
+ TUint8* target = iTargetAddr;
+ if(target == NULL)
+ return EFalse;
+
+
+ TRect targetRect = TRect(TPoint(0, 0), SwSize());
+
+ TRect sourceRect = aRect;
+ TRect updateRect = aUpdateRect;
+
+// TPoint move(0, 0);
+
+
+ if(iStateFlags & EOrientation90)
+ {
+ Rotate(sourceRect);
+ Rotate(updateRect);
+ }
+
+ if(iSourceMode != DisplayMode() || targetRect != sourceRect || targetRect != updateRect || ((iStateFlags & EOrientationFlags) != 0))
+ {
+ sourceRect.Intersection(targetRect); //so source always smaller or equal than target
+ //updateRect.Intersection(targetRect);
+ ClipCopy(target, aBits, updateRect, sourceRect);
+ }
+ else
+ {
+ const TInt byteCount = aRect.Width() * aRect.Height() * iSourceBpp; //this could be stored
+ Mem::Copy(target, aBits, byteCount);
+ }
+
+ return ETrue;
+ }
+
+
+void CDsa::UpdateSwSurface()
+ {
+ iTargetAddr = NULL;
+ UnlockHwSurface(); //could be faster if does not use AO, but only check status before redraw, then no context switch needed
+ }
+
+
+
+
+void CDsa::DoStop()
+ {
+ if(IsDsaAvailable())
+ iStateFlags |= ESdlThreadExplicitStop;
+ Stop();
+ }
+
+
+void CDsa::Stop()
+ {
+ iStateFlags &= ~ERunning;
+ }
+
+void CDsa::Start()
+ {
+ iStateFlags |= ERunning;
+
+ iStateFlags &= ~ESdlThreadExplicitStop;
+
+ if(iStateFlags & ESdlThreadSuspend)
+ {
+ EpocSdlEnv::Resume();
+ iStateFlags &= ~ ESdlThreadSuspend;
+ }
+ EpocSdlEnv::ObserverEvent(MSDLObserver::EEventWindowReserved);
+ }
+
+
+TBool CDsa::Blitter(CFbsBitmap& aBmp)
+ {
+ return iBlitter && iBlitter->BitBlt(Gc(), aBmp, HwRect(), SwSize());
+ }
+
+void CDsa::SetBlitter(MBlitter* aBlitter)
+ {
+ iBlitter = aBlitter;
+ }
+
+
+TPoint CDsa::WindowCoordinates(const TPoint& aPoint) const
+ {
+ TPoint pos = aPoint - iScreenRect.iTl;
+ const TSize asz = iScreenRect.Size();
+ if(iStateFlags & EOrientation180)
+ {
+ pos.iX = asz.iWidth - pos.iX;
+ pos.iY = asz.iHeight - pos.iY;
+ }
+ if(iStateFlags & EOrientation90)
+ {
+ pos.iX = aPoint.iY;
+ pos.iY = aPoint.iX;
+ }
+ pos.iX <<= 16;
+ pos.iY <<= 16;
+ pos.iX /= asz.iWidth;
+ pos.iY /= asz.iHeight;
+ pos.iX *= iSwSize.iWidth;
+ pos.iY *= iSwSize.iHeight;
+ pos.iX >>= 16;
+ pos.iY >>= 16;
+ return pos;
+ }
+
+void CDsa::SetTargetRect()
+ {
+ iTargetRect = iScreenRect;
+ if(iStateFlags & EResizeRequest && EpocSdlEnv::Flags(CSDL::EAllowImageResizeKeepRatio))
+ {
+ const TSize asz = iScreenRect.Size();
+ const TSize sz = iSwSize;
+
+ TRect rect;
+
+ const TInt dh = (sz.iHeight << 16) / sz.iWidth;
+
+ if((asz.iWidth * dh ) >> 16 <= asz.iHeight)
+ {
+ rect.SetRect(TPoint(0, 0), TSize(asz.iWidth, (asz.iWidth * dh) >> 16));
+ }
+ else
+ {
+ const TInt dw = (sz.iWidth << 16) / sz.iHeight;
+ rect.SetRect(TPoint(0, 0), TSize((asz.iHeight * dw) >> 16, asz.iHeight));
+ }
+ rect.Move((asz.iWidth - rect.Size().iWidth) >> 1, (asz.iHeight - rect.Size().iHeight) >> 1);
+
+ iTargetRect = rect;
+ iTargetRect.Move(iScreenRect.iTl);
+
+ }
+ if(!(iStateFlags & EResizeRequest))
+ iSwSize = iScreenRect.Size();
+
+ }
+
+
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+void CDsa::Copy256(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt)
+ {
+ TUint32* target = aTarget;
+ const TUint32* endt = target + aBytes;
+ const TUint8* source = aSource;
+ while(target < endt)
+ {
+ *target++ = aDsa.iLut256[*source++];
+ }
+ }
+
+void CDsa::Copy256Reversed(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt)
+ {
+ const TUint32* target = aTarget;
+ TUint32* endt = aTarget + aBytes;
+ const TUint8* source = aSource;
+ while(target < endt)
+ {
+ *(--endt) = aDsa.iLut256[*source++];
+ }
+ }
+
+void CDsa::Copy256Flip(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen)
+ {
+ TUint32* target = aTarget;
+ const TUint32* endt = target + aBytes;
+ const TUint8* column = aSource;
+
+ while(target < endt)
+ {
+ *target++ = aDsa.iLut256[*column];
+ column += aLineLen;
+ }
+ }
+
+void CDsa::Copy256FlipReversed(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen)
+ {
+ const TUint32* target = aTarget;
+ TUint32* endt = aTarget + aBytes;
+ const TUint8* column = aSource;
+
+ while(target < endt)
+ {
+ *(--endt) = aDsa.iLut256[*column];
+ column += aLineLen;
+ }
+ }
+
+void CDsa::CopyMem(const CDsa& /*aDsa*/, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt)
+ {
+ const TUint32* src = reinterpret_cast<const TUint32*>(aSource);
+ Mem::Copy(aTarget, src, aBytes << 2);
+ }
+
+void CDsa::CopyMemFlip(const CDsa& /*aDsa*/, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen)
+ {
+ TUint32* target = aTarget;
+ const TUint32* endt = target + aBytes;
+ const TUint32* column = reinterpret_cast<const TUint32*>(aSource);
+
+ while(target < endt)
+ {
+ *target++ = *column;
+ column += aLineLen;
+ }
+ }
+
+void CDsa::CopyMemReversed(const CDsa& /*aDsa*/, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt)
+ {
+ const TUint32* target = aTarget;
+ TUint32* endt = aTarget + aBytes;
+ const TUint32* source = reinterpret_cast<const TUint32*>(aSource);
+ while(target < endt)
+ {
+ *(--endt) = *source++;
+ }
+ }
+
+
+void CDsa::CopyMemFlipReversed(const CDsa& /*aDsa*/, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen)
+ {
+ const TUint32* target = aTarget;
+ TUint32* endt = aTarget + aBytes;
+ const TUint32* column = reinterpret_cast<const TUint32*>(aSource);
+
+ while(target < endt)
+ {
+ *(--endt) = *column;
+ column += aLineLen;
+ }
+ }
+
+/*
+
+LOCAL_C TRgb rgb16MA(TInt aValue)
+ {
+ return TRgb::Color16MA(aValue);
+ }
+*/
+NONSHARABLE_CLASS(MRgbCopy)
+ {
+ public:
+ virtual void Copy(TUint32* aTarget, const TUint8* aSource, TInt aBytes, TBool aReversed) = 0;
+ virtual void FlipCopy(TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen, TBool aReversed) = 0;
+ };
+
+template <class T>
+NONSHARABLE_CLASS(TRgbCopy) : public MRgbCopy
+ {
+ public:
+ TRgbCopy(TDisplayMode aMode);
+ void* operator new(TUint aBytes, TAny* aMem);
+ void Copy(TUint32* aTarget, const TUint8* aSource, TInt aBytes, TBool aReversed);
+ void FlipCopy(TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen, TBool aReversed);
+ static TUint32 Gray256(const TUint8& aPixel);
+ static TUint32 Color256(const TUint8& aPixel);
+ static TUint32 Color4K(const TUint16& aPixel);
+ static TUint32 Color64K(const TUint16& aPixel);
+ static TUint32 Color16M(const TUint32& aPixel);
+ static TUint32 Color16MU(const TUint32& aPixel);
+ static TUint32 Color16MA(const TUint32& aPixel);
+ private:
+ typedef TUint32 (*TRgbFunc) (const T& aValue);
+ TRgbFunc iFunc;
+ };
+
+
+template <class T>
+void* TRgbCopy<T>::operator new(TUint /*aBytes*/, TAny* aMem)
+ {
+ return aMem;
+ }
+
+template <class T>
+TRgbCopy<T>::TRgbCopy(TDisplayMode aMode)
+ {
+ switch(aMode)
+ {
+ case EGray256 : iFunc = (TRgbFunc) Gray256; break;
+ case EColor256 : iFunc = (TRgbFunc) Color256; break;
+ case EColor4K : iFunc = (TRgbFunc) Color4K; break;
+ case EColor64K : iFunc = (TRgbFunc) Color64K; break;
+ case EColor16M : iFunc = (TRgbFunc) Color16M; break;
+ case EColor16MU : iFunc = (TRgbFunc) Color16MU; break;
+ case EColor16MA : iFunc = (TRgbFunc) Color16MA; break;
+ default:
+ PANIC(KErrNotSupported);
+ }
+ }
+
+template <class T>
+void TRgbCopy<T>::Copy(TUint32* aTarget, const TUint8* aSource, TInt aBytes, TBool aReversed)
+ {
+ const T* source = reinterpret_cast<const T*>(aSource);
+ TUint32* target = aTarget;
+ TUint32* endt = target + aBytes;
+
+ if(aReversed)
+ {
+ while(target < endt)
+ {
+ const T value = *source++;
+ *(--endt) = iFunc(value);//iFunc(value).Value();
+ }
+ }
+ else
+ {
+ while(target < endt)
+ {
+ const T value = *source++;
+ *target++ = iFunc(value);//iFunc(value).Value();
+ }
+ }
+ }
+
+template <class T>
+void TRgbCopy<T>::FlipCopy(TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen, TBool aReversed)
+ {
+ const T* column = reinterpret_cast<const T*>(aSource);
+ TUint32* target = aTarget;
+ TUint32* endt = target + aBytes;
+
+ if(aReversed)
+ {
+ while(target < endt)
+ {
+ *(--endt) = iFunc(*column);
+ column += aLineLen;
+ }
+ }
+ else
+ {
+ while(target < endt)
+ {
+ *target++ = iFunc(*column);
+ column += aLineLen;
+ }
+ }
+ }
+
+template <class T> TUint32 TRgbCopy<T>::Gray256(const TUint8& aPixel)
+ {
+ const TUint32 px = aPixel << 16 | aPixel << 8 | aPixel;
+ return px;
+ }
+
+template <class T> TUint32 TRgbCopy<T>::Color256(const TUint8& aPixel)
+ {
+ return TRgb::Color256(aPixel).Value();
+ }
+
+template <class T> TUint32 TRgbCopy<T>::Color4K(const TUint16& aPixel)
+ {
+ TUint32 col = (aPixel & 0xF00) << 12;
+ col |= (aPixel & 0xF00) << 8;
+
+ col |= (aPixel & 0x0F0) << 8;
+ col |= (aPixel & 0x0F0);
+
+ col |= (aPixel & 0x00F) << 4;
+ col |= (aPixel & 0x00F);
+
+ return col;
+ }
+
+template <class T> TUint32 TRgbCopy<T>::Color64K(const TUint16& aPixel)
+ {
+ TUint32 col = (aPixel & 0xF800)<< 8;
+ col |= (aPixel & 0xE000) << 3;
+
+ col |= (aPixel & 0x07E0) << 5;
+ col |= (aPixel & 0xC0) >> 1;
+
+ col |= (aPixel & 0x07E0) << 3;
+ col |= (aPixel & 0x1C) >> 2;
+
+ return col;
+ }
+
+template <class T> TUint32 TRgbCopy<T>::Color16M(const TUint32& aPixel)
+ {
+ return TRgb::Color16M(aPixel).Value();
+ }
+
+template <class T> TUint32 TRgbCopy<T>::Color16MU(const TUint32& aPixel)
+ {
+ return TRgb::Color16MU(aPixel).Value();
+ }
+
+template <class T> TUint32 TRgbCopy<T>::Color16MA(const TUint32& aPixel)
+ {
+ return TRgb::Color16MA(aPixel).Value();
+ }
+
+typedef TUint64 TStackMem;
+
+LOCAL_C MRgbCopy* GetCopy(TAny* mem, TDisplayMode aMode)
+ {
+ if(aMode == EColor256 || aMode == EGray256)
+ {
+ return new (mem) TRgbCopy<TUint8>(aMode);
+ }
+ if(aMode == EColor4K || aMode == EColor64K)
+ {
+ return new (mem) TRgbCopy<TUint16>(aMode);
+ }
+ if(aMode == EColor16M || aMode == EColor16MU || aMode == EColor16MA)
+ {
+ return new (mem) TRgbCopy<TUint32>(aMode);
+ }
+ PANIC(KErrNotSupported);
+ return NULL;
+ }
+
+
+void CDsa::CopySlowFlipReversed(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen)
+ {
+ TStackMem mem = 0;
+ GetCopy(&mem, aDsa.iSourceMode)->FlipCopy(aTarget, aSource, aBytes, aLineLen, ETrue);
+ }
+
+void CDsa::CopySlowFlip(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen)
+ {
+ TStackMem mem = 0;
+ GetCopy(&mem, aDsa.iSourceMode)->FlipCopy(aTarget, aSource, aBytes, aLineLen, EFalse);
+ }
+
+void CDsa::CopySlow(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt)
+ {
+ TStackMem mem = 0;
+ GetCopy(&mem, aDsa.iSourceMode)->Copy(aTarget, aSource, aBytes, EFalse);
+ }
+
+void CDsa::CopySlowReversed(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt)
+ {
+ TStackMem mem = 0;
+ GetCopy(&mem, aDsa.iSourceMode)->Copy(aTarget, aSource, aBytes, ETrue);
+ }
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////7
diff --git a/distrib/sdl-1.2.15/src/video/symbian/EKA2/dsa_new.cpp b/distrib/sdl-1.2.15/src/video/symbian/EKA2/dsa_new.cpp
new file mode 100644
index 0000000..638fbe8
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/symbian/EKA2/dsa_new.cpp
@@ -0,0 +1,1443 @@
+#include "dsa.h"
+#include "sdlepocapi.h"
+#include <cdsb.h>
+
+
+LOCAL_C TInt BytesPerPixel(TDisplayMode aMode)
+ {
+ return ((TDisplayModeUtils::NumDisplayModeBitsPerPixel(aMode) - 1) >> 3) + 1;
+ }
+
+
+NONSHARABLE_CLASS(TDsa)
+ {
+ public:
+ inline TDsa(const CDsa& aDsa);
+ inline TBool IsFlip() const;
+ inline TBool IsTurn() const;
+ inline const TSize& SwSize() const;
+ inline void Copy(TUint32* aTarget, const TUint8* aSrc, TInt aBytes, TInt aHeight) const;
+ private:
+ const CDsa& iDsa;
+ };
+
+
+inline TDsa::TDsa(const CDsa& aDsa) : iDsa(aDsa)
+ {
+ }
+
+inline TBool TDsa::IsTurn() const
+ {
+ return iDsa.iStateFlags & CDsa::EOrientation90;
+ }
+
+inline TBool TDsa::IsFlip() const
+ {
+ return iDsa.iStateFlags & CDsa::EOrientation180;
+ }
+
+inline const TSize& TDsa::SwSize() const
+ {
+ return iDsa.SwSize();
+ }
+
+inline void TDsa::Copy(TUint32* aTarget, const TUint8* aSrc, TInt aBytes, TInt aHeight) const
+ {
+ iDsa.iCopyFunction(iDsa, aTarget, aSrc, aBytes, aHeight);
+ }
+
+template<class T, class S>
+void ClipCopy(const TDsa& iDsa, TUint8* aTarget,
+ const TUint8* aSource,
+ const TRect& aUpdateRect,
+ const TRect& aSourceRect)
+ {
+ const S* source = reinterpret_cast<const S*>(aSource);
+ const TInt lineWidth = aSourceRect.Width();
+
+ source += (aUpdateRect.iTl.iY * lineWidth);
+ const TInt sourceStartOffset = aUpdateRect.iTl.iX;
+ source += sourceStartOffset;
+
+ T* targetPtr = reinterpret_cast<T*>(aTarget);
+
+ const TInt scanLineWidth = iDsa.SwSize().iWidth;
+
+ targetPtr += (aSourceRect.iTl.iY + aUpdateRect.iTl.iY ) * scanLineWidth;
+ const TInt targetStartOffset = (aUpdateRect.iTl.iX + aSourceRect.iTl.iX);
+
+ targetPtr += targetStartOffset;
+
+
+ const TInt height = aUpdateRect.Height();
+
+ const TInt lineMove = iDsa.IsTurn() ? 1 : lineWidth;
+ const TInt copyLen = aUpdateRect.Width();
+
+
+ if(iDsa.IsFlip())
+ {
+
+ targetPtr += scanLineWidth * (height - 1);
+
+ for(TInt i = 0; i < height; i++) //source is always smaller
+ {
+ iDsa.Copy(reinterpret_cast<TUint32*>(targetPtr), reinterpret_cast<const TUint8*>(source), copyLen, height);
+ source += lineMove;
+ targetPtr -= scanLineWidth;
+ }
+ }
+ else
+ {
+
+
+ for(TInt i = 0; i < height; i++) //source is always smaller
+ {
+ iDsa.Copy(reinterpret_cast<TUint32*>(targetPtr), reinterpret_cast<const TUint8*>(source), copyLen, height);
+ source += lineMove;
+ targetPtr += scanLineWidth; // >> 2;
+ }
+ }
+
+ }
+
+
+
+NONSHARABLE_CLASS(CDsaA) : public CDsa
+ {
+ public:
+ CDsaA(RWsSession& aSession);
+ private:
+ ~CDsaA();
+ TUint8* LockSurface();
+ void UnlockHWSurfaceRequestComplete();
+ void UnlockHwSurface();
+ void CreateSurfaceL();
+ void Wipe(TInt aLength);
+ void Free();
+ void Update(CFbsBitmap& aBmp);
+ void ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice);
+ TInt ExternalUpdate();
+ // void ExternalUpdate();
+ protected:
+ CFbsBitmap* iBmp;
+ CFbsBitmap* iCopyBmp;
+ };
+
+
+CDsaA::CDsaA(RWsSession& aSession) : CDsa(aSession)
+ {
+ }
+
+
+void CDsaA::Free()
+ {
+ delete iBmp;
+ iBmp = NULL;
+ }
+
+CDsaA::~CDsaA()
+ {
+ __ASSERT_DEBUG(iBmp == NULL, PANIC(KErrNotReady));
+ delete iCopyBmp;
+ }
+
+TUint8* CDsaA::LockSurface()
+ {
+ iBmp->LockHeap();
+ return reinterpret_cast<TUint8*>(iBmp->DataAddress());
+ }
+
+void CDsaA::UnlockHWSurfaceRequestComplete()
+ {
+ PANIC(KErrNotSupported);
+ }
+
+void CDsaA::UnlockHwSurface()
+ {
+ iBmp->UnlockHeap();
+ SetUpdating(EFalse);
+ Update(*iBmp);
+ }
+
+void CDsaA::Update(CFbsBitmap& aBmp)
+ {
+ if(!Blitter(aBmp))
+ {
+ if(SwSize() == HwRect().Size())
+ Dsa().Gc()->BitBlt(HwRect().iTl, &aBmp);
+ else
+ Dsa().Gc()->DrawBitmap(HwRect(), &aBmp);
+ }
+ DrawOverlays();
+ Dsa().ScreenDevice()->Update();
+ }
+void CDsaA::CreateSurfaceL()
+ {
+ delete iBmp;
+ iBmp = NULL;
+ iBmp = new (ELeave) CFbsBitmap();
+ User::LeaveIfError(iBmp->Create(SwSize(), DisplayMode()));
+ }
+
+void CDsaA::Wipe(TInt aLength) //dont call in drawing
+ {
+ iBmp->LockHeap();
+ Mem::FillZ(iBmp->DataAddress(), aLength);
+ iBmp->UnlockHeap();
+ }
+
+
+
+TInt CDsaA::ExternalUpdate()
+ {
+ if(iCopyBmp->Handle() == 0)
+ {
+ const TInt err = iCopyBmp->Duplicate(iBmp->Handle());
+ if(err != KErrNone)
+ return err;
+ }
+ Update(*iCopyBmp);
+ return KErrNone;
+ }
+
+void CDsaA::ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice)
+ {
+ iCopyBmp = new (ELeave) CFbsBitmap();
+ CDsa::ConstructL(aWindow, aDevice);
+ }
+
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+NONSHARABLE_CLASS(MDsbObs)
+ {
+ public:
+ virtual void SurfaceReady() = 0;
+ virtual CDirectScreenBitmap& Dsb() = 0;
+ };
+
+NONSHARABLE_CLASS(CDsbSurface) : public CActive
+ {
+ public:
+ CDsbSurface(MDsbObs& aDsb);
+ TUint8* Address();
+ void Complete();
+ ~CDsbSurface();
+ private:
+ void RunL();
+ void DoCancel();
+ private:
+ MDsbObs& iDsb;
+ TUint8* iAddress;
+ };
+
+CDsbSurface::CDsbSurface(MDsbObs& aDsb) : CActive(CActive::EPriorityHigh) , iDsb(aDsb)
+ {
+ CActiveScheduler::Add(this);
+ }
+
+CDsbSurface::~CDsbSurface()
+ {
+ Cancel();
+ }
+
+void CDsbSurface::Complete()
+ {
+ if(iAddress != NULL && !IsActive())
+ {
+ iAddress = NULL;
+ SetActive();
+ iDsb.Dsb().EndUpdate(iStatus);
+ }
+ }
+
+TUint8* CDsbSurface::Address()
+ {
+ if(iAddress == NULL && !IsActive())
+ {
+ TAcceleratedBitmapInfo info;
+ if(KErrNone == iDsb.Dsb().BeginUpdate(info))
+ iAddress = info.iAddress;
+ }
+ return iAddress;
+ }
+
+void CDsbSurface::RunL()
+ {
+ iDsb.SurfaceReady();
+ }
+
+void CDsbSurface::DoCancel()
+ {
+ //empty
+ }
+
+NONSHARABLE_CLASS(CDsaB) : public CDsa, public MDsbObs
+ {
+ public:
+ CDsaB(RWsSession& aSession, TInt aFlags);
+ private:
+ ~CDsaB();
+ TUint8* LockSurface();
+ void UnlockHWSurfaceRequestComplete();
+ void UnlockHwSurface();
+ void CreateSurfaceL();
+ void Wipe(TInt aLength);
+ void RecreateL();
+ void ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice);
+ CDirectScreenBitmap& Dsb();
+ void SurfaceReady();
+ TInt ExternalUpdate();
+ private:
+ CDsbSurface* iSurface1;
+ CDsbSurface* iSurface2;
+ CDirectScreenBitmap* iDsb;
+ TInt iType;
+ };
+
+CDsaB::CDsaB(RWsSession& aSession, TInt aFlags) : CDsa(aSession), iType(aFlags)
+ {
+ }
+
+
+
+void CDsaB::UnlockHWSurfaceRequestComplete()
+ {
+ iSurface1->Complete();
+ if(iSurface2 != NULL)
+ iSurface2->Complete();
+ }
+
+void CDsaB::CreateSurfaceL()
+ {
+ __ASSERT_ALWAYS(SwSize() == HwRect().Size(), PANIC(KErrNotSupported));
+ }
+
+void CDsaB::Wipe(TInt aLength) //dont call in drawing
+ {
+ TUint8* addr = LockSurface();
+ if(addr != NULL)
+ {
+ Mem::FillZ(addr, aLength);
+ UnlockHwSurface();
+ }
+ }
+
+
+void CDsaB::UnlockHwSurface()
+ {
+ EpocSdlEnv::Request(CDsa::ERequestUpdate);
+ }
+
+TUint8* CDsaB::LockSurface()
+ {
+ TUint8* addr = iSurface1->Address();
+ if(addr == NULL && iSurface2 != NULL)
+ addr = iSurface2->Address();
+ SetUpdating(addr == NULL);
+ return addr;
+ }
+
+void CDsaB::SurfaceReady()
+ {
+ SetUpdating(EFalse);
+ }
+
+CDirectScreenBitmap& CDsaB::Dsb()
+ {
+ return *iDsb;
+ }
+
+void CDsaB::ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice)
+ {
+ if(iDsb == NULL)
+ iDsb = CDirectScreenBitmap::NewL();
+ CDsa::ConstructL(aWindow, aDevice);
+ if(iSurface1 == NULL)
+ iSurface1 = new (ELeave) CDsbSurface(*this);
+ if(iSurface2 == NULL && iType & CDirectScreenBitmap::EDoubleBuffer)
+ iSurface2 = new (ELeave) CDsbSurface(*this);
+ }
+
+CDsaB::~CDsaB()
+ {
+ delete iSurface1;
+ delete iSurface2;
+ delete iDsb;
+ }
+
+void CDsaB::RecreateL()
+ {
+ iDsb->Close();
+ iDsb->Create(HwRect(), CDirectScreenBitmap::TSettingsFlags(iType));
+ }
+
+TInt CDsaB::ExternalUpdate()
+ {
+ if(LockSurface())
+ {
+ UnlockHWSurfaceRequestComplete();
+ return KErrNone;
+ }
+ return KErrNotReady;
+ }
+
+
+/////////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+CDsa* CDsa::CreateL(RWsSession& aSession)
+ {
+ if(EpocSdlEnv::Flags(CSDL::EDrawModeDSB))
+ {
+ TInt flags = CDirectScreenBitmap::ENone;
+ if(EpocSdlEnv::Flags(CSDL::EDrawModeDSBDoubleBuffer))
+ flags |= CDirectScreenBitmap::EDoubleBuffer;
+ if(EpocSdlEnv::Flags(CSDL::EDrawModeDSBIncrentalUpdate))
+ flags |= CDirectScreenBitmap::EIncrementalUpdate;
+ return new (ELeave) CDsaB(aSession, flags);
+ }
+ else
+ return new (ELeave) CDsaA(aSession);
+ }
+
+
+void CDsa::RecreateL()
+ {
+ }
+
+void CDsa::Free()
+ {
+ }
+
+TSize CDsa::WindowSize() const
+ {
+ TSize size = iSwSize;
+ if(iStateFlags & EOrientation90)
+ {
+ const TInt tmp = size.iWidth;
+ size.iWidth = size.iHeight;
+ size.iHeight = tmp;
+ }
+ return size;
+ }
+
+void CDsa::SetSuspend()
+ {
+ iStateFlags |= ESdlThreadSuspend;
+ }
+
+void CDsa::ReleaseStop()
+ {
+ iStateFlags &= ~ESdlThreadExplicitStop;
+ }
+
+
+TBool CDsa::Stopped() const
+ {
+ return (iStateFlags & ESdlThreadExplicitStop);
+ }
+
+void CDsa::SetOrientation(CSDL::TOrientationMode aOrientation)
+ {
+ TInt flags = 0;
+ switch(aOrientation)
+ {
+ case CSDL::EOrientation90:
+ flags = EOrientation90;
+ break;
+ case CSDL::EOrientation180:
+ flags = EOrientation180;
+ break;
+ case CSDL::EOrientation270:
+ flags = EOrientation90 | EOrientation180;
+ break;
+ case CSDL::EOrientation0:
+ flags = 0;
+ break;
+ }
+ if(flags != (iStateFlags & EOrientationFlags))
+ {
+ iStateFlags |= EOrientationChanged;
+ iNewFlags = flags; //cannot be set during drawing...
+ }
+ }
+
+CDsa::~CDsa()
+ {
+ if(iDsa != NULL)
+ {
+ iDsa->Cancel();
+ }
+ iOverlays.Close();
+ delete iDsa;
+ User::Free(iLut256);
+ }
+
+void CDsa::ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice)
+ {
+ if(iDsa != NULL)
+ {
+ iDsa->Cancel();
+ delete iDsa;
+ iDsa = NULL;
+ }
+
+ iDsa = CDirectScreenAccess::NewL(
+ iSession,
+ aDevice,
+ aWindow,
+ *this);
+
+ if(iLut256 == NULL)
+ iLut256 = (TUint32*) User::AllocL(256 * sizeof(TUint32));
+ iTargetMode = aWindow.DisplayMode();
+ iTargetBpp = BytesPerPixel(DisplayMode());
+ iScreenRect = TRect(aWindow.Position(), aWindow.Size());
+ SetTargetRect();
+ RestartL();
+ }
+
+void CDsa::DrawOverlays()
+ {
+ const TInt last = iOverlays.Count() - 1;
+ for(TInt i = last; i >= 0 ; i--)
+ iOverlays[i].iOverlay->Draw(*iDsa->Gc(), HwRect(), SwSize());
+ }
+
+TInt CDsa::AppendOverlay(MOverlay& aOverlay, TInt aPriority)
+ {
+ TInt i;
+ for(i = 0; i < iOverlays.Count() && iOverlays[i].iPriority < aPriority; i++)
+ {}
+ const TOverlay overlay = {&aOverlay, aPriority};
+ return iOverlays.Insert(overlay, i);
+ }
+
+TInt CDsa::RemoveOverlay(MOverlay& aOverlay)
+ {
+ for(TInt i = 0; i < iOverlays.Count(); i++)
+ {
+ if(iOverlays[i].iOverlay == &aOverlay)
+ {
+ iOverlays.Remove(i);
+ return KErrNone;
+ }
+ }
+ return KErrNotFound;
+ }
+
+void CDsa::LockPalette(TBool aLock)
+ {
+ if(aLock)
+ iStateFlags |= EPaletteLocked;
+ else
+ iStateFlags &= ~EPaletteLocked;
+ }
+TInt CDsa::SetPalette(TInt aFirst, TInt aCount, TUint32* aPalette)
+ {
+ if(iLut256 == NULL)
+ return KErrNotFound;
+ const TInt count = aCount - aFirst;
+ if(count > 256)
+ return KErrArgument;
+ if(iStateFlags & EPaletteLocked)
+ return KErrNone;
+ for(TInt i = aFirst; i < count; i++) //not so busy here:-)
+ {
+ iLut256[i] = aPalette[i];
+ }
+ return KErrNone;
+ }
+
+
+
+void CDsa::RestartL()
+ {
+ //const TBool active = iDsa->IsActive();
+
+ //if(!active)
+
+ iDsa->StartL();
+
+ const RRegion* r = iDsa->DrawingRegion();
+ const TRect rect = r->BoundingRect();
+ iDsa->Gc()->SetClippingRegion(r);
+
+ if(rect != iScreenRect)
+ {
+ // iDsa->Cancel();
+ return ;
+ }
+
+
+
+ //iScreenRect = rect; //to ensure properly set, albeit may not(?) match to value SDL has - therefore may has to clip
+ //targetrect shall no change
+ SetTargetRect();
+ RecreateL();
+
+ iStateFlags |= ERunning;
+
+ ReleaseStop();
+ if(iStateFlags & ESdlThreadSuspend)
+ {
+ EpocSdlEnv::Resume();
+ iStateFlags &= ~ ESdlThreadSuspend;
+ }
+ EpocSdlEnv::ObserverEvent(MSDLObserver::EEventWindowReserved);
+ }
+
+CDsa::CDsa(RWsSession& aSession) :
+ iSession(aSession),
+ iStateFlags(0)
+ {
+// CActiveScheduler::Add(this);
+ iCFTable[0] = CopyMem;
+ iCFTable[1] = CopyMemFlipReversed;
+ iCFTable[2] = CopyMemReversed;
+ iCFTable[3] = CopyMemFlip;
+
+ iCFTable[4] = Copy256;
+ iCFTable[5] = Copy256FlipReversed;
+ iCFTable[6] = Copy256Reversed;
+ iCFTable[7] = Copy256Flip;
+
+
+ iCFTable[8] = CopySlow;
+ iCFTable[9] = CopySlowFlipReversed;
+ iCFTable[10] = CopySlowReversed;
+ iCFTable[11] = CopySlowFlip;
+ }
+
+RWsSession& CDsa::Session()
+ {
+ return iSession;
+ }
+
+TInt CDsa::RedrawRequest()
+ {
+ if(!(iStateFlags & (EUpdating) && (iStateFlags & ERunning)))
+ {
+ return ExternalUpdate();
+ }
+ return KErrNotReady;
+ }
+
+TUint8* CDsa::LockHwSurface()
+ {
+ if((iStateFlags & EUpdating) == 0) //else frame is skipped
+ {
+ return LockSurface();
+ }
+ return NULL;
+ }
+
+/*
+void CDsa::RunL()
+ {
+ iStateFlags &= ~EUpdating;
+ }
+
+
+void CDsa::DoCancel()
+ {
+ iStateFlags &= ~EUpdating;
+ //nothing can do, just wait?
+ }
+*/
+
+
+TInt CDsa::AllocSurface(TBool aHwSurface, const TSize& aSize, TDisplayMode aMode)
+ {
+ if(aHwSurface && aMode != DisplayMode())
+ return KErrArgument;
+
+ iSourceMode = aMode;
+
+ iSourceBpp = BytesPerPixel(aMode);
+
+ const TSize size = WindowSize();
+ if(aSize.iWidth > size.iWidth)
+ return KErrTooBig;
+ if(aSize.iHeight > size.iHeight)
+ return KErrTooBig;
+
+ TRAPD(err, CreateSurfaceL());
+ if(err != KErrNone)
+ return err;
+
+ SetCopyFunction();
+
+ return KErrNone;
+ }
+
+
+void CDsa::CreateZoomerL(const TSize& aSize)
+ {
+ iSwSize = aSize;
+ iStateFlags |= EResizeRequest;
+ CreateSurfaceL();
+ SetTargetRect();
+ }
+
+
+/*
+void SaveBmp(const TDesC& aName, const TAny* aData, TInt aLength, const TSize& aSz, TDisplayMode aMode)
+ {
+ CFbsBitmap* s = new CFbsBitmap();
+ s->Create(aSz, aMode);
+ s->LockHeap();
+ TUint32* addr = s->DataAddress();
+ Mem::Copy(addr, aData, aLength);
+ s->UnlockHeap();
+ s->Save(aName);
+ s->Reset();
+ delete s;
+ }
+
+void SaveBmp(const TDesC& aName, const TUint32* aData, const TSize& aSz)
+ {
+ CFbsBitmap* s = new CFbsBitmap();
+ s->Create(aSz, EColor64K);
+ TBitmapUtil bmp(s);
+ bmp.Begin(TPoint(0, 0));
+ for(TInt j = 0; j < aSz.iHeight; j++)
+ {
+ bmp.SetPos(TPoint(0, j));
+ for(TInt i = 0; i < aSz.iWidth; i++)
+ {
+ bmp.SetPixel(*aData);
+ aData++;
+ bmp.IncXPos();
+ }
+ }
+ bmp.End();
+ s->Save(aName);
+ s->Reset();
+ delete s;
+ }
+
+TBuf<16> FooName(TInt aFoo)
+ {
+ TBuf<16> b;
+ b.Format(_L("C:\\pic%d.mbm"), aFoo);
+ return b;
+ }
+
+void ClipCopy(TUint8* aTarget, const TUint8* aSource, const TRect& aRect, const TPoint& aTargetPos)
+ {
+ const TInt iSourceBpp = 1;
+ const TInt iTargetBpp = 4;
+ const TInt iScanLineWidth = 800;
+
+ TUint8* target = aTarget;
+ const TUint8* source = aSource;
+ const TInt lineWidth = aRect.Width();
+ source += iSourceBpp * (aRect.iTl.iY * lineWidth);
+ const TInt sourceStartOffset = iSourceBpp * aRect.iTl.iX;
+ source += sourceStartOffset;
+ target += iTargetBpp * ((aTargetPos.iY + aRect.iTl.iY ) * lineWidth);
+ const TInt targetStartOffset = iTargetBpp * (aRect.iTl.iX + aTargetPos.iX);
+ target += targetStartOffset;
+ TUint32* targetPtr = reinterpret_cast<TUint32*>(target);
+ const TInt targetWidth = iScanLineWidth >> 2;
+ const TInt height = aRect.Height();
+ }
+*/
+/*
+void CDsa::ClipCopy(TUint8* aTarget,
+ const TUint8* aSource,
+ const TRect& aUpdateRect,
+ const TRect& aSourceRect) const
+ {
+ //TUint8* target = aTarget;
+ const TUint32* source = (const TUint32*) aSource;
+ const TInt lineWidth = aSourceRect.Width();
+
+ source += (aUpdateRect.iTl.iY * lineWidth);
+ const TInt sourceStartOffset = aUpdateRect.iTl.iX;
+ source += sourceStartOffset;
+
+ TUint32* targetPtr = reinterpret_cast<TUint32*>(aTarget);
+
+ targetPtr += (aSourceRect.iTl.iY + aUpdateRect.iTl.iY ) * SwSize().iWidth;
+ const TInt targetStartOffset = (aUpdateRect.iTl.iX + aSourceRect.iTl.iX);
+
+ targetPtr += targetStartOffset;
+
+// TUint32* targetPtr = reinterpret_cast<TUint32*>(target);
+
+ const TInt targetWidth32 = SwSize().iWidth;
+
+ const TInt height = aUpdateRect.Height();
+
+ const TInt lineMove = iStateFlags & EOrientation90 ? 1 : lineWidth;
+ const TInt copyLen = aUpdateRect.Width();
+
+
+ if(iStateFlags & EOrientation180)
+ {
+
+ targetPtr += targetWidth32 * (height - 1);
+
+ for(TInt i = 0; i < height; i++) //source is always smaller
+ {
+ iCopyFunction(*this, targetPtr, (TUint8*)source, copyLen, height);
+ source += lineMove;
+ targetPtr -= targetWidth32;
+ }
+ }
+ else
+ {
+
+
+ for(TInt i = 0; i < height; i++) //source is always smaller
+ {
+ iCopyFunction(*this, targetPtr, (TUint8*)source, copyLen, height);
+ source += lineMove;
+ targetPtr += targetWidth32; // >> 2;
+ }
+ }
+
+ }
+
+*/
+
+void CDsa::ClipCopy(TUint8* aTarget, const TUint8* aSource, const TRect& aRect, const TPoint& aTargetPos) const
+ {
+ TUint8* target = aTarget;
+ const TUint8* source = aSource;
+ const TInt lineWidth = aRect.Width();
+ source += iSourceBpp * (aRect.iTl.iY * lineWidth);
+ TInt sourceStartOffset = iSourceBpp * aRect.iTl.iX;
+ source += sourceStartOffset;
+ target += iTargetBpp * ((aTargetPos.iY + aRect.iTl.iY ) * lineWidth);
+ TInt targetStartOffset = iTargetBpp * (aRect.iTl.iX + aTargetPos.iX);
+ target += targetStartOffset;
+ TUint32* targetPtr = reinterpret_cast<TUint32*>(target);
+ const TInt targetWidth = iScanLineWidth >> 2;
+ const TInt height = aRect.Height();
+
+ TInt lineMove = iStateFlags & EOrientation90 ? 1 : lineWidth;
+
+ if(iStateFlags & EOrientation180)
+ {
+
+ targetPtr += targetWidth * (height - 1);
+
+ for(TInt i = 0; i < height; i++) //source is always smaller
+ {
+ iCopyFunction(*this, targetPtr, source, lineWidth, height);
+ source += lineMove;
+ targetPtr -= targetWidth;
+ }
+ }
+ else
+ {
+
+
+ for(TInt i = 0; i < height; i++) //source is always smaller
+ {
+ iCopyFunction(*this, targetPtr, source, lineWidth, height);
+ source += lineMove;
+ targetPtr += targetWidth;
+ }
+ }
+
+ }
+
+
+
+ /*
+void CDsa::ClipCopy(TUint8* aTarget,
+ const TUint8* aSource,
+ const TRect& aUpdateRect,
+ const TRect& aSourceRect) const
+ {
+ const TDsa dsa(*this);
+ switch(iSourceBpp)
+ {
+ case 1:
+ ::ClipCopy<TUint32, TUint8>(dsa, aTarget, aSource, aUpdateRect, aSourceRect);
+ break;
+ case 2:
+ ::ClipCopy<TUint32, TUint16>(dsa, aTarget, aSource, aUpdateRect, aSourceRect);
+ break;
+ case 4:
+ ::ClipCopy<TUint32, TUint32>(dsa, aTarget, aSource, aUpdateRect, aSourceRect);
+ break;
+ }
+ }
+
+
+*/
+
+
+
+void CDsa::Wipe() //dont call in drawing
+ {
+ if(IsDsaAvailable())
+ Wipe(iTargetBpp * SwSize().iWidth * SwSize().iHeight);
+ }
+
+void CDsa::SetCopyFunction()
+ {
+ //calculate offset to correct function in iCFTable according to given parameters
+ TInt function = 0;
+ const TInt KCopyFunctions = 4;
+ const TInt KOffsetToNative = 0;
+ const TInt KOffsetTo256 = KOffsetToNative + KCopyFunctions;
+ const TInt KOffsetToOtherModes = KOffsetTo256 + KCopyFunctions;
+ const TInt KOffsetTo90Functions = 1;
+ const TInt KOffsetTo180Functions = 2;
+
+ if(iSourceMode == DisplayMode())
+ function = KOffsetToNative; //0
+ else if(iSourceMode == EColor256)
+ function = KOffsetTo256; //4
+ else
+ function = KOffsetToOtherModes; //8
+
+ if(iStateFlags & EOrientation90)
+ function += KOffsetTo90Functions; // + 1
+ if(iStateFlags & EOrientation180)
+ function += KOffsetTo180Functions; //+ 2
+
+ iCopyFunction = iCFTable[function];
+
+ Wipe();
+ }
+
+inline void Rotate(TRect& aRect)
+ {
+ const TInt dx = aRect.iBr.iX - aRect.iTl.iX;
+ const TInt dy = aRect.iBr.iY - aRect.iTl.iY;
+
+ aRect.iBr.iX = aRect.iTl.iX + dy;
+ aRect.iBr.iY = aRect.iTl.iY + dx;
+
+ const TInt tmp = aRect.iTl.iX;
+ aRect.iTl.iX = aRect.iTl.iY;
+ aRect.iTl.iY = tmp;
+ }
+
+/*
+int bar = 0;
+*/
+/*
+TBool CDsa::AddUpdateRect(const TUint8* aBits, const TRect& aUpdateRect, const TRect& aRect)
+ {
+
+ if(iStateFlags & EOrientationChanged)
+ {
+ iStateFlags &= ~EOrientationFlags;
+ iStateFlags |= iNewFlags;
+ SetCopyFunction();
+ iStateFlags &= ~EOrientationChanged;
+ EpocSdlEnv::WaitDeviceChange();
+ return EFalse; //skip this frame as data is may be changed
+ }
+
+ if(iTargetAddr == NULL)
+ {
+ iTargetAddr = LockHwSurface();
+ }
+
+ TUint8* target = iTargetAddr;
+ if(target == NULL)
+ return EFalse;
+
+
+ TRect targetRect = TRect(TPoint(0, 0), SwSize());
+
+ TRect sourceRect = aRect;
+ TRect updateRect = aUpdateRect;
+
+// TPoint move(0, 0);
+
+
+ if(iStateFlags & EOrientation90)
+ {
+ Rotate(sourceRect);
+ Rotate(updateRect);
+ }
+
+ if(iSourceMode != DisplayMode() || targetRect != sourceRect || targetRect != updateRect || ((iStateFlags & EOrientationFlags) != 0))
+ {
+ sourceRect.Intersection(targetRect); //so source always smaller or equal than target
+ //updateRect.Intersection(targetRect);
+ ClipCopy(target, aBits, updateRect, sourceRect);
+ }
+ else
+ {
+ const TInt byteCount = aRect.Width() * aRect.Height() * iSourceBpp; //this could be stored
+ Mem::Copy(target, aBits, byteCount);
+ }
+
+ return ETrue;
+ }
+ */
+
+TBool CDsa::AddUpdateRect(const TUint8* aBits, const TRect& aUpdateRect, const TRect& aRect)
+ {
+
+ if(iStateFlags & EOrientationChanged)
+ {
+ iStateFlags &= ~EOrientationFlags;
+ iStateFlags |= iNewFlags;
+ SetCopyFunction();
+ iStateFlags &= ~EOrientationChanged;
+ EpocSdlEnv::WaitDeviceChange();
+ return EFalse; //skip this frame as data is may be changed
+ }
+
+ if(iTargetAddr == NULL)
+ {
+ iTargetAddr = LockHwSurface();
+ }
+ TUint8* target = iTargetAddr;
+ if(target == NULL)
+ return EFalse;
+
+
+ TRect targetRect = Rect();
+ TRect sourceRect = aRect;
+ TRect updateRect = aUpdateRect;
+
+ if(iStateFlags & EOrientation90)
+ {
+ Rotate(sourceRect);
+ Rotate(updateRect);
+ }
+
+ if(iSourceMode != DisplayMode() || targetRect != sourceRect || targetRect != updateRect || ((iStateFlags & EOrientationFlags) != 0))
+ {
+ sourceRect.Intersection(targetRect); //so source always smaller or equal than target
+ updateRect.Intersection(targetRect);
+ ClipCopy(target, aBits, updateRect, sourceRect.iTl);
+ }
+ else
+ {
+ const TInt byteCount = aRect.Width() * aRect.Height() * iSourceBpp; //this could be stored
+ Mem::Copy(target, aBits, byteCount);
+ }
+
+ return ETrue;
+ }
+void CDsa::UpdateSwSurface()
+ {
+ iTargetAddr = NULL;
+ UnlockHwSurface(); //could be faster if does not use AO, but only check status before redraw, then no context switch needed
+ }
+
+
+void CDsa::Resume()
+ {
+ if(Stopped())
+ Restart(RDirectScreenAccess::ETerminateRegion);
+ }
+
+void CDsa::DoStop()
+ {
+ if(IsDsaAvailable())
+ iStateFlags |= ESdlThreadExplicitStop;
+ Stop();
+ }
+
+void CDsa::Stop()
+ {
+ iStateFlags &= ~ERunning;
+// Cancel(); //can be called only from main!
+ iDsa->Cancel();
+ }
+
+void CDsa::AbortNow(RDirectScreenAccess::TTerminationReasons /*aReason*/)
+ {
+// iStateFlags |= EChangeNotify;
+ Stop();
+ }
+
+void CDsa::Restart(RDirectScreenAccess::TTerminationReasons aReason)
+ {
+ if(aReason == RDirectScreenAccess::ETerminateRegion) //auto restart
+ {
+ TRAPD(err, RestartL());
+ PANIC_IF_ERROR(err);
+ }
+ }
+
+void CDsa::SetBlitter(MBlitter* aBlitter)
+ {
+ iBlitter = aBlitter;
+ }
+
+
+TPoint CDsa::WindowCoordinates(const TPoint& aPoint) const
+ {
+ TPoint pos = aPoint - iScreenRect.iTl;
+ const TSize asz = iScreenRect.Size();
+ if(iStateFlags & EOrientation180)
+ {
+ pos.iX = asz.iWidth - pos.iX;
+ pos.iY = asz.iHeight - pos.iY;
+ }
+ if(iStateFlags & EOrientation90)
+ {
+ pos.iX = aPoint.iY;
+ pos.iY = aPoint.iX;
+ }
+ pos.iX <<= 16;
+ pos.iY <<= 16;
+ pos.iX /= asz.iWidth;
+ pos.iY /= asz.iHeight;
+ pos.iX *= iSwSize.iWidth;
+ pos.iY *= iSwSize.iHeight;
+ pos.iX >>= 16;
+ pos.iY >>= 16;
+ return pos;
+ }
+
+void CDsa::SetTargetRect()
+ {
+ iTargetRect = iScreenRect;
+ if(iStateFlags & EResizeRequest && EpocSdlEnv::Flags(CSDL::EAllowImageResizeKeepRatio))
+ {
+ const TSize asz = iScreenRect.Size();
+ const TSize sz = iSwSize;
+
+ TRect rect;
+
+ const TInt dh = (sz.iHeight << 16) / sz.iWidth;
+
+ if((asz.iWidth * dh ) >> 16 <= asz.iHeight)
+ {
+ rect.SetRect(TPoint(0, 0), TSize(asz.iWidth, (asz.iWidth * dh) >> 16));
+ }
+ else
+ {
+ const TInt dw = (sz.iWidth << 16) / sz.iHeight;
+ rect.SetRect(TPoint(0, 0), TSize((asz.iHeight * dw) >> 16, asz.iHeight));
+ }
+ rect.Move((asz.iWidth - rect.Size().iWidth) >> 1, (asz.iHeight - rect.Size().iHeight) >> 1);
+
+ iTargetRect = rect;
+ iTargetRect.Move(iScreenRect.iTl);
+
+ }
+ if(!(iStateFlags & EResizeRequest))
+ iSwSize = iScreenRect.Size();
+// iScanLineWidth = /*iTargetBpp **/ SwSize().iWidth;
+ }
+
+/*)
+TBool CDsa::ChangeTrigger()
+ {
+ const TBool change = iStateFlags & EChangeNotify;
+ iStateFlags &= ~EChangeNotify;
+ return change;
+ }
+*/
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+void CDsa::Copy256(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt)
+ {
+ TUint32* target = aTarget;
+ const TUint32* endt = target + aBytes;
+ const TUint8* source = aSource;
+ while(target < endt)
+ {
+ *target++ = aDsa.iLut256[*source++];
+ }
+ }
+
+void CDsa::Copy256Reversed(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt)
+ {
+ const TUint32* target = aTarget;
+ TUint32* endt = aTarget + aBytes;
+ const TUint8* source = aSource;
+ while(target < endt)
+ {
+ *(--endt) = aDsa.iLut256[*source++];
+ }
+ }
+
+void CDsa::Copy256Flip(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen)
+ {
+ TUint32* target = aTarget;
+ const TUint32* endt = target + aBytes;
+ const TUint8* column = aSource;
+
+ while(target < endt)
+ {
+ *target++ = aDsa.iLut256[*column];
+ column += aLineLen;
+ }
+ }
+
+void CDsa::Copy256FlipReversed(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen)
+ {
+ const TUint32* target = aTarget;
+ TUint32* endt = aTarget + aBytes;
+ const TUint8* column = aSource;
+
+ while(target < endt)
+ {
+ *(--endt) = aDsa.iLut256[*column];
+ column += aLineLen;
+ }
+ }
+
+void CDsa::CopyMem(const CDsa& /*aDsa*/, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt)
+ {
+ const TUint32* src = reinterpret_cast<const TUint32*>(aSource);
+ Mem::Copy(aTarget, src, aBytes << 2);
+ }
+
+void CDsa::CopyMemFlip(const CDsa& /*aDsa*/, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen)
+ {
+ TUint32* target = aTarget;
+ const TUint32* endt = target + aBytes;
+ const TUint32* column = reinterpret_cast<const TUint32*>(aSource);
+
+ while(target < endt)
+ {
+ *target++ = *column;
+ column += aLineLen;
+ }
+ }
+
+void CDsa::CopyMemReversed(const CDsa& /*aDsa*/, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt)
+ {
+ const TUint32* target = aTarget;
+ TUint32* endt = aTarget + aBytes;
+ const TUint32* source = reinterpret_cast<const TUint32*>(aSource);
+ while(target < endt)
+ {
+ *(--endt) = *source++;
+ }
+ }
+
+
+void CDsa::CopyMemFlipReversed(const CDsa& /*aDsa*/, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen)
+ {
+ const TUint32* target = aTarget;
+ TUint32* endt = aTarget + aBytes;
+ const TUint32* column = reinterpret_cast<const TUint32*>(aSource);
+
+ while(target < endt)
+ {
+ *(--endt) = *column;
+ column += aLineLen;
+ }
+ }
+
+/*
+
+LOCAL_C TRgb rgb16MA(TInt aValue)
+ {
+ return TRgb::Color16MA(aValue);
+ }
+*/
+NONSHARABLE_CLASS(MRgbCopy)
+ {
+ public:
+ virtual void Copy(TUint32* aTarget, const TUint8* aSource, TInt aBytes, TBool aReversed) = 0;
+ virtual void FlipCopy(TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen, TBool aReversed) = 0;
+ };
+
+template <class T>
+NONSHARABLE_CLASS(TRgbCopy) : public MRgbCopy
+ {
+ public:
+ TRgbCopy(TDisplayMode aMode);
+ void* operator new(TUint aBytes, TAny* aMem);
+ void Copy(TUint32* aTarget, const TUint8* aSource, TInt aBytes, TBool aReversed);
+ void FlipCopy(TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen, TBool aReversed);
+ static TUint32 Gray256(const TUint8& aPixel);
+ static TUint32 Color256(const TUint8& aPixel);
+ static TUint32 Color4K(const TUint16& aPixel);
+ static TUint32 Color64K(const TUint16& aPixel);
+ static TUint32 Color16M(const TUint32& aPixel);
+ static TUint32 Color16MU(const TUint32& aPixel);
+ static TUint32 Color16MA(const TUint32& aPixel);
+ private:
+ typedef TUint32 (*TRgbFunc) (const T& aValue);
+ TRgbFunc iFunc;
+ };
+
+
+template <class T>
+void* TRgbCopy<T>::operator new(TUint /*aBytes*/, TAny* aMem)
+ {
+ return aMem;
+ }
+
+template <class T>
+TRgbCopy<T>::TRgbCopy(TDisplayMode aMode)
+ {
+ switch(aMode)
+ {
+ case EGray256 : iFunc = (TRgbFunc) Gray256; break;
+ case EColor256 : iFunc = (TRgbFunc) Color256; break;
+ case EColor4K : iFunc = (TRgbFunc) Color4K; break;
+ case EColor64K : iFunc = (TRgbFunc) Color64K; break;
+ case EColor16M : iFunc = (TRgbFunc) Color16M; break;
+ case EColor16MU : iFunc = (TRgbFunc) Color16MU; break;
+ case EColor16MA : iFunc = (TRgbFunc) Color16MA; break;
+ default:
+ PANIC(KErrNotSupported);
+ }
+ }
+
+template <class T>
+void TRgbCopy<T>::Copy(TUint32* aTarget, const TUint8* aSource, TInt aBytes, TBool aReversed)
+ {
+ const T* source = reinterpret_cast<const T*>(aSource);
+ TUint32* target = aTarget;
+ TUint32* endt = target + aBytes;
+
+ if(aReversed)
+ {
+ while(target < endt)
+ {
+ const T value = *source++;
+ *(--endt) = iFunc(value);//iFunc(value).Value();
+ }
+ }
+ else
+ {
+ while(target < endt)
+ {
+ const T value = *source++;
+ *target++ = iFunc(value);//iFunc(value).Value();
+ }
+ }
+ }
+
+template <class T>
+void TRgbCopy<T>::FlipCopy(TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen, TBool aReversed)
+ {
+ const T* column = reinterpret_cast<const T*>(aSource);
+ TUint32* target = aTarget;
+ TUint32* endt = target + aBytes;
+
+ if(aReversed)
+ {
+ while(target < endt)
+ {
+ *(--endt) = iFunc(*column);
+ column += aLineLen;
+ }
+ }
+ else
+ {
+ while(target < endt)
+ {
+ *target++ = iFunc(*column);
+ column += aLineLen;
+ }
+ }
+ }
+
+template <class T> TUint32 TRgbCopy<T>::Gray256(const TUint8& aPixel)
+ {
+ const TUint32 px = aPixel << 16 | aPixel << 8 | aPixel;
+ return px;
+ }
+
+template <class T> TUint32 TRgbCopy<T>::Color256(const TUint8& aPixel)
+ {
+ return TRgb::Color256(aPixel).Value();
+ }
+
+template <class T> TUint32 TRgbCopy<T>::Color4K(const TUint16& aPixel)
+ {
+ TUint32 col = (aPixel & 0xF00) << 12;
+ col |= (aPixel & 0xF00) << 8;
+
+ col |= (aPixel & 0x0F0) << 8;
+ col |= (aPixel & 0x0F0);
+
+ col |= (aPixel & 0x00F) << 4;
+ col |= (aPixel & 0x00F);
+
+ return col;
+ }
+
+template <class T> TUint32 TRgbCopy<T>::Color64K(const TUint16& aPixel)
+ {
+ TUint32 col = (aPixel & 0xF800)<< 8;
+ col |= (aPixel & 0xE000) << 3;
+
+ col |= (aPixel & 0x07E0) << 5;
+ col |= (aPixel & 0xC0) >> 1;
+
+ col |= (aPixel & 0x07E0) << 3;
+ col |= (aPixel & 0x1C) >> 2;
+
+ return col;
+ }
+
+template <class T> TUint32 TRgbCopy<T>::Color16M(const TUint32& aPixel)
+ {
+ return TRgb::Color16M(aPixel).Value();
+ }
+
+template <class T> TUint32 TRgbCopy<T>::Color16MU(const TUint32& aPixel)
+ {
+ return TRgb::Color16MU(aPixel).Value();
+ }
+
+template <class T> TUint32 TRgbCopy<T>::Color16MA(const TUint32& aPixel)
+ {
+ return TRgb::Color16MA(aPixel).Value();
+ }
+
+typedef TUint64 TStackMem;
+
+LOCAL_C MRgbCopy* GetCopy(TAny* mem, TDisplayMode aMode)
+ {
+ if(aMode == EColor256 || aMode == EGray256)
+ {
+ return new (mem) TRgbCopy<TUint8>(aMode);
+ }
+ if(aMode == EColor4K || aMode == EColor64K)
+ {
+ return new (mem) TRgbCopy<TUint16>(aMode);
+ }
+ if(aMode == EColor16M || aMode == EColor16MU || aMode == EColor16MA)
+ {
+ return new (mem) TRgbCopy<TUint32>(aMode);
+ }
+ PANIC(KErrNotSupported);
+ return NULL;
+ }
+
+
+void CDsa::CopySlowFlipReversed(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen)
+ {
+ TStackMem mem = 0;
+ GetCopy(&mem, aDsa.iSourceMode)->FlipCopy(aTarget, aSource, aBytes, aLineLen, ETrue);
+ }
+
+void CDsa::CopySlowFlip(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen)
+ {
+ TStackMem mem = 0;
+ GetCopy(&mem, aDsa.iSourceMode)->FlipCopy(aTarget, aSource, aBytes, aLineLen, EFalse);
+ }
+
+void CDsa::CopySlow(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt)
+ {
+ TStackMem mem = 0;
+ GetCopy(&mem, aDsa.iSourceMode)->Copy(aTarget, aSource, aBytes, EFalse);
+ }
+
+void CDsa::CopySlowReversed(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt)
+ {
+ TStackMem mem = 0;
+ GetCopy(&mem, aDsa.iSourceMode)->Copy(aTarget, aSource, aBytes, ETrue);
+ }
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////7
diff --git a/distrib/sdl-1.2.15/src/video/symbian/EKA2/dsa_old.cpp b/distrib/sdl-1.2.15/src/video/symbian/EKA2/dsa_old.cpp
new file mode 100644
index 0000000..7e32de2
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/symbian/EKA2/dsa_old.cpp
@@ -0,0 +1,1075 @@
+#include "dsa.h"
+#include "sdlepocapi.h"
+#include <cdsb.h>
+
+LOCAL_C TInt BytesPerPixel(TDisplayMode aMode)
+ {
+ return ((TDisplayModeUtils::NumDisplayModeBitsPerPixel(aMode) - 1) >> 3) + 1;
+ }
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////
+
+NONSHARABLE_CLASS(CDsaA) : public CDsa
+ {
+ public:
+ CDsaA(RWsSession& aSession);
+ private:
+ ~CDsaA();
+ TUint8* LockSurface();
+ void UnlockHWSurfaceRequestComplete();
+ void UnlockHwSurface();
+ void CreateSurfaceL();
+ void Wipe(TInt aLength);
+ void RecreateL();
+ void Free();
+ TInt ExternalUpdate() {return 0;}
+ private:
+ CFbsBitmap* iBmp;
+ };
+
+
+CDsaA::CDsaA(RWsSession& aSession) : CDsa(aSession)
+ {
+ }
+
+void CDsaA::Free()
+ {
+ delete iBmp;
+ iBmp = NULL;
+ }
+
+CDsaA::~CDsaA()
+ {
+ __ASSERT_DEBUG(iBmp == NULL, PANIC(KErrNotReady));
+ }
+
+TUint8* CDsaA::LockSurface()
+ {
+ iBmp->LockHeap();
+ return reinterpret_cast<TUint8*>(iBmp->DataAddress());
+ }
+
+void CDsaA::UnlockHWSurfaceRequestComplete()
+ {
+ PANIC(KErrNotSupported);
+ }
+
+void CDsaA::UnlockHwSurface()
+ {
+ iBmp->UnlockHeap();
+ SetUpdating(EFalse);
+ Dsa().Gc()->BitBlt(HwRect().iTl, iBmp);
+ Dsa().ScreenDevice()->Update();
+ }
+
+void CDsaA::CreateSurfaceL()
+ {
+ delete iBmp;
+ iBmp = NULL;
+ iBmp = new (ELeave) CFbsBitmap();
+ User::LeaveIfError(iBmp->Create(HwRect().Size(), DisplayMode()));
+ }
+
+void CDsaA::Wipe(TInt aLength) //dont call in drawing
+ {
+ iBmp->LockHeap();
+ Mem::FillZ(iBmp->DataAddress(), aLength);
+ iBmp->UnlockHeap();
+ }
+
+void CDsaA::RecreateL()
+ {
+ }
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+NONSHARABLE_CLASS(MDsbObs)
+ {
+ public:
+ virtual void SurfaceReady() = 0;
+ virtual CDirectScreenBitmap& Dsb() = 0;
+ };
+
+NONSHARABLE_CLASS(CDsbSurface) : public CActive
+ {
+ public:
+ CDsbSurface(MDsbObs& aDsb);
+ TUint8* Address();
+ void Complete();
+ ~CDsbSurface();
+ private:
+ void RunL();
+ void DoCancel();
+ private:
+ MDsbObs& iDsb;
+ TUint8* iAddress;
+ };
+
+CDsbSurface::CDsbSurface(MDsbObs& aDsb) : CActive(CActive::EPriorityHigh) , iDsb(aDsb)
+ {
+ CActiveScheduler::Add(this);
+ }
+
+CDsbSurface::~CDsbSurface()
+ {
+ Cancel();
+ }
+
+void CDsbSurface::Complete()
+ {
+ if(iAddress != NULL && !IsActive())
+ {
+ iAddress = NULL;
+ SetActive();
+ iDsb.Dsb().EndUpdate(iStatus);
+ }
+ }
+
+TUint8* CDsbSurface::Address()
+ {
+ if(iAddress == NULL && !IsActive())
+ {
+ TAcceleratedBitmapInfo info;
+ if(KErrNone == iDsb.Dsb().BeginUpdate(info))
+ iAddress = info.iAddress;
+ }
+ return iAddress;
+ }
+
+void CDsbSurface::RunL()
+ {
+ iDsb.SurfaceReady();
+ }
+
+void CDsbSurface::DoCancel()
+ {
+ //empty
+ }
+
+NONSHARABLE_CLASS(CDsaB) : public CDsa, public MDsbObs
+ {
+ public:
+ CDsaB(RWsSession& aSession);
+ private:
+ ~CDsaB();
+ TUint8* LockSurface();
+ void UnlockHWSurfaceRequestComplete();
+ void UnlockHwSurface();
+ void CreateSurfaceL();
+ void Wipe(TInt aLength);
+ void RecreateL();
+ void ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice);
+ void Free();
+ CDirectScreenBitmap& Dsb();
+ void SurfaceReady();
+ TInt ExternalUpdate() {return 0;}
+ private:
+ CDsbSurface* iSurface1;
+ CDsbSurface* iSurface2;
+ CDirectScreenBitmap* iDsb;
+ };
+
+CDsaB::CDsaB(RWsSession& aSession) : CDsa(aSession)
+ {
+ }
+
+void CDsaB::Free()
+ {
+ }
+
+void CDsaB::UnlockHWSurfaceRequestComplete()
+ {
+ iSurface1->Complete();
+ iSurface2->Complete();
+ }
+
+void CDsaB::CreateSurfaceL()
+ {
+ }
+
+void CDsaB::Wipe(TInt aLength) //dont call in drawing
+ {
+ TUint8* addr = LockSurface();
+ if(addr != NULL)
+ {
+ Mem::FillZ(addr, aLength);
+ UnlockHwSurface();
+ }
+ }
+
+void CDsaB::UnlockHwSurface()
+ {
+ EpocSdlEnv::Request(CDsa::ERequestUpdate);
+ }
+
+TUint8* CDsaB::LockSurface()
+ {
+ TUint8* addr = iSurface1->Address();
+ if(addr == NULL)
+ addr = iSurface2->Address();
+ SetUpdating(addr == NULL);
+ return addr;
+ }
+
+void CDsaB::SurfaceReady()
+ {
+ SetUpdating(EFalse);
+ }
+
+CDirectScreenBitmap& CDsaB::Dsb()
+ {
+ return *iDsb;
+ }
+
+void CDsaB::ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice)
+ {
+ if(iDsb == NULL)
+ iDsb = CDirectScreenBitmap::NewL();
+ CDsa::ConstructL(aWindow, aDevice);
+ iSurface1 = new (ELeave) CDsbSurface(*this);
+ iSurface2 = new (ELeave) CDsbSurface(*this);
+ }
+
+CDsaB::~CDsaB()
+ {
+ delete iSurface1;
+ delete iSurface2;
+ delete iDsb;
+ }
+
+void CDsaB::RecreateL()
+ {
+ iDsb->Close();
+ iDsb->Create(HwRect(), CDirectScreenBitmap::EDoubleBuffer);
+ }
+
+/////////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+TSize CDsa::WindowSize() const
+ {
+ TSize size = HwRect().Size();
+ if(iStateFlags & EOrientation90)
+ {
+ const TInt tmp = size.iWidth;
+ size.iWidth = size.iHeight;
+ size.iHeight = tmp;
+ }
+ return size;
+ }
+
+void CDsa::SetSuspend()
+ {
+ iStateFlags |= ESdlThreadSuspend;
+ }
+
+void CDsa::ReleaseStop()
+ {
+ iStateFlags &= ~ESdlThreadExplicitStop;
+ }
+
+
+TBool CDsa::Stopped() const
+ {
+ return (iStateFlags & ESdlThreadExplicitStop);
+ }
+
+void CDsa::SetOrientation(CSDL::TOrientationMode aOrientation)
+ {
+ TInt flags = 0;
+ switch(aOrientation)
+ {
+ case CSDL::EOrientation90:
+ flags = EOrientation90;
+ break;
+ case CSDL::EOrientation180:
+ flags = EOrientation180;
+ break;
+ case CSDL::EOrientation270:
+ flags = EOrientation90 | EOrientation180;
+ break;
+ case CSDL::EOrientation0:
+ flags = 0;
+ break;
+ }
+ if(flags != (iStateFlags & EOrientationFlags))
+ {
+ iStateFlags |= EOrientationChanged;
+ iNewFlags = flags; //cannot be set during drawing...
+ }
+ }
+
+CDsa::~CDsa()
+ {
+ if(iDsa != NULL)
+ {
+ iDsa->Cancel();
+ }
+ delete iDsa;
+ User::Free(iLut256);
+ }
+
+void CDsa::ConstructL(RWindow& aWindow, CWsScreenDevice& aDevice)
+ {
+ if(iDsa != NULL)
+ {
+ iDsa->Cancel();
+ delete iDsa;
+ iDsa = NULL;
+ }
+
+
+ iDsa = CDirectScreenAccess::NewL(
+ iSession,
+ aDevice,
+ aWindow,
+ *this);
+
+ if(iLut256 == NULL)
+ iLut256 = (TUint32*) User::AllocL(256 * sizeof(TUint32));
+ iTargetMode = aWindow.DisplayMode();
+ iTargetBpp = BytesPerPixel(DisplayMode());
+ iTargetRect = TRect(aWindow.Position(), aWindow.Size());
+ RestartL();
+ }
+
+void CDsa::LockPalette(TBool aLock)
+ {
+ if(aLock)
+ iStateFlags |= EPaletteLocked;
+ else
+ iStateFlags &= ~EPaletteLocked;
+ }
+TInt CDsa::SetPalette(TInt aFirst, TInt aCount, TUint32* aPalette)
+ {
+ if(iLut256 == NULL)
+ return KErrNotFound;
+ const TInt count = aCount - aFirst;
+ if(count > 256)
+ return KErrArgument;
+ if(iStateFlags & EPaletteLocked)
+ return KErrNone;
+ for(TInt i = aFirst; i < count; i++) //not so busy here:-)
+ {
+ iLut256[i] = aPalette[i];
+ }
+ return KErrNone;
+ }
+
+
+
+
+void CDsa::RestartL()
+ {
+ //const TBool active = iDsa->IsActive();
+
+ //if(!active)
+ iDsa->StartL();
+
+ RRegion* r = iDsa->DrawingRegion();
+ iDsa->Gc()->SetClippingRegion(r);
+ TRect rect = r->BoundingRect();
+
+ if(rect.IsEmpty())
+ {
+ return;
+ }
+
+ iScreenRect = rect; //to ensure properly set, albeit may not(?) match to value SDL has - therefore may has to clip
+
+ RecreateL();
+
+ iStateFlags |= ERunning;
+// iScanLineWidth = iTargetBpp * HwRect().Width();
+ ReleaseStop();
+ if(iStateFlags & ESdlThreadSuspend)
+ {
+ EpocSdlEnv::Resume();
+ iStateFlags &= ~ ESdlThreadSuspend;
+ }
+ }
+
+CDsa::CDsa(RWsSession& aSession) :
+ iSession(aSession),
+ iStateFlags(0)
+ {
+// CActiveScheduler::Add(this);
+ iCFTable[0] = CopyMem;
+ iCFTable[1] = CopyMemFlipReversed;
+ iCFTable[2] = CopyMemReversed;
+ iCFTable[3] = CopyMemFlip;
+
+ iCFTable[4] = Copy256;
+ iCFTable[5] = Copy256FlipReversed;
+ iCFTable[6] = Copy256Reversed;
+ iCFTable[7] = Copy256Flip;
+
+
+ iCFTable[8] = CopySlow;
+ iCFTable[9] = CopySlowFlipReversed;
+ iCFTable[10] = CopySlowReversed;
+ iCFTable[11] = CopySlowFlip;
+ }
+
+RWsSession& CDsa::Session()
+ {
+ return iSession;
+ }
+
+
+
+TUint8* CDsa::LockHwSurface()
+ {
+ if((iStateFlags & EUpdating) == 0) //else frame is skipped
+ {
+ return LockSurface();
+ }
+ return NULL;
+ }
+
+/*
+void CDsa::RunL()
+ {
+ iStateFlags &= ~EUpdating;
+ }
+
+
+void CDsa::DoCancel()
+ {
+ iStateFlags &= ~EUpdating;
+ //nothing can do, just wait?
+ }
+*/
+
+TInt CDsa::AllocSurface(TBool aHwSurface, const TSize& aSize, TDisplayMode aMode)
+ {
+ if(aHwSurface && aMode != DisplayMode())
+ return KErrArgument;
+
+ iSourceMode = aMode;
+
+ iSourceBpp = BytesPerPixel(aMode);
+
+ const TSize size = WindowSize();
+ if(aSize.iWidth > size.iWidth)
+ return KErrTooBig;
+ if(aSize.iHeight > size.iHeight)
+ return KErrTooBig;
+
+ TRAPD(err, CreateSurfaceL());
+ if(err != KErrNone)
+ return err;
+
+
+ SetCopyFunction();
+
+ EpocSdlEnv::ObserverEvent(MSDLObserver::EEventWindowReserved);
+
+ return KErrNone;
+ }
+
+
+/*
+void SaveBmp(const TDesC& aName, const TAny* aData, TInt aLength, const TSize& aSz, TDisplayMode aMode)
+ {
+ CFbsBitmap* s = new CFbsBitmap();
+ s->Create(aSz, aMode);
+ s->LockHeap();
+ TUint32* addr = s->DataAddress();
+ Mem::Copy(addr, aData, aLength);
+ s->UnlockHeap();
+ s->Save(aName);
+ s->Reset();
+ delete s;
+ }
+
+void SaveBmp(const TDesC& aName, const TUint32* aData, const TSize& aSz)
+ {
+ CFbsBitmap* s = new CFbsBitmap();
+ s->Create(aSz, EColor64K);
+ TBitmapUtil bmp(s);
+ bmp.Begin(TPoint(0, 0));
+ for(TInt j = 0; j < aSz.iHeight; j++)
+ {
+ bmp.SetPos(TPoint(0, j));
+ for(TInt i = 0; i < aSz.iWidth; i++)
+ {
+ bmp.SetPixel(*aData);
+ aData++;
+ bmp.IncXPos();
+ }
+ }
+ bmp.End();
+ s->Save(aName);
+ s->Reset();
+ delete s;
+ }
+
+TBuf<16> FooName(TInt aFoo)
+ {
+ TBuf<16> b;
+ b.Format(_L("C:\\pic%d.mbm"), aFoo);
+ return b;
+ }
+*/
+void CDsa::ClipCopy(TUint8* aTarget, const TUint8* aSource, const TRect& aRect, const TRect& aTargetPos) const
+ {
+ TUint8* target = aTarget;
+ const TUint8* source = aSource;
+ const TInt lineWidth = aRect.Width();
+ source += iSourceBpp * (aRect.iTl.iY * lineWidth);
+ TInt sourceStartOffset = iSourceBpp * aRect.iTl.iX;
+ source += sourceStartOffset;
+ target += iTargetBpp * ((aTargetPos.iTl.iY + aRect.iTl.iY ) * lineWidth);
+ TInt targetStartOffset = iTargetBpp * (aRect.iTl.iX + aTargetPos.iTl.iX);
+ target += targetStartOffset;
+ TUint32* targetPtr = reinterpret_cast<TUint32*>(target);
+ const TInt targetWidth = HwRect().Size().iWidth;
+ const TInt height = aRect.Height();
+
+ TInt lineMove = iStateFlags & EOrientation90 ? 1 : lineWidth;
+
+ if(iStateFlags & EOrientation180)
+ {
+
+ targetPtr += targetWidth * (height - 1);
+
+ for(TInt i = 0; i < height; i++) //source is always smaller
+ {
+ iCopyFunction(*this, targetPtr, source, lineWidth, height);
+ source += lineMove;
+ targetPtr -= targetWidth;
+ }
+ }
+ else
+ {
+
+
+ for(TInt i = 0; i < height; i++) //source is always smaller
+ {
+ iCopyFunction(*this, targetPtr, source, lineWidth, height);
+ source += lineMove;
+ targetPtr += targetWidth;
+ }
+ }
+
+ }
+
+
+
+
+void CDsa::Wipe() //dont call in drawing
+ {
+ if(IsDsaAvailable())
+ Wipe(iTargetBpp * iScreenRect.Width() * iScreenRect.Height());
+ }
+
+void CDsa::SetCopyFunction()
+ {
+ //calculate offset to correct function in iCFTable according to given parameters
+ TInt function = 0;
+ const TInt KCopyFunctions = 4;
+ const TInt KOffsetToNative = 0;
+ const TInt KOffsetTo256 = KOffsetToNative + KCopyFunctions;
+ const TInt KOffsetToOtherModes = KOffsetTo256 + KCopyFunctions;
+ const TInt KOffsetTo90Functions = 1;
+ const TInt KOffsetTo180Functions = 2;
+
+ if(iSourceMode == DisplayMode())
+ function = KOffsetToNative; //0
+ else if(iSourceMode == EColor256)
+ function = KOffsetTo256; //4
+ else
+ function = KOffsetToOtherModes; //8
+
+ if(iStateFlags & EOrientation90)
+ function += KOffsetTo90Functions; // + 1
+ if(iStateFlags & EOrientation180)
+ function += KOffsetTo180Functions; //+ 2
+
+ iCopyFunction = iCFTable[function];
+
+ Wipe();
+ }
+
+inline void Rotate(TRect& aRect)
+ {
+ const TInt dx = aRect.iBr.iX - aRect.iTl.iX;
+ const TInt dy = aRect.iBr.iY - aRect.iTl.iY;
+
+ aRect.iBr.iX = aRect.iTl.iX + dy;
+ aRect.iBr.iY = aRect.iTl.iY + dx;
+
+ const TInt tmp = aRect.iTl.iX;
+ aRect.iTl.iX = aRect.iTl.iY;
+ aRect.iTl.iY = tmp;
+ }
+
+/*
+int bar = 0;
+*/
+TBool CDsa::AddUpdateRect(const TUint8* aBits, const TRect& aUpdateRect, const TRect& aRect)
+ {
+
+ if(iStateFlags & EOrientationChanged)
+ {
+ iStateFlags &= ~EOrientationFlags;
+ iStateFlags |= iNewFlags;
+ SetCopyFunction();
+ iStateFlags &= ~EOrientationChanged;
+ EpocSdlEnv::WaitDeviceChange();
+ return EFalse; //skip this frame as data is may be changed
+ }
+
+ if(iTargetAddr == NULL)
+ {
+ iTargetAddr = LockHwSurface();
+ }
+ TUint8* target = iTargetAddr;
+ if(target == NULL)
+ return EFalse;
+
+
+ TRect targetRect = HwRect();
+ TRect sourceRect = aRect;
+ TRect updateRect = aUpdateRect;
+
+ if(iStateFlags & EOrientation90)
+ {
+ Rotate(sourceRect);
+ Rotate(updateRect);
+ }
+
+ if(iSourceMode != DisplayMode() || targetRect != sourceRect || targetRect != updateRect || ((iStateFlags & EOrientationFlags) != 0))
+ {
+ sourceRect.Intersection(targetRect); //so source always smaller or equal than target
+ updateRect.Intersection(targetRect);
+ ClipCopy(target, aBits, updateRect, sourceRect);
+ }
+ else
+ {
+ const TInt byteCount = aRect.Width() * aRect.Height() * iSourceBpp; //this could be stored
+ Mem::Copy(target, aBits, byteCount);
+ }
+
+ return ETrue;
+ }
+
+CDsa* CDsa::CreateL(RWsSession& aSession)
+ {
+ if(EpocSdlEnv::Flags(CSDL::EDrawModeDSB))
+ {
+ TInt flags = CDirectScreenBitmap::ENone;
+ if(EpocSdlEnv::Flags(CSDL::EDrawModeDSBDoubleBuffer))
+ flags |= CDirectScreenBitmap::EDoubleBuffer;
+ if(EpocSdlEnv::Flags(CSDL::EDrawModeDSBIncrentalUpdate))
+ flags |= CDirectScreenBitmap::EIncrementalUpdate;
+ return new (ELeave) CDsaB(aSession);
+ }
+ else
+ return new (ELeave) CDsaA(aSession);
+ }
+
+void CDsa::CreateZoomerL(const TSize& aSize)
+ {
+ iSwSize = aSize;
+ iStateFlags |= EResizeRequest;
+ CreateSurfaceL();
+ SetTargetRect();
+ }
+
+TPoint CDsa::WindowCoordinates(const TPoint& aPoint) const
+ {
+ TPoint pos = aPoint - iScreenRect.iTl;
+ const TSize asz = iScreenRect.Size();
+ if(iStateFlags & EOrientation180)
+ {
+ pos.iX = asz.iWidth - pos.iX;
+ pos.iY = asz.iHeight - pos.iY;
+ }
+ if(iStateFlags & EOrientation90)
+ {
+ pos.iX = aPoint.iY;
+ pos.iY = aPoint.iX;
+ }
+ pos.iX <<= 16;
+ pos.iY <<= 16;
+ pos.iX /= asz.iWidth;
+ pos.iY /= asz.iHeight;
+ pos.iX *= iSwSize.iWidth;
+ pos.iY *= iSwSize.iHeight;
+ pos.iX >>= 16;
+ pos.iY >>= 16;
+ return pos;
+ }
+
+void CDsa::SetTargetRect()
+ {
+ iTargetRect = iScreenRect;
+ if(iStateFlags & EResizeRequest && EpocSdlEnv::Flags(CSDL::EAllowImageResizeKeepRatio))
+ {
+ const TSize asz = iScreenRect.Size();
+ const TSize sz = iSwSize;
+
+ TRect rect;
+
+ const TInt dh = (sz.iHeight << 16) / sz.iWidth;
+
+ if((asz.iWidth * dh ) >> 16 <= asz.iHeight)
+ {
+ rect.SetRect(TPoint(0, 0), TSize(asz.iWidth, (asz.iWidth * dh) >> 16));
+ }
+ else
+ {
+ const TInt dw = (sz.iWidth << 16) / sz.iHeight;
+ rect.SetRect(TPoint(0, 0), TSize((asz.iHeight * dw) >> 16, asz.iHeight));
+ }
+ rect.Move((asz.iWidth - rect.Size().iWidth) >> 1, (asz.iHeight - rect.Size().iHeight) >> 1);
+
+ iTargetRect = rect;
+ iTargetRect.Move(iScreenRect.iTl);
+
+ }
+ if(!(iStateFlags & EResizeRequest))
+ iSwSize = iScreenRect.Size();
+// iScanLineWidth = /*iTargetBpp **/ SwSize().iWidth;
+ }
+
+void CDsa::RecreateL()
+ {
+ }
+
+void CDsa::Free()
+ {
+ }
+
+void CDsa::UpdateSwSurface()
+ {
+ iTargetAddr = NULL;
+ UnlockHwSurface(); //could be faster if does not use AO, but only check status before redraw, then no context switch needed
+ }
+
+void CDsa::SetBlitter(MBlitter* aBlitter)
+ {
+ iBlitter = aBlitter;
+ }
+
+void CDsa::DrawOverlays()
+ {
+ const TInt last = iOverlays.Count() - 1;
+ for(TInt i = last; i >= 0 ; i--)
+ iOverlays[i].iOverlay->Draw(*iDsa->Gc(), HwRect(), SwSize());
+ }
+
+TInt CDsa::AppendOverlay(MOverlay& aOverlay, TInt aPriority)
+ {
+ TInt i;
+ for(i = 0; i < iOverlays.Count() && iOverlays[i].iPriority < aPriority; i++)
+ {}
+ const TOverlay overlay = {&aOverlay, aPriority};
+ return iOverlays.Insert(overlay, i);
+ }
+
+TInt CDsa::RemoveOverlay(MOverlay& aOverlay)
+ {
+ for(TInt i = 0; i < iOverlays.Count(); i++)
+ {
+ if(iOverlays[i].iOverlay == &aOverlay)
+ {
+ iOverlays.Remove(i);
+ return KErrNone;
+ }
+ }
+ return KErrNotFound;
+ }
+
+TInt CDsa::RedrawRequest()
+ {
+ if(!(iStateFlags & (EUpdating) && (iStateFlags & ERunning)))
+ {
+ return ExternalUpdate();
+ }
+ return KErrNotReady;
+ }
+
+
+void CDsa::Resume()
+ {
+ if(Stopped())
+ Restart(RDirectScreenAccess::ETerminateRegion);
+ }
+
+void CDsa::DoStop()
+ {
+ if(IsDsaAvailable())
+ iStateFlags |= ESdlThreadExplicitStop;
+ Stop();
+ }
+
+void CDsa::Stop()
+ {
+ iStateFlags &= ~ERunning;
+// Cancel(); //can be called only from main!
+ iDsa->Cancel();
+ }
+
+void CDsa::AbortNow(RDirectScreenAccess::TTerminationReasons /*aReason*/)
+ {
+// iStateFlags |= EChangeNotify;
+ Stop();
+ }
+
+void CDsa::Restart(RDirectScreenAccess::TTerminationReasons aReason)
+ {
+ if(aReason == RDirectScreenAccess::ETerminateRegion) //auto restart
+ {
+ TRAPD(err, RestartL());
+ PANIC_IF_ERROR(err);
+ }
+ }
+/*)
+TBool CDsa::ChangeTrigger()
+ {
+ const TBool change = iStateFlags & EChangeNotify;
+ iStateFlags &= ~EChangeNotify;
+ return change;
+ }
+*/
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+void CDsa::Copy256(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt)
+ {
+ TUint32* target = aTarget;
+ const TUint32* endt = target + aBytes;
+ const TUint8* source = aSource;
+ while(target < endt)
+ {
+ *target++ = aDsa.iLut256[*source++];
+ }
+ }
+
+void CDsa::Copy256Reversed(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt)
+ {
+ const TUint32* target = aTarget;
+ TUint32* endt = aTarget + aBytes;
+ const TUint8* source = aSource;
+ while(target < endt)
+ {
+ *(--endt) = aDsa.iLut256[*source++];
+ }
+ }
+
+void CDsa::Copy256Flip(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen)
+ {
+ TUint32* target = aTarget;
+ const TUint32* endt = target + aBytes;
+ const TUint8* column = aSource;
+
+ while(target < endt)
+ {
+ *target++ = aDsa.iLut256[*column];
+ column += aLineLen;
+ }
+ }
+
+void CDsa::Copy256FlipReversed(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen)
+ {
+ const TUint32* target = aTarget;
+ TUint32* endt = aTarget + aBytes;
+ const TUint8* column = aSource;
+
+ while(target < endt)
+ {
+ *(--endt) = aDsa.iLut256[*column];
+ column += aLineLen;
+ }
+ }
+
+void CDsa::CopyMem(const CDsa& /*aDsa*/, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt)
+ {
+ Mem::Copy(aTarget, aSource, aBytes);
+ }
+
+void CDsa::CopyMemFlip(const CDsa& /*aDsa*/, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen)
+ {
+ TUint32* target = aTarget;
+ const TUint32* endt = target + aBytes;
+ const TUint32* column = reinterpret_cast<const TUint32*>(aSource);
+
+ while(target < endt)
+ {
+ *target++ = *column;
+ column += aLineLen;
+ }
+ }
+
+void CDsa::CopyMemReversed(const CDsa& /*aDsa*/, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt)
+ {
+ const TUint32* target = aTarget;
+ TUint32* endt = aTarget + aBytes;
+ const TUint32* source = reinterpret_cast<const TUint32*>(aSource);
+ while(target < endt)
+ {
+ *(--endt) = *source++;
+ }
+ }
+
+
+void CDsa::CopyMemFlipReversed(const CDsa& /*aDsa*/, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen)
+ {
+ const TUint32* target = aTarget;
+ TUint32* endt = aTarget + aBytes;
+ const TUint32* column = reinterpret_cast<const TUint32*>(aSource);
+
+ while(target < endt)
+ {
+ *(--endt) = *column;
+ column += aLineLen;
+ }
+ }
+
+
+typedef TRgb (*TRgbFunc) (TInt aValue);
+
+LOCAL_C TRgb rgb16MA(TInt aValue)
+ {
+ return TRgb::Color16MA(aValue);
+ }
+
+NONSHARABLE_CLASS(MRgbCopy)
+ {
+ public:
+ virtual void Copy(TUint32* aTarget, const TUint8* aSource, TInt aBytes, TBool aReversed) = 0;
+ virtual void FlipCopy(TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen, TBool aReversed) = 0;
+ };
+template <class T>
+NONSHARABLE_CLASS(TRgbCopy) : public MRgbCopy
+ {
+ public:
+ TRgbCopy(TDisplayMode aMode);
+ void* operator new(TUint aBytes, TAny* aMem);
+ void Copy(TUint32* aTarget, const TUint8* aSource, TInt aBytes, TBool aReversed);
+ void FlipCopy(TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen, TBool aReversed);
+ private:
+ TRgbFunc iFunc;
+ };
+
+template <class T>
+void* TRgbCopy<T>::operator new(TUint /*aBytes*/, TAny* aMem)
+ {
+ return aMem;
+ }
+
+template <class T>
+TRgbCopy<T>::TRgbCopy(TDisplayMode aMode)
+ {
+ switch(aMode)
+ {
+ case EGray256 : iFunc = TRgb::Gray256; break;
+ case EColor256 : iFunc = TRgb::Color256; break;
+ case EColor4K : iFunc = TRgb::Color4K; break;
+ case EColor64K : iFunc = TRgb::Color64K; break;
+ case EColor16M : iFunc = TRgb::Color16M; break;
+ case EColor16MU : iFunc = TRgb::Color16MU; break;
+ case EColor16MA : iFunc = rgb16MA; break;
+ default:
+ PANIC(KErrNotSupported);
+ }
+ }
+
+template <class T>
+void TRgbCopy<T>::Copy(TUint32* aTarget, const TUint8* aSource, TInt aBytes, TBool aReversed)
+ {
+ const T* source = reinterpret_cast<const T*>(aSource);
+ TUint32* target = aTarget;
+ TUint32* endt = target + aBytes;
+
+ if(aReversed)
+ {
+ while(target < endt)
+ {
+ TUint32 value = *source++;
+ *(--endt) = iFunc(value).Value();
+ }
+ }
+ else
+ {
+ while(target < endt)
+ {
+ TUint32 value = *source++;
+ *target++ = iFunc(value).Value();
+ }
+ }
+ }
+
+template <class T>
+void TRgbCopy<T>::FlipCopy(TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen, TBool aReversed)
+ {
+ const T* column = reinterpret_cast<const T*>(aSource);
+ TUint32* target = aTarget;
+ TUint32* endt = target + aBytes;
+
+ if(aReversed)
+ {
+ while(target < endt)
+ {
+ *(--endt) = iFunc(*column).Value();
+ column += aLineLen;
+ }
+ }
+ else
+ {
+ while(target < endt)
+ {
+ *target++ = iFunc(*column).Value();
+ column += aLineLen;
+ }
+ }
+ }
+
+
+typedef TUint64 TStackMem;
+
+LOCAL_C MRgbCopy* GetCopy(TAny* mem, TDisplayMode aMode)
+ {
+ if(aMode == EColor256 || aMode == EGray256)
+ {
+ return new (mem) TRgbCopy<TUint8>(aMode);
+ }
+ if(aMode == EColor4K || aMode == EColor64K)
+ {
+ return new (mem) TRgbCopy<TUint16>(aMode);
+ }
+ if(aMode == EColor16M || aMode == EColor16MU || aMode == EColor16MA)
+ {
+ return new (mem) TRgbCopy<TUint32>(aMode);
+ }
+ PANIC(KErrNotSupported);
+ return NULL;
+ }
+
+
+void CDsa::CopySlowFlipReversed(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen)
+ {
+ TStackMem mem = 0;
+ GetCopy(&mem, aDsa.iSourceMode)->FlipCopy(aTarget, aSource, aBytes, aLineLen, ETrue);
+ }
+
+void CDsa::CopySlowFlip(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt aLineLen)
+ {
+ TStackMem mem = 0;
+ GetCopy(&mem, aDsa.iSourceMode)->FlipCopy(aTarget, aSource, aBytes, aLineLen, EFalse);
+ }
+
+void CDsa::CopySlow(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt)
+ {
+ TStackMem mem = 0;
+ GetCopy(&mem, aDsa.iSourceMode)->Copy(aTarget, aSource, aBytes, EFalse);
+ }
+
+void CDsa::CopySlowReversed(const CDsa& aDsa, TUint32* aTarget, const TUint8* aSource, TInt aBytes, TInt)
+ {
+ TStackMem mem = 0;
+ GetCopy(&mem, aDsa.iSourceMode)->Copy(aTarget, aSource, aBytes, ETrue);
+ } \ No newline at end of file
diff --git a/distrib/sdl-1.2.15/src/video/symbian/SDL_epocevents_c.h b/distrib/sdl-1.2.15/src/video/symbian/SDL_epocevents_c.h
new file mode 100644
index 0000000..8e10a04
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/symbian/SDL_epocevents_c.h
@@ -0,0 +1,60 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@devolution.com
+*/
+
+/*
+ SDL_epocevents_c.h
+ Handle the event stream, converting Epoc events into SDL events
+
+ Epoc version by Hannu Viitala (hannu.j.viitala@mbnet.fi) and Markus Mertama
+
+*/
+
+
+#ifdef SAVE_RCSID
+static char rcsid =
+ "@(#) $Id: SDL_aaevents_c.h,v 1.1.2.2 2000/03/16 15:20:39 hercules Exp $";
+#endif
+
+extern "C" {
+#include "SDL_sysvideo.h"
+//#include "SDL_epocvideo.h"
+}
+
+
+
+#define MAX_SCANCODE 255
+
+/* Variables and functions exported by SDL_sysevents.c to other parts
+ of the native video subsystem (SDL_sysvideo.c)
+*/
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *_this
+#define Private _this->hidden
+
+extern "C" {
+extern void EPOC_InitOSKeymap(_THIS);
+extern void EPOC_PumpEvents(_THIS);
+}
+
+extern TBool isCursorVisible;
+
diff --git a/distrib/sdl-1.2.15/src/video/vgl/SDL_vglevents.c b/distrib/sdl-1.2.15/src/video/vgl/SDL_vglevents.c
new file mode 100644
index 0000000..fa6c9e7
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/vgl/SDL_vglevents.c
@@ -0,0 +1,299 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Handle the event stream, converting X11 events into SDL events */
+
+#include <stdio.h>
+
+#include <sys/fbio.h>
+#include <sys/consio.h>
+#include <sys/kbio.h>
+#include <vgl.h>
+
+#include "SDL.h"
+#include "SDL_thread.h"
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_vglvideo.h"
+#include "SDL_vglevents_c.h"
+
+/* The translation tables from a console scancode to a SDL keysym */
+/* FIXME: Free the keymap when we shut down the video mode */
+static keymap_t *vga_keymap = NULL;
+static SDLKey keymap[128];
+static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym);
+
+static int posted = 0;
+static int oldx = -1;
+static int oldy = -1;
+static struct mouse_info mouseinfo;
+
+/* Ugh, we have to duplicate the kernel's keysym mapping code...
+ Oh, it's not so bad. :-)
+
+ FIXME: Add keyboard LED handling code
+ */
+int VGL_initkeymaps(int fd)
+{
+ vga_keymap = SDL_malloc(sizeof(keymap_t));
+ if ( ! vga_keymap ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ if (ioctl(fd, GIO_KEYMAP, vga_keymap) == -1) {
+ SDL_free(vga_keymap);
+ vga_keymap = NULL;
+ SDL_SetError("Unable to get keyboard map");
+ return(-1);
+ }
+ return(0);
+}
+
+static void handle_keyboard(_THIS)
+{
+ SDL_keysym keysym;
+ int c, pressed, scancode;
+
+ while ((c = VGLKeyboardGetCh()) != 0) {
+ scancode = c & 0x7F;
+ if (c & 0x80) {
+ pressed = SDL_RELEASED;
+ } else {
+ pressed = SDL_PRESSED;
+ }
+
+ posted += SDL_PrivateKeyboard(pressed,
+ TranslateKey(scancode, &keysym));
+ }
+}
+
+int VGL_initmouse(int fd)
+{
+ mouseinfo.operation = MOUSE_GETINFO;
+ if (ioctl(fd, CONS_MOUSECTL, &mouseinfo) != 0)
+ return -1;
+
+ return 0;
+}
+
+static void handle_mouse(_THIS)
+{
+ char buttons;
+ int x, y;
+ int button_state, state_changed, state;
+ int i;
+
+ ioctl(0, CONS_MOUSECTL, &mouseinfo);
+ x = mouseinfo.u.data.x;
+ y = mouseinfo.u.data.y;
+ buttons = mouseinfo.u.data.buttons;
+
+ if ((x != oldx) || (y != oldy)) {
+ posted += SDL_PrivateMouseMotion(0, 0, x, y);
+ oldx = x;
+ oldy = y;
+ }
+
+ /* See what's changed */
+ button_state = SDL_GetMouseState(NULL, NULL);
+ state_changed = button_state ^ buttons;
+ for (i = 0; i < 8; i++) {
+ if (state_changed & (1<<i)) {
+ if (buttons & (1<<i)) {
+ state = SDL_PRESSED;
+ } else {
+ state = SDL_RELEASED;
+ }
+ posted += SDL_PrivateMouseButton(state, i + 1, 0, 0);
+ }
+ }
+}
+
+
+void VGL_PumpEvents(_THIS)
+{
+ do {
+ posted = 0;
+ handle_keyboard(this);
+ handle_mouse(this);
+ } while (posted != 0);
+}
+
+void VGL_InitOSKeymap(_THIS)
+{
+ int i;
+
+ /* Initialize the BeOS key translation table */
+ for ( i=0; i<SDL_arraysize(keymap); ++i )
+ keymap[i] = SDLK_UNKNOWN;
+
+ keymap[SCANCODE_ESCAPE] = SDLK_ESCAPE;
+ keymap[SCANCODE_1] = SDLK_1;
+ keymap[SCANCODE_2] = SDLK_2;
+ keymap[SCANCODE_3] = SDLK_3;
+ keymap[SCANCODE_4] = SDLK_4;
+ keymap[SCANCODE_5] = SDLK_5;
+ keymap[SCANCODE_6] = SDLK_6;
+ keymap[SCANCODE_7] = SDLK_7;
+ keymap[SCANCODE_8] = SDLK_8;
+ keymap[SCANCODE_9] = SDLK_9;
+ keymap[SCANCODE_0] = SDLK_0;
+ keymap[SCANCODE_MINUS] = SDLK_MINUS;
+ keymap[SCANCODE_EQUAL] = SDLK_EQUALS;
+ keymap[SCANCODE_BACKSPACE] = SDLK_BACKSPACE;
+ keymap[SCANCODE_TAB] = SDLK_TAB;
+ keymap[SCANCODE_Q] = SDLK_q;
+ keymap[SCANCODE_W] = SDLK_w;
+ keymap[SCANCODE_E] = SDLK_e;
+ keymap[SCANCODE_R] = SDLK_r;
+ keymap[SCANCODE_T] = SDLK_t;
+ keymap[SCANCODE_Y] = SDLK_y;
+ keymap[SCANCODE_U] = SDLK_u;
+ keymap[SCANCODE_I] = SDLK_i;
+ keymap[SCANCODE_O] = SDLK_o;
+ keymap[SCANCODE_P] = SDLK_p;
+ keymap[SCANCODE_BRACKET_LEFT] = SDLK_LEFTBRACKET;
+ keymap[SCANCODE_BRACKET_RIGHT] = SDLK_RIGHTBRACKET;
+ keymap[SCANCODE_ENTER] = SDLK_RETURN;
+ keymap[SCANCODE_LEFTCONTROL] = SDLK_LCTRL;
+ keymap[SCANCODE_A] = SDLK_a;
+ keymap[SCANCODE_S] = SDLK_s;
+ keymap[SCANCODE_D] = SDLK_d;
+ keymap[SCANCODE_F] = SDLK_f;
+ keymap[SCANCODE_G] = SDLK_g;
+ keymap[SCANCODE_H] = SDLK_h;
+ keymap[SCANCODE_J] = SDLK_j;
+ keymap[SCANCODE_K] = SDLK_k;
+ keymap[SCANCODE_L] = SDLK_l;
+ keymap[SCANCODE_SEMICOLON] = SDLK_SEMICOLON;
+ keymap[SCANCODE_APOSTROPHE] = SDLK_QUOTE;
+ keymap[SCANCODE_GRAVE] = SDLK_BACKQUOTE;
+ keymap[SCANCODE_LEFTSHIFT] = SDLK_LSHIFT;
+ keymap[SCANCODE_BACKSLASH] = SDLK_BACKSLASH;
+ keymap[SCANCODE_Z] = SDLK_z;
+ keymap[SCANCODE_X] = SDLK_x;
+ keymap[SCANCODE_C] = SDLK_c;
+ keymap[SCANCODE_V] = SDLK_v;
+ keymap[SCANCODE_B] = SDLK_b;
+ keymap[SCANCODE_N] = SDLK_n;
+ keymap[SCANCODE_M] = SDLK_m;
+ keymap[SCANCODE_COMMA] = SDLK_COMMA;
+ keymap[SCANCODE_PERIOD] = SDLK_PERIOD;
+ keymap[SCANCODE_SLASH] = SDLK_SLASH;
+ keymap[SCANCODE_RIGHTSHIFT] = SDLK_RSHIFT;
+ keymap[SCANCODE_KEYPADMULTIPLY] = SDLK_KP_MULTIPLY;
+ keymap[SCANCODE_LEFTALT] = SDLK_LALT;
+ keymap[SCANCODE_SPACE] = SDLK_SPACE;
+ keymap[SCANCODE_CAPSLOCK] = SDLK_CAPSLOCK;
+ keymap[SCANCODE_F1] = SDLK_F1;
+ keymap[SCANCODE_F2] = SDLK_F2;
+ keymap[SCANCODE_F3] = SDLK_F3;
+ keymap[SCANCODE_F4] = SDLK_F4;
+ keymap[SCANCODE_F5] = SDLK_F5;
+ keymap[SCANCODE_F6] = SDLK_F6;
+ keymap[SCANCODE_F7] = SDLK_F7;
+ keymap[SCANCODE_F8] = SDLK_F8;
+ keymap[SCANCODE_F9] = SDLK_F9;
+ keymap[SCANCODE_F10] = SDLK_F10;
+ keymap[SCANCODE_NUMLOCK] = SDLK_NUMLOCK;
+ keymap[SCANCODE_SCROLLLOCK] = SDLK_SCROLLOCK;
+ keymap[SCANCODE_KEYPAD7] = SDLK_KP7;
+ keymap[SCANCODE_CURSORUPLEFT] = SDLK_KP7;
+ keymap[SCANCODE_KEYPAD8] = SDLK_KP8;
+ keymap[SCANCODE_CURSORUP] = SDLK_KP8;
+ keymap[SCANCODE_KEYPAD9] = SDLK_KP9;
+ keymap[SCANCODE_CURSORUPRIGHT] = SDLK_KP9;
+ keymap[SCANCODE_KEYPADMINUS] = SDLK_KP_MINUS;
+ keymap[SCANCODE_KEYPAD4] = SDLK_KP4;
+ keymap[SCANCODE_CURSORLEFT] = SDLK_KP4;
+ keymap[SCANCODE_KEYPAD5] = SDLK_KP5;
+ keymap[SCANCODE_KEYPAD6] = SDLK_KP6;
+ keymap[SCANCODE_CURSORRIGHT] = SDLK_KP6;
+ keymap[SCANCODE_KEYPADPLUS] = SDLK_KP_PLUS;
+ keymap[SCANCODE_KEYPAD1] = SDLK_KP1;
+ keymap[SCANCODE_CURSORDOWNLEFT] = SDLK_KP1;
+ keymap[SCANCODE_KEYPAD2] = SDLK_KP2;
+ keymap[SCANCODE_CURSORDOWN] = SDLK_KP2;
+ keymap[SCANCODE_KEYPAD3] = SDLK_KP3;
+ keymap[SCANCODE_CURSORDOWNRIGHT] = SDLK_KP3;
+ keymap[SCANCODE_KEYPAD0] = SDLK_KP0;
+ keymap[SCANCODE_KEYPADPERIOD] = SDLK_KP_PERIOD;
+ keymap[SCANCODE_LESS] = SDLK_LESS;
+ keymap[SCANCODE_F11] = SDLK_F11;
+ keymap[SCANCODE_F12] = SDLK_F12;
+ keymap[SCANCODE_KEYPADENTER] = SDLK_KP_ENTER;
+ keymap[SCANCODE_RIGHTCONTROL] = SDLK_RCTRL;
+ keymap[SCANCODE_CONTROL] = SDLK_RCTRL;
+ keymap[SCANCODE_KEYPADDIVIDE] = SDLK_KP_DIVIDE;
+ keymap[SCANCODE_PRINTSCREEN] = SDLK_PRINT;
+ keymap[SCANCODE_RIGHTALT] = SDLK_RALT;
+ keymap[SCANCODE_BREAK] = SDLK_BREAK;
+ keymap[SCANCODE_BREAK_ALTERNATIVE] = SDLK_UNKNOWN;
+ keymap[SCANCODE_HOME] = SDLK_HOME;
+ keymap[SCANCODE_CURSORBLOCKUP] = SDLK_UP;
+ keymap[SCANCODE_PAGEUP] = SDLK_PAGEUP;
+ keymap[SCANCODE_CURSORBLOCKLEFT] = SDLK_LEFT;
+ keymap[SCANCODE_CURSORBLOCKRIGHT] = SDLK_RIGHT;
+ keymap[SCANCODE_END] = SDLK_END;
+ keymap[SCANCODE_CURSORBLOCKDOWN] = SDLK_DOWN;
+ keymap[SCANCODE_PAGEDOWN] = SDLK_PAGEDOWN;
+ keymap[SCANCODE_INSERT] = SDLK_INSERT;
+ keymap[SCANCODE_REMOVE] = SDLK_DELETE;
+ keymap[119] = SDLK_PAUSE;
+ keymap[SCANCODE_RIGHTWIN] = SDLK_RSUPER;
+ keymap[SCANCODE_LEFTWIN] = SDLK_LSUPER;
+ keymap[127] = SDLK_MENU;
+}
+
+static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym)
+{
+ /* Set the keysym information */
+ keysym->scancode = scancode;
+ keysym->sym = keymap[scancode];
+ keysym->mod = KMOD_NONE;
+
+ /* If UNICODE is on, get the UNICODE value for the key */
+ keysym->unicode = 0;
+ if ( SDL_TranslateUNICODE && vga_keymap ) {
+ int map;
+ SDLMod modstate;
+
+ modstate = SDL_GetModState();
+ map = 0;
+ if ( modstate & KMOD_SHIFT ) {
+ map += 1;
+ }
+ if ( modstate & KMOD_CTRL ) {
+ map += 2;
+ }
+ if ( modstate & KMOD_ALT ) {
+ map += 4;
+ }
+ if ( !(vga_keymap->key[scancode].spcl & (0x80 >> map)) ) {
+ keysym->unicode = vga_keymap->key[scancode].map[map];
+ }
+
+ }
+ return(keysym);
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/vgl/SDL_vglevents_c.h b/distrib/sdl-1.2.15/src/video/vgl/SDL_vglevents_c.h
new file mode 100644
index 0000000..614cab5
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/vgl/SDL_vglevents_c.h
@@ -0,0 +1,155 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_vglvideo.h"
+
+/* Variables and functions exported by SDL_sysevents.c to other parts
+ of the native video subsystem (SDL_sysvideo.c)
+*/
+extern int VGL_initkeymaps(int fd);
+extern int VGL_initmouse(int fd);
+extern void VGL_keyboardcallback(int scancode, int pressed);
+
+extern void VGL_InitOSKeymap(_THIS);
+extern void VGL_PumpEvents(_THIS);
+
+/* Mouse buttons */
+#define MOUSE_LEFTBUTTON 0x01
+#define MOUSE_MIDDLEBUTTON 0x02
+#define MOUSE_RIGHTBUTTON 0x04
+
+/* Scancodes */
+#define SCANCODE_ESCAPE 1
+#define SCANCODE_1 2
+#define SCANCODE_2 3
+#define SCANCODE_3 4
+#define SCANCODE_4 5
+#define SCANCODE_5 6
+#define SCANCODE_6 7
+#define SCANCODE_7 8
+#define SCANCODE_8 9
+#define SCANCODE_9 10
+#define SCANCODE_0 11
+#define SCANCODE_MINUS 12
+#define SCANCODE_EQUAL 13
+#define SCANCODE_BACKSPACE 14
+#define SCANCODE_TAB 15
+#define SCANCODE_Q 16
+#define SCANCODE_W 17
+#define SCANCODE_E 18
+#define SCANCODE_R 19
+#define SCANCODE_T 20
+#define SCANCODE_Y 21
+#define SCANCODE_U 22
+#define SCANCODE_I 23
+#define SCANCODE_O 24
+#define SCANCODE_P 25
+#define SCANCODE_BRACKET_LEFT 26
+#define SCANCODE_BRACKET_RIGHT 27
+#define SCANCODE_ENTER 28
+#define SCANCODE_LEFTCONTROL 29
+#define SCANCODE_A 30
+#define SCANCODE_S 31
+#define SCANCODE_D 32
+#define SCANCODE_F 33
+#define SCANCODE_G 34
+#define SCANCODE_H 35
+#define SCANCODE_J 36
+#define SCANCODE_K 37
+#define SCANCODE_L 38
+#define SCANCODE_SEMICOLON 39
+#define SCANCODE_APOSTROPHE 40
+#define SCANCODE_GRAVE 41
+#define SCANCODE_LEFTSHIFT 42
+#define SCANCODE_BACKSLASH 43
+#define SCANCODE_Z 44
+#define SCANCODE_X 45
+#define SCANCODE_C 46
+#define SCANCODE_V 47
+#define SCANCODE_B 48
+#define SCANCODE_N 49
+#define SCANCODE_M 50
+#define SCANCODE_COMMA 51
+#define SCANCODE_PERIOD 52
+#define SCANCODE_SLASH 53
+#define SCANCODE_RIGHTSHIFT 54
+#define SCANCODE_KEYPADMULTIPLY 55
+#define SCANCODE_LEFTALT 56
+#define SCANCODE_SPACE 57
+#define SCANCODE_CAPSLOCK 58
+#define SCANCODE_F1 59
+#define SCANCODE_F2 60
+#define SCANCODE_F3 61
+#define SCANCODE_F4 62
+#define SCANCODE_F5 63
+#define SCANCODE_F6 64
+#define SCANCODE_F7 65
+#define SCANCODE_F8 66
+#define SCANCODE_F9 67
+#define SCANCODE_F10 68
+#define SCANCODE_NUMLOCK 69
+#define SCANCODE_SCROLLLOCK 70
+#define SCANCODE_KEYPAD7 71
+#define SCANCODE_CURSORUPLEFT 71
+#define SCANCODE_KEYPAD8 72
+#define SCANCODE_CURSORUP 72
+#define SCANCODE_KEYPAD9 73
+#define SCANCODE_CURSORUPRIGHT 73
+#define SCANCODE_KEYPADMINUS 74
+#define SCANCODE_KEYPAD4 75
+#define SCANCODE_CURSORLEFT 75
+#define SCANCODE_KEYPAD5 76
+#define SCANCODE_KEYPAD6 77
+#define SCANCODE_CURSORRIGHT 77
+#define SCANCODE_KEYPADPLUS 78
+#define SCANCODE_KEYPAD1 79
+#define SCANCODE_CURSORDOWNLEFT 79
+#define SCANCODE_KEYPAD2 80
+#define SCANCODE_CURSORDOWN 80
+#define SCANCODE_KEYPAD3 81
+#define SCANCODE_CURSORDOWNRIGHT 81
+#define SCANCODE_KEYPAD0 82
+#define SCANCODE_KEYPADPERIOD 83
+#define SCANCODE_LESS 86
+#define SCANCODE_F11 87
+#define SCANCODE_F12 88
+#define SCANCODE_KEYPADENTER 89
+#define SCANCODE_RIGHTCONTROL 90
+#define SCANCODE_CONTROL 107
+#define SCANCODE_KEYPADDIVIDE 91
+#define SCANCODE_PRINTSCREEN 92
+#define SCANCODE_RIGHTALT 93
+#define SCANCODE_BREAK 104 /* Beware: is 119 */
+#define SCANCODE_BREAK_ALTERNATIVE 104 /* on some keyboards! */
+#define SCANCODE_HOME 94
+#define SCANCODE_CURSORBLOCKUP 95 /* Cursor key block */
+#define SCANCODE_PAGEUP 96
+#define SCANCODE_CURSORBLOCKLEFT 97 /* Cursor key block */
+#define SCANCODE_CURSORBLOCKRIGHT 98 /* Cursor key block */
+#define SCANCODE_END 99
+#define SCANCODE_CURSORBLOCKDOWN 100 /* Cursor key block */
+#define SCANCODE_PAGEDOWN 101
+#define SCANCODE_INSERT 102
+#define SCANCODE_REMOVE 103
+#define SCANCODE_RIGHTWIN 106
+#define SCANCODE_LEFTWIN 105
diff --git a/distrib/sdl-1.2.15/src/video/vgl/SDL_vglmouse.c b/distrib/sdl-1.2.15/src/video/vgl/SDL_vglmouse.c
new file mode 100644
index 0000000..466f1c5
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/vgl/SDL_vglmouse.c
@@ -0,0 +1,56 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_mouse.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_vglvideo.h"
+#include "SDL_vglmouse_c.h"
+
+
+/* The implementation dependent data for the window manager cursor */
+struct WMcursor {
+ int unused;
+};
+
+
+void VGL_FreeWMCursor(_THIS, WMcursor *cursor)
+{
+ return;
+}
+
+WMcursor *VGL_CreateWMCursor(_THIS,
+ Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
+{
+ return(NULL);
+}
+
+int VGL_ShowWMCursor(_THIS, WMcursor *cursor)
+{
+ return(0);
+}
+
+void VGL_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
+{
+ SDL_PrivateMouseMotion(0, 0, x, y);
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/vgl/SDL_vglmouse_c.h b/distrib/sdl-1.2.15/src/video/vgl/SDL_vglmouse_c.h
new file mode 100644
index 0000000..f579d65
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/vgl/SDL_vglmouse_c.h
@@ -0,0 +1,32 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_vglvideo.h"
+
+/* Functions to be exported */
+extern void VGL_FreeWMCursor(_THIS, WMcursor *cursor);
+extern WMcursor *VGL_CreateWMCursor(_THIS,
+ Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
+extern int VGL_ShowWMCursor(_THIS, WMcursor *cursor);
+extern void VGL_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
+
diff --git a/distrib/sdl-1.2.15/src/video/vgl/SDL_vglvideo.c b/distrib/sdl-1.2.15/src/video/vgl/SDL_vglvideo.c
new file mode 100644
index 0000000..0b61615
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/vgl/SDL_vglvideo.c
@@ -0,0 +1,624 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* libvga based SDL video driver implementation.
+*/
+
+#include <err.h>
+#include <osreldate.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+#include <sys/fbio.h>
+#include <sys/consio.h>
+#include <sys/kbio.h>
+#include <vgl.h>
+
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_vglvideo.h"
+#include "SDL_vglevents_c.h"
+#include "SDL_vglmouse_c.h"
+
+
+/* Initialization/Query functions */
+static int VGL_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **VGL_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *VGL_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int VGL_SetColors(_THIS, int firstcolor, int ncolors,
+ SDL_Color *colors);
+static void VGL_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int VGL_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int VGL_LockHWSurface(_THIS, SDL_Surface *surface);
+static int VGL_FlipHWSurface(_THIS, SDL_Surface *surface);
+static void VGL_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void VGL_FreeHWSurface(_THIS, SDL_Surface *surface);
+
+/* Misc function */
+static VGLMode ** VGLListModes(int depth, int mem_model);
+
+/* VGL driver bootstrap functions */
+
+static int VGL_Available(void)
+{
+ /*
+ * Check to see if we are root and stdin is a
+ * virtual console. Also try to ensure that
+ * modes other than 320x200 are available
+ */
+ int console, hires_available, i;
+ VGLMode **modes;
+
+ console = STDIN_FILENO;
+ if ( console >= 0 ) {
+ struct stat sb;
+ struct vt_mode dummy;
+
+ if ( (fstat(console, &sb) < 0) ||
+ (ioctl(console, VT_GETMODE, &dummy) < 0) ) {
+ console = -1;
+ }
+ }
+ if (geteuid() != 0 && console == -1)
+ return 0;
+
+ modes = VGLListModes(8, V_INFO_MM_DIRECT | V_INFO_MM_PACKED);
+ hires_available = 0;
+ for (i = 0; modes[i] != NULL; i++) {
+ if ((modes[i]->ModeInfo.Xsize > 320) &&
+ (modes[i]->ModeInfo.Ysize > 200) &&
+ ((modes[i]->ModeInfo.Type == VIDBUF8) ||
+ (modes[i]->ModeInfo.Type == VIDBUF16) ||
+ (modes[i]->ModeInfo.Type == VIDBUF32))) {
+ hires_available = 1;
+ break;
+ }
+ }
+ return hires_available;
+}
+
+static void VGL_DeleteDevice(SDL_VideoDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_VideoDevice *VGL_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device;
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *device->hidden));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( device ) {
+ SDL_free(device);
+ }
+ return(0);
+ }
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+
+ /* Set the function pointers */
+ device->VideoInit = VGL_VideoInit;
+ device->ListModes = VGL_ListModes;
+ device->SetVideoMode = VGL_SetVideoMode;
+ device->SetColors = VGL_SetColors;
+ device->UpdateRects = NULL;
+ device->VideoQuit = VGL_VideoQuit;
+ device->AllocHWSurface = VGL_AllocHWSurface;
+ device->CheckHWBlit = NULL;
+ device->FillHWRect = NULL;
+ device->SetHWColorKey = NULL;
+ device->SetHWAlpha = NULL;
+ device->LockHWSurface = VGL_LockHWSurface;
+ device->UnlockHWSurface = VGL_UnlockHWSurface;
+ device->FlipHWSurface = VGL_FlipHWSurface;
+ device->FreeHWSurface = VGL_FreeHWSurface;
+ device->SetIcon = NULL;
+ device->SetCaption = NULL;
+ device->GetWMInfo = NULL;
+ device->FreeWMCursor = VGL_FreeWMCursor;
+ device->CreateWMCursor = VGL_CreateWMCursor;
+ device->ShowWMCursor = VGL_ShowWMCursor;
+ device->WarpWMCursor = VGL_WarpWMCursor;
+ device->InitOSKeymap = VGL_InitOSKeymap;
+ device->PumpEvents = VGL_PumpEvents;
+
+ device->free = VGL_DeleteDevice;
+
+ return device;
+}
+
+VideoBootStrap VGL_bootstrap = {
+ "vgl", "FreeBSD libVGL",
+ VGL_Available, VGL_CreateDevice
+};
+
+static int VGL_AddMode(_THIS, VGLMode *inmode)
+{
+ SDL_Rect *mode;
+
+ int i, index;
+ int next_mode;
+
+ /* Check to see if we already have this mode */
+ if (inmode->Depth < 8) { /* Not supported */
+ return 0;
+ }
+ index = ((inmode->Depth + 7) / 8) - 1;
+ for (i=0; i<SDL_nummodes[index]; ++i) {
+ mode = SDL_modelist[index][i];
+ if ((mode->w == inmode->ModeInfo.Xsize) &&
+ (mode->h == inmode->ModeInfo.Ysize))
+ return 0;
+ }
+
+ /* Set up the new video mode rectangle */
+ mode = (SDL_Rect *)SDL_malloc(sizeof *mode);
+ if (mode == NULL) {
+ SDL_OutOfMemory();
+ return -1;
+ }
+ mode->x = 0;
+ mode->y = 0;
+ mode->w = inmode->ModeInfo.Xsize;
+ mode->h = inmode->ModeInfo.Ysize;
+
+ /* Allocate the new list of modes, and fill in the new mode */
+ next_mode = SDL_nummodes[index];
+ SDL_modelist[index] = (SDL_Rect **)
+ SDL_realloc(SDL_modelist[index], (1+next_mode+1)*sizeof(SDL_Rect *));
+ if (SDL_modelist[index] == NULL) {
+ SDL_OutOfMemory();
+ SDL_nummodes[index] = 0;
+ SDL_free(mode);
+ return -1;
+ }
+ SDL_modelist[index][next_mode] = mode;
+ SDL_modelist[index][next_mode+1] = NULL;
+ SDL_nummodes[index]++;
+
+ return 0;
+}
+
+static void VGL_UpdateVideoInfo(_THIS)
+{
+ this->info.wm_available = 0;
+ this->info.hw_available = 1;
+ this->info.video_mem = 0;
+ if (VGLCurMode == NULL) {
+ return;
+ }
+ if (VGLCurMode->ModeInfo.PixelBytes > 0) {
+ this->info.video_mem = VGLCurMode->ModeInfo.PixelBytes *
+ VGLCurMode->ModeInfo.Xsize *
+ VGLCurMode->ModeInfo.Ysize;
+ }
+}
+
+int VGL_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ int i;
+ int total_modes;
+ VGLMode **modes;
+
+ /* Initialize all variables that we clean on shutdown */
+ for ( i=0; i<NUM_MODELISTS; ++i ) {
+ SDL_nummodes[i] = 0;
+ SDL_modelist[i] = NULL;
+ }
+
+ /* Enable mouse and keyboard support */
+ if (SDL_getenv("SDL_NO_RAWKBD") == NULL) {
+ if (VGLKeyboardInit(VGL_CODEKEYS) != 0) {
+ SDL_SetError("Unable to initialize keyboard");
+ return -1;
+ }
+ } else {
+ warnx("Requiest to put keyboard into a raw mode ignored");
+ }
+ if (VGL_initkeymaps(STDIN_FILENO) != 0) {
+ SDL_SetError("Unable to initialize keymap");
+ return -1;
+ }
+ if (VGL_initmouse(STDIN_FILENO) != 0) {
+ SDL_SetError("Unable to initialize mouse");
+ return -1;
+ }
+
+ /* Determine the current screen size */
+ if (VGLCurMode != NULL) {
+ this->info.current_w = VGLCurMode->ModeInfo.Xsize;
+ this->info.current_h = VGLCurMode->ModeInfo.Ysize;
+ }
+
+ /* Determine the screen depth */
+ if (VGLCurMode != NULL)
+ vformat->BitsPerPixel = VGLCurMode->Depth;
+ else
+ vformat->BitsPerPixel = 16; /* Good default */
+
+ /* Query for the list of available video modes */
+ total_modes = 0;
+ modes = VGLListModes(-1, V_INFO_MM_DIRECT | V_INFO_MM_PACKED);
+ for (i = 0; modes[i] != NULL; i++) {
+ if ((modes[i]->ModeInfo.Type == VIDBUF8) ||
+ (modes[i]->ModeInfo.Type == VIDBUF16) ||
+ (modes[i]->ModeInfo.Type == VIDBUF32)) {
+ VGL_AddMode(this, modes[i]);
+ total_modes++;
+ }
+ }
+ if (total_modes == 0) {
+ SDL_SetError("No linear video modes available");
+ return -1;
+ }
+
+ /* Fill in our hardware acceleration capabilities */
+ VGL_UpdateVideoInfo(this);
+
+ /* Create the hardware surface lock mutex */
+ hw_lock = SDL_CreateMutex();
+ if (hw_lock == NULL) {
+ SDL_SetError("Unable to create lock mutex");
+ VGL_VideoQuit(this);
+ return -1;
+ }
+
+ /* We're done! */
+ return 0;
+}
+
+SDL_Rect **VGL_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ return SDL_modelist[((format->BitsPerPixel+7)/8)-1];
+}
+
+/* Various screen update functions available */
+static void VGL_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
+
+SDL_Surface *VGL_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ int mode_found;
+ int i;
+ VGLMode **modes;
+
+ modes = VGLListModes(bpp, V_INFO_MM_DIRECT | V_INFO_MM_PACKED);
+ mode_found = 0;
+ for (i = 0; modes[i] != NULL; i++) {
+ if ((modes[i]->ModeInfo.Xsize == width) &&
+ (modes[i]->ModeInfo.Ysize == height) &&
+ ((modes[i]->ModeInfo.Type == VIDBUF8) ||
+ (modes[i]->ModeInfo.Type == VIDBUF16) ||
+ (modes[i]->ModeInfo.Type == VIDBUF32))) {
+ mode_found = 1;
+ break;
+ }
+ }
+ if (mode_found == 0) {
+ SDL_SetError("No matching video mode found");
+ return NULL;
+ }
+
+ /* Shutdown previous videomode (if any) */
+ if (VGLCurMode != NULL)
+ VGLEnd();
+
+ /* Try to set the requested linear video mode */
+ if (VGLInit(modes[i]->ModeId) != 0) {
+ SDL_SetError("Unable to switch to requested mode");
+ return NULL;
+ }
+
+ VGLCurMode = SDL_realloc(VGLCurMode, sizeof(VGLMode));
+ VGLCurMode->ModeInfo = *VGLDisplay;
+ VGLCurMode->Depth = modes[i]->Depth;
+ VGLCurMode->ModeId = modes[i]->ModeId;
+ VGLCurMode->Rmask = modes[i]->Rmask;
+ VGLCurMode->Gmask = modes[i]->Gmask;
+ VGLCurMode->Bmask = modes[i]->Bmask;
+
+ /* Workaround a bug in libvgl */
+ if (VGLCurMode->ModeInfo.PixelBytes == 0)
+ (VGLCurMode->ModeInfo.PixelBytes = 1);
+
+ current->w = VGLCurMode->ModeInfo.Xsize;
+ current->h = VGLCurMode->ModeInfo.Ysize;
+ current->pixels = VGLCurMode->ModeInfo.Bitmap;
+ current->pitch = VGLCurMode->ModeInfo.Xsize *
+ VGLCurMode->ModeInfo.PixelBytes;
+ current->flags = (SDL_FULLSCREEN | SDL_HWSURFACE);
+
+ /* Check if we are in a pseudo-color mode */
+ if (VGLCurMode->ModeInfo.Type == VIDBUF8)
+ current->flags |= SDL_HWPALETTE;
+
+ /* Check if we can do doublebuffering */
+ if (flags & SDL_DOUBLEBUF) {
+ if (VGLCurMode->ModeInfo.Xsize * 2 <=
+ VGLCurMode->ModeInfo.VYsize) {
+ current->flags |= SDL_DOUBLEBUF;
+ flip_page = 0;
+ flip_address[0] = (byte *)current->pixels;
+ flip_address[1] = (byte *)current->pixels +
+ current->h * current->pitch;
+ VGL_FlipHWSurface(this, current);
+ }
+ }
+
+ if (! SDL_ReallocFormat(current, modes[i]->Depth, VGLCurMode->Rmask,
+ VGLCurMode->Gmask, VGLCurMode->Bmask, 0)) {
+ return NULL;
+ }
+
+ /* Update hardware acceleration info */
+ VGL_UpdateVideoInfo(this);
+
+ /* Set the blit function */
+ this->UpdateRects = VGL_DirectUpdate;
+
+ /* We're done */
+ return current;
+}
+
+/* We don't actually allow hardware surfaces other than the main one */
+static int VGL_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ return -1;
+}
+static void VGL_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+/* We need to wait for vertical retrace on page flipped displays */
+static int VGL_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ if (surface == SDL_VideoSurface) {
+ SDL_mutexP(hw_lock);
+ }
+ return 0;
+}
+static void VGL_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ if (surface == SDL_VideoSurface) {
+ SDL_mutexV(hw_lock);
+ }
+}
+
+static int VGL_FlipHWSurface(_THIS, SDL_Surface *surface)
+{
+ if (VGLPanScreen(VGLDisplay, 0, flip_page * surface->h) < 0) {
+ SDL_SetError("VGLPanSreen() failed");
+ return -1;
+ }
+
+ flip_page = !flip_page;
+ surface->pixels = flip_address[flip_page];
+
+ return 0;
+}
+
+static void VGL_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+ return;
+}
+
+int VGL_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ int i;
+
+ for(i = 0; i < ncolors; i++) {
+ VGLSetPaletteIndex(firstcolor + i,
+ colors[i].r>>2,
+ colors[i].g>>2,
+ colors[i].b>>2);
+ }
+ return 1;
+}
+
+/* Note: If we are terminated, this could be called in the middle of
+ another SDL video routine -- notably UpdateRects.
+*/
+void VGL_VideoQuit(_THIS)
+{
+ int i, j;
+
+ /* Return the keyboard to the normal state */
+ VGLKeyboardEnd();
+
+ /* Reset the console video mode if we actually initialised one */
+ if (VGLCurMode != NULL) {
+ VGLEnd();
+ SDL_free(VGLCurMode);
+ VGLCurMode = NULL;
+ }
+
+ /* Clear the lock mutex */
+ if (hw_lock != NULL) {
+ SDL_DestroyMutex(hw_lock);
+ hw_lock = NULL;
+ }
+
+ /* Free video mode lists */
+ for (i = 0; i < NUM_MODELISTS; i++) {
+ if (SDL_modelist[i] != NULL) {
+ for (j = 0; SDL_modelist[i][j] != NULL; ++j) {
+ SDL_free(SDL_modelist[i][j]);
+ }
+ SDL_free(SDL_modelist[i]);
+ SDL_modelist[i] = NULL;
+ }
+ }
+
+ if ( this->screen && (this->screen->flags & SDL_HWSURFACE) ) {
+ /* Direct screen access, not a memory buffer */
+ this->screen->pixels = NULL;
+ }
+}
+
+#define VGL_RED_INDEX 0
+#define VGL_GREEN_INDEX 1
+#define VGL_BLUE_INDEX 2
+
+static VGLMode **
+VGLListModes(int depth, int mem_model)
+{
+ static VGLMode **modes = NULL;
+
+ VGLBitmap *vminfop;
+ VGLMode **modesp, *modescp;
+ video_info_t minfo;
+ int adptype, i, modenum;
+
+ if (modes == NULL) {
+ modes = SDL_malloc(sizeof(VGLMode *) * M_VESA_MODE_MAX);
+ bzero(modes, sizeof(VGLMode *) * M_VESA_MODE_MAX);
+ }
+ modesp = modes;
+
+ for (modenum = 0; modenum < M_VESA_MODE_MAX; modenum++) {
+ minfo.vi_mode = modenum;
+ if (ioctl(0, CONS_MODEINFO, &minfo) || ioctl(0, CONS_CURRENT, &adptype))
+ continue;
+ if (minfo.vi_mode != modenum)
+ continue;
+ if ((minfo.vi_flags & V_INFO_GRAPHICS) == 0)
+ continue;
+ if ((mem_model != -1) && ((minfo.vi_mem_model & mem_model) == 0))
+ continue;
+ if ((depth > 1) && (minfo.vi_depth != depth))
+ continue;
+
+ /* reallocf can fail */
+ if ((*modesp = reallocf(*modesp, sizeof(VGLMode))) == NULL)
+ return NULL;
+ modescp = *modesp;
+
+ vminfop = &(modescp->ModeInfo);
+ bzero(vminfop, sizeof(VGLBitmap));
+
+ vminfop->Type = NOBUF;
+
+ vminfop->PixelBytes = 1; /* Good default value */
+ switch (minfo.vi_mem_model) {
+ case V_INFO_MM_PLANAR:
+ /* we can handle EGA/VGA planar modes only */
+ if (!(minfo.vi_depth != 4 || minfo.vi_planes != 4
+ || (adptype != KD_EGA && adptype != KD_VGA)))
+ vminfop->Type = VIDBUF4;
+ break;
+ case V_INFO_MM_PACKED:
+ /* we can do only 256 color packed modes */
+ if (minfo.vi_depth == 8)
+ vminfop->Type = VIDBUF8;
+ break;
+ case V_INFO_MM_VGAX:
+ vminfop->Type = VIDBUF8X;
+ break;
+#if defined(__FREEBSD__) && (defined(__DragonFly__) || __FreeBSD_version >= 500000)
+ case V_INFO_MM_DIRECT:
+ vminfop->PixelBytes = minfo.vi_pixel_size;
+ switch (vminfop->PixelBytes) {
+ case 2:
+ vminfop->Type = VIDBUF16;
+ break;
+#if notyet
+ case 3:
+ vminfop->Type = VIDBUF24;
+ break;
+#endif
+ case 4:
+ vminfop->Type = VIDBUF32;
+ break;
+ default:
+ break;
+ }
+#endif
+ default:
+ break;
+ }
+ if (vminfop->Type == NOBUF)
+ continue;
+
+ switch (vminfop->Type) {
+ case VIDBUF16:
+ case VIDBUF32:
+ modescp->Rmask = ((1 << minfo.vi_pixel_fsizes[VGL_RED_INDEX]) - 1) <<
+ minfo.vi_pixel_fields[VGL_RED_INDEX];
+ modescp->Gmask = ((1 << minfo.vi_pixel_fsizes[VGL_GREEN_INDEX]) - 1) <<
+ minfo.vi_pixel_fields[VGL_GREEN_INDEX];
+ modescp->Bmask = ((1 << minfo.vi_pixel_fsizes[VGL_BLUE_INDEX]) - 1) <<
+ minfo.vi_pixel_fields[VGL_BLUE_INDEX];
+ break;
+
+ default:
+ break;
+ }
+
+ vminfop->Xsize = minfo.vi_width;
+ vminfop->Ysize = minfo.vi_height;
+ modescp->Depth = minfo.vi_depth;
+
+ /* XXX */
+ if (minfo.vi_mode >= M_VESA_BASE)
+ modescp->ModeId = _IO('V', minfo.vi_mode - M_VESA_BASE);
+ else
+ modescp->ModeId = _IO('S', minfo.vi_mode);
+
+ /* Sort list */
+ for (i = 0; modes + i < modesp ; i++) {
+ if (modes[i]->ModeInfo.Xsize * modes[i]->ModeInfo.Ysize >
+ vminfop->Xsize * modes[i]->ModeInfo.Ysize)
+ continue;
+ if ((modes[i]->ModeInfo.Xsize * modes[i]->ModeInfo.Ysize ==
+ vminfop->Xsize * vminfop->Ysize) &&
+ (modes[i]->Depth >= modescp->Depth))
+ continue;
+ *modesp = modes[i];
+ modes[i] = modescp;
+ modescp = *modesp;
+ vminfop = &(modescp->ModeInfo);
+ }
+
+ modesp++;
+ }
+
+ if (*modesp != NULL) {
+ SDL_free(*modesp);
+ *modesp = NULL;
+ }
+
+ return modes;
+}
diff --git a/distrib/sdl-1.2.15/src/video/vgl/SDL_vglvideo.h b/distrib/sdl-1.2.15/src/video/vgl/SDL_vglvideo.h
new file mode 100644
index 0000000..9fc3569
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/vgl/SDL_vglvideo.h
@@ -0,0 +1,65 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_vglvideo_h
+#define _SDL_vglvideo_h
+
+#include <sys/fbio.h>
+#include <sys/consio.h>
+#include <vgl.h>
+
+#include "SDL_mouse.h"
+#include "SDL_mutex.h"
+#include "../SDL_sysvideo.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+typedef struct {
+ int ModeId;
+ int Depth;
+ int Rmask;
+ int Gmask;
+ int Bmask;
+ VGLBitmap ModeInfo;
+} VGLMode;
+
+/* Private display data */
+struct SDL_PrivateVideoData {
+#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
+ int SDL_nummodes[NUM_MODELISTS];
+ SDL_Rect **SDL_modelist[NUM_MODELISTS];
+ SDL_mutex *hw_lock;
+ VGLMode *VGLCurMode;
+ int flip_page;
+ byte *flip_address[2];
+};
+/* Old variable names */
+#define SDL_nummodes (this->hidden->SDL_nummodes)
+#define SDL_modelist (this->hidden->SDL_modelist)
+#define hw_lock (this->hidden->hw_lock)
+#define VGLCurMode (this->hidden->VGLCurMode)
+#define flip_page (this->hidden->flip_page)
+#define flip_address (this->hidden->flip_address)
+
+#endif /* _SDL_vglvideo_h */
diff --git a/distrib/sdl-1.2.15/src/video/wincommon/SDL_lowvideo.h b/distrib/sdl-1.2.15/src/video/wincommon/SDL_lowvideo.h
new file mode 100644
index 0000000..89d1a88
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/wincommon/SDL_lowvideo.h
@@ -0,0 +1,152 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_lowvideo_h
+#define _SDL_lowvideo_h
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#ifndef SetClassLongPtr
+#define SetClassLongPtr SetClassLong
+#endif
+#ifndef GetWindowLongPtr
+#define GetWindowLongPtr GetWindowLong
+#endif
+#ifndef SetWindowLongPtr
+#define SetWindowLongPtr SetWindowLong
+#endif
+#ifndef GWLP_WNDPROC
+#define GWLP_WNDPROC GWL_WNDPROC
+#endif
+#ifndef GWLP_HINSTANCE
+#define GWLP_HINSTANCE GWL_HINSTANCE
+#endif
+#ifndef GCLP_HICON
+#define GCLP_HICON GCL_HICON
+#endif
+
+#include "../SDL_sysvideo.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+#define FULLSCREEN() \
+ ((SDL_VideoSurface->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN)
+
+#define WINDIB_FULLSCREEN() \
+( \
+ SDL_VideoSurface && \
+ FULLSCREEN() && \
+ (((SDL_VideoSurface->flags & SDL_OPENGL ) == SDL_OPENGL ) || \
+ ((SDL_strcmp(this->name, "windib") == 0) || \
+ (SDL_strcmp(this->name, "gapi") == 0))) \
+)
+#define DDRAW_FULLSCREEN() \
+( \
+ SDL_VideoSurface && \
+ FULLSCREEN() && \
+ ((SDL_VideoSurface->flags & SDL_OPENGL ) != SDL_OPENGL ) && \
+ (SDL_strcmp(this->name, "directx") == 0) \
+)
+
+#define DINPUT_FULLSCREEN() \
+( \
+ FULLSCREEN() && \
+ (strcmp(this->name, "directx") == 0) \
+)
+
+#define DINPUT() (strcmp(this->name, "directx") == 0)
+
+/* The main window -- and a function to set it for the audio */
+#ifdef _WIN32_WCE
+extern LPWSTR SDL_Appname;
+#else
+extern LPSTR SDL_Appname;
+#endif
+extern HINSTANCE SDL_Instance;
+extern HWND SDL_Window;
+extern BOOL SDL_windowid;
+
+/* Variables and functions exported to other parts of the native video
+ subsystem (SDL_sysevents.c)
+*/
+extern void WIN_FlushMessageQueue();
+
+/* Called by windows message loop when application is activated */
+extern void (*WIN_Activate)(_THIS, BOOL active, BOOL minimized);
+
+/* Called by windows message loop when system palette is available */
+extern void (*WIN_RealizePalette)(_THIS);
+
+/* Called by windows message loop when the system palette changes */
+extern void (*WIN_PaletteChanged)(_THIS, HWND window);
+
+/* Called by windows message loop when a portion of the screen needs update */
+extern void (*WIN_WinPAINT)(_THIS, HDC hdc);
+
+/* Called by windows message loop when the message isn't handled */
+extern LONG (*HandleMessage)(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+
+/* The window cursor (from SDL_sysmouse.c) */
+extern HCURSOR SDL_hcursor;
+
+/* The bounds of the window in screen coordinates */
+extern RECT SDL_bounds;
+
+/* The position of the window in windowed mode */
+extern int SDL_windowX;
+extern int SDL_windowY;
+
+/* Flag -- SDL is performing a resize, rather than the user */
+extern int SDL_resizing;
+
+/* Flag -- the mouse is in relative motion mode */
+extern int mouse_relative;
+
+/* The GDI fullscreen mode currently active */
+#ifndef NO_CHANGEDISPLAYSETTINGS
+extern DEVMODE SDL_desktop_mode;
+extern DEVMODE SDL_fullscreen_mode;
+#endif
+
+/* The system gamma ramp for GDI modes */
+extern WORD *gamma_saved;
+
+/* This is really from SDL_dx5audio.c */
+extern void DX5_SoundFocus(HWND window);
+
+/* DJM: This is really from SDL_sysevents.c, we need it in
+ GDL_CreateWindow as well */
+LRESULT CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+
+#ifdef _WIN64
+#define SDL_ToUnicode ToUnicode
+#else
+/* JFP: Implementation of ToUnicode() that works on 9x/ME/2K/XP */
+typedef int (WINAPI *ToUnicodeFN)(UINT, UINT, const BYTE *, LPWSTR, int, UINT);
+
+extern ToUnicodeFN SDL_ToUnicode;
+#endif
+
+#endif /* SDL_lowvideo_h */
diff --git a/distrib/sdl-1.2.15/src/video/wincommon/SDL_sysevents.c b/distrib/sdl-1.2.15/src/video/wincommon/SDL_sysevents.c
new file mode 100644
index 0000000..76c67a1
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/wincommon/SDL_sysevents.c
@@ -0,0 +1,855 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+/* Make sure XBUTTON stuff is defined that isn't in older Platform SDKs... */
+#ifndef WM_XBUTTONDOWN
+#define WM_XBUTTONDOWN 0x020B
+#endif
+#ifndef WM_XBUTTONUP
+#define WM_XBUTTONUP 0x020C
+#endif
+#ifndef GET_XBUTTON_WPARAM
+#define GET_XBUTTON_WPARAM(w) (HIWORD(w))
+#endif
+
+#include "SDL_events.h"
+#include "SDL_video.h"
+#include "SDL_syswm.h"
+#include "../SDL_sysvideo.h"
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_lowvideo.h"
+#include "SDL_syswm_c.h"
+#include "SDL_main.h"
+#include "SDL_loadso.h"
+
+#ifdef WMMSG_DEBUG
+#include "wmmsg.h"
+#endif
+
+#include "../windib/SDL_gapidibvideo.h"
+
+#ifdef SDL_VIDEO_DRIVER_GAPI
+#include "../gapi/SDL_gapivideo.h"
+#endif
+
+#ifdef _WIN32_WCE
+#define IsZoomed(HWND) 1
+#define NO_GETKEYBOARDSTATE
+#if _WIN32_WCE < 420
+#define NO_CHANGEDISPLAYSETTINGS
+#endif
+#endif
+
+/* The window we use for everything... */
+#ifdef _WIN32_WCE
+LPWSTR SDL_Appname = NULL;
+#else
+LPSTR SDL_Appname = NULL;
+#endif
+Uint32 SDL_Appstyle = 0;
+HINSTANCE SDL_Instance = NULL;
+HWND SDL_Window = NULL;
+RECT SDL_bounds = {0, 0, 0, 0};
+int SDL_windowX = 0;
+int SDL_windowY = 0;
+int SDL_resizing = 0;
+int mouse_relative = 0;
+int posted = 0;
+#ifndef NO_CHANGEDISPLAYSETTINGS
+DEVMODE SDL_desktop_mode;
+DEVMODE SDL_fullscreen_mode;
+#endif
+WORD *gamma_saved = NULL;
+
+
+/* Functions called by the message processing function */
+LONG (*HandleMessage)(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)=NULL;
+void (*WIN_Activate)(_THIS, BOOL active, BOOL iconic);
+void (*WIN_RealizePalette)(_THIS);
+void (*WIN_PaletteChanged)(_THIS, HWND window);
+void (*WIN_WinPAINT)(_THIS, HDC hdc);
+extern void DIB_SwapGamma(_THIS);
+
+#ifndef NO_GETKEYBOARDSTATE
+#ifndef _WIN64
+/* Variables and support functions for SDL_ToUnicode() */
+static int codepage;
+static int Is9xME();
+static int GetCodePage();
+static int WINAPI ToUnicode9xME(UINT vkey, UINT scancode, const BYTE *keystate, LPWSTR wchars, int wsize, UINT flags);
+
+ToUnicodeFN SDL_ToUnicode = ToUnicode9xME;
+#endif
+#endif /* !NO_GETKEYBOARDSTATE */
+
+
+#if defined(_WIN32_WCE)
+
+//AdjustWindowRect is not available under WinCE 2003
+#define AdjustWindowRect(a,b,c) (AdjustWindowRectEx((a),(b),(c),0))
+
+// dynamically load aygshell dll because we want SDL to work on HPC and be300
+HINSTANCE aygshell = NULL;
+BOOL (WINAPI *SHFullScreen)(HWND hwndRequester, DWORD dwState) = 0;
+
+#define SHFS_SHOWTASKBAR 0x0001
+#define SHFS_HIDETASKBAR 0x0002
+#define SHFS_SHOWSIPBUTTON 0x0004
+#define SHFS_HIDESIPBUTTON 0x0008
+#define SHFS_SHOWSTARTICON 0x0010
+#define SHFS_HIDESTARTICON 0x0020
+
+static void LoadAygshell(void)
+{
+ if( !aygshell )
+ aygshell = SDL_LoadObject("aygshell.dll");
+ if( (aygshell != 0) && (SHFullScreen == 0) )
+ {
+ SHFullScreen = (int (WINAPI *)(struct HWND__ *,unsigned long)) SDL_LoadFunction(aygshell, "SHFullScreen");
+ }
+}
+
+#endif
+
+/* JC 14 Mar 2006
+ This is used all over the place, in the windib driver and in the dx5 driver
+ So we may as well stick it here instead of having multiple copies scattered
+ about
+*/
+void WIN_FlushMessageQueue()
+{
+ MSG msg;
+ while ( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) ) {
+ if ( msg.message == WM_QUIT ) break;
+ TranslateMessage( &msg );
+ DispatchMessage( &msg );
+ }
+}
+
+static void SDL_RestoreGameMode(void)
+{
+#ifdef _WIN32_WCE //Under ce we don't minimize, therefore no restore
+
+#ifdef SDL_VIDEO_DRIVER_GAPI
+ SDL_VideoDevice *this = current_video;
+ if(SDL_strcmp(this->name, "gapi") == 0)
+ {
+ if( this->hidden->gapiInfo->suspended )
+ {
+ this->hidden->gapiInfo->suspended = 0;
+ }
+ }
+#endif
+
+#else
+ ShowWindow(SDL_Window, SW_RESTORE);
+#endif
+
+#ifndef NO_CHANGEDISPLAYSETTINGS
+#ifndef _WIN32_WCE
+ ChangeDisplaySettings(&SDL_fullscreen_mode, CDS_FULLSCREEN);
+#endif
+#endif /* NO_CHANGEDISPLAYSETTINGS */
+}
+static void SDL_RestoreDesktopMode(void)
+{
+
+#ifdef _WIN32_WCE
+
+#ifdef SDL_VIDEO_DRIVER_GAPI
+ SDL_VideoDevice *this = current_video;
+ if(SDL_strcmp(this->name, "gapi") == 0)
+ {
+ if( !this->hidden->gapiInfo->suspended )
+ {
+ this->hidden->gapiInfo->suspended = 1;
+ }
+ }
+#endif
+
+#else
+ /* WinCE does not have a taskbar, so minimizing is not convenient */
+ ShowWindow(SDL_Window, SW_MINIMIZE);
+#endif
+
+#ifndef NO_CHANGEDISPLAYSETTINGS
+#ifndef _WIN32_WCE
+ ChangeDisplaySettings(NULL, 0);
+#endif
+#endif /* NO_CHANGEDISPLAYSETTINGS */
+}
+
+#ifdef WM_MOUSELEAVE
+/*
+ Special code to handle mouse leave events - this sucks...
+ http://support.microsoft.com/support/kb/articles/q183/1/07.asp
+
+ TrackMouseEvent() is only available on Win98 and WinNT.
+ _TrackMouseEvent() is available on Win95, but isn't yet in the mingw32
+ development environment, and only works on systems that have had IE 3.0
+ or newer installed on them (which is not the case with the base Win95).
+ Therefore, we implement our own version of _TrackMouseEvent() which
+ uses our own implementation if TrackMouseEvent() is not available.
+*/
+static BOOL (WINAPI *_TrackMouseEvent)(TRACKMOUSEEVENT *ptme) = NULL;
+
+static VOID CALLBACK
+TrackMouseTimerProc(HWND hWnd, UINT uMsg, UINT idEvent, DWORD dwTime)
+{
+ union { RECT rect; POINT pt; } rectpt; /* prevent type-punning issue. */
+ POINT pt;
+
+ GetClientRect(hWnd, &rectpt.rect);
+ MapWindowPoints(hWnd, NULL, &rectpt.pt, 2);
+ GetCursorPos(&pt);
+ if ( !PtInRect(&rectpt.rect, pt) || (WindowFromPoint(pt) != hWnd) ) {
+ if ( !KillTimer(hWnd, idEvent) ) {
+ /* Error killing the timer! */
+ }
+ PostMessage(hWnd, WM_MOUSELEAVE, 0, 0);
+ }
+}
+static BOOL WINAPI WIN_TrackMouseEvent(TRACKMOUSEEVENT *ptme)
+{
+ if ( ptme->dwFlags == TME_LEAVE ) {
+ return SetTimer(ptme->hwndTrack, ptme->dwFlags, 100,
+ (TIMERPROC)TrackMouseTimerProc) != 0;
+ }
+ return FALSE;
+}
+#endif /* WM_MOUSELEAVE */
+
+int sysevents_mouse_pressed = 0;
+
+/* The main Win32 event handler
+DJM: This is no longer static as (DX5/DIB)_CreateWindow needs it
+*/
+LRESULT CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ SDL_VideoDevice *this = current_video;
+#ifdef WMMSG_DEBUG
+ fprintf(stderr, "Received windows message: ");
+ if ( msg > MAX_WMMSG ) {
+ fprintf(stderr, "%d", msg);
+ } else {
+ fprintf(stderr, "%s", wmtab[msg]);
+ }
+ fprintf(stderr, " -- 0x%X, 0x%X\n", wParam, lParam);
+#endif
+ switch (msg) {
+
+ case WM_ACTIVATE: {
+ SDL_VideoDevice *this = current_video;
+ BOOL active, minimized;
+ Uint8 appstate;
+
+ minimized = HIWORD(wParam);
+ active = (LOWORD(wParam) != WA_INACTIVE) && !minimized;
+ if ( active ) {
+ /* Gain the following states */
+ appstate = SDL_APPACTIVE|SDL_APPINPUTFOCUS;
+ if ( !(SDL_GetAppState() & SDL_APPINPUTFOCUS) ) {
+ if ( this->input_grab != SDL_GRAB_OFF ) {
+ WIN_GrabInput(this, SDL_GRAB_ON);
+ }
+ if ( ! DDRAW_FULLSCREEN() ) {
+ DIB_SwapGamma(this);
+ }
+ if ( WINDIB_FULLSCREEN() ) {
+ SDL_RestoreGameMode();
+ }
+ }
+#if defined(_WIN32_WCE)
+ if ( WINDIB_FULLSCREEN() ) {
+ LoadAygshell();
+ if( SHFullScreen )
+ SHFullScreen(SDL_Window, SHFS_HIDESTARTICON|SHFS_HIDETASKBAR|SHFS_HIDESIPBUTTON);
+ else
+ ShowWindow(FindWindow(TEXT("HHTaskBar"),NULL),SW_HIDE);
+ }
+#endif
+ posted = SDL_PrivateAppActive(1, appstate);
+ } else {
+ /* Lose the following states */
+ appstate = SDL_APPINPUTFOCUS;
+ if ( minimized ) {
+ appstate |= SDL_APPACTIVE;
+ }
+
+ if ( SDL_GetAppState() & SDL_APPINPUTFOCUS ) {
+ if ( this->input_grab != SDL_GRAB_OFF ) {
+ WIN_GrabInput(this, SDL_GRAB_OFF);
+ }
+ if ( ! DDRAW_FULLSCREEN() ) {
+ DIB_SwapGamma(this);
+ }
+ if ( WINDIB_FULLSCREEN() ) {
+ appstate |= SDL_APPMOUSEFOCUS;
+ SDL_RestoreDesktopMode();
+ /* A fullscreen app gets hidden but will not get a minimize event */
+ appstate |= (SDL_APPACTIVE | SDL_APPMOUSEFOCUS);
+#if defined(_WIN32_WCE)
+ LoadAygshell();
+ if( SHFullScreen )
+ SHFullScreen(SDL_Window, SHFS_SHOWSTARTICON|SHFS_SHOWTASKBAR|SHFS_SHOWSIPBUTTON);
+ else
+ ShowWindow(FindWindow(TEXT("HHTaskBar"),NULL),SW_SHOW);
+#endif
+ }
+ }
+ posted = SDL_PrivateAppActive(0, appstate);
+ }
+ WIN_Activate(this, active, minimized);
+ return(0);
+ }
+ break;
+
+ case WM_MOUSEMOVE: {
+
+#ifdef WM_MOUSELEAVE
+ if ( SDL_VideoSurface ) {
+ /* mouse has entered the window */
+
+ if ( !(SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
+ TRACKMOUSEEVENT tme;
+
+ tme.cbSize = sizeof(tme);
+ tme.dwFlags = TME_LEAVE;
+ tme.hwndTrack = SDL_Window;
+ _TrackMouseEvent(&tme);
+ }
+ }
+#endif /* WM_MOUSELEAVE */
+
+ /* Mouse motion is handled in DIB_PumpEvents or
+ * DX5_PumpEvents, depending on the video driver
+ * in use */
+
+ posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
+ }
+ return(0);
+
+#ifdef WM_MOUSELEAVE
+ case WM_MOUSELEAVE: {
+
+ if ( SDL_VideoSurface ) {
+ /* mouse has left the window */
+ posted = SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
+ }
+ }
+ return(0);
+#endif /* WM_MOUSELEAVE */
+
+ case WM_LBUTTONDOWN:
+ case WM_LBUTTONUP:
+ case WM_MBUTTONDOWN:
+ case WM_MBUTTONUP:
+ case WM_RBUTTONDOWN:
+ case WM_RBUTTONUP:
+ case WM_XBUTTONDOWN:
+ case WM_XBUTTONUP: {
+ /* Mouse is handled by DirectInput when fullscreen */
+ if ( SDL_VideoSurface && ! DINPUT() ) {
+ WORD xbuttonval = 0;
+ Uint8 button, state;
+ int x, y;
+
+ /* DJM:
+ We want the SDL window to take focus so that
+ it acts like a normal windows "component"
+ (e.g. gains keyboard focus on a mouse click).
+ */
+ SetFocus(SDL_Window);
+
+ /* Figure out which button to use */
+ switch (msg) {
+ case WM_LBUTTONDOWN:
+ button = SDL_BUTTON_LEFT;
+ state = SDL_PRESSED;
+ break;
+ case WM_LBUTTONUP:
+ button = SDL_BUTTON_LEFT;
+ state = SDL_RELEASED;
+ break;
+ case WM_MBUTTONDOWN:
+ button = SDL_BUTTON_MIDDLE;
+ state = SDL_PRESSED;
+ break;
+ case WM_MBUTTONUP:
+ button = SDL_BUTTON_MIDDLE;
+ state = SDL_RELEASED;
+ break;
+ case WM_RBUTTONDOWN:
+ button = SDL_BUTTON_RIGHT;
+ state = SDL_PRESSED;
+ break;
+ case WM_RBUTTONUP:
+ button = SDL_BUTTON_RIGHT;
+ state = SDL_RELEASED;
+ break;
+ case WM_XBUTTONDOWN:
+ xbuttonval = GET_XBUTTON_WPARAM(wParam);
+ button = SDL_BUTTON_X1 + xbuttonval - 1;
+ state = SDL_PRESSED;
+ break;
+ case WM_XBUTTONUP:
+ xbuttonval = GET_XBUTTON_WPARAM(wParam);
+ button = SDL_BUTTON_X1 + xbuttonval - 1;
+ state = SDL_RELEASED;
+ break;
+ default:
+ /* Eh? Unknown button? */
+ return(0);
+ }
+ if ( state == SDL_PRESSED ) {
+ /* Grab mouse so we get up events */
+ if ( ++sysevents_mouse_pressed > 0 ) {
+ SetCapture(hwnd);
+ }
+ } else {
+ /* Release mouse after all up events */
+ if ( --sysevents_mouse_pressed <= 0 ) {
+ ReleaseCapture();
+ sysevents_mouse_pressed = 0;
+ }
+ }
+ if ( mouse_relative ) {
+ /* RJR: March 28, 2000
+ report internal mouse position if in relative mode */
+ x = 0; y = 0;
+ } else {
+ x = (Sint16)LOWORD(lParam);
+ y = (Sint16)HIWORD(lParam);
+#ifdef _WIN32_WCE
+ if (SDL_VideoSurface)
+ GapiTransform(this->hidden->userOrientation,
+this->hidden->hiresFix, &x, &y);
+#endif
+ }
+ posted = SDL_PrivateMouseButton(
+ state, button, x, y);
+
+ /*
+ * MSDN says:
+ * "Unlike the WM_LBUTTONUP, WM_MBUTTONUP, and WM_RBUTTONUP
+ * messages, an application should return TRUE from [an
+ * XBUTTON message] if it processes it. Doing so will allow
+ * software that simulates this message on Microsoft Windows
+ * systems earlier than Windows 2000 to determine whether
+ * the window procedure processed the message or called
+ * DefWindowProc to process it.
+ */
+ if (xbuttonval > 0)
+ return(TRUE);
+ }
+ }
+ return(0);
+
+
+#if (_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400)
+ case WM_MOUSEWHEEL:
+ if ( SDL_VideoSurface && ! DINPUT() ) {
+ int move = (short)HIWORD(wParam);
+ if ( move ) {
+ Uint8 button;
+ if ( move > 0 )
+ button = SDL_BUTTON_WHEELUP;
+ else
+ button = SDL_BUTTON_WHEELDOWN;
+ posted = SDL_PrivateMouseButton(
+ SDL_PRESSED, button, 0, 0);
+ posted |= SDL_PrivateMouseButton(
+ SDL_RELEASED, button, 0, 0);
+ }
+ }
+ return(0);
+#endif
+
+#ifdef WM_GETMINMAXINFO
+ /* This message is sent as a way for us to "check" the values
+ * of a position change. If we don't like it, we can adjust
+ * the values before they are changed.
+ */
+ case WM_GETMINMAXINFO: {
+ MINMAXINFO *info;
+ RECT size;
+ int x, y;
+ int style;
+ int width;
+ int height;
+
+ /* We don't want to clobber an internal resize */
+ if ( SDL_resizing )
+ return(0);
+
+ /* We allow resizing with the SDL_RESIZABLE flag */
+ if ( SDL_PublicSurface &&
+ (SDL_PublicSurface->flags & SDL_RESIZABLE) ) {
+ return(0);
+ }
+
+ /* Get the current position of our window */
+ GetWindowRect(SDL_Window, &size);
+ x = size.left;
+ y = size.top;
+
+ /* Calculate current width and height of our window */
+ size.top = 0;
+ size.left = 0;
+ if ( SDL_PublicSurface != NULL ) {
+ size.bottom = SDL_PublicSurface->h;
+ size.right = SDL_PublicSurface->w;
+ } else {
+ size.bottom = 0;
+ size.right = 0;
+ }
+
+ /* DJM - according to the docs for GetMenu(), the
+ return value is undefined if hwnd is a child window.
+ Aparently it's too difficult for MS to check
+ inside their function, so I have to do it here.
+ */
+ style = GetWindowLong(hwnd, GWL_STYLE);
+ AdjustWindowRect(
+ &size,
+ style,
+ style & WS_CHILDWINDOW ? FALSE
+ : GetMenu(hwnd) != NULL);
+
+ width = size.right - size.left;
+ height = size.bottom - size.top;
+
+ /* Fix our size to the current size */
+ info = (MINMAXINFO *)lParam;
+ info->ptMaxSize.x = width;
+ info->ptMaxSize.y = height;
+ info->ptMaxPosition.x = x;
+ info->ptMaxPosition.y = y;
+ info->ptMinTrackSize.x = width;
+ info->ptMinTrackSize.y = height;
+ info->ptMaxTrackSize.x = width;
+ info->ptMaxTrackSize.y = height;
+ }
+ return(0);
+#endif /* WM_GETMINMAXINFO */
+
+ case WM_WINDOWPOSCHANGING: {
+ WINDOWPOS *windowpos = (WINDOWPOS*)lParam;
+
+ /* When menu is at the side or top, Windows likes
+ to try to reposition the fullscreen window when
+ changing video modes.
+ */
+ if ( !SDL_resizing &&
+ SDL_PublicSurface &&
+ (SDL_PublicSurface->flags & SDL_FULLSCREEN) ) {
+ windowpos->x = 0;
+ windowpos->y = 0;
+ }
+ }
+ return(0);
+
+ case WM_WINDOWPOSCHANGED: {
+ SDL_VideoDevice *this = current_video;
+ POINT pt;
+ int w, h;
+
+ GetClientRect(SDL_Window, &SDL_bounds);
+
+ /* avoiding type-punning here... */
+ pt.x = SDL_bounds.left;
+ pt.y = SDL_bounds.top;
+ ClientToScreen(SDL_Window, &pt);
+ SDL_bounds.left = pt.x;
+ SDL_bounds.top = pt.y;
+
+ pt.x = SDL_bounds.right;
+ pt.y = SDL_bounds.bottom;
+ ClientToScreen(SDL_Window, &pt);
+ SDL_bounds.right = pt.x;
+ SDL_bounds.bottom = pt.y;
+
+ if ( !SDL_resizing && !IsZoomed(SDL_Window) &&
+ SDL_PublicSurface &&
+ !(SDL_PublicSurface->flags & SDL_FULLSCREEN) ) {
+ SDL_windowX = SDL_bounds.left;
+ SDL_windowY = SDL_bounds.top;
+ }
+ w = SDL_bounds.right-SDL_bounds.left;
+ h = SDL_bounds.bottom-SDL_bounds.top;
+ if ( this->input_grab != SDL_GRAB_OFF ) {
+ ClipCursor(&SDL_bounds);
+ }
+ if ( SDL_PublicSurface &&
+ (SDL_PublicSurface->flags & SDL_RESIZABLE) ) {
+ SDL_PrivateResize(w, h);
+ }
+ }
+ break;
+
+ /* We need to set the cursor */
+ case WM_SETCURSOR: {
+ Uint16 hittest;
+
+ hittest = LOWORD(lParam);
+ if ( hittest == HTCLIENT ) {
+ SetCursor(SDL_hcursor);
+ return(TRUE);
+ }
+ }
+ break;
+
+ /* We are about to get palette focus! */
+ case WM_QUERYNEWPALETTE: {
+ WIN_RealizePalette(current_video);
+ return(TRUE);
+ }
+ break;
+
+ /* Another application changed the palette */
+ case WM_PALETTECHANGED: {
+ WIN_PaletteChanged(current_video, (HWND)wParam);
+ }
+ break;
+
+ /* We were occluded, refresh our display */
+ case WM_PAINT: {
+ HDC hdc;
+ PAINTSTRUCT ps;
+
+ hdc = BeginPaint(SDL_Window, &ps);
+ if ( current_video->screen &&
+ !(current_video->screen->flags & SDL_OPENGL) ) {
+ WIN_WinPAINT(current_video, hdc);
+ }
+ EndPaint(SDL_Window, &ps);
+ }
+ return(0);
+
+ /* DJM: Send an expose event in this case */
+ case WM_ERASEBKGND: {
+ posted = SDL_PrivateExpose();
+ }
+ return(0);
+
+ case WM_CLOSE: {
+ if ( (posted = SDL_PrivateQuit()) )
+ PostQuitMessage(0);
+ }
+ return(0);
+
+ case WM_DESTROY: {
+ PostQuitMessage(0);
+ }
+ return(0);
+
+#ifndef NO_GETKEYBOARDSTATE
+ case WM_INPUTLANGCHANGE:
+#ifndef _WIN64
+ codepage = GetCodePage();
+#endif
+ return(TRUE);
+#endif
+
+ default: {
+ /* Special handling by the video driver */
+ if (HandleMessage) {
+ return(HandleMessage(current_video,
+ hwnd, msg, wParam, lParam));
+ }
+ }
+ break;
+ }
+ return(DefWindowProc(hwnd, msg, wParam, lParam));
+}
+
+/* Allow the application handle to be stored and retrieved later */
+static void *SDL_handle = NULL;
+
+void SDL_SetModuleHandle(void *handle)
+{
+ SDL_handle = handle;
+}
+void *SDL_GetModuleHandle(void)
+{
+ void *handle;
+
+ if ( SDL_handle ) {
+ handle = SDL_handle;
+ } else {
+ handle = GetModuleHandle(NULL);
+ }
+ return(handle);
+}
+
+/* This allows the SDL_WINDOWID hack */
+BOOL SDL_windowid = FALSE;
+
+static int app_registered = 0;
+
+/* Register the class for this application -- exported for winmain.c */
+int SDL_RegisterApp(char *name, Uint32 style, void *hInst)
+{
+ WNDCLASS class;
+#ifdef WM_MOUSELEAVE
+ HMODULE handle;
+#endif
+
+ /* Only do this once... */
+ if ( app_registered ) {
+ ++app_registered;
+ return(0);
+ }
+
+#ifndef CS_BYTEALIGNCLIENT
+#define CS_BYTEALIGNCLIENT 0
+#endif
+ if ( ! name && ! SDL_Appname ) {
+ name = "SDL_app";
+ SDL_Appstyle = CS_BYTEALIGNCLIENT;
+ SDL_Instance = hInst ? hInst : SDL_GetModuleHandle();
+ }
+
+ if ( name ) {
+#ifdef _WIN32_WCE
+ /* WinCE uses the UNICODE version */
+ SDL_Appname = SDL_iconv_utf8_ucs2(name);
+#else
+ SDL_Appname = SDL_iconv_utf8_locale(name);
+#endif /* _WIN32_WCE */
+ SDL_Appstyle = style;
+ SDL_Instance = hInst ? hInst : SDL_GetModuleHandle();
+ }
+
+ /* Register the application class */
+ class.hCursor = NULL;
+ class.hIcon = LoadImage(SDL_Instance, SDL_Appname,
+ IMAGE_ICON,
+ 0, 0, LR_DEFAULTCOLOR);
+ class.lpszMenuName = NULL;
+ class.lpszClassName = SDL_Appname;
+ class.hbrBackground = NULL;
+ class.hInstance = SDL_Instance;
+ class.style = SDL_Appstyle;
+#if SDL_VIDEO_OPENGL
+ class.style |= CS_OWNDC;
+#endif
+ class.lpfnWndProc = WinMessage;
+ class.cbWndExtra = 0;
+ class.cbClsExtra = 0;
+ if ( ! RegisterClass(&class) ) {
+ SDL_SetError("Couldn't register application class");
+ return(-1);
+ }
+
+#ifdef WM_MOUSELEAVE
+ /* Get the version of TrackMouseEvent() we use */
+ _TrackMouseEvent = NULL;
+ handle = GetModuleHandle("USER32.DLL");
+ if ( handle ) {
+ _TrackMouseEvent = (BOOL (WINAPI *)(TRACKMOUSEEVENT *))GetProcAddress(handle, "TrackMouseEvent");
+ }
+ if ( _TrackMouseEvent == NULL ) {
+ _TrackMouseEvent = WIN_TrackMouseEvent;
+ }
+#endif /* WM_MOUSELEAVE */
+
+#ifndef NO_GETKEYBOARDSTATE
+#ifndef _WIN64
+ /* Initialise variables for SDL_ToUnicode() */
+ codepage = GetCodePage();
+
+ /* Cygwin headers don't match windows.h, so we have to cast around a
+ const issue here... */
+ SDL_ToUnicode = Is9xME() ? ToUnicode9xME : (ToUnicodeFN) ToUnicode;
+#endif
+#endif /* NO_GETKEYBOARDSTATE */
+
+ app_registered = 1;
+ return(0);
+}
+
+/* Unregisters the windowclass registered in SDL_RegisterApp above. */
+void SDL_UnregisterApp()
+{
+ WNDCLASS class;
+
+ /* SDL_RegisterApp might not have been called before */
+ if ( !app_registered ) {
+ return;
+ }
+ --app_registered;
+ if ( app_registered == 0 ) {
+ /* Check for any registered window classes. */
+ if ( GetClassInfo(SDL_Instance, SDL_Appname, &class) ) {
+ UnregisterClass(SDL_Appname, SDL_Instance);
+ }
+ SDL_free(SDL_Appname);
+ SDL_Appname = NULL;
+ }
+}
+
+#ifndef NO_GETKEYBOARDSTATE
+#ifndef _WIN64
+/* JFP: Implementation of ToUnicode() that works on 9x/ME/2K/XP */
+
+static int Is9xME()
+{
+ OSVERSIONINFO info;
+
+ SDL_memset(&info, 0, sizeof(info));
+ info.dwOSVersionInfoSize = sizeof(info);
+ if (!GetVersionEx(&info)) {
+ return 0;
+ }
+ return (info.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS);
+}
+
+static int GetCodePage()
+{
+ char buff[8];
+ int lcid = MAKELCID(LOWORD(GetKeyboardLayout(0)), SORT_DEFAULT);
+ int cp = GetACP();
+
+ if (GetLocaleInfo(lcid, LOCALE_IDEFAULTANSICODEPAGE, buff, sizeof(buff))) {
+ cp = SDL_atoi(buff);
+ }
+ return cp;
+}
+
+static int WINAPI ToUnicode9xME(UINT vkey, UINT scancode, const BYTE *keystate, LPWSTR wchars, int wsize, UINT flags)
+{
+ BYTE chars[2];
+
+ /* arg #3 should be const BYTE *, but cygwin lists it as PBYTE. */
+ if (ToAsciiEx(vkey, scancode, (PBYTE) keystate, (WORD*)chars, 0, GetKeyboardLayout(0)) == 1) {
+ return MultiByteToWideChar(codepage, 0, (LPCSTR) chars, 1, wchars, wsize);
+ }
+ return 0;
+}
+#endif
+#endif /* !NO_GETKEYBOARDSTATE */
diff --git a/distrib/sdl-1.2.15/src/video/wincommon/SDL_sysmouse.c b/distrib/sdl-1.2.15/src/video/wincommon/SDL_sysmouse.c
new file mode 100644
index 0000000..12d17e0
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/wincommon/SDL_sysmouse.c
@@ -0,0 +1,259 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include "SDL_mouse.h"
+#include "../../events/SDL_events_c.h"
+#include "../SDL_cursor_c.h"
+#include "SDL_sysmouse_c.h"
+#include "SDL_lowvideo.h"
+
+#ifdef _WIN32_WCE
+#define USE_STATIC_CURSOR
+#endif
+
+HCURSOR SDL_hcursor = NULL; /* Exported for SDL_eventloop.c */
+
+/* The implementation dependent data for the window manager cursor */
+/* For some reason when creating a windows cursor, the ands and xors memory
+ is not copied, so we need to keep track of it and free it when we are done
+ with the cursor. If we free the memory prematurely, the app crashes. :-}
+*/
+struct WMcursor {
+ HCURSOR curs;
+#ifndef USE_STATIC_CURSOR
+ Uint8 *ands;
+ Uint8 *xors;
+#endif
+};
+
+/* Convert bits to padded bytes */
+#define PAD_BITS(bits) ((bits+7)/8)
+
+#ifdef CURSOR_DEBUG
+static void PrintBITMAP(FILE *out, char *bits, int w, int h)
+{
+ int i;
+ unsigned char ch;
+
+ while ( h-- > 0 ) {
+ for ( i=0; i<w; ++i ) {
+ if ( (i%8) == 0 )
+ ch = *bits++;
+ if ( ch&0x80 )
+ fprintf(out, "X");
+ else
+ fprintf(out, " ");
+ ch <<= 1;
+ }
+ fprintf(out, "\n");
+ }
+}
+#endif
+
+#ifndef USE_STATIC_CURSOR
+/* Local functions to convert the SDL cursor mask into Windows format */
+static void memnot(Uint8 *dst, Uint8 *src, int len)
+{
+ while ( len-- > 0 )
+ *dst++ = ~*src++;
+}
+static void memxor(Uint8 *dst, Uint8 *src1, Uint8 *src2, int len)
+{
+ while ( len-- > 0 )
+ *dst++ = (*src1++)^(*src2++);
+}
+#endif /* !USE_STATIC_CURSOR */
+
+void WIN_FreeWMCursor(_THIS, WMcursor *cursor)
+{
+#ifndef USE_STATIC_CURSOR
+ if ( cursor->curs == GetCursor() )
+ SetCursor(NULL);
+ if ( cursor->curs != NULL )
+ DestroyCursor(cursor->curs);
+ if ( cursor->ands != NULL )
+ SDL_free(cursor->ands);
+ if ( cursor->xors != NULL )
+ SDL_free(cursor->xors);
+#endif /* !USE_STATIC_CURSOR */
+ SDL_free(cursor);
+}
+
+WMcursor *WIN_CreateWMCursor(_THIS,
+ Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
+{
+#ifdef USE_STATIC_CURSOR
+ WMcursor *cursor;
+
+ /* Allocate the cursor */
+ cursor = (WMcursor *)SDL_malloc(sizeof(*cursor));
+ if ( cursor ) {
+ cursor->curs = LoadCursor(NULL, IDC_ARROW);
+ }
+ return(cursor);
+#else
+ WMcursor *cursor;
+ int allowed_x;
+ int allowed_y;
+ int run, pad, i;
+ Uint8 *aptr, *xptr;
+
+ /* Check to make sure the cursor size is okay */
+ allowed_x = GetSystemMetrics(SM_CXCURSOR);
+ allowed_y = GetSystemMetrics(SM_CYCURSOR);
+ if ( (w > allowed_x) || (h > allowed_y) ) {
+ SDL_SetError("Only cursors of dimension (%dx%d) are allowed",
+ allowed_x, allowed_y);
+ return(NULL);
+ }
+
+ /* Allocate the cursor */
+ cursor = (WMcursor *)SDL_malloc(sizeof(*cursor));
+ if ( cursor == NULL ) {
+ SDL_SetError("Out of memory");
+ return(NULL);
+ }
+ cursor->curs = NULL;
+ cursor->ands = NULL;
+ cursor->xors = NULL;
+
+ /* Pad out to the normal cursor size */
+ run = PAD_BITS(w);
+ pad = PAD_BITS(allowed_x)-run;
+ aptr = cursor->ands = (Uint8 *)SDL_malloc((run+pad)*allowed_y);
+ xptr = cursor->xors = (Uint8 *)SDL_malloc((run+pad)*allowed_y);
+ if ( (aptr == NULL) || (xptr == NULL) ) {
+ WIN_FreeWMCursor(NULL, cursor);
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ for ( i=0; i<h; ++i ) {
+ memxor(xptr, data, mask, run);
+ xptr += run;
+ data += run;
+ memnot(aptr, mask, run);
+ mask += run;
+ aptr += run;
+ SDL_memset(xptr, 0, pad);
+ xptr += pad;
+ SDL_memset(aptr, ~0, pad);
+ aptr += pad;
+ }
+ pad += run;
+ for ( ; i<allowed_y; ++i ) {
+ SDL_memset(xptr, 0, pad);
+ xptr += pad;
+ SDL_memset(aptr, ~0, pad);
+ aptr += pad;
+ }
+
+ /* Create the cursor */
+ cursor->curs = CreateCursor(
+ (HINSTANCE)GetWindowLongPtr(SDL_Window, GWLP_HINSTANCE),
+ hot_x, hot_y, allowed_x, allowed_y,
+ cursor->ands, cursor->xors);
+ if ( cursor->curs == NULL ) {
+ WIN_FreeWMCursor(NULL, cursor);
+ SDL_SetError("Windows couldn't create the requested cursor");
+ return(NULL);
+ }
+ return(cursor);
+#endif /* USE_STATIC_CURSOR */
+}
+
+int WIN_ShowWMCursor(_THIS, WMcursor *cursor)
+{
+ POINT mouse_pos;
+
+ if ( !this->screen ) {
+ return(0);
+ }
+
+ /* Set the window cursor to our cursor, if applicable */
+ if ( cursor != NULL ) {
+ SDL_hcursor = cursor->curs;
+ } else {
+ SDL_hcursor = NULL;
+ }
+ GetCursorPos(&mouse_pos);
+ if ( PtInRect(&SDL_bounds, mouse_pos) ) {
+ SetCursor(SDL_hcursor);
+ }
+ return(1);
+}
+
+void WIN_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
+{
+ if ( mouse_relative) {
+ /* RJR: March 28, 2000
+ leave physical cursor at center of screen if
+ mouse hidden and grabbed */
+ SDL_PrivateMouseMotion(0, 0, x, y);
+ } else {
+ POINT pt;
+
+ /* With DirectInput the position doesn't follow
+ * the cursor, so it is set manually */
+ if ( DINPUT() ) {
+ SDL_PrivateMouseMotion(0, 0, x, y);
+ }
+
+ pt.x = x;
+ pt.y = y;
+ ClientToScreen(SDL_Window, &pt);
+ SetCursorPos(pt.x, pt.y);
+ }
+}
+
+/* Update the current mouse state and position */
+void WIN_UpdateMouse(_THIS)
+{
+ POINT pt;
+
+ /* Always unset SDL_APPMOUSEFOCUS to give the WM_MOUSEMOVE event
+ * handler a chance to install a TRACKMOUSEEVENT */
+ SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
+
+ GetCursorPos(&pt);
+ ScreenToClient(SDL_Window, &pt);
+ SDL_PrivateMouseMotion(0,0, (Sint16)pt.x, (Sint16)pt.y);
+}
+
+/* Check to see if we need to enter or leave mouse relative mode */
+void WIN_CheckMouseMode(_THIS)
+{
+#ifndef _WIN32_WCE
+ /* If the mouse is hidden and input is grabbed, we use relative mode */
+ if ( !(SDL_cursorstate & CURSOR_VISIBLE) &&
+ (this->input_grab != SDL_GRAB_OFF) ) {
+ mouse_relative = 1;
+ } else {
+ mouse_relative = 0;
+ }
+#else
+ mouse_relative = 0;
+#endif
+}
diff --git a/distrib/sdl-1.2.15/src/video/wincommon/SDL_sysmouse_c.h b/distrib/sdl-1.2.15/src/video/wincommon/SDL_sysmouse_c.h
new file mode 100644
index 0000000..5d5fe8d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/wincommon/SDL_sysmouse_c.h
@@ -0,0 +1,33 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_lowvideo.h"
+
+/* Functions to be exported */
+extern void WIN_FreeWMCursor(_THIS, WMcursor *cursor);
+extern WMcursor *WIN_CreateWMCursor(_THIS,
+ Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
+extern int WIN_ShowWMCursor(_THIS, WMcursor *cursor);
+extern void WIN_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
+extern void WIN_UpdateMouse(_THIS);
+extern void WIN_CheckMouseMode(_THIS);
diff --git a/distrib/sdl-1.2.15/src/video/wincommon/SDL_syswm.c b/distrib/sdl-1.2.15/src/video/wincommon/SDL_syswm.c
new file mode 100644
index 0000000..504d95d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/wincommon/SDL_syswm.c
@@ -0,0 +1,297 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include "SDL_version.h"
+#include "SDL_video.h"
+#include "SDL_loadso.h"
+#include "SDL_syswm.h"
+#include "../SDL_pixels_c.h"
+#include "../SDL_cursor_c.h"
+#include "SDL_syswm_c.h"
+#include "SDL_wingl_c.h"
+
+
+#ifdef _WIN32_WCE
+#define DISABLE_ICON_SUPPORT
+#endif
+
+/* The screen icon -- needs to be freed on SDL_VideoQuit() */
+HICON screen_icn = NULL;
+
+/* Win32 icon mask semantics are different from those of SDL:
+ SDL applies the mask to the icon and copies result to desktop.
+ Win32 applies the mask to the desktop and XORs the icon on.
+ This means that the SDL mask needs to be applied to the icon and
+ then inverted and passed to Win32.
+*/
+void WIN_SetWMIcon(_THIS, SDL_Surface *icon, Uint8 *mask)
+{
+#ifdef DISABLE_ICON_SUPPORT
+ return;
+#else
+ SDL_Palette *pal_256;
+ SDL_Surface *icon_256;
+ Uint8 *pdata, *pwin32;
+ Uint8 *mdata, *mwin32, m = 0;
+ int icon_len;
+ int icon_plen;
+ int icon_mlen;
+ int icon_pitch;
+ int mask_pitch;
+ SDL_Rect bounds;
+ int i, skip;
+ int row, col;
+ struct /* quasi-BMP format */ Win32Icon {
+ Uint32 biSize;
+ Sint32 biWidth;
+ Sint32 biHeight;
+ Uint16 biPlanes;
+ Uint16 biBitCount;
+ Uint32 biCompression;
+ Uint32 biSizeImage;
+ Sint32 biXPelsPerMeter;
+ Sint32 biYPelsPerMeter;
+ Uint32 biClrUsed;
+ Uint32 biClrImportant;
+ struct /* RGBQUAD -- note it's BGR ordered */ {
+ Uint8 rgbBlue;
+ Uint8 rgbGreen;
+ Uint8 rgbRed;
+ Uint8 rgbReserved;
+ } biColors[256];
+ /* Pixels:
+ Uint8 pixels[]
+ */
+ /* Mask:
+ Uint8 mask[]
+ */
+ } *icon_win32;
+
+ /* Allocate the win32 bmp icon and set everything to zero */
+ icon_pitch = ((icon->w+3)&~3);
+ mask_pitch = ((icon->w+7)/8);
+ icon_plen = icon->h*icon_pitch;
+ icon_mlen = icon->h*mask_pitch;
+ icon_len = sizeof(*icon_win32)+icon_plen+icon_mlen;
+ icon_win32 = (struct Win32Icon *)SDL_stack_alloc(Uint8, icon_len);
+ if ( icon_win32 == NULL ) {
+ return;
+ }
+ SDL_memset(icon_win32, 0, icon_len);
+
+ /* Set the basic BMP parameters */
+ icon_win32->biSize = sizeof(*icon_win32)-sizeof(icon_win32->biColors);
+ icon_win32->biWidth = icon->w;
+ icon_win32->biHeight = icon->h*2;
+ icon_win32->biPlanes = 1;
+ icon_win32->biBitCount = 8;
+ icon_win32->biSizeImage = icon_plen+icon_mlen;
+
+ /* Allocate a standard 256 color icon surface */
+ icon_256 = SDL_CreateRGBSurface(SDL_SWSURFACE, icon->w, icon->h,
+ icon_win32->biBitCount, 0, 0, 0, 0);
+ if ( icon_256 == NULL ) {
+ SDL_stack_free(icon_win32);
+ return;
+ }
+ pal_256 = icon_256->format->palette;
+ if (icon->format->palette &&
+ (icon->format->BitsPerPixel == icon_256->format->BitsPerPixel)){
+ Uint8 black;
+ SDL_memcpy(pal_256->colors, icon->format->palette->colors,
+ pal_256->ncolors*sizeof(SDL_Color));
+ /* Make sure that 0 is black! */
+ black = SDL_FindColor(pal_256, 0x00, 0x00, 0x00);
+ pal_256->colors[black] = pal_256->colors[0];
+ pal_256->colors[0].r = 0x00;
+ pal_256->colors[0].g = 0x00;
+ pal_256->colors[0].b = 0x00;
+ } else {
+ SDL_DitherColors(pal_256->colors,
+ icon_256->format->BitsPerPixel);
+ }
+
+ /* Now copy color data to the icon BMP */
+ for ( i=0; i<(1<<icon_win32->biBitCount); ++i ) {
+ icon_win32->biColors[i].rgbRed = pal_256->colors[i].r;
+ icon_win32->biColors[i].rgbGreen = pal_256->colors[i].g;
+ icon_win32->biColors[i].rgbBlue = pal_256->colors[i].b;
+ }
+
+ /* Convert icon to a standard surface format. This may not always
+ be necessary, as Windows supports a variety of BMP formats, but
+ it greatly simplifies our code.
+ */
+ bounds.x = 0;
+ bounds.y = 0;
+ bounds.w = icon->w;
+ bounds.h = icon->h;
+ if ( SDL_LowerBlit(icon, &bounds, icon_256, &bounds) < 0 ) {
+ SDL_stack_free(icon_win32);
+ SDL_FreeSurface(icon_256);
+ return;
+ }
+
+ /* Copy pixels upside-down to icon BMP, masked with the icon mask */
+ if ( SDL_MUSTLOCK(icon_256) || (icon_256->pitch != icon_pitch) ) {
+ SDL_stack_free(icon_win32);
+ SDL_FreeSurface(icon_256);
+ SDL_SetError("Warning: Unexpected icon_256 characteristics");
+ return;
+ }
+ pdata = (Uint8 *)icon_256->pixels;
+ mdata = mask;
+ pwin32 = (Uint8 *)icon_win32+sizeof(*icon_win32)+icon_plen-icon_pitch;
+ skip = icon_pitch - icon->w;
+ for ( row=0; row<icon->h; ++row ) {
+ for ( col=0; col<icon->w; ++col ) {
+ if ( (col%8) == 0 ) {
+ m = *mdata++;
+ }
+ if ( (m&0x80) != 0x00 ) {
+ *pwin32 = *pdata;
+ }
+ m <<= 1;
+ ++pdata;
+ ++pwin32;
+ }
+ pdata += skip;
+ pwin32 += skip;
+ pwin32 -= 2*icon_pitch;
+ }
+ SDL_FreeSurface(icon_256);
+
+ /* Copy mask inverted and upside-down to icon BMP */
+ mdata = mask;
+ mwin32 = (Uint8 *)icon_win32
+ +sizeof(*icon_win32)+icon_plen+icon_mlen-mask_pitch;
+ for ( row=0; row<icon->h; ++row ) {
+ for ( col=0; col<mask_pitch; ++col ) {
+ *mwin32++ = ~*mdata++;
+ }
+ mwin32 -= 2*mask_pitch;
+ }
+
+ /* Finally, create the icon handle and set the window icon */
+ screen_icn = CreateIconFromResourceEx((Uint8 *)icon_win32, icon_len,
+ TRUE, 0x00030000, icon->w, icon->h, LR_DEFAULTCOLOR);
+ if ( screen_icn == NULL ) {
+ SDL_SetError("Couldn't create Win32 icon handle");
+ } else {
+ SetClassLongPtr(SDL_Window, GCLP_HICON, (LONG_PTR)screen_icn);
+ }
+ SDL_stack_free(icon_win32);
+#endif /* DISABLE_ICON_SUPPORT */
+}
+
+typedef BOOL (WINAPI *PtrSetWindowTextW)(HWND hWnd, LPCWSTR lpString);
+
+void WIN_SetWMCaption(_THIS, const char *title, const char *icon)
+{
+#ifdef _WIN32_WCE
+ /* WinCE uses the UNICODE version */
+ LPWSTR lpszW = SDL_iconv_utf8_ucs2((char *)title);
+ SetWindowText(SDL_Window, lpszW);
+ SDL_free(lpszW);
+#else
+ Uint16 *lpsz = SDL_iconv_utf8_ucs2(title);
+ size_t len = WideCharToMultiByte(CP_ACP, 0, lpsz, -1, NULL, 0, NULL, NULL);
+ char *cvt = SDL_stack_alloc(char, len + 1);
+ WideCharToMultiByte(CP_ACP, 0, lpsz, -1, cvt, len, NULL, NULL);
+ SetWindowText(SDL_Window, cvt);
+ SDL_stack_free(cvt);
+ SDL_free(lpsz);
+#endif
+}
+
+int WIN_IconifyWindow(_THIS)
+{
+ ShowWindow(SDL_Window, SW_MINIMIZE);
+ return(1);
+}
+
+SDL_GrabMode WIN_GrabInput(_THIS, SDL_GrabMode mode)
+{
+ if ( mode == SDL_GRAB_OFF ) {
+ ClipCursor(NULL);
+ if ( !(SDL_cursorstate & CURSOR_VISIBLE) ) {
+ /* RJR: March 28, 2000
+ must be leaving relative mode, move mouse from
+ center of window to where it belongs ... */
+ POINT pt;
+ int x, y;
+ SDL_GetMouseState(&x,&y);
+ pt.x = x;
+ pt.y = y;
+ ClientToScreen(SDL_Window, &pt);
+ SetCursorPos(pt.x,pt.y);
+ }
+#ifdef _WIN32_WCE
+ AllKeys(0);
+#endif
+ } else {
+ ClipCursor(&SDL_bounds);
+ if ( !(SDL_cursorstate & CURSOR_VISIBLE) ) {
+ /* RJR: March 28, 2000
+ must be entering relative mode, get ready by
+ moving mouse to center of window ... */
+ POINT pt;
+ pt.x = (SDL_VideoSurface->w/2);
+ pt.y = (SDL_VideoSurface->h/2);
+ ClientToScreen(SDL_Window, &pt);
+ SetCursorPos(pt.x, pt.y);
+ }
+#ifdef _WIN32_WCE
+ AllKeys(1);
+#endif
+ }
+ return(mode);
+}
+
+/* If 'info' is the right version, this function fills it and returns 1.
+ Otherwise, in case of a version mismatch, it returns -1.
+*/
+int WIN_GetWMInfo(_THIS, SDL_SysWMinfo *info)
+{
+ if ( info->version.major <= SDL_MAJOR_VERSION ) {
+ info->window = SDL_Window;
+ if ( SDL_VERSIONNUM(info->version.major,
+ info->version.minor,
+ info->version.patch) >=
+ SDL_VERSIONNUM(1, 2, 5) ) {
+#if SDL_VIDEO_OPENGL
+ info->hglrc = GL_hrc;
+#else
+ info->hglrc = NULL;
+#endif
+ }
+ return(1);
+ } else {
+ SDL_SetError("Application not compiled with SDL %d.%d\n",
+ SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
+ return(-1);
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/wincommon/SDL_syswm_c.h b/distrib/sdl-1.2.15/src/video/wincommon/SDL_syswm_c.h
new file mode 100644
index 0000000..a103b43
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/wincommon/SDL_syswm_c.h
@@ -0,0 +1,35 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_lowvideo.h"
+
+/* Data that needs to be freed at SDL_SYS_VideoQuit() */
+extern HICON screen_icn;
+
+/* Functions to be exported */
+extern void WIN_SetWMIcon(_THIS, SDL_Surface *icon, Uint8 *mask);
+extern void WIN_SetWMCaption(_THIS, const char *title, const char *icon);
+extern int WIN_IconifyWindow(_THIS);
+extern SDL_GrabMode WIN_GrabInput(_THIS, SDL_GrabMode mode);
+extern int WIN_GetWMInfo(_THIS, SDL_SysWMinfo *info);
+
diff --git a/distrib/sdl-1.2.15/src/video/wincommon/SDL_wingl.c b/distrib/sdl-1.2.15/src/video/wincommon/SDL_wingl.c
new file mode 100644
index 0000000..fc4e984
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/wincommon/SDL_wingl.c
@@ -0,0 +1,659 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* WGL implementation of SDL OpenGL support */
+
+#if SDL_VIDEO_OPENGL
+#include "SDL_opengl.h"
+#endif
+#include "SDL_lowvideo.h"
+#include "SDL_wingl_c.h"
+
+#if SDL_VIDEO_OPENGL
+#define DEFAULT_GL_DRIVER_PATH "OPENGL32.DLL"
+#endif
+
+/* If setting the HDC fails, we may need to recreate the window (MSDN) */
+static int WIN_GL_ResetWindow(_THIS)
+{
+ int status = 0;
+
+#ifndef _WIN32_WCE /* FIXME WinCE needs the UNICODE version of CreateWindow() */
+ /* This doesn't work with DirectX code (see CVS comments) */
+ /* If we were passed a window, then we can't create a new one */
+ if ( !SDL_windowid && SDL_strcmp(this->name, "windib") == 0 ) {
+ /* Save the existing window attributes */
+ LONG style;
+ RECT rect = { 0, 0, 0, 0 };
+ style = GetWindowLong(SDL_Window, GWL_STYLE);
+ GetWindowRect(SDL_Window, &rect);
+ DestroyWindow(SDL_Window);
+ WIN_FlushMessageQueue();
+
+ SDL_resizing = 1;
+ SDL_Window = CreateWindow(SDL_Appname, SDL_Appname,
+ style,
+ rect.left, rect.top,
+ (rect.right-rect.left)+1,
+ (rect.bottom-rect.top)+1,
+ NULL, NULL, SDL_Instance, NULL);
+ WIN_FlushMessageQueue();
+ SDL_resizing = 0;
+
+ if ( SDL_Window ) {
+ this->SetCaption(this, this->wm_title, this->wm_icon);
+ } else {
+ SDL_SetError("Couldn't create window");
+ status = -1;
+ }
+ } else
+#endif /* !_WIN32_WCE */
+ {
+ SDL_SetError("Unable to reset window for OpenGL context");
+ status = -1;
+ }
+ return(status);
+}
+
+#if SDL_VIDEO_OPENGL
+
+static int ExtensionSupported(const char *extension, const char *extensions)
+{
+ const char *start;
+ const char *where, *terminator;
+
+ /* Extension names should not have spaces. */
+ where = SDL_strchr(extension, ' ');
+ if ( where || *extension == '\0' )
+ return 0;
+
+ if ( ! extensions )
+ return 0;
+
+ /* It takes a bit of care to be fool-proof about parsing the
+ * OpenGL extensions string. Don't be fooled by sub-strings,
+ * etc. */
+
+ start = extensions;
+
+ for (;;)
+ {
+ where = SDL_strstr(start, extension);
+ if (!where) break;
+
+ terminator = where + SDL_strlen(extension);
+ if (where == start || *(where - 1) == ' ')
+ if (*terminator == ' ' || *terminator == '\0') return 1;
+
+ start = terminator;
+ }
+
+ return 0;
+}
+
+static int ChoosePixelFormatARB(_THIS, const int *iAttribs, const FLOAT *fAttribs)
+{
+ HWND hwnd;
+ HDC hdc;
+ HGLRC hglrc;
+ const char * (WINAPI *wglGetExtensionsStringARB)(HDC) = 0;
+ const char *extensions;
+ int pformat = 0;
+ UINT matches = 0;
+
+ hwnd = CreateWindow(SDL_Appname, SDL_Appname, WS_POPUP | WS_DISABLED,
+ 0, 0, 10, 10,
+ NULL, NULL, SDL_Instance, NULL);
+ WIN_FlushMessageQueue();
+
+ hdc = GetDC(hwnd);
+
+ SetPixelFormat(hdc, ChoosePixelFormat(hdc, &GL_pfd), &GL_pfd);
+
+ hglrc = this->gl_data->wglCreateContext(hdc);
+ if ( hglrc ) {
+ this->gl_data->wglMakeCurrent(hdc, hglrc);
+ }
+
+ wglGetExtensionsStringARB = (const char * (WINAPI *)(HDC))
+ this->gl_data->wglGetProcAddress("wglGetExtensionsStringARB");
+
+ if( wglGetExtensionsStringARB ) {
+ extensions = wglGetExtensionsStringARB(hdc);
+ } else {
+ extensions = NULL;
+ }
+
+ this->gl_data->WGL_ARB_pixel_format = 0;
+ if( ExtensionSupported("WGL_ARB_pixel_format", extensions) ) {
+ BOOL (WINAPI *wglChoosePixelFormatARB)(HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
+ wglChoosePixelFormatARB =
+ (BOOL (WINAPI *)(HDC, const int *, const FLOAT *, UINT, int *, UINT *))
+ this->gl_data->wglGetProcAddress("wglChoosePixelFormatARB");
+ if( wglChoosePixelFormatARB &&
+ wglChoosePixelFormatARB(hdc, iAttribs, fAttribs, 1, &pformat, &matches) && pformat ) {
+ this->gl_data->WGL_ARB_pixel_format = 1;
+ }
+ }
+
+ if ( hglrc ) {
+ this->gl_data->wglMakeCurrent(NULL, NULL);
+ this->gl_data->wglDeleteContext(hglrc);
+ }
+ ReleaseDC(hwnd, hdc);
+ DestroyWindow(hwnd);
+ WIN_FlushMessageQueue();
+
+ return pformat;
+}
+
+#endif /* SDL_VIDEO_OPENGL */
+
+int WIN_GL_SetupWindow(_THIS)
+{
+ int retval;
+#if SDL_VIDEO_OPENGL
+ int i;
+ int iAttribs[64];
+ int *iAttr;
+ int *iAccelAttr = NULL;
+ float fAttribs[1] = { 0 };
+ const GLubyte *(WINAPI *glGetStringFunc)(GLenum);
+ const char *wglext;
+
+ /* load the gl driver from a default path */
+ if ( ! this->gl_config.driver_loaded ) {
+ /* no driver has been loaded, use default (ourselves) */
+ if ( WIN_GL_LoadLibrary(this, NULL) < 0 ) {
+ return(-1);
+ }
+ }
+
+ /* Set up the pixel format descriptor with our needed format */
+ SDL_memset(&GL_pfd, 0, sizeof(GL_pfd));
+ GL_pfd.nSize = sizeof(GL_pfd);
+ GL_pfd.nVersion = 1;
+ GL_pfd.dwFlags = (PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL);
+ if ( this->gl_config.double_buffer ) {
+ GL_pfd.dwFlags |= PFD_DOUBLEBUFFER;
+ }
+ if ( this->gl_config.stereo ) {
+ GL_pfd.dwFlags |= PFD_STEREO;
+ }
+ GL_pfd.iPixelType = PFD_TYPE_RGBA;
+ GL_pfd.cColorBits = this->gl_config.buffer_size;
+ GL_pfd.cRedBits = this->gl_config.red_size;
+ GL_pfd.cGreenBits = this->gl_config.green_size;
+ GL_pfd.cBlueBits = this->gl_config.blue_size;
+ GL_pfd.cAlphaBits = this->gl_config.alpha_size;
+ GL_pfd.cAccumRedBits = this->gl_config.accum_red_size;
+ GL_pfd.cAccumGreenBits = this->gl_config.accum_green_size;
+ GL_pfd.cAccumBlueBits = this->gl_config.accum_blue_size;
+ GL_pfd.cAccumAlphaBits = this->gl_config.accum_alpha_size;
+ GL_pfd.cAccumBits =
+ (GL_pfd.cAccumRedBits + GL_pfd.cAccumGreenBits +
+ GL_pfd.cAccumBlueBits + GL_pfd.cAccumAlphaBits);
+ GL_pfd.cDepthBits = this->gl_config.depth_size;
+ GL_pfd.cStencilBits = this->gl_config.stencil_size;
+
+ /* setup WGL_ARB_pixel_format attribs */
+ iAttr = &iAttribs[0];
+
+ *iAttr++ = WGL_DRAW_TO_WINDOW_ARB;
+ *iAttr++ = GL_TRUE;
+ *iAttr++ = WGL_RED_BITS_ARB;
+ *iAttr++ = this->gl_config.red_size;
+ *iAttr++ = WGL_GREEN_BITS_ARB;
+ *iAttr++ = this->gl_config.green_size;
+ *iAttr++ = WGL_BLUE_BITS_ARB;
+ *iAttr++ = this->gl_config.blue_size;
+
+ /* 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;
+ iAccelAttr = iAttr;
+ if (this->gl_config.accelerated) {
+ *iAttr++ = WGL_FULL_ACCELERATION_ARB;
+ } else {
+ *iAttr++ = WGL_NO_ACCELERATION_ARB;
+ }
+
+ if ( this->gl_config.alpha_size ) {
+ *iAttr++ = WGL_ALPHA_BITS_ARB;
+ *iAttr++ = this->gl_config.alpha_size;
+ }
+
+ *iAttr++ = WGL_DOUBLE_BUFFER_ARB;
+ *iAttr++ = this->gl_config.double_buffer;
+
+ *iAttr++ = WGL_DEPTH_BITS_ARB;
+ *iAttr++ = this->gl_config.depth_size;
+
+ if ( this->gl_config.stencil_size ) {
+ *iAttr++ = WGL_STENCIL_BITS_ARB;
+ *iAttr++ = this->gl_config.stencil_size;
+ }
+
+ if ( this->gl_config.accum_red_size ) {
+ *iAttr++ = WGL_ACCUM_RED_BITS_ARB;
+ *iAttr++ = this->gl_config.accum_red_size;
+ }
+
+ if ( this->gl_config.accum_green_size ) {
+ *iAttr++ = WGL_ACCUM_GREEN_BITS_ARB;
+ *iAttr++ = this->gl_config.accum_green_size;
+ }
+
+ if ( this->gl_config.accum_blue_size ) {
+ *iAttr++ = WGL_ACCUM_BLUE_BITS_ARB;
+ *iAttr++ = this->gl_config.accum_blue_size;
+ }
+
+ if ( this->gl_config.accum_alpha_size ) {
+ *iAttr++ = WGL_ACCUM_ALPHA_BITS_ARB;
+ *iAttr++ = this->gl_config.accum_alpha_size;
+ }
+
+ if ( this->gl_config.stereo ) {
+ *iAttr++ = WGL_STEREO_ARB;
+ *iAttr++ = GL_TRUE;
+ }
+
+ if ( this->gl_config.multisamplebuffers ) {
+ *iAttr++ = WGL_SAMPLE_BUFFERS_ARB;
+ *iAttr++ = this->gl_config.multisamplebuffers;
+ }
+
+ if ( this->gl_config.multisamplesamples ) {
+ *iAttr++ = WGL_SAMPLES_ARB;
+ *iAttr++ = this->gl_config.multisamplesamples;
+ }
+
+ *iAttr = 0;
+
+ for ( i=0; ; ++i ) {
+ /* Get the window device context for our OpenGL drawing */
+ GL_hdc = GetDC(SDL_Window);
+ if ( GL_hdc == NULL ) {
+ SDL_SetError("Unable to get DC for SDL_Window");
+ return(-1);
+ }
+
+ /* Choose and set the closest available pixel format */
+ pixel_format = 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 = ChoosePixelFormatARB(this, iAttribs, fAttribs);
+ *iAccelAttr = WGL_FULL_ACCELERATION_ARB; /* if we try again. */
+ }
+ if ( !pixel_format ) {
+ pixel_format = ChoosePixelFormat(GL_hdc, &GL_pfd);
+ }
+ if ( !pixel_format ) {
+ SDL_SetError("No matching GL pixel format available");
+ return(-1);
+ }
+ if ( !SetPixelFormat(GL_hdc, pixel_format, &GL_pfd) ) {
+ if ( i == 0 ) {
+ /* First time through, try resetting the window */
+ if ( WIN_GL_ResetWindow(this) < 0 ) {
+ return(-1);
+ }
+ continue;
+ }
+ SDL_SetError("Unable to set HDC pixel format");
+ return(-1);
+ }
+ /* We either succeeded or failed by this point */
+ break;
+ }
+ DescribePixelFormat(GL_hdc, pixel_format, sizeof(GL_pfd), &GL_pfd);
+
+ GL_hrc = this->gl_data->wglCreateContext(GL_hdc);
+ if ( GL_hrc == NULL ) {
+ SDL_SetError("Unable to create GL context");
+ return(-1);
+ }
+ if ( WIN_GL_MakeCurrent(this) < 0 ) {
+ return(-1);
+ }
+ gl_active = 1;
+
+ /* Get the wglGetPixelFormatAttribivARB pointer for the context */
+ if ( this->gl_data->WGL_ARB_pixel_format ) {
+ this->gl_data->wglGetPixelFormatAttribivARB =
+ (BOOL (WINAPI *)(HDC, int, int, UINT, const int *, int *))
+ this->gl_data->wglGetProcAddress("wglGetPixelFormatAttribivARB");
+ } else {
+ this->gl_data->wglGetPixelFormatAttribivARB = NULL;
+ }
+
+ /* Vsync control under Windows. Checking glGetString here is
+ * somewhat a documented and reliable hack - it was originally
+ * as a feature added by mistake, but since so many people rely
+ * on it, it will not be removed. strstr should be safe here.*/
+ glGetStringFunc = WIN_GL_GetProcAddress(this, "glGetString");
+ if ( glGetStringFunc ) {
+ wglext = (const char *)glGetStringFunc(GL_EXTENSIONS);
+ } else {
+ /* Uh oh, something is seriously wrong here... */
+ wglext = NULL;
+ }
+ if ( wglext && SDL_strstr(wglext, "WGL_EXT_swap_control") ) {
+ this->gl_data->wglSwapIntervalEXT = WIN_GL_GetProcAddress(this, "wglSwapIntervalEXT");
+ this->gl_data->wglGetSwapIntervalEXT = WIN_GL_GetProcAddress(this, "wglGetSwapIntervalEXT");
+ } else {
+ this->gl_data->wglSwapIntervalEXT = NULL;
+ this->gl_data->wglGetSwapIntervalEXT = NULL;
+ }
+ if ( this->gl_config.swap_control >= 0 ) {
+ if ( this->gl_data->wglSwapIntervalEXT ) {
+ this->gl_data->wglSwapIntervalEXT(this->gl_config.swap_control);
+ }
+ }
+#else
+ SDL_SetError("WIN driver not configured with OpenGL");
+#endif
+ if ( gl_active ) {
+ retval = 0;
+ } else {
+ retval = -1;
+ }
+ return(retval);
+}
+
+void WIN_GL_ShutDown(_THIS)
+{
+#if SDL_VIDEO_OPENGL
+ /* Clean up OpenGL */
+ if ( GL_hrc ) {
+ this->gl_data->wglMakeCurrent(NULL, NULL);
+ this->gl_data->wglDeleteContext(GL_hrc);
+ GL_hrc = NULL;
+ }
+ if ( GL_hdc ) {
+ ReleaseDC(SDL_Window, GL_hdc);
+ GL_hdc = NULL;
+ }
+ gl_active = 0;
+
+ WIN_GL_UnloadLibrary(this);
+#endif /* SDL_VIDEO_OPENGL */
+}
+
+#if SDL_VIDEO_OPENGL
+
+/* Make the current context active */
+int WIN_GL_MakeCurrent(_THIS)
+{
+ int retval;
+
+ retval = 0;
+ if ( ! this->gl_data->wglMakeCurrent(GL_hdc, GL_hrc) ) {
+ SDL_SetError("Unable to make GL context current");
+ retval = -1;
+ }
+ return(retval);
+}
+
+/* Get attribute data from wgl. */
+int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
+{
+ int retval;
+
+ if (attrib == SDL_GL_SWAP_CONTROL) {
+ if ( this->gl_data->wglGetSwapIntervalEXT ) {
+ *value = this->gl_data->wglGetSwapIntervalEXT();
+ return 0;
+ }
+ return -1;
+ }
+
+ if ( this->gl_data->wglGetPixelFormatAttribivARB ) {
+ int wgl_attrib;
+
+ switch(attrib) {
+ case SDL_GL_RED_SIZE:
+ wgl_attrib = WGL_RED_BITS_ARB;
+ break;
+ case SDL_GL_GREEN_SIZE:
+ wgl_attrib = WGL_GREEN_BITS_ARB;
+ break;
+ case SDL_GL_BLUE_SIZE:
+ wgl_attrib = WGL_BLUE_BITS_ARB;
+ break;
+ case SDL_GL_ALPHA_SIZE:
+ wgl_attrib = WGL_ALPHA_BITS_ARB;
+ break;
+ case SDL_GL_DOUBLEBUFFER:
+ wgl_attrib = WGL_DOUBLE_BUFFER_ARB;
+ break;
+ case SDL_GL_BUFFER_SIZE:
+ wgl_attrib = WGL_COLOR_BITS_ARB;
+ break;
+ case SDL_GL_DEPTH_SIZE:
+ wgl_attrib = WGL_DEPTH_BITS_ARB;
+ break;
+ case SDL_GL_STENCIL_SIZE:
+ wgl_attrib = WGL_STENCIL_BITS_ARB;
+ break;
+ case SDL_GL_ACCUM_RED_SIZE:
+ wgl_attrib = WGL_ACCUM_RED_BITS_ARB;
+ break;
+ case SDL_GL_ACCUM_GREEN_SIZE:
+ wgl_attrib = WGL_ACCUM_GREEN_BITS_ARB;
+ break;
+ case SDL_GL_ACCUM_BLUE_SIZE:
+ wgl_attrib = WGL_ACCUM_BLUE_BITS_ARB;
+ break;
+ case SDL_GL_ACCUM_ALPHA_SIZE:
+ wgl_attrib = WGL_ACCUM_ALPHA_BITS_ARB;
+ break;
+ case SDL_GL_STEREO:
+ wgl_attrib = WGL_STEREO_ARB;
+ break;
+ case SDL_GL_MULTISAMPLEBUFFERS:
+ wgl_attrib = WGL_SAMPLE_BUFFERS_ARB;
+ break;
+ case SDL_GL_MULTISAMPLESAMPLES:
+ wgl_attrib = WGL_SAMPLES_ARB;
+ break;
+ case SDL_GL_ACCELERATED_VISUAL:
+ wgl_attrib = WGL_ACCELERATION_ARB;
+ this->gl_data->wglGetPixelFormatAttribivARB(GL_hdc, pixel_format, 0, 1, &wgl_attrib, value);
+ if ( *value == WGL_NO_ACCELERATION_ARB ) {
+ *value = SDL_FALSE;
+ } else {
+ *value = SDL_TRUE;
+ }
+ return 0;
+ default:
+ return(-1);
+ }
+ this->gl_data->wglGetPixelFormatAttribivARB(GL_hdc, pixel_format, 0, 1, &wgl_attrib, value);
+
+ return 0;
+ }
+
+ retval = 0;
+ switch ( attrib ) {
+ case SDL_GL_RED_SIZE:
+ *value = GL_pfd.cRedBits;
+ break;
+ case SDL_GL_GREEN_SIZE:
+ *value = GL_pfd.cGreenBits;
+ break;
+ case SDL_GL_BLUE_SIZE:
+ *value = GL_pfd.cBlueBits;
+ break;
+ case SDL_GL_ALPHA_SIZE:
+ *value = GL_pfd.cAlphaBits;
+ break;
+ case SDL_GL_DOUBLEBUFFER:
+ if ( GL_pfd.dwFlags & PFD_DOUBLEBUFFER ) {
+ *value = 1;
+ } else {
+ *value = 0;
+ }
+ break;
+ case SDL_GL_BUFFER_SIZE:
+ *value = GL_pfd.cColorBits;
+ break;
+ case SDL_GL_DEPTH_SIZE:
+ *value = GL_pfd.cDepthBits;
+ break;
+ case SDL_GL_STENCIL_SIZE:
+ *value = GL_pfd.cStencilBits;
+ break;
+ case SDL_GL_ACCUM_RED_SIZE:
+ *value = GL_pfd.cAccumRedBits;
+ break;
+ case SDL_GL_ACCUM_GREEN_SIZE:
+ *value = GL_pfd.cAccumGreenBits;
+ break;
+ case SDL_GL_ACCUM_BLUE_SIZE:
+ *value = GL_pfd.cAccumBlueBits;
+ break;
+ case SDL_GL_ACCUM_ALPHA_SIZE:
+ *value = GL_pfd.cAccumAlphaBits;
+ break;
+ case SDL_GL_STEREO:
+ if ( GL_pfd.dwFlags & PFD_STEREO ) {
+ *value = 1;
+ } else {
+ *value = 0;
+ }
+ break;
+ case SDL_GL_MULTISAMPLEBUFFERS:
+ *value = 0;
+ break;
+ case SDL_GL_MULTISAMPLESAMPLES:
+ *value = 1;
+ break;
+ case SDL_GL_SWAP_CONTROL:
+ if ( this->gl_data->wglGetSwapIntervalEXT ) {
+ *value = this->gl_data->wglGetSwapIntervalEXT();
+ return 0;
+ } else {
+ return -1;
+ }
+ break;
+ default:
+ retval = -1;
+ break;
+ }
+ return retval;
+}
+
+void WIN_GL_SwapBuffers(_THIS)
+{
+ SwapBuffers(GL_hdc);
+}
+
+void WIN_GL_UnloadLibrary(_THIS)
+{
+ if ( this->gl_config.driver_loaded ) {
+ FreeLibrary((HMODULE)this->gl_config.dll_handle);
+
+ this->gl_data->wglGetProcAddress = NULL;
+ this->gl_data->wglCreateContext = NULL;
+ this->gl_data->wglDeleteContext = NULL;
+ this->gl_data->wglMakeCurrent = NULL;
+ this->gl_data->wglGetPixelFormatAttribivARB = NULL;
+ this->gl_data->wglSwapIntervalEXT = NULL;
+ this->gl_data->wglGetSwapIntervalEXT = NULL;
+
+ this->gl_config.dll_handle = NULL;
+ this->gl_config.driver_loaded = 0;
+ }
+}
+
+/* Passing a NULL path means load pointers from the application */
+int WIN_GL_LoadLibrary(_THIS, const char* path)
+{
+ HMODULE handle;
+
+ if ( gl_active ) {
+ SDL_SetError("OpenGL context already created");
+ return -1;
+ }
+
+ if ( path == NULL ) {
+ path = DEFAULT_GL_DRIVER_PATH;
+ }
+ handle = LoadLibrary(path);
+ if ( handle == NULL ) {
+ SDL_SetError("Could not load OpenGL library");
+ return -1;
+ }
+
+ /* Unload the old driver and reset the pointers */
+ WIN_GL_UnloadLibrary(this);
+
+ /* Load new function pointers */
+ SDL_memset(this->gl_data, 0, sizeof(*this->gl_data));
+ this->gl_data->wglGetProcAddress = (void * (WINAPI *)(const char *))
+ GetProcAddress(handle, "wglGetProcAddress");
+ this->gl_data->wglCreateContext = (HGLRC (WINAPI *)(HDC))
+ GetProcAddress(handle, "wglCreateContext");
+ this->gl_data->wglDeleteContext = (BOOL (WINAPI *)(HGLRC))
+ GetProcAddress(handle, "wglDeleteContext");
+ this->gl_data->wglMakeCurrent = (BOOL (WINAPI *)(HDC, HGLRC))
+ GetProcAddress(handle, "wglMakeCurrent");
+ this->gl_data->wglSwapIntervalEXT = (void (WINAPI *)(int))
+ GetProcAddress(handle, "wglSwapIntervalEXT");
+ this->gl_data->wglGetSwapIntervalEXT = (int (WINAPI *)(void))
+ GetProcAddress(handle, "wglGetSwapIntervalEXT");
+
+ if ( (this->gl_data->wglGetProcAddress == NULL) ||
+ (this->gl_data->wglCreateContext == NULL) ||
+ (this->gl_data->wglDeleteContext == NULL) ||
+ (this->gl_data->wglMakeCurrent == NULL) ) {
+ SDL_SetError("Could not retrieve OpenGL functions");
+ FreeLibrary(handle);
+ return -1;
+ }
+
+ this->gl_config.dll_handle = handle;
+ SDL_strlcpy(this->gl_config.driver_path, path, SDL_arraysize(this->gl_config.driver_path));
+ this->gl_config.driver_loaded = 1;
+ return 0;
+}
+
+void *WIN_GL_GetProcAddress(_THIS, const char* proc)
+{
+ void *func;
+
+ /* This is to pick up extensions */
+ func = this->gl_data->wglGetProcAddress(proc);
+ if ( ! func ) {
+ /* This is probably a normal GL function */
+ func = GetProcAddress(this->gl_config.dll_handle, proc);
+ }
+ return func;
+}
+
+#endif /* SDL_VIDEO_OPENGL */
diff --git a/distrib/sdl-1.2.15/src/video/wincommon/SDL_wingl_c.h b/distrib/sdl-1.2.15/src/video/wincommon/SDL_wingl_c.h
new file mode 100644
index 0000000..c3f2291
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/wincommon/SDL_wingl_c.h
@@ -0,0 +1,135 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* WGL implementation of SDL OpenGL support */
+
+#include "../SDL_sysvideo.h"
+
+
+struct SDL_PrivateGLData {
+ int gl_active; /* to stop switching drivers while we have a valid context */
+
+#if SDL_VIDEO_OPENGL
+ PIXELFORMATDESCRIPTOR GL_pfd;
+ HDC GL_hdc;
+ HGLRC GL_hrc;
+ int pixel_format;
+ int WGL_ARB_pixel_format;
+
+ void * (WINAPI *wglGetProcAddress)(const char *proc);
+
+ HGLRC (WINAPI *wglCreateContext)(HDC hdc);
+
+ BOOL (WINAPI *wglDeleteContext)(HGLRC hglrc);
+
+ BOOL (WINAPI *wglMakeCurrent)(HDC hdc, HGLRC hglrc);
+
+ BOOL (WINAPI *wglGetPixelFormatAttribivARB)(HDC hdc, int iPixelFormat,
+ int iLayerPlane,
+ UINT nAttributes,
+ const int *piAttributes,
+ int *piValues);
+ void (WINAPI *wglSwapIntervalEXT)(int interval);
+ int (WINAPI *wglGetSwapIntervalEXT)(void);
+#endif /* SDL_VIDEO_OPENGL */
+};
+
+/* Old variable names */
+#define gl_active (this->gl_data->gl_active)
+#define GL_pfd (this->gl_data->GL_pfd)
+#define GL_hdc (this->gl_data->GL_hdc)
+#define GL_hrc (this->gl_data->GL_hrc)
+#define pixel_format (this->gl_data->pixel_format)
+
+/* OpenGL functions */
+extern int WIN_GL_SetupWindow(_THIS);
+extern void WIN_GL_ShutDown(_THIS);
+#if SDL_VIDEO_OPENGL
+extern int WIN_GL_MakeCurrent(_THIS);
+extern int WIN_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
+extern void WIN_GL_SwapBuffers(_THIS);
+extern void WIN_GL_UnloadLibrary(_THIS);
+extern int WIN_GL_LoadLibrary(_THIS, const char* path);
+extern void *WIN_GL_GetProcAddress(_THIS, const char* proc);
+#endif
+
+#if SDL_VIDEO_OPENGL
+
+#ifndef WGL_ARB_pixel_format
+#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
+#define WGL_DRAW_TO_WINDOW_ARB 0x2001
+#define WGL_DRAW_TO_BITMAP_ARB 0x2002
+#define WGL_ACCELERATION_ARB 0x2003
+#define WGL_NEED_PALETTE_ARB 0x2004
+#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
+#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
+#define WGL_SWAP_METHOD_ARB 0x2007
+#define WGL_NUMBER_OVERLAYS_ARB 0x2008
+#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
+#define WGL_TRANSPARENT_ARB 0x200A
+#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
+#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
+#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
+#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
+#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
+#define WGL_SHARE_DEPTH_ARB 0x200C
+#define WGL_SHARE_STENCIL_ARB 0x200D
+#define WGL_SHARE_ACCUM_ARB 0x200E
+#define WGL_SUPPORT_GDI_ARB 0x200F
+#define WGL_SUPPORT_OPENGL_ARB 0x2010
+#define WGL_DOUBLE_BUFFER_ARB 0x2011
+#define WGL_STEREO_ARB 0x2012
+#define WGL_PIXEL_TYPE_ARB 0x2013
+#define WGL_COLOR_BITS_ARB 0x2014
+#define WGL_RED_BITS_ARB 0x2015
+#define WGL_RED_SHIFT_ARB 0x2016
+#define WGL_GREEN_BITS_ARB 0x2017
+#define WGL_GREEN_SHIFT_ARB 0x2018
+#define WGL_BLUE_BITS_ARB 0x2019
+#define WGL_BLUE_SHIFT_ARB 0x201A
+#define WGL_ALPHA_BITS_ARB 0x201B
+#define WGL_ALPHA_SHIFT_ARB 0x201C
+#define WGL_ACCUM_BITS_ARB 0x201D
+#define WGL_ACCUM_RED_BITS_ARB 0x201E
+#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
+#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
+#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
+#define WGL_DEPTH_BITS_ARB 0x2022
+#define WGL_STENCIL_BITS_ARB 0x2023
+#define WGL_AUX_BUFFERS_ARB 0x2024
+#define WGL_NO_ACCELERATION_ARB 0x2025
+#define WGL_GENERIC_ACCELERATION_ARB 0x2026
+#define WGL_FULL_ACCELERATION_ARB 0x2027
+#define WGL_SWAP_EXCHANGE_ARB 0x2028
+#define WGL_SWAP_COPY_ARB 0x2029
+#define WGL_SWAP_UNDEFINED_ARB 0x202A
+#define WGL_TYPE_RGBA_ARB 0x202B
+#define WGL_TYPE_COLORINDEX_ARB 0x202C
+#endif
+
+#ifndef WGL_ARB_multisample
+#define WGL_SAMPLE_BUFFERS_ARB 0x2041
+#define WGL_SAMPLES_ARB 0x2042
+#endif
+
+#endif
diff --git a/distrib/sdl-1.2.12/src/video/wincommon/wmmsg.h b/distrib/sdl-1.2.15/src/video/wincommon/wmmsg.h
index 175a8ce..175a8ce 100644
--- a/distrib/sdl-1.2.12/src/video/wincommon/wmmsg.h
+++ b/distrib/sdl-1.2.15/src/video/wincommon/wmmsg.h
diff --git a/distrib/sdl-1.2.15/src/video/windib/SDL_dibevents.c b/distrib/sdl-1.2.15/src/video/windib/SDL_dibevents.c
new file mode 100644
index 0000000..6cee54a
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/windib/SDL_dibevents.c
@@ -0,0 +1,704 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include "SDL_main.h"
+#include "SDL_events.h"
+#include "SDL_syswm.h"
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "../wincommon/SDL_lowvideo.h"
+#include "SDL_gapidibvideo.h"
+#include "SDL_vkeys.h"
+
+#ifdef SDL_VIDEO_DRIVER_GAPI
+#include "../gapi/SDL_gapivideo.h"
+#endif
+
+#ifdef SDL_VIDEO_DRIVER_WINDIB
+#include "SDL_dibvideo.h"
+#endif
+
+#ifndef WM_APP
+#define WM_APP 0x8000
+#endif
+
+#ifdef _WIN32_WCE
+#define NO_GETKEYBOARDSTATE
+#endif
+
+/* The translation table from a Microsoft VK keysym to a SDL keysym */
+static SDLKey VK_keymap[SDLK_LAST];
+static SDL_keysym *TranslateKey(WPARAM vkey, UINT scancode, SDL_keysym *keysym, int pressed);
+static SDLKey Arrows_keymap[4];
+
+/* Masks for processing the windows KEYDOWN and KEYUP messages */
+#define REPEATED_KEYMASK (1<<30)
+#define EXTENDED_KEYMASK (1<<24)
+
+/* DJM: If the user setup the window for us, we want to save his window proc,
+ and give him a chance to handle some messages. */
+#ifdef STRICT
+#define WNDPROCTYPE WNDPROC
+#else
+#define WNDPROCTYPE FARPROC
+#endif
+static WNDPROCTYPE userWindowProc = NULL;
+
+
+#ifdef SDL_VIDEO_DRIVER_GAPI
+
+WPARAM rotateKey(WPARAM key,int direction)
+{
+ if(direction ==0 ) return key;
+
+ switch (key) {
+ case 0x26: /* up */
+ return Arrows_keymap[(2 + direction) % 4];
+ case 0x27: /* right */
+ return Arrows_keymap[(1 + direction) % 4];
+ case 0x28: /* down */
+ return Arrows_keymap[direction % 4];
+ case 0x25: /* left */
+ return Arrows_keymap[(3 + direction) % 4];
+ }
+
+ return key;
+}
+
+static void GapiTransform(GapiInfo *gapiInfo, LONG *x, LONG *y)
+{
+ if(gapiInfo->hiresFix)
+ {
+ *x *= 2;
+ *y *= 2;
+ }
+
+ // 0 3 0
+ if((!gapiInfo->userOrientation && gapiInfo->systemOrientation && !gapiInfo->gapiOrientation) ||
+ // 3 0 3
+ (gapiInfo->userOrientation && !gapiInfo->systemOrientation && gapiInfo->gapiOrientation) ||
+ // 3 0 0
+ (gapiInfo->userOrientation && !gapiInfo->systemOrientation && !gapiInfo->gapiOrientation))
+ {
+ Sint16 temp = *x;
+ *x = SDL_VideoSurface->w - *y;
+ *y = temp;
+ }
+ else
+ // 0 0 0
+ if((!gapiInfo->userOrientation && !gapiInfo->systemOrientation && !gapiInfo->gapiOrientation) ||
+ // 0 0 3
+ (!gapiInfo->userOrientation && !gapiInfo->systemOrientation && gapiInfo->gapiOrientation))
+ {
+ // without changes
+ // *x = *x;
+ // *y = *y;
+ }
+ // default
+ else
+ {
+ // without changes
+ // *x = *x;
+ // *y = *y;
+ }
+}
+#endif
+
+
+/* The main Win32 event handler */
+LRESULT DIB_HandleMessage(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ extern int posted;
+
+ switch (msg) {
+ case WM_SYSKEYDOWN:
+ case WM_KEYDOWN: {
+ SDL_keysym keysym;
+
+#ifdef SDL_VIDEO_DRIVER_GAPI
+ if(this->hidden->gapiInfo)
+ {
+ // Drop GAPI artefacts
+ if (wParam == 0x84 || wParam == 0x5B)
+ return 0;
+
+ wParam = rotateKey(wParam, this->hidden->gapiInfo->coordinateTransform);
+ }
+#endif
+ /* Ignore repeated keys */
+ if ( lParam&REPEATED_KEYMASK ) {
+ return(0);
+ }
+ switch (wParam) {
+ case VK_CONTROL:
+ if ( lParam&EXTENDED_KEYMASK )
+ wParam = VK_RCONTROL;
+ else
+ wParam = VK_LCONTROL;
+ break;
+ case VK_SHIFT:
+ /* EXTENDED trick doesn't work here */
+ {
+ Uint8 *state = SDL_GetKeyState(NULL);
+ if (state[SDLK_LSHIFT] == SDL_RELEASED && (GetKeyState(VK_LSHIFT) & 0x8000)) {
+ wParam = VK_LSHIFT;
+ } else if (state[SDLK_RSHIFT] == SDL_RELEASED && (GetKeyState(VK_RSHIFT) & 0x8000)) {
+ wParam = VK_RSHIFT;
+ } else {
+ /* Win9x */
+ int sc = HIWORD(lParam) & 0xFF;
+
+ if (sc == 0x2A)
+ wParam = VK_LSHIFT;
+ else
+ if (sc == 0x36)
+ wParam = VK_RSHIFT;
+ else
+ wParam = VK_LSHIFT;
+ }
+ }
+ break;
+ case VK_MENU:
+ if ( lParam&EXTENDED_KEYMASK )
+ wParam = VK_RMENU;
+ else
+ wParam = VK_LMENU;
+ break;
+ }
+#ifdef NO_GETKEYBOARDSTATE
+ /* this is the workaround for the missing ToAscii() and ToUnicode() in CE (not necessary at KEYUP!) */
+ if ( SDL_TranslateUNICODE ) {
+ MSG m;
+
+ m.hwnd = hwnd;
+ m.message = msg;
+ m.wParam = wParam;
+ m.lParam = lParam;
+ m.time = 0;
+ if ( TranslateMessage(&m) && PeekMessage(&m, hwnd, 0, WM_USER, PM_NOREMOVE) && (m.message == WM_CHAR) ) {
+ GetMessage(&m, hwnd, 0, WM_USER);
+ wParam = m.wParam;
+ }
+ }
+#endif /* NO_GETKEYBOARDSTATE */
+ posted = SDL_PrivateKeyboard(SDL_PRESSED,
+ TranslateKey(wParam,HIWORD(lParam),&keysym,1));
+ }
+ return(0);
+
+ case WM_SYSKEYUP:
+ case WM_KEYUP: {
+ SDL_keysym keysym;
+
+#ifdef SDL_VIDEO_DRIVER_GAPI
+ if(this->hidden->gapiInfo)
+ {
+ // Drop GAPI artifacts
+ if (wParam == 0x84 || wParam == 0x5B)
+ return 0;
+
+ wParam = rotateKey(wParam, this->hidden->gapiInfo->coordinateTransform);
+ }
+#endif
+
+ switch (wParam) {
+ case VK_CONTROL:
+ if ( lParam&EXTENDED_KEYMASK )
+ wParam = VK_RCONTROL;
+ else
+ wParam = VK_LCONTROL;
+ break;
+ case VK_SHIFT:
+ /* EXTENDED trick doesn't work here */
+ {
+ Uint8 *state = SDL_GetKeyState(NULL);
+ if (state[SDLK_LSHIFT] == SDL_PRESSED && !(GetKeyState(VK_LSHIFT) & 0x8000)) {
+ wParam = VK_LSHIFT;
+ } else if (state[SDLK_RSHIFT] == SDL_PRESSED && !(GetKeyState(VK_RSHIFT) & 0x8000)) {
+ wParam = VK_RSHIFT;
+ } else {
+ /* Win9x */
+ int sc = HIWORD(lParam) & 0xFF;
+
+ if (sc == 0x2A)
+ wParam = VK_LSHIFT;
+ else
+ if (sc == 0x36)
+ wParam = VK_RSHIFT;
+ else
+ wParam = VK_LSHIFT;
+ }
+ }
+ break;
+ case VK_MENU:
+ if ( lParam&EXTENDED_KEYMASK )
+ wParam = VK_RMENU;
+ else
+ wParam = VK_LMENU;
+ break;
+ }
+ /* Windows only reports keyup for print screen */
+ if ( wParam == VK_SNAPSHOT && SDL_GetKeyState(NULL)[SDLK_PRINT] == SDL_RELEASED ) {
+ posted = SDL_PrivateKeyboard(SDL_PRESSED,
+ TranslateKey(wParam,HIWORD(lParam),&keysym,1));
+ }
+ posted = SDL_PrivateKeyboard(SDL_RELEASED,
+ TranslateKey(wParam,HIWORD(lParam),&keysym,0));
+ }
+ return(0);
+#if defined(SC_SCREENSAVE) && defined(SC_MONITORPOWER)
+ case WM_SYSCOMMAND: {
+ const DWORD val = (DWORD) (wParam & 0xFFF0);
+ if ((val == SC_SCREENSAVE) || (val == SC_MONITORPOWER)) {
+ if (this->hidden->dibInfo && !allow_screensaver) {
+ /* Note that this doesn't stop anything on Vista
+ if the screensaver has a password. */
+ return(0);
+ }
+ }
+ }
+ /* Fall through to default processing */
+#endif /* SC_SCREENSAVE && SC_MONITORPOWER */
+
+ default: {
+ /* Only post the event if we're watching for it */
+ if ( SDL_ProcessEvents[SDL_SYSWMEVENT] == SDL_ENABLE ) {
+ SDL_SysWMmsg wmmsg;
+
+ SDL_VERSION(&wmmsg.version);
+ wmmsg.hwnd = hwnd;
+ wmmsg.msg = msg;
+ wmmsg.wParam = wParam;
+ wmmsg.lParam = lParam;
+ posted = SDL_PrivateSysWMEvent(&wmmsg);
+
+ /* DJM: If the user isn't watching for private
+ messages in her SDL event loop, then pass it
+ along to any win32 specific window proc.
+ */
+ } else if (userWindowProc) {
+ return CallWindowProc(userWindowProc, hwnd, msg, wParam, lParam);
+ }
+ }
+ break;
+ }
+ return(DefWindowProc(hwnd, msg, wParam, lParam));
+}
+
+#ifdef _WIN32_WCE
+static BOOL GetLastStylusPos(POINT* ptLast)
+{
+ BOOL bResult = FALSE;
+ UINT nRet;
+ GetMouseMovePoints(ptLast, 1, &nRet);
+ if ( nRet == 1 ) {
+ ptLast->x /= 4;
+ ptLast->y /= 4;
+ bResult = TRUE;
+ }
+ return bResult;
+}
+#endif
+
+static void DIB_GenerateMouseMotionEvent(_THIS)
+{
+ extern int mouse_relative;
+ extern int posted;
+
+ POINT mouse;
+#ifdef _WIN32_WCE
+ if ( !GetCursorPos(&mouse) && !GetLastStylusPos(&mouse) ) return;
+#else
+ if ( !GetCursorPos(&mouse) ) return;
+#endif
+
+ if ( mouse_relative ) {
+ POINT center;
+ center.x = (SDL_VideoSurface->w/2);
+ center.y = (SDL_VideoSurface->h/2);
+ ClientToScreen(SDL_Window, &center);
+
+ mouse.x -= center.x;
+ mouse.y -= center.y;
+ if ( mouse.x || mouse.y ) {
+ SetCursorPos(center.x, center.y);
+ posted = SDL_PrivateMouseMotion(0, 1, (Sint16)mouse.x, (Sint16)mouse.y);
+ }
+ } else {
+ ScreenToClient(SDL_Window, &mouse);
+#ifdef SDL_VIDEO_DRIVER_GAPI
+ if (SDL_VideoSurface && this->hidden->gapiInfo)
+ GapiTransform(this->hidden->gapiInfo, &mouse.x, &mouse.y);
+#endif
+ posted = SDL_PrivateMouseMotion(0, 0, (Sint16)mouse.x, (Sint16)mouse.y);
+ }
+}
+
+void DIB_PumpEvents(_THIS)
+{
+ MSG msg;
+
+ while ( PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) ) {
+ if ( GetMessage(&msg, NULL, 0, 0) > 0 ) {
+ DispatchMessage(&msg);
+ }
+ }
+
+ if ( SDL_GetAppState() & SDL_APPMOUSEFOCUS ) {
+ DIB_GenerateMouseMotionEvent( this );
+ }
+}
+
+static HKL hLayoutUS = NULL;
+
+void DIB_InitOSKeymap(_THIS)
+{
+ int i;
+#ifndef _WIN32_WCE
+ char current_layout[KL_NAMELENGTH];
+
+ GetKeyboardLayoutName(current_layout);
+ //printf("Initial Keyboard Layout Name: '%s'\n", current_layout);
+
+ hLayoutUS = LoadKeyboardLayout("00000409", KLF_NOTELLSHELL);
+
+ if (!hLayoutUS) {
+ //printf("Failed to load US keyboard layout. Using current.\n");
+ hLayoutUS = GetKeyboardLayout(0);
+ }
+ LoadKeyboardLayout(current_layout, KLF_ACTIVATE);
+#else
+#if _WIN32_WCE >=420
+ TCHAR current_layout[KL_NAMELENGTH];
+
+ GetKeyboardLayoutName(current_layout);
+ //printf("Initial Keyboard Layout Name: '%s'\n", current_layout);
+
+ hLayoutUS = LoadKeyboardLayout(L"00000409", 0);
+
+ if (!hLayoutUS) {
+ //printf("Failed to load US keyboard layout. Using current.\n");
+ hLayoutUS = GetKeyboardLayout(0);
+ }
+ LoadKeyboardLayout(current_layout, 0);
+#endif // _WIN32_WCE >=420
+#endif
+ /* Map the VK keysyms */
+ for ( i=0; i<SDL_arraysize(VK_keymap); ++i )
+ VK_keymap[i] = SDLK_UNKNOWN;
+
+ VK_keymap[VK_BACK] = SDLK_BACKSPACE;
+ VK_keymap[VK_TAB] = SDLK_TAB;
+ VK_keymap[VK_CLEAR] = SDLK_CLEAR;
+ VK_keymap[VK_RETURN] = SDLK_RETURN;
+ VK_keymap[VK_PAUSE] = SDLK_PAUSE;
+ VK_keymap[VK_ESCAPE] = SDLK_ESCAPE;
+ VK_keymap[VK_SPACE] = SDLK_SPACE;
+ VK_keymap[VK_APOSTROPHE] = SDLK_QUOTE;
+ VK_keymap[VK_COMMA] = SDLK_COMMA;
+ VK_keymap[VK_MINUS] = SDLK_MINUS;
+ VK_keymap[VK_PERIOD] = SDLK_PERIOD;
+ VK_keymap[VK_SLASH] = SDLK_SLASH;
+ VK_keymap[VK_0] = SDLK_0;
+ VK_keymap[VK_1] = SDLK_1;
+ VK_keymap[VK_2] = SDLK_2;
+ VK_keymap[VK_3] = SDLK_3;
+ VK_keymap[VK_4] = SDLK_4;
+ VK_keymap[VK_5] = SDLK_5;
+ VK_keymap[VK_6] = SDLK_6;
+ VK_keymap[VK_7] = SDLK_7;
+ VK_keymap[VK_8] = SDLK_8;
+ VK_keymap[VK_9] = SDLK_9;
+ VK_keymap[VK_SEMICOLON] = SDLK_SEMICOLON;
+ VK_keymap[VK_EQUALS] = SDLK_EQUALS;
+ VK_keymap[VK_LBRACKET] = SDLK_LEFTBRACKET;
+ VK_keymap[VK_BACKSLASH] = SDLK_BACKSLASH;
+ VK_keymap[VK_OEM_102] = SDLK_LESS;
+ VK_keymap[VK_RBRACKET] = SDLK_RIGHTBRACKET;
+ VK_keymap[VK_GRAVE] = SDLK_BACKQUOTE;
+ VK_keymap[VK_BACKTICK] = SDLK_BACKQUOTE;
+ VK_keymap[VK_A] = SDLK_a;
+ VK_keymap[VK_B] = SDLK_b;
+ VK_keymap[VK_C] = SDLK_c;
+ VK_keymap[VK_D] = SDLK_d;
+ VK_keymap[VK_E] = SDLK_e;
+ VK_keymap[VK_F] = SDLK_f;
+ VK_keymap[VK_G] = SDLK_g;
+ VK_keymap[VK_H] = SDLK_h;
+ VK_keymap[VK_I] = SDLK_i;
+ VK_keymap[VK_J] = SDLK_j;
+ VK_keymap[VK_K] = SDLK_k;
+ VK_keymap[VK_L] = SDLK_l;
+ VK_keymap[VK_M] = SDLK_m;
+ VK_keymap[VK_N] = SDLK_n;
+ VK_keymap[VK_O] = SDLK_o;
+ VK_keymap[VK_P] = SDLK_p;
+ VK_keymap[VK_Q] = SDLK_q;
+ VK_keymap[VK_R] = SDLK_r;
+ VK_keymap[VK_S] = SDLK_s;
+ VK_keymap[VK_T] = SDLK_t;
+ VK_keymap[VK_U] = SDLK_u;
+ VK_keymap[VK_V] = SDLK_v;
+ VK_keymap[VK_W] = SDLK_w;
+ VK_keymap[VK_X] = SDLK_x;
+ VK_keymap[VK_Y] = SDLK_y;
+ VK_keymap[VK_Z] = SDLK_z;
+ VK_keymap[VK_DELETE] = SDLK_DELETE;
+
+ VK_keymap[VK_NUMPAD0] = SDLK_KP0;
+ VK_keymap[VK_NUMPAD1] = SDLK_KP1;
+ VK_keymap[VK_NUMPAD2] = SDLK_KP2;
+ VK_keymap[VK_NUMPAD3] = SDLK_KP3;
+ VK_keymap[VK_NUMPAD4] = SDLK_KP4;
+ VK_keymap[VK_NUMPAD5] = SDLK_KP5;
+ VK_keymap[VK_NUMPAD6] = SDLK_KP6;
+ VK_keymap[VK_NUMPAD7] = SDLK_KP7;
+ VK_keymap[VK_NUMPAD8] = SDLK_KP8;
+ VK_keymap[VK_NUMPAD9] = SDLK_KP9;
+ VK_keymap[VK_DECIMAL] = SDLK_KP_PERIOD;
+ VK_keymap[VK_DIVIDE] = SDLK_KP_DIVIDE;
+ VK_keymap[VK_MULTIPLY] = SDLK_KP_MULTIPLY;
+ VK_keymap[VK_SUBTRACT] = SDLK_KP_MINUS;
+ VK_keymap[VK_ADD] = SDLK_KP_PLUS;
+
+ VK_keymap[VK_UP] = SDLK_UP;
+ VK_keymap[VK_DOWN] = SDLK_DOWN;
+ VK_keymap[VK_RIGHT] = SDLK_RIGHT;
+ VK_keymap[VK_LEFT] = SDLK_LEFT;
+ VK_keymap[VK_INSERT] = SDLK_INSERT;
+ VK_keymap[VK_HOME] = SDLK_HOME;
+ VK_keymap[VK_END] = SDLK_END;
+ VK_keymap[VK_PRIOR] = SDLK_PAGEUP;
+ VK_keymap[VK_NEXT] = SDLK_PAGEDOWN;
+
+ VK_keymap[VK_F1] = SDLK_F1;
+ VK_keymap[VK_F2] = SDLK_F2;
+ VK_keymap[VK_F3] = SDLK_F3;
+ VK_keymap[VK_F4] = SDLK_F4;
+ VK_keymap[VK_F5] = SDLK_F5;
+ VK_keymap[VK_F6] = SDLK_F6;
+ VK_keymap[VK_F7] = SDLK_F7;
+ VK_keymap[VK_F8] = SDLK_F8;
+ VK_keymap[VK_F9] = SDLK_F9;
+ VK_keymap[VK_F10] = SDLK_F10;
+ VK_keymap[VK_F11] = SDLK_F11;
+ VK_keymap[VK_F12] = SDLK_F12;
+ VK_keymap[VK_F13] = SDLK_F13;
+ VK_keymap[VK_F14] = SDLK_F14;
+ VK_keymap[VK_F15] = SDLK_F15;
+
+ VK_keymap[VK_NUMLOCK] = SDLK_NUMLOCK;
+ VK_keymap[VK_CAPITAL] = SDLK_CAPSLOCK;
+ VK_keymap[VK_SCROLL] = SDLK_SCROLLOCK;
+ VK_keymap[VK_RSHIFT] = SDLK_RSHIFT;
+ VK_keymap[VK_LSHIFT] = SDLK_LSHIFT;
+ VK_keymap[VK_RCONTROL] = SDLK_RCTRL;
+ VK_keymap[VK_LCONTROL] = SDLK_LCTRL;
+ VK_keymap[VK_RMENU] = SDLK_RALT;
+ VK_keymap[VK_LMENU] = SDLK_LALT;
+ VK_keymap[VK_RWIN] = SDLK_RSUPER;
+ VK_keymap[VK_LWIN] = SDLK_LSUPER;
+
+ VK_keymap[VK_HELP] = SDLK_HELP;
+#ifdef VK_PRINT
+ VK_keymap[VK_PRINT] = SDLK_PRINT;
+#endif
+ VK_keymap[VK_SNAPSHOT] = SDLK_PRINT;
+ VK_keymap[VK_CANCEL] = SDLK_BREAK;
+ VK_keymap[VK_APPS] = SDLK_MENU;
+
+ Arrows_keymap[3] = 0x25;
+ Arrows_keymap[2] = 0x26;
+ Arrows_keymap[1] = 0x27;
+ Arrows_keymap[0] = 0x28;
+}
+
+#define EXTKEYPAD(keypad) ((scancode & 0x100)?(mvke):(keypad))
+
+static int SDL_MapVirtualKey(int scancode, int vkey)
+{
+#ifndef _WIN32_WCE
+ int mvke = MapVirtualKeyEx(scancode & 0xFF, 1, hLayoutUS);
+#else
+ int mvke = MapVirtualKey(scancode & 0xFF, 1);
+#endif
+
+ switch(vkey) {
+ /* These are always correct */
+ case VK_DIVIDE:
+ case VK_MULTIPLY:
+ case VK_SUBTRACT:
+ case VK_ADD:
+ case VK_LWIN:
+ case VK_RWIN:
+ case VK_APPS:
+ /* These are already handled */
+ case VK_LCONTROL:
+ case VK_RCONTROL:
+ case VK_LSHIFT:
+ case VK_RSHIFT:
+ case VK_LMENU:
+ case VK_RMENU:
+ case VK_SNAPSHOT:
+ case VK_PAUSE:
+ return vkey;
+ }
+ switch(mvke) {
+ /* Distinguish between keypad and extended keys */
+ case VK_INSERT: return EXTKEYPAD(VK_NUMPAD0);
+ case VK_DELETE: return EXTKEYPAD(VK_DECIMAL);
+ case VK_END: return EXTKEYPAD(VK_NUMPAD1);
+ case VK_DOWN: return EXTKEYPAD(VK_NUMPAD2);
+ case VK_NEXT: return EXTKEYPAD(VK_NUMPAD3);
+ case VK_LEFT: return EXTKEYPAD(VK_NUMPAD4);
+ case VK_CLEAR: return EXTKEYPAD(VK_NUMPAD5);
+ case VK_RIGHT: return EXTKEYPAD(VK_NUMPAD6);
+ case VK_HOME: return EXTKEYPAD(VK_NUMPAD7);
+ case VK_UP: return EXTKEYPAD(VK_NUMPAD8);
+ case VK_PRIOR: return EXTKEYPAD(VK_NUMPAD9);
+ }
+ return mvke?mvke:vkey;
+}
+
+static SDL_keysym *TranslateKey(WPARAM vkey, UINT scancode, SDL_keysym *keysym, int pressed)
+{
+ /* Set the keysym information */
+ keysym->scancode = (unsigned char) scancode;
+ keysym->mod = KMOD_NONE;
+ keysym->unicode = 0;
+
+ if ((vkey == VK_RETURN) && (scancode & 0x100)) {
+ /* No VK_ code for the keypad enter key */
+ keysym->sym = SDLK_KP_ENTER;
+ }
+ else {
+ keysym->sym = VK_keymap[SDL_MapVirtualKey(scancode, vkey)];
+ }
+
+ if ( pressed && SDL_TranslateUNICODE ) {
+#ifdef NO_GETKEYBOARDSTATE
+ /* Uh oh, better hope the vkey is close enough.. */
+ if((keysym->sym == vkey) || (vkey > 0x7f))
+ keysym->unicode = vkey;
+#else
+ BYTE keystate[256];
+ Uint16 wchars[2];
+
+ GetKeyboardState(keystate);
+ /* Numlock isn't taken into account in ToUnicode,
+ * so we handle it as a special case here */
+ if ((keystate[VK_NUMLOCK] & 1) && vkey >= VK_NUMPAD0 && vkey <= VK_NUMPAD9)
+ {
+ keysym->unicode = vkey - VK_NUMPAD0 + '0';
+ }
+ else if (SDL_ToUnicode((UINT)vkey, scancode, keystate, wchars, sizeof(wchars)/sizeof(wchars[0]), 0) > 0)
+ {
+ keysym->unicode = wchars[0];
+ }
+#endif /* NO_GETKEYBOARDSTATE */
+ }
+
+#if 0
+ {
+ HKL hLayoutCurrent = GetKeyboardLayout(0);
+ int sc = scancode & 0xFF;
+
+ printf("SYM:%d, VK:0x%02X, SC:0x%04X, US:(1:0x%02X, 3:0x%02X), "
+ "Current:(1:0x%02X, 3:0x%02X)\n",
+ keysym->sym, vkey, scancode,
+ MapVirtualKeyEx(sc, 1, hLayoutUS),
+ MapVirtualKeyEx(sc, 3, hLayoutUS),
+ MapVirtualKeyEx(sc, 1, hLayoutCurrent),
+ MapVirtualKeyEx(sc, 3, hLayoutCurrent)
+ );
+ }
+#endif
+ return(keysym);
+}
+
+int DIB_CreateWindow(_THIS)
+{
+ char *windowid;
+
+ SDL_RegisterApp(NULL, 0, 0);
+
+ windowid = SDL_getenv("SDL_WINDOWID");
+ SDL_windowid = (windowid != NULL);
+ if ( SDL_windowid ) {
+#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
+ /* wince 2.1 does not have strtol */
+ wchar_t *windowid_t = SDL_malloc((SDL_strlen(windowid) + 1) * sizeof(wchar_t));
+ MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, windowid, -1, windowid_t, SDL_strlen(windowid) + 1);
+ SDL_Window = (HWND)wcstol(windowid_t, NULL, 0);
+ SDL_free(windowid_t);
+#else
+ SDL_Window = (HWND)((size_t)SDL_strtoull(windowid, NULL, 0));
+#endif
+ if ( SDL_Window == NULL ) {
+ SDL_SetError("Couldn't get user specified window");
+ return(-1);
+ }
+
+ /* DJM: we want all event's for the user specified
+ window to be handled by SDL.
+ */
+ userWindowProc = (WNDPROCTYPE)GetWindowLongPtr(SDL_Window, GWLP_WNDPROC);
+ SetWindowLongPtr(SDL_Window, GWLP_WNDPROC, (LONG_PTR)WinMessage);
+ } else {
+ SDL_Window = CreateWindow(SDL_Appname, SDL_Appname,
+ (WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX),
+ CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, NULL, NULL, SDL_Instance, NULL);
+ if ( SDL_Window == NULL ) {
+ SDL_SetError("Couldn't create window");
+ return(-1);
+ }
+ ShowWindow(SDL_Window, SW_HIDE);
+ }
+
+ /* JC 14 Mar 2006
+ Flush the message loop or this can cause big problems later
+ Especially if the user decides to use dialog boxes or assert()!
+ */
+ WIN_FlushMessageQueue();
+
+ return(0);
+}
+
+void DIB_DestroyWindow(_THIS)
+{
+ if ( SDL_windowid ) {
+ SetWindowLongPtr(SDL_Window, GWLP_WNDPROC, (LONG_PTR)userWindowProc);
+ } else {
+ DestroyWindow(SDL_Window);
+ }
+ SDL_UnregisterApp();
+
+ /* JC 14 Mar 2006
+ Flush the message loop or this can cause big problems later
+ Especially if the user decides to use dialog boxes or assert()!
+ */
+ WIN_FlushMessageQueue();
+}
diff --git a/distrib/sdl-1.2.15/src/video/windib/SDL_dibevents_c.h b/distrib/sdl-1.2.15/src/video/windib/SDL_dibevents_c.h
new file mode 100644
index 0000000..236aa68
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/windib/SDL_dibevents_c.h
@@ -0,0 +1,35 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "../wincommon/SDL_lowvideo.h"
+
+/* Variables and functions exported by SDL_dibevents.c to other parts
+ of the native video subsystem (SDL_dibvideo.c)
+*/
+extern LONG
+ DIB_HandleMessage(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+extern int DIB_CreateWindow(_THIS);
+extern void DIB_DestroyWindow(_THIS);
+
+extern void DIB_PumpEvents(_THIS);
+extern void DIB_InitOSKeymap(_THIS);
diff --git a/distrib/sdl-1.2.15/src/video/windib/SDL_dibvideo.c b/distrib/sdl-1.2.15/src/video/windib/SDL_dibvideo.c
new file mode 100644
index 0000000..9f1ffff
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/windib/SDL_dibvideo.c
@@ -0,0 +1,1499 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+/* Not yet in the mingw32 cross-compile headers */
+#ifndef CDS_FULLSCREEN
+#define CDS_FULLSCREEN 4
+#endif
+
+#include "SDL_syswm.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_gapidibvideo.h"
+#include "SDL_dibvideo.h"
+#include "../wincommon/SDL_syswm_c.h"
+#include "../wincommon/SDL_sysmouse_c.h"
+#include "SDL_dibevents_c.h"
+#include "../wincommon/SDL_wingl_c.h"
+
+#ifdef _WIN32_WCE
+
+#ifndef DM_DISPLAYORIENTATION
+#define DM_DISPLAYORIENTATION 0x00800000L
+#endif
+#ifndef DM_DISPLAYQUERYORIENTATION
+#define DM_DISPLAYQUERYORIENTATION 0x01000000L
+#endif
+#ifndef DMDO_0
+#define DMDO_0 0
+#endif
+#ifndef DMDO_90
+#define DMDO_90 1
+#endif
+#ifndef DMDO_180
+#define DMDO_180 2
+#endif
+#ifndef DMDO_270
+#define DMDO_270 4
+#endif
+
+#define NO_GETDIBITS
+#define NO_GAMMA_SUPPORT
+ #if _WIN32_WCE < 420
+ #define NO_CHANGEDISPLAYSETTINGS
+ #else
+ #define ChangeDisplaySettings(lpDevMode, dwFlags) ChangeDisplaySettingsEx(NULL, (lpDevMode), 0, (dwFlags), 0)
+ #endif
+#endif
+#ifndef WS_MAXIMIZE
+#define WS_MAXIMIZE 0
+#endif
+#ifndef WS_THICKFRAME
+#define WS_THICKFRAME 0
+#endif
+#ifndef SWP_NOCOPYBITS
+#define SWP_NOCOPYBITS 0
+#endif
+#ifndef PC_NOCOLLAPSE
+#define PC_NOCOLLAPSE 0
+#endif
+
+#ifdef _WIN32_WCE
+// defined and used in SDL_sysevents.c
+extern HINSTANCE aygshell;
+#endif
+
+/* Initialization/Query functions */
+static int DIB_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **DIB_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+SDL_Surface *DIB_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int DIB_SetColors(_THIS, int firstcolor, int ncolors,
+ SDL_Color *colors);
+static void DIB_CheckGamma(_THIS);
+void DIB_SwapGamma(_THIS);
+void DIB_QuitGamma(_THIS);
+int DIB_SetGammaRamp(_THIS, Uint16 *ramp);
+int DIB_GetGammaRamp(_THIS, Uint16 *ramp);
+static void DIB_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int DIB_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int DIB_LockHWSurface(_THIS, SDL_Surface *surface);
+static void DIB_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void DIB_FreeHWSurface(_THIS, SDL_Surface *surface);
+
+/* Windows message handling functions */
+static void DIB_GrabStaticColors(HWND window);
+static void DIB_ReleaseStaticColors(HWND window);
+static void DIB_Activate(_THIS, BOOL active, BOOL minimized);
+static void DIB_RealizePalette(_THIS);
+static void DIB_PaletteChanged(_THIS, HWND window);
+static void DIB_WinPAINT(_THIS, HDC hdc);
+
+static void DIB_GetWinPos(_THIS, int* px, int *py);
+static void DIB_SetWinPos(_THIS, int x, int y);
+static int DIB_IsWinVisible(_THIS, int recenter);
+static int DIB_GetMonitorDPI(_THIS, int* xDpi, int *yDpi);
+static int DIB_GetMonitorRect(_THIS, SDL_Rect* rect);
+
+/* helper fn */
+static int DIB_SussScreenDepth();
+
+/* DIB driver bootstrap functions */
+
+static int DIB_Available(void)
+{
+ return(1);
+}
+
+static void DIB_DeleteDevice(SDL_VideoDevice *device)
+{
+ if ( device ) {
+ if ( device->hidden ) {
+ if ( device->hidden->dibInfo ) {
+ SDL_free( device->hidden->dibInfo );
+ }
+ SDL_free(device->hidden);
+ }
+ if ( device->gl_data ) {
+ SDL_free(device->gl_data);
+ }
+ SDL_free(device);
+ }
+}
+
+static SDL_VideoDevice *DIB_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device;
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *device->hidden));
+ if(device->hidden){
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+ device->hidden->dibInfo = (DibInfo *)SDL_malloc((sizeof(DibInfo)));
+ if(device->hidden->dibInfo == NULL)
+ {
+ SDL_free(device->hidden);
+ device->hidden = NULL;
+ }
+ }
+
+ device->gl_data = (struct SDL_PrivateGLData *)
+ SDL_malloc((sizeof *device->gl_data));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ||
+ (device->gl_data == NULL) ) {
+ SDL_OutOfMemory();
+ DIB_DeleteDevice(device);
+ return(NULL);
+ }
+ SDL_memset(device->hidden->dibInfo, 0, (sizeof *device->hidden->dibInfo));
+ SDL_memset(device->gl_data, 0, (sizeof *device->gl_data));
+
+ /* Set the function pointers */
+ device->VideoInit = DIB_VideoInit;
+ device->ListModes = DIB_ListModes;
+ device->SetVideoMode = DIB_SetVideoMode;
+ device->UpdateMouse = WIN_UpdateMouse;
+ device->SetColors = DIB_SetColors;
+ device->UpdateRects = NULL;
+ device->VideoQuit = DIB_VideoQuit;
+ device->AllocHWSurface = DIB_AllocHWSurface;
+ device->CheckHWBlit = NULL;
+ device->FillHWRect = NULL;
+ device->SetHWColorKey = NULL;
+ device->SetHWAlpha = NULL;
+ device->LockHWSurface = DIB_LockHWSurface;
+ device->UnlockHWSurface = DIB_UnlockHWSurface;
+ device->FlipHWSurface = NULL;
+ device->FreeHWSurface = DIB_FreeHWSurface;
+ device->SetGammaRamp = DIB_SetGammaRamp;
+ device->GetGammaRamp = DIB_GetGammaRamp;
+#if SDL_VIDEO_OPENGL
+ device->GL_LoadLibrary = WIN_GL_LoadLibrary;
+ device->GL_GetProcAddress = WIN_GL_GetProcAddress;
+ device->GL_GetAttribute = WIN_GL_GetAttribute;
+ device->GL_MakeCurrent = WIN_GL_MakeCurrent;
+ device->GL_SwapBuffers = WIN_GL_SwapBuffers;
+#endif
+ device->SetCaption = WIN_SetWMCaption;
+ device->SetIcon = WIN_SetWMIcon;
+ device->IconifyWindow = WIN_IconifyWindow;
+ device->GrabInput = WIN_GrabInput;
+ device->GetWMInfo = WIN_GetWMInfo;
+ device->FreeWMCursor = WIN_FreeWMCursor;
+ device->CreateWMCursor = WIN_CreateWMCursor;
+ device->ShowWMCursor = WIN_ShowWMCursor;
+ device->WarpWMCursor = WIN_WarpWMCursor;
+ device->CheckMouseMode = WIN_CheckMouseMode;
+ device->InitOSKeymap = DIB_InitOSKeymap;
+ device->PumpEvents = DIB_PumpEvents;
+
+ device->GetWindowPos = DIB_GetWinPos;
+ device->SetWindowPos = DIB_SetWinPos;
+ device->IsWindowVisible = DIB_IsWinVisible;
+ device->GetMonitorDPI = DIB_GetMonitorDPI;
+ device->GetMonitorRect = DIB_GetMonitorRect;
+
+ /* Set up the windows message handling functions */
+ WIN_Activate = DIB_Activate;
+ WIN_RealizePalette = DIB_RealizePalette;
+ WIN_PaletteChanged = DIB_PaletteChanged;
+ WIN_WinPAINT = DIB_WinPAINT;
+ HandleMessage = DIB_HandleMessage;
+
+ device->free = DIB_DeleteDevice;
+
+ /* We're finally ready */
+ return device;
+}
+
+VideoBootStrap WINDIB_bootstrap = {
+ "windib", "Win95/98/NT/2000/CE GDI",
+ DIB_Available, DIB_CreateDevice
+};
+
+static int cmpmodes(const void *va, const void *vb)
+{
+ SDL_Rect *a = *(SDL_Rect **)va;
+ SDL_Rect *b = *(SDL_Rect **)vb;
+ if ( a->w == b->w )
+ return b->h - a->h;
+ else
+ return b->w - a->w;
+}
+
+static int DIB_AddMode(_THIS, int bpp, int w, int h)
+{
+ SDL_Rect *mode;
+ int i, index;
+ int next_mode;
+
+ /* Check to see if we already have this mode */
+ if ( bpp < 8 || bpp > 32 ) { /* Not supported */
+ return(0);
+ }
+ index = ((bpp+7)/8)-1;
+ for ( i=0; i<SDL_nummodes[index]; ++i ) {
+ mode = SDL_modelist[index][i];
+ if ( (mode->w == w) && (mode->h == h) ) {
+ return(0);
+ }
+ }
+
+ /* Set up the new video mode rectangle */
+ mode = (SDL_Rect *)SDL_malloc(sizeof *mode);
+ if ( mode == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ mode->x = 0;
+ mode->y = 0;
+ mode->w = w;
+ mode->h = h;
+
+ /* Allocate the new list of modes, and fill in the new mode */
+ next_mode = SDL_nummodes[index];
+ SDL_modelist[index] = (SDL_Rect **)
+ SDL_realloc(SDL_modelist[index], (1+next_mode+1)*sizeof(SDL_Rect *));
+ if ( SDL_modelist[index] == NULL ) {
+ SDL_OutOfMemory();
+ SDL_nummodes[index] = 0;
+ SDL_free(mode);
+ return(-1);
+ }
+ SDL_modelist[index][next_mode] = mode;
+ SDL_modelist[index][next_mode+1] = NULL;
+ SDL_nummodes[index]++;
+
+ return(0);
+}
+
+static void DIB_CreatePalette(_THIS, int bpp)
+{
+/* RJR: March 28, 2000
+ moved palette creation here from "DIB_VideoInit" */
+
+ LOGPALETTE *palette;
+ HDC hdc;
+ int ncolors;
+
+ ncolors = (1 << bpp);
+ palette = (LOGPALETTE *)SDL_malloc(sizeof(*palette)+
+ ncolors*sizeof(PALETTEENTRY));
+ palette->palVersion = 0x300;
+ palette->palNumEntries = ncolors;
+ hdc = GetDC(SDL_Window);
+ GetSystemPaletteEntries(hdc, 0, ncolors, palette->palPalEntry);
+ ReleaseDC(SDL_Window, hdc);
+ screen_pal = CreatePalette(palette);
+ screen_logpal = palette;
+}
+
+int DIB_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ const char *env = NULL;
+#ifndef NO_CHANGEDISPLAYSETTINGS
+ int i;
+ DEVMODE settings;
+#endif
+
+ /* Create the window */
+ if ( DIB_CreateWindow(this) < 0 ) {
+ return(-1);
+ }
+
+#if !SDL_AUDIO_DISABLED
+ DX5_SoundFocus(SDL_Window);
+#endif
+
+ /* Determine the screen depth */
+ vformat->BitsPerPixel = DIB_SussScreenDepth();
+ switch (vformat->BitsPerPixel) {
+ case 15:
+ vformat->Rmask = 0x00007c00;
+ vformat->Gmask = 0x000003e0;
+ vformat->Bmask = 0x0000001f;
+ vformat->BitsPerPixel = 16;
+ break;
+ case 16:
+ vformat->Rmask = 0x0000f800;
+ vformat->Gmask = 0x000007e0;
+ vformat->Bmask = 0x0000001f;
+ break;
+ case 24:
+ case 32:
+ /* GDI defined as 8-8-8 */
+ vformat->Rmask = 0x00ff0000;
+ vformat->Gmask = 0x0000ff00;
+ vformat->Bmask = 0x000000ff;
+ break;
+ default:
+ break;
+ }
+
+ /* See if gamma is supported on this screen */
+ DIB_CheckGamma(this);
+
+#ifndef NO_CHANGEDISPLAYSETTINGS
+
+ settings.dmSize = sizeof(DEVMODE);
+ settings.dmDriverExtra = 0;
+#ifdef _WIN32_WCE
+ settings.dmFields = DM_DISPLAYQUERYORIENTATION;
+ this->hidden->supportRotation = ChangeDisplaySettingsEx(NULL, &settings, NULL, CDS_TEST, NULL) == DISP_CHANGE_SUCCESSFUL;
+#endif
+ /* Query for the desktop resolution */
+ SDL_desktop_mode.dmSize = sizeof(SDL_desktop_mode);
+ SDL_desktop_mode.dmDriverExtra = 0;
+ EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &SDL_desktop_mode);
+ this->info.current_w = SDL_desktop_mode.dmPelsWidth;
+ this->info.current_h = SDL_desktop_mode.dmPelsHeight;
+
+ /* Query for the list of available video modes */
+ for ( i=0; EnumDisplaySettings(NULL, i, &settings); ++i ) {
+ DIB_AddMode(this, settings.dmBitsPerPel,
+ settings.dmPelsWidth, settings.dmPelsHeight);
+#ifdef _WIN32_WCE
+ if( this->hidden->supportRotation )
+ DIB_AddMode(this, settings.dmBitsPerPel,
+ settings.dmPelsHeight, settings.dmPelsWidth);
+#endif
+ }
+ /* Sort the mode lists */
+ for ( i=0; i<NUM_MODELISTS; ++i ) {
+ if ( SDL_nummodes[i] > 0 ) {
+ SDL_qsort(SDL_modelist[i], SDL_nummodes[i], sizeof *SDL_modelist[i], cmpmodes);
+ }
+ }
+#else
+ // WinCE and fullscreen mode:
+ // We use only vformat->BitsPerPixel that allow SDL to
+ // emulate other bpp (8, 32) and use triple buffer,
+ // because SDL surface conversion is much faster than the WinCE one.
+ // Although it should be tested on devices with graphics accelerator.
+
+ DIB_AddMode(this, vformat->BitsPerPixel,
+ GetDeviceCaps(GetDC(NULL), HORZRES),
+ GetDeviceCaps(GetDC(NULL), VERTRES));
+
+#endif /* !NO_CHANGEDISPLAYSETTINGS */
+
+ /* Grab an identity palette if we are in a palettized mode */
+ if ( vformat->BitsPerPixel <= 8 ) {
+ /* RJR: March 28, 2000
+ moved palette creation to "DIB_CreatePalette" */
+ DIB_CreatePalette(this, vformat->BitsPerPixel);
+ }
+
+ /* Fill in some window manager capabilities */
+ this->info.wm_available = 1;
+
+#ifdef _WIN32_WCE
+ this->hidden->origRotation = -1;
+#endif
+
+ /* Allow environment override of screensaver disable. */
+ env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
+ if ( env ) {
+ allow_screensaver = SDL_atoi(env);
+ } else {
+#ifdef SDL_VIDEO_DISABLE_SCREENSAVER
+ allow_screensaver = 0;
+#else
+ allow_screensaver = 1;
+#endif
+ }
+
+ /* We're done! */
+ return(0);
+}
+
+/* We support any format at any dimension */
+SDL_Rect **DIB_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
+ return(SDL_modelist[((format->BitsPerPixel+7)/8)-1]);
+ } else {
+ return((SDL_Rect **)-1);
+ }
+}
+
+
+/*
+ Helper fn to work out which screen depth windows is currently using.
+ 15 bit mode is considered 555 format, 16 bit is 565.
+ returns 0 for unknown mode.
+ (Derived from code in sept 1999 Windows Developer Journal
+ http://www.wdj.com/code/archive.html)
+*/
+static int DIB_SussScreenDepth()
+{
+#ifdef NO_GETDIBITS
+ int depth;
+ HDC hdc;
+
+ hdc = GetDC(SDL_Window);
+ depth = GetDeviceCaps(hdc, PLANES) * GetDeviceCaps(hdc, BITSPIXEL);
+ ReleaseDC(SDL_Window, hdc);
+ return(depth);
+#else
+ int depth;
+ int dib_size;
+ LPBITMAPINFOHEADER dib_hdr;
+ HDC hdc;
+ HBITMAP hbm;
+
+ /* Allocate enough space for a DIB header plus palette (for
+ * 8-bit modes) or bitfields (for 16- and 32-bit modes)
+ */
+ dib_size = sizeof(BITMAPINFOHEADER) + 256 * sizeof (RGBQUAD);
+ dib_hdr = (LPBITMAPINFOHEADER) SDL_malloc(dib_size);
+ SDL_memset(dib_hdr, 0, dib_size);
+ dib_hdr->biSize = sizeof(BITMAPINFOHEADER);
+
+ /* Get a device-dependent bitmap that's compatible with the
+ screen.
+ */
+ hdc = GetDC(NULL);
+ hbm = CreateCompatibleBitmap( hdc, 1, 1 );
+
+ /* Convert the DDB to a DIB. We need to call GetDIBits twice:
+ * the first call just fills in the BITMAPINFOHEADER; the
+ * second fills in the bitfields or palette.
+ */
+ GetDIBits(hdc, hbm, 0, 1, NULL, (LPBITMAPINFO) dib_hdr, DIB_RGB_COLORS);
+ GetDIBits(hdc, hbm, 0, 1, NULL, (LPBITMAPINFO) dib_hdr, DIB_RGB_COLORS);
+ DeleteObject(hbm);
+ ReleaseDC(NULL, hdc);
+
+ depth = 0;
+ switch( dib_hdr->biBitCount )
+ {
+ case 8: depth = 8; break;
+ case 24: depth = 24; break;
+ case 32: depth = 32; break;
+ case 16:
+ if( dib_hdr->biCompression == BI_BITFIELDS ) {
+ /* check the red mask */
+ switch( ((DWORD*)((char*)dib_hdr + dib_hdr->biSize))[0] ) {
+ case 0xf800: depth = 16; break; /* 565 */
+ case 0x7c00: depth = 15; break; /* 555 */
+ }
+ }
+ }
+ SDL_free(dib_hdr);
+ return depth;
+#endif /* NO_GETDIBITS */
+}
+
+
+/* Various screen update functions available */
+static void DIB_NormalUpdate(_THIS, int numrects, SDL_Rect *rects);
+
+static void DIB_ResizeWindow(_THIS, int width, int height, int prev_width, int prev_height, Uint32 flags)
+{
+ RECT bounds;
+ int x, y;
+
+#ifndef _WIN32_WCE
+ /* Resize the window */
+ if ( !SDL_windowid && !IsZoomed(SDL_Window) ) {
+#else
+ if ( !SDL_windowid ) {
+#endif
+ HWND top;
+ UINT swp_flags;
+ const char *window = NULL;
+ const char *center = NULL;
+
+ if ( width != prev_width || height != prev_height ) {
+ window = SDL_getenv("SDL_VIDEO_WINDOW_POS");
+ center = SDL_getenv("SDL_VIDEO_CENTERED");
+ if ( window ) {
+ if ( SDL_sscanf(window, "%d,%d", &x, &y) == 2 ) {
+ SDL_windowX = x;
+ SDL_windowY = y;
+ }
+ if ( SDL_strcmp(window, "center") == 0 ) {
+ center = window;
+ }
+ }
+ }
+ swp_flags = (SWP_NOCOPYBITS | SWP_SHOWWINDOW);
+
+ bounds.left = SDL_windowX;
+ bounds.top = SDL_windowY;
+ bounds.right = SDL_windowX+width;
+ bounds.bottom = SDL_windowY+height;
+#ifndef _WIN32_WCE
+ AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), (GetMenu(SDL_Window) != NULL), 0);
+#else
+ // The bMenu parameter must be FALSE; menu bars are not supported
+ AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), 0, 0);
+#endif
+ width = bounds.right-bounds.left;
+ height = bounds.bottom-bounds.top;
+ if ( (flags & SDL_FULLSCREEN) ) {
+ x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
+ y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
+ } else if ( center ) {
+ x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
+ y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
+ } else if ( SDL_windowX || SDL_windowY || window ) {
+ x = bounds.left;
+ y = bounds.top;
+ } else {
+ x = y = -1;
+ swp_flags |= SWP_NOMOVE;
+ }
+ if ( flags & SDL_FULLSCREEN ) {
+ top = HWND_TOPMOST;
+ } else {
+ top = HWND_NOTOPMOST;
+ }
+ SetWindowPos(SDL_Window, top, x, y, width, height, swp_flags);
+ if ( !(flags & SDL_FULLSCREEN) ) {
+ SDL_windowX = SDL_bounds.left;
+ SDL_windowY = SDL_bounds.top;
+ }
+ if ( GetParent(SDL_Window) == NULL ) {
+ SetForegroundWindow(SDL_Window);
+ }
+ }
+}
+
+SDL_Surface *DIB_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ SDL_Surface *video;
+ int prev_w, prev_h;
+ Uint32 prev_flags;
+ DWORD style;
+ const DWORD directstyle =
+ (WS_POPUP);
+ const DWORD windowstyle =
+ (WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX);
+ const DWORD resizestyle =
+ (WS_THICKFRAME|WS_MAXIMIZEBOX);
+ int binfo_size;
+ BITMAPINFO *binfo;
+ HDC hdc;
+ Uint32 Rmask, Gmask, Bmask;
+
+ prev_w = current->w;
+ prev_h = current->h;
+ prev_flags = current->flags;
+
+ /*
+ * Special case for OpenGL windows...since the app needs to call
+ * SDL_SetVideoMode() in response to resize events to continue to
+ * function, but WGL handles the GL context details behind the scenes,
+ * there's no sense in tearing the context down just to rebuild it
+ * to what it already was...tearing it down sacrifices your GL state
+ * and uploaded textures. So if we're requesting the same video mode
+ * attributes just resize the window and return immediately.
+ */
+ if ( SDL_Window &&
+ ((current->flags & ~SDL_ANYFORMAT) == (flags & ~SDL_ANYFORMAT)) &&
+ (current->format->BitsPerPixel == bpp) &&
+ (flags & SDL_OPENGL) &&
+ !(flags & SDL_FULLSCREEN) ) { /* probably not safe for fs */
+ current->w = width;
+ current->h = height;
+ SDL_resizing = 1;
+ DIB_ResizeWindow(this, width, height, prev_w, prev_h, flags);
+ SDL_resizing = 0;
+ return current;
+ }
+
+ /* Clean up any GL context that may be hanging around */
+ if ( current->flags & SDL_OPENGL ) {
+ WIN_GL_ShutDown(this);
+ }
+ SDL_resizing = 1;
+
+ /* Recalculate the bitmasks if necessary */
+ if ( bpp == current->format->BitsPerPixel ) {
+ video = current;
+ } else {
+ switch (bpp) {
+ case 15:
+ case 16:
+ if ( DIB_SussScreenDepth() == 15 ) {
+ /* 5-5-5 */
+ Rmask = 0x00007c00;
+ Gmask = 0x000003e0;
+ Bmask = 0x0000001f;
+ } else {
+ /* 5-6-5 */
+ Rmask = 0x0000f800;
+ Gmask = 0x000007e0;
+ Bmask = 0x0000001f;
+ }
+ break;
+ case 24:
+ case 32:
+ /* GDI defined as 8-8-8 */
+ Rmask = 0x00ff0000;
+ Gmask = 0x0000ff00;
+ Bmask = 0x000000ff;
+ break;
+ default:
+ Rmask = 0x00000000;
+ Gmask = 0x00000000;
+ Bmask = 0x00000000;
+ break;
+ }
+ video = SDL_CreateRGBSurface(SDL_SWSURFACE,
+ 0, 0, bpp, Rmask, Gmask, Bmask, 0);
+ if ( video == NULL ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ }
+
+ /* Fill in part of the video surface */
+ video->flags = 0; /* Clear flags */
+ video->w = width;
+ video->h = height;
+ video->pitch = SDL_CalculatePitch(video);
+
+ /* Small fix for WinCE/Win32 - when activating window
+ SDL_VideoSurface is equal to zero, so activating code
+ is not called properly for fullscreen windows because
+ macros WINDIB_FULLSCREEN uses SDL_VideoSurface
+ */
+ SDL_VideoSurface = video;
+
+#if defined(_WIN32_WCE)
+ if ( flags & SDL_FULLSCREEN )
+ video->flags |= SDL_FULLSCREEN;
+#endif
+
+#ifndef NO_CHANGEDISPLAYSETTINGS
+ /* Set fullscreen mode if appropriate */
+ if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
+ DEVMODE settings;
+ BOOL changed;
+
+ SDL_memset(&settings, 0, sizeof(DEVMODE));
+ settings.dmSize = sizeof(DEVMODE);
+
+#ifdef _WIN32_WCE
+ // try to rotate screen to fit requested resolution
+ if( this->hidden->supportRotation )
+ {
+ DWORD rotation;
+
+ // ask current mode
+ settings.dmFields = DM_DISPLAYORIENTATION;
+ ChangeDisplaySettingsEx(NULL, &settings, NULL, CDS_TEST, NULL);
+ rotation = settings.dmDisplayOrientation;
+
+ if( (width > GetDeviceCaps(GetDC(NULL), HORZRES))
+ && (height < GetDeviceCaps(GetDC(NULL), VERTRES)))
+ {
+ switch( rotation )
+ {
+ case DMDO_0:
+ settings.dmDisplayOrientation = DMDO_90;
+ break;
+ case DMDO_270:
+ settings.dmDisplayOrientation = DMDO_180;
+ break;
+ }
+ if( settings.dmDisplayOrientation != rotation )
+ {
+ // go to landscape
+ this->hidden->origRotation = rotation;
+ ChangeDisplaySettingsEx(NULL,&settings,NULL,CDS_RESET,NULL);
+ }
+ }
+ if( (width < GetDeviceCaps(GetDC(NULL), HORZRES))
+ && (height > GetDeviceCaps(GetDC(NULL), VERTRES)))
+ {
+ switch( rotation )
+ {
+ case DMDO_90:
+ settings.dmDisplayOrientation = DMDO_0;
+ break;
+ case DMDO_180:
+ settings.dmDisplayOrientation = DMDO_270;
+ break;
+ }
+ if( settings.dmDisplayOrientation != rotation )
+ {
+ // go to portrait
+ this->hidden->origRotation = rotation;
+ ChangeDisplaySettingsEx(NULL,&settings,NULL,CDS_RESET,NULL);
+ }
+ }
+
+ }
+#endif
+
+#ifndef _WIN32_WCE
+ settings.dmBitsPerPel = video->format->BitsPerPixel;
+ settings.dmPelsWidth = width;
+ settings.dmPelsHeight = height;
+ settings.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL;
+ if ( width <= (int)SDL_desktop_mode.dmPelsWidth &&
+ height <= (int)SDL_desktop_mode.dmPelsHeight ) {
+ settings.dmDisplayFrequency = SDL_desktop_mode.dmDisplayFrequency;
+ settings.dmFields |= DM_DISPLAYFREQUENCY;
+ }
+ changed = (ChangeDisplaySettings(&settings, CDS_FULLSCREEN) == DISP_CHANGE_SUCCESSFUL);
+ if ( ! changed && (settings.dmFields & DM_DISPLAYFREQUENCY) ) {
+ settings.dmFields &= ~DM_DISPLAYFREQUENCY;
+ changed = (ChangeDisplaySettings(&settings, CDS_FULLSCREEN) == DISP_CHANGE_SUCCESSFUL);
+ }
+#else
+ changed = 1;
+#endif
+ if ( changed ) {
+ video->flags |= SDL_FULLSCREEN;
+ SDL_fullscreen_mode = settings;
+ }
+
+ }
+#endif /* !NO_CHANGEDISPLAYSETTINGS */
+
+ /* Reset the palette and create a new one if necessary */
+ if ( grab_palette ) {
+ DIB_ReleaseStaticColors(SDL_Window);
+ grab_palette = FALSE;
+ }
+ if ( screen_pal != NULL ) {
+ /* RJR: March 28, 2000
+ delete identity palette if switching from a palettized mode */
+ DeleteObject(screen_pal);
+ screen_pal = NULL;
+ }
+ if ( screen_logpal != NULL ) {
+ SDL_free(screen_logpal);
+ screen_logpal = NULL;
+ }
+
+ if ( bpp <= 8 )
+ {
+ /* RJR: March 28, 2000
+ create identity palette switching to a palettized mode */
+ DIB_CreatePalette(this, bpp);
+ }
+
+ style = GetWindowLong(SDL_Window, GWL_STYLE);
+ style &= ~(resizestyle|WS_MAXIMIZE);
+ if ( (video->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
+ style &= ~windowstyle;
+ style |= directstyle;
+ } else {
+#ifndef NO_CHANGEDISPLAYSETTINGS
+ if ( (prev_flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
+ ChangeDisplaySettings(NULL, 0);
+ }
+#endif
+ if ( flags & SDL_NOFRAME ) {
+ style &= ~windowstyle;
+ style |= directstyle;
+ video->flags |= SDL_NOFRAME;
+ } else {
+ style &= ~directstyle;
+ style |= windowstyle;
+ if ( flags & SDL_RESIZABLE ) {
+ style |= resizestyle;
+ video->flags |= SDL_RESIZABLE;
+ }
+ }
+#if WS_MAXIMIZE && !defined(_WIN32_WCE)
+ if (IsZoomed(SDL_Window)) style |= WS_MAXIMIZE;
+#endif
+ }
+
+ /* DJM: Don't piss of anyone who has setup his own window */
+ if ( !SDL_windowid )
+ SetWindowLong(SDL_Window, GWL_STYLE, style);
+
+ /* Delete the old bitmap if necessary */
+ if ( screen_bmp != NULL ) {
+ DeleteObject(screen_bmp);
+ }
+ if ( ! (flags & SDL_OPENGL) ) {
+ BOOL is16bitmode = (video->format->BytesPerPixel == 2);
+
+ /* Suss out the bitmap info header */
+ binfo_size = sizeof(*binfo);
+ if( is16bitmode ) {
+ /* 16bit modes, palette area used for rgb bitmasks */
+ binfo_size += 3*sizeof(DWORD);
+ } else if ( video->format->palette ) {
+ binfo_size += video->format->palette->ncolors *
+ sizeof(RGBQUAD);
+ }
+ binfo = (BITMAPINFO *)SDL_malloc(binfo_size);
+ if ( ! binfo ) {
+ if ( video != current ) {
+ SDL_FreeSurface(video);
+ }
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+
+ binfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ binfo->bmiHeader.biWidth = video->w;
+ binfo->bmiHeader.biHeight = -video->h; /* -ve for topdown bitmap */
+ binfo->bmiHeader.biPlanes = 1;
+ binfo->bmiHeader.biSizeImage = video->h * video->pitch;
+ binfo->bmiHeader.biXPelsPerMeter = 0;
+ binfo->bmiHeader.biYPelsPerMeter = 0;
+ binfo->bmiHeader.biClrUsed = 0;
+ binfo->bmiHeader.biClrImportant = 0;
+ binfo->bmiHeader.biBitCount = video->format->BitsPerPixel;
+
+ if ( is16bitmode ) {
+ /* BI_BITFIELDS tells CreateDIBSection about the rgb masks in the palette */
+ binfo->bmiHeader.biCompression = BI_BITFIELDS;
+ ((Uint32*)binfo->bmiColors)[0] = video->format->Rmask;
+ ((Uint32*)binfo->bmiColors)[1] = video->format->Gmask;
+ ((Uint32*)binfo->bmiColors)[2] = video->format->Bmask;
+ } else {
+ binfo->bmiHeader.biCompression = BI_RGB; /* BI_BITFIELDS for 565 vs 555 */
+ if ( video->format->palette ) {
+ SDL_memset(binfo->bmiColors, 0,
+ video->format->palette->ncolors*sizeof(RGBQUAD));
+ }
+ }
+
+ /* Create the offscreen bitmap buffer */
+ hdc = GetDC(SDL_Window);
+ screen_bmp = CreateDIBSection(hdc, binfo, DIB_RGB_COLORS,
+ (void **)(&video->pixels), NULL, 0);
+ ReleaseDC(SDL_Window, hdc);
+ SDL_free(binfo);
+ if ( screen_bmp == NULL ) {
+ if ( video != current ) {
+ SDL_FreeSurface(video);
+ }
+ SDL_SetError("Couldn't create DIB section");
+ return(NULL);
+ }
+ this->UpdateRects = DIB_NormalUpdate;
+
+ /* Set video surface flags */
+ if ( screen_pal && (flags & (SDL_FULLSCREEN|SDL_HWPALETTE)) ) {
+ grab_palette = TRUE;
+ }
+ if ( screen_pal ) {
+ /* BitBlt() maps colors for us */
+ video->flags |= SDL_HWPALETTE;
+ }
+ }
+ DIB_ResizeWindow(this, width, height, prev_w, prev_h, flags);
+ SDL_resizing = 0;
+
+ /* Set up for OpenGL */
+ if ( flags & SDL_OPENGL ) {
+ if ( WIN_GL_SetupWindow(this) < 0 ) {
+ return(NULL);
+ }
+ video->flags |= SDL_OPENGL;
+ }
+
+ /* JC 14 Mar 2006
+ Flush the message loop or this can cause big problems later
+ Especially if the user decides to use dialog boxes or assert()!
+ */
+ WIN_FlushMessageQueue();
+
+ /* We're live! */
+ return(video);
+}
+
+/* We don't actually allow hardware surfaces in the DIB driver */
+static int DIB_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(-1);
+}
+static void DIB_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+static int DIB_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(0);
+}
+static void DIB_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+static void DIB_NormalUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+ HDC hdc, mdc;
+ int i;
+
+ hdc = GetDC(SDL_Window);
+ if ( screen_pal ) {
+ SelectPalette(hdc, screen_pal, FALSE);
+ }
+ mdc = CreateCompatibleDC(hdc);
+ SelectObject(mdc, screen_bmp);
+ for ( i=0; i<numrects; ++i ) {
+ BitBlt(hdc, rects[i].x, rects[i].y, rects[i].w, rects[i].h,
+ mdc, rects[i].x, rects[i].y, SRCCOPY);
+ }
+ DeleteDC(mdc);
+ ReleaseDC(SDL_Window, hdc);
+}
+
+static int FindPaletteIndex(LOGPALETTE *pal, BYTE r, BYTE g, BYTE b)
+{
+ PALETTEENTRY *entry;
+ int i;
+ int nentries = pal->palNumEntries;
+
+ for ( i = 0; i < nentries; ++i ) {
+ entry = &pal->palPalEntry[i];
+ if ( entry->peRed == r && entry->peGreen == g && entry->peBlue == b ) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+static BOOL CheckPaletteEntry(LOGPALETTE *pal, int index, BYTE r, BYTE g, BYTE b)
+{
+ PALETTEENTRY *entry;
+ BOOL moved = 0;
+
+ entry = &pal->palPalEntry[index];
+ if ( entry->peRed != r || entry->peGreen != g || entry->peBlue != b ) {
+ int found = FindPaletteIndex(pal, r, g, b);
+ if ( found >= 0 ) {
+ pal->palPalEntry[found] = *entry;
+ }
+ entry->peRed = r;
+ entry->peGreen = g;
+ entry->peBlue = b;
+ moved = 1;
+ }
+ entry->peFlags = 0;
+
+ return moved;
+}
+
+int DIB_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 400)
+ HDC hdc, mdc;
+ RGBQUAD *pal;
+#else
+ HDC hdc;
+#endif
+ int i;
+ int moved_entries = 0;
+
+ /* Update the display palette */
+ hdc = GetDC(SDL_Window);
+ if ( screen_pal ) {
+ PALETTEENTRY *entry;
+
+ for ( i=0; i<ncolors; ++i ) {
+ entry = &screen_logpal->palPalEntry[firstcolor+i];
+ entry->peRed = colors[i].r;
+ entry->peGreen = colors[i].g;
+ entry->peBlue = colors[i].b;
+ entry->peFlags = PC_NOCOLLAPSE;
+ }
+#if defined(SYSPAL_NOSTATIC) && !defined(_WIN32_WCE)
+ /* Check to make sure black and white are in position */
+ if ( GetSystemPaletteUse(hdc) != SYSPAL_NOSTATIC256 ) {
+ moved_entries += CheckPaletteEntry(screen_logpal, 0, 0x00, 0x00, 0x00);
+ moved_entries += CheckPaletteEntry(screen_logpal, screen_logpal->palNumEntries-1, 0xff, 0xff, 0xff);
+ }
+ /* FIXME:
+ If we don't have full access to the palette, what we
+ really want to do is find the 236 most diverse colors
+ in the desired palette, set those entries (10-245) and
+ then map everything into the new system palette.
+ */
+#endif
+
+#ifndef _WIN32_WCE
+ /* Copy the entries into the system palette */
+ UnrealizeObject(screen_pal);
+#endif
+ SetPaletteEntries(screen_pal, 0, screen_logpal->palNumEntries, screen_logpal->palPalEntry);
+ SelectPalette(hdc, screen_pal, FALSE);
+ RealizePalette(hdc);
+ }
+
+#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 400)
+ /* Copy palette colors into DIB palette */
+ pal = SDL_stack_alloc(RGBQUAD, ncolors);
+ for ( i=0; i<ncolors; ++i ) {
+ pal[i].rgbRed = colors[i].r;
+ pal[i].rgbGreen = colors[i].g;
+ pal[i].rgbBlue = colors[i].b;
+ pal[i].rgbReserved = 0;
+ }
+
+ /* Set the DIB palette and update the display */
+ mdc = CreateCompatibleDC(hdc);
+ SelectObject(mdc, screen_bmp);
+ SetDIBColorTable(mdc, firstcolor, ncolors, pal);
+ if ( moved_entries || !grab_palette ) {
+ BitBlt(hdc, 0, 0, this->screen->w, this->screen->h,
+ mdc, 0, 0, SRCCOPY);
+ }
+ DeleteDC(mdc);
+ SDL_stack_free(pal);
+#endif
+ ReleaseDC(SDL_Window, hdc);
+ return(1);
+}
+
+
+static void DIB_CheckGamma(_THIS)
+{
+#ifndef NO_GAMMA_SUPPORT
+ HDC hdc;
+ WORD ramp[3*256];
+
+ /* If we fail to get gamma, disable gamma control */
+ hdc = GetDC(SDL_Window);
+ if ( ! GetDeviceGammaRamp(hdc, ramp) ) {
+ this->GetGammaRamp = NULL;
+ this->SetGammaRamp = NULL;
+ }
+ ReleaseDC(SDL_Window, hdc);
+#endif /* !NO_GAMMA_SUPPORT */
+}
+void DIB_SwapGamma(_THIS)
+{
+#ifndef NO_GAMMA_SUPPORT
+ HDC hdc;
+
+ if ( gamma_saved ) {
+ hdc = GetDC(SDL_Window);
+ if ( SDL_GetAppState() & SDL_APPINPUTFOCUS ) {
+ /* About to leave active state, restore gamma */
+ SetDeviceGammaRamp(hdc, gamma_saved);
+ } else {
+ /* About to enter active state, set game gamma */
+ GetDeviceGammaRamp(hdc, gamma_saved);
+ SetDeviceGammaRamp(hdc, this->gamma);
+ }
+ ReleaseDC(SDL_Window, hdc);
+ }
+#endif /* !NO_GAMMA_SUPPORT */
+}
+void DIB_QuitGamma(_THIS)
+{
+#ifndef NO_GAMMA_SUPPORT
+ if ( gamma_saved ) {
+ /* Restore the original gamma if necessary */
+ if ( SDL_GetAppState() & SDL_APPINPUTFOCUS ) {
+ HDC hdc;
+
+ hdc = GetDC(SDL_Window);
+ SetDeviceGammaRamp(hdc, gamma_saved);
+ ReleaseDC(SDL_Window, hdc);
+ }
+
+ /* Free the saved gamma memory */
+ SDL_free(gamma_saved);
+ gamma_saved = 0;
+ }
+#endif /* !NO_GAMMA_SUPPORT */
+}
+
+int DIB_SetGammaRamp(_THIS, Uint16 *ramp)
+{
+#ifdef NO_GAMMA_SUPPORT
+ SDL_SetError("SDL compiled without gamma ramp support");
+ return -1;
+#else
+ HDC hdc;
+ BOOL succeeded;
+
+ /* Set the ramp for the display */
+ if ( ! gamma_saved ) {
+ gamma_saved = (WORD *)SDL_malloc(3*256*sizeof(*gamma_saved));
+ if ( ! gamma_saved ) {
+ SDL_OutOfMemory();
+ return -1;
+ }
+ hdc = GetDC(SDL_Window);
+ GetDeviceGammaRamp(hdc, gamma_saved);
+ ReleaseDC(SDL_Window, hdc);
+ }
+ if ( SDL_GetAppState() & SDL_APPINPUTFOCUS ) {
+ hdc = GetDC(SDL_Window);
+ succeeded = SetDeviceGammaRamp(hdc, ramp);
+ ReleaseDC(SDL_Window, hdc);
+ } else {
+ succeeded = TRUE;
+ }
+ return succeeded ? 0 : -1;
+#endif /* !NO_GAMMA_SUPPORT */
+}
+
+int DIB_GetGammaRamp(_THIS, Uint16 *ramp)
+{
+#ifdef NO_GAMMA_SUPPORT
+ SDL_SetError("SDL compiled without gamma ramp support");
+ return -1;
+#else
+ HDC hdc;
+ BOOL succeeded;
+
+ /* Get the ramp from the display */
+ hdc = GetDC(SDL_Window);
+ succeeded = GetDeviceGammaRamp(hdc, ramp);
+ ReleaseDC(SDL_Window, hdc);
+ return succeeded ? 0 : -1;
+#endif /* !NO_GAMMA_SUPPORT */
+}
+
+void DIB_VideoQuit(_THIS)
+{
+ int i, j;
+
+ /* Destroy the window and everything associated with it */
+ if ( SDL_Window ) {
+ /* Delete the screen bitmap (also frees screen->pixels) */
+ if ( this->screen ) {
+ if ( grab_palette ) {
+ DIB_ReleaseStaticColors(SDL_Window);
+ }
+#ifndef NO_CHANGEDISPLAYSETTINGS
+ if ( this->screen->flags & SDL_FULLSCREEN ) {
+ ChangeDisplaySettings(NULL, 0);
+ ShowWindow(SDL_Window, SW_HIDE);
+ }
+#endif
+ if ( this->screen->flags & SDL_OPENGL ) {
+ WIN_GL_ShutDown(this);
+ }
+ this->screen->pixels = NULL;
+ }
+ if ( screen_pal != NULL ) {
+ DeleteObject(screen_pal);
+ screen_pal = NULL;
+ }
+ if ( screen_logpal != NULL ) {
+ SDL_free(screen_logpal);
+ screen_logpal = NULL;
+ }
+ if ( screen_bmp ) {
+ DeleteObject(screen_bmp);
+ screen_bmp = NULL;
+ }
+ if ( screen_icn ) {
+ DestroyIcon(screen_icn);
+ screen_icn = NULL;
+ }
+ DIB_QuitGamma(this);
+ DIB_DestroyWindow(this);
+
+ SDL_Window = NULL;
+
+#if defined(_WIN32_WCE)
+
+// Unload wince aygshell library to prevent leak
+ if( aygshell )
+ {
+ FreeLibrary(aygshell);
+ aygshell = NULL;
+ }
+#endif
+ }
+
+ for ( i=0; i < SDL_arraysize(SDL_modelist); ++i ) {
+ if ( !SDL_modelist[i] ) {
+ continue;
+ }
+ for ( j=0; SDL_modelist[i][j]; ++j ) {
+ SDL_free(SDL_modelist[i][j]);
+ }
+ SDL_free(SDL_modelist[i]);
+ SDL_modelist[i] = NULL;
+ SDL_nummodes[i] = 0;
+ }
+}
+
+/* Exported for the windows message loop only */
+static void DIB_GrabStaticColors(HWND window)
+{
+#if defined(SYSPAL_NOSTATIC) && !defined(_WIN32_WCE)
+ HDC hdc;
+
+ hdc = GetDC(window);
+ SetSystemPaletteUse(hdc, SYSPAL_NOSTATIC256);
+ if ( GetSystemPaletteUse(hdc) != SYSPAL_NOSTATIC256 ) {
+ SetSystemPaletteUse(hdc, SYSPAL_NOSTATIC);
+ }
+ ReleaseDC(window, hdc);
+#endif
+}
+static void DIB_ReleaseStaticColors(HWND window)
+{
+#if defined(SYSPAL_NOSTATIC) && !defined(_WIN32_WCE)
+ HDC hdc;
+
+ hdc = GetDC(window);
+ SetSystemPaletteUse(hdc, SYSPAL_STATIC);
+ ReleaseDC(window, hdc);
+#endif
+}
+static void DIB_Activate(_THIS, BOOL active, BOOL minimized)
+{
+ if ( grab_palette ) {
+ if ( !active ) {
+ DIB_ReleaseStaticColors(SDL_Window);
+ DIB_RealizePalette(this);
+ } else if ( !minimized ) {
+ DIB_GrabStaticColors(SDL_Window);
+ DIB_RealizePalette(this);
+ }
+ }
+}
+static void DIB_RealizePalette(_THIS)
+{
+ if ( screen_pal != NULL ) {
+ HDC hdc;
+
+ hdc = GetDC(SDL_Window);
+#ifndef _WIN32_WCE
+ UnrealizeObject(screen_pal);
+#endif
+ SelectPalette(hdc, screen_pal, FALSE);
+ if ( RealizePalette(hdc) ) {
+ InvalidateRect(SDL_Window, NULL, FALSE);
+ }
+ ReleaseDC(SDL_Window, hdc);
+ }
+}
+static void DIB_PaletteChanged(_THIS, HWND window)
+{
+ if ( window != SDL_Window ) {
+ DIB_RealizePalette(this);
+ }
+}
+
+/* Exported for the windows message loop only */
+static void DIB_WinPAINT(_THIS, HDC hdc)
+{
+ HDC mdc;
+
+ if ( screen_pal ) {
+ SelectPalette(hdc, screen_pal, FALSE);
+ }
+ mdc = CreateCompatibleDC(hdc);
+ SelectObject(mdc, screen_bmp);
+ BitBlt(hdc, 0, 0, SDL_VideoSurface->w, SDL_VideoSurface->h,
+ mdc, 0, 0, SRCCOPY);
+ DeleteDC(mdc);
+}
+
+static void DIB_GetWinPos(_THIS, int* px, int *py)
+{
+ RECT rect;
+ GetWindowRect(SDL_Window, &rect);
+ *px = rect.left;
+ *py = rect.top;
+}
+
+static void DIB_SetWinPos(_THIS, int x, int y)
+{
+ SetWindowPos(SDL_Window, HWND_TOPMOST,
+ x, y, 0, 0, SWP_NOSIZE|SWP_NOZORDER);
+}
+
+typedef struct {
+ int result;
+ int first;
+ RECT wrect;
+ RECT primary;
+} VisibilityData;
+
+
+BOOL CALLBACK visibility_cb(HMONITOR hMonitor,
+ HDC hdcMonitor,
+ LPRECT mrect,
+ LPARAM dwData)
+{
+ VisibilityData* data = (VisibilityData*)dwData;
+
+ if ( data->first ) {
+ data->first = 0;
+ data->primary = mrect[0];
+ }
+
+ if ( data->wrect.left >= mrect->left &&
+ data->wrect.right <= mrect->right &&
+ data->wrect.top >= mrect->top &&
+ data->wrect.bottom <= mrect->bottom )
+ {
+ data->result = 1;
+ return FALSE;
+ }
+ return TRUE;
+}
+
+static int DIB_IsWinVisible(_THIS, int recenter)
+{
+ VisibilityData data;
+ data.result = 0;
+ data.first = 1;
+
+ GetWindowRect(SDL_Window, &data.wrect);
+
+ EnumDisplayMonitors(NULL, NULL, visibility_cb, (LPARAM)&data);
+
+ if ( !data.result && recenter ) {
+ int new_x = 10;
+ int new_y = 10;
+
+ if ( !data.first ) {
+ int primary_w = data.primary.right - data.primary.left;
+ int primary_h = data.primary.bottom - data.primary.top;
+
+ new_x = data.primary.left + (primary_w - this->screen->w)/2;
+ new_y = data.primary.top + (primary_h - this->screen->h)/2;
+ }
+ DIB_SetWinPos(this, new_x, new_y);
+ }
+ return data.result;
+}
+
+static int DIB_GetMonitorDPI(_THIS, int* xDpi, int *yDpi)
+{
+ HDC displayDC = CreateDC( "DISPLAY", NULL, NULL, NULL );
+ int xdpi, ydpi;
+
+ if (displayDC == NULL) {
+ return -1;
+ }
+ xdpi = GetDeviceCaps( displayDC, LOGPIXELSX );
+ ydpi = GetDeviceCaps( displayDC, LOGPIXELSY );
+
+ DeleteDC(displayDC);
+
+ /* sanity checks */
+ if (xdpi < 20 || xdpi > 400 || ydpi < 20 || ydpi > 400) {
+ return -1;
+ }
+
+ *xDpi = xdpi;
+ *yDpi = ydpi;
+ return 0;
+}
+
+
+typedef struct {
+ int first;
+ RECT wrect;
+ long bestArea;
+ RECT bestRect;
+ RECT primary;
+} ProximityData;
+
+BOOL CALLBACK proximity_cb(HMONITOR hMonitor,
+ HDC hdcMonitor,
+ LPRECT mrect,
+ LPARAM dwData)
+{
+ ProximityData* data = (ProximityData*)dwData;
+ int x1, y1, x2, y2, area;
+
+ x1 = mrect->left;
+ x2 = mrect->right;
+ y1 = mrect->top;
+ y2 = mrect->bottom;
+
+ if (data->first) {
+ data->primary = mrect[0];
+ }
+
+ if (x1 < data->wrect.left)
+ x1 = data->wrect.left;
+ if (x2 > data->wrect.right)
+ x2 = data->wrect.right;
+ if (y1 < data->wrect.top)
+ y1 = data->wrect.top;
+ if (y2 > data->wrect.bottom)
+ y2 = data->wrect.bottom;
+
+ if (x1 >= x2 || y1 >= y2)
+ return TRUE;
+
+ area = (x2-x1)*(y2-y1);
+ if (data->first || area > data->bestArea) {
+ data->first = 0;
+ data->bestRect = mrect[0];
+ data->bestArea = area;
+ }
+ return TRUE;
+}
+
+static int DIB_GetMonitorRect(_THIS, SDL_Rect* rect)
+{
+ ProximityData data;
+ RECT* sr;
+
+ data.first = 1;
+ GetWindowRect(SDL_Window, &data.wrect);
+
+ EnumDisplayMonitors(NULL, NULL, proximity_cb, (LPARAM)&data);
+
+ if (data.first)
+ return -1;
+
+ sr = &data.bestRect;
+
+ rect->x = sr->left;
+ rect->y = sr->top;
+ rect->w = sr->right - sr->left;
+ rect->h = sr->bottom - sr->top;
+
+ return 0;
+}
+
+/* Stub in case DirectX isn't available */
+#if !SDL_AUDIO_DRIVER_DSOUND
+void DX5_SoundFocus(HWND hwnd)
+{
+ return;
+}
+#endif
diff --git a/distrib/sdl-1.2.15/src/video/windib/SDL_dibvideo.h b/distrib/sdl-1.2.15/src/video/windib/SDL_dibvideo.h
new file mode 100644
index 0000000..48b1943
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/windib/SDL_dibvideo.h
@@ -0,0 +1,59 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_dibvideo_h
+#define _SDL_dibvideo_h
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+
+/* Private display data */
+struct DibInfo {
+ HBITMAP screen_bmp;
+ HPALETTE screen_pal;
+ LOGPALETTE *screen_logpal;
+ BOOL grab_palette;
+
+#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
+ int SDL_nummodes[NUM_MODELISTS];
+ SDL_Rect **SDL_modelist[NUM_MODELISTS];
+
+#ifdef _WIN32_WCE
+ int supportRotation; /* for Pocket PC devices */
+ DWORD origRotation; /* for Pocket PC devices */
+#endif
+
+ /* Screensaver settings */
+ int allow_screensaver;
+};
+/* Old variable names */
+#define screen_bmp (this->hidden->dibInfo->screen_bmp)
+#define screen_pal (this->hidden->dibInfo->screen_pal)
+#define screen_logpal (this->hidden->dibInfo->screen_logpal)
+#define grab_palette (this->hidden->dibInfo->grab_palette)
+#define SDL_nummodes (this->hidden->dibInfo->SDL_nummodes)
+#define SDL_modelist (this->hidden->dibInfo->SDL_modelist)
+#define allow_screensaver (this->hidden->dibInfo->allow_screensaver)
+
+#endif /* _SDL_dibvideo_h */
diff --git a/distrib/sdl-1.2.15/src/video/windib/SDL_gapidibvideo.h b/distrib/sdl-1.2.15/src/video/windib/SDL_gapidibvideo.h
new file mode 100644
index 0000000..64743d1
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/windib/SDL_gapidibvideo.h
@@ -0,0 +1,56 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_gapidibvideo_h
+#define _SDL_gapidibvideo_h
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+/* typedef these to be able to define pointers, but still force everybody who
+ * wants to access them to include the corresponding header */
+typedef struct GapiInfo GapiInfo;
+typedef struct DibInfo DibInfo;
+
+/* for PDA */
+typedef enum
+{
+ SDL_ORIENTATION_UP,
+ SDL_ORIENTATION_DOWN,
+ SDL_ORIENTATION_LEFT,
+ SDL_ORIENTATION_RIGHT
+} SDL_ScreenOrientation;
+
+/* Private display data shared by gapi and windib*/
+struct SDL_PrivateVideoData {
+ int supportRotation; /* for Pocket PC devices */
+ DWORD origRotation; /* for Pocket PC devices */
+
+ GapiInfo* gapiInfo;
+ DibInfo* dibInfo;
+};
+
+#endif
diff --git a/distrib/sdl-1.2.15/src/video/windib/SDL_vkeys.h b/distrib/sdl-1.2.15/src/video/windib/SDL_vkeys.h
new file mode 100644
index 0000000..53d9246
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/windib/SDL_vkeys.h
@@ -0,0 +1,75 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+#ifndef 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'
+#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
diff --git a/distrib/sdl-1.2.15/src/video/windx5/SDL_dx5events.c b/distrib/sdl-1.2.15/src/video/windx5/SDL_dx5events.c
new file mode 100644
index 0000000..e12092f
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/windx5/SDL_dx5events.c
@@ -0,0 +1,1005 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* CAUTION!!!! If you modify this file, check ../windib/SDL_sysevents.c */
+
+#include "directx.h"
+
+#include "SDL_main.h"
+#include "SDL_events.h"
+#include "SDL_video.h"
+#include "SDL_syswm.h"
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "../wincommon/SDL_lowvideo.h"
+#include "SDL_dx5video.h"
+
+#ifndef WM_APP
+#define WM_APP 0x8000
+#endif
+
+#ifdef _WIN32_WCE
+#define NO_GETKEYBOARDSTATE
+#endif
+
+/* The keyboard and mouse device input */
+#define MAX_INPUTS 2
+#define INPUT_QSIZE 512 /* Buffer up to 512 input messages */
+
+static LPDIRECTINPUT dinput = NULL;
+static LPDIRECTINPUTDEVICE2 SDL_DIdev[MAX_INPUTS];
+static HANDLE SDL_DIevt[MAX_INPUTS];
+static void (*SDL_DIfun[MAX_INPUTS])(const int, DIDEVICEOBJECTDATA *);
+static int SDL_DIndev = 0;
+static int mouse_lost;
+static int mouse_pressed;
+static int mouse_buttons_swapped = 0;
+
+/* The translation table from a DirectInput scancode to an SDL keysym */
+static SDLKey DIK_keymap[256];
+static SDL_keysym *TranslateKey(UINT scancode, SDL_keysym *keysym, int pressed);
+
+/* DJM: If the user setup the window for us, we want to save his window proc,
+ and give him a chance to handle some messages. */
+#ifdef STRICT
+#define WNDPROCTYPE WNDPROC
+#else
+#define WNDPROCTYPE FARPROC
+#endif
+static WNDPROCTYPE userWindowProc = NULL;
+
+static HWND GetTopLevelParent(HWND hWnd)
+{
+ HWND hParentWnd;
+ while (1)
+ {
+ hParentWnd = GetParent(hWnd);
+ if (hParentWnd == NULL)
+ break;
+ hWnd = hParentWnd;
+ }
+ return hWnd;
+}
+
+/* Convert a DirectInput return code to a text message */
+static void SetDIerror(char *function, int code)
+{
+ static char *error;
+ static char errbuf[1024];
+
+ errbuf[0] = 0;
+ switch (code) {
+ case DIERR_GENERIC:
+ error = "Undefined error!";
+ break;
+ case DIERR_OLDDIRECTINPUTVERSION:
+ error = "Your version of DirectInput needs upgrading";
+ break;
+ case DIERR_INVALIDPARAM:
+ error = "Invalid parameters";
+ break;
+ case DIERR_OUTOFMEMORY:
+ error = "Out of memory";
+ break;
+ case DIERR_DEVICENOTREG:
+ error = "Device not registered";
+ break;
+ case DIERR_NOINTERFACE:
+ error = "Interface not supported";
+ break;
+ case DIERR_NOTINITIALIZED:
+ error = "Device not initialized";
+ break;
+ default:
+ SDL_snprintf(errbuf, SDL_arraysize(errbuf),
+ "%s: Unknown DirectInput error: 0x%x",
+ function, code);
+ break;
+ }
+ if ( ! errbuf[0] ) {
+ SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: %s", function, error);
+ }
+ SDL_SetError("%s", errbuf);
+ return;
+}
+
+/* Initialize DirectInput
+ Note: If NONEXCLUSIVE access is requested for the devices, normal
+ windows input messages will continue to be generated for that
+ input device, in addition to DirectInput messages.
+ */
+static void handle_keyboard(const int numevents, DIDEVICEOBJECTDATA *events);
+static void handle_mouse(const int numevents, DIDEVICEOBJECTDATA *events);
+struct {
+ char *name;
+ REFGUID guid;
+ LPCDIDATAFORMAT format;
+ DWORD win_level;
+ DWORD raw_level;
+ void (*fun)(const int numevents, DIDEVICEOBJECTDATA *events);
+} inputs[] = {
+ { "keyboard",
+ &GUID_SysKeyboard, &c_dfDIKeyboard,
+ (DISCL_FOREGROUND|DISCL_NONEXCLUSIVE),
+ (DISCL_FOREGROUND|DISCL_NONEXCLUSIVE), handle_keyboard },
+ { "mouse",
+ &GUID_SysMouse,
+#if DIRECTINPUT_VERSION >= 0x700
+ &c_dfDIMouse2,
+#else
+ &c_dfDIMouse,
+#endif
+ (DISCL_BACKGROUND|DISCL_NONEXCLUSIVE),
+ (DISCL_BACKGROUND|DISCL_NONEXCLUSIVE), handle_mouse },
+ { NULL, NULL, NULL, 0, 0, NULL }
+};
+
+static int DX5_DInputInit(_THIS)
+{
+ int i;
+ LPDIRECTINPUTDEVICE device;
+ HRESULT result;
+ DIPROPDWORD dipdw;
+ HWND topwnd;
+
+ /* Create the DirectInput object */
+ result = DInputCreate(SDL_Instance, DIRECTINPUT_VERSION,
+ &dinput, NULL);
+ if ( result != DI_OK ) {
+ SetDIerror("DirectInputCreate", result);
+ return(-1);
+ }
+
+ /* Create all of our registered input devices */
+ SDL_DIndev = 0;
+ for ( i=0; inputs[i].name; ++i ) {
+ /* Create the DirectInput device */
+ result = IDirectInput_CreateDevice(dinput, inputs[i].guid,
+ &device, NULL);
+ if ( result != DI_OK ) {
+ SetDIerror("DirectInput::CreateDevice", result);
+ return(-1);
+ }
+ result = IDirectInputDevice_QueryInterface(device,
+ &IID_IDirectInputDevice2, (LPVOID *)&SDL_DIdev[i]);
+ IDirectInputDevice_Release(device);
+ if ( result != DI_OK ) {
+ SetDIerror("DirectInputDevice::QueryInterface", result);
+ return(-1);
+ }
+ topwnd = GetTopLevelParent(SDL_Window);
+ result = IDirectInputDevice2_SetCooperativeLevel(SDL_DIdev[i],
+ topwnd, inputs[i].win_level);
+ if ( result != DI_OK ) {
+ SetDIerror("DirectInputDevice::SetCooperativeLevel",
+ result);
+ return(-1);
+ }
+ result = IDirectInputDevice2_SetDataFormat(SDL_DIdev[i],
+ inputs[i].format);
+ if ( result != DI_OK ) {
+ SetDIerror("DirectInputDevice::SetDataFormat", result);
+ return(-1);
+ }
+
+ /* Set buffered input -- we aren't polling */
+ SDL_memset(&dipdw, 0, sizeof(dipdw));
+ dipdw.diph.dwSize = sizeof(dipdw);
+ dipdw.diph.dwHeaderSize = sizeof(dipdw.diph);
+ dipdw.diph.dwObj = 0;
+ dipdw.diph.dwHow = DIPH_DEVICE;
+ dipdw.dwData = INPUT_QSIZE;
+ result = IDirectInputDevice2_SetProperty(SDL_DIdev[i],
+ DIPROP_BUFFERSIZE, &dipdw.diph);
+ if ( result != DI_OK ) {
+ SetDIerror("DirectInputDevice::SetProperty", result);
+ return(-1);
+ }
+
+ /* Create an event to be signaled when input is ready */
+ SDL_DIevt[i] = CreateEvent(NULL, FALSE, FALSE, NULL);
+ if ( SDL_DIevt[i] == NULL ) {
+ SDL_SetError("Couldn't create DirectInput event");
+ return(-1);
+ }
+ result = IDirectInputDevice2_SetEventNotification(SDL_DIdev[i],
+ SDL_DIevt[i]);
+ if ( result != DI_OK ) {
+ SetDIerror("DirectInputDevice::SetEventNotification",
+ result);
+ return(-1);
+ }
+ SDL_DIfun[i] = inputs[i].fun;
+
+ /* Acquire the device for input */
+ IDirectInputDevice2_Acquire(SDL_DIdev[i]);
+
+ /* Increment the number of devices we have */
+ ++SDL_DIndev;
+ }
+ mouse_pressed = 0;
+ mouse_buttons_swapped = GetSystemMetrics(SM_SWAPBUTTON);
+
+ /* DirectInput is ready! */
+ return(0);
+}
+
+/* Clean up DirectInput */
+static void DX5_DInputQuit(_THIS)
+{
+ int i;
+
+ if ( dinput != NULL ) {
+ /* Close and release all DirectInput devices */
+ for ( i=0; i<MAX_INPUTS; ++i ) {
+ if ( SDL_DIdev[i] != NULL ) {
+ IDirectInputDevice2_Unacquire(SDL_DIdev[i]);
+ IDirectInputDevice2_SetEventNotification(
+ SDL_DIdev[i], NULL);
+ if ( SDL_DIevt[i] != NULL ) {
+ CloseHandle(SDL_DIevt[i]);
+ SDL_DIevt[i] = NULL;
+ }
+ IDirectInputDevice2_Release(SDL_DIdev[i]);
+ SDL_DIdev[i] = NULL;
+ }
+ }
+ SDL_DIndev = 0;
+
+ /* Release DirectInput */
+ IDirectInput_Release(dinput);
+ dinput = NULL;
+ }
+}
+
+/* Flag to tell SDL whether or not we queued an event */
+static int posted = 0;
+
+/* Input event handler functions */
+static void handle_keyboard(const int numevents, DIDEVICEOBJECTDATA *keybuf)
+{
+ int i;
+ SDL_keysym keysym;
+
+ /* Translate keyboard messages */
+ for ( i=0; i<numevents; ++i ) {
+ if ( keybuf[i].dwData & 0x80 ) {
+ posted = SDL_PrivateKeyboard(SDL_PRESSED,
+ TranslateKey(keybuf[i].dwOfs, &keysym, 1));
+ } else {
+ posted = SDL_PrivateKeyboard(SDL_RELEASED,
+ TranslateKey(keybuf[i].dwOfs, &keysym, 0));
+ }
+ }
+}
+
+static void post_mouse_motion(int relative, Sint16 x, Sint16 y)
+{
+ extern int mouse_relative;
+
+ if ( SDL_GetAppState() & SDL_APPMOUSEFOCUS ) {
+ posted = SDL_PrivateMouseMotion(
+ 0, relative, x, y);
+
+ if ( !mouse_relative ) {
+ /* As DirectInput reads raw device coordinates, it has no notion of
+ * cursors or absolute position. We must assume responsibility for
+ * keeping track of this. */
+ int current_x, current_y;
+ POINT cursor;
+ RECT trap;
+ RECT window;
+ int at_edge;
+
+ /* Get the current cursor position */
+ SDL_GetMouseState(&current_x, &current_y);
+ cursor.x = current_x;
+ cursor.y = current_y;
+ ClientToScreen(SDL_Window, &cursor);
+
+ /* Construct a 1 pixel square RECT that is used to confine the cursor
+ * pointer to a specific pixel using ClipCursor. This is used in
+ * preference to SetCursorPos as it avoids the cursor jumping around as
+ * both the OS and SDL attempt to move it simultaneously. */
+ trap.left = cursor.x;
+ trap.top = cursor.y;
+ trap.right = cursor.x + 1;
+ trap.bottom = cursor.y + 1;
+
+ GetClientRect(SDL_Window, &window);
+ window.right -= window.left; window.left = 0;
+ window.bottom -= window.top; window.top = 0;
+
+ /* As we're assuming control over the cursor, we need to know when to
+ * relinquish control of it back to the operating system. This is when
+ * the cursor reaches the edge of the window. */
+ at_edge = (current_x == window.left) ||
+ (current_x == (window.right - 1)) ||
+ (current_y == window.top) ||
+ (current_y == (window.bottom - 1));
+
+ if ( at_edge ) {
+ ClipCursor(NULL);
+ } else {
+ ClipCursor(&trap);
+ }
+ } else {
+ /* When in relative mode, warp the OS's idea of where the cursor is to
+ * the center of the screen. This isn't really necessary as DirectInput
+ * reads from the hardware itself, but in case things go wrong, the
+ * cursor will be left in a sensible place. */
+ POINT center;
+ center.x = (SDL_VideoSurface->w/2);
+ center.y = (SDL_VideoSurface->h/2);
+ ClientToScreen(SDL_Window, &center);
+ SetCursorPos(center.x, center.y);
+ }
+ }
+}
+
+static void handle_mouse(const int numevents, DIDEVICEOBJECTDATA *ptrbuf)
+{
+ int i;
+ Sint16 xrel, yrel;
+ Uint8 state;
+ Uint8 button;
+ DWORD timestamp = 0;
+
+ /* Sanity check. Mailing list reports this being NULL unexpectedly. */
+ if (SDL_PublicSurface == NULL) {
+ return;
+ }
+
+ /* If mouse focus has been lost, make sure we release the cursor. */
+ if ( !(SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) {
+ mouse_lost = 1;
+ ClipCursor(NULL);
+ } else {
+ /* If the mouse was lost, regain some sense of mouse state */
+ if ( mouse_lost ) {
+ POINT mouse_pos;
+ Uint8 old_state;
+ Uint8 new_state;
+
+ /* Set ourselves up with the current cursor position */
+ GetCursorPos(&mouse_pos);
+ ScreenToClient(SDL_Window, &mouse_pos);
+ post_mouse_motion( 0, (Sint16)mouse_pos.x, (Sint16)mouse_pos.y);
+
+ /* Check for mouse button changes */
+ old_state = SDL_GetMouseState(NULL, NULL);
+ new_state = 0;
+ { /* Get the new DirectInput button state for the mouse */
+ #if DIRECTINPUT_VERSION >= 0x700
+ DIMOUSESTATE2 distate;
+ #else
+ DIMOUSESTATE distate;
+ #endif
+ HRESULT result;
+
+ result=IDirectInputDevice2_GetDeviceState(SDL_DIdev[1],
+ sizeof(distate), &distate);
+ if ( result != DI_OK ) {
+ /* Try again next time */
+ SetDIerror(
+ "IDirectInputDevice2::GetDeviceState", result);
+ return;
+ }
+ for ( i=3; i>=0; --i ) {
+ if ( (distate.rgbButtons[i]&0x80) == 0x80 ) {
+ new_state |= 0x01;
+ }
+ new_state <<= 1;
+ }
+ }
+ for ( i=0; i<8; ++i ) {
+ if ( (old_state&0x01) != (new_state&0x01) ) {
+ button = (Uint8)(i+1);
+ /* Map DI button numbers to SDL */
+ switch ( button ) {
+ case 2: button = SDL_BUTTON_RIGHT; break;
+ case 3: button = SDL_BUTTON_MIDDLE; break;
+ case 4: button = SDL_BUTTON_X1; break;
+ case 5: button = SDL_BUTTON_X2; break;
+ default: break;
+ }
+ if ( new_state & 0x01 ) {
+ /* Grab mouse so we get mouse-up */
+ if ( ++mouse_pressed > 0 ) {
+ SetCapture(SDL_Window);
+ }
+ state = SDL_PRESSED;
+ } else {
+ /* Release mouse after all mouse-ups */
+ if ( --mouse_pressed <= 0 ) {
+ ReleaseCapture();
+ mouse_pressed = 0;
+ }
+ state = SDL_RELEASED;
+ }
+ if ( mouse_buttons_swapped ) {
+ if ( button == 1 ) button = 3;
+ else
+ if ( button == 3 ) button = 1;
+ }
+ posted = SDL_PrivateMouseButton(state, button,
+ 0, 0);
+ }
+ old_state >>= 1;
+ new_state >>= 1;
+ }
+ mouse_lost = 0;
+ return;
+ }
+
+ /* Translate mouse messages */
+ xrel = 0;
+ yrel = 0;
+ for ( i=0; i<(int)numevents; ++i ) {
+ switch (ptrbuf[i].dwOfs) {
+ case DIMOFS_X:
+ if ( timestamp != ptrbuf[i].dwTimeStamp ) {
+ if ( xrel || yrel ) {
+ post_mouse_motion(1, xrel, yrel);
+ xrel = 0;
+ yrel = 0;
+ }
+ timestamp = ptrbuf[i].dwTimeStamp;
+ }
+ xrel += (Sint16)ptrbuf[i].dwData;
+ break;
+ case DIMOFS_Y:
+ if ( timestamp != ptrbuf[i].dwTimeStamp ) {
+ if ( xrel || yrel ) {
+ post_mouse_motion(1, xrel, yrel);
+ xrel = 0;
+ yrel = 0;
+ }
+ timestamp = ptrbuf[i].dwTimeStamp;
+ }
+ yrel += (Sint16)ptrbuf[i].dwData;
+ break;
+ case DIMOFS_Z:
+ if ( xrel || yrel ) {
+ post_mouse_motion(1, xrel, yrel);
+ xrel = 0;
+ yrel = 0;
+ }
+ timestamp = 0;
+ if((int)ptrbuf[i].dwData > 0)
+ button = SDL_BUTTON_WHEELUP;
+ else
+ button = SDL_BUTTON_WHEELDOWN;
+ posted = SDL_PrivateMouseButton(
+ SDL_PRESSED, button, 0, 0);
+ posted |= SDL_PrivateMouseButton(
+ SDL_RELEASED, button, 0, 0);
+ break;
+ case DIMOFS_BUTTON0:
+ case DIMOFS_BUTTON1:
+ case DIMOFS_BUTTON2:
+ case DIMOFS_BUTTON3:
+ #if DIRECTINPUT_VERSION >= 0x700
+ case DIMOFS_BUTTON4:
+ case DIMOFS_BUTTON5:
+ case DIMOFS_BUTTON6:
+ case DIMOFS_BUTTON7:
+ #endif
+ if ( xrel || yrel ) {
+ post_mouse_motion(1, xrel, yrel);
+ xrel = 0;
+ yrel = 0;
+ }
+ timestamp = 0;
+ button = (Uint8)(ptrbuf[i].dwOfs-DIMOFS_BUTTON0)+1;
+ /* Map DI button numbers to SDL */
+ switch ( button ) {
+ case 2: button = SDL_BUTTON_RIGHT; break;
+ case 3: button = SDL_BUTTON_MIDDLE; break;
+ case 4: button = SDL_BUTTON_X1; break;
+ case 5: button = SDL_BUTTON_X2; break;
+ default: break;
+ }
+ if ( ptrbuf[i].dwData & 0x80 ) {
+ /* Grab mouse so we get mouse-up */
+ if ( ++mouse_pressed > 0 ) {
+ SetCapture(SDL_Window);
+ }
+ state = SDL_PRESSED;
+ } else {
+ /* Release mouse after all mouse-ups */
+ if ( --mouse_pressed <= 0 ) {
+ ReleaseCapture();
+ mouse_pressed = 0;
+ }
+ state = SDL_RELEASED;
+ }
+ if ( mouse_buttons_swapped ) {
+ if ( button == 1 ) button = 3;
+ else
+ if ( button == 3 ) button = 1;
+ }
+ posted = SDL_PrivateMouseButton(state, button,
+ 0, 0);
+ break;
+ }
+ }
+ if ( xrel || yrel ) {
+ post_mouse_motion(1, xrel, yrel);
+ }
+ }
+}
+
+/* The main Win32 event handler */
+LRESULT DX5_HandleMessage(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg) {
+#ifdef WM_ACTIVATEAPP
+ case WM_ACTIVATEAPP: {
+ int i, active;
+
+ active = (wParam && (GetForegroundWindow() == hwnd));
+ if ( active ) {
+ for ( i=0; i<MAX_INPUTS; ++i ) {
+ if (SDL_DIdev[i] != NULL)
+ IDirectInputDevice2_Acquire(
+ SDL_DIdev[i]);
+ }
+ } else {
+ for ( i=0; i<MAX_INPUTS; ++i ) {
+ if (SDL_DIdev[i] != NULL)
+ IDirectInputDevice2_Unacquire(
+ SDL_DIdev[i]);
+ }
+ mouse_lost = 1;
+ }
+ }
+ break;
+#endif /* WM_ACTIVATEAPP */
+
+#ifdef WM_DISPLAYCHANGE
+ case WM_DISPLAYCHANGE: {
+ WPARAM BitsPerPixel;
+ WORD SizeX, SizeY;
+
+ /* Ack! The display changed size and/or depth! */
+ SizeX = LOWORD(lParam);
+ SizeY = HIWORD(lParam);
+ BitsPerPixel = wParam;
+ /* We cause this message when we go fullscreen */
+ }
+ break;
+#endif /* WM_DISPLAYCHANGE */
+
+ /* The keyboard is handled via DirectInput */
+ case WM_SYSKEYUP:
+ case WM_SYSKEYDOWN:
+ case WM_KEYUP:
+ case WM_KEYDOWN: {
+ /* Ignore windows keyboard messages */;
+ }
+ return(0);
+
+#if defined(SC_SCREENSAVE) || defined(SC_MONITORPOWER)
+ /* Don't allow screen savers or monitor power downs.
+ This is because they quietly clear DirectX surfaces.
+ It would be better to allow the application to
+ decide whether or not to blow these off, but the
+ semantics of SDL_PrivateSysWMEvent() don't allow
+ the application that choice.
+ */
+ case WM_SYSCOMMAND: {
+ if ((wParam&0xFFF0)==SC_SCREENSAVE ||
+ (wParam&0xFFF0)==SC_MONITORPOWER)
+ return(0);
+ }
+ /* Fall through to default processing */
+
+#endif /* SC_SCREENSAVE || SC_MONITORPOWER */
+
+ default: {
+ /* Only post the event if we're watching for it */
+ if ( SDL_ProcessEvents[SDL_SYSWMEVENT] == SDL_ENABLE ) {
+ SDL_SysWMmsg wmmsg;
+
+ SDL_VERSION(&wmmsg.version);
+ wmmsg.hwnd = hwnd;
+ wmmsg.msg = msg;
+ wmmsg.wParam = wParam;
+ wmmsg.lParam = lParam;
+ posted = SDL_PrivateSysWMEvent(&wmmsg);
+
+ /* DJM: If the user isn't watching for private
+ messages in her SDL event loop, then pass it
+ along to any win32 specific window proc.
+ */
+ } else if (userWindowProc) {
+ return CallWindowProc(userWindowProc, hwnd, msg, wParam, lParam);
+ }
+ }
+ break;
+ }
+ return(DefWindowProc(hwnd, msg, wParam, lParam));
+}
+
+/* This function checks the windows message queue and DirectInput and returns
+ 1 if there was input, 0 if there was no input, or -1 if the application has
+ posted a quit message.
+*/
+static int DX5_CheckInput(_THIS, int timeout, BOOL processInput)
+{
+ MSG msg;
+ int i;
+ HRESULT result;
+ DWORD event;
+
+ /* Check the normal windows queue (highest preference) */
+ posted = 0;
+ while ( ! posted &&
+ PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) ) {
+ if ( GetMessage(&msg, NULL, 0, 0) > 0 ) {
+ DispatchMessage(&msg);
+ } else {
+ return(-1);
+ }
+ }
+ if ( posted ) {
+ return(1);
+ }
+
+ /* Pump the DirectInput flow */
+ if ( SDL_GetAppState() & SDL_APPMOUSEFOCUS ) {
+ for ( i=0; i<MAX_INPUTS; ++i ) {
+ if ( SDL_DIdev[i] != NULL ) {
+ result = IDirectInputDevice2_Poll(SDL_DIdev[i]);
+ if ( (result == DIERR_INPUTLOST) ||
+ (result == DIERR_NOTACQUIRED) ) {
+ if ( SDL_strcmp(inputs[i].name, "mouse") == 0 ) {
+ mouse_lost = 1;
+ }
+ IDirectInputDevice2_Acquire(SDL_DIdev[i]);
+ IDirectInputDevice2_Poll(SDL_DIdev[i]);
+ }
+ }
+ }
+ }
+
+ /* Wait for messages and input events */
+ event = MsgWaitForMultipleObjects(SDL_DIndev, SDL_DIevt, FALSE,
+ timeout, QS_ALLEVENTS);
+ if ((event >= WAIT_OBJECT_0) && (event < (WAIT_OBJECT_0+SDL_DIndev))) {
+ DWORD numevents;
+ static DIDEVICEOBJECTDATA evtbuf[INPUT_QSIZE];
+
+ event -= WAIT_OBJECT_0;
+ numevents = INPUT_QSIZE;
+ result = IDirectInputDevice2_GetDeviceData(
+ SDL_DIdev[event], sizeof(DIDEVICEOBJECTDATA),
+ evtbuf, &numevents, 0);
+ if ( (result == DIERR_INPUTLOST) ||
+ (result == DIERR_NOTACQUIRED) ) {
+ if ( SDL_strcmp(inputs[event].name, "mouse") == 0 ) {
+ mouse_lost = 1;
+ }
+ IDirectInputDevice2_Acquire(SDL_DIdev[event]);
+ result = IDirectInputDevice2_GetDeviceData(
+ SDL_DIdev[event], sizeof(DIDEVICEOBJECTDATA),
+ evtbuf, &numevents, 0);
+ }
+ /* Handle the events */
+ if ( result == DI_OK && processInput ) {
+ /* Note: This can post multiple events to event queue
+ */
+ (*SDL_DIfun[event])((int)numevents, evtbuf);
+ return(1);
+ }
+ }
+ if ( event != WAIT_TIMEOUT ) {
+ /* Maybe there was a windows message? */
+ if ( PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) ) {
+ if ( GetMessage(&msg, NULL, 0, 0) > 0 ) {
+ DispatchMessage(&msg);
+ } else {
+ return(-1);
+ }
+ return(1);
+ }
+ }
+ return(0);
+}
+
+/* Change cooperative level based on whether or not we are fullscreen */
+void DX5_DInputReset(_THIS, int fullscreen)
+{
+ DWORD level;
+ int i;
+ HRESULT result;
+ HWND topwnd;
+
+ for ( i=0; i<MAX_INPUTS; ++i ) {
+ if ( SDL_DIdev[i] != NULL ) {
+ if ( fullscreen ) {
+ level = inputs[i].raw_level;
+ } else {
+ level = inputs[i].win_level;
+ }
+ IDirectInputDevice2_Unacquire(SDL_DIdev[i]);
+ topwnd = GetTopLevelParent(SDL_Window);
+ result = IDirectInputDevice2_SetCooperativeLevel(
+ SDL_DIdev[i], topwnd, level);
+ IDirectInputDevice2_Acquire(SDL_DIdev[i]);
+ if ( result != DI_OK ) {
+ SetDIerror(
+ "DirectInputDevice::SetCooperativeLevel", result);
+ }
+ }
+ }
+ mouse_lost = 1;
+
+ /* Flush pending input */
+ DX5_CheckInput(this, 0, FALSE);
+}
+
+void DX5_PumpEvents(_THIS)
+{
+ /* Wait for messages and DirectInput */
+ while ( DX5_CheckInput(this, 0, TRUE) > 0 ) {
+ /* Loop and check again */;
+ }
+}
+
+void DX5_InitOSKeymap(_THIS)
+{
+#ifndef DIK_PAUSE
+#define DIK_PAUSE 0xC5
+#endif
+#ifndef DIK_OEM_102
+#define DIK_OEM_102 0x56 /* < > | on UK/Germany keyboards */
+#endif
+ int i;
+
+ /* Map the DIK scancodes to SDL keysyms */
+ for ( i=0; i<SDL_arraysize(DIK_keymap); ++i )
+ DIK_keymap[i] = 0;
+
+ /* Defined DIK_* constants */
+ DIK_keymap[DIK_ESCAPE] = SDLK_ESCAPE;
+ DIK_keymap[DIK_1] = SDLK_1;
+ DIK_keymap[DIK_2] = SDLK_2;
+ DIK_keymap[DIK_3] = SDLK_3;
+ DIK_keymap[DIK_4] = SDLK_4;
+ DIK_keymap[DIK_5] = SDLK_5;
+ DIK_keymap[DIK_6] = SDLK_6;
+ DIK_keymap[DIK_7] = SDLK_7;
+ DIK_keymap[DIK_8] = SDLK_8;
+ DIK_keymap[DIK_9] = SDLK_9;
+ DIK_keymap[DIK_0] = SDLK_0;
+ DIK_keymap[DIK_MINUS] = SDLK_MINUS;
+ DIK_keymap[DIK_EQUALS] = SDLK_EQUALS;
+ DIK_keymap[DIK_BACK] = SDLK_BACKSPACE;
+ DIK_keymap[DIK_TAB] = SDLK_TAB;
+ DIK_keymap[DIK_Q] = SDLK_q;
+ DIK_keymap[DIK_W] = SDLK_w;
+ DIK_keymap[DIK_E] = SDLK_e;
+ DIK_keymap[DIK_R] = SDLK_r;
+ DIK_keymap[DIK_T] = SDLK_t;
+ DIK_keymap[DIK_Y] = SDLK_y;
+ DIK_keymap[DIK_U] = SDLK_u;
+ DIK_keymap[DIK_I] = SDLK_i;
+ DIK_keymap[DIK_O] = SDLK_o;
+ DIK_keymap[DIK_P] = SDLK_p;
+ DIK_keymap[DIK_LBRACKET] = SDLK_LEFTBRACKET;
+ DIK_keymap[DIK_RBRACKET] = SDLK_RIGHTBRACKET;
+ DIK_keymap[DIK_RETURN] = SDLK_RETURN;
+ DIK_keymap[DIK_LCONTROL] = SDLK_LCTRL;
+ DIK_keymap[DIK_A] = SDLK_a;
+ DIK_keymap[DIK_S] = SDLK_s;
+ DIK_keymap[DIK_D] = SDLK_d;
+ DIK_keymap[DIK_F] = SDLK_f;
+ DIK_keymap[DIK_G] = SDLK_g;
+ DIK_keymap[DIK_H] = SDLK_h;
+ DIK_keymap[DIK_J] = SDLK_j;
+ DIK_keymap[DIK_K] = SDLK_k;
+ DIK_keymap[DIK_L] = SDLK_l;
+ DIK_keymap[DIK_SEMICOLON] = SDLK_SEMICOLON;
+ DIK_keymap[DIK_APOSTROPHE] = SDLK_QUOTE;
+ DIK_keymap[DIK_GRAVE] = SDLK_BACKQUOTE;
+ DIK_keymap[DIK_LSHIFT] = SDLK_LSHIFT;
+ DIK_keymap[DIK_BACKSLASH] = SDLK_BACKSLASH;
+ DIK_keymap[DIK_OEM_102] = SDLK_LESS;
+ DIK_keymap[DIK_Z] = SDLK_z;
+ DIK_keymap[DIK_X] = SDLK_x;
+ DIK_keymap[DIK_C] = SDLK_c;
+ DIK_keymap[DIK_V] = SDLK_v;
+ DIK_keymap[DIK_B] = SDLK_b;
+ DIK_keymap[DIK_N] = SDLK_n;
+ DIK_keymap[DIK_M] = SDLK_m;
+ DIK_keymap[DIK_COMMA] = SDLK_COMMA;
+ DIK_keymap[DIK_PERIOD] = SDLK_PERIOD;
+ DIK_keymap[DIK_SLASH] = SDLK_SLASH;
+ DIK_keymap[DIK_RSHIFT] = SDLK_RSHIFT;
+ DIK_keymap[DIK_MULTIPLY] = SDLK_KP_MULTIPLY;
+ DIK_keymap[DIK_LMENU] = SDLK_LALT;
+ DIK_keymap[DIK_SPACE] = SDLK_SPACE;
+ DIK_keymap[DIK_CAPITAL] = SDLK_CAPSLOCK;
+ DIK_keymap[DIK_F1] = SDLK_F1;
+ DIK_keymap[DIK_F2] = SDLK_F2;
+ DIK_keymap[DIK_F3] = SDLK_F3;
+ DIK_keymap[DIK_F4] = SDLK_F4;
+ DIK_keymap[DIK_F5] = SDLK_F5;
+ DIK_keymap[DIK_F6] = SDLK_F6;
+ DIK_keymap[DIK_F7] = SDLK_F7;
+ DIK_keymap[DIK_F8] = SDLK_F8;
+ DIK_keymap[DIK_F9] = SDLK_F9;
+ DIK_keymap[DIK_F10] = SDLK_F10;
+ DIK_keymap[DIK_NUMLOCK] = SDLK_NUMLOCK;
+ DIK_keymap[DIK_SCROLL] = SDLK_SCROLLOCK;
+ DIK_keymap[DIK_NUMPAD7] = SDLK_KP7;
+ DIK_keymap[DIK_NUMPAD8] = SDLK_KP8;
+ DIK_keymap[DIK_NUMPAD9] = SDLK_KP9;
+ DIK_keymap[DIK_SUBTRACT] = SDLK_KP_MINUS;
+ DIK_keymap[DIK_NUMPAD4] = SDLK_KP4;
+ DIK_keymap[DIK_NUMPAD5] = SDLK_KP5;
+ DIK_keymap[DIK_NUMPAD6] = SDLK_KP6;
+ DIK_keymap[DIK_ADD] = SDLK_KP_PLUS;
+ DIK_keymap[DIK_NUMPAD1] = SDLK_KP1;
+ DIK_keymap[DIK_NUMPAD2] = SDLK_KP2;
+ DIK_keymap[DIK_NUMPAD3] = SDLK_KP3;
+ DIK_keymap[DIK_NUMPAD0] = SDLK_KP0;
+ DIK_keymap[DIK_DECIMAL] = SDLK_KP_PERIOD;
+ DIK_keymap[DIK_F11] = SDLK_F11;
+ DIK_keymap[DIK_F12] = SDLK_F12;
+
+ DIK_keymap[DIK_F13] = SDLK_F13;
+ DIK_keymap[DIK_F14] = SDLK_F14;
+ DIK_keymap[DIK_F15] = SDLK_F15;
+
+ DIK_keymap[DIK_NUMPADEQUALS] = SDLK_KP_EQUALS;
+ DIK_keymap[DIK_NUMPADENTER] = SDLK_KP_ENTER;
+ DIK_keymap[DIK_RCONTROL] = SDLK_RCTRL;
+ DIK_keymap[DIK_DIVIDE] = SDLK_KP_DIVIDE;
+ DIK_keymap[DIK_SYSRQ] = SDLK_PRINT;
+ DIK_keymap[DIK_RMENU] = SDLK_RALT;
+ DIK_keymap[DIK_PAUSE] = SDLK_PAUSE;
+ DIK_keymap[DIK_HOME] = SDLK_HOME;
+ DIK_keymap[DIK_UP] = SDLK_UP;
+ DIK_keymap[DIK_PRIOR] = SDLK_PAGEUP;
+ DIK_keymap[DIK_LEFT] = SDLK_LEFT;
+ DIK_keymap[DIK_RIGHT] = SDLK_RIGHT;
+ DIK_keymap[DIK_END] = SDLK_END;
+ DIK_keymap[DIK_DOWN] = SDLK_DOWN;
+ DIK_keymap[DIK_NEXT] = SDLK_PAGEDOWN;
+ DIK_keymap[DIK_INSERT] = SDLK_INSERT;
+ DIK_keymap[DIK_DELETE] = SDLK_DELETE;
+ DIK_keymap[DIK_LWIN] = SDLK_LMETA;
+ DIK_keymap[DIK_RWIN] = SDLK_RMETA;
+ DIK_keymap[DIK_APPS] = SDLK_MENU;
+}
+
+static SDL_keysym *TranslateKey(UINT scancode, SDL_keysym *keysym, int pressed)
+{
+ /* Set the keysym information */
+ keysym->scancode = (unsigned char)scancode;
+ keysym->sym = DIK_keymap[scancode];
+ keysym->mod = KMOD_NONE;
+ keysym->unicode = 0;
+ if ( pressed && SDL_TranslateUNICODE ) {
+ UINT vkey;
+#ifndef NO_GETKEYBOARDSTATE
+ BYTE keystate[256];
+ Uint16 wchars[2];
+#endif
+
+ vkey = MapVirtualKey(scancode, 1);
+#ifdef NO_GETKEYBOARDSTATE
+ /* Uh oh, better hope the vkey is close enough.. */
+ keysym->unicode = vkey;
+#else
+ GetKeyboardState(keystate);
+ /* Numlock isn't taken into account in ToUnicode,
+ * so we handle it as a special case here */
+ if ((keystate[VK_NUMLOCK] & 1) && vkey >= VK_NUMPAD0 && vkey <= VK_NUMPAD9)
+ {
+ keysym->unicode = vkey - VK_NUMPAD0 + '0';
+ }
+ else if (SDL_ToUnicode(vkey, scancode, keystate, wchars, sizeof(wchars)/sizeof(wchars[0]), 0) > 0)
+ {
+ keysym->unicode = wchars[0];
+ }
+#endif /* NO_GETKEYBOARDSTATE */
+ }
+ return(keysym);
+}
+
+int DX5_CreateWindow(_THIS)
+{
+ char *windowid = SDL_getenv("SDL_WINDOWID");
+ int i;
+
+ /* Clear out DirectInput variables in case we fail */
+ for ( i=0; i<MAX_INPUTS; ++i ) {
+ SDL_DIdev[i] = NULL;
+ SDL_DIevt[i] = NULL;
+ SDL_DIfun[i] = NULL;
+ }
+
+ SDL_RegisterApp(NULL, 0, 0);
+
+ SDL_windowid = (windowid != NULL);
+ if ( SDL_windowid ) {
+ SDL_Window = (HWND)((size_t)SDL_strtoull(windowid, NULL, 0));
+ if ( SDL_Window == NULL ) {
+ SDL_SetError("Couldn't get user specified window");
+ return(-1);
+ }
+
+ /* DJM: we want all event's for the user specified
+ window to be handled by SDL.
+ */
+ userWindowProc = (WNDPROCTYPE)GetWindowLongPtr(SDL_Window, GWLP_WNDPROC);
+ SetWindowLongPtr(SDL_Window, GWLP_WNDPROC, (LONG_PTR)WinMessage);
+ } else {
+ SDL_Window = CreateWindow(SDL_Appname, SDL_Appname,
+ (WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX),
+ CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, NULL, NULL, SDL_Instance, NULL);
+ if ( SDL_Window == NULL ) {
+ SDL_SetError("Couldn't create window");
+ return(-1);
+ }
+ ShowWindow(SDL_Window, SW_HIDE);
+ }
+
+ /* Initialize DirectInput */
+ if ( DX5_DInputInit(this) < 0 ) {
+ return(-1);
+ }
+
+ /* JC 14 Mar 2006
+ Flush the message loop or this can cause big problems later
+ Especially if the user decides to use dialog boxes or assert()!
+ */
+ WIN_FlushMessageQueue();
+
+ /* Ready to roll */
+ return(0);
+}
+
+void DX5_DestroyWindow(_THIS)
+{
+ /* Close down DirectInput */
+ DX5_DInputQuit(this);
+
+ /* Destroy our window */
+ if ( SDL_windowid ) {
+ SetWindowLongPtr(SDL_Window, GWLP_WNDPROC, (LONG_PTR)userWindowProc);
+ } else {
+ DestroyWindow(SDL_Window);
+ }
+ SDL_UnregisterApp();
+
+ /* JC 14 Mar 2006
+ Flush the message loop or this can cause big problems later
+ Especially if the user decides to use dialog boxes or assert()!
+ */
+ WIN_FlushMessageQueue();
+}
diff --git a/distrib/sdl-1.2.15/src/video/windx5/SDL_dx5events_c.h b/distrib/sdl-1.2.15/src/video/windx5/SDL_dx5events_c.h
new file mode 100644
index 0000000..28e1b6c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/windx5/SDL_dx5events_c.h
@@ -0,0 +1,37 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "../wincommon/SDL_lowvideo.h"
+
+/* Variables and functions exported by SDL_dx5events.c to other parts
+ of the native video subsystem (SDL_dx5video.c)
+*/
+extern LONG
+ DX5_HandleMessage(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+extern int DX5_CreateWindow(_THIS);
+extern void DX5_DestroyWindow(_THIS);
+
+extern void DX5_PumpEvents(_THIS);
+extern void DX5_InitOSKeymap(_THIS);
+extern void DX5_DInputReset(_THIS, int fullscreen);
+
diff --git a/distrib/sdl-1.2.15/src/video/windx5/SDL_dx5video.c b/distrib/sdl-1.2.15/src/video/windx5/SDL_dx5video.c
new file mode 100644
index 0000000..f80ca97
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/windx5/SDL_dx5video.c
@@ -0,0 +1,2537 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "directx.h"
+
+/* Not yet in the mingw32 cross-compile headers */
+#ifndef CDS_FULLSCREEN
+#define CDS_FULLSCREEN 4
+#endif
+
+#include "SDL_timer.h"
+#include "SDL_events.h"
+#include "SDL_syswm.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_blit.h"
+#include "../SDL_pixels_c.h"
+#include "SDL_dx5video.h"
+#include "../wincommon/SDL_syswm_c.h"
+#include "../wincommon/SDL_sysmouse_c.h"
+#include "SDL_dx5events_c.h"
+#include "SDL_dx5yuv_c.h"
+#include "../wincommon/SDL_wingl_c.h"
+
+#ifdef _WIN32_WCE
+#define NO_CHANGEDISPLAYSETTINGS
+#endif
+#ifndef WS_MAXIMIZE
+#define WS_MAXIMIZE 0
+#endif
+#ifndef SWP_NOCOPYBITS
+#define SWP_NOCOPYBITS 0
+#endif
+#ifndef PC_NOCOLLAPSE
+#define PC_NOCOLLAPSE 0
+#endif
+
+
+/* DirectX function pointers for video and events */
+HRESULT (WINAPI *DDrawCreate)( GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter );
+HRESULT (WINAPI *DInputCreate)(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUT *ppDI, LPUNKNOWN punkOuter);
+
+/* This is the rect EnumModes2 uses */
+struct DX5EnumRect {
+ SDL_Rect r;
+ int refreshRate;
+ struct DX5EnumRect* next;
+};
+static struct DX5EnumRect *enumlists[NUM_MODELISTS];
+
+/*
+ * Experimentally determined values for c_cfDI* constants used in DirectX 5.0
+ */
+
+/* Keyboard */
+
+static DIOBJECTDATAFORMAT KBD_fmt[] = {
+ { &GUID_Key, 0, 0x8000000C, 0x00000000 },
+ { &GUID_Key, 1, 0x8000010C, 0x00000000 },
+ { &GUID_Key, 2, 0x8000020C, 0x00000000 },
+ { &GUID_Key, 3, 0x8000030C, 0x00000000 },
+ { &GUID_Key, 4, 0x8000040C, 0x00000000 },
+ { &GUID_Key, 5, 0x8000050C, 0x00000000 },
+ { &GUID_Key, 6, 0x8000060C, 0x00000000 },
+ { &GUID_Key, 7, 0x8000070C, 0x00000000 },
+ { &GUID_Key, 8, 0x8000080C, 0x00000000 },
+ { &GUID_Key, 9, 0x8000090C, 0x00000000 },
+ { &GUID_Key, 10, 0x80000A0C, 0x00000000 },
+ { &GUID_Key, 11, 0x80000B0C, 0x00000000 },
+ { &GUID_Key, 12, 0x80000C0C, 0x00000000 },
+ { &GUID_Key, 13, 0x80000D0C, 0x00000000 },
+ { &GUID_Key, 14, 0x80000E0C, 0x00000000 },
+ { &GUID_Key, 15, 0x80000F0C, 0x00000000 },
+ { &GUID_Key, 16, 0x8000100C, 0x00000000 },
+ { &GUID_Key, 17, 0x8000110C, 0x00000000 },
+ { &GUID_Key, 18, 0x8000120C, 0x00000000 },
+ { &GUID_Key, 19, 0x8000130C, 0x00000000 },
+ { &GUID_Key, 20, 0x8000140C, 0x00000000 },
+ { &GUID_Key, 21, 0x8000150C, 0x00000000 },
+ { &GUID_Key, 22, 0x8000160C, 0x00000000 },
+ { &GUID_Key, 23, 0x8000170C, 0x00000000 },
+ { &GUID_Key, 24, 0x8000180C, 0x00000000 },
+ { &GUID_Key, 25, 0x8000190C, 0x00000000 },
+ { &GUID_Key, 26, 0x80001A0C, 0x00000000 },
+ { &GUID_Key, 27, 0x80001B0C, 0x00000000 },
+ { &GUID_Key, 28, 0x80001C0C, 0x00000000 },
+ { &GUID_Key, 29, 0x80001D0C, 0x00000000 },
+ { &GUID_Key, 30, 0x80001E0C, 0x00000000 },
+ { &GUID_Key, 31, 0x80001F0C, 0x00000000 },
+ { &GUID_Key, 32, 0x8000200C, 0x00000000 },
+ { &GUID_Key, 33, 0x8000210C, 0x00000000 },
+ { &GUID_Key, 34, 0x8000220C, 0x00000000 },
+ { &GUID_Key, 35, 0x8000230C, 0x00000000 },
+ { &GUID_Key, 36, 0x8000240C, 0x00000000 },
+ { &GUID_Key, 37, 0x8000250C, 0x00000000 },
+ { &GUID_Key, 38, 0x8000260C, 0x00000000 },
+ { &GUID_Key, 39, 0x8000270C, 0x00000000 },
+ { &GUID_Key, 40, 0x8000280C, 0x00000000 },
+ { &GUID_Key, 41, 0x8000290C, 0x00000000 },
+ { &GUID_Key, 42, 0x80002A0C, 0x00000000 },
+ { &GUID_Key, 43, 0x80002B0C, 0x00000000 },
+ { &GUID_Key, 44, 0x80002C0C, 0x00000000 },
+ { &GUID_Key, 45, 0x80002D0C, 0x00000000 },
+ { &GUID_Key, 46, 0x80002E0C, 0x00000000 },
+ { &GUID_Key, 47, 0x80002F0C, 0x00000000 },
+ { &GUID_Key, 48, 0x8000300C, 0x00000000 },
+ { &GUID_Key, 49, 0x8000310C, 0x00000000 },
+ { &GUID_Key, 50, 0x8000320C, 0x00000000 },
+ { &GUID_Key, 51, 0x8000330C, 0x00000000 },
+ { &GUID_Key, 52, 0x8000340C, 0x00000000 },
+ { &GUID_Key, 53, 0x8000350C, 0x00000000 },
+ { &GUID_Key, 54, 0x8000360C, 0x00000000 },
+ { &GUID_Key, 55, 0x8000370C, 0x00000000 },
+ { &GUID_Key, 56, 0x8000380C, 0x00000000 },
+ { &GUID_Key, 57, 0x8000390C, 0x00000000 },
+ { &GUID_Key, 58, 0x80003A0C, 0x00000000 },
+ { &GUID_Key, 59, 0x80003B0C, 0x00000000 },
+ { &GUID_Key, 60, 0x80003C0C, 0x00000000 },
+ { &GUID_Key, 61, 0x80003D0C, 0x00000000 },
+ { &GUID_Key, 62, 0x80003E0C, 0x00000000 },
+ { &GUID_Key, 63, 0x80003F0C, 0x00000000 },
+ { &GUID_Key, 64, 0x8000400C, 0x00000000 },
+ { &GUID_Key, 65, 0x8000410C, 0x00000000 },
+ { &GUID_Key, 66, 0x8000420C, 0x00000000 },
+ { &GUID_Key, 67, 0x8000430C, 0x00000000 },
+ { &GUID_Key, 68, 0x8000440C, 0x00000000 },
+ { &GUID_Key, 69, 0x8000450C, 0x00000000 },
+ { &GUID_Key, 70, 0x8000460C, 0x00000000 },
+ { &GUID_Key, 71, 0x8000470C, 0x00000000 },
+ { &GUID_Key, 72, 0x8000480C, 0x00000000 },
+ { &GUID_Key, 73, 0x8000490C, 0x00000000 },
+ { &GUID_Key, 74, 0x80004A0C, 0x00000000 },
+ { &GUID_Key, 75, 0x80004B0C, 0x00000000 },
+ { &GUID_Key, 76, 0x80004C0C, 0x00000000 },
+ { &GUID_Key, 77, 0x80004D0C, 0x00000000 },
+ { &GUID_Key, 78, 0x80004E0C, 0x00000000 },
+ { &GUID_Key, 79, 0x80004F0C, 0x00000000 },
+ { &GUID_Key, 80, 0x8000500C, 0x00000000 },
+ { &GUID_Key, 81, 0x8000510C, 0x00000000 },
+ { &GUID_Key, 82, 0x8000520C, 0x00000000 },
+ { &GUID_Key, 83, 0x8000530C, 0x00000000 },
+ { &GUID_Key, 84, 0x8000540C, 0x00000000 },
+ { &GUID_Key, 85, 0x8000550C, 0x00000000 },
+ { &GUID_Key, 86, 0x8000560C, 0x00000000 },
+ { &GUID_Key, 87, 0x8000570C, 0x00000000 },
+ { &GUID_Key, 88, 0x8000580C, 0x00000000 },
+ { &GUID_Key, 89, 0x8000590C, 0x00000000 },
+ { &GUID_Key, 90, 0x80005A0C, 0x00000000 },
+ { &GUID_Key, 91, 0x80005B0C, 0x00000000 },
+ { &GUID_Key, 92, 0x80005C0C, 0x00000000 },
+ { &GUID_Key, 93, 0x80005D0C, 0x00000000 },
+ { &GUID_Key, 94, 0x80005E0C, 0x00000000 },
+ { &GUID_Key, 95, 0x80005F0C, 0x00000000 },
+ { &GUID_Key, 96, 0x8000600C, 0x00000000 },
+ { &GUID_Key, 97, 0x8000610C, 0x00000000 },
+ { &GUID_Key, 98, 0x8000620C, 0x00000000 },
+ { &GUID_Key, 99, 0x8000630C, 0x00000000 },
+ { &GUID_Key, 100, 0x8000640C, 0x00000000 },
+ { &GUID_Key, 101, 0x8000650C, 0x00000000 },
+ { &GUID_Key, 102, 0x8000660C, 0x00000000 },
+ { &GUID_Key, 103, 0x8000670C, 0x00000000 },
+ { &GUID_Key, 104, 0x8000680C, 0x00000000 },
+ { &GUID_Key, 105, 0x8000690C, 0x00000000 },
+ { &GUID_Key, 106, 0x80006A0C, 0x00000000 },
+ { &GUID_Key, 107, 0x80006B0C, 0x00000000 },
+ { &GUID_Key, 108, 0x80006C0C, 0x00000000 },
+ { &GUID_Key, 109, 0x80006D0C, 0x00000000 },
+ { &GUID_Key, 110, 0x80006E0C, 0x00000000 },
+ { &GUID_Key, 111, 0x80006F0C, 0x00000000 },
+ { &GUID_Key, 112, 0x8000700C, 0x00000000 },
+ { &GUID_Key, 113, 0x8000710C, 0x00000000 },
+ { &GUID_Key, 114, 0x8000720C, 0x00000000 },
+ { &GUID_Key, 115, 0x8000730C, 0x00000000 },
+ { &GUID_Key, 116, 0x8000740C, 0x00000000 },
+ { &GUID_Key, 117, 0x8000750C, 0x00000000 },
+ { &GUID_Key, 118, 0x8000760C, 0x00000000 },
+ { &GUID_Key, 119, 0x8000770C, 0x00000000 },
+ { &GUID_Key, 120, 0x8000780C, 0x00000000 },
+ { &GUID_Key, 121, 0x8000790C, 0x00000000 },
+ { &GUID_Key, 122, 0x80007A0C, 0x00000000 },
+ { &GUID_Key, 123, 0x80007B0C, 0x00000000 },
+ { &GUID_Key, 124, 0x80007C0C, 0x00000000 },
+ { &GUID_Key, 125, 0x80007D0C, 0x00000000 },
+ { &GUID_Key, 126, 0x80007E0C, 0x00000000 },
+ { &GUID_Key, 127, 0x80007F0C, 0x00000000 },
+ { &GUID_Key, 128, 0x8000800C, 0x00000000 },
+ { &GUID_Key, 129, 0x8000810C, 0x00000000 },
+ { &GUID_Key, 130, 0x8000820C, 0x00000000 },
+ { &GUID_Key, 131, 0x8000830C, 0x00000000 },
+ { &GUID_Key, 132, 0x8000840C, 0x00000000 },
+ { &GUID_Key, 133, 0x8000850C, 0x00000000 },
+ { &GUID_Key, 134, 0x8000860C, 0x00000000 },
+ { &GUID_Key, 135, 0x8000870C, 0x00000000 },
+ { &GUID_Key, 136, 0x8000880C, 0x00000000 },
+ { &GUID_Key, 137, 0x8000890C, 0x00000000 },
+ { &GUID_Key, 138, 0x80008A0C, 0x00000000 },
+ { &GUID_Key, 139, 0x80008B0C, 0x00000000 },
+ { &GUID_Key, 140, 0x80008C0C, 0x00000000 },
+ { &GUID_Key, 141, 0x80008D0C, 0x00000000 },
+ { &GUID_Key, 142, 0x80008E0C, 0x00000000 },
+ { &GUID_Key, 143, 0x80008F0C, 0x00000000 },
+ { &GUID_Key, 144, 0x8000900C, 0x00000000 },
+ { &GUID_Key, 145, 0x8000910C, 0x00000000 },
+ { &GUID_Key, 146, 0x8000920C, 0x00000000 },
+ { &GUID_Key, 147, 0x8000930C, 0x00000000 },
+ { &GUID_Key, 148, 0x8000940C, 0x00000000 },
+ { &GUID_Key, 149, 0x8000950C, 0x00000000 },
+ { &GUID_Key, 150, 0x8000960C, 0x00000000 },
+ { &GUID_Key, 151, 0x8000970C, 0x00000000 },
+ { &GUID_Key, 152, 0x8000980C, 0x00000000 },
+ { &GUID_Key, 153, 0x8000990C, 0x00000000 },
+ { &GUID_Key, 154, 0x80009A0C, 0x00000000 },
+ { &GUID_Key, 155, 0x80009B0C, 0x00000000 },
+ { &GUID_Key, 156, 0x80009C0C, 0x00000000 },
+ { &GUID_Key, 157, 0x80009D0C, 0x00000000 },
+ { &GUID_Key, 158, 0x80009E0C, 0x00000000 },
+ { &GUID_Key, 159, 0x80009F0C, 0x00000000 },
+ { &GUID_Key, 160, 0x8000A00C, 0x00000000 },
+ { &GUID_Key, 161, 0x8000A10C, 0x00000000 },
+ { &GUID_Key, 162, 0x8000A20C, 0x00000000 },
+ { &GUID_Key, 163, 0x8000A30C, 0x00000000 },
+ { &GUID_Key, 164, 0x8000A40C, 0x00000000 },
+ { &GUID_Key, 165, 0x8000A50C, 0x00000000 },
+ { &GUID_Key, 166, 0x8000A60C, 0x00000000 },
+ { &GUID_Key, 167, 0x8000A70C, 0x00000000 },
+ { &GUID_Key, 168, 0x8000A80C, 0x00000000 },
+ { &GUID_Key, 169, 0x8000A90C, 0x00000000 },
+ { &GUID_Key, 170, 0x8000AA0C, 0x00000000 },
+ { &GUID_Key, 171, 0x8000AB0C, 0x00000000 },
+ { &GUID_Key, 172, 0x8000AC0C, 0x00000000 },
+ { &GUID_Key, 173, 0x8000AD0C, 0x00000000 },
+ { &GUID_Key, 174, 0x8000AE0C, 0x00000000 },
+ { &GUID_Key, 175, 0x8000AF0C, 0x00000000 },
+ { &GUID_Key, 176, 0x8000B00C, 0x00000000 },
+ { &GUID_Key, 177, 0x8000B10C, 0x00000000 },
+ { &GUID_Key, 178, 0x8000B20C, 0x00000000 },
+ { &GUID_Key, 179, 0x8000B30C, 0x00000000 },
+ { &GUID_Key, 180, 0x8000B40C, 0x00000000 },
+ { &GUID_Key, 181, 0x8000B50C, 0x00000000 },
+ { &GUID_Key, 182, 0x8000B60C, 0x00000000 },
+ { &GUID_Key, 183, 0x8000B70C, 0x00000000 },
+ { &GUID_Key, 184, 0x8000B80C, 0x00000000 },
+ { &GUID_Key, 185, 0x8000B90C, 0x00000000 },
+ { &GUID_Key, 186, 0x8000BA0C, 0x00000000 },
+ { &GUID_Key, 187, 0x8000BB0C, 0x00000000 },
+ { &GUID_Key, 188, 0x8000BC0C, 0x00000000 },
+ { &GUID_Key, 189, 0x8000BD0C, 0x00000000 },
+ { &GUID_Key, 190, 0x8000BE0C, 0x00000000 },
+ { &GUID_Key, 191, 0x8000BF0C, 0x00000000 },
+ { &GUID_Key, 192, 0x8000C00C, 0x00000000 },
+ { &GUID_Key, 193, 0x8000C10C, 0x00000000 },
+ { &GUID_Key, 194, 0x8000C20C, 0x00000000 },
+ { &GUID_Key, 195, 0x8000C30C, 0x00000000 },
+ { &GUID_Key, 196, 0x8000C40C, 0x00000000 },
+ { &GUID_Key, 197, 0x8000C50C, 0x00000000 },
+ { &GUID_Key, 198, 0x8000C60C, 0x00000000 },
+ { &GUID_Key, 199, 0x8000C70C, 0x00000000 },
+ { &GUID_Key, 200, 0x8000C80C, 0x00000000 },
+ { &GUID_Key, 201, 0x8000C90C, 0x00000000 },
+ { &GUID_Key, 202, 0x8000CA0C, 0x00000000 },
+ { &GUID_Key, 203, 0x8000CB0C, 0x00000000 },
+ { &GUID_Key, 204, 0x8000CC0C, 0x00000000 },
+ { &GUID_Key, 205, 0x8000CD0C, 0x00000000 },
+ { &GUID_Key, 206, 0x8000CE0C, 0x00000000 },
+ { &GUID_Key, 207, 0x8000CF0C, 0x00000000 },
+ { &GUID_Key, 208, 0x8000D00C, 0x00000000 },
+ { &GUID_Key, 209, 0x8000D10C, 0x00000000 },
+ { &GUID_Key, 210, 0x8000D20C, 0x00000000 },
+ { &GUID_Key, 211, 0x8000D30C, 0x00000000 },
+ { &GUID_Key, 212, 0x8000D40C, 0x00000000 },
+ { &GUID_Key, 213, 0x8000D50C, 0x00000000 },
+ { &GUID_Key, 214, 0x8000D60C, 0x00000000 },
+ { &GUID_Key, 215, 0x8000D70C, 0x00000000 },
+ { &GUID_Key, 216, 0x8000D80C, 0x00000000 },
+ { &GUID_Key, 217, 0x8000D90C, 0x00000000 },
+ { &GUID_Key, 218, 0x8000DA0C, 0x00000000 },
+ { &GUID_Key, 219, 0x8000DB0C, 0x00000000 },
+ { &GUID_Key, 220, 0x8000DC0C, 0x00000000 },
+ { &GUID_Key, 221, 0x8000DD0C, 0x00000000 },
+ { &GUID_Key, 222, 0x8000DE0C, 0x00000000 },
+ { &GUID_Key, 223, 0x8000DF0C, 0x00000000 },
+ { &GUID_Key, 224, 0x8000E00C, 0x00000000 },
+ { &GUID_Key, 225, 0x8000E10C, 0x00000000 },
+ { &GUID_Key, 226, 0x8000E20C, 0x00000000 },
+ { &GUID_Key, 227, 0x8000E30C, 0x00000000 },
+ { &GUID_Key, 228, 0x8000E40C, 0x00000000 },
+ { &GUID_Key, 229, 0x8000E50C, 0x00000000 },
+ { &GUID_Key, 230, 0x8000E60C, 0x00000000 },
+ { &GUID_Key, 231, 0x8000E70C, 0x00000000 },
+ { &GUID_Key, 232, 0x8000E80C, 0x00000000 },
+ { &GUID_Key, 233, 0x8000E90C, 0x00000000 },
+ { &GUID_Key, 234, 0x8000EA0C, 0x00000000 },
+ { &GUID_Key, 235, 0x8000EB0C, 0x00000000 },
+ { &GUID_Key, 236, 0x8000EC0C, 0x00000000 },
+ { &GUID_Key, 237, 0x8000ED0C, 0x00000000 },
+ { &GUID_Key, 238, 0x8000EE0C, 0x00000000 },
+ { &GUID_Key, 239, 0x8000EF0C, 0x00000000 },
+ { &GUID_Key, 240, 0x8000F00C, 0x00000000 },
+ { &GUID_Key, 241, 0x8000F10C, 0x00000000 },
+ { &GUID_Key, 242, 0x8000F20C, 0x00000000 },
+ { &GUID_Key, 243, 0x8000F30C, 0x00000000 },
+ { &GUID_Key, 244, 0x8000F40C, 0x00000000 },
+ { &GUID_Key, 245, 0x8000F50C, 0x00000000 },
+ { &GUID_Key, 246, 0x8000F60C, 0x00000000 },
+ { &GUID_Key, 247, 0x8000F70C, 0x00000000 },
+ { &GUID_Key, 248, 0x8000F80C, 0x00000000 },
+ { &GUID_Key, 249, 0x8000F90C, 0x00000000 },
+ { &GUID_Key, 250, 0x8000FA0C, 0x00000000 },
+ { &GUID_Key, 251, 0x8000FB0C, 0x00000000 },
+ { &GUID_Key, 252, 0x8000FC0C, 0x00000000 },
+ { &GUID_Key, 253, 0x8000FD0C, 0x00000000 },
+ { &GUID_Key, 254, 0x8000FE0C, 0x00000000 },
+ { &GUID_Key, 255, 0x8000FF0C, 0x00000000 },
+};
+
+const DIDATAFORMAT c_dfDIKeyboard = { sizeof(DIDATAFORMAT), sizeof(DIOBJECTDATAFORMAT), 0x00000002, 256, 256, KBD_fmt };
+
+
+/* Mouse */
+
+static DIOBJECTDATAFORMAT PTR_fmt[] = {
+ { &GUID_XAxis, 0, 0x00FFFF03, 0x00000000 },
+ { &GUID_YAxis, 4, 0x00FFFF03, 0x00000000 },
+ { &GUID_ZAxis, 8, 0x80FFFF03, 0x00000000 },
+ { NULL, 12, 0x00FFFF0C, 0x00000000 },
+ { NULL, 13, 0x00FFFF0C, 0x00000000 },
+ { NULL, 14, 0x80FFFF0C, 0x00000000 },
+ { NULL, 15, 0x80FFFF0C, 0x00000000 },
+};
+
+const DIDATAFORMAT c_dfDIMouse = { sizeof(DIDATAFORMAT), sizeof(DIOBJECTDATAFORMAT), 0x00000002, 16, 7, PTR_fmt };
+
+static DIOBJECTDATAFORMAT PTR2_fmt[] = {
+ { &GUID_XAxis, 0, 0x00FFFF03, 0x00000000 },
+ { &GUID_YAxis, 4, 0x00FFFF03, 0x00000000 },
+ { &GUID_ZAxis, 8, 0x80FFFF03, 0x00000000 },
+ { NULL, 12, 0x00FFFF0C, 0x00000000 },
+ { NULL, 13, 0x00FFFF0C, 0x00000000 },
+ { NULL, 14, 0x80FFFF0C, 0x00000000 },
+ { NULL, 15, 0x80FFFF0C, 0x00000000 },
+ { NULL, 16, 0x80FFFF0C, 0x00000000 },
+ { NULL, 17, 0x80FFFF0C, 0x00000000 },
+ { NULL, 18, 0x80FFFF0C, 0x00000000 },
+ { NULL, 19, 0x80FFFF0C, 0x00000000 }
+};
+
+const DIDATAFORMAT c_dfDIMouse2 = { sizeof(DIDATAFORMAT), sizeof(DIOBJECTDATAFORMAT), 0x00000002, 20, 11, PTR2_fmt };
+
+
+/* Joystick */
+
+static DIOBJECTDATAFORMAT JOY_fmt[] = {
+ { &GUID_XAxis, 0, 0x80FFFF03, 0x00000100 },
+ { &GUID_YAxis, 4, 0x80FFFF03, 0x00000100 },
+ { &GUID_ZAxis, 8, 0x80FFFF03, 0x00000100 },
+ { &GUID_RxAxis, 12, 0x80FFFF03, 0x00000100 },
+ { &GUID_RyAxis, 16, 0x80FFFF03, 0x00000100 },
+ { &GUID_RzAxis, 20, 0x80FFFF03, 0x00000100 },
+ { &GUID_Slider, 24, 0x80FFFF03, 0x00000100 },
+ { &GUID_Slider, 28, 0x80FFFF03, 0x00000100 },
+ { &GUID_POV, 32, 0x80FFFF10, 0x00000000 },
+ { &GUID_POV, 36, 0x80FFFF10, 0x00000000 },
+ { &GUID_POV, 40, 0x80FFFF10, 0x00000000 },
+ { &GUID_POV, 44, 0x80FFFF10, 0x00000000 },
+ { NULL, 48, 0x80FFFF0C, 0x00000000 },
+ { NULL, 49, 0x80FFFF0C, 0x00000000 },
+ { NULL, 50, 0x80FFFF0C, 0x00000000 },
+ { NULL, 51, 0x80FFFF0C, 0x00000000 },
+ { NULL, 52, 0x80FFFF0C, 0x00000000 },
+ { NULL, 53, 0x80FFFF0C, 0x00000000 },
+ { NULL, 54, 0x80FFFF0C, 0x00000000 },
+ { NULL, 55, 0x80FFFF0C, 0x00000000 },
+ { NULL, 56, 0x80FFFF0C, 0x00000000 },
+ { NULL, 57, 0x80FFFF0C, 0x00000000 },
+ { NULL, 58, 0x80FFFF0C, 0x00000000 },
+ { NULL, 59, 0x80FFFF0C, 0x00000000 },
+ { NULL, 60, 0x80FFFF0C, 0x00000000 },
+ { NULL, 61, 0x80FFFF0C, 0x00000000 },
+ { NULL, 62, 0x80FFFF0C, 0x00000000 },
+ { NULL, 63, 0x80FFFF0C, 0x00000000 },
+ { NULL, 64, 0x80FFFF0C, 0x00000000 },
+ { NULL, 65, 0x80FFFF0C, 0x00000000 },
+ { NULL, 66, 0x80FFFF0C, 0x00000000 },
+ { NULL, 67, 0x80FFFF0C, 0x00000000 },
+ { NULL, 68, 0x80FFFF0C, 0x00000000 },
+ { NULL, 69, 0x80FFFF0C, 0x00000000 },
+ { NULL, 70, 0x80FFFF0C, 0x00000000 },
+ { NULL, 71, 0x80FFFF0C, 0x00000000 },
+ { NULL, 72, 0x80FFFF0C, 0x00000000 },
+ { NULL, 73, 0x80FFFF0C, 0x00000000 },
+ { NULL, 74, 0x80FFFF0C, 0x00000000 },
+ { NULL, 75, 0x80FFFF0C, 0x00000000 },
+ { NULL, 76, 0x80FFFF0C, 0x00000000 },
+ { NULL, 77, 0x80FFFF0C, 0x00000000 },
+ { NULL, 78, 0x80FFFF0C, 0x00000000 },
+ { NULL, 79, 0x80FFFF0C, 0x00000000 },
+};
+
+const DIDATAFORMAT c_dfDIJoystick = { sizeof(DIDATAFORMAT), sizeof(DIOBJECTDATAFORMAT), 0x00000001, 80, 44, JOY_fmt };
+
+
+/* Initialization/Query functions */
+static int DX5_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **DX5_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int DX5_SetColors(_THIS, int firstcolor, int ncolors,
+ SDL_Color *colors);
+static int DX5_SetGammaRamp(_THIS, Uint16 *ramp);
+static int DX5_GetGammaRamp(_THIS, Uint16 *ramp);
+static void DX5_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int DX5_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int DX5_CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst);
+static int DX5_FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);
+static int DX5_SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key);
+static int DX5_SetHWAlpha(_THIS, SDL_Surface *surface, Uint8 alpha);
+static int DX5_LockHWSurface(_THIS, SDL_Surface *surface);
+static void DX5_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static int DX5_FlipHWSurface(_THIS, SDL_Surface *surface);
+static void DX5_FreeHWSurface(_THIS, SDL_Surface *surface);
+
+static int DX5_AllocDDSurface(_THIS, SDL_Surface *surface,
+ LPDIRECTDRAWSURFACE3 requested, Uint32 flag);
+
+/* Windows message handling functions */
+static void DX5_Activate(_THIS, BOOL active, BOOL minimized);
+static void DX5_RealizePalette(_THIS);
+static void DX5_PaletteChanged(_THIS, HWND window);
+static void DX5_WinPAINT(_THIS, HDC hdc);
+
+/* WinDIB driver functions for manipulating gamma ramps */
+extern int DIB_SetGammaRamp(_THIS, Uint16 *ramp);
+extern int DIB_GetGammaRamp(_THIS, Uint16 *ramp);
+extern void DIB_QuitGamma(_THIS);
+
+/* DX5 driver bootstrap functions */
+
+static int DX5_Available(void)
+{
+ HINSTANCE DInputDLL;
+ HINSTANCE DDrawDLL;
+ int dinput_ok;
+ int ddraw_ok;
+
+ /* Version check DINPUT.DLL and DDRAW.DLL (Is DirectX okay?) */
+ dinput_ok = 0;
+ DInputDLL = LoadLibrary(TEXT("DINPUT.DLL"));
+ if ( DInputDLL != NULL ) {
+ dinput_ok = 1;
+ FreeLibrary(DInputDLL);
+ }
+ ddraw_ok = 0;
+ DDrawDLL = LoadLibrary(TEXT("DDRAW.DLL"));
+ if ( DDrawDLL != NULL ) {
+ HRESULT (WINAPI *DDrawCreate)(GUID *,LPDIRECTDRAW *,IUnknown *);
+ LPDIRECTDRAW DDraw;
+
+ /* Try to create a valid DirectDraw object */
+ DDrawCreate = (void *)GetProcAddress(DDrawDLL, TEXT("DirectDrawCreate"));
+ if ( (DDrawCreate != NULL)
+ && !FAILED(DDrawCreate(NULL, &DDraw, NULL)) ) {
+ if ( !FAILED(IDirectDraw_SetCooperativeLevel(DDraw,
+ NULL, DDSCL_NORMAL)) ) {
+ DDSURFACEDESC desc;
+ LPDIRECTDRAWSURFACE DDrawSurf;
+ LPDIRECTDRAWSURFACE3 DDrawSurf3;
+
+ /* Try to create a DirectDrawSurface3 object */
+ SDL_memset(&desc, 0, sizeof(desc));
+ desc.dwSize = sizeof(desc);
+ desc.dwFlags = DDSD_CAPS;
+ desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE|DDSCAPS_VIDEOMEMORY;
+ if ( !FAILED(IDirectDraw_CreateSurface(DDraw, &desc,
+ &DDrawSurf, NULL)) ) {
+ if ( !FAILED(IDirectDrawSurface_QueryInterface(DDrawSurf,
+ &IID_IDirectDrawSurface3, (LPVOID *)&DDrawSurf3)) ) {
+ /* Yay! */
+ ddraw_ok = 1;
+
+ /* Clean up.. */
+ IDirectDrawSurface3_Release(DDrawSurf3);
+ }
+ IDirectDrawSurface_Release(DDrawSurf);
+ }
+ }
+ IDirectDraw_Release(DDraw);
+ }
+ FreeLibrary(DDrawDLL);
+ }
+ return(dinput_ok && ddraw_ok);
+}
+
+/* Functions for loading the DirectX functions dynamically */
+static HINSTANCE DDrawDLL = NULL;
+static HINSTANCE DInputDLL = NULL;
+
+static void DX5_Unload(void)
+{
+ if ( DDrawDLL != NULL ) {
+ FreeLibrary(DDrawDLL);
+ DDrawCreate = NULL;
+ DDrawDLL = NULL;
+ }
+ if ( DInputDLL != NULL ) {
+ FreeLibrary(DInputDLL);
+ DInputCreate = NULL;
+ DInputDLL = NULL;
+ }
+}
+static int DX5_Load(void)
+{
+ int status;
+
+ DX5_Unload();
+ DDrawDLL = LoadLibrary(TEXT("DDRAW.DLL"));
+ if ( DDrawDLL != NULL ) {
+ DDrawCreate = (void *)GetProcAddress(DDrawDLL,
+ TEXT("DirectDrawCreate"));
+ }
+ DInputDLL = LoadLibrary(TEXT("DINPUT.DLL"));
+ if ( DInputDLL != NULL ) {
+ DInputCreate = (void *)GetProcAddress(DInputDLL,
+ TEXT("DirectInputCreateA"));
+ }
+ if ( DDrawDLL && DDrawCreate && DInputDLL && DInputCreate ) {
+ status = 0;
+ } else {
+ DX5_Unload();
+ status = -1;
+ }
+ return status;
+}
+
+static void DX5_DeleteDevice(SDL_VideoDevice *this)
+{
+ /* Free DirectDraw object */
+ if ( ddraw2 != NULL ) {
+ IDirectDraw2_Release(ddraw2);
+ }
+ DX5_Unload();
+ if ( this ) {
+ if ( this->hidden ) {
+ SDL_free(this->hidden);
+ }
+ if ( this->gl_data ) {
+ SDL_free(this->gl_data);
+ }
+ SDL_free(this);
+ }
+}
+
+static SDL_VideoDevice *DX5_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device;
+
+ /* Load DirectX */
+ if ( DX5_Load() < 0 ) {
+ return(NULL);
+ }
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *device->hidden));
+ device->gl_data = (struct SDL_PrivateGLData *)
+ SDL_malloc((sizeof *device->gl_data));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ||
+ (device->gl_data == NULL) ) {
+ SDL_OutOfMemory();
+ DX5_DeleteDevice(device);
+ return(NULL);
+ }
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+ SDL_memset(device->gl_data, 0, (sizeof *device->gl_data));
+
+ /* Set the function pointers */
+ device->VideoInit = DX5_VideoInit;
+ device->ListModes = DX5_ListModes;
+ device->SetVideoMode = DX5_SetVideoMode;
+ device->UpdateMouse = WIN_UpdateMouse;
+ device->CreateYUVOverlay = DX5_CreateYUVOverlay;
+ device->SetColors = DX5_SetColors;
+ device->UpdateRects = NULL;
+ device->VideoQuit = DX5_VideoQuit;
+ device->AllocHWSurface = DX5_AllocHWSurface;
+ device->CheckHWBlit = DX5_CheckHWBlit;
+ device->FillHWRect = DX5_FillHWRect;
+ device->SetHWColorKey = DX5_SetHWColorKey;
+ device->SetHWAlpha = DX5_SetHWAlpha;
+ device->LockHWSurface = DX5_LockHWSurface;
+ device->UnlockHWSurface = DX5_UnlockHWSurface;
+ device->FlipHWSurface = DX5_FlipHWSurface;
+ device->FreeHWSurface = DX5_FreeHWSurface;
+ device->SetGammaRamp = DX5_SetGammaRamp;
+ device->GetGammaRamp = DX5_GetGammaRamp;
+#if SDL_VIDEO_OPENGL
+ device->GL_LoadLibrary = WIN_GL_LoadLibrary;
+ device->GL_GetProcAddress = WIN_GL_GetProcAddress;
+ device->GL_GetAttribute = WIN_GL_GetAttribute;
+ device->GL_MakeCurrent = WIN_GL_MakeCurrent;
+ device->GL_SwapBuffers = WIN_GL_SwapBuffers;
+#endif
+ device->SetCaption = WIN_SetWMCaption;
+ device->SetIcon = WIN_SetWMIcon;
+ device->IconifyWindow = WIN_IconifyWindow;
+ device->GrabInput = WIN_GrabInput;
+ device->GetWMInfo = WIN_GetWMInfo;
+ device->FreeWMCursor = WIN_FreeWMCursor;
+ device->CreateWMCursor = WIN_CreateWMCursor;
+ device->ShowWMCursor = WIN_ShowWMCursor;
+ device->WarpWMCursor = WIN_WarpWMCursor;
+ device->CheckMouseMode = WIN_CheckMouseMode;
+ device->InitOSKeymap = DX5_InitOSKeymap;
+ device->PumpEvents = DX5_PumpEvents;
+
+ /* Set up the windows message handling functions */
+ WIN_Activate = DX5_Activate;
+ WIN_RealizePalette = DX5_RealizePalette;
+ WIN_PaletteChanged = DX5_PaletteChanged;
+ WIN_WinPAINT = DX5_WinPAINT;
+ HandleMessage = DX5_HandleMessage;
+
+ device->free = DX5_DeleteDevice;
+
+ /* We're finally ready */
+ return device;
+}
+
+VideoBootStrap DIRECTX_bootstrap = {
+ "directx", "Win95/98/2000 DirectX",
+ DX5_Available, DX5_CreateDevice
+};
+
+static int cmpmodes(const void *va, const void *vb)
+{
+ SDL_Rect *a = *(SDL_Rect **)va;
+ SDL_Rect *b = *(SDL_Rect **)vb;
+ if ( a->w == b->w )
+ return b->h - a->h;
+ else
+ return b->w - a->w;
+}
+
+static HRESULT WINAPI EnumModes2(DDSURFACEDESC *desc, VOID *udata)
+{
+ SDL_VideoDevice *this = (SDL_VideoDevice *)udata;
+ struct DX5EnumRect *enumrect;
+#if defined(NONAMELESSUNION)
+ int bpp = desc->ddpfPixelFormat.u1.dwRGBBitCount;
+ int refreshRate = desc->u2.dwRefreshRate;
+#else
+ int bpp = desc->ddpfPixelFormat.dwRGBBitCount;
+ int refreshRate = desc->dwRefreshRate;
+#endif
+ int maxRefreshRate;
+
+ if ( desc->dwWidth <= SDL_desktop_mode.dmPelsWidth &&
+ desc->dwHeight <= SDL_desktop_mode.dmPelsHeight ) {
+ maxRefreshRate = SDL_desktop_mode.dmDisplayFrequency;
+ } else {
+ maxRefreshRate = 85; /* safe value? */
+ }
+
+ switch (bpp) {
+ case 8:
+ case 16:
+ case 24:
+ case 32:
+ bpp /= 8; --bpp;
+ if ( enumlists[bpp] &&
+ enumlists[bpp]->r.w == (Uint16)desc->dwWidth &&
+ enumlists[bpp]->r.h == (Uint16)desc->dwHeight ) {
+ if ( refreshRate > enumlists[bpp]->refreshRate &&
+ refreshRate <= maxRefreshRate ) {
+ enumlists[bpp]->refreshRate = refreshRate;
+#ifdef DDRAW_DEBUG
+ fprintf(stderr, "New refresh rate for %d bpp: %dx%d at %d Hz\n", (bpp+1)*8, (int)desc->dwWidth, (int)desc->dwHeight, refreshRate);
+#endif
+ }
+ break;
+ }
+ ++SDL_nummodes[bpp];
+ enumrect = (struct DX5EnumRect*)SDL_malloc(sizeof(struct DX5EnumRect));
+ if ( !enumrect ) {
+ SDL_OutOfMemory();
+ return(DDENUMRET_CANCEL);
+ }
+ enumrect->refreshRate = refreshRate;
+ enumrect->r.x = 0;
+ enumrect->r.y = 0;
+ enumrect->r.w = (Uint16)desc->dwWidth;
+ enumrect->r.h = (Uint16)desc->dwHeight;
+ enumrect->next = enumlists[bpp];
+ enumlists[bpp] = enumrect;
+#ifdef DDRAW_DEBUG
+ fprintf(stderr, "New mode for %d bpp: %dx%d at %d Hz\n", (bpp+1)*8, (int)desc->dwWidth, (int)desc->dwHeight, refreshRate);
+#endif
+ break;
+ }
+
+ return(DDENUMRET_OK);
+}
+
+void SetDDerror(const char *function, int code)
+{
+ static char *error;
+ static char errbuf[1024];
+
+ errbuf[0] = 0;
+ switch (code) {
+ case DDERR_GENERIC:
+ error = "Undefined error!";
+ break;
+ case DDERR_EXCEPTION:
+ error = "Exception encountered";
+ break;
+ case DDERR_INVALIDOBJECT:
+ error = "Invalid object";
+ break;
+ case DDERR_INVALIDPARAMS:
+ error = "Invalid parameters";
+ break;
+ case DDERR_NOTFOUND:
+ error = "Object not found";
+ break;
+ case DDERR_INVALIDRECT:
+ error = "Invalid rectangle";
+ break;
+ case DDERR_INVALIDCAPS:
+ error = "Invalid caps member";
+ break;
+ case DDERR_INVALIDPIXELFORMAT:
+ error = "Invalid pixel format";
+ break;
+ case DDERR_OUTOFMEMORY:
+ error = "Out of memory";
+ break;
+ case DDERR_OUTOFVIDEOMEMORY:
+ error = "Out of video memory";
+ break;
+ case DDERR_SURFACEBUSY:
+ error = "Surface busy";
+ break;
+ case DDERR_SURFACELOST:
+ error = "Surface was lost";
+ break;
+ case DDERR_WASSTILLDRAWING:
+ error = "DirectDraw is still drawing";
+ break;
+ case DDERR_INVALIDSURFACETYPE:
+ error = "Invalid surface type";
+ break;
+ case DDERR_NOEXCLUSIVEMODE:
+ error = "Not in exclusive access mode";
+ break;
+ case DDERR_NOPALETTEATTACHED:
+ error = "No palette attached";
+ break;
+ case DDERR_NOPALETTEHW:
+ error = "No palette hardware";
+ break;
+ case DDERR_NOT8BITCOLOR:
+ error = "Not 8-bit color";
+ break;
+ case DDERR_EXCLUSIVEMODEALREADYSET:
+ error = "Exclusive mode was already set";
+ break;
+ case DDERR_HWNDALREADYSET:
+ error = "Window handle already set";
+ break;
+ case DDERR_HWNDSUBCLASSED:
+ error = "Window handle is subclassed";
+ break;
+ case DDERR_NOBLTHW:
+ error = "No blit hardware";
+ break;
+ case DDERR_IMPLICITLYCREATED:
+ error = "Surface was implicitly created";
+ break;
+ case DDERR_INCOMPATIBLEPRIMARY:
+ error = "Incompatible primary surface";
+ break;
+ case DDERR_NOCOOPERATIVELEVELSET:
+ error = "No cooperative level set";
+ break;
+ case DDERR_NODIRECTDRAWHW:
+ error = "No DirectDraw hardware";
+ break;
+ case DDERR_NOEMULATION:
+ error = "No emulation available";
+ break;
+ case DDERR_NOFLIPHW:
+ error = "No flip hardware";
+ break;
+ case DDERR_NOTFLIPPABLE:
+ error = "Surface not flippable";
+ break;
+ case DDERR_PRIMARYSURFACEALREADYEXISTS:
+ error = "Primary surface already exists";
+ break;
+ case DDERR_UNSUPPORTEDMODE:
+ error = "Unsupported mode";
+ break;
+ case DDERR_WRONGMODE:
+ error = "Surface created in different mode";
+ break;
+ case DDERR_UNSUPPORTED:
+ error = "Operation not supported";
+ break;
+ case E_NOINTERFACE:
+ error = "Interface not present";
+ break;
+ default:
+ SDL_snprintf(errbuf, SDL_arraysize(errbuf),
+ "%s: Unknown DirectDraw error: 0x%x",
+ function, code);
+ break;
+ }
+ if ( ! errbuf[0] ) {
+ SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: %s", function, error);
+ }
+ SDL_SetError("%s", errbuf);
+ return;
+}
+
+
+static int DX5_UpdateVideoInfo(_THIS)
+{
+ /* This needs to be DDCAPS_DX5 for the DirectDraw2 interface */
+#if DIRECTDRAW_VERSION <= 0x300
+#error Your version of DirectX must be greater than or equal to 5.0
+#endif
+#ifndef IDirectDrawGammaControl_SetGammaRamp
+ /*if gamma is undefined then we really have directx <= 0x500*/
+ DDCAPS DDCaps;
+#else
+ DDCAPS_DX5 DDCaps;
+#endif
+ HRESULT result;
+
+ /* Fill in our hardware acceleration capabilities */
+ SDL_memset(&DDCaps, 0, sizeof(DDCaps));
+ DDCaps.dwSize = sizeof(DDCaps);
+ result = IDirectDraw2_GetCaps(ddraw2, (DDCAPS *)&DDCaps, NULL);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDraw2::GetCaps", result);
+ return(-1);
+ }
+ this->info.hw_available = 1;
+ if ( (DDCaps.dwCaps & DDCAPS_BLT) == DDCAPS_BLT ) {
+ this->info.blit_hw = 1;
+ }
+ if ( ((DDCaps.dwCaps & DDCAPS_COLORKEY) == DDCAPS_COLORKEY) &&
+ ((DDCaps.dwCKeyCaps & DDCKEYCAPS_SRCBLT) == DDCKEYCAPS_SRCBLT) ) {
+ this->info.blit_hw_CC = 1;
+ }
+ if ( (DDCaps.dwCaps & DDCAPS_ALPHA) == DDCAPS_ALPHA ) {
+ /* This is only for alpha channel, and DirectX 6
+ doesn't support 2D alpha blits yet, so set it 0
+ */
+ this->info.blit_hw_A = 0;
+ }
+ if ( (DDCaps.dwCaps & DDCAPS_CANBLTSYSMEM) == DDCAPS_CANBLTSYSMEM ) {
+ this->info.blit_sw = 1;
+ /* This isn't necessarily true, but the HEL will cover us */
+ this->info.blit_sw_CC = this->info.blit_hw_CC;
+ this->info.blit_sw_A = this->info.blit_hw_A;
+ }
+ if ( (DDCaps.dwCaps & DDCAPS_BLTCOLORFILL) == DDCAPS_BLTCOLORFILL ) {
+ this->info.blit_fill = 1;
+ }
+
+ /* Find out how much video memory is available */
+ { DDSCAPS ddsCaps;
+ DWORD total_mem;
+ ddsCaps.dwCaps = DDSCAPS_VIDEOMEMORY;
+ result = IDirectDraw2_GetAvailableVidMem(ddraw2,
+ &ddsCaps, &total_mem, NULL);
+ if ( result != DD_OK ) {
+ total_mem = DDCaps.dwVidMemTotal;
+ }
+ this->info.video_mem = total_mem/1024;
+ }
+ return(0);
+}
+
+int DX5_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ HRESULT result;
+ LPDIRECTDRAW ddraw;
+ int i, j;
+ HDC hdc;
+
+ /* Intialize everything */
+ ddraw2 = NULL;
+ SDL_primary = NULL;
+ SDL_clipper = NULL;
+ SDL_palette = NULL;
+ for ( i=0; i<NUM_MODELISTS; ++i ) {
+ SDL_nummodes[i] = 0;
+ SDL_modelist[i] = NULL;
+ SDL_modeindex[i] = 0;
+ }
+ colorchange_expected = 0;
+
+ /* Create the window */
+ if ( DX5_CreateWindow(this) < 0 ) {
+ return(-1);
+ }
+
+#if !SDL_AUDIO_DISABLED
+ DX5_SoundFocus(SDL_Window);
+#endif
+
+ /* Create the DirectDraw object */
+ result = DDrawCreate(NULL, &ddraw, NULL);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDrawCreate", result);
+ return(-1);
+ }
+ result = IDirectDraw_QueryInterface(ddraw, &IID_IDirectDraw2,
+ (LPVOID *)&ddraw2);
+ IDirectDraw_Release(ddraw);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDraw::QueryInterface", result);
+ return(-1);
+ }
+
+ /* Determine the screen depth */
+ hdc = GetDC(SDL_Window);
+ vformat->BitsPerPixel = GetDeviceCaps(hdc,PLANES) *
+ GetDeviceCaps(hdc,BITSPIXEL);
+ ReleaseDC(SDL_Window, hdc);
+
+#ifndef NO_CHANGEDISPLAYSETTINGS
+ /* Query for the desktop resolution */
+ EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &SDL_desktop_mode);
+ this->info.current_w = SDL_desktop_mode.dmPelsWidth;
+ this->info.current_h = SDL_desktop_mode.dmPelsHeight;
+#endif
+
+ /* Enumerate the available fullscreen modes */
+ for ( i=0; i<NUM_MODELISTS; ++i )
+ enumlists[i] = NULL;
+
+ result = IDirectDraw2_EnumDisplayModes(ddraw2,DDEDM_REFRESHRATES,NULL,this,EnumModes2);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDraw2::EnumDisplayModes", result);
+ return(-1);
+ }
+ for ( i=0; i<NUM_MODELISTS; ++i ) {
+ struct DX5EnumRect *rect;
+ SDL_modelist[i] = (SDL_Rect **)
+ SDL_malloc((SDL_nummodes[i]+1)*sizeof(SDL_Rect *));
+ if ( SDL_modelist[i] == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ for ( j = 0, rect = enumlists[i]; rect; ++j, rect = rect->next ) {
+ SDL_modelist[i][j] = &rect->r;
+ }
+ SDL_modelist[i][j] = NULL;
+
+ if ( SDL_nummodes[i] > 0 ) {
+ SDL_qsort(SDL_modelist[i], SDL_nummodes[i], sizeof *SDL_modelist[i], cmpmodes);
+ }
+ }
+
+ /* Fill in some window manager capabilities */
+ this->info.wm_available = 1;
+
+ /* Fill in the video hardware capabilities */
+ DX5_UpdateVideoInfo(this);
+
+ return(0);
+}
+
+SDL_Rect **DX5_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ int bpp;
+
+ bpp = format->BitsPerPixel;
+ if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
+ /* FIXME: No support for 1 bpp or 4 bpp formats */
+ switch (bpp) { /* Does windows support other BPP? */
+ case 8:
+ case 16:
+ case 24:
+ case 32:
+ bpp = (bpp/8)-1;
+ if ( SDL_nummodes[bpp] > 0 )
+ return(SDL_modelist[bpp]);
+ /* Fall through */
+ default:
+ return((SDL_Rect **)0);
+ }
+ } else {
+ if ( this->screen->format->BitsPerPixel == bpp ) {
+ return((SDL_Rect **)-1);
+ } else {
+ return((SDL_Rect **)0);
+ }
+ }
+}
+
+/* Various screen update functions available */
+static void DX5_WindowUpdate(_THIS, int numrects, SDL_Rect *rects);
+static void DX5_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
+
+SDL_Surface *DX5_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ SDL_Surface *video;
+ int prev_w = -1;
+ int prev_h = -1;
+ HRESULT result;
+ DWORD sharemode;
+ DWORD style;
+ const DWORD directstyle =
+ (WS_POPUP);
+ const DWORD windowstyle =
+ (WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX);
+ const DWORD resizestyle =
+ (WS_THICKFRAME|WS_MAXIMIZEBOX);
+ DDSURFACEDESC ddsd;
+ LPDIRECTDRAWSURFACE dd_surface1;
+ LPDIRECTDRAWSURFACE3 dd_surface3;
+
+ SDL_resizing = 1;
+#ifdef DDRAW_DEBUG
+ fprintf(stderr, "Setting %dx%dx%d video mode\n", width, height, bpp);
+#endif
+ /* Clean up any previous DirectDraw surfaces */
+ if ( current->hwdata ) {
+ this->FreeHWSurface(this, current);
+ current->hwdata = NULL;
+ }
+ if ( SDL_primary != NULL ) {
+ IDirectDrawSurface3_Release(SDL_primary);
+ SDL_primary = NULL;
+ }
+
+#ifndef NO_CHANGEDISPLAYSETTINGS
+ /* Unset any previous OpenGL fullscreen mode */
+ if ( (current->flags & (SDL_OPENGL|SDL_FULLSCREEN)) ==
+ (SDL_OPENGL|SDL_FULLSCREEN) ) {
+ ChangeDisplaySettings(NULL, 0);
+ }
+#endif
+
+ /* Clean up any GL context that may be hanging around */
+ if ( current->flags & SDL_OPENGL ) {
+ WIN_GL_ShutDown(this);
+ }
+
+ /* If we are setting a GL mode, use GDI, not DirectX (yuck) */
+ if ( flags & SDL_OPENGL ) {
+ Uint32 Rmask, Gmask, Bmask;
+
+ /* Recalculate the bitmasks if necessary */
+ if ( bpp == current->format->BitsPerPixel ) {
+ video = current;
+ } else {
+ switch (bpp) {
+ case 15:
+ case 16:
+ if ( 0 /*DIB_SussScreenDepth() == 15*/ ) {
+ /* 5-5-5 */
+ Rmask = 0x00007c00;
+ Gmask = 0x000003e0;
+ Bmask = 0x0000001f;
+ } else {
+ /* 5-6-5 */
+ Rmask = 0x0000f800;
+ Gmask = 0x000007e0;
+ Bmask = 0x0000001f;
+ }
+ break;
+ case 24:
+ case 32:
+ /* GDI defined as 8-8-8 */
+ Rmask = 0x00ff0000;
+ Gmask = 0x0000ff00;
+ Bmask = 0x000000ff;
+ break;
+ default:
+ Rmask = 0x00000000;
+ Gmask = 0x00000000;
+ Bmask = 0x00000000;
+ break;
+ }
+ video = SDL_CreateRGBSurface(SDL_SWSURFACE, 0, 0, bpp,
+ Rmask, Gmask, Bmask, 0);
+ if ( video == NULL ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ }
+
+ /* Fill in part of the video surface */
+ prev_w = video->w;
+ prev_h = video->h;
+ video->flags = 0; /* Clear flags */
+ video->w = width;
+ video->h = height;
+ video->pitch = SDL_CalculatePitch(video);
+
+#ifndef NO_CHANGEDISPLAYSETTINGS
+ /* Set fullscreen mode if appropriate.
+ Ugh, since our list of valid video modes comes from
+ the DirectX driver, we may not actually be able to
+ change to the desired resolution here.
+ FIXME: Should we do a closest match?
+ */
+ if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
+ DEVMODE settings;
+ BOOL changed;
+
+ SDL_memset(&settings, 0, sizeof(DEVMODE));
+ settings.dmSize = sizeof(DEVMODE);
+ settings.dmBitsPerPel = video->format->BitsPerPixel;
+ settings.dmPelsWidth = width;
+ settings.dmPelsHeight = height;
+ settings.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL;
+ if ( width <= (int)SDL_desktop_mode.dmPelsWidth &&
+ height <= (int)SDL_desktop_mode.dmPelsHeight ) {
+ settings.dmDisplayFrequency = SDL_desktop_mode.dmDisplayFrequency;
+ settings.dmFields |= DM_DISPLAYFREQUENCY;
+ }
+ changed = (ChangeDisplaySettings(&settings, CDS_FULLSCREEN) == DISP_CHANGE_SUCCESSFUL);
+ if ( ! changed && (settings.dmFields & DM_DISPLAYFREQUENCY) ) {
+ settings.dmFields &= ~DM_DISPLAYFREQUENCY;
+ changed = (ChangeDisplaySettings(&settings, CDS_FULLSCREEN) == DISP_CHANGE_SUCCESSFUL);
+ }
+ if ( changed ) {
+ video->flags |= SDL_FULLSCREEN;
+ SDL_fullscreen_mode = settings;
+ }
+ }
+#endif /* !NO_CHANGEDISPLAYSETTINGS */
+
+ style = GetWindowLong(SDL_Window, GWL_STYLE);
+ style &= ~(resizestyle|WS_MAXIMIZE);
+ if ( video->flags & SDL_FULLSCREEN ) {
+ style &= ~windowstyle;
+ style |= directstyle;
+ } else {
+ if ( flags & SDL_NOFRAME ) {
+ style &= ~windowstyle;
+ style |= directstyle;
+ video->flags |= SDL_NOFRAME;
+ } else {
+ style &= ~directstyle;
+ style |= windowstyle;
+ if ( flags & SDL_RESIZABLE ) {
+ style |= resizestyle;
+ video->flags |= SDL_RESIZABLE;
+ }
+ }
+#if WS_MAXIMIZE
+ if (IsZoomed(SDL_Window)) style |= WS_MAXIMIZE;
+#endif
+ }
+
+ /* DJM: Don't piss of anyone who has setup his own window */
+ if ( !SDL_windowid )
+ SetWindowLong(SDL_Window, GWL_STYLE, style);
+
+ /* Resize the window (copied from SDL WinDIB driver) */
+ if ( !SDL_windowid && !IsZoomed(SDL_Window) ) {
+ RECT bounds;
+ int x, y;
+ HWND top;
+ UINT swp_flags;
+ const char *window = NULL;
+ const char *center = NULL;
+
+ if ( video->w != prev_w || video->h != prev_h ) {
+ window = SDL_getenv("SDL_VIDEO_WINDOW_POS");
+ center = SDL_getenv("SDL_VIDEO_CENTERED");
+ if ( window ) {
+ if ( SDL_sscanf(window, "%d,%d", &x, &y) == 2 ) {
+ SDL_windowX = x;
+ SDL_windowY = y;
+ }
+ if ( SDL_strcmp(window, "center") == 0 ) {
+ center = window;
+ }
+ }
+ }
+ swp_flags = (SWP_NOCOPYBITS | SWP_SHOWWINDOW);
+
+ bounds.left = SDL_windowX;
+ bounds.top = SDL_windowY;
+ bounds.right = SDL_windowX+video->w;
+ bounds.bottom = SDL_windowY+video->h;
+ AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), (GetMenu(SDL_Window) != NULL), 0);
+ width = bounds.right-bounds.left;
+ height = bounds.bottom-bounds.top;
+ if ( (flags & SDL_FULLSCREEN) ) {
+ x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
+ y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
+ } else if ( center ) {
+ x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
+ y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
+ } else if ( SDL_windowX || SDL_windowY || window ) {
+ x = bounds.left;
+ y = bounds.top;
+ } else {
+ x = y = -1;
+ swp_flags |= SWP_NOMOVE;
+ }
+ if ( flags & SDL_FULLSCREEN ) {
+ top = HWND_TOPMOST;
+ } else {
+ top = HWND_NOTOPMOST;
+ }
+ SetWindowPos(SDL_Window, top, x, y, width, height, swp_flags);
+ if ( !(flags & SDL_FULLSCREEN) ) {
+ SDL_windowX = SDL_bounds.left;
+ SDL_windowY = SDL_bounds.top;
+ }
+ SetForegroundWindow(SDL_Window);
+ }
+ SDL_resizing = 0;
+
+ /* Set up for OpenGL */
+ if ( WIN_GL_SetupWindow(this) < 0 ) {
+ return(NULL);
+ }
+ video->flags |= SDL_OPENGL;
+ return(video);
+ }
+
+ /* Set the appropriate window style */
+ style = GetWindowLong(SDL_Window, GWL_STYLE);
+ style &= ~(resizestyle|WS_MAXIMIZE);
+ if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
+ style &= ~windowstyle;
+ style |= directstyle;
+ } else {
+ if ( flags & SDL_NOFRAME ) {
+ style &= ~windowstyle;
+ style |= directstyle;
+ } else {
+ style &= ~directstyle;
+ style |= windowstyle;
+ if ( flags & SDL_RESIZABLE ) {
+ style |= resizestyle;
+ }
+ }
+#if WS_MAXIMIZE
+ if (IsZoomed(SDL_Window)) style |= WS_MAXIMIZE;
+#endif
+ }
+ /* DJM: Don't piss of anyone who has setup his own window */
+ if ( !SDL_windowid )
+ SetWindowLong(SDL_Window, GWL_STYLE, style);
+
+ /* Set DirectDraw sharing mode.. exclusive when fullscreen */
+ if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
+ sharemode = DDSCL_FULLSCREEN|DDSCL_EXCLUSIVE|DDSCL_ALLOWREBOOT;
+ } else {
+ sharemode = DDSCL_NORMAL;
+ }
+ result = IDirectDraw2_SetCooperativeLevel(ddraw2,SDL_Window,sharemode);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDraw2::SetCooperativeLevel", result);
+ return(NULL);
+ }
+
+ /* Set the display mode, if we are in fullscreen mode */
+ if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
+ RECT bounds;
+ struct DX5EnumRect *rect;
+ int maxRefreshRate;
+
+ /* Cover up desktop during mode change */
+ bounds.left = 0;
+ bounds.top = 0;
+ bounds.right = GetSystemMetrics(SM_CXSCREEN);
+ bounds.bottom = GetSystemMetrics(SM_CYSCREEN);
+ AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), (GetMenu(SDL_Window) != NULL), 0);
+ SetWindowPos(SDL_Window, HWND_TOPMOST,
+ bounds.left, bounds.top,
+ bounds.right - bounds.left,
+ bounds.bottom - bounds.top, SWP_NOCOPYBITS);
+ ShowWindow(SDL_Window, SW_SHOW);
+ while ( GetForegroundWindow() != SDL_Window ) {
+ SetForegroundWindow(SDL_Window);
+ SDL_Delay(100);
+ }
+
+ /* find maximum monitor refresh rate for this resolution */
+ /* Dmitry Yakimov ftech@tula.net */
+ maxRefreshRate = 0; /* system default */
+ for ( rect = enumlists[bpp / 8 - 1]; rect; rect = rect->next ) {
+ if ( (width == rect->r.w) && (height == rect->r.h) ) {
+ maxRefreshRate = rect->refreshRate;
+ break;
+ }
+ }
+#ifdef DDRAW_DEBUG
+ fprintf(stderr, "refresh rate = %d Hz\n", maxRefreshRate);
+#endif
+
+ result = IDirectDraw2_SetDisplayMode(ddraw2, width, height, bpp, maxRefreshRate, 0);
+ if ( result != DD_OK ) {
+ result = IDirectDraw2_SetDisplayMode(ddraw2, width, height, bpp, 0, 0);
+ if ( result != DD_OK ) {
+ /* We couldn't set fullscreen mode, try window */
+ return(DX5_SetVideoMode(this, current, width, height, bpp, flags & ~SDL_FULLSCREEN));
+ }
+ }
+ DX5_DInputReset(this, 1);
+ } else {
+ DX5_DInputReset(this, 0);
+ }
+ DX5_UpdateVideoInfo(this);
+
+ /* Create a primary DirectDraw surface */
+ SDL_memset(&ddsd, 0, sizeof(ddsd));
+ ddsd.dwSize = sizeof(ddsd);
+ ddsd.dwFlags = DDSD_CAPS;
+ ddsd.ddsCaps.dwCaps = (DDSCAPS_PRIMARYSURFACE|DDSCAPS_VIDEOMEMORY);
+ if ( (flags & SDL_FULLSCREEN) != SDL_FULLSCREEN ) {
+ /* There's no windowed double-buffering */
+ flags &= ~SDL_DOUBLEBUF;
+ }
+ if ( (flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
+ ddsd.dwFlags |= DDSD_BACKBUFFERCOUNT;
+ ddsd.ddsCaps.dwCaps |= (DDSCAPS_COMPLEX|DDSCAPS_FLIP);
+ ddsd.dwBackBufferCount = 1;
+ }
+ result = IDirectDraw2_CreateSurface(ddraw2, &ddsd, &dd_surface1, NULL);
+ if ( (result != DD_OK) && ((flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF) ) {
+ ddsd.dwFlags &= ~DDSD_BACKBUFFERCOUNT;
+ ddsd.ddsCaps.dwCaps &= ~(DDSCAPS_COMPLEX|DDSCAPS_FLIP);
+ ddsd.dwBackBufferCount = 0;
+ result = IDirectDraw2_CreateSurface(ddraw2,
+ &ddsd, &dd_surface1, NULL);
+ }
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDraw2::CreateSurface(PRIMARY)", result);
+ return(NULL);
+ }
+ result = IDirectDrawSurface_QueryInterface(dd_surface1,
+ &IID_IDirectDrawSurface3, (LPVOID *)&SDL_primary);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDrawSurface::QueryInterface", result);
+ return(NULL);
+ }
+ IDirectDrawSurface_Release(dd_surface1);
+
+ /* Get the format of the primary DirectDraw surface */
+ SDL_memset(&ddsd, 0, sizeof(ddsd));
+ ddsd.dwSize = sizeof(ddsd);
+ ddsd.dwFlags = DDSD_PIXELFORMAT|DDSD_CAPS;
+ result = IDirectDrawSurface3_GetSurfaceDesc(SDL_primary, &ddsd);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDrawSurface::GetSurfaceDesc", result);
+ return(NULL);
+ }
+ if ( ! (ddsd.ddpfPixelFormat.dwFlags&DDPF_RGB) ) {
+ SDL_SetError("Primary DDRAW surface is not RGB format");
+ return(NULL);
+ }
+
+ /* Free old palette and create a new one if we're in 8-bit mode */
+ if ( SDL_palette != NULL ) {
+ IDirectDrawPalette_Release(SDL_palette);
+ SDL_palette = NULL;
+ }
+#if defined(NONAMELESSUNION)
+ if ( ddsd.ddpfPixelFormat.u1.dwRGBBitCount == 8 ) {
+#else
+ if ( ddsd.ddpfPixelFormat.dwRGBBitCount == 8 ) {
+#endif
+ int i;
+
+ if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
+ /* We have access to the entire palette */
+ for ( i=0; i<256; ++i ) {
+ SDL_colors[i].peFlags =
+ (PC_NOCOLLAPSE|PC_RESERVED);
+ SDL_colors[i].peRed = 0;
+ SDL_colors[i].peGreen = 0;
+ SDL_colors[i].peBlue = 0;
+ }
+ } else {
+ /* First 10 colors are reserved by Windows */
+ for ( i=0; i<10; ++i ) {
+ SDL_colors[i].peFlags = PC_EXPLICIT;
+ SDL_colors[i].peRed = i;
+ SDL_colors[i].peGreen = 0;
+ SDL_colors[i].peBlue = 0;
+ }
+ for ( i=10; i<(10+236); ++i ) {
+ SDL_colors[i].peFlags = PC_NOCOLLAPSE;
+ SDL_colors[i].peRed = 0;
+ SDL_colors[i].peGreen = 0;
+ SDL_colors[i].peBlue = 0;
+ }
+ /* Last 10 colors are reserved by Windows */
+ for ( i=246; i<256; ++i ) {
+ SDL_colors[i].peFlags = PC_EXPLICIT;
+ SDL_colors[i].peRed = i;
+ SDL_colors[i].peGreen = 0;
+ SDL_colors[i].peBlue = 0;
+ }
+ }
+ result = IDirectDraw2_CreatePalette(ddraw2,
+ (DDPCAPS_8BIT|DDPCAPS_ALLOW256),
+ SDL_colors, &SDL_palette, NULL);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDraw2::CreatePalette", result);
+ return(NULL);
+ }
+ result = IDirectDrawSurface3_SetPalette(SDL_primary,
+ SDL_palette);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDrawSurface3::SetPalette", result);
+ return(NULL);
+ }
+ }
+
+ /* Create our video surface using the same pixel format */
+ video = current;
+ if ( (width != video->w) || (height != video->h)
+ || (video->format->BitsPerPixel !=
+#if defined(NONAMELESSUNION)
+ ddsd.ddpfPixelFormat.u1.dwRGBBitCount) ) {
+#else
+ ddsd.ddpfPixelFormat.dwRGBBitCount) ) {
+#endif
+ SDL_FreeSurface(video);
+ video = SDL_CreateRGBSurface(SDL_SWSURFACE, 0, 0,
+#if defined(NONAMELESSUNION)
+ ddsd.ddpfPixelFormat.u1.dwRGBBitCount,
+ ddsd.ddpfPixelFormat.u2.dwRBitMask,
+ ddsd.ddpfPixelFormat.u3.dwGBitMask,
+ ddsd.ddpfPixelFormat.u4.dwBBitMask,
+#else
+ ddsd.ddpfPixelFormat.dwRGBBitCount,
+ ddsd.ddpfPixelFormat.dwRBitMask,
+ ddsd.ddpfPixelFormat.dwGBitMask,
+ ddsd.ddpfPixelFormat.dwBBitMask,
+#endif
+ 0);
+ if ( video == NULL ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ prev_w = video->w;
+ prev_h = video->h;
+ video->w = width;
+ video->h = height;
+ video->pitch = 0;
+ }
+ video->flags = 0; /* Clear flags */
+
+ /* If not fullscreen, locking is possible, but it doesn't do what
+ the caller really expects -- if the locked surface is written to,
+ the appropriate portion of the entire screen is modified, not
+ the application window, as we would like.
+ Note that it is still possible to write directly to display
+ memory, but the application must respect the clip list of
+ the surface. There might be some odd timing interactions
+ involving clip list updates and background refreshing as
+ Windows moves other windows across our window.
+ We currently don't support this, even though it might be a
+ good idea since BeOS has an implementation of BDirectWindow
+ that does the same thing. This would be most useful for
+ applications that do complete screen updates every frame.
+ -- Fixme?
+ */
+ if ( (flags & SDL_FULLSCREEN) != SDL_FULLSCREEN ) {
+ /* Necessary if we're going from fullscreen to window */
+ if ( video->pixels == NULL ) {
+ video->pitch = (width*video->format->BytesPerPixel);
+ /* Pitch needs to be QWORD (8-byte) aligned */
+ video->pitch = (video->pitch + 7) & ~7;
+ video->pixels = (void *)SDL_malloc(video->h*video->pitch);
+ if ( video->pixels == NULL ) {
+ if ( video != current ) {
+ SDL_FreeSurface(video);
+ }
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ }
+ dd_surface3 = NULL;
+#if 0 /* FIXME: enable this when SDL consistently reports lost surfaces */
+ if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
+ video->flags |= SDL_HWSURFACE;
+ } else {
+ video->flags |= SDL_SWSURFACE;
+ }
+#else
+ video->flags |= SDL_SWSURFACE;
+#endif
+ if ( (flags & SDL_RESIZABLE) && !(flags & SDL_NOFRAME) ) {
+ video->flags |= SDL_RESIZABLE;
+ }
+ if ( flags & SDL_NOFRAME ) {
+ video->flags |= SDL_NOFRAME;
+ }
+ } else {
+ /* Necessary if we're going from window to fullscreen */
+ if ( video->pixels != NULL ) {
+ SDL_free(video->pixels);
+ video->pixels = NULL;
+ }
+ dd_surface3 = SDL_primary;
+ video->flags |= SDL_HWSURFACE;
+ }
+
+ /* See if the primary surface has double-buffering enabled */
+ if ( (ddsd.ddsCaps.dwCaps & DDSCAPS_FLIP) == DDSCAPS_FLIP ) {
+ video->flags |= SDL_DOUBLEBUF;
+ }
+
+ /* Allocate the SDL surface associated with the primary surface */
+ if ( DX5_AllocDDSurface(this, video, dd_surface3,
+ video->flags&SDL_HWSURFACE) < 0 ) {
+ if ( video != current ) {
+ SDL_FreeSurface(video);
+ }
+ return(NULL);
+ }
+
+ /* Use the appropriate blitting function */
+ if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
+ video->flags |= SDL_FULLSCREEN;
+ if ( video->format->palette != NULL ) {
+ video->flags |= SDL_HWPALETTE;
+ }
+ this->UpdateRects = DX5_DirectUpdate;
+ } else {
+ this->UpdateRects = DX5_WindowUpdate;
+ }
+
+ /* Make our window the proper size, set the clipper, then show it */
+ if ( (flags & SDL_FULLSCREEN) != SDL_FULLSCREEN ) {
+ /* Create and set a clipper on our primary surface */
+ if ( SDL_clipper == NULL ) {
+ result = IDirectDraw2_CreateClipper(ddraw2,
+ 0, &SDL_clipper, NULL);
+ if ( result != DD_OK ) {
+ if ( video != current ) {
+ SDL_FreeSurface(video);
+ }
+ SetDDerror("DirectDraw2::CreateClipper",result);
+ return(NULL);
+ }
+ }
+ result = IDirectDrawClipper_SetHWnd(SDL_clipper, 0, SDL_Window);
+ if ( result != DD_OK ) {
+ if ( video != current ) {
+ SDL_FreeSurface(video);
+ }
+ SetDDerror("DirectDrawClipper::SetHWnd", result);
+ return(NULL);
+ }
+ result = IDirectDrawSurface3_SetClipper(SDL_primary,
+ SDL_clipper);
+ if ( result != DD_OK ) {
+ if ( video != current ) {
+ SDL_FreeSurface(video);
+ }
+ SetDDerror("DirectDrawSurface3::SetClipper", result);
+ return(NULL);
+ }
+
+ /* Resize the window (copied from SDL WinDIB driver) */
+ if ( !SDL_windowid && !IsZoomed(SDL_Window) ) {
+ RECT bounds;
+ int x, y;
+ UINT swp_flags;
+ const char *window = NULL;
+ const char *center = NULL;
+
+ if ( video->w != prev_w || video->h != prev_h ) {
+ window = SDL_getenv("SDL_VIDEO_WINDOW_POS");
+ center = SDL_getenv("SDL_VIDEO_CENTERED");
+ if ( window ) {
+ if ( SDL_sscanf(window, "%d,%d", &x, &y) == 2 ) {
+ SDL_windowX = x;
+ SDL_windowY = y;
+ }
+ if ( SDL_strcmp(window, "center") == 0 ) {
+ center = window;
+ }
+ }
+ }
+ swp_flags = SWP_NOCOPYBITS;
+
+ bounds.left = SDL_windowX;
+ bounds.top = SDL_windowY;
+ bounds.right = SDL_windowX+video->w;
+ bounds.bottom = SDL_windowY+video->h;
+ AdjustWindowRectEx(&bounds, GetWindowLong(SDL_Window, GWL_STYLE), (GetMenu(SDL_Window) != NULL), 0);
+ width = bounds.right-bounds.left;
+ height = bounds.bottom-bounds.top;
+ if ( center ) {
+ x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
+ y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
+ } else if ( SDL_windowX || SDL_windowY || window ) {
+ x = bounds.left;
+ y = bounds.top;
+ } else {
+ x = y = -1;
+ swp_flags |= SWP_NOMOVE;
+ }
+ SetWindowPos(SDL_Window, HWND_NOTOPMOST, x, y, width, height, swp_flags);
+ SDL_windowX = SDL_bounds.left;
+ SDL_windowY = SDL_bounds.top;
+ }
+
+ }
+ ShowWindow(SDL_Window, SW_SHOW);
+ SetForegroundWindow(SDL_Window);
+ SDL_resizing = 0;
+
+ /* JC 14 Mar 2006
+ Flush the message loop or this can cause big problems later
+ Especially if the user decides to use dialog boxes or assert()!
+ */
+ WIN_FlushMessageQueue();
+
+ /* We're live! */
+ return(video);
+}
+
+struct private_hwdata {
+ LPDIRECTDRAWSURFACE3 dd_surface;
+ LPDIRECTDRAWSURFACE3 dd_writebuf;
+};
+
+static int DX5_AllocDDSurface(_THIS, SDL_Surface *surface,
+ LPDIRECTDRAWSURFACE3 requested, Uint32 flag)
+{
+ LPDIRECTDRAWSURFACE dd_surface1;
+ LPDIRECTDRAWSURFACE3 dd_surface3;
+ DDSURFACEDESC ddsd;
+ HRESULT result;
+
+ /* Clear the hardware flag, in case we fail */
+ surface->flags &= ~flag;
+
+ /* Allocate the hardware acceleration data */
+ surface->hwdata = (struct private_hwdata *)
+ SDL_malloc(sizeof(*surface->hwdata));
+ if ( surface->hwdata == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ dd_surface3 = NULL;
+
+ /* Set up the surface description */
+ SDL_memset(&ddsd, 0, sizeof(ddsd));
+ ddsd.dwSize = sizeof(ddsd);
+ ddsd.dwFlags = (DDSD_WIDTH|DDSD_HEIGHT|DDSD_CAPS|
+ DDSD_PITCH|DDSD_PIXELFORMAT);
+ ddsd.dwWidth = surface->w;
+ ddsd.dwHeight= surface->h;
+#if defined(NONAMELESSUNION)
+ ddsd.u1.lPitch = surface->pitch;
+#else
+ ddsd.lPitch = surface->pitch;
+#endif
+ if ( (flag & SDL_HWSURFACE) == SDL_HWSURFACE ) {
+ ddsd.ddsCaps.dwCaps =
+ (DDSCAPS_OFFSCREENPLAIN|DDSCAPS_VIDEOMEMORY);
+ } else {
+ ddsd.ddsCaps.dwCaps =
+ (DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY);
+ }
+ ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
+ ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB;
+ if ( surface->format->palette ) {
+ ddsd.ddpfPixelFormat.dwFlags |= DDPF_PALETTEINDEXED8;
+ }
+#if defined(NONAMELESSUNION)
+ ddsd.ddpfPixelFormat.u1.dwRGBBitCount = surface->format->BitsPerPixel;
+ ddsd.ddpfPixelFormat.u2.dwRBitMask = surface->format->Rmask;
+ ddsd.ddpfPixelFormat.u3.dwGBitMask = surface->format->Gmask;
+ ddsd.ddpfPixelFormat.u4.dwBBitMask = surface->format->Bmask;
+#else
+ ddsd.ddpfPixelFormat.dwRGBBitCount = surface->format->BitsPerPixel;
+ ddsd.ddpfPixelFormat.dwRBitMask = surface->format->Rmask;
+ ddsd.ddpfPixelFormat.dwGBitMask = surface->format->Gmask;
+ ddsd.ddpfPixelFormat.dwBBitMask = surface->format->Bmask;
+#endif
+
+ /* Create the DirectDraw video surface */
+ if ( requested != NULL ) {
+ dd_surface3 = requested;
+ } else {
+ result = IDirectDraw2_CreateSurface(ddraw2,
+ &ddsd, &dd_surface1, NULL);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDraw2::CreateSurface", result);
+ goto error_end;
+ }
+ result = IDirectDrawSurface_QueryInterface(dd_surface1,
+ &IID_IDirectDrawSurface3, (LPVOID *)&dd_surface3);
+ IDirectDrawSurface_Release(dd_surface1);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDrawSurface::QueryInterface", result);
+ goto error_end;
+ }
+ }
+
+ if ( (flag & SDL_HWSURFACE) == SDL_HWSURFACE ) {
+ /* Check to see whether the surface actually ended up
+ in video memory, and fail if not. We expect the
+ surfaces we create here to actually be in hardware!
+ */
+ result = IDirectDrawSurface3_GetCaps(dd_surface3,&ddsd.ddsCaps);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDrawSurface3::GetCaps", result);
+ goto error_end;
+ }
+ if ( (ddsd.ddsCaps.dwCaps&DDSCAPS_VIDEOMEMORY) !=
+ DDSCAPS_VIDEOMEMORY ) {
+ SDL_SetError("No room in video memory");
+ goto error_end;
+ }
+ } else {
+ /* Try to hook our surface memory */
+ ddsd.dwFlags = DDSD_LPSURFACE;
+ ddsd.lpSurface = surface->pixels;
+ result = IDirectDrawSurface3_SetSurfaceDesc(dd_surface3,
+ &ddsd, 0);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDraw2::SetSurfaceDesc", result);
+ goto error_end;
+ }
+
+ }
+
+ /* Make sure the surface format was set properly */
+ SDL_memset(&ddsd, 0, sizeof(ddsd));
+ ddsd.dwSize = sizeof(ddsd);
+ result = IDirectDrawSurface3_Lock(dd_surface3, NULL,
+ &ddsd, (DDLOCK_NOSYSLOCK|DDLOCK_WAIT), NULL);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDrawSurface3::Lock", result);
+ goto error_end;
+ }
+ IDirectDrawSurface3_Unlock(dd_surface3, NULL);
+
+ if ( (flag & SDL_HWSURFACE) == SDL_SWSURFACE ) {
+ if ( ddsd.lpSurface != surface->pixels ) {
+ SDL_SetError("DDraw didn't use SDL surface memory");
+ goto error_end;
+ }
+ if (
+#if defined(NONAMELESSUNION)
+ ddsd.u1.lPitch
+#else
+ ddsd.lPitch
+#endif
+ != (LONG)surface->pitch ) {
+ SDL_SetError("DDraw created surface with wrong pitch");
+ goto error_end;
+ }
+ } else {
+#if defined(NONAMELESSUNION)
+ surface->pitch = (Uint16)ddsd.u1.lPitch;
+#else
+ surface->pitch = (Uint16)ddsd.lPitch;
+#endif
+ }
+#if defined(NONAMELESSUNION)
+ if ( (ddsd.ddpfPixelFormat.u1.dwRGBBitCount !=
+ surface->format->BitsPerPixel) ||
+ (ddsd.ddpfPixelFormat.u2.dwRBitMask != surface->format->Rmask) ||
+ (ddsd.ddpfPixelFormat.u3.dwGBitMask != surface->format->Gmask) ||
+ (ddsd.ddpfPixelFormat.u4.dwBBitMask != surface->format->Bmask) ){
+#else
+ if ( (ddsd.ddpfPixelFormat.dwRGBBitCount !=
+ surface->format->BitsPerPixel) ||
+ (ddsd.ddpfPixelFormat.dwRBitMask != surface->format->Rmask) ||
+ (ddsd.ddpfPixelFormat.dwGBitMask != surface->format->Gmask) ||
+ (ddsd.ddpfPixelFormat.dwBBitMask != surface->format->Bmask) ){
+#endif
+ SDL_SetError("DDraw didn't use SDL surface description");
+ goto error_end;
+ }
+ if ( (ddsd.dwWidth != (DWORD)surface->w) ||
+ (ddsd.dwHeight != (DWORD)surface->h) ) {
+ SDL_SetError("DDraw created surface with wrong size");
+ goto error_end;
+ }
+
+ /* Set the surface private data */
+ surface->flags |= flag;
+ surface->hwdata->dd_surface = dd_surface3;
+ if ( (surface->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
+ LPDIRECTDRAWSURFACE3 dd_writebuf;
+
+ ddsd.ddsCaps.dwCaps = DDSCAPS_BACKBUFFER;
+ result = IDirectDrawSurface3_GetAttachedSurface(dd_surface3,
+ &ddsd.ddsCaps, &dd_writebuf);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDrawSurface3::GetAttachedSurface",
+ result);
+ } else {
+ dd_surface3 = dd_writebuf;
+ }
+ }
+ surface->hwdata->dd_writebuf = dd_surface3;
+
+ /* We're ready to go! */
+ return(0);
+
+ /* Okay, so goto's are cheesy, but there are so many possible
+ errors in this function, and the cleanup is the same in
+ every single case. Is there a better way, other than deeply
+ nesting the code?
+ */
+error_end:
+ if ( (dd_surface3 != NULL) && (dd_surface3 != requested) ) {
+ IDirectDrawSurface_Release(dd_surface3);
+ }
+ SDL_free(surface->hwdata);
+ surface->hwdata = NULL;
+ return(-1);
+}
+
+static int DX5_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ /* DDraw limitation -- you need to set cooperative level first */
+ if ( SDL_primary == NULL ) {
+ SDL_SetError("You must set a non-GL video mode first");
+ return(-1);
+ }
+ return(DX5_AllocDDSurface(this, surface, NULL, SDL_HWSURFACE));
+}
+
+#ifdef DDRAW_DEBUG
+void PrintSurface(char *title, LPDIRECTDRAWSURFACE3 surface, Uint32 flags)
+{
+ DDSURFACEDESC ddsd;
+
+ /* Lock and load! */
+ SDL_memset(&ddsd, 0, sizeof(ddsd));
+ ddsd.dwSize = sizeof(ddsd);
+ if ( IDirectDrawSurface3_Lock(surface, NULL, &ddsd,
+ (DDLOCK_NOSYSLOCK|DDLOCK_WAIT), NULL) != DD_OK ) {
+ return;
+ }
+ IDirectDrawSurface3_Unlock(surface, NULL);
+
+ fprintf(stderr, "%s:\n", title);
+ fprintf(stderr, "\tSize: %dx%d in %s at %ld bpp (pitch = %ld)\n",
+ ddsd.dwWidth, ddsd.dwHeight,
+ (flags & SDL_HWSURFACE) ? "hardware" : "software",
+#if defined(NONAMELESSUNION)
+ ddsd.ddpfPixelFormat.u1.dwRGBBitCount, ddsd.u1.lPitch);
+#else
+ ddsd.ddpfPixelFormat.dwRGBBitCount, ddsd.lPitch);
+#endif
+ fprintf(stderr, "\tR = 0x%X, G = 0x%X, B = 0x%X\n",
+#if defined(NONAMELESSUNION)
+ ddsd.ddpfPixelFormat.u2.dwRBitMask,
+ ddsd.ddpfPixelFormat.u3.dwGBitMask,
+ ddsd.ddpfPixelFormat.u4.dwBBitMask);
+#else
+ ddsd.ddpfPixelFormat.dwRBitMask,
+ ddsd.ddpfPixelFormat.dwGBitMask,
+ ddsd.ddpfPixelFormat.dwBBitMask);
+#endif
+}
+#endif /* DDRAW_DEBUG */
+
+static int DX5_HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
+ SDL_Surface *dst, SDL_Rect *dstrect)
+{
+ LPDIRECTDRAWSURFACE3 src_surface;
+ LPDIRECTDRAWSURFACE3 dst_surface;
+ DWORD flags;
+ RECT rect;
+ HRESULT result;
+
+ /* Set it up.. the desination must have a DDRAW surface */
+ src_surface = src->hwdata->dd_writebuf;
+ dst_surface = dst->hwdata->dd_writebuf;
+ rect.top = (LONG)srcrect->y;
+ rect.bottom = (LONG)srcrect->y+srcrect->h;
+ rect.left = (LONG)srcrect->x;
+ rect.right = (LONG)srcrect->x+srcrect->w;
+ if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY )
+ flags = DDBLTFAST_SRCCOLORKEY;
+ else
+ flags = DDBLTFAST_NOCOLORKEY;
+ /* FIXME: We can remove this flag for _really_ fast blit queuing,
+ but it will affect the return values of locks and flips.
+ */
+ flags |= DDBLTFAST_WAIT;
+
+ /* Do the blit! */
+ result = IDirectDrawSurface3_BltFast(dst_surface,
+ dstrect->x, dstrect->y, src_surface, &rect, flags);
+ if ( result != DD_OK ) {
+ if ( result == DDERR_SURFACELOST ) {
+ result = IDirectDrawSurface3_Restore(src_surface);
+ result = IDirectDrawSurface3_Restore(dst_surface);
+ /* The surfaces need to be reloaded with artwork */
+ SDL_SetError("Blit surfaces were lost, reload them");
+ return(-2);
+ }
+ SetDDerror("IDirectDrawSurface3::BltFast", result);
+#ifdef DDRAW_DEBUG
+ fprintf(stderr, "Original dest rect: %dx%d at %d,%d\n", dstrect->w, dstrect->h, dstrect->x, dstrect->y);
+ fprintf(stderr, "HW accelerated %sblit to from 0x%p to 0x%p at (%d,%d)\n",
+ (src->flags & SDL_SRCCOLORKEY) ? "colorkey " : "", src, dst,
+ dstrect->x, dstrect->y);
+ PrintSurface("SRC", src_surface, src->flags);
+ PrintSurface("DST", dst_surface, dst->flags);
+ fprintf(stderr, "Source rectangle: (%d,%d) - (%d,%d)\n",
+ rect.left, rect.top, rect.right, rect.bottom);
+#endif
+ /* Unexpected error, fall back to software blit */
+ return(src->map->sw_blit(src, srcrect, dst, dstrect));
+ }
+ return(0);
+}
+
+static int DX5_CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst)
+{
+ int accelerated;
+
+ /* We need to have a DDraw surface for HW blits */
+ if ( (src->flags & SDL_HWSURFACE) == SDL_SWSURFACE ) {
+ /* Allocate a DDraw surface for the blit */
+ if ( src->hwdata == NULL ) {
+ DX5_AllocDDSurface(this, src, NULL, SDL_SWSURFACE);
+ }
+ }
+ if ( src->hwdata == NULL ) {
+ return(0);
+ }
+
+ /* Set initial acceleration on */
+ src->flags |= SDL_HWACCEL;
+
+ /* Set the surface attributes */
+ if ( (src->flags & SDL_SRCCOLORKEY) == SDL_SRCCOLORKEY ) {
+ if ( DX5_SetHWColorKey(this, src, src->format->colorkey) < 0 ) {
+ src->flags &= ~SDL_HWACCEL;
+ }
+ }
+ if ( (src->flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
+ if ( DX5_SetHWAlpha(this, src, src->format->alpha) < 0 ) {
+ src->flags &= ~SDL_HWACCEL;
+ }
+ }
+
+ /* Check to see if final surface blit is accelerated */
+ accelerated = !!(src->flags & SDL_HWACCEL);
+ if ( accelerated ) {
+#ifdef DDRAW_DEBUG
+ fprintf(stderr, "Setting accelerated blit on 0x%p\n", src);
+#endif
+ src->map->hw_blit = DX5_HWAccelBlit;
+ }
+ return(accelerated);
+}
+
+static int DX5_FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color)
+{
+ LPDIRECTDRAWSURFACE3 dst_surface;
+ RECT area;
+ DDBLTFX bltfx;
+ HRESULT result;
+
+#ifdef DDRAW_DEBUG
+ fprintf(stderr, "HW accelerated fill at (%d,%d)\n", dstrect->x, dstrect->y);
+#endif
+ dst_surface = dst->hwdata->dd_writebuf;
+ area.top = (LONG)dstrect->y;
+ area.bottom = (LONG)dstrect->y+dstrect->h;
+ area.left = (LONG)dstrect->x;
+ area.right = (LONG)dstrect->x+dstrect->w;
+ bltfx.dwSize = sizeof(bltfx);
+#if defined(NONAMELESSUNION)
+ bltfx.u5.dwFillColor = color;
+#else
+ bltfx.dwFillColor = color;
+#endif
+ result = IDirectDrawSurface3_Blt(dst_surface,
+ &area, NULL, NULL, DDBLT_COLORFILL|DDBLT_WAIT, &bltfx);
+ if ( result == DDERR_SURFACELOST ) {
+ IDirectDrawSurface3_Restore(dst_surface);
+ result = IDirectDrawSurface3_Blt(dst_surface,
+ &area, NULL, NULL, DDBLT_COLORFILL|DDBLT_WAIT, &bltfx);
+ }
+ if ( result != DD_OK ) {
+ SetDDerror("IDirectDrawSurface3::Blt", result);
+ return(-1);
+ }
+ return(0);
+}
+
+static int DX5_SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key)
+{
+ DDCOLORKEY colorkey;
+ HRESULT result;
+
+ /* Set the surface colorkey */
+ colorkey.dwColorSpaceLowValue = key;
+ colorkey.dwColorSpaceHighValue = key;
+ result = IDirectDrawSurface3_SetColorKey(
+ surface->hwdata->dd_surface, DDCKEY_SRCBLT, &colorkey);
+ if ( result != DD_OK ) {
+ SetDDerror("IDirectDrawSurface3::SetColorKey", result);
+ return(-1);
+ }
+ return(0);
+}
+static int DX5_SetHWAlpha(_THIS, SDL_Surface *surface, Uint8 alpha)
+{
+ return(-1);
+}
+
+static int DX5_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ HRESULT result;
+ LPDIRECTDRAWSURFACE3 dd_surface;
+ DDSURFACEDESC ddsd;
+
+ /* Lock and load! */
+ dd_surface = surface->hwdata->dd_writebuf;
+ SDL_memset(&ddsd, 0, sizeof(ddsd));
+ ddsd.dwSize = sizeof(ddsd);
+ result = IDirectDrawSurface3_Lock(dd_surface, NULL, &ddsd,
+ (DDLOCK_NOSYSLOCK|DDLOCK_WAIT), NULL);
+ if ( result == DDERR_SURFACELOST ) {
+ result = IDirectDrawSurface3_Restore(
+ surface->hwdata->dd_surface);
+ result = IDirectDrawSurface3_Lock(dd_surface, NULL, &ddsd,
+ (DDLOCK_NOSYSLOCK|DDLOCK_WAIT), NULL);
+ }
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDrawSurface3::Lock", result);
+ return(-1);
+ }
+ /* Pitch might have changed -- recalculate pitch and offset */
+#if defined(NONAMELESSUNION)
+ if ( surface->pitch != ddsd.u1.lPitch ) {
+ surface->pitch = ddsd.u1.lPitch;
+#else
+ if ( surface->pitch != ddsd.lPitch ) {
+ surface->pitch = (Uint16)ddsd.lPitch;
+#endif
+ surface->offset =
+ ((ddsd.dwHeight-surface->h)/2)*surface->pitch +
+ ((ddsd.dwWidth-surface->w)/2)*
+ surface->format->BytesPerPixel;
+ }
+ surface->pixels = ddsd.lpSurface;
+ return(0);
+}
+
+static void DX5_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ IDirectDrawSurface3_Unlock(surface->hwdata->dd_writebuf, NULL);
+ surface->pixels = NULL;
+}
+
+static int DX5_FlipHWSurface(_THIS, SDL_Surface *surface)
+{
+ HRESULT result;
+ LPDIRECTDRAWSURFACE3 dd_surface;
+
+ dd_surface = surface->hwdata->dd_surface;
+
+ /* to prevent big slowdown on fast computers, wait here instead of driver ring 0 code */
+ /* Dmitry Yakimov (ftech@tula.net) */
+ while(IDirectDrawSurface3_GetFlipStatus(dd_surface, DDGBS_ISBLTDONE) == DDERR_WASSTILLDRAWING);
+
+ result = IDirectDrawSurface3_Flip(dd_surface, NULL, DDFLIP_WAIT);
+ if ( result == DDERR_SURFACELOST ) {
+ result = IDirectDrawSurface3_Restore(
+ surface->hwdata->dd_surface);
+ while(IDirectDrawSurface3_GetFlipStatus(dd_surface, DDGBS_ISBLTDONE) == DDERR_WASSTILLDRAWING);
+ result = IDirectDrawSurface3_Flip(dd_surface, NULL, DDFLIP_WAIT);
+ }
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDrawSurface3::Flip", result);
+ return(-1);
+ }
+ return(0);
+}
+
+static void DX5_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ if ( surface->hwdata ) {
+ if ( surface->hwdata->dd_surface != SDL_primary ) {
+ IDirectDrawSurface3_Release(surface->hwdata->dd_surface);
+ }
+ SDL_free(surface->hwdata);
+ surface->hwdata = NULL;
+ }
+}
+
+void DX5_WindowUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+ HRESULT result;
+ int i;
+ RECT src, dst;
+
+ for ( i=0; i<numrects; ++i ) {
+ src.top = (LONG)rects[i].y;
+ src.bottom = (LONG)rects[i].y+rects[i].h;
+ src.left = (LONG)rects[i].x;
+ src.right = (LONG)rects[i].x+rects[i].w;
+ dst.top = SDL_bounds.top+src.top;
+ dst.left = SDL_bounds.left+src.left;
+ dst.bottom = SDL_bounds.top+src.bottom;
+ dst.right = SDL_bounds.left+src.right;
+ result = IDirectDrawSurface3_Blt(SDL_primary, &dst,
+ this->screen->hwdata->dd_surface, &src,
+ DDBLT_WAIT, NULL);
+ /* Doh! Check for lost surface and restore it */
+ if ( result == DDERR_SURFACELOST ) {
+ IDirectDrawSurface3_Restore(SDL_primary);
+ IDirectDrawSurface3_Blt(SDL_primary, &dst,
+ this->screen->hwdata->dd_surface, &src,
+ DDBLT_WAIT, NULL);
+ }
+ }
+}
+
+void DX5_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+}
+
+/* Compress a full palette into the limited number of colors given to us
+ by windows.
+
+ The "best" way to do this is to sort the colors by diversity and place
+ the most diverse colors into the limited palette. Unfortunately this
+ results in widely varying colors being displayed in the interval during
+ which the windows palette has been set, and the mapping of the shadow
+ surface to the new palette. This is especially noticeable during fades.
+
+ To deal with this problem, we can copy a predetermined portion of the
+ full palette, and use that as the limited palette. This allows colors
+ to fade smoothly as the remapping is very similar on each palette change.
+ Unfortunately, this breaks applications which partition the palette into
+ distinct and widely varying areas, expecting all colors to be available.
+
+ I'm making them both available, chosen at compile time.
+ If you want the chunk-o-palette algorithm, define SIMPLE_COMPRESSION,
+ otherwise the sort-by-diversity algorithm will be used.
+*/
+#define SIMPLE_COMPRESSION
+#define CS_CS_DIST(A, B) ({ \
+ int r = (A.r - B.r); \
+ int g = (A.g - B.g); \
+ int b = (A.b - B.b); \
+ (r*r + g*g + b*b); \
+})
+static void DX5_CompressPalette(_THIS, SDL_Color *colors, int ncolors, int maxcolors)
+{
+#ifdef SIMPLE_COMPRESSION
+ int i, j;
+#else
+ static SDL_Color zero = { 0, 0, 0, 0 };
+ int i, j;
+ int max, dist;
+ int prev, next;
+ int *pool;
+ int *seen, *order;
+#endif
+
+ /* Does this happen? */
+ if ( maxcolors > ncolors ) {
+ maxcolors = ncolors;
+ }
+
+#ifdef SIMPLE_COMPRESSION
+ /* Just copy the first "maxcolors" colors */
+ for ( j=10, i=0; i<maxcolors; ++i, ++j ) {
+ SDL_colors[j].peRed = colors[i].r;
+ SDL_colors[j].peGreen = colors[i].g;
+ SDL_colors[j].peBlue = colors[i].b;
+ }
+#else
+ /* Allocate memory for the arrays we use */
+ pool = SDL_stack_alloc(int, 2*ncolors);
+ if ( pool == NULL ) {
+ /* No worries, just return */;
+ return;
+ }
+ seen = pool;
+ SDL_memset(seen, 0, ncolors*sizeof(int));
+ order = pool+ncolors;
+
+ /* Start with the brightest color */
+ max = 0;
+ for ( i=0; i<ncolors; ++i ) {
+ dist = CS_CS_DIST(zero, colors[i]);
+ if ( dist >= max ) {
+ max = dist;
+ next = i;
+ }
+ }
+ j = 0;
+ order[j++] = next;
+ seen[next] = 1;
+ prev = next;
+
+ /* Keep going through all the colors */
+ while ( j < maxcolors ) {
+ max = 0;
+ for ( i=0; i<ncolors; ++i ) {
+ if ( seen[i] ) {
+ continue;
+ }
+ dist = CS_CS_DIST(colors[i], colors[prev]);
+ if ( dist >= max ) {
+ max = dist;
+ next = i;
+ }
+ }
+ order[j++] = next;
+ seen[next] = 1;
+ prev = next;
+ }
+
+ /* Compress the colors to the palette */
+ for ( j=10, i=0; i<maxcolors; ++i, ++j ) {
+ SDL_colors[j].peRed = colors[order[i]].r;
+ SDL_colors[j].peGreen = colors[order[i]].g;
+ SDL_colors[j].peBlue = colors[order[i]].b;
+ }
+ SDL_stack_free(pool);
+#endif /* SIMPLE_COMPRESSION */
+}
+
+/* Set the system colormap in both fullscreen and windowed modes */
+int DX5_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ int i;
+ int alloct_all;
+
+ /* Copy palette colors into display palette */
+ alloct_all = 0;
+ if ( SDL_palette != NULL ) {
+ if ( (this->screen->flags&SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
+ /* We can set all entries explicitly */
+ for ( i=0; i< ncolors; ++i ) {
+ int j = firstcolor + i;
+ SDL_colors[j].peRed = colors[i].r;
+ SDL_colors[j].peGreen = colors[i].g;
+ SDL_colors[j].peBlue = colors[i].b;
+ }
+ /* This sends an WM_PALETTECHANGED message to us */
+ colorchange_expected = 1;
+ IDirectDrawPalette_SetEntries(SDL_palette, 0,
+ firstcolor, ncolors, &SDL_colors[firstcolor]);
+ alloct_all = 1;
+ } else {
+ /* Grab the 236 most diverse colors in the palette */
+ DX5_CompressPalette(this, colors, ncolors, 236);
+ /* This sends an WM_PALETTECHANGED message to us */
+ colorchange_expected = 1;
+ IDirectDrawPalette_SetEntries(SDL_palette, 0,
+ 0, 256, SDL_colors);
+ }
+ }
+ return(alloct_all);
+}
+
+/* Gamma code is only available on DirectX 7 and newer */
+static int DX5_SetGammaRamp(_THIS, Uint16 *ramp)
+{
+#ifdef IDirectDrawGammaControl_SetGammaRamp
+ LPDIRECTDRAWGAMMACONTROL gamma;
+ DDGAMMARAMP gamma_ramp;
+ HRESULT result;
+#endif
+
+ /* In windowed or OpenGL mode, use windib gamma code */
+ if ( ! DDRAW_FULLSCREEN() ) {
+ return DIB_SetGammaRamp(this, ramp);
+ }
+
+#ifndef IDirectDrawGammaControl_SetGammaRamp
+ SDL_SetError("SDL compiled without DirectX gamma ramp support");
+ return -1;
+#else
+ /* Check for a video mode! */
+ if ( ! SDL_primary ) {
+ SDL_SetError("A video mode must be set for gamma correction");
+ return(-1);
+ }
+
+ /* Get the gamma control object */
+ result = IDirectDrawSurface3_QueryInterface(SDL_primary,
+ &IID_IDirectDrawGammaControl, (LPVOID *)&gamma);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDrawSurface3::QueryInterface(GAMMA)", result);
+ return(-1);
+ }
+
+ /* Set up the gamma ramp */
+ SDL_memcpy(gamma_ramp.red, &ramp[0*256], 256*sizeof(*ramp));
+ SDL_memcpy(gamma_ramp.green, &ramp[1*256], 256*sizeof(*ramp));
+ SDL_memcpy(gamma_ramp.blue, &ramp[2*256], 256*sizeof(*ramp));
+ result = IDirectDrawGammaControl_SetGammaRamp(gamma, 0, &gamma_ramp);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDrawGammaControl::SetGammaRamp()", result);
+ }
+
+ /* Release the interface and return */
+ IDirectDrawGammaControl_Release(gamma);
+ return (result == DD_OK) ? 0 : -1;
+#endif /* !IDirectDrawGammaControl_SetGammaRamp */
+}
+
+static int DX5_GetGammaRamp(_THIS, Uint16 *ramp)
+{
+#ifdef IDirectDrawGammaControl_SetGammaRamp
+ LPDIRECTDRAWGAMMACONTROL gamma;
+ DDGAMMARAMP gamma_ramp;
+ HRESULT result;
+#endif
+
+ /* In windowed or OpenGL mode, use windib gamma code */
+ if ( ! DDRAW_FULLSCREEN() ) {
+ return DIB_GetGammaRamp(this, ramp);
+ }
+
+#ifndef IDirectDrawGammaControl_SetGammaRamp
+ SDL_SetError("SDL compiled without DirectX gamma ramp support");
+ return -1;
+#else
+ /* Check for a video mode! */
+ if ( ! SDL_primary ) {
+ SDL_SetError("A video mode must be set for gamma correction");
+ return(-1);
+ }
+
+ /* Get the gamma control object */
+ result = IDirectDrawSurface3_QueryInterface(SDL_primary,
+ &IID_IDirectDrawGammaControl, (LPVOID *)&gamma);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDrawSurface3::QueryInterface(GAMMA)", result);
+ return(-1);
+ }
+
+ /* Set up the gamma ramp */
+ result = IDirectDrawGammaControl_GetGammaRamp(gamma, 0, &gamma_ramp);
+ if ( result == DD_OK ) {
+ SDL_memcpy(&ramp[0*256], gamma_ramp.red, 256*sizeof(*ramp));
+ SDL_memcpy(&ramp[1*256], gamma_ramp.green, 256*sizeof(*ramp));
+ SDL_memcpy(&ramp[2*256], gamma_ramp.blue, 256*sizeof(*ramp));
+ } else {
+ SetDDerror("DirectDrawGammaControl::GetGammaRamp()", result);
+ }
+
+ /* Release the interface and return */
+ IDirectDrawGammaControl_Release(gamma);
+ return (result == DD_OK) ? 0 : -1;
+#endif /* !IDirectDrawGammaControl_SetGammaRamp */
+}
+
+void DX5_VideoQuit(_THIS)
+{
+ int i, j;
+
+ /* If we're fullscreen GL, we need to reset the display */
+ if ( this->screen != NULL ) {
+#ifndef NO_CHANGEDISPLAYSETTINGS
+ if ( (this->screen->flags & (SDL_OPENGL|SDL_FULLSCREEN)) ==
+ (SDL_OPENGL|SDL_FULLSCREEN) ) {
+ ChangeDisplaySettings(NULL, 0);
+ ShowWindow(SDL_Window, SW_HIDE);
+ }
+#endif
+ if ( this->screen->flags & SDL_OPENGL ) {
+ WIN_GL_ShutDown(this);
+ }
+ }
+
+ /* Free any palettes we used */
+ if ( SDL_palette != NULL ) {
+ IDirectDrawPalette_Release(SDL_palette);
+ SDL_palette = NULL;
+ }
+
+ /* Allow the primary surface to be freed */
+ if ( SDL_primary != NULL ) {
+ SDL_primary = NULL;
+ }
+
+ /* Free video mode lists */
+ for ( i=0; i<NUM_MODELISTS; ++i ) {
+ if ( SDL_modelist[i] != NULL ) {
+ for ( j=0; SDL_modelist[i][j]; ++j )
+ SDL_free(SDL_modelist[i][j]);
+ SDL_free(SDL_modelist[i]);
+ SDL_modelist[i] = NULL;
+ }
+ }
+
+ /* Free the window */
+ DIB_QuitGamma(this);
+ if ( SDL_Window ) {
+ DX5_DestroyWindow(this);
+ }
+
+ /* Free our window icon */
+ if ( screen_icn ) {
+ DestroyIcon(screen_icn);
+ screen_icn = NULL;
+ }
+}
+
+/* Exported for the windows message loop only */
+void DX5_Activate(_THIS, BOOL active, BOOL minimized)
+{
+}
+void DX5_RealizePalette(_THIS)
+{
+ if ( SDL_palette ) {
+ IDirectDrawSurface3_SetPalette(SDL_primary, SDL_palette);
+ }
+}
+static void DX5_Recolor8Bit(_THIS, SDL_Surface *surface, Uint8 *mapping)
+{
+ int row, col;
+ Uint8 *pixels;
+
+ if ( surface->w && surface->h ) {
+ if ( (surface->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
+ if ( this->LockHWSurface(this, surface) < 0 ) {
+ return;
+ }
+ }
+ for ( row=0; row<surface->h; ++row ) {
+ pixels = (Uint8 *)surface->pixels+row*surface->pitch;
+ for ( col=0; col<surface->w; ++col, ++pixels ) {
+ *pixels = mapping[*pixels];
+ }
+ }
+ if ( (surface->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
+ this->UnlockHWSurface(this, surface);
+ }
+ SDL_UpdateRect(surface, 0, 0, 0, 0);
+ }
+}
+void DX5_PaletteChanged(_THIS, HWND window)
+{
+ SDL_Palette *palette;
+ SDL_Color *saved = NULL;
+ HDC hdc;
+ int i;
+ PALETTEENTRY *entries;
+
+ /* This is true when the window is closing */
+ if ( (SDL_primary == NULL) || (SDL_VideoSurface == NULL) )
+ return;
+
+ /* We need to get the colors as they were set */
+ palette = this->physpal;
+ if(!palette)
+ palette = SDL_VideoSurface->format->palette;
+ if ( palette == NULL ) { /* Sometimes we don't have a palette */
+ return;
+ }
+ entries = SDL_stack_alloc(PALETTEENTRY, palette->ncolors);
+ hdc = GetDC(window);
+ GetSystemPaletteEntries(hdc, 0, palette->ncolors, entries);
+ ReleaseDC(window, hdc);
+ if ( ! colorchange_expected ) {
+ saved = SDL_stack_alloc(SDL_Color, palette->ncolors);
+ SDL_memcpy(saved, palette->colors,
+ palette->ncolors*sizeof(SDL_Color));
+ }
+ for ( i=0; i<palette->ncolors; ++i ) {
+ palette->colors[i].r = entries[i].peRed;
+ palette->colors[i].g = entries[i].peGreen;
+ palette->colors[i].b = entries[i].peBlue;
+ }
+ SDL_stack_free(entries);
+ if ( ! colorchange_expected ) {
+ Uint8 mapping[256];
+
+ SDL_memset(mapping, 0, sizeof(mapping));
+ for ( i=0; i<palette->ncolors; ++i ) {
+ mapping[i] = SDL_FindColor(palette,
+ saved[i].r, saved[i].g, saved[i].b);
+ }
+ DX5_Recolor8Bit(this, SDL_VideoSurface, mapping);
+ SDL_stack_free(saved);
+ }
+ colorchange_expected = 0;
+
+ /* Notify all mapped surfaces of the change */
+ SDL_FormatChanged(SDL_VideoSurface);
+}
+
+/* Exported for the windows message loop only */
+void DX5_WinPAINT(_THIS, HDC hdc)
+{
+ SDL_UpdateRect(SDL_PublicSurface, 0, 0, 0, 0);
+}
diff --git a/distrib/sdl-1.2.15/src/video/windx5/SDL_dx5video.h b/distrib/sdl-1.2.15/src/video/windx5/SDL_dx5video.h
new file mode 100644
index 0000000..3d754a0
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/windx5/SDL_dx5video.h
@@ -0,0 +1,61 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_dx5video_h
+#define _SDL_dx5video_h
+
+#include "directx.h"
+
+/* Private display data */
+struct SDL_PrivateVideoData {
+ LPDIRECTDRAW2 ddraw2;
+ LPDIRECTDRAWSURFACE3 SDL_primary;
+ LPDIRECTDRAWCLIPPER SDL_clipper;
+ LPDIRECTDRAWPALETTE SDL_palette;
+ PALETTEENTRY SDL_colors[256];
+ int colorchange_expected;
+
+#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
+ int SDL_nummodes[NUM_MODELISTS];
+ SDL_Rect **SDL_modelist[NUM_MODELISTS];
+ int SDL_modeindex[NUM_MODELISTS];
+};
+/* Old variable names */
+#define ddraw2 (this->hidden->ddraw2)
+#define SDL_primary (this->hidden->SDL_primary)
+#define SDL_clipper (this->hidden->SDL_clipper)
+#define SDL_palette (this->hidden->SDL_palette)
+#define SDL_colors (this->hidden->SDL_colors)
+#define colorchange_expected (this->hidden->colorchange_expected)
+#define SDL_nummodes (this->hidden->SDL_nummodes)
+#define SDL_modelist (this->hidden->SDL_modelist)
+#define SDL_modeindex (this->hidden->SDL_modeindex)
+
+/* DirectX function pointers for video and events */
+extern HRESULT (WINAPI *DDrawCreate)( GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter );
+extern HRESULT (WINAPI *DInputCreate)(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUT *ppDI, LPUNKNOWN punkOuter);
+
+/* DirectDraw error reporting function */
+extern void SetDDerror(const char *function, int code);
+
+#endif /* _SDL_dx5video_h */
diff --git a/distrib/sdl-1.2.15/src/video/windx5/SDL_dx5yuv.c b/distrib/sdl-1.2.15/src/video/windx5/SDL_dx5yuv.c
new file mode 100644
index 0000000..cb89fdc
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/windx5/SDL_dx5yuv.c
@@ -0,0 +1,296 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This is the DirectDraw implementation of YUV video overlays */
+#include "directx.h"
+#include "SDL_video.h"
+#include "SDL_dx5yuv_c.h"
+#include "../SDL_yuvfuncs.h"
+
+//#define USE_DIRECTX_OVERLAY
+
+/* The functions used to manipulate software video overlays */
+static struct private_yuvhwfuncs dx5_yuvfuncs = {
+ DX5_LockYUVOverlay,
+ DX5_UnlockYUVOverlay,
+ DX5_DisplayYUVOverlay,
+ DX5_FreeYUVOverlay
+};
+
+struct private_yuvhwdata {
+ LPDIRECTDRAWSURFACE3 surface;
+
+ /* These are just so we don't have to allocate them separately */
+ Uint16 pitches[3];
+ Uint8 *planes[3];
+};
+
+
+static LPDIRECTDRAWSURFACE3 CreateYUVSurface(_THIS,
+ int width, int height, Uint32 format)
+{
+ HRESULT result;
+ LPDIRECTDRAWSURFACE dd_surface1;
+ LPDIRECTDRAWSURFACE3 dd_surface3;
+ DDSURFACEDESC ddsd;
+
+ /* Set up the surface description */
+ SDL_memset(&ddsd, 0, sizeof(ddsd));
+ ddsd.dwSize = sizeof(ddsd);
+ ddsd.dwFlags = (DDSD_WIDTH|DDSD_HEIGHT|DDSD_CAPS|DDSD_PIXELFORMAT);
+ ddsd.dwWidth = width;
+ ddsd.dwHeight= height;
+#ifdef USE_DIRECTX_OVERLAY
+ ddsd.ddsCaps.dwCaps = (DDSCAPS_OVERLAY|DDSCAPS_VIDEOMEMORY);
+#else
+ ddsd.ddsCaps.dwCaps = (DDSCAPS_OFFSCREENPLAIN|DDSCAPS_VIDEOMEMORY);
+#endif
+ ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
+ ddsd.ddpfPixelFormat.dwFlags = DDPF_FOURCC;
+ ddsd.ddpfPixelFormat.dwFourCC = format;
+
+ /* Create the DirectDraw video surface */
+ result = IDirectDraw2_CreateSurface(ddraw2, &ddsd, &dd_surface1, NULL);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDraw2::CreateSurface", result);
+ return(NULL);
+ }
+ result = IDirectDrawSurface_QueryInterface(dd_surface1,
+ &IID_IDirectDrawSurface3, (LPVOID *)&dd_surface3);
+ IDirectDrawSurface_Release(dd_surface1);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDrawSurface::QueryInterface", result);
+ return(NULL);
+ }
+
+ /* Make sure the surface format was set properly */
+ SDL_memset(&ddsd, 0, sizeof(ddsd));
+ ddsd.dwSize = sizeof(ddsd);
+ result = IDirectDrawSurface3_Lock(dd_surface3, NULL,
+ &ddsd, DDLOCK_NOSYSLOCK, NULL);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDrawSurface3::Lock", result);
+ IDirectDrawSurface_Release(dd_surface3);
+ return(NULL);
+ }
+ IDirectDrawSurface3_Unlock(dd_surface3, NULL);
+
+ if ( !(ddsd.ddpfPixelFormat.dwFlags & DDPF_FOURCC) ||
+ (ddsd.ddpfPixelFormat.dwFourCC != format) ) {
+ SDL_SetError("DDraw didn't use requested FourCC format");
+ IDirectDrawSurface_Release(dd_surface3);
+ return(NULL);
+ }
+
+ /* We're ready to go! */
+ return(dd_surface3);
+}
+
+#ifdef DEBUG_YUV
+static char *PrintFOURCC(Uint32 code)
+{
+ static char buf[5];
+
+ buf[3] = code >> 24;
+ buf[2] = (code >> 16) & 0xFF;
+ buf[1] = (code >> 8) & 0xFF;
+ buf[0] = (code & 0xFF);
+ return(buf);
+}
+#endif
+
+SDL_Overlay *DX5_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display)
+{
+ SDL_Overlay *overlay;
+ struct private_yuvhwdata *hwdata;
+
+#ifdef DEBUG_YUV
+ DWORD numcodes;
+ DWORD *codes;
+
+ printf("FOURCC format requested: 0x%x\n", PrintFOURCC(format));
+ IDirectDraw2_GetFourCCCodes(ddraw2, &numcodes, NULL);
+ if ( numcodes ) {
+ DWORD i;
+ codes = SDL_malloc(numcodes*sizeof(*codes));
+ if ( codes ) {
+ IDirectDraw2_GetFourCCCodes(ddraw2, &numcodes, codes);
+ for ( i=0; i<numcodes; ++i ) {
+ fprintf(stderr, "Code %d: 0x%x\n", i, PrintFOURCC(codes[i]));
+ }
+ SDL_free(codes);
+ }
+ } else {
+ fprintf(stderr, "No FOURCC codes supported\n");
+ }
+#endif
+
+ /* Create the overlay structure */
+ overlay = (SDL_Overlay *)SDL_malloc(sizeof *overlay);
+ if ( overlay == NULL ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ SDL_memset(overlay, 0, (sizeof *overlay));
+
+ /* Fill in the basic members */
+ overlay->format = format;
+ overlay->w = width;
+ overlay->h = height;
+
+ /* Set up the YUV surface function structure */
+ overlay->hwfuncs = &dx5_yuvfuncs;
+
+ /* Create the pixel data and lookup tables */
+ hwdata = (struct private_yuvhwdata *)SDL_malloc(sizeof *hwdata);
+ overlay->hwdata = hwdata;
+ if ( hwdata == NULL ) {
+ SDL_OutOfMemory();
+ SDL_FreeYUVOverlay(overlay);
+ return(NULL);
+ }
+ hwdata->surface = CreateYUVSurface(this, width, height, format);
+ if ( hwdata->surface == NULL ) {
+ SDL_FreeYUVOverlay(overlay);
+ return(NULL);
+ }
+ overlay->hw_overlay = 1;
+
+ /* Set up the plane pointers */
+ overlay->pitches = hwdata->pitches;
+ overlay->pixels = hwdata->planes;
+ switch (format) {
+ case SDL_YV12_OVERLAY:
+ case SDL_IYUV_OVERLAY:
+ overlay->planes = 3;
+ break;
+ default:
+ overlay->planes = 1;
+ break;
+ }
+
+ /* We're all done.. */
+ return(overlay);
+}
+
+int DX5_LockYUVOverlay(_THIS, SDL_Overlay *overlay)
+{
+ HRESULT result;
+ LPDIRECTDRAWSURFACE3 surface;
+ DDSURFACEDESC ddsd;
+
+ surface = overlay->hwdata->surface;
+ SDL_memset(&ddsd, 0, sizeof(ddsd));
+ ddsd.dwSize = sizeof(ddsd);
+ result = IDirectDrawSurface3_Lock(surface, NULL,
+ &ddsd, DDLOCK_NOSYSLOCK, NULL);
+ if ( result == DDERR_SURFACELOST ) {
+ result = IDirectDrawSurface3_Restore(surface);
+ result = IDirectDrawSurface3_Lock(surface, NULL, &ddsd,
+ (DDLOCK_NOSYSLOCK|DDLOCK_WAIT), NULL);
+ }
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDrawSurface3::Lock", result);
+ return(-1);
+ }
+
+ /* Find the pitch and offset values for the overlay */
+#if defined(NONAMELESSUNION)
+ overlay->pitches[0] = (Uint16)ddsd.u1.lPitch;
+#else
+ overlay->pitches[0] = (Uint16)ddsd.lPitch;
+#endif
+ overlay->pixels[0] = (Uint8 *)ddsd.lpSurface;
+ switch (overlay->format) {
+ case SDL_YV12_OVERLAY:
+ case SDL_IYUV_OVERLAY:
+ /* Add the two extra planes */
+ overlay->pitches[1] = overlay->pitches[0] / 2;
+ overlay->pitches[2] = overlay->pitches[0] / 2;
+ overlay->pixels[1] = overlay->pixels[0] +
+ overlay->pitches[0] * overlay->h;
+ overlay->pixels[2] = overlay->pixels[1] +
+ overlay->pitches[1] * overlay->h / 2;
+ break;
+ default:
+ /* Only one plane, no worries */
+ break;
+ }
+ return(0);
+}
+
+void DX5_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay)
+{
+ LPDIRECTDRAWSURFACE3 surface;
+
+ surface = overlay->hwdata->surface;
+ IDirectDrawSurface3_Unlock(surface, NULL);
+}
+
+int DX5_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst)
+{
+ HRESULT result;
+ LPDIRECTDRAWSURFACE3 surface;
+ RECT srcrect, dstrect;
+
+ surface = overlay->hwdata->surface;
+ srcrect.top = src->y;
+ srcrect.bottom = srcrect.top+src->h;
+ srcrect.left = src->x;
+ srcrect.right = srcrect.left+src->w;
+ dstrect.top = SDL_bounds.top+dst->y;
+ dstrect.left = SDL_bounds.left+dst->x;
+ dstrect.bottom = dstrect.top+dst->h;
+ dstrect.right = dstrect.left+dst->w;
+#ifdef USE_DIRECTX_OVERLAY
+ result = IDirectDrawSurface3_UpdateOverlay(surface, &srcrect,
+ SDL_primary, &dstrect, DDOVER_SHOW, NULL);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDrawSurface3::UpdateOverlay", result);
+ return(-1);
+ }
+#else
+ result = IDirectDrawSurface3_Blt(SDL_primary, &dstrect, surface, &srcrect,
+ DDBLT_WAIT, NULL);
+ if ( result != DD_OK ) {
+ SetDDerror("DirectDrawSurface3::Blt", result);
+ return(-1);
+ }
+#endif
+ return(0);
+}
+
+void DX5_FreeYUVOverlay(_THIS, SDL_Overlay *overlay)
+{
+ struct private_yuvhwdata *hwdata;
+
+ hwdata = overlay->hwdata;
+ if ( hwdata ) {
+ if ( hwdata->surface ) {
+ IDirectDrawSurface_Release(hwdata->surface);
+ }
+ SDL_free(hwdata);
+ overlay->hwdata = NULL;
+ }
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/windx5/SDL_dx5yuv_c.h b/distrib/sdl-1.2.15/src/video/windx5/SDL_dx5yuv_c.h
new file mode 100644
index 0000000..dfceaf9
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/windx5/SDL_dx5yuv_c.h
@@ -0,0 +1,38 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This is the DirectDraw implementation of YUV video overlays */
+
+#include "SDL_video.h"
+#include "../wincommon/SDL_lowvideo.h"
+#include "SDL_dx5video.h"
+
+extern SDL_Overlay *DX5_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display);
+
+extern int DX5_LockYUVOverlay(_THIS, SDL_Overlay *overlay);
+
+extern void DX5_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay);
+
+extern int DX5_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst);
+
+extern void DX5_FreeYUVOverlay(_THIS, SDL_Overlay *overlay);
diff --git a/distrib/sdl-1.2.15/src/video/windx5/directx.h b/distrib/sdl-1.2.15/src/video/windx5/directx.h
new file mode 100644
index 0000000..c7f5365
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/windx5/directx.h
@@ -0,0 +1,97 @@
+
+#ifndef _directx_h
+#define _directx_h
+
+/* Include all of the DirectX 5.0 headers and adds any necessary tweaks */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <mmsystem.h>
+#ifndef WIN32
+#define WIN32
+#endif
+#undef WINNT
+
+/* Far pointers don't exist in 32-bit code */
+#ifndef FAR
+#define FAR
+#endif
+
+/* Error codes not yet included in Win32 API header files */
+#ifndef MAKE_HRESULT
+#define MAKE_HRESULT(sev,fac,code) \
+ ((HRESULT)(((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))))
+#endif
+
+#ifndef S_OK
+#define S_OK (HRESULT)0x00000000L
+#endif
+
+#ifndef SUCCEEDED
+#define SUCCEEDED(x) ((HRESULT)(x) >= 0)
+#endif
+#ifndef FAILED
+#define FAILED(x) ((HRESULT)(x)<0)
+#endif
+
+#ifndef E_FAIL
+#define E_FAIL (HRESULT)0x80000008L
+#endif
+#ifndef E_NOINTERFACE
+#define E_NOINTERFACE (HRESULT)0x80004002L
+#endif
+#ifndef E_OUTOFMEMORY
+#define E_OUTOFMEMORY (HRESULT)0x8007000EL
+#endif
+#ifndef E_INVALIDARG
+#define E_INVALIDARG (HRESULT)0x80070057L
+#endif
+#ifndef E_NOTIMPL
+#define E_NOTIMPL (HRESULT)0x80004001L
+#endif
+#ifndef REGDB_E_CLASSNOTREG
+#define REGDB_E_CLASSNOTREG (HRESULT)0x80040154L
+#endif
+
+/* Severity codes */
+#ifndef SEVERITY_ERROR
+#define SEVERITY_ERROR 1
+#endif
+
+/* Error facility codes */
+#ifndef FACILITY_WIN32
+#define FACILITY_WIN32 7
+#endif
+
+#ifndef FIELD_OFFSET
+#define FIELD_OFFSET(type, field) ((LONG)&(((type *)0)->field))
+#endif
+
+/* DirectX headers (if it isn't included, I haven't tested it yet)
+ */
+/* We need these defines to mark what version of DirectX API we use */
+#define DIRECTDRAW_VERSION 0x0700
+#define DIRECTSOUND_VERSION 0x0500
+#define DIRECTINPUT_VERSION 0x0700
+
+#include <ddraw.h>
+#include <dsound.h>
+#include <dinput.h>
+
+#if DIRECTINPUT_VERSION >= 0x0700 && !defined(DIMOFS_BUTTON4)
+typedef struct _DIMOUSESTATE2 {
+ LONG lX;
+ LONG lY;
+ LONG lZ;
+ BYTE rgbButtons[8];
+} DIMOUSESTATE2, *LPDIMOUSESTATE2;
+
+#define DIMOFS_BUTTON4 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 4)
+#define DIMOFS_BUTTON5 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 5)
+#define DIMOFS_BUTTON6 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 6)
+#define DIMOFS_BUTTON7 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 7)
+
+extern const DIDATAFORMAT c_dfDIMouse2;
+#endif
+
+#endif /* _directx_h */
diff --git a/distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsevents.c b/distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsevents.c
new file mode 100644
index 0000000..635b972
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsevents.c
@@ -0,0 +1,233 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <sys/types.h>
+#include <dev/wscons/wsdisplay_usl_io.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <termios.h>
+#include <errno.h>
+#include <string.h>
+
+#include "SDL.h"
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_wsconsvideo.h"
+#include "SDL_wsconsevents_c.h"
+
+static int posted = 0;
+
+int WSCONS_InitKeyboard(_THIS)
+{
+ struct termios tty;
+
+ if (ioctl(private->fd, WSKBDIO_GTYPE, &private->kbdType) == -1) {
+ WSCONS_ReportError("cannot get keyboard type: %s", strerror(errno));
+ return -1;
+ }
+
+ if (tcgetattr(private->fd, &private->saved_tty) == -1) {
+ WSCONS_ReportError("cannot get terminal attributes: %s", strerror(errno));
+ return -1;
+ }
+ private->did_save_tty = 1;
+ tty = private->saved_tty;
+ tty.c_iflag = IGNPAR | IGNBRK;
+ tty.c_oflag = 0;
+ tty.c_cflag = CREAD | CS8;
+ tty.c_lflag = 0;
+ tty.c_cc[VTIME] = 0;
+ tty.c_cc[VMIN] = 1;
+ cfsetispeed(&tty, 9600);
+ cfsetospeed(&tty, 9600);
+ if (tcsetattr(private->fd, TCSANOW, &tty) < 0) {
+ WSCONS_ReportError("cannot set terminal attributes: %s", strerror(errno));
+ return -1;
+ }
+ if (ioctl(private->fd, KDSKBMODE, K_RAW) == -1) {
+ WSCONS_ReportError("cannot set raw keyboard mode: %s", strerror(errno));
+ return -1;
+ }
+
+ return 0;
+}
+
+void WSCONS_ReleaseKeyboard(_THIS)
+{
+ if (private->fd != -1) {
+ if (ioctl(private->fd, KDSKBMODE, K_XLATE) == -1) {
+ WSCONS_ReportError("cannot restore keyboard to translated mode: %s",
+ strerror(errno));
+ }
+ if (private->did_save_tty) {
+ if (tcsetattr(private->fd, TCSANOW, &private->saved_tty) < 0) {
+ WSCONS_ReportError("cannot restore keynoard attributes: %s",
+ strerror(errno));
+ }
+ }
+ }
+}
+
+static void updateMouse()
+{
+}
+
+static SDLKey keymap[128];
+
+static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym)
+{
+ keysym->scancode = scancode;
+ keysym->sym = SDLK_UNKNOWN;
+ keysym->mod = KMOD_NONE;
+
+ if (scancode < SDL_arraysize(keymap))
+ keysym->sym = keymap[scancode];
+
+ if (keysym->sym == SDLK_UNKNOWN)
+ printf("Unknown mapping for scancode %d\n", scancode);
+
+ return keysym;
+}
+
+static void updateKeyboard(_THIS)
+{
+ unsigned char buf[100];
+ SDL_keysym keysym;
+ int n, i;
+
+ if ((n = read(private->fd, buf, sizeof(buf))) > 0) {
+ for (i = 0; i < n; i++) {
+ unsigned char c = buf[i] & 0x7f;
+ if (c == 224) // special key prefix -- what should we do with it?
+ continue;
+ posted += SDL_PrivateKeyboard((buf[i] & 0x80) ? SDL_RELEASED : SDL_PRESSED,
+ TranslateKey(c, &keysym));
+ }
+ }
+}
+
+void WSCONS_PumpEvents(_THIS)
+{
+ do {
+ posted = 0;
+ updateMouse();
+ updateKeyboard(this);
+ } while (posted);
+}
+
+void WSCONS_InitOSKeymap(_THIS)
+{
+ int i;
+
+ /* Make sure unknown keys are mapped correctly */
+ for (i=0; i < SDL_arraysize(keymap); i++) {
+ keymap[i] = SDLK_UNKNOWN;
+ }
+
+ switch (private->kbdType) {
+#ifdef WSKBD_TYPE_ZAURUS
+ case WSKBD_TYPE_ZAURUS:
+ /* top row */
+ keymap[2] = SDLK_1;
+ keymap[3] = SDLK_2;
+ keymap[4] = SDLK_3;
+ keymap[5] = SDLK_4;
+ keymap[6] = SDLK_5;
+ keymap[7] = SDLK_6;
+ keymap[8] = SDLK_7;
+ keymap[9] = SDLK_8;
+ keymap[10] = SDLK_9;
+ keymap[11] = SDLK_0;
+ keymap[14] = SDLK_BACKSPACE;
+
+ /* second row */
+ keymap[16] = SDLK_q;
+ keymap[17] = SDLK_w;
+ keymap[18] = SDLK_e;
+ keymap[19] = SDLK_r;
+ keymap[20] = SDLK_t;
+ keymap[21] = SDLK_y;
+ keymap[22] = SDLK_u;
+ keymap[23] = SDLK_i;
+ keymap[24] = SDLK_o;
+ keymap[25] = SDLK_p;
+
+ /* third row */
+ keymap[15] = SDLK_TAB;
+ keymap[30] = SDLK_a;
+ keymap[31] = SDLK_s;
+ keymap[32] = SDLK_d;
+ keymap[33] = SDLK_f;
+ keymap[34] = SDLK_g;
+ keymap[35] = SDLK_h;
+ keymap[36] = SDLK_j;
+ keymap[37] = SDLK_k;
+ keymap[38] = SDLK_l;
+
+ /* fourth row */
+ keymap[42] = SDLK_LSHIFT;
+ keymap[44] = SDLK_z;
+ keymap[45] = SDLK_x;
+ keymap[46] = SDLK_c;
+ keymap[47] = SDLK_v;
+ keymap[48] = SDLK_b;
+ keymap[49] = SDLK_n;
+ keymap[50] = SDLK_m;
+ keymap[54] = SDLK_RSHIFT;
+ keymap[28] = SDLK_RETURN;
+
+ /* fifth row */
+ keymap[56] = SDLK_LALT;
+ keymap[29] = SDLK_LCTRL;
+ /* keymap[56] = ; */
+ keymap[0] = SDLK_LSUPER;
+ keymap[12] = SDLK_MINUS;
+ keymap[57] = SDLK_SPACE;
+ keymap[51] = SDLK_COMMA;
+ keymap[52] = SDLK_PERIOD;
+
+ /* misc */
+ keymap[59] = SDLK_F1;
+ keymap[60] = SDLK_F2;
+ keymap[61] = SDLK_F3;
+ keymap[62] = SDLK_F4;
+ keymap[63] = SDLK_F5;
+ keymap[1] = SDLK_ESCAPE;
+ /* keymap[28] = SDLK_KP_ENTER; */
+ keymap[72] = SDLK_UP;
+ keymap[75] = SDLK_LEFT;
+ keymap[77] = SDLK_RIGHT;
+ keymap[80] = SDLK_DOWN;
+ break;
+#endif /* WSKBD_TYPE_ZAURUS */
+
+ default:
+ WSCONS_ReportError("Unable to map keys for keyboard type %u",
+ private->kbdType);
+ break;
+ }
+}
+
+/* end of SDL_wsconsevents.c ... */
+
diff --git a/distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsevents_c.h b/distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsevents_c.h
new file mode 100644
index 0000000..f68ee6e
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsevents_c.h
@@ -0,0 +1,36 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_wsconsvideo.h"
+
+int WSCONS_InitKeyboard(_THIS);
+void WSCONS_ReleaseKeyboard(_THIS);
+
+/* Variables and functions exported by SDL_sysevents.c to other parts
+ of the native video subsystem (SDL_sysvideo.c)
+*/
+extern void WSCONS_InitOSKeymap(_THIS);
+extern void WSCONS_PumpEvents(_THIS);
+
+/* end of SDL_wsconsevents_c.h ... */
+
diff --git a/distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsmouse.c b/distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsmouse.c
new file mode 100644
index 0000000..b69e0c5
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsmouse.c
@@ -0,0 +1,33 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_mouse.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_wsconsmouse_c.h"
+
+
+/* The implementation dependent data for the window manager cursor */
+struct WMcursor {
+ int unused;
+};
diff --git a/distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsmouse_c.h b/distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsmouse_c.h
new file mode 100644
index 0000000..875437b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsmouse_c.h
@@ -0,0 +1,26 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_wsconsvideo.h"
+
+/* Functions to be exported */
diff --git a/distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsvideo.c b/distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsvideo.c
new file mode 100644
index 0000000..0e850d1
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsvideo.c
@@ -0,0 +1,609 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <sys/time.h>
+#include <sys/mman.h>
+#include <sys/ioctl.h>
+#include <dev/wscons/wsdisplay_usl_io.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+
+#include "SDL_wsconsvideo.h"
+#include "SDL_wsconsevents_c.h"
+#include "SDL_wsconsmouse_c.h"
+
+#define WSCONSVID_DRIVER_NAME "wscons"
+enum {
+ WSCONS_ROTATE_NONE = 0,
+ WSCONS_ROTATE_CCW = 90,
+ WSCONS_ROTATE_UD = 180,
+ WSCONS_ROTATE_CW = 270
+};
+
+#define min(a,b) ((a)<(b)?(a):(b))
+
+/* Initialization/Query functions */
+static int WSCONS_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **WSCONS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *WSCONS_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int WSCONS_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
+static void WSCONS_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int WSCONS_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int WSCONS_LockHWSurface(_THIS, SDL_Surface *surface);
+static void WSCONS_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void WSCONS_FreeHWSurface(_THIS, SDL_Surface *surface);
+
+/* etc. */
+static WSCONS_bitBlit WSCONS_blit16;
+static WSCONS_bitBlit WSCONS_blit16blocked;
+static void WSCONS_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
+
+void WSCONS_ReportError(char *fmt, ...)
+{
+ char message[200];
+ va_list vaArgs;
+
+ message[199] = '\0';
+
+ va_start(vaArgs, fmt);
+ vsnprintf(message, 199, fmt, vaArgs);
+ va_end(vaArgs);
+
+ SDL_SetError(message);
+ fprintf(stderr, "WSCONS error: %s\n", message);
+}
+
+/* WSCONS driver bootstrap functions */
+
+static int WSCONS_Available(void)
+{
+ return 1;
+}
+
+static void WSCONS_DeleteDevice(SDL_VideoDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_VideoDevice *WSCONS_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device;
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if (device == NULL) {
+ SDL_OutOfMemory();
+ return 0;
+ }
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden =
+ (struct SDL_PrivateVideoData *)SDL_malloc((sizeof *device->hidden));
+ if (device->hidden == NULL) {
+ SDL_OutOfMemory();
+ SDL_free(device);
+ return(0);
+ }
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+ device->hidden->fd = -1;
+
+ /* Set the function pointers */
+ device->VideoInit = WSCONS_VideoInit;
+ device->ListModes = WSCONS_ListModes;
+ device->SetVideoMode = WSCONS_SetVideoMode;
+ device->SetColors = WSCONS_SetColors;
+ device->UpdateRects = WSCONS_UpdateRects;
+ device->VideoQuit = WSCONS_VideoQuit;
+ device->AllocHWSurface = WSCONS_AllocHWSurface;
+ device->LockHWSurface = WSCONS_LockHWSurface;
+ device->UnlockHWSurface = WSCONS_UnlockHWSurface;
+ device->FreeHWSurface = WSCONS_FreeHWSurface;
+ device->InitOSKeymap = WSCONS_InitOSKeymap;
+ device->PumpEvents = WSCONS_PumpEvents;
+ device->free = WSCONS_DeleteDevice;
+
+ return device;
+}
+
+VideoBootStrap WSCONS_bootstrap = {
+ WSCONSVID_DRIVER_NAME,
+ "SDL wscons video driver",
+ WSCONS_Available,
+ WSCONS_CreateDevice
+};
+
+#define WSCONSDEV_FORMAT "/dev/ttyC%01x"
+
+int WSCONS_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ char devnamebuf[30];
+ char *devname;
+ char *rotation;
+ int wstype;
+ int wsmode = WSDISPLAYIO_MODE_DUMBFB;
+ size_t len, mapsize;
+ int pagemask;
+ int width, height;
+
+ devname = SDL_getenv("SDL_WSCONSDEV");
+ if (devname == NULL) {
+ int activeVT;
+ if (ioctl(STDIN_FILENO, VT_GETACTIVE, &activeVT) == -1) {
+ WSCONS_ReportError("Unable to determine active terminal: %s",
+ strerror(errno));
+ return -1;
+ }
+ SDL_snprintf(devnamebuf, sizeof(devnamebuf), WSCONSDEV_FORMAT, activeVT - 1);
+ devname = devnamebuf;
+ }
+
+ private->fd = open(devname, O_RDWR | O_NONBLOCK, 0);
+ if (private->fd == -1) {
+ WSCONS_ReportError("open %s: %s", devname, strerror(errno));
+ return -1;
+ }
+ if (ioctl(private->fd, WSDISPLAYIO_GINFO, &private->info) == -1) {
+ WSCONS_ReportError("ioctl WSDISPLAY_GINFO: %s", strerror(errno));
+ return -1;
+ }
+ if (ioctl(private->fd, WSDISPLAYIO_GTYPE, &wstype) == -1) {
+ WSCONS_ReportError("ioctl WSDISPLAY_GTYPE: %s", strerror(errno));
+ return -1;
+ }
+ if (ioctl(private->fd, WSDISPLAYIO_LINEBYTES, &private->physlinebytes) == -1) {
+ WSCONS_ReportError("ioctl WSDISPLAYIO_LINEBYTES: %s", strerror(errno));
+ return -1;
+ }
+ if (private->info.depth > 8) {
+ if (wstype == WSDISPLAY_TYPE_SUN24 ||
+ wstype == WSDISPLAY_TYPE_SUNCG12 ||
+ wstype == WSDISPLAY_TYPE_SUNCG14 ||
+ wstype == WSDISPLAY_TYPE_SUNTCX ||
+ wstype == WSDISPLAY_TYPE_SUNFFB) {
+ private->redMask = 0x0000ff;
+ private->greenMask = 0x00ff00;
+ private->blueMask = 0xff0000;
+#ifdef WSDISPLAY_TYPE_PXALCD
+ } else if (wstype == WSDISPLAY_TYPE_PXALCD) {
+ private->redMask = 0x1f << 11;
+ private->greenMask = 0x3f << 5;
+ private->blueMask = 0x1f;
+#endif
+ } else {
+ WSCONS_ReportError("Unknown video hardware");
+ return -1;
+ }
+ } else {
+ WSCONS_ReportError("Displays with 8 bpp or less are not supported");
+ return -1;
+ }
+
+ private->rotate = WSCONS_ROTATE_NONE;
+ rotation = SDL_getenv("SDL_VIDEO_WSCONS_ROTATION");
+ if (rotation != NULL) {
+ if (SDL_strlen(rotation) == 0) {
+ private->shadowFB = 0;
+ private->rotate = WSCONS_ROTATE_NONE;
+ printf("Not rotating, no shadow\n");
+ } else if (!SDL_strcmp(rotation, "NONE")) {
+ private->shadowFB = 1;
+ private->rotate = WSCONS_ROTATE_NONE;
+ printf("Not rotating, but still using shadow\n");
+ } else if (!SDL_strcmp(rotation, "CW")) {
+ private->shadowFB = 1;
+ private->rotate = WSCONS_ROTATE_CW;
+ printf("Rotating screen clockwise\n");
+ } else if (!SDL_strcmp(rotation, "CCW")) {
+ private->shadowFB = 1;
+ private->rotate = WSCONS_ROTATE_CCW;
+ printf("Rotating screen counter clockwise\n");
+ } else if (!SDL_strcmp(rotation, "UD")) {
+ private->shadowFB = 1;
+ private->rotate = WSCONS_ROTATE_UD;
+ printf("Rotating screen upside down\n");
+ } else {
+ WSCONS_ReportError("\"%s\" is not a valid value for "
+ "SDL_VIDEO_WSCONS_ROTATION", rotation);
+ return -1;
+ }
+ }
+
+ switch (private->info.depth) {
+ case 1:
+ case 4:
+ case 8:
+ len = private->physlinebytes * private->info.height;
+ break;
+ case 16:
+ if (private->physlinebytes == private->info.width) {
+ len = private->info.width * private->info.height * sizeof(short);
+ } else {
+ len = private->physlinebytes * private->info.height;
+ }
+ if (private->rotate == WSCONS_ROTATE_NONE ||
+ private->rotate == WSCONS_ROTATE_UD) {
+ private->blitFunc = WSCONS_blit16;
+ } else {
+ private->blitFunc = WSCONS_blit16blocked;
+ }
+ break;
+ case 32:
+ if (private->physlinebytes == private->info.width) {
+ len = private->info.width * private->info.height * sizeof(int);
+ } else {
+ len = private->physlinebytes * private->info.height;
+ }
+ break;
+ default:
+ WSCONS_ReportError("unsupported depth %d", private->info.depth);
+ return -1;
+ }
+
+ if (private->shadowFB && private->blitFunc == NULL) {
+ WSCONS_ReportError("Using software buffer, but no blitter function is "
+ "available for this %d bpp.", private->info.depth);
+ return -1;
+ }
+
+ if (ioctl(private->fd, WSDISPLAYIO_SMODE, &wsmode) == -1) {
+ WSCONS_ReportError("ioctl SMODE");
+ return -1;
+ }
+
+ pagemask = getpagesize() - 1;
+ mapsize = ((int)len + pagemask) & ~pagemask;
+ private->physmem = (Uint8 *)mmap(NULL, mapsize,
+ PROT_READ | PROT_WRITE, MAP_SHARED,
+ private->fd, (off_t)0);
+ if (private->physmem == (Uint8 *)MAP_FAILED) {
+ private->physmem = NULL;
+ WSCONS_ReportError("mmap: %s", strerror(errno));
+ return -1;
+ }
+ private->fbmem_len = len;
+
+ if (private->rotate == WSCONS_ROTATE_CW ||
+ private->rotate == WSCONS_ROTATE_CCW) {
+ width = private->info.height;
+ height = private->info.width;
+ } else {
+ width = private->info.width;
+ height = private->info.height;
+ }
+
+ this->info.current_w = width;
+ this->info.current_h = height;
+
+ if (private->shadowFB) {
+ private->shadowmem = (Uint8 *)SDL_malloc(len);
+ if (private->shadowmem == NULL) {
+ WSCONS_ReportError("No memory for shadow");
+ return -1;
+ }
+ private->fbstart = private->shadowmem;
+ private->fblinebytes = width * ((private->info.depth + 7) / 8);
+ } else {
+ private->fbstart = private->physmem;
+ private->fblinebytes = private->physlinebytes;
+ }
+
+ private->SDL_modelist[0] = (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
+ private->SDL_modelist[0]->w = width;
+ private->SDL_modelist[0]->h = height;
+
+ vformat->BitsPerPixel = private->info.depth;
+ vformat->BytesPerPixel = private->info.depth / 8;
+
+ if (WSCONS_InitKeyboard(this) == -1) {
+ return -1;
+ }
+
+ return 0;
+}
+
+SDL_Rect **WSCONS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ if (format->BitsPerPixel == private->info.depth) {
+ return private->SDL_modelist;
+ } else {
+ return NULL;
+ }
+}
+
+SDL_Surface *WSCONS_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ if (width != private->SDL_modelist[0]->w ||
+ height != private->SDL_modelist[0]->h) {
+ WSCONS_ReportError("Requested video mode %dx%d not supported.",
+ width, height);
+ return NULL;
+ }
+ if (bpp != private->info.depth) {
+ WSCONS_ReportError("Requested video depth %d bpp not supported.", bpp);
+ return NULL;
+ }
+
+ if (!SDL_ReallocFormat(current,
+ bpp,
+ private->redMask,
+ private->greenMask,
+ private->blueMask,
+ 0)) {
+ WSCONS_ReportError("Couldn't allocate new pixel format");
+ return NULL;
+ }
+
+ current->flags &= SDL_FULLSCREEN;
+ if (private->shadowFB) {
+ current->flags |= SDL_SWSURFACE;
+ } else {
+ current->flags |= SDL_HWSURFACE;
+ }
+ current->w = width;
+ current->h = height;
+ current->pitch = private->fblinebytes;
+ current->pixels = private->fbstart;
+
+ SDL_memset(private->fbstart, 0, private->fbmem_len);
+
+ return current;
+}
+
+static int WSCONS_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ return -1;
+}
+static void WSCONS_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+}
+
+static int WSCONS_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return 0;
+}
+
+static void WSCONS_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+}
+
+static void WSCONS_blit16(Uint8 *byte_src_pos,
+ int srcRightDelta,
+ int srcDownDelta,
+ Uint8 *byte_dst_pos,
+ int dst_linebytes,
+ int width,
+ int height)
+{
+ int w;
+ Uint16 *src_pos = (Uint16 *)byte_src_pos;
+ Uint16 *dst_pos = (Uint16 *)byte_dst_pos;
+
+ while (height) {
+ Uint16 *src = src_pos;
+ Uint16 *dst = dst_pos;
+ for (w = width; w != 0; w--) {
+ *dst = *src;
+ src += srcRightDelta;
+ dst++;
+ }
+ dst_pos = (Uint16 *)((Uint8 *)dst_pos + dst_linebytes);
+ src_pos += srcDownDelta;
+ height--;
+ }
+}
+
+#define BLOCKSIZE_W 32
+#define BLOCKSIZE_H 32
+
+static void WSCONS_blit16blocked(Uint8 *byte_src_pos,
+ int srcRightDelta,
+ int srcDownDelta,
+ Uint8 *byte_dst_pos,
+ int dst_linebytes,
+ int width,
+ int height)
+{
+ int w;
+ Uint16 *src_pos = (Uint16 *)byte_src_pos;
+ Uint16 *dst_pos = (Uint16 *)byte_dst_pos;
+
+ while (height > 0) {
+ Uint16 *src = src_pos;
+ Uint16 *dst = dst_pos;
+ for (w = width; w > 0; w -= BLOCKSIZE_W) {
+ WSCONS_blit16((Uint8 *)src,
+ srcRightDelta,
+ srcDownDelta,
+ (Uint8 *)dst,
+ dst_linebytes,
+ min(w, BLOCKSIZE_W),
+ min(height, BLOCKSIZE_H));
+ src += srcRightDelta * BLOCKSIZE_W;
+ dst += BLOCKSIZE_W;
+ }
+ dst_pos = (Uint16 *)((Uint8 *)dst_pos + dst_linebytes * BLOCKSIZE_H);
+ src_pos += srcDownDelta * BLOCKSIZE_H;
+ height -= BLOCKSIZE_H;
+ }
+}
+
+static void WSCONS_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
+{
+ int width = private->SDL_modelist[0]->w;
+ int height = private->SDL_modelist[0]->h;
+ int bytesPerPixel = (private->info.depth + 7) / 8;
+ int i;
+
+ if (!private->shadowFB) {
+ return;
+ }
+
+ if (private->info.depth != 16) {
+ WSCONS_ReportError("Shadow copy only implemented for 16 bpp");
+ return;
+ }
+
+ for (i = 0; i < numrects; i++) {
+ int x1, y1, x2, y2;
+ int scr_x1, scr_y1, scr_x2, scr_y2;
+ int sha_x1, sha_y1;
+ int shadowRightDelta; /* Address change when moving right in dest */
+ int shadowDownDelta; /* Address change when moving down in dest */
+ Uint8 *src_start;
+ Uint8 *dst_start;
+
+ x1 = rects[i].x;
+ y1 = rects[i].y;
+ x2 = x1 + rects[i].w;
+ y2 = y1 + rects[i].h;
+
+ if (x1 < 0) {
+ x1 = 0;
+ } else if (x1 > width) {
+ x1 = width;
+ }
+ if (x2 < 0) {
+ x2 = 0;
+ } else if (x2 > width) {
+ x2 = width;
+ }
+ if (y1 < 0) {
+ y1 = 0;
+ } else if (y1 > height) {
+ y1 = height;
+ }
+ if (y2 < 0) {
+ y2 = 0;
+ } else if (y2 > height) {
+ y2 = height;
+ }
+ if (x2 <= x1 || y2 <= y1) {
+ continue;
+ }
+
+ switch (private->rotate) {
+ case WSCONS_ROTATE_NONE:
+ sha_x1 = scr_x1 = x1;
+ sha_y1 = scr_y1 = y1;
+ scr_x2 = x2;
+ scr_y2 = y2;
+ shadowRightDelta = 1;
+ shadowDownDelta = width;
+ break;
+ case WSCONS_ROTATE_CCW:
+ scr_x1 = y1;
+ scr_y1 = width - x2;
+ scr_x2 = y2;
+ scr_y2 = width - x1;
+ sha_x1 = x2 - 1;
+ sha_y1 = y1;
+ shadowRightDelta = width;
+ shadowDownDelta = -1;
+ break;
+ case WSCONS_ROTATE_UD:
+ scr_x1 = width - x2;
+ scr_y1 = height - y2;
+ scr_x2 = width - x1;
+ scr_y2 = height - y1;
+ sha_x1 = x2 - 1;
+ sha_y1 = y2 - 1;
+ shadowRightDelta = -1;
+ shadowDownDelta = -width;
+ break;
+ case WSCONS_ROTATE_CW:
+ scr_x1 = height - y2;
+ scr_y1 = x1;
+ scr_x2 = height - y1;
+ scr_y2 = x2;
+ sha_x1 = x1;
+ sha_y1 = y2 - 1;
+ shadowRightDelta = -width;
+ shadowDownDelta = 1;
+ break;
+ default:
+ WSCONS_ReportError("Unknown rotation");
+ return;
+ }
+
+ src_start = private->shadowmem + (sha_y1 * width + sha_x1) * bytesPerPixel;
+ dst_start = private->physmem + scr_y1 * private->physlinebytes +
+ scr_x1 * bytesPerPixel;
+
+ private->blitFunc(src_start,
+ shadowRightDelta,
+ shadowDownDelta,
+ dst_start,
+ private->physlinebytes,
+ scr_x2 - scr_x1,
+ scr_y2 - scr_y1);
+ }
+}
+
+int WSCONS_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ return 0;
+}
+
+/*
+ * Note: If we are terminated, this could be called in the middle of
+ * another SDL video routine -- notably UpdateRects.
+ */
+void WSCONS_VideoQuit(_THIS)
+{
+ int mode = WSDISPLAYIO_MODE_EMUL;
+
+ if (private->shadowmem != NULL) {
+ SDL_free(private->shadowmem);
+ private->shadowmem = NULL;
+ }
+ private->fbstart = NULL;
+ if (this->screen != NULL) {
+ this->screen->pixels = NULL;
+ }
+
+ if (private->SDL_modelist[0] != NULL) {
+ SDL_free(private->SDL_modelist[0]);
+ private->SDL_modelist[0] = NULL;
+ }
+
+ if (ioctl(private->fd, WSDISPLAYIO_SMODE, &mode) == -1) {
+ WSCONS_ReportError("ioctl SMODE");
+ }
+
+ WSCONS_ReleaseKeyboard(this);
+
+ if (private->fd != -1) {
+ close(private->fd);
+ private->fd = -1;
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsvideo.h b/distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsvideo.h
new file mode 100644
index 0000000..9d75c17
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/wscons/SDL_wsconsvideo.h
@@ -0,0 +1,76 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_wsconsvideo_h
+#define _SDL_wsconsvideo_h
+
+#include <sys/time.h>
+#include <termios.h>
+#include <dev/wscons/wsconsio.h>
+
+#include "SDL_mouse.h"
+#include "SDL_mutex.h"
+#include "../SDL_sysvideo.h"
+
+void WSCONS_ReportError(char *fmt, ...);
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+#define private (this->hidden)
+
+/* Private display data */
+
+typedef void WSCONS_bitBlit(Uint8 *src_pos,
+ int srcRightDelta, // pixels, not bytes
+ int srcDownDelta, // pixels, not bytes
+ Uint8 *dst_pos,
+ int dst_linebytes,
+ int width,
+ int height);
+
+struct SDL_PrivateVideoData {
+ int fd; /* file descriptor of open device */
+ struct wsdisplay_fbinfo info; /* frame buffer characteristics */
+ int physlinebytes; /* number of bytes per row */
+ int redMask, greenMask, blueMask;
+
+ Uint8 *fbstart; /* These refer to the surface used, */
+ int fblinebytes; /* physical frame buffer or shadow. */
+
+ size_t fbmem_len;
+ Uint8 *physmem;
+ Uint8 *shadowmem;
+ int rotate;
+ int shadowFB; /* Tells whether a shadow is being used. */
+
+ WSCONS_bitBlit *blitFunc;
+
+ SDL_Rect *SDL_modelist[2];
+
+ unsigned int kbdType;
+ int did_save_tty;
+ struct termios saved_tty;
+};
+
+
+#endif /* _SDL_wsconsvideo_h */
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11dga.c b/distrib/sdl-1.2.15/src/video/x11/SDL_x11dga.c
new file mode 100644
index 0000000..e1c0c2e
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11dga.c
@@ -0,0 +1,90 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This is currently only used to enable DGA mouse.
+ There is a completely separate DGA driver that is fullscreen-only.
+*/
+
+#include "SDL_video.h"
+#include "../SDL_cursor_c.h"
+#include "SDL_x11dga_c.h"
+
+/* Global for the error handler */
+int dga_event, dga_error = -1;
+
+void X11_EnableDGAMouse(_THIS)
+{
+#if SDL_VIDEO_DRIVER_X11_DGAMOUSE
+ static int use_dgamouse = -1;
+
+ /* Check configuration to see if we should use DGA mouse */
+ if ( use_dgamouse < 0 ) {
+ int dga_major, dga_minor;
+ int dga_flags;
+ const char *env_use_dgamouse;
+
+ use_dgamouse = 1;
+ env_use_dgamouse = SDL_getenv("SDL_VIDEO_X11_DGAMOUSE");
+ if ( env_use_dgamouse ) {
+ use_dgamouse = SDL_atoi(env_use_dgamouse);
+ }
+ /* Check for buggy X servers */
+ if ( use_dgamouse && BUGGY_XFREE86(==, 4000) ) {
+ use_dgamouse = 0;
+ }
+ if ( !use_dgamouse || !local_X11 ||
+ !SDL_NAME(XF86DGAQueryExtension)(SDL_Display, &dga_event, &dga_error) ||
+ !SDL_NAME(XF86DGAQueryVersion)(SDL_Display, &dga_major, &dga_minor) ||
+ !SDL_NAME(XF86DGAQueryDirectVideo)(SDL_Display, SDL_Screen, &dga_flags) ||
+ !(dga_flags & XF86DGADirectPresent) ) {
+ use_dgamouse = 0;
+ }
+ }
+
+ if ( use_dgamouse && !(using_dga & DGA_MOUSE) ) {
+ if ( SDL_NAME(XF86DGADirectVideo)(SDL_Display, SDL_Screen, XF86DGADirectMouse) ) {
+ using_dga |= DGA_MOUSE;
+ }
+ }
+#endif /* SDL_VIDEO_DRIVER_X11_DGAMOUSE */
+}
+
+/* Argh. Glide resets DGA mouse mode when it makes the context current! */
+void X11_CheckDGAMouse(_THIS)
+{
+#if SDL_VIDEO_DRIVER_X11_DGAMOUSE
+ if ( using_dga & DGA_MOUSE ) {
+ SDL_NAME(XF86DGADirectVideo)(SDL_Display,SDL_Screen,XF86DGADirectMouse);
+ }
+#endif
+}
+
+void X11_DisableDGAMouse(_THIS)
+{
+#if SDL_VIDEO_DRIVER_X11_DGAMOUSE
+ if ( using_dga & DGA_MOUSE ) {
+ SDL_NAME(XF86DGADirectVideo)(SDL_Display, SDL_Screen, 0);
+ using_dga &= ~DGA_MOUSE;
+ }
+#endif /* SDL_VIDEO_DRIVER_X11_DGAMOUSE */
+}
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11dga_c.h b/distrib/sdl-1.2.15/src/video/x11/SDL_x11dga_c.h
new file mode 100644
index 0000000..a57511c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11dga_c.h
@@ -0,0 +1,33 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_x11video.h"
+
+/* Different DGA access states */
+#define DGA_GRAPHICS 0x01
+#define DGA_KEYBOARD 0x02
+#define DGA_MOUSE 0x04
+
+extern void X11_EnableDGAMouse(_THIS);
+extern void X11_CheckDGAMouse(_THIS);
+extern void X11_DisableDGAMouse(_THIS);
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11dyn.c b/distrib/sdl-1.2.15/src/video/x11/SDL_x11dyn.c
new file mode 100644
index 0000000..7d4acbb
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11dyn.c
@@ -0,0 +1,223 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#define DEBUG_DYNAMIC_X11 0
+
+#include "SDL_x11dyn.h"
+
+#if DEBUG_DYNAMIC_X11
+#include <stdio.h>
+#endif
+
+#ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC
+
+#include "SDL_name.h"
+#include "SDL_loadso.h"
+
+typedef struct
+{
+ void *lib;
+ const char *libname;
+} x11dynlib;
+
+#ifndef SDL_VIDEO_DRIVER_X11_DYNAMIC
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC NULL
+#endif
+#ifndef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT NULL
+#endif
+#ifndef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER NULL
+#endif
+#ifndef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR NULL
+#endif
+
+static x11dynlib x11libs[] =
+{
+ { NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC },
+ { NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT },
+ { NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER },
+ { NULL, SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR },
+};
+
+static void *X11_GetSym(const char *fnname, int *rc)
+{
+ void *fn = NULL;
+ int i;
+ for (i = 0; i < SDL_TABLESIZE(x11libs); i++) {
+ if (x11libs[i].lib != NULL)
+ {
+ fn = SDL_LoadFunction(x11libs[i].lib, fnname);
+ if (fn != NULL)
+ break;
+ }
+ }
+
+ #if DEBUG_DYNAMIC_X11
+ if (fn != NULL)
+ printf("X11: Found '%s' in %s (%p)\n", fnname, x11libs[i].libname, *fn);
+ else
+ printf("X11: Symbol '%s' NOT FOUND!\n", fnname);
+ #endif
+
+ if (fn == NULL)
+ *rc = 0; /* kill this module. */
+
+ return fn;
+}
+
+
+/* Define all the function pointers and wrappers... */
+#define SDL_X11_MODULE(modname)
+#define SDL_X11_SYM(rc,fn,params,args,ret) \
+ static rc (*p##fn) params = NULL; \
+ rc fn params { ret p##fn args ; }
+#include "SDL_x11sym.h"
+#undef SDL_X11_MODULE
+#undef SDL_X11_SYM
+#endif /* SDL_VIDEO_DRIVER_X11_DYNAMIC */
+
+/* Annoying varargs entry point... */
+#ifdef X_HAVE_UTF8_STRING
+XIC (*pXCreateIC)(XIM,...) = NULL;
+char *(*pXGetICValues)(XIC, ...) = NULL;
+#endif
+
+/* These SDL_X11_HAVE_* flags are here whether you have dynamic X11 or not. */
+#define SDL_X11_MODULE(modname) int SDL_X11_HAVE_##modname = 1;
+#define SDL_X11_SYM(rc,fn,params,args,ret)
+#include "SDL_x11sym.h"
+#undef SDL_X11_MODULE
+#undef SDL_X11_SYM
+
+
+static void *SDL_XGetRequest_workaround(Display* dpy, CARD8 type, size_t len)
+{
+ xReq *req;
+ WORD64ALIGN
+ if (dpy->bufptr + len > dpy->bufmax)
+ _XFlush(dpy);
+ dpy->last_req = dpy->bufptr;
+ req = (xReq*)dpy->bufptr;
+ req->reqType = type;
+ req->length = len / 4;
+ dpy->bufptr += len;
+ dpy->request++;
+ return req;
+}
+
+static int x11_load_refcount = 0;
+
+void SDL_X11_UnloadSymbols(void)
+{
+ #ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC
+ /* Don't actually unload if more than one module is using the libs... */
+ if (x11_load_refcount > 0) {
+ if (--x11_load_refcount == 0) {
+ int i;
+
+ /* set all the function pointers to NULL. */
+ #define SDL_X11_MODULE(modname) SDL_X11_HAVE_##modname = 1;
+ #define SDL_X11_SYM(rc,fn,params,args,ret) p##fn = NULL;
+ #include "SDL_x11sym.h"
+ #undef SDL_X11_MODULE
+ #undef SDL_X11_SYM
+
+ #ifdef X_HAVE_UTF8_STRING
+ pXCreateIC = NULL;
+ pXGetICValues = NULL;
+ #endif
+
+ for (i = 0; i < SDL_TABLESIZE(x11libs); i++) {
+ if (x11libs[i].lib != NULL) {
+ SDL_UnloadObject(x11libs[i].lib);
+ x11libs[i].lib = NULL;
+ }
+ }
+ }
+ }
+ #endif
+}
+
+/* returns non-zero if all needed symbols were loaded. */
+int SDL_X11_LoadSymbols(void)
+{
+ int rc = 1; /* always succeed if not using Dynamic X11 stuff. */
+
+ #ifdef SDL_VIDEO_DRIVER_X11_DYNAMIC
+ /* deal with multiple modules (dga, x11, etc) needing these symbols... */
+ if (x11_load_refcount++ == 0) {
+ int i;
+ int *thismod = NULL;
+ for (i = 0; i < SDL_TABLESIZE(x11libs); i++) {
+ if (x11libs[i].libname != NULL) {
+ x11libs[i].lib = SDL_LoadObject(x11libs[i].libname);
+ }
+ }
+ #define SDL_X11_MODULE(modname) thismod = &SDL_X11_HAVE_##modname;
+ #define SDL_X11_SYM(rc,fn,params,args,ret) \
+ p##fn = (rc(*)params) X11_GetSym(#fn, thismod);
+ #include "SDL_x11sym.h"
+ #undef SDL_X11_MODULE
+ #undef SDL_X11_SYM
+
+ #ifdef X_HAVE_UTF8_STRING
+ pXCreateIC = (XIC(*)(XIM,...)) X11_GetSym("XCreateIC",
+ &SDL_X11_HAVE_UTF8);
+ pXGetICValues = (char * (*)(XIC,...)) X11_GetSym("XGetICValues",
+ &SDL_X11_HAVE_UTF8);
+ #endif
+
+ /*
+ * In case we're built with newer Xlib headers, we need to make sure
+ * that _XGetRequest() is available, even on older systems.
+ * Otherwise, various Xlib macros we use will call a NULL pointer.
+ */
+ if (!SDL_X11_HAVE_XGETREQUEST) {
+ p_XGetRequest = SDL_XGetRequest_workaround;
+ }
+
+ if (SDL_X11_HAVE_BASEXLIB) { /* all required symbols loaded. */
+ SDL_ClearError();
+ XInitThreads();
+ } else {
+ SDL_X11_UnloadSymbols(); /* in case something got loaded... */
+ rc = 0;
+ }
+ }
+ #else
+ #if DEBUG_DYNAMIC_X11
+ printf("X11: No dynamic X11 support in this build of SDL.\n");
+ #endif
+ #ifdef X_HAVE_UTF8_STRING
+ pXCreateIC = XCreateIC;
+ pXGetICValues = XGetICValues;
+ #endif
+ #endif
+
+ return rc;
+}
+
+/* end of SDL_x11dyn.c ... */
+
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11dyn.h b/distrib/sdl-1.2.15/src/video/x11/SDL_x11dyn.h
new file mode 100644
index 0000000..c2ff82a
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11dyn.h
@@ -0,0 +1,93 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_x11dyn_h
+#define _SDL_x11dyn_h
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/Xatom.h>
+
+/* Apparently some X11 systems can't include this multiple times... */
+#ifndef SDL_INCLUDED_XLIBINT_H
+#define SDL_INCLUDED_XLIBINT_H 1
+#include <X11/Xlibint.h>
+#endif
+
+#include <X11/Xproto.h>
+
+#include "../Xext/extensions/Xext.h"
+#include "../Xext/extensions/extutil.h"
+
+#ifndef NO_SHARED_MEMORY
+#include <sys/ipc.h>
+#include <sys/shm.h>
+#include <X11/extensions/XShm.h>
+#endif
+
+#if SDL_VIDEO_DRIVER_X11_XRANDR
+#include <X11/extensions/Xrandr.h>
+#endif
+
+/*
+ * When using the "dynamic X11" functionality, we duplicate all the Xlib
+ * symbols that would be referenced by SDL inside of SDL itself.
+ * These duplicated symbols just serve as passthroughs to the functions
+ * in Xlib, that was dynamically loaded.
+ *
+ * This allows us to use Xlib as-is when linking against it directly, but
+ * also handles all the strange cases where there was code in the Xlib
+ * headers that may or may not exist or vary on a given platform.
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* evil function signatures... */
+typedef Bool (*SDL_X11_XESetWireToEventRetType)(Display*,XEvent*,xEvent*);
+typedef int (*SDL_X11_XSynchronizeRetType)(Display*);
+typedef Status (*SDL_X11_XESetEventToWireRetType)(Display*,XEvent*,xEvent*);
+
+int SDL_X11_LoadSymbols(void);
+void SDL_X11_UnloadSymbols(void);
+
+/* That's really annoying...make this a function pointer no matter what. */
+#ifdef X_HAVE_UTF8_STRING
+extern XIC (*pXCreateIC)(XIM,...);
+extern char *(*pXGetICValues)(XIC, ...);
+#endif
+
+/* These SDL_X11_HAVE_* flags are here whether you have dynamic X11 or not. */
+#define SDL_X11_MODULE(modname) extern int SDL_X11_HAVE_##modname;
+#define SDL_X11_SYM(rc,fn,params,args,ret)
+#include "SDL_x11sym.h"
+#undef SDL_X11_MODULE
+#undef SDL_X11_SYM
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !defined _SDL_x11dyn_h */
+
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11events.c b/distrib/sdl-1.2.15/src/video/x11/SDL_x11events.c
new file mode 100644
index 0000000..559a001
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11events.c
@@ -0,0 +1,1414 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Handle the event stream, converting X11 events into SDL events */
+
+#include <setjmp.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/keysym.h>
+#ifdef __SVR4
+#include <X11/Sunkeysym.h>
+#endif
+#include <sys/types.h>
+#include <sys/time.h>
+#include <unistd.h>
+
+#include "SDL_timer.h"
+#include "SDL_syswm.h"
+#include "../SDL_sysvideo.h"
+#include "../../events/SDL_sysevents.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_x11video.h"
+#include "SDL_x11dga_c.h"
+#include "SDL_x11modes_c.h"
+#include "SDL_x11image_c.h"
+#include "SDL_x11gamma_c.h"
+#include "SDL_x11wm_c.h"
+#include "SDL_x11mouse_c.h"
+#include "SDL_x11events_c.h"
+
+
+/* Define this if you want to debug X11 events */
+/*#define DEBUG_XEVENTS*/
+
+/* The translation tables from an X11 keysym to a SDL keysym */
+static SDLKey ODD_keymap[256];
+static SDLKey MISC_keymap[256];
+SDLKey X11_TranslateKeycode(Display *display, KeyCode kc);
+
+/*
+ Pending resize target for ConfigureNotify (so outdated events don't
+ cause inappropriate resize events)
+*/
+int X11_PendingConfigureNotifyWidth = -1;
+int X11_PendingConfigureNotifyHeight = -1;
+
+#ifdef X_HAVE_UTF8_STRING
+Uint32 Utf8ToUcs4(const Uint8 *utf8)
+{
+ Uint32 c;
+ int i = 1;
+ int noOctets = 0;
+ int firstOctetMask = 0;
+ unsigned char firstOctet = utf8[0];
+ if (firstOctet < 0x80) {
+ /*
+ Characters in the range:
+ 00000000 to 01111111 (ASCII Range)
+ are stored in one octet:
+ 0xxxxxxx (The same as its ASCII representation)
+ The least 6 significant bits of the first octet is the most 6 significant nonzero bits
+ of the UCS4 representation.
+ */
+ noOctets = 1;
+ firstOctetMask = 0x7F; /* 0(1111111) - The most significant bit is ignored */
+ } else if ((firstOctet & 0xE0) /* get the most 3 significant bits by AND'ing with 11100000 */
+ == 0xC0 ) { /* see if those 3 bits are 110. If so, the char is in this range */
+ /*
+ Characters in the range:
+ 00000000 10000000 to 00000111 11111111
+ are stored in two octets:
+ 110xxxxx 10xxxxxx
+ The least 5 significant bits of the first octet is the most 5 significant nonzero bits
+ of the UCS4 representation.
+ */
+ noOctets = 2;
+ firstOctetMask = 0x1F; /* 000(11111) - The most 3 significant bits are ignored */
+ } else if ((firstOctet & 0xF0) /* get the most 4 significant bits by AND'ing with 11110000 */
+ == 0xE0) { /* see if those 4 bits are 1110. If so, the char is in this range */
+ /*
+ Characters in the range:
+ 00001000 00000000 to 11111111 11111111
+ are stored in three octets:
+ 1110xxxx 10xxxxxx 10xxxxxx
+ The least 4 significant bits of the first octet is the most 4 significant nonzero bits
+ of the UCS4 representation.
+ */
+ noOctets = 3;
+ firstOctetMask = 0x0F; /* 0000(1111) - The most 4 significant bits are ignored */
+ } else if ((firstOctet & 0xF8) /* get the most 5 significant bits by AND'ing with 11111000 */
+ == 0xF0) { /* see if those 5 bits are 11110. If so, the char is in this range */
+ /*
+ Characters in the range:
+ 00000001 00000000 00000000 to 00011111 11111111 11111111
+ are stored in four octets:
+ 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+ The least 3 significant bits of the first octet is the most 3 significant nonzero bits
+ of the UCS4 representation.
+ */
+ noOctets = 4;
+ firstOctetMask = 0x07; /* 11110(111) - The most 5 significant bits are ignored */
+ } else if ((firstOctet & 0xFC) /* get the most 6 significant bits by AND'ing with 11111100 */
+ == 0xF8) { /* see if those 6 bits are 111110. If so, the char is in this range */
+ /*
+ Characters in the range:
+ 00000000 00100000 00000000 00000000 to
+ 00000011 11111111 11111111 11111111
+ are stored in five octets:
+ 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+ The least 2 significant bits of the first octet is the most 2 significant nonzero bits
+ of the UCS4 representation.
+ */
+ noOctets = 5;
+ firstOctetMask = 0x03; /* 111110(11) - The most 6 significant bits are ignored */
+ } else if ((firstOctet & 0xFE) /* get the most 7 significant bits by AND'ing with 11111110 */
+ == 0xFC) { /* see if those 7 bits are 1111110. If so, the char is in this range */
+ /*
+ Characters in the range:
+ 00000100 00000000 00000000 00000000 to
+ 01111111 11111111 11111111 11111111
+ are stored in six octets:
+ 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+ The least significant bit of the first octet is the most significant nonzero bit
+ of the UCS4 representation.
+ */
+ noOctets = 6;
+ firstOctetMask = 0x01; /* 1111110(1) - The most 7 significant bits are ignored */
+ } else
+ return 0; /* The given chunk is not a valid UTF-8 encoded Unicode character */
+
+ /*
+ The least noOctets significant bits of the first octet is the most 2 significant nonzero bits
+ of the UCS4 representation.
+ The first 6 bits of the UCS4 representation is the least 8-noOctets-1 significant bits of
+ firstOctet if the character is not ASCII. If so, it's the least 7 significant bits of firstOctet.
+ This done by AND'ing firstOctet with its mask to trim the bits used for identifying the
+ number of continuing octets (if any) and leave only the free bits (the x's)
+ Sample:
+ 1-octet: 0xxxxxxx & 01111111 = 0xxxxxxx
+ 2-octets: 110xxxxx & 00011111 = 000xxxxx
+ */
+ c = firstOctet & firstOctetMask;
+
+ /* Now, start filling c.ucs4 with the bits from the continuing octets from utf8. */
+ for (i = 1; i < noOctets; i++) {
+ /* A valid continuing octet is of the form 10xxxxxx */
+ if ((utf8[i] & 0xC0) /* get the most 2 significant bits by AND'ing with 11000000 */
+ != 0x80) /* see if those 2 bits are 10. If not, the is a malformed sequence. */
+ /*The given chunk is a partial sequence at the end of a string that could
+ begin a valid character */
+ return 0;
+
+ /* Make room for the next 6-bits */
+ c <<= 6;
+
+ /*
+ Take only the least 6 significance bits of the current octet (utf8[i]) and fill the created room
+ of c.ucs4 with them.
+ This done by AND'ing utf8[i] with 00111111 and the OR'ing the result with c.ucs4.
+ */
+ c |= utf8[i] & 0x3F;
+ }
+ return c;
+}
+
+/* Given a UTF-8 encoded string pointed to by utf8 of length length in
+ bytes, returns the corresponding UTF-16 encoded string in the
+ buffer pointed to by utf16. The maximum number of UTF-16 encoding
+ units (i.e., Unit16s) allowed in the buffer is specified in
+ utf16_max_length. The return value is the number of UTF-16
+ encoding units placed in the output buffer pointed to by utf16.
+
+ In case of an error, -1 is returned, leaving some unusable partial
+ results in the output buffer.
+
+ The caller must estimate the size of utf16 buffer by itself before
+ calling this function. Insufficient output buffer is considered as
+ an error, and once an error occured, this function doesn't give any
+ clue how large the result will be.
+
+ The error cases include following:
+
+ - Invalid byte sequences were in the input UTF-8 bytes. The caller
+ has no way to know what point in the input buffer was the
+ errornous byte.
+
+ - The input contained a character (a valid UTF-8 byte sequence)
+ whose scalar value exceeded the range that UTF-16 can represent
+ (i.e., characters whose Unicode scalar value above 0x110000).
+
+ - The output buffer has no enough space to hold entire utf16 data.
+
+ Please note:
+
+ - '\0'-termination is not assumed both on the input UTF-8 string
+ and on the output UTF-16 string; any legal zero byte in the input
+ UTF-8 string will be converted to a 16-bit zero in output. As a
+ side effect, the last UTF-16 encoding unit stored in the output
+ buffer will have a non-zero value if the input UTF-8 was not
+ '\0'-terminated.
+
+ - UTF-8 aliases are *not* considered as an error. They are
+ converted to UTF-16. For example, 0xC0 0xA0, 0xE0 0x80 0xA0,
+ and 0xF0 0x80 0x80 0xA0 are all mapped to a single UTF-16
+ encoding unit 0x0020.
+
+ - Three byte UTF-8 sequences whose value corresponds to a surrogate
+ code or other reserved scalar value are not considered as an
+ error either. They may cause an invalid UTF-16 data (e.g., those
+ containing unpaired surrogates).
+
+*/
+
+static int Utf8ToUtf16(const Uint8 *utf8, const int utf8_length, Uint16 *utf16, const int utf16_max_length) {
+
+ /* p moves over the output buffer. max_ptr points to the next to the last slot of the buffer. */
+ Uint16 *p = utf16;
+ Uint16 const *const max_ptr = utf16 + utf16_max_length;
+
+ /* end_of_input points to the last byte of input as opposed to the next to the last byte. */
+ Uint8 const *const end_of_input = utf8 + utf8_length - 1;
+
+ while (utf8 <= end_of_input) {
+ Uint8 const c = *utf8;
+ if (p >= max_ptr) {
+ /* No more output space. */
+ return -1;
+ }
+ if (c < 0x80) {
+ /* One byte ASCII. */
+ *p++ = c;
+ utf8 += 1;
+ } else if (c < 0xC0) {
+ /* Follower byte without preceeding leader bytes. */
+ return -1;
+ } else if (c < 0xE0) {
+ /* Two byte sequence. We need one follower byte. */
+ if (end_of_input - utf8 < 1 || (((utf8[1] ^ 0x80)) & 0xC0)) {
+ return -1;
+ }
+ *p++ = (Uint16)(0xCF80 + (c << 6) + utf8[1]);
+ utf8 += 2;
+ } else if (c < 0xF0) {
+ /* Three byte sequence. We need two follower byte. */
+ if (end_of_input - utf8 < 2 || (((utf8[1] ^ 0x80) | (utf8[2] ^ 0x80)) & 0xC0)) {
+ return -1;
+ }
+ *p++ = (Uint16)(0xDF80 + (c << 12) + (utf8[1] << 6) + utf8[2]);
+ utf8 += 3;
+ } else if (c < 0xF8) {
+ int plane;
+ /* Four byte sequence. We need three follower bytes. */
+ if (end_of_input - utf8 < 3 || (((utf8[1] ^ 0x80) | (utf8[2] ^0x80) | (utf8[3] ^ 0x80)) & 0xC0)) {
+ return -1;
+ }
+ plane = (-0xC8 + (c << 2) + (utf8[1] >> 4));
+ if (plane == 0) {
+ /* This four byte sequence is an alias that
+ corresponds to a Unicode scalar value in BMP.
+ It fits in an UTF-16 encoding unit. */
+ *p++ = (Uint16)(0xDF80 + (utf8[1] << 12) + (utf8[2] << 6) + utf8[3]);
+ } else if (plane <= 16) {
+ /* This is a legal four byte sequence that corresponds to a surrogate pair. */
+ if (p + 1 >= max_ptr) {
+ /* No enough space on the output buffer for the pair. */
+ return -1;
+ }
+ *p++ = (Uint16)(0xE5B8 + (c << 8) + (utf8[1] << 2) + (utf8[2] >> 4));
+ *p++ = (Uint16)(0xDB80 + ((utf8[2] & 0x0F) << 6) + utf8[3]);
+ } else {
+ /* This four byte sequence is out of UTF-16 code space. */
+ return -1;
+ }
+ utf8 += 4;
+ } else {
+ /* Longer sequence or unused byte. */
+ return -1;
+ }
+ }
+ return p - utf16;
+}
+
+#endif
+
+/* Check to see if this is a repeated key.
+ (idea shamelessly lifted from GII -- thanks guys! :)
+ */
+static int X11_KeyRepeat(Display *display, XEvent *event)
+{
+ XEvent peekevent;
+ int repeated;
+
+ repeated = 0;
+ if ( XPending(display) ) {
+ XPeekEvent(display, &peekevent);
+ if ( (peekevent.type == KeyPress) &&
+ (peekevent.xkey.keycode == event->xkey.keycode) &&
+ ((peekevent.xkey.time-event->xkey.time) < 2) ) {
+ repeated = 1;
+ XNextEvent(display, &peekevent);
+ }
+ }
+ return(repeated);
+}
+
+/* Note: The X server buffers and accumulates mouse motion events, so
+ the motion event generated by the warp may not appear exactly as we
+ expect it to. We work around this (and improve performance) by only
+ warping the pointer when it reaches the edge, and then wait for it.
+*/
+#define MOUSE_FUDGE_FACTOR 8
+
+static __inline__ int X11_WarpedMotion(_THIS, XEvent *xevent)
+{
+ int w, h, i;
+ int deltax, deltay;
+ int posted;
+
+ w = SDL_VideoSurface->w;
+ h = SDL_VideoSurface->h;
+ deltax = xevent->xmotion.x - mouse_last.x;
+ deltay = xevent->xmotion.y - mouse_last.y;
+#ifdef DEBUG_MOTION
+ printf("Warped mouse motion: %d,%d\n", deltax, deltay);
+#endif
+ mouse_last.x = xevent->xmotion.x;
+ mouse_last.y = xevent->xmotion.y;
+ posted = SDL_PrivateMouseMotion(0, 1, deltax, deltay);
+
+ if ( (xevent->xmotion.x < MOUSE_FUDGE_FACTOR) ||
+ (xevent->xmotion.x > (w-MOUSE_FUDGE_FACTOR)) ||
+ (xevent->xmotion.y < MOUSE_FUDGE_FACTOR) ||
+ (xevent->xmotion.y > (h-MOUSE_FUDGE_FACTOR)) ) {
+ /* Get the events that have accumulated */
+ while ( XCheckTypedEvent(SDL_Display, MotionNotify, xevent) ) {
+ deltax = xevent->xmotion.x - mouse_last.x;
+ deltay = xevent->xmotion.y - mouse_last.y;
+#ifdef DEBUG_MOTION
+ printf("Extra mouse motion: %d,%d\n", deltax, deltay);
+#endif
+ mouse_last.x = xevent->xmotion.x;
+ mouse_last.y = xevent->xmotion.y;
+ posted += SDL_PrivateMouseMotion(0, 1, deltax, deltay);
+ }
+ mouse_last.x = w/2;
+ mouse_last.y = h/2;
+ XWarpPointer(SDL_Display, None, SDL_Window, 0, 0, 0, 0,
+ mouse_last.x, mouse_last.y);
+ for ( i=0; i<10; ++i ) {
+ XMaskEvent(SDL_Display, PointerMotionMask, xevent);
+ if ( (xevent->xmotion.x >
+ (mouse_last.x-MOUSE_FUDGE_FACTOR)) &&
+ (xevent->xmotion.x <
+ (mouse_last.x+MOUSE_FUDGE_FACTOR)) &&
+ (xevent->xmotion.y >
+ (mouse_last.y-MOUSE_FUDGE_FACTOR)) &&
+ (xevent->xmotion.y <
+ (mouse_last.y+MOUSE_FUDGE_FACTOR)) ) {
+ break;
+ }
+#ifdef DEBUG_XEVENTS
+ printf("Lost mouse motion: %d,%d\n", xevent->xmotion.x, xevent->xmotion.y);
+#endif
+ }
+#ifdef DEBUG_XEVENTS
+ if ( i == 10 ) {
+ printf("Warning: didn't detect mouse warp motion\n");
+ }
+#endif
+ }
+ return(posted);
+}
+
+static int X11_DispatchEvent(_THIS)
+{
+ int posted;
+ XEvent xevent;
+
+ SDL_memset(&xevent, '\0', sizeof (XEvent)); /* valgrind fix. --ryan. */
+ XNextEvent(SDL_Display, &xevent);
+
+ /* Discard KeyRelease and KeyPress events generated by auto-repeat.
+ We need to do it before passing event to XFilterEvent. Otherwise,
+ KeyRelease aware IMs are confused... */
+ if ( xevent.type == KeyRelease
+ && X11_KeyRepeat(SDL_Display, &xevent) ) {
+ return 0;
+ }
+
+#ifdef X_HAVE_UTF8_STRING
+ /* If we are translating with IM, we need to pass all events
+ to XFilterEvent, and discard those filtered events immediately. */
+ if ( SDL_TranslateUNICODE
+ && SDL_IM != NULL
+ && XFilterEvent(&xevent, None) ) {
+ return 0;
+ }
+#endif
+
+ posted = 0;
+ switch (xevent.type) {
+
+ /* Gaining mouse coverage? */
+ case EnterNotify: {
+#ifdef DEBUG_XEVENTS
+printf("EnterNotify! (%d,%d)\n", xevent.xcrossing.x, xevent.xcrossing.y);
+if ( xevent.xcrossing.mode == NotifyGrab )
+printf("Mode: NotifyGrab\n");
+if ( xevent.xcrossing.mode == NotifyUngrab )
+printf("Mode: NotifyUngrab\n");
+#endif
+ if ( this->input_grab == SDL_GRAB_OFF ) {
+ posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
+ }
+ posted = SDL_PrivateMouseMotion(0, 0,
+ xevent.xcrossing.x,
+ xevent.xcrossing.y);
+ }
+ break;
+
+ /* Losing mouse coverage? */
+ case LeaveNotify: {
+#ifdef DEBUG_XEVENTS
+printf("LeaveNotify! (%d,%d)\n", xevent.xcrossing.x, xevent.xcrossing.y);
+if ( xevent.xcrossing.mode == NotifyGrab )
+printf("Mode: NotifyGrab\n");
+if ( xevent.xcrossing.mode == NotifyUngrab )
+printf("Mode: NotifyUngrab\n");
+#endif
+ if ( (xevent.xcrossing.mode != NotifyGrab) &&
+ (xevent.xcrossing.mode != NotifyUngrab) &&
+ (xevent.xcrossing.detail != NotifyInferior) ) {
+ if ( this->input_grab == SDL_GRAB_OFF ) {
+ posted = SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
+ } else {
+ posted = SDL_PrivateMouseMotion(0, 0,
+ xevent.xcrossing.x,
+ xevent.xcrossing.y);
+ }
+ }
+ }
+ break;
+
+ /* Gaining input focus? */
+ case FocusIn: {
+#ifdef DEBUG_XEVENTS
+printf("FocusIn!\n");
+#endif
+ posted = SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
+
+#ifdef X_HAVE_UTF8_STRING
+ if ( SDL_IC != NULL ) {
+ XSetICFocus(SDL_IC);
+ }
+#endif
+ /* Queue entry into fullscreen mode */
+ switch_waiting = 0x01 | SDL_FULLSCREEN;
+ switch_time = SDL_GetTicks() + 1500;
+ }
+ break;
+
+ /* Losing input focus? */
+ case FocusOut: {
+#ifdef DEBUG_XEVENTS
+printf("FocusOut!\n");
+#endif
+ posted = SDL_PrivateAppActive(0, SDL_APPINPUTFOCUS);
+
+#ifdef X_HAVE_UTF8_STRING
+ if ( SDL_IC != NULL ) {
+ XUnsetICFocus(SDL_IC);
+ }
+#endif
+ /* Queue leaving fullscreen mode */
+ switch_waiting = 0x01;
+ switch_time = SDL_GetTicks() + 200;
+ }
+ break;
+
+#ifdef X_HAVE_UTF8_STRING
+ /* Some IM requires MappingNotify to be passed to
+ XRefreshKeyboardMapping by the app. */
+ case MappingNotify: {
+ XRefreshKeyboardMapping(&xevent.xmapping);
+ }
+ break;
+#endif /* X_HAVE_UTF8_STRING */
+
+ /* Generated upon EnterWindow and FocusIn */
+ case KeymapNotify: {
+#ifdef DEBUG_XEVENTS
+printf("KeymapNotify!\n");
+#endif
+ X11_SetKeyboardState(SDL_Display, xevent.xkeymap.key_vector);
+ }
+ break;
+
+ /* Mouse motion? */
+ case MotionNotify: {
+ if ( SDL_VideoSurface ) {
+ if ( mouse_relative ) {
+ if ( using_dga & DGA_MOUSE ) {
+#ifdef DEBUG_MOTION
+ printf("DGA motion: %d,%d\n", xevent.xmotion.x_root, xevent.xmotion.y_root);
+#endif
+ posted = SDL_PrivateMouseMotion(0, 1,
+ xevent.xmotion.x_root,
+ xevent.xmotion.y_root);
+ } else {
+ posted = X11_WarpedMotion(this,&xevent);
+ }
+ } else {
+#ifdef DEBUG_MOTION
+ printf("X11 motion: %d,%d\n", xevent.xmotion.x, xevent.xmotion.y);
+#endif
+ posted = SDL_PrivateMouseMotion(0, 0,
+ xevent.xmotion.x,
+ xevent.xmotion.y);
+ }
+ }
+ }
+ break;
+
+ /* Mouse button press? */
+ case ButtonPress: {
+ posted = SDL_PrivateMouseButton(SDL_PRESSED,
+ xevent.xbutton.button, 0, 0);
+ }
+ break;
+
+ /* Mouse button release? */
+ case ButtonRelease: {
+ posted = SDL_PrivateMouseButton(SDL_RELEASED,
+ xevent.xbutton.button, 0, 0);
+ }
+ break;
+
+ /* Key press? */
+ case KeyPress: {
+ SDL_keysym keysym;
+ KeyCode keycode = xevent.xkey.keycode;
+
+#ifdef DEBUG_XEVENTS
+printf("KeyPress (X11 keycode = 0x%X)\n", xevent.xkey.keycode);
+#endif
+ /* If we're not doing translation, we're done! */
+ if ( !SDL_TranslateUNICODE ) {
+ /* Get the translated SDL virtual keysym and put it on the queue.*/
+ keysym.scancode = keycode;
+ keysym.sym = X11_TranslateKeycode(SDL_Display, keycode);
+ keysym.mod = KMOD_NONE;
+ keysym.unicode = 0;
+ posted = SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
+ break;
+ }
+
+ /* Look up the translated value for the key event */
+#ifdef X_HAVE_UTF8_STRING
+ if ( SDL_IC != NULL ) {
+ Status status;
+ KeySym xkeysym;
+ int i;
+ /* A UTF-8 character can be at most 6 bytes */
+ /* ... It's true, but Xutf8LookupString can
+ return more than one characters. Moreover,
+ the spec. put no upper bound, so we should
+ be ready for longer strings. */
+ char keybuf[32];
+ char *keydata = keybuf;
+ int count;
+ Uint16 utf16buf[32];
+ Uint16 *utf16data = utf16buf;
+ int utf16size;
+ int utf16length;
+
+ count = Xutf8LookupString(SDL_IC, &xevent.xkey, keydata, sizeof(keybuf), &xkeysym, &status);
+ if (XBufferOverflow == status) {
+ /* The IM has just generated somewhat long
+ string. We need a longer buffer in this
+ case. */
+ keydata = SDL_malloc(count);
+ if ( keydata == NULL ) {
+ SDL_OutOfMemory();
+ break;
+ }
+ count = Xutf8LookupString(SDL_IC, &xevent.xkey, keydata, count, &xkeysym, &status);
+ }
+
+ switch (status) {
+
+ case XBufferOverflow: {
+ /* Oops! We have allocated the bytes as
+ requested by Xutf8LookupString, so the
+ length of the buffer must be
+ sufficient. This case should never
+ happen! */
+ SDL_SetError("Xutf8LookupString indicated a double buffer overflow!");
+ break;
+ }
+
+ case XLookupChars:
+ case XLookupBoth: {
+ if (0 == count) {
+ break;
+ }
+
+ /* We got a converted string from IM. Make
+ sure to deliver all characters to the
+ application as SDL events. Note that
+ an SDL event can only carry one UTF-16
+ encoding unit, and a surrogate pair is
+ delivered as two SDL events. I guess
+ this behaviour is probably _imported_
+ from Windows or MacOS. To do so, we need
+ to convert the UTF-8 data into UTF-16
+ data (not UCS4/UTF-32!). We need an
+ estimate of the number of UTF-16 encoding
+ units here. The worst case is pure ASCII
+ string. Assume so. */
+ /* In 1.3 SDL may have a text event instead, that
+ carries the whole UTF-8 string with it. */
+ utf16size = count * sizeof(Uint16);
+ if (utf16size > sizeof(utf16buf)) {
+ utf16data = (Uint16 *) SDL_malloc(utf16size);
+ if (utf16data == NULL) {
+ SDL_OutOfMemory();
+ break;
+ }
+ }
+ utf16length = Utf8ToUtf16((Uint8 *)keydata, count, utf16data, utf16size);
+ if (utf16length < 0) {
+ /* The keydata contained an invalid byte
+ sequence. It should be a bug of the IM
+ or Xlib... */
+ SDL_SetError("Oops! Xutf8LookupString returned an invalid UTF-8 sequence!");
+ break;
+ }
+
+ /* Deliver all UTF-16 encoding units. At
+ this moment, SDL event queue has a
+ fixed size (128 events), and an SDL
+ event can hold just one UTF-16 encoding
+ unit. So, if we receive more than 128
+ UTF-16 encoding units from a commit,
+ exceeded characters will be lost. */
+ for (i = 0; i < utf16length - 1; i++) {
+ keysym.scancode = 0;
+ keysym.sym = SDLK_UNKNOWN;
+ keysym.mod = KMOD_NONE;
+ keysym.unicode = utf16data[i];
+ posted = SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
+ }
+ /* The keysym for the last character carries the
+ scancode and symbol that corresponds to the X11
+ keycode. */
+ if (utf16length > 0) {
+ keysym.scancode = keycode;
+ keysym.sym = (keycode ? X11_TranslateKeycode(SDL_Display, keycode) : 0);
+ keysym.mod = KMOD_NONE;
+ keysym.unicode = utf16data[utf16length - 1];
+ posted = SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
+ }
+ break;
+ }
+
+ case XLookupKeySym: {
+ /* I'm not sure whether it is possible that
+ a zero keycode makes XLookupKeySym
+ status. What I'm sure is that a
+ combination of a zero scan code and a non
+ zero sym makes SDL_PrivateKeyboard
+ strange state... So, just discard it.
+ If this doesn't work, I'm receiving bug
+ reports, and I can know under what
+ condition this case happens. */
+ if (keycode) {
+ keysym.scancode = keycode;
+ keysym.sym = X11_TranslateKeycode(SDL_Display, keycode);
+ keysym.mod = KMOD_NONE;
+ keysym.unicode = 0;
+ posted = SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
+ }
+ break;
+ }
+
+ case XLookupNone: {
+ /* IM has eaten the event. */
+ break;
+ }
+
+ default:
+ /* An unknown status from Xutf8LookupString. */
+ SDL_SetError("Oops! Xutf8LookupStringreturned an unknown status");
+ }
+
+ /* Release dynamic buffers if allocated. */
+ if (keydata != NULL && keybuf != keydata) {
+ SDL_free(keydata);
+ }
+ if (utf16data != NULL && utf16buf != utf16data) {
+ SDL_free(utf16data);
+ }
+ }
+ else
+#endif
+ {
+ static XComposeStatus state;
+ char keybuf[32];
+
+ keysym.scancode = keycode;
+ keysym.sym = X11_TranslateKeycode(SDL_Display, keycode);
+ keysym.mod = KMOD_NONE;
+ keysym.unicode = 0;
+ if ( XLookupString(&xevent.xkey,
+ keybuf, sizeof(keybuf),
+ NULL, &state) ) {
+ /*
+ * FIXME: XLookupString() may yield more than one
+ * character, so we need a mechanism to allow for
+ * this (perhaps null keypress events with a
+ * unicode value)
+ */
+ keysym.unicode = (Uint8)keybuf[0];
+ }
+
+ posted = SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
+ }
+ }
+ break;
+
+ /* Key release? */
+ case KeyRelease: {
+ SDL_keysym keysym;
+ KeyCode keycode = xevent.xkey.keycode;
+
+ if (keycode == 0) {
+ /* There should be no KeyRelease for keycode == 0,
+ since it is a notification from IM but a real
+ keystroke. */
+ /* We need to emit some diagnostic message here. */
+ break;
+ }
+
+#ifdef DEBUG_XEVENTS
+printf("KeyRelease (X11 keycode = 0x%X)\n", xevent.xkey.keycode);
+#endif
+
+ /* Get the translated SDL virtual keysym */
+ keysym.scancode = keycode;
+ keysym.sym = X11_TranslateKeycode(SDL_Display, keycode);
+ keysym.mod = KMOD_NONE;
+ keysym.unicode = 0;
+
+ posted = SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
+ }
+ break;
+
+ /* Have we been iconified? */
+ case UnmapNotify: {
+#ifdef DEBUG_XEVENTS
+printf("UnmapNotify!\n");
+#endif
+ /* If we're active, make ourselves inactive */
+ if ( SDL_GetAppState() & SDL_APPACTIVE ) {
+ /* Swap out the gamma before we go inactive */
+ X11_SwapVidModeGamma(this);
+
+ /* Send an internal deactivate event */
+ posted = SDL_PrivateAppActive(0,
+ SDL_APPACTIVE|SDL_APPINPUTFOCUS);
+ }
+ }
+ break;
+
+ /* Have we been restored? */
+ case MapNotify: {
+#ifdef DEBUG_XEVENTS
+printf("MapNotify!\n");
+#endif
+ /* If we're not active, make ourselves active */
+ if ( !(SDL_GetAppState() & SDL_APPACTIVE) ) {
+ /* Send an internal activate event */
+ posted = SDL_PrivateAppActive(1, SDL_APPACTIVE);
+
+ /* Now that we're active, swap the gamma back */
+ X11_SwapVidModeGamma(this);
+ }
+
+ if ( SDL_VideoSurface &&
+ (SDL_VideoSurface->flags & SDL_FULLSCREEN) ) {
+ X11_EnterFullScreen(this);
+ } else {
+ X11_GrabInputNoLock(this, this->input_grab);
+ }
+ X11_CheckMouseModeNoLock(this);
+
+ if ( SDL_VideoSurface ) {
+ X11_RefreshDisplay(this);
+ }
+ }
+ break;
+
+ /* Have we been resized or moved? */
+ case ConfigureNotify: {
+#ifdef DEBUG_XEVENTS
+printf("ConfigureNotify! (resize: %dx%d)\n", xevent.xconfigure.width, xevent.xconfigure.height);
+#endif
+ if ((X11_PendingConfigureNotifyWidth != -1) &&
+ (X11_PendingConfigureNotifyHeight != -1)) {
+ if ((xevent.xconfigure.width != X11_PendingConfigureNotifyWidth) &&
+ (xevent.xconfigure.height != X11_PendingConfigureNotifyHeight)) {
+ /* Event is from before the resize, so ignore. */
+ break;
+ }
+ X11_PendingConfigureNotifyWidth = -1;
+ X11_PendingConfigureNotifyHeight = -1;
+ }
+ if ( SDL_VideoSurface ) {
+ if ((xevent.xconfigure.width != SDL_VideoSurface->w) ||
+ (xevent.xconfigure.height != SDL_VideoSurface->h)) {
+ /* FIXME: Find a better fix for the bug with KDE 1.2 */
+ if ( ! ((xevent.xconfigure.width == 32) &&
+ (xevent.xconfigure.height == 32)) ) {
+ SDL_PrivateResize(xevent.xconfigure.width,
+ xevent.xconfigure.height);
+ }
+ } else {
+ /* OpenGL windows need to know about the change */
+ if ( SDL_VideoSurface->flags & SDL_OPENGL ) {
+ SDL_PrivateExpose();
+ }
+ }
+ }
+ }
+ break;
+
+ /* Have we been requested to quit (or another client message?) */
+ case ClientMessage: {
+ if ( (xevent.xclient.format == 32) &&
+ (xevent.xclient.data.l[0] == WM_DELETE_WINDOW) )
+ {
+ posted = SDL_PrivateQuit();
+ } else
+ if ( SDL_ProcessEvents[SDL_SYSWMEVENT] == SDL_ENABLE ) {
+ SDL_SysWMmsg wmmsg;
+
+ SDL_VERSION(&wmmsg.version);
+ wmmsg.subsystem = SDL_SYSWM_X11;
+ wmmsg.event.xevent = xevent;
+ posted = SDL_PrivateSysWMEvent(&wmmsg);
+ }
+ }
+ break;
+
+ /* Do we need to refresh ourselves? */
+ case Expose: {
+#ifdef DEBUG_XEVENTS
+printf("Expose (count = %d)\n", xevent.xexpose.count);
+#endif
+ if ( SDL_VideoSurface && (xevent.xexpose.count == 0) ) {
+ X11_RefreshDisplay(this);
+ }
+ }
+ break;
+
+ default: {
+#ifdef DEBUG_XEVENTS
+printf("Unhandled event %d\n", xevent.type);
+#endif
+ /* Only post the event if we're watching for it */
+ if ( SDL_ProcessEvents[SDL_SYSWMEVENT] == SDL_ENABLE ) {
+ SDL_SysWMmsg wmmsg;
+
+ SDL_VERSION(&wmmsg.version);
+ wmmsg.subsystem = SDL_SYSWM_X11;
+ wmmsg.event.xevent = xevent;
+ posted = SDL_PrivateSysWMEvent(&wmmsg);
+ }
+ }
+ break;
+ }
+ return(posted);
+}
+
+/* Ack! XPending() actually performs a blocking read if no events available */
+int X11_Pending(Display *display)
+{
+ /* Flush the display connection and look to see if events are queued */
+ XFlush(display);
+ if ( XEventsQueued(display, QueuedAlready) ) {
+ return(1);
+ }
+
+ /* More drastic measures are required -- see if X is ready to talk */
+ {
+ static struct timeval zero_time; /* static == 0 */
+ int x11_fd;
+ fd_set fdset;
+
+ x11_fd = ConnectionNumber(display);
+ FD_ZERO(&fdset);
+ FD_SET(x11_fd, &fdset);
+ if ( select(x11_fd+1, &fdset, NULL, NULL, &zero_time) == 1 ) {
+ return(XPending(display));
+ }
+ }
+
+ /* Oh well, nothing is ready .. */
+ return(0);
+}
+
+void X11_PumpEvents(_THIS)
+{
+ int pending;
+
+ /* Update activity every five seconds to prevent screensaver. --ryan. */
+ if (!allow_screensaver) {
+ static Uint32 screensaverTicks;
+ Uint32 nowTicks = SDL_GetTicks();
+ if ((nowTicks - screensaverTicks) > 5000) {
+ XResetScreenSaver(SDL_Display);
+ screensaverTicks = nowTicks;
+ }
+ }
+
+ /* Keep processing pending events */
+ pending = 0;
+ while ( X11_Pending(SDL_Display) ) {
+ X11_DispatchEvent(this);
+ ++pending;
+ }
+ if ( switch_waiting ) {
+ Uint32 now;
+
+ now = SDL_GetTicks();
+ if ( pending || !SDL_VideoSurface ) {
+ /* Try again later... */
+ if ( switch_waiting & SDL_FULLSCREEN ) {
+ switch_time = now + 1500;
+ } else {
+ switch_time = now + 200;
+ }
+ } else if ( (int)(switch_time-now) <= 0 ) {
+ Uint32 go_fullscreen;
+
+ go_fullscreen = switch_waiting & SDL_FULLSCREEN;
+ switch_waiting = 0;
+ if ( SDL_VideoSurface->flags & SDL_FULLSCREEN ) {
+ if ( go_fullscreen ) {
+ X11_EnterFullScreen(this);
+ } else {
+ X11_LeaveFullScreen(this);
+ }
+ }
+ /* Handle focus in/out when grabbed */
+ if ( go_fullscreen ) {
+ X11_GrabInputNoLock(this, this->input_grab);
+ } else {
+ X11_GrabInputNoLock(this, SDL_GRAB_OFF);
+ }
+ X11_CheckMouseModeNoLock(this);
+ }
+ }
+}
+
+void X11_InitKeymap(void)
+{
+ int i;
+
+ /* Odd keys used in international keyboards */
+ for ( i=0; i<SDL_arraysize(ODD_keymap); ++i )
+ ODD_keymap[i] = SDLK_UNKNOWN;
+
+ /* Some of these might be mappable to an existing SDLK_ code */
+ ODD_keymap[XK_dead_grave&0xFF] = SDLK_COMPOSE;
+ ODD_keymap[XK_dead_acute&0xFF] = SDLK_COMPOSE;
+ ODD_keymap[XK_dead_tilde&0xFF] = SDLK_COMPOSE;
+ ODD_keymap[XK_dead_macron&0xFF] = SDLK_COMPOSE;
+ ODD_keymap[XK_dead_breve&0xFF] = SDLK_COMPOSE;
+ ODD_keymap[XK_dead_abovedot&0xFF] = SDLK_COMPOSE;
+ ODD_keymap[XK_dead_diaeresis&0xFF] = SDLK_COMPOSE;
+ ODD_keymap[XK_dead_abovering&0xFF] = SDLK_COMPOSE;
+ ODD_keymap[XK_dead_doubleacute&0xFF] = SDLK_COMPOSE;
+ ODD_keymap[XK_dead_caron&0xFF] = SDLK_COMPOSE;
+ ODD_keymap[XK_dead_cedilla&0xFF] = SDLK_COMPOSE;
+ ODD_keymap[XK_dead_ogonek&0xFF] = SDLK_COMPOSE;
+ ODD_keymap[XK_dead_iota&0xFF] = SDLK_COMPOSE;
+ ODD_keymap[XK_dead_voiced_sound&0xFF] = SDLK_COMPOSE;
+ ODD_keymap[XK_dead_semivoiced_sound&0xFF] = SDLK_COMPOSE;
+ ODD_keymap[XK_dead_belowdot&0xFF] = SDLK_COMPOSE;
+#ifdef XK_dead_hook
+ ODD_keymap[XK_dead_hook&0xFF] = SDLK_COMPOSE;
+#endif
+#ifdef XK_dead_horn
+ ODD_keymap[XK_dead_horn&0xFF] = SDLK_COMPOSE;
+#endif
+
+#ifdef XK_dead_circumflex
+ /* These X keysyms have 0xFE as the high byte */
+ ODD_keymap[XK_dead_circumflex&0xFF] = SDLK_CARET;
+#endif
+#ifdef XK_ISO_Level3_Shift
+ ODD_keymap[XK_ISO_Level3_Shift&0xFF] = SDLK_MODE; /* "Alt Gr" key */
+#endif
+
+ /* Map the miscellaneous keys */
+ for ( i=0; i<SDL_arraysize(MISC_keymap); ++i )
+ MISC_keymap[i] = SDLK_UNKNOWN;
+
+ /* These X keysyms have 0xFF as the high byte */
+ MISC_keymap[XK_BackSpace&0xFF] = SDLK_BACKSPACE;
+ MISC_keymap[XK_Tab&0xFF] = SDLK_TAB;
+ MISC_keymap[XK_Clear&0xFF] = SDLK_CLEAR;
+ MISC_keymap[XK_Return&0xFF] = SDLK_RETURN;
+ MISC_keymap[XK_Pause&0xFF] = SDLK_PAUSE;
+ MISC_keymap[XK_Escape&0xFF] = SDLK_ESCAPE;
+ MISC_keymap[XK_Delete&0xFF] = SDLK_DELETE;
+
+ MISC_keymap[XK_KP_0&0xFF] = SDLK_KP0; /* Keypad 0-9 */
+ MISC_keymap[XK_KP_1&0xFF] = SDLK_KP1;
+ MISC_keymap[XK_KP_2&0xFF] = SDLK_KP2;
+ MISC_keymap[XK_KP_3&0xFF] = SDLK_KP3;
+ MISC_keymap[XK_KP_4&0xFF] = SDLK_KP4;
+ MISC_keymap[XK_KP_5&0xFF] = SDLK_KP5;
+ MISC_keymap[XK_KP_6&0xFF] = SDLK_KP6;
+ MISC_keymap[XK_KP_7&0xFF] = SDLK_KP7;
+ MISC_keymap[XK_KP_8&0xFF] = SDLK_KP8;
+ MISC_keymap[XK_KP_9&0xFF] = SDLK_KP9;
+ MISC_keymap[XK_KP_Insert&0xFF] = SDLK_KP0;
+ MISC_keymap[XK_KP_End&0xFF] = SDLK_KP1;
+ MISC_keymap[XK_KP_Down&0xFF] = SDLK_KP2;
+ MISC_keymap[XK_KP_Page_Down&0xFF] = SDLK_KP3;
+ MISC_keymap[XK_KP_Left&0xFF] = SDLK_KP4;
+ MISC_keymap[XK_KP_Begin&0xFF] = SDLK_KP5;
+ MISC_keymap[XK_KP_Right&0xFF] = SDLK_KP6;
+ MISC_keymap[XK_KP_Home&0xFF] = SDLK_KP7;
+ MISC_keymap[XK_KP_Up&0xFF] = SDLK_KP8;
+ MISC_keymap[XK_KP_Page_Up&0xFF] = SDLK_KP9;
+ MISC_keymap[XK_KP_Delete&0xFF] = SDLK_KP_PERIOD;
+ MISC_keymap[XK_KP_Decimal&0xFF] = SDLK_KP_PERIOD;
+ MISC_keymap[XK_KP_Divide&0xFF] = SDLK_KP_DIVIDE;
+ MISC_keymap[XK_KP_Multiply&0xFF] = SDLK_KP_MULTIPLY;
+ MISC_keymap[XK_KP_Subtract&0xFF] = SDLK_KP_MINUS;
+ MISC_keymap[XK_KP_Add&0xFF] = SDLK_KP_PLUS;
+ MISC_keymap[XK_KP_Enter&0xFF] = SDLK_KP_ENTER;
+ MISC_keymap[XK_KP_Equal&0xFF] = SDLK_KP_EQUALS;
+
+ MISC_keymap[XK_Up&0xFF] = SDLK_UP;
+ MISC_keymap[XK_Down&0xFF] = SDLK_DOWN;
+ MISC_keymap[XK_Right&0xFF] = SDLK_RIGHT;
+ MISC_keymap[XK_Left&0xFF] = SDLK_LEFT;
+ MISC_keymap[XK_Insert&0xFF] = SDLK_INSERT;
+ MISC_keymap[XK_Home&0xFF] = SDLK_HOME;
+ MISC_keymap[XK_End&0xFF] = SDLK_END;
+ MISC_keymap[XK_Page_Up&0xFF] = SDLK_PAGEUP;
+ MISC_keymap[XK_Page_Down&0xFF] = SDLK_PAGEDOWN;
+
+ MISC_keymap[XK_F1&0xFF] = SDLK_F1;
+ MISC_keymap[XK_F2&0xFF] = SDLK_F2;
+ MISC_keymap[XK_F3&0xFF] = SDLK_F3;
+ MISC_keymap[XK_F4&0xFF] = SDLK_F4;
+ MISC_keymap[XK_F5&0xFF] = SDLK_F5;
+ MISC_keymap[XK_F6&0xFF] = SDLK_F6;
+ MISC_keymap[XK_F7&0xFF] = SDLK_F7;
+ MISC_keymap[XK_F8&0xFF] = SDLK_F8;
+ MISC_keymap[XK_F9&0xFF] = SDLK_F9;
+ MISC_keymap[XK_F10&0xFF] = SDLK_F10;
+ MISC_keymap[XK_F11&0xFF] = SDLK_F11;
+ MISC_keymap[XK_F12&0xFF] = SDLK_F12;
+ MISC_keymap[XK_F13&0xFF] = SDLK_F13;
+ MISC_keymap[XK_F14&0xFF] = SDLK_F14;
+ MISC_keymap[XK_F15&0xFF] = SDLK_F15;
+
+ MISC_keymap[XK_Num_Lock&0xFF] = SDLK_NUMLOCK;
+ MISC_keymap[XK_Caps_Lock&0xFF] = SDLK_CAPSLOCK;
+ MISC_keymap[XK_Scroll_Lock&0xFF] = SDLK_SCROLLOCK;
+ MISC_keymap[XK_Shift_R&0xFF] = SDLK_RSHIFT;
+ MISC_keymap[XK_Shift_L&0xFF] = SDLK_LSHIFT;
+ MISC_keymap[XK_Control_R&0xFF] = SDLK_RCTRL;
+ MISC_keymap[XK_Control_L&0xFF] = SDLK_LCTRL;
+ MISC_keymap[XK_Alt_R&0xFF] = SDLK_RALT;
+ MISC_keymap[XK_Alt_L&0xFF] = SDLK_LALT;
+ MISC_keymap[XK_Meta_R&0xFF] = SDLK_RMETA;
+ MISC_keymap[XK_Meta_L&0xFF] = SDLK_LMETA;
+ MISC_keymap[XK_Super_L&0xFF] = SDLK_LSUPER; /* Left "Windows" */
+ MISC_keymap[XK_Super_R&0xFF] = SDLK_RSUPER; /* Right "Windows */
+ MISC_keymap[XK_Mode_switch&0xFF] = SDLK_MODE; /* "Alt Gr" key */
+ MISC_keymap[XK_Multi_key&0xFF] = SDLK_COMPOSE; /* Multi-key compose */
+
+ MISC_keymap[XK_Help&0xFF] = SDLK_HELP;
+ MISC_keymap[XK_Print&0xFF] = SDLK_PRINT;
+ MISC_keymap[XK_Sys_Req&0xFF] = SDLK_SYSREQ;
+ MISC_keymap[XK_Break&0xFF] = SDLK_BREAK;
+ MISC_keymap[XK_Menu&0xFF] = SDLK_MENU;
+ MISC_keymap[XK_Hyper_R&0xFF] = SDLK_MENU; /* Windows "Menu" key */
+}
+
+/* Get the translated SDL virtual keysym */
+SDLKey X11_TranslateKeycode(Display *display, KeyCode kc)
+{
+ KeySym xsym;
+ SDLKey key;
+
+ xsym = XKeycodeToKeysym(display, kc, 0);
+#ifdef DEBUG_KEYS
+ fprintf(stderr, "Translating key code %d -> 0x%.4x\n", kc, xsym);
+#endif
+ key = SDLK_UNKNOWN;
+ if ( xsym ) {
+ switch (xsym>>8) {
+ case 0x1005FF:
+#ifdef SunXK_F36
+ if ( xsym == SunXK_F36 )
+ key = SDLK_F11;
+#endif
+#ifdef SunXK_F37
+ if ( xsym == SunXK_F37 )
+ key = SDLK_F12;
+#endif
+ break;
+ case 0x00: /* Latin 1 */
+ key = (SDLKey)(xsym & 0xFF);
+ break;
+ case 0x01: /* Latin 2 */
+ case 0x02: /* Latin 3 */
+ case 0x03: /* Latin 4 */
+ case 0x04: /* Katakana */
+ case 0x05: /* Arabic */
+ case 0x06: /* Cyrillic */
+ case 0x07: /* Greek */
+ case 0x08: /* Technical */
+ case 0x0A: /* Publishing */
+ case 0x0C: /* Hebrew */
+ case 0x0D: /* Thai */
+ /* These are wrong, but it's better than nothing */
+ key = (SDLKey)(xsym & 0xFF);
+ break;
+ case 0xFE:
+ key = ODD_keymap[xsym&0xFF];
+ break;
+ case 0xFF:
+ key = MISC_keymap[xsym&0xFF];
+ break;
+ default:
+ /*
+ fprintf(stderr, "X11: Unhandled xsym, sym = 0x%04x\n",
+ (unsigned int)xsym);
+ */
+ break;
+ }
+ } else {
+ /* X11 doesn't know how to translate the key! */
+ switch (kc) {
+ /* Caution:
+ These keycodes are from the Microsoft Keyboard
+ */
+ case 115:
+ key = SDLK_LSUPER;
+ break;
+ case 116:
+ key = SDLK_RSUPER;
+ break;
+ case 117:
+ key = SDLK_MENU;
+ break;
+ default:
+ /*
+ * no point in an error message; happens for
+ * several keys when we get a keymap notify
+ */
+ break;
+ }
+ }
+ return key;
+}
+
+/* X11 modifier masks for various keys */
+static unsigned meta_l_mask, meta_r_mask, alt_l_mask, alt_r_mask;
+static unsigned num_mask, mode_switch_mask;
+
+static void get_modifier_masks(Display *display)
+{
+ static unsigned got_masks;
+ int i, j;
+ XModifierKeymap *xmods;
+ unsigned n;
+
+ if(got_masks)
+ return;
+
+ xmods = XGetModifierMapping(display);
+ n = xmods->max_keypermod;
+ for(i = 3; i < 8; i++) {
+ for(j = 0; j < n; j++) {
+ KeyCode kc = xmods->modifiermap[i * n + j];
+ KeySym ks = XKeycodeToKeysym(display, kc, 0);
+ unsigned mask = 1 << i;
+ switch(ks) {
+ case XK_Num_Lock:
+ num_mask = mask; break;
+ case XK_Alt_L:
+ alt_l_mask = mask; break;
+ case XK_Alt_R:
+ alt_r_mask = mask; break;
+ case XK_Meta_L:
+ meta_l_mask = mask; break;
+ case XK_Meta_R:
+ meta_r_mask = mask; break;
+ case XK_Mode_switch:
+ mode_switch_mask = mask; break;
+ }
+ }
+ }
+ XFreeModifiermap(xmods);
+ got_masks = 1;
+}
+
+
+/*
+ * This function is semi-official; it is not officially exported and should
+ * not be considered part of the SDL API, but may be used by client code
+ * that *really* needs it (including legacy code).
+ * It is slow, though, and should be avoided if possible.
+ *
+ * Note that it isn't completely accurate either; in particular, multi-key
+ * sequences (dead accents, compose key sequences) will not work since the
+ * state has been irrevocably lost.
+ */
+Uint16 X11_KeyToUnicode(SDLKey keysym, SDLMod modifiers)
+{
+ struct SDL_VideoDevice *this = current_video;
+ char keybuf[32];
+ int i;
+ KeySym xsym = 0;
+ XKeyEvent xkey;
+ Uint16 unicode;
+
+ if ( !this || !SDL_Display ) {
+ return 0;
+ }
+
+ SDL_memset(&xkey, 0, sizeof(xkey));
+ xkey.display = SDL_Display;
+
+ xsym = keysym; /* last resort if not found */
+ for (i = 0; i < 256; ++i) {
+ if ( MISC_keymap[i] == keysym ) {
+ xsym = 0xFF00 | i;
+ break;
+ } else if ( ODD_keymap[i] == keysym ) {
+ xsym = 0xFE00 | i;
+ break;
+ }
+ }
+
+ xkey.keycode = XKeysymToKeycode(xkey.display, xsym);
+
+ get_modifier_masks(SDL_Display);
+ if(modifiers & KMOD_SHIFT)
+ xkey.state |= ShiftMask;
+ if(modifiers & KMOD_CAPS)
+ xkey.state |= LockMask;
+ if(modifiers & KMOD_CTRL)
+ xkey.state |= ControlMask;
+ if(modifiers & KMOD_MODE)
+ xkey.state |= mode_switch_mask;
+ if(modifiers & KMOD_LALT)
+ xkey.state |= alt_l_mask;
+ if(modifiers & KMOD_RALT)
+ xkey.state |= alt_r_mask;
+ if(modifiers & KMOD_LMETA)
+ xkey.state |= meta_l_mask;
+ if(modifiers & KMOD_RMETA)
+ xkey.state |= meta_r_mask;
+ if(modifiers & KMOD_NUM)
+ xkey.state |= num_mask;
+
+ unicode = 0;
+ if ( XLookupString(&xkey, keybuf, sizeof(keybuf), NULL, NULL) )
+ unicode = (unsigned char)keybuf[0];
+ return(unicode);
+}
+
+
+/*
+ * Called when focus is regained, to read the keyboard state and generate
+ * synthetic keypress/release events.
+ * key_vec is a bit vector of keycodes (256 bits)
+ */
+void X11_SetKeyboardState(Display *display, const char *key_vec)
+{
+ char keys_return[32];
+ int i;
+ Uint8 *kstate = SDL_GetKeyState(NULL);
+ SDLMod modstate;
+ Window junk_window;
+ int x, y;
+ unsigned int mask;
+
+ /* The first time the window is mapped, we initialize key state */
+ if ( ! key_vec ) {
+ XQueryKeymap(display, keys_return);
+ key_vec = keys_return;
+ }
+
+ /* Get the keyboard modifier state */
+ modstate = 0;
+ get_modifier_masks(display);
+ if ( XQueryPointer(display, DefaultRootWindow(display),
+ &junk_window, &junk_window, &x, &y, &x, &y, &mask) ) {
+ if ( mask & LockMask ) {
+ modstate |= KMOD_CAPS;
+ }
+ if ( mask & mode_switch_mask ) {
+ modstate |= KMOD_MODE;
+ }
+ if ( mask & num_mask ) {
+ modstate |= KMOD_NUM;
+ }
+ }
+
+ /* Zero the new keyboard state and generate it */
+ SDL_memset(kstate, 0, SDLK_LAST);
+ /*
+ * An obvious optimisation is to check entire longwords at a time in
+ * both loops, but we can't be sure the arrays are aligned so it's not
+ * worth the extra complexity
+ */
+ for ( i = 0; i < 32; i++ ) {
+ int j;
+ if ( !key_vec[i] )
+ continue;
+ for ( j = 0; j < 8; j++ ) {
+ if ( key_vec[i] & (1 << j) ) {
+ SDLKey key;
+ KeyCode kc = (i << 3 | j);
+ key = X11_TranslateKeycode(display, kc);
+ if ( key == SDLK_UNKNOWN ) {
+ continue;
+ }
+ kstate[key] = SDL_PRESSED;
+ switch (key) {
+ case SDLK_LSHIFT:
+ modstate |= KMOD_LSHIFT;
+ break;
+ case SDLK_RSHIFT:
+ modstate |= KMOD_RSHIFT;
+ break;
+ case SDLK_LCTRL:
+ modstate |= KMOD_LCTRL;
+ break;
+ case SDLK_RCTRL:
+ modstate |= KMOD_RCTRL;
+ break;
+ case SDLK_LALT:
+ modstate |= KMOD_LALT;
+ break;
+ case SDLK_RALT:
+ modstate |= KMOD_RALT;
+ break;
+ case SDLK_LMETA:
+ modstate |= KMOD_LMETA;
+ break;
+ case SDLK_RMETA:
+ modstate |= KMOD_RMETA;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+
+ /* Hack - set toggle key state */
+ if ( modstate & KMOD_CAPS ) {
+ kstate[SDLK_CAPSLOCK] = SDL_PRESSED;
+ } else {
+ kstate[SDLK_CAPSLOCK] = SDL_RELEASED;
+ }
+ if ( modstate & KMOD_NUM ) {
+ kstate[SDLK_NUMLOCK] = SDL_PRESSED;
+ } else {
+ kstate[SDLK_NUMLOCK] = SDL_RELEASED;
+ }
+
+ /* Set the final modifier state */
+ SDL_SetModState(modstate);
+}
+
+void X11_InitOSKeymap(_THIS)
+{
+ X11_InitKeymap();
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11events_c.h b/distrib/sdl-1.2.15/src/video/x11/SDL_x11events_c.h
new file mode 100644
index 0000000..fe26d9c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11events_c.h
@@ -0,0 +1,34 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_x11video.h"
+
+/* Functions to be exported */
+extern void X11_InitOSKeymap(_THIS);
+extern void X11_PumpEvents(_THIS);
+extern void X11_SetKeyboardState(Display *display, const char *key_vec);
+
+/* Variables to be exported */
+extern int X11_PendingConfigureNotifyWidth;
+extern int X11_PendingConfigureNotifyHeight;
+
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11gamma.c b/distrib/sdl-1.2.15/src/video/x11/SDL_x11gamma.c
new file mode 100644
index 0000000..c6afbda
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11gamma.c
@@ -0,0 +1,142 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL.h"
+#include "SDL_events.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_x11video.h"
+
+/* From the X server sources... */
+#define MAX_GAMMA 10.0
+#define MIN_GAMMA (1.0/MAX_GAMMA)
+
+static int X11_SetGammaNoLock(_THIS, float red, float green, float blue)
+{
+#if SDL_VIDEO_DRIVER_X11_VIDMODE
+ if (use_vidmode >= 200) {
+ SDL_NAME(XF86VidModeGamma) gamma;
+ Bool succeeded;
+
+ /* Clamp the gamma values */
+ if ( red < MIN_GAMMA ) {
+ gamma.red = MIN_GAMMA;
+ } else
+ if ( red > MAX_GAMMA ) {
+ gamma.red = MAX_GAMMA;
+ } else {
+ gamma.red = red;
+ }
+ if ( green < MIN_GAMMA ) {
+ gamma.green = MIN_GAMMA;
+ } else
+ if ( green > MAX_GAMMA ) {
+ gamma.green = MAX_GAMMA;
+ } else {
+ gamma.green = green;
+ }
+ if ( blue < MIN_GAMMA ) {
+ gamma.blue = MIN_GAMMA;
+ } else
+ if ( blue > MAX_GAMMA ) {
+ gamma.blue = MAX_GAMMA;
+ } else {
+ gamma.blue = blue;
+ }
+ if ( SDL_GetAppState() & SDL_APPACTIVE ) {
+ succeeded = SDL_NAME(XF86VidModeSetGamma)(SDL_Display, SDL_Screen, &gamma);
+ XSync(SDL_Display, False);
+ } else {
+ gamma_saved[0] = gamma.red;
+ gamma_saved[1] = gamma.green;
+ gamma_saved[2] = gamma.blue;
+ succeeded = True;
+ }
+ if ( succeeded ) {
+ ++gamma_changed;
+ }
+ return succeeded ? 0 : -1;
+ }
+#endif
+ SDL_SetError("Gamma correction not supported");
+ return -1;
+}
+int X11_SetVidModeGamma(_THIS, float red, float green, float blue)
+{
+ int result;
+
+ SDL_Lock_EventThread();
+ result = X11_SetGammaNoLock(this, red, green, blue);
+ SDL_Unlock_EventThread();
+
+ return(result);
+}
+
+static int X11_GetGammaNoLock(_THIS, float *red, float *green, float *blue)
+{
+#if SDL_VIDEO_DRIVER_X11_VIDMODE
+ if (use_vidmode >= 200) {
+ SDL_NAME(XF86VidModeGamma) gamma;
+ if (SDL_NAME(XF86VidModeGetGamma)(SDL_Display, SDL_Screen, &gamma)) {
+ *red = gamma.red;
+ *green = gamma.green;
+ *blue = gamma.blue;
+ return 0;
+ }
+ return -1;
+ }
+#endif
+ return -1;
+}
+int X11_GetVidModeGamma(_THIS, float *red, float *green, float *blue)
+{
+ int result;
+
+ SDL_Lock_EventThread();
+ result = X11_GetGammaNoLock(this, red, green, blue);
+ SDL_Unlock_EventThread();
+
+ return(result);
+}
+
+void X11_SaveVidModeGamma(_THIS)
+{
+ /* Try to save the current gamma, otherwise disable gamma control */
+ if ( X11_GetGammaNoLock(this,
+ &gamma_saved[0], &gamma_saved[1], &gamma_saved[2]) < 0 ) {
+ this->SetGamma = 0;
+ this->GetGamma = 0;
+ }
+ gamma_changed = 0;
+}
+void X11_SwapVidModeGamma(_THIS)
+{
+ float new_gamma[3];
+
+ if ( gamma_changed ) {
+ new_gamma[0] = gamma_saved[0];
+ new_gamma[1] = gamma_saved[1];
+ new_gamma[2] = gamma_saved[2];
+ X11_GetGammaNoLock(this, &gamma_saved[0], &gamma_saved[1], &gamma_saved[2]);
+ X11_SetGammaNoLock(this, new_gamma[0], new_gamma[1], new_gamma[2]);
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11gamma_c.h b/distrib/sdl-1.2.15/src/video/x11/SDL_x11gamma_c.h
new file mode 100644
index 0000000..c46350f
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11gamma_c.h
@@ -0,0 +1,32 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_x11gamma_h
+#define _SDL_x11gamma_h
+
+extern int X11_SetVidModeGamma(_THIS, float red, float green, float blue);
+extern int X11_GetVidModeGamma(_THIS, float *red, float *green, float *blue);
+extern void X11_SaveVidModeGamma(_THIS);
+extern void X11_SwapVidModeGamma(_THIS);
+
+#endif
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11gl.c b/distrib/sdl-1.2.15/src/video/x11/SDL_x11gl.c
new file mode 100644
index 0000000..aa5297b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11gl.c
@@ -0,0 +1,577 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_x11video.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_x11dga_c.h"
+#include "SDL_x11gl_c.h"
+
+#if defined(__IRIX__)
+/* IRIX doesn't have a GL library versioning system */
+#define DEFAULT_OPENGL "libGL.so"
+#elif defined(__MACOSX__)
+#define DEFAULT_OPENGL "/usr/X11R6/lib/libGL.1.dylib"
+#elif defined(__QNXNTO__)
+#define DEFAULT_OPENGL "libGL.so.3"
+#elif defined(__OpenBSD__)
+#define DEFAULT_OPENGL "libGL.so.4.0"
+#else
+#define DEFAULT_OPENGL "libGL.so.1"
+#endif
+
+#ifndef GLX_ARB_multisample
+#define GLX_ARB_multisample
+#define GLX_SAMPLE_BUFFERS_ARB 100000
+#define GLX_SAMPLES_ARB 100001
+#endif
+
+/* GLX_EXT_visual_rating stuff that might not be in the system headers... */
+#ifndef GLX_VISUAL_CAVEAT_EXT
+#define GLX_VISUAL_CAVEAT_EXT 0x20
+#endif
+#ifndef GLX_NONE_EXT
+#define GLX_NONE_EXT 0x8000
+#endif
+#ifndef GLX_SLOW_VISUAL_EXT
+#define GLX_SLOW_VISUAL_EXT 0x8001
+#endif
+#ifndef GLX_NON_CONFORMANT_VISUAL_EXT
+#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
+#endif
+
+
+#if SDL_VIDEO_OPENGL_GLX
+static int glXExtensionSupported(_THIS, const char *extension)
+{
+ const char *extensions;
+ const char *start;
+ const char *where, *terminator;
+
+ /* Extension names should not have spaces. */
+ where = SDL_strchr(extension, ' ');
+ if ( where || *extension == '\0' ) {
+ return 0;
+ }
+
+ extensions = this->gl_data->glXQueryExtensionsString(GFX_Display,SDL_Screen);
+ /* It takes a bit of care to be fool-proof about parsing the
+ * OpenGL extensions string. Don't be fooled by sub-strings, etc.
+ */
+
+ /* http://bugs.debian.org/537487 */
+ if (extensions == NULL) {
+ return 0;
+ }
+
+ start = extensions;
+
+ for (;;) {
+ where = SDL_strstr(start, extension);
+ if (!where) break;
+
+ terminator = where + strlen(extension);
+ if (where == start || *(where - 1) == ' ')
+ if (*terminator == ' ' || *terminator == '\0') return 1;
+
+ start = terminator;
+ }
+ return 0;
+}
+#endif /* SDL_VIDEO_OPENGL_GLX */
+
+XVisualInfo *X11_GL_GetVisual(_THIS)
+{
+#if SDL_VIDEO_OPENGL_GLX
+ /* 64 seems nice. */
+ int attribs[64];
+ int i;
+
+ /* load the gl driver from a default path */
+ if ( ! this->gl_config.driver_loaded ) {
+ /* no driver has been loaded, use default (ourselves) */
+ if ( X11_GL_LoadLibrary(this, NULL) < 0 ) {
+ return NULL;
+ }
+ }
+
+ /* See if we already have a window which we must use */
+ if ( SDL_windowid ) {
+ XWindowAttributes a;
+ XVisualInfo vi_in;
+ int out_count;
+
+ XGetWindowAttributes(SDL_Display, SDL_Window, &a);
+ vi_in.screen = SDL_Screen;
+ vi_in.visualid = XVisualIDFromVisual(a.visual);
+ glx_visualinfo = XGetVisualInfo(SDL_Display,
+ VisualScreenMask|VisualIDMask, &vi_in, &out_count);
+ return glx_visualinfo;
+ }
+
+ /* Setup our GLX attributes according to the gl_config. */
+ i = 0;
+ attribs[i++] = GLX_RGBA;
+ attribs[i++] = GLX_RED_SIZE;
+ attribs[i++] = this->gl_config.red_size;
+ attribs[i++] = GLX_GREEN_SIZE;
+ attribs[i++] = this->gl_config.green_size;
+ attribs[i++] = GLX_BLUE_SIZE;
+ attribs[i++] = this->gl_config.blue_size;
+
+ if( this->gl_config.alpha_size ) {
+ attribs[i++] = GLX_ALPHA_SIZE;
+ attribs[i++] = this->gl_config.alpha_size;
+ }
+
+ if( this->gl_config.double_buffer ) {
+ attribs[i++] = GLX_DOUBLEBUFFER;
+ }
+
+ attribs[i++] = GLX_DEPTH_SIZE;
+ attribs[i++] = this->gl_config.depth_size;
+
+ if( this->gl_config.stencil_size ) {
+ attribs[i++] = GLX_STENCIL_SIZE;
+ attribs[i++] = this->gl_config.stencil_size;
+ }
+
+ if( this->gl_config.accum_red_size ) {
+ attribs[i++] = GLX_ACCUM_RED_SIZE;
+ attribs[i++] = this->gl_config.accum_red_size;
+ }
+
+ if( this->gl_config.accum_green_size ) {
+ attribs[i++] = GLX_ACCUM_GREEN_SIZE;
+ attribs[i++] = this->gl_config.accum_green_size;
+ }
+
+ if( this->gl_config.accum_blue_size ) {
+ attribs[i++] = GLX_ACCUM_BLUE_SIZE;
+ attribs[i++] = this->gl_config.accum_blue_size;
+ }
+
+ if( this->gl_config.accum_alpha_size ) {
+ attribs[i++] = GLX_ACCUM_ALPHA_SIZE;
+ attribs[i++] = this->gl_config.accum_alpha_size;
+ }
+
+ if( this->gl_config.stereo ) {
+ attribs[i++] = GLX_STEREO;
+ }
+
+ if( this->gl_config.multisamplebuffers ) {
+ attribs[i++] = GLX_SAMPLE_BUFFERS_ARB;
+ attribs[i++] = this->gl_config.multisamplebuffers;
+ }
+
+ if( this->gl_config.multisamplesamples ) {
+ attribs[i++] = GLX_SAMPLES_ARB;
+ attribs[i++] = this->gl_config.multisamplesamples;
+ }
+
+ if( this->gl_config.accelerated >= 0 &&
+ glXExtensionSupported(this, "GLX_EXT_visual_rating") ) {
+ attribs[i++] = GLX_VISUAL_CAVEAT_EXT;
+ attribs[i++] = GLX_NONE_EXT;
+ }
+
+#ifdef GLX_DIRECT_COLOR /* Try for a DirectColor visual for gamma support */
+ if ( !SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ) {
+ attribs[i++] = GLX_X_VISUAL_TYPE;
+ attribs[i++] = GLX_DIRECT_COLOR;
+ }
+#endif
+ attribs[i++] = None;
+
+ glx_visualinfo = this->gl_data->glXChooseVisual(GFX_Display,
+ SDL_Screen, attribs);
+#ifdef GLX_DIRECT_COLOR
+ if( !glx_visualinfo && !SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ) { /* No DirectColor visual? Try again.. */
+ attribs[i-3] = None;
+ glx_visualinfo = this->gl_data->glXChooseVisual(GFX_Display,
+ SDL_Screen, attribs);
+ }
+#endif
+ if( !glx_visualinfo ) {
+ SDL_SetError( "Couldn't find matching GLX visual");
+ return NULL;
+ }
+/*
+ printf("Found GLX visual 0x%x\n", glx_visualinfo->visualid);
+*/
+ return glx_visualinfo;
+#else
+ SDL_SetError("X11 driver not configured with OpenGL");
+ return NULL;
+#endif
+}
+
+int X11_GL_CreateWindow(_THIS, int w, int h)
+{
+ int retval;
+#if SDL_VIDEO_OPENGL_GLX
+ XSetWindowAttributes attributes;
+ unsigned long mask;
+ unsigned long black;
+
+ black = (glx_visualinfo->visual == DefaultVisual(SDL_Display,
+ SDL_Screen))
+ ? BlackPixel(SDL_Display, SDL_Screen) : 0;
+ attributes.background_pixel = black;
+ attributes.border_pixel = black;
+ attributes.colormap = SDL_XColorMap;
+ mask = CWBackPixel | CWBorderPixel | CWColormap;
+
+ SDL_Window = XCreateWindow(SDL_Display, WMwindow,
+ 0, 0, w, h, 0, glx_visualinfo->depth,
+ InputOutput, glx_visualinfo->visual,
+ mask, &attributes);
+ if ( !SDL_Window ) {
+ SDL_SetError("Could not create window");
+ return -1;
+ }
+ retval = 0;
+#else
+ SDL_SetError("X11 driver not configured with OpenGL");
+ retval = -1;
+#endif
+ return(retval);
+}
+
+int X11_GL_CreateContext(_THIS)
+{
+ int retval;
+#if SDL_VIDEO_OPENGL_GLX
+
+ /* We do this to create a clean separation between X and GLX errors. */
+ XSync( SDL_Display, False );
+ glx_context = this->gl_data->glXCreateContext(GFX_Display,
+ glx_visualinfo, NULL, True);
+ XSync( GFX_Display, False );
+
+ if ( glx_context == NULL ) {
+ SDL_SetError("Could not create GL context");
+ return(-1);
+ }
+ if ( X11_GL_MakeCurrent(this) < 0 ) {
+ return(-1);
+ }
+ gl_active = 1;
+
+ if ( !glXExtensionSupported(this, "GLX_SGI_swap_control") ) {
+ this->gl_data->glXSwapIntervalSGI = NULL;
+ }
+ if ( !glXExtensionSupported(this, "GLX_MESA_swap_control") ) {
+ this->gl_data->glXSwapIntervalMESA = NULL;
+ }
+ if ( !glXExtensionSupported(this, "GLX_EXT_swap_control") ) {
+ this->gl_data->glXSwapIntervalEXT = NULL;
+ }
+
+ if ( this->gl_config.swap_control >= 0 ) {
+ int rc = -1;
+ if ( this->gl_data->glXSwapIntervalEXT ) {
+ rc = this->gl_data->glXSwapIntervalEXT(GFX_Display, SDL_Window,
+ this->gl_config.swap_control);
+ } else if ( this->gl_data->glXSwapIntervalMESA ) {
+ rc = this->gl_data->glXSwapIntervalMESA(this->gl_config.swap_control);
+ } else if ( this->gl_data->glXSwapIntervalSGI ) {
+ rc = this->gl_data->glXSwapIntervalSGI(this->gl_config.swap_control);
+ }
+ if (rc == 0) {
+ this->gl_data->swap_interval = this->gl_config.swap_control;
+ }
+ }
+#else
+ SDL_SetError("X11 driver not configured with OpenGL");
+#endif
+ if ( gl_active ) {
+ retval = 0;
+ } else {
+ retval = -1;
+ }
+ return(retval);
+}
+
+void X11_GL_Shutdown(_THIS)
+{
+#if SDL_VIDEO_OPENGL_GLX
+ /* Clean up OpenGL */
+ if( glx_context ) {
+ this->gl_data->glXMakeCurrent(GFX_Display, None, NULL);
+
+ if (glx_context != NULL)
+ this->gl_data->glXDestroyContext(GFX_Display, glx_context);
+
+ glx_context = NULL;
+ }
+ gl_active = 0;
+#endif /* SDL_VIDEO_OPENGL_GLX */
+}
+
+#if SDL_VIDEO_OPENGL_GLX
+
+/* Make the current context active */
+int X11_GL_MakeCurrent(_THIS)
+{
+ int retval;
+
+ retval = 0;
+ if ( ! this->gl_data->glXMakeCurrent(GFX_Display,
+ SDL_Window, glx_context) ) {
+ SDL_SetError("Unable to make GL context current");
+ retval = -1;
+ }
+ XSync( GFX_Display, False );
+
+ /* More Voodoo X server workarounds... Grr... */
+ SDL_Lock_EventThread();
+ X11_CheckDGAMouse(this);
+ SDL_Unlock_EventThread();
+
+ return(retval);
+}
+
+/* Get attribute data from glX. */
+int X11_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value)
+{
+ int retval = -1;
+ int unsupported = 0;
+ int glx_attrib = None;
+
+ switch( attrib ) {
+ case SDL_GL_RED_SIZE:
+ glx_attrib = GLX_RED_SIZE;
+ break;
+ case SDL_GL_GREEN_SIZE:
+ glx_attrib = GLX_GREEN_SIZE;
+ break;
+ case SDL_GL_BLUE_SIZE:
+ glx_attrib = GLX_BLUE_SIZE;
+ break;
+ case SDL_GL_ALPHA_SIZE:
+ glx_attrib = GLX_ALPHA_SIZE;
+ break;
+ case SDL_GL_DOUBLEBUFFER:
+ glx_attrib = GLX_DOUBLEBUFFER;
+ break;
+ case SDL_GL_BUFFER_SIZE:
+ glx_attrib = GLX_BUFFER_SIZE;
+ break;
+ case SDL_GL_DEPTH_SIZE:
+ glx_attrib = GLX_DEPTH_SIZE;
+ break;
+ case SDL_GL_STENCIL_SIZE:
+ glx_attrib = GLX_STENCIL_SIZE;
+ break;
+ case SDL_GL_ACCUM_RED_SIZE:
+ glx_attrib = GLX_ACCUM_RED_SIZE;
+ break;
+ case SDL_GL_ACCUM_GREEN_SIZE:
+ glx_attrib = GLX_ACCUM_GREEN_SIZE;
+ break;
+ case SDL_GL_ACCUM_BLUE_SIZE:
+ glx_attrib = GLX_ACCUM_BLUE_SIZE;
+ break;
+ case SDL_GL_ACCUM_ALPHA_SIZE:
+ glx_attrib = GLX_ACCUM_ALPHA_SIZE;
+ break;
+ case SDL_GL_STEREO:
+ glx_attrib = GLX_STEREO;
+ break;
+ case SDL_GL_MULTISAMPLEBUFFERS:
+ glx_attrib = GLX_SAMPLE_BUFFERS_ARB;
+ break;
+ case SDL_GL_MULTISAMPLESAMPLES:
+ glx_attrib = GLX_SAMPLES_ARB;
+ break;
+ case SDL_GL_ACCELERATED_VISUAL:
+ if ( glXExtensionSupported(this, "GLX_EXT_visual_rating") ) {
+ glx_attrib = GLX_VISUAL_CAVEAT_EXT;
+ retval = this->gl_data->glXGetConfig(GFX_Display, glx_visualinfo, glx_attrib, value);
+ if ( *value == GLX_SLOW_VISUAL_EXT ) {
+ *value = SDL_FALSE;
+ } else {
+ *value = SDL_TRUE;
+ }
+ return retval;
+ } else {
+ unsupported = 1;
+ }
+ break;
+ case SDL_GL_SWAP_CONTROL:
+ if ( ( this->gl_data->glXSwapIntervalEXT ) ||
+ ( this->gl_data->glXSwapIntervalMESA ) ||
+ ( this->gl_data->glXSwapIntervalSGI ) ) {
+ *value = this->gl_data->swap_interval;
+ return 0;
+ } else {
+ unsupported = 1;
+ }
+ break;
+ default:
+ unsupported = 1;
+ break;
+ }
+
+ if (unsupported) {
+ SDL_SetError("OpenGL attribute is unsupported on this system");
+ } else {
+ retval = this->gl_data->glXGetConfig(GFX_Display, glx_visualinfo, glx_attrib, value);
+ }
+ return retval;
+}
+
+void X11_GL_SwapBuffers(_THIS)
+{
+ this->gl_data->glXSwapBuffers(GFX_Display, SDL_Window);
+}
+
+#endif /* SDL_VIDEO_OPENGL_GLX */
+
+#define OPENGL_REQUIRS_DLOPEN
+#if defined(OPENGL_REQUIRS_DLOPEN) && defined(SDL_LOADSO_DLOPEN)
+#include <dlfcn.h>
+#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
+#endif
+
+void X11_GL_UnloadLibrary(_THIS)
+{
+#if SDL_VIDEO_OPENGL_GLX
+ if ( this->gl_config.driver_loaded ) {
+
+ GL_UnloadObject(this->gl_config.dll_handle);
+
+ this->gl_data->glXGetProcAddress = NULL;
+ this->gl_data->glXChooseVisual = NULL;
+ this->gl_data->glXCreateContext = NULL;
+ this->gl_data->glXDestroyContext = NULL;
+ this->gl_data->glXMakeCurrent = NULL;
+ this->gl_data->glXSwapBuffers = NULL;
+ this->gl_data->glXSwapIntervalSGI = NULL;
+ this->gl_data->glXSwapIntervalMESA = NULL;
+ this->gl_data->glXSwapIntervalEXT = NULL;
+
+ this->gl_config.dll_handle = NULL;
+ this->gl_config.driver_loaded = 0;
+ }
+#endif
+}
+
+#if SDL_VIDEO_OPENGL_GLX
+
+/* Passing a NULL path means load pointers from the application */
+int X11_GL_LoadLibrary(_THIS, const char* path)
+{
+ void* handle = NULL;
+
+ if ( gl_active ) {
+ SDL_SetError("OpenGL context already created");
+ return -1;
+ }
+
+ if ( path == NULL ) {
+ path = SDL_getenv("SDL_VIDEO_GL_DRIVER");
+ if ( path == NULL ) {
+ path = DEFAULT_OPENGL;
+ }
+ }
+
+ handle = GL_LoadObject(path);
+ if ( handle == NULL ) {
+#if defined(OPENGL_REQUIRS_DLOPEN) && defined(SDL_LOADSO_DLOPEN)
+ SDL_SetError("Failed loading %s", path);
+#else
+ /* SDL_LoadObject() will call SDL_SetError() for us. */
+#endif
+ return -1;
+ }
+
+ /* Unload the old driver and reset the pointers */
+ X11_GL_UnloadLibrary(this);
+
+ /* Save the handle for X11_GL_GetProcAddress() */
+ this->gl_config.dll_handle = handle;
+
+ /* Load new function pointers */
+ this->gl_data->glXGetProcAddress =
+ (void *(*)(const GLubyte *)) GL_LoadFunction(handle, "glXGetProcAddressARB");
+ this->gl_data->glXChooseVisual =
+ (XVisualInfo *(*)(Display *, int, int *)) X11_GL_GetProcAddress(this, "glXChooseVisual");
+ this->gl_data->glXCreateContext =
+ (GLXContext (*)(Display *, XVisualInfo *, GLXContext, int)) X11_GL_GetProcAddress(this, "glXCreateContext");
+ this->gl_data->glXDestroyContext =
+ (void (*)(Display *, GLXContext)) X11_GL_GetProcAddress(this, "glXDestroyContext");
+ this->gl_data->glXMakeCurrent =
+ (int (*)(Display *, GLXDrawable, GLXContext)) X11_GL_GetProcAddress(this, "glXMakeCurrent");
+ this->gl_data->glXSwapBuffers =
+ (void (*)(Display *, GLXDrawable)) X11_GL_GetProcAddress(this, "glXSwapBuffers");
+ this->gl_data->glXGetConfig =
+ (int (*)(Display *, XVisualInfo *, int, int *)) X11_GL_GetProcAddress(this, "glXGetConfig");
+ this->gl_data->glXQueryExtensionsString =
+ (const char *(*)(Display *, int)) X11_GL_GetProcAddress(this, "glXQueryExtensionsString");
+ this->gl_data->glXSwapIntervalSGI =
+ (int (*)(int)) X11_GL_GetProcAddress(this, "glXSwapIntervalSGI");
+ this->gl_data->glXSwapIntervalMESA =
+ (GLint (*)(unsigned)) X11_GL_GetProcAddress(this, "glXSwapIntervalMESA");
+ this->gl_data->glXSwapIntervalEXT =
+ (int (*)(Display*,GLXDrawable,int)) X11_GL_GetProcAddress(this, "glXSwapIntervalEXT");
+
+ if ( (this->gl_data->glXChooseVisual == NULL) ||
+ (this->gl_data->glXCreateContext == NULL) ||
+ (this->gl_data->glXDestroyContext == NULL) ||
+ (this->gl_data->glXMakeCurrent == NULL) ||
+ (this->gl_data->glXSwapBuffers == NULL) ||
+ (this->gl_data->glXGetConfig == NULL) ||
+ (this->gl_data->glXQueryExtensionsString == NULL)) {
+ GL_UnloadObject(this->gl_config.dll_handle);
+ this->gl_config.dll_handle = NULL;
+ SDL_SetError("Could not retrieve OpenGL functions");
+ return -1;
+ }
+
+ this->gl_config.driver_loaded = 1;
+ if ( path ) {
+ SDL_strlcpy(this->gl_config.driver_path, path,
+ SDL_arraysize(this->gl_config.driver_path));
+ } else {
+ *this->gl_config.driver_path = '\0';
+ }
+ return 0;
+}
+
+void *X11_GL_GetProcAddress(_THIS, const char* proc)
+{
+ if ( this->gl_data->glXGetProcAddress ) {
+ return this->gl_data->glXGetProcAddress((const GLubyte *)proc);
+ }
+ return GL_LoadFunction(this->gl_config.dll_handle, proc);
+}
+
+#endif /* SDL_VIDEO_OPENGL_GLX */
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11gl_c.h b/distrib/sdl-1.2.15/src/video/x11/SDL_x11gl_c.h
new file mode 100644
index 0000000..b4822cb
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11gl_c.h
@@ -0,0 +1,99 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#if SDL_VIDEO_OPENGL_GLX
+#include <GL/glx.h>
+#include "SDL_loadso.h"
+#endif
+
+#include "../SDL_sysvideo.h"
+
+struct SDL_PrivateGLData {
+ int gl_active; /* to stop switching drivers while we have a valid context */
+
+#if SDL_VIDEO_OPENGL_GLX
+ GLXContext glx_context; /* Current GL context */
+ XVisualInfo* glx_visualinfo; /* XVisualInfo* returned by glXChooseVisual */
+
+ void * (*glXGetProcAddress)(const GLubyte *procName);
+
+ XVisualInfo* (*glXChooseVisual)
+ ( Display* dpy,
+ int screen,
+ int* attribList );
+
+ GLXContext (*glXCreateContext)
+ ( Display* dpy,
+ XVisualInfo* vis,
+ GLXContext shareList,
+ Bool direct );
+
+ void (*glXDestroyContext)
+ ( Display* dpy,
+ GLXContext ctx );
+
+ Bool (*glXMakeCurrent)
+ ( Display* dpy,
+ GLXDrawable drawable,
+ GLXContext ctx );
+
+ void (*glXSwapBuffers)
+ ( Display* dpy,
+ GLXDrawable drawable );
+
+ int (*glXGetConfig)
+ ( Display* dpy,
+ XVisualInfo* visual_info,
+ int attrib,
+ int* value );
+
+ const char *(*glXQueryExtensionsString)
+ ( Display* dpy,
+ int screen );
+
+ int (*glXSwapIntervalSGI) ( int interval );
+ GLint (*glXSwapIntervalMESA) ( unsigned interval );
+ int (*glXSwapIntervalEXT)( Display *dpy, GLXDrawable drw, int interval);
+ int swap_interval;
+#endif /* SDL_VIDEO_OPENGL_GLX */
+};
+
+/* Old variable names */
+#define gl_active (this->gl_data->gl_active)
+#define glx_context (this->gl_data->glx_context)
+#define glx_visualinfo (this->gl_data->glx_visualinfo)
+
+/* OpenGL functions */
+extern XVisualInfo *X11_GL_GetVisual(_THIS);
+extern int X11_GL_CreateWindow(_THIS, int w, int h);
+extern int X11_GL_CreateContext(_THIS);
+extern void X11_GL_Shutdown(_THIS);
+#if SDL_VIDEO_OPENGL_GLX
+extern int X11_GL_MakeCurrent(_THIS);
+extern int X11_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
+extern void X11_GL_SwapBuffers(_THIS);
+extern int X11_GL_LoadLibrary(_THIS, const char* path);
+extern void *X11_GL_GetProcAddress(_THIS, const char* proc);
+#endif
+extern void X11_GL_UnloadLibrary(_THIS);
+
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11image.c b/distrib/sdl-1.2.15/src/video/x11/SDL_x11image.c
new file mode 100644
index 0000000..464bc37
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11image.c
@@ -0,0 +1,316 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <stdio.h>
+#include <unistd.h>
+
+#include "SDL_endian.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_x11image_c.h"
+
+#ifndef NO_SHARED_MEMORY
+
+/* Shared memory error handler routine */
+static int shm_error;
+static int (*X_handler)(Display *, XErrorEvent *) = NULL;
+static int shm_errhandler(Display *d, XErrorEvent *e)
+{
+ if ( e->error_code == BadAccess ) {
+ shm_error = True;
+ return(0);
+ } else
+ return(X_handler(d,e));
+}
+
+static void try_mitshm(_THIS, SDL_Surface *screen)
+{
+ /* Dynamic X11 may not have SHM entry points on this box. */
+ if ((use_mitshm) && (!SDL_X11_HAVE_SHM))
+ use_mitshm = 0;
+
+ if(!use_mitshm)
+ return;
+ shminfo.shmid = shmget(IPC_PRIVATE, screen->h*screen->pitch,
+ IPC_CREAT | 0777);
+ if ( shminfo.shmid >= 0 ) {
+ shminfo.shmaddr = (char *)shmat(shminfo.shmid, 0, 0);
+ shminfo.readOnly = False;
+ if ( shminfo.shmaddr != (char *)-1 ) {
+ shm_error = False;
+ X_handler = XSetErrorHandler(shm_errhandler);
+ XShmAttach(SDL_Display, &shminfo);
+ XSync(SDL_Display, True);
+ XSetErrorHandler(X_handler);
+ if ( shm_error )
+ shmdt(shminfo.shmaddr);
+ } else {
+ shm_error = True;
+ }
+ shmctl(shminfo.shmid, IPC_RMID, NULL);
+ } else {
+ shm_error = True;
+ }
+ if ( shm_error )
+ use_mitshm = 0;
+ if ( use_mitshm )
+ screen->pixels = shminfo.shmaddr;
+}
+#endif /* ! NO_SHARED_MEMORY */
+
+/* Various screen update functions available */
+static void X11_NormalUpdate(_THIS, int numrects, SDL_Rect *rects);
+static void X11_MITSHMUpdate(_THIS, int numrects, SDL_Rect *rects);
+
+int X11_SetupImage(_THIS, SDL_Surface *screen)
+{
+#ifndef NO_SHARED_MEMORY
+ try_mitshm(this, screen);
+ if(use_mitshm) {
+ SDL_Ximage = XShmCreateImage(SDL_Display, SDL_Visual,
+ this->hidden->depth, ZPixmap,
+ shminfo.shmaddr, &shminfo,
+ screen->w, screen->h);
+ if(!SDL_Ximage) {
+ XShmDetach(SDL_Display, &shminfo);
+ XSync(SDL_Display, False);
+ shmdt(shminfo.shmaddr);
+ screen->pixels = NULL;
+ goto error;
+ }
+ this->UpdateRects = X11_MITSHMUpdate;
+ }
+ if(!use_mitshm)
+#endif /* not NO_SHARED_MEMORY */
+ {
+ screen->pixels = SDL_malloc(screen->h*screen->pitch);
+ if ( screen->pixels == NULL ) {
+ SDL_OutOfMemory();
+ return -1;
+ }
+ SDL_Ximage = XCreateImage(SDL_Display, SDL_Visual,
+ this->hidden->depth, ZPixmap, 0,
+ (char *)screen->pixels,
+ screen->w, screen->h,
+ 32, 0);
+ if ( SDL_Ximage == NULL )
+ goto error;
+ /* XPutImage will convert byte sex automatically */
+ SDL_Ximage->byte_order = (SDL_BYTEORDER == SDL_BIG_ENDIAN)
+ ? MSBFirst : LSBFirst;
+ this->UpdateRects = X11_NormalUpdate;
+ }
+ screen->pitch = SDL_Ximage->bytes_per_line;
+ return(0);
+
+error:
+ SDL_SetError("Couldn't create XImage");
+ return 1;
+}
+
+void X11_DestroyImage(_THIS, SDL_Surface *screen)
+{
+ if ( SDL_Ximage ) {
+ XDestroyImage(SDL_Ximage);
+#ifndef NO_SHARED_MEMORY
+ if ( use_mitshm ) {
+ XShmDetach(SDL_Display, &shminfo);
+ XSync(SDL_Display, False);
+ shmdt(shminfo.shmaddr);
+ }
+#endif /* ! NO_SHARED_MEMORY */
+ SDL_Ximage = NULL;
+ }
+ if ( screen ) {
+ screen->pixels = NULL;
+ }
+}
+
+/* Determine the number of CPUs in the system */
+static int num_CPU(void)
+{
+ static int num_cpus = 0;
+
+ if(!num_cpus) {
+#if defined(__LINUX__)
+ char line[BUFSIZ];
+ FILE *pstat = fopen("/proc/stat", "r");
+ if ( pstat ) {
+ while ( fgets(line, sizeof(line), pstat) ) {
+ if (SDL_memcmp(line, "cpu", 3) == 0 && line[3] != ' ') {
+ ++num_cpus;
+ }
+ }
+ fclose(pstat);
+ }
+#elif defined(__IRIX__)
+ num_cpus = sysconf(_SC_NPROC_ONLN);
+#elif defined(_SC_NPROCESSORS_ONLN)
+ /* number of processors online (SVR4.0MP compliant machines) */
+ num_cpus = sysconf(_SC_NPROCESSORS_ONLN);
+#elif defined(_SC_NPROCESSORS_CONF)
+ /* number of processors configured (SVR4.0MP compliant machines) */
+ num_cpus = sysconf(_SC_NPROCESSORS_CONF);
+#endif
+ if ( num_cpus <= 0 ) {
+ num_cpus = 1;
+ }
+ }
+ return num_cpus;
+}
+
+int X11_ResizeImage(_THIS, SDL_Surface *screen, Uint32 flags)
+{
+ int retval;
+
+ X11_DestroyImage(this, screen);
+ if ( flags & SDL_OPENGL ) { /* No image when using GL */
+ retval = 0;
+ } else {
+ retval = X11_SetupImage(this, screen);
+ /* We support asynchronous blitting on the display */
+ if ( flags & SDL_ASYNCBLIT ) {
+ /* This is actually slower on single-CPU systems,
+ probably because of CPU contention between the
+ X server and the application.
+ Note: Is this still true with XFree86 4.0?
+ */
+ if ( num_CPU() > 1 ) {
+ screen->flags |= SDL_ASYNCBLIT;
+ }
+ }
+ }
+ return(retval);
+}
+
+/* We don't actually allow hardware surfaces other than the main one */
+int X11_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(-1);
+}
+void X11_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+int X11_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ if ( (surface == SDL_VideoSurface) && blit_queued ) {
+ XSync(GFX_Display, False);
+ blit_queued = 0;
+ }
+ return(0);
+}
+void X11_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+int X11_FlipHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(0);
+}
+
+static void X11_NormalUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+ int i;
+
+ for (i = 0; i < numrects; ++i) {
+ if ( rects[i].w == 0 || rects[i].h == 0 ) { /* Clipped? */
+ continue;
+ }
+ XPutImage(GFX_Display, SDL_Window, SDL_GC, SDL_Ximage,
+ rects[i].x, rects[i].y,
+ rects[i].x, rects[i].y, rects[i].w, rects[i].h);
+ }
+ if ( SDL_VideoSurface->flags & SDL_ASYNCBLIT ) {
+ XFlush(GFX_Display);
+ blit_queued = 1;
+ } else {
+ XSync(GFX_Display, False);
+ }
+}
+
+static void X11_MITSHMUpdate(_THIS, int numrects, SDL_Rect *rects)
+{
+#ifndef NO_SHARED_MEMORY
+ int i;
+
+ for ( i=0; i<numrects; ++i ) {
+ if ( rects[i].w == 0 || rects[i].h == 0 ) { /* Clipped? */
+ continue;
+ }
+ XShmPutImage(GFX_Display, SDL_Window, SDL_GC, SDL_Ximage,
+ rects[i].x, rects[i].y,
+ rects[i].x, rects[i].y, rects[i].w, rects[i].h,
+ False);
+ }
+ if ( SDL_VideoSurface->flags & SDL_ASYNCBLIT ) {
+ XFlush(GFX_Display);
+ blit_queued = 1;
+ } else {
+ XSync(GFX_Display, False);
+ }
+#endif /* ! NO_SHARED_MEMORY */
+}
+
+/* There's a problem with the automatic refreshing of the display.
+ Even though the XVideo code uses the GFX_Display to update the
+ video memory, it appears that updating the window asynchronously
+ from a different thread will cause "blackouts" of the window.
+ This is a sort of a hacked workaround for the problem.
+*/
+static int enable_autorefresh = 1;
+
+void X11_DisableAutoRefresh(_THIS)
+{
+ --enable_autorefresh;
+}
+
+void X11_EnableAutoRefresh(_THIS)
+{
+ ++enable_autorefresh;
+}
+
+void X11_RefreshDisplay(_THIS)
+{
+ /* Don't refresh a display that doesn't have an image (like GL)
+ Instead, post an expose event so the application can refresh.
+ */
+ if ( ! SDL_Ximage || (enable_autorefresh <= 0) ) {
+ SDL_PrivateExpose();
+ return;
+ }
+#ifndef NO_SHARED_MEMORY
+ if ( this->UpdateRects == X11_MITSHMUpdate ) {
+ XShmPutImage(SDL_Display, SDL_Window, SDL_GC, SDL_Ximage,
+ 0, 0, 0, 0, this->screen->w, this->screen->h,
+ False);
+ } else
+#endif /* ! NO_SHARED_MEMORY */
+ {
+ XPutImage(SDL_Display, SDL_Window, SDL_GC, SDL_Ximage,
+ 0, 0, 0, 0, this->screen->w, this->screen->h);
+ }
+ XSync(SDL_Display, False);
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11image_c.h b/distrib/sdl-1.2.15/src/video/x11/SDL_x11image_c.h
new file mode 100644
index 0000000..2de1571
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11image_c.h
@@ -0,0 +1,38 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_x11video.h"
+
+extern int X11_SetupImage(_THIS, SDL_Surface *screen);
+extern void X11_DestroyImage(_THIS, SDL_Surface *screen);
+extern int X11_ResizeImage(_THIS, SDL_Surface *screen, Uint32 flags);
+
+extern int X11_AllocHWSurface(_THIS, SDL_Surface *surface);
+extern void X11_FreeHWSurface(_THIS, SDL_Surface *surface);
+extern int X11_LockHWSurface(_THIS, SDL_Surface *surface);
+extern void X11_UnlockHWSurface(_THIS, SDL_Surface *surface);
+extern int X11_FlipHWSurface(_THIS, SDL_Surface *surface);
+
+extern void X11_DisableAutoRefresh(_THIS);
+extern void X11_EnableAutoRefresh(_THIS);
+extern void X11_RefreshDisplay(_THIS);
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11modes.c b/distrib/sdl-1.2.15/src/video/x11/SDL_x11modes.c
new file mode 100644
index 0000000..c232e6a
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11modes.c
@@ -0,0 +1,1143 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Utilities for getting and setting the X display mode */
+
+#include <stdio.h>
+
+#include "SDL_timer.h"
+#include "SDL_events.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_x11video.h"
+#include "SDL_x11wm_c.h"
+#include "SDL_x11modes_c.h"
+#include "SDL_x11image_c.h"
+
+/*#define X11MODES_DEBUG*/
+
+#define MAX(a, b) (a > b ? a : b)
+
+#if SDL_VIDEO_DRIVER_X11_XRANDR
+static int cmpmodelist(const void *va, const void *vb)
+{
+ const SDL_Rect *a = *(const SDL_Rect **)va;
+ const SDL_Rect *b = *(const SDL_Rect **)vb;
+ if ( a->w == b->w )
+ return b->h - a->h;
+ else
+ return b->w - a->w;
+}
+#endif
+
+#if SDL_VIDEO_DRIVER_X11_VIDMODE
+Bool SDL_NAME(XF86VidModeGetModeInfo)(Display *dpy, int scr, SDL_NAME(XF86VidModeModeInfo) *info)
+{
+ Bool retval;
+ int dotclock;
+ SDL_NAME(XF86VidModeModeLine) l;
+ SDL_memset(&l, 0, sizeof(l));
+ retval = SDL_NAME(XF86VidModeGetModeLine)(dpy, scr, &dotclock, &l);
+ info->dotclock = dotclock;
+ info->hdisplay = l.hdisplay;
+ info->hsyncstart = l.hsyncstart;
+ info->hsyncend = l.hsyncend;
+ info->htotal = l.htotal;
+ info->hskew = l.hskew;
+ info->vdisplay = l.vdisplay;
+ info->vsyncstart = l.vsyncstart;
+ info->vsyncend = l.vsyncend;
+ info->vtotal = l.vtotal;
+ info->flags = l.flags;
+ info->privsize = l.privsize;
+ info->private = l.private;
+ return retval;
+}
+#endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */
+
+#if SDL_VIDEO_DRIVER_X11_VIDMODE
+static void save_mode(_THIS)
+{
+ SDL_memset(&saved_mode, 0, sizeof(saved_mode));
+ SDL_NAME(XF86VidModeGetModeInfo)(SDL_Display,SDL_Screen,&saved_mode);
+ SDL_NAME(XF86VidModeGetViewPort)(SDL_Display,SDL_Screen,&saved_view.x,&saved_view.y);
+}
+#endif
+
+#if SDL_VIDEO_DRIVER_X11_VIDMODE
+static void restore_mode(_THIS)
+{
+ SDL_NAME(XF86VidModeModeLine) mode;
+ int unused;
+
+ if ( SDL_NAME(XF86VidModeGetModeLine)(SDL_Display, SDL_Screen, &unused, &mode) ) {
+ if ( (saved_mode.hdisplay != mode.hdisplay) ||
+ (saved_mode.vdisplay != mode.vdisplay) ) {
+ SDL_NAME(XF86VidModeSwitchToMode)(SDL_Display, SDL_Screen, &saved_mode);
+ }
+ }
+ if ( (saved_view.x != 0) || (saved_view.y != 0) ) {
+ SDL_NAME(XF86VidModeSetViewPort)(SDL_Display, SDL_Screen, saved_view.x, saved_view.y);
+ }
+}
+#endif
+
+#if SDL_VIDEO_DRIVER_X11_VIDMODE
+static int cmpmodes(const void *va, const void *vb)
+{
+ const SDL_NAME(XF86VidModeModeInfo) *a = *(const SDL_NAME(XF86VidModeModeInfo)**)va;
+ const SDL_NAME(XF86VidModeModeInfo) *b = *(const SDL_NAME(XF86VidModeModeInfo)**)vb;
+ if ( a->hdisplay == b->hdisplay )
+ return b->vdisplay - a->vdisplay;
+ else
+ return b->hdisplay - a->hdisplay;
+}
+#endif
+
+static void get_real_resolution(_THIS, int* w, int* h);
+
+static void set_best_resolution(_THIS, int width, int height)
+{
+#if SDL_VIDEO_DRIVER_X11_VIDMODE
+ if ( use_vidmode ) {
+ SDL_NAME(XF86VidModeModeLine) mode;
+ SDL_NAME(XF86VidModeModeInfo) **modes;
+ int i;
+ int nmodes;
+ int best = -1;
+
+ if ( SDL_NAME(XF86VidModeGetModeLine)(SDL_Display, SDL_Screen, &i, &mode) &&
+ SDL_NAME(XF86VidModeGetAllModeLines)(SDL_Display,SDL_Screen,&nmodes,&modes) ) {
+ for ( i = 0; i < nmodes ; i++ ) {
+ if ( (modes[i]->hdisplay == width) &&
+ (modes[i]->vdisplay == height) ) {
+ best = i;
+ break;
+ }
+ if ( modes[i]->hdisplay >= width &&
+ modes[i]->vdisplay >= height ) {
+ if ( best < 0 ||
+ (modes[i]->hdisplay < modes[best]->hdisplay &&
+ modes[i]->vdisplay <= modes[best]->vdisplay) ||
+ (modes[i]->vdisplay < modes[best]->vdisplay &&
+ modes[i]->hdisplay <= modes[best]->hdisplay) ) {
+ best = i;
+ }
+ }
+ }
+ if ( best >= 0 &&
+ ((modes[best]->hdisplay != mode.hdisplay) ||
+ (modes[best]->vdisplay != mode.vdisplay)) ) {
+#ifdef X11MODES_DEBUG
+ printf("Best Mode %d: %d x %d @ %d\n", best,
+ modes[best]->hdisplay, modes[best]->vdisplay,
+ (modes[best]->htotal && modes[best]->vtotal) ? (1000 * modes[best]->dotclock / (modes[best]->htotal * modes[best]->vtotal)) : 0 );
+#endif
+ SDL_NAME(XF86VidModeSwitchToMode)(SDL_Display, SDL_Screen, modes[best]);
+ }
+ XFree(modes);
+ }
+ }
+#endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */
+
+ /* XiG */
+#if SDL_VIDEO_DRIVER_X11_XME
+ if ( use_xme && SDL_modelist ) {
+ int i;
+
+#ifdef X11MODES_DEBUG
+ fprintf(stderr, "XME: set_best_resolution(): w = %d, h = %d\n",
+ width, height);
+#endif
+ for ( i=0; SDL_modelist[i]; ++i ) {
+ if ( (SDL_modelist[i]->w >= width) &&
+ (SDL_modelist[i]->h >= height) ) {
+ break;
+ }
+ }
+
+ if ( SDL_modelist[i] ) { /* found one, lets try it */
+ int w, h;
+
+ /* check current mode so we can avoid uneccessary mode changes */
+ get_real_resolution(this, &w, &h);
+
+ if ( (SDL_modelist[i]->w != w) || (SDL_modelist[i]->h != h) ) {
+#ifdef X11MODES_DEBUG
+ fprintf(stderr, "XME: set_best_resolution: "
+ "XiGMiscChangeResolution: %d %d\n",
+ SDL_modelist[i]->w, SDL_modelist[i]->h);
+#endif
+ XiGMiscChangeResolution(SDL_Display,
+ SDL_Screen,
+ 0, /* view */
+ SDL_modelist[i]->w,
+ SDL_modelist[i]->h,
+ 0);
+ XSync(SDL_Display, False);
+ }
+ }
+ }
+#endif /* SDL_VIDEO_DRIVER_X11_XME */
+
+#if SDL_VIDEO_DRIVER_X11_XRANDR
+ if ( use_xrandr && SDL_modelist ) {
+#ifdef X11MODES_DEBUG
+ fprintf(stderr, "XRANDR: set_best_resolution(): w = %d, h = %d\n",
+ width, height);
+#endif
+ int i, nsizes;
+ XRRScreenSize *sizes;
+
+ /* find the smallest resolution that is at least as big as the user requested */
+ sizes = XRRConfigSizes(screen_config, &nsizes);
+ for ( i = (nsizes-1); i >= 0; i-- ) {
+ if ( (SDL_modelist[i]->w >= width) &&
+ (SDL_modelist[i]->h >= height) ) {
+ break;
+ }
+ }
+
+ if ( i >= 0 && SDL_modelist[i] ) { /* found one, lets try it */
+ int w, h;
+
+ /* check current mode so we can avoid uneccessary mode changes */
+ get_real_resolution(this, &w, &h);
+
+ if ( (SDL_modelist[i]->w != w) || (SDL_modelist[i]->h != h) ) {
+ int size_id;
+
+#ifdef X11MODES_DEBUG
+ fprintf(stderr, "XRANDR: set_best_resolution: "
+ "XXRSetScreenConfig: %d %d\n",
+ SDL_modelist[i]->w, SDL_modelist[i]->h);
+#endif
+
+ /* find the matching size entry index */
+ for ( size_id = 0; size_id < nsizes; ++size_id ) {
+ if ( (sizes[size_id].width == SDL_modelist[i]->w) &&
+ (sizes[size_id].height == SDL_modelist[i]->h) )
+ break;
+ }
+
+ XRRSetScreenConfig(SDL_Display, screen_config, SDL_Root,
+ size_id, saved_rotation, CurrentTime);
+ }
+ }
+ }
+#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */
+}
+
+static void get_real_resolution(_THIS, int* w, int* h)
+{
+#if SDL_VIDEO_DRIVER_X11_XME
+ if ( use_xme ) {
+ int ractive;
+ XiGMiscResolutionInfo *modelist;
+
+ XiGMiscQueryResolutions(SDL_Display, SDL_Screen,
+ 0, /* view */
+ &ractive, &modelist);
+ *w = modelist[ractive].width;
+ *h = modelist[ractive].height;
+#ifdef X11MODES_DEBUG
+ fprintf(stderr, "XME: get_real_resolution: w = %d h = %d\n", *w, *h);
+#endif
+ XFree(modelist);
+ return;
+ }
+#endif /* SDL_VIDEO_DRIVER_X11_XME */
+
+#if SDL_VIDEO_DRIVER_X11_VIDMODE
+ if ( use_vidmode ) {
+ SDL_NAME(XF86VidModeModeLine) mode;
+ int unused;
+
+ if ( SDL_NAME(XF86VidModeGetModeLine)(SDL_Display, SDL_Screen, &unused, &mode) ) {
+ *w = mode.hdisplay;
+ *h = mode.vdisplay;
+ return;
+ }
+ }
+#endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */
+
+#if SDL_VIDEO_DRIVER_X11_XRANDR
+ if ( use_xrandr ) {
+ int nsizes;
+ XRRScreenSize* sizes;
+
+ sizes = XRRConfigSizes(screen_config, &nsizes);
+ if ( nsizes > 0 ) {
+ int cur_size;
+ Rotation cur_rotation;
+
+ cur_size = XRRConfigCurrentConfiguration(screen_config, &cur_rotation);
+ if ( cur_size >= 0 && cur_size < nsizes ) {
+ *w = sizes[cur_size].width;
+ *h = sizes[cur_size].height;
+ }
+#ifdef X11MODES_DEBUG
+ fprintf(stderr, "XRANDR: get_real_resolution: w = %d h = %d\n", *w, *h);
+#endif
+ return;
+ }
+ }
+#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */
+
+#if SDL_VIDEO_DRIVER_X11_XINERAMA
+ if ( use_xinerama ) {
+ *w = xinerama_info.width;
+ *h = xinerama_info.height;
+ return;
+ }
+#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */
+
+ *w = DisplayWidth(SDL_Display, SDL_Screen);
+ *h = DisplayHeight(SDL_Display, SDL_Screen);
+}
+
+/* Called after mapping a window - waits until the window is mapped */
+void X11_WaitMapped(_THIS, Window win)
+{
+ XEvent event;
+ do {
+ XMaskEvent(SDL_Display, StructureNotifyMask, &event);
+ } while ( (event.type != MapNotify) || (event.xmap.event != win) );
+}
+
+/* Called after unmapping a window - waits until the window is unmapped */
+void X11_WaitUnmapped(_THIS, Window win)
+{
+ XEvent event;
+ do {
+ XMaskEvent(SDL_Display, StructureNotifyMask, &event);
+ } while ( (event.type != UnmapNotify) || (event.xunmap.event != win) );
+}
+
+static void move_cursor_to(_THIS, int x, int y)
+{
+ XWarpPointer(SDL_Display, None, SDL_Root, 0, 0, 0, 0, x, y);
+}
+
+static int add_default_visual(_THIS)
+{
+ int i;
+ int n = this->hidden->nvisuals;
+ for (i=0; i<n; i++) {
+ if (this->hidden->visuals[i].visual == DefaultVisual(SDL_Display, SDL_Screen)) return n;
+ }
+ this->hidden->visuals[n].depth = DefaultDepth(SDL_Display, SDL_Screen);;
+ this->hidden->visuals[n].visual = DefaultVisual(SDL_Display, SDL_Screen);;
+ this->hidden->nvisuals++;
+ return(this->hidden->nvisuals);
+}
+static int add_visual(_THIS, int depth, int class)
+{
+ XVisualInfo vi;
+ if(XMatchVisualInfo(SDL_Display, SDL_Screen, depth, class, &vi)) {
+ int n = this->hidden->nvisuals;
+ this->hidden->visuals[n].depth = vi.depth;
+ this->hidden->visuals[n].visual = vi.visual;
+ this->hidden->nvisuals++;
+ }
+ return(this->hidden->nvisuals);
+}
+static int add_visual_byid(_THIS, const char *visual_id)
+{
+ XVisualInfo *vi, template;
+ int nvis;
+
+ if ( visual_id ) {
+ SDL_memset(&template, 0, (sizeof template));
+ template.visualid = SDL_strtol(visual_id, NULL, 0);
+ vi = XGetVisualInfo(SDL_Display, VisualIDMask, &template, &nvis);
+ if ( vi ) {
+ int n = this->hidden->nvisuals;
+ this->hidden->visuals[n].depth = vi->depth;
+ this->hidden->visuals[n].visual = vi->visual;
+ this->hidden->nvisuals++;
+ XFree(vi);
+ }
+ }
+ return(this->hidden->nvisuals);
+}
+
+/* Global for the error handler */
+int vm_event, vm_error = -1;
+
+#if SDL_VIDEO_DRIVER_X11_XINERAMA
+static int CheckXinerama(_THIS, int *major, int *minor)
+{
+ const char *env;
+
+ /* Default the extension not available */
+ *major = *minor = 0;
+
+ /* Allow environment override */
+ env = getenv("SDL_VIDEO_X11_XINERAMA");
+ if ( env && !SDL_atoi(env) ) {
+ return 0;
+ }
+
+ /* Query the extension version */
+ if ( !SDL_NAME(XineramaQueryExtension)(SDL_Display, major, minor) ||
+ !SDL_NAME(XineramaIsActive)(SDL_Display) ) {
+ return 0;
+ }
+ return 1;
+}
+#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */
+
+#if SDL_VIDEO_DRIVER_X11_XRANDR
+static int CheckXRandR(_THIS, int *major, int *minor)
+{
+ const char *env;
+
+ /* Default the extension not available */
+ *major = *minor = 0;
+
+ /* Allow environment override */
+ env = getenv("SDL_VIDEO_X11_XRANDR");
+ if ( env && !SDL_atoi(env) ) {
+ return 0;
+ }
+
+ /* This defaults off now, due to KDE window maximize problems */
+ if ( !env ) {
+ return 0;
+ }
+
+ if ( !SDL_X11_HAVE_XRANDR ) {
+ return 0;
+ }
+
+ /* Query the extension version */
+ if ( !XRRQueryVersion(SDL_Display, major, minor) ) {
+ return 0;
+ }
+ return 1;
+}
+#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */
+
+#if SDL_VIDEO_DRIVER_X11_VIDMODE
+static int CheckVidMode(_THIS, int *major, int *minor)
+{
+ const char *env;
+
+ /* Default the extension not available */
+ *major = *minor = 0;
+
+ /* Allow environment override */
+ env = getenv("SDL_VIDEO_X11_VIDMODE");
+ if ( env && !SDL_atoi(env) ) {
+ return 0;
+ }
+
+ /* Metro-X 4.3.0 and earlier has a broken implementation of
+ XF86VidModeGetAllModeLines() - it hangs the client.
+ */
+ if ( SDL_strcmp(ServerVendor(SDL_Display), "Metro Link Incorporated") == 0 ) {
+ FILE *metro_fp;
+
+ metro_fp = fopen("/usr/X11R6/lib/X11/Metro/.version", "r");
+ if ( metro_fp != NULL ) {
+ int major, minor, patch, version, scannum;
+ major = 0; minor = 0; patch = 0;
+ scannum = fscanf(metro_fp, "%d.%d.%d", &major, &minor, &patch);
+ fclose(metro_fp);
+ if ( (scannum < 0) || (scannum > 3) ) {
+ return 0; /* we need _something_ useful from fscanf(). */
+ }
+ version = major*100+minor*10+patch;
+ if ( version < 431 ) {
+ return 0;
+ }
+ }
+ }
+
+ /* Query the extension version */
+ vm_error = -1;
+ if ( !SDL_NAME(XF86VidModeQueryExtension)(SDL_Display, &vm_event, &vm_error) ||
+ !SDL_NAME(XF86VidModeQueryVersion)(SDL_Display, major, minor) ) {
+ return 0;
+ }
+ return 1;
+}
+#endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */
+
+#if SDL_VIDEO_DRIVER_X11_XME
+static int CheckXME(_THIS, int *major, int *minor)
+{
+ const char *env;
+
+ /* Default the extension not available */
+ *major = *minor = 0;
+
+ /* Allow environment override */
+ env = getenv("SDL_VIDEO_X11_VIDMODE");
+ if ( env && !SDL_atoi(env) ) {
+ return 0;
+ }
+
+ /* Query the extension version */
+ if ( !XiGMiscQueryVersion(SDL_Display, major, minor) ) {
+ return 0;
+ }
+ return 1;
+}
+#endif /* SDL_VIDEO_DRIVER_X11_XME */
+
+int X11_GetVideoModes(_THIS)
+{
+#if SDL_VIDEO_DRIVER_X11_XINERAMA
+ int xinerama_major, xinerama_minor;
+#endif
+#if SDL_VIDEO_DRIVER_X11_XRANDR
+ int xrandr_major, xrandr_minor;
+ int nsizes;
+ XRRScreenSize *sizes;
+#endif
+#if SDL_VIDEO_DRIVER_X11_VIDMODE
+ int vm_major, vm_minor;
+ int nmodes;
+ SDL_NAME(XF86VidModeModeInfo) **modes;
+#endif
+#if SDL_VIDEO_DRIVER_X11_XME
+ int xme_major, xme_minor;
+ int ractive, nummodes;
+ XiGMiscResolutionInfo *modelist;
+#endif
+ int i, n;
+ int screen_w;
+ int screen_h;
+
+ use_xinerama = 0;
+ use_xrandr = 0;
+ use_vidmode = 0;
+ use_xme = 0;
+ screen_w = DisplayWidth(SDL_Display, SDL_Screen);
+ screen_h = DisplayHeight(SDL_Display, SDL_Screen);
+
+#if SDL_VIDEO_DRIVER_X11_XINERAMA
+ /* Query Xinerama extention */
+ if ( CheckXinerama(this, &xinerama_major, &xinerama_minor) ) {
+ /* Find out which screen is the desired one */
+ int desired = -1;
+ int screens;
+ int w, h;
+ SDL_NAME(XineramaScreenInfo) *xinerama;
+
+ const char *variable = SDL_getenv("SDL_VIDEO_FULLSCREEN_DISPLAY");
+ if ( !variable ) {
+ variable = SDL_getenv("SDL_VIDEO_FULLSCREEN_HEAD");
+ }
+ if ( variable ) {
+ desired = SDL_atoi(variable);
+ }
+#ifdef X11MODES_DEBUG
+ printf("X11 detected Xinerama:\n");
+#endif
+ xinerama = SDL_NAME(XineramaQueryScreens)(SDL_Display, &screens);
+ for ( i = 0; i < screens; i++ ) {
+#ifdef X11MODES_DEBUG
+ printf("xinerama %d: %dx%d+%d+%d\n",
+ xinerama[i].screen_number,
+ xinerama[i].width, xinerama[i].height,
+ xinerama[i].x_org, xinerama[i].y_org);
+#endif
+ if ( xinerama[i].screen_number == desired ) {
+ use_xinerama = 1;
+ xinerama_info = xinerama[i];
+ }
+ }
+ XFree(xinerama);
+
+ if ( use_xinerama ) {
+ SDL_modelist = (SDL_Rect **)SDL_malloc(3*sizeof(SDL_Rect *));
+ if ( !SDL_modelist ) {
+ SDL_OutOfMemory();
+ return -1;
+ }
+
+ /* Add the full xinerama mode */
+ n = 0;
+ w = xinerama_info.width;
+ h = xinerama_info.height;
+ if ( screen_w > w || screen_h > h) {
+ SDL_modelist[n] = (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
+ if ( SDL_modelist[n] ) {
+ SDL_modelist[n]->x = 0;
+ SDL_modelist[n]->y = 0;
+ SDL_modelist[n]->w = screen_w;
+ SDL_modelist[n]->h = screen_h;
+ ++n;
+ }
+ }
+
+ /* Add the head xinerama mode */
+ SDL_modelist[n] = (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
+ if ( SDL_modelist[n] ) {
+ SDL_modelist[n]->x = 0;
+ SDL_modelist[n]->y = 0;
+ SDL_modelist[n]->w = w;
+ SDL_modelist[n]->h = h;
+ ++n;
+ }
+ SDL_modelist[n] = NULL;
+ }
+ }
+#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */
+
+#if SDL_VIDEO_DRIVER_X11_XRANDR
+ /* XRandR */
+ /* require at least XRandR v1.0 (arbitrary) */
+ if ( CheckXRandR(this, &xrandr_major, &xrandr_minor) && (xrandr_major >= 1) )
+ {
+#ifdef X11MODES_DEBUG
+ fprintf(stderr, "XRANDR: XRRQueryVersion: V%d.%d\n",
+ xrandr_major, xrandr_minor);
+#endif
+
+ /* save the screen configuration since we must reference it
+ each time we toggle modes.
+ */
+ screen_config = XRRGetScreenInfo(SDL_Display, SDL_Root);
+
+ /* retrieve the list of resolution */
+ sizes = XRRConfigSizes(screen_config, &nsizes);
+ if (nsizes > 0) {
+ if ( SDL_modelist ) {
+ for ( i = 0; SDL_modelist[i]; ++i ) {
+ SDL_free(SDL_modelist[i]);
+ }
+ SDL_free(SDL_modelist);
+ }
+ SDL_modelist = (SDL_Rect **)malloc((nsizes+1)*sizeof(SDL_Rect *));
+ if ( !SDL_modelist ) {
+ SDL_OutOfMemory();
+ return -1;
+ }
+ for ( i=0; i < nsizes; i++ ) {
+ if ((SDL_modelist[i] =
+ (SDL_Rect *)malloc(sizeof(SDL_Rect))) == NULL)
+ break;
+#ifdef X11MODES_DEBUG
+ fprintf(stderr, "XRANDR: mode = %4d, w = %4d, h = %4d\n",
+ i, sizes[i].width, sizes[i].height);
+#endif
+
+ SDL_modelist[i]->x = 0;
+ SDL_modelist[i]->y = 0;
+ SDL_modelist[i]->w = sizes[i].width;
+ SDL_modelist[i]->h = sizes[i].height;
+
+ }
+ /* sort the mode list descending as SDL expects */
+ SDL_qsort(SDL_modelist, nsizes, sizeof *SDL_modelist, cmpmodelist);
+ SDL_modelist[i] = NULL; /* terminator */
+
+ use_xrandr = xrandr_major * 100 + xrandr_minor;
+ saved_size_id = XRRConfigCurrentConfiguration(screen_config, &saved_rotation);
+ }
+ }
+#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */
+
+#if SDL_VIDEO_DRIVER_X11_VIDMODE
+ /* XVidMode */
+ if ( !use_xrandr &&
+#if SDL_VIDEO_DRIVER_X11_XINERAMA
+ (!use_xinerama || xinerama_info.screen_number == -1) &&
+#endif
+ CheckVidMode(this, &vm_major, &vm_minor) &&
+ SDL_NAME(XF86VidModeGetAllModeLines)(SDL_Display, SDL_Screen,&nmodes,&modes) )
+ {
+#ifdef X11MODES_DEBUG
+ printf("VidMode modes: (unsorted)\n");
+ for ( i = 0; i < nmodes; ++i ) {
+ printf("Mode %d: %d x %d @ %d\n", i,
+ modes[i]->hdisplay, modes[i]->vdisplay,
+ (modes[i]->htotal && modes[i]->vtotal) ? (1000 * modes[i]->dotclock / (modes[i]->htotal * modes[i]->vtotal)) : 0 );
+ }
+#endif
+ if ( SDL_modelist ) {
+ for ( i = 0; SDL_modelist[i]; ++i ) {
+ SDL_free(SDL_modelist[i]);
+ }
+ SDL_free(SDL_modelist);
+ }
+ SDL_modelist = (SDL_Rect **)SDL_malloc((nmodes+2)*sizeof(SDL_Rect *));
+ if ( !SDL_modelist ) {
+ SDL_OutOfMemory();
+ return -1;
+ }
+ SDL_qsort(modes, nmodes, sizeof *modes, cmpmodes);
+ n = 0;
+ for ( i=0; i<nmodes; ++i ) {
+ int w, h;
+
+ /* Eliminate duplicate modes with different refresh rates */
+ if ( i > 0 &&
+ modes[i]->hdisplay == modes[i-1]->hdisplay &&
+ modes[i]->vdisplay == modes[i-1]->vdisplay ) {
+ continue;
+ }
+
+ /* Check to see if we should add the screen size (Xinerama) */
+ w = modes[i]->hdisplay;
+ h = modes[i]->vdisplay;
+ if ( (screen_w * screen_h) >= (w * h) ) {
+ if ( (screen_w != w) || (screen_h != h) ) {
+ SDL_modelist[n] = (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
+ if ( SDL_modelist[n] ) {
+ SDL_modelist[n]->x = 0;
+ SDL_modelist[n]->y = 0;
+ SDL_modelist[n]->w = screen_w;
+ SDL_modelist[n]->h = screen_h;
+ ++n;
+ }
+ }
+ screen_w = 0;
+ screen_h = 0;
+ }
+
+ /* Add the size from the video mode list */
+ SDL_modelist[n] = (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
+ if ( SDL_modelist[n] == NULL ) {
+ break;
+ }
+ SDL_modelist[n]->x = 0;
+ SDL_modelist[n]->y = 0;
+ SDL_modelist[n]->w = w;
+ SDL_modelist[n]->h = h;
+ ++n;
+ }
+ SDL_modelist[n] = NULL;
+ XFree(modes);
+
+ use_vidmode = vm_major * 100 + vm_minor;
+ save_mode(this);
+ }
+#endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */
+
+#if SDL_VIDEO_DRIVER_X11_XME
+ /* XiG */
+ modelist = NULL;
+ /* first lets make sure we have the extension, and it's at least v2.0 */
+ if ( CheckXME(this, &xme_major, &xme_minor) && xme_major >= 2 &&
+ (nummodes = XiGMiscQueryResolutions(SDL_Display, SDL_Screen,
+ 0, /* view */
+ &ractive, &modelist)) > 1 )
+ { /* then we actually have some */
+ int j;
+
+ /* We get the list already sorted in descending order.
+ We'll copy it in reverse order so SDL is happy */
+#ifdef X11MODES_DEBUG
+ fprintf(stderr, "XME: nummodes = %d, active mode = %d\n",
+ nummodes, ractive);
+#endif
+ if ( SDL_modelist ) {
+ for ( i = 0; SDL_modelist[i]; ++i ) {
+ SDL_free(SDL_modelist[i]);
+ }
+ SDL_free(SDL_modelist);
+ }
+ SDL_modelist = (SDL_Rect **)SDL_malloc((nummodes+1)*sizeof(SDL_Rect *));
+ if ( !SDL_modelist ) {
+ SDL_OutOfMemory();
+ return -1;
+ }
+ for ( i=0, j=nummodes-1; j>=0; i++, j-- ) {
+ if ((SDL_modelist[i] =
+ (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect))) == NULL)
+ break;
+#ifdef X11MODES_DEBUG
+ fprintf(stderr, "XME: mode = %4d, w = %4d, h = %4d\n",
+ i, modelist[i].width, modelist[i].height);
+#endif
+
+ SDL_modelist[i]->x = 0;
+ SDL_modelist[i]->y = 0;
+ SDL_modelist[i]->w = modelist[j].width;
+ SDL_modelist[i]->h = modelist[j].height;
+
+ }
+ SDL_modelist[i] = NULL; /* terminator */
+
+ use_xme = xme_major * 100 + xme_minor;
+ saved_res = modelist[ractive]; /* save the current resolution */
+ }
+ if ( modelist ) {
+ XFree(modelist);
+ }
+#endif /* SDL_VIDEO_DRIVER_X11_XME */
+
+ {
+ /* It's interesting to note that if we allow 32 bit depths,
+ we get a visual with an alpha mask on composite servers.
+ static int depth_list[] = { 32, 24, 16, 15, 8 };
+ */
+ static int depth_list[] = { 24, 16, 15, 8 };
+ int j, np;
+ int use_directcolor = 1;
+ XPixmapFormatValues *pf;
+
+ /* Search for the visuals in deepest-first order, so that the first
+ will be the richest one */
+ if ( SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ) {
+ use_directcolor = 0;
+ }
+ this->hidden->nvisuals = 0;
+ if ( ! add_visual_byid(this, SDL_getenv("SDL_VIDEO_X11_VISUALID")) ) {
+ for ( i=0; i<SDL_arraysize(depth_list); ++i ) {
+ if ( depth_list[i] > 8 ) {
+ if ( use_directcolor ) {
+ add_visual(this, depth_list[i], DirectColor);
+ }
+ add_visual(this, depth_list[i], TrueColor);
+ } else {
+ add_visual(this, depth_list[i], PseudoColor);
+ add_visual(this, depth_list[i], StaticColor);
+ }
+ }
+ add_default_visual(this);
+ }
+ if ( this->hidden->nvisuals == 0 ) {
+ SDL_SetError("Found no sufficiently capable X11 visuals");
+ return -1;
+ }
+
+ /* look up the pixel quantum for each depth */
+ pf = XListPixmapFormats(SDL_Display, &np);
+ for(i = 0; i < this->hidden->nvisuals; i++) {
+ int d = this->hidden->visuals[i].depth;
+ for(j = 0; j < np; j++)
+ if(pf[j].depth == d)
+ break;
+ this->hidden->visuals[i].bpp = j < np ? pf[j].bits_per_pixel : d;
+ }
+
+ XFree(pf);
+ }
+
+ if ( SDL_modelist == NULL ) {
+ SDL_modelist = (SDL_Rect **)SDL_malloc((1+1)*sizeof(SDL_Rect *));
+ if ( !SDL_modelist ) {
+ SDL_OutOfMemory();
+ return -1;
+ }
+ n = 0;
+ SDL_modelist[n] = (SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
+ if ( SDL_modelist[n] ) {
+ SDL_modelist[n]->x = 0;
+ SDL_modelist[n]->y = 0;
+ SDL_modelist[n]->w = screen_w;
+ SDL_modelist[n]->h = screen_h;
+ ++n;
+ }
+ SDL_modelist[n] = NULL;
+ }
+
+#ifdef X11MODES_DEBUG
+ if ( use_xinerama ) {
+ printf("Xinerama is enabled\n");
+ }
+
+ if ( use_xrandr ) {
+ printf("XRandR is enabled\n");
+ }
+
+ if ( use_vidmode ) {
+ printf("VidMode is enabled\n");
+ }
+
+ if ( use_xme ) {
+ printf("Xi Graphics XME fullscreen is enabled\n");
+ }
+
+ if ( SDL_modelist ) {
+ printf("X11 video mode list:\n");
+ for ( i=0; SDL_modelist[i]; ++i ) {
+ printf("\t%dx%d\n", SDL_modelist[i]->w, SDL_modelist[i]->h);
+ }
+ }
+#endif /* X11MODES_DEBUG */
+
+ return 0;
+}
+
+int X11_SupportedVisual(_THIS, SDL_PixelFormat *format)
+{
+ int i;
+ for(i = 0; i < this->hidden->nvisuals; i++)
+ if(this->hidden->visuals[i].bpp == format->BitsPerPixel)
+ return 1;
+ return 0;
+}
+
+SDL_Rect **X11_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ if ( X11_SupportedVisual(this, format) ) {
+ if ( flags & SDL_FULLSCREEN ) {
+ return(SDL_modelist);
+ } else {
+ return((SDL_Rect **)-1);
+ }
+ } else {
+ return((SDL_Rect **)0);
+ }
+}
+
+void X11_FreeVideoModes(_THIS)
+{
+ int i;
+
+ if ( SDL_modelist ) {
+ for ( i=0; SDL_modelist[i]; ++i ) {
+ SDL_free(SDL_modelist[i]);
+ }
+ SDL_free(SDL_modelist);
+ SDL_modelist = NULL;
+ }
+
+#if SDL_VIDEO_DRIVER_X11_XRANDR
+ /* Free the Xrandr screen configuration */
+ if ( screen_config ) {
+ XRRFreeScreenConfigInfo(screen_config);
+ screen_config = NULL;
+ }
+#endif /* SDL_VIDEO_DRIVER_X11_XRANDR */
+}
+
+int X11_ResizeFullScreen(_THIS)
+{
+ int x = 0, y = 0;
+ int real_w, real_h;
+ int screen_w;
+ int screen_h;
+
+ screen_w = DisplayWidth(SDL_Display, SDL_Screen);
+ screen_h = DisplayHeight(SDL_Display, SDL_Screen);
+
+#if SDL_VIDEO_DRIVER_X11_XINERAMA
+ if ( use_xinerama &&
+ window_w <= xinerama_info.width &&
+ window_h <= xinerama_info.height ) {
+ x = xinerama_info.x_org;
+ y = xinerama_info.y_org;
+ }
+#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */
+
+ if ( currently_fullscreen ) {
+ /* Switch resolution and cover it with the FSwindow */
+ move_cursor_to(this, x, y);
+ set_best_resolution(this, window_w, window_h);
+ move_cursor_to(this, x, y);
+ get_real_resolution(this, &real_w, &real_h);
+ if ( window_w > real_w ) {
+ real_w = MAX(real_w, screen_w);
+ }
+ if ( window_h > real_h ) {
+ real_h = MAX(real_h, screen_h);
+ }
+ XMoveResizeWindow(SDL_Display, FSwindow, x, y, real_w, real_h);
+ move_cursor_to(this, real_w/2, real_h/2);
+
+ /* Center and reparent the drawing window */
+ x = (real_w - window_w)/2;
+ y = (real_h - window_h)/2;
+ XReparentWindow(SDL_Display, SDL_Window, FSwindow, x, y);
+ /* FIXME: move the mouse to the old relative location */
+ XSync(SDL_Display, True); /* Flush spurious mode change events */
+ }
+ return(1);
+}
+
+void X11_QueueEnterFullScreen(_THIS)
+{
+ switch_waiting = 0x01 | SDL_FULLSCREEN;
+ switch_time = SDL_GetTicks() + 1500;
+#if 0 /* This causes a BadMatch error if the window is iconified (not needed) */
+ XSetInputFocus(SDL_Display, WMwindow, RevertToNone, CurrentTime);
+#endif
+}
+
+int X11_EnterFullScreen(_THIS)
+{
+ int okay;
+#if 0
+ Window tmpwin, *windows;
+ int i, nwindows;
+#endif
+ int x = 0, y = 0;
+ int real_w, real_h;
+ int screen_w;
+ int screen_h;
+
+ okay = 1;
+ if ( currently_fullscreen ) {
+ return(okay);
+ }
+
+ /* Ungrab the input so that we can move the mouse around */
+ X11_GrabInputNoLock(this, SDL_GRAB_OFF);
+
+#if SDL_VIDEO_DRIVER_X11_XINERAMA
+ if ( use_xinerama &&
+ window_w <= xinerama_info.width &&
+ window_h <= xinerama_info.height ) {
+ x = xinerama_info.x_org;
+ y = xinerama_info.y_org;
+ }
+#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */
+
+ /* Map the fullscreen window to blank the screen */
+ screen_w = DisplayWidth(SDL_Display, SDL_Screen);
+ screen_h = DisplayHeight(SDL_Display, SDL_Screen);
+ get_real_resolution(this, &real_w, &real_h);
+ real_w = MAX(window_w, MAX(real_w, screen_w));
+ real_h = MAX(window_h, MAX(real_h, screen_h));
+ XMoveResizeWindow(SDL_Display, FSwindow,
+ x, y, real_w, real_h);
+ XMapRaised(SDL_Display, FSwindow);
+ X11_WaitMapped(this, FSwindow);
+
+#if 0 /* This seems to break WindowMaker in focus-follows-mouse mode */
+ /* Make sure we got to the top of the window stack */
+ if ( XQueryTree(SDL_Display, SDL_Root, &tmpwin, &tmpwin,
+ &windows, &nwindows) && windows ) {
+ /* If not, try to put us there - if fail... oh well */
+ if ( windows[nwindows-1] != FSwindow ) {
+ tmpwin = windows[nwindows-1];
+ for ( i=0; i<nwindows; ++i ) {
+ if ( windows[i] == FSwindow ) {
+ SDL_memcpy(&windows[i], &windows[i+1],
+ (nwindows-i-1)*sizeof(windows[i]));
+ break;
+ }
+ }
+ windows[nwindows-1] = FSwindow;
+ XRestackWindows(SDL_Display, windows, nwindows);
+ XSync(SDL_Display, False);
+ }
+ XFree(windows);
+ }
+#else
+ XRaiseWindow(SDL_Display, FSwindow);
+#endif
+
+#if SDL_VIDEO_DRIVER_X11_VIDMODE
+ /* Save the current video mode */
+ if ( use_vidmode ) {
+ SDL_NAME(XF86VidModeLockModeSwitch)(SDL_Display, SDL_Screen, True);
+ save_mode(this);
+ }
+#endif
+ currently_fullscreen = 1;
+
+ /* Set the new resolution */
+ okay = X11_ResizeFullScreen(this);
+ if ( ! okay ) {
+ X11_LeaveFullScreen(this);
+ }
+ /* Set the colormap */
+ if ( SDL_XColorMap ) {
+ XInstallColormap(SDL_Display, SDL_XColorMap);
+ }
+ if ( okay ) {
+ X11_GrabInputNoLock(this, this->input_grab | SDL_GRAB_FULLSCREEN);
+ }
+
+ /* We may need to refresh the screen at this point (no backing store)
+ We also don't get an event, which is why we explicitly refresh. */
+ if ( this->screen ) {
+ if ( this->screen->flags & SDL_OPENGL ) {
+ SDL_PrivateExpose();
+ } else {
+ X11_RefreshDisplay(this);
+ }
+ }
+
+ return(okay);
+}
+
+int X11_LeaveFullScreen(_THIS)
+{
+ if ( currently_fullscreen ) {
+ XReparentWindow(SDL_Display, SDL_Window, WMwindow, 0, 0);
+#if SDL_VIDEO_DRIVER_X11_VIDMODE
+ if ( use_vidmode ) {
+ restore_mode(this);
+ SDL_NAME(XF86VidModeLockModeSwitch)(SDL_Display, SDL_Screen, False);
+ }
+#endif
+
+#if SDL_VIDEO_DRIVER_X11_XME
+ if ( use_xme ) {
+ int rw, rh;
+
+ /* check current mode so we can avoid uneccessary mode changes */
+ get_real_resolution(this, &rw, &rh);
+
+ if (rw != saved_res.width || rh != saved_res.height) {
+ XiGMiscChangeResolution(SDL_Display,
+ SDL_Screen,
+ 0, /* view */
+ saved_res.width,
+ saved_res.height,
+ 0);
+ XSync(SDL_Display, False);
+ }
+ }
+#endif
+
+#if SDL_VIDEO_DRIVER_X11_XRANDR
+ if ( use_xrandr ) {
+ XRRSetScreenConfig(SDL_Display, screen_config, SDL_Root,
+ saved_size_id, saved_rotation, CurrentTime);
+ }
+#endif
+
+ XUnmapWindow(SDL_Display, FSwindow);
+ X11_WaitUnmapped(this, FSwindow);
+ XSync(SDL_Display, True); /* Flush spurious mode change events */
+ currently_fullscreen = 0;
+ }
+ /* If we get popped out of fullscreen mode for some reason, input_grab
+ will still have the SDL_GRAB_FULLSCREEN flag set, since this is only
+ temporary. In this case, release the grab unless the input has been
+ explicitly grabbed.
+ */
+ X11_GrabInputNoLock(this, this->input_grab & ~SDL_GRAB_FULLSCREEN);
+
+ /* We may need to refresh the screen at this point (no backing store)
+ We also don't get an event, which is why we explicitly refresh. */
+ if ( this->screen ) {
+ if ( this->screen->flags & SDL_OPENGL ) {
+ SDL_PrivateExpose();
+ } else {
+ X11_RefreshDisplay(this);
+ }
+ }
+
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11modes_c.h b/distrib/sdl-1.2.15/src/video/x11/SDL_x11modes_c.h
new file mode 100644
index 0000000..f7780bf
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11modes_c.h
@@ -0,0 +1,43 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Utilities for getting and setting the X display mode */
+
+#include "SDL_x11video.h"
+
+/* Define this if you want to grab the keyboard in fullscreen mode.
+ If you do not define this, SDL will return from SDL_SetVideoMode()
+ immediately, but will not actually go fullscreen until the window
+ manager is idle.
+*/
+#define GRAB_FULLSCREEN
+
+extern int X11_GetVideoModes(_THIS);
+extern SDL_Rect **X11_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+extern void X11_FreeVideoModes(_THIS);
+extern int X11_ResizeFullScreen(_THIS);
+extern void X11_WaitMapped(_THIS, Window win);
+extern void X11_WaitUnmapped(_THIS, Window win);
+extern void X11_QueueEnterFullScreen(_THIS);
+extern int X11_EnterFullScreen(_THIS);
+extern int X11_LeaveFullScreen(_THIS);
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11mouse.c b/distrib/sdl-1.2.15/src/video/x11/SDL_x11mouse.c
new file mode 100644
index 0000000..16ad739
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11mouse.c
@@ -0,0 +1,288 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+#include "SDL_mouse.h"
+#include "../../events/SDL_events_c.h"
+#include "../SDL_cursor_c.h"
+#include "SDL_x11dga_c.h"
+#include "SDL_x11mouse_c.h"
+
+
+/* The implementation dependent data for the window manager cursor */
+struct WMcursor {
+ Cursor x_cursor;
+};
+
+
+void X11_FreeWMCursor(_THIS, WMcursor *cursor)
+{
+ if ( SDL_Display != NULL ) {
+ SDL_Lock_EventThread();
+ XFreeCursor(SDL_Display, cursor->x_cursor);
+ XSync(SDL_Display, False);
+ SDL_Unlock_EventThread();
+ }
+ SDL_free(cursor);
+}
+
+WMcursor *X11_CreateWMCursor(_THIS,
+ Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
+{
+ WMcursor *cursor;
+ XGCValues GCvalues;
+ GC GCcursor;
+ XImage *data_image, *mask_image;
+ Pixmap data_pixmap, mask_pixmap;
+ int clen, i;
+ char *x_data, *x_mask;
+ static XColor black = { 0, 0, 0, 0 };
+ static XColor white = { 0xffff, 0xffff, 0xffff, 0xffff };
+
+ /* Allocate the cursor memory */
+ cursor = (WMcursor *)SDL_malloc(sizeof(WMcursor));
+ if ( cursor == NULL ) {
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+
+ /* Mix the mask and the data */
+ clen = (w/8)*h;
+ x_data = (char *)SDL_malloc(clen);
+ if ( x_data == NULL ) {
+ SDL_free(cursor);
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ x_mask = (char *)SDL_malloc(clen);
+ if ( x_mask == NULL ) {
+ SDL_free(cursor);
+ SDL_free(x_data);
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ for ( i=0; i<clen; ++i ) {
+ /* The mask is OR'd with the data to turn inverted color
+ pixels black since inverted color cursors aren't supported
+ under X11.
+ */
+ x_mask[i] = data[i] | mask[i];
+ x_data[i] = data[i];
+ }
+
+ /* Prevent the event thread from running while we use the X server */
+ SDL_Lock_EventThread();
+
+ /* Create the data image */
+ data_image = XCreateImage(SDL_Display,
+ DefaultVisual(SDL_Display, SDL_Screen),
+ 1, XYBitmap, 0, x_data, w, h, 8, w/8);
+ data_image->byte_order = MSBFirst;
+ data_image->bitmap_bit_order = MSBFirst;
+ data_pixmap = XCreatePixmap(SDL_Display, SDL_Root, w, h, 1);
+
+ /* Create the data mask */
+ mask_image = XCreateImage(SDL_Display,
+ DefaultVisual(SDL_Display, SDL_Screen),
+ 1, XYBitmap, 0, x_mask, w, h, 8, w/8);
+ mask_image->byte_order = MSBFirst;
+ mask_image->bitmap_bit_order = MSBFirst;
+ mask_pixmap = XCreatePixmap(SDL_Display, SDL_Root, w, h, 1);
+
+ /* Create the graphics context */
+ GCvalues.function = GXcopy;
+ GCvalues.foreground = ~0;
+ GCvalues.background = 0;
+ GCvalues.plane_mask = AllPlanes;
+ GCcursor = XCreateGC(SDL_Display, data_pixmap,
+ (GCFunction|GCForeground|GCBackground|GCPlaneMask),
+ &GCvalues);
+
+ /* Blit the images to the pixmaps */
+ XPutImage(SDL_Display, data_pixmap, GCcursor, data_image,
+ 0, 0, 0, 0, w, h);
+ XPutImage(SDL_Display, mask_pixmap, GCcursor, mask_image,
+ 0, 0, 0, 0, w, h);
+ XFreeGC(SDL_Display, GCcursor);
+ /* These free the x_data and x_mask memory pointers */
+ XDestroyImage(data_image);
+ XDestroyImage(mask_image);
+
+ /* Create the cursor */
+ cursor->x_cursor = XCreatePixmapCursor(SDL_Display, data_pixmap,
+ mask_pixmap, &black, &white, hot_x, hot_y);
+ XFreePixmap(SDL_Display, data_pixmap);
+ XFreePixmap(SDL_Display, mask_pixmap);
+
+ /* Release the event thread */
+ XSync(SDL_Display, False);
+ SDL_Unlock_EventThread();
+
+ return(cursor);
+}
+
+int X11_ShowWMCursor(_THIS, WMcursor *cursor)
+{
+ /* Don't do anything if the display is gone */
+ if ( SDL_Display == NULL ) {
+ return(0);
+ }
+
+ /* Set the X11 cursor cursor, or blank if cursor is NULL */
+ if ( SDL_Window ) {
+ SDL_Lock_EventThread();
+ if ( cursor == NULL ) {
+ if ( SDL_BlankCursor != NULL ) {
+ XDefineCursor(SDL_Display, SDL_Window,
+ SDL_BlankCursor->x_cursor);
+ }
+ } else {
+ XDefineCursor(SDL_Display, SDL_Window, cursor->x_cursor);
+ }
+ XSync(SDL_Display, False);
+ SDL_Unlock_EventThread();
+ }
+ return(1);
+}
+
+void X11_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
+{
+ if ( using_dga & DGA_MOUSE ) {
+ SDL_PrivateMouseMotion(0, 0, x, y);
+ } else if ( mouse_relative) {
+ /* RJR: March 28, 2000
+ leave physical cursor at center of screen if
+ mouse hidden and grabbed */
+ SDL_PrivateMouseMotion(0, 0, x, y);
+ } else {
+ SDL_Lock_EventThread();
+ XWarpPointer(SDL_Display, None, SDL_Window, 0, 0, 0, 0, x, y);
+ XSync(SDL_Display, False);
+ SDL_Unlock_EventThread();
+ }
+}
+
+/* Sets the mouse acceleration from a string of the form:
+ 2/1/0
+ The first number is the numerator, followed by the acceleration
+ denumenator and threshold.
+*/
+static void SetMouseAccel(_THIS, const char *accel_param)
+{
+ int i;
+ size_t len;
+ int accel_value[3];
+ char *mouse_param, *mouse_param_buf, *pin;
+
+ len = SDL_strlen(accel_param)+1;
+ mouse_param_buf = SDL_stack_alloc(char, len);
+ if ( ! mouse_param_buf ) {
+ return;
+ }
+ SDL_strlcpy(mouse_param_buf, accel_param, len);
+ mouse_param = mouse_param_buf;
+
+ for ( i=0; (i < 3) && mouse_param; ++i ) {
+ pin = SDL_strchr(mouse_param, '/');
+ if ( pin ) {
+ *pin = '\0';
+ }
+ accel_value[i] = atoi(mouse_param);
+ if ( pin ) {
+ mouse_param = pin+1;
+ } else {
+ mouse_param = NULL;
+ }
+ }
+ if ( i == 3 ) {
+ XChangePointerControl(SDL_Display, True, True,
+ accel_value[0], accel_value[1], accel_value[2]);
+ }
+ SDL_stack_free(mouse_param_buf);
+}
+
+/* Check to see if we need to enter or leave mouse relative mode */
+void X11_CheckMouseModeNoLock(_THIS)
+{
+ const Uint8 full_focus = (SDL_APPACTIVE|SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS);
+ char *env_override;
+ int enable_relative = 1;
+
+ /* This happens when quiting after an xio error */
+ if ( SDL_Display == NULL )
+ return;
+
+ /* Allow the user to override the relative mouse mode.
+ They almost never want to do this, as it seriously affects
+ applications that rely on continuous relative mouse motion.
+ */
+ env_override = SDL_getenv("SDL_MOUSE_RELATIVE");
+ if ( env_override ) {
+ enable_relative = atoi(env_override);
+ }
+
+ /* If the mouse is hidden and input is grabbed, we use relative mode */
+ if ( enable_relative &&
+ !(SDL_cursorstate & CURSOR_VISIBLE) &&
+ (this->input_grab != SDL_GRAB_OFF) &&
+ (SDL_GetAppState() & full_focus) == full_focus ) {
+ if ( ! mouse_relative ) {
+ X11_EnableDGAMouse(this);
+ if ( ! (using_dga & DGA_MOUSE) ) {
+ char *xmouse_accel;
+
+ SDL_GetMouseState(&mouse_last.x, &mouse_last.y);
+ /* Use as raw mouse mickeys as possible */
+ XGetPointerControl(SDL_Display,
+ &mouse_accel.numerator,
+ &mouse_accel.denominator,
+ &mouse_accel.threshold);
+ xmouse_accel=SDL_getenv("SDL_VIDEO_X11_MOUSEACCEL");
+ if ( xmouse_accel ) {
+ SetMouseAccel(this, xmouse_accel);
+ }
+ }
+ mouse_relative = 1;
+ }
+ } else {
+ if ( mouse_relative ) {
+ if ( using_dga & DGA_MOUSE ) {
+ X11_DisableDGAMouse(this);
+ } else {
+ XChangePointerControl(SDL_Display, True, True,
+ mouse_accel.numerator,
+ mouse_accel.denominator,
+ mouse_accel.threshold);
+ }
+ mouse_relative = 0;
+ }
+ }
+}
+void X11_CheckMouseMode(_THIS)
+{
+ SDL_Lock_EventThread();
+ X11_CheckMouseModeNoLock(this);
+ SDL_Unlock_EventThread();
+}
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11mouse_c.h b/distrib/sdl-1.2.15/src/video/x11/SDL_x11mouse_c.h
new file mode 100644
index 0000000..03d97d8
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11mouse_c.h
@@ -0,0 +1,33 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_x11video.h"
+
+/* Functions to be exported */
+extern void X11_FreeWMCursor(_THIS, WMcursor *cursor);
+extern WMcursor *X11_CreateWMCursor(_THIS,
+ Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
+extern int X11_ShowWMCursor(_THIS, WMcursor *cursor);
+extern void X11_WarpWMCursor(_THIS, Uint16 x, Uint16 y);
+extern void X11_CheckMouseModeNoLock(_THIS);
+extern void X11_CheckMouseMode(_THIS);
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11sym.h b/distrib/sdl-1.2.15/src/video/x11/SDL_x11sym.h
new file mode 100644
index 0000000..f9c7df3
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11sym.h
@@ -0,0 +1,211 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+
+SDL_X11_MODULE(BASEXLIB)
+SDL_X11_SYM(XClassHint*,XAllocClassHint,(void),(),return)
+SDL_X11_SYM(Status,XAllocColor,(Display* a,Colormap b,XColor* c),(a,b,c),return)
+SDL_X11_SYM(XSizeHints*,XAllocSizeHints,(void),(),return)
+SDL_X11_SYM(XWMHints*,XAllocWMHints,(void),(),return)
+SDL_X11_SYM(int,XChangePointerControl,(Display* a,Bool b,Bool c,int d,int e,int f),(a,b,c,d,e,f),return)
+SDL_X11_SYM(int,XChangeProperty,(Display* a,Window b,Atom c,Atom d,int e,int f,_Xconst unsigned char* g,int h),(a,b,c,d,e,f,g,h),return)
+SDL_X11_SYM(int,XChangeWindowAttributes,(Display* a,Window b,unsigned long c,XSetWindowAttributes* d),(a,b,c,d),return)
+SDL_X11_SYM(Bool,XCheckTypedEvent,(Display* a,int b,XEvent* c),(a,b,c),return)
+SDL_X11_SYM(int,XClearWindow,(Display* a,Window b),(a,b),return)
+SDL_X11_SYM(int,XCloseDisplay,(Display* a),(a),return)
+SDL_X11_SYM(int,XConfigureWindow,(Display* a,Window b,unsigned int c,XWindowChanges* d),(a,b,c,d),return)
+SDL_X11_SYM(Colormap,XCreateColormap,(Display* a,Window b,Visual* c,int d),(a,b,c,d),return)
+SDL_X11_SYM(Cursor,XCreatePixmapCursor,(Display* a,Pixmap b,Pixmap c,XColor* d,XColor* e,unsigned int f,unsigned int g),(a,b,c,d,e,f,g),return)
+SDL_X11_SYM(GC,XCreateGC,(Display* a,Drawable b,unsigned long c,XGCValues* d),(a,b,c,d),return)
+SDL_X11_SYM(XImage*,XCreateImage,(Display* a,Visual* b,unsigned int c,int d,int e,char* f,unsigned int g,unsigned int h,int i,int j),(a,b,c,d,e,f,g,h,i,j),return)
+SDL_X11_SYM(Pixmap,XCreatePixmap,(Display* a,Drawable b,unsigned int c,unsigned int d,unsigned int e),(a,b,c,d,e),return)
+SDL_X11_SYM(Pixmap,XCreatePixmapFromBitmapData,(Display* a,Drawable b,char* c,unsigned int d,unsigned int e,unsigned long f,unsigned long g,unsigned int h),(a,b,c,d,e,f,g,h),return)
+SDL_X11_SYM(Window,XCreateSimpleWindow,(Display* a,Window b,int c,int d,unsigned int e,unsigned int f,unsigned int g,unsigned long h,unsigned long i),(a,b,c,d,e,f,g,h,i),return)
+SDL_X11_SYM(Window,XCreateWindow,(Display* a,Window b,int c,int d,unsigned int e,unsigned int f,unsigned int g,int h,unsigned int i,Visual* j,unsigned long k,XSetWindowAttributes* l),(a,b,c,d,e,f,g,h,i,j,k,l),return)
+SDL_X11_SYM(int,XDefaultScreen,(Display* a),(a),return)
+SDL_X11_SYM(int,XDisplayWidth,(Display* a,int b),(a,b),return)
+SDL_X11_SYM(int,XDisplayWidthMM,(Display* a, int b),(a, b),return)
+SDL_X11_SYM(int,XDisplayHeight,(Display* a,int b),(a,b),return)
+SDL_X11_SYM(int,XDisplayHeightMM,(Display* a, int b),(a, b),return)
+SDL_X11_SYM(int,XDefineCursor,(Display* a,Window b,Cursor c),(a,b,c),return)
+SDL_X11_SYM(int,XDeleteProperty,(Display* a,Window b,Atom c),(a,b,c),return)
+SDL_X11_SYM(int,XDestroyWindow,(Display* a,Window b),(a,b),return)
+SDL_X11_SYM(char*,XDisplayName,(_Xconst char* a),(a),return)
+SDL_X11_SYM(int,XEventsQueued,(Display* a,int b),(a,b),return)
+SDL_X11_SYM(Bool,XFilterEvent,(XEvent *event, Window w),(event,w),return)
+SDL_X11_SYM(int,XFlush,(Display* a),(a),return)
+SDL_X11_SYM(int,XFree,(void*a),(a),return)
+SDL_X11_SYM(int,XFreeColormap,(Display* a,Colormap b),(a,b),return)
+SDL_X11_SYM(int,XFreeColors,(Display* a,Colormap b,unsigned long* c,int d,unsigned long e),(a,b,c,d,e),return)
+SDL_X11_SYM(int,XFreeCursor,(Display* a,Cursor b),(a,b),return)
+SDL_X11_SYM(int,XFreeGC,(Display* a,GC b),(a,b),return)
+SDL_X11_SYM(int,XFreeModifiermap,(XModifierKeymap* a),(a),return)
+SDL_X11_SYM(int,XFreePixmap,(Display* a,Pixmap b),(a,b),return)
+SDL_X11_SYM(int,XGetErrorDatabaseText,(Display* a,_Xconst char* b,_Xconst char* c,_Xconst char* d,char* e,int f),(a,b,c,d,e,f),return)
+SDL_X11_SYM(int,XGetGeometry,(Display* a,Drawable b,Window* c,int* d,int* e,unsigned int* f,unsigned int* g,unsigned int* h,unsigned int* i),(a,b,c,d,e,f,g,h,i),return)
+SDL_X11_SYM(XModifierKeymap*,XGetModifierMapping,(Display* a),(a),return)
+SDL_X11_SYM(int,XGetPointerControl,(Display* a,int* b,int* c,int* d),(a,b,c,d),return)
+SDL_X11_SYM(XVisualInfo*,XGetVisualInfo,(Display* a,long b,XVisualInfo* c,int* d),(a,b,c,d),return)
+SDL_X11_SYM(XWMHints*,XGetWMHints,(Display* a,Window b),(a,b),return)
+SDL_X11_SYM(Status,XGetWindowAttributes,(Display* a,Window b,XWindowAttributes* c),(a,b,c),return)
+SDL_X11_SYM(int,XGrabKeyboard,(Display* a,Window b,Bool c,int d,int e,Time f),(a,b,c,d,e,f),return)
+SDL_X11_SYM(int,XGrabPointer,(Display* a,Window b,Bool c,unsigned int d,int e,int f,Window g,Cursor h,Time i),(a,b,c,d,e,f,g,h,i),return)
+SDL_X11_SYM(Status,XIconifyWindow,(Display* a,Window b,int c),(a,b,c),return)
+SDL_X11_SYM(Status,XInitThreads,(void),(),return)
+SDL_X11_SYM(int,XInstallColormap,(Display* a,Colormap b),(a,b),return)
+SDL_X11_SYM(KeyCode,XKeysymToKeycode,(Display* a,KeySym b),(a,b),return)
+SDL_X11_SYM(Atom,XInternAtom,(Display* a,_Xconst char* b,Bool c),(a,b,c),return)
+SDL_X11_SYM(XPixmapFormatValues*,XListPixmapFormats,(Display* a,int* b),(a,b),return)
+SDL_X11_SYM(int,XLookupString,(XKeyEvent* a,char* b,int c,KeySym* d,XComposeStatus* e),(a,b,c,d,e),return)
+SDL_X11_SYM(int,XMapRaised,(Display* a,Window b),(a,b),return)
+SDL_X11_SYM(int,XMapWindow,(Display* a,Window b),(a,b),return)
+SDL_X11_SYM(int,XMaskEvent,(Display* a,long b,XEvent* c),(a,b,c),return)
+SDL_X11_SYM(Status,XMatchVisualInfo,(Display* a,int b,int c,int d,XVisualInfo* e),(a,b,c,d,e),return)
+SDL_X11_SYM(int,XMissingExtension,(Display* a,_Xconst char* b),(a,b),return)
+SDL_X11_SYM(int,XMoveResizeWindow,(Display* a,Window b,int c,int d,unsigned int e,unsigned int f),(a,b,c,d,e,f),return)
+SDL_X11_SYM(int,XMoveWindow,(Display* a,Window b,int c,int d),(a,b,c,d),return)
+SDL_X11_SYM(int,XNextEvent,(Display* a,XEvent* b),(a,b),return)
+SDL_X11_SYM(Display*,XOpenDisplay,(_Xconst char* a),(a),return)
+SDL_X11_SYM(int,XPeekEvent,(Display* a,XEvent* b),(a,b),return)
+SDL_X11_SYM(int,XPending,(Display* a),(a),return)
+SDL_X11_SYM(int,XPutImage,(Display* a,Drawable b,GC c,XImage* d,int e,int f,int g,int h,unsigned int i,unsigned int j),(a,b,c,d,e,f,g,h,i,j),return)
+SDL_X11_SYM(int,XQueryColors,(Display* a,Colormap b,XColor* c,int d),(a,b,c,d),return)
+SDL_X11_SYM(int,XQueryKeymap,(Display* a,char *b),(a,b),return)
+SDL_X11_SYM(Bool,XQueryPointer,(Display* a,Window b,Window* c,Window* d,int* e,int* f,int* g,int* h,unsigned int* i),(a,b,c,d,e,f,g,h,i),return)
+SDL_X11_SYM(int,XQueryTree,(Display* a,Window b,Window* c,Window* d,Window** e,unsigned int* f),(a,b,c,d,e,f),return)
+SDL_X11_SYM(int,XRaiseWindow,(Display* a,Window b),(a,b),return)
+SDL_X11_SYM(int,XReparentWindow,(Display* a,Window b,Window c,int d,int e),(a,b,c,d,e),return)
+SDL_X11_SYM(int,XResetScreenSaver,(Display* a),(a),return)
+SDL_X11_SYM(int,XResizeWindow,(Display* a,Window b,unsigned int c,unsigned int d),(a,b,c,d),return)
+SDL_X11_SYM(int,XSelectInput,(Display* a,Window b,long c),(a,b,c),return)
+SDL_X11_SYM(Status,XSendEvent,(Display* a,Window b,Bool c,long d,XEvent* e),(a,b,c,d,e),return)
+SDL_X11_SYM(int,XSetClassHint,(Display* a,Window b,XClassHint* c),(a,b,c),return)
+SDL_X11_SYM(XErrorHandler,XSetErrorHandler,(XErrorHandler a),(a),return)
+SDL_X11_SYM(XIOErrorHandler,XSetIOErrorHandler,(XIOErrorHandler a),(a),return)
+SDL_X11_SYM(int,XSetTransientForHint,(Display* a,Window b,Window c),(a,b,c),return)
+SDL_X11_SYM(int,XSetWMHints,(Display* a,Window b,XWMHints* c),(a,b,c),return)
+SDL_X11_SYM(void,XSetTextProperty,(Display* a,Window b,XTextProperty* c,Atom d),(a,b,c,d),)
+SDL_X11_SYM(void,XSetWMNormalHints,(Display* a,Window b,XSizeHints* c),(a,b,c),)
+SDL_X11_SYM(Status,XSetWMProtocols,(Display* a,Window b,Atom* c,int d),(a,b,c,d),return)
+SDL_X11_SYM(int,XSetWindowBackground,(Display* a,Window b,unsigned long c),(a,b,c),return)
+SDL_X11_SYM(int,XSetWindowBackgroundPixmap,(Display* a,Window b,Pixmap c),(a,b,c),return)
+SDL_X11_SYM(int,XSetWindowColormap,(Display* a,Window b,Colormap c),(a,b,c),return)
+SDL_X11_SYM(int,XStoreColors,(Display* a,Colormap b,XColor* c,int d),(a,b,c,d),return)
+SDL_X11_SYM(Status,XStringListToTextProperty,(char** a,int b,XTextProperty* c),(a,b,c),return)
+SDL_X11_SYM(int,XSync,(Display* a,Bool b),(a,b),return)
+SDL_X11_SYM(int,XUngrabKeyboard,(Display* a,Time b),(a,b),return)
+SDL_X11_SYM(int,XUngrabPointer,(Display* a,Time 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(VisualID,XVisualIDFromVisual,(Visual* a),(a),return)
+SDL_X11_SYM(XExtDisplayInfo*,XextAddDisplay,(XExtensionInfo* a,Display* b,char* c,XExtensionHooks* d,int e,XPointer f),(a,b,c,d,e,f),return)
+SDL_X11_SYM(XExtensionInfo*,XextCreateExtension,(void),(),return)
+SDL_X11_SYM(void,XextDestroyExtension,(XExtensionInfo* a),(a),)
+SDL_X11_SYM(XExtDisplayInfo*,XextFindDisplay,(XExtensionInfo* a,Display* b),(a,b),return)
+SDL_X11_SYM(int,XextRemoveDisplay,(XExtensionInfo* a,Display* b),(a,b),return)
+SDL_X11_SYM(Bool,XQueryExtension,(Display* a,_Xconst char* b,int* c,int* d,int* e),(a,b,c,d,e),return)
+SDL_X11_SYM(char *,XDisplayString,(Display* a),(a),return)
+SDL_X11_SYM(int,XGetErrorText,(Display* a,int b,char* c,int d),(a,b,c,d),return)
+SDL_X11_SYM(void,_XEatData,(Display* a,unsigned long b),(a,b),)
+SDL_X11_SYM(void,_XFlush,(Display* a),(a),)
+SDL_X11_SYM(void,_XFlushGCCache,(Display* a,GC b),(a,b),)
+SDL_X11_SYM(int,_XRead,(Display* a,char* b,long c),(a,b,c),return)
+SDL_X11_SYM(void,_XReadPad,(Display* a,char* b,long c),(a,b,c),)
+SDL_X11_SYM(void,_XSend,(Display* a,_Xconst char* b,long c),(a,b,c),)
+SDL_X11_SYM(Status,_XReply,(Display* a,xReply* b,int c,Bool d),(a,b,c,d),return)
+SDL_X11_SYM(unsigned long,_XSetLastRequestRead,(Display* a,xGenericReply* b),(a,b),return)
+SDL_X11_SYM(SDL_X11_XSynchronizeRetType,XSynchronize,(Display* a,Bool b),(a,b),return)
+SDL_X11_SYM(int,XTranslateCoordinates,(Display* a,Window b,Window c,int d,int e,int* f,int* g,Window* h),(a,b,c,d,e,f,g,h),return)
+SDL_X11_SYM(SDL_X11_XESetWireToEventRetType,XESetWireToEvent,(Display* a,int b,SDL_X11_XESetWireToEventRetType c),(a,b,c),return)
+SDL_X11_SYM(SDL_X11_XESetEventToWireRetType,XESetEventToWire,(Display* a,int b,SDL_X11_XESetEventToWireRetType c),(a,b,c),return)
+SDL_X11_SYM(XExtensionErrorHandler,XSetExtensionErrorHandler,(XExtensionErrorHandler a),(a),return)
+
+#if NeedWidePrototypes
+SDL_X11_SYM(KeySym,XKeycodeToKeysym,(Display* a,unsigned int b,int c),(a,b,c),return)
+#else
+SDL_X11_SYM(KeySym,XKeycodeToKeysym,(Display* a,KeyCode b,int c),(a,b,c),return)
+#endif
+
+#ifdef X_HAVE_UTF8_STRING
+SDL_X11_MODULE(UTF8)
+SDL_X11_SYM(int,Xutf8TextListToTextProperty,(Display* a,char** b,int c,XICCEncodingStyle d,XTextProperty* e),(a,b,c,d,e),return)
+SDL_X11_SYM(int,Xutf8LookupString,(XIC a,XKeyPressedEvent* b,char* c,int d,KeySym* e,Status* f),(a,b,c,d,e,f),return)
+/*SDL_X11_SYM(XIC,XCreateIC,(XIM, ...),return) !!! ARGH! */
+SDL_X11_SYM(void,XDestroyIC,(XIC a),(a),)
+SDL_X11_SYM(void,XSetICFocus,(XIC a),(a),)
+SDL_X11_SYM(void,XUnsetICFocus,(XIC a),(a),)
+/*SDL_X11_SYM(char*,XGetICValues,(XIC a, ...),return)*/
+SDL_X11_SYM(XIM,XOpenIM,(Display* a,struct _XrmHashBucketRec* b,char* c,char* d),(a,b,c,d),return)
+SDL_X11_SYM(Status,XCloseIM,(XIM a),(a),return)
+SDL_X11_SYM(char*,XSetLocaleModifiers,(_Xconst char* a),(a),return)
+SDL_X11_SYM(int,XRefreshKeyboardMapping,(XMappingEvent* a),(a),return)
+SDL_X11_SYM(Display*,XDisplayOfIM,(XIM a),(a),return)
+#endif
+
+#ifndef NO_SHARED_MEMORY
+SDL_X11_MODULE(SHM)
+SDL_X11_SYM(Status,XShmAttach,(Display* a,XShmSegmentInfo* b),(a,b),return)
+SDL_X11_SYM(Status,XShmDetach,(Display* a,XShmSegmentInfo* b),(a,b),return)
+SDL_X11_SYM(Status,XShmPutImage,(Display* a,Drawable b,GC c,XImage* d,int e,int f,int g,int h,unsigned int i,unsigned int j,Bool k),(a,b,c,d,e,f,g,h,i,j,k),return)
+SDL_X11_SYM(XImage*,XShmCreateImage,(Display* a,Visual* b,unsigned int c,int d,char* e,XShmSegmentInfo* f,unsigned int g,unsigned int h),(a,b,c,d,e,f,g,h),return)
+SDL_X11_SYM(Bool,XShmQueryExtension,(Display* a),(a),return)
+#endif
+
+/*
+ * Not required...these only exist in code in headers on some 64-bit platforms,
+ * and are removed via macros elsewhere, so it's safe for them to be missing.
+ */
+#ifdef LONG64
+SDL_X11_MODULE(IO_32BIT)
+SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
+SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,len),)
+#endif
+
+/*
+ * libX11 1.4.99.1 added _XGetRequest, and macros use it behind the scenes.
+ */
+SDL_X11_MODULE(XGETREQUEST)
+SDL_X11_SYM(void *,_XGetRequest,(Display* a,CARD8 b,size_t c),(a,b,c),return)
+
+/*
+ * These only show up on some variants of Unix.
+ */
+#if defined(__osf__)
+SDL_X11_MODULE(OSF_ENTRY_POINTS)
+SDL_X11_SYM(void,_SmtBufferOverflow,(Display *dpy,register smtDisplayPtr p),(dpy,p),)
+SDL_X11_SYM(void,_SmtIpError,(Display *dpy,register smtDisplayPtr p, int i),(dpy,p,i),)
+SDL_X11_SYM(int,ipAllocateData,(ChannelPtr a, IPCard b, IPDataPtr * c),(a,b,c),return)
+SDL_X11_SYM(int,ipUnallocateAndSendData,(ChannelPtr a, IPCard b),(a,b),return)
+#endif
+
+/* Xrandr support. */
+#if SDL_VIDEO_DRIVER_X11_XRANDR
+SDL_X11_MODULE(XRANDR)
+SDL_X11_SYM(Status,XRRQueryVersion,(Display *dpy,int *major_versionp,int *minor_versionp),(dpy,major_versionp,minor_versionp),return)
+SDL_X11_SYM(XRRScreenConfiguration *,XRRGetScreenInfo,(Display *dpy,Drawable draw),(dpy,draw),return)
+SDL_X11_SYM(SizeID,XRRConfigCurrentConfiguration,(XRRScreenConfiguration *config,Rotation *rotation),(config,rotation),return)
+SDL_X11_SYM(XRRScreenSize *,XRRConfigSizes,(XRRScreenConfiguration *config, int *nsizes),(config,nsizes),return)
+SDL_X11_SYM(Status,XRRSetScreenConfig,(Display *dpy, XRRScreenConfiguration *config, Drawable draw, int size_index, Rotation rotation, Time timestamp),(dpy,config,draw,size_index,rotation,timestamp),return)
+SDL_X11_SYM(void,XRRFreeScreenConfigInfo,(XRRScreenConfiguration *config),(config),)
+#endif
+
+/* end of SDL_x11sym.h ... */
+
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11video.c b/distrib/sdl-1.2.15/src/video/x11/SDL_x11video.c
new file mode 100644
index 0000000..6d24422
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11video.c
@@ -0,0 +1,1580 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* X11 based SDL video driver implementation.
+ Note: This implementation does not currently need X11 thread locking,
+ since the event thread uses a separate X connection and any
+ additional locking necessary is handled internally. However,
+ if full locking is neccessary, take a look at XInitThreads().
+*/
+
+#include <unistd.h>
+#include <sys/ioctl.h>
+#ifdef MTRR_SUPPORT
+#include <asm/mtrr.h>
+#include <sys/fcntl.h>
+#endif
+
+#include "SDL_endian.h"
+#include "SDL_timer.h"
+#include "SDL_thread.h"
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_x11video.h"
+#include "SDL_x11wm_c.h"
+#include "SDL_x11mouse_c.h"
+#include "SDL_x11events_c.h"
+#include "SDL_x11modes_c.h"
+#include "SDL_x11image_c.h"
+#include "SDL_x11yuv_c.h"
+#include "SDL_x11gl_c.h"
+#include "SDL_x11gamma_c.h"
+#include "../blank_cursor.h"
+
+#ifdef X_HAVE_UTF8_STRING
+#include <locale.h>
+#endif
+
+/* Initialization/Query functions */
+static int X11_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Surface *X11_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int X11_ToggleFullScreen(_THIS, int on);
+static void X11_UpdateMouse(_THIS);
+static int X11_SetColors(_THIS, int firstcolor, int ncolors,
+ SDL_Color *colors);
+static int X11_SetGammaRamp(_THIS, Uint16 *ramp);
+static void X11_VideoQuit(_THIS);
+
+int X11_wmXAdjust;
+int X11_wmYAdjust;
+
+/* X11 driver bootstrap functions */
+
+static int X11_Available(void)
+{
+ Display *display = NULL;
+ if ( SDL_X11_LoadSymbols() ) {
+ display = XOpenDisplay(NULL);
+ if ( display != NULL ) {
+ XCloseDisplay(display);
+ }
+ SDL_X11_UnloadSymbols();
+ }
+ return(display != NULL);
+}
+
+static void X11_DeleteDevice(SDL_VideoDevice *device)
+{
+ if ( device ) {
+ if ( device->hidden ) {
+ SDL_free(device->hidden);
+ }
+ if ( device->gl_data ) {
+ SDL_free(device->gl_data);
+ }
+ SDL_free(device);
+ SDL_X11_UnloadSymbols();
+ }
+}
+
+static SDL_VideoDevice *X11_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device = NULL;
+
+ if ( SDL_X11_LoadSymbols() ) {
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *device->hidden));
+ device->gl_data = (struct SDL_PrivateGLData *)
+ SDL_malloc((sizeof *device->gl_data));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ||
+ (device->gl_data == NULL) ) {
+ SDL_OutOfMemory();
+ X11_DeleteDevice(device); /* calls SDL_X11_UnloadSymbols(). */
+ return(0);
+ }
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+ SDL_memset(device->gl_data, 0, (sizeof *device->gl_data));
+
+#if SDL_VIDEO_OPENGL_GLX
+ device->gl_data->swap_interval = -1;
+#endif
+
+ /* Set the driver flags */
+ device->handles_any_size = 1;
+
+ /* Set the function pointers */
+ device->VideoInit = X11_VideoInit;
+ device->ListModes = X11_ListModes;
+ device->SetVideoMode = X11_SetVideoMode;
+ device->ToggleFullScreen = X11_ToggleFullScreen;
+ device->UpdateMouse = X11_UpdateMouse;
+#if SDL_VIDEO_DRIVER_X11_XV
+ device->CreateYUVOverlay = X11_CreateYUVOverlay;
+#endif
+ device->SetColors = X11_SetColors;
+ device->UpdateRects = NULL;
+ device->VideoQuit = X11_VideoQuit;
+ device->AllocHWSurface = X11_AllocHWSurface;
+ device->CheckHWBlit = NULL;
+ device->FillHWRect = NULL;
+ device->SetHWColorKey = NULL;
+ device->SetHWAlpha = NULL;
+ device->LockHWSurface = X11_LockHWSurface;
+ device->UnlockHWSurface = X11_UnlockHWSurface;
+ device->FlipHWSurface = X11_FlipHWSurface;
+ device->FreeHWSurface = X11_FreeHWSurface;
+ device->SetGamma = X11_SetVidModeGamma;
+ device->GetGamma = X11_GetVidModeGamma;
+ device->SetGammaRamp = X11_SetGammaRamp;
+ device->GetGammaRamp = NULL;
+#if SDL_VIDEO_OPENGL_GLX
+ device->GL_LoadLibrary = X11_GL_LoadLibrary;
+ device->GL_GetProcAddress = X11_GL_GetProcAddress;
+ device->GL_GetAttribute = X11_GL_GetAttribute;
+ device->GL_MakeCurrent = X11_GL_MakeCurrent;
+ device->GL_SwapBuffers = X11_GL_SwapBuffers;
+#endif
+ device->SetCaption = X11_SetCaption;
+ device->SetIcon = X11_SetIcon;
+ device->IconifyWindow = X11_IconifyWindow;
+ device->GrabInput = X11_GrabInput;
+ device->GetWindowPos = X11_GetWindowPos;
+ device->SetWindowPos = X11_SetWindowPos;
+ device->IsWindowVisible = X11_IsWindowVisible;
+ device->GetMonitorDPI = X11_GetMonitorDPI;
+ device->GetMonitorRect = X11_GetMonitorRect;
+ device->GetWMInfo = X11_GetWMInfo;
+ device->FreeWMCursor = X11_FreeWMCursor;
+ device->CreateWMCursor = X11_CreateWMCursor;
+ device->ShowWMCursor = X11_ShowWMCursor;
+ device->WarpWMCursor = X11_WarpWMCursor;
+ device->CheckMouseMode = X11_CheckMouseMode;
+ device->InitOSKeymap = X11_InitOSKeymap;
+ device->PumpEvents = X11_PumpEvents;
+
+ device->free = X11_DeleteDevice;
+ }
+
+ return device;
+}
+
+VideoBootStrap X11_bootstrap = {
+ "x11", "X Window System",
+ X11_Available, X11_CreateDevice
+};
+
+/* Normal X11 error handler routine */
+static int (*X_handler)(Display *, XErrorEvent *) = NULL;
+static int x_errhandler(Display *d, XErrorEvent *e)
+{
+#if SDL_VIDEO_DRIVER_X11_VIDMODE
+ extern int vm_error;
+#endif
+#if SDL_VIDEO_DRIVER_X11_DGAMOUSE
+ extern int dga_error;
+#endif
+
+#if SDL_VIDEO_DRIVER_X11_VIDMODE
+ /* VidMode errors are non-fatal. :) */
+ /* Are the errors offset by one from the error base?
+ e.g. the error base is 143, the code is 148, and the
+ actual error is XF86VidModeExtensionDisabled (4) ?
+ */
+ if ( (vm_error >= 0) &&
+ (((e->error_code == BadRequest)&&(e->request_code == vm_error)) ||
+ ((e->error_code > vm_error) &&
+ (e->error_code <= (vm_error+XF86VidModeNumberErrors)))) ) {
+#ifdef X11_DEBUG
+{ char errmsg[1024];
+ XGetErrorText(d, e->error_code, errmsg, sizeof(errmsg));
+printf("VidMode error: %s\n", errmsg);
+}
+#endif
+ return(0);
+ }
+#endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */
+
+#if SDL_VIDEO_DRIVER_X11_DGAMOUSE
+ /* DGA errors can be non-fatal. :) */
+ if ( (dga_error >= 0) &&
+ ((e->error_code > dga_error) &&
+ (e->error_code <= (dga_error+XF86DGANumberErrors))) ) {
+#ifdef X11_DEBUG
+{ char errmsg[1024];
+ XGetErrorText(d, e->error_code, errmsg, sizeof(errmsg));
+printf("DGA error: %s\n", errmsg);
+}
+#endif
+ return(0);
+ }
+#endif /* SDL_VIDEO_DRIVER_X11_DGAMOUSE */
+
+ return(X_handler(d,e));
+}
+
+/* X11 I/O error handler routine */
+static int (*XIO_handler)(Display *) = NULL;
+static int xio_errhandler(Display *d)
+{
+ /* Ack! Lost X11 connection! */
+
+ /* We will crash if we try to clean up our display */
+ if ( SDL_VideoSurface && current_video->hidden->Ximage ) {
+ SDL_VideoSurface->pixels = NULL;
+ }
+ current_video->hidden->X11_Display = NULL;
+
+ /* Continue with the standard X11 error handler */
+ return(XIO_handler(d));
+}
+
+static int (*Xext_handler)(Display *, _Xconst char *, _Xconst char *) = NULL;
+static int xext_errhandler(Display *d, _Xconst char *ext, _Xconst char *reason)
+{
+#ifdef X11_DEBUG
+ printf("Xext error inside SDL (may be harmless):\n");
+ printf(" Extension \"%s\" %s on display \"%s\".\n",
+ ext, reason, XDisplayString(d));
+#endif
+
+ if (SDL_strcmp(reason, "missing") == 0) {
+ /*
+ * Since the query itself, elsewhere, can handle a missing extension
+ * and the default behaviour in Xlib is to write to stderr, which
+ * generates unnecessary bug reports, we just ignore these.
+ */
+ return 0;
+ }
+
+ /* Everything else goes to the default handler... */
+ return Xext_handler(d, ext, reason);
+}
+
+/* Find out what class name we should use */
+static char *get_classname(char *classname, int maxlen)
+{
+ char *spot;
+#if defined(__LINUX__) || defined(__FREEBSD__)
+ char procfile[1024];
+ char linkfile[1024];
+ int linksize;
+#endif
+
+ /* First allow environment variable override */
+ spot = SDL_getenv("SDL_VIDEO_X11_WMCLASS");
+ if ( spot ) {
+ SDL_strlcpy(classname, spot, maxlen);
+ return classname;
+ }
+
+ /* Next look at the application's executable name */
+#if defined(__LINUX__) || defined(__FREEBSD__)
+#if defined(__LINUX__)
+ SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/exe", getpid());
+#elif defined(__FREEBSD__)
+ SDL_snprintf(procfile, SDL_arraysize(procfile), "/proc/%d/file", getpid());
+#else
+#error Where can we find the executable name?
+#endif
+ linksize = readlink(procfile, linkfile, sizeof(linkfile)-1);
+ if ( linksize > 0 ) {
+ linkfile[linksize] = '\0';
+ spot = SDL_strrchr(linkfile, '/');
+ if ( spot ) {
+ SDL_strlcpy(classname, spot+1, maxlen);
+ } else {
+ SDL_strlcpy(classname, linkfile, maxlen);
+ }
+ return classname;
+ }
+#endif /* __LINUX__ */
+
+ /* Finally use the default we've used forever */
+ SDL_strlcpy(classname, "SDL_App", maxlen);
+ return classname;
+}
+
+/* Create auxiliary (toplevel) windows with the current visual */
+static void create_aux_windows(_THIS)
+{
+ int x = 0, y = 0;
+ char classname[1024];
+ XSetWindowAttributes xattr;
+ XWMHints *hints;
+ unsigned long app_event_mask;
+ int def_vis = (SDL_Visual == DefaultVisual(SDL_Display, SDL_Screen));
+
+ /* Look up some useful Atoms */
+ WM_DELETE_WINDOW = XInternAtom(SDL_Display, "WM_DELETE_WINDOW", False);
+
+ /* Don't create any extra windows if we are being managed */
+ if ( SDL_windowid ) {
+ FSwindow = 0;
+ WMwindow = SDL_strtol(SDL_windowid, NULL, 0);
+ return;
+ }
+
+ if(FSwindow)
+ XDestroyWindow(SDL_Display, FSwindow);
+
+#if SDL_VIDEO_DRIVER_X11_XINERAMA
+ if ( use_xinerama ) {
+ x = xinerama_info.x_org;
+ y = xinerama_info.y_org;
+ }
+#endif
+ xattr.override_redirect = True;
+ xattr.background_pixel = def_vis ? BlackPixel(SDL_Display, SDL_Screen) : 0;
+ xattr.border_pixel = 0;
+ xattr.colormap = SDL_XColorMap;
+
+ FSwindow = XCreateWindow(SDL_Display, SDL_Root,
+ x + X11_wmXAdjust,
+ y + X11_wmYAdjust,
+ 32, 32, 0,
+ this->hidden->depth, InputOutput, SDL_Visual,
+ CWOverrideRedirect | CWBackPixel | CWBorderPixel
+ | CWColormap,
+ &xattr);
+
+ XSelectInput(SDL_Display, FSwindow, StructureNotifyMask);
+
+ /* Tell KDE to keep the fullscreen window on top */
+ {
+ XEvent ev;
+ long mask;
+
+ SDL_memset(&ev, 0, sizeof(ev));
+ ev.xclient.type = ClientMessage;
+ ev.xclient.window = SDL_Root;
+ ev.xclient.message_type = XInternAtom(SDL_Display,
+ "KWM_KEEP_ON_TOP", False);
+ ev.xclient.format = 32;
+ ev.xclient.data.l[0] = FSwindow;
+ ev.xclient.data.l[1] = CurrentTime;
+ mask = SubstructureRedirectMask;
+ XSendEvent(SDL_Display, SDL_Root, False, mask, &ev);
+ }
+
+ hints = NULL;
+ if(WMwindow) {
+ /* All window attributes must survive the recreation */
+ hints = XGetWMHints(SDL_Display, WMwindow);
+ XDestroyWindow(SDL_Display, WMwindow);
+ }
+
+ /* Create the window for windowed management */
+ /* (reusing the xattr structure above) */
+ WMwindow = XCreateWindow(SDL_Display, SDL_Root,
+ x, y, 32, 32, 0,
+ this->hidden->depth, InputOutput, SDL_Visual,
+ CWBackPixel | CWBorderPixel | CWColormap,
+ &xattr);
+
+ /* Set the input hints so we get keyboard input */
+ if(!hints) {
+ hints = XAllocWMHints();
+ hints->input = True;
+ hints->flags = InputHint;
+ }
+ XSetWMHints(SDL_Display, WMwindow, hints);
+ XFree(hints);
+ X11_SetCaptionNoLock(this, this->wm_title, this->wm_icon);
+
+ app_event_mask = FocusChangeMask | KeyPressMask | KeyReleaseMask
+ | PropertyChangeMask | StructureNotifyMask | KeymapStateMask;
+ XSelectInput(SDL_Display, WMwindow, app_event_mask);
+
+ /* Set the class hints so we can get an icon (AfterStep) */
+ get_classname(classname, sizeof(classname));
+ {
+ XClassHint *classhints;
+ classhints = XAllocClassHint();
+ if(classhints != NULL) {
+ classhints->res_name = classname;
+ classhints->res_class = classname;
+ XSetClassHint(SDL_Display, WMwindow, classhints);
+ XFree(classhints);
+ }
+ }
+
+ {
+ pid_t pid = getpid();
+ char hostname[256];
+
+ if (pid > 0 && gethostname(hostname, sizeof(hostname)) > -1) {
+ Atom _NET_WM_PID = XInternAtom(SDL_Display, "_NET_WM_PID", False);
+ Atom WM_CLIENT_MACHINE = XInternAtom(SDL_Display, "WM_CLIENT_MACHINE", False);
+
+ hostname[sizeof(hostname)-1] = '\0';
+ XChangeProperty(SDL_Display, WMwindow, _NET_WM_PID, XA_CARDINAL, 32,
+ PropModeReplace, (unsigned char *)&pid, 1);
+ XChangeProperty(SDL_Display, WMwindow, WM_CLIENT_MACHINE, XA_STRING, 8,
+ PropModeReplace, (unsigned char *)hostname, SDL_strlen(hostname));
+ }
+ }
+
+ /* Setup the communication with the IM server */
+ /* create_aux_windows may be called several times against the same
+ Display. We should reuse the SDL_IM if one has been opened for
+ the Display, so we should not simply reset SDL_IM here. */
+
+ #ifdef X_HAVE_UTF8_STRING
+ if (SDL_X11_HAVE_UTF8) {
+ /* Discard obsolete resources if any. */
+ if (SDL_IM != NULL && SDL_Display != XDisplayOfIM(SDL_IM)) {
+ /* Just a double check. I don't think this
+ code is ever executed. */
+ SDL_SetError("display has changed while an IM is kept");
+ if (SDL_IC) {
+ XUnsetICFocus(SDL_IC);
+ XDestroyIC(SDL_IC);
+ SDL_IC = NULL;
+ }
+ XCloseIM(SDL_IM);
+ SDL_IM = NULL;
+ }
+
+ /* Open an input method. */
+ if (SDL_IM == NULL) {
+ char *old_locale = NULL, *old_modifiers = NULL;
+ const char *p;
+ size_t n;
+ /* I'm not comfortable to do locale setup
+ here. However, we need C library locale
+ (and xlib modifiers) to be set based on the
+ user's preference to use XIM, and many
+ existing game programs doesn't take care of
+ users' locale preferences, so someone other
+ than the game program should do it.
+ Moreover, ones say that some game programs
+ heavily rely on the C locale behaviour,
+ e.g., strcol()'s, and we can't change the C
+ library locale. Given the situation, I
+ couldn't find better place to do the
+ job... */
+
+ /* Save the current (application program's)
+ locale settings. */
+ p = setlocale(LC_ALL, NULL);
+ if ( p ) {
+ n = SDL_strlen(p)+1;
+ old_locale = SDL_stack_alloc(char, n);
+ if ( old_locale ) {
+ SDL_strlcpy(old_locale, p, n);
+ }
+ }
+ p = XSetLocaleModifiers(NULL);
+ if ( p ) {
+ n = SDL_strlen(p)+1;
+ old_modifiers = SDL_stack_alloc(char, n);
+ if ( old_modifiers ) {
+ SDL_strlcpy(old_modifiers, p, n);
+ }
+ }
+
+ /* Fetch the user's preferences and open the
+ input method with them. */
+ setlocale(LC_ALL, "");
+ XSetLocaleModifiers("");
+ SDL_IM = XOpenIM(SDL_Display, NULL, classname, classname);
+
+ /* Restore the application's locale settings
+ so that we don't break the application's
+ expected behaviour. */
+ if ( old_locale ) {
+ /* We need to restore the C library
+ locale first, since the
+ interpretation of the X modifier
+ may depend on it. */
+ setlocale(LC_ALL, old_locale);
+ SDL_stack_free(old_locale);
+ }
+ if ( old_modifiers ) {
+ XSetLocaleModifiers(old_modifiers);
+ SDL_stack_free(old_modifiers);
+ }
+ }
+
+ /* Create a new input context for the new window just created. */
+ if (SDL_IM == NULL) {
+ SDL_SetError("no input method could be opened");
+ } else {
+ if (SDL_IC != NULL) {
+ /* Discard the old IC before creating new one. */
+ XUnsetICFocus(SDL_IC);
+ XDestroyIC(SDL_IC);
+ }
+ /* Theoretically we should check the current IM supports
+ PreeditNothing+StatusNothing style (i.e., root window method)
+ before creating the IC. However, it is the bottom line method,
+ and we supports any other options. If the IM didn't support
+ root window method, the following call fails, and SDL falls
+ back to pre-XIM keyboard handling. */
+ SDL_IC = pXCreateIC(SDL_IM,
+ XNClientWindow, WMwindow,
+ XNFocusWindow, WMwindow,
+ XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
+ XNResourceName, classname,
+ XNResourceClass, classname,
+ NULL);
+
+ if (SDL_IC == NULL) {
+ SDL_SetError("no input context could be created");
+ XCloseIM(SDL_IM);
+ SDL_IM = NULL;
+ } else {
+ /* We need to receive X events that an IM wants and to pass
+ them to the IM through XFilterEvent. The set of events may
+ vary depending on the IM implementation and the options
+ specified through various routes. Although unlikely, the
+ xlib specification allows IM to change the event requirement
+ with its own circumstances, it is safe to call SelectInput
+ whenever we re-create an IC. */
+ unsigned long mask = 0;
+ char *ret = pXGetICValues(SDL_IC, XNFilterEvents, &mask, NULL);
+ if (ret != NULL) {
+ XUnsetICFocus(SDL_IC);
+ XDestroyIC(SDL_IC);
+ SDL_IC = NULL;
+ SDL_SetError("no input context could be created");
+ XCloseIM(SDL_IM);
+ SDL_IM = NULL;
+ } else {
+ XSelectInput(SDL_Display, WMwindow, app_event_mask | mask);
+ XSetICFocus(SDL_IC);
+ }
+ }
+ }
+ }
+ #endif
+
+ /* Allow the window to be deleted by the window manager */
+ XSetWMProtocols(SDL_Display, WMwindow, &WM_DELETE_WINDOW, 1);
+}
+
+static int X11_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ const char *env;
+ char *display;
+ int i;
+
+ /* Open the X11 display */
+ display = NULL; /* Get it from DISPLAY environment variable */
+
+ if ( (SDL_strncmp(XDisplayName(display), ":", 1) == 0) ||
+ (SDL_strncmp(XDisplayName(display), "unix:", 5) == 0) ) {
+ local_X11 = 1;
+ } else {
+ local_X11 = 0;
+ }
+ SDL_Display = XOpenDisplay(display);
+#if defined(__osf__) && defined(SDL_VIDEO_DRIVER_X11_DYNAMIC)
+ /* On Tru64 if linking without -lX11, it fails and you get following message.
+ * Xlib: connection to ":0.0" refused by server
+ * Xlib: XDM authorization key matches an existing client!
+ *
+ * It succeeds if retrying 1 second later
+ * or if running xhost +localhost on shell.
+ *
+ */
+ if ( SDL_Display == NULL ) {
+ SDL_Delay(1000);
+ SDL_Display = XOpenDisplay(display);
+ }
+#endif
+ if ( SDL_Display == NULL ) {
+ SDL_SetError("Couldn't open X11 display");
+ return(-1);
+ }
+#ifdef X11_DEBUG
+ XSynchronize(SDL_Display, True);
+#endif
+
+ /* Create an alternate X display for graphics updates -- allows us
+ to do graphics updates in a separate thread from event handling.
+ Thread-safe X11 doesn't seem to exist.
+ */
+ GFX_Display = XOpenDisplay(display);
+ if ( GFX_Display == NULL ) {
+ XCloseDisplay(SDL_Display);
+ SDL_Display = NULL;
+ SDL_SetError("Couldn't open X11 display");
+ return(-1);
+ }
+
+ /* Set the normal X error handler */
+ X_handler = XSetErrorHandler(x_errhandler);
+
+ /* Set the error handler if we lose the X display */
+ XIO_handler = XSetIOErrorHandler(xio_errhandler);
+
+ /* Set the X extension error handler */
+ Xext_handler = XSetExtensionErrorHandler(xext_errhandler);
+
+ /* use default screen (from $DISPLAY) */
+ SDL_Screen = DefaultScreen(SDL_Display);
+
+#ifndef NO_SHARED_MEMORY
+ /* Check for MIT shared memory extension */
+ use_mitshm = 0;
+ if ( local_X11 ) {
+ use_mitshm = XShmQueryExtension(SDL_Display);
+ }
+#endif /* NO_SHARED_MEMORY */
+
+ /* Get the available video modes */
+ if(X11_GetVideoModes(this) < 0) {
+ XCloseDisplay(GFX_Display);
+ GFX_Display = NULL;
+ XCloseDisplay(SDL_Display);
+ SDL_Display = NULL;
+ return -1;
+ }
+
+ /* Determine the current screen size */
+ this->info.current_w = DisplayWidth(SDL_Display, SDL_Screen);
+ this->info.current_h = DisplayHeight(SDL_Display, SDL_Screen);
+
+ /* Determine the default screen depth:
+ Use the default visual (or at least one with the same depth) */
+ SDL_DisplayColormap = DefaultColormap(SDL_Display, SDL_Screen);
+ for(i = 0; i < this->hidden->nvisuals; i++)
+ if(this->hidden->visuals[i].depth == DefaultDepth(SDL_Display,
+ SDL_Screen))
+ break;
+ if(i == this->hidden->nvisuals) {
+ /* default visual was useless, take the deepest one instead */
+ i = 0;
+ }
+ SDL_Visual = this->hidden->visuals[i].visual;
+ if ( SDL_Visual == DefaultVisual(SDL_Display, SDL_Screen) ) {
+ SDL_XColorMap = SDL_DisplayColormap;
+ } else {
+ SDL_XColorMap = XCreateColormap(SDL_Display, SDL_Root,
+ SDL_Visual, AllocNone);
+ }
+ this->hidden->depth = this->hidden->visuals[i].depth;
+ vformat->BitsPerPixel = this->hidden->visuals[i].bpp;
+ if ( vformat->BitsPerPixel > 8 ) {
+ vformat->Rmask = SDL_Visual->red_mask;
+ vformat->Gmask = SDL_Visual->green_mask;
+ vformat->Bmask = SDL_Visual->blue_mask;
+ }
+ if ( this->hidden->depth == 32 ) {
+ vformat->Amask = (0xFFFFFFFF & ~(vformat->Rmask|vformat->Gmask|vformat->Bmask));
+ }
+ X11_SaveVidModeGamma(this);
+
+ /* Allow environment override of screensaver disable. */
+ env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
+ if ( env ) {
+ allow_screensaver = SDL_atoi(env);
+ } else {
+#ifdef SDL_VIDEO_DISABLE_SCREENSAVER
+ allow_screensaver = 0;
+#else
+ allow_screensaver = 1;
+#endif
+ }
+
+ /* See if we have been passed a window to use */
+ SDL_windowid = SDL_getenv("SDL_WINDOWID");
+
+ /* Create the fullscreen and managed windows */
+ create_aux_windows(this);
+
+ /* Create the blank cursor */
+ SDL_BlankCursor = this->CreateWMCursor(this, blank_cdata, blank_cmask,
+ BLANK_CWIDTH, BLANK_CHEIGHT,
+ BLANK_CHOTX, BLANK_CHOTY);
+
+ /* Fill in some window manager capabilities */
+ this->info.wm_available = 1;
+
+ /* We're done! */
+ XFlush(SDL_Display);
+ return(0);
+}
+
+static void X11_DestroyWindow(_THIS, SDL_Surface *screen)
+{
+ /* Clean up OpenGL */
+ if ( screen ) {
+ screen->flags &= ~(SDL_OPENGL|SDL_OPENGLBLIT);
+ }
+ X11_GL_Shutdown(this);
+
+ if ( ! SDL_windowid ) {
+ /* Hide the managed window */
+ if ( WMwindow ) {
+ XUnmapWindow(SDL_Display, WMwindow);
+ }
+ if ( screen && (screen->flags & SDL_FULLSCREEN) ) {
+ screen->flags &= ~SDL_FULLSCREEN;
+ X11_LeaveFullScreen(this);
+ }
+
+ /* Destroy the output window */
+ if ( SDL_Window ) {
+ XDestroyWindow(SDL_Display, SDL_Window);
+ }
+
+ /* Free the colormap entries */
+ if ( SDL_XPixels ) {
+ int numcolors;
+ unsigned long pixel;
+ numcolors = SDL_Visual->map_entries;
+ for ( pixel=0; pixel<numcolors; ++pixel ) {
+ while ( SDL_XPixels[pixel] > 0 ) {
+ XFreeColors(GFX_Display,
+ SDL_DisplayColormap,&pixel,1,0);
+ --SDL_XPixels[pixel];
+ }
+ }
+ SDL_free(SDL_XPixels);
+ SDL_XPixels = NULL;
+ }
+
+ /* Free the graphics context */
+ if ( SDL_GC ) {
+ XFreeGC(SDL_Display, SDL_GC);
+ SDL_GC = 0;
+ }
+ }
+}
+
+static SDL_bool X11_WindowPosition(_THIS, int *x, int *y, int w, int h)
+{
+ const char *window = SDL_getenv("SDL_VIDEO_WINDOW_POS");
+ const char *center = SDL_getenv("SDL_VIDEO_CENTERED");
+ if ( window ) {
+ if ( SDL_sscanf(window, "%d,%d", x, y) == 2 ) {
+ return SDL_TRUE;
+ }
+ if ( SDL_strcmp(window, "center") == 0 ) {
+ center = window;
+ }
+ }
+ if ( center ) {
+ *x = (DisplayWidth(SDL_Display, SDL_Screen) - w)/2;
+ *y = (DisplayHeight(SDL_Display, SDL_Screen) - h)/2;
+ return SDL_TRUE;
+ }
+ return SDL_FALSE;
+}
+
+static void X11_SetSizeHints(_THIS, int w, int h, Uint32 flags)
+{
+ XSizeHints *hints;
+
+ hints = XAllocSizeHints();
+ if ( hints ) {
+ if (!(flags & SDL_RESIZABLE)) {
+ hints->min_width = hints->max_width = w;
+ hints->min_height = hints->max_height = h;
+ hints->flags = PMaxSize | PMinSize;
+ }
+ if ( flags & SDL_FULLSCREEN ) {
+ hints->x = 0;
+ hints->y = 0;
+ hints->flags |= USPosition;
+ } else
+ /* Center it, if desired */
+ if ( X11_WindowPosition(this, &hints->x, &hints->y, w, h) ) {
+ hints->flags |= USPosition;
+
+ /* Hints must be set before moving the window, otherwise an
+ unwanted ConfigureNotify event will be issued */
+ XSetWMNormalHints(SDL_Display, WMwindow, hints);
+
+ XMoveWindow(SDL_Display, WMwindow, hints->x, hints->y);
+
+ /* Flush the resize event so we don't catch it later */
+ XSync(SDL_Display, True);
+ }
+ XSetWMNormalHints(SDL_Display, WMwindow, hints);
+ XFree(hints);
+ }
+
+ /* Respect the window caption style */
+ if ( flags & SDL_NOFRAME ) {
+ SDL_bool set;
+ Atom WM_HINTS;
+
+ /* We haven't modified the window manager hints yet */
+ set = SDL_FALSE;
+
+ /* First try to set MWM hints */
+ WM_HINTS = XInternAtom(SDL_Display, "_MOTIF_WM_HINTS", True);
+ if ( WM_HINTS != None ) {
+ /* Hints used by Motif compliant window managers */
+ struct {
+ unsigned long flags;
+ unsigned long functions;
+ unsigned long decorations;
+ long input_mode;
+ unsigned long status;
+ } MWMHints = { (1L << 1), 0, 0, 0, 0 };
+
+ XChangeProperty(SDL_Display, WMwindow,
+ WM_HINTS, WM_HINTS, 32,
+ PropModeReplace,
+ (unsigned char *)&MWMHints,
+ sizeof(MWMHints)/sizeof(long));
+ set = SDL_TRUE;
+ }
+ /* Now try to set KWM hints */
+ WM_HINTS = XInternAtom(SDL_Display, "KWM_WIN_DECORATION", True);
+ if ( WM_HINTS != None ) {
+ long KWMHints = 0;
+
+ XChangeProperty(SDL_Display, WMwindow,
+ WM_HINTS, WM_HINTS, 32,
+ PropModeReplace,
+ (unsigned char *)&KWMHints,
+ sizeof(KWMHints)/sizeof(long));
+ set = SDL_TRUE;
+ }
+ /* Now try to set GNOME hints */
+ WM_HINTS = XInternAtom(SDL_Display, "_WIN_HINTS", True);
+ if ( WM_HINTS != None ) {
+ long GNOMEHints = 0;
+
+ XChangeProperty(SDL_Display, WMwindow,
+ WM_HINTS, WM_HINTS, 32,
+ PropModeReplace,
+ (unsigned char *)&GNOMEHints,
+ sizeof(GNOMEHints)/sizeof(long));
+ set = SDL_TRUE;
+ }
+ /* Finally set the transient hints if necessary */
+ if ( ! set ) {
+ XSetTransientForHint(SDL_Display, WMwindow, SDL_Root);
+ }
+ } else {
+ SDL_bool set;
+ Atom WM_HINTS;
+
+ /* We haven't modified the window manager hints yet */
+ set = SDL_FALSE;
+
+ /* First try to unset MWM hints */
+ WM_HINTS = XInternAtom(SDL_Display, "_MOTIF_WM_HINTS", True);
+ if ( WM_HINTS != None ) {
+ XDeleteProperty(SDL_Display, WMwindow, WM_HINTS);
+ set = SDL_TRUE;
+ }
+ /* Now try to unset KWM hints */
+ WM_HINTS = XInternAtom(SDL_Display, "KWM_WIN_DECORATION", True);
+ if ( WM_HINTS != None ) {
+ XDeleteProperty(SDL_Display, WMwindow, WM_HINTS);
+ set = SDL_TRUE;
+ }
+ /* Now try to unset GNOME hints */
+ WM_HINTS = XInternAtom(SDL_Display, "_WIN_HINTS", True);
+ if ( WM_HINTS != None ) {
+ XDeleteProperty(SDL_Display, WMwindow, WM_HINTS);
+ set = SDL_TRUE;
+ }
+ /* Finally unset the transient hints if necessary */
+ if ( ! set ) {
+ XDeleteProperty(SDL_Display, WMwindow, XA_WM_TRANSIENT_FOR);
+ }
+ }
+}
+
+static int X11_CreateWindow(_THIS, SDL_Surface *screen,
+ int w, int h, int bpp, Uint32 flags)
+{
+ int i, depth;
+ Visual *vis;
+ int vis_change;
+ Uint32 Amask;
+
+ /* If a window is already present, destroy it and start fresh */
+ if ( SDL_Window ) {
+ X11_DestroyWindow(this, screen);
+ switch_waiting = 0; /* Prevent jump back to now-meaningless state. */
+ }
+
+ /* See if we have been given a window id */
+ if ( SDL_windowid ) {
+ SDL_Window = SDL_strtol(SDL_windowid, NULL, 0);
+ } else {
+ SDL_Window = 0;
+ }
+
+ /* find out which visual we are going to use */
+ if ( flags & SDL_OPENGL ) {
+ XVisualInfo *vi;
+
+ vi = X11_GL_GetVisual(this);
+ if( !vi ) {
+ return -1;
+ }
+ vis = vi->visual;
+ depth = vi->depth;
+ } else if ( SDL_windowid ) {
+ XWindowAttributes a;
+
+ XGetWindowAttributes(SDL_Display, SDL_Window, &a);
+ vis = a.visual;
+ depth = a.depth;
+ } else {
+ for ( i = 0; i < this->hidden->nvisuals; i++ ) {
+ if ( this->hidden->visuals[i].bpp == bpp )
+ break;
+ }
+ if ( i == this->hidden->nvisuals ) {
+ SDL_SetError("No matching visual for requested depth");
+ return -1; /* should never happen */
+ }
+ vis = this->hidden->visuals[i].visual;
+ depth = this->hidden->visuals[i].depth;
+ }
+#ifdef X11_DEBUG
+ printf("Choosing %s visual at %d bpp - %d colormap entries\n", vis->class == PseudoColor ? "PseudoColor" : (vis->class == TrueColor ? "TrueColor" : (vis->class == DirectColor ? "DirectColor" : "Unknown")), depth, vis->map_entries);
+#endif
+ vis_change = (vis != SDL_Visual);
+ SDL_Visual = vis;
+ this->hidden->depth = depth;
+
+ /* Allocate the new pixel format for this video mode */
+ if ( this->hidden->depth == 32 ) {
+ Amask = (0xFFFFFFFF & ~(vis->red_mask|vis->green_mask|vis->blue_mask));
+ } else {
+ Amask = 0;
+ }
+ if ( ! SDL_ReallocFormat(screen, bpp,
+ vis->red_mask, vis->green_mask, vis->blue_mask, Amask) ) {
+ return -1;
+ }
+
+ /* Create the appropriate colormap */
+ if ( SDL_XColorMap != SDL_DisplayColormap ) {
+ XFreeColormap(SDL_Display, SDL_XColorMap);
+ }
+ if ( SDL_Visual->class == PseudoColor ) {
+ int ncolors;
+
+ /* Allocate the pixel flags */
+ ncolors = SDL_Visual->map_entries;
+ SDL_XPixels = SDL_malloc(ncolors * sizeof(int));
+ if(SDL_XPixels == NULL) {
+ SDL_OutOfMemory();
+ return -1;
+ }
+ SDL_memset(SDL_XPixels, 0, ncolors * sizeof(*SDL_XPixels));
+
+ /* always allocate a private colormap on non-default visuals */
+ if ( SDL_Visual != DefaultVisual(SDL_Display, SDL_Screen) ) {
+ flags |= SDL_HWPALETTE;
+ }
+ if ( flags & SDL_HWPALETTE ) {
+ screen->flags |= SDL_HWPALETTE;
+ SDL_XColorMap = XCreateColormap(SDL_Display, SDL_Root,
+ SDL_Visual, AllocAll);
+ } else {
+ SDL_XColorMap = SDL_DisplayColormap;
+ }
+ } else if ( SDL_Visual->class == DirectColor ) {
+
+ /* Create a colormap which we can manipulate for gamma */
+ SDL_XColorMap = XCreateColormap(SDL_Display, SDL_Root,
+ SDL_Visual, AllocAll);
+ XSync(SDL_Display, False);
+
+ /* Initialize the colormap to the identity mapping */
+ SDL_GetGammaRamp(0, 0, 0);
+ this->screen = screen;
+ X11_SetGammaRamp(this, this->gamma);
+ this->screen = NULL;
+ } else {
+ /* Create a read-only colormap for our window */
+ SDL_XColorMap = XCreateColormap(SDL_Display, SDL_Root,
+ SDL_Visual, AllocNone);
+ }
+
+ /* Recreate the auxiliary windows, if needed (required for GL) */
+ if ( vis_change )
+ create_aux_windows(this);
+
+ if(screen->flags & SDL_HWPALETTE) {
+ /* Since the full-screen window might have got a nonzero background
+ colour (0 is white on some displays), we should reset the
+ background to 0 here since that is what the user expects
+ with a private colormap */
+ XSetWindowBackground(SDL_Display, FSwindow, 0);
+ XClearWindow(SDL_Display, FSwindow);
+ }
+
+ /* resize the (possibly new) window manager window */
+ if( !SDL_windowid ) {
+ X11_SetSizeHints(this, w, h, flags);
+ window_w = w;
+ window_h = h;
+ XResizeWindow(SDL_Display, WMwindow, w, h);
+ }
+
+ /* Create (or use) the X11 display window */
+ if ( !SDL_windowid ) {
+ if ( flags & SDL_OPENGL ) {
+ if ( X11_GL_CreateWindow(this, w, h) < 0 ) {
+ return(-1);
+ }
+ } else {
+ XSetWindowAttributes swa;
+
+ swa.background_pixel = 0;
+ swa.border_pixel = 0;
+ swa.colormap = SDL_XColorMap;
+ SDL_Window = XCreateWindow(SDL_Display, WMwindow,
+ 0, 0, w, h, 0, depth,
+ InputOutput, SDL_Visual,
+ CWBackPixel | CWBorderPixel
+ | CWColormap, &swa);
+ }
+ /* Only manage our input if we own the window */
+ XSelectInput(SDL_Display, SDL_Window,
+ ( EnterWindowMask | LeaveWindowMask
+ | ButtonPressMask | ButtonReleaseMask
+ | PointerMotionMask | ExposureMask ));
+ }
+ /* Create the graphics context here, once we have a window */
+ if ( flags & SDL_OPENGL ) {
+ if ( X11_GL_CreateContext(this) < 0 ) {
+ return(-1);
+ } else {
+ screen->flags |= SDL_OPENGL;
+ }
+ } else {
+ XGCValues gcv;
+
+ gcv.graphics_exposures = False;
+ SDL_GC = XCreateGC(SDL_Display, SDL_Window,
+ GCGraphicsExposures, &gcv);
+ if ( ! SDL_GC ) {
+ SDL_SetError("Couldn't create graphics context");
+ return(-1);
+ }
+ }
+
+ /* Set our colormaps when not setting a GL mode */
+ if ( ! (flags & SDL_OPENGL) ) {
+ XSetWindowColormap(SDL_Display, SDL_Window, SDL_XColorMap);
+ if( !SDL_windowid ) {
+ XSetWindowColormap(SDL_Display, FSwindow, SDL_XColorMap);
+ XSetWindowColormap(SDL_Display, WMwindow, SDL_XColorMap);
+ }
+ }
+
+#if 0 /* This is an experiment - are the graphics faster now? - nope. */
+ if ( SDL_getenv("SDL_VIDEO_X11_BACKINGSTORE") )
+#endif
+ /* Cache the window in the server, when possible */
+ {
+ Screen *xscreen;
+ XSetWindowAttributes a;
+
+ xscreen = ScreenOfDisplay(SDL_Display, SDL_Screen);
+ a.backing_store = DoesBackingStore(xscreen);
+ if ( a.backing_store != NotUseful ) {
+ XChangeWindowAttributes(SDL_Display, SDL_Window,
+ CWBackingStore, &a);
+ }
+ }
+
+ /* Map them both and go fullscreen, if requested */
+ if ( ! SDL_windowid ) {
+ XMapWindow(SDL_Display, SDL_Window);
+ XMapWindow(SDL_Display, WMwindow);
+ X11_WaitMapped(this, WMwindow);
+ if ( flags & SDL_FULLSCREEN ) {
+ screen->flags |= SDL_FULLSCREEN;
+ X11_EnterFullScreen(this);
+ } else {
+ screen->flags &= ~SDL_FULLSCREEN;
+ }
+ }
+
+ return(0);
+}
+
+static int X11_ResizeWindow(_THIS,
+ SDL_Surface *screen, int w, int h, Uint32 flags)
+{
+ if ( ! SDL_windowid ) {
+ /* Resize the window manager window */
+ X11_SetSizeHints(this, w, h, flags);
+ window_w = w;
+ window_h = h;
+ XResizeWindow(SDL_Display, WMwindow, w, h);
+
+ /* Resize the fullscreen and display windows */
+ if ( flags & SDL_FULLSCREEN ) {
+ if ( screen->flags & SDL_FULLSCREEN ) {
+ X11_ResizeFullScreen(this);
+ } else {
+ screen->flags |= SDL_FULLSCREEN;
+ X11_EnterFullScreen(this);
+ }
+ } else {
+ if ( screen->flags & SDL_FULLSCREEN ) {
+ screen->flags &= ~SDL_FULLSCREEN;
+ X11_LeaveFullScreen(this);
+ }
+ }
+ XResizeWindow(SDL_Display, SDL_Window, w, h);
+ }
+ return(0);
+}
+
+SDL_Surface *X11_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ Uint32 saved_flags;
+
+ /* Lock the event thread, in multi-threading environments */
+ SDL_Lock_EventThread();
+
+ /* Check the combination of flags we were passed */
+ if ( flags & SDL_FULLSCREEN ) {
+ /* Clear fullscreen flag if not supported */
+ if ( SDL_windowid ) {
+ flags &= ~SDL_FULLSCREEN;
+ }
+ }
+
+ /* Flush any delayed updates */
+ XSync(GFX_Display, False);
+
+ /* Set up the X11 window */
+ saved_flags = current->flags;
+ if ( (SDL_Window) && ((saved_flags&SDL_OPENGL) == (flags&SDL_OPENGL))
+ && (bpp == current->format->BitsPerPixel)
+ && ((saved_flags&SDL_NOFRAME) == (flags&SDL_NOFRAME)) ) {
+ if (X11_ResizeWindow(this, current, width, height, flags) < 0) {
+ current = NULL;
+ goto done;
+ }
+ X11_PendingConfigureNotifyWidth = width;
+ X11_PendingConfigureNotifyHeight = height;
+ } else {
+ if (X11_CreateWindow(this,current,width,height,bpp,flags) < 0) {
+ current = NULL;
+ goto done;
+ }
+ }
+
+ /* Update the internal keyboard state */
+ X11_SetKeyboardState(SDL_Display, NULL);
+
+ /* When the window is first mapped, ignore non-modifier keys */
+ if ( !current->w && !current->h ) {
+ Uint8 *keys = SDL_GetKeyState(NULL);
+ int i;
+ for ( i = 0; i < SDLK_LAST; ++i ) {
+ switch (i) {
+ case SDLK_NUMLOCK:
+ case SDLK_CAPSLOCK:
+ case SDLK_LCTRL:
+ case SDLK_RCTRL:
+ case SDLK_LSHIFT:
+ case SDLK_RSHIFT:
+ case SDLK_LALT:
+ case SDLK_RALT:
+ case SDLK_LMETA:
+ case SDLK_RMETA:
+ case SDLK_MODE:
+ break;
+ default:
+ keys[i] = SDL_RELEASED;
+ break;
+ }
+ }
+ }
+
+ /* Set up the new mode framebuffer */
+ if ( ((current->w != width) || (current->h != height)) ||
+ ((saved_flags&SDL_OPENGL) != (flags&SDL_OPENGL)) ) {
+ current->w = width;
+ current->h = height;
+ current->pitch = SDL_CalculatePitch(current);
+ if (X11_ResizeImage(this, current, flags) < 0) {
+ current = NULL;
+ goto done;
+ }
+ }
+
+ /* Clear these flags and set them only if they are in the new set. */
+ current->flags &= ~(SDL_RESIZABLE|SDL_NOFRAME);
+ current->flags |= (flags&(SDL_RESIZABLE|SDL_NOFRAME));
+
+ done:
+ /* Release the event thread */
+ XSync(SDL_Display, False);
+ SDL_Unlock_EventThread();
+
+ /* We're done! */
+ return(current);
+}
+
+static int X11_ToggleFullScreen(_THIS, int on)
+{
+ Uint32 event_thread;
+
+ /* Don't switch if we don't own the window */
+ if ( SDL_windowid ) {
+ return(0);
+ }
+
+ /* Don't lock if we are the event thread */
+ event_thread = SDL_EventThreadID();
+ if ( event_thread && (SDL_ThreadID() == event_thread) ) {
+ event_thread = 0;
+ }
+ if ( event_thread ) {
+ SDL_Lock_EventThread();
+ }
+ if ( on ) {
+ this->screen->flags |= SDL_FULLSCREEN;
+ X11_EnterFullScreen(this);
+ } else {
+ this->screen->flags &= ~SDL_FULLSCREEN;
+ X11_LeaveFullScreen(this);
+ }
+ X11_RefreshDisplay(this);
+ if ( event_thread ) {
+ SDL_Unlock_EventThread();
+ }
+ SDL_ResetKeyboard();
+ return(1);
+}
+
+/* Update the current mouse state and position */
+static void X11_UpdateMouse(_THIS)
+{
+ Window u1; int u2;
+ Window current_win;
+ int x, y;
+ unsigned int mask;
+
+ /* Lock the event thread, in multi-threading environments */
+ SDL_Lock_EventThread();
+ if ( XQueryPointer(SDL_Display, SDL_Window, &u1, &current_win,
+ &u2, &u2, &x, &y, &mask) ) {
+ if ( (x >= 0) && (x < SDL_VideoSurface->w) &&
+ (y >= 0) && (y < SDL_VideoSurface->h) ) {
+ SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
+ SDL_PrivateMouseMotion(0, 0, x, y);
+ } else {
+ SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
+ }
+ }
+ SDL_Unlock_EventThread();
+}
+
+/* simple colour distance metric. Supposed to be better than a plain
+ Euclidian distance anyway. */
+#define COLOUR_FACTOR 3
+#define LIGHT_FACTOR 1
+#define COLOUR_DIST(r1, g1, b1, r2, g2, b2) \
+ (COLOUR_FACTOR * (abs(r1 - r2) + abs(g1 - g2) + abs(b1 - b2)) \
+ + LIGHT_FACTOR * abs(r1 + g1 + b1 - (r2 + g2 + b2)))
+
+static void allocate_nearest(_THIS, SDL_Color *colors,
+ SDL_Color *want, int nwant)
+{
+ /*
+ * There is no way to know which ones to choose from, so we retrieve
+ * the entire colormap and try the nearest possible, until we find one
+ * that is shared.
+ */
+ XColor all[256];
+ int i;
+ for(i = 0; i < 256; i++)
+ all[i].pixel = i;
+ /*
+ * XQueryColors sets the flags in the XColor struct, so we use
+ * that to keep track of which colours are available
+ */
+ XQueryColors(GFX_Display, SDL_XColorMap, all, 256);
+
+ for(i = 0; i < nwant; i++) {
+ XColor *c;
+ int j;
+ int best = 0;
+ int mindist = 0x7fffffff;
+ int ri = want[i].r;
+ int gi = want[i].g;
+ int bi = want[i].b;
+ for(j = 0; j < 256; j++) {
+ int rj, gj, bj, d2;
+ if(!all[j].flags)
+ continue; /* unavailable colour cell */
+ rj = all[j].red >> 8;
+ gj = all[j].green >> 8;
+ bj = all[j].blue >> 8;
+ d2 = COLOUR_DIST(ri, gi, bi, rj, gj, bj);
+ if(d2 < mindist) {
+ mindist = d2;
+ best = j;
+ }
+ }
+ if(SDL_XPixels[best])
+ continue; /* already allocated, waste no more time */
+ c = all + best;
+ if(XAllocColor(GFX_Display, SDL_XColorMap, c)) {
+ /* got it */
+ colors[c->pixel].r = c->red >> 8;
+ colors[c->pixel].g = c->green >> 8;
+ colors[c->pixel].b = c->blue >> 8;
+ ++SDL_XPixels[c->pixel];
+ } else {
+ /*
+ * The colour couldn't be allocated, probably being
+ * owned as a r/w cell by another client. Flag it as
+ * unavailable and try again. The termination of the
+ * loop is guaranteed since at least black and white
+ * are always there.
+ */
+ c->flags = 0;
+ i--;
+ }
+ }
+}
+
+int X11_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+ int nrej = 0;
+
+ /* Check to make sure we have a colormap allocated */
+ if ( SDL_XPixels == NULL ) {
+ return(0);
+ }
+ if ( (this->screen->flags & SDL_HWPALETTE) == SDL_HWPALETTE ) {
+ /* private writable colormap: just set the colours we need */
+ XColor *xcmap;
+ int i;
+ xcmap = SDL_stack_alloc(XColor, ncolors);
+ if(xcmap == NULL)
+ return 0;
+ for ( i=0; i<ncolors; ++i ) {
+ xcmap[i].pixel = i + firstcolor;
+ xcmap[i].red = (colors[i].r<<8)|colors[i].r;
+ xcmap[i].green = (colors[i].g<<8)|colors[i].g;
+ xcmap[i].blue = (colors[i].b<<8)|colors[i].b;
+ xcmap[i].flags = (DoRed|DoGreen|DoBlue);
+ }
+ XStoreColors(GFX_Display, SDL_XColorMap, xcmap, ncolors);
+ XSync(GFX_Display, False);
+ SDL_stack_free(xcmap);
+ } else {
+ /*
+ * Shared colormap: We only allocate read-only cells, which
+ * increases the likelyhood of colour sharing with other
+ * clients. The pixel values will almost certainly be
+ * different from the requested ones, so the user has to
+ * walk the colormap and see which index got what colour.
+ *
+ * We can work directly with the logical palette since it
+ * has already been set when we get here.
+ */
+ SDL_Color *want, *reject;
+ unsigned long *freelist;
+ int i;
+ int nfree = 0;
+ int nc = this->screen->format->palette->ncolors;
+ colors = this->screen->format->palette->colors;
+ freelist = SDL_stack_alloc(unsigned long, nc);
+ /* make sure multiple allocations of the same cell are freed */
+ for(i = 0; i < ncolors; i++) {
+ int pixel = firstcolor + i;
+ while(SDL_XPixels[pixel]) {
+ freelist[nfree++] = pixel;
+ --SDL_XPixels[pixel];
+ }
+ }
+ XFreeColors(GFX_Display, SDL_XColorMap, freelist, nfree, 0);
+ SDL_stack_free(freelist);
+
+ want = SDL_stack_alloc(SDL_Color, ncolors);
+ reject = SDL_stack_alloc(SDL_Color, ncolors);
+ SDL_memcpy(want, colors + firstcolor, ncolors * sizeof(SDL_Color));
+ /* make sure the user isn't fooled by her own wishes
+ (black is safe, always available in the default colormap) */
+ SDL_memset(colors + firstcolor, 0, ncolors * sizeof(SDL_Color));
+
+ /* now try to allocate the colours */
+ for(i = 0; i < ncolors; i++) {
+ XColor col;
+ col.red = want[i].r << 8;
+ col.green = want[i].g << 8;
+ col.blue = want[i].b << 8;
+ col.flags = DoRed | DoGreen | DoBlue;
+ if(XAllocColor(GFX_Display, SDL_XColorMap, &col)) {
+ /* We got the colour, or at least the nearest
+ the hardware could get. */
+ colors[col.pixel].r = col.red >> 8;
+ colors[col.pixel].g = col.green >> 8;
+ colors[col.pixel].b = col.blue >> 8;
+ ++SDL_XPixels[col.pixel];
+ } else {
+ /*
+ * no more free cells, add it to the list
+ * of rejected colours
+ */
+ reject[nrej++] = want[i];
+ }
+ }
+ if(nrej)
+ allocate_nearest(this, colors, reject, nrej);
+ SDL_stack_free(reject);
+ SDL_stack_free(want);
+ }
+ return nrej == 0;
+}
+
+int X11_SetGammaRamp(_THIS, Uint16 *ramp)
+{
+ int i, ncolors;
+ XColor xcmap[256];
+
+ /* See if actually setting the gamma is supported */
+ if ( SDL_Visual->class != DirectColor ) {
+ SDL_SetError("Gamma correction not supported on this visual");
+ return(-1);
+ }
+
+ /* Calculate the appropriate palette for the given gamma ramp */
+ ncolors = SDL_Visual->map_entries;
+ for ( i=0; i<ncolors; ++i ) {
+ Uint8 c = (256 * i / ncolors);
+ xcmap[i].pixel = SDL_MapRGB(this->screen->format, c, c, c);
+ xcmap[i].red = ramp[0*256+c];
+ xcmap[i].green = ramp[1*256+c];
+ xcmap[i].blue = ramp[2*256+c];
+ xcmap[i].flags = (DoRed|DoGreen|DoBlue);
+ }
+ XStoreColors(GFX_Display, SDL_XColorMap, xcmap, ncolors);
+ XSync(GFX_Display, False);
+ return(0);
+}
+
+/* Note: If we are terminated, this could be called in the middle of
+ another SDL video routine -- notably UpdateRects.
+*/
+void X11_VideoQuit(_THIS)
+{
+ /* Shutdown everything that's still up */
+ /* The event thread should be done, so we can touch SDL_Display */
+ if ( SDL_Display != NULL ) {
+ /* Flush any delayed updates */
+ XSync(GFX_Display, False);
+
+ /* Close the connection with the IM server */
+ #ifdef X_HAVE_UTF8_STRING
+ if (SDL_IC != NULL) {
+ XUnsetICFocus(SDL_IC);
+ XDestroyIC(SDL_IC);
+ SDL_IC = NULL;
+ }
+ if (SDL_IM != NULL) {
+ XCloseIM(SDL_IM);
+ SDL_IM = NULL;
+ }
+ #endif
+
+ /* Start shutting down the windows */
+ X11_DestroyImage(this, this->screen);
+ X11_DestroyWindow(this, this->screen);
+ X11_FreeVideoModes(this);
+ if ( SDL_XColorMap != SDL_DisplayColormap ) {
+ XFreeColormap(SDL_Display, SDL_XColorMap);
+ }
+ if ( SDL_iconcolors ) {
+ unsigned long pixel;
+ Colormap dcmap = DefaultColormap(SDL_Display,
+ SDL_Screen);
+ for(pixel = 0; pixel < 256; ++pixel) {
+ while(SDL_iconcolors[pixel] > 0) {
+ XFreeColors(GFX_Display,
+ dcmap, &pixel, 1, 0);
+ --SDL_iconcolors[pixel];
+ }
+ }
+ SDL_free(SDL_iconcolors);
+ SDL_iconcolors = NULL;
+ }
+
+ /* Restore gamma settings if they've changed */
+ if ( SDL_GetAppState() & SDL_APPACTIVE ) {
+ X11_SwapVidModeGamma(this);
+ }
+
+ /* Free that blank cursor */
+ if ( SDL_BlankCursor != NULL ) {
+ this->FreeWMCursor(this, SDL_BlankCursor);
+ SDL_BlankCursor = NULL;
+ }
+
+ /* Close the X11 graphics connection */
+ if ( GFX_Display != NULL ) {
+ XCloseDisplay(GFX_Display);
+ GFX_Display = NULL;
+ }
+
+ /* Close the X11 display connection */
+ XCloseDisplay(SDL_Display);
+ SDL_Display = NULL;
+
+ /* Reset the X11 error handlers */
+ if ( XIO_handler ) {
+ XSetIOErrorHandler(XIO_handler);
+ }
+ if ( X_handler ) {
+ XSetErrorHandler(X_handler);
+ }
+
+ /* Unload GL library after X11 shuts down */
+ X11_GL_UnloadLibrary(this);
+ }
+ if ( this->screen && (this->screen->flags & SDL_HWSURFACE) ) {
+ /* Direct screen access, no memory buffer */
+ this->screen->pixels = NULL;
+ }
+
+#if SDL_VIDEO_DRIVER_X11_XME
+ XiGMiscDestroy();
+#endif
+}
+
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11video.h b/distrib/sdl-1.2.15/src/video/x11/SDL_x11video.h
new file mode 100644
index 0000000..18cf497
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11video.h
@@ -0,0 +1,217 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_x11video_h
+#define _SDL_x11video_h
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/Xatom.h>
+
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+
+#if SDL_VIDEO_DRIVER_X11_DGAMOUSE
+#include "../Xext/extensions/xf86dga.h"
+#endif
+#if SDL_VIDEO_DRIVER_X11_XINERAMA
+#include "../Xext/extensions/Xinerama.h"
+#endif
+#if SDL_VIDEO_DRIVER_X11_XRANDR
+#include <X11/extensions/Xrandr.h>
+#endif
+#if SDL_VIDEO_DRIVER_X11_VIDMODE
+#include "../Xext/extensions/xf86vmode.h"
+#endif
+#if SDL_VIDEO_DRIVER_X11_XME
+#include "../Xext/extensions/xme.h"
+#endif
+
+#include "SDL_x11dyn.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+/* Private display data */
+struct SDL_PrivateVideoData {
+ int local_X11; /* Flag: true if local display */
+ Display *X11_Display; /* Used for events and window management */
+ Display *GFX_Display; /* Used for graphics and colormap stuff */
+ Visual *SDL_Visual; /* The visual used by our window */
+ Window WMwindow; /* Input window, managed by window manager */
+ Window FSwindow; /* Fullscreen window, completely unmanaged */
+ Window SDL_Window; /* Shared by both displays (no X security?) */
+ Atom WM_DELETE_WINDOW; /* "close-window" protocol atom */
+ WMcursor *BlankCursor; /* The invisible cursor */
+ XIM X11_IM; /* Used to communicate with the input method (IM) server */
+ XIC X11_IC; /* Used for retaining the state, properties, and semantics of communication with the input method (IM) server */
+
+ char *SDL_windowid; /* Flag: true if we have been passed a window */
+
+ /* Direct Graphics Access extension information */
+ int using_dga;
+
+#ifndef NO_SHARED_MEMORY
+ /* MIT shared memory extension information */
+ int use_mitshm;
+ XShmSegmentInfo shminfo;
+#endif
+
+ /* The variables used for displaying graphics */
+ XImage *Ximage; /* The X image for our window */
+ GC gc; /* The graphic context for drawing */
+
+ /* The current width and height of the fullscreen mode */
+ int window_w;
+ int window_h;
+
+ /* Support for internal mouse warping */
+ struct {
+ int x;
+ int y;
+ } mouse_last;
+ struct {
+ int numerator;
+ int denominator;
+ int threshold;
+ } mouse_accel;
+ int mouse_relative;
+
+ /* The current list of available video modes */
+ SDL_Rect **modelist;
+
+ /* available visuals of interest to us, sorted deepest first */
+ struct {
+ Visual *visual;
+ int depth; /* number of significant bits/pixel */
+ int bpp; /* pixel quantum in bits */
+ } visuals[2*5]; /* at most 2 entries for 8, 15, 16, 24, 32 */
+ int nvisuals;
+
+ Visual *vis; /* current visual in use */
+ int depth; /* current visual depth (not bpp) */
+
+ /* Variables used by the X11 video mode code */
+#if SDL_VIDEO_DRIVER_X11_XINERAMA
+ SDL_NAME(XineramaScreenInfo) xinerama_info;
+#endif
+#if SDL_VIDEO_DRIVER_X11_XRANDR
+ XRRScreenConfiguration* screen_config;
+ int saved_size_id;
+ Rotation saved_rotation;
+#endif
+#if SDL_VIDEO_DRIVER_X11_VIDMODE
+ SDL_NAME(XF86VidModeModeInfo) saved_mode;
+ struct {
+ int x, y;
+ } saved_view;
+#endif
+#if SDL_VIDEO_DRIVER_X11_XME /* XiG XME fullscreen */
+ XiGMiscResolutionInfo saved_res;
+#endif
+
+ int use_xinerama;
+ int use_xrandr;
+ int use_vidmode;
+ int use_xme;
+ int currently_fullscreen;
+
+ /* Automatic mode switching support (entering/leaving fullscreen) */
+ Uint32 switch_waiting;
+ Uint32 switch_time;
+
+ /* Prevent too many XSync() calls */
+ int blit_queued;
+
+ /* Colormap handling */
+ Colormap DisplayColormap; /* The default display colormap */
+ Colormap XColorMap; /* The current window colormap */
+ int *XPixels; /* pixels value allocation counts */
+ float gamma_saved[3]; /* Saved gamma values for VidMode gamma */
+ int gamma_changed; /* flag: has VidMode gamma been modified? */
+
+ short *iconcolors; /* List of colors used by the icon */
+
+ /* Screensaver settings */
+ int allow_screensaver;
+};
+
+extern int X11_wmXAdjust;
+extern int X11_wmYAdjust;
+
+/* Old variable names */
+#define local_X11 (this->hidden->local_X11)
+#define SDL_Display (this->hidden->X11_Display)
+#define GFX_Display (this->hidden->GFX_Display)
+#define SDL_Screen DefaultScreen(this->hidden->X11_Display)
+#define SDL_Visual (this->hidden->vis)
+#define SDL_Root RootWindow(SDL_Display, SDL_Screen)
+#define WMwindow (this->hidden->WMwindow)
+#define FSwindow (this->hidden->FSwindow)
+#define SDL_Window (this->hidden->SDL_Window)
+#define WM_DELETE_WINDOW (this->hidden->WM_DELETE_WINDOW)
+#define SDL_BlankCursor (this->hidden->BlankCursor)
+#define SDL_IM (this->hidden->X11_IM)
+#define SDL_IC (this->hidden->X11_IC)
+#define SDL_windowid (this->hidden->SDL_windowid)
+#define using_dga (this->hidden->using_dga)
+#define use_mitshm (this->hidden->use_mitshm)
+#define shminfo (this->hidden->shminfo)
+#define SDL_Ximage (this->hidden->Ximage)
+#define SDL_GC (this->hidden->gc)
+#define window_w (this->hidden->window_w)
+#define window_h (this->hidden->window_h)
+#define mouse_last (this->hidden->mouse_last)
+#define mouse_accel (this->hidden->mouse_accel)
+#define mouse_relative (this->hidden->mouse_relative)
+#define SDL_modelist (this->hidden->modelist)
+#define xinerama_info (this->hidden->xinerama_info)
+#define saved_mode (this->hidden->saved_mode)
+#define saved_view (this->hidden->saved_view)
+#define saved_res (this->hidden->saved_res)
+#define screen_config (this->hidden->screen_config)
+#define saved_size_id (this->hidden->saved_size_id)
+#define saved_rotation (this->hidden->saved_rotation)
+#define use_xinerama (this->hidden->use_xinerama)
+#define use_vidmode (this->hidden->use_vidmode)
+#define use_xrandr (this->hidden->use_xrandr)
+#define use_xme (this->hidden->use_xme)
+#define currently_fullscreen (this->hidden->currently_fullscreen)
+#define switch_waiting (this->hidden->switch_waiting)
+#define switch_time (this->hidden->switch_time)
+#define blit_queued (this->hidden->blit_queued)
+#define SDL_DisplayColormap (this->hidden->DisplayColormap)
+#define SDL_PrivateColormap (this->hidden->PrivateColormap)
+#define SDL_XColorMap (this->hidden->XColorMap)
+#define SDL_XPixels (this->hidden->XPixels)
+#define gamma_saved (this->hidden->gamma_saved)
+#define gamma_changed (this->hidden->gamma_changed)
+#define SDL_iconcolors (this->hidden->iconcolors)
+#define allow_screensaver (this->hidden->allow_screensaver)
+
+/* Some versions of XFree86 have bugs - detect if this is one of them */
+#define BUGGY_XFREE86(condition, buggy_version) \
+((SDL_strcmp(ServerVendor(SDL_Display), "The XFree86 Project, Inc") == 0) && \
+ (VendorRelease(SDL_Display) condition buggy_version))
+
+#endif /* _SDL_x11video_h */
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11wm.c b/distrib/sdl-1.2.15/src/video/x11/SDL_x11wm.c
new file mode 100644
index 0000000..2fd59e9
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11wm.c
@@ -0,0 +1,620 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+#include "SDL_version.h"
+#include "SDL_timer.h"
+#include "SDL_video.h"
+#include "SDL_syswm.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+#include "SDL_x11modes_c.h"
+#include "SDL_x11wm_c.h"
+
+static Uint8 reverse_byte(Uint8 x)
+{
+ x = (x & 0xaa) >> 1 | (x & 0x55) << 1;
+ x = (x & 0xcc) >> 2 | (x & 0x33) << 2;
+ x = (x & 0xf0) >> 4 | (x & 0x0f) << 4;
+ return x;
+}
+
+void X11_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask)
+{
+ SDL_Surface *sicon;
+ XWMHints *wmhints;
+ XImage *icon_image;
+ Pixmap icon_pixmap;
+ Pixmap mask_pixmap;
+ Window icon_window = None;
+ GC gc;
+ XGCValues GCvalues;
+ int i, dbpp;
+ SDL_Rect bounds;
+ Uint8 *LSBmask;
+ Visual *dvis;
+ char *p;
+ int masksize;
+
+ SDL_Lock_EventThread();
+
+ /* The icon must use the default visual, depth and colormap of the
+ screen, so it might need a conversion */
+ dvis = DefaultVisual(SDL_Display, SDL_Screen);
+ dbpp = DefaultDepth(SDL_Display, SDL_Screen);
+ for(i = 0; i < this->hidden->nvisuals; i++) {
+ if(this->hidden->visuals[i].visual == dvis) {
+ dbpp = this->hidden->visuals[i].bpp;
+ break;
+ }
+ }
+
+ /* The Visual struct is supposed to be opaque but we cheat a little */
+ sicon = SDL_CreateRGBSurface(SDL_SWSURFACE, icon->w, icon->h,
+ dbpp,
+ dvis->red_mask, dvis->green_mask,
+ dvis->blue_mask, 0);
+ if ( sicon == NULL )
+ goto done;
+
+ if(dbpp == 8) {
+ /* Default visual is 8bit; we need to allocate colours from
+ the default colormap */
+ SDL_Color want[256], got[256];
+ int nwant;
+ Colormap dcmap;
+ int missing;
+ dcmap = DefaultColormap(SDL_Display, SDL_Screen);
+ if(icon->format->palette) {
+ /* The icon has a palette as well - we just have to
+ find those colours */
+ nwant = icon->format->palette->ncolors;
+ SDL_memcpy(want, icon->format->palette->colors,
+ nwant * sizeof want[0]);
+ } else {
+ /* try the standard 6x6x6 cube for lack of better
+ ideas */
+ int r, g, b, i;
+ for(r = i = 0; r < 256; r += 0x33)
+ for(g = 0; g < 256; g += 0x33)
+ for(b = 0; b < 256; b += 0x33, i++) {
+ want[i].r = r;
+ want[i].g = g;
+ want[i].b = b;
+ }
+ nwant = 216;
+ }
+ if(SDL_iconcolors) {
+ /* free already allocated colours first */
+ unsigned long freelist[512];
+ int nfree = 0;
+ for(i = 0; i < 256; i++) {
+ while(SDL_iconcolors[i]) {
+ freelist[nfree++] = i;
+ SDL_iconcolors[i]--;
+ }
+ }
+ XFreeColors(GFX_Display, dcmap, freelist, nfree, 0);
+ }
+ if(!SDL_iconcolors)
+ SDL_iconcolors = SDL_malloc(256 * sizeof *SDL_iconcolors);
+ SDL_memset(SDL_iconcolors, 0, 256 * sizeof *SDL_iconcolors);
+
+ /* try to allocate the colours */
+ SDL_memset(got, 0, sizeof got);
+ missing = 0;
+ for(i = 0; i < nwant; i++) {
+ XColor c;
+ c.red = want[i].r << 8;
+ c.green = want[i].g << 8;
+ c.blue = want[i].b << 8;
+ c.flags = DoRed | DoGreen | DoBlue;
+ if(XAllocColor(GFX_Display, dcmap, &c)) {
+ /* got the colour */
+ SDL_iconcolors[c.pixel]++;
+ got[c.pixel] = want[i];
+ } else {
+ missing = 1;
+ }
+ }
+ if(missing) {
+ /* Some colours were apparently missing, so we just
+ allocate all the rest as well */
+ XColor cols[256];
+ for(i = 0; i < 256; i++)
+ cols[i].pixel = i;
+ XQueryColors(GFX_Display, dcmap, cols, 256);
+ for(i = 0; i < 256; i++) {
+ got[i].r = cols[i].red >> 8;
+ got[i].g = cols[i].green >> 8;
+ got[i].b = cols[i].blue >> 8;
+ if(!SDL_iconcolors[i]) {
+ if(XAllocColor(GFX_Display, dcmap,
+ cols + i)) {
+ SDL_iconcolors[i] = 1;
+ } else {
+ /* index not available */
+ got[i].r = 0;
+ got[i].g = 0;
+ got[i].b = 0;
+ }
+ }
+ }
+ }
+
+ SDL_SetColors(sicon, got, 0, 256);
+ }
+
+ bounds.x = 0;
+ bounds.y = 0;
+ bounds.w = icon->w;
+ bounds.h = icon->h;
+ if ( SDL_LowerBlit(icon, &bounds, sicon, &bounds) < 0 )
+ goto done;
+
+ /* We need the mask as given, except in LSBfirst format instead of
+ MSBfirst. Reverse the bits in each byte. */
+ masksize = ((sicon->w + 7) >> 3) * sicon->h;
+ LSBmask = SDL_malloc(masksize);
+ if ( LSBmask == NULL ) {
+ goto done;
+ }
+ SDL_memset(LSBmask, 0, masksize);
+ for(i = 0; i < masksize; i++)
+ LSBmask[i] = reverse_byte(mask[i]);
+ mask_pixmap = XCreatePixmapFromBitmapData(SDL_Display, WMwindow,
+ (char *)LSBmask,
+ sicon->w, sicon->h,
+ 1L, 0L, 1);
+
+ /* Transfer the image to an X11 pixmap */
+ icon_image = XCreateImage(SDL_Display,
+ DefaultVisual(SDL_Display, SDL_Screen),
+ DefaultDepth(SDL_Display, SDL_Screen),
+ ZPixmap, 0, sicon->pixels,
+ sicon->w, sicon->h,
+ 32, 0);
+ icon_image->byte_order = (SDL_BYTEORDER == SDL_BIG_ENDIAN)
+ ? MSBFirst : LSBFirst;
+ icon_pixmap = XCreatePixmap(SDL_Display, SDL_Root, sicon->w, sicon->h,
+ DefaultDepth(SDL_Display, SDL_Screen));
+ gc = XCreateGC(SDL_Display, icon_pixmap, 0, &GCvalues);
+ XPutImage(SDL_Display, icon_pixmap, gc, icon_image,
+ 0, 0, 0, 0, sicon->w, sicon->h);
+ XFreeGC(SDL_Display, gc);
+ XDestroyImage(icon_image);
+ SDL_free(LSBmask);
+ sicon->pixels = NULL;
+
+ /* Some buggy window managers (some versions of Enlightenment, it
+ seems) need an icon window *and* icon pixmap to work properly, while
+ it screws up others. The default is only to use a pixmap. */
+ p = SDL_getenv("SDL_VIDEO_X11_ICONWIN");
+ if(p && *p) {
+ icon_window = XCreateSimpleWindow(SDL_Display, SDL_Root,
+ 0, 0, sicon->w, sicon->h, 0,
+ CopyFromParent,
+ CopyFromParent);
+ XSetWindowBackgroundPixmap(SDL_Display, icon_window,
+ icon_pixmap);
+ XClearWindow(SDL_Display, icon_window);
+ }
+
+ /* Set the window icon to the icon pixmap (and icon window) */
+ wmhints = XAllocWMHints();
+ wmhints->flags = (IconPixmapHint | IconMaskHint | InputHint);
+ wmhints->icon_pixmap = icon_pixmap;
+ wmhints->icon_mask = mask_pixmap;
+ wmhints->input = True;
+ if(icon_window != None) {
+ wmhints->flags |= IconWindowHint;
+ wmhints->icon_window = icon_window;
+ }
+ XSetWMHints(SDL_Display, WMwindow, wmhints);
+ XFree(wmhints);
+ XSync(SDL_Display, False);
+
+ done:
+ SDL_Unlock_EventThread();
+ SDL_FreeSurface(sicon);
+}
+
+void X11_SetCaptionNoLock(_THIS, const char *title, const char *icon)
+{
+ XTextProperty titleprop, iconprop;
+ Status status;
+
+#ifdef X_HAVE_UTF8_STRING
+ Atom _NET_WM_NAME = 0;
+ Atom _NET_WM_ICON_NAME = 0;
+
+ /* Look up some useful Atoms */
+ if (SDL_X11_HAVE_UTF8) {
+ _NET_WM_NAME = XInternAtom(SDL_Display, "_NET_WM_NAME", False);
+ _NET_WM_ICON_NAME = XInternAtom(SDL_Display, "_NET_WM_ICON_NAME", False);
+ }
+#endif
+
+ if ( title != NULL ) {
+ char *title_locale = SDL_iconv_utf8_locale(title);
+ if ( !title_locale ) {
+ SDL_OutOfMemory();
+ return;
+ }
+ status = XStringListToTextProperty(&title_locale, 1, &titleprop);
+ SDL_free(title_locale);
+ if ( status ) {
+ XSetTextProperty(SDL_Display, WMwindow, &titleprop, XA_WM_NAME);
+ XFree(titleprop.value);
+ }
+#ifdef X_HAVE_UTF8_STRING
+ if (SDL_X11_HAVE_UTF8) {
+ status = Xutf8TextListToTextProperty(SDL_Display,
+ (char **)&title, 1, XUTF8StringStyle, &titleprop);
+ if ( status == Success ) {
+ XSetTextProperty(SDL_Display, WMwindow, &titleprop, _NET_WM_NAME);
+ XFree(titleprop.value);
+ }
+ }
+#endif
+ }
+ if ( icon != NULL ) {
+ char *icon_locale = SDL_iconv_utf8_locale(icon);
+ if ( !icon_locale ) {
+ SDL_OutOfMemory();
+ return;
+ }
+ status = XStringListToTextProperty(&icon_locale, 1, &iconprop);
+ SDL_free(icon_locale);
+ if ( status ) {
+ XSetTextProperty(SDL_Display, WMwindow, &iconprop, XA_WM_ICON_NAME);
+ XFree(iconprop.value);
+ }
+#ifdef X_HAVE_UTF8_STRING
+ if (SDL_X11_HAVE_UTF8) {
+ status = Xutf8TextListToTextProperty(SDL_Display,
+ (char **)&icon, 1, XUTF8StringStyle, &iconprop);
+ if ( status == Success ) {
+ XSetTextProperty(SDL_Display, WMwindow, &iconprop, _NET_WM_ICON_NAME);
+ XFree(iconprop.value);
+ }
+ }
+#endif
+ }
+ XSync(SDL_Display, False);
+}
+
+void X11_SetCaption(_THIS, const char *title, const char *icon)
+{
+ SDL_Lock_EventThread();
+ X11_SetCaptionNoLock(this, title, icon);
+ SDL_Unlock_EventThread();
+}
+
+/* Iconify the window */
+int X11_IconifyWindow(_THIS)
+{
+ int result;
+
+ SDL_Lock_EventThread();
+ result = XIconifyWindow(SDL_Display, WMwindow, SDL_Screen);
+ XSync(SDL_Display, False);
+ SDL_Unlock_EventThread();
+ return(result);
+}
+
+#if 0
+#define D(...) printf(__VA_ARGS__)
+#define E(...) D(__VA_ARGS__)
+#else
+#define D(...) ((void)0)
+#define E(...) ((void)0)
+#endif
+
+static void set_window_pos_nolock(_THIS, int x, int y)
+{
+ int xNew, yNew;
+ Window child;
+ int xAdjust = X11_wmXAdjust;
+ int yAdjust = X11_wmYAdjust;
+
+ /* don't do anything in full-screen mode, because the FSwindow is used
+ * instead of the WMwindow, which will make the adjustment go wild
+ */
+ if (this->screen->flags & SDL_FULLSCREEN)
+ return;
+
+ /* this code is tricky because some window managers, but not all,
+ * will translate the final window position by a given offset
+ * corresponding to the frame decoration.
+ *
+ * so we first try to move the window, get the position that the
+ * window manager has set, and if they are different, re-position the
+ * window again with an adjustment.
+ *
+ * this causes a slight flicker since the window 'jumps' very
+ * quickly from one position to the other.
+ */
+
+ D("%s: move to [%d,%d] adjusted to [%d,%d]\n", __FUNCTION__,
+ x, y, x+xAdjust, y+yAdjust);
+ XMoveWindow(SDL_Display, WMwindow, x + xAdjust, y + yAdjust);
+ XSync(SDL_Display, True);
+ XTranslateCoordinates( SDL_Display, WMwindow, SDL_Root, 0, 0, &xNew, &yNew, &child );
+ if (xNew != x || yNew != y) {
+ X11_wmXAdjust = xAdjust = x - xNew;
+ X11_wmYAdjust = yAdjust = y - yNew;
+ D("%s: read pos [%d,%d], recomputing adjust=[%d,%d] moving to [%d,%d]\n",
+ __FUNCTION__, xNew, yNew, xAdjust, yAdjust, x+xAdjust, y+yAdjust);
+ XMoveWindow(SDL_Display, WMwindow, x + xAdjust, y + yAdjust );
+ }
+ XSync(SDL_Display, False);
+}
+
+/* Set window position */
+void X11_SetWindowPos(_THIS, int x, int y)
+{
+ SDL_Lock_EventThread();
+ set_window_pos_nolock(this, x, y);
+ SDL_Unlock_EventThread();
+}
+
+/* Get window position */
+void X11_GetWindowPos(_THIS, int *px, int *py)
+{
+ /* in full-screen mode, you can't move the window */
+ if (this->screen->flags & SDL_FULLSCREEN) {
+ *px = *py = 0;
+ return;
+ }
+
+
+ SDL_Lock_EventThread();
+ {
+ Window child;
+
+ XTranslateCoordinates( SDL_Display, WMwindow, SDL_Root, 0, 0, px, py, &child );
+ }
+ SDL_Unlock_EventThread();
+}
+
+static int
+is_window_visible(_THIS, int screen_x, int screen_y, int screen_w, int screen_h )
+{
+ XWindowAttributes attr;
+ int x, y;
+ Window child;
+
+ XGetWindowAttributes( SDL_Display, WMwindow, &attr );
+ XTranslateCoordinates( SDL_Display, WMwindow, SDL_Root, 0, 0, &x, &y, &child );
+
+ return ( x >= screen_x && x + attr.width <= screen_x + screen_w &&
+ y >= screen_y && y + attr.height <= screen_y + screen_h );
+}
+
+int X11_IsWindowVisible(_THIS, int recenter)
+{
+ int result = 0;
+ XWindowAttributes attr;
+ int screen_w, screen_h;
+
+ SDL_Lock_EventThread();
+ XGetWindowAttributes( SDL_Display, SDL_Root, &attr );
+ screen_w = attr.width;
+ screen_h = attr.height;
+
+#if SDL_VIDEO_DRIVER_X11_XINERAMA
+ if (use_xinerama) {
+ SDL_NAME(XineramaScreenInfo) *xinerama;
+ int i, screens;
+
+ xinerama = SDL_NAME(XineramaQueryScreens)(SDL_Display, &screens);
+ for (i = 0; i < screens; i++) {
+ if ( is_window_visible( this,
+ xinerama[i].x_org, xinerama[i].y_org,
+ xinerama[i].width, xinerama[i].height ) )
+ {
+ result = 1;
+ break;
+ }
+ }
+
+ if ( !result && recenter ) {
+ set_window_pos_nolock(this,
+ xinerama[0].x_org + (xinerama[0].width - this->screen->w)/2,
+ xinerama[0].y_org + (xinerama[0].height - this->screen->h)/2 );
+ }
+ XFree(xinerama);
+ goto Exit;
+ }
+#endif
+ if ( is_window_visible( this, 0, 0, screen_w, screen_h ) ) {
+ result = 1;
+ }
+
+ if ( !result && recenter ) {
+ set_window_pos_nolock( this,
+ (screen_w - this->screen->w)/2,
+ (screen_h - this->screen->h)/2 );
+ }
+#ifdef SDL_VIDEO_DRIVER_X11_XINERAMA
+Exit:
+#endif
+ SDL_Unlock_EventThread();
+ return result;
+}
+
+SDL_GrabMode X11_GrabInputNoLock(_THIS, SDL_GrabMode mode)
+{
+ int result;
+
+ if ( this->screen == NULL || SDL_Display == NULL ) {
+ return(SDL_GRAB_OFF);
+ }
+ if ( ! SDL_Window ) {
+ return(mode); /* Will be set later on mode switch */
+ }
+ if ( mode == SDL_GRAB_OFF ) {
+ XUngrabPointer(SDL_Display, CurrentTime);
+ XUngrabKeyboard(SDL_Display, CurrentTime);
+ } else {
+ if ( this->screen->flags & SDL_FULLSCREEN ) {
+ /* Unbind the mouse from the fullscreen window */
+ XUngrabPointer(SDL_Display, CurrentTime);
+ }
+ /* Try to grab the mouse */
+#if 0 /* We'll wait here until we actually grab, otherwise behavior undefined */
+ for ( numtries = 0; numtries < 10; ++numtries ) {
+#else
+ for ( ; ; ) {
+#endif
+ result = XGrabPointer(SDL_Display, SDL_Window, True, 0,
+ GrabModeAsync, GrabModeAsync,
+ SDL_Window, None, CurrentTime);
+ if ( result == GrabSuccess ) {
+ break;
+ }
+ SDL_Delay(100);
+ }
+ if ( result != GrabSuccess ) {
+ /* Uh, oh, what do we do here? */ ;
+ }
+ /* Now grab the keyboard */
+ XGrabKeyboard(SDL_Display, WMwindow, True,
+ GrabModeAsync, GrabModeAsync, CurrentTime);
+
+ /* Raise the window if we grab the mouse */
+ if ( !(this->screen->flags & SDL_FULLSCREEN) )
+ XRaiseWindow(SDL_Display, WMwindow);
+
+ /* Make sure we register input focus */
+ SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
+ /* Since we grabbed the pointer, we have mouse focus, too. */
+ SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
+ }
+ XSync(SDL_Display, False);
+
+ return(mode);
+}
+
+SDL_GrabMode X11_GrabInput(_THIS, SDL_GrabMode mode)
+{
+ SDL_Lock_EventThread();
+ mode = X11_GrabInputNoLock(this, mode);
+ SDL_Unlock_EventThread();
+
+ return(mode);
+}
+
+#define MM_PER_INCH 25.4
+
+int
+X11_GetMonitorDPI(_THIS, int *px_dpi, int *py_dpi)
+{
+ Display* display = SDL_Display;
+ int screen = XDefaultScreen(display);
+ int xdpi, ydpi;
+
+ int width = XDisplayWidth(display, screen);
+ int width_mm = XDisplayWidthMM(display, screen);
+ int height = XDisplayHeight(display, screen);
+ int height_mm = XDisplayHeightMM(display, screen);
+
+ if (width_mm <= 0 || height_mm <= 0) {
+ return -1;
+ }
+
+ xdpi = (int)(width * MM_PER_INCH / width_mm + 0.5);
+ ydpi = (int)(height * MM_PER_INCH / height_mm + 0.5);
+
+ if (xdpi < 20 || xdpi > 400 || ydpi < 20 || ydpi > 400) {
+ return -1;
+ }
+
+ *px_dpi = xdpi;
+ *py_dpi = ydpi;
+
+ return 0;
+}
+
+int
+X11_GetMonitorRect(_THIS, SDL_Rect *rect)
+{
+ Display* display = SDL_Display;
+ int screen = XDefaultScreen(display);
+
+ rect->x = 0;
+ rect->y = 0;
+ rect->w = XDisplayWidth(display, screen);
+ rect->h = XDisplayHeight(display, screen);
+
+ return 0;
+}
+
+/* If 'info' is the right version, this function fills it and returns 1.
+ Otherwise, in case of a version mismatch, it returns -1.
+*/
+static void lock_display(void)
+{
+ SDL_Lock_EventThread();
+}
+static void unlock_display(void)
+{
+ /* Make sure any X11 transactions are completed */
+ SDL_VideoDevice *this = current_video;
+ XSync(SDL_Display, False);
+ SDL_Unlock_EventThread();
+}
+
+#include <stdio.h>
+int X11_GetWMInfo(_THIS, SDL_SysWMinfo *info)
+{
+ if ( info->version.major <= SDL_MAJOR_VERSION ) {
+ info->subsystem = SDL_SYSWM_X11;
+ info->info.x11.display = SDL_Display;
+ info->info.x11.window = SDL_Window;
+ if ( SDL_VERSIONNUM(info->version.major,
+ info->version.minor,
+ info->version.patch) >= 1002 ) {
+ info->info.x11.fswindow = FSwindow;
+ info->info.x11.wmwindow = WMwindow;
+ }
+
+
+ if ( SDL_VERSIONNUM(info->version.major,
+ info->version.minor,
+ info->version.patch) >= 1212 ) {
+ info->info.x11.gfxdisplay = GFX_Display;
+ }
+
+ info->info.x11.lock_func = lock_display;
+ info->info.x11.unlock_func = unlock_display;
+ return(1);
+ } else {
+ SDL_SetError("Application not compiled with SDL %d.%d\n",
+ SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
+ return(-1);
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11wm_c.h b/distrib/sdl-1.2.15/src/video/x11/SDL_x11wm_c.h
new file mode 100644
index 0000000..c0f938b
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11wm_c.h
@@ -0,0 +1,38 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_x11video.h"
+
+/* Functions to be exported */
+extern void X11_SetCaptionNoLock(_THIS, const char *title, const char *icon);
+extern void X11_SetCaption(_THIS, const char *title, const char *icon);
+extern void X11_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask);
+extern int X11_IconifyWindow(_THIS);
+extern SDL_GrabMode X11_GrabInputNoLock(_THIS, SDL_GrabMode mode);
+extern SDL_GrabMode X11_GrabInput(_THIS, SDL_GrabMode mode);
+extern int X11_GetWMInfo(_THIS, SDL_SysWMinfo *info);
+extern void X11_GetWindowPos(_THIS, int *px, int *py);
+extern void X11_SetWindowPos(_THIS, int x, int y);
+extern int X11_IsWindowVisible(_THIS, int recenter);
+extern int X11_GetMonitorDPI(_THIS, int* xdpi, int *ydpi);
+extern int X11_GetMonitorRect(_THIS, SDL_Rect *rect);
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11yuv.c b/distrib/sdl-1.2.15/src/video/x11/SDL_x11yuv.c
new file mode 100644
index 0000000..62698df
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11yuv.c
@@ -0,0 +1,538 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This is the XFree86 Xv extension implementation of YUV video overlays */
+
+#if SDL_VIDEO_DRIVER_X11_XV
+
+#include <X11/Xlib.h>
+#ifndef NO_SHARED_MEMORY
+#include <sys/ipc.h>
+#include <sys/shm.h>
+#include <X11/extensions/XShm.h>
+#endif
+#include "../Xext/extensions/Xvlib.h"
+
+#include "SDL_x11yuv_c.h"
+#include "../SDL_yuvfuncs.h"
+
+#define XFREE86_REFRESH_HACK
+#ifdef XFREE86_REFRESH_HACK
+#include "SDL_x11image_c.h"
+#endif
+
+/* Workaround when pitch != width */
+#define PITCH_WORKAROUND
+
+/* Workaround intel i810 video overlay waiting with failing until the
+ first Xv[Shm]PutImage call <sigh> */
+#define INTEL_XV_BADALLOC_WORKAROUND
+
+/* Fix for the NVidia GeForce 2 - use the last available adaptor */
+/*#define USE_LAST_ADAPTOR*/ /* Apparently the NVidia drivers are fixed */
+
+/* The functions used to manipulate software video overlays */
+static struct private_yuvhwfuncs x11_yuvfuncs = {
+ X11_LockYUVOverlay,
+ X11_UnlockYUVOverlay,
+ X11_DisplayYUVOverlay,
+ X11_FreeYUVOverlay
+};
+
+struct private_yuvhwdata {
+ int port;
+#ifndef NO_SHARED_MEMORY
+ int yuv_use_mitshm;
+ XShmSegmentInfo yuvshm;
+#endif
+ SDL_NAME(XvImage) *image;
+};
+
+
+static int (*X_handler)(Display *, XErrorEvent *) = NULL;
+
+#ifndef NO_SHARED_MEMORY
+/* Shared memory error handler routine */
+static int shm_error;
+static int shm_errhandler(Display *d, XErrorEvent *e)
+{
+ if ( e->error_code == BadAccess ) {
+ shm_error = True;
+ return(0);
+ } else
+ return(X_handler(d,e));
+}
+#endif /* !NO_SHARED_MEMORY */
+
+static int xv_error;
+static int xv_errhandler(Display *d, XErrorEvent *e)
+{
+ if ( e->error_code == BadMatch ) {
+ xv_error = True;
+ return(0);
+ } else
+ return(X_handler(d,e));
+}
+
+#ifdef INTEL_XV_BADALLOC_WORKAROUND
+static int intel_errhandler(Display *d, XErrorEvent *e)
+{
+ if ( e->error_code == BadAlloc ) {
+ xv_error = True;
+ return(0);
+ } else
+ return(X_handler(d,e));
+}
+
+static void X11_ClearYUVOverlay(SDL_Overlay *overlay)
+{
+ int x,y;
+
+ switch (overlay->format)
+ {
+ case SDL_YV12_OVERLAY:
+ case SDL_IYUV_OVERLAY:
+ for (y = 0; y < overlay->h; y++)
+ memset(overlay->pixels[0] + y * overlay->pitches[0],
+ 0, overlay->w);
+
+ for (y = 0; y < (overlay->h / 2); y++)
+ {
+ memset(overlay->pixels[1] + y * overlay->pitches[1],
+ -128, overlay->w / 2);
+ memset(overlay->pixels[2] + y * overlay->pitches[2],
+ -128, overlay->w / 2);
+ }
+ break;
+ case SDL_YUY2_OVERLAY:
+ case SDL_YVYU_OVERLAY:
+ for (y = 0; y < overlay->h; y++)
+ {
+ for (x = 0; x < overlay->w; x += 2)
+ {
+ Uint8 *pixel_pair = overlay->pixels[0] +
+ y * overlay->pitches[0] + x * 2;
+ pixel_pair[0] = 0;
+ pixel_pair[1] = -128;
+ pixel_pair[2] = 0;
+ pixel_pair[3] = -128;
+ }
+ }
+ break;
+ case SDL_UYVY_OVERLAY:
+ for (y = 0; y < overlay->h; y++)
+ {
+ for (x = 0; x < overlay->w; x += 2)
+ {
+ Uint8 *pixel_pair = overlay->pixels[0] +
+ y * overlay->pitches[0] + x * 2;
+ pixel_pair[0] = -128;
+ pixel_pair[1] = 0;
+ pixel_pair[2] = -128;
+ pixel_pair[3] = 0;
+ }
+ }
+ break;
+ }
+}
+#endif
+
+SDL_Overlay *X11_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display)
+{
+ SDL_Overlay *overlay;
+ struct private_yuvhwdata *hwdata;
+ int xv_port;
+ unsigned int i, j, k;
+ unsigned int adaptors;
+ SDL_NAME(XvAdaptorInfo) *ainfo;
+ int bpp;
+#ifndef NO_SHARED_MEMORY
+ XShmSegmentInfo *yuvshm;
+#endif
+#ifdef INTEL_XV_BADALLOC_WORKAROUND
+ int intel_adapter = False;
+#endif
+
+ /* Look for the XVideo extension with a valid port for this format */
+ xv_port = -1;
+ if ( (Success == SDL_NAME(XvQueryExtension)(GFX_Display, &j, &j, &j, &j, &j)) &&
+ (Success == SDL_NAME(XvQueryAdaptors)(GFX_Display,
+ RootWindow(GFX_Display, SDL_Screen),
+ &adaptors, &ainfo)) ) {
+#ifdef USE_LAST_ADAPTOR
+ for ( i=0; i < adaptors; ++i )
+#else
+ for ( i=0; (i < adaptors) && (xv_port == -1); ++i )
+#endif /* USE_LAST_ADAPTOR */
+ {
+ /* Check to see if the visual can be used */
+ if ( BUGGY_XFREE86(<=, 4001) ) {
+ int visual_ok = 0;
+ for ( j=0; j<ainfo[i].num_formats; ++j ) {
+ if ( ainfo[i].formats[j].visual_id ==
+ SDL_Visual->visualid ) {
+ visual_ok = 1;
+ break;
+ }
+ }
+ if ( ! visual_ok ) {
+ continue;
+ }
+ }
+#ifdef INTEL_XV_BADALLOC_WORKAROUND
+ if ( !strcmp(ainfo[i].name, "Intel(R) Video Overla"))
+ intel_adapter = True;
+ else
+ intel_adapter = False;
+#endif
+ if ( (ainfo[i].type & XvInputMask) &&
+ (ainfo[i].type & XvImageMask) ) {
+ int num_formats;
+ SDL_NAME(XvImageFormatValues) *formats;
+ formats = SDL_NAME(XvListImageFormats)(GFX_Display,
+ ainfo[i].base_id, &num_formats);
+#ifdef USE_LAST_ADAPTOR
+ for ( j=0; j < num_formats; ++j )
+#else
+ for ( j=0; (j < num_formats) && (xv_port == -1); ++j )
+#endif /* USE_LAST_ADAPTOR */
+ {
+ if ( (Uint32)formats[j].id == format ) {
+ for ( k=0; k < ainfo[i].num_ports; ++k ) {
+ if ( Success == SDL_NAME(XvGrabPort)(GFX_Display, ainfo[i].base_id+k, CurrentTime) ) {
+ xv_port = ainfo[i].base_id+k;
+ break;
+ }
+ }
+ }
+ }
+ if ( formats ) {
+ XFree(formats);
+ }
+ }
+ }
+ SDL_NAME(XvFreeAdaptorInfo)(ainfo);
+ }
+
+ /* Precalculate the bpp for the pitch workaround below */
+ switch (format) {
+ /* Add any other cases we need to support... */
+ case SDL_YUY2_OVERLAY:
+ case SDL_UYVY_OVERLAY:
+ case SDL_YVYU_OVERLAY:
+ bpp = 2;
+ break;
+ default:
+ bpp = 1;
+ break;
+ }
+
+#if 0
+ /*
+ * !!! FIXME:
+ * "Here are some diffs for X11 and yuv. Note that the last part 2nd
+ * diff should probably be a new call to XvQueryAdaptorFree with ainfo
+ * and the number of adaptors, instead of the loop through like I did."
+ *
+ * ACHTUNG: This is broken! It looks like XvFreeAdaptorInfo does this
+ * for you, so we end up with a double-free. I need to look at this
+ * more closely... --ryan.
+ */
+ for ( i=0; i < adaptors; ++i ) {
+ if (ainfo[i].name != NULL) Xfree(ainfo[i].name);
+ if (ainfo[i].formats != NULL) Xfree(ainfo[i].formats);
+ }
+ Xfree(ainfo);
+#endif
+
+ if ( xv_port == -1 ) {
+ SDL_SetError("No available video ports for requested format");
+ return(NULL);
+ }
+
+ /* Enable auto-painting of the overlay colorkey */
+ {
+ static const char *attr[] = { "XV_AUTOPAINT_COLORKEY", "XV_AUTOPAINT_COLOURKEY" };
+ unsigned int i;
+
+ SDL_NAME(XvSelectPortNotify)(GFX_Display, xv_port, True);
+ X_handler = XSetErrorHandler(xv_errhandler);
+ for ( i=0; i < sizeof(attr)/(sizeof attr[0]); ++i ) {
+ Atom a;
+
+ xv_error = False;
+ a = XInternAtom(GFX_Display, attr[i], True);
+ if ( a != None ) {
+ SDL_NAME(XvSetPortAttribute)(GFX_Display, xv_port, a, 1);
+ XSync(GFX_Display, True);
+ if ( ! xv_error ) {
+ break;
+ }
+ }
+ }
+ XSetErrorHandler(X_handler);
+ SDL_NAME(XvSelectPortNotify)(GFX_Display, xv_port, False);
+ }
+
+ /* Create the overlay structure */
+ overlay = (SDL_Overlay *)SDL_malloc(sizeof *overlay);
+ if ( overlay == NULL ) {
+ SDL_NAME(XvUngrabPort)(GFX_Display, xv_port, CurrentTime);
+ SDL_OutOfMemory();
+ return(NULL);
+ }
+ SDL_memset(overlay, 0, (sizeof *overlay));
+
+ /* Fill in the basic members */
+ overlay->format = format;
+ overlay->w = width;
+ overlay->h = height;
+
+ /* Set up the YUV surface function structure */
+ overlay->hwfuncs = &x11_yuvfuncs;
+ overlay->hw_overlay = 1;
+
+ /* Create the pixel data and lookup tables */
+ hwdata = (struct private_yuvhwdata *)SDL_malloc(sizeof *hwdata);
+ overlay->hwdata = hwdata;
+ if ( hwdata == NULL ) {
+ SDL_NAME(XvUngrabPort)(GFX_Display, xv_port, CurrentTime);
+ SDL_OutOfMemory();
+ SDL_FreeYUVOverlay(overlay);
+ return(NULL);
+ }
+ hwdata->port = xv_port;
+#ifndef NO_SHARED_MEMORY
+ yuvshm = &hwdata->yuvshm;
+ SDL_memset(yuvshm, 0, sizeof(*yuvshm));
+ hwdata->image = SDL_NAME(XvShmCreateImage)(GFX_Display, xv_port, format,
+ 0, width, height, yuvshm);
+#ifdef PITCH_WORKAROUND
+ if ( hwdata->image != NULL && hwdata->image->pitches[0] != (width*bpp) ) {
+ /* Ajust overlay width according to pitch */
+ width = hwdata->image->pitches[0] / bpp;
+ XFree(hwdata->image);
+ hwdata->image = SDL_NAME(XvShmCreateImage)(GFX_Display, xv_port, format,
+ 0, width, height, yuvshm);
+ }
+#endif /* PITCH_WORKAROUND */
+ hwdata->yuv_use_mitshm = (hwdata->image != NULL);
+ if ( hwdata->yuv_use_mitshm ) {
+ yuvshm->shmid = shmget(IPC_PRIVATE, hwdata->image->data_size,
+ IPC_CREAT | 0777);
+ if ( yuvshm->shmid >= 0 ) {
+ yuvshm->shmaddr = (char *)shmat(yuvshm->shmid, 0, 0);
+ yuvshm->readOnly = False;
+ if ( yuvshm->shmaddr != (char *)-1 ) {
+ shm_error = False;
+ X_handler = XSetErrorHandler(shm_errhandler);
+ XShmAttach(GFX_Display, yuvshm);
+ XSync(GFX_Display, True);
+ XSetErrorHandler(X_handler);
+ if ( shm_error )
+ shmdt(yuvshm->shmaddr);
+ } else {
+ shm_error = True;
+ }
+ shmctl(yuvshm->shmid, IPC_RMID, NULL);
+ } else {
+ shm_error = True;
+ }
+ if ( shm_error ) {
+ XFree(hwdata->image);
+ hwdata->yuv_use_mitshm = 0;
+ } else {
+ hwdata->image->data = yuvshm->shmaddr;
+ }
+ }
+ if ( !hwdata->yuv_use_mitshm )
+#endif /* NO_SHARED_MEMORY */
+ {
+ hwdata->image = SDL_NAME(XvCreateImage)(GFX_Display, xv_port, format,
+ 0, width, height);
+
+#ifdef PITCH_WORKAROUND
+ if ( hwdata->image != NULL && hwdata->image->pitches[0] != (width*bpp) ) {
+ /* Ajust overlay width according to pitch */
+ XFree(hwdata->image);
+ width = hwdata->image->pitches[0] / bpp;
+ hwdata->image = SDL_NAME(XvCreateImage)(GFX_Display, xv_port, format,
+ 0, width, height);
+ }
+#endif /* PITCH_WORKAROUND */
+ if ( hwdata->image == NULL ) {
+ SDL_SetError("Couldn't create XVideo image");
+ SDL_FreeYUVOverlay(overlay);
+ return(NULL);
+ }
+ hwdata->image->data = SDL_malloc(hwdata->image->data_size);
+ if ( hwdata->image->data == NULL ) {
+ SDL_OutOfMemory();
+ SDL_FreeYUVOverlay(overlay);
+ return(NULL);
+ }
+ }
+
+ /* Find the pitch and offset values for the overlay */
+ overlay->planes = hwdata->image->num_planes;
+ overlay->pitches = (Uint16 *)SDL_malloc(overlay->planes * sizeof(Uint16));
+ overlay->pixels = (Uint8 **)SDL_malloc(overlay->planes * sizeof(Uint8 *));
+ if ( !overlay->pitches || !overlay->pixels ) {
+ SDL_OutOfMemory();
+ SDL_FreeYUVOverlay(overlay);
+ return(NULL);
+ }
+ for ( i=0; i<overlay->planes; ++i ) {
+ overlay->pitches[i] = hwdata->image->pitches[i];
+ overlay->pixels[i] = (Uint8 *)hwdata->image->data +
+ hwdata->image->offsets[i];
+ }
+
+#ifdef XFREE86_REFRESH_HACK
+ /* Work around an XFree86 X server bug (?)
+ We can't perform normal updates in windows that have video
+ being output to them. See SDL_x11image.c for more details.
+ */
+ X11_DisableAutoRefresh(this);
+#endif
+
+#ifdef INTEL_XV_BADALLOC_WORKAROUND
+ /* HACK, GRRR sometimes (i810) creating the overlay succeeds, but the
+ first call to XvShm[Put]Image to a mapped window fails with:
+ "BadAlloc (insufficient resources for operation)". This happens with
+ certain formats when the XvImage is too large to the i810's liking.
+
+ We work around this by doing a test XvShm[Put]Image with a black
+ Xv image, this may cause some flashing, so only do this check if we
+ are running on an intel Xv-adapter. */
+ if (intel_adapter)
+ {
+ xv_error = False;
+ X_handler = XSetErrorHandler(intel_errhandler);
+
+ X11_ClearYUVOverlay(overlay);
+
+ /* We set the destination height and width to 1 pixel to avoid
+ putting a large black rectangle over the screen, thus
+ strongly reducing possible flashing. */
+#ifndef NO_SHARED_MEMORY
+ if ( hwdata->yuv_use_mitshm ) {
+ SDL_NAME(XvShmPutImage)(GFX_Display, hwdata->port,
+ SDL_Window, SDL_GC,
+ hwdata->image,
+ 0, 0, overlay->w, overlay->h,
+ 0, 0, 1, 1, False);
+ }
+ else
+#endif
+ {
+ SDL_NAME(XvPutImage)(GFX_Display, hwdata->port,
+ SDL_Window, SDL_GC,
+ hwdata->image,
+ 0, 0, overlay->w, overlay->h,
+ 0, 0, 1, 1);
+ }
+ XSync(GFX_Display, False);
+ XSetErrorHandler(X_handler);
+
+ if (xv_error)
+ {
+ X11_FreeYUVOverlay(this, overlay);
+ return NULL;
+ }
+ /* Repair the (1 pixel worth of) damage we've just done */
+ X11_RefreshDisplay(this);
+ }
+#endif
+
+ /* We're all done.. */
+ return(overlay);
+}
+
+int X11_LockYUVOverlay(_THIS, SDL_Overlay *overlay)
+{
+ return(0);
+}
+
+void X11_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay)
+{
+ return;
+}
+
+int X11_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst)
+{
+ struct private_yuvhwdata *hwdata;
+
+ hwdata = overlay->hwdata;
+
+#ifndef NO_SHARED_MEMORY
+ if ( hwdata->yuv_use_mitshm ) {
+ SDL_NAME(XvShmPutImage)(GFX_Display, hwdata->port, SDL_Window, SDL_GC,
+ hwdata->image,
+ src->x, src->y, src->w, src->h,
+ dst->x, dst->y, dst->w, dst->h, False);
+ }
+ else
+#endif
+ {
+ SDL_NAME(XvPutImage)(GFX_Display, hwdata->port, SDL_Window, SDL_GC,
+ hwdata->image,
+ src->x, src->y, src->w, src->h,
+ dst->x, dst->y, dst->w, dst->h);
+ }
+ XSync(GFX_Display, False);
+ return(0);
+}
+
+void X11_FreeYUVOverlay(_THIS, SDL_Overlay *overlay)
+{
+ struct private_yuvhwdata *hwdata;
+
+ hwdata = overlay->hwdata;
+ if ( hwdata ) {
+ SDL_NAME(XvUngrabPort)(GFX_Display, hwdata->port, CurrentTime);
+#ifndef NO_SHARED_MEMORY
+ if ( hwdata->yuv_use_mitshm ) {
+ XShmDetach(GFX_Display, &hwdata->yuvshm);
+ shmdt(hwdata->yuvshm.shmaddr);
+ }
+#endif
+ if ( hwdata->image ) {
+ XFree(hwdata->image);
+ }
+ SDL_free(hwdata);
+ }
+ if ( overlay->pitches ) {
+ SDL_free(overlay->pitches);
+ overlay->pitches = NULL;
+ }
+ if ( overlay->pixels ) {
+ SDL_free(overlay->pixels);
+ overlay->pixels = NULL;
+ }
+#ifdef XFREE86_REFRESH_HACK
+ X11_EnableAutoRefresh(this);
+#endif
+}
+
+#endif /* SDL_VIDEO_DRIVER_X11_XV */
diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11yuv_c.h b/distrib/sdl-1.2.15/src/video/x11/SDL_x11yuv_c.h
new file mode 100644
index 0000000..d297683
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11yuv_c.h
@@ -0,0 +1,41 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* This is the XFree86 Xv extension implementation of YUV video overlays */
+
+#include "SDL_video.h"
+#include "SDL_x11video.h"
+
+#if SDL_VIDEO_DRIVER_X11_XV
+
+extern SDL_Overlay *X11_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display);
+
+extern int X11_LockYUVOverlay(_THIS, SDL_Overlay *overlay);
+
+extern void X11_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay);
+
+extern int X11_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *src, SDL_Rect *dst);
+
+extern void X11_FreeYUVOverlay(_THIS, SDL_Overlay *overlay);
+
+#endif /* SDL_VIDEO_DRIVER_X11_XV */
diff --git a/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios.c b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios.c
new file mode 100644
index 0000000..56bf6ab
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios.c
@@ -0,0 +1,1116 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ * Xbios SDL video driver
+ *
+ * Patrice Mandin
+ */
+
+#include <sys/stat.h>
+#include <unistd.h>
+
+/* Mint includes */
+#include <mint/cookie.h>
+#include <mint/osbind.h>
+#include <mint/falcon.h>
+
+#include "SDL_video.h"
+#include "SDL_mouse.h"
+#include "../SDL_sysvideo.h"
+#include "../SDL_pixels_c.h"
+#include "../../events/SDL_events_c.h"
+
+#include "../ataricommon/SDL_ataric2p_s.h"
+#include "../ataricommon/SDL_atarievents_c.h"
+#include "../ataricommon/SDL_atarimxalloc_c.h"
+#include "../ataricommon/SDL_atarigl_c.h"
+#include "SDL_xbios.h"
+#include "SDL_xbios_blowup.h"
+#include "SDL_xbios_centscreen.h"
+#include "SDL_xbios_sb3.h"
+#include "SDL_xbios_tveille.h"
+#include "SDL_xbios_milan.h"
+
+#define XBIOS_VID_DRIVER_NAME "xbios"
+
+#ifndef C_fVDI
+#define C_fVDI 0x66564449L
+#endif
+
+/* Debug print info */
+#if 0
+#define DEBUG_PRINT(what) \
+ { \
+ printf what; \
+ }
+#define DEBUG_VIDEO_XBIOS 1
+#else
+#define DEBUG_PRINT(what)
+#undef DEBUG_VIDEO_XBIOS
+#endif
+
+/* Initialization/Query functions */
+static int XBIOS_VideoInit(_THIS, SDL_PixelFormat *vformat);
+static SDL_Rect **XBIOS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
+static SDL_Surface *XBIOS_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
+static int XBIOS_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
+static void XBIOS_VideoQuit(_THIS);
+
+/* Hardware surface functions */
+static int XBIOS_AllocHWSurface(_THIS, SDL_Surface *surface);
+static int XBIOS_LockHWSurface(_THIS, SDL_Surface *surface);
+static int XBIOS_FlipHWSurface(_THIS, SDL_Surface *surface);
+static void XBIOS_UnlockHWSurface(_THIS, SDL_Surface *surface);
+static void XBIOS_FreeHWSurface(_THIS, SDL_Surface *surface);
+static void XBIOS_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
+
+#if SDL_VIDEO_OPENGL
+/* OpenGL functions */
+static void XBIOS_GL_SwapBuffers(_THIS);
+#endif
+
+/* To setup palette */
+
+static unsigned short TT_palette[256];
+static unsigned long F30_palette[256];
+
+/* Default list of video modes */
+
+static const xbiosmode_t stmodes[1]={
+ {ST_LOW>>8,320,200,4, XBIOSMODE_C2P}
+};
+
+static const xbiosmode_t ttmodes[2]={
+ {TT_LOW,320,480,8, XBIOSMODE_C2P},
+ {TT_LOW,320,240,8, XBIOSMODE_C2P|XBIOSMODE_DOUBLELINE}
+};
+
+static const xbiosmode_t falconrgbmodes[16]={
+ {BPS16|COL80|OVERSCAN|VERTFLAG,768,480,16,0},
+ {BPS16|COL80|OVERSCAN,768,240,16,0},
+ {BPS16|COL80|VERTFLAG,640,400,16,0},
+ {BPS16|COL80,640,200,16,0},
+ {BPS16|OVERSCAN|VERTFLAG,384,480,16,0},
+ {BPS16|OVERSCAN,384,240,16,0},
+ {BPS16|VERTFLAG,320,400,16,0},
+ {BPS16,320,200,16,0},
+ {BPS8|COL80|OVERSCAN|VERTFLAG,768,480,8,XBIOSMODE_C2P},
+ {BPS8|COL80|OVERSCAN,768,240,8,XBIOSMODE_C2P},
+ {BPS8|COL80|VERTFLAG,640,400,8,XBIOSMODE_C2P},
+ {BPS8|COL80,640,200,8,XBIOSMODE_C2P},
+ {BPS8|OVERSCAN|VERTFLAG,384,480,8,XBIOSMODE_C2P},
+ {BPS8|OVERSCAN,384,240,8,XBIOSMODE_C2P},
+ {BPS8|VERTFLAG,320,400,8,XBIOSMODE_C2P},
+ {BPS8,320,200,8,XBIOSMODE_C2P}
+};
+
+static const xbiosmode_t falconvgamodes[6]={
+ {BPS16,320,480,16,0},
+ {BPS16|VERTFLAG,320,240,16,0},
+ {BPS8|COL80,640,480,8,XBIOSMODE_C2P},
+ {BPS8|COL80|VERTFLAG,640,240,8,XBIOSMODE_C2P},
+ {BPS8,320,480,8,XBIOSMODE_C2P},
+ {BPS8|VERTFLAG,320,240,8,XBIOSMODE_C2P}
+};
+
+/* Xbios driver bootstrap functions */
+
+static int XBIOS_Available(void)
+{
+ long cookie_vdo, /*cookie_mil,*/ cookie_hade, cookie_scpn;
+ long cookie_fvdi;
+ const char *envr = SDL_getenv("SDL_VIDEODRIVER");
+
+ /* Milan/Hades Atari clones do not have an Atari video chip */
+ if ( /*(Getcookie(C__MIL, &cookie_mil) == C_FOUND) ||*/
+ (Getcookie(C_hade, &cookie_hade) == C_FOUND) ) {
+ return 0;
+ }
+
+ /* fVDI means graphic card, so no Xbios with it */
+ if (Getcookie(C_fVDI, &cookie_fvdi) == C_FOUND) {
+ if (!envr) {
+ return 0;
+ }
+ if (SDL_strcmp(envr, XBIOS_VID_DRIVER_NAME)!=0) {
+ return 0;
+ }
+ /* Except if we force Xbios usage, through env var */
+ }
+
+ /* Cookie _VDO present ? if not, assume ST machine */
+ if (Getcookie(C__VDO, &cookie_vdo) != C_FOUND) {
+ cookie_vdo = VDO_ST << 16;
+ }
+
+ /* Test if we have a monochrome monitor plugged in */
+ switch( cookie_vdo >>16) {
+ case VDO_ST:
+ case VDO_STE:
+ if ( Getrez() == (ST_HIGH>>8) )
+ return 0;
+ break;
+ case VDO_TT:
+ if ( (EgetShift() & ES_MODE) == TT_HIGH)
+ return 0;
+ break;
+ case VDO_F30:
+ if ( VgetMonitor() == MONITOR_MONO)
+ return 0;
+ if (Getcookie(C_SCPN, &cookie_scpn) == C_FOUND) {
+ if (!SDL_XBIOS_SB3Usable((scpn_cookie_t *)cookie_scpn)) {
+ return 0;
+ }
+ }
+ break;
+ case VDO_MILAN:
+ break;
+ default:
+ return 0;
+ }
+
+ return 1;
+}
+
+static void XBIOS_DeleteDevice(SDL_VideoDevice *device)
+{
+ SDL_free(device->hidden);
+ SDL_free(device);
+}
+
+static SDL_VideoDevice *XBIOS_CreateDevice(int devindex)
+{
+ SDL_VideoDevice *device;
+
+ /* Initialize all variables that we clean on shutdown */
+ device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
+ if ( device ) {
+ SDL_memset(device, 0, (sizeof *device));
+ device->hidden = (struct SDL_PrivateVideoData *)
+ SDL_malloc((sizeof *device->hidden));
+ device->gl_data = (struct SDL_PrivateGLData *)
+ SDL_malloc((sizeof *device->gl_data));
+ }
+ if ( (device == NULL) || (device->hidden == NULL) ) {
+ SDL_OutOfMemory();
+ if ( device ) {
+ SDL_free(device);
+ }
+ return(0);
+ }
+ SDL_memset(device->hidden, 0, (sizeof *device->hidden));
+ SDL_memset(device->gl_data, 0, sizeof(*device->gl_data));
+
+ /* Video functions */
+ device->VideoInit = XBIOS_VideoInit;
+ device->ListModes = XBIOS_ListModes;
+ device->SetVideoMode = XBIOS_SetVideoMode;
+ device->SetColors = XBIOS_SetColors;
+ device->UpdateRects = NULL;
+ device->VideoQuit = XBIOS_VideoQuit;
+ device->AllocHWSurface = XBIOS_AllocHWSurface;
+ device->LockHWSurface = XBIOS_LockHWSurface;
+ device->UnlockHWSurface = XBIOS_UnlockHWSurface;
+ device->FlipHWSurface = XBIOS_FlipHWSurface;
+ device->FreeHWSurface = XBIOS_FreeHWSurface;
+
+#if SDL_VIDEO_OPENGL
+ /* OpenGL functions */
+ device->GL_LoadLibrary = SDL_AtariGL_LoadLibrary;
+ device->GL_GetProcAddress = SDL_AtariGL_GetProcAddress;
+ device->GL_GetAttribute = SDL_AtariGL_GetAttribute;
+ device->GL_MakeCurrent = SDL_AtariGL_MakeCurrent;
+ device->GL_SwapBuffers = XBIOS_GL_SwapBuffers;
+#endif
+
+ /* Events */
+ device->InitOSKeymap = Atari_InitOSKeymap;
+ device->PumpEvents = Atari_PumpEvents;
+
+ device->free = XBIOS_DeleteDevice;
+
+ return device;
+}
+
+VideoBootStrap XBIOS_bootstrap = {
+ XBIOS_VID_DRIVER_NAME, "Atari Xbios driver",
+ XBIOS_Available, XBIOS_CreateDevice
+};
+
+void SDL_XBIOS_AddMode(_THIS, int actually_add, const xbiosmode_t *modeinfo)
+{
+ int i = 0;
+
+ switch(modeinfo->depth) {
+ case 15:
+ case 16:
+ i = 1;
+ break;
+ case 24:
+ i = 2;
+ break;
+ case 32:
+ i = 3;
+ break;
+ }
+
+ if ( actually_add ) {
+ SDL_Rect saved_rect[2];
+ xbiosmode_t saved_mode[2];
+ int b, j;
+
+ /* Add the mode, sorted largest to smallest */
+ b = 0;
+ j = 0;
+ while ( (SDL_modelist[i][j]->w > modeinfo->width) ||
+ (SDL_modelist[i][j]->h > modeinfo->height) ) {
+ ++j;
+ }
+ /* Skip modes that are already in our list */
+ if ( (SDL_modelist[i][j]->w == modeinfo->width) &&
+ (SDL_modelist[i][j]->h == modeinfo->height) ) {
+ return;
+ }
+ /* Insert the new mode */
+ saved_rect[b] = *SDL_modelist[i][j];
+ SDL_memcpy(&saved_mode[b], SDL_xbiosmode[i][j], sizeof(xbiosmode_t));
+ SDL_modelist[i][j]->w = modeinfo->width;
+ SDL_modelist[i][j]->h = modeinfo->height;
+ SDL_memcpy(SDL_xbiosmode[i][j], modeinfo, sizeof(xbiosmode_t));
+ /* Everybody scoot down! */
+ if ( saved_rect[b].w && saved_rect[b].h ) {
+ for ( ++j; SDL_modelist[i][j]->w; ++j ) {
+ saved_rect[!b] = *SDL_modelist[i][j];
+ memcpy(&saved_mode[!b], SDL_xbiosmode[i][j], sizeof(xbiosmode_t));
+ *SDL_modelist[i][j] = saved_rect[b];
+ SDL_memcpy(SDL_xbiosmode[i][j], &saved_mode[b], sizeof(xbiosmode_t));
+ b = !b;
+ }
+ *SDL_modelist[i][j] = saved_rect[b];
+ SDL_memcpy(SDL_xbiosmode[i][j], &saved_mode[b], sizeof(xbiosmode_t));
+ }
+ } else {
+ ++SDL_nummodes[i];
+ }
+}
+
+static void XBIOS_ListSTModes(_THIS, int actually_add)
+{
+ SDL_XBIOS_AddMode(this, actually_add, &stmodes[0]);
+}
+
+static void XBIOS_ListTTModes(_THIS, int actually_add)
+{
+ int i;
+
+ for (i=0; i<2; i++) {
+ SDL_XBIOS_AddMode(this, actually_add, &ttmodes[i]);
+ }
+}
+
+static void XBIOS_ListFalconRgbModes(_THIS, int actually_add)
+{
+ int i;
+
+ for (i=0; i<16; i++) {
+ xbiosmode_t modeinfo;
+
+ SDL_memcpy(&modeinfo, &falconrgbmodes[i], sizeof(xbiosmode_t));
+ modeinfo.number &= ~(VGA|PAL);
+ modeinfo.number |= XBIOS_oldvmode & (VGA|PAL);
+
+ SDL_XBIOS_AddMode(this, actually_add, &modeinfo);
+ }
+}
+
+static void XBIOS_ListFalconVgaModes(_THIS, int actually_add)
+{
+ int i;
+
+ for (i=0; i<6; i++) {
+ xbiosmode_t modeinfo;
+
+ SDL_memcpy(&modeinfo, &falconvgamodes[i], sizeof(xbiosmode_t));
+ modeinfo.number &= ~(VGA|PAL);
+ modeinfo.number |= XBIOS_oldvmode & (VGA|PAL);
+
+ SDL_XBIOS_AddMode(this, actually_add, &modeinfo);
+ }
+}
+
+static int XBIOS_VideoInit(_THIS, SDL_PixelFormat *vformat)
+{
+ int i;
+ long cookie_blow, cookie_scpn, cookie_cnts;
+
+ /* Initialize all variables that we clean on shutdown */
+ for ( i=0; i<NUM_MODELISTS; ++i ) {
+ SDL_nummodes[i] = 0;
+ SDL_modelist[i] = NULL;
+ SDL_xbiosmode[i] = NULL;
+ }
+
+ /* Cookie _VDO present ? if not, assume ST machine */
+ if (Getcookie(C__VDO, &XBIOS_cvdo) != C_FOUND) {
+ XBIOS_cvdo = VDO_ST << 16;
+ }
+
+ /* Allocate memory for old palette */
+ XBIOS_oldpalette = (void *)SDL_malloc(256*sizeof(long));
+ if ( !XBIOS_oldpalette ) {
+ SDL_SetError("Unable to allocate memory for old palette\n");
+ return(-1);
+ }
+
+ /* Initialize video mode list */
+ /* and save current screen status (palette, screen address, video mode) */
+ XBIOS_centscreen = SDL_FALSE;
+ XBIOS_oldvbase = Physbase();
+
+ /* Determine the current screen size */
+ this->info.current_w = 0;
+ this->info.current_h = 0;
+
+ /* Determine the screen depth (use default 8-bit depth) */
+ vformat->BitsPerPixel = 8;
+
+ /* First allocate room for needed video modes */
+ switch (XBIOS_cvdo >>16) {
+ case VDO_ST:
+ case VDO_STE:
+ {
+ short *oldpalette;
+
+ XBIOS_oldvmode=Getrez();
+ switch(XBIOS_oldvmode << 8) {
+ case ST_LOW:
+ XBIOS_oldnumcol=16;
+ break;
+ case ST_MED:
+ XBIOS_oldnumcol=4;
+ break;
+ case ST_HIGH:
+ XBIOS_oldnumcol=2;
+ break;
+ }
+
+ oldpalette= (short *) XBIOS_oldpalette;
+ for (i=0;i<XBIOS_oldnumcol;i++) {
+ *oldpalette++=Setcolor(i,-1);
+ }
+
+ XBIOS_ListSTModes(this, 0);
+ }
+ break;
+ case VDO_TT:
+ XBIOS_oldvmode=EgetShift();
+
+ switch(XBIOS_oldvmode & ES_MODE) {
+ case TT_LOW:
+ XBIOS_oldnumcol=256;
+ break;
+ case ST_LOW:
+ case TT_MED:
+ XBIOS_oldnumcol=16;
+ break;
+ case ST_MED:
+ XBIOS_oldnumcol=4;
+ break;
+ case ST_HIGH:
+ case TT_HIGH:
+ XBIOS_oldnumcol=2;
+ break;
+ }
+ if (XBIOS_oldnumcol) {
+ EgetPalette(0, XBIOS_oldnumcol, XBIOS_oldpalette);
+ }
+
+ XBIOS_ListTTModes(this, 0);
+ break;
+ case VDO_F30:
+ XBIOS_oldvmode=VsetMode(-1);
+
+ XBIOS_oldnumcol= 1<< (1 << (XBIOS_oldvmode & NUMCOLS));
+ if (XBIOS_oldnumcol > 256) {
+ XBIOS_oldnumcol = 0;
+ }
+ if (XBIOS_oldnumcol) {
+ VgetRGB(0, XBIOS_oldnumcol, XBIOS_oldpalette);
+ }
+
+ vformat->BitsPerPixel = 16;
+
+ /* ScreenBlaster 3 ? */
+ if (Getcookie(C_SCPN, &cookie_scpn) == C_FOUND) {
+ SDL_XBIOS_ListSB3Modes(this, 0, (scpn_cookie_t *)cookie_scpn);
+ } else
+ /* Centscreen ? */
+ if (Getcookie(C_CNTS, &cookie_cnts) == C_FOUND) {
+ XBIOS_oldvmode = SDL_XBIOS_ListCentscreenModes(this, 0);
+ XBIOS_centscreen = SDL_TRUE;
+ } else
+ /* Standard, with or without Blowup */
+ {
+ switch (VgetMonitor())
+ {
+ case MONITOR_RGB:
+ case MONITOR_TV:
+ XBIOS_ListFalconRgbModes(this, 0);
+ break;
+ case MONITOR_VGA:
+ XBIOS_ListFalconVgaModes(this, 0);
+ break;
+ }
+
+ if (Getcookie(C_BLOW, &cookie_blow) == C_FOUND) {
+ SDL_XBIOS_ListBlowupModes(this, 0, (blow_cookie_t *)cookie_blow);
+ }
+ }
+ break;
+ case VDO_MILAN:
+ {
+ SCREENINFO si;
+
+ /* Read infos about current mode */
+ VsetScreen(-1, &XBIOS_oldvmode, MI_MAGIC, CMD_GETMODE);
+
+ si.size = sizeof(SCREENINFO);
+ si.devID = XBIOS_oldvmode;
+ si.scrFlags = 0;
+ VsetScreen(-1, &si, MI_MAGIC, CMD_GETINFO);
+
+ this->info.current_w = si.scrWidth;
+ this->info.current_h = si.scrHeight;
+
+ XBIOS_oldnumcol = 0;
+ if (si.scrFlags & SCRINFO_OK) {
+ if (si.scrPlanes <= 8) {
+ XBIOS_oldnumcol = 1<<si.scrPlanes;
+ }
+ }
+ if (XBIOS_oldnumcol) {
+ VgetRGB(0, XBIOS_oldnumcol, XBIOS_oldpalette);
+ }
+
+ SDL_XBIOS_ListMilanModes(this, 0);
+ }
+ break;
+ }
+
+ for ( i=0; i<NUM_MODELISTS; ++i ) {
+ int j;
+
+ SDL_xbiosmode[i] = (xbiosmode_t **)
+ SDL_malloc((SDL_nummodes[i]+1)*sizeof(xbiosmode_t *));
+ if ( SDL_xbiosmode[i] == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ for ( j=0; j<SDL_nummodes[i]; ++j ) {
+ SDL_xbiosmode[i][j]=(xbiosmode_t *)SDL_malloc(sizeof(xbiosmode_t));
+ if ( SDL_xbiosmode[i][j] == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ SDL_memset(SDL_xbiosmode[i][j], 0, sizeof(xbiosmode_t));
+ }
+ SDL_xbiosmode[i][j] = NULL;
+
+ SDL_modelist[i] = (SDL_Rect **)
+ SDL_malloc((SDL_nummodes[i]+1)*sizeof(SDL_Rect *));
+ if ( SDL_modelist[i] == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ for ( j=0; j<SDL_nummodes[i]; ++j ) {
+ SDL_modelist[i][j]=(SDL_Rect *)SDL_malloc(sizeof(SDL_Rect));
+ if ( SDL_modelist[i][j] == NULL ) {
+ SDL_OutOfMemory();
+ return(-1);
+ }
+ SDL_memset(SDL_modelist[i][j], 0, sizeof(SDL_Rect));
+ }
+ SDL_modelist[i][j] = NULL;
+ }
+
+ /* Now fill the mode list */
+ switch (XBIOS_cvdo >>16) {
+ case VDO_ST:
+ case VDO_STE:
+ XBIOS_ListSTModes(this, 1);
+ break;
+ case VDO_TT:
+ XBIOS_ListTTModes(this, 1);
+ break;
+ case VDO_F30:
+ /* ScreenBlaster 3 ? */
+ if (Getcookie(C_SCPN, &cookie_scpn) == C_FOUND) {
+ SDL_XBIOS_ListSB3Modes(this, 1, (scpn_cookie_t *)cookie_scpn);
+ } else
+ /* Centscreen ? */
+ if (Getcookie(C_CNTS, &cookie_cnts) == C_FOUND) {
+ XBIOS_oldvmode = SDL_XBIOS_ListCentscreenModes(this, 1);
+ XBIOS_centscreen = SDL_TRUE;
+ } else
+ /* Standard, with or without Blowup */
+ {
+ switch (VgetMonitor())
+ {
+ case MONITOR_RGB:
+ case MONITOR_TV:
+ XBIOS_ListFalconRgbModes(this, 1);
+ break;
+ case MONITOR_VGA:
+ XBIOS_ListFalconVgaModes(this, 1);
+ break;
+ }
+
+ if (Getcookie(C_BLOW, &cookie_blow) == C_FOUND) {
+ SDL_XBIOS_ListBlowupModes(this, 1, (blow_cookie_t *)cookie_blow);
+ }
+ }
+ break;
+ case VDO_MILAN:
+ SDL_XBIOS_ListMilanModes(this, 1);
+ break;
+ }
+
+ XBIOS_screens[0]=NULL;
+ XBIOS_screens[1]=NULL;
+ XBIOS_shadowscreen=NULL;
+
+ /* Update hardware info */
+ this->info.hw_available = 1;
+ this->info.video_mem = (Uint32) Atari_SysMalloc(-1L, MX_STRAM);
+
+ /* Init chunky to planar routine */
+ SDL_Atari_C2pConvert = SDL_Atari_C2pConvert8;
+
+#if SDL_VIDEO_OPENGL
+ SDL_AtariGL_InitPointers(this);
+#endif
+
+ /* Disable screensavers */
+ if (SDL_XBIOS_TveillePresent(this)) {
+ SDL_XBIOS_TveilleDisable(this);
+ }
+
+ /* We're done! */
+ return(0);
+}
+
+static SDL_Rect **XBIOS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
+{
+ return(SDL_modelist[((format->BitsPerPixel+7)/8)-1]);
+}
+
+static void XBIOS_FreeBuffers(_THIS)
+{
+ int i;
+
+ for (i=0;i<2;i++) {
+ if (XBIOS_screensmem[i]!=NULL) {
+ if ((XBIOS_cvdo>>16) == VDO_MILAN) {
+ if (i==1) {
+ VsetScreen(-1, -1, MI_MAGIC, CMD_FREEPAGE);
+ }
+ } else {
+ Mfree(XBIOS_screensmem[i]);
+ }
+ XBIOS_screensmem[i]=NULL;
+ }
+ }
+
+ if (XBIOS_shadowscreen!=NULL) {
+ Mfree(XBIOS_shadowscreen);
+ XBIOS_shadowscreen=NULL;
+ }
+}
+
+static SDL_Surface *XBIOS_SetVideoMode(_THIS, SDL_Surface *current,
+ int width, int height, int bpp, Uint32 flags)
+{
+ int mode, new_depth;
+ int i, num_buffers;
+ xbiosmode_t *new_video_mode;
+ Uint32 new_screen_size;
+ Uint32 modeflags;
+
+ /* Free current buffers */
+ XBIOS_FreeBuffers(this);
+
+ /* Try to set the requested linear video mode */
+ bpp = (bpp+7)/8-1;
+ for ( mode=0; SDL_modelist[bpp][mode]; ++mode ) {
+ if ( (SDL_modelist[bpp][mode]->w == width) &&
+ (SDL_modelist[bpp][mode]->h == height) ) {
+ break;
+ }
+ }
+ if ( SDL_modelist[bpp][mode] == NULL ) {
+ SDL_SetError("Couldn't find requested mode in list");
+ return(NULL);
+ }
+ new_video_mode = SDL_xbiosmode[bpp][mode];
+
+ modeflags = SDL_FULLSCREEN | SDL_PREALLOC;
+
+ /* Allocate needed buffers: simple/double buffer and shadow surface */
+ new_depth = new_video_mode->depth;
+ if (new_depth == 4) {
+ SDL_Atari_C2pConvert = SDL_Atari_C2pConvert4;
+ new_depth=8;
+ modeflags |= SDL_SWSURFACE|SDL_HWPALETTE;
+ } else if (new_depth == 8) {
+ SDL_Atari_C2pConvert = SDL_Atari_C2pConvert8;
+ modeflags |= SDL_SWSURFACE|SDL_HWPALETTE;
+ } else {
+ modeflags |= SDL_HWSURFACE;
+ }
+
+ new_screen_size = width * height * ((new_depth)>>3);
+ new_screen_size += 256; /* To align on a 256 byte adress */
+
+ if (new_video_mode->flags & XBIOSMODE_C2P) {
+ XBIOS_shadowscreen = Atari_SysMalloc(new_screen_size, MX_PREFTTRAM);
+
+ if (XBIOS_shadowscreen == NULL) {
+ SDL_SetError("Can not allocate %d KB for shadow buffer", new_screen_size>>10);
+ return (NULL);
+ }
+ SDL_memset(XBIOS_shadowscreen, 0, new_screen_size);
+ }
+
+ /* Output buffer needs to be twice in size for the software double-line mode */
+ if (new_video_mode->flags & XBIOSMODE_DOUBLELINE) {
+ new_screen_size <<= 1;
+ }
+
+ /* Double buffer ? */
+ num_buffers = 1;
+
+#if SDL_VIDEO_OPENGL
+ if (flags & SDL_OPENGL) {
+ if (this->gl_config.double_buffer) {
+ flags |= SDL_DOUBLEBUF;
+ }
+ }
+#endif
+ if ((flags & SDL_DOUBLEBUF) && ((XBIOS_cvdo>>16) != VDO_MILAN)) {
+ num_buffers = 2;
+ modeflags |= SDL_DOUBLEBUF;
+ }
+
+ /* Allocate buffers */
+ for (i=0; i<num_buffers; i++) {
+ if ((XBIOS_cvdo>>16) == VDO_MILAN) {
+ if (i==0) {
+ XBIOS_screensmem[i] = XBIOS_oldvbase;
+ } else {
+ VsetScreen(-1, &XBIOS_screensmem[i], MI_MAGIC, CMD_ALLOCPAGE);
+ }
+ } else {
+ XBIOS_screensmem[i] = Atari_SysMalloc(new_screen_size, MX_STRAM);
+ }
+
+ if (XBIOS_screensmem[i]==NULL) {
+ XBIOS_FreeBuffers(this);
+ SDL_SetError("Can not allocate %d KB for buffer %d", new_screen_size>>10, i);
+ return (NULL);
+ }
+ SDL_memset(XBIOS_screensmem[i], 0, new_screen_size);
+
+ XBIOS_screens[i]=(void *) (( (long) XBIOS_screensmem[i]+256) & 0xFFFFFF00UL);
+ }
+
+ /* Allocate the new pixel format for the screen */
+ if ( ! SDL_ReallocFormat(current, new_depth, 0, 0, 0, 0) ) {
+ XBIOS_FreeBuffers(this);
+ SDL_SetError("Couldn't allocate new pixel format for requested mode");
+ return(NULL);
+ }
+
+ XBIOS_current = new_video_mode;
+ current->w = width;
+ current->h = height;
+ current->pitch = (width * new_depth)>>3;
+
+ /* this is for C2P conversion */
+ XBIOS_pitch = (new_video_mode->width * new_video_mode->depth)>>3;
+
+ if (new_video_mode->flags & XBIOSMODE_C2P)
+ current->pixels = XBIOS_shadowscreen;
+ else
+ current->pixels = XBIOS_screens[0];
+
+ XBIOS_fbnum = 0;
+
+#if SDL_VIDEO_OPENGL
+ if (flags & SDL_OPENGL) {
+ if (!SDL_AtariGL_Init(this, current)) {
+ XBIOS_FreeBuffers(this);
+ SDL_SetError("Can not create OpenGL context");
+ return NULL;
+ }
+
+ modeflags |= SDL_OPENGL;
+ }
+#endif
+
+ current->flags = modeflags;
+
+#ifndef DEBUG_VIDEO_XBIOS
+ /* Now set the video mode */
+ if ((XBIOS_cvdo>>16) == VDO_MILAN) {
+ VsetScreen(-1, XBIOS_screens[0], MI_MAGIC, CMD_SETADR);
+ } else {
+ Setscreen(-1,XBIOS_screens[0],-1);
+ }
+
+ switch(XBIOS_cvdo >> 16) {
+ case VDO_ST:
+ Setscreen(-1,-1,new_video_mode->number);
+
+ /* Reset palette */
+ for (i=0;i<16;i++) {
+ TT_palette[i]= ((i>>1)<<8) | (((i*8)/17)<<4) | (i>>1);
+ }
+ Setpalette(TT_palette);
+ break;
+ case VDO_STE:
+ Setscreen(-1,-1,new_video_mode->number);
+
+ /* Reset palette */
+ for (i=0;i<16;i++)
+ {
+ int c;
+
+ c=((i&1)<<3)|((i>>1)&7);
+ TT_palette[i]=(c<<8)|(c<<4)|c;
+ }
+ Setpalette(TT_palette);
+ break;
+ case VDO_TT:
+ EsetShift(new_video_mode->number);
+ break;
+ case VDO_F30:
+ if (XBIOS_centscreen) {
+ SDL_XBIOS_CentscreenSetmode(this, width, height, new_depth);
+ } else {
+ VsetMode(new_video_mode->number);
+ }
+
+ /* Set hardware palette to black in True Colour */
+ if (new_depth > 8) {
+ SDL_memset(F30_palette, 0, sizeof(F30_palette));
+ VsetRGB(0,256,F30_palette);
+ }
+ break;
+ case VDO_MILAN:
+ VsetScreen(-1, new_video_mode->number, MI_MAGIC, CMD_SETMODE);
+
+ /* Set hardware palette to black in True Colour */
+ if (new_depth > 8) {
+ SDL_memset(F30_palette, 0, sizeof(F30_palette));
+ VsetRGB(0,256,F30_palette);
+ }
+ break;
+ }
+
+ Vsync();
+#endif
+
+ this->UpdateRects = XBIOS_UpdateRects;
+
+ return (current);
+}
+
+/* We don't actually allow hardware surfaces other than the main one */
+static int XBIOS_AllocHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(-1);
+}
+
+static void XBIOS_FreeHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+static int XBIOS_LockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return(0);
+}
+
+static void XBIOS_UnlockHWSurface(_THIS, SDL_Surface *surface)
+{
+ return;
+}
+
+static void XBIOS_UpdateRects(_THIS, int numrects, SDL_Rect *rects)
+{
+ SDL_Surface *surface;
+
+ surface = this->screen;
+
+ if (XBIOS_current->flags & XBIOSMODE_C2P) {
+ int i;
+ int doubleline = (XBIOS_current->flags & XBIOSMODE_DOUBLELINE ? 1 : 0);
+
+ for (i=0;i<numrects;i++) {
+ void *source,*destination;
+ int x1,x2;
+
+ x1 = rects[i].x & ~15;
+ x2 = rects[i].x+rects[i].w;
+ if (x2 & 15) {
+ x2 = (x2 | 15) +1;
+ }
+
+ source = surface->pixels;
+ source += surface->pitch * rects[i].y;
+ source += x1;
+
+ destination = XBIOS_screens[XBIOS_fbnum];
+ destination += XBIOS_pitch * rects[i].y;
+ destination += x1;
+
+ /* Convert chunky to planar screen */
+ SDL_Atari_C2pConvert(
+ source,
+ destination,
+ x2-x1,
+ rects[i].h,
+ doubleline,
+ surface->pitch,
+ XBIOS_pitch
+ );
+ }
+ }
+
+#ifndef DEBUG_VIDEO_XBIOS
+ if ((XBIOS_cvdo>>16) == VDO_MILAN) {
+ VsetScreen(-1, XBIOS_screens[XBIOS_fbnum], MI_MAGIC, CMD_SETADR);
+ } else {
+ Setscreen(-1,XBIOS_screens[XBIOS_fbnum],-1);
+ }
+
+ Vsync();
+#endif
+
+ if ((surface->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF) {
+ XBIOS_fbnum ^= 1;
+ if ((XBIOS_current->flags & XBIOSMODE_C2P) == 0) {
+ surface->pixels=XBIOS_screens[XBIOS_fbnum];
+ }
+ }
+}
+
+static int XBIOS_FlipHWSurface(_THIS, SDL_Surface *surface)
+{
+ if (XBIOS_current->flags & XBIOSMODE_C2P) {
+ void *destscr;
+ int destx;
+ int doubleline = (XBIOS_current->flags & XBIOSMODE_DOUBLELINE ? 1 : 0);
+
+ /* Center on destination screen */
+ destscr = XBIOS_screens[XBIOS_fbnum];
+ destscr += XBIOS_pitch * ((XBIOS_current->height - surface->h) >> 1);
+ destx = (XBIOS_current->width - surface->w) >> 1;
+ destx &= ~15;
+ destscr += destx;
+
+ /* Convert chunky to planar screen */
+ SDL_Atari_C2pConvert(
+ surface->pixels,
+ destscr,
+ surface->w,
+ surface->h,
+ doubleline,
+ surface->pitch,
+ XBIOS_pitch
+ );
+ }
+
+#ifndef DEBUG_VIDEO_XBIOS
+ if ((XBIOS_cvdo>>16) == VDO_MILAN) {
+ VsetScreen(-1, XBIOS_screens[XBIOS_fbnum], MI_MAGIC, CMD_SETADR);
+ } else {
+ Setscreen(-1,XBIOS_screens[XBIOS_fbnum],-1);
+ }
+
+ Vsync();
+#endif
+
+ if ((surface->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF) {
+ XBIOS_fbnum ^= 1;
+ if ((XBIOS_current->flags & XBIOSMODE_C2P) == 0) {
+ surface->pixels=XBIOS_screens[XBIOS_fbnum];
+ }
+ }
+
+ return(0);
+}
+
+static int XBIOS_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
+{
+#ifndef DEBUG_VIDEO_XBIOS
+ int i;
+ int r,v,b;
+
+ switch( XBIOS_cvdo >> 16) {
+ case VDO_ST:
+ case VDO_STE:
+ for (i=0;i<ncolors;i++)
+ {
+ r = colors[i].r;
+ v = colors[i].g;
+ b = colors[i].b;
+
+ TT_palette[firstcolor+i]=((r*30)+(v*59)+(b*11))/100;
+ }
+ SDL_Atari_C2pConvert4_pal(TT_palette); /* convert the lighting */
+ break;
+ case VDO_TT:
+ for(i = 0; i < ncolors; i++)
+ {
+ r = colors[i].r;
+ v = colors[i].g;
+ b = colors[i].b;
+
+ TT_palette[i]=((r>>4)<<8)|((v>>4)<<4)|(b>>4);
+ }
+ EsetPalette(firstcolor,ncolors,TT_palette);
+ break;
+ case VDO_F30:
+ case VDO_MILAN:
+ for(i = 0; i < ncolors; i++)
+ {
+ r = colors[i].r;
+ v = colors[i].g;
+ b = colors[i].b;
+
+ F30_palette[i]=(r<<16)|(v<<8)|b;
+ }
+ VsetRGB(firstcolor,ncolors,F30_palette);
+ break;
+ }
+#endif
+
+ return(1);
+}
+
+/* Note: If we are terminated, this could be called in the middle of
+ another SDL video routine -- notably UpdateRects.
+*/
+static void XBIOS_VideoQuit(_THIS)
+{
+ int i,j;
+
+ Atari_ShutdownEvents();
+
+ /* Restore video mode and palette */
+#ifndef DEBUG_VIDEO_XBIOS
+ switch(XBIOS_cvdo >> 16) {
+ case VDO_ST:
+ case VDO_STE:
+ Setscreen(-1,XBIOS_oldvbase,XBIOS_oldvmode);
+ if (XBIOS_oldnumcol) {
+ Setpalette(XBIOS_oldpalette);
+ }
+ break;
+ case VDO_TT:
+ Setscreen(-1,XBIOS_oldvbase,-1);
+ EsetShift(XBIOS_oldvmode);
+ if (XBIOS_oldnumcol) {
+ EsetPalette(0, XBIOS_oldnumcol, XBIOS_oldpalette);
+ }
+ break;
+ case VDO_F30:
+ Setscreen(-1, XBIOS_oldvbase, -1);
+ if (XBIOS_centscreen) {
+ SDL_XBIOS_CentscreenRestore(this, XBIOS_oldvmode);
+ } else {
+ VsetMode(XBIOS_oldvmode);
+ }
+ if (XBIOS_oldnumcol) {
+ VsetRGB(0, XBIOS_oldnumcol, XBIOS_oldpalette);
+ }
+ break;
+ case VDO_MILAN:
+ VsetScreen(-1, &XBIOS_oldvbase, MI_MAGIC, CMD_SETADR);
+ VsetScreen(-1, &XBIOS_oldvmode, MI_MAGIC, CMD_SETMODE);
+ if (XBIOS_oldnumcol) {
+ VsetRGB(0, XBIOS_oldnumcol, XBIOS_oldpalette);
+ }
+ break;
+ }
+ Vsync();
+#endif
+
+#if SDL_VIDEO_OPENGL
+ if (gl_active) {
+ SDL_AtariGL_Quit(this, SDL_TRUE);
+ }
+#endif
+
+ if (XBIOS_oldpalette) {
+ SDL_free(XBIOS_oldpalette);
+ XBIOS_oldpalette=NULL;
+ }
+ XBIOS_FreeBuffers(this);
+
+ /* Free mode list */
+ for ( i=0; i<NUM_MODELISTS; ++i ) {
+ if ( SDL_modelist[i] != NULL ) {
+ for ( j=0; SDL_modelist[i][j]; ++j )
+ SDL_free(SDL_modelist[i][j]);
+ SDL_free(SDL_modelist[i]);
+ SDL_modelist[i] = NULL;
+ }
+ if ( SDL_xbiosmode[i] != NULL ) {
+ for ( j=0; SDL_xbiosmode[i][j]; ++j )
+ SDL_free(SDL_xbiosmode[i][j]);
+ SDL_free(SDL_xbiosmode[i]);
+ SDL_xbiosmode[i] = NULL;
+ }
+ }
+
+ this->screen->pixels = NULL;
+
+ /* Restore screensavers */
+ if (SDL_XBIOS_TveillePresent(this)) {
+ SDL_XBIOS_TveilleEnable(this);
+ }
+}
+
+#if SDL_VIDEO_OPENGL
+
+static void XBIOS_GL_SwapBuffers(_THIS)
+{
+ SDL_AtariGL_SwapBuffers(this);
+ XBIOS_FlipHWSurface(this, this->screen);
+ SDL_AtariGL_MakeCurrent(this);
+}
+
+#endif
diff --git a/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios.h b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios.h
new file mode 100644
index 0000000..3ad6827
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios.h
@@ -0,0 +1,111 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#ifndef _SDL_xbios_h
+#define _SDL_xbios_h
+
+#include "SDL_stdinc.h"
+#include "../SDL_sysvideo.h"
+
+/* Hidden "this" pointer for the video functions */
+#define _THIS SDL_VideoDevice *this
+
+#define XBIOSMODE_DOUBLELINE (1<<0)
+#define XBIOSMODE_C2P (1<<1)
+
+typedef struct
+{
+ Uint16 number; /* Video mode number */
+ Uint16 width; /* Size */
+ Uint16 height;
+ Uint16 depth; /* bits per plane */
+ Uint16 flags;
+} xbiosmode_t;
+
+/* Private display data */
+#define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */
+
+struct SDL_PrivateVideoData {
+ long cookie_vdo;
+ long old_video_mode; /* Old video mode before entering SDL */
+ void *old_video_base; /* Old pointer to screen buffer */
+ void *old_palette; /* Old palette */
+ Uint32 old_num_colors; /* Nb of colors in saved palette */
+
+ void *screens[2]; /* Pointers to aligned screen buffer */
+ void *screensmem[2]; /* Pointers to screen buffer */
+ void *shadowscreen; /* Shadow screen for c2p conversion */
+ int frame_number; /* Number of frame for double buffer */
+ int pitch; /* Destination line width for C2P */
+
+ SDL_bool centscreen; /* Centscreen extension present ? */
+
+ xbiosmode_t *current; /* Current set mode */
+ int SDL_nummodes[NUM_MODELISTS];
+ SDL_Rect **SDL_modelist[NUM_MODELISTS];
+ xbiosmode_t **SDL_xbiosmode[NUM_MODELISTS];
+};
+
+/* _VDO cookie values */
+enum {
+ VDO_ST=0,
+ VDO_STE,
+ VDO_TT,
+ VDO_F30,
+ VDO_MILAN
+};
+
+/* Monitor types */
+enum {
+ MONITOR_MONO=0,
+ MONITOR_TV,
+ MONITOR_VGA,
+ MONITOR_RGB
+};
+
+/* EgetShift masks */
+#define ES_MODE 0x0700
+
+/* Hidden structure -> variables names */
+#define SDL_nummodes (this->hidden->SDL_nummodes)
+#define SDL_modelist (this->hidden->SDL_modelist)
+#define SDL_xbiosmode (this->hidden->SDL_xbiosmode)
+#define XBIOS_mutex (this->hidden->mutex)
+#define XBIOS_cvdo (this->hidden->cookie_vdo)
+#define XBIOS_oldpalette (this->hidden->old_palette)
+#define XBIOS_oldnumcol (this->hidden->old_num_colors)
+#define XBIOS_oldvbase (this->hidden->old_video_base)
+#define XBIOS_oldvmode (this->hidden->old_video_mode)
+#define XBIOS_screens (this->hidden->screens)
+#define XBIOS_screensmem (this->hidden->screensmem)
+#define XBIOS_shadowscreen (this->hidden->shadowscreen)
+#define XBIOS_fbnum (this->hidden->frame_number)
+#define XBIOS_pitch (this->hidden->pitch)
+#define XBIOS_centscreen (this->hidden->centscreen)
+#define XBIOS_current (this->hidden->current)
+
+/*--- Functions prototypes ---*/
+
+void SDL_XBIOS_AddMode(_THIS, int actually_add, const xbiosmode_t *modeinfo);
+
+#endif /* _SDL_xbios_h */
diff --git a/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_blowup.c b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_blowup.c
new file mode 100644
index 0000000..2950b84
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_blowup.c
@@ -0,0 +1,77 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ Blowup extension definitions
+
+ Patrice Mandin
+*/
+
+#include <mint/falcon.h>
+
+#include "SDL_xbios.h"
+#include "SDL_xbios_blowup.h"
+
+void SDL_XBIOS_ListBlowupModes(_THIS, int actually_add, blow_cookie_t *cookie_blow)
+{
+ int i, j, num_mode, bank;
+ blow_mode_t *blow_mode;
+ xbiosmode_t modeinfo;
+
+ if (actually_add) {
+ /* Set bit 15 for old modes */
+ for (i=0;i<NUM_MODELISTS;i++) {
+ if ( SDL_xbiosmode[i] != NULL ) {
+ for ( j=0; SDL_xbiosmode[i][j]; ++j ) {
+ SDL_xbiosmode[i][j]->number |= 1<<15;
+ }
+ }
+ }
+ }
+
+ /* Add Blowup modes for 8 and 16 bpp */
+ for (num_mode=3; num_mode<5; num_mode++) {
+ bank = cookie_blow->num_mode[num_mode];
+ blow_mode = &(cookie_blow->blowup_modes[num_mode+(bank*5)]);
+
+ /* Check extended mode enabled */
+ if (blow_mode->enabled == 0) {
+ /* Check monitor needed for this mode */
+ if ((blow_mode->monitor == cookie_blow->montype)
+ || ((blow_mode->monitor == MONITOR_TV)
+ && (cookie_blow->montype == MONITOR_RGB))
+ || ((blow_mode->monitor == MONITOR_RGB)
+ && (cookie_blow->montype == MONITOR_TV)))
+ {
+ /* we can use this extended mode */
+ modeinfo.number = (num_mode == 3 ? BPS8 : BPS16);
+ modeinfo.width = blow_mode->width + 1;
+ modeinfo.height = blow_mode->height + 1;
+ modeinfo.depth = (num_mode == 3 ? 8 : 16);
+ modeinfo.flags = (modeinfo.depth == 8 ? XBIOSMODE_C2P : 0);
+
+ SDL_XBIOS_AddMode(this, actually_add, &modeinfo);
+ }
+ }
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_blowup.h b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_blowup.h
new file mode 100644
index 0000000..09a3651
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_blowup.h
@@ -0,0 +1,86 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ Blowup extension definitions
+
+ Patrice Mandin
+*/
+
+#ifndef _SDL_xbios_blowup_h
+#define _SDL_xbios_blowup_h
+
+#include "SDL_xbios.h"
+
+/*--- Types ---*/
+
+typedef struct {
+ /* 64 bytes */
+ unsigned short enabled; /* Extended mode enabled ? 0=yes, <>0=no */
+ unsigned short dummy10[6];
+ unsigned short registers_0E; /* value for register 0xffff820e */
+ unsigned short registers_10; /* value for register 0xffff8210 */
+ unsigned short dummy11[23];
+
+ /* 64 bytes */
+ unsigned short width; /* width-1 */
+ unsigned short height; /* height-1 */
+ unsigned short dummy20;
+ unsigned long screensize; /* screensize in bytes */
+ unsigned short dummy21[8];
+ unsigned short virtual; /* Virtual screen ? */
+ unsigned short virwidth; /* Virtual screen width */
+ unsigned short virheight; /* Virtual screen height */
+
+ unsigned short dummy22;
+ unsigned short monitor; /* Monitor defined for this mode */
+ unsigned short extension; /* Extended mode defined ? 0=yes, 1=no */
+ unsigned short dummy23[13];
+
+ /* 64 bytes */
+ unsigned short dummy30;
+ unsigned short registers_82[6]; /* values for registers 0xffff8282-8c */
+ unsigned short dummy31[9];
+
+ unsigned short dummy32;
+ unsigned short registers_A2[6]; /* values for registers 0xffff82a2-ac */
+ unsigned short dummy33[9];
+
+ /* 64 bytes */
+ unsigned short registers_C0; /* value for register 0xffff82c0 */
+ unsigned short registers_C2; /* value for register 0xffff82c2 */
+ unsigned short dummy40[30];
+} blow_mode_t;
+
+typedef struct {
+ blow_mode_t blowup_modes[10];
+ unsigned char num_mode[6];
+ unsigned long dummy;
+ unsigned short montype;
+} blow_cookie_t;
+
+/*--- Functions prototypes ---*/
+
+void SDL_XBIOS_ListBlowupModes(_THIS, int actually_add, blow_cookie_t *cookie_blow);
+
+#endif /* _SDL_xbios_blowup_h */
diff --git a/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_centscreen.c b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_centscreen.c
new file mode 100644
index 0000000..6daade2
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_centscreen.c
@@ -0,0 +1,104 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ Centscreen extension definitions
+
+ Patrice Mandin
+*/
+
+#include <mint/falcon.h>
+
+#include "SDL_xbios.h"
+#include "SDL_xbios_centscreen.h"
+
+int SDL_XBIOS_ListCentscreenModes(_THIS, int actually_add)
+{
+ centscreen_mode_t curmode, listedmode;
+ unsigned long result;
+ int cur_handle; /* Current Centscreen mode handle */
+
+ /* Add Centscreen modes */
+ Vread(&curmode);
+ cur_handle = curmode.handle;
+ curmode.mode = curmode.physx = curmode.physy = curmode.plan =
+ curmode.logx = curmode.logy = -1;
+
+ result = Vfirst(&curmode, &listedmode);
+ if (result==0) {
+ while (result==0) {
+ /* Don't add modes with virtual screen */
+ if ((listedmode.mode & CSCREEN_VIRTUAL)==0) {
+ /* Don't add modes with bpp<8 */
+ if (listedmode.plan>=8) {
+ xbiosmode_t modeinfo;
+
+ modeinfo.number = listedmode.mode;
+ modeinfo.width = listedmode.physx;
+ modeinfo.height = listedmode.physy;
+ modeinfo.depth = listedmode.plan;
+ modeinfo.flags = (modeinfo.depth == 8 ? XBIOSMODE_C2P : 0);
+
+ SDL_XBIOS_AddMode(this, actually_add, &modeinfo);
+ }
+ }
+ SDL_memcpy(&curmode, &listedmode, sizeof(centscreen_mode_t));
+ curmode.mode = curmode.physx = curmode.physy = curmode.plan =
+ curmode.logx = curmode.logy = -1;
+ result = Vnext(&curmode, &listedmode);
+ }
+ } else {
+ fprintf(stderr, "No suitable Centscreen modes\n");
+ }
+
+ return cur_handle;
+}
+
+void SDL_XBIOS_CentscreenSetmode(_THIS, int width, int height, int planes)
+{
+ centscreen_mode_t newmode, curmode;
+
+ newmode.handle = newmode.mode = newmode.logx = newmode.logy = -1;
+ newmode.physx = width;
+ newmode.physy = height;
+ newmode.plan = planes;
+ Vwrite(0, &newmode, &curmode);
+
+#ifdef SDL_VIDEO_DISABLE_SCREENSAVER
+ /* Disable screensaver */
+ Vread(&newmode);
+ newmode.mode &= ~(CSCREEN_SAVER|CSCREEN_ENERGYSTAR);
+ Vwrite(0, &newmode, &curmode);
+#endif /* SDL_VIDEO_DISABLE_SCREENSAVER */
+}
+
+void SDL_XBIOS_CentscreenRestore(_THIS, int prev_handle)
+{
+ centscreen_mode_t newmode, curmode;
+
+ /* Restore old video mode */
+ newmode.handle = prev_handle;
+ newmode.mode = newmode.physx = newmode.physy = newmode.plan =
+ newmode.logx = newmode.logy = -1;
+ Vwrite(0, &newmode, &curmode);
+}
diff --git a/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_centscreen.h b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_centscreen.h
new file mode 100644
index 0000000..dfe88d9
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_centscreen.h
@@ -0,0 +1,114 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ Centscreen extension definitions
+
+ Patrice Mandin
+*/
+
+#ifndef _SDL_xbios_centscreen_h
+#define _SDL_xbios_centscreen_h
+
+#include <mint/falcon.h> /* for trap_14_xxx macros */
+
+#include "SDL_xbios.h"
+
+/*--- Defines ---*/
+
+#define CSCREEN_ENERGYSTAR (1<<9)
+#define CSCREEN_SAVER (1<<10)
+#define CSCREEN_VIRTUAL (1<<11)
+#define CSCREEN_EXTCLOCK_CT2 (1<<12)
+#define CSCREEN_EXTCLOCK (1<<13)
+#define CSCREEN_STANDARD (1<<14)
+#define CSCREEN_DEFAULT (1<<15)
+
+/*--- Structures ---*/
+
+typedef struct {
+ unsigned short handle; /* videomode handle */
+ unsigned short mode; /* Falcon videomode code */
+ unsigned short physx; /* visible width */
+ unsigned short physy; /* visible height */
+ unsigned short plan; /* bitplanes */
+ unsigned short logx; /* virtual width */
+ unsigned short logy; /* virtual height */
+ unsigned short eco; /* screen saver delay */
+ unsigned short eco2; /* energy star screen saver delay */
+ unsigned short wsize; /* screen width (mm) */
+ unsigned short hsize; /* screen height (mm) */
+ unsigned short dummy[21];
+ unsigned char name[32]; /* videomode name */
+} centscreen_mode_t;
+
+/*--- Functions prototypes ---*/
+
+#define Vread(current_mode) \
+ (void)trap_14_wl((short)0x41,(long)(current_mode))
+#define Vwrite(init_vdi, inparam, outparam) \
+ (long)trap_14_wwll((short)0x42,(short)(init_vdi),(long)(inparam),(long)(outparam))
+#define Vattrib(inparam, outparam) \
+ (void)trap_14_wll((short)0x43,(long)(inparam),(long)(outparam))
+#define Vcreate(inparam, outparam) \
+ (void)trap_14_wll((short)0x44,(long)(inparam),(long)(outparam))
+#define Vdelete(handle) \
+ (long)trap_14_ww((short)0x45,(short)(handle))
+#define Vfirst(mask,mode) \
+ (long)trap_14_wll((short)0x46,(long)(mask),(long)(mode))
+#define Vnext(mask,mode) \
+ (long)trap_14_wll((short)0x47,(long)(mask),(long)(mode))
+#define Vvalid(handle) \
+ (long)trap_14_ww((short)0x48,(short)(handle))
+#define Vload() \
+ (long)trap_14_w((short)0x49)
+#define Vsave() \
+ (long)trap_14_w((short)0x4a)
+#define Vopen() \
+ (long)trap_14_w((short)0x4b)
+#define Vclose() \
+ (long)trap_14_w((short)0x4c)
+#define Vscroll(scrollmode) \
+ (long)trap_14_ww((short)0x4d,(short)(scrollmode))
+#define Voffset() \
+ (long)trap_14_w((short)0x4e)
+#define Vseek() \
+ (long)trap_14_w((short)0x4f)
+#define Vlock(cmd) \
+ (long)trap_14_ww((short)0x50,(short)(cmd))
+#define SetMon(montype) \
+ (long)trap_14_ww((short)0x51,(short)(montype))
+#define MultiMon(cmd) \
+ (long)trap_14_ww((short)0x52,(short)(cmd))
+#define VSizeComp() \
+ (long)trap_14_w((short)0x53)
+#define Vsize(mode) \
+ (long)trap_14_wl((short)0x54,(long)(mode))
+
+/*--- Functions prototypes ---*/
+
+int SDL_XBIOS_ListCentscreenModes(_THIS, int actually_add);
+void SDL_XBIOS_CentscreenSetmode(_THIS, int width, int height, int planes);
+void SDL_XBIOS_CentscreenRestore(_THIS, int prev_handle);
+
+#endif /* _SDL_xbios_centscreen_h */
diff --git a/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_milan.c b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_milan.c
new file mode 100644
index 0000000..a99ee18
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_milan.c
@@ -0,0 +1,106 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ Milan Xbios video functions
+
+ Patrice Mandin
+*/
+
+#include <mint/cookie.h>
+#include <mint/falcon.h>
+
+#include "SDL_xbios.h"
+#include "SDL_xbios_milan.h"
+
+#define NUM_PREDEFINED_MODES 7
+
+typedef struct {
+ Uint16 width, height;
+} predefined_mode_t;
+
+static const predefined_mode_t mode_list[NUM_PREDEFINED_MODES]={
+ {640,400},
+ {640,480},
+ {800,608},
+ {1024,768},
+ {1152,864},
+ {1280,1024},
+ {1600,1200}
+};
+
+static const Uint8 mode_bpp[4]={
+ 8, 15, 16, 32
+};
+
+/*--- Variables ---*/
+
+static int enum_actually_add;
+static SDL_VideoDevice *enum_this;
+
+/*--- Functions ---*/
+
+static unsigned long /*cdecl*/ enumfunc(SCREENINFO *inf, unsigned long flag)
+{
+ xbiosmode_t modeinfo;
+
+ modeinfo.number = inf->devID;
+ modeinfo.width = inf->scrWidth;
+ modeinfo.height = inf->scrHeight;
+ modeinfo.depth = inf->scrPlanes;
+ modeinfo.flags = 0;
+
+ SDL_XBIOS_AddMode(enum_this, enum_actually_add, &modeinfo);
+
+ return ENUMMODE_CONT;
+}
+
+void SDL_XBIOS_ListMilanModes(_THIS, int actually_add)
+{
+ int i;
+
+ /* Read validated predefined modes */
+ for (i=0; i<NUM_PREDEFINED_MODES; i++) {
+ int j;
+ Uint16 deviceid = 0x1000 + (i<<4);
+
+ for (j=1; j<4; j++) {
+ if (Validmode(deviceid + j)) {
+ xbiosmode_t modeinfo;
+
+ modeinfo.number = deviceid + j;
+ modeinfo.width = mode_list[i].width;
+ modeinfo.height = mode_list[i].height;
+ modeinfo.depth = mode_bpp[j-1];
+ modeinfo.flags = 0;
+
+ SDL_XBIOS_AddMode(this, actually_add, &modeinfo);
+ }
+ }
+ }
+
+ /* Read custom created modes */
+ enum_this = this;
+ enum_actually_add = actually_add;
+ VsetScreen(-1, &enumfunc, MI_MAGIC, CMD_ENUMMODES);
+}
diff --git a/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_milan.h b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_milan.h
new file mode 100644
index 0000000..bcf5c8a
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_milan.h
@@ -0,0 +1,129 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ Milan Xbios video functions
+
+ Patrice Mandin
+*/
+
+#ifndef _SDL_xbios_milan_h
+#define _SDL_xbios_milan_h
+
+#include "SDL_xbios.h"
+
+/*--- Defines ---*/
+
+/* Vsetscreen() parameters */
+#define MI_MAGIC 0x4D49
+
+enum {
+ CMD_GETMODE=0,
+ CMD_SETMODE,
+ CMD_GETINFO,
+ CMD_ALLOCPAGE,
+ CMD_FREEPAGE,
+ CMD_FLIPPAGE,
+ CMD_ALLOCMEM,
+ CMD_FREEMEM,
+ CMD_SETADR,
+ CMD_ENUMMODES
+};
+
+enum {
+ ENUMMODE_EXIT=0,
+ ENUMMODE_CONT
+};
+
+enum {
+ BLK_ERR=0,
+ BLK_OK,
+ BLK_CLEARED
+};
+
+/* scrFlags */
+#define SCRINFO_OK 1
+
+/* scrClut */
+#define NO_CLUT 0
+#define HARD_CLUT 1
+#define SOFT_CLUT 2
+
+/* scrFormat */
+#define INTERLEAVE_PLANES 0
+#define STANDARD_PLANES 1
+#define PACKEDPIX_PLANES 2
+
+/* bitFlags */
+#define STANDARD_BITS 1
+#define FALCON_BITS 2
+#define INTEL_BITS 8
+
+/*--- Structures ---*/
+
+typedef struct _scrblk {
+ unsigned long size; /* size of strukture */
+ unsigned long blk_status; /* status bits of blk */
+ unsigned long blk_start; /* Start Adress */
+ unsigned long blk_len; /* length of memblk */
+ unsigned long blk_x; /* x pos in total screen*/
+ unsigned long blk_y; /* y pos in total screen */
+ unsigned long blk_w; /* width */
+ unsigned long blk_h; /* height */
+ unsigned long blk_wrap; /* width in bytes */
+} SCRMEMBLK;
+
+typedef struct screeninfo {
+ unsigned long size; /* Size of structure */
+ unsigned long devID; /* device id number */
+ unsigned char name[64]; /* Friendly name of Screen */
+ unsigned long scrFlags; /* some Flags */
+ unsigned long frameadr; /* Adress of framebuffer */
+ unsigned long scrHeight; /* visible X res */
+ unsigned long scrWidth; /* visible Y res */
+ unsigned long virtHeight; /* virtual X res */
+ unsigned long virtWidth; /* virtual Y res */
+ unsigned long scrPlanes; /* color Planes */
+ unsigned long scrColors; /* # of colors */
+ unsigned long lineWrap; /* # of Bytes to next line */
+ unsigned long planeWarp; /* # of Bytes to next plane */
+ unsigned long scrFormat; /* screen Format */
+ unsigned long scrClut; /* type of clut */
+ unsigned long redBits; /* Mask of Red Bits */
+ unsigned long greenBits; /* Mask of Green Bits */
+ unsigned long blueBits; /* Mask of Blue Bits */
+ unsigned long alphaBits; /* Mask of Alpha Bits */
+ unsigned long genlockBits;/* Mask of Genlock Bits */
+ unsigned long unusedBits; /* Mask of unused Bits */
+ unsigned long bitFlags; /* Bits organisation flags */
+ unsigned long maxmem; /* max. memory in this mode */
+ unsigned long pagemem; /* needed memory for one page */
+ unsigned long max_x; /* max. possible width */
+ unsigned long max_y; /* max. possible heigth */
+} SCREENINFO;
+
+/*--- Functions prototypes ---*/
+
+void SDL_XBIOS_ListMilanModes(_THIS, int actually_add);
+
+#endif /* _SDL_xbios_milan_h */
diff --git a/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_sb3.c b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_sb3.c
new file mode 100644
index 0000000..8b0ed2c
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_sb3.c
@@ -0,0 +1,83 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ ScreenBlaster 3 functions
+
+ Patrice Mandin
+*/
+
+/*--- Includes ---*/
+
+#include "SDL_stdinc.h"
+#include "SDL_xbios.h"
+#include "SDL_xbios_sb3.h"
+
+/*--- Defines ---*/
+
+const int SDL_XBIOS_scpn_planes_device[]={
+ SCPN_DEV_1BPP,
+ SCPN_DEV_4BPP,
+ SCPN_DEV_8BPP,
+ SCPN_DEV_16BPP,
+ SCPN_DEV_2BPP,
+ SCPN_DEV_4BPP,
+ SCPN_DEV_1BPP
+};
+
+/*--- Functions ---*/
+
+int SDL_XBIOS_SB3Usable(scpn_cookie_t *cookie_scpn)
+{
+ scpn_screeninfo_t *scrinfo;
+ int bpp;
+
+ /* Check if current SB3 mode is usable, i.e. 8 or 16bpp */
+ scrinfo = cookie_scpn->screen_info;
+ bpp = 1<<(SDL_XBIOS_scpn_planes_device[scrinfo->device]);
+
+ if ((bpp==8) || (bpp==16)) {
+ return 1;
+ }
+
+ return 0;
+}
+
+void SDL_XBIOS_ListSB3Modes(_THIS, int actually_add, scpn_cookie_t *cookie_scpn)
+{
+ scpn_screeninfo_t *scrinfo;
+ xbiosmode_t modeinfo;
+
+ scrinfo = cookie_scpn->screen_info;
+ if (actually_add) {
+ scrinfo->h_pos = scrinfo->v_pos = 0;
+ }
+
+ modeinfo.number = -1;
+ modeinfo.width = scrinfo->virtual_width;
+ modeinfo.height = scrinfo->virtual_height;
+ modeinfo.depth = 1<<(SDL_XBIOS_scpn_planes_device[scrinfo->device]);
+ modeinfo.flags = (modeinfo.depth == 8 ? XBIOSMODE_C2P : 0);
+
+ SDL_XBIOS_AddMode(this, actually_add, &modeinfo);
+}
diff --git a/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_sb3.h b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_sb3.h
new file mode 100644
index 0000000..3272c31
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_sb3.h
@@ -0,0 +1,82 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ ScreenBlaster 3 definitions
+
+ Patrice Mandin
+*/
+
+#ifndef _SDL_xbios_sb3_h_
+#define _SDL_xbios_sb3_h_
+
+/*--- Defines ---*/
+
+#ifndef C_SCPN
+#define C_SCPN 0x5343504EL
+#endif
+
+#define SCPN_DEV_1BPP 0
+#define SCPN_DEV_2BPP 1
+#define SCPN_DEV_4BPP 2
+#define SCPN_DEV_8BPP 3
+#define SCPN_DEV_16BPP 4
+
+extern const int SDL_XBIOS_scpn_planes_device[];
+
+/*--- Types ---*/
+
+typedef struct {
+ unsigned short virtual_width; /* Virtual screen width */
+ unsigned short virtual_height; /* Virtual screen height */
+ unsigned short visible_width; /* Visible width */
+ unsigned short visible_height; /* Visible height */
+ unsigned short h_pos; /* Horizontal position in virtual screen */
+ unsigned short v_pos; /* Vertical position in virtual screen */
+ unsigned short dummy;
+ unsigned long size; /* Size of screen in bytes */
+ unsigned short device; /* Device number to find planes = getRez() */
+ /* = Index in scpn_planes_device[] */
+} scpn_screeninfo_t;
+
+typedef struct {
+ unsigned long magic; /* just a BRA assembler jump */
+ unsigned short version;
+ void *dummy1;
+ unsigned short ptsout0_1;
+ unsigned short ptsout0_2;
+ unsigned short dummy3;
+ unsigned char date[8]; /* Date of program build */
+ unsigned char asm_string[30]; /* 10 times the 'ASM' string */
+ unsigned short dummy4;
+ scpn_screeninfo_t *screen_info;
+ unsigned short dummy6;
+} scpn_cookie_t;
+
+/*--- Function prototypes ---*/
+
+int SDL_XBIOS_SB3Usable(scpn_cookie_t *cookie_scpn);
+
+void SDL_XBIOS_ListSB3Modes(_THIS, int actually_add, scpn_cookie_t *cookie_scpn);
+
+#endif /* _SDL_xbios_sb3_h_ */
diff --git a/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_tveille.c b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_tveille.c
new file mode 100644
index 0000000..b0f8499
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_tveille.c
@@ -0,0 +1,63 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ Turbo veille screensaver
+
+ Patrice Mandin
+*/
+
+#include <mint/cookie.h>
+
+#include "SDL_xbios.h"
+#include "SDL_xbios_tveille.h"
+
+static tveille_t *cookie_veil = NULL;
+static int status;
+
+int SDL_XBIOS_TveillePresent(_THIS)
+{
+ long dummy;
+
+ cookie_veil = NULL;
+ if (Getcookie(C_VeiL, &dummy) == C_FOUND) {
+ cookie_veil = (tveille_t *) dummy;
+ }
+
+ return (cookie_veil != NULL);
+}
+
+void SDL_XBIOS_TveilleDisable(_THIS)
+{
+ if (cookie_veil) {
+ status = cookie_veil->enabled;
+ cookie_veil->enabled = 0xff;
+ }
+}
+
+void SDL_XBIOS_TveilleEnable(_THIS)
+{
+ if (cookie_veil) {
+ cookie_veil->enabled = status;
+ }
+}
diff --git a/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_tveille.h b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_tveille.h
new file mode 100644
index 0000000..8a9cd7d
--- /dev/null
+++ b/distrib/sdl-1.2.15/src/video/xbios/SDL_xbios_tveille.h
@@ -0,0 +1,64 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2012 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Sam Lantinga
+ slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/*
+ Turbo veille screensaver
+
+ Patrice Mandin
+*/
+
+#ifndef _SDL_xbios_tveille_h
+#define _SDL_xbios_tveille_h
+
+#include "SDL_xbios.h"
+
+/*--- Structures ---*/
+
+typedef struct {
+ unsigned long version;
+ void (*prg_ptr)();
+ void (*kbd_ptr)();
+ void (*vbl_ptr)();
+ unsigned long vbl_count;
+ void (*oldkbd_ptr)();
+ unsigned long off_count;
+ unsigned long prg_size;
+ unsigned long dummy1[4];
+ unsigned char dummy2;
+ unsigned char status;
+ unsigned short freq;
+ unsigned short dummy3;
+ unsigned char clear_first;
+ unsigned char enabled; /* 0=enabled, 0xff=disabled */
+ unsigned char serial_redir;
+ unsigned char dummy4;
+ void (*oldserial_ptr)();
+} tveille_t;
+
+/*--- Functions prototypes ---*/
+
+int SDL_XBIOS_TveillePresent(_THIS);
+void SDL_XBIOS_TveilleDisable(_THIS);
+void SDL_XBIOS_TveilleEnable(_THIS);
+
+#endif /* _SDL_xbios_tveille_h */
diff --git a/distrib/sdl-1.2.15/symbian.zip b/distrib/sdl-1.2.15/symbian.zip
new file mode 100644
index 0000000..b3686e9
--- /dev/null
+++ b/distrib/sdl-1.2.15/symbian.zip
Binary files differ
diff --git a/distrib/sdl-1.2.15/test/COPYING b/distrib/sdl-1.2.15/test/COPYING
new file mode 100644
index 0000000..c4c27e0
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/COPYING
@@ -0,0 +1,8 @@
+
+The test programs in this directory tree are for demonstrating and
+testing the functionality of the SDL library, and are placed in the
+public domain.
+
+October 28, 1997
+--
+ Sam Lantinga (slouken@libsdl.org)
diff --git a/distrib/sdl-1.2.15/test/Makefile.in b/distrib/sdl-1.2.15/test/Makefile.in
new file mode 100644
index 0000000..7d5bb8b
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/Makefile.in
@@ -0,0 +1,117 @@
+# Makefile to build the SDL tests
+
+srcdir = @srcdir@
+
+CC = @CC@
+EXE = @EXE@
+CFLAGS = @CFLAGS@
+LIBS = @LIBS@
+
+TARGETS = checkkeys$(EXE) graywin$(EXE) loopwave$(EXE) testalpha$(EXE) testbitmap$(EXE) testblitspeed$(EXE) testcdrom$(EXE) testcursor$(EXE) testdyngl$(EXE) testerror$(EXE) testfile$(EXE) testgamma$(EXE) testgl$(EXE) testhread$(EXE) testiconv$(EXE) testjoystick$(EXE) testkeys$(EXE) testlock$(EXE) testoverlay2$(EXE) testoverlay$(EXE) testpalette$(EXE) testplatform$(EXE) testsem$(EXE) testsprite$(EXE) testtimer$(EXE) testver$(EXE) testvidinfo$(EXE) testwin$(EXE) testwm$(EXE) threadwin$(EXE) torturethread$(EXE) testloadso$(EXE)
+
+all: $(TARGETS)
+
+checkkeys$(EXE): $(srcdir)/checkkeys.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+graywin$(EXE): $(srcdir)/graywin.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+loopwave$(EXE): $(srcdir)/loopwave.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testalpha$(EXE): $(srcdir)/testalpha.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS) @MATHLIB@
+
+testbitmap$(EXE): $(srcdir)/testbitmap.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testblitspeed$(EXE): $(srcdir)/testblitspeed.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testcdrom$(EXE): $(srcdir)/testcdrom.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testcursor$(EXE): $(srcdir)/testcursor.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testdyngl$(EXE): $(srcdir)/testdyngl.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testerror$(EXE): $(srcdir)/testerror.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testfile$(EXE): $(srcdir)/testfile.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testgamma$(EXE): $(srcdir)/testgamma.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS) @MATHLIB@
+
+testgl$(EXE): $(srcdir)/testgl.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS) @GLLIB@ @MATHLIB@
+
+testhread$(EXE): $(srcdir)/testhread.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testiconv$(EXE): $(srcdir)/testiconv.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testjoystick$(EXE): $(srcdir)/testjoystick.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testkeys$(EXE): $(srcdir)/testkeys.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testlock$(EXE): $(srcdir)/testlock.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testoverlay2$(EXE): $(srcdir)/testoverlay2.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testoverlay$(EXE): $(srcdir)/testoverlay.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testpalette$(EXE): $(srcdir)/testpalette.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS) @MATHLIB@
+
+testplatform$(EXE): $(srcdir)/testplatform.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testsem$(EXE): $(srcdir)/testsem.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testsprite$(EXE): $(srcdir)/testsprite.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS) @MATHLIB@
+
+testtimer$(EXE): $(srcdir)/testtimer.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testver$(EXE): $(srcdir)/testver.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testvidinfo$(EXE): $(srcdir)/testvidinfo.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testwin$(EXE): $(srcdir)/testwin.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testwm$(EXE): $(srcdir)/testwm.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+threadwin$(EXE): $(srcdir)/threadwin.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+torturethread$(EXE): $(srcdir)/torturethread.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+testloadso$(EXE): $(srcdir)/testloadso.c
+ $(CC) -o $@ $? $(CFLAGS) $(LIBS)
+
+
+clean:
+ rm -f $(TARGETS)
+
+distclean: clean
+ rm -f Makefile
+ rm -f config.status config.cache config.log
+ rm -rf $(srcdir)/autom4te*
diff --git a/distrib/sdl-1.2.15/test/README b/distrib/sdl-1.2.15/test/README
new file mode 100644
index 0000000..9cf5659
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/README
@@ -0,0 +1,35 @@
+
+These are test programs for the SDL library:
+
+ checkkeys Watch the key events to check the keyboard
+ graywin Display a gray gradient and center mouse on spacebar
+ loopwave Audio test -- loop playing a WAV file
+ testalpha Display an alpha faded icon -- paint with mouse
+ testbitmap Test displaying 1-bit bitmaps
+ testblitspeed Tests performance of SDL's blitters and converters.
+ testcdrom Sample audio CD control program
+ testcursor Tests custom mouse cursor
+ testdyngl Tests dynamically loading OpenGL library
+ testerror Tests multi-threaded error handling
+ testfile Tests RWops layer
+ testgamma Tests video device gamma ramp
+ testgl A very simple example of using OpenGL with SDL
+ testhread Hacked up test of multi-threading
+ testiconv Tests international string conversion
+ testjoystick List joysticks and watch joystick events
+ testkeys List the available keyboard keys
+ testloadso Tests the loadable library layer
+ testlock Hacked up test of multi-threading and locking
+ testoverlay Tests the software/hardware overlay functionality.
+ testoverlay2 Tests the overlay flickering/scaling during playback.
+ testpalette Tests palette color cycling
+ testplatform Tests types, endianness and cpu capabilities
+ testsem Tests SDL's semaphore implementation
+ testsprite Example of fast sprite movement on the screen
+ testtimer Test the timer facilities
+ testver Check the version and dynamic loading and endianness
+ testvidinfo Show the pixel format of the display and perfom the benchmark
+ testwin Display a BMP image at various depths
+ testwm Test window manager -- title, icon, events
+ threadwin Test multi-threaded event handling
+ torturethread Simple test for thread creation/destruction
diff --git a/distrib/sdl-1.2.15/test/acinclude.m4 b/distrib/sdl-1.2.15/test/acinclude.m4
new file mode 100644
index 0000000..b6df43f
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/acinclude.m4
@@ -0,0 +1,181 @@
+# Configure paths for SDL
+# Sam Lantinga 9/21/99
+# stolen from Manish Singh
+# stolen back from Frank Belew
+# stolen from Manish Singh
+# Shamelessly stolen from Owen Taylor
+
+dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
+dnl
+AC_DEFUN([AM_PATH_SDL],
+[dnl
+dnl Get the cflags and libraries from the sdl-config script
+dnl
+AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
+ sdl_prefix="$withval", sdl_prefix="")
+AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
+ sdl_exec_prefix="$withval", sdl_exec_prefix="")
+AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
+ , enable_sdltest=yes)
+
+ if test x$sdl_exec_prefix != x ; then
+ sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
+ if test x${SDL_CONFIG+set} != xset ; then
+ SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
+ fi
+ fi
+ if test x$sdl_prefix != x ; then
+ sdl_args="$sdl_args --prefix=$sdl_prefix"
+ if test x${SDL_CONFIG+set} != xset ; then
+ SDL_CONFIG=$sdl_prefix/bin/sdl-config
+ fi
+ fi
+
+ if test "x$prefix" != xNONE; then
+ PATH="$prefix/bin:$prefix/usr/bin:$PATH"
+ fi
+ AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
+ min_sdl_version=ifelse([$1], ,0.11.0,$1)
+ AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
+ no_sdl=""
+ if test "$SDL_CONFIG" = "no" ; then
+ no_sdl=yes
+ else
+ SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
+ SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
+
+ sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ if test "x$enable_sdltest" = "xyes" ; then
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $SDL_CFLAGS"
+ CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
+ LIBS="$LIBS $SDL_LIBS"
+dnl
+dnl Now check if the installed SDL is sufficiently new. (Also sanity
+dnl checks the results of sdl-config to some extent
+dnl
+ rm -f conf.sdltest
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "SDL.h"
+
+char*
+my_strdup (char *str)
+{
+ char *new_str;
+
+ if (str)
+ {
+ new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
+ strcpy (new_str, str);
+ }
+ else
+ new_str = NULL;
+
+ return new_str;
+}
+
+int main (int argc, char *argv[])
+{
+ int major, minor, micro;
+ char *tmp_version;
+
+ /* This hangs on some systems (?)
+ system ("touch conf.sdltest");
+ */
+ { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
+
+ /* HP/UX 9 (%@#!) writes to sscanf strings */
+ tmp_version = my_strdup("$min_sdl_version");
+ if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+ printf("%s, bad version string\n", "$min_sdl_version");
+ exit(1);
+ }
+
+ if (($sdl_major_version > major) ||
+ (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
+ (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
+ {
+ return 0;
+ }
+ else
+ {
+ printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
+ printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
+ printf("*** best to upgrade to the required version.\n");
+ printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
+ printf("*** to point to the correct copy of sdl-config, and remove the file\n");
+ printf("*** config.cache before re-running configure\n");
+ return 1;
+ }
+}
+
+],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+ CFLAGS="$ac_save_CFLAGS"
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ if test "x$no_sdl" = x ; then
+ AC_MSG_RESULT(yes)
+ ifelse([$2], , :, [$2])
+ else
+ AC_MSG_RESULT(no)
+ if test "$SDL_CONFIG" = "no" ; then
+ echo "*** The sdl-config script installed by SDL could not be found"
+ echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
+ echo "*** your path, or set the SDL_CONFIG environment variable to the"
+ echo "*** full path to sdl-config."
+ else
+ if test -f conf.sdltest ; then
+ :
+ else
+ echo "*** Could not run SDL test program, checking why..."
+ CFLAGS="$CFLAGS $SDL_CFLAGS"
+ CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
+ LIBS="$LIBS $SDL_LIBS"
+ AC_TRY_LINK([
+#include <stdio.h>
+#include "SDL.h"
+
+int main(int argc, char *argv[])
+{ return 0; }
+#undef main
+#define main K_and_R_C_main
+], [ return 0; ],
+ [ echo "*** The test program compiled, but did not run. This usually means"
+ echo "*** that the run-time linker is not finding SDL or finding the wrong"
+ echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
+ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+ echo "*** to the installed location Also, make sure you have run ldconfig if that"
+ echo "*** is required on your system"
+ echo "***"
+ echo "*** If you have an old version installed, it is best to remove it, although"
+ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+ [ echo "*** The test program failed to compile or link. See the file config.log for the"
+ echo "*** exact error that occured. This usually means SDL was incorrectly installed"
+ echo "*** or that you have moved SDL since it was installed. In the latter case, you"
+ echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
+ CFLAGS="$ac_save_CFLAGS"
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ SDL_CFLAGS=""
+ SDL_LIBS=""
+ ifelse([$3], , :, [$3])
+ fi
+ AC_SUBST(SDL_CFLAGS)
+ AC_SUBST(SDL_LIBS)
+ rm -f conf.sdltest
+])
diff --git a/distrib/sdl-1.2.15/test/autogen.sh b/distrib/sdl-1.2.15/test/autogen.sh
new file mode 100755
index 0000000..939f34c
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/autogen.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# Regenerate configuration files
+cp acinclude.m4 aclocal.m4
+found=false
+for autoconf in autoconf autoconf259 autoconf-2.59
+do if which $autoconf >/dev/null 2>&1; then $autoconf && found=true; break; fi
+done
+if test x$found = xfalse; then
+ echo "Couldn't find autoconf, aborting"
+ exit 1
+fi
diff --git a/distrib/sdl-1.2.15/test/checkkeys.c b/distrib/sdl-1.2.15/test/checkkeys.c
new file mode 100644
index 0000000..8dbb24f
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/checkkeys.c
@@ -0,0 +1,146 @@
+
+/* Simple program: Loop, watching keystrokes
+ Note that you need to call SDL_PollEvent() or SDL_WaitEvent() to
+ pump the event loop and catch keystrokes.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "SDL.h"
+
+/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
+static void quit(int rc)
+{
+ SDL_Quit();
+ exit(rc);
+}
+
+static void print_modifiers(void)
+{
+ int mod;
+ printf(" modifiers:");
+ mod = SDL_GetModState();
+ if(!mod) {
+ printf(" (none)");
+ return;
+ }
+ if(mod & KMOD_LSHIFT)
+ printf(" LSHIFT");
+ if(mod & KMOD_RSHIFT)
+ printf(" RSHIFT");
+ if(mod & KMOD_LCTRL)
+ printf(" LCTRL");
+ if(mod & KMOD_RCTRL)
+ printf(" RCTRL");
+ if(mod & KMOD_LALT)
+ printf(" LALT");
+ if(mod & KMOD_RALT)
+ printf(" RALT");
+ if(mod & KMOD_LMETA)
+ printf(" LMETA");
+ if(mod & KMOD_RMETA)
+ printf(" RMETA");
+ if(mod & KMOD_NUM)
+ printf(" NUM");
+ if(mod & KMOD_CAPS)
+ printf(" CAPS");
+ if(mod & KMOD_MODE)
+ printf(" MODE");
+}
+
+static void PrintKey(SDL_keysym *sym, int pressed)
+{
+ /* Print the keycode, name and state */
+ if ( sym->sym ) {
+ printf("Key %s: %d-%s ", pressed ? "pressed" : "released",
+ sym->sym, SDL_GetKeyName(sym->sym));
+ } else {
+ printf("Unknown Key (scancode = %d) %s ", sym->scancode,
+ pressed ? "pressed" : "released");
+ }
+
+ /* Print the translated character, if one exists */
+ if ( sym->unicode ) {
+ /* Is it a control-character? */
+ if ( sym->unicode < ' ' ) {
+ printf(" (^%c)", sym->unicode+'@');
+ } else {
+#ifdef UNICODE
+ printf(" (%c)", sym->unicode);
+#else
+ /* This is a Latin-1 program, so only show 8-bits */
+ if ( !(sym->unicode & 0xFF00) )
+ printf(" (%c)", sym->unicode);
+ else
+ printf(" (0x%X)", sym->unicode);
+#endif
+ }
+ }
+ print_modifiers();
+ printf("\n");
+}
+
+int main(int argc, char *argv[])
+{
+ SDL_Event event;
+ int done;
+ Uint32 videoflags;
+
+ /* Initialize SDL */
+ if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
+ fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
+ return(1);
+ }
+
+ videoflags = SDL_SWSURFACE;
+ while( argc > 1 ) {
+ --argc;
+ if ( argv[argc] && !strcmp(argv[argc], "-fullscreen") ) {
+ videoflags |= SDL_FULLSCREEN;
+ } else {
+ fprintf(stderr, "Usage: %s [-fullscreen]\n", argv[0]);
+ quit(1);
+ }
+ }
+
+ /* Set 640x480 video mode */
+ if ( SDL_SetVideoMode(640, 480, 0, videoflags) == NULL ) {
+ fprintf(stderr, "Couldn't set 640x480 video mode: %s\n",
+ SDL_GetError());
+ quit(2);
+ }
+
+ /* Enable UNICODE translation for keyboard input */
+ SDL_EnableUNICODE(1);
+
+ /* Enable auto repeat for keyboard input */
+ SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY,
+ SDL_DEFAULT_REPEAT_INTERVAL);
+
+ /* Watch keystrokes */
+ done = 0;
+ while ( !done ) {
+ /* Check for events */
+ SDL_WaitEvent(&event);
+ switch (event.type) {
+ case SDL_KEYDOWN:
+ PrintKey(&event.key.keysym, 1);
+ break;
+ case SDL_KEYUP:
+ PrintKey(&event.key.keysym, 0);
+ break;
+ case SDL_MOUSEBUTTONDOWN:
+ /* Any button press quits the app... */
+ case SDL_QUIT:
+ done = 1;
+ break;
+ default:
+ break;
+ }
+ }
+
+ SDL_Quit();
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/test/configure.in b/distrib/sdl-1.2.15/test/configure.in
new file mode 100644
index 0000000..7c25c17
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/configure.in
@@ -0,0 +1,105 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(README)
+
+dnl Detect the canonical build and host environments
+AC_CONFIG_AUX_DIRS($srcdir/../build-scripts)
+AC_CANONICAL_HOST
+
+dnl Check for tools
+
+AC_PROG_CC
+
+dnl Check for compiler environment
+
+AC_C_CONST
+
+dnl Figure out which math library to use
+case "$host" in
+ *-*-cygwin* | *-*-mingw32*)
+ EXE=".exe"
+ MATHLIB=""
+ SYS_GL_LIBS="-lopengl32"
+ ;;
+ *-*-beos* | *-*-haiku*)
+ EXE=""
+ MATHLIB=""
+ SYS_GL_LIBS="-lGL"
+ ;;
+ *-*-darwin* )
+ EXE=""
+ MATHLIB=""
+ SYS_GL_LIBS="-Wl,-framework,OpenGL"
+ ;;
+ *-*-aix*)
+ EXE=""
+ if test x$ac_cv_prog_gcc = xyes; then
+ CFLAGS="-mthreads"
+ fi
+ SYS_GL_LIBS=""
+ ;;
+ *-*-mint*)
+ EXE=""
+ MATHLIB=""
+ AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
+ if test "x$OSMESA_CONFIG" = "xyes"; then
+ OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
+ OSMESA_LIBS=`$OSMESA_CONFIG --libs`
+ CFLAGS="$CFLAGS $OSMESA_CFLAGS"
+ SYS_GL_LIBS="$OSMESA_LIBS"
+ else
+ SYS_GL_LIBS="-lOSMesa"
+ fi
+ ;;
+ *)
+ EXE=""
+ MATHLIB="-lm"
+ SYS_GL_LIBS="-lGL"
+ ;;
+esac
+AC_SUBST(EXE)
+AC_SUBST(MATHLIB)
+
+dnl Check for SDL
+SDL_VERSION=1.2.10
+AM_PATH_SDL($SDL_VERSION,
+ :,
+ AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
+)
+CFLAGS="$CFLAGS $SDL_CFLAGS"
+LIBS="$LIBS $SDL_LIBS"
+
+dnl Check for X11 path, needed for OpenGL on some systems
+AC_PATH_X
+if test x$have_x = xyes; then
+ if test x$ac_x_includes = xno || test x$ac_x_includes = x; then
+ :
+ else
+ CFLAGS="$CFLAGS -I$ac_x_includes"
+ fi
+ if test x$ac_x_libraries = xno || test x$ac_x_libraries = x; then
+ :
+ else
+ XPATH="-L$ac_x_libraries"
+ fi
+fi
+
+dnl Check for OpenGL
+AC_MSG_CHECKING(for OpenGL support)
+have_opengl=no
+AC_TRY_COMPILE([
+ #include "SDL_opengl.h"
+],[
+],[
+have_opengl=yes
+])
+AC_MSG_RESULT($have_opengl)
+if test x$have_opengl = xyes; then
+ CFLAGS="$CFLAGS -DHAVE_OPENGL"
+ GLLIB="$XPATH $SYS_GL_LIBS"
+else
+ GLLIB=""
+fi
+AC_SUBST(GLLIB)
+
+dnl Finally create all the generated files
+AC_OUTPUT([Makefile])
diff --git a/distrib/sdl-1.2.15/test/gcc-fat.sh b/distrib/sdl-1.2.15/test/gcc-fat.sh
new file mode 100755
index 0000000..203b941
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/gcc-fat.sh
@@ -0,0 +1,134 @@
+#!/bin/sh
+#
+# Build Universal binaries on Mac OS X, thanks Ryan!
+#
+# Usage: ./configure CC="sh gcc-fat.sh" && make && rm -rf ppc x86
+
+# Locate Xcode SDK path
+SDK_PATH=/Developer/SDKs
+if [ ! -d $SDK_PATH ]; then
+ echo "Couldn't find SDK path"
+ exit 1
+fi
+
+if [ -d "$SDK_PATH/MacOSX10.2.8.sdk" ]; then
+ # PowerPC compiler flags (10.2 runtime compatibility)
+ GCC_COMPILE_PPC="gcc-3.3 -arch ppc \
+-DMAC_OS_X_VERSION_MIN_REQUIRED=1020 \
+-nostdinc \
+-F$SDK_PATH/MacOSX10.2.8.sdk/System/Library/Frameworks \
+-I$SDK_PATH/MacOSX10.2.8.sdk/usr/include/gcc/darwin/3.3 \
+-isystem $SDK_PATH/MacOSX10.2.8.sdk/usr/include"
+
+ GCC_LINK_PPC="\
+-L$SDK_PATH/MacOSX10.2.8.sdk/usr/lib/gcc/darwin/3.3 \
+-F$SDK_PATH/MacOSX10.2.8.sdk/System/Library/Frameworks \
+-Wl,-syslibroot,$SDK_PATH/MacOSX10.2.8.sdk"
+
+else # 10.2 or 10.3 SDK
+ # PowerPC compiler flags (10.3 runtime compatibility)
+ GCC_COMPILE_PPC="gcc-4.0 -arch ppc -mmacosx-version-min=10.3 \
+-DMAC_OS_X_VERSION_MIN_REQUIRED=1030 \
+-nostdinc \
+-F$SDK_PATH/MacOSX10.3.9.sdk/System/Library/Frameworks \
+-I$SDK_PATH/MacOSX10.3.9.sdk/usr/lib/gcc/powerpc-apple-darwin9/4.0.1/include \
+-isystem $SDK_PATH/MacOSX10.3.9.sdk/usr/include"
+
+ GCC_LINK_PPC="\
+-L$SDK_PATH/MacOSX10.3.9.sdk/usr/lib/gcc/powerpc-apple-darwin9/4.0.1 \
+-F$SDK_PATH/MacOSX10.3.9.sdk/System/Library/Frameworks \
+-Wl,-syslibroot,$SDK_PATH/MacOSX10.3.9.sdk"
+
+fi # 10.2 or 10.3 SDK
+
+# Intel compiler flags (10.4 runtime compatibility)
+GCC_COMPILE_X86="gcc-4.0 -arch i386 -mmacosx-version-min=10.4 \
+-DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \
+-nostdinc \
+-F$SDK_PATH/MacOSX10.4u.sdk/System/Library/Frameworks \
+-I$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1/include \
+-isystem $SDK_PATH/MacOSX10.4u.sdk/usr/include"
+
+GCC_LINK_X86="\
+-L$SDK_PATH/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1 \
+-Wl,-syslibroot,$SDK_PATH/MacOSX10.4u.sdk"
+
+# 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_PPC="$GCC_COMPILE_PPC -E"
+ GCC_COMPILE_X86="$GCC_COMPILE_X86 -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_PPC="$GCC_COMPILE_PPC $GCC_LINK_PPC"
+ GCC_COMPILE_X86="$GCC_COMPILE_X86 $GCC_LINK_X86"
+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
+
+if test x"$output" != x; then
+ dir=ppc/`dirname $output`
+ if test -d $dir; then
+ :
+ else
+ mkdir -p $dir
+ fi
+fi
+set -- $args
+while test x$1 != x; do
+ if test -f "ppc/$1" && test "$1" != "$output"; then
+ ppc_args="$ppc_args ppc/$1"
+ else
+ ppc_args="$ppc_args $1"
+ fi
+ shift
+done
+$GCC_COMPILE_PPC $ppc_args || exit $?
+if test x"$output" != x; then
+ cp $output ppc/$output
+fi
+
+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
+
+if test x"$output" != x; then
+ lipo -create -o $output ppc/$output x86/$output
+fi
diff --git a/distrib/sdl-1.2.15/test/graywin.c b/distrib/sdl-1.2.15/test/graywin.c
new file mode 100644
index 0000000..4563114
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/graywin.c
@@ -0,0 +1,257 @@
+
+/* Simple program: Fill a colormap with gray and stripe it down the screen */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#include "SDL.h"
+
+#ifdef TEST_VGA16 /* Define this if you want to test VGA 16-color video modes */
+#define NUM_COLORS 16
+#else
+#define NUM_COLORS 256
+#endif
+
+/* Draw a randomly sized and colored box centered about (X,Y) */
+void DrawBox(SDL_Surface *screen, int X, int Y, int width, int height)
+{
+ static unsigned int seeded = 0;
+ SDL_Rect area;
+ Uint32 color;
+ Uint32 randc;
+
+ /* Seed the random number generator */
+ if ( seeded == 0 ) {
+ srand(time(NULL));
+ seeded = 1;
+ }
+
+ /* Get the bounds of the rectangle */
+ area.w = (rand()%width);
+ area.h = (rand()%height);
+ area.x = X-(area.w/2);
+ area.y = Y-(area.h/2);
+ randc = (rand()%NUM_COLORS);
+
+ if (screen->format->BytesPerPixel==1)
+ {
+ color = randc;
+ }
+ else
+ {
+ color = SDL_MapRGB(screen->format, randc, randc, randc);
+ }
+
+ /* Do it! */
+ SDL_FillRect(screen, &area, color);
+ if ( screen->flags & SDL_DOUBLEBUF ) {
+ SDL_Flip(screen);
+ } else {
+ SDL_UpdateRects(screen, 1, &area);
+ }
+}
+
+void DrawBackground(SDL_Surface *screen)
+{
+ int i, j, k;
+ Uint8 *buffer;
+ Uint16 *buffer16;
+ Uint16 color;
+ Uint8 gradient;
+
+ /* Set the surface pixels and refresh! */
+ /* Use two loops in case the surface is double-buffered (both sides) */
+
+ for ( j=0; j<2; ++j ) {
+ if ( SDL_LockSurface(screen) < 0 ) {
+ fprintf(stderr, "Couldn't lock display surface: %s\n",
+ SDL_GetError());
+ return;
+ }
+ buffer = (Uint8 *)screen->pixels;
+
+ if (screen->format->BytesPerPixel!=2) {
+ for ( i=0; i<screen->h; ++i ) {
+ memset(buffer,(i*(NUM_COLORS-1))/screen->h, screen->w * screen->format->BytesPerPixel);
+ buffer += screen->pitch;
+ }
+ }
+ else
+ {
+ for ( i=0; i<screen->h; ++i ) {
+ gradient=((i*(NUM_COLORS-1))/screen->h);
+ color = SDL_MapRGB(screen->format, gradient, gradient, gradient);
+ buffer16=(Uint16*)buffer;
+ for (k=0; k<screen->w; k++)
+ {
+ *(buffer16+k)=color;
+ }
+ buffer += screen->pitch;
+ }
+ }
+
+ SDL_UnlockSurface(screen);
+ if ( screen->flags & SDL_DOUBLEBUF ) {
+ SDL_Flip(screen);
+ } else {
+ SDL_UpdateRect(screen, 0, 0, 0, 0);
+ break;
+ }
+ }
+}
+
+SDL_Surface *CreateScreen(Uint16 w, Uint16 h, Uint8 bpp, Uint32 flags)
+{
+ SDL_Surface *screen;
+ int i;
+ SDL_Color palette[NUM_COLORS];
+
+ /* Set the video mode */
+ screen = SDL_SetVideoMode(w, h, bpp, flags);
+ if ( screen == NULL ) {
+ fprintf(stderr, "Couldn't set display mode: %s\n",
+ SDL_GetError());
+ return(NULL);
+ }
+ fprintf(stderr, "Screen is in %s mode\n",
+ (screen->flags & SDL_FULLSCREEN) ? "fullscreen" : "windowed");
+
+ if (bpp==8) {
+ /* Set a gray colormap, reverse order from white to black */
+ for ( i=0; i<NUM_COLORS; ++i ) {
+ palette[i].r = (NUM_COLORS-1)-i * (256 / NUM_COLORS);
+ palette[i].g = (NUM_COLORS-1)-i * (256 / NUM_COLORS);
+ palette[i].b = (NUM_COLORS-1)-i * (256 / NUM_COLORS);
+ }
+ SDL_SetColors(screen, palette, 0, NUM_COLORS);
+ }
+
+ return(screen);
+}
+
+int main(int argc, char *argv[])
+{
+ SDL_Surface *screen;
+ Uint32 videoflags;
+ int done;
+ SDL_Event event;
+ int width, height, bpp;
+
+ /* Initialize SDL */
+ if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
+ fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
+ exit(1);
+ }
+
+ /* See if we try to get a hardware colormap */
+ width = 640;
+ height = 480;
+ bpp = 8;
+ videoflags = SDL_SWSURFACE;
+ while ( argc > 1 ) {
+ --argc;
+ if ( argv[argc-1] && (strcmp(argv[argc-1], "-width") == 0) ) {
+ width = atoi(argv[argc]);
+ --argc;
+ } else
+ if ( argv[argc-1] && (strcmp(argv[argc-1], "-height") == 0) ) {
+ height = atoi(argv[argc]);
+ --argc;
+ } else
+ if ( argv[argc-1] && (strcmp(argv[argc-1], "-bpp") == 0) ) {
+ bpp = atoi(argv[argc]);
+ --argc;
+ } else
+ if ( argv[argc] && (strcmp(argv[argc], "-hw") == 0) ) {
+ videoflags |= SDL_HWSURFACE;
+ } else
+ if ( argv[argc] && (strcmp(argv[argc], "-hwpalette") == 0) ) {
+ videoflags |= SDL_HWPALETTE;
+ } else
+ if ( argv[argc] && (strcmp(argv[argc], "-flip") == 0) ) {
+ videoflags |= SDL_DOUBLEBUF;
+ } else
+ if ( argv[argc] && (strcmp(argv[argc], "-noframe") == 0) ) {
+ videoflags |= SDL_NOFRAME;
+ } else
+ if ( argv[argc] && (strcmp(argv[argc], "-resize") == 0) ) {
+ videoflags |= SDL_RESIZABLE;
+ } else
+ if ( argv[argc] && (strcmp(argv[argc], "-fullscreen") == 0) ) {
+ videoflags |= SDL_FULLSCREEN;
+ } else {
+ fprintf(stderr, "Usage: %s [-width] [-height] [-bpp] [-hw] [-hwpalette] [-flip] [-noframe] [-fullscreen] [-resize]\n",
+ argv[0]);
+ exit(1);
+ }
+ }
+
+ /* Set a video mode */
+ screen = CreateScreen(width, height, bpp, videoflags);
+ if ( screen == NULL ) {
+ exit(2);
+ }
+
+ DrawBackground(screen);
+
+ /* Wait for a keystroke */
+ done = 0;
+ while ( !done && SDL_WaitEvent(&event) ) {
+ switch (event.type) {
+ case SDL_MOUSEBUTTONDOWN:
+ DrawBox(screen, event.button.x, event.button.y, width, height);
+ break;
+ case SDL_KEYDOWN:
+ /* Ignore ALT-TAB for windows */
+ if ( (event.key.keysym.sym == SDLK_LALT) ||
+ (event.key.keysym.sym == SDLK_TAB) ) {
+ break;
+ }
+ /* Center the mouse on <SPACE> */
+ if ( event.key.keysym.sym == SDLK_SPACE ) {
+ SDL_WarpMouse(width/2, height/2);
+ break;
+ }
+ /* Toggle fullscreen mode on <RETURN> */
+ if ( event.key.keysym.sym == SDLK_RETURN ) {
+ videoflags ^= SDL_FULLSCREEN;
+ screen = CreateScreen(
+ screen->w, screen->h,
+ screen->format->BitsPerPixel,
+ videoflags);
+ if ( screen == NULL ) {
+ fprintf(stderr,
+ "Couldn't toggle fullscreen mode\n");
+ done = 1;
+ }
+ DrawBackground(screen);
+ break;
+ }
+ /* Any other key quits the application... */
+ case SDL_QUIT:
+ done = 1;
+ break;
+ case SDL_VIDEOEXPOSE:
+ DrawBackground(screen);
+ break;
+ case SDL_VIDEORESIZE:
+ screen = CreateScreen(
+ event.resize.w, event.resize.h,
+ screen->format->BitsPerPixel,
+ videoflags);
+ if ( screen == NULL ) {
+ fprintf(stderr,
+ "Couldn't resize video mode\n");
+ done = 1;
+ }
+ DrawBackground(screen);
+ break;
+ default:
+ break;
+ }
+ }
+ SDL_Quit();
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/test/icon.bmp b/distrib/sdl-1.2.15/test/icon.bmp
new file mode 100644
index 0000000..cc96356
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/icon.bmp
Binary files differ
diff --git a/distrib/sdl-1.2.15/test/loopwave.c b/distrib/sdl-1.2.15/test/loopwave.c
new file mode 100644
index 0000000..e1df747
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/loopwave.c
@@ -0,0 +1,114 @@
+
+/* 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
+*/
+#include "SDL_config.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#if HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+
+#include "SDL.h"
+#include "SDL_audio.h"
+
+struct {
+ SDL_AudioSpec spec;
+ Uint8 *sound; /* Pointer to wave data */
+ Uint32 soundlen; /* Length of wave data */
+ int soundpos; /* Current play position */
+} wave;
+
+
+/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
+static void quit(int rc)
+{
+ SDL_Quit();
+ exit(rc);
+}
+
+
+void SDLCALL fillerup(void *unused, Uint8 *stream, int len)
+{
+ Uint8 *waveptr;
+ int waveleft;
+
+ /* Set up the pointers */
+ waveptr = wave.sound + wave.soundpos;
+ waveleft = wave.soundlen - wave.soundpos;
+
+ /* Go! */
+ while ( waveleft <= len ) {
+ SDL_memcpy(stream, waveptr, waveleft);
+ stream += waveleft;
+ len -= waveleft;
+ waveptr = wave.sound;
+ waveleft = wave.soundlen;
+ wave.soundpos = 0;
+ }
+ SDL_memcpy(stream, waveptr, len);
+ wave.soundpos += len;
+}
+
+static int done = 0;
+void poked(int sig)
+{
+ done = 1;
+}
+
+int main(int argc, char *argv[])
+{
+ char name[32];
+
+ /* Load the SDL library */
+ if ( SDL_Init(SDL_INIT_AUDIO) < 0 ) {
+ fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
+ return(1);
+ }
+ if ( argv[1] == NULL ) {
+ argv[1] = "sample.wav";
+ }
+ /* Load the wave file into memory */
+ if ( SDL_LoadWAV(argv[1],
+ &wave.spec, &wave.sound, &wave.soundlen) == NULL ) {
+ fprintf(stderr, "Couldn't load %s: %s\n",
+ argv[1], SDL_GetError());
+ quit(1);
+ }
+
+ wave.spec.callback = fillerup;
+#if HAVE_SIGNAL_H
+ /* Set the signals */
+#ifdef SIGHUP
+ signal(SIGHUP, poked);
+#endif
+ signal(SIGINT, poked);
+#ifdef SIGQUIT
+ signal(SIGQUIT, poked);
+#endif
+ signal(SIGTERM, poked);
+#endif /* HAVE_SIGNAL_H */
+
+ /* Initialize fillerup() variables */
+ if ( SDL_OpenAudio(&wave.spec, NULL) < 0 ) {
+ fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
+ SDL_FreeWAV(wave.sound);
+ quit(2);
+ }
+ SDL_PauseAudio(0);
+
+ /* Let the audio run */
+ printf("Using audio driver: %s\n", SDL_AudioDriverName(name, 32));
+ while ( ! done && (SDL_GetAudioStatus() == SDL_AUDIO_PLAYING) )
+ SDL_Delay(1000);
+
+ /* Clean up on signal */
+ SDL_CloseAudio();
+ SDL_FreeWAV(wave.sound);
+ SDL_Quit();
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/test/moose.dat b/distrib/sdl-1.2.15/test/moose.dat
new file mode 100644
index 0000000..1053004
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/moose.dat
Binary files differ
diff --git a/distrib/sdl-1.2.15/test/picture.xbm b/distrib/sdl-1.2.15/test/picture.xbm
new file mode 100644
index 0000000..c873a60
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/picture.xbm
@@ -0,0 +1,14 @@
+#define picture_width 32
+#define picture_height 32
+static char picture_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x80, 0x01, 0x18,
+ 0x64, 0x6f, 0xf6, 0x26, 0x0a, 0x00, 0x00, 0x50, 0xf2, 0xff, 0xff, 0x4f,
+ 0x14, 0x04, 0x00, 0x28, 0x14, 0x0e, 0x00, 0x28, 0x10, 0x32, 0x00, 0x08,
+ 0x94, 0x03, 0x00, 0x08, 0xf4, 0x04, 0x00, 0x08, 0xb0, 0x08, 0x00, 0x08,
+ 0x34, 0x01, 0x00, 0x28, 0x34, 0x01, 0x00, 0x28, 0x12, 0x00, 0x40, 0x48,
+ 0x12, 0x20, 0xa6, 0x48, 0x14, 0x50, 0x11, 0x29, 0x14, 0x50, 0x48, 0x2a,
+ 0x10, 0x27, 0xac, 0x0e, 0xd4, 0x71, 0xe8, 0x0a, 0x74, 0x20, 0xa8, 0x0a,
+ 0x14, 0x20, 0x00, 0x08, 0x10, 0x50, 0x00, 0x08, 0x14, 0x00, 0x00, 0x28,
+ 0x14, 0x00, 0x00, 0x28, 0xf2, 0xff, 0xff, 0x4f, 0x0a, 0x00, 0x00, 0x50,
+ 0x64, 0x6f, 0xf6, 0x26, 0x18, 0x80, 0x01, 0x18, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/distrib/sdl-1.2.15/test/sail.bmp b/distrib/sdl-1.2.15/test/sail.bmp
new file mode 100644
index 0000000..12850c3
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/sail.bmp
Binary files differ
diff --git a/distrib/sdl-1.2.15/test/sample.bmp b/distrib/sdl-1.2.15/test/sample.bmp
new file mode 100644
index 0000000..aca8bbc
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/sample.bmp
Binary files differ
diff --git a/distrib/sdl-1.2.15/test/sample.wav b/distrib/sdl-1.2.15/test/sample.wav
new file mode 100644
index 0000000..002f815
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/sample.wav
Binary files differ
diff --git a/distrib/sdl-1.2.15/test/testalpha.c b/distrib/sdl-1.2.15/test/testalpha.c
new file mode 100644
index 0000000..7e04fbe
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testalpha.c
@@ -0,0 +1,547 @@
+
+/* Simple program: Fill a colormap with gray and stripe it down the screen,
+ Then move an alpha valued sprite around the screen.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#include "SDL.h"
+
+#define FRAME_TICKS (1000/30) /* 30 frames/second */
+
+/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
+static void quit(int rc)
+{
+ SDL_Quit();
+ exit(rc);
+}
+
+/* Fill the screen with a gradient */
+static void FillBackground(SDL_Surface *screen)
+{
+ Uint8 *buffer;
+ Uint16 *buffer16;
+ Uint16 color;
+ Uint8 gradient;
+ int i, k;
+
+ /* Set the surface pixels and refresh! */
+ if ( SDL_LockSurface(screen) < 0 ) {
+ fprintf(stderr, "Couldn't lock the display surface: %s\n",
+ SDL_GetError());
+ quit(2);
+ }
+ buffer=(Uint8 *)screen->pixels;
+ if (screen->format->BytesPerPixel!=2) {
+ for ( i=0; i<screen->h; ++i ) {
+ memset(buffer,(i*255)/screen->h, screen->w*screen->format->BytesPerPixel);
+ buffer += screen->pitch;
+ }
+ }
+ else
+ {
+ for ( i=0; i<screen->h; ++i ) {
+ gradient=((i*255)/screen->h);
+ color = (Uint16)SDL_MapRGB(screen->format, gradient, gradient, gradient);
+ buffer16=(Uint16*)buffer;
+ for (k=0; k<screen->w; k++)
+ {
+ *(buffer16+k)=color;
+ }
+ buffer += screen->pitch;
+ }
+ }
+
+ SDL_UnlockSurface(screen);
+ SDL_UpdateRect(screen, 0, 0, 0, 0);
+}
+
+/* Create a "light" -- a yellowish surface with variable alpha */
+SDL_Surface *CreateLight(int radius)
+{
+ Uint8 trans, alphamask;
+ int range, addition;
+ int xdist, ydist;
+ Uint16 x, y;
+ Uint16 skip;
+ Uint32 pixel;
+ SDL_Surface *light;
+
+#ifdef LIGHT_16BIT
+ Uint16 *buf;
+
+ /* Create a 16 (4/4/4/4) bpp square with a full 4-bit alpha channel */
+ /* Note: this isn't any faster than a 32 bit alpha surface */
+ alphamask = 0x0000000F;
+ light = SDL_CreateRGBSurface(SDL_SWSURFACE, 2*radius, 2*radius, 16,
+ 0x0000F000, 0x00000F00, 0x000000F0, alphamask);
+#else
+ Uint32 *buf;
+
+ /* Create a 32 (8/8/8/8) bpp square with a full 8-bit alpha channel */
+ alphamask = 0x000000FF;
+ light = SDL_CreateRGBSurface(SDL_SWSURFACE, 2*radius, 2*radius, 32,
+ 0xFF000000, 0x00FF0000, 0x0000FF00, alphamask);
+ if ( light == NULL ) {
+ fprintf(stderr, "Couldn't create light: %s\n", SDL_GetError());
+ return(NULL);
+ }
+#endif
+
+ /* Fill with a light yellow-orange color */
+ skip = light->pitch-(light->w*light->format->BytesPerPixel);
+#ifdef LIGHT_16BIT
+ buf = (Uint16 *)light->pixels;
+#else
+ buf = (Uint32 *)light->pixels;
+#endif
+ /* Get a tranparent pixel value - we'll add alpha later */
+ pixel = SDL_MapRGBA(light->format, 0xFF, 0xDD, 0x88, 0);
+ for ( y=0; y<light->h; ++y ) {
+ for ( x=0; x<light->w; ++x ) {
+ *buf++ = pixel;
+ }
+ buf += skip; /* Almost always 0, but just in case... */
+ }
+
+ /* Calculate alpha values for the surface. */
+#ifdef LIGHT_16BIT
+ buf = (Uint16 *)light->pixels;
+#else
+ buf = (Uint32 *)light->pixels;
+#endif
+ for ( y=0; y<light->h; ++y ) {
+ for ( x=0; x<light->w; ++x ) {
+ /* Slow distance formula (from center of light) */
+ xdist = x-(light->w/2);
+ ydist = y-(light->h/2);
+ range = (int)sqrt(xdist*xdist+ydist*ydist);
+
+ /* Scale distance to range of transparency (0-255) */
+ if ( range > radius ) {
+ trans = alphamask;
+ } else {
+ /* Increasing transparency with distance */
+ trans = (Uint8)((range*alphamask)/radius);
+
+ /* Lights are very transparent */
+ addition = (alphamask+1)/8;
+ if ( (int)trans+addition > alphamask ) {
+ trans = alphamask;
+ } else {
+ trans += addition;
+ }
+ }
+ /* We set the alpha component as the right N bits */
+ *buf++ |= (255-trans);
+ }
+ buf += skip; /* Almost always 0, but just in case... */
+ }
+ /* Enable RLE acceleration of this alpha surface */
+ SDL_SetAlpha(light, SDL_SRCALPHA|SDL_RLEACCEL, 0);
+
+ /* We're done! */
+ return(light);
+}
+
+static Uint32 flashes = 0;
+static Uint32 flashtime = 0;
+
+void FlashLight(SDL_Surface *screen, SDL_Surface *light, int x, int y)
+{
+ SDL_Rect position;
+ Uint32 ticks1;
+ Uint32 ticks2;
+
+ /* Easy, center light */
+ position.x = x-(light->w/2);
+ position.y = y-(light->h/2);
+ position.w = light->w;
+ position.h = light->h;
+ ticks1 = SDL_GetTicks();
+ SDL_BlitSurface(light, NULL, screen, &position);
+ ticks2 = SDL_GetTicks();
+ SDL_UpdateRects(screen, 1, &position);
+ ++flashes;
+
+ /* Update time spend doing alpha blitting */
+ flashtime += (ticks2-ticks1);
+}
+
+static int sprite_visible = 0;
+static SDL_Surface *sprite;
+static SDL_Surface *backing;
+static SDL_Rect position;
+static int x_vel, y_vel;
+static int alpha_vel;
+
+int LoadSprite(SDL_Surface *screen, char *file)
+{
+ SDL_Surface *converted;
+
+ /* Load the sprite image */
+ sprite = SDL_LoadBMP(file);
+ if ( sprite == NULL ) {
+ fprintf(stderr, "Couldn't load %s: %s", file, SDL_GetError());
+ return(-1);
+ }
+
+ /* Set transparent pixel as the pixel at (0,0) */
+ if ( sprite->format->palette ) {
+ SDL_SetColorKey(sprite, SDL_SRCCOLORKEY,
+ *(Uint8 *)sprite->pixels);
+ }
+
+ /* Convert sprite to video format */
+ converted = SDL_DisplayFormat(sprite);
+ SDL_FreeSurface(sprite);
+ if ( converted == NULL ) {
+ fprintf(stderr, "Couldn't convert background: %s\n",
+ SDL_GetError());
+ return(-1);
+ }
+ sprite = converted;
+
+ /* Create the background */
+ backing = SDL_CreateRGBSurface(SDL_SWSURFACE, sprite->w, sprite->h, 8,
+ 0, 0, 0, 0);
+ if ( backing == NULL ) {
+ fprintf(stderr, "Couldn't create background: %s\n",
+ SDL_GetError());
+ SDL_FreeSurface(sprite);
+ return(-1);
+ }
+
+ /* Convert background to video format */
+ converted = SDL_DisplayFormat(backing);
+ SDL_FreeSurface(backing);
+ if ( converted == NULL ) {
+ fprintf(stderr, "Couldn't convert background: %s\n",
+ SDL_GetError());
+ SDL_FreeSurface(sprite);
+ return(-1);
+ }
+ backing = converted;
+
+ /* Set the initial position of the sprite */
+ position.x = (screen->w-sprite->w)/2;
+ position.y = (screen->h-sprite->h)/2;
+ position.w = sprite->w;
+ position.h = sprite->h;
+ x_vel = 0; y_vel = 0;
+ alpha_vel = 1;
+
+ /* We're ready to roll. :) */
+ return(0);
+}
+
+void AttractSprite(Uint16 x, Uint16 y)
+{
+ x_vel = ((int)x-position.x)/10;
+ y_vel = ((int)y-position.y)/10;
+}
+
+void MoveSprite(SDL_Surface *screen, SDL_Surface *light)
+{
+ SDL_Rect updates[2];
+ int alpha;
+
+ /* Erase the sprite if it was visible */
+ if ( sprite_visible ) {
+ updates[0] = position;
+ SDL_BlitSurface(backing, NULL, screen, &updates[0]);
+ } else {
+ updates[0].x = 0; updates[0].y = 0;
+ updates[0].w = 0; updates[0].h = 0;
+ sprite_visible = 1;
+ }
+
+ /* Since the sprite is off the screen, we can do other drawing
+ without being overwritten by the saved area behind the sprite.
+ */
+ if ( light != NULL ) {
+ int x, y;
+
+ SDL_GetMouseState(&x, &y);
+ FlashLight(screen, light, x, y);
+ }
+
+ /* Move the sprite, bounce at the wall */
+ position.x += x_vel;
+ if ( (position.x < 0) || (position.x >= screen->w) ) {
+ x_vel = -x_vel;
+ position.x += x_vel;
+ }
+ position.y += y_vel;
+ if ( (position.y < 0) || (position.y >= screen->h) ) {
+ y_vel = -y_vel;
+ position.y += y_vel;
+ }
+
+ /* Update transparency (fade in and out) */
+ alpha = sprite->format->alpha;
+ if ( (alpha+alpha_vel) < 0 ) {
+ alpha_vel = -alpha_vel;
+ } else
+ if ( (alpha+alpha_vel) > 255 ) {
+ alpha_vel = -alpha_vel;
+ }
+ SDL_SetAlpha(sprite, SDL_SRCALPHA, (Uint8)(alpha+alpha_vel));
+
+ /* Save the area behind the sprite */
+ updates[1] = position;
+ SDL_BlitSurface(screen, &updates[1], backing, NULL);
+
+ /* Blit the sprite onto the screen */
+ updates[1] = position;
+ SDL_BlitSurface(sprite, NULL, screen, &updates[1]);
+
+ /* Make it so! */
+ SDL_UpdateRects(screen, 2, updates);
+}
+
+void WarpSprite(SDL_Surface *screen, int x, int y)
+{
+ SDL_Rect updates[2];
+
+ /* Erase, move, Draw, update */
+ updates[0] = position;
+ SDL_BlitSurface(backing, NULL, screen, &updates[0]);
+ position.x = x-sprite->w/2; /* Center about X */
+ position.y = y-sprite->h/2; /* Center about Y */
+ updates[1] = position;
+ SDL_BlitSurface(screen, &updates[1], backing, NULL);
+ updates[1] = position;
+ SDL_BlitSurface(sprite, NULL, screen, &updates[1]);
+ SDL_UpdateRects(screen, 2, updates);
+}
+
+int main(int argc, char *argv[])
+{
+ const SDL_VideoInfo *info;
+ SDL_Surface *screen;
+ int w, h;
+ Uint8 video_bpp;
+ Uint32 videoflags;
+ int i, done;
+ SDL_Event event;
+ SDL_Surface *light;
+ int mouse_pressed;
+ Uint32 ticks, lastticks;
+
+
+ /* Initialize SDL */
+ if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
+ fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
+ return(1);
+ }
+
+ /* Alpha blending doesn't work well at 8-bit color */
+#ifdef _WIN32_WCE
+ /* Pocket PC */
+ w = 240;
+ h = 320;
+#else
+ w = 640;
+ h = 480;
+#endif
+ info = SDL_GetVideoInfo();
+ if ( info->vfmt->BitsPerPixel > 8 ) {
+ video_bpp = info->vfmt->BitsPerPixel;
+ } else {
+ video_bpp = 16;
+ fprintf(stderr, "forced 16 bpp mode\n");
+ }
+ videoflags = SDL_SWSURFACE;
+ for ( i = 1; argv[i]; ++i ) {
+ if ( strcmp(argv[i], "-bpp") == 0 ) {
+ video_bpp = atoi(argv[++i]);
+ if (video_bpp<=8) {
+ video_bpp=16;
+ fprintf(stderr, "forced 16 bpp mode\n");
+ }
+ } else
+ if ( strcmp(argv[i], "-hw") == 0 ) {
+ videoflags |= SDL_HWSURFACE;
+ } else
+ if ( strcmp(argv[i], "-warp") == 0 ) {
+ videoflags |= SDL_HWPALETTE;
+ } else
+ if ( strcmp(argv[i], "-width") == 0 && argv[i+1] ) {
+ w = atoi(argv[++i]);
+ } else
+ if ( strcmp(argv[i], "-height") == 0 && argv[i+1] ) {
+ h = atoi(argv[++i]);
+ } else
+ if ( strcmp(argv[i], "-resize") == 0 ) {
+ videoflags |= SDL_RESIZABLE;
+ } else
+ if ( strcmp(argv[i], "-noframe") == 0 ) {
+ videoflags |= SDL_NOFRAME;
+ } else
+ if ( strcmp(argv[i], "-fullscreen") == 0 ) {
+ videoflags |= SDL_FULLSCREEN;
+ } else {
+ fprintf(stderr,
+ "Usage: %s [-width N] [-height N] [-bpp N] [-warp] [-hw] [-fullscreen]\n",
+ argv[0]);
+ quit(1);
+ }
+ }
+
+ /* Set video mode */
+ if ( (screen=SDL_SetVideoMode(w,h,video_bpp,videoflags)) == NULL ) {
+ fprintf(stderr, "Couldn't set %dx%dx%d video mode: %s\n",
+ w, h, video_bpp, SDL_GetError());
+ quit(2);
+ }
+ FillBackground(screen);
+
+ /* Create the light */
+ light = CreateLight(82);
+ if ( light == NULL ) {
+ quit(1);
+ }
+
+ /* Load the sprite */
+ if ( LoadSprite(screen, "icon.bmp") < 0 ) {
+ SDL_FreeSurface(light);
+ quit(1);
+ }
+
+ /* Print out information about our surfaces */
+ printf("Screen is at %d bits per pixel\n",screen->format->BitsPerPixel);
+ if ( (screen->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
+ printf("Screen is in video memory\n");
+ } else {
+ printf("Screen is in system memory\n");
+ }
+ if ( (screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
+ printf("Screen has double-buffering enabled\n");
+ }
+ if ( (sprite->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
+ printf("Sprite is in video memory\n");
+ } else {
+ printf("Sprite is in system memory\n");
+ }
+
+ /* Run a sample blit to trigger blit acceleration */
+ MoveSprite(screen, NULL);
+ if ( (sprite->flags & SDL_HWACCEL) == SDL_HWACCEL ) {
+ printf("Sprite blit uses hardware alpha acceleration\n");
+ } else {
+ printf("Sprite blit dosn't uses hardware alpha acceleration\n");
+ }
+
+ /* Set a clipping rectangle to clip the outside edge of the screen */
+ { SDL_Rect clip;
+ clip.x = 32;
+ clip.y = 32;
+ clip.w = screen->w-(2*32);
+ clip.h = screen->h-(2*32);
+ SDL_SetClipRect(screen, &clip);
+ }
+
+ /* Wait for a keystroke */
+ lastticks = SDL_GetTicks();
+ done = 0;
+ mouse_pressed = 0;
+ while ( !done ) {
+ /* Update the frame -- move the sprite */
+ if ( mouse_pressed ) {
+ MoveSprite(screen, light);
+ mouse_pressed = 0;
+ } else {
+ MoveSprite(screen, NULL);
+ }
+
+ /* Slow down the loop to 30 frames/second */
+ ticks = SDL_GetTicks();
+ if ( (ticks-lastticks) < FRAME_TICKS ) {
+#ifdef CHECK_SLEEP_GRANULARITY
+fprintf(stderr, "Sleeping %d ticks\n", FRAME_TICKS-(ticks-lastticks));
+#endif
+ SDL_Delay(FRAME_TICKS-(ticks-lastticks));
+#ifdef CHECK_SLEEP_GRANULARITY
+fprintf(stderr, "Slept %d ticks\n", (SDL_GetTicks()-ticks));
+#endif
+ }
+ lastticks = ticks;
+
+ /* Check for events */
+ while ( SDL_PollEvent(&event) ) {
+ switch (event.type) {
+ case SDL_VIDEORESIZE:
+ screen = SDL_SetVideoMode(event.resize.w, event.resize.h, video_bpp, videoflags);
+ if ( screen ) {
+ FillBackground(screen);
+ }
+ break;
+ /* Attract sprite while mouse is held down */
+ case SDL_MOUSEMOTION:
+ if (event.motion.state != 0) {
+ AttractSprite(event.motion.x,
+ event.motion.y);
+ mouse_pressed = 1;
+ }
+ break;
+ case SDL_MOUSEBUTTONDOWN:
+ if ( event.button.button == 1 ) {
+ AttractSprite(event.button.x,
+ event.button.y);
+ mouse_pressed = 1;
+ } else {
+ SDL_Rect area;
+
+ area.x = event.button.x-16;
+ area.y = event.button.y-16;
+ area.w = 32;
+ area.h = 32;
+ SDL_FillRect(screen, &area, 0);
+ SDL_UpdateRects(screen,1,&area);
+ }
+ break;
+ case SDL_KEYDOWN:
+#ifdef _WIN32_WCE
+ // there is no ESC key at all
+ done = 1;
+#else
+ if ( event.key.keysym.sym == SDLK_ESCAPE ) {
+ done = 1;
+ } else if (event.key.keysym.sym == SDLK_t) {
+ videoflags ^= SDL_FULLSCREEN;
+ screen = SDL_SetVideoMode(w, h, video_bpp, videoflags);
+ if ( screen == NULL ) {
+ fprintf(stderr, "Couldn't toggle video mode: %s\n",
+ SDL_GetError());
+ quit(2);
+ }
+ FillBackground(screen);
+ }
+#endif
+
+ break;
+ case SDL_QUIT:
+ done = 1;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ SDL_FreeSurface(light);
+ SDL_FreeSurface(sprite);
+ SDL_FreeSurface(backing);
+
+ /* Print out some timing information */
+ if ( flashes > 0 ) {
+ printf("%d alpha blits, ~%4.4f ms per blit\n",
+ flashes, (float)flashtime/flashes);
+ }
+
+ SDL_Quit();
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/test/testbitmap.c b/distrib/sdl-1.2.15/test/testbitmap.c
new file mode 100644
index 0000000..50cfcbb
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testbitmap.c
@@ -0,0 +1,184 @@
+
+/* Simple program: Test bitmap blits */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "SDL.h"
+#include "picture.xbm"
+
+/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
+static void quit(int rc)
+{
+ SDL_Quit();
+ exit(rc);
+}
+
+SDL_Surface *LoadXBM(SDL_Surface *screen, int w, int h, Uint8 *bits)
+{
+ SDL_Surface *bitmap;
+ Uint8 *line;
+
+ /* Allocate the bitmap */
+ bitmap = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 1, 0, 0, 0, 0);
+ if ( bitmap == NULL ) {
+ fprintf(stderr, "Couldn't allocate bitmap: %s\n",
+ SDL_GetError());
+ return(NULL);
+ }
+
+ /* Copy the pixels */
+ line = (Uint8 *)bitmap->pixels;
+ w = (w+7)/8;
+ while ( h-- ) {
+ memcpy(line, bits, w);
+ /* X11 Bitmap images have the bits reversed */
+ { int i, j; Uint8 *buf, byte;
+ for ( buf=line, i=0; i<w; ++i, ++buf ) {
+ byte = *buf;
+ *buf = 0;
+ for ( j=7; j>=0; --j ) {
+ *buf |= (byte&0x01)<<j;
+ byte >>= 1;
+ }
+ }
+ }
+ line += bitmap->pitch;
+ bits += w;
+ }
+ return(bitmap);
+}
+
+int main(int argc, char *argv[])
+{
+ SDL_Surface *screen;
+ SDL_Surface *bitmap;
+ Uint8 video_bpp;
+ Uint32 videoflags;
+ Uint8 *buffer;
+ int i, k, done;
+ SDL_Event event;
+ Uint16 *buffer16;
+ Uint16 color;
+ Uint8 gradient;
+ SDL_Color palette[256];
+
+
+ /* Initialize SDL */
+ if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
+ fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
+ return(1);
+ }
+
+ video_bpp = 0;
+ videoflags = SDL_SWSURFACE;
+ while ( argc > 1 ) {
+ --argc;
+ if ( strcmp(argv[argc-1], "-bpp") == 0 ) {
+ video_bpp = atoi(argv[argc]);
+ --argc;
+ } else
+ if ( strcmp(argv[argc], "-warp") == 0 ) {
+ videoflags |= SDL_HWPALETTE;
+ } else
+ if ( strcmp(argv[argc], "-hw") == 0 ) {
+ videoflags |= SDL_HWSURFACE;
+ } else
+ if ( strcmp(argv[argc], "-fullscreen") == 0 ) {
+ videoflags |= SDL_FULLSCREEN;
+ } else {
+ fprintf(stderr,
+ "Usage: %s [-bpp N] [-warp] [-hw] [-fullscreen]\n",
+ argv[0]);
+ quit(1);
+ }
+ }
+
+ /* Set 640x480 video mode */
+ if ( (screen=SDL_SetVideoMode(640,480,video_bpp,videoflags)) == NULL ) {
+ fprintf(stderr, "Couldn't set 640x480x%d video mode: %s\n",
+ video_bpp, SDL_GetError());
+ quit(2);
+ }
+
+ if (video_bpp==8) {
+ /* Set a gray colormap, reverse order from white to black */
+ for ( i=0; i<256; ++i ) {
+ palette[i].r = 255-i;
+ palette[i].g = 255-i;
+ palette[i].b = 255-i;
+ }
+ SDL_SetColors(screen, palette, 0, 256);
+ }
+
+ /* Set the surface pixels and refresh! */
+ if ( SDL_LockSurface(screen) < 0 ) {
+ fprintf(stderr, "Couldn't lock the display surface: %s\n",
+ SDL_GetError());
+ quit(2);
+ }
+ buffer=(Uint8 *)screen->pixels;
+ if (screen->format->BytesPerPixel!=2) {
+ for ( i=0; i<screen->h; ++i ) {
+ memset(buffer,(i*255)/screen->h, screen->pitch);
+ buffer += screen->pitch;
+ }
+ }
+ else
+ {
+ for ( i=0; i<screen->h; ++i ) {
+ gradient=((i*255)/screen->h);
+ color = SDL_MapRGB(screen->format, gradient, gradient, gradient);
+ buffer16=(Uint16*)buffer;
+ for (k=0; k<screen->w; k++)
+ {
+ *(buffer16+k)=color;
+ }
+ buffer += screen->pitch;
+ }
+ }
+ SDL_UnlockSurface(screen);
+ SDL_UpdateRect(screen, 0, 0, 0, 0);
+
+ /* Load the bitmap */
+ bitmap = LoadXBM(screen, picture_width, picture_height,
+ (Uint8 *)picture_bits);
+ if ( bitmap == NULL ) {
+ quit(1);
+ }
+
+ /* Wait for a keystroke */
+ done = 0;
+ while ( !done ) {
+ /* Check for events */
+ while ( SDL_PollEvent(&event) ) {
+ switch (event.type) {
+ case SDL_MOUSEBUTTONDOWN: {
+ SDL_Rect dst;
+
+ dst.x = event.button.x - bitmap->w/2;
+ dst.y = event.button.y - bitmap->h/2;
+ dst.w = bitmap->w;
+ dst.h = bitmap->h;
+ SDL_BlitSurface(bitmap, NULL,
+ screen, &dst);
+ SDL_UpdateRects(screen,1,&dst);
+ }
+ break;
+ case SDL_KEYDOWN:
+ /* Any key press quits the app... */
+ done = 1;
+ break;
+ case SDL_QUIT:
+ done = 1;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ SDL_FreeSurface(bitmap);
+ SDL_Quit();
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/test/testblitspeed.c b/distrib/sdl-1.2.15/test/testblitspeed.c
new file mode 100644
index 0000000..f5dff6b
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testblitspeed.c
@@ -0,0 +1,420 @@
+/*
+ * Benchmarks surface-to-surface blits in various formats.
+ *
+ * Written by Ryan C. Gordon.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "SDL.h"
+
+static SDL_Surface *dest = NULL;
+static SDL_Surface *src = NULL;
+static int testSeconds = 10;
+
+
+static int percent(int val, int total)
+{
+ return((int) ((((float) val) / ((float) total)) * 100.0f));
+}
+
+static int randRange(int lo, int hi)
+{
+ return(lo + (int) (((double) hi)*rand()/(RAND_MAX+1.0)));
+}
+
+static void copy_trunc_str(char *str, size_t strsize, const char *flagstr)
+{
+ if ( (strlen(str) + strlen(flagstr)) >= (strsize - 1) )
+ strcpy(str + (strsize - 5), " ...");
+ else
+ strcat(str, flagstr);
+}
+
+static void __append_sdl_surface_flag(SDL_Surface *_surface, char *str,
+ size_t strsize, Uint32 flag,
+ const char *flagstr)
+{
+ if (_surface->flags & flag)
+ copy_trunc_str(str, strsize, flagstr);
+}
+
+
+#define append_sdl_surface_flag(a, b, c, fl) __append_sdl_surface_flag(a, b, c, fl, " " #fl)
+#define print_tf_state(str, val) printf("%s: {%s}\n", str, (val) ? "true" : "false" )
+
+static void output_videoinfo_details(void)
+{
+ const SDL_VideoInfo *info = SDL_GetVideoInfo();
+ printf("SDL_GetVideoInfo():\n");
+ if (info == NULL)
+ printf(" (null.)\n");
+ else
+ {
+ print_tf_state(" hardware surface available", info->hw_available);
+ print_tf_state(" window manager available", info->wm_available);
+ print_tf_state(" accelerated hardware->hardware blits", info->blit_hw);
+ print_tf_state(" accelerated hardware->hardware colorkey blits", info->blit_hw_CC);
+ print_tf_state(" accelerated hardware->hardware alpha blits", info->blit_hw_A);
+ print_tf_state(" accelerated software->hardware blits", info->blit_sw);
+ print_tf_state(" accelerated software->hardware colorkey blits", info->blit_sw_CC);
+ print_tf_state(" accelerated software->hardware alpha blits", info->blit_sw_A);
+ print_tf_state(" accelerated color fills", info->blit_fill);
+ printf(" video memory: (%d)\n", info->video_mem);
+ }
+
+ printf("\n");
+}
+
+static void output_surface_details(const char *name, SDL_Surface *surface)
+{
+ printf("Details for %s:\n", name);
+
+ if (surface == NULL)
+ {
+ printf("-WARNING- You've got a NULL surface!");
+ }
+ else
+ {
+ char f[256];
+ printf(" width : %d\n", surface->w);
+ printf(" height : %d\n", surface->h);
+ printf(" depth : %d bits per pixel\n", surface->format->BitsPerPixel);
+ printf(" pitch : %d\n", (int) surface->pitch);
+ printf(" alpha : %d\n", (int) surface->format->alpha);
+ printf(" colorkey : 0x%X\n", (unsigned int) surface->format->colorkey);
+
+ printf(" red bits : 0x%08X mask, %d shift, %d loss\n",
+ (int) surface->format->Rmask,
+ (int) surface->format->Rshift,
+ (int) surface->format->Rloss);
+ printf(" green bits : 0x%08X mask, %d shift, %d loss\n",
+ (int) surface->format->Gmask,
+ (int) surface->format->Gshift,
+ (int) surface->format->Gloss);
+ printf(" blue bits : 0x%08X mask, %d shift, %d loss\n",
+ (int) surface->format->Bmask,
+ (int) surface->format->Bshift,
+ (int) surface->format->Bloss);
+ printf(" alpha bits : 0x%08X mask, %d shift, %d loss\n",
+ (int) surface->format->Amask,
+ (int) surface->format->Ashift,
+ (int) surface->format->Aloss);
+
+ f[0] = '\0';
+
+ /*append_sdl_surface_flag(surface, f, sizeof (f), SDL_SWSURFACE);*/
+ if ((surface->flags & SDL_HWSURFACE) == 0)
+ copy_trunc_str(f, sizeof (f), " SDL_SWSURFACE");
+
+ append_sdl_surface_flag(surface, f, sizeof (f), SDL_HWSURFACE);
+ append_sdl_surface_flag(surface, f, sizeof (f), SDL_ASYNCBLIT);
+ append_sdl_surface_flag(surface, f, sizeof (f), SDL_ANYFORMAT);
+ append_sdl_surface_flag(surface, f, sizeof (f), SDL_HWPALETTE);
+ append_sdl_surface_flag(surface, f, sizeof (f), SDL_DOUBLEBUF);
+ append_sdl_surface_flag(surface, f, sizeof (f), SDL_FULLSCREEN);
+ append_sdl_surface_flag(surface, f, sizeof (f), SDL_OPENGL);
+ append_sdl_surface_flag(surface, f, sizeof (f), SDL_OPENGLBLIT);
+ append_sdl_surface_flag(surface, f, sizeof (f), SDL_RESIZABLE);
+ append_sdl_surface_flag(surface, f, sizeof (f), SDL_NOFRAME);
+ append_sdl_surface_flag(surface, f, sizeof (f), SDL_HWACCEL);
+ append_sdl_surface_flag(surface, f, sizeof (f), SDL_SRCCOLORKEY);
+ append_sdl_surface_flag(surface, f, sizeof (f), SDL_RLEACCELOK);
+ append_sdl_surface_flag(surface, f, sizeof (f), SDL_RLEACCEL);
+ append_sdl_surface_flag(surface, f, sizeof (f), SDL_SRCALPHA);
+ append_sdl_surface_flag(surface, f, sizeof (f), SDL_PREALLOC);
+
+ if (f[0] == '\0')
+ strcpy(f, " (none)");
+
+ printf(" flags :%s\n", f);
+ }
+
+ printf("\n");
+}
+
+static void output_details(void)
+{
+ output_videoinfo_details();
+ output_surface_details("Source Surface", src);
+ output_surface_details("Destination Surface", dest);
+}
+
+static Uint32 blit(SDL_Surface *dst, SDL_Surface *src, int x, int y)
+{
+ Uint32 start = 0;
+ SDL_Rect srcRect;
+ SDL_Rect dstRect;
+
+ srcRect.x = 0;
+ srcRect.y = 0;
+ dstRect.x = x;
+ dstRect.y = y;
+ dstRect.w = srcRect.w = src->w; /* SDL will clip as appropriate. */
+ dstRect.h = srcRect.h = src->h;
+
+ start = SDL_GetTicks();
+ SDL_BlitSurface(src, &srcRect, dst, &dstRect);
+ return(SDL_GetTicks() - start);
+}
+
+static void blitCentered(SDL_Surface *dst, SDL_Surface *src)
+{
+ int x = (dst->w - src->w) / 2;
+ int y = (dst->h - src->h) / 2;
+ blit(dst, src, x, y);
+}
+
+static int atoi_hex(const char *str)
+{
+ if (str == NULL)
+ return 0;
+
+ if (strlen(str) > 2)
+ {
+ int retval = 0;
+ if ((str[0] == '0') && (str[1] == 'x'))
+ sscanf(str + 2, "%X", &retval);
+ return(retval);
+ }
+
+ return(atoi(str));
+}
+
+
+static int setup_test(int argc, char **argv)
+{
+ const char *dumpfile = NULL;
+ SDL_Surface *bmp = NULL;
+ Uint32 dstbpp = 32;
+ Uint32 dstrmask = 0x00FF0000;
+ Uint32 dstgmask = 0x0000FF00;
+ Uint32 dstbmask = 0x000000FF;
+ Uint32 dstamask = 0x00000000;
+ Uint32 dstflags = 0;
+ int dstw = 640;
+ int dsth = 480;
+ Uint32 srcbpp = 32;
+ Uint32 srcrmask = 0x00FF0000;
+ Uint32 srcgmask = 0x0000FF00;
+ Uint32 srcbmask = 0x000000FF;
+ Uint32 srcamask = 0x00000000;
+ Uint32 srcflags = 0;
+ int srcw = 640;
+ int srch = 480;
+ Uint32 origsrcalphaflags = 0;
+ Uint32 origdstalphaflags = 0;
+ Uint32 srcalphaflags = 0;
+ Uint32 dstalphaflags = 0;
+ int srcalpha = 255;
+ int dstalpha = 255;
+ int screenSurface = 0;
+ int i = 0;
+
+ for (i = 1; i < argc; i++)
+ {
+ const char *arg = argv[i];
+
+ if (strcmp(arg, "--dstbpp") == 0)
+ dstbpp = atoi(argv[++i]);
+ else if (strcmp(arg, "--dstrmask") == 0)
+ dstrmask = atoi_hex(argv[++i]);
+ else if (strcmp(arg, "--dstgmask") == 0)
+ dstgmask = atoi_hex(argv[++i]);
+ else if (strcmp(arg, "--dstbmask") == 0)
+ dstbmask = atoi_hex(argv[++i]);
+ else if (strcmp(arg, "--dstamask") == 0)
+ dstamask = atoi_hex(argv[++i]);
+ else if (strcmp(arg, "--dstwidth") == 0)
+ dstw = atoi(argv[++i]);
+ else if (strcmp(arg, "--dstheight") == 0)
+ dsth = atoi(argv[++i]);
+ else if (strcmp(arg, "--dsthwsurface") == 0)
+ dstflags |= SDL_HWSURFACE;
+ else if (strcmp(arg, "--srcbpp") == 0)
+ srcbpp = atoi(argv[++i]);
+ else if (strcmp(arg, "--srcrmask") == 0)
+ srcrmask = atoi_hex(argv[++i]);
+ else if (strcmp(arg, "--srcgmask") == 0)
+ srcgmask = atoi_hex(argv[++i]);
+ else if (strcmp(arg, "--srcbmask") == 0)
+ srcbmask = atoi_hex(argv[++i]);
+ else if (strcmp(arg, "--srcamask") == 0)
+ srcamask = atoi_hex(argv[++i]);
+ else if (strcmp(arg, "--srcwidth") == 0)
+ srcw = atoi(argv[++i]);
+ else if (strcmp(arg, "--srcheight") == 0)
+ srch = atoi(argv[++i]);
+ else if (strcmp(arg, "--srchwsurface") == 0)
+ srcflags |= SDL_HWSURFACE;
+ else if (strcmp(arg, "--seconds") == 0)
+ testSeconds = atoi(argv[++i]);
+ else if (strcmp(arg, "--screen") == 0)
+ screenSurface = 1;
+ else if (strcmp(arg, "--dumpfile") == 0)
+ dumpfile = argv[++i];
+ /* !!! FIXME: set colorkey. */
+ else if (0) /* !!! FIXME: we handle some commandlines elsewhere now */
+ {
+ fprintf(stderr, "Unknown commandline option: %s\n", arg);
+ return(0);
+ }
+ }
+
+ if (SDL_Init(SDL_INIT_VIDEO) == -1)
+ {
+ fprintf(stderr, "SDL_Init failed: %s\n", SDL_GetError());
+ return(0);
+ }
+
+ bmp = SDL_LoadBMP("sample.bmp");
+ if (bmp == NULL)
+ {
+ fprintf(stderr, "SDL_LoadBMP failed: %s\n", SDL_GetError());
+ SDL_Quit();
+ return(0);
+ }
+
+ if ((dstflags & SDL_HWSURFACE) == 0) dstflags |= SDL_SWSURFACE;
+ if ((srcflags & SDL_HWSURFACE) == 0) srcflags |= SDL_SWSURFACE;
+
+ if (screenSurface)
+ dest = SDL_SetVideoMode(dstw, dsth, dstbpp, dstflags);
+ else
+ {
+ dest = SDL_CreateRGBSurface(dstflags, dstw, dsth, dstbpp,
+ dstrmask, dstgmask, dstbmask, dstamask);
+ }
+
+ if (dest == NULL)
+ {
+ fprintf(stderr, "dest surface creation failed: %s\n", SDL_GetError());
+ SDL_Quit();
+ return(0);
+ }
+
+ src = SDL_CreateRGBSurface(srcflags, srcw, srch, srcbpp,
+ srcrmask, srcgmask, srcbmask, srcamask);
+ if (src == NULL)
+ {
+ fprintf(stderr, "src surface creation failed: %s\n", SDL_GetError());
+ SDL_Quit();
+ return(0);
+ }
+
+ /* handle alpha settings... */
+ srcalphaflags = (src->flags&SDL_SRCALPHA) | (src->flags&SDL_RLEACCEL);
+ dstalphaflags = (dest->flags&SDL_SRCALPHA) | (dest->flags&SDL_RLEACCEL);
+ origsrcalphaflags = srcalphaflags;
+ origdstalphaflags = dstalphaflags;
+ srcalpha = src->format->alpha;
+ dstalpha = dest->format->alpha;
+ for (i = 1; i < argc; i++)
+ {
+ const char *arg = argv[i];
+
+ if (strcmp(arg, "--srcalpha") == 0)
+ srcalpha = atoi(argv[++i]);
+ else if (strcmp(arg, "--dstalpha") == 0)
+ dstalpha = atoi(argv[++i]);
+ else if (strcmp(arg, "--srcsrcalpha") == 0)
+ srcalphaflags |= SDL_SRCALPHA;
+ else if (strcmp(arg, "--srcnosrcalpha") == 0)
+ srcalphaflags &= ~SDL_SRCALPHA;
+ else if (strcmp(arg, "--srcrleaccel") == 0)
+ srcalphaflags |= SDL_RLEACCEL;
+ else if (strcmp(arg, "--srcnorleaccel") == 0)
+ srcalphaflags &= ~SDL_RLEACCEL;
+ else if (strcmp(arg, "--dstsrcalpha") == 0)
+ dstalphaflags |= SDL_SRCALPHA;
+ else if (strcmp(arg, "--dstnosrcalpha") == 0)
+ dstalphaflags &= ~SDL_SRCALPHA;
+ else if (strcmp(arg, "--dstrleaccel") == 0)
+ dstalphaflags |= SDL_RLEACCEL;
+ else if (strcmp(arg, "--dstnorleaccel") == 0)
+ dstalphaflags &= ~SDL_RLEACCEL;
+ }
+ if ((dstalphaflags != origdstalphaflags) || (dstalpha != dest->format->alpha))
+ SDL_SetAlpha(dest, dstalphaflags, (Uint8) dstalpha);
+ if ((srcalphaflags != origsrcalphaflags) || (srcalpha != src->format->alpha))
+ SDL_SetAlpha(src, srcalphaflags, (Uint8) srcalpha);
+
+ /* set some sane defaults so we can see if the blit code is broken... */
+ SDL_FillRect(dest, NULL, SDL_MapRGB(dest->format, 0, 0, 0));
+ SDL_FillRect(src, NULL, SDL_MapRGB(src->format, 0, 0, 0));
+
+ blitCentered(src, bmp);
+ SDL_FreeSurface(bmp);
+
+ if (dumpfile)
+ SDL_SaveBMP(src, dumpfile); /* make sure initial convert is sane. */
+
+ output_details();
+
+ return(1);
+}
+
+
+static void test_blit_speed(void)
+{
+ Uint32 clearColor = SDL_MapRGB(dest->format, 0, 0, 0);
+ Uint32 iterations = 0;
+ Uint32 elasped = 0;
+ Uint32 end = 0;
+ Uint32 now = 0;
+ Uint32 last = 0;
+ int testms = testSeconds * 1000;
+ int wmax = (dest->w - src->w);
+ int hmax = (dest->h - src->h);
+ int isScreen = (SDL_GetVideoSurface() == dest);
+ SDL_Event event;
+
+ printf("Testing blit speed for %d seconds...\n", testSeconds);
+
+ now = SDL_GetTicks();
+ end = now + testms;
+
+ do
+ {
+ /* pump the event queue occasionally to keep OS happy... */
+ if (now - last > 1000)
+ {
+ last = now;
+ while (SDL_PollEvent(&event)) { /* no-op. */ }
+ }
+
+ iterations++;
+ elasped += blit(dest, src, randRange(0, wmax), randRange(0, hmax));
+ if (isScreen)
+ {
+ SDL_Flip(dest); /* show it! */
+ SDL_FillRect(dest, NULL, clearColor); /* blank it for next time! */
+ }
+
+ now = SDL_GetTicks();
+ } while (now < end);
+
+ printf("Non-blitting crap accounted for %d percent of this run.\n",
+ percent(testms - elasped, testms));
+
+ printf("%d blits took %d ms (%d fps).\n",
+ (int) iterations,
+ (int) elasped,
+ (int) (((float)iterations) / (((float)elasped) / 1000.0f)));
+}
+
+int main(int argc, char **argv)
+{
+ int initialized = setup_test(argc, argv);
+ if (initialized)
+ {
+ test_blit_speed();
+ SDL_Quit();
+ }
+ return(!initialized);
+}
+
+/* end of testblitspeed.c ... */
+
diff --git a/distrib/sdl-1.2.15/test/testcdrom.c b/distrib/sdl-1.2.15/test/testcdrom.c
new file mode 100644
index 0000000..782a66c
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testcdrom.c
@@ -0,0 +1,209 @@
+
+/* Test the SDL CD-ROM audio functions */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+
+#include "SDL.h"
+
+/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
+static void quit(int rc)
+{
+ SDL_Quit();
+ exit(rc);
+}
+
+static void PrintStatus(int driveindex, SDL_CD *cdrom)
+{
+ CDstatus status;
+ char *status_str;
+
+ status = SDL_CDStatus(cdrom);
+ switch (status) {
+ case CD_TRAYEMPTY:
+ status_str = "tray empty";
+ break;
+ case CD_STOPPED:
+ status_str = "stopped";
+ break;
+ case CD_PLAYING:
+ status_str = "playing";
+ break;
+ case CD_PAUSED:
+ status_str = "paused";
+ break;
+ case CD_ERROR:
+ status_str = "error state";
+ break;
+ }
+ printf("Drive %d status: %s\n", driveindex, status_str);
+ if ( status >= CD_PLAYING ) {
+ int m, s, f;
+ FRAMES_TO_MSF(cdrom->cur_frame, &m, &s, &f);
+ printf("Currently playing track %d, %d:%2.2d\n",
+ cdrom->track[cdrom->cur_track].id, m, s);
+ }
+}
+
+static void ListTracks(SDL_CD *cdrom)
+{
+ int i;
+ int m, s, f;
+ char* trtype;
+
+ SDL_CDStatus(cdrom);
+ printf("Drive tracks: %d\n", cdrom->numtracks);
+ for ( i=0; i<cdrom->numtracks; ++i ) {
+ FRAMES_TO_MSF(cdrom->track[i].length, &m, &s, &f);
+ if ( f > 0 )
+ ++s;
+ switch(cdrom->track[i].type)
+ {
+ case SDL_AUDIO_TRACK:
+ trtype="audio";
+ break;
+ case SDL_DATA_TRACK:
+ trtype="data";
+ break;
+ default:
+ trtype="unknown";
+ break;
+ }
+ printf("\tTrack (index %d) %d: %d:%2.2d / %d [%s track]\n", i,
+ cdrom->track[i].id, m, s, cdrom->track[i].length, trtype);
+ }
+}
+
+static void PrintUsage(char *argv0)
+{
+ fprintf(stderr, "Usage: %s [drive#] [command] [command] ...\n", argv0);
+ fprintf(stderr, "Where 'command' is one of:\n");
+ fprintf(stderr, " -status\n");
+ fprintf(stderr, " -list\n");
+ fprintf(stderr, " -play [first_track] [first_frame] [num_tracks] [num_frames]\n");
+ fprintf(stderr, " -pause\n");
+ fprintf(stderr, " -resume\n");
+ fprintf(stderr, " -stop\n");
+ fprintf(stderr, " -eject\n");
+ fprintf(stderr, " -sleep <milliseconds>\n");
+}
+
+int main(int argc, char *argv[])
+{
+ int drive;
+ int i;
+ SDL_CD *cdrom;
+
+ /* Initialize SDL first */
+ if ( SDL_Init(SDL_INIT_CDROM) < 0 ) {
+ fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
+ return(1);
+ }
+
+ /* Find out how many CD-ROM drives are connected to the system */
+ if ( SDL_CDNumDrives() == 0 ) {
+ printf("No CD-ROM devices detected\n");
+ quit(0);
+ }
+ printf("Drives available: %d\n", SDL_CDNumDrives());
+ for ( i=0; i<SDL_CDNumDrives(); ++i ) {
+ printf("Drive %d: \"%s\"\n", i, SDL_CDName(i));
+ }
+
+ /* Open the CD-ROM */
+ drive = 0;
+ i=1;
+ if ( argv[i] && isdigit(argv[i][0]) ) {
+ drive = atoi(argv[i++]);
+ }
+ cdrom = SDL_CDOpen(drive);
+ if ( cdrom == NULL ) {
+ fprintf(stderr, "Couldn't open drive %d: %s\n", drive,
+ SDL_GetError());
+ quit(2);
+ }
+#ifdef TEST_NULLCD
+ cdrom = NULL;
+#endif
+
+ /* Find out which function to perform */
+ for ( ; argv[i]; ++i ) {
+ if ( strcmp(argv[i], "-status") == 0 ) {
+ /* PrintStatus(drive, cdrom); */
+ } else
+ if ( strcmp(argv[i], "-list") == 0 ) {
+ ListTracks(cdrom);
+ } else
+ if ( strcmp(argv[i], "-play") == 0 ) {
+ int strack, sframe;
+ int ntrack, nframe;
+
+ strack = 0;
+ if ( argv[i+1] && isdigit(argv[i+1][0]) ) {
+ strack = atoi(argv[++i]);
+ }
+ sframe = 0;
+ if ( argv[i+1] && isdigit(argv[i+1][0]) ) {
+ sframe = atoi(argv[++i]);
+ }
+ ntrack = 0;
+ if ( argv[i+1] && isdigit(argv[i+1][0]) ) {
+ ntrack = atoi(argv[++i]);
+ }
+ nframe = 0;
+ if ( argv[i+1] && isdigit(argv[i+1][0]) ) {
+ nframe = atoi(argv[++i]);
+ }
+ if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
+ if ( SDL_CDPlayTracks(cdrom, strack, sframe,
+ ntrack, nframe) < 0 ) {
+ fprintf(stderr,
+ "Couldn't play tracks %d/%d for %d/%d: %s\n",
+ strack, sframe, ntrack, nframe, SDL_GetError());
+ }
+ } else {
+ fprintf(stderr, "No CD in drive!\n");
+ }
+ } else
+ if ( strcmp(argv[i], "-pause") == 0 ) {
+ if ( SDL_CDPause(cdrom) < 0 ) {
+ fprintf(stderr, "Couldn't pause CD: %s\n",
+ SDL_GetError());
+ }
+ } else
+ if ( strcmp(argv[i], "-resume") == 0 ) {
+ if ( SDL_CDResume(cdrom) < 0 ) {
+ fprintf(stderr, "Couldn't resume CD: %s\n",
+ SDL_GetError());
+ }
+ } else
+ if ( strcmp(argv[i], "-stop") == 0 ) {
+ if ( SDL_CDStop(cdrom) < 0 ) {
+ fprintf(stderr, "Couldn't eject CD: %s\n",
+ SDL_GetError());
+ }
+ } else
+ if ( strcmp(argv[i], "-eject") == 0 ) {
+ if ( SDL_CDEject(cdrom) < 0 ) {
+ fprintf(stderr, "Couldn't eject CD: %s\n",
+ SDL_GetError());
+ }
+ } else
+ if ( (strcmp(argv[i], "-sleep") == 0) &&
+ (argv[i+1] && isdigit(argv[i+1][0])) ) {
+ SDL_Delay(atoi(argv[++i]));
+ printf("Delayed %d milliseconds\n", atoi(argv[i]));
+ } else {
+ PrintUsage(argv[0]);
+ SDL_CDClose(cdrom);
+ quit(1);
+ }
+ }
+ PrintStatus(drive, cdrom);
+ SDL_CDClose(cdrom);
+ SDL_Quit();
+
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/test/testcursor.c b/distrib/sdl-1.2.15/test/testcursor.c
new file mode 100644
index 0000000..010e0a6
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testcursor.c
@@ -0,0 +1,216 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "SDL.h"
+
+/* This is an example 16x16 cursor
+ top left : black
+ top right : inverted color or black
+ bottom left: white
+ bottom right: transparent
+ (swap left and right for different endianness)
+*/
+
+Uint16 cursor_data[16]={
+ 0xffff,
+ 0xffff,
+ 0xffff,
+ 0xffff,
+
+ 0xffff,
+ 0xffff,
+ 0xffff,
+ 0xffff,
+
+ 0x0000,
+ 0x0000,
+ 0x0000,
+ 0x0000,
+
+ 0x0000,
+ 0x0000,
+ 0x0000,
+ 0x0000
+};
+
+Uint16 cursor_mask[16]={
+ 0xff00,
+ 0xff00,
+ 0xff00,
+ 0xff00,
+
+ 0xff00,
+ 0xff00,
+ 0xff00,
+ 0xff00,
+
+ 0xff00,
+ 0xff00,
+ 0xff00,
+ 0xff00,
+
+ 0xff00,
+ 0xff00,
+ 0xff00,
+ 0xff00
+};
+
+/* another test cursor: smaller than 16x16, and with an odd height */
+
+Uint8 small_cursor_data[11] = { 0x00, 0x18, 0x08, 0x38, 0x44, 0x54, 0x44, 0x38, 0x20, 0x20, 0x00 };
+Uint8 small_cursor_mask[11] = { 0x3C, 0x3C, 0x3C, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x78, 0x70, 0x70 };
+
+/* XPM */
+static const char *arrow[] = {
+ /* width height num_colors chars_per_pixel */
+ " 32 32 3 1",
+ /* colors */
+ "X c #000000",
+ ". c #ffffff",
+ " c None",
+ /* pixels */
+ "X ",
+ "XX ",
+ "X.X ",
+ "X..X ",
+ "X...X ",
+ "X....X ",
+ "X.....X ",
+ "X......X ",
+ "X.......X ",
+ "X........X ",
+ "X.....XXXXX ",
+ "X..X..X ",
+ "X.X X..X ",
+ "XX X..X ",
+ "X X..X ",
+ " X..X ",
+ " X..X ",
+ " X..X ",
+ " XX ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ "0,0"
+};
+
+static SDL_Cursor *create_arrow_cursor()
+{
+ int i, row, col;
+ Uint8 data[4*32];
+ Uint8 mask[4*32];
+ int hot_x, hot_y;
+
+ i = -1;
+ for ( row=0; row<32; ++row ) {
+ for ( col=0; col<32; ++col ) {
+ if ( col % 8 ) {
+ data[i] <<= 1;
+ mask[i] <<= 1;
+ } else {
+ ++i;
+ data[i] = mask[i] = 0;
+ }
+ switch (arrow[4+row][col]) {
+ case 'X':
+ data[i] |= 0x01;
+ mask[i] |= 0x01;
+ break;
+ case '.':
+ mask[i] |= 0x01;
+ break;
+ case ' ':
+ break;
+ }
+ }
+ }
+ sscanf(arrow[4+row], "%d,%d", &hot_x, &hot_y);
+ return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y);
+}
+
+
+int main(int argc, char *argv[])
+{
+ SDL_Surface *screen;
+ SDL_bool quit = SDL_FALSE, first_time = SDL_TRUE;
+ SDL_Cursor *cursor[3];
+ int current;
+
+ /* Load the SDL library */
+ if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
+ fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
+ return(1);
+ }
+
+ screen = SDL_SetVideoMode(320,200,8,SDL_ANYFORMAT);
+ if (screen==NULL) {
+ fprintf(stderr, "Couldn't initialize video mode: %s\n",SDL_GetError());
+ return(1);
+ }
+
+ SDL_FillRect(screen, NULL, 0x664422);
+
+ cursor[0] = SDL_CreateCursor((Uint8 *)cursor_data, (Uint8 *)cursor_mask,
+ 16, 16, 8, 8);
+ if (cursor[0]==NULL) {
+ fprintf(stderr, "Couldn't initialize test cursor: %s\n",SDL_GetError());
+ SDL_Quit();
+ return(1);
+ }
+ cursor[1] = create_arrow_cursor();
+ if (cursor[1]==NULL) {
+ fprintf(stderr, "Couldn't initialize arrow cursor: %s\n",SDL_GetError());
+ SDL_FreeCursor(cursor[0]);
+ SDL_Quit();
+ return(1);
+ }
+ cursor[2] = SDL_CreateCursor(small_cursor_data, small_cursor_mask,
+ 8, 11, 3, 5);
+ if (cursor[2]==NULL) {
+ fprintf(stderr, "Couldn't initialize test cursor: %s\n",SDL_GetError());
+ SDL_Quit();
+ return(1);
+ }
+
+ current = 0;
+ SDL_SetCursor(cursor[current]);
+
+ while (!quit) {
+ SDL_Event event;
+ while (SDL_PollEvent(&event)) {
+ switch(event.type) {
+ case SDL_MOUSEBUTTONDOWN:
+ current = (current + 1)%3;
+ SDL_SetCursor(cursor[current]);
+ break;
+ case SDL_KEYDOWN:
+ if (event.key.keysym.sym == SDLK_ESCAPE) {
+ quit = SDL_TRUE;
+ }
+ break;
+ case SDL_QUIT:
+ quit = SDL_TRUE;
+ break;
+ }
+ }
+ SDL_Flip(screen);
+ SDL_Delay(1);
+ }
+
+ SDL_FreeCursor(cursor[0]);
+ SDL_FreeCursor(cursor[1]);
+ SDL_FreeCursor(cursor[2]);
+
+ SDL_Quit();
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/test/testdyngl.c b/distrib/sdl-1.2.15/test/testdyngl.c
new file mode 100644
index 0000000..a20bd1a
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testdyngl.c
@@ -0,0 +1,209 @@
+/*
+ * Small SDL example to demonstrate dynamically loading
+ * OpenGL lib and functions
+ *
+ * (FYI it was supposed to look like snow in the wind or something...)
+ *
+ * Compile with :
+ * gcc testdyngl.c `sdl-config --libs --cflags` -o testdyngl -DHAVE_OPENGL
+ *
+ * You can specify a different OpenGL lib on the command line, i.e. :
+ * ./testdyngl /usr/X11R6/lib/libGL.so.1.2
+ * or
+ * ./testdyngl /usr/lib/libGL.so.1.0.4496
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "SDL.h"
+
+#ifdef __MACOS__
+#define HAVE_OPENGL
+#endif
+
+#ifdef HAVE_OPENGL
+
+#include "SDL_opengl.h"
+
+/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
+static void quit(int rc)
+{
+ SDL_Quit();
+ exit(rc);
+}
+
+void* get_funcaddr(const char* p)
+{
+ void* f=SDL_GL_GetProcAddress(p);
+ if (f)
+ {
+ return f;
+ }
+ else
+ {
+ printf("Unable to get function pointer for %s\n",p);
+ quit(1);
+ }
+ return NULL;
+}
+
+typedef struct
+{
+ void(APIENTRY*glBegin)(GLenum);
+ void(APIENTRY*glEnd)();
+ void(APIENTRY*glVertex3f)(GLfloat, GLfloat, GLfloat);
+ void(APIENTRY*glClearColor)(GLfloat, GLfloat, GLfloat, GLfloat);
+ void(APIENTRY*glClear)(GLbitfield);
+ void(APIENTRY*glDisable)(GLenum);
+ void(APIENTRY*glEnable)(GLenum);
+ void(APIENTRY*glColor4ub)(GLubyte,GLubyte,GLubyte,GLubyte);
+ void(APIENTRY*glPointSize)(GLfloat);
+ void(APIENTRY*glHint)(GLenum,GLenum);
+ void(APIENTRY*glBlendFunc)(GLenum,GLenum);
+ void(APIENTRY*glMatrixMode)(GLenum);
+ void(APIENTRY*glLoadIdentity)();
+ void(APIENTRY*glOrtho)(GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble);
+ void(APIENTRY*glRotatef)(GLfloat,GLfloat,GLfloat,GLfloat);
+ void(APIENTRY*glViewport)(GLint,GLint,GLsizei,GLsizei);
+ void(APIENTRY*glFogf)(GLenum,GLfloat);
+}
+glfuncs;
+
+void init_glfuncs(glfuncs* f)
+{
+ f->glBegin=get_funcaddr("glBegin");
+ f->glEnd=get_funcaddr("glEnd");
+ f->glVertex3f=get_funcaddr("glVertex3f");
+ f->glClearColor=get_funcaddr("glClearColor");
+ f->glClear=get_funcaddr("glClear");
+ f->glDisable=get_funcaddr("glDisable");
+ f->glEnable=get_funcaddr("glEnable");
+ f->glColor4ub=get_funcaddr("glColor4ub");
+ f->glPointSize=get_funcaddr("glPointSize");
+ f->glHint=get_funcaddr("glHint");
+ f->glBlendFunc=get_funcaddr("glBlendFunc");
+ f->glMatrixMode=get_funcaddr("glMatrixMode");
+ f->glLoadIdentity=get_funcaddr("glLoadIdentity");
+ f->glOrtho=get_funcaddr("glOrtho");
+ f->glRotatef=get_funcaddr("glRotatef");
+ f->glViewport=get_funcaddr("glViewport");
+ f->glFogf=get_funcaddr("glFogf");
+}
+
+#define NB_PIXELS 1000
+
+int main(int argc,char *argv[])
+{
+ glfuncs f;
+ int i;
+ SDL_Event event;
+ int done=0;
+ GLfloat pixels[NB_PIXELS*3];
+ const char *gl_library = NULL; /* Use the default GL library */
+
+ if (argv[1]) {
+ gl_library = argv[1];
+ }
+
+ if (SDL_Init(SDL_INIT_VIDEO)<0)
+ {
+ printf("Unable to init SDL : %s\n",SDL_GetError());
+ return(1);
+ }
+
+ if (SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER,1)<0)
+ {
+ printf("Unable to set GL attribute : %s\n",SDL_GetError());
+ quit(1);
+ }
+
+ if (SDL_GL_LoadLibrary(gl_library)<0)
+ {
+ printf("Unable to dynamically open GL lib : %s\n",SDL_GetError());
+ quit(1);
+ }
+
+ if (SDL_SetVideoMode(640,480,0,SDL_OPENGL)==NULL)
+ {
+ printf("Unable to open video mode : %s\n",SDL_GetError());
+ quit(1);
+ }
+
+ /* Set the window manager title bar */
+ SDL_WM_SetCaption( "SDL Dynamic OpenGL Loading Test", "testdyngl" );
+
+ init_glfuncs(&f);
+
+ for(i=0;i<NB_PIXELS;i++)
+ {
+ pixels[3*i]=rand()%250-125;
+ pixels[3*i+1]=rand()%250-125;
+ pixels[3*i+2]=rand()%250-125;
+ }
+
+ f.glViewport(0,0,640,480);
+
+ f.glMatrixMode(GL_PROJECTION);
+ f.glLoadIdentity();
+ f.glOrtho(-100,100,-100,100,-500,500);
+
+ f.glMatrixMode(GL_MODELVIEW);
+ f.glLoadIdentity();
+
+ f.glEnable(GL_DEPTH_TEST);
+ f.glDisable(GL_TEXTURE_2D);
+ f.glEnable(GL_BLEND);
+ f.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+ f.glClearColor(0.0f,0.0f,0.0f,0.0f);
+ f.glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
+
+ f.glEnable(GL_POINT_SMOOTH);
+ f.glHint(GL_POINT_SMOOTH_HINT,GL_NICEST);
+ f.glPointSize(5.0f);
+ f.glEnable(GL_FOG);
+ f.glFogf(GL_FOG_START,-500);
+ f.glFogf(GL_FOG_END,500);
+ f.glFogf(GL_FOG_DENSITY,0.005);
+
+ do
+ {
+ f.glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
+
+ f.glRotatef(2.0,1.0,1.0,1.0);
+ f.glRotatef(1.0,0.0,1.0,1.0);
+
+ f.glColor4ub(255,255,255,255);
+ f.glBegin(GL_POINTS);
+ for(i=0;i<NB_PIXELS;i++)
+ {
+ f.glVertex3f(pixels[3*i],pixels[3*i+1],pixels[3*i+2]);
+ }
+ f.glEnd();
+ SDL_GL_SwapBuffers();
+
+ while(SDL_PollEvent(&event))
+ {
+ if(event.type & SDL_KEYDOWN)
+ done=1;
+ }
+
+ SDL_Delay(20);
+ }
+ while(!done);
+
+ SDL_Quit();
+ return 0;
+}
+
+#else /* HAVE_OPENGL */
+
+int main(int argc, char *argv[])
+{
+ printf("No OpenGL support on this system\n");
+ return 1;
+}
+
+#endif /* HAVE_OPENGL */
diff --git a/distrib/sdl-1.2.15/test/testerror.c b/distrib/sdl-1.2.15/test/testerror.c
new file mode 100644
index 0000000..9211dfc
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testerror.c
@@ -0,0 +1,61 @@
+
+/* Simple test of the SDL threading code and error handling */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+
+#include "SDL.h"
+#include "SDL_thread.h"
+
+static int alive = 0;
+
+/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
+static void quit(int rc)
+{
+ SDL_Quit();
+ exit(rc);
+}
+
+int SDLCALL ThreadFunc(void *data)
+{
+ /* Set the child thread error string */
+ SDL_SetError("Thread %s (%d) had a problem: %s",
+ (char *)data, SDL_ThreadID(), "nevermind");
+ while ( alive ) {
+ printf("Thread '%s' is alive!\n", (char *)data);
+ SDL_Delay(1*1000);
+ }
+ printf("Child thread error string: %s\n", SDL_GetError());
+ return(0);
+}
+
+int main(int argc, char *argv[])
+{
+ SDL_Thread *thread;
+
+ /* Load the SDL library */
+ if ( SDL_Init(0) < 0 ) {
+ fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
+ return(1);
+ }
+
+ /* Set the error value for the main thread */
+ SDL_SetError("No worries");
+
+ alive = 1;
+ thread = SDL_CreateThread(ThreadFunc, "#1");
+ if ( thread == NULL ) {
+ fprintf(stderr, "Couldn't create thread: %s\n", SDL_GetError());
+ quit(1);
+ }
+ SDL_Delay(5*1000);
+ printf("Waiting for thread #1\n");
+ alive = 0;
+ SDL_WaitThread(thread, NULL);
+
+ printf("Main thread error string: %s\n", SDL_GetError());
+
+ SDL_Quit();
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/test/testfile.c b/distrib/sdl-1.2.15/test/testfile.c
new file mode 100644
index 0000000..ecebb7d
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testfile.c
@@ -0,0 +1,182 @@
+
+/* sanity tests on SDL_rwops.c (usefull for alternative implementations of stdio rwops) */
+
+#include <stdlib.h>
+
+#ifndef _MSC_VER
+#include <unistd.h>
+#endif
+
+#include "SDL.h"
+#include "SDL_endian.h"
+
+
+#include <stdio.h>
+
+/* WARNING ! those 2 files will be destroyed by this test program */
+#define FBASENAME1 "sdldata1" /* this file will be created during tests */
+#define FBASENAME2 "sdldata2" /* this file should not exists before starting test */
+
+
+#ifndef NULL
+#define NULL ((void *)0)
+#endif
+
+static void cleanup( void ) {
+
+ unlink(FBASENAME1);
+ unlink(FBASENAME2);
+}
+
+static void rwops_error_quit( unsigned line, SDL_RWops *rwops) {
+
+ printf("testfile.c(%d): failed\n",line);
+ if (rwops) {
+ rwops->close(rwops); /* This calls SDL_FreeRW(rwops); */
+ }
+ cleanup();
+ exit(1); /* quit with rwops error (test failed) */
+}
+
+#define RWOP_ERR_QUIT(x) rwops_error_quit( __LINE__, (x) )
+
+
+
+int main(int argc, char *argv[])
+{
+ SDL_RWops *rwops = NULL;
+ char test_buf[30];
+
+ cleanup();
+
+/* test 1 : basic argument test: all those calls to SDL_RWFromFile should fail */
+
+ rwops = SDL_RWFromFile(NULL,NULL);
+ if (rwops) RWOP_ERR_QUIT(rwops);
+ rwops = SDL_RWFromFile(NULL,"ab+");
+ if (rwops) RWOP_ERR_QUIT(rwops);
+ rwops = SDL_RWFromFile(NULL,"sldfkjsldkfj");
+ if (rwops) RWOP_ERR_QUIT(rwops);
+ rwops = SDL_RWFromFile("something","");
+ if (rwops) RWOP_ERR_QUIT(rwops);
+ rwops = SDL_RWFromFile("something",NULL);
+ if (rwops) 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
+ 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) RWOP_ERR_QUIT(rwops);
+ rwops = SDL_RWFromFile(FBASENAME2,"rb+"); /* this file doesn't exist that call must fail */
+ if (rwops) RWOP_ERR_QUIT(rwops);
+ rwops = SDL_RWFromFile(FBASENAME2,"wb");
+ if (!rwops) RWOP_ERR_QUIT(rwops);
+ rwops->close(rwops); unlink(FBASENAME2);
+ rwops = SDL_RWFromFile(FBASENAME2,"wb+");
+ if (!rwops) RWOP_ERR_QUIT(rwops);
+ rwops->close(rwops); unlink(FBASENAME2);
+ rwops = SDL_RWFromFile(FBASENAME2,"ab");
+ if (!rwops) RWOP_ERR_QUIT(rwops);
+ rwops->close(rwops); unlink(FBASENAME2);
+ rwops = SDL_RWFromFile(FBASENAME2,"ab+");
+ if (!rwops) RWOP_ERR_QUIT(rwops);
+ rwops->close(rwops); unlink(FBASENAME2);
+ printf("test2 OK\n");
+
+/* test 3 : creation, writing , reading, seeking,
+ test : w mode, r mode, w+ mode
+ */
+ rwops = SDL_RWFromFile(FBASENAME1,"wb"); /* write only */
+ if (!rwops) RWOP_ERR_QUIT(rwops);
+ if (1 != rwops->write(rwops,"1234567890",10,1) ) RWOP_ERR_QUIT(rwops);
+ if (10 != rwops->write(rwops,"1234567890",1,10) ) RWOP_ERR_QUIT(rwops);
+ if (7 != rwops->write(rwops,"1234567",1,7) ) RWOP_ERR_QUIT(rwops);
+ if (0!=rwops->seek(rwops,0L,RW_SEEK_SET)) RWOP_ERR_QUIT(rwops);
+ if (0!=rwops->read(rwops,test_buf,1,1)) RWOP_ERR_QUIT(rwops); /* we are in write only mode */
+ rwops->close(rwops);
+
+ rwops = SDL_RWFromFile(FBASENAME1,"rb"); /* read mode, file must exists */
+ if (!rwops) RWOP_ERR_QUIT(rwops);
+ if (0!=rwops->seek(rwops,0L,RW_SEEK_SET)) RWOP_ERR_QUIT(rwops);
+ if (20!=rwops->seek(rwops,-7,RW_SEEK_END)) RWOP_ERR_QUIT(rwops);
+ if (7!=rwops->read(rwops,test_buf,1,7)) RWOP_ERR_QUIT(rwops);
+ if (SDL_memcmp(test_buf,"1234567",7)) RWOP_ERR_QUIT(rwops);
+ if (0!=rwops->read(rwops,test_buf,1,1)) RWOP_ERR_QUIT(rwops);
+ if (0!=rwops->read(rwops,test_buf,10,100)) RWOP_ERR_QUIT(rwops);
+ if (0!=rwops->seek(rwops,-27,RW_SEEK_CUR)) RWOP_ERR_QUIT(rwops);
+ if (2!=rwops->read(rwops,test_buf,10,3)) RWOP_ERR_QUIT(rwops);
+ if (SDL_memcmp(test_buf,"12345678901234567890",20)) RWOP_ERR_QUIT(rwops);
+ if (0!=rwops->write(rwops,test_buf,1,1)) RWOP_ERR_QUIT(rwops); /* readonly mode */
+ rwops->close(rwops);
+
+/* test 3: same with w+ mode */
+ rwops = SDL_RWFromFile(FBASENAME1,"wb+"); /* write + read + truncation */
+ if (!rwops) RWOP_ERR_QUIT(rwops);
+ if (1 != rwops->write(rwops,"1234567890",10,1) ) RWOP_ERR_QUIT(rwops);
+ if (10 != rwops->write(rwops,"1234567890",1,10) ) RWOP_ERR_QUIT(rwops);
+ if (7 != rwops->write(rwops,"1234567",1,7) ) RWOP_ERR_QUIT(rwops);
+ if (0!=rwops->seek(rwops,0L,RW_SEEK_SET)) RWOP_ERR_QUIT(rwops);
+ if (1!=rwops->read(rwops,test_buf,1,1)) RWOP_ERR_QUIT(rwops); /* we are in read/write mode */
+ if (0!=rwops->seek(rwops,0L,RW_SEEK_SET)) RWOP_ERR_QUIT(rwops);
+ if (20!=rwops->seek(rwops,-7,RW_SEEK_END)) RWOP_ERR_QUIT(rwops);
+ if (7!=rwops->read(rwops,test_buf,1,7)) RWOP_ERR_QUIT(rwops);
+ if (SDL_memcmp(test_buf,"1234567",7)) RWOP_ERR_QUIT(rwops);
+ if (0!=rwops->read(rwops,test_buf,1,1)) RWOP_ERR_QUIT(rwops);
+ if (0!=rwops->read(rwops,test_buf,10,100)) RWOP_ERR_QUIT(rwops);
+ if (0!=rwops->seek(rwops,-27,RW_SEEK_CUR)) RWOP_ERR_QUIT(rwops);
+ if (2!=rwops->read(rwops,test_buf,10,3)) RWOP_ERR_QUIT(rwops);
+ if (SDL_memcmp(test_buf,"12345678901234567890",20)) RWOP_ERR_QUIT(rwops);
+ rwops->close(rwops);
+ printf("test3 OK\n");
+
+/* test 4: same in r+ mode */
+ rwops = SDL_RWFromFile(FBASENAME1,"rb+"); /* write + read + file must exists, no truncation */
+ if (!rwops) RWOP_ERR_QUIT(rwops);
+ if (1 != rwops->write(rwops,"1234567890",10,1) ) RWOP_ERR_QUIT(rwops);
+ if (10 != rwops->write(rwops,"1234567890",1,10) ) RWOP_ERR_QUIT(rwops);
+ if (7 != rwops->write(rwops,"1234567",1,7) ) RWOP_ERR_QUIT(rwops);
+ if (0!=rwops->seek(rwops,0L,RW_SEEK_SET)) RWOP_ERR_QUIT(rwops);
+ if (1!=rwops->read(rwops,test_buf,1,1)) RWOP_ERR_QUIT(rwops); /* we are in read/write mode */
+ if (0!=rwops->seek(rwops,0L,RW_SEEK_SET)) RWOP_ERR_QUIT(rwops);
+ if (20!=rwops->seek(rwops,-7,RW_SEEK_END)) RWOP_ERR_QUIT(rwops);
+ if (7!=rwops->read(rwops,test_buf,1,7)) RWOP_ERR_QUIT(rwops);
+ if (SDL_memcmp(test_buf,"1234567",7)) RWOP_ERR_QUIT(rwops);
+ if (0!=rwops->read(rwops,test_buf,1,1)) RWOP_ERR_QUIT(rwops);
+ if (0!=rwops->read(rwops,test_buf,10,100)) RWOP_ERR_QUIT(rwops);
+ if (0!=rwops->seek(rwops,-27,RW_SEEK_CUR)) RWOP_ERR_QUIT(rwops);
+ if (2!=rwops->read(rwops,test_buf,10,3)) RWOP_ERR_QUIT(rwops);
+ if (SDL_memcmp(test_buf,"12345678901234567890",20)) RWOP_ERR_QUIT(rwops);
+ rwops->close(rwops);
+ printf("test4 OK\n");
+
+/* test5 : append mode */
+ rwops = SDL_RWFromFile(FBASENAME1,"ab+"); /* write + read + append */
+ if (!rwops) RWOP_ERR_QUIT(rwops);
+ if (1 != rwops->write(rwops,"1234567890",10,1) ) RWOP_ERR_QUIT(rwops);
+ if (10 != rwops->write(rwops,"1234567890",1,10) ) RWOP_ERR_QUIT(rwops);
+ if (7 != rwops->write(rwops,"1234567",1,7) ) RWOP_ERR_QUIT(rwops);
+ if (0!=rwops->seek(rwops,0L,RW_SEEK_SET)) RWOP_ERR_QUIT(rwops);
+
+ if (1!=rwops->read(rwops,test_buf,1,1)) RWOP_ERR_QUIT(rwops);
+ if (0!=rwops->seek(rwops,0L,RW_SEEK_SET)) RWOP_ERR_QUIT(rwops);
+
+ if (20+27!=rwops->seek(rwops,-7,RW_SEEK_END)) RWOP_ERR_QUIT(rwops);
+ if (7!=rwops->read(rwops,test_buf,1,7)) RWOP_ERR_QUIT(rwops);
+ if (SDL_memcmp(test_buf,"1234567",7)) RWOP_ERR_QUIT(rwops);
+ if (0!=rwops->read(rwops,test_buf,1,1)) RWOP_ERR_QUIT(rwops);
+ if (0!=rwops->read(rwops,test_buf,10,100)) RWOP_ERR_QUIT(rwops);
+
+ if (27!=rwops->seek(rwops,-27,RW_SEEK_CUR)) RWOP_ERR_QUIT(rwops);
+
+ if (0!=rwops->seek(rwops,0L,RW_SEEK_SET)) RWOP_ERR_QUIT(rwops);
+ if (3!=rwops->read(rwops,test_buf,10,3)) RWOP_ERR_QUIT(rwops);
+ if (SDL_memcmp(test_buf,"123456789012345678901234567123",30))
+ RWOP_ERR_QUIT(rwops);
+ rwops->close(rwops);
+ printf("test5 OK\n");
+ cleanup();
+ return 0; /* all ok */
+}
diff --git a/distrib/sdl-1.2.15/test/testgamma.c b/distrib/sdl-1.2.15/test/testgamma.c
new file mode 100644
index 0000000..70f4b3c
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testgamma.c
@@ -0,0 +1,197 @@
+
+/* Bring up a window and manipulate the gamma on it */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+
+#include "SDL.h"
+
+/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
+static void quit(int rc)
+{
+ SDL_Quit();
+ exit(rc);
+}
+
+/* Turn a normal gamma value into an appropriate gamma ramp */
+void CalculateGamma(double gamma, Uint16 *ramp)
+{
+ int i, value;
+
+ gamma = 1.0 / gamma;
+ for ( i=0; i<256; ++i ) {
+ value = (int)(pow((double)i/256.0, gamma)*65535.0 + 0.5);
+ if ( value > 65535 ) {
+ value = 65535;
+ }
+ ramp[i] = (Uint16)value;
+ }
+}
+
+/* This can be used as a general routine for all of the test programs */
+int get_video_args(char *argv[], int *w, int *h, int *bpp, Uint32 *flags)
+{
+ int i;
+
+ *w = 640;
+ *h = 480;
+ *bpp = 0;
+ *flags = SDL_SWSURFACE;
+
+ for ( i=1; argv[i]; ++i ) {
+ if ( strcmp(argv[i], "-width") == 0 ) {
+ if ( argv[i+1] ) {
+ *w = atoi(argv[++i]);
+ }
+ } else
+ if ( strcmp(argv[i], "-height") == 0 ) {
+ if ( argv[i+1] ) {
+ *h = atoi(argv[++i]);
+ }
+ } else
+ if ( strcmp(argv[i], "-bpp") == 0 ) {
+ if ( argv[i+1] ) {
+ *bpp = atoi(argv[++i]);
+ }
+ } else
+ if ( strcmp(argv[i], "-fullscreen") == 0 ) {
+ *flags |= SDL_FULLSCREEN;
+ } else
+ if ( strcmp(argv[i], "-hw") == 0 ) {
+ *flags |= SDL_HWSURFACE;
+ } else
+ if ( strcmp(argv[i], "-hwpalette") == 0 ) {
+ *flags |= SDL_HWPALETTE;
+ } else
+ break;
+ }
+ return i;
+}
+
+int main(int argc, char *argv[])
+{
+ SDL_Surface *screen;
+ SDL_Surface *image;
+ float gamma;
+ int i;
+ int w, h, bpp;
+ Uint32 flags;
+ Uint16 ramp[256];
+ Uint16 red_ramp[256];
+ Uint32 then, timeout;
+
+ /* Check command line arguments */
+ argv += get_video_args(argv, &w, &h, &bpp, &flags);
+
+ /* Initialize SDL */
+ if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
+ fprintf(stderr,
+ "Couldn't initialize SDL: %s\n", SDL_GetError());
+ return(1);
+ }
+
+ /* Initialize the display, always use hardware palette */
+ screen = SDL_SetVideoMode(w, h, bpp, flags | SDL_HWPALETTE);
+ if ( screen == NULL ) {
+ fprintf(stderr, "Couldn't set %dx%d video mode: %s\n",
+ w, h, SDL_GetError());
+ quit(1);
+ }
+
+ /* Set the window manager title bar */
+ SDL_WM_SetCaption("SDL gamma test", "testgamma");
+
+ /* Set the desired gamma, if any */
+ gamma = 1.0f;
+ if ( *argv ) {
+ gamma = (float)atof(*argv);
+ }
+ if ( SDL_SetGamma(gamma, gamma, gamma) < 0 ) {
+ fprintf(stderr, "Unable to set gamma: %s\n", SDL_GetError());
+ quit(1);
+ }
+
+#if 0 /* This isn't supported. Integrating the gamma ramps isn't exact */
+ /* See what gamma was actually set */
+ float real[3];
+ if ( SDL_GetGamma(&real[0], &real[1], &real[2]) < 0 ) {
+ printf("Couldn't get gamma: %s\n", SDL_GetError());
+ } else {
+ printf("Set gamma values: R=%2.2f, G=%2.2f, B=%2.2f\n",
+ real[0], real[1], real[2]);
+ }
+#endif
+
+ /* Do all the drawing work */
+ image = SDL_LoadBMP("sample.bmp");
+ if ( image ) {
+ SDL_Rect dst;
+
+ dst.x = (screen->w - image->w)/2;
+ dst.y = (screen->h - image->h)/2;
+ dst.w = image->w;
+ dst.h = image->h;
+ SDL_BlitSurface(image, NULL, screen, &dst);
+ SDL_UpdateRects(screen, 1, &dst);
+ }
+
+ /* Wait a bit, handling events */
+ then = SDL_GetTicks();
+ timeout = (5*1000);
+ while ( (SDL_GetTicks()-then) < timeout ) {
+ SDL_Event event;
+
+ while ( SDL_PollEvent(&event) ) {
+ switch (event.type) {
+ case SDL_QUIT: /* Quit now */
+ timeout = 0;
+ break;
+ case SDL_KEYDOWN:
+ switch (event.key.keysym.sym) {
+ case SDLK_SPACE: /* Go longer.. */
+ timeout += (5*1000);
+ break;
+ case SDLK_UP:
+ gamma += 0.2f;
+ SDL_SetGamma(gamma, gamma, gamma);
+ break;
+ case SDLK_DOWN:
+ gamma -= 0.2f;
+ SDL_SetGamma(gamma, gamma, gamma);
+ break;
+ case SDLK_ESCAPE:
+ timeout = 0;
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+ }
+ }
+
+ /* Perform a gamma flash to red using color ramps */
+ while ( gamma < 10.0 ) {
+ /* Increase the red gamma and decrease everything else... */
+ gamma += 0.1f;
+ CalculateGamma(gamma, red_ramp);
+ CalculateGamma(1.0/gamma, ramp);
+ SDL_SetGammaRamp(red_ramp, ramp, ramp);
+ }
+ /* Finish completely red */
+ memset(red_ramp, 255, sizeof(red_ramp));
+ memset(ramp, 0, sizeof(ramp));
+ SDL_SetGammaRamp(red_ramp, ramp, ramp);
+
+ /* Now fade out to black */
+ for ( i=(red_ramp[0] >> 8); i >= 0; --i ) {
+ memset(red_ramp, i, sizeof(red_ramp));
+ SDL_SetGammaRamp(red_ramp, NULL, NULL);
+ }
+ SDL_Delay(1*1000);
+
+ SDL_Quit();
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/test/testgl.c b/distrib/sdl-1.2.15/test/testgl.c
new file mode 100644
index 0000000..34b88cf
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testgl.c
@@ -0,0 +1,856 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+
+#include "SDL.h"
+
+#ifdef __MACOS__
+#define HAVE_OPENGL
+#endif
+
+#ifdef HAVE_OPENGL
+
+#include "SDL_opengl.h"
+
+/* Undefine this if you want a flat cube instead of a rainbow cube */
+#define SHADED_CUBE
+
+/* Define this to be the name of the logo image to use with -logo */
+#define LOGO_FILE "icon.bmp"
+
+/* The SDL_OPENGLBLIT interface is deprecated.
+ The code is still available for benchmark purposes though.
+*/
+
+static SDL_bool USE_DEPRECATED_OPENGLBLIT = SDL_FALSE;
+
+static SDL_Surface *global_image = NULL;
+static GLuint global_texture = 0;
+static GLuint cursor_texture = 0;
+
+/**********************************************************************/
+
+void HotKey_ToggleFullScreen(void)
+{
+ SDL_Surface *screen;
+
+ screen = SDL_GetVideoSurface();
+ if ( SDL_WM_ToggleFullScreen(screen) ) {
+ printf("Toggled fullscreen mode - now %s\n",
+ (screen->flags&SDL_FULLSCREEN) ? "fullscreen" : "windowed");
+ } else {
+ printf("Unable to toggle fullscreen mode\n");
+ }
+}
+
+void HotKey_ToggleGrab(void)
+{
+ SDL_GrabMode mode;
+
+ printf("Ctrl-G: toggling input grab!\n");
+ mode = SDL_WM_GrabInput(SDL_GRAB_QUERY);
+ if ( mode == SDL_GRAB_ON ) {
+ printf("Grab was on\n");
+ } else {
+ printf("Grab was off\n");
+ }
+ mode = SDL_WM_GrabInput(!mode);
+ if ( mode == SDL_GRAB_ON ) {
+ printf("Grab is now on\n");
+ } else {
+ printf("Grab is now off\n");
+ }
+}
+
+void HotKey_Iconify(void)
+{
+ printf("Ctrl-Z: iconifying window!\n");
+ SDL_WM_IconifyWindow();
+}
+
+int HandleEvent(SDL_Event *event)
+{
+ int done;
+
+ done = 0;
+ switch( event->type ) {
+ case SDL_ACTIVEEVENT:
+ /* See what happened */
+ printf( "app %s ", event->active.gain ? "gained" : "lost" );
+ if ( event->active.state & SDL_APPACTIVE ) {
+ printf( "active " );
+ } else if ( event->active.state & SDL_APPMOUSEFOCUS ) {
+ printf( "mouse " );
+ } else if ( event->active.state & SDL_APPINPUTFOCUS ) {
+ printf( "input " );
+ }
+ printf( "focus\n" );
+ break;
+
+
+ case SDL_KEYDOWN:
+ if ( event->key.keysym.sym == SDLK_ESCAPE ) {
+ done = 1;
+ }
+ if ( (event->key.keysym.sym == SDLK_g) &&
+ (event->key.keysym.mod & KMOD_CTRL) ) {
+ HotKey_ToggleGrab();
+ }
+ if ( (event->key.keysym.sym == SDLK_z) &&
+ (event->key.keysym.mod & KMOD_CTRL) ) {
+ HotKey_Iconify();
+ }
+ if ( (event->key.keysym.sym == SDLK_RETURN) &&
+ (event->key.keysym.mod & KMOD_ALT) ) {
+ HotKey_ToggleFullScreen();
+ }
+ printf("key '%s' pressed\n",
+ SDL_GetKeyName(event->key.keysym.sym));
+ break;
+ case SDL_QUIT:
+ done = 1;
+ break;
+ }
+ return(done);
+}
+
+void SDL_GL_Enter2DMode()
+{
+ SDL_Surface *screen = SDL_GetVideoSurface();
+
+ /* Note, there may be other things you need to change,
+ depending on how you have your OpenGL state set up.
+ */
+ glPushAttrib(GL_ENABLE_BIT);
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_CULL_FACE);
+ glEnable(GL_TEXTURE_2D);
+
+ /* This allows alpha blending of 2D textures with the scene */
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+ glViewport(0, 0, screen->w, screen->h);
+
+ glMatrixMode(GL_PROJECTION);
+ glPushMatrix();
+ glLoadIdentity();
+
+ glOrtho(0.0, (GLdouble)screen->w, (GLdouble)screen->h, 0.0, 0.0, 1.0);
+
+ glMatrixMode(GL_MODELVIEW);
+ glPushMatrix();
+ glLoadIdentity();
+
+ glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
+}
+
+void SDL_GL_Leave2DMode()
+{
+ glMatrixMode(GL_MODELVIEW);
+ glPopMatrix();
+
+ glMatrixMode(GL_PROJECTION);
+ glPopMatrix();
+
+ glPopAttrib();
+}
+
+/* Quick utility function for texture creation */
+static int power_of_two(int input)
+{
+ int value = 1;
+
+ while ( value < input ) {
+ value <<= 1;
+ }
+ return value;
+}
+
+GLuint SDL_GL_LoadTexture(SDL_Surface *surface, GLfloat *texcoord)
+{
+ GLuint texture;
+ int w, h;
+ SDL_Surface *image;
+ SDL_Rect area;
+ Uint32 saved_flags;
+ Uint8 saved_alpha;
+
+ /* Use the surface width and height expanded to powers of 2 */
+ w = power_of_two(surface->w);
+ h = power_of_two(surface->h);
+ texcoord[0] = 0.0f; /* Min X */
+ texcoord[1] = 0.0f; /* Min Y */
+ texcoord[2] = (GLfloat)surface->w / w; /* Max X */
+ texcoord[3] = (GLfloat)surface->h / h; /* Max Y */
+
+ image = SDL_CreateRGBSurface(
+ SDL_SWSURFACE,
+ w, h,
+ 32,
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN /* OpenGL RGBA masks */
+ 0x000000FF,
+ 0x0000FF00,
+ 0x00FF0000,
+ 0xFF000000
+#else
+ 0xFF000000,
+ 0x00FF0000,
+ 0x0000FF00,
+ 0x000000FF
+#endif
+ );
+ if ( image == NULL ) {
+ return 0;
+ }
+
+ /* Save the alpha blending attributes */
+ saved_flags = surface->flags&(SDL_SRCALPHA|SDL_RLEACCELOK);
+ saved_alpha = surface->format->alpha;
+ if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
+ SDL_SetAlpha(surface, 0, 0);
+ }
+
+ /* Copy the surface into the GL texture image */
+ area.x = 0;
+ area.y = 0;
+ area.w = surface->w;
+ area.h = surface->h;
+ 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);
+ }
+
+ /* Create an OpenGL texture for the image */
+ glGenTextures(1, &texture);
+ glBindTexture(GL_TEXTURE_2D, texture);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexImage2D(GL_TEXTURE_2D,
+ 0,
+ GL_RGBA,
+ w, h,
+ 0,
+ GL_RGBA,
+ GL_UNSIGNED_BYTE,
+ image->pixels);
+ SDL_FreeSurface(image); /* No longer needed */
+
+ return texture;
+}
+
+void DrawLogoCursor(void)
+{
+ static GLfloat texMinX, texMinY;
+ static GLfloat texMaxX, texMaxY;
+ static int w, h;
+ int x, y;
+
+ if ( ! cursor_texture ) {
+ SDL_Surface *image;
+ GLfloat texcoord[4];
+
+ /* Load the image (could use SDL_image library here) */
+ image = SDL_LoadBMP(LOGO_FILE);
+ if ( image == NULL ) {
+ return;
+ }
+ w = image->w;
+ h = image->h;
+
+ /* Convert the image into an OpenGL texture */
+ cursor_texture = SDL_GL_LoadTexture(image, texcoord);
+
+ /* Make texture coordinates easy to understand */
+ texMinX = texcoord[0];
+ texMinY = texcoord[1];
+ texMaxX = texcoord[2];
+ texMaxY = texcoord[3];
+
+ /* We don't need the original image anymore */
+ SDL_FreeSurface(image);
+
+ /* Make sure that the texture conversion is okay */
+ if ( ! cursor_texture ) {
+ return;
+ }
+ }
+
+ /* Move the image around */
+ SDL_GetMouseState(&x, &y);
+ x -= w/2;
+ y -= h/2;
+
+ /* Show the image on the screen */
+ SDL_GL_Enter2DMode();
+ glBindTexture(GL_TEXTURE_2D, cursor_texture);
+ glBegin(GL_TRIANGLE_STRIP);
+ glTexCoord2f(texMinX, texMinY); glVertex2i(x, y );
+ glTexCoord2f(texMaxX, texMinY); glVertex2i(x+w, y );
+ glTexCoord2f(texMinX, texMaxY); glVertex2i(x, y+h);
+ glTexCoord2f(texMaxX, texMaxY); glVertex2i(x+w, y+h);
+ glEnd();
+ SDL_GL_Leave2DMode();
+}
+
+void DrawLogoTexture(void)
+{
+ static GLfloat texMinX, texMinY;
+ static GLfloat texMaxX, texMaxY;
+ static int x = 0;
+ static int y = 0;
+ static int w, h;
+ static int delta_x = 1;
+ static int delta_y = 1;
+
+ SDL_Surface *screen = SDL_GetVideoSurface();
+
+ if ( ! global_texture ) {
+ SDL_Surface *image;
+ GLfloat texcoord[4];
+
+ /* Load the image (could use SDL_image library here) */
+ image = SDL_LoadBMP(LOGO_FILE);
+ if ( image == NULL ) {
+ return;
+ }
+ w = image->w;
+ h = image->h;
+
+ /* Convert the image into an OpenGL texture */
+ global_texture = SDL_GL_LoadTexture(image, texcoord);
+
+ /* Make texture coordinates easy to understand */
+ texMinX = texcoord[0];
+ texMinY = texcoord[1];
+ texMaxX = texcoord[2];
+ texMaxY = texcoord[3];
+
+ /* We don't need the original image anymore */
+ SDL_FreeSurface(image);
+
+ /* Make sure that the texture conversion is okay */
+ if ( ! global_texture ) {
+ return;
+ }
+ }
+
+ /* Move the image around */
+ x += delta_x;
+ if ( x < 0 ) {
+ x = 0;
+ delta_x = -delta_x;
+ } else
+ if ( (x+w) > screen->w ) {
+ x = screen->w-w;
+ delta_x = -delta_x;
+ }
+ y += delta_y;
+ if ( y < 0 ) {
+ y = 0;
+ delta_y = -delta_y;
+ } else
+ if ( (y+h) > screen->h ) {
+ y = screen->h-h;
+ delta_y = -delta_y;
+ }
+
+ /* Show the image on the screen */
+ SDL_GL_Enter2DMode();
+ glBindTexture(GL_TEXTURE_2D, global_texture);
+ glBegin(GL_TRIANGLE_STRIP);
+ glTexCoord2f(texMinX, texMinY); glVertex2i(x, y );
+ glTexCoord2f(texMaxX, texMinY); glVertex2i(x+w, y );
+ glTexCoord2f(texMinX, texMaxY); glVertex2i(x, y+h);
+ glTexCoord2f(texMaxX, texMaxY); glVertex2i(x+w, y+h);
+ glEnd();
+ SDL_GL_Leave2DMode();
+}
+
+/* This code is deprecated, but available for speed comparisons */
+void DrawLogoBlit(void)
+{
+ static int x = 0;
+ static int y = 0;
+ static int w, h;
+ static int delta_x = 1;
+ static int delta_y = 1;
+
+ SDL_Rect dst;
+ SDL_Surface *screen = SDL_GetVideoSurface();
+
+ if ( global_image == NULL ) {
+ SDL_Surface *temp;
+
+ /* Load the image (could use SDL_image library here) */
+ temp = SDL_LoadBMP(LOGO_FILE);
+ if ( temp == NULL ) {
+ return;
+ }
+ w = temp->w;
+ h = temp->h;
+
+ /* Convert the image into the screen format */
+ global_image = SDL_CreateRGBSurface(
+ SDL_SWSURFACE,
+ w, h,
+ screen->format->BitsPerPixel,
+ screen->format->Rmask,
+ screen->format->Gmask,
+ screen->format->Bmask,
+ screen->format->Amask);
+ if ( global_image ) {
+ SDL_BlitSurface(temp, NULL, global_image, NULL);
+ }
+ SDL_FreeSurface(temp);
+
+ /* Make sure that the texture conversion is okay */
+ if ( ! global_image ) {
+ return;
+ }
+ }
+
+ /* Move the image around
+ Note that we do not clear the old position. This is because we
+ perform a glClear() which clears the framebuffer and then only
+ update the new area.
+ Note that you can also achieve interesting effects by modifying
+ the screen surface alpha channel. It's set to 255 by default..
+ */
+ x += delta_x;
+ if ( x < 0 ) {
+ x = 0;
+ delta_x = -delta_x;
+ } else
+ if ( (x+w) > screen->w ) {
+ x = screen->w-w;
+ delta_x = -delta_x;
+ }
+ y += delta_y;
+ if ( y < 0 ) {
+ y = 0;
+ delta_y = -delta_y;
+ } else
+ if ( (y+h) > screen->h ) {
+ y = screen->h-h;
+ delta_y = -delta_y;
+ }
+ dst.x = x;
+ dst.y = y;
+ dst.w = w;
+ dst.h = h;
+ SDL_BlitSurface(global_image, NULL, screen, &dst);
+
+ /* Show the image on the screen */
+ SDL_UpdateRects(screen, 1, &dst);
+}
+
+int RunGLTest( int argc, char* argv[],
+ int logo, int logocursor, int slowly, int bpp, float gamma, int noframe, int fsaa, int sync, int accel )
+{
+ int i;
+ int rgb_size[3];
+ int w = 640;
+ int h = 480;
+ int done = 0;
+ int frames;
+ Uint32 start_time, this_time;
+ float color[8][3]= {{ 1.0, 1.0, 0.0},
+ { 1.0, 0.0, 0.0},
+ { 0.0, 0.0, 0.0},
+ { 0.0, 1.0, 0.0},
+ { 0.0, 1.0, 1.0},
+ { 1.0, 1.0, 1.0},
+ { 1.0, 0.0, 1.0},
+ { 0.0, 0.0, 1.0}};
+ float cube[8][3]= {{ 0.5, 0.5, -0.5},
+ { 0.5, -0.5, -0.5},
+ {-0.5, -0.5, -0.5},
+ {-0.5, 0.5, -0.5},
+ {-0.5, 0.5, 0.5},
+ { 0.5, 0.5, 0.5},
+ { 0.5, -0.5, 0.5},
+ {-0.5, -0.5, 0.5}};
+ Uint32 video_flags;
+ int value;
+
+ if( SDL_Init( SDL_INIT_VIDEO ) < 0 ) {
+ fprintf(stderr,"Couldn't initialize SDL: %s\n",SDL_GetError());
+ exit( 1 );
+ }
+
+ /* See if we should detect the display depth */
+ if ( bpp == 0 ) {
+ if ( SDL_GetVideoInfo()->vfmt->BitsPerPixel <= 8 ) {
+ bpp = 8;
+ } else {
+ bpp = 16; /* More doesn't seem to work */
+ }
+ }
+
+ /* Set the flags we want to use for setting the video mode */
+ if ( logo && USE_DEPRECATED_OPENGLBLIT ) {
+ video_flags = SDL_OPENGLBLIT;
+ } else {
+ video_flags = SDL_OPENGL;
+ }
+ for ( i=1; argv[i]; ++i ) {
+ if ( strcmp(argv[i], "-fullscreen") == 0 ) {
+ video_flags |= SDL_FULLSCREEN;
+ }
+ }
+
+ if (noframe) {
+ video_flags |= SDL_NOFRAME;
+ }
+
+ /* Initialize the display */
+ switch (bpp) {
+ case 8:
+ rgb_size[0] = 3;
+ rgb_size[1] = 3;
+ rgb_size[2] = 2;
+ break;
+ case 15:
+ case 16:
+ rgb_size[0] = 5;
+ rgb_size[1] = 5;
+ rgb_size[2] = 5;
+ break;
+ default:
+ rgb_size[0] = 8;
+ rgb_size[1] = 8;
+ rgb_size[2] = 8;
+ break;
+ }
+ SDL_GL_SetAttribute( SDL_GL_RED_SIZE, rgb_size[0] );
+ SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, rgb_size[1] );
+ SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, rgb_size[2] );
+ SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
+ SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
+ if ( fsaa ) {
+ SDL_GL_SetAttribute( SDL_GL_MULTISAMPLEBUFFERS, 1 );
+ SDL_GL_SetAttribute( SDL_GL_MULTISAMPLESAMPLES, fsaa );
+ }
+ if ( accel ) {
+ SDL_GL_SetAttribute( SDL_GL_ACCELERATED_VISUAL, 1 );
+ }
+ if ( sync ) {
+ SDL_GL_SetAttribute( SDL_GL_SWAP_CONTROL, 1 );
+ } else {
+ SDL_GL_SetAttribute( SDL_GL_SWAP_CONTROL, 0 );
+ }
+ if ( SDL_SetVideoMode( w, h, bpp, video_flags ) == NULL ) {
+ fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError());
+ SDL_Quit();
+ exit(1);
+ }
+
+ printf("Screen BPP: %d\n", SDL_GetVideoSurface()->format->BitsPerPixel);
+ printf("\n");
+ 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");
+
+ SDL_GL_GetAttribute( SDL_GL_RED_SIZE, &value );
+ printf( "SDL_GL_RED_SIZE: requested %d, got %d\n", rgb_size[0],value);
+ SDL_GL_GetAttribute( SDL_GL_GREEN_SIZE, &value );
+ printf( "SDL_GL_GREEN_SIZE: requested %d, got %d\n", rgb_size[1],value);
+ SDL_GL_GetAttribute( SDL_GL_BLUE_SIZE, &value );
+ printf( "SDL_GL_BLUE_SIZE: requested %d, got %d\n", rgb_size[2],value);
+ SDL_GL_GetAttribute( SDL_GL_DEPTH_SIZE, &value );
+ printf( "SDL_GL_DEPTH_SIZE: requested %d, got %d\n", bpp, value );
+ SDL_GL_GetAttribute( SDL_GL_DOUBLEBUFFER, &value );
+ printf( "SDL_GL_DOUBLEBUFFER: requested 1, got %d\n", value );
+ if ( fsaa ) {
+ SDL_GL_GetAttribute( SDL_GL_MULTISAMPLEBUFFERS, &value );
+ printf("SDL_GL_MULTISAMPLEBUFFERS: requested 1, got %d\n", value );
+ SDL_GL_GetAttribute( SDL_GL_MULTISAMPLESAMPLES, &value );
+ printf("SDL_GL_MULTISAMPLESAMPLES: requested %d, got %d\n", fsaa, value );
+ }
+ if ( accel ) {
+ SDL_GL_GetAttribute( SDL_GL_ACCELERATED_VISUAL, &value );
+ printf( "SDL_GL_ACCELERATED_VISUAL: requested 1, got %d\n", value );
+ }
+ if ( sync ) {
+ SDL_GL_GetAttribute( SDL_GL_SWAP_CONTROL, &value );
+ printf( "SDL_GL_SWAP_CONTROL: requested 1, got %d\n", value );
+ }
+
+ /* Set the window manager title bar */
+ SDL_WM_SetCaption( "SDL GL test", "testgl" );
+
+ /* Set the gamma for the window */
+ if ( gamma != 0.0 ) {
+ SDL_SetGamma(gamma, gamma, gamma);
+ }
+
+ glViewport( 0, 0, w, h );
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity( );
+
+ glOrtho( -2.0, 2.0, -2.0, 2.0, -20.0, 20.0 );
+
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity( );
+
+ glEnable(GL_DEPTH_TEST);
+
+ glDepthFunc(GL_LESS);
+
+ glShadeModel(GL_SMOOTH);
+
+ /* Loop until done. */
+ start_time = SDL_GetTicks();
+ frames = 0;
+ while( !done ) {
+ GLenum gl_error;
+ char* sdl_error;
+ SDL_Event event;
+
+ /* Do our drawing, too. */
+ glClearColor( 0.0, 0.0, 0.0, 1.0 );
+ glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glBegin( GL_QUADS );
+
+#ifdef SHADED_CUBE
+ glColor3fv(color[0]);
+ glVertex3fv(cube[0]);
+ glColor3fv(color[1]);
+ glVertex3fv(cube[1]);
+ glColor3fv(color[2]);
+ glVertex3fv(cube[2]);
+ glColor3fv(color[3]);
+ glVertex3fv(cube[3]);
+
+ glColor3fv(color[3]);
+ glVertex3fv(cube[3]);
+ glColor3fv(color[4]);
+ glVertex3fv(cube[4]);
+ glColor3fv(color[7]);
+ glVertex3fv(cube[7]);
+ glColor3fv(color[2]);
+ glVertex3fv(cube[2]);
+
+ glColor3fv(color[0]);
+ glVertex3fv(cube[0]);
+ glColor3fv(color[5]);
+ glVertex3fv(cube[5]);
+ glColor3fv(color[6]);
+ glVertex3fv(cube[6]);
+ glColor3fv(color[1]);
+ glVertex3fv(cube[1]);
+
+ glColor3fv(color[5]);
+ glVertex3fv(cube[5]);
+ glColor3fv(color[4]);
+ glVertex3fv(cube[4]);
+ glColor3fv(color[7]);
+ glVertex3fv(cube[7]);
+ glColor3fv(color[6]);
+ glVertex3fv(cube[6]);
+
+ glColor3fv(color[5]);
+ glVertex3fv(cube[5]);
+ glColor3fv(color[0]);
+ glVertex3fv(cube[0]);
+ glColor3fv(color[3]);
+ glVertex3fv(cube[3]);
+ glColor3fv(color[4]);
+ glVertex3fv(cube[4]);
+
+ glColor3fv(color[6]);
+ glVertex3fv(cube[6]);
+ glColor3fv(color[1]);
+ glVertex3fv(cube[1]);
+ glColor3fv(color[2]);
+ glVertex3fv(cube[2]);
+ glColor3fv(color[7]);
+ glVertex3fv(cube[7]);
+#else /* flat cube */
+ glColor3f(1.0, 0.0, 0.0);
+ glVertex3fv(cube[0]);
+ glVertex3fv(cube[1]);
+ glVertex3fv(cube[2]);
+ glVertex3fv(cube[3]);
+
+ glColor3f(0.0, 1.0, 0.0);
+ glVertex3fv(cube[3]);
+ glVertex3fv(cube[4]);
+ glVertex3fv(cube[7]);
+ glVertex3fv(cube[2]);
+
+ glColor3f(0.0, 0.0, 1.0);
+ glVertex3fv(cube[0]);
+ glVertex3fv(cube[5]);
+ glVertex3fv(cube[6]);
+ glVertex3fv(cube[1]);
+
+ glColor3f(0.0, 1.0, 1.0);
+ glVertex3fv(cube[5]);
+ glVertex3fv(cube[4]);
+ glVertex3fv(cube[7]);
+ glVertex3fv(cube[6]);
+
+ glColor3f(1.0, 1.0, 0.0);
+ glVertex3fv(cube[5]);
+ glVertex3fv(cube[0]);
+ glVertex3fv(cube[3]);
+ glVertex3fv(cube[4]);
+
+ glColor3f(1.0, 0.0, 1.0);
+ glVertex3fv(cube[6]);
+ glVertex3fv(cube[1]);
+ glVertex3fv(cube[2]);
+ glVertex3fv(cube[7]);
+#endif /* SHADED_CUBE */
+
+ glEnd( );
+
+ glMatrixMode(GL_MODELVIEW);
+ glRotatef(5.0, 1.0, 1.0, 1.0);
+
+ /* Draw 2D logo onto the 3D display */
+ if ( logo ) {
+ if ( USE_DEPRECATED_OPENGLBLIT ) {
+ DrawLogoBlit();
+ } else {
+ DrawLogoTexture();
+ }
+ }
+ if ( logocursor ) {
+ DrawLogoCursor();
+ }
+
+ SDL_GL_SwapBuffers( );
+
+ /* Check for error conditions. */
+ gl_error = glGetError( );
+
+ if( gl_error != GL_NO_ERROR ) {
+ fprintf( stderr, "testgl: OpenGL error: %d\n", gl_error );
+ }
+
+ sdl_error = SDL_GetError( );
+
+ if( sdl_error[0] != '\0' ) {
+ fprintf(stderr, "testgl: SDL error '%s'\n", sdl_error);
+ SDL_ClearError();
+ }
+
+ /* Allow the user to see what's happening */
+ if ( slowly ) {
+ SDL_Delay( 20 );
+ }
+
+ /* Check if there's a pending event. */
+ while( SDL_PollEvent( &event ) ) {
+ done = HandleEvent(&event);
+ }
+ ++frames;
+ }
+
+ /* Print out the frames per second */
+ this_time = SDL_GetTicks();
+ if ( this_time != start_time ) {
+ printf("%2.2f FPS\n",
+ ((float)frames/(this_time-start_time))*1000.0);
+ }
+
+ if ( global_image ) {
+ SDL_FreeSurface(global_image);
+ global_image = NULL;
+ }
+ if ( global_texture ) {
+ glDeleteTextures( 1, &global_texture );
+ global_texture = 0;
+ }
+ if ( cursor_texture ) {
+ glDeleteTextures( 1, &cursor_texture );
+ cursor_texture = 0;
+ }
+
+ /* Destroy our GL context, etc. */
+ SDL_Quit( );
+ return(0);
+}
+
+int main(int argc, char *argv[])
+{
+ int i, logo, logocursor = 0;
+ int numtests;
+ int bpp = 0;
+ int slowly;
+ float gamma = 0.0;
+ int noframe = 0;
+ int fsaa = 0;
+ int accel = 0;
+ int sync = 0;
+
+ logo = 0;
+ slowly = 0;
+ numtests = 1;
+ for ( i=1; argv[i]; ++i ) {
+ if ( strcmp(argv[i], "-twice") == 0 ) {
+ ++numtests;
+ }
+ if ( strcmp(argv[i], "-logo") == 0 ) {
+ logo = 1;
+ USE_DEPRECATED_OPENGLBLIT = SDL_FALSE;
+ }
+ if ( strcmp(argv[i], "-logoblit") == 0 ) {
+ logo = 1;
+ USE_DEPRECATED_OPENGLBLIT = SDL_TRUE;
+ }
+ if ( strcmp(argv[i], "-logocursor") == 0 ) {
+ logocursor = 1;
+ }
+ if ( strcmp(argv[i], "-slow") == 0 ) {
+ slowly = 1;
+ }
+ if ( strcmp(argv[i], "-bpp") == 0 ) {
+ bpp = atoi(argv[++i]);
+ }
+ if ( strcmp(argv[i], "-gamma") == 0 ) {
+ gamma = (float)atof(argv[++i]);
+ }
+ if ( strcmp(argv[i], "-noframe") == 0 ) {
+ noframe = 1;
+ }
+ if ( strcmp(argv[i], "-fsaa") == 0 ) {
+ ++fsaa;
+ }
+ if ( strcmp(argv[i], "-accel") == 0 ) {
+ ++accel;
+ }
+ if ( strcmp(argv[i], "-sync") == 0 ) {
+ ++sync;
+ }
+ if ( strncmp(argv[i], "-h", 2) == 0 ) {
+ printf(
+"Usage: %s [-twice] [-logo] [-logocursor] [-slow] [-bpp n] [-gamma n] [-noframe] [-fsaa] [-accel] [-sync] [-fullscreen]\n",
+ argv[0]);
+ exit(0);
+ }
+ }
+ for ( i=0; i<numtests; ++i ) {
+ RunGLTest(argc, argv, logo, logocursor, slowly, bpp, gamma, noframe, fsaa, sync, accel);
+ }
+ return 0;
+}
+
+#else /* HAVE_OPENGL */
+
+int main(int argc, char *argv[])
+{
+ printf("No OpenGL support on this system\n");
+ return 1;
+}
+
+#endif /* HAVE_OPENGL */
diff --git a/distrib/sdl-1.2.15/test/testhread.c b/distrib/sdl-1.2.15/test/testhread.c
new file mode 100644
index 0000000..f87f374
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testhread.c
@@ -0,0 +1,82 @@
+
+/* Simple test of the SDL threading code */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+
+#include "SDL.h"
+#include "SDL_thread.h"
+
+static int alive = 0;
+
+/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
+static void quit(int rc)
+{
+ SDL_Quit();
+ exit(rc);
+}
+
+int SDLCALL ThreadFunc(void *data)
+{
+ printf("Started thread %s: My thread id is %u\n",
+ (char *)data, SDL_ThreadID());
+ while ( alive ) {
+ printf("Thread '%s' is alive!\n", (char *)data);
+ SDL_Delay(1*1000);
+ }
+ printf("Thread '%s' exiting!\n", (char *)data);
+ return(0);
+}
+
+static void killed(int sig)
+{
+ printf("Killed with SIGTERM, waiting 5 seconds to exit\n");
+ SDL_Delay(5*1000);
+ alive = 0;
+ quit(0);
+}
+
+int main(int argc, char *argv[])
+{
+ SDL_Thread *thread;
+
+ /* Load the SDL library */
+ if ( SDL_Init(0) < 0 ) {
+ fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
+ return(1);
+ }
+
+ alive = 1;
+ thread = SDL_CreateThread(ThreadFunc, "#1");
+ if ( thread == NULL ) {
+ fprintf(stderr, "Couldn't create thread: %s\n", SDL_GetError());
+ quit(1);
+ }
+ SDL_Delay(5*1000);
+ printf("Waiting for thread #1\n");
+ alive = 0;
+ SDL_WaitThread(thread, NULL);
+
+ alive = 1;
+ thread = SDL_CreateThread(ThreadFunc, "#2");
+ if ( thread == NULL ) {
+ fprintf(stderr, "Couldn't create thread: %s\n", SDL_GetError());
+ quit(1);
+ }
+ SDL_Delay(5*1000);
+ printf("Killing thread #2\n");
+ SDL_KillThread(thread);
+
+ alive = 1;
+ signal(SIGTERM, killed);
+ thread = SDL_CreateThread(ThreadFunc, "#3");
+ if ( thread == NULL ) {
+ fprintf(stderr, "Couldn't create thread: %s\n", SDL_GetError());
+ quit(1);
+ }
+ raise(SIGTERM);
+
+ SDL_Quit(); /* Never reached */
+ return(0); /* Never reached */
+}
diff --git a/distrib/sdl-1.2.15/test/testiconv.c b/distrib/sdl-1.2.15/test/testiconv.c
new file mode 100644
index 0000000..53415d0
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testiconv.c
@@ -0,0 +1,73 @@
+
+#include <stdio.h>
+
+#include "SDL.h"
+
+static size_t widelen(char *data)
+{
+ size_t len = 0;
+ Uint32 *p = (Uint32 *)data;
+ while(*p++) {
+ ++len;
+ }
+ return len;
+}
+
+int main(int argc, char *argv[])
+{
+ const char * formats[] = {
+ "UTF8",
+ "UTF-8",
+ "UTF16BE",
+ "UTF-16BE",
+ "UTF16LE",
+ "UTF-16LE",
+ "UTF32BE",
+ "UTF-32BE",
+ "UTF32LE",
+ "UTF-32LE",
+ "UCS4",
+ "UCS-4",
+ };
+ char buffer[BUFSIZ];
+ char *ucs4;
+ char *test[2];
+ int i, index = 0;
+ FILE *file;
+ int errors = 0;
+
+ if ( !argv[1] ) {
+ argv[1] = "utf8.txt";
+ }
+ file = fopen(argv[1], "rb");
+ if ( !file ) {
+ fprintf(stderr, "Unable to open %s\n", argv[1]);
+ return (1);
+ }
+
+ while ( fgets(buffer, sizeof(buffer), file) ) {
+ /* Convert to UCS-4 */
+ size_t len;
+ ucs4 = SDL_iconv_string("UCS-4", "UTF-8", buffer, SDL_strlen(buffer)+1);
+ len = (widelen(ucs4)+1)*4;
+ for ( i = 0; i < SDL_arraysize(formats); ++i ) {
+ test[0] = SDL_iconv_string(formats[i], "UCS-4", ucs4, len);
+ test[1] = SDL_iconv_string("UCS-4", formats[i], test[0], len);
+ if ( !test[1] || SDL_memcmp(test[1], ucs4, len) != 0 ) {
+ fprintf(stderr, "FAIL: %s\n", formats[i]);
+ ++errors;
+ }
+ if ( test[0] ) {
+ SDL_free(test[0]);
+ }
+ if ( test[1] ) {
+ SDL_free(test[1]);
+ }
+ }
+ test[0] = SDL_iconv_string("UTF-8", "UCS-4", ucs4, len);
+ SDL_free(ucs4);
+ fputs(test[0], stdout);
+ SDL_free(test[0]);
+ }
+ return (errors ? errors + 1 : 0);
+}
diff --git a/distrib/sdl-1.2.15/test/testjoystick.c b/distrib/sdl-1.2.15/test/testjoystick.c
new file mode 100644
index 0000000..1cd8234
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testjoystick.c
@@ -0,0 +1,188 @@
+
+/* Simple program to test the SDL joystick routines */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "SDL.h"
+
+#define SCREEN_WIDTH 640
+#define SCREEN_HEIGHT 480
+
+void WatchJoystick(SDL_Joystick *joystick)
+{
+ SDL_Surface *screen;
+ const char *name;
+ int i, done;
+ SDL_Event event;
+ int x, y, draw;
+ SDL_Rect axis_area[2];
+
+ /* Set a video mode to display joystick axis position */
+ screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, 16, 0);
+ if ( screen == NULL ) {
+ fprintf(stderr, "Couldn't set video mode: %s\n",SDL_GetError());
+ return;
+ }
+
+ /* Print info about the joystick we are watching */
+ name = SDL_JoystickName(SDL_JoystickIndex(joystick));
+ printf("Watching joystick %d: (%s)\n", SDL_JoystickIndex(joystick),
+ name ? name : "Unknown Joystick");
+ printf("Joystick has %d axes, %d hats, %d balls, and %d buttons\n",
+ SDL_JoystickNumAxes(joystick), SDL_JoystickNumHats(joystick),
+ SDL_JoystickNumBalls(joystick),SDL_JoystickNumButtons(joystick));
+
+ /* Initialize drawing rectangles */
+ memset(axis_area, 0, (sizeof axis_area));
+ draw = 0;
+
+ /* Loop, getting joystick events! */
+ done = 0;
+ while ( ! done ) {
+ while ( SDL_PollEvent(&event) ) {
+ switch (event.type) {
+ case SDL_JOYAXISMOTION:
+ printf("Joystick %d axis %d value: %d\n",
+ event.jaxis.which,
+ event.jaxis.axis,
+ event.jaxis.value);
+ break;
+ case SDL_JOYHATMOTION:
+ printf("Joystick %d hat %d value:",
+ event.jhat.which,
+ event.jhat.hat);
+ if ( event.jhat.value == SDL_HAT_CENTERED )
+ printf(" centered");
+ if ( event.jhat.value & SDL_HAT_UP )
+ printf(" up");
+ if ( event.jhat.value & SDL_HAT_RIGHT )
+ printf(" right");
+ if ( event.jhat.value & SDL_HAT_DOWN )
+ printf(" down");
+ if ( event.jhat.value & SDL_HAT_LEFT )
+ printf(" left");
+ printf("\n");
+ break;
+ case SDL_JOYBALLMOTION:
+ printf("Joystick %d ball %d delta: (%d,%d)\n",
+ event.jball.which,
+ event.jball.ball,
+ event.jball.xrel,
+ event.jball.yrel);
+ break;
+ case SDL_JOYBUTTONDOWN:
+ printf("Joystick %d button %d down\n",
+ event.jbutton.which,
+ event.jbutton.button);
+ break;
+ case SDL_JOYBUTTONUP:
+ printf("Joystick %d button %d up\n",
+ event.jbutton.which,
+ event.jbutton.button);
+ break;
+ case SDL_KEYDOWN:
+ if ( event.key.keysym.sym != SDLK_ESCAPE ) {
+ break;
+ }
+ /* Fall through to signal quit */
+ case SDL_QUIT:
+ done = 1;
+ break;
+ default:
+ break;
+ }
+ }
+ /* Update visual joystick state */
+ for ( i=0; i<SDL_JoystickNumButtons(joystick); ++i ) {
+ SDL_Rect area;
+
+ area.x = i*34;
+ area.y = SCREEN_HEIGHT-34;
+ area.w = 32;
+ area.h = 32;
+ if (SDL_JoystickGetButton(joystick, i) == SDL_PRESSED) {
+ SDL_FillRect(screen, &area, 0xFFFF);
+ } else {
+ SDL_FillRect(screen, &area, 0x0000);
+ }
+ SDL_UpdateRects(screen, 1, &area);
+ }
+
+ /* Erase previous axes */
+ SDL_FillRect(screen, &axis_area[draw], 0x0000);
+
+ /* Draw the X/Y axis */
+ draw = !draw;
+ x = (((int)SDL_JoystickGetAxis(joystick, 0))+32768);
+ x *= SCREEN_WIDTH;
+ x /= 65535;
+ if ( x < 0 ) {
+ x = 0;
+ } else
+ if ( x > (SCREEN_WIDTH-16) ) {
+ x = SCREEN_WIDTH-16;
+ }
+ y = (((int)SDL_JoystickGetAxis(joystick, 1))+32768);
+ y *= SCREEN_HEIGHT;
+ y /= 65535;
+ if ( y < 0 ) {
+ y = 0;
+ } else
+ if ( y > (SCREEN_HEIGHT-16) ) {
+ y = SCREEN_HEIGHT-16;
+ }
+ axis_area[draw].x = (Sint16)x;
+ axis_area[draw].y = (Sint16)y;
+ axis_area[draw].w = 16;
+ axis_area[draw].h = 16;
+ SDL_FillRect(screen, &axis_area[draw], 0xFFFF);
+
+ SDL_UpdateRects(screen, 2, axis_area);
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ const char *name;
+ int i;
+ SDL_Joystick *joystick;
+
+ /* Initialize SDL (Note: video is required to start event loop) */
+ if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK) < 0 ) {
+ fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
+ exit(1);
+ }
+
+ /* Print information about the joysticks */
+ printf("There are %d joysticks attached\n", SDL_NumJoysticks());
+ for ( i=0; i<SDL_NumJoysticks(); ++i ) {
+ name = SDL_JoystickName(i);
+ printf("Joystick %d: %s\n",i,name ? name : "Unknown Joystick");
+ joystick = SDL_JoystickOpen(i);
+ if (joystick == NULL) {
+ fprintf(stderr, "SDL_JoystickOpen(%d) failed: %s\n", i, SDL_GetError());
+ } else {
+ printf(" axes: %d\n", SDL_JoystickNumAxes(joystick));
+ printf(" balls: %d\n", SDL_JoystickNumBalls(joystick));
+ printf(" hats: %d\n", SDL_JoystickNumHats(joystick));
+ printf(" buttons: %d\n", SDL_JoystickNumButtons(joystick));
+ SDL_JoystickClose(joystick);
+ }
+ }
+
+ if ( argv[1] ) {
+ joystick = SDL_JoystickOpen(atoi(argv[1]));
+ if ( joystick == NULL ) {
+ printf("Couldn't open joystick %d: %s\n", atoi(argv[1]),
+ SDL_GetError());
+ } else {
+ WatchJoystick(joystick);
+ SDL_JoystickClose(joystick);
+ }
+ }
+ SDL_QuitSubSystem(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK);
+
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/test/testkeys.c b/distrib/sdl-1.2.15/test/testkeys.c
new file mode 100644
index 0000000..e320c6d
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testkeys.c
@@ -0,0 +1,25 @@
+
+/* Print out all the keysyms we have, just to verify them */
+
+#include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "SDL.h"
+
+int main(int argc, char *argv[])
+{
+ SDLKey key;
+
+ if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
+ fprintf(stderr, "Couldn't initialize SDL: %s\n",
+ SDL_GetError());
+ exit(1);
+ }
+ for ( key=SDLK_FIRST; key<SDLK_LAST; ++key ) {
+ printf("Key #%d, \"%s\"\n", key, SDL_GetKeyName(key));
+ }
+ SDL_Quit();
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/test/testloadso.c b/distrib/sdl-1.2.15/test/testloadso.c
new file mode 100644
index 0000000..39c14c6
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testloadso.c
@@ -0,0 +1,71 @@
+
+/* Test program to test dynamic loading with the loadso subsystem.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "SDL.h"
+
+typedef int (*fntype)(const char *);
+
+int main(int argc, char *argv[])
+{
+ int retval = 0;
+ int hello = 0;
+ const char *libname = NULL;
+ const char *symname = NULL;
+ void *lib = NULL;
+ fntype fn = NULL;
+
+ if (argc != 3) {
+ const char *app = argv[0];
+ fprintf(stderr, "USAGE: %s <library> <functionname>\n", app);
+ fprintf(stderr, " %s --hello <lib with puts()>\n", app);
+ return 1;
+ }
+
+ /* Initialize SDL */
+ if ( SDL_Init(0) < 0 ) {
+ fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
+ return 2;
+ }
+
+ if (strcmp(argv[1], "--hello") == 0) {
+ hello = 1;
+ libname = argv[2];
+ symname = "puts";
+ } else {
+ libname = argv[1];
+ symname = argv[2];
+ }
+
+ lib = SDL_LoadObject(libname);
+ if (lib == NULL) {
+ fprintf(stderr, "SDL_LoadObject('%s') failed: %s\n",
+ libname, SDL_GetError());
+ retval = 3;
+ } else {
+ fn = (fntype) SDL_LoadFunction(lib, symname);
+ if (fn == NULL) {
+ fprintf(stderr, "SDL_LoadFunction('%s') failed: %s\n",
+ symname, SDL_GetError());
+ retval = 4;
+ } else {
+ printf("Found %s in %s at %p\n", symname, libname, fn);
+ if (hello) {
+ printf("Calling function...\n");
+ fflush(stdout);
+ fn(" HELLO, WORLD!\n");
+ printf("...apparently, we survived. :)\n");
+ printf("Unloading library...\n");
+ fflush(stdout);
+ }
+ }
+ SDL_UnloadObject(lib);
+ }
+ SDL_Quit();
+ return(0);
+}
+
+
diff --git a/distrib/sdl-1.2.15/test/testlock.c b/distrib/sdl-1.2.15/test/testlock.c
new file mode 100644
index 0000000..bda4b55
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testlock.c
@@ -0,0 +1,102 @@
+
+/* Test the thread and mutex locking functions
+ Also exercises the system's signal/thread interaction
+*/
+
+#include <signal.h>
+#include <stdio.h>
+
+#include "SDL.h"
+#include "SDL_mutex.h"
+#include "SDL_thread.h"
+
+static SDL_mutex *mutex = NULL;
+static Uint32 mainthread;
+static SDL_Thread *threads[6];
+static volatile int doterminate = 0;
+
+/*
+ * SDL_Quit() shouldn't be used with atexit() directly because
+ * calling conventions may differ...
+ */
+static void SDL_Quit_Wrapper(void)
+{
+ SDL_Quit();
+}
+
+void printid(void)
+{
+ printf("Process %u: exiting\n", SDL_ThreadID());
+}
+
+void terminate(int sig)
+{
+ signal(SIGINT, terminate);
+ doterminate = 1;
+}
+void closemutex(int sig)
+{
+ Uint32 id = SDL_ThreadID();
+ int i;
+ printf("Process %u: Cleaning up...\n", id == mainthread ? 0 : id);
+ for ( i=0; i<6; ++i )
+ SDL_KillThread(threads[i]);
+ SDL_DestroyMutex(mutex);
+ exit(sig);
+}
+int SDLCALL Run(void *data)
+{
+ if ( SDL_ThreadID() == mainthread )
+ signal(SIGTERM, closemutex);
+ while ( 1 ) {
+ printf("Process %u ready to work\n", SDL_ThreadID());
+ if ( SDL_mutexP(mutex) < 0 ) {
+ fprintf(stderr, "Couldn't lock mutex: %s", SDL_GetError());
+ exit(1);
+ }
+ printf("Process %u, working!\n", SDL_ThreadID());
+ SDL_Delay(1*1000);
+ printf("Process %u, done!\n", SDL_ThreadID());
+ if ( SDL_mutexV(mutex) < 0 ) {
+ fprintf(stderr, "Couldn't unlock mutex: %s", SDL_GetError());
+ exit(1);
+ }
+ /* If this sleep isn't done, then threads may starve */
+ SDL_Delay(10);
+ if (SDL_ThreadID() == mainthread && doterminate) {
+ printf("Process %u: raising SIGTERM\n", SDL_ThreadID());
+ raise(SIGTERM);
+ }
+ }
+ return(0);
+}
+
+int main(int argc, char *argv[])
+{
+ int i;
+ int maxproc = 6;
+
+ /* Load the SDL library */
+ if ( SDL_Init(0) < 0 ) {
+ fprintf(stderr, "%s\n", SDL_GetError());
+ exit(1);
+ }
+ atexit(SDL_Quit_Wrapper);
+
+ if ( (mutex=SDL_CreateMutex()) == NULL ) {
+ fprintf(stderr, "Couldn't create mutex: %s\n", SDL_GetError());
+ exit(1);
+ }
+
+ mainthread = SDL_ThreadID();
+ printf("Main thread: %u\n", mainthread);
+ atexit(printid);
+ for ( i=0; i<maxproc; ++i ) {
+ if ( (threads[i]=SDL_CreateThread(Run, NULL)) == NULL )
+ fprintf(stderr, "Couldn't create thread!\n");
+ }
+ signal(SIGINT, terminate);
+ Run(NULL);
+
+ return(0); /* Never reached */
+}
diff --git a/distrib/sdl-1.2.15/test/testoverlay.c b/distrib/sdl-1.2.15/test/testoverlay.c
new file mode 100644
index 0000000..da53f9e
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testoverlay.c
@@ -0,0 +1,594 @@
+
+/* Bring up a window and play with it */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#define BENCHMARK_SDL
+
+#define NOTICE(X) printf("%s", X);
+
+#define WINDOW_WIDTH 640
+#define WINDOW_HEIGHT 480
+
+#include "SDL.h"
+
+SDL_Surface *screen, *pic;
+SDL_Overlay *overlay;
+int scale;
+int monochrome;
+int luminance;
+int w, h;
+
+/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
+static void quit(int rc)
+{
+ SDL_Quit();
+ exit(rc);
+}
+
+/* NOTE: These RGB conversion functions are not intended for speed,
+ only as examples.
+*/
+
+void RGBtoYUV(Uint8 *rgb, int *yuv, int monochrome, int luminance)
+{
+ if (monochrome)
+ {
+#if 1 /* these are the two formulas that I found on the FourCC site... */
+ yuv[0] = 0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2];
+ yuv[1] = 128;
+ yuv[2] = 128;
+#else
+ yuv[0] = (0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16;
+ yuv[1] = 128;
+ yuv[2] = 128;
+#endif
+ }
+ else
+ {
+#if 1 /* these are the two formulas that I found on the FourCC site... */
+ yuv[0] = 0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2];
+ yuv[1] = (rgb[2]-yuv[0])*0.565 + 128;
+ yuv[2] = (rgb[0]-yuv[0])*0.713 + 128;
+#else
+ yuv[0] = (0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16;
+ yuv[1] = 128 - (0.148 * rgb[0]) - (0.291 * rgb[1]) + (0.439 * rgb[2]);
+ yuv[2] = 128 + (0.439 * rgb[0]) - (0.368 * rgb[1]) - (0.071 * rgb[2]);
+#endif
+ }
+
+ if (luminance!=100)
+ {
+ yuv[0]=yuv[0]*luminance/100;
+ if (yuv[0]>255)
+ yuv[0]=255;
+ }
+
+ /* clamp values...if you need to, we don't seem to have a need */
+ /*
+ for(i=0;i<3;i++)
+ {
+ if(yuv[i]<0)
+ yuv[i]=0;
+ if(yuv[i]>255)
+ yuv[i]=255;
+ }
+ */
+}
+
+void ConvertRGBtoYV12(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);
+
+ /* Black initialization */
+ /*
+ memset(o->pixels[0],0,o->pitches[0]*o->h);
+ memset(o->pixels[1],128,o->pitches[1]*((o->h+1)/2));
+ memset(o->pixels[2],128,o->pitches[2]*((o->h+1)/2));
+ */
+
+ /* 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[2];
+ *(op[2]++)=yuv[1];
+ }
+ p+=s->format->BytesPerPixel;
+ }
+ }
+
+ SDL_UnlockYUVOverlay(o);
+ SDL_UnlockSurface(s);
+}
+
+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);
+
+ /* Black initialization */
+ /*
+ memset(o->pixels[0],0,o->pitches[0]*o->h);
+ memset(o->pixels[1],128,o->pitches[1]*((o->h+1)/2));
+ memset(o->pixels[2],128,o->pitches[2]*((o->h+1)/2));
+ */
+
+ /* 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);
+}
+
+void Draw()
+{
+ SDL_Rect rect;
+ int i;
+ int disp;
+
+ if(!scale)
+ {
+ rect.w=overlay->w;
+ rect.h=overlay->h;
+ for(i=0; i<h-rect.h && i<w-rect.w; i++)
+ {
+ rect.x=i;
+ rect.y=i;
+ SDL_DisplayYUVOverlay(overlay,&rect);
+ }
+ }
+ else
+ {
+ rect.w=overlay->w/2;
+ rect.h=overlay->h/2;
+ rect.x=(w-rect.w)/2;
+ rect.y=(h-rect.h)/2;
+ disp=rect.y-1;
+ for(i=0; i<disp; i++)
+ {
+ rect.w+=2;
+ rect.h+=2;
+ rect.x--;
+ rect.y--;
+ SDL_DisplayYUVOverlay(overlay,&rect);
+ }
+ }
+ printf("Displayed %d times.\n",i);
+}
+
+static void PrintUsage(char *argv0)
+{
+ fprintf(stderr, "Usage: %s [arg] [arg] [arg] ...\n", argv0);
+ fprintf(stderr, "Where 'arg' is one of:\n");
+ fprintf(stderr, " -delay <seconds>\n");
+ fprintf(stderr, " -width <pixels>\n");
+ fprintf(stderr, " -height <pixels>\n");
+ fprintf(stderr, " -bpp <bits>\n");
+ fprintf(stderr, " -format <fmt> (one of the: YV12, IYUV, YUY2, UYVY, YVYU)\n");
+ fprintf(stderr, " -hw\n");
+ fprintf(stderr, " -flip\n");
+ fprintf(stderr, " -scale (test scaling features, from 50%% upto window size)\n");
+ fprintf(stderr, " -mono (use monochromatic RGB2YUV conversion)\n");
+ fprintf(stderr, " -lum <perc> (use luminance correction during RGB2YUV conversion,\n");
+ fprintf(stderr, " from 0%% to unlimited, normal is 100%%)\n");
+ fprintf(stderr, " -help (shows this help)\n");
+ fprintf(stderr, " -fullscreen (test overlay in fullscreen mode)\n");
+}
+
+int main(int argc, char **argv)
+{
+ char *argv0 = argv[0];
+ int flip;
+ int delay;
+ int desired_bpp;
+ Uint32 video_flags, overlay_format;
+ char *bmpfile;
+#ifdef BENCHMARK_SDL
+ Uint32 then, now;
+#endif
+ int i;
+
+ /* Set default options and check command-line */
+ flip = 0;
+ scale=0;
+ monochrome=0;
+ luminance=100;
+ delay = 1;
+ w = WINDOW_WIDTH;
+ h = WINDOW_HEIGHT;
+ desired_bpp = 0;
+ video_flags = 0;
+ overlay_format = SDL_YV12_OVERLAY;
+
+ while ( argc > 1 ) {
+ if ( strcmp(argv[1], "-delay") == 0 ) {
+ if ( argv[2] ) {
+ delay = atoi(argv[2]);
+ argv += 2;
+ argc -= 2;
+ } else {
+ fprintf(stderr,
+ "The -delay option requires an argument\n");
+ return(1);
+ }
+ } else
+ if ( strcmp(argv[1], "-width") == 0 ) {
+ if ( argv[2] && ((w = atoi(argv[2])) > 0) ) {
+ argv += 2;
+ argc -= 2;
+ } else {
+ fprintf(stderr,
+ "The -width option requires an argument\n");
+ return(1);
+ }
+ } else
+ if ( strcmp(argv[1], "-height") == 0 ) {
+ if ( argv[2] && ((h = atoi(argv[2])) > 0) ) {
+ argv += 2;
+ argc -= 2;
+ } else {
+ fprintf(stderr,
+ "The -height option requires an argument\n");
+ return(1);
+ }
+ } else
+ if ( strcmp(argv[1], "-bpp") == 0 ) {
+ if ( argv[2] ) {
+ desired_bpp = atoi(argv[2]);
+ argv += 2;
+ argc -= 2;
+ } else {
+ fprintf(stderr,
+ "The -bpp option requires an argument\n");
+ return(1);
+ }
+ } else
+ if ( strcmp(argv[1], "-lum") == 0 ) {
+ if ( argv[2] ) {
+ luminance = atoi(argv[2]);
+ argv += 2;
+ argc -= 2;
+ } else {
+ fprintf(stderr,
+ "The -lum option requires an argument\n");
+ return(1);
+ }
+ } else
+ if ( strcmp(argv[1], "-format") == 0 ) {
+ if ( argv[2] ) {
+ if(!strcmp(argv[2],"YV12"))
+ overlay_format = SDL_YV12_OVERLAY;
+ else if(!strcmp(argv[2],"IYUV"))
+ overlay_format = SDL_IYUV_OVERLAY;
+ else if(!strcmp(argv[2],"YUY2"))
+ overlay_format = SDL_YUY2_OVERLAY;
+ else if(!strcmp(argv[2],"UYVY"))
+ overlay_format = SDL_UYVY_OVERLAY;
+ else if(!strcmp(argv[2],"YVYU"))
+ overlay_format = SDL_YVYU_OVERLAY;
+ else
+ {
+ fprintf(stderr, "The -format option %s is not recognized\n",argv[2]);
+ return(1);
+ }
+ argv += 2;
+ argc -= 2;
+ } else {
+ fprintf(stderr,
+ "The -format option requires an argument\n");
+ return(1);
+ }
+ } else
+ if ( strcmp(argv[1], "-hw") == 0 ) {
+ video_flags |= SDL_HWSURFACE;
+ argv += 1;
+ argc -= 1;
+ } else
+ if ( strcmp(argv[1], "-flip") == 0 ) {
+ video_flags |= SDL_DOUBLEBUF;
+ argv += 1;
+ argc -= 1;
+ } else
+ if ( strcmp(argv[1], "-scale") == 0 ) {
+ scale = 1;
+ argv += 1;
+ argc -= 1;
+ } else
+ if ( strcmp(argv[1], "-mono") == 0 ) {
+ monochrome = 1;
+ argv += 1;
+ argc -= 1;
+ } else
+ if (( strcmp(argv[1], "-help") == 0 ) || (strcmp(argv[1], "-h") == 0)) {
+ PrintUsage(argv0);
+ return(1);
+ } else
+ if ( strcmp(argv[1], "-fullscreen") == 0 ) {
+ video_flags |= SDL_FULLSCREEN;
+ argv += 1;
+ argc -= 1;
+ } else
+ break;
+ }
+ if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
+ fprintf(stderr,
+ "Couldn't initialize SDL: %s\n", SDL_GetError());
+ return(1);
+ }
+
+ /* Initialize the display */
+ screen = SDL_SetVideoMode(w, h, desired_bpp, video_flags);
+ if ( screen == NULL ) {
+ fprintf(stderr, "Couldn't set %dx%dx%d video mode: %s\n",
+ w, h, desired_bpp, SDL_GetError());
+ quit(1);
+ }
+ printf("Set%s %dx%dx%d mode\n",
+ screen->flags & SDL_FULLSCREEN ? " fullscreen" : "",
+ screen->w, screen->h, screen->format->BitsPerPixel);
+ printf("(video surface located in %s memory)\n",
+ (screen->flags&SDL_HWSURFACE) ? "video" : "system");
+ if ( screen->flags & SDL_DOUBLEBUF ) {
+ printf("Double-buffering enabled\n");
+ flip = 1;
+ }
+
+ /* Set the window manager title bar */
+ SDL_WM_SetCaption("SDL test overlay", "testoverlay");
+
+ /* Load picture */
+ bmpfile=(argv[1]?argv[1]:"sample.bmp");
+ pic = SDL_LoadBMP(bmpfile);
+ if ( pic == NULL ) {
+ fprintf(stderr, "Couldn't load %s: %s\n", bmpfile,
+ SDL_GetError());
+ quit(1);
+ }
+
+ /* Convert the picture to 32bits, for easy conversion */
+ {
+ SDL_Surface *newsurf;
+ SDL_PixelFormat format;
+
+ format.palette=NULL;
+ format.BitsPerPixel=32;
+ format.BytesPerPixel=4;
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+ format.Rshift=0;
+ format.Gshift=8;
+ format.Bshift=16;
+#else
+ format.Rshift=24;
+ format.Gshift=16;
+ format.Bshift=8;
+#endif
+ format.Ashift=0;
+ format.Rmask=0xff<<format.Rshift;
+ format.Gmask=0xff<<format.Gshift;
+ format.Bmask=0xff<<format.Bshift;
+ format.Amask=0;
+ format.Rloss=0;
+ format.Gloss=0;
+ format.Bloss=0;
+ format.Aloss=8;
+ format.colorkey=0;
+ format.alpha=0;
+
+ newsurf=SDL_ConvertSurface(pic, &format, SDL_SWSURFACE);
+ if(!newsurf)
+ {
+ fprintf(stderr, "Couldn't convert picture to 32bits RGB: %s\n",
+ SDL_GetError());
+ quit(1);
+ }
+ SDL_FreeSurface(pic);
+ pic=newsurf;
+ }
+
+ /* Create the overlay */
+ overlay = SDL_CreateYUVOverlay(pic->w, pic->h, overlay_format, screen);
+ if ( overlay == NULL ) {
+ fprintf(stderr, "Couldn't create overlay: %s\n", SDL_GetError());
+ quit(1);
+ }
+ printf("Created %dx%dx%d %s %s overlay\n",overlay->w,overlay->h,overlay->planes,
+ overlay->hw_overlay?"hardware":"software",
+ overlay->format==SDL_YV12_OVERLAY?"YV12":
+ overlay->format==SDL_IYUV_OVERLAY?"IYUV":
+ overlay->format==SDL_YUY2_OVERLAY?"YUY2":
+ overlay->format==SDL_UYVY_OVERLAY?"UYVY":
+ overlay->format==SDL_YVYU_OVERLAY?"YVYU":
+ "Unknown");
+ for(i=0; i<overlay->planes; i++)
+ {
+ printf(" plane %d: pitch=%d\n", i, overlay->pitches[i]);
+ }
+
+ /* Convert to YUV, and draw to the overlay */
+#ifdef BENCHMARK_SDL
+ then = SDL_GetTicks();
+#endif
+ switch(overlay->format)
+ {
+ case SDL_YV12_OVERLAY:
+ ConvertRGBtoYV12(pic,overlay,monochrome,luminance);
+ break;
+ case SDL_UYVY_OVERLAY:
+ ConvertRGBtoUYVY(pic,overlay,monochrome,luminance);
+ break;
+ case SDL_YVYU_OVERLAY:
+ ConvertRGBtoYVYU(pic,overlay,monochrome,luminance);
+ break;
+ case SDL_YUY2_OVERLAY:
+ ConvertRGBtoYUY2(pic,overlay,monochrome,luminance);
+ break;
+ case SDL_IYUV_OVERLAY:
+ ConvertRGBtoIYUV(pic,overlay,monochrome,luminance);
+ break;
+ default:
+ printf("cannot convert RGB picture to obtained YUV format!\n");
+ quit(1);
+ break;
+ }
+#ifdef BENCHMARK_SDL
+ now = SDL_GetTicks();
+ printf("Conversion Time: %d milliseconds\n", now-then);
+#endif
+
+ /* Do all the drawing work */
+#ifdef BENCHMARK_SDL
+ then = SDL_GetTicks();
+#endif
+ Draw();
+#ifdef BENCHMARK_SDL
+ now = SDL_GetTicks();
+ printf("Time: %d milliseconds\n", now-then);
+#endif
+ SDL_Delay(delay*1000);
+ SDL_Quit();
+ return(0);
+}
+
diff --git a/distrib/sdl-1.2.15/test/testoverlay2.c b/distrib/sdl-1.2.15/test/testoverlay2.c
new file mode 100644
index 0000000..5f491f2
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testoverlay2.c
@@ -0,0 +1,600 @@
+/********************************************************************************
+ * *
+ * Test of the overlay used for moved pictures, test more closed to real life. *
+ * Running trojan moose :) Coded by Mike Gorchak. *
+ * *
+ ********************************************************************************/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "SDL.h"
+
+#define MOOSEPIC_W 64
+#define MOOSEPIC_H 88
+
+#define MOOSEFRAME_SIZE (MOOSEPIC_W * MOOSEPIC_H)
+#define MOOSEFRAMES_COUNT 10
+
+SDL_Color MooseColors[84]={
+ { 49, 49, 49}, { 66, 24, 0}, { 66, 33, 0}, { 66, 66, 66},
+ { 66, 115, 49}, { 74, 33, 0}, { 74, 41, 16}, { 82, 33, 8},
+ { 82, 41, 8}, { 82, 49, 16}, { 82, 82, 82}, { 90, 41, 8},
+ { 90, 41, 16}, { 90, 57, 24}, { 99, 49, 16}, { 99, 66, 24},
+ { 99, 66, 33}, { 99, 74, 33}, {107, 57, 24}, {107, 82, 41},
+ {115, 57, 33}, {115, 66, 33}, {115, 66, 41}, {115, 74, 0},
+ {115, 90, 49}, {115, 115, 115}, {123, 82, 0}, {123, 99, 57},
+ {132, 66, 41}, {132, 74, 41}, {132, 90, 8}, {132, 99, 33},
+ {132, 99, 66}, {132, 107, 66}, {140, 74, 49}, {140, 99, 16},
+ {140, 107, 74}, {140, 115, 74}, {148, 107, 24}, {148, 115, 82},
+ {148, 123, 74}, {148, 123, 90}, {156, 115, 33}, {156, 115, 90},
+ {156, 123, 82}, {156, 132, 82}, {156, 132, 99}, {156, 156, 156},
+ {165, 123, 49}, {165, 123, 90}, {165, 132, 82}, {165, 132, 90},
+ {165, 132, 99}, {165, 140, 90}, {173, 132, 57}, {173, 132, 99},
+ {173, 140, 107}, {173, 140, 115}, {173, 148, 99}, {173, 173, 173},
+ {181, 140, 74}, {181, 148, 115}, {181, 148, 123}, {181, 156, 107},
+ {189, 148, 123}, {189, 156, 82}, {189, 156, 123}, {189, 156, 132},
+ {189, 189, 189}, {198, 156, 123}, {198, 165, 132}, {206, 165, 99},
+ {206, 165, 132}, {206, 173, 140}, {206, 206, 206}, {214, 173, 115},
+ {214, 173, 140}, {222, 181, 148}, {222, 189, 132}, {222, 189, 156},
+ {222, 222, 222}, {231, 198, 165}, {231, 231, 231}, {239, 206, 173}
+};
+
+
+/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
+static void quit(int rc)
+{
+ SDL_Quit();
+ exit(rc);
+}
+
+/* All RGB2YUV conversion code and some other parts of code has been taken from testoverlay.c */
+
+/* NOTE: These RGB conversion functions are not intended for speed,
+ only as examples.
+*/
+
+void RGBtoYUV(Uint8 *rgb, int *yuv, int monochrome, int luminance)
+{
+ if (monochrome)
+ {
+#if 1 /* these are the two formulas that I found on the FourCC site... */
+ yuv[0] = 0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2];
+ yuv[1] = 128;
+ yuv[2] = 128;
+#else
+ yuv[0] = (0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16;
+ yuv[1] = 128;
+ yuv[2] = 128;
+#endif
+ }
+ else
+ {
+#if 1 /* these are the two formulas that I found on the FourCC site... */
+ yuv[0] = 0.299*rgb[0] + 0.587*rgb[1] + 0.114*rgb[2];
+ yuv[1] = (rgb[2]-yuv[0])*0.565 + 128;
+ yuv[2] = (rgb[0]-yuv[0])*0.713 + 128;
+#else
+ yuv[0] = (0.257 * rgb[0]) + (0.504 * rgb[1]) + (0.098 * rgb[2]) + 16;
+ yuv[1] = 128 - (0.148 * rgb[0]) - (0.291 * rgb[1]) + (0.439 * rgb[2]);
+ yuv[2] = 128 + (0.439 * rgb[0]) - (0.368 * rgb[1]) - (0.071 * rgb[2]);
+#endif
+ }
+
+ if (luminance!=100)
+ {
+ yuv[0]=yuv[0]*luminance/100;
+ if (yuv[0]>255)
+ yuv[0]=255;
+ }
+}
+
+void ConvertRGBtoYV12(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[2];
+ *(op[2]++)=yuv[1];
+ }
+ p+=s->format->BytesPerPixel;
+ }
+ }
+
+ SDL_UnlockYUVOverlay(o);
+ SDL_UnlockSurface(s);
+}
+
+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)
+{
+ fprintf(stderr, "Usage: %s [arg] [arg] [arg] ...\n", argv0);
+ fprintf(stderr, "\n");
+ fprintf(stderr, "Where 'arg' is any of the following options:\n");
+ fprintf(stderr, "\n");
+ fprintf(stderr, " -fps <frames per second>\n");
+ fprintf(stderr, " -format <fmt> (one of the: YV12, IYUV, YUY2, UYVY, YVYU)\n");
+ fprintf(stderr, " -scale <scale factor> (initial scale of the overlay)\n");
+ fprintf(stderr, " -help (shows this help)\n");
+ fprintf(stderr, "\n");
+ fprintf(stderr, "Press ESC to exit, or SPACE to freeze the movie while application running.\n");
+ fprintf(stderr, "\n");
+}
+
+int main(int argc, char **argv)
+{
+ Uint8* RawMooseData;
+ SDL_RWops* handle;
+ SDL_Surface* screen;
+ SDL_Surface* MooseFrame[MOOSEFRAMES_COUNT];
+ SDL_Overlay* overlay;
+ SDL_Rect overlayrect;
+ SDL_Event event;
+ Uint32 lastftick;
+ int paused=0;
+ int resized=0;
+ int i;
+ int fps=12;
+ int fpsdelay;
+ int overlay_format=SDL_YUY2_OVERLAY;
+ int scale=5;
+
+ if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0)
+ {
+ fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
+ return 3;
+ }
+
+ while ( argc > 1 )
+ {
+ if (strcmp(argv[1], "-fps")== 0)
+ {
+ if (argv[2])
+ {
+ fps = atoi(argv[2]);
+ if (fps==0)
+ {
+ fprintf(stderr, "The -fps option requires an argument [from 1 to 1000], default is 12.\n");
+ quit(10);
+ }
+ if ((fps<0) || (fps>1000))
+ {
+ fprintf(stderr, "The -fps option must be in range from 1 to 1000, default is 12.\n");
+ quit(10);
+ }
+ argv += 2;
+ argc -= 2;
+ }
+ else
+ {
+ fprintf(stderr, "The -fps option requires an argument [from 1 to 1000], default is 12.\n");
+ quit(10);
+ }
+ } else
+ if (strcmp(argv[1], "-format") == 0)
+ {
+ if (argv[2])
+ {
+ if (!strcmp(argv[2],"YV12"))
+ overlay_format = SDL_YV12_OVERLAY;
+ else if(!strcmp(argv[2],"IYUV"))
+ overlay_format = SDL_IYUV_OVERLAY;
+ else if(!strcmp(argv[2],"YUY2"))
+ overlay_format = SDL_YUY2_OVERLAY;
+ else if(!strcmp(argv[2],"UYVY"))
+ overlay_format = SDL_UYVY_OVERLAY;
+ else if(!strcmp(argv[2],"YVYU"))
+ overlay_format = SDL_YVYU_OVERLAY;
+ 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]);
+ if (scale==0)
+ {
+ fprintf(stderr, "The -scale option requires an argument [from 1 to 50], default is 5.\n");
+ quit(10);
+ }
+ if ((scale<0) || (scale>50))
+ {
+ fprintf(stderr, "The -scale option must be in range from 1 to 50, default is 5.\n");
+ quit(10);
+ }
+ argv += 2;
+ argc -= 2;
+ }
+ else
+ {
+ fprintf(stderr, "The -fps option requires an argument [from 1 to 1000], default is 12.\n");
+ quit(10);
+ }
+ } else
+ if ((strcmp(argv[1], "-help") == 0 ) || (strcmp(argv[1], "-h") == 0))
+ {
+ PrintUsage(argv[0]);
+ quit(0);
+ } else
+ {
+ fprintf(stderr, "Unrecognized option: %s.\n", argv[1]);
+ quit(10);
+ }
+ break;
+ }
+
+ RawMooseData=(Uint8*)malloc(MOOSEFRAME_SIZE * MOOSEFRAMES_COUNT);
+ if (RawMooseData==NULL)
+ {
+ fprintf(stderr, "Can't allocate memory for movie !\n");
+ free(RawMooseData);
+ quit(1);
+ }
+
+ /* load the trojan moose images */
+ handle=SDL_RWFromFile("moose.dat", "rb");
+ if (handle==NULL)
+ {
+ fprintf(stderr, "Can't find the file moose.dat !\n");
+ free(RawMooseData);
+ quit(2);
+ }
+
+ SDL_RWread(handle, RawMooseData, MOOSEFRAME_SIZE, MOOSEFRAMES_COUNT);
+
+ SDL_RWclose(handle);
+
+ /* Set video mode */
+ if ( (screen=SDL_SetVideoMode(MOOSEPIC_W*scale, MOOSEPIC_H*scale, 0, SDL_RESIZABLE | SDL_SWSURFACE)) == NULL )
+ {
+ fprintf(stderr, "Couldn't set video mode: %s\n", SDL_GetError());
+ free(RawMooseData);
+ quit(4);
+ }
+
+ /* Set the window manager title bar */
+ SDL_WM_SetCaption("SDL test overlay: running moose", "testoverlay2");
+
+ for (i=0; i<MOOSEFRAMES_COUNT; i++)
+ {
+ MooseFrame[i]=SDL_CreateRGBSurfaceFrom(RawMooseData+i*MOOSEFRAME_SIZE, MOOSEPIC_W,
+ MOOSEPIC_H, 8, MOOSEPIC_W, 0, 0, 0, 0);
+ if (MooseFrame[i]==NULL)
+ {
+ fprintf(stderr, "Couldn't create SDL_Surfaces:%s\n", SDL_GetError());
+ free(RawMooseData);
+ quit(5);
+ }
+ SDL_SetColors(MooseFrame[i], MooseColors, 0, 84);
+
+ {
+ SDL_Surface *newsurf;
+ SDL_PixelFormat format;
+
+ format.palette=NULL;
+ format.BitsPerPixel=32;
+ format.BytesPerPixel=4;
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+ format.Rshift=0;
+ format.Gshift=8;
+ format.Bshift=16;
+#else
+ format.Rshift=24;
+ format.Gshift=16;
+ format.Bshift=8;
+#endif
+ format.Ashift=0;
+ format.Rmask=0xff<<format.Rshift;
+ format.Gmask=0xff<<format.Gshift;
+ format.Bmask=0xff<<format.Bshift;
+ format.Amask=0;
+ format.Rloss=0;
+ format.Gloss=0;
+ format.Bloss=0;
+ format.Aloss=8;
+ format.colorkey=0;
+ format.alpha=0;
+
+ newsurf=SDL_ConvertSurface(MooseFrame[i], &format, SDL_SWSURFACE);
+ if(!newsurf)
+ {
+ fprintf(stderr, "Couldn't convert picture to 32bits RGB: %s\n", SDL_GetError());
+ quit(6);
+ }
+ SDL_FreeSurface(MooseFrame[i]);
+ MooseFrame[i]=newsurf;
+ }
+ }
+
+ free(RawMooseData);
+
+ overlay=SDL_CreateYUVOverlay(MOOSEPIC_W, MOOSEPIC_H, overlay_format, screen);
+ if (!overlay)
+ {
+ fprintf(stderr, "Couldn't create overlay: %s\n", SDL_GetError());
+ quit(7);
+ }
+
+ printf("Created %dx%dx%d %s %s overlay\n",overlay->w,overlay->h,overlay->planes,
+ overlay->hw_overlay?"hardware":"software",
+ overlay->format==SDL_YV12_OVERLAY?"YV12":
+ overlay->format==SDL_IYUV_OVERLAY?"IYUV":
+ overlay->format==SDL_YUY2_OVERLAY?"YUY2":
+ overlay->format==SDL_UYVY_OVERLAY?"UYVY":
+ overlay->format==SDL_YVYU_OVERLAY?"YVYU":
+ "Unknown");
+
+ for(i=0; i<overlay->planes; i++)
+ {
+ printf(" plane %d: pitch=%d\n", i, overlay->pitches[i]);
+ }
+
+ overlayrect.x=0;
+ overlayrect.y=0;
+ overlayrect.w=MOOSEPIC_W*scale;
+ overlayrect.h=MOOSEPIC_H*scale;
+
+ /* set the start frame */
+ i=0;
+ fpsdelay=1000/fps;
+
+ /* Ignore key up events, they don't even get filtered */
+ SDL_EventState(SDL_KEYUP, SDL_IGNORE);
+
+ lastftick=SDL_GetTicks();
+
+ /* Loop, waiting for QUIT or RESIZE */
+ while (1)
+ {
+ if (SDL_PollEvent(&event))
+ {
+ switch (event.type)
+ {
+ case SDL_VIDEORESIZE:
+ screen=SDL_SetVideoMode(event.resize.w, event.resize.h, 0, SDL_RESIZABLE | SDL_SWSURFACE);
+ overlayrect.w=event.resize.w;
+ overlayrect.h=event.resize.h;
+ if (paused)
+ {
+ resized=1;
+ }
+ break;
+ case SDL_MOUSEBUTTONDOWN:
+ overlayrect.x = event.button.x - overlayrect.w/2;
+ overlayrect.y = event.button.y - overlayrect.h/2;
+ break;
+ case SDL_KEYDOWN:
+ if (event.key.keysym.sym == SDLK_SPACE)
+ {
+ paused=!paused;
+ break;
+ }
+ if (event.key.keysym.sym != SDLK_ESCAPE)
+ {
+ break;
+ }
+ case SDL_QUIT:
+ SDL_FreeYUVOverlay(overlay);
+ for (i=0; i<MOOSEFRAMES_COUNT; i++)
+ {
+ SDL_FreeSurface(MooseFrame[i]);
+ }
+ quit(0);
+ }
+ }
+
+ if ((!paused)||(resized))
+ {
+ if (((SDL_GetTicks()-lastftick)>fpsdelay)||(resized))
+ {
+ lastftick=SDL_GetTicks();
+
+ switch (overlay_format)
+ {
+ case SDL_YUY2_OVERLAY:
+ ConvertRGBtoYUY2(MooseFrame[i], overlay, 0, 100);
+ break;
+ case SDL_YV12_OVERLAY:
+ ConvertRGBtoYV12(MooseFrame[i], overlay, 0, 100);
+ break;
+ case SDL_UYVY_OVERLAY:
+ ConvertRGBtoUYVY(MooseFrame[i], overlay, 0, 100);
+ break;
+ case SDL_YVYU_OVERLAY:
+ ConvertRGBtoYVYU(MooseFrame[i], overlay, 0, 100);
+ break;
+ case SDL_IYUV_OVERLAY:
+ ConvertRGBtoIYUV(MooseFrame[i], overlay, 0, 100);
+ break;
+ }
+
+ SDL_DisplayYUVOverlay(overlay, &overlayrect);
+ if (!resized)
+ {
+ i++;
+ if (i==10)
+ {
+ i=0;
+ }
+ }
+ else
+ {
+ resized=0;
+ }
+ }
+ }
+ /* kind of timeslice to OS */
+ SDL_Delay(1);
+ }
+
+ SDL_Quit();
+ return 0;
+}
+
diff --git a/distrib/sdl-1.2.15/test/testpalette.c b/distrib/sdl-1.2.15/test/testpalette.c
new file mode 100644
index 0000000..2ad4916
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testpalette.c
@@ -0,0 +1,342 @@
+/*
+ * testpalette.c
+ *
+ * A simple test of runtime palette modification for animation
+ * (using the SDL_SetPalette() API).
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+/* This isn't in the Windows headers */
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
+#include "SDL.h"
+
+/* screen size */
+#define SCRW 640
+#define SCRH 480
+
+#define NBOATS 5
+#define SPEED 2
+
+#ifndef MIN
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+#ifndef MAX
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#endif
+
+/*
+ * wave colours: Made by taking a narrow cross-section of a wave picture
+ * in Gimp, saving in PPM ascii format and formatting with Emacs macros.
+ */
+static SDL_Color wavemap[] = {
+ {0,2,103}, {0,7,110}, {0,13,117}, {0,19,125},
+ {0,25,133}, {0,31,141}, {0,37,150}, {0,43,158},
+ {0,49,166}, {0,55,174}, {0,61,182}, {0,67,190},
+ {0,73,198}, {0,79,206}, {0,86,214}, {0,96,220},
+ {5,105,224}, {12,112,226}, {19,120,227}, {26,128,229},
+ {33,135,230}, {40,143,232}, {47,150,234}, {54,158,236},
+ {61,165,238}, {68,173,239}, {75,180,241}, {82,188,242},
+ {89,195,244}, {96,203,246}, {103,210,248}, {112,218,250},
+ {124,224,250}, {135,226,251}, {146,229,251}, {156,231,252},
+ {167,233,252}, {178,236,252}, {189,238,252}, {200,240,252},
+ {211,242,252}, {222,244,252}, {233,247,252}, {242,249,252},
+ {237,250,252}, {209,251,252}, {174,251,252}, {138,252,252},
+ {102,251,252}, {63,250,252}, {24,243,252}, {7,225,252},
+ {4,203,252}, {3,181,252}, {2,158,252}, {1,136,251},
+ {0,111,248}, {0,82,234}, {0,63,213}, {0,50,192},
+ {0,39,172}, {0,28,152}, {0,17,132}, {0,7,114}
+};
+
+/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
+static void quit(int rc)
+{
+ SDL_Quit();
+ exit(rc);
+}
+
+static void sdlerr(char *when)
+{
+ fprintf(stderr, "SDL error: %s: %s\n", when, SDL_GetError());
+ quit(1);
+}
+
+/* create a background surface */
+static SDL_Surface *make_bg(SDL_Surface *screen, int startcol)
+{
+ int i;
+ SDL_Surface *bg = SDL_CreateRGBSurface(SDL_SWSURFACE, screen->w, screen->h,
+ 8, 0, 0, 0, 0);
+ if(!bg)
+ sdlerr("creating background surface");
+
+ /* set the palette to the logical screen palette so that blits
+ won't be translated */
+ SDL_SetColors(bg, screen->format->palette->colors, 0, 256);
+
+ /* Make a wavy background pattern using colours 0-63 */
+ if(SDL_LockSurface(bg) < 0)
+ sdlerr("locking background");
+ for(i = 0; i < SCRH; i++) {
+ Uint8 *p = (Uint8 *)bg->pixels + i * bg->pitch;
+ int j, d;
+ d = 0;
+ for(j = 0; j < SCRW; j++) {
+ int v = MAX(d, -2);
+ v = MIN(v, 2);
+ if(i > 0)
+ v += p[-bg->pitch] + 65 - startcol;
+ p[j] = startcol + (v & 63);
+ d += ((rand() >> 3) % 3) - 1;
+ }
+ }
+ SDL_UnlockSurface(bg);
+ return(bg);
+}
+
+/*
+ * Return a surface flipped horisontally. Only works for 8bpp;
+ * extension to arbitrary bitness is left as an exercise for the reader.
+ */
+static SDL_Surface *hflip(SDL_Surface *s)
+{
+ int i;
+ SDL_Surface *z = SDL_CreateRGBSurface(SDL_SWSURFACE, s->w, s->h, 8,
+ 0, 0, 0, 0);
+ /* copy palette */
+ SDL_SetColors(z, s->format->palette->colors,
+ 0, s->format->palette->ncolors);
+ if(SDL_LockSurface(s) < 0 || SDL_LockSurface(z) < 0)
+ sdlerr("locking flip images");
+
+ for(i = 0; i < s->h; i++) {
+ int j;
+ Uint8 *from = (Uint8 *)s->pixels + i * s->pitch;
+ Uint8 *to = (Uint8 *)z->pixels + i * z->pitch + s->w - 1;
+ for(j = 0; j < s->w; j++)
+ to[-j] = from[j];
+ }
+
+ SDL_UnlockSurface(z);
+ SDL_UnlockSurface(s);
+ return z;
+}
+
+int main(int argc, char **argv)
+{
+ SDL_Color cmap[256];
+ SDL_Surface *screen;
+ SDL_Surface *bg;
+ SDL_Surface *boat[2];
+ unsigned vidflags = 0;
+ unsigned start;
+ int fade_max = 400;
+ int fade_level, fade_dir;
+ int boatcols, frames, i, red;
+ int boatx[NBOATS], boaty[NBOATS], boatdir[NBOATS];
+ int gamma_fade = 0;
+ int gamma_ramp = 0;
+
+ if(SDL_Init(SDL_INIT_VIDEO) < 0)
+ sdlerr("initialising SDL");
+
+ while(--argc) {
+ ++argv;
+ if(strcmp(*argv, "-hw") == 0)
+ vidflags |= SDL_HWSURFACE;
+ else if(strcmp(*argv, "-fullscreen") == 0)
+ vidflags |= SDL_FULLSCREEN;
+ else if(strcmp(*argv, "-nofade") == 0)
+ fade_max = 1;
+ else if(strcmp(*argv, "-gamma") == 0)
+ gamma_fade = 1;
+ else if(strcmp(*argv, "-gammaramp") == 0)
+ gamma_ramp = 1;
+ else {
+ fprintf(stderr,
+ "usage: testpalette "
+ " [-hw] [-fullscreen] [-nofade] [-gamma] [-gammaramp]\n");
+ quit(1);
+ }
+ }
+
+ /* Ask explicitly for 8bpp and a hardware palette */
+ if((screen = SDL_SetVideoMode(SCRW, SCRH, 8, vidflags | SDL_HWPALETTE)) == NULL) {
+ fprintf(stderr, "error setting %dx%d 8bpp indexed mode: %s\n",
+ SCRW, SCRH, SDL_GetError());
+ quit(1);
+ }
+
+ if (vidflags & SDL_FULLSCREEN) SDL_ShowCursor (SDL_FALSE);
+
+ if((boat[0] = SDL_LoadBMP("sail.bmp")) == NULL)
+ sdlerr("loading sail.bmp");
+ /* We've chosen magenta (#ff00ff) as colour key for the boat */
+ SDL_SetColorKey(boat[0], SDL_SRCCOLORKEY | SDL_RLEACCEL,
+ SDL_MapRGB(boat[0]->format, 0xff, 0x00, 0xff));
+ boatcols = boat[0]->format->palette->ncolors;
+ boat[1] = hflip(boat[0]);
+ SDL_SetColorKey(boat[1], SDL_SRCCOLORKEY | SDL_RLEACCEL,
+ SDL_MapRGB(boat[1]->format, 0xff, 0x00, 0xff));
+
+ /*
+ * First set the physical screen palette to black, so the user won't
+ * see our initial drawing on the screen.
+ */
+ memset(cmap, 0, sizeof(cmap));
+ SDL_SetPalette(screen, SDL_PHYSPAL, cmap, 0, 256);
+
+ /*
+ * Proper palette management is important when playing games with the
+ * colormap. We have divided the palette as follows:
+ *
+ * index 0..(boatcols-1): used for the boat
+ * index boatcols..(boatcols+63): used for the waves
+ */
+ SDL_SetPalette(screen, SDL_LOGPAL,
+ boat[0]->format->palette->colors, 0, boatcols);
+ SDL_SetPalette(screen, SDL_LOGPAL, wavemap, boatcols, 64);
+
+ /*
+ * Now the logical screen palette is set, and will remain unchanged.
+ * The boats already have the same palette so fast blits can be used.
+ */
+ memcpy(cmap, screen->format->palette->colors, 256 * sizeof(SDL_Color));
+
+ /* save the index of the red colour for later */
+ red = SDL_MapRGB(screen->format, 0xff, 0x00, 0x00);
+
+ bg = make_bg(screen, boatcols); /* make a nice wavy background surface */
+
+ /* initial screen contents */
+ if(SDL_BlitSurface(bg, NULL, screen, NULL) < 0)
+ sdlerr("blitting background to screen");
+ SDL_Flip(screen); /* actually put the background on screen */
+
+ /* determine initial boat placements */
+ for(i = 0; i < NBOATS; i++) {
+ boatx[i] = (rand() % (SCRW + boat[0]->w)) - boat[0]->w;
+ boaty[i] = i * (SCRH - boat[0]->h) / (NBOATS - 1);
+ boatdir[i] = ((rand() >> 5) & 1) * 2 - 1;
+ }
+
+ start = SDL_GetTicks();
+ frames = 0;
+ fade_dir = 1;
+ fade_level = 0;
+ do {
+ SDL_Event e;
+ SDL_Rect updates[NBOATS];
+ SDL_Rect r;
+ int redphase;
+
+ /* A small event loop: just exit on any key or mouse button event */
+ while(SDL_PollEvent(&e)) {
+ if(e.type == SDL_KEYDOWN || e.type == SDL_QUIT
+ || e.type == SDL_MOUSEBUTTONDOWN) {
+ if(fade_dir < 0)
+ fade_level = 0;
+ fade_dir = -1;
+ }
+ }
+
+ /* move boats */
+ for(i = 0; i < NBOATS; i++) {
+ int old_x = boatx[i];
+ /* update boat position */
+ boatx[i] += boatdir[i] * SPEED;
+ if(boatx[i] <= -boat[0]->w || boatx[i] >= SCRW)
+ boatdir[i] = -boatdir[i];
+
+ /* paint over the old boat position */
+ r.x = old_x;
+ r.y = boaty[i];
+ r.w = boat[0]->w;
+ r.h = boat[0]->h;
+ if(SDL_BlitSurface(bg, &r, screen, &r) < 0)
+ sdlerr("blitting background");
+
+ /* construct update rectangle (bounding box of old and new pos) */
+ updates[i].x = MIN(old_x, boatx[i]);
+ updates[i].y = boaty[i];
+ updates[i].w = boat[0]->w + SPEED;
+ updates[i].h = boat[0]->h;
+ /* clip update rectangle to screen */
+ if(updates[i].x < 0) {
+ updates[i].w += updates[i].x;
+ updates[i].x = 0;
+ }
+ if(updates[i].x + updates[i].w > SCRW)
+ updates[i].w = SCRW - updates[i].x;
+ }
+
+ for(i = 0; i < NBOATS; i++) {
+ /* paint boat on new position */
+ r.x = boatx[i];
+ r.y = boaty[i];
+ if(SDL_BlitSurface(boat[(boatdir[i] + 1) / 2], NULL,
+ screen, &r) < 0)
+ sdlerr("blitting boat");
+ }
+
+ /* cycle wave palette */
+ for(i = 0; i < 64; i++)
+ cmap[boatcols + ((i + frames) & 63)] = wavemap[i];
+
+ if(fade_dir) {
+ /* Fade the entire palette in/out */
+ fade_level += fade_dir;
+
+ if(gamma_fade) {
+ /* Fade linearly in gamma level (lousy) */
+ float level = (float)fade_level / fade_max;
+ if(SDL_SetGamma(level, level, level) < 0)
+ sdlerr("setting gamma");
+
+ } else if(gamma_ramp) {
+ /* Fade using gamma ramp (better) */
+ Uint16 ramp[256];
+ for(i = 0; i < 256; i++)
+ ramp[i] = (i * fade_level / fade_max) << 8;
+ if(SDL_SetGammaRamp(ramp, ramp, ramp) < 0)
+ sdlerr("setting gamma ramp");
+
+ } else {
+ /* Fade using direct palette manipulation (best) */
+ memcpy(cmap, screen->format->palette->colors,
+ boatcols * sizeof(SDL_Color));
+ for(i = 0; i < boatcols + 64; i++) {
+ cmap[i].r = cmap[i].r * fade_level / fade_max;
+ cmap[i].g = cmap[i].g * fade_level / fade_max;
+ cmap[i].b = cmap[i].b * fade_level / fade_max;
+ }
+ }
+ if(fade_level == fade_max)
+ fade_dir = 0;
+ }
+
+ /* pulse the red colour (done after the fade, for a night effect) */
+ redphase = frames % 64;
+ cmap[red].r = (int)(255 * sin(redphase * M_PI / 63));
+
+ SDL_SetPalette(screen, SDL_PHYSPAL, cmap, 0, boatcols + 64);
+
+ /* update changed areas of the screen */
+ SDL_UpdateRects(screen, NBOATS, updates);
+ frames++;
+ } while(fade_level > 0);
+
+ printf("%d frames, %.2f fps\n",
+ frames, 1000.0 * frames / (SDL_GetTicks() - start));
+
+ if (vidflags & SDL_FULLSCREEN) SDL_ShowCursor (SDL_TRUE);
+ SDL_Quit();
+ return 0;
+}
+
diff --git a/distrib/sdl-1.2.15/test/testplatform.c b/distrib/sdl-1.2.15/test/testplatform.c
new file mode 100644
index 0000000..328a96f
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testplatform.c
@@ -0,0 +1,210 @@
+
+#include <stdio.h>
+
+#include "SDL.h"
+#include "SDL_endian.h"
+#include "SDL_cpuinfo.h"
+
+/*
+ * 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 badsize(size_t sizeoftype, size_t hardcodetype)
+{
+ return sizeoftype != hardcodetype;
+}
+
+int TestTypes(SDL_bool verbose)
+{
+ int error = 0;
+
+ if ( badsize(sizeof(Uint8), 1) ) {
+ if ( verbose )
+ printf("sizeof(Uint8) != 1, instead = %lu\n",
+ (unsigned long) sizeof(Uint8));
+ ++error;
+ }
+ if ( badsize(sizeof(Uint16), 2) ) {
+ if ( verbose )
+ printf("sizeof(Uint16) != 2, instead = %lu\n",
+ (unsigned long) sizeof(Uint16));
+ ++error;
+ }
+ if ( badsize(sizeof(Uint32), 4) ) {
+ if ( verbose )
+ printf("sizeof(Uint32) != 4, instead = %lu\n",
+ (unsigned long) sizeof(Uint32));
+ ++error;
+ }
+#ifdef SDL_HAS_64BIT_TYPE
+ if ( badsize(sizeof(Uint64), 8) ) {
+ if ( verbose )
+ printf("sizeof(Uint64) != 8, instead = %lu\n",
+ (unsigned long) sizeof(Uint64));
+ ++error;
+ }
+#else
+ if ( verbose ) {
+ printf("WARNING: No 64-bit datatype on this platform\n");
+ }
+#endif
+ if ( verbose && !error )
+ printf("All data types are the expected size.\n");
+
+ return( error ? 1 : 0 );
+}
+
+int TestEndian(SDL_bool verbose)
+{
+ int error = 0;
+ Uint16 value = 0x1234;
+ int real_byteorder;
+ Uint16 value16 = 0xCDAB;
+ Uint16 swapped16 = 0xABCD;
+ Uint32 value32 = 0xEFBEADDE;
+ Uint32 swapped32 = 0xDEADBEEF;
+#ifdef SDL_HAS_64BIT_TYPE
+ Uint64 value64, swapped64;
+ value64 = 0xEFBEADDE;
+ value64 <<= 32;
+ value64 |= 0xCDAB3412;
+ swapped64 = 0x1234ABCD;
+ swapped64 <<= 32;
+ swapped64 |= 0xDEADBEEF;
+#endif
+
+ if ( verbose ) {
+ printf("Detected a %s endian machine.\n",
+ (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? "little" : "big");
+ }
+ if ( (*((char *)&value) >> 4) == 0x1 ) {
+ real_byteorder = SDL_BIG_ENDIAN;
+ } else {
+ real_byteorder = SDL_LIL_ENDIAN;
+ }
+ if ( real_byteorder != SDL_BYTEORDER ) {
+ if ( verbose ) {
+ printf("Actually a %s endian machine!\n",
+ (real_byteorder == SDL_LIL_ENDIAN) ? "little" : "big");
+ }
+ ++error;
+ }
+ if ( verbose ) {
+ printf("Value 16 = 0x%X, swapped = 0x%X\n", value16, SDL_Swap16(value16));
+ }
+ if ( SDL_Swap16(value16) != swapped16 ) {
+ if ( verbose ) {
+ printf("16 bit value swapped incorrectly!\n");
+ }
+ ++error;
+ }
+ if ( verbose ) {
+ printf("Value 32 = 0x%X, swapped = 0x%X\n", value32, SDL_Swap32(value32));
+ }
+ if ( SDL_Swap32(value32) != swapped32 ) {
+ if ( verbose ) {
+ printf("32 bit value swapped incorrectly!\n");
+ }
+ ++error;
+ }
+#ifdef SDL_HAS_64BIT_TYPE
+ if ( verbose ) {
+#ifdef _MSC_VER
+ printf("Value 64 = 0x%I64X, swapped = 0x%I64X\n", value64, SDL_Swap64(value64));
+#else
+ printf("Value 64 = 0x%llX, swapped = 0x%llX\n", (unsigned long long) value64, (unsigned long long) SDL_Swap64(value64));
+#endif
+ }
+ if ( SDL_Swap64(value64) != swapped64 ) {
+ if ( verbose ) {
+ printf("64 bit value swapped incorrectly!\n");
+ }
+ ++error;
+ }
+#endif
+ return( error ? 1 : 0 );
+}
+
+
+int TestCPUInfo(SDL_bool verbose)
+{
+ if ( verbose ) {
+ printf("RDTSC %s\n", SDL_HasRDTSC() ? "detected" : "not detected");
+ printf("MMX %s\n", SDL_HasMMX() ? "detected" : "not detected");
+ printf("MMX Ext %s\n", SDL_HasMMXExt() ? "detected" : "not detected");
+ printf("3DNow %s\n", SDL_Has3DNow() ? "detected" : "not detected");
+ printf("3DNow Ext %s\n", SDL_Has3DNowExt() ? "detected" : "not detected");
+ printf("SSE %s\n", SDL_HasSSE() ? "detected" : "not detected");
+ printf("SSE2 %s\n", SDL_HasSSE2() ? "detected" : "not detected");
+ printf("AltiVec %s\n", SDL_HasAltiVec() ? "detected" : "not detected");
+ }
+ return(0);
+}
+
+int main(int argc, char *argv[])
+{
+ SDL_bool verbose = SDL_TRUE;
+ int status = 0;
+
+ if ( argv[1] && (SDL_strcmp(argv[1], "-q") == 0) ) {
+ verbose = SDL_FALSE;
+ }
+ if ( verbose ) {
+ printf("This system is running %s\n",
+#if __AIX__
+ "AIX"
+#elif __HAIKU__
+/* Haiku must appear here before BeOS, since it also defines __BEOS__ */
+ "Haiku"
+#elif __BEOS__
+ "BeOS"
+#elif __BSDI__
+ "BSDI"
+#elif __DREAMCAST__
+ "Dreamcast"
+#elif __FREEBSD__
+ "FreeBSD"
+#elif __HPUX__
+ "HP-UX"
+#elif __IRIX__
+ "Irix"
+#elif __LINUX__
+ "Linux"
+#elif __MINT__
+ "Atari MiNT"
+#elif __MACOS__
+ "MacOS Classic"
+#elif __MACOSX__
+ "Mac OS X"
+#elif __NETBSD__
+ "NetBSD"
+#elif __OPENBSD__
+ "OpenBSD"
+#elif __OS2__
+ "OS/2"
+#elif __OSF__
+ "OSF/1"
+#elif __QNXNTO__
+ "QNX Neutrino"
+#elif __RISCOS__
+ "RISC OS"
+#elif __SOLARIS__
+ "Solaris"
+#elif __WIN32__
+#ifdef _WIN32_WCE
+ "Windows CE"
+#else
+ "Windows"
+#endif
+#else
+ "an unknown operating system! (see SDL_platform.h)"
+#endif
+ );
+ }
+
+ status += TestTypes(verbose);
+ status += TestEndian(verbose);
+ status += TestCPUInfo(verbose);
+ return status;
+}
diff --git a/distrib/sdl-1.2.15/test/testsem.c b/distrib/sdl-1.2.15/test/testsem.c
new file mode 100644
index 0000000..c906432
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testsem.c
@@ -0,0 +1,103 @@
+
+/* Simple test of the SDL semaphore code */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+
+#include "SDL.h"
+#include "SDL_thread.h"
+
+#define NUM_THREADS 10
+
+static SDL_sem *sem;
+int alive = 1;
+
+int SDLCALL ThreadFunc(void *data)
+{
+ int threadnum = (int)(uintptr_t)data;
+ while ( alive ) {
+ SDL_SemWait(sem);
+ fprintf(stderr, "Thread number %d has got the semaphore (value = %d)!\n", threadnum, SDL_SemValue(sem));
+ SDL_Delay(200);
+ SDL_SemPost(sem);
+ fprintf(stderr, "Thread number %d has released the semaphore (value = %d)!\n", threadnum, SDL_SemValue(sem));
+ SDL_Delay(1); /* For the scheduler */
+ }
+ printf("Thread number %d exiting.\n", threadnum);
+ return 0;
+}
+
+static void killed(int sig)
+{
+ alive = 0;
+}
+
+static void TestWaitTimeout(void)
+{
+ Uint32 start_ticks;
+ Uint32 end_ticks;
+ Uint32 duration;
+
+ sem = SDL_CreateSemaphore(0);
+ printf("Waiting 2 seconds on semaphore\n");
+
+ start_ticks = SDL_GetTicks();
+ SDL_SemWaitTimeout(sem, 2000);
+ end_ticks = SDL_GetTicks();
+
+ duration = end_ticks - start_ticks;
+
+ /* Accept a little offset in the effective wait */
+ if (duration > 1900 && duration < 2050)
+ printf("Wait done.\n");
+ else
+ fprintf(stderr, "Wait took %d milliseconds\n", duration);
+}
+
+int main(int argc, char **argv)
+{
+ SDL_Thread *threads[NUM_THREADS];
+ uintptr_t i;
+ int init_sem;
+
+ if(argc < 2) {
+ fprintf(stderr,"Usage: %s init_value\n", argv[0]);
+ return(1);
+ }
+
+ /* Load the SDL library */
+ if ( SDL_Init(0) < 0 ) {
+ fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
+ return(1);
+ }
+ signal(SIGTERM, killed);
+ signal(SIGINT, killed);
+
+ init_sem = atoi(argv[1]);
+ sem = SDL_CreateSemaphore(init_sem);
+
+ printf("Running %d threads, semaphore value = %d\n", NUM_THREADS, init_sem);
+ /* Create all the threads */
+ for( i = 0; i < NUM_THREADS; ++i ) {
+ threads[i] = SDL_CreateThread(ThreadFunc, (void*)i);
+ }
+
+ /* Wait 10 seconds */
+ SDL_Delay(10 * 1000);
+
+ /* Wait for all threads to finish */
+ printf("Waiting for threads to finish\n");
+ alive = 0;
+ for( i = 0; i < NUM_THREADS; ++i ) {
+ SDL_WaitThread(threads[i], NULL);
+ }
+ printf("Finished waiting for threads\n");
+
+ SDL_DestroySemaphore(sem);
+
+ TestWaitTimeout();
+
+ SDL_Quit();
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/test/testsprite.c b/distrib/sdl-1.2.15/test/testsprite.c
new file mode 100644
index 0000000..6d9e0a8
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testsprite.c
@@ -0,0 +1,323 @@
+/* Simple program: Move N sprites around on the screen as fast as possible */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <math.h>
+#include <time.h>
+
+#include "SDL.h"
+
+#define NUM_SPRITES 100
+#define MAX_SPEED 1
+
+SDL_Surface *sprite;
+int numsprites;
+SDL_Rect *sprite_rects;
+SDL_Rect *positions;
+SDL_Rect *velocities;
+int sprites_visible;
+int debug_flip;
+Uint16 sprite_w, sprite_h;
+
+/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
+static void quit(int rc)
+{
+ SDL_Quit();
+ exit(rc);
+}
+
+int LoadSprite(char *file)
+{
+ SDL_Surface *temp;
+
+ /* Load the sprite image */
+ sprite = SDL_LoadBMP(file);
+ if ( sprite == NULL ) {
+ fprintf(stderr, "Couldn't load %s: %s", file, SDL_GetError());
+ return(-1);
+ }
+
+ /* Set transparent pixel as the pixel at (0,0) */
+ if ( sprite->format->palette ) {
+ SDL_SetColorKey(sprite, (SDL_SRCCOLORKEY|SDL_RLEACCEL),
+ *(Uint8 *)sprite->pixels);
+ }
+
+ /* Convert sprite to video format */
+ temp = SDL_DisplayFormat(sprite);
+ SDL_FreeSurface(sprite);
+ if ( temp == NULL ) {
+ fprintf(stderr, "Couldn't convert background: %s\n",
+ SDL_GetError());
+ return(-1);
+ }
+ sprite = temp;
+
+ /* We're ready to roll. :) */
+ return(0);
+}
+
+void MoveSprites(SDL_Surface *screen, Uint32 background)
+{
+ int i, nupdates;
+ SDL_Rect area, *position, *velocity;
+
+ nupdates = 0;
+ /* Erase all the sprites if necessary */
+ if ( sprites_visible ) {
+ SDL_FillRect(screen, NULL, background);
+ }
+
+ /* Move the sprite, bounce at the wall, and draw */
+ for ( i=0; i<numsprites; ++i ) {
+ position = &positions[i];
+ velocity = &velocities[i];
+ position->x += velocity->x;
+ if ( (position->x < 0) || (position->x >= (screen->w - sprite_w)) ) {
+ velocity->x = -velocity->x;
+ position->x += velocity->x;
+ }
+ position->y += velocity->y;
+ if ( (position->y < 0) || (position->y >= (screen->h - sprite_w)) ) {
+ velocity->y = -velocity->y;
+ position->y += velocity->y;
+ }
+
+ /* Blit the sprite onto the screen */
+ area = *position;
+ SDL_BlitSurface(sprite, NULL, screen, &area);
+ sprite_rects[nupdates++] = area;
+ }
+
+ if (debug_flip) {
+ if ( (screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
+ static int t = 0;
+
+ Uint32 color = SDL_MapRGB (screen->format, 255, 0, 0);
+ SDL_Rect r;
+ r.x = (sin((float)t * 2 * 3.1459) + 1.0) / 2.0 * (screen->w-20);
+ r.y = 0;
+ r.w = 20;
+ r.h = screen->h;
+
+ SDL_FillRect (screen, &r, color);
+ t+=2;
+ }
+ }
+
+ /* Update the screen! */
+ if ( (screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
+ SDL_Flip(screen);
+ } else {
+ SDL_UpdateRects(screen, nupdates, sprite_rects);
+ }
+ sprites_visible = 1;
+}
+
+/* This is a way of telling whether or not to use hardware surfaces */
+Uint32 FastestFlags(Uint32 flags, int width, int height, int bpp)
+{
+ const SDL_VideoInfo *info;
+
+ /* Hardware acceleration is only used in fullscreen mode */
+ flags |= SDL_FULLSCREEN;
+
+ /* Check for various video capabilities */
+ info = SDL_GetVideoInfo();
+ if ( info->blit_hw_CC && info->blit_fill ) {
+ /* We use accelerated colorkeying and color filling */
+ flags |= SDL_HWSURFACE;
+ }
+ /* If we have enough video memory, and will use accelerated
+ blits directly to it, then use page flipping.
+ */
+ if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
+ /* Direct hardware blitting without double-buffering
+ causes really bad flickering.
+ */
+ if ( info->video_mem*1024 > (height*width*bpp/8) ) {
+ flags |= SDL_DOUBLEBUF;
+ } else {
+ flags &= ~SDL_HWSURFACE;
+ }
+ }
+
+ /* Return the flags */
+ return(flags);
+}
+
+int main(int argc, char *argv[])
+{
+ SDL_Surface *screen;
+ Uint8 *mem;
+ int width, height;
+ Uint8 video_bpp;
+ Uint32 videoflags;
+ Uint32 background;
+ int i, done;
+ SDL_Event event;
+ Uint32 then, now, frames;
+
+ /* Initialize SDL */
+ if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
+ fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
+ return(1);
+ }
+
+ numsprites = NUM_SPRITES;
+ videoflags = SDL_SWSURFACE|SDL_ANYFORMAT;
+ width = 640;
+ height = 480;
+ video_bpp = 8;
+ debug_flip = 0;
+ while ( argc > 1 ) {
+ --argc;
+ if ( strcmp(argv[argc-1], "-width") == 0 ) {
+ width = atoi(argv[argc]);
+ --argc;
+ } else
+ if ( strcmp(argv[argc-1], "-height") == 0 ) {
+ height = atoi(argv[argc]);
+ --argc;
+ } else
+ if ( strcmp(argv[argc-1], "-bpp") == 0 ) {
+ video_bpp = atoi(argv[argc]);
+ videoflags &= ~SDL_ANYFORMAT;
+ --argc;
+ } else
+ if ( strcmp(argv[argc], "-fast") == 0 ) {
+ videoflags = FastestFlags(videoflags, width, height, video_bpp);
+ } else
+ if ( strcmp(argv[argc], "-hw") == 0 ) {
+ videoflags ^= SDL_HWSURFACE;
+ } else
+ if ( strcmp(argv[argc], "-flip") == 0 ) {
+ videoflags ^= SDL_DOUBLEBUF;
+ } else
+ if ( strcmp(argv[argc], "-debugflip") == 0 ) {
+ debug_flip ^= 1;
+ } else
+ if ( strcmp(argv[argc], "-fullscreen") == 0 ) {
+ videoflags ^= SDL_FULLSCREEN;
+ } else
+ if ( isdigit(argv[argc][0]) ) {
+ numsprites = atoi(argv[argc]);
+ } else {
+ fprintf(stderr,
+ "Usage: %s [-bpp N] [-hw] [-flip] [-fast] [-fullscreen] [numsprites]\n",
+ argv[0]);
+ quit(1);
+ }
+ }
+
+ /* Set video mode */
+ screen = SDL_SetVideoMode(width, height, video_bpp, videoflags);
+ if ( ! screen ) {
+ fprintf(stderr, "Couldn't set %dx%d video mode: %s\n",
+ width, height, SDL_GetError());
+ quit(2);
+ }
+
+ /* Load the sprite */
+ if ( LoadSprite("icon.bmp") < 0 ) {
+ quit(1);
+ }
+
+ /* Allocate memory for the sprite info */
+ mem = (Uint8 *)malloc(4*sizeof(SDL_Rect)*numsprites);
+ if ( mem == NULL ) {
+ SDL_FreeSurface(sprite);
+ fprintf(stderr, "Out of memory!\n");
+ quit(2);
+ }
+ sprite_rects = (SDL_Rect *)mem;
+ positions = sprite_rects;
+ sprite_rects += numsprites;
+ velocities = sprite_rects;
+ sprite_rects += numsprites;
+ sprite_w = sprite->w;
+ sprite_h = sprite->h;
+ srand(time(NULL));
+ for ( i=0; i<numsprites; ++i ) {
+ positions[i].x = rand()%(screen->w - sprite_w);
+ positions[i].y = rand()%(screen->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;
+ }
+ }
+ background = SDL_MapRGB(screen->format, 0x00, 0x00, 0x00);
+
+ /* Print out information about our surfaces */
+ printf("Screen is at %d bits per pixel\n",screen->format->BitsPerPixel);
+ if ( (screen->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
+ printf("Screen is in video memory\n");
+ } else {
+ printf("Screen is in system memory\n");
+ }
+ if ( (screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
+ printf("Screen has double-buffering enabled\n");
+ }
+ if ( (sprite->flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
+ printf("Sprite is in video memory\n");
+ } else {
+ printf("Sprite is in system memory\n");
+ }
+ /* Run a sample blit to trigger blit acceleration */
+ { SDL_Rect dst;
+ dst.x = 0;
+ dst.y = 0;
+ dst.w = sprite->w;
+ dst.h = sprite->h;
+ SDL_BlitSurface(sprite, NULL, screen, &dst);
+ SDL_FillRect(screen, &dst, background);
+ }
+ if ( (sprite->flags & SDL_HWACCEL) == SDL_HWACCEL ) {
+ printf("Sprite blit uses hardware acceleration\n");
+ }
+ if ( (sprite->flags & SDL_RLEACCEL) == SDL_RLEACCEL ) {
+ printf("Sprite blit uses RLE acceleration\n");
+ }
+
+ /* Loop, blitting sprites and waiting for a keystroke */
+ frames = 0;
+ then = SDL_GetTicks();
+ done = 0;
+ sprites_visible = 0;
+ while ( !done ) {
+ /* Check for events */
+ ++frames;
+ while ( SDL_PollEvent(&event) ) {
+ switch (event.type) {
+ case SDL_MOUSEBUTTONDOWN:
+ SDL_WarpMouse(screen->w/2, screen->h/2);
+ break;
+ case SDL_KEYDOWN:
+ /* Any keypress quits the app... */
+ case SDL_QUIT:
+ done = 1;
+ break;
+ default:
+ break;
+ }
+ }
+ MoveSprites(screen, background);
+ }
+ SDL_FreeSurface(sprite);
+ free(mem);
+
+ /* Print out some timing information */
+ now = SDL_GetTicks();
+ if ( now > then ) {
+ printf("%2.2f frames per second\n",
+ ((double)frames*1000)/(now-then));
+ }
+ SDL_Quit();
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/test/testtimer.c b/distrib/sdl-1.2.15/test/testtimer.c
new file mode 100644
index 0000000..95608c1
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testtimer.c
@@ -0,0 +1,87 @@
+
+/* Test program to check the resolution of the SDL timer on the current
+ platform
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "SDL.h"
+
+#define DEFAULT_RESOLUTION 1
+
+static int ticks = 0;
+
+static Uint32 SDLCALL ticktock(Uint32 interval)
+{
+ ++ticks;
+ return(interval);
+}
+
+static Uint32 SDLCALL callback(Uint32 interval, void *param)
+{
+ printf("Timer %d : param = %d\n", interval, (int)(uintptr_t)param);
+ return interval;
+}
+
+int main(int argc, char *argv[])
+{
+ int desired;
+ SDL_TimerID t1, t2, t3;
+
+ if ( SDL_Init(SDL_INIT_TIMER) < 0 ) {
+ fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
+ return(1);
+ }
+
+ /* Start the timer */
+ desired = 0;
+ if ( argv[1] ) {
+ desired = atoi(argv[1]);
+ }
+ if ( desired == 0 ) {
+ desired = DEFAULT_RESOLUTION;
+ }
+ SDL_SetTimer(desired, ticktock);
+
+ /* Wait 10 seconds */
+ printf("Waiting 10 seconds\n");
+ SDL_Delay(10*1000);
+
+ /* Stop the timer */
+ SDL_SetTimer(0, NULL);
+
+ /* Print the results */
+ if ( ticks ) {
+ fprintf(stderr,
+ "Timer resolution: desired = %d ms, actual = %f ms\n",
+ desired, (double)(10*1000)/ticks);
+ }
+
+ /* Test multiple timers */
+ printf("Testing multiple timers...\n");
+ t1 = SDL_AddTimer(100, callback, (void*)1);
+ if(!t1)
+ fprintf(stderr,"Could not create timer 1: %s\n", SDL_GetError());
+ t2 = SDL_AddTimer(50, callback, (void*)2);
+ if(!t2)
+ fprintf(stderr,"Could not create timer 2: %s\n", SDL_GetError());
+ t3 = SDL_AddTimer(233, callback, (void*)3);
+ if(!t3)
+ fprintf(stderr,"Could not create timer 3: %s\n", SDL_GetError());
+
+ /* Wait 10 seconds */
+ printf("Waiting 10 seconds\n");
+ SDL_Delay(10*1000);
+
+ printf("Removing timer 1 and waiting 5 more seconds\n");
+ SDL_RemoveTimer(t1);
+
+ SDL_Delay(5*1000);
+
+ SDL_RemoveTimer(t2);
+ SDL_RemoveTimer(t3);
+
+ SDL_Quit();
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/test/testver.c b/distrib/sdl-1.2.15/test/testver.c
new file mode 100644
index 0000000..4f45ffe
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testver.c
@@ -0,0 +1,37 @@
+
+/* Test program to compare the compile-time version of SDL with the linked
+ version of SDL
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "SDL.h"
+
+int main(int argc, char *argv[])
+{
+ SDL_version compiled;
+
+ /* Initialize SDL */
+ if ( SDL_Init(0) < 0 ) {
+ fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
+ exit(1);
+ }
+#ifdef DEBUG
+ fprintf(stderr, "SDL initialized\n");
+#endif
+#if SDL_VERSION_ATLEAST(1, 2, 0)
+ printf("Compiled with SDL 1.2 or newer\n");
+#else
+ printf("Compiled with SDL older than 1.2\n");
+#endif
+ SDL_VERSION(&compiled);
+ printf("Compiled version: %d.%d.%d\n",
+ compiled.major, compiled.minor, compiled.patch);
+ printf("Linked version: %d.%d.%d\n",
+ SDL_Linked_Version()->major,
+ SDL_Linked_Version()->minor,
+ SDL_Linked_Version()->patch);
+ SDL_Quit();
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/test/testvidinfo.c b/distrib/sdl-1.2.15/test/testvidinfo.c
new file mode 100644
index 0000000..bbafeb8
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testvidinfo.c
@@ -0,0 +1,465 @@
+
+/* Simple program -- figure out what kind of video display we have */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "SDL.h"
+
+#define NUM_BLITS 10
+#define NUM_UPDATES 500
+
+#define FLAG_MASK (SDL_HWSURFACE | SDL_FULLSCREEN | SDL_DOUBLEBUF | \
+ SDL_SRCCOLORKEY | SDL_SRCALPHA | SDL_RLEACCEL | \
+ SDL_RLEACCELOK)
+
+void PrintFlags(Uint32 flags)
+{
+ printf("0x%8.8x", (flags & FLAG_MASK));
+ if ( flags & SDL_HWSURFACE ) {
+ printf(" SDL_HWSURFACE");
+ } else {
+ printf(" SDL_SWSURFACE");
+ }
+ if ( flags & SDL_FULLSCREEN ) {
+ printf(" | SDL_FULLSCREEN");
+ }
+ if ( flags & SDL_DOUBLEBUF ) {
+ printf(" | SDL_DOUBLEBUF");
+ }
+ if ( flags & SDL_SRCCOLORKEY ) {
+ printf(" | SDL_SRCCOLORKEY");
+ }
+ if ( flags & SDL_SRCALPHA ) {
+ printf(" | SDL_SRCALPHA");
+ }
+ if ( flags & SDL_RLEACCEL ) {
+ printf(" | SDL_RLEACCEL");
+ }
+ if ( flags & SDL_RLEACCELOK ) {
+ printf(" | SDL_RLEACCELOK");
+ }
+}
+
+int RunBlitTests(SDL_Surface *screen, SDL_Surface *bmp, int blitcount)
+{
+ int i, j;
+ int maxx;
+ int maxy;
+ SDL_Rect dst;
+
+ maxx = (int)screen->w - bmp->w + 1;
+ maxy = (int)screen->h - bmp->h + 1;
+ for ( i = 0; i < NUM_UPDATES; ++i ) {
+ for ( j = 0; j < blitcount; ++j ) {
+ if ( maxx ) {
+ dst.x = rand() % maxx;
+ } else {
+ dst.x = 0;
+ }
+ if ( maxy ) {
+ dst.y = rand() % maxy;
+ } else {
+ dst.y = 0;
+ }
+ dst.w = bmp->w;
+ dst.h = bmp->h;
+ SDL_BlitSurface(bmp, NULL, screen, &dst);
+ }
+ SDL_Flip(screen);
+ }
+
+ return i;
+}
+
+int RunModeTests(SDL_Surface *screen)
+{
+ Uint32 then, now;
+ Uint32 frames;
+ float seconds;
+ int i;
+ Uint8 r, g, b;
+ SDL_Surface *bmp, *bmpcc, *tmp;
+ SDL_Event event;
+
+ while ( SDL_PollEvent(&event) ) {
+ if ( event.type == SDL_KEYDOWN )
+ return 0;
+ }
+
+ /* First test fills and screen update speed */
+ printf("Running color fill and fullscreen update test\n");
+ then = SDL_GetTicks();
+ frames = 0;
+ for ( i = 0; i < 256; ++i ) {
+ r = i;
+ g = 0;
+ b = 0;
+ SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, r, g, b));
+ SDL_Flip(screen);
+ ++frames;
+ }
+ for ( i = 0; i < 256; ++i ) {
+ r = 0;
+ g = i;
+ b = 0;
+ SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, r, g, b));
+ SDL_Flip(screen);
+ ++frames;
+ }
+ for ( i = 0; i < 256; ++i ) {
+ r = 0;
+ g = 0;
+ b = i;
+ SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, r, g, b));
+ SDL_Flip(screen);
+ ++frames;
+ }
+ now = SDL_GetTicks();
+ seconds = (float)(now - then) / 1000.0f;
+ if ( seconds > 0.0f ) {
+ printf("%d fills and flips in %2.2f seconds, %2.2f FPS\n", frames, seconds, (float)frames / seconds);
+ } else {
+ printf("%d fills and flips in zero seconds!n", frames);
+ }
+
+ /* clear the screen after fill test */
+ SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 0, 0, 0));
+ SDL_Flip(screen);
+
+ while ( SDL_PollEvent(&event) ) {
+ if ( event.type == SDL_KEYDOWN )
+ return 0;
+ }
+
+ /* run the generic blit test */
+ bmp = SDL_LoadBMP("sample.bmp");
+ if ( ! bmp ) {
+ printf("Couldn't load sample.bmp: %s\n", SDL_GetError());
+ return 0;
+ }
+ printf("Running freshly loaded blit test: %dx%d at %d bpp, flags: ",
+ bmp->w, bmp->h, bmp->format->BitsPerPixel);
+ PrintFlags(bmp->flags);
+ printf("\n");
+ then = SDL_GetTicks();
+ frames = RunBlitTests(screen, bmp, NUM_BLITS);
+ now = SDL_GetTicks();
+ seconds = (float)(now - then) / 1000.0f;
+ if ( seconds > 0.0f ) {
+ printf("%d blits / %d updates in %2.2f seconds, %2.2f FPS\n", NUM_BLITS*frames, frames, seconds, (float)frames / seconds);
+ } else {
+ printf("%d blits / %d updates in zero seconds!\n", NUM_BLITS*frames, frames);
+ }
+
+ /* clear the screen after blit test */
+ SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 0, 0, 0));
+ SDL_Flip(screen);
+
+ while ( SDL_PollEvent(&event) ) {
+ if ( event.type == SDL_KEYDOWN )
+ return 0;
+ }
+
+ /* run the colorkeyed blit test */
+ bmpcc = SDL_LoadBMP("sample.bmp");
+ if ( ! bmpcc ) {
+ printf("Couldn't load sample.bmp: %s\n", SDL_GetError());
+ return 0;
+ }
+ printf("Running freshly loaded cc blit test: %dx%d at %d bpp, flags: ",
+ bmpcc->w, bmpcc->h, bmpcc->format->BitsPerPixel);
+ SDL_SetColorKey(bmpcc, SDL_SRCCOLORKEY | SDL_RLEACCEL, *(Uint8 *)bmpcc->pixels);
+
+ PrintFlags(bmpcc->flags);
+ printf("\n");
+ then = SDL_GetTicks();
+ frames = RunBlitTests(screen, bmpcc, NUM_BLITS);
+ now = SDL_GetTicks();
+ seconds = (float)(now - then) / 1000.0f;
+ if ( seconds > 0.0f ) {
+ printf("%d cc blits / %d updates in %2.2f seconds, %2.2f FPS\n", NUM_BLITS*frames, frames, seconds, (float)frames / seconds);
+ } else {
+ printf("%d cc blits / %d updates in zero seconds!\n", NUM_BLITS*frames, frames);
+ }
+
+ /* clear the screen after cc blit test */
+ SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 0, 0, 0));
+ SDL_Flip(screen);
+
+ while ( SDL_PollEvent(&event) ) {
+ if ( event.type == SDL_KEYDOWN )
+ return 0;
+ }
+
+ /* run the generic blit test */
+ tmp = bmp;
+ bmp = SDL_DisplayFormat(bmp);
+ SDL_FreeSurface(tmp);
+ if ( ! bmp ) {
+ printf("Couldn't convert sample.bmp: %s\n", SDL_GetError());
+ return 0;
+ }
+ printf("Running display format blit test: %dx%d at %d bpp, flags: ",
+ bmp->w, bmp->h, bmp->format->BitsPerPixel);
+ PrintFlags(bmp->flags);
+ printf("\n");
+ then = SDL_GetTicks();
+ frames = RunBlitTests(screen, bmp, NUM_BLITS);
+ now = SDL_GetTicks();
+ seconds = (float)(now - then) / 1000.0f;
+ if ( seconds > 0.0f ) {
+ printf("%d blits / %d updates in %2.2f seconds, %2.2f FPS\n", NUM_BLITS*frames, frames, seconds, (float)frames / seconds);
+ } else {
+ printf("%d blits / %d updates in zero seconds!\n", NUM_BLITS*frames, frames);
+ }
+
+ /* clear the screen after blit test */
+ SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 0, 0, 0));
+ SDL_Flip(screen);
+
+ while ( SDL_PollEvent(&event) ) {
+ if ( event.type == SDL_KEYDOWN )
+ return 0;
+ }
+
+ /* run the colorkeyed blit test */
+ tmp = bmpcc;
+ bmpcc = SDL_DisplayFormat(bmpcc);
+ SDL_FreeSurface(tmp);
+ if ( ! bmpcc ) {
+ printf("Couldn't convert sample.bmp: %s\n", SDL_GetError());
+ return 0;
+ }
+ printf("Running display format cc blit test: %dx%d at %d bpp, flags: ",
+ bmpcc->w, bmpcc->h, bmpcc->format->BitsPerPixel);
+ PrintFlags(bmpcc->flags);
+ printf("\n");
+ then = SDL_GetTicks();
+ frames = RunBlitTests(screen, bmpcc, NUM_BLITS);
+ now = SDL_GetTicks();
+ seconds = (float)(now - then) / 1000.0f;
+ if ( seconds > 0.0f ) {
+ printf("%d cc blits / %d updates in %2.2f seconds, %2.2f FPS\n", NUM_BLITS*frames, frames, seconds, (float)frames / seconds);
+ } else {
+ printf("%d cc blits / %d updates in zero seconds!\n", NUM_BLITS*frames, frames);
+ }
+
+ /* clear the screen after cc blit test */
+ SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 0, 0, 0));
+ SDL_Flip(screen);
+
+ while ( SDL_PollEvent(&event) ) {
+ if ( event.type == SDL_KEYDOWN )
+ return 0;
+ }
+
+ /* run the alpha blit test only if screen bpp>8 */
+ if (bmp->format->BitsPerPixel>8)
+ {
+ SDL_FreeSurface(bmp);
+ bmp = SDL_LoadBMP("sample.bmp");
+ SDL_SetAlpha(bmp, SDL_SRCALPHA, 85); /* 85 - 33% alpha */
+ tmp = bmp;
+ bmp = SDL_DisplayFormat(bmp);
+ SDL_FreeSurface(tmp);
+ if ( ! bmp ) {
+ printf("Couldn't convert sample.bmp: %s\n", SDL_GetError());
+ return 0;
+ }
+ printf("Running display format alpha blit test: %dx%d at %d bpp, flags: ",
+ bmp->w, bmp->h, bmp->format->BitsPerPixel);
+ PrintFlags(bmp->flags);
+ printf("\n");
+ then = SDL_GetTicks();
+ frames = RunBlitTests(screen, bmp, NUM_BLITS);
+ now = SDL_GetTicks();
+ seconds = (float)(now - then) / 1000.0f;
+ if ( seconds > 0.0f ) {
+ printf("%d alpha blits / %d updates in %2.2f seconds, %2.2f FPS\n", NUM_BLITS*frames, frames, seconds, (float)frames / seconds);
+ } else {
+ printf("%d alpha blits / %d updates in zero seconds!\n", NUM_BLITS*frames, frames);
+ }
+ }
+
+ /* clear the screen after alpha blit test */
+ SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, 0, 0, 0));
+ SDL_Flip(screen);
+
+ while ( SDL_PollEvent(&event) ) {
+ if ( event.type == SDL_KEYDOWN )
+ return 0;
+ }
+
+ /* run the cc+alpha blit test only if screen bpp>8 */
+ if (bmp->format->BitsPerPixel>8)
+ {
+ SDL_FreeSurface(bmpcc);
+ bmpcc = SDL_LoadBMP("sample.bmp");
+ SDL_SetAlpha(bmpcc, SDL_SRCALPHA, 85); /* 85 - 33% alpha */
+ SDL_SetColorKey(bmpcc, SDL_SRCCOLORKEY | SDL_RLEACCEL, *(Uint8 *)bmpcc->pixels);
+ tmp = bmpcc;
+ bmpcc = SDL_DisplayFormat(bmpcc);
+ SDL_FreeSurface(tmp);
+ if ( ! bmpcc ) {
+ printf("Couldn't convert sample.bmp: %s\n", SDL_GetError());
+ return 0;
+ }
+ printf("Running display format cc+alpha blit test: %dx%d at %d bpp, flags: ",
+ bmpcc->w, bmpcc->h, bmpcc->format->BitsPerPixel);
+ PrintFlags(bmpcc->flags);
+ printf("\n");
+ then = SDL_GetTicks();
+ frames = RunBlitTests(screen, bmpcc, NUM_BLITS);
+ now = SDL_GetTicks();
+ seconds = (float)(now - then) / 1000.0f;
+ if ( seconds > 0.0f ) {
+ printf("%d cc+alpha blits / %d updates in %2.2f seconds, %2.2f FPS\n", NUM_BLITS*frames, frames, seconds, (float)frames / seconds);
+ } else {
+ printf("%d cc+alpha blits / %d updates in zero seconds!\n", NUM_BLITS*frames, frames);
+ }
+ }
+
+ SDL_FreeSurface(bmpcc);
+ SDL_FreeSurface(bmp);
+
+ while ( SDL_PollEvent(&event) ) {
+ if ( event.type == SDL_KEYDOWN )
+ return 0;
+ }
+ return 1;
+}
+
+void RunVideoTests()
+{
+ static const struct {
+ int w, h, bpp;
+ } mode_list[] = {
+ { 640, 480, 8 }, { 640, 480, 16 }, { 640, 480, 32 },
+ { 800, 600, 8 }, { 800, 600, 16 }, { 800, 600, 32 },
+ { 1024, 768, 8 }, { 1024, 768, 16 }, { 1024, 768, 32 }
+ };
+ static const Uint32 flags[] = {
+ (SDL_SWSURFACE),
+ (SDL_SWSURFACE | SDL_FULLSCREEN),
+ (SDL_HWSURFACE | SDL_FULLSCREEN),
+ (SDL_HWSURFACE | SDL_FULLSCREEN | SDL_DOUBLEBUF)
+ };
+ int i, j;
+ SDL_Surface *screen;
+
+ /* Test out several different video mode combinations */
+ SDL_WM_SetCaption("SDL Video Benchmark", "vidtest");
+ SDL_ShowCursor(0);
+ for ( i = 0; i < SDL_TABLESIZE(mode_list); ++i ) {
+ for ( j = 0; j < SDL_TABLESIZE(flags); ++j ) {
+ printf("===================================\n");
+ printf("Setting video mode: %dx%d at %d bpp, flags: ",
+ mode_list[i].w,
+ mode_list[i].h,
+ mode_list[i].bpp);
+ PrintFlags(flags[j]);
+ printf("\n");
+ screen = SDL_SetVideoMode(mode_list[i].w,
+ mode_list[i].h,
+ mode_list[i].bpp,
+ flags[j]);
+ if ( ! screen ) {
+ printf("Setting video mode failed: %s\n", SDL_GetError());
+ continue;
+ }
+ if ( (screen->flags & FLAG_MASK) != flags[j] ) {
+ printf("Flags didn't match: ");
+ PrintFlags(screen->flags);
+ printf("\n");
+ continue;
+ }
+ if ( ! RunModeTests(screen) ) {
+ return;
+ }
+ }
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ const SDL_VideoInfo *info;
+ int i;
+ SDL_Rect **modes;
+ char driver[128];
+
+ if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
+ fprintf(stderr,
+ "Couldn't initialize SDL: %s\n", SDL_GetError());
+ exit(1);
+ }
+ if ( SDL_VideoDriverName(driver, sizeof(driver)) ) {
+ printf("Video driver: %s\n", driver);
+ }
+ info = SDL_GetVideoInfo();
+ printf(
+"Current display: %dx%d, %d bits-per-pixel\n",
+ info->current_w, info->current_h, info->vfmt->BitsPerPixel);
+ if ( info->vfmt->palette == NULL ) {
+ printf(" Red Mask = 0x%.8x\n", info->vfmt->Rmask);
+ printf(" Green Mask = 0x%.8x\n", info->vfmt->Gmask);
+ printf(" Blue Mask = 0x%.8x\n", info->vfmt->Bmask);
+ }
+ /* Print available fullscreen video modes */
+ modes = SDL_ListModes(NULL, SDL_FULLSCREEN);
+ if ( modes == (SDL_Rect **)0 ) {
+ printf("No available fullscreen video modes\n");
+ } else
+ if ( modes == (SDL_Rect **)-1 ) {
+ printf("No special fullscreen video modes\n");
+ } else {
+ printf("Fullscreen video modes:\n");
+ for ( i=0; modes[i]; ++i ) {
+ printf("\t%dx%dx%d\n", modes[i]->w, modes[i]->h, info->vfmt->BitsPerPixel);
+ }
+ }
+ if ( info->wm_available ) {
+ printf("A window manager is available\n");
+ }
+ if ( info->hw_available ) {
+ printf("Hardware surfaces are available (%dK video memory)\n",
+ info->video_mem);
+ }
+ if ( info->blit_hw ) {
+ printf(
+"Copy blits between hardware surfaces are accelerated\n");
+ }
+ if ( info->blit_hw_CC ) {
+ printf(
+"Colorkey blits between hardware surfaces are accelerated\n");
+ }
+ if ( info->blit_hw_A ) {
+ printf(
+"Alpha blits between hardware surfaces are accelerated\n");
+ }
+ if ( info->blit_sw ) {
+ printf(
+"Copy blits from software surfaces to hardware surfaces are accelerated\n");
+ }
+ if ( info->blit_sw_CC ) {
+ printf(
+"Colorkey blits from software surfaces to hardware surfaces are accelerated\n");
+ }
+ if ( info->blit_sw_A ) {
+ printf(
+"Alpha blits from software surfaces to hardware surfaces are accelerated\n");
+ }
+ if ( info->blit_fill ) {
+ printf(
+"Color fills on hardware surfaces are accelerated\n");
+ }
+
+ if ( argv[1] && (strcmp(argv[1], "-benchmark") == 0) ) {
+ RunVideoTests();
+ }
+
+ SDL_Quit();
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/test/testwin.c b/distrib/sdl-1.2.15/test/testwin.c
new file mode 100644
index 0000000..261ea99
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testwin.c
@@ -0,0 +1,377 @@
+
+/* Bring up a window and play with it */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#define BENCHMARK_SDL
+
+#define NOTICE(X) printf("%s", X);
+
+#include "SDL.h"
+
+/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
+static void quit(int rc)
+{
+ SDL_Quit();
+ exit(rc);
+}
+
+void DrawPict(SDL_Surface *screen, char *bmpfile,
+ int speedy, int flip, int nofade)
+{
+ SDL_Surface *picture;
+ SDL_Rect dest, update;
+ int i, centered;
+ int ncolors;
+ SDL_Color *colors, *cmap;
+
+ /* Load the image into a surface */
+ if ( bmpfile == NULL ) {
+ bmpfile = "sample.bmp"; /* Sample image */
+ }
+fprintf(stderr, "Loading picture: %s\n", bmpfile);
+ picture = SDL_LoadBMP(bmpfile);
+ if ( picture == NULL ) {
+ fprintf(stderr, "Couldn't load %s: %s\n", bmpfile,
+ SDL_GetError());
+ return;
+ }
+
+ /* Set the display colors -- on a hicolor display this is a no-op */
+ if ( picture->format->palette ) {
+ ncolors = picture->format->palette->ncolors;
+ colors = (SDL_Color *)malloc(ncolors*sizeof(SDL_Color));
+ cmap = (SDL_Color *)malloc(ncolors*sizeof(SDL_Color));
+ memcpy(colors, picture->format->palette->colors,
+ ncolors*sizeof(SDL_Color));
+ } else {
+ int r, g, b;
+
+ /* Allocate 256 color palette */
+ ncolors = 256;
+ colors = (SDL_Color *)malloc(ncolors*sizeof(SDL_Color));
+ cmap = (SDL_Color *)malloc(ncolors*sizeof(SDL_Color));
+
+ /* Set a 3,3,2 color cube */
+ for ( r=0; r<8; ++r ) {
+ for ( g=0; g<8; ++g ) {
+ for ( b=0; b<4; ++b ) {
+ i = ((r<<5)|(g<<2)|b);
+ colors[i].r = r<<5;
+ colors[i].g = g<<5;
+ colors[i].b = b<<6;
+ }
+ }
+ }
+ }
+NOTICE("testwin: setting colors\n");
+ if ( ! SDL_SetColors(screen, colors, 0, ncolors) &&
+ (screen->format->palette != NULL) ) {
+ fprintf(stderr,
+"Warning: Couldn't set all of the colors, but SDL will map the image\n"
+" (colormap fading will suffer - try the -warp option)\n"
+ );
+ }
+
+ /* Set the screen to black (not really necessary) */
+ if ( SDL_LockSurface(screen) == 0 ) {
+ Uint32 black;
+ Uint8 *pixels;
+
+ black = SDL_MapRGB(screen->format, 0, 0, 0);
+ pixels = (Uint8 *)screen->pixels;
+ for ( i=0; i<screen->h; ++i ) {
+ memset(pixels, black,
+ screen->w*screen->format->BytesPerPixel);
+ pixels += screen->pitch;
+ }
+ SDL_UnlockSurface(screen);
+ SDL_UpdateRect(screen, 0, 0, 0, 0);
+ }
+
+ /* Display the picture */
+ if ( speedy ) {
+ SDL_Surface *displayfmt;
+
+fprintf(stderr, "Converting picture\n");
+ displayfmt = SDL_DisplayFormat(picture);
+ if ( displayfmt == NULL ) {
+ fprintf(stderr,
+ "Couldn't convert image: %s\n", SDL_GetError());
+ goto done;
+ }
+ SDL_FreeSurface(picture);
+ picture = displayfmt;
+ }
+ printf("(image surface located in %s memory)\n",
+ (picture->flags&SDL_HWSURFACE) ? "video" : "system");
+ centered = (screen->w - picture->w)/2;
+ if ( centered < 0 ) {
+ centered = 0;
+ }
+ dest.y = (screen->h - picture->h)/2;
+ dest.w = picture->w;
+ dest.h = picture->h;
+NOTICE("testwin: moving image\n");
+ for ( i=0; i<=centered; ++i ) {
+ dest.x = i;
+ update = dest;
+ if ( SDL_BlitSurface(picture, NULL, screen, &update) < 0 ) {
+ fprintf(stderr, "Blit failed: %s\n", SDL_GetError());
+ break;
+ }
+ if ( flip ) {
+ SDL_Flip(screen);
+ } else {
+ SDL_UpdateRects(screen, 1, &update);
+ }
+ }
+
+#ifdef SCREENSHOT
+ if ( SDL_SaveBMP(screen, "screen.bmp") < 0 )
+ printf("Couldn't save screen: %s\n", SDL_GetError());
+#endif
+
+#ifndef BENCHMARK_SDL
+ /* Let it sit there for a while */
+ SDL_Delay(5*1000);
+#endif
+ /* Fade the colormap */
+ if ( ! nofade ) {
+ int maxstep;
+ SDL_Color final;
+ SDL_Color palcolors[256];
+ struct {
+ Sint16 r, g, b;
+ } cdist[256];
+
+NOTICE("testwin: fading out...\n");
+ memcpy(cmap, colors, ncolors*sizeof(SDL_Color));
+ maxstep = 32-1;
+ final.r = 0xFF;
+ final.g = 0x00;
+ final.b = 0x00;
+ memcpy(palcolors, colors, ncolors*sizeof(SDL_Color));
+ for ( i=0; i<ncolors; ++i ) {
+ cdist[i].r = final.r-palcolors[i].r;
+ cdist[i].g = final.g-palcolors[i].g;
+ cdist[i].b = final.b-palcolors[i].b;
+ }
+ for ( i=0; i<=maxstep/2; ++i ) { /* halfway fade */
+ int c;
+ for ( c=0; c<ncolors; ++c ) {
+ colors[c].r =
+ palcolors[c].r+((cdist[c].r*i))/maxstep;
+ colors[c].g =
+ palcolors[c].g+((cdist[c].g*i))/maxstep;
+ colors[c].b =
+ palcolors[c].b+((cdist[c].b*i))/maxstep;
+ }
+ SDL_SetColors(screen, colors, 0, ncolors);
+ SDL_Delay(1);
+ }
+ final.r = 0x00;
+ final.g = 0x00;
+ final.b = 0x00;
+ memcpy(palcolors, colors, ncolors*sizeof(SDL_Color));
+ for ( i=0; i<ncolors; ++i ) {
+ cdist[i].r = final.r-palcolors[i].r;
+ cdist[i].g = final.g-palcolors[i].g;
+ cdist[i].b = final.b-palcolors[i].b;
+ }
+ maxstep /= 2;
+ for ( i=0; i<=maxstep; ++i ) { /* finish fade out */
+ int c;
+ for ( c=0; c<ncolors; ++c ) {
+ colors[c].r =
+ palcolors[c].r+((cdist[c].r*i))/maxstep;
+ colors[c].g =
+ palcolors[c].g+((cdist[c].g*i))/maxstep;
+ colors[c].b =
+ palcolors[c].b+((cdist[c].b*i))/maxstep;
+ }
+ SDL_SetColors(screen, colors, 0, ncolors);
+ SDL_Delay(1);
+ }
+ for ( i=0; i<ncolors; ++i ) {
+ colors[i].r = final.r;
+ colors[i].g = final.g;
+ colors[i].b = final.b;
+ }
+ SDL_SetColors(screen, colors, 0, ncolors);
+NOTICE("testwin: fading in...\n");
+ memcpy(palcolors, colors, ncolors*sizeof(SDL_Color));
+ for ( i=0; i<ncolors; ++i ) {
+ cdist[i].r = cmap[i].r-palcolors[i].r;
+ cdist[i].g = cmap[i].g-palcolors[i].g;
+ cdist[i].b = cmap[i].b-palcolors[i].b;
+ }
+ for ( i=0; i<=maxstep; ++i ) { /* 32 step fade in */
+ int c;
+ for ( c=0; c<ncolors; ++c ) {
+ colors[c].r =
+ palcolors[c].r+((cdist[c].r*i))/maxstep;
+ colors[c].g =
+ palcolors[c].g+((cdist[c].g*i))/maxstep;
+ colors[c].b =
+ palcolors[c].b+((cdist[c].b*i))/maxstep;
+ }
+ SDL_SetColors(screen, colors, 0, ncolors);
+ SDL_Delay(1);
+ }
+NOTICE("testwin: fading over\n");
+ }
+
+done:
+ /* Free the picture and return */
+ SDL_FreeSurface(picture);
+ free(colors); free(cmap);
+ return;
+}
+
+int main(int argc, char *argv[])
+{
+ SDL_Surface *screen;
+ /* Options */
+ int speedy, flip, nofade;
+ int delay;
+ int w, h;
+ int desired_bpp;
+ Uint32 video_flags;
+#ifdef BENCHMARK_SDL
+ Uint32 then, now;
+#endif
+ /* Set default options and check command-line */
+ speedy = 0;
+ flip = 0;
+ nofade = 0;
+ delay = 1;
+
+#ifdef _WIN32_WCE
+ w = 240;
+ h = 320;
+ desired_bpp = 8;
+ video_flags = SDL_FULLSCREEN;
+#else
+ w = 640;
+ h = 480;
+ desired_bpp = 0;
+ video_flags = 0;
+#endif
+ if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
+ fprintf(stderr,
+ "Couldn't initialize SDL: %s\n", SDL_GetError());
+ return(1);
+ }
+
+ while ( argc > 1 ) {
+ if ( strcmp(argv[1], "-speedy") == 0 ) {
+ speedy = 1;
+ argv += 1;
+ argc -= 1;
+ } else
+ if ( strcmp(argv[1], "-nofade") == 0 ) {
+ nofade = 1;
+ argv += 1;
+ argc -= 1;
+ } else
+ if ( strcmp(argv[1], "-delay") == 0 ) {
+ if ( argv[2] ) {
+ delay = atoi(argv[2]);
+ argv += 2;
+ argc -= 2;
+ } else {
+ fprintf(stderr,
+ "The -delay option requires an argument\n");
+ quit(1);
+ }
+ } else
+ if ( strcmp(argv[1], "-width") == 0 ) {
+ if ( argv[2] && ((w = atoi(argv[2])) > 0) ) {
+ argv += 2;
+ argc -= 2;
+ } else {
+ fprintf(stderr,
+ "The -width option requires an argument\n");
+ quit(1);
+ }
+ } else
+ if ( strcmp(argv[1], "-height") == 0 ) {
+ if ( argv[2] && ((h = atoi(argv[2])) > 0) ) {
+ argv += 2;
+ argc -= 2;
+ } else {
+ fprintf(stderr,
+ "The -height option requires an argument\n");
+ quit(1);
+ }
+ } else
+ if ( strcmp(argv[1], "-bpp") == 0 ) {
+ if ( argv[2] ) {
+ desired_bpp = atoi(argv[2]);
+ argv += 2;
+ argc -= 2;
+ } else {
+ fprintf(stderr,
+ "The -bpp option requires an argument\n");
+ quit(1);
+ }
+ } else
+ if ( strcmp(argv[1], "-warp") == 0 ) {
+ video_flags |= SDL_HWPALETTE;
+ argv += 1;
+ argc -= 1;
+ } else
+ if ( strcmp(argv[1], "-hw") == 0 ) {
+ video_flags |= SDL_HWSURFACE;
+ argv += 1;
+ argc -= 1;
+ } else
+ if ( strcmp(argv[1], "-flip") == 0 ) {
+ video_flags |= SDL_DOUBLEBUF;
+ argv += 1;
+ argc -= 1;
+ } else
+ if ( strcmp(argv[1], "-fullscreen") == 0 ) {
+ video_flags |= SDL_FULLSCREEN;
+ argv += 1;
+ argc -= 1;
+ } else
+ break;
+ }
+
+ /* Initialize the display */
+ screen = SDL_SetVideoMode(w, h, desired_bpp, video_flags);
+ if ( screen == NULL ) {
+ fprintf(stderr, "Couldn't set %dx%dx%d video mode: %s\n",
+ w, h, desired_bpp, SDL_GetError());
+ quit(1);
+ }
+ printf("Set%s %dx%dx%d mode\n",
+ screen->flags & SDL_FULLSCREEN ? " fullscreen" : "",
+ screen->w, screen->h, screen->format->BitsPerPixel);
+ printf("(video surface located in %s memory)\n",
+ (screen->flags&SDL_HWSURFACE) ? "video" : "system");
+ if ( screen->flags & SDL_DOUBLEBUF ) {
+ printf("Double-buffering enabled\n");
+ flip = 1;
+ }
+
+ /* Set the window manager title bar */
+ SDL_WM_SetCaption("SDL test window", "testwin");
+
+ /* Do all the drawing work */
+#ifdef BENCHMARK_SDL
+ then = SDL_GetTicks();
+ DrawPict(screen, argv[1], speedy, flip, nofade);
+ now = SDL_GetTicks();
+ printf("Time: %d milliseconds\n", now-then);
+#else
+ DrawPict(screen, argv[1], speedy, flip, nofade);
+#endif
+ SDL_Delay(delay*1000);
+ SDL_Quit();
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/test/testwm.c b/distrib/sdl-1.2.15/test/testwm.c
new file mode 100644
index 0000000..9c3c050
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/testwm.c
@@ -0,0 +1,443 @@
+
+/* Test out the window manager interaction functions */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "SDL.h"
+
+/* Is the cursor visible? */
+static int visible = 1;
+
+static Uint8 video_bpp;
+static Uint32 video_flags;
+
+/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
+static void quit(int rc)
+{
+ SDL_Quit();
+ exit(rc);
+}
+
+int SetVideoMode(int w, int h)
+{
+ SDL_Surface *screen;
+ int i;
+ Uint8 *buffer;
+ SDL_Color palette[256];
+
+ screen = SDL_SetVideoMode(w, h, video_bpp, video_flags);
+ if ( screen == NULL ) {
+ fprintf(stderr, "Couldn't set %dx%dx%d video mode: %s\n",
+ w, h, video_bpp, SDL_GetError());
+ return(-1);
+ }
+ printf("Running in %s mode\n", screen->flags & SDL_FULLSCREEN ?
+ "fullscreen" : "windowed");
+
+ /* Set the surface pixels and refresh! */
+ for ( i=0; i<256; ++i ) {
+ palette[i].r = 255-i;
+ palette[i].g = 255-i;
+ palette[i].b = 255-i;
+ }
+ SDL_SetColors(screen, palette, 0, 256);
+ if ( SDL_LockSurface(screen) < 0 ) {
+ fprintf(stderr, "Couldn't lock display surface: %s\n",
+ SDL_GetError());
+ return(-1);
+ }
+ buffer = (Uint8 *)screen->pixels;
+ for ( i=0; i<screen->h; ++i ) {
+ memset(buffer,(i*255)/screen->h,
+ screen->w*screen->format->BytesPerPixel);
+ buffer += screen->pitch;
+ }
+ SDL_UnlockSurface(screen);
+ SDL_UpdateRect(screen, 0, 0, 0, 0);
+
+ return(0);
+}
+
+SDL_Surface *LoadIconSurface(char *file, Uint8 **maskp)
+{
+ SDL_Surface *icon;
+ Uint8 *pixels;
+ Uint8 *mask;
+ int mlen, i, j;
+
+ *maskp = NULL;
+
+ /* Load the icon surface */
+ icon = SDL_LoadBMP(file);
+ if ( icon == NULL ) {
+ fprintf(stderr, "Couldn't load %s: %s\n", file, SDL_GetError());
+ return(NULL);
+ }
+
+ /* Check width and height
+ if ( (icon->w%8) != 0 ) {
+ fprintf(stderr, "Icon width must be a multiple of 8!\n");
+ SDL_FreeSurface(icon);
+ return(NULL);
+ }
+*/
+
+
+ if ( icon->format->palette == NULL ) {
+ fprintf(stderr, "Icon must have a palette!\n");
+ SDL_FreeSurface(icon);
+ return(NULL);
+ }
+
+ /* Set the colorkey */
+ SDL_SetColorKey(icon, SDL_SRCCOLORKEY, *((Uint8 *)icon->pixels));
+
+ /* Create the mask */
+ pixels = (Uint8 *)icon->pixels;
+ printf("Transparent pixel: (%d,%d,%d)\n",
+ icon->format->palette->colors[*pixels].r,
+ icon->format->palette->colors[*pixels].g,
+ icon->format->palette->colors[*pixels].b);
+ mlen = (icon->w*icon->h + 7) / 8;
+ mask = (Uint8 *)malloc(mlen);
+ if ( mask == NULL ) {
+ fprintf(stderr, "Out of memory!\n");
+ SDL_FreeSurface(icon);
+ return(NULL);
+ }
+ memset(mask, 0, mlen);
+ for ( i=0; i < icon->h; i++)
+ for (j=0; j < icon->w; j++) {
+ int pindex = i * icon->pitch + j;
+ int mindex = i * icon->w + j;
+ if ( pixels[pindex] != *pixels )
+ mask[mindex>>3] |= 1 << (7 - (mindex & 7));
+ }
+ *maskp = mask;
+ return(icon);
+}
+
+void HotKey_ToggleFullScreen(void)
+{
+ SDL_Surface *screen;
+
+ screen = SDL_GetVideoSurface();
+ if ( SDL_WM_ToggleFullScreen(screen) ) {
+ printf("Toggled fullscreen mode - now %s\n",
+ (screen->flags&SDL_FULLSCREEN) ? "fullscreen" : "windowed");
+ } else {
+ printf("Unable to toggle fullscreen mode\n");
+ video_flags ^= SDL_FULLSCREEN;
+ SetVideoMode(screen->w, screen->h);
+ }
+}
+
+void HotKey_ToggleGrab(void)
+{
+ SDL_GrabMode mode;
+
+ printf("Ctrl-G: toggling input grab!\n");
+ mode = SDL_WM_GrabInput(SDL_GRAB_QUERY);
+ if ( mode == SDL_GRAB_ON ) {
+ printf("Grab was on\n");
+ } else {
+ printf("Grab was off\n");
+ }
+ mode = SDL_WM_GrabInput(mode ? SDL_GRAB_OFF : SDL_GRAB_ON);
+ if ( mode == SDL_GRAB_ON ) {
+ printf("Grab is now on\n");
+ } else {
+ printf("Grab is now off\n");
+ }
+}
+
+void HotKey_Iconify(void)
+{
+ printf("Ctrl-Z: iconifying window!\n");
+ SDL_WM_IconifyWindow();
+}
+
+void HotKey_Quit(void)
+{
+ SDL_Event event;
+
+ printf("Posting internal quit request\n");
+ event.type = SDL_USEREVENT;
+ SDL_PushEvent(&event);
+}
+
+static void print_modifiers(void)
+{
+ int mod;
+ printf(" modifiers:");
+ mod = SDL_GetModState();
+ if(!mod) {
+ printf(" (none)");
+ return;
+ }
+ if(mod & KMOD_LSHIFT)
+ printf(" LSHIFT");
+ if(mod & KMOD_RSHIFT)
+ printf(" RSHIFT");
+ if(mod & KMOD_LCTRL)
+ printf(" LCTRL");
+ if(mod & KMOD_RCTRL)
+ printf(" RCTRL");
+ if(mod & KMOD_LALT)
+ printf(" LALT");
+ if(mod & KMOD_RALT)
+ printf(" RALT");
+ if(mod & KMOD_LMETA)
+ printf(" LMETA");
+ if(mod & KMOD_RMETA)
+ printf(" RMETA");
+ if(mod & KMOD_NUM)
+ printf(" NUM");
+ if(mod & KMOD_CAPS)
+ printf(" CAPS");
+ if(mod & KMOD_MODE)
+ printf(" MODE");
+}
+
+static void PrintKey(const SDL_keysym *sym, int pressed)
+{
+ /* Print the keycode, name and state */
+ if ( sym->sym ) {
+ printf("Key %s: %d-%s ", pressed ? "pressed" : "released",
+ sym->sym, SDL_GetKeyName(sym->sym));
+ } else {
+ printf("Unknown Key (scancode = %d) %s ", sym->scancode,
+ pressed ? "pressed" : "released");
+ }
+
+ /* Print the translated character, if one exists */
+ if ( sym->unicode ) {
+ /* Is it a control-character? */
+ if ( sym->unicode < ' ' ) {
+ printf(" (^%c)", sym->unicode+'@');
+ } else {
+#ifdef UNICODE
+ printf(" (%c)", sym->unicode);
+#else
+ /* This is a Latin-1 program, so only show 8-bits */
+ if ( !(sym->unicode & 0xFF00) )
+ printf(" (%c)", sym->unicode);
+ else
+ printf(" (0x%X)", sym->unicode);
+#endif
+ }
+ }
+ print_modifiers();
+ printf("\n");
+}
+
+int SDLCALL FilterEvents(const SDL_Event *event)
+{
+ static int reallyquit = 0;
+
+ switch (event->type) {
+
+ case SDL_ACTIVEEVENT:
+ /* See what happened */
+ printf("App %s ",
+ event->active.gain ? "gained" : "lost");
+ if ( event->active.state & SDL_APPACTIVE )
+ printf("active ");
+ if ( event->active.state & SDL_APPINPUTFOCUS )
+ printf("input ");
+ if ( event->active.state & SDL_APPMOUSEFOCUS )
+ printf("mouse ");
+ printf("focus\n");
+
+ /* See if we are iconified or restored */
+ if ( event->active.state & SDL_APPACTIVE ) {
+ printf("App has been %s\n",
+ event->active.gain ?
+ "restored" : "iconified");
+ }
+ return(0);
+
+ /* We want to toggle visibility on buttonpress */
+ case SDL_MOUSEBUTTONDOWN:
+ case SDL_MOUSEBUTTONUP:
+ if ( event->button.state == SDL_PRESSED ) {
+ visible = !visible;
+ SDL_ShowCursor(visible);
+ }
+ printf("Mouse button %d has been %s\n",
+ event->button.button,
+ (event->button.state == SDL_PRESSED) ?
+ "pressed" : "released");
+ return(0);
+
+ /* Show relative mouse motion */
+ case SDL_MOUSEMOTION:
+#if 0
+ printf("Mouse motion: {%d,%d} (%d,%d)\n",
+ event->motion.x, event->motion.y,
+ event->motion.xrel, event->motion.yrel);
+#endif
+ return(0);
+
+ case SDL_KEYDOWN:
+ PrintKey(&event->key.keysym, 1);
+ if ( event->key.keysym.sym == SDLK_ESCAPE ) {
+ HotKey_Quit();
+ }
+ if ( (event->key.keysym.sym == SDLK_g) &&
+ (event->key.keysym.mod & KMOD_CTRL) ) {
+ HotKey_ToggleGrab();
+ }
+ if ( (event->key.keysym.sym == SDLK_z) &&
+ (event->key.keysym.mod & KMOD_CTRL) ) {
+ HotKey_Iconify();
+ }
+ if ( (event->key.keysym.sym == SDLK_RETURN) &&
+ (event->key.keysym.mod & KMOD_ALT) ) {
+ HotKey_ToggleFullScreen();
+ }
+ return(0);
+
+ case SDL_KEYUP:
+ PrintKey(&event->key.keysym, 0);
+ return(0);
+
+ /* Pass the video resize event through .. */
+ case SDL_VIDEORESIZE:
+ return(1);
+
+ /* This is important! Queue it if we want to quit. */
+ case SDL_QUIT:
+ if ( ! reallyquit ) {
+ reallyquit = 1;
+ printf("Quit requested\n");
+ return(0);
+ }
+ printf("Quit demanded\n");
+ return(1);
+
+ /* This will never happen because events queued directly
+ to the event queue are not filtered.
+ */
+ case SDL_USEREVENT:
+ return(1);
+
+ /* Drop all other events */
+ default:
+ return(0);
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ SDL_Event event;
+ char *title;
+ SDL_Surface *icon;
+ Uint8 *icon_mask;
+ int parsed;
+ int w, h;
+
+ if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
+ fprintf(stderr,
+ "Couldn't initialize SDL: %s\n", SDL_GetError());
+ return(1);
+ }
+
+ /* Check command line arguments */
+ w = 640;
+ h = 480;
+ video_bpp = 8;
+ video_flags = SDL_SWSURFACE;
+ parsed = 1;
+ while ( parsed ) {
+ if ( (argc >= 2) && (strcmp(argv[1], "-fullscreen") == 0) ) {
+ video_flags |= SDL_FULLSCREEN;
+ argc -= 1;
+ argv += 1;
+ } else
+ if ( (argc >= 2) && (strcmp(argv[1], "-resize") == 0) ) {
+ video_flags |= SDL_RESIZABLE;
+ argc -= 1;
+ argv += 1;
+ } else
+ if ( (argc >= 2) && (strcmp(argv[1], "-noframe") == 0) ) {
+ video_flags |= SDL_NOFRAME;
+ argc -= 1;
+ argv += 1;
+ } else
+ if ( (argc >= 3) && (strcmp(argv[1], "-width") == 0) ) {
+ w = atoi(argv[2]);
+ argc -= 2;
+ argv += 2;
+ } else
+ if ( (argc >= 3) && (strcmp(argv[1], "-height") == 0) ) {
+ h = atoi(argv[2]);
+ argc -= 2;
+ argv += 2;
+ } else
+ if ( (argc >= 3) && (strcmp(argv[1], "-bpp") == 0) ) {
+ video_bpp = atoi(argv[2]);
+ argc -= 2;
+ argv += 2;
+ } else {
+ parsed = 0;
+ }
+ }
+
+ /* Set the icon -- this must be done before the first mode set */
+ icon = LoadIconSurface("icon.bmp", &icon_mask);
+ if ( icon != NULL ) {
+ SDL_WM_SetIcon(icon, icon_mask);
+ }
+ if ( icon_mask != NULL )
+ free(icon_mask);
+
+ /* Set the title bar */
+ if ( argv[1] == NULL )
+ title = "Testing 1.. 2.. 3...";
+ else
+ title = argv[1];
+ SDL_WM_SetCaption(title, "testwm");
+
+ /* See if it's really set */
+ SDL_WM_GetCaption(&title, NULL);
+ if ( title )
+ printf("Title was set to: %s\n", title);
+ else
+ printf("No window title was set!\n");
+
+ /* Initialize the display */
+ if ( SetVideoMode(w, h) < 0 ) {
+ quit(1);
+ }
+
+ /* Set an event filter that discards everything but QUIT */
+ SDL_SetEventFilter(FilterEvents);
+
+ /* Loop, waiting for QUIT */
+ while ( SDL_WaitEvent(&event) ) {
+ switch (event.type) {
+ case SDL_VIDEORESIZE:
+ printf("Got a resize event: %dx%d\n",
+ event.resize.w, event.resize.h);
+ SetVideoMode(event.resize.w, event.resize.h);
+ break;
+ case SDL_USEREVENT:
+ printf("Handling internal quit request\n");
+ /* Fall through to the quit handler */
+ case SDL_QUIT:
+ printf("Bye bye..\n");
+ quit(0);
+ default:
+ /* This should never happen */
+ printf("Warning: Event %d wasn't filtered\n",
+ event.type);
+ break;
+ }
+ }
+ printf("SDL_WaitEvent() error: %s\n", SDL_GetError());
+ SDL_Quit();
+ return(255);
+}
diff --git a/distrib/sdl-1.2.15/test/threadwin.c b/distrib/sdl-1.2.15/test/threadwin.c
new file mode 100644
index 0000000..c704b30
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/threadwin.c
@@ -0,0 +1,338 @@
+
+/* Test out the multi-threaded event handling functions */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "SDL.h"
+#include "SDL_thread.h"
+
+/* Are we done yet? */
+static int done = 0;
+
+/* Is the cursor visible? */
+static int visible = 1;
+
+/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
+static void quit(int rc)
+{
+ SDL_Quit();
+ exit(rc);
+}
+
+SDL_Surface *LoadIconSurface(char *file, Uint8 **maskp)
+{
+ SDL_Surface *icon;
+ Uint8 *pixels;
+ Uint8 *mask;
+ int mlen, i;
+
+ *maskp = NULL;
+
+ /* Load the icon surface */
+ icon = SDL_LoadBMP(file);
+ if ( icon == NULL ) {
+ fprintf(stderr, "Couldn't load %s: %s\n", file, SDL_GetError());
+ return(NULL);
+ }
+
+ /* Check width and height */
+ if ( (icon->w%8) != 0 ) {
+ fprintf(stderr, "Icon width must be a multiple of 8!\n");
+ SDL_FreeSurface(icon);
+ return(NULL);
+ }
+ if ( icon->format->palette == NULL ) {
+ fprintf(stderr, "Icon must have a palette!\n");
+ SDL_FreeSurface(icon);
+ return(NULL);
+ }
+
+ /* Set the colorkey */
+ SDL_SetColorKey(icon, SDL_SRCCOLORKEY, *((Uint8 *)icon->pixels));
+
+ /* Create the mask */
+ pixels = (Uint8 *)icon->pixels;
+ printf("Transparent pixel: (%d,%d,%d)\n",
+ icon->format->palette->colors[*pixels].r,
+ icon->format->palette->colors[*pixels].g,
+ icon->format->palette->colors[*pixels].b);
+ mlen = icon->w*icon->h;
+ mask = (Uint8 *)malloc(mlen/8);
+ if ( mask == NULL ) {
+ fprintf(stderr, "Out of memory!\n");
+ SDL_FreeSurface(icon);
+ return(NULL);
+ }
+ memset(mask, 0, mlen/8);
+ for ( i=0; i<mlen; ) {
+ if ( pixels[i] != *pixels )
+ mask[i/8] |= 0x01;
+ ++i;
+ if ( (i%8) != 0 )
+ mask[i/8] <<= 1;
+ }
+ *maskp = mask;
+ return(icon);
+}
+
+int SDLCALL FilterEvents(const SDL_Event *event)
+{
+ static int reallyquit = 0;
+
+ switch (event->type) {
+
+ case SDL_ACTIVEEVENT:
+ /* See what happened */
+ printf("App %s ",
+ event->active.gain ? "gained" : "lost");
+ if ( event->active.state & SDL_APPACTIVE )
+ printf("active ");
+ if ( event->active.state & SDL_APPMOUSEFOCUS )
+ printf("mouse ");
+ if ( event->active.state & SDL_APPINPUTFOCUS )
+ printf("input ");
+ printf("focus\n");
+
+ /* See if we are iconified or restored */
+ if ( event->active.state & SDL_APPACTIVE ) {
+ printf("App has been %s\n",
+ event->active.gain ?
+ "restored" : "iconified");
+ }
+ return(0);
+
+ /* This is important! Queue it if we want to quit. */
+ case SDL_QUIT:
+ if ( ! reallyquit ) {
+ reallyquit = 1;
+ printf("Quit requested\n");
+ return(0);
+ }
+ printf("Quit demanded\n");
+ return(1);
+
+ /* Mouse and keyboard events go to threads */
+ case SDL_MOUSEMOTION:
+ case SDL_MOUSEBUTTONDOWN:
+ case SDL_MOUSEBUTTONUP:
+ case SDL_KEYDOWN:
+ case SDL_KEYUP:
+ return(1);
+
+ /* Drop all other events */
+ default:
+ return(0);
+ }
+}
+
+int SDLCALL HandleMouse(void *unused)
+{
+ SDL_Event events[10];
+ int i, found;
+ Uint32 mask;
+
+ /* Handle mouse events here */
+ mask = (SDL_MOUSEMOTIONMASK|SDL_MOUSEBUTTONDOWNMASK|SDL_MOUSEBUTTONUPMASK);
+ while ( ! done ) {
+ found = SDL_PeepEvents(events, 10, SDL_GETEVENT, mask);
+ for ( i=0; i<found; ++i ) {
+ switch(events[i].type) {
+ /* We want to toggle visibility on buttonpress */
+ case SDL_MOUSEBUTTONDOWN:
+ case SDL_MOUSEBUTTONUP:
+ if ( events[i].button.state == SDL_PRESSED ) {
+ visible = !visible;
+ SDL_ShowCursor(visible);
+ }
+ printf("Mouse button %d has been %s\n",
+ events[i].button.button,
+ (events[i].button.state == SDL_PRESSED) ?
+ "pressed" : "released");
+ break;
+ /* Show relative mouse motion */
+ case SDL_MOUSEMOTION:
+ printf("Mouse relative motion: {%d,%d}\n",
+ events[i].motion.xrel, events[i].motion.yrel);
+ break;
+ }
+ }
+ /* Give up some CPU to allow events to arrive */
+ SDL_Delay(20);
+ }
+ return(0);
+}
+
+int SDLCALL HandleKeyboard(void *unused)
+{
+ SDL_Event events[10];
+ int i, found;
+ Uint32 mask;
+
+ /* Handle mouse events here */
+ mask = (SDL_KEYDOWNMASK|SDL_KEYUPMASK);
+ while ( ! done ) {
+ found = SDL_PeepEvents(events, 10, SDL_GETEVENT, mask);
+ for ( i=0; i<found; ++i ) {
+ switch(events[i].type) {
+ /* We want to toggle visibility on buttonpress */
+ case SDL_KEYDOWN:
+ case SDL_KEYUP:
+ printf("Key '%c' (keysym==%d) has been %s\n",
+ events[i].key.keysym.unicode,
+ (int) events[i].key.keysym.sym,
+ (events[i].key.state == SDL_PRESSED) ?
+ "pressed" : "released");
+
+ /* Allow hitting <ESC> to quit the app */
+ if ( events[i].key.keysym.sym == SDLK_ESCAPE ) {
+ done = 1;
+ }
+
+ /* skip events now that aren't KEYUPs... */
+ if (events[i].key.state == SDL_PRESSED)
+ break;
+
+ if ( events[i].key.keysym.sym == SDLK_f ) {
+ int rc = 0;
+ printf("attempting to toggle fullscreen...\n");
+ rc = SDL_WM_ToggleFullScreen(SDL_GetVideoSurface());
+ printf("SDL_WM_ToggleFullScreen returned %d.\n", rc);
+ }
+
+ if ( events[i].key.keysym.sym == SDLK_g ) {
+ SDL_GrabMode m;
+ m = SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON ?
+ SDL_GRAB_OFF : SDL_GRAB_ON;
+ printf("attempting to toggle input grab to %s...\n",
+ m == SDL_GRAB_ON ? "ON" : "OFF");
+ SDL_WM_GrabInput(m);
+ printf("attempt finished.\n");
+ }
+
+ break;
+ }
+ }
+ /* Give up some CPU to allow events to arrive */
+ SDL_Delay(20);
+ }
+ return(0);
+}
+
+int main(int argc, char *argv[])
+{
+ SDL_Surface *screen;
+ SDL_Surface *icon;
+ Uint8 *icon_mask;
+ int i, parsed;
+ Uint8 *buffer;
+ SDL_Color palette[256];
+ Uint32 init_flags;
+ Uint8 video_bpp;
+ Uint32 video_flags;
+ SDL_Thread *mouse_thread;
+ SDL_Thread *keybd_thread;
+
+ /* Set the options, based on command line arguments */
+ init_flags = SDL_INIT_VIDEO;
+ video_bpp = 8;
+ video_flags = SDL_SWSURFACE;
+ parsed = 1;
+ while ( parsed ) {
+ /* If the threaded option is enabled, and the SDL library hasn't
+ been compiled with threaded events enabled, then the mouse and
+ keyboard won't respond.
+ */
+ if ( (argc >= 2) && (strcmp(argv[1], "-threaded") == 0) ) {
+ init_flags |= SDL_INIT_EVENTTHREAD;
+ argc -= 1;
+ argv += 1;
+ printf("Running with threaded events\n");
+ } else
+ if ( (argc >= 2) && (strcmp(argv[1], "-fullscreen") == 0) ) {
+ video_flags |= SDL_FULLSCREEN;
+ argc -= 1;
+ argv += 1;
+ } else
+ if ( (argc >= 3) && (strcmp(argv[1], "-bpp") == 0) ) {
+ video_bpp = atoi(argv[2]);
+ argc -= 2;
+ argv += 2;
+ } else {
+ parsed = 0;
+ }
+ }
+
+ /* Initialize SDL with the requested flags */
+ if ( SDL_Init(init_flags) < 0 ) {
+ fprintf(stderr,
+ "Couldn't initialize SDL: %s\n", SDL_GetError());
+ return(1);
+ }
+
+ /* Set the icon -- this must be done before the first mode set */
+ icon = LoadIconSurface("icon.bmp", &icon_mask);
+ if ( icon != NULL ) {
+ SDL_WM_SetIcon(icon, icon_mask);
+ }
+ if ( icon_mask != NULL )
+ free(icon_mask);
+
+ /* Initialize the display */
+ screen = SDL_SetVideoMode(640, 480, video_bpp, video_flags);
+ if ( screen == NULL ) {
+ fprintf(stderr, "Couldn't set 640x480x%d video mode: %s\n",
+ video_bpp, SDL_GetError());
+ quit(1);
+ }
+ printf("Running in %s mode\n", screen->flags & SDL_FULLSCREEN ?
+ "fullscreen" : "windowed");
+
+ /* Enable printable characters */
+ SDL_EnableUNICODE(1);
+
+ /* Set an event filter that discards everything but QUIT */
+ SDL_SetEventFilter(FilterEvents);
+
+ /* Create the event handling threads */
+ mouse_thread = SDL_CreateThread(HandleMouse, NULL);
+ keybd_thread = SDL_CreateThread(HandleKeyboard, NULL);
+
+ /* Set the surface pixels and refresh! */
+ for ( i=0; i<256; ++i ) {
+ palette[i].r = 255-i;
+ palette[i].g = 255-i;
+ palette[i].b = 255-i;
+ }
+ SDL_SetColors(screen, palette, 0, 256);
+ if ( SDL_LockSurface(screen) < 0 ) {
+ fprintf(stderr, "Couldn't lock display surface: %s\n",
+ SDL_GetError());
+ quit(2);
+ }
+ buffer = (Uint8 *)screen->pixels;
+ for ( i=0; i<screen->h; ++i ) {
+ memset(buffer,(i*255)/screen->h,
+ screen->w*screen->format->BytesPerPixel);
+ buffer += screen->pitch;
+ }
+ SDL_UnlockSurface(screen);
+ SDL_UpdateRect(screen, 0, 0, 0, 0);
+
+ /* Loop, waiting for QUIT */
+ while ( ! done ) {
+ if ( ! (init_flags & SDL_INIT_EVENTTHREAD) ) {
+ SDL_PumpEvents(); /* Needed when event thread is off */
+ }
+ if ( SDL_PeepEvents(NULL, 0, SDL_PEEKEVENT, SDL_QUITMASK) ) {
+ done = 1;
+ }
+ /* Give up some CPU so the events can accumulate */
+ SDL_Delay(20);
+ }
+ SDL_WaitThread(mouse_thread, NULL);
+ SDL_WaitThread(keybd_thread, NULL);
+ SDL_Quit();
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/test/torturethread.c b/distrib/sdl-1.2.15/test/torturethread.c
new file mode 100644
index 0000000..cb18954
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/torturethread.c
@@ -0,0 +1,91 @@
+
+/* Simple test of the SDL threading code */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <string.h>
+
+#include "SDL.h"
+#include "SDL_thread.h"
+
+#define NUMTHREADS 10
+
+static char volatile time_for_threads_to_die[NUMTHREADS];
+
+/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
+static void quit(int rc)
+{
+ SDL_Quit();
+ exit(rc);
+}
+
+int SDLCALL SubThreadFunc(void *data) {
+ while(! *(int volatile *)data) {
+ ; /*SDL_Delay(10);*/ /* do nothing */
+ }
+ return 0;
+}
+
+int SDLCALL ThreadFunc(void *data) {
+ SDL_Thread *sub_threads[NUMTHREADS];
+ int flags[NUMTHREADS];
+ int i;
+ int tid = (int)(uintptr_t)data;
+
+ fprintf(stderr, "Creating Thread %d\n", tid);
+
+ for(i = 0; i < NUMTHREADS; i++) {
+ flags[i] = 0;
+ sub_threads[i] = SDL_CreateThread(SubThreadFunc, &flags[i]);
+ }
+
+ printf("Thread '%d' waiting for signal\n", tid);
+ while(time_for_threads_to_die[tid] != 1) {
+ ; /* do nothing */
+ }
+
+ printf("Thread '%d' sending signals to subthreads\n", tid);
+ for(i = 0; i < NUMTHREADS; i++) {
+ flags[i] = 1;
+ SDL_WaitThread(sub_threads[i], NULL);
+ }
+
+ printf("Thread '%d' exiting!\n", tid);
+
+ return 0;
+}
+
+int main(int argc, char *argv[])
+{
+ SDL_Thread *threads[NUMTHREADS];
+ int i;
+
+ /* Load the SDL library */
+ if ( SDL_Init(0) < 0 ) {
+ fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
+ return(1);
+ }
+
+ signal(SIGSEGV, SIG_DFL);
+ for(i = 0; i < NUMTHREADS; i++) {
+ time_for_threads_to_die[i] = 0;
+ threads[i] = SDL_CreateThread(ThreadFunc, (void *)(uintptr_t)i);
+
+ if ( threads[i] == NULL ) {
+ fprintf(stderr,
+ "Couldn't create thread: %s\n", SDL_GetError());
+ quit(1);
+ }
+ }
+
+ for(i = 0; i < NUMTHREADS; i++) {
+ time_for_threads_to_die[i] = 1;
+ }
+
+ for(i = 0; i < NUMTHREADS; i++) {
+ SDL_WaitThread(threads[i], NULL);
+ }
+ SDL_Quit();
+ return(0);
+}
diff --git a/distrib/sdl-1.2.15/test/utf8.txt b/distrib/sdl-1.2.15/test/utf8.txt
new file mode 100644
index 0000000..aab22f1
--- /dev/null
+++ b/distrib/sdl-1.2.15/test/utf8.txt
@@ -0,0 +1,287 @@
+UTF-8 decoder capability and stress test
+----------------------------------------
+
+Markus Kuhn <http://www.cl.cam.ac.uk/~mgk25/> - 2003-02-19
+
+This test file can help you examine, how your UTF-8 decoder handles
+various types of correct, malformed, or otherwise interesting UTF-8
+sequences. This file is not meant to be a conformance test. It does
+not prescribes any particular outcome and therefore there is no way to
+"pass" or "fail" this test file, even though the texts suggests a
+preferable decoder behaviour at some places. The aim is instead to
+help you think about and test the behaviour of your UTF-8 on a
+systematic collection of unusual inputs. Experience so far suggests
+that most first-time authors of UTF-8 decoders find at least one
+serious problem in their decoder by using this file.
+
+The test lines below cover boundary conditions, malformed UTF-8
+sequences as well as correctly encoded UTF-8 sequences of Unicode code
+points that should never occur in a correct UTF-8 file.
+
+According to ISO 10646-1:2000, sections D.7 and 2.3c, a device
+receiving UTF-8 shall interpret a "malformed sequence in the same way
+that it interprets a character that is outside the adopted subset" and
+"characters that are not within the adopted subset shall be indicated
+to the user" by a receiving device. A quite commonly used approach in
+UTF-8 decoders is to replace any malformed UTF-8 sequence by a
+replacement character (U+FFFD), which looks a bit like an inverted
+question mark, or a similar symbol. It might be a good idea to
+visually distinguish a malformed UTF-8 sequence from a correctly
+encoded Unicode character that is just not available in the current
+font but otherwise fully legal, even though ISO 10646-1 doesn't
+mandate this. In any case, just ignoring malformed sequences or
+unavailable characters does not conform to ISO 10646, will make
+debugging more difficult, and can lead to user confusion.
+
+Please check, whether a malformed UTF-8 sequence is (1) represented at
+all, (2) represented by exactly one single replacement character (or
+equivalent signal), and (3) the following quotation mark after an
+illegal UTF-8 sequence is correctly displayed, i.e. proper
+resynchronization takes place immageately after any malformed
+sequence. This file says "THE END" in the last line, so if you don't
+see that, your decoder crashed somehow before, which should always be
+cause for concern.
+
+All lines in this file are exactly 79 characters long (plus the line
+feed). In addition, all lines end with "|", except for the two test
+lines 2.1.1 and 2.2.1, which contain non-printable ASCII controls
+U+0000 and U+007F. If you display this file with a fixed-width font,
+these "|" characters should all line up in column 79 (right margin).
+This allows you to test quickly, whether your UTF-8 decoder finds the
+correct number of characters in every line, that is whether each
+malformed sequences is replaced by a single replacement character.
+
+Note that as an alternative to the notion of malformed sequence used
+here, it is also a perfectly acceptable (and in some situations even
+preferable) solution to represent each individual byte of a malformed
+sequence by a replacement character. If you follow this strategy in
+your decoder, then please ignore the "|" column.
+
+
+Here come the tests: |
+ |
+1 Some correct UTF-8 text |
+ |
+(The codepoints for this test are: |
+ U+03BA U+1F79 U+03C3 U+03BC U+03B5 --ryan.) |
+ |
+You should see the Greek word 'kosme': "κόσμε" |
+ |
+ |
+2 Boundary condition test cases |
+ |
+2.1 First possible sequence of a certain length |
+ |
+(byte zero skipped...there's a null added at the end of the test. --ryan.) |
+ |
+2.1.2 2 bytes (U-00000080): "€" |
+2.1.3 3 bytes (U-00000800): "à €" |
+2.1.4 4 bytes (U-00010000): "ð€€" |
+ |
+(5 and 6 byte sequences were made illegal in rfc3629. --ryan.) |
+2.1.5 5 bytes (U-00200000): "øˆ€€€" |
+2.1.6 6 bytes (U-04000000): "ü„€€€€" |
+ |
+2.2 Last possible sequence of a certain length |
+ |
+2.2.1 1 byte (U-0000007F): "" |
+2.2.2 2 bytes (U-000007FF): "ß¿" |
+ |
+(Section 5.3.2 below calls this illegal. --ryan.) |
+2.2.3 3 bytes (U-0000FFFF): "ï¿¿" |
+ |
+(5 and 6 bytes sequences, and 4 bytes sequences > 0x10FFFF were made illegal |
+ in rfc3629, so these next three should be replaced with a invalid |
+ character codepoint. --ryan.) |
+2.2.4 4 bytes (U-001FFFFF): "÷¿¿¿" |
+2.2.5 5 bytes (U-03FFFFFF): "û¿¿¿¿" |
+2.2.6 6 bytes (U-7FFFFFFF): "ý¿¿¿¿¿" |
+ |
+2.3 Other boundary conditions |
+ |
+2.3.1 U-0000D7FF = ed 9f bf = "퟿" |
+2.3.2 U-0000E000 = ee 80 80 = "" |
+2.3.3 U-0000FFFD = ef bf bd = "�" |
+2.3.4 U-0010FFFF = f4 8f bf bf = "ô¿¿" |
+ |
+(This one is bogus in rfc3629. --ryan.) |
+2.3.5 U-00110000 = f4 90 80 80 = "ô€€" |
+ |
+3 Malformed sequences |
+ |
+3.1 Unexpected continuation bytes |
+ |
+Each unexpected continuation byte should be separately signalled as a |
+malformed sequence of its own. |
+ |
+3.1.1 First continuation byte 0x80: "€" |
+3.1.2 Last continuation byte 0xbf: "¿" |
+ |
+3.1.3 2 continuation bytes: "€¿" |
+3.1.4 3 continuation bytes: "€¿€" |
+3.1.5 4 continuation bytes: "€¿€¿" |
+3.1.6 5 continuation bytes: "€¿€¿€" |
+3.1.7 6 continuation bytes: "€¿€¿€¿" |
+3.1.8 7 continuation bytes: "€¿€¿€¿€" |
+ |
+3.1.9 Sequence of all 64 possible continuation bytes (0x80-0xbf): |
+ |
+ "€‚ƒ„…†‡ˆ‰Š‹ŒŽ |
+ ‘’“”•–—˜™š›œžŸ |
+  ¡¢£¤¥¦§¨©ª«¬­®¯ |
+ °±²³´µ¶·¸¹º»¼½¾¿" |
+ |
+3.2 Lonely start characters |
+ |
+3.2.1 All 32 first bytes of 2-byte sequences (0xc0-0xdf), |
+ each followed by a space character: |
+ |
+ "À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï |
+ Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß " |
+ |
+3.2.2 All 16 first bytes of 3-byte sequences (0xe0-0xef), |
+ each followed by a space character: |
+ |
+ "à á â ã ä å æ ç è é ê ë ì í î ï " |
+ |
+3.2.3 All 8 first bytes of 4-byte sequences (0xf0-0xf7), |
+ each followed by a space character: |
+ |
+ "ð ñ ò ó ô õ ö ÷ " |
+ |
+3.2.4 All 4 first bytes of 5-byte sequences (0xf8-0xfb), |
+ each followed by a space character: |
+ |
+ "ø ù ú û " |
+ |
+3.2.5 All 2 first bytes of 6-byte sequences (0xfc-0xfd), |
+ each followed by a space character: |
+ |
+ "ü ý " |
+ |
+3.3 Sequences with last continuation byte missing |
+ |
+All bytes of an incomplete sequence should be signalled as a single |
+malformed sequence, i.e., you should see only a single replacement |
+character in each of the next 10 tests. (Characters as in section 2) |
+ |
+3.3.1 2-byte sequence with last byte missing (U+0000): "À" |
+3.3.2 3-byte sequence with last byte missing (U+0000): "à€" |
+3.3.3 4-byte sequence with last byte missing (U+0000): "ð€€" |
+3.3.4 5-byte sequence with last byte missing (U+0000): "ø€€€" |
+3.3.5 6-byte sequence with last byte missing (U+0000): "ü€€€€" |
+3.3.6 2-byte sequence with last byte missing (U-000007FF): "ß" |
+3.3.7 3-byte sequence with last byte missing (U-0000FFFF): "ï¿" |
+3.3.8 4-byte sequence with last byte missing (U-001FFFFF): "÷¿¿" |
+3.3.9 5-byte sequence with last byte missing (U-03FFFFFF): "û¿¿¿" |
+3.3.10 6-byte sequence with last byte missing (U-7FFFFFFF): "ý¿¿¿¿" |
+ |
+3.4 Concatenation of incomplete sequences |
+ |
+All the 10 sequences of 3.3 concatenated, you should see 10 malformed |
+sequences being signalled: |
+ |
+ "Àà€ð€€ø€€€ü€€€€ßï¿÷¿¿û¿¿¿ý¿¿¿¿" |
+ |
+3.5 Impossible bytes |
+ |
+The following two bytes cannot appear in a correct UTF-8 string |
+ |
+3.5.1 fe = "þ" |
+3.5.2 ff = "ÿ" |
+3.5.3 fe fe ff ff = "þþÿÿ" |
+ |
+4 Overlong sequences |
+ |
+The following sequences are not malformed according to the letter of |
+the Unicode 2.0 standard. However, they are longer then necessary and |
+a correct UTF-8 encoder is not allowed to produce them. A "safe UTF-8 |
+decoder" should reject them just like malformed sequences for two |
+reasons: (1) It helps to debug applications if overlong sequences are |
+not treated as valid representations of characters, because this helps |
+to spot problems more quickly. (2) Overlong sequences provide |
+alternative representations of characters, that could maliciously be |
+used to bypass filters that check only for ASCII characters. For |
+instance, a 2-byte encoded line feed (LF) would not be caught by a |
+line counter that counts only 0x0a bytes, but it would still be |
+processed as a line feed by an unsafe UTF-8 decoder later in the |
+pipeline. From a security point of view, ASCII compatibility of UTF-8 |
+sequences means also, that ASCII characters are *only* allowed to be |
+represented by ASCII bytes in the range 0x00-0x7f. To ensure this |
+aspect of ASCII compatibility, use only "safe UTF-8 decoders" that |
+reject overlong UTF-8 sequences for which a shorter encoding exists. |
+ |
+4.1 Examples of an overlong ASCII character |
+ |
+With a safe UTF-8 decoder, all of the following five overlong |
+representations of the ASCII character slash ("/") should be rejected |
+like a malformed UTF-8 sequence, for instance by substituting it with |
+a replacement character. If you see a slash below, you do not have a |
+safe UTF-8 decoder! |
+ |
+4.1.1 U+002F = c0 af = "À¯" |
+4.1.2 U+002F = e0 80 af = "à€¯" |
+4.1.3 U+002F = f0 80 80 af = "ð€€¯" |
+4.1.4 U+002F = f8 80 80 80 af = "ø€€€¯" |
+4.1.5 U+002F = fc 80 80 80 80 af = "ü€€€€¯" |
+ |
+4.2 Maximum overlong sequences |
+ |
+Below you see the highest Unicode value that is still resulting in an |
+overlong sequence if represented with the given number of bytes. This |
+is a boundary test for safe UTF-8 decoders. All five characters should |
+be rejected like malformed UTF-8 sequences. |
+ |
+4.2.1 U-0000007F = c1 bf = "Á¿" |
+4.2.2 U-000007FF = e0 9f bf = "àŸ¿" |
+4.2.3 U-0000FFFF = f0 8f bf bf = "ð¿¿" |
+4.2.4 U-001FFFFF = f8 87 bf bf bf = "ø‡¿¿¿" |
+4.2.5 U-03FFFFFF = fc 83 bf bf bf bf = "üƒ¿¿¿¿" |
+ |
+4.3 Overlong representation of the NUL character |
+ |
+The following five sequences should also be rejected like malformed |
+UTF-8 sequences and should not be treated like the ASCII NUL |
+character. |
+ |
+4.3.1 U+0000 = c0 80 = "À€" |
+4.3.2 U+0000 = e0 80 80 = "à€€" |
+4.3.3 U+0000 = f0 80 80 80 = "ð€€€" |
+4.3.4 U+0000 = f8 80 80 80 80 = "ø€€€€" |
+4.3.5 U+0000 = fc 80 80 80 80 80 = "ü€€€€€" |
+ |
+5 Illegal code positions |
+ |
+The following UTF-8 sequences should be rejected like malformed |
+sequences, because they never represent valid ISO 10646 characters and |
+a UTF-8 decoder that accepts them might introduce security problems |
+comparable to overlong UTF-8 sequences. |
+ |
+5.1 Single UTF-16 surrogates |
+ |
+5.1.1 U+D800 = ed a0 80 = "í €" |
+5.1.2 U+DB7F = ed ad bf = "í­¿" |
+5.1.3 U+DB80 = ed ae 80 = "í®€" |
+5.1.4 U+DBFF = ed af bf = "í¯¿" |
+5.1.5 U+DC00 = ed b0 80 = "í°€" |
+5.1.6 U+DF80 = ed be 80 = "í¾€" |
+5.1.7 U+DFFF = ed bf bf = "í¿¿" |
+ |
+5.2 Paired UTF-16 surrogates |
+ |
+5.2.1 U+D800 U+DC00 = ed a0 80 ed b0 80 = "𐀀" |
+5.2.2 U+D800 U+DFFF = ed a0 80 ed bf bf = "𐏿" |
+5.2.3 U+DB7F U+DC00 = ed ad bf ed b0 80 = "í­¿í°€" |
+5.2.4 U+DB7F U+DFFF = ed ad bf ed bf bf = "í­¿í¿¿" |
+5.2.5 U+DB80 U+DC00 = ed ae 80 ed b0 80 = "󰀀" |
+5.2.6 U+DB80 U+DFFF = ed ae 80 ed bf bf = "󰏿" |
+5.2.7 U+DBFF U+DC00 = ed af bf ed b0 80 = "􏰀" |
+5.2.8 U+DBFF U+DFFF = ed af bf ed bf bf = "􏿿" |
+ |
+5.3 Other illegal code positions |
+ |
+5.3.1 U+FFFE = ef bf be = "￾" |
+5.3.2 U+FFFF = ef bf bf = "ï¿¿" |
+ |
+THE END |
+
diff --git a/docs/ANDROID-KERNEL.TXT b/docs/ANDROID-KERNEL.TXT
index d5a1930..9305ff0 100644
--- a/docs/ANDROID-KERNEL.TXT
+++ b/docs/ANDROID-KERNEL.TXT
@@ -25,6 +25,11 @@ To rebuild the x86 kernel:
cd $KERNEL_SOURCES
/path/to/rebuild-kernel.sh --arch=x86 --out=$ANDROID/prebuilt/android-x86/kernel
+To rebuild the MIPS kernel:
+
+ cd $KERNEL_SOURCES
+ /path/to/rebuild-kernel.sh --arch=mips --out=$ANDROID/prebuilts/qemu-kernel/mips
+
Note that you will need to have your cross-toolchain in your path.
If this is not the case, the script will complain and give you the
expected name. Use --cross=<prefix> to specify a different toolchain.
diff --git a/exec.c b/exec.c
index b8a473f..c71ef66 100644
--- a/exec.c
+++ b/exec.c
@@ -1527,7 +1527,7 @@ void cpu_set_log(int log_flags)
logfile = fopen(logfilename, log_append ? "a" : "w");
if (!logfile) {
perror(logfilename);
- _exit(1);
+ exit(1);
}
#if !defined(CONFIG_SOFTMMU)
/* must avoid mmap() usage of glibc by setting a buffer "by hand" */
diff --git a/hw/android_mips.c b/hw/android_mips.c
new file mode 100644
index 0000000..54c3c00
--- /dev/null
+++ b/hw/android_mips.c
@@ -0,0 +1,282 @@
+/* Copyright (C) 2007-2008 The Android Open Source Project
+**
+** This software is licensed under the terms of the GNU General Public
+** License version 2, as published by the Free Software Foundation, and
+** may be copied, distributed, and modified under those terms.
+**
+** 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.
+*/
+#include "hw.h"
+#include "boards.h"
+#include "devices.h"
+#include "net.h"
+#include "sysemu.h"
+#include "mips.h"
+#include "goldfish_device.h"
+#include "android/globals.h"
+#include "audio/audio.h"
+#include "blockdev.h"
+#ifdef CONFIG_MEMCHECK
+#include "memcheck/memcheck_api.h"
+#endif // CONFIG_MEMCHECK
+
+#include "android/utils/debug.h"
+
+#define D(...) VERBOSE_PRINT(init,__VA_ARGS__)
+
+#define MIPS_CPU_SAVE_VERSION 1
+#define GOLDFISH_IO_SPACE 0x1f000000
+#define GOLDFISH_INTERRUPT 0x1f000000
+#define GOLDFISH_DEVICEBUS 0x1f001000
+#define GOLDFISH_TTY 0x1f002000
+#define GOLDFISH_RTC 0x1f003000
+#define GOLDFISH_AUDIO 0x1f004000
+#define GOLDFISH_MMC 0x1f005000
+#define GOLDFISH_MEMLOG 0x1f006000
+#define GOLDFISH_DEVICES 0x1f010000
+
+char* audio_input_source = NULL;
+
+void goldfish_memlog_init(uint32_t base);
+
+static struct goldfish_device event0_device = {
+ .name = "goldfish_events",
+ .id = 0,
+ .size = 0x1000,
+ .irq_count = 1
+};
+
+static struct goldfish_device nand_device = {
+ .name = "goldfish_nand",
+ .id = 0,
+ .size = 0x1000
+};
+
+/* Board init. */
+
+#define TEST_SWITCH 1
+#if TEST_SWITCH
+uint32_t switch_test_write(void *opaque, uint32_t state)
+{
+ goldfish_switch_set_state(opaque, state);
+ return state;
+}
+#endif
+
+#define VIRT_TO_PHYS_ADDEND (-((int64_t)(int32_t)0x80000000))
+
+#define PHYS_TO_VIRT(x) ((x) | ~(target_ulong)0x7fffffff)
+
+static void android_load_kernel(CPUState *env, int ram_size, const char *kernel_filename,
+ const char *kernel_cmdline, const char *initrd_filename)
+{
+ int initrd_size;
+ ram_addr_t initrd_offset;
+ uint64_t kernel_entry, kernel_low, kernel_high;
+ unsigned int cmdline;
+
+ /* Load the kernel. */
+ if (!kernel_filename) {
+ fprintf(stderr, "Kernel image must be specified\n");
+ exit(1);
+ }
+ if (load_elf(kernel_filename, VIRT_TO_PHYS_ADDEND,
+ (uint64_t *)&kernel_entry, (uint64_t *)&kernel_low,
+ (uint64_t *)&kernel_high) < 0) {
+ fprintf(stderr, "qemu: could not load kernel '%s'\n", kernel_filename);
+ exit(1);
+ }
+ env->active_tc.PC = (int32_t)kernel_entry;
+
+ /* load initrd */
+ initrd_size = 0;
+ initrd_offset = 0;
+ if (initrd_filename) {
+ initrd_size = get_image_size (initrd_filename);
+ if (initrd_size > 0) {
+ initrd_offset = (kernel_high + ~TARGET_PAGE_MASK) & TARGET_PAGE_MASK;
+ if (initrd_offset + initrd_size > ram_size) {
+ fprintf(stderr,
+ "qemu: memory too small for initial ram disk '%s'\n",
+ initrd_filename);
+ exit(1);
+ }
+ initrd_size = load_image_targphys(initrd_filename,
+ initrd_offset,
+ ram_size - initrd_offset);
+
+ }
+ if (initrd_size == (target_ulong) -1) {
+ fprintf(stderr, "qemu: could not load initial ram disk '%s'\n",
+ initrd_filename);
+ exit(1);
+ }
+ }
+
+ /* Store command line in top page of memory
+ * kernel will copy the command line to a loca buffer
+ */
+ cmdline = ram_size - TARGET_PAGE_SIZE;
+ char kernel_cmd[1024];
+ if (initrd_size > 0)
+ sprintf (kernel_cmd, "%s rd_start=0x" TARGET_FMT_lx " rd_size=%li",
+ kernel_cmdline,
+ PHYS_TO_VIRT(initrd_offset), initrd_size);
+ else
+ strcpy (kernel_cmd, kernel_cmdline);
+
+ cpu_physical_memory_write(ram_size - TARGET_PAGE_SIZE, (void *)kernel_cmd, strlen(kernel_cmd) + 1);
+
+#if 0
+ if (initrd_size > 0)
+ sprintf (phys_ram_base+cmdline, "%s rd_start=0x" TARGET_FMT_lx " rd_size=%li",
+ kernel_cmdline,
+ PHYS_TO_VIRT(initrd_offset), initrd_size);
+ else
+ strcpy (phys_ram_base+cmdline, kernel_cmdline);
+#endif
+
+ env->active_tc.gpr[4] = PHYS_TO_VIRT(cmdline);/* a0 */
+ env->active_tc.gpr[5] = ram_size; /* a1 */
+ env->active_tc.gpr[6] = 0; /* a2 */
+ env->active_tc.gpr[7] = 0; /* a3 */
+
+}
+
+
+static void android_mips_init_(ram_addr_t ram_size,
+ const char *boot_device,
+ const char *kernel_filename,
+ const char *kernel_cmdline,
+ const char *initrd_filename,
+ const char *cpu_model)
+{
+ CPUState *env;
+ qemu_irq *goldfish_pic;
+ int i;
+ ram_addr_t ram_offset;
+
+ if (!cpu_model)
+ cpu_model = "24Kf";
+
+ env = cpu_init(cpu_model);
+
+ register_savevm( "cpu", 0, MIPS_CPU_SAVE_VERSION, cpu_save, cpu_load, env );
+
+ if (ram_size > GOLDFISH_IO_SPACE)
+ ram_size = GOLDFISH_IO_SPACE; /* avoid overlap of ram and IO regs */
+ ram_offset = qemu_ram_alloc(NULL, "android_mips", ram_size);
+ cpu_register_physical_memory(0, ram_size, ram_offset | IO_MEM_RAM);
+
+ /* Init internal devices */
+ cpu_mips_irq_init_cpu(env);
+ cpu_mips_clock_init(env);
+
+ goldfish_pic = goldfish_interrupt_init(GOLDFISH_INTERRUPT,
+ env->irq[2], env->irq[3]);
+ goldfish_device_init(goldfish_pic, GOLDFISH_DEVICES, 0x7f0000, 10, 22);
+
+ goldfish_device_bus_init(GOLDFISH_DEVICEBUS, 1);
+
+ goldfish_timer_and_rtc_init(GOLDFISH_RTC, 3);
+
+ goldfish_tty_add(serial_hds[0], 0, GOLDFISH_TTY, 4);
+ for(i = 1; i < MAX_SERIAL_PORTS; i++) {
+ if(serial_hds[i]) {
+ goldfish_tty_add(serial_hds[i], i, 0, 0);
+ }
+ }
+
+ for(i = 0; i < MAX_NICS; i++) {
+ if (nd_table[i].vlan) {
+ if (nd_table[i].model == NULL
+ || strcmp(nd_table[i].model, "smc91c111") == 0) {
+ struct goldfish_device *smc_device;
+ smc_device = qemu_mallocz(sizeof(*smc_device));
+ smc_device->name = "smc91x";
+ smc_device->id = i;
+ smc_device->size = 0x1000;
+ smc_device->irq_count = 1;
+ goldfish_add_device_no_io(smc_device);
+ smc91c111_init(&nd_table[i], smc_device->base, goldfish_pic[smc_device->irq]);
+ } else {
+ fprintf(stderr, "qemu: Unsupported NIC: %s\n", nd_table[0].model);
+ exit (1);
+ }
+ }
+ }
+
+ goldfish_fb_init(0);
+#ifdef HAS_AUDIO
+ goldfish_audio_init(GOLDFISH_AUDIO, 0, audio_input_source);
+#endif
+ {
+ DriveInfo* info = drive_get( IF_IDE, 0, 0 );
+ if (info != NULL) {
+ goldfish_mmc_init(GOLDFISH_MMC, 0, info->bdrv);
+ }
+ }
+ goldfish_memlog_init(GOLDFISH_MEMLOG);
+
+ if (android_hw->hw_battery)
+ goldfish_battery_init();
+
+ goldfish_add_device_no_io(&event0_device);
+ events_dev_init(event0_device.base, goldfish_pic[event0_device.irq]);
+
+#ifdef CONFIG_NAND
+ goldfish_add_device_no_io(&nand_device);
+ nand_dev_init(nand_device.base);
+#endif
+#ifdef CONFIG_TRACE
+ extern const char *trace_filename;
+ /* Init trace device if either tracing, or memory checking is enabled. */
+ if (trace_filename != NULL
+#ifdef CONFIG_MEMCHECK
+ || memcheck_enabled
+#endif // CONFIG_MEMCHECK
+ || 1 /* XXX: ALWAYS AVAILABLE FOR QEMUD PIPES */
+ ) {
+ trace_dev_init();
+ }
+ if (trace_filename != NULL) {
+ D( "Trace file name is set to %s\n", trace_filename );
+ } else {
+ D("Trace file name is not set\n");
+ }
+#endif
+
+ pipe_dev_init();
+
+#if TEST_SWITCH
+ {
+ void *sw;
+ sw = goldfish_switch_add("test", NULL, NULL, 0);
+ goldfish_switch_set_state(sw, 1);
+ goldfish_switch_add("test2", switch_test_write, sw, 1);
+ }
+#endif
+
+ android_load_kernel(env, ram_size, kernel_filename, kernel_cmdline, initrd_filename);
+}
+
+
+QEMUMachine android_mips_machine = {
+ "android_mips",
+ "MIPS Android Emulator",
+ android_mips_init_,
+ 0,
+ 0,
+ 1,
+ NULL
+};
+
+static void android_mips_init(void)
+{
+ qemu_register_machine(&android_mips_machine);
+}
+
+machine_init(android_mips_init);
diff --git a/hw/boards.h b/hw/boards.h
index 4a71e56..8242af6 100644
--- a/hw/boards.h
+++ b/hw/boards.h
@@ -27,4 +27,7 @@ extern QEMUMachine *current_machine;
/* android_arm.c */
extern QEMUMachine android_arm_machine;
+/* android_mips.c */
+extern QEMUMachine android_mips_machine;
+
#endif
diff --git a/hw/goldfish_pipe.c b/hw/goldfish_pipe.c
index 97daefb..276ac9a 100644
--- a/hw/goldfish_pipe.c
+++ b/hw/goldfish_pipe.c
@@ -55,7 +55,7 @@
/* Maximum length of pipe service name, in characters (excluding final 0) */
#define MAX_PIPE_SERVICE_NAME_SIZE 255
-#define GOLDFISH_PIPE_SAVE_VERSION 1
+#define GOLDFISH_PIPE_SAVE_VERSION 2
/***********************************************************************
***********************************************************************
@@ -960,9 +960,9 @@ struct PipeDevice {
uint32_t status;
uint32_t channel;
uint32_t wakes;
+ uint64_t params_addr;
};
-
static void
pipeDevice_doCommand( PipeDevice* dev, uint32_t command )
{
@@ -1097,6 +1097,42 @@ static void pipe_dev_write(void *opaque, target_phys_addr_t offset, uint32_t val
s->channel = value;
break;
+ case PIPE_REG_PARAMS_ADDR_HIGH:
+ s->params_addr = (s->params_addr & ~(0xFFFFFFFFULL << 32) ) |
+ ((uint64_t)value << 32);
+ break;
+
+ case PIPE_REG_PARAMS_ADDR_LOW:
+ s->params_addr = (s->params_addr & ~(0xFFFFFFFFULL) ) | value;
+ break;
+
+ case PIPE_REG_ACCESS_PARAMS:
+ {
+ struct access_params aps;
+ uint32_t cmd;
+
+ /* Don't touch aps.result if anything wrong */
+ if (s->params_addr == 0)
+ break;
+
+ cpu_physical_memory_read(s->params_addr, (void*)&aps,
+ sizeof(struct access_params));
+
+ /* sync pipe device state from batch buffer */
+ s->channel = aps.channel;
+ s->size = aps.size;
+ s->address = aps.address;
+ cmd = aps.cmd;
+ if ((cmd != PIPE_CMD_READ_BUFFER) && (cmd != PIPE_CMD_WRITE_BUFFER))
+ break;
+
+ pipeDevice_doCommand(s, cmd);
+ aps.result = s->status;
+ cpu_physical_memory_write(s->params_addr, (void*)&aps,
+ sizeof(struct access_params));
+ }
+ break;
+
default:
D("%s: offset=%d (0x%x) value=%d (0x%x)\n", __FUNCTION__, offset,
offset, value, value);
@@ -1136,6 +1172,12 @@ static uint32_t pipe_dev_read(void *opaque, target_phys_addr_t offset)
DR("%s: wakes %d", __FUNCTION__, dev->wakes);
return dev->wakes;
+ case PIPE_REG_PARAMS_ADDR_HIGH:
+ return dev->params_addr >> 32;
+
+ case PIPE_REG_PARAMS_ADDR_LOW:
+ return dev->params_addr & 0xFFFFFFFFUL;
+
default:
D("%s: offset=%d (0x%x)\n", __FUNCTION__, offset, offset);
}
@@ -1165,6 +1207,7 @@ goldfish_pipe_save( QEMUFile* file, void* opaque )
qemu_put_be32(file, dev->status);
qemu_put_be32(file, dev->channel);
qemu_put_be32(file, dev->wakes);
+ qemu_put_be64(file, dev->params_addr);
/* Count the number of pipe connections */
int count = 0;
@@ -1193,6 +1236,7 @@ goldfish_pipe_load( QEMUFile* file, void* opaque, int version_id )
dev->status = qemu_get_be32(file);
dev->channel = qemu_get_be32(file);
dev->wakes = qemu_get_be32(file);
+ dev->params_addr = qemu_get_be64(file);
/* Count the number of pipe connections */
int count = qemu_get_sbe32(file);
diff --git a/hw/goldfish_pipe.h b/hw/goldfish_pipe.h
index f08cef8..10efa96 100644
--- a/hw/goldfish_pipe.h
+++ b/hw/goldfish_pipe.h
@@ -153,6 +153,11 @@ extern void goldfish_pipe_wake( void* hwpipe, unsigned flags );
#define PIPE_REG_SIZE 0x0c /* read/write: buffer size */
#define PIPE_REG_ADDRESS 0x10 /* write: physical address */
#define PIPE_REG_WAKES 0x14 /* read: wake flags */
+/* read/write: parameter buffer address */
+#define PIPE_REG_PARAMS_ADDR_LOW 0x18
+#define PIPE_REG_PARAMS_ADDR_HIGH 0x1c
+/* write: access with paremeter buffer */
+#define PIPE_REG_ACCESS_PARAMS 0x20
/* list of commands for PIPE_REG_COMMAND */
#define PIPE_CMD_OPEN 1 /* open new channel */
@@ -189,4 +194,14 @@ extern void goldfish_pipe_wake( void* hwpipe, unsigned flags );
void pipe_dev_init(void);
+struct access_params{
+ uint32_t channel;
+ uint32_t size;
+ uint32_t address;
+ uint32_t cmd;
+ uint32_t result;
+ /* reserved for future extension */
+ uint32_t flags;
+};
+
#endif /* _HW_GOLDFISH_PIPE_H */
diff --git a/hw/mips_pic.c b/hw/mips_pic.c
new file mode 100644
index 0000000..9d146b8
--- /dev/null
+++ b/hw/mips_pic.c
@@ -0,0 +1,39 @@
+/*
+ * MIPS CPU interrupt support.
+ *
+ */
+
+#include "hw.h"
+
+/* Stub functions for hardware that don't exist. */
+void pic_info(void)
+{
+}
+
+void irq_info(void)
+{
+}
+
+static void mips_cpu_irq_handler(void *opaque, int irq, int level)
+{
+ CPUState *env = (CPUState *)opaque;
+ int causebit;
+
+ if (irq < 0 || 7 < irq)
+ cpu_abort(env, "mips_pic_cpu_handler: Bad interrupt line %d\n",
+ irq);
+
+ causebit = 0x00000100 << irq;
+ if (level) {
+ env->CP0_Cause |= causebit;
+ cpu_interrupt(env, CPU_INTERRUPT_HARD);
+ } else {
+ env->CP0_Cause &= ~causebit;
+ cpu_reset_interrupt(env, CPU_INTERRUPT_HARD);
+ }
+}
+
+qemu_irq *mips_cpu_irq_init(CPUState *env)
+{
+ return qemu_allocate_irqs(mips_cpu_irq_handler, env, 8);
+}
diff --git a/net-android.c b/net-android.c
index 6459eff..50b816c 100644
--- a/net-android.c
+++ b/net-android.c
@@ -1485,7 +1485,7 @@ static int launch_script(const char *setup_script, const char *ifname, int fd)
*parg++ = (char *)ifname;
*parg++ = NULL;
execv(setup_script, args);
- _exit(1);
+ exit(1);
} else if (pid > 0) {
while (waitpid(pid, &status, 0) != pid) {
/* loop */
diff --git a/net.c b/net.c
index 1deca85..219ed30 100644
--- a/net.c
+++ b/net.c
@@ -1357,7 +1357,7 @@ static int launch_script(const char *setup_script, const char *ifname, int fd)
*parg++ = (char *)ifname;
*parg++ = NULL;
execv(setup_script, args);
- _exit(1);
+ exit(1);
} else if (pid > 0) {
while (waitpid(pid, &status, 0) != pid) {
/* loop */
diff --git a/osdep.c b/osdep.c
index 6c402d9..a5efe92 100644
--- a/osdep.c
+++ b/osdep.c
@@ -186,10 +186,10 @@ int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
}
#ifdef WIN32
-int asprintf( char **, char *, ... );
-int vasprintf( char **, char *, va_list );
+int asprintf( char **, const char *, ... );
+int vasprintf( char **, const char *, va_list );
-int vasprintf( char **sptr, char *fmt, va_list argv )
+int vasprintf( char **sptr, const char *fmt, va_list argv )
{
int wanted = vsnprintf( *sptr = NULL, 0, fmt, argv );
if( (wanted > 0) && ((*sptr = malloc( 1 + wanted )) != NULL) )
@@ -198,7 +198,7 @@ int vasprintf( char **sptr, char *fmt, va_list argv )
return wanted;
}
-int asprintf( char **sptr, char *fmt, ... )
+int asprintf( char **sptr, const char *fmt, ... )
{
int retval;
va_list argv;
diff --git a/qemu-common.h b/qemu-common.h
index 79ac779..097e1fc 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -408,4 +408,20 @@ typedef enum DisplayType
#define CLAMP_MAC_TIMEOUT(to) ((void)0)
#endif // _DARWIN_C_SOURCE
+#if defined(__clang__) || defined(__llvm__)
+/* Clang and llvm-gcc don't support global register variable (GRV).
+ Clang issues compile-time error for GRV. llvm-gcc accepts GRV (because
+ its front-end is gcc) but ignores it in the llvm-based back-end.
+ Undefining GRV decl to allow external/qemu and the rest of Android
+ to compile. But emulator built w/o GRV support will not function
+ correctly. User will be greeted with an error message (issued
+ in tcg/tcg.c) when emulator built this way is launched.
+ */
+#define SUPPORT_GLOBAL_REGISTER_VARIABLE 0
+#define GLOBAL_REGISTER_VARIABLE_DECL
+#else
+#define SUPPORT_GLOBAL_REGISTER_VARIABLE 1
+#define GLOBAL_REGISTER_VARIABLE_DECL register
+#endif /* __clang__ || __llvm__ */
+
#endif
diff --git a/sockets.c b/sockets.c
index 1063339..0879c06 100644
--- a/sockets.c
+++ b/sockets.c
@@ -125,7 +125,7 @@ static const WinsockError _winsock_errors[] = {
* errno.
*/
static int
-_fix_errno( void )
+fix_errno( void )
{
const WinsockError* werr = _winsock_errors;
int unix = EINVAL; /* generic error code */
@@ -143,7 +143,7 @@ _fix_errno( void )
}
static int
-_set_errno( int code )
+set_errno( int code )
{
winsock_error = -1;
errno = code;
@@ -173,13 +173,13 @@ _errno_str(void)
}
#else
static int
-_fix_errno( void )
+fix_errno( void )
{
return -1;
}
static int
-_set_errno( int code )
+set_errno( int code )
{
errno = code;
return -1;
@@ -560,7 +560,7 @@ sock_address_to_bsd( const SockAddress* a, sockaddr_storage* paddress, socklen
#endif /* HAVE_UNIX_SOCKETS */
default:
- return _set_errno(EINVAL);
+ return set_errno(EINVAL);
}
return 0;
@@ -575,7 +575,7 @@ sock_address_from_bsd( SockAddress* a, const void* from, size_t fromlen )
const struct sockaddr_in* src = from;
if (fromlen < sizeof(*src))
- return _set_errno(EINVAL);
+ return set_errno(EINVAL);
a->family = SOCKET_INET;
a->u.inet.port = ntohs(src->sin_port);
@@ -589,7 +589,7 @@ sock_address_from_bsd( SockAddress* a, const void* from, size_t fromlen )
const struct sockaddr_in6* src = from;
if (fromlen < sizeof(*src))
- return _set_errno(EINVAL);
+ return set_errno(EINVAL);
a->family = SOCKET_IN6;
a->u.in6.port = ntohs(src->sin6_port);
@@ -605,12 +605,12 @@ sock_address_from_bsd( SockAddress* a, const void* from, size_t fromlen )
char* end;
if (fromlen < sizeof(*src))
- return _set_errno(EINVAL);
+ return set_errno(EINVAL);
/* check that the path is zero-terminated */
end = memchr(src->sun_path, 0, UNIX_PATH_MAX);
if (end == NULL)
- return _set_errno(EINVAL);
+ return set_errno(EINVAL);
a->family = SOCKET_UNIX;
a->u._unix.owner = 1;
@@ -620,7 +620,7 @@ sock_address_from_bsd( SockAddress* a, const void* from, size_t fromlen )
#endif
default:
- return _set_errno(EINVAL);
+ return set_errno(EINVAL);
}
return 0;
}
@@ -646,7 +646,8 @@ sock_address_init_resolve( SockAddress* a, const char* hostname, uint16_t por
err = EHOSTDOWN;
break;
-#ifdef EAI_NODATA
+/* NOTE that in x86_64-w64-mingw32 both EAI_NODATA and EAI_NONAME are the same */
+#if defined(EAI_NODATA) && (EAI_NODATA != EAI_NONAME)
case EAI_NODATA:
#endif
case EAI_NONAME:
@@ -660,7 +661,7 @@ sock_address_init_resolve( SockAddress* a, const char* hostname, uint16_t por
default:
err = EINVAL;
}
- return _set_errno(err);
+ return set_errno(err);
}
/* Parse the returned list of addresses. */
@@ -699,7 +700,7 @@ sock_address_init_resolve( SockAddress* a, const char* hostname, uint16_t por
}
if (r == NULL) {
- ret = _set_errno(ENOENT);
+ ret = set_errno(ENOENT);
goto Exit;
}
@@ -765,13 +766,13 @@ sock_address_list_create( const char* hostname,
case EAI_ADDRFAMILY:
#endif
case EAI_NODATA:
- _set_errno(ENOENT);
+ set_errno(ENOENT);
break;
case EAI_FAMILY:
- _set_errno(EAFNOSUPPORT);
+ set_errno(EAFNOSUPPORT);
break;
case EAI_AGAIN:
- _set_errno(EAGAIN);
+ set_errno(EAGAIN);
break;
#ifdef EAI_SYSTEM
case EAI_SYSTEM:
@@ -780,7 +781,7 @@ sock_address_list_create( const char* hostname,
break;
#endif
default:
- _set_errno(EINVAL);
+ set_errno(EINVAL);
}
return NULL;
}
@@ -874,7 +875,7 @@ sock_address_get_numeric_info( SockAddress* a,
break;
#endif
default:
- return _set_errno(EINVAL);
+ return set_errno(EINVAL);
}
ret = getnameinfo( saddr, slen, host, hostlen, serv, servlen,
@@ -900,12 +901,12 @@ socket_create( SocketFamily family, SocketType type )
int stype = socket_type_to_bsd(type);
if (sfamily < 0 || stype < 0) {
- return _set_errno(EINVAL);
+ return set_errno(EINVAL);
}
QSOCKET_CALL(ret, socket(sfamily, stype, 0));
if (ret < 0)
- return _fix_errno();
+ return fix_errno();
return ret;
}
@@ -956,7 +957,7 @@ int socket_can_read(int fd)
int ret; \
QSOCKET_CALL(ret, (cmd)); \
if (ret < 0) \
- return _fix_errno(); \
+ return fix_errno(); \
return ret; \
int
@@ -998,7 +999,7 @@ socket_recvfrom(int fd, void* buf, int len, SockAddress* from)
QSOCKET_CALL(ret,recvfrom(fd,buf,len,0,sa.sa,&salen));
if (ret < 0)
- return _fix_errno();
+ return fix_errno();
if (sock_address_from_bsd(from, &sa, salen) < 0)
return -1;
@@ -1039,7 +1040,7 @@ socket_get_address( int fd, SockAddress* address )
QSOCKET_CALL(ret, getsockname(fd, addr.sa, &addrlen));
if (ret < 0)
- return _fix_errno();
+ return fix_errno();
return sock_address_from_bsd(address, &addr, addrlen);
}
@@ -1053,7 +1054,7 @@ socket_get_peer_address( int fd, SockAddress* address )
QSOCKET_CALL(ret, getpeername(fd, addr.sa, &addrlen));
if (ret < 0)
- return _fix_errno();
+ return fix_errno();
return sock_address_from_bsd(address, &addr, addrlen);
}
@@ -1073,7 +1074,7 @@ socket_accept( int fd, SockAddress* address )
QSOCKET_CALL(ret, accept(fd, addr.sa, &addrlen));
if (ret < 0)
- return _fix_errno();
+ return fix_errno();
if (address) {
if (sock_address_from_bsd(address, &addr, addrlen) < 0) {
@@ -1517,7 +1518,7 @@ socket_mcast_inet_add_membership( int s, uint32_t ip )
(const char *)&imr,
sizeof(struct ip_mreq)) < 0 )
{
- return _fix_errno();
+ return fix_errno();
}
return 0;
}
@@ -1534,7 +1535,7 @@ socket_mcast_inet_drop_membership( int s, uint32_t ip )
(const char *)&imr,
sizeof(struct ip_mreq)) < 0 )
{
- return _fix_errno();
+ return fix_errno();
}
return 0;
}
diff --git a/softmmu_outside_jit.h b/softmmu_outside_jit.h
index 07ba4c7..21ead05 100644
--- a/softmmu_outside_jit.h
+++ b/softmmu_outside_jit.h
@@ -49,7 +49,11 @@ void REGPARM __stq_outside_jit(target_ulong addr, uint64_t val, int mmu_idx);
// =============================================================================
// Generate ld/stx_user
// =============================================================================
+#if defined(TARGET_MIPS)
+#define MEMSUFFIX MMU_MODE2_SUFFIX
+#else
#define MEMSUFFIX MMU_MODE1_SUFFIX
+#endif
#define ACCESS_TYPE 1
#define DATA_SIZE 1
diff --git a/tap-win32.c b/tap-win32.c
index ba93355..ce30a50 100644
--- a/tap-win32.c
+++ b/tap-win32.c
@@ -31,13 +31,7 @@
#include "sysemu.h"
#include <stdio.h>
#include <windows.h>
-
-/* NOTE: PCIBus is redefined in winddk.h */
-#define PCIBus _PCIBus
-#include <ddk/ntapi.h>
-#include <ddk/winddk.h>
-#include <ddk/ntddk.h>
-#undef PCIBus
+#include <winioctl.h>
//=============
// TAP IOCTLs
diff --git a/target-arm/exec.h b/target-arm/exec.h
index 07bfd57..43bfaa9 100644
--- a/target-arm/exec.h
+++ b/target-arm/exec.h
@@ -19,7 +19,7 @@
#include "config.h"
#include "dyngen-exec.h"
-register struct CPUARMState *env asm(AREG0);
+GLOBAL_REGISTER_VARIABLE_DECL struct CPUARMState *env asm(AREG0);
#include "cpu.h"
#include "exec-all.h"
diff --git a/target-i386/exec.h b/target-i386/exec.h
index 42b471a..5d04b7f 100644
--- a/target-i386/exec.h
+++ b/target-i386/exec.h
@@ -29,7 +29,7 @@
#include "cpu-defs.h"
-register struct CPUX86State *env asm(AREG0);
+GLOBAL_REGISTER_VARIABLE_DECL struct CPUX86State *env asm(AREG0);
#include "qemu-common.h"
#include "qemu-log.h"
diff --git a/target-mips/cpu.h b/target-mips/cpu.h
index 27bdc95..46519e3 100644
--- a/target-mips/cpu.h
+++ b/target-mips/cpu.h
@@ -39,7 +39,6 @@ struct r4k_tlb_t {
typedef struct CPUMIPSTLBContext CPUMIPSTLBContext;
struct CPUMIPSTLBContext {
uint32_t nb_tlb;
- uint32_t tlb_in_use;
int (*map_address) (struct CPUMIPSState *env, target_phys_addr_t *physical, int *prot, target_ulong address, int rw, int access_type);
void (*helper_tlbwi) (void);
void (*helper_tlbwr) (void);
@@ -518,6 +517,37 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)
env->active_tc.gpr[2] = 0;
}
+static inline int cpu_mips_hw_interrupts_pending(CPUState *env)
+{
+ int32_t pending;
+ int32_t status;
+ int r;
+
+ if (!(env->CP0_Status & (1 << CP0St_IE)) ||
+ (env->CP0_Status & (1 << CP0St_EXL)) ||
+ (env->CP0_Status & (1 << CP0St_ERL)) ||
+ (env->hflags & MIPS_HFLAG_DM)) {
+ /* Interrupts are disabled */
+ return 0;
+ }
+
+ pending = env->CP0_Cause & CP0Ca_IP_mask;
+ status = env->CP0_Status & CP0Ca_IP_mask;
+
+ if (env->CP0_Config3 & (1 << CP0C3_VEIC)) {
+ /* A MIPS configured with a vectorizing external interrupt controller
+ will feed a vector into the Cause pending lines. The core treats
+ the status lines as a vector level, not as indiviual masks. */
+ r = pending > status;
+ } else {
+ /* A MIPS configured with compatibility or VInt (Vectored Interrupts)
+ treats the pending lines as individual interrupt lines, the status
+ lines are individual masks. */
+ r = pending & status;
+ }
+ return r;
+}
+
#include "cpu-all.h"
#include "exec-all.h"
@@ -599,7 +629,6 @@ int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
int mmu_idx, int is_softmmu);
#define cpu_handle_mmu_fault cpu_mips_handle_mmu_fault
void do_interrupt (CPUState *env);
-void r4k_invalidate_tlb (CPUState *env, int idx, int use_extra);
target_phys_addr_t cpu_mips_translate_address (CPUState *env, target_ulong address,
int rw);
diff --git a/target-mips/exec.h b/target-mips/exec.h
index 8a118bb..0d55790 100644
--- a/target-mips/exec.h
+++ b/target-mips/exec.h
@@ -8,7 +8,7 @@
#include "dyngen-exec.h"
#include "cpu-defs.h"
-register struct CPUMIPSState *env asm(AREG0);
+GLOBAL_REGISTER_VARIABLE_DECL struct CPUMIPSState *env asm(AREG0);
#include "cpu.h"
#include "exec-all.h"
@@ -35,10 +35,22 @@ static inline void regs_to_env(void)
static inline int cpu_has_work(CPUState *env)
{
- return (env->interrupt_request &
- (CPU_INTERRUPT_HARD | CPU_INTERRUPT_TIMER));
-}
+ int has_work = 0;
+
+ /* It is implementation dependent if non-enabled interrupts
+ wake-up the CPU, however most of the implementations only
+ check for interrupts that can be taken. */
+ if ((env->interrupt_request & CPU_INTERRUPT_HARD) &&
+ cpu_mips_hw_interrupts_pending(env)) {
+ has_work = 1;
+ }
+ if (env->interrupt_request & CPU_INTERRUPT_TIMER) {
+ has_work = 1;
+ }
+
+ return has_work;
+}
static inline int cpu_halted(CPUState *env)
{
diff --git a/target-mips/helper.c b/target-mips/helper.c
index ec87114..838ccbb 100644
--- a/target-mips/helper.c
+++ b/target-mips/helper.c
@@ -66,14 +66,20 @@ int r4k_map_address (CPUState *env, target_phys_addr_t *physical, int *prot,
target_ulong address, int rw, int access_type)
{
uint8_t ASID = env->CP0_EntryHi & 0xFF;
+ r4k_tlb_t *tlb;
+ target_ulong mask;
+ target_ulong tag;
+ target_ulong VPN;
+ int n;
int i;
- for (i = 0; i < env->tlb->tlb_in_use; i++) {
- r4k_tlb_t *tlb = &env->tlb->mmu.r4k.tlb[i];
+ for (i = 0; i < env->tlb->nb_tlb; i++) {
+ tlb = &env->tlb->mmu.r4k.tlb[i];
/* 1k pages are not supported. */
- target_ulong mask = tlb->PageMask | ~(TARGET_PAGE_MASK << 1);
- target_ulong tag = address & ~mask;
- target_ulong VPN = tlb->VPN & ~mask;
+ mask = ~(TARGET_PAGE_MASK << 1);
+ tag = address & ~mask;
+ VPN = tlb->VPN & ~mask;
+
#if defined(TARGET_MIPS64)
tag &= env->SEGMask;
#endif
@@ -81,7 +87,7 @@ int r4k_map_address (CPUState *env, target_phys_addr_t *physical, int *prot,
/* Check ASID, virtual page number & size */
if ((tlb->G == 1 || tlb->ASID == ASID) && VPN == tag) {
/* TLB match */
- int n = !!(address & mask & ~(mask >> 1));
+ n = !!(address & mask & ~(mask >> 1));
/* Check access rights */
if (!(n ? tlb->V1 : tlb->V0))
return TLBRET_INVALID;
@@ -120,7 +126,7 @@ static int get_physical_address (CPUState *env, target_phys_addr_t *physical,
if (address <= (int32_t)0x7FFFFFFFUL) {
/* useg */
- if (env->CP0_Status & (1 << CP0St_ERL)) {
+ if (unlikely(env->CP0_Status & (1 << CP0St_ERL))) {
*physical = address & 0xFFFFFFFF;
*prot = PAGE_READ | PAGE_WRITE;
} else {
@@ -253,18 +259,140 @@ static void raise_mmu_exception(CPUState *env, target_ulong address,
env->error_code = error_code;
}
-target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
+/*
+ * Get the pgd_current from TLB exception handler
+ * The exception handler is generated by function build_r4000_tlb_refill_handler.
+ * 0x80000000:0x3c1b8033: lui k1,0x8033
+ * 0x80000004:0x401a4000: mfc0 k0,c0_badvaddr
+ * 0x80000008:0x8f7bb000: lw k1,-20480(k1)
+ *
+ */
+static inline target_ulong cpu_mips_get_pgd(CPUState *env)
{
-#if defined(CONFIG_USER_ONLY)
- return addr;
-#else
- target_phys_addr_t phys_addr;
- int prot;
+ static target_ulong pgd_current_p = 0;
+ static target_ulong probed = 0;
- if (get_physical_address(env, &phys_addr, &prot, addr, 0, ACCESS_INT) != 0)
- return -1;
- return phys_addr;
-#endif
+ if (likely(pgd_current_p)) {
+ /* Get pgd_current */
+ return ldl_phys(pgd_current_p);
+ }
+ else if (unlikely(!probed)) {
+ uint32_t ins1, ins2;
+ uint32_t address;
+ uint32_t ebase;
+
+ probed = 1;
+
+ ebase = env->CP0_EBase - 0x80000000;
+
+ /* Get pgd_current pointer from TLB refill exception handler */
+ ins1 = ldl_phys(ebase); /* lui k1,%hi(pgd_current_p) */
+ ins2 = ldl_phys(ebase + 8); /* lw k1,%lo(pgd_current_p)(k1) */
+
+ address = ((ins1 & 0xffff)<<16);
+ address += (((int32_t)(ins2 & 0xffff))<<16)>>16;
+ /* assumes pgd_current_p != 0 */
+ if (address > 0x80000000 && address < 0xa0000000) {
+ pgd_current_p = address -= 0x80000000;
+ return ldl_phys(pgd_current_p);
+ }
+ }
+ return 0;
+}
+
+static inline int cpu_mips_tlb_refill(CPUState *env, target_ulong address, int rw ,
+ int mmu_idx, int is_softmmu)
+{
+ int32_t saved_hflags;
+ target_ulong saved_badvaddr,saved_entryhi,saved_context;
+
+ target_ulong pgd_addr,pt_addr,index;
+ target_ulong fault_addr,ptw_phys;
+ target_ulong elo_even,elo_odd;
+ uint32_t page_valid;
+ int ret;
+
+ saved_badvaddr = env->CP0_BadVAddr;
+ saved_context = env->CP0_Context;
+ saved_entryhi = env->CP0_EntryHi;
+ saved_hflags = env->hflags;
+
+ env->CP0_BadVAddr = address;
+ env->CP0_Context = (env->CP0_Context & ~0x007fffff) |
+ ((address >> 9) & 0x007ffff0);
+ env->CP0_EntryHi =
+ (env->CP0_EntryHi & 0xFF) | (address & (TARGET_PAGE_MASK << 1));
+
+ env->hflags = MIPS_HFLAG_KM;
+
+ fault_addr = env->CP0_BadVAddr;
+ page_valid = 0;
+
+ pgd_addr = cpu_mips_get_pgd(env);
+ if (unlikely(!pgd_addr))
+ {
+ /*not valid pgd_addr,just return.*/
+ //return TLBRET_NOMATCH;
+ ret = TLBRET_NOMATCH;
+ goto out;
+ }
+
+ ptw_phys = pgd_addr - (int32_t)0x80000000UL;
+ index = (fault_addr>>22)<<2;
+ ptw_phys += index;
+
+ pt_addr = ldl_phys(ptw_phys);
+
+ ptw_phys = pt_addr - (int32_t)0x80000000UL;
+ index = (env->CP0_Context>>1)&0xff8;
+ ptw_phys += index;
+
+ /*get the page table entry*/
+ elo_even = ldl_phys(ptw_phys);
+ elo_odd = ldl_phys(ptw_phys+4);
+ elo_even = elo_even >> 6;
+ elo_odd = elo_odd >> 6;
+ env->CP0_EntryLo0 = elo_even;
+ env->CP0_EntryLo1 = elo_odd;
+ /*Done. refill the TLB */
+ r4k_helper_ptw_tlbrefill(env);
+
+ /* Since we know the value of TLB entry, we can
+ * return the TLB lookup value here.
+ */
+
+ env->hflags = saved_hflags;
+
+ target_ulong mask = env->CP0_PageMask | ~(TARGET_PAGE_MASK << 1);
+ int n = !!(address & mask & ~(mask >> 1));
+ /* Check access rights */
+ if (!(n ? (elo_odd & 2) != 0 : (elo_even & 2) != 0))
+ {
+ ret = TLBRET_INVALID;
+ goto out;
+ }
+
+ if (rw == 0 || (n ? (elo_odd & 4) != 0 : (elo_even & 4) != 0)) {
+ target_ulong physical = (n?(elo_odd >> 6) << 12 : (elo_even >> 6) << 12);
+ physical |= (address & (mask >> 1));
+ int prot = PAGE_READ;
+ if (n ? (elo_odd & 4) != 0 : (elo_even & 4) != 0)
+ prot |= PAGE_WRITE;
+
+ tlb_set_page(env, address & TARGET_PAGE_MASK,
+ physical & TARGET_PAGE_MASK, prot,
+ mmu_idx, is_softmmu);
+ ret = TLBRET_MATCH;
+ goto out;
+ }
+ ret = TLBRET_DIRTY;
+
+out:
+ env->CP0_BadVAddr = saved_badvaddr;
+ env->CP0_Context = saved_context;
+ env->CP0_EntryHi = saved_entryhi;
+ env->hflags = saved_hflags;
+ return ret;
}
int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
@@ -274,6 +402,7 @@ int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
target_phys_addr_t physical;
int prot;
#endif
+ int exception = 0, error_code = 0;
int access_type;
int ret = 0;
@@ -300,7 +429,10 @@ int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
ret = tlb_set_page(env, address & TARGET_PAGE_MASK,
physical & TARGET_PAGE_MASK, prot,
mmu_idx, is_softmmu);
- } else if (ret < 0)
+ }
+ else if (ret == TLBRET_NOMATCH)
+ ret = cpu_mips_tlb_refill(env,address,rw,mmu_idx,is_softmmu);
+ if (ret < 0)
#endif
{
raise_mmu_exception(env, address, rw, ret);
@@ -324,7 +456,7 @@ target_phys_addr_t cpu_mips_translate_address(CPUState *env, target_ulong addres
access_type = ACCESS_INT;
ret = get_physical_address(env, &physical, &prot,
address, rw, access_type);
- if (ret != TLBRET_MATCH) {
+ if (ret != TLBRET_MATCH || ret != TLBRET_DIRTY) {
raise_mmu_exception(env, address, rw, ret);
return -1LL;
} else {
@@ -333,6 +465,48 @@ target_phys_addr_t cpu_mips_translate_address(CPUState *env, target_ulong addres
}
#endif
+target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
+{
+#if defined(CONFIG_USER_ONLY)
+ return addr;
+#else
+ target_phys_addr_t phys_addr;
+ int prot, ret;
+
+ ret = get_physical_address(env, &phys_addr, &prot, addr, 0, ACCESS_INT);
+ if (ret != TLBRET_MATCH && ret != TLBRET_DIRTY) {
+ target_ulong pgd_addr = cpu_mips_get_pgd(env);
+ if (unlikely(!pgd_addr)) {
+ phys_addr = -1;
+ }
+ else {
+ target_ulong pgd_phys, pgd_index;
+ target_ulong pt_addr, pt_phys, pt_index;
+ target_ulong lo;
+ /* Mimic the steps taken for a TLB refill */
+ pgd_phys = pgd_addr - (int32_t)0x80000000UL;
+ pgd_index = (addr >> 22) << 2;
+ pt_addr = ldl_phys(pgd_phys + pgd_index);
+ pt_phys = pt_addr - (int32_t)0x80000000UL;
+ pt_index = (((addr >> 9) & 0x007ffff0) >> 1) & 0xff8;
+ /* get the entrylo value */
+ if (addr & 0x1000)
+ lo = ldl_phys(pt_phys + pt_index + 4);
+ else
+ lo = ldl_phys(pt_phys + pt_index);
+ /* convert software TLB entry to hardware value */
+ lo >>= 6;
+ if (lo & 0x00000002)
+ /* It is valid */
+ phys_addr = (lo >> 6) << 12;
+ else
+ phys_addr = -1;
+ }
+ }
+ return phys_addr;
+#endif
+}
+
static const char * const excp_names[EXCP_LAST + 1] = {
[EXCP_RESET] = "reset",
[EXCP_SRESET] = "soft reset",
@@ -592,7 +766,7 @@ void do_interrupt (CPUState *env)
env->exception_index = EXCP_NONE;
}
-void r4k_invalidate_tlb (CPUState *env, int idx, int use_extra)
+void r4k_invalidate_tlb (CPUState *env, int idx)
{
r4k_tlb_t *tlb;
target_ulong addr;
@@ -607,15 +781,6 @@ void r4k_invalidate_tlb (CPUState *env, int idx, int use_extra)
return;
}
- if (use_extra && env->tlb->tlb_in_use < MIPS_TLB_MAX) {
- /* For tlbwr, we can shadow the discarded entry into
- a new (fake) TLB entry, as long as the guest can not
- tell that it's there. */
- env->tlb->mmu.r4k.tlb[env->tlb->tlb_in_use] = *tlb;
- env->tlb->tlb_in_use++;
- return;
- }
-
/* 1k pages are not supported. */
mask = tlb->PageMask | ~(TARGET_PAGE_MASK << 1);
if (tlb->V0) {
diff --git a/target-mips/machine.c b/target-mips/machine.c
index 9ffac71..04985b1 100644
--- a/target-mips/machine.c
+++ b/target-mips/machine.c
@@ -58,7 +58,6 @@ void cpu_save(QEMUFile *f, void *opaque)
/* Save TLB */
qemu_put_be32s(f, &env->tlb->nb_tlb);
- qemu_put_be32s(f, &env->tlb->tlb_in_use);
for(i = 0; i < MIPS_TLB_MAX; i++) {
uint16_t flags = ((env->tlb->mmu.r4k.tlb[i].G << 10) |
(env->tlb->mmu.r4k.tlb[i].C0 << 7) |
@@ -209,7 +208,6 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id)
/* Load TLB */
qemu_get_be32s(f, &env->tlb->nb_tlb);
- qemu_get_be32s(f, &env->tlb->tlb_in_use);
for(i = 0; i < MIPS_TLB_MAX; i++) {
uint16_t flags;
uint8_t asid;
diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
index 61a39df..783a1a9 100644
--- a/target-mips/op_helper.c
+++ b/target-mips/op_helper.c
@@ -1498,20 +1498,69 @@ target_ulong helper_yield(target_ulong arg1)
}
#ifndef CONFIG_USER_ONLY
-/* TLB management */
-void cpu_mips_tlb_flush (CPUState *env, int flush_global)
+static void inline r4k_invalidate_tlb_shadow (CPUState *env, int idx)
{
- /* Flush qemu's TLB and discard all shadowed entries. */
- tlb_flush (env, flush_global);
- env->tlb->tlb_in_use = env->tlb->nb_tlb;
+ r4k_tlb_t *tlb;
+ uint8_t ASID = env->CP0_EntryHi & 0xFF;
+
+ tlb = &env->tlb->mmu.r4k.tlb[idx];
+ /* The qemu TLB is flushed when the ASID changes, so no need to
+ flush these entries again. */
+ if (tlb->G == 0 && tlb->ASID != ASID) {
+ return;
+ }
}
-static void r4k_mips_tlb_flush_extra (CPUState *env, int first)
+static void inline r4k_invalidate_tlb (CPUState *env, int idx)
{
- /* Discard entries from env->tlb[first] onwards. */
- while (env->tlb->tlb_in_use > first) {
- r4k_invalidate_tlb(env, --env->tlb->tlb_in_use, 0);
+ r4k_tlb_t *tlb;
+ target_ulong addr;
+ target_ulong end;
+ uint8_t ASID = env->CP0_EntryHi & 0xFF;
+ target_ulong mask;
+
+ tlb = &env->tlb->mmu.r4k.tlb[idx];
+ /* The qemu TLB is flushed when the ASID changes, so no need to
+ flush these entries again. */
+ if (tlb->G == 0 && tlb->ASID != ASID) {
+ return;
+ }
+
+ /* 1k pages are not supported. */
+ mask = tlb->PageMask | ~(TARGET_PAGE_MASK << 1);
+ if (tlb->V0) {
+ addr = tlb->VPN & ~mask;
+#if defined(TARGET_MIPS64)
+ if (addr >= (0xFFFFFFFF80000000ULL & env->SEGMask)) {
+ addr |= 0x3FFFFF0000000000ULL;
+ }
+#endif
+ end = addr | (mask >> 1);
+ while (addr < end) {
+ tlb_flush_page (env, addr);
+ addr += TARGET_PAGE_SIZE;
+ }
}
+ if (tlb->V1) {
+ addr = (tlb->VPN & ~mask) | ((mask >> 1) + 1);
+#if defined(TARGET_MIPS64)
+ if (addr >= (0xFFFFFFFF80000000ULL & env->SEGMask)) {
+ addr |= 0x3FFFFF0000000000ULL;
+ }
+#endif
+ end = addr | mask;
+ while (addr - 1 < end) {
+ tlb_flush_page (env, addr);
+ addr += TARGET_PAGE_SIZE;
+ }
+ }
+}
+
+/* TLB management */
+void cpu_mips_tlb_flush (CPUState *env, int flush_global)
+{
+ /* Flush qemu's TLB and discard all shadowed entries. */
+ tlb_flush (env, flush_global);
}
static void r4k_fill_tlb (int idx)
@@ -1537,26 +1586,65 @@ static void r4k_fill_tlb (int idx)
tlb->PFN[1] = (env->CP0_EntryLo1 >> 6) << 12;
}
+void r4k_helper_ptw_tlbrefill(CPUState *target_env)
+{
+ CPUState *saved_env;
+
+ /* Save current 'env' value */
+ saved_env = env;
+ env = target_env;
+
+ /* Do TLB load on behalf of Page Table Walk */
+ int r = cpu_mips_get_random(env);
+ r4k_invalidate_tlb_shadow(env, r);
+ r4k_fill_tlb(r);
+
+ /* Restore 'env' value */
+ env = saved_env;
+}
+
void r4k_helper_tlbwi (void)
{
- int idx;
+ r4k_tlb_t *tlb;
+ target_ulong tag;
+ target_ulong VPN;
+ target_ulong mask;
- idx = (env->CP0_Index & ~0x80000000) % env->tlb->nb_tlb;
+ /* If tlbwi is trying to upgrading access permissions on current entry,
+ * we do not need to flush tlb hash table.
+ */
+ tlb = &env->tlb->mmu.r4k.tlb[env->CP0_Index % env->tlb->nb_tlb];
+ mask = tlb->PageMask | ~(TARGET_PAGE_MASK << 1);
+ tag = env->CP0_EntryHi & ~mask;
+ VPN = tlb->VPN & ~mask;
+ if (VPN == tag)
+ {
+ if (tlb->ASID == (env->CP0_EntryHi & 0xFF))
+ {
+ tlb->V0 = (env->CP0_EntryLo0 & 2) != 0;
+ tlb->D0 = (env->CP0_EntryLo0 & 4) != 0;
+ tlb->C0 = (env->CP0_EntryLo0 >> 3) & 0x7;
+ tlb->PFN[0] = (env->CP0_EntryLo0 >> 6) << 12;
+ tlb->V1 = (env->CP0_EntryLo1 & 2) != 0;
+ tlb->D1 = (env->CP0_EntryLo1 & 4) != 0;
+ tlb->C1 = (env->CP0_EntryLo1 >> 3) & 0x7;
+ tlb->PFN[1] = (env->CP0_EntryLo1 >> 6) << 12;
+ return;
+ }
+ }
- /* Discard cached TLB entries. We could avoid doing this if the
- tlbwi is just upgrading access permissions on the current entry;
- that might be a further win. */
- r4k_mips_tlb_flush_extra (env, env->tlb->nb_tlb);
+ /*flush all the tlb cache */
+ cpu_mips_tlb_flush (env, 1);
- r4k_invalidate_tlb(env, idx, 0);
- r4k_fill_tlb(idx);
+ r4k_invalidate_tlb(env, env->CP0_Index % env->tlb->nb_tlb);
+ r4k_fill_tlb(env->CP0_Index % env->tlb->nb_tlb);
}
void r4k_helper_tlbwr (void)
{
int r = cpu_mips_get_random(env);
- r4k_invalidate_tlb(env, r, 1);
+ r4k_invalidate_tlb_shadow(env, r);
r4k_fill_tlb(r);
}
@@ -1568,6 +1656,8 @@ void r4k_helper_tlbp (void)
target_ulong VPN;
uint8_t ASID;
int i;
+ target_ulong addr;
+ target_ulong end;
ASID = env->CP0_EntryHi & 0xFF;
for (i = 0; i < env->tlb->nb_tlb; i++) {
@@ -1577,27 +1667,16 @@ void r4k_helper_tlbp (void)
tag = env->CP0_EntryHi & ~mask;
VPN = tlb->VPN & ~mask;
/* Check ASID, virtual page number & size */
- if ((tlb->G == 1 || tlb->ASID == ASID) && VPN == tag) {
+ if (unlikely((tlb->G == 1 || tlb->ASID == ASID) && VPN == tag)) {
/* TLB match */
env->CP0_Index = i;
break;
}
}
if (i == env->tlb->nb_tlb) {
- /* No match. Discard any shadow entries, if any of them match. */
- for (i = env->tlb->nb_tlb; i < env->tlb->tlb_in_use; i++) {
- tlb = &env->tlb->mmu.r4k.tlb[i];
- /* 1k pages are not supported. */
- mask = tlb->PageMask | ~(TARGET_PAGE_MASK << 1);
- tag = env->CP0_EntryHi & ~mask;
- VPN = tlb->VPN & ~mask;
- /* Check ASID, virtual page number & size */
- if ((tlb->G == 1 || tlb->ASID == ASID) && VPN == tag) {
- r4k_mips_tlb_flush_extra (env, i);
- break;
- }
- }
-
+ /* No match. Discard any shadow entries, if any of them match. */
+ int index = ((env->CP0_EntryHi>>5)&0x1ff00) | ASID;
+ index |= (env->CP0_EntryHi>>13)&0x20000;
env->CP0_Index |= 0x80000000;
}
}
@@ -1606,17 +1685,16 @@ void r4k_helper_tlbr (void)
{
r4k_tlb_t *tlb;
uint8_t ASID;
- int idx;
ASID = env->CP0_EntryHi & 0xFF;
- idx = (env->CP0_Index & ~0x80000000) % env->tlb->nb_tlb;
- tlb = &env->tlb->mmu.r4k.tlb[idx];
+ tlb = &env->tlb->mmu.r4k.tlb[env->CP0_Index % env->tlb->nb_tlb];
/* If this will change the current ASID, flush qemu's TLB. */
if (ASID != tlb->ASID)
cpu_mips_tlb_flush (env, 1);
- r4k_mips_tlb_flush_extra(env, env->tlb->nb_tlb);
+ /*flush all the tlb cache */
+ cpu_mips_tlb_flush (env, 1);
env->CP0_EntryHi = tlb->VPN | tlb->ASID;
env->CP0_PageMask = tlb->PageMask;
@@ -1870,7 +1948,7 @@ static unsigned long v2p_mmu(target_ulong addr, int is_user)
{
int index;
target_ulong tlb_addr;
- target_phys_addr_t physaddr;
+ unsigned long physaddr;
void *retaddr;
index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
@@ -1892,12 +1970,12 @@ redo:
* to the address of simulation host (not the physical
* address of simulated OS.
*/
-target_phys_addr_t v2p(target_ulong ptr, int is_user)
+unsigned long v2p(target_ulong ptr, int is_user)
{
CPUState *saved_env;
int index;
target_ulong addr;
- target_phys_addr_t physaddr;
+ unsigned long physaddr;
saved_env = env;
env = cpu_single_env;
@@ -1907,7 +1985,7 @@ target_phys_addr_t v2p(target_ulong ptr, int is_user)
(addr & TARGET_PAGE_MASK), 0)) {
physaddr = v2p_mmu(addr, is_user);
} else {
- physaddr = (target_phys_addr_t)addr + env->tlb_table[is_user][index].addend;
+ physaddr = addr + env->tlb_table[is_user][index].addend;
}
env = saved_env;
return physaddr;
@@ -2230,6 +2308,7 @@ uint64_t helper_float_roundl_d(uint64_t fdt0)
{
uint64_t dt2;
+ set_float_exception_flags(0, &env->active_fpu.fp_status);
set_float_rounding_mode(float_round_nearest_even, &env->active_fpu.fp_status);
dt2 = float64_to_int64(fdt0, &env->active_fpu.fp_status);
RESTORE_ROUNDING_MODE;
@@ -2243,6 +2322,7 @@ uint64_t helper_float_roundl_s(uint32_t fst0)
{
uint64_t dt2;
+ set_float_exception_flags(0, &env->active_fpu.fp_status);
set_float_rounding_mode(float_round_nearest_even, &env->active_fpu.fp_status);
dt2 = float32_to_int64(fst0, &env->active_fpu.fp_status);
RESTORE_ROUNDING_MODE;
@@ -2256,6 +2336,7 @@ uint32_t helper_float_roundw_d(uint64_t fdt0)
{
uint32_t wt2;
+ set_float_exception_flags(0, &env->active_fpu.fp_status);
set_float_rounding_mode(float_round_nearest_even, &env->active_fpu.fp_status);
wt2 = float64_to_int32(fdt0, &env->active_fpu.fp_status);
RESTORE_ROUNDING_MODE;
@@ -2269,6 +2350,7 @@ uint32_t helper_float_roundw_s(uint32_t fst0)
{
uint32_t wt2;
+ set_float_exception_flags(0, &env->active_fpu.fp_status);
set_float_rounding_mode(float_round_nearest_even, &env->active_fpu.fp_status);
wt2 = float32_to_int32(fst0, &env->active_fpu.fp_status);
RESTORE_ROUNDING_MODE;
@@ -2282,6 +2364,7 @@ uint64_t helper_float_truncl_d(uint64_t fdt0)
{
uint64_t dt2;
+ set_float_exception_flags(0, &env->active_fpu.fp_status);
dt2 = float64_to_int64_round_to_zero(fdt0, &env->active_fpu.fp_status);
update_fcr31();
if (GET_FP_CAUSE(env->active_fpu.fcr31) & (FP_OVERFLOW | FP_INVALID))
@@ -2293,6 +2376,7 @@ uint64_t helper_float_truncl_s(uint32_t fst0)
{
uint64_t dt2;
+ set_float_exception_flags(0, &env->active_fpu.fp_status);
dt2 = float32_to_int64_round_to_zero(fst0, &env->active_fpu.fp_status);
update_fcr31();
if (GET_FP_CAUSE(env->active_fpu.fcr31) & (FP_OVERFLOW | FP_INVALID))
@@ -2304,6 +2388,7 @@ uint32_t helper_float_truncw_d(uint64_t fdt0)
{
uint32_t wt2;
+ set_float_exception_flags(0, &env->active_fpu.fp_status);
wt2 = float64_to_int32_round_to_zero(fdt0, &env->active_fpu.fp_status);
update_fcr31();
if (GET_FP_CAUSE(env->active_fpu.fcr31) & (FP_OVERFLOW | FP_INVALID))
@@ -2315,6 +2400,7 @@ uint32_t helper_float_truncw_s(uint32_t fst0)
{
uint32_t wt2;
+ set_float_exception_flags(0, &env->active_fpu.fp_status);
wt2 = float32_to_int32_round_to_zero(fst0, &env->active_fpu.fp_status);
update_fcr31();
if (GET_FP_CAUSE(env->active_fpu.fcr31) & (FP_OVERFLOW | FP_INVALID))
@@ -2326,6 +2412,7 @@ uint64_t helper_float_ceill_d(uint64_t fdt0)
{
uint64_t dt2;
+ set_float_exception_flags(0, &env->active_fpu.fp_status);
set_float_rounding_mode(float_round_up, &env->active_fpu.fp_status);
dt2 = float64_to_int64(fdt0, &env->active_fpu.fp_status);
RESTORE_ROUNDING_MODE;
@@ -2339,6 +2426,7 @@ uint64_t helper_float_ceill_s(uint32_t fst0)
{
uint64_t dt2;
+ set_float_exception_flags(0, &env->active_fpu.fp_status);
set_float_rounding_mode(float_round_up, &env->active_fpu.fp_status);
dt2 = float32_to_int64(fst0, &env->active_fpu.fp_status);
RESTORE_ROUNDING_MODE;
@@ -2352,6 +2440,7 @@ uint32_t helper_float_ceilw_d(uint64_t fdt0)
{
uint32_t wt2;
+ set_float_exception_flags(0, &env->active_fpu.fp_status);
set_float_rounding_mode(float_round_up, &env->active_fpu.fp_status);
wt2 = float64_to_int32(fdt0, &env->active_fpu.fp_status);
RESTORE_ROUNDING_MODE;
@@ -2365,6 +2454,7 @@ uint32_t helper_float_ceilw_s(uint32_t fst0)
{
uint32_t wt2;
+ set_float_exception_flags(0, &env->active_fpu.fp_status);
set_float_rounding_mode(float_round_up, &env->active_fpu.fp_status);
wt2 = float32_to_int32(fst0, &env->active_fpu.fp_status);
RESTORE_ROUNDING_MODE;
@@ -2378,6 +2468,7 @@ uint64_t helper_float_floorl_d(uint64_t fdt0)
{
uint64_t dt2;
+ set_float_exception_flags(0, &env->active_fpu.fp_status);
set_float_rounding_mode(float_round_down, &env->active_fpu.fp_status);
dt2 = float64_to_int64(fdt0, &env->active_fpu.fp_status);
RESTORE_ROUNDING_MODE;
@@ -2391,6 +2482,7 @@ uint64_t helper_float_floorl_s(uint32_t fst0)
{
uint64_t dt2;
+ set_float_exception_flags(0, &env->active_fpu.fp_status);
set_float_rounding_mode(float_round_down, &env->active_fpu.fp_status);
dt2 = float32_to_int64(fst0, &env->active_fpu.fp_status);
RESTORE_ROUNDING_MODE;
@@ -2404,6 +2496,7 @@ uint32_t helper_float_floorw_d(uint64_t fdt0)
{
uint32_t wt2;
+ set_float_exception_flags(0, &env->active_fpu.fp_status);
set_float_rounding_mode(float_round_down, &env->active_fpu.fp_status);
wt2 = float64_to_int32(fdt0, &env->active_fpu.fp_status);
RESTORE_ROUNDING_MODE;
@@ -2417,6 +2510,7 @@ uint32_t helper_float_floorw_s(uint32_t fst0)
{
uint32_t wt2;
+ set_float_exception_flags(0, &env->active_fpu.fp_status);
set_float_rounding_mode(float_round_down, &env->active_fpu.fp_status);
wt2 = float32_to_int32(fst0, &env->active_fpu.fp_status);
RESTORE_ROUNDING_MODE;
diff --git a/target-mips/translate.c b/target-mips/translate.c
index 853aafd..27a8df7 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -8675,7 +8675,6 @@ void cpu_reset (CPUMIPSState *env)
}
env->active_tc.PC = (int32_t)0xBFC00000;
env->CP0_Random = env->tlb->nb_tlb - 1;
- env->tlb->tlb_in_use = env->tlb->nb_tlb;
env->CP0_Wired = 0;
/* SMP not implemented */
env->CP0_EBase = 0x80000000;
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 5882f00..66529f5 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -2030,6 +2030,15 @@ static inline int tcg_gen_code_common(TCGContext *s, uint8_t *gen_code_buf,
unsigned int tpc2gpc_index = 0;
#endif // CONFIG_MEMCHECK
+#if !SUPPORT_GLOBAL_REGISTER_VARIABLE
+ printf("ERROR: This emulator is built by compiler without global register variable\n"
+ "support! Emulator reserves a register to point to target architecture state\n"
+ "for better code generation. LLVM-based compilers such as clang and llvm-gcc\n"
+ "currently don't support global register variable. Please see\n"
+ "http://source.android.com/source/initializing.html for detail.\n\n");
+ tcg_abort();
+#endif
+
#ifdef DEBUG_DISAS
if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP))) {
qemu_log("OP:\n");
diff --git a/telephony/android_modem.c b/telephony/android_modem.c
index 437035d..52d5f9c 100644
--- a/telephony/android_modem.c
+++ b/telephony/android_modem.c
@@ -2223,7 +2223,7 @@ handleSignalStrength( const char* cmd, AModem modem )
int ber = modem->ber;
rssi = (0 > rssi && rssi > 31) ? 99 : rssi ;
ber = (0 > ber && ber > 7 ) ? 99 : ber;
- amodem_add_line( modem, "+CSQ: %i,%i\r\n", rssi, ber );
+ amodem_add_line( modem, "+CSQ: %i,%i,85,130,90,6,4,25,9,50,68,12\r\n", rssi, ber );
return amodem_end_line( modem );
}
diff --git a/vl-android.c b/vl-android.c
index 5a41e2d..c566d92 100644
--- a/vl-android.c
+++ b/vl-android.c
@@ -2271,7 +2271,7 @@ char *qemu_find_file(int type, const char *name)
buf = qemu_find_file_with_subdir(data_dir, "../usr/share/pc-bios/", name);
/* Finally, try this for standalone builds under external/qemu */
if (buf == NULL)
- buf = qemu_find_file_with_subdir(data_dir, "../../../prebuilt/common/pc-bios/", name);
+ buf = qemu_find_file_with_subdir(data_dir, "../../../prebuilts/qemu-kernel/x86/pc-bios/", name);
}
#endif
return buf;
@@ -3782,6 +3782,15 @@ int main(int argc, char **argv, char **envp)
}
}
+ /* Set LCD density (if required by -qemu, and AVD is missing it. */
+ if (android_op_lcd_density && !android_hw->hw_lcd_density) {
+ int density;
+ if (parse_int(android_op_lcd_density, &density) || density <= 0) {
+ PANIC("-lcd-density : %d", density);
+ }
+ hwLcd_setBootProperty(density);
+ }
+
/* Initialize camera emulation. */
android_camera_service_init();
@@ -3867,28 +3876,33 @@ int main(int argc, char **argv, char **envp)
nand_add_dev(tmp);
}
- /* qemu.gles will be read by the OpenGLES emulation libraries.
- * If set to 0, the software GLES renderer will be used as a fallback.
- * If the parameter is undefined, this means the system image runs
- * inside an emulator that doesn't support GPU emulation at all.
- */
+ /* qemu.gles will be read by the OpenGL ES emulation libraries.
+ * If set to 0, the software GL ES renderer will be used as a fallback.
+ * If the parameter is undefined, this means the system image runs
+ * inside an emulator that doesn't support GPU emulation at all.
+ *
+ * We always start the GL ES renderer so we can gather stats on the
+ * underlying GL implementation. If GL ES acceleration is disabled,
+ * we just shut it down again once we have the strings. */
{
- int gles_emul = 0;
-
- if (android_hw->hw_gpu_enabled) {
- if (android_initOpenglesEmulation() == 0) {
- gles_emul = 1;
- /* Set framebuffer change notification callback when starting
- * GLES emulation. Currently only multi-touch emulation is
- * interested in FB changes (to transmit them to the device), so
- * the callback is set within MT emulation.*/
- android_startOpenglesRenderer(android_hw->hw_lcd_width, android_hw->hw_lcd_height,
- multitouch_opengles_fb_update, NULL);
+ int qemu_gles = 0;
+ if (android_initOpenglesEmulation() == 0 &&
+ android_startOpenglesRenderer(android_hw->hw_lcd_width, android_hw->hw_lcd_height) == 0)
+ {
+ android_getOpenglesHardwareStrings(
+ android_gl_vendor, sizeof(android_gl_vendor),
+ android_gl_renderer, sizeof(android_gl_renderer),
+ android_gl_version, sizeof(android_gl_version));
+ if (android_hw->hw_gpu_enabled) {
+ qemu_gles = 1;
} else {
- dwarning("Could not initialize OpenglES emulation, using software renderer.");
+ android_stopOpenglesRenderer();
+ qemu_gles = 0;
}
+ } else {
+ dwarning("Could not initialize OpenglES emulation, using software renderer.");
}
- if (gles_emul) {
+ if (qemu_gles) {
stralloc_add_str(kernel_params, " qemu.gles=1");
} else {
stralloc_add_str(kernel_params, " qemu.gles=0");
@@ -4041,6 +4055,32 @@ int main(int argc, char **argv, char **envp)
}
}
+ /* Quite often (especially on older XP machines) attempts to allocate large
+ * VM RAM is going to fail, and crash the emulator. Since it's failing deep
+ * inside QEMU, it's not really possible to provide the user with a
+ * meaningful explanation for the crash. So, lets see if QEMU is going to be
+ * able to allocate requested amount of RAM, and if not, lets try to come up
+ * with a recomendation. */
+ {
+ ram_addr_t r_ram = ram_size;
+ void* alloc_check = malloc(r_ram);
+ while (alloc_check == NULL && r_ram > 1024 * 1024) {
+ /* Make it 25% less */
+ r_ram -= r_ram / 4;
+ alloc_check = malloc(r_ram);
+ }
+ if (alloc_check != NULL) {
+ free(alloc_check);
+ }
+ if (r_ram != ram_size) {
+ /* Requested RAM is too large. Report this, as well as calculated
+ * recomendation. */
+ dwarning("Requested RAM size of %dMB is too large for your environment, and is reduced to %dMB.",
+ (int)(ram_size / 1024 / 1024), (int)(r_ram / 1024 / 1024));
+ ram_size = r_ram;
+ }
+ }
+
#ifdef CONFIG_KQEMU
/* FIXME: This is a nasty hack because kqemu can't cope with dynamic
guest ram allocation. It needs to go away. */